diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..67243c6 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,76 @@ +project_name: core +builds: + - env: + - GO111MODULE=on + - CGO_ENABLED=0 + flags: + - -trimpath + - -tags=netgo + ldflags: + - "-X main.Version={{ .Env.VERSION }}" + - "-X main.Commit={{ .Env.COMMIT }}" + - "-X main.CommitDate={{ .Env.COMMIT_DATE }}" + - "-X main.TreeState={{ .Env.TREE_STATE }}" + - "-X github.com/theopenlane/core/internal/constants.CLIVersion={{ .Env.VERSION }}" + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + overrides: + - goos: darwin + goarch: arm64 + env: + - CGO_ENABLED=1 + - goos: darwin + goarch: amd64 + goamd64: v1 + env: + - CGO_ENABLED=1 + main: ./cmd/cli +archives: + - format: tar.gz # we can use binary, but it seems there's an issue where goreleaser skips the sboms + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + format_overrides: + - goos: windows + format: zip +brews: + - homepage: 'https://github.com/theopenlane/core' + description: 'core is the client CLI for interacting with the OL Core Server' + directory: Formula + license: 'Apache-2.0' + commit_author: + name: bender-core + email: bender@theopenlane.io + repository: + owner: theopenlane + name: homebrew-tap + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + test: | + system "#{bin}/core --help" +source: + enabled: true +changelog: + sort: asc + use: github +sboms: + - artifacts: archive +release: + # If set to auto, will mark the release as not ready for production + # in case there is an indicator for this in the tag e.g. v1.0.0-rc1 + prerelease: auto + github: + owner: theopenlane + name: core +# This section defines how and which artifacts we want to sign for the release. +signs: + - cmd: cosign + args: + - "sign-blob" + - "--output-signature=${signature}" + - "${artifact}" + - "--yes" # needed on cosign >= 2.0.0 + artifacts: archive + output: true diff --git a/README.md b/README.md new file mode 100644 index 0000000..e00dfae --- /dev/null +++ b/README.md @@ -0,0 +1,101 @@ +
+ +[![Go Report Card](https://goreportcard.com/badge/github.com/theopenlane/core)](https://goreportcard.com/report/github.com/theopenlane/core) +[![Build status](https://badge.buildkite.com/a3a38b934ca2bb7fc771e19bc5a986a1452fa2962e4e1c63bf.svg?branch=main)](https://buildkite.com/theopenlane/core) +[![Go Reference](https://pkg.go.dev/badge/github.com/theopenlane/core.svg)](https://pkg.go.dev/github.com/theopenlane/core) +[![License: Apache 2.0](https://img.shields.io/badge/License-Apache2.0-brightgreen.svg)](https://opensource.org/licenses/Apache-2.0) + +
+ +This repository houses the core server and orchestration elements which are at the heart of the [OpenLane](https://theopenlane.io) cloud service. We have no plans to ever gate / silo elements of the code that may fall under our "enterprise licensing" (or any other commercial license we offer) and intend to keep the code Apache 2.0 licensed and free for use, forever. Given that, if you find value in anything we're doing here, our cloud services, or use this software yourself (for any purpose) - don't be afraid to become a contributor! If you have any questions please reach out to `contribute@theopenlane.io`. + +## Features + +At it's core, this repo is a collection of services built on top of an entity framework which allows us to: +- Model database schemas as graph structures +- Define schemas as programmatic go code +- Execute complex database queries and graph traversals easily +- Extend and customize using templates and code generation utilities +- Type-safe resolvers and GraphQL schema stitching +- Code generated audit / history tables for defined schemas + +On top of this powerful core we also have an incredible amount of pluggable, extensible services: +- Authentication: we today support password, OAuth2 / Social login providers (Github, Google), Passkeys as well as standard OIDC Discovery flows +- Multi-factor: built-in 2FA mechanisms, TOTP +- Authorization: extensible and flexible permissions constructs via openFGA based on Google Zanzibar +- Session Management: built-in session management with JWKS key validation, encrypted cookies and sessions +- Robust Middleware: cache control, CORS, Rate Limiting, transaction rollbacks, and more +- Queuing and Scheduling: Task management and scheduling with Marionette +- External Storage Providers: store data in AWS S3, Google GCS, or locally +- External Database Providers: Leverage Turso, or other PostgreSQL / SQLite compatible vendors and libraries +- Data Isolation and Management: Hierarchal organizations and granular permissions controls + +## Development + +Developing against this repo involves a few mandatory tools; please read up on these and familiarize yourself if you're interested in making additions or changes! + +1. [ent](https://entgo.io/) - insane entity mapping tool, definitely not an ORM but kind of an ORM (handles our relational data storage, mappings, codegen processes) +1. [atlas](https://atlasgo.io/) - Schema generation and migrations (can be disabled in lieu of migrations on disk) +1. [goose](https://github.com/pressly/goose) - Secondary database migration utility we also use for seeding data +1. [gqlgen](https://gqlgen.com/) - Code generation + GraphQL server building from from `ent` schema definitions +1. [gqlgenc](https://github.com/Yamashou/gqlgenc) - Client building utilities with GraphQL +1. [openfga](https://openfga.dev/) - Flexible authorization/permission engine inspired by Google Zanzibar +1. [echo](https://echo.labstack.com/) - High performance, extensible, minimalist Go web framework +1. [koanf](https://github.com/knadh/koanf) - Configuration management library which parses command line arguments, Go structs + creates our main configuration files + +We also leverage many secondary technologies in use, including (but not limited to!): + +1. [taskfile](https://taskfile.dev/usage/) - So much better than Make zomg +1. [redis](https://redis.io/) - in-memory datastore used for sessions, caching +1. databases: + * [postgres](https://www.postgresql.org/) + * [libsql](https://turso.tech/libsql) + * [sqlite](https://www.sqlite.org/) +1. [golangci-lint](https://github.com/golangci/golangci-lint) - an annoyingly opinionated linter +1. [buildkite](https://buildkite.com/theopenlane) - our CI system of choice (with github actions providing some intermediary support) + +Lastly we're already ourselves using (and plan to support our customers usage in our cloud service) these third party integrations: + +1. [turso/libsql](https://github.com/tursodatabase/libsql) - Turso is an edge-hosted, distributed database that's based on libSQL , an open-source and open-contribution fork of SQLite +1. [posthog](https://posthog.com/) - Product analytics +1. [sendgrid](https://sendgrid.com/en-us) - Transactional email send provider + +All of these components are bundled into our respective Docker images; for additional information / instructions, see the [contributing guide](.github/CONTRIBUTING.md) in this repository. We're constantly adding and changing things, but have tried to list all the great open source tools and projects we rely on; if you see your project (or one you use) in here and wish to list it, feel free to open a PR! + +## Dependencies + +The vast majority of behaviors of the system can be turned on or off by updating the configuration parameters found in `config`; in some instances, we've made features or integrations with third party systems which are "always on", but we're happy to receive PR's wrapping those dependencies if you are interested in running the software without them! + +### Installing Dependencies + +Setup [Taskfile](https://taskfile.dev/installation/) by following the instructions and using one of the various convenient package managers or installation scripts. After installation, you can then simply run `task install` to load the associated dependencies. Nearly everything in this repository assumes you already have a local golang environment setup so this is not included. Please see the associated documentation. + +### Updating Configuration Settings + +See the [README](/config/README.md) in the `config` directory. + +## Deploying + +The only "supported" method of deploying today is locally, but we have a WIP Helm chart which can be found [here](https://github.com/theopenlane/helm-charts) + +## Contributing + +Please read the [contributing](.github/CONTRIBUTING.md) guide as well as the [Developer Certificate of Origin](https://developercertificate.org/). You will be required to sign all commits to the The OpenLane project, so if you're unfamiliar with how to set that up, see [github's documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). + +## Licensing + +This repository contains `core` which is open source software under [Apache 2.0](LICENSE). The OpenLane is a product produced from this open source software exclusively by The Open Lane, Inc. This product is produced under our published commercial terms (which are subject to change), and any logos or trademarks in this repository or the broader [theopenlane](https://github.com/theopenlane) organization are not covered under the Apache License. + +Others are allowed to make their own distribution of this software or include this software in other commercial offerings, but cannot use any of the The OpenLane logos, trademarks, cloud services, etc. + +## Security + +We take the security of our software products and services seriously, including all of the open source code repositories managed through our Github Organizations, such as [theopenlane](https://github.com/theopenlane). If you believe you have found a security vulnerability in any of our repositories, please report it to us through coordinated disclosure. + +**Please do NOT report security vulnerabilities through public github issues, discussions, or pull requests!** + +Instead, please send an email to `security@theopenlane.io` with as much information as possible to best help us understand and resolve the issues. See the security policy attached to this repository for more details. + +## Questions? + +You can email us at `info@theopenlane.io`, open a github issue in this repository, or reach out to [matoszz](https://github.com/matoszz) directly. diff --git a/Taskfile.yaml b/Taskfile.yaml new file mode 100644 index 0000000..886f031 --- /dev/null +++ b/Taskfile.yaml @@ -0,0 +1,251 @@ +version: "3" + +includes: + cli: + taskfile: ./cmd/cli/Taskfile.yaml + dir: ./cmd/cli + docker: + taskfile: ./docker/Taskfile.yaml + dir: ./docker + aliases: [compose] + fga: + taskfile: ./fga/Taskfile.yaml + dir: ./fga + db: + taskfile: ./db/Taskfile.yaml + dir: ./db + aliases: [atlas] + config: + taskfile: ./jsonschema/Taskfile.yaml + +env: + ATLAS_SQLITE_DB_URI: "sqlite://file?mode=memory&_fk=1" + ATLAS_POSTGRES_DB_URI: "postgres:16-alpine" + TEST_DB_URL: "docker://postgres:16-alpine" + TEST_DB_CONTAINER_EXPIRY: "2" # in minutes + TEST_FGA_URL: "localhost:8080" + ENV: config + GODEBUG: gotypesalias=0 # remove once the backport fixes the types.Alias bug + +tasks: + default: + silent: true + cmds: + - task --list + + generate: + desc: a combination of the ent, graph, and gqlgen tasks which are required to fully generate the necessary graph, server, resolvers, client, etc. + cmds: + - go generate ./... + + ## Go tasks + go:lint: + desc: runs golangci-lint, the most annoying opinionated linter ever + cmds: + - golangci-lint run --config=.golangci.yaml --verbose --fast --fix + + go:test: + desc: runs and outputs results of created go tests + aliases: ['go:test:psql', 'test:psql'] + env: + TEST_DB_URL: "docker://postgres:16-alpine" + cmds: + - go test -v ./... + + go:test:libsql: + desc: runs and outputs results of created go tests + aliases: ['test:libsql'] + env: + TEST_DB_URL: "libsql://file::memory:?cache=shared" + cmds: + - go test -v ./... + + go:test:cover: + desc: runs and outputs results of created go tests with coverage + aliases: [cover] + cmds: + - go test -v ./... -coverprofile=coverage.out + - go tool cover -html=coverage.out + + go:fmt: + desc: format all go code + cmds: + - go fmt ./... + + go:tidy: + desc: Runs go mod tidy on the backend + aliases: [tidy] + cmds: + - go mod tidy + + go:build: + desc: Runs go build for the core server + cmds: + - go build -mod=mod -o core + + go:build-cli: + aliases: [buildcli] + desc: Runs go build for the core cli + cmds: + - go build -mod=mod -o core-cli ./cmd/cli + + go:all: + aliases: [go] + desc: Runs all go test and lint related tasks + cmds: + - task: go:tidy + - task: go:fmt + - task: go:lint + - task: go:test + + # dev tasks + run-dev: + dotenv: ["{{.ENV}}/.env-dev"] + desc: runs the core server in dev mode + cmds: + - task: compose:redis + - task: compose:fga + - task: compose:kafka + - task: run-api + + run-api: + dotenv: ["{{.ENV}}/.env-dev"] + desc: runs the core server in dev mode, assumes all other dependencies are running + cmds: + - go run main.go serve --debug --pretty + + pr: + desc: runs the comprehensive roll-up tasks required to ensure all files are being committed / pushed as a part of opening a PR + cmds: + - task: generate + - task: config:generate + - task: atlas:create + - task: go + - task: fga:test + + ci: + desc: a task that runs during CI + cmds: + - task: generate + - task: tidy + - "git config --global --add safe.directory /workdir" + - | + status=$(git status --porcelain) + if [ -n "$status" ]; then + echo "detected git diff after running generate; please re-run tasks" + echo "$status" + exit 1 + fi + + clean:local: + desc: cleans up core.db and core-cli local + cmds: + - "rm -f core.db" + - "rm -f core-cli" + - task: buildcli + + shell: + desc: open a new shell to launch server as a dep + cmds: + - rm -f core.db + - rm -f core-cli + - osascript -e 'tell app "Terminal" to do script "cd {{.PWD}} && task run-dev"' + vars: + PWD: + sh: pwd + + install:all: + desc: installs all dependencies for the project + aliases: [install] + cmds: + - task: install:tools + - task: brew-install + - task: local-setup + + install:tools: + desc: Installs tools from tools.go + run: once + cmds: + - echo Installing tools from tools.go + - cat tools.go | grep _ | awk -F'/' '{print $NF}' | awk -F'"' '{print "which "$1}' | sh $1 | xargs rm -f + - cat tools.go | grep _ | awk -F'"' '{print $2}' | xargs -tI % go install % + sources: + - tools.go + - go.mod + + update-brew: + desc: Update Homebrew and upgrade all packages + cmds: + - brew update && brew upgrade && brew cleanup || true + + local-setup: + desc: Setup the project dependencies + cmds: + - command -v gcloud &> /dev/null || curl https://sdk.cloud.google.com | bash + - sudo npm install jsonschema2mk --global + - sudo npm install format-graphql + - go mod download + - pre-commit install && pre-commit install-hooks + - pre-commit autoupdate + - go mod tidy && go get -u ./... &> /dev/null + - pre-commit run --show-diff-on-failure --color=always --all-files + - task: rover:install + + precommit-full: + desc: Lint the project against all files + cmds: + - pre-commit install && pre-commit install-hooks + - pre-commit autoupdate + - pre-commit run --show-diff-on-failure --color=always --all-files + + brew-install: + desc: Install workstation dependencies with Brew + cmds: + - task: update-brew + - echo "Installing {{.DEPS}} via homebrew..." + - brew install {{.DEPS}} {{.CLI_ARGS}} + - echo "Installed {{.DEPS}} via homebrew!" + deps: + - task: brew-installed + status: + - '[ -f $(brew --prefix)/bin/{{.DEPS}} ]' + vars: + DEPS: >- + age helm kubernetes-cli yq jq gomplate golangci-lint openfga/tap/fga pre-commit ariga/tap/atlas rover #magic___^_^___line + brew-installed: + silent: true + desc: check if Homebrew is installed + cmds: + - '[ -x "$(command -v brew)" ] || (echo "Homebrew is not installed, please install it from https://brew.sh" && exit 1)' + + go:dist: + desc: Downloads a Golang distribution + silent: true + vars: + GO_VERSION: + sh: curl -sk "https://go.dev/VERSION?m=text" | head -n 1 | sed 's/go//g' + GO_URL: https://go.dev/dl/go{{.GO_VERSION}}.darwin-arm64.tar.gz + cmds: + - test -d /usr/local/go-{{.GO_VERSION}} || curl -L -o go{{.GO_VERSION}}.darwin-arm64.tar.gz {{.GO_URL}} && sudo tar -C /usr/local -xzf go{{.GO_VERSION}}.darwin-arm64.tar.gz + status: + - test -d /usr/local/go-{{.GO_VERSION}} + + rover: + aliases: + - docker:rover # adding for backwards compatibility + desc: launches an interactive browser to navigate the configured graph schema + cmds: + - 'open "http://localhost:4000"' + - rover dev --skip-update-check --skip-update -u http://localhost:17608/query -s schema.graphql -n core --elv2-license=accept + + rover:update: + desc: updates rover, if updates are available, and launches an interactive browser to navigate the configured graph schema + cmds: + - 'open "http://localhost:4000"' + - rover dev -u http://localhost:17608/query -s schema.graphql -n core --elv2-license=accept + + rover:install: + desc: installs the rover plugins for supergraph and router + cmds: + - rover install --plugin supergraph@v2.8.2 + - rover install --plugin router@v1.50.0 diff --git a/atlas.hcl b/atlas.hcl new file mode 100644 index 0000000..f8abb3e --- /dev/null +++ b/atlas.hcl @@ -0,0 +1,15 @@ +variable "cloud_token" { + type = string + default = getenv("ATLAS_CLOUD_TOKEN") +} + +atlas { + cloud { + token = var.cloud_token + } +} + +data "remote_dir" "migrations" { + name = "core" +} + diff --git a/cmd/cli/Taskfile.yaml b/cmd/cli/Taskfile.yaml new file mode 100644 index 0000000..06ba522 --- /dev/null +++ b/cmd/cli/Taskfile.yaml @@ -0,0 +1,82 @@ +version: "3" + +tasks: + generate:all:history: + desc: generates a new cli cmd for all missing history commands from the query/ directory + vars: + SCHEMAS: + sh: ls -d ../../query/* | cut -f1 |grep history | sed -e "s/query\///" |sed -e "s/.graphql//" | sed -e "s/history/History/" | sed -e "s/..\/..\///" + cmds: + - for: {var: SCHEMAS, as: SCHEMA} + cmd: go run gencmd/generate/main.go generate --name={{ .SCHEMA }} --read-only + + generate:all:history:force: + desc: regenerates the cli cmd for all history commands from the query/ directory, this will overwrite any changes made to the generated files + vars: + SCHEMAS: + sh: ls -d ../../query/* | cut -f1 |grep history | sed -e "s/query\///" |sed -e "s/.graphql//" | sed -e "s/history/History/" | sed -e "s/..\/..\///" + cmds: + - for: {var: SCHEMAS, as: SCHEMA} + cmd: go run gencmd/generate/main.go generate --name={{ .SCHEMA }} --read-only --force + + generate: + desc: generates a new cli cmd + interactive: true + cmds: + - go run gencmd/generate/main.go generate + + generate:ro: + desc: generates a new cli cmd with only the read cmds + interactive: true + cmds: + - go run gencmd/generate/main.go generate --read-only + + org:create: + desc: creates an organization against a running local instance of the server - see the CLI help commands for other variables + aliases: [createorg] + cmds: + - go run main.go org create -n your_new_org -d "my new org again" + + user:verify: + desc: a task to register a user, parse out the token response, and submit it to the verify endpoint + aliases: [verifyuser] + cmds: + - curl http://localhost:17608/v1/verify?token={{.VERIFY_TOKEN}} + vars: + VERIFY_TOKEN: + sh: go run main.go register --email="mitb@theopenlane.io" --first-name="matt" --last-name="anderson" --password="mattisthebest1234" | jq -r .token + + login:creds: + desc: a task to login the verified user + aliases: [login] + env: + CORE_PASSWORD: mattisthebest1234 + cmds: + - go run main.go login -u mitb@theopenlane.io + + user:all: + desc: a task to register, verify, and login a new user + cmds: + - task: verifyuser + - task: login + + login:google: + desc: a task to login with google oauth + aliases: [google] + cmds: + - go run main.go login -o google + + login:github: + desc: a task to login with google oauth + aliases: [github] + cmds: + - go run main.go login -o github + + template:create: + desc: a task to create new root templates + vars: + MODELS: + sh: ls -d ../../jsonschema/models/* | cut -f5 -d'/' + cmds: + - for: {var: MODELS, as: MODEL} + cmd: go run main.go template create -n {{ .MODEL }} -t ROOTTEMPLATE --jsonconfig="../../jsonschema/models/{{ .MODEL }}/generate/{{ .MODEL }}.json" diff --git a/cmd/cli/cmd/apitokens/create.go b/cmd/cli/cmd/apitokens/create.go new file mode 100644 index 0000000..fb815ab --- /dev/null +++ b/cmd/cli/cmd/apitokens/create.go @@ -0,0 +1,71 @@ +package apitokens + +import ( + "context" + "time" + + "github.com/samber/lo" + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new api token", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the api token token") + createCmd.Flags().StringP("description", "d", "", "description of the api token") + createCmd.Flags().DurationP("expiration", "e", 0, "duration of the api token to be valid, leave empty to never expire") + createCmd.Flags().StringSlice("scopes", []string{"read", "write"}, "scopes to associate with the api token") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateAPITokenInput, err error) { + name := cmd.Config.String("name") + if name == "" { + return input, cmd.NewRequiredFieldMissingError("token name") + } + + input = openlaneclient.CreateAPITokenInput{ + Name: name, + Scopes: cmd.Config.Strings("scopes"), + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + expiration := cmd.Config.Duration("expiration") + if expiration != 0 { + input.ExpiresAt = lo.ToPtr(time.Now().Add(expiration)) + } + + return input, nil +} + +// create a new api token +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateAPIToken(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/apitokens/delete.go b/cmd/cli/cmd/apitokens/delete.go new file mode 100644 index 0000000..99d89bf --- /dev/null +++ b/cmd/cli/cmd/apitokens/delete.go @@ -0,0 +1,50 @@ +package apitokens + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing api token token", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "api token id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("token id") + } + + return id, nil +} + +// delete an existing api token in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteAPIToken(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/apitokens/doc.go b/cmd/cli/cmd/apitokens/doc.go new file mode 100644 index 0000000..6032e43 --- /dev/null +++ b/cmd/cli/cmd/apitokens/doc.go @@ -0,0 +1,2 @@ +// Package apitokens is our cobra cli for api token endpoints +package apitokens diff --git a/cmd/cli/cmd/apitokens/get.go b/cmd/cli/cmd/apitokens/get.go new file mode 100644 index 0000000..2694cb9 --- /dev/null +++ b/cmd/cli/cmd/apitokens/get.go @@ -0,0 +1,48 @@ +package apitokens + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get or list api tokens", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "api token id to query") +} + +// get retrieves api tokens from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + tokenID := cmd.Config.String("id") + + // if an api token ID is provided, filter on that api token, otherwise get all + if tokenID == "" { + tokens, err := client.GetAllAPITokens(ctx) + cobra.CheckErr(err) + + return consoleOutput(tokens) + } + + token, err := client.GetAPITokenByID(ctx, tokenID) + cobra.CheckErr(err) + + return consoleOutput(token) +} diff --git a/cmd/cli/cmd/apitokens/root.go b/cmd/cli/cmd/apitokens/root.go new file mode 100644 index 0000000..1ae2aa4 --- /dev/null +++ b/cmd/cli/cmd/apitokens/root.go @@ -0,0 +1,108 @@ +package apitokens + +import ( + "encoding/json" + "strings" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base cmd command when called without any subcommands +var command = &cobra.Command{ + Use: "token", + Short: "the subcommands for working with api tokens", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllAPITokens: + var nodes []*openlaneclient.GetAllAPITokens_APITokens_Edges_Node + + for _, i := range v.APITokens.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetAPITokenByID: + e = v.APIToken + case *openlaneclient.CreateAPIToken: + e = v.CreateAPIToken.APIToken + case *openlaneclient.UpdateAPIToken: + e = v.UpdateAPIToken.APIToken + case *openlaneclient.DeleteAPIToken: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.APIToken + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.APIToken + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.APIToken) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Token", "Scopes", "LastUsedAt", "ExpiresAt") + + for _, i := range out { + lastUsed := "never" + if i.LastUsedAt != nil { + lastUsed = i.LastUsedAt.String() + } + + expiresAt := "never" + if i.ExpiresAt != nil { + expiresAt = i.ExpiresAt.String() + } + + writer.AddRow(i.ID, i.Name, i.Token, strings.Join(i.Scopes, ", "), lastUsed, expiresAt) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteAPIToken) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteAPIToken.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/apitokens/update.go b/cmd/cli/cmd/apitokens/update.go new file mode 100644 index 0000000..2a13b32 --- /dev/null +++ b/cmd/cli/cmd/apitokens/update.go @@ -0,0 +1,70 @@ +package apitokens + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an api token token", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "api token id to update") + updateCmd.Flags().StringP("name", "n", "", "name of the api token token") + updateCmd.Flags().StringP("description", "d", "", "description of the api token") + updateCmd.Flags().StringSlice("scopes", []string{}, "scopes to add to the api token") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateAPITokenInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("token id") + } + + // Craft update input + name := cmd.Config.String("name") + if name != "" { + input.Name = &name + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + scopes := cmd.Config.Strings("scopes") + if len(scopes) > 0 { + input.Scopes = scopes + } + + return id, input, nil +} + +// update an existing api token +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateAPIToken(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/client.go b/cmd/cli/cmd/client.go new file mode 100644 index 0000000..adcd183 --- /dev/null +++ b/cmd/cli/cmd/client.go @@ -0,0 +1,274 @@ +package cmd + +import ( + "context" + "fmt" + "net/url" + "os" + "path" + + "github.com/99designs/keyring" + "golang.org/x/oauth2" + + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/core/pkg/tokens" +) + +const ( + serviceName = "core" + accessTokenKey = "open_lane_token" + refreshTokenKey = "open_lane_refresh_token" // nolint:gosec + sessionKey = "open_lane_session" +) + +// SetupClientWithAuth will setup the OpenLane client with the the bearer token passed in the Authorization header +// and the session cookie passed in the Cookie header. If the token is expired, it will be refreshed. +// The token and session will be stored in the keyring for future requests +func SetupClientWithAuth(ctx context.Context) (*openlaneclient.OpenLaneClient, error) { + // setup interceptors + token, session, err := GetTokenFromKeyring(ctx) + if err != nil { + return nil, err + } + + expired, err := tokens.IsExpired(token.AccessToken) + if err != nil { + return nil, err + } + + // refresh and store the new token pair if the existing access token + // is expired + if expired { + // refresh the token pair using the refresh token + token, err = refreshToken(ctx, token.RefreshToken) + if err != nil { + return nil, err + } + + // store the new token + if err := StoreToken(token); err != nil { + return nil, err + } + } + + config, opts, err := configureDefaultOpts() + if err != nil { + return nil, err + } + + opts = append(opts, openlaneclient.WithCredentials(openlaneclient.Authorization{ + BearerToken: token.AccessToken, + Session: session, + })) + + return openlaneclient.New(config, opts...) +} + +// SetupClient will setup the client without the Authorization header +// this is used for endpoints that do not require authentication, e.g. `v1/login` +func SetupClient(ctx context.Context) (*openlaneclient.OpenLaneClient, error) { + config, opts, err := configureDefaultOpts() + if err != nil { + return nil, err + } + + return openlaneclient.New(config, opts...) +} + +// configureDefaultOpts will setup the default options for the client +func configureDefaultOpts() (openlaneclient.Config, []openlaneclient.ClientOption, error) { + config := openlaneclient.NewDefaultConfig() + + // setup the logging interceptor + if Config.Bool("debug") { + config.Interceptors = append(config.Interceptors, openlaneclient.WithLoggingInterceptor()) + } + + endpointOpt, err := configureClientEndpoints() + if err != nil { + return config, nil, err + } + + return config, []openlaneclient.ClientOption{endpointOpt}, nil +} + +// configureClientEndpoints will setup the base URL for the client +func configureClientEndpoints() (openlaneclient.ClientOption, error) { + baseURL, err := url.Parse(RootHost) + if err != nil { + return nil, err + } + + return openlaneclient.WithBaseURL(baseURL), nil +} + +// StoreSessionCookies gets the session cookie from the cookie jar +// and stores it in the keychain for future requests +func StoreSessionCookies(client *openlaneclient.OpenLaneClient) { + session, err := client.GetSessionFromCookieJar() + if err != nil || session == "" { + fmt.Println("unable to get session from cookie jar") + + return + } + + if err := StoreSession(session); err != nil { + fmt.Println("unable to store session in keychain") + + return + } + + // store the auth cookies if they exist + StoreAuthCookies(client) +} + +// StoreAuthCookies gets the auth cookies from the cookie jar if they exist +// and stores them in the keychain for future requests +func StoreAuthCookies(client *openlaneclient.OpenLaneClient) { + token := client.GetAuthTokensFromCookieJar() + + if token == nil { + return // no auth cookies found, nothing to store + } + + if err := StoreToken(token); err != nil { + fmt.Println("unable to store auth tokens in keychain") + + return + } +} + +// GetTokenFromKeyring will return the oauth token from the keyring +// if the token is expired, but the refresh token is still valid, the +// token will be refreshed +func GetTokenFromKeyring(ctx context.Context) (*oauth2.Token, string, error) { + ring, err := GetKeyring() + if err != nil { + return nil, "", fmt.Errorf("error opening keyring: %w", err) + } + + access, err := ring.Get(accessTokenKey) + if err != nil { + return nil, "", fmt.Errorf("error fetching auth token: %w", err) + } + + refresh, err := ring.Get(refreshTokenKey) + if err != nil { + return nil, "", fmt.Errorf("error fetching refresh token: %w", err) + } + + session, err := ring.Get(sessionKey) + if err != nil { + return nil, "", fmt.Errorf("error fetching refresh token: %w", err) + } + + return &oauth2.Token{ + AccessToken: string(access.Data), + RefreshToken: string(refresh.Data), + }, string(session.Data), nil +} + +// refreshToken will refresh the oauth token using the refresh token +func refreshToken(ctx context.Context, refresh string) (*oauth2.Token, error) { + // setup http client + client, err := SetupClient(ctx) + if err != nil { + return nil, err + } + + req := models.RefreshRequest{ + RefreshToken: refresh, + } + + resp, err := client.Refresh(ctx, &req) + if err != nil { + return nil, err + } + + return &oauth2.Token{ + AccessToken: resp.AccessToken, + RefreshToken: resp.RefreshToken, + }, nil +} + +// GetKeyring will return the already loaded keyring so that we don't prompt users for passwords multiple times +func GetKeyring() (keyring.Keyring, error) { + var err error + + if userKeyringLoaded { + return userKeyring, nil + } + + cfgDir, err := os.UserConfigDir() + if err != nil { + return nil, err + } + + userKeyring, err = keyring.Open(keyring.Config{ + ServiceName: serviceName, + + // MacOS keychain + KeychainTrustApplication: true, + + // KDE Wallet + KWalletAppID: serviceName, + KWalletFolder: serviceName, + + // Windows + WinCredPrefix: serviceName, + + // Fallback encrypted file + FileDir: path.Join(cfgDir, serviceName, "keyring"), + FilePasswordFunc: keyring.TerminalPrompt, + }) + if err == nil { + userKeyringLoaded = true + } + + return userKeyring, err +} + +// StoreToken in local keyring +func StoreToken(token *oauth2.Token) error { + ring, err := GetKeyring() + if err != nil { + return fmt.Errorf("error opening keyring: %w", err) + } + + err = ring.Set(keyring.Item{ + Key: accessTokenKey, + Data: []byte(token.AccessToken), + }) + if err != nil { + return fmt.Errorf("failed saving access token: %w", err) + } + + err = ring.Set(keyring.Item{ + Key: refreshTokenKey, + Data: []byte(token.RefreshToken), + }) + if err != nil { + return fmt.Errorf("failed saving refresh token: %w", err) + } + + return nil +} + +// StoreSession in local keyring +func StoreSession(session string) error { + ring, err := GetKeyring() + if err != nil { + return fmt.Errorf("error opening keyring: %w", err) + } + + err = ring.Set(keyring.Item{ + Key: sessionKey, + Data: []byte(session), + }) + if err != nil { + return fmt.Errorf("failed saving session: %w", err) + } + + return nil +} diff --git a/cmd/cli/cmd/contact/create.go b/cmd/cli/cmd/contact/create.go new file mode 100644 index 0000000..e749434 --- /dev/null +++ b/cmd/cli/cmd/contact/create.go @@ -0,0 +1,77 @@ +package contact + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new contact", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + // command line flags for the create command + createCmd.Flags().StringP("name", "n", "", "full name of the contact") + createCmd.Flags().StringP("email", "e", "", "email address of the contact") + createCmd.Flags().StringP("phone", "p", "", "phone number of the contact") + createCmd.Flags().StringP("title", "t", "", "title of the contact") + createCmd.Flags().StringP("company", "c", "", "company of the contact") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateContactInput, err error) { + // validation of required fields for the create command + input.FullName = cmd.Config.String("name") + if input.FullName == "" { + return input, cmd.NewRequiredFieldMissingError("contact name") + } + + email := cmd.Config.String("email") + if email != "" { + input.Email = &email + } + + phone := cmd.Config.String("phone") + if phone != "" { + input.PhoneNumber = &phone + } + + title := cmd.Config.String("title") + if title != "" { + input.Title = &title + } + + company := cmd.Config.String("company") + if company != "" { + input.Company = &company + } + + return input, nil +} + +// create a new contact +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateContact(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/contact/delete.go b/cmd/cli/cmd/contact/delete.go new file mode 100644 index 0000000..34e9ebd --- /dev/null +++ b/cmd/cli/cmd/contact/delete.go @@ -0,0 +1,50 @@ +package contact + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing contact", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "contact id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("contact id") + } + + return id, nil +} + +// delete an existing contact in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteContact(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/contact/doc.go b/cmd/cli/cmd/contact/doc.go new file mode 100644 index 0000000..894d71a --- /dev/null +++ b/cmd/cli/cmd/contact/doc.go @@ -0,0 +1,2 @@ +// Package contact is our cobra cli for contact endpoints +package contact diff --git a/cmd/cli/cmd/contact/get.go b/cmd/cli/cmd/contact/get.go new file mode 100644 index 0000000..8e166df --- /dev/null +++ b/cmd/cli/cmd/contact/get.go @@ -0,0 +1,48 @@ +package contact + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing contact", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "contact id to query") +} + +// get an existing contact in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + // filter options + id := cmd.Config.String("id") + + // if an contact ID is provided, filter on that contact, otherwise get all + if id != "" { + o, err := client.GetContactByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllContacts(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/contact/root.go b/cmd/cli/cmd/contact/root.go new file mode 100644 index 0000000..83994c3 --- /dev/null +++ b/cmd/cli/cmd/contact/root.go @@ -0,0 +1,105 @@ +package contact + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base contact command when called without any subcommands +var command = &cobra.Command{ + Use: "contact", + Short: "the subcommands for working with contacts", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the contacts in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the contacts and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllContacts: + var nodes []*openlaneclient.GetAllContacts_Contacts_Edges_Node + + for _, i := range v.Contacts.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetContacts: + var nodes []*openlaneclient.GetContacts_Contacts_Edges_Node + + for _, i := range v.Contacts.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetContactByID: + e = v.Contact + case *openlaneclient.CreateContact: + e = v.CreateContact.Contact + case *openlaneclient.UpdateContact: + e = v.UpdateContact.Contact + case *openlaneclient.DeleteContact: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Contact + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Contact + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Contact) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Status", "Company", "Title", "Email", "PhoneNumber", "Address") + for _, i := range out { + writer.AddRow(i.ID, i.FullName, i.Status.String(), *i.Company, *i.Title, *i.Email, *i.PhoneNumber, *i.Address) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteContact) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteContact.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/contact/update.go b/cmd/cli/cmd/contact/update.go new file mode 100644 index 0000000..40e8be3 --- /dev/null +++ b/cmd/cli/cmd/contact/update.go @@ -0,0 +1,84 @@ +package contact + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing contact", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "contact id to update") + + // command line flags for the update command + updateCmd.Flags().StringP("name", "n", "", "full name of the contact") + updateCmd.Flags().StringP("email", "e", "", "email address of the contact") + updateCmd.Flags().StringP("phone", "p", "", "phone number of the contact") + updateCmd.Flags().StringP("title", "t", "", "title of the contact") + updateCmd.Flags().StringP("company", "c", "", "company of the contact") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateContactInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("contact id") + } + + // validation of required fields for the update command + name := cmd.Config.String("name") + if name != "" { + input.FullName = &name + } + + email := cmd.Config.String("email") + if email != "" { + input.Email = &email + } + + phone := cmd.Config.String("phone") + if phone != "" { + input.PhoneNumber = &phone + } + + title := cmd.Config.String("title") + if title != "" { + input.Title = &title + } + + company := cmd.Config.String("company") + if company != "" { + input.Company = &company + } + + return id, input, nil +} + +// update an existing contact in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateContact(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/contacthistory/doc.go b/cmd/cli/cmd/contacthistory/doc.go new file mode 100644 index 0000000..e46b1bf --- /dev/null +++ b/cmd/cli/cmd/contacthistory/doc.go @@ -0,0 +1,2 @@ +// Package contacthistory is our cobra cli for contactHistory endpoints +package contacthistory diff --git a/cmd/cli/cmd/contacthistory/get.go b/cmd/cli/cmd/contacthistory/get.go new file mode 100644 index 0000000..4f009cd --- /dev/null +++ b/cmd/cli/cmd/contacthistory/get.go @@ -0,0 +1,49 @@ +package contacthistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing contactHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing contactHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetContactHistories(ctx, &openlaneclient.ContactHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllContactHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/contacthistory/root.go b/cmd/cli/cmd/contacthistory/root.go new file mode 100644 index 0000000..734aadc --- /dev/null +++ b/cmd/cli/cmd/contacthistory/root.go @@ -0,0 +1,87 @@ +package contacthistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base contactHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "contact-history", + Short: "the subcommands for working with contactHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the contactHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the contactHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllContactHistories: + var nodes []*openlaneclient.GetAllContactHistories_ContactHistories_Edges_Node + + for _, i := range v.ContactHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetContactHistories: + var nodes []*openlaneclient.GetContactHistories_ContactHistories_Edges_Node + + for _, i := range v.ContactHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.ContactHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.ContactHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.ContactHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/documentdatahistory/doc.go b/cmd/cli/cmd/documentdatahistory/doc.go new file mode 100644 index 0000000..e485afb --- /dev/null +++ b/cmd/cli/cmd/documentdatahistory/doc.go @@ -0,0 +1,2 @@ +// Package documentdatahistory is our cobra cli for documentDataHistory endpoints +package documentdatahistory diff --git a/cmd/cli/cmd/documentdatahistory/get.go b/cmd/cli/cmd/documentdatahistory/get.go new file mode 100644 index 0000000..1b8b789 --- /dev/null +++ b/cmd/cli/cmd/documentdatahistory/get.go @@ -0,0 +1,49 @@ +package documentdatahistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing documentDataHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing documentDataHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetDocumentDataHistories(ctx, &openlaneclient.DocumentDataHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllDocumentDataHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/documentdatahistory/root.go b/cmd/cli/cmd/documentdatahistory/root.go new file mode 100644 index 0000000..5ed8519 --- /dev/null +++ b/cmd/cli/cmd/documentdatahistory/root.go @@ -0,0 +1,87 @@ +package documentdatahistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base documentDataHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "document-data-history", + Short: "the subcommands for working with documentDataHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the documentDataHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the documentDataHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllDocumentDataHistories: + var nodes []*openlaneclient.GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node + + for _, i := range v.DocumentDataHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetDocumentDataHistories: + var nodes []*openlaneclient.GetDocumentDataHistories_DocumentDataHistories_Edges_Node + + for _, i := range v.DocumentDataHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.DocumentDataHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.DocumentDataHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.DocumentDataHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/entitlementhistory/doc.go b/cmd/cli/cmd/entitlementhistory/doc.go new file mode 100644 index 0000000..39a0954 --- /dev/null +++ b/cmd/cli/cmd/entitlementhistory/doc.go @@ -0,0 +1,2 @@ +// Package entitlementhistory is our cobra cli for entitlementHistory endpoints +package entitlementhistory diff --git a/cmd/cli/cmd/entitlementhistory/get.go b/cmd/cli/cmd/entitlementhistory/get.go new file mode 100644 index 0000000..979c29b --- /dev/null +++ b/cmd/cli/cmd/entitlementhistory/get.go @@ -0,0 +1,49 @@ +package entitlementhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing entitlementHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing entitlementHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetEntitlementHistories(ctx, &openlaneclient.EntitlementHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEntitlementHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitlementhistory/root.go b/cmd/cli/cmd/entitlementhistory/root.go new file mode 100644 index 0000000..b04d466 --- /dev/null +++ b/cmd/cli/cmd/entitlementhistory/root.go @@ -0,0 +1,87 @@ +package entitlementhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entitlementHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "entitlement-history", + Short: "the subcommands for working with entitlementHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the entitlementHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the entitlementHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntitlementHistories: + var nodes []*openlaneclient.GetAllEntitlementHistories_EntitlementHistories_Edges_Node + + for _, i := range v.EntitlementHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntitlementHistories: + var nodes []*openlaneclient.GetEntitlementHistories_EntitlementHistories_Edges_Node + + for _, i := range v.EntitlementHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EntitlementHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EntitlementHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EntitlementHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/entitlementplan/create.go b/cmd/cli/cmd/entitlementplan/create.go new file mode 100644 index 0000000..831ab4a --- /dev/null +++ b/cmd/cli/cmd/entitlementplan/create.go @@ -0,0 +1,80 @@ +package entitlementplan + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new entitlement plan", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "short name of the plan, must be unique") + createCmd.Flags().String("display-name", "", "human friendly name of the plan") + createCmd.Flags().StringP("description", "d", "", "description of the plan") + createCmd.Flags().StringP("version", "v", "", "version of the plan") + createCmd.Flags().StringSlice("tags", []string{}, "tags associated with the plan") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateEntitlementPlanInput, err error) { + name := cmd.Config.String("name") + if name == "" { + return input, cmd.NewRequiredFieldMissingError("plan name") + } + + version := cmd.Config.String("version") + if version == "" { + return input, cmd.NewRequiredFieldMissingError("version") + } + + input = openlaneclient.CreateEntitlementPlanInput{ + Name: name, + Version: version, + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + return input, nil +} + +// create a plan in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + p, err := client.CreateEntitlementPlan(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(p) +} diff --git a/cmd/cli/cmd/entitlementplan/delete.go b/cmd/cli/cmd/entitlementplan/delete.go new file mode 100644 index 0000000..489de65 --- /dev/null +++ b/cmd/cli/cmd/entitlementplan/delete.go @@ -0,0 +1,50 @@ +package entitlementplan + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing entitlement plan", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "plan id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("plan id") + } + + return id, nil +} + +// delete an entitlement plan in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + p, err := client.DeleteEntitlementPlan(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(p) +} diff --git a/cmd/cli/cmd/entitlementplan/doc.go b/cmd/cli/cmd/entitlementplan/doc.go new file mode 100644 index 0000000..894e23e --- /dev/null +++ b/cmd/cli/cmd/entitlementplan/doc.go @@ -0,0 +1,2 @@ +// Package entitlementplan is our cobra cli for entitlement plan endpoints +package entitlementplan diff --git a/cmd/cli/cmd/entitlementplan/get.go b/cmd/cli/cmd/entitlementplan/get.go new file mode 100644 index 0000000..21f1745 --- /dev/null +++ b/cmd/cli/cmd/entitlementplan/get.go @@ -0,0 +1,48 @@ +package entitlementplan + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get existing entitlement plans", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "entitlement plan id to query") +} + +// get retrieves plans from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + // if an plan ID is provided, filter on that plan, otherwise get all + if id == "" { + // get all plans, will be filtered for the authorized organization(s) + p, err := client.GetAllEntitlementPlans(ctx) + cobra.CheckErr(err) + + return consoleOutput(p) + } + + p, err := client.GetEntitlementPlanByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(p) +} diff --git a/cmd/cli/cmd/entitlementplan/root.go b/cmd/cli/cmd/entitlementplan/root.go new file mode 100644 index 0000000..295250c --- /dev/null +++ b/cmd/cli/cmd/entitlementplan/root.go @@ -0,0 +1,97 @@ +package entitlementplan + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base plan command when called without any subcommands +var command = &cobra.Command{ + Use: "plan", + Short: "the subcommands for working with entitlement plans", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the plans in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the plans in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the plans and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntitlementPlans: + var nodes []*openlaneclient.GetAllEntitlementPlans_EntitlementPlans_Edges_Node + + for _, i := range v.EntitlementPlans.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntitlementPlanByID: + e = v.EntitlementPlan + case *openlaneclient.CreateEntitlementPlan: + e = v.CreateEntitlementPlan.EntitlementPlan + case *openlaneclient.UpdateEntitlementPlan: + e = v.UpdateEntitlementPlan.EntitlementPlan + case *openlaneclient.DeleteEntitlementPlan: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var planList []openlaneclient.EntitlementPlan + + err = json.Unmarshal(s, &planList) + if err != nil { + var plan openlaneclient.EntitlementPlan + err = json.Unmarshal(s, &plan) + cobra.CheckErr(err) + + planList = append(planList, plan) + } + + tableOutput(planList) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the plans in a table format +func tableOutput(plans []openlaneclient.EntitlementPlan) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Display Name", "Description", "Version") + + for _, p := range plans { + writer.AddRow(p.ID, p.Name, *p.DisplayName, *p.Description, p.Version) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted plan in a table format +func deletedTableOutput(e *openlaneclient.DeleteEntitlementPlan) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteEntitlementPlan.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/entitlementplan/update.go b/cmd/cli/cmd/entitlementplan/update.go new file mode 100644 index 0000000..db86c63 --- /dev/null +++ b/cmd/cli/cmd/entitlementplan/update.go @@ -0,0 +1,69 @@ +package entitlementplan + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing entitlement plan", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "plan id to update") + updateCmd.Flags().String("display-name", "", "human friendly name of the plan") + updateCmd.Flags().StringP("description", "d", "", "description of the plan") + updateCmd.Flags().StringSlice("tags", []string{}, "tags associated with the plan") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateEntitlementPlanInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("plan id") + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + return id, input, nil +} + +// update an existing entitlement plan +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + p, err := client.UpdateEntitlementPlan(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(p) +} diff --git a/cmd/cli/cmd/entitlementplanfeaturehistory/doc.go b/cmd/cli/cmd/entitlementplanfeaturehistory/doc.go new file mode 100644 index 0000000..e9b41ef --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeaturehistory/doc.go @@ -0,0 +1,2 @@ +// Package entitlementplanfeaturehistory is our cobra cli for entitlementPlanFeatureHistory endpoints +package entitlementplanfeaturehistory diff --git a/cmd/cli/cmd/entitlementplanfeaturehistory/get.go b/cmd/cli/cmd/entitlementplanfeaturehistory/get.go new file mode 100644 index 0000000..d1e78cb --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeaturehistory/get.go @@ -0,0 +1,49 @@ +package entitlementplanfeaturehistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing entitlementPlanFeatureHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing entitlementPlanFeatureHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetEntitlementPlanFeatureHistories(ctx, &openlaneclient.EntitlementPlanFeatureHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEntitlementPlanFeatureHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitlementplanfeaturehistory/root.go b/cmd/cli/cmd/entitlementplanfeaturehistory/root.go new file mode 100644 index 0000000..21c4090 --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeaturehistory/root.go @@ -0,0 +1,87 @@ +package entitlementplanfeaturehistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entitlementPlanFeatureHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "entitlement-plan-feature-history", + Short: "the subcommands for working with entitlementPlanFeatureHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the entitlementPlanFeatureHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the entitlementPlanFeatureHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntitlementPlanFeatureHistories: + var nodes []*openlaneclient.GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node + + for _, i := range v.EntitlementPlanFeatureHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntitlementPlanFeatureHistories: + var nodes []*openlaneclient.GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node + + for _, i := range v.EntitlementPlanFeatureHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EntitlementPlanFeatureHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EntitlementPlanFeatureHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EntitlementPlanFeatureHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/entitlementplanfeatures/create.go b/cmd/cli/cmd/entitlementplanfeatures/create.go new file mode 100644 index 0000000..9192eee --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeatures/create.go @@ -0,0 +1,91 @@ +package entitlementplanfeatures + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new entitlement plan feature", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("plan-id", "p", "", "plan id to use for the plan feature") + createCmd.Flags().StringP("feature-id", "f", "", "feature id to use for the plan feature") + + // fields for the plan feature metadata + createCmd.Flags().StringP("limit-type", "t", "", "limit type for the plan feature, e.g. requests, storage, etc.") + createCmd.Flags().Int64P("limit", "l", 0, "limit value for the plan feature") + + createCmd.Flags().StringSlice("tags", []string{}, "tags associated with the plan") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateEntitlementPlanFeatureInput, err error) { + planID := cmd.Config.String("plan-id") + if planID == "" { + return input, cmd.NewRequiredFieldMissingError("plan id") + } + + featureID := cmd.Config.String("feature-id") + if featureID == "" { + return input, cmd.NewRequiredFieldMissingError("feature id") + } + + input = openlaneclient.CreateEntitlementPlanFeatureInput{ + PlanID: planID, + FeatureID: featureID, + } + + limitType := cmd.Config.String("limit-type") + limit := cmd.Config.Int64("limit") + + if limitType == "" && limit > 0 { + return input, cmd.NewRequiredFieldMissingError("limit type") + } + + if limitType != "" && limit == 0 { + return input, cmd.NewRequiredFieldMissingError("limit") + } + + if limitType != "" && limit > 0 { + input.Metadata = map[string]interface{}{ + "limit_type": limitType, + "limit": limit, + } + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + return input, nil +} + +// create a new plan feature in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + f, err := client.CreateEntitlementPlanFeature(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(f) +} diff --git a/cmd/cli/cmd/entitlementplanfeatures/delete.go b/cmd/cli/cmd/entitlementplanfeatures/delete.go new file mode 100644 index 0000000..99d0b41 --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeatures/delete.go @@ -0,0 +1,50 @@ +package entitlementplanfeatures + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing plan feature", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "plan feature id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("plan feature id") + } + + return id, nil +} + +// delete a plan feature in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + f, err := client.DeleteEntitlementPlanFeature(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(f) +} diff --git a/cmd/cli/cmd/entitlementplanfeatures/doc.go b/cmd/cli/cmd/entitlementplanfeatures/doc.go new file mode 100644 index 0000000..72976ea --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeatures/doc.go @@ -0,0 +1,2 @@ +// Package entitlementplanfeatures is our cobra cli for plan feature endpoints +package entitlementplanfeatures diff --git a/cmd/cli/cmd/entitlementplanfeatures/get.go b/cmd/cli/cmd/entitlementplanfeatures/get.go new file mode 100644 index 0000000..e3b7c14 --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeatures/get.go @@ -0,0 +1,48 @@ +package entitlementplanfeatures + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get existing plan features", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "feature id to query") +} + +// get retrieves plan features from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + // if an feature ID is provided, filter on that feature, otherwise get all + if id == "" { + // get all features, will be filtered for the authorized organization(s) + out, err := client.GetAllEntitlementPlanFeatures(ctx) + cobra.CheckErr(err) + + return consoleOutput(out) + } + + out, err := client.GetEntitlementPlanFeatureByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(out) +} diff --git a/cmd/cli/cmd/entitlementplanfeatures/root.go b/cmd/cli/cmd/entitlementplanfeatures/root.go new file mode 100644 index 0000000..b98e28e --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeatures/root.go @@ -0,0 +1,119 @@ +package entitlementplanfeatures + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base feature command when called without any subcommands +var command = &cobra.Command{ + Use: "plan-feature", + Short: "the subcommands for working with entitlement plan features", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the planFeatures in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntitlementPlanFeatures: + var nodes []*openlaneclient.GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node + + for _, i := range v.EntitlementPlanFeatures.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntitlementPlanFeatureByID: + e = v.EntitlementPlanFeature + case *openlaneclient.CreateEntitlementPlanFeature: + e = v.CreateEntitlementPlanFeature.EntitlementPlanFeature + case *openlaneclient.UpdateEntitlementPlanFeature: + e = v.UpdateEntitlementPlanFeature.EntitlementPlanFeature + case *openlaneclient.DeleteEntitlementPlanFeature: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EntitlementPlanFeature + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EntitlementPlanFeature + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EntitlementPlanFeature) { + headers := []string{"ID", "PlanName", "FeatureName"} + + // check if the planFeatures is empty and print the headers only + if len(out) == 0 { + writer := tables.NewTableWriter(command.OutOrStdout(), headers...) + writer.Render() + + return + } + + // get the metadata keys from the first planFeature and add them to the headers + for k := range out[0].Metadata { + headers = append(headers, k) + } + + writer := tables.NewTableWriter(command.OutOrStdout(), headers...) + + for _, f := range out { + items := []interface{}{f.ID, f.Plan.Name, f.Feature.Name} + + // add the metadata values to the items + for _, v := range f.Metadata { + items = append(items, v) + } + + writer.AddRow(items...) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteEntitlementPlanFeature) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteEntitlementPlanFeature.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/entitlementplanfeatures/update.go b/cmd/cli/cmd/entitlementplanfeatures/update.go new file mode 100644 index 0000000..2c7b554 --- /dev/null +++ b/cmd/cli/cmd/entitlementplanfeatures/update.go @@ -0,0 +1,80 @@ +package entitlementplanfeatures + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing entitlement plan feature", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "feature id to update") + + // fields for the plan feature metadata + updateCmd.Flags().StringP("limit-type", "t", "", "limit type for the plan feature, e.g. requests, storage, etc.") + updateCmd.Flags().Int64P("limit", "l", 0, "limit value for the plan feature") + + updateCmd.Flags().StringSlice("tags", []string{}, "tags associated with the plan") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateEntitlementPlanFeatureInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("plan feature id") + } + + limitType := cmd.Config.String("limit-type") + limit := cmd.Config.Int64("limit") + + if limitType == "" && limit > 0 { + return id, input, cmd.NewRequiredFieldMissingError("limit type") + } + + if limitType != "" && limit == 0 { + return id, input, cmd.NewRequiredFieldMissingError("limit") + } + + if limitType != "" && limit > 0 { + input.Metadata = map[string]interface{}{ + "limit_type": limitType, + "limit": limit, + } + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + return id, input, nil +} + +// update an existing plan feature in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + f, err := client.UpdateEntitlementPlanFeature(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(f) +} diff --git a/cmd/cli/cmd/entitlementplanhistory/doc.go b/cmd/cli/cmd/entitlementplanhistory/doc.go new file mode 100644 index 0000000..31a8aaf --- /dev/null +++ b/cmd/cli/cmd/entitlementplanhistory/doc.go @@ -0,0 +1,2 @@ +// Package entitlementplanhistory is our cobra cli for entitlementPlanHistory endpoints +package entitlementplanhistory diff --git a/cmd/cli/cmd/entitlementplanhistory/get.go b/cmd/cli/cmd/entitlementplanhistory/get.go new file mode 100644 index 0000000..8f85b33 --- /dev/null +++ b/cmd/cli/cmd/entitlementplanhistory/get.go @@ -0,0 +1,49 @@ +package entitlementplanhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing entitlementPlanHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing entitlementPlanHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetEntitlementPlanHistories(ctx, &openlaneclient.EntitlementPlanHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEntitlementPlanHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitlementplanhistory/root.go b/cmd/cli/cmd/entitlementplanhistory/root.go new file mode 100644 index 0000000..3e2ddc8 --- /dev/null +++ b/cmd/cli/cmd/entitlementplanhistory/root.go @@ -0,0 +1,87 @@ +package entitlementplanhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entitlementPlanHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "entitlement-plan-history", + Short: "the subcommands for working with entitlementPlanHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the entitlementPlanHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the entitlementPlanHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntitlementPlanHistories: + var nodes []*openlaneclient.GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node + + for _, i := range v.EntitlementPlanHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntitlementPlanHistories: + var nodes []*openlaneclient.GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node + + for _, i := range v.EntitlementPlanHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EntitlementPlanHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EntitlementPlanHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EntitlementPlanHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/entitlements/create.go b/cmd/cli/cmd/entitlements/create.go new file mode 100644 index 0000000..1454230 --- /dev/null +++ b/cmd/cli/cmd/entitlements/create.go @@ -0,0 +1,92 @@ +package entitlement + +import ( + "context" + "time" + + "github.com/samber/lo" + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new entitlement", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("organization_id", "o", "", "organization id associated with the entitlement") + createCmd.Flags().StringP("plan_id", "p", "", "plan_id associated with the entitlement") + createCmd.Flags().DurationP("expires_at", "e", 0, "expiration time of the entitlement") + createCmd.Flags().Bool("cancelled", false, "whether the entitlement is cancelled") + createCmd.Flags().StringP("external_customer_id", "c", "", "external customer id") + createCmd.Flags().StringP("external_subscription_id", "s", "", "external subscription id") + createCmd.Flags().StringSlice("tags", []string{}, "tags associated with the entitlement") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateEntitlementInput, err error) { + orgID := cmd.Config.String("organization_id") + if orgID == "" { + return input, cmd.NewRequiredFieldMissingError("organization id") + } + + planID := cmd.Config.String("plan_id") + if planID == "" { + return input, cmd.NewRequiredFieldMissingError("plan id") + } + + cancelled := cmd.Config.Bool("cancelled") + externalCustomerID := cmd.Config.String("external_customer_id") + externalSubscriptionID := cmd.Config.String("external_subscription_id") + expiresAt := cmd.Config.Duration("expires_at") + tags := cmd.Config.Strings("tags") + + input = openlaneclient.CreateEntitlementInput{ + OrganizationID: orgID, + PlanID: planID, + Cancelled: &cancelled, + } + + if externalCustomerID != "" { + input.ExternalCustomerID = &externalCustomerID + } + + if externalSubscriptionID != "" { + input.ExternalSubscriptionID = &externalSubscriptionID + } + + if expiresAt != 0 { + input.ExpiresAt = lo.ToPtr(time.Now().Add(expiresAt)) + } + + if len(tags) > 0 { + input.Tags = tags + } + + return input, nil +} + +// create a new entitlement in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateEntitlement(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitlements/delete.go b/cmd/cli/cmd/entitlements/delete.go new file mode 100644 index 0000000..8c0756d --- /dev/null +++ b/cmd/cli/cmd/entitlements/delete.go @@ -0,0 +1,50 @@ +package entitlement + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing entitlement", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "entitlement id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("entitlement id") + } + + return id, nil +} + +// delete an entitlement in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteEntitlement(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitlements/doc.go b/cmd/cli/cmd/entitlements/doc.go new file mode 100644 index 0000000..12b1407 --- /dev/null +++ b/cmd/cli/cmd/entitlements/doc.go @@ -0,0 +1,2 @@ +// Package entitlement is our cobra cli for entitlement endpoints +package entitlement diff --git a/cmd/cli/cmd/entitlements/get.go b/cmd/cli/cmd/entitlements/get.go new file mode 100644 index 0000000..9c7d318 --- /dev/null +++ b/cmd/cli/cmd/entitlements/get.go @@ -0,0 +1,48 @@ +package entitlement + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get existing entitlements", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "entitlement id to query") +} + +// get retrieves entitlements from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + // if an entitlement ID is provided, filter on that entitlement, otherwise get all + if id == "" { + // get all entitlements, will be filtered for the authorized organization(s) + e, err := client.GetEntitlements(ctx, nil) + cobra.CheckErr(err) + + return consoleOutput(e) + } + + e, err := client.GetEntitlementByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(e) +} diff --git a/cmd/cli/cmd/entitlements/root.go b/cmd/cli/cmd/entitlements/root.go new file mode 100644 index 0000000..bfe75c2 --- /dev/null +++ b/cmd/cli/cmd/entitlements/root.go @@ -0,0 +1,97 @@ +package entitlement + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entitlement command when called without any subcommands +var command = &cobra.Command{ + Use: "entitlement", + Short: "the subcommands for working with entitlements", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetEntitlements: + var nodes []*openlaneclient.GetEntitlements_Entitlements_Edges_Node + + for _, i := range v.Entitlements.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntitlementByID: + e = v.Entitlement + case *openlaneclient.CreateEntitlement: + e = v.CreateEntitlement.Entitlement + case *openlaneclient.UpdateEntitlement: + e = v.UpdateEntitlement.Entitlement + case *openlaneclient.DeleteEntitlement: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var entitlementList []openlaneclient.Entitlement + + err = json.Unmarshal(s, &entitlementList) + if err != nil { + var entitlement openlaneclient.Entitlement + err = json.Unmarshal(s, &entitlement) + cobra.CheckErr(err) + + entitlementList = append(entitlementList, entitlement) + } + + tableOutput(entitlementList) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the entitlements in a table format +func tableOutput(out []openlaneclient.Entitlement) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "PlanID", "PlanName", "OrganizationID", "OrganizationName", "ExpiresAt", "Expires", "Cancelled") + + for _, i := range out { + writer.AddRow(i.ID, i.Plan.ID, i.Plan.Name, i.Organization.ID, i.Organization.Name, i.ExpiresAt, i.Expires, i.Cancelled) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteEntitlement) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteEntitlement.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/entitlements/update.go b/cmd/cli/cmd/entitlements/update.go new file mode 100644 index 0000000..b83958a --- /dev/null +++ b/cmd/cli/cmd/entitlements/update.go @@ -0,0 +1,78 @@ +package entitlement + +import ( + "context" + "time" + + "github.com/samber/lo" + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing entitlement", + Long: `The entitlement update command updates an existing entitlement in the platform. +The command requires the entitlement id associated with the entitlement and the fields to update.`, + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "entitlement id to update") + updateCmd.Flags().DurationP("expires_at", "e", 0, "expiration time of the entitlement") + updateCmd.Flags().Bool("cancelled", false, "whether the entitlement is cancelled") + updateCmd.Flags().StringP("external_customer_id", "c", "", "external customer id") + updateCmd.Flags().StringP("external_subscription_id", "s", "", "external subscription id") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateEntitlementInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("entitlement id") + } + + cancelled := cmd.Config.Bool("cancelled") + externalCustomerID := cmd.Config.String("external_customer_id") + externalSubscriptionID := cmd.Config.String("external_subscription_id") + expiresAt := cmd.Config.Duration("expires_at") + + input.Cancelled = &cancelled + + if externalCustomerID != "" { + input.ExternalCustomerID = &externalCustomerID + } + + if externalSubscriptionID != "" { + input.ExternalSubscriptionID = &externalSubscriptionID + } + + if expiresAt != 0 { + input.ExpiresAt = lo.ToPtr(time.Now().Add(expiresAt)) + } + + return id, input, nil +} + +// update an existing entitlement +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateEntitlement(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entity/create.go b/cmd/cli/cmd/entity/create.go new file mode 100644 index 0000000..cf5a3ca --- /dev/null +++ b/cmd/cli/cmd/entity/create.go @@ -0,0 +1,121 @@ +package entity + +import ( + "context" + "fmt" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new entity", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + // command line flags for the create command + createCmd.Flags().StringP("name", "n", "", "name of the entity") + createCmd.Flags().StringP("display-name", "s", "", "human friendly name of the entity") + createCmd.Flags().StringP("type", "t", "", "type of the entity") + createCmd.Flags().StringP("description", "d", "", "description of the entity") + createCmd.Flags().String("status", "", "status of the entity") + createCmd.Flags().StringSlice("domains", []string{}, "domains associated with the entity") + createCmd.Flags().String("note", "", "note about the entity") +} + +// createValidation validates the required fields for the command +func createValidation(ctx context.Context) (input openlaneclient.CreateEntityInput, err error) { + // validation of required fields for the create command + name := cmd.Config.String("name") + displayName := cmd.Config.String("display-name") + + if name == "" && displayName == "" { + return input, cmd.NewRequiredFieldMissingError("entity name or display name") + } + + if name != "" { + input.Name = &name + } + + if displayName != "" { + input.DisplayName = &displayName + } + + entityType := cmd.Config.String("type") + if entityType != "" { + // get the entity type id + id, err := getEntityTypeID(ctx, entityType) + cobra.CheckErr(err) + + fmt.Println("Entity Type ID: ", id) + + input.EntityTypeID = &id + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + status := cmd.Config.String("status") + if status != "" { + input.Status = &status + } + + domains := cmd.Config.Strings("domains") + if len(domains) > 0 { + input.Domains = domains + } + + note := cmd.Config.String("note") + if note != "" { + input.Note = &openlaneclient.CreateNoteInput{ + Text: note, + } + } + + return input, nil +} + +// create a new entity +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation(ctx) + cobra.CheckErr(err) + + o, err := client.CreateEntity(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} + +func getEntityTypeID(ctx context.Context, name string) (string, error) { + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + + where := &openlaneclient.EntityTypeWhereInput{ + Name: &name, + } + + o, err := client.GetEntityTypes(ctx, where) + cobra.CheckErr(err) + + if len(o.EntityTypes.Edges) == 0 || len(o.EntityTypes.Edges) > 1 { + return "", fmt.Errorf("%w: entity type '%s' not found", cmd.ErrNotFound, name) + } + + return o.EntityTypes.Edges[0].Node.ID, nil +} diff --git a/cmd/cli/cmd/entity/delete.go b/cmd/cli/cmd/entity/delete.go new file mode 100644 index 0000000..ef9eb71 --- /dev/null +++ b/cmd/cli/cmd/entity/delete.go @@ -0,0 +1,50 @@ +package entity + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing entity", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "entity id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("entity id") + } + + return id, nil +} + +// delete an existing entity in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteEntity(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entity/doc.go b/cmd/cli/cmd/entity/doc.go new file mode 100644 index 0000000..7c3f9b3 --- /dev/null +++ b/cmd/cli/cmd/entity/doc.go @@ -0,0 +1,2 @@ +// Package entity is our cobra cli for entity endpoints +package entity diff --git a/cmd/cli/cmd/entity/get.go b/cmd/cli/cmd/entity/get.go new file mode 100644 index 0000000..5631b91 --- /dev/null +++ b/cmd/cli/cmd/entity/get.go @@ -0,0 +1,48 @@ +package entity + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing entity", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "entity id to query") +} + +// get an existing entity in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + // filter options + id := cmd.Config.String("id") + + // if an entity ID is provided, filter on that entity, otherwise get all + if id != "" { + o, err := client.GetEntityByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEntities(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entity/root.go b/cmd/cli/cmd/entity/root.go new file mode 100644 index 0000000..be4109a --- /dev/null +++ b/cmd/cli/cmd/entity/root.go @@ -0,0 +1,112 @@ +package entity + +import ( + "encoding/json" + "strings" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entity command when called without any subcommands +var command = &cobra.Command{ + Use: "entity", + Short: "the subcommands for working with entities", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the entities in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the entities and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntities: + var nodes []*openlaneclient.GetAllEntities_Entities_Edges_Node + + for _, i := range v.Entities.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntities: + var nodes []*openlaneclient.GetEntities_Entities_Edges_Node + + for _, i := range v.Entities.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntityByID: + e = v.Entity + case *openlaneclient.CreateEntity: + e = v.CreateEntity.Entity + case *openlaneclient.UpdateEntity: + e = v.UpdateEntity.Entity + case *openlaneclient.DeleteEntity: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Entity + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Entity + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Entity) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "DisplayName", "Description", "EntityType", "Status", "Domains") + + for _, i := range out { + entityTypeName := "" + if i.EntityType != nil { + entityTypeName = i.EntityType.Name + } + + writer.AddRow(i.ID, *i.Name, *i.DisplayName, *i.Description, entityTypeName, *i.Status, strings.Join(i.Domains, ", ")) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteEntity) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteEntity.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/entity/update.go b/cmd/cli/cmd/entity/update.go new file mode 100644 index 0000000..a3f5808 --- /dev/null +++ b/cmd/cli/cmd/entity/update.go @@ -0,0 +1,107 @@ +package entity + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing entity", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "entity id to update") + + // command line flags for the update command + updateCmd.Flags().StringP("name", "n", "", "name of the entity") + updateCmd.Flags().StringP("display-name", "s", "", "human friendly name of the entity") + updateCmd.Flags().StringP("type", "t", "", "type of the entity") + updateCmd.Flags().StringP("description", "d", "", "description of the entity") + updateCmd.Flags().StringSliceP("contacts", "c", []string{}, "contact IDs to associate with the entity") + updateCmd.Flags().StringSlice("domains", []string{}, "domains associated with the entity") + updateCmd.Flags().String("note", "", "add note about the entity") + updateCmd.Flags().String("status", "", "status of the entity") +} + +// updateValidation validates the required fields for the command +func updateValidation(ctx context.Context) (id string, input openlaneclient.UpdateEntityInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("entity id") + } + + // validation of required fields for the update command + name := cmd.Config.String("name") + if name != "" { + input.Name = &name + } + + entityType := cmd.Config.String("type") + if entityType != "" { + id, err := getEntityTypeID(ctx, entityType) + cobra.CheckErr(err) + + input.EntityTypeID = &id + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + contacts := cmd.Config.Strings("contacts") + if len(contacts) > 0 { + input.AddContactIDs = contacts + } + + domains := cmd.Config.Strings("domains") + if len(domains) > 0 { + input.AppendDomains = domains + } + + note := cmd.Config.String("note") + if note != "" { + input.Note = &openlaneclient.CreateNoteInput{ + Text: note, + } + } + + status := cmd.Config.String("status") + if status != "" { + input.Status = &status + } + + return id, input, nil +} + +// update an existing entity in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation(ctx) + cobra.CheckErr(err) + + o, err := client.UpdateEntity(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entityhistory/doc.go b/cmd/cli/cmd/entityhistory/doc.go new file mode 100644 index 0000000..40fdb02 --- /dev/null +++ b/cmd/cli/cmd/entityhistory/doc.go @@ -0,0 +1,2 @@ +// Package entityhistory is our cobra cli for entityHistory endpoints +package entityhistory diff --git a/cmd/cli/cmd/entityhistory/get.go b/cmd/cli/cmd/entityhistory/get.go new file mode 100644 index 0000000..62ab249 --- /dev/null +++ b/cmd/cli/cmd/entityhistory/get.go @@ -0,0 +1,49 @@ +package entityhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing entityHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing entityHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetEntityHistories(ctx, &openlaneclient.EntityHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEntityHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entityhistory/root.go b/cmd/cli/cmd/entityhistory/root.go new file mode 100644 index 0000000..8fd2023 --- /dev/null +++ b/cmd/cli/cmd/entityhistory/root.go @@ -0,0 +1,87 @@ +package entityhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entityHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "entity-history", + Short: "the subcommands for working with entityHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the entityHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the entityHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntityHistories: + var nodes []*openlaneclient.GetAllEntityHistories_EntityHistories_Edges_Node + + for _, i := range v.EntityHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntityHistories: + var nodes []*openlaneclient.GetEntityHistories_EntityHistories_Edges_Node + + for _, i := range v.EntityHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EntityHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EntityHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EntityHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/entitytype/create.go b/cmd/cli/cmd/entitytype/create.go new file mode 100644 index 0000000..2253208 --- /dev/null +++ b/cmd/cli/cmd/entitytype/create.go @@ -0,0 +1,53 @@ +package entitytype + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new entity type", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + // command line flags for the create command + createCmd.Flags().StringP("name", "n", "", "name of the entity type") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateEntityTypeInput, err error) { + // validation of required fields for the create command + input.Name = cmd.Config.String("name") + if input.Name == "" { + return input, cmd.NewRequiredFieldMissingError("entity type name") + } + + return input, nil +} + +// create a new entityType +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateEntityType(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitytype/delete.go b/cmd/cli/cmd/entitytype/delete.go new file mode 100644 index 0000000..c49a44a --- /dev/null +++ b/cmd/cli/cmd/entitytype/delete.go @@ -0,0 +1,50 @@ +package entitytype + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing entity type", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "entity type id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("entity type id") + } + + return id, nil +} + +// delete an existing entityType in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteEntityType(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitytype/doc.go b/cmd/cli/cmd/entitytype/doc.go new file mode 100644 index 0000000..f08e941 --- /dev/null +++ b/cmd/cli/cmd/entitytype/doc.go @@ -0,0 +1,2 @@ +// Package entitytype is our cobra cli for entity type endpoints +package entitytype diff --git a/cmd/cli/cmd/entitytype/get.go b/cmd/cli/cmd/entitytype/get.go new file mode 100644 index 0000000..615f1e3 --- /dev/null +++ b/cmd/cli/cmd/entitytype/get.go @@ -0,0 +1,48 @@ +package entitytype + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing entity type", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "entity type id to query") +} + +// get an existing entity type in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + // filter options + id := cmd.Config.String("id") + + // if an entityType ID is provided, filter on that entity type, otherwise get all + if id != "" { + o, err := client.GetEntityTypeByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEntityTypes(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitytype/root.go b/cmd/cli/cmd/entitytype/root.go new file mode 100644 index 0000000..a5135bc --- /dev/null +++ b/cmd/cli/cmd/entitytype/root.go @@ -0,0 +1,105 @@ +package entitytype + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entity type command when called without any subcommands +var command = &cobra.Command{ + Use: "entity-type", + Short: "the subcommands for working with entity types", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the entity types in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the entity types and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntityTypes: + var nodes []*openlaneclient.GetAllEntityTypes_EntityTypes_Edges_Node + + for _, i := range v.EntityTypes.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntityTypes: + var nodes []*openlaneclient.GetEntityTypes_EntityTypes_Edges_Node + + for _, i := range v.EntityTypes.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntityTypeByID: + e = v.EntityType + case *openlaneclient.CreateEntityType: + e = v.CreateEntityType.EntityType + case *openlaneclient.UpdateEntityType: + e = v.UpdateEntityType.EntityType + case *openlaneclient.DeleteEntityType: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EntityType + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EntityType + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EntityType) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name") + for _, i := range out { + writer.AddRow(i.ID, i.Name) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteEntityType) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteEntityType.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/entitytype/update.go b/cmd/cli/cmd/entitytype/update.go new file mode 100644 index 0000000..68f094b --- /dev/null +++ b/cmd/cli/cmd/entitytype/update.go @@ -0,0 +1,60 @@ +package entitytype + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing entity type", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "entity type id to update") + + // command line flags for the update command + updateCmd.Flags().StringP("name", "n", "", "name of the entity type") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateEntityTypeInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("entity type id") + } + + // validation of required fields for the update command + name := cmd.Config.String("name") + if name != "" { + input.Name = &name + } + + return id, input, nil +} + +// update an existing entity type in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateEntityType(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitytypehistory/doc.go b/cmd/cli/cmd/entitytypehistory/doc.go new file mode 100644 index 0000000..74e643a --- /dev/null +++ b/cmd/cli/cmd/entitytypehistory/doc.go @@ -0,0 +1,2 @@ +// Package entitytypehistory is our cobra cli for entityTypeHistory endpoints +package entitytypehistory diff --git a/cmd/cli/cmd/entitytypehistory/get.go b/cmd/cli/cmd/entitytypehistory/get.go new file mode 100644 index 0000000..cc53c33 --- /dev/null +++ b/cmd/cli/cmd/entitytypehistory/get.go @@ -0,0 +1,49 @@ +package entitytypehistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing entityTypeHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing entityTypeHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetEntityTypeHistories(ctx, &openlaneclient.EntityTypeHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEntityTypeHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/entitytypehistory/root.go b/cmd/cli/cmd/entitytypehistory/root.go new file mode 100644 index 0000000..df60e58 --- /dev/null +++ b/cmd/cli/cmd/entitytypehistory/root.go @@ -0,0 +1,87 @@ +package entitytypehistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base entityTypeHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "entity-type-history", + Short: "the subcommands for working with entityTypeHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the entityTypeHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the entityTypeHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEntityTypeHistories: + var nodes []*openlaneclient.GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node + + for _, i := range v.EntityTypeHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEntityTypeHistories: + var nodes []*openlaneclient.GetEntityTypeHistories_EntityTypeHistories_Edges_Node + + for _, i := range v.EntityTypeHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EntityTypeHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EntityTypeHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EntityTypeHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/errors.go b/cmd/cli/cmd/errors.go new file mode 100644 index 0000000..82d4204 --- /dev/null +++ b/cmd/cli/cmd/errors.go @@ -0,0 +1,44 @@ +package cmd + +import ( + "errors" + "fmt" +) + +var ( + // ErrTokenRequired is returned when no authentication token is provided + ErrTokenRequired = errors.New("ACCESS_TOKEN not set") + + // ErrInvalidRole is returned when an invalid role is provided for a member + ErrInvalidRole = errors.New("invalid role, only member and admin are allowed") + + // ErrInvalidInviteStatus is returned when an invalid status is provided for an invite + ErrInvalidInviteStatus = errors.New("invalid status, only sent, required, accepted, expired are allowed") + + // ErrUnsupportedProvider is returned when an invalid provider is specified during login + ErrUnsupportedProvider = errors.New("invalid provider, only Github and Google are supported") + + // ErrNotFound is returned when a resource is not found + ErrNotFound = errors.New("resource not found") + + // ErrSessionNotFound is returned when a session is not found + ErrSessionNotFound = errors.New("session not found") +) + +// RequiredFieldMissingError is returned when a field is required but not provided +type RequiredFieldMissingError struct { + // Field contains the required field that was missing from the input + Field string +} + +// Error returns the RequiredFieldMissingError in string format +func (e *RequiredFieldMissingError) Error() string { + return fmt.Sprintf("%s is required", e.Field) +} + +// NewRequiredFieldMissingError returns an error for a missing required field +func NewRequiredFieldMissingError(f string) *RequiredFieldMissingError { + return &RequiredFieldMissingError{ + Field: f, + } +} diff --git a/cmd/cli/cmd/eventhistory/doc.go b/cmd/cli/cmd/eventhistory/doc.go new file mode 100644 index 0000000..277779e --- /dev/null +++ b/cmd/cli/cmd/eventhistory/doc.go @@ -0,0 +1,2 @@ +// Package eventhistory is our cobra cli for eventHistory endpoints +package eventhistory diff --git a/cmd/cli/cmd/eventhistory/get.go b/cmd/cli/cmd/eventhistory/get.go new file mode 100644 index 0000000..23367fb --- /dev/null +++ b/cmd/cli/cmd/eventhistory/get.go @@ -0,0 +1,49 @@ +package eventhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing eventHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing eventHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetEventHistories(ctx, &openlaneclient.EventHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllEventHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/eventhistory/root.go b/cmd/cli/cmd/eventhistory/root.go new file mode 100644 index 0000000..cd238a5 --- /dev/null +++ b/cmd/cli/cmd/eventhistory/root.go @@ -0,0 +1,87 @@ +package eventhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base eventHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "event-history", + Short: "the subcommands for working with eventHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the eventHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the eventHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEventHistories: + var nodes []*openlaneclient.GetAllEventHistories_EventHistories_Edges_Node + + for _, i := range v.EventHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEventHistories: + var nodes []*openlaneclient.GetEventHistories_EventHistories_Edges_Node + + for _, i := range v.EventHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.EventHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.EventHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.EventHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/events/create.go b/cmd/cli/cmd/events/create.go new file mode 100644 index 0000000..27e1e95 --- /dev/null +++ b/cmd/cli/cmd/events/create.go @@ -0,0 +1,81 @@ +package events + +import ( + "context" + "encoding/json" + "os" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new event", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("type", "t", "", "type of the event") + createCmd.Flags().StringP("metadata", "m", "", "metadata for the event") + createCmd.Flags().StringSliceP("user-ids", "u", []string{}, "user id associated with the event") + createCmd.Flags().StringP("event-json", "j", "", "json payload for the template") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateEventInput, err error) { + input.EventType = cmd.Config.String("type") + if input.EventType == "" { + return input, cmd.NewRequiredFieldMissingError("type") + } + + userIDs := cmd.Config.Strings("user-ids") + if userIDs != nil { + input.UserIDs = userIDs + } + + eventJSON := cmd.Config.String("event-json") + if eventJSON != "" { + var data []byte + + if data, err = os.ReadFile(eventJSON); err != nil { + cobra.CheckErr(err) + } + + parsedMessage, err := cmd.ParseBytes(data) + cobra.CheckErr(err) + + input.Metadata = parsedMessage + } + + metadata := cmd.Config.String("metadata") + if metadata != "" { + err := json.Unmarshal([]byte(metadata), &input.Metadata) + cobra.CheckErr(err) + } + + return input, nil +} + +// create a new event +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateEvent(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/events/delete.go b/cmd/cli/cmd/events/delete.go new file mode 100644 index 0000000..b3adf69 --- /dev/null +++ b/cmd/cli/cmd/events/delete.go @@ -0,0 +1 @@ +package events diff --git a/cmd/cli/cmd/events/doc.go b/cmd/cli/cmd/events/doc.go new file mode 100644 index 0000000..b3adf69 --- /dev/null +++ b/cmd/cli/cmd/events/doc.go @@ -0,0 +1 @@ +package events diff --git a/cmd/cli/cmd/events/get.go b/cmd/cli/cmd/events/get.go new file mode 100644 index 0000000..8cce0e7 --- /dev/null +++ b/cmd/cli/cmd/events/get.go @@ -0,0 +1,46 @@ +package events + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get details of existing events", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "get a specific event by ID") +} + +// get retrieves all events or a specific event by ID +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + if id != "" { + o, err := client.GetEventByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllEvents(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/events/root.go b/cmd/cli/cmd/events/root.go new file mode 100644 index 0000000..5bd72d3 --- /dev/null +++ b/cmd/cli/cmd/events/root.go @@ -0,0 +1,97 @@ +package events + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base event command when called without any subcommands +var command = &cobra.Command{ + Use: "event", + Short: "the subcommands for working with events", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllEvents: + var nodes []*openlaneclient.GetAllEvents_Events_Edges_Node + + for _, i := range v.Events.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetEventByID: + e = v.Event + case *openlaneclient.CreateEvent: + e = v.CreateEvent.Event + case *openlaneclient.UpdateEvent: + e = v.UpdateEvent.Event + case *openlaneclient.DeleteEvent: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Event + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Event + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Event) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "EventType", "EventMetadata", "CorrelationID") + + for _, i := range out { + writer.AddRow(i.ID, i.EventType, i.Metadata, i.CorrelationID) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted plan in a table format +func deletedTableOutput(e *openlaneclient.DeleteEvent) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteEvent.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/events/update.go b/cmd/cli/cmd/events/update.go new file mode 100644 index 0000000..b3adf69 --- /dev/null +++ b/cmd/cli/cmd/events/update.go @@ -0,0 +1 @@ +package events diff --git a/cmd/cli/cmd/featurehistory/doc.go b/cmd/cli/cmd/featurehistory/doc.go new file mode 100644 index 0000000..0509b34 --- /dev/null +++ b/cmd/cli/cmd/featurehistory/doc.go @@ -0,0 +1,2 @@ +// Package featurehistory is our cobra cli for featureHistory endpoints +package featurehistory diff --git a/cmd/cli/cmd/featurehistory/get.go b/cmd/cli/cmd/featurehistory/get.go new file mode 100644 index 0000000..2482673 --- /dev/null +++ b/cmd/cli/cmd/featurehistory/get.go @@ -0,0 +1,49 @@ +package featurehistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing featureHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing featureHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetFeatureHistories(ctx, &openlaneclient.FeatureHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllFeatureHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/featurehistory/root.go b/cmd/cli/cmd/featurehistory/root.go new file mode 100644 index 0000000..69ad533 --- /dev/null +++ b/cmd/cli/cmd/featurehistory/root.go @@ -0,0 +1,87 @@ +package featurehistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base featureHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "feature-history", + Short: "the subcommands for working with featureHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the featureHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the featureHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllFeatureHistories: + var nodes []*openlaneclient.GetAllFeatureHistories_FeatureHistories_Edges_Node + + for _, i := range v.FeatureHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetFeatureHistories: + var nodes []*openlaneclient.GetFeatureHistories_FeatureHistories_Edges_Node + + for _, i := range v.FeatureHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.FeatureHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.FeatureHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.FeatureHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/features/create.go b/cmd/cli/cmd/features/create.go new file mode 100644 index 0000000..0c5ff91 --- /dev/null +++ b/cmd/cli/cmd/features/create.go @@ -0,0 +1,77 @@ +package feature + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new feature", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the feature") + createCmd.Flags().String("display-name", "", "human friendly name of the feature") + createCmd.Flags().StringP("description", "d", "", "description of the feature") + createCmd.Flags().BoolP("enabled", "e", true, "enabled status of the feature") + createCmd.Flags().StringSlice("tags", []string{}, "tags associated with the plan") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateFeatureInput, err error) { + name := cmd.Config.String("name") + if name == "" { + return input, cmd.NewRequiredFieldMissingError("feature name") + } + + enabled := cmd.Config.Bool("enabled") + + input = openlaneclient.CreateFeatureInput{ + Name: name, + Enabled: &enabled, + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + return input, nil +} + +// create a new feature in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + f, err := client.CreateFeature(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(f) +} diff --git a/cmd/cli/cmd/features/delete.go b/cmd/cli/cmd/features/delete.go new file mode 100644 index 0000000..9441d85 --- /dev/null +++ b/cmd/cli/cmd/features/delete.go @@ -0,0 +1,50 @@ +package feature + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing feature", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "feature id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("feature id") + } + + return id, nil +} + +// delete an existing feature in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + f, err := client.DeleteFeature(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(f) +} diff --git a/cmd/cli/cmd/features/doc.go b/cmd/cli/cmd/features/doc.go new file mode 100644 index 0000000..4d00535 --- /dev/null +++ b/cmd/cli/cmd/features/doc.go @@ -0,0 +1,2 @@ +// Package feature is our cobra cli for feature endpoints +package feature diff --git a/cmd/cli/cmd/features/get.go b/cmd/cli/cmd/features/get.go new file mode 100644 index 0000000..f3f7036 --- /dev/null +++ b/cmd/cli/cmd/features/get.go @@ -0,0 +1,47 @@ +package feature + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get existing features", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "feature id to query") +} + +// get an existing feature in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + if id != "" { + f, err := client.GetFeatureByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(f) + } + + // get all features, will be filtered for the authorized organization(s) + features, err := client.GetFeatures(ctx, nil) + cobra.CheckErr(err) + + return consoleOutput(features) +} diff --git a/cmd/cli/cmd/features/root.go b/cmd/cli/cmd/features/root.go new file mode 100644 index 0000000..c77d10e --- /dev/null +++ b/cmd/cli/cmd/features/root.go @@ -0,0 +1,102 @@ +package feature + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base feature command when called without any subcommands +var command = &cobra.Command{ + Use: "feature", + Short: "the subcommands for working with features", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetFeatures: + var nodes []*openlaneclient.GetFeatures_Features_Edges_Node + + for _, i := range v.Features.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetFeatureByID: + e = v.Feature + case *openlaneclient.CreateFeature: + e = v.CreateFeature.Feature + case *openlaneclient.UpdateFeature: + e = v.UpdateFeature.Feature + case *openlaneclient.DeleteFeature: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Feature + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Feature + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Feature) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "DisplayName", "Enabled", "Description") + + for _, i := range out { + desc := "" + if i.Description != nil { + desc = *i.Description + } + + writer.AddRow(i.ID, i.Name, *i.DisplayName, i.Enabled, desc) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteFeature) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteFeature.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/features/update.go b/cmd/cli/cmd/features/update.go new file mode 100644 index 0000000..2f5cb56 --- /dev/null +++ b/cmd/cli/cmd/features/update.go @@ -0,0 +1,75 @@ +package feature + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing feature", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "feature id to update") + updateCmd.Flags().String("display-name", "", "human friendly name of the feature") + updateCmd.Flags().StringP("description", "d", "", "description of the feature") + updateCmd.Flags().BoolP("enabled", "e", true, "enable or disable the feature") + updateCmd.Flags().StringSlice("tags", []string{}, "tags associated with the feature") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateFeatureInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("feature id") + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + enabled := cmd.Config.Bool("enabled") + if !enabled { + input.Enabled = &enabled + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + return id, input, nil +} + +// update an existing feature in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + f, err := client.UpdateFeature(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(f) +} diff --git a/cmd/cli/cmd/filehistory/doc.go b/cmd/cli/cmd/filehistory/doc.go new file mode 100644 index 0000000..65dd9ac --- /dev/null +++ b/cmd/cli/cmd/filehistory/doc.go @@ -0,0 +1,2 @@ +// Package filehistory is our cobra cli for fileHistory endpoints +package filehistory diff --git a/cmd/cli/cmd/filehistory/get.go b/cmd/cli/cmd/filehistory/get.go new file mode 100644 index 0000000..6e16421 --- /dev/null +++ b/cmd/cli/cmd/filehistory/get.go @@ -0,0 +1,49 @@ +package filehistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing fileHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing fileHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetFileHistories(ctx, &openlaneclient.FileHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllFileHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/filehistory/root.go b/cmd/cli/cmd/filehistory/root.go new file mode 100644 index 0000000..c39c3a8 --- /dev/null +++ b/cmd/cli/cmd/filehistory/root.go @@ -0,0 +1,87 @@ +package filehistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base fileHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "file-history", + Short: "the subcommands for working with fileHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the fileHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the fileHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllFileHistories: + var nodes []*openlaneclient.GetAllFileHistories_FileHistories_Edges_Node + + for _, i := range v.FileHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetFileHistories: + var nodes []*openlaneclient.GetFileHistories_FileHistories_Edges_Node + + for _, i := range v.FileHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.FileHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.FileHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.FileHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/group/create.go b/cmd/cli/cmd/group/create.go new file mode 100644 index 0000000..19ff9dc --- /dev/null +++ b/cmd/cli/cmd/group/create.go @@ -0,0 +1,63 @@ +package group + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new group", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the group") + createCmd.Flags().StringP("display-name", "s", "", "display name of the group") + createCmd.Flags().StringP("description", "d", "", "description of the group") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateGroupInput, err error) { + input.Name = cmd.Config.String("name") + if input.Name == "" { + return input, cmd.NewRequiredFieldMissingError("group name") + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + return input, nil +} + +// create a new group +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateGroup(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/group/delete.go b/cmd/cli/cmd/group/delete.go new file mode 100644 index 0000000..b7d1e19 --- /dev/null +++ b/cmd/cli/cmd/group/delete.go @@ -0,0 +1,50 @@ +package group + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing group", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "group id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("group id") + } + + return id, nil +} + +// delete an existing group in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteGroup(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/group/doc.go b/cmd/cli/cmd/group/doc.go new file mode 100644 index 0000000..0a18769 --- /dev/null +++ b/cmd/cli/cmd/group/doc.go @@ -0,0 +1,2 @@ +// Package group is our cobra cli for group endpoints +package group diff --git a/cmd/cli/cmd/group/get.go b/cmd/cli/cmd/group/get.go new file mode 100644 index 0000000..4c1ad50 --- /dev/null +++ b/cmd/cli/cmd/group/get.go @@ -0,0 +1,49 @@ +package group + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing group", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "group id to query") +} + +// get an existing group in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + // if an group ID is provided, filter on that group, otherwise get all + if id != "" { + o, err := client.GetGroupByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all o, will be filtered for the authorized organization(s) + o, err := client.GetAllGroups(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/group/root.go b/cmd/cli/cmd/group/root.go new file mode 100644 index 0000000..c0e7a3a --- /dev/null +++ b/cmd/cli/cmd/group/root.go @@ -0,0 +1,96 @@ +package group + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base group command when called without any subcommands +var command = &cobra.Command{ + Use: "group", + Short: "the subcommands for working with groups", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the groups in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the groups and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllGroups: + var nodes []*openlaneclient.GetAllGroups_Groups_Edges_Node + + for _, i := range v.Groups.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetGroupByID: + e = v.Group + case *openlaneclient.CreateGroup: + e = v.CreateGroup.Group + case *openlaneclient.UpdateGroup: + e = v.UpdateGroup.Group + case *openlaneclient.DeleteGroup: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Group + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Group + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Group) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Description", "Visibility", "Organization", "Members") + for _, i := range out { + writer.AddRow(i.ID, i.DisplayName, *i.Description, i.Setting.Visibility, i.Owner.DisplayName, len(i.Members)) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteGroup) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteGroup.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/group/update.go b/cmd/cli/cmd/group/update.go new file mode 100644 index 0000000..e692e55 --- /dev/null +++ b/cmd/cli/cmd/group/update.go @@ -0,0 +1,69 @@ +package group + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing group", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "group id to update") + updateCmd.Flags().StringP("name", "n", "", "name of the group") + updateCmd.Flags().StringP("display-name", "s", "", "display name of the group") + updateCmd.Flags().StringP("description", "d", "", "description of the group") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateGroupInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("group id") + } + + name := cmd.Config.String("name") + if name != "" { + input.Name = &name + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + return id, input, nil +} + +// update an existing group in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateGroup(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/grouphistory/doc.go b/cmd/cli/cmd/grouphistory/doc.go new file mode 100644 index 0000000..882e195 --- /dev/null +++ b/cmd/cli/cmd/grouphistory/doc.go @@ -0,0 +1,2 @@ +// Package grouphistory is our cobra cli for groupHistory endpoints +package grouphistory diff --git a/cmd/cli/cmd/grouphistory/get.go b/cmd/cli/cmd/grouphistory/get.go new file mode 100644 index 0000000..e612840 --- /dev/null +++ b/cmd/cli/cmd/grouphistory/get.go @@ -0,0 +1,49 @@ +package grouphistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing groupHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing groupHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetGroupHistories(ctx, &openlaneclient.GroupHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllGroupHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/grouphistory/root.go b/cmd/cli/cmd/grouphistory/root.go new file mode 100644 index 0000000..d1fbfee --- /dev/null +++ b/cmd/cli/cmd/grouphistory/root.go @@ -0,0 +1,87 @@ +package grouphistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base groupHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "group-history", + Short: "the subcommands for working with groupHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the groupHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the groupHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllGroupHistories: + var nodes []*openlaneclient.GetAllGroupHistories_GroupHistories_Edges_Node + + for _, i := range v.GroupHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetGroupHistories: + var nodes []*openlaneclient.GetGroupHistories_GroupHistories_Edges_Node + + for _, i := range v.GroupHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.GroupHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.GroupHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.GroupHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/groupmembers/create.go b/cmd/cli/cmd/groupmembers/create.go new file mode 100644 index 0000000..c96d784 --- /dev/null +++ b/cmd/cli/cmd/groupmembers/create.go @@ -0,0 +1,67 @@ +package groupmembers + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "add a user to a group", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("group-id", "g", "", "group id") + createCmd.Flags().StringP("user-id", "u", "", "user id") + createCmd.Flags().StringP("role", "r", "member", "role to assign the user (member, admin)") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateGroupMembershipInput, err error) { + input.GroupID = cmd.Config.String("group-id") + if input.GroupID == "" { + return input, cmd.NewRequiredFieldMissingError("group id") + } + + input.UserID = cmd.Config.String("user-id") + if input.UserID == "" { + return input, cmd.NewRequiredFieldMissingError("user id") + } + + // role defaults to `member` so it is not required + role := cmd.Config.String("role") + if role != "" { + r, err := cmd.GetRoleEnum(role) + cobra.CheckErr(err) + + input.Role = &r + } + + return input, nil +} + +// create adds a user to a group in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.AddUserToGroupWithRole(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupmembers/delete.go b/cmd/cli/cmd/groupmembers/delete.go new file mode 100644 index 0000000..518ada0 --- /dev/null +++ b/cmd/cli/cmd/groupmembers/delete.go @@ -0,0 +1,68 @@ +package groupmembers + +import ( + "context" + "errors" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "remove a user from a group", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("group-id", "g", "", "group id") + deleteCmd.Flags().StringP("user-id", "u", "", "user id") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (where openlaneclient.GroupMembershipWhereInput, err error) { + groupID := cmd.Config.String("group-id") + if groupID == "" { + return where, cmd.NewRequiredFieldMissingError("group id") + } + + userID := cmd.Config.String("user-id") + if userID == "" { + return where, cmd.NewRequiredFieldMissingError("user id") + } + + where.GroupID = &groupID + where.UserID = &userID + + return where, nil +} + +// delete removes a user from a group in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + where, err := deleteValidation() + cobra.CheckErr(err) + + groupMembers, err := client.GetGroupMembersByGroupID(ctx, &where) + cobra.CheckErr(err) + + if len(groupMembers.GroupMemberships.Edges) != 1 { + return errors.New("error getting existing relation") //nolint:err113 + } + + o, err := client.RemoveUserFromGroup(ctx, groupMembers.GroupMemberships.Edges[0].Node.ID) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupmembers/doc.go b/cmd/cli/cmd/groupmembers/doc.go new file mode 100644 index 0000000..f1ff75a --- /dev/null +++ b/cmd/cli/cmd/groupmembers/doc.go @@ -0,0 +1,2 @@ +// Package groupmembers is our cobra cli for group member endpoints +package groupmembers diff --git a/cmd/cli/cmd/groupmembers/get.go b/cmd/cli/cmd/groupmembers/get.go new file mode 100644 index 0000000..84b3b3b --- /dev/null +++ b/cmd/cli/cmd/groupmembers/get.go @@ -0,0 +1,48 @@ +package groupmembers + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get existing members of a group", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("group-id", "g", "", "group id to query") +} + +// get existing members of a group +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("group-id") + if id == "" { + return cmd.NewRequiredFieldMissingError("group id") + } + + where := openlaneclient.GroupMembershipWhereInput{ + GroupID: &id, + } + + o, err := client.GetGroupMembersByGroupID(ctx, &where) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupmembers/root.go b/cmd/cli/cmd/groupmembers/root.go new file mode 100644 index 0000000..27c3ecc --- /dev/null +++ b/cmd/cli/cmd/groupmembers/root.go @@ -0,0 +1,94 @@ +package groupmembers + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base groupMembers command when called without any subcommands +var command = &cobra.Command{ + Use: "group-members", + Short: "the subcommands for working with the members of a group", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetGroupMembersByGroupID: + var nodes []*openlaneclient.GetGroupMembersByGroupID_GroupMemberships_Edges_Node + + for _, i := range v.GroupMemberships.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.AddUserToGroupWithRole: + e = v.CreateGroupMembership.GroupMembership + case *openlaneclient.UpdateUserRoleInGroup: + e = v.UpdateGroupMembership.GroupMembership + case *openlaneclient.RemoveUserFromGroup: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.GroupMembership + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.GroupMembership + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.GroupMembership) { + writer := tables.NewTableWriter(command.OutOrStdout(), "UserID", "DisplayName", "FirstName", "LastName", "Email", "Role") + for _, i := range out { + writer.AddRow(i.UserID, i.User.DisplayName, *i.User.FirstName, *i.User.LastName, i.User.Email, i.Role) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.RemoveUserFromGroup) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteGroupMembership.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/groupmembers/update.go b/cmd/cli/cmd/groupmembers/update.go new file mode 100644 index 0000000..b83c3b9 --- /dev/null +++ b/cmd/cli/cmd/groupmembers/update.go @@ -0,0 +1,83 @@ +package groupmembers + +import ( + "context" + "errors" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update a user's role in a group", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("group-id", "g", "", "group id") + updateCmd.Flags().StringP("user-id", "u", "", "user id") + updateCmd.Flags().StringP("role", "r", "member", "role to assign the user (member, admin)") +} + +// updateValidation validates the required fields for the command +func updateValidation() (where openlaneclient.GroupMembershipWhereInput, input openlaneclient.UpdateGroupMembershipInput, err error) { + groupID := cmd.Config.String("group-id") + if groupID == "" { + return where, input, cmd.NewRequiredFieldMissingError("group id") + } + + userID := cmd.Config.String("user-id") + if userID == "" { + return where, input, cmd.NewRequiredFieldMissingError("user id") + } + + role := cmd.Config.String("role") + if role == "" { + return where, input, cmd.NewRequiredFieldMissingError("role") + } + + r, err := cmd.GetRoleEnum(role) + cobra.CheckErr(err) + + where = openlaneclient.GroupMembershipWhereInput{ + GroupID: &groupID, + UserID: &userID, + } + + input = openlaneclient.UpdateGroupMembershipInput{ + Role: &r, + } + + return where, input, nil +} + +// update a user's role in a group in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + where, input, err := updateValidation() + cobra.CheckErr(err) + + groupMembers, err := client.GetGroupMembersByGroupID(ctx, &where) + cobra.CheckErr(err) + + if len(groupMembers.GroupMemberships.Edges) != 1 { + return errors.New("error getting existing relation") //nolint:err113 + } + + o, err := client.UpdateUserRoleInGroup(ctx, groupMembers.GroupMemberships.Edges[0].Node.ID, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupmembershiphistory/doc.go b/cmd/cli/cmd/groupmembershiphistory/doc.go new file mode 100644 index 0000000..4078842 --- /dev/null +++ b/cmd/cli/cmd/groupmembershiphistory/doc.go @@ -0,0 +1,2 @@ +// Package groupmembershiphistory is our cobra cli for groupMembershipHistory endpoints +package groupmembershiphistory diff --git a/cmd/cli/cmd/groupmembershiphistory/get.go b/cmd/cli/cmd/groupmembershiphistory/get.go new file mode 100644 index 0000000..9e026cd --- /dev/null +++ b/cmd/cli/cmd/groupmembershiphistory/get.go @@ -0,0 +1,49 @@ +package groupmembershiphistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing groupMembershipHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing groupMembershipHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetGroupMembershipHistories(ctx, &openlaneclient.GroupMembershipHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllGroupMembershipHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupmembershiphistory/root.go b/cmd/cli/cmd/groupmembershiphistory/root.go new file mode 100644 index 0000000..77fe812 --- /dev/null +++ b/cmd/cli/cmd/groupmembershiphistory/root.go @@ -0,0 +1,87 @@ +package groupmembershiphistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base groupMembershipHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "group-membership-history", + Short: "the subcommands for working with groupMembershipHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the groupMembershipHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the groupMembershipHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllGroupMembershipHistories: + var nodes []*openlaneclient.GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node + + for _, i := range v.GroupMembershipHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetGroupMembershipHistories: + var nodes []*openlaneclient.GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node + + for _, i := range v.GroupMembershipHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.GroupMembershipHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.GroupMembershipHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.GroupMembershipHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/groupsetting/doc.go b/cmd/cli/cmd/groupsetting/doc.go new file mode 100644 index 0000000..4810a07 --- /dev/null +++ b/cmd/cli/cmd/groupsetting/doc.go @@ -0,0 +1,2 @@ +// Package groupsetting provides commands for managing group settings +package groupsetting diff --git a/cmd/cli/cmd/groupsetting/get.go b/cmd/cli/cmd/groupsetting/get.go new file mode 100644 index 0000000..f11ec19 --- /dev/null +++ b/cmd/cli/cmd/groupsetting/get.go @@ -0,0 +1,48 @@ +package groupsetting + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get group settings", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "group setting id to retrieve") +} + +// get group settings from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + // if setting ID is not provided, get settings which will automatically filter by group id + if id == "" { + o, err := client.GetAllGroupSettings(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetGroupSettingByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupsetting/root.go b/cmd/cli/cmd/groupsetting/root.go new file mode 100644 index 0000000..33c73d7 --- /dev/null +++ b/cmd/cli/cmd/groupsetting/root.go @@ -0,0 +1,83 @@ +package groupsetting + +import ( + "encoding/json" + "strings" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base group setting command when called without any subcommands +var command = &cobra.Command{ + Use: "group-setting", + Short: "the subcommands for working with the group settings", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllGroupSettings: + var nodes []*openlaneclient.GetAllGroupSettings_GroupSettings_Edges_Node + + for _, i := range v.GroupSettings.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetGroupSettingByID: + e = v.GroupSetting + case *openlaneclient.UpdateGroupSetting: + e = v.UpdateGroupSetting.GroupSetting + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.GroupSetting + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.GroupSetting + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.GroupSetting) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "GroupName", "Tags", "Visibility", "SyncToGithub", "SyncToSlack") + for _, i := range out { + writer.AddRow(i.ID, i.Group.Name, strings.Join(i.Tags, ", "), i.Visibility, *i.SyncToGithub, *i.SyncToSlack) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/groupsetting/update.go b/cmd/cli/cmd/groupsetting/update.go new file mode 100644 index 0000000..b2fead5 --- /dev/null +++ b/cmd/cli/cmd/groupsetting/update.go @@ -0,0 +1,82 @@ +package groupsetting + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing group setting", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "group setting id to update") + updateCmd.Flags().StringP("visibility", "v", "", "visibility of the group") + updateCmd.Flags().StringP("join-policy", "j", "", "join policy of the group") + updateCmd.Flags().BoolP("sync-to-slack", "s", false, "sync group members to slack") + updateCmd.Flags().BoolP("sync-to-github", "g", false, "sync group members to github") + updateCmd.Flags().StringSliceP("tags", "t", []string{}, "tags associated with the group") +} + +// updateValidation validates the input flags provided by the user +func updateValidation() (id string, input openlaneclient.UpdateGroupSettingInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("setting id") + } + + visibility := cmd.Config.String("visibility") + if visibility != "" { + input.Visibility = enums.ToGroupVisibility(visibility) + } + + joinPolicy := cmd.Config.String("join-policy") + if joinPolicy != "" { + input.JoinPolicy = enums.ToGroupJoinPolicy(joinPolicy) + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + syncToSlack := cmd.Config.Bool("sync-to-slack") + if syncToSlack { + input.SyncToSlack = &syncToSlack + } + + syncToGithub := cmd.Config.Bool("sync-to-github") + if syncToGithub { + input.SyncToGithub = &syncToGithub + } + + return id, input, nil +} + +// update an existing group setting in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateGroupSetting(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupsettinghistory/doc.go b/cmd/cli/cmd/groupsettinghistory/doc.go new file mode 100644 index 0000000..fefb8b0 --- /dev/null +++ b/cmd/cli/cmd/groupsettinghistory/doc.go @@ -0,0 +1,2 @@ +// Package groupsettinghistory is our cobra cli for groupSettingHistory endpoints +package groupsettinghistory diff --git a/cmd/cli/cmd/groupsettinghistory/get.go b/cmd/cli/cmd/groupsettinghistory/get.go new file mode 100644 index 0000000..ec83d95 --- /dev/null +++ b/cmd/cli/cmd/groupsettinghistory/get.go @@ -0,0 +1,49 @@ +package groupsettinghistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing groupSettingHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing groupSettingHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetGroupSettingHistories(ctx, &openlaneclient.GroupSettingHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllGroupSettingHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/groupsettinghistory/root.go b/cmd/cli/cmd/groupsettinghistory/root.go new file mode 100644 index 0000000..d14d4d0 --- /dev/null +++ b/cmd/cli/cmd/groupsettinghistory/root.go @@ -0,0 +1,87 @@ +package groupsettinghistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base groupSettingHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "group-setting-history", + Short: "the subcommands for working with groupSettingHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the groupSettingHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the groupSettingHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllGroupSettingHistories: + var nodes []*openlaneclient.GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node + + for _, i := range v.GroupSettingHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetGroupSettingHistories: + var nodes []*openlaneclient.GetGroupSettingHistories_GroupSettingHistories_Edges_Node + + for _, i := range v.GroupSettingHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.GroupSettingHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.GroupSettingHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.GroupSettingHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/helpers.go b/cmd/cli/cmd/helpers.go new file mode 100644 index 0000000..549f542 --- /dev/null +++ b/cmd/cli/cmd/helpers.go @@ -0,0 +1,25 @@ +package cmd + +import "github.com/theopenlane/core/pkg/enums" + +// GetRoleEnum returns the Role if valid, otherwise returns an error +func GetRoleEnum(role string) (enums.Role, error) { + r := enums.ToRole(role) + + if r.String() == enums.RoleInvalid.String() { + return *r, ErrInvalidRole + } + + return *r, nil +} + +// GetInviteStatusEnum returns the invitation status if valid, otherwise returns an error +func GetInviteStatusEnum(status string) (enums.InviteStatus, error) { + r := enums.ToInviteStatus(status) + + if r.String() == enums.InviteInvalid.String() { + return *r, ErrInvalidInviteStatus + } + + return *r, nil +} diff --git a/cmd/cli/cmd/hushhistory/doc.go b/cmd/cli/cmd/hushhistory/doc.go new file mode 100644 index 0000000..429f855 --- /dev/null +++ b/cmd/cli/cmd/hushhistory/doc.go @@ -0,0 +1,2 @@ +// Package hushhistory is our cobra cli for hushHistory endpoints +package hushhistory diff --git a/cmd/cli/cmd/hushhistory/get.go b/cmd/cli/cmd/hushhistory/get.go new file mode 100644 index 0000000..9f51187 --- /dev/null +++ b/cmd/cli/cmd/hushhistory/get.go @@ -0,0 +1,49 @@ +package hushhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing hushHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing hushHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetHushHistories(ctx, &openlaneclient.HushHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllHushHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/hushhistory/root.go b/cmd/cli/cmd/hushhistory/root.go new file mode 100644 index 0000000..ca1a5e8 --- /dev/null +++ b/cmd/cli/cmd/hushhistory/root.go @@ -0,0 +1,87 @@ +package hushhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base hushHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "hush-history", + Short: "the subcommands for working with hushHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the hushHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the hushHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllHushHistories: + var nodes []*openlaneclient.GetAllHushHistories_HushHistories_Edges_Node + + for _, i := range v.HushHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetHushHistories: + var nodes []*openlaneclient.GetHushHistories_HushHistories_Edges_Node + + for _, i := range v.HushHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.HushHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.HushHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.HushHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/integration/create.go b/cmd/cli/cmd/integration/create.go new file mode 100644 index 0000000..761ff4b --- /dev/null +++ b/cmd/cli/cmd/integration/create.go @@ -0,0 +1,71 @@ +package integrations + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new integration", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the integration") + createCmd.Flags().StringP("description", "d", "", "description of the integration") + createCmd.Flags().StringP("kind", "k", "", "the kind of integration") + createCmd.Flags().StringP("webhook-id", "w", "", "the webhook id to associate with the integration") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateIntegrationInput, err error) { + input.Name = cmd.Config.String("name") + if input.Name == "" { + return input, cmd.NewRequiredFieldMissingError("name") + } + + kind := cmd.Config.String("kind") + if kind == "" { + return input, cmd.NewRequiredFieldMissingError("kind") + } + + input.Kind = &kind + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + webhookID := cmd.Config.String("webhook-id") + if webhookID != "" { + input.WebhookIDs = append(input.WebhookIDs, webhookID) + } + + return input, nil +} + +// create an integration in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateIntegration(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/integration/delete.go b/cmd/cli/cmd/integration/delete.go new file mode 100644 index 0000000..89151fb --- /dev/null +++ b/cmd/cli/cmd/integration/delete.go @@ -0,0 +1 @@ +package integrations diff --git a/cmd/cli/cmd/integration/doc.go b/cmd/cli/cmd/integration/doc.go new file mode 100644 index 0000000..89151fb --- /dev/null +++ b/cmd/cli/cmd/integration/doc.go @@ -0,0 +1 @@ +package integrations diff --git a/cmd/cli/cmd/integration/get.go b/cmd/cli/cmd/integration/get.go new file mode 100644 index 0000000..342fc41 --- /dev/null +++ b/cmd/cli/cmd/integration/get.go @@ -0,0 +1,46 @@ +package integrations + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get details of existing integrations", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "get a specific integration by ID") +} + +// get retrieves all integrations or a specific integration by ID +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + if id != "" { + o, err := client.GetIntegrationByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllIntegrations(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/integration/root.go b/cmd/cli/cmd/integration/root.go new file mode 100644 index 0000000..2819a8b --- /dev/null +++ b/cmd/cli/cmd/integration/root.go @@ -0,0 +1,96 @@ +package integrations + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base integration command when called without any subcommands +var command = &cobra.Command{ + Use: "integration", + Short: "the subcommands for working with integrations", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllIntegrations: + var nodes []*openlaneclient.GetAllIntegrations_Integrations_Edges_Node + + for _, i := range v.Integrations.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetIntegrationByID: + e = v.Integration + case *openlaneclient.CreateIntegration: + e = v.CreateIntegration.Integration + case *openlaneclient.UpdateIntegration: + e = v.UpdateIntegration.Integration + case *openlaneclient.DeleteIntegration: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Integration + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Integration + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Integration) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Description", "Kind") + for _, i := range out { + writer.AddRow(i.ID, i.Name, *i.Description, i.Kind) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteIntegration) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteIntegration.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/integration/update.go b/cmd/cli/cmd/integration/update.go new file mode 100644 index 0000000..89151fb --- /dev/null +++ b/cmd/cli/cmd/integration/update.go @@ -0,0 +1 @@ +package integrations diff --git a/cmd/cli/cmd/integrationhistory/doc.go b/cmd/cli/cmd/integrationhistory/doc.go new file mode 100644 index 0000000..85c119c --- /dev/null +++ b/cmd/cli/cmd/integrationhistory/doc.go @@ -0,0 +1,2 @@ +// Package integrationhistory is our cobra cli for integrationHistory endpoints +package integrationhistory diff --git a/cmd/cli/cmd/integrationhistory/get.go b/cmd/cli/cmd/integrationhistory/get.go new file mode 100644 index 0000000..bd9db60 --- /dev/null +++ b/cmd/cli/cmd/integrationhistory/get.go @@ -0,0 +1,49 @@ +package integrationhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing integrationHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing integrationHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetIntegrationHistories(ctx, &openlaneclient.IntegrationHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllIntegrationHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/integrationhistory/root.go b/cmd/cli/cmd/integrationhistory/root.go new file mode 100644 index 0000000..d778e41 --- /dev/null +++ b/cmd/cli/cmd/integrationhistory/root.go @@ -0,0 +1,87 @@ +package integrationhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base integrationHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "integration-history", + Short: "the subcommands for working with integrationHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the integrationHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the integrationHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllIntegrationHistories: + var nodes []*openlaneclient.GetAllIntegrationHistories_IntegrationHistories_Edges_Node + + for _, i := range v.IntegrationHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetIntegrationHistories: + var nodes []*openlaneclient.GetIntegrationHistories_IntegrationHistories_Edges_Node + + for _, i := range v.IntegrationHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.IntegrationHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.IntegrationHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.IntegrationHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/invite/accept.go b/cmd/cli/cmd/invite/accept.go new file mode 100644 index 0000000..527c81c --- /dev/null +++ b/cmd/cli/cmd/invite/accept.go @@ -0,0 +1,66 @@ +package invite + +import ( + "context" + "encoding/json" + + "github.com/spf13/cobra" + "golang.org/x/oauth2" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/models" +) + +var acceptCmd = &cobra.Command{ + Use: "accept", + Short: "accept an invite to join an organization", + Run: func(cmd *cobra.Command, args []string) { + err := accept(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(acceptCmd) + + acceptCmd.Flags().StringP("token", "t", "", "invite token") +} + +// acceptValidation validates the input for the accept command +func acceptValidation() (input models.InviteRequest, err error) { + input.Token = cmd.Config.String("token") + if input.Token == "" { + return input, cmd.NewRequiredFieldMissingError("token") + } + + return input, nil +} + +// accept an invite to join an organization +func accept(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + + var s []byte + + input, err := acceptValidation() + cobra.CheckErr(err) + + resp, err := client.AcceptInvite(ctx, &input) + cobra.CheckErr(err) + + s, err = json.Marshal(resp) + cobra.CheckErr(err) + + if err := cmd.StoreToken(&oauth2.Token{ + AccessToken: resp.AccessToken, + RefreshToken: resp.RefreshToken, + }); err != nil { + cobra.CheckErr(err) + } + + cmd.StoreSessionCookies(client) + + return cmd.JSONPrint(s) +} diff --git a/cmd/cli/cmd/invite/create.go b/cmd/cli/cmd/invite/create.go new file mode 100644 index 0000000..0e665f4 --- /dev/null +++ b/cmd/cli/cmd/invite/create.go @@ -0,0 +1,55 @@ +package invite + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create and invitation to join a organization", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("email", "e", "", "destination email for the invitation") + createCmd.Flags().StringP("role", "r", "member", "role for the user in the organization (admin, member)") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateInviteInput, err error) { + input.Recipient = cmd.Config.String("email") + if input.Recipient == "" { + return input, cmd.NewRequiredFieldMissingError("email") + } + + input.Role = enums.ToRole(cmd.Config.String("role")) + + return input, nil +} + +// create an invitation in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateInvite(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/invite/delete.go b/cmd/cli/cmd/invite/delete.go new file mode 100644 index 0000000..aec6b25 --- /dev/null +++ b/cmd/cli/cmd/invite/delete.go @@ -0,0 +1,50 @@ +package invite + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an invitation to join an organization", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "id of the invitation to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("id") + } + + return id, nil +} + +// delete an invitation to join an organization +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteInvite(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/invite/doc.go b/cmd/cli/cmd/invite/doc.go new file mode 100644 index 0000000..8089026 --- /dev/null +++ b/cmd/cli/cmd/invite/doc.go @@ -0,0 +1,2 @@ +// Package invite creates invitation emails + tokens for external users to join an organization +package invite diff --git a/cmd/cli/cmd/invite/get.go b/cmd/cli/cmd/invite/get.go new file mode 100644 index 0000000..59c069c --- /dev/null +++ b/cmd/cli/cmd/invite/get.go @@ -0,0 +1,47 @@ +package invite + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get organization invitation(s)", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "invite id to query") +} + +// get an organization invitation(s) +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + if id != "" { + o, err := client.GetInviteByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllInvites(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/invite/root.go b/cmd/cli/cmd/invite/root.go new file mode 100644 index 0000000..78ff557 --- /dev/null +++ b/cmd/cli/cmd/invite/root.go @@ -0,0 +1,94 @@ +package invite + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base invite command when called without any subcommands +var command = &cobra.Command{ + Use: "invite", + Short: "the subcommands for working with the invitations of a organization", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllInvites: + var nodes []*openlaneclient.GetAllInvites_Invites_Edges_Node + + for _, i := range v.Invites.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetInviteByID: + e = v.Invite + case *openlaneclient.CreateInvite: + e = v.CreateInvite.Invite + case *openlaneclient.DeleteInvite: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Invite + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Invite + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Invite) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Recipient", "Role", "Status") + for _, i := range out { + writer.AddRow(i.ID, i.Recipient, i.Role, i.Status) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteInvite) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteInvite.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/login/doc.go b/cmd/cli/cmd/login/doc.go new file mode 100644 index 0000000..9c66abd --- /dev/null +++ b/cmd/cli/cmd/login/doc.go @@ -0,0 +1,2 @@ +// Package login is our cobra cli for authentication endpoints +package login diff --git a/cmd/cli/cmd/login/root.go b/cmd/cli/cmd/login/root.go new file mode 100644 index 0000000..f41b0f8 --- /dev/null +++ b/cmd/cli/cmd/login/root.go @@ -0,0 +1,87 @@ +package login + +import ( + "context" + "fmt" + "syscall" + + "github.com/spf13/cobra" + "golang.org/x/oauth2" + "golang.org/x/term" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var command = &cobra.Command{ + Use: "login", + Short: "authenticate with the API using password credentials", + Run: func(cmd *cobra.Command, args []string) { + _, err := login(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + cmd.RootCmd.AddCommand(command) + + command.Flags().StringP("username", "u", "", "username (email) to authenticate with password auth") +} + +func login(ctx context.Context) (*oauth2.Token, error) { + // setup http client + client, err := cmd.SetupClient(ctx) + cobra.CheckErr(err) + + username := cmd.Config.String("username") + if username == "" { + return nil, cmd.NewRequiredFieldMissingError("username") + } + + tokens, err := passwordAuth(ctx, client, username) + cobra.CheckErr(err) + + fmt.Println("\nAuthentication Successful!") + + err = cmd.StoreToken(tokens) + cobra.CheckErr(err) + + cmd.StoreSessionCookies(client) + + fmt.Println("auth tokens successfully stored in keychain") + + return tokens, nil +} + +func passwordAuth(ctx context.Context, client *openlaneclient.OpenLaneClient, username string) (*oauth2.Token, error) { + // read password from terminal if not set in environment variable + password := cmd.Config.String("password") + + if password == "" { + fmt.Print("Password: ") + + bytepw, err := term.ReadPassword(int(syscall.Stdin)) + if err != nil { + return nil, err + } + + password = string(bytepw) + } + + login := models.LoginRequest{ + Username: username, + Password: password, + } + + resp, err := client.Login(ctx, &login) + if err != nil { + return nil, err + } + + return &oauth2.Token{ + AccessToken: resp.AccessToken, + RefreshToken: resp.RefreshToken, + TokenType: resp.TokenType, + }, nil +} diff --git a/cmd/cli/cmd/oauthproviderhistory/doc.go b/cmd/cli/cmd/oauthproviderhistory/doc.go new file mode 100644 index 0000000..7738390 --- /dev/null +++ b/cmd/cli/cmd/oauthproviderhistory/doc.go @@ -0,0 +1,2 @@ +// Package oauthproviderhistory is our cobra cli for oauthProviderHistory endpoints +package oauthproviderhistory diff --git a/cmd/cli/cmd/oauthproviderhistory/get.go b/cmd/cli/cmd/oauthproviderhistory/get.go new file mode 100644 index 0000000..f440b15 --- /dev/null +++ b/cmd/cli/cmd/oauthproviderhistory/get.go @@ -0,0 +1,49 @@ +package oauthproviderhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing oauthProviderHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing oauthProviderHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetOauthProviderHistories(ctx, &openlaneclient.OauthProviderHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllOauthProviderHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/oauthproviderhistory/root.go b/cmd/cli/cmd/oauthproviderhistory/root.go new file mode 100644 index 0000000..f353f71 --- /dev/null +++ b/cmd/cli/cmd/oauthproviderhistory/root.go @@ -0,0 +1,87 @@ +package oauthproviderhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base oauthProviderHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "oauth-provider-history", + Short: "the subcommands for working with oauthProviderHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the oauthProviderHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the oauthProviderHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllOauthProviderHistories: + var nodes []*openlaneclient.GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node + + for _, i := range v.OauthProviderHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOauthProviderHistories: + var nodes []*openlaneclient.GetOauthProviderHistories_OauthProviderHistories_Edges_Node + + for _, i := range v.OauthProviderHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.OauthProviderHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.OauthProviderHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.OauthProviderHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/organization/create.go b/cmd/cli/cmd/organization/create.go new file mode 100644 index 0000000..dfbe2a4 --- /dev/null +++ b/cmd/cli/cmd/organization/create.go @@ -0,0 +1,78 @@ +package org + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new organization", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the organization") + createCmd.Flags().StringP("display-name", "s", "", "display name of the organization") + createCmd.Flags().StringP("description", "d", "", "description of the organization") + createCmd.Flags().StringP("parent-org-id", "p", "", "parent organization id, leave empty to create a root org") + + // TODO: https://github.com/theopenlane/core/issues/734 + // remove flag once the feature is implemented + createCmd.Flags().BoolP("dedicated-db", "D", false, "create a dedicated database for the organization") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateOrganizationInput, err error) { + input.Name = cmd.Config.String("name") + if input.Name == "" { + return input, cmd.NewRequiredFieldMissingError("organization name") + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + parentOrgID := cmd.Config.String("parent-org-id") + if parentOrgID != "" { + input.ParentID = &parentOrgID + } + + dedicatedDB := cmd.Config.Bool("dedicated-db") + if dedicatedDB { + input.DedicatedDb = &dedicatedDB + } + + return input, nil +} + +// create an organization in the platform +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateOrganization(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organization/delete.go b/cmd/cli/cmd/organization/delete.go new file mode 100644 index 0000000..51e7e53 --- /dev/null +++ b/cmd/cli/cmd/organization/delete.go @@ -0,0 +1,50 @@ +package org + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing organization", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "organization id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("id") + } + + return id, nil +} + +// delete an organization in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteOrganization(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organization/doc.go b/cmd/cli/cmd/organization/doc.go new file mode 100644 index 0000000..85e2085 --- /dev/null +++ b/cmd/cli/cmd/organization/doc.go @@ -0,0 +1,2 @@ +// Package org is our cobra cli for organization endpoints +package org diff --git a/cmd/cli/cmd/organization/get.go b/cmd/cli/cmd/organization/get.go new file mode 100644 index 0000000..f21686b --- /dev/null +++ b/cmd/cli/cmd/organization/get.go @@ -0,0 +1,48 @@ +package org + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get details of existing organization(s)", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "get a specific organization by ID") +} + +// get an organization in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + // if an org ID is provided, filter on that organization, otherwise get all + if id != "" { + o, err := client.GetOrganizationByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllOrganizations(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organization/root.go b/cmd/cli/cmd/organization/root.go new file mode 100644 index 0000000..68453d8 --- /dev/null +++ b/cmd/cli/cmd/organization/root.go @@ -0,0 +1,103 @@ +package org + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base org command when called without any subcommands +var command = &cobra.Command{ + Use: "organization", + Aliases: []string{"org"}, + Short: "the subcommands for working with the organization", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllOrganizations: + var nodes []*openlaneclient.GetAllOrganizations_Organizations_Edges_Node + + for _, i := range v.Organizations.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOrganizationByID: + e = v.Organization + case *openlaneclient.CreateOrganization: + e = v.CreateOrganization.Organization + case *openlaneclient.UpdateOrganization: + e = v.UpdateOrganization.Organization + case *openlaneclient.DeleteOrganization: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Organization + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Organization + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Organization) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Description", "PersonalOrg", "Children", "Members") + + for _, i := range out { + childrenLen := 0 + if i.Children != nil { + childrenLen = len(i.Children.Edges) + } + + writer.AddRow(i.ID, i.DisplayName, *i.Description, *i.PersonalOrg, childrenLen, len(i.Members)) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeleteOrganization) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteOrganization.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/organization/update.go b/cmd/cli/cmd/organization/update.go new file mode 100644 index 0000000..4a80194 --- /dev/null +++ b/cmd/cli/cmd/organization/update.go @@ -0,0 +1,69 @@ +package org + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing organization", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "org id to update") + updateCmd.Flags().StringP("name", "n", "", "name of the organization") + updateCmd.Flags().StringP("display-name", "s", "", "display name of the organization") + updateCmd.Flags().StringP("description", "d", "", "description of the organization") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdateOrganizationInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("organization id") + } + + name := cmd.Config.String("name") + if name != "" { + input.Name = &name + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + return id, input, nil +} + +// update an existing organization in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateOrganization(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organizationhistory/doc.go b/cmd/cli/cmd/organizationhistory/doc.go new file mode 100644 index 0000000..e5dabd2 --- /dev/null +++ b/cmd/cli/cmd/organizationhistory/doc.go @@ -0,0 +1,2 @@ +// Package organizationhistory is our cobra cli for organizationHistory endpoints +package organizationhistory diff --git a/cmd/cli/cmd/organizationhistory/get.go b/cmd/cli/cmd/organizationhistory/get.go new file mode 100644 index 0000000..9441dda --- /dev/null +++ b/cmd/cli/cmd/organizationhistory/get.go @@ -0,0 +1,49 @@ +package organizationhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing organizationHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing organizationHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetOrganizationHistories(ctx, &openlaneclient.OrganizationHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllOrganizationHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organizationhistory/root.go b/cmd/cli/cmd/organizationhistory/root.go new file mode 100644 index 0000000..0a5777b --- /dev/null +++ b/cmd/cli/cmd/organizationhistory/root.go @@ -0,0 +1,88 @@ +package organizationhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base organizationHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "organization-history", + Aliases: []string{"org-history"}, + Short: "the subcommands for working with organizationHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the organizationHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the organizationHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllOrganizationHistories: + var nodes []*openlaneclient.GetAllOrganizationHistories_OrganizationHistories_Edges_Node + + for _, i := range v.OrganizationHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOrganizationHistories: + var nodes []*openlaneclient.GetOrganizationHistories_OrganizationHistories_Edges_Node + + for _, i := range v.OrganizationHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.OrganizationHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.OrganizationHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.OrganizationHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/organizationsetting/doc.go b/cmd/cli/cmd/organizationsetting/doc.go new file mode 100644 index 0000000..e8e0142 --- /dev/null +++ b/cmd/cli/cmd/organizationsetting/doc.go @@ -0,0 +1,2 @@ +// Package orgsetting provides commands for managing organization settings +package orgsetting diff --git a/cmd/cli/cmd/organizationsetting/get.go b/cmd/cli/cmd/organizationsetting/get.go new file mode 100644 index 0000000..0b848cd --- /dev/null +++ b/cmd/cli/cmd/organizationsetting/get.go @@ -0,0 +1,48 @@ +package orgsetting + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get organization settings", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "organization setting id to retrieve") +} + +// get an existing organization setting in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + // if setting ID is not provided, get settings which will automatically filter by org id + if id == "" { + o, err := client.GetAllOrganizationSettings(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetOrganizationSettingByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organizationsetting/root.go b/cmd/cli/cmd/organizationsetting/root.go new file mode 100644 index 0000000..0032fe3 --- /dev/null +++ b/cmd/cli/cmd/organizationsetting/root.go @@ -0,0 +1,112 @@ +package orgsetting + +import ( + "encoding/json" + "strings" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base org setting command when called without any subcommands +var command = &cobra.Command{ + Use: "organization-setting", + Aliases: []string{"org-setting"}, + Short: "the subcommands for working with the organization settings", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetOrganizationSettings: + var nodes []*openlaneclient.GetOrganizationSettings_OrganizationSettings_Edges_Node + + for _, i := range v.OrganizationSettings.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetAllOrganizationSettings: + var nodes []*openlaneclient.GetAllOrganizationSettings_OrganizationSettings_Edges_Node + + for _, i := range v.OrganizationSettings.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOrganizationSettingByID: + e = v.OrganizationSetting + case *openlaneclient.UpdateOrganizationSetting: + e = v.UpdateOrganizationSetting.OrganizationSetting + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.OrganizationSetting + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.OrganizationSetting + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.OrganizationSetting) { + writer := tables.NewTableWriter(command.OutOrStdout(), + "ID", + "OrganizationName", + "BillingContact", + "BillingAddress", + "BillingEmail", + "BillingPhone", + "GeoLocation", + "TaxIdentifier", + "Tags", + "Domains", + ) + for _, i := range out { + writer.AddRow(i.ID, + i.Organization.Name, + *i.BillingContact, + *i.BillingAddress, + *i.BillingEmail, + *i.BillingPhone, + *i.GeoLocation, + *i.TaxIdentifier, + strings.Join(i.Tags, ", "), + strings.Join(i.Domains, ", ")) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/organizationsetting/update.go b/cmd/cli/cmd/organizationsetting/update.go new file mode 100644 index 0000000..b3c75fc --- /dev/null +++ b/cmd/cli/cmd/organizationsetting/update.go @@ -0,0 +1,93 @@ +package orgsetting + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing organization setting", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "org setting id to update") + updateCmd.Flags().StringSliceP("domains", "d", []string{}, "domains associated with the org") + updateCmd.Flags().StringP("billing-contact", "c", "", "billing contact for the org") + updateCmd.Flags().StringP("billing-email", "e", "", "billing email for the org") + updateCmd.Flags().StringP("billing-phone", "p", "", "billing phone for the org") + updateCmd.Flags().StringP("billing-address", "a", "", "billing address for the org") + updateCmd.Flags().StringP("tax-identifier", "x", "", "tax identifier for the org") + updateCmd.Flags().StringSliceP("tags", "t", []string{}, "tags associated with the org") +} + +// updateValidation validates the input flags provided by the user +func updateValidation() (id string, input openlaneclient.UpdateOrganizationSettingInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("setting id") + } + + billingContact := cmd.Config.String("billing-contact") + if billingContact != "" { + input.BillingContact = &billingContact + } + + billingEmail := cmd.Config.String("billing-email") + if billingEmail != "" { + input.BillingEmail = &billingEmail + } + + billingPhone := cmd.Config.String("billing-phone") + if billingPhone != "" { + input.BillingPhone = &billingPhone + } + + billingAddress := cmd.Config.String("billing-address") + if billingAddress != "" { + input.BillingAddress = &billingAddress + } + + taxIdentifier := cmd.Config.String("tax-identifier") + if taxIdentifier != "" { + input.TaxIdentifier = &taxIdentifier + } + + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + domains := cmd.Config.Strings("domains") + if len(domains) > 0 { + input.Domains = domains + } + + return id, input, nil +} + +// update an organization setting in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateOrganizationSetting(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organizationsettinghistory/doc.go b/cmd/cli/cmd/organizationsettinghistory/doc.go new file mode 100644 index 0000000..4f5b8b5 --- /dev/null +++ b/cmd/cli/cmd/organizationsettinghistory/doc.go @@ -0,0 +1,2 @@ +// Package organizationsettinghistory is our cobra cli for organizationSettingHistory endpoints +package organizationsettinghistory diff --git a/cmd/cli/cmd/organizationsettinghistory/get.go b/cmd/cli/cmd/organizationsettinghistory/get.go new file mode 100644 index 0000000..ab36d61 --- /dev/null +++ b/cmd/cli/cmd/organizationsettinghistory/get.go @@ -0,0 +1,49 @@ +package organizationsettinghistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing organizationSettingHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing organizationSettingHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetOrganizationSettingHistories(ctx, &openlaneclient.OrganizationSettingHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllOrganizationSettingHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/organizationsettinghistory/root.go b/cmd/cli/cmd/organizationsettinghistory/root.go new file mode 100644 index 0000000..666965b --- /dev/null +++ b/cmd/cli/cmd/organizationsettinghistory/root.go @@ -0,0 +1,88 @@ +package organizationsettinghistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base organizationSettingHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "organization-setting-history", + Aliases: []string{"org-setting-history"}, + Short: "the subcommands for working with organizationSettingHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the organizationSettingHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the organizationSettingHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllOrganizationSettingHistories: + var nodes []*openlaneclient.GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node + + for _, i := range v.OrganizationSettingHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOrganizationSettingHistories: + var nodes []*openlaneclient.GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node + + for _, i := range v.OrganizationSettingHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.OrganizationSettingHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.OrganizationSettingHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.OrganizationSettingHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/orgmembers/create.go b/cmd/cli/cmd/orgmembers/create.go new file mode 100644 index 0000000..e7565b3 --- /dev/null +++ b/cmd/cli/cmd/orgmembers/create.go @@ -0,0 +1,65 @@ +package orgmembers + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "add user to a organization", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("org-id", "o", "", "organization id") + createCmd.Flags().StringP("user-id", "u", "", "user id") + createCmd.Flags().StringP("role", "r", "member", "role to assign the user (member, admin)") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateOrgMembershipInput, err error) { + input.UserID = cmd.Config.String("user-id") + if input.UserID == "" { + return input, cmd.NewRequiredFieldMissingError("user id") + } + + // role defaults to `member` so it is not required + role := cmd.Config.String("role") + + r, err := cmd.GetRoleEnum(role) + cobra.CheckErr(err) + + input.Role = &r + + oID := cmd.Config.String("org-id") + if oID != "" { + input.OrganizationID = oID + } + + return input, nil +} + +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.AddUserToOrgWithRole(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/orgmembers/delete.go b/cmd/cli/cmd/orgmembers/delete.go new file mode 100644 index 0000000..6b94206 --- /dev/null +++ b/cmd/cli/cmd/orgmembers/delete.go @@ -0,0 +1,62 @@ +package orgmembers + +import ( + "context" + "errors" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "remove a user from a organization", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("user-id", "u", "", "user id") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (where openlaneclient.OrgMembershipWhereInput, err error) { + uID := cmd.Config.String("user-id") + if uID == "" { + return where, cmd.NewRequiredFieldMissingError("user id") + } + + where.UserID = &uID + + return where, nil +} + +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + where, err := deleteValidation() + cobra.CheckErr(err) + + orgMembers, err := client.GetOrgMembersByOrgID(ctx, &where) + cobra.CheckErr(err) + + if len(orgMembers.OrgMemberships.Edges) != 1 { + cobra.CheckErr(errors.New("error getting existing relation")) //nolint:err113 + } + + id := orgMembers.OrgMemberships.Edges[0].Node.ID + + o, err := client.RemoveUserFromOrg(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/orgmembers/doc.go b/cmd/cli/cmd/orgmembers/doc.go new file mode 100644 index 0000000..7e13ab2 --- /dev/null +++ b/cmd/cli/cmd/orgmembers/doc.go @@ -0,0 +1,2 @@ +// Package orgmembers is our cobra cli for org member endpoints +package orgmembers diff --git a/cmd/cli/cmd/orgmembers/get.go b/cmd/cli/cmd/orgmembers/get.go new file mode 100644 index 0000000..dfc44bd --- /dev/null +++ b/cmd/cli/cmd/orgmembers/get.go @@ -0,0 +1,46 @@ +package orgmembers + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get existing members of a organization", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("org-id", "o", "", "org id to query") +} + +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + where := openlaneclient.OrgMembershipWhereInput{} + + // filter options + id := cmd.Config.String("id") + + if id != "" { + where.OrganizationID = &id + } + + o, err := client.GetOrgMembersByOrgID(ctx, &where) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/orgmembers/root.go b/cmd/cli/cmd/orgmembers/root.go new file mode 100644 index 0000000..e64c853 --- /dev/null +++ b/cmd/cli/cmd/orgmembers/root.go @@ -0,0 +1,114 @@ +package orgmembers + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base orgMembers command when called without any subcommands +var command = &cobra.Command{ + Use: "org-members", + Short: "the subcommands for working with the members of a organization", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetOrgMembersByOrgID: + var nodes []*openlaneclient.GetOrgMembersByOrgID_OrgMemberships_Edges_Node + + for _, i := range v.OrgMemberships.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.AddUserToOrgWithRole: + e = v.CreateOrgMembership.OrgMembership + case *openlaneclient.UpdateUserRoleInOrg: + e = v.UpdateOrgMembership.OrgMembership + case *openlaneclient.RemoveUserFromOrg: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.OrgMembership + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.OrgMembership + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.OrgMembership) { + writer := tables.NewTableWriter(command.OutOrStdout(), "UserID", "DisplayName", "FirstName", "LastName", "Email", "Role") + + for _, i := range out { + userID := i.UserID + if userID == "" && i.User != nil { + userID = i.User.ID + } + + var ( + displayName string + firstName string + lastName string + email string + ) + + if i.User != nil { + displayName = i.User.DisplayName + firstName = *i.User.FirstName + lastName = *i.User.LastName + email = i.User.Email + } + + writer.AddRow(userID, displayName, firstName, lastName, email, i.Role) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.RemoveUserFromOrg) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteOrgMembership.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/orgmembers/update.go b/cmd/cli/cmd/orgmembers/update.go new file mode 100644 index 0000000..2627a5b --- /dev/null +++ b/cmd/cli/cmd/orgmembers/update.go @@ -0,0 +1,77 @@ +package orgmembers + +import ( + "context" + "errors" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update a user's role in a org", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("org-id", "o", "", "organization id") + updateCmd.Flags().StringP("user-id", "u", "", "user id") + updateCmd.Flags().StringP("role", "r", "member", "role to assign the user (member, admin)") +} + +// updateValidation validates the required fields for the command +func updateValidation() (where openlaneclient.OrgMembershipWhereInput, input openlaneclient.UpdateOrgMembershipInput, err error) { + userID := cmd.Config.String("user-id") + if userID == "" { + return where, input, cmd.NewRequiredFieldMissingError("user id") + } + + where.UserID = &userID + + orgID := cmd.Config.String("org-id") + if orgID != "" { + where.OrganizationID = &orgID + } + + role := cmd.Config.String("role") + if role == "" { + return where, input, cmd.NewRequiredFieldMissingError("role") + } + + r, err := cmd.GetRoleEnum(role) + cobra.CheckErr(err) + + input.Role = &r + + return where, input, nil +} + +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + where, input, err := updateValidation() + cobra.CheckErr(err) + + orgMembers, err := client.GetOrgMembersByOrgID(ctx, &where) + cobra.CheckErr(err) + + if len(orgMembers.OrgMemberships.Edges) != 1 { + return errors.New("error getting existing relation") //nolint:err113 + } + + o, err := client.UpdateUserRoleInOrg(ctx, orgMembers.OrgMemberships.Edges[0].Node.ID, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/orgmembershiphistory/doc.go b/cmd/cli/cmd/orgmembershiphistory/doc.go new file mode 100644 index 0000000..a875ab6 --- /dev/null +++ b/cmd/cli/cmd/orgmembershiphistory/doc.go @@ -0,0 +1,2 @@ +// Package orgmembershiphistory is our cobra cli for orgMembershipHistory endpoints +package orgmembershiphistory diff --git a/cmd/cli/cmd/orgmembershiphistory/get.go b/cmd/cli/cmd/orgmembershiphistory/get.go new file mode 100644 index 0000000..c17e329 --- /dev/null +++ b/cmd/cli/cmd/orgmembershiphistory/get.go @@ -0,0 +1,49 @@ +package orgmembershiphistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing orgMembershipHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing orgMembershipHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetOrgMembershipHistories(ctx, &openlaneclient.OrgMembershipHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllOrgMembershipHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/orgmembershiphistory/root.go b/cmd/cli/cmd/orgmembershiphistory/root.go new file mode 100644 index 0000000..e76bc65 --- /dev/null +++ b/cmd/cli/cmd/orgmembershiphistory/root.go @@ -0,0 +1,87 @@ +package orgmembershiphistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base orgMembershipHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "org-membership-history", + Short: "the subcommands for working with orgMembershipHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the orgMembershipHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the orgMembershipHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllOrgMembershipHistories: + var nodes []*openlaneclient.GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node + + for _, i := range v.OrgMembershipHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOrgMembershipHistories: + var nodes []*openlaneclient.GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node + + for _, i := range v.OrgMembershipHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.OrgMembershipHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.OrgMembershipHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.OrgMembershipHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/output.go b/cmd/cli/cmd/output.go new file mode 100644 index 0000000..fcfaaee --- /dev/null +++ b/cmd/cli/cmd/output.go @@ -0,0 +1,49 @@ +package cmd + +import ( + "encoding/json" + "fmt" + + "github.com/TylerBrock/colorjson" + "github.com/spf13/cobra" +) + +// JSONPrint prints a JSON formatted string with color +func JSONPrint(s []byte) error { + var obj map[string]interface{} + + err := json.Unmarshal(s, &obj) + cobra.CheckErr(err) + + f := colorjson.NewFormatter() + f.Indent = 2 + + o, err := f.Marshal(obj) + cobra.CheckErr(err) + + fmt.Println(string(o)) + + return nil +} + +// ParseJSON parses a JSON formatted string into a map +func ParseJSON(v string) (map[string]interface{}, error) { + var m map[string]interface{} + + if err := json.Unmarshal([]byte(v), &m); err != nil { + return nil, err + } + + return m, nil +} + +// ParseBytes parses buffered bytes into a map +func ParseBytes(v []byte) (map[string]interface{}, error) { + var m map[string]interface{} + + if err := json.Unmarshal(v, &m); err != nil { + return nil, err + } + + return m, nil +} diff --git a/cmd/cli/cmd/personalaccesstokens/create.go b/cmd/cli/cmd/personalaccesstokens/create.go new file mode 100644 index 0000000..874c5dd --- /dev/null +++ b/cmd/cli/cmd/personalaccesstokens/create.go @@ -0,0 +1,71 @@ +package tokens + +import ( + "context" + "time" + + "github.com/samber/lo" + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new personal access token", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the personal access token") + createCmd.Flags().StringP("description", "d", "", "description of the pat") + createCmd.Flags().StringSliceP("organizations", "o", []string{}, "organization(s) id to associate the pat with") + createCmd.Flags().DurationP("expiration", "e", 0, "duration of the pat to be valid, leave empty to never expire") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreatePersonalAccessTokenInput, err error) { + input.Name = cmd.Config.String("name") + if input.Name == "" { + return input, cmd.NewRequiredFieldMissingError("token name") + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + organizations := cmd.Config.Strings("organizations") + if organizations != nil { + input.OrganizationIDs = organizations + } + + expiration := cmd.Config.Duration("expiration") + if expiration != 0 { + input.ExpiresAt = lo.ToPtr(time.Now().Add(expiration)) + } + + return input, nil +} + +// create a new personal access token +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreatePersonalAccessToken(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/personalaccesstokens/delete.go b/cmd/cli/cmd/personalaccesstokens/delete.go new file mode 100644 index 0000000..bb63dfb --- /dev/null +++ b/cmd/cli/cmd/personalaccesstokens/delete.go @@ -0,0 +1,50 @@ +package tokens + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing personal access token", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "pat id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("token id") + } + + return id, nil +} + +// delete a personal access token in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeletePersonalAccessToken(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/personalaccesstokens/doc.go b/cmd/cli/cmd/personalaccesstokens/doc.go new file mode 100644 index 0000000..1365e39 --- /dev/null +++ b/cmd/cli/cmd/personalaccesstokens/doc.go @@ -0,0 +1,2 @@ +// Package tokens is our cobra cli for token endpoints +package tokens diff --git a/cmd/cli/cmd/personalaccesstokens/get.go b/cmd/cli/cmd/personalaccesstokens/get.go new file mode 100644 index 0000000..31a8d3c --- /dev/null +++ b/cmd/cli/cmd/personalaccesstokens/get.go @@ -0,0 +1,47 @@ +package tokens + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get personal access tokens", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "personal access token id to query") +} + +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + // if an id is provided, filter on the id, otherwise get all + if id == "" { + o, err := client.GetAllPersonalAccessTokens(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetPersonalAccessTokenByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/personalaccesstokens/root.go b/cmd/cli/cmd/personalaccesstokens/root.go new file mode 100644 index 0000000..346320e --- /dev/null +++ b/cmd/cli/cmd/personalaccesstokens/root.go @@ -0,0 +1,115 @@ +package tokens + +import ( + "encoding/json" + "strings" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base cmd command when called without any subcommands +var command = &cobra.Command{ + Use: "pat", + Short: "the subcommands for working with personal access tokens", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the pat in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the pat and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllPersonalAccessTokens: + var nodes []*openlaneclient.GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node + + for _, i := range v.PersonalAccessTokens.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetPersonalAccessTokenByID: + e = v.PersonalAccessToken + case *openlaneclient.CreatePersonalAccessToken: + e = v.CreatePersonalAccessToken.PersonalAccessToken + case *openlaneclient.UpdatePersonalAccessToken: + e = v.UpdatePersonalAccessToken.PersonalAccessToken + case *openlaneclient.DeletePersonalAccessToken: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.PersonalAccessToken + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.PersonalAccessToken + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.PersonalAccessToken) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Token", "Authorized Organizations", "LastUsedAt", "ExpiresAt") + + for _, i := range out { + lastUsed := "never" + if i.LastUsedAt != nil { + lastUsed = i.LastUsedAt.String() + } + + expiresAt := "never" + if i.ExpiresAt != nil { + expiresAt = i.ExpiresAt.String() + } + + orgs := []string{} + for _, o := range i.Organizations { + orgs = append(orgs, o.Name) + } + + authorizedOrgs := strings.Join(orgs, ", ") + + writer.AddRow(i.ID, i.Name, i.Token, authorizedOrgs, lastUsed, expiresAt) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.DeletePersonalAccessToken) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeletePersonalAccessToken.DeletedID) + + writer.Render() +} diff --git a/cmd/cli/cmd/personalaccesstokens/update.go b/cmd/cli/cmd/personalaccesstokens/update.go new file mode 100644 index 0000000..2aee0df --- /dev/null +++ b/cmd/cli/cmd/personalaccesstokens/update.go @@ -0,0 +1,75 @@ +package tokens + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing personal access token", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "pat id to update") + updateCmd.Flags().StringP("name", "n", "", "name of the personal access token") + updateCmd.Flags().StringP("description", "d", "", "description of the pat") + updateCmd.Flags().StringSliceP("add-organizations", "o", []string{}, "add organization(s) id to associate the pat with") + updateCmd.Flags().StringSliceP("remove-organizations", "r", []string{}, "remove organization(s) id to associate the pat with") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.UpdatePersonalAccessTokenInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("token id") + } + + name := cmd.Config.String("name") + if name != "" { + input.Name = &name + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + addOrgs := cmd.Config.Strings("add-organizations") + if addOrgs != nil { + input.AddOrganizationIDs = addOrgs + } + + removeOrgs := cmd.Config.Strings("remove-organizations") + if removeOrgs != nil { + input.RemoveOrganizationIDs = removeOrgs + } + + return id, input, nil +} + +// update an existing personal access token +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdatePersonalAccessToken(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/register/doc.go b/cmd/cli/cmd/register/doc.go new file mode 100644 index 0000000..8f2419f --- /dev/null +++ b/cmd/cli/cmd/register/doc.go @@ -0,0 +1,2 @@ +// Package register allows user registration +package register diff --git a/cmd/cli/cmd/register/root.go b/cmd/cli/cmd/register/root.go new file mode 100644 index 0000000..956ec48 --- /dev/null +++ b/cmd/cli/cmd/register/root.go @@ -0,0 +1,79 @@ +package register + +import ( + "context" + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/models" +) + +var command = &cobra.Command{ + Use: "register", + Short: "register a new user", + Run: func(cmd *cobra.Command, args []string) { + err := register(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + cmd.RootCmd.AddCommand(command) + + command.Flags().StringP("email", "e", "", "email of the user") + command.Flags().StringP("password", "p", "", "password of the user") + command.Flags().StringP("first-name", "f", "", "first name of the user") + command.Flags().StringP("last-name", "l", "", "last name of the user") +} + +// validateRegister validates the required fields for the command +func validateRegister() (*models.RegisterRequest, error) { + email := cmd.Config.String("email") + if email == "" { + return nil, cmd.NewRequiredFieldMissingError("email") + } + + firstName := cmd.Config.String("first-name") + if firstName == "" { + return nil, cmd.NewRequiredFieldMissingError("first name") + } + + lastName := cmd.Config.String("last-name") + if lastName == "" { + return nil, cmd.NewRequiredFieldMissingError("last name") + } + + password := cmd.Config.String("password") + if password == "" { + return nil, cmd.NewRequiredFieldMissingError("password") + } + + return &models.RegisterRequest{ + Email: email, + FirstName: firstName, + LastName: lastName, + Password: password, + }, nil +} + +// register registers a new user in the platform +func register(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClient(ctx) + cobra.CheckErr(err) + + var s []byte + + input, err := validateRegister() + cobra.CheckErr(err) + + registration, err := client.Register(ctx, input) + cobra.CheckErr(err) + + s, err = json.Marshal(registration) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} diff --git a/cmd/cli/cmd/reset/doc.go b/cmd/cli/cmd/reset/doc.go new file mode 100644 index 0000000..890f801 --- /dev/null +++ b/cmd/cli/cmd/reset/doc.go @@ -0,0 +1,2 @@ +// Package reset allows user password reset +package reset diff --git a/cmd/cli/cmd/reset/root.go b/cmd/cli/cmd/reset/root.go new file mode 100644 index 0000000..280133c --- /dev/null +++ b/cmd/cli/cmd/reset/root.go @@ -0,0 +1,62 @@ +package reset + +import ( + "context" + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/models" +) + +var command = &cobra.Command{ + Use: "reset", + Short: "reset a user password", + Run: func(cmd *cobra.Command, args []string) { + err := resetPassword(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + cmd.RootCmd.AddCommand(command) + + command.Flags().StringP("token", "t", "", "reset token") + command.Flags().StringP("password", "p", "", "new password of the user") +} + +// validateReset validates the required fields for the command +func validateReset() (*models.ResetPasswordRequest, error) { + password := cmd.Config.String("password") + if password == "" { + return nil, cmd.NewRequiredFieldMissingError("password") + } + + token := cmd.Config.String("token") + if token == "" { + return nil, cmd.NewRequiredFieldMissingError("token") + } + + return &models.ResetPasswordRequest{ + Password: password, + Token: token, + }, nil +} + +func resetPassword(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClient(ctx) + cobra.CheckErr(err) + + input, err := validateReset() + cobra.CheckErr(err) + + reply, err := client.ResetPassword(ctx, input) + cobra.CheckErr(err) + + s, err := json.Marshal(reply) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} diff --git a/cmd/cli/cmd/root.go b/cmd/cli/cmd/root.go new file mode 100644 index 0000000..f8c9461 --- /dev/null +++ b/cmd/cli/cmd/root.go @@ -0,0 +1,162 @@ +// Package cmd is the cobra cli implementation for the core server +package cmd + +import ( + "errors" + "os" + "path/filepath" + "strings" + + "github.com/99designs/keyring" + "github.com/knadh/koanf/parsers/yaml" + "github.com/knadh/koanf/providers/env" + "github.com/knadh/koanf/providers/file" + "github.com/knadh/koanf/providers/posflag" + "github.com/knadh/koanf/v2" + "github.com/mitchellh/go-homedir" + "github.com/spf13/cobra" + "go.uber.org/zap" +) + +const ( + appName = "core" + defaultRootHost = "http://localhost:17608" + TableOutput = "table" + JSONOutput = "json" +) + +var ( + cfgFile string + OutputFormat string + InputFile string + Logger *zap.SugaredLogger + Config *koanf.Koanf +) + +var ( + // RootHost contains the root url for the API + RootHost string + // GraphAPIHost contains the url for the graph api + GraphAPIHost string +) + +var ( + userKeyring keyring.Keyring + userKeyringLoaded = false +) + +// RootCmd represents the base command when called without any subcommands +var RootCmd = &cobra.Command{ + Use: appName, + Short: "the openlane cli", + PersistentPreRun: func(cmd *cobra.Command, args []string) { + initConfiguration(cmd) + }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + cobra.CheckErr(RootCmd.Execute()) +} + +func init() { + Config = koanf.New(".") // Create a new koanf instance. + + cobra.OnInitialize(initConfig) + + RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/."+appName+".yaml)") + RootCmd.PersistentFlags().String("host", defaultRootHost, "api host url") + + // Logging flags + RootCmd.PersistentFlags().Bool("debug", false, "enable debug logging") + RootCmd.PersistentFlags().Bool("pretty", false, "enable pretty (human readable) logging output") + + // Output flags + RootCmd.PersistentFlags().StringVarP(&OutputFormat, "format", "z", TableOutput, "output format (json, table)") + RootCmd.PersistentFlags().StringVar(&InputFile, "csv", "", "csv input file instead of stdin") +} + +// initConfig reads in config file and ENV variables if set. +func initConfig() { + // load the flags to ensure we know the correct config file path + initConfiguration(RootCmd) + + // load the config file and env vars + loadConfigFile() + + // reload because flags and env vars take precedence over file + initConfiguration(RootCmd) + + // set the host url + RootHost = Config.String("host") + + // setup logging configuration + setupLogging() +} + +// setupLogging configures the logger based on the command flags +func setupLogging() { + cfg := zap.NewProductionConfig() + if Config.Bool("pretty") { + cfg = zap.NewDevelopmentConfig() + } + + if Config.Bool("debug") { + cfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel) + } else { + cfg.Level = zap.NewAtomicLevelAt(zap.InfoLevel) + } + + l, err := cfg.Build() + cobra.CheckErr(err) + + Logger = l.Sugar().With("app", appName) + defer Logger.Sync() //nolint:errcheck +} + +// initConfiguration loads the configuration from the command flags of the given cobra command +func initConfiguration(cmd *cobra.Command) { + loadEnvVars() + + loadFlags(cmd) +} + +func loadConfigFile() { + if cfgFile == "" { + // Find home directory. + home, err := homedir.Dir() + cobra.CheckErr(err) + + cfgFile = filepath.Join(home, "."+appName+".yaml") + } + + // If the config file does not exist, do nothing + if _, err := os.Stat(cfgFile); errors.Is(err, os.ErrNotExist) { + return + } + + err := Config.Load(file.Provider(cfgFile), yaml.Parser()) + + cobra.CheckErr(err) +} + +func loadEnvVars() { + err := Config.Load(env.ProviderWithValue("CORE_", ".", func(s string, v string) (string, interface{}) { + key := strings.ReplaceAll(strings.ToLower(strings.TrimPrefix(s, "CORE_")), "_", ".") + + if strings.Contains(v, ",") { + return key, strings.Split(v, ",") + } + + return key, v + }), nil) + + cobra.CheckErr(err) +} + +func loadFlags(cmd *cobra.Command) { + err := Config.Load(posflag.Provider(cmd.Flags(), Config.Delim(), Config), nil) + + cobra.CheckErr(err) +} diff --git a/cmd/cli/cmd/search/doc.go b/cmd/cli/cmd/search/doc.go new file mode 100644 index 0000000..59dcd30 --- /dev/null +++ b/cmd/cli/cmd/search/doc.go @@ -0,0 +1,2 @@ +// Package search is our cobra cli for search endpoint +package search diff --git a/cmd/cli/cmd/search/search.go b/cmd/cli/cmd/search/search.go new file mode 100644 index 0000000..96e0bee --- /dev/null +++ b/cmd/cli/cmd/search/search.go @@ -0,0 +1,111 @@ +package search + +import ( + "context" + "fmt" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var command = &cobra.Command{ + Use: "search", + Short: "search for organizations, groups, users, subscribers, etc in the system", + Run: func(cmd *cobra.Command, args []string) { + err := search(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + cmd.RootCmd.AddCommand(command) + + command.Flags().StringP("query", "q", "", "query string to search for") +} + +// validate validates the required fields for the command +func validate() (string, error) { + query := cmd.Config.String("query") + if query == "" { + return "", cmd.NewRequiredFieldMissingError("query") + } + + return query, nil +} + +// search searches for organizations, groups, users, subscribers, etc in the system +func search(ctx context.Context) error { // setup http client + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + query, err := validate() + cobra.CheckErr(err) + + results, err := client.Search(ctx, query) + cobra.CheckErr(err) + + consoleOutput(results) + + return nil +} + +func consoleOutput(results *openlaneclient.Search) { + // print results + for _, r := range results.Search.Nodes { + if len(r.OrganizationSearchResult.Organizations) > 0 { + fmt.Println("Organization Results") + + writer := tables.NewTableWriter(cmd.RootCmd.OutOrStdout(), "ID", "Name", "DisplayName", "Description") + + for _, o := range r.OrganizationSearchResult.Organizations { + writer.AddRow(o.ID, o.Name, o.DisplayName, *o.Description) + } + + writer.Render() + } + + if len(r.GroupSearchResult.Groups) > 0 { + fmt.Println("Group Results") + + writer := tables.NewTableWriter(cmd.RootCmd.OutOrStdout(), "ID", "Name", "DisplayName", "Description") + + for _, g := range r.GroupSearchResult.Groups { + writer.AddRow(g.ID, g.Name, g.DisplayName, *g.Description) + } + + writer.Render() + } + + if len(r.UserSearchResult.Users) > 0 { + fmt.Println("User Results") + + writer := tables.NewTableWriter(cmd.RootCmd.OutOrStdout(), "ID", "FirstName", "LastName", "DisplayName", "Email") + + for _, u := range r.UserSearchResult.Users { + writer.AddRow(u.ID, *u.FirstName, *u.LastName, u.DisplayName, u.Email) + } + + writer.Render() + } + + if len(r.SubscriberSearchResult.Subscribers) > 0 { + fmt.Println("Subscriber Results") + + writer := tables.NewTableWriter(cmd.RootCmd.OutOrStdout(), "ID", "Email") + + for _, s := range r.SubscriberSearchResult.Subscribers { + writer.AddRow(s.ID, s.Email) + } + + writer.Render() + } + } +} diff --git a/cmd/cli/cmd/subscriber/create.go b/cmd/cli/cmd/subscriber/create.go new file mode 100644 index 0000000..d0812df --- /dev/null +++ b/cmd/cli/cmd/subscriber/create.go @@ -0,0 +1,74 @@ +package subscribers + +import ( + "context" + "os" + + "github.com/99designs/gqlgen/graphql" + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "add subscribers to a organization", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringSliceP("emails", "e", []string{}, "email address of the subscriber()") +} + +// createValidation validates the required fields for the command +func createValidation() (input []*openlaneclient.CreateSubscriberInput, err error) { + email := cmd.Config.Strings("emails") + if len(email) == 0 { + return input, cmd.NewRequiredFieldMissingError("emails") + } + + for _, e := range email { + input = append(input, &openlaneclient.CreateSubscriberInput{ + Email: e, + }) + } + + return input, nil +} + +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + if cmd.InputFile != "" { + input, err := os.OpenFile(cmd.InputFile, os.O_RDWR|os.O_CREATE, os.ModePerm) + cobra.CheckErr(err) + + defer input.Close() + + in := graphql.Upload{ + File: input, + } + + o, err := client.CreateBulkCSVSubscriber(ctx, in) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateBulkSubscriber(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/subscriber/delete.go b/cmd/cli/cmd/subscriber/delete.go new file mode 100644 index 0000000..695fe26 --- /dev/null +++ b/cmd/cli/cmd/subscriber/delete.go @@ -0,0 +1,56 @@ +package subscribers + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "remove a subscriber from an organization", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("email", "e", "", "email address of the subscriber to delete") + deleteCmd.Flags().StringP("organization-id", "o", "", "organization ID of the subscriber to delete, only required when using a personal access token for the request") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, *string, error) { + email := cmd.Config.String("email") + if email == "" { + return "", nil, cmd.NewRequiredFieldMissingError("email") + } + + orgID := cmd.Config.String("organization-id") + if orgID == "" { + return email, nil, nil + } + + return email, &orgID, nil +} + +// delete an existing organization subscriber +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + email, orgID, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteSubscriber(ctx, email, orgID) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/subscriber/doc.go b/cmd/cli/cmd/subscriber/doc.go new file mode 100644 index 0000000..e69eb18 --- /dev/null +++ b/cmd/cli/cmd/subscriber/doc.go @@ -0,0 +1,2 @@ +// Package subscribers is our cobra cli for subscriber endpoints +package subscribers diff --git a/cmd/cli/cmd/subscriber/get.go b/cmd/cli/cmd/subscriber/get.go new file mode 100644 index 0000000..7d0e72d --- /dev/null +++ b/cmd/cli/cmd/subscriber/get.go @@ -0,0 +1,56 @@ +package subscribers + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get existing subscribers of a organization", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().BoolP("active", "a", true, "filter on active subscribers") + getCmd.Flags().StringP("email", "e", "", "email address of the subscriber to get") +} + +// get an existing subscriber(s) of an organization +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + email := cmd.Config.String("email") + + if email != "" { + o, err := client.GetSubscriberByEmail(ctx, email) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // filter options + where := openlaneclient.SubscriberWhereInput{} + + active := cmd.Config.Bool("active") + if active { + where.Active = &active + } + + o, err := client.GetSubscribers(ctx, &where) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/subscriber/root.go b/cmd/cli/cmd/subscriber/root.go new file mode 100644 index 0000000..c9e3b0d --- /dev/null +++ b/cmd/cli/cmd/subscriber/root.go @@ -0,0 +1,106 @@ +package subscribers + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base subscribers command when called without any subcommands +var command = &cobra.Command{ + Use: "subscriber", + Short: "the subcommands for working with the subscribers of a organization", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the out in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the out in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the out and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetSubscribers: + var nodes []*openlaneclient.GetSubscribers_Subscribers_Edges_Node + + for _, i := range v.Subscribers.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetAllSubscribers: + var nodes []*openlaneclient.GetAllSubscribers_Subscribers_Edges_Node + + for _, i := range v.Subscribers.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetSubscriberByEmail: + e = v.Subscriber + case *openlaneclient.CreateBulkSubscriber: + e = v.CreateBulkSubscriber.Subscribers + case *openlaneclient.CreateBulkCSVSubscriber: + e = v.CreateBulkCSVSubscriber.Subscribers + case *openlaneclient.CreateSubscriber: + e = v.CreateSubscriber.Subscriber + case *openlaneclient.DeleteSubscriber: + deletedTableOutput(v) + return nil + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Subscriber + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Subscriber + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Subscriber) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Email", "Verified", "Active") + for _, i := range out { + writer.AddRow(i.ID, i.Email, i.VerifiedEmail, i.Active) + } + + writer.Render() +} + +// deleteTableOutput prints the deleted email in a table format +func deletedTableOutput(e *openlaneclient.DeleteSubscriber) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.DeleteSubscriber.Email) + + writer.Render() +} diff --git a/cmd/cli/cmd/subscriber/update.go b/cmd/cli/cmd/subscriber/update.go new file mode 100644 index 0000000..12de891 --- /dev/null +++ b/cmd/cli/cmd/subscriber/update.go @@ -0,0 +1,56 @@ +package subscribers + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update subscriber details", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("email", "e", "", "email address of the subscriber to update") + updateCmd.Flags().StringP("phone-number", "p", "", "phone number to add or update on the subscriber") +} + +// updateValidation validates the input flags provided by the user +func updateValidation() (email string, input openlaneclient.UpdateSubscriberInput, err error) { + email = cmd.Config.String("email") + if email == "" { + return email, input, cmd.NewRequiredFieldMissingError("email") + } + + phone := cmd.Config.String("phone-number") + + input.PhoneNumber = &phone + + return email, input, nil +} + +// update a subscriber details +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + email, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateSubscriber(ctx, email, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/switchcontext/doc.go b/cmd/cli/cmd/switchcontext/doc.go new file mode 100644 index 0000000..8ffb080 --- /dev/null +++ b/cmd/cli/cmd/switchcontext/doc.go @@ -0,0 +1,2 @@ +// Package switchcontext provides a basic interface to switch between organization contexts +package switchcontext diff --git a/cmd/cli/cmd/switchcontext/root.go b/cmd/cli/cmd/switchcontext/root.go new file mode 100644 index 0000000..648b392 --- /dev/null +++ b/cmd/cli/cmd/switchcontext/root.go @@ -0,0 +1,69 @@ +package switchcontext + +import ( + "context" + "fmt" + + "github.com/spf13/cobra" + "golang.org/x/oauth2" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/models" +) + +var command = &cobra.Command{ + Use: "switch", + Short: "switch organization contexts", + Run: func(cmd *cobra.Command, args []string) { + err := switchOrg(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + cmd.RootCmd.AddCommand(command) + + command.Flags().StringP("target-org", "t", "", "target organization to switch to") +} + +// validate validates the required fields for the command +func validate() (*models.SwitchOrganizationRequest, error) { + input := &models.SwitchOrganizationRequest{} + + input.TargetOrganizationID = cmd.Config.String("target-org") + if input.TargetOrganizationID == "" { + return nil, cmd.NewRequiredFieldMissingError("target organization") + } + + return input, nil +} + +// switchOrg switches the organization context +func switchOrg(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + + input, err := validate() + cobra.CheckErr(err) + + resp, err := client.Switch(ctx, input) + cobra.CheckErr(err) + + fmt.Printf("Successfully switched to organization: %s!\n", input.TargetOrganizationID) + + // store auth tokens + if err := cmd.StoreToken(&oauth2.Token{ + AccessToken: resp.AccessToken, + RefreshToken: resp.RefreshToken, + }); err != nil { + return err + } + + // store session cookies + cmd.StoreSessionCookies(client) + + fmt.Println("auth tokens successfully stored in keychain") + + return nil +} diff --git a/cmd/cli/cmd/template/create.go b/cmd/cli/cmd/template/create.go new file mode 100644 index 0000000..59002ae --- /dev/null +++ b/cmd/cli/cmd/template/create.go @@ -0,0 +1,82 @@ +package templates + +import ( + "context" + "os" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new template", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the template") + createCmd.Flags().StringP("description", "d", "", "description of the template") + createCmd.Flags().StringP("json-config", "j", "", "json payload for the template") + createCmd.Flags().StringP("ui-schema", "u", "", "ui schema for the template") + createCmd.Flags().StringP("type", "t", "DOCUMENT", "type of the template") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateTemplateInput, err error) { + input.Name = cmd.Config.String("name") + if input.Name == "" { + return input, cmd.NewRequiredFieldMissingError("template name") + } + + jsonConfig := cmd.Config.String("json-config") + + data, err := os.ReadFile(jsonConfig) + cobra.CheckErr(err) + + input.Jsonconfig = data + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + uiSchema := cmd.Config.String("ui-schema") + if uiSchema != "" { + data, err = os.ReadFile(uiSchema) + cobra.CheckErr(err) + + input.Uischema = data + } + + templateType := cmd.Config.String("type") + if templateType != "" { + input.TemplateType = enums.ToDocumentType(templateType) + } + + return input, nil +} + +// create a new template +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateTemplate(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/template/delete.go b/cmd/cli/cmd/template/delete.go new file mode 100644 index 0000000..dac8432 --- /dev/null +++ b/cmd/cli/cmd/template/delete.go @@ -0,0 +1 @@ +package templates diff --git a/cmd/cli/cmd/template/doc.go b/cmd/cli/cmd/template/doc.go new file mode 100644 index 0000000..dac8432 --- /dev/null +++ b/cmd/cli/cmd/template/doc.go @@ -0,0 +1 @@ +package templates diff --git a/cmd/cli/cmd/template/get.go b/cmd/cli/cmd/template/get.go new file mode 100644 index 0000000..39d5187 --- /dev/null +++ b/cmd/cli/cmd/template/get.go @@ -0,0 +1,46 @@ +package templates + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get details of existing template(s)", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "get a specific template by ID") +} + +// get retrieves templates from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + if id != "" { + o, err := client.GetTemplateByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllTemplates(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/template/root.go b/cmd/cli/cmd/template/root.go new file mode 100644 index 0000000..ab20182 --- /dev/null +++ b/cmd/cli/cmd/template/root.go @@ -0,0 +1,85 @@ +package templates + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base template command when called without any subcommands +var command = &cobra.Command{ + Use: "template", + Short: "the subcommands for working with the templates", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the out in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the out in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the out and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllTemplates: + var nodes []*openlaneclient.GetAllTemplates_Templates_Edges_Node + + for _, i := range v.Templates.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetTemplateByID: + e = v.Template + case *openlaneclient.CreateTemplate: + e = v.CreateTemplate.Template + case *openlaneclient.UpdateTemplate: + e = v.UpdateTemplate.Template + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Template + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Template + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Template) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Description", "JSON") + for _, i := range out { + // this doesn't visually show you the json in the table but leaving it in for now + writer.AddRow(i.ID, i.Name, *i.Description, i.Jsonconfig) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/template/update.go b/cmd/cli/cmd/template/update.go new file mode 100644 index 0000000..dac8432 --- /dev/null +++ b/cmd/cli/cmd/template/update.go @@ -0,0 +1 @@ +package templates diff --git a/cmd/cli/cmd/templatehistory/doc.go b/cmd/cli/cmd/templatehistory/doc.go new file mode 100644 index 0000000..184e43e --- /dev/null +++ b/cmd/cli/cmd/templatehistory/doc.go @@ -0,0 +1,2 @@ +// Package templatehistory is our cobra cli for templateHistory endpoints +package templatehistory diff --git a/cmd/cli/cmd/templatehistory/get.go b/cmd/cli/cmd/templatehistory/get.go new file mode 100644 index 0000000..041af41 --- /dev/null +++ b/cmd/cli/cmd/templatehistory/get.go @@ -0,0 +1,49 @@ +package templatehistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing templateHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing templateHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetTemplateHistories(ctx, &openlaneclient.TemplateHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllTemplateHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/templatehistory/root.go b/cmd/cli/cmd/templatehistory/root.go new file mode 100644 index 0000000..d0460f1 --- /dev/null +++ b/cmd/cli/cmd/templatehistory/root.go @@ -0,0 +1,87 @@ +package templatehistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base templateHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "template-history", + Short: "the subcommands for working with templateHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the templateHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the templateHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllTemplateHistories: + var nodes []*openlaneclient.GetAllTemplateHistories_TemplateHistories_Edges_Node + + for _, i := range v.TemplateHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetTemplateHistories: + var nodes []*openlaneclient.GetTemplateHistories_TemplateHistories_Edges_Node + + for _, i := range v.TemplateHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.TemplateHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.TemplateHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.TemplateHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/user/create.go b/cmd/cli/cmd/user/create.go new file mode 100644 index 0000000..a02d97c --- /dev/null +++ b/cmd/cli/cmd/user/create.go @@ -0,0 +1,79 @@ +package user + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new user", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("email", "e", "", "email of the user") + createCmd.Flags().StringP("password", "p", "", "password of the user") + createCmd.Flags().StringP("first-name", "f", "", "first name of the user") + createCmd.Flags().StringP("last-name", "l", "", "last name of the user") + createCmd.Flags().StringP("display-name", "d", "", "first name of the user") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateUserInput, err error) { + input.Email = cmd.Config.String("email") + if input.Email == "" { + return input, cmd.NewRequiredFieldMissingError("email") + } + + firstName := cmd.Config.String("first-name") + if firstName == "" { + return input, cmd.NewRequiredFieldMissingError("first name") + } + + input.FirstName = &firstName + + lastName := cmd.Config.String("last-name") + if lastName == "" { + return input, cmd.NewRequiredFieldMissingError("last name") + } + + input.LastName = &lastName + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = displayName + } + + password := cmd.Config.String("password") + if password != "" { + input.Password = &password + } + + return input, nil +} + +// create a new user +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateUser(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/user/delete.go b/cmd/cli/cmd/user/delete.go new file mode 100644 index 0000000..858677e --- /dev/null +++ b/cmd/cli/cmd/user/delete.go @@ -0,0 +1,50 @@ +package user + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing user", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "user id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("user id") + } + + return id, nil +} + +// delete a user in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.DeleteUser(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/user/doc.go b/cmd/cli/cmd/user/doc.go new file mode 100644 index 0000000..79250c6 --- /dev/null +++ b/cmd/cli/cmd/user/doc.go @@ -0,0 +1,2 @@ +// Package user is our cobra cli for user endpoints +package user diff --git a/cmd/cli/cmd/user/get.go b/cmd/cli/cmd/user/get.go new file mode 100644 index 0000000..4519dc5 --- /dev/null +++ b/cmd/cli/cmd/user/get.go @@ -0,0 +1,48 @@ +package user + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get details of existing user", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "user id to query") +} + +// get retrieves all users or a specific user by ID +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + // if a user ID is provided, filter on that user, otherwise get all + if id != "" { + o, err := client.GetUserByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllUsers(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/user/root.go b/cmd/cli/cmd/user/root.go new file mode 100644 index 0000000..63637cd --- /dev/null +++ b/cmd/cli/cmd/user/root.go @@ -0,0 +1,85 @@ +package user + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base user command when called without any subcommands +var command = &cobra.Command{ + Use: "user", + Short: "the subcommands for working with the user", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllUsers: + var nodes []*openlaneclient.GetAllUsers_Users_Edges_Node + + for _, i := range v.Users.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetUserByID: + e = v.User + case *openlaneclient.CreateUser: + e = v.CreateUser.User + case *openlaneclient.UpdateUser: + e = v.UpdateUser.User + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.User + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.User + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.User) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Email", "FirstName", "LastName", "DisplayName", "AuthProvider") + for _, i := range out { + // this doesn't visually show you the json in the table but leaving it in for now + writer.AddRow(i.ID, i.Email, *i.FirstName, *i.LastName, i.DisplayName, i.AuthProvider) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/user/update.go b/cmd/cli/cmd/user/update.go new file mode 100644 index 0000000..dd08b9e --- /dev/null +++ b/cmd/cli/cmd/user/update.go @@ -0,0 +1,76 @@ +package user + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing user", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "user id to update") + updateCmd.Flags().StringP("first-name", "f", "", "first name of the user") + updateCmd.Flags().StringP("last-name", "l", "", "last name of the user") + updateCmd.Flags().StringP("display-name", "d", "", "display name of the user") + updateCmd.Flags().StringP("email", "e", "", "email of the user") +} + +// updateValidation validates the input flags provided by the user +func updateValidation() (id string, input openlaneclient.UpdateUserInput, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("user id") + } + + firstName := cmd.Config.String("first-name") + if firstName != "" { + input.FirstName = &firstName + } + + lastName := cmd.Config.String("last-name") + if lastName != "" { + input.LastName = &lastName + } + + displayName := cmd.Config.String("display-name") + if displayName != "" { + input.DisplayName = &displayName + } + + email := cmd.Config.String("email") + if email != "" { + input.Email = &email + } + + // TODO: allow updates to user settings + return id, input, nil +} + +// update an existing user +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.UpdateUser(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/userhistory/doc.go b/cmd/cli/cmd/userhistory/doc.go new file mode 100644 index 0000000..5e8a5b6 --- /dev/null +++ b/cmd/cli/cmd/userhistory/doc.go @@ -0,0 +1,2 @@ +// Package userhistory is our cobra cli for userHistory endpoints +package userhistory diff --git a/cmd/cli/cmd/userhistory/get.go b/cmd/cli/cmd/userhistory/get.go new file mode 100644 index 0000000..c6f33a8 --- /dev/null +++ b/cmd/cli/cmd/userhistory/get.go @@ -0,0 +1,49 @@ +package userhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing userHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing userHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetUserHistories(ctx, &openlaneclient.UserHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllUserHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/userhistory/root.go b/cmd/cli/cmd/userhistory/root.go new file mode 100644 index 0000000..8011194 --- /dev/null +++ b/cmd/cli/cmd/userhistory/root.go @@ -0,0 +1,87 @@ +package userhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base userHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "user-history", + Short: "the subcommands for working with userHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the userHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the userHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllUserHistories: + var nodes []*openlaneclient.GetAllUserHistories_UserHistories_Edges_Node + + for _, i := range v.UserHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetUserHistories: + var nodes []*openlaneclient.GetUserHistories_UserHistories_Edges_Node + + for _, i := range v.UserHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.UserHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.UserHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.UserHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/usersetting/doc.go b/cmd/cli/cmd/usersetting/doc.go new file mode 100644 index 0000000..2e25c8c --- /dev/null +++ b/cmd/cli/cmd/usersetting/doc.go @@ -0,0 +1,2 @@ +// Package usersetting is our cobra cli for user setting endpoints +package usersetting diff --git a/cmd/cli/cmd/usersetting/get.go b/cmd/cli/cmd/usersetting/get.go new file mode 100644 index 0000000..db201c8 --- /dev/null +++ b/cmd/cli/cmd/usersetting/get.go @@ -0,0 +1,48 @@ +package usersetting + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get user settings", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "user setting id to retrieve") +} + +// get retrieves user settings from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + + // if setting ID is not provided, get settings which will automatically filter by user id + if id != "" { + o, err := client.GetUserSettingByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllUserSettings(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/usersetting/root.go b/cmd/cli/cmd/usersetting/root.go new file mode 100644 index 0000000..e927e0e --- /dev/null +++ b/cmd/cli/cmd/usersetting/root.go @@ -0,0 +1,92 @@ +package usersetting + +import ( + "encoding/json" + "strings" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base user setting command when called without any subcommands +var command = &cobra.Command{ + Use: "user-setting", + Short: "the subcommands for working with the user settings", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllUserSettings: + var nodes []*openlaneclient.GetAllUserSettings_UserSettings_Edges_Node + + for _, i := range v.UserSettings.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetUserSettingByID: + e = v.UserSetting + case *openlaneclient.UpdateUserSetting: + e = v.UpdateUserSetting.UserSetting + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.UserSetting + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.UserSetting + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.UserSetting) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "DefaultOrgName", "DefaultOrgID", "2FA", "Status", "EmailConfirmed", "Tags") + + for _, i := range out { + defaultOrgName := "" + defaultOrgID := "" + + if i.DefaultOrg != nil { + defaultOrgName = i.DefaultOrg.Name + defaultOrgID = i.DefaultOrg.ID + } + + writer.AddRow(i.ID, defaultOrgName, defaultOrgID, *i.IsTfaEnabled, i.Status, i.EmailConfirmed, strings.Join(i.Tags, ", ")) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/usersetting/update.go b/cmd/cli/cmd/usersetting/update.go new file mode 100644 index 0000000..df61b28 --- /dev/null +++ b/cmd/cli/cmd/usersetting/update.go @@ -0,0 +1,104 @@ +package usersetting + +import ( + "context" + "time" + + "github.com/samber/lo" + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing user setting", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "user setting id to update") + updateCmd.Flags().String("status", "", "status of the user - active, inactive, suspended") + updateCmd.Flags().StringP("default-org", "o", "", "default organization id") + updateCmd.Flags().StringSliceP("tags", "t", []string{}, "tags associated with the user") + updateCmd.Flags().BoolP("silence-notifications", "s", false, "silence notifications") + updateCmd.Flags().Bool("enable-2fa", false, "enable 2fa authentication") + updateCmd.Flags().Bool("disable-2fa", false, "disable 2fa authentication") +} + +// updateValidation validates the input flags provided by the user +func updateValidation() (id string, input openlaneclient.UpdateUserSettingInput, err error) { + id = cmd.Config.String("id") + + // set default org if provided + defaultOrg := cmd.Config.String("default-org") + if defaultOrg != "" { + input.DefaultOrgID = &defaultOrg + } + + // set silenced at time if silence flag is set + if cmd.Config.Bool("silence") { + now := time.Now().UTC() + input.SilencedAt = &now + } else { + input.SilencedAt = nil + } + + // explicitly set 2fa if provided to avoid wiping setting unintentionally + if cmd.Config.Bool("enable-2fa") { + input.IsTfaEnabled = lo.ToPtr(true) + } else if cmd.Config.Bool("disable-2fa") { + input.IsTfaEnabled = lo.ToPtr(false) + } + + // add tags to the input if provided + tags := cmd.Config.Strings("tags") + if len(tags) > 0 { + input.Tags = tags + } + + // add status to the input if provided + status := cmd.Config.String("status") + if status != "" { + input.Status = enums.ToUserStatus(status) + } + + return id, input, nil +} + +// update an existing user setting +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + if id == "" { + // get the user settings id + settings, err := client.GetAllUserSettings(ctx) + cobra.CheckErr(err) + + // this should never happen, but just in case + if len(settings.GetUserSettings().Edges) == 0 { + return cmd.ErrNotFound + } + + id = settings.GetUserSettings().Edges[0].Node.ID + } + + // update the user settings + o, err := client.UpdateUserSetting(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/usersettinghistory/doc.go b/cmd/cli/cmd/usersettinghistory/doc.go new file mode 100644 index 0000000..a24cc0a --- /dev/null +++ b/cmd/cli/cmd/usersettinghistory/doc.go @@ -0,0 +1,2 @@ +// Package usersettinghistory is our cobra cli for userSettingHistory endpoints +package usersettinghistory diff --git a/cmd/cli/cmd/usersettinghistory/get.go b/cmd/cli/cmd/usersettinghistory/get.go new file mode 100644 index 0000000..d6165bb --- /dev/null +++ b/cmd/cli/cmd/usersettinghistory/get.go @@ -0,0 +1,49 @@ +package usersettinghistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing userSettingHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing userSettingHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetUserSettingHistories(ctx, &openlaneclient.UserSettingHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllUserSettingHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/usersettinghistory/root.go b/cmd/cli/cmd/usersettinghistory/root.go new file mode 100644 index 0000000..7582692 --- /dev/null +++ b/cmd/cli/cmd/usersettinghistory/root.go @@ -0,0 +1,87 @@ +package usersettinghistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base userSettingHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "user-setting-history", + Short: "the subcommands for working with userSettingHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the userSettingHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the userSettingHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllUserSettingHistories: + var nodes []*openlaneclient.GetAllUserSettingHistories_UserSettingHistories_Edges_Node + + for _, i := range v.UserSettingHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetUserSettingHistories: + var nodes []*openlaneclient.GetUserSettingHistories_UserSettingHistories_Edges_Node + + for _, i := range v.UserSettingHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.UserSettingHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.UserSettingHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.UserSettingHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/version/doc.go b/cmd/cli/cmd/version/doc.go new file mode 100644 index 0000000..9fee35a --- /dev/null +++ b/cmd/cli/cmd/version/doc.go @@ -0,0 +1,2 @@ +// Package version contains the version information for the CLI +package version diff --git a/cmd/cli/cmd/version/root.go b/cmd/cli/cmd/version/root.go new file mode 100644 index 0000000..870f663 --- /dev/null +++ b/cmd/cli/cmd/version/root.go @@ -0,0 +1,24 @@ +package version + +import ( + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/internal/constants" + "github.com/theopenlane/core/pkg/utils/cli/useragent" +) + +// VersionCmd is the version command +var command = &cobra.Command{ + Use: "version", + Short: "print the CLI version", + Long: `The version command prints the version of the CLI`, + Run: func(cmd *cobra.Command, _ []string) { + cmd.Println(constants.VerboseCLIVersion) + cmd.Printf("User Agent: %s\n", useragent.GetUserAgent()) + }, +} + +func init() { + cmd.RootCmd.AddCommand(command) +} diff --git a/cmd/cli/cmd/webhook/create.go b/cmd/cli/cmd/webhook/create.go new file mode 100644 index 0000000..5d58d11 --- /dev/null +++ b/cmd/cli/cmd/webhook/create.go @@ -0,0 +1,69 @@ +package webhooks + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new webhook", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + createCmd.Flags().StringP("name", "n", "", "name of the webhook") + createCmd.Flags().StringP("description", "d", "", "description of the webhook") + createCmd.Flags().StringP("url", "u", "", "the destination url the webhook is sent to") + createCmd.Flags().BoolP("enabled", "e", true, "if the webhook is enabled") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.CreateWebhookInput, err error) { + input.Name = cmd.Config.String("name") + if input.Name == "" { + return input, cmd.NewRequiredFieldMissingError("name") + } + + input.DestinationURL = cmd.Config.String("url") + if input.DestinationURL == "" { + return input, cmd.NewRequiredFieldMissingError("url") + } + + enabled := cmd.Config.Bool("enabled") + if !enabled { + input.Enabled = &enabled + } + + description := cmd.Config.String("description") + if description != "" { + input.Description = &description + } + + return input, nil +} + +// create a new webhook +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.CreateWebhook(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/webhook/delete.go b/cmd/cli/cmd/webhook/delete.go new file mode 100644 index 0000000..62c2dd2 --- /dev/null +++ b/cmd/cli/cmd/webhook/delete.go @@ -0,0 +1 @@ +package webhooks diff --git a/cmd/cli/cmd/webhook/doc.go b/cmd/cli/cmd/webhook/doc.go new file mode 100644 index 0000000..62c2dd2 --- /dev/null +++ b/cmd/cli/cmd/webhook/doc.go @@ -0,0 +1 @@ +package webhooks diff --git a/cmd/cli/cmd/webhook/get.go b/cmd/cli/cmd/webhook/get.go new file mode 100644 index 0000000..799e226 --- /dev/null +++ b/cmd/cli/cmd/webhook/get.go @@ -0,0 +1,46 @@ +package webhooks + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get details of existing webhooks", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + getCmd.Flags().StringP("id", "i", "", "get a specific webhook by ID") +} + +// get retrieves webhooks from the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id := cmd.Config.String("id") + + if id != "" { + o, err := client.GetWebhookByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + o, err := client.GetAllWebhooks(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/webhook/root.go b/cmd/cli/cmd/webhook/root.go new file mode 100644 index 0000000..93668e6 --- /dev/null +++ b/cmd/cli/cmd/webhook/root.go @@ -0,0 +1,85 @@ +package webhooks + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base webhook command when called without any subcommands +var command = &cobra.Command{ + Use: "webhook", + Short: "the subcommands for working with webhooks", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the output in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the output and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllWebhooks: + var nodes []*openlaneclient.GetAllWebhooks_Webhooks_Edges_Node + + for _, i := range v.Webhooks.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetWebhookByID: + e = v.Webhook + case *openlaneclient.CreateWebhook: + e = v.CreateWebhook.Webhook + case *openlaneclient.UpdateWebhook: + e = v.UpdateWebhook.Webhook + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.Webhook + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.Webhook + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.Webhook) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Description", "Destination URL", "Enabled") + for _, i := range out { + // this doesn't visually show you the json in the table but leaving it in for now + writer.AddRow(i.ID, i.Name, *i.Description, i.DestinationURL, i.Enabled) + } + + writer.Render() +} diff --git a/cmd/cli/cmd/webhook/update.go b/cmd/cli/cmd/webhook/update.go new file mode 100644 index 0000000..62c2dd2 --- /dev/null +++ b/cmd/cli/cmd/webhook/update.go @@ -0,0 +1 @@ +package webhooks diff --git a/cmd/cli/cmd/webhookhistory/doc.go b/cmd/cli/cmd/webhookhistory/doc.go new file mode 100644 index 0000000..9577fbf --- /dev/null +++ b/cmd/cli/cmd/webhookhistory/doc.go @@ -0,0 +1,2 @@ +// Package webhookhistory is our cobra cli for webhookHistory endpoints +package webhookhistory diff --git a/cmd/cli/cmd/webhookhistory/get.go b/cmd/cli/cmd/webhookhistory/get.go new file mode 100644 index 0000000..7ac5bf5 --- /dev/null +++ b/cmd/cli/cmd/webhookhistory/get.go @@ -0,0 +1,49 @@ +package webhookhistory + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing webhookHistory", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "id to query") +} + +// get an existing webhookHistory in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.GetWebhookHistories(ctx, &openlaneclient.WebhookHistoryWhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllWebhookHistories(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/webhookhistory/root.go b/cmd/cli/cmd/webhookhistory/root.go new file mode 100644 index 0000000..a278ddc --- /dev/null +++ b/cmd/cli/cmd/webhookhistory/root.go @@ -0,0 +1,87 @@ +package webhookhistory + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/utils/cli/tables" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +// cmd represents the base webhookHistory command when called without any subcommands +var command = &cobra.Command{ + Use: "webhook-history", + Short: "the subcommands for working with webhookHistories", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the webhookHistories in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the webhookHistories and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllWebhookHistories: + var nodes []*openlaneclient.GetAllWebhookHistories_WebhookHistories_Edges_Node + + for _, i := range v.WebhookHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetWebhookHistories: + var nodes []*openlaneclient.GetWebhookHistories_WebhookHistories_Edges_Node + + for _, i := range v.WebhookHistories.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.WebhookHistory + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.WebhookHistory + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.WebhookHistory) { + // create a table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + for _, i := range out { + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + } + + writer.Render() +} diff --git a/cmd/cli/main.go b/cmd/cli/main.go new file mode 100644 index 0000000..6ec8609 --- /dev/null +++ b/cmd/cli/main.go @@ -0,0 +1,63 @@ +package main + +import ( + core "github.com/theopenlane/core/cmd/cli/cmd" + + // since the cmds are not part of the same package + // they must all be imported in main + _ "github.com/theopenlane/core/cmd/cli/cmd/apitokens" + _ "github.com/theopenlane/core/cmd/cli/cmd/contact" + _ "github.com/theopenlane/core/cmd/cli/cmd/entitlementplan" + _ "github.com/theopenlane/core/cmd/cli/cmd/entitlementplanfeatures" + _ "github.com/theopenlane/core/cmd/cli/cmd/entitlements" + _ "github.com/theopenlane/core/cmd/cli/cmd/entity" + _ "github.com/theopenlane/core/cmd/cli/cmd/entitytype" + _ "github.com/theopenlane/core/cmd/cli/cmd/events" + _ "github.com/theopenlane/core/cmd/cli/cmd/features" + _ "github.com/theopenlane/core/cmd/cli/cmd/group" + _ "github.com/theopenlane/core/cmd/cli/cmd/groupmembers" + _ "github.com/theopenlane/core/cmd/cli/cmd/groupsetting" + _ "github.com/theopenlane/core/cmd/cli/cmd/integration" + _ "github.com/theopenlane/core/cmd/cli/cmd/invite" + _ "github.com/theopenlane/core/cmd/cli/cmd/login" + _ "github.com/theopenlane/core/cmd/cli/cmd/organization" + _ "github.com/theopenlane/core/cmd/cli/cmd/organizationsetting" + _ "github.com/theopenlane/core/cmd/cli/cmd/orgmembers" + _ "github.com/theopenlane/core/cmd/cli/cmd/personalaccesstokens" + _ "github.com/theopenlane/core/cmd/cli/cmd/register" + _ "github.com/theopenlane/core/cmd/cli/cmd/reset" + _ "github.com/theopenlane/core/cmd/cli/cmd/search" + _ "github.com/theopenlane/core/cmd/cli/cmd/subscriber" + _ "github.com/theopenlane/core/cmd/cli/cmd/switchcontext" + _ "github.com/theopenlane/core/cmd/cli/cmd/template" + _ "github.com/theopenlane/core/cmd/cli/cmd/user" + _ "github.com/theopenlane/core/cmd/cli/cmd/usersetting" + _ "github.com/theopenlane/core/cmd/cli/cmd/version" + _ "github.com/theopenlane/core/cmd/cli/cmd/webhook" + + // history commands + _ "github.com/theopenlane/core/cmd/cli/cmd/documentdatahistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/entitlementhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/entityhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/entitytypehistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/eventhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/featurehistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/filehistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/grouphistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/groupmembershiphistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/groupsettinghistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/hushhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/integrationhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/oauthproviderhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/organizationhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/organizationsettinghistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/orgmembershiphistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/templatehistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/userhistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/usersettinghistory" + _ "github.com/theopenlane/core/cmd/cli/cmd/webhookhistory" +) + +func main() { + core.Execute() +} diff --git a/cmd/doc.go b/cmd/doc.go new file mode 100644 index 0000000..b7c3e01 --- /dev/null +++ b/cmd/doc.go @@ -0,0 +1,2 @@ +// Package cmd is our cobra cli implementation +package cmd diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 0000000..e14be30 --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,79 @@ +package cmd + +import ( + "log" + + "github.com/knadh/koanf/providers/posflag" + "github.com/knadh/koanf/v2" + "github.com/spf13/cobra" + "go.uber.org/zap" +) + +const appName = "core" + +var ( + logger *zap.SugaredLogger + k *koanf.Koanf +) + +// rootCmd represents the base command when called without any subcommands +var rootCmd = &cobra.Command{ + Use: appName, + Short: "A cli for interacting with the core server", + PersistentPreRun: func(cmd *cobra.Command, args []string) { + err := initCmdFlags(cmd) + cobra.CheckErr(err) + }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + cobra.CheckErr(rootCmd.Execute()) +} + +func init() { + k = koanf.New(".") // Create a new koanf instance. + + cobra.OnInitialize(initConfig) + + rootCmd.PersistentFlags().Bool("pretty", false, "enable pretty (human readable) logging output") + rootCmd.PersistentFlags().Bool("debug", false, "debug logging output") +} + +// initConfig reads in flags set for server startup +// all other configuration is done by the server with koanf +// refer to the README.md for more information +func initConfig() { + if err := initCmdFlags(rootCmd); err != nil { + log.Fatalf("error loading config: %v", err) + } + + setupLogging() +} + +// initCmdFlags loads the flags from the command line into the koanf instance +func initCmdFlags(cmd *cobra.Command) error { + return k.Load(posflag.Provider(cmd.Flags(), k.Delim(), k), nil) +} + +func setupLogging() { + cfg := zap.NewProductionConfig() + if k.Bool("pretty") { + cfg = zap.NewDevelopmentConfig() + } + + if k.Bool("debug") { + cfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel) + } else { + cfg.Level = zap.NewAtomicLevelAt(zap.InfoLevel) + } + + l, err := cfg.Build() + if err != nil { + panic(err) + } + + logger = l.Sugar().With("app", appName) + defer logger.Sync() //nolint:errcheck +} diff --git a/cmd/serve.go b/cmd/serve.go new file mode 100644 index 0000000..69dfbae --- /dev/null +++ b/cmd/serve.go @@ -0,0 +1,164 @@ +package cmd + +import ( + "context" + + "github.com/spf13/cobra" + "go.uber.org/zap" + + dbx "github.com/theopenlane/dbx/pkg/dbxclient" + "github.com/theopenlane/iam/fgax" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/entdb" + "github.com/theopenlane/core/internal/httpserve/authmanager" + "github.com/theopenlane/core/internal/httpserve/config" + "github.com/theopenlane/core/internal/httpserve/server" + "github.com/theopenlane/core/internal/httpserve/serveropts" + "github.com/theopenlane/core/pkg/cache" + "github.com/theopenlane/core/pkg/otelx" +) + +var serveCmd = &cobra.Command{ + Use: "serve", + Short: "start the core api server", + Run: func(cmd *cobra.Command, args []string) { + err := serve(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + rootCmd.AddCommand(serveCmd) + + serveCmd.PersistentFlags().String("config", "./config/.config.yaml", "config file location") +} + +func serve(ctx context.Context) error { + // setup db connection for server + var ( + fgaClient *fgax.Client + err error + ) + + // create ent dependency injection + entOpts := []ent.Option{ent.Logger(*logger)} + + serverOpts := []serveropts.ServerOption{} + serverOpts = append(serverOpts, + serveropts.WithConfigProvider(&config.ConfigProviderWithRefresh{}), + serveropts.WithLogger(logger), + serveropts.WithHTTPS(), + serveropts.WithEmailManager(), + serveropts.WithTaskManager(), + serveropts.WithMiddleware(), + serveropts.WithRateLimiter(), + serveropts.WithSecureMW(), + serveropts.WithCacheHeaders(), + serveropts.WithCORS(), + serveropts.WithAnalytics(), + serveropts.WithEventPublisher(), + ) + + so := serveropts.NewServerOptions(serverOpts, k.String("config")) + + // Create keys for development + if so.Config.Settings.Auth.Token.GenerateKeys { + so.AddServerOptions(serveropts.WithGeneratedKeys()) + } + + // add auth session manager + so.Config.Handler.AuthManager = authmanager.New() + + // setup token manager + so.AddServerOptions( + serveropts.WithTokenManager(), + ) + + err = otelx.NewTracer(so.Config.Settings.Tracer, appName, logger) + if err != nil { + logger.Fatalw("failed to initialize tracer", "error", err) + } + + // setup Authz connection + // this must come before the database setup because the FGA Client + // is used as an ent dependency + fgaClient, err = fgax.CreateFGAClientWithStore(ctx, so.Config.Settings.Authz, so.Config.Logger) + if err != nil { + return err + } + + // Setup Redis connection + redisClient := cache.New(so.Config.Settings.Redis) + defer redisClient.Close() + + // add session manager + so.AddServerOptions( + serveropts.WithSessionManager(redisClient), + ) + + // Setup Geodetic client + if so.Config.Settings.DBx.Enabled { + gc := so.Config.Settings.DBx.NewDefaultClient() + + entOpts = append(entOpts, ent.DBx(gc.(*dbx.Client))) + } + + // add otp manager, after redis is setup + so.AddServerOptions( + serveropts.WithOTP(), + ) + + // add additional ent dependencies + entOpts = append( + entOpts, + ent.Authz(*fgaClient), + ent.Emails(so.Config.Handler.EmailManager), + ent.Marionette(so.Config.Handler.TaskMan), + ent.Analytics(so.Config.Handler.AnalyticsClient), + ent.TOTP(so.Config.Handler.OTPManager), + ent.TokenManager(so.Config.Handler.TokenManager), + ent.SessionConfig(so.Config.Handler.SessionConfig), + ent.EntConfig(&so.Config.Settings.EntConfig), + ) + + // Setup DB connection + entdbClient, dbConfig, err := entdb.NewMultiDriverDBClient(ctx, so.Config.Settings.DB, logger, entOpts) + if err != nil { + return err + } + + defer entdbClient.Close() + + // Add Driver to the Handlers Config + so.Config.Handler.DBClient = entdbClient + + // Add redis client to Handlers Config + so.Config.Handler.RedisClient = redisClient + + // add ready checks + so.AddServerOptions( + serveropts.WithReadyChecks(dbConfig, fgaClient, redisClient), + ) + + // add auth options + so.AddServerOptions( + serveropts.WithAuth(), + ) + + // add session manager + so.AddServerOptions( + serveropts.WithSessionMiddleware(), + ) + + srv := server.NewServer(so.Config, so.Config.Logger) + + // Setup Graph API Handlers + so.AddServerOptions(serveropts.WithGraphRoute(srv, entdbClient)) + + if err := srv.StartEchoServer(ctx); err != nil { + logger.Error("failed to run server", zap.Error(err)) + } + + return nil +} diff --git a/config/.env.example b/config/.env.example new file mode 100644 index 0000000..3cdc16d --- /dev/null +++ b/config/.env.example @@ -0,0 +1,157 @@ +CORE_REFRESHINTERVAL="10m" +CORE_SERVER_DEBUG="false" +CORE_SERVER_DEV="false" +CORE_SERVER_LISTEN=":17608" +CORE_SERVER_SHUTDOWNGRACEPERIOD="10s" +CORE_SERVER_READTIMEOUT="15s" +CORE_SERVER_WRITETIMEOUT="15s" +CORE_SERVER_IDLETIMEOUT="30s" +CORE_SERVER_READHEADERTIMEOUT="2s" +CORE_SERVER_TLS_ENABLED="false" +CORE_SERVER_TLS_CERTFILE="server.crt" +CORE_SERVER_TLS_CERTKEY="server.key" +CORE_SERVER_TLS_AUTOCERT="false" +CORE_SERVER_CORS_ENABLED="true" +CORE_SERVER_CORS_PREFIXES="" +CORE_SERVER_CORS_ALLOWORIGINS="" +CORE_SERVER_CORS_COOKIEINSECURE="" +CORE_SERVER_SECURE_ENABLED="true" +CORE_SERVER_SECURE_XSSPROTECTION="1; mode=block" +CORE_SERVER_SECURE_CONTENTTYPENOSNIFF="nosniff" +CORE_SERVER_SECURE_XFRAMEOPTIONS="SAMEORIGIN" +CORE_SERVER_SECURE_HSTSPRELOADENABLED="false" +CORE_SERVER_SECURE_HSTSMAXAGE="31536000" +CORE_SERVER_SECURE_CONTENTSECURITYPOLICY="default-src 'self'" +CORE_SERVER_SECURE_REFERRERPOLICY="same-origin" +CORE_SERVER_SECURE_CSPREPORTONLY="false" +CORE_SERVER_REDIRECTS_ENABLED="true" +CORE_SERVER_REDIRECTS_REDIRECTS="" +CORE_SERVER_REDIRECTS_CODE="" +CORE_SERVER_CACHECONTROL_ENABLED="true" +CORE_SERVER_CACHECONTROL_NOCACHEHEADERS="" +CORE_SERVER_CACHECONTROL_ETAGHEADERS="" +CORE_SERVER_MIME_ENABLED="true" +CORE_SERVER_MIME_MIMETYPESFILE="" +CORE_SERVER_MIME_DEFAULTCONTENTTYPE="application/data" +CORE_SERVER_GRAPHPOOL_MAXWORKERS="100" +CORE_SERVER_GRAPHPOOL_MAXCAPACITY="1000" +CORE_SERVER_ENABLEGRAPHEXTENSIONS="true" +CORE_ENTCONFIG_FLAGS_USELISTUSERSERVICE="true" +CORE_ENTCONFIG_FLAGS_USELISTOBJECTSERVICES="false" +CORE_ENTCONFIG_ENTITYTYPES="" +CORE_AUTH_ENABLED="true" +CORE_AUTH_TOKEN_KID="" +CORE_AUTH_TOKEN_AUDIENCE="https://theopenlane.io" +CORE_AUTH_TOKEN_REFRESHAUDIENCE="" +CORE_AUTH_TOKEN_ISSUER="https://auth.theopenlane.io" +CORE_AUTH_TOKEN_ACCESSDURATION="1h" +CORE_AUTH_TOKEN_REFRESHDURATION="2h" +CORE_AUTH_TOKEN_REFRESHOVERLAP="-15m" +CORE_AUTH_TOKEN_JWKSENDPOINT="https://api.theopenlane.io/.well-known/jwks.json" +CORE_AUTH_TOKEN_KEYS="" +CORE_AUTH_TOKEN_GENERATEKEYS="true" +CORE_AUTH_SUPPORTEDPROVIDERS="" +CORE_AUTH_PROVIDERS_REDIRECTURL="http://localhost:3001/api/auth/callback/theopenlane" +CORE_AUTH_PROVIDERS_GITHUB_CLIENTID="" +CORE_AUTH_PROVIDERS_GITHUB_CLIENTSECRET="" +CORE_AUTH_PROVIDERS_GITHUB_CLIENTENDPOINT="http://localhost:17608" +CORE_AUTH_PROVIDERS_GITHUB_SCOPES="" +CORE_AUTH_PROVIDERS_GITHUB_REDIRECTURL="/v1/github/callback" +CORE_AUTH_PROVIDERS_GOOGLE_CLIENTID="" +CORE_AUTH_PROVIDERS_GOOGLE_CLIENTSECRET="" +CORE_AUTH_PROVIDERS_GOOGLE_CLIENTENDPOINT="http://localhost:17608" +CORE_AUTH_PROVIDERS_GOOGLE_SCOPES="" +CORE_AUTH_PROVIDERS_GOOGLE_REDIRECTURL="/v1/google/callback" +CORE_AUTH_PROVIDERS_WEBAUTHN_ENABLED="true" +CORE_AUTH_PROVIDERS_WEBAUTHN_DISPLAYNAME="" +CORE_AUTH_PROVIDERS_WEBAUTHN_RELYINGPARTYID="localhost" +CORE_AUTH_PROVIDERS_WEBAUTHN_REQUESTORIGINS="[http://localhost:3001]" +CORE_AUTH_PROVIDERS_WEBAUTHN_MAXDEVICES="10" +CORE_AUTH_PROVIDERS_WEBAUTHN_ENFORCETIMEOUT="true" +CORE_AUTH_PROVIDERS_WEBAUTHN_TIMEOUT="60s" +CORE_AUTH_PROVIDERS_WEBAUTHN_DEBUG="false" +CORE_AUTHZ_ENABLED="true" +CORE_AUTHZ_STORENAME="openlane" +CORE_AUTHZ_HOSTURL="https://authz.theopenlane.io" +CORE_AUTHZ_STOREID="" +CORE_AUTHZ_MODELID="" +CORE_AUTHZ_CREATENEWMODEL="false" +CORE_AUTHZ_MODELFILE="fga/model/openlane.fga" +CORE_AUTHZ_CREDENTIALS_APITOKEN="" +CORE_AUTHZ_CREDENTIALS_CLIENTID="" +CORE_AUTHZ_CREDENTIALS_CLIENTSECRET="" +CORE_AUTHZ_CREDENTIALS_AUDIENCE="" +CORE_AUTHZ_CREDENTIALS_ISSUER="" +CORE_AUTHZ_CREDENTIALS_SCOPES="" +CORE_DB_DEBUG="false" +CORE_DB_DATABASENAME="openlane" +CORE_DB_DRIVERNAME="libsql" +CORE_DB_MULTIWRITE="false" +CORE_DB_PRIMARYDBSOURCE="file:openlane.db" +CORE_DB_SECONDARYDBSOURCE="file:backup.db" +CORE_DB_CACHETTL="1s" +CORE_DB_RUNMIGRATIONS="true" +CORE_DB_MIGRATIONPROVIDER="atlas" +CORE_DB_ENABLEHISTORY="false" +CORE_DBX_ENABLED="true" +CORE_DBX_BASEURL="http://localhost:1337" +CORE_DBX_ENDPOINT="query" +CORE_DBX_DEBUG="false" +CORE_REDIS_ENABLED="true" +CORE_REDIS_ADDRESS="localhost:6379" +CORE_REDIS_NAME="openlane" +CORE_REDIS_USERNAME="" +CORE_REDIS_PASSWORD="" +CORE_REDIS_DB="0" +CORE_REDIS_DIALTIMEOUT="5s" +CORE_REDIS_READTIMEOUT="0" +CORE_REDIS_WRITETIMEOUT="0" +CORE_REDIS_MAXRETRIES="3" +CORE_REDIS_MINIDLECONNS="0" +CORE_REDIS_MAXIDLECONNS="0" +CORE_REDIS_MAXACTIVECONNS="0" +CORE_TRACER_ENABLED="false" +CORE_TRACER_PROVIDER="stdout" +CORE_TRACER_ENVIRONMENT="development" +CORE_TRACER_STDOUT_PRETTY="true" +CORE_TRACER_STDOUT_DISABLETIMESTAMP="false" +CORE_TRACER_OTLP_ENDPOINT="localhost:4317" +CORE_TRACER_OTLP_INSECURE="true" +CORE_TRACER_OTLP_CERTIFICATE="" +CORE_TRACER_OTLP_HEADERS="" +CORE_TRACER_OTLP_COMPRESSION="" +CORE_TRACER_OTLP_TIMEOUT="10s" +CORE_EMAIL_SENDGRIDAPIKEY="" +CORE_EMAIL_FROMEMAIL="no-reply@theopenlane.io" +CORE_EMAIL_TESTING="true" +CORE_EMAIL_ARCHIVE="" +CORE_EMAIL_LISTID="" +CORE_EMAIL_ADMINEMAIL="admins@theopenlane.io" +CORE_EMAIL_CONSOLEURL_CONSOLEBASE="https://console.theopenlane.io" +CORE_EMAIL_CONSOLEURL_VERIFY="/verify" +CORE_EMAIL_CONSOLEURL_INVITE="/invite" +CORE_EMAIL_CONSOLEURL_RESET="/password-reset" +CORE_EMAIL_MARKETINGURL_MARKETINGBASE="https://www.theopenlane.io" +CORE_EMAIL_MARKETINGURL_SUBSCRIBERVERIFY="/verify" +CORE_SESSIONS_SIGNINGKEY="my-signing-secret" +CORE_SESSIONS_ENCRYPTIONKEY="encryptionsecret" +CORE_SESSIONS_DOMAIN="" +CORE_POSTHOG_ENABLED="false" +CORE_POSTHOG_APIKEY="" +CORE_POSTHOG_HOST="https://app.posthog.com" +CORE_TOTP_ENABLED="true" +CORE_TOTP_CODELENGTH="6" +CORE_TOTP_ISSUER="" +CORE_TOTP_REDIS="true" +CORE_TOTP_SECRET="" +CORE_TOTP_RECOVERYCODECOUNT="16" +CORE_TOTP_RECOVERYCODELENGTH="8" +CORE_RATELIMIT_ENABLED="false" +CORE_RATELIMIT_LIMIT="10" +CORE_RATELIMIT_BURST="30" +CORE_RATELIMIT_EXPIRES="10m" +CORE_PUBLISHERCONFIG_ENABLED="false" +CORE_PUBLISHERCONFIG_APPNAME="openlane" +CORE_PUBLISHERCONFIG_ADDRESS="localhost:10000" +CORE_PUBLISHERCONFIG_ADDRESSES="[localhost:10000]" +CORE_PUBLISHERCONFIG_DEBUG="false" diff --git a/config/README.md b/config/README.md new file mode 100644 index 0000000..ef5da3b --- /dev/null +++ b/config/README.md @@ -0,0 +1,20 @@ +# Configuration + +You will need to perform a 1-time action of creating a `.config.yaml` file based on the `.example` files. +The Taskfiles will also source a `.dotenv` files which match the naming conventions called for `{{.ENV}}` to ease the overriding of environment variables. These files are intentionally added to the `.gitignore` within this repository to prevent you from accidentally committing secrets or other sensitive information which may live inside the server's environment variables. + +All settings in the `yaml` configuration can also be overwritten with environment variables prefixed with `CORE_`. For example, to override the Google `client_secret` set in the yaml configuration with an environment variable you can use: + +``` +export CORE_AUTH_PROVIDERS_GOOGLE_CLIENTSECRET +``` + +Configuration precedence is as follows, the latter overriding the former: + +1. `default` values set in the config struct within the code +1. `.config.yaml` values +1. Environment variables + +## Regenerating + +If you've made changes to the code in this code base (specifically interfaces referenced in the `config.go`) and want to regenerate the configuration, run `task config:generate` \ No newline at end of file diff --git a/config/config-aio.example.yaml b/config/config-aio.example.yaml new file mode 100644 index 0000000..bfc0752 --- /dev/null +++ b/config/config-aio.example.yaml @@ -0,0 +1,41 @@ +# db settings +db: + debug: true + multiWrite: false + +# auth settings +auth: + enabled: true + supportedProviders: + - google + - github + providers: + google: + scopes: + - email + - profile + github: + scopes: + - user:email + - read:user + webauthn: + debug: false + enabled: true + relyingPartyId: "api.theopenlane.io" + requestOrigins: + - "https://console.theopenlane.io" + +# authz settings +authz: + enabled: true + storeName: openlane + +# email settings +email: + testing: false + consoleUrl: + consoleBase: "https://console.theopenlane.io" + +# analytics settings +posthog: + enabled: true diff --git a/config/config-dev.example.yaml b/config/config-dev.example.yaml new file mode 100644 index 0000000..d57fcef --- /dev/null +++ b/config/config-dev.example.yaml @@ -0,0 +1,87 @@ +# server settings +server: + debug: true + dev: true + cors: + allowOrigins: + - http://localhost:3001 + - http://localhost:5500 + # tls settings + tls: + enabled: false +# db settings +db: + debug: true + driverName: postgres + primaryDbSource: "postgres://postgres:password@0.0.0.0:5432/core?sslmode=disable" + multiWrite: false + migrationProvider: "goose" + enableHistory: true +# auth settings +auth: + enabled: true + token: + kid: "02GGBS68AM12178M0REW3CEAFF" + audience: "http://localhost:17608" + refreshAudience: "http://localhost:17608" + issuer: "http://localhost:17608" + jwksEndpoint: "http://localhost:17608/.well-known/jwks.json" + supportedProviders: + - google + - github + providers: + google: + clientId: "client_id_here.apps.googleusercontent.com" + clientSecret: "client_secret_here" + scopes: + - email + - profile + github: + clientId: "client_id_here" + clientSecret: "client_secret_here" + scopes: + - user:email + - read:user + webauthn: + debug: false + enabled: true + relyingPartyId: "localhost" + requestOrigins: + - "http://localhost:3001" +# authz settings +authz: + enabled: true + storeName: openlane + hostUrl: http://localhost:8080 + createNewModel: false + credentials: + apiToken: "QKwHEmWX99RnFh28eSRJ3GWlfb2FQkL7toh1GJpzch1mMkVeMg" + +# session settings +sessions: + encryptionKey: encryptionsecret + signingKey: my-signing-secret +# email settings +email: + testing: true + archive: "fixtures/email" + sendGridApiKey: "SG.FakeAPIKey" + consoleUrl: + consoleBase: "http://localhost:17608/" +# analytics settings +posthog: + enabled: false + apiKey: "phc_FakeKey" +publisherConfig: + appName: openlane + addresses: + - localhost:10000 + enabled: true + +entConfig: + entityTypes: + - vendor + - account + flags: + useListObjectServices: false + useListUserService: true \ No newline at end of file diff --git a/config/config.example.yaml b/config/config.example.yaml new file mode 100644 index 0000000..593ff8d --- /dev/null +++ b/config/config.example.yaml @@ -0,0 +1,192 @@ +auth: + enabled: true + providers: + github: + clientEndpoint: http://localhost:17608 + clientId: "" + clientSecret: "" + redirectUrl: /v1/github/callback + scopes: null + google: + clientEndpoint: http://localhost:17608 + clientId: "" + clientSecret: "" + redirectUrl: /v1/google/callback + scopes: null + redirectUrl: http://localhost:3001/api/auth/callback/theopenlane + webauthn: + debug: false + displayName: "" + enabled: true + enforceTimeout: true + maxDevices: 10 + relyingPartyId: localhost + requestOrigins: + - http://localhost:3001 + timeout: 60000000000 + supportedProviders: null + token: + accessDuration: 3600000000000 + audience: https://theopenlane.io + generateKeys: true + issuer: https://auth.theopenlane.io + jwksEndpoint: https://api.theopenlane.io/.well-known/jwks.json + keys: null + kid: "" + refreshAudience: "" + refreshDuration: 7200000000000 + refreshOverlap: -900000000000 +authz: + createNewModel: false + credentials: + apiToken: "" + audience: "" + clientId: "" + clientSecret: "" + issuer: "" + scopes: "" + enabled: true + hostUrl: https://authz.theopenlane.io + modelFile: fga/model/openlane.fga + modelId: "" + storeId: "" + storeName: openlane +db: + cacheTTL: 1000000000 + databaseName: openlane + debug: false + driverName: libsql + enableHistory: false + migrationProvider: atlas + multiWrite: false + primaryDbSource: file:openlane.db + runMigrations: true + secondaryDbSource: file:backup.db +dbx: + baseUrl: http://localhost:1337 + debug: false + enabled: true + endpoint: query +email: + adminEmail: admins@theopenlane.io + archive: "" + consoleUrl: + consoleBase: https://console.theopenlane.io + invite: /invite + reset: /password-reset + verify: /verify + fromEmail: no-reply@theopenlane.io + listId: "" + marketingUrl: + marketingBase: https://www.theopenlane.io + subscriberVerify: /verify + sendGridApiKey: "" + testing: true +entConfig: + entityTypes: null + flags: + useListObjectServices: false + useListUserService: true +posthog: + apiKey: "" + enabled: false + host: https://app.posthog.com +publisherConfig: + address: localhost:10000 + addresses: + - localhost:10000 + appName: openlane + debug: false + enabled: false +ratelimit: + burst: 30 + enabled: false + expires: 600000000000 + limit: 10 +redis: + address: localhost:6379 + db: 0 + dialTimeout: 5000000000 + enabled: true + maxActiveConns: 0 + maxIdleConns: 0 + maxRetries: 3 + minIdleConns: 0 + name: openlane + password: "" + readTimeout: 0 + username: "" + writeTimeout: 0 +refreshInterval: 600000000000 +server: + cacheControl: + enabled: true + etagHeaders: null + noCacheHeaders: null + cors: + allowOrigins: null + cookieInsecure: false + enabled: true + prefixes: null + debug: false + dev: false + enableGraphExtensions: true + graphPool: + maxCapacity: 1000 + maxWorkers: 100 + idleTimeout: 30000000000 + listen: :17608 + mime: + defaultContentType: application/data + enabled: true + mimeTypesFile: "" + readHeaderTimeout: 2000000000 + readTimeout: 15000000000 + redirects: + code: 0 + enabled: true + redirects: null + secure: + contentsecuritypolicy: default-src 'self' + contenttypenosniff: nosniff + cspreportonly: false + enabled: true + hstsmaxage: 31536000 + hstspreloadenabled: false + referrerpolicy: same-origin + xframeoptions: SAMEORIGIN + xssprotection: 1; mode=block + shutdownGracePeriod: 10000000000 + tls: + autoCert: false + certFile: server.crt + certKey: server.key + config: null + enabled: false + writeTimeout: 15000000000 +sessions: + domain: "" + encryptionKey: encryptionsecret + signingKey: my-signing-secret +totp: + codeLength: 6 + enabled: true + issuer: "" + recoveryCodeCount: 16 + recoveryCodeLength: 8 + redis: true + secret: "" +tracer: + enabled: false + environment: development + otlp: + certificate: "" + compression: "" + endpoint: localhost:4317 + headers: null + insecure: true + timeout: 10000000000 + provider: stdout + stdout: + disableTimestamp: false + pretty: true diff --git a/config/config.go b/config/config.go new file mode 100644 index 0000000..0bdc836 --- /dev/null +++ b/config/config.go @@ -0,0 +1,188 @@ +package config + +import ( + "crypto/tls" + "strings" + "time" + + "github.com/knadh/koanf/parsers/yaml" + "github.com/knadh/koanf/providers/env" + "github.com/knadh/koanf/providers/file" + "github.com/knadh/koanf/v2" + "github.com/mcuadros/go-defaults" + dbx "github.com/theopenlane/dbx/pkg/dbxclient" + "github.com/theopenlane/entx" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/totp" + + "github.com/theopenlane/core/internal/ent/entconfig" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/analytics/posthog" + "github.com/theopenlane/core/pkg/cache" + "github.com/theopenlane/core/pkg/events/kafka/kafkaconfig" + "github.com/theopenlane/core/pkg/middleware/cachecontrol" + "github.com/theopenlane/core/pkg/middleware/cors" + "github.com/theopenlane/core/pkg/middleware/mime" + "github.com/theopenlane/core/pkg/middleware/ratelimit" + "github.com/theopenlane/core/pkg/middleware/redirect" + "github.com/theopenlane/core/pkg/middleware/secure" + "github.com/theopenlane/core/pkg/otelx" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" +) + +var ( + DefaultConfigFilePath = "./config/.config.yaml" +) + +// Config contains the configuration for the core server +type Config struct { + // RefreshInterval determines how often to reload the config + RefreshInterval time.Duration `json:"refreshInterval" koanf:"refreshInterval" default:"10m"` + // Server contains the echo server settings + Server Server `json:"server" koanf:"server"` + // EntConfig contains the ent configuration used by the ent middleware + EntConfig entconfig.Config `json:"entConfig" koanf:"entConfig"` + // Auth contains the authentication token settings and provider(s) + Auth Auth `json:"auth" koanf:"auth"` + // Authz contains the authorization settings for fine grained access control + Authz fgax.Config `json:"authz" koanf:"authz"` + // DB contains the database configuration for the ent client + DB entx.Config `json:"db" koanf:"db"` + // DBx contains the dbx client configuration + DBx dbx.Config `json:"dbx" koanf:"dbx"` + // Redis contains the redis configuration for the key-value store + Redis cache.Config `json:"redis" koanf:"redis"` + // Tracer contains the tracing config for opentelemetry + Tracer otelx.Config `json:"tracer" koanf:"tracer"` + // Email contains email sending configuration for the server + Email emails.Config `json:"email" koanf:"email"` + // Sessions config for user sessions and cookies + Sessions sessions.Config `json:"sessions" koanf:"sessions"` + // PostHog contains the configuration for the PostHog analytics + PostHog posthog.Config `json:"posthog" koanf:"posthog"` + // TOTP contains the configuration for the TOTP provider + TOTP totp.Config `json:"totp" koanf:"totp"` + // Ratelimit contains the configuration for the rate limiter + Ratelimit ratelimit.Config `json:"ratelimit" koanf:"ratelimit"` + // EventPublisher contains the configuration for the event publisher + Events kafkaconfig.Config `json:"publisherConfig" koanf:"publisherConfig"` +} + +// Server settings for the echo server +type Server struct { + // Debug enables debug mode for the server + Debug bool `json:"debug" koanf:"debug" default:"false"` + // Dev enables echo's dev mode options + Dev bool `json:"dev" koanf:"dev" default:"false"` + // Listen sets the listen address to serve the echo server on + Listen string `json:"listen" koanf:"listen" jsonschema:"required" default:":17608"` + // ShutdownGracePeriod sets the grace period for in flight requests before shutting down + ShutdownGracePeriod time.Duration `json:"shutdownGracePeriod" koanf:"shutdownGracePeriod" default:"10s"` + // ReadTimeout sets the maximum duration for reading the entire request including the body + ReadTimeout time.Duration `json:"readTimeout" koanf:"readTimeout" default:"15s"` + // WriteTimeout sets the maximum duration before timing out writes of the response + WriteTimeout time.Duration `json:"writeTimeout" koanf:"writeTimeout" default:"15s"` + // IdleTimeout sets the maximum amount of time to wait for the next request when keep-alives are enabled + IdleTimeout time.Duration `json:"idleTimeout" koanf:"idleTimeout" default:"30s"` + // ReadHeaderTimeout sets the amount of time allowed to read request headers + ReadHeaderTimeout time.Duration `json:"readHeaderTimeout" koanf:"readHeaderTimeout" default:"2s"` + // TLS contains the tls configuration settings + TLS TLS `json:"tls" koanf:"tls"` + // CORS contains settings to allow cross origin settings and insecure cookies + CORS cors.Config `json:"cors" koanf:"cors"` + // Secure contains settings for the secure middleware + Secure secure.Config `json:"secure" koanf:"secure"` + // Redirect contains settings for the redirect middleware + Redirects redirect.Config `json:"redirects" koanf:"redirects"` + // CacheControl contains settings for the cache control middleware + CacheControl cachecontrol.Config `json:"cacheControl" koanf:"cacheControl"` + // Mime contains settings for the mime middleware + Mime mime.Config `json:"mime" koanf:"mime"` + // GraphPool contains settings for the goroutine pool used by the graph resolvers + GraphPool PondPool `json:"graphPool" koanf:"graphPool"` + // EnableGraphExtensions enables the graph extensions for the graph resolvers + EnableGraphExtensions bool `json:"enableGraphExtensions" koanf:"enableGraphExtensions" default:"true"` +} + +// Auth settings including oauth2 providers and token configuration +type Auth struct { + // Enabled authentication on the server, not recommended to disable + Enabled bool `json:"enabled" koanf:"enabled" default:"true"` + // Token contains the token config settings for the issued tokens + Token tokens.Config `json:"token" koanf:"token" jsonschema:"required" alias:"tokenconfig"` + // SupportedProviders are the supported oauth providers that have been configured + SupportedProviders []string `json:"supportedProviders" koanf:"supportedProviders"` + // Providers contains supported oauth2 providers configuration + Providers handlers.OauthProviderConfig `json:"providers" koanf:"providers"` +} + +// TLS settings for the server for secure connections +type TLS struct { + // Config contains the tls.Config settings + Config *tls.Config `json:"config" koanf:"config" jsonschema:"-"` + // Enabled turns on TLS settings for the server + Enabled bool `json:"enabled" koanf:"enabled" default:"false"` + // CertFile location for the TLS server + CertFile string `json:"certFile" koanf:"certFile" default:"server.crt"` + // CertKey file location for the TLS server + CertKey string `json:"certKey" koanf:"certKey" default:"server.key"` + // AutoCert generates the cert with letsencrypt, this does not work on localhost + AutoCert bool `json:"autoCert" koanf:"autoCert" default:"false"` +} + +// PondPool contains the settings for the goroutine pool +type PondPool struct { + // MaxWorkers is the maximum number of workers in the pool + MaxWorkers int `json:"maxWorkers" koanf:"maxWorkers" default:"100"` + // MaxCapacity is the maximum number of tasks that can be queued + MaxCapacity int `json:"maxCapacity" koanf:"maxCapacity" default:"1000"` +} + +// Load is responsible for loading the configuration from a YAML file and environment variables. +// If the `cfgFile` is empty or nil, it sets the default configuration file path. +// Config settings are taken from default values, then from the config file, and finally from environment +// the later overwriting the former. +func Load(cfgFile *string) (*Config, error) { + k := koanf.New(".") + + if cfgFile == nil || *cfgFile == "" { + *cfgFile = DefaultConfigFilePath + } + + // load defaults + conf := &Config{} + defaults.SetDefaults(conf) + + // parse yaml config + if err := k.Load(file.Provider(*cfgFile), yaml.Parser()); err != nil { + panic(err) + } + + // unmarshal the config + if err := k.Unmarshal("", &conf); err != nil { + panic(err) + } + + // load env vars + if err := k.Load(env.ProviderWithValue("CORE_", ".", func(s string, v string) (string, interface{}) { + key := strings.ReplaceAll(strings.ToLower(strings.TrimPrefix(s, "CORE_")), "_", ".") + + if strings.Contains(v, ",") { + return key, strings.Split(v, ",") + } + + return key, v + }), nil); err != nil { + panic(err) + } + + // unmarshal the env vars + if err := k.Unmarshal("", &conf); err != nil { + panic(err) + } + + return conf, nil +} diff --git a/config/configmap.yaml b/config/configmap.yaml new file mode 100644 index 0000000..7936c4f --- /dev/null +++ b/config/configmap.yaml @@ -0,0 +1,169 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.names.fullname" . -}}-config + {{ $labels := include "common.tplvalues.merge" (dict "values" ( list .Values.api.commonLabels (include "common.labels.standard" .) ) "context" . ) }} + labels: {{- include "common.tplvalues.render" ( dict "value" $labels "context" $) | nindent 4 }} + {{- if .Values.api.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.api.commonAnnotations ) "context" . ) }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- end }} +data: + CORE_REFRESHINTERVAL: {{ .Values.core.refreshInterval | default "10m" }} + CORE_SERVER_DEBUG: {{ .Values.core.server.debug | default false }} + CORE_SERVER_DEV: {{ .Values.core.server.dev | default false }} + CORE_SERVER_LISTEN: {{ .Values.core.server.listen | default ":17608" }} + CORE_SERVER_SHUTDOWNGRACEPERIOD: {{ .Values.core.server.shutdownGracePeriod | default "10s" }} + CORE_SERVER_READTIMEOUT: {{ .Values.core.server.readTimeout | default "15s" }} + CORE_SERVER_WRITETIMEOUT: {{ .Values.core.server.writeTimeout | default "15s" }} + CORE_SERVER_IDLETIMEOUT: {{ .Values.core.server.idleTimeout | default "30s" }} + CORE_SERVER_READHEADERTIMEOUT: {{ .Values.core.server.readHeaderTimeout | default "2s" }} + CORE_SERVER_TLS_ENABLED: {{ .Values.core.server.tls.enabled | default false }} + CORE_SERVER_TLS_CERTFILE: {{ .Values.core.server.tls.certFile | default "server.crt" }} + CORE_SERVER_TLS_CERTKEY: {{ .Values.core.server.tls.certKey | default "server.key" }} + CORE_SERVER_TLS_AUTOCERT: {{ .Values.core.server.tls.autoCert | default false }} + CORE_SERVER_CORS_ENABLED: {{ .Values.core.server.cors.enabled | default true }} + CORE_SERVER_CORS_PREFIXES: {{ .Values.core.server.cors.prefixes }} + CORE_SERVER_CORS_ALLOWORIGINS: {{ .Values.core.server.cors.allowOrigins }} + CORE_SERVER_CORS_COOKIEINSECURE: {{ .Values.core.server.cors.cookieInsecure }} + CORE_SERVER_SECURE_ENABLED: {{ .Values.core.server.secure.enabled | default true }} + CORE_SERVER_SECURE_XSSPROTECTION: {{ .Values.core.server.secure.xssprotection | default "1; mode=block" }} + CORE_SERVER_SECURE_CONTENTTYPENOSNIFF: {{ .Values.core.server.secure.contenttypenosniff | default "nosniff" }} + CORE_SERVER_SECURE_XFRAMEOPTIONS: {{ .Values.core.server.secure.xframeoptions | default "SAMEORIGIN" }} + CORE_SERVER_SECURE_HSTSPRELOADENABLED: {{ .Values.core.server.secure.hstspreloadenabled | default false }} + CORE_SERVER_SECURE_HSTSMAXAGE: {{ .Values.core.server.secure.hstsmaxage | default 31536000 }} + CORE_SERVER_SECURE_CONTENTSECURITYPOLICY: {{ .Values.core.server.secure.contentsecuritypolicy | default "default-src 'self'" }} + CORE_SERVER_SECURE_REFERRERPOLICY: {{ .Values.core.server.secure.referrerpolicy | default "same-origin" }} + CORE_SERVER_SECURE_CSPREPORTONLY: {{ .Values.core.server.secure.cspreportonly | default false }} + CORE_SERVER_REDIRECTS_ENABLED: {{ .Values.core.server.redirects.enabled | default true }} + CORE_SERVER_REDIRECTS_REDIRECTS: {{ .Values.core.server.redirects.redirects }} + CORE_SERVER_REDIRECTS_CODE: {{ .Values.core.server.redirects.code }} + CORE_SERVER_CACHECONTROL_ENABLED: {{ .Values.core.server.cacheControl.enabled | default true }} + CORE_SERVER_CACHECONTROL_NOCACHEHEADERS: {{ .Values.core.server.cacheControl.noCacheHeaders }} + CORE_SERVER_CACHECONTROL_ETAGHEADERS: {{ .Values.core.server.cacheControl.etagHeaders }} + CORE_SERVER_MIME_ENABLED: {{ .Values.core.server.mime.enabled | default true }} + CORE_SERVER_MIME_MIMETYPESFILE: {{ .Values.core.server.mime.mimeTypesFile }} + CORE_SERVER_MIME_DEFAULTCONTENTTYPE: {{ .Values.core.server.mime.defaultContentType | default "application/data" }} + CORE_SERVER_GRAPHPOOL_MAXWORKERS: {{ .Values.core.server.graphPool.maxWorkers | default 100 }} + CORE_SERVER_GRAPHPOOL_MAXCAPACITY: {{ .Values.core.server.graphPool.maxCapacity | default 1000 }} + CORE_SERVER_ENABLEGRAPHEXTENSIONS: {{ .Values.core.server.enableGraphExtensions | default true }} + CORE_ENTCONFIG_FLAGS_USELISTUSERSERVICE: {{ .Values.core.entConfig.flags.useListUserService | default true }} + CORE_ENTCONFIG_FLAGS_USELISTOBJECTSERVICES: {{ .Values.core.entConfig.flags.useListObjectServices | default false }} + CORE_ENTCONFIG_ENTITYTYPES: {{ .Values.core.entConfig.entityTypes }} + CORE_AUTH_ENABLED: {{ .Values.core.auth.enabled | default true }} + CORE_AUTH_TOKEN_KID: {{ .Values.core.auth.token.kid }} + CORE_AUTH_TOKEN_AUDIENCE: {{ .Values.core.auth.token.audience | default "https://theopenlane.io" }} + CORE_AUTH_TOKEN_REFRESHAUDIENCE: {{ .Values.core.auth.token.refreshAudience }} + CORE_AUTH_TOKEN_ISSUER: {{ .Values.core.auth.token.issuer | default "https://auth.theopenlane.io" }} + CORE_AUTH_TOKEN_ACCESSDURATION: {{ .Values.core.auth.token.accessDuration | default "1h" }} + CORE_AUTH_TOKEN_REFRESHDURATION: {{ .Values.core.auth.token.refreshDuration | default "2h" }} + CORE_AUTH_TOKEN_REFRESHOVERLAP: {{ .Values.core.auth.token.refreshOverlap | default "-15m" }} + CORE_AUTH_TOKEN_JWKSENDPOINT: {{ .Values.core.auth.token.jwksEndpoint | default "https://api.theopenlane.io/.well-known/jwks.json" }} + CORE_AUTH_TOKEN_KEYS: {{ .Values.core.auth.token.keys }} + CORE_AUTH_TOKEN_GENERATEKEYS: {{ .Values.core.auth.token.generateKeys | default true }} + CORE_AUTH_SUPPORTEDPROVIDERS: {{ .Values.core.auth.supportedProviders }} + CORE_AUTH_PROVIDERS_REDIRECTURL: {{ .Values.core.auth.providers.redirectUrl | default "http://localhost:3001/api/auth/callback/theopenlane" }} + CORE_AUTH_PROVIDERS_GITHUB_CLIENTID: {{ .Values.core.auth.providers.github.clientId }} + CORE_AUTH_PROVIDERS_GITHUB_CLIENTSECRET: {{ .Values.core.auth.providers.github.clientSecret }} + CORE_AUTH_PROVIDERS_GITHUB_CLIENTENDPOINT: {{ .Values.core.auth.providers.github.clientEndpoint | default "http://localhost:17608" }} + CORE_AUTH_PROVIDERS_GITHUB_SCOPES: {{ .Values.core.auth.providers.github.scopes }} + CORE_AUTH_PROVIDERS_GITHUB_REDIRECTURL: {{ .Values.core.auth.providers.github.redirectUrl | default "/v1/github/callback" }} + CORE_AUTH_PROVIDERS_GOOGLE_CLIENTID: {{ .Values.core.auth.providers.google.clientId }} + CORE_AUTH_PROVIDERS_GOOGLE_CLIENTSECRET: {{ .Values.core.auth.providers.google.clientSecret }} + CORE_AUTH_PROVIDERS_GOOGLE_CLIENTENDPOINT: {{ .Values.core.auth.providers.google.clientEndpoint | default "http://localhost:17608" }} + CORE_AUTH_PROVIDERS_GOOGLE_SCOPES: {{ .Values.core.auth.providers.google.scopes }} + CORE_AUTH_PROVIDERS_GOOGLE_REDIRECTURL: {{ .Values.core.auth.providers.google.redirectUrl | default "/v1/google/callback" }} + CORE_AUTH_PROVIDERS_WEBAUTHN_ENABLED: {{ .Values.core.auth.providers.webauthn.enabled | default true }} + CORE_AUTH_PROVIDERS_WEBAUTHN_DISPLAYNAME: {{ .Values.core.auth.providers.webauthn.displayName }} + CORE_AUTH_PROVIDERS_WEBAUTHN_RELYINGPARTYID: {{ .Values.core.auth.providers.webauthn.relyingPartyId | default "localhost" }} + CORE_AUTH_PROVIDERS_WEBAUTHN_REQUESTORIGINS: {{ .Values.core.auth.providers.webauthn.requestOrigins | default "http://localhost:3001" }} + CORE_AUTH_PROVIDERS_WEBAUTHN_MAXDEVICES: {{ .Values.core.auth.providers.webauthn.maxDevices | default 10 }} + CORE_AUTH_PROVIDERS_WEBAUTHN_ENFORCETIMEOUT: {{ .Values.core.auth.providers.webauthn.enforceTimeout | default true }} + CORE_AUTH_PROVIDERS_WEBAUTHN_TIMEOUT: {{ .Values.core.auth.providers.webauthn.timeout | default "60s" }} + CORE_AUTH_PROVIDERS_WEBAUTHN_DEBUG: {{ .Values.core.auth.providers.webauthn.debug | default false }} + CORE_AUTHZ_ENABLED: {{ .Values.core.authz.enabled | default true }} + CORE_AUTHZ_STORENAME: {{ .Values.core.authz.storeName | default "openlane" }} + CORE_AUTHZ_HOSTURL: {{ .Values.core.authz.hostUrl | default "https://authz.theopenlane.io" }} + CORE_AUTHZ_STOREID: {{ .Values.core.authz.storeId }} + CORE_AUTHZ_MODELID: {{ .Values.core.authz.modelId }} + CORE_AUTHZ_CREATENEWMODEL: {{ .Values.core.authz.createNewModel | default false }} + CORE_AUTHZ_MODELFILE: {{ .Values.core.authz.modelFile | default "fga/model/openlane.fga" }} + CORE_AUTHZ_CREDENTIALS_APITOKEN: {{ .Values.core.authz.credentials.apiToken }} + CORE_AUTHZ_CREDENTIALS_CLIENTID: {{ .Values.core.authz.credentials.clientId }} + CORE_AUTHZ_CREDENTIALS_CLIENTSECRET: {{ .Values.core.authz.credentials.clientSecret }} + CORE_AUTHZ_CREDENTIALS_AUDIENCE: {{ .Values.core.authz.credentials.audience }} + CORE_AUTHZ_CREDENTIALS_ISSUER: {{ .Values.core.authz.credentials.issuer }} + CORE_AUTHZ_CREDENTIALS_SCOPES: {{ .Values.core.authz.credentials.scopes }} + CORE_DB_DEBUG: {{ .Values.core.db.debug | default false }} + CORE_DB_DATABASENAME: {{ .Values.core.db.databaseName | default "openlane" }} + CORE_DB_DRIVERNAME: {{ .Values.core.db.driverName | default "libsql" }} + CORE_DB_MULTIWRITE: {{ .Values.core.db.multiWrite | default false }} + CORE_DB_PRIMARYDBSOURCE: {{ .Values.core.db.primaryDbSource | default "file:openlane.db" }} + CORE_DB_SECONDARYDBSOURCE: {{ .Values.core.db.secondaryDbSource | default "file:backup.db" }} + CORE_DB_CACHETTL: {{ .Values.core.db.cacheTTL | default "1s" }} + CORE_DB_RUNMIGRATIONS: {{ .Values.core.db.runMigrations | default true }} + CORE_DB_MIGRATIONPROVIDER: {{ .Values.core.db.migrationProvider | default "atlas" }} + CORE_DB_ENABLEHISTORY: {{ .Values.core.db.enableHistory | default false }} + CORE_DBX_ENABLED: {{ .Values.core.dbx.enabled | default true }} + CORE_DBX_BASEURL: {{ .Values.core.dbx.baseUrl | default "http://localhost:1337" }} + CORE_DBX_ENDPOINT: {{ .Values.core.dbx.endpoint | default "query" }} + CORE_DBX_DEBUG: {{ .Values.core.dbx.debug | default false }} + CORE_REDIS_ENABLED: {{ .Values.core.redis.enabled | default true }} + CORE_REDIS_ADDRESS: {{ .Values.core.redis.address | default "localhost:6379" }} + CORE_REDIS_NAME: {{ .Values.core.redis.name | default "openlane" }} + CORE_REDIS_USERNAME: {{ .Values.core.redis.username }} + CORE_REDIS_PASSWORD: {{ .Values.core.redis.password }} + CORE_REDIS_DB: {{ .Values.core.redis.db | default 0 }} + CORE_REDIS_DIALTIMEOUT: {{ .Values.core.redis.dialTimeout | default "5s" }} + CORE_REDIS_READTIMEOUT: {{ .Values.core.redis.readTimeout | default "0" }} + CORE_REDIS_WRITETIMEOUT: {{ .Values.core.redis.writeTimeout | default "0" }} + CORE_REDIS_MAXRETRIES: {{ .Values.core.redis.maxRetries | default 3 }} + CORE_REDIS_MINIDLECONNS: {{ .Values.core.redis.minIdleConns | default 0 }} + CORE_REDIS_MAXIDLECONNS: {{ .Values.core.redis.maxIdleConns | default 0 }} + CORE_REDIS_MAXACTIVECONNS: {{ .Values.core.redis.maxActiveConns | default 0 }} + CORE_TRACER_ENABLED: {{ .Values.core.tracer.enabled | default false }} + CORE_TRACER_PROVIDER: {{ .Values.core.tracer.provider | default "stdout" }} + CORE_TRACER_ENVIRONMENT: {{ .Values.core.tracer.environment | default "development" }} + CORE_TRACER_STDOUT_PRETTY: {{ .Values.core.tracer.stdout.pretty | default true }} + CORE_TRACER_STDOUT_DISABLETIMESTAMP: {{ .Values.core.tracer.stdout.disableTimestamp | default false }} + CORE_TRACER_OTLP_ENDPOINT: {{ .Values.core.tracer.otlp.endpoint | default "localhost:4317" }} + CORE_TRACER_OTLP_INSECURE: {{ .Values.core.tracer.otlp.insecure | default true }} + CORE_TRACER_OTLP_CERTIFICATE: {{ .Values.core.tracer.otlp.certificate }} + CORE_TRACER_OTLP_HEADERS: {{ .Values.core.tracer.otlp.headers }} + CORE_TRACER_OTLP_COMPRESSION: {{ .Values.core.tracer.otlp.compression }} + CORE_TRACER_OTLP_TIMEOUT: {{ .Values.core.tracer.otlp.timeout | default "10s" }} + CORE_EMAIL_SENDGRIDAPIKEY: {{ .Values.core.email.sendGridApiKey }} + CORE_EMAIL_FROMEMAIL: {{ .Values.core.email.fromEmail | default "no-reply@theopenlane.io" }} + CORE_EMAIL_TESTING: {{ .Values.core.email.testing | default true }} + CORE_EMAIL_ARCHIVE: {{ .Values.core.email.archive }} + CORE_EMAIL_LISTID: {{ .Values.core.email.listId }} + CORE_EMAIL_ADMINEMAIL: {{ .Values.core.email.adminEmail | default "admins@theopenlane.io" }} + CORE_EMAIL_CONSOLEURL_CONSOLEBASE: {{ .Values.core.email.consoleUrl.consoleBase | default "https://console.theopenlane.io" }} + CORE_EMAIL_CONSOLEURL_VERIFY: {{ .Values.core.email.consoleUrl.verify | default "/verify" }} + CORE_EMAIL_CONSOLEURL_INVITE: {{ .Values.core.email.consoleUrl.invite | default "/invite" }} + CORE_EMAIL_CONSOLEURL_RESET: {{ .Values.core.email.consoleUrl.reset | default "/password-reset" }} + CORE_EMAIL_MARKETINGURL_MARKETINGBASE: {{ .Values.core.email.marketingUrl.marketingBase | default "https://www.theopenlane.io" }} + CORE_EMAIL_MARKETINGURL_SUBSCRIBERVERIFY: {{ .Values.core.email.marketingUrl.subscriberVerify | default "/verify" }} + CORE_SESSIONS_SIGNINGKEY: {{ .Values.core.sessions.signingKey | default "my-signing-secret" }} + CORE_SESSIONS_ENCRYPTIONKEY: {{ .Values.core.sessions.encryptionKey | default "encryptionsecret" }} + CORE_SESSIONS_DOMAIN: {{ .Values.core.sessions.domain }} + CORE_POSTHOG_ENABLED: {{ .Values.core.posthog.enabled | default false }} + CORE_POSTHOG_APIKEY: {{ .Values.core.posthog.apiKey }} + CORE_POSTHOG_HOST: {{ .Values.core.posthog.host | default "https://app.posthog.com" }} + CORE_TOTP_ENABLED: {{ .Values.core.totp.enabled | default true }} + CORE_TOTP_CODELENGTH: {{ .Values.core.totp.codeLength | default 6 }} + CORE_TOTP_ISSUER: {{ .Values.core.totp.issuer }} + CORE_TOTP_REDIS: {{ .Values.core.totp.redis | default true }} + CORE_TOTP_SECRET: {{ .Values.core.totp.secret }} + CORE_TOTP_RECOVERYCODECOUNT: {{ .Values.core.totp.recoveryCodeCount | default 16 }} + CORE_TOTP_RECOVERYCODELENGTH: {{ .Values.core.totp.recoveryCodeLength | default 8 }} + CORE_RATELIMIT_ENABLED: {{ .Values.core.ratelimit.enabled | default false }} + CORE_RATELIMIT_LIMIT: {{ .Values.core.ratelimit.limit | default 10 }} + CORE_RATELIMIT_BURST: {{ .Values.core.ratelimit.burst | default 30 }} + CORE_RATELIMIT_EXPIRES: {{ .Values.core.ratelimit.expires | default "10m" }} + CORE_PUBLISHERCONFIG_ENABLED: {{ .Values.core.publisherConfig.enabled | default false }} + CORE_PUBLISHERCONFIG_APPNAME: {{ .Values.core.publisherConfig.appName | default "openlane" }} + CORE_PUBLISHERCONFIG_ADDRESS: {{ .Values.core.publisherConfig.address | default "localhost:10000" }} + CORE_PUBLISHERCONFIG_ADDRESSES: {{ .Values.core.publisherConfig.addresses | default "localhost:10000" }} + CORE_PUBLISHERCONFIG_DEBUG: {{ .Values.core.publisherConfig.debug | default false }} diff --git a/config/doc.go b/config/doc.go new file mode 100644 index 0000000..6ccae48 --- /dev/null +++ b/config/doc.go @@ -0,0 +1,2 @@ +// Package config holds configuration stuff to configure the things +package config diff --git a/db/README.md b/db/README.md new file mode 100644 index 0000000..04d2c63 --- /dev/null +++ b/db/README.md @@ -0,0 +1,65 @@ +# Database Support + +## Dependencies + +1. [ent](https://entgo.io/) - insane entity mapping tool, definitely not an ORM but kind of an ORM +1. [atlas](https://atlasgo.io/) - Schema generation and migration +1. [entx](https://github.com/theopenlane/entx) - Wrapper to interact with the ent + +## Supported Drivers + +1. [libsql](https://github.com/tursodatabase/libsql) +1. [sqlite](https://gitlab.com/cznic/sqlite) +1. [postgres](https://github.com/lib/pq) + +## Local Development + +### Config Examples + +#### Libsql + +1. This will write to a local file `core.db`, already included in `.gitignore` + +```yaml +db: + debug: true + driver_name: "libsql" + primary_db_source: "file:core.db" + run_migrations: true +``` + +#### Sqlite + +1. This will write to a local file `core.db`, already included in `.gitignore` + +```yaml +db: + debug: true + driver_name: sqlite3 + primary_db_source: "core.db" + run_migrations: true +``` + +#### Postgres + +1. Postgres is included in `docker/docker-compose-fga.yml` and the same instance can be used for development. The following connection string should work when using `task docker:all:up` + +```yaml +db: + debug: true + driver_name: postgres + primary_db_source: "postgres://postgres:password@postgres:5432?sslmode=disable" + run_migrations: true +``` + +#### Turso + +1. Replace the url with your turso database url and token + +```yaml +db: + debug: true + driver_name: libsql + primary_db_source: "https://core-theopenlane.turso.io?authToken=$TURSO_TOKEN" # set TURSO_TOKEN to value + run_migrations: false +``` diff --git a/db/Taskfile.yaml b/db/Taskfile.yaml new file mode 100644 index 0000000..b98f54d --- /dev/null +++ b/db/Taskfile.yaml @@ -0,0 +1,40 @@ +version: '3' + +includes: + docker: + taskfile: ../docker/Taskfile.yaml + dir: ../docker + aliases: [compose] + +tasks: + create: + desc: creates an atlas migration if one is needed based on the ent schema definitions + cmds: + - | + echo "If there is no schema to generate, this will not create a file (hint: name it your branch name if you're not sure) - enter the name of the migration:" + read migration; + go run create_migrations.go ${migration}; + + lint: + desc: lints the pushed migration files + ignore_error: true + cmds: + - atlas migrate lint --dev-url "docker://postgres/16/dev?search_path=public" --dir "file://migrations" -w + + resethash: + desc: re-sets the checksum created by the atlas package so that a complete migration can be re-created if deleted + cmds: + - atlas migrate hash --dir="file://migrations" + - atlas migrate hash --dir="file://migrations-goose-sqlite" + - atlas migrate hash --dir="file://migrations-goose-postgres" + + console: + desc: launches an interactive terminal to the local core db with some tasty options + cmds: + - sqlite3 -column -header -box ../core.db + + newschema: + desc: generate a new ent schema from template + silent: true + cmds: + - go run -mod=mod entgo.io/ent/cmd/ent new --template ../internal/ent/base/entinit.tmpl --target ../internal/ent/schema {{.CLI_ARGS}} diff --git a/db/create_migrations.go b/db/create_migrations.go new file mode 100644 index 0000000..fdbf667 --- /dev/null +++ b/db/create_migrations.go @@ -0,0 +1,100 @@ +//go:build ignore + +package main + +import ( + "context" + "log" + "os" + "time" + + // supported ent database drivers + _ "github.com/lib/pq" // postgres driver + _ "github.com/theopenlane/entx" // overlay for sqlite + _ "github.com/tursodatabase/libsql-client-go/libsql" // libsql driver + _ "modernc.org/sqlite" // sqlite driver (non-cgo) + + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/sql/schema" + + atlas "ariga.io/atlas/sql/migrate" + "ariga.io/atlas/sql/sqltool" + "github.com/theopenlane/core/internal/ent/generated/migrate" + "github.com/theopenlane/core/pkg/testutils" +) + +func main() { + ctx := context.Background() + + // Create a local migration directory able to understand Atlas migration file format for replay. + atlasDir, err := atlas.NewLocalDir("migrations") + if err != nil { + log.Fatalf("failed creating atlas migration directory: %v", err) + } + + gooseDirSqlite, err := sqltool.NewGooseDir("migrations-goose-sqlite") + if err != nil { + log.Fatalf("failed creating goose migration directory: %v", err) + } + + gooseDirPG, err := sqltool.NewGooseDir("migrations-goose-postgres") + if err != nil { + log.Fatalf("failed creating goose migration directory: %v", err) + } + + // Migrate diff options. + baseOpts := []schema.MigrateOption{ + schema.WithMigrationMode(schema.ModeReplay), // provide migration mode + schema.WithDropColumn(true), + schema.WithDropIndex(true), + } + + sqliteOpts := append(baseOpts, schema.WithDialect(dialect.SQLite)) + postgresOpts := append(baseOpts, schema.WithDialect(dialect.Postgres)) + + if len(os.Args) != 2 { + log.Fatalln("migration name is required. Use: 'go run -mod=mod create_migration.go '") + } + + sqliteDBURI, ok := os.LookupEnv("ATLAS_SQLITE_DB_URI") + if !ok { + log.Fatalln("failed to load the ATLAS_SQLITE_DB_URI env var") + } + + pgDBURI, ok := os.LookupEnv("ATLAS_POSTGRES_DB_URI") + if !ok { + log.Fatalln("failed to load the ATLAS_POSTGRES_DB_URI env var") + } + + tf, err := testutils.GetPostgresDockerTest(pgDBURI, 5*time.Minute) + if err != nil { + log.Fatalf("failed creating postgres test container: %v", err) + } + + defer testutils.TeardownFixture(tf) + + // Generate migrations using Atlas support for sqlite (note the Ent dialect option passed above). + atlasOpts := append(baseOpts, + schema.WithDialect(dialect.Postgres), + schema.WithDir(atlasDir), + schema.WithFormatter(atlas.DefaultFormatter), + ) + + if err := migrate.NamedDiff(ctx, tf.URI, os.Args[1], atlasOpts...); err != nil { + log.Fatalf("failed generating atlas migration file: %v", err) + } + + // Generate migrations using Goose support for sqlite + gooseOptsSQLite := append(sqliteOpts, schema.WithDir(gooseDirSqlite)) + + if err = migrate.NamedDiff(ctx, sqliteDBURI, os.Args[1], gooseOptsSQLite...); err != nil { + log.Fatalf("failed generating goose migration file for sqlite: %v", err) + } + + // Generate migrations using Goose support for postgres + gooseOptsPG := append(postgresOpts, schema.WithDir(gooseDirPG)) + + if err = migrate.NamedDiff(ctx, tf.URI, os.Args[1], gooseOptsPG...); err != nil { + log.Fatalf("failed generating goose migration file for postgres: %v", err) + } +} diff --git a/db/migrate.go b/db/migrate.go new file mode 100644 index 0000000..1d0f3a8 --- /dev/null +++ b/db/migrate.go @@ -0,0 +1,21 @@ +// Package db provides an embedded filesystem containing all the database migrations +package db + +import ( + "embed" +) + +// Migrations contain an embedded filesystem with all the sql migration files +// +//go:embed migrations/*.sql +var Migrations embed.FS + +// GooseMigrationsSQLite contain an embedded filesystem with all the goose migration files for sqlite +// +//go:embed migrations-goose-sqlite/*.sql +var GooseMigrationsSQLite embed.FS + +// GooseMigrationsPG contain an embedded filesystem with all the goose migration files for postgres +// +//go:embed migrations-goose-postgres/*.sql +var GooseMigrationsPG embed.FS diff --git a/db/migrations-goose-postgres/20240827061503_init.sql b/db/migrations-goose-postgres/20240827061503_init.sql new file mode 100644 index 0000000..6889d8b --- /dev/null +++ b/db/migrations-goose-postgres/20240827061503_init.sql @@ -0,0 +1,699 @@ +-- +goose Up +-- create "organizations" table +CREATE TABLE "organizations" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "display_name" character varying NOT NULL DEFAULT '', "description" character varying NULL, "personal_org" boolean NULL DEFAULT false, "avatar_remote_url" character varying NULL, "dedicated_db" boolean NOT NULL DEFAULT false, "parent_organization_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "organizations_organizations_children" FOREIGN KEY ("parent_organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "organization_name" to table: "organizations" +CREATE UNIQUE INDEX "organization_name" ON "organizations" ("name") WHERE (deleted_at IS NULL); +-- create index "organizations_mapping_id_key" to table: "organizations" +CREATE UNIQUE INDEX "organizations_mapping_id_key" ON "organizations" ("mapping_id"); +-- create "file_history" table +CREATE TABLE "file_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "file_name" character varying NOT NULL, "file_extension" character varying NOT NULL, "file_size" bigint NULL, "content_type" character varying NOT NULL, "store_key" character varying NOT NULL, "category" character varying NULL, "annotation" character varying NULL, PRIMARY KEY ("id")); +-- create index "filehistory_history_time" to table: "file_history" +CREATE INDEX "filehistory_history_time" ON "file_history" ("history_time"); +-- create "contact_history" table +CREATE TABLE "contact_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "full_name" character varying NOT NULL, "title" character varying NULL, "company" character varying NULL, "email" character varying NULL, "phone_number" character varying NULL, "address" character varying NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', PRIMARY KEY ("id")); +-- create index "contacthistory_history_time" to table: "contact_history" +CREATE INDEX "contacthistory_history_time" ON "contact_history" ("history_time"); +-- create "organization_setting_history" table +CREATE TABLE "organization_setting_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "domains" jsonb NULL, "billing_contact" character varying NULL, "billing_email" character varying NULL, "billing_phone" character varying NULL, "billing_address" character varying NULL, "tax_identifier" character varying NULL, "geo_location" character varying NULL DEFAULT 'AMER', "organization_id" character varying NULL, PRIMARY KEY ("id")); +-- create index "organizationsettinghistory_history_time" to table: "organization_setting_history" +CREATE INDEX "organizationsettinghistory_history_time" ON "organization_setting_history" ("history_time"); +-- create "document_data_history" table +CREATE TABLE "document_data_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "template_id" character varying NOT NULL, "data" jsonb NOT NULL, PRIMARY KEY ("id")); +-- create index "documentdatahistory_history_time" to table: "document_data_history" +CREATE INDEX "documentdatahistory_history_time" ON "document_data_history" ("history_time"); +-- create "webhook_history" table +CREATE TABLE "webhook_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "destination_url" character varying NOT NULL, "enabled" boolean NOT NULL DEFAULT true, "callback" character varying NULL, "expires_at" timestamptz NULL, "secret" bytea NULL, "failures" bigint NULL DEFAULT 0, "last_error" character varying NULL, "last_response" character varying NULL, PRIMARY KEY ("id")); +-- create index "webhookhistory_history_time" to table: "webhook_history" +CREATE INDEX "webhookhistory_history_time" ON "webhook_history" ("history_time"); +-- create "org_membership_history" table +CREATE TABLE "org_membership_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "organization_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id")); +-- create index "orgmembershiphistory_history_time" to table: "org_membership_history" +CREATE INDEX "orgmembershiphistory_history_time" ON "org_membership_history" ("history_time"); +-- create "entitlement_history" table +CREATE TABLE "entitlement_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "plan_id" character varying NOT NULL, "organization_id" character varying NOT NULL, "external_customer_id" character varying NULL, "external_subscription_id" character varying NULL, "expires" boolean NOT NULL DEFAULT false, "expires_at" timestamptz NULL, "cancelled" boolean NOT NULL DEFAULT false, PRIMARY KEY ("id")); +-- create index "entitlementhistory_history_time" to table: "entitlement_history" +CREATE INDEX "entitlementhistory_history_time" ON "entitlement_history" ("history_time"); +-- create "template_history" table +CREATE TABLE "template_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "template_type" character varying NOT NULL DEFAULT 'DOCUMENT', "description" character varying NULL, "jsonconfig" jsonb NOT NULL, "uischema" jsonb NULL, PRIMARY KEY ("id")); +-- create index "templatehistory_history_time" to table: "template_history" +CREATE INDEX "templatehistory_history_time" ON "template_history" ("history_time"); +-- create "oauth_provider_history" table +CREATE TABLE "oauth_provider_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "client_id" character varying NOT NULL, "client_secret" character varying NOT NULL, "redirect_url" character varying NOT NULL, "scopes" character varying NOT NULL, "auth_url" character varying NOT NULL, "token_url" character varying NOT NULL, "auth_style" smallint NOT NULL, "info_url" character varying NOT NULL, PRIMARY KEY ("id")); +-- create index "oauthproviderhistory_history_time" to table: "oauth_provider_history" +CREATE INDEX "oauthproviderhistory_history_time" ON "oauth_provider_history" ("history_time"); +-- create "entitlement_plan_feature_history" table +CREATE TABLE "entitlement_plan_feature_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "metadata" jsonb NULL, "plan_id" character varying NOT NULL, "feature_id" character varying NOT NULL, PRIMARY KEY ("id")); +-- create index "entitlementplanfeaturehistory_history_time" to table: "entitlement_plan_feature_history" +CREATE INDEX "entitlementplanfeaturehistory_history_time" ON "entitlement_plan_feature_history" ("history_time"); +-- create "entitlement_plan_history" table +CREATE TABLE "entitlement_plan_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "display_name" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "version" character varying NOT NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- create index "entitlementplanhistory_history_time" to table: "entitlement_plan_history" +CREATE INDEX "entitlementplanhistory_history_time" ON "entitlement_plan_history" ("history_time"); +-- create "note_history" table +CREATE TABLE "note_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "text" character varying NOT NULL, PRIMARY KEY ("id")); +-- create index "notehistory_history_time" to table: "note_history" +CREATE INDEX "notehistory_history_time" ON "note_history" ("history_time"); +-- create "entity_history" table +CREATE TABLE "entity_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NULL, "display_name" character varying NULL, "description" character varying NULL, "domains" jsonb NULL, "entity_type_id" character varying NULL, "status" character varying NULL DEFAULT 'active', PRIMARY KEY ("id")); +-- create index "entityhistory_history_time" to table: "entity_history" +CREATE INDEX "entityhistory_history_time" ON "entity_history" ("history_time"); +-- create "user_history" table +CREATE TABLE "user_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "email" character varying NOT NULL, "first_name" character varying NULL, "last_name" character varying NULL, "display_name" character varying NOT NULL, "avatar_remote_url" character varying NULL, "avatar_local_file" character varying NULL, "avatar_updated_at" timestamptz NULL, "last_seen" timestamptz NULL, "password" character varying NULL, "sub" character varying NULL, "auth_provider" character varying NOT NULL DEFAULT 'CREDENTIALS', "role" character varying NULL DEFAULT 'USER', PRIMARY KEY ("id")); +-- create index "userhistory_history_time" to table: "user_history" +CREATE INDEX "userhistory_history_time" ON "user_history" ("history_time"); +-- create "entity_type_history" table +CREATE TABLE "entity_type_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, PRIMARY KEY ("id")); +-- create index "entitytypehistory_history_time" to table: "entity_type_history" +CREATE INDEX "entitytypehistory_history_time" ON "entity_type_history" ("history_time"); +-- create "user_setting_history" table +CREATE TABLE "user_setting_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "user_id" character varying NULL, "locked" boolean NOT NULL DEFAULT false, "silenced_at" timestamptz NULL, "suspended_at" timestamptz NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', "email_confirmed" boolean NOT NULL DEFAULT false, "is_webauthn_allowed" boolean NULL DEFAULT false, "is_tfa_enabled" boolean NULL DEFAULT false, "phone_number" character varying NULL, PRIMARY KEY ("id")); +-- create index "usersettinghistory_history_time" to table: "user_setting_history" +CREATE INDEX "usersettinghistory_history_time" ON "user_setting_history" ("history_time"); +-- create "event_history" table +CREATE TABLE "event_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "event_id" character varying NULL, "correlation_id" character varying NULL, "event_type" character varying NOT NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- create index "eventhistory_history_time" to table: "event_history" +CREATE INDEX "eventhistory_history_time" ON "event_history" ("history_time"); +-- create "integration_history" table +CREATE TABLE "integration_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, PRIMARY KEY ("id")); +-- create index "integrationhistory_history_time" to table: "integration_history" +CREATE INDEX "integrationhistory_history_time" ON "integration_history" ("history_time"); +-- create "feature_history" table +CREATE TABLE "feature_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "display_name" character varying NULL, "enabled" boolean NOT NULL DEFAULT false, "description" character varying NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- create index "featurehistory_history_time" to table: "feature_history" +CREATE INDEX "featurehistory_history_time" ON "feature_history" ("history_time"); +-- create "organization_history" table +CREATE TABLE "organization_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "display_name" character varying NOT NULL DEFAULT '', "description" character varying NULL, "parent_organization_id" character varying NULL, "personal_org" boolean NULL DEFAULT false, "avatar_remote_url" character varying NULL, "dedicated_db" boolean NOT NULL DEFAULT false, PRIMARY KEY ("id")); +-- create index "organizationhistory_history_time" to table: "organization_history" +CREATE INDEX "organizationhistory_history_time" ON "organization_history" ("history_time"); +-- create "hush_history" table +CREATE TABLE "hush_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, "secret_name" character varying NULL, "secret_value" character varying NULL, PRIMARY KEY ("id")); +-- create index "hushhistory_history_time" to table: "hush_history" +CREATE INDEX "hushhistory_history_time" ON "hush_history" ("history_time"); +-- create "group_setting_history" table +CREATE TABLE "group_setting_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "visibility" character varying NOT NULL DEFAULT 'PUBLIC', "join_policy" character varying NOT NULL DEFAULT 'INVITE_OR_APPLICATION', "sync_to_slack" boolean NULL DEFAULT false, "sync_to_github" boolean NULL DEFAULT false, "group_id" character varying NULL, PRIMARY KEY ("id")); +-- create index "groupsettinghistory_history_time" to table: "group_setting_history" +CREATE INDEX "groupsettinghistory_history_time" ON "group_setting_history" ("history_time"); +-- create "group_history" table +CREATE TABLE "group_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "gravatar_logo_url" character varying NULL, "logo_url" character varying NULL, "display_name" character varying NOT NULL DEFAULT '', PRIMARY KEY ("id")); +-- create index "grouphistory_history_time" to table: "group_history" +CREATE INDEX "grouphistory_history_time" ON "group_history" ("history_time"); +-- create "group_membership_history" table +CREATE TABLE "group_membership_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "group_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id")); +-- create index "groupmembershiphistory_history_time" to table: "group_membership_history" +CREATE INDEX "groupmembershiphistory_history_time" ON "group_membership_history" ("history_time"); +-- create "api_tokens" table +CREATE TABLE "api_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "token" character varying NOT NULL, "expires_at" timestamptz NULL, "description" character varying NULL, "scopes" jsonb NULL, "last_used_at" timestamptz NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "api_tokens_organizations_api_tokens" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "api_tokens_mapping_id_key" to table: "api_tokens" +CREATE UNIQUE INDEX "api_tokens_mapping_id_key" ON "api_tokens" ("mapping_id"); +-- create index "api_tokens_token_key" to table: "api_tokens" +CREATE UNIQUE INDEX "api_tokens_token_key" ON "api_tokens" ("token"); +-- create index "apitoken_token" to table: "api_tokens" +CREATE INDEX "apitoken_token" ON "api_tokens" ("token"); +-- create "contacts" table +CREATE TABLE "contacts" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "full_name" character varying NOT NULL, "title" character varying NULL, "company" character varying NULL, "email" character varying NULL, "phone_number" character varying NULL, "address" character varying NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "contacts_organizations_contacts" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "contacts_mapping_id_key" to table: "contacts" +CREATE UNIQUE INDEX "contacts_mapping_id_key" ON "contacts" ("mapping_id"); +-- create "templates" table +CREATE TABLE "templates" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "template_type" character varying NOT NULL DEFAULT 'DOCUMENT', "description" character varying NULL, "jsonconfig" jsonb NOT NULL, "uischema" jsonb NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "templates_organizations_templates" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "template_name_owner_id_template_type" to table: "templates" +CREATE UNIQUE INDEX "template_name_owner_id_template_type" ON "templates" ("name", "owner_id", "template_type") WHERE (deleted_at IS NULL); +-- create index "templates_mapping_id_key" to table: "templates" +CREATE UNIQUE INDEX "templates_mapping_id_key" ON "templates" ("mapping_id"); +-- create "document_data" table +CREATE TABLE "document_data" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "data" jsonb NOT NULL, "owner_id" character varying NULL, "template_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "document_data_organizations_documentdata" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "document_data_templates_documents" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "document_data_mapping_id_key" to table: "document_data" +CREATE UNIQUE INDEX "document_data_mapping_id_key" ON "document_data" ("mapping_id"); +-- create "users" table +CREATE TABLE "users" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "email" character varying NOT NULL, "first_name" character varying NULL, "last_name" character varying NULL, "display_name" character varying NOT NULL, "avatar_remote_url" character varying NULL, "avatar_local_file" character varying NULL, "avatar_updated_at" timestamptz NULL, "last_seen" timestamptz NULL, "password" character varying NULL, "sub" character varying NULL, "auth_provider" character varying NOT NULL DEFAULT 'CREDENTIALS', "role" character varying NULL DEFAULT 'USER', PRIMARY KEY ("id")); +-- create index "user_email_auth_provider" to table: "users" +CREATE UNIQUE INDEX "user_email_auth_provider" ON "users" ("email", "auth_provider") WHERE (deleted_at IS NULL); +-- create index "user_id" to table: "users" +CREATE UNIQUE INDEX "user_id" ON "users" ("id"); +-- create index "users_mapping_id_key" to table: "users" +CREATE UNIQUE INDEX "users_mapping_id_key" ON "users" ("mapping_id"); +-- create index "users_sub_key" to table: "users" +CREATE UNIQUE INDEX "users_sub_key" ON "users" ("sub"); +-- create "email_verification_tokens" table +CREATE TABLE "email_verification_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "token" character varying NOT NULL, "ttl" timestamptz NOT NULL, "email" character varying NOT NULL, "secret" bytea NOT NULL, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "email_verification_tokens_users_email_verification_tokens" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "email_verification_tokens_mapping_id_key" to table: "email_verification_tokens" +CREATE UNIQUE INDEX "email_verification_tokens_mapping_id_key" ON "email_verification_tokens" ("mapping_id"); +-- create index "email_verification_tokens_token_key" to table: "email_verification_tokens" +CREATE UNIQUE INDEX "email_verification_tokens_token_key" ON "email_verification_tokens" ("token"); +-- create index "emailverificationtoken_token" to table: "email_verification_tokens" +CREATE UNIQUE INDEX "emailverificationtoken_token" ON "email_verification_tokens" ("token") WHERE (deleted_at IS NULL); +-- create "entity_types" table +CREATE TABLE "entity_types" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entity_types_organizations_entitytypes" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "entity_types_mapping_id_key" to table: "entity_types" +CREATE UNIQUE INDEX "entity_types_mapping_id_key" ON "entity_types" ("mapping_id"); +-- create index "entitytype_name_owner_id" to table: "entity_types" +CREATE UNIQUE INDEX "entitytype_name_owner_id" ON "entity_types" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- create "entities" table +CREATE TABLE "entities" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "name" character varying NULL, "display_name" character varying NULL, "description" character varying NULL, "domains" jsonb NULL, "status" character varying NULL DEFAULT 'active', "entity_type_id" character varying NULL, "entity_type_entities" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entities_entity_types_entities" FOREIGN KEY ("entity_type_entities") REFERENCES "entity_types" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "entities_entity_types_entity_type" FOREIGN KEY ("entity_type_id") REFERENCES "entity_types" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "entities_organizations_entities" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "entities_mapping_id_key" to table: "entities" +CREATE UNIQUE INDEX "entities_mapping_id_key" ON "entities" ("mapping_id"); +-- create index "entity_name_owner_id" to table: "entities" +CREATE UNIQUE INDEX "entity_name_owner_id" ON "entities" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- create "entitlement_plans" table +CREATE TABLE "entitlement_plans" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "display_name" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "version" character varying NOT NULL, "metadata" jsonb NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entitlement_plans_organizations_entitlementplans" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "entitlement_plans_mapping_id_key" to table: "entitlement_plans" +CREATE UNIQUE INDEX "entitlement_plans_mapping_id_key" ON "entitlement_plans" ("mapping_id"); +-- create index "entitlementplan_name_version_owner_id" to table: "entitlement_plans" +CREATE UNIQUE INDEX "entitlementplan_name_version_owner_id" ON "entitlement_plans" ("name", "version", "owner_id") WHERE (deleted_at IS NULL); +-- create "entitlements" table +CREATE TABLE "entitlements" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "external_customer_id" character varying NULL, "external_subscription_id" character varying NULL, "expires" boolean NOT NULL DEFAULT false, "expires_at" timestamptz NULL, "cancelled" boolean NOT NULL DEFAULT false, "plan_id" character varying NOT NULL, "owner_id" character varying NULL, "organization_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "entitlements_entitlement_plans_entitlements" FOREIGN KEY ("plan_id") REFERENCES "entitlement_plans" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "entitlements_organizations_entitlements" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "entitlements_organizations_organization_entitlement" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "entitlement_organization_id_owner_id" to table: "entitlements" +CREATE UNIQUE INDEX "entitlement_organization_id_owner_id" ON "entitlements" ("organization_id", "owner_id") WHERE ((deleted_at IS NULL) AND (cancelled = false)); +-- create index "entitlements_mapping_id_key" to table: "entitlements" +CREATE UNIQUE INDEX "entitlements_mapping_id_key" ON "entitlements" ("mapping_id"); +-- create "events" table +CREATE TABLE "events" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "event_id" character varying NULL, "correlation_id" character varying NULL, "event_type" character varying NOT NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- create index "events_mapping_id_key" to table: "events" +CREATE UNIQUE INDEX "events_mapping_id_key" ON "events" ("mapping_id"); +-- create "entitlement_events" table +CREATE TABLE "entitlement_events" ("entitlement_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("entitlement_id", "event_id"), CONSTRAINT "entitlement_events_entitlement_id" FOREIGN KEY ("entitlement_id") REFERENCES "entitlements" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entitlement_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "entitlement_plan_events" table +CREATE TABLE "entitlement_plan_events" ("entitlement_plan_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("entitlement_plan_id", "event_id"), CONSTRAINT "entitlement_plan_events_entitlement_plan_id" FOREIGN KEY ("entitlement_plan_id") REFERENCES "entitlement_plans" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entitlement_plan_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "features" table +CREATE TABLE "features" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "display_name" character varying NULL, "enabled" boolean NOT NULL DEFAULT false, "description" character varying NULL, "metadata" jsonb NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "features_organizations_features" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "feature_name_owner_id" to table: "features" +CREATE UNIQUE INDEX "feature_name_owner_id" ON "features" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- create index "features_mapping_id_key" to table: "features" +CREATE UNIQUE INDEX "features_mapping_id_key" ON "features" ("mapping_id"); +-- create "entitlement_plan_features" table +CREATE TABLE "entitlement_plan_features" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "metadata" jsonb NULL, "plan_id" character varying NOT NULL, "feature_id" character varying NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entitlement_plan_features_entitlement_plans_plan" FOREIGN KEY ("plan_id") REFERENCES "entitlement_plans" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "entitlement_plan_features_features_feature" FOREIGN KEY ("feature_id") REFERENCES "features" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "entitlement_plan_features_organizations_entitlementplanfeatures" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "entitlement_plan_features_mapping_id_key" to table: "entitlement_plan_features" +CREATE UNIQUE INDEX "entitlement_plan_features_mapping_id_key" ON "entitlement_plan_features" ("mapping_id"); +-- create index "entitlementplanfeature_feature_id_plan_id" to table: "entitlement_plan_features" +CREATE UNIQUE INDEX "entitlementplanfeature_feature_id_plan_id" ON "entitlement_plan_features" ("feature_id", "plan_id") WHERE (deleted_at IS NULL); +-- create "entitlement_plan_feature_events" table +CREATE TABLE "entitlement_plan_feature_events" ("entitlement_plan_feature_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("entitlement_plan_feature_id", "event_id"), CONSTRAINT "entitlement_plan_feature_events_entitlement_plan_feature_id" FOREIGN KEY ("entitlement_plan_feature_id") REFERENCES "entitlement_plan_features" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entitlement_plan_feature_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "entity_contacts" table +CREATE TABLE "entity_contacts" ("entity_id" character varying NOT NULL, "contact_id" character varying NOT NULL, PRIMARY KEY ("entity_id", "contact_id"), CONSTRAINT "entity_contacts_contact_id" FOREIGN KEY ("contact_id") REFERENCES "contacts" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entity_contacts_entity_id" FOREIGN KEY ("entity_id") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "entity_documents" table +CREATE TABLE "entity_documents" ("entity_id" character varying NOT NULL, "document_data_id" character varying NOT NULL, PRIMARY KEY ("entity_id", "document_data_id"), CONSTRAINT "entity_documents_document_data_id" FOREIGN KEY ("document_data_id") REFERENCES "document_data" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entity_documents_entity_id" FOREIGN KEY ("entity_id") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "files" table +CREATE TABLE "files" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "file_name" character varying NOT NULL, "file_extension" character varying NOT NULL, "file_size" bigint NULL, "content_type" character varying NOT NULL, "store_key" character varying NOT NULL, "category" character varying NULL, "annotation" character varying NULL, "user_files" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "files_users_files" FOREIGN KEY ("user_files") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "files_mapping_id_key" to table: "files" +CREATE UNIQUE INDEX "files_mapping_id_key" ON "files" ("mapping_id"); +-- create "entity_files" table +CREATE TABLE "entity_files" ("entity_id" character varying NOT NULL, "file_id" character varying NOT NULL, PRIMARY KEY ("entity_id", "file_id"), CONSTRAINT "entity_files_entity_id" FOREIGN KEY ("entity_id") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entity_files_file_id" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "feature_events" table +CREATE TABLE "feature_events" ("feature_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("feature_id", "event_id"), CONSTRAINT "feature_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "feature_events_feature_id" FOREIGN KEY ("feature_id") REFERENCES "features" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "groups" table +CREATE TABLE "groups" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "description" character varying NULL, "gravatar_logo_url" character varying NULL, "logo_url" character varying NULL, "display_name" character varying NOT NULL DEFAULT '', "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "groups_organizations_groups" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "group_name_owner_id" to table: "groups" +CREATE UNIQUE INDEX "group_name_owner_id" ON "groups" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- create index "groups_mapping_id_key" to table: "groups" +CREATE UNIQUE INDEX "groups_mapping_id_key" ON "groups" ("mapping_id"); +-- create "group_events" table +CREATE TABLE "group_events" ("group_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("group_id", "event_id"), CONSTRAINT "group_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "group_events_group_id" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "group_files" table +CREATE TABLE "group_files" ("group_id" character varying NOT NULL, "file_id" character varying NOT NULL, PRIMARY KEY ("group_id", "file_id"), CONSTRAINT "group_files_file_id" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "group_files_group_id" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "group_memberships" table +CREATE TABLE "group_memberships" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "group_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "group_memberships_groups_group" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "group_memberships_users_user" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "group_memberships_mapping_id_key" to table: "group_memberships" +CREATE UNIQUE INDEX "group_memberships_mapping_id_key" ON "group_memberships" ("mapping_id"); +-- create index "groupmembership_user_id_group_id" to table: "group_memberships" +CREATE UNIQUE INDEX "groupmembership_user_id_group_id" ON "group_memberships" ("user_id", "group_id") WHERE (deleted_at IS NULL); +-- create "group_membership_events" table +CREATE TABLE "group_membership_events" ("group_membership_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("group_membership_id", "event_id"), CONSTRAINT "group_membership_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "group_membership_events_group_membership_id" FOREIGN KEY ("group_membership_id") REFERENCES "group_memberships" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "group_settings" table +CREATE TABLE "group_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "visibility" character varying NOT NULL DEFAULT 'PUBLIC', "join_policy" character varying NOT NULL DEFAULT 'INVITE_OR_APPLICATION', "sync_to_slack" boolean NULL DEFAULT false, "sync_to_github" boolean NULL DEFAULT false, "group_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "group_settings_groups_setting" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "group_settings_group_id_key" to table: "group_settings" +CREATE UNIQUE INDEX "group_settings_group_id_key" ON "group_settings" ("group_id"); +-- create index "group_settings_mapping_id_key" to table: "group_settings" +CREATE UNIQUE INDEX "group_settings_mapping_id_key" ON "group_settings" ("mapping_id"); +-- create "hushes" table +CREATE TABLE "hushes" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, "secret_name" character varying NULL, "secret_value" character varying NULL, PRIMARY KEY ("id")); +-- create index "hushes_mapping_id_key" to table: "hushes" +CREATE UNIQUE INDEX "hushes_mapping_id_key" ON "hushes" ("mapping_id"); +-- create "hush_events" table +CREATE TABLE "hush_events" ("hush_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("hush_id", "event_id"), CONSTRAINT "hush_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "hush_events_hush_id" FOREIGN KEY ("hush_id") REFERENCES "hushes" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "integrations" table +CREATE TABLE "integrations" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, "group_integrations" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "integrations_groups_integrations" FOREIGN KEY ("group_integrations") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "integrations_organizations_integrations" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "integrations_mapping_id_key" to table: "integrations" +CREATE UNIQUE INDEX "integrations_mapping_id_key" ON "integrations" ("mapping_id"); +-- create "integration_events" table +CREATE TABLE "integration_events" ("integration_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "event_id"), CONSTRAINT "integration_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_events_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "oh_auth_too_tokens" table +CREATE TABLE "oh_auth_too_tokens" ("id" character varying NOT NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "client_id" text NOT NULL, "scopes" jsonb NULL, "nonce" text NOT NULL, "claims_user_id" text NOT NULL, "claims_username" text NOT NULL, "claims_email" text NOT NULL, "claims_email_verified" boolean NOT NULL, "claims_groups" jsonb NULL, "claims_preferred_username" text NOT NULL, "connector_id" text NOT NULL, "connector_data" jsonb NULL, "last_used" timestamptz NOT NULL, PRIMARY KEY ("id")); +-- create index "oh_auth_too_tokens_mapping_id_key" to table: "oh_auth_too_tokens" +CREATE UNIQUE INDEX "oh_auth_too_tokens_mapping_id_key" ON "oh_auth_too_tokens" ("mapping_id"); +-- create "integration_oauth2tokens" table +CREATE TABLE "integration_oauth2tokens" ("integration_id" character varying NOT NULL, "oh_auth_too_token_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "oh_auth_too_token_id"), CONSTRAINT "integration_oauth2tokens_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_oauth2tokens_oh_auth_too_token_id" FOREIGN KEY ("oh_auth_too_token_id") REFERENCES "oh_auth_too_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "integration_secrets" table +CREATE TABLE "integration_secrets" ("integration_id" character varying NOT NULL, "hush_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "hush_id"), CONSTRAINT "integration_secrets_hush_id" FOREIGN KEY ("hush_id") REFERENCES "hushes" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_secrets_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "webhooks" table +CREATE TABLE "webhooks" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "destination_url" character varying NOT NULL, "enabled" boolean NOT NULL DEFAULT true, "callback" character varying NULL, "expires_at" timestamptz NULL, "secret" bytea NULL, "failures" bigint NULL DEFAULT 0, "last_error" character varying NULL, "last_response" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "webhooks_organizations_webhooks" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "webhook_name_owner_id" to table: "webhooks" +CREATE UNIQUE INDEX "webhook_name_owner_id" ON "webhooks" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- create index "webhooks_callback_key" to table: "webhooks" +CREATE UNIQUE INDEX "webhooks_callback_key" ON "webhooks" ("callback"); +-- create index "webhooks_mapping_id_key" to table: "webhooks" +CREATE UNIQUE INDEX "webhooks_mapping_id_key" ON "webhooks" ("mapping_id"); +-- create "integration_webhooks" table +CREATE TABLE "integration_webhooks" ("integration_id" character varying NOT NULL, "webhook_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "webhook_id"), CONSTRAINT "integration_webhooks_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_webhooks_webhook_id" FOREIGN KEY ("webhook_id") REFERENCES "webhooks" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "invites" table +CREATE TABLE "invites" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "token" character varying NOT NULL, "expires" timestamptz NULL, "recipient" character varying NOT NULL, "status" character varying NOT NULL DEFAULT 'INVITATION_SENT', "role" character varying NOT NULL DEFAULT 'MEMBER', "send_attempts" bigint NOT NULL DEFAULT 0, "requestor_id" character varying NULL, "secret" bytea NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "invites_organizations_invites" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "invite_recipient_owner_id" to table: "invites" +CREATE UNIQUE INDEX "invite_recipient_owner_id" ON "invites" ("recipient", "owner_id") WHERE (deleted_at IS NULL); +-- create index "invites_mapping_id_key" to table: "invites" +CREATE UNIQUE INDEX "invites_mapping_id_key" ON "invites" ("mapping_id"); +-- create index "invites_token_key" to table: "invites" +CREATE UNIQUE INDEX "invites_token_key" ON "invites" ("token"); +-- create "invite_events" table +CREATE TABLE "invite_events" ("invite_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("invite_id", "event_id"), CONSTRAINT "invite_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "invite_events_invite_id" FOREIGN KEY ("invite_id") REFERENCES "invites" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "notes" table +CREATE TABLE "notes" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "text" character varying NOT NULL, "entity_notes" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "notes_entities_notes" FOREIGN KEY ("entity_notes") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "notes_organizations_notes" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "notes_mapping_id_key" to table: "notes" +CREATE UNIQUE INDEX "notes_mapping_id_key" ON "notes" ("mapping_id"); +-- create "oauth_providers" table +CREATE TABLE "oauth_providers" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "client_id" character varying NOT NULL, "client_secret" character varying NOT NULL, "redirect_url" character varying NOT NULL, "scopes" character varying NOT NULL, "auth_url" character varying NOT NULL, "token_url" character varying NOT NULL, "auth_style" smallint NOT NULL, "info_url" character varying NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "oauth_providers_organizations_oauthprovider" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "oauth_providers_mapping_id_key" to table: "oauth_providers" +CREATE UNIQUE INDEX "oauth_providers_mapping_id_key" ON "oauth_providers" ("mapping_id"); +-- create "oh_auth_too_token_events" table +CREATE TABLE "oh_auth_too_token_events" ("oh_auth_too_token_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("oh_auth_too_token_id", "event_id"), CONSTRAINT "oh_auth_too_token_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "oh_auth_too_token_events_oh_auth_too_token_id" FOREIGN KEY ("oh_auth_too_token_id") REFERENCES "oh_auth_too_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "org_memberships" table +CREATE TABLE "org_memberships" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "organization_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "org_memberships_organizations_organization" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "org_memberships_users_user" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "org_memberships_mapping_id_key" to table: "org_memberships" +CREATE UNIQUE INDEX "org_memberships_mapping_id_key" ON "org_memberships" ("mapping_id"); +-- create index "orgmembership_user_id_organization_id" to table: "org_memberships" +CREATE UNIQUE INDEX "orgmembership_user_id_organization_id" ON "org_memberships" ("user_id", "organization_id") WHERE (deleted_at IS NULL); +-- create "org_membership_events" table +CREATE TABLE "org_membership_events" ("org_membership_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("org_membership_id", "event_id"), CONSTRAINT "org_membership_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "org_membership_events_org_membership_id" FOREIGN KEY ("org_membership_id") REFERENCES "org_memberships" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "organization_events" table +CREATE TABLE "organization_events" ("organization_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "event_id"), CONSTRAINT "organization_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_events_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "organization_files" table +CREATE TABLE "organization_files" ("organization_id" character varying NOT NULL, "file_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "file_id"), CONSTRAINT "organization_files_file_id" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_files_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "personal_access_tokens" table +CREATE TABLE "personal_access_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "token" character varying NOT NULL, "expires_at" timestamptz NULL, "description" character varying NULL, "scopes" jsonb NULL, "last_used_at" timestamptz NULL, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "personal_access_tokens_users_personal_access_tokens" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "personal_access_tokens_mapping_id_key" to table: "personal_access_tokens" +CREATE UNIQUE INDEX "personal_access_tokens_mapping_id_key" ON "personal_access_tokens" ("mapping_id"); +-- create index "personal_access_tokens_token_key" to table: "personal_access_tokens" +CREATE UNIQUE INDEX "personal_access_tokens_token_key" ON "personal_access_tokens" ("token"); +-- create index "personalaccesstoken_token" to table: "personal_access_tokens" +CREATE INDEX "personalaccesstoken_token" ON "personal_access_tokens" ("token"); +-- create "organization_personal_access_tokens" table +CREATE TABLE "organization_personal_access_tokens" ("organization_id" character varying NOT NULL, "personal_access_token_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "personal_access_token_id"), CONSTRAINT "organization_personal_access_tokens_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_personal_access_tokens_personal_access_token_id" FOREIGN KEY ("personal_access_token_id") REFERENCES "personal_access_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "organization_secrets" table +CREATE TABLE "organization_secrets" ("organization_id" character varying NOT NULL, "hush_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "hush_id"), CONSTRAINT "organization_secrets_hush_id" FOREIGN KEY ("hush_id") REFERENCES "hushes" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_secrets_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "organization_settings" table +CREATE TABLE "organization_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "domains" jsonb NULL, "billing_contact" character varying NULL, "billing_email" character varying NULL, "billing_phone" character varying NULL, "billing_address" character varying NULL, "tax_identifier" character varying NULL, "geo_location" character varying NULL DEFAULT 'AMER', "organization_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "organization_settings_organizations_setting" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "organization_settings_mapping_id_key" to table: "organization_settings" +CREATE UNIQUE INDEX "organization_settings_mapping_id_key" ON "organization_settings" ("mapping_id"); +-- create index "organization_settings_organization_id_key" to table: "organization_settings" +CREATE UNIQUE INDEX "organization_settings_organization_id_key" ON "organization_settings" ("organization_id"); +-- create "password_reset_tokens" table +CREATE TABLE "password_reset_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "token" character varying NOT NULL, "ttl" timestamptz NOT NULL, "email" character varying NOT NULL, "secret" bytea NOT NULL, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "password_reset_tokens_users_password_reset_tokens" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "password_reset_tokens_mapping_id_key" to table: "password_reset_tokens" +CREATE UNIQUE INDEX "password_reset_tokens_mapping_id_key" ON "password_reset_tokens" ("mapping_id"); +-- create index "password_reset_tokens_token_key" to table: "password_reset_tokens" +CREATE UNIQUE INDEX "password_reset_tokens_token_key" ON "password_reset_tokens" ("token"); +-- create index "passwordresettoken_token" to table: "password_reset_tokens" +CREATE UNIQUE INDEX "passwordresettoken_token" ON "password_reset_tokens" ("token") WHERE (deleted_at IS NULL); +-- create "personal_access_token_events" table +CREATE TABLE "personal_access_token_events" ("personal_access_token_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("personal_access_token_id", "event_id"), CONSTRAINT "personal_access_token_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "personal_access_token_events_personal_access_token_id" FOREIGN KEY ("personal_access_token_id") REFERENCES "personal_access_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "subscribers" table +CREATE TABLE "subscribers" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "email" character varying NOT NULL, "phone_number" character varying NULL, "verified_email" boolean NOT NULL DEFAULT false, "verified_phone" boolean NOT NULL DEFAULT false, "active" boolean NOT NULL DEFAULT false, "token" character varying NOT NULL, "ttl" timestamptz NOT NULL, "secret" bytea NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "subscribers_organizations_subscribers" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "subscriber_email_owner_id" to table: "subscribers" +CREATE UNIQUE INDEX "subscriber_email_owner_id" ON "subscribers" ("email", "owner_id") WHERE (deleted_at IS NULL); +-- create index "subscribers_mapping_id_key" to table: "subscribers" +CREATE UNIQUE INDEX "subscribers_mapping_id_key" ON "subscribers" ("mapping_id"); +-- create index "subscribers_token_key" to table: "subscribers" +CREATE UNIQUE INDEX "subscribers_token_key" ON "subscribers" ("token"); +-- create "subscriber_events" table +CREATE TABLE "subscriber_events" ("subscriber_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("subscriber_id", "event_id"), CONSTRAINT "subscriber_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "subscriber_events_subscriber_id" FOREIGN KEY ("subscriber_id") REFERENCES "subscribers" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "tfa_settings" table +CREATE TABLE "tfa_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "tfa_secret" character varying NULL, "verified" boolean NOT NULL DEFAULT false, "recovery_codes" jsonb NULL, "phone_otp_allowed" boolean NULL DEFAULT false, "email_otp_allowed" boolean NULL DEFAULT false, "totp_allowed" boolean NULL DEFAULT false, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "tfa_settings_users_tfa_settings" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "tfa_settings_mapping_id_key" to table: "tfa_settings" +CREATE UNIQUE INDEX "tfa_settings_mapping_id_key" ON "tfa_settings" ("mapping_id"); +-- create index "tfasetting_owner_id" to table: "tfa_settings" +CREATE UNIQUE INDEX "tfasetting_owner_id" ON "tfa_settings" ("owner_id") WHERE (deleted_at IS NULL); +-- create "user_events" table +CREATE TABLE "user_events" ("user_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("user_id", "event_id"), CONSTRAINT "user_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "user_events_user_id" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- create "user_settings" table +CREATE TABLE "user_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "locked" boolean NOT NULL DEFAULT false, "silenced_at" timestamptz NULL, "suspended_at" timestamptz NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', "email_confirmed" boolean NOT NULL DEFAULT false, "is_webauthn_allowed" boolean NULL DEFAULT false, "is_tfa_enabled" boolean NULL DEFAULT false, "phone_number" character varying NULL, "user_id" character varying NULL, "user_setting_default_org" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "user_settings_organizations_default_org" FOREIGN KEY ("user_setting_default_org") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "user_settings_users_setting" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- create index "user_settings_mapping_id_key" to table: "user_settings" +CREATE UNIQUE INDEX "user_settings_mapping_id_key" ON "user_settings" ("mapping_id"); +-- create index "user_settings_user_id_key" to table: "user_settings" +CREATE UNIQUE INDEX "user_settings_user_id_key" ON "user_settings" ("user_id"); +-- create "webauthns" table +CREATE TABLE "webauthns" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "credential_id" bytea NULL, "public_key" bytea NULL, "attestation_type" character varying NULL, "aaguid" bytea NOT NULL, "sign_count" integer NOT NULL, "transports" jsonb NOT NULL, "backup_eligible" boolean NOT NULL DEFAULT false, "backup_state" boolean NOT NULL DEFAULT false, "user_present" boolean NOT NULL DEFAULT false, "user_verified" boolean NOT NULL DEFAULT false, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "webauthns_users_webauthn" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- create index "webauthns_aaguid_key" to table: "webauthns" +CREATE UNIQUE INDEX "webauthns_aaguid_key" ON "webauthns" ("aaguid"); +-- create index "webauthns_credential_id_key" to table: "webauthns" +CREATE UNIQUE INDEX "webauthns_credential_id_key" ON "webauthns" ("credential_id"); +-- create index "webauthns_mapping_id_key" to table: "webauthns" +CREATE UNIQUE INDEX "webauthns_mapping_id_key" ON "webauthns" ("mapping_id"); +-- create "webhook_events" table +CREATE TABLE "webhook_events" ("webhook_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("webhook_id", "event_id"), CONSTRAINT "webhook_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "webhook_events_webhook_id" FOREIGN KEY ("webhook_id") REFERENCES "webhooks" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); + +-- +goose Down +-- reverse: create "webhook_events" table +DROP TABLE "webhook_events"; +-- reverse: create index "webauthns_mapping_id_key" to table: "webauthns" +DROP INDEX "webauthns_mapping_id_key"; +-- reverse: create index "webauthns_credential_id_key" to table: "webauthns" +DROP INDEX "webauthns_credential_id_key"; +-- reverse: create index "webauthns_aaguid_key" to table: "webauthns" +DROP INDEX "webauthns_aaguid_key"; +-- reverse: create "webauthns" table +DROP TABLE "webauthns"; +-- reverse: create index "user_settings_user_id_key" to table: "user_settings" +DROP INDEX "user_settings_user_id_key"; +-- reverse: create index "user_settings_mapping_id_key" to table: "user_settings" +DROP INDEX "user_settings_mapping_id_key"; +-- reverse: create "user_settings" table +DROP TABLE "user_settings"; +-- reverse: create "user_events" table +DROP TABLE "user_events"; +-- reverse: create index "tfasetting_owner_id" to table: "tfa_settings" +DROP INDEX "tfasetting_owner_id"; +-- reverse: create index "tfa_settings_mapping_id_key" to table: "tfa_settings" +DROP INDEX "tfa_settings_mapping_id_key"; +-- reverse: create "tfa_settings" table +DROP TABLE "tfa_settings"; +-- reverse: create "subscriber_events" table +DROP TABLE "subscriber_events"; +-- reverse: create index "subscribers_token_key" to table: "subscribers" +DROP INDEX "subscribers_token_key"; +-- reverse: create index "subscribers_mapping_id_key" to table: "subscribers" +DROP INDEX "subscribers_mapping_id_key"; +-- reverse: create index "subscriber_email_owner_id" to table: "subscribers" +DROP INDEX "subscriber_email_owner_id"; +-- reverse: create "subscribers" table +DROP TABLE "subscribers"; +-- reverse: create "personal_access_token_events" table +DROP TABLE "personal_access_token_events"; +-- reverse: create index "passwordresettoken_token" to table: "password_reset_tokens" +DROP INDEX "passwordresettoken_token"; +-- reverse: create index "password_reset_tokens_token_key" to table: "password_reset_tokens" +DROP INDEX "password_reset_tokens_token_key"; +-- reverse: create index "password_reset_tokens_mapping_id_key" to table: "password_reset_tokens" +DROP INDEX "password_reset_tokens_mapping_id_key"; +-- reverse: create "password_reset_tokens" table +DROP TABLE "password_reset_tokens"; +-- reverse: create index "organization_settings_organization_id_key" to table: "organization_settings" +DROP INDEX "organization_settings_organization_id_key"; +-- reverse: create index "organization_settings_mapping_id_key" to table: "organization_settings" +DROP INDEX "organization_settings_mapping_id_key"; +-- reverse: create "organization_settings" table +DROP TABLE "organization_settings"; +-- reverse: create "organization_secrets" table +DROP TABLE "organization_secrets"; +-- reverse: create "organization_personal_access_tokens" table +DROP TABLE "organization_personal_access_tokens"; +-- reverse: create index "personalaccesstoken_token" to table: "personal_access_tokens" +DROP INDEX "personalaccesstoken_token"; +-- reverse: create index "personal_access_tokens_token_key" to table: "personal_access_tokens" +DROP INDEX "personal_access_tokens_token_key"; +-- reverse: create index "personal_access_tokens_mapping_id_key" to table: "personal_access_tokens" +DROP INDEX "personal_access_tokens_mapping_id_key"; +-- reverse: create "personal_access_tokens" table +DROP TABLE "personal_access_tokens"; +-- reverse: create "organization_files" table +DROP TABLE "organization_files"; +-- reverse: create "organization_events" table +DROP TABLE "organization_events"; +-- reverse: create "org_membership_events" table +DROP TABLE "org_membership_events"; +-- reverse: create index "orgmembership_user_id_organization_id" to table: "org_memberships" +DROP INDEX "orgmembership_user_id_organization_id"; +-- reverse: create index "org_memberships_mapping_id_key" to table: "org_memberships" +DROP INDEX "org_memberships_mapping_id_key"; +-- reverse: create "org_memberships" table +DROP TABLE "org_memberships"; +-- reverse: create "oh_auth_too_token_events" table +DROP TABLE "oh_auth_too_token_events"; +-- reverse: create index "oauth_providers_mapping_id_key" to table: "oauth_providers" +DROP INDEX "oauth_providers_mapping_id_key"; +-- reverse: create "oauth_providers" table +DROP TABLE "oauth_providers"; +-- reverse: create index "notes_mapping_id_key" to table: "notes" +DROP INDEX "notes_mapping_id_key"; +-- reverse: create "notes" table +DROP TABLE "notes"; +-- reverse: create "invite_events" table +DROP TABLE "invite_events"; +-- reverse: create index "invites_token_key" to table: "invites" +DROP INDEX "invites_token_key"; +-- reverse: create index "invites_mapping_id_key" to table: "invites" +DROP INDEX "invites_mapping_id_key"; +-- reverse: create index "invite_recipient_owner_id" to table: "invites" +DROP INDEX "invite_recipient_owner_id"; +-- reverse: create "invites" table +DROP TABLE "invites"; +-- reverse: create "integration_webhooks" table +DROP TABLE "integration_webhooks"; +-- reverse: create index "webhooks_mapping_id_key" to table: "webhooks" +DROP INDEX "webhooks_mapping_id_key"; +-- reverse: create index "webhooks_callback_key" to table: "webhooks" +DROP INDEX "webhooks_callback_key"; +-- reverse: create index "webhook_name_owner_id" to table: "webhooks" +DROP INDEX "webhook_name_owner_id"; +-- reverse: create "webhooks" table +DROP TABLE "webhooks"; +-- reverse: create "integration_secrets" table +DROP TABLE "integration_secrets"; +-- reverse: create "integration_oauth2tokens" table +DROP TABLE "integration_oauth2tokens"; +-- reverse: create index "oh_auth_too_tokens_mapping_id_key" to table: "oh_auth_too_tokens" +DROP INDEX "oh_auth_too_tokens_mapping_id_key"; +-- reverse: create "oh_auth_too_tokens" table +DROP TABLE "oh_auth_too_tokens"; +-- reverse: create "integration_events" table +DROP TABLE "integration_events"; +-- reverse: create index "integrations_mapping_id_key" to table: "integrations" +DROP INDEX "integrations_mapping_id_key"; +-- reverse: create "integrations" table +DROP TABLE "integrations"; +-- reverse: create "hush_events" table +DROP TABLE "hush_events"; +-- reverse: create index "hushes_mapping_id_key" to table: "hushes" +DROP INDEX "hushes_mapping_id_key"; +-- reverse: create "hushes" table +DROP TABLE "hushes"; +-- reverse: create index "group_settings_mapping_id_key" to table: "group_settings" +DROP INDEX "group_settings_mapping_id_key"; +-- reverse: create index "group_settings_group_id_key" to table: "group_settings" +DROP INDEX "group_settings_group_id_key"; +-- reverse: create "group_settings" table +DROP TABLE "group_settings"; +-- reverse: create "group_membership_events" table +DROP TABLE "group_membership_events"; +-- reverse: create index "groupmembership_user_id_group_id" to table: "group_memberships" +DROP INDEX "groupmembership_user_id_group_id"; +-- reverse: create index "group_memberships_mapping_id_key" to table: "group_memberships" +DROP INDEX "group_memberships_mapping_id_key"; +-- reverse: create "group_memberships" table +DROP TABLE "group_memberships"; +-- reverse: create "group_files" table +DROP TABLE "group_files"; +-- reverse: create "group_events" table +DROP TABLE "group_events"; +-- reverse: create index "groups_mapping_id_key" to table: "groups" +DROP INDEX "groups_mapping_id_key"; +-- reverse: create index "group_name_owner_id" to table: "groups" +DROP INDEX "group_name_owner_id"; +-- reverse: create "groups" table +DROP TABLE "groups"; +-- reverse: create "feature_events" table +DROP TABLE "feature_events"; +-- reverse: create "entity_files" table +DROP TABLE "entity_files"; +-- reverse: create index "files_mapping_id_key" to table: "files" +DROP INDEX "files_mapping_id_key"; +-- reverse: create "files" table +DROP TABLE "files"; +-- reverse: create "entity_documents" table +DROP TABLE "entity_documents"; +-- reverse: create "entity_contacts" table +DROP TABLE "entity_contacts"; +-- reverse: create "entitlement_plan_feature_events" table +DROP TABLE "entitlement_plan_feature_events"; +-- reverse: create index "entitlementplanfeature_feature_id_plan_id" to table: "entitlement_plan_features" +DROP INDEX "entitlementplanfeature_feature_id_plan_id"; +-- reverse: create index "entitlement_plan_features_mapping_id_key" to table: "entitlement_plan_features" +DROP INDEX "entitlement_plan_features_mapping_id_key"; +-- reverse: create "entitlement_plan_features" table +DROP TABLE "entitlement_plan_features"; +-- reverse: create index "features_mapping_id_key" to table: "features" +DROP INDEX "features_mapping_id_key"; +-- reverse: create index "feature_name_owner_id" to table: "features" +DROP INDEX "feature_name_owner_id"; +-- reverse: create "features" table +DROP TABLE "features"; +-- reverse: create "entitlement_plan_events" table +DROP TABLE "entitlement_plan_events"; +-- reverse: create "entitlement_events" table +DROP TABLE "entitlement_events"; +-- reverse: create index "events_mapping_id_key" to table: "events" +DROP INDEX "events_mapping_id_key"; +-- reverse: create "events" table +DROP TABLE "events"; +-- reverse: create index "entitlements_mapping_id_key" to table: "entitlements" +DROP INDEX "entitlements_mapping_id_key"; +-- reverse: create index "entitlement_organization_id_owner_id" to table: "entitlements" +DROP INDEX "entitlement_organization_id_owner_id"; +-- reverse: create "entitlements" table +DROP TABLE "entitlements"; +-- reverse: create index "entitlementplan_name_version_owner_id" to table: "entitlement_plans" +DROP INDEX "entitlementplan_name_version_owner_id"; +-- reverse: create index "entitlement_plans_mapping_id_key" to table: "entitlement_plans" +DROP INDEX "entitlement_plans_mapping_id_key"; +-- reverse: create "entitlement_plans" table +DROP TABLE "entitlement_plans"; +-- reverse: create index "entity_name_owner_id" to table: "entities" +DROP INDEX "entity_name_owner_id"; +-- reverse: create index "entities_mapping_id_key" to table: "entities" +DROP INDEX "entities_mapping_id_key"; +-- reverse: create "entities" table +DROP TABLE "entities"; +-- reverse: create index "entitytype_name_owner_id" to table: "entity_types" +DROP INDEX "entitytype_name_owner_id"; +-- reverse: create index "entity_types_mapping_id_key" to table: "entity_types" +DROP INDEX "entity_types_mapping_id_key"; +-- reverse: create "entity_types" table +DROP TABLE "entity_types"; +-- reverse: create index "emailverificationtoken_token" to table: "email_verification_tokens" +DROP INDEX "emailverificationtoken_token"; +-- reverse: create index "email_verification_tokens_token_key" to table: "email_verification_tokens" +DROP INDEX "email_verification_tokens_token_key"; +-- reverse: create index "email_verification_tokens_mapping_id_key" to table: "email_verification_tokens" +DROP INDEX "email_verification_tokens_mapping_id_key"; +-- reverse: create "email_verification_tokens" table +DROP TABLE "email_verification_tokens"; +-- reverse: create index "users_sub_key" to table: "users" +DROP INDEX "users_sub_key"; +-- reverse: create index "users_mapping_id_key" to table: "users" +DROP INDEX "users_mapping_id_key"; +-- reverse: create index "user_id" to table: "users" +DROP INDEX "user_id"; +-- reverse: create index "user_email_auth_provider" to table: "users" +DROP INDEX "user_email_auth_provider"; +-- reverse: create "users" table +DROP TABLE "users"; +-- reverse: create index "document_data_mapping_id_key" to table: "document_data" +DROP INDEX "document_data_mapping_id_key"; +-- reverse: create "document_data" table +DROP TABLE "document_data"; +-- reverse: create index "templates_mapping_id_key" to table: "templates" +DROP INDEX "templates_mapping_id_key"; +-- reverse: create index "template_name_owner_id_template_type" to table: "templates" +DROP INDEX "template_name_owner_id_template_type"; +-- reverse: create "templates" table +DROP TABLE "templates"; +-- reverse: create index "contacts_mapping_id_key" to table: "contacts" +DROP INDEX "contacts_mapping_id_key"; +-- reverse: create "contacts" table +DROP TABLE "contacts"; +-- reverse: create index "apitoken_token" to table: "api_tokens" +DROP INDEX "apitoken_token"; +-- reverse: create index "api_tokens_token_key" to table: "api_tokens" +DROP INDEX "api_tokens_token_key"; +-- reverse: create index "api_tokens_mapping_id_key" to table: "api_tokens" +DROP INDEX "api_tokens_mapping_id_key"; +-- reverse: create "api_tokens" table +DROP TABLE "api_tokens"; +-- reverse: create index "groupmembershiphistory_history_time" to table: "group_membership_history" +DROP INDEX "groupmembershiphistory_history_time"; +-- reverse: create "group_membership_history" table +DROP TABLE "group_membership_history"; +-- reverse: create index "grouphistory_history_time" to table: "group_history" +DROP INDEX "grouphistory_history_time"; +-- reverse: create "group_history" table +DROP TABLE "group_history"; +-- reverse: create index "groupsettinghistory_history_time" to table: "group_setting_history" +DROP INDEX "groupsettinghistory_history_time"; +-- reverse: create "group_setting_history" table +DROP TABLE "group_setting_history"; +-- reverse: create index "hushhistory_history_time" to table: "hush_history" +DROP INDEX "hushhistory_history_time"; +-- reverse: create "hush_history" table +DROP TABLE "hush_history"; +-- reverse: create index "organizationhistory_history_time" to table: "organization_history" +DROP INDEX "organizationhistory_history_time"; +-- reverse: create "organization_history" table +DROP TABLE "organization_history"; +-- reverse: create index "featurehistory_history_time" to table: "feature_history" +DROP INDEX "featurehistory_history_time"; +-- reverse: create "feature_history" table +DROP TABLE "feature_history"; +-- reverse: create index "integrationhistory_history_time" to table: "integration_history" +DROP INDEX "integrationhistory_history_time"; +-- reverse: create "integration_history" table +DROP TABLE "integration_history"; +-- reverse: create index "eventhistory_history_time" to table: "event_history" +DROP INDEX "eventhistory_history_time"; +-- reverse: create "event_history" table +DROP TABLE "event_history"; +-- reverse: create index "usersettinghistory_history_time" to table: "user_setting_history" +DROP INDEX "usersettinghistory_history_time"; +-- reverse: create "user_setting_history" table +DROP TABLE "user_setting_history"; +-- reverse: create index "entitytypehistory_history_time" to table: "entity_type_history" +DROP INDEX "entitytypehistory_history_time"; +-- reverse: create "entity_type_history" table +DROP TABLE "entity_type_history"; +-- reverse: create index "userhistory_history_time" to table: "user_history" +DROP INDEX "userhistory_history_time"; +-- reverse: create "user_history" table +DROP TABLE "user_history"; +-- reverse: create index "entityhistory_history_time" to table: "entity_history" +DROP INDEX "entityhistory_history_time"; +-- reverse: create "entity_history" table +DROP TABLE "entity_history"; +-- reverse: create index "notehistory_history_time" to table: "note_history" +DROP INDEX "notehistory_history_time"; +-- reverse: create "note_history" table +DROP TABLE "note_history"; +-- reverse: create index "entitlementplanhistory_history_time" to table: "entitlement_plan_history" +DROP INDEX "entitlementplanhistory_history_time"; +-- reverse: create "entitlement_plan_history" table +DROP TABLE "entitlement_plan_history"; +-- reverse: create index "entitlementplanfeaturehistory_history_time" to table: "entitlement_plan_feature_history" +DROP INDEX "entitlementplanfeaturehistory_history_time"; +-- reverse: create "entitlement_plan_feature_history" table +DROP TABLE "entitlement_plan_feature_history"; +-- reverse: create index "oauthproviderhistory_history_time" to table: "oauth_provider_history" +DROP INDEX "oauthproviderhistory_history_time"; +-- reverse: create "oauth_provider_history" table +DROP TABLE "oauth_provider_history"; +-- reverse: create index "templatehistory_history_time" to table: "template_history" +DROP INDEX "templatehistory_history_time"; +-- reverse: create "template_history" table +DROP TABLE "template_history"; +-- reverse: create index "entitlementhistory_history_time" to table: "entitlement_history" +DROP INDEX "entitlementhistory_history_time"; +-- reverse: create "entitlement_history" table +DROP TABLE "entitlement_history"; +-- reverse: create index "orgmembershiphistory_history_time" to table: "org_membership_history" +DROP INDEX "orgmembershiphistory_history_time"; +-- reverse: create "org_membership_history" table +DROP TABLE "org_membership_history"; +-- reverse: create index "webhookhistory_history_time" to table: "webhook_history" +DROP INDEX "webhookhistory_history_time"; +-- reverse: create "webhook_history" table +DROP TABLE "webhook_history"; +-- reverse: create index "documentdatahistory_history_time" to table: "document_data_history" +DROP INDEX "documentdatahistory_history_time"; +-- reverse: create "document_data_history" table +DROP TABLE "document_data_history"; +-- reverse: create index "organizationsettinghistory_history_time" to table: "organization_setting_history" +DROP INDEX "organizationsettinghistory_history_time"; +-- reverse: create "organization_setting_history" table +DROP TABLE "organization_setting_history"; +-- reverse: create index "contacthistory_history_time" to table: "contact_history" +DROP INDEX "contacthistory_history_time"; +-- reverse: create "contact_history" table +DROP TABLE "contact_history"; +-- reverse: create index "filehistory_history_time" to table: "file_history" +DROP INDEX "filehistory_history_time"; +-- reverse: create "file_history" table +DROP TABLE "file_history"; +-- reverse: create index "organizations_mapping_id_key" to table: "organizations" +DROP INDEX "organizations_mapping_id_key"; +-- reverse: create index "organization_name" to table: "organizations" +DROP INDEX "organization_name"; +-- reverse: create "organizations" table +DROP TABLE "organizations"; diff --git a/db/migrations-goose-postgres/atlas.sum b/db/migrations-goose-postgres/atlas.sum new file mode 100644 index 0000000..84090c6 --- /dev/null +++ b/db/migrations-goose-postgres/atlas.sum @@ -0,0 +1,2 @@ +h1:NUVn0uUG2JaUAGiR8wLtXCEJI/DH6pkQRIfGx0GUB2Y= +20240827061503_init.sql h1:D0Ce7h0FSKpjtQOHZK5gXOpaPvlNAFHHzqfQQ8re0T4= diff --git a/db/migrations-goose-sqlite/20240827061437_init.sql b/db/migrations-goose-sqlite/20240827061437_init.sql new file mode 100644 index 0000000..e70a0bb --- /dev/null +++ b/db/migrations-goose-sqlite/20240827061437_init.sql @@ -0,0 +1,699 @@ +-- +goose Up +-- create "api_tokens" table +CREATE TABLE `api_tokens` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `name` text NOT NULL, `token` text NOT NULL, `expires_at` datetime NULL, `description` text NULL, `scopes` json NULL, `last_used_at` datetime NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `api_tokens_organizations_api_tokens` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "api_tokens_mapping_id_key" to table: "api_tokens" +CREATE UNIQUE INDEX `api_tokens_mapping_id_key` ON `api_tokens` (`mapping_id`); +-- create index "api_tokens_token_key" to table: "api_tokens" +CREATE UNIQUE INDEX `api_tokens_token_key` ON `api_tokens` (`token`); +-- create index "apitoken_token" to table: "api_tokens" +CREATE INDEX `apitoken_token` ON `api_tokens` (`token`); +-- create "contacts" table +CREATE TABLE `contacts` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `full_name` text NOT NULL, `title` text NULL, `company` text NULL, `email` text NULL, `phone_number` text NULL, `address` text NULL, `status` text NOT NULL DEFAULT ('ACTIVE'), `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `contacts_organizations_contacts` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "contacts_mapping_id_key" to table: "contacts" +CREATE UNIQUE INDEX `contacts_mapping_id_key` ON `contacts` (`mapping_id`); +-- create "contact_history" table +CREATE TABLE `contact_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `owner_id` text NULL, `full_name` text NOT NULL, `title` text NULL, `company` text NULL, `email` text NULL, `phone_number` text NULL, `address` text NULL, `status` text NOT NULL DEFAULT ('ACTIVE'), PRIMARY KEY (`id`)); +-- create index "contacthistory_history_time" to table: "contact_history" +CREATE INDEX `contacthistory_history_time` ON `contact_history` (`history_time`); +-- create "document_data" table +CREATE TABLE `document_data` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `data` json NOT NULL, `owner_id` text NULL, `template_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `document_data_organizations_documentdata` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL, CONSTRAINT `document_data_templates_documents` FOREIGN KEY (`template_id`) REFERENCES `templates` (`id`) ON DELETE NO ACTION); +-- create index "document_data_mapping_id_key" to table: "document_data" +CREATE UNIQUE INDEX `document_data_mapping_id_key` ON `document_data` (`mapping_id`); +-- create "document_data_history" table +CREATE TABLE `document_data_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `owner_id` text NULL, `template_id` text NOT NULL, `data` json NOT NULL, PRIMARY KEY (`id`)); +-- create index "documentdatahistory_history_time" to table: "document_data_history" +CREATE INDEX `documentdatahistory_history_time` ON `document_data_history` (`history_time`); +-- create "email_verification_tokens" table +CREATE TABLE `email_verification_tokens` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `token` text NOT NULL, `ttl` datetime NOT NULL, `email` text NOT NULL, `secret` blob NOT NULL, `owner_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `email_verification_tokens_users_email_verification_tokens` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION); +-- create index "email_verification_tokens_mapping_id_key" to table: "email_verification_tokens" +CREATE UNIQUE INDEX `email_verification_tokens_mapping_id_key` ON `email_verification_tokens` (`mapping_id`); +-- create index "email_verification_tokens_token_key" to table: "email_verification_tokens" +CREATE UNIQUE INDEX `email_verification_tokens_token_key` ON `email_verification_tokens` (`token`); +-- create index "emailverificationtoken_token" to table: "email_verification_tokens" +CREATE UNIQUE INDEX `emailverificationtoken_token` ON `email_verification_tokens` (`token`) WHERE deleted_at is NULL; +-- create "entitlements" table +CREATE TABLE `entitlements` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `external_customer_id` text NULL, `external_subscription_id` text NULL, `expires` bool NOT NULL DEFAULT (false), `expires_at` datetime NULL, `cancelled` bool NOT NULL DEFAULT (false), `plan_id` text NOT NULL, `owner_id` text NULL, `organization_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `entitlements_entitlement_plans_entitlements` FOREIGN KEY (`plan_id`) REFERENCES `entitlement_plans` (`id`) ON DELETE NO ACTION, CONSTRAINT `entitlements_organizations_entitlements` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL, CONSTRAINT `entitlements_organizations_organization_entitlement` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE NO ACTION); +-- create index "entitlements_mapping_id_key" to table: "entitlements" +CREATE UNIQUE INDEX `entitlements_mapping_id_key` ON `entitlements` (`mapping_id`); +-- create index "entitlement_organization_id_owner_id" to table: "entitlements" +CREATE UNIQUE INDEX `entitlement_organization_id_owner_id` ON `entitlements` (`organization_id`, `owner_id`) WHERE deleted_at is NULL and cancelled = false; +-- create "entitlement_history" table +CREATE TABLE `entitlement_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `owner_id` text NULL, `plan_id` text NOT NULL, `organization_id` text NOT NULL, `external_customer_id` text NULL, `external_subscription_id` text NULL, `expires` bool NOT NULL DEFAULT (false), `expires_at` datetime NULL, `cancelled` bool NOT NULL DEFAULT (false), PRIMARY KEY (`id`)); +-- create index "entitlementhistory_history_time" to table: "entitlement_history" +CREATE INDEX `entitlementhistory_history_time` ON `entitlement_history` (`history_time`); +-- create "entitlement_plans" table +CREATE TABLE `entitlement_plans` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `display_name` text NULL, `name` text NOT NULL, `description` text NULL, `version` text NOT NULL, `metadata` json NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `entitlement_plans_organizations_entitlementplans` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "entitlement_plans_mapping_id_key" to table: "entitlement_plans" +CREATE UNIQUE INDEX `entitlement_plans_mapping_id_key` ON `entitlement_plans` (`mapping_id`); +-- create index "entitlementplan_name_version_owner_id" to table: "entitlement_plans" +CREATE UNIQUE INDEX `entitlementplan_name_version_owner_id` ON `entitlement_plans` (`name`, `version`, `owner_id`) WHERE deleted_at is NULL; +-- create "entitlement_plan_features" table +CREATE TABLE `entitlement_plan_features` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `metadata` json NULL, `plan_id` text NOT NULL, `feature_id` text NOT NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `entitlement_plan_features_entitlement_plans_plan` FOREIGN KEY (`plan_id`) REFERENCES `entitlement_plans` (`id`) ON DELETE NO ACTION, CONSTRAINT `entitlement_plan_features_features_feature` FOREIGN KEY (`feature_id`) REFERENCES `features` (`id`) ON DELETE NO ACTION, CONSTRAINT `entitlement_plan_features_organizations_entitlementplanfeatures` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "entitlement_plan_features_mapping_id_key" to table: "entitlement_plan_features" +CREATE UNIQUE INDEX `entitlement_plan_features_mapping_id_key` ON `entitlement_plan_features` (`mapping_id`); +-- create index "entitlementplanfeature_feature_id_plan_id" to table: "entitlement_plan_features" +CREATE UNIQUE INDEX `entitlementplanfeature_feature_id_plan_id` ON `entitlement_plan_features` (`feature_id`, `plan_id`) WHERE deleted_at is NULL; +-- create "entitlement_plan_feature_history" table +CREATE TABLE `entitlement_plan_feature_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `owner_id` text NULL, `metadata` json NULL, `plan_id` text NOT NULL, `feature_id` text NOT NULL, PRIMARY KEY (`id`)); +-- create index "entitlementplanfeaturehistory_history_time" to table: "entitlement_plan_feature_history" +CREATE INDEX `entitlementplanfeaturehistory_history_time` ON `entitlement_plan_feature_history` (`history_time`); +-- create "entitlement_plan_history" table +CREATE TABLE `entitlement_plan_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `owner_id` text NULL, `display_name` text NULL, `name` text NOT NULL, `description` text NULL, `version` text NOT NULL, `metadata` json NULL, PRIMARY KEY (`id`)); +-- create index "entitlementplanhistory_history_time" to table: "entitlement_plan_history" +CREATE INDEX `entitlementplanhistory_history_time` ON `entitlement_plan_history` (`history_time`); +-- create "entities" table +CREATE TABLE `entities` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `name` text NULL, `display_name` text NULL, `description` text NULL, `domains` json NULL, `status` text NULL DEFAULT ('active'), `entity_type_id` text NULL, `entity_type_entities` text NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `entities_entity_types_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `entity_types` (`id`) ON DELETE SET NULL, CONSTRAINT `entities_entity_types_entities` FOREIGN KEY (`entity_type_entities`) REFERENCES `entity_types` (`id`) ON DELETE SET NULL, CONSTRAINT `entities_organizations_entities` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "entities_mapping_id_key" to table: "entities" +CREATE UNIQUE INDEX `entities_mapping_id_key` ON `entities` (`mapping_id`); +-- create index "entity_name_owner_id" to table: "entities" +CREATE UNIQUE INDEX `entity_name_owner_id` ON `entities` (`name`, `owner_id`) WHERE deleted_at is NULL; +-- create "entity_history" table +CREATE TABLE `entity_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `owner_id` text NULL, `name` text NULL, `display_name` text NULL, `description` text NULL, `domains` json NULL, `entity_type_id` text NULL, `status` text NULL DEFAULT ('active'), PRIMARY KEY (`id`)); +-- create index "entityhistory_history_time" to table: "entity_history" +CREATE INDEX `entityhistory_history_time` ON `entity_history` (`history_time`); +-- create "entity_types" table +CREATE TABLE `entity_types` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `name` text NOT NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `entity_types_organizations_entitytypes` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "entity_types_mapping_id_key" to table: "entity_types" +CREATE UNIQUE INDEX `entity_types_mapping_id_key` ON `entity_types` (`mapping_id`); +-- create index "entitytype_name_owner_id" to table: "entity_types" +CREATE UNIQUE INDEX `entitytype_name_owner_id` ON `entity_types` (`name`, `owner_id`) WHERE deleted_at is NULL; +-- create "entity_type_history" table +CREATE TABLE `entity_type_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `owner_id` text NULL, `name` text NOT NULL, PRIMARY KEY (`id`)); +-- create index "entitytypehistory_history_time" to table: "entity_type_history" +CREATE INDEX `entitytypehistory_history_time` ON `entity_type_history` (`history_time`); +-- create "events" table +CREATE TABLE `events` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `event_id` text NULL, `correlation_id` text NULL, `event_type` text NOT NULL, `metadata` json NULL, PRIMARY KEY (`id`)); +-- create index "events_mapping_id_key" to table: "events" +CREATE UNIQUE INDEX `events_mapping_id_key` ON `events` (`mapping_id`); +-- create "event_history" table +CREATE TABLE `event_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `event_id` text NULL, `correlation_id` text NULL, `event_type` text NOT NULL, `metadata` json NULL, PRIMARY KEY (`id`)); +-- create index "eventhistory_history_time" to table: "event_history" +CREATE INDEX `eventhistory_history_time` ON `event_history` (`history_time`); +-- create "features" table +CREATE TABLE `features` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `name` text NOT NULL, `display_name` text NULL, `enabled` bool NOT NULL DEFAULT (false), `description` text NULL, `metadata` json NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `features_organizations_features` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "features_mapping_id_key" to table: "features" +CREATE UNIQUE INDEX `features_mapping_id_key` ON `features` (`mapping_id`); +-- create index "feature_name_owner_id" to table: "features" +CREATE UNIQUE INDEX `feature_name_owner_id` ON `features` (`name`, `owner_id`) WHERE deleted_at is NULL; +-- create "feature_history" table +CREATE TABLE `feature_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `owner_id` text NULL, `name` text NOT NULL, `display_name` text NULL, `enabled` bool NOT NULL DEFAULT (false), `description` text NULL, `metadata` json NULL, PRIMARY KEY (`id`)); +-- create index "featurehistory_history_time" to table: "feature_history" +CREATE INDEX `featurehistory_history_time` ON `feature_history` (`history_time`); +-- create "files" table +CREATE TABLE `files` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `file_name` text NOT NULL, `file_extension` text NOT NULL, `file_size` integer NULL, `content_type` text NOT NULL, `store_key` text NOT NULL, `category` text NULL, `annotation` text NULL, `user_files` text NULL, PRIMARY KEY (`id`), CONSTRAINT `files_users_files` FOREIGN KEY (`user_files`) REFERENCES `users` (`id`) ON DELETE SET NULL); +-- create index "files_mapping_id_key" to table: "files" +CREATE UNIQUE INDEX `files_mapping_id_key` ON `files` (`mapping_id`); +-- create "file_history" table +CREATE TABLE `file_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `file_name` text NOT NULL, `file_extension` text NOT NULL, `file_size` integer NULL, `content_type` text NOT NULL, `store_key` text NOT NULL, `category` text NULL, `annotation` text NULL, PRIMARY KEY (`id`)); +-- create index "filehistory_history_time" to table: "file_history" +CREATE INDEX `filehistory_history_time` ON `file_history` (`history_time`); +-- create "groups" table +CREATE TABLE `groups` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `name` text NOT NULL, `description` text NULL, `gravatar_logo_url` text NULL, `logo_url` text NULL, `display_name` text NOT NULL DEFAULT (''), `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `groups_organizations_groups` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "groups_mapping_id_key" to table: "groups" +CREATE UNIQUE INDEX `groups_mapping_id_key` ON `groups` (`mapping_id`); +-- create index "group_name_owner_id" to table: "groups" +CREATE UNIQUE INDEX `group_name_owner_id` ON `groups` (`name`, `owner_id`) WHERE deleted_at is NULL; +-- create "group_history" table +CREATE TABLE `group_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `owner_id` text NULL, `name` text NOT NULL, `description` text NULL, `gravatar_logo_url` text NULL, `logo_url` text NULL, `display_name` text NOT NULL DEFAULT (''), PRIMARY KEY (`id`)); +-- create index "grouphistory_history_time" to table: "group_history" +CREATE INDEX `grouphistory_history_time` ON `group_history` (`history_time`); +-- create "group_memberships" table +CREATE TABLE `group_memberships` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `role` text NOT NULL DEFAULT ('MEMBER'), `group_id` text NOT NULL, `user_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `group_memberships_groups_group` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE NO ACTION, CONSTRAINT `group_memberships_users_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION); +-- create index "group_memberships_mapping_id_key" to table: "group_memberships" +CREATE UNIQUE INDEX `group_memberships_mapping_id_key` ON `group_memberships` (`mapping_id`); +-- create index "groupmembership_user_id_group_id" to table: "group_memberships" +CREATE UNIQUE INDEX `groupmembership_user_id_group_id` ON `group_memberships` (`user_id`, `group_id`) WHERE deleted_at is NULL; +-- create "group_membership_history" table +CREATE TABLE `group_membership_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `role` text NOT NULL DEFAULT ('MEMBER'), `group_id` text NOT NULL, `user_id` text NOT NULL, PRIMARY KEY (`id`)); +-- create index "groupmembershiphistory_history_time" to table: "group_membership_history" +CREATE INDEX `groupmembershiphistory_history_time` ON `group_membership_history` (`history_time`); +-- create "group_settings" table +CREATE TABLE `group_settings` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `visibility` text NOT NULL DEFAULT ('PUBLIC'), `join_policy` text NOT NULL DEFAULT ('INVITE_OR_APPLICATION'), `sync_to_slack` bool NULL DEFAULT (false), `sync_to_github` bool NULL DEFAULT (false), `group_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `group_settings_groups_setting` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE SET NULL); +-- create index "group_settings_mapping_id_key" to table: "group_settings" +CREATE UNIQUE INDEX `group_settings_mapping_id_key` ON `group_settings` (`mapping_id`); +-- create index "group_settings_group_id_key" to table: "group_settings" +CREATE UNIQUE INDEX `group_settings_group_id_key` ON `group_settings` (`group_id`); +-- create "group_setting_history" table +CREATE TABLE `group_setting_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `visibility` text NOT NULL DEFAULT ('PUBLIC'), `join_policy` text NOT NULL DEFAULT ('INVITE_OR_APPLICATION'), `sync_to_slack` bool NULL DEFAULT (false), `sync_to_github` bool NULL DEFAULT (false), `group_id` text NULL, PRIMARY KEY (`id`)); +-- create index "groupsettinghistory_history_time" to table: "group_setting_history" +CREATE INDEX `groupsettinghistory_history_time` ON `group_setting_history` (`history_time`); +-- create "hushes" table +CREATE TABLE `hushes` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `name` text NOT NULL, `description` text NULL, `kind` text NULL, `secret_name` text NULL, `secret_value` text NULL, PRIMARY KEY (`id`)); +-- create index "hushes_mapping_id_key" to table: "hushes" +CREATE UNIQUE INDEX `hushes_mapping_id_key` ON `hushes` (`mapping_id`); +-- create "hush_history" table +CREATE TABLE `hush_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `name` text NOT NULL, `description` text NULL, `kind` text NULL, `secret_name` text NULL, `secret_value` text NULL, PRIMARY KEY (`id`)); +-- create index "hushhistory_history_time" to table: "hush_history" +CREATE INDEX `hushhistory_history_time` ON `hush_history` (`history_time`); +-- create "integrations" table +CREATE TABLE `integrations` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `name` text NOT NULL, `description` text NULL, `kind` text NULL, `group_integrations` text NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `integrations_groups_integrations` FOREIGN KEY (`group_integrations`) REFERENCES `groups` (`id`) ON DELETE SET NULL, CONSTRAINT `integrations_organizations_integrations` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "integrations_mapping_id_key" to table: "integrations" +CREATE UNIQUE INDEX `integrations_mapping_id_key` ON `integrations` (`mapping_id`); +-- create "integration_history" table +CREATE TABLE `integration_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `owner_id` text NULL, `name` text NOT NULL, `description` text NULL, `kind` text NULL, PRIMARY KEY (`id`)); +-- create index "integrationhistory_history_time" to table: "integration_history" +CREATE INDEX `integrationhistory_history_time` ON `integration_history` (`history_time`); +-- create "invites" table +CREATE TABLE `invites` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `token` text NOT NULL, `expires` datetime NULL, `recipient` text NOT NULL, `status` text NOT NULL DEFAULT ('INVITATION_SENT'), `role` text NOT NULL DEFAULT ('MEMBER'), `send_attempts` integer NOT NULL DEFAULT (0), `requestor_id` text NULL, `secret` blob NOT NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `invites_organizations_invites` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "invites_mapping_id_key" to table: "invites" +CREATE UNIQUE INDEX `invites_mapping_id_key` ON `invites` (`mapping_id`); +-- create index "invites_token_key" to table: "invites" +CREATE UNIQUE INDEX `invites_token_key` ON `invites` (`token`); +-- create index "invite_recipient_owner_id" to table: "invites" +CREATE UNIQUE INDEX `invite_recipient_owner_id` ON `invites` (`recipient`, `owner_id`) WHERE deleted_at is NULL; +-- create "notes" table +CREATE TABLE `notes` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `text` text NOT NULL, `entity_notes` text NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `notes_entities_notes` FOREIGN KEY (`entity_notes`) REFERENCES `entities` (`id`) ON DELETE SET NULL, CONSTRAINT `notes_organizations_notes` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "notes_mapping_id_key" to table: "notes" +CREATE UNIQUE INDEX `notes_mapping_id_key` ON `notes` (`mapping_id`); +-- create "note_history" table +CREATE TABLE `note_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `owner_id` text NULL, `text` text NOT NULL, PRIMARY KEY (`id`)); +-- create index "notehistory_history_time" to table: "note_history" +CREATE INDEX `notehistory_history_time` ON `note_history` (`history_time`); +-- create "oauth_providers" table +CREATE TABLE `oauth_providers` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `name` text NOT NULL, `client_id` text NOT NULL, `client_secret` text NOT NULL, `redirect_url` text NOT NULL, `scopes` text NOT NULL, `auth_url` text NOT NULL, `token_url` text NOT NULL, `auth_style` integer NOT NULL, `info_url` text NOT NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `oauth_providers_organizations_oauthprovider` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "oauth_providers_mapping_id_key" to table: "oauth_providers" +CREATE UNIQUE INDEX `oauth_providers_mapping_id_key` ON `oauth_providers` (`mapping_id`); +-- create "oauth_provider_history" table +CREATE TABLE `oauth_provider_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `owner_id` text NULL, `name` text NOT NULL, `client_id` text NOT NULL, `client_secret` text NOT NULL, `redirect_url` text NOT NULL, `scopes` text NOT NULL, `auth_url` text NOT NULL, `token_url` text NOT NULL, `auth_style` integer NOT NULL, `info_url` text NOT NULL, PRIMARY KEY (`id`)); +-- create index "oauthproviderhistory_history_time" to table: "oauth_provider_history" +CREATE INDEX `oauthproviderhistory_history_time` ON `oauth_provider_history` (`history_time`); +-- create "oh_auth_too_tokens" table +CREATE TABLE `oh_auth_too_tokens` (`id` text NOT NULL, `mapping_id` text NOT NULL, `tags` json NULL, `client_id` text NOT NULL, `scopes` json NULL, `nonce` text NOT NULL, `claims_user_id` text NOT NULL, `claims_username` text NOT NULL, `claims_email` text NOT NULL, `claims_email_verified` bool NOT NULL, `claims_groups` json NULL, `claims_preferred_username` text NOT NULL, `connector_id` text NOT NULL, `connector_data` json NULL, `last_used` datetime NOT NULL, PRIMARY KEY (`id`)); +-- create index "oh_auth_too_tokens_mapping_id_key" to table: "oh_auth_too_tokens" +CREATE UNIQUE INDEX `oh_auth_too_tokens_mapping_id_key` ON `oh_auth_too_tokens` (`mapping_id`); +-- create "org_memberships" table +CREATE TABLE `org_memberships` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `role` text NOT NULL DEFAULT ('MEMBER'), `organization_id` text NOT NULL, `user_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `org_memberships_organizations_organization` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE NO ACTION, CONSTRAINT `org_memberships_users_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION); +-- create index "org_memberships_mapping_id_key" to table: "org_memberships" +CREATE UNIQUE INDEX `org_memberships_mapping_id_key` ON `org_memberships` (`mapping_id`); +-- create index "orgmembership_user_id_organization_id" to table: "org_memberships" +CREATE UNIQUE INDEX `orgmembership_user_id_organization_id` ON `org_memberships` (`user_id`, `organization_id`) WHERE deleted_at is NULL; +-- create "org_membership_history" table +CREATE TABLE `org_membership_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `role` text NOT NULL DEFAULT ('MEMBER'), `organization_id` text NOT NULL, `user_id` text NOT NULL, PRIMARY KEY (`id`)); +-- create index "orgmembershiphistory_history_time" to table: "org_membership_history" +CREATE INDEX `orgmembershiphistory_history_time` ON `org_membership_history` (`history_time`); +-- create "organizations" table +CREATE TABLE `organizations` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `name` text NOT NULL, `display_name` text NOT NULL DEFAULT (''), `description` text NULL, `personal_org` bool NULL DEFAULT (false), `avatar_remote_url` text NULL, `dedicated_db` bool NOT NULL DEFAULT (false), `parent_organization_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `organizations_organizations_children` FOREIGN KEY (`parent_organization_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "organizations_mapping_id_key" to table: "organizations" +CREATE UNIQUE INDEX `organizations_mapping_id_key` ON `organizations` (`mapping_id`); +-- create index "organization_name" to table: "organizations" +CREATE UNIQUE INDEX `organization_name` ON `organizations` (`name`) WHERE deleted_at is NULL; +-- create "organization_history" table +CREATE TABLE `organization_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `name` text NOT NULL, `display_name` text NOT NULL DEFAULT (''), `description` text NULL, `parent_organization_id` text NULL, `personal_org` bool NULL DEFAULT (false), `avatar_remote_url` text NULL, `dedicated_db` bool NOT NULL DEFAULT (false), PRIMARY KEY (`id`)); +-- create index "organizationhistory_history_time" to table: "organization_history" +CREATE INDEX `organizationhistory_history_time` ON `organization_history` (`history_time`); +-- create "organization_settings" table +CREATE TABLE `organization_settings` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `domains` json NULL, `billing_contact` text NULL, `billing_email` text NULL, `billing_phone` text NULL, `billing_address` text NULL, `tax_identifier` text NULL, `geo_location` text NULL DEFAULT ('AMER'), `organization_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `organization_settings_organizations_setting` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "organization_settings_mapping_id_key" to table: "organization_settings" +CREATE UNIQUE INDEX `organization_settings_mapping_id_key` ON `organization_settings` (`mapping_id`); +-- create index "organization_settings_organization_id_key" to table: "organization_settings" +CREATE UNIQUE INDEX `organization_settings_organization_id_key` ON `organization_settings` (`organization_id`); +-- create "organization_setting_history" table +CREATE TABLE `organization_setting_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `domains` json NULL, `billing_contact` text NULL, `billing_email` text NULL, `billing_phone` text NULL, `billing_address` text NULL, `tax_identifier` text NULL, `geo_location` text NULL DEFAULT ('AMER'), `organization_id` text NULL, PRIMARY KEY (`id`)); +-- create index "organizationsettinghistory_history_time" to table: "organization_setting_history" +CREATE INDEX `organizationsettinghistory_history_time` ON `organization_setting_history` (`history_time`); +-- create "password_reset_tokens" table +CREATE TABLE `password_reset_tokens` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `token` text NOT NULL, `ttl` datetime NOT NULL, `email` text NOT NULL, `secret` blob NOT NULL, `owner_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `password_reset_tokens_users_password_reset_tokens` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION); +-- create index "password_reset_tokens_mapping_id_key" to table: "password_reset_tokens" +CREATE UNIQUE INDEX `password_reset_tokens_mapping_id_key` ON `password_reset_tokens` (`mapping_id`); +-- create index "password_reset_tokens_token_key" to table: "password_reset_tokens" +CREATE UNIQUE INDEX `password_reset_tokens_token_key` ON `password_reset_tokens` (`token`); +-- create index "passwordresettoken_token" to table: "password_reset_tokens" +CREATE UNIQUE INDEX `passwordresettoken_token` ON `password_reset_tokens` (`token`) WHERE deleted_at is NULL; +-- create "personal_access_tokens" table +CREATE TABLE `personal_access_tokens` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `name` text NOT NULL, `token` text NOT NULL, `expires_at` datetime NULL, `description` text NULL, `scopes` json NULL, `last_used_at` datetime NULL, `owner_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `personal_access_tokens_users_personal_access_tokens` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION); +-- create index "personal_access_tokens_mapping_id_key" to table: "personal_access_tokens" +CREATE UNIQUE INDEX `personal_access_tokens_mapping_id_key` ON `personal_access_tokens` (`mapping_id`); +-- create index "personal_access_tokens_token_key" to table: "personal_access_tokens" +CREATE UNIQUE INDEX `personal_access_tokens_token_key` ON `personal_access_tokens` (`token`); +-- create index "personalaccesstoken_token" to table: "personal_access_tokens" +CREATE INDEX `personalaccesstoken_token` ON `personal_access_tokens` (`token`); +-- create "subscribers" table +CREATE TABLE `subscribers` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `email` text NOT NULL, `phone_number` text NULL, `verified_email` bool NOT NULL DEFAULT (false), `verified_phone` bool NOT NULL DEFAULT (false), `active` bool NOT NULL DEFAULT (false), `token` text NOT NULL, `ttl` datetime NOT NULL, `secret` blob NOT NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `subscribers_organizations_subscribers` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "subscribers_mapping_id_key" to table: "subscribers" +CREATE UNIQUE INDEX `subscribers_mapping_id_key` ON `subscribers` (`mapping_id`); +-- create index "subscribers_token_key" to table: "subscribers" +CREATE UNIQUE INDEX `subscribers_token_key` ON `subscribers` (`token`); +-- create index "subscriber_email_owner_id" to table: "subscribers" +CREATE UNIQUE INDEX `subscriber_email_owner_id` ON `subscribers` (`email`, `owner_id`) WHERE deleted_at is NULL; +-- create "tfa_settings" table +CREATE TABLE `tfa_settings` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `tags` json NULL, `tfa_secret` text NULL, `verified` bool NOT NULL DEFAULT (false), `recovery_codes` json NULL, `phone_otp_allowed` bool NULL DEFAULT (false), `email_otp_allowed` bool NULL DEFAULT (false), `totp_allowed` bool NULL DEFAULT (false), `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `tfa_settings_users_tfa_settings` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE SET NULL); +-- create index "tfa_settings_mapping_id_key" to table: "tfa_settings" +CREATE UNIQUE INDEX `tfa_settings_mapping_id_key` ON `tfa_settings` (`mapping_id`); +-- create index "tfasetting_owner_id" to table: "tfa_settings" +CREATE UNIQUE INDEX `tfasetting_owner_id` ON `tfa_settings` (`owner_id`) WHERE deleted_at is NULL; +-- create "templates" table +CREATE TABLE `templates` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `name` text NOT NULL, `template_type` text NOT NULL DEFAULT ('DOCUMENT'), `description` text NULL, `jsonconfig` json NOT NULL, `uischema` json NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `templates_organizations_templates` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "templates_mapping_id_key" to table: "templates" +CREATE UNIQUE INDEX `templates_mapping_id_key` ON `templates` (`mapping_id`); +-- create index "template_name_owner_id_template_type" to table: "templates" +CREATE UNIQUE INDEX `template_name_owner_id_template_type` ON `templates` (`name`, `owner_id`, `template_type`) WHERE deleted_at is NULL; +-- create "template_history" table +CREATE TABLE `template_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `owner_id` text NULL, `name` text NOT NULL, `template_type` text NOT NULL DEFAULT ('DOCUMENT'), `description` text NULL, `jsonconfig` json NOT NULL, `uischema` json NULL, PRIMARY KEY (`id`)); +-- create index "templatehistory_history_time" to table: "template_history" +CREATE INDEX `templatehistory_history_time` ON `template_history` (`history_time`); +-- create "users" table +CREATE TABLE `users` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `email` text NOT NULL, `first_name` text NULL, `last_name` text NULL, `display_name` text NOT NULL, `avatar_remote_url` text NULL, `avatar_local_file` text NULL, `avatar_updated_at` datetime NULL, `last_seen` datetime NULL, `password` text NULL, `sub` text NULL, `auth_provider` text NOT NULL DEFAULT ('CREDENTIALS'), `role` text NULL DEFAULT ('USER'), PRIMARY KEY (`id`)); +-- create index "users_mapping_id_key" to table: "users" +CREATE UNIQUE INDEX `users_mapping_id_key` ON `users` (`mapping_id`); +-- create index "users_sub_key" to table: "users" +CREATE UNIQUE INDEX `users_sub_key` ON `users` (`sub`); +-- create index "user_id" to table: "users" +CREATE UNIQUE INDEX `user_id` ON `users` (`id`); +-- create index "user_email_auth_provider" to table: "users" +CREATE UNIQUE INDEX `user_email_auth_provider` ON `users` (`email`, `auth_provider`) WHERE deleted_at is NULL; +-- create "user_history" table +CREATE TABLE `user_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `email` text NOT NULL, `first_name` text NULL, `last_name` text NULL, `display_name` text NOT NULL, `avatar_remote_url` text NULL, `avatar_local_file` text NULL, `avatar_updated_at` datetime NULL, `last_seen` datetime NULL, `password` text NULL, `sub` text NULL, `auth_provider` text NOT NULL DEFAULT ('CREDENTIALS'), `role` text NULL DEFAULT ('USER'), PRIMARY KEY (`id`)); +-- create index "userhistory_history_time" to table: "user_history" +CREATE INDEX `userhistory_history_time` ON `user_history` (`history_time`); +-- create "user_settings" table +CREATE TABLE `user_settings` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `locked` bool NOT NULL DEFAULT (false), `silenced_at` datetime NULL, `suspended_at` datetime NULL, `status` text NOT NULL DEFAULT ('ACTIVE'), `email_confirmed` bool NOT NULL DEFAULT (false), `is_webauthn_allowed` bool NULL DEFAULT (false), `is_tfa_enabled` bool NULL DEFAULT (false), `phone_number` text NULL, `user_id` text NULL, `user_setting_default_org` text NULL, PRIMARY KEY (`id`), CONSTRAINT `user_settings_users_setting` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL, CONSTRAINT `user_settings_organizations_default_org` FOREIGN KEY (`user_setting_default_org`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "user_settings_mapping_id_key" to table: "user_settings" +CREATE UNIQUE INDEX `user_settings_mapping_id_key` ON `user_settings` (`mapping_id`); +-- create index "user_settings_user_id_key" to table: "user_settings" +CREATE UNIQUE INDEX `user_settings_user_id_key` ON `user_settings` (`user_id`); +-- create "user_setting_history" table +CREATE TABLE `user_setting_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `user_id` text NULL, `locked` bool NOT NULL DEFAULT (false), `silenced_at` datetime NULL, `suspended_at` datetime NULL, `status` text NOT NULL DEFAULT ('ACTIVE'), `email_confirmed` bool NOT NULL DEFAULT (false), `is_webauthn_allowed` bool NULL DEFAULT (false), `is_tfa_enabled` bool NULL DEFAULT (false), `phone_number` text NULL, PRIMARY KEY (`id`)); +-- create index "usersettinghistory_history_time" to table: "user_setting_history" +CREATE INDEX `usersettinghistory_history_time` ON `user_setting_history` (`history_time`); +-- create "webauthns" table +CREATE TABLE `webauthns` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `credential_id` blob NULL, `public_key` blob NULL, `attestation_type` text NULL, `aaguid` blob NOT NULL, `sign_count` integer NOT NULL, `transports` json NOT NULL, `backup_eligible` bool NOT NULL DEFAULT (false), `backup_state` bool NOT NULL DEFAULT (false), `user_present` bool NOT NULL DEFAULT (false), `user_verified` bool NOT NULL DEFAULT (false), `owner_id` text NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `webauthns_users_webauthn` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION); +-- create index "webauthns_mapping_id_key" to table: "webauthns" +CREATE UNIQUE INDEX `webauthns_mapping_id_key` ON `webauthns` (`mapping_id`); +-- create index "webauthns_credential_id_key" to table: "webauthns" +CREATE UNIQUE INDEX `webauthns_credential_id_key` ON `webauthns` (`credential_id`); +-- create index "webauthns_aaguid_key" to table: "webauthns" +CREATE UNIQUE INDEX `webauthns_aaguid_key` ON `webauthns` (`aaguid`); +-- create "webhooks" table +CREATE TABLE `webhooks` (`id` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `name` text NOT NULL, `description` text NULL, `destination_url` text NOT NULL, `enabled` bool NOT NULL DEFAULT (true), `callback` text NULL, `expires_at` datetime NULL, `secret` blob NULL, `failures` integer NULL DEFAULT (0), `last_error` text NULL, `last_response` text NULL, `owner_id` text NULL, PRIMARY KEY (`id`), CONSTRAINT `webhooks_organizations_webhooks` FOREIGN KEY (`owner_id`) REFERENCES `organizations` (`id`) ON DELETE SET NULL); +-- create index "webhooks_mapping_id_key" to table: "webhooks" +CREATE UNIQUE INDEX `webhooks_mapping_id_key` ON `webhooks` (`mapping_id`); +-- create index "webhooks_callback_key" to table: "webhooks" +CREATE UNIQUE INDEX `webhooks_callback_key` ON `webhooks` (`callback`); +-- create index "webhook_name_owner_id" to table: "webhooks" +CREATE UNIQUE INDEX `webhook_name_owner_id` ON `webhooks` (`name`, `owner_id`) WHERE deleted_at is NULL; +-- create "webhook_history" table +CREATE TABLE `webhook_history` (`id` text NOT NULL, `history_time` datetime NOT NULL, `ref` text NULL, `operation` text NOT NULL, `created_at` datetime NULL, `updated_at` datetime NULL, `created_by` text NULL, `updated_by` text NULL, `mapping_id` text NOT NULL, `tags` json NULL, `deleted_at` datetime NULL, `deleted_by` text NULL, `owner_id` text NULL, `name` text NOT NULL, `description` text NULL, `destination_url` text NOT NULL, `enabled` bool NOT NULL DEFAULT (true), `callback` text NULL, `expires_at` datetime NULL, `secret` blob NULL, `failures` integer NULL DEFAULT (0), `last_error` text NULL, `last_response` text NULL, PRIMARY KEY (`id`)); +-- create index "webhookhistory_history_time" to table: "webhook_history" +CREATE INDEX `webhookhistory_history_time` ON `webhook_history` (`history_time`); +-- create "entitlement_events" table +CREATE TABLE `entitlement_events` (`entitlement_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`entitlement_id`, `event_id`), CONSTRAINT `entitlement_events_entitlement_id` FOREIGN KEY (`entitlement_id`) REFERENCES `entitlements` (`id`) ON DELETE CASCADE, CONSTRAINT `entitlement_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "entitlement_plan_events" table +CREATE TABLE `entitlement_plan_events` (`entitlement_plan_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`entitlement_plan_id`, `event_id`), CONSTRAINT `entitlement_plan_events_entitlement_plan_id` FOREIGN KEY (`entitlement_plan_id`) REFERENCES `entitlement_plans` (`id`) ON DELETE CASCADE, CONSTRAINT `entitlement_plan_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "entitlement_plan_feature_events" table +CREATE TABLE `entitlement_plan_feature_events` (`entitlement_plan_feature_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`entitlement_plan_feature_id`, `event_id`), CONSTRAINT `entitlement_plan_feature_events_entitlement_plan_feature_id` FOREIGN KEY (`entitlement_plan_feature_id`) REFERENCES `entitlement_plan_features` (`id`) ON DELETE CASCADE, CONSTRAINT `entitlement_plan_feature_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "entity_contacts" table +CREATE TABLE `entity_contacts` (`entity_id` text NOT NULL, `contact_id` text NOT NULL, PRIMARY KEY (`entity_id`, `contact_id`), CONSTRAINT `entity_contacts_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `entities` (`id`) ON DELETE CASCADE, CONSTRAINT `entity_contacts_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE); +-- create "entity_documents" table +CREATE TABLE `entity_documents` (`entity_id` text NOT NULL, `document_data_id` text NOT NULL, PRIMARY KEY (`entity_id`, `document_data_id`), CONSTRAINT `entity_documents_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `entities` (`id`) ON DELETE CASCADE, CONSTRAINT `entity_documents_document_data_id` FOREIGN KEY (`document_data_id`) REFERENCES `document_data` (`id`) ON DELETE CASCADE); +-- create "entity_files" table +CREATE TABLE `entity_files` (`entity_id` text NOT NULL, `file_id` text NOT NULL, PRIMARY KEY (`entity_id`, `file_id`), CONSTRAINT `entity_files_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `entities` (`id`) ON DELETE CASCADE, CONSTRAINT `entity_files_file_id` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE); +-- create "feature_events" table +CREATE TABLE `feature_events` (`feature_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`feature_id`, `event_id`), CONSTRAINT `feature_events_feature_id` FOREIGN KEY (`feature_id`) REFERENCES `features` (`id`) ON DELETE CASCADE, CONSTRAINT `feature_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "group_events" table +CREATE TABLE `group_events` (`group_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`group_id`, `event_id`), CONSTRAINT `group_events_group_id` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE, CONSTRAINT `group_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "group_files" table +CREATE TABLE `group_files` (`group_id` text NOT NULL, `file_id` text NOT NULL, PRIMARY KEY (`group_id`, `file_id`), CONSTRAINT `group_files_group_id` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE, CONSTRAINT `group_files_file_id` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE); +-- create "group_membership_events" table +CREATE TABLE `group_membership_events` (`group_membership_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`group_membership_id`, `event_id`), CONSTRAINT `group_membership_events_group_membership_id` FOREIGN KEY (`group_membership_id`) REFERENCES `group_memberships` (`id`) ON DELETE CASCADE, CONSTRAINT `group_membership_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "hush_events" table +CREATE TABLE `hush_events` (`hush_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`hush_id`, `event_id`), CONSTRAINT `hush_events_hush_id` FOREIGN KEY (`hush_id`) REFERENCES `hushes` (`id`) ON DELETE CASCADE, CONSTRAINT `hush_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "integration_secrets" table +CREATE TABLE `integration_secrets` (`integration_id` text NOT NULL, `hush_id` text NOT NULL, PRIMARY KEY (`integration_id`, `hush_id`), CONSTRAINT `integration_secrets_integration_id` FOREIGN KEY (`integration_id`) REFERENCES `integrations` (`id`) ON DELETE CASCADE, CONSTRAINT `integration_secrets_hush_id` FOREIGN KEY (`hush_id`) REFERENCES `hushes` (`id`) ON DELETE CASCADE); +-- create "integration_oauth2tokens" table +CREATE TABLE `integration_oauth2tokens` (`integration_id` text NOT NULL, `oh_auth_too_token_id` text NOT NULL, PRIMARY KEY (`integration_id`, `oh_auth_too_token_id`), CONSTRAINT `integration_oauth2tokens_integration_id` FOREIGN KEY (`integration_id`) REFERENCES `integrations` (`id`) ON DELETE CASCADE, CONSTRAINT `integration_oauth2tokens_oh_auth_too_token_id` FOREIGN KEY (`oh_auth_too_token_id`) REFERENCES `oh_auth_too_tokens` (`id`) ON DELETE CASCADE); +-- create "integration_events" table +CREATE TABLE `integration_events` (`integration_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`integration_id`, `event_id`), CONSTRAINT `integration_events_integration_id` FOREIGN KEY (`integration_id`) REFERENCES `integrations` (`id`) ON DELETE CASCADE, CONSTRAINT `integration_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "integration_webhooks" table +CREATE TABLE `integration_webhooks` (`integration_id` text NOT NULL, `webhook_id` text NOT NULL, PRIMARY KEY (`integration_id`, `webhook_id`), CONSTRAINT `integration_webhooks_integration_id` FOREIGN KEY (`integration_id`) REFERENCES `integrations` (`id`) ON DELETE CASCADE, CONSTRAINT `integration_webhooks_webhook_id` FOREIGN KEY (`webhook_id`) REFERENCES `webhooks` (`id`) ON DELETE CASCADE); +-- create "invite_events" table +CREATE TABLE `invite_events` (`invite_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`invite_id`, `event_id`), CONSTRAINT `invite_events_invite_id` FOREIGN KEY (`invite_id`) REFERENCES `invites` (`id`) ON DELETE CASCADE, CONSTRAINT `invite_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "oh_auth_too_token_events" table +CREATE TABLE `oh_auth_too_token_events` (`oh_auth_too_token_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`oh_auth_too_token_id`, `event_id`), CONSTRAINT `oh_auth_too_token_events_oh_auth_too_token_id` FOREIGN KEY (`oh_auth_too_token_id`) REFERENCES `oh_auth_too_tokens` (`id`) ON DELETE CASCADE, CONSTRAINT `oh_auth_too_token_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "org_membership_events" table +CREATE TABLE `org_membership_events` (`org_membership_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`org_membership_id`, `event_id`), CONSTRAINT `org_membership_events_org_membership_id` FOREIGN KEY (`org_membership_id`) REFERENCES `org_memberships` (`id`) ON DELETE CASCADE, CONSTRAINT `org_membership_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "organization_personal_access_tokens" table +CREATE TABLE `organization_personal_access_tokens` (`organization_id` text NOT NULL, `personal_access_token_id` text NOT NULL, PRIMARY KEY (`organization_id`, `personal_access_token_id`), CONSTRAINT `organization_personal_access_tokens_organization_id` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE, CONSTRAINT `organization_personal_access_tokens_personal_access_token_id` FOREIGN KEY (`personal_access_token_id`) REFERENCES `personal_access_tokens` (`id`) ON DELETE CASCADE); +-- create "organization_events" table +CREATE TABLE `organization_events` (`organization_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`organization_id`, `event_id`), CONSTRAINT `organization_events_organization_id` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE, CONSTRAINT `organization_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "organization_secrets" table +CREATE TABLE `organization_secrets` (`organization_id` text NOT NULL, `hush_id` text NOT NULL, PRIMARY KEY (`organization_id`, `hush_id`), CONSTRAINT `organization_secrets_organization_id` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE, CONSTRAINT `organization_secrets_hush_id` FOREIGN KEY (`hush_id`) REFERENCES `hushes` (`id`) ON DELETE CASCADE); +-- create "organization_files" table +CREATE TABLE `organization_files` (`organization_id` text NOT NULL, `file_id` text NOT NULL, PRIMARY KEY (`organization_id`, `file_id`), CONSTRAINT `organization_files_organization_id` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE, CONSTRAINT `organization_files_file_id` FOREIGN KEY (`file_id`) REFERENCES `files` (`id`) ON DELETE CASCADE); +-- create "personal_access_token_events" table +CREATE TABLE `personal_access_token_events` (`personal_access_token_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`personal_access_token_id`, `event_id`), CONSTRAINT `personal_access_token_events_personal_access_token_id` FOREIGN KEY (`personal_access_token_id`) REFERENCES `personal_access_tokens` (`id`) ON DELETE CASCADE, CONSTRAINT `personal_access_token_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "subscriber_events" table +CREATE TABLE `subscriber_events` (`subscriber_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`subscriber_id`, `event_id`), CONSTRAINT `subscriber_events_subscriber_id` FOREIGN KEY (`subscriber_id`) REFERENCES `subscribers` (`id`) ON DELETE CASCADE, CONSTRAINT `subscriber_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "user_events" table +CREATE TABLE `user_events` (`user_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`user_id`, `event_id`), CONSTRAINT `user_events_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `user_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); +-- create "webhook_events" table +CREATE TABLE `webhook_events` (`webhook_id` text NOT NULL, `event_id` text NOT NULL, PRIMARY KEY (`webhook_id`, `event_id`), CONSTRAINT `webhook_events_webhook_id` FOREIGN KEY (`webhook_id`) REFERENCES `webhooks` (`id`) ON DELETE CASCADE, CONSTRAINT `webhook_events_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE); + +-- +goose Down +-- reverse: create "webhook_events" table +DROP TABLE `webhook_events`; +-- reverse: create "user_events" table +DROP TABLE `user_events`; +-- reverse: create "subscriber_events" table +DROP TABLE `subscriber_events`; +-- reverse: create "personal_access_token_events" table +DROP TABLE `personal_access_token_events`; +-- reverse: create "organization_files" table +DROP TABLE `organization_files`; +-- reverse: create "organization_secrets" table +DROP TABLE `organization_secrets`; +-- reverse: create "organization_events" table +DROP TABLE `organization_events`; +-- reverse: create "organization_personal_access_tokens" table +DROP TABLE `organization_personal_access_tokens`; +-- reverse: create "org_membership_events" table +DROP TABLE `org_membership_events`; +-- reverse: create "oh_auth_too_token_events" table +DROP TABLE `oh_auth_too_token_events`; +-- reverse: create "invite_events" table +DROP TABLE `invite_events`; +-- reverse: create "integration_webhooks" table +DROP TABLE `integration_webhooks`; +-- reverse: create "integration_events" table +DROP TABLE `integration_events`; +-- reverse: create "integration_oauth2tokens" table +DROP TABLE `integration_oauth2tokens`; +-- reverse: create "integration_secrets" table +DROP TABLE `integration_secrets`; +-- reverse: create "hush_events" table +DROP TABLE `hush_events`; +-- reverse: create "group_membership_events" table +DROP TABLE `group_membership_events`; +-- reverse: create "group_files" table +DROP TABLE `group_files`; +-- reverse: create "group_events" table +DROP TABLE `group_events`; +-- reverse: create "feature_events" table +DROP TABLE `feature_events`; +-- reverse: create "entity_files" table +DROP TABLE `entity_files`; +-- reverse: create "entity_documents" table +DROP TABLE `entity_documents`; +-- reverse: create "entity_contacts" table +DROP TABLE `entity_contacts`; +-- reverse: create "entitlement_plan_feature_events" table +DROP TABLE `entitlement_plan_feature_events`; +-- reverse: create "entitlement_plan_events" table +DROP TABLE `entitlement_plan_events`; +-- reverse: create "entitlement_events" table +DROP TABLE `entitlement_events`; +-- reverse: create index "webhookhistory_history_time" to table: "webhook_history" +DROP INDEX `webhookhistory_history_time`; +-- reverse: create "webhook_history" table +DROP TABLE `webhook_history`; +-- reverse: create index "webhook_name_owner_id" to table: "webhooks" +DROP INDEX `webhook_name_owner_id`; +-- reverse: create index "webhooks_callback_key" to table: "webhooks" +DROP INDEX `webhooks_callback_key`; +-- reverse: create index "webhooks_mapping_id_key" to table: "webhooks" +DROP INDEX `webhooks_mapping_id_key`; +-- reverse: create "webhooks" table +DROP TABLE `webhooks`; +-- reverse: create index "webauthns_aaguid_key" to table: "webauthns" +DROP INDEX `webauthns_aaguid_key`; +-- reverse: create index "webauthns_credential_id_key" to table: "webauthns" +DROP INDEX `webauthns_credential_id_key`; +-- reverse: create index "webauthns_mapping_id_key" to table: "webauthns" +DROP INDEX `webauthns_mapping_id_key`; +-- reverse: create "webauthns" table +DROP TABLE `webauthns`; +-- reverse: create index "usersettinghistory_history_time" to table: "user_setting_history" +DROP INDEX `usersettinghistory_history_time`; +-- reverse: create "user_setting_history" table +DROP TABLE `user_setting_history`; +-- reverse: create index "user_settings_user_id_key" to table: "user_settings" +DROP INDEX `user_settings_user_id_key`; +-- reverse: create index "user_settings_mapping_id_key" to table: "user_settings" +DROP INDEX `user_settings_mapping_id_key`; +-- reverse: create "user_settings" table +DROP TABLE `user_settings`; +-- reverse: create index "userhistory_history_time" to table: "user_history" +DROP INDEX `userhistory_history_time`; +-- reverse: create "user_history" table +DROP TABLE `user_history`; +-- reverse: create index "user_email_auth_provider" to table: "users" +DROP INDEX `user_email_auth_provider`; +-- reverse: create index "user_id" to table: "users" +DROP INDEX `user_id`; +-- reverse: create index "users_sub_key" to table: "users" +DROP INDEX `users_sub_key`; +-- reverse: create index "users_mapping_id_key" to table: "users" +DROP INDEX `users_mapping_id_key`; +-- reverse: create "users" table +DROP TABLE `users`; +-- reverse: create index "templatehistory_history_time" to table: "template_history" +DROP INDEX `templatehistory_history_time`; +-- reverse: create "template_history" table +DROP TABLE `template_history`; +-- reverse: create index "template_name_owner_id_template_type" to table: "templates" +DROP INDEX `template_name_owner_id_template_type`; +-- reverse: create index "templates_mapping_id_key" to table: "templates" +DROP INDEX `templates_mapping_id_key`; +-- reverse: create "templates" table +DROP TABLE `templates`; +-- reverse: create index "tfasetting_owner_id" to table: "tfa_settings" +DROP INDEX `tfasetting_owner_id`; +-- reverse: create index "tfa_settings_mapping_id_key" to table: "tfa_settings" +DROP INDEX `tfa_settings_mapping_id_key`; +-- reverse: create "tfa_settings" table +DROP TABLE `tfa_settings`; +-- reverse: create index "subscriber_email_owner_id" to table: "subscribers" +DROP INDEX `subscriber_email_owner_id`; +-- reverse: create index "subscribers_token_key" to table: "subscribers" +DROP INDEX `subscribers_token_key`; +-- reverse: create index "subscribers_mapping_id_key" to table: "subscribers" +DROP INDEX `subscribers_mapping_id_key`; +-- reverse: create "subscribers" table +DROP TABLE `subscribers`; +-- reverse: create index "personalaccesstoken_token" to table: "personal_access_tokens" +DROP INDEX `personalaccesstoken_token`; +-- reverse: create index "personal_access_tokens_token_key" to table: "personal_access_tokens" +DROP INDEX `personal_access_tokens_token_key`; +-- reverse: create index "personal_access_tokens_mapping_id_key" to table: "personal_access_tokens" +DROP INDEX `personal_access_tokens_mapping_id_key`; +-- reverse: create "personal_access_tokens" table +DROP TABLE `personal_access_tokens`; +-- reverse: create index "passwordresettoken_token" to table: "password_reset_tokens" +DROP INDEX `passwordresettoken_token`; +-- reverse: create index "password_reset_tokens_token_key" to table: "password_reset_tokens" +DROP INDEX `password_reset_tokens_token_key`; +-- reverse: create index "password_reset_tokens_mapping_id_key" to table: "password_reset_tokens" +DROP INDEX `password_reset_tokens_mapping_id_key`; +-- reverse: create "password_reset_tokens" table +DROP TABLE `password_reset_tokens`; +-- reverse: create index "organizationsettinghistory_history_time" to table: "organization_setting_history" +DROP INDEX `organizationsettinghistory_history_time`; +-- reverse: create "organization_setting_history" table +DROP TABLE `organization_setting_history`; +-- reverse: create index "organization_settings_organization_id_key" to table: "organization_settings" +DROP INDEX `organization_settings_organization_id_key`; +-- reverse: create index "organization_settings_mapping_id_key" to table: "organization_settings" +DROP INDEX `organization_settings_mapping_id_key`; +-- reverse: create "organization_settings" table +DROP TABLE `organization_settings`; +-- reverse: create index "organizationhistory_history_time" to table: "organization_history" +DROP INDEX `organizationhistory_history_time`; +-- reverse: create "organization_history" table +DROP TABLE `organization_history`; +-- reverse: create index "organization_name" to table: "organizations" +DROP INDEX `organization_name`; +-- reverse: create index "organizations_mapping_id_key" to table: "organizations" +DROP INDEX `organizations_mapping_id_key`; +-- reverse: create "organizations" table +DROP TABLE `organizations`; +-- reverse: create index "orgmembershiphistory_history_time" to table: "org_membership_history" +DROP INDEX `orgmembershiphistory_history_time`; +-- reverse: create "org_membership_history" table +DROP TABLE `org_membership_history`; +-- reverse: create index "orgmembership_user_id_organization_id" to table: "org_memberships" +DROP INDEX `orgmembership_user_id_organization_id`; +-- reverse: create index "org_memberships_mapping_id_key" to table: "org_memberships" +DROP INDEX `org_memberships_mapping_id_key`; +-- reverse: create "org_memberships" table +DROP TABLE `org_memberships`; +-- reverse: create index "oh_auth_too_tokens_mapping_id_key" to table: "oh_auth_too_tokens" +DROP INDEX `oh_auth_too_tokens_mapping_id_key`; +-- reverse: create "oh_auth_too_tokens" table +DROP TABLE `oh_auth_too_tokens`; +-- reverse: create index "oauthproviderhistory_history_time" to table: "oauth_provider_history" +DROP INDEX `oauthproviderhistory_history_time`; +-- reverse: create "oauth_provider_history" table +DROP TABLE `oauth_provider_history`; +-- reverse: create index "oauth_providers_mapping_id_key" to table: "oauth_providers" +DROP INDEX `oauth_providers_mapping_id_key`; +-- reverse: create "oauth_providers" table +DROP TABLE `oauth_providers`; +-- reverse: create index "notehistory_history_time" to table: "note_history" +DROP INDEX `notehistory_history_time`; +-- reverse: create "note_history" table +DROP TABLE `note_history`; +-- reverse: create index "notes_mapping_id_key" to table: "notes" +DROP INDEX `notes_mapping_id_key`; +-- reverse: create "notes" table +DROP TABLE `notes`; +-- reverse: create index "invite_recipient_owner_id" to table: "invites" +DROP INDEX `invite_recipient_owner_id`; +-- reverse: create index "invites_token_key" to table: "invites" +DROP INDEX `invites_token_key`; +-- reverse: create index "invites_mapping_id_key" to table: "invites" +DROP INDEX `invites_mapping_id_key`; +-- reverse: create "invites" table +DROP TABLE `invites`; +-- reverse: create index "integrationhistory_history_time" to table: "integration_history" +DROP INDEX `integrationhistory_history_time`; +-- reverse: create "integration_history" table +DROP TABLE `integration_history`; +-- reverse: create index "integrations_mapping_id_key" to table: "integrations" +DROP INDEX `integrations_mapping_id_key`; +-- reverse: create "integrations" table +DROP TABLE `integrations`; +-- reverse: create index "hushhistory_history_time" to table: "hush_history" +DROP INDEX `hushhistory_history_time`; +-- reverse: create "hush_history" table +DROP TABLE `hush_history`; +-- reverse: create index "hushes_mapping_id_key" to table: "hushes" +DROP INDEX `hushes_mapping_id_key`; +-- reverse: create "hushes" table +DROP TABLE `hushes`; +-- reverse: create index "groupsettinghistory_history_time" to table: "group_setting_history" +DROP INDEX `groupsettinghistory_history_time`; +-- reverse: create "group_setting_history" table +DROP TABLE `group_setting_history`; +-- reverse: create index "group_settings_group_id_key" to table: "group_settings" +DROP INDEX `group_settings_group_id_key`; +-- reverse: create index "group_settings_mapping_id_key" to table: "group_settings" +DROP INDEX `group_settings_mapping_id_key`; +-- reverse: create "group_settings" table +DROP TABLE `group_settings`; +-- reverse: create index "groupmembershiphistory_history_time" to table: "group_membership_history" +DROP INDEX `groupmembershiphistory_history_time`; +-- reverse: create "group_membership_history" table +DROP TABLE `group_membership_history`; +-- reverse: create index "groupmembership_user_id_group_id" to table: "group_memberships" +DROP INDEX `groupmembership_user_id_group_id`; +-- reverse: create index "group_memberships_mapping_id_key" to table: "group_memberships" +DROP INDEX `group_memberships_mapping_id_key`; +-- reverse: create "group_memberships" table +DROP TABLE `group_memberships`; +-- reverse: create index "grouphistory_history_time" to table: "group_history" +DROP INDEX `grouphistory_history_time`; +-- reverse: create "group_history" table +DROP TABLE `group_history`; +-- reverse: create index "group_name_owner_id" to table: "groups" +DROP INDEX `group_name_owner_id`; +-- reverse: create index "groups_mapping_id_key" to table: "groups" +DROP INDEX `groups_mapping_id_key`; +-- reverse: create "groups" table +DROP TABLE `groups`; +-- reverse: create index "filehistory_history_time" to table: "file_history" +DROP INDEX `filehistory_history_time`; +-- reverse: create "file_history" table +DROP TABLE `file_history`; +-- reverse: create index "files_mapping_id_key" to table: "files" +DROP INDEX `files_mapping_id_key`; +-- reverse: create "files" table +DROP TABLE `files`; +-- reverse: create index "featurehistory_history_time" to table: "feature_history" +DROP INDEX `featurehistory_history_time`; +-- reverse: create "feature_history" table +DROP TABLE `feature_history`; +-- reverse: create index "feature_name_owner_id" to table: "features" +DROP INDEX `feature_name_owner_id`; +-- reverse: create index "features_mapping_id_key" to table: "features" +DROP INDEX `features_mapping_id_key`; +-- reverse: create "features" table +DROP TABLE `features`; +-- reverse: create index "eventhistory_history_time" to table: "event_history" +DROP INDEX `eventhistory_history_time`; +-- reverse: create "event_history" table +DROP TABLE `event_history`; +-- reverse: create index "events_mapping_id_key" to table: "events" +DROP INDEX `events_mapping_id_key`; +-- reverse: create "events" table +DROP TABLE `events`; +-- reverse: create index "entitytypehistory_history_time" to table: "entity_type_history" +DROP INDEX `entitytypehistory_history_time`; +-- reverse: create "entity_type_history" table +DROP TABLE `entity_type_history`; +-- reverse: create index "entitytype_name_owner_id" to table: "entity_types" +DROP INDEX `entitytype_name_owner_id`; +-- reverse: create index "entity_types_mapping_id_key" to table: "entity_types" +DROP INDEX `entity_types_mapping_id_key`; +-- reverse: create "entity_types" table +DROP TABLE `entity_types`; +-- reverse: create index "entityhistory_history_time" to table: "entity_history" +DROP INDEX `entityhistory_history_time`; +-- reverse: create "entity_history" table +DROP TABLE `entity_history`; +-- reverse: create index "entity_name_owner_id" to table: "entities" +DROP INDEX `entity_name_owner_id`; +-- reverse: create index "entities_mapping_id_key" to table: "entities" +DROP INDEX `entities_mapping_id_key`; +-- reverse: create "entities" table +DROP TABLE `entities`; +-- reverse: create index "entitlementplanhistory_history_time" to table: "entitlement_plan_history" +DROP INDEX `entitlementplanhistory_history_time`; +-- reverse: create "entitlement_plan_history" table +DROP TABLE `entitlement_plan_history`; +-- reverse: create index "entitlementplanfeaturehistory_history_time" to table: "entitlement_plan_feature_history" +DROP INDEX `entitlementplanfeaturehistory_history_time`; +-- reverse: create "entitlement_plan_feature_history" table +DROP TABLE `entitlement_plan_feature_history`; +-- reverse: create index "entitlementplanfeature_feature_id_plan_id" to table: "entitlement_plan_features" +DROP INDEX `entitlementplanfeature_feature_id_plan_id`; +-- reverse: create index "entitlement_plan_features_mapping_id_key" to table: "entitlement_plan_features" +DROP INDEX `entitlement_plan_features_mapping_id_key`; +-- reverse: create "entitlement_plan_features" table +DROP TABLE `entitlement_plan_features`; +-- reverse: create index "entitlementplan_name_version_owner_id" to table: "entitlement_plans" +DROP INDEX `entitlementplan_name_version_owner_id`; +-- reverse: create index "entitlement_plans_mapping_id_key" to table: "entitlement_plans" +DROP INDEX `entitlement_plans_mapping_id_key`; +-- reverse: create "entitlement_plans" table +DROP TABLE `entitlement_plans`; +-- reverse: create index "entitlementhistory_history_time" to table: "entitlement_history" +DROP INDEX `entitlementhistory_history_time`; +-- reverse: create "entitlement_history" table +DROP TABLE `entitlement_history`; +-- reverse: create index "entitlement_organization_id_owner_id" to table: "entitlements" +DROP INDEX `entitlement_organization_id_owner_id`; +-- reverse: create index "entitlements_mapping_id_key" to table: "entitlements" +DROP INDEX `entitlements_mapping_id_key`; +-- reverse: create "entitlements" table +DROP TABLE `entitlements`; +-- reverse: create index "emailverificationtoken_token" to table: "email_verification_tokens" +DROP INDEX `emailverificationtoken_token`; +-- reverse: create index "email_verification_tokens_token_key" to table: "email_verification_tokens" +DROP INDEX `email_verification_tokens_token_key`; +-- reverse: create index "email_verification_tokens_mapping_id_key" to table: "email_verification_tokens" +DROP INDEX `email_verification_tokens_mapping_id_key`; +-- reverse: create "email_verification_tokens" table +DROP TABLE `email_verification_tokens`; +-- reverse: create index "documentdatahistory_history_time" to table: "document_data_history" +DROP INDEX `documentdatahistory_history_time`; +-- reverse: create "document_data_history" table +DROP TABLE `document_data_history`; +-- reverse: create index "document_data_mapping_id_key" to table: "document_data" +DROP INDEX `document_data_mapping_id_key`; +-- reverse: create "document_data" table +DROP TABLE `document_data`; +-- reverse: create index "contacthistory_history_time" to table: "contact_history" +DROP INDEX `contacthistory_history_time`; +-- reverse: create "contact_history" table +DROP TABLE `contact_history`; +-- reverse: create index "contacts_mapping_id_key" to table: "contacts" +DROP INDEX `contacts_mapping_id_key`; +-- reverse: create "contacts" table +DROP TABLE `contacts`; +-- reverse: create index "apitoken_token" to table: "api_tokens" +DROP INDEX `apitoken_token`; +-- reverse: create index "api_tokens_token_key" to table: "api_tokens" +DROP INDEX `api_tokens_token_key`; +-- reverse: create index "api_tokens_mapping_id_key" to table: "api_tokens" +DROP INDEX `api_tokens_mapping_id_key`; +-- reverse: create "api_tokens" table +DROP TABLE `api_tokens`; diff --git a/db/migrations-goose-sqlite/atlas.sum b/db/migrations-goose-sqlite/atlas.sum new file mode 100644 index 0000000..06c7f80 --- /dev/null +++ b/db/migrations-goose-sqlite/atlas.sum @@ -0,0 +1,2 @@ +h1:2N+OIUhEwG+FF/k5i45jTqBuEENp30gooqj/sCk0ROg= +20240827061437_init.sql h1:IjvD51yo1lEovvjTAD+lHZICafaykoX5ZWKIpUGg0gM= diff --git a/db/migrations/20240827061437_init.sql b/db/migrations/20240827061437_init.sql new file mode 100644 index 0000000..d8d49de --- /dev/null +++ b/db/migrations/20240827061437_init.sql @@ -0,0 +1,348 @@ +-- Create "organizations" table +CREATE TABLE "organizations" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "display_name" character varying NOT NULL DEFAULT '', "description" character varying NULL, "personal_org" boolean NULL DEFAULT false, "avatar_remote_url" character varying NULL, "dedicated_db" boolean NOT NULL DEFAULT false, "parent_organization_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "organizations_organizations_children" FOREIGN KEY ("parent_organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "organization_name" to table: "organizations" +CREATE UNIQUE INDEX "organization_name" ON "organizations" ("name") WHERE (deleted_at IS NULL); +-- Create index "organizations_mapping_id_key" to table: "organizations" +CREATE UNIQUE INDEX "organizations_mapping_id_key" ON "organizations" ("mapping_id"); +-- Create "file_history" table +CREATE TABLE "file_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "file_name" character varying NOT NULL, "file_extension" character varying NOT NULL, "file_size" bigint NULL, "content_type" character varying NOT NULL, "store_key" character varying NOT NULL, "category" character varying NULL, "annotation" character varying NULL, PRIMARY KEY ("id")); +-- Create index "filehistory_history_time" to table: "file_history" +CREATE INDEX "filehistory_history_time" ON "file_history" ("history_time"); +-- Create "contact_history" table +CREATE TABLE "contact_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "full_name" character varying NOT NULL, "title" character varying NULL, "company" character varying NULL, "email" character varying NULL, "phone_number" character varying NULL, "address" character varying NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', PRIMARY KEY ("id")); +-- Create index "contacthistory_history_time" to table: "contact_history" +CREATE INDEX "contacthistory_history_time" ON "contact_history" ("history_time"); +-- Create "organization_setting_history" table +CREATE TABLE "organization_setting_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "domains" jsonb NULL, "billing_contact" character varying NULL, "billing_email" character varying NULL, "billing_phone" character varying NULL, "billing_address" character varying NULL, "tax_identifier" character varying NULL, "geo_location" character varying NULL DEFAULT 'AMER', "organization_id" character varying NULL, PRIMARY KEY ("id")); +-- Create index "organizationsettinghistory_history_time" to table: "organization_setting_history" +CREATE INDEX "organizationsettinghistory_history_time" ON "organization_setting_history" ("history_time"); +-- Create "document_data_history" table +CREATE TABLE "document_data_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "template_id" character varying NOT NULL, "data" jsonb NOT NULL, PRIMARY KEY ("id")); +-- Create index "documentdatahistory_history_time" to table: "document_data_history" +CREATE INDEX "documentdatahistory_history_time" ON "document_data_history" ("history_time"); +-- Create "webhook_history" table +CREATE TABLE "webhook_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "destination_url" character varying NOT NULL, "enabled" boolean NOT NULL DEFAULT true, "callback" character varying NULL, "expires_at" timestamptz NULL, "secret" bytea NULL, "failures" bigint NULL DEFAULT 0, "last_error" character varying NULL, "last_response" character varying NULL, PRIMARY KEY ("id")); +-- Create index "webhookhistory_history_time" to table: "webhook_history" +CREATE INDEX "webhookhistory_history_time" ON "webhook_history" ("history_time"); +-- Create "org_membership_history" table +CREATE TABLE "org_membership_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "organization_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id")); +-- Create index "orgmembershiphistory_history_time" to table: "org_membership_history" +CREATE INDEX "orgmembershiphistory_history_time" ON "org_membership_history" ("history_time"); +-- Create "entitlement_history" table +CREATE TABLE "entitlement_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "plan_id" character varying NOT NULL, "organization_id" character varying NOT NULL, "external_customer_id" character varying NULL, "external_subscription_id" character varying NULL, "expires" boolean NOT NULL DEFAULT false, "expires_at" timestamptz NULL, "cancelled" boolean NOT NULL DEFAULT false, PRIMARY KEY ("id")); +-- Create index "entitlementhistory_history_time" to table: "entitlement_history" +CREATE INDEX "entitlementhistory_history_time" ON "entitlement_history" ("history_time"); +-- Create "template_history" table +CREATE TABLE "template_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "template_type" character varying NOT NULL DEFAULT 'DOCUMENT', "description" character varying NULL, "jsonconfig" jsonb NOT NULL, "uischema" jsonb NULL, PRIMARY KEY ("id")); +-- Create index "templatehistory_history_time" to table: "template_history" +CREATE INDEX "templatehistory_history_time" ON "template_history" ("history_time"); +-- Create "oauth_provider_history" table +CREATE TABLE "oauth_provider_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "client_id" character varying NOT NULL, "client_secret" character varying NOT NULL, "redirect_url" character varying NOT NULL, "scopes" character varying NOT NULL, "auth_url" character varying NOT NULL, "token_url" character varying NOT NULL, "auth_style" smallint NOT NULL, "info_url" character varying NOT NULL, PRIMARY KEY ("id")); +-- Create index "oauthproviderhistory_history_time" to table: "oauth_provider_history" +CREATE INDEX "oauthproviderhistory_history_time" ON "oauth_provider_history" ("history_time"); +-- Create "entitlement_plan_feature_history" table +CREATE TABLE "entitlement_plan_feature_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "metadata" jsonb NULL, "plan_id" character varying NOT NULL, "feature_id" character varying NOT NULL, PRIMARY KEY ("id")); +-- Create index "entitlementplanfeaturehistory_history_time" to table: "entitlement_plan_feature_history" +CREATE INDEX "entitlementplanfeaturehistory_history_time" ON "entitlement_plan_feature_history" ("history_time"); +-- Create "entitlement_plan_history" table +CREATE TABLE "entitlement_plan_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "display_name" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "version" character varying NOT NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- Create index "entitlementplanhistory_history_time" to table: "entitlement_plan_history" +CREATE INDEX "entitlementplanhistory_history_time" ON "entitlement_plan_history" ("history_time"); +-- Create "note_history" table +CREATE TABLE "note_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "text" character varying NOT NULL, PRIMARY KEY ("id")); +-- Create index "notehistory_history_time" to table: "note_history" +CREATE INDEX "notehistory_history_time" ON "note_history" ("history_time"); +-- Create "entity_history" table +CREATE TABLE "entity_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NULL, "display_name" character varying NULL, "description" character varying NULL, "domains" jsonb NULL, "entity_type_id" character varying NULL, "status" character varying NULL DEFAULT 'active', PRIMARY KEY ("id")); +-- Create index "entityhistory_history_time" to table: "entity_history" +CREATE INDEX "entityhistory_history_time" ON "entity_history" ("history_time"); +-- Create "user_history" table +CREATE TABLE "user_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "email" character varying NOT NULL, "first_name" character varying NULL, "last_name" character varying NULL, "display_name" character varying NOT NULL, "avatar_remote_url" character varying NULL, "avatar_local_file" character varying NULL, "avatar_updated_at" timestamptz NULL, "last_seen" timestamptz NULL, "password" character varying NULL, "sub" character varying NULL, "auth_provider" character varying NOT NULL DEFAULT 'CREDENTIALS', "role" character varying NULL DEFAULT 'USER', PRIMARY KEY ("id")); +-- Create index "userhistory_history_time" to table: "user_history" +CREATE INDEX "userhistory_history_time" ON "user_history" ("history_time"); +-- Create "entity_type_history" table +CREATE TABLE "entity_type_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, PRIMARY KEY ("id")); +-- Create index "entitytypehistory_history_time" to table: "entity_type_history" +CREATE INDEX "entitytypehistory_history_time" ON "entity_type_history" ("history_time"); +-- Create "user_setting_history" table +CREATE TABLE "user_setting_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "user_id" character varying NULL, "locked" boolean NOT NULL DEFAULT false, "silenced_at" timestamptz NULL, "suspended_at" timestamptz NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', "email_confirmed" boolean NOT NULL DEFAULT false, "is_webauthn_allowed" boolean NULL DEFAULT false, "is_tfa_enabled" boolean NULL DEFAULT false, "phone_number" character varying NULL, PRIMARY KEY ("id")); +-- Create index "usersettinghistory_history_time" to table: "user_setting_history" +CREATE INDEX "usersettinghistory_history_time" ON "user_setting_history" ("history_time"); +-- Create "event_history" table +CREATE TABLE "event_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "event_id" character varying NULL, "correlation_id" character varying NULL, "event_type" character varying NOT NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- Create index "eventhistory_history_time" to table: "event_history" +CREATE INDEX "eventhistory_history_time" ON "event_history" ("history_time"); +-- Create "integration_history" table +CREATE TABLE "integration_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, PRIMARY KEY ("id")); +-- Create index "integrationhistory_history_time" to table: "integration_history" +CREATE INDEX "integrationhistory_history_time" ON "integration_history" ("history_time"); +-- Create "feature_history" table +CREATE TABLE "feature_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "display_name" character varying NULL, "enabled" boolean NOT NULL DEFAULT false, "description" character varying NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- Create index "featurehistory_history_time" to table: "feature_history" +CREATE INDEX "featurehistory_history_time" ON "feature_history" ("history_time"); +-- Create "organization_history" table +CREATE TABLE "organization_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "display_name" character varying NOT NULL DEFAULT '', "description" character varying NULL, "parent_organization_id" character varying NULL, "personal_org" boolean NULL DEFAULT false, "avatar_remote_url" character varying NULL, "dedicated_db" boolean NOT NULL DEFAULT false, PRIMARY KEY ("id")); +-- Create index "organizationhistory_history_time" to table: "organization_history" +CREATE INDEX "organizationhistory_history_time" ON "organization_history" ("history_time"); +-- Create "hush_history" table +CREATE TABLE "hush_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, "secret_name" character varying NULL, "secret_value" character varying NULL, PRIMARY KEY ("id")); +-- Create index "hushhistory_history_time" to table: "hush_history" +CREATE INDEX "hushhistory_history_time" ON "hush_history" ("history_time"); +-- Create "group_setting_history" table +CREATE TABLE "group_setting_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "visibility" character varying NOT NULL DEFAULT 'PUBLIC', "join_policy" character varying NOT NULL DEFAULT 'INVITE_OR_APPLICATION', "sync_to_slack" boolean NULL DEFAULT false, "sync_to_github" boolean NULL DEFAULT false, "group_id" character varying NULL, PRIMARY KEY ("id")); +-- Create index "groupsettinghistory_history_time" to table: "group_setting_history" +CREATE INDEX "groupsettinghistory_history_time" ON "group_setting_history" ("history_time"); +-- Create "group_history" table +CREATE TABLE "group_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "owner_id" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "gravatar_logo_url" character varying NULL, "logo_url" character varying NULL, "display_name" character varying NOT NULL DEFAULT '', PRIMARY KEY ("id")); +-- Create index "grouphistory_history_time" to table: "group_history" +CREATE INDEX "grouphistory_history_time" ON "group_history" ("history_time"); +-- Create "group_membership_history" table +CREATE TABLE "group_membership_history" ("id" character varying NOT NULL, "history_time" timestamptz NOT NULL, "ref" character varying NULL, "operation" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "group_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id")); +-- Create index "groupmembershiphistory_history_time" to table: "group_membership_history" +CREATE INDEX "groupmembershiphistory_history_time" ON "group_membership_history" ("history_time"); +-- Create "api_tokens" table +CREATE TABLE "api_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "token" character varying NOT NULL, "expires_at" timestamptz NULL, "description" character varying NULL, "scopes" jsonb NULL, "last_used_at" timestamptz NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "api_tokens_organizations_api_tokens" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "api_tokens_mapping_id_key" to table: "api_tokens" +CREATE UNIQUE INDEX "api_tokens_mapping_id_key" ON "api_tokens" ("mapping_id"); +-- Create index "api_tokens_token_key" to table: "api_tokens" +CREATE UNIQUE INDEX "api_tokens_token_key" ON "api_tokens" ("token"); +-- Create index "apitoken_token" to table: "api_tokens" +CREATE INDEX "apitoken_token" ON "api_tokens" ("token"); +-- Create "contacts" table +CREATE TABLE "contacts" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "full_name" character varying NOT NULL, "title" character varying NULL, "company" character varying NULL, "email" character varying NULL, "phone_number" character varying NULL, "address" character varying NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "contacts_organizations_contacts" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "contacts_mapping_id_key" to table: "contacts" +CREATE UNIQUE INDEX "contacts_mapping_id_key" ON "contacts" ("mapping_id"); +-- Create "templates" table +CREATE TABLE "templates" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "template_type" character varying NOT NULL DEFAULT 'DOCUMENT', "description" character varying NULL, "jsonconfig" jsonb NOT NULL, "uischema" jsonb NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "templates_organizations_templates" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "template_name_owner_id_template_type" to table: "templates" +CREATE UNIQUE INDEX "template_name_owner_id_template_type" ON "templates" ("name", "owner_id", "template_type") WHERE (deleted_at IS NULL); +-- Create index "templates_mapping_id_key" to table: "templates" +CREATE UNIQUE INDEX "templates_mapping_id_key" ON "templates" ("mapping_id"); +-- Create "document_data" table +CREATE TABLE "document_data" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "data" jsonb NOT NULL, "owner_id" character varying NULL, "template_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "document_data_organizations_documentdata" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "document_data_templates_documents" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "document_data_mapping_id_key" to table: "document_data" +CREATE UNIQUE INDEX "document_data_mapping_id_key" ON "document_data" ("mapping_id"); +-- Create "users" table +CREATE TABLE "users" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "email" character varying NOT NULL, "first_name" character varying NULL, "last_name" character varying NULL, "display_name" character varying NOT NULL, "avatar_remote_url" character varying NULL, "avatar_local_file" character varying NULL, "avatar_updated_at" timestamptz NULL, "last_seen" timestamptz NULL, "password" character varying NULL, "sub" character varying NULL, "auth_provider" character varying NOT NULL DEFAULT 'CREDENTIALS', "role" character varying NULL DEFAULT 'USER', PRIMARY KEY ("id")); +-- Create index "user_email_auth_provider" to table: "users" +CREATE UNIQUE INDEX "user_email_auth_provider" ON "users" ("email", "auth_provider") WHERE (deleted_at IS NULL); +-- Create index "user_id" to table: "users" +CREATE UNIQUE INDEX "user_id" ON "users" ("id"); +-- Create index "users_mapping_id_key" to table: "users" +CREATE UNIQUE INDEX "users_mapping_id_key" ON "users" ("mapping_id"); +-- Create index "users_sub_key" to table: "users" +CREATE UNIQUE INDEX "users_sub_key" ON "users" ("sub"); +-- Create "email_verification_tokens" table +CREATE TABLE "email_verification_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "token" character varying NOT NULL, "ttl" timestamptz NOT NULL, "email" character varying NOT NULL, "secret" bytea NOT NULL, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "email_verification_tokens_users_email_verification_tokens" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "email_verification_tokens_mapping_id_key" to table: "email_verification_tokens" +CREATE UNIQUE INDEX "email_verification_tokens_mapping_id_key" ON "email_verification_tokens" ("mapping_id"); +-- Create index "email_verification_tokens_token_key" to table: "email_verification_tokens" +CREATE UNIQUE INDEX "email_verification_tokens_token_key" ON "email_verification_tokens" ("token"); +-- Create index "emailverificationtoken_token" to table: "email_verification_tokens" +CREATE UNIQUE INDEX "emailverificationtoken_token" ON "email_verification_tokens" ("token") WHERE (deleted_at IS NULL); +-- Create "entity_types" table +CREATE TABLE "entity_types" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entity_types_organizations_entitytypes" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "entity_types_mapping_id_key" to table: "entity_types" +CREATE UNIQUE INDEX "entity_types_mapping_id_key" ON "entity_types" ("mapping_id"); +-- Create index "entitytype_name_owner_id" to table: "entity_types" +CREATE UNIQUE INDEX "entitytype_name_owner_id" ON "entity_types" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- Create "entities" table +CREATE TABLE "entities" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "name" character varying NULL, "display_name" character varying NULL, "description" character varying NULL, "domains" jsonb NULL, "status" character varying NULL DEFAULT 'active', "entity_type_id" character varying NULL, "entity_type_entities" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entities_entity_types_entities" FOREIGN KEY ("entity_type_entities") REFERENCES "entity_types" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "entities_entity_types_entity_type" FOREIGN KEY ("entity_type_id") REFERENCES "entity_types" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "entities_organizations_entities" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "entities_mapping_id_key" to table: "entities" +CREATE UNIQUE INDEX "entities_mapping_id_key" ON "entities" ("mapping_id"); +-- Create index "entity_name_owner_id" to table: "entities" +CREATE UNIQUE INDEX "entity_name_owner_id" ON "entities" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- Create "entitlement_plans" table +CREATE TABLE "entitlement_plans" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "display_name" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "version" character varying NOT NULL, "metadata" jsonb NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entitlement_plans_organizations_entitlementplans" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "entitlement_plans_mapping_id_key" to table: "entitlement_plans" +CREATE UNIQUE INDEX "entitlement_plans_mapping_id_key" ON "entitlement_plans" ("mapping_id"); +-- Create index "entitlementplan_name_version_owner_id" to table: "entitlement_plans" +CREATE UNIQUE INDEX "entitlementplan_name_version_owner_id" ON "entitlement_plans" ("name", "version", "owner_id") WHERE (deleted_at IS NULL); +-- Create "entitlements" table +CREATE TABLE "entitlements" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "external_customer_id" character varying NULL, "external_subscription_id" character varying NULL, "expires" boolean NOT NULL DEFAULT false, "expires_at" timestamptz NULL, "cancelled" boolean NOT NULL DEFAULT false, "plan_id" character varying NOT NULL, "owner_id" character varying NULL, "organization_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "entitlements_entitlement_plans_entitlements" FOREIGN KEY ("plan_id") REFERENCES "entitlement_plans" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "entitlements_organizations_entitlements" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "entitlements_organizations_organization_entitlement" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "entitlement_organization_id_owner_id" to table: "entitlements" +CREATE UNIQUE INDEX "entitlement_organization_id_owner_id" ON "entitlements" ("organization_id", "owner_id") WHERE ((deleted_at IS NULL) AND (cancelled = false)); +-- Create index "entitlements_mapping_id_key" to table: "entitlements" +CREATE UNIQUE INDEX "entitlements_mapping_id_key" ON "entitlements" ("mapping_id"); +-- Create "events" table +CREATE TABLE "events" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "event_id" character varying NULL, "correlation_id" character varying NULL, "event_type" character varying NOT NULL, "metadata" jsonb NULL, PRIMARY KEY ("id")); +-- Create index "events_mapping_id_key" to table: "events" +CREATE UNIQUE INDEX "events_mapping_id_key" ON "events" ("mapping_id"); +-- Create "entitlement_events" table +CREATE TABLE "entitlement_events" ("entitlement_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("entitlement_id", "event_id"), CONSTRAINT "entitlement_events_entitlement_id" FOREIGN KEY ("entitlement_id") REFERENCES "entitlements" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entitlement_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "entitlement_plan_events" table +CREATE TABLE "entitlement_plan_events" ("entitlement_plan_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("entitlement_plan_id", "event_id"), CONSTRAINT "entitlement_plan_events_entitlement_plan_id" FOREIGN KEY ("entitlement_plan_id") REFERENCES "entitlement_plans" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entitlement_plan_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "features" table +CREATE TABLE "features" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "display_name" character varying NULL, "enabled" boolean NOT NULL DEFAULT false, "description" character varying NULL, "metadata" jsonb NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "features_organizations_features" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "feature_name_owner_id" to table: "features" +CREATE UNIQUE INDEX "feature_name_owner_id" ON "features" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- Create index "features_mapping_id_key" to table: "features" +CREATE UNIQUE INDEX "features_mapping_id_key" ON "features" ("mapping_id"); +-- Create "entitlement_plan_features" table +CREATE TABLE "entitlement_plan_features" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "metadata" jsonb NULL, "plan_id" character varying NOT NULL, "feature_id" character varying NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "entitlement_plan_features_entitlement_plans_plan" FOREIGN KEY ("plan_id") REFERENCES "entitlement_plans" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "entitlement_plan_features_features_feature" FOREIGN KEY ("feature_id") REFERENCES "features" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "entitlement_plan_features_organizations_entitlementplanfeatures" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "entitlement_plan_features_mapping_id_key" to table: "entitlement_plan_features" +CREATE UNIQUE INDEX "entitlement_plan_features_mapping_id_key" ON "entitlement_plan_features" ("mapping_id"); +-- Create index "entitlementplanfeature_feature_id_plan_id" to table: "entitlement_plan_features" +CREATE UNIQUE INDEX "entitlementplanfeature_feature_id_plan_id" ON "entitlement_plan_features" ("feature_id", "plan_id") WHERE (deleted_at IS NULL); +-- Create "entitlement_plan_feature_events" table +CREATE TABLE "entitlement_plan_feature_events" ("entitlement_plan_feature_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("entitlement_plan_feature_id", "event_id"), CONSTRAINT "entitlement_plan_feature_events_entitlement_plan_feature_id" FOREIGN KEY ("entitlement_plan_feature_id") REFERENCES "entitlement_plan_features" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entitlement_plan_feature_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "entity_contacts" table +CREATE TABLE "entity_contacts" ("entity_id" character varying NOT NULL, "contact_id" character varying NOT NULL, PRIMARY KEY ("entity_id", "contact_id"), CONSTRAINT "entity_contacts_contact_id" FOREIGN KEY ("contact_id") REFERENCES "contacts" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entity_contacts_entity_id" FOREIGN KEY ("entity_id") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "entity_documents" table +CREATE TABLE "entity_documents" ("entity_id" character varying NOT NULL, "document_data_id" character varying NOT NULL, PRIMARY KEY ("entity_id", "document_data_id"), CONSTRAINT "entity_documents_document_data_id" FOREIGN KEY ("document_data_id") REFERENCES "document_data" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entity_documents_entity_id" FOREIGN KEY ("entity_id") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "files" table +CREATE TABLE "files" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "file_name" character varying NOT NULL, "file_extension" character varying NOT NULL, "file_size" bigint NULL, "content_type" character varying NOT NULL, "store_key" character varying NOT NULL, "category" character varying NULL, "annotation" character varying NULL, "user_files" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "files_users_files" FOREIGN KEY ("user_files") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "files_mapping_id_key" to table: "files" +CREATE UNIQUE INDEX "files_mapping_id_key" ON "files" ("mapping_id"); +-- Create "entity_files" table +CREATE TABLE "entity_files" ("entity_id" character varying NOT NULL, "file_id" character varying NOT NULL, PRIMARY KEY ("entity_id", "file_id"), CONSTRAINT "entity_files_entity_id" FOREIGN KEY ("entity_id") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "entity_files_file_id" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "feature_events" table +CREATE TABLE "feature_events" ("feature_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("feature_id", "event_id"), CONSTRAINT "feature_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "feature_events_feature_id" FOREIGN KEY ("feature_id") REFERENCES "features" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "groups" table +CREATE TABLE "groups" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "description" character varying NULL, "gravatar_logo_url" character varying NULL, "logo_url" character varying NULL, "display_name" character varying NOT NULL DEFAULT '', "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "groups_organizations_groups" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "group_name_owner_id" to table: "groups" +CREATE UNIQUE INDEX "group_name_owner_id" ON "groups" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- Create index "groups_mapping_id_key" to table: "groups" +CREATE UNIQUE INDEX "groups_mapping_id_key" ON "groups" ("mapping_id"); +-- Create "group_events" table +CREATE TABLE "group_events" ("group_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("group_id", "event_id"), CONSTRAINT "group_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "group_events_group_id" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "group_files" table +CREATE TABLE "group_files" ("group_id" character varying NOT NULL, "file_id" character varying NOT NULL, PRIMARY KEY ("group_id", "file_id"), CONSTRAINT "group_files_file_id" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "group_files_group_id" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "group_memberships" table +CREATE TABLE "group_memberships" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "group_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "group_memberships_groups_group" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "group_memberships_users_user" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "group_memberships_mapping_id_key" to table: "group_memberships" +CREATE UNIQUE INDEX "group_memberships_mapping_id_key" ON "group_memberships" ("mapping_id"); +-- Create index "groupmembership_user_id_group_id" to table: "group_memberships" +CREATE UNIQUE INDEX "groupmembership_user_id_group_id" ON "group_memberships" ("user_id", "group_id") WHERE (deleted_at IS NULL); +-- Create "group_membership_events" table +CREATE TABLE "group_membership_events" ("group_membership_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("group_membership_id", "event_id"), CONSTRAINT "group_membership_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "group_membership_events_group_membership_id" FOREIGN KEY ("group_membership_id") REFERENCES "group_memberships" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "group_settings" table +CREATE TABLE "group_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "visibility" character varying NOT NULL DEFAULT 'PUBLIC', "join_policy" character varying NOT NULL DEFAULT 'INVITE_OR_APPLICATION', "sync_to_slack" boolean NULL DEFAULT false, "sync_to_github" boolean NULL DEFAULT false, "group_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "group_settings_groups_setting" FOREIGN KEY ("group_id") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "group_settings_group_id_key" to table: "group_settings" +CREATE UNIQUE INDEX "group_settings_group_id_key" ON "group_settings" ("group_id"); +-- Create index "group_settings_mapping_id_key" to table: "group_settings" +CREATE UNIQUE INDEX "group_settings_mapping_id_key" ON "group_settings" ("mapping_id"); +-- Create "hushes" table +CREATE TABLE "hushes" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, "secret_name" character varying NULL, "secret_value" character varying NULL, PRIMARY KEY ("id")); +-- Create index "hushes_mapping_id_key" to table: "hushes" +CREATE UNIQUE INDEX "hushes_mapping_id_key" ON "hushes" ("mapping_id"); +-- Create "hush_events" table +CREATE TABLE "hush_events" ("hush_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("hush_id", "event_id"), CONSTRAINT "hush_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "hush_events_hush_id" FOREIGN KEY ("hush_id") REFERENCES "hushes" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "integrations" table +CREATE TABLE "integrations" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "kind" character varying NULL, "group_integrations" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "integrations_groups_integrations" FOREIGN KEY ("group_integrations") REFERENCES "groups" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "integrations_organizations_integrations" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "integrations_mapping_id_key" to table: "integrations" +CREATE UNIQUE INDEX "integrations_mapping_id_key" ON "integrations" ("mapping_id"); +-- Create "integration_events" table +CREATE TABLE "integration_events" ("integration_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "event_id"), CONSTRAINT "integration_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_events_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "oh_auth_too_tokens" table +CREATE TABLE "oh_auth_too_tokens" ("id" character varying NOT NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "client_id" text NOT NULL, "scopes" jsonb NULL, "nonce" text NOT NULL, "claims_user_id" text NOT NULL, "claims_username" text NOT NULL, "claims_email" text NOT NULL, "claims_email_verified" boolean NOT NULL, "claims_groups" jsonb NULL, "claims_preferred_username" text NOT NULL, "connector_id" text NOT NULL, "connector_data" jsonb NULL, "last_used" timestamptz NOT NULL, PRIMARY KEY ("id")); +-- Create index "oh_auth_too_tokens_mapping_id_key" to table: "oh_auth_too_tokens" +CREATE UNIQUE INDEX "oh_auth_too_tokens_mapping_id_key" ON "oh_auth_too_tokens" ("mapping_id"); +-- Create "integration_oauth2tokens" table +CREATE TABLE "integration_oauth2tokens" ("integration_id" character varying NOT NULL, "oh_auth_too_token_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "oh_auth_too_token_id"), CONSTRAINT "integration_oauth2tokens_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_oauth2tokens_oh_auth_too_token_id" FOREIGN KEY ("oh_auth_too_token_id") REFERENCES "oh_auth_too_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "integration_secrets" table +CREATE TABLE "integration_secrets" ("integration_id" character varying NOT NULL, "hush_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "hush_id"), CONSTRAINT "integration_secrets_hush_id" FOREIGN KEY ("hush_id") REFERENCES "hushes" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_secrets_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "webhooks" table +CREATE TABLE "webhooks" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "description" character varying NULL, "destination_url" character varying NOT NULL, "enabled" boolean NOT NULL DEFAULT true, "callback" character varying NULL, "expires_at" timestamptz NULL, "secret" bytea NULL, "failures" bigint NULL DEFAULT 0, "last_error" character varying NULL, "last_response" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "webhooks_organizations_webhooks" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "webhook_name_owner_id" to table: "webhooks" +CREATE UNIQUE INDEX "webhook_name_owner_id" ON "webhooks" ("name", "owner_id") WHERE (deleted_at IS NULL); +-- Create index "webhooks_callback_key" to table: "webhooks" +CREATE UNIQUE INDEX "webhooks_callback_key" ON "webhooks" ("callback"); +-- Create index "webhooks_mapping_id_key" to table: "webhooks" +CREATE UNIQUE INDEX "webhooks_mapping_id_key" ON "webhooks" ("mapping_id"); +-- Create "integration_webhooks" table +CREATE TABLE "integration_webhooks" ("integration_id" character varying NOT NULL, "webhook_id" character varying NOT NULL, PRIMARY KEY ("integration_id", "webhook_id"), CONSTRAINT "integration_webhooks_integration_id" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "integration_webhooks_webhook_id" FOREIGN KEY ("webhook_id") REFERENCES "webhooks" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "invites" table +CREATE TABLE "invites" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "token" character varying NOT NULL, "expires" timestamptz NULL, "recipient" character varying NOT NULL, "status" character varying NOT NULL DEFAULT 'INVITATION_SENT', "role" character varying NOT NULL DEFAULT 'MEMBER', "send_attempts" bigint NOT NULL DEFAULT 0, "requestor_id" character varying NULL, "secret" bytea NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "invites_organizations_invites" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "invite_recipient_owner_id" to table: "invites" +CREATE UNIQUE INDEX "invite_recipient_owner_id" ON "invites" ("recipient", "owner_id") WHERE (deleted_at IS NULL); +-- Create index "invites_mapping_id_key" to table: "invites" +CREATE UNIQUE INDEX "invites_mapping_id_key" ON "invites" ("mapping_id"); +-- Create index "invites_token_key" to table: "invites" +CREATE UNIQUE INDEX "invites_token_key" ON "invites" ("token"); +-- Create "invite_events" table +CREATE TABLE "invite_events" ("invite_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("invite_id", "event_id"), CONSTRAINT "invite_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "invite_events_invite_id" FOREIGN KEY ("invite_id") REFERENCES "invites" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "notes" table +CREATE TABLE "notes" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "text" character varying NOT NULL, "entity_notes" character varying NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "notes_entities_notes" FOREIGN KEY ("entity_notes") REFERENCES "entities" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "notes_organizations_notes" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "notes_mapping_id_key" to table: "notes" +CREATE UNIQUE INDEX "notes_mapping_id_key" ON "notes" ("mapping_id"); +-- Create "oauth_providers" table +CREATE TABLE "oauth_providers" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "name" character varying NOT NULL, "client_id" character varying NOT NULL, "client_secret" character varying NOT NULL, "redirect_url" character varying NOT NULL, "scopes" character varying NOT NULL, "auth_url" character varying NOT NULL, "token_url" character varying NOT NULL, "auth_style" smallint NOT NULL, "info_url" character varying NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "oauth_providers_organizations_oauthprovider" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "oauth_providers_mapping_id_key" to table: "oauth_providers" +CREATE UNIQUE INDEX "oauth_providers_mapping_id_key" ON "oauth_providers" ("mapping_id"); +-- Create "oh_auth_too_token_events" table +CREATE TABLE "oh_auth_too_token_events" ("oh_auth_too_token_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("oh_auth_too_token_id", "event_id"), CONSTRAINT "oh_auth_too_token_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "oh_auth_too_token_events_oh_auth_too_token_id" FOREIGN KEY ("oh_auth_too_token_id") REFERENCES "oh_auth_too_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "org_memberships" table +CREATE TABLE "org_memberships" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "role" character varying NOT NULL DEFAULT 'MEMBER', "organization_id" character varying NOT NULL, "user_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "org_memberships_organizations_organization" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "org_memberships_users_user" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "org_memberships_mapping_id_key" to table: "org_memberships" +CREATE UNIQUE INDEX "org_memberships_mapping_id_key" ON "org_memberships" ("mapping_id"); +-- Create index "orgmembership_user_id_organization_id" to table: "org_memberships" +CREATE UNIQUE INDEX "orgmembership_user_id_organization_id" ON "org_memberships" ("user_id", "organization_id") WHERE (deleted_at IS NULL); +-- Create "org_membership_events" table +CREATE TABLE "org_membership_events" ("org_membership_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("org_membership_id", "event_id"), CONSTRAINT "org_membership_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "org_membership_events_org_membership_id" FOREIGN KEY ("org_membership_id") REFERENCES "org_memberships" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "organization_events" table +CREATE TABLE "organization_events" ("organization_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "event_id"), CONSTRAINT "organization_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_events_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "organization_files" table +CREATE TABLE "organization_files" ("organization_id" character varying NOT NULL, "file_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "file_id"), CONSTRAINT "organization_files_file_id" FOREIGN KEY ("file_id") REFERENCES "files" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_files_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "personal_access_tokens" table +CREATE TABLE "personal_access_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "name" character varying NOT NULL, "token" character varying NOT NULL, "expires_at" timestamptz NULL, "description" character varying NULL, "scopes" jsonb NULL, "last_used_at" timestamptz NULL, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "personal_access_tokens_users_personal_access_tokens" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "personal_access_tokens_mapping_id_key" to table: "personal_access_tokens" +CREATE UNIQUE INDEX "personal_access_tokens_mapping_id_key" ON "personal_access_tokens" ("mapping_id"); +-- Create index "personal_access_tokens_token_key" to table: "personal_access_tokens" +CREATE UNIQUE INDEX "personal_access_tokens_token_key" ON "personal_access_tokens" ("token"); +-- Create index "personalaccesstoken_token" to table: "personal_access_tokens" +CREATE INDEX "personalaccesstoken_token" ON "personal_access_tokens" ("token"); +-- Create "organization_personal_access_tokens" table +CREATE TABLE "organization_personal_access_tokens" ("organization_id" character varying NOT NULL, "personal_access_token_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "personal_access_token_id"), CONSTRAINT "organization_personal_access_tokens_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_personal_access_tokens_personal_access_token_id" FOREIGN KEY ("personal_access_token_id") REFERENCES "personal_access_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "organization_secrets" table +CREATE TABLE "organization_secrets" ("organization_id" character varying NOT NULL, "hush_id" character varying NOT NULL, PRIMARY KEY ("organization_id", "hush_id"), CONSTRAINT "organization_secrets_hush_id" FOREIGN KEY ("hush_id") REFERENCES "hushes" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "organization_secrets_organization_id" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "organization_settings" table +CREATE TABLE "organization_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "domains" jsonb NULL, "billing_contact" character varying NULL, "billing_email" character varying NULL, "billing_phone" character varying NULL, "billing_address" character varying NULL, "tax_identifier" character varying NULL, "geo_location" character varying NULL DEFAULT 'AMER', "organization_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "organization_settings_organizations_setting" FOREIGN KEY ("organization_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "organization_settings_mapping_id_key" to table: "organization_settings" +CREATE UNIQUE INDEX "organization_settings_mapping_id_key" ON "organization_settings" ("mapping_id"); +-- Create index "organization_settings_organization_id_key" to table: "organization_settings" +CREATE UNIQUE INDEX "organization_settings_organization_id_key" ON "organization_settings" ("organization_id"); +-- Create "password_reset_tokens" table +CREATE TABLE "password_reset_tokens" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "token" character varying NOT NULL, "ttl" timestamptz NOT NULL, "email" character varying NOT NULL, "secret" bytea NOT NULL, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "password_reset_tokens_users_password_reset_tokens" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "password_reset_tokens_mapping_id_key" to table: "password_reset_tokens" +CREATE UNIQUE INDEX "password_reset_tokens_mapping_id_key" ON "password_reset_tokens" ("mapping_id"); +-- Create index "password_reset_tokens_token_key" to table: "password_reset_tokens" +CREATE UNIQUE INDEX "password_reset_tokens_token_key" ON "password_reset_tokens" ("token"); +-- Create index "passwordresettoken_token" to table: "password_reset_tokens" +CREATE UNIQUE INDEX "passwordresettoken_token" ON "password_reset_tokens" ("token") WHERE (deleted_at IS NULL); +-- Create "personal_access_token_events" table +CREATE TABLE "personal_access_token_events" ("personal_access_token_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("personal_access_token_id", "event_id"), CONSTRAINT "personal_access_token_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "personal_access_token_events_personal_access_token_id" FOREIGN KEY ("personal_access_token_id") REFERENCES "personal_access_tokens" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "subscribers" table +CREATE TABLE "subscribers" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "email" character varying NOT NULL, "phone_number" character varying NULL, "verified_email" boolean NOT NULL DEFAULT false, "verified_phone" boolean NOT NULL DEFAULT false, "active" boolean NOT NULL DEFAULT false, "token" character varying NOT NULL, "ttl" timestamptz NOT NULL, "secret" bytea NOT NULL, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "subscribers_organizations_subscribers" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "subscriber_email_owner_id" to table: "subscribers" +CREATE UNIQUE INDEX "subscriber_email_owner_id" ON "subscribers" ("email", "owner_id") WHERE (deleted_at IS NULL); +-- Create index "subscribers_mapping_id_key" to table: "subscribers" +CREATE UNIQUE INDEX "subscribers_mapping_id_key" ON "subscribers" ("mapping_id"); +-- Create index "subscribers_token_key" to table: "subscribers" +CREATE UNIQUE INDEX "subscribers_token_key" ON "subscribers" ("token"); +-- Create "subscriber_events" table +CREATE TABLE "subscriber_events" ("subscriber_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("subscriber_id", "event_id"), CONSTRAINT "subscriber_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "subscriber_events_subscriber_id" FOREIGN KEY ("subscriber_id") REFERENCES "subscribers" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "tfa_settings" table +CREATE TABLE "tfa_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "tags" jsonb NULL, "tfa_secret" character varying NULL, "verified" boolean NOT NULL DEFAULT false, "recovery_codes" jsonb NULL, "phone_otp_allowed" boolean NULL DEFAULT false, "email_otp_allowed" boolean NULL DEFAULT false, "totp_allowed" boolean NULL DEFAULT false, "owner_id" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "tfa_settings_users_tfa_settings" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "tfa_settings_mapping_id_key" to table: "tfa_settings" +CREATE UNIQUE INDEX "tfa_settings_mapping_id_key" ON "tfa_settings" ("mapping_id"); +-- Create index "tfasetting_owner_id" to table: "tfa_settings" +CREATE UNIQUE INDEX "tfasetting_owner_id" ON "tfa_settings" ("owner_id") WHERE (deleted_at IS NULL); +-- Create "user_events" table +CREATE TABLE "user_events" ("user_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("user_id", "event_id"), CONSTRAINT "user_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "user_events_user_id" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); +-- Create "user_settings" table +CREATE TABLE "user_settings" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "deleted_at" timestamptz NULL, "deleted_by" character varying NULL, "locked" boolean NOT NULL DEFAULT false, "silenced_at" timestamptz NULL, "suspended_at" timestamptz NULL, "status" character varying NOT NULL DEFAULT 'ACTIVE', "email_confirmed" boolean NOT NULL DEFAULT false, "is_webauthn_allowed" boolean NULL DEFAULT false, "is_tfa_enabled" boolean NULL DEFAULT false, "phone_number" character varying NULL, "user_id" character varying NULL, "user_setting_default_org" character varying NULL, PRIMARY KEY ("id"), CONSTRAINT "user_settings_organizations_default_org" FOREIGN KEY ("user_setting_default_org") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT "user_settings_users_setting" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE SET NULL); +-- Create index "user_settings_mapping_id_key" to table: "user_settings" +CREATE UNIQUE INDEX "user_settings_mapping_id_key" ON "user_settings" ("mapping_id"); +-- Create index "user_settings_user_id_key" to table: "user_settings" +CREATE UNIQUE INDEX "user_settings_user_id_key" ON "user_settings" ("user_id"); +-- Create "webauthns" table +CREATE TABLE "webauthns" ("id" character varying NOT NULL, "created_at" timestamptz NULL, "updated_at" timestamptz NULL, "created_by" character varying NULL, "updated_by" character varying NULL, "mapping_id" character varying NOT NULL, "tags" jsonb NULL, "credential_id" bytea NULL, "public_key" bytea NULL, "attestation_type" character varying NULL, "aaguid" bytea NOT NULL, "sign_count" integer NOT NULL, "transports" jsonb NOT NULL, "backup_eligible" boolean NOT NULL DEFAULT false, "backup_state" boolean NOT NULL DEFAULT false, "user_present" boolean NOT NULL DEFAULT false, "user_verified" boolean NOT NULL DEFAULT false, "owner_id" character varying NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "webauthns_users_webauthn" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION); +-- Create index "webauthns_aaguid_key" to table: "webauthns" +CREATE UNIQUE INDEX "webauthns_aaguid_key" ON "webauthns" ("aaguid"); +-- Create index "webauthns_credential_id_key" to table: "webauthns" +CREATE UNIQUE INDEX "webauthns_credential_id_key" ON "webauthns" ("credential_id"); +-- Create index "webauthns_mapping_id_key" to table: "webauthns" +CREATE UNIQUE INDEX "webauthns_mapping_id_key" ON "webauthns" ("mapping_id"); +-- Create "webhook_events" table +CREATE TABLE "webhook_events" ("webhook_id" character varying NOT NULL, "event_id" character varying NOT NULL, PRIMARY KEY ("webhook_id", "event_id"), CONSTRAINT "webhook_events_event_id" FOREIGN KEY ("event_id") REFERENCES "events" ("id") ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT "webhook_events_webhook_id" FOREIGN KEY ("webhook_id") REFERENCES "webhooks" ("id") ON UPDATE NO ACTION ON DELETE CASCADE); diff --git a/db/migrations/atlas.sum b/db/migrations/atlas.sum new file mode 100644 index 0000000..0d6f45e --- /dev/null +++ b/db/migrations/atlas.sum @@ -0,0 +1,2 @@ +h1:5lhe9fOQo9scehEm/QcOyJBLiUGj+kdrw3XUBTbcA7Q= +20240827061437_init.sql h1:9pQTZIsiDF3hW0HraVTzaU3M25iiy3MdxvhsZosxgvo= diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..ef06efc --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,22 @@ +FROM golang:1.22.6 AS builder + +WORKDIR /go/src/app +COPY . . + +RUN go mod download +RUN CGO_ENABLED=1 GOOS=linux go build -o /go/bin/core -a -ldflags '-linkmode external -extldflags "-static"' . + +FROM gcr.io/distroless/static:nonroot + +# `nonroot` coming from distroless +USER 65532:65532 + +# Copy the binary that goreleaser built +COPY --from=builder /go/bin/core /bin/core + +# Copy default model into image +COPY fga/model/model.fga fga/model/model.fga + +# Run the web service on container startup. +ENTRYPOINT [ "/bin/core" ] +CMD ["serve"] diff --git a/docker/Taskfile.yaml b/docker/Taskfile.yaml new file mode 100644 index 0000000..3b9bced --- /dev/null +++ b/docker/Taskfile.yaml @@ -0,0 +1,102 @@ +version: "3" + +tasks: + build: + dir: .. + desc: builds the core docker image + cmds: + - "docker build -f docker/Dockerfile . -t core:dev" + + build:aio: + dir: .. + desc: builds the core docker image all-in-one image + cmds: + - "docker build -f ./docker/all-in-one/Dockerfile.all-in-one -t core:dev-aio ." + + core: + dir: .. + desc: brings up the compose environment for the core server + deps: [build] + cmds: + - "docker compose -f ./docker/docker-compose-redis.yml -f ./docker/docker-compose-fga.yml -f ./docker/docker-compose-kafka.yml -f ./docker/docker-compose.yml -p core up -d" + + core:down: + dir: .. + desc: brings the core compose environment down + cmds: + - "docker compose -p core down" + + all:up: + dir: .. + desc: brings up the full docker compose development environment including core server, fga, and rover + cmds: + - task: core + - task: :rover + + all:down: + dir: .. + desc: brings down both fga and core server compose environments + cmds: + - task: core:down + + redis: + dir: .. + desc: brings up the compose environment for redis + cmds: + - "docker compose -f ./docker/docker-compose-redis.yml -p redis up -d" + + redis:down: + dir: .. + desc: brings up the compose environment for redis + cmds: + - "docker compose -p redis down" + + postgres: + dir: .. + desc: brings up the compose environment for postgres development + cmds: + - "docker compose -f ./docker/docker-compose-pg.yml -p postgres up -d" + + postgres:down: + dir: .. + desc: brings the postgres compose environment down + cmds: + - docker compose -p postgres down + + fga: + dir: .. + desc: brings up the compose environment for openfga development + cmds: + - "docker compose -f ./docker/docker-compose-fga.yml -p fga up -d" + + fga:down: + dir: .. + desc: brings the fga compose environment down + cmds: + - docker compose -p fga down + + fga:open: + dir: .. + desc: opens the fga playground in a browser + cmds: + - 'open "http://localhost:3000/playground"' + + fga:up: + dir: .. + desc: brings the fga compose environment up and opens the fga playground + aliases: [fgaup] + cmds: + - task: fga + - task: fga:open + + kafka: + dir: .. + desc: brings up the compose environment for kafka + cmds: + - "docker compose -f ./docker/docker-compose-kafka.yml -p kafka up --build -d" + + kafka:down: + dir: .. + desc: brings the kafka compose environment down + cmds: + - docker compose -p kafka down diff --git a/docker/all-in-one/Dockerfile.all-in-one b/docker/all-in-one/Dockerfile.all-in-one new file mode 100644 index 0000000..e07af77 --- /dev/null +++ b/docker/all-in-one/Dockerfile.all-in-one @@ -0,0 +1,55 @@ +FROM golang:1.22.6 as builder + +WORKDIR /go/src/app +COPY . . + +RUN go mod download + +RUN CGO_ENABLED=1 GOOS=linux go build -o /go/bin/core -a -ldflags '-linkmode external -extldflags "-static"' . + +FROM cgr.dev/chainguard/bash:latest + +WORKDIR /home/nonroot + +# Copy the binary that goreleaser built +COPY --from=builder /go/bin/core /bin/core + +# Copy the geodetic binary +COPY --from=ghcr.io/theopenlane/geodetic:620-516e3250 /bin/geodetic /bin/geodetic + +# Copy redis binary +COPY --from=redis:7.4.0 /usr/local/bin/redis-server /bin/redis-server + +# Copy FGA binary +COPY --from=openfga/openfga:v1.5.9 /openfga /bin/openfga + +# Copy default model into image +COPY fga/model/model.fga fga/model/model.fga + +COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.29 /ko-app/grpc-health-probe /bin/grpc_health_probe + +# Copy entrypoint and env files +COPY docker/all-in-one/docker_entrypoint.sh /bin/docker_entrypoint.sh + +# Copy config +COPY ./config/config-aio.example.yaml ./config/.config.yaml + +RUN chmod +x /bin/docker_entrypoint.sh + +USER 65532:65532 + +# Expose FGA ports +EXPOSE 8080 +EXPOSE 8081 +EXPOSE 2112 + +#Expose geodetic ports +EXPOSE 1337 + +# Expose redis ports +EXPOSE 6379 + +# Expose API port +EXPOSE 17608 + +ENTRYPOINT ["docker_entrypoint.sh"] diff --git a/docker/all-in-one/README.md b/docker/all-in-one/README.md new file mode 100644 index 0000000..46cf537 --- /dev/null +++ b/docker/all-in-one/README.md @@ -0,0 +1,6 @@ +# All-In-One + +This dockerfile builds an image that contains necessary prereqs for the entire stack. Currently it will run the following: +- OpenFGA with in-memory data store +- Redis +- Core API connected to local FGA instance diff --git a/docker/all-in-one/docker_entrypoint.sh b/docker/all-in-one/docker_entrypoint.sh new file mode 100644 index 0000000..194f5ed --- /dev/null +++ b/docker/all-in-one/docker_entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# run migrate +/bin/openfga migrate + +# run the openfga service in the background +OPENFGA_LOG_FORMAT=json OPENFGA_PLAYGROUND_ENABLED=true /bin/openfga run --experimentals check-query-cache --check-query-cache-enabled & + +FGACHECK=1 +while [ $FGACHECK -ne 0 ]; do + grpc_health_probe -addr=:8081 + FGACHECK=$? +done + +/bin/redis-server --save 20 1 --loglevel warning --daemonize yes + +# run the geodetic service in the background +/bin/geodetic serve --debug --pretty &! + +# run the core service in the foreground +/bin/core serve --debug --pretty \ No newline at end of file diff --git a/docker/configs/alertmanager/alertmanager.yml b/docker/configs/alertmanager/alertmanager.yml new file mode 100644 index 0000000..d36f51f --- /dev/null +++ b/docker/configs/alertmanager/alertmanager.yml @@ -0,0 +1,14 @@ +route: + group_by: ['alertname', 'job'] + group_wait: 30s + group_interval: 5m + repeat_interval: 3h + receiver: alerts + +receivers: + - name: alerts + slack_configs: + - send_resolved: true + text: "{{ .CommonAnnotations.description }}" + channel: alerts-sink + api_url: http://localhost:17608/metrics diff --git a/docker/configs/grafana/dashboards/echo.json b/docker/configs/grafana/dashboards/echo.json new file mode 100644 index 0000000..a2bb42f --- /dev/null +++ b/docker/configs/grafana/dashboards/echo.json @@ -0,0 +1,1175 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS:BACKSTAGE", + "label": "", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "5.2.4" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "5.0.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "5.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + }, + { + "datasource": "Prometheus", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Dashboard for applications that use https://github.com/globocom/echo-prometheus", + "editable": true, + "gnetId": 10913, + "graphTooltip": 1, + "id": null, + "iteration": 1569416590151, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 41, + "panels": [], + "title": "Traffic", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 17, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "sum(rate(echo_http_requests_total{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[2m])) by (job)", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }}", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Traffic - Req/s", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 34, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "sum(rate(echo_http_requests_total{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[2m])) by (job, method, handler)", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }} - {{ method }} {{handler}}", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Traffic - Req/s by handler", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 19 + }, + "id": 43, + "panels": [], + "title": "Errors", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 34, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "echo_http_requests_total{handler!~\"/api/v1/docs/\\\\*|/metrics\"}", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }} - {{ method }} {{handler}}", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Traffic - total by handler", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 19 + }, + "id": 43, + "panels": [], + "title": "Errors", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 35, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "sum(rate(echo_http_requests_total{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\", status=\"5xx\"}[5m])) by (job)/sum(rate(echo_http_requests_total{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])) by (job)", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "instant": false, + "interval": "", + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }} - {{ method }} {{handler}}", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Errors - % (5xx)", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percentunit", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 29 + }, + "id": 36, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "sum(rate(echo_http_requests_total{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\", status=\"5xx\"}[5m])) by (job, method, handler)/sum(rate(echo_http_requests_total{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])) by (job, method, handler)", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "instant": false, + "interval": "", + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }} - {{ method }} {{handler}}", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Errors - % by handler (5xx)", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percentunit", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 38 + }, + "id": 45, + "panels": [], + "title": "Latêncy", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 39 + }, + "id": 37, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "histogram_quantile(0.5, sum by (job, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "instant": false, + "interval": "", + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }} - p50", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + }, + { + "expr": "histogram_quantile(0.95, sum by (job, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ job }} - p95", + "refId": "B" + }, + { + "expr": "histogram_quantile(0.99, sum by (job, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ job }} - p99", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Latency - General", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 48 + }, + "id": 38, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "histogram_quantile(0.5, sum by (job, method, handler, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "instant": false, + "interval": "", + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }} - {{ method }} {{ handler }} - p50", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + }, + { + "expr": "histogram_quantile(0.95, sum by (job, method, handler, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ job }} - {{ method }} {{ handler }} - p95", + "refId": "B" + }, + { + "expr": "histogram_quantile(0.99, sum by (job, method, handler, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ job }} - {{ method }} {{ handler }} - p99", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Latency by handler", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "$datasource", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 57 + }, + "id": 39, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "application": { + "filter": "" + }, + "expr": "histogram_quantile(0.5, sum by (job, instance, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "instant": false, + "interval": "", + "intervalFactor": 1, + "item": { + "filter": "" + }, + "legendFormat": "{{ job }} - {{ instance }} - p50", + "mode": 0, + "options": { + "showDisabledItems": false, + "skipEmptyValues": false + }, + "refId": "A", + "resultFormat": "time_series", + "table": { + "skipEmptyValues": false + }, + "triggers": { + "acknowledged": 2, + "count": true, + "minSeverity": 3 + } + }, + { + "expr": "histogram_quantile(0.95, sum by (job, instance, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ job }} - {{ instance }} - p95", + "refId": "B" + }, + { + "expr": "histogram_quantile(0.99, sum by (job, instance, le) (rate(echo_http_request_duration_seconds_bucket{job=~\"$job\",instance=~\"$instance\", handler=~\"$handler\"}[5m])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ job }} - {{ instance }} - p99", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Latency by instance", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "10s", + "schemaVersion": 16, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "text": "Prometheus:backstage", + "value": "Prometheus:backstage" + }, + "hide": 0, + "label": "DataSource", + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Job", + "multi": false, + "name": "job", + "options": [], + "query": "label_values(echo_http_requests_total, job)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Instance", + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(echo_http_requests_total, instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "$datasource", + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Handler", + "multi": false, + "name": "handler", + "options": [], + "query": "label_values(echo_http_requests_total, handler)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Echo Framework Processes", + "uid": "KzznqEpZz", + "version": 5 +} \ No newline at end of file diff --git a/docker/configs/grafana/dashboards/kafka-metrics.json b/docker/configs/grafana/dashboards/kafka-metrics.json new file mode 100644 index 0000000..b81a0e1 --- /dev/null +++ b/docker/configs/grafana/dashboards/kafka-metrics.json @@ -0,0 +1,638 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Kafka resource usage and throughput", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 721, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 10, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 14, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 480, + "sort": "max", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "sum(rate(kafka_topic_partition_current_offset{instance=\"$instance\", topic=~\"$topic\"}[1m])) by (topic)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{topic}}", + "refId": "B" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Message in per second", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "min": "0", + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 10, + "x": 10, + "y": 0 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 480, + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "sum(kafka_consumergroup_lag{instance=\"$instance\",topic=~\"$topic\"}) by (consumergroup, topic) ", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{consumergroup}} (topic: {{topic}})", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Lag by Consumer Group", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "", + "logBase": 1, + "min": "0", + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 10, + "x": 0, + "y": 10 + }, + "hiddenSeries": false, + "id": 16, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 480, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "sum(delta(kafka_topic_partition_current_offset{instance=~'$instance', topic=~\"$topic\"}[5m])/5) by (topic)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{topic}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Message in per minute", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 10, + "x": 10, + "y": 10 + }, + "hiddenSeries": false, + "id": 18, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "sideWidth": 480, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "sum(delta(kafka_consumergroup_current_offset{instance=~'$instance',topic=~\"$topic\"}[5m])/5) by (consumergroup, topic)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{consumergroup}} (topic: {{topic}})", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Message consume per minute", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 20, + "x": 0, + "y": 20 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": 420, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.3", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "sum by(topic) (kafka_topic_partitions{instance=\"$instance\",topic=~\"$topic\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{topic}}", + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Partitions per Topic", + "tooltip": { + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "series", + "show": false, + "values": [ + "current" + ] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + } + ], + "refresh": "10s", + "revision": 1, + "schemaVersion": 38, + "style": "dark", + "tags": [ + "Kafka" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "label": "Prometheus", + "multi": false, + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": false, + "text": "kafka-exporter", + "value": "kafka-exporter" + }, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Job", + "multi": false, + "name": "job", + "options": [], + "query": { + "query": "label_values(kafka_consumergroup_current_offset, job)", + "refId": "Prometheus-job-Variable-Query" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "kafka-exporter:9308", + "value": "kafka-exporter:9308" + }, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Instance", + "multi": false, + "name": "instance", + "options": [], + "query": { + "query": "label_values(kafka_consumergroup_current_offset{job=~\"$job\"}, instance)", + "refId": "Prometheus-instance-Variable-Query" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Topic", + "multi": true, + "name": "topic", + "options": [], + "query": { + "query": "label_values(kafka_topic_partition_current_offset{instance='$instance',topic!='__consumer_offsets',topic!='--kafka'}, topic)", + "refId": "Prometheus-topic-Variable-Query" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Kafka Exporter Overview", + "uid": "jkEKesRpt", + "version": 2, + "weekStart": "" + } \ No newline at end of file diff --git a/docker/configs/grafana/dashboards/openfga.json b/docker/configs/grafana/dashboards/openfga.json new file mode 100644 index 0000000..160133b --- /dev/null +++ b/docker/configs/grafana/dashboards/openfga.json @@ -0,0 +1,1324 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 19, + "panels": [], + "title": "Server Metrics", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "The 90th percentile request duration of an RPC, grouped by 'grpc_service' and 'grpc_method'.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 26, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "histogram_quantile(0.9, sum by(le, grpc_method, grpc_service) (rate(grpc_server_handling_seconds_bucket{job=\"openfga\", grpc_type=\"unary\", grpc_service=\"openfga.v1.OpenFGAService\"}[2m])))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": true, + "key": "Q-52ee0e33-980f-4a19-9821-39530de9f304-0", + "legendFormat": "{{grpc_service}}/{{grpc_method}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "p90 Request Duration by Method", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "The 50th percentile request duration of an RPC, grouped by 'grpc_service' and 'grpc_method'.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 17, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "histogram_quantile(0.5, sum by(le, grpc_method, grpc_service) (rate(grpc_server_handling_seconds_bucket{job=\"openfga\", grpc_type=\"unary\", grpc_service=\"openfga.v1.OpenFGAService\"}[2m])))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": true, + "key": "Q-52ee0e33-980f-4a19-9821-39530de9f304-0", + "legendFormat": "{{grpc_service}}/{{grpc_method}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "p50 Request Duration by Method", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Percentage of hits to the in-memory Check API cache", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Check Cache Hit Ratio", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "dashed+area" + } + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "dark-red", + "value": 0 + }, + { + "color": "#EAB839", + "value": 30 + }, + { + "color": "green", + "value": 70 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 18, + "y": 1 + }, + "id": 25, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "(sum(increase(openfga_check_cache_hit_count_total{service=\"openfga\"}[1m]))\n /\nsum(increase(openfga_check_cache_count_total{service=\"openfga\"}[1m])))* 100", + "hide": false, + "instant": false, + "legendFormat": "Check Cache hit ratio", + "range": true, + "refId": "A" + } + ], + "title": "Check Cache Hit Ratio", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 8 + }, + "id": 24, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "sum by(grpc_code, grpc_method) (rate(grpc_server_handled_total{grpc_service=\"openfga.v1.OpenFGAService\"}[1m]))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Status Code Count per Method", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "The number of requests per second (aggregated over a 1m interval) per method.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 23, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(grpc_server_started_total{job=\"openfga\",grpc_service=\"openfga.v1.OpenFGAService\"}[1m])) by (grpc_method)\n", + "legendFormat": "openfga.v1.OpenFGAService/{{grpc_method}}", + "range": true, + "refId": "A" + } + ], + "title": "RPS per Method", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "The 99th percentile request duration of an RPC, grouped by 'grpc_service' and 'grpc_method'.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 12, + "y": 9 + }, + "id": 21, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "histogram_quantile(0.99, sum by(le, grpc_method, grpc_service) (rate(grpc_server_handling_seconds_bucket{job=\"openfga\", grpc_type=\"unary\", grpc_service=\"openfga.v1.OpenFGAService\"}[2m])))", + "instant": true, + "key": "Q-52ee0e33-980f-4a19-9821-39530de9f304-0", + "legendFormat": "{{grpc_service}}/{{grpc_method}}", + "range": true, + "refId": "A" + } + ], + "title": "p99 Request Duration by Method", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "id": 27, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "go_sql_open_connections{db_name=\"openfga\"}", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "SQL Open Connections", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "go_sql_max_open_connections{db_name=\"openfga\"}", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "SQL Max Open Connections", + "range": true, + "refId": "B", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "go_sql_in_use_connections{db_name=\"openfga\"}", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "SQL In Use Connections", + "range": true, + "refId": "C", + "useBackend": false + } + ], + "title": "SQL metrics", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 4, + "panels": [], + "title": "Go Runtime Metrics", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "The number of goroutines reported by the Go runtime.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 25 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "go_goroutines{job=\"openfga\"}", + "legendFormat": "Goroutines (Count)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "irate(go_goroutines{job=\"openfga\"}[2m])", + "hide": false, + "legendFormat": "Goroutine (Derivative)", + "range": true, + "refId": "B" + } + ], + "title": "Goroutines", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 25 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "go_gc_duration_seconds{job=\"openfga\", quantile=\"0.5\"}", + "legendFormat": "p50", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "go_gc_duration_seconds{job=\"openfga\", quantile=\"0.75\"}", + "hide": false, + "legendFormat": "p75", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "go_gc_duration_seconds{job=\"openfga\", quantile=\"1\"}", + "hide": false, + "legendFormat": "p100", + "range": true, + "refId": "C" + } + ], + "title": "Go GC Duration", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 25 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "go_memstats_heap_alloc_bytes{job=\"openfga\"}", + "legendFormat": "{{label_name}}", + "range": true, + "refId": "A" + } + ], + "title": "Heap Memory Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "The number of heap allocations (mallocs) as a rate (malloc/sec).", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "displayName": "malloc/sec", + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 33 + }, + "id": 16, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "rate(go_memstats_mallocs_total{job=\"openfga\"}[2m])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Memory Allocation Rate (malloc/sec)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "Shows the number of heap allocations (as a byte/sec rate).", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "binBps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 33 + }, + "id": 14, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "rate(go_memstats_alloc_bytes_total{job=\"openfga\"}[2m])", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Heap Allocation Rate (bytes/sec)", + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "OpenFGA Dashboard", + "uid": "6s3pLp04z", + "version": 2, + "weekStart": "" +} \ No newline at end of file diff --git a/docker/configs/grafana/dashboards/postgres.json b/docker/configs/grafana/dashboards/postgres.json new file mode 100644 index 0000000..d64b2a6 --- /dev/null +++ b/docker/configs/grafana/dashboards/postgres.json @@ -0,0 +1,3167 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "DS_PROMETHEUS", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.3.5" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "This dashboard works with postgres_exporter for prometheus", + "editable": true, + "gnetId": 3742, + "graphTooltip": 0, + "id": null, + "iteration": 1568751813814, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 34, + "panels": [], + "title": "General Counters, CPU, Memory and File Descriptor Stats", + "type": "row" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "#7eb26d", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 36, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_static{release=\"$release\", instance=\"$instance\"}", + "format": "time_series", + "instant": true, + "intervalFactor": 1, + "legendFormat": "{{short_version}}", + "refId": "A" + } + ], + "thresholds": "", + "title": "Version", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "name" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "description": "start time of the process", + "format": "dateTimeFromNow", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 28, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "110%", + "prefix": "", + "prefixFontSize": "110%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_postmaster_start_time_seconds{release=\"$release\", instance=\"$instance\"} * 1000", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "title": "Start Time", + "type": "singlestat", + "valueFontSize": "70%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 8, + "y": 1 + }, + "height": "200px", + "id": 10, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "SUM(pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "refId": "A", + "step": 4 + } + ], + "thresholds": "", + "title": "Current fetch data", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 12, + "y": 1 + }, + "height": "200px", + "id": 11, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "SUM(pg_stat_database_tup_inserted{release=\"$release\", datname=~\"$datname\", instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "refId": "A", + "step": 4 + } + ], + "thresholds": "", + "title": "Current insert data", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 16, + "y": 1 + }, + "height": "200px", + "id": 12, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "SUM(pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "refId": "A", + "step": 4 + } + ], + "thresholds": "", + "title": "Current update data", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 20, + "y": 1 + }, + "id": 38, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_max_connections{release=\"$release\", instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max Connections", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "description": "Average user and system CPU time spent in seconds.", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 3 + }, + "id": 22, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(rate(process_cpu_seconds_total{release=\"$release\", instance=\"$instance\"}[5m]) * 1000)", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "CPU Time", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average CPU Usage", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "description": "Virtual and Resident memory size in bytes, averages over 5 min interval", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 3 + }, + "id": 24, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(rate(process_resident_memory_bytes{release=\"$release\", instance=\"$instance\"}[5m]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Resident Mem", + "refId": "A" + }, + { + "expr": "avg(rate(process_virtual_memory_bytes{release=\"$release\", instance=\"$instance\"}[5m]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Virtual Mem", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average Memory Usage", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "description": "Number of open file descriptors", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 3 + }, + "id": 26, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "process_open_fds{release=\"$release\", instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Open FD", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Open File Descriptors", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 32, + "panels": [], + "title": "Settings", + "type": "row" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 0, + "y": 11 + }, + "id": 40, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_shared_buffers_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Shared Buffers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 3, + "y": 11 + }, + "id": 42, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_effective_cache_size_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Effective Cache", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 11 + }, + "id": 44, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_maintenance_work_mem_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Maintenance Work Mem", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 11 + }, + "id": 46, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_work_mem_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "title": "Work Mem", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "decimals": 1, + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 11 + }, + "id": 48, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_max_wal_size_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max WAL Size", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 11 + }, + "id": 50, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_random_page_cost{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Random Page Cost", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 18, + "y": 11 + }, + "id": 52, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_seq_page_cost", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Seq Page Cost", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 20, + "y": 11 + }, + "id": 54, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_max_worker_processes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max Worker Processes", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 22, + "y": 11 + }, + "id": 56, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "pg_settings_max_parallel_workers{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max Parallel Workers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 30, + "panels": [], + "title": "Database Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 15 + }, + "id": 1, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 3, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=\"active\"} !=0", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{datname}}, s: {{state}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Active sessions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 15 + }, + "id": 60, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_database_xact_commit{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} commits", + "refId": "A" + }, + { + "expr": "irate(pg_stat_database_xact_rollback{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} rollbacks", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Transactions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 15 + }, + "id": 8, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": null, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Update data", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 22 + }, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Fetch data (SELECT)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 22 + }, + "id": 6, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_inserted{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Insert data", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 22 + }, + "id": 3, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_locks_count{datname=~\"$datname\", instance=~\"$instance\", mode=~\"$mode\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}},{{mode}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Lock tables", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 29 + }, + "id": 14, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_returned{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Return data", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 29 + }, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": false, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=~\"idle|idle in transaction|idle in transaction (aborted)\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}, s: {{state}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Idle sessions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 29 + }, + "id": 7, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_deleted{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Delete data", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 2, + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 36 + }, + "id": 62, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"} / (pg_stat_database_blks_read{instance=\"$instance\", datname=~\"$datname\"} + pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ datname }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Cache Hit Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 4, + "format": "percentunit", + "label": "", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 36 + }, + "id": 64, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_bgwriter_buffers_backend{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_backend", + "refId": "A" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_alloc{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_alloc", + "refId": "B" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_backend_fsync{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "backend_fsync", + "refId": "C" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_checkpoint{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_checkpoint", + "refId": "D" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_clean{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_clean", + "refId": "E" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Buffers (bgwriter)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 36 + }, + "id": 66, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_database_conflicts{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} conflicts", + "refId": "B" + }, + { + "expr": "irate(pg_stat_database_deadlocks{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} deadlocks", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Conflicts/Deadlocks", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "description": "Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 43 + }, + "id": 68, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_database_temp_bytes{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Temp File (Bytes)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "gridPos": { + "h": 7, + "w": 16, + "x": 8, + "y": 43 + }, + "id": 70, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_bgwriter_checkpoint_write_time{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "write_time - Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk.", + "refId": "B" + }, + { + "expr": "irate(pg_stat_bgwriter_checkpoint_sync_time{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "sync_time - Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk.", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Checkpoint Stats", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ms", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "10s", + "schemaVersion": 19, + "style": "dark", + "tags": [ + "postgres", + "db", + "stats" + ], + "templating": { + "list": [ + { + "hide": 0, + "label": "datasource", + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + }, + { + "auto": true, + "auto_count": 200, + "auto_min": "1s", + "current": { + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "5s", + "value": "5s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + } + ], + "query": "1s,5s,1m,5m,1h,6h,1d", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Namespace", + "multi": false, + "name": "namespace", + "options": [], + "query": "query_result(pg_exporter_last_scrape_duration_seconds)", + "refresh": 2, + "regex": "/.*kubernetes_namespace=\"([^\"]+).*/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Release", + "multi": false, + "name": "release", + "options": [], + "query": "query_result(pg_exporter_last_scrape_duration_seconds{kubernetes_namespace=\"$namespace\"})", + "refresh": 2, + "regex": "/.*release=\"([^\"]+)/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Instance", + "multi": false, + "name": "instance", + "options": [], + "query": "query_result(pg_up{release=\"$release\"})", + "refresh": 1, + "regex": "/.*instance=\"([^\"]+).*/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Database", + "multi": true, + "name": "datname", + "options": [], + "query": "label_values(datname)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Lock table", + "multi": true, + "name": "mode", + "options": [], + "query": "label_values({mode=~\"accessexclusivelock|accesssharelock|exclusivelock|rowexclusivelock|rowsharelock|sharelock|sharerowexclusivelock|shareupdateexclusivelock\"}, mode)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "PostgreSQL Database", + "uid": "000000039", + "version": 1 +} \ No newline at end of file diff --git a/docker/configs/grafana/provisioning/dashboards.yml b/docker/configs/grafana/provisioning/dashboards.yml new file mode 100644 index 0000000..b4654ec --- /dev/null +++ b/docker/configs/grafana/provisioning/dashboards.yml @@ -0,0 +1,12 @@ +apiVersion: 1 + +providers: + - name: 'dashboards' + orgId: 1 + type: file + disableDeletion: false + updateIntervalSeconds: 60 + allowUiUpdates: true + options: + path: /var/lib/grafana/dashboards + foldersFromFilesStructure: true diff --git a/docker/configs/grafana/provisioning/datasources.yml b/docker/configs/grafana/provisioning/datasources.yml new file mode 100644 index 0000000..61ed91c --- /dev/null +++ b/docker/configs/grafana/provisioning/datasources.yml @@ -0,0 +1,11 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 + version: 1 + editable: true + isDefault: false diff --git a/docker/configs/prometheus/alerts/node.rules b/docker/configs/prometheus/alerts/node.rules new file mode 100644 index 0000000..e8e178c --- /dev/null +++ b/docker/configs/prometheus/alerts/node.rules @@ -0,0 +1,294 @@ +groups: +- name: NodeExporterAlerts + rules: + # Critical Alerts + - alert: HostOutOfMemory + expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10 + for: 5m + labels: + severity: critical + annotations: + summary: Host out of memory (instance {{ $labels.instance }}) + description: Node memory is filling up (< 10% left)\n VALUE = {{ $value }} + + - alert: HostFilesystemDeviceError + expr: 'node_filesystem_device_error == 1' + for: 0m + labels: + severity: critical + annotations: + summary: Host filesystem device error (instance {{ $labels.instance }}) + description: "{{ $labels.instance }}: Device error with the {{ $labels.mountpoint }} filesystem\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: HostOutOfDiskSpace + expr: (node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) node_filesystem_readonly == 0 + for: 2m + labels: + severity: critical + annotations: + summary: Host out of disk space (instance {{ $labels.instance }}) + description: Disk is almost full (< 10% left)\n VALUE = {{ $value }} + + # Warning Alerts + - alert: HostUnusualNetworkThroughputOut + expr: '(sum by (instance) (rate(node_network_transmit_bytes_total[2m])) / 1024 / 1024 > 100) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}' + for: 5m + labels: + severity: warning + annotations: + summary: Host unusual network throughput out (instance {{ $labels.instance }}) + description: "Host network interfaces are probably sending too much data (> 100 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: HostMemoryUnderMemoryPressure + expr: rate(node_vmstat_pgmajfault[1m]) > 1000 + for: 2m + labels: + severity: warning + annotations: + summary: Host memory under memory pressure (instance {{ $labels.instance }}) + description: The node is under heavy memory pressure. High rate of major page faults\n VALUE = {{ $value }} + + - alert: HostUnusualNetworkThroughputIn + expr: sum by (instance) (rate(node_network_receive_bytes_total[2m])) / 1024 / 1024 > 100 + for: 5m + labels: + severity: warning + annotations: + summary: Host unusual network throughput in (instance {{ $labels.instance }}) + description: Host network interfaces are probably receiving too much data (> 100 MB/s)\n VALUE = {{ $value }} + + - alert: HostOutOfInodes + expr: node_filesystem_files_free{mountpoint ="/rootfs"} / node_filesystem_files{mountpoint="/rootfs"} * 100 < 10 and ON (instance, device, mountpoint) node_filesystem_readonly{mountpoint="/rootfs"} == 0 + for: 2m + labels: + severity: warning + annotations: + summary: Host out of inodes (instance {{ $labels.instance }}) + description: Disk is almost running out of available inodes (< 10% left)\n VALUE = {{ $value }} + + - alert: HostUnusualDiskReadLatency + expr: rate(node_disk_read_time_seconds_total[1m]) / rate(node_disk_reads_completed_total[1m]) > 0.1 and rate(node_disk_reads_completed_total[1m]) > 0 + for: 2m + labels: + severity: warning + annotations: + summary: Host unusual disk read latency (instance {{ $labels.instance }}) + description: Disk latency is growing (read operations > 100ms)\n VALUE = {{ $value }} + + - alert: HostUnusualDiskWriteLatency + expr: rate(node_disk_write_time_seconds_totali{device!~"mmcblk.+"}[1m]) / rate(node_disk_writes_completed_total{device!~"mmcblk.+"}[1m]) > 0.1 and rate(node_disk_writes_completed_total{device!~"mmcblk.+"}[1m]) > 0 + for: 2m + labels: + severity: warning + annotations: + summary: Host unusual disk write latency (instance {{ $labels.instance }}) + description: Disk latency is growing (write operations > 100ms)\n VALUE = {{ $value }} + + - alert: HostHighCpuLoad + expr: 100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100) > 80 + for: 0m + labels: + severity: warning + annotations: + summary: Host high CPU load (instance {{ $labels.instance }}) + description: CPU load is > 80%\n VALUE = {{ $value }} + + - alert: HostCpuStealNoisyNeighbor + expr: avg by(instance) (rate(node_cpu_seconds_total{mode="steal"}[5m])) * 100 > 10 + for: 0m + labels: + severity: warning + annotations: + summary: Host CPU steal noisy neighbor (instance {{ $labels.instance }}) + description: CPU steal is > 10%. A noisy neighbor is killing VM performances or a spot instance may be out of credit.\n VALUE = {{ $value }} + + - alert: HostUnusualDiskIo + expr: '(rate(node_disk_io_time_seconds_total[1m]) > 0.5) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}' + for: 5m + labels: + severity: warning + annotations: + summary: Host unusual disk IO (instance {{ $labels.instance }}) + description: "Time spent in IO is too high on {{ $labels.instance }}. Check storage for issues.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: HostCpuHighIowait + expr: '(avg by (instance) (rate(node_cpu_seconds_total{mode="iowait"}[5m])) * 100 > 10) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}' + for: 0m + labels: + severity: warning + annotations: + summary: Host CPU high iowait (instance {{ $labels.instance }}) + description: "CPU iowait > 10%. A high iowait means that you are disk or network bound.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: HostContextSwitching + expr: (rate(node_context_switches_total[5m])) / (count without(cpu, mode) (node_cpu_seconds_total{mode="idle"})) > 1000 + for: 0m + labels: + severity: warning + annotations: + summary: Host context switching (instance {{ $labels.instance }}) + description: Context switching is growing on node (> 1000 / s)\n VALUE = {{ $value }} + + - alert: HostSwapIsFillingUp + expr: (1 - (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes)) * 100 > 80 + for: 2m + labels: + severity: warning + annotations: + summary: Host swap is filling up (instance {{ $labels.instance }}) + description: Swap is filling up (>80%)\n VALUE = {{ $value }} + + - alert: HostSystemdServiceCrashed + expr: node_systemd_unit_state{state="failed"} == 1 + for: 0m + labels: + severity: warning + annotations: + summary: Host SystemD service crashed (instance {{ $labels.instance }}) + description: SystemD service crashed\n VALUE = {{ $value }} + + - alert: HostRaidArrayGotInactive + expr: node_md_state{state="inactive"} > 0 + for: 0m + labels: + severity: critical + annotations: + summary: Host RAID array got inactive (instance {{ $labels.instance }}) + description: RAID array {{ $labels.device }} is in degraded state due to one or more disks failures. Number of spare drives is insufficient to fix issue automatically.\n VALUE = {{ $value }} + + - alert: HostRaidDiskFailure + expr: node_md_disks{state="failed"} > 0 + for: 2m + labels: + severity: warning + annotations: + summary: Host RAID disk failure (instance {{ $labels.instance }}) + description: At least one device in RAID array on {{ $labels.instance }} failed. Array {{ $labels.md_device }} needs attention and possibly a disk swap\n VALUE = {{ $value }} + + - alert: HostKernelVersionDeviations + expr: count(sum(label_replace(node_uname_info, "kernel", "$1", "release", "([0-9]+.[0-9]+.[0-9]+).*")) by (kernel)) > 1 + for: 6h + labels: + severity: warning + annotations: + summary: Host kernel version deviations (instance {{ $labels.instance }}) + description: Different kernel versions are running\n VALUE = {{ $value }} + + - alert: HostOomKillDetected + expr: increase(node_vmstat_oom_kill[1m]) > 0 + for: 0m + labels: + severity: warning + annotations: + summary: Host OOM kill detected (instance {{ $labels.instance }}) + description: OOM kill detected\n VALUE = {{ $value }} + + - alert: HostEdacUncorrectableErrorsDetected + expr: node_edac_uncorrectable_errors_total > 0 + for: 0m + labels: + severity: warning + annotations: + summary: Host EDAC Uncorrectable Errors detected (instance {{ $labels.instance }}) + description: Instance has had {{ printf "%.0f" $value }} uncorrectable memory errors reported by EDAC in the last 5 minutes.\n VALUE = {{ $value }} + + - alert: HostNetworkReceiveErrors + expr: rate(node_network_receive_errs_total[2m]) / rate(node_network_receive_packets_total[2m]) > 0.01 + for: 2m + labels: + severity: warning + annotations: + summary: Host Network Receive Errors (instance {{ $labels.instance }}:{{ $labels.device }}) + description: Instance interface has encountered {{ printf "%.0f" $value }} receive errors in the last five minutes.\n VALUE = {{ $value }} + + - alert: HostNetworkTransmitErrors + expr: rate(node_network_transmit_errs_total[2m]) / rate(node_network_transmit_packets_total[2m]) > 0.01 + for: 2m + labels: + severity: warning + annotations: + summary: Host Network Transmit Errors (instance {{ $labels.instance }}:{{ $labels.device }}) + description: Instance has encountered {{ printf "%.0f" $value }} transmit errors in the last five minutes.\n VALUE = {{ $value }} + + - alert: HostNetworkInterfaceSaturated + expr: (rate(node_network_receive_bytes_total{device!~"^tap.*"}[1m]) + rate(node_network_transmit_bytes_total{device!~"^tap.*"}[1m])) / node_network_speed_bytes{device!~"^tap.*"} > 0.8 + for: 1m + labels: + severity: warning + annotations: + summary: Host Network Interface Saturated (instance {{ $labels.instance }}:{{ $labels.interface }}) + description: The network interface is getting overloaded.\n VALUE = {{ $value }} + + - alert: HostConntrackLimit + expr: node_nf_conntrack_entries / node_nf_conntrack_entries_limit > 0.8 + for: 5m + labels: + severity: warning + annotations: + summary: Host conntrack limit (instance {{ $labels.instance }}) + description: The number of conntrack is approaching limit\n VALUE = {{ $value }} + + - alert: HostClockSkew + expr: (node_timex_offset_seconds > 0.05 and deriv(node_timex_offset_seconds[5m]) >= 0) or (node_timex_offset_seconds < -0.05 and deriv(node_timex_offset_seconds[5m]) <= 0) + for: 2m + labels: + severity: warning + annotations: + summary: Host clock skew (instance {{ $labels.instance }}) + description: Clock skew detected. Clock is out of sync.\n VALUE = {{ $value }} + + - alert: HostClockNotSynchronising + expr: min_over_time(node_timex_sync_status[1m]) == 0 and node_timex_maxerror_seconds >= 16 + for: 2m + labels: + severity: warning + annotations: + summary: Host clock not synchronising (instance {{ $labels.instance }}) + description: Clock not synchronising.\n VALUE = {{ $value }} + + - alert: HostUnusualDiskWriteRate + expr: sum by (instance) (rate(node_disk_written_bytes_total[2m])) / 1024 / 1024 > 50 + for: 2m + labels: + severity: warning + annotations: + summary: Host unusual disk write rate (instance {{ $labels.instance }}) + description: Disk is probably writing too much data (> 50 MB/s)\n VALUE = {{ $value }} + + # Prediction + - alert: HostDiskWillFillIn24Hours + expr: (node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) predict_linear(node_filesystem_avail_bytes{fstype!~"tmpfs"}[1h], 24 * 3600) < 0 and ON (instance, device, mountpoint) node_filesystem_readonly == 0 + for: 2m + labels: + severity: warning + annotations: + summary: Host disk will fill in 24 hours (instance {{ $labels.instance }}) + description: Filesystem is predicted to run out of space within the next 24 hours at current write rate\n VALUE = {{ $value }} + + - alert: HostInodesWillFillIn24Hours + expr: node_filesystem_files_free{mountpoint ="/rootfs"} / node_filesystem_files{mountpoint="/rootfs"} * 100 < 10 and predict_linear(node_filesystem_files_free{mountpoint="/rootfs"}[1h], 24 * 3600) < 0 and ON (instance, device, mountpoint) node_filesystem_readonly{mountpoint="/rootfs"} == 0 + for: 2m + labels: + severity: warning + annotations: + summary: Host inodes will fill in 24 hours (instance {{ $labels.instance }}) + description: Filesystem is predicted to run out of inodes within the next 24 hours at current write rate\n VALUE = {{ $value }} + + # Info Alerts + - alert: HostMemoryIsUnderutilized + expr: '(100 - (rate(node_memory_MemAvailable_bytes[30m]) / node_memory_MemTotal_bytes * 100) < 20) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}' + for: 1w + labels: + severity: info + annotations: + summary: Host Memory is underutilized (instance {{ $labels.instance }}) + description: "Node memory is < 20% for 1 week. Consider reducing memory space. (instance {{ $labels.instance }})\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + + - alert: HostEdacCorrectableErrorsDetected + expr: increase(node_edac_correctable_errors_total[1m]) > 0 + for: 0m + labels: + severity: info + annotations: + summary: Host EDAC Correctable Errors detected (instance {{ $labels.instance }}) + description: Instance has had {{ printf "%.0f" $value }} correctable memory errors reported by EDAC in the last 5 minutes.\n VALUE = {{ $value }} \ No newline at end of file diff --git a/docker/configs/prometheus/prometheus.yml b/docker/configs/prometheus/prometheus.yml new file mode 100644 index 0000000..445020e --- /dev/null +++ b/docker/configs/prometheus/prometheus.yml @@ -0,0 +1,33 @@ +global: + scrape_interval: 15s + external_labels: + monitor: 'monitoring' +rule_files: + - 'alerts/*.rules' +alerting: + alertmanagers: + - scheme: http + static_configs: + - targets: + - 'alertmanager:9093' +scrape_configs: + - job_name: prometheus + honor_timestamps: true + scrape_interval: 15s + scrape_timeout: 10s + metrics_path: /metrics + scheme: http + static_configs: + - targets: + - localhost:17608 + - host.docker.internal:17608 + - host.docker.internal:2112 + - host.docker.internal:9187 + - job_name: kafka-exporter + static_configs: + - targets: ['kafka-exporter:10000'] + labels: + container: 'kafka-exporter' + - job_name: postgres-exporter + static_configs: + - targets: ["host.docker.internal:9187"] diff --git a/docker/docker-compose-fga.yml b/docker/docker-compose-fga.yml new file mode 100644 index 0000000..112644d --- /dev/null +++ b/docker/docker-compose-fga.yml @@ -0,0 +1,51 @@ +include: + - docker-compose-pg.yml +services: + migrate: + image: openfga/openfga:v1.5.9 + container_name: migrate + command: migrate + depends_on: + postgres: + condition: service_healthy + environment: + - OPENFGA_DATASTORE_ENGINE=postgres + - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/openfga?sslmode=disable + networks: + - default + openfga: + depends_on: + migrate: + condition: service_completed_successfully + image: openfga/openfga:v1.5.9 + container_name: openfga + environment: + - OPENFGA_DATASTORE_ENGINE=postgres + - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/openfga?sslmode=disable + - OPENFGA_LOG_FORMAT=json + - OPENFGA_DATASTORE_MAX_OPEN_CONNS=100 #see postgres container + - OPENFGA_PLAYGROUND_ENABLED=true + - OPENFGA_LIST_USERS_MAX_RESULTS=10000 + command: + - run + - --check-query-cache-enabled + - --metrics-enabled + - --datastore-metrics-enabled + - --authn-method=preshared + - --authn-preshared-keys="QKwHEmWX99RnFh28eSRJ3GWlfb2FQkL7toh1GJpzch1mMkVeMg" + healthcheck: + test: ["CMD", "/usr/local/bin/grpc_health_probe", "-addr=openfga:8081"] + interval: 5s + timeout: 30s + retries: 3 + ports: + # Needed for the http server + - "8080:8080" + # Needed for the grpc server (if used) + - "8081:8081" + # Needed for the playground (Do not enable in prod!) + - "3000:3000" + # Needed for the prometheus metrics + - "2112:2112" #prometheus metrics + networks: + - default diff --git a/docker/docker-compose-kafka.yml b/docker/docker-compose-kafka.yml new file mode 100644 index 0000000..53b7383 --- /dev/null +++ b/docker/docker-compose-kafka.yml @@ -0,0 +1,42 @@ +services: + proxy: + image: envoyproxy/envoy:contrib-v1.30-latest + ports: + - "${PORT_PROXY:-10000}:10000" + - "${PORT_ADMIN:-8001}:8001" + volumes: + - ./envoy.yaml:/etc/envoy/envoy.yaml + + kafka-server: + image: docker.io/bitnami/kafka:3.8 + ports: + - "9092:9092" + environment: + - ALLOW_INTERNAL_LISTENER=yes + - KAFKA_CFG_NODE_ID=0 + - KAFKA_CFG_PROCESS_ROLES=controller,broker + - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka-server:9093 + - KAFKA_CFG_LISTENERS=CONTROLLER://:9093,INTERNAL://kafka-server:9092,EXTERNAL://kafka-server:10000 + - KAFKA_CFG_ADVERTISED_LISTENERS=INTERNAL://kafka-server:9092,EXTERNAL://proxy:10000 + - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT + - KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR=1 + - KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER + - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=INTERNAL + tty: true + volumes: + - "kafka_data:/bitnami" + + kafka-ui: + container_name: kafka-ui + image: provectuslabs/kafka-ui:latest + ports: + - 8090:8080 + environment: + KAFKA_CLUSTERS_0_NAME: openlane + KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka-server:9092 + KAFKA_CLUSTERS_0_METRICS_PORT: 11001 + KAFKA_CLUSTERS_0_METRICS_TYPE: PROMETHEUS + +volumes: + kafka_data: + driver: local diff --git a/docker/docker-compose-pg.yml b/docker/docker-compose-pg.yml new file mode 100644 index 0000000..6e10c78 --- /dev/null +++ b/docker/docker-compose-pg.yml @@ -0,0 +1,31 @@ +services: + postgres: + image: postgres:16 + container_name: postgres + command: postgres -c 'max_connections=150' + ports: + - "5432:5432" + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=password + volumes: + - ./pg-init-scripts:/docker-entrypoint-initdb.d + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + networks: + - default + + postgres-exporter: + image: wrouesnel/postgres_exporter:v0.8.0 + restart: always + environment: + - DATA_SOURCE_URI=postgres:5432/openfga?sslmode=disable + - DATA_SOURCE_USER=postgres + - DATA_SOURCE_PASS=password + ports: + - "9187:9187" + depends_on: + - postgres diff --git a/docker/docker-compose-prometheus.yml b/docker/docker-compose-prometheus.yml new file mode 100644 index 0000000..8e6275e --- /dev/null +++ b/docker/docker-compose-prometheus.yml @@ -0,0 +1,51 @@ +services: + prometheus: + image: prom/prometheus:latest + container_name: prometheus + ports: + - "9090:9090" + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--log.level=error' + - '--storage.tsdb.path=/prometheus' + - '--storage.tsdb.retention.time=7d' + - '--web.console.libraries=/usr/share/prometheus/console_libraries' + - '--web.console.templates=/usr/share/prometheus/consoles' + - '--web.external-url=http://localhost:9090' + volumes: + - ./configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + restart: unless-stopped + + alertmanager: + image: prom/alertmanager:latest + volumes: + - ./configs/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml + ports: + - "9093:9093" + + grafana: + image: grafana/grafana:latest + container_name: grafana + restart: unless-stopped + environment: + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + - GF_USERS_DEFAULT_THEME=light + - GF_LOG_MODE=console + - GF_LOG_LEVEL=critical + - GF_PANELS_ENABLE_ALPHA=true + volumes: + - ./configs/grafana/provisioning/dashboards.yml:/etc/grafana/provisioning/dashboards/provisioning-dashboards.yaml:ro + - ./configs/grafana/provisioning/datasources.yml:/etc/grafana/provisioning/datasources/provisioning-datasources.yaml:ro + - ./configs/grafana/dashboards/kafka-metrics.json:/var/lib/grafana/dashboards/kafka-metrics.json:ro + - ./configs/grafana/dashboards/echo.json:/var/lib/grafana/dashboards/echo.json:ro + - ./configs/grafana/dashboards/postgres.json:/var/lib/grafana/dashboards/postgres.json:ro + - ./configs/grafana/dashboards/openfga.json:/var/lib/grafana/dashboards/openfga.json:ro + depends_on: + - prometheus + ports: + - 3003:3000 + +volumes: + prometheus-data: + driver: local diff --git a/docker/docker-compose-redis.yml b/docker/docker-compose-redis.yml new file mode 100644 index 0000000..b7215a0 --- /dev/null +++ b/docker/docker-compose-redis.yml @@ -0,0 +1,13 @@ +services: + redis: + image: redis:7.4.0-alpine + container_name: redis + restart: always + ports: + - '6379:6379' + command: redis-server --save 20 1 --loglevel warning + volumes: + - 'redis_data:/data' +volumes: + redis_data: + driver: local diff --git a/docker/docker-compose-storage.yml b/docker/docker-compose-storage.yml new file mode 100644 index 0000000..1b6a0ec --- /dev/null +++ b/docker/docker-compose-storage.yml @@ -0,0 +1,12 @@ +services: + s3: + image: minio/minio + ports: + - "9000:9000" + - "9001:9001" + volumes: + - s3_data:/data + environment: + MINIO_ROOT_USER: ${MINIO_USER} + MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD} + command: server --console-address ":9001" /data diff --git a/docker/docker-compose-tracing.yml b/docker/docker-compose-tracing.yml new file mode 100644 index 0000000..1259851 --- /dev/null +++ b/docker/docker-compose-tracing.yml @@ -0,0 +1,24 @@ +services: + jaeger: + image: jaegertracing/all-in-one:1.60 + container_name: jaeger + restart: always + ports: + - "16686:16686" #jaeger UI + # Collector + otel-collector: + image: "otel/opentelemetry-collector:0.107.0" + restart: always + command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"] + volumes: + - ./files/otel-collector-config.yaml:/etc/otel-collector-config.yaml + ports: + - "1888:1888" # pprof extension + - "8888:8888" # Prometheus metrics exposed by the collector + - "8889:8889" # Prometheus exporter metrics + - "13133:13133" # health_check extension + - "4317:4317" # OTLP gRPC receiver + - "4318:4318" # OTLP HTTP receiver + - "55679:55679" # zpages extension + depends_on: + - jaeger diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..5a3cba8 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,22 @@ +services: + api: + image: core:dev + depends_on: + - openfga + command: + - serve + - --debug + - --pretty + - --config=/config/.config.yaml + volumes: + - type: bind + source: ../config/.config.yaml + target: /config/.config.yaml + ports: + - "17608:17608" + restart: unless-stopped + environment: + - CORE_REDIS_ADDRESS=redis:6379 + - CORE_AUTHZ_HOST_URL=openfga:8080 + networks: + - default diff --git a/docker/envoy.yaml b/docker/envoy.yaml new file mode 100644 index 0000000..dbf1f9e --- /dev/null +++ b/docker/envoy.yaml @@ -0,0 +1,39 @@ +static_resources: + listeners: + - name: listener_0 + address: + socket_address: + protocol: TCP + address: 0.0.0.0 + port_value: 10000 + filter_chains: + - filters: + - name: envoy.filters.network.kafka_broker + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.kafka_broker.v3.KafkaBroker + stat_prefix: kafka_broker + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: kafka_service + cluster: kafka_service + + clusters: + - name: kafka_service + type: STRICT_DNS + lb_policy: ROUND_ROBIN + load_assignment: + cluster_name: kafka_server + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + # Kafka server's listener for client traffic ('EXTERNAL'). + address: kafka-server + port_value: 10000 +admin: + address: + socket_address: + address: 0.0.0.0 + port_value: 8001 diff --git a/docker/files/otel-collector-config.yaml b/docker/files/otel-collector-config.yaml new file mode 100644 index 0000000..0474ea8 --- /dev/null +++ b/docker/files/otel-collector-config.yaml @@ -0,0 +1,22 @@ +receivers: + otlp: + protocols: + http: + cors: + allowed_origins: + - "*" +processors: + batch: +exporters: + logging: + loglevel: debug + otlp: + endpoint: "jaeger:4317" + tls: + insecure: true +service: + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [logging, otlp] diff --git a/docker/pg-init-scripts/init.sql b/docker/pg-init-scripts/init.sql new file mode 100644 index 0000000..d3c4dca --- /dev/null +++ b/docker/pg-init-scripts/init.sql @@ -0,0 +1,7 @@ +CREATE DATABASE openfga; + +GRANT ALL PRIVILEGES ON DATABASE openfga TO postgres; + +CREATE DATABASE core; + +GRANT ALL PRIVILEGES ON DATABASE core TO postgres; \ No newline at end of file diff --git a/fga/Taskfile.yaml b/fga/Taskfile.yaml new file mode 100644 index 0000000..6ede2f3 --- /dev/null +++ b/fga/Taskfile.yaml @@ -0,0 +1,12 @@ +version: '3' + +tasks: + create: + desc: creates a new fga store with the testdata model + cmds: + - fga store create --name "core dev" --model model/model.fga + + test: + desc: runs the fga model tests + cmds: + - fga model test --tests tests/tests.yaml diff --git a/fga/model/model.fga b/fga/model/model.fga new file mode 100644 index 0000000..e07f203 --- /dev/null +++ b/fga/model/model.fga @@ -0,0 +1,47 @@ +model + schema 1.1 +type user +type service +type role + relations + define assignee: [user] +type organization + relations + # main roles + define admin: [user] or admin from parent + define member: [user] or owner or admin or member from parent + define owner: [user] or owner from parent + define parent: [organization] + # main permission sets based on roles + define can_delete: [service] or owner or can_delete from parent + define can_edit: [service] or admin or owner or can_edit from parent + define can_view: [service] or member or admin or owner or can_edit or can_view from parent + # additional fine-grained permissions + ## allow owner and assigned users to view audit logs + define audit_log_viewer: [user] or owner or audit_log_viewer from parent + ## allow members to invite other members + define can_invite_members: [user] or member or can_edit or can_invite_members from parent + ## onnly allow users with edit access to the org to invite other admins + define can_invite_admins: [user] or can_edit or can_invite_admins from parent + # additional relations + define user_in_context: [user] +type group + relations + # main roles + define admin: [user] and member from parent + define member: [user] and member from parent + define parent: [organization] + # main permission sets based on roles + define can_delete: [service] or admin or can_delete from parent + define can_edit: [service] or admin or can_edit from parent + define can_view: [service] or member or admin or can_view from parent + # additional fine-grained permissions + define audit_log_viewer: [user] or audit_log_viewer from parent +type subscription_tier + relations + define subscriber: [organization] + define subscriber_member: member from subscriber +type feature + relations + define associated_subscription_tier: [subscription_tier] + define access: [user, service] or subscriber_member from associated_subscription_tier \ No newline at end of file diff --git a/fga/tests/tests.yaml b/fga/tests/tests.yaml new file mode 100644 index 0000000..a61059b --- /dev/null +++ b/fga/tests/tests.yaml @@ -0,0 +1,427 @@ +name: TheOpenLane +model_file: ../model/model.fga +tuples: + # setup parent child org relationship + - user: organization:meow + relation: parent + object: organization:woof + # setup org primary owner + - user: user:ulid-of-owner + relation: owner + object: organization:meow + # setup org admin + - user: user:ulid-of-admin + relation: admin + object: organization:meow + # setup org member + - user: user:ulid-of-member + relation: member + object: organization:meow + # setup audit log viewer + - user: user:ulid-of-audit-log-viewer + relation: audit_log_viewer + object: organization:meow + # setup service user + - user: service:ulid-of-service-editor + relation: can_edit + object: organization:meow + # setup service user + - user: service:ulid-of-service-viewer + relation: can_view + object: organization:meow +tests: + - name: organization + description: test organization relationships + tuples: + # add test local tuples here + check: + - user: user:ulid-of-owner + object: organization:meow # parent org + assertions: + member: true + admin: false + owner: true + can_delete: true + can_edit: true + can_view: true + audit_log_viewer: true + can_invite_members: true + can_invite_admins: true + - user: user:ulid-of-member + object: organization:meow # parent org + assertions: + member: true + admin: false + owner: false + can_delete: false + can_edit: false + can_view: true + audit_log_viewer: false + can_invite_members: true + can_invite_admins: false + - user: service:ulid-of-service-editor + object: organization:meow # parent org + assertions: + member: false + admin: false + owner: false + can_delete: false + can_edit: true + can_view: true + audit_log_viewer: false + can_invite_members: true + can_invite_admins: true + - user: service:ulid-of-service-viewer + object: organization:meow # parent org + assertions: + member: false + admin: false + owner: false + can_delete: false + can_edit: false + can_view: true + audit_log_viewer: false + can_invite_members: false + can_invite_admins: false + - user: user:ulid-of-admin + object: organization:meow # parent org + assertions: + member: true + admin: true + owner: false + can_delete: false + can_edit: true + can_view: true + audit_log_viewer: false + can_invite_members: true + can_invite_admins: true + - user: user:ulid-of-audit-log-viewer + object: organization:meow # parent org + assertions: + member: false + admin: false + owner: false + can_delete: false + can_edit: false + can_view: false + audit_log_viewer: true + can_invite_members: false + can_invite_admins: false + - user: user:ulid-of-owner + object: organization:dog #child org + assertions: + member: true + admin: false + owner: true + can_delete: true + can_edit: true + can_view: true + audit_log_viewer: true + can_invite_members: true + can_invite_admins: true + - user: user:ulid-of-member + object: organization:dog # child org + assertions: + member: true + admin: false + owner: false + can_delete: false + can_edit: false + can_view: true + audit_log_viewer: false + can_invite_members: true + can_invite_admins: false + - user: user:ulid-of-admin + object: organization:dog # child org + assertions: + member: true + admin: true + owner: false + can_delete: false + can_edit: true + can_view: true + audit_log_viewer: false + can_invite_members: true + can_invite_admins: true + list_objects: + - user: user:ulid-of-owner + type: organization + assertions: + owner: + - organization:dog + - organization:meow + admin: + member: + - organization:dog + - organization:meow + - user: user:ulid-of-member + type: organization + assertions: + owner: + admin: + member: + - organization:dog + - organization:meow + - user: service:ulid-of-service-editor + type: organization + assertions: + can_edit: + - organization:dog + - organization:meow + can_view: + - organization:dog + - organization:meow + - user: service:ulid-of-service-viewer + type: organization + assertions: + can_edit: + can_view: + - organization:dog + - organization:meow + - user: user:ulid-of-admin + type: organization + assertions: + owner: + admin: + - organization:dog + - organization:meow + member: + - organization:dog + - organization:meow + - name: groups + description: test group relationships to their parent (organization) + tuples: + # setup group with owner + - user: organization:meow + relation: parent + object: group:cat-lovers + # add group admin + - user: user:ulid-of-owner + relation: admin + object: group:cat-lovers + # add group member but not a member of the org + - user: user:ulid-of-cat-lover-member + relation: member + object: group:cat-lovers + # add audit log viewer + - user: user:ulid-of-audit-log-viewer + relation: audit_log_viewer + object: group:cat-lovers + # add group admin + - user: user:ulid-of-member + relation: member + object: group:cat-lovers + check: + - user: organization:meow + object: group:cat-lovers + assertions: + parent: true + - user: user:ulid-of-owner + object: group:cat-lovers + assertions: + admin: true + member: false + can_delete: true + can_edit: true + can_view: true + audit_log_viewer: true + - user: user:ulid-of-cat-lover-member + object: group:cat-lovers + assertions: + admin: false + member: false # not an org member so should be false + can_delete: false + can_edit: false + can_view: false + audit_log_viewer: false + - user: user:ulid-of-member + object: group:cat-lovers + assertions: + admin: false + member: true + can_delete: false + can_edit: false + can_view: true + audit_log_viewer: false + - user: service:ulid-of-service-editor + object: group:cat-lovers + assertions: + admin: false + member: false + can_delete: false + can_edit: true + can_view: true + audit_log_viewer: false + list_objects: + - user: user:ulid-of-owner + type: group + assertions: + admin: + - group:cat-lovers + member: + - user: user:ulid-of-member + type: group + assertions: + admin: + member: + - group:cat-lovers + - user: user:ulid-of-admin # user wasn't added to group + type: group + assertions: + admin: + member: + - name: subscription tier + description: subscription tiers are associated to organizations, and members are part of that organization + tuples: + # setup organization with pro tier + - user: organization:meow + relation: subscriber + object: subscription_tier:pro + # setup organization with free tier + - user: organization:startup + relation: subscriber + object: subscription_tier:free + check: + - user: organization:meow + object: subscription_tier:pro + assertions: + subscriber: true + subscriber_member: false + - user: organization:meow + object: subscription_tier:free + assertions: + subscriber: false + subscriber_member: false + - user: organization:startup + object: subscription_tier:free + assertions: + subscriber: true + subscriber_member: false + - user: user:ulid-of-member + object: subscription_tier:pro + assertions: + subscriber: false + subscriber_member: true + - user: user:ulid-of-owner + object: subscription_tier:pro + assertions: + subscriber: false + subscriber_member: true + - user: user:ulid-of-admin + object: subscription_tier:pro + assertions: + subscriber: false + subscriber_member: true + list_objects: + - user: user:ulid-of-owner + type: subscription_tier + assertions: + subscriber_member: + - subscription_tier:pro + subscriber: + - user: user:ulid-of-admin + type: subscription_tier + assertions: + subscriber_member: + - subscription_tier:pro + subscriber: + - user: user:ulid-of-member + type: subscription_tier + assertions: + subscriber_member: + - subscription_tier:pro + subscriber: + - user: organization:meow + type: subscription_tier + assertions: + subscriber_member: + subscriber: + - subscription_tier:pro + - user: organization:startup + type: subscription_tier + assertions: + subscriber_member: + subscriber: + - subscription_tier:free + - user: organization:none + type: subscription_tier + assertions: + subscriber_member: + subscriber: + - name: features + description: features tiers are associated to subscription tiers, and users can access features based on their subscription tier of their organization + tuples: + # setup organization with pro tier + - user: organization:meow + relation: subscriber + object: subscription_tier:pro + # setup organization with free tier + - user: organization:startup + relation: subscriber + object: subscription_tier:free + # setup org member + - user: user:ulid-of-startup-member + relation: member + object: organization:startup + - user: subscription_tier:free + relation: associated_subscription_tier + object: feature:asset-management + - user: subscription_tier:pro + relation: associated_subscription_tier + object: feature:sso + check: + - user: user:ulid-of-startup-member + object: feature:asset-management + assertions: + associated_subscription_tier: false + access: true + - user: user:ulid-of-admin + object: feature:sso + assertions: + associated_subscription_tier: false + access: true + - user: user:ulid-of-owner + object: feature:sso + assertions: + associated_subscription_tier: false + access: true + - user: user:ulid-of-member + object: feature:sso + assertions: + associated_subscription_tier: false + access: true + - user: subscription_tier:pro + object: feature:sso + assertions: + associated_subscription_tier: true + access: false + - user: subscription_tier:free + object: feature:asset-management + assertions: + associated_subscription_tier: true + access: false + list_objects: + - user: user:ulid-of-owner + type: feature + assertions: + associated_subscription_tier: + access: + - feature:sso + - user: user:ulid-of-startup-member + type: feature + assertions: + associated_subscription_tier: + access: + - feature:asset-management + - user: subscription_tier:free + type: feature + assertions: + associated_subscription_tier: + - feature:asset-management + access: + - user: subscription_tier:pro + type: feature + assertions: + associated_subscription_tier: + - feature:sso + access: diff --git a/gen_schema.go b/gen_schema.go new file mode 100644 index 0000000..680aa51 --- /dev/null +++ b/gen_schema.go @@ -0,0 +1,27 @@ +//go:build ignore + +package main + +import ( + "log" + "os" + + "github.com/vektah/gqlparser/v2/formatter" + + "github.com/theopenlane/core/internal/graphapi" +) + +// read in schema from internal package and save it to the schema file +func main() { + execSchema := graphapi.NewExecutableSchema(graphapi.Config{}) + schema := execSchema.Schema() + + f, err := os.Create("schema.graphql") + if err != nil { + log.Fatal(err) + } + defer f.Close() + fmtr := formatter.NewFormatter(f) + + fmtr.FormatSchema(schema) +} diff --git a/generate.go b/generate.go new file mode 100644 index 0000000..72db0e6 --- /dev/null +++ b/generate.go @@ -0,0 +1,13 @@ +package main + +//go:generate echo "------> Generating code - running entc.go... <------" +//go:generate go run -mod=mod ./internal/ent/entc.go +//go:generate echo "------> Generating code - running gqlgen... <------" +//go:generate go run ./internal/graphapi/generate/generate.go +//go:generate echo "------> Generating code - running gen_schema.go... <------" +//go:generate go run -mod=mod ./gen_schema.go +//go:generate echo "------> Generating code - running gqlgenc... <------" +//go:generate go run -mod=mod github.com/Yamashou/gqlgenc generate --configdir schema +//go:generate echo "------> Tidying up... <------" +//go:generate go mod tidy +//go:generate echo "------> Code generation process completed! <------" diff --git a/go.mod b/go.mod index ba833c4..ca1bf86 100644 --- a/go.mod +++ b/go.mod @@ -3,156 +3,271 @@ module github.com/theopenlane/core go 1.23.0 require ( - entgo.io/ent v0.14.0 + ariga.io/entcache v0.1.0 + entgo.io/contrib v0.6.0 + entgo.io/ent v0.14.1 + github.com/99designs/gqlgen v0.17.49 + github.com/99designs/keyring v1.2.2 + github.com/IBM/sarama v1.43.3 + github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 + github.com/Yamashou/gqlgenc v0.24.0 github.com/alicebob/miniredis/v2 v2.33.0 - github.com/bytedance/sonic v1.12.1 + github.com/alitto/pond v1.9.1 + github.com/brianvoe/gofakeit/v7 v7.0.4 + github.com/bytedance/sonic v1.12.2 + github.com/cenkalti/backoff/v4 v4.3.0 + github.com/coreos/go-oidc/v3 v3.11.0 + github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 + github.com/gertd/go-pluralize v0.2.1 + github.com/getkin/kin-openapi v0.127.0 + github.com/go-webauthn/webauthn v0.11.1 + github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 + github.com/goccy/go-yaml v1.12.0 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/google/go-github/v63 v63.0.0 github.com/google/go-querystring v1.1.0 github.com/google/uuid v1.6.0 github.com/gorilla/securecookie v1.1.2 + github.com/gorilla/websocket v1.5.3 + github.com/hashicorp/go-multierror v1.1.1 + github.com/invopop/jsonschema v0.12.0 + github.com/invopop/yaml v0.3.1 + github.com/knadh/koanf/parsers/yaml v0.1.0 + github.com/knadh/koanf/providers/env v0.1.0 + github.com/knadh/koanf/providers/file v1.1.0 + github.com/knadh/koanf/providers/posflag v0.1.0 + github.com/knadh/koanf/v2 v2.1.1 + github.com/lestrrat-go/jwx/v2 v2.1.1 github.com/lib/pq v1.10.9 + github.com/manifoldco/promptui v0.9.0 + github.com/mcuadros/go-defaults v1.2.0 + github.com/mitchellh/go-homedir v1.1.0 + github.com/nyaruka/phonenumbers v1.4.0 + github.com/oklog/ulid/v2 v2.1.0 + github.com/openfga/go-sdk v0.5.0 github.com/ory/dockertest v3.3.5+incompatible github.com/panta/machineid v1.0.2 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.20.0 + github.com/posthog/posthog-go v1.2.20 + github.com/pressly/goose/v3 v3.21.1 + github.com/prometheus/client_golang v1.20.2 + github.com/rShetty/asyncwait v0.0.0-20180203043142-1e02703eb90e + github.com/ravilushqa/otelgqlgen v0.16.0 github.com/redis/go-redis/v9 v9.6.1 + github.com/samber/lo v1.47.0 + github.com/spf13/cobra v1.8.1 + github.com/stoewer/go-strcase v1.3.0 github.com/stretchr/testify v1.9.0 + github.com/theopenlane/dbx v0.1.0 + github.com/theopenlane/echo-prometheus v0.1.0 github.com/theopenlane/echox v0.1.0 - github.com/theopenlane/utils v0.1.0 + github.com/theopenlane/echozap v0.1.0 + github.com/theopenlane/entx v0.1.3 + github.com/theopenlane/httpsling v0.1.0 + github.com/theopenlane/iam v0.1.0 + github.com/theopenlane/utils v0.1.1 github.com/tursodatabase/libsql-client-go v0.0.0-20240812094001-348a4e45b535 - go.opentelemetry.io/otel v1.28.0 - go.opentelemetry.io/otel/sdk v1.28.0 + github.com/valyala/bytebufferpool v1.0.0 + github.com/vektah/gqlparser/v2 v2.5.16 + github.com/vmihailenco/msgpack/v5 v5.4.1 + github.com/wundergraph/graphql-go-tools v1.67.4 + go.opentelemetry.io/otel v1.29.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 + go.opentelemetry.io/otel/sdk v1.29.0 go.uber.org/zap v1.27.0 + gocloud.dev v0.39.0 + golang.org/x/crypto v0.26.0 + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 golang.org/x/oauth2 v0.22.0 - google.golang.org/api v0.192.0 + golang.org/x/term v0.23.0 + golang.org/x/text v0.17.0 + golang.org/x/tools v0.24.0 + google.golang.org/api v0.194.0 modernc.org/sqlite v1.32.0 ) require ( - cloud.google.com/go/auth v0.8.1 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect + ariga.io/atlas v0.26.1 // indirect + cloud.google.com/go/auth v0.9.1 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect cloud.google.com/go/compute/metadata v0.5.0 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect - github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect + github.com/XSAM/otelsql v0.32.0 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/agnivade/levenshtein v1.1.1 // indirect + github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/boombuler/barcode v1.0.2 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/chzyer/readline v1.5.1 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect github.com/coder/websocket v1.8.12 // indirect github.com/containerd/continuity v0.4.3 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/danieljoos/wincred v1.2.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dlclark/regexp2 v1.11.4 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/eapache/go-resiliency v1.7.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/go-jose/go-jose/v4 v4.0.2 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/go-faster/errors v0.7.1 // indirect + github.com/go-faster/jx v1.1.0 // indirect + github.com/go-faster/yaml v0.4.6 // indirect + github.com/go-jose/go-jose/v4 v4.0.4 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-playground/validator/v10 v10.15.5 // indirect - github.com/go-webauthn/x v0.1.12 // indirect + github.com/go-openapi/inflect v0.21.0 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-webauthn/x v0.1.14 // indirect github.com/goccy/go-json v0.10.3 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect + github.com/google/cel-go v0.21.0 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-tpm v0.9.1 // indirect github.com/google/s2a-go v0.1.8 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/hcl/v2 v2.22.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect github.com/jcmturner/gofork v1.7.6 // indirect github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/karlseguin/ccache/v3 v3.0.5 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/httprc v1.0.6 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/option v1.0.1 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mfridman/interpolate v0.0.2 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/hashstructure v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/natefinch/wrap v0.2.0 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/ogen-go/ogen v1.3.0 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect - github.com/opencontainers/runc v1.1.12 // indirect + github.com/opencontainers/runc v1.1.13 // indirect + github.com/openfga/api/proto v0.0.0-20240807201305-c96ec773cae9 // indirect + github.com/openfga/language/pkg/go v0.2.0-beta.0 // indirect + github.com/openfga/openfga v1.5.9 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/pquerna/otp v1.4.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.6.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/segmentio/asm v1.2.0 // indirect + github.com/sendgrid/rest v2.6.9+incompatible // indirect + github.com/sendgrid/sendgrid-go v3.16.0+incompatible // indirect + github.com/sethvargo/go-retry v0.3.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect + github.com/sosodev/duration v1.3.1 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.7.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.19.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/urfave/cli/v2 v2.27.4 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect + github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect github.com/yuin/gopher-lua v1.1.1 // indirect + github.com/zclconf/go-cty v1.15.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect - go.opentelemetry.io/otel/metric v1.28.0 // indirect - go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/contrib v1.29.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/arch v0.8.0 // indirect - golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect + golang.org/x/arch v0.9.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools v2.2.0+incompatible // indirect - modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b // indirect - modernc.org/libc v1.55.3 // indirect + modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a // indirect + modernc.org/libc v1.59.9 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.8.0 // indirect modernc.org/strutil v1.2.0 // indirect modernc.org/token v1.1.0 // indirect ) - -require ( - github.com/IBM/sarama v1.43.3 - github.com/alitto/pond v1.9.1 - github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/coreos/go-oidc/v3 v3.11.0 - github.com/fatih/color v1.17.0 // indirect - github.com/go-webauthn/webauthn v0.11.1 - github.com/goccy/go-yaml v1.12.0 - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/lestrrat-go/jwx/v2 v2.1.1 - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/oklog/ulid/v2 v2.1.0 - github.com/posthog/posthog-go v1.2.16 - github.com/segmentio/asm v1.2.0 // indirect - github.com/valyala/bytebufferpool v1.0.0 - github.com/valyala/fasttemplate v1.2.2 // indirect - github.com/vmihailenco/msgpack/v5 v5.4.1 - github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 - golang.org/x/crypto v0.26.0 - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect - golang.org/x/time v0.6.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/go.sum b/go.sum index fc5d939..2767eae 100644 --- a/go.sum +++ b/go.sum @@ -1,37 +1,84 @@ +ariga.io/atlas v0.26.1 h1:UwLn9sXgcuoo9/A3sxXhDqnOImXUcaYb2JqVP0FQciw= +ariga.io/atlas v0.26.1/go.mod h1:KPLc7Zj+nzoXfWshrcY1RwlOh94dsATQEy4UPrF2RkM= +ariga.io/entcache v0.1.0 h1:nfJXzjB5CEvAK6SmjupHREMJrKLakeqU5tG3s4TO6JA= +ariga.io/entcache v0.1.0/go.mod h1:3Z1Sql5bcqPA1YV/jvMlZyh9T+ntSFOclaASAm1TiKQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go/auth v0.8.1 h1:QZW9FjC5lZzN864p13YxvAtGUlQ+KgRL+8Sg45Z6vxo= -cloud.google.com/go/auth v0.8.1/go.mod h1:qGVp/Y3kDRSDZ5gFD/XPUfYQ9xW1iI7q8RIRoCyBbJc= -cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI= -cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I= +cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= +cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= +cloud.google.com/go/auth v0.9.1 h1:+pMtLEV2k0AXKvs/tGZojuj6QaioxfUjOpMsG5Gtx+w= +cloud.google.com/go/auth v0.9.1/go.mod h1:Sw8ocT5mhhXxFklyhT12Eiy0ed6tTrPMCJjSI8KhYLk= +cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= +cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= -entgo.io/ent v0.14.0 h1:EO3Z9aZ5bXJatJeGqu/EVdnNr6K4mRq3rWe5owt0MC4= -entgo.io/ent v0.14.0/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A= +cloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4= +cloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus= +cloud.google.com/go/kms v1.18.5 h1:75LSlVs60hyHK3ubs2OHd4sE63OAMcM2BdSJc2bkuM4= +cloud.google.com/go/kms v1.18.5/go.mod h1:yXunGUGzabH8rjUPImp2ndHiGolHeWJJ0LODLedicIY= +cloud.google.com/go/longrunning v0.5.12 h1:5LqSIdERr71CqfUsFlJdBpOkBH8FBCFD7P1nTWy3TYE= +cloud.google.com/go/longrunning v0.5.12/go.mod h1:S5hMV8CDJ6r50t2ubVJSKQVv5u0rmik5//KgLO3k4lU= +entgo.io/contrib v0.6.0 h1:xfo4TbJE7sJZWx7BV7YrpSz7IPFvS8MzL3fnfzZjKvQ= +entgo.io/contrib v0.6.0/go.mod h1:3qWIseJ/9Wx2Hu5zVh15FDzv7d/UvKNcYKdViywWCQg= +entgo.io/ent v0.14.1 h1:fUERL506Pqr92EPHJqr8EYxbPioflJo6PudkrEA8a/s= +entgo.io/ent v0.14.1/go.mod h1:MH6XLG0KXpkcDQhKiHfANZSzR55TJyPL5IGNpI8wpco= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= +github.com/99designs/gqlgen v0.17.49 h1:b3hNGexHd33fBSAd4NDT/c3NCcQzcAVkknhN9ym36YQ= +github.com/99designs/gqlgen v0.17.49/go.mod h1:tC8YFVZMed81x7UJ7ORUwXF4Kn6SXuucFqQBhN8+BU0= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/IBM/sarama v1.43.3 h1:Yj6L2IaNvb2mRBop39N7mmJAHBVY3dTPncr3qGVkxPA= github.com/IBM/sarama v1.43.3/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 h1:ZBbLwSJqkHBuFDA6DUhhse0IGJ7T5bemHyNILUjvOq4= +github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2/go.mod h1:VSw57q4QFiWDbRnjdX8Cb3Ow0SFncRw+bA/ofY6Q83w= +github.com/XSAM/otelsql v0.32.0 h1:vDRE4nole0iOOlTaC/Bn6ti7VowzgxK39n3Ll1Kt7i0= +github.com/XSAM/otelsql v0.32.0/go.mod h1:Ary0hlyVBbaSwo8atZB8Aoothg9s/LBJj/N/p5qDmLM= +github.com/Yamashou/gqlgenc v0.24.0 h1:Aeufjb2zF0XxkeSTAVQ+DfiHL+ney/M2ovShZozBmHw= +github.com/Yamashou/gqlgenc v0.24.0/go.mod h1:3QQD8ZoeEyVXuzqcMDsl8OfCCCTk+ulaxkvFFQDupIA= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= +github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= github.com/alicebob/miniredis/v2 v2.33.0/go.mod h1:MhP4a3EU7aENRi9aO+tHfTBZicLqQevyi/DJpoj6mi0= github.com/alitto/pond v1.9.1 h1:OfCpIrMyrWJpn34f647DcFmUxjK8+7Nu3eoVN/WTP+o= github.com/alitto/pond v1.9.1/go.mod h1:xQn3P/sHTYcU/1BR3i86IGIrilcrGC2LiS+E2+CJWsI= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +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/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= 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/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.2 h1:79yrbttoZrLGkL/oOI8hBrUKucwOL0oOjUgEguGMcJ4= +github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/brianvoe/gofakeit/v7 v7.0.4 h1:Mkxwz9jYg8Ad8NvT9HA27pCMZGFQo08MK6jD0QTKEww= +github.com/brianvoe/gofakeit/v7 v7.0.4/go.mod h1:QXuPeBw164PJCzCUZVmgpgHJ3Llj49jSLVkKPMtxtxA= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/bytedance/sonic v1.12.1 h1:jWl5Qz1fy7X1ioY74WqO0KjAMtAGQs4sYnjiEBiyX24= -github.com/bytedance/sonic v1.12.1/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +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/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg= +github.com/bytedance/sonic v1.12.2/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -42,6 +89,15 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= @@ -54,6 +110,10 @@ github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7b github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/coreos/go-oidc/v3 v3.11.0 h1:Ia3MxdwpSw702YW0xgfmP1GVCMA9aEFWu12XUZ3/OtI= github.com/coreos/go-oidc/v3 v3.11.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0= +github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -62,53 +122,99 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnN github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= +github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 h1:aYo8nnk3ojoQkP5iErif5Xxv0Mo0Ga/FR5+ffl/7+Nk= +github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0/go.mod h1:8AuBTZBRSFqEYBPYULd+NN474/zZBLP+6WeT5S9xlAc= +github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9TzqvtQZPo= +github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +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= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= +github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/go-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk= -github.com/go-jose/go-jose/v4 v4.0.2/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= +github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= +github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= +github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= +github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg= +github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo= +github.com/go-faster/jx v1.1.0 h1:ZsW3wD+snOdmTDy9eIVgQdjUpXRRV4rqW8NS3t+20bg= +github.com/go-faster/jx v1.1.0/go.mod h1:vKDNikrKoyUmpzaJ0OkIkRQClNHFX/nF3dnTJZb3skg= +github.com/go-faster/yaml v0.4.6 h1:lOK/EhI04gCpPgPhgt0bChS6bvw7G3WwI8xxVe0sw9I= +github.com/go-faster/yaml v0.4.6/go.mod h1:390dRIvV4zbnO7qC9FGo6YYutc+wyyUSHBgbXL52eXk= +github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E= +github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-openapi/inflect v0.21.0 h1:FoBjBTQEcbg2cJUWX6uwL9OyIW8eqc9k4KhN4lfbeYk= +github.com/go-openapi/inflect v0.21.0/go.mod h1:INezMuUu7SJQc2AyR3WO0DqqYUJSj8Kb4hBd7WtjlAw= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-redis/redismock/v8 v8.0.6 h1:rtuijPgGynsRB2Y7KDACm09WvjHWS4RaG44Nm7rcj4Y= +github.com/go-redis/redismock/v8 v8.0.6/go.mod h1:sDIF73OVsmaKzYe/1FJXGiCQ4+oHYbzjpaL9Vor0sS4= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-webauthn/webauthn v0.11.1 h1:5G/+dg91/VcaJHTtJUfwIlNJkLwbJCcnUc4W8VtkpzA= github.com/go-webauthn/webauthn v0.11.1/go.mod h1:YXRm1WG0OtUyDFaVAgB5KG7kVqW+6dYCJ7FTQH4SxEE= -github.com/go-webauthn/x v0.1.12 h1:RjQ5cvApzyU/xLCiP+rub0PE4HBZsLggbxGR5ZpUf/A= -github.com/go-webauthn/x v0.1.12/go.mod h1:XlRcGkNH8PT45TfeJYc6gqpOtiOendHhVmnOxh+5yHs= +github.com/go-webauthn/x v0.1.14 h1:1wrB8jzXAofojJPAaRxnZhRgagvLGnLjhCAwg3kTpT0= +github.com/go-webauthn/x v0.1.14/go.mod h1:UuVvFZ8/NbOnkDz3y1NaxtUN87pmtpC1PQ+/5BBQRdc= +github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 h1:FWNFq4fM1wPfcK40yHE5UO3RUdSNPaBC+j3PokzA6OQ= +github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.12.0 h1:/1WHjnMsI1dlIBQutrvSMGZRQufVO3asrHfTwfACoPM= github.com/goccy/go-yaml v1.12.0/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -125,8 +231,12 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/cel-go v0.21.0 h1:cl6uW/gxN+Hy50tNYvI691+sXxioCnstFzLp2WO4GCI= +github.com/google/cel-go v0.21.0/go.mod h1:rHUlWCcBKgyEk+eV03RPdZUekPp6YcJwV0FxuUksYxc= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -151,28 +261,52 @@ github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= -github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI= +github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA= +github.com/googleapis/enterprise-certificate-proxy v0.3.3 h1:QRje2j5GZimBzlbhGA2V2QlGNgL8G6e+wGo/+/2bWI0= +github.com/googleapis/enterprise-certificate-proxy v0.3.3/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/hcl/v2 v2.22.0 h1:hkZ3nCtqeJsDhPRFz5EA9iwcG1hNWGePOTw6oyul12M= +github.com/hashicorp/hcl/v2 v2.22.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= +github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= +github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= +github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= +github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= +github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= +github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww= +github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= @@ -185,20 +319,40 @@ github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh6 github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/jensneuse/diffview v1.0.0 h1:4b6FQJ7y3295JUHU3tRko6euyEboL825ZsXeZZM47Z4= +github.com/jensneuse/diffview v1.0.0/go.mod h1:i6IacuD8LnEaPuiyzMHA+Wfz5mAuycMOf3R/orUY9y4= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/karlseguin/ccache/v3 v3.0.5 h1:hFX25+fxzNjsRlREYsoGNa2LoVEw5mPF8wkWq/UnevQ= +github.com/karlseguin/ccache/v3 v3.0.5/go.mod h1:qxC372+Qn+IBj8Pe3KvGjHPj0sWwEF7AeZVhsNPZ6uY= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/parsers/yaml v0.1.0 h1:ZZ8/iGfRLvKSaMEECEBPM1HQslrZADk8fP1XFUxVI5w= +github.com/knadh/koanf/parsers/yaml v0.1.0/go.mod h1:cvbUDC7AL23pImuQP0oRw/hPuccrNBS2bps8asS0CwY= +github.com/knadh/koanf/providers/env v0.1.0 h1:LqKteXqfOWyx5Ab9VfGHmjY9BvRXi+clwyZozgVRiKg= +github.com/knadh/koanf/providers/env v0.1.0/go.mod h1:RE8K9GbACJkeEnkl8L/Qcj8p4ZyPXZIQ191HJi44ZaQ= +github.com/knadh/koanf/providers/file v1.1.0 h1:MTjA+gRrVl1zqgetEAIaXHqYje0XSosxSiMD4/7kz0o= +github.com/knadh/koanf/providers/file v1.1.0/go.mod h1:/faSBcv2mxPVjFrXck95qeoyoZ5myJ6uxN8OOVNJJCI= +github.com/knadh/koanf/providers/posflag v0.1.0 h1:mKJlLrKPcAP7Ootf4pBZWJ6J+4wHYujwipe7Ie3qW6U= +github.com/knadh/koanf/providers/posflag v0.1.0/go.mod h1:SYg03v/t8ISBNrMBRMlojH8OsKowbkXV7giIbBVgbz0= +github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= +github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= 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/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k= github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= @@ -213,30 +367,86 @@ github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNB github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mcuadros/go-defaults v1.2.0 h1:FODb8WSf0uGaY8elWJAkoLL0Ri6AlZ1bFlenk56oZtc= +github.com/mcuadros/go-defaults v1.2.0/go.mod h1:WEZtHEVIGYVDqkKSWBdWKUVdRyKlMfulPaGDWIVeCWY= +github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= +github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= +github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/natefinch/wrap v0.2.0 h1:IXzc/pw5KqxJv55gV0lSOcKHYuEZPGbQrOOXr/bamRk= +github.com/natefinch/wrap v0.2.0/go.mod h1:6gMHlAl12DwYEfKP3TkuykYUfLSEAvHw67itm4/KAS8= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/nyaruka/phonenumbers v1.4.0 h1:ddhWiHnHCIX3n6ETDA58Zq5dkxkjlvgrDWM2OHHPCzU= +github.com/nyaruka/phonenumbers v1.4.0/go.mod h1:gv+CtldaFz+G3vHHnasBSirAi3O2XLqZzVWz4V1pl2E= +github.com/ogen-go/ogen v1.3.0 h1:c0+CvdbwvKmaHQUqbPpRKflvkiJ/NAsEw3L3HhofDso= +github.com/ogen-go/ogen v1.3.0/go.mod h1:421U7mQVAE+7uaCc4tkq2uT0HDfZL13UTpL16CBrFt0= github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU= github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= -github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= -github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= +github.com/opencontainers/runc v1.1.13 h1:98S2srgG9vw0zWcDpFMn5TRrh8kLxa/5OFUstuUhmRs= +github.com/opencontainers/runc v1.1.13/go.mod h1:R016aXacfp/gwQBYw2FDGa9m+n6atbLWrYY8hNMT/sA= +github.com/openfga/api/proto v0.0.0-20240807201305-c96ec773cae9 h1:Y0fIAHrYECcf5lpa/o1AbH21bS7rsco/FoH4A4NGlZE= +github.com/openfga/api/proto v0.0.0-20240807201305-c96ec773cae9/go.mod h1:gil5LBD8tSdFQbUkCQdnXsoeU9kDJdJgbGdHkgJfcd0= +github.com/openfga/go-sdk v0.5.0 h1:1IuAu6Xf4eBxgc2AyMfosK7QzApxuZ5yi7jmFaftnl0= +github.com/openfga/go-sdk v0.5.0/go.mod h1:AoMnFlPw65sU/7O4xOPpCb2vXA8ZD9K9xp2hZjcvt4g= +github.com/openfga/language/pkg/go v0.2.0-beta.0 h1:dTvgDkQImfNnH1iDvxnUIbz4INvKr4kS46dI12oAEzM= +github.com/openfga/language/pkg/go v0.2.0-beta.0/go.mod h1:mCwEY2IQvyNgfEwbfH0C0ERUwtL8z6UjSAF8zgn5Xbg= +github.com/openfga/openfga v1.5.9 h1:1x+9YdBOzbYPbkEUZjPPYt255GXDUbouC0ConpMRtL8= +github.com/openfga/openfga v1.5.9/go.mod h1:1OF1qR8nXdIirtosRZq0mPx5B6nuY5phPGk61Yh+9Lc= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/panta/machineid v1.0.2 h1:LVYeEq1hZ+FwcM+/H6eB8KfXM2R5b2h1SWdnWwZ0OQw= github.com/panta/machineid v1.0.2/go.mod h1:AROj156fsca3R3rNw3q9h8xFkos25W9P0ZG9gu+3Uf0= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -244,10 +454,14 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posthog/posthog-go v1.2.16 h1:mnK58b6LDzosrZFZHf2bZQJINJhn60wBvXmdMCuSw/I= -github.com/posthog/posthog-go v1.2.16/go.mod h1:QjlpryJtfYLrZF2GUkAhejH4E7WlDbdKkvOi5hLmkdg= -github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= -github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/posthog/posthog-go v1.2.20 h1:gH62ssImK6xRKbYgmaW+sIPqvXBtu6iYjRR3f4lLIoA= +github.com/posthog/posthog-go v1.2.20/go.mod h1:QjlpryJtfYLrZF2GUkAhejH4E7WlDbdKkvOi5hLmkdg= +github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg= +github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= +github.com/pressly/goose/v3 v3.21.1 h1:5SSAKKWej8LVVzNLuT6KIvP1eFDuPvxa+B6H0w78buQ= +github.com/pressly/goose/v3 v3.21.1/go.mod h1:sqthmzV8PitchEkjecFJII//l43dLOCzfWh8pHEe+vE= +github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= +github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= @@ -255,21 +469,65 @@ github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rShetty/asyncwait v0.0.0-20180203043142-1e02703eb90e h1:JGv2d5lATeXBDtgpLKS7emfoBGh8H+LNDqm94kRozIc= +github.com/rShetty/asyncwait v0.0.0-20180203043142-1e02703eb90e/go.mod h1:YNFw1n0p4qcSXP3vvmzYGzFIeCukWn2NGmwWrYBPQS8= +github.com/ravilushqa/otelgqlgen v0.16.0 h1:tEryUp/Kai5lccgA0Hl0lb/LUdJmqIJT31HwwxaYiUM= +github.com/ravilushqa/otelgqlgen v0.16.0/go.mod h1:72/ZmqsGciNzAEYavQRKqhiRaZ4piW/Fjk4xLnG3SAg= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= +github.com/sagikazarmark/locafero v0.6.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc= +github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= +github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y= +github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= +github.com/sendgrid/rest v2.6.9+incompatible h1:1EyIcsNdn9KIisLW50MKwmSRSK+ekueiEMJ7NEoxJo0= +github.com/sendgrid/rest v2.6.9+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE= +github.com/sendgrid/sendgrid-go v3.16.0+incompatible h1:i8eE6IMkiCy7vusSdacHHSBUpXyTcTXy/Rl9N9aZ/Qw= +github.com/sendgrid/sendgrid-go v3.16.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8= +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/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE= +github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 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.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -278,57 +536,97 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/theopenlane/dbx v0.1.0 h1:hjaaruFBwLQ8yHDAN3P68j8hYbdkJE3fb0ynAwTidOY= +github.com/theopenlane/dbx v0.1.0/go.mod h1:SJm0TRYqkqC+Ap+G32zgK96OkujZvtHTqWQXmzo8ZRg= +github.com/theopenlane/echo-prometheus v0.1.0 h1:1zMejBVHe5w4zLHS+k5FV9S/46QBiwO6ggTSKi6r/7E= +github.com/theopenlane/echo-prometheus v0.1.0/go.mod h1:Eiiv1ZLXKMsteQ3T+H1tFfSSZuXSvQfZp95qr5hmGkA= github.com/theopenlane/echox v0.1.0 h1:y4Z2shaODCLwXHsHBrY/EkH/2sIuo49xdIfxx7h+Zvg= github.com/theopenlane/echox v0.1.0/go.mod h1:RaynhPvY9qbLOVlcO7Js1NqZ66+CP9hVBa0c7ehNYA4= -github.com/theopenlane/utils v0.1.0 h1:PjKNn1FuYERYzMuEvdilHJxiiMYkcMlnCqImItrJTK0= -github.com/theopenlane/utils v0.1.0/go.mod h1:37sJeeuIsmMbMFE2nKglmEQUJenTccxh5WxkJtyuZUw= +github.com/theopenlane/echozap v0.1.0 h1:qoD1tEGQoTMPrzleOymk6auLHJcQmzPLprCEvoXNKDE= +github.com/theopenlane/echozap v0.1.0/go.mod h1:E3Fkzb6QvEsx9KxxpUv9dpxUvKjxAEUZSEtkYeCXLok= +github.com/theopenlane/entx v0.1.3 h1:nn8rZINR7HSIetYnuygdP19MuQ1rwtW/HJILjwIxfag= +github.com/theopenlane/entx v0.1.3/go.mod h1:zuivUo6xLwo/BfH/DeOpCY/byGxzMkcLOC7h6FqngNQ= +github.com/theopenlane/httpsling v0.1.0 h1:IHWUSo213stJTmHOHjNIg5b3npgpchzMdPMY7jAkimI= +github.com/theopenlane/httpsling v0.1.0/go.mod h1:wOyNfO4moIbmP4stQc9Kasgp+Q4sODo3LOLwvjUe/PA= +github.com/theopenlane/iam v0.1.0 h1:mCppGnYXu9/4wlGq/wHfLKMjZmWrqD0ObGfPqEo3pAs= +github.com/theopenlane/iam v0.1.0/go.mod h1:kLevqysp3XiR/StZIjtUGLd+cDhPRxKKzusj/ZAgU7M= +github.com/theopenlane/utils v0.1.1 h1:GoPrIE8tmmC1VGlp+QmVTvrgBlHwe8e8FqLw2IPdgmY= +github.com/theopenlane/utils v0.1.1/go.mod h1:37sJeeuIsmMbMFE2nKglmEQUJenTccxh5WxkJtyuZUw= github.com/tursodatabase/libsql-client-go v0.0.0-20240812094001-348a4e45b535 h1:iLjJLq2A5J6L9zrhyNn+fpmxFvtEpYB4XLMr0rX3epI= github.com/tursodatabase/libsql-client-go v0.0.0-20240812094001-348a4e45b535/go.mod h1:l8xTsYB90uaVdMHXMCxKKLSgw5wLYBwBKKefNIUnm9s= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= +github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0vy5p8= +github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= +github.com/wundergraph/graphql-go-tools v1.67.4 h1:1QtoftaZz5sScV/J6XLZ/oTfi1lMHp6UmFkYRQfY2/g= +github.com/wundergraph/graphql-go-tools v1.67.4/go.mod h1:UFvflYjB/qnSCdgcHQuE6dTfwZ6viJB7yPnGOtBuibo= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= -go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= -go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03ymgYhPKmeXGk5Zu+cIZOlVzd9Zv7QIiyItjFBU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= -go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= -go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= -go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= -go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= -go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= -go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/contrib v1.29.0 h1:fLxD2N918DFRlES8q9iv2yE7iIFlaIMZ7ek0D6qJMqk= +go.opentelemetry.io/contrib v1.29.0/go.mod h1:Tmhw9grdWtmXy6DxZNpIAudzYJqLeEM2P6QTZQSRwU8= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= +go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= +go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= +go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= +go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= +go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= +go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +gocloud.dev v0.39.0 h1:EYABYGhAalPUaMrbSKOr5lejxoxvXj99nE8XFtsDgds= +gocloud.dev v0.39.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ= +golang.org/x/arch v0.9.0 h1:ub9TgUInamJ8mrZIGlBG6/4TqWeMszd4N8lNorbrr6k= +golang.org/x/arch v0.9.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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= @@ -336,8 +634,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58 golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -368,23 +666,27 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.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-20181122145206-62eef0e2fa9b/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-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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/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.0.0-20220811171246-fbc7d0a398ab/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.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= 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.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -404,19 +706,21 @@ golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= -golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -google.golang.org/api v0.192.0 h1:PljqpNAfZaaSpS+TnANfnNAXKdzHM/B9bKhwRlo7JP0= -google.golang.org/api v0.192.0/go.mod h1:9VcphjvAxPKLmSxVSzPlSRXy/5ARMEw5bf58WoVXafQ= +golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk= +golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= +google.golang.org/api v0.194.0 h1:dztZKG9HgtIpbI35FhfuSNR/zmaMVdxNlntHj1sIS4s= +google.golang.org/api v0.194.0/go.mod h1:AgvUFdojGANh3vI+P7EVnxj3AISHllxGCJSFmggmnd0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142 h1:oLiyxGgE+rt22duwci1+TG7bg2/L1LQsXwfjPlmuJA0= +google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142/go.mod h1:G11eXq53iI5Q+kyNOmCvnzBaxEA2Q/Ik5Tj7nqBE8j4= +google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw= +google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -436,9 +740,17 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/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/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -448,16 +760,16 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= -modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y= -modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s= +modernc.org/ccgo/v4 v4.20.7 h1:skrinQsjxWfvj6nbC3ztZPJy+NuwmB3hV9zX/pthNYQ= +modernc.org/ccgo/v4 v4.20.7/go.mod h1:UOkI3JSG2zT4E2ioHlncSOZsXbuDCZLvPi3uMlZT5GY= modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= -modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= -modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= -modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b h1:BnN1t+pb1cy61zbvSUV7SeI0PwosMhlAEi/vBY4qxp8= -modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= -modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U= -modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w= +modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M= +modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= +modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a h1:CfbpOLEo2IwNzJdMvE8aiRbPMxoTpgAJeyePh0SmO8M= +modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.59.9 h1:k+nNDDakwipimgmJ1D9H466LhFeSkaPPycAs1OZiDmY= +modernc.org/libc v1.59.9/go.mod h1:EY/egGEU7Ju66eU6SBqCNYaFUDuc4npICkMWnU5EE3A= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= diff --git a/gqlgen.yml b/gqlgen.yml new file mode 100644 index 0000000..5dc0076 --- /dev/null +++ b/gqlgen.yml @@ -0,0 +1,84 @@ +schema: + - schema/*.graphql +exec: + filename: internal/graphapi/gen_server.go + package: graphapi + +model: + filename: internal/graphapi/gen_models.go + package: graphapi +resolver: + layout: follow-schema + dir: internal/graphapi + package: graphapi + filename_template: "{name}.resolvers.go" + # omit_template_comment: false +struct_tag: json +# Optional: turn on to use []Thing instead of []*Thing +# omit_slice_element_pointers: false + +# Optional: turn on to omit Is() methods to interface and unions +# omit_interface_checks : true + +# Optional: turn on to skip generation of ComplexityRoot struct content and Complexity function +# omit_complexity: false + +# Optional: turn on to not generate any file notice comments in generated files +# omit_gqlgen_file_notice: false + +# Optional: turn on to exclude the gqlgen version in the generated file notice. No effect if `omit_gqlgen_file_notice` is true. +omit_gqlgen_version_in_file_notice: true +# Optional: turn off to make struct-type struct fields not use pointers +# e.g. type Thing struct { FieldA OtherThing } instead of { FieldA *OtherThing } +# struct_fields_always_pointers: true + +# Optional: turn off to make resolvers return values instead of pointers for structs +# resolvers_always_return_pointers: true + +# Optional: turn on to return pointers instead of values in unmarshalInput +# return_pointers_in_unmarshalinput: false + +# Optional: wrap nullable input fields with Omittable +# nullable_input_omittable: true + +# Optional: set to speed up generation time by not performing a final validation pass. +# skip_validation: true + +# Optional: set to skip running `go mod tidy` when generating server code +# skip_mod_tidy: true + +# gqlgen will search for any type names in the schema in these go packages +# if they match it will use them, otherwise it will generate them. +autobind: + - "github.com/theopenlane/core/internal/graphapi" + - "github.com/theopenlane/core/internal/ent/generated" +# This section declares type mapping between the GraphQL and go type systems +# +# The first line in each type will be used as defaults for resolver arguments and +# modelgen, the others will be allowed when binding to fields. Configure them to +# your liking +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.String + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Uint: + model: + - github.com/99designs/gqlgen/graphql.Uint + - github.com/99designs/gqlgen/graphql.Uint64 + - github.com/99designs/gqlgen/graphql.Uint32 + - github.com/theopenlane/core/internal/ent/customtypes.Uint8 + Node: + model: + - github.com/theopenlane/core/internal/ent/generated.Noder + JSON: + model: + - github.com/theopenlane/entx.RawMessage + - github.com/theopenlane/core/internal/ent/customtypes.JSONObject + Any: + model: + - github.com/99designs/gqlgen/graphql.Any diff --git a/gqlgenc.yml b/gqlgenc.yml new file mode 100644 index 0000000..c3d8840 --- /dev/null +++ b/gqlgenc.yml @@ -0,0 +1,23 @@ +model: + package: coreclient + filename: ./pkg/coreclient/models.go +client: + package: coreclient + filename: ./pkg/coreclient/graphclient.go +models: + Int: + model: github.com/99designs/gqlgen/graphql.Int64 + ID: + model: + - github.com/99designs/gqlgen/graphql.String + JSON: + model: + - github.com/theopenlane/entx.RawMessage + - github.com/theopenlane/core/internal/ent/customtypes.JSONObject +schema: ["schema.graphql"] +query: ["query/*.graphql"] +generate: + clientV2: true + clientInterfaceName: "OpenLaneGraphClient" + query: false + mutation: false diff --git a/internal/constants/doc.go b/internal/constants/doc.go new file mode 100644 index 0000000..4a36ed7 --- /dev/null +++ b/internal/constants/doc.go @@ -0,0 +1,2 @@ +// Package constants contains constants used throughout the application +package constants diff --git a/internal/constants/version.go b/internal/constants/version.go new file mode 100644 index 0000000..92562a1 --- /dev/null +++ b/internal/constants/version.go @@ -0,0 +1,76 @@ +package constants + +import ( + "runtime/debug" + "strings" + "text/template" +) + +var ( + // CLIVersion is the version of the application. Note that this is + // set at compile time using ldflags. + CLIVersion = "no-info" + // VerboseCLIVersion is the verbose version of the application. + // Note that this is set up at init time. + VerboseCLIVersion = "" +) + +type versionStruct struct { + Version string + GoVersion string + Time string + Commit string + OS string + Arch string + Modified bool +} + +const ( + verboseTemplate = `Version: {{.Version}} +Go Version: {{.GoVersion}} +Git Commit: {{.Commit}} +Commit Date: {{.Time}} +OS/Arch: {{.OS}}/{{.Arch}} +Dirty: {{.Modified}}` +) + +func init() { + bi, ok := debug.ReadBuildInfo() + if !ok { + return + } + + var vvs versionStruct + + vvs.Version = CLIVersion + vvs.GoVersion = bi.GoVersion + + for _, kv := range bi.Settings { + switch kv.Key { + case "vcs.time": + vvs.Time = kv.Value + case "vcs.revision": + vvs.Commit = kv.Value + case "vcs.modified": + vvs.Modified = kv.Value == "true" + case "GOOS": + vvs.OS = kv.Value + case "GOARCH": + vvs.Arch = kv.Value + } + } + + VerboseCLIVersion = vvs.String() +} + +func (vvs *versionStruct) String() string { + stringBuilder := &strings.Builder{} + tmpl := template.Must(template.New("version").Parse(verboseTemplate)) + err := tmpl.Execute(stringBuilder, vvs) + + if err != nil { + panic(err) + } + + return stringBuilder.String() +} diff --git a/internal/ent/base/entinit.tmpl b/internal/ent/base/entinit.tmpl new file mode 100644 index 0000000..61698a1 --- /dev/null +++ b/internal/ent/base/entinit.tmpl @@ -0,0 +1,65 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + + "github.com/theopenlane/core/internal/ent/mixin" +) + +// {{ . }} holds the schema definition for the {{ . }} entity +type {{ . }} struct { + ent.Schema +} + +// Fields of the {{ . }} +func ({{ . }}) Fields() []ent.Field { + return []ent.Field{ + // Fields go here + } +} + +// Mixin of the {{ . }} +func ({{ . }}) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + } +} + +// Edges of the {{ . }} +func ({{ . }}) Edges() []ent.Edge { + return []ent.Edge{ + // Edges go here + } +} + +// Indexes of the {{ . }} +func ({{ . }}) Indexes() []ent.Index { + return []ent.Index{} +} + +// Annotations of the {{ . }} +func ({{ . }}) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + // the above annotations create all the graphQL goodness; if you need the schema only and not the endpoints, use the below annotation instead + // if you do not need the graphql bits, also be certain to add an exclusion to scripts/files_to_skip.txt + entgql.Skip(entgql.SkipAll), + } +} + +// Hooks of the {{ . }} +func ({{ . }}) Hooks() []ent.Hook { + return []ent.Hook{} +} + +// Interceptors of the {{ . }} +func ({{ . }}) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} diff --git a/internal/ent/customtypes/doc.go b/internal/ent/customtypes/doc.go new file mode 100644 index 0000000..9228edc --- /dev/null +++ b/internal/ent/customtypes/doc.go @@ -0,0 +1,2 @@ +// Package customtypes is a custom type definition for ent and the associated interfaces +package customtypes diff --git a/internal/ent/customtypes/jsonobject.go b/internal/ent/customtypes/jsonobject.go new file mode 100644 index 0000000..472b6b5 --- /dev/null +++ b/internal/ent/customtypes/jsonobject.go @@ -0,0 +1,38 @@ +package customtypes + +import ( + "encoding/json" + "io" + "log" +) + +// JSONObject is a custom type for JSON object templates +type JSONObject map[string]interface{} + +// MarshalGQL implement the Marshaler interface for gqlgen +func (j JSONObject) MarshalGQL(w io.Writer) { + byteData, err := json.Marshal(j) + if err != nil { + log.Fatalf("error: %v", err) + } + + _, err = w.Write(byteData) + if err != nil { + log.Fatalf("error: %v", err) + } +} + +// UnmarshalGQL implement the Unmarshaler interface for gqlgen +func (j *JSONObject) UnmarshalGQL(v interface{}) error { + byteData, err := json.Marshal(v) + if err != nil { + return err + } + + err = json.Unmarshal(byteData, &j) + if err != nil { + return err + } + + return err +} diff --git a/internal/ent/customtypes/jsonobject_test.go b/internal/ent/customtypes/jsonobject_test.go new file mode 100644 index 0000000..2f661fc --- /dev/null +++ b/internal/ent/customtypes/jsonobject_test.go @@ -0,0 +1,44 @@ +package customtypes_test + +import ( + "bytes" + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/theopenlane/core/internal/ent/customtypes" +) + +func TestJSONObjectMarshalGQL(t *testing.T) { + obj := customtypes.JSONObject{ + "key1": "value1", + "key2": float64(123), + "key3": true, + } + + var buf bytes.Buffer + + obj.MarshalGQL(&buf) + + var result customtypes.JSONObject + err := json.Unmarshal(buf.Bytes(), &result) + assert.NoError(t, err) + assert.Equal(t, obj, result) +} + +func TestJSONObjectUnmarshalGQL(t *testing.T) { + obj := map[string]interface{}{ + "key1": "value1", + "key2": float64(123), + "key3": true, + } + + var result customtypes.JSONObject + err := result.UnmarshalGQL(obj) + assert.NoError(t, err) + + for k, v := range obj { + assert.Equal(t, v, result[k]) + } +} diff --git a/internal/ent/customtypes/uint8.go b/internal/ent/customtypes/uint8.go new file mode 100644 index 0000000..9a46644 --- /dev/null +++ b/internal/ent/customtypes/uint8.go @@ -0,0 +1,29 @@ +package customtypes + +import ( + "fmt" + "io" + "strconv" + + "github.com/99designs/gqlgen/graphql" +) + +// Uint8 is a custom type for uint8 +type Uint8 uint8 + +// MarshalGQL implements the graphql.Marshaler interface +func (u Uint8) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.FormatUint(uint64(u), 10)) +} + +// UnmarshalGQL implements the graphql.Unmarshaler interface +func (u *Uint8) UnmarshalGQL(v interface{}) error { + i, err := graphql.UnmarshalUint64(v) + if err != nil { + return err + } + + *u = Uint8(i) // nolint:gosec + + return nil +} diff --git a/internal/ent/entc.go b/internal/ent/entc.go new file mode 100644 index 0000000..03568a4 --- /dev/null +++ b/internal/ent/entc.go @@ -0,0 +1,176 @@ +//go:build ignore + +// See Upstream docs for more details: https://entgo.io/docs/code-gen/#use-entc-as-a-package + +package main + +import ( + "log" + "os" + + "entgo.io/contrib/entgql" + "entgo.io/ent/entc" + "entgo.io/ent/entc/gen" + "github.com/theopenlane/iam/entfga" + "github.com/theopenlane/iam/fgax" + "go.uber.org/zap" + "gocloud.dev/secrets" + + dbx "github.com/theopenlane/dbx/pkg/dbxclient" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/genhooks" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/totp" + + "github.com/theopenlane/core/internal/ent/entconfig" + "github.com/theopenlane/core/pkg/analytics" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" +) + +const ( + graphSchemaDir = "./schema/" + graphQueryDir = "./query/" + schemaPath = "./internal/ent/schema" +) + +func main() { + if err := os.Mkdir("schema", 0755); err != nil && !os.IsExist(err) { + log.Fatalf("creating schema directory: %v", err) + } + + // generate the history schemas + historyExt, entfgaExt := preRun() + + xExt, err := entx.NewExtension(entx.WithJSONScalar()) + if err != nil { + log.Fatalf("creating entx extension: %v", err) + } + + gqlExt, err := entgql.NewExtension( + entgql.WithSchemaGenerator(), + entgql.WithSchemaPath("schema/ent.graphql"), + entgql.WithConfigPath("gqlgen.yml"), + entgql.WithWhereInputs(true), + entgql.WithSchemaHook(xExt.GQLSchemaHooks()...), + ) + if err != nil { + log.Fatalf("creating entgql extension: %v", err) + } + + if err := entc.Generate(schemaPath, &gen.Config{ + Target: "./internal/ent/generated", + Templates: entgql.AllTemplates, + Hooks: []gen.Hook{ + genhooks.GenSchema(graphSchemaDir), + genhooks.GenQuery(graphQueryDir), + }, + Package: "github.com/theopenlane/core/internal/ent/generated", + Features: []gen.Feature{ + gen.FeatureVersionedMigration, + gen.FeaturePrivacy, + gen.FeatureEntQL, + gen.FeatureNamedEdges, + gen.FeatureSchemaConfig, + gen.FeatureIntercept, + }, + }, + entc.Dependency( + entc.DependencyName("EntConfig"), + entc.DependencyType(&entconfig.Config{}), + ), + entc.Dependency( + entc.DependencyName("Secrets"), + entc.DependencyType(&secrets.Keeper{}), + ), + entc.Dependency( + entc.DependencyName("Authz"), + entc.DependencyType(fgax.Client{}), + ), + entc.Dependency( + entc.DependencyName("TokenManager"), + entc.DependencyType(&tokens.TokenManager{}), + ), + entc.Dependency( + entc.DependencyName("SessionConfig"), + entc.DependencyType(&sessions.SessionConfig{}), + ), + entc.Dependency( + entc.DependencyName("Logger"), + entc.DependencyType(zap.SugaredLogger{}), + ), + entc.Dependency( + entc.DependencyName("Emails"), + entc.DependencyType(&emails.EmailManager{}), + ), + entc.Dependency( + entc.DependencyName("Marionette"), + entc.DependencyType(&marionette.TaskManager{}), + ), + entc.Dependency( + entc.DependencyName("Analytics"), + entc.DependencyType(&analytics.EventManager{}), + ), + entc.Dependency( + entc.DependencyName("TOTP"), + entc.DependencyType(&totp.Manager{}), + ), + entc.Dependency( + entc.DependencyName("DBx"), + entc.DependencyType(&dbx.Client{}), + ), + entc.TemplateDir("./internal/ent/templates"), + entc.Extensions( + gqlExt, + historyExt, + entfgaExt, + )); err != nil { + log.Fatalf("running ent codegen: %v", err) + } +} + +// preRun runs before the ent codegen to generate the history schemas and authz checks +// and returns the history and fga extensions to be used in the ent codegen +func preRun() (*history.HistoryExtension, *entfga.AuthzExtension) { + // generate the history schemas + historyExt := history.New( + history.WithAuditing(), + history.WithImmutableFields(), + history.WithHistoryTimeIndex(), + history.WithNillableFields(), + history.WithGQLQuery(), + history.WithAuthzPolicy(), + history.WithSchemaPath(schemaPath), + history.WithFirstRun(true), + history.WithAllowedRelation("audit_log_viewer"), + history.WithUpdatedByFromSchema(history.ValueTypeString, false), + ) + + if err := historyExt.GenerateSchemas(); err != nil { + log.Fatalf("generating history schema: %v", err) + } + + // initialize the entfga extension + entfgaExt := entfga.New( + entfga.WithSoftDeletes(), + entfga.WithSchemaPath(schemaPath), + ) + + // generate authz checks, this needs to happen before we regenerate the schema + // because the authz checks are generated based on the schema + if err := entfgaExt.GenerateAuthzChecks(); err != nil { + log.Fatalf("generating authz checks: %v", err) + } + + // run again with policy + historyExt.SetFirstRun(false) + + // generate the updated history schemas with authz checks + if err := historyExt.GenerateSchemas(); err != nil { + log.Fatalf("generating history schema: %v", err) + } + + return historyExt, entfgaExt +} diff --git a/internal/ent/entconfig/config.go b/internal/ent/entconfig/config.go new file mode 100644 index 0000000..be2903a --- /dev/null +++ b/internal/ent/entconfig/config.go @@ -0,0 +1,17 @@ +package entconfig + +// Config holds the configuration for the ent server +type Config struct { + // Flags contains the flags for the server to allow use to test different code paths + Flags Flags `json:"flags" koanf:"flags" jsonschema:"description=flags for the server"` + // EntityTypes is the list of entity types to create by default for the organization + EntityTypes []string `json:"entityTypes" koanf:"entityTypes" default:"" description:"entity types to create for the organization"` +} + +// Flags contains the flags for the server to allow use to test different code paths +type Flags struct { + // UseListUserService is a flag to use the list user service endpoint for users with object access, if false, the core db is used directly instead + UseListUserService bool `json:"useListUserService" koanf:"useListUserService" jsonschema:"description=use list services endpoint for object access" default:"true"` + // UserListObjectService is a flag to use the list object service endpoint for object access for a user, if false, the core db is used directly instead + UseListObjectService bool `json:"useListObjectServices" koanf:"useListObjectServices" jsonschema:"description=use list object services endpoint for object access" default:"false"` +} diff --git a/internal/ent/entconfig/doc.go b/internal/ent/entconfig/doc.go new file mode 100644 index 0000000..ad80f5e --- /dev/null +++ b/internal/ent/entconfig/doc.go @@ -0,0 +1,2 @@ +// Package entconfig holds configuration stuff for the ent server +package entconfig diff --git a/internal/ent/generated/apitoken.go b/internal/ent/generated/apitoken.go new file mode 100644 index 0000000..93678e5 --- /dev/null +++ b/internal/ent/generated/apitoken.go @@ -0,0 +1,305 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// APIToken is the model entity for the APIToken schema. +type APIToken struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name associated with the token + Name string `json:"name,omitempty"` + // Token holds the value of the "token" field. + Token string `json:"token,omitempty"` + // when the token expires + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + // Scopes holds the value of the "scopes" field. + Scopes []string `json:"scopes,omitempty"` + // LastUsedAt holds the value of the "last_used_at" field. + LastUsedAt *time.Time `json:"last_used_at,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the APITokenQuery when eager-loading is set. + Edges APITokenEdges `json:"edges"` + selectValues sql.SelectValues +} + +// APITokenEdges holds the relations/edges for other nodes in the graph. +type APITokenEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,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 +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e APITokenEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*APIToken) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case apitoken.FieldTags, apitoken.FieldScopes: + values[i] = new([]byte) + case apitoken.FieldID, apitoken.FieldCreatedBy, apitoken.FieldUpdatedBy, apitoken.FieldDeletedBy, apitoken.FieldMappingID, apitoken.FieldOwnerID, apitoken.FieldName, apitoken.FieldToken, apitoken.FieldDescription: + values[i] = new(sql.NullString) + case apitoken.FieldCreatedAt, apitoken.FieldUpdatedAt, apitoken.FieldDeletedAt, apitoken.FieldExpiresAt, apitoken.FieldLastUsedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the APIToken fields. +func (at *APIToken) 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 apitoken.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + at.ID = value.String + } + case apitoken.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + at.CreatedAt = value.Time + } + case apitoken.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + at.UpdatedAt = value.Time + } + case apitoken.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + at.CreatedBy = value.String + } + case apitoken.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + at.UpdatedBy = value.String + } + case apitoken.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + at.DeletedAt = value.Time + } + case apitoken.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + at.DeletedBy = value.String + } + case apitoken.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + at.MappingID = value.String + } + case apitoken.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &at.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case apitoken.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + at.OwnerID = value.String + } + case apitoken.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + at.Name = value.String + } + case apitoken.FieldToken: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token", values[i]) + } else if value.Valid { + at.Token = value.String + } + case apitoken.FieldExpiresAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field expires_at", values[i]) + } else if value.Valid { + at.ExpiresAt = new(time.Time) + *at.ExpiresAt = value.Time + } + case apitoken.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + at.Description = new(string) + *at.Description = value.String + } + case apitoken.FieldScopes: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field scopes", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &at.Scopes); err != nil { + return fmt.Errorf("unmarshal field scopes: %w", err) + } + } + case apitoken.FieldLastUsedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field last_used_at", values[i]) + } else if value.Valid { + at.LastUsedAt = new(time.Time) + *at.LastUsedAt = value.Time + } + default: + at.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the APIToken. +// This includes values selected through modifiers, order, etc. +func (at *APIToken) Value(name string) (ent.Value, error) { + return at.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the APIToken entity. +func (at *APIToken) QueryOwner() *OrganizationQuery { + return NewAPITokenClient(at.config).QueryOwner(at) +} + +// Update returns a builder for updating this APIToken. +// Note that you need to call APIToken.Unwrap() before calling this method if this APIToken +// was returned from a transaction, and the transaction was committed or rolled back. +func (at *APIToken) Update() *APITokenUpdateOne { + return NewAPITokenClient(at.config).UpdateOne(at) +} + +// Unwrap unwraps the APIToken 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 (at *APIToken) Unwrap() *APIToken { + _tx, ok := at.config.driver.(*txDriver) + if !ok { + panic("generated: APIToken is not a transactional entity") + } + at.config.driver = _tx.drv + return at +} + +// String implements the fmt.Stringer. +func (at *APIToken) String() string { + var builder strings.Builder + builder.WriteString("APIToken(") + builder.WriteString(fmt.Sprintf("id=%v, ", at.ID)) + builder.WriteString("created_at=") + builder.WriteString(at.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(at.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(at.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(at.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(at.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(at.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(at.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", at.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(at.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(at.Name) + builder.WriteString(", ") + builder.WriteString("token=") + builder.WriteString(at.Token) + builder.WriteString(", ") + if v := at.ExpiresAt; v != nil { + builder.WriteString("expires_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := at.Description; v != nil { + builder.WriteString("description=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("scopes=") + builder.WriteString(fmt.Sprintf("%v", at.Scopes)) + builder.WriteString(", ") + if v := at.LastUsedAt; v != nil { + builder.WriteString("last_used_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteByte(')') + return builder.String() +} + +// APITokens is a parsable slice of APIToken. +type APITokens []*APIToken diff --git a/internal/ent/generated/apitoken/apitoken.go b/internal/ent/generated/apitoken/apitoken.go new file mode 100644 index 0000000..6cbc197 --- /dev/null +++ b/internal/ent/generated/apitoken/apitoken.go @@ -0,0 +1,205 @@ +// Code generated by ent, DO NOT EDIT. + +package apitoken + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the apitoken type in the database. + Label = "api_token" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldToken holds the string denoting the token field in the database. + FieldToken = "token" + // FieldExpiresAt holds the string denoting the expires_at field in the database. + FieldExpiresAt = "expires_at" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldScopes holds the string denoting the scopes field in the database. + FieldScopes = "scopes" + // FieldLastUsedAt holds the string denoting the last_used_at field in the database. + FieldLastUsedAt = "last_used_at" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // Table holds the table name of the apitoken in the database. + Table = "api_tokens" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "api_tokens" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" +) + +// Columns holds all SQL columns for apitoken fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldToken, + FieldExpiresAt, + FieldDescription, + FieldScopes, + FieldLastUsedAt, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [6]ent.Hook + Interceptors [3]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultToken holds the default value on creation for the "token" field. + DefaultToken func() string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the APIToken queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByToken orders the results by the token field. +func ByToken(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldToken, opts...).ToFunc() +} + +// ByExpiresAt orders the results by the expires_at field. +func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpiresAt, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByLastUsedAt orders the results by the last_used_at field. +func ByLastUsedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastUsedAt, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} diff --git a/internal/ent/generated/apitoken/where.go b/internal/ent/generated/apitoken/where.go new file mode 100644 index 0000000..af0f16f --- /dev/null +++ b/internal/ent/generated/apitoken/where.go @@ -0,0 +1,1017 @@ +// Code generated by ent, DO NOT EDIT. + +package apitoken + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldName, v)) +} + +// Token applies equality check predicate on the "token" field. It's identical to TokenEQ. +func Token(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldToken, v)) +} + +// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ. +func ExpiresAt(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldExpiresAt, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldDescription, v)) +} + +// LastUsedAt applies equality check predicate on the "last_used_at" field. It's identical to LastUsedAtEQ. +func LastUsedAt(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldLastUsedAt, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldName, v)) +} + +// TokenEQ applies the EQ predicate on the "token" field. +func TokenEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldToken, v)) +} + +// TokenNEQ applies the NEQ predicate on the "token" field. +func TokenNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldToken, v)) +} + +// TokenIn applies the In predicate on the "token" field. +func TokenIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldToken, vs...)) +} + +// TokenNotIn applies the NotIn predicate on the "token" field. +func TokenNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldToken, vs...)) +} + +// TokenGT applies the GT predicate on the "token" field. +func TokenGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldToken, v)) +} + +// TokenGTE applies the GTE predicate on the "token" field. +func TokenGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldToken, v)) +} + +// TokenLT applies the LT predicate on the "token" field. +func TokenLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldToken, v)) +} + +// TokenLTE applies the LTE predicate on the "token" field. +func TokenLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldToken, v)) +} + +// TokenContains applies the Contains predicate on the "token" field. +func TokenContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldToken, v)) +} + +// TokenHasPrefix applies the HasPrefix predicate on the "token" field. +func TokenHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldToken, v)) +} + +// TokenHasSuffix applies the HasSuffix predicate on the "token" field. +func TokenHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldToken, v)) +} + +// TokenEqualFold applies the EqualFold predicate on the "token" field. +func TokenEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldToken, v)) +} + +// TokenContainsFold applies the ContainsFold predicate on the "token" field. +func TokenContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldToken, v)) +} + +// ExpiresAtEQ applies the EQ predicate on the "expires_at" field. +func ExpiresAtEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldExpiresAt, v)) +} + +// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field. +func ExpiresAtNEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldExpiresAt, v)) +} + +// ExpiresAtIn applies the In predicate on the "expires_at" field. +func ExpiresAtIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field. +func ExpiresAtNotIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtGT applies the GT predicate on the "expires_at" field. +func ExpiresAtGT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldExpiresAt, v)) +} + +// ExpiresAtGTE applies the GTE predicate on the "expires_at" field. +func ExpiresAtGTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldExpiresAt, v)) +} + +// ExpiresAtLT applies the LT predicate on the "expires_at" field. +func ExpiresAtLT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldExpiresAt, v)) +} + +// ExpiresAtLTE applies the LTE predicate on the "expires_at" field. +func ExpiresAtLTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldExpiresAt, v)) +} + +// ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field. +func ExpiresAtIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldExpiresAt)) +} + +// ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field. +func ExpiresAtNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldExpiresAt)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.APIToken { + return predicate.APIToken(sql.FieldContainsFold(FieldDescription, v)) +} + +// ScopesIsNil applies the IsNil predicate on the "scopes" field. +func ScopesIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldScopes)) +} + +// ScopesNotNil applies the NotNil predicate on the "scopes" field. +func ScopesNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldScopes)) +} + +// LastUsedAtEQ applies the EQ predicate on the "last_used_at" field. +func LastUsedAtEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldEQ(FieldLastUsedAt, v)) +} + +// LastUsedAtNEQ applies the NEQ predicate on the "last_used_at" field. +func LastUsedAtNEQ(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNEQ(FieldLastUsedAt, v)) +} + +// LastUsedAtIn applies the In predicate on the "last_used_at" field. +func LastUsedAtIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldIn(FieldLastUsedAt, vs...)) +} + +// LastUsedAtNotIn applies the NotIn predicate on the "last_used_at" field. +func LastUsedAtNotIn(vs ...time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldNotIn(FieldLastUsedAt, vs...)) +} + +// LastUsedAtGT applies the GT predicate on the "last_used_at" field. +func LastUsedAtGT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGT(FieldLastUsedAt, v)) +} + +// LastUsedAtGTE applies the GTE predicate on the "last_used_at" field. +func LastUsedAtGTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldGTE(FieldLastUsedAt, v)) +} + +// LastUsedAtLT applies the LT predicate on the "last_used_at" field. +func LastUsedAtLT(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLT(FieldLastUsedAt, v)) +} + +// LastUsedAtLTE applies the LTE predicate on the "last_used_at" field. +func LastUsedAtLTE(v time.Time) predicate.APIToken { + return predicate.APIToken(sql.FieldLTE(FieldLastUsedAt, v)) +} + +// LastUsedAtIsNil applies the IsNil predicate on the "last_used_at" field. +func LastUsedAtIsNil() predicate.APIToken { + return predicate.APIToken(sql.FieldIsNull(FieldLastUsedAt)) +} + +// LastUsedAtNotNil applies the NotNil predicate on the "last_used_at" field. +func LastUsedAtNotNil() predicate.APIToken { + return predicate.APIToken(sql.FieldNotNull(FieldLastUsedAt)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.APIToken { + return predicate.APIToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.APIToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.APIToken { + return predicate.APIToken(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.APIToken + 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.APIToken) predicate.APIToken { + return predicate.APIToken(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.APIToken) predicate.APIToken { + return predicate.APIToken(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.APIToken) predicate.APIToken { + return predicate.APIToken(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/apitoken_create.go b/internal/ent/generated/apitoken_create.go new file mode 100644 index 0000000..a51e5c1 --- /dev/null +++ b/internal/ent/generated/apitoken_create.go @@ -0,0 +1,524 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// APITokenCreate is the builder for creating a APIToken entity. +type APITokenCreate struct { + config + mutation *APITokenMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (atc *APITokenCreate) SetCreatedAt(t time.Time) *APITokenCreate { + atc.mutation.SetCreatedAt(t) + return atc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableCreatedAt(t *time.Time) *APITokenCreate { + if t != nil { + atc.SetCreatedAt(*t) + } + return atc +} + +// SetUpdatedAt sets the "updated_at" field. +func (atc *APITokenCreate) SetUpdatedAt(t time.Time) *APITokenCreate { + atc.mutation.SetUpdatedAt(t) + return atc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableUpdatedAt(t *time.Time) *APITokenCreate { + if t != nil { + atc.SetUpdatedAt(*t) + } + return atc +} + +// SetCreatedBy sets the "created_by" field. +func (atc *APITokenCreate) SetCreatedBy(s string) *APITokenCreate { + atc.mutation.SetCreatedBy(s) + return atc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableCreatedBy(s *string) *APITokenCreate { + if s != nil { + atc.SetCreatedBy(*s) + } + return atc +} + +// SetUpdatedBy sets the "updated_by" field. +func (atc *APITokenCreate) SetUpdatedBy(s string) *APITokenCreate { + atc.mutation.SetUpdatedBy(s) + return atc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableUpdatedBy(s *string) *APITokenCreate { + if s != nil { + atc.SetUpdatedBy(*s) + } + return atc +} + +// SetDeletedAt sets the "deleted_at" field. +func (atc *APITokenCreate) SetDeletedAt(t time.Time) *APITokenCreate { + atc.mutation.SetDeletedAt(t) + return atc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableDeletedAt(t *time.Time) *APITokenCreate { + if t != nil { + atc.SetDeletedAt(*t) + } + return atc +} + +// SetDeletedBy sets the "deleted_by" field. +func (atc *APITokenCreate) SetDeletedBy(s string) *APITokenCreate { + atc.mutation.SetDeletedBy(s) + return atc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableDeletedBy(s *string) *APITokenCreate { + if s != nil { + atc.SetDeletedBy(*s) + } + return atc +} + +// SetMappingID sets the "mapping_id" field. +func (atc *APITokenCreate) SetMappingID(s string) *APITokenCreate { + atc.mutation.SetMappingID(s) + return atc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableMappingID(s *string) *APITokenCreate { + if s != nil { + atc.SetMappingID(*s) + } + return atc +} + +// SetTags sets the "tags" field. +func (atc *APITokenCreate) SetTags(s []string) *APITokenCreate { + atc.mutation.SetTags(s) + return atc +} + +// SetOwnerID sets the "owner_id" field. +func (atc *APITokenCreate) SetOwnerID(s string) *APITokenCreate { + atc.mutation.SetOwnerID(s) + return atc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableOwnerID(s *string) *APITokenCreate { + if s != nil { + atc.SetOwnerID(*s) + } + return atc +} + +// SetName sets the "name" field. +func (atc *APITokenCreate) SetName(s string) *APITokenCreate { + atc.mutation.SetName(s) + return atc +} + +// SetToken sets the "token" field. +func (atc *APITokenCreate) SetToken(s string) *APITokenCreate { + atc.mutation.SetToken(s) + return atc +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableToken(s *string) *APITokenCreate { + if s != nil { + atc.SetToken(*s) + } + return atc +} + +// SetExpiresAt sets the "expires_at" field. +func (atc *APITokenCreate) SetExpiresAt(t time.Time) *APITokenCreate { + atc.mutation.SetExpiresAt(t) + return atc +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableExpiresAt(t *time.Time) *APITokenCreate { + if t != nil { + atc.SetExpiresAt(*t) + } + return atc +} + +// SetDescription sets the "description" field. +func (atc *APITokenCreate) SetDescription(s string) *APITokenCreate { + atc.mutation.SetDescription(s) + return atc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableDescription(s *string) *APITokenCreate { + if s != nil { + atc.SetDescription(*s) + } + return atc +} + +// SetScopes sets the "scopes" field. +func (atc *APITokenCreate) SetScopes(s []string) *APITokenCreate { + atc.mutation.SetScopes(s) + return atc +} + +// SetLastUsedAt sets the "last_used_at" field. +func (atc *APITokenCreate) SetLastUsedAt(t time.Time) *APITokenCreate { + atc.mutation.SetLastUsedAt(t) + return atc +} + +// SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableLastUsedAt(t *time.Time) *APITokenCreate { + if t != nil { + atc.SetLastUsedAt(*t) + } + return atc +} + +// SetID sets the "id" field. +func (atc *APITokenCreate) SetID(s string) *APITokenCreate { + atc.mutation.SetID(s) + return atc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (atc *APITokenCreate) SetNillableID(s *string) *APITokenCreate { + if s != nil { + atc.SetID(*s) + } + return atc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (atc *APITokenCreate) SetOwner(o *Organization) *APITokenCreate { + return atc.SetOwnerID(o.ID) +} + +// Mutation returns the APITokenMutation object of the builder. +func (atc *APITokenCreate) Mutation() *APITokenMutation { + return atc.mutation +} + +// Save creates the APIToken in the database. +func (atc *APITokenCreate) Save(ctx context.Context) (*APIToken, error) { + if err := atc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, atc.sqlSave, atc.mutation, atc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (atc *APITokenCreate) SaveX(ctx context.Context) *APIToken { + v, err := atc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (atc *APITokenCreate) Exec(ctx context.Context) error { + _, err := atc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (atc *APITokenCreate) ExecX(ctx context.Context) { + if err := atc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (atc *APITokenCreate) defaults() error { + if _, ok := atc.mutation.CreatedAt(); !ok { + if apitoken.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized apitoken.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := apitoken.DefaultCreatedAt() + atc.mutation.SetCreatedAt(v) + } + if _, ok := atc.mutation.UpdatedAt(); !ok { + if apitoken.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized apitoken.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := apitoken.DefaultUpdatedAt() + atc.mutation.SetUpdatedAt(v) + } + if _, ok := atc.mutation.MappingID(); !ok { + if apitoken.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized apitoken.DefaultMappingID (forgotten import generated/runtime?)") + } + v := apitoken.DefaultMappingID() + atc.mutation.SetMappingID(v) + } + if _, ok := atc.mutation.Tags(); !ok { + v := apitoken.DefaultTags + atc.mutation.SetTags(v) + } + if _, ok := atc.mutation.Token(); !ok { + if apitoken.DefaultToken == nil { + return fmt.Errorf("generated: uninitialized apitoken.DefaultToken (forgotten import generated/runtime?)") + } + v := apitoken.DefaultToken() + atc.mutation.SetToken(v) + } + if _, ok := atc.mutation.ID(); !ok { + if apitoken.DefaultID == nil { + return fmt.Errorf("generated: uninitialized apitoken.DefaultID (forgotten import generated/runtime?)") + } + v := apitoken.DefaultID() + atc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (atc *APITokenCreate) check() error { + if _, ok := atc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "APIToken.mapping_id"`)} + } + if v, ok := atc.mutation.OwnerID(); ok { + if err := apitoken.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "APIToken.owner_id": %w`, err)} + } + } + if _, ok := atc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "APIToken.name"`)} + } + if v, ok := atc.mutation.Name(); ok { + if err := apitoken.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "APIToken.name": %w`, err)} + } + } + if _, ok := atc.mutation.Token(); !ok { + return &ValidationError{Name: "token", err: errors.New(`generated: missing required field "APIToken.token"`)} + } + return nil +} + +func (atc *APITokenCreate) sqlSave(ctx context.Context) (*APIToken, error) { + if err := atc.check(); err != nil { + return nil, err + } + _node, _spec := atc.createSpec() + if err := sqlgraph.CreateNode(ctx, atc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected APIToken.ID type: %T", _spec.ID.Value) + } + } + atc.mutation.id = &_node.ID + atc.mutation.done = true + return _node, nil +} + +func (atc *APITokenCreate) createSpec() (*APIToken, *sqlgraph.CreateSpec) { + var ( + _node = &APIToken{config: atc.config} + _spec = sqlgraph.NewCreateSpec(apitoken.Table, sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString)) + ) + _spec.Schema = atc.schemaConfig.APIToken + if id, ok := atc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := atc.mutation.CreatedAt(); ok { + _spec.SetField(apitoken.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := atc.mutation.UpdatedAt(); ok { + _spec.SetField(apitoken.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := atc.mutation.CreatedBy(); ok { + _spec.SetField(apitoken.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := atc.mutation.UpdatedBy(); ok { + _spec.SetField(apitoken.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := atc.mutation.DeletedAt(); ok { + _spec.SetField(apitoken.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := atc.mutation.DeletedBy(); ok { + _spec.SetField(apitoken.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := atc.mutation.MappingID(); ok { + _spec.SetField(apitoken.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := atc.mutation.Tags(); ok { + _spec.SetField(apitoken.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := atc.mutation.Name(); ok { + _spec.SetField(apitoken.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := atc.mutation.Token(); ok { + _spec.SetField(apitoken.FieldToken, field.TypeString, value) + _node.Token = value + } + if value, ok := atc.mutation.ExpiresAt(); ok { + _spec.SetField(apitoken.FieldExpiresAt, field.TypeTime, value) + _node.ExpiresAt = &value + } + if value, ok := atc.mutation.Description(); ok { + _spec.SetField(apitoken.FieldDescription, field.TypeString, value) + _node.Description = &value + } + if value, ok := atc.mutation.Scopes(); ok { + _spec.SetField(apitoken.FieldScopes, field.TypeJSON, value) + _node.Scopes = value + } + if value, ok := atc.mutation.LastUsedAt(); ok { + _spec.SetField(apitoken.FieldLastUsedAt, field.TypeTime, value) + _node.LastUsedAt = &value + } + if nodes := atc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: apitoken.OwnerTable, + Columns: []string{apitoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = atc.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// APITokenCreateBulk is the builder for creating many APIToken entities in bulk. +type APITokenCreateBulk struct { + config + err error + builders []*APITokenCreate +} + +// Save creates the APIToken entities in the database. +func (atcb *APITokenCreateBulk) Save(ctx context.Context) ([]*APIToken, error) { + if atcb.err != nil { + return nil, atcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(atcb.builders)) + nodes := make([]*APIToken, len(atcb.builders)) + mutators := make([]Mutator, len(atcb.builders)) + for i := range atcb.builders { + func(i int, root context.Context) { + builder := atcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*APITokenMutation) + 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, atcb.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, atcb.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, atcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (atcb *APITokenCreateBulk) SaveX(ctx context.Context) []*APIToken { + v, err := atcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (atcb *APITokenCreateBulk) Exec(ctx context.Context) error { + _, err := atcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (atcb *APITokenCreateBulk) ExecX(ctx context.Context) { + if err := atcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/apitoken_delete.go b/internal/ent/generated/apitoken_delete.go new file mode 100644 index 0000000..49ca173 --- /dev/null +++ b/internal/ent/generated/apitoken_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// APITokenDelete is the builder for deleting a APIToken entity. +type APITokenDelete struct { + config + hooks []Hook + mutation *APITokenMutation +} + +// Where appends a list predicates to the APITokenDelete builder. +func (atd *APITokenDelete) Where(ps ...predicate.APIToken) *APITokenDelete { + atd.mutation.Where(ps...) + return atd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (atd *APITokenDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, atd.sqlExec, atd.mutation, atd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (atd *APITokenDelete) ExecX(ctx context.Context) int { + n, err := atd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (atd *APITokenDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(apitoken.Table, sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString)) + _spec.Node.Schema = atd.schemaConfig.APIToken + ctx = internal.NewSchemaConfigContext(ctx, atd.schemaConfig) + if ps := atd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, atd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + atd.mutation.done = true + return affected, err +} + +// APITokenDeleteOne is the builder for deleting a single APIToken entity. +type APITokenDeleteOne struct { + atd *APITokenDelete +} + +// Where appends a list predicates to the APITokenDelete builder. +func (atdo *APITokenDeleteOne) Where(ps ...predicate.APIToken) *APITokenDeleteOne { + atdo.atd.mutation.Where(ps...) + return atdo +} + +// Exec executes the deletion query. +func (atdo *APITokenDeleteOne) Exec(ctx context.Context) error { + n, err := atdo.atd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{apitoken.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (atdo *APITokenDeleteOne) ExecX(ctx context.Context) { + if err := atdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/apitoken_query.go b/internal/ent/generated/apitoken_query.go new file mode 100644 index 0000000..a97c603 --- /dev/null +++ b/internal/ent/generated/apitoken_query.go @@ -0,0 +1,638 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// APITokenQuery is the builder for querying APIToken entities. +type APITokenQuery struct { + config + ctx *QueryContext + order []apitoken.OrderOption + inters []Interceptor + predicates []predicate.APIToken + withOwner *OrganizationQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*APIToken) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the APITokenQuery builder. +func (atq *APITokenQuery) Where(ps ...predicate.APIToken) *APITokenQuery { + atq.predicates = append(atq.predicates, ps...) + return atq +} + +// Limit the number of records to be returned by this query. +func (atq *APITokenQuery) Limit(limit int) *APITokenQuery { + atq.ctx.Limit = &limit + return atq +} + +// Offset to start from. +func (atq *APITokenQuery) Offset(offset int) *APITokenQuery { + atq.ctx.Offset = &offset + return atq +} + +// 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 (atq *APITokenQuery) Unique(unique bool) *APITokenQuery { + atq.ctx.Unique = &unique + return atq +} + +// Order specifies how the records should be ordered. +func (atq *APITokenQuery) Order(o ...apitoken.OrderOption) *APITokenQuery { + atq.order = append(atq.order, o...) + return atq +} + +// QueryOwner chains the current query on the "owner" edge. +func (atq *APITokenQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: atq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := atq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := atq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(apitoken.Table, apitoken.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, apitoken.OwnerTable, apitoken.OwnerColumn), + ) + schemaConfig := atq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.APIToken + fromU = sqlgraph.SetNeighbors(atq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first APIToken entity from the query. +// Returns a *NotFoundError when no APIToken was found. +func (atq *APITokenQuery) First(ctx context.Context) (*APIToken, error) { + nodes, err := atq.Limit(1).All(setContextOp(ctx, atq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{apitoken.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (atq *APITokenQuery) FirstX(ctx context.Context) *APIToken { + node, err := atq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first APIToken ID from the query. +// Returns a *NotFoundError when no APIToken ID was found. +func (atq *APITokenQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = atq.Limit(1).IDs(setContextOp(ctx, atq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{apitoken.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (atq *APITokenQuery) FirstIDX(ctx context.Context) string { + id, err := atq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single APIToken entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one APIToken entity is found. +// Returns a *NotFoundError when no APIToken entities are found. +func (atq *APITokenQuery) Only(ctx context.Context) (*APIToken, error) { + nodes, err := atq.Limit(2).All(setContextOp(ctx, atq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{apitoken.Label} + default: + return nil, &NotSingularError{apitoken.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (atq *APITokenQuery) OnlyX(ctx context.Context) *APIToken { + node, err := atq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only APIToken ID in the query. +// Returns a *NotSingularError when more than one APIToken ID is found. +// Returns a *NotFoundError when no entities are found. +func (atq *APITokenQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = atq.Limit(2).IDs(setContextOp(ctx, atq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{apitoken.Label} + default: + err = &NotSingularError{apitoken.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (atq *APITokenQuery) OnlyIDX(ctx context.Context) string { + id, err := atq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of APITokens. +func (atq *APITokenQuery) All(ctx context.Context) ([]*APIToken, error) { + ctx = setContextOp(ctx, atq.ctx, ent.OpQueryAll) + if err := atq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*APIToken, *APITokenQuery]() + return withInterceptors[[]*APIToken](ctx, atq, qr, atq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (atq *APITokenQuery) AllX(ctx context.Context) []*APIToken { + nodes, err := atq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of APIToken IDs. +func (atq *APITokenQuery) IDs(ctx context.Context) (ids []string, err error) { + if atq.ctx.Unique == nil && atq.path != nil { + atq.Unique(true) + } + ctx = setContextOp(ctx, atq.ctx, ent.OpQueryIDs) + if err = atq.Select(apitoken.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (atq *APITokenQuery) IDsX(ctx context.Context) []string { + ids, err := atq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (atq *APITokenQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, atq.ctx, ent.OpQueryCount) + if err := atq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, atq, querierCount[*APITokenQuery](), atq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (atq *APITokenQuery) CountX(ctx context.Context) int { + count, err := atq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (atq *APITokenQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, atq.ctx, ent.OpQueryExist) + switch _, err := atq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (atq *APITokenQuery) ExistX(ctx context.Context) bool { + exist, err := atq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the APITokenQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (atq *APITokenQuery) Clone() *APITokenQuery { + if atq == nil { + return nil + } + return &APITokenQuery{ + config: atq.config, + ctx: atq.ctx.Clone(), + order: append([]apitoken.OrderOption{}, atq.order...), + inters: append([]Interceptor{}, atq.inters...), + predicates: append([]predicate.APIToken{}, atq.predicates...), + withOwner: atq.withOwner.Clone(), + // clone intermediate query. + sql: atq.sql.Clone(), + path: atq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (atq *APITokenQuery) WithOwner(opts ...func(*OrganizationQuery)) *APITokenQuery { + query := (&OrganizationClient{config: atq.config}).Query() + for _, opt := range opts { + opt(query) + } + atq.withOwner = query + return atq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.APIToken.Query(). +// GroupBy(apitoken.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (atq *APITokenQuery) GroupBy(field string, fields ...string) *APITokenGroupBy { + atq.ctx.Fields = append([]string{field}, fields...) + grbuild := &APITokenGroupBy{build: atq} + grbuild.flds = &atq.ctx.Fields + grbuild.label = apitoken.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.APIToken.Query(). +// Select(apitoken.FieldCreatedAt). +// Scan(ctx, &v) +func (atq *APITokenQuery) Select(fields ...string) *APITokenSelect { + atq.ctx.Fields = append(atq.ctx.Fields, fields...) + sbuild := &APITokenSelect{APITokenQuery: atq} + sbuild.label = apitoken.Label + sbuild.flds, sbuild.scan = &atq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a APITokenSelect configured with the given aggregations. +func (atq *APITokenQuery) Aggregate(fns ...AggregateFunc) *APITokenSelect { + return atq.Select().Aggregate(fns...) +} + +func (atq *APITokenQuery) prepareQuery(ctx context.Context) error { + for _, inter := range atq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, atq); err != nil { + return err + } + } + } + for _, f := range atq.ctx.Fields { + if !apitoken.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if atq.path != nil { + prev, err := atq.path(ctx) + if err != nil { + return err + } + atq.sql = prev + } + if apitoken.Policy == nil { + return errors.New("generated: uninitialized apitoken.Policy (forgotten import generated/runtime?)") + } + if err := apitoken.Policy.EvalQuery(ctx, atq); err != nil { + return err + } + return nil +} + +func (atq *APITokenQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*APIToken, error) { + var ( + nodes = []*APIToken{} + _spec = atq.querySpec() + loadedTypes = [1]bool{ + atq.withOwner != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*APIToken).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &APIToken{config: atq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = atq.schemaConfig.APIToken + ctx = internal.NewSchemaConfigContext(ctx, atq.schemaConfig) + if len(atq.modifiers) > 0 { + _spec.Modifiers = atq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, atq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := atq.withOwner; query != nil { + if err := atq.loadOwner(ctx, query, nodes, nil, + func(n *APIToken, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + for i := range atq.loadTotal { + if err := atq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (atq *APITokenQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*APIToken, init func(*APIToken), assign func(*APIToken, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*APIToken) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (atq *APITokenQuery) sqlCount(ctx context.Context) (int, error) { + _spec := atq.querySpec() + _spec.Node.Schema = atq.schemaConfig.APIToken + ctx = internal.NewSchemaConfigContext(ctx, atq.schemaConfig) + if len(atq.modifiers) > 0 { + _spec.Modifiers = atq.modifiers + } + _spec.Node.Columns = atq.ctx.Fields + if len(atq.ctx.Fields) > 0 { + _spec.Unique = atq.ctx.Unique != nil && *atq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, atq.driver, _spec) +} + +func (atq *APITokenQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(apitoken.Table, apitoken.Columns, sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString)) + _spec.From = atq.sql + if unique := atq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if atq.path != nil { + _spec.Unique = true + } + if fields := atq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, apitoken.FieldID) + for i := range fields { + if fields[i] != apitoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if atq.withOwner != nil { + _spec.Node.AddColumnOnce(apitoken.FieldOwnerID) + } + } + if ps := atq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := atq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := atq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := atq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (atq *APITokenQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(atq.driver.Dialect()) + t1 := builder.Table(apitoken.Table) + columns := atq.ctx.Fields + if len(columns) == 0 { + columns = apitoken.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if atq.sql != nil { + selector = atq.sql + selector.Select(selector.Columns(columns...)...) + } + if atq.ctx.Unique != nil && *atq.ctx.Unique { + selector.Distinct() + } + t1.Schema(atq.schemaConfig.APIToken) + ctx = internal.NewSchemaConfigContext(ctx, atq.schemaConfig) + selector.WithContext(ctx) + for _, p := range atq.predicates { + p(selector) + } + for _, p := range atq.order { + p(selector) + } + if offset := atq.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 := atq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// APITokenGroupBy is the group-by builder for APIToken entities. +type APITokenGroupBy struct { + selector + build *APITokenQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (atgb *APITokenGroupBy) Aggregate(fns ...AggregateFunc) *APITokenGroupBy { + atgb.fns = append(atgb.fns, fns...) + return atgb +} + +// Scan applies the selector query and scans the result into the given value. +func (atgb *APITokenGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, atgb.build.ctx, ent.OpQueryGroupBy) + if err := atgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*APITokenQuery, *APITokenGroupBy](ctx, atgb.build, atgb, atgb.build.inters, v) +} + +func (atgb *APITokenGroupBy) sqlScan(ctx context.Context, root *APITokenQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(atgb.fns)) + for _, fn := range atgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*atgb.flds)+len(atgb.fns)) + for _, f := range *atgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*atgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := atgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// APITokenSelect is the builder for selecting fields of APIToken entities. +type APITokenSelect struct { + *APITokenQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ats *APITokenSelect) Aggregate(fns ...AggregateFunc) *APITokenSelect { + ats.fns = append(ats.fns, fns...) + return ats +} + +// Scan applies the selector query and scans the result into the given value. +func (ats *APITokenSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ats.ctx, ent.OpQuerySelect) + if err := ats.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*APITokenQuery, *APITokenSelect](ctx, ats.APITokenQuery, ats, ats.inters, v) +} + +func (ats *APITokenSelect) sqlScan(ctx context.Context, root *APITokenQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ats.fns)) + for _, fn := range ats.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ats.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 := ats.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/apitoken_update.go b/internal/ent/generated/apitoken_update.go new file mode 100644 index 0000000..4e1dad3 --- /dev/null +++ b/internal/ent/generated/apitoken_update.go @@ -0,0 +1,884 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// APITokenUpdate is the builder for updating APIToken entities. +type APITokenUpdate struct { + config + hooks []Hook + mutation *APITokenMutation +} + +// Where appends a list predicates to the APITokenUpdate builder. +func (atu *APITokenUpdate) Where(ps ...predicate.APIToken) *APITokenUpdate { + atu.mutation.Where(ps...) + return atu +} + +// SetUpdatedAt sets the "updated_at" field. +func (atu *APITokenUpdate) SetUpdatedAt(t time.Time) *APITokenUpdate { + atu.mutation.SetUpdatedAt(t) + return atu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (atu *APITokenUpdate) ClearUpdatedAt() *APITokenUpdate { + atu.mutation.ClearUpdatedAt() + return atu +} + +// SetUpdatedBy sets the "updated_by" field. +func (atu *APITokenUpdate) SetUpdatedBy(s string) *APITokenUpdate { + atu.mutation.SetUpdatedBy(s) + return atu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableUpdatedBy(s *string) *APITokenUpdate { + if s != nil { + atu.SetUpdatedBy(*s) + } + return atu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (atu *APITokenUpdate) ClearUpdatedBy() *APITokenUpdate { + atu.mutation.ClearUpdatedBy() + return atu +} + +// SetDeletedAt sets the "deleted_at" field. +func (atu *APITokenUpdate) SetDeletedAt(t time.Time) *APITokenUpdate { + atu.mutation.SetDeletedAt(t) + return atu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableDeletedAt(t *time.Time) *APITokenUpdate { + if t != nil { + atu.SetDeletedAt(*t) + } + return atu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (atu *APITokenUpdate) ClearDeletedAt() *APITokenUpdate { + atu.mutation.ClearDeletedAt() + return atu +} + +// SetDeletedBy sets the "deleted_by" field. +func (atu *APITokenUpdate) SetDeletedBy(s string) *APITokenUpdate { + atu.mutation.SetDeletedBy(s) + return atu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableDeletedBy(s *string) *APITokenUpdate { + if s != nil { + atu.SetDeletedBy(*s) + } + return atu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (atu *APITokenUpdate) ClearDeletedBy() *APITokenUpdate { + atu.mutation.ClearDeletedBy() + return atu +} + +// SetTags sets the "tags" field. +func (atu *APITokenUpdate) SetTags(s []string) *APITokenUpdate { + atu.mutation.SetTags(s) + return atu +} + +// AppendTags appends s to the "tags" field. +func (atu *APITokenUpdate) AppendTags(s []string) *APITokenUpdate { + atu.mutation.AppendTags(s) + return atu +} + +// ClearTags clears the value of the "tags" field. +func (atu *APITokenUpdate) ClearTags() *APITokenUpdate { + atu.mutation.ClearTags() + return atu +} + +// SetOwnerID sets the "owner_id" field. +func (atu *APITokenUpdate) SetOwnerID(s string) *APITokenUpdate { + atu.mutation.SetOwnerID(s) + return atu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableOwnerID(s *string) *APITokenUpdate { + if s != nil { + atu.SetOwnerID(*s) + } + return atu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (atu *APITokenUpdate) ClearOwnerID() *APITokenUpdate { + atu.mutation.ClearOwnerID() + return atu +} + +// SetName sets the "name" field. +func (atu *APITokenUpdate) SetName(s string) *APITokenUpdate { + atu.mutation.SetName(s) + return atu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableName(s *string) *APITokenUpdate { + if s != nil { + atu.SetName(*s) + } + return atu +} + +// SetExpiresAt sets the "expires_at" field. +func (atu *APITokenUpdate) SetExpiresAt(t time.Time) *APITokenUpdate { + atu.mutation.SetExpiresAt(t) + return atu +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableExpiresAt(t *time.Time) *APITokenUpdate { + if t != nil { + atu.SetExpiresAt(*t) + } + return atu +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (atu *APITokenUpdate) ClearExpiresAt() *APITokenUpdate { + atu.mutation.ClearExpiresAt() + return atu +} + +// SetDescription sets the "description" field. +func (atu *APITokenUpdate) SetDescription(s string) *APITokenUpdate { + atu.mutation.SetDescription(s) + return atu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableDescription(s *string) *APITokenUpdate { + if s != nil { + atu.SetDescription(*s) + } + return atu +} + +// ClearDescription clears the value of the "description" field. +func (atu *APITokenUpdate) ClearDescription() *APITokenUpdate { + atu.mutation.ClearDescription() + return atu +} + +// SetScopes sets the "scopes" field. +func (atu *APITokenUpdate) SetScopes(s []string) *APITokenUpdate { + atu.mutation.SetScopes(s) + return atu +} + +// AppendScopes appends s to the "scopes" field. +func (atu *APITokenUpdate) AppendScopes(s []string) *APITokenUpdate { + atu.mutation.AppendScopes(s) + return atu +} + +// ClearScopes clears the value of the "scopes" field. +func (atu *APITokenUpdate) ClearScopes() *APITokenUpdate { + atu.mutation.ClearScopes() + return atu +} + +// SetLastUsedAt sets the "last_used_at" field. +func (atu *APITokenUpdate) SetLastUsedAt(t time.Time) *APITokenUpdate { + atu.mutation.SetLastUsedAt(t) + return atu +} + +// SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil. +func (atu *APITokenUpdate) SetNillableLastUsedAt(t *time.Time) *APITokenUpdate { + if t != nil { + atu.SetLastUsedAt(*t) + } + return atu +} + +// ClearLastUsedAt clears the value of the "last_used_at" field. +func (atu *APITokenUpdate) ClearLastUsedAt() *APITokenUpdate { + atu.mutation.ClearLastUsedAt() + return atu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (atu *APITokenUpdate) SetOwner(o *Organization) *APITokenUpdate { + return atu.SetOwnerID(o.ID) +} + +// Mutation returns the APITokenMutation object of the builder. +func (atu *APITokenUpdate) Mutation() *APITokenMutation { + return atu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (atu *APITokenUpdate) ClearOwner() *APITokenUpdate { + atu.mutation.ClearOwner() + return atu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (atu *APITokenUpdate) Save(ctx context.Context) (int, error) { + if err := atu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, atu.sqlSave, atu.mutation, atu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (atu *APITokenUpdate) SaveX(ctx context.Context) int { + affected, err := atu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (atu *APITokenUpdate) Exec(ctx context.Context) error { + _, err := atu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (atu *APITokenUpdate) ExecX(ctx context.Context) { + if err := atu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (atu *APITokenUpdate) defaults() error { + if _, ok := atu.mutation.UpdatedAt(); !ok && !atu.mutation.UpdatedAtCleared() { + if apitoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized apitoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := apitoken.UpdateDefaultUpdatedAt() + atu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (atu *APITokenUpdate) check() error { + if v, ok := atu.mutation.OwnerID(); ok { + if err := apitoken.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "APIToken.owner_id": %w`, err)} + } + } + if v, ok := atu.mutation.Name(); ok { + if err := apitoken.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "APIToken.name": %w`, err)} + } + } + return nil +} + +func (atu *APITokenUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := atu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(apitoken.Table, apitoken.Columns, sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString)) + if ps := atu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if atu.mutation.CreatedAtCleared() { + _spec.ClearField(apitoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := atu.mutation.UpdatedAt(); ok { + _spec.SetField(apitoken.FieldUpdatedAt, field.TypeTime, value) + } + if atu.mutation.UpdatedAtCleared() { + _spec.ClearField(apitoken.FieldUpdatedAt, field.TypeTime) + } + if atu.mutation.CreatedByCleared() { + _spec.ClearField(apitoken.FieldCreatedBy, field.TypeString) + } + if value, ok := atu.mutation.UpdatedBy(); ok { + _spec.SetField(apitoken.FieldUpdatedBy, field.TypeString, value) + } + if atu.mutation.UpdatedByCleared() { + _spec.ClearField(apitoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := atu.mutation.DeletedAt(); ok { + _spec.SetField(apitoken.FieldDeletedAt, field.TypeTime, value) + } + if atu.mutation.DeletedAtCleared() { + _spec.ClearField(apitoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := atu.mutation.DeletedBy(); ok { + _spec.SetField(apitoken.FieldDeletedBy, field.TypeString, value) + } + if atu.mutation.DeletedByCleared() { + _spec.ClearField(apitoken.FieldDeletedBy, field.TypeString) + } + if value, ok := atu.mutation.Tags(); ok { + _spec.SetField(apitoken.FieldTags, field.TypeJSON, value) + } + if value, ok := atu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, apitoken.FieldTags, value) + }) + } + if atu.mutation.TagsCleared() { + _spec.ClearField(apitoken.FieldTags, field.TypeJSON) + } + if value, ok := atu.mutation.Name(); ok { + _spec.SetField(apitoken.FieldName, field.TypeString, value) + } + if value, ok := atu.mutation.ExpiresAt(); ok { + _spec.SetField(apitoken.FieldExpiresAt, field.TypeTime, value) + } + if atu.mutation.ExpiresAtCleared() { + _spec.ClearField(apitoken.FieldExpiresAt, field.TypeTime) + } + if value, ok := atu.mutation.Description(); ok { + _spec.SetField(apitoken.FieldDescription, field.TypeString, value) + } + if atu.mutation.DescriptionCleared() { + _spec.ClearField(apitoken.FieldDescription, field.TypeString) + } + if value, ok := atu.mutation.Scopes(); ok { + _spec.SetField(apitoken.FieldScopes, field.TypeJSON, value) + } + if value, ok := atu.mutation.AppendedScopes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, apitoken.FieldScopes, value) + }) + } + if atu.mutation.ScopesCleared() { + _spec.ClearField(apitoken.FieldScopes, field.TypeJSON) + } + if value, ok := atu.mutation.LastUsedAt(); ok { + _spec.SetField(apitoken.FieldLastUsedAt, field.TypeTime, value) + } + if atu.mutation.LastUsedAtCleared() { + _spec.ClearField(apitoken.FieldLastUsedAt, field.TypeTime) + } + if atu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: apitoken.OwnerTable, + Columns: []string{apitoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = atu.schemaConfig.APIToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := atu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: apitoken.OwnerTable, + Columns: []string{apitoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = atu.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = atu.schemaConfig.APIToken + ctx = internal.NewSchemaConfigContext(ctx, atu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, atu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{apitoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + atu.mutation.done = true + return n, nil +} + +// APITokenUpdateOne is the builder for updating a single APIToken entity. +type APITokenUpdateOne struct { + config + fields []string + hooks []Hook + mutation *APITokenMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (atuo *APITokenUpdateOne) SetUpdatedAt(t time.Time) *APITokenUpdateOne { + atuo.mutation.SetUpdatedAt(t) + return atuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (atuo *APITokenUpdateOne) ClearUpdatedAt() *APITokenUpdateOne { + atuo.mutation.ClearUpdatedAt() + return atuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (atuo *APITokenUpdateOne) SetUpdatedBy(s string) *APITokenUpdateOne { + atuo.mutation.SetUpdatedBy(s) + return atuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableUpdatedBy(s *string) *APITokenUpdateOne { + if s != nil { + atuo.SetUpdatedBy(*s) + } + return atuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (atuo *APITokenUpdateOne) ClearUpdatedBy() *APITokenUpdateOne { + atuo.mutation.ClearUpdatedBy() + return atuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (atuo *APITokenUpdateOne) SetDeletedAt(t time.Time) *APITokenUpdateOne { + atuo.mutation.SetDeletedAt(t) + return atuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableDeletedAt(t *time.Time) *APITokenUpdateOne { + if t != nil { + atuo.SetDeletedAt(*t) + } + return atuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (atuo *APITokenUpdateOne) ClearDeletedAt() *APITokenUpdateOne { + atuo.mutation.ClearDeletedAt() + return atuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (atuo *APITokenUpdateOne) SetDeletedBy(s string) *APITokenUpdateOne { + atuo.mutation.SetDeletedBy(s) + return atuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableDeletedBy(s *string) *APITokenUpdateOne { + if s != nil { + atuo.SetDeletedBy(*s) + } + return atuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (atuo *APITokenUpdateOne) ClearDeletedBy() *APITokenUpdateOne { + atuo.mutation.ClearDeletedBy() + return atuo +} + +// SetTags sets the "tags" field. +func (atuo *APITokenUpdateOne) SetTags(s []string) *APITokenUpdateOne { + atuo.mutation.SetTags(s) + return atuo +} + +// AppendTags appends s to the "tags" field. +func (atuo *APITokenUpdateOne) AppendTags(s []string) *APITokenUpdateOne { + atuo.mutation.AppendTags(s) + return atuo +} + +// ClearTags clears the value of the "tags" field. +func (atuo *APITokenUpdateOne) ClearTags() *APITokenUpdateOne { + atuo.mutation.ClearTags() + return atuo +} + +// SetOwnerID sets the "owner_id" field. +func (atuo *APITokenUpdateOne) SetOwnerID(s string) *APITokenUpdateOne { + atuo.mutation.SetOwnerID(s) + return atuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableOwnerID(s *string) *APITokenUpdateOne { + if s != nil { + atuo.SetOwnerID(*s) + } + return atuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (atuo *APITokenUpdateOne) ClearOwnerID() *APITokenUpdateOne { + atuo.mutation.ClearOwnerID() + return atuo +} + +// SetName sets the "name" field. +func (atuo *APITokenUpdateOne) SetName(s string) *APITokenUpdateOne { + atuo.mutation.SetName(s) + return atuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableName(s *string) *APITokenUpdateOne { + if s != nil { + atuo.SetName(*s) + } + return atuo +} + +// SetExpiresAt sets the "expires_at" field. +func (atuo *APITokenUpdateOne) SetExpiresAt(t time.Time) *APITokenUpdateOne { + atuo.mutation.SetExpiresAt(t) + return atuo +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableExpiresAt(t *time.Time) *APITokenUpdateOne { + if t != nil { + atuo.SetExpiresAt(*t) + } + return atuo +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (atuo *APITokenUpdateOne) ClearExpiresAt() *APITokenUpdateOne { + atuo.mutation.ClearExpiresAt() + return atuo +} + +// SetDescription sets the "description" field. +func (atuo *APITokenUpdateOne) SetDescription(s string) *APITokenUpdateOne { + atuo.mutation.SetDescription(s) + return atuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableDescription(s *string) *APITokenUpdateOne { + if s != nil { + atuo.SetDescription(*s) + } + return atuo +} + +// ClearDescription clears the value of the "description" field. +func (atuo *APITokenUpdateOne) ClearDescription() *APITokenUpdateOne { + atuo.mutation.ClearDescription() + return atuo +} + +// SetScopes sets the "scopes" field. +func (atuo *APITokenUpdateOne) SetScopes(s []string) *APITokenUpdateOne { + atuo.mutation.SetScopes(s) + return atuo +} + +// AppendScopes appends s to the "scopes" field. +func (atuo *APITokenUpdateOne) AppendScopes(s []string) *APITokenUpdateOne { + atuo.mutation.AppendScopes(s) + return atuo +} + +// ClearScopes clears the value of the "scopes" field. +func (atuo *APITokenUpdateOne) ClearScopes() *APITokenUpdateOne { + atuo.mutation.ClearScopes() + return atuo +} + +// SetLastUsedAt sets the "last_used_at" field. +func (atuo *APITokenUpdateOne) SetLastUsedAt(t time.Time) *APITokenUpdateOne { + atuo.mutation.SetLastUsedAt(t) + return atuo +} + +// SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil. +func (atuo *APITokenUpdateOne) SetNillableLastUsedAt(t *time.Time) *APITokenUpdateOne { + if t != nil { + atuo.SetLastUsedAt(*t) + } + return atuo +} + +// ClearLastUsedAt clears the value of the "last_used_at" field. +func (atuo *APITokenUpdateOne) ClearLastUsedAt() *APITokenUpdateOne { + atuo.mutation.ClearLastUsedAt() + return atuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (atuo *APITokenUpdateOne) SetOwner(o *Organization) *APITokenUpdateOne { + return atuo.SetOwnerID(o.ID) +} + +// Mutation returns the APITokenMutation object of the builder. +func (atuo *APITokenUpdateOne) Mutation() *APITokenMutation { + return atuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (atuo *APITokenUpdateOne) ClearOwner() *APITokenUpdateOne { + atuo.mutation.ClearOwner() + return atuo +} + +// Where appends a list predicates to the APITokenUpdate builder. +func (atuo *APITokenUpdateOne) Where(ps ...predicate.APIToken) *APITokenUpdateOne { + atuo.mutation.Where(ps...) + return atuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (atuo *APITokenUpdateOne) Select(field string, fields ...string) *APITokenUpdateOne { + atuo.fields = append([]string{field}, fields...) + return atuo +} + +// Save executes the query and returns the updated APIToken entity. +func (atuo *APITokenUpdateOne) Save(ctx context.Context) (*APIToken, error) { + if err := atuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, atuo.sqlSave, atuo.mutation, atuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (atuo *APITokenUpdateOne) SaveX(ctx context.Context) *APIToken { + node, err := atuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (atuo *APITokenUpdateOne) Exec(ctx context.Context) error { + _, err := atuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (atuo *APITokenUpdateOne) ExecX(ctx context.Context) { + if err := atuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (atuo *APITokenUpdateOne) defaults() error { + if _, ok := atuo.mutation.UpdatedAt(); !ok && !atuo.mutation.UpdatedAtCleared() { + if apitoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized apitoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := apitoken.UpdateDefaultUpdatedAt() + atuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (atuo *APITokenUpdateOne) check() error { + if v, ok := atuo.mutation.OwnerID(); ok { + if err := apitoken.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "APIToken.owner_id": %w`, err)} + } + } + if v, ok := atuo.mutation.Name(); ok { + if err := apitoken.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "APIToken.name": %w`, err)} + } + } + return nil +} + +func (atuo *APITokenUpdateOne) sqlSave(ctx context.Context) (_node *APIToken, err error) { + if err := atuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(apitoken.Table, apitoken.Columns, sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString)) + id, ok := atuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "APIToken.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := atuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, apitoken.FieldID) + for _, f := range fields { + if !apitoken.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != apitoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := atuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if atuo.mutation.CreatedAtCleared() { + _spec.ClearField(apitoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := atuo.mutation.UpdatedAt(); ok { + _spec.SetField(apitoken.FieldUpdatedAt, field.TypeTime, value) + } + if atuo.mutation.UpdatedAtCleared() { + _spec.ClearField(apitoken.FieldUpdatedAt, field.TypeTime) + } + if atuo.mutation.CreatedByCleared() { + _spec.ClearField(apitoken.FieldCreatedBy, field.TypeString) + } + if value, ok := atuo.mutation.UpdatedBy(); ok { + _spec.SetField(apitoken.FieldUpdatedBy, field.TypeString, value) + } + if atuo.mutation.UpdatedByCleared() { + _spec.ClearField(apitoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := atuo.mutation.DeletedAt(); ok { + _spec.SetField(apitoken.FieldDeletedAt, field.TypeTime, value) + } + if atuo.mutation.DeletedAtCleared() { + _spec.ClearField(apitoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := atuo.mutation.DeletedBy(); ok { + _spec.SetField(apitoken.FieldDeletedBy, field.TypeString, value) + } + if atuo.mutation.DeletedByCleared() { + _spec.ClearField(apitoken.FieldDeletedBy, field.TypeString) + } + if value, ok := atuo.mutation.Tags(); ok { + _spec.SetField(apitoken.FieldTags, field.TypeJSON, value) + } + if value, ok := atuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, apitoken.FieldTags, value) + }) + } + if atuo.mutation.TagsCleared() { + _spec.ClearField(apitoken.FieldTags, field.TypeJSON) + } + if value, ok := atuo.mutation.Name(); ok { + _spec.SetField(apitoken.FieldName, field.TypeString, value) + } + if value, ok := atuo.mutation.ExpiresAt(); ok { + _spec.SetField(apitoken.FieldExpiresAt, field.TypeTime, value) + } + if atuo.mutation.ExpiresAtCleared() { + _spec.ClearField(apitoken.FieldExpiresAt, field.TypeTime) + } + if value, ok := atuo.mutation.Description(); ok { + _spec.SetField(apitoken.FieldDescription, field.TypeString, value) + } + if atuo.mutation.DescriptionCleared() { + _spec.ClearField(apitoken.FieldDescription, field.TypeString) + } + if value, ok := atuo.mutation.Scopes(); ok { + _spec.SetField(apitoken.FieldScopes, field.TypeJSON, value) + } + if value, ok := atuo.mutation.AppendedScopes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, apitoken.FieldScopes, value) + }) + } + if atuo.mutation.ScopesCleared() { + _spec.ClearField(apitoken.FieldScopes, field.TypeJSON) + } + if value, ok := atuo.mutation.LastUsedAt(); ok { + _spec.SetField(apitoken.FieldLastUsedAt, field.TypeTime, value) + } + if atuo.mutation.LastUsedAtCleared() { + _spec.ClearField(apitoken.FieldLastUsedAt, field.TypeTime) + } + if atuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: apitoken.OwnerTable, + Columns: []string{apitoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = atuo.schemaConfig.APIToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := atuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: apitoken.OwnerTable, + Columns: []string{apitoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = atuo.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = atuo.schemaConfig.APIToken + ctx = internal.NewSchemaConfigContext(ctx, atuo.schemaConfig) + _node = &APIToken{config: atuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, atuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{apitoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + atuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/auditing.go b/internal/ent/generated/auditing.go new file mode 100644 index 0000000..d349518 --- /dev/null +++ b/internal/ent/generated/auditing.go @@ -0,0 +1,3420 @@ +// Code generated by entx.history, DO NOT EDIT. +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "reflect" + "strings" + "time" + + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/theopenlane/entx/history" +) + +type Change struct { + FieldName string + Old any + New any +} + +func NewChange(fieldName string, old, new any) Change { + return Change{ + FieldName: fieldName, + Old: old, + New: new, + } +} + +type HistoryDiff[T any] struct { + Old *T + New *T + Changes []Change +} + +var ( + MismatchedRefError = errors.New("cannot take diff of histories with different Refs") + IdenticalHistoryError = errors.New("cannot take diff of identical history") +) + +func (ch *ContactHistory) changes(new *ContactHistory) []Change { + var changes []Change + if !reflect.DeepEqual(ch.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(contacthistory.FieldCreatedAt, ch.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(ch.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(contacthistory.FieldUpdatedAt, ch.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(ch.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(contacthistory.FieldCreatedBy, ch.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(ch.MappingID, new.MappingID) { + changes = append(changes, NewChange(contacthistory.FieldMappingID, ch.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(ch.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(contacthistory.FieldDeletedAt, ch.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(ch.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(contacthistory.FieldDeletedBy, ch.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(ch.Tags, new.Tags) { + changes = append(changes, NewChange(contacthistory.FieldTags, ch.Tags, new.Tags)) + } + if !reflect.DeepEqual(ch.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(contacthistory.FieldOwnerID, ch.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(ch.FullName, new.FullName) { + changes = append(changes, NewChange(contacthistory.FieldFullName, ch.FullName, new.FullName)) + } + if !reflect.DeepEqual(ch.Title, new.Title) { + changes = append(changes, NewChange(contacthistory.FieldTitle, ch.Title, new.Title)) + } + if !reflect.DeepEqual(ch.Company, new.Company) { + changes = append(changes, NewChange(contacthistory.FieldCompany, ch.Company, new.Company)) + } + if !reflect.DeepEqual(ch.Email, new.Email) { + changes = append(changes, NewChange(contacthistory.FieldEmail, ch.Email, new.Email)) + } + if !reflect.DeepEqual(ch.PhoneNumber, new.PhoneNumber) { + changes = append(changes, NewChange(contacthistory.FieldPhoneNumber, ch.PhoneNumber, new.PhoneNumber)) + } + if !reflect.DeepEqual(ch.Address, new.Address) { + changes = append(changes, NewChange(contacthistory.FieldAddress, ch.Address, new.Address)) + } + if !reflect.DeepEqual(ch.Status, new.Status) { + changes = append(changes, NewChange(contacthistory.FieldStatus, ch.Status, new.Status)) + } + return changes +} + +func (ch *ContactHistory) Diff(history *ContactHistory) (*HistoryDiff[ContactHistory], error) { + if ch.Ref != history.Ref { + return nil, MismatchedRefError + } + + chUnix, historyUnix := ch.HistoryTime.Unix(), history.HistoryTime.Unix() + chOlder := chUnix < historyUnix || (chUnix == historyUnix && ch.ID < history.ID) + historyOlder := chUnix > historyUnix || (chUnix == historyUnix && ch.ID > history.ID) + + if chOlder { + return &HistoryDiff[ContactHistory]{ + Old: ch, + New: history, + Changes: ch.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[ContactHistory]{ + Old: history, + New: ch, + Changes: history.changes(ch), + }, nil + } + return nil, IdenticalHistoryError +} + +func (ddh *DocumentDataHistory) changes(new *DocumentDataHistory) []Change { + var changes []Change + if !reflect.DeepEqual(ddh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(documentdatahistory.FieldCreatedAt, ddh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(ddh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(documentdatahistory.FieldUpdatedAt, ddh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(ddh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(documentdatahistory.FieldCreatedBy, ddh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(ddh.MappingID, new.MappingID) { + changes = append(changes, NewChange(documentdatahistory.FieldMappingID, ddh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(ddh.Tags, new.Tags) { + changes = append(changes, NewChange(documentdatahistory.FieldTags, ddh.Tags, new.Tags)) + } + if !reflect.DeepEqual(ddh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(documentdatahistory.FieldDeletedAt, ddh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(ddh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(documentdatahistory.FieldDeletedBy, ddh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(ddh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(documentdatahistory.FieldOwnerID, ddh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(ddh.TemplateID, new.TemplateID) { + changes = append(changes, NewChange(documentdatahistory.FieldTemplateID, ddh.TemplateID, new.TemplateID)) + } + if !reflect.DeepEqual(ddh.Data, new.Data) { + changes = append(changes, NewChange(documentdatahistory.FieldData, ddh.Data, new.Data)) + } + return changes +} + +func (ddh *DocumentDataHistory) Diff(history *DocumentDataHistory) (*HistoryDiff[DocumentDataHistory], error) { + if ddh.Ref != history.Ref { + return nil, MismatchedRefError + } + + ddhUnix, historyUnix := ddh.HistoryTime.Unix(), history.HistoryTime.Unix() + ddhOlder := ddhUnix < historyUnix || (ddhUnix == historyUnix && ddh.ID < history.ID) + historyOlder := ddhUnix > historyUnix || (ddhUnix == historyUnix && ddh.ID > history.ID) + + if ddhOlder { + return &HistoryDiff[DocumentDataHistory]{ + Old: ddh, + New: history, + Changes: ddh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[DocumentDataHistory]{ + Old: history, + New: ddh, + Changes: history.changes(ddh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (eh *EntitlementHistory) changes(new *EntitlementHistory) []Change { + var changes []Change + if !reflect.DeepEqual(eh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(entitlementhistory.FieldCreatedAt, eh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(eh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(entitlementhistory.FieldUpdatedAt, eh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(eh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(entitlementhistory.FieldCreatedBy, eh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(eh.MappingID, new.MappingID) { + changes = append(changes, NewChange(entitlementhistory.FieldMappingID, eh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(eh.Tags, new.Tags) { + changes = append(changes, NewChange(entitlementhistory.FieldTags, eh.Tags, new.Tags)) + } + if !reflect.DeepEqual(eh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(entitlementhistory.FieldDeletedAt, eh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(eh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(entitlementhistory.FieldDeletedBy, eh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(eh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(entitlementhistory.FieldOwnerID, eh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(eh.PlanID, new.PlanID) { + changes = append(changes, NewChange(entitlementhistory.FieldPlanID, eh.PlanID, new.PlanID)) + } + if !reflect.DeepEqual(eh.OrganizationID, new.OrganizationID) { + changes = append(changes, NewChange(entitlementhistory.FieldOrganizationID, eh.OrganizationID, new.OrganizationID)) + } + if !reflect.DeepEqual(eh.ExternalCustomerID, new.ExternalCustomerID) { + changes = append(changes, NewChange(entitlementhistory.FieldExternalCustomerID, eh.ExternalCustomerID, new.ExternalCustomerID)) + } + if !reflect.DeepEqual(eh.ExternalSubscriptionID, new.ExternalSubscriptionID) { + changes = append(changes, NewChange(entitlementhistory.FieldExternalSubscriptionID, eh.ExternalSubscriptionID, new.ExternalSubscriptionID)) + } + if !reflect.DeepEqual(eh.Expires, new.Expires) { + changes = append(changes, NewChange(entitlementhistory.FieldExpires, eh.Expires, new.Expires)) + } + if !reflect.DeepEqual(eh.ExpiresAt, new.ExpiresAt) { + changes = append(changes, NewChange(entitlementhistory.FieldExpiresAt, eh.ExpiresAt, new.ExpiresAt)) + } + if !reflect.DeepEqual(eh.Cancelled, new.Cancelled) { + changes = append(changes, NewChange(entitlementhistory.FieldCancelled, eh.Cancelled, new.Cancelled)) + } + return changes +} + +func (eh *EntitlementHistory) Diff(history *EntitlementHistory) (*HistoryDiff[EntitlementHistory], error) { + if eh.Ref != history.Ref { + return nil, MismatchedRefError + } + + ehUnix, historyUnix := eh.HistoryTime.Unix(), history.HistoryTime.Unix() + ehOlder := ehUnix < historyUnix || (ehUnix == historyUnix && eh.ID < history.ID) + historyOlder := ehUnix > historyUnix || (ehUnix == historyUnix && eh.ID > history.ID) + + if ehOlder { + return &HistoryDiff[EntitlementHistory]{ + Old: eh, + New: history, + Changes: eh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[EntitlementHistory]{ + Old: history, + New: eh, + Changes: history.changes(eh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (eph *EntitlementPlanHistory) changes(new *EntitlementPlanHistory) []Change { + var changes []Change + if !reflect.DeepEqual(eph.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(entitlementplanhistory.FieldCreatedAt, eph.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(eph.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(entitlementplanhistory.FieldUpdatedAt, eph.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(eph.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(entitlementplanhistory.FieldCreatedBy, eph.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(eph.MappingID, new.MappingID) { + changes = append(changes, NewChange(entitlementplanhistory.FieldMappingID, eph.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(eph.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(entitlementplanhistory.FieldDeletedAt, eph.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(eph.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(entitlementplanhistory.FieldDeletedBy, eph.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(eph.Tags, new.Tags) { + changes = append(changes, NewChange(entitlementplanhistory.FieldTags, eph.Tags, new.Tags)) + } + if !reflect.DeepEqual(eph.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(entitlementplanhistory.FieldOwnerID, eph.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(eph.DisplayName, new.DisplayName) { + changes = append(changes, NewChange(entitlementplanhistory.FieldDisplayName, eph.DisplayName, new.DisplayName)) + } + if !reflect.DeepEqual(eph.Name, new.Name) { + changes = append(changes, NewChange(entitlementplanhistory.FieldName, eph.Name, new.Name)) + } + if !reflect.DeepEqual(eph.Description, new.Description) { + changes = append(changes, NewChange(entitlementplanhistory.FieldDescription, eph.Description, new.Description)) + } + if !reflect.DeepEqual(eph.Version, new.Version) { + changes = append(changes, NewChange(entitlementplanhistory.FieldVersion, eph.Version, new.Version)) + } + if !reflect.DeepEqual(eph.Metadata, new.Metadata) { + changes = append(changes, NewChange(entitlementplanhistory.FieldMetadata, eph.Metadata, new.Metadata)) + } + return changes +} + +func (eph *EntitlementPlanHistory) Diff(history *EntitlementPlanHistory) (*HistoryDiff[EntitlementPlanHistory], error) { + if eph.Ref != history.Ref { + return nil, MismatchedRefError + } + + ephUnix, historyUnix := eph.HistoryTime.Unix(), history.HistoryTime.Unix() + ephOlder := ephUnix < historyUnix || (ephUnix == historyUnix && eph.ID < history.ID) + historyOlder := ephUnix > historyUnix || (ephUnix == historyUnix && eph.ID > history.ID) + + if ephOlder { + return &HistoryDiff[EntitlementPlanHistory]{ + Old: eph, + New: history, + Changes: eph.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[EntitlementPlanHistory]{ + Old: history, + New: eph, + Changes: history.changes(eph), + }, nil + } + return nil, IdenticalHistoryError +} + +func (epfh *EntitlementPlanFeatureHistory) changes(new *EntitlementPlanFeatureHistory) []Change { + var changes []Change + if !reflect.DeepEqual(epfh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldCreatedAt, epfh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(epfh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldUpdatedAt, epfh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(epfh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldCreatedBy, epfh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(epfh.MappingID, new.MappingID) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldMappingID, epfh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(epfh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldDeletedAt, epfh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(epfh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldDeletedBy, epfh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(epfh.Tags, new.Tags) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldTags, epfh.Tags, new.Tags)) + } + if !reflect.DeepEqual(epfh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldOwnerID, epfh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(epfh.Metadata, new.Metadata) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldMetadata, epfh.Metadata, new.Metadata)) + } + if !reflect.DeepEqual(epfh.PlanID, new.PlanID) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldPlanID, epfh.PlanID, new.PlanID)) + } + if !reflect.DeepEqual(epfh.FeatureID, new.FeatureID) { + changes = append(changes, NewChange(entitlementplanfeaturehistory.FieldFeatureID, epfh.FeatureID, new.FeatureID)) + } + return changes +} + +func (epfh *EntitlementPlanFeatureHistory) Diff(history *EntitlementPlanFeatureHistory) (*HistoryDiff[EntitlementPlanFeatureHistory], error) { + if epfh.Ref != history.Ref { + return nil, MismatchedRefError + } + + epfhUnix, historyUnix := epfh.HistoryTime.Unix(), history.HistoryTime.Unix() + epfhOlder := epfhUnix < historyUnix || (epfhUnix == historyUnix && epfh.ID < history.ID) + historyOlder := epfhUnix > historyUnix || (epfhUnix == historyUnix && epfh.ID > history.ID) + + if epfhOlder { + return &HistoryDiff[EntitlementPlanFeatureHistory]{ + Old: epfh, + New: history, + Changes: epfh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[EntitlementPlanFeatureHistory]{ + Old: history, + New: epfh, + Changes: history.changes(epfh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (eh *EntityHistory) changes(new *EntityHistory) []Change { + var changes []Change + if !reflect.DeepEqual(eh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(entityhistory.FieldCreatedAt, eh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(eh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(entityhistory.FieldUpdatedAt, eh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(eh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(entityhistory.FieldCreatedBy, eh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(eh.MappingID, new.MappingID) { + changes = append(changes, NewChange(entityhistory.FieldMappingID, eh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(eh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(entityhistory.FieldDeletedAt, eh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(eh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(entityhistory.FieldDeletedBy, eh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(eh.Tags, new.Tags) { + changes = append(changes, NewChange(entityhistory.FieldTags, eh.Tags, new.Tags)) + } + if !reflect.DeepEqual(eh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(entityhistory.FieldOwnerID, eh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(eh.Name, new.Name) { + changes = append(changes, NewChange(entityhistory.FieldName, eh.Name, new.Name)) + } + if !reflect.DeepEqual(eh.DisplayName, new.DisplayName) { + changes = append(changes, NewChange(entityhistory.FieldDisplayName, eh.DisplayName, new.DisplayName)) + } + if !reflect.DeepEqual(eh.Description, new.Description) { + changes = append(changes, NewChange(entityhistory.FieldDescription, eh.Description, new.Description)) + } + if !reflect.DeepEqual(eh.Domains, new.Domains) { + changes = append(changes, NewChange(entityhistory.FieldDomains, eh.Domains, new.Domains)) + } + if !reflect.DeepEqual(eh.EntityTypeID, new.EntityTypeID) { + changes = append(changes, NewChange(entityhistory.FieldEntityTypeID, eh.EntityTypeID, new.EntityTypeID)) + } + if !reflect.DeepEqual(eh.Status, new.Status) { + changes = append(changes, NewChange(entityhistory.FieldStatus, eh.Status, new.Status)) + } + return changes +} + +func (eh *EntityHistory) Diff(history *EntityHistory) (*HistoryDiff[EntityHistory], error) { + if eh.Ref != history.Ref { + return nil, MismatchedRefError + } + + ehUnix, historyUnix := eh.HistoryTime.Unix(), history.HistoryTime.Unix() + ehOlder := ehUnix < historyUnix || (ehUnix == historyUnix && eh.ID < history.ID) + historyOlder := ehUnix > historyUnix || (ehUnix == historyUnix && eh.ID > history.ID) + + if ehOlder { + return &HistoryDiff[EntityHistory]{ + Old: eh, + New: history, + Changes: eh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[EntityHistory]{ + Old: history, + New: eh, + Changes: history.changes(eh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (eth *EntityTypeHistory) changes(new *EntityTypeHistory) []Change { + var changes []Change + if !reflect.DeepEqual(eth.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(entitytypehistory.FieldCreatedAt, eth.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(eth.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(entitytypehistory.FieldUpdatedAt, eth.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(eth.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(entitytypehistory.FieldCreatedBy, eth.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(eth.MappingID, new.MappingID) { + changes = append(changes, NewChange(entitytypehistory.FieldMappingID, eth.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(eth.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(entitytypehistory.FieldDeletedAt, eth.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(eth.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(entitytypehistory.FieldDeletedBy, eth.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(eth.Tags, new.Tags) { + changes = append(changes, NewChange(entitytypehistory.FieldTags, eth.Tags, new.Tags)) + } + if !reflect.DeepEqual(eth.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(entitytypehistory.FieldOwnerID, eth.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(eth.Name, new.Name) { + changes = append(changes, NewChange(entitytypehistory.FieldName, eth.Name, new.Name)) + } + return changes +} + +func (eth *EntityTypeHistory) Diff(history *EntityTypeHistory) (*HistoryDiff[EntityTypeHistory], error) { + if eth.Ref != history.Ref { + return nil, MismatchedRefError + } + + ethUnix, historyUnix := eth.HistoryTime.Unix(), history.HistoryTime.Unix() + ethOlder := ethUnix < historyUnix || (ethUnix == historyUnix && eth.ID < history.ID) + historyOlder := ethUnix > historyUnix || (ethUnix == historyUnix && eth.ID > history.ID) + + if ethOlder { + return &HistoryDiff[EntityTypeHistory]{ + Old: eth, + New: history, + Changes: eth.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[EntityTypeHistory]{ + Old: history, + New: eth, + Changes: history.changes(eth), + }, nil + } + return nil, IdenticalHistoryError +} + +func (eh *EventHistory) changes(new *EventHistory) []Change { + var changes []Change + if !reflect.DeepEqual(eh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(eventhistory.FieldCreatedAt, eh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(eh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(eventhistory.FieldUpdatedAt, eh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(eh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(eventhistory.FieldCreatedBy, eh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(eh.MappingID, new.MappingID) { + changes = append(changes, NewChange(eventhistory.FieldMappingID, eh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(eh.Tags, new.Tags) { + changes = append(changes, NewChange(eventhistory.FieldTags, eh.Tags, new.Tags)) + } + if !reflect.DeepEqual(eh.EventID, new.EventID) { + changes = append(changes, NewChange(eventhistory.FieldEventID, eh.EventID, new.EventID)) + } + if !reflect.DeepEqual(eh.CorrelationID, new.CorrelationID) { + changes = append(changes, NewChange(eventhistory.FieldCorrelationID, eh.CorrelationID, new.CorrelationID)) + } + if !reflect.DeepEqual(eh.EventType, new.EventType) { + changes = append(changes, NewChange(eventhistory.FieldEventType, eh.EventType, new.EventType)) + } + if !reflect.DeepEqual(eh.Metadata, new.Metadata) { + changes = append(changes, NewChange(eventhistory.FieldMetadata, eh.Metadata, new.Metadata)) + } + return changes +} + +func (eh *EventHistory) Diff(history *EventHistory) (*HistoryDiff[EventHistory], error) { + if eh.Ref != history.Ref { + return nil, MismatchedRefError + } + + ehUnix, historyUnix := eh.HistoryTime.Unix(), history.HistoryTime.Unix() + ehOlder := ehUnix < historyUnix || (ehUnix == historyUnix && eh.ID < history.ID) + historyOlder := ehUnix > historyUnix || (ehUnix == historyUnix && eh.ID > history.ID) + + if ehOlder { + return &HistoryDiff[EventHistory]{ + Old: eh, + New: history, + Changes: eh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[EventHistory]{ + Old: history, + New: eh, + Changes: history.changes(eh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (fh *FeatureHistory) changes(new *FeatureHistory) []Change { + var changes []Change + if !reflect.DeepEqual(fh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(featurehistory.FieldCreatedAt, fh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(fh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(featurehistory.FieldUpdatedAt, fh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(fh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(featurehistory.FieldCreatedBy, fh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(fh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(featurehistory.FieldDeletedAt, fh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(fh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(featurehistory.FieldDeletedBy, fh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(fh.MappingID, new.MappingID) { + changes = append(changes, NewChange(featurehistory.FieldMappingID, fh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(fh.Tags, new.Tags) { + changes = append(changes, NewChange(featurehistory.FieldTags, fh.Tags, new.Tags)) + } + if !reflect.DeepEqual(fh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(featurehistory.FieldOwnerID, fh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(fh.Name, new.Name) { + changes = append(changes, NewChange(featurehistory.FieldName, fh.Name, new.Name)) + } + if !reflect.DeepEqual(fh.DisplayName, new.DisplayName) { + changes = append(changes, NewChange(featurehistory.FieldDisplayName, fh.DisplayName, new.DisplayName)) + } + if !reflect.DeepEqual(fh.Enabled, new.Enabled) { + changes = append(changes, NewChange(featurehistory.FieldEnabled, fh.Enabled, new.Enabled)) + } + if !reflect.DeepEqual(fh.Description, new.Description) { + changes = append(changes, NewChange(featurehistory.FieldDescription, fh.Description, new.Description)) + } + if !reflect.DeepEqual(fh.Metadata, new.Metadata) { + changes = append(changes, NewChange(featurehistory.FieldMetadata, fh.Metadata, new.Metadata)) + } + return changes +} + +func (fh *FeatureHistory) Diff(history *FeatureHistory) (*HistoryDiff[FeatureHistory], error) { + if fh.Ref != history.Ref { + return nil, MismatchedRefError + } + + fhUnix, historyUnix := fh.HistoryTime.Unix(), history.HistoryTime.Unix() + fhOlder := fhUnix < historyUnix || (fhUnix == historyUnix && fh.ID < history.ID) + historyOlder := fhUnix > historyUnix || (fhUnix == historyUnix && fh.ID > history.ID) + + if fhOlder { + return &HistoryDiff[FeatureHistory]{ + Old: fh, + New: history, + Changes: fh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[FeatureHistory]{ + Old: history, + New: fh, + Changes: history.changes(fh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (fh *FileHistory) changes(new *FileHistory) []Change { + var changes []Change + if !reflect.DeepEqual(fh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(filehistory.FieldCreatedAt, fh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(fh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(filehistory.FieldUpdatedAt, fh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(fh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(filehistory.FieldCreatedBy, fh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(fh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(filehistory.FieldDeletedAt, fh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(fh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(filehistory.FieldDeletedBy, fh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(fh.MappingID, new.MappingID) { + changes = append(changes, NewChange(filehistory.FieldMappingID, fh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(fh.Tags, new.Tags) { + changes = append(changes, NewChange(filehistory.FieldTags, fh.Tags, new.Tags)) + } + if !reflect.DeepEqual(fh.FileName, new.FileName) { + changes = append(changes, NewChange(filehistory.FieldFileName, fh.FileName, new.FileName)) + } + if !reflect.DeepEqual(fh.FileExtension, new.FileExtension) { + changes = append(changes, NewChange(filehistory.FieldFileExtension, fh.FileExtension, new.FileExtension)) + } + if !reflect.DeepEqual(fh.FileSize, new.FileSize) { + changes = append(changes, NewChange(filehistory.FieldFileSize, fh.FileSize, new.FileSize)) + } + if !reflect.DeepEqual(fh.ContentType, new.ContentType) { + changes = append(changes, NewChange(filehistory.FieldContentType, fh.ContentType, new.ContentType)) + } + if !reflect.DeepEqual(fh.StoreKey, new.StoreKey) { + changes = append(changes, NewChange(filehistory.FieldStoreKey, fh.StoreKey, new.StoreKey)) + } + if !reflect.DeepEqual(fh.Category, new.Category) { + changes = append(changes, NewChange(filehistory.FieldCategory, fh.Category, new.Category)) + } + if !reflect.DeepEqual(fh.Annotation, new.Annotation) { + changes = append(changes, NewChange(filehistory.FieldAnnotation, fh.Annotation, new.Annotation)) + } + return changes +} + +func (fh *FileHistory) Diff(history *FileHistory) (*HistoryDiff[FileHistory], error) { + if fh.Ref != history.Ref { + return nil, MismatchedRefError + } + + fhUnix, historyUnix := fh.HistoryTime.Unix(), history.HistoryTime.Unix() + fhOlder := fhUnix < historyUnix || (fhUnix == historyUnix && fh.ID < history.ID) + historyOlder := fhUnix > historyUnix || (fhUnix == historyUnix && fh.ID > history.ID) + + if fhOlder { + return &HistoryDiff[FileHistory]{ + Old: fh, + New: history, + Changes: fh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[FileHistory]{ + Old: history, + New: fh, + Changes: history.changes(fh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (gh *GroupHistory) changes(new *GroupHistory) []Change { + var changes []Change + if !reflect.DeepEqual(gh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(grouphistory.FieldCreatedAt, gh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(gh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(grouphistory.FieldUpdatedAt, gh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(gh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(grouphistory.FieldCreatedBy, gh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(gh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(grouphistory.FieldDeletedAt, gh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(gh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(grouphistory.FieldDeletedBy, gh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(gh.MappingID, new.MappingID) { + changes = append(changes, NewChange(grouphistory.FieldMappingID, gh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(gh.Tags, new.Tags) { + changes = append(changes, NewChange(grouphistory.FieldTags, gh.Tags, new.Tags)) + } + if !reflect.DeepEqual(gh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(grouphistory.FieldOwnerID, gh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(gh.Name, new.Name) { + changes = append(changes, NewChange(grouphistory.FieldName, gh.Name, new.Name)) + } + if !reflect.DeepEqual(gh.Description, new.Description) { + changes = append(changes, NewChange(grouphistory.FieldDescription, gh.Description, new.Description)) + } + if !reflect.DeepEqual(gh.GravatarLogoURL, new.GravatarLogoURL) { + changes = append(changes, NewChange(grouphistory.FieldGravatarLogoURL, gh.GravatarLogoURL, new.GravatarLogoURL)) + } + if !reflect.DeepEqual(gh.LogoURL, new.LogoURL) { + changes = append(changes, NewChange(grouphistory.FieldLogoURL, gh.LogoURL, new.LogoURL)) + } + if !reflect.DeepEqual(gh.DisplayName, new.DisplayName) { + changes = append(changes, NewChange(grouphistory.FieldDisplayName, gh.DisplayName, new.DisplayName)) + } + return changes +} + +func (gh *GroupHistory) Diff(history *GroupHistory) (*HistoryDiff[GroupHistory], error) { + if gh.Ref != history.Ref { + return nil, MismatchedRefError + } + + ghUnix, historyUnix := gh.HistoryTime.Unix(), history.HistoryTime.Unix() + ghOlder := ghUnix < historyUnix || (ghUnix == historyUnix && gh.ID < history.ID) + historyOlder := ghUnix > historyUnix || (ghUnix == historyUnix && gh.ID > history.ID) + + if ghOlder { + return &HistoryDiff[GroupHistory]{ + Old: gh, + New: history, + Changes: gh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[GroupHistory]{ + Old: history, + New: gh, + Changes: history.changes(gh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (gmh *GroupMembershipHistory) changes(new *GroupMembershipHistory) []Change { + var changes []Change + if !reflect.DeepEqual(gmh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(groupmembershiphistory.FieldCreatedAt, gmh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(gmh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(groupmembershiphistory.FieldUpdatedAt, gmh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(gmh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(groupmembershiphistory.FieldCreatedBy, gmh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(gmh.MappingID, new.MappingID) { + changes = append(changes, NewChange(groupmembershiphistory.FieldMappingID, gmh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(gmh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(groupmembershiphistory.FieldDeletedAt, gmh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(gmh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(groupmembershiphistory.FieldDeletedBy, gmh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(gmh.Role, new.Role) { + changes = append(changes, NewChange(groupmembershiphistory.FieldRole, gmh.Role, new.Role)) + } + if !reflect.DeepEqual(gmh.GroupID, new.GroupID) { + changes = append(changes, NewChange(groupmembershiphistory.FieldGroupID, gmh.GroupID, new.GroupID)) + } + if !reflect.DeepEqual(gmh.UserID, new.UserID) { + changes = append(changes, NewChange(groupmembershiphistory.FieldUserID, gmh.UserID, new.UserID)) + } + return changes +} + +func (gmh *GroupMembershipHistory) Diff(history *GroupMembershipHistory) (*HistoryDiff[GroupMembershipHistory], error) { + if gmh.Ref != history.Ref { + return nil, MismatchedRefError + } + + gmhUnix, historyUnix := gmh.HistoryTime.Unix(), history.HistoryTime.Unix() + gmhOlder := gmhUnix < historyUnix || (gmhUnix == historyUnix && gmh.ID < history.ID) + historyOlder := gmhUnix > historyUnix || (gmhUnix == historyUnix && gmh.ID > history.ID) + + if gmhOlder { + return &HistoryDiff[GroupMembershipHistory]{ + Old: gmh, + New: history, + Changes: gmh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[GroupMembershipHistory]{ + Old: history, + New: gmh, + Changes: history.changes(gmh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (gsh *GroupSettingHistory) changes(new *GroupSettingHistory) []Change { + var changes []Change + if !reflect.DeepEqual(gsh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(groupsettinghistory.FieldCreatedAt, gsh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(gsh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(groupsettinghistory.FieldUpdatedAt, gsh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(gsh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(groupsettinghistory.FieldCreatedBy, gsh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(gsh.MappingID, new.MappingID) { + changes = append(changes, NewChange(groupsettinghistory.FieldMappingID, gsh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(gsh.Tags, new.Tags) { + changes = append(changes, NewChange(groupsettinghistory.FieldTags, gsh.Tags, new.Tags)) + } + if !reflect.DeepEqual(gsh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(groupsettinghistory.FieldDeletedAt, gsh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(gsh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(groupsettinghistory.FieldDeletedBy, gsh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(gsh.Visibility, new.Visibility) { + changes = append(changes, NewChange(groupsettinghistory.FieldVisibility, gsh.Visibility, new.Visibility)) + } + if !reflect.DeepEqual(gsh.JoinPolicy, new.JoinPolicy) { + changes = append(changes, NewChange(groupsettinghistory.FieldJoinPolicy, gsh.JoinPolicy, new.JoinPolicy)) + } + if !reflect.DeepEqual(gsh.SyncToSlack, new.SyncToSlack) { + changes = append(changes, NewChange(groupsettinghistory.FieldSyncToSlack, gsh.SyncToSlack, new.SyncToSlack)) + } + if !reflect.DeepEqual(gsh.SyncToGithub, new.SyncToGithub) { + changes = append(changes, NewChange(groupsettinghistory.FieldSyncToGithub, gsh.SyncToGithub, new.SyncToGithub)) + } + if !reflect.DeepEqual(gsh.GroupID, new.GroupID) { + changes = append(changes, NewChange(groupsettinghistory.FieldGroupID, gsh.GroupID, new.GroupID)) + } + return changes +} + +func (gsh *GroupSettingHistory) Diff(history *GroupSettingHistory) (*HistoryDiff[GroupSettingHistory], error) { + if gsh.Ref != history.Ref { + return nil, MismatchedRefError + } + + gshUnix, historyUnix := gsh.HistoryTime.Unix(), history.HistoryTime.Unix() + gshOlder := gshUnix < historyUnix || (gshUnix == historyUnix && gsh.ID < history.ID) + historyOlder := gshUnix > historyUnix || (gshUnix == historyUnix && gsh.ID > history.ID) + + if gshOlder { + return &HistoryDiff[GroupSettingHistory]{ + Old: gsh, + New: history, + Changes: gsh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[GroupSettingHistory]{ + Old: history, + New: gsh, + Changes: history.changes(gsh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (hh *HushHistory) changes(new *HushHistory) []Change { + var changes []Change + if !reflect.DeepEqual(hh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(hushhistory.FieldCreatedAt, hh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(hh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(hushhistory.FieldUpdatedAt, hh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(hh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(hushhistory.FieldCreatedBy, hh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(hh.MappingID, new.MappingID) { + changes = append(changes, NewChange(hushhistory.FieldMappingID, hh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(hh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(hushhistory.FieldDeletedAt, hh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(hh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(hushhistory.FieldDeletedBy, hh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(hh.Name, new.Name) { + changes = append(changes, NewChange(hushhistory.FieldName, hh.Name, new.Name)) + } + if !reflect.DeepEqual(hh.Description, new.Description) { + changes = append(changes, NewChange(hushhistory.FieldDescription, hh.Description, new.Description)) + } + if !reflect.DeepEqual(hh.Kind, new.Kind) { + changes = append(changes, NewChange(hushhistory.FieldKind, hh.Kind, new.Kind)) + } + if !reflect.DeepEqual(hh.SecretName, new.SecretName) { + changes = append(changes, NewChange(hushhistory.FieldSecretName, hh.SecretName, new.SecretName)) + } + if !reflect.DeepEqual(hh.SecretValue, new.SecretValue) { + changes = append(changes, NewChange(hushhistory.FieldSecretValue, hh.SecretValue, new.SecretValue)) + } + return changes +} + +func (hh *HushHistory) Diff(history *HushHistory) (*HistoryDiff[HushHistory], error) { + if hh.Ref != history.Ref { + return nil, MismatchedRefError + } + + hhUnix, historyUnix := hh.HistoryTime.Unix(), history.HistoryTime.Unix() + hhOlder := hhUnix < historyUnix || (hhUnix == historyUnix && hh.ID < history.ID) + historyOlder := hhUnix > historyUnix || (hhUnix == historyUnix && hh.ID > history.ID) + + if hhOlder { + return &HistoryDiff[HushHistory]{ + Old: hh, + New: history, + Changes: hh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[HushHistory]{ + Old: history, + New: hh, + Changes: history.changes(hh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (ih *IntegrationHistory) changes(new *IntegrationHistory) []Change { + var changes []Change + if !reflect.DeepEqual(ih.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(integrationhistory.FieldCreatedAt, ih.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(ih.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(integrationhistory.FieldUpdatedAt, ih.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(ih.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(integrationhistory.FieldCreatedBy, ih.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(ih.MappingID, new.MappingID) { + changes = append(changes, NewChange(integrationhistory.FieldMappingID, ih.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(ih.Tags, new.Tags) { + changes = append(changes, NewChange(integrationhistory.FieldTags, ih.Tags, new.Tags)) + } + if !reflect.DeepEqual(ih.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(integrationhistory.FieldDeletedAt, ih.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(ih.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(integrationhistory.FieldDeletedBy, ih.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(ih.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(integrationhistory.FieldOwnerID, ih.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(ih.Name, new.Name) { + changes = append(changes, NewChange(integrationhistory.FieldName, ih.Name, new.Name)) + } + if !reflect.DeepEqual(ih.Description, new.Description) { + changes = append(changes, NewChange(integrationhistory.FieldDescription, ih.Description, new.Description)) + } + if !reflect.DeepEqual(ih.Kind, new.Kind) { + changes = append(changes, NewChange(integrationhistory.FieldKind, ih.Kind, new.Kind)) + } + return changes +} + +func (ih *IntegrationHistory) Diff(history *IntegrationHistory) (*HistoryDiff[IntegrationHistory], error) { + if ih.Ref != history.Ref { + return nil, MismatchedRefError + } + + ihUnix, historyUnix := ih.HistoryTime.Unix(), history.HistoryTime.Unix() + ihOlder := ihUnix < historyUnix || (ihUnix == historyUnix && ih.ID < history.ID) + historyOlder := ihUnix > historyUnix || (ihUnix == historyUnix && ih.ID > history.ID) + + if ihOlder { + return &HistoryDiff[IntegrationHistory]{ + Old: ih, + New: history, + Changes: ih.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[IntegrationHistory]{ + Old: history, + New: ih, + Changes: history.changes(ih), + }, nil + } + return nil, IdenticalHistoryError +} + +func (nh *NoteHistory) changes(new *NoteHistory) []Change { + var changes []Change + if !reflect.DeepEqual(nh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(notehistory.FieldCreatedAt, nh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(nh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(notehistory.FieldUpdatedAt, nh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(nh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(notehistory.FieldCreatedBy, nh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(nh.MappingID, new.MappingID) { + changes = append(changes, NewChange(notehistory.FieldMappingID, nh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(nh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(notehistory.FieldDeletedAt, nh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(nh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(notehistory.FieldDeletedBy, nh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(nh.Tags, new.Tags) { + changes = append(changes, NewChange(notehistory.FieldTags, nh.Tags, new.Tags)) + } + if !reflect.DeepEqual(nh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(notehistory.FieldOwnerID, nh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(nh.Text, new.Text) { + changes = append(changes, NewChange(notehistory.FieldText, nh.Text, new.Text)) + } + return changes +} + +func (nh *NoteHistory) Diff(history *NoteHistory) (*HistoryDiff[NoteHistory], error) { + if nh.Ref != history.Ref { + return nil, MismatchedRefError + } + + nhUnix, historyUnix := nh.HistoryTime.Unix(), history.HistoryTime.Unix() + nhOlder := nhUnix < historyUnix || (nhUnix == historyUnix && nh.ID < history.ID) + historyOlder := nhUnix > historyUnix || (nhUnix == historyUnix && nh.ID > history.ID) + + if nhOlder { + return &HistoryDiff[NoteHistory]{ + Old: nh, + New: history, + Changes: nh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[NoteHistory]{ + Old: history, + New: nh, + Changes: history.changes(nh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (oph *OauthProviderHistory) changes(new *OauthProviderHistory) []Change { + var changes []Change + if !reflect.DeepEqual(oph.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(oauthproviderhistory.FieldCreatedAt, oph.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(oph.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(oauthproviderhistory.FieldUpdatedAt, oph.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(oph.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(oauthproviderhistory.FieldCreatedBy, oph.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(oph.MappingID, new.MappingID) { + changes = append(changes, NewChange(oauthproviderhistory.FieldMappingID, oph.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(oph.Tags, new.Tags) { + changes = append(changes, NewChange(oauthproviderhistory.FieldTags, oph.Tags, new.Tags)) + } + if !reflect.DeepEqual(oph.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(oauthproviderhistory.FieldDeletedAt, oph.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(oph.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(oauthproviderhistory.FieldDeletedBy, oph.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(oph.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(oauthproviderhistory.FieldOwnerID, oph.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(oph.Name, new.Name) { + changes = append(changes, NewChange(oauthproviderhistory.FieldName, oph.Name, new.Name)) + } + if !reflect.DeepEqual(oph.ClientID, new.ClientID) { + changes = append(changes, NewChange(oauthproviderhistory.FieldClientID, oph.ClientID, new.ClientID)) + } + if !reflect.DeepEqual(oph.ClientSecret, new.ClientSecret) { + changes = append(changes, NewChange(oauthproviderhistory.FieldClientSecret, oph.ClientSecret, new.ClientSecret)) + } + if !reflect.DeepEqual(oph.RedirectURL, new.RedirectURL) { + changes = append(changes, NewChange(oauthproviderhistory.FieldRedirectURL, oph.RedirectURL, new.RedirectURL)) + } + if !reflect.DeepEqual(oph.Scopes, new.Scopes) { + changes = append(changes, NewChange(oauthproviderhistory.FieldScopes, oph.Scopes, new.Scopes)) + } + if !reflect.DeepEqual(oph.AuthURL, new.AuthURL) { + changes = append(changes, NewChange(oauthproviderhistory.FieldAuthURL, oph.AuthURL, new.AuthURL)) + } + if !reflect.DeepEqual(oph.TokenURL, new.TokenURL) { + changes = append(changes, NewChange(oauthproviderhistory.FieldTokenURL, oph.TokenURL, new.TokenURL)) + } + if !reflect.DeepEqual(oph.AuthStyle, new.AuthStyle) { + changes = append(changes, NewChange(oauthproviderhistory.FieldAuthStyle, oph.AuthStyle, new.AuthStyle)) + } + if !reflect.DeepEqual(oph.InfoURL, new.InfoURL) { + changes = append(changes, NewChange(oauthproviderhistory.FieldInfoURL, oph.InfoURL, new.InfoURL)) + } + return changes +} + +func (oph *OauthProviderHistory) Diff(history *OauthProviderHistory) (*HistoryDiff[OauthProviderHistory], error) { + if oph.Ref != history.Ref { + return nil, MismatchedRefError + } + + ophUnix, historyUnix := oph.HistoryTime.Unix(), history.HistoryTime.Unix() + ophOlder := ophUnix < historyUnix || (ophUnix == historyUnix && oph.ID < history.ID) + historyOlder := ophUnix > historyUnix || (ophUnix == historyUnix && oph.ID > history.ID) + + if ophOlder { + return &HistoryDiff[OauthProviderHistory]{ + Old: oph, + New: history, + Changes: oph.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[OauthProviderHistory]{ + Old: history, + New: oph, + Changes: history.changes(oph), + }, nil + } + return nil, IdenticalHistoryError +} + +func (omh *OrgMembershipHistory) changes(new *OrgMembershipHistory) []Change { + var changes []Change + if !reflect.DeepEqual(omh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(orgmembershiphistory.FieldCreatedAt, omh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(omh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(orgmembershiphistory.FieldUpdatedAt, omh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(omh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(orgmembershiphistory.FieldCreatedBy, omh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(omh.MappingID, new.MappingID) { + changes = append(changes, NewChange(orgmembershiphistory.FieldMappingID, omh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(omh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(orgmembershiphistory.FieldDeletedAt, omh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(omh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(orgmembershiphistory.FieldDeletedBy, omh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(omh.Role, new.Role) { + changes = append(changes, NewChange(orgmembershiphistory.FieldRole, omh.Role, new.Role)) + } + if !reflect.DeepEqual(omh.OrganizationID, new.OrganizationID) { + changes = append(changes, NewChange(orgmembershiphistory.FieldOrganizationID, omh.OrganizationID, new.OrganizationID)) + } + if !reflect.DeepEqual(omh.UserID, new.UserID) { + changes = append(changes, NewChange(orgmembershiphistory.FieldUserID, omh.UserID, new.UserID)) + } + return changes +} + +func (omh *OrgMembershipHistory) Diff(history *OrgMembershipHistory) (*HistoryDiff[OrgMembershipHistory], error) { + if omh.Ref != history.Ref { + return nil, MismatchedRefError + } + + omhUnix, historyUnix := omh.HistoryTime.Unix(), history.HistoryTime.Unix() + omhOlder := omhUnix < historyUnix || (omhUnix == historyUnix && omh.ID < history.ID) + historyOlder := omhUnix > historyUnix || (omhUnix == historyUnix && omh.ID > history.ID) + + if omhOlder { + return &HistoryDiff[OrgMembershipHistory]{ + Old: omh, + New: history, + Changes: omh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[OrgMembershipHistory]{ + Old: history, + New: omh, + Changes: history.changes(omh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (oh *OrganizationHistory) changes(new *OrganizationHistory) []Change { + var changes []Change + if !reflect.DeepEqual(oh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(organizationhistory.FieldCreatedAt, oh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(oh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(organizationhistory.FieldUpdatedAt, oh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(oh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(organizationhistory.FieldCreatedBy, oh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(oh.MappingID, new.MappingID) { + changes = append(changes, NewChange(organizationhistory.FieldMappingID, oh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(oh.Tags, new.Tags) { + changes = append(changes, NewChange(organizationhistory.FieldTags, oh.Tags, new.Tags)) + } + if !reflect.DeepEqual(oh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(organizationhistory.FieldDeletedAt, oh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(oh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(organizationhistory.FieldDeletedBy, oh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(oh.Name, new.Name) { + changes = append(changes, NewChange(organizationhistory.FieldName, oh.Name, new.Name)) + } + if !reflect.DeepEqual(oh.DisplayName, new.DisplayName) { + changes = append(changes, NewChange(organizationhistory.FieldDisplayName, oh.DisplayName, new.DisplayName)) + } + if !reflect.DeepEqual(oh.Description, new.Description) { + changes = append(changes, NewChange(organizationhistory.FieldDescription, oh.Description, new.Description)) + } + if !reflect.DeepEqual(oh.ParentOrganizationID, new.ParentOrganizationID) { + changes = append(changes, NewChange(organizationhistory.FieldParentOrganizationID, oh.ParentOrganizationID, new.ParentOrganizationID)) + } + if !reflect.DeepEqual(oh.PersonalOrg, new.PersonalOrg) { + changes = append(changes, NewChange(organizationhistory.FieldPersonalOrg, oh.PersonalOrg, new.PersonalOrg)) + } + if !reflect.DeepEqual(oh.AvatarRemoteURL, new.AvatarRemoteURL) { + changes = append(changes, NewChange(organizationhistory.FieldAvatarRemoteURL, oh.AvatarRemoteURL, new.AvatarRemoteURL)) + } + if !reflect.DeepEqual(oh.DedicatedDb, new.DedicatedDb) { + changes = append(changes, NewChange(organizationhistory.FieldDedicatedDb, oh.DedicatedDb, new.DedicatedDb)) + } + return changes +} + +func (oh *OrganizationHistory) Diff(history *OrganizationHistory) (*HistoryDiff[OrganizationHistory], error) { + if oh.Ref != history.Ref { + return nil, MismatchedRefError + } + + ohUnix, historyUnix := oh.HistoryTime.Unix(), history.HistoryTime.Unix() + ohOlder := ohUnix < historyUnix || (ohUnix == historyUnix && oh.ID < history.ID) + historyOlder := ohUnix > historyUnix || (ohUnix == historyUnix && oh.ID > history.ID) + + if ohOlder { + return &HistoryDiff[OrganizationHistory]{ + Old: oh, + New: history, + Changes: oh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[OrganizationHistory]{ + Old: history, + New: oh, + Changes: history.changes(oh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (osh *OrganizationSettingHistory) changes(new *OrganizationSettingHistory) []Change { + var changes []Change + if !reflect.DeepEqual(osh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(organizationsettinghistory.FieldCreatedAt, osh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(osh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(organizationsettinghistory.FieldUpdatedAt, osh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(osh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(organizationsettinghistory.FieldCreatedBy, osh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(osh.MappingID, new.MappingID) { + changes = append(changes, NewChange(organizationsettinghistory.FieldMappingID, osh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(osh.Tags, new.Tags) { + changes = append(changes, NewChange(organizationsettinghistory.FieldTags, osh.Tags, new.Tags)) + } + if !reflect.DeepEqual(osh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(organizationsettinghistory.FieldDeletedAt, osh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(osh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(organizationsettinghistory.FieldDeletedBy, osh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(osh.Domains, new.Domains) { + changes = append(changes, NewChange(organizationsettinghistory.FieldDomains, osh.Domains, new.Domains)) + } + if !reflect.DeepEqual(osh.BillingContact, new.BillingContact) { + changes = append(changes, NewChange(organizationsettinghistory.FieldBillingContact, osh.BillingContact, new.BillingContact)) + } + if !reflect.DeepEqual(osh.BillingEmail, new.BillingEmail) { + changes = append(changes, NewChange(organizationsettinghistory.FieldBillingEmail, osh.BillingEmail, new.BillingEmail)) + } + if !reflect.DeepEqual(osh.BillingPhone, new.BillingPhone) { + changes = append(changes, NewChange(organizationsettinghistory.FieldBillingPhone, osh.BillingPhone, new.BillingPhone)) + } + if !reflect.DeepEqual(osh.BillingAddress, new.BillingAddress) { + changes = append(changes, NewChange(organizationsettinghistory.FieldBillingAddress, osh.BillingAddress, new.BillingAddress)) + } + if !reflect.DeepEqual(osh.TaxIdentifier, new.TaxIdentifier) { + changes = append(changes, NewChange(organizationsettinghistory.FieldTaxIdentifier, osh.TaxIdentifier, new.TaxIdentifier)) + } + if !reflect.DeepEqual(osh.GeoLocation, new.GeoLocation) { + changes = append(changes, NewChange(organizationsettinghistory.FieldGeoLocation, osh.GeoLocation, new.GeoLocation)) + } + if !reflect.DeepEqual(osh.OrganizationID, new.OrganizationID) { + changes = append(changes, NewChange(organizationsettinghistory.FieldOrganizationID, osh.OrganizationID, new.OrganizationID)) + } + return changes +} + +func (osh *OrganizationSettingHistory) Diff(history *OrganizationSettingHistory) (*HistoryDiff[OrganizationSettingHistory], error) { + if osh.Ref != history.Ref { + return nil, MismatchedRefError + } + + oshUnix, historyUnix := osh.HistoryTime.Unix(), history.HistoryTime.Unix() + oshOlder := oshUnix < historyUnix || (oshUnix == historyUnix && osh.ID < history.ID) + historyOlder := oshUnix > historyUnix || (oshUnix == historyUnix && osh.ID > history.ID) + + if oshOlder { + return &HistoryDiff[OrganizationSettingHistory]{ + Old: osh, + New: history, + Changes: osh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[OrganizationSettingHistory]{ + Old: history, + New: osh, + Changes: history.changes(osh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (th *TemplateHistory) changes(new *TemplateHistory) []Change { + var changes []Change + if !reflect.DeepEqual(th.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(templatehistory.FieldCreatedAt, th.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(th.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(templatehistory.FieldUpdatedAt, th.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(th.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(templatehistory.FieldCreatedBy, th.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(th.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(templatehistory.FieldDeletedAt, th.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(th.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(templatehistory.FieldDeletedBy, th.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(th.MappingID, new.MappingID) { + changes = append(changes, NewChange(templatehistory.FieldMappingID, th.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(th.Tags, new.Tags) { + changes = append(changes, NewChange(templatehistory.FieldTags, th.Tags, new.Tags)) + } + if !reflect.DeepEqual(th.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(templatehistory.FieldOwnerID, th.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(th.Name, new.Name) { + changes = append(changes, NewChange(templatehistory.FieldName, th.Name, new.Name)) + } + if !reflect.DeepEqual(th.TemplateType, new.TemplateType) { + changes = append(changes, NewChange(templatehistory.FieldTemplateType, th.TemplateType, new.TemplateType)) + } + if !reflect.DeepEqual(th.Description, new.Description) { + changes = append(changes, NewChange(templatehistory.FieldDescription, th.Description, new.Description)) + } + if !reflect.DeepEqual(th.Jsonconfig, new.Jsonconfig) { + changes = append(changes, NewChange(templatehistory.FieldJsonconfig, th.Jsonconfig, new.Jsonconfig)) + } + if !reflect.DeepEqual(th.Uischema, new.Uischema) { + changes = append(changes, NewChange(templatehistory.FieldUischema, th.Uischema, new.Uischema)) + } + return changes +} + +func (th *TemplateHistory) Diff(history *TemplateHistory) (*HistoryDiff[TemplateHistory], error) { + if th.Ref != history.Ref { + return nil, MismatchedRefError + } + + thUnix, historyUnix := th.HistoryTime.Unix(), history.HistoryTime.Unix() + thOlder := thUnix < historyUnix || (thUnix == historyUnix && th.ID < history.ID) + historyOlder := thUnix > historyUnix || (thUnix == historyUnix && th.ID > history.ID) + + if thOlder { + return &HistoryDiff[TemplateHistory]{ + Old: th, + New: history, + Changes: th.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[TemplateHistory]{ + Old: history, + New: th, + Changes: history.changes(th), + }, nil + } + return nil, IdenticalHistoryError +} + +func (uh *UserHistory) changes(new *UserHistory) []Change { + var changes []Change + if !reflect.DeepEqual(uh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(userhistory.FieldCreatedAt, uh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(uh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(userhistory.FieldUpdatedAt, uh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(uh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(userhistory.FieldCreatedBy, uh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(uh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(userhistory.FieldDeletedAt, uh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(uh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(userhistory.FieldDeletedBy, uh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(uh.MappingID, new.MappingID) { + changes = append(changes, NewChange(userhistory.FieldMappingID, uh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(uh.Tags, new.Tags) { + changes = append(changes, NewChange(userhistory.FieldTags, uh.Tags, new.Tags)) + } + if !reflect.DeepEqual(uh.Email, new.Email) { + changes = append(changes, NewChange(userhistory.FieldEmail, uh.Email, new.Email)) + } + if !reflect.DeepEqual(uh.FirstName, new.FirstName) { + changes = append(changes, NewChange(userhistory.FieldFirstName, uh.FirstName, new.FirstName)) + } + if !reflect.DeepEqual(uh.LastName, new.LastName) { + changes = append(changes, NewChange(userhistory.FieldLastName, uh.LastName, new.LastName)) + } + if !reflect.DeepEqual(uh.DisplayName, new.DisplayName) { + changes = append(changes, NewChange(userhistory.FieldDisplayName, uh.DisplayName, new.DisplayName)) + } + if !reflect.DeepEqual(uh.AvatarRemoteURL, new.AvatarRemoteURL) { + changes = append(changes, NewChange(userhistory.FieldAvatarRemoteURL, uh.AvatarRemoteURL, new.AvatarRemoteURL)) + } + if !reflect.DeepEqual(uh.AvatarLocalFile, new.AvatarLocalFile) { + changes = append(changes, NewChange(userhistory.FieldAvatarLocalFile, uh.AvatarLocalFile, new.AvatarLocalFile)) + } + if !reflect.DeepEqual(uh.AvatarUpdatedAt, new.AvatarUpdatedAt) { + changes = append(changes, NewChange(userhistory.FieldAvatarUpdatedAt, uh.AvatarUpdatedAt, new.AvatarUpdatedAt)) + } + if !reflect.DeepEqual(uh.LastSeen, new.LastSeen) { + changes = append(changes, NewChange(userhistory.FieldLastSeen, uh.LastSeen, new.LastSeen)) + } + if !reflect.DeepEqual(uh.Password, new.Password) { + changes = append(changes, NewChange(userhistory.FieldPassword, uh.Password, new.Password)) + } + if !reflect.DeepEqual(uh.Sub, new.Sub) { + changes = append(changes, NewChange(userhistory.FieldSub, uh.Sub, new.Sub)) + } + if !reflect.DeepEqual(uh.AuthProvider, new.AuthProvider) { + changes = append(changes, NewChange(userhistory.FieldAuthProvider, uh.AuthProvider, new.AuthProvider)) + } + if !reflect.DeepEqual(uh.Role, new.Role) { + changes = append(changes, NewChange(userhistory.FieldRole, uh.Role, new.Role)) + } + return changes +} + +func (uh *UserHistory) Diff(history *UserHistory) (*HistoryDiff[UserHistory], error) { + if uh.Ref != history.Ref { + return nil, MismatchedRefError + } + + uhUnix, historyUnix := uh.HistoryTime.Unix(), history.HistoryTime.Unix() + uhOlder := uhUnix < historyUnix || (uhUnix == historyUnix && uh.ID < history.ID) + historyOlder := uhUnix > historyUnix || (uhUnix == historyUnix && uh.ID > history.ID) + + if uhOlder { + return &HistoryDiff[UserHistory]{ + Old: uh, + New: history, + Changes: uh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[UserHistory]{ + Old: history, + New: uh, + Changes: history.changes(uh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (ush *UserSettingHistory) changes(new *UserSettingHistory) []Change { + var changes []Change + if !reflect.DeepEqual(ush.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(usersettinghistory.FieldCreatedAt, ush.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(ush.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(usersettinghistory.FieldUpdatedAt, ush.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(ush.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(usersettinghistory.FieldCreatedBy, ush.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(ush.MappingID, new.MappingID) { + changes = append(changes, NewChange(usersettinghistory.FieldMappingID, ush.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(ush.Tags, new.Tags) { + changes = append(changes, NewChange(usersettinghistory.FieldTags, ush.Tags, new.Tags)) + } + if !reflect.DeepEqual(ush.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(usersettinghistory.FieldDeletedAt, ush.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(ush.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(usersettinghistory.FieldDeletedBy, ush.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(ush.UserID, new.UserID) { + changes = append(changes, NewChange(usersettinghistory.FieldUserID, ush.UserID, new.UserID)) + } + if !reflect.DeepEqual(ush.Locked, new.Locked) { + changes = append(changes, NewChange(usersettinghistory.FieldLocked, ush.Locked, new.Locked)) + } + if !reflect.DeepEqual(ush.SilencedAt, new.SilencedAt) { + changes = append(changes, NewChange(usersettinghistory.FieldSilencedAt, ush.SilencedAt, new.SilencedAt)) + } + if !reflect.DeepEqual(ush.SuspendedAt, new.SuspendedAt) { + changes = append(changes, NewChange(usersettinghistory.FieldSuspendedAt, ush.SuspendedAt, new.SuspendedAt)) + } + if !reflect.DeepEqual(ush.Status, new.Status) { + changes = append(changes, NewChange(usersettinghistory.FieldStatus, ush.Status, new.Status)) + } + if !reflect.DeepEqual(ush.EmailConfirmed, new.EmailConfirmed) { + changes = append(changes, NewChange(usersettinghistory.FieldEmailConfirmed, ush.EmailConfirmed, new.EmailConfirmed)) + } + if !reflect.DeepEqual(ush.IsWebauthnAllowed, new.IsWebauthnAllowed) { + changes = append(changes, NewChange(usersettinghistory.FieldIsWebauthnAllowed, ush.IsWebauthnAllowed, new.IsWebauthnAllowed)) + } + if !reflect.DeepEqual(ush.IsTfaEnabled, new.IsTfaEnabled) { + changes = append(changes, NewChange(usersettinghistory.FieldIsTfaEnabled, ush.IsTfaEnabled, new.IsTfaEnabled)) + } + if !reflect.DeepEqual(ush.PhoneNumber, new.PhoneNumber) { + changes = append(changes, NewChange(usersettinghistory.FieldPhoneNumber, ush.PhoneNumber, new.PhoneNumber)) + } + return changes +} + +func (ush *UserSettingHistory) Diff(history *UserSettingHistory) (*HistoryDiff[UserSettingHistory], error) { + if ush.Ref != history.Ref { + return nil, MismatchedRefError + } + + ushUnix, historyUnix := ush.HistoryTime.Unix(), history.HistoryTime.Unix() + ushOlder := ushUnix < historyUnix || (ushUnix == historyUnix && ush.ID < history.ID) + historyOlder := ushUnix > historyUnix || (ushUnix == historyUnix && ush.ID > history.ID) + + if ushOlder { + return &HistoryDiff[UserSettingHistory]{ + Old: ush, + New: history, + Changes: ush.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[UserSettingHistory]{ + Old: history, + New: ush, + Changes: history.changes(ush), + }, nil + } + return nil, IdenticalHistoryError +} + +func (wh *WebhookHistory) changes(new *WebhookHistory) []Change { + var changes []Change + if !reflect.DeepEqual(wh.CreatedAt, new.CreatedAt) { + changes = append(changes, NewChange(webhookhistory.FieldCreatedAt, wh.CreatedAt, new.CreatedAt)) + } + if !reflect.DeepEqual(wh.UpdatedAt, new.UpdatedAt) { + changes = append(changes, NewChange(webhookhistory.FieldUpdatedAt, wh.UpdatedAt, new.UpdatedAt)) + } + if !reflect.DeepEqual(wh.CreatedBy, new.CreatedBy) { + changes = append(changes, NewChange(webhookhistory.FieldCreatedBy, wh.CreatedBy, new.CreatedBy)) + } + if !reflect.DeepEqual(wh.MappingID, new.MappingID) { + changes = append(changes, NewChange(webhookhistory.FieldMappingID, wh.MappingID, new.MappingID)) + } + if !reflect.DeepEqual(wh.Tags, new.Tags) { + changes = append(changes, NewChange(webhookhistory.FieldTags, wh.Tags, new.Tags)) + } + if !reflect.DeepEqual(wh.DeletedAt, new.DeletedAt) { + changes = append(changes, NewChange(webhookhistory.FieldDeletedAt, wh.DeletedAt, new.DeletedAt)) + } + if !reflect.DeepEqual(wh.DeletedBy, new.DeletedBy) { + changes = append(changes, NewChange(webhookhistory.FieldDeletedBy, wh.DeletedBy, new.DeletedBy)) + } + if !reflect.DeepEqual(wh.OwnerID, new.OwnerID) { + changes = append(changes, NewChange(webhookhistory.FieldOwnerID, wh.OwnerID, new.OwnerID)) + } + if !reflect.DeepEqual(wh.Name, new.Name) { + changes = append(changes, NewChange(webhookhistory.FieldName, wh.Name, new.Name)) + } + if !reflect.DeepEqual(wh.Description, new.Description) { + changes = append(changes, NewChange(webhookhistory.FieldDescription, wh.Description, new.Description)) + } + if !reflect.DeepEqual(wh.DestinationURL, new.DestinationURL) { + changes = append(changes, NewChange(webhookhistory.FieldDestinationURL, wh.DestinationURL, new.DestinationURL)) + } + if !reflect.DeepEqual(wh.Enabled, new.Enabled) { + changes = append(changes, NewChange(webhookhistory.FieldEnabled, wh.Enabled, new.Enabled)) + } + if !reflect.DeepEqual(wh.Callback, new.Callback) { + changes = append(changes, NewChange(webhookhistory.FieldCallback, wh.Callback, new.Callback)) + } + if !reflect.DeepEqual(wh.ExpiresAt, new.ExpiresAt) { + changes = append(changes, NewChange(webhookhistory.FieldExpiresAt, wh.ExpiresAt, new.ExpiresAt)) + } + if !reflect.DeepEqual(wh.Secret, new.Secret) { + changes = append(changes, NewChange(webhookhistory.FieldSecret, wh.Secret, new.Secret)) + } + if !reflect.DeepEqual(wh.Failures, new.Failures) { + changes = append(changes, NewChange(webhookhistory.FieldFailures, wh.Failures, new.Failures)) + } + if !reflect.DeepEqual(wh.LastError, new.LastError) { + changes = append(changes, NewChange(webhookhistory.FieldLastError, wh.LastError, new.LastError)) + } + if !reflect.DeepEqual(wh.LastResponse, new.LastResponse) { + changes = append(changes, NewChange(webhookhistory.FieldLastResponse, wh.LastResponse, new.LastResponse)) + } + return changes +} + +func (wh *WebhookHistory) Diff(history *WebhookHistory) (*HistoryDiff[WebhookHistory], error) { + if wh.Ref != history.Ref { + return nil, MismatchedRefError + } + + whUnix, historyUnix := wh.HistoryTime.Unix(), history.HistoryTime.Unix() + whOlder := whUnix < historyUnix || (whUnix == historyUnix && wh.ID < history.ID) + historyOlder := whUnix > historyUnix || (whUnix == historyUnix && wh.ID > history.ID) + + if whOlder { + return &HistoryDiff[WebhookHistory]{ + Old: wh, + New: history, + Changes: wh.changes(history), + }, nil + } else if historyOlder { + return &HistoryDiff[WebhookHistory]{ + Old: history, + New: wh, + Changes: history.changes(wh), + }, nil + } + return nil, IdenticalHistoryError +} + +func (c Change) String(op history.OpType) string { + var newstr, oldstr string + if c.New != nil { + val, err := json.Marshal(c.New) + if err != nil { + newstr = fmt.Sprintf("%v", c.New) + } else { + newstr = string(val) + } + } + if c.Old != nil { + val, err := json.Marshal(c.Old) + if err != nil { + oldstr = fmt.Sprintf("%v", c.Old) + } else { + oldstr = string(val) + } + } + switch op { + case history.OpTypeInsert: + return fmt.Sprintf("%s: %s", c.FieldName, newstr) + case history.OpTypeDelete: + return fmt.Sprintf("%s: %s", c.FieldName, oldstr) + default: + return fmt.Sprintf("%s: %s -> %s", c.FieldName, oldstr, newstr) + } +} + +func (c *Client) Audit(ctx context.Context) ([][]string, error) { + records := [][]string{ + {"Table", "Ref Id", "History Time", "Operation", "Changes", "Updated By"}, + } + var record [][]string + var err error + record, err = auditContactHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditDocumentDataHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditEntitlementHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditEntitlementPlanFeatureHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditEntitlementPlanHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditEntityHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditEntityTypeHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditEventHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditFeatureHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditFileHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditGroupHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditGroupMembershipHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditGroupSettingHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditHushHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditIntegrationHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditNoteHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditOauthProviderHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditOrgMembershipHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditOrganizationHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditOrganizationSettingHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditTemplateHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditUserHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditUserSettingHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + record, err = auditWebhookHistory(ctx, c.config) + if err != nil { + return nil, err + } + records = append(records, record...) + + return records, nil +} + +func (c *Client) AuditWithFilter(ctx context.Context, tableName string) ([][]string, error) { + records := [][]string{ + {"Table", "Ref Id", "History Time", "Operation", "Changes", "Updated By"}, + } + var record [][]string + var err error + + if tableName == "" || tableName == strings.TrimSuffix("ContactHistory", "History") { + record, err = auditContactHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("DocumentDataHistory", "History") { + record, err = auditDocumentDataHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("EntitlementHistory", "History") { + record, err = auditEntitlementHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("EntitlementPlanFeatureHistory", "History") { + record, err = auditEntitlementPlanFeatureHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("EntitlementPlanHistory", "History") { + record, err = auditEntitlementPlanHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("EntityHistory", "History") { + record, err = auditEntityHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("EntityTypeHistory", "History") { + record, err = auditEntityTypeHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("EventHistory", "History") { + record, err = auditEventHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("FeatureHistory", "History") { + record, err = auditFeatureHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("FileHistory", "History") { + record, err = auditFileHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("GroupHistory", "History") { + record, err = auditGroupHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("GroupMembershipHistory", "History") { + record, err = auditGroupMembershipHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("GroupSettingHistory", "History") { + record, err = auditGroupSettingHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("HushHistory", "History") { + record, err = auditHushHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("IntegrationHistory", "History") { + record, err = auditIntegrationHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("NoteHistory", "History") { + record, err = auditNoteHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("OauthProviderHistory", "History") { + record, err = auditOauthProviderHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("OrgMembershipHistory", "History") { + record, err = auditOrgMembershipHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("OrganizationHistory", "History") { + record, err = auditOrganizationHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("OrganizationSettingHistory", "History") { + record, err = auditOrganizationSettingHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("TemplateHistory", "History") { + record, err = auditTemplateHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("UserHistory", "History") { + record, err = auditUserHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("UserSettingHistory", "History") { + record, err = auditUserSettingHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + if tableName == "" || tableName == strings.TrimSuffix("WebhookHistory", "History") { + record, err = auditWebhookHistory(ctx, c.config) + if err != nil { + return nil, err + } + + records = append(records, record...) + } + + return records, nil +} + +type record struct { + Table string + RefId any + HistoryTime time.Time + Operation history.OpType + Changes []Change + UpdatedBy string +} + +func (r *record) toRow() []string { + row := make([]string, 6) + + row[0] = r.Table + row[1] = fmt.Sprintf("%v", r.RefId) + row[2] = r.HistoryTime.Format(time.ANSIC) + row[3] = r.Operation.String() + for i, change := range r.Changes { + if i == 0 { + row[4] = change.String(r.Operation) + continue + } + row[4] = fmt.Sprintf("%s\n%s", row[4], change.String(r.Operation)) + } + if r.UpdatedBy != "" { + row[5] = fmt.Sprintf("%v", r.UpdatedBy) + } + return row +} + +type contacthistoryref struct { + Ref string +} + +func auditContactHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []contacthistoryref + client := NewContactHistoryClient(config) + err := client.Query(). + Unique(true). + Order(contacthistory.ByRef()). + Select(contacthistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(contacthistory.Ref(currRef.Ref)). + Order(contacthistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "ContactHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&ContactHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&ContactHistory{}) + default: + if i == 0 { + record.Changes = (&ContactHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type documentdatahistoryref struct { + Ref string +} + +func auditDocumentDataHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []documentdatahistoryref + client := NewDocumentDataHistoryClient(config) + err := client.Query(). + Unique(true). + Order(documentdatahistory.ByRef()). + Select(documentdatahistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(documentdatahistory.Ref(currRef.Ref)). + Order(documentdatahistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "DocumentDataHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&DocumentDataHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&DocumentDataHistory{}) + default: + if i == 0 { + record.Changes = (&DocumentDataHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type entitlementhistoryref struct { + Ref string +} + +func auditEntitlementHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []entitlementhistoryref + client := NewEntitlementHistoryClient(config) + err := client.Query(). + Unique(true). + Order(entitlementhistory.ByRef()). + Select(entitlementhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(entitlementhistory.Ref(currRef.Ref)). + Order(entitlementhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "EntitlementHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&EntitlementHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&EntitlementHistory{}) + default: + if i == 0 { + record.Changes = (&EntitlementHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type entitlementplanfeaturehistoryref struct { + Ref string +} + +func auditEntitlementPlanFeatureHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []entitlementplanfeaturehistoryref + client := NewEntitlementPlanFeatureHistoryClient(config) + err := client.Query(). + Unique(true). + Order(entitlementplanfeaturehistory.ByRef()). + Select(entitlementplanfeaturehistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(entitlementplanfeaturehistory.Ref(currRef.Ref)). + Order(entitlementplanfeaturehistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "EntitlementPlanFeatureHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&EntitlementPlanFeatureHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&EntitlementPlanFeatureHistory{}) + default: + if i == 0 { + record.Changes = (&EntitlementPlanFeatureHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type entitlementplanhistoryref struct { + Ref string +} + +func auditEntitlementPlanHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []entitlementplanhistoryref + client := NewEntitlementPlanHistoryClient(config) + err := client.Query(). + Unique(true). + Order(entitlementplanhistory.ByRef()). + Select(entitlementplanhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(entitlementplanhistory.Ref(currRef.Ref)). + Order(entitlementplanhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "EntitlementPlanHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&EntitlementPlanHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&EntitlementPlanHistory{}) + default: + if i == 0 { + record.Changes = (&EntitlementPlanHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type entityhistoryref struct { + Ref string +} + +func auditEntityHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []entityhistoryref + client := NewEntityHistoryClient(config) + err := client.Query(). + Unique(true). + Order(entityhistory.ByRef()). + Select(entityhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(entityhistory.Ref(currRef.Ref)). + Order(entityhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "EntityHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&EntityHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&EntityHistory{}) + default: + if i == 0 { + record.Changes = (&EntityHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type entitytypehistoryref struct { + Ref string +} + +func auditEntityTypeHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []entitytypehistoryref + client := NewEntityTypeHistoryClient(config) + err := client.Query(). + Unique(true). + Order(entitytypehistory.ByRef()). + Select(entitytypehistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(entitytypehistory.Ref(currRef.Ref)). + Order(entitytypehistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "EntityTypeHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&EntityTypeHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&EntityTypeHistory{}) + default: + if i == 0 { + record.Changes = (&EntityTypeHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type eventhistoryref struct { + Ref string +} + +func auditEventHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []eventhistoryref + client := NewEventHistoryClient(config) + err := client.Query(). + Unique(true). + Order(eventhistory.ByRef()). + Select(eventhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(eventhistory.Ref(currRef.Ref)). + Order(eventhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "EventHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&EventHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&EventHistory{}) + default: + if i == 0 { + record.Changes = (&EventHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type featurehistoryref struct { + Ref string +} + +func auditFeatureHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []featurehistoryref + client := NewFeatureHistoryClient(config) + err := client.Query(). + Unique(true). + Order(featurehistory.ByRef()). + Select(featurehistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(featurehistory.Ref(currRef.Ref)). + Order(featurehistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "FeatureHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&FeatureHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&FeatureHistory{}) + default: + if i == 0 { + record.Changes = (&FeatureHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type filehistoryref struct { + Ref string +} + +func auditFileHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []filehistoryref + client := NewFileHistoryClient(config) + err := client.Query(). + Unique(true). + Order(filehistory.ByRef()). + Select(filehistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(filehistory.Ref(currRef.Ref)). + Order(filehistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "FileHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&FileHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&FileHistory{}) + default: + if i == 0 { + record.Changes = (&FileHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type grouphistoryref struct { + Ref string +} + +func auditGroupHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []grouphistoryref + client := NewGroupHistoryClient(config) + err := client.Query(). + Unique(true). + Order(grouphistory.ByRef()). + Select(grouphistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(grouphistory.Ref(currRef.Ref)). + Order(grouphistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "GroupHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&GroupHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&GroupHistory{}) + default: + if i == 0 { + record.Changes = (&GroupHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type groupmembershiphistoryref struct { + Ref string +} + +func auditGroupMembershipHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []groupmembershiphistoryref + client := NewGroupMembershipHistoryClient(config) + err := client.Query(). + Unique(true). + Order(groupmembershiphistory.ByRef()). + Select(groupmembershiphistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(groupmembershiphistory.Ref(currRef.Ref)). + Order(groupmembershiphistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "GroupMembershipHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&GroupMembershipHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&GroupMembershipHistory{}) + default: + if i == 0 { + record.Changes = (&GroupMembershipHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type groupsettinghistoryref struct { + Ref string +} + +func auditGroupSettingHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []groupsettinghistoryref + client := NewGroupSettingHistoryClient(config) + err := client.Query(). + Unique(true). + Order(groupsettinghistory.ByRef()). + Select(groupsettinghistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(groupsettinghistory.Ref(currRef.Ref)). + Order(groupsettinghistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "GroupSettingHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&GroupSettingHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&GroupSettingHistory{}) + default: + if i == 0 { + record.Changes = (&GroupSettingHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type hushhistoryref struct { + Ref string +} + +func auditHushHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []hushhistoryref + client := NewHushHistoryClient(config) + err := client.Query(). + Unique(true). + Order(hushhistory.ByRef()). + Select(hushhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(hushhistory.Ref(currRef.Ref)). + Order(hushhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "HushHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&HushHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&HushHistory{}) + default: + if i == 0 { + record.Changes = (&HushHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type integrationhistoryref struct { + Ref string +} + +func auditIntegrationHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []integrationhistoryref + client := NewIntegrationHistoryClient(config) + err := client.Query(). + Unique(true). + Order(integrationhistory.ByRef()). + Select(integrationhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(integrationhistory.Ref(currRef.Ref)). + Order(integrationhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "IntegrationHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&IntegrationHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&IntegrationHistory{}) + default: + if i == 0 { + record.Changes = (&IntegrationHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type notehistoryref struct { + Ref string +} + +func auditNoteHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []notehistoryref + client := NewNoteHistoryClient(config) + err := client.Query(). + Unique(true). + Order(notehistory.ByRef()). + Select(notehistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(notehistory.Ref(currRef.Ref)). + Order(notehistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "NoteHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&NoteHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&NoteHistory{}) + default: + if i == 0 { + record.Changes = (&NoteHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type oauthproviderhistoryref struct { + Ref string +} + +func auditOauthProviderHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []oauthproviderhistoryref + client := NewOauthProviderHistoryClient(config) + err := client.Query(). + Unique(true). + Order(oauthproviderhistory.ByRef()). + Select(oauthproviderhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(oauthproviderhistory.Ref(currRef.Ref)). + Order(oauthproviderhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "OauthProviderHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&OauthProviderHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&OauthProviderHistory{}) + default: + if i == 0 { + record.Changes = (&OauthProviderHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type orgmembershiphistoryref struct { + Ref string +} + +func auditOrgMembershipHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []orgmembershiphistoryref + client := NewOrgMembershipHistoryClient(config) + err := client.Query(). + Unique(true). + Order(orgmembershiphistory.ByRef()). + Select(orgmembershiphistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(orgmembershiphistory.Ref(currRef.Ref)). + Order(orgmembershiphistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "OrgMembershipHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&OrgMembershipHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&OrgMembershipHistory{}) + default: + if i == 0 { + record.Changes = (&OrgMembershipHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type organizationhistoryref struct { + Ref string +} + +func auditOrganizationHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []organizationhistoryref + client := NewOrganizationHistoryClient(config) + err := client.Query(). + Unique(true). + Order(organizationhistory.ByRef()). + Select(organizationhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(organizationhistory.Ref(currRef.Ref)). + Order(organizationhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "OrganizationHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&OrganizationHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&OrganizationHistory{}) + default: + if i == 0 { + record.Changes = (&OrganizationHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type organizationsettinghistoryref struct { + Ref string +} + +func auditOrganizationSettingHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []organizationsettinghistoryref + client := NewOrganizationSettingHistoryClient(config) + err := client.Query(). + Unique(true). + Order(organizationsettinghistory.ByRef()). + Select(organizationsettinghistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(organizationsettinghistory.Ref(currRef.Ref)). + Order(organizationsettinghistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "OrganizationSettingHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&OrganizationSettingHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&OrganizationSettingHistory{}) + default: + if i == 0 { + record.Changes = (&OrganizationSettingHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type templatehistoryref struct { + Ref string +} + +func auditTemplateHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []templatehistoryref + client := NewTemplateHistoryClient(config) + err := client.Query(). + Unique(true). + Order(templatehistory.ByRef()). + Select(templatehistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(templatehistory.Ref(currRef.Ref)). + Order(templatehistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "TemplateHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&TemplateHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&TemplateHistory{}) + default: + if i == 0 { + record.Changes = (&TemplateHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type userhistoryref struct { + Ref string +} + +func auditUserHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []userhistoryref + client := NewUserHistoryClient(config) + err := client.Query(). + Unique(true). + Order(userhistory.ByRef()). + Select(userhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(userhistory.Ref(currRef.Ref)). + Order(userhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "UserHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&UserHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&UserHistory{}) + default: + if i == 0 { + record.Changes = (&UserHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type usersettinghistoryref struct { + Ref string +} + +func auditUserSettingHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []usersettinghistoryref + client := NewUserSettingHistoryClient(config) + err := client.Query(). + Unique(true). + Order(usersettinghistory.ByRef()). + Select(usersettinghistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(usersettinghistory.Ref(currRef.Ref)). + Order(usersettinghistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "UserSettingHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&UserSettingHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&UserSettingHistory{}) + default: + if i == 0 { + record.Changes = (&UserSettingHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} + +type webhookhistoryref struct { + Ref string +} + +func auditWebhookHistory(ctx context.Context, config config) ([][]string, error) { + var records = [][]string{} + var refs []webhookhistoryref + client := NewWebhookHistoryClient(config) + err := client.Query(). + Unique(true). + Order(webhookhistory.ByRef()). + Select(webhookhistory.FieldRef). + Scan(ctx, &refs) + + if err != nil { + return nil, err + } + for _, currRef := range refs { + histories, err := client.Query(). + Where(webhookhistory.Ref(currRef.Ref)). + Order(webhookhistory.ByHistoryTime()). + All(ctx) + if err != nil { + return nil, err + } + + for i := 0; i < len(histories); i++ { + curr := histories[i] + record := record{ + Table: "WebhookHistory", + RefId: curr.Ref, + HistoryTime: curr.HistoryTime, + Operation: curr.Operation, + UpdatedBy: curr.UpdatedBy, + } + switch curr.Operation { + case history.OpTypeInsert: + record.Changes = (&WebhookHistory{}).changes(curr) + case history.OpTypeDelete: + record.Changes = curr.changes(&WebhookHistory{}) + default: + if i == 0 { + record.Changes = (&WebhookHistory{}).changes(curr) + } else { + record.Changes = histories[i-1].changes(curr) + } + } + records = append(records, record.toRow()) + } + } + return records, nil +} diff --git a/internal/ent/generated/auth_from_mutation.go b/internal/ent/generated/auth_from_mutation.go new file mode 100644 index 0000000..3cd305b --- /dev/null +++ b/internal/ent/generated/auth_from_mutation.go @@ -0,0 +1,311 @@ +// Code generated by entfga, DO NOT EDIT. + +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "github.com/theopenlane/entx" + "github.com/theopenlane/iam/entfga" + "github.com/theopenlane/iam/fgax" +) + +func (m *GroupMembershipMutation) CreateTuplesFromCreate(ctx context.Context) error { + + // Get fields for tuple creation + userID, _ := m.UserID() + objectID, _ := m.GroupID() + role, _ := m.Role() + + // get tuple key + req := fgax.TupleRequest{ + SubjectID: userID, + SubjectType: "user", + ObjectID: objectID, + ObjectType: "group", + Relation: role.String(), + } + tuple := fgax.GetTupleKey(req) + + if _, err := m.Authz.WriteTupleKeys(ctx, []fgax.TupleKey{tuple}, nil); err != nil { + m.Logger.Errorw("failed to create relationship tuple", "error", err) + + return err + } + + m.Logger.Debugw("created relationship tuples", "relation", role, "object", tuple.Object) + + return nil +} + +func (m *GroupMembershipMutation) CreateTuplesFromUpdate(ctx context.Context) error { + + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateTuplesFromDelete(ctx) + } + + // get ids that will be updated + ids, err := m.IDs(ctx) + if err != nil { + return err + } + + var ( + writes []fgax.TupleKey + deletes []fgax.TupleKey + ) + + oldRole, err := m.OldRole(ctx) + if err != nil { + return err + } + + newRole, exists := m.Role() + if !exists { + return entfga.ErrMissingRole + } + + if oldRole == newRole { + m.Logger.Debugw("nothing to update, roles are the same", "old_role", oldRole, "new_role", newRole) + + return nil + } + + // User the IDs of the memberships and delete all related tuples + for _, id := range ids { + member, err := m.Client().GroupMembership.Get(ctx, id) + if err != nil { + return err + } + + req := fgax.TupleRequest{ + SubjectID: member.UserID, + SubjectType: "user", + ObjectID: member.GroupID, + ObjectType: "group", + Relation: oldRole.String(), + } + d := fgax.GetTupleKey(req) + + deletes = append(deletes, d) + + req.Relation = newRole.String() + w := fgax.GetTupleKey(req) + + writes = append(writes, w) + + if len(writes) == 0 && len(deletes) == 0 { + m.Logger.Debugw("no relationships to create or delete") + + return nil + } + + if _, err := m.Authz.WriteTupleKeys(ctx, writes, deletes); err != nil { + m.Logger.Errorw("failed to update relationship tuple", "error", err) + + return err + } + } + + return nil +} + +func (m *GroupMembershipMutation) CreateTuplesFromDelete(ctx context.Context) error { + + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + + // get ids that will be deleted + ids, err := m.IDs(ctx) + if err != nil { + return err + } + + tuples := []fgax.TupleKey{} + + // User the IDs of the memberships and delete all related tuples + for _, id := range ids { + // this wont work with soft deletes + members, err := m.Client().GroupMembership.Get(ctx, id) + if err != nil { + return err + } + + req := fgax.TupleRequest{ + SubjectID: members.UserID, + SubjectType: "user", + ObjectID: members.GroupID, + ObjectType: "group", + Relation: members.Role.String(), + } + t := fgax.GetTupleKey(req) + + tuples = append(tuples, t) + } + + if len(tuples) > 0 { + if _, err := m.Authz.WriteTupleKeys(ctx, nil, tuples); err != nil { + m.Logger.Errorw("failed to delete relationship tuple", "error", err) + + return err + } + + m.Logger.Debugw("deleted relationship tuples") + } + + return nil +} + +func (m *OrgMembershipMutation) CreateTuplesFromCreate(ctx context.Context) error { + + // Get fields for tuple creation + userID, _ := m.UserID() + objectID, _ := m.OrganizationID() + role, _ := m.Role() + + // get tuple key + req := fgax.TupleRequest{ + SubjectID: userID, + SubjectType: "user", + ObjectID: objectID, + ObjectType: "organization", + Relation: role.String(), + } + tuple := fgax.GetTupleKey(req) + + if _, err := m.Authz.WriteTupleKeys(ctx, []fgax.TupleKey{tuple}, nil); err != nil { + m.Logger.Errorw("failed to create relationship tuple", "error", err) + + return err + } + + m.Logger.Debugw("created relationship tuples", "relation", role, "object", tuple.Object) + + return nil +} + +func (m *OrgMembershipMutation) CreateTuplesFromUpdate(ctx context.Context) error { + + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateTuplesFromDelete(ctx) + } + + // get ids that will be updated + ids, err := m.IDs(ctx) + if err != nil { + return err + } + + var ( + writes []fgax.TupleKey + deletes []fgax.TupleKey + ) + + oldRole, err := m.OldRole(ctx) + if err != nil { + return err + } + + newRole, exists := m.Role() + if !exists { + return entfga.ErrMissingRole + } + + if oldRole == newRole { + m.Logger.Debugw("nothing to update, roles are the same", "old_role", oldRole, "new_role", newRole) + + return nil + } + + // User the IDs of the memberships and delete all related tuples + for _, id := range ids { + member, err := m.Client().OrgMembership.Get(ctx, id) + if err != nil { + return err + } + + req := fgax.TupleRequest{ + SubjectID: member.UserID, + SubjectType: "user", + ObjectID: member.OrganizationID, + ObjectType: "organization", + Relation: oldRole.String(), + } + d := fgax.GetTupleKey(req) + + deletes = append(deletes, d) + + req.Relation = newRole.String() + w := fgax.GetTupleKey(req) + + writes = append(writes, w) + + if len(writes) == 0 && len(deletes) == 0 { + m.Logger.Debugw("no relationships to create or delete") + + return nil + } + + if _, err := m.Authz.WriteTupleKeys(ctx, writes, deletes); err != nil { + m.Logger.Errorw("failed to update relationship tuple", "error", err) + + return err + } + } + + return nil +} + +func (m *OrgMembershipMutation) CreateTuplesFromDelete(ctx context.Context) error { + + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + + // get ids that will be deleted + ids, err := m.IDs(ctx) + if err != nil { + return err + } + + tuples := []fgax.TupleKey{} + + // User the IDs of the memberships and delete all related tuples + for _, id := range ids { + // this wont work with soft deletes + members, err := m.Client().OrgMembership.Get(ctx, id) + if err != nil { + return err + } + + req := fgax.TupleRequest{ + SubjectID: members.UserID, + SubjectType: "user", + ObjectID: members.OrganizationID, + ObjectType: "organization", + Relation: members.Role.String(), + } + t := fgax.GetTupleKey(req) + + tuples = append(tuples, t) + } + + if len(tuples) > 0 { + if _, err := m.Authz.WriteTupleKeys(ctx, nil, tuples); err != nil { + m.Logger.Errorw("failed to delete relationship tuple", "error", err) + + return err + } + + m.Logger.Debugw("deleted relationship tuples") + } + + return nil +} diff --git a/internal/ent/generated/authz_checks.go b/internal/ent/generated/authz_checks.go new file mode 100644 index 0000000..21f2d9a --- /dev/null +++ b/internal/ent/generated/authz_checks.go @@ -0,0 +1,4905 @@ +// Code generated by entfga, DO NOT EDIT. +package generated + +import ( + "context" + + "entgo.io/ent/privacy" + "github.com/99designs/gqlgen/graphql" + + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/iam/auth" + "github.com/theopenlane/iam/fgax" +) + +func (q *APITokenQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*APITokenWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *APITokenMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().APIToken.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *APITokenMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *ContactQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*ContactWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *ContactMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Contact.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *ContactMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *ContactHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*ContactHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *DocumentDataQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*DocumentDataWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *DocumentDataMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().DocumentData.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *DocumentDataMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *DocumentDataHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*DocumentDataHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *EntitlementQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntitlementWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *EntitlementMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Entitlement.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *EntitlementMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *EntitlementHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntitlementHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *EntitlementPlanQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntitlementPlanWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *EntitlementPlanMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().EntitlementPlan.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *EntitlementPlanMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *EntitlementPlanFeatureQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntitlementPlanFeatureWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *EntitlementPlanFeatureMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().EntitlementPlanFeature.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *EntitlementPlanFeatureMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *EntitlementPlanFeatureHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntitlementPlanFeatureHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *EntitlementPlanHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntitlementPlanHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *EntityQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntityWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *EntityMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Entity.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *EntityMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *EntityHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntityHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *EntityTypeQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntityTypeWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *EntityTypeMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().EntityType.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *EntityTypeMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *EntityTypeHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*EntityTypeHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *FeatureQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*FeatureWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *FeatureMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Feature.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *FeatureMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *FeatureHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*FeatureHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *GroupQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*GroupWhereInput) + if ok && where != nil && where.ID != nil { + ac.ObjectID = *where.ID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["id"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "id" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.ID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *GroupMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + // check the id from the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["id"].(string) + } + + // if this is still empty, we need to query the object to get the object id + // this happens on join tables where we have the join ID (for updates and deletes) + if ac.ObjectID == "" && "id" != "id" { + id, ok := gCtx.Args["id"].(string) + if ok { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Group.Query().Where(group.ID(id)).Only(reqCtx) + if err != nil { + return privacy.Skipf("nil request, skipping auth check") + } + ac.ObjectID = ob.ID + } + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *GroupMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *GroupHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*GroupHistoryWhereInput) + if ok && where != nil && where.Ref != nil { + ac.ObjectID = *where.Ref + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ref"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ref" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.Ref + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *GroupMembershipQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*GroupMembershipWhereInput) + if ok && where != nil && where.GroupID != nil { + ac.ObjectID = *where.GroupID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["groupid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "groupid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.GroupID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *GroupMembershipMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + // get the input from the context + gInput := gCtx.Args["input"] + + // check if the input is a CreateGroupMembershipInput + input, ok := gInput.(CreateGroupMembershipInput) + if ok { + ac.ObjectID = input.GroupID + + } + + // check the id from the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["groupid"].(string) + } + + // if this is still empty, we need to query the object to get the object id + // this happens on join tables where we have the join ID (for updates and deletes) + if ac.ObjectID == "" && "id" != "groupid" { + id, ok := gCtx.Args["id"].(string) + if ok { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().GroupMembership.Query().Where(groupmembership.ID(id)).Only(reqCtx) + if err != nil { + return privacy.Skipf("nil request, skipping auth check") + } + ac.ObjectID = ob.GroupID + } + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *GroupMembershipMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *GroupMembershipHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*GroupMembershipHistoryWhereInput) + if ok && where != nil && where.GroupID != nil { + ac.ObjectID = *where.GroupID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["groupid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "groupid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.GroupID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *GroupSettingQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*GroupSettingWhereInput) + if ok && where != nil && where.GroupID != nil { + ac.ObjectID = *where.GroupID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["groupid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "groupid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.GroupID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *GroupSettingMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + // get the input from the context + gInput := gCtx.Args["input"] + + // check if the input is a CreateGroupSettingInput + input, ok := gInput.(CreateGroupSettingInput) + if ok { + ac.ObjectID = *input.GroupID + + } + + // check the id from the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["groupid"].(string) + } + + // if this is still empty, we need to query the object to get the object id + // this happens on join tables where we have the join ID (for updates and deletes) + if ac.ObjectID == "" && "id" != "groupid" { + id, ok := gCtx.Args["id"].(string) + if ok { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().GroupSetting.Query().Where(groupsetting.ID(id)).Only(reqCtx) + if err != nil { + return privacy.Skipf("nil request, skipping auth check") + } + ac.ObjectID = ob.GroupID + } + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *GroupSettingMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *GroupSettingHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "group", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*GroupSettingHistoryWhereInput) + if ok && where != nil && where.GroupID != nil { + ac.ObjectID = *where.GroupID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["groupid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "groupid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.GroupID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *IntegrationQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*IntegrationWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *IntegrationMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Integration.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *IntegrationMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *IntegrationHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*IntegrationHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *InviteQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*InviteWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *InviteMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Invite.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *InviteMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *NoteQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*NoteWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *NoteMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Note.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *NoteMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *NoteHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*NoteHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *OauthProviderQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OauthProviderWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *OauthProviderMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().OauthProvider.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *OauthProviderMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *OauthProviderHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OauthProviderHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *OrgMembershipQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OrgMembershipWhereInput) + if ok && where != nil && where.OrganizationID != nil { + ac.ObjectID = *where.OrganizationID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["organizationid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "organizationid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OrganizationID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *OrgMembershipMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + // get the input from the context + gInput := gCtx.Args["input"] + + // check if the input is a CreateOrgMembershipInput + input, ok := gInput.(CreateOrgMembershipInput) + if ok { + ac.ObjectID = input.OrganizationID + + } + + // check the id from the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["organizationid"].(string) + } + + // if this is still empty, we need to query the object to get the object id + // this happens on join tables where we have the join ID (for updates and deletes) + if ac.ObjectID == "" && "id" != "organizationid" { + id, ok := gCtx.Args["id"].(string) + if ok { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().OrgMembership.Query().Where(orgmembership.ID(id)).Only(reqCtx) + if err != nil { + return privacy.Skipf("nil request, skipping auth check") + } + ac.ObjectID = ob.OrganizationID + } + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *OrgMembershipMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *OrgMembershipHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OrgMembershipHistoryWhereInput) + if ok && where != nil && where.OrganizationID != nil { + ac.ObjectID = *where.OrganizationID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["organizationid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "organizationid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OrganizationID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *OrganizationQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OrganizationWhereInput) + if ok && where != nil && where.ID != nil { + ac.ObjectID = *where.ID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["id"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "id" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.ID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *OrganizationMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + // check the id from the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["id"].(string) + } + + // if this is still empty, we need to query the object to get the object id + // this happens on join tables where we have the join ID (for updates and deletes) + if ac.ObjectID == "" && "id" != "id" { + id, ok := gCtx.Args["id"].(string) + if ok { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Organization.Query().Where(organization.ID(id)).Only(reqCtx) + if err != nil { + return privacy.Skipf("nil request, skipping auth check") + } + ac.ObjectID = ob.ID + } + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *OrganizationMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *OrganizationHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OrganizationHistoryWhereInput) + if ok && where != nil && where.Ref != nil { + ac.ObjectID = *where.Ref + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ref"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ref" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.Ref + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *OrganizationSettingQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OrganizationSettingWhereInput) + if ok && where != nil && where.OrganizationID != nil { + ac.ObjectID = *where.OrganizationID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["organizationid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "organizationid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OrganizationID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *OrganizationSettingMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + // get the input from the context + gInput := gCtx.Args["input"] + + // check if the input is a CreateOrganizationSettingInput + input, ok := gInput.(CreateOrganizationSettingInput) + if ok { + ac.ObjectID = *input.OrganizationID + + } + + // check the id from the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["organizationid"].(string) + } + + // if this is still empty, we need to query the object to get the object id + // this happens on join tables where we have the join ID (for updates and deletes) + if ac.ObjectID == "" && "id" != "organizationid" { + id, ok := gCtx.Args["id"].(string) + if ok { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().OrganizationSetting.Query().Where(organizationsetting.ID(id)).Only(reqCtx) + if err != nil { + return privacy.Skipf("nil request, skipping auth check") + } + ac.ObjectID = ob.OrganizationID + } + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *OrganizationSettingMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *OrganizationSettingHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*OrganizationSettingHistoryWhereInput) + if ok && where != nil && where.OrganizationID != nil { + ac.ObjectID = *where.OrganizationID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["organizationid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "organizationid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OrganizationID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *SubscriberQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*SubscriberWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *SubscriberMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Subscriber.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *SubscriberMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *TemplateQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*TemplateWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *TemplateMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + orgID, oErr := auth.GetOrganizationIDFromContext(ctx) + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens when using a personal access token since it is authorized for multiple orgs + if orgID == "" || oErr != nil { + id, _ := m.ID() + + if id != "" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Template.Get(reqCtx, id) + if err != nil { + m.Logger.Debugw("error getting object", "error", err) + + return err + } + + orgID = ob.OwnerID + } + } + + ac.ObjectID = orgID + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *TemplateMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *TemplateHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*TemplateHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} + +func (q *WebhookQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*WebhookWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} +func (m *WebhookMutation) CheckAccessForEdit(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanEdit, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + // get the input from the context + gInput := gCtx.Args["input"] + + // check if the input is a CreateWebhookInput + input, ok := gInput.(CreateWebhookInput) + if ok { + ac.ObjectID = *input.OwnerID + + } + + // check the id from the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if this is still empty, we need to query the object to get the object id + // this happens on join tables where we have the join ID (for updates and deletes) + if ac.ObjectID == "" && "id" != "ownerid" { + id, ok := gCtx.Args["id"].(string) + if ok { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := m.Client().Webhook.Query().Where(webhook.ID(id)).Only(reqCtx) + if err != nil { + return privacy.Skipf("nil request, skipping auth check") + } + ac.ObjectID = ob.OwnerID + } + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (m *WebhookMutation) CheckAccessForDelete(ctx context.Context) error { + ac := fgax.AccessCheck{ + Relation: fgax.CanDelete, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + gCtx := graphql.GetFieldContext(ctx) + + var ok bool + ac.ObjectID, ok = gCtx.Args["id"].(string) + if !ok { + return privacy.Allowf("nil request, bypassing auth check") + } + + m.Logger.Debugw("checking mutation access") + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", ac.Relation, "object_id", ac.ObjectID) + + access, err := m.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", ac.Relation, "object_id", ac.ObjectID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny +} + +func (q *WebhookHistoryQuery) CheckAccess(ctx context.Context) error { + gCtx := graphql.GetFieldContext(ctx) + + if gCtx != nil { + ac := fgax.AccessCheck{ + Relation: fgax.CanView, + ObjectType: "organization", + SubjectType: auth.GetAuthzSubjectType(ctx), + } + + // check id from graphql arg context + // when all objects are requested, the interceptor will check object access + // check the where input first + whereArg := gCtx.Args["where"] + if whereArg != nil { + where, ok := whereArg.(*WebhookHistoryWhereInput) + if ok && where != nil && where.OwnerID != nil { + ac.ObjectID = *where.OwnerID + } + } + + // if that doesn't work, check for the id in the args + if ac.ObjectID == "" { + ac.ObjectID, _ = gCtx.Args["ownerid"].(string) + } + + // if we still don't have an object id, run the query and grab the object ID + // from the result + // this happens on join tables where we have the join ID (for updates and deletes) + // and not the actual object id + if ac.ObjectID == "" && "id" != "ownerid" { + // allow this query to run + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + ob, err := q.Clone().Only(reqCtx) + if err != nil { + return privacy.Allowf("nil request, bypassing auth check") + } + ac.ObjectID = ob.OwnerID + } + + // request is for a list objects, will get filtered in interceptors + if ac.ObjectID == "" { + return privacy.Allowf("nil request, bypassing auth check") + } + + var err error + ac.SubjectID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + access, err := q.Authz.CheckAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + return privacy.Allow + } + } + + // Skip to the next privacy rule (equivalent to return nil) + return privacy.Skip +} diff --git a/internal/ent/generated/client.go b/internal/ent/generated/client.go new file mode 100644 index 0000000..3b3f85d --- /dev/null +++ b/internal/ent/generated/client.go @@ -0,0 +1,11118 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "log" + "reflect" + + "github.com/theopenlane/core/internal/ent/generated/migrate" + + "entgo.io/ent" + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/entconfig" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/theopenlane/core/pkg/analytics" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" + "github.com/theopenlane/dbx/pkg/dbxclient" + "github.com/theopenlane/iam/entfga" + "github.com/theopenlane/iam/fgax" + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/totp" + "go.uber.org/zap" + "gocloud.dev/secrets" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// Client is the client that holds all ent builders. +type Client struct { + config + // Schema is the client for creating, migrating and dropping schema. + Schema *migrate.Schema + // APIToken is the client for interacting with the APIToken builders. + APIToken *APITokenClient + // Contact is the client for interacting with the Contact builders. + Contact *ContactClient + // ContactHistory is the client for interacting with the ContactHistory builders. + ContactHistory *ContactHistoryClient + // DocumentData is the client for interacting with the DocumentData builders. + DocumentData *DocumentDataClient + // DocumentDataHistory is the client for interacting with the DocumentDataHistory builders. + DocumentDataHistory *DocumentDataHistoryClient + // EmailVerificationToken is the client for interacting with the EmailVerificationToken builders. + EmailVerificationToken *EmailVerificationTokenClient + // Entitlement is the client for interacting with the Entitlement builders. + Entitlement *EntitlementClient + // EntitlementHistory is the client for interacting with the EntitlementHistory builders. + EntitlementHistory *EntitlementHistoryClient + // EntitlementPlan is the client for interacting with the EntitlementPlan builders. + EntitlementPlan *EntitlementPlanClient + // EntitlementPlanFeature is the client for interacting with the EntitlementPlanFeature builders. + EntitlementPlanFeature *EntitlementPlanFeatureClient + // EntitlementPlanFeatureHistory is the client for interacting with the EntitlementPlanFeatureHistory builders. + EntitlementPlanFeatureHistory *EntitlementPlanFeatureHistoryClient + // EntitlementPlanHistory is the client for interacting with the EntitlementPlanHistory builders. + EntitlementPlanHistory *EntitlementPlanHistoryClient + // Entity is the client for interacting with the Entity builders. + Entity *EntityClient + // EntityHistory is the client for interacting with the EntityHistory builders. + EntityHistory *EntityHistoryClient + // EntityType is the client for interacting with the EntityType builders. + EntityType *EntityTypeClient + // EntityTypeHistory is the client for interacting with the EntityTypeHistory builders. + EntityTypeHistory *EntityTypeHistoryClient + // Event is the client for interacting with the Event builders. + Event *EventClient + // EventHistory is the client for interacting with the EventHistory builders. + EventHistory *EventHistoryClient + // Feature is the client for interacting with the Feature builders. + Feature *FeatureClient + // FeatureHistory is the client for interacting with the FeatureHistory builders. + FeatureHistory *FeatureHistoryClient + // File is the client for interacting with the File builders. + File *FileClient + // FileHistory is the client for interacting with the FileHistory builders. + FileHistory *FileHistoryClient + // Group is the client for interacting with the Group builders. + Group *GroupClient + // GroupHistory is the client for interacting with the GroupHistory builders. + GroupHistory *GroupHistoryClient + // GroupMembership is the client for interacting with the GroupMembership builders. + GroupMembership *GroupMembershipClient + // GroupMembershipHistory is the client for interacting with the GroupMembershipHistory builders. + GroupMembershipHistory *GroupMembershipHistoryClient + // GroupSetting is the client for interacting with the GroupSetting builders. + GroupSetting *GroupSettingClient + // GroupSettingHistory is the client for interacting with the GroupSettingHistory builders. + GroupSettingHistory *GroupSettingHistoryClient + // Hush is the client for interacting with the Hush builders. + Hush *HushClient + // HushHistory is the client for interacting with the HushHistory builders. + HushHistory *HushHistoryClient + // Integration is the client for interacting with the Integration builders. + Integration *IntegrationClient + // IntegrationHistory is the client for interacting with the IntegrationHistory builders. + IntegrationHistory *IntegrationHistoryClient + // Invite is the client for interacting with the Invite builders. + Invite *InviteClient + // Note is the client for interacting with the Note builders. + Note *NoteClient + // NoteHistory is the client for interacting with the NoteHistory builders. + NoteHistory *NoteHistoryClient + // OauthProvider is the client for interacting with the OauthProvider builders. + OauthProvider *OauthProviderClient + // OauthProviderHistory is the client for interacting with the OauthProviderHistory builders. + OauthProviderHistory *OauthProviderHistoryClient + // OhAuthTooToken is the client for interacting with the OhAuthTooToken builders. + OhAuthTooToken *OhAuthTooTokenClient + // OrgMembership is the client for interacting with the OrgMembership builders. + OrgMembership *OrgMembershipClient + // OrgMembershipHistory is the client for interacting with the OrgMembershipHistory builders. + OrgMembershipHistory *OrgMembershipHistoryClient + // Organization is the client for interacting with the Organization builders. + Organization *OrganizationClient + // OrganizationHistory is the client for interacting with the OrganizationHistory builders. + OrganizationHistory *OrganizationHistoryClient + // OrganizationSetting is the client for interacting with the OrganizationSetting builders. + OrganizationSetting *OrganizationSettingClient + // OrganizationSettingHistory is the client for interacting with the OrganizationSettingHistory builders. + OrganizationSettingHistory *OrganizationSettingHistoryClient + // PasswordResetToken is the client for interacting with the PasswordResetToken builders. + PasswordResetToken *PasswordResetTokenClient + // PersonalAccessToken is the client for interacting with the PersonalAccessToken builders. + PersonalAccessToken *PersonalAccessTokenClient + // Subscriber is the client for interacting with the Subscriber builders. + Subscriber *SubscriberClient + // TFASetting is the client for interacting with the TFASetting builders. + TFASetting *TFASettingClient + // Template is the client for interacting with the Template builders. + Template *TemplateClient + // TemplateHistory is the client for interacting with the TemplateHistory builders. + TemplateHistory *TemplateHistoryClient + // User is the client for interacting with the User builders. + User *UserClient + // UserHistory is the client for interacting with the UserHistory builders. + UserHistory *UserHistoryClient + // UserSetting is the client for interacting with the UserSetting builders. + UserSetting *UserSettingClient + // UserSettingHistory is the client for interacting with the UserSettingHistory builders. + UserSettingHistory *UserSettingHistoryClient + // Webauthn is the client for interacting with the Webauthn builders. + Webauthn *WebauthnClient + // Webhook is the client for interacting with the Webhook builders. + Webhook *WebhookClient + // WebhookHistory is the client for interacting with the WebhookHistory builders. + WebhookHistory *WebhookHistoryClient + + // authzActivated determines if the authz hooks have already been activated + authzActivated bool +} + +// NewClient creates a new client configured with the given options. +func NewClient(opts ...Option) *Client { + cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} + cfg.options(opts...) + client := &Client{config: cfg} + client.init() + return client +} + +func (c *Client) init() { + c.Schema = migrate.NewSchema(c.driver) + c.APIToken = NewAPITokenClient(c.config) + c.Contact = NewContactClient(c.config) + c.ContactHistory = NewContactHistoryClient(c.config) + c.DocumentData = NewDocumentDataClient(c.config) + c.DocumentDataHistory = NewDocumentDataHistoryClient(c.config) + c.EmailVerificationToken = NewEmailVerificationTokenClient(c.config) + c.Entitlement = NewEntitlementClient(c.config) + c.EntitlementHistory = NewEntitlementHistoryClient(c.config) + c.EntitlementPlan = NewEntitlementPlanClient(c.config) + c.EntitlementPlanFeature = NewEntitlementPlanFeatureClient(c.config) + c.EntitlementPlanFeatureHistory = NewEntitlementPlanFeatureHistoryClient(c.config) + c.EntitlementPlanHistory = NewEntitlementPlanHistoryClient(c.config) + c.Entity = NewEntityClient(c.config) + c.EntityHistory = NewEntityHistoryClient(c.config) + c.EntityType = NewEntityTypeClient(c.config) + c.EntityTypeHistory = NewEntityTypeHistoryClient(c.config) + c.Event = NewEventClient(c.config) + c.EventHistory = NewEventHistoryClient(c.config) + c.Feature = NewFeatureClient(c.config) + c.FeatureHistory = NewFeatureHistoryClient(c.config) + c.File = NewFileClient(c.config) + c.FileHistory = NewFileHistoryClient(c.config) + c.Group = NewGroupClient(c.config) + c.GroupHistory = NewGroupHistoryClient(c.config) + c.GroupMembership = NewGroupMembershipClient(c.config) + c.GroupMembershipHistory = NewGroupMembershipHistoryClient(c.config) + c.GroupSetting = NewGroupSettingClient(c.config) + c.GroupSettingHistory = NewGroupSettingHistoryClient(c.config) + c.Hush = NewHushClient(c.config) + c.HushHistory = NewHushHistoryClient(c.config) + c.Integration = NewIntegrationClient(c.config) + c.IntegrationHistory = NewIntegrationHistoryClient(c.config) + c.Invite = NewInviteClient(c.config) + c.Note = NewNoteClient(c.config) + c.NoteHistory = NewNoteHistoryClient(c.config) + c.OauthProvider = NewOauthProviderClient(c.config) + c.OauthProviderHistory = NewOauthProviderHistoryClient(c.config) + c.OhAuthTooToken = NewOhAuthTooTokenClient(c.config) + c.OrgMembership = NewOrgMembershipClient(c.config) + c.OrgMembershipHistory = NewOrgMembershipHistoryClient(c.config) + c.Organization = NewOrganizationClient(c.config) + c.OrganizationHistory = NewOrganizationHistoryClient(c.config) + c.OrganizationSetting = NewOrganizationSettingClient(c.config) + c.OrganizationSettingHistory = NewOrganizationSettingHistoryClient(c.config) + c.PasswordResetToken = NewPasswordResetTokenClient(c.config) + c.PersonalAccessToken = NewPersonalAccessTokenClient(c.config) + c.Subscriber = NewSubscriberClient(c.config) + c.TFASetting = NewTFASettingClient(c.config) + c.Template = NewTemplateClient(c.config) + c.TemplateHistory = NewTemplateHistoryClient(c.config) + c.User = NewUserClient(c.config) + c.UserHistory = NewUserHistoryClient(c.config) + c.UserSetting = NewUserSettingClient(c.config) + c.UserSettingHistory = NewUserSettingHistoryClient(c.config) + c.Webauthn = NewWebauthnClient(c.config) + c.Webhook = NewWebhookClient(c.config) + c.WebhookHistory = NewWebhookHistoryClient(c.config) +} + +// WithAuthz adds the authz hooks to the appropriate schemas - generated by entfga +func (c *Client) WithAuthz() { + if !c.authzActivated { + + for _, hook := range entfga.AuthzHooks[*GroupMembershipMutation]() { + c.GroupMembership.Use(hook) + } + + for _, hook := range entfga.AuthzHooks[*OrgMembershipMutation]() { + c.OrgMembership.Use(hook) + } + + c.authzActivated = true + } +} + +type ( + // config is the configuration for the client and its builder. + config struct { + // driver used for executing database requests. + driver dialect.Driver + // debug enable a debug logging. + debug bool + // log used for logging on debug mode. + log func(...any) + // hooks to execute on mutations. + hooks *hooks + // interceptors to execute on queries. + inters *inters + EntConfig *entconfig.Config + Secrets *secrets.Keeper + Authz fgax.Client + TokenManager *tokens.TokenManager + SessionConfig *sessions.SessionConfig + Logger zap.SugaredLogger + Emails *emails.EmailManager + Marionette *marionette.TaskManager + Analytics *analytics.EventManager + TOTP *totp.Manager + DBx *dbxclient.Client + // schemaConfig contains alternative names for all tables. + schemaConfig SchemaConfig + } + // Option function to configure the client. + Option func(*config) +) + +// newConfig creates a new config for the client. +func newConfig(opts ...Option) config { + cfg := config{log: log.Println, hooks: &hooks{}, inters: &inters{}} + cfg.options(opts...) + return cfg +} + +// options applies the options on the config object. +func (c *config) options(opts ...Option) { + for _, opt := range opts { + opt(c) + } + if c.debug { + c.driver = dialect.Debug(c.driver, c.log) + } +} + +// Debug enables debug logging on the ent.Driver. +func Debug() Option { + return func(c *config) { + c.debug = true + } +} + +// Log sets the logging function for debug mode. +func Log(fn func(...any)) Option { + return func(c *config) { + c.log = fn + } +} + +// Driver configures the client driver. +func Driver(driver dialect.Driver) Option { + return func(c *config) { + c.driver = driver + } +} + +// EntConfig configures the EntConfig. +func EntConfig(v *entconfig.Config) Option { + return func(c *config) { + c.EntConfig = v + } +} + +// Secrets configures the Secrets. +func Secrets(v *secrets.Keeper) Option { + return func(c *config) { + c.Secrets = v + } +} + +// Authz configures the Authz. +func Authz(v fgax.Client) Option { + return func(c *config) { + c.Authz = v + } +} + +// TokenManager configures the TokenManager. +func TokenManager(v *tokens.TokenManager) Option { + return func(c *config) { + c.TokenManager = v + } +} + +// SessionConfig configures the SessionConfig. +func SessionConfig(v *sessions.SessionConfig) Option { + return func(c *config) { + c.SessionConfig = v + } +} + +// Logger configures the Logger. +func Logger(v zap.SugaredLogger) Option { + return func(c *config) { + c.Logger = v + } +} + +// Emails configures the Emails. +func Emails(v *emails.EmailManager) Option { + return func(c *config) { + c.Emails = v + } +} + +// Marionette configures the Marionette. +func Marionette(v *marionette.TaskManager) Option { + return func(c *config) { + c.Marionette = v + } +} + +// Analytics configures the Analytics. +func Analytics(v *analytics.EventManager) Option { + return func(c *config) { + c.Analytics = v + } +} + +// TOTP configures the TOTP. +func TOTP(v *totp.Manager) Option { + return func(c *config) { + c.TOTP = v + } +} + +// DBx configures the DBx. +func DBx(v *dbxclient.Client) Option { + return func(c *config) { + c.DBx = v + } +} + +// Open opens a database/sql.DB specified by the driver name and +// the data source name, and returns a new client attached to it. +// Optional parameters can be added for configuring the client. +func Open(driverName, dataSourceName string, options ...Option) (*Client, error) { + switch driverName { + case dialect.MySQL, dialect.Postgres, dialect.SQLite: + drv, err := sql.Open(driverName, dataSourceName) + if err != nil { + return nil, err + } + return NewClient(append(options, Driver(drv))...), nil + default: + return nil, fmt.Errorf("unsupported driver: %q", driverName) + } +} + +// ErrTxStarted is returned when trying to start a new transaction from a transactional client. +var ErrTxStarted = errors.New("generated: cannot start a transaction within a transaction") + +// Tx returns a new transactional client. The provided context +// is used until the transaction is committed or rolled back. +func (c *Client) Tx(ctx context.Context) (*Tx, error) { + if _, ok := c.driver.(*txDriver); ok { + return nil, ErrTxStarted + } + tx, err := newTx(ctx, c.driver) + if err != nil { + return nil, fmt.Errorf("generated: starting a transaction: %w", err) + } + cfg := c.config + cfg.driver = tx + return &Tx{ + ctx: ctx, + config: cfg, + APIToken: NewAPITokenClient(cfg), + Contact: NewContactClient(cfg), + ContactHistory: NewContactHistoryClient(cfg), + DocumentData: NewDocumentDataClient(cfg), + DocumentDataHistory: NewDocumentDataHistoryClient(cfg), + EmailVerificationToken: NewEmailVerificationTokenClient(cfg), + Entitlement: NewEntitlementClient(cfg), + EntitlementHistory: NewEntitlementHistoryClient(cfg), + EntitlementPlan: NewEntitlementPlanClient(cfg), + EntitlementPlanFeature: NewEntitlementPlanFeatureClient(cfg), + EntitlementPlanFeatureHistory: NewEntitlementPlanFeatureHistoryClient(cfg), + EntitlementPlanHistory: NewEntitlementPlanHistoryClient(cfg), + Entity: NewEntityClient(cfg), + EntityHistory: NewEntityHistoryClient(cfg), + EntityType: NewEntityTypeClient(cfg), + EntityTypeHistory: NewEntityTypeHistoryClient(cfg), + Event: NewEventClient(cfg), + EventHistory: NewEventHistoryClient(cfg), + Feature: NewFeatureClient(cfg), + FeatureHistory: NewFeatureHistoryClient(cfg), + File: NewFileClient(cfg), + FileHistory: NewFileHistoryClient(cfg), + Group: NewGroupClient(cfg), + GroupHistory: NewGroupHistoryClient(cfg), + GroupMembership: NewGroupMembershipClient(cfg), + GroupMembershipHistory: NewGroupMembershipHistoryClient(cfg), + GroupSetting: NewGroupSettingClient(cfg), + GroupSettingHistory: NewGroupSettingHistoryClient(cfg), + Hush: NewHushClient(cfg), + HushHistory: NewHushHistoryClient(cfg), + Integration: NewIntegrationClient(cfg), + IntegrationHistory: NewIntegrationHistoryClient(cfg), + Invite: NewInviteClient(cfg), + Note: NewNoteClient(cfg), + NoteHistory: NewNoteHistoryClient(cfg), + OauthProvider: NewOauthProviderClient(cfg), + OauthProviderHistory: NewOauthProviderHistoryClient(cfg), + OhAuthTooToken: NewOhAuthTooTokenClient(cfg), + OrgMembership: NewOrgMembershipClient(cfg), + OrgMembershipHistory: NewOrgMembershipHistoryClient(cfg), + Organization: NewOrganizationClient(cfg), + OrganizationHistory: NewOrganizationHistoryClient(cfg), + OrganizationSetting: NewOrganizationSettingClient(cfg), + OrganizationSettingHistory: NewOrganizationSettingHistoryClient(cfg), + PasswordResetToken: NewPasswordResetTokenClient(cfg), + PersonalAccessToken: NewPersonalAccessTokenClient(cfg), + Subscriber: NewSubscriberClient(cfg), + TFASetting: NewTFASettingClient(cfg), + Template: NewTemplateClient(cfg), + TemplateHistory: NewTemplateHistoryClient(cfg), + User: NewUserClient(cfg), + UserHistory: NewUserHistoryClient(cfg), + UserSetting: NewUserSettingClient(cfg), + UserSettingHistory: NewUserSettingHistoryClient(cfg), + Webauthn: NewWebauthnClient(cfg), + Webhook: NewWebhookClient(cfg), + WebhookHistory: NewWebhookHistoryClient(cfg), + }, nil +} + +// BeginTx returns a transactional client with specified options. +func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) { + if _, ok := c.driver.(*txDriver); ok { + return nil, errors.New("ent: cannot start a transaction within a transaction") + } + tx, err := c.driver.(interface { + BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error) + }).BeginTx(ctx, opts) + if err != nil { + return nil, fmt.Errorf("ent: starting a transaction: %w", err) + } + cfg := c.config + cfg.driver = &txDriver{tx: tx, drv: c.driver} + return &Tx{ + ctx: ctx, + config: cfg, + APIToken: NewAPITokenClient(cfg), + Contact: NewContactClient(cfg), + ContactHistory: NewContactHistoryClient(cfg), + DocumentData: NewDocumentDataClient(cfg), + DocumentDataHistory: NewDocumentDataHistoryClient(cfg), + EmailVerificationToken: NewEmailVerificationTokenClient(cfg), + Entitlement: NewEntitlementClient(cfg), + EntitlementHistory: NewEntitlementHistoryClient(cfg), + EntitlementPlan: NewEntitlementPlanClient(cfg), + EntitlementPlanFeature: NewEntitlementPlanFeatureClient(cfg), + EntitlementPlanFeatureHistory: NewEntitlementPlanFeatureHistoryClient(cfg), + EntitlementPlanHistory: NewEntitlementPlanHistoryClient(cfg), + Entity: NewEntityClient(cfg), + EntityHistory: NewEntityHistoryClient(cfg), + EntityType: NewEntityTypeClient(cfg), + EntityTypeHistory: NewEntityTypeHistoryClient(cfg), + Event: NewEventClient(cfg), + EventHistory: NewEventHistoryClient(cfg), + Feature: NewFeatureClient(cfg), + FeatureHistory: NewFeatureHistoryClient(cfg), + File: NewFileClient(cfg), + FileHistory: NewFileHistoryClient(cfg), + Group: NewGroupClient(cfg), + GroupHistory: NewGroupHistoryClient(cfg), + GroupMembership: NewGroupMembershipClient(cfg), + GroupMembershipHistory: NewGroupMembershipHistoryClient(cfg), + GroupSetting: NewGroupSettingClient(cfg), + GroupSettingHistory: NewGroupSettingHistoryClient(cfg), + Hush: NewHushClient(cfg), + HushHistory: NewHushHistoryClient(cfg), + Integration: NewIntegrationClient(cfg), + IntegrationHistory: NewIntegrationHistoryClient(cfg), + Invite: NewInviteClient(cfg), + Note: NewNoteClient(cfg), + NoteHistory: NewNoteHistoryClient(cfg), + OauthProvider: NewOauthProviderClient(cfg), + OauthProviderHistory: NewOauthProviderHistoryClient(cfg), + OhAuthTooToken: NewOhAuthTooTokenClient(cfg), + OrgMembership: NewOrgMembershipClient(cfg), + OrgMembershipHistory: NewOrgMembershipHistoryClient(cfg), + Organization: NewOrganizationClient(cfg), + OrganizationHistory: NewOrganizationHistoryClient(cfg), + OrganizationSetting: NewOrganizationSettingClient(cfg), + OrganizationSettingHistory: NewOrganizationSettingHistoryClient(cfg), + PasswordResetToken: NewPasswordResetTokenClient(cfg), + PersonalAccessToken: NewPersonalAccessTokenClient(cfg), + Subscriber: NewSubscriberClient(cfg), + TFASetting: NewTFASettingClient(cfg), + Template: NewTemplateClient(cfg), + TemplateHistory: NewTemplateHistoryClient(cfg), + User: NewUserClient(cfg), + UserHistory: NewUserHistoryClient(cfg), + UserSetting: NewUserSettingClient(cfg), + UserSettingHistory: NewUserSettingHistoryClient(cfg), + Webauthn: NewWebauthnClient(cfg), + Webhook: NewWebhookClient(cfg), + WebhookHistory: NewWebhookHistoryClient(cfg), + }, nil +} + +// Debug returns a new debug-client. It's used to get verbose logging on specific operations. +// +// client.Debug(). +// APIToken. +// Query(). +// Count(ctx) +func (c *Client) Debug() *Client { + if c.debug { + return c + } + cfg := c.config + cfg.driver = dialect.Debug(c.driver, c.log) + client := &Client{config: cfg} + client.init() + return client +} + +// Close closes the database connection and prevents new queries from starting. +func (c *Client) Close() error { + return c.driver.Close() +} + +// Use adds the mutation hooks to all the entity clients. +// In order to add hooks to a specific client, call: `client.Node.Use(...)`. +func (c *Client) Use(hooks ...Hook) { + for _, n := range []interface{ Use(...Hook) }{ + c.APIToken, c.Contact, c.ContactHistory, c.DocumentData, c.DocumentDataHistory, + c.EmailVerificationToken, c.Entitlement, c.EntitlementHistory, + c.EntitlementPlan, c.EntitlementPlanFeature, c.EntitlementPlanFeatureHistory, + c.EntitlementPlanHistory, c.Entity, c.EntityHistory, c.EntityType, + c.EntityTypeHistory, c.Event, c.EventHistory, c.Feature, c.FeatureHistory, + c.File, c.FileHistory, c.Group, c.GroupHistory, c.GroupMembership, + c.GroupMembershipHistory, c.GroupSetting, c.GroupSettingHistory, c.Hush, + c.HushHistory, c.Integration, c.IntegrationHistory, c.Invite, c.Note, + c.NoteHistory, c.OauthProvider, c.OauthProviderHistory, c.OhAuthTooToken, + c.OrgMembership, c.OrgMembershipHistory, c.Organization, c.OrganizationHistory, + c.OrganizationSetting, c.OrganizationSettingHistory, c.PasswordResetToken, + c.PersonalAccessToken, c.Subscriber, c.TFASetting, c.Template, + c.TemplateHistory, c.User, c.UserHistory, c.UserSetting, c.UserSettingHistory, + c.Webauthn, c.Webhook, c.WebhookHistory, + } { + n.Use(hooks...) + } +} + +// Intercept adds the query interceptors to all the entity clients. +// In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`. +func (c *Client) Intercept(interceptors ...Interceptor) { + for _, n := range []interface{ Intercept(...Interceptor) }{ + c.APIToken, c.Contact, c.ContactHistory, c.DocumentData, c.DocumentDataHistory, + c.EmailVerificationToken, c.Entitlement, c.EntitlementHistory, + c.EntitlementPlan, c.EntitlementPlanFeature, c.EntitlementPlanFeatureHistory, + c.EntitlementPlanHistory, c.Entity, c.EntityHistory, c.EntityType, + c.EntityTypeHistory, c.Event, c.EventHistory, c.Feature, c.FeatureHistory, + c.File, c.FileHistory, c.Group, c.GroupHistory, c.GroupMembership, + c.GroupMembershipHistory, c.GroupSetting, c.GroupSettingHistory, c.Hush, + c.HushHistory, c.Integration, c.IntegrationHistory, c.Invite, c.Note, + c.NoteHistory, c.OauthProvider, c.OauthProviderHistory, c.OhAuthTooToken, + c.OrgMembership, c.OrgMembershipHistory, c.Organization, c.OrganizationHistory, + c.OrganizationSetting, c.OrganizationSettingHistory, c.PasswordResetToken, + c.PersonalAccessToken, c.Subscriber, c.TFASetting, c.Template, + c.TemplateHistory, c.User, c.UserHistory, c.UserSetting, c.UserSettingHistory, + c.Webauthn, c.Webhook, c.WebhookHistory, + } { + n.Intercept(interceptors...) + } +} + +// Mutate implements the ent.Mutator interface. +func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) { + switch m := m.(type) { + case *APITokenMutation: + return c.APIToken.mutate(ctx, m) + case *ContactMutation: + return c.Contact.mutate(ctx, m) + case *ContactHistoryMutation: + return c.ContactHistory.mutate(ctx, m) + case *DocumentDataMutation: + return c.DocumentData.mutate(ctx, m) + case *DocumentDataHistoryMutation: + return c.DocumentDataHistory.mutate(ctx, m) + case *EmailVerificationTokenMutation: + return c.EmailVerificationToken.mutate(ctx, m) + case *EntitlementMutation: + return c.Entitlement.mutate(ctx, m) + case *EntitlementHistoryMutation: + return c.EntitlementHistory.mutate(ctx, m) + case *EntitlementPlanMutation: + return c.EntitlementPlan.mutate(ctx, m) + case *EntitlementPlanFeatureMutation: + return c.EntitlementPlanFeature.mutate(ctx, m) + case *EntitlementPlanFeatureHistoryMutation: + return c.EntitlementPlanFeatureHistory.mutate(ctx, m) + case *EntitlementPlanHistoryMutation: + return c.EntitlementPlanHistory.mutate(ctx, m) + case *EntityMutation: + return c.Entity.mutate(ctx, m) + case *EntityHistoryMutation: + return c.EntityHistory.mutate(ctx, m) + case *EntityTypeMutation: + return c.EntityType.mutate(ctx, m) + case *EntityTypeHistoryMutation: + return c.EntityTypeHistory.mutate(ctx, m) + case *EventMutation: + return c.Event.mutate(ctx, m) + case *EventHistoryMutation: + return c.EventHistory.mutate(ctx, m) + case *FeatureMutation: + return c.Feature.mutate(ctx, m) + case *FeatureHistoryMutation: + return c.FeatureHistory.mutate(ctx, m) + case *FileMutation: + return c.File.mutate(ctx, m) + case *FileHistoryMutation: + return c.FileHistory.mutate(ctx, m) + case *GroupMutation: + return c.Group.mutate(ctx, m) + case *GroupHistoryMutation: + return c.GroupHistory.mutate(ctx, m) + case *GroupMembershipMutation: + return c.GroupMembership.mutate(ctx, m) + case *GroupMembershipHistoryMutation: + return c.GroupMembershipHistory.mutate(ctx, m) + case *GroupSettingMutation: + return c.GroupSetting.mutate(ctx, m) + case *GroupSettingHistoryMutation: + return c.GroupSettingHistory.mutate(ctx, m) + case *HushMutation: + return c.Hush.mutate(ctx, m) + case *HushHistoryMutation: + return c.HushHistory.mutate(ctx, m) + case *IntegrationMutation: + return c.Integration.mutate(ctx, m) + case *IntegrationHistoryMutation: + return c.IntegrationHistory.mutate(ctx, m) + case *InviteMutation: + return c.Invite.mutate(ctx, m) + case *NoteMutation: + return c.Note.mutate(ctx, m) + case *NoteHistoryMutation: + return c.NoteHistory.mutate(ctx, m) + case *OauthProviderMutation: + return c.OauthProvider.mutate(ctx, m) + case *OauthProviderHistoryMutation: + return c.OauthProviderHistory.mutate(ctx, m) + case *OhAuthTooTokenMutation: + return c.OhAuthTooToken.mutate(ctx, m) + case *OrgMembershipMutation: + return c.OrgMembership.mutate(ctx, m) + case *OrgMembershipHistoryMutation: + return c.OrgMembershipHistory.mutate(ctx, m) + case *OrganizationMutation: + return c.Organization.mutate(ctx, m) + case *OrganizationHistoryMutation: + return c.OrganizationHistory.mutate(ctx, m) + case *OrganizationSettingMutation: + return c.OrganizationSetting.mutate(ctx, m) + case *OrganizationSettingHistoryMutation: + return c.OrganizationSettingHistory.mutate(ctx, m) + case *PasswordResetTokenMutation: + return c.PasswordResetToken.mutate(ctx, m) + case *PersonalAccessTokenMutation: + return c.PersonalAccessToken.mutate(ctx, m) + case *SubscriberMutation: + return c.Subscriber.mutate(ctx, m) + case *TFASettingMutation: + return c.TFASetting.mutate(ctx, m) + case *TemplateMutation: + return c.Template.mutate(ctx, m) + case *TemplateHistoryMutation: + return c.TemplateHistory.mutate(ctx, m) + case *UserMutation: + return c.User.mutate(ctx, m) + case *UserHistoryMutation: + return c.UserHistory.mutate(ctx, m) + case *UserSettingMutation: + return c.UserSetting.mutate(ctx, m) + case *UserSettingHistoryMutation: + return c.UserSettingHistory.mutate(ctx, m) + case *WebauthnMutation: + return c.Webauthn.mutate(ctx, m) + case *WebhookMutation: + return c.Webhook.mutate(ctx, m) + case *WebhookHistoryMutation: + return c.WebhookHistory.mutate(ctx, m) + default: + return nil, fmt.Errorf("generated: unknown mutation type %T", m) + } +} + +// APITokenClient is a client for the APIToken schema. +type APITokenClient struct { + config +} + +// NewAPITokenClient returns a client for the APIToken from the given config. +func NewAPITokenClient(c config) *APITokenClient { + return &APITokenClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `apitoken.Hooks(f(g(h())))`. +func (c *APITokenClient) Use(hooks ...Hook) { + c.hooks.APIToken = append(c.hooks.APIToken, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `apitoken.Intercept(f(g(h())))`. +func (c *APITokenClient) Intercept(interceptors ...Interceptor) { + c.inters.APIToken = append(c.inters.APIToken, interceptors...) +} + +// Create returns a builder for creating a APIToken entity. +func (c *APITokenClient) Create() *APITokenCreate { + mutation := newAPITokenMutation(c.config, OpCreate) + return &APITokenCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of APIToken entities. +func (c *APITokenClient) CreateBulk(builders ...*APITokenCreate) *APITokenCreateBulk { + return &APITokenCreateBulk{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 *APITokenClient) MapCreateBulk(slice any, setFunc func(*APITokenCreate, int)) *APITokenCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &APITokenCreateBulk{err: fmt.Errorf("calling to APITokenClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*APITokenCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &APITokenCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for APIToken. +func (c *APITokenClient) Update() *APITokenUpdate { + mutation := newAPITokenMutation(c.config, OpUpdate) + return &APITokenUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *APITokenClient) UpdateOne(at *APIToken) *APITokenUpdateOne { + mutation := newAPITokenMutation(c.config, OpUpdateOne, withAPIToken(at)) + return &APITokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *APITokenClient) UpdateOneID(id string) *APITokenUpdateOne { + mutation := newAPITokenMutation(c.config, OpUpdateOne, withAPITokenID(id)) + return &APITokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for APIToken. +func (c *APITokenClient) Delete() *APITokenDelete { + mutation := newAPITokenMutation(c.config, OpDelete) + return &APITokenDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *APITokenClient) DeleteOne(at *APIToken) *APITokenDeleteOne { + return c.DeleteOneID(at.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *APITokenClient) DeleteOneID(id string) *APITokenDeleteOne { + builder := c.Delete().Where(apitoken.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &APITokenDeleteOne{builder} +} + +// Query returns a query builder for APIToken. +func (c *APITokenClient) Query() *APITokenQuery { + return &APITokenQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeAPIToken}, + inters: c.Interceptors(), + } +} + +// Get returns a APIToken entity by its id. +func (c *APITokenClient) Get(ctx context.Context, id string) (*APIToken, error) { + return c.Query().Where(apitoken.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *APITokenClient) GetX(ctx context.Context, id string) *APIToken { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a APIToken. +func (c *APITokenClient) QueryOwner(at *APIToken) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := at.ID + step := sqlgraph.NewStep( + sqlgraph.From(apitoken.Table, apitoken.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, apitoken.OwnerTable, apitoken.OwnerColumn), + ) + schemaConfig := at.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.APIToken + fromV = sqlgraph.Neighbors(at.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *APITokenClient) Hooks() []Hook { + hooks := c.hooks.APIToken + return append(hooks[:len(hooks):len(hooks)], apitoken.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *APITokenClient) Interceptors() []Interceptor { + inters := c.inters.APIToken + return append(inters[:len(inters):len(inters)], apitoken.Interceptors[:]...) +} + +func (c *APITokenClient) mutate(ctx context.Context, m *APITokenMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&APITokenCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&APITokenUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&APITokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&APITokenDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown APIToken mutation op: %q", m.Op()) + } +} + +// ContactClient is a client for the Contact schema. +type ContactClient struct { + config +} + +// NewContactClient returns a client for the Contact from the given config. +func NewContactClient(c config) *ContactClient { + return &ContactClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `contact.Hooks(f(g(h())))`. +func (c *ContactClient) Use(hooks ...Hook) { + c.hooks.Contact = append(c.hooks.Contact, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `contact.Intercept(f(g(h())))`. +func (c *ContactClient) Intercept(interceptors ...Interceptor) { + c.inters.Contact = append(c.inters.Contact, interceptors...) +} + +// Create returns a builder for creating a Contact entity. +func (c *ContactClient) Create() *ContactCreate { + mutation := newContactMutation(c.config, OpCreate) + return &ContactCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Contact entities. +func (c *ContactClient) CreateBulk(builders ...*ContactCreate) *ContactCreateBulk { + return &ContactCreateBulk{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 *ContactClient) MapCreateBulk(slice any, setFunc func(*ContactCreate, int)) *ContactCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &ContactCreateBulk{err: fmt.Errorf("calling to ContactClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*ContactCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &ContactCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Contact. +func (c *ContactClient) Update() *ContactUpdate { + mutation := newContactMutation(c.config, OpUpdate) + return &ContactUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *ContactClient) UpdateOne(co *Contact) *ContactUpdateOne { + mutation := newContactMutation(c.config, OpUpdateOne, withContact(co)) + return &ContactUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *ContactClient) UpdateOneID(id string) *ContactUpdateOne { + mutation := newContactMutation(c.config, OpUpdateOne, withContactID(id)) + return &ContactUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Contact. +func (c *ContactClient) Delete() *ContactDelete { + mutation := newContactMutation(c.config, OpDelete) + return &ContactDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *ContactClient) DeleteOne(co *Contact) *ContactDeleteOne { + return c.DeleteOneID(co.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *ContactClient) DeleteOneID(id string) *ContactDeleteOne { + builder := c.Delete().Where(contact.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &ContactDeleteOne{builder} +} + +// Query returns a query builder for Contact. +func (c *ContactClient) Query() *ContactQuery { + return &ContactQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeContact}, + inters: c.Interceptors(), + } +} + +// Get returns a Contact entity by its id. +func (c *ContactClient) Get(ctx context.Context, id string) (*Contact, error) { + return c.Query().Where(contact.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *ContactClient) GetX(ctx context.Context, id string) *Contact { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Contact. +func (c *ContactClient) QueryOwner(co *Contact) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := co.ID + step := sqlgraph.NewStep( + sqlgraph.From(contact.Table, contact.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, contact.OwnerTable, contact.OwnerColumn), + ) + schemaConfig := co.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Contact + fromV = sqlgraph.Neighbors(co.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntities queries the entities edge of a Contact. +func (c *ContactClient) QueryEntities(co *Contact) *EntityQuery { + query := (&EntityClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := co.ID + step := sqlgraph.NewStep( + sqlgraph.From(contact.Table, contact.FieldID, id), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, contact.EntitiesTable, contact.EntitiesPrimaryKey...), + ) + schemaConfig := co.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityContacts + fromV = sqlgraph.Neighbors(co.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *ContactClient) Hooks() []Hook { + hooks := c.hooks.Contact + return append(hooks[:len(hooks):len(hooks)], contact.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *ContactClient) Interceptors() []Interceptor { + inters := c.inters.Contact + return append(inters[:len(inters):len(inters)], contact.Interceptors[:]...) +} + +func (c *ContactClient) mutate(ctx context.Context, m *ContactMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&ContactCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&ContactUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&ContactUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&ContactDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Contact mutation op: %q", m.Op()) + } +} + +// ContactHistoryClient is a client for the ContactHistory schema. +type ContactHistoryClient struct { + config +} + +// NewContactHistoryClient returns a client for the ContactHistory from the given config. +func NewContactHistoryClient(c config) *ContactHistoryClient { + return &ContactHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `contacthistory.Hooks(f(g(h())))`. +func (c *ContactHistoryClient) Use(hooks ...Hook) { + c.hooks.ContactHistory = append(c.hooks.ContactHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `contacthistory.Intercept(f(g(h())))`. +func (c *ContactHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.ContactHistory = append(c.inters.ContactHistory, interceptors...) +} + +// Create returns a builder for creating a ContactHistory entity. +func (c *ContactHistoryClient) Create() *ContactHistoryCreate { + mutation := newContactHistoryMutation(c.config, OpCreate) + return &ContactHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of ContactHistory entities. +func (c *ContactHistoryClient) CreateBulk(builders ...*ContactHistoryCreate) *ContactHistoryCreateBulk { + return &ContactHistoryCreateBulk{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 *ContactHistoryClient) MapCreateBulk(slice any, setFunc func(*ContactHistoryCreate, int)) *ContactHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &ContactHistoryCreateBulk{err: fmt.Errorf("calling to ContactHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*ContactHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &ContactHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for ContactHistory. +func (c *ContactHistoryClient) Update() *ContactHistoryUpdate { + mutation := newContactHistoryMutation(c.config, OpUpdate) + return &ContactHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *ContactHistoryClient) UpdateOne(ch *ContactHistory) *ContactHistoryUpdateOne { + mutation := newContactHistoryMutation(c.config, OpUpdateOne, withContactHistory(ch)) + return &ContactHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *ContactHistoryClient) UpdateOneID(id string) *ContactHistoryUpdateOne { + mutation := newContactHistoryMutation(c.config, OpUpdateOne, withContactHistoryID(id)) + return &ContactHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for ContactHistory. +func (c *ContactHistoryClient) Delete() *ContactHistoryDelete { + mutation := newContactHistoryMutation(c.config, OpDelete) + return &ContactHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *ContactHistoryClient) DeleteOne(ch *ContactHistory) *ContactHistoryDeleteOne { + return c.DeleteOneID(ch.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *ContactHistoryClient) DeleteOneID(id string) *ContactHistoryDeleteOne { + builder := c.Delete().Where(contacthistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &ContactHistoryDeleteOne{builder} +} + +// Query returns a query builder for ContactHistory. +func (c *ContactHistoryClient) Query() *ContactHistoryQuery { + return &ContactHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeContactHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a ContactHistory entity by its id. +func (c *ContactHistoryClient) Get(ctx context.Context, id string) (*ContactHistory, error) { + return c.Query().Where(contacthistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *ContactHistoryClient) GetX(ctx context.Context, id string) *ContactHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *ContactHistoryClient) Hooks() []Hook { + hooks := c.hooks.ContactHistory + return append(hooks[:len(hooks):len(hooks)], contacthistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *ContactHistoryClient) Interceptors() []Interceptor { + inters := c.inters.ContactHistory + return append(inters[:len(inters):len(inters)], contacthistory.Interceptors[:]...) +} + +func (c *ContactHistoryClient) mutate(ctx context.Context, m *ContactHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&ContactHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&ContactHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&ContactHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&ContactHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown ContactHistory mutation op: %q", m.Op()) + } +} + +// DocumentDataClient is a client for the DocumentData schema. +type DocumentDataClient struct { + config +} + +// NewDocumentDataClient returns a client for the DocumentData from the given config. +func NewDocumentDataClient(c config) *DocumentDataClient { + return &DocumentDataClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `documentdata.Hooks(f(g(h())))`. +func (c *DocumentDataClient) Use(hooks ...Hook) { + c.hooks.DocumentData = append(c.hooks.DocumentData, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `documentdata.Intercept(f(g(h())))`. +func (c *DocumentDataClient) Intercept(interceptors ...Interceptor) { + c.inters.DocumentData = append(c.inters.DocumentData, interceptors...) +} + +// Create returns a builder for creating a DocumentData entity. +func (c *DocumentDataClient) Create() *DocumentDataCreate { + mutation := newDocumentDataMutation(c.config, OpCreate) + return &DocumentDataCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of DocumentData entities. +func (c *DocumentDataClient) CreateBulk(builders ...*DocumentDataCreate) *DocumentDataCreateBulk { + return &DocumentDataCreateBulk{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 *DocumentDataClient) MapCreateBulk(slice any, setFunc func(*DocumentDataCreate, int)) *DocumentDataCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &DocumentDataCreateBulk{err: fmt.Errorf("calling to DocumentDataClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*DocumentDataCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &DocumentDataCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for DocumentData. +func (c *DocumentDataClient) Update() *DocumentDataUpdate { + mutation := newDocumentDataMutation(c.config, OpUpdate) + return &DocumentDataUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *DocumentDataClient) UpdateOne(dd *DocumentData) *DocumentDataUpdateOne { + mutation := newDocumentDataMutation(c.config, OpUpdateOne, withDocumentData(dd)) + return &DocumentDataUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *DocumentDataClient) UpdateOneID(id string) *DocumentDataUpdateOne { + mutation := newDocumentDataMutation(c.config, OpUpdateOne, withDocumentDataID(id)) + return &DocumentDataUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for DocumentData. +func (c *DocumentDataClient) Delete() *DocumentDataDelete { + mutation := newDocumentDataMutation(c.config, OpDelete) + return &DocumentDataDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *DocumentDataClient) DeleteOne(dd *DocumentData) *DocumentDataDeleteOne { + return c.DeleteOneID(dd.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *DocumentDataClient) DeleteOneID(id string) *DocumentDataDeleteOne { + builder := c.Delete().Where(documentdata.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &DocumentDataDeleteOne{builder} +} + +// Query returns a query builder for DocumentData. +func (c *DocumentDataClient) Query() *DocumentDataQuery { + return &DocumentDataQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeDocumentData}, + inters: c.Interceptors(), + } +} + +// Get returns a DocumentData entity by its id. +func (c *DocumentDataClient) Get(ctx context.Context, id string) (*DocumentData, error) { + return c.Query().Where(documentdata.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *DocumentDataClient) GetX(ctx context.Context, id string) *DocumentData { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a DocumentData. +func (c *DocumentDataClient) QueryOwner(dd *DocumentData) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := dd.ID + step := sqlgraph.NewStep( + sqlgraph.From(documentdata.Table, documentdata.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, documentdata.OwnerTable, documentdata.OwnerColumn), + ) + schemaConfig := dd.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.DocumentData + fromV = sqlgraph.Neighbors(dd.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryTemplate queries the template edge of a DocumentData. +func (c *DocumentDataClient) QueryTemplate(dd *DocumentData) *TemplateQuery { + query := (&TemplateClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := dd.ID + step := sqlgraph.NewStep( + sqlgraph.From(documentdata.Table, documentdata.FieldID, id), + sqlgraph.To(template.Table, template.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, documentdata.TemplateTable, documentdata.TemplateColumn), + ) + schemaConfig := dd.schemaConfig + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.DocumentData + fromV = sqlgraph.Neighbors(dd.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntity queries the entity edge of a DocumentData. +func (c *DocumentDataClient) QueryEntity(dd *DocumentData) *EntityQuery { + query := (&EntityClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := dd.ID + step := sqlgraph.NewStep( + sqlgraph.From(documentdata.Table, documentdata.FieldID, id), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, documentdata.EntityTable, documentdata.EntityPrimaryKey...), + ) + schemaConfig := dd.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityDocuments + fromV = sqlgraph.Neighbors(dd.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *DocumentDataClient) Hooks() []Hook { + hooks := c.hooks.DocumentData + return append(hooks[:len(hooks):len(hooks)], documentdata.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *DocumentDataClient) Interceptors() []Interceptor { + inters := c.inters.DocumentData + return append(inters[:len(inters):len(inters)], documentdata.Interceptors[:]...) +} + +func (c *DocumentDataClient) mutate(ctx context.Context, m *DocumentDataMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&DocumentDataCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&DocumentDataUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&DocumentDataUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&DocumentDataDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown DocumentData mutation op: %q", m.Op()) + } +} + +// DocumentDataHistoryClient is a client for the DocumentDataHistory schema. +type DocumentDataHistoryClient struct { + config +} + +// NewDocumentDataHistoryClient returns a client for the DocumentDataHistory from the given config. +func NewDocumentDataHistoryClient(c config) *DocumentDataHistoryClient { + return &DocumentDataHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `documentdatahistory.Hooks(f(g(h())))`. +func (c *DocumentDataHistoryClient) Use(hooks ...Hook) { + c.hooks.DocumentDataHistory = append(c.hooks.DocumentDataHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `documentdatahistory.Intercept(f(g(h())))`. +func (c *DocumentDataHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.DocumentDataHistory = append(c.inters.DocumentDataHistory, interceptors...) +} + +// Create returns a builder for creating a DocumentDataHistory entity. +func (c *DocumentDataHistoryClient) Create() *DocumentDataHistoryCreate { + mutation := newDocumentDataHistoryMutation(c.config, OpCreate) + return &DocumentDataHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of DocumentDataHistory entities. +func (c *DocumentDataHistoryClient) CreateBulk(builders ...*DocumentDataHistoryCreate) *DocumentDataHistoryCreateBulk { + return &DocumentDataHistoryCreateBulk{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 *DocumentDataHistoryClient) MapCreateBulk(slice any, setFunc func(*DocumentDataHistoryCreate, int)) *DocumentDataHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &DocumentDataHistoryCreateBulk{err: fmt.Errorf("calling to DocumentDataHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*DocumentDataHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &DocumentDataHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for DocumentDataHistory. +func (c *DocumentDataHistoryClient) Update() *DocumentDataHistoryUpdate { + mutation := newDocumentDataHistoryMutation(c.config, OpUpdate) + return &DocumentDataHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *DocumentDataHistoryClient) UpdateOne(ddh *DocumentDataHistory) *DocumentDataHistoryUpdateOne { + mutation := newDocumentDataHistoryMutation(c.config, OpUpdateOne, withDocumentDataHistory(ddh)) + return &DocumentDataHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *DocumentDataHistoryClient) UpdateOneID(id string) *DocumentDataHistoryUpdateOne { + mutation := newDocumentDataHistoryMutation(c.config, OpUpdateOne, withDocumentDataHistoryID(id)) + return &DocumentDataHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for DocumentDataHistory. +func (c *DocumentDataHistoryClient) Delete() *DocumentDataHistoryDelete { + mutation := newDocumentDataHistoryMutation(c.config, OpDelete) + return &DocumentDataHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *DocumentDataHistoryClient) DeleteOne(ddh *DocumentDataHistory) *DocumentDataHistoryDeleteOne { + return c.DeleteOneID(ddh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *DocumentDataHistoryClient) DeleteOneID(id string) *DocumentDataHistoryDeleteOne { + builder := c.Delete().Where(documentdatahistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &DocumentDataHistoryDeleteOne{builder} +} + +// Query returns a query builder for DocumentDataHistory. +func (c *DocumentDataHistoryClient) Query() *DocumentDataHistoryQuery { + return &DocumentDataHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeDocumentDataHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a DocumentDataHistory entity by its id. +func (c *DocumentDataHistoryClient) Get(ctx context.Context, id string) (*DocumentDataHistory, error) { + return c.Query().Where(documentdatahistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *DocumentDataHistoryClient) GetX(ctx context.Context, id string) *DocumentDataHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *DocumentDataHistoryClient) Hooks() []Hook { + hooks := c.hooks.DocumentDataHistory + return append(hooks[:len(hooks):len(hooks)], documentdatahistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *DocumentDataHistoryClient) Interceptors() []Interceptor { + inters := c.inters.DocumentDataHistory + return append(inters[:len(inters):len(inters)], documentdatahistory.Interceptors[:]...) +} + +func (c *DocumentDataHistoryClient) mutate(ctx context.Context, m *DocumentDataHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&DocumentDataHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&DocumentDataHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&DocumentDataHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&DocumentDataHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown DocumentDataHistory mutation op: %q", m.Op()) + } +} + +// EmailVerificationTokenClient is a client for the EmailVerificationToken schema. +type EmailVerificationTokenClient struct { + config +} + +// NewEmailVerificationTokenClient returns a client for the EmailVerificationToken from the given config. +func NewEmailVerificationTokenClient(c config) *EmailVerificationTokenClient { + return &EmailVerificationTokenClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `emailverificationtoken.Hooks(f(g(h())))`. +func (c *EmailVerificationTokenClient) Use(hooks ...Hook) { + c.hooks.EmailVerificationToken = append(c.hooks.EmailVerificationToken, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `emailverificationtoken.Intercept(f(g(h())))`. +func (c *EmailVerificationTokenClient) Intercept(interceptors ...Interceptor) { + c.inters.EmailVerificationToken = append(c.inters.EmailVerificationToken, interceptors...) +} + +// Create returns a builder for creating a EmailVerificationToken entity. +func (c *EmailVerificationTokenClient) Create() *EmailVerificationTokenCreate { + mutation := newEmailVerificationTokenMutation(c.config, OpCreate) + return &EmailVerificationTokenCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EmailVerificationToken entities. +func (c *EmailVerificationTokenClient) CreateBulk(builders ...*EmailVerificationTokenCreate) *EmailVerificationTokenCreateBulk { + return &EmailVerificationTokenCreateBulk{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 *EmailVerificationTokenClient) MapCreateBulk(slice any, setFunc func(*EmailVerificationTokenCreate, int)) *EmailVerificationTokenCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EmailVerificationTokenCreateBulk{err: fmt.Errorf("calling to EmailVerificationTokenClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EmailVerificationTokenCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EmailVerificationTokenCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EmailVerificationToken. +func (c *EmailVerificationTokenClient) Update() *EmailVerificationTokenUpdate { + mutation := newEmailVerificationTokenMutation(c.config, OpUpdate) + return &EmailVerificationTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EmailVerificationTokenClient) UpdateOne(evt *EmailVerificationToken) *EmailVerificationTokenUpdateOne { + mutation := newEmailVerificationTokenMutation(c.config, OpUpdateOne, withEmailVerificationToken(evt)) + return &EmailVerificationTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EmailVerificationTokenClient) UpdateOneID(id string) *EmailVerificationTokenUpdateOne { + mutation := newEmailVerificationTokenMutation(c.config, OpUpdateOne, withEmailVerificationTokenID(id)) + return &EmailVerificationTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EmailVerificationToken. +func (c *EmailVerificationTokenClient) Delete() *EmailVerificationTokenDelete { + mutation := newEmailVerificationTokenMutation(c.config, OpDelete) + return &EmailVerificationTokenDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EmailVerificationTokenClient) DeleteOne(evt *EmailVerificationToken) *EmailVerificationTokenDeleteOne { + return c.DeleteOneID(evt.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EmailVerificationTokenClient) DeleteOneID(id string) *EmailVerificationTokenDeleteOne { + builder := c.Delete().Where(emailverificationtoken.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EmailVerificationTokenDeleteOne{builder} +} + +// Query returns a query builder for EmailVerificationToken. +func (c *EmailVerificationTokenClient) Query() *EmailVerificationTokenQuery { + return &EmailVerificationTokenQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEmailVerificationToken}, + inters: c.Interceptors(), + } +} + +// Get returns a EmailVerificationToken entity by its id. +func (c *EmailVerificationTokenClient) Get(ctx context.Context, id string) (*EmailVerificationToken, error) { + return c.Query().Where(emailverificationtoken.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EmailVerificationTokenClient) GetX(ctx context.Context, id string) *EmailVerificationToken { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a EmailVerificationToken. +func (c *EmailVerificationTokenClient) QueryOwner(evt *EmailVerificationToken) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := evt.ID + step := sqlgraph.NewStep( + sqlgraph.From(emailverificationtoken.Table, emailverificationtoken.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, emailverificationtoken.OwnerTable, emailverificationtoken.OwnerColumn), + ) + schemaConfig := evt.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.EmailVerificationToken + fromV = sqlgraph.Neighbors(evt.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *EmailVerificationTokenClient) Hooks() []Hook { + hooks := c.hooks.EmailVerificationToken + return append(hooks[:len(hooks):len(hooks)], emailverificationtoken.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EmailVerificationTokenClient) Interceptors() []Interceptor { + inters := c.inters.EmailVerificationToken + return append(inters[:len(inters):len(inters)], emailverificationtoken.Interceptors[:]...) +} + +func (c *EmailVerificationTokenClient) mutate(ctx context.Context, m *EmailVerificationTokenMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EmailVerificationTokenCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EmailVerificationTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EmailVerificationTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EmailVerificationTokenDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EmailVerificationToken mutation op: %q", m.Op()) + } +} + +// EntitlementClient is a client for the Entitlement schema. +type EntitlementClient struct { + config +} + +// NewEntitlementClient returns a client for the Entitlement from the given config. +func NewEntitlementClient(c config) *EntitlementClient { + return &EntitlementClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitlement.Hooks(f(g(h())))`. +func (c *EntitlementClient) Use(hooks ...Hook) { + c.hooks.Entitlement = append(c.hooks.Entitlement, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitlement.Intercept(f(g(h())))`. +func (c *EntitlementClient) Intercept(interceptors ...Interceptor) { + c.inters.Entitlement = append(c.inters.Entitlement, interceptors...) +} + +// Create returns a builder for creating a Entitlement entity. +func (c *EntitlementClient) Create() *EntitlementCreate { + mutation := newEntitlementMutation(c.config, OpCreate) + return &EntitlementCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Entitlement entities. +func (c *EntitlementClient) CreateBulk(builders ...*EntitlementCreate) *EntitlementCreateBulk { + return &EntitlementCreateBulk{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 *EntitlementClient) MapCreateBulk(slice any, setFunc func(*EntitlementCreate, int)) *EntitlementCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntitlementCreateBulk{err: fmt.Errorf("calling to EntitlementClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntitlementCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntitlementCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Entitlement. +func (c *EntitlementClient) Update() *EntitlementUpdate { + mutation := newEntitlementMutation(c.config, OpUpdate) + return &EntitlementUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntitlementClient) UpdateOne(e *Entitlement) *EntitlementUpdateOne { + mutation := newEntitlementMutation(c.config, OpUpdateOne, withEntitlement(e)) + return &EntitlementUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntitlementClient) UpdateOneID(id string) *EntitlementUpdateOne { + mutation := newEntitlementMutation(c.config, OpUpdateOne, withEntitlementID(id)) + return &EntitlementUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Entitlement. +func (c *EntitlementClient) Delete() *EntitlementDelete { + mutation := newEntitlementMutation(c.config, OpDelete) + return &EntitlementDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntitlementClient) DeleteOne(e *Entitlement) *EntitlementDeleteOne { + return c.DeleteOneID(e.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntitlementClient) DeleteOneID(id string) *EntitlementDeleteOne { + builder := c.Delete().Where(entitlement.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntitlementDeleteOne{builder} +} + +// Query returns a query builder for Entitlement. +func (c *EntitlementClient) Query() *EntitlementQuery { + return &EntitlementQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntitlement}, + inters: c.Interceptors(), + } +} + +// Get returns a Entitlement entity by its id. +func (c *EntitlementClient) Get(ctx context.Context, id string) (*Entitlement, error) { + return c.Query().Where(entitlement.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntitlementClient) GetX(ctx context.Context, id string) *Entitlement { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Entitlement. +func (c *EntitlementClient) QueryOwner(e *Entitlement) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlement.OwnerTable, entitlement.OwnerColumn), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryPlan queries the plan edge of a Entitlement. +func (c *EntitlementClient) QueryPlan(e *Entitlement) *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, id), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlement.PlanTable, entitlement.PlanColumn), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.Entitlement + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrganization queries the organization edge of a Entitlement. +func (c *EntitlementClient) QueryOrganization(e *Entitlement) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlement.OrganizationTable, entitlement.OrganizationColumn), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Entitlement. +func (c *EntitlementClient) QueryEvents(e *Entitlement) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entitlement.EventsTable, entitlement.EventsPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *EntitlementClient) Hooks() []Hook { + hooks := c.hooks.Entitlement + return append(hooks[:len(hooks):len(hooks)], entitlement.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntitlementClient) Interceptors() []Interceptor { + inters := c.inters.Entitlement + return append(inters[:len(inters):len(inters)], entitlement.Interceptors[:]...) +} + +func (c *EntitlementClient) mutate(ctx context.Context, m *EntitlementMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntitlementCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntitlementUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntitlementUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntitlementDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Entitlement mutation op: %q", m.Op()) + } +} + +// EntitlementHistoryClient is a client for the EntitlementHistory schema. +type EntitlementHistoryClient struct { + config +} + +// NewEntitlementHistoryClient returns a client for the EntitlementHistory from the given config. +func NewEntitlementHistoryClient(c config) *EntitlementHistoryClient { + return &EntitlementHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitlementhistory.Hooks(f(g(h())))`. +func (c *EntitlementHistoryClient) Use(hooks ...Hook) { + c.hooks.EntitlementHistory = append(c.hooks.EntitlementHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitlementhistory.Intercept(f(g(h())))`. +func (c *EntitlementHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.EntitlementHistory = append(c.inters.EntitlementHistory, interceptors...) +} + +// Create returns a builder for creating a EntitlementHistory entity. +func (c *EntitlementHistoryClient) Create() *EntitlementHistoryCreate { + mutation := newEntitlementHistoryMutation(c.config, OpCreate) + return &EntitlementHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntitlementHistory entities. +func (c *EntitlementHistoryClient) CreateBulk(builders ...*EntitlementHistoryCreate) *EntitlementHistoryCreateBulk { + return &EntitlementHistoryCreateBulk{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 *EntitlementHistoryClient) MapCreateBulk(slice any, setFunc func(*EntitlementHistoryCreate, int)) *EntitlementHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntitlementHistoryCreateBulk{err: fmt.Errorf("calling to EntitlementHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntitlementHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntitlementHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntitlementHistory. +func (c *EntitlementHistoryClient) Update() *EntitlementHistoryUpdate { + mutation := newEntitlementHistoryMutation(c.config, OpUpdate) + return &EntitlementHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntitlementHistoryClient) UpdateOne(eh *EntitlementHistory) *EntitlementHistoryUpdateOne { + mutation := newEntitlementHistoryMutation(c.config, OpUpdateOne, withEntitlementHistory(eh)) + return &EntitlementHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntitlementHistoryClient) UpdateOneID(id string) *EntitlementHistoryUpdateOne { + mutation := newEntitlementHistoryMutation(c.config, OpUpdateOne, withEntitlementHistoryID(id)) + return &EntitlementHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntitlementHistory. +func (c *EntitlementHistoryClient) Delete() *EntitlementHistoryDelete { + mutation := newEntitlementHistoryMutation(c.config, OpDelete) + return &EntitlementHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntitlementHistoryClient) DeleteOne(eh *EntitlementHistory) *EntitlementHistoryDeleteOne { + return c.DeleteOneID(eh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntitlementHistoryClient) DeleteOneID(id string) *EntitlementHistoryDeleteOne { + builder := c.Delete().Where(entitlementhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntitlementHistoryDeleteOne{builder} +} + +// Query returns a query builder for EntitlementHistory. +func (c *EntitlementHistoryClient) Query() *EntitlementHistoryQuery { + return &EntitlementHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntitlementHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a EntitlementHistory entity by its id. +func (c *EntitlementHistoryClient) Get(ctx context.Context, id string) (*EntitlementHistory, error) { + return c.Query().Where(entitlementhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntitlementHistoryClient) GetX(ctx context.Context, id string) *EntitlementHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *EntitlementHistoryClient) Hooks() []Hook { + hooks := c.hooks.EntitlementHistory + return append(hooks[:len(hooks):len(hooks)], entitlementhistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntitlementHistoryClient) Interceptors() []Interceptor { + inters := c.inters.EntitlementHistory + return append(inters[:len(inters):len(inters)], entitlementhistory.Interceptors[:]...) +} + +func (c *EntitlementHistoryClient) mutate(ctx context.Context, m *EntitlementHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntitlementHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntitlementHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntitlementHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntitlementHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntitlementHistory mutation op: %q", m.Op()) + } +} + +// EntitlementPlanClient is a client for the EntitlementPlan schema. +type EntitlementPlanClient struct { + config +} + +// NewEntitlementPlanClient returns a client for the EntitlementPlan from the given config. +func NewEntitlementPlanClient(c config) *EntitlementPlanClient { + return &EntitlementPlanClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitlementplan.Hooks(f(g(h())))`. +func (c *EntitlementPlanClient) Use(hooks ...Hook) { + c.hooks.EntitlementPlan = append(c.hooks.EntitlementPlan, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitlementplan.Intercept(f(g(h())))`. +func (c *EntitlementPlanClient) Intercept(interceptors ...Interceptor) { + c.inters.EntitlementPlan = append(c.inters.EntitlementPlan, interceptors...) +} + +// Create returns a builder for creating a EntitlementPlan entity. +func (c *EntitlementPlanClient) Create() *EntitlementPlanCreate { + mutation := newEntitlementPlanMutation(c.config, OpCreate) + return &EntitlementPlanCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntitlementPlan entities. +func (c *EntitlementPlanClient) CreateBulk(builders ...*EntitlementPlanCreate) *EntitlementPlanCreateBulk { + return &EntitlementPlanCreateBulk{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 *EntitlementPlanClient) MapCreateBulk(slice any, setFunc func(*EntitlementPlanCreate, int)) *EntitlementPlanCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntitlementPlanCreateBulk{err: fmt.Errorf("calling to EntitlementPlanClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntitlementPlanCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntitlementPlanCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntitlementPlan. +func (c *EntitlementPlanClient) Update() *EntitlementPlanUpdate { + mutation := newEntitlementPlanMutation(c.config, OpUpdate) + return &EntitlementPlanUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntitlementPlanClient) UpdateOne(ep *EntitlementPlan) *EntitlementPlanUpdateOne { + mutation := newEntitlementPlanMutation(c.config, OpUpdateOne, withEntitlementPlan(ep)) + return &EntitlementPlanUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntitlementPlanClient) UpdateOneID(id string) *EntitlementPlanUpdateOne { + mutation := newEntitlementPlanMutation(c.config, OpUpdateOne, withEntitlementPlanID(id)) + return &EntitlementPlanUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntitlementPlan. +func (c *EntitlementPlanClient) Delete() *EntitlementPlanDelete { + mutation := newEntitlementPlanMutation(c.config, OpDelete) + return &EntitlementPlanDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntitlementPlanClient) DeleteOne(ep *EntitlementPlan) *EntitlementPlanDeleteOne { + return c.DeleteOneID(ep.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntitlementPlanClient) DeleteOneID(id string) *EntitlementPlanDeleteOne { + builder := c.Delete().Where(entitlementplan.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntitlementPlanDeleteOne{builder} +} + +// Query returns a query builder for EntitlementPlan. +func (c *EntitlementPlanClient) Query() *EntitlementPlanQuery { + return &EntitlementPlanQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntitlementPlan}, + inters: c.Interceptors(), + } +} + +// Get returns a EntitlementPlan entity by its id. +func (c *EntitlementPlanClient) Get(ctx context.Context, id string) (*EntitlementPlan, error) { + return c.Query().Where(entitlementplan.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntitlementPlanClient) GetX(ctx context.Context, id string) *EntitlementPlan { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a EntitlementPlan. +func (c *EntitlementPlanClient) QueryOwner(ep *EntitlementPlan) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ep.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlementplan.OwnerTable, entitlementplan.OwnerColumn), + ) + schemaConfig := ep.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlan + fromV = sqlgraph.Neighbors(ep.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitlements queries the entitlements edge of a EntitlementPlan. +func (c *EntitlementPlanClient) QueryEntitlements(ep *EntitlementPlan) *EntitlementQuery { + query := (&EntitlementClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ep.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, id), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, entitlementplan.EntitlementsTable, entitlementplan.EntitlementsColumn), + ) + schemaConfig := ep.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + fromV = sqlgraph.Neighbors(ep.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryBaseFeatures queries the base_features edge of a EntitlementPlan. +func (c *EntitlementPlanClient) QueryBaseFeatures(ep *EntitlementPlan) *FeatureQuery { + query := (&FeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ep.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, id), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, entitlementplan.BaseFeaturesTable, entitlementplan.BaseFeaturesPrimaryKey...), + ) + schemaConfig := ep.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(ep.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a EntitlementPlan. +func (c *EntitlementPlanClient) QueryEvents(ep *EntitlementPlan) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ep.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entitlementplan.EventsTable, entitlementplan.EventsPrimaryKey...), + ) + schemaConfig := ep.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + fromV = sqlgraph.Neighbors(ep.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFeatures queries the features edge of a EntitlementPlan. +func (c *EntitlementPlanClient) QueryFeatures(ep *EntitlementPlan) *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ep.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, id), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, entitlementplan.FeaturesTable, entitlementplan.FeaturesColumn), + ) + schemaConfig := ep.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(ep.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *EntitlementPlanClient) Hooks() []Hook { + hooks := c.hooks.EntitlementPlan + return append(hooks[:len(hooks):len(hooks)], entitlementplan.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntitlementPlanClient) Interceptors() []Interceptor { + inters := c.inters.EntitlementPlan + return append(inters[:len(inters):len(inters)], entitlementplan.Interceptors[:]...) +} + +func (c *EntitlementPlanClient) mutate(ctx context.Context, m *EntitlementPlanMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntitlementPlanCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntitlementPlanUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntitlementPlanUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntitlementPlanDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntitlementPlan mutation op: %q", m.Op()) + } +} + +// EntitlementPlanFeatureClient is a client for the EntitlementPlanFeature schema. +type EntitlementPlanFeatureClient struct { + config +} + +// NewEntitlementPlanFeatureClient returns a client for the EntitlementPlanFeature from the given config. +func NewEntitlementPlanFeatureClient(c config) *EntitlementPlanFeatureClient { + return &EntitlementPlanFeatureClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitlementplanfeature.Hooks(f(g(h())))`. +func (c *EntitlementPlanFeatureClient) Use(hooks ...Hook) { + c.hooks.EntitlementPlanFeature = append(c.hooks.EntitlementPlanFeature, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitlementplanfeature.Intercept(f(g(h())))`. +func (c *EntitlementPlanFeatureClient) Intercept(interceptors ...Interceptor) { + c.inters.EntitlementPlanFeature = append(c.inters.EntitlementPlanFeature, interceptors...) +} + +// Create returns a builder for creating a EntitlementPlanFeature entity. +func (c *EntitlementPlanFeatureClient) Create() *EntitlementPlanFeatureCreate { + mutation := newEntitlementPlanFeatureMutation(c.config, OpCreate) + return &EntitlementPlanFeatureCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntitlementPlanFeature entities. +func (c *EntitlementPlanFeatureClient) CreateBulk(builders ...*EntitlementPlanFeatureCreate) *EntitlementPlanFeatureCreateBulk { + return &EntitlementPlanFeatureCreateBulk{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 *EntitlementPlanFeatureClient) MapCreateBulk(slice any, setFunc func(*EntitlementPlanFeatureCreate, int)) *EntitlementPlanFeatureCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntitlementPlanFeatureCreateBulk{err: fmt.Errorf("calling to EntitlementPlanFeatureClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntitlementPlanFeatureCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntitlementPlanFeatureCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntitlementPlanFeature. +func (c *EntitlementPlanFeatureClient) Update() *EntitlementPlanFeatureUpdate { + mutation := newEntitlementPlanFeatureMutation(c.config, OpUpdate) + return &EntitlementPlanFeatureUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntitlementPlanFeatureClient) UpdateOne(epf *EntitlementPlanFeature) *EntitlementPlanFeatureUpdateOne { + mutation := newEntitlementPlanFeatureMutation(c.config, OpUpdateOne, withEntitlementPlanFeature(epf)) + return &EntitlementPlanFeatureUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntitlementPlanFeatureClient) UpdateOneID(id string) *EntitlementPlanFeatureUpdateOne { + mutation := newEntitlementPlanFeatureMutation(c.config, OpUpdateOne, withEntitlementPlanFeatureID(id)) + return &EntitlementPlanFeatureUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntitlementPlanFeature. +func (c *EntitlementPlanFeatureClient) Delete() *EntitlementPlanFeatureDelete { + mutation := newEntitlementPlanFeatureMutation(c.config, OpDelete) + return &EntitlementPlanFeatureDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntitlementPlanFeatureClient) DeleteOne(epf *EntitlementPlanFeature) *EntitlementPlanFeatureDeleteOne { + return c.DeleteOneID(epf.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntitlementPlanFeatureClient) DeleteOneID(id string) *EntitlementPlanFeatureDeleteOne { + builder := c.Delete().Where(entitlementplanfeature.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntitlementPlanFeatureDeleteOne{builder} +} + +// Query returns a query builder for EntitlementPlanFeature. +func (c *EntitlementPlanFeatureClient) Query() *EntitlementPlanFeatureQuery { + return &EntitlementPlanFeatureQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntitlementPlanFeature}, + inters: c.Interceptors(), + } +} + +// Get returns a EntitlementPlanFeature entity by its id. +func (c *EntitlementPlanFeatureClient) Get(ctx context.Context, id string) (*EntitlementPlanFeature, error) { + return c.Query().Where(entitlementplanfeature.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntitlementPlanFeatureClient) GetX(ctx context.Context, id string) *EntitlementPlanFeature { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a EntitlementPlanFeature. +func (c *EntitlementPlanFeatureClient) QueryOwner(epf *EntitlementPlanFeature) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := epf.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlementplanfeature.OwnerTable, entitlementplanfeature.OwnerColumn), + ) + schemaConfig := epf.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(epf.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryPlan queries the plan edge of a EntitlementPlanFeature. +func (c *EntitlementPlanFeatureClient) QueryPlan(epf *EntitlementPlanFeature) *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := epf.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, id), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, entitlementplanfeature.PlanTable, entitlementplanfeature.PlanColumn), + ) + schemaConfig := epf.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(epf.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFeature queries the feature edge of a EntitlementPlanFeature. +func (c *EntitlementPlanFeatureClient) QueryFeature(epf *EntitlementPlanFeature) *FeatureQuery { + query := (&FeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := epf.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, id), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, entitlementplanfeature.FeatureTable, entitlementplanfeature.FeatureColumn), + ) + schemaConfig := epf.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(epf.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a EntitlementPlanFeature. +func (c *EntitlementPlanFeatureClient) QueryEvents(epf *EntitlementPlanFeature) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := epf.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entitlementplanfeature.EventsTable, entitlementplanfeature.EventsPrimaryKey...), + ) + schemaConfig := epf.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + fromV = sqlgraph.Neighbors(epf.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *EntitlementPlanFeatureClient) Hooks() []Hook { + hooks := c.hooks.EntitlementPlanFeature + return append(hooks[:len(hooks):len(hooks)], entitlementplanfeature.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntitlementPlanFeatureClient) Interceptors() []Interceptor { + inters := c.inters.EntitlementPlanFeature + return append(inters[:len(inters):len(inters)], entitlementplanfeature.Interceptors[:]...) +} + +func (c *EntitlementPlanFeatureClient) mutate(ctx context.Context, m *EntitlementPlanFeatureMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntitlementPlanFeatureCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntitlementPlanFeatureUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntitlementPlanFeatureUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntitlementPlanFeatureDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntitlementPlanFeature mutation op: %q", m.Op()) + } +} + +// EntitlementPlanFeatureHistoryClient is a client for the EntitlementPlanFeatureHistory schema. +type EntitlementPlanFeatureHistoryClient struct { + config +} + +// NewEntitlementPlanFeatureHistoryClient returns a client for the EntitlementPlanFeatureHistory from the given config. +func NewEntitlementPlanFeatureHistoryClient(c config) *EntitlementPlanFeatureHistoryClient { + return &EntitlementPlanFeatureHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitlementplanfeaturehistory.Hooks(f(g(h())))`. +func (c *EntitlementPlanFeatureHistoryClient) Use(hooks ...Hook) { + c.hooks.EntitlementPlanFeatureHistory = append(c.hooks.EntitlementPlanFeatureHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitlementplanfeaturehistory.Intercept(f(g(h())))`. +func (c *EntitlementPlanFeatureHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.EntitlementPlanFeatureHistory = append(c.inters.EntitlementPlanFeatureHistory, interceptors...) +} + +// Create returns a builder for creating a EntitlementPlanFeatureHistory entity. +func (c *EntitlementPlanFeatureHistoryClient) Create() *EntitlementPlanFeatureHistoryCreate { + mutation := newEntitlementPlanFeatureHistoryMutation(c.config, OpCreate) + return &EntitlementPlanFeatureHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntitlementPlanFeatureHistory entities. +func (c *EntitlementPlanFeatureHistoryClient) CreateBulk(builders ...*EntitlementPlanFeatureHistoryCreate) *EntitlementPlanFeatureHistoryCreateBulk { + return &EntitlementPlanFeatureHistoryCreateBulk{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 *EntitlementPlanFeatureHistoryClient) MapCreateBulk(slice any, setFunc func(*EntitlementPlanFeatureHistoryCreate, int)) *EntitlementPlanFeatureHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntitlementPlanFeatureHistoryCreateBulk{err: fmt.Errorf("calling to EntitlementPlanFeatureHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntitlementPlanFeatureHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntitlementPlanFeatureHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntitlementPlanFeatureHistory. +func (c *EntitlementPlanFeatureHistoryClient) Update() *EntitlementPlanFeatureHistoryUpdate { + mutation := newEntitlementPlanFeatureHistoryMutation(c.config, OpUpdate) + return &EntitlementPlanFeatureHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntitlementPlanFeatureHistoryClient) UpdateOne(epfh *EntitlementPlanFeatureHistory) *EntitlementPlanFeatureHistoryUpdateOne { + mutation := newEntitlementPlanFeatureHistoryMutation(c.config, OpUpdateOne, withEntitlementPlanFeatureHistory(epfh)) + return &EntitlementPlanFeatureHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntitlementPlanFeatureHistoryClient) UpdateOneID(id string) *EntitlementPlanFeatureHistoryUpdateOne { + mutation := newEntitlementPlanFeatureHistoryMutation(c.config, OpUpdateOne, withEntitlementPlanFeatureHistoryID(id)) + return &EntitlementPlanFeatureHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntitlementPlanFeatureHistory. +func (c *EntitlementPlanFeatureHistoryClient) Delete() *EntitlementPlanFeatureHistoryDelete { + mutation := newEntitlementPlanFeatureHistoryMutation(c.config, OpDelete) + return &EntitlementPlanFeatureHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntitlementPlanFeatureHistoryClient) DeleteOne(epfh *EntitlementPlanFeatureHistory) *EntitlementPlanFeatureHistoryDeleteOne { + return c.DeleteOneID(epfh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntitlementPlanFeatureHistoryClient) DeleteOneID(id string) *EntitlementPlanFeatureHistoryDeleteOne { + builder := c.Delete().Where(entitlementplanfeaturehistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntitlementPlanFeatureHistoryDeleteOne{builder} +} + +// Query returns a query builder for EntitlementPlanFeatureHistory. +func (c *EntitlementPlanFeatureHistoryClient) Query() *EntitlementPlanFeatureHistoryQuery { + return &EntitlementPlanFeatureHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntitlementPlanFeatureHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a EntitlementPlanFeatureHistory entity by its id. +func (c *EntitlementPlanFeatureHistoryClient) Get(ctx context.Context, id string) (*EntitlementPlanFeatureHistory, error) { + return c.Query().Where(entitlementplanfeaturehistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntitlementPlanFeatureHistoryClient) GetX(ctx context.Context, id string) *EntitlementPlanFeatureHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *EntitlementPlanFeatureHistoryClient) Hooks() []Hook { + hooks := c.hooks.EntitlementPlanFeatureHistory + return append(hooks[:len(hooks):len(hooks)], entitlementplanfeaturehistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntitlementPlanFeatureHistoryClient) Interceptors() []Interceptor { + inters := c.inters.EntitlementPlanFeatureHistory + return append(inters[:len(inters):len(inters)], entitlementplanfeaturehistory.Interceptors[:]...) +} + +func (c *EntitlementPlanFeatureHistoryClient) mutate(ctx context.Context, m *EntitlementPlanFeatureHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntitlementPlanFeatureHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntitlementPlanFeatureHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntitlementPlanFeatureHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntitlementPlanFeatureHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntitlementPlanFeatureHistory mutation op: %q", m.Op()) + } +} + +// EntitlementPlanHistoryClient is a client for the EntitlementPlanHistory schema. +type EntitlementPlanHistoryClient struct { + config +} + +// NewEntitlementPlanHistoryClient returns a client for the EntitlementPlanHistory from the given config. +func NewEntitlementPlanHistoryClient(c config) *EntitlementPlanHistoryClient { + return &EntitlementPlanHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitlementplanhistory.Hooks(f(g(h())))`. +func (c *EntitlementPlanHistoryClient) Use(hooks ...Hook) { + c.hooks.EntitlementPlanHistory = append(c.hooks.EntitlementPlanHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitlementplanhistory.Intercept(f(g(h())))`. +func (c *EntitlementPlanHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.EntitlementPlanHistory = append(c.inters.EntitlementPlanHistory, interceptors...) +} + +// Create returns a builder for creating a EntitlementPlanHistory entity. +func (c *EntitlementPlanHistoryClient) Create() *EntitlementPlanHistoryCreate { + mutation := newEntitlementPlanHistoryMutation(c.config, OpCreate) + return &EntitlementPlanHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntitlementPlanHistory entities. +func (c *EntitlementPlanHistoryClient) CreateBulk(builders ...*EntitlementPlanHistoryCreate) *EntitlementPlanHistoryCreateBulk { + return &EntitlementPlanHistoryCreateBulk{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 *EntitlementPlanHistoryClient) MapCreateBulk(slice any, setFunc func(*EntitlementPlanHistoryCreate, int)) *EntitlementPlanHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntitlementPlanHistoryCreateBulk{err: fmt.Errorf("calling to EntitlementPlanHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntitlementPlanHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntitlementPlanHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntitlementPlanHistory. +func (c *EntitlementPlanHistoryClient) Update() *EntitlementPlanHistoryUpdate { + mutation := newEntitlementPlanHistoryMutation(c.config, OpUpdate) + return &EntitlementPlanHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntitlementPlanHistoryClient) UpdateOne(eph *EntitlementPlanHistory) *EntitlementPlanHistoryUpdateOne { + mutation := newEntitlementPlanHistoryMutation(c.config, OpUpdateOne, withEntitlementPlanHistory(eph)) + return &EntitlementPlanHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntitlementPlanHistoryClient) UpdateOneID(id string) *EntitlementPlanHistoryUpdateOne { + mutation := newEntitlementPlanHistoryMutation(c.config, OpUpdateOne, withEntitlementPlanHistoryID(id)) + return &EntitlementPlanHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntitlementPlanHistory. +func (c *EntitlementPlanHistoryClient) Delete() *EntitlementPlanHistoryDelete { + mutation := newEntitlementPlanHistoryMutation(c.config, OpDelete) + return &EntitlementPlanHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntitlementPlanHistoryClient) DeleteOne(eph *EntitlementPlanHistory) *EntitlementPlanHistoryDeleteOne { + return c.DeleteOneID(eph.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntitlementPlanHistoryClient) DeleteOneID(id string) *EntitlementPlanHistoryDeleteOne { + builder := c.Delete().Where(entitlementplanhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntitlementPlanHistoryDeleteOne{builder} +} + +// Query returns a query builder for EntitlementPlanHistory. +func (c *EntitlementPlanHistoryClient) Query() *EntitlementPlanHistoryQuery { + return &EntitlementPlanHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntitlementPlanHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a EntitlementPlanHistory entity by its id. +func (c *EntitlementPlanHistoryClient) Get(ctx context.Context, id string) (*EntitlementPlanHistory, error) { + return c.Query().Where(entitlementplanhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntitlementPlanHistoryClient) GetX(ctx context.Context, id string) *EntitlementPlanHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *EntitlementPlanHistoryClient) Hooks() []Hook { + hooks := c.hooks.EntitlementPlanHistory + return append(hooks[:len(hooks):len(hooks)], entitlementplanhistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntitlementPlanHistoryClient) Interceptors() []Interceptor { + inters := c.inters.EntitlementPlanHistory + return append(inters[:len(inters):len(inters)], entitlementplanhistory.Interceptors[:]...) +} + +func (c *EntitlementPlanHistoryClient) mutate(ctx context.Context, m *EntitlementPlanHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntitlementPlanHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntitlementPlanHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntitlementPlanHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntitlementPlanHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntitlementPlanHistory mutation op: %q", m.Op()) + } +} + +// EntityClient is a client for the Entity schema. +type EntityClient struct { + config +} + +// NewEntityClient returns a client for the Entity from the given config. +func NewEntityClient(c config) *EntityClient { + return &EntityClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entity.Hooks(f(g(h())))`. +func (c *EntityClient) Use(hooks ...Hook) { + c.hooks.Entity = append(c.hooks.Entity, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entity.Intercept(f(g(h())))`. +func (c *EntityClient) Intercept(interceptors ...Interceptor) { + c.inters.Entity = append(c.inters.Entity, interceptors...) +} + +// Create returns a builder for creating a Entity entity. +func (c *EntityClient) Create() *EntityCreate { + mutation := newEntityMutation(c.config, OpCreate) + return &EntityCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Entity entities. +func (c *EntityClient) CreateBulk(builders ...*EntityCreate) *EntityCreateBulk { + return &EntityCreateBulk{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 *EntityClient) MapCreateBulk(slice any, setFunc func(*EntityCreate, int)) *EntityCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntityCreateBulk{err: fmt.Errorf("calling to EntityClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntityCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntityCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Entity. +func (c *EntityClient) Update() *EntityUpdate { + mutation := newEntityMutation(c.config, OpUpdate) + return &EntityUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntityClient) UpdateOne(e *Entity) *EntityUpdateOne { + mutation := newEntityMutation(c.config, OpUpdateOne, withEntity(e)) + return &EntityUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntityClient) UpdateOneID(id string) *EntityUpdateOne { + mutation := newEntityMutation(c.config, OpUpdateOne, withEntityID(id)) + return &EntityUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Entity. +func (c *EntityClient) Delete() *EntityDelete { + mutation := newEntityMutation(c.config, OpDelete) + return &EntityDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntityClient) DeleteOne(e *Entity) *EntityDeleteOne { + return c.DeleteOneID(e.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntityClient) DeleteOneID(id string) *EntityDeleteOne { + builder := c.Delete().Where(entity.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntityDeleteOne{builder} +} + +// Query returns a query builder for Entity. +func (c *EntityClient) Query() *EntityQuery { + return &EntityQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntity}, + inters: c.Interceptors(), + } +} + +// Get returns a Entity entity by its id. +func (c *EntityClient) Get(ctx context.Context, id string) (*Entity, error) { + return c.Query().Where(entity.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntityClient) GetX(ctx context.Context, id string) *Entity { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Entity. +func (c *EntityClient) QueryOwner(e *Entity) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entity.OwnerTable, entity.OwnerColumn), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entity + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryContacts queries the contacts edge of a Entity. +func (c *EntityClient) QueryContacts(e *Entity) *ContactQuery { + query := (&ContactClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, id), + sqlgraph.To(contact.Table, contact.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entity.ContactsTable, entity.ContactsPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.EntityContacts + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryDocuments queries the documents edge of a Entity. +func (c *EntityClient) QueryDocuments(e *Entity) *DocumentDataQuery { + query := (&DocumentDataClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, id), + sqlgraph.To(documentdata.Table, documentdata.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entity.DocumentsTable, entity.DocumentsPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.EntityDocuments + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryNotes queries the notes edge of a Entity. +func (c *EntityClient) QueryNotes(e *Entity) *NoteQuery { + query := (&NoteClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, id), + sqlgraph.To(note.Table, note.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, entity.NotesTable, entity.NotesColumn), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFiles queries the files edge of a Entity. +func (c *EntityClient) QueryFiles(e *Entity) *FileQuery { + query := (&FileClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, id), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entity.FilesTable, entity.FilesPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.EntityFiles + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntityType queries the entity_type edge of a Entity. +func (c *EntityClient) QueryEntityType(e *Entity) *EntityTypeQuery { + query := (&EntityTypeClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, id), + sqlgraph.To(entitytype.Table, entitytype.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, entity.EntityTypeTable, entity.EntityTypeColumn), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.Entity + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *EntityClient) Hooks() []Hook { + hooks := c.hooks.Entity + return append(hooks[:len(hooks):len(hooks)], entity.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntityClient) Interceptors() []Interceptor { + inters := c.inters.Entity + return append(inters[:len(inters):len(inters)], entity.Interceptors[:]...) +} + +func (c *EntityClient) mutate(ctx context.Context, m *EntityMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntityCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntityUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntityUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntityDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Entity mutation op: %q", m.Op()) + } +} + +// EntityHistoryClient is a client for the EntityHistory schema. +type EntityHistoryClient struct { + config +} + +// NewEntityHistoryClient returns a client for the EntityHistory from the given config. +func NewEntityHistoryClient(c config) *EntityHistoryClient { + return &EntityHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entityhistory.Hooks(f(g(h())))`. +func (c *EntityHistoryClient) Use(hooks ...Hook) { + c.hooks.EntityHistory = append(c.hooks.EntityHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entityhistory.Intercept(f(g(h())))`. +func (c *EntityHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.EntityHistory = append(c.inters.EntityHistory, interceptors...) +} + +// Create returns a builder for creating a EntityHistory entity. +func (c *EntityHistoryClient) Create() *EntityHistoryCreate { + mutation := newEntityHistoryMutation(c.config, OpCreate) + return &EntityHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntityHistory entities. +func (c *EntityHistoryClient) CreateBulk(builders ...*EntityHistoryCreate) *EntityHistoryCreateBulk { + return &EntityHistoryCreateBulk{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 *EntityHistoryClient) MapCreateBulk(slice any, setFunc func(*EntityHistoryCreate, int)) *EntityHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntityHistoryCreateBulk{err: fmt.Errorf("calling to EntityHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntityHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntityHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntityHistory. +func (c *EntityHistoryClient) Update() *EntityHistoryUpdate { + mutation := newEntityHistoryMutation(c.config, OpUpdate) + return &EntityHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntityHistoryClient) UpdateOne(eh *EntityHistory) *EntityHistoryUpdateOne { + mutation := newEntityHistoryMutation(c.config, OpUpdateOne, withEntityHistory(eh)) + return &EntityHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntityHistoryClient) UpdateOneID(id string) *EntityHistoryUpdateOne { + mutation := newEntityHistoryMutation(c.config, OpUpdateOne, withEntityHistoryID(id)) + return &EntityHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntityHistory. +func (c *EntityHistoryClient) Delete() *EntityHistoryDelete { + mutation := newEntityHistoryMutation(c.config, OpDelete) + return &EntityHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntityHistoryClient) DeleteOne(eh *EntityHistory) *EntityHistoryDeleteOne { + return c.DeleteOneID(eh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntityHistoryClient) DeleteOneID(id string) *EntityHistoryDeleteOne { + builder := c.Delete().Where(entityhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntityHistoryDeleteOne{builder} +} + +// Query returns a query builder for EntityHistory. +func (c *EntityHistoryClient) Query() *EntityHistoryQuery { + return &EntityHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntityHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a EntityHistory entity by its id. +func (c *EntityHistoryClient) Get(ctx context.Context, id string) (*EntityHistory, error) { + return c.Query().Where(entityhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntityHistoryClient) GetX(ctx context.Context, id string) *EntityHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *EntityHistoryClient) Hooks() []Hook { + hooks := c.hooks.EntityHistory + return append(hooks[:len(hooks):len(hooks)], entityhistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntityHistoryClient) Interceptors() []Interceptor { + inters := c.inters.EntityHistory + return append(inters[:len(inters):len(inters)], entityhistory.Interceptors[:]...) +} + +func (c *EntityHistoryClient) mutate(ctx context.Context, m *EntityHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntityHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntityHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntityHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntityHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntityHistory mutation op: %q", m.Op()) + } +} + +// EntityTypeClient is a client for the EntityType schema. +type EntityTypeClient struct { + config +} + +// NewEntityTypeClient returns a client for the EntityType from the given config. +func NewEntityTypeClient(c config) *EntityTypeClient { + return &EntityTypeClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitytype.Hooks(f(g(h())))`. +func (c *EntityTypeClient) Use(hooks ...Hook) { + c.hooks.EntityType = append(c.hooks.EntityType, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitytype.Intercept(f(g(h())))`. +func (c *EntityTypeClient) Intercept(interceptors ...Interceptor) { + c.inters.EntityType = append(c.inters.EntityType, interceptors...) +} + +// Create returns a builder for creating a EntityType entity. +func (c *EntityTypeClient) Create() *EntityTypeCreate { + mutation := newEntityTypeMutation(c.config, OpCreate) + return &EntityTypeCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntityType entities. +func (c *EntityTypeClient) CreateBulk(builders ...*EntityTypeCreate) *EntityTypeCreateBulk { + return &EntityTypeCreateBulk{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 *EntityTypeClient) MapCreateBulk(slice any, setFunc func(*EntityTypeCreate, int)) *EntityTypeCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntityTypeCreateBulk{err: fmt.Errorf("calling to EntityTypeClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntityTypeCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntityTypeCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntityType. +func (c *EntityTypeClient) Update() *EntityTypeUpdate { + mutation := newEntityTypeMutation(c.config, OpUpdate) + return &EntityTypeUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntityTypeClient) UpdateOne(et *EntityType) *EntityTypeUpdateOne { + mutation := newEntityTypeMutation(c.config, OpUpdateOne, withEntityType(et)) + return &EntityTypeUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntityTypeClient) UpdateOneID(id string) *EntityTypeUpdateOne { + mutation := newEntityTypeMutation(c.config, OpUpdateOne, withEntityTypeID(id)) + return &EntityTypeUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntityType. +func (c *EntityTypeClient) Delete() *EntityTypeDelete { + mutation := newEntityTypeMutation(c.config, OpDelete) + return &EntityTypeDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntityTypeClient) DeleteOne(et *EntityType) *EntityTypeDeleteOne { + return c.DeleteOneID(et.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntityTypeClient) DeleteOneID(id string) *EntityTypeDeleteOne { + builder := c.Delete().Where(entitytype.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntityTypeDeleteOne{builder} +} + +// Query returns a query builder for EntityType. +func (c *EntityTypeClient) Query() *EntityTypeQuery { + return &EntityTypeQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntityType}, + inters: c.Interceptors(), + } +} + +// Get returns a EntityType entity by its id. +func (c *EntityTypeClient) Get(ctx context.Context, id string) (*EntityType, error) { + return c.Query().Where(entitytype.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntityTypeClient) GetX(ctx context.Context, id string) *EntityType { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a EntityType. +func (c *EntityTypeClient) QueryOwner(et *EntityType) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := et.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitytype.Table, entitytype.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitytype.OwnerTable, entitytype.OwnerColumn), + ) + schemaConfig := et.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntityType + fromV = sqlgraph.Neighbors(et.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntities queries the entities edge of a EntityType. +func (c *EntityTypeClient) QueryEntities(et *EntityType) *EntityQuery { + query := (&EntityClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := et.ID + step := sqlgraph.NewStep( + sqlgraph.From(entitytype.Table, entitytype.FieldID, id), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, entitytype.EntitiesTable, entitytype.EntitiesColumn), + ) + schemaConfig := et.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + fromV = sqlgraph.Neighbors(et.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *EntityTypeClient) Hooks() []Hook { + hooks := c.hooks.EntityType + return append(hooks[:len(hooks):len(hooks)], entitytype.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntityTypeClient) Interceptors() []Interceptor { + inters := c.inters.EntityType + return append(inters[:len(inters):len(inters)], entitytype.Interceptors[:]...) +} + +func (c *EntityTypeClient) mutate(ctx context.Context, m *EntityTypeMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntityTypeCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntityTypeUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntityTypeUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntityTypeDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntityType mutation op: %q", m.Op()) + } +} + +// EntityTypeHistoryClient is a client for the EntityTypeHistory schema. +type EntityTypeHistoryClient struct { + config +} + +// NewEntityTypeHistoryClient returns a client for the EntityTypeHistory from the given config. +func NewEntityTypeHistoryClient(c config) *EntityTypeHistoryClient { + return &EntityTypeHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `entitytypehistory.Hooks(f(g(h())))`. +func (c *EntityTypeHistoryClient) Use(hooks ...Hook) { + c.hooks.EntityTypeHistory = append(c.hooks.EntityTypeHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `entitytypehistory.Intercept(f(g(h())))`. +func (c *EntityTypeHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.EntityTypeHistory = append(c.inters.EntityTypeHistory, interceptors...) +} + +// Create returns a builder for creating a EntityTypeHistory entity. +func (c *EntityTypeHistoryClient) Create() *EntityTypeHistoryCreate { + mutation := newEntityTypeHistoryMutation(c.config, OpCreate) + return &EntityTypeHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EntityTypeHistory entities. +func (c *EntityTypeHistoryClient) CreateBulk(builders ...*EntityTypeHistoryCreate) *EntityTypeHistoryCreateBulk { + return &EntityTypeHistoryCreateBulk{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 *EntityTypeHistoryClient) MapCreateBulk(slice any, setFunc func(*EntityTypeHistoryCreate, int)) *EntityTypeHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EntityTypeHistoryCreateBulk{err: fmt.Errorf("calling to EntityTypeHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EntityTypeHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EntityTypeHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EntityTypeHistory. +func (c *EntityTypeHistoryClient) Update() *EntityTypeHistoryUpdate { + mutation := newEntityTypeHistoryMutation(c.config, OpUpdate) + return &EntityTypeHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EntityTypeHistoryClient) UpdateOne(eth *EntityTypeHistory) *EntityTypeHistoryUpdateOne { + mutation := newEntityTypeHistoryMutation(c.config, OpUpdateOne, withEntityTypeHistory(eth)) + return &EntityTypeHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EntityTypeHistoryClient) UpdateOneID(id string) *EntityTypeHistoryUpdateOne { + mutation := newEntityTypeHistoryMutation(c.config, OpUpdateOne, withEntityTypeHistoryID(id)) + return &EntityTypeHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EntityTypeHistory. +func (c *EntityTypeHistoryClient) Delete() *EntityTypeHistoryDelete { + mutation := newEntityTypeHistoryMutation(c.config, OpDelete) + return &EntityTypeHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EntityTypeHistoryClient) DeleteOne(eth *EntityTypeHistory) *EntityTypeHistoryDeleteOne { + return c.DeleteOneID(eth.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EntityTypeHistoryClient) DeleteOneID(id string) *EntityTypeHistoryDeleteOne { + builder := c.Delete().Where(entitytypehistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EntityTypeHistoryDeleteOne{builder} +} + +// Query returns a query builder for EntityTypeHistory. +func (c *EntityTypeHistoryClient) Query() *EntityTypeHistoryQuery { + return &EntityTypeHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEntityTypeHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a EntityTypeHistory entity by its id. +func (c *EntityTypeHistoryClient) Get(ctx context.Context, id string) (*EntityTypeHistory, error) { + return c.Query().Where(entitytypehistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EntityTypeHistoryClient) GetX(ctx context.Context, id string) *EntityTypeHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *EntityTypeHistoryClient) Hooks() []Hook { + hooks := c.hooks.EntityTypeHistory + return append(hooks[:len(hooks):len(hooks)], entitytypehistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EntityTypeHistoryClient) Interceptors() []Interceptor { + inters := c.inters.EntityTypeHistory + return append(inters[:len(inters):len(inters)], entitytypehistory.Interceptors[:]...) +} + +func (c *EntityTypeHistoryClient) mutate(ctx context.Context, m *EntityTypeHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EntityTypeHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EntityTypeHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EntityTypeHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EntityTypeHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EntityTypeHistory mutation op: %q", m.Op()) + } +} + +// EventClient is a client for the Event schema. +type EventClient struct { + config +} + +// NewEventClient returns a client for the Event from the given config. +func NewEventClient(c config) *EventClient { + return &EventClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `event.Hooks(f(g(h())))`. +func (c *EventClient) Use(hooks ...Hook) { + c.hooks.Event = append(c.hooks.Event, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `event.Intercept(f(g(h())))`. +func (c *EventClient) Intercept(interceptors ...Interceptor) { + c.inters.Event = append(c.inters.Event, interceptors...) +} + +// Create returns a builder for creating a Event entity. +func (c *EventClient) Create() *EventCreate { + mutation := newEventMutation(c.config, OpCreate) + return &EventCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Event entities. +func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk { + return &EventCreateBulk{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 *EventClient) MapCreateBulk(slice any, setFunc func(*EventCreate, int)) *EventCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EventCreateBulk{err: fmt.Errorf("calling to EventClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EventCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EventCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Event. +func (c *EventClient) Update() *EventUpdate { + mutation := newEventMutation(c.config, OpUpdate) + return &EventUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne { + mutation := newEventMutation(c.config, OpUpdateOne, withEvent(e)) + return &EventUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EventClient) UpdateOneID(id string) *EventUpdateOne { + mutation := newEventMutation(c.config, OpUpdateOne, withEventID(id)) + return &EventUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Event. +func (c *EventClient) Delete() *EventDelete { + mutation := newEventMutation(c.config, OpDelete) + return &EventDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne { + return c.DeleteOneID(e.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EventClient) DeleteOneID(id string) *EventDeleteOne { + builder := c.Delete().Where(event.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EventDeleteOne{builder} +} + +// Query returns a query builder for Event. +func (c *EventClient) Query() *EventQuery { + return &EventQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEvent}, + inters: c.Interceptors(), + } +} + +// Get returns a Event entity by its id. +func (c *EventClient) Get(ctx context.Context, id string) (*Event, error) { + return c.Query().Where(event.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EventClient) GetX(ctx context.Context, id string) *Event { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryUser queries the user edge of a Event. +func (c *EventClient) QueryUser(e *Event) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.UserTable, event.UserPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryGroup queries the group edge of a Event. +func (c *EventClient) QueryGroup(e *Event) *GroupQuery { + query := (&GroupClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.GroupTable, event.GroupPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryIntegration queries the integration edge of a Event. +func (c *EventClient) QueryIntegration(e *Event) *IntegrationQuery { + query := (&IntegrationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.IntegrationTable, event.IntegrationPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrganization queries the organization edge of a Event. +func (c *EventClient) QueryOrganization(e *Event) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.OrganizationTable, event.OrganizationPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryInvite queries the invite edge of a Event. +func (c *EventClient) QueryInvite(e *Event) *InviteQuery { + query := (&InviteClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(invite.Table, invite.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.InviteTable, event.InvitePrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.InviteEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFeature queries the feature edge of a Event. +func (c *EventClient) QueryFeature(e *Event) *FeatureQuery { + query := (&FeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.FeatureTable, event.FeaturePrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.FeatureEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitlementplan queries the entitlementplan edge of a Event. +func (c *EventClient) QueryEntitlementplan(e *Event) *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.EntitlementplanTable, event.EntitlementplanPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitlementplanfeature queries the entitlementplanfeature edge of a Event. +func (c *EventClient) QueryEntitlementplanfeature(e *Event) *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.EntitlementplanfeatureTable, event.EntitlementplanfeaturePrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryPersonalAccessToken queries the personal_access_token edge of a Event. +func (c *EventClient) QueryPersonalAccessToken(e *Event) *PersonalAccessTokenQuery { + query := (&PersonalAccessTokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(personalaccesstoken.Table, personalaccesstoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.PersonalAccessTokenTable, event.PersonalAccessTokenPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOauth2token queries the oauth2token edge of a Event. +func (c *EventClient) QueryOauth2token(e *Event) *OhAuthTooTokenQuery { + query := (&OhAuthTooTokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(ohauthtootoken.Table, ohauthtootoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.Oauth2tokenTable, event.Oauth2tokenPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryHush queries the hush edge of a Event. +func (c *EventClient) QueryHush(e *Event) *HushQuery { + query := (&HushClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(hush.Table, hush.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.HushTable, event.HushPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.HushEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrgmembership queries the orgmembership edge of a Event. +func (c *EventClient) QueryOrgmembership(e *Event) *OrgMembershipQuery { + query := (&OrgMembershipClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(orgmembership.Table, orgmembership.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.OrgmembershipTable, event.OrgmembershipPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembershipEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryGroupmembership queries the groupmembership edge of a Event. +func (c *EventClient) QueryGroupmembership(e *Event) *GroupMembershipQuery { + query := (&GroupMembershipClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(groupmembership.Table, groupmembership.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.GroupmembershipTable, event.GroupmembershipPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembershipEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitlement queries the entitlement edge of a Event. +func (c *EventClient) QueryEntitlement(e *Event) *EntitlementQuery { + query := (&EntitlementClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.EntitlementTable, event.EntitlementPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.EntitlementEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryWebhook queries the webhook edge of a Event. +func (c *EventClient) QueryWebhook(e *Event) *WebhookQuery { + query := (&WebhookClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(webhook.Table, webhook.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.WebhookTable, event.WebhookPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.WebhookEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QuerySubscriber queries the subscriber edge of a Event. +func (c *EventClient) QuerySubscriber(e *Event) *SubscriberQuery { + query := (&SubscriberClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := e.ID + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, id), + sqlgraph.To(subscriber.Table, subscriber.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.SubscriberTable, event.SubscriberPrimaryKey...), + ) + schemaConfig := e.schemaConfig + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.SubscriberEvents + fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *EventClient) Hooks() []Hook { + hooks := c.hooks.Event + return append(hooks[:len(hooks):len(hooks)], event.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *EventClient) Interceptors() []Interceptor { + return c.inters.Event +} + +func (c *EventClient) mutate(ctx context.Context, m *EventMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EventCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EventUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EventUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EventDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Event mutation op: %q", m.Op()) + } +} + +// EventHistoryClient is a client for the EventHistory schema. +type EventHistoryClient struct { + config +} + +// NewEventHistoryClient returns a client for the EventHistory from the given config. +func NewEventHistoryClient(c config) *EventHistoryClient { + return &EventHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `eventhistory.Hooks(f(g(h())))`. +func (c *EventHistoryClient) Use(hooks ...Hook) { + c.hooks.EventHistory = append(c.hooks.EventHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `eventhistory.Intercept(f(g(h())))`. +func (c *EventHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.EventHistory = append(c.inters.EventHistory, interceptors...) +} + +// Create returns a builder for creating a EventHistory entity. +func (c *EventHistoryClient) Create() *EventHistoryCreate { + mutation := newEventHistoryMutation(c.config, OpCreate) + return &EventHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of EventHistory entities. +func (c *EventHistoryClient) CreateBulk(builders ...*EventHistoryCreate) *EventHistoryCreateBulk { + return &EventHistoryCreateBulk{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 *EventHistoryClient) MapCreateBulk(slice any, setFunc func(*EventHistoryCreate, int)) *EventHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &EventHistoryCreateBulk{err: fmt.Errorf("calling to EventHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*EventHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &EventHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for EventHistory. +func (c *EventHistoryClient) Update() *EventHistoryUpdate { + mutation := newEventHistoryMutation(c.config, OpUpdate) + return &EventHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *EventHistoryClient) UpdateOne(eh *EventHistory) *EventHistoryUpdateOne { + mutation := newEventHistoryMutation(c.config, OpUpdateOne, withEventHistory(eh)) + return &EventHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *EventHistoryClient) UpdateOneID(id string) *EventHistoryUpdateOne { + mutation := newEventHistoryMutation(c.config, OpUpdateOne, withEventHistoryID(id)) + return &EventHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for EventHistory. +func (c *EventHistoryClient) Delete() *EventHistoryDelete { + mutation := newEventHistoryMutation(c.config, OpDelete) + return &EventHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *EventHistoryClient) DeleteOne(eh *EventHistory) *EventHistoryDeleteOne { + return c.DeleteOneID(eh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *EventHistoryClient) DeleteOneID(id string) *EventHistoryDeleteOne { + builder := c.Delete().Where(eventhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &EventHistoryDeleteOne{builder} +} + +// Query returns a query builder for EventHistory. +func (c *EventHistoryClient) Query() *EventHistoryQuery { + return &EventHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeEventHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a EventHistory entity by its id. +func (c *EventHistoryClient) Get(ctx context.Context, id string) (*EventHistory, error) { + return c.Query().Where(eventhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *EventHistoryClient) GetX(ctx context.Context, id string) *EventHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *EventHistoryClient) Hooks() []Hook { + return c.hooks.EventHistory +} + +// Interceptors returns the client interceptors. +func (c *EventHistoryClient) Interceptors() []Interceptor { + return c.inters.EventHistory +} + +func (c *EventHistoryClient) mutate(ctx context.Context, m *EventHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&EventHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&EventHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&EventHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&EventHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown EventHistory mutation op: %q", m.Op()) + } +} + +// FeatureClient is a client for the Feature schema. +type FeatureClient struct { + config +} + +// NewFeatureClient returns a client for the Feature from the given config. +func NewFeatureClient(c config) *FeatureClient { + return &FeatureClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `feature.Hooks(f(g(h())))`. +func (c *FeatureClient) Use(hooks ...Hook) { + c.hooks.Feature = append(c.hooks.Feature, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `feature.Intercept(f(g(h())))`. +func (c *FeatureClient) Intercept(interceptors ...Interceptor) { + c.inters.Feature = append(c.inters.Feature, interceptors...) +} + +// Create returns a builder for creating a Feature entity. +func (c *FeatureClient) Create() *FeatureCreate { + mutation := newFeatureMutation(c.config, OpCreate) + return &FeatureCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Feature entities. +func (c *FeatureClient) CreateBulk(builders ...*FeatureCreate) *FeatureCreateBulk { + return &FeatureCreateBulk{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 *FeatureClient) MapCreateBulk(slice any, setFunc func(*FeatureCreate, int)) *FeatureCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &FeatureCreateBulk{err: fmt.Errorf("calling to FeatureClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*FeatureCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &FeatureCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Feature. +func (c *FeatureClient) Update() *FeatureUpdate { + mutation := newFeatureMutation(c.config, OpUpdate) + return &FeatureUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *FeatureClient) UpdateOne(f *Feature) *FeatureUpdateOne { + mutation := newFeatureMutation(c.config, OpUpdateOne, withFeature(f)) + return &FeatureUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *FeatureClient) UpdateOneID(id string) *FeatureUpdateOne { + mutation := newFeatureMutation(c.config, OpUpdateOne, withFeatureID(id)) + return &FeatureUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Feature. +func (c *FeatureClient) Delete() *FeatureDelete { + mutation := newFeatureMutation(c.config, OpDelete) + return &FeatureDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *FeatureClient) DeleteOne(f *Feature) *FeatureDeleteOne { + return c.DeleteOneID(f.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *FeatureClient) DeleteOneID(id string) *FeatureDeleteOne { + builder := c.Delete().Where(feature.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &FeatureDeleteOne{builder} +} + +// Query returns a query builder for Feature. +func (c *FeatureClient) Query() *FeatureQuery { + return &FeatureQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeFeature}, + inters: c.Interceptors(), + } +} + +// Get returns a Feature entity by its id. +func (c *FeatureClient) Get(ctx context.Context, id string) (*Feature, error) { + return c.Query().Where(feature.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *FeatureClient) GetX(ctx context.Context, id string) *Feature { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Feature. +func (c *FeatureClient) QueryOwner(f *Feature) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, feature.OwnerTable, feature.OwnerColumn), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Feature + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryPlans queries the plans edge of a Feature. +func (c *FeatureClient) QueryPlans(f *Feature) *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, id), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, feature.PlansTable, feature.PlansPrimaryKey...), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Feature. +func (c *FeatureClient) QueryEvents(f *Feature) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, feature.EventsTable, feature.EventsPrimaryKey...), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.FeatureEvents + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFeatures queries the features edge of a Feature. +func (c *FeatureClient) QueryFeatures(f *Feature) *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, id), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, feature.FeaturesTable, feature.FeaturesColumn), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *FeatureClient) Hooks() []Hook { + hooks := c.hooks.Feature + return append(hooks[:len(hooks):len(hooks)], feature.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *FeatureClient) Interceptors() []Interceptor { + inters := c.inters.Feature + return append(inters[:len(inters):len(inters)], feature.Interceptors[:]...) +} + +func (c *FeatureClient) mutate(ctx context.Context, m *FeatureMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&FeatureCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&FeatureUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&FeatureUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&FeatureDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Feature mutation op: %q", m.Op()) + } +} + +// FeatureHistoryClient is a client for the FeatureHistory schema. +type FeatureHistoryClient struct { + config +} + +// NewFeatureHistoryClient returns a client for the FeatureHistory from the given config. +func NewFeatureHistoryClient(c config) *FeatureHistoryClient { + return &FeatureHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `featurehistory.Hooks(f(g(h())))`. +func (c *FeatureHistoryClient) Use(hooks ...Hook) { + c.hooks.FeatureHistory = append(c.hooks.FeatureHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `featurehistory.Intercept(f(g(h())))`. +func (c *FeatureHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.FeatureHistory = append(c.inters.FeatureHistory, interceptors...) +} + +// Create returns a builder for creating a FeatureHistory entity. +func (c *FeatureHistoryClient) Create() *FeatureHistoryCreate { + mutation := newFeatureHistoryMutation(c.config, OpCreate) + return &FeatureHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of FeatureHistory entities. +func (c *FeatureHistoryClient) CreateBulk(builders ...*FeatureHistoryCreate) *FeatureHistoryCreateBulk { + return &FeatureHistoryCreateBulk{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 *FeatureHistoryClient) MapCreateBulk(slice any, setFunc func(*FeatureHistoryCreate, int)) *FeatureHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &FeatureHistoryCreateBulk{err: fmt.Errorf("calling to FeatureHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*FeatureHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &FeatureHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for FeatureHistory. +func (c *FeatureHistoryClient) Update() *FeatureHistoryUpdate { + mutation := newFeatureHistoryMutation(c.config, OpUpdate) + return &FeatureHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *FeatureHistoryClient) UpdateOne(fh *FeatureHistory) *FeatureHistoryUpdateOne { + mutation := newFeatureHistoryMutation(c.config, OpUpdateOne, withFeatureHistory(fh)) + return &FeatureHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *FeatureHistoryClient) UpdateOneID(id string) *FeatureHistoryUpdateOne { + mutation := newFeatureHistoryMutation(c.config, OpUpdateOne, withFeatureHistoryID(id)) + return &FeatureHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for FeatureHistory. +func (c *FeatureHistoryClient) Delete() *FeatureHistoryDelete { + mutation := newFeatureHistoryMutation(c.config, OpDelete) + return &FeatureHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *FeatureHistoryClient) DeleteOne(fh *FeatureHistory) *FeatureHistoryDeleteOne { + return c.DeleteOneID(fh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *FeatureHistoryClient) DeleteOneID(id string) *FeatureHistoryDeleteOne { + builder := c.Delete().Where(featurehistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &FeatureHistoryDeleteOne{builder} +} + +// Query returns a query builder for FeatureHistory. +func (c *FeatureHistoryClient) Query() *FeatureHistoryQuery { + return &FeatureHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeFeatureHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a FeatureHistory entity by its id. +func (c *FeatureHistoryClient) Get(ctx context.Context, id string) (*FeatureHistory, error) { + return c.Query().Where(featurehistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *FeatureHistoryClient) GetX(ctx context.Context, id string) *FeatureHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *FeatureHistoryClient) Hooks() []Hook { + hooks := c.hooks.FeatureHistory + return append(hooks[:len(hooks):len(hooks)], featurehistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *FeatureHistoryClient) Interceptors() []Interceptor { + inters := c.inters.FeatureHistory + return append(inters[:len(inters):len(inters)], featurehistory.Interceptors[:]...) +} + +func (c *FeatureHistoryClient) mutate(ctx context.Context, m *FeatureHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&FeatureHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&FeatureHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&FeatureHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&FeatureHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown FeatureHistory mutation op: %q", m.Op()) + } +} + +// FileClient is a client for the File schema. +type FileClient struct { + config +} + +// NewFileClient returns a client for the File from the given config. +func NewFileClient(c config) *FileClient { + return &FileClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `file.Hooks(f(g(h())))`. +func (c *FileClient) Use(hooks ...Hook) { + c.hooks.File = append(c.hooks.File, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `file.Intercept(f(g(h())))`. +func (c *FileClient) Intercept(interceptors ...Interceptor) { + c.inters.File = append(c.inters.File, interceptors...) +} + +// Create returns a builder for creating a File entity. +func (c *FileClient) Create() *FileCreate { + mutation := newFileMutation(c.config, OpCreate) + return &FileCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of File entities. +func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk { + return &FileCreateBulk{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 *FileClient) MapCreateBulk(slice any, setFunc func(*FileCreate, int)) *FileCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &FileCreateBulk{err: fmt.Errorf("calling to FileClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*FileCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &FileCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for File. +func (c *FileClient) Update() *FileUpdate { + mutation := newFileMutation(c.config, OpUpdate) + return &FileUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *FileClient) UpdateOne(f *File) *FileUpdateOne { + mutation := newFileMutation(c.config, OpUpdateOne, withFile(f)) + return &FileUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *FileClient) UpdateOneID(id string) *FileUpdateOne { + mutation := newFileMutation(c.config, OpUpdateOne, withFileID(id)) + return &FileUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for File. +func (c *FileClient) Delete() *FileDelete { + mutation := newFileMutation(c.config, OpDelete) + return &FileDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *FileClient) DeleteOne(f *File) *FileDeleteOne { + return c.DeleteOneID(f.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *FileClient) DeleteOneID(id string) *FileDeleteOne { + builder := c.Delete().Where(file.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &FileDeleteOne{builder} +} + +// Query returns a query builder for File. +func (c *FileClient) Query() *FileQuery { + return &FileQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeFile}, + inters: c.Interceptors(), + } +} + +// Get returns a File entity by its id. +func (c *FileClient) Get(ctx context.Context, id string) (*File, error) { + return c.Query().Where(file.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *FileClient) GetX(ctx context.Context, id string) *File { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryUser queries the user edge of a File. +func (c *FileClient) QueryUser(f *File) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, file.UserTable, file.UserColumn), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.File + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrganization queries the organization edge of a File. +func (c *FileClient) QueryOrganization(f *File) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, file.OrganizationTable, file.OrganizationPrimaryKey...), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationFiles + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntity queries the entity edge of a File. +func (c *FileClient) QueryEntity(f *File) *EntityQuery { + query := (&EntityClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, id), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, file.EntityTable, file.EntityPrimaryKey...), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityFiles + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryGroup queries the group edge of a File. +func (c *FileClient) QueryGroup(f *File) *GroupQuery { + query := (&GroupClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := f.ID + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, id), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, file.GroupTable, file.GroupPrimaryKey...), + ) + schemaConfig := f.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupFiles + fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *FileClient) Hooks() []Hook { + hooks := c.hooks.File + return append(hooks[:len(hooks):len(hooks)], file.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *FileClient) Interceptors() []Interceptor { + inters := c.inters.File + return append(inters[:len(inters):len(inters)], file.Interceptors[:]...) +} + +func (c *FileClient) mutate(ctx context.Context, m *FileMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&FileCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&FileUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&FileUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&FileDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown File mutation op: %q", m.Op()) + } +} + +// FileHistoryClient is a client for the FileHistory schema. +type FileHistoryClient struct { + config +} + +// NewFileHistoryClient returns a client for the FileHistory from the given config. +func NewFileHistoryClient(c config) *FileHistoryClient { + return &FileHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `filehistory.Hooks(f(g(h())))`. +func (c *FileHistoryClient) Use(hooks ...Hook) { + c.hooks.FileHistory = append(c.hooks.FileHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `filehistory.Intercept(f(g(h())))`. +func (c *FileHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.FileHistory = append(c.inters.FileHistory, interceptors...) +} + +// Create returns a builder for creating a FileHistory entity. +func (c *FileHistoryClient) Create() *FileHistoryCreate { + mutation := newFileHistoryMutation(c.config, OpCreate) + return &FileHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of FileHistory entities. +func (c *FileHistoryClient) CreateBulk(builders ...*FileHistoryCreate) *FileHistoryCreateBulk { + return &FileHistoryCreateBulk{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 *FileHistoryClient) MapCreateBulk(slice any, setFunc func(*FileHistoryCreate, int)) *FileHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &FileHistoryCreateBulk{err: fmt.Errorf("calling to FileHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*FileHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &FileHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for FileHistory. +func (c *FileHistoryClient) Update() *FileHistoryUpdate { + mutation := newFileHistoryMutation(c.config, OpUpdate) + return &FileHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *FileHistoryClient) UpdateOne(fh *FileHistory) *FileHistoryUpdateOne { + mutation := newFileHistoryMutation(c.config, OpUpdateOne, withFileHistory(fh)) + return &FileHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *FileHistoryClient) UpdateOneID(id string) *FileHistoryUpdateOne { + mutation := newFileHistoryMutation(c.config, OpUpdateOne, withFileHistoryID(id)) + return &FileHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for FileHistory. +func (c *FileHistoryClient) Delete() *FileHistoryDelete { + mutation := newFileHistoryMutation(c.config, OpDelete) + return &FileHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *FileHistoryClient) DeleteOne(fh *FileHistory) *FileHistoryDeleteOne { + return c.DeleteOneID(fh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *FileHistoryClient) DeleteOneID(id string) *FileHistoryDeleteOne { + builder := c.Delete().Where(filehistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &FileHistoryDeleteOne{builder} +} + +// Query returns a query builder for FileHistory. +func (c *FileHistoryClient) Query() *FileHistoryQuery { + return &FileHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeFileHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a FileHistory entity by its id. +func (c *FileHistoryClient) Get(ctx context.Context, id string) (*FileHistory, error) { + return c.Query().Where(filehistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *FileHistoryClient) GetX(ctx context.Context, id string) *FileHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *FileHistoryClient) Hooks() []Hook { + return c.hooks.FileHistory +} + +// Interceptors returns the client interceptors. +func (c *FileHistoryClient) Interceptors() []Interceptor { + return c.inters.FileHistory +} + +func (c *FileHistoryClient) mutate(ctx context.Context, m *FileHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&FileHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&FileHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&FileHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&FileHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown FileHistory mutation op: %q", m.Op()) + } +} + +// GroupClient is a client for the Group schema. +type GroupClient struct { + config +} + +// NewGroupClient returns a client for the Group from the given config. +func NewGroupClient(c config) *GroupClient { + return &GroupClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `group.Hooks(f(g(h())))`. +func (c *GroupClient) Use(hooks ...Hook) { + c.hooks.Group = append(c.hooks.Group, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `group.Intercept(f(g(h())))`. +func (c *GroupClient) Intercept(interceptors ...Interceptor) { + c.inters.Group = append(c.inters.Group, interceptors...) +} + +// Create returns a builder for creating a Group entity. +func (c *GroupClient) Create() *GroupCreate { + mutation := newGroupMutation(c.config, OpCreate) + return &GroupCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Group entities. +func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk { + return &GroupCreateBulk{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 *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &GroupCreateBulk{err: fmt.Errorf("calling to GroupClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*GroupCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &GroupCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Group. +func (c *GroupClient) Update() *GroupUpdate { + mutation := newGroupMutation(c.config, OpUpdate) + return &GroupUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne { + mutation := newGroupMutation(c.config, OpUpdateOne, withGroup(gr)) + return &GroupUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *GroupClient) UpdateOneID(id string) *GroupUpdateOne { + mutation := newGroupMutation(c.config, OpUpdateOne, withGroupID(id)) + return &GroupUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Group. +func (c *GroupClient) Delete() *GroupDelete { + mutation := newGroupMutation(c.config, OpDelete) + return &GroupDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne { + return c.DeleteOneID(gr.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *GroupClient) DeleteOneID(id string) *GroupDeleteOne { + builder := c.Delete().Where(group.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &GroupDeleteOne{builder} +} + +// Query returns a query builder for Group. +func (c *GroupClient) Query() *GroupQuery { + return &GroupQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeGroup}, + inters: c.Interceptors(), + } +} + +// Get returns a Group entity by its id. +func (c *GroupClient) Get(ctx context.Context, id string) (*Group, error) { + return c.Query().Where(group.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *GroupClient) GetX(ctx context.Context, id string) *Group { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Group. +func (c *GroupClient) QueryOwner(gr *Group) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gr.ID + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, group.OwnerTable, group.OwnerColumn), + ) + schemaConfig := gr.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Group + fromV = sqlgraph.Neighbors(gr.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QuerySetting queries the setting edge of a Group. +func (c *GroupClient) QuerySetting(gr *Group) *GroupSettingQuery { + query := (&GroupSettingClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gr.ID + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, id), + sqlgraph.To(groupsetting.Table, groupsetting.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, group.SettingTable, group.SettingColumn), + ) + schemaConfig := gr.schemaConfig + step.To.Schema = schemaConfig.GroupSetting + step.Edge.Schema = schemaConfig.GroupSetting + fromV = sqlgraph.Neighbors(gr.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryUsers queries the users edge of a Group. +func (c *GroupClient) QueryUsers(gr *Group) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gr.ID + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, group.UsersTable, group.UsersPrimaryKey...), + ) + schemaConfig := gr.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + fromV = sqlgraph.Neighbors(gr.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Group. +func (c *GroupClient) QueryEvents(gr *Group) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gr.ID + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, group.EventsTable, group.EventsPrimaryKey...), + ) + schemaConfig := gr.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupEvents + fromV = sqlgraph.Neighbors(gr.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryIntegrations queries the integrations edge of a Group. +func (c *GroupClient) QueryIntegrations(gr *Group) *IntegrationQuery { + query := (&IntegrationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gr.ID + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, id), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, group.IntegrationsTable, group.IntegrationsColumn), + ) + schemaConfig := gr.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + fromV = sqlgraph.Neighbors(gr.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFiles queries the files edge of a Group. +func (c *GroupClient) QueryFiles(gr *Group) *FileQuery { + query := (&FileClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gr.ID + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, id), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, group.FilesTable, group.FilesPrimaryKey...), + ) + schemaConfig := gr.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.GroupFiles + fromV = sqlgraph.Neighbors(gr.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryMembers queries the members edge of a Group. +func (c *GroupClient) QueryMembers(gr *Group) *GroupMembershipQuery { + query := (&GroupMembershipClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gr.ID + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, id), + sqlgraph.To(groupmembership.Table, groupmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, group.MembersTable, group.MembersColumn), + ) + schemaConfig := gr.schemaConfig + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + fromV = sqlgraph.Neighbors(gr.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *GroupClient) Hooks() []Hook { + hooks := c.hooks.Group + return append(hooks[:len(hooks):len(hooks)], group.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *GroupClient) Interceptors() []Interceptor { + inters := c.inters.Group + return append(inters[:len(inters):len(inters)], group.Interceptors[:]...) +} + +func (c *GroupClient) mutate(ctx context.Context, m *GroupMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&GroupCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&GroupUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&GroupUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&GroupDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Group mutation op: %q", m.Op()) + } +} + +// GroupHistoryClient is a client for the GroupHistory schema. +type GroupHistoryClient struct { + config +} + +// NewGroupHistoryClient returns a client for the GroupHistory from the given config. +func NewGroupHistoryClient(c config) *GroupHistoryClient { + return &GroupHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `grouphistory.Hooks(f(g(h())))`. +func (c *GroupHistoryClient) Use(hooks ...Hook) { + c.hooks.GroupHistory = append(c.hooks.GroupHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `grouphistory.Intercept(f(g(h())))`. +func (c *GroupHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.GroupHistory = append(c.inters.GroupHistory, interceptors...) +} + +// Create returns a builder for creating a GroupHistory entity. +func (c *GroupHistoryClient) Create() *GroupHistoryCreate { + mutation := newGroupHistoryMutation(c.config, OpCreate) + return &GroupHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of GroupHistory entities. +func (c *GroupHistoryClient) CreateBulk(builders ...*GroupHistoryCreate) *GroupHistoryCreateBulk { + return &GroupHistoryCreateBulk{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 *GroupHistoryClient) MapCreateBulk(slice any, setFunc func(*GroupHistoryCreate, int)) *GroupHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &GroupHistoryCreateBulk{err: fmt.Errorf("calling to GroupHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*GroupHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &GroupHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for GroupHistory. +func (c *GroupHistoryClient) Update() *GroupHistoryUpdate { + mutation := newGroupHistoryMutation(c.config, OpUpdate) + return &GroupHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *GroupHistoryClient) UpdateOne(gh *GroupHistory) *GroupHistoryUpdateOne { + mutation := newGroupHistoryMutation(c.config, OpUpdateOne, withGroupHistory(gh)) + return &GroupHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *GroupHistoryClient) UpdateOneID(id string) *GroupHistoryUpdateOne { + mutation := newGroupHistoryMutation(c.config, OpUpdateOne, withGroupHistoryID(id)) + return &GroupHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for GroupHistory. +func (c *GroupHistoryClient) Delete() *GroupHistoryDelete { + mutation := newGroupHistoryMutation(c.config, OpDelete) + return &GroupHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *GroupHistoryClient) DeleteOne(gh *GroupHistory) *GroupHistoryDeleteOne { + return c.DeleteOneID(gh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *GroupHistoryClient) DeleteOneID(id string) *GroupHistoryDeleteOne { + builder := c.Delete().Where(grouphistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &GroupHistoryDeleteOne{builder} +} + +// Query returns a query builder for GroupHistory. +func (c *GroupHistoryClient) Query() *GroupHistoryQuery { + return &GroupHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeGroupHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a GroupHistory entity by its id. +func (c *GroupHistoryClient) Get(ctx context.Context, id string) (*GroupHistory, error) { + return c.Query().Where(grouphistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *GroupHistoryClient) GetX(ctx context.Context, id string) *GroupHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *GroupHistoryClient) Hooks() []Hook { + hooks := c.hooks.GroupHistory + return append(hooks[:len(hooks):len(hooks)], grouphistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *GroupHistoryClient) Interceptors() []Interceptor { + inters := c.inters.GroupHistory + return append(inters[:len(inters):len(inters)], grouphistory.Interceptors[:]...) +} + +func (c *GroupHistoryClient) mutate(ctx context.Context, m *GroupHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&GroupHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&GroupHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&GroupHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&GroupHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown GroupHistory mutation op: %q", m.Op()) + } +} + +// GroupMembershipClient is a client for the GroupMembership schema. +type GroupMembershipClient struct { + config +} + +// NewGroupMembershipClient returns a client for the GroupMembership from the given config. +func NewGroupMembershipClient(c config) *GroupMembershipClient { + return &GroupMembershipClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `groupmembership.Hooks(f(g(h())))`. +func (c *GroupMembershipClient) Use(hooks ...Hook) { + c.hooks.GroupMembership = append(c.hooks.GroupMembership, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `groupmembership.Intercept(f(g(h())))`. +func (c *GroupMembershipClient) Intercept(interceptors ...Interceptor) { + c.inters.GroupMembership = append(c.inters.GroupMembership, interceptors...) +} + +// Create returns a builder for creating a GroupMembership entity. +func (c *GroupMembershipClient) Create() *GroupMembershipCreate { + mutation := newGroupMembershipMutation(c.config, OpCreate) + return &GroupMembershipCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of GroupMembership entities. +func (c *GroupMembershipClient) CreateBulk(builders ...*GroupMembershipCreate) *GroupMembershipCreateBulk { + return &GroupMembershipCreateBulk{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 *GroupMembershipClient) MapCreateBulk(slice any, setFunc func(*GroupMembershipCreate, int)) *GroupMembershipCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &GroupMembershipCreateBulk{err: fmt.Errorf("calling to GroupMembershipClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*GroupMembershipCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &GroupMembershipCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for GroupMembership. +func (c *GroupMembershipClient) Update() *GroupMembershipUpdate { + mutation := newGroupMembershipMutation(c.config, OpUpdate) + return &GroupMembershipUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *GroupMembershipClient) UpdateOne(gm *GroupMembership) *GroupMembershipUpdateOne { + mutation := newGroupMembershipMutation(c.config, OpUpdateOne, withGroupMembership(gm)) + return &GroupMembershipUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *GroupMembershipClient) UpdateOneID(id string) *GroupMembershipUpdateOne { + mutation := newGroupMembershipMutation(c.config, OpUpdateOne, withGroupMembershipID(id)) + return &GroupMembershipUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for GroupMembership. +func (c *GroupMembershipClient) Delete() *GroupMembershipDelete { + mutation := newGroupMembershipMutation(c.config, OpDelete) + return &GroupMembershipDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *GroupMembershipClient) DeleteOne(gm *GroupMembership) *GroupMembershipDeleteOne { + return c.DeleteOneID(gm.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *GroupMembershipClient) DeleteOneID(id string) *GroupMembershipDeleteOne { + builder := c.Delete().Where(groupmembership.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &GroupMembershipDeleteOne{builder} +} + +// Query returns a query builder for GroupMembership. +func (c *GroupMembershipClient) Query() *GroupMembershipQuery { + return &GroupMembershipQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeGroupMembership}, + inters: c.Interceptors(), + } +} + +// Get returns a GroupMembership entity by its id. +func (c *GroupMembershipClient) Get(ctx context.Context, id string) (*GroupMembership, error) { + return c.Query().Where(groupmembership.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *GroupMembershipClient) GetX(ctx context.Context, id string) *GroupMembership { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryGroup queries the group edge of a GroupMembership. +func (c *GroupMembershipClient) QueryGroup(gm *GroupMembership) *GroupQuery { + query := (&GroupClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gm.ID + step := sqlgraph.NewStep( + sqlgraph.From(groupmembership.Table, groupmembership.FieldID, id), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, groupmembership.GroupTable, groupmembership.GroupColumn), + ) + schemaConfig := gm.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + fromV = sqlgraph.Neighbors(gm.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryUser queries the user edge of a GroupMembership. +func (c *GroupMembershipClient) QueryUser(gm *GroupMembership) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gm.ID + step := sqlgraph.NewStep( + sqlgraph.From(groupmembership.Table, groupmembership.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, groupmembership.UserTable, groupmembership.UserColumn), + ) + schemaConfig := gm.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + fromV = sqlgraph.Neighbors(gm.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a GroupMembership. +func (c *GroupMembershipClient) QueryEvents(gm *GroupMembership) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gm.ID + step := sqlgraph.NewStep( + sqlgraph.From(groupmembership.Table, groupmembership.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, groupmembership.EventsTable, groupmembership.EventsPrimaryKey...), + ) + schemaConfig := gm.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupMembershipEvents + fromV = sqlgraph.Neighbors(gm.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *GroupMembershipClient) Hooks() []Hook { + hooks := c.hooks.GroupMembership + return append(hooks[:len(hooks):len(hooks)], groupmembership.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *GroupMembershipClient) Interceptors() []Interceptor { + inters := c.inters.GroupMembership + return append(inters[:len(inters):len(inters)], groupmembership.Interceptors[:]...) +} + +func (c *GroupMembershipClient) mutate(ctx context.Context, m *GroupMembershipMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&GroupMembershipCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&GroupMembershipUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&GroupMembershipUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&GroupMembershipDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown GroupMembership mutation op: %q", m.Op()) + } +} + +// GroupMembershipHistoryClient is a client for the GroupMembershipHistory schema. +type GroupMembershipHistoryClient struct { + config +} + +// NewGroupMembershipHistoryClient returns a client for the GroupMembershipHistory from the given config. +func NewGroupMembershipHistoryClient(c config) *GroupMembershipHistoryClient { + return &GroupMembershipHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `groupmembershiphistory.Hooks(f(g(h())))`. +func (c *GroupMembershipHistoryClient) Use(hooks ...Hook) { + c.hooks.GroupMembershipHistory = append(c.hooks.GroupMembershipHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `groupmembershiphistory.Intercept(f(g(h())))`. +func (c *GroupMembershipHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.GroupMembershipHistory = append(c.inters.GroupMembershipHistory, interceptors...) +} + +// Create returns a builder for creating a GroupMembershipHistory entity. +func (c *GroupMembershipHistoryClient) Create() *GroupMembershipHistoryCreate { + mutation := newGroupMembershipHistoryMutation(c.config, OpCreate) + return &GroupMembershipHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of GroupMembershipHistory entities. +func (c *GroupMembershipHistoryClient) CreateBulk(builders ...*GroupMembershipHistoryCreate) *GroupMembershipHistoryCreateBulk { + return &GroupMembershipHistoryCreateBulk{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 *GroupMembershipHistoryClient) MapCreateBulk(slice any, setFunc func(*GroupMembershipHistoryCreate, int)) *GroupMembershipHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &GroupMembershipHistoryCreateBulk{err: fmt.Errorf("calling to GroupMembershipHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*GroupMembershipHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &GroupMembershipHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for GroupMembershipHistory. +func (c *GroupMembershipHistoryClient) Update() *GroupMembershipHistoryUpdate { + mutation := newGroupMembershipHistoryMutation(c.config, OpUpdate) + return &GroupMembershipHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *GroupMembershipHistoryClient) UpdateOne(gmh *GroupMembershipHistory) *GroupMembershipHistoryUpdateOne { + mutation := newGroupMembershipHistoryMutation(c.config, OpUpdateOne, withGroupMembershipHistory(gmh)) + return &GroupMembershipHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *GroupMembershipHistoryClient) UpdateOneID(id string) *GroupMembershipHistoryUpdateOne { + mutation := newGroupMembershipHistoryMutation(c.config, OpUpdateOne, withGroupMembershipHistoryID(id)) + return &GroupMembershipHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for GroupMembershipHistory. +func (c *GroupMembershipHistoryClient) Delete() *GroupMembershipHistoryDelete { + mutation := newGroupMembershipHistoryMutation(c.config, OpDelete) + return &GroupMembershipHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *GroupMembershipHistoryClient) DeleteOne(gmh *GroupMembershipHistory) *GroupMembershipHistoryDeleteOne { + return c.DeleteOneID(gmh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *GroupMembershipHistoryClient) DeleteOneID(id string) *GroupMembershipHistoryDeleteOne { + builder := c.Delete().Where(groupmembershiphistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &GroupMembershipHistoryDeleteOne{builder} +} + +// Query returns a query builder for GroupMembershipHistory. +func (c *GroupMembershipHistoryClient) Query() *GroupMembershipHistoryQuery { + return &GroupMembershipHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeGroupMembershipHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a GroupMembershipHistory entity by its id. +func (c *GroupMembershipHistoryClient) Get(ctx context.Context, id string) (*GroupMembershipHistory, error) { + return c.Query().Where(groupmembershiphistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *GroupMembershipHistoryClient) GetX(ctx context.Context, id string) *GroupMembershipHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *GroupMembershipHistoryClient) Hooks() []Hook { + hooks := c.hooks.GroupMembershipHistory + return append(hooks[:len(hooks):len(hooks)], groupmembershiphistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *GroupMembershipHistoryClient) Interceptors() []Interceptor { + inters := c.inters.GroupMembershipHistory + return append(inters[:len(inters):len(inters)], groupmembershiphistory.Interceptors[:]...) +} + +func (c *GroupMembershipHistoryClient) mutate(ctx context.Context, m *GroupMembershipHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&GroupMembershipHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&GroupMembershipHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&GroupMembershipHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&GroupMembershipHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown GroupMembershipHistory mutation op: %q", m.Op()) + } +} + +// GroupSettingClient is a client for the GroupSetting schema. +type GroupSettingClient struct { + config +} + +// NewGroupSettingClient returns a client for the GroupSetting from the given config. +func NewGroupSettingClient(c config) *GroupSettingClient { + return &GroupSettingClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `groupsetting.Hooks(f(g(h())))`. +func (c *GroupSettingClient) Use(hooks ...Hook) { + c.hooks.GroupSetting = append(c.hooks.GroupSetting, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `groupsetting.Intercept(f(g(h())))`. +func (c *GroupSettingClient) Intercept(interceptors ...Interceptor) { + c.inters.GroupSetting = append(c.inters.GroupSetting, interceptors...) +} + +// Create returns a builder for creating a GroupSetting entity. +func (c *GroupSettingClient) Create() *GroupSettingCreate { + mutation := newGroupSettingMutation(c.config, OpCreate) + return &GroupSettingCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of GroupSetting entities. +func (c *GroupSettingClient) CreateBulk(builders ...*GroupSettingCreate) *GroupSettingCreateBulk { + return &GroupSettingCreateBulk{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 *GroupSettingClient) MapCreateBulk(slice any, setFunc func(*GroupSettingCreate, int)) *GroupSettingCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &GroupSettingCreateBulk{err: fmt.Errorf("calling to GroupSettingClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*GroupSettingCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &GroupSettingCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for GroupSetting. +func (c *GroupSettingClient) Update() *GroupSettingUpdate { + mutation := newGroupSettingMutation(c.config, OpUpdate) + return &GroupSettingUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *GroupSettingClient) UpdateOne(gs *GroupSetting) *GroupSettingUpdateOne { + mutation := newGroupSettingMutation(c.config, OpUpdateOne, withGroupSetting(gs)) + return &GroupSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *GroupSettingClient) UpdateOneID(id string) *GroupSettingUpdateOne { + mutation := newGroupSettingMutation(c.config, OpUpdateOne, withGroupSettingID(id)) + return &GroupSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for GroupSetting. +func (c *GroupSettingClient) Delete() *GroupSettingDelete { + mutation := newGroupSettingMutation(c.config, OpDelete) + return &GroupSettingDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *GroupSettingClient) DeleteOne(gs *GroupSetting) *GroupSettingDeleteOne { + return c.DeleteOneID(gs.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *GroupSettingClient) DeleteOneID(id string) *GroupSettingDeleteOne { + builder := c.Delete().Where(groupsetting.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &GroupSettingDeleteOne{builder} +} + +// Query returns a query builder for GroupSetting. +func (c *GroupSettingClient) Query() *GroupSettingQuery { + return &GroupSettingQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeGroupSetting}, + inters: c.Interceptors(), + } +} + +// Get returns a GroupSetting entity by its id. +func (c *GroupSettingClient) Get(ctx context.Context, id string) (*GroupSetting, error) { + return c.Query().Where(groupsetting.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *GroupSettingClient) GetX(ctx context.Context, id string) *GroupSetting { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryGroup queries the group edge of a GroupSetting. +func (c *GroupSettingClient) QueryGroup(gs *GroupSetting) *GroupQuery { + query := (&GroupClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := gs.ID + step := sqlgraph.NewStep( + sqlgraph.From(groupsetting.Table, groupsetting.FieldID, id), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, groupsetting.GroupTable, groupsetting.GroupColumn), + ) + schemaConfig := gs.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupSetting + fromV = sqlgraph.Neighbors(gs.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *GroupSettingClient) Hooks() []Hook { + hooks := c.hooks.GroupSetting + return append(hooks[:len(hooks):len(hooks)], groupsetting.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *GroupSettingClient) Interceptors() []Interceptor { + inters := c.inters.GroupSetting + return append(inters[:len(inters):len(inters)], groupsetting.Interceptors[:]...) +} + +func (c *GroupSettingClient) mutate(ctx context.Context, m *GroupSettingMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&GroupSettingCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&GroupSettingUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&GroupSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&GroupSettingDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown GroupSetting mutation op: %q", m.Op()) + } +} + +// GroupSettingHistoryClient is a client for the GroupSettingHistory schema. +type GroupSettingHistoryClient struct { + config +} + +// NewGroupSettingHistoryClient returns a client for the GroupSettingHistory from the given config. +func NewGroupSettingHistoryClient(c config) *GroupSettingHistoryClient { + return &GroupSettingHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `groupsettinghistory.Hooks(f(g(h())))`. +func (c *GroupSettingHistoryClient) Use(hooks ...Hook) { + c.hooks.GroupSettingHistory = append(c.hooks.GroupSettingHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `groupsettinghistory.Intercept(f(g(h())))`. +func (c *GroupSettingHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.GroupSettingHistory = append(c.inters.GroupSettingHistory, interceptors...) +} + +// Create returns a builder for creating a GroupSettingHistory entity. +func (c *GroupSettingHistoryClient) Create() *GroupSettingHistoryCreate { + mutation := newGroupSettingHistoryMutation(c.config, OpCreate) + return &GroupSettingHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of GroupSettingHistory entities. +func (c *GroupSettingHistoryClient) CreateBulk(builders ...*GroupSettingHistoryCreate) *GroupSettingHistoryCreateBulk { + return &GroupSettingHistoryCreateBulk{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 *GroupSettingHistoryClient) MapCreateBulk(slice any, setFunc func(*GroupSettingHistoryCreate, int)) *GroupSettingHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &GroupSettingHistoryCreateBulk{err: fmt.Errorf("calling to GroupSettingHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*GroupSettingHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &GroupSettingHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for GroupSettingHistory. +func (c *GroupSettingHistoryClient) Update() *GroupSettingHistoryUpdate { + mutation := newGroupSettingHistoryMutation(c.config, OpUpdate) + return &GroupSettingHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *GroupSettingHistoryClient) UpdateOne(gsh *GroupSettingHistory) *GroupSettingHistoryUpdateOne { + mutation := newGroupSettingHistoryMutation(c.config, OpUpdateOne, withGroupSettingHistory(gsh)) + return &GroupSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *GroupSettingHistoryClient) UpdateOneID(id string) *GroupSettingHistoryUpdateOne { + mutation := newGroupSettingHistoryMutation(c.config, OpUpdateOne, withGroupSettingHistoryID(id)) + return &GroupSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for GroupSettingHistory. +func (c *GroupSettingHistoryClient) Delete() *GroupSettingHistoryDelete { + mutation := newGroupSettingHistoryMutation(c.config, OpDelete) + return &GroupSettingHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *GroupSettingHistoryClient) DeleteOne(gsh *GroupSettingHistory) *GroupSettingHistoryDeleteOne { + return c.DeleteOneID(gsh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *GroupSettingHistoryClient) DeleteOneID(id string) *GroupSettingHistoryDeleteOne { + builder := c.Delete().Where(groupsettinghistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &GroupSettingHistoryDeleteOne{builder} +} + +// Query returns a query builder for GroupSettingHistory. +func (c *GroupSettingHistoryClient) Query() *GroupSettingHistoryQuery { + return &GroupSettingHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeGroupSettingHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a GroupSettingHistory entity by its id. +func (c *GroupSettingHistoryClient) Get(ctx context.Context, id string) (*GroupSettingHistory, error) { + return c.Query().Where(groupsettinghistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *GroupSettingHistoryClient) GetX(ctx context.Context, id string) *GroupSettingHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *GroupSettingHistoryClient) Hooks() []Hook { + hooks := c.hooks.GroupSettingHistory + return append(hooks[:len(hooks):len(hooks)], groupsettinghistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *GroupSettingHistoryClient) Interceptors() []Interceptor { + inters := c.inters.GroupSettingHistory + return append(inters[:len(inters):len(inters)], groupsettinghistory.Interceptors[:]...) +} + +func (c *GroupSettingHistoryClient) mutate(ctx context.Context, m *GroupSettingHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&GroupSettingHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&GroupSettingHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&GroupSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&GroupSettingHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown GroupSettingHistory mutation op: %q", m.Op()) + } +} + +// HushClient is a client for the Hush schema. +type HushClient struct { + config +} + +// NewHushClient returns a client for the Hush from the given config. +func NewHushClient(c config) *HushClient { + return &HushClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `hush.Hooks(f(g(h())))`. +func (c *HushClient) Use(hooks ...Hook) { + c.hooks.Hush = append(c.hooks.Hush, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `hush.Intercept(f(g(h())))`. +func (c *HushClient) Intercept(interceptors ...Interceptor) { + c.inters.Hush = append(c.inters.Hush, interceptors...) +} + +// Create returns a builder for creating a Hush entity. +func (c *HushClient) Create() *HushCreate { + mutation := newHushMutation(c.config, OpCreate) + return &HushCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Hush entities. +func (c *HushClient) CreateBulk(builders ...*HushCreate) *HushCreateBulk { + return &HushCreateBulk{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 *HushClient) MapCreateBulk(slice any, setFunc func(*HushCreate, int)) *HushCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &HushCreateBulk{err: fmt.Errorf("calling to HushClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*HushCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &HushCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Hush. +func (c *HushClient) Update() *HushUpdate { + mutation := newHushMutation(c.config, OpUpdate) + return &HushUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *HushClient) UpdateOne(h *Hush) *HushUpdateOne { + mutation := newHushMutation(c.config, OpUpdateOne, withHush(h)) + return &HushUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *HushClient) UpdateOneID(id string) *HushUpdateOne { + mutation := newHushMutation(c.config, OpUpdateOne, withHushID(id)) + return &HushUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Hush. +func (c *HushClient) Delete() *HushDelete { + mutation := newHushMutation(c.config, OpDelete) + return &HushDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *HushClient) DeleteOne(h *Hush) *HushDeleteOne { + return c.DeleteOneID(h.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *HushClient) DeleteOneID(id string) *HushDeleteOne { + builder := c.Delete().Where(hush.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &HushDeleteOne{builder} +} + +// Query returns a query builder for Hush. +func (c *HushClient) Query() *HushQuery { + return &HushQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeHush}, + inters: c.Interceptors(), + } +} + +// Get returns a Hush entity by its id. +func (c *HushClient) Get(ctx context.Context, id string) (*Hush, error) { + return c.Query().Where(hush.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *HushClient) GetX(ctx context.Context, id string) *Hush { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryIntegrations queries the integrations edge of a Hush. +func (c *HushClient) QueryIntegrations(h *Hush) *IntegrationQuery { + query := (&IntegrationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := h.ID + step := sqlgraph.NewStep( + sqlgraph.From(hush.Table, hush.FieldID, id), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, hush.IntegrationsTable, hush.IntegrationsPrimaryKey...), + ) + schemaConfig := h.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationSecrets + fromV = sqlgraph.Neighbors(h.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrganization queries the organization edge of a Hush. +func (c *HushClient) QueryOrganization(h *Hush) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := h.ID + step := sqlgraph.NewStep( + sqlgraph.From(hush.Table, hush.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, hush.OrganizationTable, hush.OrganizationPrimaryKey...), + ) + schemaConfig := h.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSecrets + fromV = sqlgraph.Neighbors(h.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Hush. +func (c *HushClient) QueryEvents(h *Hush) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := h.ID + step := sqlgraph.NewStep( + sqlgraph.From(hush.Table, hush.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, hush.EventsTable, hush.EventsPrimaryKey...), + ) + schemaConfig := h.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.HushEvents + fromV = sqlgraph.Neighbors(h.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *HushClient) Hooks() []Hook { + hooks := c.hooks.Hush + return append(hooks[:len(hooks):len(hooks)], hush.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *HushClient) Interceptors() []Interceptor { + inters := c.inters.Hush + return append(inters[:len(inters):len(inters)], hush.Interceptors[:]...) +} + +func (c *HushClient) mutate(ctx context.Context, m *HushMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&HushCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&HushUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&HushUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&HushDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Hush mutation op: %q", m.Op()) + } +} + +// HushHistoryClient is a client for the HushHistory schema. +type HushHistoryClient struct { + config +} + +// NewHushHistoryClient returns a client for the HushHistory from the given config. +func NewHushHistoryClient(c config) *HushHistoryClient { + return &HushHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `hushhistory.Hooks(f(g(h())))`. +func (c *HushHistoryClient) Use(hooks ...Hook) { + c.hooks.HushHistory = append(c.hooks.HushHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `hushhistory.Intercept(f(g(h())))`. +func (c *HushHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.HushHistory = append(c.inters.HushHistory, interceptors...) +} + +// Create returns a builder for creating a HushHistory entity. +func (c *HushHistoryClient) Create() *HushHistoryCreate { + mutation := newHushHistoryMutation(c.config, OpCreate) + return &HushHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of HushHistory entities. +func (c *HushHistoryClient) CreateBulk(builders ...*HushHistoryCreate) *HushHistoryCreateBulk { + return &HushHistoryCreateBulk{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 *HushHistoryClient) MapCreateBulk(slice any, setFunc func(*HushHistoryCreate, int)) *HushHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &HushHistoryCreateBulk{err: fmt.Errorf("calling to HushHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*HushHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &HushHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for HushHistory. +func (c *HushHistoryClient) Update() *HushHistoryUpdate { + mutation := newHushHistoryMutation(c.config, OpUpdate) + return &HushHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *HushHistoryClient) UpdateOne(hh *HushHistory) *HushHistoryUpdateOne { + mutation := newHushHistoryMutation(c.config, OpUpdateOne, withHushHistory(hh)) + return &HushHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *HushHistoryClient) UpdateOneID(id string) *HushHistoryUpdateOne { + mutation := newHushHistoryMutation(c.config, OpUpdateOne, withHushHistoryID(id)) + return &HushHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for HushHistory. +func (c *HushHistoryClient) Delete() *HushHistoryDelete { + mutation := newHushHistoryMutation(c.config, OpDelete) + return &HushHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *HushHistoryClient) DeleteOne(hh *HushHistory) *HushHistoryDeleteOne { + return c.DeleteOneID(hh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *HushHistoryClient) DeleteOneID(id string) *HushHistoryDeleteOne { + builder := c.Delete().Where(hushhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &HushHistoryDeleteOne{builder} +} + +// Query returns a query builder for HushHistory. +func (c *HushHistoryClient) Query() *HushHistoryQuery { + return &HushHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeHushHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a HushHistory entity by its id. +func (c *HushHistoryClient) Get(ctx context.Context, id string) (*HushHistory, error) { + return c.Query().Where(hushhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *HushHistoryClient) GetX(ctx context.Context, id string) *HushHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *HushHistoryClient) Hooks() []Hook { + return c.hooks.HushHistory +} + +// Interceptors returns the client interceptors. +func (c *HushHistoryClient) Interceptors() []Interceptor { + return c.inters.HushHistory +} + +func (c *HushHistoryClient) mutate(ctx context.Context, m *HushHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&HushHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&HushHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&HushHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&HushHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown HushHistory mutation op: %q", m.Op()) + } +} + +// IntegrationClient is a client for the Integration schema. +type IntegrationClient struct { + config +} + +// NewIntegrationClient returns a client for the Integration from the given config. +func NewIntegrationClient(c config) *IntegrationClient { + return &IntegrationClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `integration.Hooks(f(g(h())))`. +func (c *IntegrationClient) Use(hooks ...Hook) { + c.hooks.Integration = append(c.hooks.Integration, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `integration.Intercept(f(g(h())))`. +func (c *IntegrationClient) Intercept(interceptors ...Interceptor) { + c.inters.Integration = append(c.inters.Integration, interceptors...) +} + +// Create returns a builder for creating a Integration entity. +func (c *IntegrationClient) Create() *IntegrationCreate { + mutation := newIntegrationMutation(c.config, OpCreate) + return &IntegrationCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Integration entities. +func (c *IntegrationClient) CreateBulk(builders ...*IntegrationCreate) *IntegrationCreateBulk { + return &IntegrationCreateBulk{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 *IntegrationClient) MapCreateBulk(slice any, setFunc func(*IntegrationCreate, int)) *IntegrationCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &IntegrationCreateBulk{err: fmt.Errorf("calling to IntegrationClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*IntegrationCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &IntegrationCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Integration. +func (c *IntegrationClient) Update() *IntegrationUpdate { + mutation := newIntegrationMutation(c.config, OpUpdate) + return &IntegrationUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *IntegrationClient) UpdateOne(i *Integration) *IntegrationUpdateOne { + mutation := newIntegrationMutation(c.config, OpUpdateOne, withIntegration(i)) + return &IntegrationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *IntegrationClient) UpdateOneID(id string) *IntegrationUpdateOne { + mutation := newIntegrationMutation(c.config, OpUpdateOne, withIntegrationID(id)) + return &IntegrationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Integration. +func (c *IntegrationClient) Delete() *IntegrationDelete { + mutation := newIntegrationMutation(c.config, OpDelete) + return &IntegrationDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *IntegrationClient) DeleteOne(i *Integration) *IntegrationDeleteOne { + return c.DeleteOneID(i.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *IntegrationClient) DeleteOneID(id string) *IntegrationDeleteOne { + builder := c.Delete().Where(integration.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &IntegrationDeleteOne{builder} +} + +// Query returns a query builder for Integration. +func (c *IntegrationClient) Query() *IntegrationQuery { + return &IntegrationQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeIntegration}, + inters: c.Interceptors(), + } +} + +// Get returns a Integration entity by its id. +func (c *IntegrationClient) Get(ctx context.Context, id string) (*Integration, error) { + return c.Query().Where(integration.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *IntegrationClient) GetX(ctx context.Context, id string) *Integration { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Integration. +func (c *IntegrationClient) QueryOwner(i *Integration) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := i.ID + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, integration.OwnerTable, integration.OwnerColumn), + ) + schemaConfig := i.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Integration + fromV = sqlgraph.Neighbors(i.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QuerySecrets queries the secrets edge of a Integration. +func (c *IntegrationClient) QuerySecrets(i *Integration) *HushQuery { + query := (&HushClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := i.ID + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, id), + sqlgraph.To(hush.Table, hush.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.SecretsTable, integration.SecretsPrimaryKey...), + ) + schemaConfig := i.schemaConfig + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.IntegrationSecrets + fromV = sqlgraph.Neighbors(i.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOauth2tokens queries the oauth2tokens edge of a Integration. +func (c *IntegrationClient) QueryOauth2tokens(i *Integration) *OhAuthTooTokenQuery { + query := (&OhAuthTooTokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := i.ID + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, id), + sqlgraph.To(ohauthtootoken.Table, ohauthtootoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.Oauth2tokensTable, integration.Oauth2tokensPrimaryKey...), + ) + schemaConfig := i.schemaConfig + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + fromV = sqlgraph.Neighbors(i.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Integration. +func (c *IntegrationClient) QueryEvents(i *Integration) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := i.ID + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.EventsTable, integration.EventsPrimaryKey...), + ) + schemaConfig := i.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.IntegrationEvents + fromV = sqlgraph.Neighbors(i.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryWebhooks queries the webhooks edge of a Integration. +func (c *IntegrationClient) QueryWebhooks(i *Integration) *WebhookQuery { + query := (&WebhookClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := i.ID + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, id), + sqlgraph.To(webhook.Table, webhook.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.WebhooksTable, integration.WebhooksPrimaryKey...), + ) + schemaConfig := i.schemaConfig + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.IntegrationWebhooks + fromV = sqlgraph.Neighbors(i.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *IntegrationClient) Hooks() []Hook { + hooks := c.hooks.Integration + return append(hooks[:len(hooks):len(hooks)], integration.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *IntegrationClient) Interceptors() []Interceptor { + inters := c.inters.Integration + return append(inters[:len(inters):len(inters)], integration.Interceptors[:]...) +} + +func (c *IntegrationClient) mutate(ctx context.Context, m *IntegrationMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&IntegrationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&IntegrationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&IntegrationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&IntegrationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Integration mutation op: %q", m.Op()) + } +} + +// IntegrationHistoryClient is a client for the IntegrationHistory schema. +type IntegrationHistoryClient struct { + config +} + +// NewIntegrationHistoryClient returns a client for the IntegrationHistory from the given config. +func NewIntegrationHistoryClient(c config) *IntegrationHistoryClient { + return &IntegrationHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `integrationhistory.Hooks(f(g(h())))`. +func (c *IntegrationHistoryClient) Use(hooks ...Hook) { + c.hooks.IntegrationHistory = append(c.hooks.IntegrationHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `integrationhistory.Intercept(f(g(h())))`. +func (c *IntegrationHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.IntegrationHistory = append(c.inters.IntegrationHistory, interceptors...) +} + +// Create returns a builder for creating a IntegrationHistory entity. +func (c *IntegrationHistoryClient) Create() *IntegrationHistoryCreate { + mutation := newIntegrationHistoryMutation(c.config, OpCreate) + return &IntegrationHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of IntegrationHistory entities. +func (c *IntegrationHistoryClient) CreateBulk(builders ...*IntegrationHistoryCreate) *IntegrationHistoryCreateBulk { + return &IntegrationHistoryCreateBulk{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 *IntegrationHistoryClient) MapCreateBulk(slice any, setFunc func(*IntegrationHistoryCreate, int)) *IntegrationHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &IntegrationHistoryCreateBulk{err: fmt.Errorf("calling to IntegrationHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*IntegrationHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &IntegrationHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for IntegrationHistory. +func (c *IntegrationHistoryClient) Update() *IntegrationHistoryUpdate { + mutation := newIntegrationHistoryMutation(c.config, OpUpdate) + return &IntegrationHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *IntegrationHistoryClient) UpdateOne(ih *IntegrationHistory) *IntegrationHistoryUpdateOne { + mutation := newIntegrationHistoryMutation(c.config, OpUpdateOne, withIntegrationHistory(ih)) + return &IntegrationHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *IntegrationHistoryClient) UpdateOneID(id string) *IntegrationHistoryUpdateOne { + mutation := newIntegrationHistoryMutation(c.config, OpUpdateOne, withIntegrationHistoryID(id)) + return &IntegrationHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for IntegrationHistory. +func (c *IntegrationHistoryClient) Delete() *IntegrationHistoryDelete { + mutation := newIntegrationHistoryMutation(c.config, OpDelete) + return &IntegrationHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *IntegrationHistoryClient) DeleteOne(ih *IntegrationHistory) *IntegrationHistoryDeleteOne { + return c.DeleteOneID(ih.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *IntegrationHistoryClient) DeleteOneID(id string) *IntegrationHistoryDeleteOne { + builder := c.Delete().Where(integrationhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &IntegrationHistoryDeleteOne{builder} +} + +// Query returns a query builder for IntegrationHistory. +func (c *IntegrationHistoryClient) Query() *IntegrationHistoryQuery { + return &IntegrationHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeIntegrationHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a IntegrationHistory entity by its id. +func (c *IntegrationHistoryClient) Get(ctx context.Context, id string) (*IntegrationHistory, error) { + return c.Query().Where(integrationhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *IntegrationHistoryClient) GetX(ctx context.Context, id string) *IntegrationHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *IntegrationHistoryClient) Hooks() []Hook { + hooks := c.hooks.IntegrationHistory + return append(hooks[:len(hooks):len(hooks)], integrationhistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *IntegrationHistoryClient) Interceptors() []Interceptor { + inters := c.inters.IntegrationHistory + return append(inters[:len(inters):len(inters)], integrationhistory.Interceptors[:]...) +} + +func (c *IntegrationHistoryClient) mutate(ctx context.Context, m *IntegrationHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&IntegrationHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&IntegrationHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&IntegrationHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&IntegrationHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown IntegrationHistory mutation op: %q", m.Op()) + } +} + +// InviteClient is a client for the Invite schema. +type InviteClient struct { + config +} + +// NewInviteClient returns a client for the Invite from the given config. +func NewInviteClient(c config) *InviteClient { + return &InviteClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `invite.Hooks(f(g(h())))`. +func (c *InviteClient) Use(hooks ...Hook) { + c.hooks.Invite = append(c.hooks.Invite, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `invite.Intercept(f(g(h())))`. +func (c *InviteClient) Intercept(interceptors ...Interceptor) { + c.inters.Invite = append(c.inters.Invite, interceptors...) +} + +// Create returns a builder for creating a Invite entity. +func (c *InviteClient) Create() *InviteCreate { + mutation := newInviteMutation(c.config, OpCreate) + return &InviteCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Invite entities. +func (c *InviteClient) CreateBulk(builders ...*InviteCreate) *InviteCreateBulk { + return &InviteCreateBulk{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 *InviteClient) MapCreateBulk(slice any, setFunc func(*InviteCreate, int)) *InviteCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &InviteCreateBulk{err: fmt.Errorf("calling to InviteClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*InviteCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &InviteCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Invite. +func (c *InviteClient) Update() *InviteUpdate { + mutation := newInviteMutation(c.config, OpUpdate) + return &InviteUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *InviteClient) UpdateOne(i *Invite) *InviteUpdateOne { + mutation := newInviteMutation(c.config, OpUpdateOne, withInvite(i)) + return &InviteUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *InviteClient) UpdateOneID(id string) *InviteUpdateOne { + mutation := newInviteMutation(c.config, OpUpdateOne, withInviteID(id)) + return &InviteUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Invite. +func (c *InviteClient) Delete() *InviteDelete { + mutation := newInviteMutation(c.config, OpDelete) + return &InviteDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *InviteClient) DeleteOne(i *Invite) *InviteDeleteOne { + return c.DeleteOneID(i.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *InviteClient) DeleteOneID(id string) *InviteDeleteOne { + builder := c.Delete().Where(invite.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &InviteDeleteOne{builder} +} + +// Query returns a query builder for Invite. +func (c *InviteClient) Query() *InviteQuery { + return &InviteQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeInvite}, + inters: c.Interceptors(), + } +} + +// Get returns a Invite entity by its id. +func (c *InviteClient) Get(ctx context.Context, id string) (*Invite, error) { + return c.Query().Where(invite.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *InviteClient) GetX(ctx context.Context, id string) *Invite { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Invite. +func (c *InviteClient) QueryOwner(i *Invite) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := i.ID + step := sqlgraph.NewStep( + sqlgraph.From(invite.Table, invite.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, invite.OwnerTable, invite.OwnerColumn), + ) + schemaConfig := i.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Invite + fromV = sqlgraph.Neighbors(i.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Invite. +func (c *InviteClient) QueryEvents(i *Invite) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := i.ID + step := sqlgraph.NewStep( + sqlgraph.From(invite.Table, invite.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, invite.EventsTable, invite.EventsPrimaryKey...), + ) + schemaConfig := i.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.InviteEvents + fromV = sqlgraph.Neighbors(i.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *InviteClient) Hooks() []Hook { + hooks := c.hooks.Invite + return append(hooks[:len(hooks):len(hooks)], invite.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *InviteClient) Interceptors() []Interceptor { + inters := c.inters.Invite + return append(inters[:len(inters):len(inters)], invite.Interceptors[:]...) +} + +func (c *InviteClient) mutate(ctx context.Context, m *InviteMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&InviteCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&InviteUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&InviteUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&InviteDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Invite mutation op: %q", m.Op()) + } +} + +// NoteClient is a client for the Note schema. +type NoteClient struct { + config +} + +// NewNoteClient returns a client for the Note from the given config. +func NewNoteClient(c config) *NoteClient { + return &NoteClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `note.Hooks(f(g(h())))`. +func (c *NoteClient) Use(hooks ...Hook) { + c.hooks.Note = append(c.hooks.Note, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `note.Intercept(f(g(h())))`. +func (c *NoteClient) Intercept(interceptors ...Interceptor) { + c.inters.Note = append(c.inters.Note, interceptors...) +} + +// Create returns a builder for creating a Note entity. +func (c *NoteClient) Create() *NoteCreate { + mutation := newNoteMutation(c.config, OpCreate) + return &NoteCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Note entities. +func (c *NoteClient) CreateBulk(builders ...*NoteCreate) *NoteCreateBulk { + return &NoteCreateBulk{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 *NoteClient) MapCreateBulk(slice any, setFunc func(*NoteCreate, int)) *NoteCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &NoteCreateBulk{err: fmt.Errorf("calling to NoteClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*NoteCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &NoteCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Note. +func (c *NoteClient) Update() *NoteUpdate { + mutation := newNoteMutation(c.config, OpUpdate) + return &NoteUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *NoteClient) UpdateOne(n *Note) *NoteUpdateOne { + mutation := newNoteMutation(c.config, OpUpdateOne, withNote(n)) + return &NoteUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *NoteClient) UpdateOneID(id string) *NoteUpdateOne { + mutation := newNoteMutation(c.config, OpUpdateOne, withNoteID(id)) + return &NoteUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Note. +func (c *NoteClient) Delete() *NoteDelete { + mutation := newNoteMutation(c.config, OpDelete) + return &NoteDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *NoteClient) DeleteOne(n *Note) *NoteDeleteOne { + return c.DeleteOneID(n.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *NoteClient) DeleteOneID(id string) *NoteDeleteOne { + builder := c.Delete().Where(note.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &NoteDeleteOne{builder} +} + +// Query returns a query builder for Note. +func (c *NoteClient) Query() *NoteQuery { + return &NoteQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeNote}, + inters: c.Interceptors(), + } +} + +// Get returns a Note entity by its id. +func (c *NoteClient) Get(ctx context.Context, id string) (*Note, error) { + return c.Query().Where(note.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *NoteClient) GetX(ctx context.Context, id string) *Note { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Note. +func (c *NoteClient) QueryOwner(n *Note) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := n.ID + step := sqlgraph.NewStep( + sqlgraph.From(note.Table, note.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, note.OwnerTable, note.OwnerColumn), + ) + schemaConfig := n.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Note + fromV = sqlgraph.Neighbors(n.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntity queries the entity edge of a Note. +func (c *NoteClient) QueryEntity(n *Note) *EntityQuery { + query := (&EntityClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := n.ID + step := sqlgraph.NewStep( + sqlgraph.From(note.Table, note.FieldID, id), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, note.EntityTable, note.EntityColumn), + ) + schemaConfig := n.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Note + fromV = sqlgraph.Neighbors(n.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *NoteClient) Hooks() []Hook { + hooks := c.hooks.Note + return append(hooks[:len(hooks):len(hooks)], note.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *NoteClient) Interceptors() []Interceptor { + inters := c.inters.Note + return append(inters[:len(inters):len(inters)], note.Interceptors[:]...) +} + +func (c *NoteClient) mutate(ctx context.Context, m *NoteMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&NoteCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&NoteUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&NoteUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&NoteDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Note mutation op: %q", m.Op()) + } +} + +// NoteHistoryClient is a client for the NoteHistory schema. +type NoteHistoryClient struct { + config +} + +// NewNoteHistoryClient returns a client for the NoteHistory from the given config. +func NewNoteHistoryClient(c config) *NoteHistoryClient { + return &NoteHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `notehistory.Hooks(f(g(h())))`. +func (c *NoteHistoryClient) Use(hooks ...Hook) { + c.hooks.NoteHistory = append(c.hooks.NoteHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `notehistory.Intercept(f(g(h())))`. +func (c *NoteHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.NoteHistory = append(c.inters.NoteHistory, interceptors...) +} + +// Create returns a builder for creating a NoteHistory entity. +func (c *NoteHistoryClient) Create() *NoteHistoryCreate { + mutation := newNoteHistoryMutation(c.config, OpCreate) + return &NoteHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of NoteHistory entities. +func (c *NoteHistoryClient) CreateBulk(builders ...*NoteHistoryCreate) *NoteHistoryCreateBulk { + return &NoteHistoryCreateBulk{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 *NoteHistoryClient) MapCreateBulk(slice any, setFunc func(*NoteHistoryCreate, int)) *NoteHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &NoteHistoryCreateBulk{err: fmt.Errorf("calling to NoteHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*NoteHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &NoteHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for NoteHistory. +func (c *NoteHistoryClient) Update() *NoteHistoryUpdate { + mutation := newNoteHistoryMutation(c.config, OpUpdate) + return &NoteHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *NoteHistoryClient) UpdateOne(nh *NoteHistory) *NoteHistoryUpdateOne { + mutation := newNoteHistoryMutation(c.config, OpUpdateOne, withNoteHistory(nh)) + return &NoteHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *NoteHistoryClient) UpdateOneID(id string) *NoteHistoryUpdateOne { + mutation := newNoteHistoryMutation(c.config, OpUpdateOne, withNoteHistoryID(id)) + return &NoteHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for NoteHistory. +func (c *NoteHistoryClient) Delete() *NoteHistoryDelete { + mutation := newNoteHistoryMutation(c.config, OpDelete) + return &NoteHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *NoteHistoryClient) DeleteOne(nh *NoteHistory) *NoteHistoryDeleteOne { + return c.DeleteOneID(nh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *NoteHistoryClient) DeleteOneID(id string) *NoteHistoryDeleteOne { + builder := c.Delete().Where(notehistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &NoteHistoryDeleteOne{builder} +} + +// Query returns a query builder for NoteHistory. +func (c *NoteHistoryClient) Query() *NoteHistoryQuery { + return &NoteHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeNoteHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a NoteHistory entity by its id. +func (c *NoteHistoryClient) Get(ctx context.Context, id string) (*NoteHistory, error) { + return c.Query().Where(notehistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *NoteHistoryClient) GetX(ctx context.Context, id string) *NoteHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *NoteHistoryClient) Hooks() []Hook { + hooks := c.hooks.NoteHistory + return append(hooks[:len(hooks):len(hooks)], notehistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *NoteHistoryClient) Interceptors() []Interceptor { + inters := c.inters.NoteHistory + return append(inters[:len(inters):len(inters)], notehistory.Interceptors[:]...) +} + +func (c *NoteHistoryClient) mutate(ctx context.Context, m *NoteHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&NoteHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&NoteHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&NoteHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&NoteHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown NoteHistory mutation op: %q", m.Op()) + } +} + +// OauthProviderClient is a client for the OauthProvider schema. +type OauthProviderClient struct { + config +} + +// NewOauthProviderClient returns a client for the OauthProvider from the given config. +func NewOauthProviderClient(c config) *OauthProviderClient { + return &OauthProviderClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `oauthprovider.Hooks(f(g(h())))`. +func (c *OauthProviderClient) Use(hooks ...Hook) { + c.hooks.OauthProvider = append(c.hooks.OauthProvider, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `oauthprovider.Intercept(f(g(h())))`. +func (c *OauthProviderClient) Intercept(interceptors ...Interceptor) { + c.inters.OauthProvider = append(c.inters.OauthProvider, interceptors...) +} + +// Create returns a builder for creating a OauthProvider entity. +func (c *OauthProviderClient) Create() *OauthProviderCreate { + mutation := newOauthProviderMutation(c.config, OpCreate) + return &OauthProviderCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OauthProvider entities. +func (c *OauthProviderClient) CreateBulk(builders ...*OauthProviderCreate) *OauthProviderCreateBulk { + return &OauthProviderCreateBulk{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 *OauthProviderClient) MapCreateBulk(slice any, setFunc func(*OauthProviderCreate, int)) *OauthProviderCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OauthProviderCreateBulk{err: fmt.Errorf("calling to OauthProviderClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OauthProviderCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OauthProviderCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OauthProvider. +func (c *OauthProviderClient) Update() *OauthProviderUpdate { + mutation := newOauthProviderMutation(c.config, OpUpdate) + return &OauthProviderUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OauthProviderClient) UpdateOne(op *OauthProvider) *OauthProviderUpdateOne { + mutation := newOauthProviderMutation(c.config, OpUpdateOne, withOauthProvider(op)) + return &OauthProviderUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OauthProviderClient) UpdateOneID(id string) *OauthProviderUpdateOne { + mutation := newOauthProviderMutation(c.config, OpUpdateOne, withOauthProviderID(id)) + return &OauthProviderUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OauthProvider. +func (c *OauthProviderClient) Delete() *OauthProviderDelete { + mutation := newOauthProviderMutation(c.config, OpDelete) + return &OauthProviderDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OauthProviderClient) DeleteOne(op *OauthProvider) *OauthProviderDeleteOne { + return c.DeleteOneID(op.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OauthProviderClient) DeleteOneID(id string) *OauthProviderDeleteOne { + builder := c.Delete().Where(oauthprovider.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OauthProviderDeleteOne{builder} +} + +// Query returns a query builder for OauthProvider. +func (c *OauthProviderClient) Query() *OauthProviderQuery { + return &OauthProviderQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOauthProvider}, + inters: c.Interceptors(), + } +} + +// Get returns a OauthProvider entity by its id. +func (c *OauthProviderClient) Get(ctx context.Context, id string) (*OauthProvider, error) { + return c.Query().Where(oauthprovider.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OauthProviderClient) GetX(ctx context.Context, id string) *OauthProvider { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a OauthProvider. +func (c *OauthProviderClient) QueryOwner(op *OauthProvider) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := op.ID + step := sqlgraph.NewStep( + sqlgraph.From(oauthprovider.Table, oauthprovider.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, oauthprovider.OwnerTable, oauthprovider.OwnerColumn), + ) + schemaConfig := op.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OauthProvider + fromV = sqlgraph.Neighbors(op.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *OauthProviderClient) Hooks() []Hook { + hooks := c.hooks.OauthProvider + return append(hooks[:len(hooks):len(hooks)], oauthprovider.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OauthProviderClient) Interceptors() []Interceptor { + inters := c.inters.OauthProvider + return append(inters[:len(inters):len(inters)], oauthprovider.Interceptors[:]...) +} + +func (c *OauthProviderClient) mutate(ctx context.Context, m *OauthProviderMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OauthProviderCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OauthProviderUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OauthProviderUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OauthProviderDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OauthProvider mutation op: %q", m.Op()) + } +} + +// OauthProviderHistoryClient is a client for the OauthProviderHistory schema. +type OauthProviderHistoryClient struct { + config +} + +// NewOauthProviderHistoryClient returns a client for the OauthProviderHistory from the given config. +func NewOauthProviderHistoryClient(c config) *OauthProviderHistoryClient { + return &OauthProviderHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `oauthproviderhistory.Hooks(f(g(h())))`. +func (c *OauthProviderHistoryClient) Use(hooks ...Hook) { + c.hooks.OauthProviderHistory = append(c.hooks.OauthProviderHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `oauthproviderhistory.Intercept(f(g(h())))`. +func (c *OauthProviderHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.OauthProviderHistory = append(c.inters.OauthProviderHistory, interceptors...) +} + +// Create returns a builder for creating a OauthProviderHistory entity. +func (c *OauthProviderHistoryClient) Create() *OauthProviderHistoryCreate { + mutation := newOauthProviderHistoryMutation(c.config, OpCreate) + return &OauthProviderHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OauthProviderHistory entities. +func (c *OauthProviderHistoryClient) CreateBulk(builders ...*OauthProviderHistoryCreate) *OauthProviderHistoryCreateBulk { + return &OauthProviderHistoryCreateBulk{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 *OauthProviderHistoryClient) MapCreateBulk(slice any, setFunc func(*OauthProviderHistoryCreate, int)) *OauthProviderHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OauthProviderHistoryCreateBulk{err: fmt.Errorf("calling to OauthProviderHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OauthProviderHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OauthProviderHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OauthProviderHistory. +func (c *OauthProviderHistoryClient) Update() *OauthProviderHistoryUpdate { + mutation := newOauthProviderHistoryMutation(c.config, OpUpdate) + return &OauthProviderHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OauthProviderHistoryClient) UpdateOne(oph *OauthProviderHistory) *OauthProviderHistoryUpdateOne { + mutation := newOauthProviderHistoryMutation(c.config, OpUpdateOne, withOauthProviderHistory(oph)) + return &OauthProviderHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OauthProviderHistoryClient) UpdateOneID(id string) *OauthProviderHistoryUpdateOne { + mutation := newOauthProviderHistoryMutation(c.config, OpUpdateOne, withOauthProviderHistoryID(id)) + return &OauthProviderHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OauthProviderHistory. +func (c *OauthProviderHistoryClient) Delete() *OauthProviderHistoryDelete { + mutation := newOauthProviderHistoryMutation(c.config, OpDelete) + return &OauthProviderHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OauthProviderHistoryClient) DeleteOne(oph *OauthProviderHistory) *OauthProviderHistoryDeleteOne { + return c.DeleteOneID(oph.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OauthProviderHistoryClient) DeleteOneID(id string) *OauthProviderHistoryDeleteOne { + builder := c.Delete().Where(oauthproviderhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OauthProviderHistoryDeleteOne{builder} +} + +// Query returns a query builder for OauthProviderHistory. +func (c *OauthProviderHistoryClient) Query() *OauthProviderHistoryQuery { + return &OauthProviderHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOauthProviderHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a OauthProviderHistory entity by its id. +func (c *OauthProviderHistoryClient) Get(ctx context.Context, id string) (*OauthProviderHistory, error) { + return c.Query().Where(oauthproviderhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OauthProviderHistoryClient) GetX(ctx context.Context, id string) *OauthProviderHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *OauthProviderHistoryClient) Hooks() []Hook { + hooks := c.hooks.OauthProviderHistory + return append(hooks[:len(hooks):len(hooks)], oauthproviderhistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OauthProviderHistoryClient) Interceptors() []Interceptor { + inters := c.inters.OauthProviderHistory + return append(inters[:len(inters):len(inters)], oauthproviderhistory.Interceptors[:]...) +} + +func (c *OauthProviderHistoryClient) mutate(ctx context.Context, m *OauthProviderHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OauthProviderHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OauthProviderHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OauthProviderHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OauthProviderHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OauthProviderHistory mutation op: %q", m.Op()) + } +} + +// OhAuthTooTokenClient is a client for the OhAuthTooToken schema. +type OhAuthTooTokenClient struct { + config +} + +// NewOhAuthTooTokenClient returns a client for the OhAuthTooToken from the given config. +func NewOhAuthTooTokenClient(c config) *OhAuthTooTokenClient { + return &OhAuthTooTokenClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `ohauthtootoken.Hooks(f(g(h())))`. +func (c *OhAuthTooTokenClient) Use(hooks ...Hook) { + c.hooks.OhAuthTooToken = append(c.hooks.OhAuthTooToken, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `ohauthtootoken.Intercept(f(g(h())))`. +func (c *OhAuthTooTokenClient) Intercept(interceptors ...Interceptor) { + c.inters.OhAuthTooToken = append(c.inters.OhAuthTooToken, interceptors...) +} + +// Create returns a builder for creating a OhAuthTooToken entity. +func (c *OhAuthTooTokenClient) Create() *OhAuthTooTokenCreate { + mutation := newOhAuthTooTokenMutation(c.config, OpCreate) + return &OhAuthTooTokenCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OhAuthTooToken entities. +func (c *OhAuthTooTokenClient) CreateBulk(builders ...*OhAuthTooTokenCreate) *OhAuthTooTokenCreateBulk { + return &OhAuthTooTokenCreateBulk{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 *OhAuthTooTokenClient) MapCreateBulk(slice any, setFunc func(*OhAuthTooTokenCreate, int)) *OhAuthTooTokenCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OhAuthTooTokenCreateBulk{err: fmt.Errorf("calling to OhAuthTooTokenClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OhAuthTooTokenCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OhAuthTooTokenCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OhAuthTooToken. +func (c *OhAuthTooTokenClient) Update() *OhAuthTooTokenUpdate { + mutation := newOhAuthTooTokenMutation(c.config, OpUpdate) + return &OhAuthTooTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OhAuthTooTokenClient) UpdateOne(oatt *OhAuthTooToken) *OhAuthTooTokenUpdateOne { + mutation := newOhAuthTooTokenMutation(c.config, OpUpdateOne, withOhAuthTooToken(oatt)) + return &OhAuthTooTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OhAuthTooTokenClient) UpdateOneID(id string) *OhAuthTooTokenUpdateOne { + mutation := newOhAuthTooTokenMutation(c.config, OpUpdateOne, withOhAuthTooTokenID(id)) + return &OhAuthTooTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OhAuthTooToken. +func (c *OhAuthTooTokenClient) Delete() *OhAuthTooTokenDelete { + mutation := newOhAuthTooTokenMutation(c.config, OpDelete) + return &OhAuthTooTokenDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OhAuthTooTokenClient) DeleteOne(oatt *OhAuthTooToken) *OhAuthTooTokenDeleteOne { + return c.DeleteOneID(oatt.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OhAuthTooTokenClient) DeleteOneID(id string) *OhAuthTooTokenDeleteOne { + builder := c.Delete().Where(ohauthtootoken.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OhAuthTooTokenDeleteOne{builder} +} + +// Query returns a query builder for OhAuthTooToken. +func (c *OhAuthTooTokenClient) Query() *OhAuthTooTokenQuery { + return &OhAuthTooTokenQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOhAuthTooToken}, + inters: c.Interceptors(), + } +} + +// Get returns a OhAuthTooToken entity by its id. +func (c *OhAuthTooTokenClient) Get(ctx context.Context, id string) (*OhAuthTooToken, error) { + return c.Query().Where(ohauthtootoken.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OhAuthTooTokenClient) GetX(ctx context.Context, id string) *OhAuthTooToken { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryIntegration queries the integration edge of a OhAuthTooToken. +func (c *OhAuthTooTokenClient) QueryIntegration(oatt *OhAuthTooToken) *IntegrationQuery { + query := (&IntegrationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := oatt.ID + step := sqlgraph.NewStep( + sqlgraph.From(ohauthtootoken.Table, ohauthtootoken.FieldID, id), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, ohauthtootoken.IntegrationTable, ohauthtootoken.IntegrationPrimaryKey...), + ) + schemaConfig := oatt.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + fromV = sqlgraph.Neighbors(oatt.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a OhAuthTooToken. +func (c *OhAuthTooTokenClient) QueryEvents(oatt *OhAuthTooToken) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := oatt.ID + step := sqlgraph.NewStep( + sqlgraph.From(ohauthtootoken.Table, ohauthtootoken.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, ohauthtootoken.EventsTable, ohauthtootoken.EventsPrimaryKey...), + ) + schemaConfig := oatt.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + fromV = sqlgraph.Neighbors(oatt.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *OhAuthTooTokenClient) Hooks() []Hook { + return c.hooks.OhAuthTooToken +} + +// Interceptors returns the client interceptors. +func (c *OhAuthTooTokenClient) Interceptors() []Interceptor { + return c.inters.OhAuthTooToken +} + +func (c *OhAuthTooTokenClient) mutate(ctx context.Context, m *OhAuthTooTokenMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OhAuthTooTokenCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OhAuthTooTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OhAuthTooTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OhAuthTooTokenDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OhAuthTooToken mutation op: %q", m.Op()) + } +} + +// OrgMembershipClient is a client for the OrgMembership schema. +type OrgMembershipClient struct { + config +} + +// NewOrgMembershipClient returns a client for the OrgMembership from the given config. +func NewOrgMembershipClient(c config) *OrgMembershipClient { + return &OrgMembershipClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `orgmembership.Hooks(f(g(h())))`. +func (c *OrgMembershipClient) Use(hooks ...Hook) { + c.hooks.OrgMembership = append(c.hooks.OrgMembership, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `orgmembership.Intercept(f(g(h())))`. +func (c *OrgMembershipClient) Intercept(interceptors ...Interceptor) { + c.inters.OrgMembership = append(c.inters.OrgMembership, interceptors...) +} + +// Create returns a builder for creating a OrgMembership entity. +func (c *OrgMembershipClient) Create() *OrgMembershipCreate { + mutation := newOrgMembershipMutation(c.config, OpCreate) + return &OrgMembershipCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OrgMembership entities. +func (c *OrgMembershipClient) CreateBulk(builders ...*OrgMembershipCreate) *OrgMembershipCreateBulk { + return &OrgMembershipCreateBulk{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 *OrgMembershipClient) MapCreateBulk(slice any, setFunc func(*OrgMembershipCreate, int)) *OrgMembershipCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OrgMembershipCreateBulk{err: fmt.Errorf("calling to OrgMembershipClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OrgMembershipCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OrgMembershipCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OrgMembership. +func (c *OrgMembershipClient) Update() *OrgMembershipUpdate { + mutation := newOrgMembershipMutation(c.config, OpUpdate) + return &OrgMembershipUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OrgMembershipClient) UpdateOne(om *OrgMembership) *OrgMembershipUpdateOne { + mutation := newOrgMembershipMutation(c.config, OpUpdateOne, withOrgMembership(om)) + return &OrgMembershipUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OrgMembershipClient) UpdateOneID(id string) *OrgMembershipUpdateOne { + mutation := newOrgMembershipMutation(c.config, OpUpdateOne, withOrgMembershipID(id)) + return &OrgMembershipUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OrgMembership. +func (c *OrgMembershipClient) Delete() *OrgMembershipDelete { + mutation := newOrgMembershipMutation(c.config, OpDelete) + return &OrgMembershipDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OrgMembershipClient) DeleteOne(om *OrgMembership) *OrgMembershipDeleteOne { + return c.DeleteOneID(om.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OrgMembershipClient) DeleteOneID(id string) *OrgMembershipDeleteOne { + builder := c.Delete().Where(orgmembership.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OrgMembershipDeleteOne{builder} +} + +// Query returns a query builder for OrgMembership. +func (c *OrgMembershipClient) Query() *OrgMembershipQuery { + return &OrgMembershipQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOrgMembership}, + inters: c.Interceptors(), + } +} + +// Get returns a OrgMembership entity by its id. +func (c *OrgMembershipClient) Get(ctx context.Context, id string) (*OrgMembership, error) { + return c.Query().Where(orgmembership.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OrgMembershipClient) GetX(ctx context.Context, id string) *OrgMembership { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOrganization queries the organization edge of a OrgMembership. +func (c *OrgMembershipClient) QueryOrganization(om *OrgMembership) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := om.ID + step := sqlgraph.NewStep( + sqlgraph.From(orgmembership.Table, orgmembership.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, orgmembership.OrganizationTable, orgmembership.OrganizationColumn), + ) + schemaConfig := om.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + fromV = sqlgraph.Neighbors(om.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryUser queries the user edge of a OrgMembership. +func (c *OrgMembershipClient) QueryUser(om *OrgMembership) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := om.ID + step := sqlgraph.NewStep( + sqlgraph.From(orgmembership.Table, orgmembership.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, orgmembership.UserTable, orgmembership.UserColumn), + ) + schemaConfig := om.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + fromV = sqlgraph.Neighbors(om.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a OrgMembership. +func (c *OrgMembershipClient) QueryEvents(om *OrgMembership) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := om.ID + step := sqlgraph.NewStep( + sqlgraph.From(orgmembership.Table, orgmembership.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, orgmembership.EventsTable, orgmembership.EventsPrimaryKey...), + ) + schemaConfig := om.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrgMembershipEvents + fromV = sqlgraph.Neighbors(om.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *OrgMembershipClient) Hooks() []Hook { + hooks := c.hooks.OrgMembership + return append(hooks[:len(hooks):len(hooks)], orgmembership.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OrgMembershipClient) Interceptors() []Interceptor { + inters := c.inters.OrgMembership + return append(inters[:len(inters):len(inters)], orgmembership.Interceptors[:]...) +} + +func (c *OrgMembershipClient) mutate(ctx context.Context, m *OrgMembershipMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OrgMembershipCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OrgMembershipUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OrgMembershipUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OrgMembershipDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OrgMembership mutation op: %q", m.Op()) + } +} + +// OrgMembershipHistoryClient is a client for the OrgMembershipHistory schema. +type OrgMembershipHistoryClient struct { + config +} + +// NewOrgMembershipHistoryClient returns a client for the OrgMembershipHistory from the given config. +func NewOrgMembershipHistoryClient(c config) *OrgMembershipHistoryClient { + return &OrgMembershipHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `orgmembershiphistory.Hooks(f(g(h())))`. +func (c *OrgMembershipHistoryClient) Use(hooks ...Hook) { + c.hooks.OrgMembershipHistory = append(c.hooks.OrgMembershipHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `orgmembershiphistory.Intercept(f(g(h())))`. +func (c *OrgMembershipHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.OrgMembershipHistory = append(c.inters.OrgMembershipHistory, interceptors...) +} + +// Create returns a builder for creating a OrgMembershipHistory entity. +func (c *OrgMembershipHistoryClient) Create() *OrgMembershipHistoryCreate { + mutation := newOrgMembershipHistoryMutation(c.config, OpCreate) + return &OrgMembershipHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OrgMembershipHistory entities. +func (c *OrgMembershipHistoryClient) CreateBulk(builders ...*OrgMembershipHistoryCreate) *OrgMembershipHistoryCreateBulk { + return &OrgMembershipHistoryCreateBulk{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 *OrgMembershipHistoryClient) MapCreateBulk(slice any, setFunc func(*OrgMembershipHistoryCreate, int)) *OrgMembershipHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OrgMembershipHistoryCreateBulk{err: fmt.Errorf("calling to OrgMembershipHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OrgMembershipHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OrgMembershipHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OrgMembershipHistory. +func (c *OrgMembershipHistoryClient) Update() *OrgMembershipHistoryUpdate { + mutation := newOrgMembershipHistoryMutation(c.config, OpUpdate) + return &OrgMembershipHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OrgMembershipHistoryClient) UpdateOne(omh *OrgMembershipHistory) *OrgMembershipHistoryUpdateOne { + mutation := newOrgMembershipHistoryMutation(c.config, OpUpdateOne, withOrgMembershipHistory(omh)) + return &OrgMembershipHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OrgMembershipHistoryClient) UpdateOneID(id string) *OrgMembershipHistoryUpdateOne { + mutation := newOrgMembershipHistoryMutation(c.config, OpUpdateOne, withOrgMembershipHistoryID(id)) + return &OrgMembershipHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OrgMembershipHistory. +func (c *OrgMembershipHistoryClient) Delete() *OrgMembershipHistoryDelete { + mutation := newOrgMembershipHistoryMutation(c.config, OpDelete) + return &OrgMembershipHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OrgMembershipHistoryClient) DeleteOne(omh *OrgMembershipHistory) *OrgMembershipHistoryDeleteOne { + return c.DeleteOneID(omh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OrgMembershipHistoryClient) DeleteOneID(id string) *OrgMembershipHistoryDeleteOne { + builder := c.Delete().Where(orgmembershiphistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OrgMembershipHistoryDeleteOne{builder} +} + +// Query returns a query builder for OrgMembershipHistory. +func (c *OrgMembershipHistoryClient) Query() *OrgMembershipHistoryQuery { + return &OrgMembershipHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOrgMembershipHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a OrgMembershipHistory entity by its id. +func (c *OrgMembershipHistoryClient) Get(ctx context.Context, id string) (*OrgMembershipHistory, error) { + return c.Query().Where(orgmembershiphistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OrgMembershipHistoryClient) GetX(ctx context.Context, id string) *OrgMembershipHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *OrgMembershipHistoryClient) Hooks() []Hook { + hooks := c.hooks.OrgMembershipHistory + return append(hooks[:len(hooks):len(hooks)], orgmembershiphistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OrgMembershipHistoryClient) Interceptors() []Interceptor { + inters := c.inters.OrgMembershipHistory + return append(inters[:len(inters):len(inters)], orgmembershiphistory.Interceptors[:]...) +} + +func (c *OrgMembershipHistoryClient) mutate(ctx context.Context, m *OrgMembershipHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OrgMembershipHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OrgMembershipHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OrgMembershipHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OrgMembershipHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OrgMembershipHistory mutation op: %q", m.Op()) + } +} + +// OrganizationClient is a client for the Organization schema. +type OrganizationClient struct { + config +} + +// NewOrganizationClient returns a client for the Organization from the given config. +func NewOrganizationClient(c config) *OrganizationClient { + return &OrganizationClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `organization.Hooks(f(g(h())))`. +func (c *OrganizationClient) Use(hooks ...Hook) { + c.hooks.Organization = append(c.hooks.Organization, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `organization.Intercept(f(g(h())))`. +func (c *OrganizationClient) Intercept(interceptors ...Interceptor) { + c.inters.Organization = append(c.inters.Organization, interceptors...) +} + +// Create returns a builder for creating a Organization entity. +func (c *OrganizationClient) Create() *OrganizationCreate { + mutation := newOrganizationMutation(c.config, OpCreate) + return &OrganizationCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Organization entities. +func (c *OrganizationClient) CreateBulk(builders ...*OrganizationCreate) *OrganizationCreateBulk { + return &OrganizationCreateBulk{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 *OrganizationClient) MapCreateBulk(slice any, setFunc func(*OrganizationCreate, int)) *OrganizationCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OrganizationCreateBulk{err: fmt.Errorf("calling to OrganizationClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OrganizationCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OrganizationCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Organization. +func (c *OrganizationClient) Update() *OrganizationUpdate { + mutation := newOrganizationMutation(c.config, OpUpdate) + return &OrganizationUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OrganizationClient) UpdateOne(o *Organization) *OrganizationUpdateOne { + mutation := newOrganizationMutation(c.config, OpUpdateOne, withOrganization(o)) + return &OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OrganizationClient) UpdateOneID(id string) *OrganizationUpdateOne { + mutation := newOrganizationMutation(c.config, OpUpdateOne, withOrganizationID(id)) + return &OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Organization. +func (c *OrganizationClient) Delete() *OrganizationDelete { + mutation := newOrganizationMutation(c.config, OpDelete) + return &OrganizationDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OrganizationClient) DeleteOne(o *Organization) *OrganizationDeleteOne { + return c.DeleteOneID(o.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OrganizationClient) DeleteOneID(id string) *OrganizationDeleteOne { + builder := c.Delete().Where(organization.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OrganizationDeleteOne{builder} +} + +// Query returns a query builder for Organization. +func (c *OrganizationClient) Query() *OrganizationQuery { + return &OrganizationQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOrganization}, + inters: c.Interceptors(), + } +} + +// Get returns a Organization entity by its id. +func (c *OrganizationClient) Get(ctx context.Context, id string) (*Organization, error) { + return c.Query().Where(organization.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OrganizationClient) GetX(ctx context.Context, id string) *Organization { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryParent queries the parent edge of a Organization. +func (c *OrganizationClient) QueryParent(o *Organization) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, organization.ParentTable, organization.ParentColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryChildren queries the children edge of a Organization. +func (c *OrganizationClient) QueryChildren(o *Organization) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.ChildrenTable, organization.ChildrenColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryGroups queries the groups edge of a Organization. +func (c *OrganizationClient) QueryGroups(o *Organization) *GroupQuery { + query := (&GroupClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.GroupsTable, organization.GroupsColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.Group + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryTemplates queries the templates edge of a Organization. +func (c *OrganizationClient) QueryTemplates(o *Organization) *TemplateQuery { + query := (&TemplateClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(template.Table, template.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.TemplatesTable, organization.TemplatesColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.Template + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryIntegrations queries the integrations edge of a Organization. +func (c *OrganizationClient) QueryIntegrations(o *Organization) *IntegrationQuery { + query := (&IntegrationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.IntegrationsTable, organization.IntegrationsColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QuerySetting queries the setting edge of a Organization. +func (c *OrganizationClient) QuerySetting(o *Organization) *OrganizationSettingQuery { + query := (&OrganizationSettingClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(organizationsetting.Table, organizationsetting.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, organization.SettingTable, organization.SettingColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.OrganizationSetting + step.Edge.Schema = schemaConfig.OrganizationSetting + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryDocumentdata queries the documentdata edge of a Organization. +func (c *OrganizationClient) QueryDocumentdata(o *Organization) *DocumentDataQuery { + query := (&DocumentDataClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(documentdata.Table, documentdata.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.DocumentdataTable, organization.DocumentdataColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitlements queries the entitlements edge of a Organization. +func (c *OrganizationClient) QueryEntitlements(o *Organization) *EntitlementQuery { + query := (&EntitlementClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitlementsTable, organization.EntitlementsColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrganizationEntitlement queries the organization_entitlement edge of a Organization. +func (c *OrganizationClient) QueryOrganizationEntitlement(o *Organization) *EntitlementQuery { + query := (&EntitlementClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.OrganizationEntitlementTable, organization.OrganizationEntitlementColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryPersonalAccessTokens queries the personal_access_tokens edge of a Organization. +func (c *OrganizationClient) QueryPersonalAccessTokens(o *Organization) *PersonalAccessTokenQuery { + query := (&PersonalAccessTokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(personalaccesstoken.Table, personalaccesstoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.PersonalAccessTokensTable, organization.PersonalAccessTokensPrimaryKey...), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryAPITokens queries the api_tokens edge of a Organization. +func (c *OrganizationClient) QueryAPITokens(o *Organization) *APITokenQuery { + query := (&APITokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(apitoken.Table, apitoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.APITokensTable, organization.APITokensColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.APIToken + step.Edge.Schema = schemaConfig.APIToken + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOauthprovider queries the oauthprovider edge of a Organization. +func (c *OrganizationClient) QueryOauthprovider(o *Organization) *OauthProviderQuery { + query := (&OauthProviderClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(oauthprovider.Table, oauthprovider.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.OauthproviderTable, organization.OauthproviderColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.OauthProvider + step.Edge.Schema = schemaConfig.OauthProvider + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryUsers queries the users edge of a Organization. +func (c *OrganizationClient) QueryUsers(o *Organization) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, organization.UsersTable, organization.UsersPrimaryKey...), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryInvites queries the invites edge of a Organization. +func (c *OrganizationClient) QueryInvites(o *Organization) *InviteQuery { + query := (&InviteClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(invite.Table, invite.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.InvitesTable, organization.InvitesColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.Invite + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QuerySubscribers queries the subscribers edge of a Organization. +func (c *OrganizationClient) QuerySubscribers(o *Organization) *SubscriberQuery { + query := (&SubscriberClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(subscriber.Table, subscriber.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.SubscribersTable, organization.SubscribersColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.Subscriber + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryWebhooks queries the webhooks edge of a Organization. +func (c *OrganizationClient) QueryWebhooks(o *Organization) *WebhookQuery { + query := (&WebhookClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(webhook.Table, webhook.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.WebhooksTable, organization.WebhooksColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.Webhook + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Organization. +func (c *OrganizationClient) QueryEvents(o *Organization) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.EventsTable, organization.EventsPrimaryKey...), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrganizationEvents + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QuerySecrets queries the secrets edge of a Organization. +func (c *OrganizationClient) QuerySecrets(o *Organization) *HushQuery { + query := (&HushClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(hush.Table, hush.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.SecretsTable, organization.SecretsPrimaryKey...), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.OrganizationSecrets + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFeatures queries the features edge of a Organization. +func (c *OrganizationClient) QueryFeatures(o *Organization) *FeatureQuery { + query := (&FeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.FeaturesTable, organization.FeaturesColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.Feature + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFiles queries the files edge of a Organization. +func (c *OrganizationClient) QueryFiles(o *Organization) *FileQuery { + query := (&FileClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.FilesTable, organization.FilesPrimaryKey...), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.OrganizationFiles + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitlementplans queries the entitlementplans edge of a Organization. +func (c *OrganizationClient) QueryEntitlementplans(o *Organization) *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitlementplansTable, organization.EntitlementplansColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlan + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitlementplanfeatures queries the entitlementplanfeatures edge of a Organization. +func (c *OrganizationClient) QueryEntitlementplanfeatures(o *Organization) *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitlementplanfeaturesTable, organization.EntitlementplanfeaturesColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntities queries the entities edge of a Organization. +func (c *OrganizationClient) QueryEntities(o *Organization) *EntityQuery { + query := (&EntityClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitiesTable, organization.EntitiesColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEntitytypes queries the entitytypes edge of a Organization. +func (c *OrganizationClient) QueryEntitytypes(o *Organization) *EntityTypeQuery { + query := (&EntityTypeClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(entitytype.Table, entitytype.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitytypesTable, organization.EntitytypesColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.EntityType + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryContacts queries the contacts edge of a Organization. +func (c *OrganizationClient) QueryContacts(o *Organization) *ContactQuery { + query := (&ContactClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(contact.Table, contact.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.ContactsTable, organization.ContactsColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.Contact + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryNotes queries the notes edge of a Organization. +func (c *OrganizationClient) QueryNotes(o *Organization) *NoteQuery { + query := (&NoteClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(note.Table, note.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.NotesTable, organization.NotesColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryMembers queries the members edge of a Organization. +func (c *OrganizationClient) QueryMembers(o *Organization) *OrgMembershipQuery { + query := (&OrgMembershipClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := o.ID + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, id), + sqlgraph.To(orgmembership.Table, orgmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, organization.MembersTable, organization.MembersColumn), + ) + schemaConfig := o.schemaConfig + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + fromV = sqlgraph.Neighbors(o.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *OrganizationClient) Hooks() []Hook { + hooks := c.hooks.Organization + return append(hooks[:len(hooks):len(hooks)], organization.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OrganizationClient) Interceptors() []Interceptor { + inters := c.inters.Organization + return append(inters[:len(inters):len(inters)], organization.Interceptors[:]...) +} + +func (c *OrganizationClient) mutate(ctx context.Context, m *OrganizationMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OrganizationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OrganizationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OrganizationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Organization mutation op: %q", m.Op()) + } +} + +// OrganizationHistoryClient is a client for the OrganizationHistory schema. +type OrganizationHistoryClient struct { + config +} + +// NewOrganizationHistoryClient returns a client for the OrganizationHistory from the given config. +func NewOrganizationHistoryClient(c config) *OrganizationHistoryClient { + return &OrganizationHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `organizationhistory.Hooks(f(g(h())))`. +func (c *OrganizationHistoryClient) Use(hooks ...Hook) { + c.hooks.OrganizationHistory = append(c.hooks.OrganizationHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `organizationhistory.Intercept(f(g(h())))`. +func (c *OrganizationHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.OrganizationHistory = append(c.inters.OrganizationHistory, interceptors...) +} + +// Create returns a builder for creating a OrganizationHistory entity. +func (c *OrganizationHistoryClient) Create() *OrganizationHistoryCreate { + mutation := newOrganizationHistoryMutation(c.config, OpCreate) + return &OrganizationHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OrganizationHistory entities. +func (c *OrganizationHistoryClient) CreateBulk(builders ...*OrganizationHistoryCreate) *OrganizationHistoryCreateBulk { + return &OrganizationHistoryCreateBulk{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 *OrganizationHistoryClient) MapCreateBulk(slice any, setFunc func(*OrganizationHistoryCreate, int)) *OrganizationHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OrganizationHistoryCreateBulk{err: fmt.Errorf("calling to OrganizationHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OrganizationHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OrganizationHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OrganizationHistory. +func (c *OrganizationHistoryClient) Update() *OrganizationHistoryUpdate { + mutation := newOrganizationHistoryMutation(c.config, OpUpdate) + return &OrganizationHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OrganizationHistoryClient) UpdateOne(oh *OrganizationHistory) *OrganizationHistoryUpdateOne { + mutation := newOrganizationHistoryMutation(c.config, OpUpdateOne, withOrganizationHistory(oh)) + return &OrganizationHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OrganizationHistoryClient) UpdateOneID(id string) *OrganizationHistoryUpdateOne { + mutation := newOrganizationHistoryMutation(c.config, OpUpdateOne, withOrganizationHistoryID(id)) + return &OrganizationHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OrganizationHistory. +func (c *OrganizationHistoryClient) Delete() *OrganizationHistoryDelete { + mutation := newOrganizationHistoryMutation(c.config, OpDelete) + return &OrganizationHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OrganizationHistoryClient) DeleteOne(oh *OrganizationHistory) *OrganizationHistoryDeleteOne { + return c.DeleteOneID(oh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OrganizationHistoryClient) DeleteOneID(id string) *OrganizationHistoryDeleteOne { + builder := c.Delete().Where(organizationhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OrganizationHistoryDeleteOne{builder} +} + +// Query returns a query builder for OrganizationHistory. +func (c *OrganizationHistoryClient) Query() *OrganizationHistoryQuery { + return &OrganizationHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOrganizationHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a OrganizationHistory entity by its id. +func (c *OrganizationHistoryClient) Get(ctx context.Context, id string) (*OrganizationHistory, error) { + return c.Query().Where(organizationhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OrganizationHistoryClient) GetX(ctx context.Context, id string) *OrganizationHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *OrganizationHistoryClient) Hooks() []Hook { + hooks := c.hooks.OrganizationHistory + return append(hooks[:len(hooks):len(hooks)], organizationhistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OrganizationHistoryClient) Interceptors() []Interceptor { + inters := c.inters.OrganizationHistory + return append(inters[:len(inters):len(inters)], organizationhistory.Interceptors[:]...) +} + +func (c *OrganizationHistoryClient) mutate(ctx context.Context, m *OrganizationHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OrganizationHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OrganizationHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OrganizationHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OrganizationHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OrganizationHistory mutation op: %q", m.Op()) + } +} + +// OrganizationSettingClient is a client for the OrganizationSetting schema. +type OrganizationSettingClient struct { + config +} + +// NewOrganizationSettingClient returns a client for the OrganizationSetting from the given config. +func NewOrganizationSettingClient(c config) *OrganizationSettingClient { + return &OrganizationSettingClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `organizationsetting.Hooks(f(g(h())))`. +func (c *OrganizationSettingClient) Use(hooks ...Hook) { + c.hooks.OrganizationSetting = append(c.hooks.OrganizationSetting, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `organizationsetting.Intercept(f(g(h())))`. +func (c *OrganizationSettingClient) Intercept(interceptors ...Interceptor) { + c.inters.OrganizationSetting = append(c.inters.OrganizationSetting, interceptors...) +} + +// Create returns a builder for creating a OrganizationSetting entity. +func (c *OrganizationSettingClient) Create() *OrganizationSettingCreate { + mutation := newOrganizationSettingMutation(c.config, OpCreate) + return &OrganizationSettingCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OrganizationSetting entities. +func (c *OrganizationSettingClient) CreateBulk(builders ...*OrganizationSettingCreate) *OrganizationSettingCreateBulk { + return &OrganizationSettingCreateBulk{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 *OrganizationSettingClient) MapCreateBulk(slice any, setFunc func(*OrganizationSettingCreate, int)) *OrganizationSettingCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OrganizationSettingCreateBulk{err: fmt.Errorf("calling to OrganizationSettingClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OrganizationSettingCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OrganizationSettingCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OrganizationSetting. +func (c *OrganizationSettingClient) Update() *OrganizationSettingUpdate { + mutation := newOrganizationSettingMutation(c.config, OpUpdate) + return &OrganizationSettingUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OrganizationSettingClient) UpdateOne(os *OrganizationSetting) *OrganizationSettingUpdateOne { + mutation := newOrganizationSettingMutation(c.config, OpUpdateOne, withOrganizationSetting(os)) + return &OrganizationSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OrganizationSettingClient) UpdateOneID(id string) *OrganizationSettingUpdateOne { + mutation := newOrganizationSettingMutation(c.config, OpUpdateOne, withOrganizationSettingID(id)) + return &OrganizationSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OrganizationSetting. +func (c *OrganizationSettingClient) Delete() *OrganizationSettingDelete { + mutation := newOrganizationSettingMutation(c.config, OpDelete) + return &OrganizationSettingDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OrganizationSettingClient) DeleteOne(os *OrganizationSetting) *OrganizationSettingDeleteOne { + return c.DeleteOneID(os.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OrganizationSettingClient) DeleteOneID(id string) *OrganizationSettingDeleteOne { + builder := c.Delete().Where(organizationsetting.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OrganizationSettingDeleteOne{builder} +} + +// Query returns a query builder for OrganizationSetting. +func (c *OrganizationSettingClient) Query() *OrganizationSettingQuery { + return &OrganizationSettingQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOrganizationSetting}, + inters: c.Interceptors(), + } +} + +// Get returns a OrganizationSetting entity by its id. +func (c *OrganizationSettingClient) Get(ctx context.Context, id string) (*OrganizationSetting, error) { + return c.Query().Where(organizationsetting.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OrganizationSettingClient) GetX(ctx context.Context, id string) *OrganizationSetting { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOrganization queries the organization edge of a OrganizationSetting. +func (c *OrganizationSettingClient) QueryOrganization(os *OrganizationSetting) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := os.ID + step := sqlgraph.NewStep( + sqlgraph.From(organizationsetting.Table, organizationsetting.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, organizationsetting.OrganizationTable, organizationsetting.OrganizationColumn), + ) + schemaConfig := os.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSetting + fromV = sqlgraph.Neighbors(os.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *OrganizationSettingClient) Hooks() []Hook { + hooks := c.hooks.OrganizationSetting + return append(hooks[:len(hooks):len(hooks)], organizationsetting.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OrganizationSettingClient) Interceptors() []Interceptor { + inters := c.inters.OrganizationSetting + return append(inters[:len(inters):len(inters)], organizationsetting.Interceptors[:]...) +} + +func (c *OrganizationSettingClient) mutate(ctx context.Context, m *OrganizationSettingMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OrganizationSettingCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OrganizationSettingUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OrganizationSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OrganizationSettingDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OrganizationSetting mutation op: %q", m.Op()) + } +} + +// OrganizationSettingHistoryClient is a client for the OrganizationSettingHistory schema. +type OrganizationSettingHistoryClient struct { + config +} + +// NewOrganizationSettingHistoryClient returns a client for the OrganizationSettingHistory from the given config. +func NewOrganizationSettingHistoryClient(c config) *OrganizationSettingHistoryClient { + return &OrganizationSettingHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `organizationsettinghistory.Hooks(f(g(h())))`. +func (c *OrganizationSettingHistoryClient) Use(hooks ...Hook) { + c.hooks.OrganizationSettingHistory = append(c.hooks.OrganizationSettingHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `organizationsettinghistory.Intercept(f(g(h())))`. +func (c *OrganizationSettingHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.OrganizationSettingHistory = append(c.inters.OrganizationSettingHistory, interceptors...) +} + +// Create returns a builder for creating a OrganizationSettingHistory entity. +func (c *OrganizationSettingHistoryClient) Create() *OrganizationSettingHistoryCreate { + mutation := newOrganizationSettingHistoryMutation(c.config, OpCreate) + return &OrganizationSettingHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of OrganizationSettingHistory entities. +func (c *OrganizationSettingHistoryClient) CreateBulk(builders ...*OrganizationSettingHistoryCreate) *OrganizationSettingHistoryCreateBulk { + return &OrganizationSettingHistoryCreateBulk{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 *OrganizationSettingHistoryClient) MapCreateBulk(slice any, setFunc func(*OrganizationSettingHistoryCreate, int)) *OrganizationSettingHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &OrganizationSettingHistoryCreateBulk{err: fmt.Errorf("calling to OrganizationSettingHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*OrganizationSettingHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &OrganizationSettingHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for OrganizationSettingHistory. +func (c *OrganizationSettingHistoryClient) Update() *OrganizationSettingHistoryUpdate { + mutation := newOrganizationSettingHistoryMutation(c.config, OpUpdate) + return &OrganizationSettingHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *OrganizationSettingHistoryClient) UpdateOne(osh *OrganizationSettingHistory) *OrganizationSettingHistoryUpdateOne { + mutation := newOrganizationSettingHistoryMutation(c.config, OpUpdateOne, withOrganizationSettingHistory(osh)) + return &OrganizationSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *OrganizationSettingHistoryClient) UpdateOneID(id string) *OrganizationSettingHistoryUpdateOne { + mutation := newOrganizationSettingHistoryMutation(c.config, OpUpdateOne, withOrganizationSettingHistoryID(id)) + return &OrganizationSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for OrganizationSettingHistory. +func (c *OrganizationSettingHistoryClient) Delete() *OrganizationSettingHistoryDelete { + mutation := newOrganizationSettingHistoryMutation(c.config, OpDelete) + return &OrganizationSettingHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *OrganizationSettingHistoryClient) DeleteOne(osh *OrganizationSettingHistory) *OrganizationSettingHistoryDeleteOne { + return c.DeleteOneID(osh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *OrganizationSettingHistoryClient) DeleteOneID(id string) *OrganizationSettingHistoryDeleteOne { + builder := c.Delete().Where(organizationsettinghistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &OrganizationSettingHistoryDeleteOne{builder} +} + +// Query returns a query builder for OrganizationSettingHistory. +func (c *OrganizationSettingHistoryClient) Query() *OrganizationSettingHistoryQuery { + return &OrganizationSettingHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeOrganizationSettingHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a OrganizationSettingHistory entity by its id. +func (c *OrganizationSettingHistoryClient) Get(ctx context.Context, id string) (*OrganizationSettingHistory, error) { + return c.Query().Where(organizationsettinghistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *OrganizationSettingHistoryClient) GetX(ctx context.Context, id string) *OrganizationSettingHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *OrganizationSettingHistoryClient) Hooks() []Hook { + hooks := c.hooks.OrganizationSettingHistory + return append(hooks[:len(hooks):len(hooks)], organizationsettinghistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *OrganizationSettingHistoryClient) Interceptors() []Interceptor { + inters := c.inters.OrganizationSettingHistory + return append(inters[:len(inters):len(inters)], organizationsettinghistory.Interceptors[:]...) +} + +func (c *OrganizationSettingHistoryClient) mutate(ctx context.Context, m *OrganizationSettingHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&OrganizationSettingHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&OrganizationSettingHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&OrganizationSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&OrganizationSettingHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown OrganizationSettingHistory mutation op: %q", m.Op()) + } +} + +// PasswordResetTokenClient is a client for the PasswordResetToken schema. +type PasswordResetTokenClient struct { + config +} + +// NewPasswordResetTokenClient returns a client for the PasswordResetToken from the given config. +func NewPasswordResetTokenClient(c config) *PasswordResetTokenClient { + return &PasswordResetTokenClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `passwordresettoken.Hooks(f(g(h())))`. +func (c *PasswordResetTokenClient) Use(hooks ...Hook) { + c.hooks.PasswordResetToken = append(c.hooks.PasswordResetToken, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `passwordresettoken.Intercept(f(g(h())))`. +func (c *PasswordResetTokenClient) Intercept(interceptors ...Interceptor) { + c.inters.PasswordResetToken = append(c.inters.PasswordResetToken, interceptors...) +} + +// Create returns a builder for creating a PasswordResetToken entity. +func (c *PasswordResetTokenClient) Create() *PasswordResetTokenCreate { + mutation := newPasswordResetTokenMutation(c.config, OpCreate) + return &PasswordResetTokenCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of PasswordResetToken entities. +func (c *PasswordResetTokenClient) CreateBulk(builders ...*PasswordResetTokenCreate) *PasswordResetTokenCreateBulk { + return &PasswordResetTokenCreateBulk{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 *PasswordResetTokenClient) MapCreateBulk(slice any, setFunc func(*PasswordResetTokenCreate, int)) *PasswordResetTokenCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &PasswordResetTokenCreateBulk{err: fmt.Errorf("calling to PasswordResetTokenClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*PasswordResetTokenCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &PasswordResetTokenCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for PasswordResetToken. +func (c *PasswordResetTokenClient) Update() *PasswordResetTokenUpdate { + mutation := newPasswordResetTokenMutation(c.config, OpUpdate) + return &PasswordResetTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *PasswordResetTokenClient) UpdateOne(prt *PasswordResetToken) *PasswordResetTokenUpdateOne { + mutation := newPasswordResetTokenMutation(c.config, OpUpdateOne, withPasswordResetToken(prt)) + return &PasswordResetTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *PasswordResetTokenClient) UpdateOneID(id string) *PasswordResetTokenUpdateOne { + mutation := newPasswordResetTokenMutation(c.config, OpUpdateOne, withPasswordResetTokenID(id)) + return &PasswordResetTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for PasswordResetToken. +func (c *PasswordResetTokenClient) Delete() *PasswordResetTokenDelete { + mutation := newPasswordResetTokenMutation(c.config, OpDelete) + return &PasswordResetTokenDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *PasswordResetTokenClient) DeleteOne(prt *PasswordResetToken) *PasswordResetTokenDeleteOne { + return c.DeleteOneID(prt.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *PasswordResetTokenClient) DeleteOneID(id string) *PasswordResetTokenDeleteOne { + builder := c.Delete().Where(passwordresettoken.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &PasswordResetTokenDeleteOne{builder} +} + +// Query returns a query builder for PasswordResetToken. +func (c *PasswordResetTokenClient) Query() *PasswordResetTokenQuery { + return &PasswordResetTokenQuery{ + config: c.config, + ctx: &QueryContext{Type: TypePasswordResetToken}, + inters: c.Interceptors(), + } +} + +// Get returns a PasswordResetToken entity by its id. +func (c *PasswordResetTokenClient) Get(ctx context.Context, id string) (*PasswordResetToken, error) { + return c.Query().Where(passwordresettoken.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *PasswordResetTokenClient) GetX(ctx context.Context, id string) *PasswordResetToken { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a PasswordResetToken. +func (c *PasswordResetTokenClient) QueryOwner(prt *PasswordResetToken) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := prt.ID + step := sqlgraph.NewStep( + sqlgraph.From(passwordresettoken.Table, passwordresettoken.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, passwordresettoken.OwnerTable, passwordresettoken.OwnerColumn), + ) + schemaConfig := prt.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PasswordResetToken + fromV = sqlgraph.Neighbors(prt.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *PasswordResetTokenClient) Hooks() []Hook { + hooks := c.hooks.PasswordResetToken + return append(hooks[:len(hooks):len(hooks)], passwordresettoken.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *PasswordResetTokenClient) Interceptors() []Interceptor { + inters := c.inters.PasswordResetToken + return append(inters[:len(inters):len(inters)], passwordresettoken.Interceptors[:]...) +} + +func (c *PasswordResetTokenClient) mutate(ctx context.Context, m *PasswordResetTokenMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&PasswordResetTokenCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&PasswordResetTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&PasswordResetTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&PasswordResetTokenDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown PasswordResetToken mutation op: %q", m.Op()) + } +} + +// PersonalAccessTokenClient is a client for the PersonalAccessToken schema. +type PersonalAccessTokenClient struct { + config +} + +// NewPersonalAccessTokenClient returns a client for the PersonalAccessToken from the given config. +func NewPersonalAccessTokenClient(c config) *PersonalAccessTokenClient { + return &PersonalAccessTokenClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `personalaccesstoken.Hooks(f(g(h())))`. +func (c *PersonalAccessTokenClient) Use(hooks ...Hook) { + c.hooks.PersonalAccessToken = append(c.hooks.PersonalAccessToken, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `personalaccesstoken.Intercept(f(g(h())))`. +func (c *PersonalAccessTokenClient) Intercept(interceptors ...Interceptor) { + c.inters.PersonalAccessToken = append(c.inters.PersonalAccessToken, interceptors...) +} + +// Create returns a builder for creating a PersonalAccessToken entity. +func (c *PersonalAccessTokenClient) Create() *PersonalAccessTokenCreate { + mutation := newPersonalAccessTokenMutation(c.config, OpCreate) + return &PersonalAccessTokenCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of PersonalAccessToken entities. +func (c *PersonalAccessTokenClient) CreateBulk(builders ...*PersonalAccessTokenCreate) *PersonalAccessTokenCreateBulk { + return &PersonalAccessTokenCreateBulk{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 *PersonalAccessTokenClient) MapCreateBulk(slice any, setFunc func(*PersonalAccessTokenCreate, int)) *PersonalAccessTokenCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &PersonalAccessTokenCreateBulk{err: fmt.Errorf("calling to PersonalAccessTokenClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*PersonalAccessTokenCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &PersonalAccessTokenCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for PersonalAccessToken. +func (c *PersonalAccessTokenClient) Update() *PersonalAccessTokenUpdate { + mutation := newPersonalAccessTokenMutation(c.config, OpUpdate) + return &PersonalAccessTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *PersonalAccessTokenClient) UpdateOne(pat *PersonalAccessToken) *PersonalAccessTokenUpdateOne { + mutation := newPersonalAccessTokenMutation(c.config, OpUpdateOne, withPersonalAccessToken(pat)) + return &PersonalAccessTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *PersonalAccessTokenClient) UpdateOneID(id string) *PersonalAccessTokenUpdateOne { + mutation := newPersonalAccessTokenMutation(c.config, OpUpdateOne, withPersonalAccessTokenID(id)) + return &PersonalAccessTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for PersonalAccessToken. +func (c *PersonalAccessTokenClient) Delete() *PersonalAccessTokenDelete { + mutation := newPersonalAccessTokenMutation(c.config, OpDelete) + return &PersonalAccessTokenDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *PersonalAccessTokenClient) DeleteOne(pat *PersonalAccessToken) *PersonalAccessTokenDeleteOne { + return c.DeleteOneID(pat.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *PersonalAccessTokenClient) DeleteOneID(id string) *PersonalAccessTokenDeleteOne { + builder := c.Delete().Where(personalaccesstoken.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &PersonalAccessTokenDeleteOne{builder} +} + +// Query returns a query builder for PersonalAccessToken. +func (c *PersonalAccessTokenClient) Query() *PersonalAccessTokenQuery { + return &PersonalAccessTokenQuery{ + config: c.config, + ctx: &QueryContext{Type: TypePersonalAccessToken}, + inters: c.Interceptors(), + } +} + +// Get returns a PersonalAccessToken entity by its id. +func (c *PersonalAccessTokenClient) Get(ctx context.Context, id string) (*PersonalAccessToken, error) { + return c.Query().Where(personalaccesstoken.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *PersonalAccessTokenClient) GetX(ctx context.Context, id string) *PersonalAccessToken { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a PersonalAccessToken. +func (c *PersonalAccessTokenClient) QueryOwner(pat *PersonalAccessToken) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := pat.ID + step := sqlgraph.NewStep( + sqlgraph.From(personalaccesstoken.Table, personalaccesstoken.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, personalaccesstoken.OwnerTable, personalaccesstoken.OwnerColumn), + ) + schemaConfig := pat.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PersonalAccessToken + fromV = sqlgraph.Neighbors(pat.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrganizations queries the organizations edge of a PersonalAccessToken. +func (c *PersonalAccessTokenClient) QueryOrganizations(pat *PersonalAccessToken) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := pat.ID + step := sqlgraph.NewStep( + sqlgraph.From(personalaccesstoken.Table, personalaccesstoken.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, personalaccesstoken.OrganizationsTable, personalaccesstoken.OrganizationsPrimaryKey...), + ) + schemaConfig := pat.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + fromV = sqlgraph.Neighbors(pat.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a PersonalAccessToken. +func (c *PersonalAccessTokenClient) QueryEvents(pat *PersonalAccessToken) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := pat.ID + step := sqlgraph.NewStep( + sqlgraph.From(personalaccesstoken.Table, personalaccesstoken.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, personalaccesstoken.EventsTable, personalaccesstoken.EventsPrimaryKey...), + ) + schemaConfig := pat.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + fromV = sqlgraph.Neighbors(pat.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *PersonalAccessTokenClient) Hooks() []Hook { + hooks := c.hooks.PersonalAccessToken + return append(hooks[:len(hooks):len(hooks)], personalaccesstoken.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *PersonalAccessTokenClient) Interceptors() []Interceptor { + inters := c.inters.PersonalAccessToken + return append(inters[:len(inters):len(inters)], personalaccesstoken.Interceptors[:]...) +} + +func (c *PersonalAccessTokenClient) mutate(ctx context.Context, m *PersonalAccessTokenMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&PersonalAccessTokenCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&PersonalAccessTokenUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&PersonalAccessTokenUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&PersonalAccessTokenDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown PersonalAccessToken mutation op: %q", m.Op()) + } +} + +// SubscriberClient is a client for the Subscriber schema. +type SubscriberClient struct { + config +} + +// NewSubscriberClient returns a client for the Subscriber from the given config. +func NewSubscriberClient(c config) *SubscriberClient { + return &SubscriberClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `subscriber.Hooks(f(g(h())))`. +func (c *SubscriberClient) Use(hooks ...Hook) { + c.hooks.Subscriber = append(c.hooks.Subscriber, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `subscriber.Intercept(f(g(h())))`. +func (c *SubscriberClient) Intercept(interceptors ...Interceptor) { + c.inters.Subscriber = append(c.inters.Subscriber, interceptors...) +} + +// Create returns a builder for creating a Subscriber entity. +func (c *SubscriberClient) Create() *SubscriberCreate { + mutation := newSubscriberMutation(c.config, OpCreate) + return &SubscriberCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Subscriber entities. +func (c *SubscriberClient) CreateBulk(builders ...*SubscriberCreate) *SubscriberCreateBulk { + return &SubscriberCreateBulk{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 *SubscriberClient) MapCreateBulk(slice any, setFunc func(*SubscriberCreate, int)) *SubscriberCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &SubscriberCreateBulk{err: fmt.Errorf("calling to SubscriberClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*SubscriberCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &SubscriberCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Subscriber. +func (c *SubscriberClient) Update() *SubscriberUpdate { + mutation := newSubscriberMutation(c.config, OpUpdate) + return &SubscriberUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *SubscriberClient) UpdateOne(s *Subscriber) *SubscriberUpdateOne { + mutation := newSubscriberMutation(c.config, OpUpdateOne, withSubscriber(s)) + return &SubscriberUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *SubscriberClient) UpdateOneID(id string) *SubscriberUpdateOne { + mutation := newSubscriberMutation(c.config, OpUpdateOne, withSubscriberID(id)) + return &SubscriberUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Subscriber. +func (c *SubscriberClient) Delete() *SubscriberDelete { + mutation := newSubscriberMutation(c.config, OpDelete) + return &SubscriberDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *SubscriberClient) DeleteOne(s *Subscriber) *SubscriberDeleteOne { + return c.DeleteOneID(s.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *SubscriberClient) DeleteOneID(id string) *SubscriberDeleteOne { + builder := c.Delete().Where(subscriber.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &SubscriberDeleteOne{builder} +} + +// Query returns a query builder for Subscriber. +func (c *SubscriberClient) Query() *SubscriberQuery { + return &SubscriberQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeSubscriber}, + inters: c.Interceptors(), + } +} + +// Get returns a Subscriber entity by its id. +func (c *SubscriberClient) Get(ctx context.Context, id string) (*Subscriber, error) { + return c.Query().Where(subscriber.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *SubscriberClient) GetX(ctx context.Context, id string) *Subscriber { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Subscriber. +func (c *SubscriberClient) QueryOwner(s *Subscriber) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := s.ID + step := sqlgraph.NewStep( + sqlgraph.From(subscriber.Table, subscriber.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, subscriber.OwnerTable, subscriber.OwnerColumn), + ) + schemaConfig := s.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Subscriber + fromV = sqlgraph.Neighbors(s.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Subscriber. +func (c *SubscriberClient) QueryEvents(s *Subscriber) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := s.ID + step := sqlgraph.NewStep( + sqlgraph.From(subscriber.Table, subscriber.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, subscriber.EventsTable, subscriber.EventsPrimaryKey...), + ) + schemaConfig := s.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.SubscriberEvents + fromV = sqlgraph.Neighbors(s.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *SubscriberClient) Hooks() []Hook { + hooks := c.hooks.Subscriber + return append(hooks[:len(hooks):len(hooks)], subscriber.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *SubscriberClient) Interceptors() []Interceptor { + inters := c.inters.Subscriber + return append(inters[:len(inters):len(inters)], subscriber.Interceptors[:]...) +} + +func (c *SubscriberClient) mutate(ctx context.Context, m *SubscriberMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&SubscriberCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&SubscriberUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&SubscriberUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&SubscriberDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Subscriber mutation op: %q", m.Op()) + } +} + +// TFASettingClient is a client for the TFASetting schema. +type TFASettingClient struct { + config +} + +// NewTFASettingClient returns a client for the TFASetting from the given config. +func NewTFASettingClient(c config) *TFASettingClient { + return &TFASettingClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `tfasetting.Hooks(f(g(h())))`. +func (c *TFASettingClient) Use(hooks ...Hook) { + c.hooks.TFASetting = append(c.hooks.TFASetting, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `tfasetting.Intercept(f(g(h())))`. +func (c *TFASettingClient) Intercept(interceptors ...Interceptor) { + c.inters.TFASetting = append(c.inters.TFASetting, interceptors...) +} + +// Create returns a builder for creating a TFASetting entity. +func (c *TFASettingClient) Create() *TFASettingCreate { + mutation := newTFASettingMutation(c.config, OpCreate) + return &TFASettingCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of TFASetting entities. +func (c *TFASettingClient) CreateBulk(builders ...*TFASettingCreate) *TFASettingCreateBulk { + return &TFASettingCreateBulk{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 *TFASettingClient) MapCreateBulk(slice any, setFunc func(*TFASettingCreate, int)) *TFASettingCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &TFASettingCreateBulk{err: fmt.Errorf("calling to TFASettingClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*TFASettingCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &TFASettingCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for TFASetting. +func (c *TFASettingClient) Update() *TFASettingUpdate { + mutation := newTFASettingMutation(c.config, OpUpdate) + return &TFASettingUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *TFASettingClient) UpdateOne(ts *TFASetting) *TFASettingUpdateOne { + mutation := newTFASettingMutation(c.config, OpUpdateOne, withTFASetting(ts)) + return &TFASettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *TFASettingClient) UpdateOneID(id string) *TFASettingUpdateOne { + mutation := newTFASettingMutation(c.config, OpUpdateOne, withTFASettingID(id)) + return &TFASettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for TFASetting. +func (c *TFASettingClient) Delete() *TFASettingDelete { + mutation := newTFASettingMutation(c.config, OpDelete) + return &TFASettingDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *TFASettingClient) DeleteOne(ts *TFASetting) *TFASettingDeleteOne { + return c.DeleteOneID(ts.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *TFASettingClient) DeleteOneID(id string) *TFASettingDeleteOne { + builder := c.Delete().Where(tfasetting.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &TFASettingDeleteOne{builder} +} + +// Query returns a query builder for TFASetting. +func (c *TFASettingClient) Query() *TFASettingQuery { + return &TFASettingQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeTFASetting}, + inters: c.Interceptors(), + } +} + +// Get returns a TFASetting entity by its id. +func (c *TFASettingClient) Get(ctx context.Context, id string) (*TFASetting, error) { + return c.Query().Where(tfasetting.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *TFASettingClient) GetX(ctx context.Context, id string) *TFASetting { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a TFASetting. +func (c *TFASettingClient) QueryOwner(ts *TFASetting) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := ts.ID + step := sqlgraph.NewStep( + sqlgraph.From(tfasetting.Table, tfasetting.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, tfasetting.OwnerTable, tfasetting.OwnerColumn), + ) + schemaConfig := ts.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.TFASetting + fromV = sqlgraph.Neighbors(ts.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *TFASettingClient) Hooks() []Hook { + hooks := c.hooks.TFASetting + return append(hooks[:len(hooks):len(hooks)], tfasetting.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *TFASettingClient) Interceptors() []Interceptor { + inters := c.inters.TFASetting + return append(inters[:len(inters):len(inters)], tfasetting.Interceptors[:]...) +} + +func (c *TFASettingClient) mutate(ctx context.Context, m *TFASettingMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&TFASettingCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&TFASettingUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&TFASettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&TFASettingDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown TFASetting mutation op: %q", m.Op()) + } +} + +// TemplateClient is a client for the Template schema. +type TemplateClient struct { + config +} + +// NewTemplateClient returns a client for the Template from the given config. +func NewTemplateClient(c config) *TemplateClient { + return &TemplateClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `template.Hooks(f(g(h())))`. +func (c *TemplateClient) Use(hooks ...Hook) { + c.hooks.Template = append(c.hooks.Template, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `template.Intercept(f(g(h())))`. +func (c *TemplateClient) Intercept(interceptors ...Interceptor) { + c.inters.Template = append(c.inters.Template, interceptors...) +} + +// Create returns a builder for creating a Template entity. +func (c *TemplateClient) Create() *TemplateCreate { + mutation := newTemplateMutation(c.config, OpCreate) + return &TemplateCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Template entities. +func (c *TemplateClient) CreateBulk(builders ...*TemplateCreate) *TemplateCreateBulk { + return &TemplateCreateBulk{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 *TemplateClient) MapCreateBulk(slice any, setFunc func(*TemplateCreate, int)) *TemplateCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &TemplateCreateBulk{err: fmt.Errorf("calling to TemplateClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*TemplateCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &TemplateCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Template. +func (c *TemplateClient) Update() *TemplateUpdate { + mutation := newTemplateMutation(c.config, OpUpdate) + return &TemplateUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *TemplateClient) UpdateOne(t *Template) *TemplateUpdateOne { + mutation := newTemplateMutation(c.config, OpUpdateOne, withTemplate(t)) + return &TemplateUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *TemplateClient) UpdateOneID(id string) *TemplateUpdateOne { + mutation := newTemplateMutation(c.config, OpUpdateOne, withTemplateID(id)) + return &TemplateUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Template. +func (c *TemplateClient) Delete() *TemplateDelete { + mutation := newTemplateMutation(c.config, OpDelete) + return &TemplateDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *TemplateClient) DeleteOne(t *Template) *TemplateDeleteOne { + return c.DeleteOneID(t.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *TemplateClient) DeleteOneID(id string) *TemplateDeleteOne { + builder := c.Delete().Where(template.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &TemplateDeleteOne{builder} +} + +// Query returns a query builder for Template. +func (c *TemplateClient) Query() *TemplateQuery { + return &TemplateQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeTemplate}, + inters: c.Interceptors(), + } +} + +// Get returns a Template entity by its id. +func (c *TemplateClient) Get(ctx context.Context, id string) (*Template, error) { + return c.Query().Where(template.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *TemplateClient) GetX(ctx context.Context, id string) *Template { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Template. +func (c *TemplateClient) QueryOwner(t *Template) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := t.ID + step := sqlgraph.NewStep( + sqlgraph.From(template.Table, template.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, template.OwnerTable, template.OwnerColumn), + ) + schemaConfig := t.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Template + fromV = sqlgraph.Neighbors(t.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryDocuments queries the documents edge of a Template. +func (c *TemplateClient) QueryDocuments(t *Template) *DocumentDataQuery { + query := (&DocumentDataClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := t.ID + step := sqlgraph.NewStep( + sqlgraph.From(template.Table, template.FieldID, id), + sqlgraph.To(documentdata.Table, documentdata.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, template.DocumentsTable, template.DocumentsColumn), + ) + schemaConfig := t.schemaConfig + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + fromV = sqlgraph.Neighbors(t.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *TemplateClient) Hooks() []Hook { + hooks := c.hooks.Template + return append(hooks[:len(hooks):len(hooks)], template.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *TemplateClient) Interceptors() []Interceptor { + inters := c.inters.Template + return append(inters[:len(inters):len(inters)], template.Interceptors[:]...) +} + +func (c *TemplateClient) mutate(ctx context.Context, m *TemplateMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&TemplateCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&TemplateUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&TemplateUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&TemplateDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Template mutation op: %q", m.Op()) + } +} + +// TemplateHistoryClient is a client for the TemplateHistory schema. +type TemplateHistoryClient struct { + config +} + +// NewTemplateHistoryClient returns a client for the TemplateHistory from the given config. +func NewTemplateHistoryClient(c config) *TemplateHistoryClient { + return &TemplateHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `templatehistory.Hooks(f(g(h())))`. +func (c *TemplateHistoryClient) Use(hooks ...Hook) { + c.hooks.TemplateHistory = append(c.hooks.TemplateHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `templatehistory.Intercept(f(g(h())))`. +func (c *TemplateHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.TemplateHistory = append(c.inters.TemplateHistory, interceptors...) +} + +// Create returns a builder for creating a TemplateHistory entity. +func (c *TemplateHistoryClient) Create() *TemplateHistoryCreate { + mutation := newTemplateHistoryMutation(c.config, OpCreate) + return &TemplateHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of TemplateHistory entities. +func (c *TemplateHistoryClient) CreateBulk(builders ...*TemplateHistoryCreate) *TemplateHistoryCreateBulk { + return &TemplateHistoryCreateBulk{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 *TemplateHistoryClient) MapCreateBulk(slice any, setFunc func(*TemplateHistoryCreate, int)) *TemplateHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &TemplateHistoryCreateBulk{err: fmt.Errorf("calling to TemplateHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*TemplateHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &TemplateHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for TemplateHistory. +func (c *TemplateHistoryClient) Update() *TemplateHistoryUpdate { + mutation := newTemplateHistoryMutation(c.config, OpUpdate) + return &TemplateHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *TemplateHistoryClient) UpdateOne(th *TemplateHistory) *TemplateHistoryUpdateOne { + mutation := newTemplateHistoryMutation(c.config, OpUpdateOne, withTemplateHistory(th)) + return &TemplateHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *TemplateHistoryClient) UpdateOneID(id string) *TemplateHistoryUpdateOne { + mutation := newTemplateHistoryMutation(c.config, OpUpdateOne, withTemplateHistoryID(id)) + return &TemplateHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for TemplateHistory. +func (c *TemplateHistoryClient) Delete() *TemplateHistoryDelete { + mutation := newTemplateHistoryMutation(c.config, OpDelete) + return &TemplateHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *TemplateHistoryClient) DeleteOne(th *TemplateHistory) *TemplateHistoryDeleteOne { + return c.DeleteOneID(th.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *TemplateHistoryClient) DeleteOneID(id string) *TemplateHistoryDeleteOne { + builder := c.Delete().Where(templatehistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &TemplateHistoryDeleteOne{builder} +} + +// Query returns a query builder for TemplateHistory. +func (c *TemplateHistoryClient) Query() *TemplateHistoryQuery { + return &TemplateHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeTemplateHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a TemplateHistory entity by its id. +func (c *TemplateHistoryClient) Get(ctx context.Context, id string) (*TemplateHistory, error) { + return c.Query().Where(templatehistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *TemplateHistoryClient) GetX(ctx context.Context, id string) *TemplateHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *TemplateHistoryClient) Hooks() []Hook { + hooks := c.hooks.TemplateHistory + return append(hooks[:len(hooks):len(hooks)], templatehistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *TemplateHistoryClient) Interceptors() []Interceptor { + inters := c.inters.TemplateHistory + return append(inters[:len(inters):len(inters)], templatehistory.Interceptors[:]...) +} + +func (c *TemplateHistoryClient) mutate(ctx context.Context, m *TemplateHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&TemplateHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&TemplateHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&TemplateHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&TemplateHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown TemplateHistory mutation op: %q", m.Op()) + } +} + +// UserClient is a client for the User schema. +type UserClient struct { + config +} + +// NewUserClient returns a client for the User from the given config. +func NewUserClient(c config) *UserClient { + return &UserClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`. +func (c *UserClient) Use(hooks ...Hook) { + c.hooks.User = append(c.hooks.User, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`. +func (c *UserClient) Intercept(interceptors ...Interceptor) { + c.inters.User = append(c.inters.User, interceptors...) +} + +// Create returns a builder for creating a User entity. +func (c *UserClient) Create() *UserCreate { + mutation := newUserMutation(c.config, OpCreate) + return &UserCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of User entities. +func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk { + return &UserCreateBulk{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 *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &UserCreateBulk{err: fmt.Errorf("calling to UserClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*UserCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &UserCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for User. +func (c *UserClient) Update() *UserUpdate { + mutation := newUserMutation(c.config, OpUpdate) + return &UserUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *UserClient) UpdateOne(u *User) *UserUpdateOne { + mutation := newUserMutation(c.config, OpUpdateOne, withUser(u)) + return &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *UserClient) UpdateOneID(id string) *UserUpdateOne { + mutation := newUserMutation(c.config, OpUpdateOne, withUserID(id)) + return &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for User. +func (c *UserClient) Delete() *UserDelete { + mutation := newUserMutation(c.config, OpDelete) + return &UserDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *UserClient) DeleteOne(u *User) *UserDeleteOne { + return c.DeleteOneID(u.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *UserClient) DeleteOneID(id string) *UserDeleteOne { + builder := c.Delete().Where(user.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &UserDeleteOne{builder} +} + +// Query returns a query builder for User. +func (c *UserClient) Query() *UserQuery { + return &UserQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeUser}, + inters: c.Interceptors(), + } +} + +// Get returns a User entity by its id. +func (c *UserClient) Get(ctx context.Context, id string) (*User, error) { + return c.Query().Where(user.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *UserClient) GetX(ctx context.Context, id string) *User { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryPersonalAccessTokens queries the personal_access_tokens edge of a User. +func (c *UserClient) QueryPersonalAccessTokens(u *User) *PersonalAccessTokenQuery { + query := (&PersonalAccessTokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(personalaccesstoken.Table, personalaccesstoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.PersonalAccessTokensTable, user.PersonalAccessTokensColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessToken + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryTfaSettings queries the tfa_settings edge of a User. +func (c *UserClient) QueryTfaSettings(u *User) *TFASettingQuery { + query := (&TFASettingClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(tfasetting.Table, tfasetting.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.TfaSettingsTable, user.TfaSettingsColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.TFASetting + step.Edge.Schema = schemaConfig.TFASetting + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QuerySetting queries the setting edge of a User. +func (c *UserClient) QuerySetting(u *User) *UserSettingQuery { + query := (&UserSettingClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(usersetting.Table, usersetting.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, user.SettingTable, user.SettingColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.UserSetting + step.Edge.Schema = schemaConfig.UserSetting + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEmailVerificationTokens queries the email_verification_tokens edge of a User. +func (c *UserClient) QueryEmailVerificationTokens(u *User) *EmailVerificationTokenQuery { + query := (&EmailVerificationTokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(emailverificationtoken.Table, emailverificationtoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.EmailVerificationTokensTable, user.EmailVerificationTokensColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.EmailVerificationToken + step.Edge.Schema = schemaConfig.EmailVerificationToken + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryPasswordResetTokens queries the password_reset_tokens edge of a User. +func (c *UserClient) QueryPasswordResetTokens(u *User) *PasswordResetTokenQuery { + query := (&PasswordResetTokenClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(passwordresettoken.Table, passwordresettoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.PasswordResetTokensTable, user.PasswordResetTokensColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.PasswordResetToken + step.Edge.Schema = schemaConfig.PasswordResetToken + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryGroups queries the groups edge of a User. +func (c *UserClient) QueryGroups(u *User) *GroupQuery { + query := (&GroupClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, user.GroupsTable, user.GroupsPrimaryKey...), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrganizations queries the organizations edge of a User. +func (c *UserClient) QueryOrganizations(u *User) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, user.OrganizationsTable, user.OrganizationsPrimaryKey...), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryWebauthn queries the webauthn edge of a User. +func (c *UserClient) QueryWebauthn(u *User) *WebauthnQuery { + query := (&WebauthnClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(webauthn.Table, webauthn.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.WebauthnTable, user.WebauthnColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.Webauthn + step.Edge.Schema = schemaConfig.Webauthn + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryFiles queries the files edge of a User. +func (c *UserClient) QueryFiles(u *User) *FileQuery { + query := (&FileClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.FilesTable, user.FilesColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.File + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a User. +func (c *UserClient) QueryEvents(u *User) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, user.EventsTable, user.EventsPrimaryKey...), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.UserEvents + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryGroupMemberships queries the group_memberships edge of a User. +func (c *UserClient) QueryGroupMemberships(u *User) *GroupMembershipQuery { + query := (&GroupMembershipClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(groupmembership.Table, groupmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, user.GroupMembershipsTable, user.GroupMembershipsColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryOrgMemberships queries the org_memberships edge of a User. +func (c *UserClient) QueryOrgMemberships(u *User) *OrgMembershipQuery { + query := (&OrgMembershipClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := u.ID + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, id), + sqlgraph.To(orgmembership.Table, orgmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, user.OrgMembershipsTable, user.OrgMembershipsColumn), + ) + schemaConfig := u.schemaConfig + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *UserClient) Hooks() []Hook { + hooks := c.hooks.User + return append(hooks[:len(hooks):len(hooks)], user.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *UserClient) Interceptors() []Interceptor { + inters := c.inters.User + return append(inters[:len(inters):len(inters)], user.Interceptors[:]...) +} + +func (c *UserClient) mutate(ctx context.Context, m *UserMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&UserCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&UserUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&UserDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown User mutation op: %q", m.Op()) + } +} + +// UserHistoryClient is a client for the UserHistory schema. +type UserHistoryClient struct { + config +} + +// NewUserHistoryClient returns a client for the UserHistory from the given config. +func NewUserHistoryClient(c config) *UserHistoryClient { + return &UserHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `userhistory.Hooks(f(g(h())))`. +func (c *UserHistoryClient) Use(hooks ...Hook) { + c.hooks.UserHistory = append(c.hooks.UserHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `userhistory.Intercept(f(g(h())))`. +func (c *UserHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.UserHistory = append(c.inters.UserHistory, interceptors...) +} + +// Create returns a builder for creating a UserHistory entity. +func (c *UserHistoryClient) Create() *UserHistoryCreate { + mutation := newUserHistoryMutation(c.config, OpCreate) + return &UserHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of UserHistory entities. +func (c *UserHistoryClient) CreateBulk(builders ...*UserHistoryCreate) *UserHistoryCreateBulk { + return &UserHistoryCreateBulk{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 *UserHistoryClient) MapCreateBulk(slice any, setFunc func(*UserHistoryCreate, int)) *UserHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &UserHistoryCreateBulk{err: fmt.Errorf("calling to UserHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*UserHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &UserHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for UserHistory. +func (c *UserHistoryClient) Update() *UserHistoryUpdate { + mutation := newUserHistoryMutation(c.config, OpUpdate) + return &UserHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *UserHistoryClient) UpdateOne(uh *UserHistory) *UserHistoryUpdateOne { + mutation := newUserHistoryMutation(c.config, OpUpdateOne, withUserHistory(uh)) + return &UserHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *UserHistoryClient) UpdateOneID(id string) *UserHistoryUpdateOne { + mutation := newUserHistoryMutation(c.config, OpUpdateOne, withUserHistoryID(id)) + return &UserHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for UserHistory. +func (c *UserHistoryClient) Delete() *UserHistoryDelete { + mutation := newUserHistoryMutation(c.config, OpDelete) + return &UserHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *UserHistoryClient) DeleteOne(uh *UserHistory) *UserHistoryDeleteOne { + return c.DeleteOneID(uh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *UserHistoryClient) DeleteOneID(id string) *UserHistoryDeleteOne { + builder := c.Delete().Where(userhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &UserHistoryDeleteOne{builder} +} + +// Query returns a query builder for UserHistory. +func (c *UserHistoryClient) Query() *UserHistoryQuery { + return &UserHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeUserHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a UserHistory entity by its id. +func (c *UserHistoryClient) Get(ctx context.Context, id string) (*UserHistory, error) { + return c.Query().Where(userhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *UserHistoryClient) GetX(ctx context.Context, id string) *UserHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *UserHistoryClient) Hooks() []Hook { + return c.hooks.UserHistory +} + +// Interceptors returns the client interceptors. +func (c *UserHistoryClient) Interceptors() []Interceptor { + inters := c.inters.UserHistory + return append(inters[:len(inters):len(inters)], userhistory.Interceptors[:]...) +} + +func (c *UserHistoryClient) mutate(ctx context.Context, m *UserHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&UserHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&UserHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&UserHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&UserHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown UserHistory mutation op: %q", m.Op()) + } +} + +// UserSettingClient is a client for the UserSetting schema. +type UserSettingClient struct { + config +} + +// NewUserSettingClient returns a client for the UserSetting from the given config. +func NewUserSettingClient(c config) *UserSettingClient { + return &UserSettingClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `usersetting.Hooks(f(g(h())))`. +func (c *UserSettingClient) Use(hooks ...Hook) { + c.hooks.UserSetting = append(c.hooks.UserSetting, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `usersetting.Intercept(f(g(h())))`. +func (c *UserSettingClient) Intercept(interceptors ...Interceptor) { + c.inters.UserSetting = append(c.inters.UserSetting, interceptors...) +} + +// Create returns a builder for creating a UserSetting entity. +func (c *UserSettingClient) Create() *UserSettingCreate { + mutation := newUserSettingMutation(c.config, OpCreate) + return &UserSettingCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of UserSetting entities. +func (c *UserSettingClient) CreateBulk(builders ...*UserSettingCreate) *UserSettingCreateBulk { + return &UserSettingCreateBulk{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 *UserSettingClient) MapCreateBulk(slice any, setFunc func(*UserSettingCreate, int)) *UserSettingCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &UserSettingCreateBulk{err: fmt.Errorf("calling to UserSettingClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*UserSettingCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &UserSettingCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for UserSetting. +func (c *UserSettingClient) Update() *UserSettingUpdate { + mutation := newUserSettingMutation(c.config, OpUpdate) + return &UserSettingUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *UserSettingClient) UpdateOne(us *UserSetting) *UserSettingUpdateOne { + mutation := newUserSettingMutation(c.config, OpUpdateOne, withUserSetting(us)) + return &UserSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *UserSettingClient) UpdateOneID(id string) *UserSettingUpdateOne { + mutation := newUserSettingMutation(c.config, OpUpdateOne, withUserSettingID(id)) + return &UserSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for UserSetting. +func (c *UserSettingClient) Delete() *UserSettingDelete { + mutation := newUserSettingMutation(c.config, OpDelete) + return &UserSettingDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *UserSettingClient) DeleteOne(us *UserSetting) *UserSettingDeleteOne { + return c.DeleteOneID(us.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *UserSettingClient) DeleteOneID(id string) *UserSettingDeleteOne { + builder := c.Delete().Where(usersetting.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &UserSettingDeleteOne{builder} +} + +// Query returns a query builder for UserSetting. +func (c *UserSettingClient) Query() *UserSettingQuery { + return &UserSettingQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeUserSetting}, + inters: c.Interceptors(), + } +} + +// Get returns a UserSetting entity by its id. +func (c *UserSettingClient) Get(ctx context.Context, id string) (*UserSetting, error) { + return c.Query().Where(usersetting.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *UserSettingClient) GetX(ctx context.Context, id string) *UserSetting { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryUser queries the user edge of a UserSetting. +func (c *UserSettingClient) QueryUser(us *UserSetting) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := us.ID + step := sqlgraph.NewStep( + sqlgraph.From(usersetting.Table, usersetting.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, usersetting.UserTable, usersetting.UserColumn), + ) + schemaConfig := us.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserSetting + fromV = sqlgraph.Neighbors(us.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryDefaultOrg queries the default_org edge of a UserSetting. +func (c *UserSettingClient) QueryDefaultOrg(us *UserSetting) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := us.ID + step := sqlgraph.NewStep( + sqlgraph.From(usersetting.Table, usersetting.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, usersetting.DefaultOrgTable, usersetting.DefaultOrgColumn), + ) + schemaConfig := us.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.UserSetting + fromV = sqlgraph.Neighbors(us.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *UserSettingClient) Hooks() []Hook { + hooks := c.hooks.UserSetting + return append(hooks[:len(hooks):len(hooks)], usersetting.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *UserSettingClient) Interceptors() []Interceptor { + inters := c.inters.UserSetting + return append(inters[:len(inters):len(inters)], usersetting.Interceptors[:]...) +} + +func (c *UserSettingClient) mutate(ctx context.Context, m *UserSettingMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&UserSettingCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&UserSettingUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&UserSettingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&UserSettingDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown UserSetting mutation op: %q", m.Op()) + } +} + +// UserSettingHistoryClient is a client for the UserSettingHistory schema. +type UserSettingHistoryClient struct { + config +} + +// NewUserSettingHistoryClient returns a client for the UserSettingHistory from the given config. +func NewUserSettingHistoryClient(c config) *UserSettingHistoryClient { + return &UserSettingHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `usersettinghistory.Hooks(f(g(h())))`. +func (c *UserSettingHistoryClient) Use(hooks ...Hook) { + c.hooks.UserSettingHistory = append(c.hooks.UserSettingHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `usersettinghistory.Intercept(f(g(h())))`. +func (c *UserSettingHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.UserSettingHistory = append(c.inters.UserSettingHistory, interceptors...) +} + +// Create returns a builder for creating a UserSettingHistory entity. +func (c *UserSettingHistoryClient) Create() *UserSettingHistoryCreate { + mutation := newUserSettingHistoryMutation(c.config, OpCreate) + return &UserSettingHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of UserSettingHistory entities. +func (c *UserSettingHistoryClient) CreateBulk(builders ...*UserSettingHistoryCreate) *UserSettingHistoryCreateBulk { + return &UserSettingHistoryCreateBulk{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 *UserSettingHistoryClient) MapCreateBulk(slice any, setFunc func(*UserSettingHistoryCreate, int)) *UserSettingHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &UserSettingHistoryCreateBulk{err: fmt.Errorf("calling to UserSettingHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*UserSettingHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &UserSettingHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for UserSettingHistory. +func (c *UserSettingHistoryClient) Update() *UserSettingHistoryUpdate { + mutation := newUserSettingHistoryMutation(c.config, OpUpdate) + return &UserSettingHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *UserSettingHistoryClient) UpdateOne(ush *UserSettingHistory) *UserSettingHistoryUpdateOne { + mutation := newUserSettingHistoryMutation(c.config, OpUpdateOne, withUserSettingHistory(ush)) + return &UserSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *UserSettingHistoryClient) UpdateOneID(id string) *UserSettingHistoryUpdateOne { + mutation := newUserSettingHistoryMutation(c.config, OpUpdateOne, withUserSettingHistoryID(id)) + return &UserSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for UserSettingHistory. +func (c *UserSettingHistoryClient) Delete() *UserSettingHistoryDelete { + mutation := newUserSettingHistoryMutation(c.config, OpDelete) + return &UserSettingHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *UserSettingHistoryClient) DeleteOne(ush *UserSettingHistory) *UserSettingHistoryDeleteOne { + return c.DeleteOneID(ush.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *UserSettingHistoryClient) DeleteOneID(id string) *UserSettingHistoryDeleteOne { + builder := c.Delete().Where(usersettinghistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &UserSettingHistoryDeleteOne{builder} +} + +// Query returns a query builder for UserSettingHistory. +func (c *UserSettingHistoryClient) Query() *UserSettingHistoryQuery { + return &UserSettingHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeUserSettingHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a UserSettingHistory entity by its id. +func (c *UserSettingHistoryClient) Get(ctx context.Context, id string) (*UserSettingHistory, error) { + return c.Query().Where(usersettinghistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *UserSettingHistoryClient) GetX(ctx context.Context, id string) *UserSettingHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *UserSettingHistoryClient) Hooks() []Hook { + return c.hooks.UserSettingHistory +} + +// Interceptors returns the client interceptors. +func (c *UserSettingHistoryClient) Interceptors() []Interceptor { + inters := c.inters.UserSettingHistory + return append(inters[:len(inters):len(inters)], usersettinghistory.Interceptors[:]...) +} + +func (c *UserSettingHistoryClient) mutate(ctx context.Context, m *UserSettingHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&UserSettingHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&UserSettingHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&UserSettingHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&UserSettingHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown UserSettingHistory mutation op: %q", m.Op()) + } +} + +// WebauthnClient is a client for the Webauthn schema. +type WebauthnClient struct { + config +} + +// NewWebauthnClient returns a client for the Webauthn from the given config. +func NewWebauthnClient(c config) *WebauthnClient { + return &WebauthnClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `webauthn.Hooks(f(g(h())))`. +func (c *WebauthnClient) Use(hooks ...Hook) { + c.hooks.Webauthn = append(c.hooks.Webauthn, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `webauthn.Intercept(f(g(h())))`. +func (c *WebauthnClient) Intercept(interceptors ...Interceptor) { + c.inters.Webauthn = append(c.inters.Webauthn, interceptors...) +} + +// Create returns a builder for creating a Webauthn entity. +func (c *WebauthnClient) Create() *WebauthnCreate { + mutation := newWebauthnMutation(c.config, OpCreate) + return &WebauthnCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Webauthn entities. +func (c *WebauthnClient) CreateBulk(builders ...*WebauthnCreate) *WebauthnCreateBulk { + return &WebauthnCreateBulk{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 *WebauthnClient) MapCreateBulk(slice any, setFunc func(*WebauthnCreate, int)) *WebauthnCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &WebauthnCreateBulk{err: fmt.Errorf("calling to WebauthnClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*WebauthnCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &WebauthnCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Webauthn. +func (c *WebauthnClient) Update() *WebauthnUpdate { + mutation := newWebauthnMutation(c.config, OpUpdate) + return &WebauthnUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *WebauthnClient) UpdateOne(w *Webauthn) *WebauthnUpdateOne { + mutation := newWebauthnMutation(c.config, OpUpdateOne, withWebauthn(w)) + return &WebauthnUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *WebauthnClient) UpdateOneID(id string) *WebauthnUpdateOne { + mutation := newWebauthnMutation(c.config, OpUpdateOne, withWebauthnID(id)) + return &WebauthnUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Webauthn. +func (c *WebauthnClient) Delete() *WebauthnDelete { + mutation := newWebauthnMutation(c.config, OpDelete) + return &WebauthnDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *WebauthnClient) DeleteOne(w *Webauthn) *WebauthnDeleteOne { + return c.DeleteOneID(w.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *WebauthnClient) DeleteOneID(id string) *WebauthnDeleteOne { + builder := c.Delete().Where(webauthn.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &WebauthnDeleteOne{builder} +} + +// Query returns a query builder for Webauthn. +func (c *WebauthnClient) Query() *WebauthnQuery { + return &WebauthnQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeWebauthn}, + inters: c.Interceptors(), + } +} + +// Get returns a Webauthn entity by its id. +func (c *WebauthnClient) Get(ctx context.Context, id string) (*Webauthn, error) { + return c.Query().Where(webauthn.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *WebauthnClient) GetX(ctx context.Context, id string) *Webauthn { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Webauthn. +func (c *WebauthnClient) QueryOwner(w *Webauthn) *UserQuery { + query := (&UserClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := w.ID + step := sqlgraph.NewStep( + sqlgraph.From(webauthn.Table, webauthn.FieldID, id), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, webauthn.OwnerTable, webauthn.OwnerColumn), + ) + schemaConfig := w.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.Webauthn + fromV = sqlgraph.Neighbors(w.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *WebauthnClient) Hooks() []Hook { + hooks := c.hooks.Webauthn + return append(hooks[:len(hooks):len(hooks)], webauthn.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *WebauthnClient) Interceptors() []Interceptor { + inters := c.inters.Webauthn + return append(inters[:len(inters):len(inters)], webauthn.Interceptors[:]...) +} + +func (c *WebauthnClient) mutate(ctx context.Context, m *WebauthnMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&WebauthnCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&WebauthnUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&WebauthnUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&WebauthnDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Webauthn mutation op: %q", m.Op()) + } +} + +// WebhookClient is a client for the Webhook schema. +type WebhookClient struct { + config +} + +// NewWebhookClient returns a client for the Webhook from the given config. +func NewWebhookClient(c config) *WebhookClient { + return &WebhookClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `webhook.Hooks(f(g(h())))`. +func (c *WebhookClient) Use(hooks ...Hook) { + c.hooks.Webhook = append(c.hooks.Webhook, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `webhook.Intercept(f(g(h())))`. +func (c *WebhookClient) Intercept(interceptors ...Interceptor) { + c.inters.Webhook = append(c.inters.Webhook, interceptors...) +} + +// Create returns a builder for creating a Webhook entity. +func (c *WebhookClient) Create() *WebhookCreate { + mutation := newWebhookMutation(c.config, OpCreate) + return &WebhookCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of Webhook entities. +func (c *WebhookClient) CreateBulk(builders ...*WebhookCreate) *WebhookCreateBulk { + return &WebhookCreateBulk{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 *WebhookClient) MapCreateBulk(slice any, setFunc func(*WebhookCreate, int)) *WebhookCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &WebhookCreateBulk{err: fmt.Errorf("calling to WebhookClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*WebhookCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &WebhookCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for Webhook. +func (c *WebhookClient) Update() *WebhookUpdate { + mutation := newWebhookMutation(c.config, OpUpdate) + return &WebhookUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *WebhookClient) UpdateOne(w *Webhook) *WebhookUpdateOne { + mutation := newWebhookMutation(c.config, OpUpdateOne, withWebhook(w)) + return &WebhookUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *WebhookClient) UpdateOneID(id string) *WebhookUpdateOne { + mutation := newWebhookMutation(c.config, OpUpdateOne, withWebhookID(id)) + return &WebhookUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for Webhook. +func (c *WebhookClient) Delete() *WebhookDelete { + mutation := newWebhookMutation(c.config, OpDelete) + return &WebhookDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *WebhookClient) DeleteOne(w *Webhook) *WebhookDeleteOne { + return c.DeleteOneID(w.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *WebhookClient) DeleteOneID(id string) *WebhookDeleteOne { + builder := c.Delete().Where(webhook.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &WebhookDeleteOne{builder} +} + +// Query returns a query builder for Webhook. +func (c *WebhookClient) Query() *WebhookQuery { + return &WebhookQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeWebhook}, + inters: c.Interceptors(), + } +} + +// Get returns a Webhook entity by its id. +func (c *WebhookClient) Get(ctx context.Context, id string) (*Webhook, error) { + return c.Query().Where(webhook.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *WebhookClient) GetX(ctx context.Context, id string) *Webhook { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// QueryOwner queries the owner edge of a Webhook. +func (c *WebhookClient) QueryOwner(w *Webhook) *OrganizationQuery { + query := (&OrganizationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := w.ID + step := sqlgraph.NewStep( + sqlgraph.From(webhook.Table, webhook.FieldID, id), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, webhook.OwnerTable, webhook.OwnerColumn), + ) + schemaConfig := w.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Webhook + fromV = sqlgraph.Neighbors(w.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryEvents queries the events edge of a Webhook. +func (c *WebhookClient) QueryEvents(w *Webhook) *EventQuery { + query := (&EventClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := w.ID + step := sqlgraph.NewStep( + sqlgraph.From(webhook.Table, webhook.FieldID, id), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, webhook.EventsTable, webhook.EventsPrimaryKey...), + ) + schemaConfig := w.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.WebhookEvents + fromV = sqlgraph.Neighbors(w.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// QueryIntegrations queries the integrations edge of a Webhook. +func (c *WebhookClient) QueryIntegrations(w *Webhook) *IntegrationQuery { + query := (&IntegrationClient{config: c.config}).Query() + query.path = func(context.Context) (fromV *sql.Selector, _ error) { + id := w.ID + step := sqlgraph.NewStep( + sqlgraph.From(webhook.Table, webhook.FieldID, id), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, webhook.IntegrationsTable, webhook.IntegrationsPrimaryKey...), + ) + schemaConfig := w.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationWebhooks + fromV = sqlgraph.Neighbors(w.driver.Dialect(), step) + return fromV, nil + } + return query +} + +// Hooks returns the client hooks. +func (c *WebhookClient) Hooks() []Hook { + hooks := c.hooks.Webhook + return append(hooks[:len(hooks):len(hooks)], webhook.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *WebhookClient) Interceptors() []Interceptor { + inters := c.inters.Webhook + return append(inters[:len(inters):len(inters)], webhook.Interceptors[:]...) +} + +func (c *WebhookClient) mutate(ctx context.Context, m *WebhookMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&WebhookCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&WebhookUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&WebhookUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&WebhookDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown Webhook mutation op: %q", m.Op()) + } +} + +// WebhookHistoryClient is a client for the WebhookHistory schema. +type WebhookHistoryClient struct { + config +} + +// NewWebhookHistoryClient returns a client for the WebhookHistory from the given config. +func NewWebhookHistoryClient(c config) *WebhookHistoryClient { + return &WebhookHistoryClient{config: c} +} + +// Use adds a list of mutation hooks to the hooks stack. +// A call to `Use(f, g, h)` equals to `webhookhistory.Hooks(f(g(h())))`. +func (c *WebhookHistoryClient) Use(hooks ...Hook) { + c.hooks.WebhookHistory = append(c.hooks.WebhookHistory, hooks...) +} + +// Intercept adds a list of query interceptors to the interceptors stack. +// A call to `Intercept(f, g, h)` equals to `webhookhistory.Intercept(f(g(h())))`. +func (c *WebhookHistoryClient) Intercept(interceptors ...Interceptor) { + c.inters.WebhookHistory = append(c.inters.WebhookHistory, interceptors...) +} + +// Create returns a builder for creating a WebhookHistory entity. +func (c *WebhookHistoryClient) Create() *WebhookHistoryCreate { + mutation := newWebhookHistoryMutation(c.config, OpCreate) + return &WebhookHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// CreateBulk returns a builder for creating a bulk of WebhookHistory entities. +func (c *WebhookHistoryClient) CreateBulk(builders ...*WebhookHistoryCreate) *WebhookHistoryCreateBulk { + return &WebhookHistoryCreateBulk{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 *WebhookHistoryClient) MapCreateBulk(slice any, setFunc func(*WebhookHistoryCreate, int)) *WebhookHistoryCreateBulk { + rv := reflect.ValueOf(slice) + if rv.Kind() != reflect.Slice { + return &WebhookHistoryCreateBulk{err: fmt.Errorf("calling to WebhookHistoryClient.MapCreateBulk with wrong type %T, need slice", slice)} + } + builders := make([]*WebhookHistoryCreate, rv.Len()) + for i := 0; i < rv.Len(); i++ { + builders[i] = c.Create() + setFunc(builders[i], i) + } + return &WebhookHistoryCreateBulk{config: c.config, builders: builders} +} + +// Update returns an update builder for WebhookHistory. +func (c *WebhookHistoryClient) Update() *WebhookHistoryUpdate { + mutation := newWebhookHistoryMutation(c.config, OpUpdate) + return &WebhookHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOne returns an update builder for the given entity. +func (c *WebhookHistoryClient) UpdateOne(wh *WebhookHistory) *WebhookHistoryUpdateOne { + mutation := newWebhookHistoryMutation(c.config, OpUpdateOne, withWebhookHistory(wh)) + return &WebhookHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// UpdateOneID returns an update builder for the given id. +func (c *WebhookHistoryClient) UpdateOneID(id string) *WebhookHistoryUpdateOne { + mutation := newWebhookHistoryMutation(c.config, OpUpdateOne, withWebhookHistoryID(id)) + return &WebhookHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// Delete returns a delete builder for WebhookHistory. +func (c *WebhookHistoryClient) Delete() *WebhookHistoryDelete { + mutation := newWebhookHistoryMutation(c.config, OpDelete) + return &WebhookHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: mutation} +} + +// DeleteOne returns a builder for deleting the given entity. +func (c *WebhookHistoryClient) DeleteOne(wh *WebhookHistory) *WebhookHistoryDeleteOne { + return c.DeleteOneID(wh.ID) +} + +// DeleteOneID returns a builder for deleting the given entity by its id. +func (c *WebhookHistoryClient) DeleteOneID(id string) *WebhookHistoryDeleteOne { + builder := c.Delete().Where(webhookhistory.ID(id)) + builder.mutation.id = &id + builder.mutation.op = OpDeleteOne + return &WebhookHistoryDeleteOne{builder} +} + +// Query returns a query builder for WebhookHistory. +func (c *WebhookHistoryClient) Query() *WebhookHistoryQuery { + return &WebhookHistoryQuery{ + config: c.config, + ctx: &QueryContext{Type: TypeWebhookHistory}, + inters: c.Interceptors(), + } +} + +// Get returns a WebhookHistory entity by its id. +func (c *WebhookHistoryClient) Get(ctx context.Context, id string) (*WebhookHistory, error) { + return c.Query().Where(webhookhistory.ID(id)).Only(ctx) +} + +// GetX is like Get, but panics if an error occurs. +func (c *WebhookHistoryClient) GetX(ctx context.Context, id string) *WebhookHistory { + obj, err := c.Get(ctx, id) + if err != nil { + panic(err) + } + return obj +} + +// Hooks returns the client hooks. +func (c *WebhookHistoryClient) Hooks() []Hook { + hooks := c.hooks.WebhookHistory + return append(hooks[:len(hooks):len(hooks)], webhookhistory.Hooks[:]...) +} + +// Interceptors returns the client interceptors. +func (c *WebhookHistoryClient) Interceptors() []Interceptor { + inters := c.inters.WebhookHistory + return append(inters[:len(inters):len(inters)], webhookhistory.Interceptors[:]...) +} + +func (c *WebhookHistoryClient) mutate(ctx context.Context, m *WebhookHistoryMutation) (Value, error) { + switch m.Op() { + case OpCreate: + return (&WebhookHistoryCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdate: + return (&WebhookHistoryUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpUpdateOne: + return (&WebhookHistoryUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx) + case OpDelete, OpDeleteOne: + return (&WebhookHistoryDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx) + default: + return nil, fmt.Errorf("generated: unknown WebhookHistory mutation op: %q", m.Op()) + } +} + +// hooks and interceptors per client, for fast access. +type ( + hooks struct { + APIToken, Contact, ContactHistory, DocumentData, DocumentDataHistory, + EmailVerificationToken, Entitlement, EntitlementHistory, EntitlementPlan, + EntitlementPlanFeature, EntitlementPlanFeatureHistory, EntitlementPlanHistory, + Entity, EntityHistory, EntityType, EntityTypeHistory, Event, EventHistory, + Feature, FeatureHistory, File, FileHistory, Group, GroupHistory, + GroupMembership, GroupMembershipHistory, GroupSetting, GroupSettingHistory, + Hush, HushHistory, Integration, IntegrationHistory, Invite, Note, NoteHistory, + OauthProvider, OauthProviderHistory, OhAuthTooToken, OrgMembership, + OrgMembershipHistory, Organization, OrganizationHistory, OrganizationSetting, + OrganizationSettingHistory, PasswordResetToken, PersonalAccessToken, + Subscriber, TFASetting, Template, TemplateHistory, User, UserHistory, + UserSetting, UserSettingHistory, Webauthn, Webhook, WebhookHistory []ent.Hook + } + inters struct { + APIToken, Contact, ContactHistory, DocumentData, DocumentDataHistory, + EmailVerificationToken, Entitlement, EntitlementHistory, EntitlementPlan, + EntitlementPlanFeature, EntitlementPlanFeatureHistory, EntitlementPlanHistory, + Entity, EntityHistory, EntityType, EntityTypeHistory, Event, EventHistory, + Feature, FeatureHistory, File, FileHistory, Group, GroupHistory, + GroupMembership, GroupMembershipHistory, GroupSetting, GroupSettingHistory, + Hush, HushHistory, Integration, IntegrationHistory, Invite, Note, NoteHistory, + OauthProvider, OauthProviderHistory, OhAuthTooToken, OrgMembership, + OrgMembershipHistory, Organization, OrganizationHistory, OrganizationSetting, + OrganizationSettingHistory, PasswordResetToken, PersonalAccessToken, + Subscriber, TFASetting, Template, TemplateHistory, User, UserHistory, + UserSetting, UserSettingHistory, Webauthn, Webhook, + WebhookHistory []ent.Interceptor + } +) + +// SchemaConfig represents alternative schema names for all tables +// that can be passed at runtime. +type SchemaConfig = internal.SchemaConfig + +// AlternateSchemas allows alternate schema names to be +// passed into ent operations. +func AlternateSchema(schemaConfig SchemaConfig) Option { + return func(c *config) { + c.schemaConfig = schemaConfig + } +} diff --git a/internal/ent/generated/contact.go b/internal/ent/generated/contact.go new file mode 100644 index 0000000..c238321 --- /dev/null +++ b/internal/ent/generated/contact.go @@ -0,0 +1,348 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/pkg/enums" +) + +// Contact is the model entity for the Contact schema. +type Contact struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the full name of the contact + FullName string `json:"full_name,omitempty"` + // the title of the contact + Title string `json:"title,omitempty"` + // the company of the contact + Company string `json:"company,omitempty"` + // the email of the contact + Email string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber string `json:"phone_number,omitempty"` + // the address of the contact + Address string `json:"address,omitempty"` + // status of the contact + Status enums.UserStatus `json:"status,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the ContactQuery when eager-loading is set. + Edges ContactEdges `json:"edges"` + selectValues sql.SelectValues +} + +// ContactEdges holds the relations/edges for other nodes in the graph. +type ContactEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Entities holds the value of the entities edge. + Entities []*Entity `json:"entities,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int + + namedEntities map[string][]*Entity +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e ContactEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// EntitiesOrErr returns the Entities value or an error if the edge +// was not loaded in eager-loading. +func (e ContactEdges) EntitiesOrErr() ([]*Entity, error) { + if e.loadedTypes[1] { + return e.Entities, nil + } + return nil, &NotLoadedError{edge: "entities"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Contact) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case contact.FieldTags: + values[i] = new([]byte) + case contact.FieldID, contact.FieldCreatedBy, contact.FieldUpdatedBy, contact.FieldMappingID, contact.FieldDeletedBy, contact.FieldOwnerID, contact.FieldFullName, contact.FieldTitle, contact.FieldCompany, contact.FieldEmail, contact.FieldPhoneNumber, contact.FieldAddress, contact.FieldStatus: + values[i] = new(sql.NullString) + case contact.FieldCreatedAt, contact.FieldUpdatedAt, contact.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Contact fields. +func (c *Contact) 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 contact.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + c.ID = value.String + } + case contact.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + c.CreatedAt = value.Time + } + case contact.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + c.UpdatedAt = value.Time + } + case contact.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + c.CreatedBy = value.String + } + case contact.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + c.UpdatedBy = value.String + } + case contact.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + c.MappingID = value.String + } + case contact.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + c.DeletedAt = value.Time + } + case contact.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + c.DeletedBy = value.String + } + case contact.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &c.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case contact.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + c.OwnerID = value.String + } + case contact.FieldFullName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field full_name", values[i]) + } else if value.Valid { + c.FullName = value.String + } + case contact.FieldTitle: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field title", values[i]) + } else if value.Valid { + c.Title = value.String + } + case contact.FieldCompany: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field company", values[i]) + } else if value.Valid { + c.Company = value.String + } + case contact.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + c.Email = value.String + } + case contact.FieldPhoneNumber: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field phone_number", values[i]) + } else if value.Valid { + c.PhoneNumber = value.String + } + case contact.FieldAddress: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field address", values[i]) + } else if value.Valid { + c.Address = value.String + } + case contact.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + c.Status = enums.UserStatus(value.String) + } + default: + c.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Contact. +// This includes values selected through modifiers, order, etc. +func (c *Contact) Value(name string) (ent.Value, error) { + return c.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Contact entity. +func (c *Contact) QueryOwner() *OrganizationQuery { + return NewContactClient(c.config).QueryOwner(c) +} + +// QueryEntities queries the "entities" edge of the Contact entity. +func (c *Contact) QueryEntities() *EntityQuery { + return NewContactClient(c.config).QueryEntities(c) +} + +// Update returns a builder for updating this Contact. +// Note that you need to call Contact.Unwrap() before calling this method if this Contact +// was returned from a transaction, and the transaction was committed or rolled back. +func (c *Contact) Update() *ContactUpdateOne { + return NewContactClient(c.config).UpdateOne(c) +} + +// Unwrap unwraps the Contact 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 (c *Contact) Unwrap() *Contact { + _tx, ok := c.config.driver.(*txDriver) + if !ok { + panic("generated: Contact is not a transactional entity") + } + c.config.driver = _tx.drv + return c +} + +// String implements the fmt.Stringer. +func (c *Contact) String() string { + var builder strings.Builder + builder.WriteString("Contact(") + builder.WriteString(fmt.Sprintf("id=%v, ", c.ID)) + builder.WriteString("created_at=") + builder.WriteString(c.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(c.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(c.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(c.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(c.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(c.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(c.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", c.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(c.OwnerID) + builder.WriteString(", ") + builder.WriteString("full_name=") + builder.WriteString(c.FullName) + builder.WriteString(", ") + builder.WriteString("title=") + builder.WriteString(c.Title) + builder.WriteString(", ") + builder.WriteString("company=") + builder.WriteString(c.Company) + builder.WriteString(", ") + builder.WriteString("email=") + builder.WriteString(c.Email) + builder.WriteString(", ") + builder.WriteString("phone_number=") + builder.WriteString(c.PhoneNumber) + builder.WriteString(", ") + builder.WriteString("address=") + builder.WriteString(c.Address) + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", c.Status)) + builder.WriteByte(')') + return builder.String() +} + +// NamedEntities returns the Entities named value or an error if the edge was not +// loaded in eager-loading with this name. +func (c *Contact) NamedEntities(name string) ([]*Entity, error) { + if c.Edges.namedEntities == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := c.Edges.namedEntities[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (c *Contact) appendNamedEntities(name string, edges ...*Entity) { + if c.Edges.namedEntities == nil { + c.Edges.namedEntities = make(map[string][]*Entity) + } + if len(edges) == 0 { + c.Edges.namedEntities[name] = []*Entity{} + } else { + c.Edges.namedEntities[name] = append(c.Edges.namedEntities[name], edges...) + } +} + +// Contacts is a parsable slice of Contact. +type Contacts []*Contact diff --git a/internal/ent/generated/contact/contact.go b/internal/ent/generated/contact/contact.go new file mode 100644 index 0000000..ff112d1 --- /dev/null +++ b/internal/ent/generated/contact/contact.go @@ -0,0 +1,276 @@ +// Code generated by ent, DO NOT EDIT. + +package contact + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the contact type in the database. + Label = "contact" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldFullName holds the string denoting the full_name field in the database. + FieldFullName = "full_name" + // FieldTitle holds the string denoting the title field in the database. + FieldTitle = "title" + // FieldCompany holds the string denoting the company field in the database. + FieldCompany = "company" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldPhoneNumber holds the string denoting the phone_number field in the database. + FieldPhoneNumber = "phone_number" + // FieldAddress holds the string denoting the address field in the database. + FieldAddress = "address" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeEntities holds the string denoting the entities edge name in mutations. + EdgeEntities = "entities" + // Table holds the table name of the contact in the database. + Table = "contacts" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "contacts" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // EntitiesTable is the table that holds the entities relation/edge. The primary key declared below. + EntitiesTable = "entity_contacts" + // EntitiesInverseTable is the table name for the Entity entity. + // It exists in this package in order to avoid circular dependency with the "entity" package. + EntitiesInverseTable = "entities" +) + +// Columns holds all SQL columns for contact fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldFullName, + FieldTitle, + FieldCompany, + FieldEmail, + FieldPhoneNumber, + FieldAddress, + FieldStatus, +} + +var ( + // EntitiesPrimaryKey and EntitiesColumn2 are the table columns denoting the + // primary key for the entities relation (M2M). + EntitiesPrimaryKey = []string{"entity_id", "contact_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // FullNameValidator is a validator for the "full_name" field. It is called by the builders before save. + FullNameValidator func(string) error + // EmailValidator is a validator for the "email" field. It is called by the builders before save. + EmailValidator func(string) error + // PhoneNumberValidator is a validator for the "phone_number" field. It is called by the builders before save. + PhoneNumberValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultStatus enums.UserStatus = "ACTIVE" + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s enums.UserStatus) error { + switch s.String() { + case "ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING": + return nil + default: + return fmt.Errorf("contact: invalid enum value for status field: %q", s) + } +} + +// OrderOption defines the ordering options for the Contact queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByFullName orders the results by the full_name field. +func ByFullName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFullName, opts...).ToFunc() +} + +// ByTitle orders the results by the title field. +func ByTitle(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTitle, opts...).ToFunc() +} + +// ByCompany orders the results by the company field. +func ByCompany(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCompany, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByPhoneNumber orders the results by the phone_number field. +func ByPhoneNumber(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPhoneNumber, opts...).ToFunc() +} + +// ByAddress orders the results by the address field. +func ByAddress(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAddress, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEntitiesCount orders the results by entities count. +func ByEntitiesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitiesStep(), opts...) + } +} + +// ByEntities orders the results by entities terms. +func ByEntities(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitiesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newEntitiesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitiesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitiesTable, EntitiesPrimaryKey...), + ) +} + +var ( + // enums.UserStatus must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.UserStatus)(nil) + // enums.UserStatus must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.UserStatus)(nil) +) diff --git a/internal/ent/generated/contact/where.go b/internal/ent/generated/contact/where.go new file mode 100644 index 0000000..e4419ec --- /dev/null +++ b/internal/ent/generated/contact/where.go @@ -0,0 +1,1207 @@ +// Code generated by ent, DO NOT EDIT. + +package contact + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldOwnerID, v)) +} + +// FullName applies equality check predicate on the "full_name" field. It's identical to FullNameEQ. +func FullName(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldFullName, v)) +} + +// Title applies equality check predicate on the "title" field. It's identical to TitleEQ. +func Title(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldTitle, v)) +} + +// Company applies equality check predicate on the "company" field. It's identical to CompanyEQ. +func Company(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldCompany, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldEmail, v)) +} + +// PhoneNumber applies equality check predicate on the "phone_number" field. It's identical to PhoneNumberEQ. +func PhoneNumber(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// Address applies equality check predicate on the "address" field. It's identical to AddressEQ. +func Address(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldAddress, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// FullNameEQ applies the EQ predicate on the "full_name" field. +func FullNameEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldFullName, v)) +} + +// FullNameNEQ applies the NEQ predicate on the "full_name" field. +func FullNameNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldFullName, v)) +} + +// FullNameIn applies the In predicate on the "full_name" field. +func FullNameIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldFullName, vs...)) +} + +// FullNameNotIn applies the NotIn predicate on the "full_name" field. +func FullNameNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldFullName, vs...)) +} + +// FullNameGT applies the GT predicate on the "full_name" field. +func FullNameGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldFullName, v)) +} + +// FullNameGTE applies the GTE predicate on the "full_name" field. +func FullNameGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldFullName, v)) +} + +// FullNameLT applies the LT predicate on the "full_name" field. +func FullNameLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldFullName, v)) +} + +// FullNameLTE applies the LTE predicate on the "full_name" field. +func FullNameLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldFullName, v)) +} + +// FullNameContains applies the Contains predicate on the "full_name" field. +func FullNameContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldFullName, v)) +} + +// FullNameHasPrefix applies the HasPrefix predicate on the "full_name" field. +func FullNameHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldFullName, v)) +} + +// FullNameHasSuffix applies the HasSuffix predicate on the "full_name" field. +func FullNameHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldFullName, v)) +} + +// FullNameEqualFold applies the EqualFold predicate on the "full_name" field. +func FullNameEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldFullName, v)) +} + +// FullNameContainsFold applies the ContainsFold predicate on the "full_name" field. +func FullNameContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldFullName, v)) +} + +// TitleEQ applies the EQ predicate on the "title" field. +func TitleEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldTitle, v)) +} + +// TitleNEQ applies the NEQ predicate on the "title" field. +func TitleNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldTitle, v)) +} + +// TitleIn applies the In predicate on the "title" field. +func TitleIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldTitle, vs...)) +} + +// TitleNotIn applies the NotIn predicate on the "title" field. +func TitleNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldTitle, vs...)) +} + +// TitleGT applies the GT predicate on the "title" field. +func TitleGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldTitle, v)) +} + +// TitleGTE applies the GTE predicate on the "title" field. +func TitleGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldTitle, v)) +} + +// TitleLT applies the LT predicate on the "title" field. +func TitleLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldTitle, v)) +} + +// TitleLTE applies the LTE predicate on the "title" field. +func TitleLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldTitle, v)) +} + +// TitleContains applies the Contains predicate on the "title" field. +func TitleContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldTitle, v)) +} + +// TitleHasPrefix applies the HasPrefix predicate on the "title" field. +func TitleHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldTitle, v)) +} + +// TitleHasSuffix applies the HasSuffix predicate on the "title" field. +func TitleHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldTitle, v)) +} + +// TitleIsNil applies the IsNil predicate on the "title" field. +func TitleIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldTitle)) +} + +// TitleNotNil applies the NotNil predicate on the "title" field. +func TitleNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldTitle)) +} + +// TitleEqualFold applies the EqualFold predicate on the "title" field. +func TitleEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldTitle, v)) +} + +// TitleContainsFold applies the ContainsFold predicate on the "title" field. +func TitleContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldTitle, v)) +} + +// CompanyEQ applies the EQ predicate on the "company" field. +func CompanyEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldCompany, v)) +} + +// CompanyNEQ applies the NEQ predicate on the "company" field. +func CompanyNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldCompany, v)) +} + +// CompanyIn applies the In predicate on the "company" field. +func CompanyIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldCompany, vs...)) +} + +// CompanyNotIn applies the NotIn predicate on the "company" field. +func CompanyNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldCompany, vs...)) +} + +// CompanyGT applies the GT predicate on the "company" field. +func CompanyGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldCompany, v)) +} + +// CompanyGTE applies the GTE predicate on the "company" field. +func CompanyGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldCompany, v)) +} + +// CompanyLT applies the LT predicate on the "company" field. +func CompanyLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldCompany, v)) +} + +// CompanyLTE applies the LTE predicate on the "company" field. +func CompanyLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldCompany, v)) +} + +// CompanyContains applies the Contains predicate on the "company" field. +func CompanyContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldCompany, v)) +} + +// CompanyHasPrefix applies the HasPrefix predicate on the "company" field. +func CompanyHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldCompany, v)) +} + +// CompanyHasSuffix applies the HasSuffix predicate on the "company" field. +func CompanyHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldCompany, v)) +} + +// CompanyIsNil applies the IsNil predicate on the "company" field. +func CompanyIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldCompany)) +} + +// CompanyNotNil applies the NotNil predicate on the "company" field. +func CompanyNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldCompany)) +} + +// CompanyEqualFold applies the EqualFold predicate on the "company" field. +func CompanyEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldCompany, v)) +} + +// CompanyContainsFold applies the ContainsFold predicate on the "company" field. +func CompanyContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldCompany, v)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailIsNil applies the IsNil predicate on the "email" field. +func EmailIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldEmail)) +} + +// EmailNotNil applies the NotNil predicate on the "email" field. +func EmailNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldEmail)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldEmail, v)) +} + +// PhoneNumberEQ applies the EQ predicate on the "phone_number" field. +func PhoneNumberEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberNEQ applies the NEQ predicate on the "phone_number" field. +func PhoneNumberNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberIn applies the In predicate on the "phone_number" field. +func PhoneNumberIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberNotIn applies the NotIn predicate on the "phone_number" field. +func PhoneNumberNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberGT applies the GT predicate on the "phone_number" field. +func PhoneNumberGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldPhoneNumber, v)) +} + +// PhoneNumberGTE applies the GTE predicate on the "phone_number" field. +func PhoneNumberGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldPhoneNumber, v)) +} + +// PhoneNumberLT applies the LT predicate on the "phone_number" field. +func PhoneNumberLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldPhoneNumber, v)) +} + +// PhoneNumberLTE applies the LTE predicate on the "phone_number" field. +func PhoneNumberLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldPhoneNumber, v)) +} + +// PhoneNumberContains applies the Contains predicate on the "phone_number" field. +func PhoneNumberContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldPhoneNumber, v)) +} + +// PhoneNumberHasPrefix applies the HasPrefix predicate on the "phone_number" field. +func PhoneNumberHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldPhoneNumber, v)) +} + +// PhoneNumberHasSuffix applies the HasSuffix predicate on the "phone_number" field. +func PhoneNumberHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldPhoneNumber, v)) +} + +// PhoneNumberIsNil applies the IsNil predicate on the "phone_number" field. +func PhoneNumberIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldPhoneNumber)) +} + +// PhoneNumberNotNil applies the NotNil predicate on the "phone_number" field. +func PhoneNumberNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldPhoneNumber)) +} + +// PhoneNumberEqualFold applies the EqualFold predicate on the "phone_number" field. +func PhoneNumberEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldPhoneNumber, v)) +} + +// PhoneNumberContainsFold applies the ContainsFold predicate on the "phone_number" field. +func PhoneNumberContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldPhoneNumber, v)) +} + +// AddressEQ applies the EQ predicate on the "address" field. +func AddressEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldEQ(FieldAddress, v)) +} + +// AddressNEQ applies the NEQ predicate on the "address" field. +func AddressNEQ(v string) predicate.Contact { + return predicate.Contact(sql.FieldNEQ(FieldAddress, v)) +} + +// AddressIn applies the In predicate on the "address" field. +func AddressIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldIn(FieldAddress, vs...)) +} + +// AddressNotIn applies the NotIn predicate on the "address" field. +func AddressNotIn(vs ...string) predicate.Contact { + return predicate.Contact(sql.FieldNotIn(FieldAddress, vs...)) +} + +// AddressGT applies the GT predicate on the "address" field. +func AddressGT(v string) predicate.Contact { + return predicate.Contact(sql.FieldGT(FieldAddress, v)) +} + +// AddressGTE applies the GTE predicate on the "address" field. +func AddressGTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldGTE(FieldAddress, v)) +} + +// AddressLT applies the LT predicate on the "address" field. +func AddressLT(v string) predicate.Contact { + return predicate.Contact(sql.FieldLT(FieldAddress, v)) +} + +// AddressLTE applies the LTE predicate on the "address" field. +func AddressLTE(v string) predicate.Contact { + return predicate.Contact(sql.FieldLTE(FieldAddress, v)) +} + +// AddressContains applies the Contains predicate on the "address" field. +func AddressContains(v string) predicate.Contact { + return predicate.Contact(sql.FieldContains(FieldAddress, v)) +} + +// AddressHasPrefix applies the HasPrefix predicate on the "address" field. +func AddressHasPrefix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasPrefix(FieldAddress, v)) +} + +// AddressHasSuffix applies the HasSuffix predicate on the "address" field. +func AddressHasSuffix(v string) predicate.Contact { + return predicate.Contact(sql.FieldHasSuffix(FieldAddress, v)) +} + +// AddressIsNil applies the IsNil predicate on the "address" field. +func AddressIsNil() predicate.Contact { + return predicate.Contact(sql.FieldIsNull(FieldAddress)) +} + +// AddressNotNil applies the NotNil predicate on the "address" field. +func AddressNotNil() predicate.Contact { + return predicate.Contact(sql.FieldNotNull(FieldAddress)) +} + +// AddressEqualFold applies the EqualFold predicate on the "address" field. +func AddressEqualFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldEqualFold(FieldAddress, v)) +} + +// AddressContainsFold applies the ContainsFold predicate on the "address" field. +func AddressContainsFold(v string) predicate.Contact { + return predicate.Contact(sql.FieldContainsFold(FieldAddress, v)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v enums.UserStatus) predicate.Contact { + vc := v + return predicate.Contact(sql.FieldEQ(FieldStatus, vc)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v enums.UserStatus) predicate.Contact { + vc := v + return predicate.Contact(sql.FieldNEQ(FieldStatus, vc)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...enums.UserStatus) predicate.Contact { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Contact(sql.FieldIn(FieldStatus, v...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...enums.UserStatus) predicate.Contact { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Contact(sql.FieldNotIn(FieldStatus, v...)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Contact { + return predicate.Contact(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Contact + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Contact { + return predicate.Contact(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Contact + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntities applies the HasEdge predicate on the "entities" edge. +func HasEntities() predicate.Contact { + return predicate.Contact(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitiesTable, EntitiesPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityContacts + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitiesWith applies the HasEdge predicate on the "entities" edge with a given conditions (other predicates). +func HasEntitiesWith(preds ...predicate.Entity) predicate.Contact { + return predicate.Contact(func(s *sql.Selector) { + step := newEntitiesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityContacts + 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.Contact) predicate.Contact { + return predicate.Contact(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Contact) predicate.Contact { + return predicate.Contact(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Contact) predicate.Contact { + return predicate.Contact(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/contact_create.go b/internal/ent/generated/contact_create.go new file mode 100644 index 0000000..5c5518c --- /dev/null +++ b/internal/ent/generated/contact_create.go @@ -0,0 +1,596 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/pkg/enums" +) + +// ContactCreate is the builder for creating a Contact entity. +type ContactCreate struct { + config + mutation *ContactMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (cc *ContactCreate) SetCreatedAt(t time.Time) *ContactCreate { + cc.mutation.SetCreatedAt(t) + return cc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (cc *ContactCreate) SetNillableCreatedAt(t *time.Time) *ContactCreate { + if t != nil { + cc.SetCreatedAt(*t) + } + return cc +} + +// SetUpdatedAt sets the "updated_at" field. +func (cc *ContactCreate) SetUpdatedAt(t time.Time) *ContactCreate { + cc.mutation.SetUpdatedAt(t) + return cc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (cc *ContactCreate) SetNillableUpdatedAt(t *time.Time) *ContactCreate { + if t != nil { + cc.SetUpdatedAt(*t) + } + return cc +} + +// SetCreatedBy sets the "created_by" field. +func (cc *ContactCreate) SetCreatedBy(s string) *ContactCreate { + cc.mutation.SetCreatedBy(s) + return cc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (cc *ContactCreate) SetNillableCreatedBy(s *string) *ContactCreate { + if s != nil { + cc.SetCreatedBy(*s) + } + return cc +} + +// SetUpdatedBy sets the "updated_by" field. +func (cc *ContactCreate) SetUpdatedBy(s string) *ContactCreate { + cc.mutation.SetUpdatedBy(s) + return cc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (cc *ContactCreate) SetNillableUpdatedBy(s *string) *ContactCreate { + if s != nil { + cc.SetUpdatedBy(*s) + } + return cc +} + +// SetMappingID sets the "mapping_id" field. +func (cc *ContactCreate) SetMappingID(s string) *ContactCreate { + cc.mutation.SetMappingID(s) + return cc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (cc *ContactCreate) SetNillableMappingID(s *string) *ContactCreate { + if s != nil { + cc.SetMappingID(*s) + } + return cc +} + +// SetDeletedAt sets the "deleted_at" field. +func (cc *ContactCreate) SetDeletedAt(t time.Time) *ContactCreate { + cc.mutation.SetDeletedAt(t) + return cc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (cc *ContactCreate) SetNillableDeletedAt(t *time.Time) *ContactCreate { + if t != nil { + cc.SetDeletedAt(*t) + } + return cc +} + +// SetDeletedBy sets the "deleted_by" field. +func (cc *ContactCreate) SetDeletedBy(s string) *ContactCreate { + cc.mutation.SetDeletedBy(s) + return cc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (cc *ContactCreate) SetNillableDeletedBy(s *string) *ContactCreate { + if s != nil { + cc.SetDeletedBy(*s) + } + return cc +} + +// SetTags sets the "tags" field. +func (cc *ContactCreate) SetTags(s []string) *ContactCreate { + cc.mutation.SetTags(s) + return cc +} + +// SetOwnerID sets the "owner_id" field. +func (cc *ContactCreate) SetOwnerID(s string) *ContactCreate { + cc.mutation.SetOwnerID(s) + return cc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (cc *ContactCreate) SetNillableOwnerID(s *string) *ContactCreate { + if s != nil { + cc.SetOwnerID(*s) + } + return cc +} + +// SetFullName sets the "full_name" field. +func (cc *ContactCreate) SetFullName(s string) *ContactCreate { + cc.mutation.SetFullName(s) + return cc +} + +// SetTitle sets the "title" field. +func (cc *ContactCreate) SetTitle(s string) *ContactCreate { + cc.mutation.SetTitle(s) + return cc +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (cc *ContactCreate) SetNillableTitle(s *string) *ContactCreate { + if s != nil { + cc.SetTitle(*s) + } + return cc +} + +// SetCompany sets the "company" field. +func (cc *ContactCreate) SetCompany(s string) *ContactCreate { + cc.mutation.SetCompany(s) + return cc +} + +// SetNillableCompany sets the "company" field if the given value is not nil. +func (cc *ContactCreate) SetNillableCompany(s *string) *ContactCreate { + if s != nil { + cc.SetCompany(*s) + } + return cc +} + +// SetEmail sets the "email" field. +func (cc *ContactCreate) SetEmail(s string) *ContactCreate { + cc.mutation.SetEmail(s) + return cc +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (cc *ContactCreate) SetNillableEmail(s *string) *ContactCreate { + if s != nil { + cc.SetEmail(*s) + } + return cc +} + +// SetPhoneNumber sets the "phone_number" field. +func (cc *ContactCreate) SetPhoneNumber(s string) *ContactCreate { + cc.mutation.SetPhoneNumber(s) + return cc +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (cc *ContactCreate) SetNillablePhoneNumber(s *string) *ContactCreate { + if s != nil { + cc.SetPhoneNumber(*s) + } + return cc +} + +// SetAddress sets the "address" field. +func (cc *ContactCreate) SetAddress(s string) *ContactCreate { + cc.mutation.SetAddress(s) + return cc +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (cc *ContactCreate) SetNillableAddress(s *string) *ContactCreate { + if s != nil { + cc.SetAddress(*s) + } + return cc +} + +// SetStatus sets the "status" field. +func (cc *ContactCreate) SetStatus(es enums.UserStatus) *ContactCreate { + cc.mutation.SetStatus(es) + return cc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (cc *ContactCreate) SetNillableStatus(es *enums.UserStatus) *ContactCreate { + if es != nil { + cc.SetStatus(*es) + } + return cc +} + +// SetID sets the "id" field. +func (cc *ContactCreate) SetID(s string) *ContactCreate { + cc.mutation.SetID(s) + return cc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (cc *ContactCreate) SetNillableID(s *string) *ContactCreate { + if s != nil { + cc.SetID(*s) + } + return cc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (cc *ContactCreate) SetOwner(o *Organization) *ContactCreate { + return cc.SetOwnerID(o.ID) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (cc *ContactCreate) AddEntityIDs(ids ...string) *ContactCreate { + cc.mutation.AddEntityIDs(ids...) + return cc +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (cc *ContactCreate) AddEntities(e ...*Entity) *ContactCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return cc.AddEntityIDs(ids...) +} + +// Mutation returns the ContactMutation object of the builder. +func (cc *ContactCreate) Mutation() *ContactMutation { + return cc.mutation +} + +// Save creates the Contact in the database. +func (cc *ContactCreate) Save(ctx context.Context) (*Contact, error) { + if err := cc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, cc.sqlSave, cc.mutation, cc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (cc *ContactCreate) SaveX(ctx context.Context) *Contact { + v, err := cc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (cc *ContactCreate) Exec(ctx context.Context) error { + _, err := cc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (cc *ContactCreate) ExecX(ctx context.Context) { + if err := cc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (cc *ContactCreate) defaults() error { + if _, ok := cc.mutation.CreatedAt(); !ok { + if contact.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized contact.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := contact.DefaultCreatedAt() + cc.mutation.SetCreatedAt(v) + } + if _, ok := cc.mutation.UpdatedAt(); !ok { + if contact.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized contact.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := contact.DefaultUpdatedAt() + cc.mutation.SetUpdatedAt(v) + } + if _, ok := cc.mutation.MappingID(); !ok { + if contact.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized contact.DefaultMappingID (forgotten import generated/runtime?)") + } + v := contact.DefaultMappingID() + cc.mutation.SetMappingID(v) + } + if _, ok := cc.mutation.Tags(); !ok { + v := contact.DefaultTags + cc.mutation.SetTags(v) + } + if _, ok := cc.mutation.Status(); !ok { + v := contact.DefaultStatus + cc.mutation.SetStatus(v) + } + if _, ok := cc.mutation.ID(); !ok { + if contact.DefaultID == nil { + return fmt.Errorf("generated: uninitialized contact.DefaultID (forgotten import generated/runtime?)") + } + v := contact.DefaultID() + cc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (cc *ContactCreate) check() error { + if _, ok := cc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Contact.mapping_id"`)} + } + if v, ok := cc.mutation.OwnerID(); ok { + if err := contact.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Contact.owner_id": %w`, err)} + } + } + if _, ok := cc.mutation.FullName(); !ok { + return &ValidationError{Name: "full_name", err: errors.New(`generated: missing required field "Contact.full_name"`)} + } + if v, ok := cc.mutation.FullName(); ok { + if err := contact.FullNameValidator(v); err != nil { + return &ValidationError{Name: "full_name", err: fmt.Errorf(`generated: validator failed for field "Contact.full_name": %w`, err)} + } + } + if v, ok := cc.mutation.Email(); ok { + if err := contact.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "Contact.email": %w`, err)} + } + } + if v, ok := cc.mutation.PhoneNumber(); ok { + if err := contact.PhoneNumberValidator(v); err != nil { + return &ValidationError{Name: "phone_number", err: fmt.Errorf(`generated: validator failed for field "Contact.phone_number": %w`, err)} + } + } + if _, ok := cc.mutation.Status(); !ok { + return &ValidationError{Name: "status", err: errors.New(`generated: missing required field "Contact.status"`)} + } + if v, ok := cc.mutation.Status(); ok { + if err := contact.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "Contact.status": %w`, err)} + } + } + return nil +} + +func (cc *ContactCreate) sqlSave(ctx context.Context) (*Contact, error) { + if err := cc.check(); err != nil { + return nil, err + } + _node, _spec := cc.createSpec() + if err := sqlgraph.CreateNode(ctx, cc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Contact.ID type: %T", _spec.ID.Value) + } + } + cc.mutation.id = &_node.ID + cc.mutation.done = true + return _node, nil +} + +func (cc *ContactCreate) createSpec() (*Contact, *sqlgraph.CreateSpec) { + var ( + _node = &Contact{config: cc.config} + _spec = sqlgraph.NewCreateSpec(contact.Table, sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString)) + ) + _spec.Schema = cc.schemaConfig.Contact + if id, ok := cc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := cc.mutation.CreatedAt(); ok { + _spec.SetField(contact.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := cc.mutation.UpdatedAt(); ok { + _spec.SetField(contact.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := cc.mutation.CreatedBy(); ok { + _spec.SetField(contact.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := cc.mutation.UpdatedBy(); ok { + _spec.SetField(contact.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := cc.mutation.MappingID(); ok { + _spec.SetField(contact.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := cc.mutation.DeletedAt(); ok { + _spec.SetField(contact.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := cc.mutation.DeletedBy(); ok { + _spec.SetField(contact.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := cc.mutation.Tags(); ok { + _spec.SetField(contact.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := cc.mutation.FullName(); ok { + _spec.SetField(contact.FieldFullName, field.TypeString, value) + _node.FullName = value + } + if value, ok := cc.mutation.Title(); ok { + _spec.SetField(contact.FieldTitle, field.TypeString, value) + _node.Title = value + } + if value, ok := cc.mutation.Company(); ok { + _spec.SetField(contact.FieldCompany, field.TypeString, value) + _node.Company = value + } + if value, ok := cc.mutation.Email(); ok { + _spec.SetField(contact.FieldEmail, field.TypeString, value) + _node.Email = value + } + if value, ok := cc.mutation.PhoneNumber(); ok { + _spec.SetField(contact.FieldPhoneNumber, field.TypeString, value) + _node.PhoneNumber = value + } + if value, ok := cc.mutation.Address(); ok { + _spec.SetField(contact.FieldAddress, field.TypeString, value) + _node.Address = value + } + if value, ok := cc.mutation.Status(); ok { + _spec.SetField(contact.FieldStatus, field.TypeEnum, value) + _node.Status = value + } + if nodes := cc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: contact.OwnerTable, + Columns: []string{contact.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = cc.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := cc.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = cc.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// ContactCreateBulk is the builder for creating many Contact entities in bulk. +type ContactCreateBulk struct { + config + err error + builders []*ContactCreate +} + +// Save creates the Contact entities in the database. +func (ccb *ContactCreateBulk) Save(ctx context.Context) ([]*Contact, error) { + if ccb.err != nil { + return nil, ccb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ccb.builders)) + nodes := make([]*Contact, len(ccb.builders)) + mutators := make([]Mutator, len(ccb.builders)) + for i := range ccb.builders { + func(i int, root context.Context) { + builder := ccb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*ContactMutation) + 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, ccb.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, ccb.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, ccb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ccb *ContactCreateBulk) SaveX(ctx context.Context) []*Contact { + v, err := ccb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ccb *ContactCreateBulk) Exec(ctx context.Context) error { + _, err := ccb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ccb *ContactCreateBulk) ExecX(ctx context.Context) { + if err := ccb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/contact_delete.go b/internal/ent/generated/contact_delete.go new file mode 100644 index 0000000..bbaa1c1 --- /dev/null +++ b/internal/ent/generated/contact_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ContactDelete is the builder for deleting a Contact entity. +type ContactDelete struct { + config + hooks []Hook + mutation *ContactMutation +} + +// Where appends a list predicates to the ContactDelete builder. +func (cd *ContactDelete) Where(ps ...predicate.Contact) *ContactDelete { + cd.mutation.Where(ps...) + return cd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (cd *ContactDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, cd.sqlExec, cd.mutation, cd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (cd *ContactDelete) ExecX(ctx context.Context) int { + n, err := cd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (cd *ContactDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(contact.Table, sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString)) + _spec.Node.Schema = cd.schemaConfig.Contact + ctx = internal.NewSchemaConfigContext(ctx, cd.schemaConfig) + if ps := cd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, cd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + cd.mutation.done = true + return affected, err +} + +// ContactDeleteOne is the builder for deleting a single Contact entity. +type ContactDeleteOne struct { + cd *ContactDelete +} + +// Where appends a list predicates to the ContactDelete builder. +func (cdo *ContactDeleteOne) Where(ps ...predicate.Contact) *ContactDeleteOne { + cdo.cd.mutation.Where(ps...) + return cdo +} + +// Exec executes the deletion query. +func (cdo *ContactDeleteOne) Exec(ctx context.Context) error { + n, err := cdo.cd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{contact.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (cdo *ContactDeleteOne) ExecX(ctx context.Context) { + if err := cdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/contact_query.go b/internal/ent/generated/contact_query.go new file mode 100644 index 0000000..e719ffb --- /dev/null +++ b/internal/ent/generated/contact_query.go @@ -0,0 +1,770 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ContactQuery is the builder for querying Contact entities. +type ContactQuery struct { + config + ctx *QueryContext + order []contact.OrderOption + inters []Interceptor + predicates []predicate.Contact + withOwner *OrganizationQuery + withEntities *EntityQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Contact) error + withNamedEntities map[string]*EntityQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the ContactQuery builder. +func (cq *ContactQuery) Where(ps ...predicate.Contact) *ContactQuery { + cq.predicates = append(cq.predicates, ps...) + return cq +} + +// Limit the number of records to be returned by this query. +func (cq *ContactQuery) Limit(limit int) *ContactQuery { + cq.ctx.Limit = &limit + return cq +} + +// Offset to start from. +func (cq *ContactQuery) Offset(offset int) *ContactQuery { + cq.ctx.Offset = &offset + return cq +} + +// 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 (cq *ContactQuery) Unique(unique bool) *ContactQuery { + cq.ctx.Unique = &unique + return cq +} + +// Order specifies how the records should be ordered. +func (cq *ContactQuery) Order(o ...contact.OrderOption) *ContactQuery { + cq.order = append(cq.order, o...) + return cq +} + +// QueryOwner chains the current query on the "owner" edge. +func (cq *ContactQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: cq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := cq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := cq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(contact.Table, contact.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, contact.OwnerTable, contact.OwnerColumn), + ) + schemaConfig := cq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Contact + fromU = sqlgraph.SetNeighbors(cq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntities chains the current query on the "entities" edge. +func (cq *ContactQuery) QueryEntities() *EntityQuery { + query := (&EntityClient{config: cq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := cq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := cq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(contact.Table, contact.FieldID, selector), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, contact.EntitiesTable, contact.EntitiesPrimaryKey...), + ) + schemaConfig := cq.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityContacts + fromU = sqlgraph.SetNeighbors(cq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Contact entity from the query. +// Returns a *NotFoundError when no Contact was found. +func (cq *ContactQuery) First(ctx context.Context) (*Contact, error) { + nodes, err := cq.Limit(1).All(setContextOp(ctx, cq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{contact.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (cq *ContactQuery) FirstX(ctx context.Context) *Contact { + node, err := cq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Contact ID from the query. +// Returns a *NotFoundError when no Contact ID was found. +func (cq *ContactQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = cq.Limit(1).IDs(setContextOp(ctx, cq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{contact.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (cq *ContactQuery) FirstIDX(ctx context.Context) string { + id, err := cq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Contact entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Contact entity is found. +// Returns a *NotFoundError when no Contact entities are found. +func (cq *ContactQuery) Only(ctx context.Context) (*Contact, error) { + nodes, err := cq.Limit(2).All(setContextOp(ctx, cq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{contact.Label} + default: + return nil, &NotSingularError{contact.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (cq *ContactQuery) OnlyX(ctx context.Context) *Contact { + node, err := cq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Contact ID in the query. +// Returns a *NotSingularError when more than one Contact ID is found. +// Returns a *NotFoundError when no entities are found. +func (cq *ContactQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = cq.Limit(2).IDs(setContextOp(ctx, cq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{contact.Label} + default: + err = &NotSingularError{contact.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (cq *ContactQuery) OnlyIDX(ctx context.Context) string { + id, err := cq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Contacts. +func (cq *ContactQuery) All(ctx context.Context) ([]*Contact, error) { + ctx = setContextOp(ctx, cq.ctx, ent.OpQueryAll) + if err := cq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Contact, *ContactQuery]() + return withInterceptors[[]*Contact](ctx, cq, qr, cq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (cq *ContactQuery) AllX(ctx context.Context) []*Contact { + nodes, err := cq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Contact IDs. +func (cq *ContactQuery) IDs(ctx context.Context) (ids []string, err error) { + if cq.ctx.Unique == nil && cq.path != nil { + cq.Unique(true) + } + ctx = setContextOp(ctx, cq.ctx, ent.OpQueryIDs) + if err = cq.Select(contact.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (cq *ContactQuery) IDsX(ctx context.Context) []string { + ids, err := cq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (cq *ContactQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, cq.ctx, ent.OpQueryCount) + if err := cq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, cq, querierCount[*ContactQuery](), cq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (cq *ContactQuery) CountX(ctx context.Context) int { + count, err := cq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (cq *ContactQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, cq.ctx, ent.OpQueryExist) + switch _, err := cq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (cq *ContactQuery) ExistX(ctx context.Context) bool { + exist, err := cq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the ContactQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (cq *ContactQuery) Clone() *ContactQuery { + if cq == nil { + return nil + } + return &ContactQuery{ + config: cq.config, + ctx: cq.ctx.Clone(), + order: append([]contact.OrderOption{}, cq.order...), + inters: append([]Interceptor{}, cq.inters...), + predicates: append([]predicate.Contact{}, cq.predicates...), + withOwner: cq.withOwner.Clone(), + withEntities: cq.withEntities.Clone(), + // clone intermediate query. + sql: cq.sql.Clone(), + path: cq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (cq *ContactQuery) WithOwner(opts ...func(*OrganizationQuery)) *ContactQuery { + query := (&OrganizationClient{config: cq.config}).Query() + for _, opt := range opts { + opt(query) + } + cq.withOwner = query + return cq +} + +// WithEntities tells the query-builder to eager-load the nodes that are connected to +// the "entities" edge. The optional arguments are used to configure the query builder of the edge. +func (cq *ContactQuery) WithEntities(opts ...func(*EntityQuery)) *ContactQuery { + query := (&EntityClient{config: cq.config}).Query() + for _, opt := range opts { + opt(query) + } + cq.withEntities = query + return cq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Contact.Query(). +// GroupBy(contact.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (cq *ContactQuery) GroupBy(field string, fields ...string) *ContactGroupBy { + cq.ctx.Fields = append([]string{field}, fields...) + grbuild := &ContactGroupBy{build: cq} + grbuild.flds = &cq.ctx.Fields + grbuild.label = contact.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Contact.Query(). +// Select(contact.FieldCreatedAt). +// Scan(ctx, &v) +func (cq *ContactQuery) Select(fields ...string) *ContactSelect { + cq.ctx.Fields = append(cq.ctx.Fields, fields...) + sbuild := &ContactSelect{ContactQuery: cq} + sbuild.label = contact.Label + sbuild.flds, sbuild.scan = &cq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a ContactSelect configured with the given aggregations. +func (cq *ContactQuery) Aggregate(fns ...AggregateFunc) *ContactSelect { + return cq.Select().Aggregate(fns...) +} + +func (cq *ContactQuery) prepareQuery(ctx context.Context) error { + for _, inter := range cq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, cq); err != nil { + return err + } + } + } + for _, f := range cq.ctx.Fields { + if !contact.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if cq.path != nil { + prev, err := cq.path(ctx) + if err != nil { + return err + } + cq.sql = prev + } + if contact.Policy == nil { + return errors.New("generated: uninitialized contact.Policy (forgotten import generated/runtime?)") + } + if err := contact.Policy.EvalQuery(ctx, cq); err != nil { + return err + } + return nil +} + +func (cq *ContactQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Contact, error) { + var ( + nodes = []*Contact{} + _spec = cq.querySpec() + loadedTypes = [2]bool{ + cq.withOwner != nil, + cq.withEntities != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Contact).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Contact{config: cq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = cq.schemaConfig.Contact + ctx = internal.NewSchemaConfigContext(ctx, cq.schemaConfig) + if len(cq.modifiers) > 0 { + _spec.Modifiers = cq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, cq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := cq.withOwner; query != nil { + if err := cq.loadOwner(ctx, query, nodes, nil, + func(n *Contact, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := cq.withEntities; query != nil { + if err := cq.loadEntities(ctx, query, nodes, + func(n *Contact) { n.Edges.Entities = []*Entity{} }, + func(n *Contact, e *Entity) { n.Edges.Entities = append(n.Edges.Entities, e) }); err != nil { + return nil, err + } + } + for name, query := range cq.withNamedEntities { + if err := cq.loadEntities(ctx, query, nodes, + func(n *Contact) { n.appendNamedEntities(name) }, + func(n *Contact, e *Entity) { n.appendNamedEntities(name, e) }); err != nil { + return nil, err + } + } + for i := range cq.loadTotal { + if err := cq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (cq *ContactQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Contact, init func(*Contact), assign func(*Contact, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Contact) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (cq *ContactQuery) loadEntities(ctx context.Context, query *EntityQuery, nodes []*Contact, init func(*Contact), assign func(*Contact, *Entity)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Contact) + nids := make(map[string]map[*Contact]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(contact.EntitiesTable) + joinT.Schema(cq.schemaConfig.EntityContacts) + s.Join(joinT).On(s.C(entity.FieldID), joinT.C(contact.EntitiesPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(contact.EntitiesPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(contact.EntitiesPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Contact]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Entity](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "entities" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (cq *ContactQuery) sqlCount(ctx context.Context) (int, error) { + _spec := cq.querySpec() + _spec.Node.Schema = cq.schemaConfig.Contact + ctx = internal.NewSchemaConfigContext(ctx, cq.schemaConfig) + if len(cq.modifiers) > 0 { + _spec.Modifiers = cq.modifiers + } + _spec.Node.Columns = cq.ctx.Fields + if len(cq.ctx.Fields) > 0 { + _spec.Unique = cq.ctx.Unique != nil && *cq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, cq.driver, _spec) +} + +func (cq *ContactQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(contact.Table, contact.Columns, sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString)) + _spec.From = cq.sql + if unique := cq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if cq.path != nil { + _spec.Unique = true + } + if fields := cq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, contact.FieldID) + for i := range fields { + if fields[i] != contact.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if cq.withOwner != nil { + _spec.Node.AddColumnOnce(contact.FieldOwnerID) + } + } + if ps := cq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := cq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := cq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := cq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (cq *ContactQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(cq.driver.Dialect()) + t1 := builder.Table(contact.Table) + columns := cq.ctx.Fields + if len(columns) == 0 { + columns = contact.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if cq.sql != nil { + selector = cq.sql + selector.Select(selector.Columns(columns...)...) + } + if cq.ctx.Unique != nil && *cq.ctx.Unique { + selector.Distinct() + } + t1.Schema(cq.schemaConfig.Contact) + ctx = internal.NewSchemaConfigContext(ctx, cq.schemaConfig) + selector.WithContext(ctx) + for _, p := range cq.predicates { + p(selector) + } + for _, p := range cq.order { + p(selector) + } + if offset := cq.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 := cq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEntities tells the query-builder to eager-load the nodes that are connected to the "entities" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (cq *ContactQuery) WithNamedEntities(name string, opts ...func(*EntityQuery)) *ContactQuery { + query := (&EntityClient{config: cq.config}).Query() + for _, opt := range opts { + opt(query) + } + if cq.withNamedEntities == nil { + cq.withNamedEntities = make(map[string]*EntityQuery) + } + cq.withNamedEntities[name] = query + return cq +} + +// ContactGroupBy is the group-by builder for Contact entities. +type ContactGroupBy struct { + selector + build *ContactQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (cgb *ContactGroupBy) Aggregate(fns ...AggregateFunc) *ContactGroupBy { + cgb.fns = append(cgb.fns, fns...) + return cgb +} + +// Scan applies the selector query and scans the result into the given value. +func (cgb *ContactGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, cgb.build.ctx, ent.OpQueryGroupBy) + if err := cgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*ContactQuery, *ContactGroupBy](ctx, cgb.build, cgb, cgb.build.inters, v) +} + +func (cgb *ContactGroupBy) sqlScan(ctx context.Context, root *ContactQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(cgb.fns)) + for _, fn := range cgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*cgb.flds)+len(cgb.fns)) + for _, f := range *cgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*cgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := cgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// ContactSelect is the builder for selecting fields of Contact entities. +type ContactSelect struct { + *ContactQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (cs *ContactSelect) Aggregate(fns ...AggregateFunc) *ContactSelect { + cs.fns = append(cs.fns, fns...) + return cs +} + +// Scan applies the selector query and scans the result into the given value. +func (cs *ContactSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, cs.ctx, ent.OpQuerySelect) + if err := cs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*ContactQuery, *ContactSelect](ctx, cs.ContactQuery, cs, cs.inters, v) +} + +func (cs *ContactSelect) sqlScan(ctx context.Context, root *ContactQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(cs.fns)) + for _, fn := range cs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*cs.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 := cs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/contact_update.go b/internal/ent/generated/contact_update.go new file mode 100644 index 0000000..bec4794 --- /dev/null +++ b/internal/ent/generated/contact_update.go @@ -0,0 +1,1164 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ContactUpdate is the builder for updating Contact entities. +type ContactUpdate struct { + config + hooks []Hook + mutation *ContactMutation +} + +// Where appends a list predicates to the ContactUpdate builder. +func (cu *ContactUpdate) Where(ps ...predicate.Contact) *ContactUpdate { + cu.mutation.Where(ps...) + return cu +} + +// SetUpdatedAt sets the "updated_at" field. +func (cu *ContactUpdate) SetUpdatedAt(t time.Time) *ContactUpdate { + cu.mutation.SetUpdatedAt(t) + return cu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (cu *ContactUpdate) ClearUpdatedAt() *ContactUpdate { + cu.mutation.ClearUpdatedAt() + return cu +} + +// SetUpdatedBy sets the "updated_by" field. +func (cu *ContactUpdate) SetUpdatedBy(s string) *ContactUpdate { + cu.mutation.SetUpdatedBy(s) + return cu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableUpdatedBy(s *string) *ContactUpdate { + if s != nil { + cu.SetUpdatedBy(*s) + } + return cu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (cu *ContactUpdate) ClearUpdatedBy() *ContactUpdate { + cu.mutation.ClearUpdatedBy() + return cu +} + +// SetDeletedAt sets the "deleted_at" field. +func (cu *ContactUpdate) SetDeletedAt(t time.Time) *ContactUpdate { + cu.mutation.SetDeletedAt(t) + return cu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableDeletedAt(t *time.Time) *ContactUpdate { + if t != nil { + cu.SetDeletedAt(*t) + } + return cu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (cu *ContactUpdate) ClearDeletedAt() *ContactUpdate { + cu.mutation.ClearDeletedAt() + return cu +} + +// SetDeletedBy sets the "deleted_by" field. +func (cu *ContactUpdate) SetDeletedBy(s string) *ContactUpdate { + cu.mutation.SetDeletedBy(s) + return cu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableDeletedBy(s *string) *ContactUpdate { + if s != nil { + cu.SetDeletedBy(*s) + } + return cu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (cu *ContactUpdate) ClearDeletedBy() *ContactUpdate { + cu.mutation.ClearDeletedBy() + return cu +} + +// SetTags sets the "tags" field. +func (cu *ContactUpdate) SetTags(s []string) *ContactUpdate { + cu.mutation.SetTags(s) + return cu +} + +// AppendTags appends s to the "tags" field. +func (cu *ContactUpdate) AppendTags(s []string) *ContactUpdate { + cu.mutation.AppendTags(s) + return cu +} + +// ClearTags clears the value of the "tags" field. +func (cu *ContactUpdate) ClearTags() *ContactUpdate { + cu.mutation.ClearTags() + return cu +} + +// SetOwnerID sets the "owner_id" field. +func (cu *ContactUpdate) SetOwnerID(s string) *ContactUpdate { + cu.mutation.SetOwnerID(s) + return cu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableOwnerID(s *string) *ContactUpdate { + if s != nil { + cu.SetOwnerID(*s) + } + return cu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (cu *ContactUpdate) ClearOwnerID() *ContactUpdate { + cu.mutation.ClearOwnerID() + return cu +} + +// SetFullName sets the "full_name" field. +func (cu *ContactUpdate) SetFullName(s string) *ContactUpdate { + cu.mutation.SetFullName(s) + return cu +} + +// SetNillableFullName sets the "full_name" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableFullName(s *string) *ContactUpdate { + if s != nil { + cu.SetFullName(*s) + } + return cu +} + +// SetTitle sets the "title" field. +func (cu *ContactUpdate) SetTitle(s string) *ContactUpdate { + cu.mutation.SetTitle(s) + return cu +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableTitle(s *string) *ContactUpdate { + if s != nil { + cu.SetTitle(*s) + } + return cu +} + +// ClearTitle clears the value of the "title" field. +func (cu *ContactUpdate) ClearTitle() *ContactUpdate { + cu.mutation.ClearTitle() + return cu +} + +// SetCompany sets the "company" field. +func (cu *ContactUpdate) SetCompany(s string) *ContactUpdate { + cu.mutation.SetCompany(s) + return cu +} + +// SetNillableCompany sets the "company" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableCompany(s *string) *ContactUpdate { + if s != nil { + cu.SetCompany(*s) + } + return cu +} + +// ClearCompany clears the value of the "company" field. +func (cu *ContactUpdate) ClearCompany() *ContactUpdate { + cu.mutation.ClearCompany() + return cu +} + +// SetEmail sets the "email" field. +func (cu *ContactUpdate) SetEmail(s string) *ContactUpdate { + cu.mutation.SetEmail(s) + return cu +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableEmail(s *string) *ContactUpdate { + if s != nil { + cu.SetEmail(*s) + } + return cu +} + +// ClearEmail clears the value of the "email" field. +func (cu *ContactUpdate) ClearEmail() *ContactUpdate { + cu.mutation.ClearEmail() + return cu +} + +// SetPhoneNumber sets the "phone_number" field. +func (cu *ContactUpdate) SetPhoneNumber(s string) *ContactUpdate { + cu.mutation.SetPhoneNumber(s) + return cu +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (cu *ContactUpdate) SetNillablePhoneNumber(s *string) *ContactUpdate { + if s != nil { + cu.SetPhoneNumber(*s) + } + return cu +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (cu *ContactUpdate) ClearPhoneNumber() *ContactUpdate { + cu.mutation.ClearPhoneNumber() + return cu +} + +// SetAddress sets the "address" field. +func (cu *ContactUpdate) SetAddress(s string) *ContactUpdate { + cu.mutation.SetAddress(s) + return cu +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableAddress(s *string) *ContactUpdate { + if s != nil { + cu.SetAddress(*s) + } + return cu +} + +// ClearAddress clears the value of the "address" field. +func (cu *ContactUpdate) ClearAddress() *ContactUpdate { + cu.mutation.ClearAddress() + return cu +} + +// SetStatus sets the "status" field. +func (cu *ContactUpdate) SetStatus(es enums.UserStatus) *ContactUpdate { + cu.mutation.SetStatus(es) + return cu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (cu *ContactUpdate) SetNillableStatus(es *enums.UserStatus) *ContactUpdate { + if es != nil { + cu.SetStatus(*es) + } + return cu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (cu *ContactUpdate) SetOwner(o *Organization) *ContactUpdate { + return cu.SetOwnerID(o.ID) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (cu *ContactUpdate) AddEntityIDs(ids ...string) *ContactUpdate { + cu.mutation.AddEntityIDs(ids...) + return cu +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (cu *ContactUpdate) AddEntities(e ...*Entity) *ContactUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return cu.AddEntityIDs(ids...) +} + +// Mutation returns the ContactMutation object of the builder. +func (cu *ContactUpdate) Mutation() *ContactMutation { + return cu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (cu *ContactUpdate) ClearOwner() *ContactUpdate { + cu.mutation.ClearOwner() + return cu +} + +// ClearEntities clears all "entities" edges to the Entity entity. +func (cu *ContactUpdate) ClearEntities() *ContactUpdate { + cu.mutation.ClearEntities() + return cu +} + +// RemoveEntityIDs removes the "entities" edge to Entity entities by IDs. +func (cu *ContactUpdate) RemoveEntityIDs(ids ...string) *ContactUpdate { + cu.mutation.RemoveEntityIDs(ids...) + return cu +} + +// RemoveEntities removes "entities" edges to Entity entities. +func (cu *ContactUpdate) RemoveEntities(e ...*Entity) *ContactUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return cu.RemoveEntityIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (cu *ContactUpdate) Save(ctx context.Context) (int, error) { + if err := cu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, cu.sqlSave, cu.mutation, cu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (cu *ContactUpdate) SaveX(ctx context.Context) int { + affected, err := cu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (cu *ContactUpdate) Exec(ctx context.Context) error { + _, err := cu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (cu *ContactUpdate) ExecX(ctx context.Context) { + if err := cu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (cu *ContactUpdate) defaults() error { + if _, ok := cu.mutation.UpdatedAt(); !ok && !cu.mutation.UpdatedAtCleared() { + if contact.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized contact.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := contact.UpdateDefaultUpdatedAt() + cu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (cu *ContactUpdate) check() error { + if v, ok := cu.mutation.OwnerID(); ok { + if err := contact.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Contact.owner_id": %w`, err)} + } + } + if v, ok := cu.mutation.FullName(); ok { + if err := contact.FullNameValidator(v); err != nil { + return &ValidationError{Name: "full_name", err: fmt.Errorf(`generated: validator failed for field "Contact.full_name": %w`, err)} + } + } + if v, ok := cu.mutation.Email(); ok { + if err := contact.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "Contact.email": %w`, err)} + } + } + if v, ok := cu.mutation.PhoneNumber(); ok { + if err := contact.PhoneNumberValidator(v); err != nil { + return &ValidationError{Name: "phone_number", err: fmt.Errorf(`generated: validator failed for field "Contact.phone_number": %w`, err)} + } + } + if v, ok := cu.mutation.Status(); ok { + if err := contact.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "Contact.status": %w`, err)} + } + } + return nil +} + +func (cu *ContactUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := cu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(contact.Table, contact.Columns, sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString)) + if ps := cu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if cu.mutation.CreatedAtCleared() { + _spec.ClearField(contact.FieldCreatedAt, field.TypeTime) + } + if value, ok := cu.mutation.UpdatedAt(); ok { + _spec.SetField(contact.FieldUpdatedAt, field.TypeTime, value) + } + if cu.mutation.UpdatedAtCleared() { + _spec.ClearField(contact.FieldUpdatedAt, field.TypeTime) + } + if cu.mutation.CreatedByCleared() { + _spec.ClearField(contact.FieldCreatedBy, field.TypeString) + } + if value, ok := cu.mutation.UpdatedBy(); ok { + _spec.SetField(contact.FieldUpdatedBy, field.TypeString, value) + } + if cu.mutation.UpdatedByCleared() { + _spec.ClearField(contact.FieldUpdatedBy, field.TypeString) + } + if value, ok := cu.mutation.DeletedAt(); ok { + _spec.SetField(contact.FieldDeletedAt, field.TypeTime, value) + } + if cu.mutation.DeletedAtCleared() { + _spec.ClearField(contact.FieldDeletedAt, field.TypeTime) + } + if value, ok := cu.mutation.DeletedBy(); ok { + _spec.SetField(contact.FieldDeletedBy, field.TypeString, value) + } + if cu.mutation.DeletedByCleared() { + _spec.ClearField(contact.FieldDeletedBy, field.TypeString) + } + if value, ok := cu.mutation.Tags(); ok { + _spec.SetField(contact.FieldTags, field.TypeJSON, value) + } + if value, ok := cu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, contact.FieldTags, value) + }) + } + if cu.mutation.TagsCleared() { + _spec.ClearField(contact.FieldTags, field.TypeJSON) + } + if value, ok := cu.mutation.FullName(); ok { + _spec.SetField(contact.FieldFullName, field.TypeString, value) + } + if value, ok := cu.mutation.Title(); ok { + _spec.SetField(contact.FieldTitle, field.TypeString, value) + } + if cu.mutation.TitleCleared() { + _spec.ClearField(contact.FieldTitle, field.TypeString) + } + if value, ok := cu.mutation.Company(); ok { + _spec.SetField(contact.FieldCompany, field.TypeString, value) + } + if cu.mutation.CompanyCleared() { + _spec.ClearField(contact.FieldCompany, field.TypeString) + } + if value, ok := cu.mutation.Email(); ok { + _spec.SetField(contact.FieldEmail, field.TypeString, value) + } + if cu.mutation.EmailCleared() { + _spec.ClearField(contact.FieldEmail, field.TypeString) + } + if value, ok := cu.mutation.PhoneNumber(); ok { + _spec.SetField(contact.FieldPhoneNumber, field.TypeString, value) + } + if cu.mutation.PhoneNumberCleared() { + _spec.ClearField(contact.FieldPhoneNumber, field.TypeString) + } + if value, ok := cu.mutation.Address(); ok { + _spec.SetField(contact.FieldAddress, field.TypeString, value) + } + if cu.mutation.AddressCleared() { + _spec.ClearField(contact.FieldAddress, field.TypeString) + } + if value, ok := cu.mutation.Status(); ok { + _spec.SetField(contact.FieldStatus, field.TypeEnum, value) + } + if cu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: contact.OwnerTable, + Columns: []string{contact.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = cu.schemaConfig.Contact + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := cu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: contact.OwnerTable, + Columns: []string{contact.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = cu.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if cu.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = cu.schemaConfig.EntityContacts + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := cu.mutation.RemovedEntitiesIDs(); len(nodes) > 0 && !cu.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = cu.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := cu.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = cu.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = cu.schemaConfig.Contact + ctx = internal.NewSchemaConfigContext(ctx, cu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, cu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{contact.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + cu.mutation.done = true + return n, nil +} + +// ContactUpdateOne is the builder for updating a single Contact entity. +type ContactUpdateOne struct { + config + fields []string + hooks []Hook + mutation *ContactMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (cuo *ContactUpdateOne) SetUpdatedAt(t time.Time) *ContactUpdateOne { + cuo.mutation.SetUpdatedAt(t) + return cuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (cuo *ContactUpdateOne) ClearUpdatedAt() *ContactUpdateOne { + cuo.mutation.ClearUpdatedAt() + return cuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (cuo *ContactUpdateOne) SetUpdatedBy(s string) *ContactUpdateOne { + cuo.mutation.SetUpdatedBy(s) + return cuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableUpdatedBy(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetUpdatedBy(*s) + } + return cuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (cuo *ContactUpdateOne) ClearUpdatedBy() *ContactUpdateOne { + cuo.mutation.ClearUpdatedBy() + return cuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (cuo *ContactUpdateOne) SetDeletedAt(t time.Time) *ContactUpdateOne { + cuo.mutation.SetDeletedAt(t) + return cuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableDeletedAt(t *time.Time) *ContactUpdateOne { + if t != nil { + cuo.SetDeletedAt(*t) + } + return cuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (cuo *ContactUpdateOne) ClearDeletedAt() *ContactUpdateOne { + cuo.mutation.ClearDeletedAt() + return cuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (cuo *ContactUpdateOne) SetDeletedBy(s string) *ContactUpdateOne { + cuo.mutation.SetDeletedBy(s) + return cuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableDeletedBy(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetDeletedBy(*s) + } + return cuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (cuo *ContactUpdateOne) ClearDeletedBy() *ContactUpdateOne { + cuo.mutation.ClearDeletedBy() + return cuo +} + +// SetTags sets the "tags" field. +func (cuo *ContactUpdateOne) SetTags(s []string) *ContactUpdateOne { + cuo.mutation.SetTags(s) + return cuo +} + +// AppendTags appends s to the "tags" field. +func (cuo *ContactUpdateOne) AppendTags(s []string) *ContactUpdateOne { + cuo.mutation.AppendTags(s) + return cuo +} + +// ClearTags clears the value of the "tags" field. +func (cuo *ContactUpdateOne) ClearTags() *ContactUpdateOne { + cuo.mutation.ClearTags() + return cuo +} + +// SetOwnerID sets the "owner_id" field. +func (cuo *ContactUpdateOne) SetOwnerID(s string) *ContactUpdateOne { + cuo.mutation.SetOwnerID(s) + return cuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableOwnerID(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetOwnerID(*s) + } + return cuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (cuo *ContactUpdateOne) ClearOwnerID() *ContactUpdateOne { + cuo.mutation.ClearOwnerID() + return cuo +} + +// SetFullName sets the "full_name" field. +func (cuo *ContactUpdateOne) SetFullName(s string) *ContactUpdateOne { + cuo.mutation.SetFullName(s) + return cuo +} + +// SetNillableFullName sets the "full_name" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableFullName(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetFullName(*s) + } + return cuo +} + +// SetTitle sets the "title" field. +func (cuo *ContactUpdateOne) SetTitle(s string) *ContactUpdateOne { + cuo.mutation.SetTitle(s) + return cuo +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableTitle(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetTitle(*s) + } + return cuo +} + +// ClearTitle clears the value of the "title" field. +func (cuo *ContactUpdateOne) ClearTitle() *ContactUpdateOne { + cuo.mutation.ClearTitle() + return cuo +} + +// SetCompany sets the "company" field. +func (cuo *ContactUpdateOne) SetCompany(s string) *ContactUpdateOne { + cuo.mutation.SetCompany(s) + return cuo +} + +// SetNillableCompany sets the "company" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableCompany(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetCompany(*s) + } + return cuo +} + +// ClearCompany clears the value of the "company" field. +func (cuo *ContactUpdateOne) ClearCompany() *ContactUpdateOne { + cuo.mutation.ClearCompany() + return cuo +} + +// SetEmail sets the "email" field. +func (cuo *ContactUpdateOne) SetEmail(s string) *ContactUpdateOne { + cuo.mutation.SetEmail(s) + return cuo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableEmail(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetEmail(*s) + } + return cuo +} + +// ClearEmail clears the value of the "email" field. +func (cuo *ContactUpdateOne) ClearEmail() *ContactUpdateOne { + cuo.mutation.ClearEmail() + return cuo +} + +// SetPhoneNumber sets the "phone_number" field. +func (cuo *ContactUpdateOne) SetPhoneNumber(s string) *ContactUpdateOne { + cuo.mutation.SetPhoneNumber(s) + return cuo +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillablePhoneNumber(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetPhoneNumber(*s) + } + return cuo +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (cuo *ContactUpdateOne) ClearPhoneNumber() *ContactUpdateOne { + cuo.mutation.ClearPhoneNumber() + return cuo +} + +// SetAddress sets the "address" field. +func (cuo *ContactUpdateOne) SetAddress(s string) *ContactUpdateOne { + cuo.mutation.SetAddress(s) + return cuo +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableAddress(s *string) *ContactUpdateOne { + if s != nil { + cuo.SetAddress(*s) + } + return cuo +} + +// ClearAddress clears the value of the "address" field. +func (cuo *ContactUpdateOne) ClearAddress() *ContactUpdateOne { + cuo.mutation.ClearAddress() + return cuo +} + +// SetStatus sets the "status" field. +func (cuo *ContactUpdateOne) SetStatus(es enums.UserStatus) *ContactUpdateOne { + cuo.mutation.SetStatus(es) + return cuo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (cuo *ContactUpdateOne) SetNillableStatus(es *enums.UserStatus) *ContactUpdateOne { + if es != nil { + cuo.SetStatus(*es) + } + return cuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (cuo *ContactUpdateOne) SetOwner(o *Organization) *ContactUpdateOne { + return cuo.SetOwnerID(o.ID) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (cuo *ContactUpdateOne) AddEntityIDs(ids ...string) *ContactUpdateOne { + cuo.mutation.AddEntityIDs(ids...) + return cuo +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (cuo *ContactUpdateOne) AddEntities(e ...*Entity) *ContactUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return cuo.AddEntityIDs(ids...) +} + +// Mutation returns the ContactMutation object of the builder. +func (cuo *ContactUpdateOne) Mutation() *ContactMutation { + return cuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (cuo *ContactUpdateOne) ClearOwner() *ContactUpdateOne { + cuo.mutation.ClearOwner() + return cuo +} + +// ClearEntities clears all "entities" edges to the Entity entity. +func (cuo *ContactUpdateOne) ClearEntities() *ContactUpdateOne { + cuo.mutation.ClearEntities() + return cuo +} + +// RemoveEntityIDs removes the "entities" edge to Entity entities by IDs. +func (cuo *ContactUpdateOne) RemoveEntityIDs(ids ...string) *ContactUpdateOne { + cuo.mutation.RemoveEntityIDs(ids...) + return cuo +} + +// RemoveEntities removes "entities" edges to Entity entities. +func (cuo *ContactUpdateOne) RemoveEntities(e ...*Entity) *ContactUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return cuo.RemoveEntityIDs(ids...) +} + +// Where appends a list predicates to the ContactUpdate builder. +func (cuo *ContactUpdateOne) Where(ps ...predicate.Contact) *ContactUpdateOne { + cuo.mutation.Where(ps...) + return cuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (cuo *ContactUpdateOne) Select(field string, fields ...string) *ContactUpdateOne { + cuo.fields = append([]string{field}, fields...) + return cuo +} + +// Save executes the query and returns the updated Contact entity. +func (cuo *ContactUpdateOne) Save(ctx context.Context) (*Contact, error) { + if err := cuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, cuo.sqlSave, cuo.mutation, cuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (cuo *ContactUpdateOne) SaveX(ctx context.Context) *Contact { + node, err := cuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (cuo *ContactUpdateOne) Exec(ctx context.Context) error { + _, err := cuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (cuo *ContactUpdateOne) ExecX(ctx context.Context) { + if err := cuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (cuo *ContactUpdateOne) defaults() error { + if _, ok := cuo.mutation.UpdatedAt(); !ok && !cuo.mutation.UpdatedAtCleared() { + if contact.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized contact.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := contact.UpdateDefaultUpdatedAt() + cuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (cuo *ContactUpdateOne) check() error { + if v, ok := cuo.mutation.OwnerID(); ok { + if err := contact.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Contact.owner_id": %w`, err)} + } + } + if v, ok := cuo.mutation.FullName(); ok { + if err := contact.FullNameValidator(v); err != nil { + return &ValidationError{Name: "full_name", err: fmt.Errorf(`generated: validator failed for field "Contact.full_name": %w`, err)} + } + } + if v, ok := cuo.mutation.Email(); ok { + if err := contact.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "Contact.email": %w`, err)} + } + } + if v, ok := cuo.mutation.PhoneNumber(); ok { + if err := contact.PhoneNumberValidator(v); err != nil { + return &ValidationError{Name: "phone_number", err: fmt.Errorf(`generated: validator failed for field "Contact.phone_number": %w`, err)} + } + } + if v, ok := cuo.mutation.Status(); ok { + if err := contact.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "Contact.status": %w`, err)} + } + } + return nil +} + +func (cuo *ContactUpdateOne) sqlSave(ctx context.Context) (_node *Contact, err error) { + if err := cuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(contact.Table, contact.Columns, sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString)) + id, ok := cuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Contact.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := cuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, contact.FieldID) + for _, f := range fields { + if !contact.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != contact.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := cuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if cuo.mutation.CreatedAtCleared() { + _spec.ClearField(contact.FieldCreatedAt, field.TypeTime) + } + if value, ok := cuo.mutation.UpdatedAt(); ok { + _spec.SetField(contact.FieldUpdatedAt, field.TypeTime, value) + } + if cuo.mutation.UpdatedAtCleared() { + _spec.ClearField(contact.FieldUpdatedAt, field.TypeTime) + } + if cuo.mutation.CreatedByCleared() { + _spec.ClearField(contact.FieldCreatedBy, field.TypeString) + } + if value, ok := cuo.mutation.UpdatedBy(); ok { + _spec.SetField(contact.FieldUpdatedBy, field.TypeString, value) + } + if cuo.mutation.UpdatedByCleared() { + _spec.ClearField(contact.FieldUpdatedBy, field.TypeString) + } + if value, ok := cuo.mutation.DeletedAt(); ok { + _spec.SetField(contact.FieldDeletedAt, field.TypeTime, value) + } + if cuo.mutation.DeletedAtCleared() { + _spec.ClearField(contact.FieldDeletedAt, field.TypeTime) + } + if value, ok := cuo.mutation.DeletedBy(); ok { + _spec.SetField(contact.FieldDeletedBy, field.TypeString, value) + } + if cuo.mutation.DeletedByCleared() { + _spec.ClearField(contact.FieldDeletedBy, field.TypeString) + } + if value, ok := cuo.mutation.Tags(); ok { + _spec.SetField(contact.FieldTags, field.TypeJSON, value) + } + if value, ok := cuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, contact.FieldTags, value) + }) + } + if cuo.mutation.TagsCleared() { + _spec.ClearField(contact.FieldTags, field.TypeJSON) + } + if value, ok := cuo.mutation.FullName(); ok { + _spec.SetField(contact.FieldFullName, field.TypeString, value) + } + if value, ok := cuo.mutation.Title(); ok { + _spec.SetField(contact.FieldTitle, field.TypeString, value) + } + if cuo.mutation.TitleCleared() { + _spec.ClearField(contact.FieldTitle, field.TypeString) + } + if value, ok := cuo.mutation.Company(); ok { + _spec.SetField(contact.FieldCompany, field.TypeString, value) + } + if cuo.mutation.CompanyCleared() { + _spec.ClearField(contact.FieldCompany, field.TypeString) + } + if value, ok := cuo.mutation.Email(); ok { + _spec.SetField(contact.FieldEmail, field.TypeString, value) + } + if cuo.mutation.EmailCleared() { + _spec.ClearField(contact.FieldEmail, field.TypeString) + } + if value, ok := cuo.mutation.PhoneNumber(); ok { + _spec.SetField(contact.FieldPhoneNumber, field.TypeString, value) + } + if cuo.mutation.PhoneNumberCleared() { + _spec.ClearField(contact.FieldPhoneNumber, field.TypeString) + } + if value, ok := cuo.mutation.Address(); ok { + _spec.SetField(contact.FieldAddress, field.TypeString, value) + } + if cuo.mutation.AddressCleared() { + _spec.ClearField(contact.FieldAddress, field.TypeString) + } + if value, ok := cuo.mutation.Status(); ok { + _spec.SetField(contact.FieldStatus, field.TypeEnum, value) + } + if cuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: contact.OwnerTable, + Columns: []string{contact.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = cuo.schemaConfig.Contact + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := cuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: contact.OwnerTable, + Columns: []string{contact.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = cuo.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if cuo.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = cuo.schemaConfig.EntityContacts + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := cuo.mutation.RemovedEntitiesIDs(); len(nodes) > 0 && !cuo.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = cuo.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := cuo.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = cuo.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = cuo.schemaConfig.Contact + ctx = internal.NewSchemaConfigContext(ctx, cuo.schemaConfig) + _node = &Contact{config: cuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, cuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{contact.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + cuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/contacthistory.go b/internal/ent/generated/contacthistory.go new file mode 100644 index 0000000..45b6639 --- /dev/null +++ b/internal/ent/generated/contacthistory.go @@ -0,0 +1,311 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ContactHistory is the model entity for the ContactHistory schema. +type ContactHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the full name of the contact + FullName string `json:"full_name,omitempty"` + // the title of the contact + Title string `json:"title,omitempty"` + // the company of the contact + Company string `json:"company,omitempty"` + // the email of the contact + Email string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber string `json:"phone_number,omitempty"` + // the address of the contact + Address string `json:"address,omitempty"` + // status of the contact + Status enums.UserStatus `json:"status,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*ContactHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case contacthistory.FieldTags: + values[i] = new([]byte) + case contacthistory.FieldOperation: + values[i] = new(history.OpType) + case contacthistory.FieldID, contacthistory.FieldRef, contacthistory.FieldCreatedBy, contacthistory.FieldUpdatedBy, contacthistory.FieldMappingID, contacthistory.FieldDeletedBy, contacthistory.FieldOwnerID, contacthistory.FieldFullName, contacthistory.FieldTitle, contacthistory.FieldCompany, contacthistory.FieldEmail, contacthistory.FieldPhoneNumber, contacthistory.FieldAddress, contacthistory.FieldStatus: + values[i] = new(sql.NullString) + case contacthistory.FieldHistoryTime, contacthistory.FieldCreatedAt, contacthistory.FieldUpdatedAt, contacthistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the ContactHistory fields. +func (ch *ContactHistory) 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 contacthistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + ch.ID = value.String + } + case contacthistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + ch.HistoryTime = value.Time + } + case contacthistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + ch.Ref = value.String + } + case contacthistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + ch.Operation = *value + } + case contacthistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + ch.CreatedAt = value.Time + } + case contacthistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + ch.UpdatedAt = value.Time + } + case contacthistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + ch.CreatedBy = value.String + } + case contacthistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + ch.UpdatedBy = value.String + } + case contacthistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + ch.MappingID = value.String + } + case contacthistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + ch.DeletedAt = value.Time + } + case contacthistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + ch.DeletedBy = value.String + } + case contacthistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ch.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case contacthistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + ch.OwnerID = value.String + } + case contacthistory.FieldFullName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field full_name", values[i]) + } else if value.Valid { + ch.FullName = value.String + } + case contacthistory.FieldTitle: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field title", values[i]) + } else if value.Valid { + ch.Title = value.String + } + case contacthistory.FieldCompany: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field company", values[i]) + } else if value.Valid { + ch.Company = value.String + } + case contacthistory.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + ch.Email = value.String + } + case contacthistory.FieldPhoneNumber: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field phone_number", values[i]) + } else if value.Valid { + ch.PhoneNumber = value.String + } + case contacthistory.FieldAddress: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field address", values[i]) + } else if value.Valid { + ch.Address = value.String + } + case contacthistory.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + ch.Status = enums.UserStatus(value.String) + } + default: + ch.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the ContactHistory. +// This includes values selected through modifiers, order, etc. +func (ch *ContactHistory) Value(name string) (ent.Value, error) { + return ch.selectValues.Get(name) +} + +// Update returns a builder for updating this ContactHistory. +// Note that you need to call ContactHistory.Unwrap() before calling this method if this ContactHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (ch *ContactHistory) Update() *ContactHistoryUpdateOne { + return NewContactHistoryClient(ch.config).UpdateOne(ch) +} + +// Unwrap unwraps the ContactHistory 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 (ch *ContactHistory) Unwrap() *ContactHistory { + _tx, ok := ch.config.driver.(*txDriver) + if !ok { + panic("generated: ContactHistory is not a transactional entity") + } + ch.config.driver = _tx.drv + return ch +} + +// String implements the fmt.Stringer. +func (ch *ContactHistory) String() string { + var builder strings.Builder + builder.WriteString("ContactHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", ch.ID)) + builder.WriteString("history_time=") + builder.WriteString(ch.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(ch.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", ch.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(ch.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(ch.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(ch.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(ch.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(ch.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(ch.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(ch.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", ch.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(ch.OwnerID) + builder.WriteString(", ") + builder.WriteString("full_name=") + builder.WriteString(ch.FullName) + builder.WriteString(", ") + builder.WriteString("title=") + builder.WriteString(ch.Title) + builder.WriteString(", ") + builder.WriteString("company=") + builder.WriteString(ch.Company) + builder.WriteString(", ") + builder.WriteString("email=") + builder.WriteString(ch.Email) + builder.WriteString(", ") + builder.WriteString("phone_number=") + builder.WriteString(ch.PhoneNumber) + builder.WriteString(", ") + builder.WriteString("address=") + builder.WriteString(ch.Address) + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", ch.Status)) + builder.WriteByte(')') + return builder.String() +} + +// ContactHistories is a parsable slice of ContactHistory. +type ContactHistories []*ContactHistory diff --git a/internal/ent/generated/contacthistory/contacthistory.go b/internal/ent/generated/contacthistory/contacthistory.go new file mode 100644 index 0000000..6ba46fe --- /dev/null +++ b/internal/ent/generated/contacthistory/contacthistory.go @@ -0,0 +1,254 @@ +// Code generated by ent, DO NOT EDIT. + +package contacthistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the contacthistory type in the database. + Label = "contact_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldFullName holds the string denoting the full_name field in the database. + FieldFullName = "full_name" + // FieldTitle holds the string denoting the title field in the database. + FieldTitle = "title" + // FieldCompany holds the string denoting the company field in the database. + FieldCompany = "company" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldPhoneNumber holds the string denoting the phone_number field in the database. + FieldPhoneNumber = "phone_number" + // FieldAddress holds the string denoting the address field in the database. + FieldAddress = "address" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // Table holds the table name of the contacthistory in the database. + Table = "contact_history" +) + +// Columns holds all SQL columns for contacthistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldFullName, + FieldTitle, + FieldCompany, + FieldEmail, + FieldPhoneNumber, + FieldAddress, + FieldStatus, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("contacthistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultStatus enums.UserStatus = "ACTIVE" + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s enums.UserStatus) error { + switch s.String() { + case "ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING": + return nil + default: + return fmt.Errorf("contacthistory: invalid enum value for status field: %q", s) + } +} + +// OrderOption defines the ordering options for the ContactHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByFullName orders the results by the full_name field. +func ByFullName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFullName, opts...).ToFunc() +} + +// ByTitle orders the results by the title field. +func ByTitle(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTitle, opts...).ToFunc() +} + +// ByCompany orders the results by the company field. +func ByCompany(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCompany, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByPhoneNumber orders the results by the phone_number field. +func ByPhoneNumber(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPhoneNumber, opts...).ToFunc() +} + +// ByAddress orders the results by the address field. +func ByAddress(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAddress, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.UserStatus must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.UserStatus)(nil) + // enums.UserStatus must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.UserStatus)(nil) +) diff --git a/internal/ent/generated/contacthistory/where.go b/internal/ent/generated/contacthistory/where.go new file mode 100644 index 0000000..fbc21b5 --- /dev/null +++ b/internal/ent/generated/contacthistory/where.go @@ -0,0 +1,1292 @@ +// Code generated by ent, DO NOT EDIT. + +package contacthistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// FullName applies equality check predicate on the "full_name" field. It's identical to FullNameEQ. +func FullName(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldFullName, v)) +} + +// Title applies equality check predicate on the "title" field. It's identical to TitleEQ. +func Title(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldTitle, v)) +} + +// Company applies equality check predicate on the "company" field. It's identical to CompanyEQ. +func Company(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldCompany, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldEmail, v)) +} + +// PhoneNumber applies equality check predicate on the "phone_number" field. It's identical to PhoneNumberEQ. +func PhoneNumber(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// Address applies equality check predicate on the "address" field. It's identical to AddressEQ. +func Address(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldAddress, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// FullNameEQ applies the EQ predicate on the "full_name" field. +func FullNameEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldFullName, v)) +} + +// FullNameNEQ applies the NEQ predicate on the "full_name" field. +func FullNameNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldFullName, v)) +} + +// FullNameIn applies the In predicate on the "full_name" field. +func FullNameIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldFullName, vs...)) +} + +// FullNameNotIn applies the NotIn predicate on the "full_name" field. +func FullNameNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldFullName, vs...)) +} + +// FullNameGT applies the GT predicate on the "full_name" field. +func FullNameGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldFullName, v)) +} + +// FullNameGTE applies the GTE predicate on the "full_name" field. +func FullNameGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldFullName, v)) +} + +// FullNameLT applies the LT predicate on the "full_name" field. +func FullNameLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldFullName, v)) +} + +// FullNameLTE applies the LTE predicate on the "full_name" field. +func FullNameLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldFullName, v)) +} + +// FullNameContains applies the Contains predicate on the "full_name" field. +func FullNameContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldFullName, v)) +} + +// FullNameHasPrefix applies the HasPrefix predicate on the "full_name" field. +func FullNameHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldFullName, v)) +} + +// FullNameHasSuffix applies the HasSuffix predicate on the "full_name" field. +func FullNameHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldFullName, v)) +} + +// FullNameEqualFold applies the EqualFold predicate on the "full_name" field. +func FullNameEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldFullName, v)) +} + +// FullNameContainsFold applies the ContainsFold predicate on the "full_name" field. +func FullNameContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldFullName, v)) +} + +// TitleEQ applies the EQ predicate on the "title" field. +func TitleEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldTitle, v)) +} + +// TitleNEQ applies the NEQ predicate on the "title" field. +func TitleNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldTitle, v)) +} + +// TitleIn applies the In predicate on the "title" field. +func TitleIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldTitle, vs...)) +} + +// TitleNotIn applies the NotIn predicate on the "title" field. +func TitleNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldTitle, vs...)) +} + +// TitleGT applies the GT predicate on the "title" field. +func TitleGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldTitle, v)) +} + +// TitleGTE applies the GTE predicate on the "title" field. +func TitleGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldTitle, v)) +} + +// TitleLT applies the LT predicate on the "title" field. +func TitleLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldTitle, v)) +} + +// TitleLTE applies the LTE predicate on the "title" field. +func TitleLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldTitle, v)) +} + +// TitleContains applies the Contains predicate on the "title" field. +func TitleContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldTitle, v)) +} + +// TitleHasPrefix applies the HasPrefix predicate on the "title" field. +func TitleHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldTitle, v)) +} + +// TitleHasSuffix applies the HasSuffix predicate on the "title" field. +func TitleHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldTitle, v)) +} + +// TitleIsNil applies the IsNil predicate on the "title" field. +func TitleIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldTitle)) +} + +// TitleNotNil applies the NotNil predicate on the "title" field. +func TitleNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldTitle)) +} + +// TitleEqualFold applies the EqualFold predicate on the "title" field. +func TitleEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldTitle, v)) +} + +// TitleContainsFold applies the ContainsFold predicate on the "title" field. +func TitleContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldTitle, v)) +} + +// CompanyEQ applies the EQ predicate on the "company" field. +func CompanyEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldCompany, v)) +} + +// CompanyNEQ applies the NEQ predicate on the "company" field. +func CompanyNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldCompany, v)) +} + +// CompanyIn applies the In predicate on the "company" field. +func CompanyIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldCompany, vs...)) +} + +// CompanyNotIn applies the NotIn predicate on the "company" field. +func CompanyNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldCompany, vs...)) +} + +// CompanyGT applies the GT predicate on the "company" field. +func CompanyGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldCompany, v)) +} + +// CompanyGTE applies the GTE predicate on the "company" field. +func CompanyGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldCompany, v)) +} + +// CompanyLT applies the LT predicate on the "company" field. +func CompanyLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldCompany, v)) +} + +// CompanyLTE applies the LTE predicate on the "company" field. +func CompanyLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldCompany, v)) +} + +// CompanyContains applies the Contains predicate on the "company" field. +func CompanyContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldCompany, v)) +} + +// CompanyHasPrefix applies the HasPrefix predicate on the "company" field. +func CompanyHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldCompany, v)) +} + +// CompanyHasSuffix applies the HasSuffix predicate on the "company" field. +func CompanyHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldCompany, v)) +} + +// CompanyIsNil applies the IsNil predicate on the "company" field. +func CompanyIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldCompany)) +} + +// CompanyNotNil applies the NotNil predicate on the "company" field. +func CompanyNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldCompany)) +} + +// CompanyEqualFold applies the EqualFold predicate on the "company" field. +func CompanyEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldCompany, v)) +} + +// CompanyContainsFold applies the ContainsFold predicate on the "company" field. +func CompanyContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldCompany, v)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailIsNil applies the IsNil predicate on the "email" field. +func EmailIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldEmail)) +} + +// EmailNotNil applies the NotNil predicate on the "email" field. +func EmailNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldEmail)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldEmail, v)) +} + +// PhoneNumberEQ applies the EQ predicate on the "phone_number" field. +func PhoneNumberEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberNEQ applies the NEQ predicate on the "phone_number" field. +func PhoneNumberNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberIn applies the In predicate on the "phone_number" field. +func PhoneNumberIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberNotIn applies the NotIn predicate on the "phone_number" field. +func PhoneNumberNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberGT applies the GT predicate on the "phone_number" field. +func PhoneNumberGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldPhoneNumber, v)) +} + +// PhoneNumberGTE applies the GTE predicate on the "phone_number" field. +func PhoneNumberGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldPhoneNumber, v)) +} + +// PhoneNumberLT applies the LT predicate on the "phone_number" field. +func PhoneNumberLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldPhoneNumber, v)) +} + +// PhoneNumberLTE applies the LTE predicate on the "phone_number" field. +func PhoneNumberLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldPhoneNumber, v)) +} + +// PhoneNumberContains applies the Contains predicate on the "phone_number" field. +func PhoneNumberContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldPhoneNumber, v)) +} + +// PhoneNumberHasPrefix applies the HasPrefix predicate on the "phone_number" field. +func PhoneNumberHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldPhoneNumber, v)) +} + +// PhoneNumberHasSuffix applies the HasSuffix predicate on the "phone_number" field. +func PhoneNumberHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldPhoneNumber, v)) +} + +// PhoneNumberIsNil applies the IsNil predicate on the "phone_number" field. +func PhoneNumberIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldPhoneNumber)) +} + +// PhoneNumberNotNil applies the NotNil predicate on the "phone_number" field. +func PhoneNumberNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldPhoneNumber)) +} + +// PhoneNumberEqualFold applies the EqualFold predicate on the "phone_number" field. +func PhoneNumberEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldPhoneNumber, v)) +} + +// PhoneNumberContainsFold applies the ContainsFold predicate on the "phone_number" field. +func PhoneNumberContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldPhoneNumber, v)) +} + +// AddressEQ applies the EQ predicate on the "address" field. +func AddressEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEQ(FieldAddress, v)) +} + +// AddressNEQ applies the NEQ predicate on the "address" field. +func AddressNEQ(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNEQ(FieldAddress, v)) +} + +// AddressIn applies the In predicate on the "address" field. +func AddressIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIn(FieldAddress, vs...)) +} + +// AddressNotIn applies the NotIn predicate on the "address" field. +func AddressNotIn(vs ...string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotIn(FieldAddress, vs...)) +} + +// AddressGT applies the GT predicate on the "address" field. +func AddressGT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGT(FieldAddress, v)) +} + +// AddressGTE applies the GTE predicate on the "address" field. +func AddressGTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldGTE(FieldAddress, v)) +} + +// AddressLT applies the LT predicate on the "address" field. +func AddressLT(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLT(FieldAddress, v)) +} + +// AddressLTE applies the LTE predicate on the "address" field. +func AddressLTE(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldLTE(FieldAddress, v)) +} + +// AddressContains applies the Contains predicate on the "address" field. +func AddressContains(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContains(FieldAddress, v)) +} + +// AddressHasPrefix applies the HasPrefix predicate on the "address" field. +func AddressHasPrefix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasPrefix(FieldAddress, v)) +} + +// AddressHasSuffix applies the HasSuffix predicate on the "address" field. +func AddressHasSuffix(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldHasSuffix(FieldAddress, v)) +} + +// AddressIsNil applies the IsNil predicate on the "address" field. +func AddressIsNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldIsNull(FieldAddress)) +} + +// AddressNotNil applies the NotNil predicate on the "address" field. +func AddressNotNil() predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldNotNull(FieldAddress)) +} + +// AddressEqualFold applies the EqualFold predicate on the "address" field. +func AddressEqualFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldEqualFold(FieldAddress, v)) +} + +// AddressContainsFold applies the ContainsFold predicate on the "address" field. +func AddressContainsFold(v string) predicate.ContactHistory { + return predicate.ContactHistory(sql.FieldContainsFold(FieldAddress, v)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v enums.UserStatus) predicate.ContactHistory { + vc := v + return predicate.ContactHistory(sql.FieldEQ(FieldStatus, vc)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v enums.UserStatus) predicate.ContactHistory { + vc := v + return predicate.ContactHistory(sql.FieldNEQ(FieldStatus, vc)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...enums.UserStatus) predicate.ContactHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.ContactHistory(sql.FieldIn(FieldStatus, v...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...enums.UserStatus) predicate.ContactHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.ContactHistory(sql.FieldNotIn(FieldStatus, v...)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.ContactHistory) predicate.ContactHistory { + return predicate.ContactHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.ContactHistory) predicate.ContactHistory { + return predicate.ContactHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.ContactHistory) predicate.ContactHistory { + return predicate.ContactHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/contacthistory_create.go b/internal/ent/generated/contacthistory_create.go new file mode 100644 index 0000000..58fb5e7 --- /dev/null +++ b/internal/ent/generated/contacthistory_create.go @@ -0,0 +1,588 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ContactHistoryCreate is the builder for creating a ContactHistory entity. +type ContactHistoryCreate struct { + config + mutation *ContactHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (chc *ContactHistoryCreate) SetHistoryTime(t time.Time) *ContactHistoryCreate { + chc.mutation.SetHistoryTime(t) + return chc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableHistoryTime(t *time.Time) *ContactHistoryCreate { + if t != nil { + chc.SetHistoryTime(*t) + } + return chc +} + +// SetRef sets the "ref" field. +func (chc *ContactHistoryCreate) SetRef(s string) *ContactHistoryCreate { + chc.mutation.SetRef(s) + return chc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableRef(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetRef(*s) + } + return chc +} + +// SetOperation sets the "operation" field. +func (chc *ContactHistoryCreate) SetOperation(ht history.OpType) *ContactHistoryCreate { + chc.mutation.SetOperation(ht) + return chc +} + +// SetCreatedAt sets the "created_at" field. +func (chc *ContactHistoryCreate) SetCreatedAt(t time.Time) *ContactHistoryCreate { + chc.mutation.SetCreatedAt(t) + return chc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableCreatedAt(t *time.Time) *ContactHistoryCreate { + if t != nil { + chc.SetCreatedAt(*t) + } + return chc +} + +// SetUpdatedAt sets the "updated_at" field. +func (chc *ContactHistoryCreate) SetUpdatedAt(t time.Time) *ContactHistoryCreate { + chc.mutation.SetUpdatedAt(t) + return chc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableUpdatedAt(t *time.Time) *ContactHistoryCreate { + if t != nil { + chc.SetUpdatedAt(*t) + } + return chc +} + +// SetCreatedBy sets the "created_by" field. +func (chc *ContactHistoryCreate) SetCreatedBy(s string) *ContactHistoryCreate { + chc.mutation.SetCreatedBy(s) + return chc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableCreatedBy(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetCreatedBy(*s) + } + return chc +} + +// SetUpdatedBy sets the "updated_by" field. +func (chc *ContactHistoryCreate) SetUpdatedBy(s string) *ContactHistoryCreate { + chc.mutation.SetUpdatedBy(s) + return chc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableUpdatedBy(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetUpdatedBy(*s) + } + return chc +} + +// SetMappingID sets the "mapping_id" field. +func (chc *ContactHistoryCreate) SetMappingID(s string) *ContactHistoryCreate { + chc.mutation.SetMappingID(s) + return chc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableMappingID(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetMappingID(*s) + } + return chc +} + +// SetDeletedAt sets the "deleted_at" field. +func (chc *ContactHistoryCreate) SetDeletedAt(t time.Time) *ContactHistoryCreate { + chc.mutation.SetDeletedAt(t) + return chc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableDeletedAt(t *time.Time) *ContactHistoryCreate { + if t != nil { + chc.SetDeletedAt(*t) + } + return chc +} + +// SetDeletedBy sets the "deleted_by" field. +func (chc *ContactHistoryCreate) SetDeletedBy(s string) *ContactHistoryCreate { + chc.mutation.SetDeletedBy(s) + return chc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableDeletedBy(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetDeletedBy(*s) + } + return chc +} + +// SetTags sets the "tags" field. +func (chc *ContactHistoryCreate) SetTags(s []string) *ContactHistoryCreate { + chc.mutation.SetTags(s) + return chc +} + +// SetOwnerID sets the "owner_id" field. +func (chc *ContactHistoryCreate) SetOwnerID(s string) *ContactHistoryCreate { + chc.mutation.SetOwnerID(s) + return chc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableOwnerID(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetOwnerID(*s) + } + return chc +} + +// SetFullName sets the "full_name" field. +func (chc *ContactHistoryCreate) SetFullName(s string) *ContactHistoryCreate { + chc.mutation.SetFullName(s) + return chc +} + +// SetTitle sets the "title" field. +func (chc *ContactHistoryCreate) SetTitle(s string) *ContactHistoryCreate { + chc.mutation.SetTitle(s) + return chc +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableTitle(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetTitle(*s) + } + return chc +} + +// SetCompany sets the "company" field. +func (chc *ContactHistoryCreate) SetCompany(s string) *ContactHistoryCreate { + chc.mutation.SetCompany(s) + return chc +} + +// SetNillableCompany sets the "company" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableCompany(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetCompany(*s) + } + return chc +} + +// SetEmail sets the "email" field. +func (chc *ContactHistoryCreate) SetEmail(s string) *ContactHistoryCreate { + chc.mutation.SetEmail(s) + return chc +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableEmail(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetEmail(*s) + } + return chc +} + +// SetPhoneNumber sets the "phone_number" field. +func (chc *ContactHistoryCreate) SetPhoneNumber(s string) *ContactHistoryCreate { + chc.mutation.SetPhoneNumber(s) + return chc +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillablePhoneNumber(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetPhoneNumber(*s) + } + return chc +} + +// SetAddress sets the "address" field. +func (chc *ContactHistoryCreate) SetAddress(s string) *ContactHistoryCreate { + chc.mutation.SetAddress(s) + return chc +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableAddress(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetAddress(*s) + } + return chc +} + +// SetStatus sets the "status" field. +func (chc *ContactHistoryCreate) SetStatus(es enums.UserStatus) *ContactHistoryCreate { + chc.mutation.SetStatus(es) + return chc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableStatus(es *enums.UserStatus) *ContactHistoryCreate { + if es != nil { + chc.SetStatus(*es) + } + return chc +} + +// SetID sets the "id" field. +func (chc *ContactHistoryCreate) SetID(s string) *ContactHistoryCreate { + chc.mutation.SetID(s) + return chc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (chc *ContactHistoryCreate) SetNillableID(s *string) *ContactHistoryCreate { + if s != nil { + chc.SetID(*s) + } + return chc +} + +// Mutation returns the ContactHistoryMutation object of the builder. +func (chc *ContactHistoryCreate) Mutation() *ContactHistoryMutation { + return chc.mutation +} + +// Save creates the ContactHistory in the database. +func (chc *ContactHistoryCreate) Save(ctx context.Context) (*ContactHistory, error) { + if err := chc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, chc.sqlSave, chc.mutation, chc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (chc *ContactHistoryCreate) SaveX(ctx context.Context) *ContactHistory { + v, err := chc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (chc *ContactHistoryCreate) Exec(ctx context.Context) error { + _, err := chc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (chc *ContactHistoryCreate) ExecX(ctx context.Context) { + if err := chc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (chc *ContactHistoryCreate) defaults() error { + if _, ok := chc.mutation.HistoryTime(); !ok { + if contacthistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized contacthistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := contacthistory.DefaultHistoryTime() + chc.mutation.SetHistoryTime(v) + } + if _, ok := chc.mutation.CreatedAt(); !ok { + if contacthistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized contacthistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := contacthistory.DefaultCreatedAt() + chc.mutation.SetCreatedAt(v) + } + if _, ok := chc.mutation.UpdatedAt(); !ok { + if contacthistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized contacthistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := contacthistory.DefaultUpdatedAt() + chc.mutation.SetUpdatedAt(v) + } + if _, ok := chc.mutation.MappingID(); !ok { + if contacthistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized contacthistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := contacthistory.DefaultMappingID() + chc.mutation.SetMappingID(v) + } + if _, ok := chc.mutation.Tags(); !ok { + v := contacthistory.DefaultTags + chc.mutation.SetTags(v) + } + if _, ok := chc.mutation.Status(); !ok { + v := contacthistory.DefaultStatus + chc.mutation.SetStatus(v) + } + if _, ok := chc.mutation.ID(); !ok { + if contacthistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized contacthistory.DefaultID (forgotten import generated/runtime?)") + } + v := contacthistory.DefaultID() + chc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (chc *ContactHistoryCreate) check() error { + if _, ok := chc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "ContactHistory.history_time"`)} + } + if _, ok := chc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "ContactHistory.operation"`)} + } + if v, ok := chc.mutation.Operation(); ok { + if err := contacthistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "ContactHistory.operation": %w`, err)} + } + } + if _, ok := chc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "ContactHistory.mapping_id"`)} + } + if _, ok := chc.mutation.FullName(); !ok { + return &ValidationError{Name: "full_name", err: errors.New(`generated: missing required field "ContactHistory.full_name"`)} + } + if _, ok := chc.mutation.Status(); !ok { + return &ValidationError{Name: "status", err: errors.New(`generated: missing required field "ContactHistory.status"`)} + } + if v, ok := chc.mutation.Status(); ok { + if err := contacthistory.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "ContactHistory.status": %w`, err)} + } + } + return nil +} + +func (chc *ContactHistoryCreate) sqlSave(ctx context.Context) (*ContactHistory, error) { + if err := chc.check(); err != nil { + return nil, err + } + _node, _spec := chc.createSpec() + if err := sqlgraph.CreateNode(ctx, chc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected ContactHistory.ID type: %T", _spec.ID.Value) + } + } + chc.mutation.id = &_node.ID + chc.mutation.done = true + return _node, nil +} + +func (chc *ContactHistoryCreate) createSpec() (*ContactHistory, *sqlgraph.CreateSpec) { + var ( + _node = &ContactHistory{config: chc.config} + _spec = sqlgraph.NewCreateSpec(contacthistory.Table, sqlgraph.NewFieldSpec(contacthistory.FieldID, field.TypeString)) + ) + _spec.Schema = chc.schemaConfig.ContactHistory + if id, ok := chc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := chc.mutation.HistoryTime(); ok { + _spec.SetField(contacthistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := chc.mutation.Ref(); ok { + _spec.SetField(contacthistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := chc.mutation.Operation(); ok { + _spec.SetField(contacthistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := chc.mutation.CreatedAt(); ok { + _spec.SetField(contacthistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := chc.mutation.UpdatedAt(); ok { + _spec.SetField(contacthistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := chc.mutation.CreatedBy(); ok { + _spec.SetField(contacthistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := chc.mutation.UpdatedBy(); ok { + _spec.SetField(contacthistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := chc.mutation.MappingID(); ok { + _spec.SetField(contacthistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := chc.mutation.DeletedAt(); ok { + _spec.SetField(contacthistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := chc.mutation.DeletedBy(); ok { + _spec.SetField(contacthistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := chc.mutation.Tags(); ok { + _spec.SetField(contacthistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := chc.mutation.OwnerID(); ok { + _spec.SetField(contacthistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := chc.mutation.FullName(); ok { + _spec.SetField(contacthistory.FieldFullName, field.TypeString, value) + _node.FullName = value + } + if value, ok := chc.mutation.Title(); ok { + _spec.SetField(contacthistory.FieldTitle, field.TypeString, value) + _node.Title = value + } + if value, ok := chc.mutation.Company(); ok { + _spec.SetField(contacthistory.FieldCompany, field.TypeString, value) + _node.Company = value + } + if value, ok := chc.mutation.Email(); ok { + _spec.SetField(contacthistory.FieldEmail, field.TypeString, value) + _node.Email = value + } + if value, ok := chc.mutation.PhoneNumber(); ok { + _spec.SetField(contacthistory.FieldPhoneNumber, field.TypeString, value) + _node.PhoneNumber = value + } + if value, ok := chc.mutation.Address(); ok { + _spec.SetField(contacthistory.FieldAddress, field.TypeString, value) + _node.Address = value + } + if value, ok := chc.mutation.Status(); ok { + _spec.SetField(contacthistory.FieldStatus, field.TypeEnum, value) + _node.Status = value + } + return _node, _spec +} + +// ContactHistoryCreateBulk is the builder for creating many ContactHistory entities in bulk. +type ContactHistoryCreateBulk struct { + config + err error + builders []*ContactHistoryCreate +} + +// Save creates the ContactHistory entities in the database. +func (chcb *ContactHistoryCreateBulk) Save(ctx context.Context) ([]*ContactHistory, error) { + if chcb.err != nil { + return nil, chcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(chcb.builders)) + nodes := make([]*ContactHistory, len(chcb.builders)) + mutators := make([]Mutator, len(chcb.builders)) + for i := range chcb.builders { + func(i int, root context.Context) { + builder := chcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*ContactHistoryMutation) + 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, chcb.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, chcb.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, chcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (chcb *ContactHistoryCreateBulk) SaveX(ctx context.Context) []*ContactHistory { + v, err := chcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (chcb *ContactHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := chcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (chcb *ContactHistoryCreateBulk) ExecX(ctx context.Context) { + if err := chcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/contacthistory_delete.go b/internal/ent/generated/contacthistory_delete.go new file mode 100644 index 0000000..c8b3b30 --- /dev/null +++ b/internal/ent/generated/contacthistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ContactHistoryDelete is the builder for deleting a ContactHistory entity. +type ContactHistoryDelete struct { + config + hooks []Hook + mutation *ContactHistoryMutation +} + +// Where appends a list predicates to the ContactHistoryDelete builder. +func (chd *ContactHistoryDelete) Where(ps ...predicate.ContactHistory) *ContactHistoryDelete { + chd.mutation.Where(ps...) + return chd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (chd *ContactHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, chd.sqlExec, chd.mutation, chd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (chd *ContactHistoryDelete) ExecX(ctx context.Context) int { + n, err := chd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (chd *ContactHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(contacthistory.Table, sqlgraph.NewFieldSpec(contacthistory.FieldID, field.TypeString)) + _spec.Node.Schema = chd.schemaConfig.ContactHistory + ctx = internal.NewSchemaConfigContext(ctx, chd.schemaConfig) + if ps := chd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, chd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + chd.mutation.done = true + return affected, err +} + +// ContactHistoryDeleteOne is the builder for deleting a single ContactHistory entity. +type ContactHistoryDeleteOne struct { + chd *ContactHistoryDelete +} + +// Where appends a list predicates to the ContactHistoryDelete builder. +func (chdo *ContactHistoryDeleteOne) Where(ps ...predicate.ContactHistory) *ContactHistoryDeleteOne { + chdo.chd.mutation.Where(ps...) + return chdo +} + +// Exec executes the deletion query. +func (chdo *ContactHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := chdo.chd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{contacthistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (chdo *ContactHistoryDeleteOne) ExecX(ctx context.Context) { + if err := chdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/contacthistory_query.go b/internal/ent/generated/contacthistory_query.go new file mode 100644 index 0000000..2ee44ec --- /dev/null +++ b/internal/ent/generated/contacthistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ContactHistoryQuery is the builder for querying ContactHistory entities. +type ContactHistoryQuery struct { + config + ctx *QueryContext + order []contacthistory.OrderOption + inters []Interceptor + predicates []predicate.ContactHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*ContactHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the ContactHistoryQuery builder. +func (chq *ContactHistoryQuery) Where(ps ...predicate.ContactHistory) *ContactHistoryQuery { + chq.predicates = append(chq.predicates, ps...) + return chq +} + +// Limit the number of records to be returned by this query. +func (chq *ContactHistoryQuery) Limit(limit int) *ContactHistoryQuery { + chq.ctx.Limit = &limit + return chq +} + +// Offset to start from. +func (chq *ContactHistoryQuery) Offset(offset int) *ContactHistoryQuery { + chq.ctx.Offset = &offset + return chq +} + +// 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 (chq *ContactHistoryQuery) Unique(unique bool) *ContactHistoryQuery { + chq.ctx.Unique = &unique + return chq +} + +// Order specifies how the records should be ordered. +func (chq *ContactHistoryQuery) Order(o ...contacthistory.OrderOption) *ContactHistoryQuery { + chq.order = append(chq.order, o...) + return chq +} + +// First returns the first ContactHistory entity from the query. +// Returns a *NotFoundError when no ContactHistory was found. +func (chq *ContactHistoryQuery) First(ctx context.Context) (*ContactHistory, error) { + nodes, err := chq.Limit(1).All(setContextOp(ctx, chq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{contacthistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (chq *ContactHistoryQuery) FirstX(ctx context.Context) *ContactHistory { + node, err := chq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first ContactHistory ID from the query. +// Returns a *NotFoundError when no ContactHistory ID was found. +func (chq *ContactHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = chq.Limit(1).IDs(setContextOp(ctx, chq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{contacthistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (chq *ContactHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := chq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single ContactHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one ContactHistory entity is found. +// Returns a *NotFoundError when no ContactHistory entities are found. +func (chq *ContactHistoryQuery) Only(ctx context.Context) (*ContactHistory, error) { + nodes, err := chq.Limit(2).All(setContextOp(ctx, chq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{contacthistory.Label} + default: + return nil, &NotSingularError{contacthistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (chq *ContactHistoryQuery) OnlyX(ctx context.Context) *ContactHistory { + node, err := chq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only ContactHistory ID in the query. +// Returns a *NotSingularError when more than one ContactHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (chq *ContactHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = chq.Limit(2).IDs(setContextOp(ctx, chq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{contacthistory.Label} + default: + err = &NotSingularError{contacthistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (chq *ContactHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := chq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of ContactHistories. +func (chq *ContactHistoryQuery) All(ctx context.Context) ([]*ContactHistory, error) { + ctx = setContextOp(ctx, chq.ctx, ent.OpQueryAll) + if err := chq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*ContactHistory, *ContactHistoryQuery]() + return withInterceptors[[]*ContactHistory](ctx, chq, qr, chq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (chq *ContactHistoryQuery) AllX(ctx context.Context) []*ContactHistory { + nodes, err := chq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of ContactHistory IDs. +func (chq *ContactHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if chq.ctx.Unique == nil && chq.path != nil { + chq.Unique(true) + } + ctx = setContextOp(ctx, chq.ctx, ent.OpQueryIDs) + if err = chq.Select(contacthistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (chq *ContactHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := chq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (chq *ContactHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, chq.ctx, ent.OpQueryCount) + if err := chq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, chq, querierCount[*ContactHistoryQuery](), chq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (chq *ContactHistoryQuery) CountX(ctx context.Context) int { + count, err := chq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (chq *ContactHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, chq.ctx, ent.OpQueryExist) + switch _, err := chq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (chq *ContactHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := chq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the ContactHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (chq *ContactHistoryQuery) Clone() *ContactHistoryQuery { + if chq == nil { + return nil + } + return &ContactHistoryQuery{ + config: chq.config, + ctx: chq.ctx.Clone(), + order: append([]contacthistory.OrderOption{}, chq.order...), + inters: append([]Interceptor{}, chq.inters...), + predicates: append([]predicate.ContactHistory{}, chq.predicates...), + // clone intermediate query. + sql: chq.sql.Clone(), + path: chq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.ContactHistory.Query(). +// GroupBy(contacthistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (chq *ContactHistoryQuery) GroupBy(field string, fields ...string) *ContactHistoryGroupBy { + chq.ctx.Fields = append([]string{field}, fields...) + grbuild := &ContactHistoryGroupBy{build: chq} + grbuild.flds = &chq.ctx.Fields + grbuild.label = contacthistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.ContactHistory.Query(). +// Select(contacthistory.FieldHistoryTime). +// Scan(ctx, &v) +func (chq *ContactHistoryQuery) Select(fields ...string) *ContactHistorySelect { + chq.ctx.Fields = append(chq.ctx.Fields, fields...) + sbuild := &ContactHistorySelect{ContactHistoryQuery: chq} + sbuild.label = contacthistory.Label + sbuild.flds, sbuild.scan = &chq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a ContactHistorySelect configured with the given aggregations. +func (chq *ContactHistoryQuery) Aggregate(fns ...AggregateFunc) *ContactHistorySelect { + return chq.Select().Aggregate(fns...) +} + +func (chq *ContactHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range chq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, chq); err != nil { + return err + } + } + } + for _, f := range chq.ctx.Fields { + if !contacthistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if chq.path != nil { + prev, err := chq.path(ctx) + if err != nil { + return err + } + chq.sql = prev + } + if contacthistory.Policy == nil { + return errors.New("generated: uninitialized contacthistory.Policy (forgotten import generated/runtime?)") + } + if err := contacthistory.Policy.EvalQuery(ctx, chq); err != nil { + return err + } + return nil +} + +func (chq *ContactHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*ContactHistory, error) { + var ( + nodes = []*ContactHistory{} + _spec = chq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*ContactHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &ContactHistory{config: chq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = chq.schemaConfig.ContactHistory + ctx = internal.NewSchemaConfigContext(ctx, chq.schemaConfig) + if len(chq.modifiers) > 0 { + _spec.Modifiers = chq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, chq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range chq.loadTotal { + if err := chq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (chq *ContactHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := chq.querySpec() + _spec.Node.Schema = chq.schemaConfig.ContactHistory + ctx = internal.NewSchemaConfigContext(ctx, chq.schemaConfig) + if len(chq.modifiers) > 0 { + _spec.Modifiers = chq.modifiers + } + _spec.Node.Columns = chq.ctx.Fields + if len(chq.ctx.Fields) > 0 { + _spec.Unique = chq.ctx.Unique != nil && *chq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, chq.driver, _spec) +} + +func (chq *ContactHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(contacthistory.Table, contacthistory.Columns, sqlgraph.NewFieldSpec(contacthistory.FieldID, field.TypeString)) + _spec.From = chq.sql + if unique := chq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if chq.path != nil { + _spec.Unique = true + } + if fields := chq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, contacthistory.FieldID) + for i := range fields { + if fields[i] != contacthistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := chq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := chq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := chq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := chq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (chq *ContactHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(chq.driver.Dialect()) + t1 := builder.Table(contacthistory.Table) + columns := chq.ctx.Fields + if len(columns) == 0 { + columns = contacthistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if chq.sql != nil { + selector = chq.sql + selector.Select(selector.Columns(columns...)...) + } + if chq.ctx.Unique != nil && *chq.ctx.Unique { + selector.Distinct() + } + t1.Schema(chq.schemaConfig.ContactHistory) + ctx = internal.NewSchemaConfigContext(ctx, chq.schemaConfig) + selector.WithContext(ctx) + for _, p := range chq.predicates { + p(selector) + } + for _, p := range chq.order { + p(selector) + } + if offset := chq.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 := chq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// ContactHistoryGroupBy is the group-by builder for ContactHistory entities. +type ContactHistoryGroupBy struct { + selector + build *ContactHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (chgb *ContactHistoryGroupBy) Aggregate(fns ...AggregateFunc) *ContactHistoryGroupBy { + chgb.fns = append(chgb.fns, fns...) + return chgb +} + +// Scan applies the selector query and scans the result into the given value. +func (chgb *ContactHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, chgb.build.ctx, ent.OpQueryGroupBy) + if err := chgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*ContactHistoryQuery, *ContactHistoryGroupBy](ctx, chgb.build, chgb, chgb.build.inters, v) +} + +func (chgb *ContactHistoryGroupBy) sqlScan(ctx context.Context, root *ContactHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(chgb.fns)) + for _, fn := range chgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*chgb.flds)+len(chgb.fns)) + for _, f := range *chgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*chgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := chgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// ContactHistorySelect is the builder for selecting fields of ContactHistory entities. +type ContactHistorySelect struct { + *ContactHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (chs *ContactHistorySelect) Aggregate(fns ...AggregateFunc) *ContactHistorySelect { + chs.fns = append(chs.fns, fns...) + return chs +} + +// Scan applies the selector query and scans the result into the given value. +func (chs *ContactHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, chs.ctx, ent.OpQuerySelect) + if err := chs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*ContactHistoryQuery, *ContactHistorySelect](ctx, chs.ContactHistoryQuery, chs, chs.inters, v) +} + +func (chs *ContactHistorySelect) sqlScan(ctx context.Context, root *ContactHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(chs.fns)) + for _, fn := range chs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*chs.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 := chs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/contacthistory_update.go b/internal/ent/generated/contacthistory_update.go new file mode 100644 index 0000000..5ea81c0 --- /dev/null +++ b/internal/ent/generated/contacthistory_update.go @@ -0,0 +1,888 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ContactHistoryUpdate is the builder for updating ContactHistory entities. +type ContactHistoryUpdate struct { + config + hooks []Hook + mutation *ContactHistoryMutation +} + +// Where appends a list predicates to the ContactHistoryUpdate builder. +func (chu *ContactHistoryUpdate) Where(ps ...predicate.ContactHistory) *ContactHistoryUpdate { + chu.mutation.Where(ps...) + return chu +} + +// SetUpdatedAt sets the "updated_at" field. +func (chu *ContactHistoryUpdate) SetUpdatedAt(t time.Time) *ContactHistoryUpdate { + chu.mutation.SetUpdatedAt(t) + return chu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (chu *ContactHistoryUpdate) ClearUpdatedAt() *ContactHistoryUpdate { + chu.mutation.ClearUpdatedAt() + return chu +} + +// SetUpdatedBy sets the "updated_by" field. +func (chu *ContactHistoryUpdate) SetUpdatedBy(s string) *ContactHistoryUpdate { + chu.mutation.SetUpdatedBy(s) + return chu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableUpdatedBy(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetUpdatedBy(*s) + } + return chu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (chu *ContactHistoryUpdate) ClearUpdatedBy() *ContactHistoryUpdate { + chu.mutation.ClearUpdatedBy() + return chu +} + +// SetDeletedAt sets the "deleted_at" field. +func (chu *ContactHistoryUpdate) SetDeletedAt(t time.Time) *ContactHistoryUpdate { + chu.mutation.SetDeletedAt(t) + return chu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableDeletedAt(t *time.Time) *ContactHistoryUpdate { + if t != nil { + chu.SetDeletedAt(*t) + } + return chu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (chu *ContactHistoryUpdate) ClearDeletedAt() *ContactHistoryUpdate { + chu.mutation.ClearDeletedAt() + return chu +} + +// SetDeletedBy sets the "deleted_by" field. +func (chu *ContactHistoryUpdate) SetDeletedBy(s string) *ContactHistoryUpdate { + chu.mutation.SetDeletedBy(s) + return chu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableDeletedBy(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetDeletedBy(*s) + } + return chu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (chu *ContactHistoryUpdate) ClearDeletedBy() *ContactHistoryUpdate { + chu.mutation.ClearDeletedBy() + return chu +} + +// SetTags sets the "tags" field. +func (chu *ContactHistoryUpdate) SetTags(s []string) *ContactHistoryUpdate { + chu.mutation.SetTags(s) + return chu +} + +// AppendTags appends s to the "tags" field. +func (chu *ContactHistoryUpdate) AppendTags(s []string) *ContactHistoryUpdate { + chu.mutation.AppendTags(s) + return chu +} + +// ClearTags clears the value of the "tags" field. +func (chu *ContactHistoryUpdate) ClearTags() *ContactHistoryUpdate { + chu.mutation.ClearTags() + return chu +} + +// SetOwnerID sets the "owner_id" field. +func (chu *ContactHistoryUpdate) SetOwnerID(s string) *ContactHistoryUpdate { + chu.mutation.SetOwnerID(s) + return chu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableOwnerID(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetOwnerID(*s) + } + return chu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (chu *ContactHistoryUpdate) ClearOwnerID() *ContactHistoryUpdate { + chu.mutation.ClearOwnerID() + return chu +} + +// SetFullName sets the "full_name" field. +func (chu *ContactHistoryUpdate) SetFullName(s string) *ContactHistoryUpdate { + chu.mutation.SetFullName(s) + return chu +} + +// SetNillableFullName sets the "full_name" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableFullName(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetFullName(*s) + } + return chu +} + +// SetTitle sets the "title" field. +func (chu *ContactHistoryUpdate) SetTitle(s string) *ContactHistoryUpdate { + chu.mutation.SetTitle(s) + return chu +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableTitle(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetTitle(*s) + } + return chu +} + +// ClearTitle clears the value of the "title" field. +func (chu *ContactHistoryUpdate) ClearTitle() *ContactHistoryUpdate { + chu.mutation.ClearTitle() + return chu +} + +// SetCompany sets the "company" field. +func (chu *ContactHistoryUpdate) SetCompany(s string) *ContactHistoryUpdate { + chu.mutation.SetCompany(s) + return chu +} + +// SetNillableCompany sets the "company" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableCompany(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetCompany(*s) + } + return chu +} + +// ClearCompany clears the value of the "company" field. +func (chu *ContactHistoryUpdate) ClearCompany() *ContactHistoryUpdate { + chu.mutation.ClearCompany() + return chu +} + +// SetEmail sets the "email" field. +func (chu *ContactHistoryUpdate) SetEmail(s string) *ContactHistoryUpdate { + chu.mutation.SetEmail(s) + return chu +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableEmail(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetEmail(*s) + } + return chu +} + +// ClearEmail clears the value of the "email" field. +func (chu *ContactHistoryUpdate) ClearEmail() *ContactHistoryUpdate { + chu.mutation.ClearEmail() + return chu +} + +// SetPhoneNumber sets the "phone_number" field. +func (chu *ContactHistoryUpdate) SetPhoneNumber(s string) *ContactHistoryUpdate { + chu.mutation.SetPhoneNumber(s) + return chu +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillablePhoneNumber(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetPhoneNumber(*s) + } + return chu +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (chu *ContactHistoryUpdate) ClearPhoneNumber() *ContactHistoryUpdate { + chu.mutation.ClearPhoneNumber() + return chu +} + +// SetAddress sets the "address" field. +func (chu *ContactHistoryUpdate) SetAddress(s string) *ContactHistoryUpdate { + chu.mutation.SetAddress(s) + return chu +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableAddress(s *string) *ContactHistoryUpdate { + if s != nil { + chu.SetAddress(*s) + } + return chu +} + +// ClearAddress clears the value of the "address" field. +func (chu *ContactHistoryUpdate) ClearAddress() *ContactHistoryUpdate { + chu.mutation.ClearAddress() + return chu +} + +// SetStatus sets the "status" field. +func (chu *ContactHistoryUpdate) SetStatus(es enums.UserStatus) *ContactHistoryUpdate { + chu.mutation.SetStatus(es) + return chu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (chu *ContactHistoryUpdate) SetNillableStatus(es *enums.UserStatus) *ContactHistoryUpdate { + if es != nil { + chu.SetStatus(*es) + } + return chu +} + +// Mutation returns the ContactHistoryMutation object of the builder. +func (chu *ContactHistoryUpdate) Mutation() *ContactHistoryMutation { + return chu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (chu *ContactHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := chu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, chu.sqlSave, chu.mutation, chu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (chu *ContactHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := chu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (chu *ContactHistoryUpdate) Exec(ctx context.Context) error { + _, err := chu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (chu *ContactHistoryUpdate) ExecX(ctx context.Context) { + if err := chu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (chu *ContactHistoryUpdate) defaults() error { + if _, ok := chu.mutation.UpdatedAt(); !ok && !chu.mutation.UpdatedAtCleared() { + if contacthistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized contacthistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := contacthistory.UpdateDefaultUpdatedAt() + chu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (chu *ContactHistoryUpdate) check() error { + if v, ok := chu.mutation.Status(); ok { + if err := contacthistory.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "ContactHistory.status": %w`, err)} + } + } + return nil +} + +func (chu *ContactHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := chu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(contacthistory.Table, contacthistory.Columns, sqlgraph.NewFieldSpec(contacthistory.FieldID, field.TypeString)) + if ps := chu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if chu.mutation.RefCleared() { + _spec.ClearField(contacthistory.FieldRef, field.TypeString) + } + if chu.mutation.CreatedAtCleared() { + _spec.ClearField(contacthistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := chu.mutation.UpdatedAt(); ok { + _spec.SetField(contacthistory.FieldUpdatedAt, field.TypeTime, value) + } + if chu.mutation.UpdatedAtCleared() { + _spec.ClearField(contacthistory.FieldUpdatedAt, field.TypeTime) + } + if chu.mutation.CreatedByCleared() { + _spec.ClearField(contacthistory.FieldCreatedBy, field.TypeString) + } + if value, ok := chu.mutation.UpdatedBy(); ok { + _spec.SetField(contacthistory.FieldUpdatedBy, field.TypeString, value) + } + if chu.mutation.UpdatedByCleared() { + _spec.ClearField(contacthistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := chu.mutation.DeletedAt(); ok { + _spec.SetField(contacthistory.FieldDeletedAt, field.TypeTime, value) + } + if chu.mutation.DeletedAtCleared() { + _spec.ClearField(contacthistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := chu.mutation.DeletedBy(); ok { + _spec.SetField(contacthistory.FieldDeletedBy, field.TypeString, value) + } + if chu.mutation.DeletedByCleared() { + _spec.ClearField(contacthistory.FieldDeletedBy, field.TypeString) + } + if value, ok := chu.mutation.Tags(); ok { + _spec.SetField(contacthistory.FieldTags, field.TypeJSON, value) + } + if value, ok := chu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, contacthistory.FieldTags, value) + }) + } + if chu.mutation.TagsCleared() { + _spec.ClearField(contacthistory.FieldTags, field.TypeJSON) + } + if value, ok := chu.mutation.OwnerID(); ok { + _spec.SetField(contacthistory.FieldOwnerID, field.TypeString, value) + } + if chu.mutation.OwnerIDCleared() { + _spec.ClearField(contacthistory.FieldOwnerID, field.TypeString) + } + if value, ok := chu.mutation.FullName(); ok { + _spec.SetField(contacthistory.FieldFullName, field.TypeString, value) + } + if value, ok := chu.mutation.Title(); ok { + _spec.SetField(contacthistory.FieldTitle, field.TypeString, value) + } + if chu.mutation.TitleCleared() { + _spec.ClearField(contacthistory.FieldTitle, field.TypeString) + } + if value, ok := chu.mutation.Company(); ok { + _spec.SetField(contacthistory.FieldCompany, field.TypeString, value) + } + if chu.mutation.CompanyCleared() { + _spec.ClearField(contacthistory.FieldCompany, field.TypeString) + } + if value, ok := chu.mutation.Email(); ok { + _spec.SetField(contacthistory.FieldEmail, field.TypeString, value) + } + if chu.mutation.EmailCleared() { + _spec.ClearField(contacthistory.FieldEmail, field.TypeString) + } + if value, ok := chu.mutation.PhoneNumber(); ok { + _spec.SetField(contacthistory.FieldPhoneNumber, field.TypeString, value) + } + if chu.mutation.PhoneNumberCleared() { + _spec.ClearField(contacthistory.FieldPhoneNumber, field.TypeString) + } + if value, ok := chu.mutation.Address(); ok { + _spec.SetField(contacthistory.FieldAddress, field.TypeString, value) + } + if chu.mutation.AddressCleared() { + _spec.ClearField(contacthistory.FieldAddress, field.TypeString) + } + if value, ok := chu.mutation.Status(); ok { + _spec.SetField(contacthistory.FieldStatus, field.TypeEnum, value) + } + _spec.Node.Schema = chu.schemaConfig.ContactHistory + ctx = internal.NewSchemaConfigContext(ctx, chu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, chu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{contacthistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + chu.mutation.done = true + return n, nil +} + +// ContactHistoryUpdateOne is the builder for updating a single ContactHistory entity. +type ContactHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *ContactHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (chuo *ContactHistoryUpdateOne) SetUpdatedAt(t time.Time) *ContactHistoryUpdateOne { + chuo.mutation.SetUpdatedAt(t) + return chuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (chuo *ContactHistoryUpdateOne) ClearUpdatedAt() *ContactHistoryUpdateOne { + chuo.mutation.ClearUpdatedAt() + return chuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (chuo *ContactHistoryUpdateOne) SetUpdatedBy(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetUpdatedBy(s) + return chuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableUpdatedBy(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetUpdatedBy(*s) + } + return chuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (chuo *ContactHistoryUpdateOne) ClearUpdatedBy() *ContactHistoryUpdateOne { + chuo.mutation.ClearUpdatedBy() + return chuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (chuo *ContactHistoryUpdateOne) SetDeletedAt(t time.Time) *ContactHistoryUpdateOne { + chuo.mutation.SetDeletedAt(t) + return chuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *ContactHistoryUpdateOne { + if t != nil { + chuo.SetDeletedAt(*t) + } + return chuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (chuo *ContactHistoryUpdateOne) ClearDeletedAt() *ContactHistoryUpdateOne { + chuo.mutation.ClearDeletedAt() + return chuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (chuo *ContactHistoryUpdateOne) SetDeletedBy(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetDeletedBy(s) + return chuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableDeletedBy(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetDeletedBy(*s) + } + return chuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (chuo *ContactHistoryUpdateOne) ClearDeletedBy() *ContactHistoryUpdateOne { + chuo.mutation.ClearDeletedBy() + return chuo +} + +// SetTags sets the "tags" field. +func (chuo *ContactHistoryUpdateOne) SetTags(s []string) *ContactHistoryUpdateOne { + chuo.mutation.SetTags(s) + return chuo +} + +// AppendTags appends s to the "tags" field. +func (chuo *ContactHistoryUpdateOne) AppendTags(s []string) *ContactHistoryUpdateOne { + chuo.mutation.AppendTags(s) + return chuo +} + +// ClearTags clears the value of the "tags" field. +func (chuo *ContactHistoryUpdateOne) ClearTags() *ContactHistoryUpdateOne { + chuo.mutation.ClearTags() + return chuo +} + +// SetOwnerID sets the "owner_id" field. +func (chuo *ContactHistoryUpdateOne) SetOwnerID(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetOwnerID(s) + return chuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableOwnerID(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetOwnerID(*s) + } + return chuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (chuo *ContactHistoryUpdateOne) ClearOwnerID() *ContactHistoryUpdateOne { + chuo.mutation.ClearOwnerID() + return chuo +} + +// SetFullName sets the "full_name" field. +func (chuo *ContactHistoryUpdateOne) SetFullName(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetFullName(s) + return chuo +} + +// SetNillableFullName sets the "full_name" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableFullName(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetFullName(*s) + } + return chuo +} + +// SetTitle sets the "title" field. +func (chuo *ContactHistoryUpdateOne) SetTitle(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetTitle(s) + return chuo +} + +// SetNillableTitle sets the "title" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableTitle(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetTitle(*s) + } + return chuo +} + +// ClearTitle clears the value of the "title" field. +func (chuo *ContactHistoryUpdateOne) ClearTitle() *ContactHistoryUpdateOne { + chuo.mutation.ClearTitle() + return chuo +} + +// SetCompany sets the "company" field. +func (chuo *ContactHistoryUpdateOne) SetCompany(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetCompany(s) + return chuo +} + +// SetNillableCompany sets the "company" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableCompany(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetCompany(*s) + } + return chuo +} + +// ClearCompany clears the value of the "company" field. +func (chuo *ContactHistoryUpdateOne) ClearCompany() *ContactHistoryUpdateOne { + chuo.mutation.ClearCompany() + return chuo +} + +// SetEmail sets the "email" field. +func (chuo *ContactHistoryUpdateOne) SetEmail(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetEmail(s) + return chuo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableEmail(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetEmail(*s) + } + return chuo +} + +// ClearEmail clears the value of the "email" field. +func (chuo *ContactHistoryUpdateOne) ClearEmail() *ContactHistoryUpdateOne { + chuo.mutation.ClearEmail() + return chuo +} + +// SetPhoneNumber sets the "phone_number" field. +func (chuo *ContactHistoryUpdateOne) SetPhoneNumber(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetPhoneNumber(s) + return chuo +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillablePhoneNumber(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetPhoneNumber(*s) + } + return chuo +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (chuo *ContactHistoryUpdateOne) ClearPhoneNumber() *ContactHistoryUpdateOne { + chuo.mutation.ClearPhoneNumber() + return chuo +} + +// SetAddress sets the "address" field. +func (chuo *ContactHistoryUpdateOne) SetAddress(s string) *ContactHistoryUpdateOne { + chuo.mutation.SetAddress(s) + return chuo +} + +// SetNillableAddress sets the "address" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableAddress(s *string) *ContactHistoryUpdateOne { + if s != nil { + chuo.SetAddress(*s) + } + return chuo +} + +// ClearAddress clears the value of the "address" field. +func (chuo *ContactHistoryUpdateOne) ClearAddress() *ContactHistoryUpdateOne { + chuo.mutation.ClearAddress() + return chuo +} + +// SetStatus sets the "status" field. +func (chuo *ContactHistoryUpdateOne) SetStatus(es enums.UserStatus) *ContactHistoryUpdateOne { + chuo.mutation.SetStatus(es) + return chuo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (chuo *ContactHistoryUpdateOne) SetNillableStatus(es *enums.UserStatus) *ContactHistoryUpdateOne { + if es != nil { + chuo.SetStatus(*es) + } + return chuo +} + +// Mutation returns the ContactHistoryMutation object of the builder. +func (chuo *ContactHistoryUpdateOne) Mutation() *ContactHistoryMutation { + return chuo.mutation +} + +// Where appends a list predicates to the ContactHistoryUpdate builder. +func (chuo *ContactHistoryUpdateOne) Where(ps ...predicate.ContactHistory) *ContactHistoryUpdateOne { + chuo.mutation.Where(ps...) + return chuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (chuo *ContactHistoryUpdateOne) Select(field string, fields ...string) *ContactHistoryUpdateOne { + chuo.fields = append([]string{field}, fields...) + return chuo +} + +// Save executes the query and returns the updated ContactHistory entity. +func (chuo *ContactHistoryUpdateOne) Save(ctx context.Context) (*ContactHistory, error) { + if err := chuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, chuo.sqlSave, chuo.mutation, chuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (chuo *ContactHistoryUpdateOne) SaveX(ctx context.Context) *ContactHistory { + node, err := chuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (chuo *ContactHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := chuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (chuo *ContactHistoryUpdateOne) ExecX(ctx context.Context) { + if err := chuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (chuo *ContactHistoryUpdateOne) defaults() error { + if _, ok := chuo.mutation.UpdatedAt(); !ok && !chuo.mutation.UpdatedAtCleared() { + if contacthistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized contacthistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := contacthistory.UpdateDefaultUpdatedAt() + chuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (chuo *ContactHistoryUpdateOne) check() error { + if v, ok := chuo.mutation.Status(); ok { + if err := contacthistory.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "ContactHistory.status": %w`, err)} + } + } + return nil +} + +func (chuo *ContactHistoryUpdateOne) sqlSave(ctx context.Context) (_node *ContactHistory, err error) { + if err := chuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(contacthistory.Table, contacthistory.Columns, sqlgraph.NewFieldSpec(contacthistory.FieldID, field.TypeString)) + id, ok := chuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "ContactHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := chuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, contacthistory.FieldID) + for _, f := range fields { + if !contacthistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != contacthistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := chuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if chuo.mutation.RefCleared() { + _spec.ClearField(contacthistory.FieldRef, field.TypeString) + } + if chuo.mutation.CreatedAtCleared() { + _spec.ClearField(contacthistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := chuo.mutation.UpdatedAt(); ok { + _spec.SetField(contacthistory.FieldUpdatedAt, field.TypeTime, value) + } + if chuo.mutation.UpdatedAtCleared() { + _spec.ClearField(contacthistory.FieldUpdatedAt, field.TypeTime) + } + if chuo.mutation.CreatedByCleared() { + _spec.ClearField(contacthistory.FieldCreatedBy, field.TypeString) + } + if value, ok := chuo.mutation.UpdatedBy(); ok { + _spec.SetField(contacthistory.FieldUpdatedBy, field.TypeString, value) + } + if chuo.mutation.UpdatedByCleared() { + _spec.ClearField(contacthistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := chuo.mutation.DeletedAt(); ok { + _spec.SetField(contacthistory.FieldDeletedAt, field.TypeTime, value) + } + if chuo.mutation.DeletedAtCleared() { + _spec.ClearField(contacthistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := chuo.mutation.DeletedBy(); ok { + _spec.SetField(contacthistory.FieldDeletedBy, field.TypeString, value) + } + if chuo.mutation.DeletedByCleared() { + _spec.ClearField(contacthistory.FieldDeletedBy, field.TypeString) + } + if value, ok := chuo.mutation.Tags(); ok { + _spec.SetField(contacthistory.FieldTags, field.TypeJSON, value) + } + if value, ok := chuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, contacthistory.FieldTags, value) + }) + } + if chuo.mutation.TagsCleared() { + _spec.ClearField(contacthistory.FieldTags, field.TypeJSON) + } + if value, ok := chuo.mutation.OwnerID(); ok { + _spec.SetField(contacthistory.FieldOwnerID, field.TypeString, value) + } + if chuo.mutation.OwnerIDCleared() { + _spec.ClearField(contacthistory.FieldOwnerID, field.TypeString) + } + if value, ok := chuo.mutation.FullName(); ok { + _spec.SetField(contacthistory.FieldFullName, field.TypeString, value) + } + if value, ok := chuo.mutation.Title(); ok { + _spec.SetField(contacthistory.FieldTitle, field.TypeString, value) + } + if chuo.mutation.TitleCleared() { + _spec.ClearField(contacthistory.FieldTitle, field.TypeString) + } + if value, ok := chuo.mutation.Company(); ok { + _spec.SetField(contacthistory.FieldCompany, field.TypeString, value) + } + if chuo.mutation.CompanyCleared() { + _spec.ClearField(contacthistory.FieldCompany, field.TypeString) + } + if value, ok := chuo.mutation.Email(); ok { + _spec.SetField(contacthistory.FieldEmail, field.TypeString, value) + } + if chuo.mutation.EmailCleared() { + _spec.ClearField(contacthistory.FieldEmail, field.TypeString) + } + if value, ok := chuo.mutation.PhoneNumber(); ok { + _spec.SetField(contacthistory.FieldPhoneNumber, field.TypeString, value) + } + if chuo.mutation.PhoneNumberCleared() { + _spec.ClearField(contacthistory.FieldPhoneNumber, field.TypeString) + } + if value, ok := chuo.mutation.Address(); ok { + _spec.SetField(contacthistory.FieldAddress, field.TypeString, value) + } + if chuo.mutation.AddressCleared() { + _spec.ClearField(contacthistory.FieldAddress, field.TypeString) + } + if value, ok := chuo.mutation.Status(); ok { + _spec.SetField(contacthistory.FieldStatus, field.TypeEnum, value) + } + _spec.Node.Schema = chuo.schemaConfig.ContactHistory + ctx = internal.NewSchemaConfigContext(ctx, chuo.schemaConfig) + _node = &ContactHistory{config: chuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, chuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{contacthistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + chuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/doc.go b/internal/ent/generated/doc.go new file mode 100644 index 0000000..9682b93 --- /dev/null +++ b/internal/ent/generated/doc.go @@ -0,0 +1,2 @@ +// Package generated is the ent generated package +package generated diff --git a/internal/ent/generated/documentdata.go b/internal/ent/generated/documentdata.go new file mode 100644 index 0000000..8445aa4 --- /dev/null +++ b/internal/ent/generated/documentdata.go @@ -0,0 +1,314 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/template" +) + +// DocumentData is the model entity for the DocumentData schema. +type DocumentData struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the template id of the document + TemplateID string `json:"template_id,omitempty"` + // the json data of the document + Data customtypes.JSONObject `json:"data,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the DocumentDataQuery when eager-loading is set. + Edges DocumentDataEdges `json:"edges"` + selectValues sql.SelectValues +} + +// DocumentDataEdges holds the relations/edges for other nodes in the graph. +type DocumentDataEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Template holds the value of the template edge. + Template *Template `json:"template,omitempty"` + // Entity holds the value of the entity edge. + Entity []*Entity `json:"entity,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [3]bool + // totalCount holds the count of the edges above. + totalCount [3]map[string]int + + namedEntity map[string][]*Entity +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e DocumentDataEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// TemplateOrErr returns the Template value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e DocumentDataEdges) TemplateOrErr() (*Template, error) { + if e.Template != nil { + return e.Template, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: template.Label} + } + return nil, &NotLoadedError{edge: "template"} +} + +// EntityOrErr returns the Entity value or an error if the edge +// was not loaded in eager-loading. +func (e DocumentDataEdges) EntityOrErr() ([]*Entity, error) { + if e.loadedTypes[2] { + return e.Entity, nil + } + return nil, &NotLoadedError{edge: "entity"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*DocumentData) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case documentdata.FieldTags, documentdata.FieldData: + values[i] = new([]byte) + case documentdata.FieldID, documentdata.FieldCreatedBy, documentdata.FieldUpdatedBy, documentdata.FieldMappingID, documentdata.FieldDeletedBy, documentdata.FieldOwnerID, documentdata.FieldTemplateID: + values[i] = new(sql.NullString) + case documentdata.FieldCreatedAt, documentdata.FieldUpdatedAt, documentdata.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the DocumentData fields. +func (dd *DocumentData) 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 documentdata.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + dd.ID = value.String + } + case documentdata.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + dd.CreatedAt = value.Time + } + case documentdata.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + dd.UpdatedAt = value.Time + } + case documentdata.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + dd.CreatedBy = value.String + } + case documentdata.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + dd.UpdatedBy = value.String + } + case documentdata.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + dd.MappingID = value.String + } + case documentdata.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &dd.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case documentdata.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + dd.DeletedAt = value.Time + } + case documentdata.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + dd.DeletedBy = value.String + } + case documentdata.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + dd.OwnerID = value.String + } + case documentdata.FieldTemplateID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field template_id", values[i]) + } else if value.Valid { + dd.TemplateID = value.String + } + case documentdata.FieldData: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field data", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &dd.Data); err != nil { + return fmt.Errorf("unmarshal field data: %w", err) + } + } + default: + dd.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the DocumentData. +// This includes values selected through modifiers, order, etc. +func (dd *DocumentData) Value(name string) (ent.Value, error) { + return dd.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the DocumentData entity. +func (dd *DocumentData) QueryOwner() *OrganizationQuery { + return NewDocumentDataClient(dd.config).QueryOwner(dd) +} + +// QueryTemplate queries the "template" edge of the DocumentData entity. +func (dd *DocumentData) QueryTemplate() *TemplateQuery { + return NewDocumentDataClient(dd.config).QueryTemplate(dd) +} + +// QueryEntity queries the "entity" edge of the DocumentData entity. +func (dd *DocumentData) QueryEntity() *EntityQuery { + return NewDocumentDataClient(dd.config).QueryEntity(dd) +} + +// Update returns a builder for updating this DocumentData. +// Note that you need to call DocumentData.Unwrap() before calling this method if this DocumentData +// was returned from a transaction, and the transaction was committed or rolled back. +func (dd *DocumentData) Update() *DocumentDataUpdateOne { + return NewDocumentDataClient(dd.config).UpdateOne(dd) +} + +// Unwrap unwraps the DocumentData 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 (dd *DocumentData) Unwrap() *DocumentData { + _tx, ok := dd.config.driver.(*txDriver) + if !ok { + panic("generated: DocumentData is not a transactional entity") + } + dd.config.driver = _tx.drv + return dd +} + +// String implements the fmt.Stringer. +func (dd *DocumentData) String() string { + var builder strings.Builder + builder.WriteString("DocumentData(") + builder.WriteString(fmt.Sprintf("id=%v, ", dd.ID)) + builder.WriteString("created_at=") + builder.WriteString(dd.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(dd.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(dd.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(dd.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(dd.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", dd.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(dd.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(dd.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(dd.OwnerID) + builder.WriteString(", ") + builder.WriteString("template_id=") + builder.WriteString(dd.TemplateID) + builder.WriteString(", ") + builder.WriteString("data=") + builder.WriteString(fmt.Sprintf("%v", dd.Data)) + builder.WriteByte(')') + return builder.String() +} + +// NamedEntity returns the Entity named value or an error if the edge was not +// loaded in eager-loading with this name. +func (dd *DocumentData) NamedEntity(name string) ([]*Entity, error) { + if dd.Edges.namedEntity == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := dd.Edges.namedEntity[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (dd *DocumentData) appendNamedEntity(name string, edges ...*Entity) { + if dd.Edges.namedEntity == nil { + dd.Edges.namedEntity = make(map[string][]*Entity) + } + if len(edges) == 0 { + dd.Edges.namedEntity[name] = []*Entity{} + } else { + dd.Edges.namedEntity[name] = append(dd.Edges.namedEntity[name], edges...) + } +} + +// DocumentDataSlice is a parsable slice of DocumentData. +type DocumentDataSlice []*DocumentData diff --git a/internal/ent/generated/documentdata/documentdata.go b/internal/ent/generated/documentdata/documentdata.go new file mode 100644 index 0000000..e4a65e2 --- /dev/null +++ b/internal/ent/generated/documentdata/documentdata.go @@ -0,0 +1,226 @@ +// Code generated by ent, DO NOT EDIT. + +package documentdata + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the documentdata type in the database. + Label = "document_data" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldTemplateID holds the string denoting the template_id field in the database. + FieldTemplateID = "template_id" + // FieldData holds the string denoting the data field in the database. + FieldData = "data" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeTemplate holds the string denoting the template edge name in mutations. + EdgeTemplate = "template" + // EdgeEntity holds the string denoting the entity edge name in mutations. + EdgeEntity = "entity" + // Table holds the table name of the documentdata in the database. + Table = "document_data" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "document_data" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // TemplateTable is the table that holds the template relation/edge. + TemplateTable = "document_data" + // TemplateInverseTable is the table name for the Template entity. + // It exists in this package in order to avoid circular dependency with the "template" package. + TemplateInverseTable = "templates" + // TemplateColumn is the table column denoting the template relation/edge. + TemplateColumn = "template_id" + // EntityTable is the table that holds the entity relation/edge. The primary key declared below. + EntityTable = "entity_documents" + // EntityInverseTable is the table name for the Entity entity. + // It exists in this package in order to avoid circular dependency with the "entity" package. + EntityInverseTable = "entities" +) + +// Columns holds all SQL columns for documentdata fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldTemplateID, + FieldData, +} + +var ( + // EntityPrimaryKey and EntityColumn2 are the table columns denoting the + // primary key for the entity relation (M2M). + EntityPrimaryKey = []string{"entity_id", "document_data_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the DocumentData queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByTemplateID orders the results by the template_id field. +func ByTemplateID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTemplateID, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByTemplateField orders the results by template field. +func ByTemplateField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newTemplateStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEntityCount orders the results by entity count. +func ByEntityCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntityStep(), opts...) + } +} + +// ByEntity orders the results by entity terms. +func ByEntity(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntityStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newTemplateStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(TemplateInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, TemplateTable, TemplateColumn), + ) +} +func newEntityStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntityInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntityTable, EntityPrimaryKey...), + ) +} diff --git a/internal/ent/generated/documentdata/where.go b/internal/ent/generated/documentdata/where.go new file mode 100644 index 0000000..6e20789 --- /dev/null +++ b/internal/ent/generated/documentdata/where.go @@ -0,0 +1,805 @@ +// Code generated by ent, DO NOT EDIT. + +package documentdata + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldOwnerID, v)) +} + +// TemplateID applies equality check predicate on the "template_id" field. It's identical to TemplateIDEQ. +func TemplateID(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldTemplateID, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TemplateIDEQ applies the EQ predicate on the "template_id" field. +func TemplateIDEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEQ(FieldTemplateID, v)) +} + +// TemplateIDNEQ applies the NEQ predicate on the "template_id" field. +func TemplateIDNEQ(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNEQ(FieldTemplateID, v)) +} + +// TemplateIDIn applies the In predicate on the "template_id" field. +func TemplateIDIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldIn(FieldTemplateID, vs...)) +} + +// TemplateIDNotIn applies the NotIn predicate on the "template_id" field. +func TemplateIDNotIn(vs ...string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldNotIn(FieldTemplateID, vs...)) +} + +// TemplateIDGT applies the GT predicate on the "template_id" field. +func TemplateIDGT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGT(FieldTemplateID, v)) +} + +// TemplateIDGTE applies the GTE predicate on the "template_id" field. +func TemplateIDGTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldGTE(FieldTemplateID, v)) +} + +// TemplateIDLT applies the LT predicate on the "template_id" field. +func TemplateIDLT(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLT(FieldTemplateID, v)) +} + +// TemplateIDLTE applies the LTE predicate on the "template_id" field. +func TemplateIDLTE(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldLTE(FieldTemplateID, v)) +} + +// TemplateIDContains applies the Contains predicate on the "template_id" field. +func TemplateIDContains(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContains(FieldTemplateID, v)) +} + +// TemplateIDHasPrefix applies the HasPrefix predicate on the "template_id" field. +func TemplateIDHasPrefix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasPrefix(FieldTemplateID, v)) +} + +// TemplateIDHasSuffix applies the HasSuffix predicate on the "template_id" field. +func TemplateIDHasSuffix(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldHasSuffix(FieldTemplateID, v)) +} + +// TemplateIDEqualFold applies the EqualFold predicate on the "template_id" field. +func TemplateIDEqualFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldEqualFold(FieldTemplateID, v)) +} + +// TemplateIDContainsFold applies the ContainsFold predicate on the "template_id" field. +func TemplateIDContainsFold(v string) predicate.DocumentData { + return predicate.DocumentData(sql.FieldContainsFold(FieldTemplateID, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.DocumentData { + return predicate.DocumentData(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.DocumentData + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.DocumentData { + return predicate.DocumentData(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.DocumentData + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasTemplate applies the HasEdge predicate on the "template" edge. +func HasTemplate() predicate.DocumentData { + return predicate.DocumentData(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, TemplateTable, TemplateColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.DocumentData + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasTemplateWith applies the HasEdge predicate on the "template" edge with a given conditions (other predicates). +func HasTemplateWith(preds ...predicate.Template) predicate.DocumentData { + return predicate.DocumentData(func(s *sql.Selector) { + step := newTemplateStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.DocumentData + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntity applies the HasEdge predicate on the "entity" edge. +func HasEntity() predicate.DocumentData { + return predicate.DocumentData(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntityTable, EntityPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityDocuments + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntityWith applies the HasEdge predicate on the "entity" edge with a given conditions (other predicates). +func HasEntityWith(preds ...predicate.Entity) predicate.DocumentData { + return predicate.DocumentData(func(s *sql.Selector) { + step := newEntityStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityDocuments + 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.DocumentData) predicate.DocumentData { + return predicate.DocumentData(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.DocumentData) predicate.DocumentData { + return predicate.DocumentData(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.DocumentData) predicate.DocumentData { + return predicate.DocumentData(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/documentdata_create.go b/internal/ent/generated/documentdata_create.go new file mode 100644 index 0000000..29706a3 --- /dev/null +++ b/internal/ent/generated/documentdata_create.go @@ -0,0 +1,497 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/template" +) + +// DocumentDataCreate is the builder for creating a DocumentData entity. +type DocumentDataCreate struct { + config + mutation *DocumentDataMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (ddc *DocumentDataCreate) SetCreatedAt(t time.Time) *DocumentDataCreate { + ddc.mutation.SetCreatedAt(t) + return ddc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableCreatedAt(t *time.Time) *DocumentDataCreate { + if t != nil { + ddc.SetCreatedAt(*t) + } + return ddc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ddc *DocumentDataCreate) SetUpdatedAt(t time.Time) *DocumentDataCreate { + ddc.mutation.SetUpdatedAt(t) + return ddc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableUpdatedAt(t *time.Time) *DocumentDataCreate { + if t != nil { + ddc.SetUpdatedAt(*t) + } + return ddc +} + +// SetCreatedBy sets the "created_by" field. +func (ddc *DocumentDataCreate) SetCreatedBy(s string) *DocumentDataCreate { + ddc.mutation.SetCreatedBy(s) + return ddc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableCreatedBy(s *string) *DocumentDataCreate { + if s != nil { + ddc.SetCreatedBy(*s) + } + return ddc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ddc *DocumentDataCreate) SetUpdatedBy(s string) *DocumentDataCreate { + ddc.mutation.SetUpdatedBy(s) + return ddc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableUpdatedBy(s *string) *DocumentDataCreate { + if s != nil { + ddc.SetUpdatedBy(*s) + } + return ddc +} + +// SetMappingID sets the "mapping_id" field. +func (ddc *DocumentDataCreate) SetMappingID(s string) *DocumentDataCreate { + ddc.mutation.SetMappingID(s) + return ddc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableMappingID(s *string) *DocumentDataCreate { + if s != nil { + ddc.SetMappingID(*s) + } + return ddc +} + +// SetTags sets the "tags" field. +func (ddc *DocumentDataCreate) SetTags(s []string) *DocumentDataCreate { + ddc.mutation.SetTags(s) + return ddc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ddc *DocumentDataCreate) SetDeletedAt(t time.Time) *DocumentDataCreate { + ddc.mutation.SetDeletedAt(t) + return ddc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableDeletedAt(t *time.Time) *DocumentDataCreate { + if t != nil { + ddc.SetDeletedAt(*t) + } + return ddc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ddc *DocumentDataCreate) SetDeletedBy(s string) *DocumentDataCreate { + ddc.mutation.SetDeletedBy(s) + return ddc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableDeletedBy(s *string) *DocumentDataCreate { + if s != nil { + ddc.SetDeletedBy(*s) + } + return ddc +} + +// SetOwnerID sets the "owner_id" field. +func (ddc *DocumentDataCreate) SetOwnerID(s string) *DocumentDataCreate { + ddc.mutation.SetOwnerID(s) + return ddc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableOwnerID(s *string) *DocumentDataCreate { + if s != nil { + ddc.SetOwnerID(*s) + } + return ddc +} + +// SetTemplateID sets the "template_id" field. +func (ddc *DocumentDataCreate) SetTemplateID(s string) *DocumentDataCreate { + ddc.mutation.SetTemplateID(s) + return ddc +} + +// SetData sets the "data" field. +func (ddc *DocumentDataCreate) SetData(co customtypes.JSONObject) *DocumentDataCreate { + ddc.mutation.SetData(co) + return ddc +} + +// SetID sets the "id" field. +func (ddc *DocumentDataCreate) SetID(s string) *DocumentDataCreate { + ddc.mutation.SetID(s) + return ddc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ddc *DocumentDataCreate) SetNillableID(s *string) *DocumentDataCreate { + if s != nil { + ddc.SetID(*s) + } + return ddc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (ddc *DocumentDataCreate) SetOwner(o *Organization) *DocumentDataCreate { + return ddc.SetOwnerID(o.ID) +} + +// SetTemplate sets the "template" edge to the Template entity. +func (ddc *DocumentDataCreate) SetTemplate(t *Template) *DocumentDataCreate { + return ddc.SetTemplateID(t.ID) +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by IDs. +func (ddc *DocumentDataCreate) AddEntityIDs(ids ...string) *DocumentDataCreate { + ddc.mutation.AddEntityIDs(ids...) + return ddc +} + +// AddEntity adds the "entity" edges to the Entity entity. +func (ddc *DocumentDataCreate) AddEntity(e ...*Entity) *DocumentDataCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ddc.AddEntityIDs(ids...) +} + +// Mutation returns the DocumentDataMutation object of the builder. +func (ddc *DocumentDataCreate) Mutation() *DocumentDataMutation { + return ddc.mutation +} + +// Save creates the DocumentData in the database. +func (ddc *DocumentDataCreate) Save(ctx context.Context) (*DocumentData, error) { + if err := ddc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ddc.sqlSave, ddc.mutation, ddc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ddc *DocumentDataCreate) SaveX(ctx context.Context) *DocumentData { + v, err := ddc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ddc *DocumentDataCreate) Exec(ctx context.Context) error { + _, err := ddc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddc *DocumentDataCreate) ExecX(ctx context.Context) { + if err := ddc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ddc *DocumentDataCreate) defaults() error { + if _, ok := ddc.mutation.CreatedAt(); !ok { + if documentdata.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdata.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := documentdata.DefaultCreatedAt() + ddc.mutation.SetCreatedAt(v) + } + if _, ok := ddc.mutation.UpdatedAt(); !ok { + if documentdata.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdata.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := documentdata.DefaultUpdatedAt() + ddc.mutation.SetUpdatedAt(v) + } + if _, ok := ddc.mutation.MappingID(); !ok { + if documentdata.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized documentdata.DefaultMappingID (forgotten import generated/runtime?)") + } + v := documentdata.DefaultMappingID() + ddc.mutation.SetMappingID(v) + } + if _, ok := ddc.mutation.Tags(); !ok { + v := documentdata.DefaultTags + ddc.mutation.SetTags(v) + } + if _, ok := ddc.mutation.ID(); !ok { + if documentdata.DefaultID == nil { + return fmt.Errorf("generated: uninitialized documentdata.DefaultID (forgotten import generated/runtime?)") + } + v := documentdata.DefaultID() + ddc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ddc *DocumentDataCreate) check() error { + if _, ok := ddc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "DocumentData.mapping_id"`)} + } + if v, ok := ddc.mutation.OwnerID(); ok { + if err := documentdata.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "DocumentData.owner_id": %w`, err)} + } + } + if _, ok := ddc.mutation.TemplateID(); !ok { + return &ValidationError{Name: "template_id", err: errors.New(`generated: missing required field "DocumentData.template_id"`)} + } + if _, ok := ddc.mutation.Data(); !ok { + return &ValidationError{Name: "data", err: errors.New(`generated: missing required field "DocumentData.data"`)} + } + if len(ddc.mutation.TemplateIDs()) == 0 { + return &ValidationError{Name: "template", err: errors.New(`generated: missing required edge "DocumentData.template"`)} + } + return nil +} + +func (ddc *DocumentDataCreate) sqlSave(ctx context.Context) (*DocumentData, error) { + if err := ddc.check(); err != nil { + return nil, err + } + _node, _spec := ddc.createSpec() + if err := sqlgraph.CreateNode(ctx, ddc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected DocumentData.ID type: %T", _spec.ID.Value) + } + } + ddc.mutation.id = &_node.ID + ddc.mutation.done = true + return _node, nil +} + +func (ddc *DocumentDataCreate) createSpec() (*DocumentData, *sqlgraph.CreateSpec) { + var ( + _node = &DocumentData{config: ddc.config} + _spec = sqlgraph.NewCreateSpec(documentdata.Table, sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString)) + ) + _spec.Schema = ddc.schemaConfig.DocumentData + if id, ok := ddc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ddc.mutation.CreatedAt(); ok { + _spec.SetField(documentdata.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ddc.mutation.UpdatedAt(); ok { + _spec.SetField(documentdata.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ddc.mutation.CreatedBy(); ok { + _spec.SetField(documentdata.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ddc.mutation.UpdatedBy(); ok { + _spec.SetField(documentdata.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ddc.mutation.MappingID(); ok { + _spec.SetField(documentdata.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ddc.mutation.Tags(); ok { + _spec.SetField(documentdata.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ddc.mutation.DeletedAt(); ok { + _spec.SetField(documentdata.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ddc.mutation.DeletedBy(); ok { + _spec.SetField(documentdata.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ddc.mutation.Data(); ok { + _spec.SetField(documentdata.FieldData, field.TypeJSON, value) + _node.Data = value + } + if nodes := ddc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.OwnerTable, + Columns: []string{documentdata.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ddc.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ddc.mutation.TemplateIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.TemplateTable, + Columns: []string{documentdata.TemplateColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ddc.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.TemplateID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ddc.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ddc.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// DocumentDataCreateBulk is the builder for creating many DocumentData entities in bulk. +type DocumentDataCreateBulk struct { + config + err error + builders []*DocumentDataCreate +} + +// Save creates the DocumentData entities in the database. +func (ddcb *DocumentDataCreateBulk) Save(ctx context.Context) ([]*DocumentData, error) { + if ddcb.err != nil { + return nil, ddcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ddcb.builders)) + nodes := make([]*DocumentData, len(ddcb.builders)) + mutators := make([]Mutator, len(ddcb.builders)) + for i := range ddcb.builders { + func(i int, root context.Context) { + builder := ddcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*DocumentDataMutation) + 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, ddcb.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, ddcb.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, ddcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ddcb *DocumentDataCreateBulk) SaveX(ctx context.Context) []*DocumentData { + v, err := ddcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ddcb *DocumentDataCreateBulk) Exec(ctx context.Context) error { + _, err := ddcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddcb *DocumentDataCreateBulk) ExecX(ctx context.Context) { + if err := ddcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/documentdata_delete.go b/internal/ent/generated/documentdata_delete.go new file mode 100644 index 0000000..2ed342b --- /dev/null +++ b/internal/ent/generated/documentdata_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// DocumentDataDelete is the builder for deleting a DocumentData entity. +type DocumentDataDelete struct { + config + hooks []Hook + mutation *DocumentDataMutation +} + +// Where appends a list predicates to the DocumentDataDelete builder. +func (ddd *DocumentDataDelete) Where(ps ...predicate.DocumentData) *DocumentDataDelete { + ddd.mutation.Where(ps...) + return ddd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ddd *DocumentDataDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ddd.sqlExec, ddd.mutation, ddd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddd *DocumentDataDelete) ExecX(ctx context.Context) int { + n, err := ddd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ddd *DocumentDataDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(documentdata.Table, sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString)) + _spec.Node.Schema = ddd.schemaConfig.DocumentData + ctx = internal.NewSchemaConfigContext(ctx, ddd.schemaConfig) + if ps := ddd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ddd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ddd.mutation.done = true + return affected, err +} + +// DocumentDataDeleteOne is the builder for deleting a single DocumentData entity. +type DocumentDataDeleteOne struct { + ddd *DocumentDataDelete +} + +// Where appends a list predicates to the DocumentDataDelete builder. +func (dddo *DocumentDataDeleteOne) Where(ps ...predicate.DocumentData) *DocumentDataDeleteOne { + dddo.ddd.mutation.Where(ps...) + return dddo +} + +// Exec executes the deletion query. +func (dddo *DocumentDataDeleteOne) Exec(ctx context.Context) error { + n, err := dddo.ddd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{documentdata.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (dddo *DocumentDataDeleteOne) ExecX(ctx context.Context) { + if err := dddo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/documentdata_query.go b/internal/ent/generated/documentdata_query.go new file mode 100644 index 0000000..b7f5532 --- /dev/null +++ b/internal/ent/generated/documentdata_query.go @@ -0,0 +1,848 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/template" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// DocumentDataQuery is the builder for querying DocumentData entities. +type DocumentDataQuery struct { + config + ctx *QueryContext + order []documentdata.OrderOption + inters []Interceptor + predicates []predicate.DocumentData + withOwner *OrganizationQuery + withTemplate *TemplateQuery + withEntity *EntityQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*DocumentData) error + withNamedEntity map[string]*EntityQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the DocumentDataQuery builder. +func (ddq *DocumentDataQuery) Where(ps ...predicate.DocumentData) *DocumentDataQuery { + ddq.predicates = append(ddq.predicates, ps...) + return ddq +} + +// Limit the number of records to be returned by this query. +func (ddq *DocumentDataQuery) Limit(limit int) *DocumentDataQuery { + ddq.ctx.Limit = &limit + return ddq +} + +// Offset to start from. +func (ddq *DocumentDataQuery) Offset(offset int) *DocumentDataQuery { + ddq.ctx.Offset = &offset + return ddq +} + +// 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 (ddq *DocumentDataQuery) Unique(unique bool) *DocumentDataQuery { + ddq.ctx.Unique = &unique + return ddq +} + +// Order specifies how the records should be ordered. +func (ddq *DocumentDataQuery) Order(o ...documentdata.OrderOption) *DocumentDataQuery { + ddq.order = append(ddq.order, o...) + return ddq +} + +// QueryOwner chains the current query on the "owner" edge. +func (ddq *DocumentDataQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: ddq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := ddq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := ddq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(documentdata.Table, documentdata.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, documentdata.OwnerTable, documentdata.OwnerColumn), + ) + schemaConfig := ddq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.DocumentData + fromU = sqlgraph.SetNeighbors(ddq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryTemplate chains the current query on the "template" edge. +func (ddq *DocumentDataQuery) QueryTemplate() *TemplateQuery { + query := (&TemplateClient{config: ddq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := ddq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := ddq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(documentdata.Table, documentdata.FieldID, selector), + sqlgraph.To(template.Table, template.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, documentdata.TemplateTable, documentdata.TemplateColumn), + ) + schemaConfig := ddq.schemaConfig + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.DocumentData + fromU = sqlgraph.SetNeighbors(ddq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntity chains the current query on the "entity" edge. +func (ddq *DocumentDataQuery) QueryEntity() *EntityQuery { + query := (&EntityClient{config: ddq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := ddq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := ddq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(documentdata.Table, documentdata.FieldID, selector), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, documentdata.EntityTable, documentdata.EntityPrimaryKey...), + ) + schemaConfig := ddq.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityDocuments + fromU = sqlgraph.SetNeighbors(ddq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first DocumentData entity from the query. +// Returns a *NotFoundError when no DocumentData was found. +func (ddq *DocumentDataQuery) First(ctx context.Context) (*DocumentData, error) { + nodes, err := ddq.Limit(1).All(setContextOp(ctx, ddq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{documentdata.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ddq *DocumentDataQuery) FirstX(ctx context.Context) *DocumentData { + node, err := ddq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first DocumentData ID from the query. +// Returns a *NotFoundError when no DocumentData ID was found. +func (ddq *DocumentDataQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ddq.Limit(1).IDs(setContextOp(ctx, ddq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{documentdata.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ddq *DocumentDataQuery) FirstIDX(ctx context.Context) string { + id, err := ddq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single DocumentData entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one DocumentData entity is found. +// Returns a *NotFoundError when no DocumentData entities are found. +func (ddq *DocumentDataQuery) Only(ctx context.Context) (*DocumentData, error) { + nodes, err := ddq.Limit(2).All(setContextOp(ctx, ddq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{documentdata.Label} + default: + return nil, &NotSingularError{documentdata.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ddq *DocumentDataQuery) OnlyX(ctx context.Context) *DocumentData { + node, err := ddq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only DocumentData ID in the query. +// Returns a *NotSingularError when more than one DocumentData ID is found. +// Returns a *NotFoundError when no entities are found. +func (ddq *DocumentDataQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ddq.Limit(2).IDs(setContextOp(ctx, ddq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{documentdata.Label} + default: + err = &NotSingularError{documentdata.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ddq *DocumentDataQuery) OnlyIDX(ctx context.Context) string { + id, err := ddq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of DocumentDataSlice. +func (ddq *DocumentDataQuery) All(ctx context.Context) ([]*DocumentData, error) { + ctx = setContextOp(ctx, ddq.ctx, ent.OpQueryAll) + if err := ddq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*DocumentData, *DocumentDataQuery]() + return withInterceptors[[]*DocumentData](ctx, ddq, qr, ddq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ddq *DocumentDataQuery) AllX(ctx context.Context) []*DocumentData { + nodes, err := ddq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of DocumentData IDs. +func (ddq *DocumentDataQuery) IDs(ctx context.Context) (ids []string, err error) { + if ddq.ctx.Unique == nil && ddq.path != nil { + ddq.Unique(true) + } + ctx = setContextOp(ctx, ddq.ctx, ent.OpQueryIDs) + if err = ddq.Select(documentdata.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ddq *DocumentDataQuery) IDsX(ctx context.Context) []string { + ids, err := ddq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ddq *DocumentDataQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ddq.ctx, ent.OpQueryCount) + if err := ddq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ddq, querierCount[*DocumentDataQuery](), ddq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ddq *DocumentDataQuery) CountX(ctx context.Context) int { + count, err := ddq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ddq *DocumentDataQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ddq.ctx, ent.OpQueryExist) + switch _, err := ddq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ddq *DocumentDataQuery) ExistX(ctx context.Context) bool { + exist, err := ddq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the DocumentDataQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ddq *DocumentDataQuery) Clone() *DocumentDataQuery { + if ddq == nil { + return nil + } + return &DocumentDataQuery{ + config: ddq.config, + ctx: ddq.ctx.Clone(), + order: append([]documentdata.OrderOption{}, ddq.order...), + inters: append([]Interceptor{}, ddq.inters...), + predicates: append([]predicate.DocumentData{}, ddq.predicates...), + withOwner: ddq.withOwner.Clone(), + withTemplate: ddq.withTemplate.Clone(), + withEntity: ddq.withEntity.Clone(), + // clone intermediate query. + sql: ddq.sql.Clone(), + path: ddq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (ddq *DocumentDataQuery) WithOwner(opts ...func(*OrganizationQuery)) *DocumentDataQuery { + query := (&OrganizationClient{config: ddq.config}).Query() + for _, opt := range opts { + opt(query) + } + ddq.withOwner = query + return ddq +} + +// WithTemplate tells the query-builder to eager-load the nodes that are connected to +// the "template" edge. The optional arguments are used to configure the query builder of the edge. +func (ddq *DocumentDataQuery) WithTemplate(opts ...func(*TemplateQuery)) *DocumentDataQuery { + query := (&TemplateClient{config: ddq.config}).Query() + for _, opt := range opts { + opt(query) + } + ddq.withTemplate = query + return ddq +} + +// WithEntity tells the query-builder to eager-load the nodes that are connected to +// the "entity" edge. The optional arguments are used to configure the query builder of the edge. +func (ddq *DocumentDataQuery) WithEntity(opts ...func(*EntityQuery)) *DocumentDataQuery { + query := (&EntityClient{config: ddq.config}).Query() + for _, opt := range opts { + opt(query) + } + ddq.withEntity = query + return ddq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.DocumentData.Query(). +// GroupBy(documentdata.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ddq *DocumentDataQuery) GroupBy(field string, fields ...string) *DocumentDataGroupBy { + ddq.ctx.Fields = append([]string{field}, fields...) + grbuild := &DocumentDataGroupBy{build: ddq} + grbuild.flds = &ddq.ctx.Fields + grbuild.label = documentdata.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.DocumentData.Query(). +// Select(documentdata.FieldCreatedAt). +// Scan(ctx, &v) +func (ddq *DocumentDataQuery) Select(fields ...string) *DocumentDataSelect { + ddq.ctx.Fields = append(ddq.ctx.Fields, fields...) + sbuild := &DocumentDataSelect{DocumentDataQuery: ddq} + sbuild.label = documentdata.Label + sbuild.flds, sbuild.scan = &ddq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a DocumentDataSelect configured with the given aggregations. +func (ddq *DocumentDataQuery) Aggregate(fns ...AggregateFunc) *DocumentDataSelect { + return ddq.Select().Aggregate(fns...) +} + +func (ddq *DocumentDataQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ddq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ddq); err != nil { + return err + } + } + } + for _, f := range ddq.ctx.Fields { + if !documentdata.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ddq.path != nil { + prev, err := ddq.path(ctx) + if err != nil { + return err + } + ddq.sql = prev + } + if documentdata.Policy == nil { + return errors.New("generated: uninitialized documentdata.Policy (forgotten import generated/runtime?)") + } + if err := documentdata.Policy.EvalQuery(ctx, ddq); err != nil { + return err + } + return nil +} + +func (ddq *DocumentDataQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*DocumentData, error) { + var ( + nodes = []*DocumentData{} + _spec = ddq.querySpec() + loadedTypes = [3]bool{ + ddq.withOwner != nil, + ddq.withTemplate != nil, + ddq.withEntity != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*DocumentData).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &DocumentData{config: ddq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = ddq.schemaConfig.DocumentData + ctx = internal.NewSchemaConfigContext(ctx, ddq.schemaConfig) + if len(ddq.modifiers) > 0 { + _spec.Modifiers = ddq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ddq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := ddq.withOwner; query != nil { + if err := ddq.loadOwner(ctx, query, nodes, nil, + func(n *DocumentData, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := ddq.withTemplate; query != nil { + if err := ddq.loadTemplate(ctx, query, nodes, nil, + func(n *DocumentData, e *Template) { n.Edges.Template = e }); err != nil { + return nil, err + } + } + if query := ddq.withEntity; query != nil { + if err := ddq.loadEntity(ctx, query, nodes, + func(n *DocumentData) { n.Edges.Entity = []*Entity{} }, + func(n *DocumentData, e *Entity) { n.Edges.Entity = append(n.Edges.Entity, e) }); err != nil { + return nil, err + } + } + for name, query := range ddq.withNamedEntity { + if err := ddq.loadEntity(ctx, query, nodes, + func(n *DocumentData) { n.appendNamedEntity(name) }, + func(n *DocumentData, e *Entity) { n.appendNamedEntity(name, e) }); err != nil { + return nil, err + } + } + for i := range ddq.loadTotal { + if err := ddq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ddq *DocumentDataQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*DocumentData, init func(*DocumentData), assign func(*DocumentData, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*DocumentData) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (ddq *DocumentDataQuery) loadTemplate(ctx context.Context, query *TemplateQuery, nodes []*DocumentData, init func(*DocumentData), assign func(*DocumentData, *Template)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*DocumentData) + for i := range nodes { + fk := nodes[i].TemplateID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(template.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 "template_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (ddq *DocumentDataQuery) loadEntity(ctx context.Context, query *EntityQuery, nodes []*DocumentData, init func(*DocumentData), assign func(*DocumentData, *Entity)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*DocumentData) + nids := make(map[string]map[*DocumentData]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(documentdata.EntityTable) + joinT.Schema(ddq.schemaConfig.EntityDocuments) + s.Join(joinT).On(s.C(entity.FieldID), joinT.C(documentdata.EntityPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(documentdata.EntityPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(documentdata.EntityPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*DocumentData]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Entity](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "entity" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (ddq *DocumentDataQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ddq.querySpec() + _spec.Node.Schema = ddq.schemaConfig.DocumentData + ctx = internal.NewSchemaConfigContext(ctx, ddq.schemaConfig) + if len(ddq.modifiers) > 0 { + _spec.Modifiers = ddq.modifiers + } + _spec.Node.Columns = ddq.ctx.Fields + if len(ddq.ctx.Fields) > 0 { + _spec.Unique = ddq.ctx.Unique != nil && *ddq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ddq.driver, _spec) +} + +func (ddq *DocumentDataQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(documentdata.Table, documentdata.Columns, sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString)) + _spec.From = ddq.sql + if unique := ddq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ddq.path != nil { + _spec.Unique = true + } + if fields := ddq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, documentdata.FieldID) + for i := range fields { + if fields[i] != documentdata.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if ddq.withOwner != nil { + _spec.Node.AddColumnOnce(documentdata.FieldOwnerID) + } + if ddq.withTemplate != nil { + _spec.Node.AddColumnOnce(documentdata.FieldTemplateID) + } + } + if ps := ddq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ddq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ddq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ddq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ddq *DocumentDataQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ddq.driver.Dialect()) + t1 := builder.Table(documentdata.Table) + columns := ddq.ctx.Fields + if len(columns) == 0 { + columns = documentdata.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ddq.sql != nil { + selector = ddq.sql + selector.Select(selector.Columns(columns...)...) + } + if ddq.ctx.Unique != nil && *ddq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ddq.schemaConfig.DocumentData) + ctx = internal.NewSchemaConfigContext(ctx, ddq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ddq.predicates { + p(selector) + } + for _, p := range ddq.order { + p(selector) + } + if offset := ddq.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 := ddq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEntity tells the query-builder to eager-load the nodes that are connected to the "entity" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (ddq *DocumentDataQuery) WithNamedEntity(name string, opts ...func(*EntityQuery)) *DocumentDataQuery { + query := (&EntityClient{config: ddq.config}).Query() + for _, opt := range opts { + opt(query) + } + if ddq.withNamedEntity == nil { + ddq.withNamedEntity = make(map[string]*EntityQuery) + } + ddq.withNamedEntity[name] = query + return ddq +} + +// DocumentDataGroupBy is the group-by builder for DocumentData entities. +type DocumentDataGroupBy struct { + selector + build *DocumentDataQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ddgb *DocumentDataGroupBy) Aggregate(fns ...AggregateFunc) *DocumentDataGroupBy { + ddgb.fns = append(ddgb.fns, fns...) + return ddgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ddgb *DocumentDataGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ddgb.build.ctx, ent.OpQueryGroupBy) + if err := ddgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DocumentDataQuery, *DocumentDataGroupBy](ctx, ddgb.build, ddgb, ddgb.build.inters, v) +} + +func (ddgb *DocumentDataGroupBy) sqlScan(ctx context.Context, root *DocumentDataQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ddgb.fns)) + for _, fn := range ddgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ddgb.flds)+len(ddgb.fns)) + for _, f := range *ddgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ddgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ddgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// DocumentDataSelect is the builder for selecting fields of DocumentData entities. +type DocumentDataSelect struct { + *DocumentDataQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (dds *DocumentDataSelect) Aggregate(fns ...AggregateFunc) *DocumentDataSelect { + dds.fns = append(dds.fns, fns...) + return dds +} + +// Scan applies the selector query and scans the result into the given value. +func (dds *DocumentDataSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, dds.ctx, ent.OpQuerySelect) + if err := dds.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DocumentDataQuery, *DocumentDataSelect](ctx, dds.DocumentDataQuery, dds, dds.inters, v) +} + +func (dds *DocumentDataSelect) sqlScan(ctx context.Context, root *DocumentDataQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(dds.fns)) + for _, fn := range dds.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*dds.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 := dds.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/documentdata_update.go b/internal/ent/generated/documentdata_update.go new file mode 100644 index 0000000..f8e47ef --- /dev/null +++ b/internal/ent/generated/documentdata_update.go @@ -0,0 +1,933 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/template" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// DocumentDataUpdate is the builder for updating DocumentData entities. +type DocumentDataUpdate struct { + config + hooks []Hook + mutation *DocumentDataMutation +} + +// Where appends a list predicates to the DocumentDataUpdate builder. +func (ddu *DocumentDataUpdate) Where(ps ...predicate.DocumentData) *DocumentDataUpdate { + ddu.mutation.Where(ps...) + return ddu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ddu *DocumentDataUpdate) SetUpdatedAt(t time.Time) *DocumentDataUpdate { + ddu.mutation.SetUpdatedAt(t) + return ddu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ddu *DocumentDataUpdate) ClearUpdatedAt() *DocumentDataUpdate { + ddu.mutation.ClearUpdatedAt() + return ddu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ddu *DocumentDataUpdate) SetUpdatedBy(s string) *DocumentDataUpdate { + ddu.mutation.SetUpdatedBy(s) + return ddu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ddu *DocumentDataUpdate) SetNillableUpdatedBy(s *string) *DocumentDataUpdate { + if s != nil { + ddu.SetUpdatedBy(*s) + } + return ddu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ddu *DocumentDataUpdate) ClearUpdatedBy() *DocumentDataUpdate { + ddu.mutation.ClearUpdatedBy() + return ddu +} + +// SetTags sets the "tags" field. +func (ddu *DocumentDataUpdate) SetTags(s []string) *DocumentDataUpdate { + ddu.mutation.SetTags(s) + return ddu +} + +// AppendTags appends s to the "tags" field. +func (ddu *DocumentDataUpdate) AppendTags(s []string) *DocumentDataUpdate { + ddu.mutation.AppendTags(s) + return ddu +} + +// ClearTags clears the value of the "tags" field. +func (ddu *DocumentDataUpdate) ClearTags() *DocumentDataUpdate { + ddu.mutation.ClearTags() + return ddu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ddu *DocumentDataUpdate) SetDeletedAt(t time.Time) *DocumentDataUpdate { + ddu.mutation.SetDeletedAt(t) + return ddu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ddu *DocumentDataUpdate) SetNillableDeletedAt(t *time.Time) *DocumentDataUpdate { + if t != nil { + ddu.SetDeletedAt(*t) + } + return ddu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ddu *DocumentDataUpdate) ClearDeletedAt() *DocumentDataUpdate { + ddu.mutation.ClearDeletedAt() + return ddu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ddu *DocumentDataUpdate) SetDeletedBy(s string) *DocumentDataUpdate { + ddu.mutation.SetDeletedBy(s) + return ddu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ddu *DocumentDataUpdate) SetNillableDeletedBy(s *string) *DocumentDataUpdate { + if s != nil { + ddu.SetDeletedBy(*s) + } + return ddu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ddu *DocumentDataUpdate) ClearDeletedBy() *DocumentDataUpdate { + ddu.mutation.ClearDeletedBy() + return ddu +} + +// SetOwnerID sets the "owner_id" field. +func (ddu *DocumentDataUpdate) SetOwnerID(s string) *DocumentDataUpdate { + ddu.mutation.SetOwnerID(s) + return ddu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ddu *DocumentDataUpdate) SetNillableOwnerID(s *string) *DocumentDataUpdate { + if s != nil { + ddu.SetOwnerID(*s) + } + return ddu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ddu *DocumentDataUpdate) ClearOwnerID() *DocumentDataUpdate { + ddu.mutation.ClearOwnerID() + return ddu +} + +// SetTemplateID sets the "template_id" field. +func (ddu *DocumentDataUpdate) SetTemplateID(s string) *DocumentDataUpdate { + ddu.mutation.SetTemplateID(s) + return ddu +} + +// SetNillableTemplateID sets the "template_id" field if the given value is not nil. +func (ddu *DocumentDataUpdate) SetNillableTemplateID(s *string) *DocumentDataUpdate { + if s != nil { + ddu.SetTemplateID(*s) + } + return ddu +} + +// SetData sets the "data" field. +func (ddu *DocumentDataUpdate) SetData(co customtypes.JSONObject) *DocumentDataUpdate { + ddu.mutation.SetData(co) + return ddu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (ddu *DocumentDataUpdate) SetOwner(o *Organization) *DocumentDataUpdate { + return ddu.SetOwnerID(o.ID) +} + +// SetTemplate sets the "template" edge to the Template entity. +func (ddu *DocumentDataUpdate) SetTemplate(t *Template) *DocumentDataUpdate { + return ddu.SetTemplateID(t.ID) +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by IDs. +func (ddu *DocumentDataUpdate) AddEntityIDs(ids ...string) *DocumentDataUpdate { + ddu.mutation.AddEntityIDs(ids...) + return ddu +} + +// AddEntity adds the "entity" edges to the Entity entity. +func (ddu *DocumentDataUpdate) AddEntity(e ...*Entity) *DocumentDataUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ddu.AddEntityIDs(ids...) +} + +// Mutation returns the DocumentDataMutation object of the builder. +func (ddu *DocumentDataUpdate) Mutation() *DocumentDataMutation { + return ddu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (ddu *DocumentDataUpdate) ClearOwner() *DocumentDataUpdate { + ddu.mutation.ClearOwner() + return ddu +} + +// ClearTemplate clears the "template" edge to the Template entity. +func (ddu *DocumentDataUpdate) ClearTemplate() *DocumentDataUpdate { + ddu.mutation.ClearTemplate() + return ddu +} + +// ClearEntity clears all "entity" edges to the Entity entity. +func (ddu *DocumentDataUpdate) ClearEntity() *DocumentDataUpdate { + ddu.mutation.ClearEntity() + return ddu +} + +// RemoveEntityIDs removes the "entity" edge to Entity entities by IDs. +func (ddu *DocumentDataUpdate) RemoveEntityIDs(ids ...string) *DocumentDataUpdate { + ddu.mutation.RemoveEntityIDs(ids...) + return ddu +} + +// RemoveEntity removes "entity" edges to Entity entities. +func (ddu *DocumentDataUpdate) RemoveEntity(e ...*Entity) *DocumentDataUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ddu.RemoveEntityIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ddu *DocumentDataUpdate) Save(ctx context.Context) (int, error) { + if err := ddu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ddu.sqlSave, ddu.mutation, ddu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ddu *DocumentDataUpdate) SaveX(ctx context.Context) int { + affected, err := ddu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ddu *DocumentDataUpdate) Exec(ctx context.Context) error { + _, err := ddu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddu *DocumentDataUpdate) ExecX(ctx context.Context) { + if err := ddu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ddu *DocumentDataUpdate) defaults() error { + if _, ok := ddu.mutation.UpdatedAt(); !ok && !ddu.mutation.UpdatedAtCleared() { + if documentdata.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdata.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := documentdata.UpdateDefaultUpdatedAt() + ddu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ddu *DocumentDataUpdate) check() error { + if v, ok := ddu.mutation.OwnerID(); ok { + if err := documentdata.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "DocumentData.owner_id": %w`, err)} + } + } + if ddu.mutation.TemplateCleared() && len(ddu.mutation.TemplateIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "DocumentData.template"`) + } + return nil +} + +func (ddu *DocumentDataUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := ddu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(documentdata.Table, documentdata.Columns, sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString)) + if ps := ddu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ddu.mutation.CreatedAtCleared() { + _spec.ClearField(documentdata.FieldCreatedAt, field.TypeTime) + } + if value, ok := ddu.mutation.UpdatedAt(); ok { + _spec.SetField(documentdata.FieldUpdatedAt, field.TypeTime, value) + } + if ddu.mutation.UpdatedAtCleared() { + _spec.ClearField(documentdata.FieldUpdatedAt, field.TypeTime) + } + if ddu.mutation.CreatedByCleared() { + _spec.ClearField(documentdata.FieldCreatedBy, field.TypeString) + } + if value, ok := ddu.mutation.UpdatedBy(); ok { + _spec.SetField(documentdata.FieldUpdatedBy, field.TypeString, value) + } + if ddu.mutation.UpdatedByCleared() { + _spec.ClearField(documentdata.FieldUpdatedBy, field.TypeString) + } + if value, ok := ddu.mutation.Tags(); ok { + _spec.SetField(documentdata.FieldTags, field.TypeJSON, value) + } + if value, ok := ddu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, documentdata.FieldTags, value) + }) + } + if ddu.mutation.TagsCleared() { + _spec.ClearField(documentdata.FieldTags, field.TypeJSON) + } + if value, ok := ddu.mutation.DeletedAt(); ok { + _spec.SetField(documentdata.FieldDeletedAt, field.TypeTime, value) + } + if ddu.mutation.DeletedAtCleared() { + _spec.ClearField(documentdata.FieldDeletedAt, field.TypeTime) + } + if value, ok := ddu.mutation.DeletedBy(); ok { + _spec.SetField(documentdata.FieldDeletedBy, field.TypeString, value) + } + if ddu.mutation.DeletedByCleared() { + _spec.ClearField(documentdata.FieldDeletedBy, field.TypeString) + } + if value, ok := ddu.mutation.Data(); ok { + _spec.SetField(documentdata.FieldData, field.TypeJSON, value) + } + if ddu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.OwnerTable, + Columns: []string{documentdata.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ddu.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ddu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.OwnerTable, + Columns: []string{documentdata.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ddu.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ddu.mutation.TemplateCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.TemplateTable, + Columns: []string{documentdata.TemplateColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ddu.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ddu.mutation.TemplateIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.TemplateTable, + Columns: []string{documentdata.TemplateColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ddu.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ddu.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ddu.schemaConfig.EntityDocuments + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ddu.mutation.RemovedEntityIDs(); len(nodes) > 0 && !ddu.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ddu.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ddu.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ddu.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = ddu.schemaConfig.DocumentData + ctx = internal.NewSchemaConfigContext(ctx, ddu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ddu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{documentdata.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ddu.mutation.done = true + return n, nil +} + +// DocumentDataUpdateOne is the builder for updating a single DocumentData entity. +type DocumentDataUpdateOne struct { + config + fields []string + hooks []Hook + mutation *DocumentDataMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (dduo *DocumentDataUpdateOne) SetUpdatedAt(t time.Time) *DocumentDataUpdateOne { + dduo.mutation.SetUpdatedAt(t) + return dduo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (dduo *DocumentDataUpdateOne) ClearUpdatedAt() *DocumentDataUpdateOne { + dduo.mutation.ClearUpdatedAt() + return dduo +} + +// SetUpdatedBy sets the "updated_by" field. +func (dduo *DocumentDataUpdateOne) SetUpdatedBy(s string) *DocumentDataUpdateOne { + dduo.mutation.SetUpdatedBy(s) + return dduo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (dduo *DocumentDataUpdateOne) SetNillableUpdatedBy(s *string) *DocumentDataUpdateOne { + if s != nil { + dduo.SetUpdatedBy(*s) + } + return dduo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (dduo *DocumentDataUpdateOne) ClearUpdatedBy() *DocumentDataUpdateOne { + dduo.mutation.ClearUpdatedBy() + return dduo +} + +// SetTags sets the "tags" field. +func (dduo *DocumentDataUpdateOne) SetTags(s []string) *DocumentDataUpdateOne { + dduo.mutation.SetTags(s) + return dduo +} + +// AppendTags appends s to the "tags" field. +func (dduo *DocumentDataUpdateOne) AppendTags(s []string) *DocumentDataUpdateOne { + dduo.mutation.AppendTags(s) + return dduo +} + +// ClearTags clears the value of the "tags" field. +func (dduo *DocumentDataUpdateOne) ClearTags() *DocumentDataUpdateOne { + dduo.mutation.ClearTags() + return dduo +} + +// SetDeletedAt sets the "deleted_at" field. +func (dduo *DocumentDataUpdateOne) SetDeletedAt(t time.Time) *DocumentDataUpdateOne { + dduo.mutation.SetDeletedAt(t) + return dduo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (dduo *DocumentDataUpdateOne) SetNillableDeletedAt(t *time.Time) *DocumentDataUpdateOne { + if t != nil { + dduo.SetDeletedAt(*t) + } + return dduo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (dduo *DocumentDataUpdateOne) ClearDeletedAt() *DocumentDataUpdateOne { + dduo.mutation.ClearDeletedAt() + return dduo +} + +// SetDeletedBy sets the "deleted_by" field. +func (dduo *DocumentDataUpdateOne) SetDeletedBy(s string) *DocumentDataUpdateOne { + dduo.mutation.SetDeletedBy(s) + return dduo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (dduo *DocumentDataUpdateOne) SetNillableDeletedBy(s *string) *DocumentDataUpdateOne { + if s != nil { + dduo.SetDeletedBy(*s) + } + return dduo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (dduo *DocumentDataUpdateOne) ClearDeletedBy() *DocumentDataUpdateOne { + dduo.mutation.ClearDeletedBy() + return dduo +} + +// SetOwnerID sets the "owner_id" field. +func (dduo *DocumentDataUpdateOne) SetOwnerID(s string) *DocumentDataUpdateOne { + dduo.mutation.SetOwnerID(s) + return dduo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (dduo *DocumentDataUpdateOne) SetNillableOwnerID(s *string) *DocumentDataUpdateOne { + if s != nil { + dduo.SetOwnerID(*s) + } + return dduo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (dduo *DocumentDataUpdateOne) ClearOwnerID() *DocumentDataUpdateOne { + dduo.mutation.ClearOwnerID() + return dduo +} + +// SetTemplateID sets the "template_id" field. +func (dduo *DocumentDataUpdateOne) SetTemplateID(s string) *DocumentDataUpdateOne { + dduo.mutation.SetTemplateID(s) + return dduo +} + +// SetNillableTemplateID sets the "template_id" field if the given value is not nil. +func (dduo *DocumentDataUpdateOne) SetNillableTemplateID(s *string) *DocumentDataUpdateOne { + if s != nil { + dduo.SetTemplateID(*s) + } + return dduo +} + +// SetData sets the "data" field. +func (dduo *DocumentDataUpdateOne) SetData(co customtypes.JSONObject) *DocumentDataUpdateOne { + dduo.mutation.SetData(co) + return dduo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (dduo *DocumentDataUpdateOne) SetOwner(o *Organization) *DocumentDataUpdateOne { + return dduo.SetOwnerID(o.ID) +} + +// SetTemplate sets the "template" edge to the Template entity. +func (dduo *DocumentDataUpdateOne) SetTemplate(t *Template) *DocumentDataUpdateOne { + return dduo.SetTemplateID(t.ID) +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by IDs. +func (dduo *DocumentDataUpdateOne) AddEntityIDs(ids ...string) *DocumentDataUpdateOne { + dduo.mutation.AddEntityIDs(ids...) + return dduo +} + +// AddEntity adds the "entity" edges to the Entity entity. +func (dduo *DocumentDataUpdateOne) AddEntity(e ...*Entity) *DocumentDataUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return dduo.AddEntityIDs(ids...) +} + +// Mutation returns the DocumentDataMutation object of the builder. +func (dduo *DocumentDataUpdateOne) Mutation() *DocumentDataMutation { + return dduo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (dduo *DocumentDataUpdateOne) ClearOwner() *DocumentDataUpdateOne { + dduo.mutation.ClearOwner() + return dduo +} + +// ClearTemplate clears the "template" edge to the Template entity. +func (dduo *DocumentDataUpdateOne) ClearTemplate() *DocumentDataUpdateOne { + dduo.mutation.ClearTemplate() + return dduo +} + +// ClearEntity clears all "entity" edges to the Entity entity. +func (dduo *DocumentDataUpdateOne) ClearEntity() *DocumentDataUpdateOne { + dduo.mutation.ClearEntity() + return dduo +} + +// RemoveEntityIDs removes the "entity" edge to Entity entities by IDs. +func (dduo *DocumentDataUpdateOne) RemoveEntityIDs(ids ...string) *DocumentDataUpdateOne { + dduo.mutation.RemoveEntityIDs(ids...) + return dduo +} + +// RemoveEntity removes "entity" edges to Entity entities. +func (dduo *DocumentDataUpdateOne) RemoveEntity(e ...*Entity) *DocumentDataUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return dduo.RemoveEntityIDs(ids...) +} + +// Where appends a list predicates to the DocumentDataUpdate builder. +func (dduo *DocumentDataUpdateOne) Where(ps ...predicate.DocumentData) *DocumentDataUpdateOne { + dduo.mutation.Where(ps...) + return dduo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (dduo *DocumentDataUpdateOne) Select(field string, fields ...string) *DocumentDataUpdateOne { + dduo.fields = append([]string{field}, fields...) + return dduo +} + +// Save executes the query and returns the updated DocumentData entity. +func (dduo *DocumentDataUpdateOne) Save(ctx context.Context) (*DocumentData, error) { + if err := dduo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, dduo.sqlSave, dduo.mutation, dduo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (dduo *DocumentDataUpdateOne) SaveX(ctx context.Context) *DocumentData { + node, err := dduo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (dduo *DocumentDataUpdateOne) Exec(ctx context.Context) error { + _, err := dduo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (dduo *DocumentDataUpdateOne) ExecX(ctx context.Context) { + if err := dduo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (dduo *DocumentDataUpdateOne) defaults() error { + if _, ok := dduo.mutation.UpdatedAt(); !ok && !dduo.mutation.UpdatedAtCleared() { + if documentdata.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdata.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := documentdata.UpdateDefaultUpdatedAt() + dduo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (dduo *DocumentDataUpdateOne) check() error { + if v, ok := dduo.mutation.OwnerID(); ok { + if err := documentdata.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "DocumentData.owner_id": %w`, err)} + } + } + if dduo.mutation.TemplateCleared() && len(dduo.mutation.TemplateIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "DocumentData.template"`) + } + return nil +} + +func (dduo *DocumentDataUpdateOne) sqlSave(ctx context.Context) (_node *DocumentData, err error) { + if err := dduo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(documentdata.Table, documentdata.Columns, sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString)) + id, ok := dduo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "DocumentData.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := dduo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, documentdata.FieldID) + for _, f := range fields { + if !documentdata.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != documentdata.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := dduo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if dduo.mutation.CreatedAtCleared() { + _spec.ClearField(documentdata.FieldCreatedAt, field.TypeTime) + } + if value, ok := dduo.mutation.UpdatedAt(); ok { + _spec.SetField(documentdata.FieldUpdatedAt, field.TypeTime, value) + } + if dduo.mutation.UpdatedAtCleared() { + _spec.ClearField(documentdata.FieldUpdatedAt, field.TypeTime) + } + if dduo.mutation.CreatedByCleared() { + _spec.ClearField(documentdata.FieldCreatedBy, field.TypeString) + } + if value, ok := dduo.mutation.UpdatedBy(); ok { + _spec.SetField(documentdata.FieldUpdatedBy, field.TypeString, value) + } + if dduo.mutation.UpdatedByCleared() { + _spec.ClearField(documentdata.FieldUpdatedBy, field.TypeString) + } + if value, ok := dduo.mutation.Tags(); ok { + _spec.SetField(documentdata.FieldTags, field.TypeJSON, value) + } + if value, ok := dduo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, documentdata.FieldTags, value) + }) + } + if dduo.mutation.TagsCleared() { + _spec.ClearField(documentdata.FieldTags, field.TypeJSON) + } + if value, ok := dduo.mutation.DeletedAt(); ok { + _spec.SetField(documentdata.FieldDeletedAt, field.TypeTime, value) + } + if dduo.mutation.DeletedAtCleared() { + _spec.ClearField(documentdata.FieldDeletedAt, field.TypeTime) + } + if value, ok := dduo.mutation.DeletedBy(); ok { + _spec.SetField(documentdata.FieldDeletedBy, field.TypeString, value) + } + if dduo.mutation.DeletedByCleared() { + _spec.ClearField(documentdata.FieldDeletedBy, field.TypeString) + } + if value, ok := dduo.mutation.Data(); ok { + _spec.SetField(documentdata.FieldData, field.TypeJSON, value) + } + if dduo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.OwnerTable, + Columns: []string{documentdata.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = dduo.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := dduo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.OwnerTable, + Columns: []string{documentdata.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = dduo.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if dduo.mutation.TemplateCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.TemplateTable, + Columns: []string{documentdata.TemplateColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = dduo.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := dduo.mutation.TemplateIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.TemplateTable, + Columns: []string{documentdata.TemplateColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = dduo.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if dduo.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = dduo.schemaConfig.EntityDocuments + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := dduo.mutation.RemovedEntityIDs(); len(nodes) > 0 && !dduo.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = dduo.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := dduo.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = dduo.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = dduo.schemaConfig.DocumentData + ctx = internal.NewSchemaConfigContext(ctx, dduo.schemaConfig) + _node = &DocumentData{config: dduo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, dduo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{documentdata.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + dduo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/documentdatahistory.go b/internal/ent/generated/documentdatahistory.go new file mode 100644 index 0000000..bf109f0 --- /dev/null +++ b/internal/ent/generated/documentdatahistory.go @@ -0,0 +1,258 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/entx/history" +) + +// DocumentDataHistory is the model entity for the DocumentDataHistory schema. +type DocumentDataHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the template id of the document + TemplateID string `json:"template_id,omitempty"` + // the json data of the document + Data customtypes.JSONObject `json:"data,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*DocumentDataHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case documentdatahistory.FieldTags, documentdatahistory.FieldData: + values[i] = new([]byte) + case documentdatahistory.FieldOperation: + values[i] = new(history.OpType) + case documentdatahistory.FieldID, documentdatahistory.FieldRef, documentdatahistory.FieldCreatedBy, documentdatahistory.FieldUpdatedBy, documentdatahistory.FieldMappingID, documentdatahistory.FieldDeletedBy, documentdatahistory.FieldOwnerID, documentdatahistory.FieldTemplateID: + values[i] = new(sql.NullString) + case documentdatahistory.FieldHistoryTime, documentdatahistory.FieldCreatedAt, documentdatahistory.FieldUpdatedAt, documentdatahistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the DocumentDataHistory fields. +func (ddh *DocumentDataHistory) 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 documentdatahistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + ddh.ID = value.String + } + case documentdatahistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + ddh.HistoryTime = value.Time + } + case documentdatahistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + ddh.Ref = value.String + } + case documentdatahistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + ddh.Operation = *value + } + case documentdatahistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + ddh.CreatedAt = value.Time + } + case documentdatahistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + ddh.UpdatedAt = value.Time + } + case documentdatahistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + ddh.CreatedBy = value.String + } + case documentdatahistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + ddh.UpdatedBy = value.String + } + case documentdatahistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + ddh.MappingID = value.String + } + case documentdatahistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ddh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case documentdatahistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + ddh.DeletedAt = value.Time + } + case documentdatahistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + ddh.DeletedBy = value.String + } + case documentdatahistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + ddh.OwnerID = value.String + } + case documentdatahistory.FieldTemplateID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field template_id", values[i]) + } else if value.Valid { + ddh.TemplateID = value.String + } + case documentdatahistory.FieldData: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field data", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ddh.Data); err != nil { + return fmt.Errorf("unmarshal field data: %w", err) + } + } + default: + ddh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the DocumentDataHistory. +// This includes values selected through modifiers, order, etc. +func (ddh *DocumentDataHistory) Value(name string) (ent.Value, error) { + return ddh.selectValues.Get(name) +} + +// Update returns a builder for updating this DocumentDataHistory. +// Note that you need to call DocumentDataHistory.Unwrap() before calling this method if this DocumentDataHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (ddh *DocumentDataHistory) Update() *DocumentDataHistoryUpdateOne { + return NewDocumentDataHistoryClient(ddh.config).UpdateOne(ddh) +} + +// Unwrap unwraps the DocumentDataHistory 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 (ddh *DocumentDataHistory) Unwrap() *DocumentDataHistory { + _tx, ok := ddh.config.driver.(*txDriver) + if !ok { + panic("generated: DocumentDataHistory is not a transactional entity") + } + ddh.config.driver = _tx.drv + return ddh +} + +// String implements the fmt.Stringer. +func (ddh *DocumentDataHistory) String() string { + var builder strings.Builder + builder.WriteString("DocumentDataHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", ddh.ID)) + builder.WriteString("history_time=") + builder.WriteString(ddh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(ddh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", ddh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(ddh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(ddh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(ddh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(ddh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(ddh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", ddh.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(ddh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(ddh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(ddh.OwnerID) + builder.WriteString(", ") + builder.WriteString("template_id=") + builder.WriteString(ddh.TemplateID) + builder.WriteString(", ") + builder.WriteString("data=") + builder.WriteString(fmt.Sprintf("%v", ddh.Data)) + builder.WriteByte(')') + return builder.String() +} + +// DocumentDataHistories is a parsable slice of DocumentDataHistory. +type DocumentDataHistories []*DocumentDataHistory diff --git a/internal/ent/generated/documentdatahistory/documentdatahistory.go b/internal/ent/generated/documentdatahistory/documentdatahistory.go new file mode 100644 index 0000000..2f36c4d --- /dev/null +++ b/internal/ent/generated/documentdatahistory/documentdatahistory.go @@ -0,0 +1,189 @@ +// Code generated by ent, DO NOT EDIT. + +package documentdatahistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the documentdatahistory type in the database. + Label = "document_data_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldTemplateID holds the string denoting the template_id field in the database. + FieldTemplateID = "template_id" + // FieldData holds the string denoting the data field in the database. + FieldData = "data" + // Table holds the table name of the documentdatahistory in the database. + Table = "document_data_history" +) + +// Columns holds all SQL columns for documentdatahistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldTemplateID, + FieldData, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("documentdatahistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the DocumentDataHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByTemplateID orders the results by the template_id field. +func ByTemplateID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTemplateID, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/documentdatahistory/where.go b/internal/ent/generated/documentdatahistory/where.go new file mode 100644 index 0000000..32c6483 --- /dev/null +++ b/internal/ent/generated/documentdatahistory/where.go @@ -0,0 +1,861 @@ +// Code generated by ent, DO NOT EDIT. + +package documentdatahistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// TemplateID applies equality check predicate on the "template_id" field. It's identical to TemplateIDEQ. +func TemplateID(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldTemplateID, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TemplateIDEQ applies the EQ predicate on the "template_id" field. +func TemplateIDEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEQ(FieldTemplateID, v)) +} + +// TemplateIDNEQ applies the NEQ predicate on the "template_id" field. +func TemplateIDNEQ(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNEQ(FieldTemplateID, v)) +} + +// TemplateIDIn applies the In predicate on the "template_id" field. +func TemplateIDIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldIn(FieldTemplateID, vs...)) +} + +// TemplateIDNotIn applies the NotIn predicate on the "template_id" field. +func TemplateIDNotIn(vs ...string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldNotIn(FieldTemplateID, vs...)) +} + +// TemplateIDGT applies the GT predicate on the "template_id" field. +func TemplateIDGT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGT(FieldTemplateID, v)) +} + +// TemplateIDGTE applies the GTE predicate on the "template_id" field. +func TemplateIDGTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldGTE(FieldTemplateID, v)) +} + +// TemplateIDLT applies the LT predicate on the "template_id" field. +func TemplateIDLT(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLT(FieldTemplateID, v)) +} + +// TemplateIDLTE applies the LTE predicate on the "template_id" field. +func TemplateIDLTE(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldLTE(FieldTemplateID, v)) +} + +// TemplateIDContains applies the Contains predicate on the "template_id" field. +func TemplateIDContains(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContains(FieldTemplateID, v)) +} + +// TemplateIDHasPrefix applies the HasPrefix predicate on the "template_id" field. +func TemplateIDHasPrefix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasPrefix(FieldTemplateID, v)) +} + +// TemplateIDHasSuffix applies the HasSuffix predicate on the "template_id" field. +func TemplateIDHasSuffix(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldHasSuffix(FieldTemplateID, v)) +} + +// TemplateIDEqualFold applies the EqualFold predicate on the "template_id" field. +func TemplateIDEqualFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldEqualFold(FieldTemplateID, v)) +} + +// TemplateIDContainsFold applies the ContainsFold predicate on the "template_id" field. +func TemplateIDContainsFold(v string) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.FieldContainsFold(FieldTemplateID, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.DocumentDataHistory) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.DocumentDataHistory) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.DocumentDataHistory) predicate.DocumentDataHistory { + return predicate.DocumentDataHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/documentdatahistory_create.go b/internal/ent/generated/documentdatahistory_create.go new file mode 100644 index 0000000..cf0b2bc --- /dev/null +++ b/internal/ent/generated/documentdatahistory_create.go @@ -0,0 +1,481 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/entx/history" +) + +// DocumentDataHistoryCreate is the builder for creating a DocumentDataHistory entity. +type DocumentDataHistoryCreate struct { + config + mutation *DocumentDataHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ddhc *DocumentDataHistoryCreate) SetHistoryTime(t time.Time) *DocumentDataHistoryCreate { + ddhc.mutation.SetHistoryTime(t) + return ddhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableHistoryTime(t *time.Time) *DocumentDataHistoryCreate { + if t != nil { + ddhc.SetHistoryTime(*t) + } + return ddhc +} + +// SetRef sets the "ref" field. +func (ddhc *DocumentDataHistoryCreate) SetRef(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetRef(s) + return ddhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableRef(s *string) *DocumentDataHistoryCreate { + if s != nil { + ddhc.SetRef(*s) + } + return ddhc +} + +// SetOperation sets the "operation" field. +func (ddhc *DocumentDataHistoryCreate) SetOperation(ht history.OpType) *DocumentDataHistoryCreate { + ddhc.mutation.SetOperation(ht) + return ddhc +} + +// SetCreatedAt sets the "created_at" field. +func (ddhc *DocumentDataHistoryCreate) SetCreatedAt(t time.Time) *DocumentDataHistoryCreate { + ddhc.mutation.SetCreatedAt(t) + return ddhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableCreatedAt(t *time.Time) *DocumentDataHistoryCreate { + if t != nil { + ddhc.SetCreatedAt(*t) + } + return ddhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ddhc *DocumentDataHistoryCreate) SetUpdatedAt(t time.Time) *DocumentDataHistoryCreate { + ddhc.mutation.SetUpdatedAt(t) + return ddhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableUpdatedAt(t *time.Time) *DocumentDataHistoryCreate { + if t != nil { + ddhc.SetUpdatedAt(*t) + } + return ddhc +} + +// SetCreatedBy sets the "created_by" field. +func (ddhc *DocumentDataHistoryCreate) SetCreatedBy(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetCreatedBy(s) + return ddhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableCreatedBy(s *string) *DocumentDataHistoryCreate { + if s != nil { + ddhc.SetCreatedBy(*s) + } + return ddhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ddhc *DocumentDataHistoryCreate) SetUpdatedBy(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetUpdatedBy(s) + return ddhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableUpdatedBy(s *string) *DocumentDataHistoryCreate { + if s != nil { + ddhc.SetUpdatedBy(*s) + } + return ddhc +} + +// SetMappingID sets the "mapping_id" field. +func (ddhc *DocumentDataHistoryCreate) SetMappingID(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetMappingID(s) + return ddhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableMappingID(s *string) *DocumentDataHistoryCreate { + if s != nil { + ddhc.SetMappingID(*s) + } + return ddhc +} + +// SetTags sets the "tags" field. +func (ddhc *DocumentDataHistoryCreate) SetTags(s []string) *DocumentDataHistoryCreate { + ddhc.mutation.SetTags(s) + return ddhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ddhc *DocumentDataHistoryCreate) SetDeletedAt(t time.Time) *DocumentDataHistoryCreate { + ddhc.mutation.SetDeletedAt(t) + return ddhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableDeletedAt(t *time.Time) *DocumentDataHistoryCreate { + if t != nil { + ddhc.SetDeletedAt(*t) + } + return ddhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ddhc *DocumentDataHistoryCreate) SetDeletedBy(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetDeletedBy(s) + return ddhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableDeletedBy(s *string) *DocumentDataHistoryCreate { + if s != nil { + ddhc.SetDeletedBy(*s) + } + return ddhc +} + +// SetOwnerID sets the "owner_id" field. +func (ddhc *DocumentDataHistoryCreate) SetOwnerID(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetOwnerID(s) + return ddhc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableOwnerID(s *string) *DocumentDataHistoryCreate { + if s != nil { + ddhc.SetOwnerID(*s) + } + return ddhc +} + +// SetTemplateID sets the "template_id" field. +func (ddhc *DocumentDataHistoryCreate) SetTemplateID(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetTemplateID(s) + return ddhc +} + +// SetData sets the "data" field. +func (ddhc *DocumentDataHistoryCreate) SetData(co customtypes.JSONObject) *DocumentDataHistoryCreate { + ddhc.mutation.SetData(co) + return ddhc +} + +// SetID sets the "id" field. +func (ddhc *DocumentDataHistoryCreate) SetID(s string) *DocumentDataHistoryCreate { + ddhc.mutation.SetID(s) + return ddhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ddhc *DocumentDataHistoryCreate) SetNillableID(s *string) *DocumentDataHistoryCreate { + if s != nil { + ddhc.SetID(*s) + } + return ddhc +} + +// Mutation returns the DocumentDataHistoryMutation object of the builder. +func (ddhc *DocumentDataHistoryCreate) Mutation() *DocumentDataHistoryMutation { + return ddhc.mutation +} + +// Save creates the DocumentDataHistory in the database. +func (ddhc *DocumentDataHistoryCreate) Save(ctx context.Context) (*DocumentDataHistory, error) { + if err := ddhc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ddhc.sqlSave, ddhc.mutation, ddhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ddhc *DocumentDataHistoryCreate) SaveX(ctx context.Context) *DocumentDataHistory { + v, err := ddhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ddhc *DocumentDataHistoryCreate) Exec(ctx context.Context) error { + _, err := ddhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddhc *DocumentDataHistoryCreate) ExecX(ctx context.Context) { + if err := ddhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ddhc *DocumentDataHistoryCreate) defaults() error { + if _, ok := ddhc.mutation.HistoryTime(); !ok { + if documentdatahistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized documentdatahistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := documentdatahistory.DefaultHistoryTime() + ddhc.mutation.SetHistoryTime(v) + } + if _, ok := ddhc.mutation.CreatedAt(); !ok { + if documentdatahistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdatahistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := documentdatahistory.DefaultCreatedAt() + ddhc.mutation.SetCreatedAt(v) + } + if _, ok := ddhc.mutation.UpdatedAt(); !ok { + if documentdatahistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdatahistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := documentdatahistory.DefaultUpdatedAt() + ddhc.mutation.SetUpdatedAt(v) + } + if _, ok := ddhc.mutation.MappingID(); !ok { + if documentdatahistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized documentdatahistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := documentdatahistory.DefaultMappingID() + ddhc.mutation.SetMappingID(v) + } + if _, ok := ddhc.mutation.Tags(); !ok { + v := documentdatahistory.DefaultTags + ddhc.mutation.SetTags(v) + } + if _, ok := ddhc.mutation.ID(); !ok { + if documentdatahistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized documentdatahistory.DefaultID (forgotten import generated/runtime?)") + } + v := documentdatahistory.DefaultID() + ddhc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ddhc *DocumentDataHistoryCreate) check() error { + if _, ok := ddhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "DocumentDataHistory.history_time"`)} + } + if _, ok := ddhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "DocumentDataHistory.operation"`)} + } + if v, ok := ddhc.mutation.Operation(); ok { + if err := documentdatahistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "DocumentDataHistory.operation": %w`, err)} + } + } + if _, ok := ddhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "DocumentDataHistory.mapping_id"`)} + } + if _, ok := ddhc.mutation.TemplateID(); !ok { + return &ValidationError{Name: "template_id", err: errors.New(`generated: missing required field "DocumentDataHistory.template_id"`)} + } + if _, ok := ddhc.mutation.Data(); !ok { + return &ValidationError{Name: "data", err: errors.New(`generated: missing required field "DocumentDataHistory.data"`)} + } + return nil +} + +func (ddhc *DocumentDataHistoryCreate) sqlSave(ctx context.Context) (*DocumentDataHistory, error) { + if err := ddhc.check(); err != nil { + return nil, err + } + _node, _spec := ddhc.createSpec() + if err := sqlgraph.CreateNode(ctx, ddhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected DocumentDataHistory.ID type: %T", _spec.ID.Value) + } + } + ddhc.mutation.id = &_node.ID + ddhc.mutation.done = true + return _node, nil +} + +func (ddhc *DocumentDataHistoryCreate) createSpec() (*DocumentDataHistory, *sqlgraph.CreateSpec) { + var ( + _node = &DocumentDataHistory{config: ddhc.config} + _spec = sqlgraph.NewCreateSpec(documentdatahistory.Table, sqlgraph.NewFieldSpec(documentdatahistory.FieldID, field.TypeString)) + ) + _spec.Schema = ddhc.schemaConfig.DocumentDataHistory + if id, ok := ddhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ddhc.mutation.HistoryTime(); ok { + _spec.SetField(documentdatahistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ddhc.mutation.Ref(); ok { + _spec.SetField(documentdatahistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ddhc.mutation.Operation(); ok { + _spec.SetField(documentdatahistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ddhc.mutation.CreatedAt(); ok { + _spec.SetField(documentdatahistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ddhc.mutation.UpdatedAt(); ok { + _spec.SetField(documentdatahistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ddhc.mutation.CreatedBy(); ok { + _spec.SetField(documentdatahistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ddhc.mutation.UpdatedBy(); ok { + _spec.SetField(documentdatahistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ddhc.mutation.MappingID(); ok { + _spec.SetField(documentdatahistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ddhc.mutation.Tags(); ok { + _spec.SetField(documentdatahistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ddhc.mutation.DeletedAt(); ok { + _spec.SetField(documentdatahistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ddhc.mutation.DeletedBy(); ok { + _spec.SetField(documentdatahistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ddhc.mutation.OwnerID(); ok { + _spec.SetField(documentdatahistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ddhc.mutation.TemplateID(); ok { + _spec.SetField(documentdatahistory.FieldTemplateID, field.TypeString, value) + _node.TemplateID = value + } + if value, ok := ddhc.mutation.Data(); ok { + _spec.SetField(documentdatahistory.FieldData, field.TypeJSON, value) + _node.Data = value + } + return _node, _spec +} + +// DocumentDataHistoryCreateBulk is the builder for creating many DocumentDataHistory entities in bulk. +type DocumentDataHistoryCreateBulk struct { + config + err error + builders []*DocumentDataHistoryCreate +} + +// Save creates the DocumentDataHistory entities in the database. +func (ddhcb *DocumentDataHistoryCreateBulk) Save(ctx context.Context) ([]*DocumentDataHistory, error) { + if ddhcb.err != nil { + return nil, ddhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ddhcb.builders)) + nodes := make([]*DocumentDataHistory, len(ddhcb.builders)) + mutators := make([]Mutator, len(ddhcb.builders)) + for i := range ddhcb.builders { + func(i int, root context.Context) { + builder := ddhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*DocumentDataHistoryMutation) + 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, ddhcb.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, ddhcb.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, ddhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ddhcb *DocumentDataHistoryCreateBulk) SaveX(ctx context.Context) []*DocumentDataHistory { + v, err := ddhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ddhcb *DocumentDataHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ddhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddhcb *DocumentDataHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ddhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/documentdatahistory_delete.go b/internal/ent/generated/documentdatahistory_delete.go new file mode 100644 index 0000000..b80ad8f --- /dev/null +++ b/internal/ent/generated/documentdatahistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// DocumentDataHistoryDelete is the builder for deleting a DocumentDataHistory entity. +type DocumentDataHistoryDelete struct { + config + hooks []Hook + mutation *DocumentDataHistoryMutation +} + +// Where appends a list predicates to the DocumentDataHistoryDelete builder. +func (ddhd *DocumentDataHistoryDelete) Where(ps ...predicate.DocumentDataHistory) *DocumentDataHistoryDelete { + ddhd.mutation.Where(ps...) + return ddhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ddhd *DocumentDataHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ddhd.sqlExec, ddhd.mutation, ddhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddhd *DocumentDataHistoryDelete) ExecX(ctx context.Context) int { + n, err := ddhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ddhd *DocumentDataHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(documentdatahistory.Table, sqlgraph.NewFieldSpec(documentdatahistory.FieldID, field.TypeString)) + _spec.Node.Schema = ddhd.schemaConfig.DocumentDataHistory + ctx = internal.NewSchemaConfigContext(ctx, ddhd.schemaConfig) + if ps := ddhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ddhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ddhd.mutation.done = true + return affected, err +} + +// DocumentDataHistoryDeleteOne is the builder for deleting a single DocumentDataHistory entity. +type DocumentDataHistoryDeleteOne struct { + ddhd *DocumentDataHistoryDelete +} + +// Where appends a list predicates to the DocumentDataHistoryDelete builder. +func (ddhdo *DocumentDataHistoryDeleteOne) Where(ps ...predicate.DocumentDataHistory) *DocumentDataHistoryDeleteOne { + ddhdo.ddhd.mutation.Where(ps...) + return ddhdo +} + +// Exec executes the deletion query. +func (ddhdo *DocumentDataHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ddhdo.ddhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{documentdatahistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddhdo *DocumentDataHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ddhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/documentdatahistory_query.go b/internal/ent/generated/documentdatahistory_query.go new file mode 100644 index 0000000..6a93d46 --- /dev/null +++ b/internal/ent/generated/documentdatahistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// DocumentDataHistoryQuery is the builder for querying DocumentDataHistory entities. +type DocumentDataHistoryQuery struct { + config + ctx *QueryContext + order []documentdatahistory.OrderOption + inters []Interceptor + predicates []predicate.DocumentDataHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*DocumentDataHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the DocumentDataHistoryQuery builder. +func (ddhq *DocumentDataHistoryQuery) Where(ps ...predicate.DocumentDataHistory) *DocumentDataHistoryQuery { + ddhq.predicates = append(ddhq.predicates, ps...) + return ddhq +} + +// Limit the number of records to be returned by this query. +func (ddhq *DocumentDataHistoryQuery) Limit(limit int) *DocumentDataHistoryQuery { + ddhq.ctx.Limit = &limit + return ddhq +} + +// Offset to start from. +func (ddhq *DocumentDataHistoryQuery) Offset(offset int) *DocumentDataHistoryQuery { + ddhq.ctx.Offset = &offset + return ddhq +} + +// 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 (ddhq *DocumentDataHistoryQuery) Unique(unique bool) *DocumentDataHistoryQuery { + ddhq.ctx.Unique = &unique + return ddhq +} + +// Order specifies how the records should be ordered. +func (ddhq *DocumentDataHistoryQuery) Order(o ...documentdatahistory.OrderOption) *DocumentDataHistoryQuery { + ddhq.order = append(ddhq.order, o...) + return ddhq +} + +// First returns the first DocumentDataHistory entity from the query. +// Returns a *NotFoundError when no DocumentDataHistory was found. +func (ddhq *DocumentDataHistoryQuery) First(ctx context.Context) (*DocumentDataHistory, error) { + nodes, err := ddhq.Limit(1).All(setContextOp(ctx, ddhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{documentdatahistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) FirstX(ctx context.Context) *DocumentDataHistory { + node, err := ddhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first DocumentDataHistory ID from the query. +// Returns a *NotFoundError when no DocumentDataHistory ID was found. +func (ddhq *DocumentDataHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ddhq.Limit(1).IDs(setContextOp(ctx, ddhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{documentdatahistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ddhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single DocumentDataHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one DocumentDataHistory entity is found. +// Returns a *NotFoundError when no DocumentDataHistory entities are found. +func (ddhq *DocumentDataHistoryQuery) Only(ctx context.Context) (*DocumentDataHistory, error) { + nodes, err := ddhq.Limit(2).All(setContextOp(ctx, ddhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{documentdatahistory.Label} + default: + return nil, &NotSingularError{documentdatahistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) OnlyX(ctx context.Context) *DocumentDataHistory { + node, err := ddhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only DocumentDataHistory ID in the query. +// Returns a *NotSingularError when more than one DocumentDataHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ddhq *DocumentDataHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ddhq.Limit(2).IDs(setContextOp(ctx, ddhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{documentdatahistory.Label} + default: + err = &NotSingularError{documentdatahistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ddhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of DocumentDataHistories. +func (ddhq *DocumentDataHistoryQuery) All(ctx context.Context) ([]*DocumentDataHistory, error) { + ctx = setContextOp(ctx, ddhq.ctx, ent.OpQueryAll) + if err := ddhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*DocumentDataHistory, *DocumentDataHistoryQuery]() + return withInterceptors[[]*DocumentDataHistory](ctx, ddhq, qr, ddhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) AllX(ctx context.Context) []*DocumentDataHistory { + nodes, err := ddhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of DocumentDataHistory IDs. +func (ddhq *DocumentDataHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ddhq.ctx.Unique == nil && ddhq.path != nil { + ddhq.Unique(true) + } + ctx = setContextOp(ctx, ddhq.ctx, ent.OpQueryIDs) + if err = ddhq.Select(documentdatahistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ddhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ddhq *DocumentDataHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ddhq.ctx, ent.OpQueryCount) + if err := ddhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ddhq, querierCount[*DocumentDataHistoryQuery](), ddhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) CountX(ctx context.Context) int { + count, err := ddhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ddhq *DocumentDataHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ddhq.ctx, ent.OpQueryExist) + switch _, err := ddhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ddhq *DocumentDataHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ddhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the DocumentDataHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ddhq *DocumentDataHistoryQuery) Clone() *DocumentDataHistoryQuery { + if ddhq == nil { + return nil + } + return &DocumentDataHistoryQuery{ + config: ddhq.config, + ctx: ddhq.ctx.Clone(), + order: append([]documentdatahistory.OrderOption{}, ddhq.order...), + inters: append([]Interceptor{}, ddhq.inters...), + predicates: append([]predicate.DocumentDataHistory{}, ddhq.predicates...), + // clone intermediate query. + sql: ddhq.sql.Clone(), + path: ddhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.DocumentDataHistory.Query(). +// GroupBy(documentdatahistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ddhq *DocumentDataHistoryQuery) GroupBy(field string, fields ...string) *DocumentDataHistoryGroupBy { + ddhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &DocumentDataHistoryGroupBy{build: ddhq} + grbuild.flds = &ddhq.ctx.Fields + grbuild.label = documentdatahistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.DocumentDataHistory.Query(). +// Select(documentdatahistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ddhq *DocumentDataHistoryQuery) Select(fields ...string) *DocumentDataHistorySelect { + ddhq.ctx.Fields = append(ddhq.ctx.Fields, fields...) + sbuild := &DocumentDataHistorySelect{DocumentDataHistoryQuery: ddhq} + sbuild.label = documentdatahistory.Label + sbuild.flds, sbuild.scan = &ddhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a DocumentDataHistorySelect configured with the given aggregations. +func (ddhq *DocumentDataHistoryQuery) Aggregate(fns ...AggregateFunc) *DocumentDataHistorySelect { + return ddhq.Select().Aggregate(fns...) +} + +func (ddhq *DocumentDataHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ddhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ddhq); err != nil { + return err + } + } + } + for _, f := range ddhq.ctx.Fields { + if !documentdatahistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ddhq.path != nil { + prev, err := ddhq.path(ctx) + if err != nil { + return err + } + ddhq.sql = prev + } + if documentdatahistory.Policy == nil { + return errors.New("generated: uninitialized documentdatahistory.Policy (forgotten import generated/runtime?)") + } + if err := documentdatahistory.Policy.EvalQuery(ctx, ddhq); err != nil { + return err + } + return nil +} + +func (ddhq *DocumentDataHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*DocumentDataHistory, error) { + var ( + nodes = []*DocumentDataHistory{} + _spec = ddhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*DocumentDataHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &DocumentDataHistory{config: ddhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ddhq.schemaConfig.DocumentDataHistory + ctx = internal.NewSchemaConfigContext(ctx, ddhq.schemaConfig) + if len(ddhq.modifiers) > 0 { + _spec.Modifiers = ddhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ddhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ddhq.loadTotal { + if err := ddhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ddhq *DocumentDataHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ddhq.querySpec() + _spec.Node.Schema = ddhq.schemaConfig.DocumentDataHistory + ctx = internal.NewSchemaConfigContext(ctx, ddhq.schemaConfig) + if len(ddhq.modifiers) > 0 { + _spec.Modifiers = ddhq.modifiers + } + _spec.Node.Columns = ddhq.ctx.Fields + if len(ddhq.ctx.Fields) > 0 { + _spec.Unique = ddhq.ctx.Unique != nil && *ddhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ddhq.driver, _spec) +} + +func (ddhq *DocumentDataHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(documentdatahistory.Table, documentdatahistory.Columns, sqlgraph.NewFieldSpec(documentdatahistory.FieldID, field.TypeString)) + _spec.From = ddhq.sql + if unique := ddhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ddhq.path != nil { + _spec.Unique = true + } + if fields := ddhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, documentdatahistory.FieldID) + for i := range fields { + if fields[i] != documentdatahistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ddhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ddhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ddhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ddhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ddhq *DocumentDataHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ddhq.driver.Dialect()) + t1 := builder.Table(documentdatahistory.Table) + columns := ddhq.ctx.Fields + if len(columns) == 0 { + columns = documentdatahistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ddhq.sql != nil { + selector = ddhq.sql + selector.Select(selector.Columns(columns...)...) + } + if ddhq.ctx.Unique != nil && *ddhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ddhq.schemaConfig.DocumentDataHistory) + ctx = internal.NewSchemaConfigContext(ctx, ddhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ddhq.predicates { + p(selector) + } + for _, p := range ddhq.order { + p(selector) + } + if offset := ddhq.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 := ddhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// DocumentDataHistoryGroupBy is the group-by builder for DocumentDataHistory entities. +type DocumentDataHistoryGroupBy struct { + selector + build *DocumentDataHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ddhgb *DocumentDataHistoryGroupBy) Aggregate(fns ...AggregateFunc) *DocumentDataHistoryGroupBy { + ddhgb.fns = append(ddhgb.fns, fns...) + return ddhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ddhgb *DocumentDataHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ddhgb.build.ctx, ent.OpQueryGroupBy) + if err := ddhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DocumentDataHistoryQuery, *DocumentDataHistoryGroupBy](ctx, ddhgb.build, ddhgb, ddhgb.build.inters, v) +} + +func (ddhgb *DocumentDataHistoryGroupBy) sqlScan(ctx context.Context, root *DocumentDataHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ddhgb.fns)) + for _, fn := range ddhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ddhgb.flds)+len(ddhgb.fns)) + for _, f := range *ddhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ddhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ddhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// DocumentDataHistorySelect is the builder for selecting fields of DocumentDataHistory entities. +type DocumentDataHistorySelect struct { + *DocumentDataHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ddhs *DocumentDataHistorySelect) Aggregate(fns ...AggregateFunc) *DocumentDataHistorySelect { + ddhs.fns = append(ddhs.fns, fns...) + return ddhs +} + +// Scan applies the selector query and scans the result into the given value. +func (ddhs *DocumentDataHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ddhs.ctx, ent.OpQuerySelect) + if err := ddhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*DocumentDataHistoryQuery, *DocumentDataHistorySelect](ctx, ddhs.DocumentDataHistoryQuery, ddhs, ddhs.inters, v) +} + +func (ddhs *DocumentDataHistorySelect) sqlScan(ctx context.Context, root *DocumentDataHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ddhs.fns)) + for _, fn := range ddhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ddhs.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 := ddhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/documentdatahistory_update.go b/internal/ent/generated/documentdatahistory_update.go new file mode 100644 index 0000000..d4bc603 --- /dev/null +++ b/internal/ent/generated/documentdatahistory_update.go @@ -0,0 +1,586 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// DocumentDataHistoryUpdate is the builder for updating DocumentDataHistory entities. +type DocumentDataHistoryUpdate struct { + config + hooks []Hook + mutation *DocumentDataHistoryMutation +} + +// Where appends a list predicates to the DocumentDataHistoryUpdate builder. +func (ddhu *DocumentDataHistoryUpdate) Where(ps ...predicate.DocumentDataHistory) *DocumentDataHistoryUpdate { + ddhu.mutation.Where(ps...) + return ddhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ddhu *DocumentDataHistoryUpdate) SetUpdatedAt(t time.Time) *DocumentDataHistoryUpdate { + ddhu.mutation.SetUpdatedAt(t) + return ddhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ddhu *DocumentDataHistoryUpdate) ClearUpdatedAt() *DocumentDataHistoryUpdate { + ddhu.mutation.ClearUpdatedAt() + return ddhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ddhu *DocumentDataHistoryUpdate) SetUpdatedBy(s string) *DocumentDataHistoryUpdate { + ddhu.mutation.SetUpdatedBy(s) + return ddhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ddhu *DocumentDataHistoryUpdate) SetNillableUpdatedBy(s *string) *DocumentDataHistoryUpdate { + if s != nil { + ddhu.SetUpdatedBy(*s) + } + return ddhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ddhu *DocumentDataHistoryUpdate) ClearUpdatedBy() *DocumentDataHistoryUpdate { + ddhu.mutation.ClearUpdatedBy() + return ddhu +} + +// SetTags sets the "tags" field. +func (ddhu *DocumentDataHistoryUpdate) SetTags(s []string) *DocumentDataHistoryUpdate { + ddhu.mutation.SetTags(s) + return ddhu +} + +// AppendTags appends s to the "tags" field. +func (ddhu *DocumentDataHistoryUpdate) AppendTags(s []string) *DocumentDataHistoryUpdate { + ddhu.mutation.AppendTags(s) + return ddhu +} + +// ClearTags clears the value of the "tags" field. +func (ddhu *DocumentDataHistoryUpdate) ClearTags() *DocumentDataHistoryUpdate { + ddhu.mutation.ClearTags() + return ddhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ddhu *DocumentDataHistoryUpdate) SetDeletedAt(t time.Time) *DocumentDataHistoryUpdate { + ddhu.mutation.SetDeletedAt(t) + return ddhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ddhu *DocumentDataHistoryUpdate) SetNillableDeletedAt(t *time.Time) *DocumentDataHistoryUpdate { + if t != nil { + ddhu.SetDeletedAt(*t) + } + return ddhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ddhu *DocumentDataHistoryUpdate) ClearDeletedAt() *DocumentDataHistoryUpdate { + ddhu.mutation.ClearDeletedAt() + return ddhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ddhu *DocumentDataHistoryUpdate) SetDeletedBy(s string) *DocumentDataHistoryUpdate { + ddhu.mutation.SetDeletedBy(s) + return ddhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ddhu *DocumentDataHistoryUpdate) SetNillableDeletedBy(s *string) *DocumentDataHistoryUpdate { + if s != nil { + ddhu.SetDeletedBy(*s) + } + return ddhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ddhu *DocumentDataHistoryUpdate) ClearDeletedBy() *DocumentDataHistoryUpdate { + ddhu.mutation.ClearDeletedBy() + return ddhu +} + +// SetOwnerID sets the "owner_id" field. +func (ddhu *DocumentDataHistoryUpdate) SetOwnerID(s string) *DocumentDataHistoryUpdate { + ddhu.mutation.SetOwnerID(s) + return ddhu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ddhu *DocumentDataHistoryUpdate) SetNillableOwnerID(s *string) *DocumentDataHistoryUpdate { + if s != nil { + ddhu.SetOwnerID(*s) + } + return ddhu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ddhu *DocumentDataHistoryUpdate) ClearOwnerID() *DocumentDataHistoryUpdate { + ddhu.mutation.ClearOwnerID() + return ddhu +} + +// SetTemplateID sets the "template_id" field. +func (ddhu *DocumentDataHistoryUpdate) SetTemplateID(s string) *DocumentDataHistoryUpdate { + ddhu.mutation.SetTemplateID(s) + return ddhu +} + +// SetNillableTemplateID sets the "template_id" field if the given value is not nil. +func (ddhu *DocumentDataHistoryUpdate) SetNillableTemplateID(s *string) *DocumentDataHistoryUpdate { + if s != nil { + ddhu.SetTemplateID(*s) + } + return ddhu +} + +// SetData sets the "data" field. +func (ddhu *DocumentDataHistoryUpdate) SetData(co customtypes.JSONObject) *DocumentDataHistoryUpdate { + ddhu.mutation.SetData(co) + return ddhu +} + +// Mutation returns the DocumentDataHistoryMutation object of the builder. +func (ddhu *DocumentDataHistoryUpdate) Mutation() *DocumentDataHistoryMutation { + return ddhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ddhu *DocumentDataHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ddhu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ddhu.sqlSave, ddhu.mutation, ddhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ddhu *DocumentDataHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ddhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ddhu *DocumentDataHistoryUpdate) Exec(ctx context.Context) error { + _, err := ddhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddhu *DocumentDataHistoryUpdate) ExecX(ctx context.Context) { + if err := ddhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ddhu *DocumentDataHistoryUpdate) defaults() error { + if _, ok := ddhu.mutation.UpdatedAt(); !ok && !ddhu.mutation.UpdatedAtCleared() { + if documentdatahistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdatahistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := documentdatahistory.UpdateDefaultUpdatedAt() + ddhu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ddhu *DocumentDataHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(documentdatahistory.Table, documentdatahistory.Columns, sqlgraph.NewFieldSpec(documentdatahistory.FieldID, field.TypeString)) + if ps := ddhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ddhu.mutation.RefCleared() { + _spec.ClearField(documentdatahistory.FieldRef, field.TypeString) + } + if ddhu.mutation.CreatedAtCleared() { + _spec.ClearField(documentdatahistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ddhu.mutation.UpdatedAt(); ok { + _spec.SetField(documentdatahistory.FieldUpdatedAt, field.TypeTime, value) + } + if ddhu.mutation.UpdatedAtCleared() { + _spec.ClearField(documentdatahistory.FieldUpdatedAt, field.TypeTime) + } + if ddhu.mutation.CreatedByCleared() { + _spec.ClearField(documentdatahistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ddhu.mutation.UpdatedBy(); ok { + _spec.SetField(documentdatahistory.FieldUpdatedBy, field.TypeString, value) + } + if ddhu.mutation.UpdatedByCleared() { + _spec.ClearField(documentdatahistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ddhu.mutation.Tags(); ok { + _spec.SetField(documentdatahistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ddhu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, documentdatahistory.FieldTags, value) + }) + } + if ddhu.mutation.TagsCleared() { + _spec.ClearField(documentdatahistory.FieldTags, field.TypeJSON) + } + if value, ok := ddhu.mutation.DeletedAt(); ok { + _spec.SetField(documentdatahistory.FieldDeletedAt, field.TypeTime, value) + } + if ddhu.mutation.DeletedAtCleared() { + _spec.ClearField(documentdatahistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ddhu.mutation.DeletedBy(); ok { + _spec.SetField(documentdatahistory.FieldDeletedBy, field.TypeString, value) + } + if ddhu.mutation.DeletedByCleared() { + _spec.ClearField(documentdatahistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ddhu.mutation.OwnerID(); ok { + _spec.SetField(documentdatahistory.FieldOwnerID, field.TypeString, value) + } + if ddhu.mutation.OwnerIDCleared() { + _spec.ClearField(documentdatahistory.FieldOwnerID, field.TypeString) + } + if value, ok := ddhu.mutation.TemplateID(); ok { + _spec.SetField(documentdatahistory.FieldTemplateID, field.TypeString, value) + } + if value, ok := ddhu.mutation.Data(); ok { + _spec.SetField(documentdatahistory.FieldData, field.TypeJSON, value) + } + _spec.Node.Schema = ddhu.schemaConfig.DocumentDataHistory + ctx = internal.NewSchemaConfigContext(ctx, ddhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ddhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{documentdatahistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ddhu.mutation.done = true + return n, nil +} + +// DocumentDataHistoryUpdateOne is the builder for updating a single DocumentDataHistory entity. +type DocumentDataHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *DocumentDataHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetUpdatedAt(t time.Time) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetUpdatedAt(t) + return ddhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ddhuo *DocumentDataHistoryUpdateOne) ClearUpdatedAt() *DocumentDataHistoryUpdateOne { + ddhuo.mutation.ClearUpdatedAt() + return ddhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetUpdatedBy(s string) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetUpdatedBy(s) + return ddhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ddhuo *DocumentDataHistoryUpdateOne) SetNillableUpdatedBy(s *string) *DocumentDataHistoryUpdateOne { + if s != nil { + ddhuo.SetUpdatedBy(*s) + } + return ddhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ddhuo *DocumentDataHistoryUpdateOne) ClearUpdatedBy() *DocumentDataHistoryUpdateOne { + ddhuo.mutation.ClearUpdatedBy() + return ddhuo +} + +// SetTags sets the "tags" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetTags(s []string) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetTags(s) + return ddhuo +} + +// AppendTags appends s to the "tags" field. +func (ddhuo *DocumentDataHistoryUpdateOne) AppendTags(s []string) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.AppendTags(s) + return ddhuo +} + +// ClearTags clears the value of the "tags" field. +func (ddhuo *DocumentDataHistoryUpdateOne) ClearTags() *DocumentDataHistoryUpdateOne { + ddhuo.mutation.ClearTags() + return ddhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetDeletedAt(t time.Time) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetDeletedAt(t) + return ddhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ddhuo *DocumentDataHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *DocumentDataHistoryUpdateOne { + if t != nil { + ddhuo.SetDeletedAt(*t) + } + return ddhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ddhuo *DocumentDataHistoryUpdateOne) ClearDeletedAt() *DocumentDataHistoryUpdateOne { + ddhuo.mutation.ClearDeletedAt() + return ddhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetDeletedBy(s string) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetDeletedBy(s) + return ddhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ddhuo *DocumentDataHistoryUpdateOne) SetNillableDeletedBy(s *string) *DocumentDataHistoryUpdateOne { + if s != nil { + ddhuo.SetDeletedBy(*s) + } + return ddhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ddhuo *DocumentDataHistoryUpdateOne) ClearDeletedBy() *DocumentDataHistoryUpdateOne { + ddhuo.mutation.ClearDeletedBy() + return ddhuo +} + +// SetOwnerID sets the "owner_id" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetOwnerID(s string) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetOwnerID(s) + return ddhuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ddhuo *DocumentDataHistoryUpdateOne) SetNillableOwnerID(s *string) *DocumentDataHistoryUpdateOne { + if s != nil { + ddhuo.SetOwnerID(*s) + } + return ddhuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ddhuo *DocumentDataHistoryUpdateOne) ClearOwnerID() *DocumentDataHistoryUpdateOne { + ddhuo.mutation.ClearOwnerID() + return ddhuo +} + +// SetTemplateID sets the "template_id" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetTemplateID(s string) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetTemplateID(s) + return ddhuo +} + +// SetNillableTemplateID sets the "template_id" field if the given value is not nil. +func (ddhuo *DocumentDataHistoryUpdateOne) SetNillableTemplateID(s *string) *DocumentDataHistoryUpdateOne { + if s != nil { + ddhuo.SetTemplateID(*s) + } + return ddhuo +} + +// SetData sets the "data" field. +func (ddhuo *DocumentDataHistoryUpdateOne) SetData(co customtypes.JSONObject) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.SetData(co) + return ddhuo +} + +// Mutation returns the DocumentDataHistoryMutation object of the builder. +func (ddhuo *DocumentDataHistoryUpdateOne) Mutation() *DocumentDataHistoryMutation { + return ddhuo.mutation +} + +// Where appends a list predicates to the DocumentDataHistoryUpdate builder. +func (ddhuo *DocumentDataHistoryUpdateOne) Where(ps ...predicate.DocumentDataHistory) *DocumentDataHistoryUpdateOne { + ddhuo.mutation.Where(ps...) + return ddhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ddhuo *DocumentDataHistoryUpdateOne) Select(field string, fields ...string) *DocumentDataHistoryUpdateOne { + ddhuo.fields = append([]string{field}, fields...) + return ddhuo +} + +// Save executes the query and returns the updated DocumentDataHistory entity. +func (ddhuo *DocumentDataHistoryUpdateOne) Save(ctx context.Context) (*DocumentDataHistory, error) { + if err := ddhuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ddhuo.sqlSave, ddhuo.mutation, ddhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ddhuo *DocumentDataHistoryUpdateOne) SaveX(ctx context.Context) *DocumentDataHistory { + node, err := ddhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ddhuo *DocumentDataHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ddhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ddhuo *DocumentDataHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ddhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ddhuo *DocumentDataHistoryUpdateOne) defaults() error { + if _, ok := ddhuo.mutation.UpdatedAt(); !ok && !ddhuo.mutation.UpdatedAtCleared() { + if documentdatahistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized documentdatahistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := documentdatahistory.UpdateDefaultUpdatedAt() + ddhuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ddhuo *DocumentDataHistoryUpdateOne) sqlSave(ctx context.Context) (_node *DocumentDataHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(documentdatahistory.Table, documentdatahistory.Columns, sqlgraph.NewFieldSpec(documentdatahistory.FieldID, field.TypeString)) + id, ok := ddhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "DocumentDataHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ddhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, documentdatahistory.FieldID) + for _, f := range fields { + if !documentdatahistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != documentdatahistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ddhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ddhuo.mutation.RefCleared() { + _spec.ClearField(documentdatahistory.FieldRef, field.TypeString) + } + if ddhuo.mutation.CreatedAtCleared() { + _spec.ClearField(documentdatahistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ddhuo.mutation.UpdatedAt(); ok { + _spec.SetField(documentdatahistory.FieldUpdatedAt, field.TypeTime, value) + } + if ddhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(documentdatahistory.FieldUpdatedAt, field.TypeTime) + } + if ddhuo.mutation.CreatedByCleared() { + _spec.ClearField(documentdatahistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ddhuo.mutation.UpdatedBy(); ok { + _spec.SetField(documentdatahistory.FieldUpdatedBy, field.TypeString, value) + } + if ddhuo.mutation.UpdatedByCleared() { + _spec.ClearField(documentdatahistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ddhuo.mutation.Tags(); ok { + _spec.SetField(documentdatahistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ddhuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, documentdatahistory.FieldTags, value) + }) + } + if ddhuo.mutation.TagsCleared() { + _spec.ClearField(documentdatahistory.FieldTags, field.TypeJSON) + } + if value, ok := ddhuo.mutation.DeletedAt(); ok { + _spec.SetField(documentdatahistory.FieldDeletedAt, field.TypeTime, value) + } + if ddhuo.mutation.DeletedAtCleared() { + _spec.ClearField(documentdatahistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ddhuo.mutation.DeletedBy(); ok { + _spec.SetField(documentdatahistory.FieldDeletedBy, field.TypeString, value) + } + if ddhuo.mutation.DeletedByCleared() { + _spec.ClearField(documentdatahistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ddhuo.mutation.OwnerID(); ok { + _spec.SetField(documentdatahistory.FieldOwnerID, field.TypeString, value) + } + if ddhuo.mutation.OwnerIDCleared() { + _spec.ClearField(documentdatahistory.FieldOwnerID, field.TypeString) + } + if value, ok := ddhuo.mutation.TemplateID(); ok { + _spec.SetField(documentdatahistory.FieldTemplateID, field.TypeString, value) + } + if value, ok := ddhuo.mutation.Data(); ok { + _spec.SetField(documentdatahistory.FieldData, field.TypeJSON, value) + } + _spec.Node.Schema = ddhuo.schemaConfig.DocumentDataHistory + ctx = internal.NewSchemaConfigContext(ctx, ddhuo.schemaConfig) + _node = &DocumentDataHistory{config: ddhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ddhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{documentdatahistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ddhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/edge_cleanup.go b/internal/ent/generated/edge_cleanup.go new file mode 100644 index 0000000..0b835a2 --- /dev/null +++ b/internal/ent/generated/edge_cleanup.go @@ -0,0 +1,408 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/privacy" +) + +func APITokenEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup apitoken edge")) + + return nil +} + +func ContactEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup contact edge")) + + return nil +} + +func ContactHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup contacthistory edge")) + + return nil +} + +func DocumentDataEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup documentdata edge")) + + return nil +} + +func DocumentDataHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup documentdatahistory edge")) + + return nil +} + +func EmailVerificationTokenEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup emailverificationtoken edge")) + + return nil +} + +func EntitlementEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitlement edge")) + + return nil +} + +func EntitlementHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitlementhistory edge")) + + return nil +} + +func EntitlementPlanEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitlementplan edge")) + + return nil +} + +func EntitlementPlanFeatureEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitlementplanfeature edge")) + + return nil +} + +func EntitlementPlanFeatureHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitlementplanfeaturehistory edge")) + + return nil +} + +func EntitlementPlanHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitlementplanhistory edge")) + + return nil +} + +func EntityEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entity edge")) + + return nil +} + +func EntityHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entityhistory edge")) + + return nil +} + +func EntityTypeEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitytype edge")) + + return nil +} + +func EntityTypeHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup entitytypehistory edge")) + + return nil +} + +func EventEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup event edge")) + + return nil +} + +func EventHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup eventhistory edge")) + + return nil +} + +func FeatureEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup feature edge")) + + return nil +} + +func FeatureHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup featurehistory edge")) + + return nil +} + +func FileEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup file edge")) + + return nil +} + +func FileHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup filehistory edge")) + + return nil +} + +func GroupEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup group edge")) + + return nil +} + +func GroupHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup grouphistory edge")) + + return nil +} + +func GroupMembershipEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup groupmembership edge")) + + return nil +} + +func GroupMembershipHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup groupmembershiphistory edge")) + + return nil +} + +func GroupSettingEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup groupsetting edge")) + + return nil +} + +func GroupSettingHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup groupsettinghistory edge")) + + return nil +} + +func HushEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup hush edge")) + + return nil +} + +func HushHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup hushhistory edge")) + + return nil +} + +func IntegrationEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup integration edge")) + + return nil +} + +func IntegrationHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup integrationhistory edge")) + + return nil +} + +func InviteEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup invite edge")) + + return nil +} + +func NoteEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup note edge")) + + return nil +} + +func NoteHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup notehistory edge")) + + return nil +} + +func OauthProviderEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup oauthprovider edge")) + + return nil +} + +func OauthProviderHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup oauthproviderhistory edge")) + + return nil +} + +func OhAuthTooTokenEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup ohauthtootoken edge")) + + return nil +} + +func OrgMembershipEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup orgmembership edge")) + + return nil +} + +func OrgMembershipHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup orgmembershiphistory edge")) + + return nil +} + +func OrganizationEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup organization edge")) + + return nil +} + +func OrganizationHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup organizationhistory edge")) + + return nil +} + +func OrganizationSettingEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup organizationsetting edge")) + + return nil +} + +func OrganizationSettingHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup organizationsettinghistory edge")) + + return nil +} + +func PasswordResetTokenEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup passwordresettoken edge")) + + return nil +} + +func PersonalAccessTokenEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup personalaccesstoken edge")) + + return nil +} + +func SubscriberEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup subscriber edge")) + + return nil +} + +func TFASettingEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup tfasetting edge")) + + return nil +} + +func TemplateEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup template edge")) + + return nil +} + +func TemplateHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup templatehistory edge")) + + return nil +} + +func UserEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup user edge")) + + return nil +} + +func UserHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup userhistory edge")) + + return nil +} + +func UserSettingEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup usersetting edge")) + + return nil +} + +func UserSettingHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup usersettinghistory edge")) + + return nil +} + +func WebauthnEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup webauthn edge")) + + return nil +} + +func WebhookEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup webhook edge")) + + return nil +} + +func WebhookHistoryEdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup webhookhistory edge")) + + return nil +} diff --git a/internal/ent/generated/emailverificationtoken.go b/internal/ent/generated/emailverificationtoken.go new file mode 100644 index 0000000..1d87aad --- /dev/null +++ b/internal/ent/generated/emailverificationtoken.go @@ -0,0 +1,263 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// EmailVerificationToken is the model entity for the EmailVerificationToken schema. +type EmailVerificationToken struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The user id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the verification token sent to the user via email which should only be provided to the /verify endpoint + handler + Token string `json:"token,omitempty"` + // the ttl of the verification token which defaults to 7 days + TTL *time.Time `json:"ttl,omitempty"` + // the email used as input to generate the verification token; this is used to verify that the token when regenerated within the server matches the token emailed + Email string `json:"email,omitempty"` + // the comparison secret to verify the token's signature + Secret *[]byte `json:"secret,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the EmailVerificationTokenQuery when eager-loading is set. + Edges EmailVerificationTokenEdges `json:"edges"` + selectValues sql.SelectValues +} + +// EmailVerificationTokenEdges holds the relations/edges for other nodes in the graph. +type EmailVerificationTokenEdges struct { + // Owner holds the value of the owner edge. + Owner *User `json:"owner,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 +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EmailVerificationTokenEdges) OwnerOrErr() (*User, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EmailVerificationToken) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case emailverificationtoken.FieldSecret: + values[i] = new([]byte) + case emailverificationtoken.FieldID, emailverificationtoken.FieldCreatedBy, emailverificationtoken.FieldUpdatedBy, emailverificationtoken.FieldMappingID, emailverificationtoken.FieldDeletedBy, emailverificationtoken.FieldOwnerID, emailverificationtoken.FieldToken, emailverificationtoken.FieldEmail: + values[i] = new(sql.NullString) + case emailverificationtoken.FieldCreatedAt, emailverificationtoken.FieldUpdatedAt, emailverificationtoken.FieldDeletedAt, emailverificationtoken.FieldTTL: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EmailVerificationToken fields. +func (evt *EmailVerificationToken) 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 emailverificationtoken.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + evt.ID = value.String + } + case emailverificationtoken.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + evt.CreatedAt = value.Time + } + case emailverificationtoken.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + evt.UpdatedAt = value.Time + } + case emailverificationtoken.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + evt.CreatedBy = value.String + } + case emailverificationtoken.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + evt.UpdatedBy = value.String + } + case emailverificationtoken.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + evt.MappingID = value.String + } + case emailverificationtoken.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + evt.DeletedAt = value.Time + } + case emailverificationtoken.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + evt.DeletedBy = value.String + } + case emailverificationtoken.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + evt.OwnerID = value.String + } + case emailverificationtoken.FieldToken: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token", values[i]) + } else if value.Valid { + evt.Token = value.String + } + case emailverificationtoken.FieldTTL: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field ttl", values[i]) + } else if value.Valid { + evt.TTL = new(time.Time) + *evt.TTL = value.Time + } + case emailverificationtoken.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + evt.Email = value.String + } + case emailverificationtoken.FieldSecret: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field secret", values[i]) + } else if value != nil { + evt.Secret = value + } + default: + evt.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EmailVerificationToken. +// This includes values selected through modifiers, order, etc. +func (evt *EmailVerificationToken) Value(name string) (ent.Value, error) { + return evt.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the EmailVerificationToken entity. +func (evt *EmailVerificationToken) QueryOwner() *UserQuery { + return NewEmailVerificationTokenClient(evt.config).QueryOwner(evt) +} + +// Update returns a builder for updating this EmailVerificationToken. +// Note that you need to call EmailVerificationToken.Unwrap() before calling this method if this EmailVerificationToken +// was returned from a transaction, and the transaction was committed or rolled back. +func (evt *EmailVerificationToken) Update() *EmailVerificationTokenUpdateOne { + return NewEmailVerificationTokenClient(evt.config).UpdateOne(evt) +} + +// Unwrap unwraps the EmailVerificationToken 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 (evt *EmailVerificationToken) Unwrap() *EmailVerificationToken { + _tx, ok := evt.config.driver.(*txDriver) + if !ok { + panic("generated: EmailVerificationToken is not a transactional entity") + } + evt.config.driver = _tx.drv + return evt +} + +// String implements the fmt.Stringer. +func (evt *EmailVerificationToken) String() string { + var builder strings.Builder + builder.WriteString("EmailVerificationToken(") + builder.WriteString(fmt.Sprintf("id=%v, ", evt.ID)) + builder.WriteString("created_at=") + builder.WriteString(evt.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(evt.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(evt.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(evt.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(evt.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(evt.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(evt.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(evt.OwnerID) + builder.WriteString(", ") + builder.WriteString("token=") + builder.WriteString(evt.Token) + builder.WriteString(", ") + if v := evt.TTL; v != nil { + builder.WriteString("ttl=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("email=") + builder.WriteString(evt.Email) + builder.WriteString(", ") + if v := evt.Secret; v != nil { + builder.WriteString("secret=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteByte(')') + return builder.String() +} + +// EmailVerificationTokens is a parsable slice of EmailVerificationToken. +type EmailVerificationTokens []*EmailVerificationToken diff --git a/internal/ent/generated/emailverificationtoken/emailverificationtoken.go b/internal/ent/generated/emailverificationtoken/emailverificationtoken.go new file mode 100644 index 0000000..a0b0e96 --- /dev/null +++ b/internal/ent/generated/emailverificationtoken/emailverificationtoken.go @@ -0,0 +1,184 @@ +// Code generated by ent, DO NOT EDIT. + +package emailverificationtoken + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the emailverificationtoken type in the database. + Label = "email_verification_token" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldToken holds the string denoting the token field in the database. + FieldToken = "token" + // FieldTTL holds the string denoting the ttl field in the database. + FieldTTL = "ttl" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldSecret holds the string denoting the secret field in the database. + FieldSecret = "secret" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // Table holds the table name of the emailverificationtoken in the database. + Table = "email_verification_tokens" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "email_verification_tokens" + // OwnerInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + OwnerInverseTable = "users" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" +) + +// Columns holds all SQL columns for emailverificationtoken fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldToken, + FieldTTL, + FieldEmail, + FieldSecret, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // TokenValidator is a validator for the "token" field. It is called by the builders before save. + TokenValidator func(string) error + // EmailValidator is a validator for the "email" field. It is called by the builders before save. + EmailValidator func(string) error + // SecretValidator is a validator for the "secret" field. It is called by the builders before save. + SecretValidator func([]byte) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the EmailVerificationToken queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByToken orders the results by the token field. +func ByToken(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldToken, opts...).ToFunc() +} + +// ByTTL orders the results by the ttl field. +func ByTTL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTTL, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} diff --git a/internal/ent/generated/emailverificationtoken/where.go b/internal/ent/generated/emailverificationtoken/where.go new file mode 100644 index 0000000..e2c24a4 --- /dev/null +++ b/internal/ent/generated/emailverificationtoken/where.go @@ -0,0 +1,887 @@ +// Code generated by ent, DO NOT EDIT. + +package emailverificationtoken + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// Token applies equality check predicate on the "token" field. It's identical to TokenEQ. +func Token(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldToken, v)) +} + +// TTL applies equality check predicate on the "ttl" field. It's identical to TTLEQ. +func TTL(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldTTL, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldEmail, v)) +} + +// Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ. +func Secret(v []byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldSecret, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TokenEQ applies the EQ predicate on the "token" field. +func TokenEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldToken, v)) +} + +// TokenNEQ applies the NEQ predicate on the "token" field. +func TokenNEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldToken, v)) +} + +// TokenIn applies the In predicate on the "token" field. +func TokenIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldToken, vs...)) +} + +// TokenNotIn applies the NotIn predicate on the "token" field. +func TokenNotIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldToken, vs...)) +} + +// TokenGT applies the GT predicate on the "token" field. +func TokenGT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldToken, v)) +} + +// TokenGTE applies the GTE predicate on the "token" field. +func TokenGTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldToken, v)) +} + +// TokenLT applies the LT predicate on the "token" field. +func TokenLT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldToken, v)) +} + +// TokenLTE applies the LTE predicate on the "token" field. +func TokenLTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldToken, v)) +} + +// TokenContains applies the Contains predicate on the "token" field. +func TokenContains(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContains(FieldToken, v)) +} + +// TokenHasPrefix applies the HasPrefix predicate on the "token" field. +func TokenHasPrefix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasPrefix(FieldToken, v)) +} + +// TokenHasSuffix applies the HasSuffix predicate on the "token" field. +func TokenHasSuffix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasSuffix(FieldToken, v)) +} + +// TokenEqualFold applies the EqualFold predicate on the "token" field. +func TokenEqualFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldToken, v)) +} + +// TokenContainsFold applies the ContainsFold predicate on the "token" field. +func TokenContainsFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldToken, v)) +} + +// TTLEQ applies the EQ predicate on the "ttl" field. +func TTLEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldTTL, v)) +} + +// TTLNEQ applies the NEQ predicate on the "ttl" field. +func TTLNEQ(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldTTL, v)) +} + +// TTLIn applies the In predicate on the "ttl" field. +func TTLIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldTTL, vs...)) +} + +// TTLNotIn applies the NotIn predicate on the "ttl" field. +func TTLNotIn(vs ...time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldTTL, vs...)) +} + +// TTLGT applies the GT predicate on the "ttl" field. +func TTLGT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldTTL, v)) +} + +// TTLGTE applies the GTE predicate on the "ttl" field. +func TTLGTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldTTL, v)) +} + +// TTLLT applies the LT predicate on the "ttl" field. +func TTLLT(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldTTL, v)) +} + +// TTLLTE applies the LTE predicate on the "ttl" field. +func TTLLTE(v time.Time) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldTTL, v)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldContainsFold(FieldEmail, v)) +} + +// SecretEQ applies the EQ predicate on the "secret" field. +func SecretEQ(v []byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldEQ(FieldSecret, v)) +} + +// SecretNEQ applies the NEQ predicate on the "secret" field. +func SecretNEQ(v []byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNEQ(FieldSecret, v)) +} + +// SecretIn applies the In predicate on the "secret" field. +func SecretIn(vs ...[]byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldIn(FieldSecret, vs...)) +} + +// SecretNotIn applies the NotIn predicate on the "secret" field. +func SecretNotIn(vs ...[]byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldNotIn(FieldSecret, vs...)) +} + +// SecretGT applies the GT predicate on the "secret" field. +func SecretGT(v []byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGT(FieldSecret, v)) +} + +// SecretGTE applies the GTE predicate on the "secret" field. +func SecretGTE(v []byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldGTE(FieldSecret, v)) +} + +// SecretLT applies the LT predicate on the "secret" field. +func SecretLT(v []byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLT(FieldSecret, v)) +} + +// SecretLTE applies the LTE predicate on the "secret" field. +func SecretLTE(v []byte) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.FieldLTE(FieldSecret, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.EmailVerificationToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.User) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.EmailVerificationToken + 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.EmailVerificationToken) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EmailVerificationToken) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EmailVerificationToken) predicate.EmailVerificationToken { + return predicate.EmailVerificationToken(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/emailverificationtoken_create.go b/internal/ent/generated/emailverificationtoken_create.go new file mode 100644 index 0000000..c77cd78 --- /dev/null +++ b/internal/ent/generated/emailverificationtoken_create.go @@ -0,0 +1,460 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// EmailVerificationTokenCreate is the builder for creating a EmailVerificationToken entity. +type EmailVerificationTokenCreate struct { + config + mutation *EmailVerificationTokenMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (evtc *EmailVerificationTokenCreate) SetCreatedAt(t time.Time) *EmailVerificationTokenCreate { + evtc.mutation.SetCreatedAt(t) + return evtc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableCreatedAt(t *time.Time) *EmailVerificationTokenCreate { + if t != nil { + evtc.SetCreatedAt(*t) + } + return evtc +} + +// SetUpdatedAt sets the "updated_at" field. +func (evtc *EmailVerificationTokenCreate) SetUpdatedAt(t time.Time) *EmailVerificationTokenCreate { + evtc.mutation.SetUpdatedAt(t) + return evtc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableUpdatedAt(t *time.Time) *EmailVerificationTokenCreate { + if t != nil { + evtc.SetUpdatedAt(*t) + } + return evtc +} + +// SetCreatedBy sets the "created_by" field. +func (evtc *EmailVerificationTokenCreate) SetCreatedBy(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetCreatedBy(s) + return evtc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableCreatedBy(s *string) *EmailVerificationTokenCreate { + if s != nil { + evtc.SetCreatedBy(*s) + } + return evtc +} + +// SetUpdatedBy sets the "updated_by" field. +func (evtc *EmailVerificationTokenCreate) SetUpdatedBy(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetUpdatedBy(s) + return evtc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableUpdatedBy(s *string) *EmailVerificationTokenCreate { + if s != nil { + evtc.SetUpdatedBy(*s) + } + return evtc +} + +// SetMappingID sets the "mapping_id" field. +func (evtc *EmailVerificationTokenCreate) SetMappingID(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetMappingID(s) + return evtc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableMappingID(s *string) *EmailVerificationTokenCreate { + if s != nil { + evtc.SetMappingID(*s) + } + return evtc +} + +// SetDeletedAt sets the "deleted_at" field. +func (evtc *EmailVerificationTokenCreate) SetDeletedAt(t time.Time) *EmailVerificationTokenCreate { + evtc.mutation.SetDeletedAt(t) + return evtc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableDeletedAt(t *time.Time) *EmailVerificationTokenCreate { + if t != nil { + evtc.SetDeletedAt(*t) + } + return evtc +} + +// SetDeletedBy sets the "deleted_by" field. +func (evtc *EmailVerificationTokenCreate) SetDeletedBy(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetDeletedBy(s) + return evtc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableDeletedBy(s *string) *EmailVerificationTokenCreate { + if s != nil { + evtc.SetDeletedBy(*s) + } + return evtc +} + +// SetOwnerID sets the "owner_id" field. +func (evtc *EmailVerificationTokenCreate) SetOwnerID(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetOwnerID(s) + return evtc +} + +// SetToken sets the "token" field. +func (evtc *EmailVerificationTokenCreate) SetToken(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetToken(s) + return evtc +} + +// SetTTL sets the "ttl" field. +func (evtc *EmailVerificationTokenCreate) SetTTL(t time.Time) *EmailVerificationTokenCreate { + evtc.mutation.SetTTL(t) + return evtc +} + +// SetEmail sets the "email" field. +func (evtc *EmailVerificationTokenCreate) SetEmail(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetEmail(s) + return evtc +} + +// SetSecret sets the "secret" field. +func (evtc *EmailVerificationTokenCreate) SetSecret(b []byte) *EmailVerificationTokenCreate { + evtc.mutation.SetSecret(b) + return evtc +} + +// SetID sets the "id" field. +func (evtc *EmailVerificationTokenCreate) SetID(s string) *EmailVerificationTokenCreate { + evtc.mutation.SetID(s) + return evtc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (evtc *EmailVerificationTokenCreate) SetNillableID(s *string) *EmailVerificationTokenCreate { + if s != nil { + evtc.SetID(*s) + } + return evtc +} + +// SetOwner sets the "owner" edge to the User entity. +func (evtc *EmailVerificationTokenCreate) SetOwner(u *User) *EmailVerificationTokenCreate { + return evtc.SetOwnerID(u.ID) +} + +// Mutation returns the EmailVerificationTokenMutation object of the builder. +func (evtc *EmailVerificationTokenCreate) Mutation() *EmailVerificationTokenMutation { + return evtc.mutation +} + +// Save creates the EmailVerificationToken in the database. +func (evtc *EmailVerificationTokenCreate) Save(ctx context.Context) (*EmailVerificationToken, error) { + if err := evtc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, evtc.sqlSave, evtc.mutation, evtc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (evtc *EmailVerificationTokenCreate) SaveX(ctx context.Context) *EmailVerificationToken { + v, err := evtc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (evtc *EmailVerificationTokenCreate) Exec(ctx context.Context) error { + _, err := evtc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (evtc *EmailVerificationTokenCreate) ExecX(ctx context.Context) { + if err := evtc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (evtc *EmailVerificationTokenCreate) defaults() error { + if _, ok := evtc.mutation.CreatedAt(); !ok { + if emailverificationtoken.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized emailverificationtoken.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := emailverificationtoken.DefaultCreatedAt() + evtc.mutation.SetCreatedAt(v) + } + if _, ok := evtc.mutation.UpdatedAt(); !ok { + if emailverificationtoken.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized emailverificationtoken.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := emailverificationtoken.DefaultUpdatedAt() + evtc.mutation.SetUpdatedAt(v) + } + if _, ok := evtc.mutation.MappingID(); !ok { + if emailverificationtoken.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized emailverificationtoken.DefaultMappingID (forgotten import generated/runtime?)") + } + v := emailverificationtoken.DefaultMappingID() + evtc.mutation.SetMappingID(v) + } + if _, ok := evtc.mutation.ID(); !ok { + if emailverificationtoken.DefaultID == nil { + return fmt.Errorf("generated: uninitialized emailverificationtoken.DefaultID (forgotten import generated/runtime?)") + } + v := emailverificationtoken.DefaultID() + evtc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (evtc *EmailVerificationTokenCreate) check() error { + if _, ok := evtc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EmailVerificationToken.mapping_id"`)} + } + if _, ok := evtc.mutation.OwnerID(); !ok { + return &ValidationError{Name: "owner_id", err: errors.New(`generated: missing required field "EmailVerificationToken.owner_id"`)} + } + if _, ok := evtc.mutation.Token(); !ok { + return &ValidationError{Name: "token", err: errors.New(`generated: missing required field "EmailVerificationToken.token"`)} + } + if v, ok := evtc.mutation.Token(); ok { + if err := emailverificationtoken.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.token": %w`, err)} + } + } + if _, ok := evtc.mutation.TTL(); !ok { + return &ValidationError{Name: "ttl", err: errors.New(`generated: missing required field "EmailVerificationToken.ttl"`)} + } + if _, ok := evtc.mutation.Email(); !ok { + return &ValidationError{Name: "email", err: errors.New(`generated: missing required field "EmailVerificationToken.email"`)} + } + if v, ok := evtc.mutation.Email(); ok { + if err := emailverificationtoken.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.email": %w`, err)} + } + } + if _, ok := evtc.mutation.Secret(); !ok { + return &ValidationError{Name: "secret", err: errors.New(`generated: missing required field "EmailVerificationToken.secret"`)} + } + if v, ok := evtc.mutation.Secret(); ok { + if err := emailverificationtoken.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.secret": %w`, err)} + } + } + if len(evtc.mutation.OwnerIDs()) == 0 { + return &ValidationError{Name: "owner", err: errors.New(`generated: missing required edge "EmailVerificationToken.owner"`)} + } + return nil +} + +func (evtc *EmailVerificationTokenCreate) sqlSave(ctx context.Context) (*EmailVerificationToken, error) { + if err := evtc.check(); err != nil { + return nil, err + } + _node, _spec := evtc.createSpec() + if err := sqlgraph.CreateNode(ctx, evtc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EmailVerificationToken.ID type: %T", _spec.ID.Value) + } + } + evtc.mutation.id = &_node.ID + evtc.mutation.done = true + return _node, nil +} + +func (evtc *EmailVerificationTokenCreate) createSpec() (*EmailVerificationToken, *sqlgraph.CreateSpec) { + var ( + _node = &EmailVerificationToken{config: evtc.config} + _spec = sqlgraph.NewCreateSpec(emailverificationtoken.Table, sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString)) + ) + _spec.Schema = evtc.schemaConfig.EmailVerificationToken + if id, ok := evtc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := evtc.mutation.CreatedAt(); ok { + _spec.SetField(emailverificationtoken.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := evtc.mutation.UpdatedAt(); ok { + _spec.SetField(emailverificationtoken.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := evtc.mutation.CreatedBy(); ok { + _spec.SetField(emailverificationtoken.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := evtc.mutation.UpdatedBy(); ok { + _spec.SetField(emailverificationtoken.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := evtc.mutation.MappingID(); ok { + _spec.SetField(emailverificationtoken.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := evtc.mutation.DeletedAt(); ok { + _spec.SetField(emailverificationtoken.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := evtc.mutation.DeletedBy(); ok { + _spec.SetField(emailverificationtoken.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := evtc.mutation.Token(); ok { + _spec.SetField(emailverificationtoken.FieldToken, field.TypeString, value) + _node.Token = value + } + if value, ok := evtc.mutation.TTL(); ok { + _spec.SetField(emailverificationtoken.FieldTTL, field.TypeTime, value) + _node.TTL = &value + } + if value, ok := evtc.mutation.Email(); ok { + _spec.SetField(emailverificationtoken.FieldEmail, field.TypeString, value) + _node.Email = value + } + if value, ok := evtc.mutation.Secret(); ok { + _spec.SetField(emailverificationtoken.FieldSecret, field.TypeBytes, value) + _node.Secret = &value + } + if nodes := evtc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: emailverificationtoken.OwnerTable, + Columns: []string{emailverificationtoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = evtc.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// EmailVerificationTokenCreateBulk is the builder for creating many EmailVerificationToken entities in bulk. +type EmailVerificationTokenCreateBulk struct { + config + err error + builders []*EmailVerificationTokenCreate +} + +// Save creates the EmailVerificationToken entities in the database. +func (evtcb *EmailVerificationTokenCreateBulk) Save(ctx context.Context) ([]*EmailVerificationToken, error) { + if evtcb.err != nil { + return nil, evtcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(evtcb.builders)) + nodes := make([]*EmailVerificationToken, len(evtcb.builders)) + mutators := make([]Mutator, len(evtcb.builders)) + for i := range evtcb.builders { + func(i int, root context.Context) { + builder := evtcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EmailVerificationTokenMutation) + 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, evtcb.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, evtcb.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, evtcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (evtcb *EmailVerificationTokenCreateBulk) SaveX(ctx context.Context) []*EmailVerificationToken { + v, err := evtcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (evtcb *EmailVerificationTokenCreateBulk) Exec(ctx context.Context) error { + _, err := evtcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (evtcb *EmailVerificationTokenCreateBulk) ExecX(ctx context.Context) { + if err := evtcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/emailverificationtoken_delete.go b/internal/ent/generated/emailverificationtoken_delete.go new file mode 100644 index 0000000..b3ff763 --- /dev/null +++ b/internal/ent/generated/emailverificationtoken_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EmailVerificationTokenDelete is the builder for deleting a EmailVerificationToken entity. +type EmailVerificationTokenDelete struct { + config + hooks []Hook + mutation *EmailVerificationTokenMutation +} + +// Where appends a list predicates to the EmailVerificationTokenDelete builder. +func (evtd *EmailVerificationTokenDelete) Where(ps ...predicate.EmailVerificationToken) *EmailVerificationTokenDelete { + evtd.mutation.Where(ps...) + return evtd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (evtd *EmailVerificationTokenDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, evtd.sqlExec, evtd.mutation, evtd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (evtd *EmailVerificationTokenDelete) ExecX(ctx context.Context) int { + n, err := evtd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (evtd *EmailVerificationTokenDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(emailverificationtoken.Table, sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString)) + _spec.Node.Schema = evtd.schemaConfig.EmailVerificationToken + ctx = internal.NewSchemaConfigContext(ctx, evtd.schemaConfig) + if ps := evtd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, evtd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + evtd.mutation.done = true + return affected, err +} + +// EmailVerificationTokenDeleteOne is the builder for deleting a single EmailVerificationToken entity. +type EmailVerificationTokenDeleteOne struct { + evtd *EmailVerificationTokenDelete +} + +// Where appends a list predicates to the EmailVerificationTokenDelete builder. +func (evtdo *EmailVerificationTokenDeleteOne) Where(ps ...predicate.EmailVerificationToken) *EmailVerificationTokenDeleteOne { + evtdo.evtd.mutation.Where(ps...) + return evtdo +} + +// Exec executes the deletion query. +func (evtdo *EmailVerificationTokenDeleteOne) Exec(ctx context.Context) error { + n, err := evtdo.evtd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{emailverificationtoken.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (evtdo *EmailVerificationTokenDeleteOne) ExecX(ctx context.Context) { + if err := evtdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/emailverificationtoken_query.go b/internal/ent/generated/emailverificationtoken_query.go new file mode 100644 index 0000000..2838dd8 --- /dev/null +++ b/internal/ent/generated/emailverificationtoken_query.go @@ -0,0 +1,638 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EmailVerificationTokenQuery is the builder for querying EmailVerificationToken entities. +type EmailVerificationTokenQuery struct { + config + ctx *QueryContext + order []emailverificationtoken.OrderOption + inters []Interceptor + predicates []predicate.EmailVerificationToken + withOwner *UserQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EmailVerificationToken) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EmailVerificationTokenQuery builder. +func (evtq *EmailVerificationTokenQuery) Where(ps ...predicate.EmailVerificationToken) *EmailVerificationTokenQuery { + evtq.predicates = append(evtq.predicates, ps...) + return evtq +} + +// Limit the number of records to be returned by this query. +func (evtq *EmailVerificationTokenQuery) Limit(limit int) *EmailVerificationTokenQuery { + evtq.ctx.Limit = &limit + return evtq +} + +// Offset to start from. +func (evtq *EmailVerificationTokenQuery) Offset(offset int) *EmailVerificationTokenQuery { + evtq.ctx.Offset = &offset + return evtq +} + +// 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 (evtq *EmailVerificationTokenQuery) Unique(unique bool) *EmailVerificationTokenQuery { + evtq.ctx.Unique = &unique + return evtq +} + +// Order specifies how the records should be ordered. +func (evtq *EmailVerificationTokenQuery) Order(o ...emailverificationtoken.OrderOption) *EmailVerificationTokenQuery { + evtq.order = append(evtq.order, o...) + return evtq +} + +// QueryOwner chains the current query on the "owner" edge. +func (evtq *EmailVerificationTokenQuery) QueryOwner() *UserQuery { + query := (&UserClient{config: evtq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := evtq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := evtq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(emailverificationtoken.Table, emailverificationtoken.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, emailverificationtoken.OwnerTable, emailverificationtoken.OwnerColumn), + ) + schemaConfig := evtq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.EmailVerificationToken + fromU = sqlgraph.SetNeighbors(evtq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first EmailVerificationToken entity from the query. +// Returns a *NotFoundError when no EmailVerificationToken was found. +func (evtq *EmailVerificationTokenQuery) First(ctx context.Context) (*EmailVerificationToken, error) { + nodes, err := evtq.Limit(1).All(setContextOp(ctx, evtq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{emailverificationtoken.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) FirstX(ctx context.Context) *EmailVerificationToken { + node, err := evtq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EmailVerificationToken ID from the query. +// Returns a *NotFoundError when no EmailVerificationToken ID was found. +func (evtq *EmailVerificationTokenQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = evtq.Limit(1).IDs(setContextOp(ctx, evtq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{emailverificationtoken.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) FirstIDX(ctx context.Context) string { + id, err := evtq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EmailVerificationToken entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EmailVerificationToken entity is found. +// Returns a *NotFoundError when no EmailVerificationToken entities are found. +func (evtq *EmailVerificationTokenQuery) Only(ctx context.Context) (*EmailVerificationToken, error) { + nodes, err := evtq.Limit(2).All(setContextOp(ctx, evtq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{emailverificationtoken.Label} + default: + return nil, &NotSingularError{emailverificationtoken.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) OnlyX(ctx context.Context) *EmailVerificationToken { + node, err := evtq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EmailVerificationToken ID in the query. +// Returns a *NotSingularError when more than one EmailVerificationToken ID is found. +// Returns a *NotFoundError when no entities are found. +func (evtq *EmailVerificationTokenQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = evtq.Limit(2).IDs(setContextOp(ctx, evtq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{emailverificationtoken.Label} + default: + err = &NotSingularError{emailverificationtoken.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) OnlyIDX(ctx context.Context) string { + id, err := evtq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EmailVerificationTokens. +func (evtq *EmailVerificationTokenQuery) All(ctx context.Context) ([]*EmailVerificationToken, error) { + ctx = setContextOp(ctx, evtq.ctx, ent.OpQueryAll) + if err := evtq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EmailVerificationToken, *EmailVerificationTokenQuery]() + return withInterceptors[[]*EmailVerificationToken](ctx, evtq, qr, evtq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) AllX(ctx context.Context) []*EmailVerificationToken { + nodes, err := evtq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EmailVerificationToken IDs. +func (evtq *EmailVerificationTokenQuery) IDs(ctx context.Context) (ids []string, err error) { + if evtq.ctx.Unique == nil && evtq.path != nil { + evtq.Unique(true) + } + ctx = setContextOp(ctx, evtq.ctx, ent.OpQueryIDs) + if err = evtq.Select(emailverificationtoken.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) IDsX(ctx context.Context) []string { + ids, err := evtq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (evtq *EmailVerificationTokenQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, evtq.ctx, ent.OpQueryCount) + if err := evtq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, evtq, querierCount[*EmailVerificationTokenQuery](), evtq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) CountX(ctx context.Context) int { + count, err := evtq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (evtq *EmailVerificationTokenQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, evtq.ctx, ent.OpQueryExist) + switch _, err := evtq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (evtq *EmailVerificationTokenQuery) ExistX(ctx context.Context) bool { + exist, err := evtq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EmailVerificationTokenQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (evtq *EmailVerificationTokenQuery) Clone() *EmailVerificationTokenQuery { + if evtq == nil { + return nil + } + return &EmailVerificationTokenQuery{ + config: evtq.config, + ctx: evtq.ctx.Clone(), + order: append([]emailverificationtoken.OrderOption{}, evtq.order...), + inters: append([]Interceptor{}, evtq.inters...), + predicates: append([]predicate.EmailVerificationToken{}, evtq.predicates...), + withOwner: evtq.withOwner.Clone(), + // clone intermediate query. + sql: evtq.sql.Clone(), + path: evtq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (evtq *EmailVerificationTokenQuery) WithOwner(opts ...func(*UserQuery)) *EmailVerificationTokenQuery { + query := (&UserClient{config: evtq.config}).Query() + for _, opt := range opts { + opt(query) + } + evtq.withOwner = query + return evtq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EmailVerificationToken.Query(). +// GroupBy(emailverificationtoken.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (evtq *EmailVerificationTokenQuery) GroupBy(field string, fields ...string) *EmailVerificationTokenGroupBy { + evtq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EmailVerificationTokenGroupBy{build: evtq} + grbuild.flds = &evtq.ctx.Fields + grbuild.label = emailverificationtoken.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.EmailVerificationToken.Query(). +// Select(emailverificationtoken.FieldCreatedAt). +// Scan(ctx, &v) +func (evtq *EmailVerificationTokenQuery) Select(fields ...string) *EmailVerificationTokenSelect { + evtq.ctx.Fields = append(evtq.ctx.Fields, fields...) + sbuild := &EmailVerificationTokenSelect{EmailVerificationTokenQuery: evtq} + sbuild.label = emailverificationtoken.Label + sbuild.flds, sbuild.scan = &evtq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EmailVerificationTokenSelect configured with the given aggregations. +func (evtq *EmailVerificationTokenQuery) Aggregate(fns ...AggregateFunc) *EmailVerificationTokenSelect { + return evtq.Select().Aggregate(fns...) +} + +func (evtq *EmailVerificationTokenQuery) prepareQuery(ctx context.Context) error { + for _, inter := range evtq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, evtq); err != nil { + return err + } + } + } + for _, f := range evtq.ctx.Fields { + if !emailverificationtoken.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if evtq.path != nil { + prev, err := evtq.path(ctx) + if err != nil { + return err + } + evtq.sql = prev + } + if emailverificationtoken.Policy == nil { + return errors.New("generated: uninitialized emailverificationtoken.Policy (forgotten import generated/runtime?)") + } + if err := emailverificationtoken.Policy.EvalQuery(ctx, evtq); err != nil { + return err + } + return nil +} + +func (evtq *EmailVerificationTokenQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EmailVerificationToken, error) { + var ( + nodes = []*EmailVerificationToken{} + _spec = evtq.querySpec() + loadedTypes = [1]bool{ + evtq.withOwner != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EmailVerificationToken).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EmailVerificationToken{config: evtq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = evtq.schemaConfig.EmailVerificationToken + ctx = internal.NewSchemaConfigContext(ctx, evtq.schemaConfig) + if len(evtq.modifiers) > 0 { + _spec.Modifiers = evtq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, evtq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := evtq.withOwner; query != nil { + if err := evtq.loadOwner(ctx, query, nodes, nil, + func(n *EmailVerificationToken, e *User) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + for i := range evtq.loadTotal { + if err := evtq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (evtq *EmailVerificationTokenQuery) loadOwner(ctx context.Context, query *UserQuery, nodes []*EmailVerificationToken, init func(*EmailVerificationToken), assign func(*EmailVerificationToken, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*EmailVerificationToken) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (evtq *EmailVerificationTokenQuery) sqlCount(ctx context.Context) (int, error) { + _spec := evtq.querySpec() + _spec.Node.Schema = evtq.schemaConfig.EmailVerificationToken + ctx = internal.NewSchemaConfigContext(ctx, evtq.schemaConfig) + if len(evtq.modifiers) > 0 { + _spec.Modifiers = evtq.modifiers + } + _spec.Node.Columns = evtq.ctx.Fields + if len(evtq.ctx.Fields) > 0 { + _spec.Unique = evtq.ctx.Unique != nil && *evtq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, evtq.driver, _spec) +} + +func (evtq *EmailVerificationTokenQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(emailverificationtoken.Table, emailverificationtoken.Columns, sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString)) + _spec.From = evtq.sql + if unique := evtq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if evtq.path != nil { + _spec.Unique = true + } + if fields := evtq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, emailverificationtoken.FieldID) + for i := range fields { + if fields[i] != emailverificationtoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if evtq.withOwner != nil { + _spec.Node.AddColumnOnce(emailverificationtoken.FieldOwnerID) + } + } + if ps := evtq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := evtq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := evtq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := evtq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (evtq *EmailVerificationTokenQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(evtq.driver.Dialect()) + t1 := builder.Table(emailverificationtoken.Table) + columns := evtq.ctx.Fields + if len(columns) == 0 { + columns = emailverificationtoken.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if evtq.sql != nil { + selector = evtq.sql + selector.Select(selector.Columns(columns...)...) + } + if evtq.ctx.Unique != nil && *evtq.ctx.Unique { + selector.Distinct() + } + t1.Schema(evtq.schemaConfig.EmailVerificationToken) + ctx = internal.NewSchemaConfigContext(ctx, evtq.schemaConfig) + selector.WithContext(ctx) + for _, p := range evtq.predicates { + p(selector) + } + for _, p := range evtq.order { + p(selector) + } + if offset := evtq.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 := evtq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// EmailVerificationTokenGroupBy is the group-by builder for EmailVerificationToken entities. +type EmailVerificationTokenGroupBy struct { + selector + build *EmailVerificationTokenQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (evtgb *EmailVerificationTokenGroupBy) Aggregate(fns ...AggregateFunc) *EmailVerificationTokenGroupBy { + evtgb.fns = append(evtgb.fns, fns...) + return evtgb +} + +// Scan applies the selector query and scans the result into the given value. +func (evtgb *EmailVerificationTokenGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, evtgb.build.ctx, ent.OpQueryGroupBy) + if err := evtgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EmailVerificationTokenQuery, *EmailVerificationTokenGroupBy](ctx, evtgb.build, evtgb, evtgb.build.inters, v) +} + +func (evtgb *EmailVerificationTokenGroupBy) sqlScan(ctx context.Context, root *EmailVerificationTokenQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(evtgb.fns)) + for _, fn := range evtgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*evtgb.flds)+len(evtgb.fns)) + for _, f := range *evtgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*evtgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := evtgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EmailVerificationTokenSelect is the builder for selecting fields of EmailVerificationToken entities. +type EmailVerificationTokenSelect struct { + *EmailVerificationTokenQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (evts *EmailVerificationTokenSelect) Aggregate(fns ...AggregateFunc) *EmailVerificationTokenSelect { + evts.fns = append(evts.fns, fns...) + return evts +} + +// Scan applies the selector query and scans the result into the given value. +func (evts *EmailVerificationTokenSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, evts.ctx, ent.OpQuerySelect) + if err := evts.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EmailVerificationTokenQuery, *EmailVerificationTokenSelect](ctx, evts.EmailVerificationTokenQuery, evts, evts.inters, v) +} + +func (evts *EmailVerificationTokenSelect) sqlScan(ctx context.Context, root *EmailVerificationTokenQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(evts.fns)) + for _, fn := range evts.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*evts.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 := evts.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/emailverificationtoken_update.go b/internal/ent/generated/emailverificationtoken_update.go new file mode 100644 index 0000000..9514d7e --- /dev/null +++ b/internal/ent/generated/emailverificationtoken_update.go @@ -0,0 +1,701 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EmailVerificationTokenUpdate is the builder for updating EmailVerificationToken entities. +type EmailVerificationTokenUpdate struct { + config + hooks []Hook + mutation *EmailVerificationTokenMutation +} + +// Where appends a list predicates to the EmailVerificationTokenUpdate builder. +func (evtu *EmailVerificationTokenUpdate) Where(ps ...predicate.EmailVerificationToken) *EmailVerificationTokenUpdate { + evtu.mutation.Where(ps...) + return evtu +} + +// SetUpdatedAt sets the "updated_at" field. +func (evtu *EmailVerificationTokenUpdate) SetUpdatedAt(t time.Time) *EmailVerificationTokenUpdate { + evtu.mutation.SetUpdatedAt(t) + return evtu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (evtu *EmailVerificationTokenUpdate) ClearUpdatedAt() *EmailVerificationTokenUpdate { + evtu.mutation.ClearUpdatedAt() + return evtu +} + +// SetUpdatedBy sets the "updated_by" field. +func (evtu *EmailVerificationTokenUpdate) SetUpdatedBy(s string) *EmailVerificationTokenUpdate { + evtu.mutation.SetUpdatedBy(s) + return evtu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (evtu *EmailVerificationTokenUpdate) SetNillableUpdatedBy(s *string) *EmailVerificationTokenUpdate { + if s != nil { + evtu.SetUpdatedBy(*s) + } + return evtu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (evtu *EmailVerificationTokenUpdate) ClearUpdatedBy() *EmailVerificationTokenUpdate { + evtu.mutation.ClearUpdatedBy() + return evtu +} + +// SetDeletedAt sets the "deleted_at" field. +func (evtu *EmailVerificationTokenUpdate) SetDeletedAt(t time.Time) *EmailVerificationTokenUpdate { + evtu.mutation.SetDeletedAt(t) + return evtu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (evtu *EmailVerificationTokenUpdate) SetNillableDeletedAt(t *time.Time) *EmailVerificationTokenUpdate { + if t != nil { + evtu.SetDeletedAt(*t) + } + return evtu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (evtu *EmailVerificationTokenUpdate) ClearDeletedAt() *EmailVerificationTokenUpdate { + evtu.mutation.ClearDeletedAt() + return evtu +} + +// SetDeletedBy sets the "deleted_by" field. +func (evtu *EmailVerificationTokenUpdate) SetDeletedBy(s string) *EmailVerificationTokenUpdate { + evtu.mutation.SetDeletedBy(s) + return evtu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (evtu *EmailVerificationTokenUpdate) SetNillableDeletedBy(s *string) *EmailVerificationTokenUpdate { + if s != nil { + evtu.SetDeletedBy(*s) + } + return evtu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (evtu *EmailVerificationTokenUpdate) ClearDeletedBy() *EmailVerificationTokenUpdate { + evtu.mutation.ClearDeletedBy() + return evtu +} + +// SetOwnerID sets the "owner_id" field. +func (evtu *EmailVerificationTokenUpdate) SetOwnerID(s string) *EmailVerificationTokenUpdate { + evtu.mutation.SetOwnerID(s) + return evtu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (evtu *EmailVerificationTokenUpdate) SetNillableOwnerID(s *string) *EmailVerificationTokenUpdate { + if s != nil { + evtu.SetOwnerID(*s) + } + return evtu +} + +// SetToken sets the "token" field. +func (evtu *EmailVerificationTokenUpdate) SetToken(s string) *EmailVerificationTokenUpdate { + evtu.mutation.SetToken(s) + return evtu +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (evtu *EmailVerificationTokenUpdate) SetNillableToken(s *string) *EmailVerificationTokenUpdate { + if s != nil { + evtu.SetToken(*s) + } + return evtu +} + +// SetTTL sets the "ttl" field. +func (evtu *EmailVerificationTokenUpdate) SetTTL(t time.Time) *EmailVerificationTokenUpdate { + evtu.mutation.SetTTL(t) + return evtu +} + +// SetNillableTTL sets the "ttl" field if the given value is not nil. +func (evtu *EmailVerificationTokenUpdate) SetNillableTTL(t *time.Time) *EmailVerificationTokenUpdate { + if t != nil { + evtu.SetTTL(*t) + } + return evtu +} + +// SetEmail sets the "email" field. +func (evtu *EmailVerificationTokenUpdate) SetEmail(s string) *EmailVerificationTokenUpdate { + evtu.mutation.SetEmail(s) + return evtu +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (evtu *EmailVerificationTokenUpdate) SetNillableEmail(s *string) *EmailVerificationTokenUpdate { + if s != nil { + evtu.SetEmail(*s) + } + return evtu +} + +// SetSecret sets the "secret" field. +func (evtu *EmailVerificationTokenUpdate) SetSecret(b []byte) *EmailVerificationTokenUpdate { + evtu.mutation.SetSecret(b) + return evtu +} + +// SetOwner sets the "owner" edge to the User entity. +func (evtu *EmailVerificationTokenUpdate) SetOwner(u *User) *EmailVerificationTokenUpdate { + return evtu.SetOwnerID(u.ID) +} + +// Mutation returns the EmailVerificationTokenMutation object of the builder. +func (evtu *EmailVerificationTokenUpdate) Mutation() *EmailVerificationTokenMutation { + return evtu.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (evtu *EmailVerificationTokenUpdate) ClearOwner() *EmailVerificationTokenUpdate { + evtu.mutation.ClearOwner() + return evtu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (evtu *EmailVerificationTokenUpdate) Save(ctx context.Context) (int, error) { + if err := evtu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, evtu.sqlSave, evtu.mutation, evtu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (evtu *EmailVerificationTokenUpdate) SaveX(ctx context.Context) int { + affected, err := evtu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (evtu *EmailVerificationTokenUpdate) Exec(ctx context.Context) error { + _, err := evtu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (evtu *EmailVerificationTokenUpdate) ExecX(ctx context.Context) { + if err := evtu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (evtu *EmailVerificationTokenUpdate) defaults() error { + if _, ok := evtu.mutation.UpdatedAt(); !ok && !evtu.mutation.UpdatedAtCleared() { + if emailverificationtoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized emailverificationtoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := emailverificationtoken.UpdateDefaultUpdatedAt() + evtu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (evtu *EmailVerificationTokenUpdate) check() error { + if v, ok := evtu.mutation.Token(); ok { + if err := emailverificationtoken.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.token": %w`, err)} + } + } + if v, ok := evtu.mutation.Email(); ok { + if err := emailverificationtoken.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.email": %w`, err)} + } + } + if v, ok := evtu.mutation.Secret(); ok { + if err := emailverificationtoken.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.secret": %w`, err)} + } + } + if evtu.mutation.OwnerCleared() && len(evtu.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "EmailVerificationToken.owner"`) + } + return nil +} + +func (evtu *EmailVerificationTokenUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := evtu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(emailverificationtoken.Table, emailverificationtoken.Columns, sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString)) + if ps := evtu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if evtu.mutation.CreatedAtCleared() { + _spec.ClearField(emailverificationtoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := evtu.mutation.UpdatedAt(); ok { + _spec.SetField(emailverificationtoken.FieldUpdatedAt, field.TypeTime, value) + } + if evtu.mutation.UpdatedAtCleared() { + _spec.ClearField(emailverificationtoken.FieldUpdatedAt, field.TypeTime) + } + if evtu.mutation.CreatedByCleared() { + _spec.ClearField(emailverificationtoken.FieldCreatedBy, field.TypeString) + } + if value, ok := evtu.mutation.UpdatedBy(); ok { + _spec.SetField(emailverificationtoken.FieldUpdatedBy, field.TypeString, value) + } + if evtu.mutation.UpdatedByCleared() { + _spec.ClearField(emailverificationtoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := evtu.mutation.DeletedAt(); ok { + _spec.SetField(emailverificationtoken.FieldDeletedAt, field.TypeTime, value) + } + if evtu.mutation.DeletedAtCleared() { + _spec.ClearField(emailverificationtoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := evtu.mutation.DeletedBy(); ok { + _spec.SetField(emailverificationtoken.FieldDeletedBy, field.TypeString, value) + } + if evtu.mutation.DeletedByCleared() { + _spec.ClearField(emailverificationtoken.FieldDeletedBy, field.TypeString) + } + if value, ok := evtu.mutation.Token(); ok { + _spec.SetField(emailverificationtoken.FieldToken, field.TypeString, value) + } + if value, ok := evtu.mutation.TTL(); ok { + _spec.SetField(emailverificationtoken.FieldTTL, field.TypeTime, value) + } + if value, ok := evtu.mutation.Email(); ok { + _spec.SetField(emailverificationtoken.FieldEmail, field.TypeString, value) + } + if value, ok := evtu.mutation.Secret(); ok { + _spec.SetField(emailverificationtoken.FieldSecret, field.TypeBytes, value) + } + if evtu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: emailverificationtoken.OwnerTable, + Columns: []string{emailverificationtoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = evtu.schemaConfig.EmailVerificationToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := evtu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: emailverificationtoken.OwnerTable, + Columns: []string{emailverificationtoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = evtu.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = evtu.schemaConfig.EmailVerificationToken + ctx = internal.NewSchemaConfigContext(ctx, evtu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, evtu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{emailverificationtoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + evtu.mutation.done = true + return n, nil +} + +// EmailVerificationTokenUpdateOne is the builder for updating a single EmailVerificationToken entity. +type EmailVerificationTokenUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EmailVerificationTokenMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetUpdatedAt(t time.Time) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetUpdatedAt(t) + return evtuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (evtuo *EmailVerificationTokenUpdateOne) ClearUpdatedAt() *EmailVerificationTokenUpdateOne { + evtuo.mutation.ClearUpdatedAt() + return evtuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetUpdatedBy(s string) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetUpdatedBy(s) + return evtuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (evtuo *EmailVerificationTokenUpdateOne) SetNillableUpdatedBy(s *string) *EmailVerificationTokenUpdateOne { + if s != nil { + evtuo.SetUpdatedBy(*s) + } + return evtuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (evtuo *EmailVerificationTokenUpdateOne) ClearUpdatedBy() *EmailVerificationTokenUpdateOne { + evtuo.mutation.ClearUpdatedBy() + return evtuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetDeletedAt(t time.Time) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetDeletedAt(t) + return evtuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (evtuo *EmailVerificationTokenUpdateOne) SetNillableDeletedAt(t *time.Time) *EmailVerificationTokenUpdateOne { + if t != nil { + evtuo.SetDeletedAt(*t) + } + return evtuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (evtuo *EmailVerificationTokenUpdateOne) ClearDeletedAt() *EmailVerificationTokenUpdateOne { + evtuo.mutation.ClearDeletedAt() + return evtuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetDeletedBy(s string) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetDeletedBy(s) + return evtuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (evtuo *EmailVerificationTokenUpdateOne) SetNillableDeletedBy(s *string) *EmailVerificationTokenUpdateOne { + if s != nil { + evtuo.SetDeletedBy(*s) + } + return evtuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (evtuo *EmailVerificationTokenUpdateOne) ClearDeletedBy() *EmailVerificationTokenUpdateOne { + evtuo.mutation.ClearDeletedBy() + return evtuo +} + +// SetOwnerID sets the "owner_id" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetOwnerID(s string) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetOwnerID(s) + return evtuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (evtuo *EmailVerificationTokenUpdateOne) SetNillableOwnerID(s *string) *EmailVerificationTokenUpdateOne { + if s != nil { + evtuo.SetOwnerID(*s) + } + return evtuo +} + +// SetToken sets the "token" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetToken(s string) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetToken(s) + return evtuo +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (evtuo *EmailVerificationTokenUpdateOne) SetNillableToken(s *string) *EmailVerificationTokenUpdateOne { + if s != nil { + evtuo.SetToken(*s) + } + return evtuo +} + +// SetTTL sets the "ttl" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetTTL(t time.Time) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetTTL(t) + return evtuo +} + +// SetNillableTTL sets the "ttl" field if the given value is not nil. +func (evtuo *EmailVerificationTokenUpdateOne) SetNillableTTL(t *time.Time) *EmailVerificationTokenUpdateOne { + if t != nil { + evtuo.SetTTL(*t) + } + return evtuo +} + +// SetEmail sets the "email" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetEmail(s string) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetEmail(s) + return evtuo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (evtuo *EmailVerificationTokenUpdateOne) SetNillableEmail(s *string) *EmailVerificationTokenUpdateOne { + if s != nil { + evtuo.SetEmail(*s) + } + return evtuo +} + +// SetSecret sets the "secret" field. +func (evtuo *EmailVerificationTokenUpdateOne) SetSecret(b []byte) *EmailVerificationTokenUpdateOne { + evtuo.mutation.SetSecret(b) + return evtuo +} + +// SetOwner sets the "owner" edge to the User entity. +func (evtuo *EmailVerificationTokenUpdateOne) SetOwner(u *User) *EmailVerificationTokenUpdateOne { + return evtuo.SetOwnerID(u.ID) +} + +// Mutation returns the EmailVerificationTokenMutation object of the builder. +func (evtuo *EmailVerificationTokenUpdateOne) Mutation() *EmailVerificationTokenMutation { + return evtuo.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (evtuo *EmailVerificationTokenUpdateOne) ClearOwner() *EmailVerificationTokenUpdateOne { + evtuo.mutation.ClearOwner() + return evtuo +} + +// Where appends a list predicates to the EmailVerificationTokenUpdate builder. +func (evtuo *EmailVerificationTokenUpdateOne) Where(ps ...predicate.EmailVerificationToken) *EmailVerificationTokenUpdateOne { + evtuo.mutation.Where(ps...) + return evtuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (evtuo *EmailVerificationTokenUpdateOne) Select(field string, fields ...string) *EmailVerificationTokenUpdateOne { + evtuo.fields = append([]string{field}, fields...) + return evtuo +} + +// Save executes the query and returns the updated EmailVerificationToken entity. +func (evtuo *EmailVerificationTokenUpdateOne) Save(ctx context.Context) (*EmailVerificationToken, error) { + if err := evtuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, evtuo.sqlSave, evtuo.mutation, evtuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (evtuo *EmailVerificationTokenUpdateOne) SaveX(ctx context.Context) *EmailVerificationToken { + node, err := evtuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (evtuo *EmailVerificationTokenUpdateOne) Exec(ctx context.Context) error { + _, err := evtuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (evtuo *EmailVerificationTokenUpdateOne) ExecX(ctx context.Context) { + if err := evtuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (evtuo *EmailVerificationTokenUpdateOne) defaults() error { + if _, ok := evtuo.mutation.UpdatedAt(); !ok && !evtuo.mutation.UpdatedAtCleared() { + if emailverificationtoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized emailverificationtoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := emailverificationtoken.UpdateDefaultUpdatedAt() + evtuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (evtuo *EmailVerificationTokenUpdateOne) check() error { + if v, ok := evtuo.mutation.Token(); ok { + if err := emailverificationtoken.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.token": %w`, err)} + } + } + if v, ok := evtuo.mutation.Email(); ok { + if err := emailverificationtoken.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.email": %w`, err)} + } + } + if v, ok := evtuo.mutation.Secret(); ok { + if err := emailverificationtoken.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "EmailVerificationToken.secret": %w`, err)} + } + } + if evtuo.mutation.OwnerCleared() && len(evtuo.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "EmailVerificationToken.owner"`) + } + return nil +} + +func (evtuo *EmailVerificationTokenUpdateOne) sqlSave(ctx context.Context) (_node *EmailVerificationToken, err error) { + if err := evtuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(emailverificationtoken.Table, emailverificationtoken.Columns, sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString)) + id, ok := evtuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EmailVerificationToken.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := evtuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, emailverificationtoken.FieldID) + for _, f := range fields { + if !emailverificationtoken.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != emailverificationtoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := evtuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if evtuo.mutation.CreatedAtCleared() { + _spec.ClearField(emailverificationtoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := evtuo.mutation.UpdatedAt(); ok { + _spec.SetField(emailverificationtoken.FieldUpdatedAt, field.TypeTime, value) + } + if evtuo.mutation.UpdatedAtCleared() { + _spec.ClearField(emailverificationtoken.FieldUpdatedAt, field.TypeTime) + } + if evtuo.mutation.CreatedByCleared() { + _spec.ClearField(emailverificationtoken.FieldCreatedBy, field.TypeString) + } + if value, ok := evtuo.mutation.UpdatedBy(); ok { + _spec.SetField(emailverificationtoken.FieldUpdatedBy, field.TypeString, value) + } + if evtuo.mutation.UpdatedByCleared() { + _spec.ClearField(emailverificationtoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := evtuo.mutation.DeletedAt(); ok { + _spec.SetField(emailverificationtoken.FieldDeletedAt, field.TypeTime, value) + } + if evtuo.mutation.DeletedAtCleared() { + _spec.ClearField(emailverificationtoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := evtuo.mutation.DeletedBy(); ok { + _spec.SetField(emailverificationtoken.FieldDeletedBy, field.TypeString, value) + } + if evtuo.mutation.DeletedByCleared() { + _spec.ClearField(emailverificationtoken.FieldDeletedBy, field.TypeString) + } + if value, ok := evtuo.mutation.Token(); ok { + _spec.SetField(emailverificationtoken.FieldToken, field.TypeString, value) + } + if value, ok := evtuo.mutation.TTL(); ok { + _spec.SetField(emailverificationtoken.FieldTTL, field.TypeTime, value) + } + if value, ok := evtuo.mutation.Email(); ok { + _spec.SetField(emailverificationtoken.FieldEmail, field.TypeString, value) + } + if value, ok := evtuo.mutation.Secret(); ok { + _spec.SetField(emailverificationtoken.FieldSecret, field.TypeBytes, value) + } + if evtuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: emailverificationtoken.OwnerTable, + Columns: []string{emailverificationtoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = evtuo.schemaConfig.EmailVerificationToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := evtuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: emailverificationtoken.OwnerTable, + Columns: []string{emailverificationtoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = evtuo.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = evtuo.schemaConfig.EmailVerificationToken + ctx = internal.NewSchemaConfigContext(ctx, evtuo.schemaConfig) + _node = &EmailVerificationToken{config: evtuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, evtuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{emailverificationtoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + evtuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/ent.go b/internal/ent/generated/ent.go new file mode 100644 index 0000000..7924e4e --- /dev/null +++ b/internal/ent/generated/ent.go @@ -0,0 +1,720 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "reflect" + "sync" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" +) + +// ent aliases to avoid import conflicts in user's code. +type ( + Op = ent.Op + Hook = ent.Hook + Value = ent.Value + Query = ent.Query + QueryContext = ent.QueryContext + Querier = ent.Querier + QuerierFunc = ent.QuerierFunc + Interceptor = ent.Interceptor + InterceptFunc = ent.InterceptFunc + Traverser = ent.Traverser + TraverseFunc = ent.TraverseFunc + Policy = ent.Policy + Mutator = ent.Mutator + Mutation = ent.Mutation + MutateFunc = ent.MutateFunc +) + +type clientCtxKey struct{} + +// FromContext returns a Client stored inside a context, or nil if there isn't one. +func FromContext(ctx context.Context) *Client { + c, _ := ctx.Value(clientCtxKey{}).(*Client) + return c +} + +// NewContext returns a new context with the given Client attached. +func NewContext(parent context.Context, c *Client) context.Context { + return context.WithValue(parent, clientCtxKey{}, c) +} + +type txCtxKey struct{} + +// TxFromContext returns a Tx stored inside a context, or nil if there isn't one. +func TxFromContext(ctx context.Context) *Tx { + tx, _ := ctx.Value(txCtxKey{}).(*Tx) + return tx +} + +// NewTxContext returns a new context with the given Tx attached. +func NewTxContext(parent context.Context, tx *Tx) context.Context { + return context.WithValue(parent, txCtxKey{}, tx) +} + +// OrderFunc applies an ordering on the sql selector. +// Deprecated: Use Asc/Desc functions or the package builders instead. +type OrderFunc func(*sql.Selector) + +var ( + initCheck sync.Once + columnCheck sql.ColumnCheck +) + +// checkColumn checks if the column exists in the given table. +func checkColumn(table, column string) error { + initCheck.Do(func() { + columnCheck = sql.NewColumnCheck(map[string]func(string) bool{ + apitoken.Table: apitoken.ValidColumn, + contact.Table: contact.ValidColumn, + contacthistory.Table: contacthistory.ValidColumn, + documentdata.Table: documentdata.ValidColumn, + documentdatahistory.Table: documentdatahistory.ValidColumn, + emailverificationtoken.Table: emailverificationtoken.ValidColumn, + entitlement.Table: entitlement.ValidColumn, + entitlementhistory.Table: entitlementhistory.ValidColumn, + entitlementplan.Table: entitlementplan.ValidColumn, + entitlementplanfeature.Table: entitlementplanfeature.ValidColumn, + entitlementplanfeaturehistory.Table: entitlementplanfeaturehistory.ValidColumn, + entitlementplanhistory.Table: entitlementplanhistory.ValidColumn, + entity.Table: entity.ValidColumn, + entityhistory.Table: entityhistory.ValidColumn, + entitytype.Table: entitytype.ValidColumn, + entitytypehistory.Table: entitytypehistory.ValidColumn, + event.Table: event.ValidColumn, + eventhistory.Table: eventhistory.ValidColumn, + feature.Table: feature.ValidColumn, + featurehistory.Table: featurehistory.ValidColumn, + file.Table: file.ValidColumn, + filehistory.Table: filehistory.ValidColumn, + group.Table: group.ValidColumn, + grouphistory.Table: grouphistory.ValidColumn, + groupmembership.Table: groupmembership.ValidColumn, + groupmembershiphistory.Table: groupmembershiphistory.ValidColumn, + groupsetting.Table: groupsetting.ValidColumn, + groupsettinghistory.Table: groupsettinghistory.ValidColumn, + hush.Table: hush.ValidColumn, + hushhistory.Table: hushhistory.ValidColumn, + integration.Table: integration.ValidColumn, + integrationhistory.Table: integrationhistory.ValidColumn, + invite.Table: invite.ValidColumn, + note.Table: note.ValidColumn, + notehistory.Table: notehistory.ValidColumn, + oauthprovider.Table: oauthprovider.ValidColumn, + oauthproviderhistory.Table: oauthproviderhistory.ValidColumn, + ohauthtootoken.Table: ohauthtootoken.ValidColumn, + orgmembership.Table: orgmembership.ValidColumn, + orgmembershiphistory.Table: orgmembershiphistory.ValidColumn, + organization.Table: organization.ValidColumn, + organizationhistory.Table: organizationhistory.ValidColumn, + organizationsetting.Table: organizationsetting.ValidColumn, + organizationsettinghistory.Table: organizationsettinghistory.ValidColumn, + passwordresettoken.Table: passwordresettoken.ValidColumn, + personalaccesstoken.Table: personalaccesstoken.ValidColumn, + subscriber.Table: subscriber.ValidColumn, + tfasetting.Table: tfasetting.ValidColumn, + template.Table: template.ValidColumn, + templatehistory.Table: templatehistory.ValidColumn, + user.Table: user.ValidColumn, + userhistory.Table: userhistory.ValidColumn, + usersetting.Table: usersetting.ValidColumn, + usersettinghistory.Table: usersettinghistory.ValidColumn, + webauthn.Table: webauthn.ValidColumn, + webhook.Table: webhook.ValidColumn, + webhookhistory.Table: webhookhistory.ValidColumn, + }) + }) + return columnCheck(table, column) +} + +// Asc applies the given fields in ASC order. +func Asc(fields ...string) func(*sql.Selector) { + return func(s *sql.Selector) { + for _, f := range fields { + if err := checkColumn(s.TableName(), f); err != nil { + s.AddError(&ValidationError{Name: f, err: fmt.Errorf("generated: %w", err)}) + } + s.OrderBy(sql.Asc(s.C(f))) + } + } +} + +// Desc applies the given fields in DESC order. +func Desc(fields ...string) func(*sql.Selector) { + return func(s *sql.Selector) { + for _, f := range fields { + if err := checkColumn(s.TableName(), f); err != nil { + s.AddError(&ValidationError{Name: f, err: fmt.Errorf("generated: %w", err)}) + } + s.OrderBy(sql.Desc(s.C(f))) + } + } +} + +// AggregateFunc applies an aggregation step on the group-by traversal/selector. +type AggregateFunc func(*sql.Selector) string + +// As is a pseudo aggregation function for renaming another other functions with custom names. For example: +// +// GroupBy(field1, field2). +// Aggregate(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.Sum(field2), "sum_field2")). +// Scan(ctx, &v) +func As(fn AggregateFunc, end string) AggregateFunc { + return func(s *sql.Selector) string { + return sql.As(fn(s), end) + } +} + +// Count applies the "count" aggregation function on each group. +func Count() AggregateFunc { + return func(s *sql.Selector) string { + return sql.Count("*") + } +} + +// Max applies the "max" aggregation function on the given field of each group. +func Max(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("generated: %w", err)}) + return "" + } + return sql.Max(s.C(field)) + } +} + +// Mean applies the "mean" aggregation function on the given field of each group. +func Mean(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("generated: %w", err)}) + return "" + } + return sql.Avg(s.C(field)) + } +} + +// Min applies the "min" aggregation function on the given field of each group. +func Min(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("generated: %w", err)}) + return "" + } + return sql.Min(s.C(field)) + } +} + +// Sum applies the "sum" aggregation function on the given field of each group. +func Sum(field string) AggregateFunc { + return func(s *sql.Selector) string { + if err := checkColumn(s.TableName(), field); err != nil { + s.AddError(&ValidationError{Name: field, err: fmt.Errorf("generated: %w", err)}) + return "" + } + return sql.Sum(s.C(field)) + } +} + +// ValidationError returns when validating a field or edge fails. +type ValidationError struct { + Name string // Field or edge name. + err error +} + +// Error implements the error interface. +func (e *ValidationError) Error() string { + return e.err.Error() +} + +// Unwrap implements the errors.Wrapper interface. +func (e *ValidationError) Unwrap() error { + return e.err +} + +// IsValidationError returns a boolean indicating whether the error is a validation error. +func IsValidationError(err error) bool { + if err == nil { + return false + } + var e *ValidationError + return errors.As(err, &e) +} + +// NotFoundError returns when trying to fetch a specific entity and it was not found in the database. +type NotFoundError struct { + label string +} + +// Error implements the error interface. +func (e *NotFoundError) Error() string { + return "generated: " + e.label + " not found" +} + +// IsNotFound returns a boolean indicating whether the error is a not found error. +func IsNotFound(err error) bool { + if err == nil { + return false + } + var e *NotFoundError + return errors.As(err, &e) +} + +// MaskNotFound masks not found error. +func MaskNotFound(err error) error { + if IsNotFound(err) { + return nil + } + return err +} + +// NotSingularError returns when trying to fetch a singular entity and more then one was found in the database. +type NotSingularError struct { + label string +} + +// Error implements the error interface. +func (e *NotSingularError) Error() string { + return "generated: " + e.label + " not singular" +} + +// IsNotSingular returns a boolean indicating whether the error is a not singular error. +func IsNotSingular(err error) bool { + if err == nil { + return false + } + var e *NotSingularError + return errors.As(err, &e) +} + +// NotLoadedError returns when trying to get a node that was not loaded by the query. +type NotLoadedError struct { + edge string +} + +// Error implements the error interface. +func (e *NotLoadedError) Error() string { + return "generated: " + e.edge + " edge was not loaded" +} + +// IsNotLoaded returns a boolean indicating whether the error is a not loaded error. +func IsNotLoaded(err error) bool { + if err == nil { + return false + } + var e *NotLoadedError + return errors.As(err, &e) +} + +// ConstraintError returns when trying to create/update one or more entities and +// one or more of their constraints failed. For example, violation of edge or +// field uniqueness. +type ConstraintError struct { + msg string + wrap error +} + +// Error implements the error interface. +func (e ConstraintError) Error() string { + return "generated: constraint failed: " + e.msg +} + +// Unwrap implements the errors.Wrapper interface. +func (e *ConstraintError) Unwrap() error { + return e.wrap +} + +// IsConstraintError returns a boolean indicating whether the error is a constraint failure. +func IsConstraintError(err error) bool { + if err == nil { + return false + } + var e *ConstraintError + return errors.As(err, &e) +} + +// selector embedded by the different Select/GroupBy builders. +type selector struct { + label string + flds *[]string + fns []AggregateFunc + scan func(context.Context, any) error +} + +// ScanX is like Scan, but panics if an error occurs. +func (s *selector) ScanX(ctx context.Context, v any) { + if err := s.scan(ctx, v); err != nil { + panic(err) + } +} + +// Strings returns list of strings from a selector. It is only allowed when selecting one field. +func (s *selector) Strings(ctx context.Context) ([]string, error) { + if len(*s.flds) > 1 { + return nil, errors.New("generated: Strings is not achievable when selecting more than 1 field") + } + var v []string + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// StringsX is like Strings, but panics if an error occurs. +func (s *selector) StringsX(ctx context.Context) []string { + v, err := s.Strings(ctx) + if err != nil { + panic(err) + } + return v +} + +// String returns a single string from a selector. It is only allowed when selecting one field. +func (s *selector) String(ctx context.Context) (_ string, err error) { + var v []string + if v, err = s.Strings(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("generated: Strings returned %d results when one was expected", len(v)) + } + return +} + +// StringX is like String, but panics if an error occurs. +func (s *selector) StringX(ctx context.Context) string { + v, err := s.String(ctx) + if err != nil { + panic(err) + } + return v +} + +// Ints returns list of ints from a selector. It is only allowed when selecting one field. +func (s *selector) Ints(ctx context.Context) ([]int, error) { + if len(*s.flds) > 1 { + return nil, errors.New("generated: Ints is not achievable when selecting more than 1 field") + } + var v []int + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// IntsX is like Ints, but panics if an error occurs. +func (s *selector) IntsX(ctx context.Context) []int { + v, err := s.Ints(ctx) + if err != nil { + panic(err) + } + return v +} + +// Int returns a single int from a selector. It is only allowed when selecting one field. +func (s *selector) Int(ctx context.Context) (_ int, err error) { + var v []int + if v, err = s.Ints(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("generated: Ints returned %d results when one was expected", len(v)) + } + return +} + +// IntX is like Int, but panics if an error occurs. +func (s *selector) IntX(ctx context.Context) int { + v, err := s.Int(ctx) + if err != nil { + panic(err) + } + return v +} + +// Float64s returns list of float64s from a selector. It is only allowed when selecting one field. +func (s *selector) Float64s(ctx context.Context) ([]float64, error) { + if len(*s.flds) > 1 { + return nil, errors.New("generated: Float64s is not achievable when selecting more than 1 field") + } + var v []float64 + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// Float64sX is like Float64s, but panics if an error occurs. +func (s *selector) Float64sX(ctx context.Context) []float64 { + v, err := s.Float64s(ctx) + if err != nil { + panic(err) + } + return v +} + +// Float64 returns a single float64 from a selector. It is only allowed when selecting one field. +func (s *selector) Float64(ctx context.Context) (_ float64, err error) { + var v []float64 + if v, err = s.Float64s(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("generated: Float64s returned %d results when one was expected", len(v)) + } + return +} + +// Float64X is like Float64, but panics if an error occurs. +func (s *selector) Float64X(ctx context.Context) float64 { + v, err := s.Float64(ctx) + if err != nil { + panic(err) + } + return v +} + +// Bools returns list of bools from a selector. It is only allowed when selecting one field. +func (s *selector) Bools(ctx context.Context) ([]bool, error) { + if len(*s.flds) > 1 { + return nil, errors.New("generated: Bools is not achievable when selecting more than 1 field") + } + var v []bool + if err := s.scan(ctx, &v); err != nil { + return nil, err + } + return v, nil +} + +// BoolsX is like Bools, but panics if an error occurs. +func (s *selector) BoolsX(ctx context.Context) []bool { + v, err := s.Bools(ctx) + if err != nil { + panic(err) + } + return v +} + +// Bool returns a single bool from a selector. It is only allowed when selecting one field. +func (s *selector) Bool(ctx context.Context) (_ bool, err error) { + var v []bool + if v, err = s.Bools(ctx); err != nil { + return + } + switch len(v) { + case 1: + return v[0], nil + case 0: + err = &NotFoundError{s.label} + default: + err = fmt.Errorf("generated: Bools returned %d results when one was expected", len(v)) + } + return +} + +// BoolX is like Bool, but panics if an error occurs. +func (s *selector) BoolX(ctx context.Context) bool { + v, err := s.Bool(ctx) + if err != nil { + panic(err) + } + return v +} + +// withHooks invokes the builder operation with the given hooks, if any. +func withHooks[V Value, M any, PM interface { + *M + Mutation +}](ctx context.Context, exec func(context.Context) (V, error), mutation PM, hooks []Hook) (value V, err error) { + if len(hooks) == 0 { + return exec(ctx) + } + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutationT, ok := any(m).(PM) + if !ok { + return nil, fmt.Errorf("unexpected mutation type %T", m) + } + // Set the mutation to the builder. + *mutation = *mutationT + return exec(ctx) + }) + for i := len(hooks) - 1; i >= 0; i-- { + if hooks[i] == nil { + return value, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)") + } + mut = hooks[i](mut) + } + v, err := mut.Mutate(ctx, mutation) + if err != nil { + return value, err + } + nv, ok := v.(V) + if !ok { + return value, fmt.Errorf("unexpected node type %T returned from %T", v, mutation) + } + return nv, nil +} + +// setContextOp returns a new context with the given QueryContext attached (including its op) in case it does not exist. +func setContextOp(ctx context.Context, qc *QueryContext, op string) context.Context { + if ent.QueryFromContext(ctx) == nil { + qc.Op = op + ctx = ent.NewQueryContext(ctx, qc) + } + return ctx +} + +func querierAll[V Value, Q interface { + sqlAll(context.Context, ...queryHook) (V, error) +}]() Querier { + return QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + return query.sqlAll(ctx) + }) +} + +func querierCount[Q interface { + sqlCount(context.Context) (int, error) +}]() Querier { + return QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + return query.sqlCount(ctx) + }) +} + +func withInterceptors[V Value](ctx context.Context, q Query, qr Querier, inters []Interceptor) (v V, err error) { + for i := len(inters) - 1; i >= 0; i-- { + qr = inters[i].Intercept(qr) + } + rv, err := qr.Query(ctx, q) + if err != nil { + return v, err + } + vt, ok := rv.(V) + if !ok { + return v, fmt.Errorf("unexpected type %T returned from %T. expected type: %T", vt, q, v) + } + return vt, nil +} + +func scanWithInterceptors[Q1 ent.Query, Q2 interface { + sqlScan(context.Context, Q1, any) error +}](ctx context.Context, rootQuery Q1, selectOrGroup Q2, inters []Interceptor, v any) error { + rv := reflect.ValueOf(v) + var qr Querier = QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + query, ok := q.(Q1) + if !ok { + return nil, fmt.Errorf("unexpected query type %T", q) + } + if err := selectOrGroup.sqlScan(ctx, query, v); err != nil { + return nil, err + } + if k := rv.Kind(); k == reflect.Pointer && rv.Elem().CanInterface() { + return rv.Elem().Interface(), nil + } + return v, nil + }) + for i := len(inters) - 1; i >= 0; i-- { + qr = inters[i].Intercept(qr) + } + vv, err := qr.Query(ctx, rootQuery) + if err != nil { + return err + } + switch rv2 := reflect.ValueOf(vv); { + case rv.IsNil(), rv2.IsNil(), rv.Kind() != reflect.Pointer: + case rv.Type() == rv2.Type(): + rv.Elem().Set(rv2.Elem()) + case rv.Elem().Type() == rv2.Type(): + rv.Elem().Set(rv2) + } + return nil +} + +// queryHook describes an internal hook for the different sqlAll methods. +type queryHook func(context.Context, *sqlgraph.QuerySpec) diff --git a/internal/ent/generated/entitlement.go b/internal/ent/generated/entitlement.go new file mode 100644 index 0000000..470ad56 --- /dev/null +++ b/internal/ent/generated/entitlement.go @@ -0,0 +1,389 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// Entitlement is the model entity for the Entitlement schema. +type Entitlement struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the plan to which the entitlement belongs + PlanID string `json:"plan_id,omitempty"` + // the organization to which the entitlement belongs + OrganizationID string `json:"organization_id,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID string `json:"external_customer_id,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID string `json:"external_subscription_id,omitempty"` + // whether or not the customers entitlement expires - expires_at will show the time + Expires bool `json:"expires,omitempty"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled bool `json:"cancelled,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the EntitlementQuery when eager-loading is set. + Edges EntitlementEdges `json:"edges"` + selectValues sql.SelectValues +} + +// EntitlementEdges holds the relations/edges for other nodes in the graph. +type EntitlementEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Plan holds the value of the plan edge. + Plan *EntitlementPlan `json:"plan,omitempty"` + // Organization holds the value of the organization edge. + Organization *Organization `json:"organization,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [4]bool + // totalCount holds the count of the edges above. + totalCount [4]map[string]int + + namedEvents map[string][]*Event +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntitlementEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// PlanOrErr returns the Plan value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntitlementEdges) PlanOrErr() (*EntitlementPlan, error) { + if e.Plan != nil { + return e.Plan, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: entitlementplan.Label} + } + return nil, &NotLoadedError{edge: "plan"} +} + +// OrganizationOrErr returns the Organization value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntitlementEdges) OrganizationOrErr() (*Organization, error) { + if e.Organization != nil { + return e.Organization, nil + } else if e.loadedTypes[2] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "organization"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e EntitlementEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[3] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Entitlement) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitlement.FieldTags: + values[i] = new([]byte) + case entitlement.FieldExpires, entitlement.FieldCancelled: + values[i] = new(sql.NullBool) + case entitlement.FieldID, entitlement.FieldCreatedBy, entitlement.FieldUpdatedBy, entitlement.FieldMappingID, entitlement.FieldDeletedBy, entitlement.FieldOwnerID, entitlement.FieldPlanID, entitlement.FieldOrganizationID, entitlement.FieldExternalCustomerID, entitlement.FieldExternalSubscriptionID: + values[i] = new(sql.NullString) + case entitlement.FieldCreatedAt, entitlement.FieldUpdatedAt, entitlement.FieldDeletedAt, entitlement.FieldExpiresAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Entitlement fields. +func (e *Entitlement) 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 entitlement.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + e.ID = value.String + } + case entitlement.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + e.CreatedAt = value.Time + } + case entitlement.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + e.UpdatedAt = value.Time + } + case entitlement.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + e.CreatedBy = value.String + } + case entitlement.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + e.UpdatedBy = value.String + } + case entitlement.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + e.MappingID = value.String + } + case entitlement.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &e.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitlement.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + e.DeletedAt = value.Time + } + case entitlement.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + e.DeletedBy = value.String + } + case entitlement.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + e.OwnerID = value.String + } + case entitlement.FieldPlanID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field plan_id", values[i]) + } else if value.Valid { + e.PlanID = value.String + } + case entitlement.FieldOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field organization_id", values[i]) + } else if value.Valid { + e.OrganizationID = value.String + } + case entitlement.FieldExternalCustomerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field external_customer_id", values[i]) + } else if value.Valid { + e.ExternalCustomerID = value.String + } + case entitlement.FieldExternalSubscriptionID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field external_subscription_id", values[i]) + } else if value.Valid { + e.ExternalSubscriptionID = value.String + } + case entitlement.FieldExpires: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field expires", values[i]) + } else if value.Valid { + e.Expires = value.Bool + } + case entitlement.FieldExpiresAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field expires_at", values[i]) + } else if value.Valid { + e.ExpiresAt = new(time.Time) + *e.ExpiresAt = value.Time + } + case entitlement.FieldCancelled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field cancelled", values[i]) + } else if value.Valid { + e.Cancelled = value.Bool + } + default: + e.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Entitlement. +// This includes values selected through modifiers, order, etc. +func (e *Entitlement) Value(name string) (ent.Value, error) { + return e.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Entitlement entity. +func (e *Entitlement) QueryOwner() *OrganizationQuery { + return NewEntitlementClient(e.config).QueryOwner(e) +} + +// QueryPlan queries the "plan" edge of the Entitlement entity. +func (e *Entitlement) QueryPlan() *EntitlementPlanQuery { + return NewEntitlementClient(e.config).QueryPlan(e) +} + +// QueryOrganization queries the "organization" edge of the Entitlement entity. +func (e *Entitlement) QueryOrganization() *OrganizationQuery { + return NewEntitlementClient(e.config).QueryOrganization(e) +} + +// QueryEvents queries the "events" edge of the Entitlement entity. +func (e *Entitlement) QueryEvents() *EventQuery { + return NewEntitlementClient(e.config).QueryEvents(e) +} + +// Update returns a builder for updating this Entitlement. +// Note that you need to call Entitlement.Unwrap() before calling this method if this Entitlement +// was returned from a transaction, and the transaction was committed or rolled back. +func (e *Entitlement) Update() *EntitlementUpdateOne { + return NewEntitlementClient(e.config).UpdateOne(e) +} + +// Unwrap unwraps the Entitlement 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 (e *Entitlement) Unwrap() *Entitlement { + _tx, ok := e.config.driver.(*txDriver) + if !ok { + panic("generated: Entitlement is not a transactional entity") + } + e.config.driver = _tx.drv + return e +} + +// String implements the fmt.Stringer. +func (e *Entitlement) String() string { + var builder strings.Builder + builder.WriteString("Entitlement(") + builder.WriteString(fmt.Sprintf("id=%v, ", e.ID)) + builder.WriteString("created_at=") + builder.WriteString(e.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(e.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(e.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(e.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(e.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", e.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(e.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(e.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(e.OwnerID) + builder.WriteString(", ") + builder.WriteString("plan_id=") + builder.WriteString(e.PlanID) + builder.WriteString(", ") + builder.WriteString("organization_id=") + builder.WriteString(e.OrganizationID) + builder.WriteString(", ") + builder.WriteString("external_customer_id=") + builder.WriteString(e.ExternalCustomerID) + builder.WriteString(", ") + builder.WriteString("external_subscription_id=") + builder.WriteString(e.ExternalSubscriptionID) + builder.WriteString(", ") + builder.WriteString("expires=") + builder.WriteString(fmt.Sprintf("%v", e.Expires)) + builder.WriteString(", ") + if v := e.ExpiresAt; v != nil { + builder.WriteString("expires_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("cancelled=") + builder.WriteString(fmt.Sprintf("%v", e.Cancelled)) + builder.WriteByte(')') + return builder.String() +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Entitlement) NamedEvents(name string) ([]*Event, error) { + if e.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Entitlement) appendNamedEvents(name string, edges ...*Event) { + if e.Edges.namedEvents == nil { + e.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + e.Edges.namedEvents[name] = []*Event{} + } else { + e.Edges.namedEvents[name] = append(e.Edges.namedEvents[name], edges...) + } +} + +// Entitlements is a parsable slice of Entitlement. +type Entitlements []*Entitlement diff --git a/internal/ent/generated/entitlement/entitlement.go b/internal/ent/generated/entitlement/entitlement.go new file mode 100644 index 0000000..a4639e3 --- /dev/null +++ b/internal/ent/generated/entitlement/entitlement.go @@ -0,0 +1,302 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlement + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the entitlement type in the database. + Label = "entitlement" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldPlanID holds the string denoting the plan_id field in the database. + FieldPlanID = "plan_id" + // FieldOrganizationID holds the string denoting the organization_id field in the database. + FieldOrganizationID = "organization_id" + // FieldExternalCustomerID holds the string denoting the external_customer_id field in the database. + FieldExternalCustomerID = "external_customer_id" + // FieldExternalSubscriptionID holds the string denoting the external_subscription_id field in the database. + FieldExternalSubscriptionID = "external_subscription_id" + // FieldExpires holds the string denoting the expires field in the database. + FieldExpires = "expires" + // FieldExpiresAt holds the string denoting the expires_at field in the database. + FieldExpiresAt = "expires_at" + // FieldCancelled holds the string denoting the cancelled field in the database. + FieldCancelled = "cancelled" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgePlan holds the string denoting the plan edge name in mutations. + EdgePlan = "plan" + // EdgeOrganization holds the string denoting the organization edge name in mutations. + EdgeOrganization = "organization" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the entitlement in the database. + Table = "entitlements" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "entitlements" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // PlanTable is the table that holds the plan relation/edge. + PlanTable = "entitlements" + // PlanInverseTable is the table name for the EntitlementPlan entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplan" package. + PlanInverseTable = "entitlement_plans" + // PlanColumn is the table column denoting the plan relation/edge. + PlanColumn = "plan_id" + // OrganizationTable is the table that holds the organization relation/edge. + OrganizationTable = "entitlements" + // OrganizationInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationInverseTable = "organizations" + // OrganizationColumn is the table column denoting the organization relation/edge. + OrganizationColumn = "organization_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "entitlement_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for entitlement fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldPlanID, + FieldOrganizationID, + FieldExternalCustomerID, + FieldExternalSubscriptionID, + FieldExpires, + FieldExpiresAt, + FieldCancelled, +} + +var ( + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"entitlement_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // PlanIDValidator is a validator for the "plan_id" field. It is called by the builders before save. + PlanIDValidator func(string) error + // OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save. + OrganizationIDValidator func(string) error + // DefaultExpires holds the default value on creation for the "expires" field. + DefaultExpires bool + // DefaultCancelled holds the default value on creation for the "cancelled" field. + DefaultCancelled bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Entitlement queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByPlanID orders the results by the plan_id field. +func ByPlanID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPlanID, opts...).ToFunc() +} + +// ByOrganizationID orders the results by the organization_id field. +func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() +} + +// ByExternalCustomerID orders the results by the external_customer_id field. +func ByExternalCustomerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExternalCustomerID, opts...).ToFunc() +} + +// ByExternalSubscriptionID orders the results by the external_subscription_id field. +func ByExternalSubscriptionID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExternalSubscriptionID, opts...).ToFunc() +} + +// ByExpires orders the results by the expires field. +func ByExpires(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpires, opts...).ToFunc() +} + +// ByExpiresAt orders the results by the expires_at field. +func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpiresAt, opts...).ToFunc() +} + +// ByCancelled orders the results by the cancelled field. +func ByCancelled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCancelled, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByPlanField orders the results by plan field. +func ByPlanField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPlanStep(), sql.OrderByField(field, opts...)) + } +} + +// ByOrganizationField orders the results by organization field. +func ByOrganizationField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newPlanStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PlanInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, PlanTable, PlanColumn), + ) +} +func newOrganizationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OrganizationTable, OrganizationColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} diff --git a/internal/ent/generated/entitlement/where.go b/internal/ent/generated/entitlement/where.go new file mode 100644 index 0000000..79c5f51 --- /dev/null +++ b/internal/ent/generated/entitlement/where.go @@ -0,0 +1,1149 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlement + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldOwnerID, v)) +} + +// PlanID applies equality check predicate on the "plan_id" field. It's identical to PlanIDEQ. +func PlanID(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldPlanID, v)) +} + +// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ. +func OrganizationID(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldOrganizationID, v)) +} + +// ExternalCustomerID applies equality check predicate on the "external_customer_id" field. It's identical to ExternalCustomerIDEQ. +func ExternalCustomerID(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExternalCustomerID, v)) +} + +// ExternalSubscriptionID applies equality check predicate on the "external_subscription_id" field. It's identical to ExternalSubscriptionIDEQ. +func ExternalSubscriptionID(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExternalSubscriptionID, v)) +} + +// Expires applies equality check predicate on the "expires" field. It's identical to ExpiresEQ. +func Expires(v bool) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExpires, v)) +} + +// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ. +func ExpiresAt(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExpiresAt, v)) +} + +// Cancelled applies equality check predicate on the "cancelled" field. It's identical to CancelledEQ. +func Cancelled(v bool) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldCancelled, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// PlanIDEQ applies the EQ predicate on the "plan_id" field. +func PlanIDEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldPlanID, v)) +} + +// PlanIDNEQ applies the NEQ predicate on the "plan_id" field. +func PlanIDNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldPlanID, v)) +} + +// PlanIDIn applies the In predicate on the "plan_id" field. +func PlanIDIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldPlanID, vs...)) +} + +// PlanIDNotIn applies the NotIn predicate on the "plan_id" field. +func PlanIDNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldPlanID, vs...)) +} + +// PlanIDGT applies the GT predicate on the "plan_id" field. +func PlanIDGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldPlanID, v)) +} + +// PlanIDGTE applies the GTE predicate on the "plan_id" field. +func PlanIDGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldPlanID, v)) +} + +// PlanIDLT applies the LT predicate on the "plan_id" field. +func PlanIDLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldPlanID, v)) +} + +// PlanIDLTE applies the LTE predicate on the "plan_id" field. +func PlanIDLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldPlanID, v)) +} + +// PlanIDContains applies the Contains predicate on the "plan_id" field. +func PlanIDContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldPlanID, v)) +} + +// PlanIDHasPrefix applies the HasPrefix predicate on the "plan_id" field. +func PlanIDHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldPlanID, v)) +} + +// PlanIDHasSuffix applies the HasSuffix predicate on the "plan_id" field. +func PlanIDHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldPlanID, v)) +} + +// PlanIDEqualFold applies the EqualFold predicate on the "plan_id" field. +func PlanIDEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldPlanID, v)) +} + +// PlanIDContainsFold applies the ContainsFold predicate on the "plan_id" field. +func PlanIDContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldPlanID, v)) +} + +// OrganizationIDEQ applies the EQ predicate on the "organization_id" field. +func OrganizationIDEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldOrganizationID, v)) +} + +// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field. +func OrganizationIDNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldOrganizationID, v)) +} + +// OrganizationIDIn applies the In predicate on the "organization_id" field. +func OrganizationIDIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field. +func OrganizationIDNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDGT applies the GT predicate on the "organization_id" field. +func OrganizationIDGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldOrganizationID, v)) +} + +// OrganizationIDGTE applies the GTE predicate on the "organization_id" field. +func OrganizationIDGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldOrganizationID, v)) +} + +// OrganizationIDLT applies the LT predicate on the "organization_id" field. +func OrganizationIDLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldOrganizationID, v)) +} + +// OrganizationIDLTE applies the LTE predicate on the "organization_id" field. +func OrganizationIDLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldOrganizationID, v)) +} + +// OrganizationIDContains applies the Contains predicate on the "organization_id" field. +func OrganizationIDContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldOrganizationID, v)) +} + +// OrganizationIDHasPrefix applies the HasPrefix predicate on the "organization_id" field. +func OrganizationIDHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldOrganizationID, v)) +} + +// OrganizationIDHasSuffix applies the HasSuffix predicate on the "organization_id" field. +func OrganizationIDHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldOrganizationID, v)) +} + +// OrganizationIDEqualFold applies the EqualFold predicate on the "organization_id" field. +func OrganizationIDEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldOrganizationID, v)) +} + +// OrganizationIDContainsFold applies the ContainsFold predicate on the "organization_id" field. +func OrganizationIDContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldOrganizationID, v)) +} + +// ExternalCustomerIDEQ applies the EQ predicate on the "external_customer_id" field. +func ExternalCustomerIDEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDNEQ applies the NEQ predicate on the "external_customer_id" field. +func ExternalCustomerIDNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDIn applies the In predicate on the "external_customer_id" field. +func ExternalCustomerIDIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldExternalCustomerID, vs...)) +} + +// ExternalCustomerIDNotIn applies the NotIn predicate on the "external_customer_id" field. +func ExternalCustomerIDNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldExternalCustomerID, vs...)) +} + +// ExternalCustomerIDGT applies the GT predicate on the "external_customer_id" field. +func ExternalCustomerIDGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDGTE applies the GTE predicate on the "external_customer_id" field. +func ExternalCustomerIDGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDLT applies the LT predicate on the "external_customer_id" field. +func ExternalCustomerIDLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDLTE applies the LTE predicate on the "external_customer_id" field. +func ExternalCustomerIDLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDContains applies the Contains predicate on the "external_customer_id" field. +func ExternalCustomerIDContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDHasPrefix applies the HasPrefix predicate on the "external_customer_id" field. +func ExternalCustomerIDHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDHasSuffix applies the HasSuffix predicate on the "external_customer_id" field. +func ExternalCustomerIDHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDIsNil applies the IsNil predicate on the "external_customer_id" field. +func ExternalCustomerIDIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldExternalCustomerID)) +} + +// ExternalCustomerIDNotNil applies the NotNil predicate on the "external_customer_id" field. +func ExternalCustomerIDNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldExternalCustomerID)) +} + +// ExternalCustomerIDEqualFold applies the EqualFold predicate on the "external_customer_id" field. +func ExternalCustomerIDEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDContainsFold applies the ContainsFold predicate on the "external_customer_id" field. +func ExternalCustomerIDContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldExternalCustomerID, v)) +} + +// ExternalSubscriptionIDEQ applies the EQ predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDNEQ applies the NEQ predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDNEQ(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDIn applies the In predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldExternalSubscriptionID, vs...)) +} + +// ExternalSubscriptionIDNotIn applies the NotIn predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDNotIn(vs ...string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldExternalSubscriptionID, vs...)) +} + +// ExternalSubscriptionIDGT applies the GT predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDGT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDGTE applies the GTE predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDGTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDLT applies the LT predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDLT(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDLTE applies the LTE predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDLTE(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDContains applies the Contains predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDContains(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContains(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDHasPrefix applies the HasPrefix predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDHasPrefix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasPrefix(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDHasSuffix applies the HasSuffix predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDHasSuffix(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldHasSuffix(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDIsNil applies the IsNil predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldExternalSubscriptionID)) +} + +// ExternalSubscriptionIDNotNil applies the NotNil predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldExternalSubscriptionID)) +} + +// ExternalSubscriptionIDEqualFold applies the EqualFold predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDEqualFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEqualFold(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDContainsFold applies the ContainsFold predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDContainsFold(v string) predicate.Entitlement { + return predicate.Entitlement(sql.FieldContainsFold(FieldExternalSubscriptionID, v)) +} + +// ExpiresEQ applies the EQ predicate on the "expires" field. +func ExpiresEQ(v bool) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExpires, v)) +} + +// ExpiresNEQ applies the NEQ predicate on the "expires" field. +func ExpiresNEQ(v bool) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldExpires, v)) +} + +// ExpiresAtEQ applies the EQ predicate on the "expires_at" field. +func ExpiresAtEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldExpiresAt, v)) +} + +// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field. +func ExpiresAtNEQ(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldExpiresAt, v)) +} + +// ExpiresAtIn applies the In predicate on the "expires_at" field. +func ExpiresAtIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field. +func ExpiresAtNotIn(vs ...time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtGT applies the GT predicate on the "expires_at" field. +func ExpiresAtGT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGT(FieldExpiresAt, v)) +} + +// ExpiresAtGTE applies the GTE predicate on the "expires_at" field. +func ExpiresAtGTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldGTE(FieldExpiresAt, v)) +} + +// ExpiresAtLT applies the LT predicate on the "expires_at" field. +func ExpiresAtLT(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLT(FieldExpiresAt, v)) +} + +// ExpiresAtLTE applies the LTE predicate on the "expires_at" field. +func ExpiresAtLTE(v time.Time) predicate.Entitlement { + return predicate.Entitlement(sql.FieldLTE(FieldExpiresAt, v)) +} + +// ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field. +func ExpiresAtIsNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldIsNull(FieldExpiresAt)) +} + +// ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field. +func ExpiresAtNotNil() predicate.Entitlement { + return predicate.Entitlement(sql.FieldNotNull(FieldExpiresAt)) +} + +// CancelledEQ applies the EQ predicate on the "cancelled" field. +func CancelledEQ(v bool) predicate.Entitlement { + return predicate.Entitlement(sql.FieldEQ(FieldCancelled, v)) +} + +// CancelledNEQ applies the NEQ predicate on the "cancelled" field. +func CancelledNEQ(v bool) predicate.Entitlement { + return predicate.Entitlement(sql.FieldNEQ(FieldCancelled, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasPlan applies the HasEdge predicate on the "plan" edge. +func HasPlan() predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, PlanTable, PlanColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPlanWith applies the HasEdge predicate on the "plan" edge with a given conditions (other predicates). +func HasPlanWith(preds ...predicate.EntitlementPlan) predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := newPlanStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrganization applies the HasEdge predicate on the "organization" edge. +func HasOrganization() predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OrganizationTable, OrganizationColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationWith applies the HasEdge predicate on the "organization" edge with a given conditions (other predicates). +func HasOrganizationWith(preds ...predicate.Organization) predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := newOrganizationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Entitlement { + return predicate.Entitlement(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementEvents + 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.Entitlement) predicate.Entitlement { + return predicate.Entitlement(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Entitlement) predicate.Entitlement { + return predicate.Entitlement(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Entitlement) predicate.Entitlement { + return predicate.Entitlement(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitlement_create.go b/internal/ent/generated/entitlement_create.go new file mode 100644 index 0000000..f461271 --- /dev/null +++ b/internal/ent/generated/entitlement_create.go @@ -0,0 +1,632 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntitlementCreate is the builder for creating a Entitlement entity. +type EntitlementCreate struct { + config + mutation *EntitlementMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (ec *EntitlementCreate) SetCreatedAt(t time.Time) *EntitlementCreate { + ec.mutation.SetCreatedAt(t) + return ec +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableCreatedAt(t *time.Time) *EntitlementCreate { + if t != nil { + ec.SetCreatedAt(*t) + } + return ec +} + +// SetUpdatedAt sets the "updated_at" field. +func (ec *EntitlementCreate) SetUpdatedAt(t time.Time) *EntitlementCreate { + ec.mutation.SetUpdatedAt(t) + return ec +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementCreate { + if t != nil { + ec.SetUpdatedAt(*t) + } + return ec +} + +// SetCreatedBy sets the "created_by" field. +func (ec *EntitlementCreate) SetCreatedBy(s string) *EntitlementCreate { + ec.mutation.SetCreatedBy(s) + return ec +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableCreatedBy(s *string) *EntitlementCreate { + if s != nil { + ec.SetCreatedBy(*s) + } + return ec +} + +// SetUpdatedBy sets the "updated_by" field. +func (ec *EntitlementCreate) SetUpdatedBy(s string) *EntitlementCreate { + ec.mutation.SetUpdatedBy(s) + return ec +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableUpdatedBy(s *string) *EntitlementCreate { + if s != nil { + ec.SetUpdatedBy(*s) + } + return ec +} + +// SetMappingID sets the "mapping_id" field. +func (ec *EntitlementCreate) SetMappingID(s string) *EntitlementCreate { + ec.mutation.SetMappingID(s) + return ec +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableMappingID(s *string) *EntitlementCreate { + if s != nil { + ec.SetMappingID(*s) + } + return ec +} + +// SetTags sets the "tags" field. +func (ec *EntitlementCreate) SetTags(s []string) *EntitlementCreate { + ec.mutation.SetTags(s) + return ec +} + +// SetDeletedAt sets the "deleted_at" field. +func (ec *EntitlementCreate) SetDeletedAt(t time.Time) *EntitlementCreate { + ec.mutation.SetDeletedAt(t) + return ec +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableDeletedAt(t *time.Time) *EntitlementCreate { + if t != nil { + ec.SetDeletedAt(*t) + } + return ec +} + +// SetDeletedBy sets the "deleted_by" field. +func (ec *EntitlementCreate) SetDeletedBy(s string) *EntitlementCreate { + ec.mutation.SetDeletedBy(s) + return ec +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableDeletedBy(s *string) *EntitlementCreate { + if s != nil { + ec.SetDeletedBy(*s) + } + return ec +} + +// SetOwnerID sets the "owner_id" field. +func (ec *EntitlementCreate) SetOwnerID(s string) *EntitlementCreate { + ec.mutation.SetOwnerID(s) + return ec +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableOwnerID(s *string) *EntitlementCreate { + if s != nil { + ec.SetOwnerID(*s) + } + return ec +} + +// SetPlanID sets the "plan_id" field. +func (ec *EntitlementCreate) SetPlanID(s string) *EntitlementCreate { + ec.mutation.SetPlanID(s) + return ec +} + +// SetOrganizationID sets the "organization_id" field. +func (ec *EntitlementCreate) SetOrganizationID(s string) *EntitlementCreate { + ec.mutation.SetOrganizationID(s) + return ec +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (ec *EntitlementCreate) SetExternalCustomerID(s string) *EntitlementCreate { + ec.mutation.SetExternalCustomerID(s) + return ec +} + +// SetNillableExternalCustomerID sets the "external_customer_id" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableExternalCustomerID(s *string) *EntitlementCreate { + if s != nil { + ec.SetExternalCustomerID(*s) + } + return ec +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (ec *EntitlementCreate) SetExternalSubscriptionID(s string) *EntitlementCreate { + ec.mutation.SetExternalSubscriptionID(s) + return ec +} + +// SetNillableExternalSubscriptionID sets the "external_subscription_id" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableExternalSubscriptionID(s *string) *EntitlementCreate { + if s != nil { + ec.SetExternalSubscriptionID(*s) + } + return ec +} + +// SetExpires sets the "expires" field. +func (ec *EntitlementCreate) SetExpires(b bool) *EntitlementCreate { + ec.mutation.SetExpires(b) + return ec +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableExpires(b *bool) *EntitlementCreate { + if b != nil { + ec.SetExpires(*b) + } + return ec +} + +// SetExpiresAt sets the "expires_at" field. +func (ec *EntitlementCreate) SetExpiresAt(t time.Time) *EntitlementCreate { + ec.mutation.SetExpiresAt(t) + return ec +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableExpiresAt(t *time.Time) *EntitlementCreate { + if t != nil { + ec.SetExpiresAt(*t) + } + return ec +} + +// SetCancelled sets the "cancelled" field. +func (ec *EntitlementCreate) SetCancelled(b bool) *EntitlementCreate { + ec.mutation.SetCancelled(b) + return ec +} + +// SetNillableCancelled sets the "cancelled" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableCancelled(b *bool) *EntitlementCreate { + if b != nil { + ec.SetCancelled(*b) + } + return ec +} + +// SetID sets the "id" field. +func (ec *EntitlementCreate) SetID(s string) *EntitlementCreate { + ec.mutation.SetID(s) + return ec +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ec *EntitlementCreate) SetNillableID(s *string) *EntitlementCreate { + if s != nil { + ec.SetID(*s) + } + return ec +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (ec *EntitlementCreate) SetOwner(o *Organization) *EntitlementCreate { + return ec.SetOwnerID(o.ID) +} + +// SetPlan sets the "plan" edge to the EntitlementPlan entity. +func (ec *EntitlementCreate) SetPlan(e *EntitlementPlan) *EntitlementCreate { + return ec.SetPlanID(e.ID) +} + +// SetOrganization sets the "organization" edge to the Organization entity. +func (ec *EntitlementCreate) SetOrganization(o *Organization) *EntitlementCreate { + return ec.SetOrganizationID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (ec *EntitlementCreate) AddEventIDs(ids ...string) *EntitlementCreate { + ec.mutation.AddEventIDs(ids...) + return ec +} + +// AddEvents adds the "events" edges to the Event entity. +func (ec *EntitlementCreate) AddEvents(e ...*Event) *EntitlementCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ec.AddEventIDs(ids...) +} + +// Mutation returns the EntitlementMutation object of the builder. +func (ec *EntitlementCreate) Mutation() *EntitlementMutation { + return ec.mutation +} + +// Save creates the Entitlement in the database. +func (ec *EntitlementCreate) Save(ctx context.Context) (*Entitlement, error) { + if err := ec.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ec.sqlSave, ec.mutation, ec.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ec *EntitlementCreate) SaveX(ctx context.Context) *Entitlement { + v, err := ec.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ec *EntitlementCreate) Exec(ctx context.Context) error { + _, err := ec.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ec *EntitlementCreate) ExecX(ctx context.Context) { + if err := ec.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ec *EntitlementCreate) defaults() error { + if _, ok := ec.mutation.CreatedAt(); !ok { + if entitlement.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlement.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitlement.DefaultCreatedAt() + ec.mutation.SetCreatedAt(v) + } + if _, ok := ec.mutation.UpdatedAt(); !ok { + if entitlement.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlement.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlement.DefaultUpdatedAt() + ec.mutation.SetUpdatedAt(v) + } + if _, ok := ec.mutation.MappingID(); !ok { + if entitlement.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitlement.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitlement.DefaultMappingID() + ec.mutation.SetMappingID(v) + } + if _, ok := ec.mutation.Tags(); !ok { + v := entitlement.DefaultTags + ec.mutation.SetTags(v) + } + if _, ok := ec.mutation.Expires(); !ok { + v := entitlement.DefaultExpires + ec.mutation.SetExpires(v) + } + if _, ok := ec.mutation.Cancelled(); !ok { + v := entitlement.DefaultCancelled + ec.mutation.SetCancelled(v) + } + if _, ok := ec.mutation.ID(); !ok { + if entitlement.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitlement.DefaultID (forgotten import generated/runtime?)") + } + v := entitlement.DefaultID() + ec.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ec *EntitlementCreate) check() error { + if _, ok := ec.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Entitlement.mapping_id"`)} + } + if v, ok := ec.mutation.OwnerID(); ok { + if err := entitlement.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Entitlement.owner_id": %w`, err)} + } + } + if _, ok := ec.mutation.PlanID(); !ok { + return &ValidationError{Name: "plan_id", err: errors.New(`generated: missing required field "Entitlement.plan_id"`)} + } + if v, ok := ec.mutation.PlanID(); ok { + if err := entitlement.PlanIDValidator(v); err != nil { + return &ValidationError{Name: "plan_id", err: fmt.Errorf(`generated: validator failed for field "Entitlement.plan_id": %w`, err)} + } + } + if _, ok := ec.mutation.OrganizationID(); !ok { + return &ValidationError{Name: "organization_id", err: errors.New(`generated: missing required field "Entitlement.organization_id"`)} + } + if v, ok := ec.mutation.OrganizationID(); ok { + if err := entitlement.OrganizationIDValidator(v); err != nil { + return &ValidationError{Name: "organization_id", err: fmt.Errorf(`generated: validator failed for field "Entitlement.organization_id": %w`, err)} + } + } + if _, ok := ec.mutation.Expires(); !ok { + return &ValidationError{Name: "expires", err: errors.New(`generated: missing required field "Entitlement.expires"`)} + } + if _, ok := ec.mutation.Cancelled(); !ok { + return &ValidationError{Name: "cancelled", err: errors.New(`generated: missing required field "Entitlement.cancelled"`)} + } + if len(ec.mutation.PlanIDs()) == 0 { + return &ValidationError{Name: "plan", err: errors.New(`generated: missing required edge "Entitlement.plan"`)} + } + if len(ec.mutation.OrganizationIDs()) == 0 { + return &ValidationError{Name: "organization", err: errors.New(`generated: missing required edge "Entitlement.organization"`)} + } + return nil +} + +func (ec *EntitlementCreate) sqlSave(ctx context.Context) (*Entitlement, error) { + if err := ec.check(); err != nil { + return nil, err + } + _node, _spec := ec.createSpec() + if err := sqlgraph.CreateNode(ctx, ec.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Entitlement.ID type: %T", _spec.ID.Value) + } + } + ec.mutation.id = &_node.ID + ec.mutation.done = true + return _node, nil +} + +func (ec *EntitlementCreate) createSpec() (*Entitlement, *sqlgraph.CreateSpec) { + var ( + _node = &Entitlement{config: ec.config} + _spec = sqlgraph.NewCreateSpec(entitlement.Table, sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString)) + ) + _spec.Schema = ec.schemaConfig.Entitlement + if id, ok := ec.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ec.mutation.CreatedAt(); ok { + _spec.SetField(entitlement.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ec.mutation.UpdatedAt(); ok { + _spec.SetField(entitlement.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ec.mutation.CreatedBy(); ok { + _spec.SetField(entitlement.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ec.mutation.UpdatedBy(); ok { + _spec.SetField(entitlement.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ec.mutation.MappingID(); ok { + _spec.SetField(entitlement.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ec.mutation.Tags(); ok { + _spec.SetField(entitlement.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ec.mutation.DeletedAt(); ok { + _spec.SetField(entitlement.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ec.mutation.DeletedBy(); ok { + _spec.SetField(entitlement.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ec.mutation.ExternalCustomerID(); ok { + _spec.SetField(entitlement.FieldExternalCustomerID, field.TypeString, value) + _node.ExternalCustomerID = value + } + if value, ok := ec.mutation.ExternalSubscriptionID(); ok { + _spec.SetField(entitlement.FieldExternalSubscriptionID, field.TypeString, value) + _node.ExternalSubscriptionID = value + } + if value, ok := ec.mutation.Expires(); ok { + _spec.SetField(entitlement.FieldExpires, field.TypeBool, value) + _node.Expires = value + } + if value, ok := ec.mutation.ExpiresAt(); ok { + _spec.SetField(entitlement.FieldExpiresAt, field.TypeTime, value) + _node.ExpiresAt = &value + } + if value, ok := ec.mutation.Cancelled(); ok { + _spec.SetField(entitlement.FieldCancelled, field.TypeBool, value) + _node.Cancelled = value + } + if nodes := ec.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OwnerTable, + Columns: []string{entitlement.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.PlanIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.PlanTable, + Columns: []string{entitlement.PlanColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.PlanID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OrganizationTable, + Columns: []string{entitlement.OrganizationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OrganizationID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// EntitlementCreateBulk is the builder for creating many Entitlement entities in bulk. +type EntitlementCreateBulk struct { + config + err error + builders []*EntitlementCreate +} + +// Save creates the Entitlement entities in the database. +func (ecb *EntitlementCreateBulk) Save(ctx context.Context) ([]*Entitlement, error) { + if ecb.err != nil { + return nil, ecb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ecb.builders)) + nodes := make([]*Entitlement, len(ecb.builders)) + mutators := make([]Mutator, len(ecb.builders)) + for i := range ecb.builders { + func(i int, root context.Context) { + builder := ecb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntitlementMutation) + 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, ecb.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, ecb.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, ecb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ecb *EntitlementCreateBulk) SaveX(ctx context.Context) []*Entitlement { + v, err := ecb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ecb *EntitlementCreateBulk) Exec(ctx context.Context) error { + _, err := ecb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ecb *EntitlementCreateBulk) ExecX(ctx context.Context) { + if err := ecb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlement_delete.go b/internal/ent/generated/entitlement_delete.go new file mode 100644 index 0000000..42e07cf --- /dev/null +++ b/internal/ent/generated/entitlement_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementDelete is the builder for deleting a Entitlement entity. +type EntitlementDelete struct { + config + hooks []Hook + mutation *EntitlementMutation +} + +// Where appends a list predicates to the EntitlementDelete builder. +func (ed *EntitlementDelete) Where(ps ...predicate.Entitlement) *EntitlementDelete { + ed.mutation.Where(ps...) + return ed +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ed *EntitlementDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ed.sqlExec, ed.mutation, ed.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ed *EntitlementDelete) ExecX(ctx context.Context) int { + n, err := ed.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ed *EntitlementDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitlement.Table, sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString)) + _spec.Node.Schema = ed.schemaConfig.Entitlement + ctx = internal.NewSchemaConfigContext(ctx, ed.schemaConfig) + if ps := ed.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ed.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ed.mutation.done = true + return affected, err +} + +// EntitlementDeleteOne is the builder for deleting a single Entitlement entity. +type EntitlementDeleteOne struct { + ed *EntitlementDelete +} + +// Where appends a list predicates to the EntitlementDelete builder. +func (edo *EntitlementDeleteOne) Where(ps ...predicate.Entitlement) *EntitlementDeleteOne { + edo.ed.mutation.Where(ps...) + return edo +} + +// Exec executes the deletion query. +func (edo *EntitlementDeleteOne) Exec(ctx context.Context) error { + n, err := edo.ed.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitlement.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (edo *EntitlementDeleteOne) ExecX(ctx context.Context) { + if err := edo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlement_query.go b/internal/ent/generated/entitlement_query.go new file mode 100644 index 0000000..366050d --- /dev/null +++ b/internal/ent/generated/entitlement_query.go @@ -0,0 +1,925 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementQuery is the builder for querying Entitlement entities. +type EntitlementQuery struct { + config + ctx *QueryContext + order []entitlement.OrderOption + inters []Interceptor + predicates []predicate.Entitlement + withOwner *OrganizationQuery + withPlan *EntitlementPlanQuery + withOrganization *OrganizationQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Entitlement) error + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntitlementQuery builder. +func (eq *EntitlementQuery) Where(ps ...predicate.Entitlement) *EntitlementQuery { + eq.predicates = append(eq.predicates, ps...) + return eq +} + +// Limit the number of records to be returned by this query. +func (eq *EntitlementQuery) Limit(limit int) *EntitlementQuery { + eq.ctx.Limit = &limit + return eq +} + +// Offset to start from. +func (eq *EntitlementQuery) Offset(offset int) *EntitlementQuery { + eq.ctx.Offset = &offset + return eq +} + +// 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 (eq *EntitlementQuery) Unique(unique bool) *EntitlementQuery { + eq.ctx.Unique = &unique + return eq +} + +// Order specifies how the records should be ordered. +func (eq *EntitlementQuery) Order(o ...entitlement.OrderOption) *EntitlementQuery { + eq.order = append(eq.order, o...) + return eq +} + +// QueryOwner chains the current query on the "owner" edge. +func (eq *EntitlementQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlement.OwnerTable, entitlement.OwnerColumn), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryPlan chains the current query on the "plan" edge. +func (eq *EntitlementQuery) QueryPlan() *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, selector), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlement.PlanTable, entitlement.PlanColumn), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.Entitlement + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrganization chains the current query on the "organization" edge. +func (eq *EntitlementQuery) QueryOrganization() *OrganizationQuery { + query := (&OrganizationClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlement.OrganizationTable, entitlement.OrganizationColumn), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entitlement + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (eq *EntitlementQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlement.Table, entitlement.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entitlement.EventsTable, entitlement.EventsPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Entitlement entity from the query. +// Returns a *NotFoundError when no Entitlement was found. +func (eq *EntitlementQuery) First(ctx context.Context) (*Entitlement, error) { + nodes, err := eq.Limit(1).All(setContextOp(ctx, eq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitlement.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (eq *EntitlementQuery) FirstX(ctx context.Context) *Entitlement { + node, err := eq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Entitlement ID from the query. +// Returns a *NotFoundError when no Entitlement ID was found. +func (eq *EntitlementQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = eq.Limit(1).IDs(setContextOp(ctx, eq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitlement.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (eq *EntitlementQuery) FirstIDX(ctx context.Context) string { + id, err := eq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Entitlement entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Entitlement entity is found. +// Returns a *NotFoundError when no Entitlement entities are found. +func (eq *EntitlementQuery) Only(ctx context.Context) (*Entitlement, error) { + nodes, err := eq.Limit(2).All(setContextOp(ctx, eq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitlement.Label} + default: + return nil, &NotSingularError{entitlement.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (eq *EntitlementQuery) OnlyX(ctx context.Context) *Entitlement { + node, err := eq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Entitlement ID in the query. +// Returns a *NotSingularError when more than one Entitlement ID is found. +// Returns a *NotFoundError when no entities are found. +func (eq *EntitlementQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = eq.Limit(2).IDs(setContextOp(ctx, eq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitlement.Label} + default: + err = &NotSingularError{entitlement.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (eq *EntitlementQuery) OnlyIDX(ctx context.Context) string { + id, err := eq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Entitlements. +func (eq *EntitlementQuery) All(ctx context.Context) ([]*Entitlement, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryAll) + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Entitlement, *EntitlementQuery]() + return withInterceptors[[]*Entitlement](ctx, eq, qr, eq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (eq *EntitlementQuery) AllX(ctx context.Context) []*Entitlement { + nodes, err := eq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Entitlement IDs. +func (eq *EntitlementQuery) IDs(ctx context.Context) (ids []string, err error) { + if eq.ctx.Unique == nil && eq.path != nil { + eq.Unique(true) + } + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryIDs) + if err = eq.Select(entitlement.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (eq *EntitlementQuery) IDsX(ctx context.Context) []string { + ids, err := eq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (eq *EntitlementQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryCount) + if err := eq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, eq, querierCount[*EntitlementQuery](), eq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (eq *EntitlementQuery) CountX(ctx context.Context) int { + count, err := eq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (eq *EntitlementQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryExist) + switch _, err := eq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (eq *EntitlementQuery) ExistX(ctx context.Context) bool { + exist, err := eq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntitlementQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (eq *EntitlementQuery) Clone() *EntitlementQuery { + if eq == nil { + return nil + } + return &EntitlementQuery{ + config: eq.config, + ctx: eq.ctx.Clone(), + order: append([]entitlement.OrderOption{}, eq.order...), + inters: append([]Interceptor{}, eq.inters...), + predicates: append([]predicate.Entitlement{}, eq.predicates...), + withOwner: eq.withOwner.Clone(), + withPlan: eq.withPlan.Clone(), + withOrganization: eq.withOrganization.Clone(), + withEvents: eq.withEvents.Clone(), + // clone intermediate query. + sql: eq.sql.Clone(), + path: eq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntitlementQuery) WithOwner(opts ...func(*OrganizationQuery)) *EntitlementQuery { + query := (&OrganizationClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withOwner = query + return eq +} + +// WithPlan tells the query-builder to eager-load the nodes that are connected to +// the "plan" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntitlementQuery) WithPlan(opts ...func(*EntitlementPlanQuery)) *EntitlementQuery { + query := (&EntitlementPlanClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withPlan = query + return eq +} + +// WithOrganization tells the query-builder to eager-load the nodes that are connected to +// the "organization" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntitlementQuery) WithOrganization(opts ...func(*OrganizationQuery)) *EntitlementQuery { + query := (&OrganizationClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withOrganization = query + return eq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntitlementQuery) WithEvents(opts ...func(*EventQuery)) *EntitlementQuery { + query := (&EventClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withEvents = query + return eq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Entitlement.Query(). +// GroupBy(entitlement.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (eq *EntitlementQuery) GroupBy(field string, fields ...string) *EntitlementGroupBy { + eq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntitlementGroupBy{build: eq} + grbuild.flds = &eq.ctx.Fields + grbuild.label = entitlement.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Entitlement.Query(). +// Select(entitlement.FieldCreatedAt). +// Scan(ctx, &v) +func (eq *EntitlementQuery) Select(fields ...string) *EntitlementSelect { + eq.ctx.Fields = append(eq.ctx.Fields, fields...) + sbuild := &EntitlementSelect{EntitlementQuery: eq} + sbuild.label = entitlement.Label + sbuild.flds, sbuild.scan = &eq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntitlementSelect configured with the given aggregations. +func (eq *EntitlementQuery) Aggregate(fns ...AggregateFunc) *EntitlementSelect { + return eq.Select().Aggregate(fns...) +} + +func (eq *EntitlementQuery) prepareQuery(ctx context.Context) error { + for _, inter := range eq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, eq); err != nil { + return err + } + } + } + for _, f := range eq.ctx.Fields { + if !entitlement.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if eq.path != nil { + prev, err := eq.path(ctx) + if err != nil { + return err + } + eq.sql = prev + } + if entitlement.Policy == nil { + return errors.New("generated: uninitialized entitlement.Policy (forgotten import generated/runtime?)") + } + if err := entitlement.Policy.EvalQuery(ctx, eq); err != nil { + return err + } + return nil +} + +func (eq *EntitlementQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Entitlement, error) { + var ( + nodes = []*Entitlement{} + _spec = eq.querySpec() + loadedTypes = [4]bool{ + eq.withOwner != nil, + eq.withPlan != nil, + eq.withOrganization != nil, + eq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Entitlement).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Entitlement{config: eq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = eq.schemaConfig.Entitlement + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + if len(eq.modifiers) > 0 { + _spec.Modifiers = eq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, eq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := eq.withOwner; query != nil { + if err := eq.loadOwner(ctx, query, nodes, nil, + func(n *Entitlement, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := eq.withPlan; query != nil { + if err := eq.loadPlan(ctx, query, nodes, nil, + func(n *Entitlement, e *EntitlementPlan) { n.Edges.Plan = e }); err != nil { + return nil, err + } + } + if query := eq.withOrganization; query != nil { + if err := eq.loadOrganization(ctx, query, nodes, nil, + func(n *Entitlement, e *Organization) { n.Edges.Organization = e }); err != nil { + return nil, err + } + } + if query := eq.withEvents; query != nil { + if err := eq.loadEvents(ctx, query, nodes, + func(n *Entitlement) { n.Edges.Events = []*Event{} }, + func(n *Entitlement, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedEvents { + if err := eq.loadEvents(ctx, query, nodes, + func(n *Entitlement) { n.appendNamedEvents(name) }, + func(n *Entitlement, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range eq.loadTotal { + if err := eq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (eq *EntitlementQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Entitlement, init func(*Entitlement), assign func(*Entitlement, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Entitlement) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (eq *EntitlementQuery) loadPlan(ctx context.Context, query *EntitlementPlanQuery, nodes []*Entitlement, init func(*Entitlement), assign func(*Entitlement, *EntitlementPlan)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Entitlement) + for i := range nodes { + fk := nodes[i].PlanID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(entitlementplan.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 "plan_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (eq *EntitlementQuery) loadOrganization(ctx context.Context, query *OrganizationQuery, nodes []*Entitlement, init func(*Entitlement), assign func(*Entitlement, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Entitlement) + for i := range nodes { + fk := nodes[i].OrganizationID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "organization_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (eq *EntitlementQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Entitlement, init func(*Entitlement), assign func(*Entitlement, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Entitlement) + nids := make(map[string]map[*Entitlement]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(entitlement.EventsTable) + joinT.Schema(eq.schemaConfig.EntitlementEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(entitlement.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(entitlement.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(entitlement.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Entitlement]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (eq *EntitlementQuery) sqlCount(ctx context.Context) (int, error) { + _spec := eq.querySpec() + _spec.Node.Schema = eq.schemaConfig.Entitlement + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + if len(eq.modifiers) > 0 { + _spec.Modifiers = eq.modifiers + } + _spec.Node.Columns = eq.ctx.Fields + if len(eq.ctx.Fields) > 0 { + _spec.Unique = eq.ctx.Unique != nil && *eq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, eq.driver, _spec) +} + +func (eq *EntitlementQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitlement.Table, entitlement.Columns, sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString)) + _spec.From = eq.sql + if unique := eq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if eq.path != nil { + _spec.Unique = true + } + if fields := eq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlement.FieldID) + for i := range fields { + if fields[i] != entitlement.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if eq.withOwner != nil { + _spec.Node.AddColumnOnce(entitlement.FieldOwnerID) + } + if eq.withPlan != nil { + _spec.Node.AddColumnOnce(entitlement.FieldPlanID) + } + if eq.withOrganization != nil { + _spec.Node.AddColumnOnce(entitlement.FieldOrganizationID) + } + } + if ps := eq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := eq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := eq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := eq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (eq *EntitlementQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(eq.driver.Dialect()) + t1 := builder.Table(entitlement.Table) + columns := eq.ctx.Fields + if len(columns) == 0 { + columns = entitlement.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if eq.sql != nil { + selector = eq.sql + selector.Select(selector.Columns(columns...)...) + } + if eq.ctx.Unique != nil && *eq.ctx.Unique { + selector.Distinct() + } + t1.Schema(eq.schemaConfig.Entitlement) + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + selector.WithContext(ctx) + for _, p := range eq.predicates { + p(selector) + } + for _, p := range eq.order { + p(selector) + } + if offset := eq.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 := eq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EntitlementQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *EntitlementQuery { + query := (&EventClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedEvents == nil { + eq.withNamedEvents = make(map[string]*EventQuery) + } + eq.withNamedEvents[name] = query + return eq +} + +// EntitlementGroupBy is the group-by builder for Entitlement entities. +type EntitlementGroupBy struct { + selector + build *EntitlementQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (egb *EntitlementGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementGroupBy { + egb.fns = append(egb.fns, fns...) + return egb +} + +// Scan applies the selector query and scans the result into the given value. +func (egb *EntitlementGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, egb.build.ctx, ent.OpQueryGroupBy) + if err := egb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementQuery, *EntitlementGroupBy](ctx, egb.build, egb, egb.build.inters, v) +} + +func (egb *EntitlementGroupBy) sqlScan(ctx context.Context, root *EntitlementQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(egb.fns)) + for _, fn := range egb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*egb.flds)+len(egb.fns)) + for _, f := range *egb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*egb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := egb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntitlementSelect is the builder for selecting fields of Entitlement entities. +type EntitlementSelect struct { + *EntitlementQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (es *EntitlementSelect) Aggregate(fns ...AggregateFunc) *EntitlementSelect { + es.fns = append(es.fns, fns...) + return es +} + +// Scan applies the selector query and scans the result into the given value. +func (es *EntitlementSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, es.ctx, ent.OpQuerySelect) + if err := es.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementQuery, *EntitlementSelect](ctx, es.EntitlementQuery, es, es.inters, v) +} + +func (es *EntitlementSelect) sqlScan(ctx context.Context, root *EntitlementQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(es.fns)) + for _, fn := range es.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*es.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 := es.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitlement_update.go b/internal/ent/generated/entitlement_update.go new file mode 100644 index 0000000..b1e92a6 --- /dev/null +++ b/internal/ent/generated/entitlement_update.go @@ -0,0 +1,1031 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementUpdate is the builder for updating Entitlement entities. +type EntitlementUpdate struct { + config + hooks []Hook + mutation *EntitlementMutation +} + +// Where appends a list predicates to the EntitlementUpdate builder. +func (eu *EntitlementUpdate) Where(ps ...predicate.Entitlement) *EntitlementUpdate { + eu.mutation.Where(ps...) + return eu +} + +// SetUpdatedAt sets the "updated_at" field. +func (eu *EntitlementUpdate) SetUpdatedAt(t time.Time) *EntitlementUpdate { + eu.mutation.SetUpdatedAt(t) + return eu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (eu *EntitlementUpdate) ClearUpdatedAt() *EntitlementUpdate { + eu.mutation.ClearUpdatedAt() + return eu +} + +// SetUpdatedBy sets the "updated_by" field. +func (eu *EntitlementUpdate) SetUpdatedBy(s string) *EntitlementUpdate { + eu.mutation.SetUpdatedBy(s) + return eu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableUpdatedBy(s *string) *EntitlementUpdate { + if s != nil { + eu.SetUpdatedBy(*s) + } + return eu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (eu *EntitlementUpdate) ClearUpdatedBy() *EntitlementUpdate { + eu.mutation.ClearUpdatedBy() + return eu +} + +// SetTags sets the "tags" field. +func (eu *EntitlementUpdate) SetTags(s []string) *EntitlementUpdate { + eu.mutation.SetTags(s) + return eu +} + +// AppendTags appends s to the "tags" field. +func (eu *EntitlementUpdate) AppendTags(s []string) *EntitlementUpdate { + eu.mutation.AppendTags(s) + return eu +} + +// ClearTags clears the value of the "tags" field. +func (eu *EntitlementUpdate) ClearTags() *EntitlementUpdate { + eu.mutation.ClearTags() + return eu +} + +// SetDeletedAt sets the "deleted_at" field. +func (eu *EntitlementUpdate) SetDeletedAt(t time.Time) *EntitlementUpdate { + eu.mutation.SetDeletedAt(t) + return eu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementUpdate { + if t != nil { + eu.SetDeletedAt(*t) + } + return eu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (eu *EntitlementUpdate) ClearDeletedAt() *EntitlementUpdate { + eu.mutation.ClearDeletedAt() + return eu +} + +// SetDeletedBy sets the "deleted_by" field. +func (eu *EntitlementUpdate) SetDeletedBy(s string) *EntitlementUpdate { + eu.mutation.SetDeletedBy(s) + return eu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableDeletedBy(s *string) *EntitlementUpdate { + if s != nil { + eu.SetDeletedBy(*s) + } + return eu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (eu *EntitlementUpdate) ClearDeletedBy() *EntitlementUpdate { + eu.mutation.ClearDeletedBy() + return eu +} + +// SetOwnerID sets the "owner_id" field. +func (eu *EntitlementUpdate) SetOwnerID(s string) *EntitlementUpdate { + eu.mutation.SetOwnerID(s) + return eu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableOwnerID(s *string) *EntitlementUpdate { + if s != nil { + eu.SetOwnerID(*s) + } + return eu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (eu *EntitlementUpdate) ClearOwnerID() *EntitlementUpdate { + eu.mutation.ClearOwnerID() + return eu +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (eu *EntitlementUpdate) SetExternalCustomerID(s string) *EntitlementUpdate { + eu.mutation.SetExternalCustomerID(s) + return eu +} + +// SetNillableExternalCustomerID sets the "external_customer_id" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableExternalCustomerID(s *string) *EntitlementUpdate { + if s != nil { + eu.SetExternalCustomerID(*s) + } + return eu +} + +// ClearExternalCustomerID clears the value of the "external_customer_id" field. +func (eu *EntitlementUpdate) ClearExternalCustomerID() *EntitlementUpdate { + eu.mutation.ClearExternalCustomerID() + return eu +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (eu *EntitlementUpdate) SetExternalSubscriptionID(s string) *EntitlementUpdate { + eu.mutation.SetExternalSubscriptionID(s) + return eu +} + +// SetNillableExternalSubscriptionID sets the "external_subscription_id" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableExternalSubscriptionID(s *string) *EntitlementUpdate { + if s != nil { + eu.SetExternalSubscriptionID(*s) + } + return eu +} + +// ClearExternalSubscriptionID clears the value of the "external_subscription_id" field. +func (eu *EntitlementUpdate) ClearExternalSubscriptionID() *EntitlementUpdate { + eu.mutation.ClearExternalSubscriptionID() + return eu +} + +// SetExpires sets the "expires" field. +func (eu *EntitlementUpdate) SetExpires(b bool) *EntitlementUpdate { + eu.mutation.SetExpires(b) + return eu +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableExpires(b *bool) *EntitlementUpdate { + if b != nil { + eu.SetExpires(*b) + } + return eu +} + +// SetExpiresAt sets the "expires_at" field. +func (eu *EntitlementUpdate) SetExpiresAt(t time.Time) *EntitlementUpdate { + eu.mutation.SetExpiresAt(t) + return eu +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableExpiresAt(t *time.Time) *EntitlementUpdate { + if t != nil { + eu.SetExpiresAt(*t) + } + return eu +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (eu *EntitlementUpdate) ClearExpiresAt() *EntitlementUpdate { + eu.mutation.ClearExpiresAt() + return eu +} + +// SetCancelled sets the "cancelled" field. +func (eu *EntitlementUpdate) SetCancelled(b bool) *EntitlementUpdate { + eu.mutation.SetCancelled(b) + return eu +} + +// SetNillableCancelled sets the "cancelled" field if the given value is not nil. +func (eu *EntitlementUpdate) SetNillableCancelled(b *bool) *EntitlementUpdate { + if b != nil { + eu.SetCancelled(*b) + } + return eu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (eu *EntitlementUpdate) SetOwner(o *Organization) *EntitlementUpdate { + return eu.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (eu *EntitlementUpdate) AddEventIDs(ids ...string) *EntitlementUpdate { + eu.mutation.AddEventIDs(ids...) + return eu +} + +// AddEvents adds the "events" edges to the Event entity. +func (eu *EntitlementUpdate) AddEvents(e ...*Event) *EntitlementUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.AddEventIDs(ids...) +} + +// Mutation returns the EntitlementMutation object of the builder. +func (eu *EntitlementUpdate) Mutation() *EntitlementMutation { + return eu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (eu *EntitlementUpdate) ClearOwner() *EntitlementUpdate { + eu.mutation.ClearOwner() + return eu +} + +// ClearEvents clears all "events" edges to the Event entity. +func (eu *EntitlementUpdate) ClearEvents() *EntitlementUpdate { + eu.mutation.ClearEvents() + return eu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (eu *EntitlementUpdate) RemoveEventIDs(ids ...string) *EntitlementUpdate { + eu.mutation.RemoveEventIDs(ids...) + return eu +} + +// RemoveEvents removes "events" edges to Event entities. +func (eu *EntitlementUpdate) RemoveEvents(e ...*Event) *EntitlementUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (eu *EntitlementUpdate) Save(ctx context.Context) (int, error) { + if err := eu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, eu.sqlSave, eu.mutation, eu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (eu *EntitlementUpdate) SaveX(ctx context.Context) int { + affected, err := eu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (eu *EntitlementUpdate) Exec(ctx context.Context) error { + _, err := eu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (eu *EntitlementUpdate) ExecX(ctx context.Context) { + if err := eu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (eu *EntitlementUpdate) defaults() error { + if _, ok := eu.mutation.UpdatedAt(); !ok && !eu.mutation.UpdatedAtCleared() { + if entitlement.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlement.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlement.UpdateDefaultUpdatedAt() + eu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (eu *EntitlementUpdate) check() error { + if v, ok := eu.mutation.OwnerID(); ok { + if err := entitlement.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Entitlement.owner_id": %w`, err)} + } + } + if eu.mutation.PlanCleared() && len(eu.mutation.PlanIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Entitlement.plan"`) + } + if eu.mutation.OrganizationCleared() && len(eu.mutation.OrganizationIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Entitlement.organization"`) + } + return nil +} + +func (eu *EntitlementUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := eu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(entitlement.Table, entitlement.Columns, sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString)) + if ps := eu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if eu.mutation.CreatedAtCleared() { + _spec.ClearField(entitlement.FieldCreatedAt, field.TypeTime) + } + if value, ok := eu.mutation.UpdatedAt(); ok { + _spec.SetField(entitlement.FieldUpdatedAt, field.TypeTime, value) + } + if eu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlement.FieldUpdatedAt, field.TypeTime) + } + if eu.mutation.CreatedByCleared() { + _spec.ClearField(entitlement.FieldCreatedBy, field.TypeString) + } + if value, ok := eu.mutation.UpdatedBy(); ok { + _spec.SetField(entitlement.FieldUpdatedBy, field.TypeString, value) + } + if eu.mutation.UpdatedByCleared() { + _spec.ClearField(entitlement.FieldUpdatedBy, field.TypeString) + } + if value, ok := eu.mutation.Tags(); ok { + _spec.SetField(entitlement.FieldTags, field.TypeJSON, value) + } + if value, ok := eu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlement.FieldTags, value) + }) + } + if eu.mutation.TagsCleared() { + _spec.ClearField(entitlement.FieldTags, field.TypeJSON) + } + if value, ok := eu.mutation.DeletedAt(); ok { + _spec.SetField(entitlement.FieldDeletedAt, field.TypeTime, value) + } + if eu.mutation.DeletedAtCleared() { + _spec.ClearField(entitlement.FieldDeletedAt, field.TypeTime) + } + if value, ok := eu.mutation.DeletedBy(); ok { + _spec.SetField(entitlement.FieldDeletedBy, field.TypeString, value) + } + if eu.mutation.DeletedByCleared() { + _spec.ClearField(entitlement.FieldDeletedBy, field.TypeString) + } + if value, ok := eu.mutation.ExternalCustomerID(); ok { + _spec.SetField(entitlement.FieldExternalCustomerID, field.TypeString, value) + } + if eu.mutation.ExternalCustomerIDCleared() { + _spec.ClearField(entitlement.FieldExternalCustomerID, field.TypeString) + } + if value, ok := eu.mutation.ExternalSubscriptionID(); ok { + _spec.SetField(entitlement.FieldExternalSubscriptionID, field.TypeString, value) + } + if eu.mutation.ExternalSubscriptionIDCleared() { + _spec.ClearField(entitlement.FieldExternalSubscriptionID, field.TypeString) + } + if value, ok := eu.mutation.Expires(); ok { + _spec.SetField(entitlement.FieldExpires, field.TypeBool, value) + } + if value, ok := eu.mutation.ExpiresAt(); ok { + _spec.SetField(entitlement.FieldExpiresAt, field.TypeTime, value) + } + if eu.mutation.ExpiresAtCleared() { + _spec.ClearField(entitlement.FieldExpiresAt, field.TypeTime) + } + if value, ok := eu.mutation.Cancelled(); ok { + _spec.SetField(entitlement.FieldCancelled, field.TypeBool, value) + } + if eu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OwnerTable, + Columns: []string{entitlement.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OwnerTable, + Columns: []string{entitlement.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !eu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = eu.schemaConfig.Entitlement + ctx = internal.NewSchemaConfigContext(ctx, eu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, eu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlement.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + eu.mutation.done = true + return n, nil +} + +// EntitlementUpdateOne is the builder for updating a single Entitlement entity. +type EntitlementUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntitlementMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (euo *EntitlementUpdateOne) SetUpdatedAt(t time.Time) *EntitlementUpdateOne { + euo.mutation.SetUpdatedAt(t) + return euo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (euo *EntitlementUpdateOne) ClearUpdatedAt() *EntitlementUpdateOne { + euo.mutation.ClearUpdatedAt() + return euo +} + +// SetUpdatedBy sets the "updated_by" field. +func (euo *EntitlementUpdateOne) SetUpdatedBy(s string) *EntitlementUpdateOne { + euo.mutation.SetUpdatedBy(s) + return euo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableUpdatedBy(s *string) *EntitlementUpdateOne { + if s != nil { + euo.SetUpdatedBy(*s) + } + return euo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (euo *EntitlementUpdateOne) ClearUpdatedBy() *EntitlementUpdateOne { + euo.mutation.ClearUpdatedBy() + return euo +} + +// SetTags sets the "tags" field. +func (euo *EntitlementUpdateOne) SetTags(s []string) *EntitlementUpdateOne { + euo.mutation.SetTags(s) + return euo +} + +// AppendTags appends s to the "tags" field. +func (euo *EntitlementUpdateOne) AppendTags(s []string) *EntitlementUpdateOne { + euo.mutation.AppendTags(s) + return euo +} + +// ClearTags clears the value of the "tags" field. +func (euo *EntitlementUpdateOne) ClearTags() *EntitlementUpdateOne { + euo.mutation.ClearTags() + return euo +} + +// SetDeletedAt sets the "deleted_at" field. +func (euo *EntitlementUpdateOne) SetDeletedAt(t time.Time) *EntitlementUpdateOne { + euo.mutation.SetDeletedAt(t) + return euo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementUpdateOne { + if t != nil { + euo.SetDeletedAt(*t) + } + return euo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (euo *EntitlementUpdateOne) ClearDeletedAt() *EntitlementUpdateOne { + euo.mutation.ClearDeletedAt() + return euo +} + +// SetDeletedBy sets the "deleted_by" field. +func (euo *EntitlementUpdateOne) SetDeletedBy(s string) *EntitlementUpdateOne { + euo.mutation.SetDeletedBy(s) + return euo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableDeletedBy(s *string) *EntitlementUpdateOne { + if s != nil { + euo.SetDeletedBy(*s) + } + return euo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (euo *EntitlementUpdateOne) ClearDeletedBy() *EntitlementUpdateOne { + euo.mutation.ClearDeletedBy() + return euo +} + +// SetOwnerID sets the "owner_id" field. +func (euo *EntitlementUpdateOne) SetOwnerID(s string) *EntitlementUpdateOne { + euo.mutation.SetOwnerID(s) + return euo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableOwnerID(s *string) *EntitlementUpdateOne { + if s != nil { + euo.SetOwnerID(*s) + } + return euo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (euo *EntitlementUpdateOne) ClearOwnerID() *EntitlementUpdateOne { + euo.mutation.ClearOwnerID() + return euo +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (euo *EntitlementUpdateOne) SetExternalCustomerID(s string) *EntitlementUpdateOne { + euo.mutation.SetExternalCustomerID(s) + return euo +} + +// SetNillableExternalCustomerID sets the "external_customer_id" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableExternalCustomerID(s *string) *EntitlementUpdateOne { + if s != nil { + euo.SetExternalCustomerID(*s) + } + return euo +} + +// ClearExternalCustomerID clears the value of the "external_customer_id" field. +func (euo *EntitlementUpdateOne) ClearExternalCustomerID() *EntitlementUpdateOne { + euo.mutation.ClearExternalCustomerID() + return euo +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (euo *EntitlementUpdateOne) SetExternalSubscriptionID(s string) *EntitlementUpdateOne { + euo.mutation.SetExternalSubscriptionID(s) + return euo +} + +// SetNillableExternalSubscriptionID sets the "external_subscription_id" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableExternalSubscriptionID(s *string) *EntitlementUpdateOne { + if s != nil { + euo.SetExternalSubscriptionID(*s) + } + return euo +} + +// ClearExternalSubscriptionID clears the value of the "external_subscription_id" field. +func (euo *EntitlementUpdateOne) ClearExternalSubscriptionID() *EntitlementUpdateOne { + euo.mutation.ClearExternalSubscriptionID() + return euo +} + +// SetExpires sets the "expires" field. +func (euo *EntitlementUpdateOne) SetExpires(b bool) *EntitlementUpdateOne { + euo.mutation.SetExpires(b) + return euo +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableExpires(b *bool) *EntitlementUpdateOne { + if b != nil { + euo.SetExpires(*b) + } + return euo +} + +// SetExpiresAt sets the "expires_at" field. +func (euo *EntitlementUpdateOne) SetExpiresAt(t time.Time) *EntitlementUpdateOne { + euo.mutation.SetExpiresAt(t) + return euo +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableExpiresAt(t *time.Time) *EntitlementUpdateOne { + if t != nil { + euo.SetExpiresAt(*t) + } + return euo +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (euo *EntitlementUpdateOne) ClearExpiresAt() *EntitlementUpdateOne { + euo.mutation.ClearExpiresAt() + return euo +} + +// SetCancelled sets the "cancelled" field. +func (euo *EntitlementUpdateOne) SetCancelled(b bool) *EntitlementUpdateOne { + euo.mutation.SetCancelled(b) + return euo +} + +// SetNillableCancelled sets the "cancelled" field if the given value is not nil. +func (euo *EntitlementUpdateOne) SetNillableCancelled(b *bool) *EntitlementUpdateOne { + if b != nil { + euo.SetCancelled(*b) + } + return euo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (euo *EntitlementUpdateOne) SetOwner(o *Organization) *EntitlementUpdateOne { + return euo.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (euo *EntitlementUpdateOne) AddEventIDs(ids ...string) *EntitlementUpdateOne { + euo.mutation.AddEventIDs(ids...) + return euo +} + +// AddEvents adds the "events" edges to the Event entity. +func (euo *EntitlementUpdateOne) AddEvents(e ...*Event) *EntitlementUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.AddEventIDs(ids...) +} + +// Mutation returns the EntitlementMutation object of the builder. +func (euo *EntitlementUpdateOne) Mutation() *EntitlementMutation { + return euo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (euo *EntitlementUpdateOne) ClearOwner() *EntitlementUpdateOne { + euo.mutation.ClearOwner() + return euo +} + +// ClearEvents clears all "events" edges to the Event entity. +func (euo *EntitlementUpdateOne) ClearEvents() *EntitlementUpdateOne { + euo.mutation.ClearEvents() + return euo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (euo *EntitlementUpdateOne) RemoveEventIDs(ids ...string) *EntitlementUpdateOne { + euo.mutation.RemoveEventIDs(ids...) + return euo +} + +// RemoveEvents removes "events" edges to Event entities. +func (euo *EntitlementUpdateOne) RemoveEvents(e ...*Event) *EntitlementUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the EntitlementUpdate builder. +func (euo *EntitlementUpdateOne) Where(ps ...predicate.Entitlement) *EntitlementUpdateOne { + euo.mutation.Where(ps...) + return euo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (euo *EntitlementUpdateOne) Select(field string, fields ...string) *EntitlementUpdateOne { + euo.fields = append([]string{field}, fields...) + return euo +} + +// Save executes the query and returns the updated Entitlement entity. +func (euo *EntitlementUpdateOne) Save(ctx context.Context) (*Entitlement, error) { + if err := euo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, euo.sqlSave, euo.mutation, euo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (euo *EntitlementUpdateOne) SaveX(ctx context.Context) *Entitlement { + node, err := euo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (euo *EntitlementUpdateOne) Exec(ctx context.Context) error { + _, err := euo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (euo *EntitlementUpdateOne) ExecX(ctx context.Context) { + if err := euo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (euo *EntitlementUpdateOne) defaults() error { + if _, ok := euo.mutation.UpdatedAt(); !ok && !euo.mutation.UpdatedAtCleared() { + if entitlement.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlement.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlement.UpdateDefaultUpdatedAt() + euo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (euo *EntitlementUpdateOne) check() error { + if v, ok := euo.mutation.OwnerID(); ok { + if err := entitlement.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Entitlement.owner_id": %w`, err)} + } + } + if euo.mutation.PlanCleared() && len(euo.mutation.PlanIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Entitlement.plan"`) + } + if euo.mutation.OrganizationCleared() && len(euo.mutation.OrganizationIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Entitlement.organization"`) + } + return nil +} + +func (euo *EntitlementUpdateOne) sqlSave(ctx context.Context) (_node *Entitlement, err error) { + if err := euo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(entitlement.Table, entitlement.Columns, sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString)) + id, ok := euo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Entitlement.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := euo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlement.FieldID) + for _, f := range fields { + if !entitlement.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitlement.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := euo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if euo.mutation.CreatedAtCleared() { + _spec.ClearField(entitlement.FieldCreatedAt, field.TypeTime) + } + if value, ok := euo.mutation.UpdatedAt(); ok { + _spec.SetField(entitlement.FieldUpdatedAt, field.TypeTime, value) + } + if euo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlement.FieldUpdatedAt, field.TypeTime) + } + if euo.mutation.CreatedByCleared() { + _spec.ClearField(entitlement.FieldCreatedBy, field.TypeString) + } + if value, ok := euo.mutation.UpdatedBy(); ok { + _spec.SetField(entitlement.FieldUpdatedBy, field.TypeString, value) + } + if euo.mutation.UpdatedByCleared() { + _spec.ClearField(entitlement.FieldUpdatedBy, field.TypeString) + } + if value, ok := euo.mutation.Tags(); ok { + _spec.SetField(entitlement.FieldTags, field.TypeJSON, value) + } + if value, ok := euo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlement.FieldTags, value) + }) + } + if euo.mutation.TagsCleared() { + _spec.ClearField(entitlement.FieldTags, field.TypeJSON) + } + if value, ok := euo.mutation.DeletedAt(); ok { + _spec.SetField(entitlement.FieldDeletedAt, field.TypeTime, value) + } + if euo.mutation.DeletedAtCleared() { + _spec.ClearField(entitlement.FieldDeletedAt, field.TypeTime) + } + if value, ok := euo.mutation.DeletedBy(); ok { + _spec.SetField(entitlement.FieldDeletedBy, field.TypeString, value) + } + if euo.mutation.DeletedByCleared() { + _spec.ClearField(entitlement.FieldDeletedBy, field.TypeString) + } + if value, ok := euo.mutation.ExternalCustomerID(); ok { + _spec.SetField(entitlement.FieldExternalCustomerID, field.TypeString, value) + } + if euo.mutation.ExternalCustomerIDCleared() { + _spec.ClearField(entitlement.FieldExternalCustomerID, field.TypeString) + } + if value, ok := euo.mutation.ExternalSubscriptionID(); ok { + _spec.SetField(entitlement.FieldExternalSubscriptionID, field.TypeString, value) + } + if euo.mutation.ExternalSubscriptionIDCleared() { + _spec.ClearField(entitlement.FieldExternalSubscriptionID, field.TypeString) + } + if value, ok := euo.mutation.Expires(); ok { + _spec.SetField(entitlement.FieldExpires, field.TypeBool, value) + } + if value, ok := euo.mutation.ExpiresAt(); ok { + _spec.SetField(entitlement.FieldExpiresAt, field.TypeTime, value) + } + if euo.mutation.ExpiresAtCleared() { + _spec.ClearField(entitlement.FieldExpiresAt, field.TypeTime) + } + if value, ok := euo.mutation.Cancelled(); ok { + _spec.SetField(entitlement.FieldCancelled, field.TypeBool, value) + } + if euo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OwnerTable, + Columns: []string{entitlement.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OwnerTable, + Columns: []string{entitlement.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !euo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = euo.schemaConfig.Entitlement + ctx = internal.NewSchemaConfigContext(ctx, euo.schemaConfig) + _node = &Entitlement{config: euo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, euo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlement.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + euo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entitlementhistory.go b/internal/ent/generated/entitlementhistory.go new file mode 100644 index 0000000..26e48e6 --- /dev/null +++ b/internal/ent/generated/entitlementhistory.go @@ -0,0 +1,315 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/entx/history" +) + +// EntitlementHistory is the model entity for the EntitlementHistory schema. +type EntitlementHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the plan to which the entitlement belongs + PlanID string `json:"plan_id,omitempty"` + // the organization to which the entitlement belongs + OrganizationID string `json:"organization_id,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID string `json:"external_customer_id,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID string `json:"external_subscription_id,omitempty"` + // whether or not the customers entitlement expires - expires_at will show the time + Expires bool `json:"expires,omitempty"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled bool `json:"cancelled,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntitlementHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitlementhistory.FieldTags: + values[i] = new([]byte) + case entitlementhistory.FieldOperation: + values[i] = new(history.OpType) + case entitlementhistory.FieldExpires, entitlementhistory.FieldCancelled: + values[i] = new(sql.NullBool) + case entitlementhistory.FieldID, entitlementhistory.FieldRef, entitlementhistory.FieldCreatedBy, entitlementhistory.FieldUpdatedBy, entitlementhistory.FieldMappingID, entitlementhistory.FieldDeletedBy, entitlementhistory.FieldOwnerID, entitlementhistory.FieldPlanID, entitlementhistory.FieldOrganizationID, entitlementhistory.FieldExternalCustomerID, entitlementhistory.FieldExternalSubscriptionID: + values[i] = new(sql.NullString) + case entitlementhistory.FieldHistoryTime, entitlementhistory.FieldCreatedAt, entitlementhistory.FieldUpdatedAt, entitlementhistory.FieldDeletedAt, entitlementhistory.FieldExpiresAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntitlementHistory fields. +func (eh *EntitlementHistory) 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 entitlementhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + eh.ID = value.String + } + case entitlementhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + eh.HistoryTime = value.Time + } + case entitlementhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + eh.Ref = value.String + } + case entitlementhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + eh.Operation = *value + } + case entitlementhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + eh.CreatedAt = value.Time + } + case entitlementhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + eh.UpdatedAt = value.Time + } + case entitlementhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + eh.CreatedBy = value.String + } + case entitlementhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + eh.UpdatedBy = value.String + } + case entitlementhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + eh.MappingID = value.String + } + case entitlementhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &eh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitlementhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + eh.DeletedAt = value.Time + } + case entitlementhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + eh.DeletedBy = value.String + } + case entitlementhistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + eh.OwnerID = value.String + } + case entitlementhistory.FieldPlanID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field plan_id", values[i]) + } else if value.Valid { + eh.PlanID = value.String + } + case entitlementhistory.FieldOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field organization_id", values[i]) + } else if value.Valid { + eh.OrganizationID = value.String + } + case entitlementhistory.FieldExternalCustomerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field external_customer_id", values[i]) + } else if value.Valid { + eh.ExternalCustomerID = value.String + } + case entitlementhistory.FieldExternalSubscriptionID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field external_subscription_id", values[i]) + } else if value.Valid { + eh.ExternalSubscriptionID = value.String + } + case entitlementhistory.FieldExpires: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field expires", values[i]) + } else if value.Valid { + eh.Expires = value.Bool + } + case entitlementhistory.FieldExpiresAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field expires_at", values[i]) + } else if value.Valid { + eh.ExpiresAt = new(time.Time) + *eh.ExpiresAt = value.Time + } + case entitlementhistory.FieldCancelled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field cancelled", values[i]) + } else if value.Valid { + eh.Cancelled = value.Bool + } + default: + eh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntitlementHistory. +// This includes values selected through modifiers, order, etc. +func (eh *EntitlementHistory) Value(name string) (ent.Value, error) { + return eh.selectValues.Get(name) +} + +// Update returns a builder for updating this EntitlementHistory. +// Note that you need to call EntitlementHistory.Unwrap() before calling this method if this EntitlementHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (eh *EntitlementHistory) Update() *EntitlementHistoryUpdateOne { + return NewEntitlementHistoryClient(eh.config).UpdateOne(eh) +} + +// Unwrap unwraps the EntitlementHistory 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 (eh *EntitlementHistory) Unwrap() *EntitlementHistory { + _tx, ok := eh.config.driver.(*txDriver) + if !ok { + panic("generated: EntitlementHistory is not a transactional entity") + } + eh.config.driver = _tx.drv + return eh +} + +// String implements the fmt.Stringer. +func (eh *EntitlementHistory) String() string { + var builder strings.Builder + builder.WriteString("EntitlementHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", eh.ID)) + builder.WriteString("history_time=") + builder.WriteString(eh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(eh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", eh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(eh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(eh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(eh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(eh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(eh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", eh.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(eh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(eh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(eh.OwnerID) + builder.WriteString(", ") + builder.WriteString("plan_id=") + builder.WriteString(eh.PlanID) + builder.WriteString(", ") + builder.WriteString("organization_id=") + builder.WriteString(eh.OrganizationID) + builder.WriteString(", ") + builder.WriteString("external_customer_id=") + builder.WriteString(eh.ExternalCustomerID) + builder.WriteString(", ") + builder.WriteString("external_subscription_id=") + builder.WriteString(eh.ExternalSubscriptionID) + builder.WriteString(", ") + builder.WriteString("expires=") + builder.WriteString(fmt.Sprintf("%v", eh.Expires)) + builder.WriteString(", ") + if v := eh.ExpiresAt; v != nil { + builder.WriteString("expires_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("cancelled=") + builder.WriteString(fmt.Sprintf("%v", eh.Cancelled)) + builder.WriteByte(')') + return builder.String() +} + +// EntitlementHistories is a parsable slice of EntitlementHistory. +type EntitlementHistories []*EntitlementHistory diff --git a/internal/ent/generated/entitlementhistory/entitlementhistory.go b/internal/ent/generated/entitlementhistory/entitlementhistory.go new file mode 100644 index 0000000..bd450c8 --- /dev/null +++ b/internal/ent/generated/entitlementhistory/entitlementhistory.go @@ -0,0 +1,238 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the entitlementhistory type in the database. + Label = "entitlement_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldPlanID holds the string denoting the plan_id field in the database. + FieldPlanID = "plan_id" + // FieldOrganizationID holds the string denoting the organization_id field in the database. + FieldOrganizationID = "organization_id" + // FieldExternalCustomerID holds the string denoting the external_customer_id field in the database. + FieldExternalCustomerID = "external_customer_id" + // FieldExternalSubscriptionID holds the string denoting the external_subscription_id field in the database. + FieldExternalSubscriptionID = "external_subscription_id" + // FieldExpires holds the string denoting the expires field in the database. + FieldExpires = "expires" + // FieldExpiresAt holds the string denoting the expires_at field in the database. + FieldExpiresAt = "expires_at" + // FieldCancelled holds the string denoting the cancelled field in the database. + FieldCancelled = "cancelled" + // Table holds the table name of the entitlementhistory in the database. + Table = "entitlement_history" +) + +// Columns holds all SQL columns for entitlementhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldPlanID, + FieldOrganizationID, + FieldExternalCustomerID, + FieldExternalSubscriptionID, + FieldExpires, + FieldExpiresAt, + FieldCancelled, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultExpires holds the default value on creation for the "expires" field. + DefaultExpires bool + // DefaultCancelled holds the default value on creation for the "cancelled" field. + DefaultCancelled bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("entitlementhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the EntitlementHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByPlanID orders the results by the plan_id field. +func ByPlanID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPlanID, opts...).ToFunc() +} + +// ByOrganizationID orders the results by the organization_id field. +func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() +} + +// ByExternalCustomerID orders the results by the external_customer_id field. +func ByExternalCustomerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExternalCustomerID, opts...).ToFunc() +} + +// ByExternalSubscriptionID orders the results by the external_subscription_id field. +func ByExternalSubscriptionID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExternalSubscriptionID, opts...).ToFunc() +} + +// ByExpires orders the results by the expires field. +func ByExpires(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpires, opts...).ToFunc() +} + +// ByExpiresAt orders the results by the expires_at field. +func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpiresAt, opts...).ToFunc() +} + +// ByCancelled orders the results by the cancelled field. +func ByCancelled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCancelled, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/entitlementhistory/where.go b/internal/ent/generated/entitlementhistory/where.go new file mode 100644 index 0000000..4d0ca62 --- /dev/null +++ b/internal/ent/generated/entitlementhistory/where.go @@ -0,0 +1,1176 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// PlanID applies equality check predicate on the "plan_id" field. It's identical to PlanIDEQ. +func PlanID(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldPlanID, v)) +} + +// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ. +func OrganizationID(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldOrganizationID, v)) +} + +// ExternalCustomerID applies equality check predicate on the "external_customer_id" field. It's identical to ExternalCustomerIDEQ. +func ExternalCustomerID(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExternalCustomerID, v)) +} + +// ExternalSubscriptionID applies equality check predicate on the "external_subscription_id" field. It's identical to ExternalSubscriptionIDEQ. +func ExternalSubscriptionID(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExternalSubscriptionID, v)) +} + +// Expires applies equality check predicate on the "expires" field. It's identical to ExpiresEQ. +func Expires(v bool) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExpires, v)) +} + +// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ. +func ExpiresAt(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExpiresAt, v)) +} + +// Cancelled applies equality check predicate on the "cancelled" field. It's identical to CancelledEQ. +func Cancelled(v bool) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldCancelled, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// PlanIDEQ applies the EQ predicate on the "plan_id" field. +func PlanIDEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldPlanID, v)) +} + +// PlanIDNEQ applies the NEQ predicate on the "plan_id" field. +func PlanIDNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldPlanID, v)) +} + +// PlanIDIn applies the In predicate on the "plan_id" field. +func PlanIDIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldPlanID, vs...)) +} + +// PlanIDNotIn applies the NotIn predicate on the "plan_id" field. +func PlanIDNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldPlanID, vs...)) +} + +// PlanIDGT applies the GT predicate on the "plan_id" field. +func PlanIDGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldPlanID, v)) +} + +// PlanIDGTE applies the GTE predicate on the "plan_id" field. +func PlanIDGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldPlanID, v)) +} + +// PlanIDLT applies the LT predicate on the "plan_id" field. +func PlanIDLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldPlanID, v)) +} + +// PlanIDLTE applies the LTE predicate on the "plan_id" field. +func PlanIDLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldPlanID, v)) +} + +// PlanIDContains applies the Contains predicate on the "plan_id" field. +func PlanIDContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldPlanID, v)) +} + +// PlanIDHasPrefix applies the HasPrefix predicate on the "plan_id" field. +func PlanIDHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldPlanID, v)) +} + +// PlanIDHasSuffix applies the HasSuffix predicate on the "plan_id" field. +func PlanIDHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldPlanID, v)) +} + +// PlanIDEqualFold applies the EqualFold predicate on the "plan_id" field. +func PlanIDEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldPlanID, v)) +} + +// PlanIDContainsFold applies the ContainsFold predicate on the "plan_id" field. +func PlanIDContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldPlanID, v)) +} + +// OrganizationIDEQ applies the EQ predicate on the "organization_id" field. +func OrganizationIDEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldOrganizationID, v)) +} + +// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field. +func OrganizationIDNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldOrganizationID, v)) +} + +// OrganizationIDIn applies the In predicate on the "organization_id" field. +func OrganizationIDIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field. +func OrganizationIDNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDGT applies the GT predicate on the "organization_id" field. +func OrganizationIDGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldOrganizationID, v)) +} + +// OrganizationIDGTE applies the GTE predicate on the "organization_id" field. +func OrganizationIDGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldOrganizationID, v)) +} + +// OrganizationIDLT applies the LT predicate on the "organization_id" field. +func OrganizationIDLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldOrganizationID, v)) +} + +// OrganizationIDLTE applies the LTE predicate on the "organization_id" field. +func OrganizationIDLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldOrganizationID, v)) +} + +// OrganizationIDContains applies the Contains predicate on the "organization_id" field. +func OrganizationIDContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldOrganizationID, v)) +} + +// OrganizationIDHasPrefix applies the HasPrefix predicate on the "organization_id" field. +func OrganizationIDHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldOrganizationID, v)) +} + +// OrganizationIDHasSuffix applies the HasSuffix predicate on the "organization_id" field. +func OrganizationIDHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldOrganizationID, v)) +} + +// OrganizationIDEqualFold applies the EqualFold predicate on the "organization_id" field. +func OrganizationIDEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldOrganizationID, v)) +} + +// OrganizationIDContainsFold applies the ContainsFold predicate on the "organization_id" field. +func OrganizationIDContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldOrganizationID, v)) +} + +// ExternalCustomerIDEQ applies the EQ predicate on the "external_customer_id" field. +func ExternalCustomerIDEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDNEQ applies the NEQ predicate on the "external_customer_id" field. +func ExternalCustomerIDNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDIn applies the In predicate on the "external_customer_id" field. +func ExternalCustomerIDIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldExternalCustomerID, vs...)) +} + +// ExternalCustomerIDNotIn applies the NotIn predicate on the "external_customer_id" field. +func ExternalCustomerIDNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldExternalCustomerID, vs...)) +} + +// ExternalCustomerIDGT applies the GT predicate on the "external_customer_id" field. +func ExternalCustomerIDGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDGTE applies the GTE predicate on the "external_customer_id" field. +func ExternalCustomerIDGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDLT applies the LT predicate on the "external_customer_id" field. +func ExternalCustomerIDLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDLTE applies the LTE predicate on the "external_customer_id" field. +func ExternalCustomerIDLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDContains applies the Contains predicate on the "external_customer_id" field. +func ExternalCustomerIDContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDHasPrefix applies the HasPrefix predicate on the "external_customer_id" field. +func ExternalCustomerIDHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDHasSuffix applies the HasSuffix predicate on the "external_customer_id" field. +func ExternalCustomerIDHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDIsNil applies the IsNil predicate on the "external_customer_id" field. +func ExternalCustomerIDIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldExternalCustomerID)) +} + +// ExternalCustomerIDNotNil applies the NotNil predicate on the "external_customer_id" field. +func ExternalCustomerIDNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldExternalCustomerID)) +} + +// ExternalCustomerIDEqualFold applies the EqualFold predicate on the "external_customer_id" field. +func ExternalCustomerIDEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldExternalCustomerID, v)) +} + +// ExternalCustomerIDContainsFold applies the ContainsFold predicate on the "external_customer_id" field. +func ExternalCustomerIDContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldExternalCustomerID, v)) +} + +// ExternalSubscriptionIDEQ applies the EQ predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDNEQ applies the NEQ predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDNEQ(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDIn applies the In predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldExternalSubscriptionID, vs...)) +} + +// ExternalSubscriptionIDNotIn applies the NotIn predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDNotIn(vs ...string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldExternalSubscriptionID, vs...)) +} + +// ExternalSubscriptionIDGT applies the GT predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDGT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDGTE applies the GTE predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDGTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDLT applies the LT predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDLT(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDLTE applies the LTE predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDLTE(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDContains applies the Contains predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDContains(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContains(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDHasPrefix applies the HasPrefix predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDHasPrefix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasPrefix(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDHasSuffix applies the HasSuffix predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDHasSuffix(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldHasSuffix(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDIsNil applies the IsNil predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldExternalSubscriptionID)) +} + +// ExternalSubscriptionIDNotNil applies the NotNil predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldExternalSubscriptionID)) +} + +// ExternalSubscriptionIDEqualFold applies the EqualFold predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDEqualFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEqualFold(FieldExternalSubscriptionID, v)) +} + +// ExternalSubscriptionIDContainsFold applies the ContainsFold predicate on the "external_subscription_id" field. +func ExternalSubscriptionIDContainsFold(v string) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldContainsFold(FieldExternalSubscriptionID, v)) +} + +// ExpiresEQ applies the EQ predicate on the "expires" field. +func ExpiresEQ(v bool) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExpires, v)) +} + +// ExpiresNEQ applies the NEQ predicate on the "expires" field. +func ExpiresNEQ(v bool) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldExpires, v)) +} + +// ExpiresAtEQ applies the EQ predicate on the "expires_at" field. +func ExpiresAtEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldExpiresAt, v)) +} + +// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field. +func ExpiresAtNEQ(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldExpiresAt, v)) +} + +// ExpiresAtIn applies the In predicate on the "expires_at" field. +func ExpiresAtIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field. +func ExpiresAtNotIn(vs ...time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtGT applies the GT predicate on the "expires_at" field. +func ExpiresAtGT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGT(FieldExpiresAt, v)) +} + +// ExpiresAtGTE applies the GTE predicate on the "expires_at" field. +func ExpiresAtGTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldGTE(FieldExpiresAt, v)) +} + +// ExpiresAtLT applies the LT predicate on the "expires_at" field. +func ExpiresAtLT(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLT(FieldExpiresAt, v)) +} + +// ExpiresAtLTE applies the LTE predicate on the "expires_at" field. +func ExpiresAtLTE(v time.Time) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldLTE(FieldExpiresAt, v)) +} + +// ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field. +func ExpiresAtIsNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldIsNull(FieldExpiresAt)) +} + +// ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field. +func ExpiresAtNotNil() predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNotNull(FieldExpiresAt)) +} + +// CancelledEQ applies the EQ predicate on the "cancelled" field. +func CancelledEQ(v bool) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldEQ(FieldCancelled, v)) +} + +// CancelledNEQ applies the NEQ predicate on the "cancelled" field. +func CancelledNEQ(v bool) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.FieldNEQ(FieldCancelled, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.EntitlementHistory) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntitlementHistory) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntitlementHistory) predicate.EntitlementHistory { + return predicate.EntitlementHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitlementhistory_create.go b/internal/ent/generated/entitlementhistory_create.go new file mode 100644 index 0000000..6224023 --- /dev/null +++ b/internal/ent/generated/entitlementhistory_create.go @@ -0,0 +1,584 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/entx/history" +) + +// EntitlementHistoryCreate is the builder for creating a EntitlementHistory entity. +type EntitlementHistoryCreate struct { + config + mutation *EntitlementHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ehc *EntitlementHistoryCreate) SetHistoryTime(t time.Time) *EntitlementHistoryCreate { + ehc.mutation.SetHistoryTime(t) + return ehc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableHistoryTime(t *time.Time) *EntitlementHistoryCreate { + if t != nil { + ehc.SetHistoryTime(*t) + } + return ehc +} + +// SetRef sets the "ref" field. +func (ehc *EntitlementHistoryCreate) SetRef(s string) *EntitlementHistoryCreate { + ehc.mutation.SetRef(s) + return ehc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableRef(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetRef(*s) + } + return ehc +} + +// SetOperation sets the "operation" field. +func (ehc *EntitlementHistoryCreate) SetOperation(ht history.OpType) *EntitlementHistoryCreate { + ehc.mutation.SetOperation(ht) + return ehc +} + +// SetCreatedAt sets the "created_at" field. +func (ehc *EntitlementHistoryCreate) SetCreatedAt(t time.Time) *EntitlementHistoryCreate { + ehc.mutation.SetCreatedAt(t) + return ehc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableCreatedAt(t *time.Time) *EntitlementHistoryCreate { + if t != nil { + ehc.SetCreatedAt(*t) + } + return ehc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehc *EntitlementHistoryCreate) SetUpdatedAt(t time.Time) *EntitlementHistoryCreate { + ehc.mutation.SetUpdatedAt(t) + return ehc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementHistoryCreate { + if t != nil { + ehc.SetUpdatedAt(*t) + } + return ehc +} + +// SetCreatedBy sets the "created_by" field. +func (ehc *EntitlementHistoryCreate) SetCreatedBy(s string) *EntitlementHistoryCreate { + ehc.mutation.SetCreatedBy(s) + return ehc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableCreatedBy(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetCreatedBy(*s) + } + return ehc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehc *EntitlementHistoryCreate) SetUpdatedBy(s string) *EntitlementHistoryCreate { + ehc.mutation.SetUpdatedBy(s) + return ehc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableUpdatedBy(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetUpdatedBy(*s) + } + return ehc +} + +// SetMappingID sets the "mapping_id" field. +func (ehc *EntitlementHistoryCreate) SetMappingID(s string) *EntitlementHistoryCreate { + ehc.mutation.SetMappingID(s) + return ehc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableMappingID(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetMappingID(*s) + } + return ehc +} + +// SetTags sets the "tags" field. +func (ehc *EntitlementHistoryCreate) SetTags(s []string) *EntitlementHistoryCreate { + ehc.mutation.SetTags(s) + return ehc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ehc *EntitlementHistoryCreate) SetDeletedAt(t time.Time) *EntitlementHistoryCreate { + ehc.mutation.SetDeletedAt(t) + return ehc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableDeletedAt(t *time.Time) *EntitlementHistoryCreate { + if t != nil { + ehc.SetDeletedAt(*t) + } + return ehc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ehc *EntitlementHistoryCreate) SetDeletedBy(s string) *EntitlementHistoryCreate { + ehc.mutation.SetDeletedBy(s) + return ehc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableDeletedBy(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetDeletedBy(*s) + } + return ehc +} + +// SetOwnerID sets the "owner_id" field. +func (ehc *EntitlementHistoryCreate) SetOwnerID(s string) *EntitlementHistoryCreate { + ehc.mutation.SetOwnerID(s) + return ehc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableOwnerID(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetOwnerID(*s) + } + return ehc +} + +// SetPlanID sets the "plan_id" field. +func (ehc *EntitlementHistoryCreate) SetPlanID(s string) *EntitlementHistoryCreate { + ehc.mutation.SetPlanID(s) + return ehc +} + +// SetOrganizationID sets the "organization_id" field. +func (ehc *EntitlementHistoryCreate) SetOrganizationID(s string) *EntitlementHistoryCreate { + ehc.mutation.SetOrganizationID(s) + return ehc +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (ehc *EntitlementHistoryCreate) SetExternalCustomerID(s string) *EntitlementHistoryCreate { + ehc.mutation.SetExternalCustomerID(s) + return ehc +} + +// SetNillableExternalCustomerID sets the "external_customer_id" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableExternalCustomerID(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetExternalCustomerID(*s) + } + return ehc +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (ehc *EntitlementHistoryCreate) SetExternalSubscriptionID(s string) *EntitlementHistoryCreate { + ehc.mutation.SetExternalSubscriptionID(s) + return ehc +} + +// SetNillableExternalSubscriptionID sets the "external_subscription_id" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableExternalSubscriptionID(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetExternalSubscriptionID(*s) + } + return ehc +} + +// SetExpires sets the "expires" field. +func (ehc *EntitlementHistoryCreate) SetExpires(b bool) *EntitlementHistoryCreate { + ehc.mutation.SetExpires(b) + return ehc +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableExpires(b *bool) *EntitlementHistoryCreate { + if b != nil { + ehc.SetExpires(*b) + } + return ehc +} + +// SetExpiresAt sets the "expires_at" field. +func (ehc *EntitlementHistoryCreate) SetExpiresAt(t time.Time) *EntitlementHistoryCreate { + ehc.mutation.SetExpiresAt(t) + return ehc +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableExpiresAt(t *time.Time) *EntitlementHistoryCreate { + if t != nil { + ehc.SetExpiresAt(*t) + } + return ehc +} + +// SetCancelled sets the "cancelled" field. +func (ehc *EntitlementHistoryCreate) SetCancelled(b bool) *EntitlementHistoryCreate { + ehc.mutation.SetCancelled(b) + return ehc +} + +// SetNillableCancelled sets the "cancelled" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableCancelled(b *bool) *EntitlementHistoryCreate { + if b != nil { + ehc.SetCancelled(*b) + } + return ehc +} + +// SetID sets the "id" field. +func (ehc *EntitlementHistoryCreate) SetID(s string) *EntitlementHistoryCreate { + ehc.mutation.SetID(s) + return ehc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ehc *EntitlementHistoryCreate) SetNillableID(s *string) *EntitlementHistoryCreate { + if s != nil { + ehc.SetID(*s) + } + return ehc +} + +// Mutation returns the EntitlementHistoryMutation object of the builder. +func (ehc *EntitlementHistoryCreate) Mutation() *EntitlementHistoryMutation { + return ehc.mutation +} + +// Save creates the EntitlementHistory in the database. +func (ehc *EntitlementHistoryCreate) Save(ctx context.Context) (*EntitlementHistory, error) { + if err := ehc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ehc.sqlSave, ehc.mutation, ehc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ehc *EntitlementHistoryCreate) SaveX(ctx context.Context) *EntitlementHistory { + v, err := ehc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ehc *EntitlementHistoryCreate) Exec(ctx context.Context) error { + _, err := ehc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehc *EntitlementHistoryCreate) ExecX(ctx context.Context) { + if err := ehc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehc *EntitlementHistoryCreate) defaults() error { + if _, ok := ehc.mutation.HistoryTime(); !ok { + if entitlementhistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized entitlementhistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := entitlementhistory.DefaultHistoryTime() + ehc.mutation.SetHistoryTime(v) + } + if _, ok := ehc.mutation.CreatedAt(); !ok { + if entitlementhistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementhistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitlementhistory.DefaultCreatedAt() + ehc.mutation.SetCreatedAt(v) + } + if _, ok := ehc.mutation.UpdatedAt(); !ok { + if entitlementhistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementhistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementhistory.DefaultUpdatedAt() + ehc.mutation.SetUpdatedAt(v) + } + if _, ok := ehc.mutation.MappingID(); !ok { + if entitlementhistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitlementhistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitlementhistory.DefaultMappingID() + ehc.mutation.SetMappingID(v) + } + if _, ok := ehc.mutation.Tags(); !ok { + v := entitlementhistory.DefaultTags + ehc.mutation.SetTags(v) + } + if _, ok := ehc.mutation.Expires(); !ok { + v := entitlementhistory.DefaultExpires + ehc.mutation.SetExpires(v) + } + if _, ok := ehc.mutation.Cancelled(); !ok { + v := entitlementhistory.DefaultCancelled + ehc.mutation.SetCancelled(v) + } + if _, ok := ehc.mutation.ID(); !ok { + if entitlementhistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitlementhistory.DefaultID (forgotten import generated/runtime?)") + } + v := entitlementhistory.DefaultID() + ehc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ehc *EntitlementHistoryCreate) check() error { + if _, ok := ehc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "EntitlementHistory.history_time"`)} + } + if _, ok := ehc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "EntitlementHistory.operation"`)} + } + if v, ok := ehc.mutation.Operation(); ok { + if err := entitlementhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "EntitlementHistory.operation": %w`, err)} + } + } + if _, ok := ehc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntitlementHistory.mapping_id"`)} + } + if _, ok := ehc.mutation.PlanID(); !ok { + return &ValidationError{Name: "plan_id", err: errors.New(`generated: missing required field "EntitlementHistory.plan_id"`)} + } + if _, ok := ehc.mutation.OrganizationID(); !ok { + return &ValidationError{Name: "organization_id", err: errors.New(`generated: missing required field "EntitlementHistory.organization_id"`)} + } + if _, ok := ehc.mutation.Expires(); !ok { + return &ValidationError{Name: "expires", err: errors.New(`generated: missing required field "EntitlementHistory.expires"`)} + } + if _, ok := ehc.mutation.Cancelled(); !ok { + return &ValidationError{Name: "cancelled", err: errors.New(`generated: missing required field "EntitlementHistory.cancelled"`)} + } + return nil +} + +func (ehc *EntitlementHistoryCreate) sqlSave(ctx context.Context) (*EntitlementHistory, error) { + if err := ehc.check(); err != nil { + return nil, err + } + _node, _spec := ehc.createSpec() + if err := sqlgraph.CreateNode(ctx, ehc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntitlementHistory.ID type: %T", _spec.ID.Value) + } + } + ehc.mutation.id = &_node.ID + ehc.mutation.done = true + return _node, nil +} + +func (ehc *EntitlementHistoryCreate) createSpec() (*EntitlementHistory, *sqlgraph.CreateSpec) { + var ( + _node = &EntitlementHistory{config: ehc.config} + _spec = sqlgraph.NewCreateSpec(entitlementhistory.Table, sqlgraph.NewFieldSpec(entitlementhistory.FieldID, field.TypeString)) + ) + _spec.Schema = ehc.schemaConfig.EntitlementHistory + if id, ok := ehc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ehc.mutation.HistoryTime(); ok { + _spec.SetField(entitlementhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ehc.mutation.Ref(); ok { + _spec.SetField(entitlementhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ehc.mutation.Operation(); ok { + _spec.SetField(entitlementhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ehc.mutation.CreatedAt(); ok { + _spec.SetField(entitlementhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ehc.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ehc.mutation.CreatedBy(); ok { + _spec.SetField(entitlementhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ehc.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ehc.mutation.MappingID(); ok { + _spec.SetField(entitlementhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ehc.mutation.Tags(); ok { + _spec.SetField(entitlementhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ehc.mutation.DeletedAt(); ok { + _spec.SetField(entitlementhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ehc.mutation.DeletedBy(); ok { + _spec.SetField(entitlementhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ehc.mutation.OwnerID(); ok { + _spec.SetField(entitlementhistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ehc.mutation.PlanID(); ok { + _spec.SetField(entitlementhistory.FieldPlanID, field.TypeString, value) + _node.PlanID = value + } + if value, ok := ehc.mutation.OrganizationID(); ok { + _spec.SetField(entitlementhistory.FieldOrganizationID, field.TypeString, value) + _node.OrganizationID = value + } + if value, ok := ehc.mutation.ExternalCustomerID(); ok { + _spec.SetField(entitlementhistory.FieldExternalCustomerID, field.TypeString, value) + _node.ExternalCustomerID = value + } + if value, ok := ehc.mutation.ExternalSubscriptionID(); ok { + _spec.SetField(entitlementhistory.FieldExternalSubscriptionID, field.TypeString, value) + _node.ExternalSubscriptionID = value + } + if value, ok := ehc.mutation.Expires(); ok { + _spec.SetField(entitlementhistory.FieldExpires, field.TypeBool, value) + _node.Expires = value + } + if value, ok := ehc.mutation.ExpiresAt(); ok { + _spec.SetField(entitlementhistory.FieldExpiresAt, field.TypeTime, value) + _node.ExpiresAt = &value + } + if value, ok := ehc.mutation.Cancelled(); ok { + _spec.SetField(entitlementhistory.FieldCancelled, field.TypeBool, value) + _node.Cancelled = value + } + return _node, _spec +} + +// EntitlementHistoryCreateBulk is the builder for creating many EntitlementHistory entities in bulk. +type EntitlementHistoryCreateBulk struct { + config + err error + builders []*EntitlementHistoryCreate +} + +// Save creates the EntitlementHistory entities in the database. +func (ehcb *EntitlementHistoryCreateBulk) Save(ctx context.Context) ([]*EntitlementHistory, error) { + if ehcb.err != nil { + return nil, ehcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ehcb.builders)) + nodes := make([]*EntitlementHistory, len(ehcb.builders)) + mutators := make([]Mutator, len(ehcb.builders)) + for i := range ehcb.builders { + func(i int, root context.Context) { + builder := ehcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntitlementHistoryMutation) + 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, ehcb.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, ehcb.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, ehcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ehcb *EntitlementHistoryCreateBulk) SaveX(ctx context.Context) []*EntitlementHistory { + v, err := ehcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ehcb *EntitlementHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ehcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehcb *EntitlementHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ehcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementhistory_delete.go b/internal/ent/generated/entitlementhistory_delete.go new file mode 100644 index 0000000..e0dbba1 --- /dev/null +++ b/internal/ent/generated/entitlementhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementHistoryDelete is the builder for deleting a EntitlementHistory entity. +type EntitlementHistoryDelete struct { + config + hooks []Hook + mutation *EntitlementHistoryMutation +} + +// Where appends a list predicates to the EntitlementHistoryDelete builder. +func (ehd *EntitlementHistoryDelete) Where(ps ...predicate.EntitlementHistory) *EntitlementHistoryDelete { + ehd.mutation.Where(ps...) + return ehd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ehd *EntitlementHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ehd.sqlExec, ehd.mutation, ehd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehd *EntitlementHistoryDelete) ExecX(ctx context.Context) int { + n, err := ehd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ehd *EntitlementHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitlementhistory.Table, sqlgraph.NewFieldSpec(entitlementhistory.FieldID, field.TypeString)) + _spec.Node.Schema = ehd.schemaConfig.EntitlementHistory + ctx = internal.NewSchemaConfigContext(ctx, ehd.schemaConfig) + if ps := ehd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ehd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ehd.mutation.done = true + return affected, err +} + +// EntitlementHistoryDeleteOne is the builder for deleting a single EntitlementHistory entity. +type EntitlementHistoryDeleteOne struct { + ehd *EntitlementHistoryDelete +} + +// Where appends a list predicates to the EntitlementHistoryDelete builder. +func (ehdo *EntitlementHistoryDeleteOne) Where(ps ...predicate.EntitlementHistory) *EntitlementHistoryDeleteOne { + ehdo.ehd.mutation.Where(ps...) + return ehdo +} + +// Exec executes the deletion query. +func (ehdo *EntitlementHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ehdo.ehd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitlementhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehdo *EntitlementHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ehdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementhistory_query.go b/internal/ent/generated/entitlementhistory_query.go new file mode 100644 index 0000000..a883fcb --- /dev/null +++ b/internal/ent/generated/entitlementhistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementHistoryQuery is the builder for querying EntitlementHistory entities. +type EntitlementHistoryQuery struct { + config + ctx *QueryContext + order []entitlementhistory.OrderOption + inters []Interceptor + predicates []predicate.EntitlementHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntitlementHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntitlementHistoryQuery builder. +func (ehq *EntitlementHistoryQuery) Where(ps ...predicate.EntitlementHistory) *EntitlementHistoryQuery { + ehq.predicates = append(ehq.predicates, ps...) + return ehq +} + +// Limit the number of records to be returned by this query. +func (ehq *EntitlementHistoryQuery) Limit(limit int) *EntitlementHistoryQuery { + ehq.ctx.Limit = &limit + return ehq +} + +// Offset to start from. +func (ehq *EntitlementHistoryQuery) Offset(offset int) *EntitlementHistoryQuery { + ehq.ctx.Offset = &offset + return ehq +} + +// 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 (ehq *EntitlementHistoryQuery) Unique(unique bool) *EntitlementHistoryQuery { + ehq.ctx.Unique = &unique + return ehq +} + +// Order specifies how the records should be ordered. +func (ehq *EntitlementHistoryQuery) Order(o ...entitlementhistory.OrderOption) *EntitlementHistoryQuery { + ehq.order = append(ehq.order, o...) + return ehq +} + +// First returns the first EntitlementHistory entity from the query. +// Returns a *NotFoundError when no EntitlementHistory was found. +func (ehq *EntitlementHistoryQuery) First(ctx context.Context) (*EntitlementHistory, error) { + nodes, err := ehq.Limit(1).All(setContextOp(ctx, ehq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitlementhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) FirstX(ctx context.Context) *EntitlementHistory { + node, err := ehq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntitlementHistory ID from the query. +// Returns a *NotFoundError when no EntitlementHistory ID was found. +func (ehq *EntitlementHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ehq.Limit(1).IDs(setContextOp(ctx, ehq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitlementhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ehq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntitlementHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntitlementHistory entity is found. +// Returns a *NotFoundError when no EntitlementHistory entities are found. +func (ehq *EntitlementHistoryQuery) Only(ctx context.Context) (*EntitlementHistory, error) { + nodes, err := ehq.Limit(2).All(setContextOp(ctx, ehq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitlementhistory.Label} + default: + return nil, &NotSingularError{entitlementhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) OnlyX(ctx context.Context) *EntitlementHistory { + node, err := ehq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntitlementHistory ID in the query. +// Returns a *NotSingularError when more than one EntitlementHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ehq *EntitlementHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ehq.Limit(2).IDs(setContextOp(ctx, ehq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitlementhistory.Label} + default: + err = &NotSingularError{entitlementhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ehq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntitlementHistories. +func (ehq *EntitlementHistoryQuery) All(ctx context.Context) ([]*EntitlementHistory, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryAll) + if err := ehq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntitlementHistory, *EntitlementHistoryQuery]() + return withInterceptors[[]*EntitlementHistory](ctx, ehq, qr, ehq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) AllX(ctx context.Context) []*EntitlementHistory { + nodes, err := ehq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntitlementHistory IDs. +func (ehq *EntitlementHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ehq.ctx.Unique == nil && ehq.path != nil { + ehq.Unique(true) + } + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryIDs) + if err = ehq.Select(entitlementhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ehq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ehq *EntitlementHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryCount) + if err := ehq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ehq, querierCount[*EntitlementHistoryQuery](), ehq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) CountX(ctx context.Context) int { + count, err := ehq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ehq *EntitlementHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryExist) + switch _, err := ehq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ehq *EntitlementHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ehq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntitlementHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ehq *EntitlementHistoryQuery) Clone() *EntitlementHistoryQuery { + if ehq == nil { + return nil + } + return &EntitlementHistoryQuery{ + config: ehq.config, + ctx: ehq.ctx.Clone(), + order: append([]entitlementhistory.OrderOption{}, ehq.order...), + inters: append([]Interceptor{}, ehq.inters...), + predicates: append([]predicate.EntitlementHistory{}, ehq.predicates...), + // clone intermediate query. + sql: ehq.sql.Clone(), + path: ehq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntitlementHistory.Query(). +// GroupBy(entitlementhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ehq *EntitlementHistoryQuery) GroupBy(field string, fields ...string) *EntitlementHistoryGroupBy { + ehq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntitlementHistoryGroupBy{build: ehq} + grbuild.flds = &ehq.ctx.Fields + grbuild.label = entitlementhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.EntitlementHistory.Query(). +// Select(entitlementhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ehq *EntitlementHistoryQuery) Select(fields ...string) *EntitlementHistorySelect { + ehq.ctx.Fields = append(ehq.ctx.Fields, fields...) + sbuild := &EntitlementHistorySelect{EntitlementHistoryQuery: ehq} + sbuild.label = entitlementhistory.Label + sbuild.flds, sbuild.scan = &ehq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntitlementHistorySelect configured with the given aggregations. +func (ehq *EntitlementHistoryQuery) Aggregate(fns ...AggregateFunc) *EntitlementHistorySelect { + return ehq.Select().Aggregate(fns...) +} + +func (ehq *EntitlementHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ehq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ehq); err != nil { + return err + } + } + } + for _, f := range ehq.ctx.Fields { + if !entitlementhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ehq.path != nil { + prev, err := ehq.path(ctx) + if err != nil { + return err + } + ehq.sql = prev + } + if entitlementhistory.Policy == nil { + return errors.New("generated: uninitialized entitlementhistory.Policy (forgotten import generated/runtime?)") + } + if err := entitlementhistory.Policy.EvalQuery(ctx, ehq); err != nil { + return err + } + return nil +} + +func (ehq *EntitlementHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntitlementHistory, error) { + var ( + nodes = []*EntitlementHistory{} + _spec = ehq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntitlementHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntitlementHistory{config: ehq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ehq.schemaConfig.EntitlementHistory + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + if len(ehq.modifiers) > 0 { + _spec.Modifiers = ehq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ehq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ehq.loadTotal { + if err := ehq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ehq *EntitlementHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ehq.querySpec() + _spec.Node.Schema = ehq.schemaConfig.EntitlementHistory + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + if len(ehq.modifiers) > 0 { + _spec.Modifiers = ehq.modifiers + } + _spec.Node.Columns = ehq.ctx.Fields + if len(ehq.ctx.Fields) > 0 { + _spec.Unique = ehq.ctx.Unique != nil && *ehq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ehq.driver, _spec) +} + +func (ehq *EntitlementHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitlementhistory.Table, entitlementhistory.Columns, sqlgraph.NewFieldSpec(entitlementhistory.FieldID, field.TypeString)) + _spec.From = ehq.sql + if unique := ehq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ehq.path != nil { + _spec.Unique = true + } + if fields := ehq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementhistory.FieldID) + for i := range fields { + if fields[i] != entitlementhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ehq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ehq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ehq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ehq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ehq *EntitlementHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ehq.driver.Dialect()) + t1 := builder.Table(entitlementhistory.Table) + columns := ehq.ctx.Fields + if len(columns) == 0 { + columns = entitlementhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ehq.sql != nil { + selector = ehq.sql + selector.Select(selector.Columns(columns...)...) + } + if ehq.ctx.Unique != nil && *ehq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ehq.schemaConfig.EntitlementHistory) + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ehq.predicates { + p(selector) + } + for _, p := range ehq.order { + p(selector) + } + if offset := ehq.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 := ehq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// EntitlementHistoryGroupBy is the group-by builder for EntitlementHistory entities. +type EntitlementHistoryGroupBy struct { + selector + build *EntitlementHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ehgb *EntitlementHistoryGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementHistoryGroupBy { + ehgb.fns = append(ehgb.fns, fns...) + return ehgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ehgb *EntitlementHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ehgb.build.ctx, ent.OpQueryGroupBy) + if err := ehgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementHistoryQuery, *EntitlementHistoryGroupBy](ctx, ehgb.build, ehgb, ehgb.build.inters, v) +} + +func (ehgb *EntitlementHistoryGroupBy) sqlScan(ctx context.Context, root *EntitlementHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ehgb.fns)) + for _, fn := range ehgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ehgb.flds)+len(ehgb.fns)) + for _, f := range *ehgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ehgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ehgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntitlementHistorySelect is the builder for selecting fields of EntitlementHistory entities. +type EntitlementHistorySelect struct { + *EntitlementHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ehs *EntitlementHistorySelect) Aggregate(fns ...AggregateFunc) *EntitlementHistorySelect { + ehs.fns = append(ehs.fns, fns...) + return ehs +} + +// Scan applies the selector query and scans the result into the given value. +func (ehs *EntitlementHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ehs.ctx, ent.OpQuerySelect) + if err := ehs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementHistoryQuery, *EntitlementHistorySelect](ctx, ehs.EntitlementHistoryQuery, ehs, ehs.inters, v) +} + +func (ehs *EntitlementHistorySelect) sqlScan(ctx context.Context, root *EntitlementHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ehs.fns)) + for _, fn := range ehs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ehs.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 := ehs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitlementhistory_update.go b/internal/ent/generated/entitlementhistory_update.go new file mode 100644 index 0000000..232691d --- /dev/null +++ b/internal/ent/generated/entitlementhistory_update.go @@ -0,0 +1,757 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementHistoryUpdate is the builder for updating EntitlementHistory entities. +type EntitlementHistoryUpdate struct { + config + hooks []Hook + mutation *EntitlementHistoryMutation +} + +// Where appends a list predicates to the EntitlementHistoryUpdate builder. +func (ehu *EntitlementHistoryUpdate) Where(ps ...predicate.EntitlementHistory) *EntitlementHistoryUpdate { + ehu.mutation.Where(ps...) + return ehu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehu *EntitlementHistoryUpdate) SetUpdatedAt(t time.Time) *EntitlementHistoryUpdate { + ehu.mutation.SetUpdatedAt(t) + return ehu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ehu *EntitlementHistoryUpdate) ClearUpdatedAt() *EntitlementHistoryUpdate { + ehu.mutation.ClearUpdatedAt() + return ehu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehu *EntitlementHistoryUpdate) SetUpdatedBy(s string) *EntitlementHistoryUpdate { + ehu.mutation.SetUpdatedBy(s) + return ehu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableUpdatedBy(s *string) *EntitlementHistoryUpdate { + if s != nil { + ehu.SetUpdatedBy(*s) + } + return ehu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ehu *EntitlementHistoryUpdate) ClearUpdatedBy() *EntitlementHistoryUpdate { + ehu.mutation.ClearUpdatedBy() + return ehu +} + +// SetTags sets the "tags" field. +func (ehu *EntitlementHistoryUpdate) SetTags(s []string) *EntitlementHistoryUpdate { + ehu.mutation.SetTags(s) + return ehu +} + +// AppendTags appends s to the "tags" field. +func (ehu *EntitlementHistoryUpdate) AppendTags(s []string) *EntitlementHistoryUpdate { + ehu.mutation.AppendTags(s) + return ehu +} + +// ClearTags clears the value of the "tags" field. +func (ehu *EntitlementHistoryUpdate) ClearTags() *EntitlementHistoryUpdate { + ehu.mutation.ClearTags() + return ehu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ehu *EntitlementHistoryUpdate) SetDeletedAt(t time.Time) *EntitlementHistoryUpdate { + ehu.mutation.SetDeletedAt(t) + return ehu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementHistoryUpdate { + if t != nil { + ehu.SetDeletedAt(*t) + } + return ehu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ehu *EntitlementHistoryUpdate) ClearDeletedAt() *EntitlementHistoryUpdate { + ehu.mutation.ClearDeletedAt() + return ehu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ehu *EntitlementHistoryUpdate) SetDeletedBy(s string) *EntitlementHistoryUpdate { + ehu.mutation.SetDeletedBy(s) + return ehu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableDeletedBy(s *string) *EntitlementHistoryUpdate { + if s != nil { + ehu.SetDeletedBy(*s) + } + return ehu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ehu *EntitlementHistoryUpdate) ClearDeletedBy() *EntitlementHistoryUpdate { + ehu.mutation.ClearDeletedBy() + return ehu +} + +// SetOwnerID sets the "owner_id" field. +func (ehu *EntitlementHistoryUpdate) SetOwnerID(s string) *EntitlementHistoryUpdate { + ehu.mutation.SetOwnerID(s) + return ehu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableOwnerID(s *string) *EntitlementHistoryUpdate { + if s != nil { + ehu.SetOwnerID(*s) + } + return ehu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ehu *EntitlementHistoryUpdate) ClearOwnerID() *EntitlementHistoryUpdate { + ehu.mutation.ClearOwnerID() + return ehu +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (ehu *EntitlementHistoryUpdate) SetExternalCustomerID(s string) *EntitlementHistoryUpdate { + ehu.mutation.SetExternalCustomerID(s) + return ehu +} + +// SetNillableExternalCustomerID sets the "external_customer_id" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableExternalCustomerID(s *string) *EntitlementHistoryUpdate { + if s != nil { + ehu.SetExternalCustomerID(*s) + } + return ehu +} + +// ClearExternalCustomerID clears the value of the "external_customer_id" field. +func (ehu *EntitlementHistoryUpdate) ClearExternalCustomerID() *EntitlementHistoryUpdate { + ehu.mutation.ClearExternalCustomerID() + return ehu +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (ehu *EntitlementHistoryUpdate) SetExternalSubscriptionID(s string) *EntitlementHistoryUpdate { + ehu.mutation.SetExternalSubscriptionID(s) + return ehu +} + +// SetNillableExternalSubscriptionID sets the "external_subscription_id" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableExternalSubscriptionID(s *string) *EntitlementHistoryUpdate { + if s != nil { + ehu.SetExternalSubscriptionID(*s) + } + return ehu +} + +// ClearExternalSubscriptionID clears the value of the "external_subscription_id" field. +func (ehu *EntitlementHistoryUpdate) ClearExternalSubscriptionID() *EntitlementHistoryUpdate { + ehu.mutation.ClearExternalSubscriptionID() + return ehu +} + +// SetExpires sets the "expires" field. +func (ehu *EntitlementHistoryUpdate) SetExpires(b bool) *EntitlementHistoryUpdate { + ehu.mutation.SetExpires(b) + return ehu +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableExpires(b *bool) *EntitlementHistoryUpdate { + if b != nil { + ehu.SetExpires(*b) + } + return ehu +} + +// SetExpiresAt sets the "expires_at" field. +func (ehu *EntitlementHistoryUpdate) SetExpiresAt(t time.Time) *EntitlementHistoryUpdate { + ehu.mutation.SetExpiresAt(t) + return ehu +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableExpiresAt(t *time.Time) *EntitlementHistoryUpdate { + if t != nil { + ehu.SetExpiresAt(*t) + } + return ehu +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (ehu *EntitlementHistoryUpdate) ClearExpiresAt() *EntitlementHistoryUpdate { + ehu.mutation.ClearExpiresAt() + return ehu +} + +// SetCancelled sets the "cancelled" field. +func (ehu *EntitlementHistoryUpdate) SetCancelled(b bool) *EntitlementHistoryUpdate { + ehu.mutation.SetCancelled(b) + return ehu +} + +// SetNillableCancelled sets the "cancelled" field if the given value is not nil. +func (ehu *EntitlementHistoryUpdate) SetNillableCancelled(b *bool) *EntitlementHistoryUpdate { + if b != nil { + ehu.SetCancelled(*b) + } + return ehu +} + +// Mutation returns the EntitlementHistoryMutation object of the builder. +func (ehu *EntitlementHistoryUpdate) Mutation() *EntitlementHistoryMutation { + return ehu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ehu *EntitlementHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ehu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ehu.sqlSave, ehu.mutation, ehu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ehu *EntitlementHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ehu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ehu *EntitlementHistoryUpdate) Exec(ctx context.Context) error { + _, err := ehu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehu *EntitlementHistoryUpdate) ExecX(ctx context.Context) { + if err := ehu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehu *EntitlementHistoryUpdate) defaults() error { + if _, ok := ehu.mutation.UpdatedAt(); !ok && !ehu.mutation.UpdatedAtCleared() { + if entitlementhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementhistory.UpdateDefaultUpdatedAt() + ehu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ehu *EntitlementHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(entitlementhistory.Table, entitlementhistory.Columns, sqlgraph.NewFieldSpec(entitlementhistory.FieldID, field.TypeString)) + if ps := ehu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ehu.mutation.RefCleared() { + _spec.ClearField(entitlementhistory.FieldRef, field.TypeString) + } + if ehu.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ehu.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ehu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementhistory.FieldUpdatedAt, field.TypeTime) + } + if ehu.mutation.CreatedByCleared() { + _spec.ClearField(entitlementhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ehu.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementhistory.FieldUpdatedBy, field.TypeString, value) + } + if ehu.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ehu.mutation.Tags(); ok { + _spec.SetField(entitlementhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ehu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementhistory.FieldTags, value) + }) + } + if ehu.mutation.TagsCleared() { + _spec.ClearField(entitlementhistory.FieldTags, field.TypeJSON) + } + if value, ok := ehu.mutation.DeletedAt(); ok { + _spec.SetField(entitlementhistory.FieldDeletedAt, field.TypeTime, value) + } + if ehu.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ehu.mutation.DeletedBy(); ok { + _spec.SetField(entitlementhistory.FieldDeletedBy, field.TypeString, value) + } + if ehu.mutation.DeletedByCleared() { + _spec.ClearField(entitlementhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ehu.mutation.OwnerID(); ok { + _spec.SetField(entitlementhistory.FieldOwnerID, field.TypeString, value) + } + if ehu.mutation.OwnerIDCleared() { + _spec.ClearField(entitlementhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ehu.mutation.ExternalCustomerID(); ok { + _spec.SetField(entitlementhistory.FieldExternalCustomerID, field.TypeString, value) + } + if ehu.mutation.ExternalCustomerIDCleared() { + _spec.ClearField(entitlementhistory.FieldExternalCustomerID, field.TypeString) + } + if value, ok := ehu.mutation.ExternalSubscriptionID(); ok { + _spec.SetField(entitlementhistory.FieldExternalSubscriptionID, field.TypeString, value) + } + if ehu.mutation.ExternalSubscriptionIDCleared() { + _spec.ClearField(entitlementhistory.FieldExternalSubscriptionID, field.TypeString) + } + if value, ok := ehu.mutation.Expires(); ok { + _spec.SetField(entitlementhistory.FieldExpires, field.TypeBool, value) + } + if value, ok := ehu.mutation.ExpiresAt(); ok { + _spec.SetField(entitlementhistory.FieldExpiresAt, field.TypeTime, value) + } + if ehu.mutation.ExpiresAtCleared() { + _spec.ClearField(entitlementhistory.FieldExpiresAt, field.TypeTime) + } + if value, ok := ehu.mutation.Cancelled(); ok { + _spec.SetField(entitlementhistory.FieldCancelled, field.TypeBool, value) + } + _spec.Node.Schema = ehu.schemaConfig.EntitlementHistory + ctx = internal.NewSchemaConfigContext(ctx, ehu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ehu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ehu.mutation.done = true + return n, nil +} + +// EntitlementHistoryUpdateOne is the builder for updating a single EntitlementHistory entity. +type EntitlementHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntitlementHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehuo *EntitlementHistoryUpdateOne) SetUpdatedAt(t time.Time) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetUpdatedAt(t) + return ehuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearUpdatedAt() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearUpdatedAt() + return ehuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehuo *EntitlementHistoryUpdateOne) SetUpdatedBy(s string) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetUpdatedBy(s) + return ehuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableUpdatedBy(s *string) *EntitlementHistoryUpdateOne { + if s != nil { + ehuo.SetUpdatedBy(*s) + } + return ehuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearUpdatedBy() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearUpdatedBy() + return ehuo +} + +// SetTags sets the "tags" field. +func (ehuo *EntitlementHistoryUpdateOne) SetTags(s []string) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetTags(s) + return ehuo +} + +// AppendTags appends s to the "tags" field. +func (ehuo *EntitlementHistoryUpdateOne) AppendTags(s []string) *EntitlementHistoryUpdateOne { + ehuo.mutation.AppendTags(s) + return ehuo +} + +// ClearTags clears the value of the "tags" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearTags() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearTags() + return ehuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ehuo *EntitlementHistoryUpdateOne) SetDeletedAt(t time.Time) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetDeletedAt(t) + return ehuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementHistoryUpdateOne { + if t != nil { + ehuo.SetDeletedAt(*t) + } + return ehuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearDeletedAt() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearDeletedAt() + return ehuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ehuo *EntitlementHistoryUpdateOne) SetDeletedBy(s string) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetDeletedBy(s) + return ehuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableDeletedBy(s *string) *EntitlementHistoryUpdateOne { + if s != nil { + ehuo.SetDeletedBy(*s) + } + return ehuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearDeletedBy() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearDeletedBy() + return ehuo +} + +// SetOwnerID sets the "owner_id" field. +func (ehuo *EntitlementHistoryUpdateOne) SetOwnerID(s string) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetOwnerID(s) + return ehuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableOwnerID(s *string) *EntitlementHistoryUpdateOne { + if s != nil { + ehuo.SetOwnerID(*s) + } + return ehuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearOwnerID() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearOwnerID() + return ehuo +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (ehuo *EntitlementHistoryUpdateOne) SetExternalCustomerID(s string) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetExternalCustomerID(s) + return ehuo +} + +// SetNillableExternalCustomerID sets the "external_customer_id" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableExternalCustomerID(s *string) *EntitlementHistoryUpdateOne { + if s != nil { + ehuo.SetExternalCustomerID(*s) + } + return ehuo +} + +// ClearExternalCustomerID clears the value of the "external_customer_id" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearExternalCustomerID() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearExternalCustomerID() + return ehuo +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (ehuo *EntitlementHistoryUpdateOne) SetExternalSubscriptionID(s string) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetExternalSubscriptionID(s) + return ehuo +} + +// SetNillableExternalSubscriptionID sets the "external_subscription_id" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableExternalSubscriptionID(s *string) *EntitlementHistoryUpdateOne { + if s != nil { + ehuo.SetExternalSubscriptionID(*s) + } + return ehuo +} + +// ClearExternalSubscriptionID clears the value of the "external_subscription_id" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearExternalSubscriptionID() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearExternalSubscriptionID() + return ehuo +} + +// SetExpires sets the "expires" field. +func (ehuo *EntitlementHistoryUpdateOne) SetExpires(b bool) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetExpires(b) + return ehuo +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableExpires(b *bool) *EntitlementHistoryUpdateOne { + if b != nil { + ehuo.SetExpires(*b) + } + return ehuo +} + +// SetExpiresAt sets the "expires_at" field. +func (ehuo *EntitlementHistoryUpdateOne) SetExpiresAt(t time.Time) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetExpiresAt(t) + return ehuo +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableExpiresAt(t *time.Time) *EntitlementHistoryUpdateOne { + if t != nil { + ehuo.SetExpiresAt(*t) + } + return ehuo +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (ehuo *EntitlementHistoryUpdateOne) ClearExpiresAt() *EntitlementHistoryUpdateOne { + ehuo.mutation.ClearExpiresAt() + return ehuo +} + +// SetCancelled sets the "cancelled" field. +func (ehuo *EntitlementHistoryUpdateOne) SetCancelled(b bool) *EntitlementHistoryUpdateOne { + ehuo.mutation.SetCancelled(b) + return ehuo +} + +// SetNillableCancelled sets the "cancelled" field if the given value is not nil. +func (ehuo *EntitlementHistoryUpdateOne) SetNillableCancelled(b *bool) *EntitlementHistoryUpdateOne { + if b != nil { + ehuo.SetCancelled(*b) + } + return ehuo +} + +// Mutation returns the EntitlementHistoryMutation object of the builder. +func (ehuo *EntitlementHistoryUpdateOne) Mutation() *EntitlementHistoryMutation { + return ehuo.mutation +} + +// Where appends a list predicates to the EntitlementHistoryUpdate builder. +func (ehuo *EntitlementHistoryUpdateOne) Where(ps ...predicate.EntitlementHistory) *EntitlementHistoryUpdateOne { + ehuo.mutation.Where(ps...) + return ehuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ehuo *EntitlementHistoryUpdateOne) Select(field string, fields ...string) *EntitlementHistoryUpdateOne { + ehuo.fields = append([]string{field}, fields...) + return ehuo +} + +// Save executes the query and returns the updated EntitlementHistory entity. +func (ehuo *EntitlementHistoryUpdateOne) Save(ctx context.Context) (*EntitlementHistory, error) { + if err := ehuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ehuo.sqlSave, ehuo.mutation, ehuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ehuo *EntitlementHistoryUpdateOne) SaveX(ctx context.Context) *EntitlementHistory { + node, err := ehuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ehuo *EntitlementHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ehuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehuo *EntitlementHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ehuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehuo *EntitlementHistoryUpdateOne) defaults() error { + if _, ok := ehuo.mutation.UpdatedAt(); !ok && !ehuo.mutation.UpdatedAtCleared() { + if entitlementhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementhistory.UpdateDefaultUpdatedAt() + ehuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ehuo *EntitlementHistoryUpdateOne) sqlSave(ctx context.Context) (_node *EntitlementHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(entitlementhistory.Table, entitlementhistory.Columns, sqlgraph.NewFieldSpec(entitlementhistory.FieldID, field.TypeString)) + id, ok := ehuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntitlementHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ehuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementhistory.FieldID) + for _, f := range fields { + if !entitlementhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitlementhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ehuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ehuo.mutation.RefCleared() { + _spec.ClearField(entitlementhistory.FieldRef, field.TypeString) + } + if ehuo.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ehuo.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ehuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementhistory.FieldUpdatedAt, field.TypeTime) + } + if ehuo.mutation.CreatedByCleared() { + _spec.ClearField(entitlementhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ehuo.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementhistory.FieldUpdatedBy, field.TypeString, value) + } + if ehuo.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ehuo.mutation.Tags(); ok { + _spec.SetField(entitlementhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ehuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementhistory.FieldTags, value) + }) + } + if ehuo.mutation.TagsCleared() { + _spec.ClearField(entitlementhistory.FieldTags, field.TypeJSON) + } + if value, ok := ehuo.mutation.DeletedAt(); ok { + _spec.SetField(entitlementhistory.FieldDeletedAt, field.TypeTime, value) + } + if ehuo.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ehuo.mutation.DeletedBy(); ok { + _spec.SetField(entitlementhistory.FieldDeletedBy, field.TypeString, value) + } + if ehuo.mutation.DeletedByCleared() { + _spec.ClearField(entitlementhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ehuo.mutation.OwnerID(); ok { + _spec.SetField(entitlementhistory.FieldOwnerID, field.TypeString, value) + } + if ehuo.mutation.OwnerIDCleared() { + _spec.ClearField(entitlementhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ehuo.mutation.ExternalCustomerID(); ok { + _spec.SetField(entitlementhistory.FieldExternalCustomerID, field.TypeString, value) + } + if ehuo.mutation.ExternalCustomerIDCleared() { + _spec.ClearField(entitlementhistory.FieldExternalCustomerID, field.TypeString) + } + if value, ok := ehuo.mutation.ExternalSubscriptionID(); ok { + _spec.SetField(entitlementhistory.FieldExternalSubscriptionID, field.TypeString, value) + } + if ehuo.mutation.ExternalSubscriptionIDCleared() { + _spec.ClearField(entitlementhistory.FieldExternalSubscriptionID, field.TypeString) + } + if value, ok := ehuo.mutation.Expires(); ok { + _spec.SetField(entitlementhistory.FieldExpires, field.TypeBool, value) + } + if value, ok := ehuo.mutation.ExpiresAt(); ok { + _spec.SetField(entitlementhistory.FieldExpiresAt, field.TypeTime, value) + } + if ehuo.mutation.ExpiresAtCleared() { + _spec.ClearField(entitlementhistory.FieldExpiresAt, field.TypeTime) + } + if value, ok := ehuo.mutation.Cancelled(); ok { + _spec.SetField(entitlementhistory.FieldCancelled, field.TypeBool, value) + } + _spec.Node.Schema = ehuo.schemaConfig.EntitlementHistory + ctx = internal.NewSchemaConfigContext(ctx, ehuo.schemaConfig) + _node = &EntitlementHistory{config: ehuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ehuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ehuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entitlementplan.go b/internal/ent/generated/entitlementplan.go new file mode 100644 index 0000000..6d72394 --- /dev/null +++ b/internal/ent/generated/entitlementplan.go @@ -0,0 +1,450 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntitlementPlan is the model entity for the EntitlementPlan schema. +type EntitlementPlan struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName string `json:"display_name,omitempty"` + // the unique name of the plan + Name string `json:"name,omitempty"` + // a description of the plan + Description string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version,omitempty"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the EntitlementPlanQuery when eager-loading is set. + Edges EntitlementPlanEdges `json:"edges"` + selectValues sql.SelectValues +} + +// EntitlementPlanEdges holds the relations/edges for other nodes in the graph. +type EntitlementPlanEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Entitlements holds the value of the entitlements edge. + Entitlements []*Entitlement `json:"entitlements,omitempty"` + // BaseFeatures holds the value of the base_features edge. + BaseFeatures []*Feature `json:"base_features,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // Features holds the value of the features edge. + Features []*EntitlementPlanFeature `json:"features,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [5]bool + // totalCount holds the count of the edges above. + totalCount [5]map[string]int + + namedEntitlements map[string][]*Entitlement + namedBaseFeatures map[string][]*Feature + namedEvents map[string][]*Event + namedFeatures map[string][]*EntitlementPlanFeature +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntitlementPlanEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// EntitlementsOrErr returns the Entitlements value or an error if the edge +// was not loaded in eager-loading. +func (e EntitlementPlanEdges) EntitlementsOrErr() ([]*Entitlement, error) { + if e.loadedTypes[1] { + return e.Entitlements, nil + } + return nil, &NotLoadedError{edge: "entitlements"} +} + +// BaseFeaturesOrErr returns the BaseFeatures value or an error if the edge +// was not loaded in eager-loading. +func (e EntitlementPlanEdges) BaseFeaturesOrErr() ([]*Feature, error) { + if e.loadedTypes[2] { + return e.BaseFeatures, nil + } + return nil, &NotLoadedError{edge: "base_features"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e EntitlementPlanEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[3] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// FeaturesOrErr returns the Features value or an error if the edge +// was not loaded in eager-loading. +func (e EntitlementPlanEdges) FeaturesOrErr() ([]*EntitlementPlanFeature, error) { + if e.loadedTypes[4] { + return e.Features, nil + } + return nil, &NotLoadedError{edge: "features"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntitlementPlan) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitlementplan.FieldTags, entitlementplan.FieldMetadata: + values[i] = new([]byte) + case entitlementplan.FieldID, entitlementplan.FieldCreatedBy, entitlementplan.FieldUpdatedBy, entitlementplan.FieldMappingID, entitlementplan.FieldDeletedBy, entitlementplan.FieldOwnerID, entitlementplan.FieldDisplayName, entitlementplan.FieldName, entitlementplan.FieldDescription, entitlementplan.FieldVersion: + values[i] = new(sql.NullString) + case entitlementplan.FieldCreatedAt, entitlementplan.FieldUpdatedAt, entitlementplan.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntitlementPlan fields. +func (ep *EntitlementPlan) 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 entitlementplan.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + ep.ID = value.String + } + case entitlementplan.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + ep.CreatedAt = value.Time + } + case entitlementplan.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + ep.UpdatedAt = value.Time + } + case entitlementplan.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + ep.CreatedBy = value.String + } + case entitlementplan.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + ep.UpdatedBy = value.String + } + case entitlementplan.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + ep.MappingID = value.String + } + case entitlementplan.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + ep.DeletedAt = value.Time + } + case entitlementplan.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + ep.DeletedBy = value.String + } + case entitlementplan.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ep.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitlementplan.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + ep.OwnerID = value.String + } + case entitlementplan.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + ep.DisplayName = value.String + } + case entitlementplan.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + ep.Name = value.String + } + case entitlementplan.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + ep.Description = value.String + } + case entitlementplan.FieldVersion: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field version", values[i]) + } else if value.Valid { + ep.Version = value.String + } + case entitlementplan.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ep.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + default: + ep.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntitlementPlan. +// This includes values selected through modifiers, order, etc. +func (ep *EntitlementPlan) Value(name string) (ent.Value, error) { + return ep.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the EntitlementPlan entity. +func (ep *EntitlementPlan) QueryOwner() *OrganizationQuery { + return NewEntitlementPlanClient(ep.config).QueryOwner(ep) +} + +// QueryEntitlements queries the "entitlements" edge of the EntitlementPlan entity. +func (ep *EntitlementPlan) QueryEntitlements() *EntitlementQuery { + return NewEntitlementPlanClient(ep.config).QueryEntitlements(ep) +} + +// QueryBaseFeatures queries the "base_features" edge of the EntitlementPlan entity. +func (ep *EntitlementPlan) QueryBaseFeatures() *FeatureQuery { + return NewEntitlementPlanClient(ep.config).QueryBaseFeatures(ep) +} + +// QueryEvents queries the "events" edge of the EntitlementPlan entity. +func (ep *EntitlementPlan) QueryEvents() *EventQuery { + return NewEntitlementPlanClient(ep.config).QueryEvents(ep) +} + +// QueryFeatures queries the "features" edge of the EntitlementPlan entity. +func (ep *EntitlementPlan) QueryFeatures() *EntitlementPlanFeatureQuery { + return NewEntitlementPlanClient(ep.config).QueryFeatures(ep) +} + +// Update returns a builder for updating this EntitlementPlan. +// Note that you need to call EntitlementPlan.Unwrap() before calling this method if this EntitlementPlan +// was returned from a transaction, and the transaction was committed or rolled back. +func (ep *EntitlementPlan) Update() *EntitlementPlanUpdateOne { + return NewEntitlementPlanClient(ep.config).UpdateOne(ep) +} + +// Unwrap unwraps the EntitlementPlan 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 (ep *EntitlementPlan) Unwrap() *EntitlementPlan { + _tx, ok := ep.config.driver.(*txDriver) + if !ok { + panic("generated: EntitlementPlan is not a transactional entity") + } + ep.config.driver = _tx.drv + return ep +} + +// String implements the fmt.Stringer. +func (ep *EntitlementPlan) String() string { + var builder strings.Builder + builder.WriteString("EntitlementPlan(") + builder.WriteString(fmt.Sprintf("id=%v, ", ep.ID)) + builder.WriteString("created_at=") + builder.WriteString(ep.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(ep.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(ep.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(ep.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(ep.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(ep.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(ep.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", ep.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(ep.OwnerID) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(ep.DisplayName) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(ep.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(ep.Description) + builder.WriteString(", ") + builder.WriteString("version=") + builder.WriteString(ep.Version) + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", ep.Metadata)) + builder.WriteByte(')') + return builder.String() +} + +// NamedEntitlements returns the Entitlements named value or an error if the edge was not +// loaded in eager-loading with this name. +func (ep *EntitlementPlan) NamedEntitlements(name string) ([]*Entitlement, error) { + if ep.Edges.namedEntitlements == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := ep.Edges.namedEntitlements[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (ep *EntitlementPlan) appendNamedEntitlements(name string, edges ...*Entitlement) { + if ep.Edges.namedEntitlements == nil { + ep.Edges.namedEntitlements = make(map[string][]*Entitlement) + } + if len(edges) == 0 { + ep.Edges.namedEntitlements[name] = []*Entitlement{} + } else { + ep.Edges.namedEntitlements[name] = append(ep.Edges.namedEntitlements[name], edges...) + } +} + +// NamedBaseFeatures returns the BaseFeatures named value or an error if the edge was not +// loaded in eager-loading with this name. +func (ep *EntitlementPlan) NamedBaseFeatures(name string) ([]*Feature, error) { + if ep.Edges.namedBaseFeatures == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := ep.Edges.namedBaseFeatures[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (ep *EntitlementPlan) appendNamedBaseFeatures(name string, edges ...*Feature) { + if ep.Edges.namedBaseFeatures == nil { + ep.Edges.namedBaseFeatures = make(map[string][]*Feature) + } + if len(edges) == 0 { + ep.Edges.namedBaseFeatures[name] = []*Feature{} + } else { + ep.Edges.namedBaseFeatures[name] = append(ep.Edges.namedBaseFeatures[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (ep *EntitlementPlan) NamedEvents(name string) ([]*Event, error) { + if ep.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := ep.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (ep *EntitlementPlan) appendNamedEvents(name string, edges ...*Event) { + if ep.Edges.namedEvents == nil { + ep.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + ep.Edges.namedEvents[name] = []*Event{} + } else { + ep.Edges.namedEvents[name] = append(ep.Edges.namedEvents[name], edges...) + } +} + +// NamedFeatures returns the Features named value or an error if the edge was not +// loaded in eager-loading with this name. +func (ep *EntitlementPlan) NamedFeatures(name string) ([]*EntitlementPlanFeature, error) { + if ep.Edges.namedFeatures == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := ep.Edges.namedFeatures[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (ep *EntitlementPlan) appendNamedFeatures(name string, edges ...*EntitlementPlanFeature) { + if ep.Edges.namedFeatures == nil { + ep.Edges.namedFeatures = make(map[string][]*EntitlementPlanFeature) + } + if len(edges) == 0 { + ep.Edges.namedFeatures[name] = []*EntitlementPlanFeature{} + } else { + ep.Edges.namedFeatures[name] = append(ep.Edges.namedFeatures[name], edges...) + } +} + +// EntitlementPlans is a parsable slice of EntitlementPlan. +type EntitlementPlans []*EntitlementPlan diff --git a/internal/ent/generated/entitlementplan/entitlementplan.go b/internal/ent/generated/entitlementplan/entitlementplan.go new file mode 100644 index 0000000..fff35d8 --- /dev/null +++ b/internal/ent/generated/entitlementplan/entitlementplan.go @@ -0,0 +1,322 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplan + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the entitlementplan type in the database. + Label = "entitlement_plan" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldVersion holds the string denoting the version field in the database. + FieldVersion = "version" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeEntitlements holds the string denoting the entitlements edge name in mutations. + EdgeEntitlements = "entitlements" + // EdgeBaseFeatures holds the string denoting the base_features edge name in mutations. + EdgeBaseFeatures = "base_features" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // EdgeFeatures holds the string denoting the features edge name in mutations. + EdgeFeatures = "features" + // Table holds the table name of the entitlementplan in the database. + Table = "entitlement_plans" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "entitlement_plans" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // EntitlementsTable is the table that holds the entitlements relation/edge. + EntitlementsTable = "entitlements" + // EntitlementsInverseTable is the table name for the Entitlement entity. + // It exists in this package in order to avoid circular dependency with the "entitlement" package. + EntitlementsInverseTable = "entitlements" + // EntitlementsColumn is the table column denoting the entitlements relation/edge. + EntitlementsColumn = "plan_id" + // BaseFeaturesTable is the table that holds the base_features relation/edge. The primary key declared below. + BaseFeaturesTable = "entitlement_plan_features" + // BaseFeaturesInverseTable is the table name for the Feature entity. + // It exists in this package in order to avoid circular dependency with the "feature" package. + BaseFeaturesInverseTable = "features" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "entitlement_plan_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" + // FeaturesTable is the table that holds the features relation/edge. + FeaturesTable = "entitlement_plan_features" + // FeaturesInverseTable is the table name for the EntitlementPlanFeature entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplanfeature" package. + FeaturesInverseTable = "entitlement_plan_features" + // FeaturesColumn is the table column denoting the features relation/edge. + FeaturesColumn = "plan_id" +) + +// Columns holds all SQL columns for entitlementplan fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldDisplayName, + FieldName, + FieldDescription, + FieldVersion, + FieldMetadata, +} + +var ( + // BaseFeaturesPrimaryKey and BaseFeaturesColumn2 are the table columns denoting the + // primary key for the base_features relation (M2M). + BaseFeaturesPrimaryKey = []string{"feature_id", "plan_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"entitlement_plan_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // VersionValidator is a validator for the "version" field. It is called by the builders before save. + VersionValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the EntitlementPlan queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByVersion orders the results by the version field. +func ByVersion(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldVersion, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEntitlementsCount orders the results by entitlements count. +func ByEntitlementsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitlementsStep(), opts...) + } +} + +// ByEntitlements orders the results by entitlements terms. +func ByEntitlements(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitlementsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByBaseFeaturesCount orders the results by base_features count. +func ByBaseFeaturesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newBaseFeaturesStep(), opts...) + } +} + +// ByBaseFeatures orders the results by base_features terms. +func ByBaseFeatures(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newBaseFeaturesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFeaturesCount orders the results by features count. +func ByFeaturesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFeaturesStep(), opts...) + } +} + +// ByFeatures orders the results by features terms. +func ByFeatures(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFeaturesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newEntitlementsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitlementsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementsTable, EntitlementsColumn), + ) +} +func newBaseFeaturesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(BaseFeaturesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, BaseFeaturesTable, BaseFeaturesPrimaryKey...), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} +func newFeaturesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FeaturesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, FeaturesTable, FeaturesColumn), + ) +} diff --git a/internal/ent/generated/entitlementplan/where.go b/internal/ent/generated/entitlementplan/where.go new file mode 100644 index 0000000..33a98bd --- /dev/null +++ b/internal/ent/generated/entitlementplan/where.go @@ -0,0 +1,1103 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplan + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldOwnerID, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDisplayName, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDescription, v)) +} + +// Version applies equality check predicate on the "version" field. It's identical to VersionEQ. +func Version(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldVersion, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameIsNil applies the IsNil predicate on the "display_name" field. +func DisplayNameIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldDisplayName)) +} + +// DisplayNameNotNil applies the NotNil predicate on the "display_name" field. +func DisplayNameNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldDisplayName)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldDescription, v)) +} + +// VersionEQ applies the EQ predicate on the "version" field. +func VersionEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEQ(FieldVersion, v)) +} + +// VersionNEQ applies the NEQ predicate on the "version" field. +func VersionNEQ(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNEQ(FieldVersion, v)) +} + +// VersionIn applies the In predicate on the "version" field. +func VersionIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIn(FieldVersion, vs...)) +} + +// VersionNotIn applies the NotIn predicate on the "version" field. +func VersionNotIn(vs ...string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotIn(FieldVersion, vs...)) +} + +// VersionGT applies the GT predicate on the "version" field. +func VersionGT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGT(FieldVersion, v)) +} + +// VersionGTE applies the GTE predicate on the "version" field. +func VersionGTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldGTE(FieldVersion, v)) +} + +// VersionLT applies the LT predicate on the "version" field. +func VersionLT(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLT(FieldVersion, v)) +} + +// VersionLTE applies the LTE predicate on the "version" field. +func VersionLTE(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldLTE(FieldVersion, v)) +} + +// VersionContains applies the Contains predicate on the "version" field. +func VersionContains(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContains(FieldVersion, v)) +} + +// VersionHasPrefix applies the HasPrefix predicate on the "version" field. +func VersionHasPrefix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasPrefix(FieldVersion, v)) +} + +// VersionHasSuffix applies the HasSuffix predicate on the "version" field. +func VersionHasSuffix(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldHasSuffix(FieldVersion, v)) +} + +// VersionEqualFold applies the EqualFold predicate on the "version" field. +func VersionEqualFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldEqualFold(FieldVersion, v)) +} + +// VersionContainsFold applies the ContainsFold predicate on the "version" field. +func VersionContainsFold(v string) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldContainsFold(FieldVersion, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.FieldNotNull(FieldMetadata)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlan + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlan + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitlements applies the HasEdge predicate on the "entitlements" edge. +func HasEntitlements() predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementsTable, EntitlementsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitlementsWith applies the HasEdge predicate on the "entitlements" edge with a given conditions (other predicates). +func HasEntitlementsWith(preds ...predicate.Entitlement) predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := newEntitlementsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasBaseFeatures applies the HasEdge predicate on the "base_features" edge. +func HasBaseFeatures() predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, BaseFeaturesTable, BaseFeaturesPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasBaseFeaturesWith applies the HasEdge predicate on the "base_features" edge with a given conditions (other predicates). +func HasBaseFeaturesWith(preds ...predicate.Feature) predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := newBaseFeaturesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFeatures applies the HasEdge predicate on the "features" edge. +func HasFeatures() predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, FeaturesTable, FeaturesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFeaturesWith applies the HasEdge predicate on the "features" edge with a given conditions (other predicates). +func HasFeaturesWith(preds ...predicate.EntitlementPlanFeature) predicate.EntitlementPlan { + return predicate.EntitlementPlan(func(s *sql.Selector) { + step := newFeaturesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + 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.EntitlementPlan) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntitlementPlan) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntitlementPlan) predicate.EntitlementPlan { + return predicate.EntitlementPlan(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitlementplan_create.go b/internal/ent/generated/entitlementplan_create.go new file mode 100644 index 0000000..cb7b535 --- /dev/null +++ b/internal/ent/generated/entitlementplan_create.go @@ -0,0 +1,635 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntitlementPlanCreate is the builder for creating a EntitlementPlan entity. +type EntitlementPlanCreate struct { + config + mutation *EntitlementPlanMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (epc *EntitlementPlanCreate) SetCreatedAt(t time.Time) *EntitlementPlanCreate { + epc.mutation.SetCreatedAt(t) + return epc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableCreatedAt(t *time.Time) *EntitlementPlanCreate { + if t != nil { + epc.SetCreatedAt(*t) + } + return epc +} + +// SetUpdatedAt sets the "updated_at" field. +func (epc *EntitlementPlanCreate) SetUpdatedAt(t time.Time) *EntitlementPlanCreate { + epc.mutation.SetUpdatedAt(t) + return epc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementPlanCreate { + if t != nil { + epc.SetUpdatedAt(*t) + } + return epc +} + +// SetCreatedBy sets the "created_by" field. +func (epc *EntitlementPlanCreate) SetCreatedBy(s string) *EntitlementPlanCreate { + epc.mutation.SetCreatedBy(s) + return epc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableCreatedBy(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetCreatedBy(*s) + } + return epc +} + +// SetUpdatedBy sets the "updated_by" field. +func (epc *EntitlementPlanCreate) SetUpdatedBy(s string) *EntitlementPlanCreate { + epc.mutation.SetUpdatedBy(s) + return epc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableUpdatedBy(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetUpdatedBy(*s) + } + return epc +} + +// SetMappingID sets the "mapping_id" field. +func (epc *EntitlementPlanCreate) SetMappingID(s string) *EntitlementPlanCreate { + epc.mutation.SetMappingID(s) + return epc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableMappingID(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetMappingID(*s) + } + return epc +} + +// SetDeletedAt sets the "deleted_at" field. +func (epc *EntitlementPlanCreate) SetDeletedAt(t time.Time) *EntitlementPlanCreate { + epc.mutation.SetDeletedAt(t) + return epc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanCreate { + if t != nil { + epc.SetDeletedAt(*t) + } + return epc +} + +// SetDeletedBy sets the "deleted_by" field. +func (epc *EntitlementPlanCreate) SetDeletedBy(s string) *EntitlementPlanCreate { + epc.mutation.SetDeletedBy(s) + return epc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableDeletedBy(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetDeletedBy(*s) + } + return epc +} + +// SetTags sets the "tags" field. +func (epc *EntitlementPlanCreate) SetTags(s []string) *EntitlementPlanCreate { + epc.mutation.SetTags(s) + return epc +} + +// SetOwnerID sets the "owner_id" field. +func (epc *EntitlementPlanCreate) SetOwnerID(s string) *EntitlementPlanCreate { + epc.mutation.SetOwnerID(s) + return epc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableOwnerID(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetOwnerID(*s) + } + return epc +} + +// SetDisplayName sets the "display_name" field. +func (epc *EntitlementPlanCreate) SetDisplayName(s string) *EntitlementPlanCreate { + epc.mutation.SetDisplayName(s) + return epc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableDisplayName(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetDisplayName(*s) + } + return epc +} + +// SetName sets the "name" field. +func (epc *EntitlementPlanCreate) SetName(s string) *EntitlementPlanCreate { + epc.mutation.SetName(s) + return epc +} + +// SetDescription sets the "description" field. +func (epc *EntitlementPlanCreate) SetDescription(s string) *EntitlementPlanCreate { + epc.mutation.SetDescription(s) + return epc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableDescription(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetDescription(*s) + } + return epc +} + +// SetVersion sets the "version" field. +func (epc *EntitlementPlanCreate) SetVersion(s string) *EntitlementPlanCreate { + epc.mutation.SetVersion(s) + return epc +} + +// SetMetadata sets the "metadata" field. +func (epc *EntitlementPlanCreate) SetMetadata(m map[string]interface{}) *EntitlementPlanCreate { + epc.mutation.SetMetadata(m) + return epc +} + +// SetID sets the "id" field. +func (epc *EntitlementPlanCreate) SetID(s string) *EntitlementPlanCreate { + epc.mutation.SetID(s) + return epc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (epc *EntitlementPlanCreate) SetNillableID(s *string) *EntitlementPlanCreate { + if s != nil { + epc.SetID(*s) + } + return epc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (epc *EntitlementPlanCreate) SetOwner(o *Organization) *EntitlementPlanCreate { + return epc.SetOwnerID(o.ID) +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by IDs. +func (epc *EntitlementPlanCreate) AddEntitlementIDs(ids ...string) *EntitlementPlanCreate { + epc.mutation.AddEntitlementIDs(ids...) + return epc +} + +// AddEntitlements adds the "entitlements" edges to the Entitlement entity. +func (epc *EntitlementPlanCreate) AddEntitlements(e ...*Entitlement) *EntitlementPlanCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epc.AddEntitlementIDs(ids...) +} + +// AddBaseFeatureIDs adds the "base_features" edge to the Feature entity by IDs. +func (epc *EntitlementPlanCreate) AddBaseFeatureIDs(ids ...string) *EntitlementPlanCreate { + epc.mutation.AddBaseFeatureIDs(ids...) + return epc +} + +// AddBaseFeatures adds the "base_features" edges to the Feature entity. +func (epc *EntitlementPlanCreate) AddBaseFeatures(f ...*Feature) *EntitlementPlanCreate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return epc.AddBaseFeatureIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (epc *EntitlementPlanCreate) AddEventIDs(ids ...string) *EntitlementPlanCreate { + epc.mutation.AddEventIDs(ids...) + return epc +} + +// AddEvents adds the "events" edges to the Event entity. +func (epc *EntitlementPlanCreate) AddEvents(e ...*Event) *EntitlementPlanCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epc.AddEventIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by IDs. +func (epc *EntitlementPlanCreate) AddFeatureIDs(ids ...string) *EntitlementPlanCreate { + epc.mutation.AddFeatureIDs(ids...) + return epc +} + +// AddFeatures adds the "features" edges to the EntitlementPlanFeature entity. +func (epc *EntitlementPlanCreate) AddFeatures(e ...*EntitlementPlanFeature) *EntitlementPlanCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epc.AddFeatureIDs(ids...) +} + +// Mutation returns the EntitlementPlanMutation object of the builder. +func (epc *EntitlementPlanCreate) Mutation() *EntitlementPlanMutation { + return epc.mutation +} + +// Save creates the EntitlementPlan in the database. +func (epc *EntitlementPlanCreate) Save(ctx context.Context) (*EntitlementPlan, error) { + if err := epc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, epc.sqlSave, epc.mutation, epc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (epc *EntitlementPlanCreate) SaveX(ctx context.Context) *EntitlementPlan { + v, err := epc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (epc *EntitlementPlanCreate) Exec(ctx context.Context) error { + _, err := epc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epc *EntitlementPlanCreate) ExecX(ctx context.Context) { + if err := epc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epc *EntitlementPlanCreate) defaults() error { + if _, ok := epc.mutation.CreatedAt(); !ok { + if entitlementplan.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplan.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitlementplan.DefaultCreatedAt() + epc.mutation.SetCreatedAt(v) + } + if _, ok := epc.mutation.UpdatedAt(); !ok { + if entitlementplan.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplan.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplan.DefaultUpdatedAt() + epc.mutation.SetUpdatedAt(v) + } + if _, ok := epc.mutation.MappingID(); !ok { + if entitlementplan.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitlementplan.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitlementplan.DefaultMappingID() + epc.mutation.SetMappingID(v) + } + if _, ok := epc.mutation.Tags(); !ok { + v := entitlementplan.DefaultTags + epc.mutation.SetTags(v) + } + if _, ok := epc.mutation.ID(); !ok { + if entitlementplan.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitlementplan.DefaultID (forgotten import generated/runtime?)") + } + v := entitlementplan.DefaultID() + epc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (epc *EntitlementPlanCreate) check() error { + if _, ok := epc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntitlementPlan.mapping_id"`)} + } + if v, ok := epc.mutation.OwnerID(); ok { + if err := entitlementplan.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlan.owner_id": %w`, err)} + } + } + if _, ok := epc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "EntitlementPlan.name"`)} + } + if v, ok := epc.mutation.Name(); ok { + if err := entitlementplan.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlan.name": %w`, err)} + } + } + if _, ok := epc.mutation.Version(); !ok { + return &ValidationError{Name: "version", err: errors.New(`generated: missing required field "EntitlementPlan.version"`)} + } + if v, ok := epc.mutation.Version(); ok { + if err := entitlementplan.VersionValidator(v); err != nil { + return &ValidationError{Name: "version", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlan.version": %w`, err)} + } + } + return nil +} + +func (epc *EntitlementPlanCreate) sqlSave(ctx context.Context) (*EntitlementPlan, error) { + if err := epc.check(); err != nil { + return nil, err + } + _node, _spec := epc.createSpec() + if err := sqlgraph.CreateNode(ctx, epc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntitlementPlan.ID type: %T", _spec.ID.Value) + } + } + epc.mutation.id = &_node.ID + epc.mutation.done = true + return _node, nil +} + +func (epc *EntitlementPlanCreate) createSpec() (*EntitlementPlan, *sqlgraph.CreateSpec) { + var ( + _node = &EntitlementPlan{config: epc.config} + _spec = sqlgraph.NewCreateSpec(entitlementplan.Table, sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString)) + ) + _spec.Schema = epc.schemaConfig.EntitlementPlan + if id, ok := epc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := epc.mutation.CreatedAt(); ok { + _spec.SetField(entitlementplan.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := epc.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplan.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := epc.mutation.CreatedBy(); ok { + _spec.SetField(entitlementplan.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := epc.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplan.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := epc.mutation.MappingID(); ok { + _spec.SetField(entitlementplan.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := epc.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplan.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := epc.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplan.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := epc.mutation.Tags(); ok { + _spec.SetField(entitlementplan.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := epc.mutation.DisplayName(); ok { + _spec.SetField(entitlementplan.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := epc.mutation.Name(); ok { + _spec.SetField(entitlementplan.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := epc.mutation.Description(); ok { + _spec.SetField(entitlementplan.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := epc.mutation.Version(); ok { + _spec.SetField(entitlementplan.FieldVersion, field.TypeString, value) + _node.Version = value + } + if value, ok := epc.mutation.Metadata(); ok { + _spec.SetField(entitlementplan.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + if nodes := epc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplan.OwnerTable, + Columns: []string{entitlementplan.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epc.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := epc.mutation.EntitlementsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = epc.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := epc.mutation.BaseFeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: epc.config, mutation: newEntitlementPlanFeatureMutation(epc.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := epc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epc.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := epc.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = epc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// EntitlementPlanCreateBulk is the builder for creating many EntitlementPlan entities in bulk. +type EntitlementPlanCreateBulk struct { + config + err error + builders []*EntitlementPlanCreate +} + +// Save creates the EntitlementPlan entities in the database. +func (epcb *EntitlementPlanCreateBulk) Save(ctx context.Context) ([]*EntitlementPlan, error) { + if epcb.err != nil { + return nil, epcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(epcb.builders)) + nodes := make([]*EntitlementPlan, len(epcb.builders)) + mutators := make([]Mutator, len(epcb.builders)) + for i := range epcb.builders { + func(i int, root context.Context) { + builder := epcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntitlementPlanMutation) + 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, epcb.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, epcb.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, epcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (epcb *EntitlementPlanCreateBulk) SaveX(ctx context.Context) []*EntitlementPlan { + v, err := epcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (epcb *EntitlementPlanCreateBulk) Exec(ctx context.Context) error { + _, err := epcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epcb *EntitlementPlanCreateBulk) ExecX(ctx context.Context) { + if err := epcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplan_delete.go b/internal/ent/generated/entitlementplan_delete.go new file mode 100644 index 0000000..9a92490 --- /dev/null +++ b/internal/ent/generated/entitlementplan_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanDelete is the builder for deleting a EntitlementPlan entity. +type EntitlementPlanDelete struct { + config + hooks []Hook + mutation *EntitlementPlanMutation +} + +// Where appends a list predicates to the EntitlementPlanDelete builder. +func (epd *EntitlementPlanDelete) Where(ps ...predicate.EntitlementPlan) *EntitlementPlanDelete { + epd.mutation.Where(ps...) + return epd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (epd *EntitlementPlanDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, epd.sqlExec, epd.mutation, epd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (epd *EntitlementPlanDelete) ExecX(ctx context.Context) int { + n, err := epd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (epd *EntitlementPlanDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitlementplan.Table, sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString)) + _spec.Node.Schema = epd.schemaConfig.EntitlementPlan + ctx = internal.NewSchemaConfigContext(ctx, epd.schemaConfig) + if ps := epd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, epd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + epd.mutation.done = true + return affected, err +} + +// EntitlementPlanDeleteOne is the builder for deleting a single EntitlementPlan entity. +type EntitlementPlanDeleteOne struct { + epd *EntitlementPlanDelete +} + +// Where appends a list predicates to the EntitlementPlanDelete builder. +func (epdo *EntitlementPlanDeleteOne) Where(ps ...predicate.EntitlementPlan) *EntitlementPlanDeleteOne { + epdo.epd.mutation.Where(ps...) + return epdo +} + +// Exec executes the deletion query. +func (epdo *EntitlementPlanDeleteOne) Exec(ctx context.Context) error { + n, err := epdo.epd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitlementplan.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (epdo *EntitlementPlanDeleteOne) ExecX(ctx context.Context) { + if err := epdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplan_query.go b/internal/ent/generated/entitlementplan_query.go new file mode 100644 index 0000000..cb2c048 --- /dev/null +++ b/internal/ent/generated/entitlementplan_query.go @@ -0,0 +1,1099 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanQuery is the builder for querying EntitlementPlan entities. +type EntitlementPlanQuery struct { + config + ctx *QueryContext + order []entitlementplan.OrderOption + inters []Interceptor + predicates []predicate.EntitlementPlan + withOwner *OrganizationQuery + withEntitlements *EntitlementQuery + withBaseFeatures *FeatureQuery + withEvents *EventQuery + withFeatures *EntitlementPlanFeatureQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntitlementPlan) error + withNamedEntitlements map[string]*EntitlementQuery + withNamedBaseFeatures map[string]*FeatureQuery + withNamedEvents map[string]*EventQuery + withNamedFeatures map[string]*EntitlementPlanFeatureQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntitlementPlanQuery builder. +func (epq *EntitlementPlanQuery) Where(ps ...predicate.EntitlementPlan) *EntitlementPlanQuery { + epq.predicates = append(epq.predicates, ps...) + return epq +} + +// Limit the number of records to be returned by this query. +func (epq *EntitlementPlanQuery) Limit(limit int) *EntitlementPlanQuery { + epq.ctx.Limit = &limit + return epq +} + +// Offset to start from. +func (epq *EntitlementPlanQuery) Offset(offset int) *EntitlementPlanQuery { + epq.ctx.Offset = &offset + return epq +} + +// 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 (epq *EntitlementPlanQuery) Unique(unique bool) *EntitlementPlanQuery { + epq.ctx.Unique = &unique + return epq +} + +// Order specifies how the records should be ordered. +func (epq *EntitlementPlanQuery) Order(o ...entitlementplan.OrderOption) *EntitlementPlanQuery { + epq.order = append(epq.order, o...) + return epq +} + +// QueryOwner chains the current query on the "owner" edge. +func (epq *EntitlementPlanQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: epq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlementplan.OwnerTable, entitlementplan.OwnerColumn), + ) + schemaConfig := epq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlan + fromU = sqlgraph.SetNeighbors(epq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitlements chains the current query on the "entitlements" edge. +func (epq *EntitlementPlanQuery) QueryEntitlements() *EntitlementQuery { + query := (&EntitlementClient{config: epq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, selector), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, entitlementplan.EntitlementsTable, entitlementplan.EntitlementsColumn), + ) + schemaConfig := epq.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + fromU = sqlgraph.SetNeighbors(epq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryBaseFeatures chains the current query on the "base_features" edge. +func (epq *EntitlementPlanQuery) QueryBaseFeatures() *FeatureQuery { + query := (&FeatureClient{config: epq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, selector), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, entitlementplan.BaseFeaturesTable, entitlementplan.BaseFeaturesPrimaryKey...), + ) + schemaConfig := epq.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(epq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (epq *EntitlementPlanQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: epq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entitlementplan.EventsTable, entitlementplan.EventsPrimaryKey...), + ) + schemaConfig := epq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + fromU = sqlgraph.SetNeighbors(epq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFeatures chains the current query on the "features" edge. +func (epq *EntitlementPlanQuery) QueryFeatures() *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: epq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplan.Table, entitlementplan.FieldID, selector), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, entitlementplan.FeaturesTable, entitlementplan.FeaturesColumn), + ) + schemaConfig := epq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(epq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first EntitlementPlan entity from the query. +// Returns a *NotFoundError when no EntitlementPlan was found. +func (epq *EntitlementPlanQuery) First(ctx context.Context) (*EntitlementPlan, error) { + nodes, err := epq.Limit(1).All(setContextOp(ctx, epq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitlementplan.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (epq *EntitlementPlanQuery) FirstX(ctx context.Context) *EntitlementPlan { + node, err := epq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntitlementPlan ID from the query. +// Returns a *NotFoundError when no EntitlementPlan ID was found. +func (epq *EntitlementPlanQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = epq.Limit(1).IDs(setContextOp(ctx, epq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitlementplan.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (epq *EntitlementPlanQuery) FirstIDX(ctx context.Context) string { + id, err := epq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntitlementPlan entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntitlementPlan entity is found. +// Returns a *NotFoundError when no EntitlementPlan entities are found. +func (epq *EntitlementPlanQuery) Only(ctx context.Context) (*EntitlementPlan, error) { + nodes, err := epq.Limit(2).All(setContextOp(ctx, epq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitlementplan.Label} + default: + return nil, &NotSingularError{entitlementplan.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (epq *EntitlementPlanQuery) OnlyX(ctx context.Context) *EntitlementPlan { + node, err := epq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntitlementPlan ID in the query. +// Returns a *NotSingularError when more than one EntitlementPlan ID is found. +// Returns a *NotFoundError when no entities are found. +func (epq *EntitlementPlanQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = epq.Limit(2).IDs(setContextOp(ctx, epq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitlementplan.Label} + default: + err = &NotSingularError{entitlementplan.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (epq *EntitlementPlanQuery) OnlyIDX(ctx context.Context) string { + id, err := epq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntitlementPlans. +func (epq *EntitlementPlanQuery) All(ctx context.Context) ([]*EntitlementPlan, error) { + ctx = setContextOp(ctx, epq.ctx, ent.OpQueryAll) + if err := epq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntitlementPlan, *EntitlementPlanQuery]() + return withInterceptors[[]*EntitlementPlan](ctx, epq, qr, epq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (epq *EntitlementPlanQuery) AllX(ctx context.Context) []*EntitlementPlan { + nodes, err := epq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntitlementPlan IDs. +func (epq *EntitlementPlanQuery) IDs(ctx context.Context) (ids []string, err error) { + if epq.ctx.Unique == nil && epq.path != nil { + epq.Unique(true) + } + ctx = setContextOp(ctx, epq.ctx, ent.OpQueryIDs) + if err = epq.Select(entitlementplan.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (epq *EntitlementPlanQuery) IDsX(ctx context.Context) []string { + ids, err := epq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (epq *EntitlementPlanQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, epq.ctx, ent.OpQueryCount) + if err := epq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, epq, querierCount[*EntitlementPlanQuery](), epq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (epq *EntitlementPlanQuery) CountX(ctx context.Context) int { + count, err := epq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (epq *EntitlementPlanQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, epq.ctx, ent.OpQueryExist) + switch _, err := epq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (epq *EntitlementPlanQuery) ExistX(ctx context.Context) bool { + exist, err := epq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntitlementPlanQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (epq *EntitlementPlanQuery) Clone() *EntitlementPlanQuery { + if epq == nil { + return nil + } + return &EntitlementPlanQuery{ + config: epq.config, + ctx: epq.ctx.Clone(), + order: append([]entitlementplan.OrderOption{}, epq.order...), + inters: append([]Interceptor{}, epq.inters...), + predicates: append([]predicate.EntitlementPlan{}, epq.predicates...), + withOwner: epq.withOwner.Clone(), + withEntitlements: epq.withEntitlements.Clone(), + withBaseFeatures: epq.withBaseFeatures.Clone(), + withEvents: epq.withEvents.Clone(), + withFeatures: epq.withFeatures.Clone(), + // clone intermediate query. + sql: epq.sql.Clone(), + path: epq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithOwner(opts ...func(*OrganizationQuery)) *EntitlementPlanQuery { + query := (&OrganizationClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + epq.withOwner = query + return epq +} + +// WithEntitlements tells the query-builder to eager-load the nodes that are connected to +// the "entitlements" edge. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithEntitlements(opts ...func(*EntitlementQuery)) *EntitlementPlanQuery { + query := (&EntitlementClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + epq.withEntitlements = query + return epq +} + +// WithBaseFeatures tells the query-builder to eager-load the nodes that are connected to +// the "base_features" edge. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithBaseFeatures(opts ...func(*FeatureQuery)) *EntitlementPlanQuery { + query := (&FeatureClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + epq.withBaseFeatures = query + return epq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithEvents(opts ...func(*EventQuery)) *EntitlementPlanQuery { + query := (&EventClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + epq.withEvents = query + return epq +} + +// WithFeatures tells the query-builder to eager-load the nodes that are connected to +// the "features" edge. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithFeatures(opts ...func(*EntitlementPlanFeatureQuery)) *EntitlementPlanQuery { + query := (&EntitlementPlanFeatureClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + epq.withFeatures = query + return epq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntitlementPlan.Query(). +// GroupBy(entitlementplan.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (epq *EntitlementPlanQuery) GroupBy(field string, fields ...string) *EntitlementPlanGroupBy { + epq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntitlementPlanGroupBy{build: epq} + grbuild.flds = &epq.ctx.Fields + grbuild.label = entitlementplan.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.EntitlementPlan.Query(). +// Select(entitlementplan.FieldCreatedAt). +// Scan(ctx, &v) +func (epq *EntitlementPlanQuery) Select(fields ...string) *EntitlementPlanSelect { + epq.ctx.Fields = append(epq.ctx.Fields, fields...) + sbuild := &EntitlementPlanSelect{EntitlementPlanQuery: epq} + sbuild.label = entitlementplan.Label + sbuild.flds, sbuild.scan = &epq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntitlementPlanSelect configured with the given aggregations. +func (epq *EntitlementPlanQuery) Aggregate(fns ...AggregateFunc) *EntitlementPlanSelect { + return epq.Select().Aggregate(fns...) +} + +func (epq *EntitlementPlanQuery) prepareQuery(ctx context.Context) error { + for _, inter := range epq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, epq); err != nil { + return err + } + } + } + for _, f := range epq.ctx.Fields { + if !entitlementplan.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if epq.path != nil { + prev, err := epq.path(ctx) + if err != nil { + return err + } + epq.sql = prev + } + if entitlementplan.Policy == nil { + return errors.New("generated: uninitialized entitlementplan.Policy (forgotten import generated/runtime?)") + } + if err := entitlementplan.Policy.EvalQuery(ctx, epq); err != nil { + return err + } + return nil +} + +func (epq *EntitlementPlanQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntitlementPlan, error) { + var ( + nodes = []*EntitlementPlan{} + _spec = epq.querySpec() + loadedTypes = [5]bool{ + epq.withOwner != nil, + epq.withEntitlements != nil, + epq.withBaseFeatures != nil, + epq.withEvents != nil, + epq.withFeatures != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntitlementPlan).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntitlementPlan{config: epq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = epq.schemaConfig.EntitlementPlan + ctx = internal.NewSchemaConfigContext(ctx, epq.schemaConfig) + if len(epq.modifiers) > 0 { + _spec.Modifiers = epq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, epq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := epq.withOwner; query != nil { + if err := epq.loadOwner(ctx, query, nodes, nil, + func(n *EntitlementPlan, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := epq.withEntitlements; query != nil { + if err := epq.loadEntitlements(ctx, query, nodes, + func(n *EntitlementPlan) { n.Edges.Entitlements = []*Entitlement{} }, + func(n *EntitlementPlan, e *Entitlement) { n.Edges.Entitlements = append(n.Edges.Entitlements, e) }); err != nil { + return nil, err + } + } + if query := epq.withBaseFeatures; query != nil { + if err := epq.loadBaseFeatures(ctx, query, nodes, + func(n *EntitlementPlan) { n.Edges.BaseFeatures = []*Feature{} }, + func(n *EntitlementPlan, e *Feature) { n.Edges.BaseFeatures = append(n.Edges.BaseFeatures, e) }); err != nil { + return nil, err + } + } + if query := epq.withEvents; query != nil { + if err := epq.loadEvents(ctx, query, nodes, + func(n *EntitlementPlan) { n.Edges.Events = []*Event{} }, + func(n *EntitlementPlan, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + if query := epq.withFeatures; query != nil { + if err := epq.loadFeatures(ctx, query, nodes, + func(n *EntitlementPlan) { n.Edges.Features = []*EntitlementPlanFeature{} }, + func(n *EntitlementPlan, e *EntitlementPlanFeature) { n.Edges.Features = append(n.Edges.Features, e) }); err != nil { + return nil, err + } + } + for name, query := range epq.withNamedEntitlements { + if err := epq.loadEntitlements(ctx, query, nodes, + func(n *EntitlementPlan) { n.appendNamedEntitlements(name) }, + func(n *EntitlementPlan, e *Entitlement) { n.appendNamedEntitlements(name, e) }); err != nil { + return nil, err + } + } + for name, query := range epq.withNamedBaseFeatures { + if err := epq.loadBaseFeatures(ctx, query, nodes, + func(n *EntitlementPlan) { n.appendNamedBaseFeatures(name) }, + func(n *EntitlementPlan, e *Feature) { n.appendNamedBaseFeatures(name, e) }); err != nil { + return nil, err + } + } + for name, query := range epq.withNamedEvents { + if err := epq.loadEvents(ctx, query, nodes, + func(n *EntitlementPlan) { n.appendNamedEvents(name) }, + func(n *EntitlementPlan, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for name, query := range epq.withNamedFeatures { + if err := epq.loadFeatures(ctx, query, nodes, + func(n *EntitlementPlan) { n.appendNamedFeatures(name) }, + func(n *EntitlementPlan, e *EntitlementPlanFeature) { n.appendNamedFeatures(name, e) }); err != nil { + return nil, err + } + } + for i := range epq.loadTotal { + if err := epq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (epq *EntitlementPlanQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*EntitlementPlan, init func(*EntitlementPlan), assign func(*EntitlementPlan, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*EntitlementPlan) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (epq *EntitlementPlanQuery) loadEntitlements(ctx context.Context, query *EntitlementQuery, nodes []*EntitlementPlan, init func(*EntitlementPlan), assign func(*EntitlementPlan, *Entitlement)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*EntitlementPlan) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitlement.FieldPlanID) + } + query.Where(predicate.Entitlement(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(entitlementplan.EntitlementsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.PlanID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "plan_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (epq *EntitlementPlanQuery) loadBaseFeatures(ctx context.Context, query *FeatureQuery, nodes []*EntitlementPlan, init func(*EntitlementPlan), assign func(*EntitlementPlan, *Feature)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*EntitlementPlan) + nids := make(map[string]map[*EntitlementPlan]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(entitlementplan.BaseFeaturesTable) + joinT.Schema(epq.schemaConfig.EntitlementPlanFeature) + s.Join(joinT).On(s.C(feature.FieldID), joinT.C(entitlementplan.BaseFeaturesPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(entitlementplan.BaseFeaturesPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(entitlementplan.BaseFeaturesPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*EntitlementPlan]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Feature](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "base_features" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (epq *EntitlementPlanQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*EntitlementPlan, init func(*EntitlementPlan), assign func(*EntitlementPlan, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*EntitlementPlan) + nids := make(map[string]map[*EntitlementPlan]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(entitlementplan.EventsTable) + joinT.Schema(epq.schemaConfig.EntitlementPlanEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(entitlementplan.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(entitlementplan.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(entitlementplan.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*EntitlementPlan]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (epq *EntitlementPlanQuery) loadFeatures(ctx context.Context, query *EntitlementPlanFeatureQuery, nodes []*EntitlementPlan, init func(*EntitlementPlan), assign func(*EntitlementPlan, *EntitlementPlanFeature)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*EntitlementPlan) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitlementplanfeature.FieldPlanID) + } + query.Where(predicate.EntitlementPlanFeature(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(entitlementplan.FeaturesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.PlanID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "plan_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (epq *EntitlementPlanQuery) sqlCount(ctx context.Context) (int, error) { + _spec := epq.querySpec() + _spec.Node.Schema = epq.schemaConfig.EntitlementPlan + ctx = internal.NewSchemaConfigContext(ctx, epq.schemaConfig) + if len(epq.modifiers) > 0 { + _spec.Modifiers = epq.modifiers + } + _spec.Node.Columns = epq.ctx.Fields + if len(epq.ctx.Fields) > 0 { + _spec.Unique = epq.ctx.Unique != nil && *epq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, epq.driver, _spec) +} + +func (epq *EntitlementPlanQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitlementplan.Table, entitlementplan.Columns, sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString)) + _spec.From = epq.sql + if unique := epq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if epq.path != nil { + _spec.Unique = true + } + if fields := epq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplan.FieldID) + for i := range fields { + if fields[i] != entitlementplan.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if epq.withOwner != nil { + _spec.Node.AddColumnOnce(entitlementplan.FieldOwnerID) + } + } + if ps := epq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := epq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := epq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := epq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (epq *EntitlementPlanQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(epq.driver.Dialect()) + t1 := builder.Table(entitlementplan.Table) + columns := epq.ctx.Fields + if len(columns) == 0 { + columns = entitlementplan.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if epq.sql != nil { + selector = epq.sql + selector.Select(selector.Columns(columns...)...) + } + if epq.ctx.Unique != nil && *epq.ctx.Unique { + selector.Distinct() + } + t1.Schema(epq.schemaConfig.EntitlementPlan) + ctx = internal.NewSchemaConfigContext(ctx, epq.schemaConfig) + selector.WithContext(ctx) + for _, p := range epq.predicates { + p(selector) + } + for _, p := range epq.order { + p(selector) + } + if offset := epq.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 := epq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEntitlements tells the query-builder to eager-load the nodes that are connected to the "entitlements" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithNamedEntitlements(name string, opts ...func(*EntitlementQuery)) *EntitlementPlanQuery { + query := (&EntitlementClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + if epq.withNamedEntitlements == nil { + epq.withNamedEntitlements = make(map[string]*EntitlementQuery) + } + epq.withNamedEntitlements[name] = query + return epq +} + +// WithNamedBaseFeatures tells the query-builder to eager-load the nodes that are connected to the "base_features" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithNamedBaseFeatures(name string, opts ...func(*FeatureQuery)) *EntitlementPlanQuery { + query := (&FeatureClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + if epq.withNamedBaseFeatures == nil { + epq.withNamedBaseFeatures = make(map[string]*FeatureQuery) + } + epq.withNamedBaseFeatures[name] = query + return epq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *EntitlementPlanQuery { + query := (&EventClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + if epq.withNamedEvents == nil { + epq.withNamedEvents = make(map[string]*EventQuery) + } + epq.withNamedEvents[name] = query + return epq +} + +// WithNamedFeatures tells the query-builder to eager-load the nodes that are connected to the "features" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (epq *EntitlementPlanQuery) WithNamedFeatures(name string, opts ...func(*EntitlementPlanFeatureQuery)) *EntitlementPlanQuery { + query := (&EntitlementPlanFeatureClient{config: epq.config}).Query() + for _, opt := range opts { + opt(query) + } + if epq.withNamedFeatures == nil { + epq.withNamedFeatures = make(map[string]*EntitlementPlanFeatureQuery) + } + epq.withNamedFeatures[name] = query + return epq +} + +// EntitlementPlanGroupBy is the group-by builder for EntitlementPlan entities. +type EntitlementPlanGroupBy struct { + selector + build *EntitlementPlanQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (epgb *EntitlementPlanGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementPlanGroupBy { + epgb.fns = append(epgb.fns, fns...) + return epgb +} + +// Scan applies the selector query and scans the result into the given value. +func (epgb *EntitlementPlanGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, epgb.build.ctx, ent.OpQueryGroupBy) + if err := epgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanQuery, *EntitlementPlanGroupBy](ctx, epgb.build, epgb, epgb.build.inters, v) +} + +func (epgb *EntitlementPlanGroupBy) sqlScan(ctx context.Context, root *EntitlementPlanQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(epgb.fns)) + for _, fn := range epgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*epgb.flds)+len(epgb.fns)) + for _, f := range *epgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*epgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := epgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntitlementPlanSelect is the builder for selecting fields of EntitlementPlan entities. +type EntitlementPlanSelect struct { + *EntitlementPlanQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (eps *EntitlementPlanSelect) Aggregate(fns ...AggregateFunc) *EntitlementPlanSelect { + eps.fns = append(eps.fns, fns...) + return eps +} + +// Scan applies the selector query and scans the result into the given value. +func (eps *EntitlementPlanSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, eps.ctx, ent.OpQuerySelect) + if err := eps.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanQuery, *EntitlementPlanSelect](ctx, eps.EntitlementPlanQuery, eps, eps.inters, v) +} + +func (eps *EntitlementPlanSelect) sqlScan(ctx context.Context, root *EntitlementPlanQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(eps.fns)) + for _, fn := range eps.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*eps.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 := eps.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitlementplan_update.go b/internal/ent/generated/entitlementplan_update.go new file mode 100644 index 0000000..b614fb6 --- /dev/null +++ b/internal/ent/generated/entitlementplan_update.go @@ -0,0 +1,1484 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanUpdate is the builder for updating EntitlementPlan entities. +type EntitlementPlanUpdate struct { + config + hooks []Hook + mutation *EntitlementPlanMutation +} + +// Where appends a list predicates to the EntitlementPlanUpdate builder. +func (epu *EntitlementPlanUpdate) Where(ps ...predicate.EntitlementPlan) *EntitlementPlanUpdate { + epu.mutation.Where(ps...) + return epu +} + +// SetUpdatedAt sets the "updated_at" field. +func (epu *EntitlementPlanUpdate) SetUpdatedAt(t time.Time) *EntitlementPlanUpdate { + epu.mutation.SetUpdatedAt(t) + return epu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (epu *EntitlementPlanUpdate) ClearUpdatedAt() *EntitlementPlanUpdate { + epu.mutation.ClearUpdatedAt() + return epu +} + +// SetUpdatedBy sets the "updated_by" field. +func (epu *EntitlementPlanUpdate) SetUpdatedBy(s string) *EntitlementPlanUpdate { + epu.mutation.SetUpdatedBy(s) + return epu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epu *EntitlementPlanUpdate) SetNillableUpdatedBy(s *string) *EntitlementPlanUpdate { + if s != nil { + epu.SetUpdatedBy(*s) + } + return epu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (epu *EntitlementPlanUpdate) ClearUpdatedBy() *EntitlementPlanUpdate { + epu.mutation.ClearUpdatedBy() + return epu +} + +// SetDeletedAt sets the "deleted_at" field. +func (epu *EntitlementPlanUpdate) SetDeletedAt(t time.Time) *EntitlementPlanUpdate { + epu.mutation.SetDeletedAt(t) + return epu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epu *EntitlementPlanUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanUpdate { + if t != nil { + epu.SetDeletedAt(*t) + } + return epu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (epu *EntitlementPlanUpdate) ClearDeletedAt() *EntitlementPlanUpdate { + epu.mutation.ClearDeletedAt() + return epu +} + +// SetDeletedBy sets the "deleted_by" field. +func (epu *EntitlementPlanUpdate) SetDeletedBy(s string) *EntitlementPlanUpdate { + epu.mutation.SetDeletedBy(s) + return epu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epu *EntitlementPlanUpdate) SetNillableDeletedBy(s *string) *EntitlementPlanUpdate { + if s != nil { + epu.SetDeletedBy(*s) + } + return epu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (epu *EntitlementPlanUpdate) ClearDeletedBy() *EntitlementPlanUpdate { + epu.mutation.ClearDeletedBy() + return epu +} + +// SetTags sets the "tags" field. +func (epu *EntitlementPlanUpdate) SetTags(s []string) *EntitlementPlanUpdate { + epu.mutation.SetTags(s) + return epu +} + +// AppendTags appends s to the "tags" field. +func (epu *EntitlementPlanUpdate) AppendTags(s []string) *EntitlementPlanUpdate { + epu.mutation.AppendTags(s) + return epu +} + +// ClearTags clears the value of the "tags" field. +func (epu *EntitlementPlanUpdate) ClearTags() *EntitlementPlanUpdate { + epu.mutation.ClearTags() + return epu +} + +// SetOwnerID sets the "owner_id" field. +func (epu *EntitlementPlanUpdate) SetOwnerID(s string) *EntitlementPlanUpdate { + epu.mutation.SetOwnerID(s) + return epu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epu *EntitlementPlanUpdate) SetNillableOwnerID(s *string) *EntitlementPlanUpdate { + if s != nil { + epu.SetOwnerID(*s) + } + return epu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (epu *EntitlementPlanUpdate) ClearOwnerID() *EntitlementPlanUpdate { + epu.mutation.ClearOwnerID() + return epu +} + +// SetDisplayName sets the "display_name" field. +func (epu *EntitlementPlanUpdate) SetDisplayName(s string) *EntitlementPlanUpdate { + epu.mutation.SetDisplayName(s) + return epu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (epu *EntitlementPlanUpdate) SetNillableDisplayName(s *string) *EntitlementPlanUpdate { + if s != nil { + epu.SetDisplayName(*s) + } + return epu +} + +// ClearDisplayName clears the value of the "display_name" field. +func (epu *EntitlementPlanUpdate) ClearDisplayName() *EntitlementPlanUpdate { + epu.mutation.ClearDisplayName() + return epu +} + +// SetDescription sets the "description" field. +func (epu *EntitlementPlanUpdate) SetDescription(s string) *EntitlementPlanUpdate { + epu.mutation.SetDescription(s) + return epu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (epu *EntitlementPlanUpdate) SetNillableDescription(s *string) *EntitlementPlanUpdate { + if s != nil { + epu.SetDescription(*s) + } + return epu +} + +// ClearDescription clears the value of the "description" field. +func (epu *EntitlementPlanUpdate) ClearDescription() *EntitlementPlanUpdate { + epu.mutation.ClearDescription() + return epu +} + +// SetMetadata sets the "metadata" field. +func (epu *EntitlementPlanUpdate) SetMetadata(m map[string]interface{}) *EntitlementPlanUpdate { + epu.mutation.SetMetadata(m) + return epu +} + +// ClearMetadata clears the value of the "metadata" field. +func (epu *EntitlementPlanUpdate) ClearMetadata() *EntitlementPlanUpdate { + epu.mutation.ClearMetadata() + return epu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (epu *EntitlementPlanUpdate) SetOwner(o *Organization) *EntitlementPlanUpdate { + return epu.SetOwnerID(o.ID) +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by IDs. +func (epu *EntitlementPlanUpdate) AddEntitlementIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.AddEntitlementIDs(ids...) + return epu +} + +// AddEntitlements adds the "entitlements" edges to the Entitlement entity. +func (epu *EntitlementPlanUpdate) AddEntitlements(e ...*Entitlement) *EntitlementPlanUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epu.AddEntitlementIDs(ids...) +} + +// AddBaseFeatureIDs adds the "base_features" edge to the Feature entity by IDs. +func (epu *EntitlementPlanUpdate) AddBaseFeatureIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.AddBaseFeatureIDs(ids...) + return epu +} + +// AddBaseFeatures adds the "base_features" edges to the Feature entity. +func (epu *EntitlementPlanUpdate) AddBaseFeatures(f ...*Feature) *EntitlementPlanUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return epu.AddBaseFeatureIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (epu *EntitlementPlanUpdate) AddEventIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.AddEventIDs(ids...) + return epu +} + +// AddEvents adds the "events" edges to the Event entity. +func (epu *EntitlementPlanUpdate) AddEvents(e ...*Event) *EntitlementPlanUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epu.AddEventIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by IDs. +func (epu *EntitlementPlanUpdate) AddFeatureIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.AddFeatureIDs(ids...) + return epu +} + +// AddFeatures adds the "features" edges to the EntitlementPlanFeature entity. +func (epu *EntitlementPlanUpdate) AddFeatures(e ...*EntitlementPlanFeature) *EntitlementPlanUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epu.AddFeatureIDs(ids...) +} + +// Mutation returns the EntitlementPlanMutation object of the builder. +func (epu *EntitlementPlanUpdate) Mutation() *EntitlementPlanMutation { + return epu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (epu *EntitlementPlanUpdate) ClearOwner() *EntitlementPlanUpdate { + epu.mutation.ClearOwner() + return epu +} + +// ClearEntitlements clears all "entitlements" edges to the Entitlement entity. +func (epu *EntitlementPlanUpdate) ClearEntitlements() *EntitlementPlanUpdate { + epu.mutation.ClearEntitlements() + return epu +} + +// RemoveEntitlementIDs removes the "entitlements" edge to Entitlement entities by IDs. +func (epu *EntitlementPlanUpdate) RemoveEntitlementIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.RemoveEntitlementIDs(ids...) + return epu +} + +// RemoveEntitlements removes "entitlements" edges to Entitlement entities. +func (epu *EntitlementPlanUpdate) RemoveEntitlements(e ...*Entitlement) *EntitlementPlanUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epu.RemoveEntitlementIDs(ids...) +} + +// ClearBaseFeatures clears all "base_features" edges to the Feature entity. +func (epu *EntitlementPlanUpdate) ClearBaseFeatures() *EntitlementPlanUpdate { + epu.mutation.ClearBaseFeatures() + return epu +} + +// RemoveBaseFeatureIDs removes the "base_features" edge to Feature entities by IDs. +func (epu *EntitlementPlanUpdate) RemoveBaseFeatureIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.RemoveBaseFeatureIDs(ids...) + return epu +} + +// RemoveBaseFeatures removes "base_features" edges to Feature entities. +func (epu *EntitlementPlanUpdate) RemoveBaseFeatures(f ...*Feature) *EntitlementPlanUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return epu.RemoveBaseFeatureIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (epu *EntitlementPlanUpdate) ClearEvents() *EntitlementPlanUpdate { + epu.mutation.ClearEvents() + return epu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (epu *EntitlementPlanUpdate) RemoveEventIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.RemoveEventIDs(ids...) + return epu +} + +// RemoveEvents removes "events" edges to Event entities. +func (epu *EntitlementPlanUpdate) RemoveEvents(e ...*Event) *EntitlementPlanUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epu.RemoveEventIDs(ids...) +} + +// ClearFeatures clears all "features" edges to the EntitlementPlanFeature entity. +func (epu *EntitlementPlanUpdate) ClearFeatures() *EntitlementPlanUpdate { + epu.mutation.ClearFeatures() + return epu +} + +// RemoveFeatureIDs removes the "features" edge to EntitlementPlanFeature entities by IDs. +func (epu *EntitlementPlanUpdate) RemoveFeatureIDs(ids ...string) *EntitlementPlanUpdate { + epu.mutation.RemoveFeatureIDs(ids...) + return epu +} + +// RemoveFeatures removes "features" edges to EntitlementPlanFeature entities. +func (epu *EntitlementPlanUpdate) RemoveFeatures(e ...*EntitlementPlanFeature) *EntitlementPlanUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epu.RemoveFeatureIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (epu *EntitlementPlanUpdate) Save(ctx context.Context) (int, error) { + if err := epu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, epu.sqlSave, epu.mutation, epu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (epu *EntitlementPlanUpdate) SaveX(ctx context.Context) int { + affected, err := epu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (epu *EntitlementPlanUpdate) Exec(ctx context.Context) error { + _, err := epu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epu *EntitlementPlanUpdate) ExecX(ctx context.Context) { + if err := epu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epu *EntitlementPlanUpdate) defaults() error { + if _, ok := epu.mutation.UpdatedAt(); !ok && !epu.mutation.UpdatedAtCleared() { + if entitlementplan.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplan.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplan.UpdateDefaultUpdatedAt() + epu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (epu *EntitlementPlanUpdate) check() error { + if v, ok := epu.mutation.OwnerID(); ok { + if err := entitlementplan.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlan.owner_id": %w`, err)} + } + } + return nil +} + +func (epu *EntitlementPlanUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := epu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(entitlementplan.Table, entitlementplan.Columns, sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString)) + if ps := epu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if epu.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplan.FieldCreatedAt, field.TypeTime) + } + if value, ok := epu.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplan.FieldUpdatedAt, field.TypeTime, value) + } + if epu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplan.FieldUpdatedAt, field.TypeTime) + } + if epu.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplan.FieldCreatedBy, field.TypeString) + } + if value, ok := epu.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplan.FieldUpdatedBy, field.TypeString, value) + } + if epu.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplan.FieldUpdatedBy, field.TypeString) + } + if value, ok := epu.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplan.FieldDeletedAt, field.TypeTime, value) + } + if epu.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplan.FieldDeletedAt, field.TypeTime) + } + if value, ok := epu.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplan.FieldDeletedBy, field.TypeString, value) + } + if epu.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplan.FieldDeletedBy, field.TypeString) + } + if value, ok := epu.mutation.Tags(); ok { + _spec.SetField(entitlementplan.FieldTags, field.TypeJSON, value) + } + if value, ok := epu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplan.FieldTags, value) + }) + } + if epu.mutation.TagsCleared() { + _spec.ClearField(entitlementplan.FieldTags, field.TypeJSON) + } + if value, ok := epu.mutation.DisplayName(); ok { + _spec.SetField(entitlementplan.FieldDisplayName, field.TypeString, value) + } + if epu.mutation.DisplayNameCleared() { + _spec.ClearField(entitlementplan.FieldDisplayName, field.TypeString) + } + if value, ok := epu.mutation.Description(); ok { + _spec.SetField(entitlementplan.FieldDescription, field.TypeString, value) + } + if epu.mutation.DescriptionCleared() { + _spec.ClearField(entitlementplan.FieldDescription, field.TypeString) + } + if value, ok := epu.mutation.Metadata(); ok { + _spec.SetField(entitlementplan.FieldMetadata, field.TypeJSON, value) + } + if epu.mutation.MetadataCleared() { + _spec.ClearField(entitlementplan.FieldMetadata, field.TypeJSON) + } + if epu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplan.OwnerTable, + Columns: []string{entitlementplan.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlan + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplan.OwnerTable, + Columns: []string{entitlementplan.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epu.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.RemovedEntitlementsIDs(); len(nodes) > 0 && !epu.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.EntitlementsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epu.mutation.BaseFeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanFeature + createE := &EntitlementPlanFeatureCreate{config: epu.config, mutation: newEntitlementPlanFeatureMutation(epu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.RemovedBaseFeaturesIDs(); len(nodes) > 0 && !epu.mutation.BaseFeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: epu.config, mutation: newEntitlementPlanFeatureMutation(epu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.BaseFeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: epu.config, mutation: newEntitlementPlanFeatureMutation(epu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !epu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epu.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.RemovedFeaturesIDs(); len(nodes) > 0 && !epu.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epu.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = epu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = epu.schemaConfig.EntitlementPlan + ctx = internal.NewSchemaConfigContext(ctx, epu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, epu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplan.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + epu.mutation.done = true + return n, nil +} + +// EntitlementPlanUpdateOne is the builder for updating a single EntitlementPlan entity. +type EntitlementPlanUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntitlementPlanMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (epuo *EntitlementPlanUpdateOne) SetUpdatedAt(t time.Time) *EntitlementPlanUpdateOne { + epuo.mutation.SetUpdatedAt(t) + return epuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (epuo *EntitlementPlanUpdateOne) ClearUpdatedAt() *EntitlementPlanUpdateOne { + epuo.mutation.ClearUpdatedAt() + return epuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (epuo *EntitlementPlanUpdateOne) SetUpdatedBy(s string) *EntitlementPlanUpdateOne { + epuo.mutation.SetUpdatedBy(s) + return epuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epuo *EntitlementPlanUpdateOne) SetNillableUpdatedBy(s *string) *EntitlementPlanUpdateOne { + if s != nil { + epuo.SetUpdatedBy(*s) + } + return epuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (epuo *EntitlementPlanUpdateOne) ClearUpdatedBy() *EntitlementPlanUpdateOne { + epuo.mutation.ClearUpdatedBy() + return epuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (epuo *EntitlementPlanUpdateOne) SetDeletedAt(t time.Time) *EntitlementPlanUpdateOne { + epuo.mutation.SetDeletedAt(t) + return epuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epuo *EntitlementPlanUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementPlanUpdateOne { + if t != nil { + epuo.SetDeletedAt(*t) + } + return epuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (epuo *EntitlementPlanUpdateOne) ClearDeletedAt() *EntitlementPlanUpdateOne { + epuo.mutation.ClearDeletedAt() + return epuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (epuo *EntitlementPlanUpdateOne) SetDeletedBy(s string) *EntitlementPlanUpdateOne { + epuo.mutation.SetDeletedBy(s) + return epuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epuo *EntitlementPlanUpdateOne) SetNillableDeletedBy(s *string) *EntitlementPlanUpdateOne { + if s != nil { + epuo.SetDeletedBy(*s) + } + return epuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (epuo *EntitlementPlanUpdateOne) ClearDeletedBy() *EntitlementPlanUpdateOne { + epuo.mutation.ClearDeletedBy() + return epuo +} + +// SetTags sets the "tags" field. +func (epuo *EntitlementPlanUpdateOne) SetTags(s []string) *EntitlementPlanUpdateOne { + epuo.mutation.SetTags(s) + return epuo +} + +// AppendTags appends s to the "tags" field. +func (epuo *EntitlementPlanUpdateOne) AppendTags(s []string) *EntitlementPlanUpdateOne { + epuo.mutation.AppendTags(s) + return epuo +} + +// ClearTags clears the value of the "tags" field. +func (epuo *EntitlementPlanUpdateOne) ClearTags() *EntitlementPlanUpdateOne { + epuo.mutation.ClearTags() + return epuo +} + +// SetOwnerID sets the "owner_id" field. +func (epuo *EntitlementPlanUpdateOne) SetOwnerID(s string) *EntitlementPlanUpdateOne { + epuo.mutation.SetOwnerID(s) + return epuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epuo *EntitlementPlanUpdateOne) SetNillableOwnerID(s *string) *EntitlementPlanUpdateOne { + if s != nil { + epuo.SetOwnerID(*s) + } + return epuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (epuo *EntitlementPlanUpdateOne) ClearOwnerID() *EntitlementPlanUpdateOne { + epuo.mutation.ClearOwnerID() + return epuo +} + +// SetDisplayName sets the "display_name" field. +func (epuo *EntitlementPlanUpdateOne) SetDisplayName(s string) *EntitlementPlanUpdateOne { + epuo.mutation.SetDisplayName(s) + return epuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (epuo *EntitlementPlanUpdateOne) SetNillableDisplayName(s *string) *EntitlementPlanUpdateOne { + if s != nil { + epuo.SetDisplayName(*s) + } + return epuo +} + +// ClearDisplayName clears the value of the "display_name" field. +func (epuo *EntitlementPlanUpdateOne) ClearDisplayName() *EntitlementPlanUpdateOne { + epuo.mutation.ClearDisplayName() + return epuo +} + +// SetDescription sets the "description" field. +func (epuo *EntitlementPlanUpdateOne) SetDescription(s string) *EntitlementPlanUpdateOne { + epuo.mutation.SetDescription(s) + return epuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (epuo *EntitlementPlanUpdateOne) SetNillableDescription(s *string) *EntitlementPlanUpdateOne { + if s != nil { + epuo.SetDescription(*s) + } + return epuo +} + +// ClearDescription clears the value of the "description" field. +func (epuo *EntitlementPlanUpdateOne) ClearDescription() *EntitlementPlanUpdateOne { + epuo.mutation.ClearDescription() + return epuo +} + +// SetMetadata sets the "metadata" field. +func (epuo *EntitlementPlanUpdateOne) SetMetadata(m map[string]interface{}) *EntitlementPlanUpdateOne { + epuo.mutation.SetMetadata(m) + return epuo +} + +// ClearMetadata clears the value of the "metadata" field. +func (epuo *EntitlementPlanUpdateOne) ClearMetadata() *EntitlementPlanUpdateOne { + epuo.mutation.ClearMetadata() + return epuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (epuo *EntitlementPlanUpdateOne) SetOwner(o *Organization) *EntitlementPlanUpdateOne { + return epuo.SetOwnerID(o.ID) +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by IDs. +func (epuo *EntitlementPlanUpdateOne) AddEntitlementIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.AddEntitlementIDs(ids...) + return epuo +} + +// AddEntitlements adds the "entitlements" edges to the Entitlement entity. +func (epuo *EntitlementPlanUpdateOne) AddEntitlements(e ...*Entitlement) *EntitlementPlanUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epuo.AddEntitlementIDs(ids...) +} + +// AddBaseFeatureIDs adds the "base_features" edge to the Feature entity by IDs. +func (epuo *EntitlementPlanUpdateOne) AddBaseFeatureIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.AddBaseFeatureIDs(ids...) + return epuo +} + +// AddBaseFeatures adds the "base_features" edges to the Feature entity. +func (epuo *EntitlementPlanUpdateOne) AddBaseFeatures(f ...*Feature) *EntitlementPlanUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return epuo.AddBaseFeatureIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (epuo *EntitlementPlanUpdateOne) AddEventIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.AddEventIDs(ids...) + return epuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (epuo *EntitlementPlanUpdateOne) AddEvents(e ...*Event) *EntitlementPlanUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epuo.AddEventIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by IDs. +func (epuo *EntitlementPlanUpdateOne) AddFeatureIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.AddFeatureIDs(ids...) + return epuo +} + +// AddFeatures adds the "features" edges to the EntitlementPlanFeature entity. +func (epuo *EntitlementPlanUpdateOne) AddFeatures(e ...*EntitlementPlanFeature) *EntitlementPlanUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epuo.AddFeatureIDs(ids...) +} + +// Mutation returns the EntitlementPlanMutation object of the builder. +func (epuo *EntitlementPlanUpdateOne) Mutation() *EntitlementPlanMutation { + return epuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (epuo *EntitlementPlanUpdateOne) ClearOwner() *EntitlementPlanUpdateOne { + epuo.mutation.ClearOwner() + return epuo +} + +// ClearEntitlements clears all "entitlements" edges to the Entitlement entity. +func (epuo *EntitlementPlanUpdateOne) ClearEntitlements() *EntitlementPlanUpdateOne { + epuo.mutation.ClearEntitlements() + return epuo +} + +// RemoveEntitlementIDs removes the "entitlements" edge to Entitlement entities by IDs. +func (epuo *EntitlementPlanUpdateOne) RemoveEntitlementIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.RemoveEntitlementIDs(ids...) + return epuo +} + +// RemoveEntitlements removes "entitlements" edges to Entitlement entities. +func (epuo *EntitlementPlanUpdateOne) RemoveEntitlements(e ...*Entitlement) *EntitlementPlanUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epuo.RemoveEntitlementIDs(ids...) +} + +// ClearBaseFeatures clears all "base_features" edges to the Feature entity. +func (epuo *EntitlementPlanUpdateOne) ClearBaseFeatures() *EntitlementPlanUpdateOne { + epuo.mutation.ClearBaseFeatures() + return epuo +} + +// RemoveBaseFeatureIDs removes the "base_features" edge to Feature entities by IDs. +func (epuo *EntitlementPlanUpdateOne) RemoveBaseFeatureIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.RemoveBaseFeatureIDs(ids...) + return epuo +} + +// RemoveBaseFeatures removes "base_features" edges to Feature entities. +func (epuo *EntitlementPlanUpdateOne) RemoveBaseFeatures(f ...*Feature) *EntitlementPlanUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return epuo.RemoveBaseFeatureIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (epuo *EntitlementPlanUpdateOne) ClearEvents() *EntitlementPlanUpdateOne { + epuo.mutation.ClearEvents() + return epuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (epuo *EntitlementPlanUpdateOne) RemoveEventIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.RemoveEventIDs(ids...) + return epuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (epuo *EntitlementPlanUpdateOne) RemoveEvents(e ...*Event) *EntitlementPlanUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epuo.RemoveEventIDs(ids...) +} + +// ClearFeatures clears all "features" edges to the EntitlementPlanFeature entity. +func (epuo *EntitlementPlanUpdateOne) ClearFeatures() *EntitlementPlanUpdateOne { + epuo.mutation.ClearFeatures() + return epuo +} + +// RemoveFeatureIDs removes the "features" edge to EntitlementPlanFeature entities by IDs. +func (epuo *EntitlementPlanUpdateOne) RemoveFeatureIDs(ids ...string) *EntitlementPlanUpdateOne { + epuo.mutation.RemoveFeatureIDs(ids...) + return epuo +} + +// RemoveFeatures removes "features" edges to EntitlementPlanFeature entities. +func (epuo *EntitlementPlanUpdateOne) RemoveFeatures(e ...*EntitlementPlanFeature) *EntitlementPlanUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epuo.RemoveFeatureIDs(ids...) +} + +// Where appends a list predicates to the EntitlementPlanUpdate builder. +func (epuo *EntitlementPlanUpdateOne) Where(ps ...predicate.EntitlementPlan) *EntitlementPlanUpdateOne { + epuo.mutation.Where(ps...) + return epuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (epuo *EntitlementPlanUpdateOne) Select(field string, fields ...string) *EntitlementPlanUpdateOne { + epuo.fields = append([]string{field}, fields...) + return epuo +} + +// Save executes the query and returns the updated EntitlementPlan entity. +func (epuo *EntitlementPlanUpdateOne) Save(ctx context.Context) (*EntitlementPlan, error) { + if err := epuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, epuo.sqlSave, epuo.mutation, epuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (epuo *EntitlementPlanUpdateOne) SaveX(ctx context.Context) *EntitlementPlan { + node, err := epuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (epuo *EntitlementPlanUpdateOne) Exec(ctx context.Context) error { + _, err := epuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epuo *EntitlementPlanUpdateOne) ExecX(ctx context.Context) { + if err := epuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epuo *EntitlementPlanUpdateOne) defaults() error { + if _, ok := epuo.mutation.UpdatedAt(); !ok && !epuo.mutation.UpdatedAtCleared() { + if entitlementplan.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplan.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplan.UpdateDefaultUpdatedAt() + epuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (epuo *EntitlementPlanUpdateOne) check() error { + if v, ok := epuo.mutation.OwnerID(); ok { + if err := entitlementplan.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlan.owner_id": %w`, err)} + } + } + return nil +} + +func (epuo *EntitlementPlanUpdateOne) sqlSave(ctx context.Context) (_node *EntitlementPlan, err error) { + if err := epuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(entitlementplan.Table, entitlementplan.Columns, sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString)) + id, ok := epuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntitlementPlan.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := epuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplan.FieldID) + for _, f := range fields { + if !entitlementplan.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitlementplan.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := epuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if epuo.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplan.FieldCreatedAt, field.TypeTime) + } + if value, ok := epuo.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplan.FieldUpdatedAt, field.TypeTime, value) + } + if epuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplan.FieldUpdatedAt, field.TypeTime) + } + if epuo.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplan.FieldCreatedBy, field.TypeString) + } + if value, ok := epuo.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplan.FieldUpdatedBy, field.TypeString, value) + } + if epuo.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplan.FieldUpdatedBy, field.TypeString) + } + if value, ok := epuo.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplan.FieldDeletedAt, field.TypeTime, value) + } + if epuo.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplan.FieldDeletedAt, field.TypeTime) + } + if value, ok := epuo.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplan.FieldDeletedBy, field.TypeString, value) + } + if epuo.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplan.FieldDeletedBy, field.TypeString) + } + if value, ok := epuo.mutation.Tags(); ok { + _spec.SetField(entitlementplan.FieldTags, field.TypeJSON, value) + } + if value, ok := epuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplan.FieldTags, value) + }) + } + if epuo.mutation.TagsCleared() { + _spec.ClearField(entitlementplan.FieldTags, field.TypeJSON) + } + if value, ok := epuo.mutation.DisplayName(); ok { + _spec.SetField(entitlementplan.FieldDisplayName, field.TypeString, value) + } + if epuo.mutation.DisplayNameCleared() { + _spec.ClearField(entitlementplan.FieldDisplayName, field.TypeString) + } + if value, ok := epuo.mutation.Description(); ok { + _spec.SetField(entitlementplan.FieldDescription, field.TypeString, value) + } + if epuo.mutation.DescriptionCleared() { + _spec.ClearField(entitlementplan.FieldDescription, field.TypeString) + } + if value, ok := epuo.mutation.Metadata(); ok { + _spec.SetField(entitlementplan.FieldMetadata, field.TypeJSON, value) + } + if epuo.mutation.MetadataCleared() { + _spec.ClearField(entitlementplan.FieldMetadata, field.TypeJSON) + } + if epuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplan.OwnerTable, + Columns: []string{entitlementplan.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlan + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplan.OwnerTable, + Columns: []string{entitlementplan.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epuo.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.RemovedEntitlementsIDs(); len(nodes) > 0 && !epuo.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.EntitlementsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epuo.mutation.BaseFeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanFeature + createE := &EntitlementPlanFeatureCreate{config: epuo.config, mutation: newEntitlementPlanFeatureMutation(epuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.RemovedBaseFeaturesIDs(); len(nodes) > 0 && !epuo.mutation.BaseFeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: epuo.config, mutation: newEntitlementPlanFeatureMutation(epuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.BaseFeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: epuo.config, mutation: newEntitlementPlanFeatureMutation(epuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !epuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epuo.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.RemovedFeaturesIDs(); len(nodes) > 0 && !epuo.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epuo.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = epuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = epuo.schemaConfig.EntitlementPlan + ctx = internal.NewSchemaConfigContext(ctx, epuo.schemaConfig) + _node = &EntitlementPlan{config: epuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, epuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplan.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + epuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entitlementplanfeature.go b/internal/ent/generated/entitlementplanfeature.go new file mode 100644 index 0000000..a55b77d --- /dev/null +++ b/internal/ent/generated/entitlementplanfeature.go @@ -0,0 +1,343 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntitlementPlanFeature is the model entity for the EntitlementPlanFeature schema. +type EntitlementPlanFeature struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + // PlanID holds the value of the "plan_id" field. + PlanID string `json:"plan_id,omitempty"` + // FeatureID holds the value of the "feature_id" field. + FeatureID string `json:"feature_id,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the EntitlementPlanFeatureQuery when eager-loading is set. + Edges EntitlementPlanFeatureEdges `json:"edges"` + selectValues sql.SelectValues +} + +// EntitlementPlanFeatureEdges holds the relations/edges for other nodes in the graph. +type EntitlementPlanFeatureEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Plan holds the value of the plan edge. + Plan *EntitlementPlan `json:"plan,omitempty"` + // Feature holds the value of the feature edge. + Feature *Feature `json:"feature,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [4]bool + // totalCount holds the count of the edges above. + totalCount [4]map[string]int + + namedEvents map[string][]*Event +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntitlementPlanFeatureEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// PlanOrErr returns the Plan value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntitlementPlanFeatureEdges) PlanOrErr() (*EntitlementPlan, error) { + if e.Plan != nil { + return e.Plan, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: entitlementplan.Label} + } + return nil, &NotLoadedError{edge: "plan"} +} + +// FeatureOrErr returns the Feature value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntitlementPlanFeatureEdges) FeatureOrErr() (*Feature, error) { + if e.Feature != nil { + return e.Feature, nil + } else if e.loadedTypes[2] { + return nil, &NotFoundError{label: feature.Label} + } + return nil, &NotLoadedError{edge: "feature"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e EntitlementPlanFeatureEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[3] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntitlementPlanFeature) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitlementplanfeature.FieldTags, entitlementplanfeature.FieldMetadata: + values[i] = new([]byte) + case entitlementplanfeature.FieldID, entitlementplanfeature.FieldCreatedBy, entitlementplanfeature.FieldUpdatedBy, entitlementplanfeature.FieldMappingID, entitlementplanfeature.FieldDeletedBy, entitlementplanfeature.FieldOwnerID, entitlementplanfeature.FieldPlanID, entitlementplanfeature.FieldFeatureID: + values[i] = new(sql.NullString) + case entitlementplanfeature.FieldCreatedAt, entitlementplanfeature.FieldUpdatedAt, entitlementplanfeature.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntitlementPlanFeature fields. +func (epf *EntitlementPlanFeature) 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 entitlementplanfeature.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + epf.ID = value.String + } + case entitlementplanfeature.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + epf.CreatedAt = value.Time + } + case entitlementplanfeature.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + epf.UpdatedAt = value.Time + } + case entitlementplanfeature.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + epf.CreatedBy = value.String + } + case entitlementplanfeature.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + epf.UpdatedBy = value.String + } + case entitlementplanfeature.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + epf.MappingID = value.String + } + case entitlementplanfeature.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + epf.DeletedAt = value.Time + } + case entitlementplanfeature.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + epf.DeletedBy = value.String + } + case entitlementplanfeature.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &epf.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitlementplanfeature.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + epf.OwnerID = value.String + } + case entitlementplanfeature.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &epf.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + case entitlementplanfeature.FieldPlanID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field plan_id", values[i]) + } else if value.Valid { + epf.PlanID = value.String + } + case entitlementplanfeature.FieldFeatureID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field feature_id", values[i]) + } else if value.Valid { + epf.FeatureID = value.String + } + default: + epf.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntitlementPlanFeature. +// This includes values selected through modifiers, order, etc. +func (epf *EntitlementPlanFeature) Value(name string) (ent.Value, error) { + return epf.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the EntitlementPlanFeature entity. +func (epf *EntitlementPlanFeature) QueryOwner() *OrganizationQuery { + return NewEntitlementPlanFeatureClient(epf.config).QueryOwner(epf) +} + +// QueryPlan queries the "plan" edge of the EntitlementPlanFeature entity. +func (epf *EntitlementPlanFeature) QueryPlan() *EntitlementPlanQuery { + return NewEntitlementPlanFeatureClient(epf.config).QueryPlan(epf) +} + +// QueryFeature queries the "feature" edge of the EntitlementPlanFeature entity. +func (epf *EntitlementPlanFeature) QueryFeature() *FeatureQuery { + return NewEntitlementPlanFeatureClient(epf.config).QueryFeature(epf) +} + +// QueryEvents queries the "events" edge of the EntitlementPlanFeature entity. +func (epf *EntitlementPlanFeature) QueryEvents() *EventQuery { + return NewEntitlementPlanFeatureClient(epf.config).QueryEvents(epf) +} + +// Update returns a builder for updating this EntitlementPlanFeature. +// Note that you need to call EntitlementPlanFeature.Unwrap() before calling this method if this EntitlementPlanFeature +// was returned from a transaction, and the transaction was committed or rolled back. +func (epf *EntitlementPlanFeature) Update() *EntitlementPlanFeatureUpdateOne { + return NewEntitlementPlanFeatureClient(epf.config).UpdateOne(epf) +} + +// Unwrap unwraps the EntitlementPlanFeature 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 (epf *EntitlementPlanFeature) Unwrap() *EntitlementPlanFeature { + _tx, ok := epf.config.driver.(*txDriver) + if !ok { + panic("generated: EntitlementPlanFeature is not a transactional entity") + } + epf.config.driver = _tx.drv + return epf +} + +// String implements the fmt.Stringer. +func (epf *EntitlementPlanFeature) String() string { + var builder strings.Builder + builder.WriteString("EntitlementPlanFeature(") + builder.WriteString(fmt.Sprintf("id=%v, ", epf.ID)) + builder.WriteString("created_at=") + builder.WriteString(epf.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(epf.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(epf.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(epf.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(epf.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(epf.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(epf.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", epf.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(epf.OwnerID) + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", epf.Metadata)) + builder.WriteString(", ") + builder.WriteString("plan_id=") + builder.WriteString(epf.PlanID) + builder.WriteString(", ") + builder.WriteString("feature_id=") + builder.WriteString(epf.FeatureID) + builder.WriteByte(')') + return builder.String() +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (epf *EntitlementPlanFeature) NamedEvents(name string) ([]*Event, error) { + if epf.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := epf.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (epf *EntitlementPlanFeature) appendNamedEvents(name string, edges ...*Event) { + if epf.Edges.namedEvents == nil { + epf.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + epf.Edges.namedEvents[name] = []*Event{} + } else { + epf.Edges.namedEvents[name] = append(epf.Edges.namedEvents[name], edges...) + } +} + +// EntitlementPlanFeatures is a parsable slice of EntitlementPlanFeature. +type EntitlementPlanFeatures []*EntitlementPlanFeature diff --git a/internal/ent/generated/entitlementplanfeature/entitlementplanfeature.go b/internal/ent/generated/entitlementplanfeature/entitlementplanfeature.go new file mode 100644 index 0000000..12dcbcf --- /dev/null +++ b/internal/ent/generated/entitlementplanfeature/entitlementplanfeature.go @@ -0,0 +1,261 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplanfeature + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the entitlementplanfeature type in the database. + Label = "entitlement_plan_feature" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // FieldPlanID holds the string denoting the plan_id field in the database. + FieldPlanID = "plan_id" + // FieldFeatureID holds the string denoting the feature_id field in the database. + FieldFeatureID = "feature_id" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgePlan holds the string denoting the plan edge name in mutations. + EdgePlan = "plan" + // EdgeFeature holds the string denoting the feature edge name in mutations. + EdgeFeature = "feature" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the entitlementplanfeature in the database. + Table = "entitlement_plan_features" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "entitlement_plan_features" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // PlanTable is the table that holds the plan relation/edge. + PlanTable = "entitlement_plan_features" + // PlanInverseTable is the table name for the EntitlementPlan entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplan" package. + PlanInverseTable = "entitlement_plans" + // PlanColumn is the table column denoting the plan relation/edge. + PlanColumn = "plan_id" + // FeatureTable is the table that holds the feature relation/edge. + FeatureTable = "entitlement_plan_features" + // FeatureInverseTable is the table name for the Feature entity. + // It exists in this package in order to avoid circular dependency with the "feature" package. + FeatureInverseTable = "features" + // FeatureColumn is the table column denoting the feature relation/edge. + FeatureColumn = "feature_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "entitlement_plan_feature_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for entitlementplanfeature fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldMetadata, + FieldPlanID, + FieldFeatureID, +} + +var ( + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"entitlement_plan_feature_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // PlanIDValidator is a validator for the "plan_id" field. It is called by the builders before save. + PlanIDValidator func(string) error + // FeatureIDValidator is a validator for the "feature_id" field. It is called by the builders before save. + FeatureIDValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the EntitlementPlanFeature queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByPlanID orders the results by the plan_id field. +func ByPlanID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPlanID, opts...).ToFunc() +} + +// ByFeatureID orders the results by the feature_id field. +func ByFeatureID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFeatureID, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByPlanField orders the results by plan field. +func ByPlanField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPlanStep(), sql.OrderByField(field, opts...)) + } +} + +// ByFeatureField orders the results by feature field. +func ByFeatureField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFeatureStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newPlanStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PlanInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, PlanTable, PlanColumn), + ) +} +func newFeatureStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FeatureInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, FeatureTable, FeatureColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} diff --git a/internal/ent/generated/entitlementplanfeature/where.go b/internal/ent/generated/entitlementplanfeature/where.go new file mode 100644 index 0000000..863c09b --- /dev/null +++ b/internal/ent/generated/entitlementplanfeature/where.go @@ -0,0 +1,914 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplanfeature + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldOwnerID, v)) +} + +// PlanID applies equality check predicate on the "plan_id" field. It's identical to PlanIDEQ. +func PlanID(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldPlanID, v)) +} + +// FeatureID applies equality check predicate on the "feature_id" field. It's identical to FeatureIDEQ. +func FeatureID(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldFeatureID, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotNull(FieldMetadata)) +} + +// PlanIDEQ applies the EQ predicate on the "plan_id" field. +func PlanIDEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldPlanID, v)) +} + +// PlanIDNEQ applies the NEQ predicate on the "plan_id" field. +func PlanIDNEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldPlanID, v)) +} + +// PlanIDIn applies the In predicate on the "plan_id" field. +func PlanIDIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldPlanID, vs...)) +} + +// PlanIDNotIn applies the NotIn predicate on the "plan_id" field. +func PlanIDNotIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldPlanID, vs...)) +} + +// PlanIDGT applies the GT predicate on the "plan_id" field. +func PlanIDGT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldPlanID, v)) +} + +// PlanIDGTE applies the GTE predicate on the "plan_id" field. +func PlanIDGTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldPlanID, v)) +} + +// PlanIDLT applies the LT predicate on the "plan_id" field. +func PlanIDLT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldPlanID, v)) +} + +// PlanIDLTE applies the LTE predicate on the "plan_id" field. +func PlanIDLTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldPlanID, v)) +} + +// PlanIDContains applies the Contains predicate on the "plan_id" field. +func PlanIDContains(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContains(FieldPlanID, v)) +} + +// PlanIDHasPrefix applies the HasPrefix predicate on the "plan_id" field. +func PlanIDHasPrefix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasPrefix(FieldPlanID, v)) +} + +// PlanIDHasSuffix applies the HasSuffix predicate on the "plan_id" field. +func PlanIDHasSuffix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasSuffix(FieldPlanID, v)) +} + +// PlanIDEqualFold applies the EqualFold predicate on the "plan_id" field. +func PlanIDEqualFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldPlanID, v)) +} + +// PlanIDContainsFold applies the ContainsFold predicate on the "plan_id" field. +func PlanIDContainsFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldPlanID, v)) +} + +// FeatureIDEQ applies the EQ predicate on the "feature_id" field. +func FeatureIDEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEQ(FieldFeatureID, v)) +} + +// FeatureIDNEQ applies the NEQ predicate on the "feature_id" field. +func FeatureIDNEQ(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNEQ(FieldFeatureID, v)) +} + +// FeatureIDIn applies the In predicate on the "feature_id" field. +func FeatureIDIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldIn(FieldFeatureID, vs...)) +} + +// FeatureIDNotIn applies the NotIn predicate on the "feature_id" field. +func FeatureIDNotIn(vs ...string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldNotIn(FieldFeatureID, vs...)) +} + +// FeatureIDGT applies the GT predicate on the "feature_id" field. +func FeatureIDGT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGT(FieldFeatureID, v)) +} + +// FeatureIDGTE applies the GTE predicate on the "feature_id" field. +func FeatureIDGTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldGTE(FieldFeatureID, v)) +} + +// FeatureIDLT applies the LT predicate on the "feature_id" field. +func FeatureIDLT(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLT(FieldFeatureID, v)) +} + +// FeatureIDLTE applies the LTE predicate on the "feature_id" field. +func FeatureIDLTE(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldLTE(FieldFeatureID, v)) +} + +// FeatureIDContains applies the Contains predicate on the "feature_id" field. +func FeatureIDContains(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContains(FieldFeatureID, v)) +} + +// FeatureIDHasPrefix applies the HasPrefix predicate on the "feature_id" field. +func FeatureIDHasPrefix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasPrefix(FieldFeatureID, v)) +} + +// FeatureIDHasSuffix applies the HasSuffix predicate on the "feature_id" field. +func FeatureIDHasSuffix(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldHasSuffix(FieldFeatureID, v)) +} + +// FeatureIDEqualFold applies the EqualFold predicate on the "feature_id" field. +func FeatureIDEqualFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldEqualFold(FieldFeatureID, v)) +} + +// FeatureIDContainsFold applies the ContainsFold predicate on the "feature_id" field. +func FeatureIDContainsFold(v string) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.FieldContainsFold(FieldFeatureID, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasPlan applies the HasEdge predicate on the "plan" edge. +func HasPlan() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, PlanTable, PlanColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPlanWith applies the HasEdge predicate on the "plan" edge with a given conditions (other predicates). +func HasPlanWith(preds ...predicate.EntitlementPlan) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := newPlanStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFeature applies the HasEdge predicate on the "feature" edge. +func HasFeature() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, FeatureTable, FeatureColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFeatureWith applies the HasEdge predicate on the "feature" edge with a given conditions (other predicates). +func HasFeatureWith(preds ...predicate.Feature) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := newFeatureStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + 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.EntitlementPlanFeature) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntitlementPlanFeature) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntitlementPlanFeature) predicate.EntitlementPlanFeature { + return predicate.EntitlementPlanFeature(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitlementplanfeature_create.go b/internal/ent/generated/entitlementplanfeature_create.go new file mode 100644 index 0000000..698b971 --- /dev/null +++ b/internal/ent/generated/entitlementplanfeature_create.go @@ -0,0 +1,539 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntitlementPlanFeatureCreate is the builder for creating a EntitlementPlanFeature entity. +type EntitlementPlanFeatureCreate struct { + config + mutation *EntitlementPlanFeatureMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (epfc *EntitlementPlanFeatureCreate) SetCreatedAt(t time.Time) *EntitlementPlanFeatureCreate { + epfc.mutation.SetCreatedAt(t) + return epfc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableCreatedAt(t *time.Time) *EntitlementPlanFeatureCreate { + if t != nil { + epfc.SetCreatedAt(*t) + } + return epfc +} + +// SetUpdatedAt sets the "updated_at" field. +func (epfc *EntitlementPlanFeatureCreate) SetUpdatedAt(t time.Time) *EntitlementPlanFeatureCreate { + epfc.mutation.SetUpdatedAt(t) + return epfc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementPlanFeatureCreate { + if t != nil { + epfc.SetUpdatedAt(*t) + } + return epfc +} + +// SetCreatedBy sets the "created_by" field. +func (epfc *EntitlementPlanFeatureCreate) SetCreatedBy(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetCreatedBy(s) + return epfc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableCreatedBy(s *string) *EntitlementPlanFeatureCreate { + if s != nil { + epfc.SetCreatedBy(*s) + } + return epfc +} + +// SetUpdatedBy sets the "updated_by" field. +func (epfc *EntitlementPlanFeatureCreate) SetUpdatedBy(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetUpdatedBy(s) + return epfc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableUpdatedBy(s *string) *EntitlementPlanFeatureCreate { + if s != nil { + epfc.SetUpdatedBy(*s) + } + return epfc +} + +// SetMappingID sets the "mapping_id" field. +func (epfc *EntitlementPlanFeatureCreate) SetMappingID(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetMappingID(s) + return epfc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableMappingID(s *string) *EntitlementPlanFeatureCreate { + if s != nil { + epfc.SetMappingID(*s) + } + return epfc +} + +// SetDeletedAt sets the "deleted_at" field. +func (epfc *EntitlementPlanFeatureCreate) SetDeletedAt(t time.Time) *EntitlementPlanFeatureCreate { + epfc.mutation.SetDeletedAt(t) + return epfc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanFeatureCreate { + if t != nil { + epfc.SetDeletedAt(*t) + } + return epfc +} + +// SetDeletedBy sets the "deleted_by" field. +func (epfc *EntitlementPlanFeatureCreate) SetDeletedBy(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetDeletedBy(s) + return epfc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableDeletedBy(s *string) *EntitlementPlanFeatureCreate { + if s != nil { + epfc.SetDeletedBy(*s) + } + return epfc +} + +// SetTags sets the "tags" field. +func (epfc *EntitlementPlanFeatureCreate) SetTags(s []string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetTags(s) + return epfc +} + +// SetOwnerID sets the "owner_id" field. +func (epfc *EntitlementPlanFeatureCreate) SetOwnerID(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetOwnerID(s) + return epfc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableOwnerID(s *string) *EntitlementPlanFeatureCreate { + if s != nil { + epfc.SetOwnerID(*s) + } + return epfc +} + +// SetMetadata sets the "metadata" field. +func (epfc *EntitlementPlanFeatureCreate) SetMetadata(m map[string]interface{}) *EntitlementPlanFeatureCreate { + epfc.mutation.SetMetadata(m) + return epfc +} + +// SetPlanID sets the "plan_id" field. +func (epfc *EntitlementPlanFeatureCreate) SetPlanID(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetPlanID(s) + return epfc +} + +// SetFeatureID sets the "feature_id" field. +func (epfc *EntitlementPlanFeatureCreate) SetFeatureID(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetFeatureID(s) + return epfc +} + +// SetID sets the "id" field. +func (epfc *EntitlementPlanFeatureCreate) SetID(s string) *EntitlementPlanFeatureCreate { + epfc.mutation.SetID(s) + return epfc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (epfc *EntitlementPlanFeatureCreate) SetNillableID(s *string) *EntitlementPlanFeatureCreate { + if s != nil { + epfc.SetID(*s) + } + return epfc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (epfc *EntitlementPlanFeatureCreate) SetOwner(o *Organization) *EntitlementPlanFeatureCreate { + return epfc.SetOwnerID(o.ID) +} + +// SetPlan sets the "plan" edge to the EntitlementPlan entity. +func (epfc *EntitlementPlanFeatureCreate) SetPlan(e *EntitlementPlan) *EntitlementPlanFeatureCreate { + return epfc.SetPlanID(e.ID) +} + +// SetFeature sets the "feature" edge to the Feature entity. +func (epfc *EntitlementPlanFeatureCreate) SetFeature(f *Feature) *EntitlementPlanFeatureCreate { + return epfc.SetFeatureID(f.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (epfc *EntitlementPlanFeatureCreate) AddEventIDs(ids ...string) *EntitlementPlanFeatureCreate { + epfc.mutation.AddEventIDs(ids...) + return epfc +} + +// AddEvents adds the "events" edges to the Event entity. +func (epfc *EntitlementPlanFeatureCreate) AddEvents(e ...*Event) *EntitlementPlanFeatureCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epfc.AddEventIDs(ids...) +} + +// Mutation returns the EntitlementPlanFeatureMutation object of the builder. +func (epfc *EntitlementPlanFeatureCreate) Mutation() *EntitlementPlanFeatureMutation { + return epfc.mutation +} + +// Save creates the EntitlementPlanFeature in the database. +func (epfc *EntitlementPlanFeatureCreate) Save(ctx context.Context) (*EntitlementPlanFeature, error) { + if err := epfc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, epfc.sqlSave, epfc.mutation, epfc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (epfc *EntitlementPlanFeatureCreate) SaveX(ctx context.Context) *EntitlementPlanFeature { + v, err := epfc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (epfc *EntitlementPlanFeatureCreate) Exec(ctx context.Context) error { + _, err := epfc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfc *EntitlementPlanFeatureCreate) ExecX(ctx context.Context) { + if err := epfc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epfc *EntitlementPlanFeatureCreate) defaults() error { + if _, ok := epfc.mutation.CreatedAt(); !ok { + if entitlementplanfeature.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeature.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeature.DefaultCreatedAt() + epfc.mutation.SetCreatedAt(v) + } + if _, ok := epfc.mutation.UpdatedAt(); !ok { + if entitlementplanfeature.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeature.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeature.DefaultUpdatedAt() + epfc.mutation.SetUpdatedAt(v) + } + if _, ok := epfc.mutation.MappingID(); !ok { + if entitlementplanfeature.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeature.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitlementplanfeature.DefaultMappingID() + epfc.mutation.SetMappingID(v) + } + if _, ok := epfc.mutation.Tags(); !ok { + v := entitlementplanfeature.DefaultTags + epfc.mutation.SetTags(v) + } + if _, ok := epfc.mutation.ID(); !ok { + if entitlementplanfeature.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeature.DefaultID (forgotten import generated/runtime?)") + } + v := entitlementplanfeature.DefaultID() + epfc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (epfc *EntitlementPlanFeatureCreate) check() error { + if _, ok := epfc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntitlementPlanFeature.mapping_id"`)} + } + if v, ok := epfc.mutation.OwnerID(); ok { + if err := entitlementplanfeature.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlanFeature.owner_id": %w`, err)} + } + } + if _, ok := epfc.mutation.PlanID(); !ok { + return &ValidationError{Name: "plan_id", err: errors.New(`generated: missing required field "EntitlementPlanFeature.plan_id"`)} + } + if v, ok := epfc.mutation.PlanID(); ok { + if err := entitlementplanfeature.PlanIDValidator(v); err != nil { + return &ValidationError{Name: "plan_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlanFeature.plan_id": %w`, err)} + } + } + if _, ok := epfc.mutation.FeatureID(); !ok { + return &ValidationError{Name: "feature_id", err: errors.New(`generated: missing required field "EntitlementPlanFeature.feature_id"`)} + } + if v, ok := epfc.mutation.FeatureID(); ok { + if err := entitlementplanfeature.FeatureIDValidator(v); err != nil { + return &ValidationError{Name: "feature_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlanFeature.feature_id": %w`, err)} + } + } + if len(epfc.mutation.PlanIDs()) == 0 { + return &ValidationError{Name: "plan", err: errors.New(`generated: missing required edge "EntitlementPlanFeature.plan"`)} + } + if len(epfc.mutation.FeatureIDs()) == 0 { + return &ValidationError{Name: "feature", err: errors.New(`generated: missing required edge "EntitlementPlanFeature.feature"`)} + } + return nil +} + +func (epfc *EntitlementPlanFeatureCreate) sqlSave(ctx context.Context) (*EntitlementPlanFeature, error) { + if err := epfc.check(); err != nil { + return nil, err + } + _node, _spec := epfc.createSpec() + if err := sqlgraph.CreateNode(ctx, epfc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntitlementPlanFeature.ID type: %T", _spec.ID.Value) + } + } + epfc.mutation.id = &_node.ID + epfc.mutation.done = true + return _node, nil +} + +func (epfc *EntitlementPlanFeatureCreate) createSpec() (*EntitlementPlanFeature, *sqlgraph.CreateSpec) { + var ( + _node = &EntitlementPlanFeature{config: epfc.config} + _spec = sqlgraph.NewCreateSpec(entitlementplanfeature.Table, sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString)) + ) + _spec.Schema = epfc.schemaConfig.EntitlementPlanFeature + if id, ok := epfc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := epfc.mutation.CreatedAt(); ok { + _spec.SetField(entitlementplanfeature.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := epfc.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanfeature.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := epfc.mutation.CreatedBy(); ok { + _spec.SetField(entitlementplanfeature.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := epfc.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanfeature.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := epfc.mutation.MappingID(); ok { + _spec.SetField(entitlementplanfeature.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := epfc.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanfeature.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := epfc.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanfeature.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := epfc.mutation.Tags(); ok { + _spec.SetField(entitlementplanfeature.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := epfc.mutation.Metadata(); ok { + _spec.SetField(entitlementplanfeature.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + if nodes := epfc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplanfeature.OwnerTable, + Columns: []string{entitlementplanfeature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epfc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := epfc.mutation.PlanIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entitlementplanfeature.PlanTable, + Columns: []string{entitlementplanfeature.PlanColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = epfc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.PlanID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := epfc.mutation.FeatureIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entitlementplanfeature.FeatureTable, + Columns: []string{entitlementplanfeature.FeatureColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = epfc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.FeatureID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := epfc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epfc.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// EntitlementPlanFeatureCreateBulk is the builder for creating many EntitlementPlanFeature entities in bulk. +type EntitlementPlanFeatureCreateBulk struct { + config + err error + builders []*EntitlementPlanFeatureCreate +} + +// Save creates the EntitlementPlanFeature entities in the database. +func (epfcb *EntitlementPlanFeatureCreateBulk) Save(ctx context.Context) ([]*EntitlementPlanFeature, error) { + if epfcb.err != nil { + return nil, epfcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(epfcb.builders)) + nodes := make([]*EntitlementPlanFeature, len(epfcb.builders)) + mutators := make([]Mutator, len(epfcb.builders)) + for i := range epfcb.builders { + func(i int, root context.Context) { + builder := epfcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntitlementPlanFeatureMutation) + 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, epfcb.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, epfcb.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, epfcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (epfcb *EntitlementPlanFeatureCreateBulk) SaveX(ctx context.Context) []*EntitlementPlanFeature { + v, err := epfcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (epfcb *EntitlementPlanFeatureCreateBulk) Exec(ctx context.Context) error { + _, err := epfcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfcb *EntitlementPlanFeatureCreateBulk) ExecX(ctx context.Context) { + if err := epfcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplanfeature_delete.go b/internal/ent/generated/entitlementplanfeature_delete.go new file mode 100644 index 0000000..6e065c5 --- /dev/null +++ b/internal/ent/generated/entitlementplanfeature_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanFeatureDelete is the builder for deleting a EntitlementPlanFeature entity. +type EntitlementPlanFeatureDelete struct { + config + hooks []Hook + mutation *EntitlementPlanFeatureMutation +} + +// Where appends a list predicates to the EntitlementPlanFeatureDelete builder. +func (epfd *EntitlementPlanFeatureDelete) Where(ps ...predicate.EntitlementPlanFeature) *EntitlementPlanFeatureDelete { + epfd.mutation.Where(ps...) + return epfd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (epfd *EntitlementPlanFeatureDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, epfd.sqlExec, epfd.mutation, epfd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfd *EntitlementPlanFeatureDelete) ExecX(ctx context.Context) int { + n, err := epfd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (epfd *EntitlementPlanFeatureDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitlementplanfeature.Table, sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString)) + _spec.Node.Schema = epfd.schemaConfig.EntitlementPlanFeature + ctx = internal.NewSchemaConfigContext(ctx, epfd.schemaConfig) + if ps := epfd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, epfd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + epfd.mutation.done = true + return affected, err +} + +// EntitlementPlanFeatureDeleteOne is the builder for deleting a single EntitlementPlanFeature entity. +type EntitlementPlanFeatureDeleteOne struct { + epfd *EntitlementPlanFeatureDelete +} + +// Where appends a list predicates to the EntitlementPlanFeatureDelete builder. +func (epfdo *EntitlementPlanFeatureDeleteOne) Where(ps ...predicate.EntitlementPlanFeature) *EntitlementPlanFeatureDeleteOne { + epfdo.epfd.mutation.Where(ps...) + return epfdo +} + +// Exec executes the deletion query. +func (epfdo *EntitlementPlanFeatureDeleteOne) Exec(ctx context.Context) error { + n, err := epfdo.epfd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitlementplanfeature.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfdo *EntitlementPlanFeatureDeleteOne) ExecX(ctx context.Context) { + if err := epfdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplanfeature_query.go b/internal/ent/generated/entitlementplanfeature_query.go new file mode 100644 index 0000000..b8e66c2 --- /dev/null +++ b/internal/ent/generated/entitlementplanfeature_query.go @@ -0,0 +1,926 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanFeatureQuery is the builder for querying EntitlementPlanFeature entities. +type EntitlementPlanFeatureQuery struct { + config + ctx *QueryContext + order []entitlementplanfeature.OrderOption + inters []Interceptor + predicates []predicate.EntitlementPlanFeature + withOwner *OrganizationQuery + withPlan *EntitlementPlanQuery + withFeature *FeatureQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntitlementPlanFeature) error + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntitlementPlanFeatureQuery builder. +func (epfq *EntitlementPlanFeatureQuery) Where(ps ...predicate.EntitlementPlanFeature) *EntitlementPlanFeatureQuery { + epfq.predicates = append(epfq.predicates, ps...) + return epfq +} + +// Limit the number of records to be returned by this query. +func (epfq *EntitlementPlanFeatureQuery) Limit(limit int) *EntitlementPlanFeatureQuery { + epfq.ctx.Limit = &limit + return epfq +} + +// Offset to start from. +func (epfq *EntitlementPlanFeatureQuery) Offset(offset int) *EntitlementPlanFeatureQuery { + epfq.ctx.Offset = &offset + return epfq +} + +// 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 (epfq *EntitlementPlanFeatureQuery) Unique(unique bool) *EntitlementPlanFeatureQuery { + epfq.ctx.Unique = &unique + return epfq +} + +// Order specifies how the records should be ordered. +func (epfq *EntitlementPlanFeatureQuery) Order(o ...entitlementplanfeature.OrderOption) *EntitlementPlanFeatureQuery { + epfq.order = append(epfq.order, o...) + return epfq +} + +// QueryOwner chains the current query on the "owner" edge. +func (epfq *EntitlementPlanFeatureQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: epfq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epfq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epfq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitlementplanfeature.OwnerTable, entitlementplanfeature.OwnerColumn), + ) + schemaConfig := epfq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(epfq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryPlan chains the current query on the "plan" edge. +func (epfq *EntitlementPlanFeatureQuery) QueryPlan() *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: epfq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epfq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epfq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, selector), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, entitlementplanfeature.PlanTable, entitlementplanfeature.PlanColumn), + ) + schemaConfig := epfq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(epfq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFeature chains the current query on the "feature" edge. +func (epfq *EntitlementPlanFeatureQuery) QueryFeature() *FeatureQuery { + query := (&FeatureClient{config: epfq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epfq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epfq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, selector), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, entitlementplanfeature.FeatureTable, entitlementplanfeature.FeatureColumn), + ) + schemaConfig := epfq.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(epfq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (epfq *EntitlementPlanFeatureQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: epfq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := epfq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := epfq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitlementplanfeature.Table, entitlementplanfeature.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entitlementplanfeature.EventsTable, entitlementplanfeature.EventsPrimaryKey...), + ) + schemaConfig := epfq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + fromU = sqlgraph.SetNeighbors(epfq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first EntitlementPlanFeature entity from the query. +// Returns a *NotFoundError when no EntitlementPlanFeature was found. +func (epfq *EntitlementPlanFeatureQuery) First(ctx context.Context) (*EntitlementPlanFeature, error) { + nodes, err := epfq.Limit(1).All(setContextOp(ctx, epfq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitlementplanfeature.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) FirstX(ctx context.Context) *EntitlementPlanFeature { + node, err := epfq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntitlementPlanFeature ID from the query. +// Returns a *NotFoundError when no EntitlementPlanFeature ID was found. +func (epfq *EntitlementPlanFeatureQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = epfq.Limit(1).IDs(setContextOp(ctx, epfq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitlementplanfeature.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) FirstIDX(ctx context.Context) string { + id, err := epfq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntitlementPlanFeature entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntitlementPlanFeature entity is found. +// Returns a *NotFoundError when no EntitlementPlanFeature entities are found. +func (epfq *EntitlementPlanFeatureQuery) Only(ctx context.Context) (*EntitlementPlanFeature, error) { + nodes, err := epfq.Limit(2).All(setContextOp(ctx, epfq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitlementplanfeature.Label} + default: + return nil, &NotSingularError{entitlementplanfeature.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) OnlyX(ctx context.Context) *EntitlementPlanFeature { + node, err := epfq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntitlementPlanFeature ID in the query. +// Returns a *NotSingularError when more than one EntitlementPlanFeature ID is found. +// Returns a *NotFoundError when no entities are found. +func (epfq *EntitlementPlanFeatureQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = epfq.Limit(2).IDs(setContextOp(ctx, epfq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitlementplanfeature.Label} + default: + err = &NotSingularError{entitlementplanfeature.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) OnlyIDX(ctx context.Context) string { + id, err := epfq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntitlementPlanFeatures. +func (epfq *EntitlementPlanFeatureQuery) All(ctx context.Context) ([]*EntitlementPlanFeature, error) { + ctx = setContextOp(ctx, epfq.ctx, ent.OpQueryAll) + if err := epfq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntitlementPlanFeature, *EntitlementPlanFeatureQuery]() + return withInterceptors[[]*EntitlementPlanFeature](ctx, epfq, qr, epfq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) AllX(ctx context.Context) []*EntitlementPlanFeature { + nodes, err := epfq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntitlementPlanFeature IDs. +func (epfq *EntitlementPlanFeatureQuery) IDs(ctx context.Context) (ids []string, err error) { + if epfq.ctx.Unique == nil && epfq.path != nil { + epfq.Unique(true) + } + ctx = setContextOp(ctx, epfq.ctx, ent.OpQueryIDs) + if err = epfq.Select(entitlementplanfeature.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) IDsX(ctx context.Context) []string { + ids, err := epfq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (epfq *EntitlementPlanFeatureQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, epfq.ctx, ent.OpQueryCount) + if err := epfq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, epfq, querierCount[*EntitlementPlanFeatureQuery](), epfq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) CountX(ctx context.Context) int { + count, err := epfq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (epfq *EntitlementPlanFeatureQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, epfq.ctx, ent.OpQueryExist) + switch _, err := epfq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (epfq *EntitlementPlanFeatureQuery) ExistX(ctx context.Context) bool { + exist, err := epfq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntitlementPlanFeatureQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (epfq *EntitlementPlanFeatureQuery) Clone() *EntitlementPlanFeatureQuery { + if epfq == nil { + return nil + } + return &EntitlementPlanFeatureQuery{ + config: epfq.config, + ctx: epfq.ctx.Clone(), + order: append([]entitlementplanfeature.OrderOption{}, epfq.order...), + inters: append([]Interceptor{}, epfq.inters...), + predicates: append([]predicate.EntitlementPlanFeature{}, epfq.predicates...), + withOwner: epfq.withOwner.Clone(), + withPlan: epfq.withPlan.Clone(), + withFeature: epfq.withFeature.Clone(), + withEvents: epfq.withEvents.Clone(), + // clone intermediate query. + sql: epfq.sql.Clone(), + path: epfq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (epfq *EntitlementPlanFeatureQuery) WithOwner(opts ...func(*OrganizationQuery)) *EntitlementPlanFeatureQuery { + query := (&OrganizationClient{config: epfq.config}).Query() + for _, opt := range opts { + opt(query) + } + epfq.withOwner = query + return epfq +} + +// WithPlan tells the query-builder to eager-load the nodes that are connected to +// the "plan" edge. The optional arguments are used to configure the query builder of the edge. +func (epfq *EntitlementPlanFeatureQuery) WithPlan(opts ...func(*EntitlementPlanQuery)) *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanClient{config: epfq.config}).Query() + for _, opt := range opts { + opt(query) + } + epfq.withPlan = query + return epfq +} + +// WithFeature tells the query-builder to eager-load the nodes that are connected to +// the "feature" edge. The optional arguments are used to configure the query builder of the edge. +func (epfq *EntitlementPlanFeatureQuery) WithFeature(opts ...func(*FeatureQuery)) *EntitlementPlanFeatureQuery { + query := (&FeatureClient{config: epfq.config}).Query() + for _, opt := range opts { + opt(query) + } + epfq.withFeature = query + return epfq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (epfq *EntitlementPlanFeatureQuery) WithEvents(opts ...func(*EventQuery)) *EntitlementPlanFeatureQuery { + query := (&EventClient{config: epfq.config}).Query() + for _, opt := range opts { + opt(query) + } + epfq.withEvents = query + return epfq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntitlementPlanFeature.Query(). +// GroupBy(entitlementplanfeature.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (epfq *EntitlementPlanFeatureQuery) GroupBy(field string, fields ...string) *EntitlementPlanFeatureGroupBy { + epfq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntitlementPlanFeatureGroupBy{build: epfq} + grbuild.flds = &epfq.ctx.Fields + grbuild.label = entitlementplanfeature.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.EntitlementPlanFeature.Query(). +// Select(entitlementplanfeature.FieldCreatedAt). +// Scan(ctx, &v) +func (epfq *EntitlementPlanFeatureQuery) Select(fields ...string) *EntitlementPlanFeatureSelect { + epfq.ctx.Fields = append(epfq.ctx.Fields, fields...) + sbuild := &EntitlementPlanFeatureSelect{EntitlementPlanFeatureQuery: epfq} + sbuild.label = entitlementplanfeature.Label + sbuild.flds, sbuild.scan = &epfq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntitlementPlanFeatureSelect configured with the given aggregations. +func (epfq *EntitlementPlanFeatureQuery) Aggregate(fns ...AggregateFunc) *EntitlementPlanFeatureSelect { + return epfq.Select().Aggregate(fns...) +} + +func (epfq *EntitlementPlanFeatureQuery) prepareQuery(ctx context.Context) error { + for _, inter := range epfq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, epfq); err != nil { + return err + } + } + } + for _, f := range epfq.ctx.Fields { + if !entitlementplanfeature.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if epfq.path != nil { + prev, err := epfq.path(ctx) + if err != nil { + return err + } + epfq.sql = prev + } + if entitlementplanfeature.Policy == nil { + return errors.New("generated: uninitialized entitlementplanfeature.Policy (forgotten import generated/runtime?)") + } + if err := entitlementplanfeature.Policy.EvalQuery(ctx, epfq); err != nil { + return err + } + return nil +} + +func (epfq *EntitlementPlanFeatureQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntitlementPlanFeature, error) { + var ( + nodes = []*EntitlementPlanFeature{} + _spec = epfq.querySpec() + loadedTypes = [4]bool{ + epfq.withOwner != nil, + epfq.withPlan != nil, + epfq.withFeature != nil, + epfq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntitlementPlanFeature).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntitlementPlanFeature{config: epfq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = epfq.schemaConfig.EntitlementPlanFeature + ctx = internal.NewSchemaConfigContext(ctx, epfq.schemaConfig) + if len(epfq.modifiers) > 0 { + _spec.Modifiers = epfq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, epfq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := epfq.withOwner; query != nil { + if err := epfq.loadOwner(ctx, query, nodes, nil, + func(n *EntitlementPlanFeature, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := epfq.withPlan; query != nil { + if err := epfq.loadPlan(ctx, query, nodes, nil, + func(n *EntitlementPlanFeature, e *EntitlementPlan) { n.Edges.Plan = e }); err != nil { + return nil, err + } + } + if query := epfq.withFeature; query != nil { + if err := epfq.loadFeature(ctx, query, nodes, nil, + func(n *EntitlementPlanFeature, e *Feature) { n.Edges.Feature = e }); err != nil { + return nil, err + } + } + if query := epfq.withEvents; query != nil { + if err := epfq.loadEvents(ctx, query, nodes, + func(n *EntitlementPlanFeature) { n.Edges.Events = []*Event{} }, + func(n *EntitlementPlanFeature, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range epfq.withNamedEvents { + if err := epfq.loadEvents(ctx, query, nodes, + func(n *EntitlementPlanFeature) { n.appendNamedEvents(name) }, + func(n *EntitlementPlanFeature, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range epfq.loadTotal { + if err := epfq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (epfq *EntitlementPlanFeatureQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*EntitlementPlanFeature, init func(*EntitlementPlanFeature), assign func(*EntitlementPlanFeature, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*EntitlementPlanFeature) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (epfq *EntitlementPlanFeatureQuery) loadPlan(ctx context.Context, query *EntitlementPlanQuery, nodes []*EntitlementPlanFeature, init func(*EntitlementPlanFeature), assign func(*EntitlementPlanFeature, *EntitlementPlan)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*EntitlementPlanFeature) + for i := range nodes { + fk := nodes[i].PlanID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(entitlementplan.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 "plan_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (epfq *EntitlementPlanFeatureQuery) loadFeature(ctx context.Context, query *FeatureQuery, nodes []*EntitlementPlanFeature, init func(*EntitlementPlanFeature), assign func(*EntitlementPlanFeature, *Feature)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*EntitlementPlanFeature) + for i := range nodes { + fk := nodes[i].FeatureID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(feature.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 "feature_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (epfq *EntitlementPlanFeatureQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*EntitlementPlanFeature, init func(*EntitlementPlanFeature), assign func(*EntitlementPlanFeature, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*EntitlementPlanFeature) + nids := make(map[string]map[*EntitlementPlanFeature]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(entitlementplanfeature.EventsTable) + joinT.Schema(epfq.schemaConfig.EntitlementPlanFeatureEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(entitlementplanfeature.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(entitlementplanfeature.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(entitlementplanfeature.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*EntitlementPlanFeature]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (epfq *EntitlementPlanFeatureQuery) sqlCount(ctx context.Context) (int, error) { + _spec := epfq.querySpec() + _spec.Node.Schema = epfq.schemaConfig.EntitlementPlanFeature + ctx = internal.NewSchemaConfigContext(ctx, epfq.schemaConfig) + if len(epfq.modifiers) > 0 { + _spec.Modifiers = epfq.modifiers + } + _spec.Node.Columns = epfq.ctx.Fields + if len(epfq.ctx.Fields) > 0 { + _spec.Unique = epfq.ctx.Unique != nil && *epfq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, epfq.driver, _spec) +} + +func (epfq *EntitlementPlanFeatureQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitlementplanfeature.Table, entitlementplanfeature.Columns, sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString)) + _spec.From = epfq.sql + if unique := epfq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if epfq.path != nil { + _spec.Unique = true + } + if fields := epfq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplanfeature.FieldID) + for i := range fields { + if fields[i] != entitlementplanfeature.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if epfq.withOwner != nil { + _spec.Node.AddColumnOnce(entitlementplanfeature.FieldOwnerID) + } + if epfq.withPlan != nil { + _spec.Node.AddColumnOnce(entitlementplanfeature.FieldPlanID) + } + if epfq.withFeature != nil { + _spec.Node.AddColumnOnce(entitlementplanfeature.FieldFeatureID) + } + } + if ps := epfq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := epfq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := epfq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := epfq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (epfq *EntitlementPlanFeatureQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(epfq.driver.Dialect()) + t1 := builder.Table(entitlementplanfeature.Table) + columns := epfq.ctx.Fields + if len(columns) == 0 { + columns = entitlementplanfeature.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if epfq.sql != nil { + selector = epfq.sql + selector.Select(selector.Columns(columns...)...) + } + if epfq.ctx.Unique != nil && *epfq.ctx.Unique { + selector.Distinct() + } + t1.Schema(epfq.schemaConfig.EntitlementPlanFeature) + ctx = internal.NewSchemaConfigContext(ctx, epfq.schemaConfig) + selector.WithContext(ctx) + for _, p := range epfq.predicates { + p(selector) + } + for _, p := range epfq.order { + p(selector) + } + if offset := epfq.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 := epfq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (epfq *EntitlementPlanFeatureQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *EntitlementPlanFeatureQuery { + query := (&EventClient{config: epfq.config}).Query() + for _, opt := range opts { + opt(query) + } + if epfq.withNamedEvents == nil { + epfq.withNamedEvents = make(map[string]*EventQuery) + } + epfq.withNamedEvents[name] = query + return epfq +} + +// EntitlementPlanFeatureGroupBy is the group-by builder for EntitlementPlanFeature entities. +type EntitlementPlanFeatureGroupBy struct { + selector + build *EntitlementPlanFeatureQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (epfgb *EntitlementPlanFeatureGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementPlanFeatureGroupBy { + epfgb.fns = append(epfgb.fns, fns...) + return epfgb +} + +// Scan applies the selector query and scans the result into the given value. +func (epfgb *EntitlementPlanFeatureGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, epfgb.build.ctx, ent.OpQueryGroupBy) + if err := epfgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanFeatureQuery, *EntitlementPlanFeatureGroupBy](ctx, epfgb.build, epfgb, epfgb.build.inters, v) +} + +func (epfgb *EntitlementPlanFeatureGroupBy) sqlScan(ctx context.Context, root *EntitlementPlanFeatureQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(epfgb.fns)) + for _, fn := range epfgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*epfgb.flds)+len(epfgb.fns)) + for _, f := range *epfgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*epfgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := epfgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntitlementPlanFeatureSelect is the builder for selecting fields of EntitlementPlanFeature entities. +type EntitlementPlanFeatureSelect struct { + *EntitlementPlanFeatureQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (epfs *EntitlementPlanFeatureSelect) Aggregate(fns ...AggregateFunc) *EntitlementPlanFeatureSelect { + epfs.fns = append(epfs.fns, fns...) + return epfs +} + +// Scan applies the selector query and scans the result into the given value. +func (epfs *EntitlementPlanFeatureSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, epfs.ctx, ent.OpQuerySelect) + if err := epfs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanFeatureQuery, *EntitlementPlanFeatureSelect](ctx, epfs.EntitlementPlanFeatureQuery, epfs, epfs.inters, v) +} + +func (epfs *EntitlementPlanFeatureSelect) sqlScan(ctx context.Context, root *EntitlementPlanFeatureQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(epfs.fns)) + for _, fn := range epfs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*epfs.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 := epfs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitlementplanfeature_update.go b/internal/ent/generated/entitlementplanfeature_update.go new file mode 100644 index 0000000..8dbbdcc --- /dev/null +++ b/internal/ent/generated/entitlementplanfeature_update.go @@ -0,0 +1,843 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanFeatureUpdate is the builder for updating EntitlementPlanFeature entities. +type EntitlementPlanFeatureUpdate struct { + config + hooks []Hook + mutation *EntitlementPlanFeatureMutation +} + +// Where appends a list predicates to the EntitlementPlanFeatureUpdate builder. +func (epfu *EntitlementPlanFeatureUpdate) Where(ps ...predicate.EntitlementPlanFeature) *EntitlementPlanFeatureUpdate { + epfu.mutation.Where(ps...) + return epfu +} + +// SetUpdatedAt sets the "updated_at" field. +func (epfu *EntitlementPlanFeatureUpdate) SetUpdatedAt(t time.Time) *EntitlementPlanFeatureUpdate { + epfu.mutation.SetUpdatedAt(t) + return epfu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (epfu *EntitlementPlanFeatureUpdate) ClearUpdatedAt() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearUpdatedAt() + return epfu +} + +// SetUpdatedBy sets the "updated_by" field. +func (epfu *EntitlementPlanFeatureUpdate) SetUpdatedBy(s string) *EntitlementPlanFeatureUpdate { + epfu.mutation.SetUpdatedBy(s) + return epfu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epfu *EntitlementPlanFeatureUpdate) SetNillableUpdatedBy(s *string) *EntitlementPlanFeatureUpdate { + if s != nil { + epfu.SetUpdatedBy(*s) + } + return epfu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (epfu *EntitlementPlanFeatureUpdate) ClearUpdatedBy() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearUpdatedBy() + return epfu +} + +// SetDeletedAt sets the "deleted_at" field. +func (epfu *EntitlementPlanFeatureUpdate) SetDeletedAt(t time.Time) *EntitlementPlanFeatureUpdate { + epfu.mutation.SetDeletedAt(t) + return epfu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epfu *EntitlementPlanFeatureUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanFeatureUpdate { + if t != nil { + epfu.SetDeletedAt(*t) + } + return epfu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (epfu *EntitlementPlanFeatureUpdate) ClearDeletedAt() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearDeletedAt() + return epfu +} + +// SetDeletedBy sets the "deleted_by" field. +func (epfu *EntitlementPlanFeatureUpdate) SetDeletedBy(s string) *EntitlementPlanFeatureUpdate { + epfu.mutation.SetDeletedBy(s) + return epfu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epfu *EntitlementPlanFeatureUpdate) SetNillableDeletedBy(s *string) *EntitlementPlanFeatureUpdate { + if s != nil { + epfu.SetDeletedBy(*s) + } + return epfu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (epfu *EntitlementPlanFeatureUpdate) ClearDeletedBy() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearDeletedBy() + return epfu +} + +// SetTags sets the "tags" field. +func (epfu *EntitlementPlanFeatureUpdate) SetTags(s []string) *EntitlementPlanFeatureUpdate { + epfu.mutation.SetTags(s) + return epfu +} + +// AppendTags appends s to the "tags" field. +func (epfu *EntitlementPlanFeatureUpdate) AppendTags(s []string) *EntitlementPlanFeatureUpdate { + epfu.mutation.AppendTags(s) + return epfu +} + +// ClearTags clears the value of the "tags" field. +func (epfu *EntitlementPlanFeatureUpdate) ClearTags() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearTags() + return epfu +} + +// SetOwnerID sets the "owner_id" field. +func (epfu *EntitlementPlanFeatureUpdate) SetOwnerID(s string) *EntitlementPlanFeatureUpdate { + epfu.mutation.SetOwnerID(s) + return epfu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epfu *EntitlementPlanFeatureUpdate) SetNillableOwnerID(s *string) *EntitlementPlanFeatureUpdate { + if s != nil { + epfu.SetOwnerID(*s) + } + return epfu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (epfu *EntitlementPlanFeatureUpdate) ClearOwnerID() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearOwnerID() + return epfu +} + +// SetMetadata sets the "metadata" field. +func (epfu *EntitlementPlanFeatureUpdate) SetMetadata(m map[string]interface{}) *EntitlementPlanFeatureUpdate { + epfu.mutation.SetMetadata(m) + return epfu +} + +// ClearMetadata clears the value of the "metadata" field. +func (epfu *EntitlementPlanFeatureUpdate) ClearMetadata() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearMetadata() + return epfu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (epfu *EntitlementPlanFeatureUpdate) SetOwner(o *Organization) *EntitlementPlanFeatureUpdate { + return epfu.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (epfu *EntitlementPlanFeatureUpdate) AddEventIDs(ids ...string) *EntitlementPlanFeatureUpdate { + epfu.mutation.AddEventIDs(ids...) + return epfu +} + +// AddEvents adds the "events" edges to the Event entity. +func (epfu *EntitlementPlanFeatureUpdate) AddEvents(e ...*Event) *EntitlementPlanFeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epfu.AddEventIDs(ids...) +} + +// Mutation returns the EntitlementPlanFeatureMutation object of the builder. +func (epfu *EntitlementPlanFeatureUpdate) Mutation() *EntitlementPlanFeatureMutation { + return epfu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (epfu *EntitlementPlanFeatureUpdate) ClearOwner() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearOwner() + return epfu +} + +// ClearEvents clears all "events" edges to the Event entity. +func (epfu *EntitlementPlanFeatureUpdate) ClearEvents() *EntitlementPlanFeatureUpdate { + epfu.mutation.ClearEvents() + return epfu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (epfu *EntitlementPlanFeatureUpdate) RemoveEventIDs(ids ...string) *EntitlementPlanFeatureUpdate { + epfu.mutation.RemoveEventIDs(ids...) + return epfu +} + +// RemoveEvents removes "events" edges to Event entities. +func (epfu *EntitlementPlanFeatureUpdate) RemoveEvents(e ...*Event) *EntitlementPlanFeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epfu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (epfu *EntitlementPlanFeatureUpdate) Save(ctx context.Context) (int, error) { + if err := epfu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, epfu.sqlSave, epfu.mutation, epfu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (epfu *EntitlementPlanFeatureUpdate) SaveX(ctx context.Context) int { + affected, err := epfu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (epfu *EntitlementPlanFeatureUpdate) Exec(ctx context.Context) error { + _, err := epfu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfu *EntitlementPlanFeatureUpdate) ExecX(ctx context.Context) { + if err := epfu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epfu *EntitlementPlanFeatureUpdate) defaults() error { + if _, ok := epfu.mutation.UpdatedAt(); !ok && !epfu.mutation.UpdatedAtCleared() { + if entitlementplanfeature.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeature.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeature.UpdateDefaultUpdatedAt() + epfu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (epfu *EntitlementPlanFeatureUpdate) check() error { + if v, ok := epfu.mutation.OwnerID(); ok { + if err := entitlementplanfeature.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlanFeature.owner_id": %w`, err)} + } + } + if epfu.mutation.PlanCleared() && len(epfu.mutation.PlanIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "EntitlementPlanFeature.plan"`) + } + if epfu.mutation.FeatureCleared() && len(epfu.mutation.FeatureIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "EntitlementPlanFeature.feature"`) + } + return nil +} + +func (epfu *EntitlementPlanFeatureUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := epfu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(entitlementplanfeature.Table, entitlementplanfeature.Columns, sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString)) + if ps := epfu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if epfu.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplanfeature.FieldCreatedAt, field.TypeTime) + } + if value, ok := epfu.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanfeature.FieldUpdatedAt, field.TypeTime, value) + } + if epfu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplanfeature.FieldUpdatedAt, field.TypeTime) + } + if epfu.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplanfeature.FieldCreatedBy, field.TypeString) + } + if value, ok := epfu.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanfeature.FieldUpdatedBy, field.TypeString, value) + } + if epfu.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplanfeature.FieldUpdatedBy, field.TypeString) + } + if value, ok := epfu.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanfeature.FieldDeletedAt, field.TypeTime, value) + } + if epfu.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplanfeature.FieldDeletedAt, field.TypeTime) + } + if value, ok := epfu.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanfeature.FieldDeletedBy, field.TypeString, value) + } + if epfu.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplanfeature.FieldDeletedBy, field.TypeString) + } + if value, ok := epfu.mutation.Tags(); ok { + _spec.SetField(entitlementplanfeature.FieldTags, field.TypeJSON, value) + } + if value, ok := epfu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplanfeature.FieldTags, value) + }) + } + if epfu.mutation.TagsCleared() { + _spec.ClearField(entitlementplanfeature.FieldTags, field.TypeJSON) + } + if value, ok := epfu.mutation.Metadata(); ok { + _spec.SetField(entitlementplanfeature.FieldMetadata, field.TypeJSON, value) + } + if epfu.mutation.MetadataCleared() { + _spec.ClearField(entitlementplanfeature.FieldMetadata, field.TypeJSON) + } + if epfu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplanfeature.OwnerTable, + Columns: []string{entitlementplanfeature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epfu.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epfu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplanfeature.OwnerTable, + Columns: []string{entitlementplanfeature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epfu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epfu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epfu.schemaConfig.EntitlementPlanFeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epfu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !epfu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epfu.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epfu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epfu.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = epfu.schemaConfig.EntitlementPlanFeature + ctx = internal.NewSchemaConfigContext(ctx, epfu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, epfu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplanfeature.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + epfu.mutation.done = true + return n, nil +} + +// EntitlementPlanFeatureUpdateOne is the builder for updating a single EntitlementPlanFeature entity. +type EntitlementPlanFeatureUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntitlementPlanFeatureMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetUpdatedAt(t time.Time) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.SetUpdatedAt(t) + return epfuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearUpdatedAt() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearUpdatedAt() + return epfuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetUpdatedBy(s string) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.SetUpdatedBy(s) + return epfuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetNillableUpdatedBy(s *string) *EntitlementPlanFeatureUpdateOne { + if s != nil { + epfuo.SetUpdatedBy(*s) + } + return epfuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearUpdatedBy() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearUpdatedBy() + return epfuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetDeletedAt(t time.Time) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.SetDeletedAt(t) + return epfuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementPlanFeatureUpdateOne { + if t != nil { + epfuo.SetDeletedAt(*t) + } + return epfuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearDeletedAt() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearDeletedAt() + return epfuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetDeletedBy(s string) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.SetDeletedBy(s) + return epfuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetNillableDeletedBy(s *string) *EntitlementPlanFeatureUpdateOne { + if s != nil { + epfuo.SetDeletedBy(*s) + } + return epfuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearDeletedBy() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearDeletedBy() + return epfuo +} + +// SetTags sets the "tags" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetTags(s []string) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.SetTags(s) + return epfuo +} + +// AppendTags appends s to the "tags" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) AppendTags(s []string) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.AppendTags(s) + return epfuo +} + +// ClearTags clears the value of the "tags" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearTags() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearTags() + return epfuo +} + +// SetOwnerID sets the "owner_id" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetOwnerID(s string) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.SetOwnerID(s) + return epfuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetNillableOwnerID(s *string) *EntitlementPlanFeatureUpdateOne { + if s != nil { + epfuo.SetOwnerID(*s) + } + return epfuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearOwnerID() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearOwnerID() + return epfuo +} + +// SetMetadata sets the "metadata" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetMetadata(m map[string]interface{}) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.SetMetadata(m) + return epfuo +} + +// ClearMetadata clears the value of the "metadata" field. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearMetadata() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearMetadata() + return epfuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (epfuo *EntitlementPlanFeatureUpdateOne) SetOwner(o *Organization) *EntitlementPlanFeatureUpdateOne { + return epfuo.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (epfuo *EntitlementPlanFeatureUpdateOne) AddEventIDs(ids ...string) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.AddEventIDs(ids...) + return epfuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (epfuo *EntitlementPlanFeatureUpdateOne) AddEvents(e ...*Event) *EntitlementPlanFeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epfuo.AddEventIDs(ids...) +} + +// Mutation returns the EntitlementPlanFeatureMutation object of the builder. +func (epfuo *EntitlementPlanFeatureUpdateOne) Mutation() *EntitlementPlanFeatureMutation { + return epfuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearOwner() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearOwner() + return epfuo +} + +// ClearEvents clears all "events" edges to the Event entity. +func (epfuo *EntitlementPlanFeatureUpdateOne) ClearEvents() *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.ClearEvents() + return epfuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (epfuo *EntitlementPlanFeatureUpdateOne) RemoveEventIDs(ids ...string) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.RemoveEventIDs(ids...) + return epfuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (epfuo *EntitlementPlanFeatureUpdateOne) RemoveEvents(e ...*Event) *EntitlementPlanFeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return epfuo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the EntitlementPlanFeatureUpdate builder. +func (epfuo *EntitlementPlanFeatureUpdateOne) Where(ps ...predicate.EntitlementPlanFeature) *EntitlementPlanFeatureUpdateOne { + epfuo.mutation.Where(ps...) + return epfuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (epfuo *EntitlementPlanFeatureUpdateOne) Select(field string, fields ...string) *EntitlementPlanFeatureUpdateOne { + epfuo.fields = append([]string{field}, fields...) + return epfuo +} + +// Save executes the query and returns the updated EntitlementPlanFeature entity. +func (epfuo *EntitlementPlanFeatureUpdateOne) Save(ctx context.Context) (*EntitlementPlanFeature, error) { + if err := epfuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, epfuo.sqlSave, epfuo.mutation, epfuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (epfuo *EntitlementPlanFeatureUpdateOne) SaveX(ctx context.Context) *EntitlementPlanFeature { + node, err := epfuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (epfuo *EntitlementPlanFeatureUpdateOne) Exec(ctx context.Context) error { + _, err := epfuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfuo *EntitlementPlanFeatureUpdateOne) ExecX(ctx context.Context) { + if err := epfuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epfuo *EntitlementPlanFeatureUpdateOne) defaults() error { + if _, ok := epfuo.mutation.UpdatedAt(); !ok && !epfuo.mutation.UpdatedAtCleared() { + if entitlementplanfeature.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeature.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeature.UpdateDefaultUpdatedAt() + epfuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (epfuo *EntitlementPlanFeatureUpdateOne) check() error { + if v, ok := epfuo.mutation.OwnerID(); ok { + if err := entitlementplanfeature.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlanFeature.owner_id": %w`, err)} + } + } + if epfuo.mutation.PlanCleared() && len(epfuo.mutation.PlanIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "EntitlementPlanFeature.plan"`) + } + if epfuo.mutation.FeatureCleared() && len(epfuo.mutation.FeatureIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "EntitlementPlanFeature.feature"`) + } + return nil +} + +func (epfuo *EntitlementPlanFeatureUpdateOne) sqlSave(ctx context.Context) (_node *EntitlementPlanFeature, err error) { + if err := epfuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(entitlementplanfeature.Table, entitlementplanfeature.Columns, sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString)) + id, ok := epfuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntitlementPlanFeature.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := epfuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplanfeature.FieldID) + for _, f := range fields { + if !entitlementplanfeature.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitlementplanfeature.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := epfuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if epfuo.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplanfeature.FieldCreatedAt, field.TypeTime) + } + if value, ok := epfuo.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanfeature.FieldUpdatedAt, field.TypeTime, value) + } + if epfuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplanfeature.FieldUpdatedAt, field.TypeTime) + } + if epfuo.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplanfeature.FieldCreatedBy, field.TypeString) + } + if value, ok := epfuo.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanfeature.FieldUpdatedBy, field.TypeString, value) + } + if epfuo.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplanfeature.FieldUpdatedBy, field.TypeString) + } + if value, ok := epfuo.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanfeature.FieldDeletedAt, field.TypeTime, value) + } + if epfuo.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplanfeature.FieldDeletedAt, field.TypeTime) + } + if value, ok := epfuo.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanfeature.FieldDeletedBy, field.TypeString, value) + } + if epfuo.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplanfeature.FieldDeletedBy, field.TypeString) + } + if value, ok := epfuo.mutation.Tags(); ok { + _spec.SetField(entitlementplanfeature.FieldTags, field.TypeJSON, value) + } + if value, ok := epfuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplanfeature.FieldTags, value) + }) + } + if epfuo.mutation.TagsCleared() { + _spec.ClearField(entitlementplanfeature.FieldTags, field.TypeJSON) + } + if value, ok := epfuo.mutation.Metadata(); ok { + _spec.SetField(entitlementplanfeature.FieldMetadata, field.TypeJSON, value) + } + if epfuo.mutation.MetadataCleared() { + _spec.ClearField(entitlementplanfeature.FieldMetadata, field.TypeJSON) + } + if epfuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplanfeature.OwnerTable, + Columns: []string{entitlementplanfeature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epfuo.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epfuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplanfeature.OwnerTable, + Columns: []string{entitlementplanfeature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = epfuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if epfuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epfuo.schemaConfig.EntitlementPlanFeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epfuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !epfuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epfuo.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := epfuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = epfuo.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = epfuo.schemaConfig.EntitlementPlanFeature + ctx = internal.NewSchemaConfigContext(ctx, epfuo.schemaConfig) + _node = &EntitlementPlanFeature{config: epfuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, epfuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplanfeature.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + epfuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entitlementplanfeaturehistory.go b/internal/ent/generated/entitlementplanfeaturehistory.go new file mode 100644 index 0000000..b04e54f --- /dev/null +++ b/internal/ent/generated/entitlementplanfeaturehistory.go @@ -0,0 +1,268 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/entx/history" +) + +// EntitlementPlanFeatureHistory is the model entity for the EntitlementPlanFeatureHistory schema. +type EntitlementPlanFeatureHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + // PlanID holds the value of the "plan_id" field. + PlanID string `json:"plan_id,omitempty"` + // FeatureID holds the value of the "feature_id" field. + FeatureID string `json:"feature_id,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntitlementPlanFeatureHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitlementplanfeaturehistory.FieldTags, entitlementplanfeaturehistory.FieldMetadata: + values[i] = new([]byte) + case entitlementplanfeaturehistory.FieldOperation: + values[i] = new(history.OpType) + case entitlementplanfeaturehistory.FieldID, entitlementplanfeaturehistory.FieldRef, entitlementplanfeaturehistory.FieldCreatedBy, entitlementplanfeaturehistory.FieldUpdatedBy, entitlementplanfeaturehistory.FieldMappingID, entitlementplanfeaturehistory.FieldDeletedBy, entitlementplanfeaturehistory.FieldOwnerID, entitlementplanfeaturehistory.FieldPlanID, entitlementplanfeaturehistory.FieldFeatureID: + values[i] = new(sql.NullString) + case entitlementplanfeaturehistory.FieldHistoryTime, entitlementplanfeaturehistory.FieldCreatedAt, entitlementplanfeaturehistory.FieldUpdatedAt, entitlementplanfeaturehistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntitlementPlanFeatureHistory fields. +func (epfh *EntitlementPlanFeatureHistory) 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 entitlementplanfeaturehistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + epfh.ID = value.String + } + case entitlementplanfeaturehistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + epfh.HistoryTime = value.Time + } + case entitlementplanfeaturehistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + epfh.Ref = value.String + } + case entitlementplanfeaturehistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + epfh.Operation = *value + } + case entitlementplanfeaturehistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + epfh.CreatedAt = value.Time + } + case entitlementplanfeaturehistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + epfh.UpdatedAt = value.Time + } + case entitlementplanfeaturehistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + epfh.CreatedBy = value.String + } + case entitlementplanfeaturehistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + epfh.UpdatedBy = value.String + } + case entitlementplanfeaturehistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + epfh.MappingID = value.String + } + case entitlementplanfeaturehistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + epfh.DeletedAt = value.Time + } + case entitlementplanfeaturehistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + epfh.DeletedBy = value.String + } + case entitlementplanfeaturehistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &epfh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitlementplanfeaturehistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + epfh.OwnerID = value.String + } + case entitlementplanfeaturehistory.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &epfh.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + case entitlementplanfeaturehistory.FieldPlanID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field plan_id", values[i]) + } else if value.Valid { + epfh.PlanID = value.String + } + case entitlementplanfeaturehistory.FieldFeatureID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field feature_id", values[i]) + } else if value.Valid { + epfh.FeatureID = value.String + } + default: + epfh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntitlementPlanFeatureHistory. +// This includes values selected through modifiers, order, etc. +func (epfh *EntitlementPlanFeatureHistory) Value(name string) (ent.Value, error) { + return epfh.selectValues.Get(name) +} + +// Update returns a builder for updating this EntitlementPlanFeatureHistory. +// Note that you need to call EntitlementPlanFeatureHistory.Unwrap() before calling this method if this EntitlementPlanFeatureHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (epfh *EntitlementPlanFeatureHistory) Update() *EntitlementPlanFeatureHistoryUpdateOne { + return NewEntitlementPlanFeatureHistoryClient(epfh.config).UpdateOne(epfh) +} + +// Unwrap unwraps the EntitlementPlanFeatureHistory 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 (epfh *EntitlementPlanFeatureHistory) Unwrap() *EntitlementPlanFeatureHistory { + _tx, ok := epfh.config.driver.(*txDriver) + if !ok { + panic("generated: EntitlementPlanFeatureHistory is not a transactional entity") + } + epfh.config.driver = _tx.drv + return epfh +} + +// String implements the fmt.Stringer. +func (epfh *EntitlementPlanFeatureHistory) String() string { + var builder strings.Builder + builder.WriteString("EntitlementPlanFeatureHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", epfh.ID)) + builder.WriteString("history_time=") + builder.WriteString(epfh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(epfh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", epfh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(epfh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(epfh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(epfh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(epfh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(epfh.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(epfh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(epfh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", epfh.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(epfh.OwnerID) + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", epfh.Metadata)) + builder.WriteString(", ") + builder.WriteString("plan_id=") + builder.WriteString(epfh.PlanID) + builder.WriteString(", ") + builder.WriteString("feature_id=") + builder.WriteString(epfh.FeatureID) + builder.WriteByte(')') + return builder.String() +} + +// EntitlementPlanFeatureHistories is a parsable slice of EntitlementPlanFeatureHistory. +type EntitlementPlanFeatureHistories []*EntitlementPlanFeatureHistory diff --git a/internal/ent/generated/entitlementplanfeaturehistory/entitlementplanfeaturehistory.go b/internal/ent/generated/entitlementplanfeaturehistory/entitlementplanfeaturehistory.go new file mode 100644 index 0000000..eb17a85 --- /dev/null +++ b/internal/ent/generated/entitlementplanfeaturehistory/entitlementplanfeaturehistory.go @@ -0,0 +1,197 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplanfeaturehistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the entitlementplanfeaturehistory type in the database. + Label = "entitlement_plan_feature_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // FieldPlanID holds the string denoting the plan_id field in the database. + FieldPlanID = "plan_id" + // FieldFeatureID holds the string denoting the feature_id field in the database. + FieldFeatureID = "feature_id" + // Table holds the table name of the entitlementplanfeaturehistory in the database. + Table = "entitlement_plan_feature_history" +) + +// Columns holds all SQL columns for entitlementplanfeaturehistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldMetadata, + FieldPlanID, + FieldFeatureID, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("entitlementplanfeaturehistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the EntitlementPlanFeatureHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByPlanID orders the results by the plan_id field. +func ByPlanID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPlanID, opts...).ToFunc() +} + +// ByFeatureID orders the results by the feature_id field. +func ByFeatureID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFeatureID, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/entitlementplanfeaturehistory/where.go b/internal/ent/generated/entitlementplanfeaturehistory/where.go new file mode 100644 index 0000000..75706ba --- /dev/null +++ b/internal/ent/generated/entitlementplanfeaturehistory/where.go @@ -0,0 +1,941 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplanfeaturehistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// PlanID applies equality check predicate on the "plan_id" field. It's identical to PlanIDEQ. +func PlanID(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldPlanID, v)) +} + +// FeatureID applies equality check predicate on the "feature_id" field. It's identical to FeatureIDEQ. +func FeatureID(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldFeatureID, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotNull(FieldMetadata)) +} + +// PlanIDEQ applies the EQ predicate on the "plan_id" field. +func PlanIDEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldPlanID, v)) +} + +// PlanIDNEQ applies the NEQ predicate on the "plan_id" field. +func PlanIDNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldPlanID, v)) +} + +// PlanIDIn applies the In predicate on the "plan_id" field. +func PlanIDIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldPlanID, vs...)) +} + +// PlanIDNotIn applies the NotIn predicate on the "plan_id" field. +func PlanIDNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldPlanID, vs...)) +} + +// PlanIDGT applies the GT predicate on the "plan_id" field. +func PlanIDGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldPlanID, v)) +} + +// PlanIDGTE applies the GTE predicate on the "plan_id" field. +func PlanIDGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldPlanID, v)) +} + +// PlanIDLT applies the LT predicate on the "plan_id" field. +func PlanIDLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldPlanID, v)) +} + +// PlanIDLTE applies the LTE predicate on the "plan_id" field. +func PlanIDLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldPlanID, v)) +} + +// PlanIDContains applies the Contains predicate on the "plan_id" field. +func PlanIDContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldPlanID, v)) +} + +// PlanIDHasPrefix applies the HasPrefix predicate on the "plan_id" field. +func PlanIDHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldPlanID, v)) +} + +// PlanIDHasSuffix applies the HasSuffix predicate on the "plan_id" field. +func PlanIDHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldPlanID, v)) +} + +// PlanIDEqualFold applies the EqualFold predicate on the "plan_id" field. +func PlanIDEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldPlanID, v)) +} + +// PlanIDContainsFold applies the ContainsFold predicate on the "plan_id" field. +func PlanIDContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldPlanID, v)) +} + +// FeatureIDEQ applies the EQ predicate on the "feature_id" field. +func FeatureIDEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEQ(FieldFeatureID, v)) +} + +// FeatureIDNEQ applies the NEQ predicate on the "feature_id" field. +func FeatureIDNEQ(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNEQ(FieldFeatureID, v)) +} + +// FeatureIDIn applies the In predicate on the "feature_id" field. +func FeatureIDIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldIn(FieldFeatureID, vs...)) +} + +// FeatureIDNotIn applies the NotIn predicate on the "feature_id" field. +func FeatureIDNotIn(vs ...string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldNotIn(FieldFeatureID, vs...)) +} + +// FeatureIDGT applies the GT predicate on the "feature_id" field. +func FeatureIDGT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGT(FieldFeatureID, v)) +} + +// FeatureIDGTE applies the GTE predicate on the "feature_id" field. +func FeatureIDGTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldGTE(FieldFeatureID, v)) +} + +// FeatureIDLT applies the LT predicate on the "feature_id" field. +func FeatureIDLT(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLT(FieldFeatureID, v)) +} + +// FeatureIDLTE applies the LTE predicate on the "feature_id" field. +func FeatureIDLTE(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldLTE(FieldFeatureID, v)) +} + +// FeatureIDContains applies the Contains predicate on the "feature_id" field. +func FeatureIDContains(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContains(FieldFeatureID, v)) +} + +// FeatureIDHasPrefix applies the HasPrefix predicate on the "feature_id" field. +func FeatureIDHasPrefix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasPrefix(FieldFeatureID, v)) +} + +// FeatureIDHasSuffix applies the HasSuffix predicate on the "feature_id" field. +func FeatureIDHasSuffix(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldHasSuffix(FieldFeatureID, v)) +} + +// FeatureIDEqualFold applies the EqualFold predicate on the "feature_id" field. +func FeatureIDEqualFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldEqualFold(FieldFeatureID, v)) +} + +// FeatureIDContainsFold applies the ContainsFold predicate on the "feature_id" field. +func FeatureIDContainsFold(v string) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.FieldContainsFold(FieldFeatureID, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.EntitlementPlanFeatureHistory) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntitlementPlanFeatureHistory) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntitlementPlanFeatureHistory) predicate.EntitlementPlanFeatureHistory { + return predicate.EntitlementPlanFeatureHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitlementplanfeaturehistory_create.go b/internal/ent/generated/entitlementplanfeaturehistory_create.go new file mode 100644 index 0000000..22c6aee --- /dev/null +++ b/internal/ent/generated/entitlementplanfeaturehistory_create.go @@ -0,0 +1,490 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/entx/history" +) + +// EntitlementPlanFeatureHistoryCreate is the builder for creating a EntitlementPlanFeatureHistory entity. +type EntitlementPlanFeatureHistoryCreate struct { + config + mutation *EntitlementPlanFeatureHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetHistoryTime(t time.Time) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetHistoryTime(t) + return epfhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableHistoryTime(t *time.Time) *EntitlementPlanFeatureHistoryCreate { + if t != nil { + epfhc.SetHistoryTime(*t) + } + return epfhc +} + +// SetRef sets the "ref" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetRef(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetRef(s) + return epfhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableRef(s *string) *EntitlementPlanFeatureHistoryCreate { + if s != nil { + epfhc.SetRef(*s) + } + return epfhc +} + +// SetOperation sets the "operation" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetOperation(ht history.OpType) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetOperation(ht) + return epfhc +} + +// SetCreatedAt sets the "created_at" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetCreatedAt(t time.Time) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetCreatedAt(t) + return epfhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableCreatedAt(t *time.Time) *EntitlementPlanFeatureHistoryCreate { + if t != nil { + epfhc.SetCreatedAt(*t) + } + return epfhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetUpdatedAt(t time.Time) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetUpdatedAt(t) + return epfhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementPlanFeatureHistoryCreate { + if t != nil { + epfhc.SetUpdatedAt(*t) + } + return epfhc +} + +// SetCreatedBy sets the "created_by" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetCreatedBy(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetCreatedBy(s) + return epfhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableCreatedBy(s *string) *EntitlementPlanFeatureHistoryCreate { + if s != nil { + epfhc.SetCreatedBy(*s) + } + return epfhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetUpdatedBy(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetUpdatedBy(s) + return epfhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableUpdatedBy(s *string) *EntitlementPlanFeatureHistoryCreate { + if s != nil { + epfhc.SetUpdatedBy(*s) + } + return epfhc +} + +// SetMappingID sets the "mapping_id" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetMappingID(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetMappingID(s) + return epfhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableMappingID(s *string) *EntitlementPlanFeatureHistoryCreate { + if s != nil { + epfhc.SetMappingID(*s) + } + return epfhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetDeletedAt(t time.Time) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetDeletedAt(t) + return epfhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanFeatureHistoryCreate { + if t != nil { + epfhc.SetDeletedAt(*t) + } + return epfhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetDeletedBy(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetDeletedBy(s) + return epfhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableDeletedBy(s *string) *EntitlementPlanFeatureHistoryCreate { + if s != nil { + epfhc.SetDeletedBy(*s) + } + return epfhc +} + +// SetTags sets the "tags" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetTags(s []string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetTags(s) + return epfhc +} + +// SetOwnerID sets the "owner_id" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetOwnerID(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetOwnerID(s) + return epfhc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableOwnerID(s *string) *EntitlementPlanFeatureHistoryCreate { + if s != nil { + epfhc.SetOwnerID(*s) + } + return epfhc +} + +// SetMetadata sets the "metadata" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetMetadata(m map[string]interface{}) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetMetadata(m) + return epfhc +} + +// SetPlanID sets the "plan_id" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetPlanID(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetPlanID(s) + return epfhc +} + +// SetFeatureID sets the "feature_id" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetFeatureID(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetFeatureID(s) + return epfhc +} + +// SetID sets the "id" field. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetID(s string) *EntitlementPlanFeatureHistoryCreate { + epfhc.mutation.SetID(s) + return epfhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SetNillableID(s *string) *EntitlementPlanFeatureHistoryCreate { + if s != nil { + epfhc.SetID(*s) + } + return epfhc +} + +// Mutation returns the EntitlementPlanFeatureHistoryMutation object of the builder. +func (epfhc *EntitlementPlanFeatureHistoryCreate) Mutation() *EntitlementPlanFeatureHistoryMutation { + return epfhc.mutation +} + +// Save creates the EntitlementPlanFeatureHistory in the database. +func (epfhc *EntitlementPlanFeatureHistoryCreate) Save(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + if err := epfhc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, epfhc.sqlSave, epfhc.mutation, epfhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (epfhc *EntitlementPlanFeatureHistoryCreate) SaveX(ctx context.Context) *EntitlementPlanFeatureHistory { + v, err := epfhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (epfhc *EntitlementPlanFeatureHistoryCreate) Exec(ctx context.Context) error { + _, err := epfhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfhc *EntitlementPlanFeatureHistoryCreate) ExecX(ctx context.Context) { + if err := epfhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epfhc *EntitlementPlanFeatureHistoryCreate) defaults() error { + if _, ok := epfhc.mutation.HistoryTime(); !ok { + if entitlementplanfeaturehistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeaturehistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := entitlementplanfeaturehistory.DefaultHistoryTime() + epfhc.mutation.SetHistoryTime(v) + } + if _, ok := epfhc.mutation.CreatedAt(); !ok { + if entitlementplanfeaturehistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeaturehistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeaturehistory.DefaultCreatedAt() + epfhc.mutation.SetCreatedAt(v) + } + if _, ok := epfhc.mutation.UpdatedAt(); !ok { + if entitlementplanfeaturehistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeaturehistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeaturehistory.DefaultUpdatedAt() + epfhc.mutation.SetUpdatedAt(v) + } + if _, ok := epfhc.mutation.MappingID(); !ok { + if entitlementplanfeaturehistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeaturehistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitlementplanfeaturehistory.DefaultMappingID() + epfhc.mutation.SetMappingID(v) + } + if _, ok := epfhc.mutation.Tags(); !ok { + v := entitlementplanfeaturehistory.DefaultTags + epfhc.mutation.SetTags(v) + } + if _, ok := epfhc.mutation.ID(); !ok { + if entitlementplanfeaturehistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeaturehistory.DefaultID (forgotten import generated/runtime?)") + } + v := entitlementplanfeaturehistory.DefaultID() + epfhc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (epfhc *EntitlementPlanFeatureHistoryCreate) check() error { + if _, ok := epfhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "EntitlementPlanFeatureHistory.history_time"`)} + } + if _, ok := epfhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "EntitlementPlanFeatureHistory.operation"`)} + } + if v, ok := epfhc.mutation.Operation(); ok { + if err := entitlementplanfeaturehistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlanFeatureHistory.operation": %w`, err)} + } + } + if _, ok := epfhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntitlementPlanFeatureHistory.mapping_id"`)} + } + if _, ok := epfhc.mutation.PlanID(); !ok { + return &ValidationError{Name: "plan_id", err: errors.New(`generated: missing required field "EntitlementPlanFeatureHistory.plan_id"`)} + } + if _, ok := epfhc.mutation.FeatureID(); !ok { + return &ValidationError{Name: "feature_id", err: errors.New(`generated: missing required field "EntitlementPlanFeatureHistory.feature_id"`)} + } + return nil +} + +func (epfhc *EntitlementPlanFeatureHistoryCreate) sqlSave(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + if err := epfhc.check(); err != nil { + return nil, err + } + _node, _spec := epfhc.createSpec() + if err := sqlgraph.CreateNode(ctx, epfhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntitlementPlanFeatureHistory.ID type: %T", _spec.ID.Value) + } + } + epfhc.mutation.id = &_node.ID + epfhc.mutation.done = true + return _node, nil +} + +func (epfhc *EntitlementPlanFeatureHistoryCreate) createSpec() (*EntitlementPlanFeatureHistory, *sqlgraph.CreateSpec) { + var ( + _node = &EntitlementPlanFeatureHistory{config: epfhc.config} + _spec = sqlgraph.NewCreateSpec(entitlementplanfeaturehistory.Table, sqlgraph.NewFieldSpec(entitlementplanfeaturehistory.FieldID, field.TypeString)) + ) + _spec.Schema = epfhc.schemaConfig.EntitlementPlanFeatureHistory + if id, ok := epfhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := epfhc.mutation.HistoryTime(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := epfhc.mutation.Ref(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := epfhc.mutation.Operation(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := epfhc.mutation.CreatedAt(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := epfhc.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := epfhc.mutation.CreatedBy(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := epfhc.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := epfhc.mutation.MappingID(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := epfhc.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := epfhc.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := epfhc.mutation.Tags(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := epfhc.mutation.OwnerID(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := epfhc.mutation.Metadata(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + if value, ok := epfhc.mutation.PlanID(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldPlanID, field.TypeString, value) + _node.PlanID = value + } + if value, ok := epfhc.mutation.FeatureID(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldFeatureID, field.TypeString, value) + _node.FeatureID = value + } + return _node, _spec +} + +// EntitlementPlanFeatureHistoryCreateBulk is the builder for creating many EntitlementPlanFeatureHistory entities in bulk. +type EntitlementPlanFeatureHistoryCreateBulk struct { + config + err error + builders []*EntitlementPlanFeatureHistoryCreate +} + +// Save creates the EntitlementPlanFeatureHistory entities in the database. +func (epfhcb *EntitlementPlanFeatureHistoryCreateBulk) Save(ctx context.Context) ([]*EntitlementPlanFeatureHistory, error) { + if epfhcb.err != nil { + return nil, epfhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(epfhcb.builders)) + nodes := make([]*EntitlementPlanFeatureHistory, len(epfhcb.builders)) + mutators := make([]Mutator, len(epfhcb.builders)) + for i := range epfhcb.builders { + func(i int, root context.Context) { + builder := epfhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntitlementPlanFeatureHistoryMutation) + 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, epfhcb.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, epfhcb.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, epfhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (epfhcb *EntitlementPlanFeatureHistoryCreateBulk) SaveX(ctx context.Context) []*EntitlementPlanFeatureHistory { + v, err := epfhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (epfhcb *EntitlementPlanFeatureHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := epfhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfhcb *EntitlementPlanFeatureHistoryCreateBulk) ExecX(ctx context.Context) { + if err := epfhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplanfeaturehistory_delete.go b/internal/ent/generated/entitlementplanfeaturehistory_delete.go new file mode 100644 index 0000000..4b749b0 --- /dev/null +++ b/internal/ent/generated/entitlementplanfeaturehistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanFeatureHistoryDelete is the builder for deleting a EntitlementPlanFeatureHistory entity. +type EntitlementPlanFeatureHistoryDelete struct { + config + hooks []Hook + mutation *EntitlementPlanFeatureHistoryMutation +} + +// Where appends a list predicates to the EntitlementPlanFeatureHistoryDelete builder. +func (epfhd *EntitlementPlanFeatureHistoryDelete) Where(ps ...predicate.EntitlementPlanFeatureHistory) *EntitlementPlanFeatureHistoryDelete { + epfhd.mutation.Where(ps...) + return epfhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (epfhd *EntitlementPlanFeatureHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, epfhd.sqlExec, epfhd.mutation, epfhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfhd *EntitlementPlanFeatureHistoryDelete) ExecX(ctx context.Context) int { + n, err := epfhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (epfhd *EntitlementPlanFeatureHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitlementplanfeaturehistory.Table, sqlgraph.NewFieldSpec(entitlementplanfeaturehistory.FieldID, field.TypeString)) + _spec.Node.Schema = epfhd.schemaConfig.EntitlementPlanFeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, epfhd.schemaConfig) + if ps := epfhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, epfhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + epfhd.mutation.done = true + return affected, err +} + +// EntitlementPlanFeatureHistoryDeleteOne is the builder for deleting a single EntitlementPlanFeatureHistory entity. +type EntitlementPlanFeatureHistoryDeleteOne struct { + epfhd *EntitlementPlanFeatureHistoryDelete +} + +// Where appends a list predicates to the EntitlementPlanFeatureHistoryDelete builder. +func (epfhdo *EntitlementPlanFeatureHistoryDeleteOne) Where(ps ...predicate.EntitlementPlanFeatureHistory) *EntitlementPlanFeatureHistoryDeleteOne { + epfhdo.epfhd.mutation.Where(ps...) + return epfhdo +} + +// Exec executes the deletion query. +func (epfhdo *EntitlementPlanFeatureHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := epfhdo.epfhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitlementplanfeaturehistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfhdo *EntitlementPlanFeatureHistoryDeleteOne) ExecX(ctx context.Context) { + if err := epfhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplanfeaturehistory_query.go b/internal/ent/generated/entitlementplanfeaturehistory_query.go new file mode 100644 index 0000000..9e56a04 --- /dev/null +++ b/internal/ent/generated/entitlementplanfeaturehistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanFeatureHistoryQuery is the builder for querying EntitlementPlanFeatureHistory entities. +type EntitlementPlanFeatureHistoryQuery struct { + config + ctx *QueryContext + order []entitlementplanfeaturehistory.OrderOption + inters []Interceptor + predicates []predicate.EntitlementPlanFeatureHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntitlementPlanFeatureHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntitlementPlanFeatureHistoryQuery builder. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Where(ps ...predicate.EntitlementPlanFeatureHistory) *EntitlementPlanFeatureHistoryQuery { + epfhq.predicates = append(epfhq.predicates, ps...) + return epfhq +} + +// Limit the number of records to be returned by this query. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Limit(limit int) *EntitlementPlanFeatureHistoryQuery { + epfhq.ctx.Limit = &limit + return epfhq +} + +// Offset to start from. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Offset(offset int) *EntitlementPlanFeatureHistoryQuery { + epfhq.ctx.Offset = &offset + return epfhq +} + +// 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 (epfhq *EntitlementPlanFeatureHistoryQuery) Unique(unique bool) *EntitlementPlanFeatureHistoryQuery { + epfhq.ctx.Unique = &unique + return epfhq +} + +// Order specifies how the records should be ordered. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Order(o ...entitlementplanfeaturehistory.OrderOption) *EntitlementPlanFeatureHistoryQuery { + epfhq.order = append(epfhq.order, o...) + return epfhq +} + +// First returns the first EntitlementPlanFeatureHistory entity from the query. +// Returns a *NotFoundError when no EntitlementPlanFeatureHistory was found. +func (epfhq *EntitlementPlanFeatureHistoryQuery) First(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + nodes, err := epfhq.Limit(1).All(setContextOp(ctx, epfhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitlementplanfeaturehistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) FirstX(ctx context.Context) *EntitlementPlanFeatureHistory { + node, err := epfhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntitlementPlanFeatureHistory ID from the query. +// Returns a *NotFoundError when no EntitlementPlanFeatureHistory ID was found. +func (epfhq *EntitlementPlanFeatureHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = epfhq.Limit(1).IDs(setContextOp(ctx, epfhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitlementplanfeaturehistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := epfhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntitlementPlanFeatureHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntitlementPlanFeatureHistory entity is found. +// Returns a *NotFoundError when no EntitlementPlanFeatureHistory entities are found. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Only(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + nodes, err := epfhq.Limit(2).All(setContextOp(ctx, epfhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitlementplanfeaturehistory.Label} + default: + return nil, &NotSingularError{entitlementplanfeaturehistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) OnlyX(ctx context.Context) *EntitlementPlanFeatureHistory { + node, err := epfhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntitlementPlanFeatureHistory ID in the query. +// Returns a *NotSingularError when more than one EntitlementPlanFeatureHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (epfhq *EntitlementPlanFeatureHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = epfhq.Limit(2).IDs(setContextOp(ctx, epfhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitlementplanfeaturehistory.Label} + default: + err = &NotSingularError{entitlementplanfeaturehistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := epfhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntitlementPlanFeatureHistories. +func (epfhq *EntitlementPlanFeatureHistoryQuery) All(ctx context.Context) ([]*EntitlementPlanFeatureHistory, error) { + ctx = setContextOp(ctx, epfhq.ctx, ent.OpQueryAll) + if err := epfhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntitlementPlanFeatureHistory, *EntitlementPlanFeatureHistoryQuery]() + return withInterceptors[[]*EntitlementPlanFeatureHistory](ctx, epfhq, qr, epfhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) AllX(ctx context.Context) []*EntitlementPlanFeatureHistory { + nodes, err := epfhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntitlementPlanFeatureHistory IDs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if epfhq.ctx.Unique == nil && epfhq.path != nil { + epfhq.Unique(true) + } + ctx = setContextOp(ctx, epfhq.ctx, ent.OpQueryIDs) + if err = epfhq.Select(entitlementplanfeaturehistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := epfhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, epfhq.ctx, ent.OpQueryCount) + if err := epfhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, epfhq, querierCount[*EntitlementPlanFeatureHistoryQuery](), epfhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) CountX(ctx context.Context) int { + count, err := epfhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, epfhq.ctx, ent.OpQueryExist) + switch _, err := epfhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (epfhq *EntitlementPlanFeatureHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := epfhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntitlementPlanFeatureHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Clone() *EntitlementPlanFeatureHistoryQuery { + if epfhq == nil { + return nil + } + return &EntitlementPlanFeatureHistoryQuery{ + config: epfhq.config, + ctx: epfhq.ctx.Clone(), + order: append([]entitlementplanfeaturehistory.OrderOption{}, epfhq.order...), + inters: append([]Interceptor{}, epfhq.inters...), + predicates: append([]predicate.EntitlementPlanFeatureHistory{}, epfhq.predicates...), + // clone intermediate query. + sql: epfhq.sql.Clone(), + path: epfhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntitlementPlanFeatureHistory.Query(). +// GroupBy(entitlementplanfeaturehistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (epfhq *EntitlementPlanFeatureHistoryQuery) GroupBy(field string, fields ...string) *EntitlementPlanFeatureHistoryGroupBy { + epfhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntitlementPlanFeatureHistoryGroupBy{build: epfhq} + grbuild.flds = &epfhq.ctx.Fields + grbuild.label = entitlementplanfeaturehistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.EntitlementPlanFeatureHistory.Query(). +// Select(entitlementplanfeaturehistory.FieldHistoryTime). +// Scan(ctx, &v) +func (epfhq *EntitlementPlanFeatureHistoryQuery) Select(fields ...string) *EntitlementPlanFeatureHistorySelect { + epfhq.ctx.Fields = append(epfhq.ctx.Fields, fields...) + sbuild := &EntitlementPlanFeatureHistorySelect{EntitlementPlanFeatureHistoryQuery: epfhq} + sbuild.label = entitlementplanfeaturehistory.Label + sbuild.flds, sbuild.scan = &epfhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntitlementPlanFeatureHistorySelect configured with the given aggregations. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Aggregate(fns ...AggregateFunc) *EntitlementPlanFeatureHistorySelect { + return epfhq.Select().Aggregate(fns...) +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range epfhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, epfhq); err != nil { + return err + } + } + } + for _, f := range epfhq.ctx.Fields { + if !entitlementplanfeaturehistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if epfhq.path != nil { + prev, err := epfhq.path(ctx) + if err != nil { + return err + } + epfhq.sql = prev + } + if entitlementplanfeaturehistory.Policy == nil { + return errors.New("generated: uninitialized entitlementplanfeaturehistory.Policy (forgotten import generated/runtime?)") + } + if err := entitlementplanfeaturehistory.Policy.EvalQuery(ctx, epfhq); err != nil { + return err + } + return nil +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntitlementPlanFeatureHistory, error) { + var ( + nodes = []*EntitlementPlanFeatureHistory{} + _spec = epfhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntitlementPlanFeatureHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntitlementPlanFeatureHistory{config: epfhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = epfhq.schemaConfig.EntitlementPlanFeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, epfhq.schemaConfig) + if len(epfhq.modifiers) > 0 { + _spec.Modifiers = epfhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, epfhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range epfhq.loadTotal { + if err := epfhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := epfhq.querySpec() + _spec.Node.Schema = epfhq.schemaConfig.EntitlementPlanFeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, epfhq.schemaConfig) + if len(epfhq.modifiers) > 0 { + _spec.Modifiers = epfhq.modifiers + } + _spec.Node.Columns = epfhq.ctx.Fields + if len(epfhq.ctx.Fields) > 0 { + _spec.Unique = epfhq.ctx.Unique != nil && *epfhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, epfhq.driver, _spec) +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitlementplanfeaturehistory.Table, entitlementplanfeaturehistory.Columns, sqlgraph.NewFieldSpec(entitlementplanfeaturehistory.FieldID, field.TypeString)) + _spec.From = epfhq.sql + if unique := epfhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if epfhq.path != nil { + _spec.Unique = true + } + if fields := epfhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplanfeaturehistory.FieldID) + for i := range fields { + if fields[i] != entitlementplanfeaturehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := epfhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := epfhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := epfhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := epfhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(epfhq.driver.Dialect()) + t1 := builder.Table(entitlementplanfeaturehistory.Table) + columns := epfhq.ctx.Fields + if len(columns) == 0 { + columns = entitlementplanfeaturehistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if epfhq.sql != nil { + selector = epfhq.sql + selector.Select(selector.Columns(columns...)...) + } + if epfhq.ctx.Unique != nil && *epfhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(epfhq.schemaConfig.EntitlementPlanFeatureHistory) + ctx = internal.NewSchemaConfigContext(ctx, epfhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range epfhq.predicates { + p(selector) + } + for _, p := range epfhq.order { + p(selector) + } + if offset := epfhq.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 := epfhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// EntitlementPlanFeatureHistoryGroupBy is the group-by builder for EntitlementPlanFeatureHistory entities. +type EntitlementPlanFeatureHistoryGroupBy struct { + selector + build *EntitlementPlanFeatureHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (epfhgb *EntitlementPlanFeatureHistoryGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementPlanFeatureHistoryGroupBy { + epfhgb.fns = append(epfhgb.fns, fns...) + return epfhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (epfhgb *EntitlementPlanFeatureHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, epfhgb.build.ctx, ent.OpQueryGroupBy) + if err := epfhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanFeatureHistoryQuery, *EntitlementPlanFeatureHistoryGroupBy](ctx, epfhgb.build, epfhgb, epfhgb.build.inters, v) +} + +func (epfhgb *EntitlementPlanFeatureHistoryGroupBy) sqlScan(ctx context.Context, root *EntitlementPlanFeatureHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(epfhgb.fns)) + for _, fn := range epfhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*epfhgb.flds)+len(epfhgb.fns)) + for _, f := range *epfhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*epfhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := epfhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntitlementPlanFeatureHistorySelect is the builder for selecting fields of EntitlementPlanFeatureHistory entities. +type EntitlementPlanFeatureHistorySelect struct { + *EntitlementPlanFeatureHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (epfhs *EntitlementPlanFeatureHistorySelect) Aggregate(fns ...AggregateFunc) *EntitlementPlanFeatureHistorySelect { + epfhs.fns = append(epfhs.fns, fns...) + return epfhs +} + +// Scan applies the selector query and scans the result into the given value. +func (epfhs *EntitlementPlanFeatureHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, epfhs.ctx, ent.OpQuerySelect) + if err := epfhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanFeatureHistoryQuery, *EntitlementPlanFeatureHistorySelect](ctx, epfhs.EntitlementPlanFeatureHistoryQuery, epfhs, epfhs.inters, v) +} + +func (epfhs *EntitlementPlanFeatureHistorySelect) sqlScan(ctx context.Context, root *EntitlementPlanFeatureHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(epfhs.fns)) + for _, fn := range epfhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*epfhs.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 := epfhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitlementplanfeaturehistory_update.go b/internal/ent/generated/entitlementplanfeaturehistory_update.go new file mode 100644 index 0000000..a1ed7ce --- /dev/null +++ b/internal/ent/generated/entitlementplanfeaturehistory_update.go @@ -0,0 +1,569 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanFeatureHistoryUpdate is the builder for updating EntitlementPlanFeatureHistory entities. +type EntitlementPlanFeatureHistoryUpdate struct { + config + hooks []Hook + mutation *EntitlementPlanFeatureHistoryMutation +} + +// Where appends a list predicates to the EntitlementPlanFeatureHistoryUpdate builder. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) Where(ps ...predicate.EntitlementPlanFeatureHistory) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.Where(ps...) + return epfhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetUpdatedAt(t time.Time) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.SetUpdatedAt(t) + return epfhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ClearUpdatedAt() *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.ClearUpdatedAt() + return epfhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetUpdatedBy(s string) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.SetUpdatedBy(s) + return epfhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetNillableUpdatedBy(s *string) *EntitlementPlanFeatureHistoryUpdate { + if s != nil { + epfhu.SetUpdatedBy(*s) + } + return epfhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ClearUpdatedBy() *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.ClearUpdatedBy() + return epfhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetDeletedAt(t time.Time) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.SetDeletedAt(t) + return epfhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanFeatureHistoryUpdate { + if t != nil { + epfhu.SetDeletedAt(*t) + } + return epfhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ClearDeletedAt() *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.ClearDeletedAt() + return epfhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetDeletedBy(s string) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.SetDeletedBy(s) + return epfhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetNillableDeletedBy(s *string) *EntitlementPlanFeatureHistoryUpdate { + if s != nil { + epfhu.SetDeletedBy(*s) + } + return epfhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ClearDeletedBy() *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.ClearDeletedBy() + return epfhu +} + +// SetTags sets the "tags" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetTags(s []string) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.SetTags(s) + return epfhu +} + +// AppendTags appends s to the "tags" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) AppendTags(s []string) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.AppendTags(s) + return epfhu +} + +// ClearTags clears the value of the "tags" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ClearTags() *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.ClearTags() + return epfhu +} + +// SetOwnerID sets the "owner_id" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetOwnerID(s string) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.SetOwnerID(s) + return epfhu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetNillableOwnerID(s *string) *EntitlementPlanFeatureHistoryUpdate { + if s != nil { + epfhu.SetOwnerID(*s) + } + return epfhu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ClearOwnerID() *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.ClearOwnerID() + return epfhu +} + +// SetMetadata sets the "metadata" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SetMetadata(m map[string]interface{}) *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.SetMetadata(m) + return epfhu +} + +// ClearMetadata clears the value of the "metadata" field. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ClearMetadata() *EntitlementPlanFeatureHistoryUpdate { + epfhu.mutation.ClearMetadata() + return epfhu +} + +// Mutation returns the EntitlementPlanFeatureHistoryMutation object of the builder. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) Mutation() *EntitlementPlanFeatureHistoryMutation { + return epfhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := epfhu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, epfhu.sqlSave, epfhu.mutation, epfhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := epfhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) Exec(ctx context.Context) error { + _, err := epfhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) ExecX(ctx context.Context) { + if err := epfhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epfhu *EntitlementPlanFeatureHistoryUpdate) defaults() error { + if _, ok := epfhu.mutation.UpdatedAt(); !ok && !epfhu.mutation.UpdatedAtCleared() { + if entitlementplanfeaturehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeaturehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeaturehistory.UpdateDefaultUpdatedAt() + epfhu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (epfhu *EntitlementPlanFeatureHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(entitlementplanfeaturehistory.Table, entitlementplanfeaturehistory.Columns, sqlgraph.NewFieldSpec(entitlementplanfeaturehistory.FieldID, field.TypeString)) + if ps := epfhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if epfhu.mutation.RefCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldRef, field.TypeString) + } + if epfhu.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := epfhu.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldUpdatedAt, field.TypeTime, value) + } + if epfhu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldUpdatedAt, field.TypeTime) + } + if epfhu.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := epfhu.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldUpdatedBy, field.TypeString, value) + } + if epfhu.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := epfhu.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldDeletedAt, field.TypeTime, value) + } + if epfhu.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := epfhu.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldDeletedBy, field.TypeString, value) + } + if epfhu.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := epfhu.mutation.Tags(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := epfhu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplanfeaturehistory.FieldTags, value) + }) + } + if epfhu.mutation.TagsCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldTags, field.TypeJSON) + } + if value, ok := epfhu.mutation.OwnerID(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldOwnerID, field.TypeString, value) + } + if epfhu.mutation.OwnerIDCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldOwnerID, field.TypeString) + } + if value, ok := epfhu.mutation.Metadata(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldMetadata, field.TypeJSON, value) + } + if epfhu.mutation.MetadataCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = epfhu.schemaConfig.EntitlementPlanFeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, epfhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, epfhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplanfeaturehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + epfhu.mutation.done = true + return n, nil +} + +// EntitlementPlanFeatureHistoryUpdateOne is the builder for updating a single EntitlementPlanFeatureHistory entity. +type EntitlementPlanFeatureHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntitlementPlanFeatureHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetUpdatedAt(t time.Time) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.SetUpdatedAt(t) + return epfhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ClearUpdatedAt() *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.ClearUpdatedAt() + return epfhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetUpdatedBy(s string) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.SetUpdatedBy(s) + return epfhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetNillableUpdatedBy(s *string) *EntitlementPlanFeatureHistoryUpdateOne { + if s != nil { + epfhuo.SetUpdatedBy(*s) + } + return epfhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ClearUpdatedBy() *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.ClearUpdatedBy() + return epfhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetDeletedAt(t time.Time) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.SetDeletedAt(t) + return epfhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementPlanFeatureHistoryUpdateOne { + if t != nil { + epfhuo.SetDeletedAt(*t) + } + return epfhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ClearDeletedAt() *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.ClearDeletedAt() + return epfhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetDeletedBy(s string) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.SetDeletedBy(s) + return epfhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetNillableDeletedBy(s *string) *EntitlementPlanFeatureHistoryUpdateOne { + if s != nil { + epfhuo.SetDeletedBy(*s) + } + return epfhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ClearDeletedBy() *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.ClearDeletedBy() + return epfhuo +} + +// SetTags sets the "tags" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetTags(s []string) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.SetTags(s) + return epfhuo +} + +// AppendTags appends s to the "tags" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) AppendTags(s []string) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.AppendTags(s) + return epfhuo +} + +// ClearTags clears the value of the "tags" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ClearTags() *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.ClearTags() + return epfhuo +} + +// SetOwnerID sets the "owner_id" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetOwnerID(s string) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.SetOwnerID(s) + return epfhuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetNillableOwnerID(s *string) *EntitlementPlanFeatureHistoryUpdateOne { + if s != nil { + epfhuo.SetOwnerID(*s) + } + return epfhuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ClearOwnerID() *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.ClearOwnerID() + return epfhuo +} + +// SetMetadata sets the "metadata" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SetMetadata(m map[string]interface{}) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.SetMetadata(m) + return epfhuo +} + +// ClearMetadata clears the value of the "metadata" field. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ClearMetadata() *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.ClearMetadata() + return epfhuo +} + +// Mutation returns the EntitlementPlanFeatureHistoryMutation object of the builder. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) Mutation() *EntitlementPlanFeatureHistoryMutation { + return epfhuo.mutation +} + +// Where appends a list predicates to the EntitlementPlanFeatureHistoryUpdate builder. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) Where(ps ...predicate.EntitlementPlanFeatureHistory) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.mutation.Where(ps...) + return epfhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) Select(field string, fields ...string) *EntitlementPlanFeatureHistoryUpdateOne { + epfhuo.fields = append([]string{field}, fields...) + return epfhuo +} + +// Save executes the query and returns the updated EntitlementPlanFeatureHistory entity. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) Save(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + if err := epfhuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, epfhuo.sqlSave, epfhuo.mutation, epfhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) SaveX(ctx context.Context) *EntitlementPlanFeatureHistory { + node, err := epfhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := epfhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) ExecX(ctx context.Context) { + if err := epfhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) defaults() error { + if _, ok := epfhuo.mutation.UpdatedAt(); !ok && !epfhuo.mutation.UpdatedAtCleared() { + if entitlementplanfeaturehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanfeaturehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanfeaturehistory.UpdateDefaultUpdatedAt() + epfhuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (epfhuo *EntitlementPlanFeatureHistoryUpdateOne) sqlSave(ctx context.Context) (_node *EntitlementPlanFeatureHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(entitlementplanfeaturehistory.Table, entitlementplanfeaturehistory.Columns, sqlgraph.NewFieldSpec(entitlementplanfeaturehistory.FieldID, field.TypeString)) + id, ok := epfhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntitlementPlanFeatureHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := epfhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplanfeaturehistory.FieldID) + for _, f := range fields { + if !entitlementplanfeaturehistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitlementplanfeaturehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := epfhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if epfhuo.mutation.RefCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldRef, field.TypeString) + } + if epfhuo.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := epfhuo.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldUpdatedAt, field.TypeTime, value) + } + if epfhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldUpdatedAt, field.TypeTime) + } + if epfhuo.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := epfhuo.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldUpdatedBy, field.TypeString, value) + } + if epfhuo.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := epfhuo.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldDeletedAt, field.TypeTime, value) + } + if epfhuo.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := epfhuo.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldDeletedBy, field.TypeString, value) + } + if epfhuo.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := epfhuo.mutation.Tags(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := epfhuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplanfeaturehistory.FieldTags, value) + }) + } + if epfhuo.mutation.TagsCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldTags, field.TypeJSON) + } + if value, ok := epfhuo.mutation.OwnerID(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldOwnerID, field.TypeString, value) + } + if epfhuo.mutation.OwnerIDCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldOwnerID, field.TypeString) + } + if value, ok := epfhuo.mutation.Metadata(); ok { + _spec.SetField(entitlementplanfeaturehistory.FieldMetadata, field.TypeJSON, value) + } + if epfhuo.mutation.MetadataCleared() { + _spec.ClearField(entitlementplanfeaturehistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = epfhuo.schemaConfig.EntitlementPlanFeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, epfhuo.schemaConfig) + _node = &EntitlementPlanFeatureHistory{config: epfhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, epfhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplanfeaturehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + epfhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entitlementplanhistory.go b/internal/ent/generated/entitlementplanhistory.go new file mode 100644 index 0000000..16565d8 --- /dev/null +++ b/internal/ent/generated/entitlementplanhistory.go @@ -0,0 +1,290 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/entx/history" +) + +// EntitlementPlanHistory is the model entity for the EntitlementPlanHistory schema. +type EntitlementPlanHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName string `json:"display_name,omitempty"` + // the unique name of the plan + Name string `json:"name,omitempty"` + // a description of the plan + Description string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version,omitempty"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntitlementPlanHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitlementplanhistory.FieldTags, entitlementplanhistory.FieldMetadata: + values[i] = new([]byte) + case entitlementplanhistory.FieldOperation: + values[i] = new(history.OpType) + case entitlementplanhistory.FieldID, entitlementplanhistory.FieldRef, entitlementplanhistory.FieldCreatedBy, entitlementplanhistory.FieldUpdatedBy, entitlementplanhistory.FieldMappingID, entitlementplanhistory.FieldDeletedBy, entitlementplanhistory.FieldOwnerID, entitlementplanhistory.FieldDisplayName, entitlementplanhistory.FieldName, entitlementplanhistory.FieldDescription, entitlementplanhistory.FieldVersion: + values[i] = new(sql.NullString) + case entitlementplanhistory.FieldHistoryTime, entitlementplanhistory.FieldCreatedAt, entitlementplanhistory.FieldUpdatedAt, entitlementplanhistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntitlementPlanHistory fields. +func (eph *EntitlementPlanHistory) 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 entitlementplanhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + eph.ID = value.String + } + case entitlementplanhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + eph.HistoryTime = value.Time + } + case entitlementplanhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + eph.Ref = value.String + } + case entitlementplanhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + eph.Operation = *value + } + case entitlementplanhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + eph.CreatedAt = value.Time + } + case entitlementplanhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + eph.UpdatedAt = value.Time + } + case entitlementplanhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + eph.CreatedBy = value.String + } + case entitlementplanhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + eph.UpdatedBy = value.String + } + case entitlementplanhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + eph.MappingID = value.String + } + case entitlementplanhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + eph.DeletedAt = value.Time + } + case entitlementplanhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + eph.DeletedBy = value.String + } + case entitlementplanhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &eph.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitlementplanhistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + eph.OwnerID = value.String + } + case entitlementplanhistory.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + eph.DisplayName = value.String + } + case entitlementplanhistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + eph.Name = value.String + } + case entitlementplanhistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + eph.Description = value.String + } + case entitlementplanhistory.FieldVersion: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field version", values[i]) + } else if value.Valid { + eph.Version = value.String + } + case entitlementplanhistory.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &eph.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + default: + eph.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntitlementPlanHistory. +// This includes values selected through modifiers, order, etc. +func (eph *EntitlementPlanHistory) Value(name string) (ent.Value, error) { + return eph.selectValues.Get(name) +} + +// Update returns a builder for updating this EntitlementPlanHistory. +// Note that you need to call EntitlementPlanHistory.Unwrap() before calling this method if this EntitlementPlanHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (eph *EntitlementPlanHistory) Update() *EntitlementPlanHistoryUpdateOne { + return NewEntitlementPlanHistoryClient(eph.config).UpdateOne(eph) +} + +// Unwrap unwraps the EntitlementPlanHistory 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 (eph *EntitlementPlanHistory) Unwrap() *EntitlementPlanHistory { + _tx, ok := eph.config.driver.(*txDriver) + if !ok { + panic("generated: EntitlementPlanHistory is not a transactional entity") + } + eph.config.driver = _tx.drv + return eph +} + +// String implements the fmt.Stringer. +func (eph *EntitlementPlanHistory) String() string { + var builder strings.Builder + builder.WriteString("EntitlementPlanHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", eph.ID)) + builder.WriteString("history_time=") + builder.WriteString(eph.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(eph.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", eph.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(eph.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(eph.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(eph.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(eph.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(eph.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(eph.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(eph.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", eph.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(eph.OwnerID) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(eph.DisplayName) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(eph.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(eph.Description) + builder.WriteString(", ") + builder.WriteString("version=") + builder.WriteString(eph.Version) + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", eph.Metadata)) + builder.WriteByte(')') + return builder.String() +} + +// EntitlementPlanHistories is a parsable slice of EntitlementPlanHistory. +type EntitlementPlanHistories []*EntitlementPlanHistory diff --git a/internal/ent/generated/entitlementplanhistory/entitlementplanhistory.go b/internal/ent/generated/entitlementplanhistory/entitlementplanhistory.go new file mode 100644 index 0000000..b6de364 --- /dev/null +++ b/internal/ent/generated/entitlementplanhistory/entitlementplanhistory.go @@ -0,0 +1,213 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplanhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the entitlementplanhistory type in the database. + Label = "entitlement_plan_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldVersion holds the string denoting the version field in the database. + FieldVersion = "version" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // Table holds the table name of the entitlementplanhistory in the database. + Table = "entitlement_plan_history" +) + +// Columns holds all SQL columns for entitlementplanhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldDisplayName, + FieldName, + FieldDescription, + FieldVersion, + FieldMetadata, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("entitlementplanhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the EntitlementPlanHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByVersion orders the results by the version field. +func ByVersion(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldVersion, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/entitlementplanhistory/where.go b/internal/ent/generated/entitlementplanhistory/where.go new file mode 100644 index 0000000..3adb206 --- /dev/null +++ b/internal/ent/generated/entitlementplanhistory/where.go @@ -0,0 +1,1101 @@ +// Code generated by ent, DO NOT EDIT. + +package entitlementplanhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDescription, v)) +} + +// Version applies equality check predicate on the "version" field. It's identical to VersionEQ. +func Version(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldVersion, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameIsNil applies the IsNil predicate on the "display_name" field. +func DisplayNameIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldDisplayName)) +} + +// DisplayNameNotNil applies the NotNil predicate on the "display_name" field. +func DisplayNameNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldDisplayName)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// VersionEQ applies the EQ predicate on the "version" field. +func VersionEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEQ(FieldVersion, v)) +} + +// VersionNEQ applies the NEQ predicate on the "version" field. +func VersionNEQ(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNEQ(FieldVersion, v)) +} + +// VersionIn applies the In predicate on the "version" field. +func VersionIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIn(FieldVersion, vs...)) +} + +// VersionNotIn applies the NotIn predicate on the "version" field. +func VersionNotIn(vs ...string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotIn(FieldVersion, vs...)) +} + +// VersionGT applies the GT predicate on the "version" field. +func VersionGT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGT(FieldVersion, v)) +} + +// VersionGTE applies the GTE predicate on the "version" field. +func VersionGTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldGTE(FieldVersion, v)) +} + +// VersionLT applies the LT predicate on the "version" field. +func VersionLT(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLT(FieldVersion, v)) +} + +// VersionLTE applies the LTE predicate on the "version" field. +func VersionLTE(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldLTE(FieldVersion, v)) +} + +// VersionContains applies the Contains predicate on the "version" field. +func VersionContains(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContains(FieldVersion, v)) +} + +// VersionHasPrefix applies the HasPrefix predicate on the "version" field. +func VersionHasPrefix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasPrefix(FieldVersion, v)) +} + +// VersionHasSuffix applies the HasSuffix predicate on the "version" field. +func VersionHasSuffix(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldHasSuffix(FieldVersion, v)) +} + +// VersionEqualFold applies the EqualFold predicate on the "version" field. +func VersionEqualFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldEqualFold(FieldVersion, v)) +} + +// VersionContainsFold applies the ContainsFold predicate on the "version" field. +func VersionContainsFold(v string) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldContainsFold(FieldVersion, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.FieldNotNull(FieldMetadata)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.EntitlementPlanHistory) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntitlementPlanHistory) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntitlementPlanHistory) predicate.EntitlementPlanHistory { + return predicate.EntitlementPlanHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitlementplanhistory_create.go b/internal/ent/generated/entitlementplanhistory_create.go new file mode 100644 index 0000000..63686db --- /dev/null +++ b/internal/ent/generated/entitlementplanhistory_create.go @@ -0,0 +1,526 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/entx/history" +) + +// EntitlementPlanHistoryCreate is the builder for creating a EntitlementPlanHistory entity. +type EntitlementPlanHistoryCreate struct { + config + mutation *EntitlementPlanHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ephc *EntitlementPlanHistoryCreate) SetHistoryTime(t time.Time) *EntitlementPlanHistoryCreate { + ephc.mutation.SetHistoryTime(t) + return ephc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableHistoryTime(t *time.Time) *EntitlementPlanHistoryCreate { + if t != nil { + ephc.SetHistoryTime(*t) + } + return ephc +} + +// SetRef sets the "ref" field. +func (ephc *EntitlementPlanHistoryCreate) SetRef(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetRef(s) + return ephc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableRef(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetRef(*s) + } + return ephc +} + +// SetOperation sets the "operation" field. +func (ephc *EntitlementPlanHistoryCreate) SetOperation(ht history.OpType) *EntitlementPlanHistoryCreate { + ephc.mutation.SetOperation(ht) + return ephc +} + +// SetCreatedAt sets the "created_at" field. +func (ephc *EntitlementPlanHistoryCreate) SetCreatedAt(t time.Time) *EntitlementPlanHistoryCreate { + ephc.mutation.SetCreatedAt(t) + return ephc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableCreatedAt(t *time.Time) *EntitlementPlanHistoryCreate { + if t != nil { + ephc.SetCreatedAt(*t) + } + return ephc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ephc *EntitlementPlanHistoryCreate) SetUpdatedAt(t time.Time) *EntitlementPlanHistoryCreate { + ephc.mutation.SetUpdatedAt(t) + return ephc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableUpdatedAt(t *time.Time) *EntitlementPlanHistoryCreate { + if t != nil { + ephc.SetUpdatedAt(*t) + } + return ephc +} + +// SetCreatedBy sets the "created_by" field. +func (ephc *EntitlementPlanHistoryCreate) SetCreatedBy(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetCreatedBy(s) + return ephc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableCreatedBy(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetCreatedBy(*s) + } + return ephc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ephc *EntitlementPlanHistoryCreate) SetUpdatedBy(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetUpdatedBy(s) + return ephc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableUpdatedBy(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetUpdatedBy(*s) + } + return ephc +} + +// SetMappingID sets the "mapping_id" field. +func (ephc *EntitlementPlanHistoryCreate) SetMappingID(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetMappingID(s) + return ephc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableMappingID(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetMappingID(*s) + } + return ephc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ephc *EntitlementPlanHistoryCreate) SetDeletedAt(t time.Time) *EntitlementPlanHistoryCreate { + ephc.mutation.SetDeletedAt(t) + return ephc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanHistoryCreate { + if t != nil { + ephc.SetDeletedAt(*t) + } + return ephc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ephc *EntitlementPlanHistoryCreate) SetDeletedBy(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetDeletedBy(s) + return ephc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableDeletedBy(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetDeletedBy(*s) + } + return ephc +} + +// SetTags sets the "tags" field. +func (ephc *EntitlementPlanHistoryCreate) SetTags(s []string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetTags(s) + return ephc +} + +// SetOwnerID sets the "owner_id" field. +func (ephc *EntitlementPlanHistoryCreate) SetOwnerID(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetOwnerID(s) + return ephc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableOwnerID(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetOwnerID(*s) + } + return ephc +} + +// SetDisplayName sets the "display_name" field. +func (ephc *EntitlementPlanHistoryCreate) SetDisplayName(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetDisplayName(s) + return ephc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableDisplayName(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetDisplayName(*s) + } + return ephc +} + +// SetName sets the "name" field. +func (ephc *EntitlementPlanHistoryCreate) SetName(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetName(s) + return ephc +} + +// SetDescription sets the "description" field. +func (ephc *EntitlementPlanHistoryCreate) SetDescription(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetDescription(s) + return ephc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableDescription(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetDescription(*s) + } + return ephc +} + +// SetVersion sets the "version" field. +func (ephc *EntitlementPlanHistoryCreate) SetVersion(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetVersion(s) + return ephc +} + +// SetMetadata sets the "metadata" field. +func (ephc *EntitlementPlanHistoryCreate) SetMetadata(m map[string]interface{}) *EntitlementPlanHistoryCreate { + ephc.mutation.SetMetadata(m) + return ephc +} + +// SetID sets the "id" field. +func (ephc *EntitlementPlanHistoryCreate) SetID(s string) *EntitlementPlanHistoryCreate { + ephc.mutation.SetID(s) + return ephc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ephc *EntitlementPlanHistoryCreate) SetNillableID(s *string) *EntitlementPlanHistoryCreate { + if s != nil { + ephc.SetID(*s) + } + return ephc +} + +// Mutation returns the EntitlementPlanHistoryMutation object of the builder. +func (ephc *EntitlementPlanHistoryCreate) Mutation() *EntitlementPlanHistoryMutation { + return ephc.mutation +} + +// Save creates the EntitlementPlanHistory in the database. +func (ephc *EntitlementPlanHistoryCreate) Save(ctx context.Context) (*EntitlementPlanHistory, error) { + if err := ephc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ephc.sqlSave, ephc.mutation, ephc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ephc *EntitlementPlanHistoryCreate) SaveX(ctx context.Context) *EntitlementPlanHistory { + v, err := ephc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ephc *EntitlementPlanHistoryCreate) Exec(ctx context.Context) error { + _, err := ephc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ephc *EntitlementPlanHistoryCreate) ExecX(ctx context.Context) { + if err := ephc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ephc *EntitlementPlanHistoryCreate) defaults() error { + if _, ok := ephc.mutation.HistoryTime(); !ok { + if entitlementplanhistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized entitlementplanhistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := entitlementplanhistory.DefaultHistoryTime() + ephc.mutation.SetHistoryTime(v) + } + if _, ok := ephc.mutation.CreatedAt(); !ok { + if entitlementplanhistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanhistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanhistory.DefaultCreatedAt() + ephc.mutation.SetCreatedAt(v) + } + if _, ok := ephc.mutation.UpdatedAt(); !ok { + if entitlementplanhistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanhistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanhistory.DefaultUpdatedAt() + ephc.mutation.SetUpdatedAt(v) + } + if _, ok := ephc.mutation.MappingID(); !ok { + if entitlementplanhistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitlementplanhistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitlementplanhistory.DefaultMappingID() + ephc.mutation.SetMappingID(v) + } + if _, ok := ephc.mutation.Tags(); !ok { + v := entitlementplanhistory.DefaultTags + ephc.mutation.SetTags(v) + } + if _, ok := ephc.mutation.ID(); !ok { + if entitlementplanhistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitlementplanhistory.DefaultID (forgotten import generated/runtime?)") + } + v := entitlementplanhistory.DefaultID() + ephc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ephc *EntitlementPlanHistoryCreate) check() error { + if _, ok := ephc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "EntitlementPlanHistory.history_time"`)} + } + if _, ok := ephc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "EntitlementPlanHistory.operation"`)} + } + if v, ok := ephc.mutation.Operation(); ok { + if err := entitlementplanhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "EntitlementPlanHistory.operation": %w`, err)} + } + } + if _, ok := ephc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntitlementPlanHistory.mapping_id"`)} + } + if _, ok := ephc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "EntitlementPlanHistory.name"`)} + } + if _, ok := ephc.mutation.Version(); !ok { + return &ValidationError{Name: "version", err: errors.New(`generated: missing required field "EntitlementPlanHistory.version"`)} + } + return nil +} + +func (ephc *EntitlementPlanHistoryCreate) sqlSave(ctx context.Context) (*EntitlementPlanHistory, error) { + if err := ephc.check(); err != nil { + return nil, err + } + _node, _spec := ephc.createSpec() + if err := sqlgraph.CreateNode(ctx, ephc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntitlementPlanHistory.ID type: %T", _spec.ID.Value) + } + } + ephc.mutation.id = &_node.ID + ephc.mutation.done = true + return _node, nil +} + +func (ephc *EntitlementPlanHistoryCreate) createSpec() (*EntitlementPlanHistory, *sqlgraph.CreateSpec) { + var ( + _node = &EntitlementPlanHistory{config: ephc.config} + _spec = sqlgraph.NewCreateSpec(entitlementplanhistory.Table, sqlgraph.NewFieldSpec(entitlementplanhistory.FieldID, field.TypeString)) + ) + _spec.Schema = ephc.schemaConfig.EntitlementPlanHistory + if id, ok := ephc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ephc.mutation.HistoryTime(); ok { + _spec.SetField(entitlementplanhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ephc.mutation.Ref(); ok { + _spec.SetField(entitlementplanhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ephc.mutation.Operation(); ok { + _spec.SetField(entitlementplanhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ephc.mutation.CreatedAt(); ok { + _spec.SetField(entitlementplanhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ephc.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ephc.mutation.CreatedBy(); ok { + _spec.SetField(entitlementplanhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ephc.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ephc.mutation.MappingID(); ok { + _spec.SetField(entitlementplanhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ephc.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ephc.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ephc.mutation.Tags(); ok { + _spec.SetField(entitlementplanhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ephc.mutation.OwnerID(); ok { + _spec.SetField(entitlementplanhistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ephc.mutation.DisplayName(); ok { + _spec.SetField(entitlementplanhistory.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := ephc.mutation.Name(); ok { + _spec.SetField(entitlementplanhistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ephc.mutation.Description(); ok { + _spec.SetField(entitlementplanhistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := ephc.mutation.Version(); ok { + _spec.SetField(entitlementplanhistory.FieldVersion, field.TypeString, value) + _node.Version = value + } + if value, ok := ephc.mutation.Metadata(); ok { + _spec.SetField(entitlementplanhistory.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + return _node, _spec +} + +// EntitlementPlanHistoryCreateBulk is the builder for creating many EntitlementPlanHistory entities in bulk. +type EntitlementPlanHistoryCreateBulk struct { + config + err error + builders []*EntitlementPlanHistoryCreate +} + +// Save creates the EntitlementPlanHistory entities in the database. +func (ephcb *EntitlementPlanHistoryCreateBulk) Save(ctx context.Context) ([]*EntitlementPlanHistory, error) { + if ephcb.err != nil { + return nil, ephcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ephcb.builders)) + nodes := make([]*EntitlementPlanHistory, len(ephcb.builders)) + mutators := make([]Mutator, len(ephcb.builders)) + for i := range ephcb.builders { + func(i int, root context.Context) { + builder := ephcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntitlementPlanHistoryMutation) + 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, ephcb.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, ephcb.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, ephcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ephcb *EntitlementPlanHistoryCreateBulk) SaveX(ctx context.Context) []*EntitlementPlanHistory { + v, err := ephcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ephcb *EntitlementPlanHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ephcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ephcb *EntitlementPlanHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ephcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplanhistory_delete.go b/internal/ent/generated/entitlementplanhistory_delete.go new file mode 100644 index 0000000..de0815b --- /dev/null +++ b/internal/ent/generated/entitlementplanhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanHistoryDelete is the builder for deleting a EntitlementPlanHistory entity. +type EntitlementPlanHistoryDelete struct { + config + hooks []Hook + mutation *EntitlementPlanHistoryMutation +} + +// Where appends a list predicates to the EntitlementPlanHistoryDelete builder. +func (ephd *EntitlementPlanHistoryDelete) Where(ps ...predicate.EntitlementPlanHistory) *EntitlementPlanHistoryDelete { + ephd.mutation.Where(ps...) + return ephd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ephd *EntitlementPlanHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ephd.sqlExec, ephd.mutation, ephd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ephd *EntitlementPlanHistoryDelete) ExecX(ctx context.Context) int { + n, err := ephd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ephd *EntitlementPlanHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitlementplanhistory.Table, sqlgraph.NewFieldSpec(entitlementplanhistory.FieldID, field.TypeString)) + _spec.Node.Schema = ephd.schemaConfig.EntitlementPlanHistory + ctx = internal.NewSchemaConfigContext(ctx, ephd.schemaConfig) + if ps := ephd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ephd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ephd.mutation.done = true + return affected, err +} + +// EntitlementPlanHistoryDeleteOne is the builder for deleting a single EntitlementPlanHistory entity. +type EntitlementPlanHistoryDeleteOne struct { + ephd *EntitlementPlanHistoryDelete +} + +// Where appends a list predicates to the EntitlementPlanHistoryDelete builder. +func (ephdo *EntitlementPlanHistoryDeleteOne) Where(ps ...predicate.EntitlementPlanHistory) *EntitlementPlanHistoryDeleteOne { + ephdo.ephd.mutation.Where(ps...) + return ephdo +} + +// Exec executes the deletion query. +func (ephdo *EntitlementPlanHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ephdo.ephd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitlementplanhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ephdo *EntitlementPlanHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ephdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitlementplanhistory_query.go b/internal/ent/generated/entitlementplanhistory_query.go new file mode 100644 index 0000000..3a44a40 --- /dev/null +++ b/internal/ent/generated/entitlementplanhistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanHistoryQuery is the builder for querying EntitlementPlanHistory entities. +type EntitlementPlanHistoryQuery struct { + config + ctx *QueryContext + order []entitlementplanhistory.OrderOption + inters []Interceptor + predicates []predicate.EntitlementPlanHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntitlementPlanHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntitlementPlanHistoryQuery builder. +func (ephq *EntitlementPlanHistoryQuery) Where(ps ...predicate.EntitlementPlanHistory) *EntitlementPlanHistoryQuery { + ephq.predicates = append(ephq.predicates, ps...) + return ephq +} + +// Limit the number of records to be returned by this query. +func (ephq *EntitlementPlanHistoryQuery) Limit(limit int) *EntitlementPlanHistoryQuery { + ephq.ctx.Limit = &limit + return ephq +} + +// Offset to start from. +func (ephq *EntitlementPlanHistoryQuery) Offset(offset int) *EntitlementPlanHistoryQuery { + ephq.ctx.Offset = &offset + return ephq +} + +// 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 (ephq *EntitlementPlanHistoryQuery) Unique(unique bool) *EntitlementPlanHistoryQuery { + ephq.ctx.Unique = &unique + return ephq +} + +// Order specifies how the records should be ordered. +func (ephq *EntitlementPlanHistoryQuery) Order(o ...entitlementplanhistory.OrderOption) *EntitlementPlanHistoryQuery { + ephq.order = append(ephq.order, o...) + return ephq +} + +// First returns the first EntitlementPlanHistory entity from the query. +// Returns a *NotFoundError when no EntitlementPlanHistory was found. +func (ephq *EntitlementPlanHistoryQuery) First(ctx context.Context) (*EntitlementPlanHistory, error) { + nodes, err := ephq.Limit(1).All(setContextOp(ctx, ephq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitlementplanhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) FirstX(ctx context.Context) *EntitlementPlanHistory { + node, err := ephq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntitlementPlanHistory ID from the query. +// Returns a *NotFoundError when no EntitlementPlanHistory ID was found. +func (ephq *EntitlementPlanHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ephq.Limit(1).IDs(setContextOp(ctx, ephq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitlementplanhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ephq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntitlementPlanHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntitlementPlanHistory entity is found. +// Returns a *NotFoundError when no EntitlementPlanHistory entities are found. +func (ephq *EntitlementPlanHistoryQuery) Only(ctx context.Context) (*EntitlementPlanHistory, error) { + nodes, err := ephq.Limit(2).All(setContextOp(ctx, ephq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitlementplanhistory.Label} + default: + return nil, &NotSingularError{entitlementplanhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) OnlyX(ctx context.Context) *EntitlementPlanHistory { + node, err := ephq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntitlementPlanHistory ID in the query. +// Returns a *NotSingularError when more than one EntitlementPlanHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ephq *EntitlementPlanHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ephq.Limit(2).IDs(setContextOp(ctx, ephq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitlementplanhistory.Label} + default: + err = &NotSingularError{entitlementplanhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ephq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntitlementPlanHistories. +func (ephq *EntitlementPlanHistoryQuery) All(ctx context.Context) ([]*EntitlementPlanHistory, error) { + ctx = setContextOp(ctx, ephq.ctx, ent.OpQueryAll) + if err := ephq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntitlementPlanHistory, *EntitlementPlanHistoryQuery]() + return withInterceptors[[]*EntitlementPlanHistory](ctx, ephq, qr, ephq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) AllX(ctx context.Context) []*EntitlementPlanHistory { + nodes, err := ephq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntitlementPlanHistory IDs. +func (ephq *EntitlementPlanHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ephq.ctx.Unique == nil && ephq.path != nil { + ephq.Unique(true) + } + ctx = setContextOp(ctx, ephq.ctx, ent.OpQueryIDs) + if err = ephq.Select(entitlementplanhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ephq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ephq *EntitlementPlanHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ephq.ctx, ent.OpQueryCount) + if err := ephq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ephq, querierCount[*EntitlementPlanHistoryQuery](), ephq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) CountX(ctx context.Context) int { + count, err := ephq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ephq *EntitlementPlanHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ephq.ctx, ent.OpQueryExist) + switch _, err := ephq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ephq *EntitlementPlanHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ephq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntitlementPlanHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ephq *EntitlementPlanHistoryQuery) Clone() *EntitlementPlanHistoryQuery { + if ephq == nil { + return nil + } + return &EntitlementPlanHistoryQuery{ + config: ephq.config, + ctx: ephq.ctx.Clone(), + order: append([]entitlementplanhistory.OrderOption{}, ephq.order...), + inters: append([]Interceptor{}, ephq.inters...), + predicates: append([]predicate.EntitlementPlanHistory{}, ephq.predicates...), + // clone intermediate query. + sql: ephq.sql.Clone(), + path: ephq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntitlementPlanHistory.Query(). +// GroupBy(entitlementplanhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ephq *EntitlementPlanHistoryQuery) GroupBy(field string, fields ...string) *EntitlementPlanHistoryGroupBy { + ephq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntitlementPlanHistoryGroupBy{build: ephq} + grbuild.flds = &ephq.ctx.Fields + grbuild.label = entitlementplanhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.EntitlementPlanHistory.Query(). +// Select(entitlementplanhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ephq *EntitlementPlanHistoryQuery) Select(fields ...string) *EntitlementPlanHistorySelect { + ephq.ctx.Fields = append(ephq.ctx.Fields, fields...) + sbuild := &EntitlementPlanHistorySelect{EntitlementPlanHistoryQuery: ephq} + sbuild.label = entitlementplanhistory.Label + sbuild.flds, sbuild.scan = &ephq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntitlementPlanHistorySelect configured with the given aggregations. +func (ephq *EntitlementPlanHistoryQuery) Aggregate(fns ...AggregateFunc) *EntitlementPlanHistorySelect { + return ephq.Select().Aggregate(fns...) +} + +func (ephq *EntitlementPlanHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ephq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ephq); err != nil { + return err + } + } + } + for _, f := range ephq.ctx.Fields { + if !entitlementplanhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ephq.path != nil { + prev, err := ephq.path(ctx) + if err != nil { + return err + } + ephq.sql = prev + } + if entitlementplanhistory.Policy == nil { + return errors.New("generated: uninitialized entitlementplanhistory.Policy (forgotten import generated/runtime?)") + } + if err := entitlementplanhistory.Policy.EvalQuery(ctx, ephq); err != nil { + return err + } + return nil +} + +func (ephq *EntitlementPlanHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntitlementPlanHistory, error) { + var ( + nodes = []*EntitlementPlanHistory{} + _spec = ephq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntitlementPlanHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntitlementPlanHistory{config: ephq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ephq.schemaConfig.EntitlementPlanHistory + ctx = internal.NewSchemaConfigContext(ctx, ephq.schemaConfig) + if len(ephq.modifiers) > 0 { + _spec.Modifiers = ephq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ephq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ephq.loadTotal { + if err := ephq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ephq *EntitlementPlanHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ephq.querySpec() + _spec.Node.Schema = ephq.schemaConfig.EntitlementPlanHistory + ctx = internal.NewSchemaConfigContext(ctx, ephq.schemaConfig) + if len(ephq.modifiers) > 0 { + _spec.Modifiers = ephq.modifiers + } + _spec.Node.Columns = ephq.ctx.Fields + if len(ephq.ctx.Fields) > 0 { + _spec.Unique = ephq.ctx.Unique != nil && *ephq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ephq.driver, _spec) +} + +func (ephq *EntitlementPlanHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitlementplanhistory.Table, entitlementplanhistory.Columns, sqlgraph.NewFieldSpec(entitlementplanhistory.FieldID, field.TypeString)) + _spec.From = ephq.sql + if unique := ephq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ephq.path != nil { + _spec.Unique = true + } + if fields := ephq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplanhistory.FieldID) + for i := range fields { + if fields[i] != entitlementplanhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ephq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ephq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ephq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ephq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ephq *EntitlementPlanHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ephq.driver.Dialect()) + t1 := builder.Table(entitlementplanhistory.Table) + columns := ephq.ctx.Fields + if len(columns) == 0 { + columns = entitlementplanhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ephq.sql != nil { + selector = ephq.sql + selector.Select(selector.Columns(columns...)...) + } + if ephq.ctx.Unique != nil && *ephq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ephq.schemaConfig.EntitlementPlanHistory) + ctx = internal.NewSchemaConfigContext(ctx, ephq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ephq.predicates { + p(selector) + } + for _, p := range ephq.order { + p(selector) + } + if offset := ephq.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 := ephq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// EntitlementPlanHistoryGroupBy is the group-by builder for EntitlementPlanHistory entities. +type EntitlementPlanHistoryGroupBy struct { + selector + build *EntitlementPlanHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ephgb *EntitlementPlanHistoryGroupBy) Aggregate(fns ...AggregateFunc) *EntitlementPlanHistoryGroupBy { + ephgb.fns = append(ephgb.fns, fns...) + return ephgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ephgb *EntitlementPlanHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ephgb.build.ctx, ent.OpQueryGroupBy) + if err := ephgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanHistoryQuery, *EntitlementPlanHistoryGroupBy](ctx, ephgb.build, ephgb, ephgb.build.inters, v) +} + +func (ephgb *EntitlementPlanHistoryGroupBy) sqlScan(ctx context.Context, root *EntitlementPlanHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ephgb.fns)) + for _, fn := range ephgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ephgb.flds)+len(ephgb.fns)) + for _, f := range *ephgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ephgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ephgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntitlementPlanHistorySelect is the builder for selecting fields of EntitlementPlanHistory entities. +type EntitlementPlanHistorySelect struct { + *EntitlementPlanHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ephs *EntitlementPlanHistorySelect) Aggregate(fns ...AggregateFunc) *EntitlementPlanHistorySelect { + ephs.fns = append(ephs.fns, fns...) + return ephs +} + +// Scan applies the selector query and scans the result into the given value. +func (ephs *EntitlementPlanHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ephs.ctx, ent.OpQuerySelect) + if err := ephs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntitlementPlanHistoryQuery, *EntitlementPlanHistorySelect](ctx, ephs.EntitlementPlanHistoryQuery, ephs, ephs.inters, v) +} + +func (ephs *EntitlementPlanHistorySelect) sqlScan(ctx context.Context, root *EntitlementPlanHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ephs.fns)) + for _, fn := range ephs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ephs.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 := ephs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitlementplanhistory_update.go b/internal/ent/generated/entitlementplanhistory_update.go new file mode 100644 index 0000000..095466c --- /dev/null +++ b/internal/ent/generated/entitlementplanhistory_update.go @@ -0,0 +1,673 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntitlementPlanHistoryUpdate is the builder for updating EntitlementPlanHistory entities. +type EntitlementPlanHistoryUpdate struct { + config + hooks []Hook + mutation *EntitlementPlanHistoryMutation +} + +// Where appends a list predicates to the EntitlementPlanHistoryUpdate builder. +func (ephu *EntitlementPlanHistoryUpdate) Where(ps ...predicate.EntitlementPlanHistory) *EntitlementPlanHistoryUpdate { + ephu.mutation.Where(ps...) + return ephu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ephu *EntitlementPlanHistoryUpdate) SetUpdatedAt(t time.Time) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetUpdatedAt(t) + return ephu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearUpdatedAt() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearUpdatedAt() + return ephu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ephu *EntitlementPlanHistoryUpdate) SetUpdatedBy(s string) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetUpdatedBy(s) + return ephu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ephu *EntitlementPlanHistoryUpdate) SetNillableUpdatedBy(s *string) *EntitlementPlanHistoryUpdate { + if s != nil { + ephu.SetUpdatedBy(*s) + } + return ephu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearUpdatedBy() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearUpdatedBy() + return ephu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ephu *EntitlementPlanHistoryUpdate) SetDeletedAt(t time.Time) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetDeletedAt(t) + return ephu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ephu *EntitlementPlanHistoryUpdate) SetNillableDeletedAt(t *time.Time) *EntitlementPlanHistoryUpdate { + if t != nil { + ephu.SetDeletedAt(*t) + } + return ephu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearDeletedAt() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearDeletedAt() + return ephu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ephu *EntitlementPlanHistoryUpdate) SetDeletedBy(s string) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetDeletedBy(s) + return ephu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ephu *EntitlementPlanHistoryUpdate) SetNillableDeletedBy(s *string) *EntitlementPlanHistoryUpdate { + if s != nil { + ephu.SetDeletedBy(*s) + } + return ephu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearDeletedBy() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearDeletedBy() + return ephu +} + +// SetTags sets the "tags" field. +func (ephu *EntitlementPlanHistoryUpdate) SetTags(s []string) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetTags(s) + return ephu +} + +// AppendTags appends s to the "tags" field. +func (ephu *EntitlementPlanHistoryUpdate) AppendTags(s []string) *EntitlementPlanHistoryUpdate { + ephu.mutation.AppendTags(s) + return ephu +} + +// ClearTags clears the value of the "tags" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearTags() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearTags() + return ephu +} + +// SetOwnerID sets the "owner_id" field. +func (ephu *EntitlementPlanHistoryUpdate) SetOwnerID(s string) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetOwnerID(s) + return ephu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ephu *EntitlementPlanHistoryUpdate) SetNillableOwnerID(s *string) *EntitlementPlanHistoryUpdate { + if s != nil { + ephu.SetOwnerID(*s) + } + return ephu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearOwnerID() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearOwnerID() + return ephu +} + +// SetDisplayName sets the "display_name" field. +func (ephu *EntitlementPlanHistoryUpdate) SetDisplayName(s string) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetDisplayName(s) + return ephu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ephu *EntitlementPlanHistoryUpdate) SetNillableDisplayName(s *string) *EntitlementPlanHistoryUpdate { + if s != nil { + ephu.SetDisplayName(*s) + } + return ephu +} + +// ClearDisplayName clears the value of the "display_name" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearDisplayName() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearDisplayName() + return ephu +} + +// SetDescription sets the "description" field. +func (ephu *EntitlementPlanHistoryUpdate) SetDescription(s string) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetDescription(s) + return ephu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ephu *EntitlementPlanHistoryUpdate) SetNillableDescription(s *string) *EntitlementPlanHistoryUpdate { + if s != nil { + ephu.SetDescription(*s) + } + return ephu +} + +// ClearDescription clears the value of the "description" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearDescription() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearDescription() + return ephu +} + +// SetMetadata sets the "metadata" field. +func (ephu *EntitlementPlanHistoryUpdate) SetMetadata(m map[string]interface{}) *EntitlementPlanHistoryUpdate { + ephu.mutation.SetMetadata(m) + return ephu +} + +// ClearMetadata clears the value of the "metadata" field. +func (ephu *EntitlementPlanHistoryUpdate) ClearMetadata() *EntitlementPlanHistoryUpdate { + ephu.mutation.ClearMetadata() + return ephu +} + +// Mutation returns the EntitlementPlanHistoryMutation object of the builder. +func (ephu *EntitlementPlanHistoryUpdate) Mutation() *EntitlementPlanHistoryMutation { + return ephu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ephu *EntitlementPlanHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ephu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ephu.sqlSave, ephu.mutation, ephu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ephu *EntitlementPlanHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ephu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ephu *EntitlementPlanHistoryUpdate) Exec(ctx context.Context) error { + _, err := ephu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ephu *EntitlementPlanHistoryUpdate) ExecX(ctx context.Context) { + if err := ephu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ephu *EntitlementPlanHistoryUpdate) defaults() error { + if _, ok := ephu.mutation.UpdatedAt(); !ok && !ephu.mutation.UpdatedAtCleared() { + if entitlementplanhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanhistory.UpdateDefaultUpdatedAt() + ephu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ephu *EntitlementPlanHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(entitlementplanhistory.Table, entitlementplanhistory.Columns, sqlgraph.NewFieldSpec(entitlementplanhistory.FieldID, field.TypeString)) + if ps := ephu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ephu.mutation.RefCleared() { + _spec.ClearField(entitlementplanhistory.FieldRef, field.TypeString) + } + if ephu.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplanhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ephu.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ephu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplanhistory.FieldUpdatedAt, field.TypeTime) + } + if ephu.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplanhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ephu.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanhistory.FieldUpdatedBy, field.TypeString, value) + } + if ephu.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplanhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ephu.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanhistory.FieldDeletedAt, field.TypeTime, value) + } + if ephu.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplanhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ephu.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanhistory.FieldDeletedBy, field.TypeString, value) + } + if ephu.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplanhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ephu.mutation.Tags(); ok { + _spec.SetField(entitlementplanhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ephu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplanhistory.FieldTags, value) + }) + } + if ephu.mutation.TagsCleared() { + _spec.ClearField(entitlementplanhistory.FieldTags, field.TypeJSON) + } + if value, ok := ephu.mutation.OwnerID(); ok { + _spec.SetField(entitlementplanhistory.FieldOwnerID, field.TypeString, value) + } + if ephu.mutation.OwnerIDCleared() { + _spec.ClearField(entitlementplanhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ephu.mutation.DisplayName(); ok { + _spec.SetField(entitlementplanhistory.FieldDisplayName, field.TypeString, value) + } + if ephu.mutation.DisplayNameCleared() { + _spec.ClearField(entitlementplanhistory.FieldDisplayName, field.TypeString) + } + if value, ok := ephu.mutation.Description(); ok { + _spec.SetField(entitlementplanhistory.FieldDescription, field.TypeString, value) + } + if ephu.mutation.DescriptionCleared() { + _spec.ClearField(entitlementplanhistory.FieldDescription, field.TypeString) + } + if value, ok := ephu.mutation.Metadata(); ok { + _spec.SetField(entitlementplanhistory.FieldMetadata, field.TypeJSON, value) + } + if ephu.mutation.MetadataCleared() { + _spec.ClearField(entitlementplanhistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = ephu.schemaConfig.EntitlementPlanHistory + ctx = internal.NewSchemaConfigContext(ctx, ephu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ephu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplanhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ephu.mutation.done = true + return n, nil +} + +// EntitlementPlanHistoryUpdateOne is the builder for updating a single EntitlementPlanHistory entity. +type EntitlementPlanHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntitlementPlanHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetUpdatedAt(t time.Time) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetUpdatedAt(t) + return ephuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearUpdatedAt() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearUpdatedAt() + return ephuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetUpdatedBy(s string) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetUpdatedBy(s) + return ephuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetNillableUpdatedBy(s *string) *EntitlementPlanHistoryUpdateOne { + if s != nil { + ephuo.SetUpdatedBy(*s) + } + return ephuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearUpdatedBy() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearUpdatedBy() + return ephuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetDeletedAt(t time.Time) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetDeletedAt(t) + return ephuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *EntitlementPlanHistoryUpdateOne { + if t != nil { + ephuo.SetDeletedAt(*t) + } + return ephuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearDeletedAt() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearDeletedAt() + return ephuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetDeletedBy(s string) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetDeletedBy(s) + return ephuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetNillableDeletedBy(s *string) *EntitlementPlanHistoryUpdateOne { + if s != nil { + ephuo.SetDeletedBy(*s) + } + return ephuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearDeletedBy() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearDeletedBy() + return ephuo +} + +// SetTags sets the "tags" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetTags(s []string) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetTags(s) + return ephuo +} + +// AppendTags appends s to the "tags" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) AppendTags(s []string) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.AppendTags(s) + return ephuo +} + +// ClearTags clears the value of the "tags" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearTags() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearTags() + return ephuo +} + +// SetOwnerID sets the "owner_id" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetOwnerID(s string) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetOwnerID(s) + return ephuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetNillableOwnerID(s *string) *EntitlementPlanHistoryUpdateOne { + if s != nil { + ephuo.SetOwnerID(*s) + } + return ephuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearOwnerID() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearOwnerID() + return ephuo +} + +// SetDisplayName sets the "display_name" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetDisplayName(s string) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetDisplayName(s) + return ephuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetNillableDisplayName(s *string) *EntitlementPlanHistoryUpdateOne { + if s != nil { + ephuo.SetDisplayName(*s) + } + return ephuo +} + +// ClearDisplayName clears the value of the "display_name" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearDisplayName() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearDisplayName() + return ephuo +} + +// SetDescription sets the "description" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetDescription(s string) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetDescription(s) + return ephuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetNillableDescription(s *string) *EntitlementPlanHistoryUpdateOne { + if s != nil { + ephuo.SetDescription(*s) + } + return ephuo +} + +// ClearDescription clears the value of the "description" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearDescription() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearDescription() + return ephuo +} + +// SetMetadata sets the "metadata" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) SetMetadata(m map[string]interface{}) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.SetMetadata(m) + return ephuo +} + +// ClearMetadata clears the value of the "metadata" field. +func (ephuo *EntitlementPlanHistoryUpdateOne) ClearMetadata() *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.ClearMetadata() + return ephuo +} + +// Mutation returns the EntitlementPlanHistoryMutation object of the builder. +func (ephuo *EntitlementPlanHistoryUpdateOne) Mutation() *EntitlementPlanHistoryMutation { + return ephuo.mutation +} + +// Where appends a list predicates to the EntitlementPlanHistoryUpdate builder. +func (ephuo *EntitlementPlanHistoryUpdateOne) Where(ps ...predicate.EntitlementPlanHistory) *EntitlementPlanHistoryUpdateOne { + ephuo.mutation.Where(ps...) + return ephuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ephuo *EntitlementPlanHistoryUpdateOne) Select(field string, fields ...string) *EntitlementPlanHistoryUpdateOne { + ephuo.fields = append([]string{field}, fields...) + return ephuo +} + +// Save executes the query and returns the updated EntitlementPlanHistory entity. +func (ephuo *EntitlementPlanHistoryUpdateOne) Save(ctx context.Context) (*EntitlementPlanHistory, error) { + if err := ephuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ephuo.sqlSave, ephuo.mutation, ephuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ephuo *EntitlementPlanHistoryUpdateOne) SaveX(ctx context.Context) *EntitlementPlanHistory { + node, err := ephuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ephuo *EntitlementPlanHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ephuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ephuo *EntitlementPlanHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ephuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ephuo *EntitlementPlanHistoryUpdateOne) defaults() error { + if _, ok := ephuo.mutation.UpdatedAt(); !ok && !ephuo.mutation.UpdatedAtCleared() { + if entitlementplanhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitlementplanhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitlementplanhistory.UpdateDefaultUpdatedAt() + ephuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ephuo *EntitlementPlanHistoryUpdateOne) sqlSave(ctx context.Context) (_node *EntitlementPlanHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(entitlementplanhistory.Table, entitlementplanhistory.Columns, sqlgraph.NewFieldSpec(entitlementplanhistory.FieldID, field.TypeString)) + id, ok := ephuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntitlementPlanHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ephuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitlementplanhistory.FieldID) + for _, f := range fields { + if !entitlementplanhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitlementplanhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ephuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ephuo.mutation.RefCleared() { + _spec.ClearField(entitlementplanhistory.FieldRef, field.TypeString) + } + if ephuo.mutation.CreatedAtCleared() { + _spec.ClearField(entitlementplanhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ephuo.mutation.UpdatedAt(); ok { + _spec.SetField(entitlementplanhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ephuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitlementplanhistory.FieldUpdatedAt, field.TypeTime) + } + if ephuo.mutation.CreatedByCleared() { + _spec.ClearField(entitlementplanhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ephuo.mutation.UpdatedBy(); ok { + _spec.SetField(entitlementplanhistory.FieldUpdatedBy, field.TypeString, value) + } + if ephuo.mutation.UpdatedByCleared() { + _spec.ClearField(entitlementplanhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ephuo.mutation.DeletedAt(); ok { + _spec.SetField(entitlementplanhistory.FieldDeletedAt, field.TypeTime, value) + } + if ephuo.mutation.DeletedAtCleared() { + _spec.ClearField(entitlementplanhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ephuo.mutation.DeletedBy(); ok { + _spec.SetField(entitlementplanhistory.FieldDeletedBy, field.TypeString, value) + } + if ephuo.mutation.DeletedByCleared() { + _spec.ClearField(entitlementplanhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ephuo.mutation.Tags(); ok { + _spec.SetField(entitlementplanhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ephuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitlementplanhistory.FieldTags, value) + }) + } + if ephuo.mutation.TagsCleared() { + _spec.ClearField(entitlementplanhistory.FieldTags, field.TypeJSON) + } + if value, ok := ephuo.mutation.OwnerID(); ok { + _spec.SetField(entitlementplanhistory.FieldOwnerID, field.TypeString, value) + } + if ephuo.mutation.OwnerIDCleared() { + _spec.ClearField(entitlementplanhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ephuo.mutation.DisplayName(); ok { + _spec.SetField(entitlementplanhistory.FieldDisplayName, field.TypeString, value) + } + if ephuo.mutation.DisplayNameCleared() { + _spec.ClearField(entitlementplanhistory.FieldDisplayName, field.TypeString) + } + if value, ok := ephuo.mutation.Description(); ok { + _spec.SetField(entitlementplanhistory.FieldDescription, field.TypeString, value) + } + if ephuo.mutation.DescriptionCleared() { + _spec.ClearField(entitlementplanhistory.FieldDescription, field.TypeString) + } + if value, ok := ephuo.mutation.Metadata(); ok { + _spec.SetField(entitlementplanhistory.FieldMetadata, field.TypeJSON, value) + } + if ephuo.mutation.MetadataCleared() { + _spec.ClearField(entitlementplanhistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = ephuo.schemaConfig.EntitlementPlanHistory + ctx = internal.NewSchemaConfigContext(ctx, ephuo.schemaConfig) + _node = &EntitlementPlanHistory{config: ephuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ephuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitlementplanhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ephuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entity.go b/internal/ent/generated/entity.go new file mode 100644 index 0000000..6f57025 --- /dev/null +++ b/internal/ent/generated/entity.go @@ -0,0 +1,490 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// Entity is the model entity for the Entity schema. +type Entity struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the entity + Name string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + // An optional description of the entity + Description string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // The type of the entity + EntityTypeID string `json:"entity_type_id,omitempty"` + // status of the entity + Status string `json:"status,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the EntityQuery when eager-loading is set. + Edges EntityEdges `json:"edges"` + entity_type_entities *string + selectValues sql.SelectValues +} + +// EntityEdges holds the relations/edges for other nodes in the graph. +type EntityEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Contacts holds the value of the contacts edge. + Contacts []*Contact `json:"contacts,omitempty"` + // Documents holds the value of the documents edge. + Documents []*DocumentData `json:"documents,omitempty"` + // Notes holds the value of the notes edge. + Notes []*Note `json:"notes,omitempty"` + // Files holds the value of the files edge. + Files []*File `json:"files,omitempty"` + // EntityType holds the value of the entity_type edge. + EntityType *EntityType `json:"entity_type,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [6]bool + // totalCount holds the count of the edges above. + totalCount [6]map[string]int + + namedContacts map[string][]*Contact + namedDocuments map[string][]*DocumentData + namedNotes map[string][]*Note + namedFiles map[string][]*File +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntityEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// ContactsOrErr returns the Contacts value or an error if the edge +// was not loaded in eager-loading. +func (e EntityEdges) ContactsOrErr() ([]*Contact, error) { + if e.loadedTypes[1] { + return e.Contacts, nil + } + return nil, &NotLoadedError{edge: "contacts"} +} + +// DocumentsOrErr returns the Documents value or an error if the edge +// was not loaded in eager-loading. +func (e EntityEdges) DocumentsOrErr() ([]*DocumentData, error) { + if e.loadedTypes[2] { + return e.Documents, nil + } + return nil, &NotLoadedError{edge: "documents"} +} + +// NotesOrErr returns the Notes value or an error if the edge +// was not loaded in eager-loading. +func (e EntityEdges) NotesOrErr() ([]*Note, error) { + if e.loadedTypes[3] { + return e.Notes, nil + } + return nil, &NotLoadedError{edge: "notes"} +} + +// FilesOrErr returns the Files value or an error if the edge +// was not loaded in eager-loading. +func (e EntityEdges) FilesOrErr() ([]*File, error) { + if e.loadedTypes[4] { + return e.Files, nil + } + return nil, &NotLoadedError{edge: "files"} +} + +// EntityTypeOrErr returns the EntityType value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntityEdges) EntityTypeOrErr() (*EntityType, error) { + if e.EntityType != nil { + return e.EntityType, nil + } else if e.loadedTypes[5] { + return nil, &NotFoundError{label: entitytype.Label} + } + return nil, &NotLoadedError{edge: "entity_type"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Entity) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entity.FieldTags, entity.FieldDomains: + values[i] = new([]byte) + case entity.FieldID, entity.FieldCreatedBy, entity.FieldUpdatedBy, entity.FieldMappingID, entity.FieldDeletedBy, entity.FieldOwnerID, entity.FieldName, entity.FieldDisplayName, entity.FieldDescription, entity.FieldEntityTypeID, entity.FieldStatus: + values[i] = new(sql.NullString) + case entity.FieldCreatedAt, entity.FieldUpdatedAt, entity.FieldDeletedAt: + values[i] = new(sql.NullTime) + case entity.ForeignKeys[0]: // entity_type_entities + values[i] = new(sql.NullString) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Entity fields. +func (e *Entity) 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 entity.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + e.ID = value.String + } + case entity.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + e.CreatedAt = value.Time + } + case entity.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + e.UpdatedAt = value.Time + } + case entity.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + e.CreatedBy = value.String + } + case entity.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + e.UpdatedBy = value.String + } + case entity.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + e.MappingID = value.String + } + case entity.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + e.DeletedAt = value.Time + } + case entity.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + e.DeletedBy = value.String + } + case entity.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &e.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entity.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + e.OwnerID = value.String + } + case entity.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + e.Name = value.String + } + case entity.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + e.DisplayName = value.String + } + case entity.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + e.Description = value.String + } + case entity.FieldDomains: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field domains", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &e.Domains); err != nil { + return fmt.Errorf("unmarshal field domains: %w", err) + } + } + case entity.FieldEntityTypeID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field entity_type_id", values[i]) + } else if value.Valid { + e.EntityTypeID = value.String + } + case entity.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + e.Status = value.String + } + case entity.ForeignKeys[0]: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field entity_type_entities", values[i]) + } else if value.Valid { + e.entity_type_entities = new(string) + *e.entity_type_entities = value.String + } + default: + e.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Entity. +// This includes values selected through modifiers, order, etc. +func (e *Entity) Value(name string) (ent.Value, error) { + return e.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Entity entity. +func (e *Entity) QueryOwner() *OrganizationQuery { + return NewEntityClient(e.config).QueryOwner(e) +} + +// QueryContacts queries the "contacts" edge of the Entity entity. +func (e *Entity) QueryContacts() *ContactQuery { + return NewEntityClient(e.config).QueryContacts(e) +} + +// QueryDocuments queries the "documents" edge of the Entity entity. +func (e *Entity) QueryDocuments() *DocumentDataQuery { + return NewEntityClient(e.config).QueryDocuments(e) +} + +// QueryNotes queries the "notes" edge of the Entity entity. +func (e *Entity) QueryNotes() *NoteQuery { + return NewEntityClient(e.config).QueryNotes(e) +} + +// QueryFiles queries the "files" edge of the Entity entity. +func (e *Entity) QueryFiles() *FileQuery { + return NewEntityClient(e.config).QueryFiles(e) +} + +// QueryEntityType queries the "entity_type" edge of the Entity entity. +func (e *Entity) QueryEntityType() *EntityTypeQuery { + return NewEntityClient(e.config).QueryEntityType(e) +} + +// Update returns a builder for updating this Entity. +// Note that you need to call Entity.Unwrap() before calling this method if this Entity +// was returned from a transaction, and the transaction was committed or rolled back. +func (e *Entity) Update() *EntityUpdateOne { + return NewEntityClient(e.config).UpdateOne(e) +} + +// Unwrap unwraps the Entity 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 (e *Entity) Unwrap() *Entity { + _tx, ok := e.config.driver.(*txDriver) + if !ok { + panic("generated: Entity is not a transactional entity") + } + e.config.driver = _tx.drv + return e +} + +// String implements the fmt.Stringer. +func (e *Entity) String() string { + var builder strings.Builder + builder.WriteString("Entity(") + builder.WriteString(fmt.Sprintf("id=%v, ", e.ID)) + builder.WriteString("created_at=") + builder.WriteString(e.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(e.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(e.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(e.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(e.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(e.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(e.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", e.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(e.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(e.Name) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(e.DisplayName) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(e.Description) + builder.WriteString(", ") + builder.WriteString("domains=") + builder.WriteString(fmt.Sprintf("%v", e.Domains)) + builder.WriteString(", ") + builder.WriteString("entity_type_id=") + builder.WriteString(e.EntityTypeID) + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(e.Status) + builder.WriteByte(')') + return builder.String() +} + +// NamedContacts returns the Contacts named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Entity) NamedContacts(name string) ([]*Contact, error) { + if e.Edges.namedContacts == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedContacts[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Entity) appendNamedContacts(name string, edges ...*Contact) { + if e.Edges.namedContacts == nil { + e.Edges.namedContacts = make(map[string][]*Contact) + } + if len(edges) == 0 { + e.Edges.namedContacts[name] = []*Contact{} + } else { + e.Edges.namedContacts[name] = append(e.Edges.namedContacts[name], edges...) + } +} + +// NamedDocuments returns the Documents named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Entity) NamedDocuments(name string) ([]*DocumentData, error) { + if e.Edges.namedDocuments == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedDocuments[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Entity) appendNamedDocuments(name string, edges ...*DocumentData) { + if e.Edges.namedDocuments == nil { + e.Edges.namedDocuments = make(map[string][]*DocumentData) + } + if len(edges) == 0 { + e.Edges.namedDocuments[name] = []*DocumentData{} + } else { + e.Edges.namedDocuments[name] = append(e.Edges.namedDocuments[name], edges...) + } +} + +// NamedNotes returns the Notes named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Entity) NamedNotes(name string) ([]*Note, error) { + if e.Edges.namedNotes == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedNotes[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Entity) appendNamedNotes(name string, edges ...*Note) { + if e.Edges.namedNotes == nil { + e.Edges.namedNotes = make(map[string][]*Note) + } + if len(edges) == 0 { + e.Edges.namedNotes[name] = []*Note{} + } else { + e.Edges.namedNotes[name] = append(e.Edges.namedNotes[name], edges...) + } +} + +// NamedFiles returns the Files named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Entity) NamedFiles(name string) ([]*File, error) { + if e.Edges.namedFiles == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedFiles[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Entity) appendNamedFiles(name string, edges ...*File) { + if e.Edges.namedFiles == nil { + e.Edges.namedFiles = make(map[string][]*File) + } + if len(edges) == 0 { + e.Edges.namedFiles[name] = []*File{} + } else { + e.Edges.namedFiles[name] = append(e.Edges.namedFiles[name], edges...) + } +} + +// Entities is a parsable slice of Entity. +type Entities []*Entity diff --git a/internal/ent/generated/entity/entity.go b/internal/ent/generated/entity/entity.go new file mode 100644 index 0000000..2467776 --- /dev/null +++ b/internal/ent/generated/entity/entity.go @@ -0,0 +1,369 @@ +// Code generated by ent, DO NOT EDIT. + +package entity + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the entity type in the database. + Label = "entity" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldDomains holds the string denoting the domains field in the database. + FieldDomains = "domains" + // FieldEntityTypeID holds the string denoting the entity_type_id field in the database. + FieldEntityTypeID = "entity_type_id" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeContacts holds the string denoting the contacts edge name in mutations. + EdgeContacts = "contacts" + // EdgeDocuments holds the string denoting the documents edge name in mutations. + EdgeDocuments = "documents" + // EdgeNotes holds the string denoting the notes edge name in mutations. + EdgeNotes = "notes" + // EdgeFiles holds the string denoting the files edge name in mutations. + EdgeFiles = "files" + // EdgeEntityType holds the string denoting the entity_type edge name in mutations. + EdgeEntityType = "entity_type" + // Table holds the table name of the entity in the database. + Table = "entities" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "entities" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // ContactsTable is the table that holds the contacts relation/edge. The primary key declared below. + ContactsTable = "entity_contacts" + // ContactsInverseTable is the table name for the Contact entity. + // It exists in this package in order to avoid circular dependency with the "contact" package. + ContactsInverseTable = "contacts" + // DocumentsTable is the table that holds the documents relation/edge. The primary key declared below. + DocumentsTable = "entity_documents" + // DocumentsInverseTable is the table name for the DocumentData entity. + // It exists in this package in order to avoid circular dependency with the "documentdata" package. + DocumentsInverseTable = "document_data" + // NotesTable is the table that holds the notes relation/edge. + NotesTable = "notes" + // NotesInverseTable is the table name for the Note entity. + // It exists in this package in order to avoid circular dependency with the "note" package. + NotesInverseTable = "notes" + // NotesColumn is the table column denoting the notes relation/edge. + NotesColumn = "entity_notes" + // FilesTable is the table that holds the files relation/edge. The primary key declared below. + FilesTable = "entity_files" + // FilesInverseTable is the table name for the File entity. + // It exists in this package in order to avoid circular dependency with the "file" package. + FilesInverseTable = "files" + // EntityTypeTable is the table that holds the entity_type relation/edge. + EntityTypeTable = "entities" + // EntityTypeInverseTable is the table name for the EntityType entity. + // It exists in this package in order to avoid circular dependency with the "entitytype" package. + EntityTypeInverseTable = "entity_types" + // EntityTypeColumn is the table column denoting the entity_type relation/edge. + EntityTypeColumn = "entity_type_id" +) + +// Columns holds all SQL columns for entity fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldName, + FieldDisplayName, + FieldDescription, + FieldDomains, + FieldEntityTypeID, + FieldStatus, +} + +// ForeignKeys holds the SQL foreign-keys that are owned by the "entities" +// table and are not defined as standalone fields in the schema. +var ForeignKeys = []string{ + "entity_type_entities", +} + +var ( + // ContactsPrimaryKey and ContactsColumn2 are the table columns denoting the + // primary key for the contacts relation (M2M). + ContactsPrimaryKey = []string{"entity_id", "contact_id"} + // DocumentsPrimaryKey and DocumentsColumn2 are the table columns denoting the + // primary key for the documents relation (M2M). + DocumentsPrimaryKey = []string{"entity_id", "document_data_id"} + // FilesPrimaryKey and FilesColumn2 are the table columns denoting the + // primary key for the files relation (M2M). + FilesPrimaryKey = []string{"entity_id", "file_id"} +) + +// 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 +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + DisplayNameValidator func(string) error + // DomainsValidator is a validator for the "domains" field. It is called by the builders before save. + DomainsValidator func([]string) error + // DefaultStatus holds the default value on creation for the "status" field. + DefaultStatus string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Entity queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByEntityTypeID orders the results by the entity_type_id field. +func ByEntityTypeID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEntityTypeID, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByContactsCount orders the results by contacts count. +func ByContactsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newContactsStep(), opts...) + } +} + +// ByContacts orders the results by contacts terms. +func ByContacts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newContactsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByDocumentsCount orders the results by documents count. +func ByDocumentsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newDocumentsStep(), opts...) + } +} + +// ByDocuments orders the results by documents terms. +func ByDocuments(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newDocumentsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByNotesCount orders the results by notes count. +func ByNotesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newNotesStep(), opts...) + } +} + +// ByNotes orders the results by notes terms. +func ByNotes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newNotesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFilesCount orders the results by files count. +func ByFilesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFilesStep(), opts...) + } +} + +// ByFiles orders the results by files terms. +func ByFiles(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFilesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntityTypeField orders the results by entity_type field. +func ByEntityTypeField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntityTypeStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newContactsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(ContactsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, ContactsTable, ContactsPrimaryKey...), + ) +} +func newDocumentsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(DocumentsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, DocumentsTable, DocumentsPrimaryKey...), + ) +} +func newNotesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(NotesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, NotesTable, NotesColumn), + ) +} +func newFilesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FilesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, FilesTable, FilesPrimaryKey...), + ) +} +func newEntityTypeStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntityTypeInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, EntityTypeTable, EntityTypeColumn), + ) +} diff --git a/internal/ent/generated/entity/where.go b/internal/ent/generated/entity/where.go new file mode 100644 index 0000000..dd82167 --- /dev/null +++ b/internal/ent/generated/entity/where.go @@ -0,0 +1,1232 @@ +// Code generated by ent, DO NOT EDIT. + +package entity + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDisplayName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDescription, v)) +} + +// EntityTypeID applies equality check predicate on the "entity_type_id" field. It's identical to EntityTypeIDEQ. +func EntityTypeID(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldEntityTypeID, v)) +} + +// Status applies equality check predicate on the "status" field. It's identical to StatusEQ. +func Status(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldStatus, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldName, v)) +} + +// NameIsNil applies the IsNil predicate on the "name" field. +func NameIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldName)) +} + +// NameNotNil applies the NotNil predicate on the "name" field. +func NameNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldName)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameIsNil applies the IsNil predicate on the "display_name" field. +func DisplayNameIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldDisplayName)) +} + +// DisplayNameNotNil applies the NotNil predicate on the "display_name" field. +func DisplayNameNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldDisplayName)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldDescription, v)) +} + +// DomainsIsNil applies the IsNil predicate on the "domains" field. +func DomainsIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldDomains)) +} + +// DomainsNotNil applies the NotNil predicate on the "domains" field. +func DomainsNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldDomains)) +} + +// EntityTypeIDEQ applies the EQ predicate on the "entity_type_id" field. +func EntityTypeIDEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldEntityTypeID, v)) +} + +// EntityTypeIDNEQ applies the NEQ predicate on the "entity_type_id" field. +func EntityTypeIDNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldEntityTypeID, v)) +} + +// EntityTypeIDIn applies the In predicate on the "entity_type_id" field. +func EntityTypeIDIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldEntityTypeID, vs...)) +} + +// EntityTypeIDNotIn applies the NotIn predicate on the "entity_type_id" field. +func EntityTypeIDNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldEntityTypeID, vs...)) +} + +// EntityTypeIDGT applies the GT predicate on the "entity_type_id" field. +func EntityTypeIDGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldEntityTypeID, v)) +} + +// EntityTypeIDGTE applies the GTE predicate on the "entity_type_id" field. +func EntityTypeIDGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldEntityTypeID, v)) +} + +// EntityTypeIDLT applies the LT predicate on the "entity_type_id" field. +func EntityTypeIDLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldEntityTypeID, v)) +} + +// EntityTypeIDLTE applies the LTE predicate on the "entity_type_id" field. +func EntityTypeIDLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldEntityTypeID, v)) +} + +// EntityTypeIDContains applies the Contains predicate on the "entity_type_id" field. +func EntityTypeIDContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldEntityTypeID, v)) +} + +// EntityTypeIDHasPrefix applies the HasPrefix predicate on the "entity_type_id" field. +func EntityTypeIDHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldEntityTypeID, v)) +} + +// EntityTypeIDHasSuffix applies the HasSuffix predicate on the "entity_type_id" field. +func EntityTypeIDHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldEntityTypeID, v)) +} + +// EntityTypeIDIsNil applies the IsNil predicate on the "entity_type_id" field. +func EntityTypeIDIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldEntityTypeID)) +} + +// EntityTypeIDNotNil applies the NotNil predicate on the "entity_type_id" field. +func EntityTypeIDNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldEntityTypeID)) +} + +// EntityTypeIDEqualFold applies the EqualFold predicate on the "entity_type_id" field. +func EntityTypeIDEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldEntityTypeID, v)) +} + +// EntityTypeIDContainsFold applies the ContainsFold predicate on the "entity_type_id" field. +func EntityTypeIDContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldEntityTypeID, v)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldEQ(FieldStatus, v)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v string) predicate.Entity { + return predicate.Entity(sql.FieldNEQ(FieldStatus, v)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldIn(FieldStatus, vs...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...string) predicate.Entity { + return predicate.Entity(sql.FieldNotIn(FieldStatus, vs...)) +} + +// StatusGT applies the GT predicate on the "status" field. +func StatusGT(v string) predicate.Entity { + return predicate.Entity(sql.FieldGT(FieldStatus, v)) +} + +// StatusGTE applies the GTE predicate on the "status" field. +func StatusGTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldGTE(FieldStatus, v)) +} + +// StatusLT applies the LT predicate on the "status" field. +func StatusLT(v string) predicate.Entity { + return predicate.Entity(sql.FieldLT(FieldStatus, v)) +} + +// StatusLTE applies the LTE predicate on the "status" field. +func StatusLTE(v string) predicate.Entity { + return predicate.Entity(sql.FieldLTE(FieldStatus, v)) +} + +// StatusContains applies the Contains predicate on the "status" field. +func StatusContains(v string) predicate.Entity { + return predicate.Entity(sql.FieldContains(FieldStatus, v)) +} + +// StatusHasPrefix applies the HasPrefix predicate on the "status" field. +func StatusHasPrefix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasPrefix(FieldStatus, v)) +} + +// StatusHasSuffix applies the HasSuffix predicate on the "status" field. +func StatusHasSuffix(v string) predicate.Entity { + return predicate.Entity(sql.FieldHasSuffix(FieldStatus, v)) +} + +// StatusIsNil applies the IsNil predicate on the "status" field. +func StatusIsNil() predicate.Entity { + return predicate.Entity(sql.FieldIsNull(FieldStatus)) +} + +// StatusNotNil applies the NotNil predicate on the "status" field. +func StatusNotNil() predicate.Entity { + return predicate.Entity(sql.FieldNotNull(FieldStatus)) +} + +// StatusEqualFold applies the EqualFold predicate on the "status" field. +func StatusEqualFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldEqualFold(FieldStatus, v)) +} + +// StatusContainsFold applies the ContainsFold predicate on the "status" field. +func StatusContainsFold(v string) predicate.Entity { + return predicate.Entity(sql.FieldContainsFold(FieldStatus, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entity + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entity + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasContacts applies the HasEdge predicate on the "contacts" edge. +func HasContacts() predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, ContactsTable, ContactsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.EntityContacts + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasContactsWith applies the HasEdge predicate on the "contacts" edge with a given conditions (other predicates). +func HasContactsWith(preds ...predicate.Contact) predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := newContactsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.EntityContacts + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasDocuments applies the HasEdge predicate on the "documents" edge. +func HasDocuments() predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, DocumentsTable, DocumentsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.EntityDocuments + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasDocumentsWith applies the HasEdge predicate on the "documents" edge with a given conditions (other predicates). +func HasDocumentsWith(preds ...predicate.DocumentData) predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := newDocumentsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.EntityDocuments + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasNotes applies the HasEdge predicate on the "notes" edge. +func HasNotes() predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, NotesTable, NotesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasNotesWith applies the HasEdge predicate on the "notes" edge with a given conditions (other predicates). +func HasNotesWith(preds ...predicate.Note) predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := newNotesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFiles applies the HasEdge predicate on the "files" edge. +func HasFiles() predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, FilesTable, FilesPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.EntityFiles + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). +func HasFilesWith(preds ...predicate.File) predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := newFilesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.EntityFiles + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntityType applies the HasEdge predicate on the "entity_type" edge. +func HasEntityType() predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, EntityTypeTable, EntityTypeColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.Entity + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntityTypeWith applies the HasEdge predicate on the "entity_type" edge with a given conditions (other predicates). +func HasEntityTypeWith(preds ...predicate.EntityType) predicate.Entity { + return predicate.Entity(func(s *sql.Selector) { + step := newEntityTypeStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.Entity + 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.Entity) predicate.Entity { + return predicate.Entity(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Entity) predicate.Entity { + return predicate.Entity(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Entity) predicate.Entity { + return predicate.Entity(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entity_create.go b/internal/ent/generated/entity_create.go new file mode 100644 index 0000000..f19afdc --- /dev/null +++ b/internal/ent/generated/entity_create.go @@ -0,0 +1,685 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntityCreate is the builder for creating a Entity entity. +type EntityCreate struct { + config + mutation *EntityMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (ec *EntityCreate) SetCreatedAt(t time.Time) *EntityCreate { + ec.mutation.SetCreatedAt(t) + return ec +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ec *EntityCreate) SetNillableCreatedAt(t *time.Time) *EntityCreate { + if t != nil { + ec.SetCreatedAt(*t) + } + return ec +} + +// SetUpdatedAt sets the "updated_at" field. +func (ec *EntityCreate) SetUpdatedAt(t time.Time) *EntityCreate { + ec.mutation.SetUpdatedAt(t) + return ec +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ec *EntityCreate) SetNillableUpdatedAt(t *time.Time) *EntityCreate { + if t != nil { + ec.SetUpdatedAt(*t) + } + return ec +} + +// SetCreatedBy sets the "created_by" field. +func (ec *EntityCreate) SetCreatedBy(s string) *EntityCreate { + ec.mutation.SetCreatedBy(s) + return ec +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ec *EntityCreate) SetNillableCreatedBy(s *string) *EntityCreate { + if s != nil { + ec.SetCreatedBy(*s) + } + return ec +} + +// SetUpdatedBy sets the "updated_by" field. +func (ec *EntityCreate) SetUpdatedBy(s string) *EntityCreate { + ec.mutation.SetUpdatedBy(s) + return ec +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ec *EntityCreate) SetNillableUpdatedBy(s *string) *EntityCreate { + if s != nil { + ec.SetUpdatedBy(*s) + } + return ec +} + +// SetMappingID sets the "mapping_id" field. +func (ec *EntityCreate) SetMappingID(s string) *EntityCreate { + ec.mutation.SetMappingID(s) + return ec +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ec *EntityCreate) SetNillableMappingID(s *string) *EntityCreate { + if s != nil { + ec.SetMappingID(*s) + } + return ec +} + +// SetDeletedAt sets the "deleted_at" field. +func (ec *EntityCreate) SetDeletedAt(t time.Time) *EntityCreate { + ec.mutation.SetDeletedAt(t) + return ec +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ec *EntityCreate) SetNillableDeletedAt(t *time.Time) *EntityCreate { + if t != nil { + ec.SetDeletedAt(*t) + } + return ec +} + +// SetDeletedBy sets the "deleted_by" field. +func (ec *EntityCreate) SetDeletedBy(s string) *EntityCreate { + ec.mutation.SetDeletedBy(s) + return ec +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ec *EntityCreate) SetNillableDeletedBy(s *string) *EntityCreate { + if s != nil { + ec.SetDeletedBy(*s) + } + return ec +} + +// SetTags sets the "tags" field. +func (ec *EntityCreate) SetTags(s []string) *EntityCreate { + ec.mutation.SetTags(s) + return ec +} + +// SetOwnerID sets the "owner_id" field. +func (ec *EntityCreate) SetOwnerID(s string) *EntityCreate { + ec.mutation.SetOwnerID(s) + return ec +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ec *EntityCreate) SetNillableOwnerID(s *string) *EntityCreate { + if s != nil { + ec.SetOwnerID(*s) + } + return ec +} + +// SetName sets the "name" field. +func (ec *EntityCreate) SetName(s string) *EntityCreate { + ec.mutation.SetName(s) + return ec +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ec *EntityCreate) SetNillableName(s *string) *EntityCreate { + if s != nil { + ec.SetName(*s) + } + return ec +} + +// SetDisplayName sets the "display_name" field. +func (ec *EntityCreate) SetDisplayName(s string) *EntityCreate { + ec.mutation.SetDisplayName(s) + return ec +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ec *EntityCreate) SetNillableDisplayName(s *string) *EntityCreate { + if s != nil { + ec.SetDisplayName(*s) + } + return ec +} + +// SetDescription sets the "description" field. +func (ec *EntityCreate) SetDescription(s string) *EntityCreate { + ec.mutation.SetDescription(s) + return ec +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ec *EntityCreate) SetNillableDescription(s *string) *EntityCreate { + if s != nil { + ec.SetDescription(*s) + } + return ec +} + +// SetDomains sets the "domains" field. +func (ec *EntityCreate) SetDomains(s []string) *EntityCreate { + ec.mutation.SetDomains(s) + return ec +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (ec *EntityCreate) SetEntityTypeID(s string) *EntityCreate { + ec.mutation.SetEntityTypeID(s) + return ec +} + +// SetNillableEntityTypeID sets the "entity_type_id" field if the given value is not nil. +func (ec *EntityCreate) SetNillableEntityTypeID(s *string) *EntityCreate { + if s != nil { + ec.SetEntityTypeID(*s) + } + return ec +} + +// SetStatus sets the "status" field. +func (ec *EntityCreate) SetStatus(s string) *EntityCreate { + ec.mutation.SetStatus(s) + return ec +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ec *EntityCreate) SetNillableStatus(s *string) *EntityCreate { + if s != nil { + ec.SetStatus(*s) + } + return ec +} + +// SetID sets the "id" field. +func (ec *EntityCreate) SetID(s string) *EntityCreate { + ec.mutation.SetID(s) + return ec +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ec *EntityCreate) SetNillableID(s *string) *EntityCreate { + if s != nil { + ec.SetID(*s) + } + return ec +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (ec *EntityCreate) SetOwner(o *Organization) *EntityCreate { + return ec.SetOwnerID(o.ID) +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by IDs. +func (ec *EntityCreate) AddContactIDs(ids ...string) *EntityCreate { + ec.mutation.AddContactIDs(ids...) + return ec +} + +// AddContacts adds the "contacts" edges to the Contact entity. +func (ec *EntityCreate) AddContacts(c ...*Contact) *EntityCreate { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return ec.AddContactIDs(ids...) +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by IDs. +func (ec *EntityCreate) AddDocumentIDs(ids ...string) *EntityCreate { + ec.mutation.AddDocumentIDs(ids...) + return ec +} + +// AddDocuments adds the "documents" edges to the DocumentData entity. +func (ec *EntityCreate) AddDocuments(d ...*DocumentData) *EntityCreate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return ec.AddDocumentIDs(ids...) +} + +// AddNoteIDs adds the "notes" edge to the Note entity by IDs. +func (ec *EntityCreate) AddNoteIDs(ids ...string) *EntityCreate { + ec.mutation.AddNoteIDs(ids...) + return ec +} + +// AddNotes adds the "notes" edges to the Note entity. +func (ec *EntityCreate) AddNotes(n ...*Note) *EntityCreate { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return ec.AddNoteIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (ec *EntityCreate) AddFileIDs(ids ...string) *EntityCreate { + ec.mutation.AddFileIDs(ids...) + return ec +} + +// AddFiles adds the "files" edges to the File entity. +func (ec *EntityCreate) AddFiles(f ...*File) *EntityCreate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ec.AddFileIDs(ids...) +} + +// SetEntityType sets the "entity_type" edge to the EntityType entity. +func (ec *EntityCreate) SetEntityType(e *EntityType) *EntityCreate { + return ec.SetEntityTypeID(e.ID) +} + +// Mutation returns the EntityMutation object of the builder. +func (ec *EntityCreate) Mutation() *EntityMutation { + return ec.mutation +} + +// Save creates the Entity in the database. +func (ec *EntityCreate) Save(ctx context.Context) (*Entity, error) { + if err := ec.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ec.sqlSave, ec.mutation, ec.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ec *EntityCreate) SaveX(ctx context.Context) *Entity { + v, err := ec.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ec *EntityCreate) Exec(ctx context.Context) error { + _, err := ec.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ec *EntityCreate) ExecX(ctx context.Context) { + if err := ec.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ec *EntityCreate) defaults() error { + if _, ok := ec.mutation.CreatedAt(); !ok { + if entity.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entity.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entity.DefaultCreatedAt() + ec.mutation.SetCreatedAt(v) + } + if _, ok := ec.mutation.UpdatedAt(); !ok { + if entity.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entity.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entity.DefaultUpdatedAt() + ec.mutation.SetUpdatedAt(v) + } + if _, ok := ec.mutation.MappingID(); !ok { + if entity.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entity.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entity.DefaultMappingID() + ec.mutation.SetMappingID(v) + } + if _, ok := ec.mutation.Tags(); !ok { + v := entity.DefaultTags + ec.mutation.SetTags(v) + } + if _, ok := ec.mutation.Status(); !ok { + v := entity.DefaultStatus + ec.mutation.SetStatus(v) + } + if _, ok := ec.mutation.ID(); !ok { + if entity.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entity.DefaultID (forgotten import generated/runtime?)") + } + v := entity.DefaultID() + ec.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ec *EntityCreate) check() error { + if _, ok := ec.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Entity.mapping_id"`)} + } + if v, ok := ec.mutation.OwnerID(); ok { + if err := entity.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Entity.owner_id": %w`, err)} + } + } + if v, ok := ec.mutation.Name(); ok { + if err := entity.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Entity.name": %w`, err)} + } + } + if v, ok := ec.mutation.DisplayName(); ok { + if err := entity.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Entity.display_name": %w`, err)} + } + } + if v, ok := ec.mutation.Domains(); ok { + if err := entity.DomainsValidator(v); err != nil { + return &ValidationError{Name: "domains", err: fmt.Errorf(`generated: validator failed for field "Entity.domains": %w`, err)} + } + } + return nil +} + +func (ec *EntityCreate) sqlSave(ctx context.Context) (*Entity, error) { + if err := ec.check(); err != nil { + return nil, err + } + _node, _spec := ec.createSpec() + if err := sqlgraph.CreateNode(ctx, ec.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Entity.ID type: %T", _spec.ID.Value) + } + } + ec.mutation.id = &_node.ID + ec.mutation.done = true + return _node, nil +} + +func (ec *EntityCreate) createSpec() (*Entity, *sqlgraph.CreateSpec) { + var ( + _node = &Entity{config: ec.config} + _spec = sqlgraph.NewCreateSpec(entity.Table, sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString)) + ) + _spec.Schema = ec.schemaConfig.Entity + if id, ok := ec.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ec.mutation.CreatedAt(); ok { + _spec.SetField(entity.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ec.mutation.UpdatedAt(); ok { + _spec.SetField(entity.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ec.mutation.CreatedBy(); ok { + _spec.SetField(entity.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ec.mutation.UpdatedBy(); ok { + _spec.SetField(entity.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ec.mutation.MappingID(); ok { + _spec.SetField(entity.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ec.mutation.DeletedAt(); ok { + _spec.SetField(entity.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ec.mutation.DeletedBy(); ok { + _spec.SetField(entity.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ec.mutation.Tags(); ok { + _spec.SetField(entity.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ec.mutation.Name(); ok { + _spec.SetField(entity.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ec.mutation.DisplayName(); ok { + _spec.SetField(entity.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := ec.mutation.Description(); ok { + _spec.SetField(entity.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := ec.mutation.Domains(); ok { + _spec.SetField(entity.FieldDomains, field.TypeJSON, value) + _node.Domains = value + } + if value, ok := ec.mutation.Status(); ok { + _spec.SetField(entity.FieldStatus, field.TypeString, value) + _node.Status = value + } + if nodes := ec.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entity.OwnerTable, + Columns: []string{entity.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.ContactsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.DocumentsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.NotesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.EntityTypeIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entity.EntityTypeTable, + Columns: []string{entity.EntityTypeColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.EntityTypeID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// EntityCreateBulk is the builder for creating many Entity entities in bulk. +type EntityCreateBulk struct { + config + err error + builders []*EntityCreate +} + +// Save creates the Entity entities in the database. +func (ecb *EntityCreateBulk) Save(ctx context.Context) ([]*Entity, error) { + if ecb.err != nil { + return nil, ecb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ecb.builders)) + nodes := make([]*Entity, len(ecb.builders)) + mutators := make([]Mutator, len(ecb.builders)) + for i := range ecb.builders { + func(i int, root context.Context) { + builder := ecb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntityMutation) + 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, ecb.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, ecb.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, ecb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ecb *EntityCreateBulk) SaveX(ctx context.Context) []*Entity { + v, err := ecb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ecb *EntityCreateBulk) Exec(ctx context.Context) error { + _, err := ecb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ecb *EntityCreateBulk) ExecX(ctx context.Context) { + if err := ecb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entity_delete.go b/internal/ent/generated/entity_delete.go new file mode 100644 index 0000000..f457cae --- /dev/null +++ b/internal/ent/generated/entity_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityDelete is the builder for deleting a Entity entity. +type EntityDelete struct { + config + hooks []Hook + mutation *EntityMutation +} + +// Where appends a list predicates to the EntityDelete builder. +func (ed *EntityDelete) Where(ps ...predicate.Entity) *EntityDelete { + ed.mutation.Where(ps...) + return ed +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ed *EntityDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ed.sqlExec, ed.mutation, ed.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ed *EntityDelete) ExecX(ctx context.Context) int { + n, err := ed.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ed *EntityDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entity.Table, sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString)) + _spec.Node.Schema = ed.schemaConfig.Entity + ctx = internal.NewSchemaConfigContext(ctx, ed.schemaConfig) + if ps := ed.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ed.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ed.mutation.done = true + return affected, err +} + +// EntityDeleteOne is the builder for deleting a single Entity entity. +type EntityDeleteOne struct { + ed *EntityDelete +} + +// Where appends a list predicates to the EntityDelete builder. +func (edo *EntityDeleteOne) Where(ps ...predicate.Entity) *EntityDeleteOne { + edo.ed.mutation.Where(ps...) + return edo +} + +// Exec executes the deletion query. +func (edo *EntityDeleteOne) Exec(ctx context.Context) error { + n, err := edo.ed.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entity.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (edo *EntityDeleteOne) ExecX(ctx context.Context) { + if err := edo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entity_query.go b/internal/ent/generated/entity_query.go new file mode 100644 index 0000000..07c3628 --- /dev/null +++ b/internal/ent/generated/entity_query.go @@ -0,0 +1,1215 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityQuery is the builder for querying Entity entities. +type EntityQuery struct { + config + ctx *QueryContext + order []entity.OrderOption + inters []Interceptor + predicates []predicate.Entity + withOwner *OrganizationQuery + withContacts *ContactQuery + withDocuments *DocumentDataQuery + withNotes *NoteQuery + withFiles *FileQuery + withEntityType *EntityTypeQuery + withFKs bool + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Entity) error + withNamedContacts map[string]*ContactQuery + withNamedDocuments map[string]*DocumentDataQuery + withNamedNotes map[string]*NoteQuery + withNamedFiles map[string]*FileQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntityQuery builder. +func (eq *EntityQuery) Where(ps ...predicate.Entity) *EntityQuery { + eq.predicates = append(eq.predicates, ps...) + return eq +} + +// Limit the number of records to be returned by this query. +func (eq *EntityQuery) Limit(limit int) *EntityQuery { + eq.ctx.Limit = &limit + return eq +} + +// Offset to start from. +func (eq *EntityQuery) Offset(offset int) *EntityQuery { + eq.ctx.Offset = &offset + return eq +} + +// 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 (eq *EntityQuery) Unique(unique bool) *EntityQuery { + eq.ctx.Unique = &unique + return eq +} + +// Order specifies how the records should be ordered. +func (eq *EntityQuery) Order(o ...entity.OrderOption) *EntityQuery { + eq.order = append(eq.order, o...) + return eq +} + +// QueryOwner chains the current query on the "owner" edge. +func (eq *EntityQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entity.OwnerTable, entity.OwnerColumn), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Entity + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryContacts chains the current query on the "contacts" edge. +func (eq *EntityQuery) QueryContacts() *ContactQuery { + query := (&ContactClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, selector), + sqlgraph.To(contact.Table, contact.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entity.ContactsTable, entity.ContactsPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.EntityContacts + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryDocuments chains the current query on the "documents" edge. +func (eq *EntityQuery) QueryDocuments() *DocumentDataQuery { + query := (&DocumentDataClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, selector), + sqlgraph.To(documentdata.Table, documentdata.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entity.DocumentsTable, entity.DocumentsPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.EntityDocuments + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryNotes chains the current query on the "notes" edge. +func (eq *EntityQuery) QueryNotes() *NoteQuery { + query := (&NoteClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, selector), + sqlgraph.To(note.Table, note.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, entity.NotesTable, entity.NotesColumn), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFiles chains the current query on the "files" edge. +func (eq *EntityQuery) QueryFiles() *FileQuery { + query := (&FileClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, selector), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, entity.FilesTable, entity.FilesPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.EntityFiles + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntityType chains the current query on the "entity_type" edge. +func (eq *EntityQuery) QueryEntityType() *EntityTypeQuery { + query := (&EntityTypeClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entity.Table, entity.FieldID, selector), + sqlgraph.To(entitytype.Table, entitytype.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, entity.EntityTypeTable, entity.EntityTypeColumn), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.Entity + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Entity entity from the query. +// Returns a *NotFoundError when no Entity was found. +func (eq *EntityQuery) First(ctx context.Context) (*Entity, error) { + nodes, err := eq.Limit(1).All(setContextOp(ctx, eq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entity.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (eq *EntityQuery) FirstX(ctx context.Context) *Entity { + node, err := eq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Entity ID from the query. +// Returns a *NotFoundError when no Entity ID was found. +func (eq *EntityQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = eq.Limit(1).IDs(setContextOp(ctx, eq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entity.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (eq *EntityQuery) FirstIDX(ctx context.Context) string { + id, err := eq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Entity entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Entity entity is found. +// Returns a *NotFoundError when no Entity entities are found. +func (eq *EntityQuery) Only(ctx context.Context) (*Entity, error) { + nodes, err := eq.Limit(2).All(setContextOp(ctx, eq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entity.Label} + default: + return nil, &NotSingularError{entity.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (eq *EntityQuery) OnlyX(ctx context.Context) *Entity { + node, err := eq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Entity ID in the query. +// Returns a *NotSingularError when more than one Entity ID is found. +// Returns a *NotFoundError when no entities are found. +func (eq *EntityQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = eq.Limit(2).IDs(setContextOp(ctx, eq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entity.Label} + default: + err = &NotSingularError{entity.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (eq *EntityQuery) OnlyIDX(ctx context.Context) string { + id, err := eq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Entities. +func (eq *EntityQuery) All(ctx context.Context) ([]*Entity, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryAll) + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Entity, *EntityQuery]() + return withInterceptors[[]*Entity](ctx, eq, qr, eq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (eq *EntityQuery) AllX(ctx context.Context) []*Entity { + nodes, err := eq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Entity IDs. +func (eq *EntityQuery) IDs(ctx context.Context) (ids []string, err error) { + if eq.ctx.Unique == nil && eq.path != nil { + eq.Unique(true) + } + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryIDs) + if err = eq.Select(entity.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (eq *EntityQuery) IDsX(ctx context.Context) []string { + ids, err := eq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (eq *EntityQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryCount) + if err := eq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, eq, querierCount[*EntityQuery](), eq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (eq *EntityQuery) CountX(ctx context.Context) int { + count, err := eq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (eq *EntityQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryExist) + switch _, err := eq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (eq *EntityQuery) ExistX(ctx context.Context) bool { + exist, err := eq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntityQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (eq *EntityQuery) Clone() *EntityQuery { + if eq == nil { + return nil + } + return &EntityQuery{ + config: eq.config, + ctx: eq.ctx.Clone(), + order: append([]entity.OrderOption{}, eq.order...), + inters: append([]Interceptor{}, eq.inters...), + predicates: append([]predicate.Entity{}, eq.predicates...), + withOwner: eq.withOwner.Clone(), + withContacts: eq.withContacts.Clone(), + withDocuments: eq.withDocuments.Clone(), + withNotes: eq.withNotes.Clone(), + withFiles: eq.withFiles.Clone(), + withEntityType: eq.withEntityType.Clone(), + // clone intermediate query. + sql: eq.sql.Clone(), + path: eq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithOwner(opts ...func(*OrganizationQuery)) *EntityQuery { + query := (&OrganizationClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withOwner = query + return eq +} + +// WithContacts tells the query-builder to eager-load the nodes that are connected to +// the "contacts" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithContacts(opts ...func(*ContactQuery)) *EntityQuery { + query := (&ContactClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withContacts = query + return eq +} + +// WithDocuments tells the query-builder to eager-load the nodes that are connected to +// the "documents" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithDocuments(opts ...func(*DocumentDataQuery)) *EntityQuery { + query := (&DocumentDataClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withDocuments = query + return eq +} + +// WithNotes tells the query-builder to eager-load the nodes that are connected to +// the "notes" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithNotes(opts ...func(*NoteQuery)) *EntityQuery { + query := (&NoteClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withNotes = query + return eq +} + +// WithFiles tells the query-builder to eager-load the nodes that are connected to +// the "files" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithFiles(opts ...func(*FileQuery)) *EntityQuery { + query := (&FileClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withFiles = query + return eq +} + +// WithEntityType tells the query-builder to eager-load the nodes that are connected to +// the "entity_type" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithEntityType(opts ...func(*EntityTypeQuery)) *EntityQuery { + query := (&EntityTypeClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withEntityType = query + return eq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Entity.Query(). +// GroupBy(entity.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (eq *EntityQuery) GroupBy(field string, fields ...string) *EntityGroupBy { + eq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntityGroupBy{build: eq} + grbuild.flds = &eq.ctx.Fields + grbuild.label = entity.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Entity.Query(). +// Select(entity.FieldCreatedAt). +// Scan(ctx, &v) +func (eq *EntityQuery) Select(fields ...string) *EntitySelect { + eq.ctx.Fields = append(eq.ctx.Fields, fields...) + sbuild := &EntitySelect{EntityQuery: eq} + sbuild.label = entity.Label + sbuild.flds, sbuild.scan = &eq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntitySelect configured with the given aggregations. +func (eq *EntityQuery) Aggregate(fns ...AggregateFunc) *EntitySelect { + return eq.Select().Aggregate(fns...) +} + +func (eq *EntityQuery) prepareQuery(ctx context.Context) error { + for _, inter := range eq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, eq); err != nil { + return err + } + } + } + for _, f := range eq.ctx.Fields { + if !entity.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if eq.path != nil { + prev, err := eq.path(ctx) + if err != nil { + return err + } + eq.sql = prev + } + if entity.Policy == nil { + return errors.New("generated: uninitialized entity.Policy (forgotten import generated/runtime?)") + } + if err := entity.Policy.EvalQuery(ctx, eq); err != nil { + return err + } + return nil +} + +func (eq *EntityQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Entity, error) { + var ( + nodes = []*Entity{} + withFKs = eq.withFKs + _spec = eq.querySpec() + loadedTypes = [6]bool{ + eq.withOwner != nil, + eq.withContacts != nil, + eq.withDocuments != nil, + eq.withNotes != nil, + eq.withFiles != nil, + eq.withEntityType != nil, + } + ) + if withFKs { + _spec.Node.Columns = append(_spec.Node.Columns, entity.ForeignKeys...) + } + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Entity).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Entity{config: eq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = eq.schemaConfig.Entity + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + if len(eq.modifiers) > 0 { + _spec.Modifiers = eq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, eq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := eq.withOwner; query != nil { + if err := eq.loadOwner(ctx, query, nodes, nil, + func(n *Entity, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := eq.withContacts; query != nil { + if err := eq.loadContacts(ctx, query, nodes, + func(n *Entity) { n.Edges.Contacts = []*Contact{} }, + func(n *Entity, e *Contact) { n.Edges.Contacts = append(n.Edges.Contacts, e) }); err != nil { + return nil, err + } + } + if query := eq.withDocuments; query != nil { + if err := eq.loadDocuments(ctx, query, nodes, + func(n *Entity) { n.Edges.Documents = []*DocumentData{} }, + func(n *Entity, e *DocumentData) { n.Edges.Documents = append(n.Edges.Documents, e) }); err != nil { + return nil, err + } + } + if query := eq.withNotes; query != nil { + if err := eq.loadNotes(ctx, query, nodes, + func(n *Entity) { n.Edges.Notes = []*Note{} }, + func(n *Entity, e *Note) { n.Edges.Notes = append(n.Edges.Notes, e) }); err != nil { + return nil, err + } + } + if query := eq.withFiles; query != nil { + if err := eq.loadFiles(ctx, query, nodes, + func(n *Entity) { n.Edges.Files = []*File{} }, + func(n *Entity, e *File) { n.Edges.Files = append(n.Edges.Files, e) }); err != nil { + return nil, err + } + } + if query := eq.withEntityType; query != nil { + if err := eq.loadEntityType(ctx, query, nodes, nil, + func(n *Entity, e *EntityType) { n.Edges.EntityType = e }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedContacts { + if err := eq.loadContacts(ctx, query, nodes, + func(n *Entity) { n.appendNamedContacts(name) }, + func(n *Entity, e *Contact) { n.appendNamedContacts(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedDocuments { + if err := eq.loadDocuments(ctx, query, nodes, + func(n *Entity) { n.appendNamedDocuments(name) }, + func(n *Entity, e *DocumentData) { n.appendNamedDocuments(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedNotes { + if err := eq.loadNotes(ctx, query, nodes, + func(n *Entity) { n.appendNamedNotes(name) }, + func(n *Entity, e *Note) { n.appendNamedNotes(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedFiles { + if err := eq.loadFiles(ctx, query, nodes, + func(n *Entity) { n.appendNamedFiles(name) }, + func(n *Entity, e *File) { n.appendNamedFiles(name, e) }); err != nil { + return nil, err + } + } + for i := range eq.loadTotal { + if err := eq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (eq *EntityQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Entity, init func(*Entity), assign func(*Entity, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Entity) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (eq *EntityQuery) loadContacts(ctx context.Context, query *ContactQuery, nodes []*Entity, init func(*Entity), assign func(*Entity, *Contact)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Entity) + nids := make(map[string]map[*Entity]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(entity.ContactsTable) + joinT.Schema(eq.schemaConfig.EntityContacts) + s.Join(joinT).On(s.C(contact.FieldID), joinT.C(entity.ContactsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(entity.ContactsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(entity.ContactsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Entity]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Contact](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "contacts" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EntityQuery) loadDocuments(ctx context.Context, query *DocumentDataQuery, nodes []*Entity, init func(*Entity), assign func(*Entity, *DocumentData)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Entity) + nids := make(map[string]map[*Entity]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(entity.DocumentsTable) + joinT.Schema(eq.schemaConfig.EntityDocuments) + s.Join(joinT).On(s.C(documentdata.FieldID), joinT.C(entity.DocumentsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(entity.DocumentsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(entity.DocumentsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Entity]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*DocumentData](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "documents" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EntityQuery) loadNotes(ctx context.Context, query *NoteQuery, nodes []*Entity, init func(*Entity), assign func(*Entity, *Note)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Entity) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + query.withFKs = true + query.Where(predicate.Note(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(entity.NotesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.entity_notes + if fk == nil { + return fmt.Errorf(`foreign-key "entity_notes" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "entity_notes" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} +func (eq *EntityQuery) loadFiles(ctx context.Context, query *FileQuery, nodes []*Entity, init func(*Entity), assign func(*Entity, *File)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Entity) + nids := make(map[string]map[*Entity]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(entity.FilesTable) + joinT.Schema(eq.schemaConfig.EntityFiles) + s.Join(joinT).On(s.C(file.FieldID), joinT.C(entity.FilesPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(entity.FilesPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(entity.FilesPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Entity]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*File](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "files" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EntityQuery) loadEntityType(ctx context.Context, query *EntityTypeQuery, nodes []*Entity, init func(*Entity), assign func(*Entity, *EntityType)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Entity) + for i := range nodes { + fk := nodes[i].EntityTypeID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(entitytype.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 "entity_type_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (eq *EntityQuery) sqlCount(ctx context.Context) (int, error) { + _spec := eq.querySpec() + _spec.Node.Schema = eq.schemaConfig.Entity + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + if len(eq.modifiers) > 0 { + _spec.Modifiers = eq.modifiers + } + _spec.Node.Columns = eq.ctx.Fields + if len(eq.ctx.Fields) > 0 { + _spec.Unique = eq.ctx.Unique != nil && *eq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, eq.driver, _spec) +} + +func (eq *EntityQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entity.Table, entity.Columns, sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString)) + _spec.From = eq.sql + if unique := eq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if eq.path != nil { + _spec.Unique = true + } + if fields := eq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entity.FieldID) + for i := range fields { + if fields[i] != entity.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if eq.withOwner != nil { + _spec.Node.AddColumnOnce(entity.FieldOwnerID) + } + if eq.withEntityType != nil { + _spec.Node.AddColumnOnce(entity.FieldEntityTypeID) + } + } + if ps := eq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := eq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := eq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := eq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (eq *EntityQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(eq.driver.Dialect()) + t1 := builder.Table(entity.Table) + columns := eq.ctx.Fields + if len(columns) == 0 { + columns = entity.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if eq.sql != nil { + selector = eq.sql + selector.Select(selector.Columns(columns...)...) + } + if eq.ctx.Unique != nil && *eq.ctx.Unique { + selector.Distinct() + } + t1.Schema(eq.schemaConfig.Entity) + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + selector.WithContext(ctx) + for _, p := range eq.predicates { + p(selector) + } + for _, p := range eq.order { + p(selector) + } + if offset := eq.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 := eq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedContacts tells the query-builder to eager-load the nodes that are connected to the "contacts" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithNamedContacts(name string, opts ...func(*ContactQuery)) *EntityQuery { + query := (&ContactClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedContacts == nil { + eq.withNamedContacts = make(map[string]*ContactQuery) + } + eq.withNamedContacts[name] = query + return eq +} + +// WithNamedDocuments tells the query-builder to eager-load the nodes that are connected to the "documents" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithNamedDocuments(name string, opts ...func(*DocumentDataQuery)) *EntityQuery { + query := (&DocumentDataClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedDocuments == nil { + eq.withNamedDocuments = make(map[string]*DocumentDataQuery) + } + eq.withNamedDocuments[name] = query + return eq +} + +// WithNamedNotes tells the query-builder to eager-load the nodes that are connected to the "notes" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithNamedNotes(name string, opts ...func(*NoteQuery)) *EntityQuery { + query := (&NoteClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedNotes == nil { + eq.withNamedNotes = make(map[string]*NoteQuery) + } + eq.withNamedNotes[name] = query + return eq +} + +// WithNamedFiles tells the query-builder to eager-load the nodes that are connected to the "files" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EntityQuery) WithNamedFiles(name string, opts ...func(*FileQuery)) *EntityQuery { + query := (&FileClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedFiles == nil { + eq.withNamedFiles = make(map[string]*FileQuery) + } + eq.withNamedFiles[name] = query + return eq +} + +// EntityGroupBy is the group-by builder for Entity entities. +type EntityGroupBy struct { + selector + build *EntityQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (egb *EntityGroupBy) Aggregate(fns ...AggregateFunc) *EntityGroupBy { + egb.fns = append(egb.fns, fns...) + return egb +} + +// Scan applies the selector query and scans the result into the given value. +func (egb *EntityGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, egb.build.ctx, ent.OpQueryGroupBy) + if err := egb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityQuery, *EntityGroupBy](ctx, egb.build, egb, egb.build.inters, v) +} + +func (egb *EntityGroupBy) sqlScan(ctx context.Context, root *EntityQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(egb.fns)) + for _, fn := range egb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*egb.flds)+len(egb.fns)) + for _, f := range *egb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*egb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := egb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntitySelect is the builder for selecting fields of Entity entities. +type EntitySelect struct { + *EntityQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (es *EntitySelect) Aggregate(fns ...AggregateFunc) *EntitySelect { + es.fns = append(es.fns, fns...) + return es +} + +// Scan applies the selector query and scans the result into the given value. +func (es *EntitySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, es.ctx, ent.OpQuerySelect) + if err := es.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityQuery, *EntitySelect](ctx, es.EntityQuery, es, es.inters, v) +} + +func (es *EntitySelect) sqlScan(ctx context.Context, root *EntityQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(es.fns)) + for _, fn := range es.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*es.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 := es.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entity_update.go b/internal/ent/generated/entity_update.go new file mode 100644 index 0000000..07a2a63 --- /dev/null +++ b/internal/ent/generated/entity_update.go @@ -0,0 +1,1723 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityUpdate is the builder for updating Entity entities. +type EntityUpdate struct { + config + hooks []Hook + mutation *EntityMutation +} + +// Where appends a list predicates to the EntityUpdate builder. +func (eu *EntityUpdate) Where(ps ...predicate.Entity) *EntityUpdate { + eu.mutation.Where(ps...) + return eu +} + +// SetUpdatedAt sets the "updated_at" field. +func (eu *EntityUpdate) SetUpdatedAt(t time.Time) *EntityUpdate { + eu.mutation.SetUpdatedAt(t) + return eu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (eu *EntityUpdate) ClearUpdatedAt() *EntityUpdate { + eu.mutation.ClearUpdatedAt() + return eu +} + +// SetUpdatedBy sets the "updated_by" field. +func (eu *EntityUpdate) SetUpdatedBy(s string) *EntityUpdate { + eu.mutation.SetUpdatedBy(s) + return eu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableUpdatedBy(s *string) *EntityUpdate { + if s != nil { + eu.SetUpdatedBy(*s) + } + return eu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (eu *EntityUpdate) ClearUpdatedBy() *EntityUpdate { + eu.mutation.ClearUpdatedBy() + return eu +} + +// SetDeletedAt sets the "deleted_at" field. +func (eu *EntityUpdate) SetDeletedAt(t time.Time) *EntityUpdate { + eu.mutation.SetDeletedAt(t) + return eu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableDeletedAt(t *time.Time) *EntityUpdate { + if t != nil { + eu.SetDeletedAt(*t) + } + return eu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (eu *EntityUpdate) ClearDeletedAt() *EntityUpdate { + eu.mutation.ClearDeletedAt() + return eu +} + +// SetDeletedBy sets the "deleted_by" field. +func (eu *EntityUpdate) SetDeletedBy(s string) *EntityUpdate { + eu.mutation.SetDeletedBy(s) + return eu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableDeletedBy(s *string) *EntityUpdate { + if s != nil { + eu.SetDeletedBy(*s) + } + return eu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (eu *EntityUpdate) ClearDeletedBy() *EntityUpdate { + eu.mutation.ClearDeletedBy() + return eu +} + +// SetTags sets the "tags" field. +func (eu *EntityUpdate) SetTags(s []string) *EntityUpdate { + eu.mutation.SetTags(s) + return eu +} + +// AppendTags appends s to the "tags" field. +func (eu *EntityUpdate) AppendTags(s []string) *EntityUpdate { + eu.mutation.AppendTags(s) + return eu +} + +// ClearTags clears the value of the "tags" field. +func (eu *EntityUpdate) ClearTags() *EntityUpdate { + eu.mutation.ClearTags() + return eu +} + +// SetOwnerID sets the "owner_id" field. +func (eu *EntityUpdate) SetOwnerID(s string) *EntityUpdate { + eu.mutation.SetOwnerID(s) + return eu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableOwnerID(s *string) *EntityUpdate { + if s != nil { + eu.SetOwnerID(*s) + } + return eu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (eu *EntityUpdate) ClearOwnerID() *EntityUpdate { + eu.mutation.ClearOwnerID() + return eu +} + +// SetName sets the "name" field. +func (eu *EntityUpdate) SetName(s string) *EntityUpdate { + eu.mutation.SetName(s) + return eu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableName(s *string) *EntityUpdate { + if s != nil { + eu.SetName(*s) + } + return eu +} + +// ClearName clears the value of the "name" field. +func (eu *EntityUpdate) ClearName() *EntityUpdate { + eu.mutation.ClearName() + return eu +} + +// SetDisplayName sets the "display_name" field. +func (eu *EntityUpdate) SetDisplayName(s string) *EntityUpdate { + eu.mutation.SetDisplayName(s) + return eu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableDisplayName(s *string) *EntityUpdate { + if s != nil { + eu.SetDisplayName(*s) + } + return eu +} + +// ClearDisplayName clears the value of the "display_name" field. +func (eu *EntityUpdate) ClearDisplayName() *EntityUpdate { + eu.mutation.ClearDisplayName() + return eu +} + +// SetDescription sets the "description" field. +func (eu *EntityUpdate) SetDescription(s string) *EntityUpdate { + eu.mutation.SetDescription(s) + return eu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableDescription(s *string) *EntityUpdate { + if s != nil { + eu.SetDescription(*s) + } + return eu +} + +// ClearDescription clears the value of the "description" field. +func (eu *EntityUpdate) ClearDescription() *EntityUpdate { + eu.mutation.ClearDescription() + return eu +} + +// SetDomains sets the "domains" field. +func (eu *EntityUpdate) SetDomains(s []string) *EntityUpdate { + eu.mutation.SetDomains(s) + return eu +} + +// AppendDomains appends s to the "domains" field. +func (eu *EntityUpdate) AppendDomains(s []string) *EntityUpdate { + eu.mutation.AppendDomains(s) + return eu +} + +// ClearDomains clears the value of the "domains" field. +func (eu *EntityUpdate) ClearDomains() *EntityUpdate { + eu.mutation.ClearDomains() + return eu +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (eu *EntityUpdate) SetEntityTypeID(s string) *EntityUpdate { + eu.mutation.SetEntityTypeID(s) + return eu +} + +// SetNillableEntityTypeID sets the "entity_type_id" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableEntityTypeID(s *string) *EntityUpdate { + if s != nil { + eu.SetEntityTypeID(*s) + } + return eu +} + +// ClearEntityTypeID clears the value of the "entity_type_id" field. +func (eu *EntityUpdate) ClearEntityTypeID() *EntityUpdate { + eu.mutation.ClearEntityTypeID() + return eu +} + +// SetStatus sets the "status" field. +func (eu *EntityUpdate) SetStatus(s string) *EntityUpdate { + eu.mutation.SetStatus(s) + return eu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (eu *EntityUpdate) SetNillableStatus(s *string) *EntityUpdate { + if s != nil { + eu.SetStatus(*s) + } + return eu +} + +// ClearStatus clears the value of the "status" field. +func (eu *EntityUpdate) ClearStatus() *EntityUpdate { + eu.mutation.ClearStatus() + return eu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (eu *EntityUpdate) SetOwner(o *Organization) *EntityUpdate { + return eu.SetOwnerID(o.ID) +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by IDs. +func (eu *EntityUpdate) AddContactIDs(ids ...string) *EntityUpdate { + eu.mutation.AddContactIDs(ids...) + return eu +} + +// AddContacts adds the "contacts" edges to the Contact entity. +func (eu *EntityUpdate) AddContacts(c ...*Contact) *EntityUpdate { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return eu.AddContactIDs(ids...) +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by IDs. +func (eu *EntityUpdate) AddDocumentIDs(ids ...string) *EntityUpdate { + eu.mutation.AddDocumentIDs(ids...) + return eu +} + +// AddDocuments adds the "documents" edges to the DocumentData entity. +func (eu *EntityUpdate) AddDocuments(d ...*DocumentData) *EntityUpdate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return eu.AddDocumentIDs(ids...) +} + +// AddNoteIDs adds the "notes" edge to the Note entity by IDs. +func (eu *EntityUpdate) AddNoteIDs(ids ...string) *EntityUpdate { + eu.mutation.AddNoteIDs(ids...) + return eu +} + +// AddNotes adds the "notes" edges to the Note entity. +func (eu *EntityUpdate) AddNotes(n ...*Note) *EntityUpdate { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return eu.AddNoteIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (eu *EntityUpdate) AddFileIDs(ids ...string) *EntityUpdate { + eu.mutation.AddFileIDs(ids...) + return eu +} + +// AddFiles adds the "files" edges to the File entity. +func (eu *EntityUpdate) AddFiles(f ...*File) *EntityUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return eu.AddFileIDs(ids...) +} + +// SetEntityType sets the "entity_type" edge to the EntityType entity. +func (eu *EntityUpdate) SetEntityType(e *EntityType) *EntityUpdate { + return eu.SetEntityTypeID(e.ID) +} + +// Mutation returns the EntityMutation object of the builder. +func (eu *EntityUpdate) Mutation() *EntityMutation { + return eu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (eu *EntityUpdate) ClearOwner() *EntityUpdate { + eu.mutation.ClearOwner() + return eu +} + +// ClearContacts clears all "contacts" edges to the Contact entity. +func (eu *EntityUpdate) ClearContacts() *EntityUpdate { + eu.mutation.ClearContacts() + return eu +} + +// RemoveContactIDs removes the "contacts" edge to Contact entities by IDs. +func (eu *EntityUpdate) RemoveContactIDs(ids ...string) *EntityUpdate { + eu.mutation.RemoveContactIDs(ids...) + return eu +} + +// RemoveContacts removes "contacts" edges to Contact entities. +func (eu *EntityUpdate) RemoveContacts(c ...*Contact) *EntityUpdate { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return eu.RemoveContactIDs(ids...) +} + +// ClearDocuments clears all "documents" edges to the DocumentData entity. +func (eu *EntityUpdate) ClearDocuments() *EntityUpdate { + eu.mutation.ClearDocuments() + return eu +} + +// RemoveDocumentIDs removes the "documents" edge to DocumentData entities by IDs. +func (eu *EntityUpdate) RemoveDocumentIDs(ids ...string) *EntityUpdate { + eu.mutation.RemoveDocumentIDs(ids...) + return eu +} + +// RemoveDocuments removes "documents" edges to DocumentData entities. +func (eu *EntityUpdate) RemoveDocuments(d ...*DocumentData) *EntityUpdate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return eu.RemoveDocumentIDs(ids...) +} + +// ClearNotes clears all "notes" edges to the Note entity. +func (eu *EntityUpdate) ClearNotes() *EntityUpdate { + eu.mutation.ClearNotes() + return eu +} + +// RemoveNoteIDs removes the "notes" edge to Note entities by IDs. +func (eu *EntityUpdate) RemoveNoteIDs(ids ...string) *EntityUpdate { + eu.mutation.RemoveNoteIDs(ids...) + return eu +} + +// RemoveNotes removes "notes" edges to Note entities. +func (eu *EntityUpdate) RemoveNotes(n ...*Note) *EntityUpdate { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return eu.RemoveNoteIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (eu *EntityUpdate) ClearFiles() *EntityUpdate { + eu.mutation.ClearFiles() + return eu +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (eu *EntityUpdate) RemoveFileIDs(ids ...string) *EntityUpdate { + eu.mutation.RemoveFileIDs(ids...) + return eu +} + +// RemoveFiles removes "files" edges to File entities. +func (eu *EntityUpdate) RemoveFiles(f ...*File) *EntityUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return eu.RemoveFileIDs(ids...) +} + +// ClearEntityType clears the "entity_type" edge to the EntityType entity. +func (eu *EntityUpdate) ClearEntityType() *EntityUpdate { + eu.mutation.ClearEntityType() + return eu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (eu *EntityUpdate) Save(ctx context.Context) (int, error) { + if err := eu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, eu.sqlSave, eu.mutation, eu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (eu *EntityUpdate) SaveX(ctx context.Context) int { + affected, err := eu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (eu *EntityUpdate) Exec(ctx context.Context) error { + _, err := eu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (eu *EntityUpdate) ExecX(ctx context.Context) { + if err := eu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (eu *EntityUpdate) defaults() error { + if _, ok := eu.mutation.UpdatedAt(); !ok && !eu.mutation.UpdatedAtCleared() { + if entity.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entity.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entity.UpdateDefaultUpdatedAt() + eu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (eu *EntityUpdate) check() error { + if v, ok := eu.mutation.OwnerID(); ok { + if err := entity.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Entity.owner_id": %w`, err)} + } + } + if v, ok := eu.mutation.Name(); ok { + if err := entity.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Entity.name": %w`, err)} + } + } + if v, ok := eu.mutation.DisplayName(); ok { + if err := entity.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Entity.display_name": %w`, err)} + } + } + if v, ok := eu.mutation.Domains(); ok { + if err := entity.DomainsValidator(v); err != nil { + return &ValidationError{Name: "domains", err: fmt.Errorf(`generated: validator failed for field "Entity.domains": %w`, err)} + } + } + return nil +} + +func (eu *EntityUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := eu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(entity.Table, entity.Columns, sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString)) + if ps := eu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if eu.mutation.CreatedAtCleared() { + _spec.ClearField(entity.FieldCreatedAt, field.TypeTime) + } + if value, ok := eu.mutation.UpdatedAt(); ok { + _spec.SetField(entity.FieldUpdatedAt, field.TypeTime, value) + } + if eu.mutation.UpdatedAtCleared() { + _spec.ClearField(entity.FieldUpdatedAt, field.TypeTime) + } + if eu.mutation.CreatedByCleared() { + _spec.ClearField(entity.FieldCreatedBy, field.TypeString) + } + if value, ok := eu.mutation.UpdatedBy(); ok { + _spec.SetField(entity.FieldUpdatedBy, field.TypeString, value) + } + if eu.mutation.UpdatedByCleared() { + _spec.ClearField(entity.FieldUpdatedBy, field.TypeString) + } + if value, ok := eu.mutation.DeletedAt(); ok { + _spec.SetField(entity.FieldDeletedAt, field.TypeTime, value) + } + if eu.mutation.DeletedAtCleared() { + _spec.ClearField(entity.FieldDeletedAt, field.TypeTime) + } + if value, ok := eu.mutation.DeletedBy(); ok { + _spec.SetField(entity.FieldDeletedBy, field.TypeString, value) + } + if eu.mutation.DeletedByCleared() { + _spec.ClearField(entity.FieldDeletedBy, field.TypeString) + } + if value, ok := eu.mutation.Tags(); ok { + _spec.SetField(entity.FieldTags, field.TypeJSON, value) + } + if value, ok := eu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entity.FieldTags, value) + }) + } + if eu.mutation.TagsCleared() { + _spec.ClearField(entity.FieldTags, field.TypeJSON) + } + if value, ok := eu.mutation.Name(); ok { + _spec.SetField(entity.FieldName, field.TypeString, value) + } + if eu.mutation.NameCleared() { + _spec.ClearField(entity.FieldName, field.TypeString) + } + if value, ok := eu.mutation.DisplayName(); ok { + _spec.SetField(entity.FieldDisplayName, field.TypeString, value) + } + if eu.mutation.DisplayNameCleared() { + _spec.ClearField(entity.FieldDisplayName, field.TypeString) + } + if value, ok := eu.mutation.Description(); ok { + _spec.SetField(entity.FieldDescription, field.TypeString, value) + } + if eu.mutation.DescriptionCleared() { + _spec.ClearField(entity.FieldDescription, field.TypeString) + } + if value, ok := eu.mutation.Domains(); ok { + _spec.SetField(entity.FieldDomains, field.TypeJSON, value) + } + if value, ok := eu.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entity.FieldDomains, value) + }) + } + if eu.mutation.DomainsCleared() { + _spec.ClearField(entity.FieldDomains, field.TypeJSON) + } + if value, ok := eu.mutation.Status(); ok { + _spec.SetField(entity.FieldStatus, field.TypeString, value) + } + if eu.mutation.StatusCleared() { + _spec.ClearField(entity.FieldStatus, field.TypeString) + } + if eu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entity.OwnerTable, + Columns: []string{entity.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entity.OwnerTable, + Columns: []string{entity.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityContacts + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedContactsIDs(); len(nodes) > 0 && !eu.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.ContactsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityDocuments + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedDocumentsIDs(); len(nodes) > 0 && !eu.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.DocumentsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedNotesIDs(); len(nodes) > 0 && !eu.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.NotesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedFilesIDs(); len(nodes) > 0 && !eu.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.EntityTypeCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entity.EntityTypeTable, + Columns: []string{entity.EntityTypeColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.EntityTypeIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entity.EntityTypeTable, + Columns: []string{entity.EntityTypeColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = eu.schemaConfig.Entity + ctx = internal.NewSchemaConfigContext(ctx, eu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, eu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entity.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + eu.mutation.done = true + return n, nil +} + +// EntityUpdateOne is the builder for updating a single Entity entity. +type EntityUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntityMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (euo *EntityUpdateOne) SetUpdatedAt(t time.Time) *EntityUpdateOne { + euo.mutation.SetUpdatedAt(t) + return euo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (euo *EntityUpdateOne) ClearUpdatedAt() *EntityUpdateOne { + euo.mutation.ClearUpdatedAt() + return euo +} + +// SetUpdatedBy sets the "updated_by" field. +func (euo *EntityUpdateOne) SetUpdatedBy(s string) *EntityUpdateOne { + euo.mutation.SetUpdatedBy(s) + return euo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableUpdatedBy(s *string) *EntityUpdateOne { + if s != nil { + euo.SetUpdatedBy(*s) + } + return euo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (euo *EntityUpdateOne) ClearUpdatedBy() *EntityUpdateOne { + euo.mutation.ClearUpdatedBy() + return euo +} + +// SetDeletedAt sets the "deleted_at" field. +func (euo *EntityUpdateOne) SetDeletedAt(t time.Time) *EntityUpdateOne { + euo.mutation.SetDeletedAt(t) + return euo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableDeletedAt(t *time.Time) *EntityUpdateOne { + if t != nil { + euo.SetDeletedAt(*t) + } + return euo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (euo *EntityUpdateOne) ClearDeletedAt() *EntityUpdateOne { + euo.mutation.ClearDeletedAt() + return euo +} + +// SetDeletedBy sets the "deleted_by" field. +func (euo *EntityUpdateOne) SetDeletedBy(s string) *EntityUpdateOne { + euo.mutation.SetDeletedBy(s) + return euo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableDeletedBy(s *string) *EntityUpdateOne { + if s != nil { + euo.SetDeletedBy(*s) + } + return euo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (euo *EntityUpdateOne) ClearDeletedBy() *EntityUpdateOne { + euo.mutation.ClearDeletedBy() + return euo +} + +// SetTags sets the "tags" field. +func (euo *EntityUpdateOne) SetTags(s []string) *EntityUpdateOne { + euo.mutation.SetTags(s) + return euo +} + +// AppendTags appends s to the "tags" field. +func (euo *EntityUpdateOne) AppendTags(s []string) *EntityUpdateOne { + euo.mutation.AppendTags(s) + return euo +} + +// ClearTags clears the value of the "tags" field. +func (euo *EntityUpdateOne) ClearTags() *EntityUpdateOne { + euo.mutation.ClearTags() + return euo +} + +// SetOwnerID sets the "owner_id" field. +func (euo *EntityUpdateOne) SetOwnerID(s string) *EntityUpdateOne { + euo.mutation.SetOwnerID(s) + return euo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableOwnerID(s *string) *EntityUpdateOne { + if s != nil { + euo.SetOwnerID(*s) + } + return euo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (euo *EntityUpdateOne) ClearOwnerID() *EntityUpdateOne { + euo.mutation.ClearOwnerID() + return euo +} + +// SetName sets the "name" field. +func (euo *EntityUpdateOne) SetName(s string) *EntityUpdateOne { + euo.mutation.SetName(s) + return euo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableName(s *string) *EntityUpdateOne { + if s != nil { + euo.SetName(*s) + } + return euo +} + +// ClearName clears the value of the "name" field. +func (euo *EntityUpdateOne) ClearName() *EntityUpdateOne { + euo.mutation.ClearName() + return euo +} + +// SetDisplayName sets the "display_name" field. +func (euo *EntityUpdateOne) SetDisplayName(s string) *EntityUpdateOne { + euo.mutation.SetDisplayName(s) + return euo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableDisplayName(s *string) *EntityUpdateOne { + if s != nil { + euo.SetDisplayName(*s) + } + return euo +} + +// ClearDisplayName clears the value of the "display_name" field. +func (euo *EntityUpdateOne) ClearDisplayName() *EntityUpdateOne { + euo.mutation.ClearDisplayName() + return euo +} + +// SetDescription sets the "description" field. +func (euo *EntityUpdateOne) SetDescription(s string) *EntityUpdateOne { + euo.mutation.SetDescription(s) + return euo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableDescription(s *string) *EntityUpdateOne { + if s != nil { + euo.SetDescription(*s) + } + return euo +} + +// ClearDescription clears the value of the "description" field. +func (euo *EntityUpdateOne) ClearDescription() *EntityUpdateOne { + euo.mutation.ClearDescription() + return euo +} + +// SetDomains sets the "domains" field. +func (euo *EntityUpdateOne) SetDomains(s []string) *EntityUpdateOne { + euo.mutation.SetDomains(s) + return euo +} + +// AppendDomains appends s to the "domains" field. +func (euo *EntityUpdateOne) AppendDomains(s []string) *EntityUpdateOne { + euo.mutation.AppendDomains(s) + return euo +} + +// ClearDomains clears the value of the "domains" field. +func (euo *EntityUpdateOne) ClearDomains() *EntityUpdateOne { + euo.mutation.ClearDomains() + return euo +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (euo *EntityUpdateOne) SetEntityTypeID(s string) *EntityUpdateOne { + euo.mutation.SetEntityTypeID(s) + return euo +} + +// SetNillableEntityTypeID sets the "entity_type_id" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableEntityTypeID(s *string) *EntityUpdateOne { + if s != nil { + euo.SetEntityTypeID(*s) + } + return euo +} + +// ClearEntityTypeID clears the value of the "entity_type_id" field. +func (euo *EntityUpdateOne) ClearEntityTypeID() *EntityUpdateOne { + euo.mutation.ClearEntityTypeID() + return euo +} + +// SetStatus sets the "status" field. +func (euo *EntityUpdateOne) SetStatus(s string) *EntityUpdateOne { + euo.mutation.SetStatus(s) + return euo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (euo *EntityUpdateOne) SetNillableStatus(s *string) *EntityUpdateOne { + if s != nil { + euo.SetStatus(*s) + } + return euo +} + +// ClearStatus clears the value of the "status" field. +func (euo *EntityUpdateOne) ClearStatus() *EntityUpdateOne { + euo.mutation.ClearStatus() + return euo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (euo *EntityUpdateOne) SetOwner(o *Organization) *EntityUpdateOne { + return euo.SetOwnerID(o.ID) +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by IDs. +func (euo *EntityUpdateOne) AddContactIDs(ids ...string) *EntityUpdateOne { + euo.mutation.AddContactIDs(ids...) + return euo +} + +// AddContacts adds the "contacts" edges to the Contact entity. +func (euo *EntityUpdateOne) AddContacts(c ...*Contact) *EntityUpdateOne { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return euo.AddContactIDs(ids...) +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by IDs. +func (euo *EntityUpdateOne) AddDocumentIDs(ids ...string) *EntityUpdateOne { + euo.mutation.AddDocumentIDs(ids...) + return euo +} + +// AddDocuments adds the "documents" edges to the DocumentData entity. +func (euo *EntityUpdateOne) AddDocuments(d ...*DocumentData) *EntityUpdateOne { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return euo.AddDocumentIDs(ids...) +} + +// AddNoteIDs adds the "notes" edge to the Note entity by IDs. +func (euo *EntityUpdateOne) AddNoteIDs(ids ...string) *EntityUpdateOne { + euo.mutation.AddNoteIDs(ids...) + return euo +} + +// AddNotes adds the "notes" edges to the Note entity. +func (euo *EntityUpdateOne) AddNotes(n ...*Note) *EntityUpdateOne { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return euo.AddNoteIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (euo *EntityUpdateOne) AddFileIDs(ids ...string) *EntityUpdateOne { + euo.mutation.AddFileIDs(ids...) + return euo +} + +// AddFiles adds the "files" edges to the File entity. +func (euo *EntityUpdateOne) AddFiles(f ...*File) *EntityUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return euo.AddFileIDs(ids...) +} + +// SetEntityType sets the "entity_type" edge to the EntityType entity. +func (euo *EntityUpdateOne) SetEntityType(e *EntityType) *EntityUpdateOne { + return euo.SetEntityTypeID(e.ID) +} + +// Mutation returns the EntityMutation object of the builder. +func (euo *EntityUpdateOne) Mutation() *EntityMutation { + return euo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (euo *EntityUpdateOne) ClearOwner() *EntityUpdateOne { + euo.mutation.ClearOwner() + return euo +} + +// ClearContacts clears all "contacts" edges to the Contact entity. +func (euo *EntityUpdateOne) ClearContacts() *EntityUpdateOne { + euo.mutation.ClearContacts() + return euo +} + +// RemoveContactIDs removes the "contacts" edge to Contact entities by IDs. +func (euo *EntityUpdateOne) RemoveContactIDs(ids ...string) *EntityUpdateOne { + euo.mutation.RemoveContactIDs(ids...) + return euo +} + +// RemoveContacts removes "contacts" edges to Contact entities. +func (euo *EntityUpdateOne) RemoveContacts(c ...*Contact) *EntityUpdateOne { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return euo.RemoveContactIDs(ids...) +} + +// ClearDocuments clears all "documents" edges to the DocumentData entity. +func (euo *EntityUpdateOne) ClearDocuments() *EntityUpdateOne { + euo.mutation.ClearDocuments() + return euo +} + +// RemoveDocumentIDs removes the "documents" edge to DocumentData entities by IDs. +func (euo *EntityUpdateOne) RemoveDocumentIDs(ids ...string) *EntityUpdateOne { + euo.mutation.RemoveDocumentIDs(ids...) + return euo +} + +// RemoveDocuments removes "documents" edges to DocumentData entities. +func (euo *EntityUpdateOne) RemoveDocuments(d ...*DocumentData) *EntityUpdateOne { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return euo.RemoveDocumentIDs(ids...) +} + +// ClearNotes clears all "notes" edges to the Note entity. +func (euo *EntityUpdateOne) ClearNotes() *EntityUpdateOne { + euo.mutation.ClearNotes() + return euo +} + +// RemoveNoteIDs removes the "notes" edge to Note entities by IDs. +func (euo *EntityUpdateOne) RemoveNoteIDs(ids ...string) *EntityUpdateOne { + euo.mutation.RemoveNoteIDs(ids...) + return euo +} + +// RemoveNotes removes "notes" edges to Note entities. +func (euo *EntityUpdateOne) RemoveNotes(n ...*Note) *EntityUpdateOne { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return euo.RemoveNoteIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (euo *EntityUpdateOne) ClearFiles() *EntityUpdateOne { + euo.mutation.ClearFiles() + return euo +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (euo *EntityUpdateOne) RemoveFileIDs(ids ...string) *EntityUpdateOne { + euo.mutation.RemoveFileIDs(ids...) + return euo +} + +// RemoveFiles removes "files" edges to File entities. +func (euo *EntityUpdateOne) RemoveFiles(f ...*File) *EntityUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return euo.RemoveFileIDs(ids...) +} + +// ClearEntityType clears the "entity_type" edge to the EntityType entity. +func (euo *EntityUpdateOne) ClearEntityType() *EntityUpdateOne { + euo.mutation.ClearEntityType() + return euo +} + +// Where appends a list predicates to the EntityUpdate builder. +func (euo *EntityUpdateOne) Where(ps ...predicate.Entity) *EntityUpdateOne { + euo.mutation.Where(ps...) + return euo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (euo *EntityUpdateOne) Select(field string, fields ...string) *EntityUpdateOne { + euo.fields = append([]string{field}, fields...) + return euo +} + +// Save executes the query and returns the updated Entity entity. +func (euo *EntityUpdateOne) Save(ctx context.Context) (*Entity, error) { + if err := euo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, euo.sqlSave, euo.mutation, euo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (euo *EntityUpdateOne) SaveX(ctx context.Context) *Entity { + node, err := euo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (euo *EntityUpdateOne) Exec(ctx context.Context) error { + _, err := euo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (euo *EntityUpdateOne) ExecX(ctx context.Context) { + if err := euo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (euo *EntityUpdateOne) defaults() error { + if _, ok := euo.mutation.UpdatedAt(); !ok && !euo.mutation.UpdatedAtCleared() { + if entity.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entity.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entity.UpdateDefaultUpdatedAt() + euo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (euo *EntityUpdateOne) check() error { + if v, ok := euo.mutation.OwnerID(); ok { + if err := entity.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Entity.owner_id": %w`, err)} + } + } + if v, ok := euo.mutation.Name(); ok { + if err := entity.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Entity.name": %w`, err)} + } + } + if v, ok := euo.mutation.DisplayName(); ok { + if err := entity.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Entity.display_name": %w`, err)} + } + } + if v, ok := euo.mutation.Domains(); ok { + if err := entity.DomainsValidator(v); err != nil { + return &ValidationError{Name: "domains", err: fmt.Errorf(`generated: validator failed for field "Entity.domains": %w`, err)} + } + } + return nil +} + +func (euo *EntityUpdateOne) sqlSave(ctx context.Context) (_node *Entity, err error) { + if err := euo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(entity.Table, entity.Columns, sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString)) + id, ok := euo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Entity.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := euo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entity.FieldID) + for _, f := range fields { + if !entity.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entity.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := euo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if euo.mutation.CreatedAtCleared() { + _spec.ClearField(entity.FieldCreatedAt, field.TypeTime) + } + if value, ok := euo.mutation.UpdatedAt(); ok { + _spec.SetField(entity.FieldUpdatedAt, field.TypeTime, value) + } + if euo.mutation.UpdatedAtCleared() { + _spec.ClearField(entity.FieldUpdatedAt, field.TypeTime) + } + if euo.mutation.CreatedByCleared() { + _spec.ClearField(entity.FieldCreatedBy, field.TypeString) + } + if value, ok := euo.mutation.UpdatedBy(); ok { + _spec.SetField(entity.FieldUpdatedBy, field.TypeString, value) + } + if euo.mutation.UpdatedByCleared() { + _spec.ClearField(entity.FieldUpdatedBy, field.TypeString) + } + if value, ok := euo.mutation.DeletedAt(); ok { + _spec.SetField(entity.FieldDeletedAt, field.TypeTime, value) + } + if euo.mutation.DeletedAtCleared() { + _spec.ClearField(entity.FieldDeletedAt, field.TypeTime) + } + if value, ok := euo.mutation.DeletedBy(); ok { + _spec.SetField(entity.FieldDeletedBy, field.TypeString, value) + } + if euo.mutation.DeletedByCleared() { + _spec.ClearField(entity.FieldDeletedBy, field.TypeString) + } + if value, ok := euo.mutation.Tags(); ok { + _spec.SetField(entity.FieldTags, field.TypeJSON, value) + } + if value, ok := euo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entity.FieldTags, value) + }) + } + if euo.mutation.TagsCleared() { + _spec.ClearField(entity.FieldTags, field.TypeJSON) + } + if value, ok := euo.mutation.Name(); ok { + _spec.SetField(entity.FieldName, field.TypeString, value) + } + if euo.mutation.NameCleared() { + _spec.ClearField(entity.FieldName, field.TypeString) + } + if value, ok := euo.mutation.DisplayName(); ok { + _spec.SetField(entity.FieldDisplayName, field.TypeString, value) + } + if euo.mutation.DisplayNameCleared() { + _spec.ClearField(entity.FieldDisplayName, field.TypeString) + } + if value, ok := euo.mutation.Description(); ok { + _spec.SetField(entity.FieldDescription, field.TypeString, value) + } + if euo.mutation.DescriptionCleared() { + _spec.ClearField(entity.FieldDescription, field.TypeString) + } + if value, ok := euo.mutation.Domains(); ok { + _spec.SetField(entity.FieldDomains, field.TypeJSON, value) + } + if value, ok := euo.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entity.FieldDomains, value) + }) + } + if euo.mutation.DomainsCleared() { + _spec.ClearField(entity.FieldDomains, field.TypeJSON) + } + if value, ok := euo.mutation.Status(); ok { + _spec.SetField(entity.FieldStatus, field.TypeString, value) + } + if euo.mutation.StatusCleared() { + _spec.ClearField(entity.FieldStatus, field.TypeString) + } + if euo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entity.OwnerTable, + Columns: []string{entity.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entity.OwnerTable, + Columns: []string{entity.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityContacts + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedContactsIDs(); len(nodes) > 0 && !euo.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.ContactsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityContacts + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityDocuments + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedDocumentsIDs(); len(nodes) > 0 && !euo.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.DocumentsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityDocuments + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedNotesIDs(); len(nodes) > 0 && !euo.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.NotesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedFilesIDs(); len(nodes) > 0 && !euo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.EntityTypeCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entity.EntityTypeTable, + Columns: []string{entity.EntityTypeColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.EntityTypeIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entity.EntityTypeTable, + Columns: []string{entity.EntityTypeColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = euo.schemaConfig.Entity + ctx = internal.NewSchemaConfigContext(ctx, euo.schemaConfig) + _node = &Entity{config: euo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, euo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entity.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + euo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entityhistory.go b/internal/ent/generated/entityhistory.go new file mode 100644 index 0000000..54cf05c --- /dev/null +++ b/internal/ent/generated/entityhistory.go @@ -0,0 +1,301 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/entx/history" +) + +// EntityHistory is the model entity for the EntityHistory schema. +type EntityHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the entity + Name string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + // An optional description of the entity + Description string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // The type of the entity + EntityTypeID string `json:"entity_type_id,omitempty"` + // status of the entity + Status string `json:"status,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntityHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entityhistory.FieldTags, entityhistory.FieldDomains: + values[i] = new([]byte) + case entityhistory.FieldOperation: + values[i] = new(history.OpType) + case entityhistory.FieldID, entityhistory.FieldRef, entityhistory.FieldCreatedBy, entityhistory.FieldUpdatedBy, entityhistory.FieldMappingID, entityhistory.FieldDeletedBy, entityhistory.FieldOwnerID, entityhistory.FieldName, entityhistory.FieldDisplayName, entityhistory.FieldDescription, entityhistory.FieldEntityTypeID, entityhistory.FieldStatus: + values[i] = new(sql.NullString) + case entityhistory.FieldHistoryTime, entityhistory.FieldCreatedAt, entityhistory.FieldUpdatedAt, entityhistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntityHistory fields. +func (eh *EntityHistory) 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 entityhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + eh.ID = value.String + } + case entityhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + eh.HistoryTime = value.Time + } + case entityhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + eh.Ref = value.String + } + case entityhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + eh.Operation = *value + } + case entityhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + eh.CreatedAt = value.Time + } + case entityhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + eh.UpdatedAt = value.Time + } + case entityhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + eh.CreatedBy = value.String + } + case entityhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + eh.UpdatedBy = value.String + } + case entityhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + eh.MappingID = value.String + } + case entityhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + eh.DeletedAt = value.Time + } + case entityhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + eh.DeletedBy = value.String + } + case entityhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &eh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entityhistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + eh.OwnerID = value.String + } + case entityhistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + eh.Name = value.String + } + case entityhistory.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + eh.DisplayName = value.String + } + case entityhistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + eh.Description = value.String + } + case entityhistory.FieldDomains: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field domains", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &eh.Domains); err != nil { + return fmt.Errorf("unmarshal field domains: %w", err) + } + } + case entityhistory.FieldEntityTypeID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field entity_type_id", values[i]) + } else if value.Valid { + eh.EntityTypeID = value.String + } + case entityhistory.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + eh.Status = value.String + } + default: + eh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntityHistory. +// This includes values selected through modifiers, order, etc. +func (eh *EntityHistory) Value(name string) (ent.Value, error) { + return eh.selectValues.Get(name) +} + +// Update returns a builder for updating this EntityHistory. +// Note that you need to call EntityHistory.Unwrap() before calling this method if this EntityHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (eh *EntityHistory) Update() *EntityHistoryUpdateOne { + return NewEntityHistoryClient(eh.config).UpdateOne(eh) +} + +// Unwrap unwraps the EntityHistory 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 (eh *EntityHistory) Unwrap() *EntityHistory { + _tx, ok := eh.config.driver.(*txDriver) + if !ok { + panic("generated: EntityHistory is not a transactional entity") + } + eh.config.driver = _tx.drv + return eh +} + +// String implements the fmt.Stringer. +func (eh *EntityHistory) String() string { + var builder strings.Builder + builder.WriteString("EntityHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", eh.ID)) + builder.WriteString("history_time=") + builder.WriteString(eh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(eh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", eh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(eh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(eh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(eh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(eh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(eh.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(eh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(eh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", eh.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(eh.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(eh.Name) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(eh.DisplayName) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(eh.Description) + builder.WriteString(", ") + builder.WriteString("domains=") + builder.WriteString(fmt.Sprintf("%v", eh.Domains)) + builder.WriteString(", ") + builder.WriteString("entity_type_id=") + builder.WriteString(eh.EntityTypeID) + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(eh.Status) + builder.WriteByte(')') + return builder.String() +} + +// EntityHistories is a parsable slice of EntityHistory. +type EntityHistories []*EntityHistory diff --git a/internal/ent/generated/entityhistory/entityhistory.go b/internal/ent/generated/entityhistory/entityhistory.go new file mode 100644 index 0000000..b29233f --- /dev/null +++ b/internal/ent/generated/entityhistory/entityhistory.go @@ -0,0 +1,223 @@ +// Code generated by ent, DO NOT EDIT. + +package entityhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the entityhistory type in the database. + Label = "entity_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldDomains holds the string denoting the domains field in the database. + FieldDomains = "domains" + // FieldEntityTypeID holds the string denoting the entity_type_id field in the database. + FieldEntityTypeID = "entity_type_id" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // Table holds the table name of the entityhistory in the database. + Table = "entity_history" +) + +// Columns holds all SQL columns for entityhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldName, + FieldDisplayName, + FieldDescription, + FieldDomains, + FieldEntityTypeID, + FieldStatus, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultStatus holds the default value on creation for the "status" field. + DefaultStatus string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("entityhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the EntityHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByEntityTypeID orders the results by the entity_type_id field. +func ByEntityTypeID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEntityTypeID, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/entityhistory/where.go b/internal/ent/generated/entityhistory/where.go new file mode 100644 index 0000000..808092f --- /dev/null +++ b/internal/ent/generated/entityhistory/where.go @@ -0,0 +1,1201 @@ +// Code generated by ent, DO NOT EDIT. + +package entityhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDescription, v)) +} + +// EntityTypeID applies equality check predicate on the "entity_type_id" field. It's identical to EntityTypeIDEQ. +func EntityTypeID(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldEntityTypeID, v)) +} + +// Status applies equality check predicate on the "status" field. It's identical to StatusEQ. +func Status(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldStatus, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameIsNil applies the IsNil predicate on the "name" field. +func NameIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldName)) +} + +// NameNotNil applies the NotNil predicate on the "name" field. +func NameNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldName)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameIsNil applies the IsNil predicate on the "display_name" field. +func DisplayNameIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldDisplayName)) +} + +// DisplayNameNotNil applies the NotNil predicate on the "display_name" field. +func DisplayNameNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldDisplayName)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// DomainsIsNil applies the IsNil predicate on the "domains" field. +func DomainsIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldDomains)) +} + +// DomainsNotNil applies the NotNil predicate on the "domains" field. +func DomainsNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldDomains)) +} + +// EntityTypeIDEQ applies the EQ predicate on the "entity_type_id" field. +func EntityTypeIDEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldEntityTypeID, v)) +} + +// EntityTypeIDNEQ applies the NEQ predicate on the "entity_type_id" field. +func EntityTypeIDNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldEntityTypeID, v)) +} + +// EntityTypeIDIn applies the In predicate on the "entity_type_id" field. +func EntityTypeIDIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldEntityTypeID, vs...)) +} + +// EntityTypeIDNotIn applies the NotIn predicate on the "entity_type_id" field. +func EntityTypeIDNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldEntityTypeID, vs...)) +} + +// EntityTypeIDGT applies the GT predicate on the "entity_type_id" field. +func EntityTypeIDGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldEntityTypeID, v)) +} + +// EntityTypeIDGTE applies the GTE predicate on the "entity_type_id" field. +func EntityTypeIDGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldEntityTypeID, v)) +} + +// EntityTypeIDLT applies the LT predicate on the "entity_type_id" field. +func EntityTypeIDLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldEntityTypeID, v)) +} + +// EntityTypeIDLTE applies the LTE predicate on the "entity_type_id" field. +func EntityTypeIDLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldEntityTypeID, v)) +} + +// EntityTypeIDContains applies the Contains predicate on the "entity_type_id" field. +func EntityTypeIDContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldEntityTypeID, v)) +} + +// EntityTypeIDHasPrefix applies the HasPrefix predicate on the "entity_type_id" field. +func EntityTypeIDHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldEntityTypeID, v)) +} + +// EntityTypeIDHasSuffix applies the HasSuffix predicate on the "entity_type_id" field. +func EntityTypeIDHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldEntityTypeID, v)) +} + +// EntityTypeIDIsNil applies the IsNil predicate on the "entity_type_id" field. +func EntityTypeIDIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldEntityTypeID)) +} + +// EntityTypeIDNotNil applies the NotNil predicate on the "entity_type_id" field. +func EntityTypeIDNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldEntityTypeID)) +} + +// EntityTypeIDEqualFold applies the EqualFold predicate on the "entity_type_id" field. +func EntityTypeIDEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldEntityTypeID, v)) +} + +// EntityTypeIDContainsFold applies the ContainsFold predicate on the "entity_type_id" field. +func EntityTypeIDContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldEntityTypeID, v)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEQ(FieldStatus, v)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNEQ(FieldStatus, v)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIn(FieldStatus, vs...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotIn(FieldStatus, vs...)) +} + +// StatusGT applies the GT predicate on the "status" field. +func StatusGT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGT(FieldStatus, v)) +} + +// StatusGTE applies the GTE predicate on the "status" field. +func StatusGTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldGTE(FieldStatus, v)) +} + +// StatusLT applies the LT predicate on the "status" field. +func StatusLT(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLT(FieldStatus, v)) +} + +// StatusLTE applies the LTE predicate on the "status" field. +func StatusLTE(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldLTE(FieldStatus, v)) +} + +// StatusContains applies the Contains predicate on the "status" field. +func StatusContains(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContains(FieldStatus, v)) +} + +// StatusHasPrefix applies the HasPrefix predicate on the "status" field. +func StatusHasPrefix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasPrefix(FieldStatus, v)) +} + +// StatusHasSuffix applies the HasSuffix predicate on the "status" field. +func StatusHasSuffix(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldHasSuffix(FieldStatus, v)) +} + +// StatusIsNil applies the IsNil predicate on the "status" field. +func StatusIsNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldIsNull(FieldStatus)) +} + +// StatusNotNil applies the NotNil predicate on the "status" field. +func StatusNotNil() predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldNotNull(FieldStatus)) +} + +// StatusEqualFold applies the EqualFold predicate on the "status" field. +func StatusEqualFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldEqualFold(FieldStatus, v)) +} + +// StatusContainsFold applies the ContainsFold predicate on the "status" field. +func StatusContainsFold(v string) predicate.EntityHistory { + return predicate.EntityHistory(sql.FieldContainsFold(FieldStatus, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.EntityHistory) predicate.EntityHistory { + return predicate.EntityHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntityHistory) predicate.EntityHistory { + return predicate.EntityHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntityHistory) predicate.EntityHistory { + return predicate.EntityHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entityhistory_create.go b/internal/ent/generated/entityhistory_create.go new file mode 100644 index 0000000..755b710 --- /dev/null +++ b/internal/ent/generated/entityhistory_create.go @@ -0,0 +1,558 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/entx/history" +) + +// EntityHistoryCreate is the builder for creating a EntityHistory entity. +type EntityHistoryCreate struct { + config + mutation *EntityHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ehc *EntityHistoryCreate) SetHistoryTime(t time.Time) *EntityHistoryCreate { + ehc.mutation.SetHistoryTime(t) + return ehc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableHistoryTime(t *time.Time) *EntityHistoryCreate { + if t != nil { + ehc.SetHistoryTime(*t) + } + return ehc +} + +// SetRef sets the "ref" field. +func (ehc *EntityHistoryCreate) SetRef(s string) *EntityHistoryCreate { + ehc.mutation.SetRef(s) + return ehc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableRef(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetRef(*s) + } + return ehc +} + +// SetOperation sets the "operation" field. +func (ehc *EntityHistoryCreate) SetOperation(ht history.OpType) *EntityHistoryCreate { + ehc.mutation.SetOperation(ht) + return ehc +} + +// SetCreatedAt sets the "created_at" field. +func (ehc *EntityHistoryCreate) SetCreatedAt(t time.Time) *EntityHistoryCreate { + ehc.mutation.SetCreatedAt(t) + return ehc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableCreatedAt(t *time.Time) *EntityHistoryCreate { + if t != nil { + ehc.SetCreatedAt(*t) + } + return ehc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehc *EntityHistoryCreate) SetUpdatedAt(t time.Time) *EntityHistoryCreate { + ehc.mutation.SetUpdatedAt(t) + return ehc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableUpdatedAt(t *time.Time) *EntityHistoryCreate { + if t != nil { + ehc.SetUpdatedAt(*t) + } + return ehc +} + +// SetCreatedBy sets the "created_by" field. +func (ehc *EntityHistoryCreate) SetCreatedBy(s string) *EntityHistoryCreate { + ehc.mutation.SetCreatedBy(s) + return ehc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableCreatedBy(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetCreatedBy(*s) + } + return ehc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehc *EntityHistoryCreate) SetUpdatedBy(s string) *EntityHistoryCreate { + ehc.mutation.SetUpdatedBy(s) + return ehc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableUpdatedBy(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetUpdatedBy(*s) + } + return ehc +} + +// SetMappingID sets the "mapping_id" field. +func (ehc *EntityHistoryCreate) SetMappingID(s string) *EntityHistoryCreate { + ehc.mutation.SetMappingID(s) + return ehc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableMappingID(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetMappingID(*s) + } + return ehc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ehc *EntityHistoryCreate) SetDeletedAt(t time.Time) *EntityHistoryCreate { + ehc.mutation.SetDeletedAt(t) + return ehc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableDeletedAt(t *time.Time) *EntityHistoryCreate { + if t != nil { + ehc.SetDeletedAt(*t) + } + return ehc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ehc *EntityHistoryCreate) SetDeletedBy(s string) *EntityHistoryCreate { + ehc.mutation.SetDeletedBy(s) + return ehc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableDeletedBy(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetDeletedBy(*s) + } + return ehc +} + +// SetTags sets the "tags" field. +func (ehc *EntityHistoryCreate) SetTags(s []string) *EntityHistoryCreate { + ehc.mutation.SetTags(s) + return ehc +} + +// SetOwnerID sets the "owner_id" field. +func (ehc *EntityHistoryCreate) SetOwnerID(s string) *EntityHistoryCreate { + ehc.mutation.SetOwnerID(s) + return ehc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableOwnerID(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetOwnerID(*s) + } + return ehc +} + +// SetName sets the "name" field. +func (ehc *EntityHistoryCreate) SetName(s string) *EntityHistoryCreate { + ehc.mutation.SetName(s) + return ehc +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableName(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetName(*s) + } + return ehc +} + +// SetDisplayName sets the "display_name" field. +func (ehc *EntityHistoryCreate) SetDisplayName(s string) *EntityHistoryCreate { + ehc.mutation.SetDisplayName(s) + return ehc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableDisplayName(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetDisplayName(*s) + } + return ehc +} + +// SetDescription sets the "description" field. +func (ehc *EntityHistoryCreate) SetDescription(s string) *EntityHistoryCreate { + ehc.mutation.SetDescription(s) + return ehc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableDescription(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetDescription(*s) + } + return ehc +} + +// SetDomains sets the "domains" field. +func (ehc *EntityHistoryCreate) SetDomains(s []string) *EntityHistoryCreate { + ehc.mutation.SetDomains(s) + return ehc +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (ehc *EntityHistoryCreate) SetEntityTypeID(s string) *EntityHistoryCreate { + ehc.mutation.SetEntityTypeID(s) + return ehc +} + +// SetNillableEntityTypeID sets the "entity_type_id" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableEntityTypeID(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetEntityTypeID(*s) + } + return ehc +} + +// SetStatus sets the "status" field. +func (ehc *EntityHistoryCreate) SetStatus(s string) *EntityHistoryCreate { + ehc.mutation.SetStatus(s) + return ehc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableStatus(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetStatus(*s) + } + return ehc +} + +// SetID sets the "id" field. +func (ehc *EntityHistoryCreate) SetID(s string) *EntityHistoryCreate { + ehc.mutation.SetID(s) + return ehc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ehc *EntityHistoryCreate) SetNillableID(s *string) *EntityHistoryCreate { + if s != nil { + ehc.SetID(*s) + } + return ehc +} + +// Mutation returns the EntityHistoryMutation object of the builder. +func (ehc *EntityHistoryCreate) Mutation() *EntityHistoryMutation { + return ehc.mutation +} + +// Save creates the EntityHistory in the database. +func (ehc *EntityHistoryCreate) Save(ctx context.Context) (*EntityHistory, error) { + if err := ehc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ehc.sqlSave, ehc.mutation, ehc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ehc *EntityHistoryCreate) SaveX(ctx context.Context) *EntityHistory { + v, err := ehc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ehc *EntityHistoryCreate) Exec(ctx context.Context) error { + _, err := ehc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehc *EntityHistoryCreate) ExecX(ctx context.Context) { + if err := ehc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehc *EntityHistoryCreate) defaults() error { + if _, ok := ehc.mutation.HistoryTime(); !ok { + if entityhistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized entityhistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := entityhistory.DefaultHistoryTime() + ehc.mutation.SetHistoryTime(v) + } + if _, ok := ehc.mutation.CreatedAt(); !ok { + if entityhistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entityhistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entityhistory.DefaultCreatedAt() + ehc.mutation.SetCreatedAt(v) + } + if _, ok := ehc.mutation.UpdatedAt(); !ok { + if entityhistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entityhistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entityhistory.DefaultUpdatedAt() + ehc.mutation.SetUpdatedAt(v) + } + if _, ok := ehc.mutation.MappingID(); !ok { + if entityhistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entityhistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entityhistory.DefaultMappingID() + ehc.mutation.SetMappingID(v) + } + if _, ok := ehc.mutation.Tags(); !ok { + v := entityhistory.DefaultTags + ehc.mutation.SetTags(v) + } + if _, ok := ehc.mutation.Status(); !ok { + v := entityhistory.DefaultStatus + ehc.mutation.SetStatus(v) + } + if _, ok := ehc.mutation.ID(); !ok { + if entityhistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entityhistory.DefaultID (forgotten import generated/runtime?)") + } + v := entityhistory.DefaultID() + ehc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ehc *EntityHistoryCreate) check() error { + if _, ok := ehc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "EntityHistory.history_time"`)} + } + if _, ok := ehc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "EntityHistory.operation"`)} + } + if v, ok := ehc.mutation.Operation(); ok { + if err := entityhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "EntityHistory.operation": %w`, err)} + } + } + if _, ok := ehc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntityHistory.mapping_id"`)} + } + return nil +} + +func (ehc *EntityHistoryCreate) sqlSave(ctx context.Context) (*EntityHistory, error) { + if err := ehc.check(); err != nil { + return nil, err + } + _node, _spec := ehc.createSpec() + if err := sqlgraph.CreateNode(ctx, ehc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntityHistory.ID type: %T", _spec.ID.Value) + } + } + ehc.mutation.id = &_node.ID + ehc.mutation.done = true + return _node, nil +} + +func (ehc *EntityHistoryCreate) createSpec() (*EntityHistory, *sqlgraph.CreateSpec) { + var ( + _node = &EntityHistory{config: ehc.config} + _spec = sqlgraph.NewCreateSpec(entityhistory.Table, sqlgraph.NewFieldSpec(entityhistory.FieldID, field.TypeString)) + ) + _spec.Schema = ehc.schemaConfig.EntityHistory + if id, ok := ehc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ehc.mutation.HistoryTime(); ok { + _spec.SetField(entityhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ehc.mutation.Ref(); ok { + _spec.SetField(entityhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ehc.mutation.Operation(); ok { + _spec.SetField(entityhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ehc.mutation.CreatedAt(); ok { + _spec.SetField(entityhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ehc.mutation.UpdatedAt(); ok { + _spec.SetField(entityhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ehc.mutation.CreatedBy(); ok { + _spec.SetField(entityhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ehc.mutation.UpdatedBy(); ok { + _spec.SetField(entityhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ehc.mutation.MappingID(); ok { + _spec.SetField(entityhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ehc.mutation.DeletedAt(); ok { + _spec.SetField(entityhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ehc.mutation.DeletedBy(); ok { + _spec.SetField(entityhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ehc.mutation.Tags(); ok { + _spec.SetField(entityhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ehc.mutation.OwnerID(); ok { + _spec.SetField(entityhistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ehc.mutation.Name(); ok { + _spec.SetField(entityhistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ehc.mutation.DisplayName(); ok { + _spec.SetField(entityhistory.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := ehc.mutation.Description(); ok { + _spec.SetField(entityhistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := ehc.mutation.Domains(); ok { + _spec.SetField(entityhistory.FieldDomains, field.TypeJSON, value) + _node.Domains = value + } + if value, ok := ehc.mutation.EntityTypeID(); ok { + _spec.SetField(entityhistory.FieldEntityTypeID, field.TypeString, value) + _node.EntityTypeID = value + } + if value, ok := ehc.mutation.Status(); ok { + _spec.SetField(entityhistory.FieldStatus, field.TypeString, value) + _node.Status = value + } + return _node, _spec +} + +// EntityHistoryCreateBulk is the builder for creating many EntityHistory entities in bulk. +type EntityHistoryCreateBulk struct { + config + err error + builders []*EntityHistoryCreate +} + +// Save creates the EntityHistory entities in the database. +func (ehcb *EntityHistoryCreateBulk) Save(ctx context.Context) ([]*EntityHistory, error) { + if ehcb.err != nil { + return nil, ehcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ehcb.builders)) + nodes := make([]*EntityHistory, len(ehcb.builders)) + mutators := make([]Mutator, len(ehcb.builders)) + for i := range ehcb.builders { + func(i int, root context.Context) { + builder := ehcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntityHistoryMutation) + 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, ehcb.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, ehcb.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, ehcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ehcb *EntityHistoryCreateBulk) SaveX(ctx context.Context) []*EntityHistory { + v, err := ehcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ehcb *EntityHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ehcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehcb *EntityHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ehcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entityhistory_delete.go b/internal/ent/generated/entityhistory_delete.go new file mode 100644 index 0000000..5788c51 --- /dev/null +++ b/internal/ent/generated/entityhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityHistoryDelete is the builder for deleting a EntityHistory entity. +type EntityHistoryDelete struct { + config + hooks []Hook + mutation *EntityHistoryMutation +} + +// Where appends a list predicates to the EntityHistoryDelete builder. +func (ehd *EntityHistoryDelete) Where(ps ...predicate.EntityHistory) *EntityHistoryDelete { + ehd.mutation.Where(ps...) + return ehd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ehd *EntityHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ehd.sqlExec, ehd.mutation, ehd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehd *EntityHistoryDelete) ExecX(ctx context.Context) int { + n, err := ehd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ehd *EntityHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entityhistory.Table, sqlgraph.NewFieldSpec(entityhistory.FieldID, field.TypeString)) + _spec.Node.Schema = ehd.schemaConfig.EntityHistory + ctx = internal.NewSchemaConfigContext(ctx, ehd.schemaConfig) + if ps := ehd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ehd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ehd.mutation.done = true + return affected, err +} + +// EntityHistoryDeleteOne is the builder for deleting a single EntityHistory entity. +type EntityHistoryDeleteOne struct { + ehd *EntityHistoryDelete +} + +// Where appends a list predicates to the EntityHistoryDelete builder. +func (ehdo *EntityHistoryDeleteOne) Where(ps ...predicate.EntityHistory) *EntityHistoryDeleteOne { + ehdo.ehd.mutation.Where(ps...) + return ehdo +} + +// Exec executes the deletion query. +func (ehdo *EntityHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ehdo.ehd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entityhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehdo *EntityHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ehdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entityhistory_query.go b/internal/ent/generated/entityhistory_query.go new file mode 100644 index 0000000..bf735bd --- /dev/null +++ b/internal/ent/generated/entityhistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityHistoryQuery is the builder for querying EntityHistory entities. +type EntityHistoryQuery struct { + config + ctx *QueryContext + order []entityhistory.OrderOption + inters []Interceptor + predicates []predicate.EntityHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntityHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntityHistoryQuery builder. +func (ehq *EntityHistoryQuery) Where(ps ...predicate.EntityHistory) *EntityHistoryQuery { + ehq.predicates = append(ehq.predicates, ps...) + return ehq +} + +// Limit the number of records to be returned by this query. +func (ehq *EntityHistoryQuery) Limit(limit int) *EntityHistoryQuery { + ehq.ctx.Limit = &limit + return ehq +} + +// Offset to start from. +func (ehq *EntityHistoryQuery) Offset(offset int) *EntityHistoryQuery { + ehq.ctx.Offset = &offset + return ehq +} + +// 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 (ehq *EntityHistoryQuery) Unique(unique bool) *EntityHistoryQuery { + ehq.ctx.Unique = &unique + return ehq +} + +// Order specifies how the records should be ordered. +func (ehq *EntityHistoryQuery) Order(o ...entityhistory.OrderOption) *EntityHistoryQuery { + ehq.order = append(ehq.order, o...) + return ehq +} + +// First returns the first EntityHistory entity from the query. +// Returns a *NotFoundError when no EntityHistory was found. +func (ehq *EntityHistoryQuery) First(ctx context.Context) (*EntityHistory, error) { + nodes, err := ehq.Limit(1).All(setContextOp(ctx, ehq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entityhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ehq *EntityHistoryQuery) FirstX(ctx context.Context) *EntityHistory { + node, err := ehq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntityHistory ID from the query. +// Returns a *NotFoundError when no EntityHistory ID was found. +func (ehq *EntityHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ehq.Limit(1).IDs(setContextOp(ctx, ehq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entityhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ehq *EntityHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ehq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntityHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntityHistory entity is found. +// Returns a *NotFoundError when no EntityHistory entities are found. +func (ehq *EntityHistoryQuery) Only(ctx context.Context) (*EntityHistory, error) { + nodes, err := ehq.Limit(2).All(setContextOp(ctx, ehq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entityhistory.Label} + default: + return nil, &NotSingularError{entityhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ehq *EntityHistoryQuery) OnlyX(ctx context.Context) *EntityHistory { + node, err := ehq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntityHistory ID in the query. +// Returns a *NotSingularError when more than one EntityHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ehq *EntityHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ehq.Limit(2).IDs(setContextOp(ctx, ehq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entityhistory.Label} + default: + err = &NotSingularError{entityhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ehq *EntityHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ehq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntityHistories. +func (ehq *EntityHistoryQuery) All(ctx context.Context) ([]*EntityHistory, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryAll) + if err := ehq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntityHistory, *EntityHistoryQuery]() + return withInterceptors[[]*EntityHistory](ctx, ehq, qr, ehq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ehq *EntityHistoryQuery) AllX(ctx context.Context) []*EntityHistory { + nodes, err := ehq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntityHistory IDs. +func (ehq *EntityHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ehq.ctx.Unique == nil && ehq.path != nil { + ehq.Unique(true) + } + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryIDs) + if err = ehq.Select(entityhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ehq *EntityHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ehq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ehq *EntityHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryCount) + if err := ehq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ehq, querierCount[*EntityHistoryQuery](), ehq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ehq *EntityHistoryQuery) CountX(ctx context.Context) int { + count, err := ehq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ehq *EntityHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryExist) + switch _, err := ehq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ehq *EntityHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ehq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntityHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ehq *EntityHistoryQuery) Clone() *EntityHistoryQuery { + if ehq == nil { + return nil + } + return &EntityHistoryQuery{ + config: ehq.config, + ctx: ehq.ctx.Clone(), + order: append([]entityhistory.OrderOption{}, ehq.order...), + inters: append([]Interceptor{}, ehq.inters...), + predicates: append([]predicate.EntityHistory{}, ehq.predicates...), + // clone intermediate query. + sql: ehq.sql.Clone(), + path: ehq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntityHistory.Query(). +// GroupBy(entityhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ehq *EntityHistoryQuery) GroupBy(field string, fields ...string) *EntityHistoryGroupBy { + ehq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntityHistoryGroupBy{build: ehq} + grbuild.flds = &ehq.ctx.Fields + grbuild.label = entityhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.EntityHistory.Query(). +// Select(entityhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ehq *EntityHistoryQuery) Select(fields ...string) *EntityHistorySelect { + ehq.ctx.Fields = append(ehq.ctx.Fields, fields...) + sbuild := &EntityHistorySelect{EntityHistoryQuery: ehq} + sbuild.label = entityhistory.Label + sbuild.flds, sbuild.scan = &ehq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntityHistorySelect configured with the given aggregations. +func (ehq *EntityHistoryQuery) Aggregate(fns ...AggregateFunc) *EntityHistorySelect { + return ehq.Select().Aggregate(fns...) +} + +func (ehq *EntityHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ehq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ehq); err != nil { + return err + } + } + } + for _, f := range ehq.ctx.Fields { + if !entityhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ehq.path != nil { + prev, err := ehq.path(ctx) + if err != nil { + return err + } + ehq.sql = prev + } + if entityhistory.Policy == nil { + return errors.New("generated: uninitialized entityhistory.Policy (forgotten import generated/runtime?)") + } + if err := entityhistory.Policy.EvalQuery(ctx, ehq); err != nil { + return err + } + return nil +} + +func (ehq *EntityHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntityHistory, error) { + var ( + nodes = []*EntityHistory{} + _spec = ehq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntityHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntityHistory{config: ehq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ehq.schemaConfig.EntityHistory + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + if len(ehq.modifiers) > 0 { + _spec.Modifiers = ehq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ehq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ehq.loadTotal { + if err := ehq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ehq *EntityHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ehq.querySpec() + _spec.Node.Schema = ehq.schemaConfig.EntityHistory + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + if len(ehq.modifiers) > 0 { + _spec.Modifiers = ehq.modifiers + } + _spec.Node.Columns = ehq.ctx.Fields + if len(ehq.ctx.Fields) > 0 { + _spec.Unique = ehq.ctx.Unique != nil && *ehq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ehq.driver, _spec) +} + +func (ehq *EntityHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entityhistory.Table, entityhistory.Columns, sqlgraph.NewFieldSpec(entityhistory.FieldID, field.TypeString)) + _spec.From = ehq.sql + if unique := ehq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ehq.path != nil { + _spec.Unique = true + } + if fields := ehq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entityhistory.FieldID) + for i := range fields { + if fields[i] != entityhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ehq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ehq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ehq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ehq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ehq *EntityHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ehq.driver.Dialect()) + t1 := builder.Table(entityhistory.Table) + columns := ehq.ctx.Fields + if len(columns) == 0 { + columns = entityhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ehq.sql != nil { + selector = ehq.sql + selector.Select(selector.Columns(columns...)...) + } + if ehq.ctx.Unique != nil && *ehq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ehq.schemaConfig.EntityHistory) + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ehq.predicates { + p(selector) + } + for _, p := range ehq.order { + p(selector) + } + if offset := ehq.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 := ehq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// EntityHistoryGroupBy is the group-by builder for EntityHistory entities. +type EntityHistoryGroupBy struct { + selector + build *EntityHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ehgb *EntityHistoryGroupBy) Aggregate(fns ...AggregateFunc) *EntityHistoryGroupBy { + ehgb.fns = append(ehgb.fns, fns...) + return ehgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ehgb *EntityHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ehgb.build.ctx, ent.OpQueryGroupBy) + if err := ehgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityHistoryQuery, *EntityHistoryGroupBy](ctx, ehgb.build, ehgb, ehgb.build.inters, v) +} + +func (ehgb *EntityHistoryGroupBy) sqlScan(ctx context.Context, root *EntityHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ehgb.fns)) + for _, fn := range ehgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ehgb.flds)+len(ehgb.fns)) + for _, f := range *ehgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ehgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ehgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntityHistorySelect is the builder for selecting fields of EntityHistory entities. +type EntityHistorySelect struct { + *EntityHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ehs *EntityHistorySelect) Aggregate(fns ...AggregateFunc) *EntityHistorySelect { + ehs.fns = append(ehs.fns, fns...) + return ehs +} + +// Scan applies the selector query and scans the result into the given value. +func (ehs *EntityHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ehs.ctx, ent.OpQuerySelect) + if err := ehs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityHistoryQuery, *EntityHistorySelect](ctx, ehs.EntityHistoryQuery, ehs, ehs.inters, v) +} + +func (ehs *EntityHistorySelect) sqlScan(ctx context.Context, root *EntityHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ehs.fns)) + for _, fn := range ehs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ehs.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 := ehs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entityhistory_update.go b/internal/ent/generated/entityhistory_update.go new file mode 100644 index 0000000..240c58e --- /dev/null +++ b/internal/ent/generated/entityhistory_update.go @@ -0,0 +1,851 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityHistoryUpdate is the builder for updating EntityHistory entities. +type EntityHistoryUpdate struct { + config + hooks []Hook + mutation *EntityHistoryMutation +} + +// Where appends a list predicates to the EntityHistoryUpdate builder. +func (ehu *EntityHistoryUpdate) Where(ps ...predicate.EntityHistory) *EntityHistoryUpdate { + ehu.mutation.Where(ps...) + return ehu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehu *EntityHistoryUpdate) SetUpdatedAt(t time.Time) *EntityHistoryUpdate { + ehu.mutation.SetUpdatedAt(t) + return ehu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ehu *EntityHistoryUpdate) ClearUpdatedAt() *EntityHistoryUpdate { + ehu.mutation.ClearUpdatedAt() + return ehu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehu *EntityHistoryUpdate) SetUpdatedBy(s string) *EntityHistoryUpdate { + ehu.mutation.SetUpdatedBy(s) + return ehu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableUpdatedBy(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetUpdatedBy(*s) + } + return ehu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ehu *EntityHistoryUpdate) ClearUpdatedBy() *EntityHistoryUpdate { + ehu.mutation.ClearUpdatedBy() + return ehu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ehu *EntityHistoryUpdate) SetDeletedAt(t time.Time) *EntityHistoryUpdate { + ehu.mutation.SetDeletedAt(t) + return ehu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableDeletedAt(t *time.Time) *EntityHistoryUpdate { + if t != nil { + ehu.SetDeletedAt(*t) + } + return ehu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ehu *EntityHistoryUpdate) ClearDeletedAt() *EntityHistoryUpdate { + ehu.mutation.ClearDeletedAt() + return ehu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ehu *EntityHistoryUpdate) SetDeletedBy(s string) *EntityHistoryUpdate { + ehu.mutation.SetDeletedBy(s) + return ehu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableDeletedBy(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetDeletedBy(*s) + } + return ehu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ehu *EntityHistoryUpdate) ClearDeletedBy() *EntityHistoryUpdate { + ehu.mutation.ClearDeletedBy() + return ehu +} + +// SetTags sets the "tags" field. +func (ehu *EntityHistoryUpdate) SetTags(s []string) *EntityHistoryUpdate { + ehu.mutation.SetTags(s) + return ehu +} + +// AppendTags appends s to the "tags" field. +func (ehu *EntityHistoryUpdate) AppendTags(s []string) *EntityHistoryUpdate { + ehu.mutation.AppendTags(s) + return ehu +} + +// ClearTags clears the value of the "tags" field. +func (ehu *EntityHistoryUpdate) ClearTags() *EntityHistoryUpdate { + ehu.mutation.ClearTags() + return ehu +} + +// SetOwnerID sets the "owner_id" field. +func (ehu *EntityHistoryUpdate) SetOwnerID(s string) *EntityHistoryUpdate { + ehu.mutation.SetOwnerID(s) + return ehu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableOwnerID(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetOwnerID(*s) + } + return ehu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ehu *EntityHistoryUpdate) ClearOwnerID() *EntityHistoryUpdate { + ehu.mutation.ClearOwnerID() + return ehu +} + +// SetName sets the "name" field. +func (ehu *EntityHistoryUpdate) SetName(s string) *EntityHistoryUpdate { + ehu.mutation.SetName(s) + return ehu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableName(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetName(*s) + } + return ehu +} + +// ClearName clears the value of the "name" field. +func (ehu *EntityHistoryUpdate) ClearName() *EntityHistoryUpdate { + ehu.mutation.ClearName() + return ehu +} + +// SetDisplayName sets the "display_name" field. +func (ehu *EntityHistoryUpdate) SetDisplayName(s string) *EntityHistoryUpdate { + ehu.mutation.SetDisplayName(s) + return ehu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableDisplayName(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetDisplayName(*s) + } + return ehu +} + +// ClearDisplayName clears the value of the "display_name" field. +func (ehu *EntityHistoryUpdate) ClearDisplayName() *EntityHistoryUpdate { + ehu.mutation.ClearDisplayName() + return ehu +} + +// SetDescription sets the "description" field. +func (ehu *EntityHistoryUpdate) SetDescription(s string) *EntityHistoryUpdate { + ehu.mutation.SetDescription(s) + return ehu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableDescription(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetDescription(*s) + } + return ehu +} + +// ClearDescription clears the value of the "description" field. +func (ehu *EntityHistoryUpdate) ClearDescription() *EntityHistoryUpdate { + ehu.mutation.ClearDescription() + return ehu +} + +// SetDomains sets the "domains" field. +func (ehu *EntityHistoryUpdate) SetDomains(s []string) *EntityHistoryUpdate { + ehu.mutation.SetDomains(s) + return ehu +} + +// AppendDomains appends s to the "domains" field. +func (ehu *EntityHistoryUpdate) AppendDomains(s []string) *EntityHistoryUpdate { + ehu.mutation.AppendDomains(s) + return ehu +} + +// ClearDomains clears the value of the "domains" field. +func (ehu *EntityHistoryUpdate) ClearDomains() *EntityHistoryUpdate { + ehu.mutation.ClearDomains() + return ehu +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (ehu *EntityHistoryUpdate) SetEntityTypeID(s string) *EntityHistoryUpdate { + ehu.mutation.SetEntityTypeID(s) + return ehu +} + +// SetNillableEntityTypeID sets the "entity_type_id" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableEntityTypeID(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetEntityTypeID(*s) + } + return ehu +} + +// ClearEntityTypeID clears the value of the "entity_type_id" field. +func (ehu *EntityHistoryUpdate) ClearEntityTypeID() *EntityHistoryUpdate { + ehu.mutation.ClearEntityTypeID() + return ehu +} + +// SetStatus sets the "status" field. +func (ehu *EntityHistoryUpdate) SetStatus(s string) *EntityHistoryUpdate { + ehu.mutation.SetStatus(s) + return ehu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ehu *EntityHistoryUpdate) SetNillableStatus(s *string) *EntityHistoryUpdate { + if s != nil { + ehu.SetStatus(*s) + } + return ehu +} + +// ClearStatus clears the value of the "status" field. +func (ehu *EntityHistoryUpdate) ClearStatus() *EntityHistoryUpdate { + ehu.mutation.ClearStatus() + return ehu +} + +// Mutation returns the EntityHistoryMutation object of the builder. +func (ehu *EntityHistoryUpdate) Mutation() *EntityHistoryMutation { + return ehu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ehu *EntityHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ehu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ehu.sqlSave, ehu.mutation, ehu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ehu *EntityHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ehu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ehu *EntityHistoryUpdate) Exec(ctx context.Context) error { + _, err := ehu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehu *EntityHistoryUpdate) ExecX(ctx context.Context) { + if err := ehu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehu *EntityHistoryUpdate) defaults() error { + if _, ok := ehu.mutation.UpdatedAt(); !ok && !ehu.mutation.UpdatedAtCleared() { + if entityhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entityhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entityhistory.UpdateDefaultUpdatedAt() + ehu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ehu *EntityHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(entityhistory.Table, entityhistory.Columns, sqlgraph.NewFieldSpec(entityhistory.FieldID, field.TypeString)) + if ps := ehu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ehu.mutation.RefCleared() { + _spec.ClearField(entityhistory.FieldRef, field.TypeString) + } + if ehu.mutation.CreatedAtCleared() { + _spec.ClearField(entityhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ehu.mutation.UpdatedAt(); ok { + _spec.SetField(entityhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ehu.mutation.UpdatedAtCleared() { + _spec.ClearField(entityhistory.FieldUpdatedAt, field.TypeTime) + } + if ehu.mutation.CreatedByCleared() { + _spec.ClearField(entityhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ehu.mutation.UpdatedBy(); ok { + _spec.SetField(entityhistory.FieldUpdatedBy, field.TypeString, value) + } + if ehu.mutation.UpdatedByCleared() { + _spec.ClearField(entityhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ehu.mutation.DeletedAt(); ok { + _spec.SetField(entityhistory.FieldDeletedAt, field.TypeTime, value) + } + if ehu.mutation.DeletedAtCleared() { + _spec.ClearField(entityhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ehu.mutation.DeletedBy(); ok { + _spec.SetField(entityhistory.FieldDeletedBy, field.TypeString, value) + } + if ehu.mutation.DeletedByCleared() { + _spec.ClearField(entityhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ehu.mutation.Tags(); ok { + _spec.SetField(entityhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ehu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entityhistory.FieldTags, value) + }) + } + if ehu.mutation.TagsCleared() { + _spec.ClearField(entityhistory.FieldTags, field.TypeJSON) + } + if value, ok := ehu.mutation.OwnerID(); ok { + _spec.SetField(entityhistory.FieldOwnerID, field.TypeString, value) + } + if ehu.mutation.OwnerIDCleared() { + _spec.ClearField(entityhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ehu.mutation.Name(); ok { + _spec.SetField(entityhistory.FieldName, field.TypeString, value) + } + if ehu.mutation.NameCleared() { + _spec.ClearField(entityhistory.FieldName, field.TypeString) + } + if value, ok := ehu.mutation.DisplayName(); ok { + _spec.SetField(entityhistory.FieldDisplayName, field.TypeString, value) + } + if ehu.mutation.DisplayNameCleared() { + _spec.ClearField(entityhistory.FieldDisplayName, field.TypeString) + } + if value, ok := ehu.mutation.Description(); ok { + _spec.SetField(entityhistory.FieldDescription, field.TypeString, value) + } + if ehu.mutation.DescriptionCleared() { + _spec.ClearField(entityhistory.FieldDescription, field.TypeString) + } + if value, ok := ehu.mutation.Domains(); ok { + _spec.SetField(entityhistory.FieldDomains, field.TypeJSON, value) + } + if value, ok := ehu.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entityhistory.FieldDomains, value) + }) + } + if ehu.mutation.DomainsCleared() { + _spec.ClearField(entityhistory.FieldDomains, field.TypeJSON) + } + if value, ok := ehu.mutation.EntityTypeID(); ok { + _spec.SetField(entityhistory.FieldEntityTypeID, field.TypeString, value) + } + if ehu.mutation.EntityTypeIDCleared() { + _spec.ClearField(entityhistory.FieldEntityTypeID, field.TypeString) + } + if value, ok := ehu.mutation.Status(); ok { + _spec.SetField(entityhistory.FieldStatus, field.TypeString, value) + } + if ehu.mutation.StatusCleared() { + _spec.ClearField(entityhistory.FieldStatus, field.TypeString) + } + _spec.Node.Schema = ehu.schemaConfig.EntityHistory + ctx = internal.NewSchemaConfigContext(ctx, ehu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ehu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entityhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ehu.mutation.done = true + return n, nil +} + +// EntityHistoryUpdateOne is the builder for updating a single EntityHistory entity. +type EntityHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntityHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehuo *EntityHistoryUpdateOne) SetUpdatedAt(t time.Time) *EntityHistoryUpdateOne { + ehuo.mutation.SetUpdatedAt(t) + return ehuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ehuo *EntityHistoryUpdateOne) ClearUpdatedAt() *EntityHistoryUpdateOne { + ehuo.mutation.ClearUpdatedAt() + return ehuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehuo *EntityHistoryUpdateOne) SetUpdatedBy(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetUpdatedBy(s) + return ehuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableUpdatedBy(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetUpdatedBy(*s) + } + return ehuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ehuo *EntityHistoryUpdateOne) ClearUpdatedBy() *EntityHistoryUpdateOne { + ehuo.mutation.ClearUpdatedBy() + return ehuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ehuo *EntityHistoryUpdateOne) SetDeletedAt(t time.Time) *EntityHistoryUpdateOne { + ehuo.mutation.SetDeletedAt(t) + return ehuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *EntityHistoryUpdateOne { + if t != nil { + ehuo.SetDeletedAt(*t) + } + return ehuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ehuo *EntityHistoryUpdateOne) ClearDeletedAt() *EntityHistoryUpdateOne { + ehuo.mutation.ClearDeletedAt() + return ehuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ehuo *EntityHistoryUpdateOne) SetDeletedBy(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetDeletedBy(s) + return ehuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableDeletedBy(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetDeletedBy(*s) + } + return ehuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ehuo *EntityHistoryUpdateOne) ClearDeletedBy() *EntityHistoryUpdateOne { + ehuo.mutation.ClearDeletedBy() + return ehuo +} + +// SetTags sets the "tags" field. +func (ehuo *EntityHistoryUpdateOne) SetTags(s []string) *EntityHistoryUpdateOne { + ehuo.mutation.SetTags(s) + return ehuo +} + +// AppendTags appends s to the "tags" field. +func (ehuo *EntityHistoryUpdateOne) AppendTags(s []string) *EntityHistoryUpdateOne { + ehuo.mutation.AppendTags(s) + return ehuo +} + +// ClearTags clears the value of the "tags" field. +func (ehuo *EntityHistoryUpdateOne) ClearTags() *EntityHistoryUpdateOne { + ehuo.mutation.ClearTags() + return ehuo +} + +// SetOwnerID sets the "owner_id" field. +func (ehuo *EntityHistoryUpdateOne) SetOwnerID(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetOwnerID(s) + return ehuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableOwnerID(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetOwnerID(*s) + } + return ehuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ehuo *EntityHistoryUpdateOne) ClearOwnerID() *EntityHistoryUpdateOne { + ehuo.mutation.ClearOwnerID() + return ehuo +} + +// SetName sets the "name" field. +func (ehuo *EntityHistoryUpdateOne) SetName(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetName(s) + return ehuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableName(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetName(*s) + } + return ehuo +} + +// ClearName clears the value of the "name" field. +func (ehuo *EntityHistoryUpdateOne) ClearName() *EntityHistoryUpdateOne { + ehuo.mutation.ClearName() + return ehuo +} + +// SetDisplayName sets the "display_name" field. +func (ehuo *EntityHistoryUpdateOne) SetDisplayName(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetDisplayName(s) + return ehuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableDisplayName(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetDisplayName(*s) + } + return ehuo +} + +// ClearDisplayName clears the value of the "display_name" field. +func (ehuo *EntityHistoryUpdateOne) ClearDisplayName() *EntityHistoryUpdateOne { + ehuo.mutation.ClearDisplayName() + return ehuo +} + +// SetDescription sets the "description" field. +func (ehuo *EntityHistoryUpdateOne) SetDescription(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetDescription(s) + return ehuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableDescription(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetDescription(*s) + } + return ehuo +} + +// ClearDescription clears the value of the "description" field. +func (ehuo *EntityHistoryUpdateOne) ClearDescription() *EntityHistoryUpdateOne { + ehuo.mutation.ClearDescription() + return ehuo +} + +// SetDomains sets the "domains" field. +func (ehuo *EntityHistoryUpdateOne) SetDomains(s []string) *EntityHistoryUpdateOne { + ehuo.mutation.SetDomains(s) + return ehuo +} + +// AppendDomains appends s to the "domains" field. +func (ehuo *EntityHistoryUpdateOne) AppendDomains(s []string) *EntityHistoryUpdateOne { + ehuo.mutation.AppendDomains(s) + return ehuo +} + +// ClearDomains clears the value of the "domains" field. +func (ehuo *EntityHistoryUpdateOne) ClearDomains() *EntityHistoryUpdateOne { + ehuo.mutation.ClearDomains() + return ehuo +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (ehuo *EntityHistoryUpdateOne) SetEntityTypeID(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetEntityTypeID(s) + return ehuo +} + +// SetNillableEntityTypeID sets the "entity_type_id" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableEntityTypeID(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetEntityTypeID(*s) + } + return ehuo +} + +// ClearEntityTypeID clears the value of the "entity_type_id" field. +func (ehuo *EntityHistoryUpdateOne) ClearEntityTypeID() *EntityHistoryUpdateOne { + ehuo.mutation.ClearEntityTypeID() + return ehuo +} + +// SetStatus sets the "status" field. +func (ehuo *EntityHistoryUpdateOne) SetStatus(s string) *EntityHistoryUpdateOne { + ehuo.mutation.SetStatus(s) + return ehuo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ehuo *EntityHistoryUpdateOne) SetNillableStatus(s *string) *EntityHistoryUpdateOne { + if s != nil { + ehuo.SetStatus(*s) + } + return ehuo +} + +// ClearStatus clears the value of the "status" field. +func (ehuo *EntityHistoryUpdateOne) ClearStatus() *EntityHistoryUpdateOne { + ehuo.mutation.ClearStatus() + return ehuo +} + +// Mutation returns the EntityHistoryMutation object of the builder. +func (ehuo *EntityHistoryUpdateOne) Mutation() *EntityHistoryMutation { + return ehuo.mutation +} + +// Where appends a list predicates to the EntityHistoryUpdate builder. +func (ehuo *EntityHistoryUpdateOne) Where(ps ...predicate.EntityHistory) *EntityHistoryUpdateOne { + ehuo.mutation.Where(ps...) + return ehuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ehuo *EntityHistoryUpdateOne) Select(field string, fields ...string) *EntityHistoryUpdateOne { + ehuo.fields = append([]string{field}, fields...) + return ehuo +} + +// Save executes the query and returns the updated EntityHistory entity. +func (ehuo *EntityHistoryUpdateOne) Save(ctx context.Context) (*EntityHistory, error) { + if err := ehuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ehuo.sqlSave, ehuo.mutation, ehuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ehuo *EntityHistoryUpdateOne) SaveX(ctx context.Context) *EntityHistory { + node, err := ehuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ehuo *EntityHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ehuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehuo *EntityHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ehuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehuo *EntityHistoryUpdateOne) defaults() error { + if _, ok := ehuo.mutation.UpdatedAt(); !ok && !ehuo.mutation.UpdatedAtCleared() { + if entityhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entityhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entityhistory.UpdateDefaultUpdatedAt() + ehuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ehuo *EntityHistoryUpdateOne) sqlSave(ctx context.Context) (_node *EntityHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(entityhistory.Table, entityhistory.Columns, sqlgraph.NewFieldSpec(entityhistory.FieldID, field.TypeString)) + id, ok := ehuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntityHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ehuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entityhistory.FieldID) + for _, f := range fields { + if !entityhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entityhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ehuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ehuo.mutation.RefCleared() { + _spec.ClearField(entityhistory.FieldRef, field.TypeString) + } + if ehuo.mutation.CreatedAtCleared() { + _spec.ClearField(entityhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ehuo.mutation.UpdatedAt(); ok { + _spec.SetField(entityhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ehuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entityhistory.FieldUpdatedAt, field.TypeTime) + } + if ehuo.mutation.CreatedByCleared() { + _spec.ClearField(entityhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ehuo.mutation.UpdatedBy(); ok { + _spec.SetField(entityhistory.FieldUpdatedBy, field.TypeString, value) + } + if ehuo.mutation.UpdatedByCleared() { + _spec.ClearField(entityhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ehuo.mutation.DeletedAt(); ok { + _spec.SetField(entityhistory.FieldDeletedAt, field.TypeTime, value) + } + if ehuo.mutation.DeletedAtCleared() { + _spec.ClearField(entityhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ehuo.mutation.DeletedBy(); ok { + _spec.SetField(entityhistory.FieldDeletedBy, field.TypeString, value) + } + if ehuo.mutation.DeletedByCleared() { + _spec.ClearField(entityhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ehuo.mutation.Tags(); ok { + _spec.SetField(entityhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ehuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entityhistory.FieldTags, value) + }) + } + if ehuo.mutation.TagsCleared() { + _spec.ClearField(entityhistory.FieldTags, field.TypeJSON) + } + if value, ok := ehuo.mutation.OwnerID(); ok { + _spec.SetField(entityhistory.FieldOwnerID, field.TypeString, value) + } + if ehuo.mutation.OwnerIDCleared() { + _spec.ClearField(entityhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ehuo.mutation.Name(); ok { + _spec.SetField(entityhistory.FieldName, field.TypeString, value) + } + if ehuo.mutation.NameCleared() { + _spec.ClearField(entityhistory.FieldName, field.TypeString) + } + if value, ok := ehuo.mutation.DisplayName(); ok { + _spec.SetField(entityhistory.FieldDisplayName, field.TypeString, value) + } + if ehuo.mutation.DisplayNameCleared() { + _spec.ClearField(entityhistory.FieldDisplayName, field.TypeString) + } + if value, ok := ehuo.mutation.Description(); ok { + _spec.SetField(entityhistory.FieldDescription, field.TypeString, value) + } + if ehuo.mutation.DescriptionCleared() { + _spec.ClearField(entityhistory.FieldDescription, field.TypeString) + } + if value, ok := ehuo.mutation.Domains(); ok { + _spec.SetField(entityhistory.FieldDomains, field.TypeJSON, value) + } + if value, ok := ehuo.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entityhistory.FieldDomains, value) + }) + } + if ehuo.mutation.DomainsCleared() { + _spec.ClearField(entityhistory.FieldDomains, field.TypeJSON) + } + if value, ok := ehuo.mutation.EntityTypeID(); ok { + _spec.SetField(entityhistory.FieldEntityTypeID, field.TypeString, value) + } + if ehuo.mutation.EntityTypeIDCleared() { + _spec.ClearField(entityhistory.FieldEntityTypeID, field.TypeString) + } + if value, ok := ehuo.mutation.Status(); ok { + _spec.SetField(entityhistory.FieldStatus, field.TypeString, value) + } + if ehuo.mutation.StatusCleared() { + _spec.ClearField(entityhistory.FieldStatus, field.TypeString) + } + _spec.Node.Schema = ehuo.schemaConfig.EntityHistory + ctx = internal.NewSchemaConfigContext(ctx, ehuo.schemaConfig) + _node = &EntityHistory{config: ehuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ehuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entityhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ehuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entitytype.go b/internal/ent/generated/entitytype.go new file mode 100644 index 0000000..f74b521 --- /dev/null +++ b/internal/ent/generated/entitytype.go @@ -0,0 +1,281 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntityType is the model entity for the EntityType schema. +type EntityType struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the entity + Name string `json:"name,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the EntityTypeQuery when eager-loading is set. + Edges EntityTypeEdges `json:"edges"` + selectValues sql.SelectValues +} + +// EntityTypeEdges holds the relations/edges for other nodes in the graph. +type EntityTypeEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Entities holds the value of the entities edge. + Entities []*Entity `json:"entities,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int + + namedEntities map[string][]*Entity +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e EntityTypeEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// EntitiesOrErr returns the Entities value or an error if the edge +// was not loaded in eager-loading. +func (e EntityTypeEdges) EntitiesOrErr() ([]*Entity, error) { + if e.loadedTypes[1] { + return e.Entities, nil + } + return nil, &NotLoadedError{edge: "entities"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntityType) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitytype.FieldTags: + values[i] = new([]byte) + case entitytype.FieldID, entitytype.FieldCreatedBy, entitytype.FieldUpdatedBy, entitytype.FieldMappingID, entitytype.FieldDeletedBy, entitytype.FieldOwnerID, entitytype.FieldName: + values[i] = new(sql.NullString) + case entitytype.FieldCreatedAt, entitytype.FieldUpdatedAt, entitytype.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntityType fields. +func (et *EntityType) 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 entitytype.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + et.ID = value.String + } + case entitytype.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + et.CreatedAt = value.Time + } + case entitytype.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + et.UpdatedAt = value.Time + } + case entitytype.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + et.CreatedBy = value.String + } + case entitytype.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + et.UpdatedBy = value.String + } + case entitytype.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + et.MappingID = value.String + } + case entitytype.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + et.DeletedAt = value.Time + } + case entitytype.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + et.DeletedBy = value.String + } + case entitytype.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &et.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitytype.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + et.OwnerID = value.String + } + case entitytype.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + et.Name = value.String + } + default: + et.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntityType. +// This includes values selected through modifiers, order, etc. +func (et *EntityType) Value(name string) (ent.Value, error) { + return et.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the EntityType entity. +func (et *EntityType) QueryOwner() *OrganizationQuery { + return NewEntityTypeClient(et.config).QueryOwner(et) +} + +// QueryEntities queries the "entities" edge of the EntityType entity. +func (et *EntityType) QueryEntities() *EntityQuery { + return NewEntityTypeClient(et.config).QueryEntities(et) +} + +// Update returns a builder for updating this EntityType. +// Note that you need to call EntityType.Unwrap() before calling this method if this EntityType +// was returned from a transaction, and the transaction was committed or rolled back. +func (et *EntityType) Update() *EntityTypeUpdateOne { + return NewEntityTypeClient(et.config).UpdateOne(et) +} + +// Unwrap unwraps the EntityType 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 (et *EntityType) Unwrap() *EntityType { + _tx, ok := et.config.driver.(*txDriver) + if !ok { + panic("generated: EntityType is not a transactional entity") + } + et.config.driver = _tx.drv + return et +} + +// String implements the fmt.Stringer. +func (et *EntityType) String() string { + var builder strings.Builder + builder.WriteString("EntityType(") + builder.WriteString(fmt.Sprintf("id=%v, ", et.ID)) + builder.WriteString("created_at=") + builder.WriteString(et.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(et.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(et.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(et.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(et.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(et.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(et.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", et.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(et.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(et.Name) + builder.WriteByte(')') + return builder.String() +} + +// NamedEntities returns the Entities named value or an error if the edge was not +// loaded in eager-loading with this name. +func (et *EntityType) NamedEntities(name string) ([]*Entity, error) { + if et.Edges.namedEntities == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := et.Edges.namedEntities[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (et *EntityType) appendNamedEntities(name string, edges ...*Entity) { + if et.Edges.namedEntities == nil { + et.Edges.namedEntities = make(map[string][]*Entity) + } + if len(edges) == 0 { + et.Edges.namedEntities[name] = []*Entity{} + } else { + et.Edges.namedEntities[name] = append(et.Edges.namedEntities[name], edges...) + } +} + +// EntityTypes is a parsable slice of EntityType. +type EntityTypes []*EntityType diff --git a/internal/ent/generated/entitytype/entitytype.go b/internal/ent/generated/entitytype/entitytype.go new file mode 100644 index 0000000..a4907f7 --- /dev/null +++ b/internal/ent/generated/entitytype/entitytype.go @@ -0,0 +1,198 @@ +// Code generated by ent, DO NOT EDIT. + +package entitytype + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the entitytype type in the database. + Label = "entity_type" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeEntities holds the string denoting the entities edge name in mutations. + EdgeEntities = "entities" + // Table holds the table name of the entitytype in the database. + Table = "entity_types" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "entity_types" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // EntitiesTable is the table that holds the entities relation/edge. + EntitiesTable = "entities" + // EntitiesInverseTable is the table name for the Entity entity. + // It exists in this package in order to avoid circular dependency with the "entity" package. + EntitiesInverseTable = "entities" + // EntitiesColumn is the table column denoting the entities relation/edge. + EntitiesColumn = "entity_type_entities" +) + +// Columns holds all SQL columns for entitytype fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldName, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the EntityType queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEntitiesCount orders the results by entities count. +func ByEntitiesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitiesStep(), opts...) + } +} + +// ByEntities orders the results by entities terms. +func ByEntities(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitiesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newEntitiesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitiesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitiesTable, EntitiesColumn), + ) +} diff --git a/internal/ent/generated/entitytype/where.go b/internal/ent/generated/entitytype/where.go new file mode 100644 index 0000000..384911c --- /dev/null +++ b/internal/ent/generated/entitytype/where.go @@ -0,0 +1,776 @@ +// Code generated by ent, DO NOT EDIT. + +package entitytype + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntityType { + return predicate.EntityType(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldName, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntityType { + return predicate.EntityType(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntityType { + return predicate.EntityType(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.EntityType { + return predicate.EntityType(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.EntityType { + return predicate.EntityType(sql.FieldContainsFold(FieldName, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.EntityType { + return predicate.EntityType(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntityType + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.EntityType { + return predicate.EntityType(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntityType + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntities applies the HasEdge predicate on the "entities" edge. +func HasEntities() predicate.EntityType { + return predicate.EntityType(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitiesTable, EntitiesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitiesWith applies the HasEdge predicate on the "entities" edge with a given conditions (other predicates). +func HasEntitiesWith(preds ...predicate.Entity) predicate.EntityType { + return predicate.EntityType(func(s *sql.Selector) { + step := newEntitiesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + 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.EntityType) predicate.EntityType { + return predicate.EntityType(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntityType) predicate.EntityType { + return predicate.EntityType(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntityType) predicate.EntityType { + return predicate.EntityType(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitytype_create.go b/internal/ent/generated/entitytype_create.go new file mode 100644 index 0000000..69169e7 --- /dev/null +++ b/internal/ent/generated/entitytype_create.go @@ -0,0 +1,465 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// EntityTypeCreate is the builder for creating a EntityType entity. +type EntityTypeCreate struct { + config + mutation *EntityTypeMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (etc *EntityTypeCreate) SetCreatedAt(t time.Time) *EntityTypeCreate { + etc.mutation.SetCreatedAt(t) + return etc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableCreatedAt(t *time.Time) *EntityTypeCreate { + if t != nil { + etc.SetCreatedAt(*t) + } + return etc +} + +// SetUpdatedAt sets the "updated_at" field. +func (etc *EntityTypeCreate) SetUpdatedAt(t time.Time) *EntityTypeCreate { + etc.mutation.SetUpdatedAt(t) + return etc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableUpdatedAt(t *time.Time) *EntityTypeCreate { + if t != nil { + etc.SetUpdatedAt(*t) + } + return etc +} + +// SetCreatedBy sets the "created_by" field. +func (etc *EntityTypeCreate) SetCreatedBy(s string) *EntityTypeCreate { + etc.mutation.SetCreatedBy(s) + return etc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableCreatedBy(s *string) *EntityTypeCreate { + if s != nil { + etc.SetCreatedBy(*s) + } + return etc +} + +// SetUpdatedBy sets the "updated_by" field. +func (etc *EntityTypeCreate) SetUpdatedBy(s string) *EntityTypeCreate { + etc.mutation.SetUpdatedBy(s) + return etc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableUpdatedBy(s *string) *EntityTypeCreate { + if s != nil { + etc.SetUpdatedBy(*s) + } + return etc +} + +// SetMappingID sets the "mapping_id" field. +func (etc *EntityTypeCreate) SetMappingID(s string) *EntityTypeCreate { + etc.mutation.SetMappingID(s) + return etc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableMappingID(s *string) *EntityTypeCreate { + if s != nil { + etc.SetMappingID(*s) + } + return etc +} + +// SetDeletedAt sets the "deleted_at" field. +func (etc *EntityTypeCreate) SetDeletedAt(t time.Time) *EntityTypeCreate { + etc.mutation.SetDeletedAt(t) + return etc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableDeletedAt(t *time.Time) *EntityTypeCreate { + if t != nil { + etc.SetDeletedAt(*t) + } + return etc +} + +// SetDeletedBy sets the "deleted_by" field. +func (etc *EntityTypeCreate) SetDeletedBy(s string) *EntityTypeCreate { + etc.mutation.SetDeletedBy(s) + return etc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableDeletedBy(s *string) *EntityTypeCreate { + if s != nil { + etc.SetDeletedBy(*s) + } + return etc +} + +// SetTags sets the "tags" field. +func (etc *EntityTypeCreate) SetTags(s []string) *EntityTypeCreate { + etc.mutation.SetTags(s) + return etc +} + +// SetOwnerID sets the "owner_id" field. +func (etc *EntityTypeCreate) SetOwnerID(s string) *EntityTypeCreate { + etc.mutation.SetOwnerID(s) + return etc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableOwnerID(s *string) *EntityTypeCreate { + if s != nil { + etc.SetOwnerID(*s) + } + return etc +} + +// SetName sets the "name" field. +func (etc *EntityTypeCreate) SetName(s string) *EntityTypeCreate { + etc.mutation.SetName(s) + return etc +} + +// SetID sets the "id" field. +func (etc *EntityTypeCreate) SetID(s string) *EntityTypeCreate { + etc.mutation.SetID(s) + return etc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (etc *EntityTypeCreate) SetNillableID(s *string) *EntityTypeCreate { + if s != nil { + etc.SetID(*s) + } + return etc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (etc *EntityTypeCreate) SetOwner(o *Organization) *EntityTypeCreate { + return etc.SetOwnerID(o.ID) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (etc *EntityTypeCreate) AddEntityIDs(ids ...string) *EntityTypeCreate { + etc.mutation.AddEntityIDs(ids...) + return etc +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (etc *EntityTypeCreate) AddEntities(e ...*Entity) *EntityTypeCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return etc.AddEntityIDs(ids...) +} + +// Mutation returns the EntityTypeMutation object of the builder. +func (etc *EntityTypeCreate) Mutation() *EntityTypeMutation { + return etc.mutation +} + +// Save creates the EntityType in the database. +func (etc *EntityTypeCreate) Save(ctx context.Context) (*EntityType, error) { + if err := etc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, etc.sqlSave, etc.mutation, etc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (etc *EntityTypeCreate) SaveX(ctx context.Context) *EntityType { + v, err := etc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (etc *EntityTypeCreate) Exec(ctx context.Context) error { + _, err := etc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (etc *EntityTypeCreate) ExecX(ctx context.Context) { + if err := etc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (etc *EntityTypeCreate) defaults() error { + if _, ok := etc.mutation.CreatedAt(); !ok { + if entitytype.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytype.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitytype.DefaultCreatedAt() + etc.mutation.SetCreatedAt(v) + } + if _, ok := etc.mutation.UpdatedAt(); !ok { + if entitytype.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytype.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitytype.DefaultUpdatedAt() + etc.mutation.SetUpdatedAt(v) + } + if _, ok := etc.mutation.MappingID(); !ok { + if entitytype.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitytype.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitytype.DefaultMappingID() + etc.mutation.SetMappingID(v) + } + if _, ok := etc.mutation.Tags(); !ok { + v := entitytype.DefaultTags + etc.mutation.SetTags(v) + } + if _, ok := etc.mutation.ID(); !ok { + if entitytype.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitytype.DefaultID (forgotten import generated/runtime?)") + } + v := entitytype.DefaultID() + etc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (etc *EntityTypeCreate) check() error { + if _, ok := etc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntityType.mapping_id"`)} + } + if v, ok := etc.mutation.OwnerID(); ok { + if err := entitytype.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntityType.owner_id": %w`, err)} + } + } + if _, ok := etc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "EntityType.name"`)} + } + if v, ok := etc.mutation.Name(); ok { + if err := entitytype.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "EntityType.name": %w`, err)} + } + } + return nil +} + +func (etc *EntityTypeCreate) sqlSave(ctx context.Context) (*EntityType, error) { + if err := etc.check(); err != nil { + return nil, err + } + _node, _spec := etc.createSpec() + if err := sqlgraph.CreateNode(ctx, etc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntityType.ID type: %T", _spec.ID.Value) + } + } + etc.mutation.id = &_node.ID + etc.mutation.done = true + return _node, nil +} + +func (etc *EntityTypeCreate) createSpec() (*EntityType, *sqlgraph.CreateSpec) { + var ( + _node = &EntityType{config: etc.config} + _spec = sqlgraph.NewCreateSpec(entitytype.Table, sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString)) + ) + _spec.Schema = etc.schemaConfig.EntityType + if id, ok := etc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := etc.mutation.CreatedAt(); ok { + _spec.SetField(entitytype.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := etc.mutation.UpdatedAt(); ok { + _spec.SetField(entitytype.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := etc.mutation.CreatedBy(); ok { + _spec.SetField(entitytype.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := etc.mutation.UpdatedBy(); ok { + _spec.SetField(entitytype.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := etc.mutation.MappingID(); ok { + _spec.SetField(entitytype.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := etc.mutation.DeletedAt(); ok { + _spec.SetField(entitytype.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := etc.mutation.DeletedBy(); ok { + _spec.SetField(entitytype.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := etc.mutation.Tags(); ok { + _spec.SetField(entitytype.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := etc.mutation.Name(); ok { + _spec.SetField(entitytype.FieldName, field.TypeString, value) + _node.Name = value + } + if nodes := etc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitytype.OwnerTable, + Columns: []string{entitytype.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = etc.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := etc.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = etc.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// EntityTypeCreateBulk is the builder for creating many EntityType entities in bulk. +type EntityTypeCreateBulk struct { + config + err error + builders []*EntityTypeCreate +} + +// Save creates the EntityType entities in the database. +func (etcb *EntityTypeCreateBulk) Save(ctx context.Context) ([]*EntityType, error) { + if etcb.err != nil { + return nil, etcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(etcb.builders)) + nodes := make([]*EntityType, len(etcb.builders)) + mutators := make([]Mutator, len(etcb.builders)) + for i := range etcb.builders { + func(i int, root context.Context) { + builder := etcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntityTypeMutation) + 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, etcb.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, etcb.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, etcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (etcb *EntityTypeCreateBulk) SaveX(ctx context.Context) []*EntityType { + v, err := etcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (etcb *EntityTypeCreateBulk) Exec(ctx context.Context) error { + _, err := etcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (etcb *EntityTypeCreateBulk) ExecX(ctx context.Context) { + if err := etcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitytype_delete.go b/internal/ent/generated/entitytype_delete.go new file mode 100644 index 0000000..c7e14c0 --- /dev/null +++ b/internal/ent/generated/entitytype_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityTypeDelete is the builder for deleting a EntityType entity. +type EntityTypeDelete struct { + config + hooks []Hook + mutation *EntityTypeMutation +} + +// Where appends a list predicates to the EntityTypeDelete builder. +func (etd *EntityTypeDelete) Where(ps ...predicate.EntityType) *EntityTypeDelete { + etd.mutation.Where(ps...) + return etd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (etd *EntityTypeDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, etd.sqlExec, etd.mutation, etd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (etd *EntityTypeDelete) ExecX(ctx context.Context) int { + n, err := etd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (etd *EntityTypeDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitytype.Table, sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString)) + _spec.Node.Schema = etd.schemaConfig.EntityType + ctx = internal.NewSchemaConfigContext(ctx, etd.schemaConfig) + if ps := etd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, etd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + etd.mutation.done = true + return affected, err +} + +// EntityTypeDeleteOne is the builder for deleting a single EntityType entity. +type EntityTypeDeleteOne struct { + etd *EntityTypeDelete +} + +// Where appends a list predicates to the EntityTypeDelete builder. +func (etdo *EntityTypeDeleteOne) Where(ps ...predicate.EntityType) *EntityTypeDeleteOne { + etdo.etd.mutation.Where(ps...) + return etdo +} + +// Exec executes the deletion query. +func (etdo *EntityTypeDeleteOne) Exec(ctx context.Context) error { + n, err := etdo.etd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitytype.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (etdo *EntityTypeDeleteOne) ExecX(ctx context.Context) { + if err := etdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitytype_query.go b/internal/ent/generated/entitytype_query.go new file mode 100644 index 0000000..935fcda --- /dev/null +++ b/internal/ent/generated/entitytype_query.go @@ -0,0 +1,739 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityTypeQuery is the builder for querying EntityType entities. +type EntityTypeQuery struct { + config + ctx *QueryContext + order []entitytype.OrderOption + inters []Interceptor + predicates []predicate.EntityType + withOwner *OrganizationQuery + withEntities *EntityQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntityType) error + withNamedEntities map[string]*EntityQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntityTypeQuery builder. +func (etq *EntityTypeQuery) Where(ps ...predicate.EntityType) *EntityTypeQuery { + etq.predicates = append(etq.predicates, ps...) + return etq +} + +// Limit the number of records to be returned by this query. +func (etq *EntityTypeQuery) Limit(limit int) *EntityTypeQuery { + etq.ctx.Limit = &limit + return etq +} + +// Offset to start from. +func (etq *EntityTypeQuery) Offset(offset int) *EntityTypeQuery { + etq.ctx.Offset = &offset + return etq +} + +// 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 (etq *EntityTypeQuery) Unique(unique bool) *EntityTypeQuery { + etq.ctx.Unique = &unique + return etq +} + +// Order specifies how the records should be ordered. +func (etq *EntityTypeQuery) Order(o ...entitytype.OrderOption) *EntityTypeQuery { + etq.order = append(etq.order, o...) + return etq +} + +// QueryOwner chains the current query on the "owner" edge. +func (etq *EntityTypeQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: etq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := etq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := etq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitytype.Table, entitytype.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, entitytype.OwnerTable, entitytype.OwnerColumn), + ) + schemaConfig := etq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.EntityType + fromU = sqlgraph.SetNeighbors(etq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntities chains the current query on the "entities" edge. +func (etq *EntityTypeQuery) QueryEntities() *EntityQuery { + query := (&EntityClient{config: etq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := etq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := etq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(entitytype.Table, entitytype.FieldID, selector), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, entitytype.EntitiesTable, entitytype.EntitiesColumn), + ) + schemaConfig := etq.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + fromU = sqlgraph.SetNeighbors(etq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first EntityType entity from the query. +// Returns a *NotFoundError when no EntityType was found. +func (etq *EntityTypeQuery) First(ctx context.Context) (*EntityType, error) { + nodes, err := etq.Limit(1).All(setContextOp(ctx, etq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitytype.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (etq *EntityTypeQuery) FirstX(ctx context.Context) *EntityType { + node, err := etq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntityType ID from the query. +// Returns a *NotFoundError when no EntityType ID was found. +func (etq *EntityTypeQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = etq.Limit(1).IDs(setContextOp(ctx, etq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitytype.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (etq *EntityTypeQuery) FirstIDX(ctx context.Context) string { + id, err := etq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntityType entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntityType entity is found. +// Returns a *NotFoundError when no EntityType entities are found. +func (etq *EntityTypeQuery) Only(ctx context.Context) (*EntityType, error) { + nodes, err := etq.Limit(2).All(setContextOp(ctx, etq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitytype.Label} + default: + return nil, &NotSingularError{entitytype.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (etq *EntityTypeQuery) OnlyX(ctx context.Context) *EntityType { + node, err := etq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntityType ID in the query. +// Returns a *NotSingularError when more than one EntityType ID is found. +// Returns a *NotFoundError when no entities are found. +func (etq *EntityTypeQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = etq.Limit(2).IDs(setContextOp(ctx, etq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitytype.Label} + default: + err = &NotSingularError{entitytype.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (etq *EntityTypeQuery) OnlyIDX(ctx context.Context) string { + id, err := etq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntityTypes. +func (etq *EntityTypeQuery) All(ctx context.Context) ([]*EntityType, error) { + ctx = setContextOp(ctx, etq.ctx, ent.OpQueryAll) + if err := etq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntityType, *EntityTypeQuery]() + return withInterceptors[[]*EntityType](ctx, etq, qr, etq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (etq *EntityTypeQuery) AllX(ctx context.Context) []*EntityType { + nodes, err := etq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntityType IDs. +func (etq *EntityTypeQuery) IDs(ctx context.Context) (ids []string, err error) { + if etq.ctx.Unique == nil && etq.path != nil { + etq.Unique(true) + } + ctx = setContextOp(ctx, etq.ctx, ent.OpQueryIDs) + if err = etq.Select(entitytype.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (etq *EntityTypeQuery) IDsX(ctx context.Context) []string { + ids, err := etq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (etq *EntityTypeQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, etq.ctx, ent.OpQueryCount) + if err := etq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, etq, querierCount[*EntityTypeQuery](), etq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (etq *EntityTypeQuery) CountX(ctx context.Context) int { + count, err := etq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (etq *EntityTypeQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, etq.ctx, ent.OpQueryExist) + switch _, err := etq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (etq *EntityTypeQuery) ExistX(ctx context.Context) bool { + exist, err := etq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntityTypeQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (etq *EntityTypeQuery) Clone() *EntityTypeQuery { + if etq == nil { + return nil + } + return &EntityTypeQuery{ + config: etq.config, + ctx: etq.ctx.Clone(), + order: append([]entitytype.OrderOption{}, etq.order...), + inters: append([]Interceptor{}, etq.inters...), + predicates: append([]predicate.EntityType{}, etq.predicates...), + withOwner: etq.withOwner.Clone(), + withEntities: etq.withEntities.Clone(), + // clone intermediate query. + sql: etq.sql.Clone(), + path: etq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (etq *EntityTypeQuery) WithOwner(opts ...func(*OrganizationQuery)) *EntityTypeQuery { + query := (&OrganizationClient{config: etq.config}).Query() + for _, opt := range opts { + opt(query) + } + etq.withOwner = query + return etq +} + +// WithEntities tells the query-builder to eager-load the nodes that are connected to +// the "entities" edge. The optional arguments are used to configure the query builder of the edge. +func (etq *EntityTypeQuery) WithEntities(opts ...func(*EntityQuery)) *EntityTypeQuery { + query := (&EntityClient{config: etq.config}).Query() + for _, opt := range opts { + opt(query) + } + etq.withEntities = query + return etq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntityType.Query(). +// GroupBy(entitytype.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (etq *EntityTypeQuery) GroupBy(field string, fields ...string) *EntityTypeGroupBy { + etq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntityTypeGroupBy{build: etq} + grbuild.flds = &etq.ctx.Fields + grbuild.label = entitytype.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.EntityType.Query(). +// Select(entitytype.FieldCreatedAt). +// Scan(ctx, &v) +func (etq *EntityTypeQuery) Select(fields ...string) *EntityTypeSelect { + etq.ctx.Fields = append(etq.ctx.Fields, fields...) + sbuild := &EntityTypeSelect{EntityTypeQuery: etq} + sbuild.label = entitytype.Label + sbuild.flds, sbuild.scan = &etq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntityTypeSelect configured with the given aggregations. +func (etq *EntityTypeQuery) Aggregate(fns ...AggregateFunc) *EntityTypeSelect { + return etq.Select().Aggregate(fns...) +} + +func (etq *EntityTypeQuery) prepareQuery(ctx context.Context) error { + for _, inter := range etq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, etq); err != nil { + return err + } + } + } + for _, f := range etq.ctx.Fields { + if !entitytype.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if etq.path != nil { + prev, err := etq.path(ctx) + if err != nil { + return err + } + etq.sql = prev + } + if entitytype.Policy == nil { + return errors.New("generated: uninitialized entitytype.Policy (forgotten import generated/runtime?)") + } + if err := entitytype.Policy.EvalQuery(ctx, etq); err != nil { + return err + } + return nil +} + +func (etq *EntityTypeQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntityType, error) { + var ( + nodes = []*EntityType{} + _spec = etq.querySpec() + loadedTypes = [2]bool{ + etq.withOwner != nil, + etq.withEntities != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntityType).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntityType{config: etq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = etq.schemaConfig.EntityType + ctx = internal.NewSchemaConfigContext(ctx, etq.schemaConfig) + if len(etq.modifiers) > 0 { + _spec.Modifiers = etq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, etq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := etq.withOwner; query != nil { + if err := etq.loadOwner(ctx, query, nodes, nil, + func(n *EntityType, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := etq.withEntities; query != nil { + if err := etq.loadEntities(ctx, query, nodes, + func(n *EntityType) { n.Edges.Entities = []*Entity{} }, + func(n *EntityType, e *Entity) { n.Edges.Entities = append(n.Edges.Entities, e) }); err != nil { + return nil, err + } + } + for name, query := range etq.withNamedEntities { + if err := etq.loadEntities(ctx, query, nodes, + func(n *EntityType) { n.appendNamedEntities(name) }, + func(n *EntityType, e *Entity) { n.appendNamedEntities(name, e) }); err != nil { + return nil, err + } + } + for i := range etq.loadTotal { + if err := etq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (etq *EntityTypeQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*EntityType, init func(*EntityType), assign func(*EntityType, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*EntityType) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (etq *EntityTypeQuery) loadEntities(ctx context.Context, query *EntityQuery, nodes []*EntityType, init func(*EntityType), assign func(*EntityType, *Entity)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*EntityType) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + query.withFKs = true + query.Where(predicate.Entity(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(entitytype.EntitiesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.entity_type_entities + if fk == nil { + return fmt.Errorf(`foreign-key "entity_type_entities" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "entity_type_entities" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (etq *EntityTypeQuery) sqlCount(ctx context.Context) (int, error) { + _spec := etq.querySpec() + _spec.Node.Schema = etq.schemaConfig.EntityType + ctx = internal.NewSchemaConfigContext(ctx, etq.schemaConfig) + if len(etq.modifiers) > 0 { + _spec.Modifiers = etq.modifiers + } + _spec.Node.Columns = etq.ctx.Fields + if len(etq.ctx.Fields) > 0 { + _spec.Unique = etq.ctx.Unique != nil && *etq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, etq.driver, _spec) +} + +func (etq *EntityTypeQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitytype.Table, entitytype.Columns, sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString)) + _spec.From = etq.sql + if unique := etq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if etq.path != nil { + _spec.Unique = true + } + if fields := etq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitytype.FieldID) + for i := range fields { + if fields[i] != entitytype.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if etq.withOwner != nil { + _spec.Node.AddColumnOnce(entitytype.FieldOwnerID) + } + } + if ps := etq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := etq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := etq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := etq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (etq *EntityTypeQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(etq.driver.Dialect()) + t1 := builder.Table(entitytype.Table) + columns := etq.ctx.Fields + if len(columns) == 0 { + columns = entitytype.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if etq.sql != nil { + selector = etq.sql + selector.Select(selector.Columns(columns...)...) + } + if etq.ctx.Unique != nil && *etq.ctx.Unique { + selector.Distinct() + } + t1.Schema(etq.schemaConfig.EntityType) + ctx = internal.NewSchemaConfigContext(ctx, etq.schemaConfig) + selector.WithContext(ctx) + for _, p := range etq.predicates { + p(selector) + } + for _, p := range etq.order { + p(selector) + } + if offset := etq.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 := etq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEntities tells the query-builder to eager-load the nodes that are connected to the "entities" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (etq *EntityTypeQuery) WithNamedEntities(name string, opts ...func(*EntityQuery)) *EntityTypeQuery { + query := (&EntityClient{config: etq.config}).Query() + for _, opt := range opts { + opt(query) + } + if etq.withNamedEntities == nil { + etq.withNamedEntities = make(map[string]*EntityQuery) + } + etq.withNamedEntities[name] = query + return etq +} + +// EntityTypeGroupBy is the group-by builder for EntityType entities. +type EntityTypeGroupBy struct { + selector + build *EntityTypeQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (etgb *EntityTypeGroupBy) Aggregate(fns ...AggregateFunc) *EntityTypeGroupBy { + etgb.fns = append(etgb.fns, fns...) + return etgb +} + +// Scan applies the selector query and scans the result into the given value. +func (etgb *EntityTypeGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, etgb.build.ctx, ent.OpQueryGroupBy) + if err := etgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityTypeQuery, *EntityTypeGroupBy](ctx, etgb.build, etgb, etgb.build.inters, v) +} + +func (etgb *EntityTypeGroupBy) sqlScan(ctx context.Context, root *EntityTypeQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(etgb.fns)) + for _, fn := range etgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*etgb.flds)+len(etgb.fns)) + for _, f := range *etgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*etgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := etgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntityTypeSelect is the builder for selecting fields of EntityType entities. +type EntityTypeSelect struct { + *EntityTypeQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ets *EntityTypeSelect) Aggregate(fns ...AggregateFunc) *EntityTypeSelect { + ets.fns = append(ets.fns, fns...) + return ets +} + +// Scan applies the selector query and scans the result into the given value. +func (ets *EntityTypeSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ets.ctx, ent.OpQuerySelect) + if err := ets.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityTypeQuery, *EntityTypeSelect](ctx, ets.EntityTypeQuery, ets, ets.inters, v) +} + +func (ets *EntityTypeSelect) sqlScan(ctx context.Context, root *EntityTypeQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ets.fns)) + for _, fn := range ets.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ets.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 := ets.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitytype_update.go b/internal/ent/generated/entitytype_update.go new file mode 100644 index 0000000..c26b491 --- /dev/null +++ b/internal/ent/generated/entitytype_update.go @@ -0,0 +1,839 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityTypeUpdate is the builder for updating EntityType entities. +type EntityTypeUpdate struct { + config + hooks []Hook + mutation *EntityTypeMutation +} + +// Where appends a list predicates to the EntityTypeUpdate builder. +func (etu *EntityTypeUpdate) Where(ps ...predicate.EntityType) *EntityTypeUpdate { + etu.mutation.Where(ps...) + return etu +} + +// SetUpdatedAt sets the "updated_at" field. +func (etu *EntityTypeUpdate) SetUpdatedAt(t time.Time) *EntityTypeUpdate { + etu.mutation.SetUpdatedAt(t) + return etu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (etu *EntityTypeUpdate) ClearUpdatedAt() *EntityTypeUpdate { + etu.mutation.ClearUpdatedAt() + return etu +} + +// SetUpdatedBy sets the "updated_by" field. +func (etu *EntityTypeUpdate) SetUpdatedBy(s string) *EntityTypeUpdate { + etu.mutation.SetUpdatedBy(s) + return etu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (etu *EntityTypeUpdate) SetNillableUpdatedBy(s *string) *EntityTypeUpdate { + if s != nil { + etu.SetUpdatedBy(*s) + } + return etu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (etu *EntityTypeUpdate) ClearUpdatedBy() *EntityTypeUpdate { + etu.mutation.ClearUpdatedBy() + return etu +} + +// SetDeletedAt sets the "deleted_at" field. +func (etu *EntityTypeUpdate) SetDeletedAt(t time.Time) *EntityTypeUpdate { + etu.mutation.SetDeletedAt(t) + return etu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (etu *EntityTypeUpdate) SetNillableDeletedAt(t *time.Time) *EntityTypeUpdate { + if t != nil { + etu.SetDeletedAt(*t) + } + return etu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (etu *EntityTypeUpdate) ClearDeletedAt() *EntityTypeUpdate { + etu.mutation.ClearDeletedAt() + return etu +} + +// SetDeletedBy sets the "deleted_by" field. +func (etu *EntityTypeUpdate) SetDeletedBy(s string) *EntityTypeUpdate { + etu.mutation.SetDeletedBy(s) + return etu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (etu *EntityTypeUpdate) SetNillableDeletedBy(s *string) *EntityTypeUpdate { + if s != nil { + etu.SetDeletedBy(*s) + } + return etu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (etu *EntityTypeUpdate) ClearDeletedBy() *EntityTypeUpdate { + etu.mutation.ClearDeletedBy() + return etu +} + +// SetTags sets the "tags" field. +func (etu *EntityTypeUpdate) SetTags(s []string) *EntityTypeUpdate { + etu.mutation.SetTags(s) + return etu +} + +// AppendTags appends s to the "tags" field. +func (etu *EntityTypeUpdate) AppendTags(s []string) *EntityTypeUpdate { + etu.mutation.AppendTags(s) + return etu +} + +// ClearTags clears the value of the "tags" field. +func (etu *EntityTypeUpdate) ClearTags() *EntityTypeUpdate { + etu.mutation.ClearTags() + return etu +} + +// SetOwnerID sets the "owner_id" field. +func (etu *EntityTypeUpdate) SetOwnerID(s string) *EntityTypeUpdate { + etu.mutation.SetOwnerID(s) + return etu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (etu *EntityTypeUpdate) SetNillableOwnerID(s *string) *EntityTypeUpdate { + if s != nil { + etu.SetOwnerID(*s) + } + return etu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (etu *EntityTypeUpdate) ClearOwnerID() *EntityTypeUpdate { + etu.mutation.ClearOwnerID() + return etu +} + +// SetName sets the "name" field. +func (etu *EntityTypeUpdate) SetName(s string) *EntityTypeUpdate { + etu.mutation.SetName(s) + return etu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (etu *EntityTypeUpdate) SetNillableName(s *string) *EntityTypeUpdate { + if s != nil { + etu.SetName(*s) + } + return etu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (etu *EntityTypeUpdate) SetOwner(o *Organization) *EntityTypeUpdate { + return etu.SetOwnerID(o.ID) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (etu *EntityTypeUpdate) AddEntityIDs(ids ...string) *EntityTypeUpdate { + etu.mutation.AddEntityIDs(ids...) + return etu +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (etu *EntityTypeUpdate) AddEntities(e ...*Entity) *EntityTypeUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return etu.AddEntityIDs(ids...) +} + +// Mutation returns the EntityTypeMutation object of the builder. +func (etu *EntityTypeUpdate) Mutation() *EntityTypeMutation { + return etu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (etu *EntityTypeUpdate) ClearOwner() *EntityTypeUpdate { + etu.mutation.ClearOwner() + return etu +} + +// ClearEntities clears all "entities" edges to the Entity entity. +func (etu *EntityTypeUpdate) ClearEntities() *EntityTypeUpdate { + etu.mutation.ClearEntities() + return etu +} + +// RemoveEntityIDs removes the "entities" edge to Entity entities by IDs. +func (etu *EntityTypeUpdate) RemoveEntityIDs(ids ...string) *EntityTypeUpdate { + etu.mutation.RemoveEntityIDs(ids...) + return etu +} + +// RemoveEntities removes "entities" edges to Entity entities. +func (etu *EntityTypeUpdate) RemoveEntities(e ...*Entity) *EntityTypeUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return etu.RemoveEntityIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (etu *EntityTypeUpdate) Save(ctx context.Context) (int, error) { + if err := etu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, etu.sqlSave, etu.mutation, etu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (etu *EntityTypeUpdate) SaveX(ctx context.Context) int { + affected, err := etu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (etu *EntityTypeUpdate) Exec(ctx context.Context) error { + _, err := etu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (etu *EntityTypeUpdate) ExecX(ctx context.Context) { + if err := etu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (etu *EntityTypeUpdate) defaults() error { + if _, ok := etu.mutation.UpdatedAt(); !ok && !etu.mutation.UpdatedAtCleared() { + if entitytype.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytype.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitytype.UpdateDefaultUpdatedAt() + etu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (etu *EntityTypeUpdate) check() error { + if v, ok := etu.mutation.OwnerID(); ok { + if err := entitytype.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntityType.owner_id": %w`, err)} + } + } + if v, ok := etu.mutation.Name(); ok { + if err := entitytype.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "EntityType.name": %w`, err)} + } + } + return nil +} + +func (etu *EntityTypeUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := etu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(entitytype.Table, entitytype.Columns, sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString)) + if ps := etu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if etu.mutation.CreatedAtCleared() { + _spec.ClearField(entitytype.FieldCreatedAt, field.TypeTime) + } + if value, ok := etu.mutation.UpdatedAt(); ok { + _spec.SetField(entitytype.FieldUpdatedAt, field.TypeTime, value) + } + if etu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitytype.FieldUpdatedAt, field.TypeTime) + } + if etu.mutation.CreatedByCleared() { + _spec.ClearField(entitytype.FieldCreatedBy, field.TypeString) + } + if value, ok := etu.mutation.UpdatedBy(); ok { + _spec.SetField(entitytype.FieldUpdatedBy, field.TypeString, value) + } + if etu.mutation.UpdatedByCleared() { + _spec.ClearField(entitytype.FieldUpdatedBy, field.TypeString) + } + if value, ok := etu.mutation.DeletedAt(); ok { + _spec.SetField(entitytype.FieldDeletedAt, field.TypeTime, value) + } + if etu.mutation.DeletedAtCleared() { + _spec.ClearField(entitytype.FieldDeletedAt, field.TypeTime) + } + if value, ok := etu.mutation.DeletedBy(); ok { + _spec.SetField(entitytype.FieldDeletedBy, field.TypeString, value) + } + if etu.mutation.DeletedByCleared() { + _spec.ClearField(entitytype.FieldDeletedBy, field.TypeString) + } + if value, ok := etu.mutation.Tags(); ok { + _spec.SetField(entitytype.FieldTags, field.TypeJSON, value) + } + if value, ok := etu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitytype.FieldTags, value) + }) + } + if etu.mutation.TagsCleared() { + _spec.ClearField(entitytype.FieldTags, field.TypeJSON) + } + if value, ok := etu.mutation.Name(); ok { + _spec.SetField(entitytype.FieldName, field.TypeString, value) + } + if etu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitytype.OwnerTable, + Columns: []string{entitytype.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = etu.schemaConfig.EntityType + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := etu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitytype.OwnerTable, + Columns: []string{entitytype.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = etu.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if etu.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = etu.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := etu.mutation.RemovedEntitiesIDs(); len(nodes) > 0 && !etu.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = etu.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := etu.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = etu.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = etu.schemaConfig.EntityType + ctx = internal.NewSchemaConfigContext(ctx, etu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, etu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitytype.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + etu.mutation.done = true + return n, nil +} + +// EntityTypeUpdateOne is the builder for updating a single EntityType entity. +type EntityTypeUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntityTypeMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (etuo *EntityTypeUpdateOne) SetUpdatedAt(t time.Time) *EntityTypeUpdateOne { + etuo.mutation.SetUpdatedAt(t) + return etuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (etuo *EntityTypeUpdateOne) ClearUpdatedAt() *EntityTypeUpdateOne { + etuo.mutation.ClearUpdatedAt() + return etuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (etuo *EntityTypeUpdateOne) SetUpdatedBy(s string) *EntityTypeUpdateOne { + etuo.mutation.SetUpdatedBy(s) + return etuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (etuo *EntityTypeUpdateOne) SetNillableUpdatedBy(s *string) *EntityTypeUpdateOne { + if s != nil { + etuo.SetUpdatedBy(*s) + } + return etuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (etuo *EntityTypeUpdateOne) ClearUpdatedBy() *EntityTypeUpdateOne { + etuo.mutation.ClearUpdatedBy() + return etuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (etuo *EntityTypeUpdateOne) SetDeletedAt(t time.Time) *EntityTypeUpdateOne { + etuo.mutation.SetDeletedAt(t) + return etuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (etuo *EntityTypeUpdateOne) SetNillableDeletedAt(t *time.Time) *EntityTypeUpdateOne { + if t != nil { + etuo.SetDeletedAt(*t) + } + return etuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (etuo *EntityTypeUpdateOne) ClearDeletedAt() *EntityTypeUpdateOne { + etuo.mutation.ClearDeletedAt() + return etuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (etuo *EntityTypeUpdateOne) SetDeletedBy(s string) *EntityTypeUpdateOne { + etuo.mutation.SetDeletedBy(s) + return etuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (etuo *EntityTypeUpdateOne) SetNillableDeletedBy(s *string) *EntityTypeUpdateOne { + if s != nil { + etuo.SetDeletedBy(*s) + } + return etuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (etuo *EntityTypeUpdateOne) ClearDeletedBy() *EntityTypeUpdateOne { + etuo.mutation.ClearDeletedBy() + return etuo +} + +// SetTags sets the "tags" field. +func (etuo *EntityTypeUpdateOne) SetTags(s []string) *EntityTypeUpdateOne { + etuo.mutation.SetTags(s) + return etuo +} + +// AppendTags appends s to the "tags" field. +func (etuo *EntityTypeUpdateOne) AppendTags(s []string) *EntityTypeUpdateOne { + etuo.mutation.AppendTags(s) + return etuo +} + +// ClearTags clears the value of the "tags" field. +func (etuo *EntityTypeUpdateOne) ClearTags() *EntityTypeUpdateOne { + etuo.mutation.ClearTags() + return etuo +} + +// SetOwnerID sets the "owner_id" field. +func (etuo *EntityTypeUpdateOne) SetOwnerID(s string) *EntityTypeUpdateOne { + etuo.mutation.SetOwnerID(s) + return etuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (etuo *EntityTypeUpdateOne) SetNillableOwnerID(s *string) *EntityTypeUpdateOne { + if s != nil { + etuo.SetOwnerID(*s) + } + return etuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (etuo *EntityTypeUpdateOne) ClearOwnerID() *EntityTypeUpdateOne { + etuo.mutation.ClearOwnerID() + return etuo +} + +// SetName sets the "name" field. +func (etuo *EntityTypeUpdateOne) SetName(s string) *EntityTypeUpdateOne { + etuo.mutation.SetName(s) + return etuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (etuo *EntityTypeUpdateOne) SetNillableName(s *string) *EntityTypeUpdateOne { + if s != nil { + etuo.SetName(*s) + } + return etuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (etuo *EntityTypeUpdateOne) SetOwner(o *Organization) *EntityTypeUpdateOne { + return etuo.SetOwnerID(o.ID) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (etuo *EntityTypeUpdateOne) AddEntityIDs(ids ...string) *EntityTypeUpdateOne { + etuo.mutation.AddEntityIDs(ids...) + return etuo +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (etuo *EntityTypeUpdateOne) AddEntities(e ...*Entity) *EntityTypeUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return etuo.AddEntityIDs(ids...) +} + +// Mutation returns the EntityTypeMutation object of the builder. +func (etuo *EntityTypeUpdateOne) Mutation() *EntityTypeMutation { + return etuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (etuo *EntityTypeUpdateOne) ClearOwner() *EntityTypeUpdateOne { + etuo.mutation.ClearOwner() + return etuo +} + +// ClearEntities clears all "entities" edges to the Entity entity. +func (etuo *EntityTypeUpdateOne) ClearEntities() *EntityTypeUpdateOne { + etuo.mutation.ClearEntities() + return etuo +} + +// RemoveEntityIDs removes the "entities" edge to Entity entities by IDs. +func (etuo *EntityTypeUpdateOne) RemoveEntityIDs(ids ...string) *EntityTypeUpdateOne { + etuo.mutation.RemoveEntityIDs(ids...) + return etuo +} + +// RemoveEntities removes "entities" edges to Entity entities. +func (etuo *EntityTypeUpdateOne) RemoveEntities(e ...*Entity) *EntityTypeUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return etuo.RemoveEntityIDs(ids...) +} + +// Where appends a list predicates to the EntityTypeUpdate builder. +func (etuo *EntityTypeUpdateOne) Where(ps ...predicate.EntityType) *EntityTypeUpdateOne { + etuo.mutation.Where(ps...) + return etuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (etuo *EntityTypeUpdateOne) Select(field string, fields ...string) *EntityTypeUpdateOne { + etuo.fields = append([]string{field}, fields...) + return etuo +} + +// Save executes the query and returns the updated EntityType entity. +func (etuo *EntityTypeUpdateOne) Save(ctx context.Context) (*EntityType, error) { + if err := etuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, etuo.sqlSave, etuo.mutation, etuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (etuo *EntityTypeUpdateOne) SaveX(ctx context.Context) *EntityType { + node, err := etuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (etuo *EntityTypeUpdateOne) Exec(ctx context.Context) error { + _, err := etuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (etuo *EntityTypeUpdateOne) ExecX(ctx context.Context) { + if err := etuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (etuo *EntityTypeUpdateOne) defaults() error { + if _, ok := etuo.mutation.UpdatedAt(); !ok && !etuo.mutation.UpdatedAtCleared() { + if entitytype.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytype.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitytype.UpdateDefaultUpdatedAt() + etuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (etuo *EntityTypeUpdateOne) check() error { + if v, ok := etuo.mutation.OwnerID(); ok { + if err := entitytype.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "EntityType.owner_id": %w`, err)} + } + } + if v, ok := etuo.mutation.Name(); ok { + if err := entitytype.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "EntityType.name": %w`, err)} + } + } + return nil +} + +func (etuo *EntityTypeUpdateOne) sqlSave(ctx context.Context) (_node *EntityType, err error) { + if err := etuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(entitytype.Table, entitytype.Columns, sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString)) + id, ok := etuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntityType.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := etuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitytype.FieldID) + for _, f := range fields { + if !entitytype.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitytype.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := etuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if etuo.mutation.CreatedAtCleared() { + _spec.ClearField(entitytype.FieldCreatedAt, field.TypeTime) + } + if value, ok := etuo.mutation.UpdatedAt(); ok { + _spec.SetField(entitytype.FieldUpdatedAt, field.TypeTime, value) + } + if etuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitytype.FieldUpdatedAt, field.TypeTime) + } + if etuo.mutation.CreatedByCleared() { + _spec.ClearField(entitytype.FieldCreatedBy, field.TypeString) + } + if value, ok := etuo.mutation.UpdatedBy(); ok { + _spec.SetField(entitytype.FieldUpdatedBy, field.TypeString, value) + } + if etuo.mutation.UpdatedByCleared() { + _spec.ClearField(entitytype.FieldUpdatedBy, field.TypeString) + } + if value, ok := etuo.mutation.DeletedAt(); ok { + _spec.SetField(entitytype.FieldDeletedAt, field.TypeTime, value) + } + if etuo.mutation.DeletedAtCleared() { + _spec.ClearField(entitytype.FieldDeletedAt, field.TypeTime) + } + if value, ok := etuo.mutation.DeletedBy(); ok { + _spec.SetField(entitytype.FieldDeletedBy, field.TypeString, value) + } + if etuo.mutation.DeletedByCleared() { + _spec.ClearField(entitytype.FieldDeletedBy, field.TypeString) + } + if value, ok := etuo.mutation.Tags(); ok { + _spec.SetField(entitytype.FieldTags, field.TypeJSON, value) + } + if value, ok := etuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitytype.FieldTags, value) + }) + } + if etuo.mutation.TagsCleared() { + _spec.ClearField(entitytype.FieldTags, field.TypeJSON) + } + if value, ok := etuo.mutation.Name(); ok { + _spec.SetField(entitytype.FieldName, field.TypeString, value) + } + if etuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitytype.OwnerTable, + Columns: []string{entitytype.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = etuo.schemaConfig.EntityType + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := etuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitytype.OwnerTable, + Columns: []string{entitytype.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = etuo.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if etuo.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = etuo.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := etuo.mutation.RemovedEntitiesIDs(); len(nodes) > 0 && !etuo.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = etuo.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := etuo.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = etuo.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = etuo.schemaConfig.EntityType + ctx = internal.NewSchemaConfigContext(ctx, etuo.schemaConfig) + _node = &EntityType{config: etuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, etuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitytype.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + etuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entitytypehistory.go b/internal/ent/generated/entitytypehistory.go new file mode 100644 index 0000000..eec8efe --- /dev/null +++ b/internal/ent/generated/entitytypehistory.go @@ -0,0 +1,244 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/entx/history" +) + +// EntityTypeHistory is the model entity for the EntityTypeHistory schema. +type EntityTypeHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the entity + Name string `json:"name,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EntityTypeHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case entitytypehistory.FieldTags: + values[i] = new([]byte) + case entitytypehistory.FieldOperation: + values[i] = new(history.OpType) + case entitytypehistory.FieldID, entitytypehistory.FieldRef, entitytypehistory.FieldCreatedBy, entitytypehistory.FieldUpdatedBy, entitytypehistory.FieldMappingID, entitytypehistory.FieldDeletedBy, entitytypehistory.FieldOwnerID, entitytypehistory.FieldName: + values[i] = new(sql.NullString) + case entitytypehistory.FieldHistoryTime, entitytypehistory.FieldCreatedAt, entitytypehistory.FieldUpdatedAt, entitytypehistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EntityTypeHistory fields. +func (eth *EntityTypeHistory) 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 entitytypehistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + eth.ID = value.String + } + case entitytypehistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + eth.HistoryTime = value.Time + } + case entitytypehistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + eth.Ref = value.String + } + case entitytypehistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + eth.Operation = *value + } + case entitytypehistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + eth.CreatedAt = value.Time + } + case entitytypehistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + eth.UpdatedAt = value.Time + } + case entitytypehistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + eth.CreatedBy = value.String + } + case entitytypehistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + eth.UpdatedBy = value.String + } + case entitytypehistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + eth.MappingID = value.String + } + case entitytypehistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + eth.DeletedAt = value.Time + } + case entitytypehistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + eth.DeletedBy = value.String + } + case entitytypehistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, ð.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case entitytypehistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + eth.OwnerID = value.String + } + case entitytypehistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + eth.Name = value.String + } + default: + eth.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EntityTypeHistory. +// This includes values selected through modifiers, order, etc. +func (eth *EntityTypeHistory) Value(name string) (ent.Value, error) { + return eth.selectValues.Get(name) +} + +// Update returns a builder for updating this EntityTypeHistory. +// Note that you need to call EntityTypeHistory.Unwrap() before calling this method if this EntityTypeHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (eth *EntityTypeHistory) Update() *EntityTypeHistoryUpdateOne { + return NewEntityTypeHistoryClient(eth.config).UpdateOne(eth) +} + +// Unwrap unwraps the EntityTypeHistory 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 (eth *EntityTypeHistory) Unwrap() *EntityTypeHistory { + _tx, ok := eth.config.driver.(*txDriver) + if !ok { + panic("generated: EntityTypeHistory is not a transactional entity") + } + eth.config.driver = _tx.drv + return eth +} + +// String implements the fmt.Stringer. +func (eth *EntityTypeHistory) String() string { + var builder strings.Builder + builder.WriteString("EntityTypeHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", eth.ID)) + builder.WriteString("history_time=") + builder.WriteString(eth.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(eth.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", eth.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(eth.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(eth.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(eth.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(eth.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(eth.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(eth.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(eth.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", eth.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(eth.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(eth.Name) + builder.WriteByte(')') + return builder.String() +} + +// EntityTypeHistories is a parsable slice of EntityTypeHistory. +type EntityTypeHistories []*EntityTypeHistory diff --git a/internal/ent/generated/entitytypehistory/entitytypehistory.go b/internal/ent/generated/entitytypehistory/entitytypehistory.go new file mode 100644 index 0000000..e9d68f7 --- /dev/null +++ b/internal/ent/generated/entitytypehistory/entitytypehistory.go @@ -0,0 +1,186 @@ +// Code generated by ent, DO NOT EDIT. + +package entitytypehistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the entitytypehistory type in the database. + Label = "entity_type_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // Table holds the table name of the entitytypehistory in the database. + Table = "entity_type_history" +) + +// Columns holds all SQL columns for entitytypehistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldName, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("entitytypehistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the EntityTypeHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/entitytypehistory/where.go b/internal/ent/generated/entitytypehistory/where.go new file mode 100644 index 0000000..6293828 --- /dev/null +++ b/internal/ent/generated/entitytypehistory/where.go @@ -0,0 +1,861 @@ +// Code generated by ent, DO NOT EDIT. + +package entitytypehistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldName, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.FieldContainsFold(FieldName, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.EntityTypeHistory) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EntityTypeHistory) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EntityTypeHistory) predicate.EntityTypeHistory { + return predicate.EntityTypeHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/entitytypehistory_create.go b/internal/ent/generated/entitytypehistory_create.go new file mode 100644 index 0000000..c821b4c --- /dev/null +++ b/internal/ent/generated/entitytypehistory_create.go @@ -0,0 +1,467 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/entx/history" +) + +// EntityTypeHistoryCreate is the builder for creating a EntityTypeHistory entity. +type EntityTypeHistoryCreate struct { + config + mutation *EntityTypeHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ethc *EntityTypeHistoryCreate) SetHistoryTime(t time.Time) *EntityTypeHistoryCreate { + ethc.mutation.SetHistoryTime(t) + return ethc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableHistoryTime(t *time.Time) *EntityTypeHistoryCreate { + if t != nil { + ethc.SetHistoryTime(*t) + } + return ethc +} + +// SetRef sets the "ref" field. +func (ethc *EntityTypeHistoryCreate) SetRef(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetRef(s) + return ethc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableRef(s *string) *EntityTypeHistoryCreate { + if s != nil { + ethc.SetRef(*s) + } + return ethc +} + +// SetOperation sets the "operation" field. +func (ethc *EntityTypeHistoryCreate) SetOperation(ht history.OpType) *EntityTypeHistoryCreate { + ethc.mutation.SetOperation(ht) + return ethc +} + +// SetCreatedAt sets the "created_at" field. +func (ethc *EntityTypeHistoryCreate) SetCreatedAt(t time.Time) *EntityTypeHistoryCreate { + ethc.mutation.SetCreatedAt(t) + return ethc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableCreatedAt(t *time.Time) *EntityTypeHistoryCreate { + if t != nil { + ethc.SetCreatedAt(*t) + } + return ethc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ethc *EntityTypeHistoryCreate) SetUpdatedAt(t time.Time) *EntityTypeHistoryCreate { + ethc.mutation.SetUpdatedAt(t) + return ethc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableUpdatedAt(t *time.Time) *EntityTypeHistoryCreate { + if t != nil { + ethc.SetUpdatedAt(*t) + } + return ethc +} + +// SetCreatedBy sets the "created_by" field. +func (ethc *EntityTypeHistoryCreate) SetCreatedBy(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetCreatedBy(s) + return ethc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableCreatedBy(s *string) *EntityTypeHistoryCreate { + if s != nil { + ethc.SetCreatedBy(*s) + } + return ethc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ethc *EntityTypeHistoryCreate) SetUpdatedBy(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetUpdatedBy(s) + return ethc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableUpdatedBy(s *string) *EntityTypeHistoryCreate { + if s != nil { + ethc.SetUpdatedBy(*s) + } + return ethc +} + +// SetMappingID sets the "mapping_id" field. +func (ethc *EntityTypeHistoryCreate) SetMappingID(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetMappingID(s) + return ethc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableMappingID(s *string) *EntityTypeHistoryCreate { + if s != nil { + ethc.SetMappingID(*s) + } + return ethc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ethc *EntityTypeHistoryCreate) SetDeletedAt(t time.Time) *EntityTypeHistoryCreate { + ethc.mutation.SetDeletedAt(t) + return ethc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableDeletedAt(t *time.Time) *EntityTypeHistoryCreate { + if t != nil { + ethc.SetDeletedAt(*t) + } + return ethc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ethc *EntityTypeHistoryCreate) SetDeletedBy(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetDeletedBy(s) + return ethc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableDeletedBy(s *string) *EntityTypeHistoryCreate { + if s != nil { + ethc.SetDeletedBy(*s) + } + return ethc +} + +// SetTags sets the "tags" field. +func (ethc *EntityTypeHistoryCreate) SetTags(s []string) *EntityTypeHistoryCreate { + ethc.mutation.SetTags(s) + return ethc +} + +// SetOwnerID sets the "owner_id" field. +func (ethc *EntityTypeHistoryCreate) SetOwnerID(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetOwnerID(s) + return ethc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableOwnerID(s *string) *EntityTypeHistoryCreate { + if s != nil { + ethc.SetOwnerID(*s) + } + return ethc +} + +// SetName sets the "name" field. +func (ethc *EntityTypeHistoryCreate) SetName(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetName(s) + return ethc +} + +// SetID sets the "id" field. +func (ethc *EntityTypeHistoryCreate) SetID(s string) *EntityTypeHistoryCreate { + ethc.mutation.SetID(s) + return ethc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ethc *EntityTypeHistoryCreate) SetNillableID(s *string) *EntityTypeHistoryCreate { + if s != nil { + ethc.SetID(*s) + } + return ethc +} + +// Mutation returns the EntityTypeHistoryMutation object of the builder. +func (ethc *EntityTypeHistoryCreate) Mutation() *EntityTypeHistoryMutation { + return ethc.mutation +} + +// Save creates the EntityTypeHistory in the database. +func (ethc *EntityTypeHistoryCreate) Save(ctx context.Context) (*EntityTypeHistory, error) { + if err := ethc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ethc.sqlSave, ethc.mutation, ethc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ethc *EntityTypeHistoryCreate) SaveX(ctx context.Context) *EntityTypeHistory { + v, err := ethc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ethc *EntityTypeHistoryCreate) Exec(ctx context.Context) error { + _, err := ethc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ethc *EntityTypeHistoryCreate) ExecX(ctx context.Context) { + if err := ethc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ethc *EntityTypeHistoryCreate) defaults() error { + if _, ok := ethc.mutation.HistoryTime(); !ok { + if entitytypehistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized entitytypehistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := entitytypehistory.DefaultHistoryTime() + ethc.mutation.SetHistoryTime(v) + } + if _, ok := ethc.mutation.CreatedAt(); !ok { + if entitytypehistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytypehistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := entitytypehistory.DefaultCreatedAt() + ethc.mutation.SetCreatedAt(v) + } + if _, ok := ethc.mutation.UpdatedAt(); !ok { + if entitytypehistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytypehistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitytypehistory.DefaultUpdatedAt() + ethc.mutation.SetUpdatedAt(v) + } + if _, ok := ethc.mutation.MappingID(); !ok { + if entitytypehistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized entitytypehistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := entitytypehistory.DefaultMappingID() + ethc.mutation.SetMappingID(v) + } + if _, ok := ethc.mutation.Tags(); !ok { + v := entitytypehistory.DefaultTags + ethc.mutation.SetTags(v) + } + if _, ok := ethc.mutation.ID(); !ok { + if entitytypehistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized entitytypehistory.DefaultID (forgotten import generated/runtime?)") + } + v := entitytypehistory.DefaultID() + ethc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ethc *EntityTypeHistoryCreate) check() error { + if _, ok := ethc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "EntityTypeHistory.history_time"`)} + } + if _, ok := ethc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "EntityTypeHistory.operation"`)} + } + if v, ok := ethc.mutation.Operation(); ok { + if err := entitytypehistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "EntityTypeHistory.operation": %w`, err)} + } + } + if _, ok := ethc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EntityTypeHistory.mapping_id"`)} + } + if _, ok := ethc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "EntityTypeHistory.name"`)} + } + return nil +} + +func (ethc *EntityTypeHistoryCreate) sqlSave(ctx context.Context) (*EntityTypeHistory, error) { + if err := ethc.check(); err != nil { + return nil, err + } + _node, _spec := ethc.createSpec() + if err := sqlgraph.CreateNode(ctx, ethc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EntityTypeHistory.ID type: %T", _spec.ID.Value) + } + } + ethc.mutation.id = &_node.ID + ethc.mutation.done = true + return _node, nil +} + +func (ethc *EntityTypeHistoryCreate) createSpec() (*EntityTypeHistory, *sqlgraph.CreateSpec) { + var ( + _node = &EntityTypeHistory{config: ethc.config} + _spec = sqlgraph.NewCreateSpec(entitytypehistory.Table, sqlgraph.NewFieldSpec(entitytypehistory.FieldID, field.TypeString)) + ) + _spec.Schema = ethc.schemaConfig.EntityTypeHistory + if id, ok := ethc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ethc.mutation.HistoryTime(); ok { + _spec.SetField(entitytypehistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ethc.mutation.Ref(); ok { + _spec.SetField(entitytypehistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ethc.mutation.Operation(); ok { + _spec.SetField(entitytypehistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ethc.mutation.CreatedAt(); ok { + _spec.SetField(entitytypehistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ethc.mutation.UpdatedAt(); ok { + _spec.SetField(entitytypehistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ethc.mutation.CreatedBy(); ok { + _spec.SetField(entitytypehistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ethc.mutation.UpdatedBy(); ok { + _spec.SetField(entitytypehistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ethc.mutation.MappingID(); ok { + _spec.SetField(entitytypehistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ethc.mutation.DeletedAt(); ok { + _spec.SetField(entitytypehistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ethc.mutation.DeletedBy(); ok { + _spec.SetField(entitytypehistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ethc.mutation.Tags(); ok { + _spec.SetField(entitytypehistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ethc.mutation.OwnerID(); ok { + _spec.SetField(entitytypehistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ethc.mutation.Name(); ok { + _spec.SetField(entitytypehistory.FieldName, field.TypeString, value) + _node.Name = value + } + return _node, _spec +} + +// EntityTypeHistoryCreateBulk is the builder for creating many EntityTypeHistory entities in bulk. +type EntityTypeHistoryCreateBulk struct { + config + err error + builders []*EntityTypeHistoryCreate +} + +// Save creates the EntityTypeHistory entities in the database. +func (ethcb *EntityTypeHistoryCreateBulk) Save(ctx context.Context) ([]*EntityTypeHistory, error) { + if ethcb.err != nil { + return nil, ethcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ethcb.builders)) + nodes := make([]*EntityTypeHistory, len(ethcb.builders)) + mutators := make([]Mutator, len(ethcb.builders)) + for i := range ethcb.builders { + func(i int, root context.Context) { + builder := ethcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EntityTypeHistoryMutation) + 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, ethcb.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, ethcb.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, ethcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ethcb *EntityTypeHistoryCreateBulk) SaveX(ctx context.Context) []*EntityTypeHistory { + v, err := ethcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ethcb *EntityTypeHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ethcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ethcb *EntityTypeHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ethcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitytypehistory_delete.go b/internal/ent/generated/entitytypehistory_delete.go new file mode 100644 index 0000000..4126000 --- /dev/null +++ b/internal/ent/generated/entitytypehistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityTypeHistoryDelete is the builder for deleting a EntityTypeHistory entity. +type EntityTypeHistoryDelete struct { + config + hooks []Hook + mutation *EntityTypeHistoryMutation +} + +// Where appends a list predicates to the EntityTypeHistoryDelete builder. +func (ethd *EntityTypeHistoryDelete) Where(ps ...predicate.EntityTypeHistory) *EntityTypeHistoryDelete { + ethd.mutation.Where(ps...) + return ethd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ethd *EntityTypeHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ethd.sqlExec, ethd.mutation, ethd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ethd *EntityTypeHistoryDelete) ExecX(ctx context.Context) int { + n, err := ethd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ethd *EntityTypeHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(entitytypehistory.Table, sqlgraph.NewFieldSpec(entitytypehistory.FieldID, field.TypeString)) + _spec.Node.Schema = ethd.schemaConfig.EntityTypeHistory + ctx = internal.NewSchemaConfigContext(ctx, ethd.schemaConfig) + if ps := ethd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ethd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ethd.mutation.done = true + return affected, err +} + +// EntityTypeHistoryDeleteOne is the builder for deleting a single EntityTypeHistory entity. +type EntityTypeHistoryDeleteOne struct { + ethd *EntityTypeHistoryDelete +} + +// Where appends a list predicates to the EntityTypeHistoryDelete builder. +func (ethdo *EntityTypeHistoryDeleteOne) Where(ps ...predicate.EntityTypeHistory) *EntityTypeHistoryDeleteOne { + ethdo.ethd.mutation.Where(ps...) + return ethdo +} + +// Exec executes the deletion query. +func (ethdo *EntityTypeHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ethdo.ethd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{entitytypehistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ethdo *EntityTypeHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ethdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/entitytypehistory_query.go b/internal/ent/generated/entitytypehistory_query.go new file mode 100644 index 0000000..61328ac --- /dev/null +++ b/internal/ent/generated/entitytypehistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityTypeHistoryQuery is the builder for querying EntityTypeHistory entities. +type EntityTypeHistoryQuery struct { + config + ctx *QueryContext + order []entitytypehistory.OrderOption + inters []Interceptor + predicates []predicate.EntityTypeHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EntityTypeHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EntityTypeHistoryQuery builder. +func (ethq *EntityTypeHistoryQuery) Where(ps ...predicate.EntityTypeHistory) *EntityTypeHistoryQuery { + ethq.predicates = append(ethq.predicates, ps...) + return ethq +} + +// Limit the number of records to be returned by this query. +func (ethq *EntityTypeHistoryQuery) Limit(limit int) *EntityTypeHistoryQuery { + ethq.ctx.Limit = &limit + return ethq +} + +// Offset to start from. +func (ethq *EntityTypeHistoryQuery) Offset(offset int) *EntityTypeHistoryQuery { + ethq.ctx.Offset = &offset + return ethq +} + +// 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 (ethq *EntityTypeHistoryQuery) Unique(unique bool) *EntityTypeHistoryQuery { + ethq.ctx.Unique = &unique + return ethq +} + +// Order specifies how the records should be ordered. +func (ethq *EntityTypeHistoryQuery) Order(o ...entitytypehistory.OrderOption) *EntityTypeHistoryQuery { + ethq.order = append(ethq.order, o...) + return ethq +} + +// First returns the first EntityTypeHistory entity from the query. +// Returns a *NotFoundError when no EntityTypeHistory was found. +func (ethq *EntityTypeHistoryQuery) First(ctx context.Context) (*EntityTypeHistory, error) { + nodes, err := ethq.Limit(1).All(setContextOp(ctx, ethq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{entitytypehistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) FirstX(ctx context.Context) *EntityTypeHistory { + node, err := ethq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EntityTypeHistory ID from the query. +// Returns a *NotFoundError when no EntityTypeHistory ID was found. +func (ethq *EntityTypeHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ethq.Limit(1).IDs(setContextOp(ctx, ethq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{entitytypehistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ethq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EntityTypeHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EntityTypeHistory entity is found. +// Returns a *NotFoundError when no EntityTypeHistory entities are found. +func (ethq *EntityTypeHistoryQuery) Only(ctx context.Context) (*EntityTypeHistory, error) { + nodes, err := ethq.Limit(2).All(setContextOp(ctx, ethq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{entitytypehistory.Label} + default: + return nil, &NotSingularError{entitytypehistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) OnlyX(ctx context.Context) *EntityTypeHistory { + node, err := ethq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EntityTypeHistory ID in the query. +// Returns a *NotSingularError when more than one EntityTypeHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ethq *EntityTypeHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ethq.Limit(2).IDs(setContextOp(ctx, ethq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{entitytypehistory.Label} + default: + err = &NotSingularError{entitytypehistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ethq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EntityTypeHistories. +func (ethq *EntityTypeHistoryQuery) All(ctx context.Context) ([]*EntityTypeHistory, error) { + ctx = setContextOp(ctx, ethq.ctx, ent.OpQueryAll) + if err := ethq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EntityTypeHistory, *EntityTypeHistoryQuery]() + return withInterceptors[[]*EntityTypeHistory](ctx, ethq, qr, ethq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) AllX(ctx context.Context) []*EntityTypeHistory { + nodes, err := ethq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EntityTypeHistory IDs. +func (ethq *EntityTypeHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ethq.ctx.Unique == nil && ethq.path != nil { + ethq.Unique(true) + } + ctx = setContextOp(ctx, ethq.ctx, ent.OpQueryIDs) + if err = ethq.Select(entitytypehistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ethq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ethq *EntityTypeHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ethq.ctx, ent.OpQueryCount) + if err := ethq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ethq, querierCount[*EntityTypeHistoryQuery](), ethq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) CountX(ctx context.Context) int { + count, err := ethq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ethq *EntityTypeHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ethq.ctx, ent.OpQueryExist) + switch _, err := ethq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ethq *EntityTypeHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ethq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EntityTypeHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ethq *EntityTypeHistoryQuery) Clone() *EntityTypeHistoryQuery { + if ethq == nil { + return nil + } + return &EntityTypeHistoryQuery{ + config: ethq.config, + ctx: ethq.ctx.Clone(), + order: append([]entitytypehistory.OrderOption{}, ethq.order...), + inters: append([]Interceptor{}, ethq.inters...), + predicates: append([]predicate.EntityTypeHistory{}, ethq.predicates...), + // clone intermediate query. + sql: ethq.sql.Clone(), + path: ethq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EntityTypeHistory.Query(). +// GroupBy(entitytypehistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ethq *EntityTypeHistoryQuery) GroupBy(field string, fields ...string) *EntityTypeHistoryGroupBy { + ethq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EntityTypeHistoryGroupBy{build: ethq} + grbuild.flds = ðq.ctx.Fields + grbuild.label = entitytypehistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.EntityTypeHistory.Query(). +// Select(entitytypehistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ethq *EntityTypeHistoryQuery) Select(fields ...string) *EntityTypeHistorySelect { + ethq.ctx.Fields = append(ethq.ctx.Fields, fields...) + sbuild := &EntityTypeHistorySelect{EntityTypeHistoryQuery: ethq} + sbuild.label = entitytypehistory.Label + sbuild.flds, sbuild.scan = ðq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EntityTypeHistorySelect configured with the given aggregations. +func (ethq *EntityTypeHistoryQuery) Aggregate(fns ...AggregateFunc) *EntityTypeHistorySelect { + return ethq.Select().Aggregate(fns...) +} + +func (ethq *EntityTypeHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ethq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ethq); err != nil { + return err + } + } + } + for _, f := range ethq.ctx.Fields { + if !entitytypehistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ethq.path != nil { + prev, err := ethq.path(ctx) + if err != nil { + return err + } + ethq.sql = prev + } + if entitytypehistory.Policy == nil { + return errors.New("generated: uninitialized entitytypehistory.Policy (forgotten import generated/runtime?)") + } + if err := entitytypehistory.Policy.EvalQuery(ctx, ethq); err != nil { + return err + } + return nil +} + +func (ethq *EntityTypeHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EntityTypeHistory, error) { + var ( + nodes = []*EntityTypeHistory{} + _spec = ethq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EntityTypeHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EntityTypeHistory{config: ethq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ethq.schemaConfig.EntityTypeHistory + ctx = internal.NewSchemaConfigContext(ctx, ethq.schemaConfig) + if len(ethq.modifiers) > 0 { + _spec.Modifiers = ethq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ethq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ethq.loadTotal { + if err := ethq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ethq *EntityTypeHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ethq.querySpec() + _spec.Node.Schema = ethq.schemaConfig.EntityTypeHistory + ctx = internal.NewSchemaConfigContext(ctx, ethq.schemaConfig) + if len(ethq.modifiers) > 0 { + _spec.Modifiers = ethq.modifiers + } + _spec.Node.Columns = ethq.ctx.Fields + if len(ethq.ctx.Fields) > 0 { + _spec.Unique = ethq.ctx.Unique != nil && *ethq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ethq.driver, _spec) +} + +func (ethq *EntityTypeHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(entitytypehistory.Table, entitytypehistory.Columns, sqlgraph.NewFieldSpec(entitytypehistory.FieldID, field.TypeString)) + _spec.From = ethq.sql + if unique := ethq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ethq.path != nil { + _spec.Unique = true + } + if fields := ethq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitytypehistory.FieldID) + for i := range fields { + if fields[i] != entitytypehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ethq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ethq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ethq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ethq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ethq *EntityTypeHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ethq.driver.Dialect()) + t1 := builder.Table(entitytypehistory.Table) + columns := ethq.ctx.Fields + if len(columns) == 0 { + columns = entitytypehistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ethq.sql != nil { + selector = ethq.sql + selector.Select(selector.Columns(columns...)...) + } + if ethq.ctx.Unique != nil && *ethq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ethq.schemaConfig.EntityTypeHistory) + ctx = internal.NewSchemaConfigContext(ctx, ethq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ethq.predicates { + p(selector) + } + for _, p := range ethq.order { + p(selector) + } + if offset := ethq.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 := ethq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// EntityTypeHistoryGroupBy is the group-by builder for EntityTypeHistory entities. +type EntityTypeHistoryGroupBy struct { + selector + build *EntityTypeHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ethgb *EntityTypeHistoryGroupBy) Aggregate(fns ...AggregateFunc) *EntityTypeHistoryGroupBy { + ethgb.fns = append(ethgb.fns, fns...) + return ethgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ethgb *EntityTypeHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ethgb.build.ctx, ent.OpQueryGroupBy) + if err := ethgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityTypeHistoryQuery, *EntityTypeHistoryGroupBy](ctx, ethgb.build, ethgb, ethgb.build.inters, v) +} + +func (ethgb *EntityTypeHistoryGroupBy) sqlScan(ctx context.Context, root *EntityTypeHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ethgb.fns)) + for _, fn := range ethgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ethgb.flds)+len(ethgb.fns)) + for _, f := range *ethgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ethgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ethgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EntityTypeHistorySelect is the builder for selecting fields of EntityTypeHistory entities. +type EntityTypeHistorySelect struct { + *EntityTypeHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (eths *EntityTypeHistorySelect) Aggregate(fns ...AggregateFunc) *EntityTypeHistorySelect { + eths.fns = append(eths.fns, fns...) + return eths +} + +// Scan applies the selector query and scans the result into the given value. +func (eths *EntityTypeHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, eths.ctx, ent.OpQuerySelect) + if err := eths.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EntityTypeHistoryQuery, *EntityTypeHistorySelect](ctx, eths.EntityTypeHistoryQuery, eths, eths.inters, v) +} + +func (eths *EntityTypeHistorySelect) sqlScan(ctx context.Context, root *EntityTypeHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(eths.fns)) + for _, fn := range eths.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*eths.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 := eths.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/entitytypehistory_update.go b/internal/ent/generated/entitytypehistory_update.go new file mode 100644 index 0000000..90437d7 --- /dev/null +++ b/internal/ent/generated/entitytypehistory_update.go @@ -0,0 +1,567 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EntityTypeHistoryUpdate is the builder for updating EntityTypeHistory entities. +type EntityTypeHistoryUpdate struct { + config + hooks []Hook + mutation *EntityTypeHistoryMutation +} + +// Where appends a list predicates to the EntityTypeHistoryUpdate builder. +func (ethu *EntityTypeHistoryUpdate) Where(ps ...predicate.EntityTypeHistory) *EntityTypeHistoryUpdate { + ethu.mutation.Where(ps...) + return ethu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ethu *EntityTypeHistoryUpdate) SetUpdatedAt(t time.Time) *EntityTypeHistoryUpdate { + ethu.mutation.SetUpdatedAt(t) + return ethu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ethu *EntityTypeHistoryUpdate) ClearUpdatedAt() *EntityTypeHistoryUpdate { + ethu.mutation.ClearUpdatedAt() + return ethu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ethu *EntityTypeHistoryUpdate) SetUpdatedBy(s string) *EntityTypeHistoryUpdate { + ethu.mutation.SetUpdatedBy(s) + return ethu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ethu *EntityTypeHistoryUpdate) SetNillableUpdatedBy(s *string) *EntityTypeHistoryUpdate { + if s != nil { + ethu.SetUpdatedBy(*s) + } + return ethu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ethu *EntityTypeHistoryUpdate) ClearUpdatedBy() *EntityTypeHistoryUpdate { + ethu.mutation.ClearUpdatedBy() + return ethu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ethu *EntityTypeHistoryUpdate) SetDeletedAt(t time.Time) *EntityTypeHistoryUpdate { + ethu.mutation.SetDeletedAt(t) + return ethu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ethu *EntityTypeHistoryUpdate) SetNillableDeletedAt(t *time.Time) *EntityTypeHistoryUpdate { + if t != nil { + ethu.SetDeletedAt(*t) + } + return ethu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ethu *EntityTypeHistoryUpdate) ClearDeletedAt() *EntityTypeHistoryUpdate { + ethu.mutation.ClearDeletedAt() + return ethu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ethu *EntityTypeHistoryUpdate) SetDeletedBy(s string) *EntityTypeHistoryUpdate { + ethu.mutation.SetDeletedBy(s) + return ethu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ethu *EntityTypeHistoryUpdate) SetNillableDeletedBy(s *string) *EntityTypeHistoryUpdate { + if s != nil { + ethu.SetDeletedBy(*s) + } + return ethu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ethu *EntityTypeHistoryUpdate) ClearDeletedBy() *EntityTypeHistoryUpdate { + ethu.mutation.ClearDeletedBy() + return ethu +} + +// SetTags sets the "tags" field. +func (ethu *EntityTypeHistoryUpdate) SetTags(s []string) *EntityTypeHistoryUpdate { + ethu.mutation.SetTags(s) + return ethu +} + +// AppendTags appends s to the "tags" field. +func (ethu *EntityTypeHistoryUpdate) AppendTags(s []string) *EntityTypeHistoryUpdate { + ethu.mutation.AppendTags(s) + return ethu +} + +// ClearTags clears the value of the "tags" field. +func (ethu *EntityTypeHistoryUpdate) ClearTags() *EntityTypeHistoryUpdate { + ethu.mutation.ClearTags() + return ethu +} + +// SetOwnerID sets the "owner_id" field. +func (ethu *EntityTypeHistoryUpdate) SetOwnerID(s string) *EntityTypeHistoryUpdate { + ethu.mutation.SetOwnerID(s) + return ethu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ethu *EntityTypeHistoryUpdate) SetNillableOwnerID(s *string) *EntityTypeHistoryUpdate { + if s != nil { + ethu.SetOwnerID(*s) + } + return ethu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ethu *EntityTypeHistoryUpdate) ClearOwnerID() *EntityTypeHistoryUpdate { + ethu.mutation.ClearOwnerID() + return ethu +} + +// SetName sets the "name" field. +func (ethu *EntityTypeHistoryUpdate) SetName(s string) *EntityTypeHistoryUpdate { + ethu.mutation.SetName(s) + return ethu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ethu *EntityTypeHistoryUpdate) SetNillableName(s *string) *EntityTypeHistoryUpdate { + if s != nil { + ethu.SetName(*s) + } + return ethu +} + +// Mutation returns the EntityTypeHistoryMutation object of the builder. +func (ethu *EntityTypeHistoryUpdate) Mutation() *EntityTypeHistoryMutation { + return ethu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ethu *EntityTypeHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ethu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ethu.sqlSave, ethu.mutation, ethu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ethu *EntityTypeHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ethu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ethu *EntityTypeHistoryUpdate) Exec(ctx context.Context) error { + _, err := ethu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ethu *EntityTypeHistoryUpdate) ExecX(ctx context.Context) { + if err := ethu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ethu *EntityTypeHistoryUpdate) defaults() error { + if _, ok := ethu.mutation.UpdatedAt(); !ok && !ethu.mutation.UpdatedAtCleared() { + if entitytypehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytypehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitytypehistory.UpdateDefaultUpdatedAt() + ethu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ethu *EntityTypeHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(entitytypehistory.Table, entitytypehistory.Columns, sqlgraph.NewFieldSpec(entitytypehistory.FieldID, field.TypeString)) + if ps := ethu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ethu.mutation.RefCleared() { + _spec.ClearField(entitytypehistory.FieldRef, field.TypeString) + } + if ethu.mutation.CreatedAtCleared() { + _spec.ClearField(entitytypehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ethu.mutation.UpdatedAt(); ok { + _spec.SetField(entitytypehistory.FieldUpdatedAt, field.TypeTime, value) + } + if ethu.mutation.UpdatedAtCleared() { + _spec.ClearField(entitytypehistory.FieldUpdatedAt, field.TypeTime) + } + if ethu.mutation.CreatedByCleared() { + _spec.ClearField(entitytypehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ethu.mutation.UpdatedBy(); ok { + _spec.SetField(entitytypehistory.FieldUpdatedBy, field.TypeString, value) + } + if ethu.mutation.UpdatedByCleared() { + _spec.ClearField(entitytypehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ethu.mutation.DeletedAt(); ok { + _spec.SetField(entitytypehistory.FieldDeletedAt, field.TypeTime, value) + } + if ethu.mutation.DeletedAtCleared() { + _spec.ClearField(entitytypehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ethu.mutation.DeletedBy(); ok { + _spec.SetField(entitytypehistory.FieldDeletedBy, field.TypeString, value) + } + if ethu.mutation.DeletedByCleared() { + _spec.ClearField(entitytypehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ethu.mutation.Tags(); ok { + _spec.SetField(entitytypehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ethu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitytypehistory.FieldTags, value) + }) + } + if ethu.mutation.TagsCleared() { + _spec.ClearField(entitytypehistory.FieldTags, field.TypeJSON) + } + if value, ok := ethu.mutation.OwnerID(); ok { + _spec.SetField(entitytypehistory.FieldOwnerID, field.TypeString, value) + } + if ethu.mutation.OwnerIDCleared() { + _spec.ClearField(entitytypehistory.FieldOwnerID, field.TypeString) + } + if value, ok := ethu.mutation.Name(); ok { + _spec.SetField(entitytypehistory.FieldName, field.TypeString, value) + } + _spec.Node.Schema = ethu.schemaConfig.EntityTypeHistory + ctx = internal.NewSchemaConfigContext(ctx, ethu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ethu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitytypehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ethu.mutation.done = true + return n, nil +} + +// EntityTypeHistoryUpdateOne is the builder for updating a single EntityTypeHistory entity. +type EntityTypeHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EntityTypeHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ethuo *EntityTypeHistoryUpdateOne) SetUpdatedAt(t time.Time) *EntityTypeHistoryUpdateOne { + ethuo.mutation.SetUpdatedAt(t) + return ethuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ethuo *EntityTypeHistoryUpdateOne) ClearUpdatedAt() *EntityTypeHistoryUpdateOne { + ethuo.mutation.ClearUpdatedAt() + return ethuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ethuo *EntityTypeHistoryUpdateOne) SetUpdatedBy(s string) *EntityTypeHistoryUpdateOne { + ethuo.mutation.SetUpdatedBy(s) + return ethuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ethuo *EntityTypeHistoryUpdateOne) SetNillableUpdatedBy(s *string) *EntityTypeHistoryUpdateOne { + if s != nil { + ethuo.SetUpdatedBy(*s) + } + return ethuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ethuo *EntityTypeHistoryUpdateOne) ClearUpdatedBy() *EntityTypeHistoryUpdateOne { + ethuo.mutation.ClearUpdatedBy() + return ethuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ethuo *EntityTypeHistoryUpdateOne) SetDeletedAt(t time.Time) *EntityTypeHistoryUpdateOne { + ethuo.mutation.SetDeletedAt(t) + return ethuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ethuo *EntityTypeHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *EntityTypeHistoryUpdateOne { + if t != nil { + ethuo.SetDeletedAt(*t) + } + return ethuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ethuo *EntityTypeHistoryUpdateOne) ClearDeletedAt() *EntityTypeHistoryUpdateOne { + ethuo.mutation.ClearDeletedAt() + return ethuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ethuo *EntityTypeHistoryUpdateOne) SetDeletedBy(s string) *EntityTypeHistoryUpdateOne { + ethuo.mutation.SetDeletedBy(s) + return ethuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ethuo *EntityTypeHistoryUpdateOne) SetNillableDeletedBy(s *string) *EntityTypeHistoryUpdateOne { + if s != nil { + ethuo.SetDeletedBy(*s) + } + return ethuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ethuo *EntityTypeHistoryUpdateOne) ClearDeletedBy() *EntityTypeHistoryUpdateOne { + ethuo.mutation.ClearDeletedBy() + return ethuo +} + +// SetTags sets the "tags" field. +func (ethuo *EntityTypeHistoryUpdateOne) SetTags(s []string) *EntityTypeHistoryUpdateOne { + ethuo.mutation.SetTags(s) + return ethuo +} + +// AppendTags appends s to the "tags" field. +func (ethuo *EntityTypeHistoryUpdateOne) AppendTags(s []string) *EntityTypeHistoryUpdateOne { + ethuo.mutation.AppendTags(s) + return ethuo +} + +// ClearTags clears the value of the "tags" field. +func (ethuo *EntityTypeHistoryUpdateOne) ClearTags() *EntityTypeHistoryUpdateOne { + ethuo.mutation.ClearTags() + return ethuo +} + +// SetOwnerID sets the "owner_id" field. +func (ethuo *EntityTypeHistoryUpdateOne) SetOwnerID(s string) *EntityTypeHistoryUpdateOne { + ethuo.mutation.SetOwnerID(s) + return ethuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ethuo *EntityTypeHistoryUpdateOne) SetNillableOwnerID(s *string) *EntityTypeHistoryUpdateOne { + if s != nil { + ethuo.SetOwnerID(*s) + } + return ethuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ethuo *EntityTypeHistoryUpdateOne) ClearOwnerID() *EntityTypeHistoryUpdateOne { + ethuo.mutation.ClearOwnerID() + return ethuo +} + +// SetName sets the "name" field. +func (ethuo *EntityTypeHistoryUpdateOne) SetName(s string) *EntityTypeHistoryUpdateOne { + ethuo.mutation.SetName(s) + return ethuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ethuo *EntityTypeHistoryUpdateOne) SetNillableName(s *string) *EntityTypeHistoryUpdateOne { + if s != nil { + ethuo.SetName(*s) + } + return ethuo +} + +// Mutation returns the EntityTypeHistoryMutation object of the builder. +func (ethuo *EntityTypeHistoryUpdateOne) Mutation() *EntityTypeHistoryMutation { + return ethuo.mutation +} + +// Where appends a list predicates to the EntityTypeHistoryUpdate builder. +func (ethuo *EntityTypeHistoryUpdateOne) Where(ps ...predicate.EntityTypeHistory) *EntityTypeHistoryUpdateOne { + ethuo.mutation.Where(ps...) + return ethuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ethuo *EntityTypeHistoryUpdateOne) Select(field string, fields ...string) *EntityTypeHistoryUpdateOne { + ethuo.fields = append([]string{field}, fields...) + return ethuo +} + +// Save executes the query and returns the updated EntityTypeHistory entity. +func (ethuo *EntityTypeHistoryUpdateOne) Save(ctx context.Context) (*EntityTypeHistory, error) { + if err := ethuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ethuo.sqlSave, ethuo.mutation, ethuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ethuo *EntityTypeHistoryUpdateOne) SaveX(ctx context.Context) *EntityTypeHistory { + node, err := ethuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ethuo *EntityTypeHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ethuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ethuo *EntityTypeHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ethuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ethuo *EntityTypeHistoryUpdateOne) defaults() error { + if _, ok := ethuo.mutation.UpdatedAt(); !ok && !ethuo.mutation.UpdatedAtCleared() { + if entitytypehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized entitytypehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := entitytypehistory.UpdateDefaultUpdatedAt() + ethuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ethuo *EntityTypeHistoryUpdateOne) sqlSave(ctx context.Context) (_node *EntityTypeHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(entitytypehistory.Table, entitytypehistory.Columns, sqlgraph.NewFieldSpec(entitytypehistory.FieldID, field.TypeString)) + id, ok := ethuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EntityTypeHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ethuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, entitytypehistory.FieldID) + for _, f := range fields { + if !entitytypehistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != entitytypehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ethuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ethuo.mutation.RefCleared() { + _spec.ClearField(entitytypehistory.FieldRef, field.TypeString) + } + if ethuo.mutation.CreatedAtCleared() { + _spec.ClearField(entitytypehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ethuo.mutation.UpdatedAt(); ok { + _spec.SetField(entitytypehistory.FieldUpdatedAt, field.TypeTime, value) + } + if ethuo.mutation.UpdatedAtCleared() { + _spec.ClearField(entitytypehistory.FieldUpdatedAt, field.TypeTime) + } + if ethuo.mutation.CreatedByCleared() { + _spec.ClearField(entitytypehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ethuo.mutation.UpdatedBy(); ok { + _spec.SetField(entitytypehistory.FieldUpdatedBy, field.TypeString, value) + } + if ethuo.mutation.UpdatedByCleared() { + _spec.ClearField(entitytypehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ethuo.mutation.DeletedAt(); ok { + _spec.SetField(entitytypehistory.FieldDeletedAt, field.TypeTime, value) + } + if ethuo.mutation.DeletedAtCleared() { + _spec.ClearField(entitytypehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ethuo.mutation.DeletedBy(); ok { + _spec.SetField(entitytypehistory.FieldDeletedBy, field.TypeString, value) + } + if ethuo.mutation.DeletedByCleared() { + _spec.ClearField(entitytypehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ethuo.mutation.Tags(); ok { + _spec.SetField(entitytypehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ethuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, entitytypehistory.FieldTags, value) + }) + } + if ethuo.mutation.TagsCleared() { + _spec.ClearField(entitytypehistory.FieldTags, field.TypeJSON) + } + if value, ok := ethuo.mutation.OwnerID(); ok { + _spec.SetField(entitytypehistory.FieldOwnerID, field.TypeString, value) + } + if ethuo.mutation.OwnerIDCleared() { + _spec.ClearField(entitytypehistory.FieldOwnerID, field.TypeString) + } + if value, ok := ethuo.mutation.Name(); ok { + _spec.SetField(entitytypehistory.FieldName, field.TypeString, value) + } + _spec.Node.Schema = ethuo.schemaConfig.EntityTypeHistory + ctx = internal.NewSchemaConfigContext(ctx, ethuo.schemaConfig) + _node = &EntityTypeHistory{config: ethuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ethuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{entitytypehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ethuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/entql.go b/internal/ent/generated/entql.go new file mode 100644 index 0000000..0c6f558 --- /dev/null +++ b/internal/ent/generated/entql.go @@ -0,0 +1,11864 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/entql" + "entgo.io/ent/schema/field" +) + +// schemaGraph holds a representation of ent/schema at runtime. +var schemaGraph = func() *sqlgraph.Schema { + graph := &sqlgraph.Schema{Nodes: make([]*sqlgraph.Node, 57)} + graph.Nodes[0] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: apitoken.Table, + Columns: apitoken.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: apitoken.FieldID, + }, + }, + Type: "APIToken", + Fields: map[string]*sqlgraph.FieldSpec{ + apitoken.FieldCreatedAt: {Type: field.TypeTime, Column: apitoken.FieldCreatedAt}, + apitoken.FieldUpdatedAt: {Type: field.TypeTime, Column: apitoken.FieldUpdatedAt}, + apitoken.FieldCreatedBy: {Type: field.TypeString, Column: apitoken.FieldCreatedBy}, + apitoken.FieldUpdatedBy: {Type: field.TypeString, Column: apitoken.FieldUpdatedBy}, + apitoken.FieldDeletedAt: {Type: field.TypeTime, Column: apitoken.FieldDeletedAt}, + apitoken.FieldDeletedBy: {Type: field.TypeString, Column: apitoken.FieldDeletedBy}, + apitoken.FieldMappingID: {Type: field.TypeString, Column: apitoken.FieldMappingID}, + apitoken.FieldTags: {Type: field.TypeJSON, Column: apitoken.FieldTags}, + apitoken.FieldOwnerID: {Type: field.TypeString, Column: apitoken.FieldOwnerID}, + apitoken.FieldName: {Type: field.TypeString, Column: apitoken.FieldName}, + apitoken.FieldToken: {Type: field.TypeString, Column: apitoken.FieldToken}, + apitoken.FieldExpiresAt: {Type: field.TypeTime, Column: apitoken.FieldExpiresAt}, + apitoken.FieldDescription: {Type: field.TypeString, Column: apitoken.FieldDescription}, + apitoken.FieldScopes: {Type: field.TypeJSON, Column: apitoken.FieldScopes}, + apitoken.FieldLastUsedAt: {Type: field.TypeTime, Column: apitoken.FieldLastUsedAt}, + }, + } + graph.Nodes[1] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: contact.Table, + Columns: contact.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: contact.FieldID, + }, + }, + Type: "Contact", + Fields: map[string]*sqlgraph.FieldSpec{ + contact.FieldCreatedAt: {Type: field.TypeTime, Column: contact.FieldCreatedAt}, + contact.FieldUpdatedAt: {Type: field.TypeTime, Column: contact.FieldUpdatedAt}, + contact.FieldCreatedBy: {Type: field.TypeString, Column: contact.FieldCreatedBy}, + contact.FieldUpdatedBy: {Type: field.TypeString, Column: contact.FieldUpdatedBy}, + contact.FieldMappingID: {Type: field.TypeString, Column: contact.FieldMappingID}, + contact.FieldDeletedAt: {Type: field.TypeTime, Column: contact.FieldDeletedAt}, + contact.FieldDeletedBy: {Type: field.TypeString, Column: contact.FieldDeletedBy}, + contact.FieldTags: {Type: field.TypeJSON, Column: contact.FieldTags}, + contact.FieldOwnerID: {Type: field.TypeString, Column: contact.FieldOwnerID}, + contact.FieldFullName: {Type: field.TypeString, Column: contact.FieldFullName}, + contact.FieldTitle: {Type: field.TypeString, Column: contact.FieldTitle}, + contact.FieldCompany: {Type: field.TypeString, Column: contact.FieldCompany}, + contact.FieldEmail: {Type: field.TypeString, Column: contact.FieldEmail}, + contact.FieldPhoneNumber: {Type: field.TypeString, Column: contact.FieldPhoneNumber}, + contact.FieldAddress: {Type: field.TypeString, Column: contact.FieldAddress}, + contact.FieldStatus: {Type: field.TypeEnum, Column: contact.FieldStatus}, + }, + } + graph.Nodes[2] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: contacthistory.Table, + Columns: contacthistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: contacthistory.FieldID, + }, + }, + Type: "ContactHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + contacthistory.FieldHistoryTime: {Type: field.TypeTime, Column: contacthistory.FieldHistoryTime}, + contacthistory.FieldRef: {Type: field.TypeString, Column: contacthistory.FieldRef}, + contacthistory.FieldOperation: {Type: field.TypeEnum, Column: contacthistory.FieldOperation}, + contacthistory.FieldCreatedAt: {Type: field.TypeTime, Column: contacthistory.FieldCreatedAt}, + contacthistory.FieldUpdatedAt: {Type: field.TypeTime, Column: contacthistory.FieldUpdatedAt}, + contacthistory.FieldCreatedBy: {Type: field.TypeString, Column: contacthistory.FieldCreatedBy}, + contacthistory.FieldUpdatedBy: {Type: field.TypeString, Column: contacthistory.FieldUpdatedBy}, + contacthistory.FieldMappingID: {Type: field.TypeString, Column: contacthistory.FieldMappingID}, + contacthistory.FieldDeletedAt: {Type: field.TypeTime, Column: contacthistory.FieldDeletedAt}, + contacthistory.FieldDeletedBy: {Type: field.TypeString, Column: contacthistory.FieldDeletedBy}, + contacthistory.FieldTags: {Type: field.TypeJSON, Column: contacthistory.FieldTags}, + contacthistory.FieldOwnerID: {Type: field.TypeString, Column: contacthistory.FieldOwnerID}, + contacthistory.FieldFullName: {Type: field.TypeString, Column: contacthistory.FieldFullName}, + contacthistory.FieldTitle: {Type: field.TypeString, Column: contacthistory.FieldTitle}, + contacthistory.FieldCompany: {Type: field.TypeString, Column: contacthistory.FieldCompany}, + contacthistory.FieldEmail: {Type: field.TypeString, Column: contacthistory.FieldEmail}, + contacthistory.FieldPhoneNumber: {Type: field.TypeString, Column: contacthistory.FieldPhoneNumber}, + contacthistory.FieldAddress: {Type: field.TypeString, Column: contacthistory.FieldAddress}, + contacthistory.FieldStatus: {Type: field.TypeEnum, Column: contacthistory.FieldStatus}, + }, + } + graph.Nodes[3] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: documentdata.Table, + Columns: documentdata.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: documentdata.FieldID, + }, + }, + Type: "DocumentData", + Fields: map[string]*sqlgraph.FieldSpec{ + documentdata.FieldCreatedAt: {Type: field.TypeTime, Column: documentdata.FieldCreatedAt}, + documentdata.FieldUpdatedAt: {Type: field.TypeTime, Column: documentdata.FieldUpdatedAt}, + documentdata.FieldCreatedBy: {Type: field.TypeString, Column: documentdata.FieldCreatedBy}, + documentdata.FieldUpdatedBy: {Type: field.TypeString, Column: documentdata.FieldUpdatedBy}, + documentdata.FieldMappingID: {Type: field.TypeString, Column: documentdata.FieldMappingID}, + documentdata.FieldTags: {Type: field.TypeJSON, Column: documentdata.FieldTags}, + documentdata.FieldDeletedAt: {Type: field.TypeTime, Column: documentdata.FieldDeletedAt}, + documentdata.FieldDeletedBy: {Type: field.TypeString, Column: documentdata.FieldDeletedBy}, + documentdata.FieldOwnerID: {Type: field.TypeString, Column: documentdata.FieldOwnerID}, + documentdata.FieldTemplateID: {Type: field.TypeString, Column: documentdata.FieldTemplateID}, + documentdata.FieldData: {Type: field.TypeJSON, Column: documentdata.FieldData}, + }, + } + graph.Nodes[4] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: documentdatahistory.Table, + Columns: documentdatahistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: documentdatahistory.FieldID, + }, + }, + Type: "DocumentDataHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + documentdatahistory.FieldHistoryTime: {Type: field.TypeTime, Column: documentdatahistory.FieldHistoryTime}, + documentdatahistory.FieldRef: {Type: field.TypeString, Column: documentdatahistory.FieldRef}, + documentdatahistory.FieldOperation: {Type: field.TypeEnum, Column: documentdatahistory.FieldOperation}, + documentdatahistory.FieldCreatedAt: {Type: field.TypeTime, Column: documentdatahistory.FieldCreatedAt}, + documentdatahistory.FieldUpdatedAt: {Type: field.TypeTime, Column: documentdatahistory.FieldUpdatedAt}, + documentdatahistory.FieldCreatedBy: {Type: field.TypeString, Column: documentdatahistory.FieldCreatedBy}, + documentdatahistory.FieldUpdatedBy: {Type: field.TypeString, Column: documentdatahistory.FieldUpdatedBy}, + documentdatahistory.FieldMappingID: {Type: field.TypeString, Column: documentdatahistory.FieldMappingID}, + documentdatahistory.FieldTags: {Type: field.TypeJSON, Column: documentdatahistory.FieldTags}, + documentdatahistory.FieldDeletedAt: {Type: field.TypeTime, Column: documentdatahistory.FieldDeletedAt}, + documentdatahistory.FieldDeletedBy: {Type: field.TypeString, Column: documentdatahistory.FieldDeletedBy}, + documentdatahistory.FieldOwnerID: {Type: field.TypeString, Column: documentdatahistory.FieldOwnerID}, + documentdatahistory.FieldTemplateID: {Type: field.TypeString, Column: documentdatahistory.FieldTemplateID}, + documentdatahistory.FieldData: {Type: field.TypeJSON, Column: documentdatahistory.FieldData}, + }, + } + graph.Nodes[5] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: emailverificationtoken.Table, + Columns: emailverificationtoken.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: emailverificationtoken.FieldID, + }, + }, + Type: "EmailVerificationToken", + Fields: map[string]*sqlgraph.FieldSpec{ + emailverificationtoken.FieldCreatedAt: {Type: field.TypeTime, Column: emailverificationtoken.FieldCreatedAt}, + emailverificationtoken.FieldUpdatedAt: {Type: field.TypeTime, Column: emailverificationtoken.FieldUpdatedAt}, + emailverificationtoken.FieldCreatedBy: {Type: field.TypeString, Column: emailverificationtoken.FieldCreatedBy}, + emailverificationtoken.FieldUpdatedBy: {Type: field.TypeString, Column: emailverificationtoken.FieldUpdatedBy}, + emailverificationtoken.FieldMappingID: {Type: field.TypeString, Column: emailverificationtoken.FieldMappingID}, + emailverificationtoken.FieldDeletedAt: {Type: field.TypeTime, Column: emailverificationtoken.FieldDeletedAt}, + emailverificationtoken.FieldDeletedBy: {Type: field.TypeString, Column: emailverificationtoken.FieldDeletedBy}, + emailverificationtoken.FieldOwnerID: {Type: field.TypeString, Column: emailverificationtoken.FieldOwnerID}, + emailverificationtoken.FieldToken: {Type: field.TypeString, Column: emailverificationtoken.FieldToken}, + emailverificationtoken.FieldTTL: {Type: field.TypeTime, Column: emailverificationtoken.FieldTTL}, + emailverificationtoken.FieldEmail: {Type: field.TypeString, Column: emailverificationtoken.FieldEmail}, + emailverificationtoken.FieldSecret: {Type: field.TypeBytes, Column: emailverificationtoken.FieldSecret}, + }, + } + graph.Nodes[6] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitlement.Table, + Columns: entitlement.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitlement.FieldID, + }, + }, + Type: "Entitlement", + Fields: map[string]*sqlgraph.FieldSpec{ + entitlement.FieldCreatedAt: {Type: field.TypeTime, Column: entitlement.FieldCreatedAt}, + entitlement.FieldUpdatedAt: {Type: field.TypeTime, Column: entitlement.FieldUpdatedAt}, + entitlement.FieldCreatedBy: {Type: field.TypeString, Column: entitlement.FieldCreatedBy}, + entitlement.FieldUpdatedBy: {Type: field.TypeString, Column: entitlement.FieldUpdatedBy}, + entitlement.FieldMappingID: {Type: field.TypeString, Column: entitlement.FieldMappingID}, + entitlement.FieldTags: {Type: field.TypeJSON, Column: entitlement.FieldTags}, + entitlement.FieldDeletedAt: {Type: field.TypeTime, Column: entitlement.FieldDeletedAt}, + entitlement.FieldDeletedBy: {Type: field.TypeString, Column: entitlement.FieldDeletedBy}, + entitlement.FieldOwnerID: {Type: field.TypeString, Column: entitlement.FieldOwnerID}, + entitlement.FieldPlanID: {Type: field.TypeString, Column: entitlement.FieldPlanID}, + entitlement.FieldOrganizationID: {Type: field.TypeString, Column: entitlement.FieldOrganizationID}, + entitlement.FieldExternalCustomerID: {Type: field.TypeString, Column: entitlement.FieldExternalCustomerID}, + entitlement.FieldExternalSubscriptionID: {Type: field.TypeString, Column: entitlement.FieldExternalSubscriptionID}, + entitlement.FieldExpires: {Type: field.TypeBool, Column: entitlement.FieldExpires}, + entitlement.FieldExpiresAt: {Type: field.TypeTime, Column: entitlement.FieldExpiresAt}, + entitlement.FieldCancelled: {Type: field.TypeBool, Column: entitlement.FieldCancelled}, + }, + } + graph.Nodes[7] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitlementhistory.Table, + Columns: entitlementhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitlementhistory.FieldID, + }, + }, + Type: "EntitlementHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + entitlementhistory.FieldHistoryTime: {Type: field.TypeTime, Column: entitlementhistory.FieldHistoryTime}, + entitlementhistory.FieldRef: {Type: field.TypeString, Column: entitlementhistory.FieldRef}, + entitlementhistory.FieldOperation: {Type: field.TypeEnum, Column: entitlementhistory.FieldOperation}, + entitlementhistory.FieldCreatedAt: {Type: field.TypeTime, Column: entitlementhistory.FieldCreatedAt}, + entitlementhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: entitlementhistory.FieldUpdatedAt}, + entitlementhistory.FieldCreatedBy: {Type: field.TypeString, Column: entitlementhistory.FieldCreatedBy}, + entitlementhistory.FieldUpdatedBy: {Type: field.TypeString, Column: entitlementhistory.FieldUpdatedBy}, + entitlementhistory.FieldMappingID: {Type: field.TypeString, Column: entitlementhistory.FieldMappingID}, + entitlementhistory.FieldTags: {Type: field.TypeJSON, Column: entitlementhistory.FieldTags}, + entitlementhistory.FieldDeletedAt: {Type: field.TypeTime, Column: entitlementhistory.FieldDeletedAt}, + entitlementhistory.FieldDeletedBy: {Type: field.TypeString, Column: entitlementhistory.FieldDeletedBy}, + entitlementhistory.FieldOwnerID: {Type: field.TypeString, Column: entitlementhistory.FieldOwnerID}, + entitlementhistory.FieldPlanID: {Type: field.TypeString, Column: entitlementhistory.FieldPlanID}, + entitlementhistory.FieldOrganizationID: {Type: field.TypeString, Column: entitlementhistory.FieldOrganizationID}, + entitlementhistory.FieldExternalCustomerID: {Type: field.TypeString, Column: entitlementhistory.FieldExternalCustomerID}, + entitlementhistory.FieldExternalSubscriptionID: {Type: field.TypeString, Column: entitlementhistory.FieldExternalSubscriptionID}, + entitlementhistory.FieldExpires: {Type: field.TypeBool, Column: entitlementhistory.FieldExpires}, + entitlementhistory.FieldExpiresAt: {Type: field.TypeTime, Column: entitlementhistory.FieldExpiresAt}, + entitlementhistory.FieldCancelled: {Type: field.TypeBool, Column: entitlementhistory.FieldCancelled}, + }, + } + graph.Nodes[8] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitlementplan.Table, + Columns: entitlementplan.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitlementplan.FieldID, + }, + }, + Type: "EntitlementPlan", + Fields: map[string]*sqlgraph.FieldSpec{ + entitlementplan.FieldCreatedAt: {Type: field.TypeTime, Column: entitlementplan.FieldCreatedAt}, + entitlementplan.FieldUpdatedAt: {Type: field.TypeTime, Column: entitlementplan.FieldUpdatedAt}, + entitlementplan.FieldCreatedBy: {Type: field.TypeString, Column: entitlementplan.FieldCreatedBy}, + entitlementplan.FieldUpdatedBy: {Type: field.TypeString, Column: entitlementplan.FieldUpdatedBy}, + entitlementplan.FieldMappingID: {Type: field.TypeString, Column: entitlementplan.FieldMappingID}, + entitlementplan.FieldDeletedAt: {Type: field.TypeTime, Column: entitlementplan.FieldDeletedAt}, + entitlementplan.FieldDeletedBy: {Type: field.TypeString, Column: entitlementplan.FieldDeletedBy}, + entitlementplan.FieldTags: {Type: field.TypeJSON, Column: entitlementplan.FieldTags}, + entitlementplan.FieldOwnerID: {Type: field.TypeString, Column: entitlementplan.FieldOwnerID}, + entitlementplan.FieldDisplayName: {Type: field.TypeString, Column: entitlementplan.FieldDisplayName}, + entitlementplan.FieldName: {Type: field.TypeString, Column: entitlementplan.FieldName}, + entitlementplan.FieldDescription: {Type: field.TypeString, Column: entitlementplan.FieldDescription}, + entitlementplan.FieldVersion: {Type: field.TypeString, Column: entitlementplan.FieldVersion}, + entitlementplan.FieldMetadata: {Type: field.TypeJSON, Column: entitlementplan.FieldMetadata}, + }, + } + graph.Nodes[9] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitlementplanfeature.Table, + Columns: entitlementplanfeature.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitlementplanfeature.FieldID, + }, + }, + Type: "EntitlementPlanFeature", + Fields: map[string]*sqlgraph.FieldSpec{ + entitlementplanfeature.FieldCreatedAt: {Type: field.TypeTime, Column: entitlementplanfeature.FieldCreatedAt}, + entitlementplanfeature.FieldUpdatedAt: {Type: field.TypeTime, Column: entitlementplanfeature.FieldUpdatedAt}, + entitlementplanfeature.FieldCreatedBy: {Type: field.TypeString, Column: entitlementplanfeature.FieldCreatedBy}, + entitlementplanfeature.FieldUpdatedBy: {Type: field.TypeString, Column: entitlementplanfeature.FieldUpdatedBy}, + entitlementplanfeature.FieldMappingID: {Type: field.TypeString, Column: entitlementplanfeature.FieldMappingID}, + entitlementplanfeature.FieldDeletedAt: {Type: field.TypeTime, Column: entitlementplanfeature.FieldDeletedAt}, + entitlementplanfeature.FieldDeletedBy: {Type: field.TypeString, Column: entitlementplanfeature.FieldDeletedBy}, + entitlementplanfeature.FieldTags: {Type: field.TypeJSON, Column: entitlementplanfeature.FieldTags}, + entitlementplanfeature.FieldOwnerID: {Type: field.TypeString, Column: entitlementplanfeature.FieldOwnerID}, + entitlementplanfeature.FieldMetadata: {Type: field.TypeJSON, Column: entitlementplanfeature.FieldMetadata}, + entitlementplanfeature.FieldPlanID: {Type: field.TypeString, Column: entitlementplanfeature.FieldPlanID}, + entitlementplanfeature.FieldFeatureID: {Type: field.TypeString, Column: entitlementplanfeature.FieldFeatureID}, + }, + } + graph.Nodes[10] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitlementplanfeaturehistory.Table, + Columns: entitlementplanfeaturehistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitlementplanfeaturehistory.FieldID, + }, + }, + Type: "EntitlementPlanFeatureHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + entitlementplanfeaturehistory.FieldHistoryTime: {Type: field.TypeTime, Column: entitlementplanfeaturehistory.FieldHistoryTime}, + entitlementplanfeaturehistory.FieldRef: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldRef}, + entitlementplanfeaturehistory.FieldOperation: {Type: field.TypeEnum, Column: entitlementplanfeaturehistory.FieldOperation}, + entitlementplanfeaturehistory.FieldCreatedAt: {Type: field.TypeTime, Column: entitlementplanfeaturehistory.FieldCreatedAt}, + entitlementplanfeaturehistory.FieldUpdatedAt: {Type: field.TypeTime, Column: entitlementplanfeaturehistory.FieldUpdatedAt}, + entitlementplanfeaturehistory.FieldCreatedBy: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldCreatedBy}, + entitlementplanfeaturehistory.FieldUpdatedBy: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldUpdatedBy}, + entitlementplanfeaturehistory.FieldMappingID: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldMappingID}, + entitlementplanfeaturehistory.FieldDeletedAt: {Type: field.TypeTime, Column: entitlementplanfeaturehistory.FieldDeletedAt}, + entitlementplanfeaturehistory.FieldDeletedBy: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldDeletedBy}, + entitlementplanfeaturehistory.FieldTags: {Type: field.TypeJSON, Column: entitlementplanfeaturehistory.FieldTags}, + entitlementplanfeaturehistory.FieldOwnerID: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldOwnerID}, + entitlementplanfeaturehistory.FieldMetadata: {Type: field.TypeJSON, Column: entitlementplanfeaturehistory.FieldMetadata}, + entitlementplanfeaturehistory.FieldPlanID: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldPlanID}, + entitlementplanfeaturehistory.FieldFeatureID: {Type: field.TypeString, Column: entitlementplanfeaturehistory.FieldFeatureID}, + }, + } + graph.Nodes[11] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitlementplanhistory.Table, + Columns: entitlementplanhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitlementplanhistory.FieldID, + }, + }, + Type: "EntitlementPlanHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + entitlementplanhistory.FieldHistoryTime: {Type: field.TypeTime, Column: entitlementplanhistory.FieldHistoryTime}, + entitlementplanhistory.FieldRef: {Type: field.TypeString, Column: entitlementplanhistory.FieldRef}, + entitlementplanhistory.FieldOperation: {Type: field.TypeEnum, Column: entitlementplanhistory.FieldOperation}, + entitlementplanhistory.FieldCreatedAt: {Type: field.TypeTime, Column: entitlementplanhistory.FieldCreatedAt}, + entitlementplanhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: entitlementplanhistory.FieldUpdatedAt}, + entitlementplanhistory.FieldCreatedBy: {Type: field.TypeString, Column: entitlementplanhistory.FieldCreatedBy}, + entitlementplanhistory.FieldUpdatedBy: {Type: field.TypeString, Column: entitlementplanhistory.FieldUpdatedBy}, + entitlementplanhistory.FieldMappingID: {Type: field.TypeString, Column: entitlementplanhistory.FieldMappingID}, + entitlementplanhistory.FieldDeletedAt: {Type: field.TypeTime, Column: entitlementplanhistory.FieldDeletedAt}, + entitlementplanhistory.FieldDeletedBy: {Type: field.TypeString, Column: entitlementplanhistory.FieldDeletedBy}, + entitlementplanhistory.FieldTags: {Type: field.TypeJSON, Column: entitlementplanhistory.FieldTags}, + entitlementplanhistory.FieldOwnerID: {Type: field.TypeString, Column: entitlementplanhistory.FieldOwnerID}, + entitlementplanhistory.FieldDisplayName: {Type: field.TypeString, Column: entitlementplanhistory.FieldDisplayName}, + entitlementplanhistory.FieldName: {Type: field.TypeString, Column: entitlementplanhistory.FieldName}, + entitlementplanhistory.FieldDescription: {Type: field.TypeString, Column: entitlementplanhistory.FieldDescription}, + entitlementplanhistory.FieldVersion: {Type: field.TypeString, Column: entitlementplanhistory.FieldVersion}, + entitlementplanhistory.FieldMetadata: {Type: field.TypeJSON, Column: entitlementplanhistory.FieldMetadata}, + }, + } + graph.Nodes[12] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entity.Table, + Columns: entity.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entity.FieldID, + }, + }, + Type: "Entity", + Fields: map[string]*sqlgraph.FieldSpec{ + entity.FieldCreatedAt: {Type: field.TypeTime, Column: entity.FieldCreatedAt}, + entity.FieldUpdatedAt: {Type: field.TypeTime, Column: entity.FieldUpdatedAt}, + entity.FieldCreatedBy: {Type: field.TypeString, Column: entity.FieldCreatedBy}, + entity.FieldUpdatedBy: {Type: field.TypeString, Column: entity.FieldUpdatedBy}, + entity.FieldMappingID: {Type: field.TypeString, Column: entity.FieldMappingID}, + entity.FieldDeletedAt: {Type: field.TypeTime, Column: entity.FieldDeletedAt}, + entity.FieldDeletedBy: {Type: field.TypeString, Column: entity.FieldDeletedBy}, + entity.FieldTags: {Type: field.TypeJSON, Column: entity.FieldTags}, + entity.FieldOwnerID: {Type: field.TypeString, Column: entity.FieldOwnerID}, + entity.FieldName: {Type: field.TypeString, Column: entity.FieldName}, + entity.FieldDisplayName: {Type: field.TypeString, Column: entity.FieldDisplayName}, + entity.FieldDescription: {Type: field.TypeString, Column: entity.FieldDescription}, + entity.FieldDomains: {Type: field.TypeJSON, Column: entity.FieldDomains}, + entity.FieldEntityTypeID: {Type: field.TypeString, Column: entity.FieldEntityTypeID}, + entity.FieldStatus: {Type: field.TypeString, Column: entity.FieldStatus}, + }, + } + graph.Nodes[13] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entityhistory.Table, + Columns: entityhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entityhistory.FieldID, + }, + }, + Type: "EntityHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + entityhistory.FieldHistoryTime: {Type: field.TypeTime, Column: entityhistory.FieldHistoryTime}, + entityhistory.FieldRef: {Type: field.TypeString, Column: entityhistory.FieldRef}, + entityhistory.FieldOperation: {Type: field.TypeEnum, Column: entityhistory.FieldOperation}, + entityhistory.FieldCreatedAt: {Type: field.TypeTime, Column: entityhistory.FieldCreatedAt}, + entityhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: entityhistory.FieldUpdatedAt}, + entityhistory.FieldCreatedBy: {Type: field.TypeString, Column: entityhistory.FieldCreatedBy}, + entityhistory.FieldUpdatedBy: {Type: field.TypeString, Column: entityhistory.FieldUpdatedBy}, + entityhistory.FieldMappingID: {Type: field.TypeString, Column: entityhistory.FieldMappingID}, + entityhistory.FieldDeletedAt: {Type: field.TypeTime, Column: entityhistory.FieldDeletedAt}, + entityhistory.FieldDeletedBy: {Type: field.TypeString, Column: entityhistory.FieldDeletedBy}, + entityhistory.FieldTags: {Type: field.TypeJSON, Column: entityhistory.FieldTags}, + entityhistory.FieldOwnerID: {Type: field.TypeString, Column: entityhistory.FieldOwnerID}, + entityhistory.FieldName: {Type: field.TypeString, Column: entityhistory.FieldName}, + entityhistory.FieldDisplayName: {Type: field.TypeString, Column: entityhistory.FieldDisplayName}, + entityhistory.FieldDescription: {Type: field.TypeString, Column: entityhistory.FieldDescription}, + entityhistory.FieldDomains: {Type: field.TypeJSON, Column: entityhistory.FieldDomains}, + entityhistory.FieldEntityTypeID: {Type: field.TypeString, Column: entityhistory.FieldEntityTypeID}, + entityhistory.FieldStatus: {Type: field.TypeString, Column: entityhistory.FieldStatus}, + }, + } + graph.Nodes[14] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitytype.Table, + Columns: entitytype.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitytype.FieldID, + }, + }, + Type: "EntityType", + Fields: map[string]*sqlgraph.FieldSpec{ + entitytype.FieldCreatedAt: {Type: field.TypeTime, Column: entitytype.FieldCreatedAt}, + entitytype.FieldUpdatedAt: {Type: field.TypeTime, Column: entitytype.FieldUpdatedAt}, + entitytype.FieldCreatedBy: {Type: field.TypeString, Column: entitytype.FieldCreatedBy}, + entitytype.FieldUpdatedBy: {Type: field.TypeString, Column: entitytype.FieldUpdatedBy}, + entitytype.FieldMappingID: {Type: field.TypeString, Column: entitytype.FieldMappingID}, + entitytype.FieldDeletedAt: {Type: field.TypeTime, Column: entitytype.FieldDeletedAt}, + entitytype.FieldDeletedBy: {Type: field.TypeString, Column: entitytype.FieldDeletedBy}, + entitytype.FieldTags: {Type: field.TypeJSON, Column: entitytype.FieldTags}, + entitytype.FieldOwnerID: {Type: field.TypeString, Column: entitytype.FieldOwnerID}, + entitytype.FieldName: {Type: field.TypeString, Column: entitytype.FieldName}, + }, + } + graph.Nodes[15] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: entitytypehistory.Table, + Columns: entitytypehistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: entitytypehistory.FieldID, + }, + }, + Type: "EntityTypeHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + entitytypehistory.FieldHistoryTime: {Type: field.TypeTime, Column: entitytypehistory.FieldHistoryTime}, + entitytypehistory.FieldRef: {Type: field.TypeString, Column: entitytypehistory.FieldRef}, + entitytypehistory.FieldOperation: {Type: field.TypeEnum, Column: entitytypehistory.FieldOperation}, + entitytypehistory.FieldCreatedAt: {Type: field.TypeTime, Column: entitytypehistory.FieldCreatedAt}, + entitytypehistory.FieldUpdatedAt: {Type: field.TypeTime, Column: entitytypehistory.FieldUpdatedAt}, + entitytypehistory.FieldCreatedBy: {Type: field.TypeString, Column: entitytypehistory.FieldCreatedBy}, + entitytypehistory.FieldUpdatedBy: {Type: field.TypeString, Column: entitytypehistory.FieldUpdatedBy}, + entitytypehistory.FieldMappingID: {Type: field.TypeString, Column: entitytypehistory.FieldMappingID}, + entitytypehistory.FieldDeletedAt: {Type: field.TypeTime, Column: entitytypehistory.FieldDeletedAt}, + entitytypehistory.FieldDeletedBy: {Type: field.TypeString, Column: entitytypehistory.FieldDeletedBy}, + entitytypehistory.FieldTags: {Type: field.TypeJSON, Column: entitytypehistory.FieldTags}, + entitytypehistory.FieldOwnerID: {Type: field.TypeString, Column: entitytypehistory.FieldOwnerID}, + entitytypehistory.FieldName: {Type: field.TypeString, Column: entitytypehistory.FieldName}, + }, + } + graph.Nodes[16] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: event.Table, + Columns: event.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: event.FieldID, + }, + }, + Type: "Event", + Fields: map[string]*sqlgraph.FieldSpec{ + event.FieldCreatedAt: {Type: field.TypeTime, Column: event.FieldCreatedAt}, + event.FieldUpdatedAt: {Type: field.TypeTime, Column: event.FieldUpdatedAt}, + event.FieldCreatedBy: {Type: field.TypeString, Column: event.FieldCreatedBy}, + event.FieldUpdatedBy: {Type: field.TypeString, Column: event.FieldUpdatedBy}, + event.FieldMappingID: {Type: field.TypeString, Column: event.FieldMappingID}, + event.FieldTags: {Type: field.TypeJSON, Column: event.FieldTags}, + event.FieldEventID: {Type: field.TypeString, Column: event.FieldEventID}, + event.FieldCorrelationID: {Type: field.TypeString, Column: event.FieldCorrelationID}, + event.FieldEventType: {Type: field.TypeString, Column: event.FieldEventType}, + event.FieldMetadata: {Type: field.TypeJSON, Column: event.FieldMetadata}, + }, + } + graph.Nodes[17] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: eventhistory.Table, + Columns: eventhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: eventhistory.FieldID, + }, + }, + Type: "EventHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + eventhistory.FieldHistoryTime: {Type: field.TypeTime, Column: eventhistory.FieldHistoryTime}, + eventhistory.FieldRef: {Type: field.TypeString, Column: eventhistory.FieldRef}, + eventhistory.FieldOperation: {Type: field.TypeEnum, Column: eventhistory.FieldOperation}, + eventhistory.FieldCreatedAt: {Type: field.TypeTime, Column: eventhistory.FieldCreatedAt}, + eventhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: eventhistory.FieldUpdatedAt}, + eventhistory.FieldCreatedBy: {Type: field.TypeString, Column: eventhistory.FieldCreatedBy}, + eventhistory.FieldUpdatedBy: {Type: field.TypeString, Column: eventhistory.FieldUpdatedBy}, + eventhistory.FieldMappingID: {Type: field.TypeString, Column: eventhistory.FieldMappingID}, + eventhistory.FieldTags: {Type: field.TypeJSON, Column: eventhistory.FieldTags}, + eventhistory.FieldEventID: {Type: field.TypeString, Column: eventhistory.FieldEventID}, + eventhistory.FieldCorrelationID: {Type: field.TypeString, Column: eventhistory.FieldCorrelationID}, + eventhistory.FieldEventType: {Type: field.TypeString, Column: eventhistory.FieldEventType}, + eventhistory.FieldMetadata: {Type: field.TypeJSON, Column: eventhistory.FieldMetadata}, + }, + } + graph.Nodes[18] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: feature.Table, + Columns: feature.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: feature.FieldID, + }, + }, + Type: "Feature", + Fields: map[string]*sqlgraph.FieldSpec{ + feature.FieldCreatedAt: {Type: field.TypeTime, Column: feature.FieldCreatedAt}, + feature.FieldUpdatedAt: {Type: field.TypeTime, Column: feature.FieldUpdatedAt}, + feature.FieldCreatedBy: {Type: field.TypeString, Column: feature.FieldCreatedBy}, + feature.FieldUpdatedBy: {Type: field.TypeString, Column: feature.FieldUpdatedBy}, + feature.FieldDeletedAt: {Type: field.TypeTime, Column: feature.FieldDeletedAt}, + feature.FieldDeletedBy: {Type: field.TypeString, Column: feature.FieldDeletedBy}, + feature.FieldMappingID: {Type: field.TypeString, Column: feature.FieldMappingID}, + feature.FieldTags: {Type: field.TypeJSON, Column: feature.FieldTags}, + feature.FieldOwnerID: {Type: field.TypeString, Column: feature.FieldOwnerID}, + feature.FieldName: {Type: field.TypeString, Column: feature.FieldName}, + feature.FieldDisplayName: {Type: field.TypeString, Column: feature.FieldDisplayName}, + feature.FieldEnabled: {Type: field.TypeBool, Column: feature.FieldEnabled}, + feature.FieldDescription: {Type: field.TypeString, Column: feature.FieldDescription}, + feature.FieldMetadata: {Type: field.TypeJSON, Column: feature.FieldMetadata}, + }, + } + graph.Nodes[19] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: featurehistory.Table, + Columns: featurehistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: featurehistory.FieldID, + }, + }, + Type: "FeatureHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + featurehistory.FieldHistoryTime: {Type: field.TypeTime, Column: featurehistory.FieldHistoryTime}, + featurehistory.FieldRef: {Type: field.TypeString, Column: featurehistory.FieldRef}, + featurehistory.FieldOperation: {Type: field.TypeEnum, Column: featurehistory.FieldOperation}, + featurehistory.FieldCreatedAt: {Type: field.TypeTime, Column: featurehistory.FieldCreatedAt}, + featurehistory.FieldUpdatedAt: {Type: field.TypeTime, Column: featurehistory.FieldUpdatedAt}, + featurehistory.FieldCreatedBy: {Type: field.TypeString, Column: featurehistory.FieldCreatedBy}, + featurehistory.FieldUpdatedBy: {Type: field.TypeString, Column: featurehistory.FieldUpdatedBy}, + featurehistory.FieldDeletedAt: {Type: field.TypeTime, Column: featurehistory.FieldDeletedAt}, + featurehistory.FieldDeletedBy: {Type: field.TypeString, Column: featurehistory.FieldDeletedBy}, + featurehistory.FieldMappingID: {Type: field.TypeString, Column: featurehistory.FieldMappingID}, + featurehistory.FieldTags: {Type: field.TypeJSON, Column: featurehistory.FieldTags}, + featurehistory.FieldOwnerID: {Type: field.TypeString, Column: featurehistory.FieldOwnerID}, + featurehistory.FieldName: {Type: field.TypeString, Column: featurehistory.FieldName}, + featurehistory.FieldDisplayName: {Type: field.TypeString, Column: featurehistory.FieldDisplayName}, + featurehistory.FieldEnabled: {Type: field.TypeBool, Column: featurehistory.FieldEnabled}, + featurehistory.FieldDescription: {Type: field.TypeString, Column: featurehistory.FieldDescription}, + featurehistory.FieldMetadata: {Type: field.TypeJSON, Column: featurehistory.FieldMetadata}, + }, + } + graph.Nodes[20] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: file.Table, + Columns: file.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: file.FieldID, + }, + }, + Type: "File", + Fields: map[string]*sqlgraph.FieldSpec{ + file.FieldCreatedAt: {Type: field.TypeTime, Column: file.FieldCreatedAt}, + file.FieldUpdatedAt: {Type: field.TypeTime, Column: file.FieldUpdatedAt}, + file.FieldCreatedBy: {Type: field.TypeString, Column: file.FieldCreatedBy}, + file.FieldUpdatedBy: {Type: field.TypeString, Column: file.FieldUpdatedBy}, + file.FieldDeletedAt: {Type: field.TypeTime, Column: file.FieldDeletedAt}, + file.FieldDeletedBy: {Type: field.TypeString, Column: file.FieldDeletedBy}, + file.FieldMappingID: {Type: field.TypeString, Column: file.FieldMappingID}, + file.FieldTags: {Type: field.TypeJSON, Column: file.FieldTags}, + file.FieldFileName: {Type: field.TypeString, Column: file.FieldFileName}, + file.FieldFileExtension: {Type: field.TypeString, Column: file.FieldFileExtension}, + file.FieldFileSize: {Type: field.TypeInt, Column: file.FieldFileSize}, + file.FieldContentType: {Type: field.TypeString, Column: file.FieldContentType}, + file.FieldStoreKey: {Type: field.TypeString, Column: file.FieldStoreKey}, + file.FieldCategory: {Type: field.TypeString, Column: file.FieldCategory}, + file.FieldAnnotation: {Type: field.TypeString, Column: file.FieldAnnotation}, + }, + } + graph.Nodes[21] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: filehistory.Table, + Columns: filehistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: filehistory.FieldID, + }, + }, + Type: "FileHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + filehistory.FieldHistoryTime: {Type: field.TypeTime, Column: filehistory.FieldHistoryTime}, + filehistory.FieldRef: {Type: field.TypeString, Column: filehistory.FieldRef}, + filehistory.FieldOperation: {Type: field.TypeEnum, Column: filehistory.FieldOperation}, + filehistory.FieldCreatedAt: {Type: field.TypeTime, Column: filehistory.FieldCreatedAt}, + filehistory.FieldUpdatedAt: {Type: field.TypeTime, Column: filehistory.FieldUpdatedAt}, + filehistory.FieldCreatedBy: {Type: field.TypeString, Column: filehistory.FieldCreatedBy}, + filehistory.FieldUpdatedBy: {Type: field.TypeString, Column: filehistory.FieldUpdatedBy}, + filehistory.FieldDeletedAt: {Type: field.TypeTime, Column: filehistory.FieldDeletedAt}, + filehistory.FieldDeletedBy: {Type: field.TypeString, Column: filehistory.FieldDeletedBy}, + filehistory.FieldMappingID: {Type: field.TypeString, Column: filehistory.FieldMappingID}, + filehistory.FieldTags: {Type: field.TypeJSON, Column: filehistory.FieldTags}, + filehistory.FieldFileName: {Type: field.TypeString, Column: filehistory.FieldFileName}, + filehistory.FieldFileExtension: {Type: field.TypeString, Column: filehistory.FieldFileExtension}, + filehistory.FieldFileSize: {Type: field.TypeInt, Column: filehistory.FieldFileSize}, + filehistory.FieldContentType: {Type: field.TypeString, Column: filehistory.FieldContentType}, + filehistory.FieldStoreKey: {Type: field.TypeString, Column: filehistory.FieldStoreKey}, + filehistory.FieldCategory: {Type: field.TypeString, Column: filehistory.FieldCategory}, + filehistory.FieldAnnotation: {Type: field.TypeString, Column: filehistory.FieldAnnotation}, + }, + } + graph.Nodes[22] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: group.Table, + Columns: group.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: group.FieldID, + }, + }, + Type: "Group", + Fields: map[string]*sqlgraph.FieldSpec{ + group.FieldCreatedAt: {Type: field.TypeTime, Column: group.FieldCreatedAt}, + group.FieldUpdatedAt: {Type: field.TypeTime, Column: group.FieldUpdatedAt}, + group.FieldCreatedBy: {Type: field.TypeString, Column: group.FieldCreatedBy}, + group.FieldUpdatedBy: {Type: field.TypeString, Column: group.FieldUpdatedBy}, + group.FieldDeletedAt: {Type: field.TypeTime, Column: group.FieldDeletedAt}, + group.FieldDeletedBy: {Type: field.TypeString, Column: group.FieldDeletedBy}, + group.FieldMappingID: {Type: field.TypeString, Column: group.FieldMappingID}, + group.FieldTags: {Type: field.TypeJSON, Column: group.FieldTags}, + group.FieldOwnerID: {Type: field.TypeString, Column: group.FieldOwnerID}, + group.FieldName: {Type: field.TypeString, Column: group.FieldName}, + group.FieldDescription: {Type: field.TypeString, Column: group.FieldDescription}, + group.FieldGravatarLogoURL: {Type: field.TypeString, Column: group.FieldGravatarLogoURL}, + group.FieldLogoURL: {Type: field.TypeString, Column: group.FieldLogoURL}, + group.FieldDisplayName: {Type: field.TypeString, Column: group.FieldDisplayName}, + }, + } + graph.Nodes[23] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: grouphistory.Table, + Columns: grouphistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: grouphistory.FieldID, + }, + }, + Type: "GroupHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + grouphistory.FieldHistoryTime: {Type: field.TypeTime, Column: grouphistory.FieldHistoryTime}, + grouphistory.FieldRef: {Type: field.TypeString, Column: grouphistory.FieldRef}, + grouphistory.FieldOperation: {Type: field.TypeEnum, Column: grouphistory.FieldOperation}, + grouphistory.FieldCreatedAt: {Type: field.TypeTime, Column: grouphistory.FieldCreatedAt}, + grouphistory.FieldUpdatedAt: {Type: field.TypeTime, Column: grouphistory.FieldUpdatedAt}, + grouphistory.FieldCreatedBy: {Type: field.TypeString, Column: grouphistory.FieldCreatedBy}, + grouphistory.FieldUpdatedBy: {Type: field.TypeString, Column: grouphistory.FieldUpdatedBy}, + grouphistory.FieldDeletedAt: {Type: field.TypeTime, Column: grouphistory.FieldDeletedAt}, + grouphistory.FieldDeletedBy: {Type: field.TypeString, Column: grouphistory.FieldDeletedBy}, + grouphistory.FieldMappingID: {Type: field.TypeString, Column: grouphistory.FieldMappingID}, + grouphistory.FieldTags: {Type: field.TypeJSON, Column: grouphistory.FieldTags}, + grouphistory.FieldOwnerID: {Type: field.TypeString, Column: grouphistory.FieldOwnerID}, + grouphistory.FieldName: {Type: field.TypeString, Column: grouphistory.FieldName}, + grouphistory.FieldDescription: {Type: field.TypeString, Column: grouphistory.FieldDescription}, + grouphistory.FieldGravatarLogoURL: {Type: field.TypeString, Column: grouphistory.FieldGravatarLogoURL}, + grouphistory.FieldLogoURL: {Type: field.TypeString, Column: grouphistory.FieldLogoURL}, + grouphistory.FieldDisplayName: {Type: field.TypeString, Column: grouphistory.FieldDisplayName}, + }, + } + graph.Nodes[24] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: groupmembership.Table, + Columns: groupmembership.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: groupmembership.FieldID, + }, + }, + Type: "GroupMembership", + Fields: map[string]*sqlgraph.FieldSpec{ + groupmembership.FieldCreatedAt: {Type: field.TypeTime, Column: groupmembership.FieldCreatedAt}, + groupmembership.FieldUpdatedAt: {Type: field.TypeTime, Column: groupmembership.FieldUpdatedAt}, + groupmembership.FieldCreatedBy: {Type: field.TypeString, Column: groupmembership.FieldCreatedBy}, + groupmembership.FieldUpdatedBy: {Type: field.TypeString, Column: groupmembership.FieldUpdatedBy}, + groupmembership.FieldMappingID: {Type: field.TypeString, Column: groupmembership.FieldMappingID}, + groupmembership.FieldDeletedAt: {Type: field.TypeTime, Column: groupmembership.FieldDeletedAt}, + groupmembership.FieldDeletedBy: {Type: field.TypeString, Column: groupmembership.FieldDeletedBy}, + groupmembership.FieldRole: {Type: field.TypeEnum, Column: groupmembership.FieldRole}, + groupmembership.FieldGroupID: {Type: field.TypeString, Column: groupmembership.FieldGroupID}, + groupmembership.FieldUserID: {Type: field.TypeString, Column: groupmembership.FieldUserID}, + }, + } + graph.Nodes[25] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: groupmembershiphistory.Table, + Columns: groupmembershiphistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: groupmembershiphistory.FieldID, + }, + }, + Type: "GroupMembershipHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + groupmembershiphistory.FieldHistoryTime: {Type: field.TypeTime, Column: groupmembershiphistory.FieldHistoryTime}, + groupmembershiphistory.FieldRef: {Type: field.TypeString, Column: groupmembershiphistory.FieldRef}, + groupmembershiphistory.FieldOperation: {Type: field.TypeEnum, Column: groupmembershiphistory.FieldOperation}, + groupmembershiphistory.FieldCreatedAt: {Type: field.TypeTime, Column: groupmembershiphistory.FieldCreatedAt}, + groupmembershiphistory.FieldUpdatedAt: {Type: field.TypeTime, Column: groupmembershiphistory.FieldUpdatedAt}, + groupmembershiphistory.FieldCreatedBy: {Type: field.TypeString, Column: groupmembershiphistory.FieldCreatedBy}, + groupmembershiphistory.FieldUpdatedBy: {Type: field.TypeString, Column: groupmembershiphistory.FieldUpdatedBy}, + groupmembershiphistory.FieldMappingID: {Type: field.TypeString, Column: groupmembershiphistory.FieldMappingID}, + groupmembershiphistory.FieldDeletedAt: {Type: field.TypeTime, Column: groupmembershiphistory.FieldDeletedAt}, + groupmembershiphistory.FieldDeletedBy: {Type: field.TypeString, Column: groupmembershiphistory.FieldDeletedBy}, + groupmembershiphistory.FieldRole: {Type: field.TypeEnum, Column: groupmembershiphistory.FieldRole}, + groupmembershiphistory.FieldGroupID: {Type: field.TypeString, Column: groupmembershiphistory.FieldGroupID}, + groupmembershiphistory.FieldUserID: {Type: field.TypeString, Column: groupmembershiphistory.FieldUserID}, + }, + } + graph.Nodes[26] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: groupsetting.Table, + Columns: groupsetting.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: groupsetting.FieldID, + }, + }, + Type: "GroupSetting", + Fields: map[string]*sqlgraph.FieldSpec{ + groupsetting.FieldCreatedAt: {Type: field.TypeTime, Column: groupsetting.FieldCreatedAt}, + groupsetting.FieldUpdatedAt: {Type: field.TypeTime, Column: groupsetting.FieldUpdatedAt}, + groupsetting.FieldCreatedBy: {Type: field.TypeString, Column: groupsetting.FieldCreatedBy}, + groupsetting.FieldUpdatedBy: {Type: field.TypeString, Column: groupsetting.FieldUpdatedBy}, + groupsetting.FieldMappingID: {Type: field.TypeString, Column: groupsetting.FieldMappingID}, + groupsetting.FieldTags: {Type: field.TypeJSON, Column: groupsetting.FieldTags}, + groupsetting.FieldDeletedAt: {Type: field.TypeTime, Column: groupsetting.FieldDeletedAt}, + groupsetting.FieldDeletedBy: {Type: field.TypeString, Column: groupsetting.FieldDeletedBy}, + groupsetting.FieldVisibility: {Type: field.TypeEnum, Column: groupsetting.FieldVisibility}, + groupsetting.FieldJoinPolicy: {Type: field.TypeEnum, Column: groupsetting.FieldJoinPolicy}, + groupsetting.FieldSyncToSlack: {Type: field.TypeBool, Column: groupsetting.FieldSyncToSlack}, + groupsetting.FieldSyncToGithub: {Type: field.TypeBool, Column: groupsetting.FieldSyncToGithub}, + groupsetting.FieldGroupID: {Type: field.TypeString, Column: groupsetting.FieldGroupID}, + }, + } + graph.Nodes[27] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: groupsettinghistory.Table, + Columns: groupsettinghistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: groupsettinghistory.FieldID, + }, + }, + Type: "GroupSettingHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + groupsettinghistory.FieldHistoryTime: {Type: field.TypeTime, Column: groupsettinghistory.FieldHistoryTime}, + groupsettinghistory.FieldRef: {Type: field.TypeString, Column: groupsettinghistory.FieldRef}, + groupsettinghistory.FieldOperation: {Type: field.TypeEnum, Column: groupsettinghistory.FieldOperation}, + groupsettinghistory.FieldCreatedAt: {Type: field.TypeTime, Column: groupsettinghistory.FieldCreatedAt}, + groupsettinghistory.FieldUpdatedAt: {Type: field.TypeTime, Column: groupsettinghistory.FieldUpdatedAt}, + groupsettinghistory.FieldCreatedBy: {Type: field.TypeString, Column: groupsettinghistory.FieldCreatedBy}, + groupsettinghistory.FieldUpdatedBy: {Type: field.TypeString, Column: groupsettinghistory.FieldUpdatedBy}, + groupsettinghistory.FieldMappingID: {Type: field.TypeString, Column: groupsettinghistory.FieldMappingID}, + groupsettinghistory.FieldTags: {Type: field.TypeJSON, Column: groupsettinghistory.FieldTags}, + groupsettinghistory.FieldDeletedAt: {Type: field.TypeTime, Column: groupsettinghistory.FieldDeletedAt}, + groupsettinghistory.FieldDeletedBy: {Type: field.TypeString, Column: groupsettinghistory.FieldDeletedBy}, + groupsettinghistory.FieldVisibility: {Type: field.TypeEnum, Column: groupsettinghistory.FieldVisibility}, + groupsettinghistory.FieldJoinPolicy: {Type: field.TypeEnum, Column: groupsettinghistory.FieldJoinPolicy}, + groupsettinghistory.FieldSyncToSlack: {Type: field.TypeBool, Column: groupsettinghistory.FieldSyncToSlack}, + groupsettinghistory.FieldSyncToGithub: {Type: field.TypeBool, Column: groupsettinghistory.FieldSyncToGithub}, + groupsettinghistory.FieldGroupID: {Type: field.TypeString, Column: groupsettinghistory.FieldGroupID}, + }, + } + graph.Nodes[28] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: hush.Table, + Columns: hush.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: hush.FieldID, + }, + }, + Type: "Hush", + Fields: map[string]*sqlgraph.FieldSpec{ + hush.FieldCreatedAt: {Type: field.TypeTime, Column: hush.FieldCreatedAt}, + hush.FieldUpdatedAt: {Type: field.TypeTime, Column: hush.FieldUpdatedAt}, + hush.FieldCreatedBy: {Type: field.TypeString, Column: hush.FieldCreatedBy}, + hush.FieldUpdatedBy: {Type: field.TypeString, Column: hush.FieldUpdatedBy}, + hush.FieldMappingID: {Type: field.TypeString, Column: hush.FieldMappingID}, + hush.FieldDeletedAt: {Type: field.TypeTime, Column: hush.FieldDeletedAt}, + hush.FieldDeletedBy: {Type: field.TypeString, Column: hush.FieldDeletedBy}, + hush.FieldName: {Type: field.TypeString, Column: hush.FieldName}, + hush.FieldDescription: {Type: field.TypeString, Column: hush.FieldDescription}, + hush.FieldKind: {Type: field.TypeString, Column: hush.FieldKind}, + hush.FieldSecretName: {Type: field.TypeString, Column: hush.FieldSecretName}, + hush.FieldSecretValue: {Type: field.TypeString, Column: hush.FieldSecretValue}, + }, + } + graph.Nodes[29] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: hushhistory.Table, + Columns: hushhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: hushhistory.FieldID, + }, + }, + Type: "HushHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + hushhistory.FieldHistoryTime: {Type: field.TypeTime, Column: hushhistory.FieldHistoryTime}, + hushhistory.FieldRef: {Type: field.TypeString, Column: hushhistory.FieldRef}, + hushhistory.FieldOperation: {Type: field.TypeEnum, Column: hushhistory.FieldOperation}, + hushhistory.FieldCreatedAt: {Type: field.TypeTime, Column: hushhistory.FieldCreatedAt}, + hushhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: hushhistory.FieldUpdatedAt}, + hushhistory.FieldCreatedBy: {Type: field.TypeString, Column: hushhistory.FieldCreatedBy}, + hushhistory.FieldUpdatedBy: {Type: field.TypeString, Column: hushhistory.FieldUpdatedBy}, + hushhistory.FieldMappingID: {Type: field.TypeString, Column: hushhistory.FieldMappingID}, + hushhistory.FieldDeletedAt: {Type: field.TypeTime, Column: hushhistory.FieldDeletedAt}, + hushhistory.FieldDeletedBy: {Type: field.TypeString, Column: hushhistory.FieldDeletedBy}, + hushhistory.FieldName: {Type: field.TypeString, Column: hushhistory.FieldName}, + hushhistory.FieldDescription: {Type: field.TypeString, Column: hushhistory.FieldDescription}, + hushhistory.FieldKind: {Type: field.TypeString, Column: hushhistory.FieldKind}, + hushhistory.FieldSecretName: {Type: field.TypeString, Column: hushhistory.FieldSecretName}, + hushhistory.FieldSecretValue: {Type: field.TypeString, Column: hushhistory.FieldSecretValue}, + }, + } + graph.Nodes[30] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: integration.Table, + Columns: integration.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: integration.FieldID, + }, + }, + Type: "Integration", + Fields: map[string]*sqlgraph.FieldSpec{ + integration.FieldCreatedAt: {Type: field.TypeTime, Column: integration.FieldCreatedAt}, + integration.FieldUpdatedAt: {Type: field.TypeTime, Column: integration.FieldUpdatedAt}, + integration.FieldCreatedBy: {Type: field.TypeString, Column: integration.FieldCreatedBy}, + integration.FieldUpdatedBy: {Type: field.TypeString, Column: integration.FieldUpdatedBy}, + integration.FieldMappingID: {Type: field.TypeString, Column: integration.FieldMappingID}, + integration.FieldTags: {Type: field.TypeJSON, Column: integration.FieldTags}, + integration.FieldDeletedAt: {Type: field.TypeTime, Column: integration.FieldDeletedAt}, + integration.FieldDeletedBy: {Type: field.TypeString, Column: integration.FieldDeletedBy}, + integration.FieldOwnerID: {Type: field.TypeString, Column: integration.FieldOwnerID}, + integration.FieldName: {Type: field.TypeString, Column: integration.FieldName}, + integration.FieldDescription: {Type: field.TypeString, Column: integration.FieldDescription}, + integration.FieldKind: {Type: field.TypeString, Column: integration.FieldKind}, + }, + } + graph.Nodes[31] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: integrationhistory.Table, + Columns: integrationhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: integrationhistory.FieldID, + }, + }, + Type: "IntegrationHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + integrationhistory.FieldHistoryTime: {Type: field.TypeTime, Column: integrationhistory.FieldHistoryTime}, + integrationhistory.FieldRef: {Type: field.TypeString, Column: integrationhistory.FieldRef}, + integrationhistory.FieldOperation: {Type: field.TypeEnum, Column: integrationhistory.FieldOperation}, + integrationhistory.FieldCreatedAt: {Type: field.TypeTime, Column: integrationhistory.FieldCreatedAt}, + integrationhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: integrationhistory.FieldUpdatedAt}, + integrationhistory.FieldCreatedBy: {Type: field.TypeString, Column: integrationhistory.FieldCreatedBy}, + integrationhistory.FieldUpdatedBy: {Type: field.TypeString, Column: integrationhistory.FieldUpdatedBy}, + integrationhistory.FieldMappingID: {Type: field.TypeString, Column: integrationhistory.FieldMappingID}, + integrationhistory.FieldTags: {Type: field.TypeJSON, Column: integrationhistory.FieldTags}, + integrationhistory.FieldDeletedAt: {Type: field.TypeTime, Column: integrationhistory.FieldDeletedAt}, + integrationhistory.FieldDeletedBy: {Type: field.TypeString, Column: integrationhistory.FieldDeletedBy}, + integrationhistory.FieldOwnerID: {Type: field.TypeString, Column: integrationhistory.FieldOwnerID}, + integrationhistory.FieldName: {Type: field.TypeString, Column: integrationhistory.FieldName}, + integrationhistory.FieldDescription: {Type: field.TypeString, Column: integrationhistory.FieldDescription}, + integrationhistory.FieldKind: {Type: field.TypeString, Column: integrationhistory.FieldKind}, + }, + } + graph.Nodes[32] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: invite.Table, + Columns: invite.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: invite.FieldID, + }, + }, + Type: "Invite", + Fields: map[string]*sqlgraph.FieldSpec{ + invite.FieldCreatedAt: {Type: field.TypeTime, Column: invite.FieldCreatedAt}, + invite.FieldUpdatedAt: {Type: field.TypeTime, Column: invite.FieldUpdatedAt}, + invite.FieldCreatedBy: {Type: field.TypeString, Column: invite.FieldCreatedBy}, + invite.FieldUpdatedBy: {Type: field.TypeString, Column: invite.FieldUpdatedBy}, + invite.FieldMappingID: {Type: field.TypeString, Column: invite.FieldMappingID}, + invite.FieldDeletedAt: {Type: field.TypeTime, Column: invite.FieldDeletedAt}, + invite.FieldDeletedBy: {Type: field.TypeString, Column: invite.FieldDeletedBy}, + invite.FieldOwnerID: {Type: field.TypeString, Column: invite.FieldOwnerID}, + invite.FieldToken: {Type: field.TypeString, Column: invite.FieldToken}, + invite.FieldExpires: {Type: field.TypeTime, Column: invite.FieldExpires}, + invite.FieldRecipient: {Type: field.TypeString, Column: invite.FieldRecipient}, + invite.FieldStatus: {Type: field.TypeEnum, Column: invite.FieldStatus}, + invite.FieldRole: {Type: field.TypeEnum, Column: invite.FieldRole}, + invite.FieldSendAttempts: {Type: field.TypeInt, Column: invite.FieldSendAttempts}, + invite.FieldRequestorID: {Type: field.TypeString, Column: invite.FieldRequestorID}, + invite.FieldSecret: {Type: field.TypeBytes, Column: invite.FieldSecret}, + }, + } + graph.Nodes[33] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: note.Table, + Columns: note.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: note.FieldID, + }, + }, + Type: "Note", + Fields: map[string]*sqlgraph.FieldSpec{ + note.FieldCreatedAt: {Type: field.TypeTime, Column: note.FieldCreatedAt}, + note.FieldUpdatedAt: {Type: field.TypeTime, Column: note.FieldUpdatedAt}, + note.FieldCreatedBy: {Type: field.TypeString, Column: note.FieldCreatedBy}, + note.FieldUpdatedBy: {Type: field.TypeString, Column: note.FieldUpdatedBy}, + note.FieldMappingID: {Type: field.TypeString, Column: note.FieldMappingID}, + note.FieldDeletedAt: {Type: field.TypeTime, Column: note.FieldDeletedAt}, + note.FieldDeletedBy: {Type: field.TypeString, Column: note.FieldDeletedBy}, + note.FieldTags: {Type: field.TypeJSON, Column: note.FieldTags}, + note.FieldOwnerID: {Type: field.TypeString, Column: note.FieldOwnerID}, + note.FieldText: {Type: field.TypeString, Column: note.FieldText}, + }, + } + graph.Nodes[34] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: notehistory.Table, + Columns: notehistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: notehistory.FieldID, + }, + }, + Type: "NoteHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + notehistory.FieldHistoryTime: {Type: field.TypeTime, Column: notehistory.FieldHistoryTime}, + notehistory.FieldRef: {Type: field.TypeString, Column: notehistory.FieldRef}, + notehistory.FieldOperation: {Type: field.TypeEnum, Column: notehistory.FieldOperation}, + notehistory.FieldCreatedAt: {Type: field.TypeTime, Column: notehistory.FieldCreatedAt}, + notehistory.FieldUpdatedAt: {Type: field.TypeTime, Column: notehistory.FieldUpdatedAt}, + notehistory.FieldCreatedBy: {Type: field.TypeString, Column: notehistory.FieldCreatedBy}, + notehistory.FieldUpdatedBy: {Type: field.TypeString, Column: notehistory.FieldUpdatedBy}, + notehistory.FieldMappingID: {Type: field.TypeString, Column: notehistory.FieldMappingID}, + notehistory.FieldDeletedAt: {Type: field.TypeTime, Column: notehistory.FieldDeletedAt}, + notehistory.FieldDeletedBy: {Type: field.TypeString, Column: notehistory.FieldDeletedBy}, + notehistory.FieldTags: {Type: field.TypeJSON, Column: notehistory.FieldTags}, + notehistory.FieldOwnerID: {Type: field.TypeString, Column: notehistory.FieldOwnerID}, + notehistory.FieldText: {Type: field.TypeString, Column: notehistory.FieldText}, + }, + } + graph.Nodes[35] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: oauthprovider.Table, + Columns: oauthprovider.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: oauthprovider.FieldID, + }, + }, + Type: "OauthProvider", + Fields: map[string]*sqlgraph.FieldSpec{ + oauthprovider.FieldCreatedAt: {Type: field.TypeTime, Column: oauthprovider.FieldCreatedAt}, + oauthprovider.FieldUpdatedAt: {Type: field.TypeTime, Column: oauthprovider.FieldUpdatedAt}, + oauthprovider.FieldCreatedBy: {Type: field.TypeString, Column: oauthprovider.FieldCreatedBy}, + oauthprovider.FieldUpdatedBy: {Type: field.TypeString, Column: oauthprovider.FieldUpdatedBy}, + oauthprovider.FieldMappingID: {Type: field.TypeString, Column: oauthprovider.FieldMappingID}, + oauthprovider.FieldTags: {Type: field.TypeJSON, Column: oauthprovider.FieldTags}, + oauthprovider.FieldDeletedAt: {Type: field.TypeTime, Column: oauthprovider.FieldDeletedAt}, + oauthprovider.FieldDeletedBy: {Type: field.TypeString, Column: oauthprovider.FieldDeletedBy}, + oauthprovider.FieldOwnerID: {Type: field.TypeString, Column: oauthprovider.FieldOwnerID}, + oauthprovider.FieldName: {Type: field.TypeString, Column: oauthprovider.FieldName}, + oauthprovider.FieldClientID: {Type: field.TypeString, Column: oauthprovider.FieldClientID}, + oauthprovider.FieldClientSecret: {Type: field.TypeString, Column: oauthprovider.FieldClientSecret}, + oauthprovider.FieldRedirectURL: {Type: field.TypeString, Column: oauthprovider.FieldRedirectURL}, + oauthprovider.FieldScopes: {Type: field.TypeString, Column: oauthprovider.FieldScopes}, + oauthprovider.FieldAuthURL: {Type: field.TypeString, Column: oauthprovider.FieldAuthURL}, + oauthprovider.FieldTokenURL: {Type: field.TypeString, Column: oauthprovider.FieldTokenURL}, + oauthprovider.FieldAuthStyle: {Type: field.TypeUint8, Column: oauthprovider.FieldAuthStyle}, + oauthprovider.FieldInfoURL: {Type: field.TypeString, Column: oauthprovider.FieldInfoURL}, + }, + } + graph.Nodes[36] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: oauthproviderhistory.Table, + Columns: oauthproviderhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: oauthproviderhistory.FieldID, + }, + }, + Type: "OauthProviderHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + oauthproviderhistory.FieldHistoryTime: {Type: field.TypeTime, Column: oauthproviderhistory.FieldHistoryTime}, + oauthproviderhistory.FieldRef: {Type: field.TypeString, Column: oauthproviderhistory.FieldRef}, + oauthproviderhistory.FieldOperation: {Type: field.TypeEnum, Column: oauthproviderhistory.FieldOperation}, + oauthproviderhistory.FieldCreatedAt: {Type: field.TypeTime, Column: oauthproviderhistory.FieldCreatedAt}, + oauthproviderhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: oauthproviderhistory.FieldUpdatedAt}, + oauthproviderhistory.FieldCreatedBy: {Type: field.TypeString, Column: oauthproviderhistory.FieldCreatedBy}, + oauthproviderhistory.FieldUpdatedBy: {Type: field.TypeString, Column: oauthproviderhistory.FieldUpdatedBy}, + oauthproviderhistory.FieldMappingID: {Type: field.TypeString, Column: oauthproviderhistory.FieldMappingID}, + oauthproviderhistory.FieldTags: {Type: field.TypeJSON, Column: oauthproviderhistory.FieldTags}, + oauthproviderhistory.FieldDeletedAt: {Type: field.TypeTime, Column: oauthproviderhistory.FieldDeletedAt}, + oauthproviderhistory.FieldDeletedBy: {Type: field.TypeString, Column: oauthproviderhistory.FieldDeletedBy}, + oauthproviderhistory.FieldOwnerID: {Type: field.TypeString, Column: oauthproviderhistory.FieldOwnerID}, + oauthproviderhistory.FieldName: {Type: field.TypeString, Column: oauthproviderhistory.FieldName}, + oauthproviderhistory.FieldClientID: {Type: field.TypeString, Column: oauthproviderhistory.FieldClientID}, + oauthproviderhistory.FieldClientSecret: {Type: field.TypeString, Column: oauthproviderhistory.FieldClientSecret}, + oauthproviderhistory.FieldRedirectURL: {Type: field.TypeString, Column: oauthproviderhistory.FieldRedirectURL}, + oauthproviderhistory.FieldScopes: {Type: field.TypeString, Column: oauthproviderhistory.FieldScopes}, + oauthproviderhistory.FieldAuthURL: {Type: field.TypeString, Column: oauthproviderhistory.FieldAuthURL}, + oauthproviderhistory.FieldTokenURL: {Type: field.TypeString, Column: oauthproviderhistory.FieldTokenURL}, + oauthproviderhistory.FieldAuthStyle: {Type: field.TypeUint8, Column: oauthproviderhistory.FieldAuthStyle}, + oauthproviderhistory.FieldInfoURL: {Type: field.TypeString, Column: oauthproviderhistory.FieldInfoURL}, + }, + } + graph.Nodes[37] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: ohauthtootoken.Table, + Columns: ohauthtootoken.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: ohauthtootoken.FieldID, + }, + }, + Type: "OhAuthTooToken", + Fields: map[string]*sqlgraph.FieldSpec{ + ohauthtootoken.FieldMappingID: {Type: field.TypeString, Column: ohauthtootoken.FieldMappingID}, + ohauthtootoken.FieldTags: {Type: field.TypeJSON, Column: ohauthtootoken.FieldTags}, + ohauthtootoken.FieldClientID: {Type: field.TypeString, Column: ohauthtootoken.FieldClientID}, + ohauthtootoken.FieldScopes: {Type: field.TypeJSON, Column: ohauthtootoken.FieldScopes}, + ohauthtootoken.FieldNonce: {Type: field.TypeString, Column: ohauthtootoken.FieldNonce}, + ohauthtootoken.FieldClaimsUserID: {Type: field.TypeString, Column: ohauthtootoken.FieldClaimsUserID}, + ohauthtootoken.FieldClaimsUsername: {Type: field.TypeString, Column: ohauthtootoken.FieldClaimsUsername}, + ohauthtootoken.FieldClaimsEmail: {Type: field.TypeString, Column: ohauthtootoken.FieldClaimsEmail}, + ohauthtootoken.FieldClaimsEmailVerified: {Type: field.TypeBool, Column: ohauthtootoken.FieldClaimsEmailVerified}, + ohauthtootoken.FieldClaimsGroups: {Type: field.TypeJSON, Column: ohauthtootoken.FieldClaimsGroups}, + ohauthtootoken.FieldClaimsPreferredUsername: {Type: field.TypeString, Column: ohauthtootoken.FieldClaimsPreferredUsername}, + ohauthtootoken.FieldConnectorID: {Type: field.TypeString, Column: ohauthtootoken.FieldConnectorID}, + ohauthtootoken.FieldConnectorData: {Type: field.TypeJSON, Column: ohauthtootoken.FieldConnectorData}, + ohauthtootoken.FieldLastUsed: {Type: field.TypeTime, Column: ohauthtootoken.FieldLastUsed}, + }, + } + graph.Nodes[38] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: orgmembership.Table, + Columns: orgmembership.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: orgmembership.FieldID, + }, + }, + Type: "OrgMembership", + Fields: map[string]*sqlgraph.FieldSpec{ + orgmembership.FieldCreatedAt: {Type: field.TypeTime, Column: orgmembership.FieldCreatedAt}, + orgmembership.FieldUpdatedAt: {Type: field.TypeTime, Column: orgmembership.FieldUpdatedAt}, + orgmembership.FieldCreatedBy: {Type: field.TypeString, Column: orgmembership.FieldCreatedBy}, + orgmembership.FieldUpdatedBy: {Type: field.TypeString, Column: orgmembership.FieldUpdatedBy}, + orgmembership.FieldMappingID: {Type: field.TypeString, Column: orgmembership.FieldMappingID}, + orgmembership.FieldDeletedAt: {Type: field.TypeTime, Column: orgmembership.FieldDeletedAt}, + orgmembership.FieldDeletedBy: {Type: field.TypeString, Column: orgmembership.FieldDeletedBy}, + orgmembership.FieldRole: {Type: field.TypeEnum, Column: orgmembership.FieldRole}, + orgmembership.FieldOrganizationID: {Type: field.TypeString, Column: orgmembership.FieldOrganizationID}, + orgmembership.FieldUserID: {Type: field.TypeString, Column: orgmembership.FieldUserID}, + }, + } + graph.Nodes[39] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: orgmembershiphistory.Table, + Columns: orgmembershiphistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: orgmembershiphistory.FieldID, + }, + }, + Type: "OrgMembershipHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + orgmembershiphistory.FieldHistoryTime: {Type: field.TypeTime, Column: orgmembershiphistory.FieldHistoryTime}, + orgmembershiphistory.FieldRef: {Type: field.TypeString, Column: orgmembershiphistory.FieldRef}, + orgmembershiphistory.FieldOperation: {Type: field.TypeEnum, Column: orgmembershiphistory.FieldOperation}, + orgmembershiphistory.FieldCreatedAt: {Type: field.TypeTime, Column: orgmembershiphistory.FieldCreatedAt}, + orgmembershiphistory.FieldUpdatedAt: {Type: field.TypeTime, Column: orgmembershiphistory.FieldUpdatedAt}, + orgmembershiphistory.FieldCreatedBy: {Type: field.TypeString, Column: orgmembershiphistory.FieldCreatedBy}, + orgmembershiphistory.FieldUpdatedBy: {Type: field.TypeString, Column: orgmembershiphistory.FieldUpdatedBy}, + orgmembershiphistory.FieldMappingID: {Type: field.TypeString, Column: orgmembershiphistory.FieldMappingID}, + orgmembershiphistory.FieldDeletedAt: {Type: field.TypeTime, Column: orgmembershiphistory.FieldDeletedAt}, + orgmembershiphistory.FieldDeletedBy: {Type: field.TypeString, Column: orgmembershiphistory.FieldDeletedBy}, + orgmembershiphistory.FieldRole: {Type: field.TypeEnum, Column: orgmembershiphistory.FieldRole}, + orgmembershiphistory.FieldOrganizationID: {Type: field.TypeString, Column: orgmembershiphistory.FieldOrganizationID}, + orgmembershiphistory.FieldUserID: {Type: field.TypeString, Column: orgmembershiphistory.FieldUserID}, + }, + } + graph.Nodes[40] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: organization.Table, + Columns: organization.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: organization.FieldID, + }, + }, + Type: "Organization", + Fields: map[string]*sqlgraph.FieldSpec{ + organization.FieldCreatedAt: {Type: field.TypeTime, Column: organization.FieldCreatedAt}, + organization.FieldUpdatedAt: {Type: field.TypeTime, Column: organization.FieldUpdatedAt}, + organization.FieldCreatedBy: {Type: field.TypeString, Column: organization.FieldCreatedBy}, + organization.FieldUpdatedBy: {Type: field.TypeString, Column: organization.FieldUpdatedBy}, + organization.FieldMappingID: {Type: field.TypeString, Column: organization.FieldMappingID}, + organization.FieldTags: {Type: field.TypeJSON, Column: organization.FieldTags}, + organization.FieldDeletedAt: {Type: field.TypeTime, Column: organization.FieldDeletedAt}, + organization.FieldDeletedBy: {Type: field.TypeString, Column: organization.FieldDeletedBy}, + organization.FieldName: {Type: field.TypeString, Column: organization.FieldName}, + organization.FieldDisplayName: {Type: field.TypeString, Column: organization.FieldDisplayName}, + organization.FieldDescription: {Type: field.TypeString, Column: organization.FieldDescription}, + organization.FieldParentOrganizationID: {Type: field.TypeString, Column: organization.FieldParentOrganizationID}, + organization.FieldPersonalOrg: {Type: field.TypeBool, Column: organization.FieldPersonalOrg}, + organization.FieldAvatarRemoteURL: {Type: field.TypeString, Column: organization.FieldAvatarRemoteURL}, + organization.FieldDedicatedDb: {Type: field.TypeBool, Column: organization.FieldDedicatedDb}, + }, + } + graph.Nodes[41] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: organizationhistory.Table, + Columns: organizationhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: organizationhistory.FieldID, + }, + }, + Type: "OrganizationHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + organizationhistory.FieldHistoryTime: {Type: field.TypeTime, Column: organizationhistory.FieldHistoryTime}, + organizationhistory.FieldRef: {Type: field.TypeString, Column: organizationhistory.FieldRef}, + organizationhistory.FieldOperation: {Type: field.TypeEnum, Column: organizationhistory.FieldOperation}, + organizationhistory.FieldCreatedAt: {Type: field.TypeTime, Column: organizationhistory.FieldCreatedAt}, + organizationhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: organizationhistory.FieldUpdatedAt}, + organizationhistory.FieldCreatedBy: {Type: field.TypeString, Column: organizationhistory.FieldCreatedBy}, + organizationhistory.FieldUpdatedBy: {Type: field.TypeString, Column: organizationhistory.FieldUpdatedBy}, + organizationhistory.FieldMappingID: {Type: field.TypeString, Column: organizationhistory.FieldMappingID}, + organizationhistory.FieldTags: {Type: field.TypeJSON, Column: organizationhistory.FieldTags}, + organizationhistory.FieldDeletedAt: {Type: field.TypeTime, Column: organizationhistory.FieldDeletedAt}, + organizationhistory.FieldDeletedBy: {Type: field.TypeString, Column: organizationhistory.FieldDeletedBy}, + organizationhistory.FieldName: {Type: field.TypeString, Column: organizationhistory.FieldName}, + organizationhistory.FieldDisplayName: {Type: field.TypeString, Column: organizationhistory.FieldDisplayName}, + organizationhistory.FieldDescription: {Type: field.TypeString, Column: organizationhistory.FieldDescription}, + organizationhistory.FieldParentOrganizationID: {Type: field.TypeString, Column: organizationhistory.FieldParentOrganizationID}, + organizationhistory.FieldPersonalOrg: {Type: field.TypeBool, Column: organizationhistory.FieldPersonalOrg}, + organizationhistory.FieldAvatarRemoteURL: {Type: field.TypeString, Column: organizationhistory.FieldAvatarRemoteURL}, + organizationhistory.FieldDedicatedDb: {Type: field.TypeBool, Column: organizationhistory.FieldDedicatedDb}, + }, + } + graph.Nodes[42] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: organizationsetting.Table, + Columns: organizationsetting.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: organizationsetting.FieldID, + }, + }, + Type: "OrganizationSetting", + Fields: map[string]*sqlgraph.FieldSpec{ + organizationsetting.FieldCreatedAt: {Type: field.TypeTime, Column: organizationsetting.FieldCreatedAt}, + organizationsetting.FieldUpdatedAt: {Type: field.TypeTime, Column: organizationsetting.FieldUpdatedAt}, + organizationsetting.FieldCreatedBy: {Type: field.TypeString, Column: organizationsetting.FieldCreatedBy}, + organizationsetting.FieldUpdatedBy: {Type: field.TypeString, Column: organizationsetting.FieldUpdatedBy}, + organizationsetting.FieldMappingID: {Type: field.TypeString, Column: organizationsetting.FieldMappingID}, + organizationsetting.FieldTags: {Type: field.TypeJSON, Column: organizationsetting.FieldTags}, + organizationsetting.FieldDeletedAt: {Type: field.TypeTime, Column: organizationsetting.FieldDeletedAt}, + organizationsetting.FieldDeletedBy: {Type: field.TypeString, Column: organizationsetting.FieldDeletedBy}, + organizationsetting.FieldDomains: {Type: field.TypeJSON, Column: organizationsetting.FieldDomains}, + organizationsetting.FieldBillingContact: {Type: field.TypeString, Column: organizationsetting.FieldBillingContact}, + organizationsetting.FieldBillingEmail: {Type: field.TypeString, Column: organizationsetting.FieldBillingEmail}, + organizationsetting.FieldBillingPhone: {Type: field.TypeString, Column: organizationsetting.FieldBillingPhone}, + organizationsetting.FieldBillingAddress: {Type: field.TypeString, Column: organizationsetting.FieldBillingAddress}, + organizationsetting.FieldTaxIdentifier: {Type: field.TypeString, Column: organizationsetting.FieldTaxIdentifier}, + organizationsetting.FieldGeoLocation: {Type: field.TypeEnum, Column: organizationsetting.FieldGeoLocation}, + organizationsetting.FieldOrganizationID: {Type: field.TypeString, Column: organizationsetting.FieldOrganizationID}, + }, + } + graph.Nodes[43] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: organizationsettinghistory.Table, + Columns: organizationsettinghistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: organizationsettinghistory.FieldID, + }, + }, + Type: "OrganizationSettingHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + organizationsettinghistory.FieldHistoryTime: {Type: field.TypeTime, Column: organizationsettinghistory.FieldHistoryTime}, + organizationsettinghistory.FieldRef: {Type: field.TypeString, Column: organizationsettinghistory.FieldRef}, + organizationsettinghistory.FieldOperation: {Type: field.TypeEnum, Column: organizationsettinghistory.FieldOperation}, + organizationsettinghistory.FieldCreatedAt: {Type: field.TypeTime, Column: organizationsettinghistory.FieldCreatedAt}, + organizationsettinghistory.FieldUpdatedAt: {Type: field.TypeTime, Column: organizationsettinghistory.FieldUpdatedAt}, + organizationsettinghistory.FieldCreatedBy: {Type: field.TypeString, Column: organizationsettinghistory.FieldCreatedBy}, + organizationsettinghistory.FieldUpdatedBy: {Type: field.TypeString, Column: organizationsettinghistory.FieldUpdatedBy}, + organizationsettinghistory.FieldMappingID: {Type: field.TypeString, Column: organizationsettinghistory.FieldMappingID}, + organizationsettinghistory.FieldTags: {Type: field.TypeJSON, Column: organizationsettinghistory.FieldTags}, + organizationsettinghistory.FieldDeletedAt: {Type: field.TypeTime, Column: organizationsettinghistory.FieldDeletedAt}, + organizationsettinghistory.FieldDeletedBy: {Type: field.TypeString, Column: organizationsettinghistory.FieldDeletedBy}, + organizationsettinghistory.FieldDomains: {Type: field.TypeJSON, Column: organizationsettinghistory.FieldDomains}, + organizationsettinghistory.FieldBillingContact: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingContact}, + organizationsettinghistory.FieldBillingEmail: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingEmail}, + organizationsettinghistory.FieldBillingPhone: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingPhone}, + organizationsettinghistory.FieldBillingAddress: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingAddress}, + organizationsettinghistory.FieldTaxIdentifier: {Type: field.TypeString, Column: organizationsettinghistory.FieldTaxIdentifier}, + organizationsettinghistory.FieldGeoLocation: {Type: field.TypeEnum, Column: organizationsettinghistory.FieldGeoLocation}, + organizationsettinghistory.FieldOrganizationID: {Type: field.TypeString, Column: organizationsettinghistory.FieldOrganizationID}, + }, + } + graph.Nodes[44] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: passwordresettoken.Table, + Columns: passwordresettoken.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: passwordresettoken.FieldID, + }, + }, + Type: "PasswordResetToken", + Fields: map[string]*sqlgraph.FieldSpec{ + passwordresettoken.FieldCreatedAt: {Type: field.TypeTime, Column: passwordresettoken.FieldCreatedAt}, + passwordresettoken.FieldUpdatedAt: {Type: field.TypeTime, Column: passwordresettoken.FieldUpdatedAt}, + passwordresettoken.FieldCreatedBy: {Type: field.TypeString, Column: passwordresettoken.FieldCreatedBy}, + passwordresettoken.FieldUpdatedBy: {Type: field.TypeString, Column: passwordresettoken.FieldUpdatedBy}, + passwordresettoken.FieldMappingID: {Type: field.TypeString, Column: passwordresettoken.FieldMappingID}, + passwordresettoken.FieldDeletedAt: {Type: field.TypeTime, Column: passwordresettoken.FieldDeletedAt}, + passwordresettoken.FieldDeletedBy: {Type: field.TypeString, Column: passwordresettoken.FieldDeletedBy}, + passwordresettoken.FieldOwnerID: {Type: field.TypeString, Column: passwordresettoken.FieldOwnerID}, + passwordresettoken.FieldToken: {Type: field.TypeString, Column: passwordresettoken.FieldToken}, + passwordresettoken.FieldTTL: {Type: field.TypeTime, Column: passwordresettoken.FieldTTL}, + passwordresettoken.FieldEmail: {Type: field.TypeString, Column: passwordresettoken.FieldEmail}, + passwordresettoken.FieldSecret: {Type: field.TypeBytes, Column: passwordresettoken.FieldSecret}, + }, + } + graph.Nodes[45] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: personalaccesstoken.Table, + Columns: personalaccesstoken.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: personalaccesstoken.FieldID, + }, + }, + Type: "PersonalAccessToken", + Fields: map[string]*sqlgraph.FieldSpec{ + personalaccesstoken.FieldCreatedAt: {Type: field.TypeTime, Column: personalaccesstoken.FieldCreatedAt}, + personalaccesstoken.FieldUpdatedAt: {Type: field.TypeTime, Column: personalaccesstoken.FieldUpdatedAt}, + personalaccesstoken.FieldCreatedBy: {Type: field.TypeString, Column: personalaccesstoken.FieldCreatedBy}, + personalaccesstoken.FieldUpdatedBy: {Type: field.TypeString, Column: personalaccesstoken.FieldUpdatedBy}, + personalaccesstoken.FieldDeletedAt: {Type: field.TypeTime, Column: personalaccesstoken.FieldDeletedAt}, + personalaccesstoken.FieldDeletedBy: {Type: field.TypeString, Column: personalaccesstoken.FieldDeletedBy}, + personalaccesstoken.FieldMappingID: {Type: field.TypeString, Column: personalaccesstoken.FieldMappingID}, + personalaccesstoken.FieldTags: {Type: field.TypeJSON, Column: personalaccesstoken.FieldTags}, + personalaccesstoken.FieldOwnerID: {Type: field.TypeString, Column: personalaccesstoken.FieldOwnerID}, + personalaccesstoken.FieldName: {Type: field.TypeString, Column: personalaccesstoken.FieldName}, + personalaccesstoken.FieldToken: {Type: field.TypeString, Column: personalaccesstoken.FieldToken}, + personalaccesstoken.FieldExpiresAt: {Type: field.TypeTime, Column: personalaccesstoken.FieldExpiresAt}, + personalaccesstoken.FieldDescription: {Type: field.TypeString, Column: personalaccesstoken.FieldDescription}, + personalaccesstoken.FieldScopes: {Type: field.TypeJSON, Column: personalaccesstoken.FieldScopes}, + personalaccesstoken.FieldLastUsedAt: {Type: field.TypeTime, Column: personalaccesstoken.FieldLastUsedAt}, + }, + } + graph.Nodes[46] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: subscriber.Table, + Columns: subscriber.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: subscriber.FieldID, + }, + }, + Type: "Subscriber", + Fields: map[string]*sqlgraph.FieldSpec{ + subscriber.FieldCreatedAt: {Type: field.TypeTime, Column: subscriber.FieldCreatedAt}, + subscriber.FieldUpdatedAt: {Type: field.TypeTime, Column: subscriber.FieldUpdatedAt}, + subscriber.FieldCreatedBy: {Type: field.TypeString, Column: subscriber.FieldCreatedBy}, + subscriber.FieldUpdatedBy: {Type: field.TypeString, Column: subscriber.FieldUpdatedBy}, + subscriber.FieldMappingID: {Type: field.TypeString, Column: subscriber.FieldMappingID}, + subscriber.FieldTags: {Type: field.TypeJSON, Column: subscriber.FieldTags}, + subscriber.FieldDeletedAt: {Type: field.TypeTime, Column: subscriber.FieldDeletedAt}, + subscriber.FieldDeletedBy: {Type: field.TypeString, Column: subscriber.FieldDeletedBy}, + subscriber.FieldOwnerID: {Type: field.TypeString, Column: subscriber.FieldOwnerID}, + subscriber.FieldEmail: {Type: field.TypeString, Column: subscriber.FieldEmail}, + subscriber.FieldPhoneNumber: {Type: field.TypeString, Column: subscriber.FieldPhoneNumber}, + subscriber.FieldVerifiedEmail: {Type: field.TypeBool, Column: subscriber.FieldVerifiedEmail}, + subscriber.FieldVerifiedPhone: {Type: field.TypeBool, Column: subscriber.FieldVerifiedPhone}, + subscriber.FieldActive: {Type: field.TypeBool, Column: subscriber.FieldActive}, + subscriber.FieldToken: {Type: field.TypeString, Column: subscriber.FieldToken}, + subscriber.FieldTTL: {Type: field.TypeTime, Column: subscriber.FieldTTL}, + subscriber.FieldSecret: {Type: field.TypeBytes, Column: subscriber.FieldSecret}, + }, + } + graph.Nodes[47] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: tfasetting.Table, + Columns: tfasetting.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: tfasetting.FieldID, + }, + }, + Type: "TFASetting", + Fields: map[string]*sqlgraph.FieldSpec{ + tfasetting.FieldCreatedAt: {Type: field.TypeTime, Column: tfasetting.FieldCreatedAt}, + tfasetting.FieldUpdatedAt: {Type: field.TypeTime, Column: tfasetting.FieldUpdatedAt}, + tfasetting.FieldCreatedBy: {Type: field.TypeString, Column: tfasetting.FieldCreatedBy}, + tfasetting.FieldUpdatedBy: {Type: field.TypeString, Column: tfasetting.FieldUpdatedBy}, + tfasetting.FieldMappingID: {Type: field.TypeString, Column: tfasetting.FieldMappingID}, + tfasetting.FieldDeletedAt: {Type: field.TypeTime, Column: tfasetting.FieldDeletedAt}, + tfasetting.FieldDeletedBy: {Type: field.TypeString, Column: tfasetting.FieldDeletedBy}, + tfasetting.FieldTags: {Type: field.TypeJSON, Column: tfasetting.FieldTags}, + tfasetting.FieldOwnerID: {Type: field.TypeString, Column: tfasetting.FieldOwnerID}, + tfasetting.FieldTfaSecret: {Type: field.TypeString, Column: tfasetting.FieldTfaSecret}, + tfasetting.FieldVerified: {Type: field.TypeBool, Column: tfasetting.FieldVerified}, + tfasetting.FieldRecoveryCodes: {Type: field.TypeJSON, Column: tfasetting.FieldRecoveryCodes}, + tfasetting.FieldPhoneOtpAllowed: {Type: field.TypeBool, Column: tfasetting.FieldPhoneOtpAllowed}, + tfasetting.FieldEmailOtpAllowed: {Type: field.TypeBool, Column: tfasetting.FieldEmailOtpAllowed}, + tfasetting.FieldTotpAllowed: {Type: field.TypeBool, Column: tfasetting.FieldTotpAllowed}, + }, + } + graph.Nodes[48] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: template.Table, + Columns: template.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: template.FieldID, + }, + }, + Type: "Template", + Fields: map[string]*sqlgraph.FieldSpec{ + template.FieldCreatedAt: {Type: field.TypeTime, Column: template.FieldCreatedAt}, + template.FieldUpdatedAt: {Type: field.TypeTime, Column: template.FieldUpdatedAt}, + template.FieldCreatedBy: {Type: field.TypeString, Column: template.FieldCreatedBy}, + template.FieldUpdatedBy: {Type: field.TypeString, Column: template.FieldUpdatedBy}, + template.FieldDeletedAt: {Type: field.TypeTime, Column: template.FieldDeletedAt}, + template.FieldDeletedBy: {Type: field.TypeString, Column: template.FieldDeletedBy}, + template.FieldMappingID: {Type: field.TypeString, Column: template.FieldMappingID}, + template.FieldTags: {Type: field.TypeJSON, Column: template.FieldTags}, + template.FieldOwnerID: {Type: field.TypeString, Column: template.FieldOwnerID}, + template.FieldName: {Type: field.TypeString, Column: template.FieldName}, + template.FieldTemplateType: {Type: field.TypeEnum, Column: template.FieldTemplateType}, + template.FieldDescription: {Type: field.TypeString, Column: template.FieldDescription}, + template.FieldJsonconfig: {Type: field.TypeJSON, Column: template.FieldJsonconfig}, + template.FieldUischema: {Type: field.TypeJSON, Column: template.FieldUischema}, + }, + } + graph.Nodes[49] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: templatehistory.Table, + Columns: templatehistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: templatehistory.FieldID, + }, + }, + Type: "TemplateHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + templatehistory.FieldHistoryTime: {Type: field.TypeTime, Column: templatehistory.FieldHistoryTime}, + templatehistory.FieldRef: {Type: field.TypeString, Column: templatehistory.FieldRef}, + templatehistory.FieldOperation: {Type: field.TypeEnum, Column: templatehistory.FieldOperation}, + templatehistory.FieldCreatedAt: {Type: field.TypeTime, Column: templatehistory.FieldCreatedAt}, + templatehistory.FieldUpdatedAt: {Type: field.TypeTime, Column: templatehistory.FieldUpdatedAt}, + templatehistory.FieldCreatedBy: {Type: field.TypeString, Column: templatehistory.FieldCreatedBy}, + templatehistory.FieldUpdatedBy: {Type: field.TypeString, Column: templatehistory.FieldUpdatedBy}, + templatehistory.FieldDeletedAt: {Type: field.TypeTime, Column: templatehistory.FieldDeletedAt}, + templatehistory.FieldDeletedBy: {Type: field.TypeString, Column: templatehistory.FieldDeletedBy}, + templatehistory.FieldMappingID: {Type: field.TypeString, Column: templatehistory.FieldMappingID}, + templatehistory.FieldTags: {Type: field.TypeJSON, Column: templatehistory.FieldTags}, + templatehistory.FieldOwnerID: {Type: field.TypeString, Column: templatehistory.FieldOwnerID}, + templatehistory.FieldName: {Type: field.TypeString, Column: templatehistory.FieldName}, + templatehistory.FieldTemplateType: {Type: field.TypeEnum, Column: templatehistory.FieldTemplateType}, + templatehistory.FieldDescription: {Type: field.TypeString, Column: templatehistory.FieldDescription}, + templatehistory.FieldJsonconfig: {Type: field.TypeJSON, Column: templatehistory.FieldJsonconfig}, + templatehistory.FieldUischema: {Type: field.TypeJSON, Column: templatehistory.FieldUischema}, + }, + } + graph.Nodes[50] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: user.Table, + Columns: user.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: user.FieldID, + }, + }, + Type: "User", + Fields: map[string]*sqlgraph.FieldSpec{ + user.FieldCreatedAt: {Type: field.TypeTime, Column: user.FieldCreatedAt}, + user.FieldUpdatedAt: {Type: field.TypeTime, Column: user.FieldUpdatedAt}, + user.FieldCreatedBy: {Type: field.TypeString, Column: user.FieldCreatedBy}, + user.FieldUpdatedBy: {Type: field.TypeString, Column: user.FieldUpdatedBy}, + user.FieldDeletedAt: {Type: field.TypeTime, Column: user.FieldDeletedAt}, + user.FieldDeletedBy: {Type: field.TypeString, Column: user.FieldDeletedBy}, + user.FieldMappingID: {Type: field.TypeString, Column: user.FieldMappingID}, + user.FieldTags: {Type: field.TypeJSON, Column: user.FieldTags}, + user.FieldEmail: {Type: field.TypeString, Column: user.FieldEmail}, + user.FieldFirstName: {Type: field.TypeString, Column: user.FieldFirstName}, + user.FieldLastName: {Type: field.TypeString, Column: user.FieldLastName}, + user.FieldDisplayName: {Type: field.TypeString, Column: user.FieldDisplayName}, + user.FieldAvatarRemoteURL: {Type: field.TypeString, Column: user.FieldAvatarRemoteURL}, + user.FieldAvatarLocalFile: {Type: field.TypeString, Column: user.FieldAvatarLocalFile}, + user.FieldAvatarUpdatedAt: {Type: field.TypeTime, Column: user.FieldAvatarUpdatedAt}, + user.FieldLastSeen: {Type: field.TypeTime, Column: user.FieldLastSeen}, + user.FieldPassword: {Type: field.TypeString, Column: user.FieldPassword}, + user.FieldSub: {Type: field.TypeString, Column: user.FieldSub}, + user.FieldAuthProvider: {Type: field.TypeEnum, Column: user.FieldAuthProvider}, + user.FieldRole: {Type: field.TypeEnum, Column: user.FieldRole}, + }, + } + graph.Nodes[51] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: userhistory.Table, + Columns: userhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: userhistory.FieldID, + }, + }, + Type: "UserHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + userhistory.FieldHistoryTime: {Type: field.TypeTime, Column: userhistory.FieldHistoryTime}, + userhistory.FieldRef: {Type: field.TypeString, Column: userhistory.FieldRef}, + userhistory.FieldOperation: {Type: field.TypeEnum, Column: userhistory.FieldOperation}, + userhistory.FieldCreatedAt: {Type: field.TypeTime, Column: userhistory.FieldCreatedAt}, + userhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: userhistory.FieldUpdatedAt}, + userhistory.FieldCreatedBy: {Type: field.TypeString, Column: userhistory.FieldCreatedBy}, + userhistory.FieldUpdatedBy: {Type: field.TypeString, Column: userhistory.FieldUpdatedBy}, + userhistory.FieldDeletedAt: {Type: field.TypeTime, Column: userhistory.FieldDeletedAt}, + userhistory.FieldDeletedBy: {Type: field.TypeString, Column: userhistory.FieldDeletedBy}, + userhistory.FieldMappingID: {Type: field.TypeString, Column: userhistory.FieldMappingID}, + userhistory.FieldTags: {Type: field.TypeJSON, Column: userhistory.FieldTags}, + userhistory.FieldEmail: {Type: field.TypeString, Column: userhistory.FieldEmail}, + userhistory.FieldFirstName: {Type: field.TypeString, Column: userhistory.FieldFirstName}, + userhistory.FieldLastName: {Type: field.TypeString, Column: userhistory.FieldLastName}, + userhistory.FieldDisplayName: {Type: field.TypeString, Column: userhistory.FieldDisplayName}, + userhistory.FieldAvatarRemoteURL: {Type: field.TypeString, Column: userhistory.FieldAvatarRemoteURL}, + userhistory.FieldAvatarLocalFile: {Type: field.TypeString, Column: userhistory.FieldAvatarLocalFile}, + userhistory.FieldAvatarUpdatedAt: {Type: field.TypeTime, Column: userhistory.FieldAvatarUpdatedAt}, + userhistory.FieldLastSeen: {Type: field.TypeTime, Column: userhistory.FieldLastSeen}, + userhistory.FieldPassword: {Type: field.TypeString, Column: userhistory.FieldPassword}, + userhistory.FieldSub: {Type: field.TypeString, Column: userhistory.FieldSub}, + userhistory.FieldAuthProvider: {Type: field.TypeEnum, Column: userhistory.FieldAuthProvider}, + userhistory.FieldRole: {Type: field.TypeEnum, Column: userhistory.FieldRole}, + }, + } + graph.Nodes[52] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: usersetting.Table, + Columns: usersetting.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: usersetting.FieldID, + }, + }, + Type: "UserSetting", + Fields: map[string]*sqlgraph.FieldSpec{ + usersetting.FieldCreatedAt: {Type: field.TypeTime, Column: usersetting.FieldCreatedAt}, + usersetting.FieldUpdatedAt: {Type: field.TypeTime, Column: usersetting.FieldUpdatedAt}, + usersetting.FieldCreatedBy: {Type: field.TypeString, Column: usersetting.FieldCreatedBy}, + usersetting.FieldUpdatedBy: {Type: field.TypeString, Column: usersetting.FieldUpdatedBy}, + usersetting.FieldMappingID: {Type: field.TypeString, Column: usersetting.FieldMappingID}, + usersetting.FieldTags: {Type: field.TypeJSON, Column: usersetting.FieldTags}, + usersetting.FieldDeletedAt: {Type: field.TypeTime, Column: usersetting.FieldDeletedAt}, + usersetting.FieldDeletedBy: {Type: field.TypeString, Column: usersetting.FieldDeletedBy}, + usersetting.FieldUserID: {Type: field.TypeString, Column: usersetting.FieldUserID}, + usersetting.FieldLocked: {Type: field.TypeBool, Column: usersetting.FieldLocked}, + usersetting.FieldSilencedAt: {Type: field.TypeTime, Column: usersetting.FieldSilencedAt}, + usersetting.FieldSuspendedAt: {Type: field.TypeTime, Column: usersetting.FieldSuspendedAt}, + usersetting.FieldStatus: {Type: field.TypeEnum, Column: usersetting.FieldStatus}, + usersetting.FieldEmailConfirmed: {Type: field.TypeBool, Column: usersetting.FieldEmailConfirmed}, + usersetting.FieldIsWebauthnAllowed: {Type: field.TypeBool, Column: usersetting.FieldIsWebauthnAllowed}, + usersetting.FieldIsTfaEnabled: {Type: field.TypeBool, Column: usersetting.FieldIsTfaEnabled}, + usersetting.FieldPhoneNumber: {Type: field.TypeString, Column: usersetting.FieldPhoneNumber}, + }, + } + graph.Nodes[53] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: usersettinghistory.Table, + Columns: usersettinghistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: usersettinghistory.FieldID, + }, + }, + Type: "UserSettingHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + usersettinghistory.FieldHistoryTime: {Type: field.TypeTime, Column: usersettinghistory.FieldHistoryTime}, + usersettinghistory.FieldRef: {Type: field.TypeString, Column: usersettinghistory.FieldRef}, + usersettinghistory.FieldOperation: {Type: field.TypeEnum, Column: usersettinghistory.FieldOperation}, + usersettinghistory.FieldCreatedAt: {Type: field.TypeTime, Column: usersettinghistory.FieldCreatedAt}, + usersettinghistory.FieldUpdatedAt: {Type: field.TypeTime, Column: usersettinghistory.FieldUpdatedAt}, + usersettinghistory.FieldCreatedBy: {Type: field.TypeString, Column: usersettinghistory.FieldCreatedBy}, + usersettinghistory.FieldUpdatedBy: {Type: field.TypeString, Column: usersettinghistory.FieldUpdatedBy}, + usersettinghistory.FieldMappingID: {Type: field.TypeString, Column: usersettinghistory.FieldMappingID}, + usersettinghistory.FieldTags: {Type: field.TypeJSON, Column: usersettinghistory.FieldTags}, + usersettinghistory.FieldDeletedAt: {Type: field.TypeTime, Column: usersettinghistory.FieldDeletedAt}, + usersettinghistory.FieldDeletedBy: {Type: field.TypeString, Column: usersettinghistory.FieldDeletedBy}, + usersettinghistory.FieldUserID: {Type: field.TypeString, Column: usersettinghistory.FieldUserID}, + usersettinghistory.FieldLocked: {Type: field.TypeBool, Column: usersettinghistory.FieldLocked}, + usersettinghistory.FieldSilencedAt: {Type: field.TypeTime, Column: usersettinghistory.FieldSilencedAt}, + usersettinghistory.FieldSuspendedAt: {Type: field.TypeTime, Column: usersettinghistory.FieldSuspendedAt}, + usersettinghistory.FieldStatus: {Type: field.TypeEnum, Column: usersettinghistory.FieldStatus}, + usersettinghistory.FieldEmailConfirmed: {Type: field.TypeBool, Column: usersettinghistory.FieldEmailConfirmed}, + usersettinghistory.FieldIsWebauthnAllowed: {Type: field.TypeBool, Column: usersettinghistory.FieldIsWebauthnAllowed}, + usersettinghistory.FieldIsTfaEnabled: {Type: field.TypeBool, Column: usersettinghistory.FieldIsTfaEnabled}, + usersettinghistory.FieldPhoneNumber: {Type: field.TypeString, Column: usersettinghistory.FieldPhoneNumber}, + }, + } + graph.Nodes[54] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: webauthn.Table, + Columns: webauthn.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: webauthn.FieldID, + }, + }, + Type: "Webauthn", + Fields: map[string]*sqlgraph.FieldSpec{ + webauthn.FieldCreatedAt: {Type: field.TypeTime, Column: webauthn.FieldCreatedAt}, + webauthn.FieldUpdatedAt: {Type: field.TypeTime, Column: webauthn.FieldUpdatedAt}, + webauthn.FieldCreatedBy: {Type: field.TypeString, Column: webauthn.FieldCreatedBy}, + webauthn.FieldUpdatedBy: {Type: field.TypeString, Column: webauthn.FieldUpdatedBy}, + webauthn.FieldMappingID: {Type: field.TypeString, Column: webauthn.FieldMappingID}, + webauthn.FieldTags: {Type: field.TypeJSON, Column: webauthn.FieldTags}, + webauthn.FieldOwnerID: {Type: field.TypeString, Column: webauthn.FieldOwnerID}, + webauthn.FieldCredentialID: {Type: field.TypeBytes, Column: webauthn.FieldCredentialID}, + webauthn.FieldPublicKey: {Type: field.TypeBytes, Column: webauthn.FieldPublicKey}, + webauthn.FieldAttestationType: {Type: field.TypeString, Column: webauthn.FieldAttestationType}, + webauthn.FieldAaguid: {Type: field.TypeBytes, Column: webauthn.FieldAaguid}, + webauthn.FieldSignCount: {Type: field.TypeInt32, Column: webauthn.FieldSignCount}, + webauthn.FieldTransports: {Type: field.TypeJSON, Column: webauthn.FieldTransports}, + webauthn.FieldBackupEligible: {Type: field.TypeBool, Column: webauthn.FieldBackupEligible}, + webauthn.FieldBackupState: {Type: field.TypeBool, Column: webauthn.FieldBackupState}, + webauthn.FieldUserPresent: {Type: field.TypeBool, Column: webauthn.FieldUserPresent}, + webauthn.FieldUserVerified: {Type: field.TypeBool, Column: webauthn.FieldUserVerified}, + }, + } + graph.Nodes[55] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: webhook.Table, + Columns: webhook.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: webhook.FieldID, + }, + }, + Type: "Webhook", + Fields: map[string]*sqlgraph.FieldSpec{ + webhook.FieldCreatedAt: {Type: field.TypeTime, Column: webhook.FieldCreatedAt}, + webhook.FieldUpdatedAt: {Type: field.TypeTime, Column: webhook.FieldUpdatedAt}, + webhook.FieldCreatedBy: {Type: field.TypeString, Column: webhook.FieldCreatedBy}, + webhook.FieldUpdatedBy: {Type: field.TypeString, Column: webhook.FieldUpdatedBy}, + webhook.FieldMappingID: {Type: field.TypeString, Column: webhook.FieldMappingID}, + webhook.FieldTags: {Type: field.TypeJSON, Column: webhook.FieldTags}, + webhook.FieldDeletedAt: {Type: field.TypeTime, Column: webhook.FieldDeletedAt}, + webhook.FieldDeletedBy: {Type: field.TypeString, Column: webhook.FieldDeletedBy}, + webhook.FieldOwnerID: {Type: field.TypeString, Column: webhook.FieldOwnerID}, + webhook.FieldName: {Type: field.TypeString, Column: webhook.FieldName}, + webhook.FieldDescription: {Type: field.TypeString, Column: webhook.FieldDescription}, + webhook.FieldDestinationURL: {Type: field.TypeString, Column: webhook.FieldDestinationURL}, + webhook.FieldEnabled: {Type: field.TypeBool, Column: webhook.FieldEnabled}, + webhook.FieldCallback: {Type: field.TypeString, Column: webhook.FieldCallback}, + webhook.FieldExpiresAt: {Type: field.TypeTime, Column: webhook.FieldExpiresAt}, + webhook.FieldSecret: {Type: field.TypeBytes, Column: webhook.FieldSecret}, + webhook.FieldFailures: {Type: field.TypeInt, Column: webhook.FieldFailures}, + webhook.FieldLastError: {Type: field.TypeString, Column: webhook.FieldLastError}, + webhook.FieldLastResponse: {Type: field.TypeString, Column: webhook.FieldLastResponse}, + }, + } + graph.Nodes[56] = &sqlgraph.Node{ + NodeSpec: sqlgraph.NodeSpec{ + Table: webhookhistory.Table, + Columns: webhookhistory.Columns, + ID: &sqlgraph.FieldSpec{ + Type: field.TypeString, + Column: webhookhistory.FieldID, + }, + }, + Type: "WebhookHistory", + Fields: map[string]*sqlgraph.FieldSpec{ + webhookhistory.FieldHistoryTime: {Type: field.TypeTime, Column: webhookhistory.FieldHistoryTime}, + webhookhistory.FieldRef: {Type: field.TypeString, Column: webhookhistory.FieldRef}, + webhookhistory.FieldOperation: {Type: field.TypeEnum, Column: webhookhistory.FieldOperation}, + webhookhistory.FieldCreatedAt: {Type: field.TypeTime, Column: webhookhistory.FieldCreatedAt}, + webhookhistory.FieldUpdatedAt: {Type: field.TypeTime, Column: webhookhistory.FieldUpdatedAt}, + webhookhistory.FieldCreatedBy: {Type: field.TypeString, Column: webhookhistory.FieldCreatedBy}, + webhookhistory.FieldUpdatedBy: {Type: field.TypeString, Column: webhookhistory.FieldUpdatedBy}, + webhookhistory.FieldMappingID: {Type: field.TypeString, Column: webhookhistory.FieldMappingID}, + webhookhistory.FieldTags: {Type: field.TypeJSON, Column: webhookhistory.FieldTags}, + webhookhistory.FieldDeletedAt: {Type: field.TypeTime, Column: webhookhistory.FieldDeletedAt}, + webhookhistory.FieldDeletedBy: {Type: field.TypeString, Column: webhookhistory.FieldDeletedBy}, + webhookhistory.FieldOwnerID: {Type: field.TypeString, Column: webhookhistory.FieldOwnerID}, + webhookhistory.FieldName: {Type: field.TypeString, Column: webhookhistory.FieldName}, + webhookhistory.FieldDescription: {Type: field.TypeString, Column: webhookhistory.FieldDescription}, + webhookhistory.FieldDestinationURL: {Type: field.TypeString, Column: webhookhistory.FieldDestinationURL}, + webhookhistory.FieldEnabled: {Type: field.TypeBool, Column: webhookhistory.FieldEnabled}, + webhookhistory.FieldCallback: {Type: field.TypeString, Column: webhookhistory.FieldCallback}, + webhookhistory.FieldExpiresAt: {Type: field.TypeTime, Column: webhookhistory.FieldExpiresAt}, + webhookhistory.FieldSecret: {Type: field.TypeBytes, Column: webhookhistory.FieldSecret}, + webhookhistory.FieldFailures: {Type: field.TypeInt, Column: webhookhistory.FieldFailures}, + webhookhistory.FieldLastError: {Type: field.TypeString, Column: webhookhistory.FieldLastError}, + webhookhistory.FieldLastResponse: {Type: field.TypeString, Column: webhookhistory.FieldLastResponse}, + }, + } + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: apitoken.OwnerTable, + Columns: []string{apitoken.OwnerColumn}, + Bidi: false, + }, + "APIToken", + "Organization", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: contact.OwnerTable, + Columns: []string{contact.OwnerColumn}, + Bidi: false, + }, + "Contact", + "Organization", + ) + graph.MustAddE( + "entities", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: contact.EntitiesTable, + Columns: contact.EntitiesPrimaryKey, + Bidi: false, + }, + "Contact", + "Entity", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.OwnerTable, + Columns: []string{documentdata.OwnerColumn}, + Bidi: false, + }, + "DocumentData", + "Organization", + ) + graph.MustAddE( + "template", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: documentdata.TemplateTable, + Columns: []string{documentdata.TemplateColumn}, + Bidi: false, + }, + "DocumentData", + "Template", + ) + graph.MustAddE( + "entity", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: documentdata.EntityTable, + Columns: documentdata.EntityPrimaryKey, + Bidi: false, + }, + "DocumentData", + "Entity", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: emailverificationtoken.OwnerTable, + Columns: []string{emailverificationtoken.OwnerColumn}, + Bidi: false, + }, + "EmailVerificationToken", + "User", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OwnerTable, + Columns: []string{entitlement.OwnerColumn}, + Bidi: false, + }, + "Entitlement", + "Organization", + ) + graph.MustAddE( + "plan", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.PlanTable, + Columns: []string{entitlement.PlanColumn}, + Bidi: false, + }, + "Entitlement", + "EntitlementPlan", + ) + graph.MustAddE( + "organization", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlement.OrganizationTable, + Columns: []string{entitlement.OrganizationColumn}, + Bidi: false, + }, + "Entitlement", + "Organization", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlement.EventsTable, + Columns: entitlement.EventsPrimaryKey, + Bidi: false, + }, + "Entitlement", + "Event", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplan.OwnerTable, + Columns: []string{entitlementplan.OwnerColumn}, + Bidi: false, + }, + "EntitlementPlan", + "Organization", + ) + graph.MustAddE( + "entitlements", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitlementplan.EntitlementsTable, + Columns: []string{entitlementplan.EntitlementsColumn}, + Bidi: false, + }, + "EntitlementPlan", + "Entitlement", + ) + graph.MustAddE( + "base_features", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: entitlementplan.BaseFeaturesTable, + Columns: entitlementplan.BaseFeaturesPrimaryKey, + Bidi: false, + }, + "EntitlementPlan", + "Feature", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplan.EventsTable, + Columns: entitlementplan.EventsPrimaryKey, + Bidi: false, + }, + "EntitlementPlan", + "Event", + ) + graph.MustAddE( + "features", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: entitlementplan.FeaturesTable, + Columns: []string{entitlementplan.FeaturesColumn}, + Bidi: false, + }, + "EntitlementPlan", + "EntitlementPlanFeature", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitlementplanfeature.OwnerTable, + Columns: []string{entitlementplanfeature.OwnerColumn}, + Bidi: false, + }, + "EntitlementPlanFeature", + "Organization", + ) + graph.MustAddE( + "plan", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entitlementplanfeature.PlanTable, + Columns: []string{entitlementplanfeature.PlanColumn}, + Bidi: false, + }, + "EntitlementPlanFeature", + "EntitlementPlan", + ) + graph.MustAddE( + "feature", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entitlementplanfeature.FeatureTable, + Columns: []string{entitlementplanfeature.FeatureColumn}, + Bidi: false, + }, + "EntitlementPlanFeature", + "Feature", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entitlementplanfeature.EventsTable, + Columns: entitlementplanfeature.EventsPrimaryKey, + Bidi: false, + }, + "EntitlementPlanFeature", + "Event", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entity.OwnerTable, + Columns: []string{entity.OwnerColumn}, + Bidi: false, + }, + "Entity", + "Organization", + ) + graph.MustAddE( + "contacts", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.ContactsTable, + Columns: entity.ContactsPrimaryKey, + Bidi: false, + }, + "Entity", + "Contact", + ) + graph.MustAddE( + "documents", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.DocumentsTable, + Columns: entity.DocumentsPrimaryKey, + Bidi: false, + }, + "Entity", + "DocumentData", + ) + graph.MustAddE( + "notes", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entity.NotesTable, + Columns: []string{entity.NotesColumn}, + Bidi: false, + }, + "Entity", + "Note", + ) + graph.MustAddE( + "files", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: entity.FilesTable, + Columns: entity.FilesPrimaryKey, + Bidi: false, + }, + "Entity", + "File", + ) + graph.MustAddE( + "entity_type", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: entity.EntityTypeTable, + Columns: []string{entity.EntityTypeColumn}, + Bidi: false, + }, + "Entity", + "EntityType", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: entitytype.OwnerTable, + Columns: []string{entitytype.OwnerColumn}, + Bidi: false, + }, + "EntityType", + "Organization", + ) + graph.MustAddE( + "entities", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: entitytype.EntitiesTable, + Columns: []string{entitytype.EntitiesColumn}, + Bidi: false, + }, + "EntityType", + "Entity", + ) + graph.MustAddE( + "user", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + }, + "Event", + "User", + ) + graph.MustAddE( + "group", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + }, + "Event", + "Group", + ) + graph.MustAddE( + "integration", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + }, + "Event", + "Integration", + ) + graph.MustAddE( + "organization", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + }, + "Event", + "Organization", + ) + graph.MustAddE( + "invite", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + }, + "Event", + "Invite", + ) + graph.MustAddE( + "feature", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + }, + "Event", + "Feature", + ) + graph.MustAddE( + "entitlementplan", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + }, + "Event", + "EntitlementPlan", + ) + graph.MustAddE( + "entitlementplanfeature", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + }, + "Event", + "EntitlementPlanFeature", + ) + graph.MustAddE( + "personal_access_token", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + }, + "Event", + "PersonalAccessToken", + ) + graph.MustAddE( + "oauth2token", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + }, + "Event", + "OhAuthTooToken", + ) + graph.MustAddE( + "hush", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + }, + "Event", + "Hush", + ) + graph.MustAddE( + "orgmembership", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + }, + "Event", + "OrgMembership", + ) + graph.MustAddE( + "groupmembership", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + }, + "Event", + "GroupMembership", + ) + graph.MustAddE( + "entitlement", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + }, + "Event", + "Entitlement", + ) + graph.MustAddE( + "webhook", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + }, + "Event", + "Webhook", + ) + graph.MustAddE( + "subscriber", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + }, + "Event", + "Subscriber", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: feature.OwnerTable, + Columns: []string{feature.OwnerColumn}, + Bidi: false, + }, + "Feature", + "Organization", + ) + graph.MustAddE( + "plans", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + }, + "Feature", + "EntitlementPlan", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + }, + "Feature", + "Event", + ) + graph.MustAddE( + "features", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + }, + "Feature", + "EntitlementPlanFeature", + ) + graph.MustAddE( + "user", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: file.UserTable, + Columns: []string{file.UserColumn}, + Bidi: false, + }, + "File", + "User", + ) + graph.MustAddE( + "organization", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + }, + "File", + "Organization", + ) + graph.MustAddE( + "entity", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + }, + "File", + "Entity", + ) + graph.MustAddE( + "group", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + }, + "File", + "Group", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: group.OwnerTable, + Columns: []string{group.OwnerColumn}, + Bidi: false, + }, + "Group", + "Organization", + ) + graph.MustAddE( + "setting", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: group.SettingTable, + Columns: []string{group.SettingColumn}, + Bidi: false, + }, + "Group", + "GroupSetting", + ) + graph.MustAddE( + "users", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + }, + "Group", + "User", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + }, + "Group", + "Event", + ) + graph.MustAddE( + "integrations", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + }, + "Group", + "Integration", + ) + graph.MustAddE( + "files", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + }, + "Group", + "File", + ) + graph.MustAddE( + "members", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + }, + "Group", + "GroupMembership", + ) + graph.MustAddE( + "group", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: groupmembership.GroupTable, + Columns: []string{groupmembership.GroupColumn}, + Bidi: false, + }, + "GroupMembership", + "Group", + ) + graph.MustAddE( + "user", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: groupmembership.UserTable, + Columns: []string{groupmembership.UserColumn}, + Bidi: false, + }, + "GroupMembership", + "User", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + }, + "GroupMembership", + "Event", + ) + graph.MustAddE( + "group", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: groupsetting.GroupTable, + Columns: []string{groupsetting.GroupColumn}, + Bidi: false, + }, + "GroupSetting", + "Group", + ) + graph.MustAddE( + "integrations", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + }, + "Hush", + "Integration", + ) + graph.MustAddE( + "organization", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + }, + "Hush", + "Organization", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + }, + "Hush", + "Event", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: integration.OwnerTable, + Columns: []string{integration.OwnerColumn}, + Bidi: false, + }, + "Integration", + "Organization", + ) + graph.MustAddE( + "secrets", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + }, + "Integration", + "Hush", + ) + graph.MustAddE( + "oauth2tokens", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + }, + "Integration", + "OhAuthTooToken", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + }, + "Integration", + "Event", + ) + graph.MustAddE( + "webhooks", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + }, + "Integration", + "Webhook", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: invite.OwnerTable, + Columns: []string{invite.OwnerColumn}, + Bidi: false, + }, + "Invite", + "Organization", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + }, + "Invite", + "Event", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.OwnerTable, + Columns: []string{note.OwnerColumn}, + Bidi: false, + }, + "Note", + "Organization", + ) + graph.MustAddE( + "entity", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.EntityTable, + Columns: []string{note.EntityColumn}, + Bidi: false, + }, + "Note", + "Entity", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: oauthprovider.OwnerTable, + Columns: []string{oauthprovider.OwnerColumn}, + Bidi: false, + }, + "OauthProvider", + "Organization", + ) + graph.MustAddE( + "integration", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + }, + "OhAuthTooToken", + "Integration", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + }, + "OhAuthTooToken", + "Event", + ) + graph.MustAddE( + "organization", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: orgmembership.OrganizationTable, + Columns: []string{orgmembership.OrganizationColumn}, + Bidi: false, + }, + "OrgMembership", + "Organization", + ) + graph.MustAddE( + "user", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: orgmembership.UserTable, + Columns: []string{orgmembership.UserColumn}, + Bidi: false, + }, + "OrgMembership", + "User", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + }, + "OrgMembership", + "Event", + ) + graph.MustAddE( + "parent", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + }, + "Organization", + "Organization", + ) + graph.MustAddE( + "children", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + }, + "Organization", + "Organization", + ) + graph.MustAddE( + "groups", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + }, + "Organization", + "Group", + ) + graph.MustAddE( + "templates", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + }, + "Organization", + "Template", + ) + graph.MustAddE( + "integrations", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + }, + "Organization", + "Integration", + ) + graph.MustAddE( + "setting", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: organization.SettingTable, + Columns: []string{organization.SettingColumn}, + Bidi: false, + }, + "Organization", + "OrganizationSetting", + ) + graph.MustAddE( + "documentdata", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + }, + "Organization", + "DocumentData", + ) + graph.MustAddE( + "entitlements", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + }, + "Organization", + "Entitlement", + ) + graph.MustAddE( + "organization_entitlement", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + }, + "Organization", + "Entitlement", + ) + graph.MustAddE( + "personal_access_tokens", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + }, + "Organization", + "PersonalAccessToken", + ) + graph.MustAddE( + "api_tokens", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + }, + "Organization", + "APIToken", + ) + graph.MustAddE( + "oauthprovider", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + }, + "Organization", + "OauthProvider", + ) + graph.MustAddE( + "users", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + }, + "Organization", + "User", + ) + graph.MustAddE( + "invites", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + }, + "Organization", + "Invite", + ) + graph.MustAddE( + "subscribers", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + }, + "Organization", + "Subscriber", + ) + graph.MustAddE( + "webhooks", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + }, + "Organization", + "Webhook", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + }, + "Organization", + "Event", + ) + graph.MustAddE( + "secrets", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + }, + "Organization", + "Hush", + ) + graph.MustAddE( + "features", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + }, + "Organization", + "Feature", + ) + graph.MustAddE( + "files", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + }, + "Organization", + "File", + ) + graph.MustAddE( + "entitlementplans", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + }, + "Organization", + "EntitlementPlan", + ) + graph.MustAddE( + "entitlementplanfeatures", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + }, + "Organization", + "EntitlementPlanFeature", + ) + graph.MustAddE( + "entities", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + }, + "Organization", + "Entity", + ) + graph.MustAddE( + "entitytypes", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + }, + "Organization", + "EntityType", + ) + graph.MustAddE( + "contacts", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + }, + "Organization", + "Contact", + ) + graph.MustAddE( + "notes", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + }, + "Organization", + "Note", + ) + graph.MustAddE( + "members", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + }, + "Organization", + "OrgMembership", + ) + graph.MustAddE( + "organization", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: organizationsetting.OrganizationTable, + Columns: []string{organizationsetting.OrganizationColumn}, + Bidi: false, + }, + "OrganizationSetting", + "Organization", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: passwordresettoken.OwnerTable, + Columns: []string{passwordresettoken.OwnerColumn}, + Bidi: false, + }, + "PasswordResetToken", + "User", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: personalaccesstoken.OwnerTable, + Columns: []string{personalaccesstoken.OwnerColumn}, + Bidi: false, + }, + "PersonalAccessToken", + "User", + ) + graph.MustAddE( + "organizations", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + }, + "PersonalAccessToken", + "Organization", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + }, + "PersonalAccessToken", + "Event", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: subscriber.OwnerTable, + Columns: []string{subscriber.OwnerColumn}, + Bidi: false, + }, + "Subscriber", + "Organization", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + }, + "Subscriber", + "Event", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: tfasetting.OwnerTable, + Columns: []string{tfasetting.OwnerColumn}, + Bidi: false, + }, + "TFASetting", + "User", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: template.OwnerTable, + Columns: []string{template.OwnerColumn}, + Bidi: false, + }, + "Template", + "Organization", + ) + graph.MustAddE( + "documents", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + }, + "Template", + "DocumentData", + ) + graph.MustAddE( + "personal_access_tokens", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + }, + "User", + "PersonalAccessToken", + ) + graph.MustAddE( + "tfa_settings", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + }, + "User", + "TFASetting", + ) + graph.MustAddE( + "setting", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: user.SettingTable, + Columns: []string{user.SettingColumn}, + Bidi: false, + }, + "User", + "UserSetting", + ) + graph.MustAddE( + "email_verification_tokens", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + }, + "User", + "EmailVerificationToken", + ) + graph.MustAddE( + "password_reset_tokens", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + }, + "User", + "PasswordResetToken", + ) + graph.MustAddE( + "groups", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + }, + "User", + "Group", + ) + graph.MustAddE( + "organizations", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + }, + "User", + "Organization", + ) + graph.MustAddE( + "webauthn", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + }, + "User", + "Webauthn", + ) + graph.MustAddE( + "files", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + }, + "User", + "File", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + }, + "User", + "Event", + ) + graph.MustAddE( + "group_memberships", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + }, + "User", + "GroupMembership", + ) + graph.MustAddE( + "org_memberships", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + }, + "User", + "OrgMembership", + ) + graph.MustAddE( + "user", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: usersetting.UserTable, + Columns: []string{usersetting.UserColumn}, + Bidi: false, + }, + "UserSetting", + "User", + ) + graph.MustAddE( + "default_org", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: usersetting.DefaultOrgTable, + Columns: []string{usersetting.DefaultOrgColumn}, + Bidi: false, + }, + "UserSetting", + "Organization", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webauthn.OwnerTable, + Columns: []string{webauthn.OwnerColumn}, + Bidi: false, + }, + "Webauthn", + "User", + ) + graph.MustAddE( + "owner", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webhook.OwnerTable, + Columns: []string{webhook.OwnerColumn}, + Bidi: false, + }, + "Webhook", + "Organization", + ) + graph.MustAddE( + "events", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + }, + "Webhook", + "Event", + ) + graph.MustAddE( + "integrations", + &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + }, + "Webhook", + "Integration", + ) + return graph +}() + +// predicateAdder wraps the addPredicate method. +// All update, update-one and query builders implement this interface. +type predicateAdder interface { + addPredicate(func(s *sql.Selector)) +} + +// addPredicate implements the predicateAdder interface. +func (atq *APITokenQuery) addPredicate(pred func(s *sql.Selector)) { + atq.predicates = append(atq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the APITokenQuery builder. +func (atq *APITokenQuery) Filter() *APITokenFilter { + return &APITokenFilter{config: atq.config, predicateAdder: atq} +} + +// addPredicate implements the predicateAdder interface. +func (m *APITokenMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the APITokenMutation builder. +func (m *APITokenMutation) Filter() *APITokenFilter { + return &APITokenFilter{config: m.config, predicateAdder: m} +} + +// APITokenFilter provides a generic filtering capability at runtime for APITokenQuery. +type APITokenFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *APITokenFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[0].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *APITokenFilter) WhereID(p entql.StringP) { + f.Where(p.Field(apitoken.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *APITokenFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(apitoken.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *APITokenFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(apitoken.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *APITokenFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(apitoken.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *APITokenFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(apitoken.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *APITokenFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(apitoken.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *APITokenFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(apitoken.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *APITokenFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(apitoken.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *APITokenFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(apitoken.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *APITokenFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(apitoken.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *APITokenFilter) WhereName(p entql.StringP) { + f.Where(p.Field(apitoken.FieldName)) +} + +// WhereToken applies the entql string predicate on the token field. +func (f *APITokenFilter) WhereToken(p entql.StringP) { + f.Where(p.Field(apitoken.FieldToken)) +} + +// WhereExpiresAt applies the entql time.Time predicate on the expires_at field. +func (f *APITokenFilter) WhereExpiresAt(p entql.TimeP) { + f.Where(p.Field(apitoken.FieldExpiresAt)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *APITokenFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(apitoken.FieldDescription)) +} + +// WhereScopes applies the entql json.RawMessage predicate on the scopes field. +func (f *APITokenFilter) WhereScopes(p entql.BytesP) { + f.Where(p.Field(apitoken.FieldScopes)) +} + +// WhereLastUsedAt applies the entql time.Time predicate on the last_used_at field. +func (f *APITokenFilter) WhereLastUsedAt(p entql.TimeP) { + f.Where(p.Field(apitoken.FieldLastUsedAt)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *APITokenFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *APITokenFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (cq *ContactQuery) addPredicate(pred func(s *sql.Selector)) { + cq.predicates = append(cq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the ContactQuery builder. +func (cq *ContactQuery) Filter() *ContactFilter { + return &ContactFilter{config: cq.config, predicateAdder: cq} +} + +// addPredicate implements the predicateAdder interface. +func (m *ContactMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the ContactMutation builder. +func (m *ContactMutation) Filter() *ContactFilter { + return &ContactFilter{config: m.config, predicateAdder: m} +} + +// ContactFilter provides a generic filtering capability at runtime for ContactQuery. +type ContactFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *ContactFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[1].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *ContactFilter) WhereID(p entql.StringP) { + f.Where(p.Field(contact.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *ContactFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(contact.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *ContactFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(contact.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *ContactFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(contact.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *ContactFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(contact.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *ContactFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(contact.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *ContactFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(contact.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *ContactFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(contact.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *ContactFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(contact.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *ContactFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(contact.FieldOwnerID)) +} + +// WhereFullName applies the entql string predicate on the full_name field. +func (f *ContactFilter) WhereFullName(p entql.StringP) { + f.Where(p.Field(contact.FieldFullName)) +} + +// WhereTitle applies the entql string predicate on the title field. +func (f *ContactFilter) WhereTitle(p entql.StringP) { + f.Where(p.Field(contact.FieldTitle)) +} + +// WhereCompany applies the entql string predicate on the company field. +func (f *ContactFilter) WhereCompany(p entql.StringP) { + f.Where(p.Field(contact.FieldCompany)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *ContactFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(contact.FieldEmail)) +} + +// WherePhoneNumber applies the entql string predicate on the phone_number field. +func (f *ContactFilter) WherePhoneNumber(p entql.StringP) { + f.Where(p.Field(contact.FieldPhoneNumber)) +} + +// WhereAddress applies the entql string predicate on the address field. +func (f *ContactFilter) WhereAddress(p entql.StringP) { + f.Where(p.Field(contact.FieldAddress)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *ContactFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(contact.FieldStatus)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *ContactFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *ContactFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntities applies a predicate to check if query has an edge entities. +func (f *ContactFilter) WhereHasEntities() { + f.Where(entql.HasEdge("entities")) +} + +// WhereHasEntitiesWith applies a predicate to check if query has an edge entities with a given conditions (other predicates). +func (f *ContactFilter) WhereHasEntitiesWith(preds ...predicate.Entity) { + f.Where(entql.HasEdgeWith("entities", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (chq *ContactHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + chq.predicates = append(chq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the ContactHistoryQuery builder. +func (chq *ContactHistoryQuery) Filter() *ContactHistoryFilter { + return &ContactHistoryFilter{config: chq.config, predicateAdder: chq} +} + +// addPredicate implements the predicateAdder interface. +func (m *ContactHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the ContactHistoryMutation builder. +func (m *ContactHistoryMutation) Filter() *ContactHistoryFilter { + return &ContactHistoryFilter{config: m.config, predicateAdder: m} +} + +// ContactHistoryFilter provides a generic filtering capability at runtime for ContactHistoryQuery. +type ContactHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *ContactHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[2].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *ContactHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *ContactHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(contacthistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *ContactHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *ContactHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *ContactHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(contacthistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *ContactHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(contacthistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *ContactHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *ContactHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *ContactHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *ContactHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(contacthistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *ContactHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *ContactHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(contacthistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *ContactHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldOwnerID)) +} + +// WhereFullName applies the entql string predicate on the full_name field. +func (f *ContactHistoryFilter) WhereFullName(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldFullName)) +} + +// WhereTitle applies the entql string predicate on the title field. +func (f *ContactHistoryFilter) WhereTitle(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldTitle)) +} + +// WhereCompany applies the entql string predicate on the company field. +func (f *ContactHistoryFilter) WhereCompany(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldCompany)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *ContactHistoryFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldEmail)) +} + +// WherePhoneNumber applies the entql string predicate on the phone_number field. +func (f *ContactHistoryFilter) WherePhoneNumber(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldPhoneNumber)) +} + +// WhereAddress applies the entql string predicate on the address field. +func (f *ContactHistoryFilter) WhereAddress(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldAddress)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *ContactHistoryFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(contacthistory.FieldStatus)) +} + +// addPredicate implements the predicateAdder interface. +func (ddq *DocumentDataQuery) addPredicate(pred func(s *sql.Selector)) { + ddq.predicates = append(ddq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the DocumentDataQuery builder. +func (ddq *DocumentDataQuery) Filter() *DocumentDataFilter { + return &DocumentDataFilter{config: ddq.config, predicateAdder: ddq} +} + +// addPredicate implements the predicateAdder interface. +func (m *DocumentDataMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the DocumentDataMutation builder. +func (m *DocumentDataMutation) Filter() *DocumentDataFilter { + return &DocumentDataFilter{config: m.config, predicateAdder: m} +} + +// DocumentDataFilter provides a generic filtering capability at runtime for DocumentDataQuery. +type DocumentDataFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *DocumentDataFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[3].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *DocumentDataFilter) WhereID(p entql.StringP) { + f.Where(p.Field(documentdata.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *DocumentDataFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(documentdata.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *DocumentDataFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(documentdata.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *DocumentDataFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(documentdata.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *DocumentDataFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(documentdata.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *DocumentDataFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(documentdata.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *DocumentDataFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(documentdata.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *DocumentDataFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(documentdata.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *DocumentDataFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(documentdata.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *DocumentDataFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(documentdata.FieldOwnerID)) +} + +// WhereTemplateID applies the entql string predicate on the template_id field. +func (f *DocumentDataFilter) WhereTemplateID(p entql.StringP) { + f.Where(p.Field(documentdata.FieldTemplateID)) +} + +// WhereData applies the entql json.RawMessage predicate on the data field. +func (f *DocumentDataFilter) WhereData(p entql.BytesP) { + f.Where(p.Field(documentdata.FieldData)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *DocumentDataFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *DocumentDataFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasTemplate applies a predicate to check if query has an edge template. +func (f *DocumentDataFilter) WhereHasTemplate() { + f.Where(entql.HasEdge("template")) +} + +// WhereHasTemplateWith applies a predicate to check if query has an edge template with a given conditions (other predicates). +func (f *DocumentDataFilter) WhereHasTemplateWith(preds ...predicate.Template) { + f.Where(entql.HasEdgeWith("template", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntity applies a predicate to check if query has an edge entity. +func (f *DocumentDataFilter) WhereHasEntity() { + f.Where(entql.HasEdge("entity")) +} + +// WhereHasEntityWith applies a predicate to check if query has an edge entity with a given conditions (other predicates). +func (f *DocumentDataFilter) WhereHasEntityWith(preds ...predicate.Entity) { + f.Where(entql.HasEdgeWith("entity", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ddhq *DocumentDataHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ddhq.predicates = append(ddhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the DocumentDataHistoryQuery builder. +func (ddhq *DocumentDataHistoryQuery) Filter() *DocumentDataHistoryFilter { + return &DocumentDataHistoryFilter{config: ddhq.config, predicateAdder: ddhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *DocumentDataHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the DocumentDataHistoryMutation builder. +func (m *DocumentDataHistoryMutation) Filter() *DocumentDataHistoryFilter { + return &DocumentDataHistoryFilter{config: m.config, predicateAdder: m} +} + +// DocumentDataHistoryFilter provides a generic filtering capability at runtime for DocumentDataHistoryQuery. +type DocumentDataHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *DocumentDataHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[4].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *DocumentDataHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *DocumentDataHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(documentdatahistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *DocumentDataHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *DocumentDataHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *DocumentDataHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(documentdatahistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *DocumentDataHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(documentdatahistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *DocumentDataHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *DocumentDataHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *DocumentDataHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *DocumentDataHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(documentdatahistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *DocumentDataHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(documentdatahistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *DocumentDataHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *DocumentDataHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldOwnerID)) +} + +// WhereTemplateID applies the entql string predicate on the template_id field. +func (f *DocumentDataHistoryFilter) WhereTemplateID(p entql.StringP) { + f.Where(p.Field(documentdatahistory.FieldTemplateID)) +} + +// WhereData applies the entql json.RawMessage predicate on the data field. +func (f *DocumentDataHistoryFilter) WhereData(p entql.BytesP) { + f.Where(p.Field(documentdatahistory.FieldData)) +} + +// addPredicate implements the predicateAdder interface. +func (evtq *EmailVerificationTokenQuery) addPredicate(pred func(s *sql.Selector)) { + evtq.predicates = append(evtq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EmailVerificationTokenQuery builder. +func (evtq *EmailVerificationTokenQuery) Filter() *EmailVerificationTokenFilter { + return &EmailVerificationTokenFilter{config: evtq.config, predicateAdder: evtq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EmailVerificationTokenMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EmailVerificationTokenMutation builder. +func (m *EmailVerificationTokenMutation) Filter() *EmailVerificationTokenFilter { + return &EmailVerificationTokenFilter{config: m.config, predicateAdder: m} +} + +// EmailVerificationTokenFilter provides a generic filtering capability at runtime for EmailVerificationTokenQuery. +type EmailVerificationTokenFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EmailVerificationTokenFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[5].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EmailVerificationTokenFilter) WhereID(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EmailVerificationTokenFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(emailverificationtoken.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EmailVerificationTokenFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(emailverificationtoken.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EmailVerificationTokenFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EmailVerificationTokenFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EmailVerificationTokenFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EmailVerificationTokenFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(emailverificationtoken.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EmailVerificationTokenFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EmailVerificationTokenFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldOwnerID)) +} + +// WhereToken applies the entql string predicate on the token field. +func (f *EmailVerificationTokenFilter) WhereToken(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldToken)) +} + +// WhereTTL applies the entql time.Time predicate on the ttl field. +func (f *EmailVerificationTokenFilter) WhereTTL(p entql.TimeP) { + f.Where(p.Field(emailverificationtoken.FieldTTL)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *EmailVerificationTokenFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(emailverificationtoken.FieldEmail)) +} + +// WhereSecret applies the entql []byte predicate on the secret field. +func (f *EmailVerificationTokenFilter) WhereSecret(p entql.BytesP) { + f.Where(p.Field(emailverificationtoken.FieldSecret)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *EmailVerificationTokenFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *EmailVerificationTokenFilter) WhereHasOwnerWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (eq *EntitlementQuery) addPredicate(pred func(s *sql.Selector)) { + eq.predicates = append(eq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntitlementQuery builder. +func (eq *EntitlementQuery) Filter() *EntitlementFilter { + return &EntitlementFilter{config: eq.config, predicateAdder: eq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntitlementMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntitlementMutation builder. +func (m *EntitlementMutation) Filter() *EntitlementFilter { + return &EntitlementFilter{config: m.config, predicateAdder: m} +} + +// EntitlementFilter provides a generic filtering capability at runtime for EntitlementQuery. +type EntitlementFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntitlementFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[6].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntitlementFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitlement.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntitlementFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitlement.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntitlementFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitlement.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntitlementFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitlement.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntitlementFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitlement.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntitlementFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitlement.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntitlementFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitlement.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntitlementFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitlement.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntitlementFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitlement.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntitlementFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitlement.FieldOwnerID)) +} + +// WherePlanID applies the entql string predicate on the plan_id field. +func (f *EntitlementFilter) WherePlanID(p entql.StringP) { + f.Where(p.Field(entitlement.FieldPlanID)) +} + +// WhereOrganizationID applies the entql string predicate on the organization_id field. +func (f *EntitlementFilter) WhereOrganizationID(p entql.StringP) { + f.Where(p.Field(entitlement.FieldOrganizationID)) +} + +// WhereExternalCustomerID applies the entql string predicate on the external_customer_id field. +func (f *EntitlementFilter) WhereExternalCustomerID(p entql.StringP) { + f.Where(p.Field(entitlement.FieldExternalCustomerID)) +} + +// WhereExternalSubscriptionID applies the entql string predicate on the external_subscription_id field. +func (f *EntitlementFilter) WhereExternalSubscriptionID(p entql.StringP) { + f.Where(p.Field(entitlement.FieldExternalSubscriptionID)) +} + +// WhereExpires applies the entql bool predicate on the expires field. +func (f *EntitlementFilter) WhereExpires(p entql.BoolP) { + f.Where(p.Field(entitlement.FieldExpires)) +} + +// WhereExpiresAt applies the entql time.Time predicate on the expires_at field. +func (f *EntitlementFilter) WhereExpiresAt(p entql.TimeP) { + f.Where(p.Field(entitlement.FieldExpiresAt)) +} + +// WhereCancelled applies the entql bool predicate on the cancelled field. +func (f *EntitlementFilter) WhereCancelled(p entql.BoolP) { + f.Where(p.Field(entitlement.FieldCancelled)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *EntitlementFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *EntitlementFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasPlan applies a predicate to check if query has an edge plan. +func (f *EntitlementFilter) WhereHasPlan() { + f.Where(entql.HasEdge("plan")) +} + +// WhereHasPlanWith applies a predicate to check if query has an edge plan with a given conditions (other predicates). +func (f *EntitlementFilter) WhereHasPlanWith(preds ...predicate.EntitlementPlan) { + f.Where(entql.HasEdgeWith("plan", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrganization applies a predicate to check if query has an edge organization. +func (f *EntitlementFilter) WhereHasOrganization() { + f.Where(entql.HasEdge("organization")) +} + +// WhereHasOrganizationWith applies a predicate to check if query has an edge organization with a given conditions (other predicates). +func (f *EntitlementFilter) WhereHasOrganizationWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organization", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *EntitlementFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *EntitlementFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ehq *EntitlementHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ehq.predicates = append(ehq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntitlementHistoryQuery builder. +func (ehq *EntitlementHistoryQuery) Filter() *EntitlementHistoryFilter { + return &EntitlementHistoryFilter{config: ehq.config, predicateAdder: ehq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntitlementHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntitlementHistoryMutation builder. +func (m *EntitlementHistoryMutation) Filter() *EntitlementHistoryFilter { + return &EntitlementHistoryFilter{config: m.config, predicateAdder: m} +} + +// EntitlementHistoryFilter provides a generic filtering capability at runtime for EntitlementHistoryQuery. +type EntitlementHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntitlementHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[7].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntitlementHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *EntitlementHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(entitlementhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *EntitlementHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *EntitlementHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntitlementHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntitlementHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntitlementHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntitlementHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntitlementHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntitlementHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitlementhistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntitlementHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitlementhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntitlementHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntitlementHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldOwnerID)) +} + +// WherePlanID applies the entql string predicate on the plan_id field. +func (f *EntitlementHistoryFilter) WherePlanID(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldPlanID)) +} + +// WhereOrganizationID applies the entql string predicate on the organization_id field. +func (f *EntitlementHistoryFilter) WhereOrganizationID(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldOrganizationID)) +} + +// WhereExternalCustomerID applies the entql string predicate on the external_customer_id field. +func (f *EntitlementHistoryFilter) WhereExternalCustomerID(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldExternalCustomerID)) +} + +// WhereExternalSubscriptionID applies the entql string predicate on the external_subscription_id field. +func (f *EntitlementHistoryFilter) WhereExternalSubscriptionID(p entql.StringP) { + f.Where(p.Field(entitlementhistory.FieldExternalSubscriptionID)) +} + +// WhereExpires applies the entql bool predicate on the expires field. +func (f *EntitlementHistoryFilter) WhereExpires(p entql.BoolP) { + f.Where(p.Field(entitlementhistory.FieldExpires)) +} + +// WhereExpiresAt applies the entql time.Time predicate on the expires_at field. +func (f *EntitlementHistoryFilter) WhereExpiresAt(p entql.TimeP) { + f.Where(p.Field(entitlementhistory.FieldExpiresAt)) +} + +// WhereCancelled applies the entql bool predicate on the cancelled field. +func (f *EntitlementHistoryFilter) WhereCancelled(p entql.BoolP) { + f.Where(p.Field(entitlementhistory.FieldCancelled)) +} + +// addPredicate implements the predicateAdder interface. +func (epq *EntitlementPlanQuery) addPredicate(pred func(s *sql.Selector)) { + epq.predicates = append(epq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntitlementPlanQuery builder. +func (epq *EntitlementPlanQuery) Filter() *EntitlementPlanFilter { + return &EntitlementPlanFilter{config: epq.config, predicateAdder: epq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntitlementPlanMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntitlementPlanMutation builder. +func (m *EntitlementPlanMutation) Filter() *EntitlementPlanFilter { + return &EntitlementPlanFilter{config: m.config, predicateAdder: m} +} + +// EntitlementPlanFilter provides a generic filtering capability at runtime for EntitlementPlanQuery. +type EntitlementPlanFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntitlementPlanFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[8].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntitlementPlanFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntitlementPlanFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplan.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntitlementPlanFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplan.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntitlementPlanFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntitlementPlanFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntitlementPlanFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntitlementPlanFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplan.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntitlementPlanFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntitlementPlanFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitlementplan.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntitlementPlanFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldOwnerID)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *EntitlementPlanFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldDisplayName)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *EntitlementPlanFilter) WhereName(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *EntitlementPlanFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldDescription)) +} + +// WhereVersion applies the entql string predicate on the version field. +func (f *EntitlementPlanFilter) WhereVersion(p entql.StringP) { + f.Where(p.Field(entitlementplan.FieldVersion)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *EntitlementPlanFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(entitlementplan.FieldMetadata)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *EntitlementPlanFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *EntitlementPlanFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitlements applies a predicate to check if query has an edge entitlements. +func (f *EntitlementPlanFilter) WhereHasEntitlements() { + f.Where(entql.HasEdge("entitlements")) +} + +// WhereHasEntitlementsWith applies a predicate to check if query has an edge entitlements with a given conditions (other predicates). +func (f *EntitlementPlanFilter) WhereHasEntitlementsWith(preds ...predicate.Entitlement) { + f.Where(entql.HasEdgeWith("entitlements", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasBaseFeatures applies a predicate to check if query has an edge base_features. +func (f *EntitlementPlanFilter) WhereHasBaseFeatures() { + f.Where(entql.HasEdge("base_features")) +} + +// WhereHasBaseFeaturesWith applies a predicate to check if query has an edge base_features with a given conditions (other predicates). +func (f *EntitlementPlanFilter) WhereHasBaseFeaturesWith(preds ...predicate.Feature) { + f.Where(entql.HasEdgeWith("base_features", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *EntitlementPlanFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *EntitlementPlanFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFeatures applies a predicate to check if query has an edge features. +func (f *EntitlementPlanFilter) WhereHasFeatures() { + f.Where(entql.HasEdge("features")) +} + +// WhereHasFeaturesWith applies a predicate to check if query has an edge features with a given conditions (other predicates). +func (f *EntitlementPlanFilter) WhereHasFeaturesWith(preds ...predicate.EntitlementPlanFeature) { + f.Where(entql.HasEdgeWith("features", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (epfq *EntitlementPlanFeatureQuery) addPredicate(pred func(s *sql.Selector)) { + epfq.predicates = append(epfq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntitlementPlanFeatureQuery builder. +func (epfq *EntitlementPlanFeatureQuery) Filter() *EntitlementPlanFeatureFilter { + return &EntitlementPlanFeatureFilter{config: epfq.config, predicateAdder: epfq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntitlementPlanFeatureMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntitlementPlanFeatureMutation builder. +func (m *EntitlementPlanFeatureMutation) Filter() *EntitlementPlanFeatureFilter { + return &EntitlementPlanFeatureFilter{config: m.config, predicateAdder: m} +} + +// EntitlementPlanFeatureFilter provides a generic filtering capability at runtime for EntitlementPlanFeatureQuery. +type EntitlementPlanFeatureFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntitlementPlanFeatureFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[9].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntitlementPlanFeatureFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntitlementPlanFeatureFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanfeature.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntitlementPlanFeatureFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanfeature.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntitlementPlanFeatureFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntitlementPlanFeatureFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntitlementPlanFeatureFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntitlementPlanFeatureFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanfeature.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntitlementPlanFeatureFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntitlementPlanFeatureFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitlementplanfeature.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntitlementPlanFeatureFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldOwnerID)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *EntitlementPlanFeatureFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(entitlementplanfeature.FieldMetadata)) +} + +// WherePlanID applies the entql string predicate on the plan_id field. +func (f *EntitlementPlanFeatureFilter) WherePlanID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldPlanID)) +} + +// WhereFeatureID applies the entql string predicate on the feature_id field. +func (f *EntitlementPlanFeatureFilter) WhereFeatureID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeature.FieldFeatureID)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *EntitlementPlanFeatureFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *EntitlementPlanFeatureFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasPlan applies a predicate to check if query has an edge plan. +func (f *EntitlementPlanFeatureFilter) WhereHasPlan() { + f.Where(entql.HasEdge("plan")) +} + +// WhereHasPlanWith applies a predicate to check if query has an edge plan with a given conditions (other predicates). +func (f *EntitlementPlanFeatureFilter) WhereHasPlanWith(preds ...predicate.EntitlementPlan) { + f.Where(entql.HasEdgeWith("plan", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFeature applies a predicate to check if query has an edge feature. +func (f *EntitlementPlanFeatureFilter) WhereHasFeature() { + f.Where(entql.HasEdge("feature")) +} + +// WhereHasFeatureWith applies a predicate to check if query has an edge feature with a given conditions (other predicates). +func (f *EntitlementPlanFeatureFilter) WhereHasFeatureWith(preds ...predicate.Feature) { + f.Where(entql.HasEdgeWith("feature", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *EntitlementPlanFeatureFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *EntitlementPlanFeatureFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (epfhq *EntitlementPlanFeatureHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + epfhq.predicates = append(epfhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntitlementPlanFeatureHistoryQuery builder. +func (epfhq *EntitlementPlanFeatureHistoryQuery) Filter() *EntitlementPlanFeatureHistoryFilter { + return &EntitlementPlanFeatureHistoryFilter{config: epfhq.config, predicateAdder: epfhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntitlementPlanFeatureHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntitlementPlanFeatureHistoryMutation builder. +func (m *EntitlementPlanFeatureHistoryMutation) Filter() *EntitlementPlanFeatureHistoryFilter { + return &EntitlementPlanFeatureHistoryFilter{config: m.config, predicateAdder: m} +} + +// EntitlementPlanFeatureHistoryFilter provides a generic filtering capability at runtime for EntitlementPlanFeatureHistoryQuery. +type EntitlementPlanFeatureHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntitlementPlanFeatureHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[10].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldOwnerID)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldMetadata)) +} + +// WherePlanID applies the entql string predicate on the plan_id field. +func (f *EntitlementPlanFeatureHistoryFilter) WherePlanID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldPlanID)) +} + +// WhereFeatureID applies the entql string predicate on the feature_id field. +func (f *EntitlementPlanFeatureHistoryFilter) WhereFeatureID(p entql.StringP) { + f.Where(p.Field(entitlementplanfeaturehistory.FieldFeatureID)) +} + +// addPredicate implements the predicateAdder interface. +func (ephq *EntitlementPlanHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ephq.predicates = append(ephq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntitlementPlanHistoryQuery builder. +func (ephq *EntitlementPlanHistoryQuery) Filter() *EntitlementPlanHistoryFilter { + return &EntitlementPlanHistoryFilter{config: ephq.config, predicateAdder: ephq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntitlementPlanHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntitlementPlanHistoryMutation builder. +func (m *EntitlementPlanHistoryMutation) Filter() *EntitlementPlanHistoryFilter { + return &EntitlementPlanHistoryFilter{config: m.config, predicateAdder: m} +} + +// EntitlementPlanHistoryFilter provides a generic filtering capability at runtime for EntitlementPlanHistoryQuery. +type EntitlementPlanHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntitlementPlanHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[11].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntitlementPlanHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *EntitlementPlanHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(entitlementplanhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *EntitlementPlanHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *EntitlementPlanHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntitlementPlanHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntitlementPlanHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntitlementPlanHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntitlementPlanHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntitlementPlanHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntitlementPlanHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitlementplanhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntitlementPlanHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntitlementPlanHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitlementplanhistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntitlementPlanHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldOwnerID)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *EntitlementPlanHistoryFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldDisplayName)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *EntitlementPlanHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *EntitlementPlanHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldDescription)) +} + +// WhereVersion applies the entql string predicate on the version field. +func (f *EntitlementPlanHistoryFilter) WhereVersion(p entql.StringP) { + f.Where(p.Field(entitlementplanhistory.FieldVersion)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *EntitlementPlanHistoryFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(entitlementplanhistory.FieldMetadata)) +} + +// addPredicate implements the predicateAdder interface. +func (eq *EntityQuery) addPredicate(pred func(s *sql.Selector)) { + eq.predicates = append(eq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntityQuery builder. +func (eq *EntityQuery) Filter() *EntityFilter { + return &EntityFilter{config: eq.config, predicateAdder: eq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntityMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntityMutation builder. +func (m *EntityMutation) Filter() *EntityFilter { + return &EntityFilter{config: m.config, predicateAdder: m} +} + +// EntityFilter provides a generic filtering capability at runtime for EntityQuery. +type EntityFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntityFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[12].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntityFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entity.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntityFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entity.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntityFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entity.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntityFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entity.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntityFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entity.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntityFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entity.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntityFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entity.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntityFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entity.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntityFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entity.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntityFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entity.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *EntityFilter) WhereName(p entql.StringP) { + f.Where(p.Field(entity.FieldName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *EntityFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(entity.FieldDisplayName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *EntityFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(entity.FieldDescription)) +} + +// WhereDomains applies the entql json.RawMessage predicate on the domains field. +func (f *EntityFilter) WhereDomains(p entql.BytesP) { + f.Where(p.Field(entity.FieldDomains)) +} + +// WhereEntityTypeID applies the entql string predicate on the entity_type_id field. +func (f *EntityFilter) WhereEntityTypeID(p entql.StringP) { + f.Where(p.Field(entity.FieldEntityTypeID)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *EntityFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(entity.FieldStatus)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *EntityFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *EntityFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasContacts applies a predicate to check if query has an edge contacts. +func (f *EntityFilter) WhereHasContacts() { + f.Where(entql.HasEdge("contacts")) +} + +// WhereHasContactsWith applies a predicate to check if query has an edge contacts with a given conditions (other predicates). +func (f *EntityFilter) WhereHasContactsWith(preds ...predicate.Contact) { + f.Where(entql.HasEdgeWith("contacts", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasDocuments applies a predicate to check if query has an edge documents. +func (f *EntityFilter) WhereHasDocuments() { + f.Where(entql.HasEdge("documents")) +} + +// WhereHasDocumentsWith applies a predicate to check if query has an edge documents with a given conditions (other predicates). +func (f *EntityFilter) WhereHasDocumentsWith(preds ...predicate.DocumentData) { + f.Where(entql.HasEdgeWith("documents", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasNotes applies a predicate to check if query has an edge notes. +func (f *EntityFilter) WhereHasNotes() { + f.Where(entql.HasEdge("notes")) +} + +// WhereHasNotesWith applies a predicate to check if query has an edge notes with a given conditions (other predicates). +func (f *EntityFilter) WhereHasNotesWith(preds ...predicate.Note) { + f.Where(entql.HasEdgeWith("notes", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFiles applies a predicate to check if query has an edge files. +func (f *EntityFilter) WhereHasFiles() { + f.Where(entql.HasEdge("files")) +} + +// WhereHasFilesWith applies a predicate to check if query has an edge files with a given conditions (other predicates). +func (f *EntityFilter) WhereHasFilesWith(preds ...predicate.File) { + f.Where(entql.HasEdgeWith("files", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntityType applies a predicate to check if query has an edge entity_type. +func (f *EntityFilter) WhereHasEntityType() { + f.Where(entql.HasEdge("entity_type")) +} + +// WhereHasEntityTypeWith applies a predicate to check if query has an edge entity_type with a given conditions (other predicates). +func (f *EntityFilter) WhereHasEntityTypeWith(preds ...predicate.EntityType) { + f.Where(entql.HasEdgeWith("entity_type", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ehq *EntityHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ehq.predicates = append(ehq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntityHistoryQuery builder. +func (ehq *EntityHistoryQuery) Filter() *EntityHistoryFilter { + return &EntityHistoryFilter{config: ehq.config, predicateAdder: ehq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntityHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntityHistoryMutation builder. +func (m *EntityHistoryMutation) Filter() *EntityHistoryFilter { + return &EntityHistoryFilter{config: m.config, predicateAdder: m} +} + +// EntityHistoryFilter provides a generic filtering capability at runtime for EntityHistoryQuery. +type EntityHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntityHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[13].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntityHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *EntityHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(entityhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *EntityHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *EntityHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntityHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entityhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntityHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entityhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntityHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntityHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntityHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntityHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entityhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntityHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntityHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entityhistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntityHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *EntityHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *EntityHistoryFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldDisplayName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *EntityHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldDescription)) +} + +// WhereDomains applies the entql json.RawMessage predicate on the domains field. +func (f *EntityHistoryFilter) WhereDomains(p entql.BytesP) { + f.Where(p.Field(entityhistory.FieldDomains)) +} + +// WhereEntityTypeID applies the entql string predicate on the entity_type_id field. +func (f *EntityHistoryFilter) WhereEntityTypeID(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldEntityTypeID)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *EntityHistoryFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(entityhistory.FieldStatus)) +} + +// addPredicate implements the predicateAdder interface. +func (etq *EntityTypeQuery) addPredicate(pred func(s *sql.Selector)) { + etq.predicates = append(etq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntityTypeQuery builder. +func (etq *EntityTypeQuery) Filter() *EntityTypeFilter { + return &EntityTypeFilter{config: etq.config, predicateAdder: etq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntityTypeMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntityTypeMutation builder. +func (m *EntityTypeMutation) Filter() *EntityTypeFilter { + return &EntityTypeFilter{config: m.config, predicateAdder: m} +} + +// EntityTypeFilter provides a generic filtering capability at runtime for EntityTypeQuery. +type EntityTypeFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntityTypeFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[14].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntityTypeFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitytype.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntityTypeFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitytype.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntityTypeFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitytype.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntityTypeFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitytype.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntityTypeFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitytype.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntityTypeFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitytype.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntityTypeFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitytype.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntityTypeFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitytype.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntityTypeFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitytype.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntityTypeFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitytype.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *EntityTypeFilter) WhereName(p entql.StringP) { + f.Where(p.Field(entitytype.FieldName)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *EntityTypeFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *EntityTypeFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntities applies a predicate to check if query has an edge entities. +func (f *EntityTypeFilter) WhereHasEntities() { + f.Where(entql.HasEdge("entities")) +} + +// WhereHasEntitiesWith applies a predicate to check if query has an edge entities with a given conditions (other predicates). +func (f *EntityTypeFilter) WhereHasEntitiesWith(preds ...predicate.Entity) { + f.Where(entql.HasEdgeWith("entities", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ethq *EntityTypeHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ethq.predicates = append(ethq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EntityTypeHistoryQuery builder. +func (ethq *EntityTypeHistoryQuery) Filter() *EntityTypeHistoryFilter { + return &EntityTypeHistoryFilter{config: ethq.config, predicateAdder: ethq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EntityTypeHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EntityTypeHistoryMutation builder. +func (m *EntityTypeHistoryMutation) Filter() *EntityTypeHistoryFilter { + return &EntityTypeHistoryFilter{config: m.config, predicateAdder: m} +} + +// EntityTypeHistoryFilter provides a generic filtering capability at runtime for EntityTypeHistoryQuery. +type EntityTypeHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EntityTypeHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[15].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EntityTypeHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *EntityTypeHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(entitytypehistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *EntityTypeHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *EntityTypeHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EntityTypeHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(entitytypehistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EntityTypeHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(entitytypehistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EntityTypeHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EntityTypeHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EntityTypeHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *EntityTypeHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(entitytypehistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *EntityTypeHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EntityTypeHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(entitytypehistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *EntityTypeHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *EntityTypeHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(entitytypehistory.FieldName)) +} + +// addPredicate implements the predicateAdder interface. +func (eq *EventQuery) addPredicate(pred func(s *sql.Selector)) { + eq.predicates = append(eq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EventQuery builder. +func (eq *EventQuery) Filter() *EventFilter { + return &EventFilter{config: eq.config, predicateAdder: eq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EventMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EventMutation builder. +func (m *EventMutation) Filter() *EventFilter { + return &EventFilter{config: m.config, predicateAdder: m} +} + +// EventFilter provides a generic filtering capability at runtime for EventQuery. +type EventFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EventFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[16].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EventFilter) WhereID(p entql.StringP) { + f.Where(p.Field(event.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EventFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(event.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EventFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(event.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EventFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(event.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EventFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(event.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EventFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(event.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EventFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(event.FieldTags)) +} + +// WhereEventID applies the entql string predicate on the event_id field. +func (f *EventFilter) WhereEventID(p entql.StringP) { + f.Where(p.Field(event.FieldEventID)) +} + +// WhereCorrelationID applies the entql string predicate on the correlation_id field. +func (f *EventFilter) WhereCorrelationID(p entql.StringP) { + f.Where(p.Field(event.FieldCorrelationID)) +} + +// WhereEventType applies the entql string predicate on the event_type field. +func (f *EventFilter) WhereEventType(p entql.StringP) { + f.Where(p.Field(event.FieldEventType)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *EventFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(event.FieldMetadata)) +} + +// WhereHasUser applies a predicate to check if query has an edge user. +func (f *EventFilter) WhereHasUser() { + f.Where(entql.HasEdge("user")) +} + +// WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates). +func (f *EventFilter) WhereHasUserWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("user", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasGroup applies a predicate to check if query has an edge group. +func (f *EventFilter) WhereHasGroup() { + f.Where(entql.HasEdge("group")) +} + +// WhereHasGroupWith applies a predicate to check if query has an edge group with a given conditions (other predicates). +func (f *EventFilter) WhereHasGroupWith(preds ...predicate.Group) { + f.Where(entql.HasEdgeWith("group", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasIntegration applies a predicate to check if query has an edge integration. +func (f *EventFilter) WhereHasIntegration() { + f.Where(entql.HasEdge("integration")) +} + +// WhereHasIntegrationWith applies a predicate to check if query has an edge integration with a given conditions (other predicates). +func (f *EventFilter) WhereHasIntegrationWith(preds ...predicate.Integration) { + f.Where(entql.HasEdgeWith("integration", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrganization applies a predicate to check if query has an edge organization. +func (f *EventFilter) WhereHasOrganization() { + f.Where(entql.HasEdge("organization")) +} + +// WhereHasOrganizationWith applies a predicate to check if query has an edge organization with a given conditions (other predicates). +func (f *EventFilter) WhereHasOrganizationWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organization", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasInvite applies a predicate to check if query has an edge invite. +func (f *EventFilter) WhereHasInvite() { + f.Where(entql.HasEdge("invite")) +} + +// WhereHasInviteWith applies a predicate to check if query has an edge invite with a given conditions (other predicates). +func (f *EventFilter) WhereHasInviteWith(preds ...predicate.Invite) { + f.Where(entql.HasEdgeWith("invite", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFeature applies a predicate to check if query has an edge feature. +func (f *EventFilter) WhereHasFeature() { + f.Where(entql.HasEdge("feature")) +} + +// WhereHasFeatureWith applies a predicate to check if query has an edge feature with a given conditions (other predicates). +func (f *EventFilter) WhereHasFeatureWith(preds ...predicate.Feature) { + f.Where(entql.HasEdgeWith("feature", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitlementplan applies a predicate to check if query has an edge entitlementplan. +func (f *EventFilter) WhereHasEntitlementplan() { + f.Where(entql.HasEdge("entitlementplan")) +} + +// WhereHasEntitlementplanWith applies a predicate to check if query has an edge entitlementplan with a given conditions (other predicates). +func (f *EventFilter) WhereHasEntitlementplanWith(preds ...predicate.EntitlementPlan) { + f.Where(entql.HasEdgeWith("entitlementplan", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitlementplanfeature applies a predicate to check if query has an edge entitlementplanfeature. +func (f *EventFilter) WhereHasEntitlementplanfeature() { + f.Where(entql.HasEdge("entitlementplanfeature")) +} + +// WhereHasEntitlementplanfeatureWith applies a predicate to check if query has an edge entitlementplanfeature with a given conditions (other predicates). +func (f *EventFilter) WhereHasEntitlementplanfeatureWith(preds ...predicate.EntitlementPlanFeature) { + f.Where(entql.HasEdgeWith("entitlementplanfeature", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasPersonalAccessToken applies a predicate to check if query has an edge personal_access_token. +func (f *EventFilter) WhereHasPersonalAccessToken() { + f.Where(entql.HasEdge("personal_access_token")) +} + +// WhereHasPersonalAccessTokenWith applies a predicate to check if query has an edge personal_access_token with a given conditions (other predicates). +func (f *EventFilter) WhereHasPersonalAccessTokenWith(preds ...predicate.PersonalAccessToken) { + f.Where(entql.HasEdgeWith("personal_access_token", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOauth2token applies a predicate to check if query has an edge oauth2token. +func (f *EventFilter) WhereHasOauth2token() { + f.Where(entql.HasEdge("oauth2token")) +} + +// WhereHasOauth2tokenWith applies a predicate to check if query has an edge oauth2token with a given conditions (other predicates). +func (f *EventFilter) WhereHasOauth2tokenWith(preds ...predicate.OhAuthTooToken) { + f.Where(entql.HasEdgeWith("oauth2token", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasHush applies a predicate to check if query has an edge hush. +func (f *EventFilter) WhereHasHush() { + f.Where(entql.HasEdge("hush")) +} + +// WhereHasHushWith applies a predicate to check if query has an edge hush with a given conditions (other predicates). +func (f *EventFilter) WhereHasHushWith(preds ...predicate.Hush) { + f.Where(entql.HasEdgeWith("hush", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrgmembership applies a predicate to check if query has an edge orgmembership. +func (f *EventFilter) WhereHasOrgmembership() { + f.Where(entql.HasEdge("orgmembership")) +} + +// WhereHasOrgmembershipWith applies a predicate to check if query has an edge orgmembership with a given conditions (other predicates). +func (f *EventFilter) WhereHasOrgmembershipWith(preds ...predicate.OrgMembership) { + f.Where(entql.HasEdgeWith("orgmembership", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasGroupmembership applies a predicate to check if query has an edge groupmembership. +func (f *EventFilter) WhereHasGroupmembership() { + f.Where(entql.HasEdge("groupmembership")) +} + +// WhereHasGroupmembershipWith applies a predicate to check if query has an edge groupmembership with a given conditions (other predicates). +func (f *EventFilter) WhereHasGroupmembershipWith(preds ...predicate.GroupMembership) { + f.Where(entql.HasEdgeWith("groupmembership", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitlement applies a predicate to check if query has an edge entitlement. +func (f *EventFilter) WhereHasEntitlement() { + f.Where(entql.HasEdge("entitlement")) +} + +// WhereHasEntitlementWith applies a predicate to check if query has an edge entitlement with a given conditions (other predicates). +func (f *EventFilter) WhereHasEntitlementWith(preds ...predicate.Entitlement) { + f.Where(entql.HasEdgeWith("entitlement", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasWebhook applies a predicate to check if query has an edge webhook. +func (f *EventFilter) WhereHasWebhook() { + f.Where(entql.HasEdge("webhook")) +} + +// WhereHasWebhookWith applies a predicate to check if query has an edge webhook with a given conditions (other predicates). +func (f *EventFilter) WhereHasWebhookWith(preds ...predicate.Webhook) { + f.Where(entql.HasEdgeWith("webhook", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasSubscriber applies a predicate to check if query has an edge subscriber. +func (f *EventFilter) WhereHasSubscriber() { + f.Where(entql.HasEdge("subscriber")) +} + +// WhereHasSubscriberWith applies a predicate to check if query has an edge subscriber with a given conditions (other predicates). +func (f *EventFilter) WhereHasSubscriberWith(preds ...predicate.Subscriber) { + f.Where(entql.HasEdgeWith("subscriber", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ehq *EventHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ehq.predicates = append(ehq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the EventHistoryQuery builder. +func (ehq *EventHistoryQuery) Filter() *EventHistoryFilter { + return &EventHistoryFilter{config: ehq.config, predicateAdder: ehq} +} + +// addPredicate implements the predicateAdder interface. +func (m *EventHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the EventHistoryMutation builder. +func (m *EventHistoryMutation) Filter() *EventHistoryFilter { + return &EventHistoryFilter{config: m.config, predicateAdder: m} +} + +// EventHistoryFilter provides a generic filtering capability at runtime for EventHistoryQuery. +type EventHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *EventHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[17].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *EventHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *EventHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(eventhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *EventHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *EventHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *EventHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(eventhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *EventHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(eventhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *EventHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *EventHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *EventHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *EventHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(eventhistory.FieldTags)) +} + +// WhereEventID applies the entql string predicate on the event_id field. +func (f *EventHistoryFilter) WhereEventID(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldEventID)) +} + +// WhereCorrelationID applies the entql string predicate on the correlation_id field. +func (f *EventHistoryFilter) WhereCorrelationID(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldCorrelationID)) +} + +// WhereEventType applies the entql string predicate on the event_type field. +func (f *EventHistoryFilter) WhereEventType(p entql.StringP) { + f.Where(p.Field(eventhistory.FieldEventType)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *EventHistoryFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(eventhistory.FieldMetadata)) +} + +// addPredicate implements the predicateAdder interface. +func (fq *FeatureQuery) addPredicate(pred func(s *sql.Selector)) { + fq.predicates = append(fq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the FeatureQuery builder. +func (fq *FeatureQuery) Filter() *FeatureFilter { + return &FeatureFilter{config: fq.config, predicateAdder: fq} +} + +// addPredicate implements the predicateAdder interface. +func (m *FeatureMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the FeatureMutation builder. +func (m *FeatureMutation) Filter() *FeatureFilter { + return &FeatureFilter{config: m.config, predicateAdder: m} +} + +// FeatureFilter provides a generic filtering capability at runtime for FeatureQuery. +type FeatureFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *FeatureFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[18].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *FeatureFilter) WhereID(p entql.StringP) { + f.Where(p.Field(feature.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *FeatureFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(feature.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *FeatureFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(feature.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *FeatureFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(feature.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *FeatureFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(feature.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *FeatureFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(feature.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *FeatureFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(feature.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *FeatureFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(feature.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *FeatureFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(feature.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *FeatureFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(feature.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *FeatureFilter) WhereName(p entql.StringP) { + f.Where(p.Field(feature.FieldName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *FeatureFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(feature.FieldDisplayName)) +} + +// WhereEnabled applies the entql bool predicate on the enabled field. +func (f *FeatureFilter) WhereEnabled(p entql.BoolP) { + f.Where(p.Field(feature.FieldEnabled)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *FeatureFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(feature.FieldDescription)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *FeatureFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(feature.FieldMetadata)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *FeatureFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *FeatureFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasPlans applies a predicate to check if query has an edge plans. +func (f *FeatureFilter) WhereHasPlans() { + f.Where(entql.HasEdge("plans")) +} + +// WhereHasPlansWith applies a predicate to check if query has an edge plans with a given conditions (other predicates). +func (f *FeatureFilter) WhereHasPlansWith(preds ...predicate.EntitlementPlan) { + f.Where(entql.HasEdgeWith("plans", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *FeatureFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *FeatureFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFeatures applies a predicate to check if query has an edge features. +func (f *FeatureFilter) WhereHasFeatures() { + f.Where(entql.HasEdge("features")) +} + +// WhereHasFeaturesWith applies a predicate to check if query has an edge features with a given conditions (other predicates). +func (f *FeatureFilter) WhereHasFeaturesWith(preds ...predicate.EntitlementPlanFeature) { + f.Where(entql.HasEdgeWith("features", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (fhq *FeatureHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + fhq.predicates = append(fhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the FeatureHistoryQuery builder. +func (fhq *FeatureHistoryQuery) Filter() *FeatureHistoryFilter { + return &FeatureHistoryFilter{config: fhq.config, predicateAdder: fhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *FeatureHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the FeatureHistoryMutation builder. +func (m *FeatureHistoryMutation) Filter() *FeatureHistoryFilter { + return &FeatureHistoryFilter{config: m.config, predicateAdder: m} +} + +// FeatureHistoryFilter provides a generic filtering capability at runtime for FeatureHistoryQuery. +type FeatureHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *FeatureHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[19].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *FeatureHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *FeatureHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(featurehistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *FeatureHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *FeatureHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *FeatureHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(featurehistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *FeatureHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(featurehistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *FeatureHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *FeatureHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *FeatureHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(featurehistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *FeatureHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *FeatureHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *FeatureHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(featurehistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *FeatureHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *FeatureHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *FeatureHistoryFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldDisplayName)) +} + +// WhereEnabled applies the entql bool predicate on the enabled field. +func (f *FeatureHistoryFilter) WhereEnabled(p entql.BoolP) { + f.Where(p.Field(featurehistory.FieldEnabled)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *FeatureHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(featurehistory.FieldDescription)) +} + +// WhereMetadata applies the entql json.RawMessage predicate on the metadata field. +func (f *FeatureHistoryFilter) WhereMetadata(p entql.BytesP) { + f.Where(p.Field(featurehistory.FieldMetadata)) +} + +// addPredicate implements the predicateAdder interface. +func (fq *FileQuery) addPredicate(pred func(s *sql.Selector)) { + fq.predicates = append(fq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the FileQuery builder. +func (fq *FileQuery) Filter() *FileFilter { + return &FileFilter{config: fq.config, predicateAdder: fq} +} + +// addPredicate implements the predicateAdder interface. +func (m *FileMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the FileMutation builder. +func (m *FileMutation) Filter() *FileFilter { + return &FileFilter{config: m.config, predicateAdder: m} +} + +// FileFilter provides a generic filtering capability at runtime for FileQuery. +type FileFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *FileFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[20].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *FileFilter) WhereID(p entql.StringP) { + f.Where(p.Field(file.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *FileFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(file.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *FileFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(file.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *FileFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(file.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *FileFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(file.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *FileFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(file.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *FileFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(file.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *FileFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(file.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *FileFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(file.FieldTags)) +} + +// WhereFileName applies the entql string predicate on the file_name field. +func (f *FileFilter) WhereFileName(p entql.StringP) { + f.Where(p.Field(file.FieldFileName)) +} + +// WhereFileExtension applies the entql string predicate on the file_extension field. +func (f *FileFilter) WhereFileExtension(p entql.StringP) { + f.Where(p.Field(file.FieldFileExtension)) +} + +// WhereFileSize applies the entql int predicate on the file_size field. +func (f *FileFilter) WhereFileSize(p entql.IntP) { + f.Where(p.Field(file.FieldFileSize)) +} + +// WhereContentType applies the entql string predicate on the content_type field. +func (f *FileFilter) WhereContentType(p entql.StringP) { + f.Where(p.Field(file.FieldContentType)) +} + +// WhereStoreKey applies the entql string predicate on the store_key field. +func (f *FileFilter) WhereStoreKey(p entql.StringP) { + f.Where(p.Field(file.FieldStoreKey)) +} + +// WhereCategory applies the entql string predicate on the category field. +func (f *FileFilter) WhereCategory(p entql.StringP) { + f.Where(p.Field(file.FieldCategory)) +} + +// WhereAnnotation applies the entql string predicate on the annotation field. +func (f *FileFilter) WhereAnnotation(p entql.StringP) { + f.Where(p.Field(file.FieldAnnotation)) +} + +// WhereHasUser applies a predicate to check if query has an edge user. +func (f *FileFilter) WhereHasUser() { + f.Where(entql.HasEdge("user")) +} + +// WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates). +func (f *FileFilter) WhereHasUserWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("user", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrganization applies a predicate to check if query has an edge organization. +func (f *FileFilter) WhereHasOrganization() { + f.Where(entql.HasEdge("organization")) +} + +// WhereHasOrganizationWith applies a predicate to check if query has an edge organization with a given conditions (other predicates). +func (f *FileFilter) WhereHasOrganizationWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organization", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntity applies a predicate to check if query has an edge entity. +func (f *FileFilter) WhereHasEntity() { + f.Where(entql.HasEdge("entity")) +} + +// WhereHasEntityWith applies a predicate to check if query has an edge entity with a given conditions (other predicates). +func (f *FileFilter) WhereHasEntityWith(preds ...predicate.Entity) { + f.Where(entql.HasEdgeWith("entity", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasGroup applies a predicate to check if query has an edge group. +func (f *FileFilter) WhereHasGroup() { + f.Where(entql.HasEdge("group")) +} + +// WhereHasGroupWith applies a predicate to check if query has an edge group with a given conditions (other predicates). +func (f *FileFilter) WhereHasGroupWith(preds ...predicate.Group) { + f.Where(entql.HasEdgeWith("group", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (fhq *FileHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + fhq.predicates = append(fhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the FileHistoryQuery builder. +func (fhq *FileHistoryQuery) Filter() *FileHistoryFilter { + return &FileHistoryFilter{config: fhq.config, predicateAdder: fhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *FileHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the FileHistoryMutation builder. +func (m *FileHistoryMutation) Filter() *FileHistoryFilter { + return &FileHistoryFilter{config: m.config, predicateAdder: m} +} + +// FileHistoryFilter provides a generic filtering capability at runtime for FileHistoryQuery. +type FileHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *FileHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[21].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *FileHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(filehistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *FileHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(filehistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *FileHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(filehistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *FileHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(filehistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *FileHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(filehistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *FileHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(filehistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *FileHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(filehistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *FileHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(filehistory.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *FileHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(filehistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *FileHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(filehistory.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *FileHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(filehistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *FileHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(filehistory.FieldTags)) +} + +// WhereFileName applies the entql string predicate on the file_name field. +func (f *FileHistoryFilter) WhereFileName(p entql.StringP) { + f.Where(p.Field(filehistory.FieldFileName)) +} + +// WhereFileExtension applies the entql string predicate on the file_extension field. +func (f *FileHistoryFilter) WhereFileExtension(p entql.StringP) { + f.Where(p.Field(filehistory.FieldFileExtension)) +} + +// WhereFileSize applies the entql int predicate on the file_size field. +func (f *FileHistoryFilter) WhereFileSize(p entql.IntP) { + f.Where(p.Field(filehistory.FieldFileSize)) +} + +// WhereContentType applies the entql string predicate on the content_type field. +func (f *FileHistoryFilter) WhereContentType(p entql.StringP) { + f.Where(p.Field(filehistory.FieldContentType)) +} + +// WhereStoreKey applies the entql string predicate on the store_key field. +func (f *FileHistoryFilter) WhereStoreKey(p entql.StringP) { + f.Where(p.Field(filehistory.FieldStoreKey)) +} + +// WhereCategory applies the entql string predicate on the category field. +func (f *FileHistoryFilter) WhereCategory(p entql.StringP) { + f.Where(p.Field(filehistory.FieldCategory)) +} + +// WhereAnnotation applies the entql string predicate on the annotation field. +func (f *FileHistoryFilter) WhereAnnotation(p entql.StringP) { + f.Where(p.Field(filehistory.FieldAnnotation)) +} + +// addPredicate implements the predicateAdder interface. +func (gq *GroupQuery) addPredicate(pred func(s *sql.Selector)) { + gq.predicates = append(gq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the GroupQuery builder. +func (gq *GroupQuery) Filter() *GroupFilter { + return &GroupFilter{config: gq.config, predicateAdder: gq} +} + +// addPredicate implements the predicateAdder interface. +func (m *GroupMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the GroupMutation builder. +func (m *GroupMutation) Filter() *GroupFilter { + return &GroupFilter{config: m.config, predicateAdder: m} +} + +// GroupFilter provides a generic filtering capability at runtime for GroupQuery. +type GroupFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *GroupFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[22].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *GroupFilter) WhereID(p entql.StringP) { + f.Where(p.Field(group.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *GroupFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(group.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *GroupFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(group.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *GroupFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(group.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *GroupFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(group.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *GroupFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(group.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *GroupFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(group.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *GroupFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(group.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *GroupFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(group.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *GroupFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(group.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *GroupFilter) WhereName(p entql.StringP) { + f.Where(p.Field(group.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *GroupFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(group.FieldDescription)) +} + +// WhereGravatarLogoURL applies the entql string predicate on the gravatar_logo_url field. +func (f *GroupFilter) WhereGravatarLogoURL(p entql.StringP) { + f.Where(p.Field(group.FieldGravatarLogoURL)) +} + +// WhereLogoURL applies the entql string predicate on the logo_url field. +func (f *GroupFilter) WhereLogoURL(p entql.StringP) { + f.Where(p.Field(group.FieldLogoURL)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *GroupFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(group.FieldDisplayName)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *GroupFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *GroupFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasSetting applies a predicate to check if query has an edge setting. +func (f *GroupFilter) WhereHasSetting() { + f.Where(entql.HasEdge("setting")) +} + +// WhereHasSettingWith applies a predicate to check if query has an edge setting with a given conditions (other predicates). +func (f *GroupFilter) WhereHasSettingWith(preds ...predicate.GroupSetting) { + f.Where(entql.HasEdgeWith("setting", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasUsers applies a predicate to check if query has an edge users. +func (f *GroupFilter) WhereHasUsers() { + f.Where(entql.HasEdge("users")) +} + +// WhereHasUsersWith applies a predicate to check if query has an edge users with a given conditions (other predicates). +func (f *GroupFilter) WhereHasUsersWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("users", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *GroupFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *GroupFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasIntegrations applies a predicate to check if query has an edge integrations. +func (f *GroupFilter) WhereHasIntegrations() { + f.Where(entql.HasEdge("integrations")) +} + +// WhereHasIntegrationsWith applies a predicate to check if query has an edge integrations with a given conditions (other predicates). +func (f *GroupFilter) WhereHasIntegrationsWith(preds ...predicate.Integration) { + f.Where(entql.HasEdgeWith("integrations", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFiles applies a predicate to check if query has an edge files. +func (f *GroupFilter) WhereHasFiles() { + f.Where(entql.HasEdge("files")) +} + +// WhereHasFilesWith applies a predicate to check if query has an edge files with a given conditions (other predicates). +func (f *GroupFilter) WhereHasFilesWith(preds ...predicate.File) { + f.Where(entql.HasEdgeWith("files", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasMembers applies a predicate to check if query has an edge members. +func (f *GroupFilter) WhereHasMembers() { + f.Where(entql.HasEdge("members")) +} + +// WhereHasMembersWith applies a predicate to check if query has an edge members with a given conditions (other predicates). +func (f *GroupFilter) WhereHasMembersWith(preds ...predicate.GroupMembership) { + f.Where(entql.HasEdgeWith("members", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ghq *GroupHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ghq.predicates = append(ghq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the GroupHistoryQuery builder. +func (ghq *GroupHistoryQuery) Filter() *GroupHistoryFilter { + return &GroupHistoryFilter{config: ghq.config, predicateAdder: ghq} +} + +// addPredicate implements the predicateAdder interface. +func (m *GroupHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the GroupHistoryMutation builder. +func (m *GroupHistoryMutation) Filter() *GroupHistoryFilter { + return &GroupHistoryFilter{config: m.config, predicateAdder: m} +} + +// GroupHistoryFilter provides a generic filtering capability at runtime for GroupHistoryQuery. +type GroupHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *GroupHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[23].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *GroupHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *GroupHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(grouphistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *GroupHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *GroupHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *GroupHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(grouphistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *GroupHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(grouphistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *GroupHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *GroupHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *GroupHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(grouphistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *GroupHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *GroupHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *GroupHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(grouphistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *GroupHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *GroupHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *GroupHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldDescription)) +} + +// WhereGravatarLogoURL applies the entql string predicate on the gravatar_logo_url field. +func (f *GroupHistoryFilter) WhereGravatarLogoURL(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldGravatarLogoURL)) +} + +// WhereLogoURL applies the entql string predicate on the logo_url field. +func (f *GroupHistoryFilter) WhereLogoURL(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldLogoURL)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *GroupHistoryFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(grouphistory.FieldDisplayName)) +} + +// addPredicate implements the predicateAdder interface. +func (gmq *GroupMembershipQuery) addPredicate(pred func(s *sql.Selector)) { + gmq.predicates = append(gmq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the GroupMembershipQuery builder. +func (gmq *GroupMembershipQuery) Filter() *GroupMembershipFilter { + return &GroupMembershipFilter{config: gmq.config, predicateAdder: gmq} +} + +// addPredicate implements the predicateAdder interface. +func (m *GroupMembershipMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the GroupMembershipMutation builder. +func (m *GroupMembershipMutation) Filter() *GroupMembershipFilter { + return &GroupMembershipFilter{config: m.config, predicateAdder: m} +} + +// GroupMembershipFilter provides a generic filtering capability at runtime for GroupMembershipQuery. +type GroupMembershipFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *GroupMembershipFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[24].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *GroupMembershipFilter) WhereID(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *GroupMembershipFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(groupmembership.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *GroupMembershipFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(groupmembership.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *GroupMembershipFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *GroupMembershipFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *GroupMembershipFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *GroupMembershipFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(groupmembership.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *GroupMembershipFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldDeletedBy)) +} + +// WhereRole applies the entql string predicate on the role field. +func (f *GroupMembershipFilter) WhereRole(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldRole)) +} + +// WhereGroupID applies the entql string predicate on the group_id field. +func (f *GroupMembershipFilter) WhereGroupID(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldGroupID)) +} + +// WhereUserID applies the entql string predicate on the user_id field. +func (f *GroupMembershipFilter) WhereUserID(p entql.StringP) { + f.Where(p.Field(groupmembership.FieldUserID)) +} + +// WhereHasGroup applies a predicate to check if query has an edge group. +func (f *GroupMembershipFilter) WhereHasGroup() { + f.Where(entql.HasEdge("group")) +} + +// WhereHasGroupWith applies a predicate to check if query has an edge group with a given conditions (other predicates). +func (f *GroupMembershipFilter) WhereHasGroupWith(preds ...predicate.Group) { + f.Where(entql.HasEdgeWith("group", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasUser applies a predicate to check if query has an edge user. +func (f *GroupMembershipFilter) WhereHasUser() { + f.Where(entql.HasEdge("user")) +} + +// WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates). +func (f *GroupMembershipFilter) WhereHasUserWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("user", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *GroupMembershipFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *GroupMembershipFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (gmhq *GroupMembershipHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + gmhq.predicates = append(gmhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the GroupMembershipHistoryQuery builder. +func (gmhq *GroupMembershipHistoryQuery) Filter() *GroupMembershipHistoryFilter { + return &GroupMembershipHistoryFilter{config: gmhq.config, predicateAdder: gmhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *GroupMembershipHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the GroupMembershipHistoryMutation builder. +func (m *GroupMembershipHistoryMutation) Filter() *GroupMembershipHistoryFilter { + return &GroupMembershipHistoryFilter{config: m.config, predicateAdder: m} +} + +// GroupMembershipHistoryFilter provides a generic filtering capability at runtime for GroupMembershipHistoryQuery. +type GroupMembershipHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *GroupMembershipHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[25].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *GroupMembershipHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *GroupMembershipHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(groupmembershiphistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *GroupMembershipHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *GroupMembershipHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *GroupMembershipHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(groupmembershiphistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *GroupMembershipHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(groupmembershiphistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *GroupMembershipHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *GroupMembershipHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *GroupMembershipHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *GroupMembershipHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(groupmembershiphistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *GroupMembershipHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldDeletedBy)) +} + +// WhereRole applies the entql string predicate on the role field. +func (f *GroupMembershipHistoryFilter) WhereRole(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldRole)) +} + +// WhereGroupID applies the entql string predicate on the group_id field. +func (f *GroupMembershipHistoryFilter) WhereGroupID(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldGroupID)) +} + +// WhereUserID applies the entql string predicate on the user_id field. +func (f *GroupMembershipHistoryFilter) WhereUserID(p entql.StringP) { + f.Where(p.Field(groupmembershiphistory.FieldUserID)) +} + +// addPredicate implements the predicateAdder interface. +func (gsq *GroupSettingQuery) addPredicate(pred func(s *sql.Selector)) { + gsq.predicates = append(gsq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the GroupSettingQuery builder. +func (gsq *GroupSettingQuery) Filter() *GroupSettingFilter { + return &GroupSettingFilter{config: gsq.config, predicateAdder: gsq} +} + +// addPredicate implements the predicateAdder interface. +func (m *GroupSettingMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the GroupSettingMutation builder. +func (m *GroupSettingMutation) Filter() *GroupSettingFilter { + return &GroupSettingFilter{config: m.config, predicateAdder: m} +} + +// GroupSettingFilter provides a generic filtering capability at runtime for GroupSettingQuery. +type GroupSettingFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *GroupSettingFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[26].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *GroupSettingFilter) WhereID(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *GroupSettingFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(groupsetting.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *GroupSettingFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(groupsetting.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *GroupSettingFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *GroupSettingFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *GroupSettingFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *GroupSettingFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(groupsetting.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *GroupSettingFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(groupsetting.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *GroupSettingFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldDeletedBy)) +} + +// WhereVisibility applies the entql string predicate on the visibility field. +func (f *GroupSettingFilter) WhereVisibility(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldVisibility)) +} + +// WhereJoinPolicy applies the entql string predicate on the join_policy field. +func (f *GroupSettingFilter) WhereJoinPolicy(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldJoinPolicy)) +} + +// WhereSyncToSlack applies the entql bool predicate on the sync_to_slack field. +func (f *GroupSettingFilter) WhereSyncToSlack(p entql.BoolP) { + f.Where(p.Field(groupsetting.FieldSyncToSlack)) +} + +// WhereSyncToGithub applies the entql bool predicate on the sync_to_github field. +func (f *GroupSettingFilter) WhereSyncToGithub(p entql.BoolP) { + f.Where(p.Field(groupsetting.FieldSyncToGithub)) +} + +// WhereGroupID applies the entql string predicate on the group_id field. +func (f *GroupSettingFilter) WhereGroupID(p entql.StringP) { + f.Where(p.Field(groupsetting.FieldGroupID)) +} + +// WhereHasGroup applies a predicate to check if query has an edge group. +func (f *GroupSettingFilter) WhereHasGroup() { + f.Where(entql.HasEdge("group")) +} + +// WhereHasGroupWith applies a predicate to check if query has an edge group with a given conditions (other predicates). +func (f *GroupSettingFilter) WhereHasGroupWith(preds ...predicate.Group) { + f.Where(entql.HasEdgeWith("group", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (gshq *GroupSettingHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + gshq.predicates = append(gshq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the GroupSettingHistoryQuery builder. +func (gshq *GroupSettingHistoryQuery) Filter() *GroupSettingHistoryFilter { + return &GroupSettingHistoryFilter{config: gshq.config, predicateAdder: gshq} +} + +// addPredicate implements the predicateAdder interface. +func (m *GroupSettingHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the GroupSettingHistoryMutation builder. +func (m *GroupSettingHistoryMutation) Filter() *GroupSettingHistoryFilter { + return &GroupSettingHistoryFilter{config: m.config, predicateAdder: m} +} + +// GroupSettingHistoryFilter provides a generic filtering capability at runtime for GroupSettingHistoryQuery. +type GroupSettingHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *GroupSettingHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[27].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *GroupSettingHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *GroupSettingHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(groupsettinghistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *GroupSettingHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *GroupSettingHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *GroupSettingHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(groupsettinghistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *GroupSettingHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(groupsettinghistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *GroupSettingHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *GroupSettingHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *GroupSettingHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *GroupSettingHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(groupsettinghistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *GroupSettingHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(groupsettinghistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *GroupSettingHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldDeletedBy)) +} + +// WhereVisibility applies the entql string predicate on the visibility field. +func (f *GroupSettingHistoryFilter) WhereVisibility(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldVisibility)) +} + +// WhereJoinPolicy applies the entql string predicate on the join_policy field. +func (f *GroupSettingHistoryFilter) WhereJoinPolicy(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldJoinPolicy)) +} + +// WhereSyncToSlack applies the entql bool predicate on the sync_to_slack field. +func (f *GroupSettingHistoryFilter) WhereSyncToSlack(p entql.BoolP) { + f.Where(p.Field(groupsettinghistory.FieldSyncToSlack)) +} + +// WhereSyncToGithub applies the entql bool predicate on the sync_to_github field. +func (f *GroupSettingHistoryFilter) WhereSyncToGithub(p entql.BoolP) { + f.Where(p.Field(groupsettinghistory.FieldSyncToGithub)) +} + +// WhereGroupID applies the entql string predicate on the group_id field. +func (f *GroupSettingHistoryFilter) WhereGroupID(p entql.StringP) { + f.Where(p.Field(groupsettinghistory.FieldGroupID)) +} + +// addPredicate implements the predicateAdder interface. +func (hq *HushQuery) addPredicate(pred func(s *sql.Selector)) { + hq.predicates = append(hq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the HushQuery builder. +func (hq *HushQuery) Filter() *HushFilter { + return &HushFilter{config: hq.config, predicateAdder: hq} +} + +// addPredicate implements the predicateAdder interface. +func (m *HushMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the HushMutation builder. +func (m *HushMutation) Filter() *HushFilter { + return &HushFilter{config: m.config, predicateAdder: m} +} + +// HushFilter provides a generic filtering capability at runtime for HushQuery. +type HushFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *HushFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[28].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *HushFilter) WhereID(p entql.StringP) { + f.Where(p.Field(hush.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *HushFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(hush.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *HushFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(hush.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *HushFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(hush.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *HushFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(hush.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *HushFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(hush.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *HushFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(hush.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *HushFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(hush.FieldDeletedBy)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *HushFilter) WhereName(p entql.StringP) { + f.Where(p.Field(hush.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *HushFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(hush.FieldDescription)) +} + +// WhereKind applies the entql string predicate on the kind field. +func (f *HushFilter) WhereKind(p entql.StringP) { + f.Where(p.Field(hush.FieldKind)) +} + +// WhereSecretName applies the entql string predicate on the secret_name field. +func (f *HushFilter) WhereSecretName(p entql.StringP) { + f.Where(p.Field(hush.FieldSecretName)) +} + +// WhereSecretValue applies the entql string predicate on the secret_value field. +func (f *HushFilter) WhereSecretValue(p entql.StringP) { + f.Where(p.Field(hush.FieldSecretValue)) +} + +// WhereHasIntegrations applies a predicate to check if query has an edge integrations. +func (f *HushFilter) WhereHasIntegrations() { + f.Where(entql.HasEdge("integrations")) +} + +// WhereHasIntegrationsWith applies a predicate to check if query has an edge integrations with a given conditions (other predicates). +func (f *HushFilter) WhereHasIntegrationsWith(preds ...predicate.Integration) { + f.Where(entql.HasEdgeWith("integrations", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrganization applies a predicate to check if query has an edge organization. +func (f *HushFilter) WhereHasOrganization() { + f.Where(entql.HasEdge("organization")) +} + +// WhereHasOrganizationWith applies a predicate to check if query has an edge organization with a given conditions (other predicates). +func (f *HushFilter) WhereHasOrganizationWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organization", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *HushFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *HushFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (hhq *HushHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + hhq.predicates = append(hhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the HushHistoryQuery builder. +func (hhq *HushHistoryQuery) Filter() *HushHistoryFilter { + return &HushHistoryFilter{config: hhq.config, predicateAdder: hhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *HushHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the HushHistoryMutation builder. +func (m *HushHistoryMutation) Filter() *HushHistoryFilter { + return &HushHistoryFilter{config: m.config, predicateAdder: m} +} + +// HushHistoryFilter provides a generic filtering capability at runtime for HushHistoryQuery. +type HushHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *HushHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[29].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *HushHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *HushHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(hushhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *HushHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *HushHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *HushHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(hushhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *HushHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(hushhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *HushHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *HushHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *HushHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *HushHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(hushhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *HushHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldDeletedBy)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *HushHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *HushHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldDescription)) +} + +// WhereKind applies the entql string predicate on the kind field. +func (f *HushHistoryFilter) WhereKind(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldKind)) +} + +// WhereSecretName applies the entql string predicate on the secret_name field. +func (f *HushHistoryFilter) WhereSecretName(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldSecretName)) +} + +// WhereSecretValue applies the entql string predicate on the secret_value field. +func (f *HushHistoryFilter) WhereSecretValue(p entql.StringP) { + f.Where(p.Field(hushhistory.FieldSecretValue)) +} + +// addPredicate implements the predicateAdder interface. +func (iq *IntegrationQuery) addPredicate(pred func(s *sql.Selector)) { + iq.predicates = append(iq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the IntegrationQuery builder. +func (iq *IntegrationQuery) Filter() *IntegrationFilter { + return &IntegrationFilter{config: iq.config, predicateAdder: iq} +} + +// addPredicate implements the predicateAdder interface. +func (m *IntegrationMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the IntegrationMutation builder. +func (m *IntegrationMutation) Filter() *IntegrationFilter { + return &IntegrationFilter{config: m.config, predicateAdder: m} +} + +// IntegrationFilter provides a generic filtering capability at runtime for IntegrationQuery. +type IntegrationFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *IntegrationFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[30].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *IntegrationFilter) WhereID(p entql.StringP) { + f.Where(p.Field(integration.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *IntegrationFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(integration.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *IntegrationFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(integration.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *IntegrationFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(integration.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *IntegrationFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(integration.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *IntegrationFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(integration.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *IntegrationFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(integration.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *IntegrationFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(integration.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *IntegrationFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(integration.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *IntegrationFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(integration.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *IntegrationFilter) WhereName(p entql.StringP) { + f.Where(p.Field(integration.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *IntegrationFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(integration.FieldDescription)) +} + +// WhereKind applies the entql string predicate on the kind field. +func (f *IntegrationFilter) WhereKind(p entql.StringP) { + f.Where(p.Field(integration.FieldKind)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *IntegrationFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *IntegrationFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasSecrets applies a predicate to check if query has an edge secrets. +func (f *IntegrationFilter) WhereHasSecrets() { + f.Where(entql.HasEdge("secrets")) +} + +// WhereHasSecretsWith applies a predicate to check if query has an edge secrets with a given conditions (other predicates). +func (f *IntegrationFilter) WhereHasSecretsWith(preds ...predicate.Hush) { + f.Where(entql.HasEdgeWith("secrets", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOauth2tokens applies a predicate to check if query has an edge oauth2tokens. +func (f *IntegrationFilter) WhereHasOauth2tokens() { + f.Where(entql.HasEdge("oauth2tokens")) +} + +// WhereHasOauth2tokensWith applies a predicate to check if query has an edge oauth2tokens with a given conditions (other predicates). +func (f *IntegrationFilter) WhereHasOauth2tokensWith(preds ...predicate.OhAuthTooToken) { + f.Where(entql.HasEdgeWith("oauth2tokens", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *IntegrationFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *IntegrationFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasWebhooks applies a predicate to check if query has an edge webhooks. +func (f *IntegrationFilter) WhereHasWebhooks() { + f.Where(entql.HasEdge("webhooks")) +} + +// WhereHasWebhooksWith applies a predicate to check if query has an edge webhooks with a given conditions (other predicates). +func (f *IntegrationFilter) WhereHasWebhooksWith(preds ...predicate.Webhook) { + f.Where(entql.HasEdgeWith("webhooks", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ihq *IntegrationHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ihq.predicates = append(ihq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the IntegrationHistoryQuery builder. +func (ihq *IntegrationHistoryQuery) Filter() *IntegrationHistoryFilter { + return &IntegrationHistoryFilter{config: ihq.config, predicateAdder: ihq} +} + +// addPredicate implements the predicateAdder interface. +func (m *IntegrationHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the IntegrationHistoryMutation builder. +func (m *IntegrationHistoryMutation) Filter() *IntegrationHistoryFilter { + return &IntegrationHistoryFilter{config: m.config, predicateAdder: m} +} + +// IntegrationHistoryFilter provides a generic filtering capability at runtime for IntegrationHistoryQuery. +type IntegrationHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *IntegrationHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[31].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *IntegrationHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *IntegrationHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(integrationhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *IntegrationHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *IntegrationHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *IntegrationHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(integrationhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *IntegrationHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(integrationhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *IntegrationHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *IntegrationHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *IntegrationHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *IntegrationHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(integrationhistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *IntegrationHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(integrationhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *IntegrationHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *IntegrationHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *IntegrationHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *IntegrationHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldDescription)) +} + +// WhereKind applies the entql string predicate on the kind field. +func (f *IntegrationHistoryFilter) WhereKind(p entql.StringP) { + f.Where(p.Field(integrationhistory.FieldKind)) +} + +// addPredicate implements the predicateAdder interface. +func (iq *InviteQuery) addPredicate(pred func(s *sql.Selector)) { + iq.predicates = append(iq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the InviteQuery builder. +func (iq *InviteQuery) Filter() *InviteFilter { + return &InviteFilter{config: iq.config, predicateAdder: iq} +} + +// addPredicate implements the predicateAdder interface. +func (m *InviteMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the InviteMutation builder. +func (m *InviteMutation) Filter() *InviteFilter { + return &InviteFilter{config: m.config, predicateAdder: m} +} + +// InviteFilter provides a generic filtering capability at runtime for InviteQuery. +type InviteFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *InviteFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[32].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *InviteFilter) WhereID(p entql.StringP) { + f.Where(p.Field(invite.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *InviteFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(invite.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *InviteFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(invite.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *InviteFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(invite.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *InviteFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(invite.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *InviteFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(invite.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *InviteFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(invite.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *InviteFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(invite.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *InviteFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(invite.FieldOwnerID)) +} + +// WhereToken applies the entql string predicate on the token field. +func (f *InviteFilter) WhereToken(p entql.StringP) { + f.Where(p.Field(invite.FieldToken)) +} + +// WhereExpires applies the entql time.Time predicate on the expires field. +func (f *InviteFilter) WhereExpires(p entql.TimeP) { + f.Where(p.Field(invite.FieldExpires)) +} + +// WhereRecipient applies the entql string predicate on the recipient field. +func (f *InviteFilter) WhereRecipient(p entql.StringP) { + f.Where(p.Field(invite.FieldRecipient)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *InviteFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(invite.FieldStatus)) +} + +// WhereRole applies the entql string predicate on the role field. +func (f *InviteFilter) WhereRole(p entql.StringP) { + f.Where(p.Field(invite.FieldRole)) +} + +// WhereSendAttempts applies the entql int predicate on the send_attempts field. +func (f *InviteFilter) WhereSendAttempts(p entql.IntP) { + f.Where(p.Field(invite.FieldSendAttempts)) +} + +// WhereRequestorID applies the entql string predicate on the requestor_id field. +func (f *InviteFilter) WhereRequestorID(p entql.StringP) { + f.Where(p.Field(invite.FieldRequestorID)) +} + +// WhereSecret applies the entql []byte predicate on the secret field. +func (f *InviteFilter) WhereSecret(p entql.BytesP) { + f.Where(p.Field(invite.FieldSecret)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *InviteFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *InviteFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *InviteFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *InviteFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (nq *NoteQuery) addPredicate(pred func(s *sql.Selector)) { + nq.predicates = append(nq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the NoteQuery builder. +func (nq *NoteQuery) Filter() *NoteFilter { + return &NoteFilter{config: nq.config, predicateAdder: nq} +} + +// addPredicate implements the predicateAdder interface. +func (m *NoteMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the NoteMutation builder. +func (m *NoteMutation) Filter() *NoteFilter { + return &NoteFilter{config: m.config, predicateAdder: m} +} + +// NoteFilter provides a generic filtering capability at runtime for NoteQuery. +type NoteFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *NoteFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[33].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *NoteFilter) WhereID(p entql.StringP) { + f.Where(p.Field(note.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *NoteFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(note.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *NoteFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(note.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *NoteFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(note.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *NoteFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(note.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *NoteFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(note.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *NoteFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(note.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *NoteFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(note.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *NoteFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(note.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *NoteFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(note.FieldOwnerID)) +} + +// WhereText applies the entql string predicate on the text field. +func (f *NoteFilter) WhereText(p entql.StringP) { + f.Where(p.Field(note.FieldText)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *NoteFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *NoteFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntity applies a predicate to check if query has an edge entity. +func (f *NoteFilter) WhereHasEntity() { + f.Where(entql.HasEdge("entity")) +} + +// WhereHasEntityWith applies a predicate to check if query has an edge entity with a given conditions (other predicates). +func (f *NoteFilter) WhereHasEntityWith(preds ...predicate.Entity) { + f.Where(entql.HasEdgeWith("entity", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (nhq *NoteHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + nhq.predicates = append(nhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the NoteHistoryQuery builder. +func (nhq *NoteHistoryQuery) Filter() *NoteHistoryFilter { + return &NoteHistoryFilter{config: nhq.config, predicateAdder: nhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *NoteHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the NoteHistoryMutation builder. +func (m *NoteHistoryMutation) Filter() *NoteHistoryFilter { + return &NoteHistoryFilter{config: m.config, predicateAdder: m} +} + +// NoteHistoryFilter provides a generic filtering capability at runtime for NoteHistoryQuery. +type NoteHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *NoteHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[34].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *NoteHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(notehistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *NoteHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(notehistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *NoteHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(notehistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *NoteHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(notehistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *NoteHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(notehistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *NoteHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(notehistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *NoteHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(notehistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *NoteHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(notehistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *NoteHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(notehistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *NoteHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(notehistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *NoteHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(notehistory.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *NoteHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(notehistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *NoteHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(notehistory.FieldOwnerID)) +} + +// WhereText applies the entql string predicate on the text field. +func (f *NoteHistoryFilter) WhereText(p entql.StringP) { + f.Where(p.Field(notehistory.FieldText)) +} + +// addPredicate implements the predicateAdder interface. +func (opq *OauthProviderQuery) addPredicate(pred func(s *sql.Selector)) { + opq.predicates = append(opq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OauthProviderQuery builder. +func (opq *OauthProviderQuery) Filter() *OauthProviderFilter { + return &OauthProviderFilter{config: opq.config, predicateAdder: opq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OauthProviderMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OauthProviderMutation builder. +func (m *OauthProviderMutation) Filter() *OauthProviderFilter { + return &OauthProviderFilter{config: m.config, predicateAdder: m} +} + +// OauthProviderFilter provides a generic filtering capability at runtime for OauthProviderQuery. +type OauthProviderFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OauthProviderFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[35].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OauthProviderFilter) WhereID(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OauthProviderFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(oauthprovider.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OauthProviderFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(oauthprovider.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OauthProviderFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OauthProviderFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OauthProviderFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *OauthProviderFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(oauthprovider.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OauthProviderFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(oauthprovider.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OauthProviderFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *OauthProviderFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *OauthProviderFilter) WhereName(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldName)) +} + +// WhereClientID applies the entql string predicate on the client_id field. +func (f *OauthProviderFilter) WhereClientID(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldClientID)) +} + +// WhereClientSecret applies the entql string predicate on the client_secret field. +func (f *OauthProviderFilter) WhereClientSecret(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldClientSecret)) +} + +// WhereRedirectURL applies the entql string predicate on the redirect_url field. +func (f *OauthProviderFilter) WhereRedirectURL(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldRedirectURL)) +} + +// WhereScopes applies the entql string predicate on the scopes field. +func (f *OauthProviderFilter) WhereScopes(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldScopes)) +} + +// WhereAuthURL applies the entql string predicate on the auth_url field. +func (f *OauthProviderFilter) WhereAuthURL(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldAuthURL)) +} + +// WhereTokenURL applies the entql string predicate on the token_url field. +func (f *OauthProviderFilter) WhereTokenURL(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldTokenURL)) +} + +// WhereAuthStyle applies the entql uint8 predicate on the auth_style field. +func (f *OauthProviderFilter) WhereAuthStyle(p entql.Uint8P) { + f.Where(p.Field(oauthprovider.FieldAuthStyle)) +} + +// WhereInfoURL applies the entql string predicate on the info_url field. +func (f *OauthProviderFilter) WhereInfoURL(p entql.StringP) { + f.Where(p.Field(oauthprovider.FieldInfoURL)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *OauthProviderFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *OauthProviderFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ophq *OauthProviderHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ophq.predicates = append(ophq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OauthProviderHistoryQuery builder. +func (ophq *OauthProviderHistoryQuery) Filter() *OauthProviderHistoryFilter { + return &OauthProviderHistoryFilter{config: ophq.config, predicateAdder: ophq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OauthProviderHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OauthProviderHistoryMutation builder. +func (m *OauthProviderHistoryMutation) Filter() *OauthProviderHistoryFilter { + return &OauthProviderHistoryFilter{config: m.config, predicateAdder: m} +} + +// OauthProviderHistoryFilter provides a generic filtering capability at runtime for OauthProviderHistoryQuery. +type OauthProviderHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OauthProviderHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[36].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OauthProviderHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *OauthProviderHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(oauthproviderhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *OauthProviderHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *OauthProviderHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OauthProviderHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(oauthproviderhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OauthProviderHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(oauthproviderhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OauthProviderHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OauthProviderHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OauthProviderHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *OauthProviderHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(oauthproviderhistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OauthProviderHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(oauthproviderhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OauthProviderHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *OauthProviderHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *OauthProviderHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldName)) +} + +// WhereClientID applies the entql string predicate on the client_id field. +func (f *OauthProviderHistoryFilter) WhereClientID(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldClientID)) +} + +// WhereClientSecret applies the entql string predicate on the client_secret field. +func (f *OauthProviderHistoryFilter) WhereClientSecret(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldClientSecret)) +} + +// WhereRedirectURL applies the entql string predicate on the redirect_url field. +func (f *OauthProviderHistoryFilter) WhereRedirectURL(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldRedirectURL)) +} + +// WhereScopes applies the entql string predicate on the scopes field. +func (f *OauthProviderHistoryFilter) WhereScopes(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldScopes)) +} + +// WhereAuthURL applies the entql string predicate on the auth_url field. +func (f *OauthProviderHistoryFilter) WhereAuthURL(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldAuthURL)) +} + +// WhereTokenURL applies the entql string predicate on the token_url field. +func (f *OauthProviderHistoryFilter) WhereTokenURL(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldTokenURL)) +} + +// WhereAuthStyle applies the entql uint8 predicate on the auth_style field. +func (f *OauthProviderHistoryFilter) WhereAuthStyle(p entql.Uint8P) { + f.Where(p.Field(oauthproviderhistory.FieldAuthStyle)) +} + +// WhereInfoURL applies the entql string predicate on the info_url field. +func (f *OauthProviderHistoryFilter) WhereInfoURL(p entql.StringP) { + f.Where(p.Field(oauthproviderhistory.FieldInfoURL)) +} + +// addPredicate implements the predicateAdder interface. +func (oattq *OhAuthTooTokenQuery) addPredicate(pred func(s *sql.Selector)) { + oattq.predicates = append(oattq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OhAuthTooTokenQuery builder. +func (oattq *OhAuthTooTokenQuery) Filter() *OhAuthTooTokenFilter { + return &OhAuthTooTokenFilter{config: oattq.config, predicateAdder: oattq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OhAuthTooTokenMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OhAuthTooTokenMutation builder. +func (m *OhAuthTooTokenMutation) Filter() *OhAuthTooTokenFilter { + return &OhAuthTooTokenFilter{config: m.config, predicateAdder: m} +} + +// OhAuthTooTokenFilter provides a generic filtering capability at runtime for OhAuthTooTokenQuery. +type OhAuthTooTokenFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OhAuthTooTokenFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[37].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OhAuthTooTokenFilter) WhereID(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldID)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OhAuthTooTokenFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *OhAuthTooTokenFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(ohauthtootoken.FieldTags)) +} + +// WhereClientID applies the entql string predicate on the client_id field. +func (f *OhAuthTooTokenFilter) WhereClientID(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldClientID)) +} + +// WhereScopes applies the entql json.RawMessage predicate on the scopes field. +func (f *OhAuthTooTokenFilter) WhereScopes(p entql.BytesP) { + f.Where(p.Field(ohauthtootoken.FieldScopes)) +} + +// WhereNonce applies the entql string predicate on the nonce field. +func (f *OhAuthTooTokenFilter) WhereNonce(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldNonce)) +} + +// WhereClaimsUserID applies the entql string predicate on the claims_user_id field. +func (f *OhAuthTooTokenFilter) WhereClaimsUserID(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldClaimsUserID)) +} + +// WhereClaimsUsername applies the entql string predicate on the claims_username field. +func (f *OhAuthTooTokenFilter) WhereClaimsUsername(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldClaimsUsername)) +} + +// WhereClaimsEmail applies the entql string predicate on the claims_email field. +func (f *OhAuthTooTokenFilter) WhereClaimsEmail(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldClaimsEmail)) +} + +// WhereClaimsEmailVerified applies the entql bool predicate on the claims_email_verified field. +func (f *OhAuthTooTokenFilter) WhereClaimsEmailVerified(p entql.BoolP) { + f.Where(p.Field(ohauthtootoken.FieldClaimsEmailVerified)) +} + +// WhereClaimsGroups applies the entql json.RawMessage predicate on the claims_groups field. +func (f *OhAuthTooTokenFilter) WhereClaimsGroups(p entql.BytesP) { + f.Where(p.Field(ohauthtootoken.FieldClaimsGroups)) +} + +// WhereClaimsPreferredUsername applies the entql string predicate on the claims_preferred_username field. +func (f *OhAuthTooTokenFilter) WhereClaimsPreferredUsername(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldClaimsPreferredUsername)) +} + +// WhereConnectorID applies the entql string predicate on the connector_id field. +func (f *OhAuthTooTokenFilter) WhereConnectorID(p entql.StringP) { + f.Where(p.Field(ohauthtootoken.FieldConnectorID)) +} + +// WhereConnectorData applies the entql json.RawMessage predicate on the connector_data field. +func (f *OhAuthTooTokenFilter) WhereConnectorData(p entql.BytesP) { + f.Where(p.Field(ohauthtootoken.FieldConnectorData)) +} + +// WhereLastUsed applies the entql time.Time predicate on the last_used field. +func (f *OhAuthTooTokenFilter) WhereLastUsed(p entql.TimeP) { + f.Where(p.Field(ohauthtootoken.FieldLastUsed)) +} + +// WhereHasIntegration applies a predicate to check if query has an edge integration. +func (f *OhAuthTooTokenFilter) WhereHasIntegration() { + f.Where(entql.HasEdge("integration")) +} + +// WhereHasIntegrationWith applies a predicate to check if query has an edge integration with a given conditions (other predicates). +func (f *OhAuthTooTokenFilter) WhereHasIntegrationWith(preds ...predicate.Integration) { + f.Where(entql.HasEdgeWith("integration", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *OhAuthTooTokenFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *OhAuthTooTokenFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (omq *OrgMembershipQuery) addPredicate(pred func(s *sql.Selector)) { + omq.predicates = append(omq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OrgMembershipQuery builder. +func (omq *OrgMembershipQuery) Filter() *OrgMembershipFilter { + return &OrgMembershipFilter{config: omq.config, predicateAdder: omq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OrgMembershipMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OrgMembershipMutation builder. +func (m *OrgMembershipMutation) Filter() *OrgMembershipFilter { + return &OrgMembershipFilter{config: m.config, predicateAdder: m} +} + +// OrgMembershipFilter provides a generic filtering capability at runtime for OrgMembershipQuery. +type OrgMembershipFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OrgMembershipFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[38].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OrgMembershipFilter) WhereID(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OrgMembershipFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(orgmembership.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OrgMembershipFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(orgmembership.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OrgMembershipFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OrgMembershipFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OrgMembershipFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OrgMembershipFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(orgmembership.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OrgMembershipFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldDeletedBy)) +} + +// WhereRole applies the entql string predicate on the role field. +func (f *OrgMembershipFilter) WhereRole(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldRole)) +} + +// WhereOrganizationID applies the entql string predicate on the organization_id field. +func (f *OrgMembershipFilter) WhereOrganizationID(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldOrganizationID)) +} + +// WhereUserID applies the entql string predicate on the user_id field. +func (f *OrgMembershipFilter) WhereUserID(p entql.StringP) { + f.Where(p.Field(orgmembership.FieldUserID)) +} + +// WhereHasOrganization applies a predicate to check if query has an edge organization. +func (f *OrgMembershipFilter) WhereHasOrganization() { + f.Where(entql.HasEdge("organization")) +} + +// WhereHasOrganizationWith applies a predicate to check if query has an edge organization with a given conditions (other predicates). +func (f *OrgMembershipFilter) WhereHasOrganizationWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organization", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasUser applies a predicate to check if query has an edge user. +func (f *OrgMembershipFilter) WhereHasUser() { + f.Where(entql.HasEdge("user")) +} + +// WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates). +func (f *OrgMembershipFilter) WhereHasUserWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("user", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *OrgMembershipFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *OrgMembershipFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (omhq *OrgMembershipHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + omhq.predicates = append(omhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OrgMembershipHistoryQuery builder. +func (omhq *OrgMembershipHistoryQuery) Filter() *OrgMembershipHistoryFilter { + return &OrgMembershipHistoryFilter{config: omhq.config, predicateAdder: omhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OrgMembershipHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OrgMembershipHistoryMutation builder. +func (m *OrgMembershipHistoryMutation) Filter() *OrgMembershipHistoryFilter { + return &OrgMembershipHistoryFilter{config: m.config, predicateAdder: m} +} + +// OrgMembershipHistoryFilter provides a generic filtering capability at runtime for OrgMembershipHistoryQuery. +type OrgMembershipHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OrgMembershipHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[39].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OrgMembershipHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *OrgMembershipHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(orgmembershiphistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *OrgMembershipHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *OrgMembershipHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OrgMembershipHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(orgmembershiphistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OrgMembershipHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(orgmembershiphistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OrgMembershipHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OrgMembershipHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OrgMembershipHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OrgMembershipHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(orgmembershiphistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OrgMembershipHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldDeletedBy)) +} + +// WhereRole applies the entql string predicate on the role field. +func (f *OrgMembershipHistoryFilter) WhereRole(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldRole)) +} + +// WhereOrganizationID applies the entql string predicate on the organization_id field. +func (f *OrgMembershipHistoryFilter) WhereOrganizationID(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldOrganizationID)) +} + +// WhereUserID applies the entql string predicate on the user_id field. +func (f *OrgMembershipHistoryFilter) WhereUserID(p entql.StringP) { + f.Where(p.Field(orgmembershiphistory.FieldUserID)) +} + +// addPredicate implements the predicateAdder interface. +func (oq *OrganizationQuery) addPredicate(pred func(s *sql.Selector)) { + oq.predicates = append(oq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OrganizationQuery builder. +func (oq *OrganizationQuery) Filter() *OrganizationFilter { + return &OrganizationFilter{config: oq.config, predicateAdder: oq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OrganizationMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OrganizationMutation builder. +func (m *OrganizationMutation) Filter() *OrganizationFilter { + return &OrganizationFilter{config: m.config, predicateAdder: m} +} + +// OrganizationFilter provides a generic filtering capability at runtime for OrganizationQuery. +type OrganizationFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OrganizationFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[40].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OrganizationFilter) WhereID(p entql.StringP) { + f.Where(p.Field(organization.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OrganizationFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(organization.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OrganizationFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(organization.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OrganizationFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(organization.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OrganizationFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(organization.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OrganizationFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(organization.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *OrganizationFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(organization.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OrganizationFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(organization.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OrganizationFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(organization.FieldDeletedBy)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *OrganizationFilter) WhereName(p entql.StringP) { + f.Where(p.Field(organization.FieldName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *OrganizationFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(organization.FieldDisplayName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *OrganizationFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(organization.FieldDescription)) +} + +// WhereParentOrganizationID applies the entql string predicate on the parent_organization_id field. +func (f *OrganizationFilter) WhereParentOrganizationID(p entql.StringP) { + f.Where(p.Field(organization.FieldParentOrganizationID)) +} + +// WherePersonalOrg applies the entql bool predicate on the personal_org field. +func (f *OrganizationFilter) WherePersonalOrg(p entql.BoolP) { + f.Where(p.Field(organization.FieldPersonalOrg)) +} + +// WhereAvatarRemoteURL applies the entql string predicate on the avatar_remote_url field. +func (f *OrganizationFilter) WhereAvatarRemoteURL(p entql.StringP) { + f.Where(p.Field(organization.FieldAvatarRemoteURL)) +} + +// WhereDedicatedDb applies the entql bool predicate on the dedicated_db field. +func (f *OrganizationFilter) WhereDedicatedDb(p entql.BoolP) { + f.Where(p.Field(organization.FieldDedicatedDb)) +} + +// WhereHasParent applies a predicate to check if query has an edge parent. +func (f *OrganizationFilter) WhereHasParent() { + f.Where(entql.HasEdge("parent")) +} + +// WhereHasParentWith applies a predicate to check if query has an edge parent with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasParentWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("parent", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasChildren applies a predicate to check if query has an edge children. +func (f *OrganizationFilter) WhereHasChildren() { + f.Where(entql.HasEdge("children")) +} + +// WhereHasChildrenWith applies a predicate to check if query has an edge children with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasChildrenWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("children", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasGroups applies a predicate to check if query has an edge groups. +func (f *OrganizationFilter) WhereHasGroups() { + f.Where(entql.HasEdge("groups")) +} + +// WhereHasGroupsWith applies a predicate to check if query has an edge groups with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasGroupsWith(preds ...predicate.Group) { + f.Where(entql.HasEdgeWith("groups", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasTemplates applies a predicate to check if query has an edge templates. +func (f *OrganizationFilter) WhereHasTemplates() { + f.Where(entql.HasEdge("templates")) +} + +// WhereHasTemplatesWith applies a predicate to check if query has an edge templates with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasTemplatesWith(preds ...predicate.Template) { + f.Where(entql.HasEdgeWith("templates", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasIntegrations applies a predicate to check if query has an edge integrations. +func (f *OrganizationFilter) WhereHasIntegrations() { + f.Where(entql.HasEdge("integrations")) +} + +// WhereHasIntegrationsWith applies a predicate to check if query has an edge integrations with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasIntegrationsWith(preds ...predicate.Integration) { + f.Where(entql.HasEdgeWith("integrations", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasSetting applies a predicate to check if query has an edge setting. +func (f *OrganizationFilter) WhereHasSetting() { + f.Where(entql.HasEdge("setting")) +} + +// WhereHasSettingWith applies a predicate to check if query has an edge setting with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasSettingWith(preds ...predicate.OrganizationSetting) { + f.Where(entql.HasEdgeWith("setting", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasDocumentdata applies a predicate to check if query has an edge documentdata. +func (f *OrganizationFilter) WhereHasDocumentdata() { + f.Where(entql.HasEdge("documentdata")) +} + +// WhereHasDocumentdataWith applies a predicate to check if query has an edge documentdata with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasDocumentdataWith(preds ...predicate.DocumentData) { + f.Where(entql.HasEdgeWith("documentdata", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitlements applies a predicate to check if query has an edge entitlements. +func (f *OrganizationFilter) WhereHasEntitlements() { + f.Where(entql.HasEdge("entitlements")) +} + +// WhereHasEntitlementsWith applies a predicate to check if query has an edge entitlements with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasEntitlementsWith(preds ...predicate.Entitlement) { + f.Where(entql.HasEdgeWith("entitlements", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrganizationEntitlement applies a predicate to check if query has an edge organization_entitlement. +func (f *OrganizationFilter) WhereHasOrganizationEntitlement() { + f.Where(entql.HasEdge("organization_entitlement")) +} + +// WhereHasOrganizationEntitlementWith applies a predicate to check if query has an edge organization_entitlement with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasOrganizationEntitlementWith(preds ...predicate.Entitlement) { + f.Where(entql.HasEdgeWith("organization_entitlement", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasPersonalAccessTokens applies a predicate to check if query has an edge personal_access_tokens. +func (f *OrganizationFilter) WhereHasPersonalAccessTokens() { + f.Where(entql.HasEdge("personal_access_tokens")) +} + +// WhereHasPersonalAccessTokensWith applies a predicate to check if query has an edge personal_access_tokens with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasPersonalAccessTokensWith(preds ...predicate.PersonalAccessToken) { + f.Where(entql.HasEdgeWith("personal_access_tokens", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasAPITokens applies a predicate to check if query has an edge api_tokens. +func (f *OrganizationFilter) WhereHasAPITokens() { + f.Where(entql.HasEdge("api_tokens")) +} + +// WhereHasAPITokensWith applies a predicate to check if query has an edge api_tokens with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasAPITokensWith(preds ...predicate.APIToken) { + f.Where(entql.HasEdgeWith("api_tokens", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOauthprovider applies a predicate to check if query has an edge oauthprovider. +func (f *OrganizationFilter) WhereHasOauthprovider() { + f.Where(entql.HasEdge("oauthprovider")) +} + +// WhereHasOauthproviderWith applies a predicate to check if query has an edge oauthprovider with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasOauthproviderWith(preds ...predicate.OauthProvider) { + f.Where(entql.HasEdgeWith("oauthprovider", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasUsers applies a predicate to check if query has an edge users. +func (f *OrganizationFilter) WhereHasUsers() { + f.Where(entql.HasEdge("users")) +} + +// WhereHasUsersWith applies a predicate to check if query has an edge users with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasUsersWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("users", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasInvites applies a predicate to check if query has an edge invites. +func (f *OrganizationFilter) WhereHasInvites() { + f.Where(entql.HasEdge("invites")) +} + +// WhereHasInvitesWith applies a predicate to check if query has an edge invites with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasInvitesWith(preds ...predicate.Invite) { + f.Where(entql.HasEdgeWith("invites", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasSubscribers applies a predicate to check if query has an edge subscribers. +func (f *OrganizationFilter) WhereHasSubscribers() { + f.Where(entql.HasEdge("subscribers")) +} + +// WhereHasSubscribersWith applies a predicate to check if query has an edge subscribers with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasSubscribersWith(preds ...predicate.Subscriber) { + f.Where(entql.HasEdgeWith("subscribers", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasWebhooks applies a predicate to check if query has an edge webhooks. +func (f *OrganizationFilter) WhereHasWebhooks() { + f.Where(entql.HasEdge("webhooks")) +} + +// WhereHasWebhooksWith applies a predicate to check if query has an edge webhooks with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasWebhooksWith(preds ...predicate.Webhook) { + f.Where(entql.HasEdgeWith("webhooks", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *OrganizationFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasSecrets applies a predicate to check if query has an edge secrets. +func (f *OrganizationFilter) WhereHasSecrets() { + f.Where(entql.HasEdge("secrets")) +} + +// WhereHasSecretsWith applies a predicate to check if query has an edge secrets with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasSecretsWith(preds ...predicate.Hush) { + f.Where(entql.HasEdgeWith("secrets", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFeatures applies a predicate to check if query has an edge features. +func (f *OrganizationFilter) WhereHasFeatures() { + f.Where(entql.HasEdge("features")) +} + +// WhereHasFeaturesWith applies a predicate to check if query has an edge features with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasFeaturesWith(preds ...predicate.Feature) { + f.Where(entql.HasEdgeWith("features", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFiles applies a predicate to check if query has an edge files. +func (f *OrganizationFilter) WhereHasFiles() { + f.Where(entql.HasEdge("files")) +} + +// WhereHasFilesWith applies a predicate to check if query has an edge files with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasFilesWith(preds ...predicate.File) { + f.Where(entql.HasEdgeWith("files", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitlementplans applies a predicate to check if query has an edge entitlementplans. +func (f *OrganizationFilter) WhereHasEntitlementplans() { + f.Where(entql.HasEdge("entitlementplans")) +} + +// WhereHasEntitlementplansWith applies a predicate to check if query has an edge entitlementplans with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasEntitlementplansWith(preds ...predicate.EntitlementPlan) { + f.Where(entql.HasEdgeWith("entitlementplans", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitlementplanfeatures applies a predicate to check if query has an edge entitlementplanfeatures. +func (f *OrganizationFilter) WhereHasEntitlementplanfeatures() { + f.Where(entql.HasEdge("entitlementplanfeatures")) +} + +// WhereHasEntitlementplanfeaturesWith applies a predicate to check if query has an edge entitlementplanfeatures with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasEntitlementplanfeaturesWith(preds ...predicate.EntitlementPlanFeature) { + f.Where(entql.HasEdgeWith("entitlementplanfeatures", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntities applies a predicate to check if query has an edge entities. +func (f *OrganizationFilter) WhereHasEntities() { + f.Where(entql.HasEdge("entities")) +} + +// WhereHasEntitiesWith applies a predicate to check if query has an edge entities with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasEntitiesWith(preds ...predicate.Entity) { + f.Where(entql.HasEdgeWith("entities", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEntitytypes applies a predicate to check if query has an edge entitytypes. +func (f *OrganizationFilter) WhereHasEntitytypes() { + f.Where(entql.HasEdge("entitytypes")) +} + +// WhereHasEntitytypesWith applies a predicate to check if query has an edge entitytypes with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasEntitytypesWith(preds ...predicate.EntityType) { + f.Where(entql.HasEdgeWith("entitytypes", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasContacts applies a predicate to check if query has an edge contacts. +func (f *OrganizationFilter) WhereHasContacts() { + f.Where(entql.HasEdge("contacts")) +} + +// WhereHasContactsWith applies a predicate to check if query has an edge contacts with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasContactsWith(preds ...predicate.Contact) { + f.Where(entql.HasEdgeWith("contacts", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasNotes applies a predicate to check if query has an edge notes. +func (f *OrganizationFilter) WhereHasNotes() { + f.Where(entql.HasEdge("notes")) +} + +// WhereHasNotesWith applies a predicate to check if query has an edge notes with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasNotesWith(preds ...predicate.Note) { + f.Where(entql.HasEdgeWith("notes", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasMembers applies a predicate to check if query has an edge members. +func (f *OrganizationFilter) WhereHasMembers() { + f.Where(entql.HasEdge("members")) +} + +// WhereHasMembersWith applies a predicate to check if query has an edge members with a given conditions (other predicates). +func (f *OrganizationFilter) WhereHasMembersWith(preds ...predicate.OrgMembership) { + f.Where(entql.HasEdgeWith("members", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ohq *OrganizationHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ohq.predicates = append(ohq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OrganizationHistoryQuery builder. +func (ohq *OrganizationHistoryQuery) Filter() *OrganizationHistoryFilter { + return &OrganizationHistoryFilter{config: ohq.config, predicateAdder: ohq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OrganizationHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OrganizationHistoryMutation builder. +func (m *OrganizationHistoryMutation) Filter() *OrganizationHistoryFilter { + return &OrganizationHistoryFilter{config: m.config, predicateAdder: m} +} + +// OrganizationHistoryFilter provides a generic filtering capability at runtime for OrganizationHistoryQuery. +type OrganizationHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OrganizationHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[41].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OrganizationHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *OrganizationHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(organizationhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *OrganizationHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *OrganizationHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OrganizationHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(organizationhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OrganizationHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(organizationhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OrganizationHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OrganizationHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OrganizationHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *OrganizationHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(organizationhistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OrganizationHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(organizationhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OrganizationHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldDeletedBy)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *OrganizationHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *OrganizationHistoryFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldDisplayName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *OrganizationHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldDescription)) +} + +// WhereParentOrganizationID applies the entql string predicate on the parent_organization_id field. +func (f *OrganizationHistoryFilter) WhereParentOrganizationID(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldParentOrganizationID)) +} + +// WherePersonalOrg applies the entql bool predicate on the personal_org field. +func (f *OrganizationHistoryFilter) WherePersonalOrg(p entql.BoolP) { + f.Where(p.Field(organizationhistory.FieldPersonalOrg)) +} + +// WhereAvatarRemoteURL applies the entql string predicate on the avatar_remote_url field. +func (f *OrganizationHistoryFilter) WhereAvatarRemoteURL(p entql.StringP) { + f.Where(p.Field(organizationhistory.FieldAvatarRemoteURL)) +} + +// WhereDedicatedDb applies the entql bool predicate on the dedicated_db field. +func (f *OrganizationHistoryFilter) WhereDedicatedDb(p entql.BoolP) { + f.Where(p.Field(organizationhistory.FieldDedicatedDb)) +} + +// addPredicate implements the predicateAdder interface. +func (osq *OrganizationSettingQuery) addPredicate(pred func(s *sql.Selector)) { + osq.predicates = append(osq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OrganizationSettingQuery builder. +func (osq *OrganizationSettingQuery) Filter() *OrganizationSettingFilter { + return &OrganizationSettingFilter{config: osq.config, predicateAdder: osq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OrganizationSettingMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OrganizationSettingMutation builder. +func (m *OrganizationSettingMutation) Filter() *OrganizationSettingFilter { + return &OrganizationSettingFilter{config: m.config, predicateAdder: m} +} + +// OrganizationSettingFilter provides a generic filtering capability at runtime for OrganizationSettingQuery. +type OrganizationSettingFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OrganizationSettingFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[42].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OrganizationSettingFilter) WhereID(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OrganizationSettingFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(organizationsetting.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OrganizationSettingFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(organizationsetting.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OrganizationSettingFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OrganizationSettingFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OrganizationSettingFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *OrganizationSettingFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(organizationsetting.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OrganizationSettingFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(organizationsetting.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OrganizationSettingFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldDeletedBy)) +} + +// WhereDomains applies the entql json.RawMessage predicate on the domains field. +func (f *OrganizationSettingFilter) WhereDomains(p entql.BytesP) { + f.Where(p.Field(organizationsetting.FieldDomains)) +} + +// WhereBillingContact applies the entql string predicate on the billing_contact field. +func (f *OrganizationSettingFilter) WhereBillingContact(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldBillingContact)) +} + +// WhereBillingEmail applies the entql string predicate on the billing_email field. +func (f *OrganizationSettingFilter) WhereBillingEmail(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldBillingEmail)) +} + +// WhereBillingPhone applies the entql string predicate on the billing_phone field. +func (f *OrganizationSettingFilter) WhereBillingPhone(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldBillingPhone)) +} + +// WhereBillingAddress applies the entql string predicate on the billing_address field. +func (f *OrganizationSettingFilter) WhereBillingAddress(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldBillingAddress)) +} + +// WhereTaxIdentifier applies the entql string predicate on the tax_identifier field. +func (f *OrganizationSettingFilter) WhereTaxIdentifier(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldTaxIdentifier)) +} + +// WhereGeoLocation applies the entql string predicate on the geo_location field. +func (f *OrganizationSettingFilter) WhereGeoLocation(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldGeoLocation)) +} + +// WhereOrganizationID applies the entql string predicate on the organization_id field. +func (f *OrganizationSettingFilter) WhereOrganizationID(p entql.StringP) { + f.Where(p.Field(organizationsetting.FieldOrganizationID)) +} + +// WhereHasOrganization applies a predicate to check if query has an edge organization. +func (f *OrganizationSettingFilter) WhereHasOrganization() { + f.Where(entql.HasEdge("organization")) +} + +// WhereHasOrganizationWith applies a predicate to check if query has an edge organization with a given conditions (other predicates). +func (f *OrganizationSettingFilter) WhereHasOrganizationWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organization", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (oshq *OrganizationSettingHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + oshq.predicates = append(oshq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the OrganizationSettingHistoryQuery builder. +func (oshq *OrganizationSettingHistoryQuery) Filter() *OrganizationSettingHistoryFilter { + return &OrganizationSettingHistoryFilter{config: oshq.config, predicateAdder: oshq} +} + +// addPredicate implements the predicateAdder interface. +func (m *OrganizationSettingHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the OrganizationSettingHistoryMutation builder. +func (m *OrganizationSettingHistoryMutation) Filter() *OrganizationSettingHistoryFilter { + return &OrganizationSettingHistoryFilter{config: m.config, predicateAdder: m} +} + +// OrganizationSettingHistoryFilter provides a generic filtering capability at runtime for OrganizationSettingHistoryQuery. +type OrganizationSettingHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *OrganizationSettingHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[43].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *OrganizationSettingHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *OrganizationSettingHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(organizationsettinghistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *OrganizationSettingHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *OrganizationSettingHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *OrganizationSettingHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(organizationsettinghistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *OrganizationSettingHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(organizationsettinghistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *OrganizationSettingHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *OrganizationSettingHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *OrganizationSettingHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *OrganizationSettingHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(organizationsettinghistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *OrganizationSettingHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(organizationsettinghistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *OrganizationSettingHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldDeletedBy)) +} + +// WhereDomains applies the entql json.RawMessage predicate on the domains field. +func (f *OrganizationSettingHistoryFilter) WhereDomains(p entql.BytesP) { + f.Where(p.Field(organizationsettinghistory.FieldDomains)) +} + +// WhereBillingContact applies the entql string predicate on the billing_contact field. +func (f *OrganizationSettingHistoryFilter) WhereBillingContact(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldBillingContact)) +} + +// WhereBillingEmail applies the entql string predicate on the billing_email field. +func (f *OrganizationSettingHistoryFilter) WhereBillingEmail(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldBillingEmail)) +} + +// WhereBillingPhone applies the entql string predicate on the billing_phone field. +func (f *OrganizationSettingHistoryFilter) WhereBillingPhone(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldBillingPhone)) +} + +// WhereBillingAddress applies the entql string predicate on the billing_address field. +func (f *OrganizationSettingHistoryFilter) WhereBillingAddress(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldBillingAddress)) +} + +// WhereTaxIdentifier applies the entql string predicate on the tax_identifier field. +func (f *OrganizationSettingHistoryFilter) WhereTaxIdentifier(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldTaxIdentifier)) +} + +// WhereGeoLocation applies the entql string predicate on the geo_location field. +func (f *OrganizationSettingHistoryFilter) WhereGeoLocation(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldGeoLocation)) +} + +// WhereOrganizationID applies the entql string predicate on the organization_id field. +func (f *OrganizationSettingHistoryFilter) WhereOrganizationID(p entql.StringP) { + f.Where(p.Field(organizationsettinghistory.FieldOrganizationID)) +} + +// addPredicate implements the predicateAdder interface. +func (prtq *PasswordResetTokenQuery) addPredicate(pred func(s *sql.Selector)) { + prtq.predicates = append(prtq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the PasswordResetTokenQuery builder. +func (prtq *PasswordResetTokenQuery) Filter() *PasswordResetTokenFilter { + return &PasswordResetTokenFilter{config: prtq.config, predicateAdder: prtq} +} + +// addPredicate implements the predicateAdder interface. +func (m *PasswordResetTokenMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the PasswordResetTokenMutation builder. +func (m *PasswordResetTokenMutation) Filter() *PasswordResetTokenFilter { + return &PasswordResetTokenFilter{config: m.config, predicateAdder: m} +} + +// PasswordResetTokenFilter provides a generic filtering capability at runtime for PasswordResetTokenQuery. +type PasswordResetTokenFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *PasswordResetTokenFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[44].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *PasswordResetTokenFilter) WhereID(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *PasswordResetTokenFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(passwordresettoken.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *PasswordResetTokenFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(passwordresettoken.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *PasswordResetTokenFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *PasswordResetTokenFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *PasswordResetTokenFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *PasswordResetTokenFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(passwordresettoken.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *PasswordResetTokenFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *PasswordResetTokenFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldOwnerID)) +} + +// WhereToken applies the entql string predicate on the token field. +func (f *PasswordResetTokenFilter) WhereToken(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldToken)) +} + +// WhereTTL applies the entql time.Time predicate on the ttl field. +func (f *PasswordResetTokenFilter) WhereTTL(p entql.TimeP) { + f.Where(p.Field(passwordresettoken.FieldTTL)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *PasswordResetTokenFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(passwordresettoken.FieldEmail)) +} + +// WhereSecret applies the entql []byte predicate on the secret field. +func (f *PasswordResetTokenFilter) WhereSecret(p entql.BytesP) { + f.Where(p.Field(passwordresettoken.FieldSecret)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *PasswordResetTokenFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *PasswordResetTokenFilter) WhereHasOwnerWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (patq *PersonalAccessTokenQuery) addPredicate(pred func(s *sql.Selector)) { + patq.predicates = append(patq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the PersonalAccessTokenQuery builder. +func (patq *PersonalAccessTokenQuery) Filter() *PersonalAccessTokenFilter { + return &PersonalAccessTokenFilter{config: patq.config, predicateAdder: patq} +} + +// addPredicate implements the predicateAdder interface. +func (m *PersonalAccessTokenMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the PersonalAccessTokenMutation builder. +func (m *PersonalAccessTokenMutation) Filter() *PersonalAccessTokenFilter { + return &PersonalAccessTokenFilter{config: m.config, predicateAdder: m} +} + +// PersonalAccessTokenFilter provides a generic filtering capability at runtime for PersonalAccessTokenQuery. +type PersonalAccessTokenFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *PersonalAccessTokenFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[45].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *PersonalAccessTokenFilter) WhereID(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *PersonalAccessTokenFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(personalaccesstoken.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *PersonalAccessTokenFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(personalaccesstoken.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *PersonalAccessTokenFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *PersonalAccessTokenFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *PersonalAccessTokenFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(personalaccesstoken.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *PersonalAccessTokenFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *PersonalAccessTokenFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *PersonalAccessTokenFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(personalaccesstoken.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *PersonalAccessTokenFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *PersonalAccessTokenFilter) WhereName(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldName)) +} + +// WhereToken applies the entql string predicate on the token field. +func (f *PersonalAccessTokenFilter) WhereToken(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldToken)) +} + +// WhereExpiresAt applies the entql time.Time predicate on the expires_at field. +func (f *PersonalAccessTokenFilter) WhereExpiresAt(p entql.TimeP) { + f.Where(p.Field(personalaccesstoken.FieldExpiresAt)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *PersonalAccessTokenFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(personalaccesstoken.FieldDescription)) +} + +// WhereScopes applies the entql json.RawMessage predicate on the scopes field. +func (f *PersonalAccessTokenFilter) WhereScopes(p entql.BytesP) { + f.Where(p.Field(personalaccesstoken.FieldScopes)) +} + +// WhereLastUsedAt applies the entql time.Time predicate on the last_used_at field. +func (f *PersonalAccessTokenFilter) WhereLastUsedAt(p entql.TimeP) { + f.Where(p.Field(personalaccesstoken.FieldLastUsedAt)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *PersonalAccessTokenFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *PersonalAccessTokenFilter) WhereHasOwnerWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrganizations applies a predicate to check if query has an edge organizations. +func (f *PersonalAccessTokenFilter) WhereHasOrganizations() { + f.Where(entql.HasEdge("organizations")) +} + +// WhereHasOrganizationsWith applies a predicate to check if query has an edge organizations with a given conditions (other predicates). +func (f *PersonalAccessTokenFilter) WhereHasOrganizationsWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organizations", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *PersonalAccessTokenFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *PersonalAccessTokenFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (sq *SubscriberQuery) addPredicate(pred func(s *sql.Selector)) { + sq.predicates = append(sq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the SubscriberQuery builder. +func (sq *SubscriberQuery) Filter() *SubscriberFilter { + return &SubscriberFilter{config: sq.config, predicateAdder: sq} +} + +// addPredicate implements the predicateAdder interface. +func (m *SubscriberMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the SubscriberMutation builder. +func (m *SubscriberMutation) Filter() *SubscriberFilter { + return &SubscriberFilter{config: m.config, predicateAdder: m} +} + +// SubscriberFilter provides a generic filtering capability at runtime for SubscriberQuery. +type SubscriberFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *SubscriberFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[46].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *SubscriberFilter) WhereID(p entql.StringP) { + f.Where(p.Field(subscriber.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *SubscriberFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(subscriber.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *SubscriberFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(subscriber.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *SubscriberFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(subscriber.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *SubscriberFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(subscriber.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *SubscriberFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(subscriber.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *SubscriberFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(subscriber.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *SubscriberFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(subscriber.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *SubscriberFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(subscriber.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *SubscriberFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(subscriber.FieldOwnerID)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *SubscriberFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(subscriber.FieldEmail)) +} + +// WherePhoneNumber applies the entql string predicate on the phone_number field. +func (f *SubscriberFilter) WherePhoneNumber(p entql.StringP) { + f.Where(p.Field(subscriber.FieldPhoneNumber)) +} + +// WhereVerifiedEmail applies the entql bool predicate on the verified_email field. +func (f *SubscriberFilter) WhereVerifiedEmail(p entql.BoolP) { + f.Where(p.Field(subscriber.FieldVerifiedEmail)) +} + +// WhereVerifiedPhone applies the entql bool predicate on the verified_phone field. +func (f *SubscriberFilter) WhereVerifiedPhone(p entql.BoolP) { + f.Where(p.Field(subscriber.FieldVerifiedPhone)) +} + +// WhereActive applies the entql bool predicate on the active field. +func (f *SubscriberFilter) WhereActive(p entql.BoolP) { + f.Where(p.Field(subscriber.FieldActive)) +} + +// WhereToken applies the entql string predicate on the token field. +func (f *SubscriberFilter) WhereToken(p entql.StringP) { + f.Where(p.Field(subscriber.FieldToken)) +} + +// WhereTTL applies the entql time.Time predicate on the ttl field. +func (f *SubscriberFilter) WhereTTL(p entql.TimeP) { + f.Where(p.Field(subscriber.FieldTTL)) +} + +// WhereSecret applies the entql []byte predicate on the secret field. +func (f *SubscriberFilter) WhereSecret(p entql.BytesP) { + f.Where(p.Field(subscriber.FieldSecret)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *SubscriberFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *SubscriberFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *SubscriberFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *SubscriberFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (tsq *TFASettingQuery) addPredicate(pred func(s *sql.Selector)) { + tsq.predicates = append(tsq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the TFASettingQuery builder. +func (tsq *TFASettingQuery) Filter() *TFASettingFilter { + return &TFASettingFilter{config: tsq.config, predicateAdder: tsq} +} + +// addPredicate implements the predicateAdder interface. +func (m *TFASettingMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the TFASettingMutation builder. +func (m *TFASettingMutation) Filter() *TFASettingFilter { + return &TFASettingFilter{config: m.config, predicateAdder: m} +} + +// TFASettingFilter provides a generic filtering capability at runtime for TFASettingQuery. +type TFASettingFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *TFASettingFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[47].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *TFASettingFilter) WhereID(p entql.StringP) { + f.Where(p.Field(tfasetting.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *TFASettingFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(tfasetting.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *TFASettingFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(tfasetting.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *TFASettingFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(tfasetting.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *TFASettingFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(tfasetting.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *TFASettingFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(tfasetting.FieldMappingID)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *TFASettingFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(tfasetting.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *TFASettingFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(tfasetting.FieldDeletedBy)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *TFASettingFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(tfasetting.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *TFASettingFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(tfasetting.FieldOwnerID)) +} + +// WhereTfaSecret applies the entql string predicate on the tfa_secret field. +func (f *TFASettingFilter) WhereTfaSecret(p entql.StringP) { + f.Where(p.Field(tfasetting.FieldTfaSecret)) +} + +// WhereVerified applies the entql bool predicate on the verified field. +func (f *TFASettingFilter) WhereVerified(p entql.BoolP) { + f.Where(p.Field(tfasetting.FieldVerified)) +} + +// WhereRecoveryCodes applies the entql json.RawMessage predicate on the recovery_codes field. +func (f *TFASettingFilter) WhereRecoveryCodes(p entql.BytesP) { + f.Where(p.Field(tfasetting.FieldRecoveryCodes)) +} + +// WherePhoneOtpAllowed applies the entql bool predicate on the phone_otp_allowed field. +func (f *TFASettingFilter) WherePhoneOtpAllowed(p entql.BoolP) { + f.Where(p.Field(tfasetting.FieldPhoneOtpAllowed)) +} + +// WhereEmailOtpAllowed applies the entql bool predicate on the email_otp_allowed field. +func (f *TFASettingFilter) WhereEmailOtpAllowed(p entql.BoolP) { + f.Where(p.Field(tfasetting.FieldEmailOtpAllowed)) +} + +// WhereTotpAllowed applies the entql bool predicate on the totp_allowed field. +func (f *TFASettingFilter) WhereTotpAllowed(p entql.BoolP) { + f.Where(p.Field(tfasetting.FieldTotpAllowed)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *TFASettingFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *TFASettingFilter) WhereHasOwnerWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (tq *TemplateQuery) addPredicate(pred func(s *sql.Selector)) { + tq.predicates = append(tq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the TemplateQuery builder. +func (tq *TemplateQuery) Filter() *TemplateFilter { + return &TemplateFilter{config: tq.config, predicateAdder: tq} +} + +// addPredicate implements the predicateAdder interface. +func (m *TemplateMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the TemplateMutation builder. +func (m *TemplateMutation) Filter() *TemplateFilter { + return &TemplateFilter{config: m.config, predicateAdder: m} +} + +// TemplateFilter provides a generic filtering capability at runtime for TemplateQuery. +type TemplateFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *TemplateFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[48].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *TemplateFilter) WhereID(p entql.StringP) { + f.Where(p.Field(template.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *TemplateFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(template.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *TemplateFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(template.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *TemplateFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(template.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *TemplateFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(template.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *TemplateFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(template.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *TemplateFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(template.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *TemplateFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(template.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *TemplateFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(template.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *TemplateFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(template.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *TemplateFilter) WhereName(p entql.StringP) { + f.Where(p.Field(template.FieldName)) +} + +// WhereTemplateType applies the entql string predicate on the template_type field. +func (f *TemplateFilter) WhereTemplateType(p entql.StringP) { + f.Where(p.Field(template.FieldTemplateType)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *TemplateFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(template.FieldDescription)) +} + +// WhereJsonconfig applies the entql json.RawMessage predicate on the jsonconfig field. +func (f *TemplateFilter) WhereJsonconfig(p entql.BytesP) { + f.Where(p.Field(template.FieldJsonconfig)) +} + +// WhereUischema applies the entql json.RawMessage predicate on the uischema field. +func (f *TemplateFilter) WhereUischema(p entql.BytesP) { + f.Where(p.Field(template.FieldUischema)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *TemplateFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *TemplateFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasDocuments applies a predicate to check if query has an edge documents. +func (f *TemplateFilter) WhereHasDocuments() { + f.Where(entql.HasEdge("documents")) +} + +// WhereHasDocumentsWith applies a predicate to check if query has an edge documents with a given conditions (other predicates). +func (f *TemplateFilter) WhereHasDocumentsWith(preds ...predicate.DocumentData) { + f.Where(entql.HasEdgeWith("documents", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (thq *TemplateHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + thq.predicates = append(thq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the TemplateHistoryQuery builder. +func (thq *TemplateHistoryQuery) Filter() *TemplateHistoryFilter { + return &TemplateHistoryFilter{config: thq.config, predicateAdder: thq} +} + +// addPredicate implements the predicateAdder interface. +func (m *TemplateHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the TemplateHistoryMutation builder. +func (m *TemplateHistoryMutation) Filter() *TemplateHistoryFilter { + return &TemplateHistoryFilter{config: m.config, predicateAdder: m} +} + +// TemplateHistoryFilter provides a generic filtering capability at runtime for TemplateHistoryQuery. +type TemplateHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *TemplateHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[49].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *TemplateHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *TemplateHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(templatehistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *TemplateHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *TemplateHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *TemplateHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(templatehistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *TemplateHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(templatehistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *TemplateHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *TemplateHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *TemplateHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(templatehistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *TemplateHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *TemplateHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *TemplateHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(templatehistory.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *TemplateHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *TemplateHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldName)) +} + +// WhereTemplateType applies the entql string predicate on the template_type field. +func (f *TemplateHistoryFilter) WhereTemplateType(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldTemplateType)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *TemplateHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(templatehistory.FieldDescription)) +} + +// WhereJsonconfig applies the entql json.RawMessage predicate on the jsonconfig field. +func (f *TemplateHistoryFilter) WhereJsonconfig(p entql.BytesP) { + f.Where(p.Field(templatehistory.FieldJsonconfig)) +} + +// WhereUischema applies the entql json.RawMessage predicate on the uischema field. +func (f *TemplateHistoryFilter) WhereUischema(p entql.BytesP) { + f.Where(p.Field(templatehistory.FieldUischema)) +} + +// addPredicate implements the predicateAdder interface. +func (uq *UserQuery) addPredicate(pred func(s *sql.Selector)) { + uq.predicates = append(uq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the UserQuery builder. +func (uq *UserQuery) Filter() *UserFilter { + return &UserFilter{config: uq.config, predicateAdder: uq} +} + +// addPredicate implements the predicateAdder interface. +func (m *UserMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the UserMutation builder. +func (m *UserMutation) Filter() *UserFilter { + return &UserFilter{config: m.config, predicateAdder: m} +} + +// UserFilter provides a generic filtering capability at runtime for UserQuery. +type UserFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *UserFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[50].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *UserFilter) WhereID(p entql.StringP) { + f.Where(p.Field(user.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *UserFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(user.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *UserFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(user.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *UserFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(user.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *UserFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(user.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *UserFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(user.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *UserFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(user.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *UserFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(user.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *UserFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(user.FieldTags)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *UserFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(user.FieldEmail)) +} + +// WhereFirstName applies the entql string predicate on the first_name field. +func (f *UserFilter) WhereFirstName(p entql.StringP) { + f.Where(p.Field(user.FieldFirstName)) +} + +// WhereLastName applies the entql string predicate on the last_name field. +func (f *UserFilter) WhereLastName(p entql.StringP) { + f.Where(p.Field(user.FieldLastName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *UserFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(user.FieldDisplayName)) +} + +// WhereAvatarRemoteURL applies the entql string predicate on the avatar_remote_url field. +func (f *UserFilter) WhereAvatarRemoteURL(p entql.StringP) { + f.Where(p.Field(user.FieldAvatarRemoteURL)) +} + +// WhereAvatarLocalFile applies the entql string predicate on the avatar_local_file field. +func (f *UserFilter) WhereAvatarLocalFile(p entql.StringP) { + f.Where(p.Field(user.FieldAvatarLocalFile)) +} + +// WhereAvatarUpdatedAt applies the entql time.Time predicate on the avatar_updated_at field. +func (f *UserFilter) WhereAvatarUpdatedAt(p entql.TimeP) { + f.Where(p.Field(user.FieldAvatarUpdatedAt)) +} + +// WhereLastSeen applies the entql time.Time predicate on the last_seen field. +func (f *UserFilter) WhereLastSeen(p entql.TimeP) { + f.Where(p.Field(user.FieldLastSeen)) +} + +// WherePassword applies the entql string predicate on the password field. +func (f *UserFilter) WherePassword(p entql.StringP) { + f.Where(p.Field(user.FieldPassword)) +} + +// WhereSub applies the entql string predicate on the sub field. +func (f *UserFilter) WhereSub(p entql.StringP) { + f.Where(p.Field(user.FieldSub)) +} + +// WhereAuthProvider applies the entql string predicate on the auth_provider field. +func (f *UserFilter) WhereAuthProvider(p entql.StringP) { + f.Where(p.Field(user.FieldAuthProvider)) +} + +// WhereRole applies the entql string predicate on the role field. +func (f *UserFilter) WhereRole(p entql.StringP) { + f.Where(p.Field(user.FieldRole)) +} + +// WhereHasPersonalAccessTokens applies a predicate to check if query has an edge personal_access_tokens. +func (f *UserFilter) WhereHasPersonalAccessTokens() { + f.Where(entql.HasEdge("personal_access_tokens")) +} + +// WhereHasPersonalAccessTokensWith applies a predicate to check if query has an edge personal_access_tokens with a given conditions (other predicates). +func (f *UserFilter) WhereHasPersonalAccessTokensWith(preds ...predicate.PersonalAccessToken) { + f.Where(entql.HasEdgeWith("personal_access_tokens", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasTfaSettings applies a predicate to check if query has an edge tfa_settings. +func (f *UserFilter) WhereHasTfaSettings() { + f.Where(entql.HasEdge("tfa_settings")) +} + +// WhereHasTfaSettingsWith applies a predicate to check if query has an edge tfa_settings with a given conditions (other predicates). +func (f *UserFilter) WhereHasTfaSettingsWith(preds ...predicate.TFASetting) { + f.Where(entql.HasEdgeWith("tfa_settings", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasSetting applies a predicate to check if query has an edge setting. +func (f *UserFilter) WhereHasSetting() { + f.Where(entql.HasEdge("setting")) +} + +// WhereHasSettingWith applies a predicate to check if query has an edge setting with a given conditions (other predicates). +func (f *UserFilter) WhereHasSettingWith(preds ...predicate.UserSetting) { + f.Where(entql.HasEdgeWith("setting", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEmailVerificationTokens applies a predicate to check if query has an edge email_verification_tokens. +func (f *UserFilter) WhereHasEmailVerificationTokens() { + f.Where(entql.HasEdge("email_verification_tokens")) +} + +// WhereHasEmailVerificationTokensWith applies a predicate to check if query has an edge email_verification_tokens with a given conditions (other predicates). +func (f *UserFilter) WhereHasEmailVerificationTokensWith(preds ...predicate.EmailVerificationToken) { + f.Where(entql.HasEdgeWith("email_verification_tokens", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasPasswordResetTokens applies a predicate to check if query has an edge password_reset_tokens. +func (f *UserFilter) WhereHasPasswordResetTokens() { + f.Where(entql.HasEdge("password_reset_tokens")) +} + +// WhereHasPasswordResetTokensWith applies a predicate to check if query has an edge password_reset_tokens with a given conditions (other predicates). +func (f *UserFilter) WhereHasPasswordResetTokensWith(preds ...predicate.PasswordResetToken) { + f.Where(entql.HasEdgeWith("password_reset_tokens", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasGroups applies a predicate to check if query has an edge groups. +func (f *UserFilter) WhereHasGroups() { + f.Where(entql.HasEdge("groups")) +} + +// WhereHasGroupsWith applies a predicate to check if query has an edge groups with a given conditions (other predicates). +func (f *UserFilter) WhereHasGroupsWith(preds ...predicate.Group) { + f.Where(entql.HasEdgeWith("groups", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrganizations applies a predicate to check if query has an edge organizations. +func (f *UserFilter) WhereHasOrganizations() { + f.Where(entql.HasEdge("organizations")) +} + +// WhereHasOrganizationsWith applies a predicate to check if query has an edge organizations with a given conditions (other predicates). +func (f *UserFilter) WhereHasOrganizationsWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("organizations", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasWebauthn applies a predicate to check if query has an edge webauthn. +func (f *UserFilter) WhereHasWebauthn() { + f.Where(entql.HasEdge("webauthn")) +} + +// WhereHasWebauthnWith applies a predicate to check if query has an edge webauthn with a given conditions (other predicates). +func (f *UserFilter) WhereHasWebauthnWith(preds ...predicate.Webauthn) { + f.Where(entql.HasEdgeWith("webauthn", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasFiles applies a predicate to check if query has an edge files. +func (f *UserFilter) WhereHasFiles() { + f.Where(entql.HasEdge("files")) +} + +// WhereHasFilesWith applies a predicate to check if query has an edge files with a given conditions (other predicates). +func (f *UserFilter) WhereHasFilesWith(preds ...predicate.File) { + f.Where(entql.HasEdgeWith("files", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *UserFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *UserFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasGroupMemberships applies a predicate to check if query has an edge group_memberships. +func (f *UserFilter) WhereHasGroupMemberships() { + f.Where(entql.HasEdge("group_memberships")) +} + +// WhereHasGroupMembershipsWith applies a predicate to check if query has an edge group_memberships with a given conditions (other predicates). +func (f *UserFilter) WhereHasGroupMembershipsWith(preds ...predicate.GroupMembership) { + f.Where(entql.HasEdgeWith("group_memberships", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasOrgMemberships applies a predicate to check if query has an edge org_memberships. +func (f *UserFilter) WhereHasOrgMemberships() { + f.Where(entql.HasEdge("org_memberships")) +} + +// WhereHasOrgMembershipsWith applies a predicate to check if query has an edge org_memberships with a given conditions (other predicates). +func (f *UserFilter) WhereHasOrgMembershipsWith(preds ...predicate.OrgMembership) { + f.Where(entql.HasEdgeWith("org_memberships", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (uhq *UserHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + uhq.predicates = append(uhq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the UserHistoryQuery builder. +func (uhq *UserHistoryQuery) Filter() *UserHistoryFilter { + return &UserHistoryFilter{config: uhq.config, predicateAdder: uhq} +} + +// addPredicate implements the predicateAdder interface. +func (m *UserHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the UserHistoryMutation builder. +func (m *UserHistoryMutation) Filter() *UserHistoryFilter { + return &UserHistoryFilter{config: m.config, predicateAdder: m} +} + +// UserHistoryFilter provides a generic filtering capability at runtime for UserHistoryQuery. +type UserHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *UserHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[51].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *UserHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(userhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *UserHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(userhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *UserHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(userhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *UserHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(userhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *UserHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(userhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *UserHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(userhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *UserHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(userhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *UserHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(userhistory.FieldUpdatedBy)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *UserHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(userhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *UserHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(userhistory.FieldDeletedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *UserHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(userhistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *UserHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(userhistory.FieldTags)) +} + +// WhereEmail applies the entql string predicate on the email field. +func (f *UserHistoryFilter) WhereEmail(p entql.StringP) { + f.Where(p.Field(userhistory.FieldEmail)) +} + +// WhereFirstName applies the entql string predicate on the first_name field. +func (f *UserHistoryFilter) WhereFirstName(p entql.StringP) { + f.Where(p.Field(userhistory.FieldFirstName)) +} + +// WhereLastName applies the entql string predicate on the last_name field. +func (f *UserHistoryFilter) WhereLastName(p entql.StringP) { + f.Where(p.Field(userhistory.FieldLastName)) +} + +// WhereDisplayName applies the entql string predicate on the display_name field. +func (f *UserHistoryFilter) WhereDisplayName(p entql.StringP) { + f.Where(p.Field(userhistory.FieldDisplayName)) +} + +// WhereAvatarRemoteURL applies the entql string predicate on the avatar_remote_url field. +func (f *UserHistoryFilter) WhereAvatarRemoteURL(p entql.StringP) { + f.Where(p.Field(userhistory.FieldAvatarRemoteURL)) +} + +// WhereAvatarLocalFile applies the entql string predicate on the avatar_local_file field. +func (f *UserHistoryFilter) WhereAvatarLocalFile(p entql.StringP) { + f.Where(p.Field(userhistory.FieldAvatarLocalFile)) +} + +// WhereAvatarUpdatedAt applies the entql time.Time predicate on the avatar_updated_at field. +func (f *UserHistoryFilter) WhereAvatarUpdatedAt(p entql.TimeP) { + f.Where(p.Field(userhistory.FieldAvatarUpdatedAt)) +} + +// WhereLastSeen applies the entql time.Time predicate on the last_seen field. +func (f *UserHistoryFilter) WhereLastSeen(p entql.TimeP) { + f.Where(p.Field(userhistory.FieldLastSeen)) +} + +// WherePassword applies the entql string predicate on the password field. +func (f *UserHistoryFilter) WherePassword(p entql.StringP) { + f.Where(p.Field(userhistory.FieldPassword)) +} + +// WhereSub applies the entql string predicate on the sub field. +func (f *UserHistoryFilter) WhereSub(p entql.StringP) { + f.Where(p.Field(userhistory.FieldSub)) +} + +// WhereAuthProvider applies the entql string predicate on the auth_provider field. +func (f *UserHistoryFilter) WhereAuthProvider(p entql.StringP) { + f.Where(p.Field(userhistory.FieldAuthProvider)) +} + +// WhereRole applies the entql string predicate on the role field. +func (f *UserHistoryFilter) WhereRole(p entql.StringP) { + f.Where(p.Field(userhistory.FieldRole)) +} + +// addPredicate implements the predicateAdder interface. +func (usq *UserSettingQuery) addPredicate(pred func(s *sql.Selector)) { + usq.predicates = append(usq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the UserSettingQuery builder. +func (usq *UserSettingQuery) Filter() *UserSettingFilter { + return &UserSettingFilter{config: usq.config, predicateAdder: usq} +} + +// addPredicate implements the predicateAdder interface. +func (m *UserSettingMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the UserSettingMutation builder. +func (m *UserSettingMutation) Filter() *UserSettingFilter { + return &UserSettingFilter{config: m.config, predicateAdder: m} +} + +// UserSettingFilter provides a generic filtering capability at runtime for UserSettingQuery. +type UserSettingFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *UserSettingFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[52].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *UserSettingFilter) WhereID(p entql.StringP) { + f.Where(p.Field(usersetting.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *UserSettingFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(usersetting.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *UserSettingFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(usersetting.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *UserSettingFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(usersetting.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *UserSettingFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(usersetting.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *UserSettingFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(usersetting.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *UserSettingFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(usersetting.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *UserSettingFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(usersetting.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *UserSettingFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(usersetting.FieldDeletedBy)) +} + +// WhereUserID applies the entql string predicate on the user_id field. +func (f *UserSettingFilter) WhereUserID(p entql.StringP) { + f.Where(p.Field(usersetting.FieldUserID)) +} + +// WhereLocked applies the entql bool predicate on the locked field. +func (f *UserSettingFilter) WhereLocked(p entql.BoolP) { + f.Where(p.Field(usersetting.FieldLocked)) +} + +// WhereSilencedAt applies the entql time.Time predicate on the silenced_at field. +func (f *UserSettingFilter) WhereSilencedAt(p entql.TimeP) { + f.Where(p.Field(usersetting.FieldSilencedAt)) +} + +// WhereSuspendedAt applies the entql time.Time predicate on the suspended_at field. +func (f *UserSettingFilter) WhereSuspendedAt(p entql.TimeP) { + f.Where(p.Field(usersetting.FieldSuspendedAt)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *UserSettingFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(usersetting.FieldStatus)) +} + +// WhereEmailConfirmed applies the entql bool predicate on the email_confirmed field. +func (f *UserSettingFilter) WhereEmailConfirmed(p entql.BoolP) { + f.Where(p.Field(usersetting.FieldEmailConfirmed)) +} + +// WhereIsWebauthnAllowed applies the entql bool predicate on the is_webauthn_allowed field. +func (f *UserSettingFilter) WhereIsWebauthnAllowed(p entql.BoolP) { + f.Where(p.Field(usersetting.FieldIsWebauthnAllowed)) +} + +// WhereIsTfaEnabled applies the entql bool predicate on the is_tfa_enabled field. +func (f *UserSettingFilter) WhereIsTfaEnabled(p entql.BoolP) { + f.Where(p.Field(usersetting.FieldIsTfaEnabled)) +} + +// WherePhoneNumber applies the entql string predicate on the phone_number field. +func (f *UserSettingFilter) WherePhoneNumber(p entql.StringP) { + f.Where(p.Field(usersetting.FieldPhoneNumber)) +} + +// WhereHasUser applies a predicate to check if query has an edge user. +func (f *UserSettingFilter) WhereHasUser() { + f.Where(entql.HasEdge("user")) +} + +// WhereHasUserWith applies a predicate to check if query has an edge user with a given conditions (other predicates). +func (f *UserSettingFilter) WhereHasUserWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("user", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasDefaultOrg applies a predicate to check if query has an edge default_org. +func (f *UserSettingFilter) WhereHasDefaultOrg() { + f.Where(entql.HasEdge("default_org")) +} + +// WhereHasDefaultOrgWith applies a predicate to check if query has an edge default_org with a given conditions (other predicates). +func (f *UserSettingFilter) WhereHasDefaultOrgWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("default_org", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (ushq *UserSettingHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + ushq.predicates = append(ushq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the UserSettingHistoryQuery builder. +func (ushq *UserSettingHistoryQuery) Filter() *UserSettingHistoryFilter { + return &UserSettingHistoryFilter{config: ushq.config, predicateAdder: ushq} +} + +// addPredicate implements the predicateAdder interface. +func (m *UserSettingHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the UserSettingHistoryMutation builder. +func (m *UserSettingHistoryMutation) Filter() *UserSettingHistoryFilter { + return &UserSettingHistoryFilter{config: m.config, predicateAdder: m} +} + +// UserSettingHistoryFilter provides a generic filtering capability at runtime for UserSettingHistoryQuery. +type UserSettingHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *UserSettingHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[53].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *UserSettingHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *UserSettingHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(usersettinghistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *UserSettingHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *UserSettingHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *UserSettingHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(usersettinghistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *UserSettingHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(usersettinghistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *UserSettingHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *UserSettingHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *UserSettingHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *UserSettingHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(usersettinghistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *UserSettingHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(usersettinghistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *UserSettingHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldDeletedBy)) +} + +// WhereUserID applies the entql string predicate on the user_id field. +func (f *UserSettingHistoryFilter) WhereUserID(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldUserID)) +} + +// WhereLocked applies the entql bool predicate on the locked field. +func (f *UserSettingHistoryFilter) WhereLocked(p entql.BoolP) { + f.Where(p.Field(usersettinghistory.FieldLocked)) +} + +// WhereSilencedAt applies the entql time.Time predicate on the silenced_at field. +func (f *UserSettingHistoryFilter) WhereSilencedAt(p entql.TimeP) { + f.Where(p.Field(usersettinghistory.FieldSilencedAt)) +} + +// WhereSuspendedAt applies the entql time.Time predicate on the suspended_at field. +func (f *UserSettingHistoryFilter) WhereSuspendedAt(p entql.TimeP) { + f.Where(p.Field(usersettinghistory.FieldSuspendedAt)) +} + +// WhereStatus applies the entql string predicate on the status field. +func (f *UserSettingHistoryFilter) WhereStatus(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldStatus)) +} + +// WhereEmailConfirmed applies the entql bool predicate on the email_confirmed field. +func (f *UserSettingHistoryFilter) WhereEmailConfirmed(p entql.BoolP) { + f.Where(p.Field(usersettinghistory.FieldEmailConfirmed)) +} + +// WhereIsWebauthnAllowed applies the entql bool predicate on the is_webauthn_allowed field. +func (f *UserSettingHistoryFilter) WhereIsWebauthnAllowed(p entql.BoolP) { + f.Where(p.Field(usersettinghistory.FieldIsWebauthnAllowed)) +} + +// WhereIsTfaEnabled applies the entql bool predicate on the is_tfa_enabled field. +func (f *UserSettingHistoryFilter) WhereIsTfaEnabled(p entql.BoolP) { + f.Where(p.Field(usersettinghistory.FieldIsTfaEnabled)) +} + +// WherePhoneNumber applies the entql string predicate on the phone_number field. +func (f *UserSettingHistoryFilter) WherePhoneNumber(p entql.StringP) { + f.Where(p.Field(usersettinghistory.FieldPhoneNumber)) +} + +// addPredicate implements the predicateAdder interface. +func (wq *WebauthnQuery) addPredicate(pred func(s *sql.Selector)) { + wq.predicates = append(wq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the WebauthnQuery builder. +func (wq *WebauthnQuery) Filter() *WebauthnFilter { + return &WebauthnFilter{config: wq.config, predicateAdder: wq} +} + +// addPredicate implements the predicateAdder interface. +func (m *WebauthnMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the WebauthnMutation builder. +func (m *WebauthnMutation) Filter() *WebauthnFilter { + return &WebauthnFilter{config: m.config, predicateAdder: m} +} + +// WebauthnFilter provides a generic filtering capability at runtime for WebauthnQuery. +type WebauthnFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *WebauthnFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[54].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *WebauthnFilter) WhereID(p entql.StringP) { + f.Where(p.Field(webauthn.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *WebauthnFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(webauthn.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *WebauthnFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(webauthn.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *WebauthnFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(webauthn.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *WebauthnFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(webauthn.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *WebauthnFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(webauthn.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *WebauthnFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(webauthn.FieldTags)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *WebauthnFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(webauthn.FieldOwnerID)) +} + +// WhereCredentialID applies the entql []byte predicate on the credential_id field. +func (f *WebauthnFilter) WhereCredentialID(p entql.BytesP) { + f.Where(p.Field(webauthn.FieldCredentialID)) +} + +// WherePublicKey applies the entql []byte predicate on the public_key field. +func (f *WebauthnFilter) WherePublicKey(p entql.BytesP) { + f.Where(p.Field(webauthn.FieldPublicKey)) +} + +// WhereAttestationType applies the entql string predicate on the attestation_type field. +func (f *WebauthnFilter) WhereAttestationType(p entql.StringP) { + f.Where(p.Field(webauthn.FieldAttestationType)) +} + +// WhereAaguid applies the entql []byte predicate on the aaguid field. +func (f *WebauthnFilter) WhereAaguid(p entql.BytesP) { + f.Where(p.Field(webauthn.FieldAaguid)) +} + +// WhereSignCount applies the entql int32 predicate on the sign_count field. +func (f *WebauthnFilter) WhereSignCount(p entql.Int32P) { + f.Where(p.Field(webauthn.FieldSignCount)) +} + +// WhereTransports applies the entql json.RawMessage predicate on the transports field. +func (f *WebauthnFilter) WhereTransports(p entql.BytesP) { + f.Where(p.Field(webauthn.FieldTransports)) +} + +// WhereBackupEligible applies the entql bool predicate on the backup_eligible field. +func (f *WebauthnFilter) WhereBackupEligible(p entql.BoolP) { + f.Where(p.Field(webauthn.FieldBackupEligible)) +} + +// WhereBackupState applies the entql bool predicate on the backup_state field. +func (f *WebauthnFilter) WhereBackupState(p entql.BoolP) { + f.Where(p.Field(webauthn.FieldBackupState)) +} + +// WhereUserPresent applies the entql bool predicate on the user_present field. +func (f *WebauthnFilter) WhereUserPresent(p entql.BoolP) { + f.Where(p.Field(webauthn.FieldUserPresent)) +} + +// WhereUserVerified applies the entql bool predicate on the user_verified field. +func (f *WebauthnFilter) WhereUserVerified(p entql.BoolP) { + f.Where(p.Field(webauthn.FieldUserVerified)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *WebauthnFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *WebauthnFilter) WhereHasOwnerWith(preds ...predicate.User) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (wq *WebhookQuery) addPredicate(pred func(s *sql.Selector)) { + wq.predicates = append(wq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the WebhookQuery builder. +func (wq *WebhookQuery) Filter() *WebhookFilter { + return &WebhookFilter{config: wq.config, predicateAdder: wq} +} + +// addPredicate implements the predicateAdder interface. +func (m *WebhookMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the WebhookMutation builder. +func (m *WebhookMutation) Filter() *WebhookFilter { + return &WebhookFilter{config: m.config, predicateAdder: m} +} + +// WebhookFilter provides a generic filtering capability at runtime for WebhookQuery. +type WebhookFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *WebhookFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[55].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *WebhookFilter) WhereID(p entql.StringP) { + f.Where(p.Field(webhook.FieldID)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *WebhookFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(webhook.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *WebhookFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(webhook.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *WebhookFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(webhook.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *WebhookFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(webhook.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *WebhookFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(webhook.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *WebhookFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(webhook.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *WebhookFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(webhook.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *WebhookFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(webhook.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *WebhookFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(webhook.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *WebhookFilter) WhereName(p entql.StringP) { + f.Where(p.Field(webhook.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *WebhookFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(webhook.FieldDescription)) +} + +// WhereDestinationURL applies the entql string predicate on the destination_url field. +func (f *WebhookFilter) WhereDestinationURL(p entql.StringP) { + f.Where(p.Field(webhook.FieldDestinationURL)) +} + +// WhereEnabled applies the entql bool predicate on the enabled field. +func (f *WebhookFilter) WhereEnabled(p entql.BoolP) { + f.Where(p.Field(webhook.FieldEnabled)) +} + +// WhereCallback applies the entql string predicate on the callback field. +func (f *WebhookFilter) WhereCallback(p entql.StringP) { + f.Where(p.Field(webhook.FieldCallback)) +} + +// WhereExpiresAt applies the entql time.Time predicate on the expires_at field. +func (f *WebhookFilter) WhereExpiresAt(p entql.TimeP) { + f.Where(p.Field(webhook.FieldExpiresAt)) +} + +// WhereSecret applies the entql []byte predicate on the secret field. +func (f *WebhookFilter) WhereSecret(p entql.BytesP) { + f.Where(p.Field(webhook.FieldSecret)) +} + +// WhereFailures applies the entql int predicate on the failures field. +func (f *WebhookFilter) WhereFailures(p entql.IntP) { + f.Where(p.Field(webhook.FieldFailures)) +} + +// WhereLastError applies the entql string predicate on the last_error field. +func (f *WebhookFilter) WhereLastError(p entql.StringP) { + f.Where(p.Field(webhook.FieldLastError)) +} + +// WhereLastResponse applies the entql string predicate on the last_response field. +func (f *WebhookFilter) WhereLastResponse(p entql.StringP) { + f.Where(p.Field(webhook.FieldLastResponse)) +} + +// WhereHasOwner applies a predicate to check if query has an edge owner. +func (f *WebhookFilter) WhereHasOwner() { + f.Where(entql.HasEdge("owner")) +} + +// WhereHasOwnerWith applies a predicate to check if query has an edge owner with a given conditions (other predicates). +func (f *WebhookFilter) WhereHasOwnerWith(preds ...predicate.Organization) { + f.Where(entql.HasEdgeWith("owner", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasEvents applies a predicate to check if query has an edge events. +func (f *WebhookFilter) WhereHasEvents() { + f.Where(entql.HasEdge("events")) +} + +// WhereHasEventsWith applies a predicate to check if query has an edge events with a given conditions (other predicates). +func (f *WebhookFilter) WhereHasEventsWith(preds ...predicate.Event) { + f.Where(entql.HasEdgeWith("events", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// WhereHasIntegrations applies a predicate to check if query has an edge integrations. +func (f *WebhookFilter) WhereHasIntegrations() { + f.Where(entql.HasEdge("integrations")) +} + +// WhereHasIntegrationsWith applies a predicate to check if query has an edge integrations with a given conditions (other predicates). +func (f *WebhookFilter) WhereHasIntegrationsWith(preds ...predicate.Integration) { + f.Where(entql.HasEdgeWith("integrations", sqlgraph.WrapFunc(func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }))) +} + +// addPredicate implements the predicateAdder interface. +func (whq *WebhookHistoryQuery) addPredicate(pred func(s *sql.Selector)) { + whq.predicates = append(whq.predicates, pred) +} + +// Filter returns a Filter implementation to apply filters on the WebhookHistoryQuery builder. +func (whq *WebhookHistoryQuery) Filter() *WebhookHistoryFilter { + return &WebhookHistoryFilter{config: whq.config, predicateAdder: whq} +} + +// addPredicate implements the predicateAdder interface. +func (m *WebhookHistoryMutation) addPredicate(pred func(s *sql.Selector)) { + m.predicates = append(m.predicates, pred) +} + +// Filter returns an entql.Where implementation to apply filters on the WebhookHistoryMutation builder. +func (m *WebhookHistoryMutation) Filter() *WebhookHistoryFilter { + return &WebhookHistoryFilter{config: m.config, predicateAdder: m} +} + +// WebhookHistoryFilter provides a generic filtering capability at runtime for WebhookHistoryQuery. +type WebhookHistoryFilter struct { + predicateAdder + config +} + +// Where applies the entql predicate on the query filter. +func (f *WebhookHistoryFilter) Where(p entql.P) { + f.addPredicate(func(s *sql.Selector) { + if err := schemaGraph.EvalP(schemaGraph.Nodes[56].Type, p, s); err != nil { + s.AddError(err) + } + }) +} + +// WhereID applies the entql string predicate on the id field. +func (f *WebhookHistoryFilter) WhereID(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldID)) +} + +// WhereHistoryTime applies the entql time.Time predicate on the history_time field. +func (f *WebhookHistoryFilter) WhereHistoryTime(p entql.TimeP) { + f.Where(p.Field(webhookhistory.FieldHistoryTime)) +} + +// WhereRef applies the entql string predicate on the ref field. +func (f *WebhookHistoryFilter) WhereRef(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldRef)) +} + +// WhereOperation applies the entql string predicate on the operation field. +func (f *WebhookHistoryFilter) WhereOperation(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldOperation)) +} + +// WhereCreatedAt applies the entql time.Time predicate on the created_at field. +func (f *WebhookHistoryFilter) WhereCreatedAt(p entql.TimeP) { + f.Where(p.Field(webhookhistory.FieldCreatedAt)) +} + +// WhereUpdatedAt applies the entql time.Time predicate on the updated_at field. +func (f *WebhookHistoryFilter) WhereUpdatedAt(p entql.TimeP) { + f.Where(p.Field(webhookhistory.FieldUpdatedAt)) +} + +// WhereCreatedBy applies the entql string predicate on the created_by field. +func (f *WebhookHistoryFilter) WhereCreatedBy(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldCreatedBy)) +} + +// WhereUpdatedBy applies the entql string predicate on the updated_by field. +func (f *WebhookHistoryFilter) WhereUpdatedBy(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldUpdatedBy)) +} + +// WhereMappingID applies the entql string predicate on the mapping_id field. +func (f *WebhookHistoryFilter) WhereMappingID(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldMappingID)) +} + +// WhereTags applies the entql json.RawMessage predicate on the tags field. +func (f *WebhookHistoryFilter) WhereTags(p entql.BytesP) { + f.Where(p.Field(webhookhistory.FieldTags)) +} + +// WhereDeletedAt applies the entql time.Time predicate on the deleted_at field. +func (f *WebhookHistoryFilter) WhereDeletedAt(p entql.TimeP) { + f.Where(p.Field(webhookhistory.FieldDeletedAt)) +} + +// WhereDeletedBy applies the entql string predicate on the deleted_by field. +func (f *WebhookHistoryFilter) WhereDeletedBy(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldDeletedBy)) +} + +// WhereOwnerID applies the entql string predicate on the owner_id field. +func (f *WebhookHistoryFilter) WhereOwnerID(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldOwnerID)) +} + +// WhereName applies the entql string predicate on the name field. +func (f *WebhookHistoryFilter) WhereName(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldName)) +} + +// WhereDescription applies the entql string predicate on the description field. +func (f *WebhookHistoryFilter) WhereDescription(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldDescription)) +} + +// WhereDestinationURL applies the entql string predicate on the destination_url field. +func (f *WebhookHistoryFilter) WhereDestinationURL(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldDestinationURL)) +} + +// WhereEnabled applies the entql bool predicate on the enabled field. +func (f *WebhookHistoryFilter) WhereEnabled(p entql.BoolP) { + f.Where(p.Field(webhookhistory.FieldEnabled)) +} + +// WhereCallback applies the entql string predicate on the callback field. +func (f *WebhookHistoryFilter) WhereCallback(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldCallback)) +} + +// WhereExpiresAt applies the entql time.Time predicate on the expires_at field. +func (f *WebhookHistoryFilter) WhereExpiresAt(p entql.TimeP) { + f.Where(p.Field(webhookhistory.FieldExpiresAt)) +} + +// WhereSecret applies the entql []byte predicate on the secret field. +func (f *WebhookHistoryFilter) WhereSecret(p entql.BytesP) { + f.Where(p.Field(webhookhistory.FieldSecret)) +} + +// WhereFailures applies the entql int predicate on the failures field. +func (f *WebhookHistoryFilter) WhereFailures(p entql.IntP) { + f.Where(p.Field(webhookhistory.FieldFailures)) +} + +// WhereLastError applies the entql string predicate on the last_error field. +func (f *WebhookHistoryFilter) WhereLastError(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldLastError)) +} + +// WhereLastResponse applies the entql string predicate on the last_response field. +func (f *WebhookHistoryFilter) WhereLastResponse(p entql.StringP) { + f.Where(p.Field(webhookhistory.FieldLastResponse)) +} diff --git a/internal/ent/generated/enttest/enttest.go b/internal/ent/generated/enttest/enttest.go new file mode 100644 index 0000000..f3da0af --- /dev/null +++ b/internal/ent/generated/enttest/enttest.go @@ -0,0 +1,84 @@ +// Code generated by ent, DO NOT EDIT. + +package enttest + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated" + // required by schema hooks. + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + + "entgo.io/ent/dialect/sql/schema" + "github.com/theopenlane/core/internal/ent/generated/migrate" +) + +type ( + // TestingT is the interface that is shared between + // testing.T and testing.B and used by enttest. + TestingT interface { + FailNow() + Error(...any) + } + + // Option configures client creation. + Option func(*options) + + options struct { + opts []generated.Option + migrateOpts []schema.MigrateOption + } +) + +// WithOptions forwards options to client creation. +func WithOptions(opts ...generated.Option) Option { + return func(o *options) { + o.opts = append(o.opts, opts...) + } +} + +// WithMigrateOptions forwards options to auto migration. +func WithMigrateOptions(opts ...schema.MigrateOption) Option { + return func(o *options) { + o.migrateOpts = append(o.migrateOpts, opts...) + } +} + +func newOptions(opts []Option) *options { + o := &options{} + for _, opt := range opts { + opt(o) + } + return o +} + +// Open calls generated.Open and auto-run migration. +func Open(t TestingT, driverName, dataSourceName string, opts ...Option) *generated.Client { + o := newOptions(opts) + c, err := generated.Open(driverName, dataSourceName, o.opts...) + if err != nil { + t.Error(err) + t.FailNow() + } + migrateSchema(t, c, o) + return c +} + +// NewClient calls generated.NewClient and auto-run migration. +func NewClient(t TestingT, opts ...Option) *generated.Client { + o := newOptions(opts) + c := generated.NewClient(o.opts...) + migrateSchema(t, c, o) + return c +} +func migrateSchema(t TestingT, c *generated.Client, o *options) { + tables, err := schema.CopyTables(migrate.Tables) + if err != nil { + t.Error(err) + t.FailNow() + } + if err := migrate.Create(context.Background(), c.Schema, tables, o.migrateOpts...); err != nil { + t.Error(err) + t.FailNow() + } +} diff --git a/internal/ent/generated/event.go b/internal/ent/generated/event.go new file mode 100644 index 0000000..52a692d --- /dev/null +++ b/internal/ent/generated/event.go @@ -0,0 +1,879 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/event" +) + +// Event is the model entity for the Event schema. +type Event struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // EventID holds the value of the "event_id" field. + EventID string `json:"event_id,omitempty"` + // CorrelationID holds the value of the "correlation_id" field. + CorrelationID string `json:"correlation_id,omitempty"` + // EventType holds the value of the "event_type" field. + EventType string `json:"event_type,omitempty"` + // Metadata holds the value of the "metadata" field. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the EventQuery when eager-loading is set. + Edges EventEdges `json:"edges"` + selectValues sql.SelectValues +} + +// EventEdges holds the relations/edges for other nodes in the graph. +type EventEdges struct { + // User holds the value of the user edge. + User []*User `json:"user,omitempty"` + // Group holds the value of the group edge. + Group []*Group `json:"group,omitempty"` + // Integration holds the value of the integration edge. + Integration []*Integration `json:"integration,omitempty"` + // Organization holds the value of the organization edge. + Organization []*Organization `json:"organization,omitempty"` + // Invite holds the value of the invite edge. + Invite []*Invite `json:"invite,omitempty"` + // Feature holds the value of the feature edge. + Feature []*Feature `json:"feature,omitempty"` + // Entitlementplan holds the value of the entitlementplan edge. + Entitlementplan []*EntitlementPlan `json:"entitlementplan,omitempty"` + // Entitlementplanfeature holds the value of the entitlementplanfeature edge. + Entitlementplanfeature []*EntitlementPlanFeature `json:"entitlementplanfeature,omitempty"` + // PersonalAccessToken holds the value of the personal_access_token edge. + PersonalAccessToken []*PersonalAccessToken `json:"personal_access_token,omitempty"` + // Oauth2token holds the value of the oauth2token edge. + Oauth2token []*OhAuthTooToken `json:"oauth2token,omitempty"` + // Hush holds the value of the hush edge. + Hush []*Hush `json:"hush,omitempty"` + // Orgmembership holds the value of the orgmembership edge. + Orgmembership []*OrgMembership `json:"orgmembership,omitempty"` + // Groupmembership holds the value of the groupmembership edge. + Groupmembership []*GroupMembership `json:"groupmembership,omitempty"` + // Entitlement holds the value of the entitlement edge. + Entitlement []*Entitlement `json:"entitlement,omitempty"` + // Webhook holds the value of the webhook edge. + Webhook []*Webhook `json:"webhook,omitempty"` + // Subscriber holds the value of the subscriber edge. + Subscriber []*Subscriber `json:"subscriber,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [16]bool + // totalCount holds the count of the edges above. + totalCount [16]map[string]int + + namedUser map[string][]*User + namedGroup map[string][]*Group + namedIntegration map[string][]*Integration + namedOrganization map[string][]*Organization + namedInvite map[string][]*Invite + namedFeature map[string][]*Feature + namedEntitlementplan map[string][]*EntitlementPlan + namedEntitlementplanfeature map[string][]*EntitlementPlanFeature + namedPersonalAccessToken map[string][]*PersonalAccessToken + namedOauth2token map[string][]*OhAuthTooToken + namedHush map[string][]*Hush + namedOrgmembership map[string][]*OrgMembership + namedGroupmembership map[string][]*GroupMembership + namedEntitlement map[string][]*Entitlement + namedWebhook map[string][]*Webhook + namedSubscriber map[string][]*Subscriber +} + +// UserOrErr returns the User value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) UserOrErr() ([]*User, error) { + if e.loadedTypes[0] { + return e.User, nil + } + return nil, &NotLoadedError{edge: "user"} +} + +// GroupOrErr returns the Group value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) GroupOrErr() ([]*Group, error) { + if e.loadedTypes[1] { + return e.Group, nil + } + return nil, &NotLoadedError{edge: "group"} +} + +// IntegrationOrErr returns the Integration value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) IntegrationOrErr() ([]*Integration, error) { + if e.loadedTypes[2] { + return e.Integration, nil + } + return nil, &NotLoadedError{edge: "integration"} +} + +// OrganizationOrErr returns the Organization value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) OrganizationOrErr() ([]*Organization, error) { + if e.loadedTypes[3] { + return e.Organization, nil + } + return nil, &NotLoadedError{edge: "organization"} +} + +// InviteOrErr returns the Invite value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) InviteOrErr() ([]*Invite, error) { + if e.loadedTypes[4] { + return e.Invite, nil + } + return nil, &NotLoadedError{edge: "invite"} +} + +// FeatureOrErr returns the Feature value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) FeatureOrErr() ([]*Feature, error) { + if e.loadedTypes[5] { + return e.Feature, nil + } + return nil, &NotLoadedError{edge: "feature"} +} + +// EntitlementplanOrErr returns the Entitlementplan value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) EntitlementplanOrErr() ([]*EntitlementPlan, error) { + if e.loadedTypes[6] { + return e.Entitlementplan, nil + } + return nil, &NotLoadedError{edge: "entitlementplan"} +} + +// EntitlementplanfeatureOrErr returns the Entitlementplanfeature value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) EntitlementplanfeatureOrErr() ([]*EntitlementPlanFeature, error) { + if e.loadedTypes[7] { + return e.Entitlementplanfeature, nil + } + return nil, &NotLoadedError{edge: "entitlementplanfeature"} +} + +// PersonalAccessTokenOrErr returns the PersonalAccessToken value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) PersonalAccessTokenOrErr() ([]*PersonalAccessToken, error) { + if e.loadedTypes[8] { + return e.PersonalAccessToken, nil + } + return nil, &NotLoadedError{edge: "personal_access_token"} +} + +// Oauth2tokenOrErr returns the Oauth2token value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) Oauth2tokenOrErr() ([]*OhAuthTooToken, error) { + if e.loadedTypes[9] { + return e.Oauth2token, nil + } + return nil, &NotLoadedError{edge: "oauth2token"} +} + +// HushOrErr returns the Hush value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) HushOrErr() ([]*Hush, error) { + if e.loadedTypes[10] { + return e.Hush, nil + } + return nil, &NotLoadedError{edge: "hush"} +} + +// OrgmembershipOrErr returns the Orgmembership value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) OrgmembershipOrErr() ([]*OrgMembership, error) { + if e.loadedTypes[11] { + return e.Orgmembership, nil + } + return nil, &NotLoadedError{edge: "orgmembership"} +} + +// GroupmembershipOrErr returns the Groupmembership value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) GroupmembershipOrErr() ([]*GroupMembership, error) { + if e.loadedTypes[12] { + return e.Groupmembership, nil + } + return nil, &NotLoadedError{edge: "groupmembership"} +} + +// EntitlementOrErr returns the Entitlement value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) EntitlementOrErr() ([]*Entitlement, error) { + if e.loadedTypes[13] { + return e.Entitlement, nil + } + return nil, &NotLoadedError{edge: "entitlement"} +} + +// WebhookOrErr returns the Webhook value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) WebhookOrErr() ([]*Webhook, error) { + if e.loadedTypes[14] { + return e.Webhook, nil + } + return nil, &NotLoadedError{edge: "webhook"} +} + +// SubscriberOrErr returns the Subscriber value or an error if the edge +// was not loaded in eager-loading. +func (e EventEdges) SubscriberOrErr() ([]*Subscriber, error) { + if e.loadedTypes[15] { + return e.Subscriber, nil + } + return nil, &NotLoadedError{edge: "subscriber"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Event) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case event.FieldTags, event.FieldMetadata: + values[i] = new([]byte) + case event.FieldID, event.FieldCreatedBy, event.FieldUpdatedBy, event.FieldMappingID, event.FieldEventID, event.FieldCorrelationID, event.FieldEventType: + values[i] = new(sql.NullString) + case event.FieldCreatedAt, event.FieldUpdatedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Event fields. +func (e *Event) 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 event.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + e.ID = value.String + } + case event.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + e.CreatedAt = value.Time + } + case event.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + e.UpdatedAt = value.Time + } + case event.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + e.CreatedBy = value.String + } + case event.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + e.UpdatedBy = value.String + } + case event.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + e.MappingID = value.String + } + case event.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &e.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case event.FieldEventID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field event_id", values[i]) + } else if value.Valid { + e.EventID = value.String + } + case event.FieldCorrelationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field correlation_id", values[i]) + } else if value.Valid { + e.CorrelationID = value.String + } + case event.FieldEventType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field event_type", values[i]) + } else if value.Valid { + e.EventType = value.String + } + case event.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &e.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + default: + e.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Event. +// This includes values selected through modifiers, order, etc. +func (e *Event) Value(name string) (ent.Value, error) { + return e.selectValues.Get(name) +} + +// QueryUser queries the "user" edge of the Event entity. +func (e *Event) QueryUser() *UserQuery { + return NewEventClient(e.config).QueryUser(e) +} + +// QueryGroup queries the "group" edge of the Event entity. +func (e *Event) QueryGroup() *GroupQuery { + return NewEventClient(e.config).QueryGroup(e) +} + +// QueryIntegration queries the "integration" edge of the Event entity. +func (e *Event) QueryIntegration() *IntegrationQuery { + return NewEventClient(e.config).QueryIntegration(e) +} + +// QueryOrganization queries the "organization" edge of the Event entity. +func (e *Event) QueryOrganization() *OrganizationQuery { + return NewEventClient(e.config).QueryOrganization(e) +} + +// QueryInvite queries the "invite" edge of the Event entity. +func (e *Event) QueryInvite() *InviteQuery { + return NewEventClient(e.config).QueryInvite(e) +} + +// QueryFeature queries the "feature" edge of the Event entity. +func (e *Event) QueryFeature() *FeatureQuery { + return NewEventClient(e.config).QueryFeature(e) +} + +// QueryEntitlementplan queries the "entitlementplan" edge of the Event entity. +func (e *Event) QueryEntitlementplan() *EntitlementPlanQuery { + return NewEventClient(e.config).QueryEntitlementplan(e) +} + +// QueryEntitlementplanfeature queries the "entitlementplanfeature" edge of the Event entity. +func (e *Event) QueryEntitlementplanfeature() *EntitlementPlanFeatureQuery { + return NewEventClient(e.config).QueryEntitlementplanfeature(e) +} + +// QueryPersonalAccessToken queries the "personal_access_token" edge of the Event entity. +func (e *Event) QueryPersonalAccessToken() *PersonalAccessTokenQuery { + return NewEventClient(e.config).QueryPersonalAccessToken(e) +} + +// QueryOauth2token queries the "oauth2token" edge of the Event entity. +func (e *Event) QueryOauth2token() *OhAuthTooTokenQuery { + return NewEventClient(e.config).QueryOauth2token(e) +} + +// QueryHush queries the "hush" edge of the Event entity. +func (e *Event) QueryHush() *HushQuery { + return NewEventClient(e.config).QueryHush(e) +} + +// QueryOrgmembership queries the "orgmembership" edge of the Event entity. +func (e *Event) QueryOrgmembership() *OrgMembershipQuery { + return NewEventClient(e.config).QueryOrgmembership(e) +} + +// QueryGroupmembership queries the "groupmembership" edge of the Event entity. +func (e *Event) QueryGroupmembership() *GroupMembershipQuery { + return NewEventClient(e.config).QueryGroupmembership(e) +} + +// QueryEntitlement queries the "entitlement" edge of the Event entity. +func (e *Event) QueryEntitlement() *EntitlementQuery { + return NewEventClient(e.config).QueryEntitlement(e) +} + +// QueryWebhook queries the "webhook" edge of the Event entity. +func (e *Event) QueryWebhook() *WebhookQuery { + return NewEventClient(e.config).QueryWebhook(e) +} + +// QuerySubscriber queries the "subscriber" edge of the Event entity. +func (e *Event) QuerySubscriber() *SubscriberQuery { + return NewEventClient(e.config).QuerySubscriber(e) +} + +// Update returns a builder for updating this Event. +// Note that you need to call Event.Unwrap() before calling this method if this Event +// was returned from a transaction, and the transaction was committed or rolled back. +func (e *Event) Update() *EventUpdateOne { + return NewEventClient(e.config).UpdateOne(e) +} + +// Unwrap unwraps the Event 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 (e *Event) Unwrap() *Event { + _tx, ok := e.config.driver.(*txDriver) + if !ok { + panic("generated: Event is not a transactional entity") + } + e.config.driver = _tx.drv + return e +} + +// String implements the fmt.Stringer. +func (e *Event) String() string { + var builder strings.Builder + builder.WriteString("Event(") + builder.WriteString(fmt.Sprintf("id=%v, ", e.ID)) + builder.WriteString("created_at=") + builder.WriteString(e.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(e.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(e.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(e.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(e.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", e.Tags)) + builder.WriteString(", ") + builder.WriteString("event_id=") + builder.WriteString(e.EventID) + builder.WriteString(", ") + builder.WriteString("correlation_id=") + builder.WriteString(e.CorrelationID) + builder.WriteString(", ") + builder.WriteString("event_type=") + builder.WriteString(e.EventType) + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", e.Metadata)) + builder.WriteByte(')') + return builder.String() +} + +// NamedUser returns the User named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedUser(name string) ([]*User, error) { + if e.Edges.namedUser == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedUser[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedUser(name string, edges ...*User) { + if e.Edges.namedUser == nil { + e.Edges.namedUser = make(map[string][]*User) + } + if len(edges) == 0 { + e.Edges.namedUser[name] = []*User{} + } else { + e.Edges.namedUser[name] = append(e.Edges.namedUser[name], edges...) + } +} + +// NamedGroup returns the Group named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedGroup(name string) ([]*Group, error) { + if e.Edges.namedGroup == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedGroup[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedGroup(name string, edges ...*Group) { + if e.Edges.namedGroup == nil { + e.Edges.namedGroup = make(map[string][]*Group) + } + if len(edges) == 0 { + e.Edges.namedGroup[name] = []*Group{} + } else { + e.Edges.namedGroup[name] = append(e.Edges.namedGroup[name], edges...) + } +} + +// NamedIntegration returns the Integration named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedIntegration(name string) ([]*Integration, error) { + if e.Edges.namedIntegration == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedIntegration[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedIntegration(name string, edges ...*Integration) { + if e.Edges.namedIntegration == nil { + e.Edges.namedIntegration = make(map[string][]*Integration) + } + if len(edges) == 0 { + e.Edges.namedIntegration[name] = []*Integration{} + } else { + e.Edges.namedIntegration[name] = append(e.Edges.namedIntegration[name], edges...) + } +} + +// NamedOrganization returns the Organization named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedOrganization(name string) ([]*Organization, error) { + if e.Edges.namedOrganization == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedOrganization[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedOrganization(name string, edges ...*Organization) { + if e.Edges.namedOrganization == nil { + e.Edges.namedOrganization = make(map[string][]*Organization) + } + if len(edges) == 0 { + e.Edges.namedOrganization[name] = []*Organization{} + } else { + e.Edges.namedOrganization[name] = append(e.Edges.namedOrganization[name], edges...) + } +} + +// NamedInvite returns the Invite named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedInvite(name string) ([]*Invite, error) { + if e.Edges.namedInvite == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedInvite[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedInvite(name string, edges ...*Invite) { + if e.Edges.namedInvite == nil { + e.Edges.namedInvite = make(map[string][]*Invite) + } + if len(edges) == 0 { + e.Edges.namedInvite[name] = []*Invite{} + } else { + e.Edges.namedInvite[name] = append(e.Edges.namedInvite[name], edges...) + } +} + +// NamedFeature returns the Feature named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedFeature(name string) ([]*Feature, error) { + if e.Edges.namedFeature == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedFeature[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedFeature(name string, edges ...*Feature) { + if e.Edges.namedFeature == nil { + e.Edges.namedFeature = make(map[string][]*Feature) + } + if len(edges) == 0 { + e.Edges.namedFeature[name] = []*Feature{} + } else { + e.Edges.namedFeature[name] = append(e.Edges.namedFeature[name], edges...) + } +} + +// NamedEntitlementplan returns the Entitlementplan named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedEntitlementplan(name string) ([]*EntitlementPlan, error) { + if e.Edges.namedEntitlementplan == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedEntitlementplan[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedEntitlementplan(name string, edges ...*EntitlementPlan) { + if e.Edges.namedEntitlementplan == nil { + e.Edges.namedEntitlementplan = make(map[string][]*EntitlementPlan) + } + if len(edges) == 0 { + e.Edges.namedEntitlementplan[name] = []*EntitlementPlan{} + } else { + e.Edges.namedEntitlementplan[name] = append(e.Edges.namedEntitlementplan[name], edges...) + } +} + +// NamedEntitlementplanfeature returns the Entitlementplanfeature named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedEntitlementplanfeature(name string) ([]*EntitlementPlanFeature, error) { + if e.Edges.namedEntitlementplanfeature == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedEntitlementplanfeature[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedEntitlementplanfeature(name string, edges ...*EntitlementPlanFeature) { + if e.Edges.namedEntitlementplanfeature == nil { + e.Edges.namedEntitlementplanfeature = make(map[string][]*EntitlementPlanFeature) + } + if len(edges) == 0 { + e.Edges.namedEntitlementplanfeature[name] = []*EntitlementPlanFeature{} + } else { + e.Edges.namedEntitlementplanfeature[name] = append(e.Edges.namedEntitlementplanfeature[name], edges...) + } +} + +// NamedPersonalAccessToken returns the PersonalAccessToken named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedPersonalAccessToken(name string) ([]*PersonalAccessToken, error) { + if e.Edges.namedPersonalAccessToken == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedPersonalAccessToken[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedPersonalAccessToken(name string, edges ...*PersonalAccessToken) { + if e.Edges.namedPersonalAccessToken == nil { + e.Edges.namedPersonalAccessToken = make(map[string][]*PersonalAccessToken) + } + if len(edges) == 0 { + e.Edges.namedPersonalAccessToken[name] = []*PersonalAccessToken{} + } else { + e.Edges.namedPersonalAccessToken[name] = append(e.Edges.namedPersonalAccessToken[name], edges...) + } +} + +// NamedOauth2token returns the Oauth2token named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedOauth2token(name string) ([]*OhAuthTooToken, error) { + if e.Edges.namedOauth2token == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedOauth2token[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedOauth2token(name string, edges ...*OhAuthTooToken) { + if e.Edges.namedOauth2token == nil { + e.Edges.namedOauth2token = make(map[string][]*OhAuthTooToken) + } + if len(edges) == 0 { + e.Edges.namedOauth2token[name] = []*OhAuthTooToken{} + } else { + e.Edges.namedOauth2token[name] = append(e.Edges.namedOauth2token[name], edges...) + } +} + +// NamedHush returns the Hush named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedHush(name string) ([]*Hush, error) { + if e.Edges.namedHush == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedHush[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedHush(name string, edges ...*Hush) { + if e.Edges.namedHush == nil { + e.Edges.namedHush = make(map[string][]*Hush) + } + if len(edges) == 0 { + e.Edges.namedHush[name] = []*Hush{} + } else { + e.Edges.namedHush[name] = append(e.Edges.namedHush[name], edges...) + } +} + +// NamedOrgmembership returns the Orgmembership named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedOrgmembership(name string) ([]*OrgMembership, error) { + if e.Edges.namedOrgmembership == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedOrgmembership[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedOrgmembership(name string, edges ...*OrgMembership) { + if e.Edges.namedOrgmembership == nil { + e.Edges.namedOrgmembership = make(map[string][]*OrgMembership) + } + if len(edges) == 0 { + e.Edges.namedOrgmembership[name] = []*OrgMembership{} + } else { + e.Edges.namedOrgmembership[name] = append(e.Edges.namedOrgmembership[name], edges...) + } +} + +// NamedGroupmembership returns the Groupmembership named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedGroupmembership(name string) ([]*GroupMembership, error) { + if e.Edges.namedGroupmembership == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedGroupmembership[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedGroupmembership(name string, edges ...*GroupMembership) { + if e.Edges.namedGroupmembership == nil { + e.Edges.namedGroupmembership = make(map[string][]*GroupMembership) + } + if len(edges) == 0 { + e.Edges.namedGroupmembership[name] = []*GroupMembership{} + } else { + e.Edges.namedGroupmembership[name] = append(e.Edges.namedGroupmembership[name], edges...) + } +} + +// NamedEntitlement returns the Entitlement named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedEntitlement(name string) ([]*Entitlement, error) { + if e.Edges.namedEntitlement == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedEntitlement[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedEntitlement(name string, edges ...*Entitlement) { + if e.Edges.namedEntitlement == nil { + e.Edges.namedEntitlement = make(map[string][]*Entitlement) + } + if len(edges) == 0 { + e.Edges.namedEntitlement[name] = []*Entitlement{} + } else { + e.Edges.namedEntitlement[name] = append(e.Edges.namedEntitlement[name], edges...) + } +} + +// NamedWebhook returns the Webhook named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedWebhook(name string) ([]*Webhook, error) { + if e.Edges.namedWebhook == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedWebhook[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedWebhook(name string, edges ...*Webhook) { + if e.Edges.namedWebhook == nil { + e.Edges.namedWebhook = make(map[string][]*Webhook) + } + if len(edges) == 0 { + e.Edges.namedWebhook[name] = []*Webhook{} + } else { + e.Edges.namedWebhook[name] = append(e.Edges.namedWebhook[name], edges...) + } +} + +// NamedSubscriber returns the Subscriber named value or an error if the edge was not +// loaded in eager-loading with this name. +func (e *Event) NamedSubscriber(name string) ([]*Subscriber, error) { + if e.Edges.namedSubscriber == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := e.Edges.namedSubscriber[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (e *Event) appendNamedSubscriber(name string, edges ...*Subscriber) { + if e.Edges.namedSubscriber == nil { + e.Edges.namedSubscriber = make(map[string][]*Subscriber) + } + if len(edges) == 0 { + e.Edges.namedSubscriber[name] = []*Subscriber{} + } else { + e.Edges.namedSubscriber[name] = append(e.Edges.namedSubscriber[name], edges...) + } +} + +// Events is a parsable slice of Event. +type Events []*Event diff --git a/internal/ent/generated/event/event.go b/internal/ent/generated/event/event.go new file mode 100644 index 0000000..50b36d2 --- /dev/null +++ b/internal/ent/generated/event/event.go @@ -0,0 +1,633 @@ +// Code generated by ent, DO NOT EDIT. + +package event + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the event type in the database. + Label = "event" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldEventID holds the string denoting the event_id field in the database. + FieldEventID = "event_id" + // FieldCorrelationID holds the string denoting the correlation_id field in the database. + FieldCorrelationID = "correlation_id" + // FieldEventType holds the string denoting the event_type field in the database. + FieldEventType = "event_type" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // EdgeUser holds the string denoting the user edge name in mutations. + EdgeUser = "user" + // EdgeGroup holds the string denoting the group edge name in mutations. + EdgeGroup = "group" + // EdgeIntegration holds the string denoting the integration edge name in mutations. + EdgeIntegration = "integration" + // EdgeOrganization holds the string denoting the organization edge name in mutations. + EdgeOrganization = "organization" + // EdgeInvite holds the string denoting the invite edge name in mutations. + EdgeInvite = "invite" + // EdgeFeature holds the string denoting the feature edge name in mutations. + EdgeFeature = "feature" + // EdgeEntitlementplan holds the string denoting the entitlementplan edge name in mutations. + EdgeEntitlementplan = "entitlementplan" + // EdgeEntitlementplanfeature holds the string denoting the entitlementplanfeature edge name in mutations. + EdgeEntitlementplanfeature = "entitlementplanfeature" + // EdgePersonalAccessToken holds the string denoting the personal_access_token edge name in mutations. + EdgePersonalAccessToken = "personal_access_token" + // EdgeOauth2token holds the string denoting the oauth2token edge name in mutations. + EdgeOauth2token = "oauth2token" + // EdgeHush holds the string denoting the hush edge name in mutations. + EdgeHush = "hush" + // EdgeOrgmembership holds the string denoting the orgmembership edge name in mutations. + EdgeOrgmembership = "orgmembership" + // EdgeGroupmembership holds the string denoting the groupmembership edge name in mutations. + EdgeGroupmembership = "groupmembership" + // EdgeEntitlement holds the string denoting the entitlement edge name in mutations. + EdgeEntitlement = "entitlement" + // EdgeWebhook holds the string denoting the webhook edge name in mutations. + EdgeWebhook = "webhook" + // EdgeSubscriber holds the string denoting the subscriber edge name in mutations. + EdgeSubscriber = "subscriber" + // Table holds the table name of the event in the database. + Table = "events" + // UserTable is the table that holds the user relation/edge. The primary key declared below. + UserTable = "user_events" + // UserInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + UserInverseTable = "users" + // GroupTable is the table that holds the group relation/edge. The primary key declared below. + GroupTable = "group_events" + // GroupInverseTable is the table name for the Group entity. + // It exists in this package in order to avoid circular dependency with the "group" package. + GroupInverseTable = "groups" + // IntegrationTable is the table that holds the integration relation/edge. The primary key declared below. + IntegrationTable = "integration_events" + // IntegrationInverseTable is the table name for the Integration entity. + // It exists in this package in order to avoid circular dependency with the "integration" package. + IntegrationInverseTable = "integrations" + // OrganizationTable is the table that holds the organization relation/edge. The primary key declared below. + OrganizationTable = "organization_events" + // OrganizationInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationInverseTable = "organizations" + // InviteTable is the table that holds the invite relation/edge. The primary key declared below. + InviteTable = "invite_events" + // InviteInverseTable is the table name for the Invite entity. + // It exists in this package in order to avoid circular dependency with the "invite" package. + InviteInverseTable = "invites" + // FeatureTable is the table that holds the feature relation/edge. The primary key declared below. + FeatureTable = "feature_events" + // FeatureInverseTable is the table name for the Feature entity. + // It exists in this package in order to avoid circular dependency with the "feature" package. + FeatureInverseTable = "features" + // EntitlementplanTable is the table that holds the entitlementplan relation/edge. The primary key declared below. + EntitlementplanTable = "entitlement_plan_events" + // EntitlementplanInverseTable is the table name for the EntitlementPlan entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplan" package. + EntitlementplanInverseTable = "entitlement_plans" + // EntitlementplanfeatureTable is the table that holds the entitlementplanfeature relation/edge. The primary key declared below. + EntitlementplanfeatureTable = "entitlement_plan_feature_events" + // EntitlementplanfeatureInverseTable is the table name for the EntitlementPlanFeature entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplanfeature" package. + EntitlementplanfeatureInverseTable = "entitlement_plan_features" + // PersonalAccessTokenTable is the table that holds the personal_access_token relation/edge. The primary key declared below. + PersonalAccessTokenTable = "personal_access_token_events" + // PersonalAccessTokenInverseTable is the table name for the PersonalAccessToken entity. + // It exists in this package in order to avoid circular dependency with the "personalaccesstoken" package. + PersonalAccessTokenInverseTable = "personal_access_tokens" + // Oauth2tokenTable is the table that holds the oauth2token relation/edge. The primary key declared below. + Oauth2tokenTable = "oh_auth_too_token_events" + // Oauth2tokenInverseTable is the table name for the OhAuthTooToken entity. + // It exists in this package in order to avoid circular dependency with the "ohauthtootoken" package. + Oauth2tokenInverseTable = "oh_auth_too_tokens" + // HushTable is the table that holds the hush relation/edge. The primary key declared below. + HushTable = "hush_events" + // HushInverseTable is the table name for the Hush entity. + // It exists in this package in order to avoid circular dependency with the "hush" package. + HushInverseTable = "hushes" + // OrgmembershipTable is the table that holds the orgmembership relation/edge. The primary key declared below. + OrgmembershipTable = "org_membership_events" + // OrgmembershipInverseTable is the table name for the OrgMembership entity. + // It exists in this package in order to avoid circular dependency with the "orgmembership" package. + OrgmembershipInverseTable = "org_memberships" + // GroupmembershipTable is the table that holds the groupmembership relation/edge. The primary key declared below. + GroupmembershipTable = "group_membership_events" + // GroupmembershipInverseTable is the table name for the GroupMembership entity. + // It exists in this package in order to avoid circular dependency with the "groupmembership" package. + GroupmembershipInverseTable = "group_memberships" + // EntitlementTable is the table that holds the entitlement relation/edge. The primary key declared below. + EntitlementTable = "entitlement_events" + // EntitlementInverseTable is the table name for the Entitlement entity. + // It exists in this package in order to avoid circular dependency with the "entitlement" package. + EntitlementInverseTable = "entitlements" + // WebhookTable is the table that holds the webhook relation/edge. The primary key declared below. + WebhookTable = "webhook_events" + // WebhookInverseTable is the table name for the Webhook entity. + // It exists in this package in order to avoid circular dependency with the "webhook" package. + WebhookInverseTable = "webhooks" + // SubscriberTable is the table that holds the subscriber relation/edge. The primary key declared below. + SubscriberTable = "subscriber_events" + // SubscriberInverseTable is the table name for the Subscriber entity. + // It exists in this package in order to avoid circular dependency with the "subscriber" package. + SubscriberInverseTable = "subscribers" +) + +// Columns holds all SQL columns for event fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldEventID, + FieldCorrelationID, + FieldEventType, + FieldMetadata, +} + +var ( + // UserPrimaryKey and UserColumn2 are the table columns denoting the + // primary key for the user relation (M2M). + UserPrimaryKey = []string{"user_id", "event_id"} + // GroupPrimaryKey and GroupColumn2 are the table columns denoting the + // primary key for the group relation (M2M). + GroupPrimaryKey = []string{"group_id", "event_id"} + // IntegrationPrimaryKey and IntegrationColumn2 are the table columns denoting the + // primary key for the integration relation (M2M). + IntegrationPrimaryKey = []string{"integration_id", "event_id"} + // OrganizationPrimaryKey and OrganizationColumn2 are the table columns denoting the + // primary key for the organization relation (M2M). + OrganizationPrimaryKey = []string{"organization_id", "event_id"} + // InvitePrimaryKey and InviteColumn2 are the table columns denoting the + // primary key for the invite relation (M2M). + InvitePrimaryKey = []string{"invite_id", "event_id"} + // FeaturePrimaryKey and FeatureColumn2 are the table columns denoting the + // primary key for the feature relation (M2M). + FeaturePrimaryKey = []string{"feature_id", "event_id"} + // EntitlementplanPrimaryKey and EntitlementplanColumn2 are the table columns denoting the + // primary key for the entitlementplan relation (M2M). + EntitlementplanPrimaryKey = []string{"entitlement_plan_id", "event_id"} + // EntitlementplanfeaturePrimaryKey and EntitlementplanfeatureColumn2 are the table columns denoting the + // primary key for the entitlementplanfeature relation (M2M). + EntitlementplanfeaturePrimaryKey = []string{"entitlement_plan_feature_id", "event_id"} + // PersonalAccessTokenPrimaryKey and PersonalAccessTokenColumn2 are the table columns denoting the + // primary key for the personal_access_token relation (M2M). + PersonalAccessTokenPrimaryKey = []string{"personal_access_token_id", "event_id"} + // Oauth2tokenPrimaryKey and Oauth2tokenColumn2 are the table columns denoting the + // primary key for the oauth2token relation (M2M). + Oauth2tokenPrimaryKey = []string{"oh_auth_too_token_id", "event_id"} + // HushPrimaryKey and HushColumn2 are the table columns denoting the + // primary key for the hush relation (M2M). + HushPrimaryKey = []string{"hush_id", "event_id"} + // OrgmembershipPrimaryKey and OrgmembershipColumn2 are the table columns denoting the + // primary key for the orgmembership relation (M2M). + OrgmembershipPrimaryKey = []string{"org_membership_id", "event_id"} + // GroupmembershipPrimaryKey and GroupmembershipColumn2 are the table columns denoting the + // primary key for the groupmembership relation (M2M). + GroupmembershipPrimaryKey = []string{"group_membership_id", "event_id"} + // EntitlementPrimaryKey and EntitlementColumn2 are the table columns denoting the + // primary key for the entitlement relation (M2M). + EntitlementPrimaryKey = []string{"entitlement_id", "event_id"} + // WebhookPrimaryKey and WebhookColumn2 are the table columns denoting the + // primary key for the webhook relation (M2M). + WebhookPrimaryKey = []string{"webhook_id", "event_id"} + // SubscriberPrimaryKey and SubscriberColumn2 are the table columns denoting the + // primary key for the subscriber relation (M2M). + SubscriberPrimaryKey = []string{"subscriber_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Event queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByEventID orders the results by the event_id field. +func ByEventID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEventID, opts...).ToFunc() +} + +// ByCorrelationID orders the results by the correlation_id field. +func ByCorrelationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCorrelationID, opts...).ToFunc() +} + +// ByEventType orders the results by the event_type field. +func ByEventType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEventType, opts...).ToFunc() +} + +// ByUserCount orders the results by user count. +func ByUserCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newUserStep(), opts...) + } +} + +// ByUser orders the results by user terms. +func ByUser(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newUserStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByGroupCount orders the results by group count. +func ByGroupCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newGroupStep(), opts...) + } +} + +// ByGroup orders the results by group terms. +func ByGroup(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByIntegrationCount orders the results by integration count. +func ByIntegrationCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newIntegrationStep(), opts...) + } +} + +// ByIntegration orders the results by integration terms. +func ByIntegration(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newIntegrationStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOrganizationCount orders the results by organization count. +func ByOrganizationCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrganizationStep(), opts...) + } +} + +// ByOrganization orders the results by organization terms. +func ByOrganization(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByInviteCount orders the results by invite count. +func ByInviteCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newInviteStep(), opts...) + } +} + +// ByInvite orders the results by invite terms. +func ByInvite(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newInviteStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFeatureCount orders the results by feature count. +func ByFeatureCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFeatureStep(), opts...) + } +} + +// ByFeature orders the results by feature terms. +func ByFeature(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFeatureStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitlementplanCount orders the results by entitlementplan count. +func ByEntitlementplanCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitlementplanStep(), opts...) + } +} + +// ByEntitlementplan orders the results by entitlementplan terms. +func ByEntitlementplan(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitlementplanStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitlementplanfeatureCount orders the results by entitlementplanfeature count. +func ByEntitlementplanfeatureCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitlementplanfeatureStep(), opts...) + } +} + +// ByEntitlementplanfeature orders the results by entitlementplanfeature terms. +func ByEntitlementplanfeature(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitlementplanfeatureStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByPersonalAccessTokenCount orders the results by personal_access_token count. +func ByPersonalAccessTokenCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newPersonalAccessTokenStep(), opts...) + } +} + +// ByPersonalAccessToken orders the results by personal_access_token terms. +func ByPersonalAccessToken(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPersonalAccessTokenStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOauth2tokenCount orders the results by oauth2token count. +func ByOauth2tokenCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOauth2tokenStep(), opts...) + } +} + +// ByOauth2token orders the results by oauth2token terms. +func ByOauth2token(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOauth2tokenStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByHushCount orders the results by hush count. +func ByHushCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newHushStep(), opts...) + } +} + +// ByHush orders the results by hush terms. +func ByHush(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newHushStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOrgmembershipCount orders the results by orgmembership count. +func ByOrgmembershipCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrgmembershipStep(), opts...) + } +} + +// ByOrgmembership orders the results by orgmembership terms. +func ByOrgmembership(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrgmembershipStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByGroupmembershipCount orders the results by groupmembership count. +func ByGroupmembershipCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newGroupmembershipStep(), opts...) + } +} + +// ByGroupmembership orders the results by groupmembership terms. +func ByGroupmembership(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupmembershipStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitlementCount orders the results by entitlement count. +func ByEntitlementCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitlementStep(), opts...) + } +} + +// ByEntitlement orders the results by entitlement terms. +func ByEntitlement(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitlementStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByWebhookCount orders the results by webhook count. +func ByWebhookCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newWebhookStep(), opts...) + } +} + +// ByWebhook orders the results by webhook terms. +func ByWebhook(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newWebhookStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// BySubscriberCount orders the results by subscriber count. +func BySubscriberCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newSubscriberStep(), opts...) + } +} + +// BySubscriber orders the results by subscriber terms. +func BySubscriber(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newSubscriberStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newUserStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(UserInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, UserTable, UserPrimaryKey...), + ) +} +func newGroupStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, GroupTable, GroupPrimaryKey...), + ) +} +func newIntegrationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(IntegrationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationTable, IntegrationPrimaryKey...), + ) +} +func newOrganizationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationTable, OrganizationPrimaryKey...), + ) +} +func newInviteStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(InviteInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, InviteTable, InvitePrimaryKey...), + ) +} +func newFeatureStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FeatureInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, FeatureTable, FeaturePrimaryKey...), + ) +} +func newEntitlementplanStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitlementplanInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitlementplanTable, EntitlementplanPrimaryKey...), + ) +} +func newEntitlementplanfeatureStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitlementplanfeatureInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitlementplanfeatureTable, EntitlementplanfeaturePrimaryKey...), + ) +} +func newPersonalAccessTokenStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PersonalAccessTokenInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, PersonalAccessTokenTable, PersonalAccessTokenPrimaryKey...), + ) +} +func newOauth2tokenStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Oauth2tokenInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, Oauth2tokenTable, Oauth2tokenPrimaryKey...), + ) +} +func newHushStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(HushInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, HushTable, HushPrimaryKey...), + ) +} +func newOrgmembershipStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrgmembershipInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrgmembershipTable, OrgmembershipPrimaryKey...), + ) +} +func newGroupmembershipStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupmembershipInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, GroupmembershipTable, GroupmembershipPrimaryKey...), + ) +} +func newEntitlementStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitlementInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitlementTable, EntitlementPrimaryKey...), + ) +} +func newWebhookStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(WebhookInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, WebhookTable, WebhookPrimaryKey...), + ) +} +func newSubscriberStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(SubscriberInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, SubscriberTable, SubscriberPrimaryKey...), + ) +} diff --git a/internal/ent/generated/event/where.go b/internal/ent/generated/event/where.go new file mode 100644 index 0000000..a868af1 --- /dev/null +++ b/internal/ent/generated/event/where.go @@ -0,0 +1,1137 @@ +// Code generated by ent, DO NOT EDIT. + +package event + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Event { + return predicate.Event(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Event { + return predicate.Event(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Event { + return predicate.Event(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Event { + return predicate.Event(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Event { + return predicate.Event(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldMappingID, v)) +} + +// EventID applies equality check predicate on the "event_id" field. It's identical to EventIDEQ. +func EventID(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldEventID, v)) +} + +// CorrelationID applies equality check predicate on the "correlation_id" field. It's identical to CorrelationIDEQ. +func CorrelationID(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldCorrelationID, v)) +} + +// EventType applies equality check predicate on the "event_type" field. It's identical to EventTypeEQ. +func EventType(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldEventType, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Event { + return predicate.Event(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Event { + return predicate.Event(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Event { + return predicate.Event(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Event { + return predicate.Event(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Event { + return predicate.Event(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Event { + return predicate.Event(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Event { + return predicate.Event(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Event { + return predicate.Event(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Event { + return predicate.Event(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Event { + return predicate.Event(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Event { + return predicate.Event(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Event { + return predicate.Event(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Event { + return predicate.Event(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Event { + return predicate.Event(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Event { + return predicate.Event(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Event { + return predicate.Event(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Event { + return predicate.Event(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Event { + return predicate.Event(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Event { + return predicate.Event(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Event { + return predicate.Event(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Event { + return predicate.Event(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Event { + return predicate.Event(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Event { + return predicate.Event(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Event { + return predicate.Event(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Event { + return predicate.Event(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Event { + return predicate.Event(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Event { + return predicate.Event(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldTags)) +} + +// EventIDEQ applies the EQ predicate on the "event_id" field. +func EventIDEQ(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldEventID, v)) +} + +// EventIDNEQ applies the NEQ predicate on the "event_id" field. +func EventIDNEQ(v string) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldEventID, v)) +} + +// EventIDIn applies the In predicate on the "event_id" field. +func EventIDIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldIn(FieldEventID, vs...)) +} + +// EventIDNotIn applies the NotIn predicate on the "event_id" field. +func EventIDNotIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldEventID, vs...)) +} + +// EventIDGT applies the GT predicate on the "event_id" field. +func EventIDGT(v string) predicate.Event { + return predicate.Event(sql.FieldGT(FieldEventID, v)) +} + +// EventIDGTE applies the GTE predicate on the "event_id" field. +func EventIDGTE(v string) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldEventID, v)) +} + +// EventIDLT applies the LT predicate on the "event_id" field. +func EventIDLT(v string) predicate.Event { + return predicate.Event(sql.FieldLT(FieldEventID, v)) +} + +// EventIDLTE applies the LTE predicate on the "event_id" field. +func EventIDLTE(v string) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldEventID, v)) +} + +// EventIDContains applies the Contains predicate on the "event_id" field. +func EventIDContains(v string) predicate.Event { + return predicate.Event(sql.FieldContains(FieldEventID, v)) +} + +// EventIDHasPrefix applies the HasPrefix predicate on the "event_id" field. +func EventIDHasPrefix(v string) predicate.Event { + return predicate.Event(sql.FieldHasPrefix(FieldEventID, v)) +} + +// EventIDHasSuffix applies the HasSuffix predicate on the "event_id" field. +func EventIDHasSuffix(v string) predicate.Event { + return predicate.Event(sql.FieldHasSuffix(FieldEventID, v)) +} + +// EventIDIsNil applies the IsNil predicate on the "event_id" field. +func EventIDIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldEventID)) +} + +// EventIDNotNil applies the NotNil predicate on the "event_id" field. +func EventIDNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldEventID)) +} + +// EventIDEqualFold applies the EqualFold predicate on the "event_id" field. +func EventIDEqualFold(v string) predicate.Event { + return predicate.Event(sql.FieldEqualFold(FieldEventID, v)) +} + +// EventIDContainsFold applies the ContainsFold predicate on the "event_id" field. +func EventIDContainsFold(v string) predicate.Event { + return predicate.Event(sql.FieldContainsFold(FieldEventID, v)) +} + +// CorrelationIDEQ applies the EQ predicate on the "correlation_id" field. +func CorrelationIDEQ(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldCorrelationID, v)) +} + +// CorrelationIDNEQ applies the NEQ predicate on the "correlation_id" field. +func CorrelationIDNEQ(v string) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldCorrelationID, v)) +} + +// CorrelationIDIn applies the In predicate on the "correlation_id" field. +func CorrelationIDIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldIn(FieldCorrelationID, vs...)) +} + +// CorrelationIDNotIn applies the NotIn predicate on the "correlation_id" field. +func CorrelationIDNotIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldCorrelationID, vs...)) +} + +// CorrelationIDGT applies the GT predicate on the "correlation_id" field. +func CorrelationIDGT(v string) predicate.Event { + return predicate.Event(sql.FieldGT(FieldCorrelationID, v)) +} + +// CorrelationIDGTE applies the GTE predicate on the "correlation_id" field. +func CorrelationIDGTE(v string) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldCorrelationID, v)) +} + +// CorrelationIDLT applies the LT predicate on the "correlation_id" field. +func CorrelationIDLT(v string) predicate.Event { + return predicate.Event(sql.FieldLT(FieldCorrelationID, v)) +} + +// CorrelationIDLTE applies the LTE predicate on the "correlation_id" field. +func CorrelationIDLTE(v string) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldCorrelationID, v)) +} + +// CorrelationIDContains applies the Contains predicate on the "correlation_id" field. +func CorrelationIDContains(v string) predicate.Event { + return predicate.Event(sql.FieldContains(FieldCorrelationID, v)) +} + +// CorrelationIDHasPrefix applies the HasPrefix predicate on the "correlation_id" field. +func CorrelationIDHasPrefix(v string) predicate.Event { + return predicate.Event(sql.FieldHasPrefix(FieldCorrelationID, v)) +} + +// CorrelationIDHasSuffix applies the HasSuffix predicate on the "correlation_id" field. +func CorrelationIDHasSuffix(v string) predicate.Event { + return predicate.Event(sql.FieldHasSuffix(FieldCorrelationID, v)) +} + +// CorrelationIDIsNil applies the IsNil predicate on the "correlation_id" field. +func CorrelationIDIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldCorrelationID)) +} + +// CorrelationIDNotNil applies the NotNil predicate on the "correlation_id" field. +func CorrelationIDNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldCorrelationID)) +} + +// CorrelationIDEqualFold applies the EqualFold predicate on the "correlation_id" field. +func CorrelationIDEqualFold(v string) predicate.Event { + return predicate.Event(sql.FieldEqualFold(FieldCorrelationID, v)) +} + +// CorrelationIDContainsFold applies the ContainsFold predicate on the "correlation_id" field. +func CorrelationIDContainsFold(v string) predicate.Event { + return predicate.Event(sql.FieldContainsFold(FieldCorrelationID, v)) +} + +// EventTypeEQ applies the EQ predicate on the "event_type" field. +func EventTypeEQ(v string) predicate.Event { + return predicate.Event(sql.FieldEQ(FieldEventType, v)) +} + +// EventTypeNEQ applies the NEQ predicate on the "event_type" field. +func EventTypeNEQ(v string) predicate.Event { + return predicate.Event(sql.FieldNEQ(FieldEventType, v)) +} + +// EventTypeIn applies the In predicate on the "event_type" field. +func EventTypeIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldIn(FieldEventType, vs...)) +} + +// EventTypeNotIn applies the NotIn predicate on the "event_type" field. +func EventTypeNotIn(vs ...string) predicate.Event { + return predicate.Event(sql.FieldNotIn(FieldEventType, vs...)) +} + +// EventTypeGT applies the GT predicate on the "event_type" field. +func EventTypeGT(v string) predicate.Event { + return predicate.Event(sql.FieldGT(FieldEventType, v)) +} + +// EventTypeGTE applies the GTE predicate on the "event_type" field. +func EventTypeGTE(v string) predicate.Event { + return predicate.Event(sql.FieldGTE(FieldEventType, v)) +} + +// EventTypeLT applies the LT predicate on the "event_type" field. +func EventTypeLT(v string) predicate.Event { + return predicate.Event(sql.FieldLT(FieldEventType, v)) +} + +// EventTypeLTE applies the LTE predicate on the "event_type" field. +func EventTypeLTE(v string) predicate.Event { + return predicate.Event(sql.FieldLTE(FieldEventType, v)) +} + +// EventTypeContains applies the Contains predicate on the "event_type" field. +func EventTypeContains(v string) predicate.Event { + return predicate.Event(sql.FieldContains(FieldEventType, v)) +} + +// EventTypeHasPrefix applies the HasPrefix predicate on the "event_type" field. +func EventTypeHasPrefix(v string) predicate.Event { + return predicate.Event(sql.FieldHasPrefix(FieldEventType, v)) +} + +// EventTypeHasSuffix applies the HasSuffix predicate on the "event_type" field. +func EventTypeHasSuffix(v string) predicate.Event { + return predicate.Event(sql.FieldHasSuffix(FieldEventType, v)) +} + +// EventTypeEqualFold applies the EqualFold predicate on the "event_type" field. +func EventTypeEqualFold(v string) predicate.Event { + return predicate.Event(sql.FieldEqualFold(FieldEventType, v)) +} + +// EventTypeContainsFold applies the ContainsFold predicate on the "event_type" field. +func EventTypeContainsFold(v string) predicate.Event { + return predicate.Event(sql.FieldContainsFold(FieldEventType, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.Event { + return predicate.Event(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.Event { + return predicate.Event(sql.FieldNotNull(FieldMetadata)) +} + +// HasUser applies the HasEdge predicate on the "user" edge. +func HasUser() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, UserTable, UserPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates). +func HasUserWith(preds ...predicate.User) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newUserStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasGroup applies the HasEdge predicate on the "group" edge. +func HasGroup() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, GroupTable, GroupPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates). +func HasGroupWith(preds ...predicate.Group) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newGroupStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasIntegration applies the HasEdge predicate on the "integration" edge. +func HasIntegration() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationTable, IntegrationPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasIntegrationWith applies the HasEdge predicate on the "integration" edge with a given conditions (other predicates). +func HasIntegrationWith(preds ...predicate.Integration) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newIntegrationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrganization applies the HasEdge predicate on the "organization" edge. +func HasOrganization() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationTable, OrganizationPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationWith applies the HasEdge predicate on the "organization" edge with a given conditions (other predicates). +func HasOrganizationWith(preds ...predicate.Organization) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newOrganizationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasInvite applies the HasEdge predicate on the "invite" edge. +func HasInvite() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, InviteTable, InvitePrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.InviteEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasInviteWith applies the HasEdge predicate on the "invite" edge with a given conditions (other predicates). +func HasInviteWith(preds ...predicate.Invite) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newInviteStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.InviteEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFeature applies the HasEdge predicate on the "feature" edge. +func HasFeature() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, FeatureTable, FeaturePrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.FeatureEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFeatureWith applies the HasEdge predicate on the "feature" edge with a given conditions (other predicates). +func HasFeatureWith(preds ...predicate.Feature) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newFeatureStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.FeatureEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitlementplan applies the HasEdge predicate on the "entitlementplan" edge. +func HasEntitlementplan() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitlementplanTable, EntitlementplanPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitlementplanWith applies the HasEdge predicate on the "entitlementplan" edge with a given conditions (other predicates). +func HasEntitlementplanWith(preds ...predicate.EntitlementPlan) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newEntitlementplanStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitlementplanfeature applies the HasEdge predicate on the "entitlementplanfeature" edge. +func HasEntitlementplanfeature() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitlementplanfeatureTable, EntitlementplanfeaturePrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitlementplanfeatureWith applies the HasEdge predicate on the "entitlementplanfeature" edge with a given conditions (other predicates). +func HasEntitlementplanfeatureWith(preds ...predicate.EntitlementPlanFeature) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newEntitlementplanfeatureStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasPersonalAccessToken applies the HasEdge predicate on the "personal_access_token" edge. +func HasPersonalAccessToken() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, PersonalAccessTokenTable, PersonalAccessTokenPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPersonalAccessTokenWith applies the HasEdge predicate on the "personal_access_token" edge with a given conditions (other predicates). +func HasPersonalAccessTokenWith(preds ...predicate.PersonalAccessToken) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newPersonalAccessTokenStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOauth2token applies the HasEdge predicate on the "oauth2token" edge. +func HasOauth2token() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, Oauth2tokenTable, Oauth2tokenPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOauth2tokenWith applies the HasEdge predicate on the "oauth2token" edge with a given conditions (other predicates). +func HasOauth2tokenWith(preds ...predicate.OhAuthTooToken) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newOauth2tokenStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasHush applies the HasEdge predicate on the "hush" edge. +func HasHush() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, HushTable, HushPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.HushEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasHushWith applies the HasEdge predicate on the "hush" edge with a given conditions (other predicates). +func HasHushWith(preds ...predicate.Hush) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newHushStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.HushEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrgmembership applies the HasEdge predicate on the "orgmembership" edge. +func HasOrgmembership() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrgmembershipTable, OrgmembershipPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembershipEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrgmembershipWith applies the HasEdge predicate on the "orgmembership" edge with a given conditions (other predicates). +func HasOrgmembershipWith(preds ...predicate.OrgMembership) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newOrgmembershipStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembershipEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasGroupmembership applies the HasEdge predicate on the "groupmembership" edge. +func HasGroupmembership() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, GroupmembershipTable, GroupmembershipPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembershipEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupmembershipWith applies the HasEdge predicate on the "groupmembership" edge with a given conditions (other predicates). +func HasGroupmembershipWith(preds ...predicate.GroupMembership) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newGroupmembershipStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembershipEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitlement applies the HasEdge predicate on the "entitlement" edge. +func HasEntitlement() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntitlementTable, EntitlementPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.EntitlementEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitlementWith applies the HasEdge predicate on the "entitlement" edge with a given conditions (other predicates). +func HasEntitlementWith(preds ...predicate.Entitlement) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newEntitlementStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.EntitlementEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasWebhook applies the HasEdge predicate on the "webhook" edge. +func HasWebhook() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, WebhookTable, WebhookPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.WebhookEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasWebhookWith applies the HasEdge predicate on the "webhook" edge with a given conditions (other predicates). +func HasWebhookWith(preds ...predicate.Webhook) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newWebhookStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.WebhookEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasSubscriber applies the HasEdge predicate on the "subscriber" edge. +func HasSubscriber() predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, SubscriberTable, SubscriberPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.SubscriberEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasSubscriberWith applies the HasEdge predicate on the "subscriber" edge with a given conditions (other predicates). +func HasSubscriberWith(preds ...predicate.Subscriber) predicate.Event { + return predicate.Event(func(s *sql.Selector) { + step := newSubscriberStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.SubscriberEvents + 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.Event) predicate.Event { + return predicate.Event(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Event) predicate.Event { + return predicate.Event(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Event) predicate.Event { + return predicate.Event(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/event_create.go b/internal/ent/generated/event_create.go new file mode 100644 index 0000000..5896549 --- /dev/null +++ b/internal/ent/generated/event_create.go @@ -0,0 +1,922 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webhook" +) + +// EventCreate is the builder for creating a Event entity. +type EventCreate struct { + config + mutation *EventMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate { + ec.mutation.SetCreatedAt(t) + return ec +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate { + if t != nil { + ec.SetCreatedAt(*t) + } + return ec +} + +// SetUpdatedAt sets the "updated_at" field. +func (ec *EventCreate) SetUpdatedAt(t time.Time) *EventCreate { + ec.mutation.SetUpdatedAt(t) + return ec +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ec *EventCreate) SetNillableUpdatedAt(t *time.Time) *EventCreate { + if t != nil { + ec.SetUpdatedAt(*t) + } + return ec +} + +// SetCreatedBy sets the "created_by" field. +func (ec *EventCreate) SetCreatedBy(s string) *EventCreate { + ec.mutation.SetCreatedBy(s) + return ec +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ec *EventCreate) SetNillableCreatedBy(s *string) *EventCreate { + if s != nil { + ec.SetCreatedBy(*s) + } + return ec +} + +// SetUpdatedBy sets the "updated_by" field. +func (ec *EventCreate) SetUpdatedBy(s string) *EventCreate { + ec.mutation.SetUpdatedBy(s) + return ec +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ec *EventCreate) SetNillableUpdatedBy(s *string) *EventCreate { + if s != nil { + ec.SetUpdatedBy(*s) + } + return ec +} + +// SetMappingID sets the "mapping_id" field. +func (ec *EventCreate) SetMappingID(s string) *EventCreate { + ec.mutation.SetMappingID(s) + return ec +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ec *EventCreate) SetNillableMappingID(s *string) *EventCreate { + if s != nil { + ec.SetMappingID(*s) + } + return ec +} + +// SetTags sets the "tags" field. +func (ec *EventCreate) SetTags(s []string) *EventCreate { + ec.mutation.SetTags(s) + return ec +} + +// SetEventID sets the "event_id" field. +func (ec *EventCreate) SetEventID(s string) *EventCreate { + ec.mutation.SetEventID(s) + return ec +} + +// SetNillableEventID sets the "event_id" field if the given value is not nil. +func (ec *EventCreate) SetNillableEventID(s *string) *EventCreate { + if s != nil { + ec.SetEventID(*s) + } + return ec +} + +// SetCorrelationID sets the "correlation_id" field. +func (ec *EventCreate) SetCorrelationID(s string) *EventCreate { + ec.mutation.SetCorrelationID(s) + return ec +} + +// SetNillableCorrelationID sets the "correlation_id" field if the given value is not nil. +func (ec *EventCreate) SetNillableCorrelationID(s *string) *EventCreate { + if s != nil { + ec.SetCorrelationID(*s) + } + return ec +} + +// SetEventType sets the "event_type" field. +func (ec *EventCreate) SetEventType(s string) *EventCreate { + ec.mutation.SetEventType(s) + return ec +} + +// SetMetadata sets the "metadata" field. +func (ec *EventCreate) SetMetadata(m map[string]interface{}) *EventCreate { + ec.mutation.SetMetadata(m) + return ec +} + +// SetID sets the "id" field. +func (ec *EventCreate) SetID(s string) *EventCreate { + ec.mutation.SetID(s) + return ec +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ec *EventCreate) SetNillableID(s *string) *EventCreate { + if s != nil { + ec.SetID(*s) + } + return ec +} + +// AddUserIDs adds the "user" edge to the User entity by IDs. +func (ec *EventCreate) AddUserIDs(ids ...string) *EventCreate { + ec.mutation.AddUserIDs(ids...) + return ec +} + +// AddUser adds the "user" edges to the User entity. +func (ec *EventCreate) AddUser(u ...*User) *EventCreate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return ec.AddUserIDs(ids...) +} + +// AddGroupIDs adds the "group" edge to the Group entity by IDs. +func (ec *EventCreate) AddGroupIDs(ids ...string) *EventCreate { + ec.mutation.AddGroupIDs(ids...) + return ec +} + +// AddGroup adds the "group" edges to the Group entity. +func (ec *EventCreate) AddGroup(g ...*Group) *EventCreate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return ec.AddGroupIDs(ids...) +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by IDs. +func (ec *EventCreate) AddIntegrationIDs(ids ...string) *EventCreate { + ec.mutation.AddIntegrationIDs(ids...) + return ec +} + +// AddIntegration adds the "integration" edges to the Integration entity. +func (ec *EventCreate) AddIntegration(i ...*Integration) *EventCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ec.AddIntegrationIDs(ids...) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (ec *EventCreate) AddOrganizationIDs(ids ...string) *EventCreate { + ec.mutation.AddOrganizationIDs(ids...) + return ec +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (ec *EventCreate) AddOrganization(o ...*Organization) *EventCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ec.AddOrganizationIDs(ids...) +} + +// AddInviteIDs adds the "invite" edge to the Invite entity by IDs. +func (ec *EventCreate) AddInviteIDs(ids ...string) *EventCreate { + ec.mutation.AddInviteIDs(ids...) + return ec +} + +// AddInvite adds the "invite" edges to the Invite entity. +func (ec *EventCreate) AddInvite(i ...*Invite) *EventCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ec.AddInviteIDs(ids...) +} + +// AddFeatureIDs adds the "feature" edge to the Feature entity by IDs. +func (ec *EventCreate) AddFeatureIDs(ids ...string) *EventCreate { + ec.mutation.AddFeatureIDs(ids...) + return ec +} + +// AddFeature adds the "feature" edges to the Feature entity. +func (ec *EventCreate) AddFeature(f ...*Feature) *EventCreate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ec.AddFeatureIDs(ids...) +} + +// AddEntitlementplanIDs adds the "entitlementplan" edge to the EntitlementPlan entity by IDs. +func (ec *EventCreate) AddEntitlementplanIDs(ids ...string) *EventCreate { + ec.mutation.AddEntitlementplanIDs(ids...) + return ec +} + +// AddEntitlementplan adds the "entitlementplan" edges to the EntitlementPlan entity. +func (ec *EventCreate) AddEntitlementplan(e ...*EntitlementPlan) *EventCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ec.AddEntitlementplanIDs(ids...) +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeature" edge to the EntitlementPlanFeature entity by IDs. +func (ec *EventCreate) AddEntitlementplanfeatureIDs(ids ...string) *EventCreate { + ec.mutation.AddEntitlementplanfeatureIDs(ids...) + return ec +} + +// AddEntitlementplanfeature adds the "entitlementplanfeature" edges to the EntitlementPlanFeature entity. +func (ec *EventCreate) AddEntitlementplanfeature(e ...*EntitlementPlanFeature) *EventCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ec.AddEntitlementplanfeatureIDs(ids...) +} + +// AddPersonalAccessTokenIDs adds the "personal_access_token" edge to the PersonalAccessToken entity by IDs. +func (ec *EventCreate) AddPersonalAccessTokenIDs(ids ...string) *EventCreate { + ec.mutation.AddPersonalAccessTokenIDs(ids...) + return ec +} + +// AddPersonalAccessToken adds the "personal_access_token" edges to the PersonalAccessToken entity. +func (ec *EventCreate) AddPersonalAccessToken(p ...*PersonalAccessToken) *EventCreate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return ec.AddPersonalAccessTokenIDs(ids...) +} + +// AddOauth2tokenIDs adds the "oauth2token" edge to the OhAuthTooToken entity by IDs. +func (ec *EventCreate) AddOauth2tokenIDs(ids ...string) *EventCreate { + ec.mutation.AddOauth2tokenIDs(ids...) + return ec +} + +// AddOauth2token adds the "oauth2token" edges to the OhAuthTooToken entity. +func (ec *EventCreate) AddOauth2token(o ...*OhAuthTooToken) *EventCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ec.AddOauth2tokenIDs(ids...) +} + +// AddHushIDs adds the "hush" edge to the Hush entity by IDs. +func (ec *EventCreate) AddHushIDs(ids ...string) *EventCreate { + ec.mutation.AddHushIDs(ids...) + return ec +} + +// AddHush adds the "hush" edges to the Hush entity. +func (ec *EventCreate) AddHush(h ...*Hush) *EventCreate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return ec.AddHushIDs(ids...) +} + +// AddOrgmembershipIDs adds the "orgmembership" edge to the OrgMembership entity by IDs. +func (ec *EventCreate) AddOrgmembershipIDs(ids ...string) *EventCreate { + ec.mutation.AddOrgmembershipIDs(ids...) + return ec +} + +// AddOrgmembership adds the "orgmembership" edges to the OrgMembership entity. +func (ec *EventCreate) AddOrgmembership(o ...*OrgMembership) *EventCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ec.AddOrgmembershipIDs(ids...) +} + +// AddGroupmembershipIDs adds the "groupmembership" edge to the GroupMembership entity by IDs. +func (ec *EventCreate) AddGroupmembershipIDs(ids ...string) *EventCreate { + ec.mutation.AddGroupmembershipIDs(ids...) + return ec +} + +// AddGroupmembership adds the "groupmembership" edges to the GroupMembership entity. +func (ec *EventCreate) AddGroupmembership(g ...*GroupMembership) *EventCreate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return ec.AddGroupmembershipIDs(ids...) +} + +// AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by IDs. +func (ec *EventCreate) AddEntitlementIDs(ids ...string) *EventCreate { + ec.mutation.AddEntitlementIDs(ids...) + return ec +} + +// AddEntitlement adds the "entitlement" edges to the Entitlement entity. +func (ec *EventCreate) AddEntitlement(e ...*Entitlement) *EventCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ec.AddEntitlementIDs(ids...) +} + +// AddWebhookIDs adds the "webhook" edge to the Webhook entity by IDs. +func (ec *EventCreate) AddWebhookIDs(ids ...string) *EventCreate { + ec.mutation.AddWebhookIDs(ids...) + return ec +} + +// AddWebhook adds the "webhook" edges to the Webhook entity. +func (ec *EventCreate) AddWebhook(w ...*Webhook) *EventCreate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return ec.AddWebhookIDs(ids...) +} + +// AddSubscriberIDs adds the "subscriber" edge to the Subscriber entity by IDs. +func (ec *EventCreate) AddSubscriberIDs(ids ...string) *EventCreate { + ec.mutation.AddSubscriberIDs(ids...) + return ec +} + +// AddSubscriber adds the "subscriber" edges to the Subscriber entity. +func (ec *EventCreate) AddSubscriber(s ...*Subscriber) *EventCreate { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return ec.AddSubscriberIDs(ids...) +} + +// Mutation returns the EventMutation object of the builder. +func (ec *EventCreate) Mutation() *EventMutation { + return ec.mutation +} + +// Save creates the Event in the database. +func (ec *EventCreate) Save(ctx context.Context) (*Event, error) { + if err := ec.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ec.sqlSave, ec.mutation, ec.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ec *EventCreate) SaveX(ctx context.Context) *Event { + v, err := ec.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ec *EventCreate) Exec(ctx context.Context) error { + _, err := ec.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ec *EventCreate) ExecX(ctx context.Context) { + if err := ec.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ec *EventCreate) defaults() error { + if _, ok := ec.mutation.CreatedAt(); !ok { + if event.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized event.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := event.DefaultCreatedAt() + ec.mutation.SetCreatedAt(v) + } + if _, ok := ec.mutation.UpdatedAt(); !ok { + if event.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized event.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := event.DefaultUpdatedAt() + ec.mutation.SetUpdatedAt(v) + } + if _, ok := ec.mutation.MappingID(); !ok { + if event.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized event.DefaultMappingID (forgotten import generated/runtime?)") + } + v := event.DefaultMappingID() + ec.mutation.SetMappingID(v) + } + if _, ok := ec.mutation.Tags(); !ok { + v := event.DefaultTags + ec.mutation.SetTags(v) + } + if _, ok := ec.mutation.ID(); !ok { + if event.DefaultID == nil { + return fmt.Errorf("generated: uninitialized event.DefaultID (forgotten import generated/runtime?)") + } + v := event.DefaultID() + ec.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ec *EventCreate) check() error { + if _, ok := ec.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Event.mapping_id"`)} + } + if _, ok := ec.mutation.EventType(); !ok { + return &ValidationError{Name: "event_type", err: errors.New(`generated: missing required field "Event.event_type"`)} + } + return nil +} + +func (ec *EventCreate) sqlSave(ctx context.Context) (*Event, error) { + if err := ec.check(); err != nil { + return nil, err + } + _node, _spec := ec.createSpec() + if err := sqlgraph.CreateNode(ctx, ec.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Event.ID type: %T", _spec.ID.Value) + } + } + ec.mutation.id = &_node.ID + ec.mutation.done = true + return _node, nil +} + +func (ec *EventCreate) createSpec() (*Event, *sqlgraph.CreateSpec) { + var ( + _node = &Event{config: ec.config} + _spec = sqlgraph.NewCreateSpec(event.Table, sqlgraph.NewFieldSpec(event.FieldID, field.TypeString)) + ) + _spec.Schema = ec.schemaConfig.Event + if id, ok := ec.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ec.mutation.CreatedAt(); ok { + _spec.SetField(event.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ec.mutation.UpdatedAt(); ok { + _spec.SetField(event.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ec.mutation.CreatedBy(); ok { + _spec.SetField(event.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ec.mutation.UpdatedBy(); ok { + _spec.SetField(event.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ec.mutation.MappingID(); ok { + _spec.SetField(event.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ec.mutation.Tags(); ok { + _spec.SetField(event.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ec.mutation.EventID(); ok { + _spec.SetField(event.FieldEventID, field.TypeString, value) + _node.EventID = value + } + if value, ok := ec.mutation.CorrelationID(); ok { + _spec.SetField(event.FieldCorrelationID, field.TypeString, value) + _node.CorrelationID = value + } + if value, ok := ec.mutation.EventType(); ok { + _spec.SetField(event.FieldEventType, field.TypeString, value) + _node.EventType = value + } + if value, ok := ec.mutation.Metadata(); ok { + _spec.SetField(event.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + if nodes := ec.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.IntegrationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.InviteIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.FeatureIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.EntitlementplanIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.EntitlementplanfeatureIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.PersonalAccessTokenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.Oauth2tokenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.HushIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.OrgmembershipIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.GroupmembershipIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.EntitlementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.WebhookIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ec.mutation.SubscriberIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = ec.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// EventCreateBulk is the builder for creating many Event entities in bulk. +type EventCreateBulk struct { + config + err error + builders []*EventCreate +} + +// Save creates the Event entities in the database. +func (ecb *EventCreateBulk) Save(ctx context.Context) ([]*Event, error) { + if ecb.err != nil { + return nil, ecb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ecb.builders)) + nodes := make([]*Event, len(ecb.builders)) + mutators := make([]Mutator, len(ecb.builders)) + for i := range ecb.builders { + func(i int, root context.Context) { + builder := ecb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EventMutation) + 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, ecb.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, ecb.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, ecb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ecb *EventCreateBulk) SaveX(ctx context.Context) []*Event { + v, err := ecb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ecb *EventCreateBulk) Exec(ctx context.Context) error { + _, err := ecb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ecb *EventCreateBulk) ExecX(ctx context.Context) { + if err := ecb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/event_delete.go b/internal/ent/generated/event_delete.go new file mode 100644 index 0000000..45ecc74 --- /dev/null +++ b/internal/ent/generated/event_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EventDelete is the builder for deleting a Event entity. +type EventDelete struct { + config + hooks []Hook + mutation *EventMutation +} + +// Where appends a list predicates to the EventDelete builder. +func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete { + ed.mutation.Where(ps...) + return ed +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ed *EventDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ed.sqlExec, ed.mutation, ed.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ed *EventDelete) ExecX(ctx context.Context) int { + n, err := ed.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ed *EventDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(event.Table, sqlgraph.NewFieldSpec(event.FieldID, field.TypeString)) + _spec.Node.Schema = ed.schemaConfig.Event + ctx = internal.NewSchemaConfigContext(ctx, ed.schemaConfig) + if ps := ed.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ed.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ed.mutation.done = true + return affected, err +} + +// EventDeleteOne is the builder for deleting a single Event entity. +type EventDeleteOne struct { + ed *EventDelete +} + +// Where appends a list predicates to the EventDelete builder. +func (edo *EventDeleteOne) Where(ps ...predicate.Event) *EventDeleteOne { + edo.ed.mutation.Where(ps...) + return edo +} + +// Exec executes the deletion query. +func (edo *EventDeleteOne) Exec(ctx context.Context) error { + n, err := edo.ed.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{event.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (edo *EventDeleteOne) ExecX(ctx context.Context) { + if err := edo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/event_query.go b/internal/ent/generated/event_query.go new file mode 100644 index 0000000..239e00d --- /dev/null +++ b/internal/ent/generated/event_query.go @@ -0,0 +1,2654 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EventQuery is the builder for querying Event entities. +type EventQuery struct { + config + ctx *QueryContext + order []event.OrderOption + inters []Interceptor + predicates []predicate.Event + withUser *UserQuery + withGroup *GroupQuery + withIntegration *IntegrationQuery + withOrganization *OrganizationQuery + withInvite *InviteQuery + withFeature *FeatureQuery + withEntitlementplan *EntitlementPlanQuery + withEntitlementplanfeature *EntitlementPlanFeatureQuery + withPersonalAccessToken *PersonalAccessTokenQuery + withOauth2token *OhAuthTooTokenQuery + withHush *HushQuery + withOrgmembership *OrgMembershipQuery + withGroupmembership *GroupMembershipQuery + withEntitlement *EntitlementQuery + withWebhook *WebhookQuery + withSubscriber *SubscriberQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Event) error + withNamedUser map[string]*UserQuery + withNamedGroup map[string]*GroupQuery + withNamedIntegration map[string]*IntegrationQuery + withNamedOrganization map[string]*OrganizationQuery + withNamedInvite map[string]*InviteQuery + withNamedFeature map[string]*FeatureQuery + withNamedEntitlementplan map[string]*EntitlementPlanQuery + withNamedEntitlementplanfeature map[string]*EntitlementPlanFeatureQuery + withNamedPersonalAccessToken map[string]*PersonalAccessTokenQuery + withNamedOauth2token map[string]*OhAuthTooTokenQuery + withNamedHush map[string]*HushQuery + withNamedOrgmembership map[string]*OrgMembershipQuery + withNamedGroupmembership map[string]*GroupMembershipQuery + withNamedEntitlement map[string]*EntitlementQuery + withNamedWebhook map[string]*WebhookQuery + withNamedSubscriber map[string]*SubscriberQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EventQuery builder. +func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery { + eq.predicates = append(eq.predicates, ps...) + return eq +} + +// Limit the number of records to be returned by this query. +func (eq *EventQuery) Limit(limit int) *EventQuery { + eq.ctx.Limit = &limit + return eq +} + +// Offset to start from. +func (eq *EventQuery) Offset(offset int) *EventQuery { + eq.ctx.Offset = &offset + return eq +} + +// 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 (eq *EventQuery) Unique(unique bool) *EventQuery { + eq.ctx.Unique = &unique + return eq +} + +// Order specifies how the records should be ordered. +func (eq *EventQuery) Order(o ...event.OrderOption) *EventQuery { + eq.order = append(eq.order, o...) + return eq +} + +// QueryUser chains the current query on the "user" edge. +func (eq *EventQuery) QueryUser() *UserQuery { + query := (&UserClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.UserTable, event.UserPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryGroup chains the current query on the "group" edge. +func (eq *EventQuery) QueryGroup() *GroupQuery { + query := (&GroupClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.GroupTable, event.GroupPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryIntegration chains the current query on the "integration" edge. +func (eq *EventQuery) QueryIntegration() *IntegrationQuery { + query := (&IntegrationClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.IntegrationTable, event.IntegrationPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrganization chains the current query on the "organization" edge. +func (eq *EventQuery) QueryOrganization() *OrganizationQuery { + query := (&OrganizationClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.OrganizationTable, event.OrganizationPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryInvite chains the current query on the "invite" edge. +func (eq *EventQuery) QueryInvite() *InviteQuery { + query := (&InviteClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(invite.Table, invite.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.InviteTable, event.InvitePrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.InviteEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFeature chains the current query on the "feature" edge. +func (eq *EventQuery) QueryFeature() *FeatureQuery { + query := (&FeatureClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.FeatureTable, event.FeaturePrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.FeatureEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitlementplan chains the current query on the "entitlementplan" edge. +func (eq *EventQuery) QueryEntitlementplan() *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.EntitlementplanTable, event.EntitlementplanPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitlementplanfeature chains the current query on the "entitlementplanfeature" edge. +func (eq *EventQuery) QueryEntitlementplanfeature() *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.EntitlementplanfeatureTable, event.EntitlementplanfeaturePrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeatureEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryPersonalAccessToken chains the current query on the "personal_access_token" edge. +func (eq *EventQuery) QueryPersonalAccessToken() *PersonalAccessTokenQuery { + query := (&PersonalAccessTokenClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(personalaccesstoken.Table, personalaccesstoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.PersonalAccessTokenTable, event.PersonalAccessTokenPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOauth2token chains the current query on the "oauth2token" edge. +func (eq *EventQuery) QueryOauth2token() *OhAuthTooTokenQuery { + query := (&OhAuthTooTokenClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(ohauthtootoken.Table, ohauthtootoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.Oauth2tokenTable, event.Oauth2tokenPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryHush chains the current query on the "hush" edge. +func (eq *EventQuery) QueryHush() *HushQuery { + query := (&HushClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(hush.Table, hush.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.HushTable, event.HushPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.HushEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrgmembership chains the current query on the "orgmembership" edge. +func (eq *EventQuery) QueryOrgmembership() *OrgMembershipQuery { + query := (&OrgMembershipClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(orgmembership.Table, orgmembership.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.OrgmembershipTable, event.OrgmembershipPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembershipEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryGroupmembership chains the current query on the "groupmembership" edge. +func (eq *EventQuery) QueryGroupmembership() *GroupMembershipQuery { + query := (&GroupMembershipClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(groupmembership.Table, groupmembership.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.GroupmembershipTable, event.GroupmembershipPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembershipEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitlement chains the current query on the "entitlement" edge. +func (eq *EventQuery) QueryEntitlement() *EntitlementQuery { + query := (&EntitlementClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.EntitlementTable, event.EntitlementPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.EntitlementEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryWebhook chains the current query on the "webhook" edge. +func (eq *EventQuery) QueryWebhook() *WebhookQuery { + query := (&WebhookClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(webhook.Table, webhook.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.WebhookTable, event.WebhookPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.WebhookEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QuerySubscriber chains the current query on the "subscriber" edge. +func (eq *EventQuery) QuerySubscriber() *SubscriberQuery { + query := (&SubscriberClient{config: eq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := eq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(event.Table, event.FieldID, selector), + sqlgraph.To(subscriber.Table, subscriber.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, event.SubscriberTable, event.SubscriberPrimaryKey...), + ) + schemaConfig := eq.schemaConfig + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.SubscriberEvents + fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Event entity from the query. +// Returns a *NotFoundError when no Event was found. +func (eq *EventQuery) First(ctx context.Context) (*Event, error) { + nodes, err := eq.Limit(1).All(setContextOp(ctx, eq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{event.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (eq *EventQuery) FirstX(ctx context.Context) *Event { + node, err := eq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Event ID from the query. +// Returns a *NotFoundError when no Event ID was found. +func (eq *EventQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = eq.Limit(1).IDs(setContextOp(ctx, eq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{event.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (eq *EventQuery) FirstIDX(ctx context.Context) string { + id, err := eq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Event entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Event entity is found. +// Returns a *NotFoundError when no Event entities are found. +func (eq *EventQuery) Only(ctx context.Context) (*Event, error) { + nodes, err := eq.Limit(2).All(setContextOp(ctx, eq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{event.Label} + default: + return nil, &NotSingularError{event.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (eq *EventQuery) OnlyX(ctx context.Context) *Event { + node, err := eq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Event ID in the query. +// Returns a *NotSingularError when more than one Event ID is found. +// Returns a *NotFoundError when no entities are found. +func (eq *EventQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = eq.Limit(2).IDs(setContextOp(ctx, eq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{event.Label} + default: + err = &NotSingularError{event.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (eq *EventQuery) OnlyIDX(ctx context.Context) string { + id, err := eq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Events. +func (eq *EventQuery) All(ctx context.Context) ([]*Event, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryAll) + if err := eq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Event, *EventQuery]() + return withInterceptors[[]*Event](ctx, eq, qr, eq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (eq *EventQuery) AllX(ctx context.Context) []*Event { + nodes, err := eq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Event IDs. +func (eq *EventQuery) IDs(ctx context.Context) (ids []string, err error) { + if eq.ctx.Unique == nil && eq.path != nil { + eq.Unique(true) + } + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryIDs) + if err = eq.Select(event.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (eq *EventQuery) IDsX(ctx context.Context) []string { + ids, err := eq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (eq *EventQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryCount) + if err := eq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, eq, querierCount[*EventQuery](), eq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (eq *EventQuery) CountX(ctx context.Context) int { + count, err := eq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (eq *EventQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, eq.ctx, ent.OpQueryExist) + switch _, err := eq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (eq *EventQuery) ExistX(ctx context.Context) bool { + exist, err := eq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EventQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (eq *EventQuery) Clone() *EventQuery { + if eq == nil { + return nil + } + return &EventQuery{ + config: eq.config, + ctx: eq.ctx.Clone(), + order: append([]event.OrderOption{}, eq.order...), + inters: append([]Interceptor{}, eq.inters...), + predicates: append([]predicate.Event{}, eq.predicates...), + withUser: eq.withUser.Clone(), + withGroup: eq.withGroup.Clone(), + withIntegration: eq.withIntegration.Clone(), + withOrganization: eq.withOrganization.Clone(), + withInvite: eq.withInvite.Clone(), + withFeature: eq.withFeature.Clone(), + withEntitlementplan: eq.withEntitlementplan.Clone(), + withEntitlementplanfeature: eq.withEntitlementplanfeature.Clone(), + withPersonalAccessToken: eq.withPersonalAccessToken.Clone(), + withOauth2token: eq.withOauth2token.Clone(), + withHush: eq.withHush.Clone(), + withOrgmembership: eq.withOrgmembership.Clone(), + withGroupmembership: eq.withGroupmembership.Clone(), + withEntitlement: eq.withEntitlement.Clone(), + withWebhook: eq.withWebhook.Clone(), + withSubscriber: eq.withSubscriber.Clone(), + // clone intermediate query. + sql: eq.sql.Clone(), + path: eq.path, + } +} + +// WithUser tells the query-builder to eager-load the nodes that are connected to +// the "user" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithUser(opts ...func(*UserQuery)) *EventQuery { + query := (&UserClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withUser = query + return eq +} + +// WithGroup tells the query-builder to eager-load the nodes that are connected to +// the "group" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithGroup(opts ...func(*GroupQuery)) *EventQuery { + query := (&GroupClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withGroup = query + return eq +} + +// WithIntegration tells the query-builder to eager-load the nodes that are connected to +// the "integration" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithIntegration(opts ...func(*IntegrationQuery)) *EventQuery { + query := (&IntegrationClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withIntegration = query + return eq +} + +// WithOrganization tells the query-builder to eager-load the nodes that are connected to +// the "organization" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithOrganization(opts ...func(*OrganizationQuery)) *EventQuery { + query := (&OrganizationClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withOrganization = query + return eq +} + +// WithInvite tells the query-builder to eager-load the nodes that are connected to +// the "invite" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithInvite(opts ...func(*InviteQuery)) *EventQuery { + query := (&InviteClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withInvite = query + return eq +} + +// WithFeature tells the query-builder to eager-load the nodes that are connected to +// the "feature" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithFeature(opts ...func(*FeatureQuery)) *EventQuery { + query := (&FeatureClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withFeature = query + return eq +} + +// WithEntitlementplan tells the query-builder to eager-load the nodes that are connected to +// the "entitlementplan" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithEntitlementplan(opts ...func(*EntitlementPlanQuery)) *EventQuery { + query := (&EntitlementPlanClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withEntitlementplan = query + return eq +} + +// WithEntitlementplanfeature tells the query-builder to eager-load the nodes that are connected to +// the "entitlementplanfeature" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithEntitlementplanfeature(opts ...func(*EntitlementPlanFeatureQuery)) *EventQuery { + query := (&EntitlementPlanFeatureClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withEntitlementplanfeature = query + return eq +} + +// WithPersonalAccessToken tells the query-builder to eager-load the nodes that are connected to +// the "personal_access_token" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithPersonalAccessToken(opts ...func(*PersonalAccessTokenQuery)) *EventQuery { + query := (&PersonalAccessTokenClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withPersonalAccessToken = query + return eq +} + +// WithOauth2token tells the query-builder to eager-load the nodes that are connected to +// the "oauth2token" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithOauth2token(opts ...func(*OhAuthTooTokenQuery)) *EventQuery { + query := (&OhAuthTooTokenClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withOauth2token = query + return eq +} + +// WithHush tells the query-builder to eager-load the nodes that are connected to +// the "hush" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithHush(opts ...func(*HushQuery)) *EventQuery { + query := (&HushClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withHush = query + return eq +} + +// WithOrgmembership tells the query-builder to eager-load the nodes that are connected to +// the "orgmembership" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithOrgmembership(opts ...func(*OrgMembershipQuery)) *EventQuery { + query := (&OrgMembershipClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withOrgmembership = query + return eq +} + +// WithGroupmembership tells the query-builder to eager-load the nodes that are connected to +// the "groupmembership" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithGroupmembership(opts ...func(*GroupMembershipQuery)) *EventQuery { + query := (&GroupMembershipClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withGroupmembership = query + return eq +} + +// WithEntitlement tells the query-builder to eager-load the nodes that are connected to +// the "entitlement" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithEntitlement(opts ...func(*EntitlementQuery)) *EventQuery { + query := (&EntitlementClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withEntitlement = query + return eq +} + +// WithWebhook tells the query-builder to eager-load the nodes that are connected to +// the "webhook" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithWebhook(opts ...func(*WebhookQuery)) *EventQuery { + query := (&WebhookClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withWebhook = query + return eq +} + +// WithSubscriber tells the query-builder to eager-load the nodes that are connected to +// the "subscriber" edge. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithSubscriber(opts ...func(*SubscriberQuery)) *EventQuery { + query := (&SubscriberClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + eq.withSubscriber = query + return eq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Event.Query(). +// GroupBy(event.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy { + eq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EventGroupBy{build: eq} + grbuild.flds = &eq.ctx.Fields + grbuild.label = event.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Event.Query(). +// Select(event.FieldCreatedAt). +// Scan(ctx, &v) +func (eq *EventQuery) Select(fields ...string) *EventSelect { + eq.ctx.Fields = append(eq.ctx.Fields, fields...) + sbuild := &EventSelect{EventQuery: eq} + sbuild.label = event.Label + sbuild.flds, sbuild.scan = &eq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EventSelect configured with the given aggregations. +func (eq *EventQuery) Aggregate(fns ...AggregateFunc) *EventSelect { + return eq.Select().Aggregate(fns...) +} + +func (eq *EventQuery) prepareQuery(ctx context.Context) error { + for _, inter := range eq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, eq); err != nil { + return err + } + } + } + for _, f := range eq.ctx.Fields { + if !event.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if eq.path != nil { + prev, err := eq.path(ctx) + if err != nil { + return err + } + eq.sql = prev + } + return nil +} + +func (eq *EventQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Event, error) { + var ( + nodes = []*Event{} + _spec = eq.querySpec() + loadedTypes = [16]bool{ + eq.withUser != nil, + eq.withGroup != nil, + eq.withIntegration != nil, + eq.withOrganization != nil, + eq.withInvite != nil, + eq.withFeature != nil, + eq.withEntitlementplan != nil, + eq.withEntitlementplanfeature != nil, + eq.withPersonalAccessToken != nil, + eq.withOauth2token != nil, + eq.withHush != nil, + eq.withOrgmembership != nil, + eq.withGroupmembership != nil, + eq.withEntitlement != nil, + eq.withWebhook != nil, + eq.withSubscriber != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Event).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Event{config: eq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = eq.schemaConfig.Event + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + if len(eq.modifiers) > 0 { + _spec.Modifiers = eq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, eq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := eq.withUser; query != nil { + if err := eq.loadUser(ctx, query, nodes, + func(n *Event) { n.Edges.User = []*User{} }, + func(n *Event, e *User) { n.Edges.User = append(n.Edges.User, e) }); err != nil { + return nil, err + } + } + if query := eq.withGroup; query != nil { + if err := eq.loadGroup(ctx, query, nodes, + func(n *Event) { n.Edges.Group = []*Group{} }, + func(n *Event, e *Group) { n.Edges.Group = append(n.Edges.Group, e) }); err != nil { + return nil, err + } + } + if query := eq.withIntegration; query != nil { + if err := eq.loadIntegration(ctx, query, nodes, + func(n *Event) { n.Edges.Integration = []*Integration{} }, + func(n *Event, e *Integration) { n.Edges.Integration = append(n.Edges.Integration, e) }); err != nil { + return nil, err + } + } + if query := eq.withOrganization; query != nil { + if err := eq.loadOrganization(ctx, query, nodes, + func(n *Event) { n.Edges.Organization = []*Organization{} }, + func(n *Event, e *Organization) { n.Edges.Organization = append(n.Edges.Organization, e) }); err != nil { + return nil, err + } + } + if query := eq.withInvite; query != nil { + if err := eq.loadInvite(ctx, query, nodes, + func(n *Event) { n.Edges.Invite = []*Invite{} }, + func(n *Event, e *Invite) { n.Edges.Invite = append(n.Edges.Invite, e) }); err != nil { + return nil, err + } + } + if query := eq.withFeature; query != nil { + if err := eq.loadFeature(ctx, query, nodes, + func(n *Event) { n.Edges.Feature = []*Feature{} }, + func(n *Event, e *Feature) { n.Edges.Feature = append(n.Edges.Feature, e) }); err != nil { + return nil, err + } + } + if query := eq.withEntitlementplan; query != nil { + if err := eq.loadEntitlementplan(ctx, query, nodes, + func(n *Event) { n.Edges.Entitlementplan = []*EntitlementPlan{} }, + func(n *Event, e *EntitlementPlan) { n.Edges.Entitlementplan = append(n.Edges.Entitlementplan, e) }); err != nil { + return nil, err + } + } + if query := eq.withEntitlementplanfeature; query != nil { + if err := eq.loadEntitlementplanfeature(ctx, query, nodes, + func(n *Event) { n.Edges.Entitlementplanfeature = []*EntitlementPlanFeature{} }, + func(n *Event, e *EntitlementPlanFeature) { + n.Edges.Entitlementplanfeature = append(n.Edges.Entitlementplanfeature, e) + }); err != nil { + return nil, err + } + } + if query := eq.withPersonalAccessToken; query != nil { + if err := eq.loadPersonalAccessToken(ctx, query, nodes, + func(n *Event) { n.Edges.PersonalAccessToken = []*PersonalAccessToken{} }, + func(n *Event, e *PersonalAccessToken) { + n.Edges.PersonalAccessToken = append(n.Edges.PersonalAccessToken, e) + }); err != nil { + return nil, err + } + } + if query := eq.withOauth2token; query != nil { + if err := eq.loadOauth2token(ctx, query, nodes, + func(n *Event) { n.Edges.Oauth2token = []*OhAuthTooToken{} }, + func(n *Event, e *OhAuthTooToken) { n.Edges.Oauth2token = append(n.Edges.Oauth2token, e) }); err != nil { + return nil, err + } + } + if query := eq.withHush; query != nil { + if err := eq.loadHush(ctx, query, nodes, + func(n *Event) { n.Edges.Hush = []*Hush{} }, + func(n *Event, e *Hush) { n.Edges.Hush = append(n.Edges.Hush, e) }); err != nil { + return nil, err + } + } + if query := eq.withOrgmembership; query != nil { + if err := eq.loadOrgmembership(ctx, query, nodes, + func(n *Event) { n.Edges.Orgmembership = []*OrgMembership{} }, + func(n *Event, e *OrgMembership) { n.Edges.Orgmembership = append(n.Edges.Orgmembership, e) }); err != nil { + return nil, err + } + } + if query := eq.withGroupmembership; query != nil { + if err := eq.loadGroupmembership(ctx, query, nodes, + func(n *Event) { n.Edges.Groupmembership = []*GroupMembership{} }, + func(n *Event, e *GroupMembership) { n.Edges.Groupmembership = append(n.Edges.Groupmembership, e) }); err != nil { + return nil, err + } + } + if query := eq.withEntitlement; query != nil { + if err := eq.loadEntitlement(ctx, query, nodes, + func(n *Event) { n.Edges.Entitlement = []*Entitlement{} }, + func(n *Event, e *Entitlement) { n.Edges.Entitlement = append(n.Edges.Entitlement, e) }); err != nil { + return nil, err + } + } + if query := eq.withWebhook; query != nil { + if err := eq.loadWebhook(ctx, query, nodes, + func(n *Event) { n.Edges.Webhook = []*Webhook{} }, + func(n *Event, e *Webhook) { n.Edges.Webhook = append(n.Edges.Webhook, e) }); err != nil { + return nil, err + } + } + if query := eq.withSubscriber; query != nil { + if err := eq.loadSubscriber(ctx, query, nodes, + func(n *Event) { n.Edges.Subscriber = []*Subscriber{} }, + func(n *Event, e *Subscriber) { n.Edges.Subscriber = append(n.Edges.Subscriber, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedUser { + if err := eq.loadUser(ctx, query, nodes, + func(n *Event) { n.appendNamedUser(name) }, + func(n *Event, e *User) { n.appendNamedUser(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedGroup { + if err := eq.loadGroup(ctx, query, nodes, + func(n *Event) { n.appendNamedGroup(name) }, + func(n *Event, e *Group) { n.appendNamedGroup(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedIntegration { + if err := eq.loadIntegration(ctx, query, nodes, + func(n *Event) { n.appendNamedIntegration(name) }, + func(n *Event, e *Integration) { n.appendNamedIntegration(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedOrganization { + if err := eq.loadOrganization(ctx, query, nodes, + func(n *Event) { n.appendNamedOrganization(name) }, + func(n *Event, e *Organization) { n.appendNamedOrganization(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedInvite { + if err := eq.loadInvite(ctx, query, nodes, + func(n *Event) { n.appendNamedInvite(name) }, + func(n *Event, e *Invite) { n.appendNamedInvite(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedFeature { + if err := eq.loadFeature(ctx, query, nodes, + func(n *Event) { n.appendNamedFeature(name) }, + func(n *Event, e *Feature) { n.appendNamedFeature(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedEntitlementplan { + if err := eq.loadEntitlementplan(ctx, query, nodes, + func(n *Event) { n.appendNamedEntitlementplan(name) }, + func(n *Event, e *EntitlementPlan) { n.appendNamedEntitlementplan(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedEntitlementplanfeature { + if err := eq.loadEntitlementplanfeature(ctx, query, nodes, + func(n *Event) { n.appendNamedEntitlementplanfeature(name) }, + func(n *Event, e *EntitlementPlanFeature) { n.appendNamedEntitlementplanfeature(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedPersonalAccessToken { + if err := eq.loadPersonalAccessToken(ctx, query, nodes, + func(n *Event) { n.appendNamedPersonalAccessToken(name) }, + func(n *Event, e *PersonalAccessToken) { n.appendNamedPersonalAccessToken(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedOauth2token { + if err := eq.loadOauth2token(ctx, query, nodes, + func(n *Event) { n.appendNamedOauth2token(name) }, + func(n *Event, e *OhAuthTooToken) { n.appendNamedOauth2token(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedHush { + if err := eq.loadHush(ctx, query, nodes, + func(n *Event) { n.appendNamedHush(name) }, + func(n *Event, e *Hush) { n.appendNamedHush(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedOrgmembership { + if err := eq.loadOrgmembership(ctx, query, nodes, + func(n *Event) { n.appendNamedOrgmembership(name) }, + func(n *Event, e *OrgMembership) { n.appendNamedOrgmembership(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedGroupmembership { + if err := eq.loadGroupmembership(ctx, query, nodes, + func(n *Event) { n.appendNamedGroupmembership(name) }, + func(n *Event, e *GroupMembership) { n.appendNamedGroupmembership(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedEntitlement { + if err := eq.loadEntitlement(ctx, query, nodes, + func(n *Event) { n.appendNamedEntitlement(name) }, + func(n *Event, e *Entitlement) { n.appendNamedEntitlement(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedWebhook { + if err := eq.loadWebhook(ctx, query, nodes, + func(n *Event) { n.appendNamedWebhook(name) }, + func(n *Event, e *Webhook) { n.appendNamedWebhook(name, e) }); err != nil { + return nil, err + } + } + for name, query := range eq.withNamedSubscriber { + if err := eq.loadSubscriber(ctx, query, nodes, + func(n *Event) { n.appendNamedSubscriber(name) }, + func(n *Event, e *Subscriber) { n.appendNamedSubscriber(name, e) }); err != nil { + return nil, err + } + } + for i := range eq.loadTotal { + if err := eq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (eq *EventQuery) loadUser(ctx context.Context, query *UserQuery, nodes []*Event, init func(*Event), assign func(*Event, *User)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.UserTable) + joinT.Schema(eq.schemaConfig.UserEvents) + s.Join(joinT).On(s.C(user.FieldID), joinT.C(event.UserPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.UserPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.UserPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*User](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "user" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []*Event, init func(*Event), assign func(*Event, *Group)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.GroupTable) + joinT.Schema(eq.schemaConfig.GroupEvents) + s.Join(joinT).On(s.C(group.FieldID), joinT.C(event.GroupPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.GroupPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.GroupPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Group](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "group" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadIntegration(ctx context.Context, query *IntegrationQuery, nodes []*Event, init func(*Event), assign func(*Event, *Integration)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.IntegrationTable) + joinT.Schema(eq.schemaConfig.IntegrationEvents) + s.Join(joinT).On(s.C(integration.FieldID), joinT.C(event.IntegrationPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.IntegrationPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.IntegrationPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Integration](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "integration" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadOrganization(ctx context.Context, query *OrganizationQuery, nodes []*Event, init func(*Event), assign func(*Event, *Organization)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.OrganizationTable) + joinT.Schema(eq.schemaConfig.OrganizationEvents) + s.Join(joinT).On(s.C(organization.FieldID), joinT.C(event.OrganizationPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.OrganizationPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.OrganizationPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Organization](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "organization" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadInvite(ctx context.Context, query *InviteQuery, nodes []*Event, init func(*Event), assign func(*Event, *Invite)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.InviteTable) + joinT.Schema(eq.schemaConfig.InviteEvents) + s.Join(joinT).On(s.C(invite.FieldID), joinT.C(event.InvitePrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.InvitePrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.InvitePrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Invite](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "invite" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadFeature(ctx context.Context, query *FeatureQuery, nodes []*Event, init func(*Event), assign func(*Event, *Feature)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.FeatureTable) + joinT.Schema(eq.schemaConfig.FeatureEvents) + s.Join(joinT).On(s.C(feature.FieldID), joinT.C(event.FeaturePrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.FeaturePrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.FeaturePrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Feature](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "feature" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadEntitlementplan(ctx context.Context, query *EntitlementPlanQuery, nodes []*Event, init func(*Event), assign func(*Event, *EntitlementPlan)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.EntitlementplanTable) + joinT.Schema(eq.schemaConfig.EntitlementPlanEvents) + s.Join(joinT).On(s.C(entitlementplan.FieldID), joinT.C(event.EntitlementplanPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.EntitlementplanPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.EntitlementplanPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*EntitlementPlan](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "entitlementplan" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadEntitlementplanfeature(ctx context.Context, query *EntitlementPlanFeatureQuery, nodes []*Event, init func(*Event), assign func(*Event, *EntitlementPlanFeature)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.EntitlementplanfeatureTable) + joinT.Schema(eq.schemaConfig.EntitlementPlanFeatureEvents) + s.Join(joinT).On(s.C(entitlementplanfeature.FieldID), joinT.C(event.EntitlementplanfeaturePrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.EntitlementplanfeaturePrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.EntitlementplanfeaturePrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*EntitlementPlanFeature](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "entitlementplanfeature" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadPersonalAccessToken(ctx context.Context, query *PersonalAccessTokenQuery, nodes []*Event, init func(*Event), assign func(*Event, *PersonalAccessToken)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.PersonalAccessTokenTable) + joinT.Schema(eq.schemaConfig.PersonalAccessTokenEvents) + s.Join(joinT).On(s.C(personalaccesstoken.FieldID), joinT.C(event.PersonalAccessTokenPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.PersonalAccessTokenPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.PersonalAccessTokenPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*PersonalAccessToken](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "personal_access_token" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadOauth2token(ctx context.Context, query *OhAuthTooTokenQuery, nodes []*Event, init func(*Event), assign func(*Event, *OhAuthTooToken)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.Oauth2tokenTable) + joinT.Schema(eq.schemaConfig.OhAuthTooTokenEvents) + s.Join(joinT).On(s.C(ohauthtootoken.FieldID), joinT.C(event.Oauth2tokenPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.Oauth2tokenPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.Oauth2tokenPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*OhAuthTooToken](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "oauth2token" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadHush(ctx context.Context, query *HushQuery, nodes []*Event, init func(*Event), assign func(*Event, *Hush)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.HushTable) + joinT.Schema(eq.schemaConfig.HushEvents) + s.Join(joinT).On(s.C(hush.FieldID), joinT.C(event.HushPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.HushPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.HushPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Hush](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "hush" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadOrgmembership(ctx context.Context, query *OrgMembershipQuery, nodes []*Event, init func(*Event), assign func(*Event, *OrgMembership)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.OrgmembershipTable) + joinT.Schema(eq.schemaConfig.OrgMembershipEvents) + s.Join(joinT).On(s.C(orgmembership.FieldID), joinT.C(event.OrgmembershipPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.OrgmembershipPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.OrgmembershipPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*OrgMembership](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "orgmembership" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadGroupmembership(ctx context.Context, query *GroupMembershipQuery, nodes []*Event, init func(*Event), assign func(*Event, *GroupMembership)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.GroupmembershipTable) + joinT.Schema(eq.schemaConfig.GroupMembershipEvents) + s.Join(joinT).On(s.C(groupmembership.FieldID), joinT.C(event.GroupmembershipPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.GroupmembershipPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.GroupmembershipPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*GroupMembership](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "groupmembership" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadEntitlement(ctx context.Context, query *EntitlementQuery, nodes []*Event, init func(*Event), assign func(*Event, *Entitlement)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.EntitlementTable) + joinT.Schema(eq.schemaConfig.EntitlementEvents) + s.Join(joinT).On(s.C(entitlement.FieldID), joinT.C(event.EntitlementPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.EntitlementPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.EntitlementPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Entitlement](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "entitlement" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadWebhook(ctx context.Context, query *WebhookQuery, nodes []*Event, init func(*Event), assign func(*Event, *Webhook)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.WebhookTable) + joinT.Schema(eq.schemaConfig.WebhookEvents) + s.Join(joinT).On(s.C(webhook.FieldID), joinT.C(event.WebhookPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.WebhookPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.WebhookPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Webhook](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "webhook" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (eq *EventQuery) loadSubscriber(ctx context.Context, query *SubscriberQuery, nodes []*Event, init func(*Event), assign func(*Event, *Subscriber)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Event) + nids := make(map[string]map[*Event]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(event.SubscriberTable) + joinT.Schema(eq.schemaConfig.SubscriberEvents) + s.Join(joinT).On(s.C(subscriber.FieldID), joinT.C(event.SubscriberPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(event.SubscriberPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(event.SubscriberPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Event]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Subscriber](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "subscriber" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (eq *EventQuery) sqlCount(ctx context.Context) (int, error) { + _spec := eq.querySpec() + _spec.Node.Schema = eq.schemaConfig.Event + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + if len(eq.modifiers) > 0 { + _spec.Modifiers = eq.modifiers + } + _spec.Node.Columns = eq.ctx.Fields + if len(eq.ctx.Fields) > 0 { + _spec.Unique = eq.ctx.Unique != nil && *eq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, eq.driver, _spec) +} + +func (eq *EventQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(event.Table, event.Columns, sqlgraph.NewFieldSpec(event.FieldID, field.TypeString)) + _spec.From = eq.sql + if unique := eq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if eq.path != nil { + _spec.Unique = true + } + if fields := eq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, event.FieldID) + for i := range fields { + if fields[i] != event.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := eq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := eq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := eq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := eq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (eq *EventQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(eq.driver.Dialect()) + t1 := builder.Table(event.Table) + columns := eq.ctx.Fields + if len(columns) == 0 { + columns = event.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if eq.sql != nil { + selector = eq.sql + selector.Select(selector.Columns(columns...)...) + } + if eq.ctx.Unique != nil && *eq.ctx.Unique { + selector.Distinct() + } + t1.Schema(eq.schemaConfig.Event) + ctx = internal.NewSchemaConfigContext(ctx, eq.schemaConfig) + selector.WithContext(ctx) + for _, p := range eq.predicates { + p(selector) + } + for _, p := range eq.order { + p(selector) + } + if offset := eq.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 := eq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedUser tells the query-builder to eager-load the nodes that are connected to the "user" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedUser(name string, opts ...func(*UserQuery)) *EventQuery { + query := (&UserClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedUser == nil { + eq.withNamedUser = make(map[string]*UserQuery) + } + eq.withNamedUser[name] = query + return eq +} + +// WithNamedGroup tells the query-builder to eager-load the nodes that are connected to the "group" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedGroup(name string, opts ...func(*GroupQuery)) *EventQuery { + query := (&GroupClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedGroup == nil { + eq.withNamedGroup = make(map[string]*GroupQuery) + } + eq.withNamedGroup[name] = query + return eq +} + +// WithNamedIntegration tells the query-builder to eager-load the nodes that are connected to the "integration" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedIntegration(name string, opts ...func(*IntegrationQuery)) *EventQuery { + query := (&IntegrationClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedIntegration == nil { + eq.withNamedIntegration = make(map[string]*IntegrationQuery) + } + eq.withNamedIntegration[name] = query + return eq +} + +// WithNamedOrganization tells the query-builder to eager-load the nodes that are connected to the "organization" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedOrganization(name string, opts ...func(*OrganizationQuery)) *EventQuery { + query := (&OrganizationClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedOrganization == nil { + eq.withNamedOrganization = make(map[string]*OrganizationQuery) + } + eq.withNamedOrganization[name] = query + return eq +} + +// WithNamedInvite tells the query-builder to eager-load the nodes that are connected to the "invite" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedInvite(name string, opts ...func(*InviteQuery)) *EventQuery { + query := (&InviteClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedInvite == nil { + eq.withNamedInvite = make(map[string]*InviteQuery) + } + eq.withNamedInvite[name] = query + return eq +} + +// WithNamedFeature tells the query-builder to eager-load the nodes that are connected to the "feature" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedFeature(name string, opts ...func(*FeatureQuery)) *EventQuery { + query := (&FeatureClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedFeature == nil { + eq.withNamedFeature = make(map[string]*FeatureQuery) + } + eq.withNamedFeature[name] = query + return eq +} + +// WithNamedEntitlementplan tells the query-builder to eager-load the nodes that are connected to the "entitlementplan" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedEntitlementplan(name string, opts ...func(*EntitlementPlanQuery)) *EventQuery { + query := (&EntitlementPlanClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedEntitlementplan == nil { + eq.withNamedEntitlementplan = make(map[string]*EntitlementPlanQuery) + } + eq.withNamedEntitlementplan[name] = query + return eq +} + +// WithNamedEntitlementplanfeature tells the query-builder to eager-load the nodes that are connected to the "entitlementplanfeature" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedEntitlementplanfeature(name string, opts ...func(*EntitlementPlanFeatureQuery)) *EventQuery { + query := (&EntitlementPlanFeatureClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedEntitlementplanfeature == nil { + eq.withNamedEntitlementplanfeature = make(map[string]*EntitlementPlanFeatureQuery) + } + eq.withNamedEntitlementplanfeature[name] = query + return eq +} + +// WithNamedPersonalAccessToken tells the query-builder to eager-load the nodes that are connected to the "personal_access_token" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedPersonalAccessToken(name string, opts ...func(*PersonalAccessTokenQuery)) *EventQuery { + query := (&PersonalAccessTokenClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedPersonalAccessToken == nil { + eq.withNamedPersonalAccessToken = make(map[string]*PersonalAccessTokenQuery) + } + eq.withNamedPersonalAccessToken[name] = query + return eq +} + +// WithNamedOauth2token tells the query-builder to eager-load the nodes that are connected to the "oauth2token" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedOauth2token(name string, opts ...func(*OhAuthTooTokenQuery)) *EventQuery { + query := (&OhAuthTooTokenClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedOauth2token == nil { + eq.withNamedOauth2token = make(map[string]*OhAuthTooTokenQuery) + } + eq.withNamedOauth2token[name] = query + return eq +} + +// WithNamedHush tells the query-builder to eager-load the nodes that are connected to the "hush" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedHush(name string, opts ...func(*HushQuery)) *EventQuery { + query := (&HushClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedHush == nil { + eq.withNamedHush = make(map[string]*HushQuery) + } + eq.withNamedHush[name] = query + return eq +} + +// WithNamedOrgmembership tells the query-builder to eager-load the nodes that are connected to the "orgmembership" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedOrgmembership(name string, opts ...func(*OrgMembershipQuery)) *EventQuery { + query := (&OrgMembershipClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedOrgmembership == nil { + eq.withNamedOrgmembership = make(map[string]*OrgMembershipQuery) + } + eq.withNamedOrgmembership[name] = query + return eq +} + +// WithNamedGroupmembership tells the query-builder to eager-load the nodes that are connected to the "groupmembership" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedGroupmembership(name string, opts ...func(*GroupMembershipQuery)) *EventQuery { + query := (&GroupMembershipClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedGroupmembership == nil { + eq.withNamedGroupmembership = make(map[string]*GroupMembershipQuery) + } + eq.withNamedGroupmembership[name] = query + return eq +} + +// WithNamedEntitlement tells the query-builder to eager-load the nodes that are connected to the "entitlement" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedEntitlement(name string, opts ...func(*EntitlementQuery)) *EventQuery { + query := (&EntitlementClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedEntitlement == nil { + eq.withNamedEntitlement = make(map[string]*EntitlementQuery) + } + eq.withNamedEntitlement[name] = query + return eq +} + +// WithNamedWebhook tells the query-builder to eager-load the nodes that are connected to the "webhook" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedWebhook(name string, opts ...func(*WebhookQuery)) *EventQuery { + query := (&WebhookClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedWebhook == nil { + eq.withNamedWebhook = make(map[string]*WebhookQuery) + } + eq.withNamedWebhook[name] = query + return eq +} + +// WithNamedSubscriber tells the query-builder to eager-load the nodes that are connected to the "subscriber" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (eq *EventQuery) WithNamedSubscriber(name string, opts ...func(*SubscriberQuery)) *EventQuery { + query := (&SubscriberClient{config: eq.config}).Query() + for _, opt := range opts { + opt(query) + } + if eq.withNamedSubscriber == nil { + eq.withNamedSubscriber = make(map[string]*SubscriberQuery) + } + eq.withNamedSubscriber[name] = query + return eq +} + +// EventGroupBy is the group-by builder for Event entities. +type EventGroupBy struct { + selector + build *EventQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy { + egb.fns = append(egb.fns, fns...) + return egb +} + +// Scan applies the selector query and scans the result into the given value. +func (egb *EventGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, egb.build.ctx, ent.OpQueryGroupBy) + if err := egb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EventQuery, *EventGroupBy](ctx, egb.build, egb, egb.build.inters, v) +} + +func (egb *EventGroupBy) sqlScan(ctx context.Context, root *EventQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(egb.fns)) + for _, fn := range egb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*egb.flds)+len(egb.fns)) + for _, f := range *egb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*egb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := egb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EventSelect is the builder for selecting fields of Event entities. +type EventSelect struct { + *EventQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (es *EventSelect) Aggregate(fns ...AggregateFunc) *EventSelect { + es.fns = append(es.fns, fns...) + return es +} + +// Scan applies the selector query and scans the result into the given value. +func (es *EventSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, es.ctx, ent.OpQuerySelect) + if err := es.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EventQuery, *EventSelect](ctx, es.EventQuery, es, es.inters, v) +} + +func (es *EventSelect) sqlScan(ctx context.Context, root *EventQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(es.fns)) + for _, fn := range es.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*es.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 := es.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/event_update.go b/internal/ent/generated/event_update.go new file mode 100644 index 0000000..84a2054 --- /dev/null +++ b/internal/ent/generated/event_update.go @@ -0,0 +1,3249 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EventUpdate is the builder for updating Event entities. +type EventUpdate struct { + config + hooks []Hook + mutation *EventMutation +} + +// Where appends a list predicates to the EventUpdate builder. +func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate { + eu.mutation.Where(ps...) + return eu +} + +// SetUpdatedAt sets the "updated_at" field. +func (eu *EventUpdate) SetUpdatedAt(t time.Time) *EventUpdate { + eu.mutation.SetUpdatedAt(t) + return eu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (eu *EventUpdate) ClearUpdatedAt() *EventUpdate { + eu.mutation.ClearUpdatedAt() + return eu +} + +// SetUpdatedBy sets the "updated_by" field. +func (eu *EventUpdate) SetUpdatedBy(s string) *EventUpdate { + eu.mutation.SetUpdatedBy(s) + return eu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (eu *EventUpdate) SetNillableUpdatedBy(s *string) *EventUpdate { + if s != nil { + eu.SetUpdatedBy(*s) + } + return eu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (eu *EventUpdate) ClearUpdatedBy() *EventUpdate { + eu.mutation.ClearUpdatedBy() + return eu +} + +// SetTags sets the "tags" field. +func (eu *EventUpdate) SetTags(s []string) *EventUpdate { + eu.mutation.SetTags(s) + return eu +} + +// AppendTags appends s to the "tags" field. +func (eu *EventUpdate) AppendTags(s []string) *EventUpdate { + eu.mutation.AppendTags(s) + return eu +} + +// ClearTags clears the value of the "tags" field. +func (eu *EventUpdate) ClearTags() *EventUpdate { + eu.mutation.ClearTags() + return eu +} + +// SetEventID sets the "event_id" field. +func (eu *EventUpdate) SetEventID(s string) *EventUpdate { + eu.mutation.SetEventID(s) + return eu +} + +// SetNillableEventID sets the "event_id" field if the given value is not nil. +func (eu *EventUpdate) SetNillableEventID(s *string) *EventUpdate { + if s != nil { + eu.SetEventID(*s) + } + return eu +} + +// ClearEventID clears the value of the "event_id" field. +func (eu *EventUpdate) ClearEventID() *EventUpdate { + eu.mutation.ClearEventID() + return eu +} + +// SetCorrelationID sets the "correlation_id" field. +func (eu *EventUpdate) SetCorrelationID(s string) *EventUpdate { + eu.mutation.SetCorrelationID(s) + return eu +} + +// SetNillableCorrelationID sets the "correlation_id" field if the given value is not nil. +func (eu *EventUpdate) SetNillableCorrelationID(s *string) *EventUpdate { + if s != nil { + eu.SetCorrelationID(*s) + } + return eu +} + +// ClearCorrelationID clears the value of the "correlation_id" field. +func (eu *EventUpdate) ClearCorrelationID() *EventUpdate { + eu.mutation.ClearCorrelationID() + return eu +} + +// SetEventType sets the "event_type" field. +func (eu *EventUpdate) SetEventType(s string) *EventUpdate { + eu.mutation.SetEventType(s) + return eu +} + +// SetNillableEventType sets the "event_type" field if the given value is not nil. +func (eu *EventUpdate) SetNillableEventType(s *string) *EventUpdate { + if s != nil { + eu.SetEventType(*s) + } + return eu +} + +// SetMetadata sets the "metadata" field. +func (eu *EventUpdate) SetMetadata(m map[string]interface{}) *EventUpdate { + eu.mutation.SetMetadata(m) + return eu +} + +// ClearMetadata clears the value of the "metadata" field. +func (eu *EventUpdate) ClearMetadata() *EventUpdate { + eu.mutation.ClearMetadata() + return eu +} + +// AddUserIDs adds the "user" edge to the User entity by IDs. +func (eu *EventUpdate) AddUserIDs(ids ...string) *EventUpdate { + eu.mutation.AddUserIDs(ids...) + return eu +} + +// AddUser adds the "user" edges to the User entity. +func (eu *EventUpdate) AddUser(u ...*User) *EventUpdate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return eu.AddUserIDs(ids...) +} + +// AddGroupIDs adds the "group" edge to the Group entity by IDs. +func (eu *EventUpdate) AddGroupIDs(ids ...string) *EventUpdate { + eu.mutation.AddGroupIDs(ids...) + return eu +} + +// AddGroup adds the "group" edges to the Group entity. +func (eu *EventUpdate) AddGroup(g ...*Group) *EventUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return eu.AddGroupIDs(ids...) +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by IDs. +func (eu *EventUpdate) AddIntegrationIDs(ids ...string) *EventUpdate { + eu.mutation.AddIntegrationIDs(ids...) + return eu +} + +// AddIntegration adds the "integration" edges to the Integration entity. +func (eu *EventUpdate) AddIntegration(i ...*Integration) *EventUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return eu.AddIntegrationIDs(ids...) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (eu *EventUpdate) AddOrganizationIDs(ids ...string) *EventUpdate { + eu.mutation.AddOrganizationIDs(ids...) + return eu +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (eu *EventUpdate) AddOrganization(o ...*Organization) *EventUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return eu.AddOrganizationIDs(ids...) +} + +// AddInviteIDs adds the "invite" edge to the Invite entity by IDs. +func (eu *EventUpdate) AddInviteIDs(ids ...string) *EventUpdate { + eu.mutation.AddInviteIDs(ids...) + return eu +} + +// AddInvite adds the "invite" edges to the Invite entity. +func (eu *EventUpdate) AddInvite(i ...*Invite) *EventUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return eu.AddInviteIDs(ids...) +} + +// AddFeatureIDs adds the "feature" edge to the Feature entity by IDs. +func (eu *EventUpdate) AddFeatureIDs(ids ...string) *EventUpdate { + eu.mutation.AddFeatureIDs(ids...) + return eu +} + +// AddFeature adds the "feature" edges to the Feature entity. +func (eu *EventUpdate) AddFeature(f ...*Feature) *EventUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return eu.AddFeatureIDs(ids...) +} + +// AddEntitlementplanIDs adds the "entitlementplan" edge to the EntitlementPlan entity by IDs. +func (eu *EventUpdate) AddEntitlementplanIDs(ids ...string) *EventUpdate { + eu.mutation.AddEntitlementplanIDs(ids...) + return eu +} + +// AddEntitlementplan adds the "entitlementplan" edges to the EntitlementPlan entity. +func (eu *EventUpdate) AddEntitlementplan(e ...*EntitlementPlan) *EventUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.AddEntitlementplanIDs(ids...) +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeature" edge to the EntitlementPlanFeature entity by IDs. +func (eu *EventUpdate) AddEntitlementplanfeatureIDs(ids ...string) *EventUpdate { + eu.mutation.AddEntitlementplanfeatureIDs(ids...) + return eu +} + +// AddEntitlementplanfeature adds the "entitlementplanfeature" edges to the EntitlementPlanFeature entity. +func (eu *EventUpdate) AddEntitlementplanfeature(e ...*EntitlementPlanFeature) *EventUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.AddEntitlementplanfeatureIDs(ids...) +} + +// AddPersonalAccessTokenIDs adds the "personal_access_token" edge to the PersonalAccessToken entity by IDs. +func (eu *EventUpdate) AddPersonalAccessTokenIDs(ids ...string) *EventUpdate { + eu.mutation.AddPersonalAccessTokenIDs(ids...) + return eu +} + +// AddPersonalAccessToken adds the "personal_access_token" edges to the PersonalAccessToken entity. +func (eu *EventUpdate) AddPersonalAccessToken(p ...*PersonalAccessToken) *EventUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return eu.AddPersonalAccessTokenIDs(ids...) +} + +// AddOauth2tokenIDs adds the "oauth2token" edge to the OhAuthTooToken entity by IDs. +func (eu *EventUpdate) AddOauth2tokenIDs(ids ...string) *EventUpdate { + eu.mutation.AddOauth2tokenIDs(ids...) + return eu +} + +// AddOauth2token adds the "oauth2token" edges to the OhAuthTooToken entity. +func (eu *EventUpdate) AddOauth2token(o ...*OhAuthTooToken) *EventUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return eu.AddOauth2tokenIDs(ids...) +} + +// AddHushIDs adds the "hush" edge to the Hush entity by IDs. +func (eu *EventUpdate) AddHushIDs(ids ...string) *EventUpdate { + eu.mutation.AddHushIDs(ids...) + return eu +} + +// AddHush adds the "hush" edges to the Hush entity. +func (eu *EventUpdate) AddHush(h ...*Hush) *EventUpdate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return eu.AddHushIDs(ids...) +} + +// AddOrgmembershipIDs adds the "orgmembership" edge to the OrgMembership entity by IDs. +func (eu *EventUpdate) AddOrgmembershipIDs(ids ...string) *EventUpdate { + eu.mutation.AddOrgmembershipIDs(ids...) + return eu +} + +// AddOrgmembership adds the "orgmembership" edges to the OrgMembership entity. +func (eu *EventUpdate) AddOrgmembership(o ...*OrgMembership) *EventUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return eu.AddOrgmembershipIDs(ids...) +} + +// AddGroupmembershipIDs adds the "groupmembership" edge to the GroupMembership entity by IDs. +func (eu *EventUpdate) AddGroupmembershipIDs(ids ...string) *EventUpdate { + eu.mutation.AddGroupmembershipIDs(ids...) + return eu +} + +// AddGroupmembership adds the "groupmembership" edges to the GroupMembership entity. +func (eu *EventUpdate) AddGroupmembership(g ...*GroupMembership) *EventUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return eu.AddGroupmembershipIDs(ids...) +} + +// AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by IDs. +func (eu *EventUpdate) AddEntitlementIDs(ids ...string) *EventUpdate { + eu.mutation.AddEntitlementIDs(ids...) + return eu +} + +// AddEntitlement adds the "entitlement" edges to the Entitlement entity. +func (eu *EventUpdate) AddEntitlement(e ...*Entitlement) *EventUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.AddEntitlementIDs(ids...) +} + +// AddWebhookIDs adds the "webhook" edge to the Webhook entity by IDs. +func (eu *EventUpdate) AddWebhookIDs(ids ...string) *EventUpdate { + eu.mutation.AddWebhookIDs(ids...) + return eu +} + +// AddWebhook adds the "webhook" edges to the Webhook entity. +func (eu *EventUpdate) AddWebhook(w ...*Webhook) *EventUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return eu.AddWebhookIDs(ids...) +} + +// AddSubscriberIDs adds the "subscriber" edge to the Subscriber entity by IDs. +func (eu *EventUpdate) AddSubscriberIDs(ids ...string) *EventUpdate { + eu.mutation.AddSubscriberIDs(ids...) + return eu +} + +// AddSubscriber adds the "subscriber" edges to the Subscriber entity. +func (eu *EventUpdate) AddSubscriber(s ...*Subscriber) *EventUpdate { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return eu.AddSubscriberIDs(ids...) +} + +// Mutation returns the EventMutation object of the builder. +func (eu *EventUpdate) Mutation() *EventMutation { + return eu.mutation +} + +// ClearUser clears all "user" edges to the User entity. +func (eu *EventUpdate) ClearUser() *EventUpdate { + eu.mutation.ClearUser() + return eu +} + +// RemoveUserIDs removes the "user" edge to User entities by IDs. +func (eu *EventUpdate) RemoveUserIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveUserIDs(ids...) + return eu +} + +// RemoveUser removes "user" edges to User entities. +func (eu *EventUpdate) RemoveUser(u ...*User) *EventUpdate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return eu.RemoveUserIDs(ids...) +} + +// ClearGroup clears all "group" edges to the Group entity. +func (eu *EventUpdate) ClearGroup() *EventUpdate { + eu.mutation.ClearGroup() + return eu +} + +// RemoveGroupIDs removes the "group" edge to Group entities by IDs. +func (eu *EventUpdate) RemoveGroupIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveGroupIDs(ids...) + return eu +} + +// RemoveGroup removes "group" edges to Group entities. +func (eu *EventUpdate) RemoveGroup(g ...*Group) *EventUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return eu.RemoveGroupIDs(ids...) +} + +// ClearIntegration clears all "integration" edges to the Integration entity. +func (eu *EventUpdate) ClearIntegration() *EventUpdate { + eu.mutation.ClearIntegration() + return eu +} + +// RemoveIntegrationIDs removes the "integration" edge to Integration entities by IDs. +func (eu *EventUpdate) RemoveIntegrationIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveIntegrationIDs(ids...) + return eu +} + +// RemoveIntegration removes "integration" edges to Integration entities. +func (eu *EventUpdate) RemoveIntegration(i ...*Integration) *EventUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return eu.RemoveIntegrationIDs(ids...) +} + +// ClearOrganization clears all "organization" edges to the Organization entity. +func (eu *EventUpdate) ClearOrganization() *EventUpdate { + eu.mutation.ClearOrganization() + return eu +} + +// RemoveOrganizationIDs removes the "organization" edge to Organization entities by IDs. +func (eu *EventUpdate) RemoveOrganizationIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveOrganizationIDs(ids...) + return eu +} + +// RemoveOrganization removes "organization" edges to Organization entities. +func (eu *EventUpdate) RemoveOrganization(o ...*Organization) *EventUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return eu.RemoveOrganizationIDs(ids...) +} + +// ClearInvite clears all "invite" edges to the Invite entity. +func (eu *EventUpdate) ClearInvite() *EventUpdate { + eu.mutation.ClearInvite() + return eu +} + +// RemoveInviteIDs removes the "invite" edge to Invite entities by IDs. +func (eu *EventUpdate) RemoveInviteIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveInviteIDs(ids...) + return eu +} + +// RemoveInvite removes "invite" edges to Invite entities. +func (eu *EventUpdate) RemoveInvite(i ...*Invite) *EventUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return eu.RemoveInviteIDs(ids...) +} + +// ClearFeature clears all "feature" edges to the Feature entity. +func (eu *EventUpdate) ClearFeature() *EventUpdate { + eu.mutation.ClearFeature() + return eu +} + +// RemoveFeatureIDs removes the "feature" edge to Feature entities by IDs. +func (eu *EventUpdate) RemoveFeatureIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveFeatureIDs(ids...) + return eu +} + +// RemoveFeature removes "feature" edges to Feature entities. +func (eu *EventUpdate) RemoveFeature(f ...*Feature) *EventUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return eu.RemoveFeatureIDs(ids...) +} + +// ClearEntitlementplan clears all "entitlementplan" edges to the EntitlementPlan entity. +func (eu *EventUpdate) ClearEntitlementplan() *EventUpdate { + eu.mutation.ClearEntitlementplan() + return eu +} + +// RemoveEntitlementplanIDs removes the "entitlementplan" edge to EntitlementPlan entities by IDs. +func (eu *EventUpdate) RemoveEntitlementplanIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveEntitlementplanIDs(ids...) + return eu +} + +// RemoveEntitlementplan removes "entitlementplan" edges to EntitlementPlan entities. +func (eu *EventUpdate) RemoveEntitlementplan(e ...*EntitlementPlan) *EventUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.RemoveEntitlementplanIDs(ids...) +} + +// ClearEntitlementplanfeature clears all "entitlementplanfeature" edges to the EntitlementPlanFeature entity. +func (eu *EventUpdate) ClearEntitlementplanfeature() *EventUpdate { + eu.mutation.ClearEntitlementplanfeature() + return eu +} + +// RemoveEntitlementplanfeatureIDs removes the "entitlementplanfeature" edge to EntitlementPlanFeature entities by IDs. +func (eu *EventUpdate) RemoveEntitlementplanfeatureIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveEntitlementplanfeatureIDs(ids...) + return eu +} + +// RemoveEntitlementplanfeature removes "entitlementplanfeature" edges to EntitlementPlanFeature entities. +func (eu *EventUpdate) RemoveEntitlementplanfeature(e ...*EntitlementPlanFeature) *EventUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.RemoveEntitlementplanfeatureIDs(ids...) +} + +// ClearPersonalAccessToken clears all "personal_access_token" edges to the PersonalAccessToken entity. +func (eu *EventUpdate) ClearPersonalAccessToken() *EventUpdate { + eu.mutation.ClearPersonalAccessToken() + return eu +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_token" edge to PersonalAccessToken entities by IDs. +func (eu *EventUpdate) RemovePersonalAccessTokenIDs(ids ...string) *EventUpdate { + eu.mutation.RemovePersonalAccessTokenIDs(ids...) + return eu +} + +// RemovePersonalAccessToken removes "personal_access_token" edges to PersonalAccessToken entities. +func (eu *EventUpdate) RemovePersonalAccessToken(p ...*PersonalAccessToken) *EventUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return eu.RemovePersonalAccessTokenIDs(ids...) +} + +// ClearOauth2token clears all "oauth2token" edges to the OhAuthTooToken entity. +func (eu *EventUpdate) ClearOauth2token() *EventUpdate { + eu.mutation.ClearOauth2token() + return eu +} + +// RemoveOauth2tokenIDs removes the "oauth2token" edge to OhAuthTooToken entities by IDs. +func (eu *EventUpdate) RemoveOauth2tokenIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveOauth2tokenIDs(ids...) + return eu +} + +// RemoveOauth2token removes "oauth2token" edges to OhAuthTooToken entities. +func (eu *EventUpdate) RemoveOauth2token(o ...*OhAuthTooToken) *EventUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return eu.RemoveOauth2tokenIDs(ids...) +} + +// ClearHush clears all "hush" edges to the Hush entity. +func (eu *EventUpdate) ClearHush() *EventUpdate { + eu.mutation.ClearHush() + return eu +} + +// RemoveHushIDs removes the "hush" edge to Hush entities by IDs. +func (eu *EventUpdate) RemoveHushIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveHushIDs(ids...) + return eu +} + +// RemoveHush removes "hush" edges to Hush entities. +func (eu *EventUpdate) RemoveHush(h ...*Hush) *EventUpdate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return eu.RemoveHushIDs(ids...) +} + +// ClearOrgmembership clears all "orgmembership" edges to the OrgMembership entity. +func (eu *EventUpdate) ClearOrgmembership() *EventUpdate { + eu.mutation.ClearOrgmembership() + return eu +} + +// RemoveOrgmembershipIDs removes the "orgmembership" edge to OrgMembership entities by IDs. +func (eu *EventUpdate) RemoveOrgmembershipIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveOrgmembershipIDs(ids...) + return eu +} + +// RemoveOrgmembership removes "orgmembership" edges to OrgMembership entities. +func (eu *EventUpdate) RemoveOrgmembership(o ...*OrgMembership) *EventUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return eu.RemoveOrgmembershipIDs(ids...) +} + +// ClearGroupmembership clears all "groupmembership" edges to the GroupMembership entity. +func (eu *EventUpdate) ClearGroupmembership() *EventUpdate { + eu.mutation.ClearGroupmembership() + return eu +} + +// RemoveGroupmembershipIDs removes the "groupmembership" edge to GroupMembership entities by IDs. +func (eu *EventUpdate) RemoveGroupmembershipIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveGroupmembershipIDs(ids...) + return eu +} + +// RemoveGroupmembership removes "groupmembership" edges to GroupMembership entities. +func (eu *EventUpdate) RemoveGroupmembership(g ...*GroupMembership) *EventUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return eu.RemoveGroupmembershipIDs(ids...) +} + +// ClearEntitlement clears all "entitlement" edges to the Entitlement entity. +func (eu *EventUpdate) ClearEntitlement() *EventUpdate { + eu.mutation.ClearEntitlement() + return eu +} + +// RemoveEntitlementIDs removes the "entitlement" edge to Entitlement entities by IDs. +func (eu *EventUpdate) RemoveEntitlementIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveEntitlementIDs(ids...) + return eu +} + +// RemoveEntitlement removes "entitlement" edges to Entitlement entities. +func (eu *EventUpdate) RemoveEntitlement(e ...*Entitlement) *EventUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return eu.RemoveEntitlementIDs(ids...) +} + +// ClearWebhook clears all "webhook" edges to the Webhook entity. +func (eu *EventUpdate) ClearWebhook() *EventUpdate { + eu.mutation.ClearWebhook() + return eu +} + +// RemoveWebhookIDs removes the "webhook" edge to Webhook entities by IDs. +func (eu *EventUpdate) RemoveWebhookIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveWebhookIDs(ids...) + return eu +} + +// RemoveWebhook removes "webhook" edges to Webhook entities. +func (eu *EventUpdate) RemoveWebhook(w ...*Webhook) *EventUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return eu.RemoveWebhookIDs(ids...) +} + +// ClearSubscriber clears all "subscriber" edges to the Subscriber entity. +func (eu *EventUpdate) ClearSubscriber() *EventUpdate { + eu.mutation.ClearSubscriber() + return eu +} + +// RemoveSubscriberIDs removes the "subscriber" edge to Subscriber entities by IDs. +func (eu *EventUpdate) RemoveSubscriberIDs(ids ...string) *EventUpdate { + eu.mutation.RemoveSubscriberIDs(ids...) + return eu +} + +// RemoveSubscriber removes "subscriber" edges to Subscriber entities. +func (eu *EventUpdate) RemoveSubscriber(s ...*Subscriber) *EventUpdate { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return eu.RemoveSubscriberIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (eu *EventUpdate) Save(ctx context.Context) (int, error) { + if err := eu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, eu.sqlSave, eu.mutation, eu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (eu *EventUpdate) SaveX(ctx context.Context) int { + affected, err := eu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (eu *EventUpdate) Exec(ctx context.Context) error { + _, err := eu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (eu *EventUpdate) ExecX(ctx context.Context) { + if err := eu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (eu *EventUpdate) defaults() error { + if _, ok := eu.mutation.UpdatedAt(); !ok && !eu.mutation.UpdatedAtCleared() { + if event.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized event.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := event.UpdateDefaultUpdatedAt() + eu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (eu *EventUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(event.Table, event.Columns, sqlgraph.NewFieldSpec(event.FieldID, field.TypeString)) + if ps := eu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if eu.mutation.CreatedAtCleared() { + _spec.ClearField(event.FieldCreatedAt, field.TypeTime) + } + if value, ok := eu.mutation.UpdatedAt(); ok { + _spec.SetField(event.FieldUpdatedAt, field.TypeTime, value) + } + if eu.mutation.UpdatedAtCleared() { + _spec.ClearField(event.FieldUpdatedAt, field.TypeTime) + } + if eu.mutation.CreatedByCleared() { + _spec.ClearField(event.FieldCreatedBy, field.TypeString) + } + if value, ok := eu.mutation.UpdatedBy(); ok { + _spec.SetField(event.FieldUpdatedBy, field.TypeString, value) + } + if eu.mutation.UpdatedByCleared() { + _spec.ClearField(event.FieldUpdatedBy, field.TypeString) + } + if value, ok := eu.mutation.Tags(); ok { + _spec.SetField(event.FieldTags, field.TypeJSON, value) + } + if value, ok := eu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, event.FieldTags, value) + }) + } + if eu.mutation.TagsCleared() { + _spec.ClearField(event.FieldTags, field.TypeJSON) + } + if value, ok := eu.mutation.EventID(); ok { + _spec.SetField(event.FieldEventID, field.TypeString, value) + } + if eu.mutation.EventIDCleared() { + _spec.ClearField(event.FieldEventID, field.TypeString) + } + if value, ok := eu.mutation.CorrelationID(); ok { + _spec.SetField(event.FieldCorrelationID, field.TypeString, value) + } + if eu.mutation.CorrelationIDCleared() { + _spec.ClearField(event.FieldCorrelationID, field.TypeString) + } + if value, ok := eu.mutation.EventType(); ok { + _spec.SetField(event.FieldEventType, field.TypeString, value) + } + if value, ok := eu.mutation.Metadata(); ok { + _spec.SetField(event.FieldMetadata, field.TypeJSON, value) + } + if eu.mutation.MetadataCleared() { + _spec.ClearField(event.FieldMetadata, field.TypeJSON) + } + if eu.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.UserEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedUserIDs(); len(nodes) > 0 && !eu.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.GroupEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedGroupIDs(); len(nodes) > 0 && !eu.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.IntegrationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedIntegrationIDs(); len(nodes) > 0 && !eu.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.IntegrationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OrganizationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedOrganizationIDs(); len(nodes) > 0 && !eu.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.InviteCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.InviteEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedInviteIDs(); len(nodes) > 0 && !eu.mutation.InviteCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.InviteIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.FeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.FeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedFeatureIDs(); len(nodes) > 0 && !eu.mutation.FeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.FeatureIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.EntitlementplanCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementPlanEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedEntitlementplanIDs(); len(nodes) > 0 && !eu.mutation.EntitlementplanCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.EntitlementplanIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.EntitlementplanfeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementPlanFeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedEntitlementplanfeatureIDs(); len(nodes) > 0 && !eu.mutation.EntitlementplanfeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.EntitlementplanfeatureIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.PersonalAccessTokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.PersonalAccessTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedPersonalAccessTokenIDs(); len(nodes) > 0 && !eu.mutation.PersonalAccessTokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.PersonalAccessTokenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.Oauth2tokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OhAuthTooTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedOauth2tokenIDs(); len(nodes) > 0 && !eu.mutation.Oauth2tokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.Oauth2tokenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.HushCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.HushEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedHushIDs(); len(nodes) > 0 && !eu.mutation.HushCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.HushIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.OrgmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OrgMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedOrgmembershipIDs(); len(nodes) > 0 && !eu.mutation.OrgmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.OrgmembershipIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.GroupmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.GroupMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedGroupmembershipIDs(); len(nodes) > 0 && !eu.mutation.GroupmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.GroupmembershipIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.EntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedEntitlementIDs(); len(nodes) > 0 && !eu.mutation.EntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.EntitlementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.WebhookCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.WebhookEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedWebhookIDs(); len(nodes) > 0 && !eu.mutation.WebhookCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.WebhookIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if eu.mutation.SubscriberCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.SubscriberEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.RemovedSubscriberIDs(); len(nodes) > 0 && !eu.mutation.SubscriberCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := eu.mutation.SubscriberIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = eu.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = eu.schemaConfig.Event + ctx = internal.NewSchemaConfigContext(ctx, eu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, eu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{event.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + eu.mutation.done = true + return n, nil +} + +// EventUpdateOne is the builder for updating a single Event entity. +type EventUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EventMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (euo *EventUpdateOne) SetUpdatedAt(t time.Time) *EventUpdateOne { + euo.mutation.SetUpdatedAt(t) + return euo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (euo *EventUpdateOne) ClearUpdatedAt() *EventUpdateOne { + euo.mutation.ClearUpdatedAt() + return euo +} + +// SetUpdatedBy sets the "updated_by" field. +func (euo *EventUpdateOne) SetUpdatedBy(s string) *EventUpdateOne { + euo.mutation.SetUpdatedBy(s) + return euo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (euo *EventUpdateOne) SetNillableUpdatedBy(s *string) *EventUpdateOne { + if s != nil { + euo.SetUpdatedBy(*s) + } + return euo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (euo *EventUpdateOne) ClearUpdatedBy() *EventUpdateOne { + euo.mutation.ClearUpdatedBy() + return euo +} + +// SetTags sets the "tags" field. +func (euo *EventUpdateOne) SetTags(s []string) *EventUpdateOne { + euo.mutation.SetTags(s) + return euo +} + +// AppendTags appends s to the "tags" field. +func (euo *EventUpdateOne) AppendTags(s []string) *EventUpdateOne { + euo.mutation.AppendTags(s) + return euo +} + +// ClearTags clears the value of the "tags" field. +func (euo *EventUpdateOne) ClearTags() *EventUpdateOne { + euo.mutation.ClearTags() + return euo +} + +// SetEventID sets the "event_id" field. +func (euo *EventUpdateOne) SetEventID(s string) *EventUpdateOne { + euo.mutation.SetEventID(s) + return euo +} + +// SetNillableEventID sets the "event_id" field if the given value is not nil. +func (euo *EventUpdateOne) SetNillableEventID(s *string) *EventUpdateOne { + if s != nil { + euo.SetEventID(*s) + } + return euo +} + +// ClearEventID clears the value of the "event_id" field. +func (euo *EventUpdateOne) ClearEventID() *EventUpdateOne { + euo.mutation.ClearEventID() + return euo +} + +// SetCorrelationID sets the "correlation_id" field. +func (euo *EventUpdateOne) SetCorrelationID(s string) *EventUpdateOne { + euo.mutation.SetCorrelationID(s) + return euo +} + +// SetNillableCorrelationID sets the "correlation_id" field if the given value is not nil. +func (euo *EventUpdateOne) SetNillableCorrelationID(s *string) *EventUpdateOne { + if s != nil { + euo.SetCorrelationID(*s) + } + return euo +} + +// ClearCorrelationID clears the value of the "correlation_id" field. +func (euo *EventUpdateOne) ClearCorrelationID() *EventUpdateOne { + euo.mutation.ClearCorrelationID() + return euo +} + +// SetEventType sets the "event_type" field. +func (euo *EventUpdateOne) SetEventType(s string) *EventUpdateOne { + euo.mutation.SetEventType(s) + return euo +} + +// SetNillableEventType sets the "event_type" field if the given value is not nil. +func (euo *EventUpdateOne) SetNillableEventType(s *string) *EventUpdateOne { + if s != nil { + euo.SetEventType(*s) + } + return euo +} + +// SetMetadata sets the "metadata" field. +func (euo *EventUpdateOne) SetMetadata(m map[string]interface{}) *EventUpdateOne { + euo.mutation.SetMetadata(m) + return euo +} + +// ClearMetadata clears the value of the "metadata" field. +func (euo *EventUpdateOne) ClearMetadata() *EventUpdateOne { + euo.mutation.ClearMetadata() + return euo +} + +// AddUserIDs adds the "user" edge to the User entity by IDs. +func (euo *EventUpdateOne) AddUserIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddUserIDs(ids...) + return euo +} + +// AddUser adds the "user" edges to the User entity. +func (euo *EventUpdateOne) AddUser(u ...*User) *EventUpdateOne { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return euo.AddUserIDs(ids...) +} + +// AddGroupIDs adds the "group" edge to the Group entity by IDs. +func (euo *EventUpdateOne) AddGroupIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddGroupIDs(ids...) + return euo +} + +// AddGroup adds the "group" edges to the Group entity. +func (euo *EventUpdateOne) AddGroup(g ...*Group) *EventUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return euo.AddGroupIDs(ids...) +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by IDs. +func (euo *EventUpdateOne) AddIntegrationIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddIntegrationIDs(ids...) + return euo +} + +// AddIntegration adds the "integration" edges to the Integration entity. +func (euo *EventUpdateOne) AddIntegration(i ...*Integration) *EventUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return euo.AddIntegrationIDs(ids...) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (euo *EventUpdateOne) AddOrganizationIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddOrganizationIDs(ids...) + return euo +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (euo *EventUpdateOne) AddOrganization(o ...*Organization) *EventUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return euo.AddOrganizationIDs(ids...) +} + +// AddInviteIDs adds the "invite" edge to the Invite entity by IDs. +func (euo *EventUpdateOne) AddInviteIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddInviteIDs(ids...) + return euo +} + +// AddInvite adds the "invite" edges to the Invite entity. +func (euo *EventUpdateOne) AddInvite(i ...*Invite) *EventUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return euo.AddInviteIDs(ids...) +} + +// AddFeatureIDs adds the "feature" edge to the Feature entity by IDs. +func (euo *EventUpdateOne) AddFeatureIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddFeatureIDs(ids...) + return euo +} + +// AddFeature adds the "feature" edges to the Feature entity. +func (euo *EventUpdateOne) AddFeature(f ...*Feature) *EventUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return euo.AddFeatureIDs(ids...) +} + +// AddEntitlementplanIDs adds the "entitlementplan" edge to the EntitlementPlan entity by IDs. +func (euo *EventUpdateOne) AddEntitlementplanIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddEntitlementplanIDs(ids...) + return euo +} + +// AddEntitlementplan adds the "entitlementplan" edges to the EntitlementPlan entity. +func (euo *EventUpdateOne) AddEntitlementplan(e ...*EntitlementPlan) *EventUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.AddEntitlementplanIDs(ids...) +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeature" edge to the EntitlementPlanFeature entity by IDs. +func (euo *EventUpdateOne) AddEntitlementplanfeatureIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddEntitlementplanfeatureIDs(ids...) + return euo +} + +// AddEntitlementplanfeature adds the "entitlementplanfeature" edges to the EntitlementPlanFeature entity. +func (euo *EventUpdateOne) AddEntitlementplanfeature(e ...*EntitlementPlanFeature) *EventUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.AddEntitlementplanfeatureIDs(ids...) +} + +// AddPersonalAccessTokenIDs adds the "personal_access_token" edge to the PersonalAccessToken entity by IDs. +func (euo *EventUpdateOne) AddPersonalAccessTokenIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddPersonalAccessTokenIDs(ids...) + return euo +} + +// AddPersonalAccessToken adds the "personal_access_token" edges to the PersonalAccessToken entity. +func (euo *EventUpdateOne) AddPersonalAccessToken(p ...*PersonalAccessToken) *EventUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return euo.AddPersonalAccessTokenIDs(ids...) +} + +// AddOauth2tokenIDs adds the "oauth2token" edge to the OhAuthTooToken entity by IDs. +func (euo *EventUpdateOne) AddOauth2tokenIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddOauth2tokenIDs(ids...) + return euo +} + +// AddOauth2token adds the "oauth2token" edges to the OhAuthTooToken entity. +func (euo *EventUpdateOne) AddOauth2token(o ...*OhAuthTooToken) *EventUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return euo.AddOauth2tokenIDs(ids...) +} + +// AddHushIDs adds the "hush" edge to the Hush entity by IDs. +func (euo *EventUpdateOne) AddHushIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddHushIDs(ids...) + return euo +} + +// AddHush adds the "hush" edges to the Hush entity. +func (euo *EventUpdateOne) AddHush(h ...*Hush) *EventUpdateOne { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return euo.AddHushIDs(ids...) +} + +// AddOrgmembershipIDs adds the "orgmembership" edge to the OrgMembership entity by IDs. +func (euo *EventUpdateOne) AddOrgmembershipIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddOrgmembershipIDs(ids...) + return euo +} + +// AddOrgmembership adds the "orgmembership" edges to the OrgMembership entity. +func (euo *EventUpdateOne) AddOrgmembership(o ...*OrgMembership) *EventUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return euo.AddOrgmembershipIDs(ids...) +} + +// AddGroupmembershipIDs adds the "groupmembership" edge to the GroupMembership entity by IDs. +func (euo *EventUpdateOne) AddGroupmembershipIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddGroupmembershipIDs(ids...) + return euo +} + +// AddGroupmembership adds the "groupmembership" edges to the GroupMembership entity. +func (euo *EventUpdateOne) AddGroupmembership(g ...*GroupMembership) *EventUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return euo.AddGroupmembershipIDs(ids...) +} + +// AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by IDs. +func (euo *EventUpdateOne) AddEntitlementIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddEntitlementIDs(ids...) + return euo +} + +// AddEntitlement adds the "entitlement" edges to the Entitlement entity. +func (euo *EventUpdateOne) AddEntitlement(e ...*Entitlement) *EventUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.AddEntitlementIDs(ids...) +} + +// AddWebhookIDs adds the "webhook" edge to the Webhook entity by IDs. +func (euo *EventUpdateOne) AddWebhookIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddWebhookIDs(ids...) + return euo +} + +// AddWebhook adds the "webhook" edges to the Webhook entity. +func (euo *EventUpdateOne) AddWebhook(w ...*Webhook) *EventUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return euo.AddWebhookIDs(ids...) +} + +// AddSubscriberIDs adds the "subscriber" edge to the Subscriber entity by IDs. +func (euo *EventUpdateOne) AddSubscriberIDs(ids ...string) *EventUpdateOne { + euo.mutation.AddSubscriberIDs(ids...) + return euo +} + +// AddSubscriber adds the "subscriber" edges to the Subscriber entity. +func (euo *EventUpdateOne) AddSubscriber(s ...*Subscriber) *EventUpdateOne { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return euo.AddSubscriberIDs(ids...) +} + +// Mutation returns the EventMutation object of the builder. +func (euo *EventUpdateOne) Mutation() *EventMutation { + return euo.mutation +} + +// ClearUser clears all "user" edges to the User entity. +func (euo *EventUpdateOne) ClearUser() *EventUpdateOne { + euo.mutation.ClearUser() + return euo +} + +// RemoveUserIDs removes the "user" edge to User entities by IDs. +func (euo *EventUpdateOne) RemoveUserIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveUserIDs(ids...) + return euo +} + +// RemoveUser removes "user" edges to User entities. +func (euo *EventUpdateOne) RemoveUser(u ...*User) *EventUpdateOne { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return euo.RemoveUserIDs(ids...) +} + +// ClearGroup clears all "group" edges to the Group entity. +func (euo *EventUpdateOne) ClearGroup() *EventUpdateOne { + euo.mutation.ClearGroup() + return euo +} + +// RemoveGroupIDs removes the "group" edge to Group entities by IDs. +func (euo *EventUpdateOne) RemoveGroupIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveGroupIDs(ids...) + return euo +} + +// RemoveGroup removes "group" edges to Group entities. +func (euo *EventUpdateOne) RemoveGroup(g ...*Group) *EventUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return euo.RemoveGroupIDs(ids...) +} + +// ClearIntegration clears all "integration" edges to the Integration entity. +func (euo *EventUpdateOne) ClearIntegration() *EventUpdateOne { + euo.mutation.ClearIntegration() + return euo +} + +// RemoveIntegrationIDs removes the "integration" edge to Integration entities by IDs. +func (euo *EventUpdateOne) RemoveIntegrationIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveIntegrationIDs(ids...) + return euo +} + +// RemoveIntegration removes "integration" edges to Integration entities. +func (euo *EventUpdateOne) RemoveIntegration(i ...*Integration) *EventUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return euo.RemoveIntegrationIDs(ids...) +} + +// ClearOrganization clears all "organization" edges to the Organization entity. +func (euo *EventUpdateOne) ClearOrganization() *EventUpdateOne { + euo.mutation.ClearOrganization() + return euo +} + +// RemoveOrganizationIDs removes the "organization" edge to Organization entities by IDs. +func (euo *EventUpdateOne) RemoveOrganizationIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveOrganizationIDs(ids...) + return euo +} + +// RemoveOrganization removes "organization" edges to Organization entities. +func (euo *EventUpdateOne) RemoveOrganization(o ...*Organization) *EventUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return euo.RemoveOrganizationIDs(ids...) +} + +// ClearInvite clears all "invite" edges to the Invite entity. +func (euo *EventUpdateOne) ClearInvite() *EventUpdateOne { + euo.mutation.ClearInvite() + return euo +} + +// RemoveInviteIDs removes the "invite" edge to Invite entities by IDs. +func (euo *EventUpdateOne) RemoveInviteIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveInviteIDs(ids...) + return euo +} + +// RemoveInvite removes "invite" edges to Invite entities. +func (euo *EventUpdateOne) RemoveInvite(i ...*Invite) *EventUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return euo.RemoveInviteIDs(ids...) +} + +// ClearFeature clears all "feature" edges to the Feature entity. +func (euo *EventUpdateOne) ClearFeature() *EventUpdateOne { + euo.mutation.ClearFeature() + return euo +} + +// RemoveFeatureIDs removes the "feature" edge to Feature entities by IDs. +func (euo *EventUpdateOne) RemoveFeatureIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveFeatureIDs(ids...) + return euo +} + +// RemoveFeature removes "feature" edges to Feature entities. +func (euo *EventUpdateOne) RemoveFeature(f ...*Feature) *EventUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return euo.RemoveFeatureIDs(ids...) +} + +// ClearEntitlementplan clears all "entitlementplan" edges to the EntitlementPlan entity. +func (euo *EventUpdateOne) ClearEntitlementplan() *EventUpdateOne { + euo.mutation.ClearEntitlementplan() + return euo +} + +// RemoveEntitlementplanIDs removes the "entitlementplan" edge to EntitlementPlan entities by IDs. +func (euo *EventUpdateOne) RemoveEntitlementplanIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveEntitlementplanIDs(ids...) + return euo +} + +// RemoveEntitlementplan removes "entitlementplan" edges to EntitlementPlan entities. +func (euo *EventUpdateOne) RemoveEntitlementplan(e ...*EntitlementPlan) *EventUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.RemoveEntitlementplanIDs(ids...) +} + +// ClearEntitlementplanfeature clears all "entitlementplanfeature" edges to the EntitlementPlanFeature entity. +func (euo *EventUpdateOne) ClearEntitlementplanfeature() *EventUpdateOne { + euo.mutation.ClearEntitlementplanfeature() + return euo +} + +// RemoveEntitlementplanfeatureIDs removes the "entitlementplanfeature" edge to EntitlementPlanFeature entities by IDs. +func (euo *EventUpdateOne) RemoveEntitlementplanfeatureIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveEntitlementplanfeatureIDs(ids...) + return euo +} + +// RemoveEntitlementplanfeature removes "entitlementplanfeature" edges to EntitlementPlanFeature entities. +func (euo *EventUpdateOne) RemoveEntitlementplanfeature(e ...*EntitlementPlanFeature) *EventUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.RemoveEntitlementplanfeatureIDs(ids...) +} + +// ClearPersonalAccessToken clears all "personal_access_token" edges to the PersonalAccessToken entity. +func (euo *EventUpdateOne) ClearPersonalAccessToken() *EventUpdateOne { + euo.mutation.ClearPersonalAccessToken() + return euo +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_token" edge to PersonalAccessToken entities by IDs. +func (euo *EventUpdateOne) RemovePersonalAccessTokenIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemovePersonalAccessTokenIDs(ids...) + return euo +} + +// RemovePersonalAccessToken removes "personal_access_token" edges to PersonalAccessToken entities. +func (euo *EventUpdateOne) RemovePersonalAccessToken(p ...*PersonalAccessToken) *EventUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return euo.RemovePersonalAccessTokenIDs(ids...) +} + +// ClearOauth2token clears all "oauth2token" edges to the OhAuthTooToken entity. +func (euo *EventUpdateOne) ClearOauth2token() *EventUpdateOne { + euo.mutation.ClearOauth2token() + return euo +} + +// RemoveOauth2tokenIDs removes the "oauth2token" edge to OhAuthTooToken entities by IDs. +func (euo *EventUpdateOne) RemoveOauth2tokenIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveOauth2tokenIDs(ids...) + return euo +} + +// RemoveOauth2token removes "oauth2token" edges to OhAuthTooToken entities. +func (euo *EventUpdateOne) RemoveOauth2token(o ...*OhAuthTooToken) *EventUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return euo.RemoveOauth2tokenIDs(ids...) +} + +// ClearHush clears all "hush" edges to the Hush entity. +func (euo *EventUpdateOne) ClearHush() *EventUpdateOne { + euo.mutation.ClearHush() + return euo +} + +// RemoveHushIDs removes the "hush" edge to Hush entities by IDs. +func (euo *EventUpdateOne) RemoveHushIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveHushIDs(ids...) + return euo +} + +// RemoveHush removes "hush" edges to Hush entities. +func (euo *EventUpdateOne) RemoveHush(h ...*Hush) *EventUpdateOne { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return euo.RemoveHushIDs(ids...) +} + +// ClearOrgmembership clears all "orgmembership" edges to the OrgMembership entity. +func (euo *EventUpdateOne) ClearOrgmembership() *EventUpdateOne { + euo.mutation.ClearOrgmembership() + return euo +} + +// RemoveOrgmembershipIDs removes the "orgmembership" edge to OrgMembership entities by IDs. +func (euo *EventUpdateOne) RemoveOrgmembershipIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveOrgmembershipIDs(ids...) + return euo +} + +// RemoveOrgmembership removes "orgmembership" edges to OrgMembership entities. +func (euo *EventUpdateOne) RemoveOrgmembership(o ...*OrgMembership) *EventUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return euo.RemoveOrgmembershipIDs(ids...) +} + +// ClearGroupmembership clears all "groupmembership" edges to the GroupMembership entity. +func (euo *EventUpdateOne) ClearGroupmembership() *EventUpdateOne { + euo.mutation.ClearGroupmembership() + return euo +} + +// RemoveGroupmembershipIDs removes the "groupmembership" edge to GroupMembership entities by IDs. +func (euo *EventUpdateOne) RemoveGroupmembershipIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveGroupmembershipIDs(ids...) + return euo +} + +// RemoveGroupmembership removes "groupmembership" edges to GroupMembership entities. +func (euo *EventUpdateOne) RemoveGroupmembership(g ...*GroupMembership) *EventUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return euo.RemoveGroupmembershipIDs(ids...) +} + +// ClearEntitlement clears all "entitlement" edges to the Entitlement entity. +func (euo *EventUpdateOne) ClearEntitlement() *EventUpdateOne { + euo.mutation.ClearEntitlement() + return euo +} + +// RemoveEntitlementIDs removes the "entitlement" edge to Entitlement entities by IDs. +func (euo *EventUpdateOne) RemoveEntitlementIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveEntitlementIDs(ids...) + return euo +} + +// RemoveEntitlement removes "entitlement" edges to Entitlement entities. +func (euo *EventUpdateOne) RemoveEntitlement(e ...*Entitlement) *EventUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return euo.RemoveEntitlementIDs(ids...) +} + +// ClearWebhook clears all "webhook" edges to the Webhook entity. +func (euo *EventUpdateOne) ClearWebhook() *EventUpdateOne { + euo.mutation.ClearWebhook() + return euo +} + +// RemoveWebhookIDs removes the "webhook" edge to Webhook entities by IDs. +func (euo *EventUpdateOne) RemoveWebhookIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveWebhookIDs(ids...) + return euo +} + +// RemoveWebhook removes "webhook" edges to Webhook entities. +func (euo *EventUpdateOne) RemoveWebhook(w ...*Webhook) *EventUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return euo.RemoveWebhookIDs(ids...) +} + +// ClearSubscriber clears all "subscriber" edges to the Subscriber entity. +func (euo *EventUpdateOne) ClearSubscriber() *EventUpdateOne { + euo.mutation.ClearSubscriber() + return euo +} + +// RemoveSubscriberIDs removes the "subscriber" edge to Subscriber entities by IDs. +func (euo *EventUpdateOne) RemoveSubscriberIDs(ids ...string) *EventUpdateOne { + euo.mutation.RemoveSubscriberIDs(ids...) + return euo +} + +// RemoveSubscriber removes "subscriber" edges to Subscriber entities. +func (euo *EventUpdateOne) RemoveSubscriber(s ...*Subscriber) *EventUpdateOne { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return euo.RemoveSubscriberIDs(ids...) +} + +// Where appends a list predicates to the EventUpdate builder. +func (euo *EventUpdateOne) Where(ps ...predicate.Event) *EventUpdateOne { + euo.mutation.Where(ps...) + return euo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne { + euo.fields = append([]string{field}, fields...) + return euo +} + +// Save executes the query and returns the updated Event entity. +func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error) { + if err := euo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, euo.sqlSave, euo.mutation, euo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event { + node, err := euo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (euo *EventUpdateOne) Exec(ctx context.Context) error { + _, err := euo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (euo *EventUpdateOne) ExecX(ctx context.Context) { + if err := euo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (euo *EventUpdateOne) defaults() error { + if _, ok := euo.mutation.UpdatedAt(); !ok && !euo.mutation.UpdatedAtCleared() { + if event.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized event.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := event.UpdateDefaultUpdatedAt() + euo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (euo *EventUpdateOne) sqlSave(ctx context.Context) (_node *Event, err error) { + _spec := sqlgraph.NewUpdateSpec(event.Table, event.Columns, sqlgraph.NewFieldSpec(event.FieldID, field.TypeString)) + id, ok := euo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Event.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := euo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, event.FieldID) + for _, f := range fields { + if !event.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != event.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := euo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if euo.mutation.CreatedAtCleared() { + _spec.ClearField(event.FieldCreatedAt, field.TypeTime) + } + if value, ok := euo.mutation.UpdatedAt(); ok { + _spec.SetField(event.FieldUpdatedAt, field.TypeTime, value) + } + if euo.mutation.UpdatedAtCleared() { + _spec.ClearField(event.FieldUpdatedAt, field.TypeTime) + } + if euo.mutation.CreatedByCleared() { + _spec.ClearField(event.FieldCreatedBy, field.TypeString) + } + if value, ok := euo.mutation.UpdatedBy(); ok { + _spec.SetField(event.FieldUpdatedBy, field.TypeString, value) + } + if euo.mutation.UpdatedByCleared() { + _spec.ClearField(event.FieldUpdatedBy, field.TypeString) + } + if value, ok := euo.mutation.Tags(); ok { + _spec.SetField(event.FieldTags, field.TypeJSON, value) + } + if value, ok := euo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, event.FieldTags, value) + }) + } + if euo.mutation.TagsCleared() { + _spec.ClearField(event.FieldTags, field.TypeJSON) + } + if value, ok := euo.mutation.EventID(); ok { + _spec.SetField(event.FieldEventID, field.TypeString, value) + } + if euo.mutation.EventIDCleared() { + _spec.ClearField(event.FieldEventID, field.TypeString) + } + if value, ok := euo.mutation.CorrelationID(); ok { + _spec.SetField(event.FieldCorrelationID, field.TypeString, value) + } + if euo.mutation.CorrelationIDCleared() { + _spec.ClearField(event.FieldCorrelationID, field.TypeString) + } + if value, ok := euo.mutation.EventType(); ok { + _spec.SetField(event.FieldEventType, field.TypeString, value) + } + if value, ok := euo.mutation.Metadata(); ok { + _spec.SetField(event.FieldMetadata, field.TypeJSON, value) + } + if euo.mutation.MetadataCleared() { + _spec.ClearField(event.FieldMetadata, field.TypeJSON) + } + if euo.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.UserEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedUserIDs(); len(nodes) > 0 && !euo.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.UserTable, + Columns: event.UserPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.GroupEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedGroupIDs(); len(nodes) > 0 && !euo.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupTable, + Columns: event.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.IntegrationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedIntegrationIDs(); len(nodes) > 0 && !euo.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.IntegrationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.IntegrationTable, + Columns: event.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OrganizationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedOrganizationIDs(); len(nodes) > 0 && !euo.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrganizationTable, + Columns: event.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.InviteCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.InviteEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedInviteIDs(); len(nodes) > 0 && !euo.mutation.InviteCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.InviteIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.InviteTable, + Columns: event.InvitePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.FeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.FeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedFeatureIDs(); len(nodes) > 0 && !euo.mutation.FeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.FeatureIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.FeatureTable, + Columns: event.FeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.EntitlementplanCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementPlanEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedEntitlementplanIDs(); len(nodes) > 0 && !euo.mutation.EntitlementplanCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.EntitlementplanIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanTable, + Columns: event.EntitlementplanPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementPlanEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.EntitlementplanfeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementPlanFeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedEntitlementplanfeatureIDs(); len(nodes) > 0 && !euo.mutation.EntitlementplanfeatureCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.EntitlementplanfeatureIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementplanfeatureTable, + Columns: event.EntitlementplanfeaturePrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementPlanFeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.PersonalAccessTokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.PersonalAccessTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedPersonalAccessTokenIDs(); len(nodes) > 0 && !euo.mutation.PersonalAccessTokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.PersonalAccessTokenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.PersonalAccessTokenTable, + Columns: event.PersonalAccessTokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.Oauth2tokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OhAuthTooTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedOauth2tokenIDs(); len(nodes) > 0 && !euo.mutation.Oauth2tokenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.Oauth2tokenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.Oauth2tokenTable, + Columns: event.Oauth2tokenPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.HushCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.HushEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedHushIDs(); len(nodes) > 0 && !euo.mutation.HushCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.HushIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.HushTable, + Columns: event.HushPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.OrgmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OrgMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedOrgmembershipIDs(); len(nodes) > 0 && !euo.mutation.OrgmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.OrgmembershipIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.OrgmembershipTable, + Columns: event.OrgmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.GroupmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.GroupMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedGroupmembershipIDs(); len(nodes) > 0 && !euo.mutation.GroupmembershipCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.GroupmembershipIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.GroupmembershipTable, + Columns: event.GroupmembershipPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.EntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedEntitlementIDs(); len(nodes) > 0 && !euo.mutation.EntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.EntitlementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.EntitlementTable, + Columns: event.EntitlementPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.EntitlementEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.WebhookCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.WebhookEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedWebhookIDs(); len(nodes) > 0 && !euo.mutation.WebhookCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.WebhookIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.WebhookTable, + Columns: event.WebhookPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if euo.mutation.SubscriberCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.SubscriberEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.RemovedSubscriberIDs(); len(nodes) > 0 && !euo.mutation.SubscriberCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := euo.mutation.SubscriberIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: event.SubscriberTable, + Columns: event.SubscriberPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = euo.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = euo.schemaConfig.Event + ctx = internal.NewSchemaConfigContext(ctx, euo.schemaConfig) + _node = &Event{config: euo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, euo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{event.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + euo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/eventhistory.go b/internal/ent/generated/eventhistory.go new file mode 100644 index 0000000..44332e7 --- /dev/null +++ b/internal/ent/generated/eventhistory.go @@ -0,0 +1,246 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/entx/history" +) + +// EventHistory is the model entity for the EventHistory schema. +type EventHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // EventID holds the value of the "event_id" field. + EventID string `json:"event_id,omitempty"` + // CorrelationID holds the value of the "correlation_id" field. + CorrelationID string `json:"correlation_id,omitempty"` + // EventType holds the value of the "event_type" field. + EventType string `json:"event_type,omitempty"` + // Metadata holds the value of the "metadata" field. + Metadata map[string]interface{} `json:"metadata,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*EventHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case eventhistory.FieldTags, eventhistory.FieldMetadata: + values[i] = new([]byte) + case eventhistory.FieldOperation: + values[i] = new(history.OpType) + case eventhistory.FieldID, eventhistory.FieldRef, eventhistory.FieldCreatedBy, eventhistory.FieldUpdatedBy, eventhistory.FieldMappingID, eventhistory.FieldEventID, eventhistory.FieldCorrelationID, eventhistory.FieldEventType: + values[i] = new(sql.NullString) + case eventhistory.FieldHistoryTime, eventhistory.FieldCreatedAt, eventhistory.FieldUpdatedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the EventHistory fields. +func (eh *EventHistory) 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 eventhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + eh.ID = value.String + } + case eventhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + eh.HistoryTime = value.Time + } + case eventhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + eh.Ref = value.String + } + case eventhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + eh.Operation = *value + } + case eventhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + eh.CreatedAt = value.Time + } + case eventhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + eh.UpdatedAt = value.Time + } + case eventhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + eh.CreatedBy = value.String + } + case eventhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + eh.UpdatedBy = value.String + } + case eventhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + eh.MappingID = value.String + } + case eventhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &eh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case eventhistory.FieldEventID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field event_id", values[i]) + } else if value.Valid { + eh.EventID = value.String + } + case eventhistory.FieldCorrelationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field correlation_id", values[i]) + } else if value.Valid { + eh.CorrelationID = value.String + } + case eventhistory.FieldEventType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field event_type", values[i]) + } else if value.Valid { + eh.EventType = value.String + } + case eventhistory.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &eh.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + default: + eh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the EventHistory. +// This includes values selected through modifiers, order, etc. +func (eh *EventHistory) Value(name string) (ent.Value, error) { + return eh.selectValues.Get(name) +} + +// Update returns a builder for updating this EventHistory. +// Note that you need to call EventHistory.Unwrap() before calling this method if this EventHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (eh *EventHistory) Update() *EventHistoryUpdateOne { + return NewEventHistoryClient(eh.config).UpdateOne(eh) +} + +// Unwrap unwraps the EventHistory 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 (eh *EventHistory) Unwrap() *EventHistory { + _tx, ok := eh.config.driver.(*txDriver) + if !ok { + panic("generated: EventHistory is not a transactional entity") + } + eh.config.driver = _tx.drv + return eh +} + +// String implements the fmt.Stringer. +func (eh *EventHistory) String() string { + var builder strings.Builder + builder.WriteString("EventHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", eh.ID)) + builder.WriteString("history_time=") + builder.WriteString(eh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(eh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", eh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(eh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(eh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(eh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(eh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(eh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", eh.Tags)) + builder.WriteString(", ") + builder.WriteString("event_id=") + builder.WriteString(eh.EventID) + builder.WriteString(", ") + builder.WriteString("correlation_id=") + builder.WriteString(eh.CorrelationID) + builder.WriteString(", ") + builder.WriteString("event_type=") + builder.WriteString(eh.EventType) + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", eh.Metadata)) + builder.WriteByte(')') + return builder.String() +} + +// EventHistories is a parsable slice of EventHistory. +type EventHistories []*EventHistory diff --git a/internal/ent/generated/eventhistory/eventhistory.go b/internal/ent/generated/eventhistory/eventhistory.go new file mode 100644 index 0000000..d507e5a --- /dev/null +++ b/internal/ent/generated/eventhistory/eventhistory.go @@ -0,0 +1,172 @@ +// Code generated by ent, DO NOT EDIT. + +package eventhistory + +import ( + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the eventhistory type in the database. + Label = "event_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldEventID holds the string denoting the event_id field in the database. + FieldEventID = "event_id" + // FieldCorrelationID holds the string denoting the correlation_id field in the database. + FieldCorrelationID = "correlation_id" + // FieldEventType holds the string denoting the event_type field in the database. + FieldEventType = "event_type" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // Table holds the table name of the eventhistory in the database. + Table = "event_history" +) + +// Columns holds all SQL columns for eventhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldEventID, + FieldCorrelationID, + FieldEventType, + FieldMetadata, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("eventhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the EventHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByEventID orders the results by the event_id field. +func ByEventID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEventID, opts...).ToFunc() +} + +// ByCorrelationID orders the results by the correlation_id field. +func ByCorrelationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCorrelationID, opts...).ToFunc() +} + +// ByEventType orders the results by the event_type field. +func ByEventType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEventType, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/eventhistory/where.go b/internal/ent/generated/eventhistory/where.go new file mode 100644 index 0000000..ca4be76 --- /dev/null +++ b/internal/ent/generated/eventhistory/where.go @@ -0,0 +1,816 @@ +// Code generated by ent, DO NOT EDIT. + +package eventhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// EventID applies equality check predicate on the "event_id" field. It's identical to EventIDEQ. +func EventID(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldEventID, v)) +} + +// CorrelationID applies equality check predicate on the "correlation_id" field. It's identical to CorrelationIDEQ. +func CorrelationID(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldCorrelationID, v)) +} + +// EventType applies equality check predicate on the "event_type" field. It's identical to EventTypeEQ. +func EventType(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldEventType, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldTags)) +} + +// EventIDEQ applies the EQ predicate on the "event_id" field. +func EventIDEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldEventID, v)) +} + +// EventIDNEQ applies the NEQ predicate on the "event_id" field. +func EventIDNEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldEventID, v)) +} + +// EventIDIn applies the In predicate on the "event_id" field. +func EventIDIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldEventID, vs...)) +} + +// EventIDNotIn applies the NotIn predicate on the "event_id" field. +func EventIDNotIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldEventID, vs...)) +} + +// EventIDGT applies the GT predicate on the "event_id" field. +func EventIDGT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldEventID, v)) +} + +// EventIDGTE applies the GTE predicate on the "event_id" field. +func EventIDGTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldEventID, v)) +} + +// EventIDLT applies the LT predicate on the "event_id" field. +func EventIDLT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldEventID, v)) +} + +// EventIDLTE applies the LTE predicate on the "event_id" field. +func EventIDLTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldEventID, v)) +} + +// EventIDContains applies the Contains predicate on the "event_id" field. +func EventIDContains(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContains(FieldEventID, v)) +} + +// EventIDHasPrefix applies the HasPrefix predicate on the "event_id" field. +func EventIDHasPrefix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasPrefix(FieldEventID, v)) +} + +// EventIDHasSuffix applies the HasSuffix predicate on the "event_id" field. +func EventIDHasSuffix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasSuffix(FieldEventID, v)) +} + +// EventIDIsNil applies the IsNil predicate on the "event_id" field. +func EventIDIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldEventID)) +} + +// EventIDNotNil applies the NotNil predicate on the "event_id" field. +func EventIDNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldEventID)) +} + +// EventIDEqualFold applies the EqualFold predicate on the "event_id" field. +func EventIDEqualFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldEventID, v)) +} + +// EventIDContainsFold applies the ContainsFold predicate on the "event_id" field. +func EventIDContainsFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldEventID, v)) +} + +// CorrelationIDEQ applies the EQ predicate on the "correlation_id" field. +func CorrelationIDEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldCorrelationID, v)) +} + +// CorrelationIDNEQ applies the NEQ predicate on the "correlation_id" field. +func CorrelationIDNEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldCorrelationID, v)) +} + +// CorrelationIDIn applies the In predicate on the "correlation_id" field. +func CorrelationIDIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldCorrelationID, vs...)) +} + +// CorrelationIDNotIn applies the NotIn predicate on the "correlation_id" field. +func CorrelationIDNotIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldCorrelationID, vs...)) +} + +// CorrelationIDGT applies the GT predicate on the "correlation_id" field. +func CorrelationIDGT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldCorrelationID, v)) +} + +// CorrelationIDGTE applies the GTE predicate on the "correlation_id" field. +func CorrelationIDGTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldCorrelationID, v)) +} + +// CorrelationIDLT applies the LT predicate on the "correlation_id" field. +func CorrelationIDLT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldCorrelationID, v)) +} + +// CorrelationIDLTE applies the LTE predicate on the "correlation_id" field. +func CorrelationIDLTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldCorrelationID, v)) +} + +// CorrelationIDContains applies the Contains predicate on the "correlation_id" field. +func CorrelationIDContains(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContains(FieldCorrelationID, v)) +} + +// CorrelationIDHasPrefix applies the HasPrefix predicate on the "correlation_id" field. +func CorrelationIDHasPrefix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasPrefix(FieldCorrelationID, v)) +} + +// CorrelationIDHasSuffix applies the HasSuffix predicate on the "correlation_id" field. +func CorrelationIDHasSuffix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasSuffix(FieldCorrelationID, v)) +} + +// CorrelationIDIsNil applies the IsNil predicate on the "correlation_id" field. +func CorrelationIDIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldCorrelationID)) +} + +// CorrelationIDNotNil applies the NotNil predicate on the "correlation_id" field. +func CorrelationIDNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldCorrelationID)) +} + +// CorrelationIDEqualFold applies the EqualFold predicate on the "correlation_id" field. +func CorrelationIDEqualFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldCorrelationID, v)) +} + +// CorrelationIDContainsFold applies the ContainsFold predicate on the "correlation_id" field. +func CorrelationIDContainsFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldCorrelationID, v)) +} + +// EventTypeEQ applies the EQ predicate on the "event_type" field. +func EventTypeEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEQ(FieldEventType, v)) +} + +// EventTypeNEQ applies the NEQ predicate on the "event_type" field. +func EventTypeNEQ(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNEQ(FieldEventType, v)) +} + +// EventTypeIn applies the In predicate on the "event_type" field. +func EventTypeIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldIn(FieldEventType, vs...)) +} + +// EventTypeNotIn applies the NotIn predicate on the "event_type" field. +func EventTypeNotIn(vs ...string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotIn(FieldEventType, vs...)) +} + +// EventTypeGT applies the GT predicate on the "event_type" field. +func EventTypeGT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGT(FieldEventType, v)) +} + +// EventTypeGTE applies the GTE predicate on the "event_type" field. +func EventTypeGTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldGTE(FieldEventType, v)) +} + +// EventTypeLT applies the LT predicate on the "event_type" field. +func EventTypeLT(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLT(FieldEventType, v)) +} + +// EventTypeLTE applies the LTE predicate on the "event_type" field. +func EventTypeLTE(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldLTE(FieldEventType, v)) +} + +// EventTypeContains applies the Contains predicate on the "event_type" field. +func EventTypeContains(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContains(FieldEventType, v)) +} + +// EventTypeHasPrefix applies the HasPrefix predicate on the "event_type" field. +func EventTypeHasPrefix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasPrefix(FieldEventType, v)) +} + +// EventTypeHasSuffix applies the HasSuffix predicate on the "event_type" field. +func EventTypeHasSuffix(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldHasSuffix(FieldEventType, v)) +} + +// EventTypeEqualFold applies the EqualFold predicate on the "event_type" field. +func EventTypeEqualFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldEqualFold(FieldEventType, v)) +} + +// EventTypeContainsFold applies the ContainsFold predicate on the "event_type" field. +func EventTypeContainsFold(v string) predicate.EventHistory { + return predicate.EventHistory(sql.FieldContainsFold(FieldEventType, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.EventHistory { + return predicate.EventHistory(sql.FieldNotNull(FieldMetadata)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.EventHistory) predicate.EventHistory { + return predicate.EventHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.EventHistory) predicate.EventHistory { + return predicate.EventHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.EventHistory) predicate.EventHistory { + return predicate.EventHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/eventhistory_create.go b/internal/ent/generated/eventhistory_create.go new file mode 100644 index 0000000..03b0216 --- /dev/null +++ b/internal/ent/generated/eventhistory_create.go @@ -0,0 +1,441 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/entx/history" +) + +// EventHistoryCreate is the builder for creating a EventHistory entity. +type EventHistoryCreate struct { + config + mutation *EventHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ehc *EventHistoryCreate) SetHistoryTime(t time.Time) *EventHistoryCreate { + ehc.mutation.SetHistoryTime(t) + return ehc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableHistoryTime(t *time.Time) *EventHistoryCreate { + if t != nil { + ehc.SetHistoryTime(*t) + } + return ehc +} + +// SetRef sets the "ref" field. +func (ehc *EventHistoryCreate) SetRef(s string) *EventHistoryCreate { + ehc.mutation.SetRef(s) + return ehc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableRef(s *string) *EventHistoryCreate { + if s != nil { + ehc.SetRef(*s) + } + return ehc +} + +// SetOperation sets the "operation" field. +func (ehc *EventHistoryCreate) SetOperation(ht history.OpType) *EventHistoryCreate { + ehc.mutation.SetOperation(ht) + return ehc +} + +// SetCreatedAt sets the "created_at" field. +func (ehc *EventHistoryCreate) SetCreatedAt(t time.Time) *EventHistoryCreate { + ehc.mutation.SetCreatedAt(t) + return ehc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableCreatedAt(t *time.Time) *EventHistoryCreate { + if t != nil { + ehc.SetCreatedAt(*t) + } + return ehc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehc *EventHistoryCreate) SetUpdatedAt(t time.Time) *EventHistoryCreate { + ehc.mutation.SetUpdatedAt(t) + return ehc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableUpdatedAt(t *time.Time) *EventHistoryCreate { + if t != nil { + ehc.SetUpdatedAt(*t) + } + return ehc +} + +// SetCreatedBy sets the "created_by" field. +func (ehc *EventHistoryCreate) SetCreatedBy(s string) *EventHistoryCreate { + ehc.mutation.SetCreatedBy(s) + return ehc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableCreatedBy(s *string) *EventHistoryCreate { + if s != nil { + ehc.SetCreatedBy(*s) + } + return ehc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehc *EventHistoryCreate) SetUpdatedBy(s string) *EventHistoryCreate { + ehc.mutation.SetUpdatedBy(s) + return ehc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableUpdatedBy(s *string) *EventHistoryCreate { + if s != nil { + ehc.SetUpdatedBy(*s) + } + return ehc +} + +// SetMappingID sets the "mapping_id" field. +func (ehc *EventHistoryCreate) SetMappingID(s string) *EventHistoryCreate { + ehc.mutation.SetMappingID(s) + return ehc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableMappingID(s *string) *EventHistoryCreate { + if s != nil { + ehc.SetMappingID(*s) + } + return ehc +} + +// SetTags sets the "tags" field. +func (ehc *EventHistoryCreate) SetTags(s []string) *EventHistoryCreate { + ehc.mutation.SetTags(s) + return ehc +} + +// SetEventID sets the "event_id" field. +func (ehc *EventHistoryCreate) SetEventID(s string) *EventHistoryCreate { + ehc.mutation.SetEventID(s) + return ehc +} + +// SetNillableEventID sets the "event_id" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableEventID(s *string) *EventHistoryCreate { + if s != nil { + ehc.SetEventID(*s) + } + return ehc +} + +// SetCorrelationID sets the "correlation_id" field. +func (ehc *EventHistoryCreate) SetCorrelationID(s string) *EventHistoryCreate { + ehc.mutation.SetCorrelationID(s) + return ehc +} + +// SetNillableCorrelationID sets the "correlation_id" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableCorrelationID(s *string) *EventHistoryCreate { + if s != nil { + ehc.SetCorrelationID(*s) + } + return ehc +} + +// SetEventType sets the "event_type" field. +func (ehc *EventHistoryCreate) SetEventType(s string) *EventHistoryCreate { + ehc.mutation.SetEventType(s) + return ehc +} + +// SetMetadata sets the "metadata" field. +func (ehc *EventHistoryCreate) SetMetadata(m map[string]interface{}) *EventHistoryCreate { + ehc.mutation.SetMetadata(m) + return ehc +} + +// SetID sets the "id" field. +func (ehc *EventHistoryCreate) SetID(s string) *EventHistoryCreate { + ehc.mutation.SetID(s) + return ehc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ehc *EventHistoryCreate) SetNillableID(s *string) *EventHistoryCreate { + if s != nil { + ehc.SetID(*s) + } + return ehc +} + +// Mutation returns the EventHistoryMutation object of the builder. +func (ehc *EventHistoryCreate) Mutation() *EventHistoryMutation { + return ehc.mutation +} + +// Save creates the EventHistory in the database. +func (ehc *EventHistoryCreate) Save(ctx context.Context) (*EventHistory, error) { + ehc.defaults() + return withHooks(ctx, ehc.sqlSave, ehc.mutation, ehc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ehc *EventHistoryCreate) SaveX(ctx context.Context) *EventHistory { + v, err := ehc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ehc *EventHistoryCreate) Exec(ctx context.Context) error { + _, err := ehc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehc *EventHistoryCreate) ExecX(ctx context.Context) { + if err := ehc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehc *EventHistoryCreate) defaults() { + if _, ok := ehc.mutation.HistoryTime(); !ok { + v := eventhistory.DefaultHistoryTime() + ehc.mutation.SetHistoryTime(v) + } + if _, ok := ehc.mutation.CreatedAt(); !ok { + v := eventhistory.DefaultCreatedAt() + ehc.mutation.SetCreatedAt(v) + } + if _, ok := ehc.mutation.UpdatedAt(); !ok { + v := eventhistory.DefaultUpdatedAt() + ehc.mutation.SetUpdatedAt(v) + } + if _, ok := ehc.mutation.MappingID(); !ok { + v := eventhistory.DefaultMappingID() + ehc.mutation.SetMappingID(v) + } + if _, ok := ehc.mutation.Tags(); !ok { + v := eventhistory.DefaultTags + ehc.mutation.SetTags(v) + } + if _, ok := ehc.mutation.ID(); !ok { + v := eventhistory.DefaultID() + ehc.mutation.SetID(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ehc *EventHistoryCreate) check() error { + if _, ok := ehc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "EventHistory.history_time"`)} + } + if _, ok := ehc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "EventHistory.operation"`)} + } + if v, ok := ehc.mutation.Operation(); ok { + if err := eventhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "EventHistory.operation": %w`, err)} + } + } + if _, ok := ehc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "EventHistory.mapping_id"`)} + } + if _, ok := ehc.mutation.EventType(); !ok { + return &ValidationError{Name: "event_type", err: errors.New(`generated: missing required field "EventHistory.event_type"`)} + } + return nil +} + +func (ehc *EventHistoryCreate) sqlSave(ctx context.Context) (*EventHistory, error) { + if err := ehc.check(); err != nil { + return nil, err + } + _node, _spec := ehc.createSpec() + if err := sqlgraph.CreateNode(ctx, ehc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected EventHistory.ID type: %T", _spec.ID.Value) + } + } + ehc.mutation.id = &_node.ID + ehc.mutation.done = true + return _node, nil +} + +func (ehc *EventHistoryCreate) createSpec() (*EventHistory, *sqlgraph.CreateSpec) { + var ( + _node = &EventHistory{config: ehc.config} + _spec = sqlgraph.NewCreateSpec(eventhistory.Table, sqlgraph.NewFieldSpec(eventhistory.FieldID, field.TypeString)) + ) + _spec.Schema = ehc.schemaConfig.EventHistory + if id, ok := ehc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ehc.mutation.HistoryTime(); ok { + _spec.SetField(eventhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ehc.mutation.Ref(); ok { + _spec.SetField(eventhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ehc.mutation.Operation(); ok { + _spec.SetField(eventhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ehc.mutation.CreatedAt(); ok { + _spec.SetField(eventhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ehc.mutation.UpdatedAt(); ok { + _spec.SetField(eventhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ehc.mutation.CreatedBy(); ok { + _spec.SetField(eventhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ehc.mutation.UpdatedBy(); ok { + _spec.SetField(eventhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ehc.mutation.MappingID(); ok { + _spec.SetField(eventhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ehc.mutation.Tags(); ok { + _spec.SetField(eventhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ehc.mutation.EventID(); ok { + _spec.SetField(eventhistory.FieldEventID, field.TypeString, value) + _node.EventID = value + } + if value, ok := ehc.mutation.CorrelationID(); ok { + _spec.SetField(eventhistory.FieldCorrelationID, field.TypeString, value) + _node.CorrelationID = value + } + if value, ok := ehc.mutation.EventType(); ok { + _spec.SetField(eventhistory.FieldEventType, field.TypeString, value) + _node.EventType = value + } + if value, ok := ehc.mutation.Metadata(); ok { + _spec.SetField(eventhistory.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + return _node, _spec +} + +// EventHistoryCreateBulk is the builder for creating many EventHistory entities in bulk. +type EventHistoryCreateBulk struct { + config + err error + builders []*EventHistoryCreate +} + +// Save creates the EventHistory entities in the database. +func (ehcb *EventHistoryCreateBulk) Save(ctx context.Context) ([]*EventHistory, error) { + if ehcb.err != nil { + return nil, ehcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ehcb.builders)) + nodes := make([]*EventHistory, len(ehcb.builders)) + mutators := make([]Mutator, len(ehcb.builders)) + for i := range ehcb.builders { + func(i int, root context.Context) { + builder := ehcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*EventHistoryMutation) + 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, ehcb.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, ehcb.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, ehcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ehcb *EventHistoryCreateBulk) SaveX(ctx context.Context) []*EventHistory { + v, err := ehcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ehcb *EventHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ehcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehcb *EventHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ehcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/eventhistory_delete.go b/internal/ent/generated/eventhistory_delete.go new file mode 100644 index 0000000..7f3bde9 --- /dev/null +++ b/internal/ent/generated/eventhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EventHistoryDelete is the builder for deleting a EventHistory entity. +type EventHistoryDelete struct { + config + hooks []Hook + mutation *EventHistoryMutation +} + +// Where appends a list predicates to the EventHistoryDelete builder. +func (ehd *EventHistoryDelete) Where(ps ...predicate.EventHistory) *EventHistoryDelete { + ehd.mutation.Where(ps...) + return ehd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ehd *EventHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ehd.sqlExec, ehd.mutation, ehd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehd *EventHistoryDelete) ExecX(ctx context.Context) int { + n, err := ehd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ehd *EventHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(eventhistory.Table, sqlgraph.NewFieldSpec(eventhistory.FieldID, field.TypeString)) + _spec.Node.Schema = ehd.schemaConfig.EventHistory + ctx = internal.NewSchemaConfigContext(ctx, ehd.schemaConfig) + if ps := ehd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ehd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ehd.mutation.done = true + return affected, err +} + +// EventHistoryDeleteOne is the builder for deleting a single EventHistory entity. +type EventHistoryDeleteOne struct { + ehd *EventHistoryDelete +} + +// Where appends a list predicates to the EventHistoryDelete builder. +func (ehdo *EventHistoryDeleteOne) Where(ps ...predicate.EventHistory) *EventHistoryDeleteOne { + ehdo.ehd.mutation.Where(ps...) + return ehdo +} + +// Exec executes the deletion query. +func (ehdo *EventHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ehdo.ehd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{eventhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehdo *EventHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ehdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/eventhistory_query.go b/internal/ent/generated/eventhistory_query.go new file mode 100644 index 0000000..2ac2038 --- /dev/null +++ b/internal/ent/generated/eventhistory_query.go @@ -0,0 +1,549 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EventHistoryQuery is the builder for querying EventHistory entities. +type EventHistoryQuery struct { + config + ctx *QueryContext + order []eventhistory.OrderOption + inters []Interceptor + predicates []predicate.EventHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*EventHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the EventHistoryQuery builder. +func (ehq *EventHistoryQuery) Where(ps ...predicate.EventHistory) *EventHistoryQuery { + ehq.predicates = append(ehq.predicates, ps...) + return ehq +} + +// Limit the number of records to be returned by this query. +func (ehq *EventHistoryQuery) Limit(limit int) *EventHistoryQuery { + ehq.ctx.Limit = &limit + return ehq +} + +// Offset to start from. +func (ehq *EventHistoryQuery) Offset(offset int) *EventHistoryQuery { + ehq.ctx.Offset = &offset + return ehq +} + +// 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 (ehq *EventHistoryQuery) Unique(unique bool) *EventHistoryQuery { + ehq.ctx.Unique = &unique + return ehq +} + +// Order specifies how the records should be ordered. +func (ehq *EventHistoryQuery) Order(o ...eventhistory.OrderOption) *EventHistoryQuery { + ehq.order = append(ehq.order, o...) + return ehq +} + +// First returns the first EventHistory entity from the query. +// Returns a *NotFoundError when no EventHistory was found. +func (ehq *EventHistoryQuery) First(ctx context.Context) (*EventHistory, error) { + nodes, err := ehq.Limit(1).All(setContextOp(ctx, ehq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{eventhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ehq *EventHistoryQuery) FirstX(ctx context.Context) *EventHistory { + node, err := ehq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first EventHistory ID from the query. +// Returns a *NotFoundError when no EventHistory ID was found. +func (ehq *EventHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ehq.Limit(1).IDs(setContextOp(ctx, ehq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{eventhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ehq *EventHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ehq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single EventHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one EventHistory entity is found. +// Returns a *NotFoundError when no EventHistory entities are found. +func (ehq *EventHistoryQuery) Only(ctx context.Context) (*EventHistory, error) { + nodes, err := ehq.Limit(2).All(setContextOp(ctx, ehq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{eventhistory.Label} + default: + return nil, &NotSingularError{eventhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ehq *EventHistoryQuery) OnlyX(ctx context.Context) *EventHistory { + node, err := ehq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only EventHistory ID in the query. +// Returns a *NotSingularError when more than one EventHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ehq *EventHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ehq.Limit(2).IDs(setContextOp(ctx, ehq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{eventhistory.Label} + default: + err = &NotSingularError{eventhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ehq *EventHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ehq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of EventHistories. +func (ehq *EventHistoryQuery) All(ctx context.Context) ([]*EventHistory, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryAll) + if err := ehq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*EventHistory, *EventHistoryQuery]() + return withInterceptors[[]*EventHistory](ctx, ehq, qr, ehq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ehq *EventHistoryQuery) AllX(ctx context.Context) []*EventHistory { + nodes, err := ehq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of EventHistory IDs. +func (ehq *EventHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ehq.ctx.Unique == nil && ehq.path != nil { + ehq.Unique(true) + } + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryIDs) + if err = ehq.Select(eventhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ehq *EventHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ehq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ehq *EventHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryCount) + if err := ehq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ehq, querierCount[*EventHistoryQuery](), ehq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ehq *EventHistoryQuery) CountX(ctx context.Context) int { + count, err := ehq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ehq *EventHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ehq.ctx, ent.OpQueryExist) + switch _, err := ehq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ehq *EventHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ehq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the EventHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ehq *EventHistoryQuery) Clone() *EventHistoryQuery { + if ehq == nil { + return nil + } + return &EventHistoryQuery{ + config: ehq.config, + ctx: ehq.ctx.Clone(), + order: append([]eventhistory.OrderOption{}, ehq.order...), + inters: append([]Interceptor{}, ehq.inters...), + predicates: append([]predicate.EventHistory{}, ehq.predicates...), + // clone intermediate query. + sql: ehq.sql.Clone(), + path: ehq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.EventHistory.Query(). +// GroupBy(eventhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ehq *EventHistoryQuery) GroupBy(field string, fields ...string) *EventHistoryGroupBy { + ehq.ctx.Fields = append([]string{field}, fields...) + grbuild := &EventHistoryGroupBy{build: ehq} + grbuild.flds = &ehq.ctx.Fields + grbuild.label = eventhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.EventHistory.Query(). +// Select(eventhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ehq *EventHistoryQuery) Select(fields ...string) *EventHistorySelect { + ehq.ctx.Fields = append(ehq.ctx.Fields, fields...) + sbuild := &EventHistorySelect{EventHistoryQuery: ehq} + sbuild.label = eventhistory.Label + sbuild.flds, sbuild.scan = &ehq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a EventHistorySelect configured with the given aggregations. +func (ehq *EventHistoryQuery) Aggregate(fns ...AggregateFunc) *EventHistorySelect { + return ehq.Select().Aggregate(fns...) +} + +func (ehq *EventHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ehq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ehq); err != nil { + return err + } + } + } + for _, f := range ehq.ctx.Fields { + if !eventhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ehq.path != nil { + prev, err := ehq.path(ctx) + if err != nil { + return err + } + ehq.sql = prev + } + return nil +} + +func (ehq *EventHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EventHistory, error) { + var ( + nodes = []*EventHistory{} + _spec = ehq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*EventHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &EventHistory{config: ehq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ehq.schemaConfig.EventHistory + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + if len(ehq.modifiers) > 0 { + _spec.Modifiers = ehq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ehq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ehq.loadTotal { + if err := ehq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ehq *EventHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ehq.querySpec() + _spec.Node.Schema = ehq.schemaConfig.EventHistory + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + if len(ehq.modifiers) > 0 { + _spec.Modifiers = ehq.modifiers + } + _spec.Node.Columns = ehq.ctx.Fields + if len(ehq.ctx.Fields) > 0 { + _spec.Unique = ehq.ctx.Unique != nil && *ehq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ehq.driver, _spec) +} + +func (ehq *EventHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(eventhistory.Table, eventhistory.Columns, sqlgraph.NewFieldSpec(eventhistory.FieldID, field.TypeString)) + _spec.From = ehq.sql + if unique := ehq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ehq.path != nil { + _spec.Unique = true + } + if fields := ehq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, eventhistory.FieldID) + for i := range fields { + if fields[i] != eventhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ehq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ehq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ehq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ehq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ehq *EventHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ehq.driver.Dialect()) + t1 := builder.Table(eventhistory.Table) + columns := ehq.ctx.Fields + if len(columns) == 0 { + columns = eventhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ehq.sql != nil { + selector = ehq.sql + selector.Select(selector.Columns(columns...)...) + } + if ehq.ctx.Unique != nil && *ehq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ehq.schemaConfig.EventHistory) + ctx = internal.NewSchemaConfigContext(ctx, ehq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ehq.predicates { + p(selector) + } + for _, p := range ehq.order { + p(selector) + } + if offset := ehq.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 := ehq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// EventHistoryGroupBy is the group-by builder for EventHistory entities. +type EventHistoryGroupBy struct { + selector + build *EventHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ehgb *EventHistoryGroupBy) Aggregate(fns ...AggregateFunc) *EventHistoryGroupBy { + ehgb.fns = append(ehgb.fns, fns...) + return ehgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ehgb *EventHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ehgb.build.ctx, ent.OpQueryGroupBy) + if err := ehgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EventHistoryQuery, *EventHistoryGroupBy](ctx, ehgb.build, ehgb, ehgb.build.inters, v) +} + +func (ehgb *EventHistoryGroupBy) sqlScan(ctx context.Context, root *EventHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ehgb.fns)) + for _, fn := range ehgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ehgb.flds)+len(ehgb.fns)) + for _, f := range *ehgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ehgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ehgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// EventHistorySelect is the builder for selecting fields of EventHistory entities. +type EventHistorySelect struct { + *EventHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ehs *EventHistorySelect) Aggregate(fns ...AggregateFunc) *EventHistorySelect { + ehs.fns = append(ehs.fns, fns...) + return ehs +} + +// Scan applies the selector query and scans the result into the given value. +func (ehs *EventHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ehs.ctx, ent.OpQuerySelect) + if err := ehs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*EventHistoryQuery, *EventHistorySelect](ctx, ehs.EventHistoryQuery, ehs, ehs.inters, v) +} + +func (ehs *EventHistorySelect) sqlScan(ctx context.Context, root *EventHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ehs.fns)) + for _, fn := range ehs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ehs.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 := ehs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/eventhistory_update.go b/internal/ent/generated/eventhistory_update.go new file mode 100644 index 0000000..3ba762a --- /dev/null +++ b/internal/ent/generated/eventhistory_update.go @@ -0,0 +1,539 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// EventHistoryUpdate is the builder for updating EventHistory entities. +type EventHistoryUpdate struct { + config + hooks []Hook + mutation *EventHistoryMutation +} + +// Where appends a list predicates to the EventHistoryUpdate builder. +func (ehu *EventHistoryUpdate) Where(ps ...predicate.EventHistory) *EventHistoryUpdate { + ehu.mutation.Where(ps...) + return ehu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehu *EventHistoryUpdate) SetUpdatedAt(t time.Time) *EventHistoryUpdate { + ehu.mutation.SetUpdatedAt(t) + return ehu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ehu *EventHistoryUpdate) ClearUpdatedAt() *EventHistoryUpdate { + ehu.mutation.ClearUpdatedAt() + return ehu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehu *EventHistoryUpdate) SetUpdatedBy(s string) *EventHistoryUpdate { + ehu.mutation.SetUpdatedBy(s) + return ehu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehu *EventHistoryUpdate) SetNillableUpdatedBy(s *string) *EventHistoryUpdate { + if s != nil { + ehu.SetUpdatedBy(*s) + } + return ehu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ehu *EventHistoryUpdate) ClearUpdatedBy() *EventHistoryUpdate { + ehu.mutation.ClearUpdatedBy() + return ehu +} + +// SetTags sets the "tags" field. +func (ehu *EventHistoryUpdate) SetTags(s []string) *EventHistoryUpdate { + ehu.mutation.SetTags(s) + return ehu +} + +// AppendTags appends s to the "tags" field. +func (ehu *EventHistoryUpdate) AppendTags(s []string) *EventHistoryUpdate { + ehu.mutation.AppendTags(s) + return ehu +} + +// ClearTags clears the value of the "tags" field. +func (ehu *EventHistoryUpdate) ClearTags() *EventHistoryUpdate { + ehu.mutation.ClearTags() + return ehu +} + +// SetEventID sets the "event_id" field. +func (ehu *EventHistoryUpdate) SetEventID(s string) *EventHistoryUpdate { + ehu.mutation.SetEventID(s) + return ehu +} + +// SetNillableEventID sets the "event_id" field if the given value is not nil. +func (ehu *EventHistoryUpdate) SetNillableEventID(s *string) *EventHistoryUpdate { + if s != nil { + ehu.SetEventID(*s) + } + return ehu +} + +// ClearEventID clears the value of the "event_id" field. +func (ehu *EventHistoryUpdate) ClearEventID() *EventHistoryUpdate { + ehu.mutation.ClearEventID() + return ehu +} + +// SetCorrelationID sets the "correlation_id" field. +func (ehu *EventHistoryUpdate) SetCorrelationID(s string) *EventHistoryUpdate { + ehu.mutation.SetCorrelationID(s) + return ehu +} + +// SetNillableCorrelationID sets the "correlation_id" field if the given value is not nil. +func (ehu *EventHistoryUpdate) SetNillableCorrelationID(s *string) *EventHistoryUpdate { + if s != nil { + ehu.SetCorrelationID(*s) + } + return ehu +} + +// ClearCorrelationID clears the value of the "correlation_id" field. +func (ehu *EventHistoryUpdate) ClearCorrelationID() *EventHistoryUpdate { + ehu.mutation.ClearCorrelationID() + return ehu +} + +// SetEventType sets the "event_type" field. +func (ehu *EventHistoryUpdate) SetEventType(s string) *EventHistoryUpdate { + ehu.mutation.SetEventType(s) + return ehu +} + +// SetNillableEventType sets the "event_type" field if the given value is not nil. +func (ehu *EventHistoryUpdate) SetNillableEventType(s *string) *EventHistoryUpdate { + if s != nil { + ehu.SetEventType(*s) + } + return ehu +} + +// SetMetadata sets the "metadata" field. +func (ehu *EventHistoryUpdate) SetMetadata(m map[string]interface{}) *EventHistoryUpdate { + ehu.mutation.SetMetadata(m) + return ehu +} + +// ClearMetadata clears the value of the "metadata" field. +func (ehu *EventHistoryUpdate) ClearMetadata() *EventHistoryUpdate { + ehu.mutation.ClearMetadata() + return ehu +} + +// Mutation returns the EventHistoryMutation object of the builder. +func (ehu *EventHistoryUpdate) Mutation() *EventHistoryMutation { + return ehu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ehu *EventHistoryUpdate) Save(ctx context.Context) (int, error) { + ehu.defaults() + return withHooks(ctx, ehu.sqlSave, ehu.mutation, ehu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ehu *EventHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ehu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ehu *EventHistoryUpdate) Exec(ctx context.Context) error { + _, err := ehu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehu *EventHistoryUpdate) ExecX(ctx context.Context) { + if err := ehu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehu *EventHistoryUpdate) defaults() { + if _, ok := ehu.mutation.UpdatedAt(); !ok && !ehu.mutation.UpdatedAtCleared() { + v := eventhistory.UpdateDefaultUpdatedAt() + ehu.mutation.SetUpdatedAt(v) + } +} + +func (ehu *EventHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(eventhistory.Table, eventhistory.Columns, sqlgraph.NewFieldSpec(eventhistory.FieldID, field.TypeString)) + if ps := ehu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ehu.mutation.RefCleared() { + _spec.ClearField(eventhistory.FieldRef, field.TypeString) + } + if ehu.mutation.CreatedAtCleared() { + _spec.ClearField(eventhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ehu.mutation.UpdatedAt(); ok { + _spec.SetField(eventhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ehu.mutation.UpdatedAtCleared() { + _spec.ClearField(eventhistory.FieldUpdatedAt, field.TypeTime) + } + if ehu.mutation.CreatedByCleared() { + _spec.ClearField(eventhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ehu.mutation.UpdatedBy(); ok { + _spec.SetField(eventhistory.FieldUpdatedBy, field.TypeString, value) + } + if ehu.mutation.UpdatedByCleared() { + _spec.ClearField(eventhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ehu.mutation.Tags(); ok { + _spec.SetField(eventhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ehu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, eventhistory.FieldTags, value) + }) + } + if ehu.mutation.TagsCleared() { + _spec.ClearField(eventhistory.FieldTags, field.TypeJSON) + } + if value, ok := ehu.mutation.EventID(); ok { + _spec.SetField(eventhistory.FieldEventID, field.TypeString, value) + } + if ehu.mutation.EventIDCleared() { + _spec.ClearField(eventhistory.FieldEventID, field.TypeString) + } + if value, ok := ehu.mutation.CorrelationID(); ok { + _spec.SetField(eventhistory.FieldCorrelationID, field.TypeString, value) + } + if ehu.mutation.CorrelationIDCleared() { + _spec.ClearField(eventhistory.FieldCorrelationID, field.TypeString) + } + if value, ok := ehu.mutation.EventType(); ok { + _spec.SetField(eventhistory.FieldEventType, field.TypeString, value) + } + if value, ok := ehu.mutation.Metadata(); ok { + _spec.SetField(eventhistory.FieldMetadata, field.TypeJSON, value) + } + if ehu.mutation.MetadataCleared() { + _spec.ClearField(eventhistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = ehu.schemaConfig.EventHistory + ctx = internal.NewSchemaConfigContext(ctx, ehu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ehu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{eventhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ehu.mutation.done = true + return n, nil +} + +// EventHistoryUpdateOne is the builder for updating a single EventHistory entity. +type EventHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *EventHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ehuo *EventHistoryUpdateOne) SetUpdatedAt(t time.Time) *EventHistoryUpdateOne { + ehuo.mutation.SetUpdatedAt(t) + return ehuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ehuo *EventHistoryUpdateOne) ClearUpdatedAt() *EventHistoryUpdateOne { + ehuo.mutation.ClearUpdatedAt() + return ehuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ehuo *EventHistoryUpdateOne) SetUpdatedBy(s string) *EventHistoryUpdateOne { + ehuo.mutation.SetUpdatedBy(s) + return ehuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ehuo *EventHistoryUpdateOne) SetNillableUpdatedBy(s *string) *EventHistoryUpdateOne { + if s != nil { + ehuo.SetUpdatedBy(*s) + } + return ehuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ehuo *EventHistoryUpdateOne) ClearUpdatedBy() *EventHistoryUpdateOne { + ehuo.mutation.ClearUpdatedBy() + return ehuo +} + +// SetTags sets the "tags" field. +func (ehuo *EventHistoryUpdateOne) SetTags(s []string) *EventHistoryUpdateOne { + ehuo.mutation.SetTags(s) + return ehuo +} + +// AppendTags appends s to the "tags" field. +func (ehuo *EventHistoryUpdateOne) AppendTags(s []string) *EventHistoryUpdateOne { + ehuo.mutation.AppendTags(s) + return ehuo +} + +// ClearTags clears the value of the "tags" field. +func (ehuo *EventHistoryUpdateOne) ClearTags() *EventHistoryUpdateOne { + ehuo.mutation.ClearTags() + return ehuo +} + +// SetEventID sets the "event_id" field. +func (ehuo *EventHistoryUpdateOne) SetEventID(s string) *EventHistoryUpdateOne { + ehuo.mutation.SetEventID(s) + return ehuo +} + +// SetNillableEventID sets the "event_id" field if the given value is not nil. +func (ehuo *EventHistoryUpdateOne) SetNillableEventID(s *string) *EventHistoryUpdateOne { + if s != nil { + ehuo.SetEventID(*s) + } + return ehuo +} + +// ClearEventID clears the value of the "event_id" field. +func (ehuo *EventHistoryUpdateOne) ClearEventID() *EventHistoryUpdateOne { + ehuo.mutation.ClearEventID() + return ehuo +} + +// SetCorrelationID sets the "correlation_id" field. +func (ehuo *EventHistoryUpdateOne) SetCorrelationID(s string) *EventHistoryUpdateOne { + ehuo.mutation.SetCorrelationID(s) + return ehuo +} + +// SetNillableCorrelationID sets the "correlation_id" field if the given value is not nil. +func (ehuo *EventHistoryUpdateOne) SetNillableCorrelationID(s *string) *EventHistoryUpdateOne { + if s != nil { + ehuo.SetCorrelationID(*s) + } + return ehuo +} + +// ClearCorrelationID clears the value of the "correlation_id" field. +func (ehuo *EventHistoryUpdateOne) ClearCorrelationID() *EventHistoryUpdateOne { + ehuo.mutation.ClearCorrelationID() + return ehuo +} + +// SetEventType sets the "event_type" field. +func (ehuo *EventHistoryUpdateOne) SetEventType(s string) *EventHistoryUpdateOne { + ehuo.mutation.SetEventType(s) + return ehuo +} + +// SetNillableEventType sets the "event_type" field if the given value is not nil. +func (ehuo *EventHistoryUpdateOne) SetNillableEventType(s *string) *EventHistoryUpdateOne { + if s != nil { + ehuo.SetEventType(*s) + } + return ehuo +} + +// SetMetadata sets the "metadata" field. +func (ehuo *EventHistoryUpdateOne) SetMetadata(m map[string]interface{}) *EventHistoryUpdateOne { + ehuo.mutation.SetMetadata(m) + return ehuo +} + +// ClearMetadata clears the value of the "metadata" field. +func (ehuo *EventHistoryUpdateOne) ClearMetadata() *EventHistoryUpdateOne { + ehuo.mutation.ClearMetadata() + return ehuo +} + +// Mutation returns the EventHistoryMutation object of the builder. +func (ehuo *EventHistoryUpdateOne) Mutation() *EventHistoryMutation { + return ehuo.mutation +} + +// Where appends a list predicates to the EventHistoryUpdate builder. +func (ehuo *EventHistoryUpdateOne) Where(ps ...predicate.EventHistory) *EventHistoryUpdateOne { + ehuo.mutation.Where(ps...) + return ehuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ehuo *EventHistoryUpdateOne) Select(field string, fields ...string) *EventHistoryUpdateOne { + ehuo.fields = append([]string{field}, fields...) + return ehuo +} + +// Save executes the query and returns the updated EventHistory entity. +func (ehuo *EventHistoryUpdateOne) Save(ctx context.Context) (*EventHistory, error) { + ehuo.defaults() + return withHooks(ctx, ehuo.sqlSave, ehuo.mutation, ehuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ehuo *EventHistoryUpdateOne) SaveX(ctx context.Context) *EventHistory { + node, err := ehuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ehuo *EventHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ehuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ehuo *EventHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ehuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ehuo *EventHistoryUpdateOne) defaults() { + if _, ok := ehuo.mutation.UpdatedAt(); !ok && !ehuo.mutation.UpdatedAtCleared() { + v := eventhistory.UpdateDefaultUpdatedAt() + ehuo.mutation.SetUpdatedAt(v) + } +} + +func (ehuo *EventHistoryUpdateOne) sqlSave(ctx context.Context) (_node *EventHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(eventhistory.Table, eventhistory.Columns, sqlgraph.NewFieldSpec(eventhistory.FieldID, field.TypeString)) + id, ok := ehuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "EventHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ehuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, eventhistory.FieldID) + for _, f := range fields { + if !eventhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != eventhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ehuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ehuo.mutation.RefCleared() { + _spec.ClearField(eventhistory.FieldRef, field.TypeString) + } + if ehuo.mutation.CreatedAtCleared() { + _spec.ClearField(eventhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ehuo.mutation.UpdatedAt(); ok { + _spec.SetField(eventhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ehuo.mutation.UpdatedAtCleared() { + _spec.ClearField(eventhistory.FieldUpdatedAt, field.TypeTime) + } + if ehuo.mutation.CreatedByCleared() { + _spec.ClearField(eventhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ehuo.mutation.UpdatedBy(); ok { + _spec.SetField(eventhistory.FieldUpdatedBy, field.TypeString, value) + } + if ehuo.mutation.UpdatedByCleared() { + _spec.ClearField(eventhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ehuo.mutation.Tags(); ok { + _spec.SetField(eventhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ehuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, eventhistory.FieldTags, value) + }) + } + if ehuo.mutation.TagsCleared() { + _spec.ClearField(eventhistory.FieldTags, field.TypeJSON) + } + if value, ok := ehuo.mutation.EventID(); ok { + _spec.SetField(eventhistory.FieldEventID, field.TypeString, value) + } + if ehuo.mutation.EventIDCleared() { + _spec.ClearField(eventhistory.FieldEventID, field.TypeString) + } + if value, ok := ehuo.mutation.CorrelationID(); ok { + _spec.SetField(eventhistory.FieldCorrelationID, field.TypeString, value) + } + if ehuo.mutation.CorrelationIDCleared() { + _spec.ClearField(eventhistory.FieldCorrelationID, field.TypeString) + } + if value, ok := ehuo.mutation.EventType(); ok { + _spec.SetField(eventhistory.FieldEventType, field.TypeString, value) + } + if value, ok := ehuo.mutation.Metadata(); ok { + _spec.SetField(eventhistory.FieldMetadata, field.TypeJSON, value) + } + if ehuo.mutation.MetadataCleared() { + _spec.ClearField(eventhistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = ehuo.schemaConfig.EventHistory + ctx = internal.NewSchemaConfigContext(ctx, ehuo.schemaConfig) + _node = &EventHistory{config: ehuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ehuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{eventhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ehuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/feature.go b/internal/ent/generated/feature.go new file mode 100644 index 0000000..10372b5 --- /dev/null +++ b/internal/ent/generated/feature.go @@ -0,0 +1,414 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// Feature is the model entity for the Feature schema. +type Feature struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the unique name of the feature + Name string `json:"name,omitempty"` + // the displayed 'friendly' name of the feature + DisplayName string `json:"display_name,omitempty"` + // enabled features are available for use + Enabled bool `json:"enabled,omitempty"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the FeatureQuery when eager-loading is set. + Edges FeatureEdges `json:"edges"` + selectValues sql.SelectValues +} + +// FeatureEdges holds the relations/edges for other nodes in the graph. +type FeatureEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Plans holds the value of the plans edge. + Plans []*EntitlementPlan `json:"plans,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // Features holds the value of the features edge. + Features []*EntitlementPlanFeature `json:"features,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [4]bool + // totalCount holds the count of the edges above. + totalCount [4]map[string]int + + namedPlans map[string][]*EntitlementPlan + namedEvents map[string][]*Event + namedFeatures map[string][]*EntitlementPlanFeature +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e FeatureEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// PlansOrErr returns the Plans value or an error if the edge +// was not loaded in eager-loading. +func (e FeatureEdges) PlansOrErr() ([]*EntitlementPlan, error) { + if e.loadedTypes[1] { + return e.Plans, nil + } + return nil, &NotLoadedError{edge: "plans"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e FeatureEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[2] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// FeaturesOrErr returns the Features value or an error if the edge +// was not loaded in eager-loading. +func (e FeatureEdges) FeaturesOrErr() ([]*EntitlementPlanFeature, error) { + if e.loadedTypes[3] { + return e.Features, nil + } + return nil, &NotLoadedError{edge: "features"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Feature) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case feature.FieldTags, feature.FieldMetadata: + values[i] = new([]byte) + case feature.FieldEnabled: + values[i] = new(sql.NullBool) + case feature.FieldID, feature.FieldCreatedBy, feature.FieldUpdatedBy, feature.FieldDeletedBy, feature.FieldMappingID, feature.FieldOwnerID, feature.FieldName, feature.FieldDisplayName, feature.FieldDescription: + values[i] = new(sql.NullString) + case feature.FieldCreatedAt, feature.FieldUpdatedAt, feature.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Feature fields. +func (f *Feature) 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 feature.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + f.ID = value.String + } + case feature.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + f.CreatedAt = value.Time + } + case feature.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + f.UpdatedAt = value.Time + } + case feature.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + f.CreatedBy = value.String + } + case feature.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + f.UpdatedBy = value.String + } + case feature.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + f.DeletedAt = value.Time + } + case feature.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + f.DeletedBy = value.String + } + case feature.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + f.MappingID = value.String + } + case feature.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &f.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case feature.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + f.OwnerID = value.String + } + case feature.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + f.Name = value.String + } + case feature.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + f.DisplayName = value.String + } + case feature.FieldEnabled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field enabled", values[i]) + } else if value.Valid { + f.Enabled = value.Bool + } + case feature.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + f.Description = new(string) + *f.Description = value.String + } + case feature.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &f.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + default: + f.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Feature. +// This includes values selected through modifiers, order, etc. +func (f *Feature) Value(name string) (ent.Value, error) { + return f.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Feature entity. +func (f *Feature) QueryOwner() *OrganizationQuery { + return NewFeatureClient(f.config).QueryOwner(f) +} + +// QueryPlans queries the "plans" edge of the Feature entity. +func (f *Feature) QueryPlans() *EntitlementPlanQuery { + return NewFeatureClient(f.config).QueryPlans(f) +} + +// QueryEvents queries the "events" edge of the Feature entity. +func (f *Feature) QueryEvents() *EventQuery { + return NewFeatureClient(f.config).QueryEvents(f) +} + +// QueryFeatures queries the "features" edge of the Feature entity. +func (f *Feature) QueryFeatures() *EntitlementPlanFeatureQuery { + return NewFeatureClient(f.config).QueryFeatures(f) +} + +// Update returns a builder for updating this Feature. +// Note that you need to call Feature.Unwrap() before calling this method if this Feature +// was returned from a transaction, and the transaction was committed or rolled back. +func (f *Feature) Update() *FeatureUpdateOne { + return NewFeatureClient(f.config).UpdateOne(f) +} + +// Unwrap unwraps the Feature 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 (f *Feature) Unwrap() *Feature { + _tx, ok := f.config.driver.(*txDriver) + if !ok { + panic("generated: Feature is not a transactional entity") + } + f.config.driver = _tx.drv + return f +} + +// String implements the fmt.Stringer. +func (f *Feature) String() string { + var builder strings.Builder + builder.WriteString("Feature(") + builder.WriteString(fmt.Sprintf("id=%v, ", f.ID)) + builder.WriteString("created_at=") + builder.WriteString(f.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(f.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(f.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(f.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(f.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(f.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(f.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", f.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(f.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(f.Name) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(f.DisplayName) + builder.WriteString(", ") + builder.WriteString("enabled=") + builder.WriteString(fmt.Sprintf("%v", f.Enabled)) + builder.WriteString(", ") + if v := f.Description; v != nil { + builder.WriteString("description=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", f.Metadata)) + builder.WriteByte(')') + return builder.String() +} + +// NamedPlans returns the Plans named value or an error if the edge was not +// loaded in eager-loading with this name. +func (f *Feature) NamedPlans(name string) ([]*EntitlementPlan, error) { + if f.Edges.namedPlans == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := f.Edges.namedPlans[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (f *Feature) appendNamedPlans(name string, edges ...*EntitlementPlan) { + if f.Edges.namedPlans == nil { + f.Edges.namedPlans = make(map[string][]*EntitlementPlan) + } + if len(edges) == 0 { + f.Edges.namedPlans[name] = []*EntitlementPlan{} + } else { + f.Edges.namedPlans[name] = append(f.Edges.namedPlans[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (f *Feature) NamedEvents(name string) ([]*Event, error) { + if f.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := f.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (f *Feature) appendNamedEvents(name string, edges ...*Event) { + if f.Edges.namedEvents == nil { + f.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + f.Edges.namedEvents[name] = []*Event{} + } else { + f.Edges.namedEvents[name] = append(f.Edges.namedEvents[name], edges...) + } +} + +// NamedFeatures returns the Features named value or an error if the edge was not +// loaded in eager-loading with this name. +func (f *Feature) NamedFeatures(name string) ([]*EntitlementPlanFeature, error) { + if f.Edges.namedFeatures == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := f.Edges.namedFeatures[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (f *Feature) appendNamedFeatures(name string, edges ...*EntitlementPlanFeature) { + if f.Edges.namedFeatures == nil { + f.Edges.namedFeatures = make(map[string][]*EntitlementPlanFeature) + } + if len(edges) == 0 { + f.Edges.namedFeatures[name] = []*EntitlementPlanFeature{} + } else { + f.Edges.namedFeatures[name] = append(f.Edges.namedFeatures[name], edges...) + } +} + +// Features is a parsable slice of Feature. +type Features []*Feature diff --git a/internal/ent/generated/feature/feature.go b/internal/ent/generated/feature/feature.go new file mode 100644 index 0000000..6efe7fc --- /dev/null +++ b/internal/ent/generated/feature/feature.go @@ -0,0 +1,292 @@ +// Code generated by ent, DO NOT EDIT. + +package feature + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the feature type in the database. + Label = "feature" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldEnabled holds the string denoting the enabled field in the database. + FieldEnabled = "enabled" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgePlans holds the string denoting the plans edge name in mutations. + EdgePlans = "plans" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // EdgeFeatures holds the string denoting the features edge name in mutations. + EdgeFeatures = "features" + // Table holds the table name of the feature in the database. + Table = "features" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "features" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // PlansTable is the table that holds the plans relation/edge. The primary key declared below. + PlansTable = "entitlement_plan_features" + // PlansInverseTable is the table name for the EntitlementPlan entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplan" package. + PlansInverseTable = "entitlement_plans" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "feature_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" + // FeaturesTable is the table that holds the features relation/edge. + FeaturesTable = "entitlement_plan_features" + // FeaturesInverseTable is the table name for the EntitlementPlanFeature entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplanfeature" package. + FeaturesInverseTable = "entitlement_plan_features" + // FeaturesColumn is the table column denoting the features relation/edge. + FeaturesColumn = "feature_id" +) + +// Columns holds all SQL columns for feature fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldDisplayName, + FieldEnabled, + FieldDescription, + FieldMetadata, +} + +var ( + // PlansPrimaryKey and PlansColumn2 are the table columns denoting the + // primary key for the plans relation (M2M). + PlansPrimaryKey = []string{"feature_id", "plan_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"feature_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultEnabled holds the default value on creation for the "enabled" field. + DefaultEnabled bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Feature queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByEnabled orders the results by the enabled field. +func ByEnabled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEnabled, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByPlansCount orders the results by plans count. +func ByPlansCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newPlansStep(), opts...) + } +} + +// ByPlans orders the results by plans terms. +func ByPlans(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPlansStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFeaturesCount orders the results by features count. +func ByFeaturesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFeaturesStep(), opts...) + } +} + +// ByFeatures orders the results by features terms. +func ByFeatures(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFeaturesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newPlansStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PlansInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, PlansTable, PlansPrimaryKey...), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} +func newFeaturesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FeaturesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, FeaturesTable, FeaturesColumn), + ) +} diff --git a/internal/ent/generated/feature/where.go b/internal/ent/generated/feature/where.go new file mode 100644 index 0000000..fad7454 --- /dev/null +++ b/internal/ent/generated/feature/where.go @@ -0,0 +1,1019 @@ +// Code generated by ent, DO NOT EDIT. + +package feature + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDisplayName, v)) +} + +// Enabled applies equality check predicate on the "enabled" field. It's identical to EnabledEQ. +func Enabled(v bool) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldEnabled, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDescription, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameIsNil applies the IsNil predicate on the "display_name" field. +func DisplayNameIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldDisplayName)) +} + +// DisplayNameNotNil applies the NotNil predicate on the "display_name" field. +func DisplayNameNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldDisplayName)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// EnabledEQ applies the EQ predicate on the "enabled" field. +func EnabledEQ(v bool) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldEnabled, v)) +} + +// EnabledNEQ applies the NEQ predicate on the "enabled" field. +func EnabledNEQ(v bool) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldEnabled, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Feature { + return predicate.Feature(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Feature { + return predicate.Feature(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Feature { + return predicate.Feature(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Feature { + return predicate.Feature(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Feature { + return predicate.Feature(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Feature { + return predicate.Feature(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Feature { + return predicate.Feature(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Feature { + return predicate.Feature(sql.FieldContainsFold(FieldDescription, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.Feature { + return predicate.Feature(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.Feature { + return predicate.Feature(sql.FieldNotNull(FieldMetadata)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Feature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Feature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasPlans applies the HasEdge predicate on the "plans" edge. +func HasPlans() predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, PlansTable, PlansPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPlansWith applies the HasEdge predicate on the "plans" edge with a given conditions (other predicates). +func HasPlansWith(preds ...predicate.EntitlementPlan) predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := newPlansStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.FeatureEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.FeatureEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFeatures applies the HasEdge predicate on the "features" edge. +func HasFeatures() predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, FeaturesTable, FeaturesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFeaturesWith applies the HasEdge predicate on the "features" edge with a given conditions (other predicates). +func HasFeaturesWith(preds ...predicate.EntitlementPlanFeature) predicate.Feature { + return predicate.Feature(func(s *sql.Selector) { + step := newFeaturesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + 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.Feature) predicate.Feature { + return predicate.Feature(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Feature) predicate.Feature { + return predicate.Feature(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Feature) predicate.Feature { + return predicate.Feature(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/feature_create.go b/internal/ent/generated/feature_create.go new file mode 100644 index 0000000..0934e61 --- /dev/null +++ b/internal/ent/generated/feature_create.go @@ -0,0 +1,609 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// FeatureCreate is the builder for creating a Feature entity. +type FeatureCreate struct { + config + mutation *FeatureMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (fc *FeatureCreate) SetCreatedAt(t time.Time) *FeatureCreate { + fc.mutation.SetCreatedAt(t) + return fc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableCreatedAt(t *time.Time) *FeatureCreate { + if t != nil { + fc.SetCreatedAt(*t) + } + return fc +} + +// SetUpdatedAt sets the "updated_at" field. +func (fc *FeatureCreate) SetUpdatedAt(t time.Time) *FeatureCreate { + fc.mutation.SetUpdatedAt(t) + return fc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableUpdatedAt(t *time.Time) *FeatureCreate { + if t != nil { + fc.SetUpdatedAt(*t) + } + return fc +} + +// SetCreatedBy sets the "created_by" field. +func (fc *FeatureCreate) SetCreatedBy(s string) *FeatureCreate { + fc.mutation.SetCreatedBy(s) + return fc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableCreatedBy(s *string) *FeatureCreate { + if s != nil { + fc.SetCreatedBy(*s) + } + return fc +} + +// SetUpdatedBy sets the "updated_by" field. +func (fc *FeatureCreate) SetUpdatedBy(s string) *FeatureCreate { + fc.mutation.SetUpdatedBy(s) + return fc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableUpdatedBy(s *string) *FeatureCreate { + if s != nil { + fc.SetUpdatedBy(*s) + } + return fc +} + +// SetDeletedAt sets the "deleted_at" field. +func (fc *FeatureCreate) SetDeletedAt(t time.Time) *FeatureCreate { + fc.mutation.SetDeletedAt(t) + return fc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableDeletedAt(t *time.Time) *FeatureCreate { + if t != nil { + fc.SetDeletedAt(*t) + } + return fc +} + +// SetDeletedBy sets the "deleted_by" field. +func (fc *FeatureCreate) SetDeletedBy(s string) *FeatureCreate { + fc.mutation.SetDeletedBy(s) + return fc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableDeletedBy(s *string) *FeatureCreate { + if s != nil { + fc.SetDeletedBy(*s) + } + return fc +} + +// SetMappingID sets the "mapping_id" field. +func (fc *FeatureCreate) SetMappingID(s string) *FeatureCreate { + fc.mutation.SetMappingID(s) + return fc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableMappingID(s *string) *FeatureCreate { + if s != nil { + fc.SetMappingID(*s) + } + return fc +} + +// SetTags sets the "tags" field. +func (fc *FeatureCreate) SetTags(s []string) *FeatureCreate { + fc.mutation.SetTags(s) + return fc +} + +// SetOwnerID sets the "owner_id" field. +func (fc *FeatureCreate) SetOwnerID(s string) *FeatureCreate { + fc.mutation.SetOwnerID(s) + return fc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableOwnerID(s *string) *FeatureCreate { + if s != nil { + fc.SetOwnerID(*s) + } + return fc +} + +// SetName sets the "name" field. +func (fc *FeatureCreate) SetName(s string) *FeatureCreate { + fc.mutation.SetName(s) + return fc +} + +// SetDisplayName sets the "display_name" field. +func (fc *FeatureCreate) SetDisplayName(s string) *FeatureCreate { + fc.mutation.SetDisplayName(s) + return fc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableDisplayName(s *string) *FeatureCreate { + if s != nil { + fc.SetDisplayName(*s) + } + return fc +} + +// SetEnabled sets the "enabled" field. +func (fc *FeatureCreate) SetEnabled(b bool) *FeatureCreate { + fc.mutation.SetEnabled(b) + return fc +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableEnabled(b *bool) *FeatureCreate { + if b != nil { + fc.SetEnabled(*b) + } + return fc +} + +// SetDescription sets the "description" field. +func (fc *FeatureCreate) SetDescription(s string) *FeatureCreate { + fc.mutation.SetDescription(s) + return fc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableDescription(s *string) *FeatureCreate { + if s != nil { + fc.SetDescription(*s) + } + return fc +} + +// SetMetadata sets the "metadata" field. +func (fc *FeatureCreate) SetMetadata(m map[string]interface{}) *FeatureCreate { + fc.mutation.SetMetadata(m) + return fc +} + +// SetID sets the "id" field. +func (fc *FeatureCreate) SetID(s string) *FeatureCreate { + fc.mutation.SetID(s) + return fc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (fc *FeatureCreate) SetNillableID(s *string) *FeatureCreate { + if s != nil { + fc.SetID(*s) + } + return fc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (fc *FeatureCreate) SetOwner(o *Organization) *FeatureCreate { + return fc.SetOwnerID(o.ID) +} + +// AddPlanIDs adds the "plans" edge to the EntitlementPlan entity by IDs. +func (fc *FeatureCreate) AddPlanIDs(ids ...string) *FeatureCreate { + fc.mutation.AddPlanIDs(ids...) + return fc +} + +// AddPlans adds the "plans" edges to the EntitlementPlan entity. +func (fc *FeatureCreate) AddPlans(e ...*EntitlementPlan) *FeatureCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fc.AddPlanIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (fc *FeatureCreate) AddEventIDs(ids ...string) *FeatureCreate { + fc.mutation.AddEventIDs(ids...) + return fc +} + +// AddEvents adds the "events" edges to the Event entity. +func (fc *FeatureCreate) AddEvents(e ...*Event) *FeatureCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fc.AddEventIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by IDs. +func (fc *FeatureCreate) AddFeatureIDs(ids ...string) *FeatureCreate { + fc.mutation.AddFeatureIDs(ids...) + return fc +} + +// AddFeatures adds the "features" edges to the EntitlementPlanFeature entity. +func (fc *FeatureCreate) AddFeatures(e ...*EntitlementPlanFeature) *FeatureCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fc.AddFeatureIDs(ids...) +} + +// Mutation returns the FeatureMutation object of the builder. +func (fc *FeatureCreate) Mutation() *FeatureMutation { + return fc.mutation +} + +// Save creates the Feature in the database. +func (fc *FeatureCreate) Save(ctx context.Context) (*Feature, error) { + if err := fc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, fc.sqlSave, fc.mutation, fc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (fc *FeatureCreate) SaveX(ctx context.Context) *Feature { + v, err := fc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fc *FeatureCreate) Exec(ctx context.Context) error { + _, err := fc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fc *FeatureCreate) ExecX(ctx context.Context) { + if err := fc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fc *FeatureCreate) defaults() error { + if _, ok := fc.mutation.CreatedAt(); !ok { + if feature.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized feature.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := feature.DefaultCreatedAt() + fc.mutation.SetCreatedAt(v) + } + if _, ok := fc.mutation.UpdatedAt(); !ok { + if feature.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized feature.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := feature.DefaultUpdatedAt() + fc.mutation.SetUpdatedAt(v) + } + if _, ok := fc.mutation.MappingID(); !ok { + if feature.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized feature.DefaultMappingID (forgotten import generated/runtime?)") + } + v := feature.DefaultMappingID() + fc.mutation.SetMappingID(v) + } + if _, ok := fc.mutation.Tags(); !ok { + v := feature.DefaultTags + fc.mutation.SetTags(v) + } + if _, ok := fc.mutation.Enabled(); !ok { + v := feature.DefaultEnabled + fc.mutation.SetEnabled(v) + } + if _, ok := fc.mutation.ID(); !ok { + if feature.DefaultID == nil { + return fmt.Errorf("generated: uninitialized feature.DefaultID (forgotten import generated/runtime?)") + } + v := feature.DefaultID() + fc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (fc *FeatureCreate) check() error { + if _, ok := fc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Feature.mapping_id"`)} + } + if v, ok := fc.mutation.OwnerID(); ok { + if err := feature.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Feature.owner_id": %w`, err)} + } + } + if _, ok := fc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "Feature.name"`)} + } + if v, ok := fc.mutation.Name(); ok { + if err := feature.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Feature.name": %w`, err)} + } + } + if _, ok := fc.mutation.Enabled(); !ok { + return &ValidationError{Name: "enabled", err: errors.New(`generated: missing required field "Feature.enabled"`)} + } + return nil +} + +func (fc *FeatureCreate) sqlSave(ctx context.Context) (*Feature, error) { + if err := fc.check(); err != nil { + return nil, err + } + _node, _spec := fc.createSpec() + if err := sqlgraph.CreateNode(ctx, fc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Feature.ID type: %T", _spec.ID.Value) + } + } + fc.mutation.id = &_node.ID + fc.mutation.done = true + return _node, nil +} + +func (fc *FeatureCreate) createSpec() (*Feature, *sqlgraph.CreateSpec) { + var ( + _node = &Feature{config: fc.config} + _spec = sqlgraph.NewCreateSpec(feature.Table, sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString)) + ) + _spec.Schema = fc.schemaConfig.Feature + if id, ok := fc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := fc.mutation.CreatedAt(); ok { + _spec.SetField(feature.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := fc.mutation.UpdatedAt(); ok { + _spec.SetField(feature.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := fc.mutation.CreatedBy(); ok { + _spec.SetField(feature.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := fc.mutation.UpdatedBy(); ok { + _spec.SetField(feature.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := fc.mutation.DeletedAt(); ok { + _spec.SetField(feature.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := fc.mutation.DeletedBy(); ok { + _spec.SetField(feature.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := fc.mutation.MappingID(); ok { + _spec.SetField(feature.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := fc.mutation.Tags(); ok { + _spec.SetField(feature.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := fc.mutation.Name(); ok { + _spec.SetField(feature.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := fc.mutation.DisplayName(); ok { + _spec.SetField(feature.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := fc.mutation.Enabled(); ok { + _spec.SetField(feature.FieldEnabled, field.TypeBool, value) + _node.Enabled = value + } + if value, ok := fc.mutation.Description(); ok { + _spec.SetField(feature.FieldDescription, field.TypeString, value) + _node.Description = &value + } + if value, ok := fc.mutation.Metadata(); ok { + _spec.SetField(feature.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + if nodes := fc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: feature.OwnerTable, + Columns: []string{feature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := fc.mutation.PlansIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: fc.config, mutation: newEntitlementPlanFeatureMutation(fc.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := fc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := fc.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// FeatureCreateBulk is the builder for creating many Feature entities in bulk. +type FeatureCreateBulk struct { + config + err error + builders []*FeatureCreate +} + +// Save creates the Feature entities in the database. +func (fcb *FeatureCreateBulk) Save(ctx context.Context) ([]*Feature, error) { + if fcb.err != nil { + return nil, fcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(fcb.builders)) + nodes := make([]*Feature, len(fcb.builders)) + mutators := make([]Mutator, len(fcb.builders)) + for i := range fcb.builders { + func(i int, root context.Context) { + builder := fcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*FeatureMutation) + 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, fcb.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, fcb.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, fcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (fcb *FeatureCreateBulk) SaveX(ctx context.Context) []*Feature { + v, err := fcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fcb *FeatureCreateBulk) Exec(ctx context.Context) error { + _, err := fcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fcb *FeatureCreateBulk) ExecX(ctx context.Context) { + if err := fcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/feature_delete.go b/internal/ent/generated/feature_delete.go new file mode 100644 index 0000000..7fd6db1 --- /dev/null +++ b/internal/ent/generated/feature_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FeatureDelete is the builder for deleting a Feature entity. +type FeatureDelete struct { + config + hooks []Hook + mutation *FeatureMutation +} + +// Where appends a list predicates to the FeatureDelete builder. +func (fd *FeatureDelete) Where(ps ...predicate.Feature) *FeatureDelete { + fd.mutation.Where(ps...) + return fd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (fd *FeatureDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, fd.sqlExec, fd.mutation, fd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (fd *FeatureDelete) ExecX(ctx context.Context) int { + n, err := fd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (fd *FeatureDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(feature.Table, sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString)) + _spec.Node.Schema = fd.schemaConfig.Feature + ctx = internal.NewSchemaConfigContext(ctx, fd.schemaConfig) + if ps := fd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, fd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + fd.mutation.done = true + return affected, err +} + +// FeatureDeleteOne is the builder for deleting a single Feature entity. +type FeatureDeleteOne struct { + fd *FeatureDelete +} + +// Where appends a list predicates to the FeatureDelete builder. +func (fdo *FeatureDeleteOne) Where(ps ...predicate.Feature) *FeatureDeleteOne { + fdo.fd.mutation.Where(ps...) + return fdo +} + +// Exec executes the deletion query. +func (fdo *FeatureDeleteOne) Exec(ctx context.Context) error { + n, err := fdo.fd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{feature.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (fdo *FeatureDeleteOne) ExecX(ctx context.Context) { + if err := fdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/feature_query.go b/internal/ent/generated/feature_query.go new file mode 100644 index 0000000..113ccc1 --- /dev/null +++ b/internal/ent/generated/feature_query.go @@ -0,0 +1,1000 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FeatureQuery is the builder for querying Feature entities. +type FeatureQuery struct { + config + ctx *QueryContext + order []feature.OrderOption + inters []Interceptor + predicates []predicate.Feature + withOwner *OrganizationQuery + withPlans *EntitlementPlanQuery + withEvents *EventQuery + withFeatures *EntitlementPlanFeatureQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Feature) error + withNamedPlans map[string]*EntitlementPlanQuery + withNamedEvents map[string]*EventQuery + withNamedFeatures map[string]*EntitlementPlanFeatureQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the FeatureQuery builder. +func (fq *FeatureQuery) Where(ps ...predicate.Feature) *FeatureQuery { + fq.predicates = append(fq.predicates, ps...) + return fq +} + +// Limit the number of records to be returned by this query. +func (fq *FeatureQuery) Limit(limit int) *FeatureQuery { + fq.ctx.Limit = &limit + return fq +} + +// Offset to start from. +func (fq *FeatureQuery) Offset(offset int) *FeatureQuery { + fq.ctx.Offset = &offset + return fq +} + +// 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 (fq *FeatureQuery) Unique(unique bool) *FeatureQuery { + fq.ctx.Unique = &unique + return fq +} + +// Order specifies how the records should be ordered. +func (fq *FeatureQuery) Order(o ...feature.OrderOption) *FeatureQuery { + fq.order = append(fq.order, o...) + return fq +} + +// QueryOwner chains the current query on the "owner" edge. +func (fq *FeatureQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, feature.OwnerTable, feature.OwnerColumn), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Feature + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryPlans chains the current query on the "plans" edge. +func (fq *FeatureQuery) QueryPlans() *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, selector), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, feature.PlansTable, feature.PlansPrimaryKey...), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (fq *FeatureQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, feature.EventsTable, feature.EventsPrimaryKey...), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.FeatureEvents + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFeatures chains the current query on the "features" edge. +func (fq *FeatureQuery) QueryFeatures() *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(feature.Table, feature.FieldID, selector), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, feature.FeaturesTable, feature.FeaturesColumn), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Feature entity from the query. +// Returns a *NotFoundError when no Feature was found. +func (fq *FeatureQuery) First(ctx context.Context) (*Feature, error) { + nodes, err := fq.Limit(1).All(setContextOp(ctx, fq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{feature.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (fq *FeatureQuery) FirstX(ctx context.Context) *Feature { + node, err := fq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Feature ID from the query. +// Returns a *NotFoundError when no Feature ID was found. +func (fq *FeatureQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fq.Limit(1).IDs(setContextOp(ctx, fq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{feature.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (fq *FeatureQuery) FirstIDX(ctx context.Context) string { + id, err := fq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Feature entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Feature entity is found. +// Returns a *NotFoundError when no Feature entities are found. +func (fq *FeatureQuery) Only(ctx context.Context) (*Feature, error) { + nodes, err := fq.Limit(2).All(setContextOp(ctx, fq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{feature.Label} + default: + return nil, &NotSingularError{feature.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (fq *FeatureQuery) OnlyX(ctx context.Context) *Feature { + node, err := fq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Feature ID in the query. +// Returns a *NotSingularError when more than one Feature ID is found. +// Returns a *NotFoundError when no entities are found. +func (fq *FeatureQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fq.Limit(2).IDs(setContextOp(ctx, fq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{feature.Label} + default: + err = &NotSingularError{feature.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (fq *FeatureQuery) OnlyIDX(ctx context.Context) string { + id, err := fq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Features. +func (fq *FeatureQuery) All(ctx context.Context) ([]*Feature, error) { + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryAll) + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Feature, *FeatureQuery]() + return withInterceptors[[]*Feature](ctx, fq, qr, fq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (fq *FeatureQuery) AllX(ctx context.Context) []*Feature { + nodes, err := fq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Feature IDs. +func (fq *FeatureQuery) IDs(ctx context.Context) (ids []string, err error) { + if fq.ctx.Unique == nil && fq.path != nil { + fq.Unique(true) + } + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryIDs) + if err = fq.Select(feature.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (fq *FeatureQuery) IDsX(ctx context.Context) []string { + ids, err := fq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (fq *FeatureQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryCount) + if err := fq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, fq, querierCount[*FeatureQuery](), fq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (fq *FeatureQuery) CountX(ctx context.Context) int { + count, err := fq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (fq *FeatureQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryExist) + switch _, err := fq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (fq *FeatureQuery) ExistX(ctx context.Context) bool { + exist, err := fq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the FeatureQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (fq *FeatureQuery) Clone() *FeatureQuery { + if fq == nil { + return nil + } + return &FeatureQuery{ + config: fq.config, + ctx: fq.ctx.Clone(), + order: append([]feature.OrderOption{}, fq.order...), + inters: append([]Interceptor{}, fq.inters...), + predicates: append([]predicate.Feature{}, fq.predicates...), + withOwner: fq.withOwner.Clone(), + withPlans: fq.withPlans.Clone(), + withEvents: fq.withEvents.Clone(), + withFeatures: fq.withFeatures.Clone(), + // clone intermediate query. + sql: fq.sql.Clone(), + path: fq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FeatureQuery) WithOwner(opts ...func(*OrganizationQuery)) *FeatureQuery { + query := (&OrganizationClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withOwner = query + return fq +} + +// WithPlans tells the query-builder to eager-load the nodes that are connected to +// the "plans" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FeatureQuery) WithPlans(opts ...func(*EntitlementPlanQuery)) *FeatureQuery { + query := (&EntitlementPlanClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withPlans = query + return fq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FeatureQuery) WithEvents(opts ...func(*EventQuery)) *FeatureQuery { + query := (&EventClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withEvents = query + return fq +} + +// WithFeatures tells the query-builder to eager-load the nodes that are connected to +// the "features" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FeatureQuery) WithFeatures(opts ...func(*EntitlementPlanFeatureQuery)) *FeatureQuery { + query := (&EntitlementPlanFeatureClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withFeatures = query + return fq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Feature.Query(). +// GroupBy(feature.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (fq *FeatureQuery) GroupBy(field string, fields ...string) *FeatureGroupBy { + fq.ctx.Fields = append([]string{field}, fields...) + grbuild := &FeatureGroupBy{build: fq} + grbuild.flds = &fq.ctx.Fields + grbuild.label = feature.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Feature.Query(). +// Select(feature.FieldCreatedAt). +// Scan(ctx, &v) +func (fq *FeatureQuery) Select(fields ...string) *FeatureSelect { + fq.ctx.Fields = append(fq.ctx.Fields, fields...) + sbuild := &FeatureSelect{FeatureQuery: fq} + sbuild.label = feature.Label + sbuild.flds, sbuild.scan = &fq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a FeatureSelect configured with the given aggregations. +func (fq *FeatureQuery) Aggregate(fns ...AggregateFunc) *FeatureSelect { + return fq.Select().Aggregate(fns...) +} + +func (fq *FeatureQuery) prepareQuery(ctx context.Context) error { + for _, inter := range fq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, fq); err != nil { + return err + } + } + } + for _, f := range fq.ctx.Fields { + if !feature.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if fq.path != nil { + prev, err := fq.path(ctx) + if err != nil { + return err + } + fq.sql = prev + } + if feature.Policy == nil { + return errors.New("generated: uninitialized feature.Policy (forgotten import generated/runtime?)") + } + if err := feature.Policy.EvalQuery(ctx, fq); err != nil { + return err + } + return nil +} + +func (fq *FeatureQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Feature, error) { + var ( + nodes = []*Feature{} + _spec = fq.querySpec() + loadedTypes = [4]bool{ + fq.withOwner != nil, + fq.withPlans != nil, + fq.withEvents != nil, + fq.withFeatures != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Feature).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Feature{config: fq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = fq.schemaConfig.Feature + ctx = internal.NewSchemaConfigContext(ctx, fq.schemaConfig) + if len(fq.modifiers) > 0 { + _spec.Modifiers = fq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, fq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := fq.withOwner; query != nil { + if err := fq.loadOwner(ctx, query, nodes, nil, + func(n *Feature, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := fq.withPlans; query != nil { + if err := fq.loadPlans(ctx, query, nodes, + func(n *Feature) { n.Edges.Plans = []*EntitlementPlan{} }, + func(n *Feature, e *EntitlementPlan) { n.Edges.Plans = append(n.Edges.Plans, e) }); err != nil { + return nil, err + } + } + if query := fq.withEvents; query != nil { + if err := fq.loadEvents(ctx, query, nodes, + func(n *Feature) { n.Edges.Events = []*Event{} }, + func(n *Feature, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + if query := fq.withFeatures; query != nil { + if err := fq.loadFeatures(ctx, query, nodes, + func(n *Feature) { n.Edges.Features = []*EntitlementPlanFeature{} }, + func(n *Feature, e *EntitlementPlanFeature) { n.Edges.Features = append(n.Edges.Features, e) }); err != nil { + return nil, err + } + } + for name, query := range fq.withNamedPlans { + if err := fq.loadPlans(ctx, query, nodes, + func(n *Feature) { n.appendNamedPlans(name) }, + func(n *Feature, e *EntitlementPlan) { n.appendNamedPlans(name, e) }); err != nil { + return nil, err + } + } + for name, query := range fq.withNamedEvents { + if err := fq.loadEvents(ctx, query, nodes, + func(n *Feature) { n.appendNamedEvents(name) }, + func(n *Feature, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for name, query := range fq.withNamedFeatures { + if err := fq.loadFeatures(ctx, query, nodes, + func(n *Feature) { n.appendNamedFeatures(name) }, + func(n *Feature, e *EntitlementPlanFeature) { n.appendNamedFeatures(name, e) }); err != nil { + return nil, err + } + } + for i := range fq.loadTotal { + if err := fq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (fq *FeatureQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Feature, init func(*Feature), assign func(*Feature, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Feature) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (fq *FeatureQuery) loadPlans(ctx context.Context, query *EntitlementPlanQuery, nodes []*Feature, init func(*Feature), assign func(*Feature, *EntitlementPlan)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Feature) + nids := make(map[string]map[*Feature]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(feature.PlansTable) + joinT.Schema(fq.schemaConfig.EntitlementPlanFeature) + s.Join(joinT).On(s.C(entitlementplan.FieldID), joinT.C(feature.PlansPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(feature.PlansPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(feature.PlansPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Feature]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*EntitlementPlan](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "plans" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (fq *FeatureQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Feature, init func(*Feature), assign func(*Feature, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Feature) + nids := make(map[string]map[*Feature]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(feature.EventsTable) + joinT.Schema(fq.schemaConfig.FeatureEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(feature.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(feature.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(feature.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Feature]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (fq *FeatureQuery) loadFeatures(ctx context.Context, query *EntitlementPlanFeatureQuery, nodes []*Feature, init func(*Feature), assign func(*Feature, *EntitlementPlanFeature)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Feature) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitlementplanfeature.FieldFeatureID) + } + query.Where(predicate.EntitlementPlanFeature(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(feature.FeaturesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.FeatureID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "feature_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (fq *FeatureQuery) sqlCount(ctx context.Context) (int, error) { + _spec := fq.querySpec() + _spec.Node.Schema = fq.schemaConfig.Feature + ctx = internal.NewSchemaConfigContext(ctx, fq.schemaConfig) + if len(fq.modifiers) > 0 { + _spec.Modifiers = fq.modifiers + } + _spec.Node.Columns = fq.ctx.Fields + if len(fq.ctx.Fields) > 0 { + _spec.Unique = fq.ctx.Unique != nil && *fq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, fq.driver, _spec) +} + +func (fq *FeatureQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(feature.Table, feature.Columns, sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString)) + _spec.From = fq.sql + if unique := fq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if fq.path != nil { + _spec.Unique = true + } + if fields := fq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, feature.FieldID) + for i := range fields { + if fields[i] != feature.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if fq.withOwner != nil { + _spec.Node.AddColumnOnce(feature.FieldOwnerID) + } + } + if ps := fq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := fq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := fq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := fq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (fq *FeatureQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(fq.driver.Dialect()) + t1 := builder.Table(feature.Table) + columns := fq.ctx.Fields + if len(columns) == 0 { + columns = feature.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if fq.sql != nil { + selector = fq.sql + selector.Select(selector.Columns(columns...)...) + } + if fq.ctx.Unique != nil && *fq.ctx.Unique { + selector.Distinct() + } + t1.Schema(fq.schemaConfig.Feature) + ctx = internal.NewSchemaConfigContext(ctx, fq.schemaConfig) + selector.WithContext(ctx) + for _, p := range fq.predicates { + p(selector) + } + for _, p := range fq.order { + p(selector) + } + if offset := fq.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 := fq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedPlans tells the query-builder to eager-load the nodes that are connected to the "plans" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (fq *FeatureQuery) WithNamedPlans(name string, opts ...func(*EntitlementPlanQuery)) *FeatureQuery { + query := (&EntitlementPlanClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + if fq.withNamedPlans == nil { + fq.withNamedPlans = make(map[string]*EntitlementPlanQuery) + } + fq.withNamedPlans[name] = query + return fq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (fq *FeatureQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *FeatureQuery { + query := (&EventClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + if fq.withNamedEvents == nil { + fq.withNamedEvents = make(map[string]*EventQuery) + } + fq.withNamedEvents[name] = query + return fq +} + +// WithNamedFeatures tells the query-builder to eager-load the nodes that are connected to the "features" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (fq *FeatureQuery) WithNamedFeatures(name string, opts ...func(*EntitlementPlanFeatureQuery)) *FeatureQuery { + query := (&EntitlementPlanFeatureClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + if fq.withNamedFeatures == nil { + fq.withNamedFeatures = make(map[string]*EntitlementPlanFeatureQuery) + } + fq.withNamedFeatures[name] = query + return fq +} + +// FeatureGroupBy is the group-by builder for Feature entities. +type FeatureGroupBy struct { + selector + build *FeatureQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (fgb *FeatureGroupBy) Aggregate(fns ...AggregateFunc) *FeatureGroupBy { + fgb.fns = append(fgb.fns, fns...) + return fgb +} + +// Scan applies the selector query and scans the result into the given value. +func (fgb *FeatureGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fgb.build.ctx, ent.OpQueryGroupBy) + if err := fgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FeatureQuery, *FeatureGroupBy](ctx, fgb.build, fgb, fgb.build.inters, v) +} + +func (fgb *FeatureGroupBy) sqlScan(ctx context.Context, root *FeatureQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(fgb.fns)) + for _, fn := range fgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*fgb.flds)+len(fgb.fns)) + for _, f := range *fgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*fgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := fgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// FeatureSelect is the builder for selecting fields of Feature entities. +type FeatureSelect struct { + *FeatureQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (fs *FeatureSelect) Aggregate(fns ...AggregateFunc) *FeatureSelect { + fs.fns = append(fs.fns, fns...) + return fs +} + +// Scan applies the selector query and scans the result into the given value. +func (fs *FeatureSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fs.ctx, ent.OpQuerySelect) + if err := fs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FeatureQuery, *FeatureSelect](ctx, fs.FeatureQuery, fs, fs.inters, v) +} + +func (fs *FeatureSelect) sqlScan(ctx context.Context, root *FeatureQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(fs.fns)) + for _, fn := range fs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*fs.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 := fs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/feature_update.go b/internal/ent/generated/feature_update.go new file mode 100644 index 0000000..a4c0847 --- /dev/null +++ b/internal/ent/generated/feature_update.go @@ -0,0 +1,1349 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FeatureUpdate is the builder for updating Feature entities. +type FeatureUpdate struct { + config + hooks []Hook + mutation *FeatureMutation +} + +// Where appends a list predicates to the FeatureUpdate builder. +func (fu *FeatureUpdate) Where(ps ...predicate.Feature) *FeatureUpdate { + fu.mutation.Where(ps...) + return fu +} + +// SetUpdatedAt sets the "updated_at" field. +func (fu *FeatureUpdate) SetUpdatedAt(t time.Time) *FeatureUpdate { + fu.mutation.SetUpdatedAt(t) + return fu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fu *FeatureUpdate) ClearUpdatedAt() *FeatureUpdate { + fu.mutation.ClearUpdatedAt() + return fu +} + +// SetUpdatedBy sets the "updated_by" field. +func (fu *FeatureUpdate) SetUpdatedBy(s string) *FeatureUpdate { + fu.mutation.SetUpdatedBy(s) + return fu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fu *FeatureUpdate) SetNillableUpdatedBy(s *string) *FeatureUpdate { + if s != nil { + fu.SetUpdatedBy(*s) + } + return fu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fu *FeatureUpdate) ClearUpdatedBy() *FeatureUpdate { + fu.mutation.ClearUpdatedBy() + return fu +} + +// SetDeletedAt sets the "deleted_at" field. +func (fu *FeatureUpdate) SetDeletedAt(t time.Time) *FeatureUpdate { + fu.mutation.SetDeletedAt(t) + return fu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fu *FeatureUpdate) SetNillableDeletedAt(t *time.Time) *FeatureUpdate { + if t != nil { + fu.SetDeletedAt(*t) + } + return fu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fu *FeatureUpdate) ClearDeletedAt() *FeatureUpdate { + fu.mutation.ClearDeletedAt() + return fu +} + +// SetDeletedBy sets the "deleted_by" field. +func (fu *FeatureUpdate) SetDeletedBy(s string) *FeatureUpdate { + fu.mutation.SetDeletedBy(s) + return fu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fu *FeatureUpdate) SetNillableDeletedBy(s *string) *FeatureUpdate { + if s != nil { + fu.SetDeletedBy(*s) + } + return fu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fu *FeatureUpdate) ClearDeletedBy() *FeatureUpdate { + fu.mutation.ClearDeletedBy() + return fu +} + +// SetTags sets the "tags" field. +func (fu *FeatureUpdate) SetTags(s []string) *FeatureUpdate { + fu.mutation.SetTags(s) + return fu +} + +// AppendTags appends s to the "tags" field. +func (fu *FeatureUpdate) AppendTags(s []string) *FeatureUpdate { + fu.mutation.AppendTags(s) + return fu +} + +// ClearTags clears the value of the "tags" field. +func (fu *FeatureUpdate) ClearTags() *FeatureUpdate { + fu.mutation.ClearTags() + return fu +} + +// SetOwnerID sets the "owner_id" field. +func (fu *FeatureUpdate) SetOwnerID(s string) *FeatureUpdate { + fu.mutation.SetOwnerID(s) + return fu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (fu *FeatureUpdate) SetNillableOwnerID(s *string) *FeatureUpdate { + if s != nil { + fu.SetOwnerID(*s) + } + return fu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (fu *FeatureUpdate) ClearOwnerID() *FeatureUpdate { + fu.mutation.ClearOwnerID() + return fu +} + +// SetDisplayName sets the "display_name" field. +func (fu *FeatureUpdate) SetDisplayName(s string) *FeatureUpdate { + fu.mutation.SetDisplayName(s) + return fu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (fu *FeatureUpdate) SetNillableDisplayName(s *string) *FeatureUpdate { + if s != nil { + fu.SetDisplayName(*s) + } + return fu +} + +// ClearDisplayName clears the value of the "display_name" field. +func (fu *FeatureUpdate) ClearDisplayName() *FeatureUpdate { + fu.mutation.ClearDisplayName() + return fu +} + +// SetEnabled sets the "enabled" field. +func (fu *FeatureUpdate) SetEnabled(b bool) *FeatureUpdate { + fu.mutation.SetEnabled(b) + return fu +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (fu *FeatureUpdate) SetNillableEnabled(b *bool) *FeatureUpdate { + if b != nil { + fu.SetEnabled(*b) + } + return fu +} + +// SetDescription sets the "description" field. +func (fu *FeatureUpdate) SetDescription(s string) *FeatureUpdate { + fu.mutation.SetDescription(s) + return fu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (fu *FeatureUpdate) SetNillableDescription(s *string) *FeatureUpdate { + if s != nil { + fu.SetDescription(*s) + } + return fu +} + +// ClearDescription clears the value of the "description" field. +func (fu *FeatureUpdate) ClearDescription() *FeatureUpdate { + fu.mutation.ClearDescription() + return fu +} + +// SetMetadata sets the "metadata" field. +func (fu *FeatureUpdate) SetMetadata(m map[string]interface{}) *FeatureUpdate { + fu.mutation.SetMetadata(m) + return fu +} + +// ClearMetadata clears the value of the "metadata" field. +func (fu *FeatureUpdate) ClearMetadata() *FeatureUpdate { + fu.mutation.ClearMetadata() + return fu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (fu *FeatureUpdate) SetOwner(o *Organization) *FeatureUpdate { + return fu.SetOwnerID(o.ID) +} + +// AddPlanIDs adds the "plans" edge to the EntitlementPlan entity by IDs. +func (fu *FeatureUpdate) AddPlanIDs(ids ...string) *FeatureUpdate { + fu.mutation.AddPlanIDs(ids...) + return fu +} + +// AddPlans adds the "plans" edges to the EntitlementPlan entity. +func (fu *FeatureUpdate) AddPlans(e ...*EntitlementPlan) *FeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.AddPlanIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (fu *FeatureUpdate) AddEventIDs(ids ...string) *FeatureUpdate { + fu.mutation.AddEventIDs(ids...) + return fu +} + +// AddEvents adds the "events" edges to the Event entity. +func (fu *FeatureUpdate) AddEvents(e ...*Event) *FeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.AddEventIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by IDs. +func (fu *FeatureUpdate) AddFeatureIDs(ids ...string) *FeatureUpdate { + fu.mutation.AddFeatureIDs(ids...) + return fu +} + +// AddFeatures adds the "features" edges to the EntitlementPlanFeature entity. +func (fu *FeatureUpdate) AddFeatures(e ...*EntitlementPlanFeature) *FeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.AddFeatureIDs(ids...) +} + +// Mutation returns the FeatureMutation object of the builder. +func (fu *FeatureUpdate) Mutation() *FeatureMutation { + return fu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (fu *FeatureUpdate) ClearOwner() *FeatureUpdate { + fu.mutation.ClearOwner() + return fu +} + +// ClearPlans clears all "plans" edges to the EntitlementPlan entity. +func (fu *FeatureUpdate) ClearPlans() *FeatureUpdate { + fu.mutation.ClearPlans() + return fu +} + +// RemovePlanIDs removes the "plans" edge to EntitlementPlan entities by IDs. +func (fu *FeatureUpdate) RemovePlanIDs(ids ...string) *FeatureUpdate { + fu.mutation.RemovePlanIDs(ids...) + return fu +} + +// RemovePlans removes "plans" edges to EntitlementPlan entities. +func (fu *FeatureUpdate) RemovePlans(e ...*EntitlementPlan) *FeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.RemovePlanIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (fu *FeatureUpdate) ClearEvents() *FeatureUpdate { + fu.mutation.ClearEvents() + return fu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (fu *FeatureUpdate) RemoveEventIDs(ids ...string) *FeatureUpdate { + fu.mutation.RemoveEventIDs(ids...) + return fu +} + +// RemoveEvents removes "events" edges to Event entities. +func (fu *FeatureUpdate) RemoveEvents(e ...*Event) *FeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.RemoveEventIDs(ids...) +} + +// ClearFeatures clears all "features" edges to the EntitlementPlanFeature entity. +func (fu *FeatureUpdate) ClearFeatures() *FeatureUpdate { + fu.mutation.ClearFeatures() + return fu +} + +// RemoveFeatureIDs removes the "features" edge to EntitlementPlanFeature entities by IDs. +func (fu *FeatureUpdate) RemoveFeatureIDs(ids ...string) *FeatureUpdate { + fu.mutation.RemoveFeatureIDs(ids...) + return fu +} + +// RemoveFeatures removes "features" edges to EntitlementPlanFeature entities. +func (fu *FeatureUpdate) RemoveFeatures(e ...*EntitlementPlanFeature) *FeatureUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.RemoveFeatureIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (fu *FeatureUpdate) Save(ctx context.Context) (int, error) { + if err := fu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, fu.sqlSave, fu.mutation, fu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fu *FeatureUpdate) SaveX(ctx context.Context) int { + affected, err := fu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (fu *FeatureUpdate) Exec(ctx context.Context) error { + _, err := fu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fu *FeatureUpdate) ExecX(ctx context.Context) { + if err := fu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fu *FeatureUpdate) defaults() error { + if _, ok := fu.mutation.UpdatedAt(); !ok && !fu.mutation.UpdatedAtCleared() { + if feature.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized feature.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := feature.UpdateDefaultUpdatedAt() + fu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (fu *FeatureUpdate) check() error { + if v, ok := fu.mutation.OwnerID(); ok { + if err := feature.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Feature.owner_id": %w`, err)} + } + } + return nil +} + +func (fu *FeatureUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := fu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(feature.Table, feature.Columns, sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString)) + if ps := fu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fu.mutation.CreatedAtCleared() { + _spec.ClearField(feature.FieldCreatedAt, field.TypeTime) + } + if value, ok := fu.mutation.UpdatedAt(); ok { + _spec.SetField(feature.FieldUpdatedAt, field.TypeTime, value) + } + if fu.mutation.UpdatedAtCleared() { + _spec.ClearField(feature.FieldUpdatedAt, field.TypeTime) + } + if fu.mutation.CreatedByCleared() { + _spec.ClearField(feature.FieldCreatedBy, field.TypeString) + } + if value, ok := fu.mutation.UpdatedBy(); ok { + _spec.SetField(feature.FieldUpdatedBy, field.TypeString, value) + } + if fu.mutation.UpdatedByCleared() { + _spec.ClearField(feature.FieldUpdatedBy, field.TypeString) + } + if value, ok := fu.mutation.DeletedAt(); ok { + _spec.SetField(feature.FieldDeletedAt, field.TypeTime, value) + } + if fu.mutation.DeletedAtCleared() { + _spec.ClearField(feature.FieldDeletedAt, field.TypeTime) + } + if value, ok := fu.mutation.DeletedBy(); ok { + _spec.SetField(feature.FieldDeletedBy, field.TypeString, value) + } + if fu.mutation.DeletedByCleared() { + _spec.ClearField(feature.FieldDeletedBy, field.TypeString) + } + if value, ok := fu.mutation.Tags(); ok { + _spec.SetField(feature.FieldTags, field.TypeJSON, value) + } + if value, ok := fu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, feature.FieldTags, value) + }) + } + if fu.mutation.TagsCleared() { + _spec.ClearField(feature.FieldTags, field.TypeJSON) + } + if value, ok := fu.mutation.DisplayName(); ok { + _spec.SetField(feature.FieldDisplayName, field.TypeString, value) + } + if fu.mutation.DisplayNameCleared() { + _spec.ClearField(feature.FieldDisplayName, field.TypeString) + } + if value, ok := fu.mutation.Enabled(); ok { + _spec.SetField(feature.FieldEnabled, field.TypeBool, value) + } + if value, ok := fu.mutation.Description(); ok { + _spec.SetField(feature.FieldDescription, field.TypeString, value) + } + if fu.mutation.DescriptionCleared() { + _spec.ClearField(feature.FieldDescription, field.TypeString) + } + if value, ok := fu.mutation.Metadata(); ok { + _spec.SetField(feature.FieldMetadata, field.TypeJSON, value) + } + if fu.mutation.MetadataCleared() { + _spec.ClearField(feature.FieldMetadata, field.TypeJSON) + } + if fu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: feature.OwnerTable, + Columns: []string{feature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.Feature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: feature.OwnerTable, + Columns: []string{feature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fu.mutation.PlansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntitlementPlanFeature + createE := &EntitlementPlanFeatureCreate{config: fu.config, mutation: newEntitlementPlanFeatureMutation(fu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.RemovedPlansIDs(); len(nodes) > 0 && !fu.mutation.PlansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: fu.config, mutation: newEntitlementPlanFeatureMutation(fu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.PlansIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: fu.config, mutation: newEntitlementPlanFeatureMutation(fu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.FeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !fu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fu.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.RemovedFeaturesIDs(); len(nodes) > 0 && !fu.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = fu.schemaConfig.Feature + ctx = internal.NewSchemaConfigContext(ctx, fu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, fu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{feature.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + fu.mutation.done = true + return n, nil +} + +// FeatureUpdateOne is the builder for updating a single Feature entity. +type FeatureUpdateOne struct { + config + fields []string + hooks []Hook + mutation *FeatureMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (fuo *FeatureUpdateOne) SetUpdatedAt(t time.Time) *FeatureUpdateOne { + fuo.mutation.SetUpdatedAt(t) + return fuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fuo *FeatureUpdateOne) ClearUpdatedAt() *FeatureUpdateOne { + fuo.mutation.ClearUpdatedAt() + return fuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (fuo *FeatureUpdateOne) SetUpdatedBy(s string) *FeatureUpdateOne { + fuo.mutation.SetUpdatedBy(s) + return fuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fuo *FeatureUpdateOne) SetNillableUpdatedBy(s *string) *FeatureUpdateOne { + if s != nil { + fuo.SetUpdatedBy(*s) + } + return fuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fuo *FeatureUpdateOne) ClearUpdatedBy() *FeatureUpdateOne { + fuo.mutation.ClearUpdatedBy() + return fuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (fuo *FeatureUpdateOne) SetDeletedAt(t time.Time) *FeatureUpdateOne { + fuo.mutation.SetDeletedAt(t) + return fuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fuo *FeatureUpdateOne) SetNillableDeletedAt(t *time.Time) *FeatureUpdateOne { + if t != nil { + fuo.SetDeletedAt(*t) + } + return fuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fuo *FeatureUpdateOne) ClearDeletedAt() *FeatureUpdateOne { + fuo.mutation.ClearDeletedAt() + return fuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (fuo *FeatureUpdateOne) SetDeletedBy(s string) *FeatureUpdateOne { + fuo.mutation.SetDeletedBy(s) + return fuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fuo *FeatureUpdateOne) SetNillableDeletedBy(s *string) *FeatureUpdateOne { + if s != nil { + fuo.SetDeletedBy(*s) + } + return fuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fuo *FeatureUpdateOne) ClearDeletedBy() *FeatureUpdateOne { + fuo.mutation.ClearDeletedBy() + return fuo +} + +// SetTags sets the "tags" field. +func (fuo *FeatureUpdateOne) SetTags(s []string) *FeatureUpdateOne { + fuo.mutation.SetTags(s) + return fuo +} + +// AppendTags appends s to the "tags" field. +func (fuo *FeatureUpdateOne) AppendTags(s []string) *FeatureUpdateOne { + fuo.mutation.AppendTags(s) + return fuo +} + +// ClearTags clears the value of the "tags" field. +func (fuo *FeatureUpdateOne) ClearTags() *FeatureUpdateOne { + fuo.mutation.ClearTags() + return fuo +} + +// SetOwnerID sets the "owner_id" field. +func (fuo *FeatureUpdateOne) SetOwnerID(s string) *FeatureUpdateOne { + fuo.mutation.SetOwnerID(s) + return fuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (fuo *FeatureUpdateOne) SetNillableOwnerID(s *string) *FeatureUpdateOne { + if s != nil { + fuo.SetOwnerID(*s) + } + return fuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (fuo *FeatureUpdateOne) ClearOwnerID() *FeatureUpdateOne { + fuo.mutation.ClearOwnerID() + return fuo +} + +// SetDisplayName sets the "display_name" field. +func (fuo *FeatureUpdateOne) SetDisplayName(s string) *FeatureUpdateOne { + fuo.mutation.SetDisplayName(s) + return fuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (fuo *FeatureUpdateOne) SetNillableDisplayName(s *string) *FeatureUpdateOne { + if s != nil { + fuo.SetDisplayName(*s) + } + return fuo +} + +// ClearDisplayName clears the value of the "display_name" field. +func (fuo *FeatureUpdateOne) ClearDisplayName() *FeatureUpdateOne { + fuo.mutation.ClearDisplayName() + return fuo +} + +// SetEnabled sets the "enabled" field. +func (fuo *FeatureUpdateOne) SetEnabled(b bool) *FeatureUpdateOne { + fuo.mutation.SetEnabled(b) + return fuo +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (fuo *FeatureUpdateOne) SetNillableEnabled(b *bool) *FeatureUpdateOne { + if b != nil { + fuo.SetEnabled(*b) + } + return fuo +} + +// SetDescription sets the "description" field. +func (fuo *FeatureUpdateOne) SetDescription(s string) *FeatureUpdateOne { + fuo.mutation.SetDescription(s) + return fuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (fuo *FeatureUpdateOne) SetNillableDescription(s *string) *FeatureUpdateOne { + if s != nil { + fuo.SetDescription(*s) + } + return fuo +} + +// ClearDescription clears the value of the "description" field. +func (fuo *FeatureUpdateOne) ClearDescription() *FeatureUpdateOne { + fuo.mutation.ClearDescription() + return fuo +} + +// SetMetadata sets the "metadata" field. +func (fuo *FeatureUpdateOne) SetMetadata(m map[string]interface{}) *FeatureUpdateOne { + fuo.mutation.SetMetadata(m) + return fuo +} + +// ClearMetadata clears the value of the "metadata" field. +func (fuo *FeatureUpdateOne) ClearMetadata() *FeatureUpdateOne { + fuo.mutation.ClearMetadata() + return fuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (fuo *FeatureUpdateOne) SetOwner(o *Organization) *FeatureUpdateOne { + return fuo.SetOwnerID(o.ID) +} + +// AddPlanIDs adds the "plans" edge to the EntitlementPlan entity by IDs. +func (fuo *FeatureUpdateOne) AddPlanIDs(ids ...string) *FeatureUpdateOne { + fuo.mutation.AddPlanIDs(ids...) + return fuo +} + +// AddPlans adds the "plans" edges to the EntitlementPlan entity. +func (fuo *FeatureUpdateOne) AddPlans(e ...*EntitlementPlan) *FeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.AddPlanIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (fuo *FeatureUpdateOne) AddEventIDs(ids ...string) *FeatureUpdateOne { + fuo.mutation.AddEventIDs(ids...) + return fuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (fuo *FeatureUpdateOne) AddEvents(e ...*Event) *FeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.AddEventIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by IDs. +func (fuo *FeatureUpdateOne) AddFeatureIDs(ids ...string) *FeatureUpdateOne { + fuo.mutation.AddFeatureIDs(ids...) + return fuo +} + +// AddFeatures adds the "features" edges to the EntitlementPlanFeature entity. +func (fuo *FeatureUpdateOne) AddFeatures(e ...*EntitlementPlanFeature) *FeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.AddFeatureIDs(ids...) +} + +// Mutation returns the FeatureMutation object of the builder. +func (fuo *FeatureUpdateOne) Mutation() *FeatureMutation { + return fuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (fuo *FeatureUpdateOne) ClearOwner() *FeatureUpdateOne { + fuo.mutation.ClearOwner() + return fuo +} + +// ClearPlans clears all "plans" edges to the EntitlementPlan entity. +func (fuo *FeatureUpdateOne) ClearPlans() *FeatureUpdateOne { + fuo.mutation.ClearPlans() + return fuo +} + +// RemovePlanIDs removes the "plans" edge to EntitlementPlan entities by IDs. +func (fuo *FeatureUpdateOne) RemovePlanIDs(ids ...string) *FeatureUpdateOne { + fuo.mutation.RemovePlanIDs(ids...) + return fuo +} + +// RemovePlans removes "plans" edges to EntitlementPlan entities. +func (fuo *FeatureUpdateOne) RemovePlans(e ...*EntitlementPlan) *FeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.RemovePlanIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (fuo *FeatureUpdateOne) ClearEvents() *FeatureUpdateOne { + fuo.mutation.ClearEvents() + return fuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (fuo *FeatureUpdateOne) RemoveEventIDs(ids ...string) *FeatureUpdateOne { + fuo.mutation.RemoveEventIDs(ids...) + return fuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (fuo *FeatureUpdateOne) RemoveEvents(e ...*Event) *FeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.RemoveEventIDs(ids...) +} + +// ClearFeatures clears all "features" edges to the EntitlementPlanFeature entity. +func (fuo *FeatureUpdateOne) ClearFeatures() *FeatureUpdateOne { + fuo.mutation.ClearFeatures() + return fuo +} + +// RemoveFeatureIDs removes the "features" edge to EntitlementPlanFeature entities by IDs. +func (fuo *FeatureUpdateOne) RemoveFeatureIDs(ids ...string) *FeatureUpdateOne { + fuo.mutation.RemoveFeatureIDs(ids...) + return fuo +} + +// RemoveFeatures removes "features" edges to EntitlementPlanFeature entities. +func (fuo *FeatureUpdateOne) RemoveFeatures(e ...*EntitlementPlanFeature) *FeatureUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.RemoveFeatureIDs(ids...) +} + +// Where appends a list predicates to the FeatureUpdate builder. +func (fuo *FeatureUpdateOne) Where(ps ...predicate.Feature) *FeatureUpdateOne { + fuo.mutation.Where(ps...) + return fuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (fuo *FeatureUpdateOne) Select(field string, fields ...string) *FeatureUpdateOne { + fuo.fields = append([]string{field}, fields...) + return fuo +} + +// Save executes the query and returns the updated Feature entity. +func (fuo *FeatureUpdateOne) Save(ctx context.Context) (*Feature, error) { + if err := fuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, fuo.sqlSave, fuo.mutation, fuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fuo *FeatureUpdateOne) SaveX(ctx context.Context) *Feature { + node, err := fuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (fuo *FeatureUpdateOne) Exec(ctx context.Context) error { + _, err := fuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fuo *FeatureUpdateOne) ExecX(ctx context.Context) { + if err := fuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fuo *FeatureUpdateOne) defaults() error { + if _, ok := fuo.mutation.UpdatedAt(); !ok && !fuo.mutation.UpdatedAtCleared() { + if feature.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized feature.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := feature.UpdateDefaultUpdatedAt() + fuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (fuo *FeatureUpdateOne) check() error { + if v, ok := fuo.mutation.OwnerID(); ok { + if err := feature.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Feature.owner_id": %w`, err)} + } + } + return nil +} + +func (fuo *FeatureUpdateOne) sqlSave(ctx context.Context) (_node *Feature, err error) { + if err := fuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(feature.Table, feature.Columns, sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString)) + id, ok := fuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Feature.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := fuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, feature.FieldID) + for _, f := range fields { + if !feature.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != feature.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := fuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fuo.mutation.CreatedAtCleared() { + _spec.ClearField(feature.FieldCreatedAt, field.TypeTime) + } + if value, ok := fuo.mutation.UpdatedAt(); ok { + _spec.SetField(feature.FieldUpdatedAt, field.TypeTime, value) + } + if fuo.mutation.UpdatedAtCleared() { + _spec.ClearField(feature.FieldUpdatedAt, field.TypeTime) + } + if fuo.mutation.CreatedByCleared() { + _spec.ClearField(feature.FieldCreatedBy, field.TypeString) + } + if value, ok := fuo.mutation.UpdatedBy(); ok { + _spec.SetField(feature.FieldUpdatedBy, field.TypeString, value) + } + if fuo.mutation.UpdatedByCleared() { + _spec.ClearField(feature.FieldUpdatedBy, field.TypeString) + } + if value, ok := fuo.mutation.DeletedAt(); ok { + _spec.SetField(feature.FieldDeletedAt, field.TypeTime, value) + } + if fuo.mutation.DeletedAtCleared() { + _spec.ClearField(feature.FieldDeletedAt, field.TypeTime) + } + if value, ok := fuo.mutation.DeletedBy(); ok { + _spec.SetField(feature.FieldDeletedBy, field.TypeString, value) + } + if fuo.mutation.DeletedByCleared() { + _spec.ClearField(feature.FieldDeletedBy, field.TypeString) + } + if value, ok := fuo.mutation.Tags(); ok { + _spec.SetField(feature.FieldTags, field.TypeJSON, value) + } + if value, ok := fuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, feature.FieldTags, value) + }) + } + if fuo.mutation.TagsCleared() { + _spec.ClearField(feature.FieldTags, field.TypeJSON) + } + if value, ok := fuo.mutation.DisplayName(); ok { + _spec.SetField(feature.FieldDisplayName, field.TypeString, value) + } + if fuo.mutation.DisplayNameCleared() { + _spec.ClearField(feature.FieldDisplayName, field.TypeString) + } + if value, ok := fuo.mutation.Enabled(); ok { + _spec.SetField(feature.FieldEnabled, field.TypeBool, value) + } + if value, ok := fuo.mutation.Description(); ok { + _spec.SetField(feature.FieldDescription, field.TypeString, value) + } + if fuo.mutation.DescriptionCleared() { + _spec.ClearField(feature.FieldDescription, field.TypeString) + } + if value, ok := fuo.mutation.Metadata(); ok { + _spec.SetField(feature.FieldMetadata, field.TypeJSON, value) + } + if fuo.mutation.MetadataCleared() { + _spec.ClearField(feature.FieldMetadata, field.TypeJSON) + } + if fuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: feature.OwnerTable, + Columns: []string{feature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.Feature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: feature.OwnerTable, + Columns: []string{feature.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fuo.mutation.PlansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntitlementPlanFeature + createE := &EntitlementPlanFeatureCreate{config: fuo.config, mutation: newEntitlementPlanFeatureMutation(fuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.RemovedPlansIDs(); len(nodes) > 0 && !fuo.mutation.PlansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: fuo.config, mutation: newEntitlementPlanFeatureMutation(fuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.PlansIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.PlansTable, + Columns: feature.PlansPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &EntitlementPlanFeatureCreate{config: fuo.config, mutation: newEntitlementPlanFeatureMutation(fuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.FeatureEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !fuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: feature.EventsTable, + Columns: feature.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.FeatureEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fuo.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.RemovedFeaturesIDs(); len(nodes) > 0 && !fuo.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: feature.FeaturesTable, + Columns: []string{feature.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = fuo.schemaConfig.Feature + ctx = internal.NewSchemaConfigContext(ctx, fuo.schemaConfig) + _node = &Feature{config: fuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, fuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{feature.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + fuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/featurehistory.go b/internal/ent/generated/featurehistory.go new file mode 100644 index 0000000..f280500 --- /dev/null +++ b/internal/ent/generated/featurehistory.go @@ -0,0 +1,295 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/entx/history" +) + +// FeatureHistory is the model entity for the FeatureHistory schema. +type FeatureHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the unique name of the feature + Name string `json:"name,omitempty"` + // the displayed 'friendly' name of the feature + DisplayName string `json:"display_name,omitempty"` + // enabled features are available for use + Enabled bool `json:"enabled,omitempty"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*FeatureHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case featurehistory.FieldTags, featurehistory.FieldMetadata: + values[i] = new([]byte) + case featurehistory.FieldOperation: + values[i] = new(history.OpType) + case featurehistory.FieldEnabled: + values[i] = new(sql.NullBool) + case featurehistory.FieldID, featurehistory.FieldRef, featurehistory.FieldCreatedBy, featurehistory.FieldUpdatedBy, featurehistory.FieldDeletedBy, featurehistory.FieldMappingID, featurehistory.FieldOwnerID, featurehistory.FieldName, featurehistory.FieldDisplayName, featurehistory.FieldDescription: + values[i] = new(sql.NullString) + case featurehistory.FieldHistoryTime, featurehistory.FieldCreatedAt, featurehistory.FieldUpdatedAt, featurehistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the FeatureHistory fields. +func (fh *FeatureHistory) 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 featurehistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + fh.ID = value.String + } + case featurehistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + fh.HistoryTime = value.Time + } + case featurehistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + fh.Ref = value.String + } + case featurehistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + fh.Operation = *value + } + case featurehistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + fh.CreatedAt = value.Time + } + case featurehistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + fh.UpdatedAt = value.Time + } + case featurehistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + fh.CreatedBy = value.String + } + case featurehistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + fh.UpdatedBy = value.String + } + case featurehistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + fh.DeletedAt = value.Time + } + case featurehistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + fh.DeletedBy = value.String + } + case featurehistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + fh.MappingID = value.String + } + case featurehistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &fh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case featurehistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + fh.OwnerID = value.String + } + case featurehistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + fh.Name = value.String + } + case featurehistory.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + fh.DisplayName = value.String + } + case featurehistory.FieldEnabled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field enabled", values[i]) + } else if value.Valid { + fh.Enabled = value.Bool + } + case featurehistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + fh.Description = new(string) + *fh.Description = value.String + } + case featurehistory.FieldMetadata: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field metadata", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &fh.Metadata); err != nil { + return fmt.Errorf("unmarshal field metadata: %w", err) + } + } + default: + fh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the FeatureHistory. +// This includes values selected through modifiers, order, etc. +func (fh *FeatureHistory) Value(name string) (ent.Value, error) { + return fh.selectValues.Get(name) +} + +// Update returns a builder for updating this FeatureHistory. +// Note that you need to call FeatureHistory.Unwrap() before calling this method if this FeatureHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (fh *FeatureHistory) Update() *FeatureHistoryUpdateOne { + return NewFeatureHistoryClient(fh.config).UpdateOne(fh) +} + +// Unwrap unwraps the FeatureHistory 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 (fh *FeatureHistory) Unwrap() *FeatureHistory { + _tx, ok := fh.config.driver.(*txDriver) + if !ok { + panic("generated: FeatureHistory is not a transactional entity") + } + fh.config.driver = _tx.drv + return fh +} + +// String implements the fmt.Stringer. +func (fh *FeatureHistory) String() string { + var builder strings.Builder + builder.WriteString("FeatureHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", fh.ID)) + builder.WriteString("history_time=") + builder.WriteString(fh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(fh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", fh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(fh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(fh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(fh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(fh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(fh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(fh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(fh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", fh.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(fh.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(fh.Name) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(fh.DisplayName) + builder.WriteString(", ") + builder.WriteString("enabled=") + builder.WriteString(fmt.Sprintf("%v", fh.Enabled)) + builder.WriteString(", ") + if v := fh.Description; v != nil { + builder.WriteString("description=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("metadata=") + builder.WriteString(fmt.Sprintf("%v", fh.Metadata)) + builder.WriteByte(')') + return builder.String() +} + +// FeatureHistories is a parsable slice of FeatureHistory. +type FeatureHistories []*FeatureHistory diff --git a/internal/ent/generated/featurehistory/featurehistory.go b/internal/ent/generated/featurehistory/featurehistory.go new file mode 100644 index 0000000..0598393 --- /dev/null +++ b/internal/ent/generated/featurehistory/featurehistory.go @@ -0,0 +1,215 @@ +// Code generated by ent, DO NOT EDIT. + +package featurehistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the featurehistory type in the database. + Label = "feature_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldEnabled holds the string denoting the enabled field in the database. + FieldEnabled = "enabled" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldMetadata holds the string denoting the metadata field in the database. + FieldMetadata = "metadata" + // Table holds the table name of the featurehistory in the database. + Table = "feature_history" +) + +// Columns holds all SQL columns for featurehistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldDisplayName, + FieldEnabled, + FieldDescription, + FieldMetadata, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultEnabled holds the default value on creation for the "enabled" field. + DefaultEnabled bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("featurehistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the FeatureHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByEnabled orders the results by the enabled field. +func ByEnabled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEnabled, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/featurehistory/where.go b/internal/ent/generated/featurehistory/where.go new file mode 100644 index 0000000..b4ef2ce --- /dev/null +++ b/internal/ent/generated/featurehistory/where.go @@ -0,0 +1,1046 @@ +// Code generated by ent, DO NOT EDIT. + +package featurehistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// Enabled applies equality check predicate on the "enabled" field. It's identical to EnabledEQ. +func Enabled(v bool) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldEnabled, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDescription, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameIsNil applies the IsNil predicate on the "display_name" field. +func DisplayNameIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldDisplayName)) +} + +// DisplayNameNotNil applies the NotNil predicate on the "display_name" field. +func DisplayNameNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldDisplayName)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// EnabledEQ applies the EQ predicate on the "enabled" field. +func EnabledEQ(v bool) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldEnabled, v)) +} + +// EnabledNEQ applies the NEQ predicate on the "enabled" field. +func EnabledNEQ(v bool) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldEnabled, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// MetadataIsNil applies the IsNil predicate on the "metadata" field. +func MetadataIsNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldIsNull(FieldMetadata)) +} + +// MetadataNotNil applies the NotNil predicate on the "metadata" field. +func MetadataNotNil() predicate.FeatureHistory { + return predicate.FeatureHistory(sql.FieldNotNull(FieldMetadata)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.FeatureHistory) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.FeatureHistory) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.FeatureHistory) predicate.FeatureHistory { + return predicate.FeatureHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/featurehistory_create.go b/internal/ent/generated/featurehistory_create.go new file mode 100644 index 0000000..3c4ef20 --- /dev/null +++ b/internal/ent/generated/featurehistory_create.go @@ -0,0 +1,538 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/entx/history" +) + +// FeatureHistoryCreate is the builder for creating a FeatureHistory entity. +type FeatureHistoryCreate struct { + config + mutation *FeatureHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (fhc *FeatureHistoryCreate) SetHistoryTime(t time.Time) *FeatureHistoryCreate { + fhc.mutation.SetHistoryTime(t) + return fhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableHistoryTime(t *time.Time) *FeatureHistoryCreate { + if t != nil { + fhc.SetHistoryTime(*t) + } + return fhc +} + +// SetRef sets the "ref" field. +func (fhc *FeatureHistoryCreate) SetRef(s string) *FeatureHistoryCreate { + fhc.mutation.SetRef(s) + return fhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableRef(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetRef(*s) + } + return fhc +} + +// SetOperation sets the "operation" field. +func (fhc *FeatureHistoryCreate) SetOperation(ht history.OpType) *FeatureHistoryCreate { + fhc.mutation.SetOperation(ht) + return fhc +} + +// SetCreatedAt sets the "created_at" field. +func (fhc *FeatureHistoryCreate) SetCreatedAt(t time.Time) *FeatureHistoryCreate { + fhc.mutation.SetCreatedAt(t) + return fhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableCreatedAt(t *time.Time) *FeatureHistoryCreate { + if t != nil { + fhc.SetCreatedAt(*t) + } + return fhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (fhc *FeatureHistoryCreate) SetUpdatedAt(t time.Time) *FeatureHistoryCreate { + fhc.mutation.SetUpdatedAt(t) + return fhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableUpdatedAt(t *time.Time) *FeatureHistoryCreate { + if t != nil { + fhc.SetUpdatedAt(*t) + } + return fhc +} + +// SetCreatedBy sets the "created_by" field. +func (fhc *FeatureHistoryCreate) SetCreatedBy(s string) *FeatureHistoryCreate { + fhc.mutation.SetCreatedBy(s) + return fhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableCreatedBy(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetCreatedBy(*s) + } + return fhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (fhc *FeatureHistoryCreate) SetUpdatedBy(s string) *FeatureHistoryCreate { + fhc.mutation.SetUpdatedBy(s) + return fhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableUpdatedBy(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetUpdatedBy(*s) + } + return fhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (fhc *FeatureHistoryCreate) SetDeletedAt(t time.Time) *FeatureHistoryCreate { + fhc.mutation.SetDeletedAt(t) + return fhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableDeletedAt(t *time.Time) *FeatureHistoryCreate { + if t != nil { + fhc.SetDeletedAt(*t) + } + return fhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (fhc *FeatureHistoryCreate) SetDeletedBy(s string) *FeatureHistoryCreate { + fhc.mutation.SetDeletedBy(s) + return fhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableDeletedBy(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetDeletedBy(*s) + } + return fhc +} + +// SetMappingID sets the "mapping_id" field. +func (fhc *FeatureHistoryCreate) SetMappingID(s string) *FeatureHistoryCreate { + fhc.mutation.SetMappingID(s) + return fhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableMappingID(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetMappingID(*s) + } + return fhc +} + +// SetTags sets the "tags" field. +func (fhc *FeatureHistoryCreate) SetTags(s []string) *FeatureHistoryCreate { + fhc.mutation.SetTags(s) + return fhc +} + +// SetOwnerID sets the "owner_id" field. +func (fhc *FeatureHistoryCreate) SetOwnerID(s string) *FeatureHistoryCreate { + fhc.mutation.SetOwnerID(s) + return fhc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableOwnerID(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetOwnerID(*s) + } + return fhc +} + +// SetName sets the "name" field. +func (fhc *FeatureHistoryCreate) SetName(s string) *FeatureHistoryCreate { + fhc.mutation.SetName(s) + return fhc +} + +// SetDisplayName sets the "display_name" field. +func (fhc *FeatureHistoryCreate) SetDisplayName(s string) *FeatureHistoryCreate { + fhc.mutation.SetDisplayName(s) + return fhc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableDisplayName(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetDisplayName(*s) + } + return fhc +} + +// SetEnabled sets the "enabled" field. +func (fhc *FeatureHistoryCreate) SetEnabled(b bool) *FeatureHistoryCreate { + fhc.mutation.SetEnabled(b) + return fhc +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableEnabled(b *bool) *FeatureHistoryCreate { + if b != nil { + fhc.SetEnabled(*b) + } + return fhc +} + +// SetDescription sets the "description" field. +func (fhc *FeatureHistoryCreate) SetDescription(s string) *FeatureHistoryCreate { + fhc.mutation.SetDescription(s) + return fhc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableDescription(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetDescription(*s) + } + return fhc +} + +// SetMetadata sets the "metadata" field. +func (fhc *FeatureHistoryCreate) SetMetadata(m map[string]interface{}) *FeatureHistoryCreate { + fhc.mutation.SetMetadata(m) + return fhc +} + +// SetID sets the "id" field. +func (fhc *FeatureHistoryCreate) SetID(s string) *FeatureHistoryCreate { + fhc.mutation.SetID(s) + return fhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (fhc *FeatureHistoryCreate) SetNillableID(s *string) *FeatureHistoryCreate { + if s != nil { + fhc.SetID(*s) + } + return fhc +} + +// Mutation returns the FeatureHistoryMutation object of the builder. +func (fhc *FeatureHistoryCreate) Mutation() *FeatureHistoryMutation { + return fhc.mutation +} + +// Save creates the FeatureHistory in the database. +func (fhc *FeatureHistoryCreate) Save(ctx context.Context) (*FeatureHistory, error) { + if err := fhc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, fhc.sqlSave, fhc.mutation, fhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (fhc *FeatureHistoryCreate) SaveX(ctx context.Context) *FeatureHistory { + v, err := fhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fhc *FeatureHistoryCreate) Exec(ctx context.Context) error { + _, err := fhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhc *FeatureHistoryCreate) ExecX(ctx context.Context) { + if err := fhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fhc *FeatureHistoryCreate) defaults() error { + if _, ok := fhc.mutation.HistoryTime(); !ok { + if featurehistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized featurehistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := featurehistory.DefaultHistoryTime() + fhc.mutation.SetHistoryTime(v) + } + if _, ok := fhc.mutation.CreatedAt(); !ok { + if featurehistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized featurehistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := featurehistory.DefaultCreatedAt() + fhc.mutation.SetCreatedAt(v) + } + if _, ok := fhc.mutation.UpdatedAt(); !ok { + if featurehistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized featurehistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := featurehistory.DefaultUpdatedAt() + fhc.mutation.SetUpdatedAt(v) + } + if _, ok := fhc.mutation.MappingID(); !ok { + if featurehistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized featurehistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := featurehistory.DefaultMappingID() + fhc.mutation.SetMappingID(v) + } + if _, ok := fhc.mutation.Tags(); !ok { + v := featurehistory.DefaultTags + fhc.mutation.SetTags(v) + } + if _, ok := fhc.mutation.Enabled(); !ok { + v := featurehistory.DefaultEnabled + fhc.mutation.SetEnabled(v) + } + if _, ok := fhc.mutation.ID(); !ok { + if featurehistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized featurehistory.DefaultID (forgotten import generated/runtime?)") + } + v := featurehistory.DefaultID() + fhc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (fhc *FeatureHistoryCreate) check() error { + if _, ok := fhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "FeatureHistory.history_time"`)} + } + if _, ok := fhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "FeatureHistory.operation"`)} + } + if v, ok := fhc.mutation.Operation(); ok { + if err := featurehistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "FeatureHistory.operation": %w`, err)} + } + } + if _, ok := fhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "FeatureHistory.mapping_id"`)} + } + if _, ok := fhc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "FeatureHistory.name"`)} + } + if _, ok := fhc.mutation.Enabled(); !ok { + return &ValidationError{Name: "enabled", err: errors.New(`generated: missing required field "FeatureHistory.enabled"`)} + } + return nil +} + +func (fhc *FeatureHistoryCreate) sqlSave(ctx context.Context) (*FeatureHistory, error) { + if err := fhc.check(); err != nil { + return nil, err + } + _node, _spec := fhc.createSpec() + if err := sqlgraph.CreateNode(ctx, fhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected FeatureHistory.ID type: %T", _spec.ID.Value) + } + } + fhc.mutation.id = &_node.ID + fhc.mutation.done = true + return _node, nil +} + +func (fhc *FeatureHistoryCreate) createSpec() (*FeatureHistory, *sqlgraph.CreateSpec) { + var ( + _node = &FeatureHistory{config: fhc.config} + _spec = sqlgraph.NewCreateSpec(featurehistory.Table, sqlgraph.NewFieldSpec(featurehistory.FieldID, field.TypeString)) + ) + _spec.Schema = fhc.schemaConfig.FeatureHistory + if id, ok := fhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := fhc.mutation.HistoryTime(); ok { + _spec.SetField(featurehistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := fhc.mutation.Ref(); ok { + _spec.SetField(featurehistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := fhc.mutation.Operation(); ok { + _spec.SetField(featurehistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := fhc.mutation.CreatedAt(); ok { + _spec.SetField(featurehistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := fhc.mutation.UpdatedAt(); ok { + _spec.SetField(featurehistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := fhc.mutation.CreatedBy(); ok { + _spec.SetField(featurehistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := fhc.mutation.UpdatedBy(); ok { + _spec.SetField(featurehistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := fhc.mutation.DeletedAt(); ok { + _spec.SetField(featurehistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := fhc.mutation.DeletedBy(); ok { + _spec.SetField(featurehistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := fhc.mutation.MappingID(); ok { + _spec.SetField(featurehistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := fhc.mutation.Tags(); ok { + _spec.SetField(featurehistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := fhc.mutation.OwnerID(); ok { + _spec.SetField(featurehistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := fhc.mutation.Name(); ok { + _spec.SetField(featurehistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := fhc.mutation.DisplayName(); ok { + _spec.SetField(featurehistory.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := fhc.mutation.Enabled(); ok { + _spec.SetField(featurehistory.FieldEnabled, field.TypeBool, value) + _node.Enabled = value + } + if value, ok := fhc.mutation.Description(); ok { + _spec.SetField(featurehistory.FieldDescription, field.TypeString, value) + _node.Description = &value + } + if value, ok := fhc.mutation.Metadata(); ok { + _spec.SetField(featurehistory.FieldMetadata, field.TypeJSON, value) + _node.Metadata = value + } + return _node, _spec +} + +// FeatureHistoryCreateBulk is the builder for creating many FeatureHistory entities in bulk. +type FeatureHistoryCreateBulk struct { + config + err error + builders []*FeatureHistoryCreate +} + +// Save creates the FeatureHistory entities in the database. +func (fhcb *FeatureHistoryCreateBulk) Save(ctx context.Context) ([]*FeatureHistory, error) { + if fhcb.err != nil { + return nil, fhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(fhcb.builders)) + nodes := make([]*FeatureHistory, len(fhcb.builders)) + mutators := make([]Mutator, len(fhcb.builders)) + for i := range fhcb.builders { + func(i int, root context.Context) { + builder := fhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*FeatureHistoryMutation) + 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, fhcb.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, fhcb.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, fhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (fhcb *FeatureHistoryCreateBulk) SaveX(ctx context.Context) []*FeatureHistory { + v, err := fhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fhcb *FeatureHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := fhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhcb *FeatureHistoryCreateBulk) ExecX(ctx context.Context) { + if err := fhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/featurehistory_delete.go b/internal/ent/generated/featurehistory_delete.go new file mode 100644 index 0000000..005e330 --- /dev/null +++ b/internal/ent/generated/featurehistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FeatureHistoryDelete is the builder for deleting a FeatureHistory entity. +type FeatureHistoryDelete struct { + config + hooks []Hook + mutation *FeatureHistoryMutation +} + +// Where appends a list predicates to the FeatureHistoryDelete builder. +func (fhd *FeatureHistoryDelete) Where(ps ...predicate.FeatureHistory) *FeatureHistoryDelete { + fhd.mutation.Where(ps...) + return fhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (fhd *FeatureHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, fhd.sqlExec, fhd.mutation, fhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhd *FeatureHistoryDelete) ExecX(ctx context.Context) int { + n, err := fhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (fhd *FeatureHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(featurehistory.Table, sqlgraph.NewFieldSpec(featurehistory.FieldID, field.TypeString)) + _spec.Node.Schema = fhd.schemaConfig.FeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, fhd.schemaConfig) + if ps := fhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, fhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + fhd.mutation.done = true + return affected, err +} + +// FeatureHistoryDeleteOne is the builder for deleting a single FeatureHistory entity. +type FeatureHistoryDeleteOne struct { + fhd *FeatureHistoryDelete +} + +// Where appends a list predicates to the FeatureHistoryDelete builder. +func (fhdo *FeatureHistoryDeleteOne) Where(ps ...predicate.FeatureHistory) *FeatureHistoryDeleteOne { + fhdo.fhd.mutation.Where(ps...) + return fhdo +} + +// Exec executes the deletion query. +func (fhdo *FeatureHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := fhdo.fhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{featurehistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhdo *FeatureHistoryDeleteOne) ExecX(ctx context.Context) { + if err := fhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/featurehistory_query.go b/internal/ent/generated/featurehistory_query.go new file mode 100644 index 0000000..4cc193e --- /dev/null +++ b/internal/ent/generated/featurehistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FeatureHistoryQuery is the builder for querying FeatureHistory entities. +type FeatureHistoryQuery struct { + config + ctx *QueryContext + order []featurehistory.OrderOption + inters []Interceptor + predicates []predicate.FeatureHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*FeatureHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the FeatureHistoryQuery builder. +func (fhq *FeatureHistoryQuery) Where(ps ...predicate.FeatureHistory) *FeatureHistoryQuery { + fhq.predicates = append(fhq.predicates, ps...) + return fhq +} + +// Limit the number of records to be returned by this query. +func (fhq *FeatureHistoryQuery) Limit(limit int) *FeatureHistoryQuery { + fhq.ctx.Limit = &limit + return fhq +} + +// Offset to start from. +func (fhq *FeatureHistoryQuery) Offset(offset int) *FeatureHistoryQuery { + fhq.ctx.Offset = &offset + return fhq +} + +// 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 (fhq *FeatureHistoryQuery) Unique(unique bool) *FeatureHistoryQuery { + fhq.ctx.Unique = &unique + return fhq +} + +// Order specifies how the records should be ordered. +func (fhq *FeatureHistoryQuery) Order(o ...featurehistory.OrderOption) *FeatureHistoryQuery { + fhq.order = append(fhq.order, o...) + return fhq +} + +// First returns the first FeatureHistory entity from the query. +// Returns a *NotFoundError when no FeatureHistory was found. +func (fhq *FeatureHistoryQuery) First(ctx context.Context) (*FeatureHistory, error) { + nodes, err := fhq.Limit(1).All(setContextOp(ctx, fhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{featurehistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) FirstX(ctx context.Context) *FeatureHistory { + node, err := fhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first FeatureHistory ID from the query. +// Returns a *NotFoundError when no FeatureHistory ID was found. +func (fhq *FeatureHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fhq.Limit(1).IDs(setContextOp(ctx, fhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{featurehistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := fhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single FeatureHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one FeatureHistory entity is found. +// Returns a *NotFoundError when no FeatureHistory entities are found. +func (fhq *FeatureHistoryQuery) Only(ctx context.Context) (*FeatureHistory, error) { + nodes, err := fhq.Limit(2).All(setContextOp(ctx, fhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{featurehistory.Label} + default: + return nil, &NotSingularError{featurehistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) OnlyX(ctx context.Context) *FeatureHistory { + node, err := fhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only FeatureHistory ID in the query. +// Returns a *NotSingularError when more than one FeatureHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (fhq *FeatureHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fhq.Limit(2).IDs(setContextOp(ctx, fhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{featurehistory.Label} + default: + err = &NotSingularError{featurehistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := fhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of FeatureHistories. +func (fhq *FeatureHistoryQuery) All(ctx context.Context) ([]*FeatureHistory, error) { + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryAll) + if err := fhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*FeatureHistory, *FeatureHistoryQuery]() + return withInterceptors[[]*FeatureHistory](ctx, fhq, qr, fhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) AllX(ctx context.Context) []*FeatureHistory { + nodes, err := fhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of FeatureHistory IDs. +func (fhq *FeatureHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if fhq.ctx.Unique == nil && fhq.path != nil { + fhq.Unique(true) + } + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryIDs) + if err = fhq.Select(featurehistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := fhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (fhq *FeatureHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryCount) + if err := fhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, fhq, querierCount[*FeatureHistoryQuery](), fhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) CountX(ctx context.Context) int { + count, err := fhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (fhq *FeatureHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryExist) + switch _, err := fhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (fhq *FeatureHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := fhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the FeatureHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (fhq *FeatureHistoryQuery) Clone() *FeatureHistoryQuery { + if fhq == nil { + return nil + } + return &FeatureHistoryQuery{ + config: fhq.config, + ctx: fhq.ctx.Clone(), + order: append([]featurehistory.OrderOption{}, fhq.order...), + inters: append([]Interceptor{}, fhq.inters...), + predicates: append([]predicate.FeatureHistory{}, fhq.predicates...), + // clone intermediate query. + sql: fhq.sql.Clone(), + path: fhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.FeatureHistory.Query(). +// GroupBy(featurehistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (fhq *FeatureHistoryQuery) GroupBy(field string, fields ...string) *FeatureHistoryGroupBy { + fhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &FeatureHistoryGroupBy{build: fhq} + grbuild.flds = &fhq.ctx.Fields + grbuild.label = featurehistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.FeatureHistory.Query(). +// Select(featurehistory.FieldHistoryTime). +// Scan(ctx, &v) +func (fhq *FeatureHistoryQuery) Select(fields ...string) *FeatureHistorySelect { + fhq.ctx.Fields = append(fhq.ctx.Fields, fields...) + sbuild := &FeatureHistorySelect{FeatureHistoryQuery: fhq} + sbuild.label = featurehistory.Label + sbuild.flds, sbuild.scan = &fhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a FeatureHistorySelect configured with the given aggregations. +func (fhq *FeatureHistoryQuery) Aggregate(fns ...AggregateFunc) *FeatureHistorySelect { + return fhq.Select().Aggregate(fns...) +} + +func (fhq *FeatureHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range fhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, fhq); err != nil { + return err + } + } + } + for _, f := range fhq.ctx.Fields { + if !featurehistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if fhq.path != nil { + prev, err := fhq.path(ctx) + if err != nil { + return err + } + fhq.sql = prev + } + if featurehistory.Policy == nil { + return errors.New("generated: uninitialized featurehistory.Policy (forgotten import generated/runtime?)") + } + if err := featurehistory.Policy.EvalQuery(ctx, fhq); err != nil { + return err + } + return nil +} + +func (fhq *FeatureHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*FeatureHistory, error) { + var ( + nodes = []*FeatureHistory{} + _spec = fhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*FeatureHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &FeatureHistory{config: fhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = fhq.schemaConfig.FeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, fhq.schemaConfig) + if len(fhq.modifiers) > 0 { + _spec.Modifiers = fhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, fhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range fhq.loadTotal { + if err := fhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (fhq *FeatureHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := fhq.querySpec() + _spec.Node.Schema = fhq.schemaConfig.FeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, fhq.schemaConfig) + if len(fhq.modifiers) > 0 { + _spec.Modifiers = fhq.modifiers + } + _spec.Node.Columns = fhq.ctx.Fields + if len(fhq.ctx.Fields) > 0 { + _spec.Unique = fhq.ctx.Unique != nil && *fhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, fhq.driver, _spec) +} + +func (fhq *FeatureHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(featurehistory.Table, featurehistory.Columns, sqlgraph.NewFieldSpec(featurehistory.FieldID, field.TypeString)) + _spec.From = fhq.sql + if unique := fhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if fhq.path != nil { + _spec.Unique = true + } + if fields := fhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, featurehistory.FieldID) + for i := range fields { + if fields[i] != featurehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := fhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := fhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := fhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := fhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (fhq *FeatureHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(fhq.driver.Dialect()) + t1 := builder.Table(featurehistory.Table) + columns := fhq.ctx.Fields + if len(columns) == 0 { + columns = featurehistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if fhq.sql != nil { + selector = fhq.sql + selector.Select(selector.Columns(columns...)...) + } + if fhq.ctx.Unique != nil && *fhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(fhq.schemaConfig.FeatureHistory) + ctx = internal.NewSchemaConfigContext(ctx, fhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range fhq.predicates { + p(selector) + } + for _, p := range fhq.order { + p(selector) + } + if offset := fhq.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 := fhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// FeatureHistoryGroupBy is the group-by builder for FeatureHistory entities. +type FeatureHistoryGroupBy struct { + selector + build *FeatureHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (fhgb *FeatureHistoryGroupBy) Aggregate(fns ...AggregateFunc) *FeatureHistoryGroupBy { + fhgb.fns = append(fhgb.fns, fns...) + return fhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (fhgb *FeatureHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fhgb.build.ctx, ent.OpQueryGroupBy) + if err := fhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FeatureHistoryQuery, *FeatureHistoryGroupBy](ctx, fhgb.build, fhgb, fhgb.build.inters, v) +} + +func (fhgb *FeatureHistoryGroupBy) sqlScan(ctx context.Context, root *FeatureHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(fhgb.fns)) + for _, fn := range fhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*fhgb.flds)+len(fhgb.fns)) + for _, f := range *fhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*fhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := fhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// FeatureHistorySelect is the builder for selecting fields of FeatureHistory entities. +type FeatureHistorySelect struct { + *FeatureHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (fhs *FeatureHistorySelect) Aggregate(fns ...AggregateFunc) *FeatureHistorySelect { + fhs.fns = append(fhs.fns, fns...) + return fhs +} + +// Scan applies the selector query and scans the result into the given value. +func (fhs *FeatureHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fhs.ctx, ent.OpQuerySelect) + if err := fhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FeatureHistoryQuery, *FeatureHistorySelect](ctx, fhs.FeatureHistoryQuery, fhs, fhs.inters, v) +} + +func (fhs *FeatureHistorySelect) sqlScan(ctx context.Context, root *FeatureHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(fhs.fns)) + for _, fn := range fhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*fhs.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 := fhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/featurehistory_update.go b/internal/ent/generated/featurehistory_update.go new file mode 100644 index 0000000..c4eab12 --- /dev/null +++ b/internal/ent/generated/featurehistory_update.go @@ -0,0 +1,707 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FeatureHistoryUpdate is the builder for updating FeatureHistory entities. +type FeatureHistoryUpdate struct { + config + hooks []Hook + mutation *FeatureHistoryMutation +} + +// Where appends a list predicates to the FeatureHistoryUpdate builder. +func (fhu *FeatureHistoryUpdate) Where(ps ...predicate.FeatureHistory) *FeatureHistoryUpdate { + fhu.mutation.Where(ps...) + return fhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (fhu *FeatureHistoryUpdate) SetUpdatedAt(t time.Time) *FeatureHistoryUpdate { + fhu.mutation.SetUpdatedAt(t) + return fhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fhu *FeatureHistoryUpdate) ClearUpdatedAt() *FeatureHistoryUpdate { + fhu.mutation.ClearUpdatedAt() + return fhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (fhu *FeatureHistoryUpdate) SetUpdatedBy(s string) *FeatureHistoryUpdate { + fhu.mutation.SetUpdatedBy(s) + return fhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fhu *FeatureHistoryUpdate) SetNillableUpdatedBy(s *string) *FeatureHistoryUpdate { + if s != nil { + fhu.SetUpdatedBy(*s) + } + return fhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fhu *FeatureHistoryUpdate) ClearUpdatedBy() *FeatureHistoryUpdate { + fhu.mutation.ClearUpdatedBy() + return fhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (fhu *FeatureHistoryUpdate) SetDeletedAt(t time.Time) *FeatureHistoryUpdate { + fhu.mutation.SetDeletedAt(t) + return fhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fhu *FeatureHistoryUpdate) SetNillableDeletedAt(t *time.Time) *FeatureHistoryUpdate { + if t != nil { + fhu.SetDeletedAt(*t) + } + return fhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fhu *FeatureHistoryUpdate) ClearDeletedAt() *FeatureHistoryUpdate { + fhu.mutation.ClearDeletedAt() + return fhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (fhu *FeatureHistoryUpdate) SetDeletedBy(s string) *FeatureHistoryUpdate { + fhu.mutation.SetDeletedBy(s) + return fhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fhu *FeatureHistoryUpdate) SetNillableDeletedBy(s *string) *FeatureHistoryUpdate { + if s != nil { + fhu.SetDeletedBy(*s) + } + return fhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fhu *FeatureHistoryUpdate) ClearDeletedBy() *FeatureHistoryUpdate { + fhu.mutation.ClearDeletedBy() + return fhu +} + +// SetTags sets the "tags" field. +func (fhu *FeatureHistoryUpdate) SetTags(s []string) *FeatureHistoryUpdate { + fhu.mutation.SetTags(s) + return fhu +} + +// AppendTags appends s to the "tags" field. +func (fhu *FeatureHistoryUpdate) AppendTags(s []string) *FeatureHistoryUpdate { + fhu.mutation.AppendTags(s) + return fhu +} + +// ClearTags clears the value of the "tags" field. +func (fhu *FeatureHistoryUpdate) ClearTags() *FeatureHistoryUpdate { + fhu.mutation.ClearTags() + return fhu +} + +// SetOwnerID sets the "owner_id" field. +func (fhu *FeatureHistoryUpdate) SetOwnerID(s string) *FeatureHistoryUpdate { + fhu.mutation.SetOwnerID(s) + return fhu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (fhu *FeatureHistoryUpdate) SetNillableOwnerID(s *string) *FeatureHistoryUpdate { + if s != nil { + fhu.SetOwnerID(*s) + } + return fhu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (fhu *FeatureHistoryUpdate) ClearOwnerID() *FeatureHistoryUpdate { + fhu.mutation.ClearOwnerID() + return fhu +} + +// SetDisplayName sets the "display_name" field. +func (fhu *FeatureHistoryUpdate) SetDisplayName(s string) *FeatureHistoryUpdate { + fhu.mutation.SetDisplayName(s) + return fhu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (fhu *FeatureHistoryUpdate) SetNillableDisplayName(s *string) *FeatureHistoryUpdate { + if s != nil { + fhu.SetDisplayName(*s) + } + return fhu +} + +// ClearDisplayName clears the value of the "display_name" field. +func (fhu *FeatureHistoryUpdate) ClearDisplayName() *FeatureHistoryUpdate { + fhu.mutation.ClearDisplayName() + return fhu +} + +// SetEnabled sets the "enabled" field. +func (fhu *FeatureHistoryUpdate) SetEnabled(b bool) *FeatureHistoryUpdate { + fhu.mutation.SetEnabled(b) + return fhu +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (fhu *FeatureHistoryUpdate) SetNillableEnabled(b *bool) *FeatureHistoryUpdate { + if b != nil { + fhu.SetEnabled(*b) + } + return fhu +} + +// SetDescription sets the "description" field. +func (fhu *FeatureHistoryUpdate) SetDescription(s string) *FeatureHistoryUpdate { + fhu.mutation.SetDescription(s) + return fhu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (fhu *FeatureHistoryUpdate) SetNillableDescription(s *string) *FeatureHistoryUpdate { + if s != nil { + fhu.SetDescription(*s) + } + return fhu +} + +// ClearDescription clears the value of the "description" field. +func (fhu *FeatureHistoryUpdate) ClearDescription() *FeatureHistoryUpdate { + fhu.mutation.ClearDescription() + return fhu +} + +// SetMetadata sets the "metadata" field. +func (fhu *FeatureHistoryUpdate) SetMetadata(m map[string]interface{}) *FeatureHistoryUpdate { + fhu.mutation.SetMetadata(m) + return fhu +} + +// ClearMetadata clears the value of the "metadata" field. +func (fhu *FeatureHistoryUpdate) ClearMetadata() *FeatureHistoryUpdate { + fhu.mutation.ClearMetadata() + return fhu +} + +// Mutation returns the FeatureHistoryMutation object of the builder. +func (fhu *FeatureHistoryUpdate) Mutation() *FeatureHistoryMutation { + return fhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (fhu *FeatureHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := fhu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, fhu.sqlSave, fhu.mutation, fhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fhu *FeatureHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := fhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (fhu *FeatureHistoryUpdate) Exec(ctx context.Context) error { + _, err := fhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhu *FeatureHistoryUpdate) ExecX(ctx context.Context) { + if err := fhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fhu *FeatureHistoryUpdate) defaults() error { + if _, ok := fhu.mutation.UpdatedAt(); !ok && !fhu.mutation.UpdatedAtCleared() { + if featurehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized featurehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := featurehistory.UpdateDefaultUpdatedAt() + fhu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (fhu *FeatureHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(featurehistory.Table, featurehistory.Columns, sqlgraph.NewFieldSpec(featurehistory.FieldID, field.TypeString)) + if ps := fhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fhu.mutation.RefCleared() { + _spec.ClearField(featurehistory.FieldRef, field.TypeString) + } + if fhu.mutation.CreatedAtCleared() { + _spec.ClearField(featurehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := fhu.mutation.UpdatedAt(); ok { + _spec.SetField(featurehistory.FieldUpdatedAt, field.TypeTime, value) + } + if fhu.mutation.UpdatedAtCleared() { + _spec.ClearField(featurehistory.FieldUpdatedAt, field.TypeTime) + } + if fhu.mutation.CreatedByCleared() { + _spec.ClearField(featurehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := fhu.mutation.UpdatedBy(); ok { + _spec.SetField(featurehistory.FieldUpdatedBy, field.TypeString, value) + } + if fhu.mutation.UpdatedByCleared() { + _spec.ClearField(featurehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := fhu.mutation.DeletedAt(); ok { + _spec.SetField(featurehistory.FieldDeletedAt, field.TypeTime, value) + } + if fhu.mutation.DeletedAtCleared() { + _spec.ClearField(featurehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := fhu.mutation.DeletedBy(); ok { + _spec.SetField(featurehistory.FieldDeletedBy, field.TypeString, value) + } + if fhu.mutation.DeletedByCleared() { + _spec.ClearField(featurehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := fhu.mutation.Tags(); ok { + _spec.SetField(featurehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := fhu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, featurehistory.FieldTags, value) + }) + } + if fhu.mutation.TagsCleared() { + _spec.ClearField(featurehistory.FieldTags, field.TypeJSON) + } + if value, ok := fhu.mutation.OwnerID(); ok { + _spec.SetField(featurehistory.FieldOwnerID, field.TypeString, value) + } + if fhu.mutation.OwnerIDCleared() { + _spec.ClearField(featurehistory.FieldOwnerID, field.TypeString) + } + if value, ok := fhu.mutation.DisplayName(); ok { + _spec.SetField(featurehistory.FieldDisplayName, field.TypeString, value) + } + if fhu.mutation.DisplayNameCleared() { + _spec.ClearField(featurehistory.FieldDisplayName, field.TypeString) + } + if value, ok := fhu.mutation.Enabled(); ok { + _spec.SetField(featurehistory.FieldEnabled, field.TypeBool, value) + } + if value, ok := fhu.mutation.Description(); ok { + _spec.SetField(featurehistory.FieldDescription, field.TypeString, value) + } + if fhu.mutation.DescriptionCleared() { + _spec.ClearField(featurehistory.FieldDescription, field.TypeString) + } + if value, ok := fhu.mutation.Metadata(); ok { + _spec.SetField(featurehistory.FieldMetadata, field.TypeJSON, value) + } + if fhu.mutation.MetadataCleared() { + _spec.ClearField(featurehistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = fhu.schemaConfig.FeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, fhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, fhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{featurehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + fhu.mutation.done = true + return n, nil +} + +// FeatureHistoryUpdateOne is the builder for updating a single FeatureHistory entity. +type FeatureHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *FeatureHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (fhuo *FeatureHistoryUpdateOne) SetUpdatedAt(t time.Time) *FeatureHistoryUpdateOne { + fhuo.mutation.SetUpdatedAt(t) + return fhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fhuo *FeatureHistoryUpdateOne) ClearUpdatedAt() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearUpdatedAt() + return fhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (fhuo *FeatureHistoryUpdateOne) SetUpdatedBy(s string) *FeatureHistoryUpdateOne { + fhuo.mutation.SetUpdatedBy(s) + return fhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fhuo *FeatureHistoryUpdateOne) SetNillableUpdatedBy(s *string) *FeatureHistoryUpdateOne { + if s != nil { + fhuo.SetUpdatedBy(*s) + } + return fhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fhuo *FeatureHistoryUpdateOne) ClearUpdatedBy() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearUpdatedBy() + return fhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (fhuo *FeatureHistoryUpdateOne) SetDeletedAt(t time.Time) *FeatureHistoryUpdateOne { + fhuo.mutation.SetDeletedAt(t) + return fhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fhuo *FeatureHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *FeatureHistoryUpdateOne { + if t != nil { + fhuo.SetDeletedAt(*t) + } + return fhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fhuo *FeatureHistoryUpdateOne) ClearDeletedAt() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearDeletedAt() + return fhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (fhuo *FeatureHistoryUpdateOne) SetDeletedBy(s string) *FeatureHistoryUpdateOne { + fhuo.mutation.SetDeletedBy(s) + return fhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fhuo *FeatureHistoryUpdateOne) SetNillableDeletedBy(s *string) *FeatureHistoryUpdateOne { + if s != nil { + fhuo.SetDeletedBy(*s) + } + return fhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fhuo *FeatureHistoryUpdateOne) ClearDeletedBy() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearDeletedBy() + return fhuo +} + +// SetTags sets the "tags" field. +func (fhuo *FeatureHistoryUpdateOne) SetTags(s []string) *FeatureHistoryUpdateOne { + fhuo.mutation.SetTags(s) + return fhuo +} + +// AppendTags appends s to the "tags" field. +func (fhuo *FeatureHistoryUpdateOne) AppendTags(s []string) *FeatureHistoryUpdateOne { + fhuo.mutation.AppendTags(s) + return fhuo +} + +// ClearTags clears the value of the "tags" field. +func (fhuo *FeatureHistoryUpdateOne) ClearTags() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearTags() + return fhuo +} + +// SetOwnerID sets the "owner_id" field. +func (fhuo *FeatureHistoryUpdateOne) SetOwnerID(s string) *FeatureHistoryUpdateOne { + fhuo.mutation.SetOwnerID(s) + return fhuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (fhuo *FeatureHistoryUpdateOne) SetNillableOwnerID(s *string) *FeatureHistoryUpdateOne { + if s != nil { + fhuo.SetOwnerID(*s) + } + return fhuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (fhuo *FeatureHistoryUpdateOne) ClearOwnerID() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearOwnerID() + return fhuo +} + +// SetDisplayName sets the "display_name" field. +func (fhuo *FeatureHistoryUpdateOne) SetDisplayName(s string) *FeatureHistoryUpdateOne { + fhuo.mutation.SetDisplayName(s) + return fhuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (fhuo *FeatureHistoryUpdateOne) SetNillableDisplayName(s *string) *FeatureHistoryUpdateOne { + if s != nil { + fhuo.SetDisplayName(*s) + } + return fhuo +} + +// ClearDisplayName clears the value of the "display_name" field. +func (fhuo *FeatureHistoryUpdateOne) ClearDisplayName() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearDisplayName() + return fhuo +} + +// SetEnabled sets the "enabled" field. +func (fhuo *FeatureHistoryUpdateOne) SetEnabled(b bool) *FeatureHistoryUpdateOne { + fhuo.mutation.SetEnabled(b) + return fhuo +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (fhuo *FeatureHistoryUpdateOne) SetNillableEnabled(b *bool) *FeatureHistoryUpdateOne { + if b != nil { + fhuo.SetEnabled(*b) + } + return fhuo +} + +// SetDescription sets the "description" field. +func (fhuo *FeatureHistoryUpdateOne) SetDescription(s string) *FeatureHistoryUpdateOne { + fhuo.mutation.SetDescription(s) + return fhuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (fhuo *FeatureHistoryUpdateOne) SetNillableDescription(s *string) *FeatureHistoryUpdateOne { + if s != nil { + fhuo.SetDescription(*s) + } + return fhuo +} + +// ClearDescription clears the value of the "description" field. +func (fhuo *FeatureHistoryUpdateOne) ClearDescription() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearDescription() + return fhuo +} + +// SetMetadata sets the "metadata" field. +func (fhuo *FeatureHistoryUpdateOne) SetMetadata(m map[string]interface{}) *FeatureHistoryUpdateOne { + fhuo.mutation.SetMetadata(m) + return fhuo +} + +// ClearMetadata clears the value of the "metadata" field. +func (fhuo *FeatureHistoryUpdateOne) ClearMetadata() *FeatureHistoryUpdateOne { + fhuo.mutation.ClearMetadata() + return fhuo +} + +// Mutation returns the FeatureHistoryMutation object of the builder. +func (fhuo *FeatureHistoryUpdateOne) Mutation() *FeatureHistoryMutation { + return fhuo.mutation +} + +// Where appends a list predicates to the FeatureHistoryUpdate builder. +func (fhuo *FeatureHistoryUpdateOne) Where(ps ...predicate.FeatureHistory) *FeatureHistoryUpdateOne { + fhuo.mutation.Where(ps...) + return fhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (fhuo *FeatureHistoryUpdateOne) Select(field string, fields ...string) *FeatureHistoryUpdateOne { + fhuo.fields = append([]string{field}, fields...) + return fhuo +} + +// Save executes the query and returns the updated FeatureHistory entity. +func (fhuo *FeatureHistoryUpdateOne) Save(ctx context.Context) (*FeatureHistory, error) { + if err := fhuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, fhuo.sqlSave, fhuo.mutation, fhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fhuo *FeatureHistoryUpdateOne) SaveX(ctx context.Context) *FeatureHistory { + node, err := fhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (fhuo *FeatureHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := fhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhuo *FeatureHistoryUpdateOne) ExecX(ctx context.Context) { + if err := fhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fhuo *FeatureHistoryUpdateOne) defaults() error { + if _, ok := fhuo.mutation.UpdatedAt(); !ok && !fhuo.mutation.UpdatedAtCleared() { + if featurehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized featurehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := featurehistory.UpdateDefaultUpdatedAt() + fhuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (fhuo *FeatureHistoryUpdateOne) sqlSave(ctx context.Context) (_node *FeatureHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(featurehistory.Table, featurehistory.Columns, sqlgraph.NewFieldSpec(featurehistory.FieldID, field.TypeString)) + id, ok := fhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "FeatureHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := fhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, featurehistory.FieldID) + for _, f := range fields { + if !featurehistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != featurehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := fhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fhuo.mutation.RefCleared() { + _spec.ClearField(featurehistory.FieldRef, field.TypeString) + } + if fhuo.mutation.CreatedAtCleared() { + _spec.ClearField(featurehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := fhuo.mutation.UpdatedAt(); ok { + _spec.SetField(featurehistory.FieldUpdatedAt, field.TypeTime, value) + } + if fhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(featurehistory.FieldUpdatedAt, field.TypeTime) + } + if fhuo.mutation.CreatedByCleared() { + _spec.ClearField(featurehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := fhuo.mutation.UpdatedBy(); ok { + _spec.SetField(featurehistory.FieldUpdatedBy, field.TypeString, value) + } + if fhuo.mutation.UpdatedByCleared() { + _spec.ClearField(featurehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := fhuo.mutation.DeletedAt(); ok { + _spec.SetField(featurehistory.FieldDeletedAt, field.TypeTime, value) + } + if fhuo.mutation.DeletedAtCleared() { + _spec.ClearField(featurehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := fhuo.mutation.DeletedBy(); ok { + _spec.SetField(featurehistory.FieldDeletedBy, field.TypeString, value) + } + if fhuo.mutation.DeletedByCleared() { + _spec.ClearField(featurehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := fhuo.mutation.Tags(); ok { + _spec.SetField(featurehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := fhuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, featurehistory.FieldTags, value) + }) + } + if fhuo.mutation.TagsCleared() { + _spec.ClearField(featurehistory.FieldTags, field.TypeJSON) + } + if value, ok := fhuo.mutation.OwnerID(); ok { + _spec.SetField(featurehistory.FieldOwnerID, field.TypeString, value) + } + if fhuo.mutation.OwnerIDCleared() { + _spec.ClearField(featurehistory.FieldOwnerID, field.TypeString) + } + if value, ok := fhuo.mutation.DisplayName(); ok { + _spec.SetField(featurehistory.FieldDisplayName, field.TypeString, value) + } + if fhuo.mutation.DisplayNameCleared() { + _spec.ClearField(featurehistory.FieldDisplayName, field.TypeString) + } + if value, ok := fhuo.mutation.Enabled(); ok { + _spec.SetField(featurehistory.FieldEnabled, field.TypeBool, value) + } + if value, ok := fhuo.mutation.Description(); ok { + _spec.SetField(featurehistory.FieldDescription, field.TypeString, value) + } + if fhuo.mutation.DescriptionCleared() { + _spec.ClearField(featurehistory.FieldDescription, field.TypeString) + } + if value, ok := fhuo.mutation.Metadata(); ok { + _spec.SetField(featurehistory.FieldMetadata, field.TypeJSON, value) + } + if fhuo.mutation.MetadataCleared() { + _spec.ClearField(featurehistory.FieldMetadata, field.TypeJSON) + } + _spec.Node.Schema = fhuo.schemaConfig.FeatureHistory + ctx = internal.NewSchemaConfigContext(ctx, fhuo.schemaConfig) + _node = &FeatureHistory{config: fhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, fhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{featurehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + fhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/file.go b/internal/ent/generated/file.go new file mode 100644 index 0000000..4d11b26 --- /dev/null +++ b/internal/ent/generated/file.go @@ -0,0 +1,430 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// File is the model entity for the File schema. +type File struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // FileName holds the value of the "file_name" field. + FileName string `json:"file_name,omitempty"` + // FileExtension holds the value of the "file_extension" field. + FileExtension string `json:"file_extension,omitempty"` + // FileSize holds the value of the "file_size" field. + FileSize int `json:"file_size,omitempty"` + // ContentType holds the value of the "content_type" field. + ContentType string `json:"content_type,omitempty"` + // StoreKey holds the value of the "store_key" field. + StoreKey string `json:"store_key,omitempty"` + // Category holds the value of the "category" field. + Category string `json:"category,omitempty"` + // Annotation holds the value of the "annotation" field. + Annotation string `json:"annotation,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the FileQuery when eager-loading is set. + Edges FileEdges `json:"edges"` + user_files *string + selectValues sql.SelectValues +} + +// FileEdges holds the relations/edges for other nodes in the graph. +type FileEdges struct { + // User holds the value of the user edge. + User *User `json:"user,omitempty"` + // Organization holds the value of the organization edge. + Organization []*Organization `json:"organization,omitempty"` + // Entity holds the value of the entity edge. + Entity []*Entity `json:"entity,omitempty"` + // Group holds the value of the group edge. + Group []*Group `json:"group,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [4]bool + // totalCount holds the count of the edges above. + totalCount [4]map[string]int + + namedOrganization map[string][]*Organization + namedEntity map[string][]*Entity + namedGroup map[string][]*Group +} + +// UserOrErr returns the User value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e FileEdges) UserOrErr() (*User, error) { + if e.User != nil { + return e.User, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "user"} +} + +// OrganizationOrErr returns the Organization value or an error if the edge +// was not loaded in eager-loading. +func (e FileEdges) OrganizationOrErr() ([]*Organization, error) { + if e.loadedTypes[1] { + return e.Organization, nil + } + return nil, &NotLoadedError{edge: "organization"} +} + +// EntityOrErr returns the Entity value or an error if the edge +// was not loaded in eager-loading. +func (e FileEdges) EntityOrErr() ([]*Entity, error) { + if e.loadedTypes[2] { + return e.Entity, nil + } + return nil, &NotLoadedError{edge: "entity"} +} + +// GroupOrErr returns the Group value or an error if the edge +// was not loaded in eager-loading. +func (e FileEdges) GroupOrErr() ([]*Group, error) { + if e.loadedTypes[3] { + return e.Group, nil + } + return nil, &NotLoadedError{edge: "group"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*File) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case file.FieldTags: + values[i] = new([]byte) + case file.FieldFileSize: + values[i] = new(sql.NullInt64) + case file.FieldID, file.FieldCreatedBy, file.FieldUpdatedBy, file.FieldDeletedBy, file.FieldMappingID, file.FieldFileName, file.FieldFileExtension, file.FieldContentType, file.FieldStoreKey, file.FieldCategory, file.FieldAnnotation: + values[i] = new(sql.NullString) + case file.FieldCreatedAt, file.FieldUpdatedAt, file.FieldDeletedAt: + values[i] = new(sql.NullTime) + case file.ForeignKeys[0]: // user_files + values[i] = new(sql.NullString) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the File fields. +func (f *File) 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 file.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + f.ID = value.String + } + case file.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + f.CreatedAt = value.Time + } + case file.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + f.UpdatedAt = value.Time + } + case file.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + f.CreatedBy = value.String + } + case file.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + f.UpdatedBy = value.String + } + case file.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + f.DeletedAt = value.Time + } + case file.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + f.DeletedBy = value.String + } + case file.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + f.MappingID = value.String + } + case file.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &f.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case file.FieldFileName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field file_name", values[i]) + } else if value.Valid { + f.FileName = value.String + } + case file.FieldFileExtension: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field file_extension", values[i]) + } else if value.Valid { + f.FileExtension = value.String + } + case file.FieldFileSize: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field file_size", values[i]) + } else if value.Valid { + f.FileSize = int(value.Int64) + } + case file.FieldContentType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field content_type", values[i]) + } else if value.Valid { + f.ContentType = value.String + } + case file.FieldStoreKey: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field store_key", values[i]) + } else if value.Valid { + f.StoreKey = value.String + } + case file.FieldCategory: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field category", values[i]) + } else if value.Valid { + f.Category = value.String + } + case file.FieldAnnotation: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field annotation", values[i]) + } else if value.Valid { + f.Annotation = value.String + } + case file.ForeignKeys[0]: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_files", values[i]) + } else if value.Valid { + f.user_files = new(string) + *f.user_files = value.String + } + default: + f.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the File. +// This includes values selected through modifiers, order, etc. +func (f *File) Value(name string) (ent.Value, error) { + return f.selectValues.Get(name) +} + +// QueryUser queries the "user" edge of the File entity. +func (f *File) QueryUser() *UserQuery { + return NewFileClient(f.config).QueryUser(f) +} + +// QueryOrganization queries the "organization" edge of the File entity. +func (f *File) QueryOrganization() *OrganizationQuery { + return NewFileClient(f.config).QueryOrganization(f) +} + +// QueryEntity queries the "entity" edge of the File entity. +func (f *File) QueryEntity() *EntityQuery { + return NewFileClient(f.config).QueryEntity(f) +} + +// QueryGroup queries the "group" edge of the File entity. +func (f *File) QueryGroup() *GroupQuery { + return NewFileClient(f.config).QueryGroup(f) +} + +// Update returns a builder for updating this File. +// Note that you need to call File.Unwrap() before calling this method if this File +// was returned from a transaction, and the transaction was committed or rolled back. +func (f *File) Update() *FileUpdateOne { + return NewFileClient(f.config).UpdateOne(f) +} + +// Unwrap unwraps the File 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 (f *File) Unwrap() *File { + _tx, ok := f.config.driver.(*txDriver) + if !ok { + panic("generated: File is not a transactional entity") + } + f.config.driver = _tx.drv + return f +} + +// String implements the fmt.Stringer. +func (f *File) String() string { + var builder strings.Builder + builder.WriteString("File(") + builder.WriteString(fmt.Sprintf("id=%v, ", f.ID)) + builder.WriteString("created_at=") + builder.WriteString(f.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(f.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(f.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(f.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(f.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(f.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(f.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", f.Tags)) + builder.WriteString(", ") + builder.WriteString("file_name=") + builder.WriteString(f.FileName) + builder.WriteString(", ") + builder.WriteString("file_extension=") + builder.WriteString(f.FileExtension) + builder.WriteString(", ") + builder.WriteString("file_size=") + builder.WriteString(fmt.Sprintf("%v", f.FileSize)) + builder.WriteString(", ") + builder.WriteString("content_type=") + builder.WriteString(f.ContentType) + builder.WriteString(", ") + builder.WriteString("store_key=") + builder.WriteString(f.StoreKey) + builder.WriteString(", ") + builder.WriteString("category=") + builder.WriteString(f.Category) + builder.WriteString(", ") + builder.WriteString("annotation=") + builder.WriteString(f.Annotation) + builder.WriteByte(')') + return builder.String() +} + +// NamedOrganization returns the Organization named value or an error if the edge was not +// loaded in eager-loading with this name. +func (f *File) NamedOrganization(name string) ([]*Organization, error) { + if f.Edges.namedOrganization == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := f.Edges.namedOrganization[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (f *File) appendNamedOrganization(name string, edges ...*Organization) { + if f.Edges.namedOrganization == nil { + f.Edges.namedOrganization = make(map[string][]*Organization) + } + if len(edges) == 0 { + f.Edges.namedOrganization[name] = []*Organization{} + } else { + f.Edges.namedOrganization[name] = append(f.Edges.namedOrganization[name], edges...) + } +} + +// NamedEntity returns the Entity named value or an error if the edge was not +// loaded in eager-loading with this name. +func (f *File) NamedEntity(name string) ([]*Entity, error) { + if f.Edges.namedEntity == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := f.Edges.namedEntity[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (f *File) appendNamedEntity(name string, edges ...*Entity) { + if f.Edges.namedEntity == nil { + f.Edges.namedEntity = make(map[string][]*Entity) + } + if len(edges) == 0 { + f.Edges.namedEntity[name] = []*Entity{} + } else { + f.Edges.namedEntity[name] = append(f.Edges.namedEntity[name], edges...) + } +} + +// NamedGroup returns the Group named value or an error if the edge was not +// loaded in eager-loading with this name. +func (f *File) NamedGroup(name string) ([]*Group, error) { + if f.Edges.namedGroup == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := f.Edges.namedGroup[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (f *File) appendNamedGroup(name string, edges ...*Group) { + if f.Edges.namedGroup == nil { + f.Edges.namedGroup = make(map[string][]*Group) + } + if len(edges) == 0 { + f.Edges.namedGroup[name] = []*Group{} + } else { + f.Edges.namedGroup[name] = append(f.Edges.namedGroup[name], edges...) + } +} + +// Files is a parsable slice of File. +type Files []*File diff --git a/internal/ent/generated/file/file.go b/internal/ent/generated/file/file.go new file mode 100644 index 0000000..e1bd236 --- /dev/null +++ b/internal/ent/generated/file/file.go @@ -0,0 +1,312 @@ +// Code generated by ent, DO NOT EDIT. + +package file + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the file type in the database. + Label = "file" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldFileName holds the string denoting the file_name field in the database. + FieldFileName = "file_name" + // FieldFileExtension holds the string denoting the file_extension field in the database. + FieldFileExtension = "file_extension" + // FieldFileSize holds the string denoting the file_size field in the database. + FieldFileSize = "file_size" + // FieldContentType holds the string denoting the content_type field in the database. + FieldContentType = "content_type" + // FieldStoreKey holds the string denoting the store_key field in the database. + FieldStoreKey = "store_key" + // FieldCategory holds the string denoting the category field in the database. + FieldCategory = "category" + // FieldAnnotation holds the string denoting the annotation field in the database. + FieldAnnotation = "annotation" + // EdgeUser holds the string denoting the user edge name in mutations. + EdgeUser = "user" + // EdgeOrganization holds the string denoting the organization edge name in mutations. + EdgeOrganization = "organization" + // EdgeEntity holds the string denoting the entity edge name in mutations. + EdgeEntity = "entity" + // EdgeGroup holds the string denoting the group edge name in mutations. + EdgeGroup = "group" + // Table holds the table name of the file in the database. + Table = "files" + // UserTable is the table that holds the user relation/edge. + UserTable = "files" + // UserInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + UserInverseTable = "users" + // UserColumn is the table column denoting the user relation/edge. + UserColumn = "user_files" + // OrganizationTable is the table that holds the organization relation/edge. The primary key declared below. + OrganizationTable = "organization_files" + // OrganizationInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationInverseTable = "organizations" + // EntityTable is the table that holds the entity relation/edge. The primary key declared below. + EntityTable = "entity_files" + // EntityInverseTable is the table name for the Entity entity. + // It exists in this package in order to avoid circular dependency with the "entity" package. + EntityInverseTable = "entities" + // GroupTable is the table that holds the group relation/edge. The primary key declared below. + GroupTable = "group_files" + // GroupInverseTable is the table name for the Group entity. + // It exists in this package in order to avoid circular dependency with the "group" package. + GroupInverseTable = "groups" +) + +// Columns holds all SQL columns for file fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldFileName, + FieldFileExtension, + FieldFileSize, + FieldContentType, + FieldStoreKey, + FieldCategory, + FieldAnnotation, +} + +// ForeignKeys holds the SQL foreign-keys that are owned by the "files" +// table and are not defined as standalone fields in the schema. +var ForeignKeys = []string{ + "user_files", +} + +var ( + // OrganizationPrimaryKey and OrganizationColumn2 are the table columns denoting the + // primary key for the organization relation (M2M). + OrganizationPrimaryKey = []string{"organization_id", "file_id"} + // EntityPrimaryKey and EntityColumn2 are the table columns denoting the + // primary key for the entity relation (M2M). + EntityPrimaryKey = []string{"entity_id", "file_id"} + // GroupPrimaryKey and GroupColumn2 are the table columns denoting the + // primary key for the group relation (M2M). + GroupPrimaryKey = []string{"group_id", "file_id"} +) + +// 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 +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [2]ent.Hook + Interceptors [1]ent.Interceptor + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // FileSizeValidator is a validator for the "file_size" field. It is called by the builders before save. + FileSizeValidator func(int) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the File queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByFileName orders the results by the file_name field. +func ByFileName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFileName, opts...).ToFunc() +} + +// ByFileExtension orders the results by the file_extension field. +func ByFileExtension(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFileExtension, opts...).ToFunc() +} + +// ByFileSize orders the results by the file_size field. +func ByFileSize(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFileSize, opts...).ToFunc() +} + +// ByContentType orders the results by the content_type field. +func ByContentType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldContentType, opts...).ToFunc() +} + +// ByStoreKey orders the results by the store_key field. +func ByStoreKey(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStoreKey, opts...).ToFunc() +} + +// ByCategory orders the results by the category field. +func ByCategory(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCategory, opts...).ToFunc() +} + +// ByAnnotation orders the results by the annotation field. +func ByAnnotation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAnnotation, opts...).ToFunc() +} + +// ByUserField orders the results by user field. +func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...)) + } +} + +// ByOrganizationCount orders the results by organization count. +func ByOrganizationCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrganizationStep(), opts...) + } +} + +// ByOrganization orders the results by organization terms. +func ByOrganization(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntityCount orders the results by entity count. +func ByEntityCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntityStep(), opts...) + } +} + +// ByEntity orders the results by entity terms. +func ByEntity(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntityStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByGroupCount orders the results by group count. +func ByGroupCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newGroupStep(), opts...) + } +} + +// ByGroup orders the results by group terms. +func ByGroup(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newUserStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(UserInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), + ) +} +func newOrganizationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationTable, OrganizationPrimaryKey...), + ) +} +func newEntityStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntityInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntityTable, EntityPrimaryKey...), + ) +} +func newGroupStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, GroupTable, GroupPrimaryKey...), + ) +} diff --git a/internal/ent/generated/file/where.go b/internal/ent/generated/file/where.go new file mode 100644 index 0000000..8dd77f9 --- /dev/null +++ b/internal/ent/generated/file/where.go @@ -0,0 +1,1179 @@ +// Code generated by ent, DO NOT EDIT. + +package file + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.File { + return predicate.File(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.File { + return predicate.File(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.File { + return predicate.File(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.File { + return predicate.File(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.File { + return predicate.File(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.File { + return predicate.File(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.File { + return predicate.File(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.File { + return predicate.File(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.File { + return predicate.File(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldMappingID, v)) +} + +// FileName applies equality check predicate on the "file_name" field. It's identical to FileNameEQ. +func FileName(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldFileName, v)) +} + +// FileExtension applies equality check predicate on the "file_extension" field. It's identical to FileExtensionEQ. +func FileExtension(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldFileExtension, v)) +} + +// FileSize applies equality check predicate on the "file_size" field. It's identical to FileSizeEQ. +func FileSize(v int) predicate.File { + return predicate.File(sql.FieldEQ(FieldFileSize, v)) +} + +// ContentType applies equality check predicate on the "content_type" field. It's identical to ContentTypeEQ. +func ContentType(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldContentType, v)) +} + +// StoreKey applies equality check predicate on the "store_key" field. It's identical to StoreKeyEQ. +func StoreKey(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldStoreKey, v)) +} + +// Category applies equality check predicate on the "category" field. It's identical to CategoryEQ. +func Category(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldCategory, v)) +} + +// Annotation applies equality check predicate on the "annotation" field. It's identical to AnnotationEQ. +func Annotation(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldAnnotation, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.File { + return predicate.File(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.File { + return predicate.File(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.File { + return predicate.File(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.File { + return predicate.File(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.File { + return predicate.File(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.File { + return predicate.File(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.File { + return predicate.File(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.File { + return predicate.File(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.File { + return predicate.File(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.File { + return predicate.File(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.File { + return predicate.File(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.File { + return predicate.File(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.File { + return predicate.File(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.File { + return predicate.File(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.File { + return predicate.File(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.File { + return predicate.File(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.File { + return predicate.File(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.File { + return predicate.File(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.File { + return predicate.File(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.File { + return predicate.File(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.File { + return predicate.File(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.File { + return predicate.File(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.File { + return predicate.File(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.File { + return predicate.File(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldTags)) +} + +// FileNameEQ applies the EQ predicate on the "file_name" field. +func FileNameEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldFileName, v)) +} + +// FileNameNEQ applies the NEQ predicate on the "file_name" field. +func FileNameNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldFileName, v)) +} + +// FileNameIn applies the In predicate on the "file_name" field. +func FileNameIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldFileName, vs...)) +} + +// FileNameNotIn applies the NotIn predicate on the "file_name" field. +func FileNameNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldFileName, vs...)) +} + +// FileNameGT applies the GT predicate on the "file_name" field. +func FileNameGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldFileName, v)) +} + +// FileNameGTE applies the GTE predicate on the "file_name" field. +func FileNameGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldFileName, v)) +} + +// FileNameLT applies the LT predicate on the "file_name" field. +func FileNameLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldFileName, v)) +} + +// FileNameLTE applies the LTE predicate on the "file_name" field. +func FileNameLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldFileName, v)) +} + +// FileNameContains applies the Contains predicate on the "file_name" field. +func FileNameContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldFileName, v)) +} + +// FileNameHasPrefix applies the HasPrefix predicate on the "file_name" field. +func FileNameHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldFileName, v)) +} + +// FileNameHasSuffix applies the HasSuffix predicate on the "file_name" field. +func FileNameHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldFileName, v)) +} + +// FileNameEqualFold applies the EqualFold predicate on the "file_name" field. +func FileNameEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldFileName, v)) +} + +// FileNameContainsFold applies the ContainsFold predicate on the "file_name" field. +func FileNameContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldFileName, v)) +} + +// FileExtensionEQ applies the EQ predicate on the "file_extension" field. +func FileExtensionEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldFileExtension, v)) +} + +// FileExtensionNEQ applies the NEQ predicate on the "file_extension" field. +func FileExtensionNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldFileExtension, v)) +} + +// FileExtensionIn applies the In predicate on the "file_extension" field. +func FileExtensionIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldFileExtension, vs...)) +} + +// FileExtensionNotIn applies the NotIn predicate on the "file_extension" field. +func FileExtensionNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldFileExtension, vs...)) +} + +// FileExtensionGT applies the GT predicate on the "file_extension" field. +func FileExtensionGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldFileExtension, v)) +} + +// FileExtensionGTE applies the GTE predicate on the "file_extension" field. +func FileExtensionGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldFileExtension, v)) +} + +// FileExtensionLT applies the LT predicate on the "file_extension" field. +func FileExtensionLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldFileExtension, v)) +} + +// FileExtensionLTE applies the LTE predicate on the "file_extension" field. +func FileExtensionLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldFileExtension, v)) +} + +// FileExtensionContains applies the Contains predicate on the "file_extension" field. +func FileExtensionContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldFileExtension, v)) +} + +// FileExtensionHasPrefix applies the HasPrefix predicate on the "file_extension" field. +func FileExtensionHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldFileExtension, v)) +} + +// FileExtensionHasSuffix applies the HasSuffix predicate on the "file_extension" field. +func FileExtensionHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldFileExtension, v)) +} + +// FileExtensionEqualFold applies the EqualFold predicate on the "file_extension" field. +func FileExtensionEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldFileExtension, v)) +} + +// FileExtensionContainsFold applies the ContainsFold predicate on the "file_extension" field. +func FileExtensionContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldFileExtension, v)) +} + +// FileSizeEQ applies the EQ predicate on the "file_size" field. +func FileSizeEQ(v int) predicate.File { + return predicate.File(sql.FieldEQ(FieldFileSize, v)) +} + +// FileSizeNEQ applies the NEQ predicate on the "file_size" field. +func FileSizeNEQ(v int) predicate.File { + return predicate.File(sql.FieldNEQ(FieldFileSize, v)) +} + +// FileSizeIn applies the In predicate on the "file_size" field. +func FileSizeIn(vs ...int) predicate.File { + return predicate.File(sql.FieldIn(FieldFileSize, vs...)) +} + +// FileSizeNotIn applies the NotIn predicate on the "file_size" field. +func FileSizeNotIn(vs ...int) predicate.File { + return predicate.File(sql.FieldNotIn(FieldFileSize, vs...)) +} + +// FileSizeGT applies the GT predicate on the "file_size" field. +func FileSizeGT(v int) predicate.File { + return predicate.File(sql.FieldGT(FieldFileSize, v)) +} + +// FileSizeGTE applies the GTE predicate on the "file_size" field. +func FileSizeGTE(v int) predicate.File { + return predicate.File(sql.FieldGTE(FieldFileSize, v)) +} + +// FileSizeLT applies the LT predicate on the "file_size" field. +func FileSizeLT(v int) predicate.File { + return predicate.File(sql.FieldLT(FieldFileSize, v)) +} + +// FileSizeLTE applies the LTE predicate on the "file_size" field. +func FileSizeLTE(v int) predicate.File { + return predicate.File(sql.FieldLTE(FieldFileSize, v)) +} + +// FileSizeIsNil applies the IsNil predicate on the "file_size" field. +func FileSizeIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldFileSize)) +} + +// FileSizeNotNil applies the NotNil predicate on the "file_size" field. +func FileSizeNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldFileSize)) +} + +// ContentTypeEQ applies the EQ predicate on the "content_type" field. +func ContentTypeEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldContentType, v)) +} + +// ContentTypeNEQ applies the NEQ predicate on the "content_type" field. +func ContentTypeNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldContentType, v)) +} + +// ContentTypeIn applies the In predicate on the "content_type" field. +func ContentTypeIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldContentType, vs...)) +} + +// ContentTypeNotIn applies the NotIn predicate on the "content_type" field. +func ContentTypeNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldContentType, vs...)) +} + +// ContentTypeGT applies the GT predicate on the "content_type" field. +func ContentTypeGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldContentType, v)) +} + +// ContentTypeGTE applies the GTE predicate on the "content_type" field. +func ContentTypeGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldContentType, v)) +} + +// ContentTypeLT applies the LT predicate on the "content_type" field. +func ContentTypeLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldContentType, v)) +} + +// ContentTypeLTE applies the LTE predicate on the "content_type" field. +func ContentTypeLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldContentType, v)) +} + +// ContentTypeContains applies the Contains predicate on the "content_type" field. +func ContentTypeContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldContentType, v)) +} + +// ContentTypeHasPrefix applies the HasPrefix predicate on the "content_type" field. +func ContentTypeHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldContentType, v)) +} + +// ContentTypeHasSuffix applies the HasSuffix predicate on the "content_type" field. +func ContentTypeHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldContentType, v)) +} + +// ContentTypeEqualFold applies the EqualFold predicate on the "content_type" field. +func ContentTypeEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldContentType, v)) +} + +// ContentTypeContainsFold applies the ContainsFold predicate on the "content_type" field. +func ContentTypeContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldContentType, v)) +} + +// StoreKeyEQ applies the EQ predicate on the "store_key" field. +func StoreKeyEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldStoreKey, v)) +} + +// StoreKeyNEQ applies the NEQ predicate on the "store_key" field. +func StoreKeyNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldStoreKey, v)) +} + +// StoreKeyIn applies the In predicate on the "store_key" field. +func StoreKeyIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldStoreKey, vs...)) +} + +// StoreKeyNotIn applies the NotIn predicate on the "store_key" field. +func StoreKeyNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldStoreKey, vs...)) +} + +// StoreKeyGT applies the GT predicate on the "store_key" field. +func StoreKeyGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldStoreKey, v)) +} + +// StoreKeyGTE applies the GTE predicate on the "store_key" field. +func StoreKeyGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldStoreKey, v)) +} + +// StoreKeyLT applies the LT predicate on the "store_key" field. +func StoreKeyLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldStoreKey, v)) +} + +// StoreKeyLTE applies the LTE predicate on the "store_key" field. +func StoreKeyLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldStoreKey, v)) +} + +// StoreKeyContains applies the Contains predicate on the "store_key" field. +func StoreKeyContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldStoreKey, v)) +} + +// StoreKeyHasPrefix applies the HasPrefix predicate on the "store_key" field. +func StoreKeyHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldStoreKey, v)) +} + +// StoreKeyHasSuffix applies the HasSuffix predicate on the "store_key" field. +func StoreKeyHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldStoreKey, v)) +} + +// StoreKeyEqualFold applies the EqualFold predicate on the "store_key" field. +func StoreKeyEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldStoreKey, v)) +} + +// StoreKeyContainsFold applies the ContainsFold predicate on the "store_key" field. +func StoreKeyContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldStoreKey, v)) +} + +// CategoryEQ applies the EQ predicate on the "category" field. +func CategoryEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldCategory, v)) +} + +// CategoryNEQ applies the NEQ predicate on the "category" field. +func CategoryNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldCategory, v)) +} + +// CategoryIn applies the In predicate on the "category" field. +func CategoryIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldCategory, vs...)) +} + +// CategoryNotIn applies the NotIn predicate on the "category" field. +func CategoryNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldCategory, vs...)) +} + +// CategoryGT applies the GT predicate on the "category" field. +func CategoryGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldCategory, v)) +} + +// CategoryGTE applies the GTE predicate on the "category" field. +func CategoryGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldCategory, v)) +} + +// CategoryLT applies the LT predicate on the "category" field. +func CategoryLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldCategory, v)) +} + +// CategoryLTE applies the LTE predicate on the "category" field. +func CategoryLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldCategory, v)) +} + +// CategoryContains applies the Contains predicate on the "category" field. +func CategoryContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldCategory, v)) +} + +// CategoryHasPrefix applies the HasPrefix predicate on the "category" field. +func CategoryHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldCategory, v)) +} + +// CategoryHasSuffix applies the HasSuffix predicate on the "category" field. +func CategoryHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldCategory, v)) +} + +// CategoryIsNil applies the IsNil predicate on the "category" field. +func CategoryIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldCategory)) +} + +// CategoryNotNil applies the NotNil predicate on the "category" field. +func CategoryNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldCategory)) +} + +// CategoryEqualFold applies the EqualFold predicate on the "category" field. +func CategoryEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldCategory, v)) +} + +// CategoryContainsFold applies the ContainsFold predicate on the "category" field. +func CategoryContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldCategory, v)) +} + +// AnnotationEQ applies the EQ predicate on the "annotation" field. +func AnnotationEQ(v string) predicate.File { + return predicate.File(sql.FieldEQ(FieldAnnotation, v)) +} + +// AnnotationNEQ applies the NEQ predicate on the "annotation" field. +func AnnotationNEQ(v string) predicate.File { + return predicate.File(sql.FieldNEQ(FieldAnnotation, v)) +} + +// AnnotationIn applies the In predicate on the "annotation" field. +func AnnotationIn(vs ...string) predicate.File { + return predicate.File(sql.FieldIn(FieldAnnotation, vs...)) +} + +// AnnotationNotIn applies the NotIn predicate on the "annotation" field. +func AnnotationNotIn(vs ...string) predicate.File { + return predicate.File(sql.FieldNotIn(FieldAnnotation, vs...)) +} + +// AnnotationGT applies the GT predicate on the "annotation" field. +func AnnotationGT(v string) predicate.File { + return predicate.File(sql.FieldGT(FieldAnnotation, v)) +} + +// AnnotationGTE applies the GTE predicate on the "annotation" field. +func AnnotationGTE(v string) predicate.File { + return predicate.File(sql.FieldGTE(FieldAnnotation, v)) +} + +// AnnotationLT applies the LT predicate on the "annotation" field. +func AnnotationLT(v string) predicate.File { + return predicate.File(sql.FieldLT(FieldAnnotation, v)) +} + +// AnnotationLTE applies the LTE predicate on the "annotation" field. +func AnnotationLTE(v string) predicate.File { + return predicate.File(sql.FieldLTE(FieldAnnotation, v)) +} + +// AnnotationContains applies the Contains predicate on the "annotation" field. +func AnnotationContains(v string) predicate.File { + return predicate.File(sql.FieldContains(FieldAnnotation, v)) +} + +// AnnotationHasPrefix applies the HasPrefix predicate on the "annotation" field. +func AnnotationHasPrefix(v string) predicate.File { + return predicate.File(sql.FieldHasPrefix(FieldAnnotation, v)) +} + +// AnnotationHasSuffix applies the HasSuffix predicate on the "annotation" field. +func AnnotationHasSuffix(v string) predicate.File { + return predicate.File(sql.FieldHasSuffix(FieldAnnotation, v)) +} + +// AnnotationIsNil applies the IsNil predicate on the "annotation" field. +func AnnotationIsNil() predicate.File { + return predicate.File(sql.FieldIsNull(FieldAnnotation)) +} + +// AnnotationNotNil applies the NotNil predicate on the "annotation" field. +func AnnotationNotNil() predicate.File { + return predicate.File(sql.FieldNotNull(FieldAnnotation)) +} + +// AnnotationEqualFold applies the EqualFold predicate on the "annotation" field. +func AnnotationEqualFold(v string) predicate.File { + return predicate.File(sql.FieldEqualFold(FieldAnnotation, v)) +} + +// AnnotationContainsFold applies the ContainsFold predicate on the "annotation" field. +func AnnotationContainsFold(v string) predicate.File { + return predicate.File(sql.FieldContainsFold(FieldAnnotation, v)) +} + +// HasUser applies the HasEdge predicate on the "user" edge. +func HasUser() predicate.File { + return predicate.File(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.File + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates). +func HasUserWith(preds ...predicate.User) predicate.File { + return predicate.File(func(s *sql.Selector) { + step := newUserStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.File + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrganization applies the HasEdge predicate on the "organization" edge. +func HasOrganization() predicate.File { + return predicate.File(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationTable, OrganizationPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationFiles + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationWith applies the HasEdge predicate on the "organization" edge with a given conditions (other predicates). +func HasOrganizationWith(preds ...predicate.Organization) predicate.File { + return predicate.File(func(s *sql.Selector) { + step := newOrganizationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationFiles + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntity applies the HasEdge predicate on the "entity" edge. +func HasEntity() predicate.File { + return predicate.File(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, EntityTable, EntityPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityFiles + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntityWith applies the HasEdge predicate on the "entity" edge with a given conditions (other predicates). +func HasEntityWith(preds ...predicate.Entity) predicate.File { + return predicate.File(func(s *sql.Selector) { + step := newEntityStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityFiles + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasGroup applies the HasEdge predicate on the "group" edge. +func HasGroup() predicate.File { + return predicate.File(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, GroupTable, GroupPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupFiles + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates). +func HasGroupWith(preds ...predicate.Group) predicate.File { + return predicate.File(func(s *sql.Selector) { + step := newGroupStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupFiles + 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.File) predicate.File { + return predicate.File(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.File) predicate.File { + return predicate.File(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.File) predicate.File { + return predicate.File(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/file_create.go b/internal/ent/generated/file_create.go new file mode 100644 index 0000000..66f2e28 --- /dev/null +++ b/internal/ent/generated/file_create.go @@ -0,0 +1,619 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// FileCreate is the builder for creating a File entity. +type FileCreate struct { + config + mutation *FileMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (fc *FileCreate) SetCreatedAt(t time.Time) *FileCreate { + fc.mutation.SetCreatedAt(t) + return fc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (fc *FileCreate) SetNillableCreatedAt(t *time.Time) *FileCreate { + if t != nil { + fc.SetCreatedAt(*t) + } + return fc +} + +// SetUpdatedAt sets the "updated_at" field. +func (fc *FileCreate) SetUpdatedAt(t time.Time) *FileCreate { + fc.mutation.SetUpdatedAt(t) + return fc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (fc *FileCreate) SetNillableUpdatedAt(t *time.Time) *FileCreate { + if t != nil { + fc.SetUpdatedAt(*t) + } + return fc +} + +// SetCreatedBy sets the "created_by" field. +func (fc *FileCreate) SetCreatedBy(s string) *FileCreate { + fc.mutation.SetCreatedBy(s) + return fc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (fc *FileCreate) SetNillableCreatedBy(s *string) *FileCreate { + if s != nil { + fc.SetCreatedBy(*s) + } + return fc +} + +// SetUpdatedBy sets the "updated_by" field. +func (fc *FileCreate) SetUpdatedBy(s string) *FileCreate { + fc.mutation.SetUpdatedBy(s) + return fc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fc *FileCreate) SetNillableUpdatedBy(s *string) *FileCreate { + if s != nil { + fc.SetUpdatedBy(*s) + } + return fc +} + +// SetDeletedAt sets the "deleted_at" field. +func (fc *FileCreate) SetDeletedAt(t time.Time) *FileCreate { + fc.mutation.SetDeletedAt(t) + return fc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fc *FileCreate) SetNillableDeletedAt(t *time.Time) *FileCreate { + if t != nil { + fc.SetDeletedAt(*t) + } + return fc +} + +// SetDeletedBy sets the "deleted_by" field. +func (fc *FileCreate) SetDeletedBy(s string) *FileCreate { + fc.mutation.SetDeletedBy(s) + return fc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fc *FileCreate) SetNillableDeletedBy(s *string) *FileCreate { + if s != nil { + fc.SetDeletedBy(*s) + } + return fc +} + +// SetMappingID sets the "mapping_id" field. +func (fc *FileCreate) SetMappingID(s string) *FileCreate { + fc.mutation.SetMappingID(s) + return fc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (fc *FileCreate) SetNillableMappingID(s *string) *FileCreate { + if s != nil { + fc.SetMappingID(*s) + } + return fc +} + +// SetTags sets the "tags" field. +func (fc *FileCreate) SetTags(s []string) *FileCreate { + fc.mutation.SetTags(s) + return fc +} + +// SetFileName sets the "file_name" field. +func (fc *FileCreate) SetFileName(s string) *FileCreate { + fc.mutation.SetFileName(s) + return fc +} + +// SetFileExtension sets the "file_extension" field. +func (fc *FileCreate) SetFileExtension(s string) *FileCreate { + fc.mutation.SetFileExtension(s) + return fc +} + +// SetFileSize sets the "file_size" field. +func (fc *FileCreate) SetFileSize(i int) *FileCreate { + fc.mutation.SetFileSize(i) + return fc +} + +// SetNillableFileSize sets the "file_size" field if the given value is not nil. +func (fc *FileCreate) SetNillableFileSize(i *int) *FileCreate { + if i != nil { + fc.SetFileSize(*i) + } + return fc +} + +// SetContentType sets the "content_type" field. +func (fc *FileCreate) SetContentType(s string) *FileCreate { + fc.mutation.SetContentType(s) + return fc +} + +// SetStoreKey sets the "store_key" field. +func (fc *FileCreate) SetStoreKey(s string) *FileCreate { + fc.mutation.SetStoreKey(s) + return fc +} + +// SetCategory sets the "category" field. +func (fc *FileCreate) SetCategory(s string) *FileCreate { + fc.mutation.SetCategory(s) + return fc +} + +// SetNillableCategory sets the "category" field if the given value is not nil. +func (fc *FileCreate) SetNillableCategory(s *string) *FileCreate { + if s != nil { + fc.SetCategory(*s) + } + return fc +} + +// SetAnnotation sets the "annotation" field. +func (fc *FileCreate) SetAnnotation(s string) *FileCreate { + fc.mutation.SetAnnotation(s) + return fc +} + +// SetNillableAnnotation sets the "annotation" field if the given value is not nil. +func (fc *FileCreate) SetNillableAnnotation(s *string) *FileCreate { + if s != nil { + fc.SetAnnotation(*s) + } + return fc +} + +// SetID sets the "id" field. +func (fc *FileCreate) SetID(s string) *FileCreate { + fc.mutation.SetID(s) + return fc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (fc *FileCreate) SetNillableID(s *string) *FileCreate { + if s != nil { + fc.SetID(*s) + } + return fc +} + +// SetUserID sets the "user" edge to the User entity by ID. +func (fc *FileCreate) SetUserID(id string) *FileCreate { + fc.mutation.SetUserID(id) + return fc +} + +// SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil. +func (fc *FileCreate) SetNillableUserID(id *string) *FileCreate { + if id != nil { + fc = fc.SetUserID(*id) + } + return fc +} + +// SetUser sets the "user" edge to the User entity. +func (fc *FileCreate) SetUser(u *User) *FileCreate { + return fc.SetUserID(u.ID) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (fc *FileCreate) AddOrganizationIDs(ids ...string) *FileCreate { + fc.mutation.AddOrganizationIDs(ids...) + return fc +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (fc *FileCreate) AddOrganization(o ...*Organization) *FileCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return fc.AddOrganizationIDs(ids...) +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by IDs. +func (fc *FileCreate) AddEntityIDs(ids ...string) *FileCreate { + fc.mutation.AddEntityIDs(ids...) + return fc +} + +// AddEntity adds the "entity" edges to the Entity entity. +func (fc *FileCreate) AddEntity(e ...*Entity) *FileCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fc.AddEntityIDs(ids...) +} + +// AddGroupIDs adds the "group" edge to the Group entity by IDs. +func (fc *FileCreate) AddGroupIDs(ids ...string) *FileCreate { + fc.mutation.AddGroupIDs(ids...) + return fc +} + +// AddGroup adds the "group" edges to the Group entity. +func (fc *FileCreate) AddGroup(g ...*Group) *FileCreate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return fc.AddGroupIDs(ids...) +} + +// Mutation returns the FileMutation object of the builder. +func (fc *FileCreate) Mutation() *FileMutation { + return fc.mutation +} + +// Save creates the File in the database. +func (fc *FileCreate) Save(ctx context.Context) (*File, error) { + if err := fc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, fc.sqlSave, fc.mutation, fc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (fc *FileCreate) SaveX(ctx context.Context) *File { + v, err := fc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fc *FileCreate) Exec(ctx context.Context) error { + _, err := fc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fc *FileCreate) ExecX(ctx context.Context) { + if err := fc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fc *FileCreate) defaults() error { + if _, ok := fc.mutation.CreatedAt(); !ok { + if file.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized file.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := file.DefaultCreatedAt() + fc.mutation.SetCreatedAt(v) + } + if _, ok := fc.mutation.UpdatedAt(); !ok { + if file.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized file.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := file.DefaultUpdatedAt() + fc.mutation.SetUpdatedAt(v) + } + if _, ok := fc.mutation.MappingID(); !ok { + if file.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized file.DefaultMappingID (forgotten import generated/runtime?)") + } + v := file.DefaultMappingID() + fc.mutation.SetMappingID(v) + } + if _, ok := fc.mutation.Tags(); !ok { + v := file.DefaultTags + fc.mutation.SetTags(v) + } + if _, ok := fc.mutation.ID(); !ok { + if file.DefaultID == nil { + return fmt.Errorf("generated: uninitialized file.DefaultID (forgotten import generated/runtime?)") + } + v := file.DefaultID() + fc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (fc *FileCreate) check() error { + if _, ok := fc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "File.mapping_id"`)} + } + if _, ok := fc.mutation.FileName(); !ok { + return &ValidationError{Name: "file_name", err: errors.New(`generated: missing required field "File.file_name"`)} + } + if _, ok := fc.mutation.FileExtension(); !ok { + return &ValidationError{Name: "file_extension", err: errors.New(`generated: missing required field "File.file_extension"`)} + } + if v, ok := fc.mutation.FileSize(); ok { + if err := file.FileSizeValidator(v); err != nil { + return &ValidationError{Name: "file_size", err: fmt.Errorf(`generated: validator failed for field "File.file_size": %w`, err)} + } + } + if _, ok := fc.mutation.ContentType(); !ok { + return &ValidationError{Name: "content_type", err: errors.New(`generated: missing required field "File.content_type"`)} + } + if _, ok := fc.mutation.StoreKey(); !ok { + return &ValidationError{Name: "store_key", err: errors.New(`generated: missing required field "File.store_key"`)} + } + return nil +} + +func (fc *FileCreate) sqlSave(ctx context.Context) (*File, error) { + if err := fc.check(); err != nil { + return nil, err + } + _node, _spec := fc.createSpec() + if err := sqlgraph.CreateNode(ctx, fc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected File.ID type: %T", _spec.ID.Value) + } + } + fc.mutation.id = &_node.ID + fc.mutation.done = true + return _node, nil +} + +func (fc *FileCreate) createSpec() (*File, *sqlgraph.CreateSpec) { + var ( + _node = &File{config: fc.config} + _spec = sqlgraph.NewCreateSpec(file.Table, sqlgraph.NewFieldSpec(file.FieldID, field.TypeString)) + ) + _spec.Schema = fc.schemaConfig.File + if id, ok := fc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := fc.mutation.CreatedAt(); ok { + _spec.SetField(file.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := fc.mutation.UpdatedAt(); ok { + _spec.SetField(file.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := fc.mutation.CreatedBy(); ok { + _spec.SetField(file.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := fc.mutation.UpdatedBy(); ok { + _spec.SetField(file.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := fc.mutation.DeletedAt(); ok { + _spec.SetField(file.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := fc.mutation.DeletedBy(); ok { + _spec.SetField(file.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := fc.mutation.MappingID(); ok { + _spec.SetField(file.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := fc.mutation.Tags(); ok { + _spec.SetField(file.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := fc.mutation.FileName(); ok { + _spec.SetField(file.FieldFileName, field.TypeString, value) + _node.FileName = value + } + if value, ok := fc.mutation.FileExtension(); ok { + _spec.SetField(file.FieldFileExtension, field.TypeString, value) + _node.FileExtension = value + } + if value, ok := fc.mutation.FileSize(); ok { + _spec.SetField(file.FieldFileSize, field.TypeInt, value) + _node.FileSize = value + } + if value, ok := fc.mutation.ContentType(); ok { + _spec.SetField(file.FieldContentType, field.TypeString, value) + _node.ContentType = value + } + if value, ok := fc.mutation.StoreKey(); ok { + _spec.SetField(file.FieldStoreKey, field.TypeString, value) + _node.StoreKey = value + } + if value, ok := fc.mutation.Category(); ok { + _spec.SetField(file.FieldCategory, field.TypeString, value) + _node.Category = value + } + if value, ok := fc.mutation.Annotation(); ok { + _spec.SetField(file.FieldAnnotation, field.TypeString, value) + _node.Annotation = value + } + if nodes := fc.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: file.UserTable, + Columns: []string{file.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.user_files = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := fc.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := fc.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := fc.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = fc.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// FileCreateBulk is the builder for creating many File entities in bulk. +type FileCreateBulk struct { + config + err error + builders []*FileCreate +} + +// Save creates the File entities in the database. +func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error) { + if fcb.err != nil { + return nil, fcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(fcb.builders)) + nodes := make([]*File, len(fcb.builders)) + mutators := make([]Mutator, len(fcb.builders)) + for i := range fcb.builders { + func(i int, root context.Context) { + builder := fcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*FileMutation) + 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, fcb.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, fcb.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, fcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File { + v, err := fcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fcb *FileCreateBulk) Exec(ctx context.Context) error { + _, err := fcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fcb *FileCreateBulk) ExecX(ctx context.Context) { + if err := fcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/file_delete.go b/internal/ent/generated/file_delete.go new file mode 100644 index 0000000..a96d36c --- /dev/null +++ b/internal/ent/generated/file_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FileDelete is the builder for deleting a File entity. +type FileDelete struct { + config + hooks []Hook + mutation *FileMutation +} + +// Where appends a list predicates to the FileDelete builder. +func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete { + fd.mutation.Where(ps...) + return fd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (fd *FileDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, fd.sqlExec, fd.mutation, fd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (fd *FileDelete) ExecX(ctx context.Context) int { + n, err := fd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (fd *FileDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(file.Table, sqlgraph.NewFieldSpec(file.FieldID, field.TypeString)) + _spec.Node.Schema = fd.schemaConfig.File + ctx = internal.NewSchemaConfigContext(ctx, fd.schemaConfig) + if ps := fd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, fd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + fd.mutation.done = true + return affected, err +} + +// FileDeleteOne is the builder for deleting a single File entity. +type FileDeleteOne struct { + fd *FileDelete +} + +// Where appends a list predicates to the FileDelete builder. +func (fdo *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne { + fdo.fd.mutation.Where(ps...) + return fdo +} + +// Exec executes the deletion query. +func (fdo *FileDeleteOne) Exec(ctx context.Context) error { + n, err := fdo.fd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{file.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (fdo *FileDeleteOne) ExecX(ctx context.Context) { + if err := fdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/file_query.go b/internal/ent/generated/file_query.go new file mode 100644 index 0000000..cff92ff --- /dev/null +++ b/internal/ent/generated/file_query.go @@ -0,0 +1,1033 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FileQuery is the builder for querying File entities. +type FileQuery struct { + config + ctx *QueryContext + order []file.OrderOption + inters []Interceptor + predicates []predicate.File + withUser *UserQuery + withOrganization *OrganizationQuery + withEntity *EntityQuery + withGroup *GroupQuery + withFKs bool + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*File) error + withNamedOrganization map[string]*OrganizationQuery + withNamedEntity map[string]*EntityQuery + withNamedGroup map[string]*GroupQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the FileQuery builder. +func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery { + fq.predicates = append(fq.predicates, ps...) + return fq +} + +// Limit the number of records to be returned by this query. +func (fq *FileQuery) Limit(limit int) *FileQuery { + fq.ctx.Limit = &limit + return fq +} + +// Offset to start from. +func (fq *FileQuery) Offset(offset int) *FileQuery { + fq.ctx.Offset = &offset + return fq +} + +// 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 (fq *FileQuery) Unique(unique bool) *FileQuery { + fq.ctx.Unique = &unique + return fq +} + +// Order specifies how the records should be ordered. +func (fq *FileQuery) Order(o ...file.OrderOption) *FileQuery { + fq.order = append(fq.order, o...) + return fq +} + +// QueryUser chains the current query on the "user" edge. +func (fq *FileQuery) QueryUser() *UserQuery { + query := (&UserClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, file.UserTable, file.UserColumn), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.File + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrganization chains the current query on the "organization" edge. +func (fq *FileQuery) QueryOrganization() *OrganizationQuery { + query := (&OrganizationClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, file.OrganizationTable, file.OrganizationPrimaryKey...), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationFiles + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntity chains the current query on the "entity" edge. +func (fq *FileQuery) QueryEntity() *EntityQuery { + query := (&EntityClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, selector), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, file.EntityTable, file.EntityPrimaryKey...), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.EntityFiles + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryGroup chains the current query on the "group" edge. +func (fq *FileQuery) QueryGroup() *GroupQuery { + query := (&GroupClient{config: fq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := fq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(file.Table, file.FieldID, selector), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, file.GroupTable, file.GroupPrimaryKey...), + ) + schemaConfig := fq.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupFiles + fromU = sqlgraph.SetNeighbors(fq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first File entity from the query. +// Returns a *NotFoundError when no File was found. +func (fq *FileQuery) First(ctx context.Context) (*File, error) { + nodes, err := fq.Limit(1).All(setContextOp(ctx, fq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{file.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (fq *FileQuery) FirstX(ctx context.Context) *File { + node, err := fq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first File ID from the query. +// Returns a *NotFoundError when no File ID was found. +func (fq *FileQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fq.Limit(1).IDs(setContextOp(ctx, fq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{file.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (fq *FileQuery) FirstIDX(ctx context.Context) string { + id, err := fq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single File entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one File entity is found. +// Returns a *NotFoundError when no File entities are found. +func (fq *FileQuery) Only(ctx context.Context) (*File, error) { + nodes, err := fq.Limit(2).All(setContextOp(ctx, fq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{file.Label} + default: + return nil, &NotSingularError{file.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (fq *FileQuery) OnlyX(ctx context.Context) *File { + node, err := fq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only File ID in the query. +// Returns a *NotSingularError when more than one File ID is found. +// Returns a *NotFoundError when no entities are found. +func (fq *FileQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fq.Limit(2).IDs(setContextOp(ctx, fq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{file.Label} + default: + err = &NotSingularError{file.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (fq *FileQuery) OnlyIDX(ctx context.Context) string { + id, err := fq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Files. +func (fq *FileQuery) All(ctx context.Context) ([]*File, error) { + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryAll) + if err := fq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*File, *FileQuery]() + return withInterceptors[[]*File](ctx, fq, qr, fq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (fq *FileQuery) AllX(ctx context.Context) []*File { + nodes, err := fq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of File IDs. +func (fq *FileQuery) IDs(ctx context.Context) (ids []string, err error) { + if fq.ctx.Unique == nil && fq.path != nil { + fq.Unique(true) + } + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryIDs) + if err = fq.Select(file.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (fq *FileQuery) IDsX(ctx context.Context) []string { + ids, err := fq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (fq *FileQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryCount) + if err := fq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, fq, querierCount[*FileQuery](), fq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (fq *FileQuery) CountX(ctx context.Context) int { + count, err := fq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (fq *FileQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, fq.ctx, ent.OpQueryExist) + switch _, err := fq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (fq *FileQuery) ExistX(ctx context.Context) bool { + exist, err := fq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the FileQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (fq *FileQuery) Clone() *FileQuery { + if fq == nil { + return nil + } + return &FileQuery{ + config: fq.config, + ctx: fq.ctx.Clone(), + order: append([]file.OrderOption{}, fq.order...), + inters: append([]Interceptor{}, fq.inters...), + predicates: append([]predicate.File{}, fq.predicates...), + withUser: fq.withUser.Clone(), + withOrganization: fq.withOrganization.Clone(), + withEntity: fq.withEntity.Clone(), + withGroup: fq.withGroup.Clone(), + // clone intermediate query. + sql: fq.sql.Clone(), + path: fq.path, + } +} + +// WithUser tells the query-builder to eager-load the nodes that are connected to +// the "user" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FileQuery) WithUser(opts ...func(*UserQuery)) *FileQuery { + query := (&UserClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withUser = query + return fq +} + +// WithOrganization tells the query-builder to eager-load the nodes that are connected to +// the "organization" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FileQuery) WithOrganization(opts ...func(*OrganizationQuery)) *FileQuery { + query := (&OrganizationClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withOrganization = query + return fq +} + +// WithEntity tells the query-builder to eager-load the nodes that are connected to +// the "entity" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FileQuery) WithEntity(opts ...func(*EntityQuery)) *FileQuery { + query := (&EntityClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withEntity = query + return fq +} + +// WithGroup tells the query-builder to eager-load the nodes that are connected to +// the "group" edge. The optional arguments are used to configure the query builder of the edge. +func (fq *FileQuery) WithGroup(opts ...func(*GroupQuery)) *FileQuery { + query := (&GroupClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + fq.withGroup = query + return fq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.File.Query(). +// GroupBy(file.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy { + fq.ctx.Fields = append([]string{field}, fields...) + grbuild := &FileGroupBy{build: fq} + grbuild.flds = &fq.ctx.Fields + grbuild.label = file.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.File.Query(). +// Select(file.FieldCreatedAt). +// Scan(ctx, &v) +func (fq *FileQuery) Select(fields ...string) *FileSelect { + fq.ctx.Fields = append(fq.ctx.Fields, fields...) + sbuild := &FileSelect{FileQuery: fq} + sbuild.label = file.Label + sbuild.flds, sbuild.scan = &fq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a FileSelect configured with the given aggregations. +func (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect { + return fq.Select().Aggregate(fns...) +} + +func (fq *FileQuery) prepareQuery(ctx context.Context) error { + for _, inter := range fq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, fq); err != nil { + return err + } + } + } + for _, f := range fq.ctx.Fields { + if !file.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if fq.path != nil { + prev, err := fq.path(ctx) + if err != nil { + return err + } + fq.sql = prev + } + return nil +} + +func (fq *FileQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*File, error) { + var ( + nodes = []*File{} + withFKs = fq.withFKs + _spec = fq.querySpec() + loadedTypes = [4]bool{ + fq.withUser != nil, + fq.withOrganization != nil, + fq.withEntity != nil, + fq.withGroup != nil, + } + ) + if fq.withUser != nil { + withFKs = true + } + if withFKs { + _spec.Node.Columns = append(_spec.Node.Columns, file.ForeignKeys...) + } + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*File).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &File{config: fq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = fq.schemaConfig.File + ctx = internal.NewSchemaConfigContext(ctx, fq.schemaConfig) + if len(fq.modifiers) > 0 { + _spec.Modifiers = fq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, fq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := fq.withUser; query != nil { + if err := fq.loadUser(ctx, query, nodes, nil, + func(n *File, e *User) { n.Edges.User = e }); err != nil { + return nil, err + } + } + if query := fq.withOrganization; query != nil { + if err := fq.loadOrganization(ctx, query, nodes, + func(n *File) { n.Edges.Organization = []*Organization{} }, + func(n *File, e *Organization) { n.Edges.Organization = append(n.Edges.Organization, e) }); err != nil { + return nil, err + } + } + if query := fq.withEntity; query != nil { + if err := fq.loadEntity(ctx, query, nodes, + func(n *File) { n.Edges.Entity = []*Entity{} }, + func(n *File, e *Entity) { n.Edges.Entity = append(n.Edges.Entity, e) }); err != nil { + return nil, err + } + } + if query := fq.withGroup; query != nil { + if err := fq.loadGroup(ctx, query, nodes, + func(n *File) { n.Edges.Group = []*Group{} }, + func(n *File, e *Group) { n.Edges.Group = append(n.Edges.Group, e) }); err != nil { + return nil, err + } + } + for name, query := range fq.withNamedOrganization { + if err := fq.loadOrganization(ctx, query, nodes, + func(n *File) { n.appendNamedOrganization(name) }, + func(n *File, e *Organization) { n.appendNamedOrganization(name, e) }); err != nil { + return nil, err + } + } + for name, query := range fq.withNamedEntity { + if err := fq.loadEntity(ctx, query, nodes, + func(n *File) { n.appendNamedEntity(name) }, + func(n *File, e *Entity) { n.appendNamedEntity(name, e) }); err != nil { + return nil, err + } + } + for name, query := range fq.withNamedGroup { + if err := fq.loadGroup(ctx, query, nodes, + func(n *File) { n.appendNamedGroup(name) }, + func(n *File, e *Group) { n.appendNamedGroup(name, e) }); err != nil { + return nil, err + } + } + for i := range fq.loadTotal { + if err := fq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (fq *FileQuery) loadUser(ctx context.Context, query *UserQuery, nodes []*File, init func(*File), assign func(*File, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*File) + for i := range nodes { + if nodes[i].user_files == nil { + continue + } + fk := *nodes[i].user_files + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "user_files" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (fq *FileQuery) loadOrganization(ctx context.Context, query *OrganizationQuery, nodes []*File, init func(*File), assign func(*File, *Organization)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*File) + nids := make(map[string]map[*File]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(file.OrganizationTable) + joinT.Schema(fq.schemaConfig.OrganizationFiles) + s.Join(joinT).On(s.C(organization.FieldID), joinT.C(file.OrganizationPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(file.OrganizationPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(file.OrganizationPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*File]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Organization](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "organization" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (fq *FileQuery) loadEntity(ctx context.Context, query *EntityQuery, nodes []*File, init func(*File), assign func(*File, *Entity)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*File) + nids := make(map[string]map[*File]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(file.EntityTable) + joinT.Schema(fq.schemaConfig.EntityFiles) + s.Join(joinT).On(s.C(entity.FieldID), joinT.C(file.EntityPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(file.EntityPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(file.EntityPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*File]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Entity](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "entity" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (fq *FileQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []*File, init func(*File), assign func(*File, *Group)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*File) + nids := make(map[string]map[*File]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(file.GroupTable) + joinT.Schema(fq.schemaConfig.GroupFiles) + s.Join(joinT).On(s.C(group.FieldID), joinT.C(file.GroupPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(file.GroupPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(file.GroupPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*File]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Group](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "group" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (fq *FileQuery) sqlCount(ctx context.Context) (int, error) { + _spec := fq.querySpec() + _spec.Node.Schema = fq.schemaConfig.File + ctx = internal.NewSchemaConfigContext(ctx, fq.schemaConfig) + if len(fq.modifiers) > 0 { + _spec.Modifiers = fq.modifiers + } + _spec.Node.Columns = fq.ctx.Fields + if len(fq.ctx.Fields) > 0 { + _spec.Unique = fq.ctx.Unique != nil && *fq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, fq.driver, _spec) +} + +func (fq *FileQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(file.Table, file.Columns, sqlgraph.NewFieldSpec(file.FieldID, field.TypeString)) + _spec.From = fq.sql + if unique := fq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if fq.path != nil { + _spec.Unique = true + } + if fields := fq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, file.FieldID) + for i := range fields { + if fields[i] != file.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := fq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := fq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := fq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := fq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (fq *FileQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(fq.driver.Dialect()) + t1 := builder.Table(file.Table) + columns := fq.ctx.Fields + if len(columns) == 0 { + columns = file.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if fq.sql != nil { + selector = fq.sql + selector.Select(selector.Columns(columns...)...) + } + if fq.ctx.Unique != nil && *fq.ctx.Unique { + selector.Distinct() + } + t1.Schema(fq.schemaConfig.File) + ctx = internal.NewSchemaConfigContext(ctx, fq.schemaConfig) + selector.WithContext(ctx) + for _, p := range fq.predicates { + p(selector) + } + for _, p := range fq.order { + p(selector) + } + if offset := fq.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 := fq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedOrganization tells the query-builder to eager-load the nodes that are connected to the "organization" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (fq *FileQuery) WithNamedOrganization(name string, opts ...func(*OrganizationQuery)) *FileQuery { + query := (&OrganizationClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + if fq.withNamedOrganization == nil { + fq.withNamedOrganization = make(map[string]*OrganizationQuery) + } + fq.withNamedOrganization[name] = query + return fq +} + +// WithNamedEntity tells the query-builder to eager-load the nodes that are connected to the "entity" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (fq *FileQuery) WithNamedEntity(name string, opts ...func(*EntityQuery)) *FileQuery { + query := (&EntityClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + if fq.withNamedEntity == nil { + fq.withNamedEntity = make(map[string]*EntityQuery) + } + fq.withNamedEntity[name] = query + return fq +} + +// WithNamedGroup tells the query-builder to eager-load the nodes that are connected to the "group" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (fq *FileQuery) WithNamedGroup(name string, opts ...func(*GroupQuery)) *FileQuery { + query := (&GroupClient{config: fq.config}).Query() + for _, opt := range opts { + opt(query) + } + if fq.withNamedGroup == nil { + fq.withNamedGroup = make(map[string]*GroupQuery) + } + fq.withNamedGroup[name] = query + return fq +} + +// FileGroupBy is the group-by builder for File entities. +type FileGroupBy struct { + selector + build *FileQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy { + fgb.fns = append(fgb.fns, fns...) + return fgb +} + +// Scan applies the selector query and scans the result into the given value. +func (fgb *FileGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fgb.build.ctx, ent.OpQueryGroupBy) + if err := fgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FileQuery, *FileGroupBy](ctx, fgb.build, fgb, fgb.build.inters, v) +} + +func (fgb *FileGroupBy) sqlScan(ctx context.Context, root *FileQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(fgb.fns)) + for _, fn := range fgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*fgb.flds)+len(fgb.fns)) + for _, f := range *fgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*fgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := fgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// FileSelect is the builder for selecting fields of File entities. +type FileSelect struct { + *FileQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (fs *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect { + fs.fns = append(fs.fns, fns...) + return fs +} + +// Scan applies the selector query and scans the result into the given value. +func (fs *FileSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fs.ctx, ent.OpQuerySelect) + if err := fs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FileQuery, *FileSelect](ctx, fs.FileQuery, fs, fs.inters, v) +} + +func (fs *FileSelect) sqlScan(ctx context.Context, root *FileQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(fs.fns)) + for _, fn := range fs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*fs.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 := fs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/file_update.go b/internal/ent/generated/file_update.go new file mode 100644 index 0000000..f786281 --- /dev/null +++ b/internal/ent/generated/file_update.go @@ -0,0 +1,1433 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FileUpdate is the builder for updating File entities. +type FileUpdate struct { + config + hooks []Hook + mutation *FileMutation +} + +// Where appends a list predicates to the FileUpdate builder. +func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate { + fu.mutation.Where(ps...) + return fu +} + +// SetUpdatedAt sets the "updated_at" field. +func (fu *FileUpdate) SetUpdatedAt(t time.Time) *FileUpdate { + fu.mutation.SetUpdatedAt(t) + return fu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fu *FileUpdate) ClearUpdatedAt() *FileUpdate { + fu.mutation.ClearUpdatedAt() + return fu +} + +// SetUpdatedBy sets the "updated_by" field. +func (fu *FileUpdate) SetUpdatedBy(s string) *FileUpdate { + fu.mutation.SetUpdatedBy(s) + return fu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fu *FileUpdate) SetNillableUpdatedBy(s *string) *FileUpdate { + if s != nil { + fu.SetUpdatedBy(*s) + } + return fu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fu *FileUpdate) ClearUpdatedBy() *FileUpdate { + fu.mutation.ClearUpdatedBy() + return fu +} + +// SetDeletedAt sets the "deleted_at" field. +func (fu *FileUpdate) SetDeletedAt(t time.Time) *FileUpdate { + fu.mutation.SetDeletedAt(t) + return fu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fu *FileUpdate) SetNillableDeletedAt(t *time.Time) *FileUpdate { + if t != nil { + fu.SetDeletedAt(*t) + } + return fu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fu *FileUpdate) ClearDeletedAt() *FileUpdate { + fu.mutation.ClearDeletedAt() + return fu +} + +// SetDeletedBy sets the "deleted_by" field. +func (fu *FileUpdate) SetDeletedBy(s string) *FileUpdate { + fu.mutation.SetDeletedBy(s) + return fu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fu *FileUpdate) SetNillableDeletedBy(s *string) *FileUpdate { + if s != nil { + fu.SetDeletedBy(*s) + } + return fu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fu *FileUpdate) ClearDeletedBy() *FileUpdate { + fu.mutation.ClearDeletedBy() + return fu +} + +// SetTags sets the "tags" field. +func (fu *FileUpdate) SetTags(s []string) *FileUpdate { + fu.mutation.SetTags(s) + return fu +} + +// AppendTags appends s to the "tags" field. +func (fu *FileUpdate) AppendTags(s []string) *FileUpdate { + fu.mutation.AppendTags(s) + return fu +} + +// ClearTags clears the value of the "tags" field. +func (fu *FileUpdate) ClearTags() *FileUpdate { + fu.mutation.ClearTags() + return fu +} + +// SetFileName sets the "file_name" field. +func (fu *FileUpdate) SetFileName(s string) *FileUpdate { + fu.mutation.SetFileName(s) + return fu +} + +// SetNillableFileName sets the "file_name" field if the given value is not nil. +func (fu *FileUpdate) SetNillableFileName(s *string) *FileUpdate { + if s != nil { + fu.SetFileName(*s) + } + return fu +} + +// SetFileExtension sets the "file_extension" field. +func (fu *FileUpdate) SetFileExtension(s string) *FileUpdate { + fu.mutation.SetFileExtension(s) + return fu +} + +// SetNillableFileExtension sets the "file_extension" field if the given value is not nil. +func (fu *FileUpdate) SetNillableFileExtension(s *string) *FileUpdate { + if s != nil { + fu.SetFileExtension(*s) + } + return fu +} + +// SetFileSize sets the "file_size" field. +func (fu *FileUpdate) SetFileSize(i int) *FileUpdate { + fu.mutation.ResetFileSize() + fu.mutation.SetFileSize(i) + return fu +} + +// SetNillableFileSize sets the "file_size" field if the given value is not nil. +func (fu *FileUpdate) SetNillableFileSize(i *int) *FileUpdate { + if i != nil { + fu.SetFileSize(*i) + } + return fu +} + +// AddFileSize adds i to the "file_size" field. +func (fu *FileUpdate) AddFileSize(i int) *FileUpdate { + fu.mutation.AddFileSize(i) + return fu +} + +// ClearFileSize clears the value of the "file_size" field. +func (fu *FileUpdate) ClearFileSize() *FileUpdate { + fu.mutation.ClearFileSize() + return fu +} + +// SetContentType sets the "content_type" field. +func (fu *FileUpdate) SetContentType(s string) *FileUpdate { + fu.mutation.SetContentType(s) + return fu +} + +// SetNillableContentType sets the "content_type" field if the given value is not nil. +func (fu *FileUpdate) SetNillableContentType(s *string) *FileUpdate { + if s != nil { + fu.SetContentType(*s) + } + return fu +} + +// SetStoreKey sets the "store_key" field. +func (fu *FileUpdate) SetStoreKey(s string) *FileUpdate { + fu.mutation.SetStoreKey(s) + return fu +} + +// SetNillableStoreKey sets the "store_key" field if the given value is not nil. +func (fu *FileUpdate) SetNillableStoreKey(s *string) *FileUpdate { + if s != nil { + fu.SetStoreKey(*s) + } + return fu +} + +// SetCategory sets the "category" field. +func (fu *FileUpdate) SetCategory(s string) *FileUpdate { + fu.mutation.SetCategory(s) + return fu +} + +// SetNillableCategory sets the "category" field if the given value is not nil. +func (fu *FileUpdate) SetNillableCategory(s *string) *FileUpdate { + if s != nil { + fu.SetCategory(*s) + } + return fu +} + +// ClearCategory clears the value of the "category" field. +func (fu *FileUpdate) ClearCategory() *FileUpdate { + fu.mutation.ClearCategory() + return fu +} + +// SetAnnotation sets the "annotation" field. +func (fu *FileUpdate) SetAnnotation(s string) *FileUpdate { + fu.mutation.SetAnnotation(s) + return fu +} + +// SetNillableAnnotation sets the "annotation" field if the given value is not nil. +func (fu *FileUpdate) SetNillableAnnotation(s *string) *FileUpdate { + if s != nil { + fu.SetAnnotation(*s) + } + return fu +} + +// ClearAnnotation clears the value of the "annotation" field. +func (fu *FileUpdate) ClearAnnotation() *FileUpdate { + fu.mutation.ClearAnnotation() + return fu +} + +// SetUserID sets the "user" edge to the User entity by ID. +func (fu *FileUpdate) SetUserID(id string) *FileUpdate { + fu.mutation.SetUserID(id) + return fu +} + +// SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil. +func (fu *FileUpdate) SetNillableUserID(id *string) *FileUpdate { + if id != nil { + fu = fu.SetUserID(*id) + } + return fu +} + +// SetUser sets the "user" edge to the User entity. +func (fu *FileUpdate) SetUser(u *User) *FileUpdate { + return fu.SetUserID(u.ID) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (fu *FileUpdate) AddOrganizationIDs(ids ...string) *FileUpdate { + fu.mutation.AddOrganizationIDs(ids...) + return fu +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (fu *FileUpdate) AddOrganization(o ...*Organization) *FileUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return fu.AddOrganizationIDs(ids...) +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by IDs. +func (fu *FileUpdate) AddEntityIDs(ids ...string) *FileUpdate { + fu.mutation.AddEntityIDs(ids...) + return fu +} + +// AddEntity adds the "entity" edges to the Entity entity. +func (fu *FileUpdate) AddEntity(e ...*Entity) *FileUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.AddEntityIDs(ids...) +} + +// AddGroupIDs adds the "group" edge to the Group entity by IDs. +func (fu *FileUpdate) AddGroupIDs(ids ...string) *FileUpdate { + fu.mutation.AddGroupIDs(ids...) + return fu +} + +// AddGroup adds the "group" edges to the Group entity. +func (fu *FileUpdate) AddGroup(g ...*Group) *FileUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return fu.AddGroupIDs(ids...) +} + +// Mutation returns the FileMutation object of the builder. +func (fu *FileUpdate) Mutation() *FileMutation { + return fu.mutation +} + +// ClearUser clears the "user" edge to the User entity. +func (fu *FileUpdate) ClearUser() *FileUpdate { + fu.mutation.ClearUser() + return fu +} + +// ClearOrganization clears all "organization" edges to the Organization entity. +func (fu *FileUpdate) ClearOrganization() *FileUpdate { + fu.mutation.ClearOrganization() + return fu +} + +// RemoveOrganizationIDs removes the "organization" edge to Organization entities by IDs. +func (fu *FileUpdate) RemoveOrganizationIDs(ids ...string) *FileUpdate { + fu.mutation.RemoveOrganizationIDs(ids...) + return fu +} + +// RemoveOrganization removes "organization" edges to Organization entities. +func (fu *FileUpdate) RemoveOrganization(o ...*Organization) *FileUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return fu.RemoveOrganizationIDs(ids...) +} + +// ClearEntity clears all "entity" edges to the Entity entity. +func (fu *FileUpdate) ClearEntity() *FileUpdate { + fu.mutation.ClearEntity() + return fu +} + +// RemoveEntityIDs removes the "entity" edge to Entity entities by IDs. +func (fu *FileUpdate) RemoveEntityIDs(ids ...string) *FileUpdate { + fu.mutation.RemoveEntityIDs(ids...) + return fu +} + +// RemoveEntity removes "entity" edges to Entity entities. +func (fu *FileUpdate) RemoveEntity(e ...*Entity) *FileUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fu.RemoveEntityIDs(ids...) +} + +// ClearGroup clears all "group" edges to the Group entity. +func (fu *FileUpdate) ClearGroup() *FileUpdate { + fu.mutation.ClearGroup() + return fu +} + +// RemoveGroupIDs removes the "group" edge to Group entities by IDs. +func (fu *FileUpdate) RemoveGroupIDs(ids ...string) *FileUpdate { + fu.mutation.RemoveGroupIDs(ids...) + return fu +} + +// RemoveGroup removes "group" edges to Group entities. +func (fu *FileUpdate) RemoveGroup(g ...*Group) *FileUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return fu.RemoveGroupIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (fu *FileUpdate) Save(ctx context.Context) (int, error) { + if err := fu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, fu.sqlSave, fu.mutation, fu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fu *FileUpdate) SaveX(ctx context.Context) int { + affected, err := fu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (fu *FileUpdate) Exec(ctx context.Context) error { + _, err := fu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fu *FileUpdate) ExecX(ctx context.Context) { + if err := fu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fu *FileUpdate) defaults() error { + if _, ok := fu.mutation.UpdatedAt(); !ok && !fu.mutation.UpdatedAtCleared() { + if file.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized file.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := file.UpdateDefaultUpdatedAt() + fu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (fu *FileUpdate) check() error { + if v, ok := fu.mutation.FileSize(); ok { + if err := file.FileSizeValidator(v); err != nil { + return &ValidationError{Name: "file_size", err: fmt.Errorf(`generated: validator failed for field "File.file_size": %w`, err)} + } + } + return nil +} + +func (fu *FileUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := fu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(file.Table, file.Columns, sqlgraph.NewFieldSpec(file.FieldID, field.TypeString)) + if ps := fu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fu.mutation.CreatedAtCleared() { + _spec.ClearField(file.FieldCreatedAt, field.TypeTime) + } + if value, ok := fu.mutation.UpdatedAt(); ok { + _spec.SetField(file.FieldUpdatedAt, field.TypeTime, value) + } + if fu.mutation.UpdatedAtCleared() { + _spec.ClearField(file.FieldUpdatedAt, field.TypeTime) + } + if fu.mutation.CreatedByCleared() { + _spec.ClearField(file.FieldCreatedBy, field.TypeString) + } + if value, ok := fu.mutation.UpdatedBy(); ok { + _spec.SetField(file.FieldUpdatedBy, field.TypeString, value) + } + if fu.mutation.UpdatedByCleared() { + _spec.ClearField(file.FieldUpdatedBy, field.TypeString) + } + if value, ok := fu.mutation.DeletedAt(); ok { + _spec.SetField(file.FieldDeletedAt, field.TypeTime, value) + } + if fu.mutation.DeletedAtCleared() { + _spec.ClearField(file.FieldDeletedAt, field.TypeTime) + } + if value, ok := fu.mutation.DeletedBy(); ok { + _spec.SetField(file.FieldDeletedBy, field.TypeString, value) + } + if fu.mutation.DeletedByCleared() { + _spec.ClearField(file.FieldDeletedBy, field.TypeString) + } + if value, ok := fu.mutation.Tags(); ok { + _spec.SetField(file.FieldTags, field.TypeJSON, value) + } + if value, ok := fu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, file.FieldTags, value) + }) + } + if fu.mutation.TagsCleared() { + _spec.ClearField(file.FieldTags, field.TypeJSON) + } + if value, ok := fu.mutation.FileName(); ok { + _spec.SetField(file.FieldFileName, field.TypeString, value) + } + if value, ok := fu.mutation.FileExtension(); ok { + _spec.SetField(file.FieldFileExtension, field.TypeString, value) + } + if value, ok := fu.mutation.FileSize(); ok { + _spec.SetField(file.FieldFileSize, field.TypeInt, value) + } + if value, ok := fu.mutation.AddedFileSize(); ok { + _spec.AddField(file.FieldFileSize, field.TypeInt, value) + } + if fu.mutation.FileSizeCleared() { + _spec.ClearField(file.FieldFileSize, field.TypeInt) + } + if value, ok := fu.mutation.ContentType(); ok { + _spec.SetField(file.FieldContentType, field.TypeString, value) + } + if value, ok := fu.mutation.StoreKey(); ok { + _spec.SetField(file.FieldStoreKey, field.TypeString, value) + } + if value, ok := fu.mutation.Category(); ok { + _spec.SetField(file.FieldCategory, field.TypeString, value) + } + if fu.mutation.CategoryCleared() { + _spec.ClearField(file.FieldCategory, field.TypeString) + } + if value, ok := fu.mutation.Annotation(); ok { + _spec.SetField(file.FieldAnnotation, field.TypeString, value) + } + if fu.mutation.AnnotationCleared() { + _spec.ClearField(file.FieldAnnotation, field.TypeString) + } + if fu.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: file.UserTable, + Columns: []string{file.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.File + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: file.UserTable, + Columns: []string{file.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fu.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.OrganizationFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.RemovedOrganizationIDs(); len(nodes) > 0 && !fu.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fu.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntityFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.RemovedEntityIDs(); len(nodes) > 0 && !fu.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fu.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.GroupFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.RemovedGroupIDs(); len(nodes) > 0 && !fu.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fu.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = fu.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = fu.schemaConfig.File + ctx = internal.NewSchemaConfigContext(ctx, fu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, fu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{file.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + fu.mutation.done = true + return n, nil +} + +// FileUpdateOne is the builder for updating a single File entity. +type FileUpdateOne struct { + config + fields []string + hooks []Hook + mutation *FileMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (fuo *FileUpdateOne) SetUpdatedAt(t time.Time) *FileUpdateOne { + fuo.mutation.SetUpdatedAt(t) + return fuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fuo *FileUpdateOne) ClearUpdatedAt() *FileUpdateOne { + fuo.mutation.ClearUpdatedAt() + return fuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (fuo *FileUpdateOne) SetUpdatedBy(s string) *FileUpdateOne { + fuo.mutation.SetUpdatedBy(s) + return fuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableUpdatedBy(s *string) *FileUpdateOne { + if s != nil { + fuo.SetUpdatedBy(*s) + } + return fuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fuo *FileUpdateOne) ClearUpdatedBy() *FileUpdateOne { + fuo.mutation.ClearUpdatedBy() + return fuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (fuo *FileUpdateOne) SetDeletedAt(t time.Time) *FileUpdateOne { + fuo.mutation.SetDeletedAt(t) + return fuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableDeletedAt(t *time.Time) *FileUpdateOne { + if t != nil { + fuo.SetDeletedAt(*t) + } + return fuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fuo *FileUpdateOne) ClearDeletedAt() *FileUpdateOne { + fuo.mutation.ClearDeletedAt() + return fuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (fuo *FileUpdateOne) SetDeletedBy(s string) *FileUpdateOne { + fuo.mutation.SetDeletedBy(s) + return fuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableDeletedBy(s *string) *FileUpdateOne { + if s != nil { + fuo.SetDeletedBy(*s) + } + return fuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fuo *FileUpdateOne) ClearDeletedBy() *FileUpdateOne { + fuo.mutation.ClearDeletedBy() + return fuo +} + +// SetTags sets the "tags" field. +func (fuo *FileUpdateOne) SetTags(s []string) *FileUpdateOne { + fuo.mutation.SetTags(s) + return fuo +} + +// AppendTags appends s to the "tags" field. +func (fuo *FileUpdateOne) AppendTags(s []string) *FileUpdateOne { + fuo.mutation.AppendTags(s) + return fuo +} + +// ClearTags clears the value of the "tags" field. +func (fuo *FileUpdateOne) ClearTags() *FileUpdateOne { + fuo.mutation.ClearTags() + return fuo +} + +// SetFileName sets the "file_name" field. +func (fuo *FileUpdateOne) SetFileName(s string) *FileUpdateOne { + fuo.mutation.SetFileName(s) + return fuo +} + +// SetNillableFileName sets the "file_name" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableFileName(s *string) *FileUpdateOne { + if s != nil { + fuo.SetFileName(*s) + } + return fuo +} + +// SetFileExtension sets the "file_extension" field. +func (fuo *FileUpdateOne) SetFileExtension(s string) *FileUpdateOne { + fuo.mutation.SetFileExtension(s) + return fuo +} + +// SetNillableFileExtension sets the "file_extension" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableFileExtension(s *string) *FileUpdateOne { + if s != nil { + fuo.SetFileExtension(*s) + } + return fuo +} + +// SetFileSize sets the "file_size" field. +func (fuo *FileUpdateOne) SetFileSize(i int) *FileUpdateOne { + fuo.mutation.ResetFileSize() + fuo.mutation.SetFileSize(i) + return fuo +} + +// SetNillableFileSize sets the "file_size" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableFileSize(i *int) *FileUpdateOne { + if i != nil { + fuo.SetFileSize(*i) + } + return fuo +} + +// AddFileSize adds i to the "file_size" field. +func (fuo *FileUpdateOne) AddFileSize(i int) *FileUpdateOne { + fuo.mutation.AddFileSize(i) + return fuo +} + +// ClearFileSize clears the value of the "file_size" field. +func (fuo *FileUpdateOne) ClearFileSize() *FileUpdateOne { + fuo.mutation.ClearFileSize() + return fuo +} + +// SetContentType sets the "content_type" field. +func (fuo *FileUpdateOne) SetContentType(s string) *FileUpdateOne { + fuo.mutation.SetContentType(s) + return fuo +} + +// SetNillableContentType sets the "content_type" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableContentType(s *string) *FileUpdateOne { + if s != nil { + fuo.SetContentType(*s) + } + return fuo +} + +// SetStoreKey sets the "store_key" field. +func (fuo *FileUpdateOne) SetStoreKey(s string) *FileUpdateOne { + fuo.mutation.SetStoreKey(s) + return fuo +} + +// SetNillableStoreKey sets the "store_key" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableStoreKey(s *string) *FileUpdateOne { + if s != nil { + fuo.SetStoreKey(*s) + } + return fuo +} + +// SetCategory sets the "category" field. +func (fuo *FileUpdateOne) SetCategory(s string) *FileUpdateOne { + fuo.mutation.SetCategory(s) + return fuo +} + +// SetNillableCategory sets the "category" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableCategory(s *string) *FileUpdateOne { + if s != nil { + fuo.SetCategory(*s) + } + return fuo +} + +// ClearCategory clears the value of the "category" field. +func (fuo *FileUpdateOne) ClearCategory() *FileUpdateOne { + fuo.mutation.ClearCategory() + return fuo +} + +// SetAnnotation sets the "annotation" field. +func (fuo *FileUpdateOne) SetAnnotation(s string) *FileUpdateOne { + fuo.mutation.SetAnnotation(s) + return fuo +} + +// SetNillableAnnotation sets the "annotation" field if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableAnnotation(s *string) *FileUpdateOne { + if s != nil { + fuo.SetAnnotation(*s) + } + return fuo +} + +// ClearAnnotation clears the value of the "annotation" field. +func (fuo *FileUpdateOne) ClearAnnotation() *FileUpdateOne { + fuo.mutation.ClearAnnotation() + return fuo +} + +// SetUserID sets the "user" edge to the User entity by ID. +func (fuo *FileUpdateOne) SetUserID(id string) *FileUpdateOne { + fuo.mutation.SetUserID(id) + return fuo +} + +// SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil. +func (fuo *FileUpdateOne) SetNillableUserID(id *string) *FileUpdateOne { + if id != nil { + fuo = fuo.SetUserID(*id) + } + return fuo +} + +// SetUser sets the "user" edge to the User entity. +func (fuo *FileUpdateOne) SetUser(u *User) *FileUpdateOne { + return fuo.SetUserID(u.ID) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (fuo *FileUpdateOne) AddOrganizationIDs(ids ...string) *FileUpdateOne { + fuo.mutation.AddOrganizationIDs(ids...) + return fuo +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (fuo *FileUpdateOne) AddOrganization(o ...*Organization) *FileUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return fuo.AddOrganizationIDs(ids...) +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by IDs. +func (fuo *FileUpdateOne) AddEntityIDs(ids ...string) *FileUpdateOne { + fuo.mutation.AddEntityIDs(ids...) + return fuo +} + +// AddEntity adds the "entity" edges to the Entity entity. +func (fuo *FileUpdateOne) AddEntity(e ...*Entity) *FileUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.AddEntityIDs(ids...) +} + +// AddGroupIDs adds the "group" edge to the Group entity by IDs. +func (fuo *FileUpdateOne) AddGroupIDs(ids ...string) *FileUpdateOne { + fuo.mutation.AddGroupIDs(ids...) + return fuo +} + +// AddGroup adds the "group" edges to the Group entity. +func (fuo *FileUpdateOne) AddGroup(g ...*Group) *FileUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return fuo.AddGroupIDs(ids...) +} + +// Mutation returns the FileMutation object of the builder. +func (fuo *FileUpdateOne) Mutation() *FileMutation { + return fuo.mutation +} + +// ClearUser clears the "user" edge to the User entity. +func (fuo *FileUpdateOne) ClearUser() *FileUpdateOne { + fuo.mutation.ClearUser() + return fuo +} + +// ClearOrganization clears all "organization" edges to the Organization entity. +func (fuo *FileUpdateOne) ClearOrganization() *FileUpdateOne { + fuo.mutation.ClearOrganization() + return fuo +} + +// RemoveOrganizationIDs removes the "organization" edge to Organization entities by IDs. +func (fuo *FileUpdateOne) RemoveOrganizationIDs(ids ...string) *FileUpdateOne { + fuo.mutation.RemoveOrganizationIDs(ids...) + return fuo +} + +// RemoveOrganization removes "organization" edges to Organization entities. +func (fuo *FileUpdateOne) RemoveOrganization(o ...*Organization) *FileUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return fuo.RemoveOrganizationIDs(ids...) +} + +// ClearEntity clears all "entity" edges to the Entity entity. +func (fuo *FileUpdateOne) ClearEntity() *FileUpdateOne { + fuo.mutation.ClearEntity() + return fuo +} + +// RemoveEntityIDs removes the "entity" edge to Entity entities by IDs. +func (fuo *FileUpdateOne) RemoveEntityIDs(ids ...string) *FileUpdateOne { + fuo.mutation.RemoveEntityIDs(ids...) + return fuo +} + +// RemoveEntity removes "entity" edges to Entity entities. +func (fuo *FileUpdateOne) RemoveEntity(e ...*Entity) *FileUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return fuo.RemoveEntityIDs(ids...) +} + +// ClearGroup clears all "group" edges to the Group entity. +func (fuo *FileUpdateOne) ClearGroup() *FileUpdateOne { + fuo.mutation.ClearGroup() + return fuo +} + +// RemoveGroupIDs removes the "group" edge to Group entities by IDs. +func (fuo *FileUpdateOne) RemoveGroupIDs(ids ...string) *FileUpdateOne { + fuo.mutation.RemoveGroupIDs(ids...) + return fuo +} + +// RemoveGroup removes "group" edges to Group entities. +func (fuo *FileUpdateOne) RemoveGroup(g ...*Group) *FileUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return fuo.RemoveGroupIDs(ids...) +} + +// Where appends a list predicates to the FileUpdate builder. +func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne { + fuo.mutation.Where(ps...) + return fuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne { + fuo.fields = append([]string{field}, fields...) + return fuo +} + +// Save executes the query and returns the updated File entity. +func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error) { + if err := fuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, fuo.sqlSave, fuo.mutation, fuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File { + node, err := fuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (fuo *FileUpdateOne) Exec(ctx context.Context) error { + _, err := fuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fuo *FileUpdateOne) ExecX(ctx context.Context) { + if err := fuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fuo *FileUpdateOne) defaults() error { + if _, ok := fuo.mutation.UpdatedAt(); !ok && !fuo.mutation.UpdatedAtCleared() { + if file.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized file.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := file.UpdateDefaultUpdatedAt() + fuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (fuo *FileUpdateOne) check() error { + if v, ok := fuo.mutation.FileSize(); ok { + if err := file.FileSizeValidator(v); err != nil { + return &ValidationError{Name: "file_size", err: fmt.Errorf(`generated: validator failed for field "File.file_size": %w`, err)} + } + } + return nil +} + +func (fuo *FileUpdateOne) sqlSave(ctx context.Context) (_node *File, err error) { + if err := fuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(file.Table, file.Columns, sqlgraph.NewFieldSpec(file.FieldID, field.TypeString)) + id, ok := fuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "File.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := fuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, file.FieldID) + for _, f := range fields { + if !file.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != file.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := fuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fuo.mutation.CreatedAtCleared() { + _spec.ClearField(file.FieldCreatedAt, field.TypeTime) + } + if value, ok := fuo.mutation.UpdatedAt(); ok { + _spec.SetField(file.FieldUpdatedAt, field.TypeTime, value) + } + if fuo.mutation.UpdatedAtCleared() { + _spec.ClearField(file.FieldUpdatedAt, field.TypeTime) + } + if fuo.mutation.CreatedByCleared() { + _spec.ClearField(file.FieldCreatedBy, field.TypeString) + } + if value, ok := fuo.mutation.UpdatedBy(); ok { + _spec.SetField(file.FieldUpdatedBy, field.TypeString, value) + } + if fuo.mutation.UpdatedByCleared() { + _spec.ClearField(file.FieldUpdatedBy, field.TypeString) + } + if value, ok := fuo.mutation.DeletedAt(); ok { + _spec.SetField(file.FieldDeletedAt, field.TypeTime, value) + } + if fuo.mutation.DeletedAtCleared() { + _spec.ClearField(file.FieldDeletedAt, field.TypeTime) + } + if value, ok := fuo.mutation.DeletedBy(); ok { + _spec.SetField(file.FieldDeletedBy, field.TypeString, value) + } + if fuo.mutation.DeletedByCleared() { + _spec.ClearField(file.FieldDeletedBy, field.TypeString) + } + if value, ok := fuo.mutation.Tags(); ok { + _spec.SetField(file.FieldTags, field.TypeJSON, value) + } + if value, ok := fuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, file.FieldTags, value) + }) + } + if fuo.mutation.TagsCleared() { + _spec.ClearField(file.FieldTags, field.TypeJSON) + } + if value, ok := fuo.mutation.FileName(); ok { + _spec.SetField(file.FieldFileName, field.TypeString, value) + } + if value, ok := fuo.mutation.FileExtension(); ok { + _spec.SetField(file.FieldFileExtension, field.TypeString, value) + } + if value, ok := fuo.mutation.FileSize(); ok { + _spec.SetField(file.FieldFileSize, field.TypeInt, value) + } + if value, ok := fuo.mutation.AddedFileSize(); ok { + _spec.AddField(file.FieldFileSize, field.TypeInt, value) + } + if fuo.mutation.FileSizeCleared() { + _spec.ClearField(file.FieldFileSize, field.TypeInt) + } + if value, ok := fuo.mutation.ContentType(); ok { + _spec.SetField(file.FieldContentType, field.TypeString, value) + } + if value, ok := fuo.mutation.StoreKey(); ok { + _spec.SetField(file.FieldStoreKey, field.TypeString, value) + } + if value, ok := fuo.mutation.Category(); ok { + _spec.SetField(file.FieldCategory, field.TypeString, value) + } + if fuo.mutation.CategoryCleared() { + _spec.ClearField(file.FieldCategory, field.TypeString) + } + if value, ok := fuo.mutation.Annotation(); ok { + _spec.SetField(file.FieldAnnotation, field.TypeString, value) + } + if fuo.mutation.AnnotationCleared() { + _spec.ClearField(file.FieldAnnotation, field.TypeString) + } + if fuo.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: file.UserTable, + Columns: []string{file.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.File + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: file.UserTable, + Columns: []string{file.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fuo.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.OrganizationFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.RemovedOrganizationIDs(); len(nodes) > 0 && !fuo.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.OrganizationTable, + Columns: file.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fuo.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntityFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.RemovedEntityIDs(); len(nodes) > 0 && !fuo.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.EntityTable, + Columns: file.EntityPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.EntityFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if fuo.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.GroupFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.RemovedGroupIDs(); len(nodes) > 0 && !fuo.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := fuo.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: file.GroupTable, + Columns: file.GroupPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = fuo.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = fuo.schemaConfig.File + ctx = internal.NewSchemaConfigContext(ctx, fuo.schemaConfig) + _node = &File{config: fuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, fuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{file.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + fuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/filehistory.go b/internal/ent/generated/filehistory.go new file mode 100644 index 0000000..3acb5ba --- /dev/null +++ b/internal/ent/generated/filehistory.go @@ -0,0 +1,301 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/entx/history" +) + +// FileHistory is the model entity for the FileHistory schema. +type FileHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // FileName holds the value of the "file_name" field. + FileName string `json:"file_name,omitempty"` + // FileExtension holds the value of the "file_extension" field. + FileExtension string `json:"file_extension,omitempty"` + // FileSize holds the value of the "file_size" field. + FileSize int `json:"file_size,omitempty"` + // ContentType holds the value of the "content_type" field. + ContentType string `json:"content_type,omitempty"` + // StoreKey holds the value of the "store_key" field. + StoreKey string `json:"store_key,omitempty"` + // Category holds the value of the "category" field. + Category string `json:"category,omitempty"` + // Annotation holds the value of the "annotation" field. + Annotation string `json:"annotation,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*FileHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case filehistory.FieldTags: + values[i] = new([]byte) + case filehistory.FieldOperation: + values[i] = new(history.OpType) + case filehistory.FieldFileSize: + values[i] = new(sql.NullInt64) + case filehistory.FieldID, filehistory.FieldRef, filehistory.FieldCreatedBy, filehistory.FieldUpdatedBy, filehistory.FieldDeletedBy, filehistory.FieldMappingID, filehistory.FieldFileName, filehistory.FieldFileExtension, filehistory.FieldContentType, filehistory.FieldStoreKey, filehistory.FieldCategory, filehistory.FieldAnnotation: + values[i] = new(sql.NullString) + case filehistory.FieldHistoryTime, filehistory.FieldCreatedAt, filehistory.FieldUpdatedAt, filehistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the FileHistory fields. +func (fh *FileHistory) 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 filehistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + fh.ID = value.String + } + case filehistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + fh.HistoryTime = value.Time + } + case filehistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + fh.Ref = value.String + } + case filehistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + fh.Operation = *value + } + case filehistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + fh.CreatedAt = value.Time + } + case filehistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + fh.UpdatedAt = value.Time + } + case filehistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + fh.CreatedBy = value.String + } + case filehistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + fh.UpdatedBy = value.String + } + case filehistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + fh.DeletedAt = value.Time + } + case filehistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + fh.DeletedBy = value.String + } + case filehistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + fh.MappingID = value.String + } + case filehistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &fh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case filehistory.FieldFileName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field file_name", values[i]) + } else if value.Valid { + fh.FileName = value.String + } + case filehistory.FieldFileExtension: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field file_extension", values[i]) + } else if value.Valid { + fh.FileExtension = value.String + } + case filehistory.FieldFileSize: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field file_size", values[i]) + } else if value.Valid { + fh.FileSize = int(value.Int64) + } + case filehistory.FieldContentType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field content_type", values[i]) + } else if value.Valid { + fh.ContentType = value.String + } + case filehistory.FieldStoreKey: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field store_key", values[i]) + } else if value.Valid { + fh.StoreKey = value.String + } + case filehistory.FieldCategory: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field category", values[i]) + } else if value.Valid { + fh.Category = value.String + } + case filehistory.FieldAnnotation: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field annotation", values[i]) + } else if value.Valid { + fh.Annotation = value.String + } + default: + fh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the FileHistory. +// This includes values selected through modifiers, order, etc. +func (fh *FileHistory) Value(name string) (ent.Value, error) { + return fh.selectValues.Get(name) +} + +// Update returns a builder for updating this FileHistory. +// Note that you need to call FileHistory.Unwrap() before calling this method if this FileHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (fh *FileHistory) Update() *FileHistoryUpdateOne { + return NewFileHistoryClient(fh.config).UpdateOne(fh) +} + +// Unwrap unwraps the FileHistory 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 (fh *FileHistory) Unwrap() *FileHistory { + _tx, ok := fh.config.driver.(*txDriver) + if !ok { + panic("generated: FileHistory is not a transactional entity") + } + fh.config.driver = _tx.drv + return fh +} + +// String implements the fmt.Stringer. +func (fh *FileHistory) String() string { + var builder strings.Builder + builder.WriteString("FileHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", fh.ID)) + builder.WriteString("history_time=") + builder.WriteString(fh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(fh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", fh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(fh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(fh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(fh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(fh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(fh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(fh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(fh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", fh.Tags)) + builder.WriteString(", ") + builder.WriteString("file_name=") + builder.WriteString(fh.FileName) + builder.WriteString(", ") + builder.WriteString("file_extension=") + builder.WriteString(fh.FileExtension) + builder.WriteString(", ") + builder.WriteString("file_size=") + builder.WriteString(fmt.Sprintf("%v", fh.FileSize)) + builder.WriteString(", ") + builder.WriteString("content_type=") + builder.WriteString(fh.ContentType) + builder.WriteString(", ") + builder.WriteString("store_key=") + builder.WriteString(fh.StoreKey) + builder.WriteString(", ") + builder.WriteString("category=") + builder.WriteString(fh.Category) + builder.WriteString(", ") + builder.WriteString("annotation=") + builder.WriteString(fh.Annotation) + builder.WriteByte(')') + return builder.String() +} + +// FileHistories is a parsable slice of FileHistory. +type FileHistories []*FileHistory diff --git a/internal/ent/generated/filehistory/filehistory.go b/internal/ent/generated/filehistory/filehistory.go new file mode 100644 index 0000000..db86236 --- /dev/null +++ b/internal/ent/generated/filehistory/filehistory.go @@ -0,0 +1,217 @@ +// Code generated by ent, DO NOT EDIT. + +package filehistory + +import ( + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the filehistory type in the database. + Label = "file_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldFileName holds the string denoting the file_name field in the database. + FieldFileName = "file_name" + // FieldFileExtension holds the string denoting the file_extension field in the database. + FieldFileExtension = "file_extension" + // FieldFileSize holds the string denoting the file_size field in the database. + FieldFileSize = "file_size" + // FieldContentType holds the string denoting the content_type field in the database. + FieldContentType = "content_type" + // FieldStoreKey holds the string denoting the store_key field in the database. + FieldStoreKey = "store_key" + // FieldCategory holds the string denoting the category field in the database. + FieldCategory = "category" + // FieldAnnotation holds the string denoting the annotation field in the database. + FieldAnnotation = "annotation" + // Table holds the table name of the filehistory in the database. + Table = "file_history" +) + +// Columns holds all SQL columns for filehistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldFileName, + FieldFileExtension, + FieldFileSize, + FieldContentType, + FieldStoreKey, + FieldCategory, + FieldAnnotation, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("filehistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the FileHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByFileName orders the results by the file_name field. +func ByFileName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFileName, opts...).ToFunc() +} + +// ByFileExtension orders the results by the file_extension field. +func ByFileExtension(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFileExtension, opts...).ToFunc() +} + +// ByFileSize orders the results by the file_size field. +func ByFileSize(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFileSize, opts...).ToFunc() +} + +// ByContentType orders the results by the content_type field. +func ByContentType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldContentType, opts...).ToFunc() +} + +// ByStoreKey orders the results by the store_key field. +func ByStoreKey(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStoreKey, opts...).ToFunc() +} + +// ByCategory orders the results by the category field. +func ByCategory(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCategory, opts...).ToFunc() +} + +// ByAnnotation orders the results by the annotation field. +func ByAnnotation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAnnotation, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/filehistory/where.go b/internal/ent/generated/filehistory/where.go new file mode 100644 index 0000000..90c909a --- /dev/null +++ b/internal/ent/generated/filehistory/where.go @@ -0,0 +1,1206 @@ +// Code generated by ent, DO NOT EDIT. + +package filehistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// FileName applies equality check predicate on the "file_name" field. It's identical to FileNameEQ. +func FileName(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldFileName, v)) +} + +// FileExtension applies equality check predicate on the "file_extension" field. It's identical to FileExtensionEQ. +func FileExtension(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldFileExtension, v)) +} + +// FileSize applies equality check predicate on the "file_size" field. It's identical to FileSizeEQ. +func FileSize(v int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldFileSize, v)) +} + +// ContentType applies equality check predicate on the "content_type" field. It's identical to ContentTypeEQ. +func ContentType(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldContentType, v)) +} + +// StoreKey applies equality check predicate on the "store_key" field. It's identical to StoreKeyEQ. +func StoreKey(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldStoreKey, v)) +} + +// Category applies equality check predicate on the "category" field. It's identical to CategoryEQ. +func Category(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldCategory, v)) +} + +// Annotation applies equality check predicate on the "annotation" field. It's identical to AnnotationEQ. +func Annotation(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldAnnotation, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldTags)) +} + +// FileNameEQ applies the EQ predicate on the "file_name" field. +func FileNameEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldFileName, v)) +} + +// FileNameNEQ applies the NEQ predicate on the "file_name" field. +func FileNameNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldFileName, v)) +} + +// FileNameIn applies the In predicate on the "file_name" field. +func FileNameIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldFileName, vs...)) +} + +// FileNameNotIn applies the NotIn predicate on the "file_name" field. +func FileNameNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldFileName, vs...)) +} + +// FileNameGT applies the GT predicate on the "file_name" field. +func FileNameGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldFileName, v)) +} + +// FileNameGTE applies the GTE predicate on the "file_name" field. +func FileNameGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldFileName, v)) +} + +// FileNameLT applies the LT predicate on the "file_name" field. +func FileNameLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldFileName, v)) +} + +// FileNameLTE applies the LTE predicate on the "file_name" field. +func FileNameLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldFileName, v)) +} + +// FileNameContains applies the Contains predicate on the "file_name" field. +func FileNameContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldFileName, v)) +} + +// FileNameHasPrefix applies the HasPrefix predicate on the "file_name" field. +func FileNameHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldFileName, v)) +} + +// FileNameHasSuffix applies the HasSuffix predicate on the "file_name" field. +func FileNameHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldFileName, v)) +} + +// FileNameEqualFold applies the EqualFold predicate on the "file_name" field. +func FileNameEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldFileName, v)) +} + +// FileNameContainsFold applies the ContainsFold predicate on the "file_name" field. +func FileNameContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldFileName, v)) +} + +// FileExtensionEQ applies the EQ predicate on the "file_extension" field. +func FileExtensionEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldFileExtension, v)) +} + +// FileExtensionNEQ applies the NEQ predicate on the "file_extension" field. +func FileExtensionNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldFileExtension, v)) +} + +// FileExtensionIn applies the In predicate on the "file_extension" field. +func FileExtensionIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldFileExtension, vs...)) +} + +// FileExtensionNotIn applies the NotIn predicate on the "file_extension" field. +func FileExtensionNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldFileExtension, vs...)) +} + +// FileExtensionGT applies the GT predicate on the "file_extension" field. +func FileExtensionGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldFileExtension, v)) +} + +// FileExtensionGTE applies the GTE predicate on the "file_extension" field. +func FileExtensionGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldFileExtension, v)) +} + +// FileExtensionLT applies the LT predicate on the "file_extension" field. +func FileExtensionLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldFileExtension, v)) +} + +// FileExtensionLTE applies the LTE predicate on the "file_extension" field. +func FileExtensionLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldFileExtension, v)) +} + +// FileExtensionContains applies the Contains predicate on the "file_extension" field. +func FileExtensionContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldFileExtension, v)) +} + +// FileExtensionHasPrefix applies the HasPrefix predicate on the "file_extension" field. +func FileExtensionHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldFileExtension, v)) +} + +// FileExtensionHasSuffix applies the HasSuffix predicate on the "file_extension" field. +func FileExtensionHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldFileExtension, v)) +} + +// FileExtensionEqualFold applies the EqualFold predicate on the "file_extension" field. +func FileExtensionEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldFileExtension, v)) +} + +// FileExtensionContainsFold applies the ContainsFold predicate on the "file_extension" field. +func FileExtensionContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldFileExtension, v)) +} + +// FileSizeEQ applies the EQ predicate on the "file_size" field. +func FileSizeEQ(v int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldFileSize, v)) +} + +// FileSizeNEQ applies the NEQ predicate on the "file_size" field. +func FileSizeNEQ(v int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldFileSize, v)) +} + +// FileSizeIn applies the In predicate on the "file_size" field. +func FileSizeIn(vs ...int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldFileSize, vs...)) +} + +// FileSizeNotIn applies the NotIn predicate on the "file_size" field. +func FileSizeNotIn(vs ...int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldFileSize, vs...)) +} + +// FileSizeGT applies the GT predicate on the "file_size" field. +func FileSizeGT(v int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldFileSize, v)) +} + +// FileSizeGTE applies the GTE predicate on the "file_size" field. +func FileSizeGTE(v int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldFileSize, v)) +} + +// FileSizeLT applies the LT predicate on the "file_size" field. +func FileSizeLT(v int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldFileSize, v)) +} + +// FileSizeLTE applies the LTE predicate on the "file_size" field. +func FileSizeLTE(v int) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldFileSize, v)) +} + +// FileSizeIsNil applies the IsNil predicate on the "file_size" field. +func FileSizeIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldFileSize)) +} + +// FileSizeNotNil applies the NotNil predicate on the "file_size" field. +func FileSizeNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldFileSize)) +} + +// ContentTypeEQ applies the EQ predicate on the "content_type" field. +func ContentTypeEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldContentType, v)) +} + +// ContentTypeNEQ applies the NEQ predicate on the "content_type" field. +func ContentTypeNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldContentType, v)) +} + +// ContentTypeIn applies the In predicate on the "content_type" field. +func ContentTypeIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldContentType, vs...)) +} + +// ContentTypeNotIn applies the NotIn predicate on the "content_type" field. +func ContentTypeNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldContentType, vs...)) +} + +// ContentTypeGT applies the GT predicate on the "content_type" field. +func ContentTypeGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldContentType, v)) +} + +// ContentTypeGTE applies the GTE predicate on the "content_type" field. +func ContentTypeGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldContentType, v)) +} + +// ContentTypeLT applies the LT predicate on the "content_type" field. +func ContentTypeLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldContentType, v)) +} + +// ContentTypeLTE applies the LTE predicate on the "content_type" field. +func ContentTypeLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldContentType, v)) +} + +// ContentTypeContains applies the Contains predicate on the "content_type" field. +func ContentTypeContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldContentType, v)) +} + +// ContentTypeHasPrefix applies the HasPrefix predicate on the "content_type" field. +func ContentTypeHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldContentType, v)) +} + +// ContentTypeHasSuffix applies the HasSuffix predicate on the "content_type" field. +func ContentTypeHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldContentType, v)) +} + +// ContentTypeEqualFold applies the EqualFold predicate on the "content_type" field. +func ContentTypeEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldContentType, v)) +} + +// ContentTypeContainsFold applies the ContainsFold predicate on the "content_type" field. +func ContentTypeContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldContentType, v)) +} + +// StoreKeyEQ applies the EQ predicate on the "store_key" field. +func StoreKeyEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldStoreKey, v)) +} + +// StoreKeyNEQ applies the NEQ predicate on the "store_key" field. +func StoreKeyNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldStoreKey, v)) +} + +// StoreKeyIn applies the In predicate on the "store_key" field. +func StoreKeyIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldStoreKey, vs...)) +} + +// StoreKeyNotIn applies the NotIn predicate on the "store_key" field. +func StoreKeyNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldStoreKey, vs...)) +} + +// StoreKeyGT applies the GT predicate on the "store_key" field. +func StoreKeyGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldStoreKey, v)) +} + +// StoreKeyGTE applies the GTE predicate on the "store_key" field. +func StoreKeyGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldStoreKey, v)) +} + +// StoreKeyLT applies the LT predicate on the "store_key" field. +func StoreKeyLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldStoreKey, v)) +} + +// StoreKeyLTE applies the LTE predicate on the "store_key" field. +func StoreKeyLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldStoreKey, v)) +} + +// StoreKeyContains applies the Contains predicate on the "store_key" field. +func StoreKeyContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldStoreKey, v)) +} + +// StoreKeyHasPrefix applies the HasPrefix predicate on the "store_key" field. +func StoreKeyHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldStoreKey, v)) +} + +// StoreKeyHasSuffix applies the HasSuffix predicate on the "store_key" field. +func StoreKeyHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldStoreKey, v)) +} + +// StoreKeyEqualFold applies the EqualFold predicate on the "store_key" field. +func StoreKeyEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldStoreKey, v)) +} + +// StoreKeyContainsFold applies the ContainsFold predicate on the "store_key" field. +func StoreKeyContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldStoreKey, v)) +} + +// CategoryEQ applies the EQ predicate on the "category" field. +func CategoryEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldCategory, v)) +} + +// CategoryNEQ applies the NEQ predicate on the "category" field. +func CategoryNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldCategory, v)) +} + +// CategoryIn applies the In predicate on the "category" field. +func CategoryIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldCategory, vs...)) +} + +// CategoryNotIn applies the NotIn predicate on the "category" field. +func CategoryNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldCategory, vs...)) +} + +// CategoryGT applies the GT predicate on the "category" field. +func CategoryGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldCategory, v)) +} + +// CategoryGTE applies the GTE predicate on the "category" field. +func CategoryGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldCategory, v)) +} + +// CategoryLT applies the LT predicate on the "category" field. +func CategoryLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldCategory, v)) +} + +// CategoryLTE applies the LTE predicate on the "category" field. +func CategoryLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldCategory, v)) +} + +// CategoryContains applies the Contains predicate on the "category" field. +func CategoryContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldCategory, v)) +} + +// CategoryHasPrefix applies the HasPrefix predicate on the "category" field. +func CategoryHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldCategory, v)) +} + +// CategoryHasSuffix applies the HasSuffix predicate on the "category" field. +func CategoryHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldCategory, v)) +} + +// CategoryIsNil applies the IsNil predicate on the "category" field. +func CategoryIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldCategory)) +} + +// CategoryNotNil applies the NotNil predicate on the "category" field. +func CategoryNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldCategory)) +} + +// CategoryEqualFold applies the EqualFold predicate on the "category" field. +func CategoryEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldCategory, v)) +} + +// CategoryContainsFold applies the ContainsFold predicate on the "category" field. +func CategoryContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldCategory, v)) +} + +// AnnotationEQ applies the EQ predicate on the "annotation" field. +func AnnotationEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEQ(FieldAnnotation, v)) +} + +// AnnotationNEQ applies the NEQ predicate on the "annotation" field. +func AnnotationNEQ(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNEQ(FieldAnnotation, v)) +} + +// AnnotationIn applies the In predicate on the "annotation" field. +func AnnotationIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldIn(FieldAnnotation, vs...)) +} + +// AnnotationNotIn applies the NotIn predicate on the "annotation" field. +func AnnotationNotIn(vs ...string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotIn(FieldAnnotation, vs...)) +} + +// AnnotationGT applies the GT predicate on the "annotation" field. +func AnnotationGT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGT(FieldAnnotation, v)) +} + +// AnnotationGTE applies the GTE predicate on the "annotation" field. +func AnnotationGTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldGTE(FieldAnnotation, v)) +} + +// AnnotationLT applies the LT predicate on the "annotation" field. +func AnnotationLT(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLT(FieldAnnotation, v)) +} + +// AnnotationLTE applies the LTE predicate on the "annotation" field. +func AnnotationLTE(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldLTE(FieldAnnotation, v)) +} + +// AnnotationContains applies the Contains predicate on the "annotation" field. +func AnnotationContains(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContains(FieldAnnotation, v)) +} + +// AnnotationHasPrefix applies the HasPrefix predicate on the "annotation" field. +func AnnotationHasPrefix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasPrefix(FieldAnnotation, v)) +} + +// AnnotationHasSuffix applies the HasSuffix predicate on the "annotation" field. +func AnnotationHasSuffix(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldHasSuffix(FieldAnnotation, v)) +} + +// AnnotationIsNil applies the IsNil predicate on the "annotation" field. +func AnnotationIsNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldIsNull(FieldAnnotation)) +} + +// AnnotationNotNil applies the NotNil predicate on the "annotation" field. +func AnnotationNotNil() predicate.FileHistory { + return predicate.FileHistory(sql.FieldNotNull(FieldAnnotation)) +} + +// AnnotationEqualFold applies the EqualFold predicate on the "annotation" field. +func AnnotationEqualFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldEqualFold(FieldAnnotation, v)) +} + +// AnnotationContainsFold applies the ContainsFold predicate on the "annotation" field. +func AnnotationContainsFold(v string) predicate.FileHistory { + return predicate.FileHistory(sql.FieldContainsFold(FieldAnnotation, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.FileHistory) predicate.FileHistory { + return predicate.FileHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.FileHistory) predicate.FileHistory { + return predicate.FileHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.FileHistory) predicate.FileHistory { + return predicate.FileHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/filehistory_create.go b/internal/ent/generated/filehistory_create.go new file mode 100644 index 0000000..0d59df1 --- /dev/null +++ b/internal/ent/generated/filehistory_create.go @@ -0,0 +1,524 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/entx/history" +) + +// FileHistoryCreate is the builder for creating a FileHistory entity. +type FileHistoryCreate struct { + config + mutation *FileHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (fhc *FileHistoryCreate) SetHistoryTime(t time.Time) *FileHistoryCreate { + fhc.mutation.SetHistoryTime(t) + return fhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableHistoryTime(t *time.Time) *FileHistoryCreate { + if t != nil { + fhc.SetHistoryTime(*t) + } + return fhc +} + +// SetRef sets the "ref" field. +func (fhc *FileHistoryCreate) SetRef(s string) *FileHistoryCreate { + fhc.mutation.SetRef(s) + return fhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableRef(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetRef(*s) + } + return fhc +} + +// SetOperation sets the "operation" field. +func (fhc *FileHistoryCreate) SetOperation(ht history.OpType) *FileHistoryCreate { + fhc.mutation.SetOperation(ht) + return fhc +} + +// SetCreatedAt sets the "created_at" field. +func (fhc *FileHistoryCreate) SetCreatedAt(t time.Time) *FileHistoryCreate { + fhc.mutation.SetCreatedAt(t) + return fhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableCreatedAt(t *time.Time) *FileHistoryCreate { + if t != nil { + fhc.SetCreatedAt(*t) + } + return fhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (fhc *FileHistoryCreate) SetUpdatedAt(t time.Time) *FileHistoryCreate { + fhc.mutation.SetUpdatedAt(t) + return fhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableUpdatedAt(t *time.Time) *FileHistoryCreate { + if t != nil { + fhc.SetUpdatedAt(*t) + } + return fhc +} + +// SetCreatedBy sets the "created_by" field. +func (fhc *FileHistoryCreate) SetCreatedBy(s string) *FileHistoryCreate { + fhc.mutation.SetCreatedBy(s) + return fhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableCreatedBy(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetCreatedBy(*s) + } + return fhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (fhc *FileHistoryCreate) SetUpdatedBy(s string) *FileHistoryCreate { + fhc.mutation.SetUpdatedBy(s) + return fhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableUpdatedBy(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetUpdatedBy(*s) + } + return fhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (fhc *FileHistoryCreate) SetDeletedAt(t time.Time) *FileHistoryCreate { + fhc.mutation.SetDeletedAt(t) + return fhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableDeletedAt(t *time.Time) *FileHistoryCreate { + if t != nil { + fhc.SetDeletedAt(*t) + } + return fhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (fhc *FileHistoryCreate) SetDeletedBy(s string) *FileHistoryCreate { + fhc.mutation.SetDeletedBy(s) + return fhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableDeletedBy(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetDeletedBy(*s) + } + return fhc +} + +// SetMappingID sets the "mapping_id" field. +func (fhc *FileHistoryCreate) SetMappingID(s string) *FileHistoryCreate { + fhc.mutation.SetMappingID(s) + return fhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableMappingID(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetMappingID(*s) + } + return fhc +} + +// SetTags sets the "tags" field. +func (fhc *FileHistoryCreate) SetTags(s []string) *FileHistoryCreate { + fhc.mutation.SetTags(s) + return fhc +} + +// SetFileName sets the "file_name" field. +func (fhc *FileHistoryCreate) SetFileName(s string) *FileHistoryCreate { + fhc.mutation.SetFileName(s) + return fhc +} + +// SetFileExtension sets the "file_extension" field. +func (fhc *FileHistoryCreate) SetFileExtension(s string) *FileHistoryCreate { + fhc.mutation.SetFileExtension(s) + return fhc +} + +// SetFileSize sets the "file_size" field. +func (fhc *FileHistoryCreate) SetFileSize(i int) *FileHistoryCreate { + fhc.mutation.SetFileSize(i) + return fhc +} + +// SetNillableFileSize sets the "file_size" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableFileSize(i *int) *FileHistoryCreate { + if i != nil { + fhc.SetFileSize(*i) + } + return fhc +} + +// SetContentType sets the "content_type" field. +func (fhc *FileHistoryCreate) SetContentType(s string) *FileHistoryCreate { + fhc.mutation.SetContentType(s) + return fhc +} + +// SetStoreKey sets the "store_key" field. +func (fhc *FileHistoryCreate) SetStoreKey(s string) *FileHistoryCreate { + fhc.mutation.SetStoreKey(s) + return fhc +} + +// SetCategory sets the "category" field. +func (fhc *FileHistoryCreate) SetCategory(s string) *FileHistoryCreate { + fhc.mutation.SetCategory(s) + return fhc +} + +// SetNillableCategory sets the "category" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableCategory(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetCategory(*s) + } + return fhc +} + +// SetAnnotation sets the "annotation" field. +func (fhc *FileHistoryCreate) SetAnnotation(s string) *FileHistoryCreate { + fhc.mutation.SetAnnotation(s) + return fhc +} + +// SetNillableAnnotation sets the "annotation" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableAnnotation(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetAnnotation(*s) + } + return fhc +} + +// SetID sets the "id" field. +func (fhc *FileHistoryCreate) SetID(s string) *FileHistoryCreate { + fhc.mutation.SetID(s) + return fhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (fhc *FileHistoryCreate) SetNillableID(s *string) *FileHistoryCreate { + if s != nil { + fhc.SetID(*s) + } + return fhc +} + +// Mutation returns the FileHistoryMutation object of the builder. +func (fhc *FileHistoryCreate) Mutation() *FileHistoryMutation { + return fhc.mutation +} + +// Save creates the FileHistory in the database. +func (fhc *FileHistoryCreate) Save(ctx context.Context) (*FileHistory, error) { + fhc.defaults() + return withHooks(ctx, fhc.sqlSave, fhc.mutation, fhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (fhc *FileHistoryCreate) SaveX(ctx context.Context) *FileHistory { + v, err := fhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fhc *FileHistoryCreate) Exec(ctx context.Context) error { + _, err := fhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhc *FileHistoryCreate) ExecX(ctx context.Context) { + if err := fhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fhc *FileHistoryCreate) defaults() { + if _, ok := fhc.mutation.HistoryTime(); !ok { + v := filehistory.DefaultHistoryTime() + fhc.mutation.SetHistoryTime(v) + } + if _, ok := fhc.mutation.CreatedAt(); !ok { + v := filehistory.DefaultCreatedAt() + fhc.mutation.SetCreatedAt(v) + } + if _, ok := fhc.mutation.UpdatedAt(); !ok { + v := filehistory.DefaultUpdatedAt() + fhc.mutation.SetUpdatedAt(v) + } + if _, ok := fhc.mutation.MappingID(); !ok { + v := filehistory.DefaultMappingID() + fhc.mutation.SetMappingID(v) + } + if _, ok := fhc.mutation.Tags(); !ok { + v := filehistory.DefaultTags + fhc.mutation.SetTags(v) + } + if _, ok := fhc.mutation.ID(); !ok { + v := filehistory.DefaultID() + fhc.mutation.SetID(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (fhc *FileHistoryCreate) check() error { + if _, ok := fhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "FileHistory.history_time"`)} + } + if _, ok := fhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "FileHistory.operation"`)} + } + if v, ok := fhc.mutation.Operation(); ok { + if err := filehistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "FileHistory.operation": %w`, err)} + } + } + if _, ok := fhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "FileHistory.mapping_id"`)} + } + if _, ok := fhc.mutation.FileName(); !ok { + return &ValidationError{Name: "file_name", err: errors.New(`generated: missing required field "FileHistory.file_name"`)} + } + if _, ok := fhc.mutation.FileExtension(); !ok { + return &ValidationError{Name: "file_extension", err: errors.New(`generated: missing required field "FileHistory.file_extension"`)} + } + if _, ok := fhc.mutation.ContentType(); !ok { + return &ValidationError{Name: "content_type", err: errors.New(`generated: missing required field "FileHistory.content_type"`)} + } + if _, ok := fhc.mutation.StoreKey(); !ok { + return &ValidationError{Name: "store_key", err: errors.New(`generated: missing required field "FileHistory.store_key"`)} + } + return nil +} + +func (fhc *FileHistoryCreate) sqlSave(ctx context.Context) (*FileHistory, error) { + if err := fhc.check(); err != nil { + return nil, err + } + _node, _spec := fhc.createSpec() + if err := sqlgraph.CreateNode(ctx, fhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected FileHistory.ID type: %T", _spec.ID.Value) + } + } + fhc.mutation.id = &_node.ID + fhc.mutation.done = true + return _node, nil +} + +func (fhc *FileHistoryCreate) createSpec() (*FileHistory, *sqlgraph.CreateSpec) { + var ( + _node = &FileHistory{config: fhc.config} + _spec = sqlgraph.NewCreateSpec(filehistory.Table, sqlgraph.NewFieldSpec(filehistory.FieldID, field.TypeString)) + ) + _spec.Schema = fhc.schemaConfig.FileHistory + if id, ok := fhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := fhc.mutation.HistoryTime(); ok { + _spec.SetField(filehistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := fhc.mutation.Ref(); ok { + _spec.SetField(filehistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := fhc.mutation.Operation(); ok { + _spec.SetField(filehistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := fhc.mutation.CreatedAt(); ok { + _spec.SetField(filehistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := fhc.mutation.UpdatedAt(); ok { + _spec.SetField(filehistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := fhc.mutation.CreatedBy(); ok { + _spec.SetField(filehistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := fhc.mutation.UpdatedBy(); ok { + _spec.SetField(filehistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := fhc.mutation.DeletedAt(); ok { + _spec.SetField(filehistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := fhc.mutation.DeletedBy(); ok { + _spec.SetField(filehistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := fhc.mutation.MappingID(); ok { + _spec.SetField(filehistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := fhc.mutation.Tags(); ok { + _spec.SetField(filehistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := fhc.mutation.FileName(); ok { + _spec.SetField(filehistory.FieldFileName, field.TypeString, value) + _node.FileName = value + } + if value, ok := fhc.mutation.FileExtension(); ok { + _spec.SetField(filehistory.FieldFileExtension, field.TypeString, value) + _node.FileExtension = value + } + if value, ok := fhc.mutation.FileSize(); ok { + _spec.SetField(filehistory.FieldFileSize, field.TypeInt, value) + _node.FileSize = value + } + if value, ok := fhc.mutation.ContentType(); ok { + _spec.SetField(filehistory.FieldContentType, field.TypeString, value) + _node.ContentType = value + } + if value, ok := fhc.mutation.StoreKey(); ok { + _spec.SetField(filehistory.FieldStoreKey, field.TypeString, value) + _node.StoreKey = value + } + if value, ok := fhc.mutation.Category(); ok { + _spec.SetField(filehistory.FieldCategory, field.TypeString, value) + _node.Category = value + } + if value, ok := fhc.mutation.Annotation(); ok { + _spec.SetField(filehistory.FieldAnnotation, field.TypeString, value) + _node.Annotation = value + } + return _node, _spec +} + +// FileHistoryCreateBulk is the builder for creating many FileHistory entities in bulk. +type FileHistoryCreateBulk struct { + config + err error + builders []*FileHistoryCreate +} + +// Save creates the FileHistory entities in the database. +func (fhcb *FileHistoryCreateBulk) Save(ctx context.Context) ([]*FileHistory, error) { + if fhcb.err != nil { + return nil, fhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(fhcb.builders)) + nodes := make([]*FileHistory, len(fhcb.builders)) + mutators := make([]Mutator, len(fhcb.builders)) + for i := range fhcb.builders { + func(i int, root context.Context) { + builder := fhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*FileHistoryMutation) + 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, fhcb.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, fhcb.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, fhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (fhcb *FileHistoryCreateBulk) SaveX(ctx context.Context) []*FileHistory { + v, err := fhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (fhcb *FileHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := fhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhcb *FileHistoryCreateBulk) ExecX(ctx context.Context) { + if err := fhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/filehistory_delete.go b/internal/ent/generated/filehistory_delete.go new file mode 100644 index 0000000..acb0921 --- /dev/null +++ b/internal/ent/generated/filehistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FileHistoryDelete is the builder for deleting a FileHistory entity. +type FileHistoryDelete struct { + config + hooks []Hook + mutation *FileHistoryMutation +} + +// Where appends a list predicates to the FileHistoryDelete builder. +func (fhd *FileHistoryDelete) Where(ps ...predicate.FileHistory) *FileHistoryDelete { + fhd.mutation.Where(ps...) + return fhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (fhd *FileHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, fhd.sqlExec, fhd.mutation, fhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhd *FileHistoryDelete) ExecX(ctx context.Context) int { + n, err := fhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (fhd *FileHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(filehistory.Table, sqlgraph.NewFieldSpec(filehistory.FieldID, field.TypeString)) + _spec.Node.Schema = fhd.schemaConfig.FileHistory + ctx = internal.NewSchemaConfigContext(ctx, fhd.schemaConfig) + if ps := fhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, fhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + fhd.mutation.done = true + return affected, err +} + +// FileHistoryDeleteOne is the builder for deleting a single FileHistory entity. +type FileHistoryDeleteOne struct { + fhd *FileHistoryDelete +} + +// Where appends a list predicates to the FileHistoryDelete builder. +func (fhdo *FileHistoryDeleteOne) Where(ps ...predicate.FileHistory) *FileHistoryDeleteOne { + fhdo.fhd.mutation.Where(ps...) + return fhdo +} + +// Exec executes the deletion query. +func (fhdo *FileHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := fhdo.fhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{filehistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhdo *FileHistoryDeleteOne) ExecX(ctx context.Context) { + if err := fhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/filehistory_query.go b/internal/ent/generated/filehistory_query.go new file mode 100644 index 0000000..43a12d7 --- /dev/null +++ b/internal/ent/generated/filehistory_query.go @@ -0,0 +1,549 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FileHistoryQuery is the builder for querying FileHistory entities. +type FileHistoryQuery struct { + config + ctx *QueryContext + order []filehistory.OrderOption + inters []Interceptor + predicates []predicate.FileHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*FileHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the FileHistoryQuery builder. +func (fhq *FileHistoryQuery) Where(ps ...predicate.FileHistory) *FileHistoryQuery { + fhq.predicates = append(fhq.predicates, ps...) + return fhq +} + +// Limit the number of records to be returned by this query. +func (fhq *FileHistoryQuery) Limit(limit int) *FileHistoryQuery { + fhq.ctx.Limit = &limit + return fhq +} + +// Offset to start from. +func (fhq *FileHistoryQuery) Offset(offset int) *FileHistoryQuery { + fhq.ctx.Offset = &offset + return fhq +} + +// 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 (fhq *FileHistoryQuery) Unique(unique bool) *FileHistoryQuery { + fhq.ctx.Unique = &unique + return fhq +} + +// Order specifies how the records should be ordered. +func (fhq *FileHistoryQuery) Order(o ...filehistory.OrderOption) *FileHistoryQuery { + fhq.order = append(fhq.order, o...) + return fhq +} + +// First returns the first FileHistory entity from the query. +// Returns a *NotFoundError when no FileHistory was found. +func (fhq *FileHistoryQuery) First(ctx context.Context) (*FileHistory, error) { + nodes, err := fhq.Limit(1).All(setContextOp(ctx, fhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{filehistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (fhq *FileHistoryQuery) FirstX(ctx context.Context) *FileHistory { + node, err := fhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first FileHistory ID from the query. +// Returns a *NotFoundError when no FileHistory ID was found. +func (fhq *FileHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fhq.Limit(1).IDs(setContextOp(ctx, fhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{filehistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (fhq *FileHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := fhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single FileHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one FileHistory entity is found. +// Returns a *NotFoundError when no FileHistory entities are found. +func (fhq *FileHistoryQuery) Only(ctx context.Context) (*FileHistory, error) { + nodes, err := fhq.Limit(2).All(setContextOp(ctx, fhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{filehistory.Label} + default: + return nil, &NotSingularError{filehistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (fhq *FileHistoryQuery) OnlyX(ctx context.Context) *FileHistory { + node, err := fhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only FileHistory ID in the query. +// Returns a *NotSingularError when more than one FileHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (fhq *FileHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = fhq.Limit(2).IDs(setContextOp(ctx, fhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{filehistory.Label} + default: + err = &NotSingularError{filehistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (fhq *FileHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := fhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of FileHistories. +func (fhq *FileHistoryQuery) All(ctx context.Context) ([]*FileHistory, error) { + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryAll) + if err := fhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*FileHistory, *FileHistoryQuery]() + return withInterceptors[[]*FileHistory](ctx, fhq, qr, fhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (fhq *FileHistoryQuery) AllX(ctx context.Context) []*FileHistory { + nodes, err := fhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of FileHistory IDs. +func (fhq *FileHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if fhq.ctx.Unique == nil && fhq.path != nil { + fhq.Unique(true) + } + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryIDs) + if err = fhq.Select(filehistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (fhq *FileHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := fhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (fhq *FileHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryCount) + if err := fhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, fhq, querierCount[*FileHistoryQuery](), fhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (fhq *FileHistoryQuery) CountX(ctx context.Context) int { + count, err := fhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (fhq *FileHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, fhq.ctx, ent.OpQueryExist) + switch _, err := fhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (fhq *FileHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := fhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the FileHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (fhq *FileHistoryQuery) Clone() *FileHistoryQuery { + if fhq == nil { + return nil + } + return &FileHistoryQuery{ + config: fhq.config, + ctx: fhq.ctx.Clone(), + order: append([]filehistory.OrderOption{}, fhq.order...), + inters: append([]Interceptor{}, fhq.inters...), + predicates: append([]predicate.FileHistory{}, fhq.predicates...), + // clone intermediate query. + sql: fhq.sql.Clone(), + path: fhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.FileHistory.Query(). +// GroupBy(filehistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (fhq *FileHistoryQuery) GroupBy(field string, fields ...string) *FileHistoryGroupBy { + fhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &FileHistoryGroupBy{build: fhq} + grbuild.flds = &fhq.ctx.Fields + grbuild.label = filehistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.FileHistory.Query(). +// Select(filehistory.FieldHistoryTime). +// Scan(ctx, &v) +func (fhq *FileHistoryQuery) Select(fields ...string) *FileHistorySelect { + fhq.ctx.Fields = append(fhq.ctx.Fields, fields...) + sbuild := &FileHistorySelect{FileHistoryQuery: fhq} + sbuild.label = filehistory.Label + sbuild.flds, sbuild.scan = &fhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a FileHistorySelect configured with the given aggregations. +func (fhq *FileHistoryQuery) Aggregate(fns ...AggregateFunc) *FileHistorySelect { + return fhq.Select().Aggregate(fns...) +} + +func (fhq *FileHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range fhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, fhq); err != nil { + return err + } + } + } + for _, f := range fhq.ctx.Fields { + if !filehistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if fhq.path != nil { + prev, err := fhq.path(ctx) + if err != nil { + return err + } + fhq.sql = prev + } + return nil +} + +func (fhq *FileHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*FileHistory, error) { + var ( + nodes = []*FileHistory{} + _spec = fhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*FileHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &FileHistory{config: fhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = fhq.schemaConfig.FileHistory + ctx = internal.NewSchemaConfigContext(ctx, fhq.schemaConfig) + if len(fhq.modifiers) > 0 { + _spec.Modifiers = fhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, fhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range fhq.loadTotal { + if err := fhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (fhq *FileHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := fhq.querySpec() + _spec.Node.Schema = fhq.schemaConfig.FileHistory + ctx = internal.NewSchemaConfigContext(ctx, fhq.schemaConfig) + if len(fhq.modifiers) > 0 { + _spec.Modifiers = fhq.modifiers + } + _spec.Node.Columns = fhq.ctx.Fields + if len(fhq.ctx.Fields) > 0 { + _spec.Unique = fhq.ctx.Unique != nil && *fhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, fhq.driver, _spec) +} + +func (fhq *FileHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(filehistory.Table, filehistory.Columns, sqlgraph.NewFieldSpec(filehistory.FieldID, field.TypeString)) + _spec.From = fhq.sql + if unique := fhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if fhq.path != nil { + _spec.Unique = true + } + if fields := fhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, filehistory.FieldID) + for i := range fields { + if fields[i] != filehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := fhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := fhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := fhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := fhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (fhq *FileHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(fhq.driver.Dialect()) + t1 := builder.Table(filehistory.Table) + columns := fhq.ctx.Fields + if len(columns) == 0 { + columns = filehistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if fhq.sql != nil { + selector = fhq.sql + selector.Select(selector.Columns(columns...)...) + } + if fhq.ctx.Unique != nil && *fhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(fhq.schemaConfig.FileHistory) + ctx = internal.NewSchemaConfigContext(ctx, fhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range fhq.predicates { + p(selector) + } + for _, p := range fhq.order { + p(selector) + } + if offset := fhq.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 := fhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// FileHistoryGroupBy is the group-by builder for FileHistory entities. +type FileHistoryGroupBy struct { + selector + build *FileHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (fhgb *FileHistoryGroupBy) Aggregate(fns ...AggregateFunc) *FileHistoryGroupBy { + fhgb.fns = append(fhgb.fns, fns...) + return fhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (fhgb *FileHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fhgb.build.ctx, ent.OpQueryGroupBy) + if err := fhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FileHistoryQuery, *FileHistoryGroupBy](ctx, fhgb.build, fhgb, fhgb.build.inters, v) +} + +func (fhgb *FileHistoryGroupBy) sqlScan(ctx context.Context, root *FileHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(fhgb.fns)) + for _, fn := range fhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*fhgb.flds)+len(fhgb.fns)) + for _, f := range *fhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*fhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := fhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// FileHistorySelect is the builder for selecting fields of FileHistory entities. +type FileHistorySelect struct { + *FileHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (fhs *FileHistorySelect) Aggregate(fns ...AggregateFunc) *FileHistorySelect { + fhs.fns = append(fhs.fns, fns...) + return fhs +} + +// Scan applies the selector query and scans the result into the given value. +func (fhs *FileHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, fhs.ctx, ent.OpQuerySelect) + if err := fhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*FileHistoryQuery, *FileHistorySelect](ctx, fhs.FileHistoryQuery, fhs, fhs.inters, v) +} + +func (fhs *FileHistorySelect) sqlScan(ctx context.Context, root *FileHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(fhs.fns)) + for _, fn := range fhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*fhs.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 := fhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/filehistory_update.go b/internal/ent/generated/filehistory_update.go new file mode 100644 index 0000000..a944c19 --- /dev/null +++ b/internal/ent/generated/filehistory_update.go @@ -0,0 +1,781 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// FileHistoryUpdate is the builder for updating FileHistory entities. +type FileHistoryUpdate struct { + config + hooks []Hook + mutation *FileHistoryMutation +} + +// Where appends a list predicates to the FileHistoryUpdate builder. +func (fhu *FileHistoryUpdate) Where(ps ...predicate.FileHistory) *FileHistoryUpdate { + fhu.mutation.Where(ps...) + return fhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (fhu *FileHistoryUpdate) SetUpdatedAt(t time.Time) *FileHistoryUpdate { + fhu.mutation.SetUpdatedAt(t) + return fhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fhu *FileHistoryUpdate) ClearUpdatedAt() *FileHistoryUpdate { + fhu.mutation.ClearUpdatedAt() + return fhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (fhu *FileHistoryUpdate) SetUpdatedBy(s string) *FileHistoryUpdate { + fhu.mutation.SetUpdatedBy(s) + return fhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableUpdatedBy(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetUpdatedBy(*s) + } + return fhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fhu *FileHistoryUpdate) ClearUpdatedBy() *FileHistoryUpdate { + fhu.mutation.ClearUpdatedBy() + return fhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (fhu *FileHistoryUpdate) SetDeletedAt(t time.Time) *FileHistoryUpdate { + fhu.mutation.SetDeletedAt(t) + return fhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableDeletedAt(t *time.Time) *FileHistoryUpdate { + if t != nil { + fhu.SetDeletedAt(*t) + } + return fhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fhu *FileHistoryUpdate) ClearDeletedAt() *FileHistoryUpdate { + fhu.mutation.ClearDeletedAt() + return fhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (fhu *FileHistoryUpdate) SetDeletedBy(s string) *FileHistoryUpdate { + fhu.mutation.SetDeletedBy(s) + return fhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableDeletedBy(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetDeletedBy(*s) + } + return fhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fhu *FileHistoryUpdate) ClearDeletedBy() *FileHistoryUpdate { + fhu.mutation.ClearDeletedBy() + return fhu +} + +// SetTags sets the "tags" field. +func (fhu *FileHistoryUpdate) SetTags(s []string) *FileHistoryUpdate { + fhu.mutation.SetTags(s) + return fhu +} + +// AppendTags appends s to the "tags" field. +func (fhu *FileHistoryUpdate) AppendTags(s []string) *FileHistoryUpdate { + fhu.mutation.AppendTags(s) + return fhu +} + +// ClearTags clears the value of the "tags" field. +func (fhu *FileHistoryUpdate) ClearTags() *FileHistoryUpdate { + fhu.mutation.ClearTags() + return fhu +} + +// SetFileName sets the "file_name" field. +func (fhu *FileHistoryUpdate) SetFileName(s string) *FileHistoryUpdate { + fhu.mutation.SetFileName(s) + return fhu +} + +// SetNillableFileName sets the "file_name" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableFileName(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetFileName(*s) + } + return fhu +} + +// SetFileExtension sets the "file_extension" field. +func (fhu *FileHistoryUpdate) SetFileExtension(s string) *FileHistoryUpdate { + fhu.mutation.SetFileExtension(s) + return fhu +} + +// SetNillableFileExtension sets the "file_extension" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableFileExtension(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetFileExtension(*s) + } + return fhu +} + +// SetFileSize sets the "file_size" field. +func (fhu *FileHistoryUpdate) SetFileSize(i int) *FileHistoryUpdate { + fhu.mutation.ResetFileSize() + fhu.mutation.SetFileSize(i) + return fhu +} + +// SetNillableFileSize sets the "file_size" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableFileSize(i *int) *FileHistoryUpdate { + if i != nil { + fhu.SetFileSize(*i) + } + return fhu +} + +// AddFileSize adds i to the "file_size" field. +func (fhu *FileHistoryUpdate) AddFileSize(i int) *FileHistoryUpdate { + fhu.mutation.AddFileSize(i) + return fhu +} + +// ClearFileSize clears the value of the "file_size" field. +func (fhu *FileHistoryUpdate) ClearFileSize() *FileHistoryUpdate { + fhu.mutation.ClearFileSize() + return fhu +} + +// SetContentType sets the "content_type" field. +func (fhu *FileHistoryUpdate) SetContentType(s string) *FileHistoryUpdate { + fhu.mutation.SetContentType(s) + return fhu +} + +// SetNillableContentType sets the "content_type" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableContentType(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetContentType(*s) + } + return fhu +} + +// SetStoreKey sets the "store_key" field. +func (fhu *FileHistoryUpdate) SetStoreKey(s string) *FileHistoryUpdate { + fhu.mutation.SetStoreKey(s) + return fhu +} + +// SetNillableStoreKey sets the "store_key" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableStoreKey(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetStoreKey(*s) + } + return fhu +} + +// SetCategory sets the "category" field. +func (fhu *FileHistoryUpdate) SetCategory(s string) *FileHistoryUpdate { + fhu.mutation.SetCategory(s) + return fhu +} + +// SetNillableCategory sets the "category" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableCategory(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetCategory(*s) + } + return fhu +} + +// ClearCategory clears the value of the "category" field. +func (fhu *FileHistoryUpdate) ClearCategory() *FileHistoryUpdate { + fhu.mutation.ClearCategory() + return fhu +} + +// SetAnnotation sets the "annotation" field. +func (fhu *FileHistoryUpdate) SetAnnotation(s string) *FileHistoryUpdate { + fhu.mutation.SetAnnotation(s) + return fhu +} + +// SetNillableAnnotation sets the "annotation" field if the given value is not nil. +func (fhu *FileHistoryUpdate) SetNillableAnnotation(s *string) *FileHistoryUpdate { + if s != nil { + fhu.SetAnnotation(*s) + } + return fhu +} + +// ClearAnnotation clears the value of the "annotation" field. +func (fhu *FileHistoryUpdate) ClearAnnotation() *FileHistoryUpdate { + fhu.mutation.ClearAnnotation() + return fhu +} + +// Mutation returns the FileHistoryMutation object of the builder. +func (fhu *FileHistoryUpdate) Mutation() *FileHistoryMutation { + return fhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (fhu *FileHistoryUpdate) Save(ctx context.Context) (int, error) { + fhu.defaults() + return withHooks(ctx, fhu.sqlSave, fhu.mutation, fhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fhu *FileHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := fhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (fhu *FileHistoryUpdate) Exec(ctx context.Context) error { + _, err := fhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhu *FileHistoryUpdate) ExecX(ctx context.Context) { + if err := fhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fhu *FileHistoryUpdate) defaults() { + if _, ok := fhu.mutation.UpdatedAt(); !ok && !fhu.mutation.UpdatedAtCleared() { + v := filehistory.UpdateDefaultUpdatedAt() + fhu.mutation.SetUpdatedAt(v) + } +} + +func (fhu *FileHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(filehistory.Table, filehistory.Columns, sqlgraph.NewFieldSpec(filehistory.FieldID, field.TypeString)) + if ps := fhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fhu.mutation.RefCleared() { + _spec.ClearField(filehistory.FieldRef, field.TypeString) + } + if fhu.mutation.CreatedAtCleared() { + _spec.ClearField(filehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := fhu.mutation.UpdatedAt(); ok { + _spec.SetField(filehistory.FieldUpdatedAt, field.TypeTime, value) + } + if fhu.mutation.UpdatedAtCleared() { + _spec.ClearField(filehistory.FieldUpdatedAt, field.TypeTime) + } + if fhu.mutation.CreatedByCleared() { + _spec.ClearField(filehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := fhu.mutation.UpdatedBy(); ok { + _spec.SetField(filehistory.FieldUpdatedBy, field.TypeString, value) + } + if fhu.mutation.UpdatedByCleared() { + _spec.ClearField(filehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := fhu.mutation.DeletedAt(); ok { + _spec.SetField(filehistory.FieldDeletedAt, field.TypeTime, value) + } + if fhu.mutation.DeletedAtCleared() { + _spec.ClearField(filehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := fhu.mutation.DeletedBy(); ok { + _spec.SetField(filehistory.FieldDeletedBy, field.TypeString, value) + } + if fhu.mutation.DeletedByCleared() { + _spec.ClearField(filehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := fhu.mutation.Tags(); ok { + _spec.SetField(filehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := fhu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, filehistory.FieldTags, value) + }) + } + if fhu.mutation.TagsCleared() { + _spec.ClearField(filehistory.FieldTags, field.TypeJSON) + } + if value, ok := fhu.mutation.FileName(); ok { + _spec.SetField(filehistory.FieldFileName, field.TypeString, value) + } + if value, ok := fhu.mutation.FileExtension(); ok { + _spec.SetField(filehistory.FieldFileExtension, field.TypeString, value) + } + if value, ok := fhu.mutation.FileSize(); ok { + _spec.SetField(filehistory.FieldFileSize, field.TypeInt, value) + } + if value, ok := fhu.mutation.AddedFileSize(); ok { + _spec.AddField(filehistory.FieldFileSize, field.TypeInt, value) + } + if fhu.mutation.FileSizeCleared() { + _spec.ClearField(filehistory.FieldFileSize, field.TypeInt) + } + if value, ok := fhu.mutation.ContentType(); ok { + _spec.SetField(filehistory.FieldContentType, field.TypeString, value) + } + if value, ok := fhu.mutation.StoreKey(); ok { + _spec.SetField(filehistory.FieldStoreKey, field.TypeString, value) + } + if value, ok := fhu.mutation.Category(); ok { + _spec.SetField(filehistory.FieldCategory, field.TypeString, value) + } + if fhu.mutation.CategoryCleared() { + _spec.ClearField(filehistory.FieldCategory, field.TypeString) + } + if value, ok := fhu.mutation.Annotation(); ok { + _spec.SetField(filehistory.FieldAnnotation, field.TypeString, value) + } + if fhu.mutation.AnnotationCleared() { + _spec.ClearField(filehistory.FieldAnnotation, field.TypeString) + } + _spec.Node.Schema = fhu.schemaConfig.FileHistory + ctx = internal.NewSchemaConfigContext(ctx, fhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, fhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{filehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + fhu.mutation.done = true + return n, nil +} + +// FileHistoryUpdateOne is the builder for updating a single FileHistory entity. +type FileHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *FileHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (fhuo *FileHistoryUpdateOne) SetUpdatedAt(t time.Time) *FileHistoryUpdateOne { + fhuo.mutation.SetUpdatedAt(t) + return fhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (fhuo *FileHistoryUpdateOne) ClearUpdatedAt() *FileHistoryUpdateOne { + fhuo.mutation.ClearUpdatedAt() + return fhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (fhuo *FileHistoryUpdateOne) SetUpdatedBy(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetUpdatedBy(s) + return fhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableUpdatedBy(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetUpdatedBy(*s) + } + return fhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (fhuo *FileHistoryUpdateOne) ClearUpdatedBy() *FileHistoryUpdateOne { + fhuo.mutation.ClearUpdatedBy() + return fhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (fhuo *FileHistoryUpdateOne) SetDeletedAt(t time.Time) *FileHistoryUpdateOne { + fhuo.mutation.SetDeletedAt(t) + return fhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *FileHistoryUpdateOne { + if t != nil { + fhuo.SetDeletedAt(*t) + } + return fhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (fhuo *FileHistoryUpdateOne) ClearDeletedAt() *FileHistoryUpdateOne { + fhuo.mutation.ClearDeletedAt() + return fhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (fhuo *FileHistoryUpdateOne) SetDeletedBy(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetDeletedBy(s) + return fhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableDeletedBy(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetDeletedBy(*s) + } + return fhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (fhuo *FileHistoryUpdateOne) ClearDeletedBy() *FileHistoryUpdateOne { + fhuo.mutation.ClearDeletedBy() + return fhuo +} + +// SetTags sets the "tags" field. +func (fhuo *FileHistoryUpdateOne) SetTags(s []string) *FileHistoryUpdateOne { + fhuo.mutation.SetTags(s) + return fhuo +} + +// AppendTags appends s to the "tags" field. +func (fhuo *FileHistoryUpdateOne) AppendTags(s []string) *FileHistoryUpdateOne { + fhuo.mutation.AppendTags(s) + return fhuo +} + +// ClearTags clears the value of the "tags" field. +func (fhuo *FileHistoryUpdateOne) ClearTags() *FileHistoryUpdateOne { + fhuo.mutation.ClearTags() + return fhuo +} + +// SetFileName sets the "file_name" field. +func (fhuo *FileHistoryUpdateOne) SetFileName(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetFileName(s) + return fhuo +} + +// SetNillableFileName sets the "file_name" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableFileName(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetFileName(*s) + } + return fhuo +} + +// SetFileExtension sets the "file_extension" field. +func (fhuo *FileHistoryUpdateOne) SetFileExtension(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetFileExtension(s) + return fhuo +} + +// SetNillableFileExtension sets the "file_extension" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableFileExtension(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetFileExtension(*s) + } + return fhuo +} + +// SetFileSize sets the "file_size" field. +func (fhuo *FileHistoryUpdateOne) SetFileSize(i int) *FileHistoryUpdateOne { + fhuo.mutation.ResetFileSize() + fhuo.mutation.SetFileSize(i) + return fhuo +} + +// SetNillableFileSize sets the "file_size" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableFileSize(i *int) *FileHistoryUpdateOne { + if i != nil { + fhuo.SetFileSize(*i) + } + return fhuo +} + +// AddFileSize adds i to the "file_size" field. +func (fhuo *FileHistoryUpdateOne) AddFileSize(i int) *FileHistoryUpdateOne { + fhuo.mutation.AddFileSize(i) + return fhuo +} + +// ClearFileSize clears the value of the "file_size" field. +func (fhuo *FileHistoryUpdateOne) ClearFileSize() *FileHistoryUpdateOne { + fhuo.mutation.ClearFileSize() + return fhuo +} + +// SetContentType sets the "content_type" field. +func (fhuo *FileHistoryUpdateOne) SetContentType(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetContentType(s) + return fhuo +} + +// SetNillableContentType sets the "content_type" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableContentType(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetContentType(*s) + } + return fhuo +} + +// SetStoreKey sets the "store_key" field. +func (fhuo *FileHistoryUpdateOne) SetStoreKey(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetStoreKey(s) + return fhuo +} + +// SetNillableStoreKey sets the "store_key" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableStoreKey(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetStoreKey(*s) + } + return fhuo +} + +// SetCategory sets the "category" field. +func (fhuo *FileHistoryUpdateOne) SetCategory(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetCategory(s) + return fhuo +} + +// SetNillableCategory sets the "category" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableCategory(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetCategory(*s) + } + return fhuo +} + +// ClearCategory clears the value of the "category" field. +func (fhuo *FileHistoryUpdateOne) ClearCategory() *FileHistoryUpdateOne { + fhuo.mutation.ClearCategory() + return fhuo +} + +// SetAnnotation sets the "annotation" field. +func (fhuo *FileHistoryUpdateOne) SetAnnotation(s string) *FileHistoryUpdateOne { + fhuo.mutation.SetAnnotation(s) + return fhuo +} + +// SetNillableAnnotation sets the "annotation" field if the given value is not nil. +func (fhuo *FileHistoryUpdateOne) SetNillableAnnotation(s *string) *FileHistoryUpdateOne { + if s != nil { + fhuo.SetAnnotation(*s) + } + return fhuo +} + +// ClearAnnotation clears the value of the "annotation" field. +func (fhuo *FileHistoryUpdateOne) ClearAnnotation() *FileHistoryUpdateOne { + fhuo.mutation.ClearAnnotation() + return fhuo +} + +// Mutation returns the FileHistoryMutation object of the builder. +func (fhuo *FileHistoryUpdateOne) Mutation() *FileHistoryMutation { + return fhuo.mutation +} + +// Where appends a list predicates to the FileHistoryUpdate builder. +func (fhuo *FileHistoryUpdateOne) Where(ps ...predicate.FileHistory) *FileHistoryUpdateOne { + fhuo.mutation.Where(ps...) + return fhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (fhuo *FileHistoryUpdateOne) Select(field string, fields ...string) *FileHistoryUpdateOne { + fhuo.fields = append([]string{field}, fields...) + return fhuo +} + +// Save executes the query and returns the updated FileHistory entity. +func (fhuo *FileHistoryUpdateOne) Save(ctx context.Context) (*FileHistory, error) { + fhuo.defaults() + return withHooks(ctx, fhuo.sqlSave, fhuo.mutation, fhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (fhuo *FileHistoryUpdateOne) SaveX(ctx context.Context) *FileHistory { + node, err := fhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (fhuo *FileHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := fhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (fhuo *FileHistoryUpdateOne) ExecX(ctx context.Context) { + if err := fhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (fhuo *FileHistoryUpdateOne) defaults() { + if _, ok := fhuo.mutation.UpdatedAt(); !ok && !fhuo.mutation.UpdatedAtCleared() { + v := filehistory.UpdateDefaultUpdatedAt() + fhuo.mutation.SetUpdatedAt(v) + } +} + +func (fhuo *FileHistoryUpdateOne) sqlSave(ctx context.Context) (_node *FileHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(filehistory.Table, filehistory.Columns, sqlgraph.NewFieldSpec(filehistory.FieldID, field.TypeString)) + id, ok := fhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "FileHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := fhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, filehistory.FieldID) + for _, f := range fields { + if !filehistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != filehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := fhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if fhuo.mutation.RefCleared() { + _spec.ClearField(filehistory.FieldRef, field.TypeString) + } + if fhuo.mutation.CreatedAtCleared() { + _spec.ClearField(filehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := fhuo.mutation.UpdatedAt(); ok { + _spec.SetField(filehistory.FieldUpdatedAt, field.TypeTime, value) + } + if fhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(filehistory.FieldUpdatedAt, field.TypeTime) + } + if fhuo.mutation.CreatedByCleared() { + _spec.ClearField(filehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := fhuo.mutation.UpdatedBy(); ok { + _spec.SetField(filehistory.FieldUpdatedBy, field.TypeString, value) + } + if fhuo.mutation.UpdatedByCleared() { + _spec.ClearField(filehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := fhuo.mutation.DeletedAt(); ok { + _spec.SetField(filehistory.FieldDeletedAt, field.TypeTime, value) + } + if fhuo.mutation.DeletedAtCleared() { + _spec.ClearField(filehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := fhuo.mutation.DeletedBy(); ok { + _spec.SetField(filehistory.FieldDeletedBy, field.TypeString, value) + } + if fhuo.mutation.DeletedByCleared() { + _spec.ClearField(filehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := fhuo.mutation.Tags(); ok { + _spec.SetField(filehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := fhuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, filehistory.FieldTags, value) + }) + } + if fhuo.mutation.TagsCleared() { + _spec.ClearField(filehistory.FieldTags, field.TypeJSON) + } + if value, ok := fhuo.mutation.FileName(); ok { + _spec.SetField(filehistory.FieldFileName, field.TypeString, value) + } + if value, ok := fhuo.mutation.FileExtension(); ok { + _spec.SetField(filehistory.FieldFileExtension, field.TypeString, value) + } + if value, ok := fhuo.mutation.FileSize(); ok { + _spec.SetField(filehistory.FieldFileSize, field.TypeInt, value) + } + if value, ok := fhuo.mutation.AddedFileSize(); ok { + _spec.AddField(filehistory.FieldFileSize, field.TypeInt, value) + } + if fhuo.mutation.FileSizeCleared() { + _spec.ClearField(filehistory.FieldFileSize, field.TypeInt) + } + if value, ok := fhuo.mutation.ContentType(); ok { + _spec.SetField(filehistory.FieldContentType, field.TypeString, value) + } + if value, ok := fhuo.mutation.StoreKey(); ok { + _spec.SetField(filehistory.FieldStoreKey, field.TypeString, value) + } + if value, ok := fhuo.mutation.Category(); ok { + _spec.SetField(filehistory.FieldCategory, field.TypeString, value) + } + if fhuo.mutation.CategoryCleared() { + _spec.ClearField(filehistory.FieldCategory, field.TypeString) + } + if value, ok := fhuo.mutation.Annotation(); ok { + _spec.SetField(filehistory.FieldAnnotation, field.TypeString, value) + } + if fhuo.mutation.AnnotationCleared() { + _spec.ClearField(filehistory.FieldAnnotation, field.TypeString) + } + _spec.Node.Schema = fhuo.schemaConfig.FileHistory + ctx = internal.NewSchemaConfigContext(ctx, fhuo.schemaConfig) + _node = &FileHistory{config: fhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, fhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{filehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + fhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/gql_collection.go b/internal/ent/generated/gql_collection.go new file mode 100644 index 0000000..31714d7 --- /dev/null +++ b/internal/ent/generated/gql_collection.go @@ -0,0 +1,9463 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "fmt" + + "entgo.io/contrib/entgql" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" +) + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (at *APITokenQuery) CollectFields(ctx context.Context, satisfies ...string) (*APITokenQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return at, nil + } + if err := at.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return at, nil +} + +func (at *APITokenQuery) 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(apitoken.Columns)) + selectedFields = []string{apitoken.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: at.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + at.withOwner = query + if _, ok := fieldSeen[apitoken.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, apitoken.FieldOwnerID) + fieldSeen[apitoken.FieldOwnerID] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[apitoken.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, apitoken.FieldCreatedAt) + fieldSeen[apitoken.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[apitoken.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, apitoken.FieldUpdatedAt) + fieldSeen[apitoken.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[apitoken.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, apitoken.FieldCreatedBy) + fieldSeen[apitoken.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[apitoken.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, apitoken.FieldUpdatedBy) + fieldSeen[apitoken.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[apitoken.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, apitoken.FieldDeletedAt) + fieldSeen[apitoken.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[apitoken.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, apitoken.FieldDeletedBy) + fieldSeen[apitoken.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[apitoken.FieldTags]; !ok { + selectedFields = append(selectedFields, apitoken.FieldTags) + fieldSeen[apitoken.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[apitoken.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, apitoken.FieldOwnerID) + fieldSeen[apitoken.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[apitoken.FieldName]; !ok { + selectedFields = append(selectedFields, apitoken.FieldName) + fieldSeen[apitoken.FieldName] = struct{}{} + } + case "token": + if _, ok := fieldSeen[apitoken.FieldToken]; !ok { + selectedFields = append(selectedFields, apitoken.FieldToken) + fieldSeen[apitoken.FieldToken] = struct{}{} + } + case "expiresAt": + if _, ok := fieldSeen[apitoken.FieldExpiresAt]; !ok { + selectedFields = append(selectedFields, apitoken.FieldExpiresAt) + fieldSeen[apitoken.FieldExpiresAt] = struct{}{} + } + case "description": + if _, ok := fieldSeen[apitoken.FieldDescription]; !ok { + selectedFields = append(selectedFields, apitoken.FieldDescription) + fieldSeen[apitoken.FieldDescription] = struct{}{} + } + case "scopes": + if _, ok := fieldSeen[apitoken.FieldScopes]; !ok { + selectedFields = append(selectedFields, apitoken.FieldScopes) + fieldSeen[apitoken.FieldScopes] = struct{}{} + } + case "lastUsedAt": + if _, ok := fieldSeen[apitoken.FieldLastUsedAt]; !ok { + selectedFields = append(selectedFields, apitoken.FieldLastUsedAt) + fieldSeen[apitoken.FieldLastUsedAt] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + at.Select(selectedFields...) + } + return nil +} + +type apitokenPaginateArgs struct { + first, last *int + after, before *Cursor + opts []APITokenPaginateOption +} + +func newAPITokenPaginateArgs(rv map[string]any) *apitokenPaginateArgs { + args := &apitokenPaginateArgs{} + 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].(*APITokenWhereInput); ok { + args.opts = append(args.opts, WithAPITokenFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (c *ContactQuery) CollectFields(ctx context.Context, satisfies ...string) (*ContactQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return c, nil + } + if err := c.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return c, nil +} + +func (c *ContactQuery) 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(contact.Columns)) + selectedFields = []string{contact.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: c.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + c.withOwner = query + if _, ok := fieldSeen[contact.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, contact.FieldOwnerID) + fieldSeen[contact.FieldOwnerID] = struct{}{} + } + + case "entities": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityClient{config: c.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entityImplementors)...); err != nil { + return err + } + c.WithNamedEntities(alias, func(wq *EntityQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[contact.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, contact.FieldCreatedAt) + fieldSeen[contact.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[contact.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, contact.FieldUpdatedAt) + fieldSeen[contact.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[contact.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, contact.FieldCreatedBy) + fieldSeen[contact.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[contact.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, contact.FieldUpdatedBy) + fieldSeen[contact.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[contact.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, contact.FieldDeletedAt) + fieldSeen[contact.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[contact.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, contact.FieldDeletedBy) + fieldSeen[contact.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[contact.FieldTags]; !ok { + selectedFields = append(selectedFields, contact.FieldTags) + fieldSeen[contact.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[contact.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, contact.FieldOwnerID) + fieldSeen[contact.FieldOwnerID] = struct{}{} + } + case "fullName": + if _, ok := fieldSeen[contact.FieldFullName]; !ok { + selectedFields = append(selectedFields, contact.FieldFullName) + fieldSeen[contact.FieldFullName] = struct{}{} + } + case "title": + if _, ok := fieldSeen[contact.FieldTitle]; !ok { + selectedFields = append(selectedFields, contact.FieldTitle) + fieldSeen[contact.FieldTitle] = struct{}{} + } + case "company": + if _, ok := fieldSeen[contact.FieldCompany]; !ok { + selectedFields = append(selectedFields, contact.FieldCompany) + fieldSeen[contact.FieldCompany] = struct{}{} + } + case "email": + if _, ok := fieldSeen[contact.FieldEmail]; !ok { + selectedFields = append(selectedFields, contact.FieldEmail) + fieldSeen[contact.FieldEmail] = struct{}{} + } + case "phoneNumber": + if _, ok := fieldSeen[contact.FieldPhoneNumber]; !ok { + selectedFields = append(selectedFields, contact.FieldPhoneNumber) + fieldSeen[contact.FieldPhoneNumber] = struct{}{} + } + case "address": + if _, ok := fieldSeen[contact.FieldAddress]; !ok { + selectedFields = append(selectedFields, contact.FieldAddress) + fieldSeen[contact.FieldAddress] = struct{}{} + } + case "status": + if _, ok := fieldSeen[contact.FieldStatus]; !ok { + selectedFields = append(selectedFields, contact.FieldStatus) + fieldSeen[contact.FieldStatus] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + c.Select(selectedFields...) + } + return nil +} + +type contactPaginateArgs struct { + first, last *int + after, before *Cursor + opts []ContactPaginateOption +} + +func newContactPaginateArgs(rv map[string]any) *contactPaginateArgs { + args := &contactPaginateArgs{} + 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].(*ContactWhereInput); ok { + args.opts = append(args.opts, WithContactFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ch *ContactHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*ContactHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ch, nil + } + if err := ch.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ch, nil +} + +func (ch *ContactHistoryQuery) 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(contacthistory.Columns)) + selectedFields = []string{contacthistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[contacthistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldHistoryTime) + fieldSeen[contacthistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[contacthistory.FieldRef]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldRef) + fieldSeen[contacthistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[contacthistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldOperation) + fieldSeen[contacthistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[contacthistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldCreatedAt) + fieldSeen[contacthistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[contacthistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldUpdatedAt) + fieldSeen[contacthistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[contacthistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldCreatedBy) + fieldSeen[contacthistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[contacthistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldUpdatedBy) + fieldSeen[contacthistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[contacthistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldDeletedAt) + fieldSeen[contacthistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[contacthistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldDeletedBy) + fieldSeen[contacthistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[contacthistory.FieldTags]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldTags) + fieldSeen[contacthistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[contacthistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldOwnerID) + fieldSeen[contacthistory.FieldOwnerID] = struct{}{} + } + case "fullName": + if _, ok := fieldSeen[contacthistory.FieldFullName]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldFullName) + fieldSeen[contacthistory.FieldFullName] = struct{}{} + } + case "title": + if _, ok := fieldSeen[contacthistory.FieldTitle]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldTitle) + fieldSeen[contacthistory.FieldTitle] = struct{}{} + } + case "company": + if _, ok := fieldSeen[contacthistory.FieldCompany]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldCompany) + fieldSeen[contacthistory.FieldCompany] = struct{}{} + } + case "email": + if _, ok := fieldSeen[contacthistory.FieldEmail]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldEmail) + fieldSeen[contacthistory.FieldEmail] = struct{}{} + } + case "phoneNumber": + if _, ok := fieldSeen[contacthistory.FieldPhoneNumber]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldPhoneNumber) + fieldSeen[contacthistory.FieldPhoneNumber] = struct{}{} + } + case "address": + if _, ok := fieldSeen[contacthistory.FieldAddress]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldAddress) + fieldSeen[contacthistory.FieldAddress] = struct{}{} + } + case "status": + if _, ok := fieldSeen[contacthistory.FieldStatus]; !ok { + selectedFields = append(selectedFields, contacthistory.FieldStatus) + fieldSeen[contacthistory.FieldStatus] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ch.Select(selectedFields...) + } + return nil +} + +type contacthistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []ContactHistoryPaginateOption +} + +func newContactHistoryPaginateArgs(rv map[string]any) *contacthistoryPaginateArgs { + args := &contacthistoryPaginateArgs{} + 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].(*ContactHistoryWhereInput); ok { + args.opts = append(args.opts, WithContactHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (dd *DocumentDataQuery) CollectFields(ctx context.Context, satisfies ...string) (*DocumentDataQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return dd, nil + } + if err := dd.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return dd, nil +} + +func (dd *DocumentDataQuery) 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(documentdata.Columns)) + selectedFields = []string{documentdata.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: dd.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + dd.withOwner = query + if _, ok := fieldSeen[documentdata.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, documentdata.FieldOwnerID) + fieldSeen[documentdata.FieldOwnerID] = struct{}{} + } + + case "template": + var ( + alias = field.Alias + path = append(path, alias) + query = (&TemplateClient{config: dd.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, templateImplementors)...); err != nil { + return err + } + dd.withTemplate = query + if _, ok := fieldSeen[documentdata.FieldTemplateID]; !ok { + selectedFields = append(selectedFields, documentdata.FieldTemplateID) + fieldSeen[documentdata.FieldTemplateID] = struct{}{} + } + + case "entity": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityClient{config: dd.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entityImplementors)...); err != nil { + return err + } + dd.WithNamedEntity(alias, func(wq *EntityQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[documentdata.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, documentdata.FieldCreatedAt) + fieldSeen[documentdata.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[documentdata.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, documentdata.FieldUpdatedAt) + fieldSeen[documentdata.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[documentdata.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, documentdata.FieldCreatedBy) + fieldSeen[documentdata.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[documentdata.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, documentdata.FieldUpdatedBy) + fieldSeen[documentdata.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[documentdata.FieldTags]; !ok { + selectedFields = append(selectedFields, documentdata.FieldTags) + fieldSeen[documentdata.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[documentdata.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, documentdata.FieldDeletedAt) + fieldSeen[documentdata.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[documentdata.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, documentdata.FieldDeletedBy) + fieldSeen[documentdata.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[documentdata.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, documentdata.FieldOwnerID) + fieldSeen[documentdata.FieldOwnerID] = struct{}{} + } + case "templateID": + if _, ok := fieldSeen[documentdata.FieldTemplateID]; !ok { + selectedFields = append(selectedFields, documentdata.FieldTemplateID) + fieldSeen[documentdata.FieldTemplateID] = struct{}{} + } + case "data": + if _, ok := fieldSeen[documentdata.FieldData]; !ok { + selectedFields = append(selectedFields, documentdata.FieldData) + fieldSeen[documentdata.FieldData] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + dd.Select(selectedFields...) + } + return nil +} + +type documentdataPaginateArgs struct { + first, last *int + after, before *Cursor + opts []DocumentDataPaginateOption +} + +func newDocumentDataPaginateArgs(rv map[string]any) *documentdataPaginateArgs { + args := &documentdataPaginateArgs{} + 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].(*DocumentDataWhereInput); ok { + args.opts = append(args.opts, WithDocumentDataFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ddh *DocumentDataHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*DocumentDataHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ddh, nil + } + if err := ddh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ddh, nil +} + +func (ddh *DocumentDataHistoryQuery) 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(documentdatahistory.Columns)) + selectedFields = []string{documentdatahistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[documentdatahistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldHistoryTime) + fieldSeen[documentdatahistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[documentdatahistory.FieldRef]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldRef) + fieldSeen[documentdatahistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[documentdatahistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldOperation) + fieldSeen[documentdatahistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[documentdatahistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldCreatedAt) + fieldSeen[documentdatahistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[documentdatahistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldUpdatedAt) + fieldSeen[documentdatahistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[documentdatahistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldCreatedBy) + fieldSeen[documentdatahistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[documentdatahistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldUpdatedBy) + fieldSeen[documentdatahistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[documentdatahistory.FieldTags]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldTags) + fieldSeen[documentdatahistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[documentdatahistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldDeletedAt) + fieldSeen[documentdatahistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[documentdatahistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldDeletedBy) + fieldSeen[documentdatahistory.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[documentdatahistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldOwnerID) + fieldSeen[documentdatahistory.FieldOwnerID] = struct{}{} + } + case "templateID": + if _, ok := fieldSeen[documentdatahistory.FieldTemplateID]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldTemplateID) + fieldSeen[documentdatahistory.FieldTemplateID] = struct{}{} + } + case "data": + if _, ok := fieldSeen[documentdatahistory.FieldData]; !ok { + selectedFields = append(selectedFields, documentdatahistory.FieldData) + fieldSeen[documentdatahistory.FieldData] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ddh.Select(selectedFields...) + } + return nil +} + +type documentdatahistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []DocumentDataHistoryPaginateOption +} + +func newDocumentDataHistoryPaginateArgs(rv map[string]any) *documentdatahistoryPaginateArgs { + args := &documentdatahistoryPaginateArgs{} + 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].(*DocumentDataHistoryWhereInput); ok { + args.opts = append(args.opts, WithDocumentDataHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (e *EntitlementQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntitlementQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return e, nil + } + if err := e.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return e, nil +} + +func (e *EntitlementQuery) 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(entitlement.Columns)) + selectedFields = []string{entitlement.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + e.withOwner = query + if _, ok := fieldSeen[entitlement.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldOwnerID) + fieldSeen[entitlement.FieldOwnerID] = struct{}{} + } + + case "plan": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, entitlementplanImplementors)...); err != nil { + return err + } + e.withPlan = query + if _, ok := fieldSeen[entitlement.FieldPlanID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldPlanID) + fieldSeen[entitlement.FieldPlanID] = struct{}{} + } + + case "organization": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + e.withOrganization = query + if _, ok := fieldSeen[entitlement.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldOrganizationID) + fieldSeen[entitlement.FieldOrganizationID] = struct{}{} + } + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + e.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[entitlement.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitlement.FieldCreatedAt) + fieldSeen[entitlement.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitlement.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitlement.FieldUpdatedAt) + fieldSeen[entitlement.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitlement.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitlement.FieldCreatedBy) + fieldSeen[entitlement.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitlement.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitlement.FieldUpdatedBy) + fieldSeen[entitlement.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitlement.FieldTags]; !ok { + selectedFields = append(selectedFields, entitlement.FieldTags) + fieldSeen[entitlement.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitlement.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitlement.FieldDeletedAt) + fieldSeen[entitlement.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitlement.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitlement.FieldDeletedBy) + fieldSeen[entitlement.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitlement.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldOwnerID) + fieldSeen[entitlement.FieldOwnerID] = struct{}{} + } + case "planID": + if _, ok := fieldSeen[entitlement.FieldPlanID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldPlanID) + fieldSeen[entitlement.FieldPlanID] = struct{}{} + } + case "organizationID": + if _, ok := fieldSeen[entitlement.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldOrganizationID) + fieldSeen[entitlement.FieldOrganizationID] = struct{}{} + } + case "externalCustomerID": + if _, ok := fieldSeen[entitlement.FieldExternalCustomerID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldExternalCustomerID) + fieldSeen[entitlement.FieldExternalCustomerID] = struct{}{} + } + case "externalSubscriptionID": + if _, ok := fieldSeen[entitlement.FieldExternalSubscriptionID]; !ok { + selectedFields = append(selectedFields, entitlement.FieldExternalSubscriptionID) + fieldSeen[entitlement.FieldExternalSubscriptionID] = struct{}{} + } + case "expires": + if _, ok := fieldSeen[entitlement.FieldExpires]; !ok { + selectedFields = append(selectedFields, entitlement.FieldExpires) + fieldSeen[entitlement.FieldExpires] = struct{}{} + } + case "expiresAt": + if _, ok := fieldSeen[entitlement.FieldExpiresAt]; !ok { + selectedFields = append(selectedFields, entitlement.FieldExpiresAt) + fieldSeen[entitlement.FieldExpiresAt] = struct{}{} + } + case "cancelled": + if _, ok := fieldSeen[entitlement.FieldCancelled]; !ok { + selectedFields = append(selectedFields, entitlement.FieldCancelled) + fieldSeen[entitlement.FieldCancelled] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + e.Select(selectedFields...) + } + return nil +} + +type entitlementPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntitlementPaginateOption +} + +func newEntitlementPaginateArgs(rv map[string]any) *entitlementPaginateArgs { + args := &entitlementPaginateArgs{} + 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].(*EntitlementWhereInput); ok { + args.opts = append(args.opts, WithEntitlementFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (eh *EntitlementHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntitlementHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return eh, nil + } + if err := eh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return eh, nil +} + +func (eh *EntitlementHistoryQuery) 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(entitlementhistory.Columns)) + selectedFields = []string{entitlementhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[entitlementhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldHistoryTime) + fieldSeen[entitlementhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[entitlementhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldRef) + fieldSeen[entitlementhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[entitlementhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldOperation) + fieldSeen[entitlementhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[entitlementhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldCreatedAt) + fieldSeen[entitlementhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitlementhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldUpdatedAt) + fieldSeen[entitlementhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitlementhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldCreatedBy) + fieldSeen[entitlementhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitlementhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldUpdatedBy) + fieldSeen[entitlementhistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitlementhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldTags) + fieldSeen[entitlementhistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitlementhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldDeletedAt) + fieldSeen[entitlementhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitlementhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldDeletedBy) + fieldSeen[entitlementhistory.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitlementhistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldOwnerID) + fieldSeen[entitlementhistory.FieldOwnerID] = struct{}{} + } + case "planID": + if _, ok := fieldSeen[entitlementhistory.FieldPlanID]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldPlanID) + fieldSeen[entitlementhistory.FieldPlanID] = struct{}{} + } + case "organizationID": + if _, ok := fieldSeen[entitlementhistory.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldOrganizationID) + fieldSeen[entitlementhistory.FieldOrganizationID] = struct{}{} + } + case "externalCustomerID": + if _, ok := fieldSeen[entitlementhistory.FieldExternalCustomerID]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldExternalCustomerID) + fieldSeen[entitlementhistory.FieldExternalCustomerID] = struct{}{} + } + case "externalSubscriptionID": + if _, ok := fieldSeen[entitlementhistory.FieldExternalSubscriptionID]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldExternalSubscriptionID) + fieldSeen[entitlementhistory.FieldExternalSubscriptionID] = struct{}{} + } + case "expires": + if _, ok := fieldSeen[entitlementhistory.FieldExpires]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldExpires) + fieldSeen[entitlementhistory.FieldExpires] = struct{}{} + } + case "expiresAt": + if _, ok := fieldSeen[entitlementhistory.FieldExpiresAt]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldExpiresAt) + fieldSeen[entitlementhistory.FieldExpiresAt] = struct{}{} + } + case "cancelled": + if _, ok := fieldSeen[entitlementhistory.FieldCancelled]; !ok { + selectedFields = append(selectedFields, entitlementhistory.FieldCancelled) + fieldSeen[entitlementhistory.FieldCancelled] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + eh.Select(selectedFields...) + } + return nil +} + +type entitlementhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntitlementHistoryPaginateOption +} + +func newEntitlementHistoryPaginateArgs(rv map[string]any) *entitlementhistoryPaginateArgs { + args := &entitlementhistoryPaginateArgs{} + 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].(*EntitlementHistoryWhereInput); ok { + args.opts = append(args.opts, WithEntitlementHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ep *EntitlementPlanQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntitlementPlanQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ep, nil + } + if err := ep.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ep, nil +} + +func (ep *EntitlementPlanQuery) 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(entitlementplan.Columns)) + selectedFields = []string{entitlementplan.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: ep.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + ep.withOwner = query + if _, ok := fieldSeen[entitlementplan.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldOwnerID) + fieldSeen[entitlementplan.FieldOwnerID] = struct{}{} + } + + case "entitlements": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementClient{config: ep.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementImplementors)...); err != nil { + return err + } + ep.WithNamedEntitlements(alias, func(wq *EntitlementQuery) { + *wq = *query + }) + + case "baseFeatures": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FeatureClient{config: ep.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, featureImplementors)...); err != nil { + return err + } + ep.WithNamedBaseFeatures(alias, func(wq *FeatureQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: ep.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + ep.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + + case "features": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanFeatureClient{config: ep.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementplanfeatureImplementors)...); err != nil { + return err + } + ep.WithNamedFeatures(alias, func(wq *EntitlementPlanFeatureQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[entitlementplan.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldCreatedAt) + fieldSeen[entitlementplan.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitlementplan.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldUpdatedAt) + fieldSeen[entitlementplan.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitlementplan.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldCreatedBy) + fieldSeen[entitlementplan.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitlementplan.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldUpdatedBy) + fieldSeen[entitlementplan.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitlementplan.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldDeletedAt) + fieldSeen[entitlementplan.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitlementplan.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldDeletedBy) + fieldSeen[entitlementplan.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitlementplan.FieldTags]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldTags) + fieldSeen[entitlementplan.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitlementplan.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldOwnerID) + fieldSeen[entitlementplan.FieldOwnerID] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[entitlementplan.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldDisplayName) + fieldSeen[entitlementplan.FieldDisplayName] = struct{}{} + } + case "name": + if _, ok := fieldSeen[entitlementplan.FieldName]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldName) + fieldSeen[entitlementplan.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[entitlementplan.FieldDescription]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldDescription) + fieldSeen[entitlementplan.FieldDescription] = struct{}{} + } + case "version": + if _, ok := fieldSeen[entitlementplan.FieldVersion]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldVersion) + fieldSeen[entitlementplan.FieldVersion] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[entitlementplan.FieldMetadata]; !ok { + selectedFields = append(selectedFields, entitlementplan.FieldMetadata) + fieldSeen[entitlementplan.FieldMetadata] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ep.Select(selectedFields...) + } + return nil +} + +type entitlementplanPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntitlementPlanPaginateOption +} + +func newEntitlementPlanPaginateArgs(rv map[string]any) *entitlementplanPaginateArgs { + args := &entitlementplanPaginateArgs{} + 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].(*EntitlementPlanWhereInput); ok { + args.opts = append(args.opts, WithEntitlementPlanFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (epf *EntitlementPlanFeatureQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntitlementPlanFeatureQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return epf, nil + } + if err := epf.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return epf, nil +} + +func (epf *EntitlementPlanFeatureQuery) 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(entitlementplanfeature.Columns)) + selectedFields = []string{entitlementplanfeature.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: epf.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + epf.withOwner = query + if _, ok := fieldSeen[entitlementplanfeature.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldOwnerID) + fieldSeen[entitlementplanfeature.FieldOwnerID] = struct{}{} + } + + case "plan": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanClient{config: epf.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, entitlementplanImplementors)...); err != nil { + return err + } + epf.withPlan = query + if _, ok := fieldSeen[entitlementplanfeature.FieldPlanID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldPlanID) + fieldSeen[entitlementplanfeature.FieldPlanID] = struct{}{} + } + + case "feature": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FeatureClient{config: epf.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, featureImplementors)...); err != nil { + return err + } + epf.withFeature = query + if _, ok := fieldSeen[entitlementplanfeature.FieldFeatureID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldFeatureID) + fieldSeen[entitlementplanfeature.FieldFeatureID] = struct{}{} + } + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: epf.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + epf.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[entitlementplanfeature.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldCreatedAt) + fieldSeen[entitlementplanfeature.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitlementplanfeature.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldUpdatedAt) + fieldSeen[entitlementplanfeature.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitlementplanfeature.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldCreatedBy) + fieldSeen[entitlementplanfeature.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitlementplanfeature.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldUpdatedBy) + fieldSeen[entitlementplanfeature.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitlementplanfeature.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldDeletedAt) + fieldSeen[entitlementplanfeature.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitlementplanfeature.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldDeletedBy) + fieldSeen[entitlementplanfeature.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitlementplanfeature.FieldTags]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldTags) + fieldSeen[entitlementplanfeature.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitlementplanfeature.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldOwnerID) + fieldSeen[entitlementplanfeature.FieldOwnerID] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[entitlementplanfeature.FieldMetadata]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldMetadata) + fieldSeen[entitlementplanfeature.FieldMetadata] = struct{}{} + } + case "planID": + if _, ok := fieldSeen[entitlementplanfeature.FieldPlanID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldPlanID) + fieldSeen[entitlementplanfeature.FieldPlanID] = struct{}{} + } + case "featureID": + if _, ok := fieldSeen[entitlementplanfeature.FieldFeatureID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeature.FieldFeatureID) + fieldSeen[entitlementplanfeature.FieldFeatureID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + epf.Select(selectedFields...) + } + return nil +} + +type entitlementplanfeaturePaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntitlementPlanFeaturePaginateOption +} + +func newEntitlementPlanFeaturePaginateArgs(rv map[string]any) *entitlementplanfeaturePaginateArgs { + args := &entitlementplanfeaturePaginateArgs{} + 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].(*EntitlementPlanFeatureWhereInput); ok { + args.opts = append(args.opts, WithEntitlementPlanFeatureFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (epfh *EntitlementPlanFeatureHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntitlementPlanFeatureHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return epfh, nil + } + if err := epfh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return epfh, nil +} + +func (epfh *EntitlementPlanFeatureHistoryQuery) 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(entitlementplanfeaturehistory.Columns)) + selectedFields = []string{entitlementplanfeaturehistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldHistoryTime) + fieldSeen[entitlementplanfeaturehistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldRef]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldRef) + fieldSeen[entitlementplanfeaturehistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldOperation) + fieldSeen[entitlementplanfeaturehistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldCreatedAt) + fieldSeen[entitlementplanfeaturehistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldUpdatedAt) + fieldSeen[entitlementplanfeaturehistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldCreatedBy) + fieldSeen[entitlementplanfeaturehistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldUpdatedBy) + fieldSeen[entitlementplanfeaturehistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldDeletedAt) + fieldSeen[entitlementplanfeaturehistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldDeletedBy) + fieldSeen[entitlementplanfeaturehistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldTags]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldTags) + fieldSeen[entitlementplanfeaturehistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldOwnerID) + fieldSeen[entitlementplanfeaturehistory.FieldOwnerID] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldMetadata]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldMetadata) + fieldSeen[entitlementplanfeaturehistory.FieldMetadata] = struct{}{} + } + case "planID": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldPlanID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldPlanID) + fieldSeen[entitlementplanfeaturehistory.FieldPlanID] = struct{}{} + } + case "featureID": + if _, ok := fieldSeen[entitlementplanfeaturehistory.FieldFeatureID]; !ok { + selectedFields = append(selectedFields, entitlementplanfeaturehistory.FieldFeatureID) + fieldSeen[entitlementplanfeaturehistory.FieldFeatureID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + epfh.Select(selectedFields...) + } + return nil +} + +type entitlementplanfeaturehistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntitlementPlanFeatureHistoryPaginateOption +} + +func newEntitlementPlanFeatureHistoryPaginateArgs(rv map[string]any) *entitlementplanfeaturehistoryPaginateArgs { + args := &entitlementplanfeaturehistoryPaginateArgs{} + 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].(*EntitlementPlanFeatureHistoryWhereInput); ok { + args.opts = append(args.opts, WithEntitlementPlanFeatureHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (eph *EntitlementPlanHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntitlementPlanHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return eph, nil + } + if err := eph.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return eph, nil +} + +func (eph *EntitlementPlanHistoryQuery) 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(entitlementplanhistory.Columns)) + selectedFields = []string{entitlementplanhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[entitlementplanhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldHistoryTime) + fieldSeen[entitlementplanhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[entitlementplanhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldRef) + fieldSeen[entitlementplanhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[entitlementplanhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldOperation) + fieldSeen[entitlementplanhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[entitlementplanhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldCreatedAt) + fieldSeen[entitlementplanhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitlementplanhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldUpdatedAt) + fieldSeen[entitlementplanhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitlementplanhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldCreatedBy) + fieldSeen[entitlementplanhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitlementplanhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldUpdatedBy) + fieldSeen[entitlementplanhistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitlementplanhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldDeletedAt) + fieldSeen[entitlementplanhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitlementplanhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldDeletedBy) + fieldSeen[entitlementplanhistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitlementplanhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldTags) + fieldSeen[entitlementplanhistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitlementplanhistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldOwnerID) + fieldSeen[entitlementplanhistory.FieldOwnerID] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[entitlementplanhistory.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldDisplayName) + fieldSeen[entitlementplanhistory.FieldDisplayName] = struct{}{} + } + case "name": + if _, ok := fieldSeen[entitlementplanhistory.FieldName]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldName) + fieldSeen[entitlementplanhistory.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[entitlementplanhistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldDescription) + fieldSeen[entitlementplanhistory.FieldDescription] = struct{}{} + } + case "version": + if _, ok := fieldSeen[entitlementplanhistory.FieldVersion]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldVersion) + fieldSeen[entitlementplanhistory.FieldVersion] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[entitlementplanhistory.FieldMetadata]; !ok { + selectedFields = append(selectedFields, entitlementplanhistory.FieldMetadata) + fieldSeen[entitlementplanhistory.FieldMetadata] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + eph.Select(selectedFields...) + } + return nil +} + +type entitlementplanhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntitlementPlanHistoryPaginateOption +} + +func newEntitlementPlanHistoryPaginateArgs(rv map[string]any) *entitlementplanhistoryPaginateArgs { + args := &entitlementplanhistoryPaginateArgs{} + 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].(*EntitlementPlanHistoryWhereInput); ok { + args.opts = append(args.opts, WithEntitlementPlanHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (e *EntityQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntityQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return e, nil + } + if err := e.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return e, nil +} + +func (e *EntityQuery) 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(entity.Columns)) + selectedFields = []string{entity.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + e.withOwner = query + if _, ok := fieldSeen[entity.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entity.FieldOwnerID) + fieldSeen[entity.FieldOwnerID] = struct{}{} + } + + case "contacts": + var ( + alias = field.Alias + path = append(path, alias) + query = (&ContactClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, contactImplementors)...); err != nil { + return err + } + e.WithNamedContacts(alias, func(wq *ContactQuery) { + *wq = *query + }) + + case "documents": + var ( + alias = field.Alias + path = append(path, alias) + query = (&DocumentDataClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, documentdataImplementors)...); err != nil { + return err + } + e.WithNamedDocuments(alias, func(wq *DocumentDataQuery) { + *wq = *query + }) + + case "notes": + var ( + alias = field.Alias + path = append(path, alias) + query = (&NoteClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, noteImplementors)...); err != nil { + return err + } + e.WithNamedNotes(alias, func(wq *NoteQuery) { + *wq = *query + }) + + case "files": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FileClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, fileImplementors)...); err != nil { + return err + } + e.WithNamedFiles(alias, func(wq *FileQuery) { + *wq = *query + }) + + case "entityType": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityTypeClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, entitytypeImplementors)...); err != nil { + return err + } + e.withEntityType = query + if _, ok := fieldSeen[entity.FieldEntityTypeID]; !ok { + selectedFields = append(selectedFields, entity.FieldEntityTypeID) + fieldSeen[entity.FieldEntityTypeID] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[entity.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entity.FieldCreatedAt) + fieldSeen[entity.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entity.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entity.FieldUpdatedAt) + fieldSeen[entity.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entity.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entity.FieldCreatedBy) + fieldSeen[entity.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entity.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entity.FieldUpdatedBy) + fieldSeen[entity.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entity.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entity.FieldDeletedAt) + fieldSeen[entity.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entity.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entity.FieldDeletedBy) + fieldSeen[entity.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entity.FieldTags]; !ok { + selectedFields = append(selectedFields, entity.FieldTags) + fieldSeen[entity.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entity.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entity.FieldOwnerID) + fieldSeen[entity.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[entity.FieldName]; !ok { + selectedFields = append(selectedFields, entity.FieldName) + fieldSeen[entity.FieldName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[entity.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, entity.FieldDisplayName) + fieldSeen[entity.FieldDisplayName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[entity.FieldDescription]; !ok { + selectedFields = append(selectedFields, entity.FieldDescription) + fieldSeen[entity.FieldDescription] = struct{}{} + } + case "domains": + if _, ok := fieldSeen[entity.FieldDomains]; !ok { + selectedFields = append(selectedFields, entity.FieldDomains) + fieldSeen[entity.FieldDomains] = struct{}{} + } + case "entityTypeID": + if _, ok := fieldSeen[entity.FieldEntityTypeID]; !ok { + selectedFields = append(selectedFields, entity.FieldEntityTypeID) + fieldSeen[entity.FieldEntityTypeID] = struct{}{} + } + case "status": + if _, ok := fieldSeen[entity.FieldStatus]; !ok { + selectedFields = append(selectedFields, entity.FieldStatus) + fieldSeen[entity.FieldStatus] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + e.Select(selectedFields...) + } + return nil +} + +type entityPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntityPaginateOption +} + +func newEntityPaginateArgs(rv map[string]any) *entityPaginateArgs { + args := &entityPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &EntityOrder{Field: &EntityOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithEntityOrder(order)) + } + case *EntityOrder: + if v != nil { + args.opts = append(args.opts, WithEntityOrder(v)) + } + } + } + if v, ok := rv[whereField].(*EntityWhereInput); ok { + args.opts = append(args.opts, WithEntityFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (eh *EntityHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntityHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return eh, nil + } + if err := eh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return eh, nil +} + +func (eh *EntityHistoryQuery) 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(entityhistory.Columns)) + selectedFields = []string{entityhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[entityhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldHistoryTime) + fieldSeen[entityhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[entityhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldRef) + fieldSeen[entityhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[entityhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldOperation) + fieldSeen[entityhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[entityhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldCreatedAt) + fieldSeen[entityhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entityhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldUpdatedAt) + fieldSeen[entityhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entityhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldCreatedBy) + fieldSeen[entityhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entityhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldUpdatedBy) + fieldSeen[entityhistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entityhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldDeletedAt) + fieldSeen[entityhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entityhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldDeletedBy) + fieldSeen[entityhistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entityhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldTags) + fieldSeen[entityhistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entityhistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldOwnerID) + fieldSeen[entityhistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[entityhistory.FieldName]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldName) + fieldSeen[entityhistory.FieldName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[entityhistory.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldDisplayName) + fieldSeen[entityhistory.FieldDisplayName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[entityhistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldDescription) + fieldSeen[entityhistory.FieldDescription] = struct{}{} + } + case "domains": + if _, ok := fieldSeen[entityhistory.FieldDomains]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldDomains) + fieldSeen[entityhistory.FieldDomains] = struct{}{} + } + case "entityTypeID": + if _, ok := fieldSeen[entityhistory.FieldEntityTypeID]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldEntityTypeID) + fieldSeen[entityhistory.FieldEntityTypeID] = struct{}{} + } + case "status": + if _, ok := fieldSeen[entityhistory.FieldStatus]; !ok { + selectedFields = append(selectedFields, entityhistory.FieldStatus) + fieldSeen[entityhistory.FieldStatus] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + eh.Select(selectedFields...) + } + return nil +} + +type entityhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntityHistoryPaginateOption +} + +func newEntityHistoryPaginateArgs(rv map[string]any) *entityhistoryPaginateArgs { + args := &entityhistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &EntityHistoryOrder{Field: &EntityHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithEntityHistoryOrder(order)) + } + case *EntityHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithEntityHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*EntityHistoryWhereInput); ok { + args.opts = append(args.opts, WithEntityHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (et *EntityTypeQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntityTypeQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return et, nil + } + if err := et.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return et, nil +} + +func (et *EntityTypeQuery) 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(entitytype.Columns)) + selectedFields = []string{entitytype.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: et.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + et.withOwner = query + if _, ok := fieldSeen[entitytype.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitytype.FieldOwnerID) + fieldSeen[entitytype.FieldOwnerID] = struct{}{} + } + + case "entities": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityClient{config: et.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entityImplementors)...); err != nil { + return err + } + et.WithNamedEntities(alias, func(wq *EntityQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[entitytype.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitytype.FieldCreatedAt) + fieldSeen[entitytype.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitytype.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitytype.FieldUpdatedAt) + fieldSeen[entitytype.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitytype.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitytype.FieldCreatedBy) + fieldSeen[entitytype.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitytype.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitytype.FieldUpdatedBy) + fieldSeen[entitytype.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitytype.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitytype.FieldDeletedAt) + fieldSeen[entitytype.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitytype.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitytype.FieldDeletedBy) + fieldSeen[entitytype.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitytype.FieldTags]; !ok { + selectedFields = append(selectedFields, entitytype.FieldTags) + fieldSeen[entitytype.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitytype.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitytype.FieldOwnerID) + fieldSeen[entitytype.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[entitytype.FieldName]; !ok { + selectedFields = append(selectedFields, entitytype.FieldName) + fieldSeen[entitytype.FieldName] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + et.Select(selectedFields...) + } + return nil +} + +type entitytypePaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntityTypePaginateOption +} + +func newEntityTypePaginateArgs(rv map[string]any) *entitytypePaginateArgs { + args := &entitytypePaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &EntityTypeOrder{Field: &EntityTypeOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithEntityTypeOrder(order)) + } + case *EntityTypeOrder: + if v != nil { + args.opts = append(args.opts, WithEntityTypeOrder(v)) + } + } + } + if v, ok := rv[whereField].(*EntityTypeWhereInput); ok { + args.opts = append(args.opts, WithEntityTypeFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (eth *EntityTypeHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*EntityTypeHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return eth, nil + } + if err := eth.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return eth, nil +} + +func (eth *EntityTypeHistoryQuery) 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(entitytypehistory.Columns)) + selectedFields = []string{entitytypehistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[entitytypehistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldHistoryTime) + fieldSeen[entitytypehistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[entitytypehistory.FieldRef]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldRef) + fieldSeen[entitytypehistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[entitytypehistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldOperation) + fieldSeen[entitytypehistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[entitytypehistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldCreatedAt) + fieldSeen[entitytypehistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[entitytypehistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldUpdatedAt) + fieldSeen[entitytypehistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[entitytypehistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldCreatedBy) + fieldSeen[entitytypehistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[entitytypehistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldUpdatedBy) + fieldSeen[entitytypehistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[entitytypehistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldDeletedAt) + fieldSeen[entitytypehistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[entitytypehistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldDeletedBy) + fieldSeen[entitytypehistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[entitytypehistory.FieldTags]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldTags) + fieldSeen[entitytypehistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[entitytypehistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldOwnerID) + fieldSeen[entitytypehistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[entitytypehistory.FieldName]; !ok { + selectedFields = append(selectedFields, entitytypehistory.FieldName) + fieldSeen[entitytypehistory.FieldName] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + eth.Select(selectedFields...) + } + return nil +} + +type entitytypehistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EntityTypeHistoryPaginateOption +} + +func newEntityTypeHistoryPaginateArgs(rv map[string]any) *entitytypehistoryPaginateArgs { + args := &entitytypehistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &EntityTypeHistoryOrder{Field: &EntityTypeHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithEntityTypeHistoryOrder(order)) + } + case *EntityTypeHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithEntityTypeHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*EntityTypeHistoryWhereInput); ok { + args.opts = append(args.opts, WithEntityTypeHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (e *EventQuery) CollectFields(ctx context.Context, satisfies ...string) (*EventQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return e, nil + } + if err := e.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return e, nil +} + +func (e *EventQuery) 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(event.Columns)) + selectedFields = []string{event.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "user": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + e.WithNamedUser(alias, func(wq *UserQuery) { + *wq = *query + }) + + case "group": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, groupImplementors)...); err != nil { + return err + } + e.WithNamedGroup(alias, func(wq *GroupQuery) { + *wq = *query + }) + + case "integration": + var ( + alias = field.Alias + path = append(path, alias) + query = (&IntegrationClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, integrationImplementors)...); err != nil { + return err + } + e.WithNamedIntegration(alias, func(wq *IntegrationQuery) { + *wq = *query + }) + + case "organization": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + e.WithNamedOrganization(alias, func(wq *OrganizationQuery) { + *wq = *query + }) + + case "invite": + var ( + alias = field.Alias + path = append(path, alias) + query = (&InviteClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, inviteImplementors)...); err != nil { + return err + } + e.WithNamedInvite(alias, func(wq *InviteQuery) { + *wq = *query + }) + + case "feature": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FeatureClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, featureImplementors)...); err != nil { + return err + } + e.WithNamedFeature(alias, func(wq *FeatureQuery) { + *wq = *query + }) + + case "entitlementplan": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementplanImplementors)...); err != nil { + return err + } + e.WithNamedEntitlementplan(alias, func(wq *EntitlementPlanQuery) { + *wq = *query + }) + + case "entitlementplanfeature": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanFeatureClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementplanfeatureImplementors)...); err != nil { + return err + } + e.WithNamedEntitlementplanfeature(alias, func(wq *EntitlementPlanFeatureQuery) { + *wq = *query + }) + + case "personalAccessToken": + var ( + alias = field.Alias + path = append(path, alias) + query = (&PersonalAccessTokenClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, personalaccesstokenImplementors)...); err != nil { + return err + } + e.WithNamedPersonalAccessToken(alias, func(wq *PersonalAccessTokenQuery) { + *wq = *query + }) + + case "oauth2token": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OhAuthTooTokenClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, ohauthtootokenImplementors)...); err != nil { + return err + } + e.WithNamedOauth2token(alias, func(wq *OhAuthTooTokenQuery) { + *wq = *query + }) + + case "hush": + var ( + alias = field.Alias + path = append(path, alias) + query = (&HushClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, hushImplementors)...); err != nil { + return err + } + e.WithNamedHush(alias, func(wq *HushQuery) { + *wq = *query + }) + + case "orgmembership": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrgMembershipClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, orgmembershipImplementors)...); err != nil { + return err + } + e.WithNamedOrgmembership(alias, func(wq *OrgMembershipQuery) { + *wq = *query + }) + + case "groupmembership": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupMembershipClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, groupmembershipImplementors)...); err != nil { + return err + } + e.WithNamedGroupmembership(alias, func(wq *GroupMembershipQuery) { + *wq = *query + }) + + case "entitlement": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementImplementors)...); err != nil { + return err + } + e.WithNamedEntitlement(alias, func(wq *EntitlementQuery) { + *wq = *query + }) + + case "webhook": + var ( + alias = field.Alias + path = append(path, alias) + query = (&WebhookClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, webhookImplementors)...); err != nil { + return err + } + e.WithNamedWebhook(alias, func(wq *WebhookQuery) { + *wq = *query + }) + + case "subscriber": + var ( + alias = field.Alias + path = append(path, alias) + query = (&SubscriberClient{config: e.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, subscriberImplementors)...); err != nil { + return err + } + e.WithNamedSubscriber(alias, func(wq *SubscriberQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[event.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, event.FieldCreatedAt) + fieldSeen[event.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[event.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, event.FieldUpdatedAt) + fieldSeen[event.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[event.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, event.FieldCreatedBy) + fieldSeen[event.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[event.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, event.FieldUpdatedBy) + fieldSeen[event.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[event.FieldTags]; !ok { + selectedFields = append(selectedFields, event.FieldTags) + fieldSeen[event.FieldTags] = struct{}{} + } + case "eventID": + if _, ok := fieldSeen[event.FieldEventID]; !ok { + selectedFields = append(selectedFields, event.FieldEventID) + fieldSeen[event.FieldEventID] = struct{}{} + } + case "correlationID": + if _, ok := fieldSeen[event.FieldCorrelationID]; !ok { + selectedFields = append(selectedFields, event.FieldCorrelationID) + fieldSeen[event.FieldCorrelationID] = struct{}{} + } + case "eventType": + if _, ok := fieldSeen[event.FieldEventType]; !ok { + selectedFields = append(selectedFields, event.FieldEventType) + fieldSeen[event.FieldEventType] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[event.FieldMetadata]; !ok { + selectedFields = append(selectedFields, event.FieldMetadata) + fieldSeen[event.FieldMetadata] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + e.Select(selectedFields...) + } + return nil +} + +type eventPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EventPaginateOption +} + +func newEventPaginateArgs(rv map[string]any) *eventPaginateArgs { + args := &eventPaginateArgs{} + 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].(*EventWhereInput); ok { + args.opts = append(args.opts, WithEventFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (eh *EventHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*EventHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return eh, nil + } + if err := eh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return eh, nil +} + +func (eh *EventHistoryQuery) 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(eventhistory.Columns)) + selectedFields = []string{eventhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[eventhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldHistoryTime) + fieldSeen[eventhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[eventhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldRef) + fieldSeen[eventhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[eventhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldOperation) + fieldSeen[eventhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[eventhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldCreatedAt) + fieldSeen[eventhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[eventhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldUpdatedAt) + fieldSeen[eventhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[eventhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldCreatedBy) + fieldSeen[eventhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[eventhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldUpdatedBy) + fieldSeen[eventhistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[eventhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldTags) + fieldSeen[eventhistory.FieldTags] = struct{}{} + } + case "eventID": + if _, ok := fieldSeen[eventhistory.FieldEventID]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldEventID) + fieldSeen[eventhistory.FieldEventID] = struct{}{} + } + case "correlationID": + if _, ok := fieldSeen[eventhistory.FieldCorrelationID]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldCorrelationID) + fieldSeen[eventhistory.FieldCorrelationID] = struct{}{} + } + case "eventType": + if _, ok := fieldSeen[eventhistory.FieldEventType]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldEventType) + fieldSeen[eventhistory.FieldEventType] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[eventhistory.FieldMetadata]; !ok { + selectedFields = append(selectedFields, eventhistory.FieldMetadata) + fieldSeen[eventhistory.FieldMetadata] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + eh.Select(selectedFields...) + } + return nil +} + +type eventhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []EventHistoryPaginateOption +} + +func newEventHistoryPaginateArgs(rv map[string]any) *eventhistoryPaginateArgs { + args := &eventhistoryPaginateArgs{} + 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].(*EventHistoryWhereInput); ok { + args.opts = append(args.opts, WithEventHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (f *FeatureQuery) CollectFields(ctx context.Context, satisfies ...string) (*FeatureQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return f, nil + } + if err := f.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return f, nil +} + +func (f *FeatureQuery) 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(feature.Columns)) + selectedFields = []string{feature.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + f.withOwner = query + if _, ok := fieldSeen[feature.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, feature.FieldOwnerID) + fieldSeen[feature.FieldOwnerID] = struct{}{} + } + + case "plans": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementplanImplementors)...); err != nil { + return err + } + f.WithNamedPlans(alias, func(wq *EntitlementPlanQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + f.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + + case "features": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanFeatureClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementplanfeatureImplementors)...); err != nil { + return err + } + f.WithNamedFeatures(alias, func(wq *EntitlementPlanFeatureQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[feature.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, feature.FieldCreatedAt) + fieldSeen[feature.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[feature.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, feature.FieldUpdatedAt) + fieldSeen[feature.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[feature.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, feature.FieldCreatedBy) + fieldSeen[feature.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[feature.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, feature.FieldUpdatedBy) + fieldSeen[feature.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[feature.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, feature.FieldDeletedAt) + fieldSeen[feature.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[feature.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, feature.FieldDeletedBy) + fieldSeen[feature.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[feature.FieldTags]; !ok { + selectedFields = append(selectedFields, feature.FieldTags) + fieldSeen[feature.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[feature.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, feature.FieldOwnerID) + fieldSeen[feature.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[feature.FieldName]; !ok { + selectedFields = append(selectedFields, feature.FieldName) + fieldSeen[feature.FieldName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[feature.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, feature.FieldDisplayName) + fieldSeen[feature.FieldDisplayName] = struct{}{} + } + case "enabled": + if _, ok := fieldSeen[feature.FieldEnabled]; !ok { + selectedFields = append(selectedFields, feature.FieldEnabled) + fieldSeen[feature.FieldEnabled] = struct{}{} + } + case "description": + if _, ok := fieldSeen[feature.FieldDescription]; !ok { + selectedFields = append(selectedFields, feature.FieldDescription) + fieldSeen[feature.FieldDescription] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[feature.FieldMetadata]; !ok { + selectedFields = append(selectedFields, feature.FieldMetadata) + fieldSeen[feature.FieldMetadata] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + f.Select(selectedFields...) + } + return nil +} + +type featurePaginateArgs struct { + first, last *int + after, before *Cursor + opts []FeaturePaginateOption +} + +func newFeaturePaginateArgs(rv map[string]any) *featurePaginateArgs { + args := &featurePaginateArgs{} + 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].(*FeatureWhereInput); ok { + args.opts = append(args.opts, WithFeatureFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (fh *FeatureHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*FeatureHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return fh, nil + } + if err := fh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return fh, nil +} + +func (fh *FeatureHistoryQuery) 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(featurehistory.Columns)) + selectedFields = []string{featurehistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[featurehistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldHistoryTime) + fieldSeen[featurehistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[featurehistory.FieldRef]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldRef) + fieldSeen[featurehistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[featurehistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldOperation) + fieldSeen[featurehistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[featurehistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldCreatedAt) + fieldSeen[featurehistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[featurehistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldUpdatedAt) + fieldSeen[featurehistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[featurehistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldCreatedBy) + fieldSeen[featurehistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[featurehistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldUpdatedBy) + fieldSeen[featurehistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[featurehistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldDeletedAt) + fieldSeen[featurehistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[featurehistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldDeletedBy) + fieldSeen[featurehistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[featurehistory.FieldTags]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldTags) + fieldSeen[featurehistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[featurehistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldOwnerID) + fieldSeen[featurehistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[featurehistory.FieldName]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldName) + fieldSeen[featurehistory.FieldName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[featurehistory.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldDisplayName) + fieldSeen[featurehistory.FieldDisplayName] = struct{}{} + } + case "enabled": + if _, ok := fieldSeen[featurehistory.FieldEnabled]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldEnabled) + fieldSeen[featurehistory.FieldEnabled] = struct{}{} + } + case "description": + if _, ok := fieldSeen[featurehistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldDescription) + fieldSeen[featurehistory.FieldDescription] = struct{}{} + } + case "metadata": + if _, ok := fieldSeen[featurehistory.FieldMetadata]; !ok { + selectedFields = append(selectedFields, featurehistory.FieldMetadata) + fieldSeen[featurehistory.FieldMetadata] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + fh.Select(selectedFields...) + } + return nil +} + +type featurehistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []FeatureHistoryPaginateOption +} + +func newFeatureHistoryPaginateArgs(rv map[string]any) *featurehistoryPaginateArgs { + args := &featurehistoryPaginateArgs{} + 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].(*FeatureHistoryWhereInput); ok { + args.opts = append(args.opts, WithFeatureHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (f *FileQuery) CollectFields(ctx context.Context, satisfies ...string) (*FileQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return f, nil + } + if err := f.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return f, nil +} + +func (f *FileQuery) 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(file.Columns)) + selectedFields = []string{file.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "user": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + f.withUser = query + + case "organization": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + f.WithNamedOrganization(alias, func(wq *OrganizationQuery) { + *wq = *query + }) + + case "entity": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entityImplementors)...); err != nil { + return err + } + f.WithNamedEntity(alias, func(wq *EntityQuery) { + *wq = *query + }) + + case "group": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupClient{config: f.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, groupImplementors)...); err != nil { + return err + } + f.WithNamedGroup(alias, func(wq *GroupQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[file.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, file.FieldCreatedAt) + fieldSeen[file.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[file.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, file.FieldUpdatedAt) + fieldSeen[file.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[file.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, file.FieldCreatedBy) + fieldSeen[file.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[file.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, file.FieldUpdatedBy) + fieldSeen[file.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[file.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, file.FieldDeletedAt) + fieldSeen[file.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[file.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, file.FieldDeletedBy) + fieldSeen[file.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[file.FieldTags]; !ok { + selectedFields = append(selectedFields, file.FieldTags) + fieldSeen[file.FieldTags] = struct{}{} + } + case "fileName": + if _, ok := fieldSeen[file.FieldFileName]; !ok { + selectedFields = append(selectedFields, file.FieldFileName) + fieldSeen[file.FieldFileName] = struct{}{} + } + case "fileExtension": + if _, ok := fieldSeen[file.FieldFileExtension]; !ok { + selectedFields = append(selectedFields, file.FieldFileExtension) + fieldSeen[file.FieldFileExtension] = struct{}{} + } + case "fileSize": + if _, ok := fieldSeen[file.FieldFileSize]; !ok { + selectedFields = append(selectedFields, file.FieldFileSize) + fieldSeen[file.FieldFileSize] = struct{}{} + } + case "contentType": + if _, ok := fieldSeen[file.FieldContentType]; !ok { + selectedFields = append(selectedFields, file.FieldContentType) + fieldSeen[file.FieldContentType] = struct{}{} + } + case "storeKey": + if _, ok := fieldSeen[file.FieldStoreKey]; !ok { + selectedFields = append(selectedFields, file.FieldStoreKey) + fieldSeen[file.FieldStoreKey] = struct{}{} + } + case "category": + if _, ok := fieldSeen[file.FieldCategory]; !ok { + selectedFields = append(selectedFields, file.FieldCategory) + fieldSeen[file.FieldCategory] = struct{}{} + } + case "annotation": + if _, ok := fieldSeen[file.FieldAnnotation]; !ok { + selectedFields = append(selectedFields, file.FieldAnnotation) + fieldSeen[file.FieldAnnotation] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + f.Select(selectedFields...) + } + return nil +} + +type filePaginateArgs struct { + first, last *int + after, before *Cursor + opts []FilePaginateOption +} + +func newFilePaginateArgs(rv map[string]any) *filePaginateArgs { + args := &filePaginateArgs{} + 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].(*FileWhereInput); ok { + args.opts = append(args.opts, WithFileFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (fh *FileHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*FileHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return fh, nil + } + if err := fh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return fh, nil +} + +func (fh *FileHistoryQuery) 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(filehistory.Columns)) + selectedFields = []string{filehistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[filehistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, filehistory.FieldHistoryTime) + fieldSeen[filehistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[filehistory.FieldRef]; !ok { + selectedFields = append(selectedFields, filehistory.FieldRef) + fieldSeen[filehistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[filehistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, filehistory.FieldOperation) + fieldSeen[filehistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[filehistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, filehistory.FieldCreatedAt) + fieldSeen[filehistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[filehistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, filehistory.FieldUpdatedAt) + fieldSeen[filehistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[filehistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, filehistory.FieldCreatedBy) + fieldSeen[filehistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[filehistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, filehistory.FieldUpdatedBy) + fieldSeen[filehistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[filehistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, filehistory.FieldDeletedAt) + fieldSeen[filehistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[filehistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, filehistory.FieldDeletedBy) + fieldSeen[filehistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[filehistory.FieldTags]; !ok { + selectedFields = append(selectedFields, filehistory.FieldTags) + fieldSeen[filehistory.FieldTags] = struct{}{} + } + case "fileName": + if _, ok := fieldSeen[filehistory.FieldFileName]; !ok { + selectedFields = append(selectedFields, filehistory.FieldFileName) + fieldSeen[filehistory.FieldFileName] = struct{}{} + } + case "fileExtension": + if _, ok := fieldSeen[filehistory.FieldFileExtension]; !ok { + selectedFields = append(selectedFields, filehistory.FieldFileExtension) + fieldSeen[filehistory.FieldFileExtension] = struct{}{} + } + case "fileSize": + if _, ok := fieldSeen[filehistory.FieldFileSize]; !ok { + selectedFields = append(selectedFields, filehistory.FieldFileSize) + fieldSeen[filehistory.FieldFileSize] = struct{}{} + } + case "contentType": + if _, ok := fieldSeen[filehistory.FieldContentType]; !ok { + selectedFields = append(selectedFields, filehistory.FieldContentType) + fieldSeen[filehistory.FieldContentType] = struct{}{} + } + case "storeKey": + if _, ok := fieldSeen[filehistory.FieldStoreKey]; !ok { + selectedFields = append(selectedFields, filehistory.FieldStoreKey) + fieldSeen[filehistory.FieldStoreKey] = struct{}{} + } + case "category": + if _, ok := fieldSeen[filehistory.FieldCategory]; !ok { + selectedFields = append(selectedFields, filehistory.FieldCategory) + fieldSeen[filehistory.FieldCategory] = struct{}{} + } + case "annotation": + if _, ok := fieldSeen[filehistory.FieldAnnotation]; !ok { + selectedFields = append(selectedFields, filehistory.FieldAnnotation) + fieldSeen[filehistory.FieldAnnotation] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + fh.Select(selectedFields...) + } + return nil +} + +type filehistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []FileHistoryPaginateOption +} + +func newFileHistoryPaginateArgs(rv map[string]any) *filehistoryPaginateArgs { + args := &filehistoryPaginateArgs{} + 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].(*FileHistoryWhereInput); ok { + args.opts = append(args.opts, WithFileHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return gr, nil + } + if err := gr.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return gr, nil +} + +func (gr *GroupQuery) 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(group.Columns)) + selectedFields = []string{group.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: gr.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + gr.withOwner = query + if _, ok := fieldSeen[group.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, group.FieldOwnerID) + fieldSeen[group.FieldOwnerID] = struct{}{} + } + + case "setting": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupSettingClient{config: gr.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, groupsettingImplementors)...); err != nil { + return err + } + gr.withSetting = query + + case "users": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: gr.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + gr.WithNamedUsers(alias, func(wq *UserQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: gr.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + gr.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + + case "integrations": + var ( + alias = field.Alias + path = append(path, alias) + query = (&IntegrationClient{config: gr.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, integrationImplementors)...); err != nil { + return err + } + gr.WithNamedIntegrations(alias, func(wq *IntegrationQuery) { + *wq = *query + }) + + case "files": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FileClient{config: gr.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, fileImplementors)...); err != nil { + return err + } + gr.WithNamedFiles(alias, func(wq *FileQuery) { + *wq = *query + }) + + case "members": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupMembershipClient{config: gr.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, groupmembershipImplementors)...); err != nil { + return err + } + gr.WithNamedMembers(alias, func(wq *GroupMembershipQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[group.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, group.FieldCreatedAt) + fieldSeen[group.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[group.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, group.FieldUpdatedAt) + fieldSeen[group.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[group.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, group.FieldCreatedBy) + fieldSeen[group.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[group.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, group.FieldUpdatedBy) + fieldSeen[group.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[group.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, group.FieldDeletedAt) + fieldSeen[group.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[group.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, group.FieldDeletedBy) + fieldSeen[group.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[group.FieldTags]; !ok { + selectedFields = append(selectedFields, group.FieldTags) + fieldSeen[group.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[group.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, group.FieldOwnerID) + fieldSeen[group.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[group.FieldName]; !ok { + selectedFields = append(selectedFields, group.FieldName) + fieldSeen[group.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[group.FieldDescription]; !ok { + selectedFields = append(selectedFields, group.FieldDescription) + fieldSeen[group.FieldDescription] = struct{}{} + } + case "gravatarLogoURL": + if _, ok := fieldSeen[group.FieldGravatarLogoURL]; !ok { + selectedFields = append(selectedFields, group.FieldGravatarLogoURL) + fieldSeen[group.FieldGravatarLogoURL] = struct{}{} + } + case "logoURL": + if _, ok := fieldSeen[group.FieldLogoURL]; !ok { + selectedFields = append(selectedFields, group.FieldLogoURL) + fieldSeen[group.FieldLogoURL] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[group.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, group.FieldDisplayName) + fieldSeen[group.FieldDisplayName] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + gr.Select(selectedFields...) + } + return nil +} + +type groupPaginateArgs struct { + first, last *int + after, before *Cursor + opts []GroupPaginateOption +} + +func newGroupPaginateArgs(rv map[string]any) *groupPaginateArgs { + args := &groupPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &GroupOrder{Field: &GroupOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithGroupOrder(order)) + } + case *GroupOrder: + if v != nil { + args.opts = append(args.opts, WithGroupOrder(v)) + } + } + } + if v, ok := rv[whereField].(*GroupWhereInput); ok { + args.opts = append(args.opts, WithGroupFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (gh *GroupHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return gh, nil + } + if err := gh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return gh, nil +} + +func (gh *GroupHistoryQuery) 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(grouphistory.Columns)) + selectedFields = []string{grouphistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[grouphistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldHistoryTime) + fieldSeen[grouphistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[grouphistory.FieldRef]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldRef) + fieldSeen[grouphistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[grouphistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldOperation) + fieldSeen[grouphistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[grouphistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldCreatedAt) + fieldSeen[grouphistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[grouphistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldUpdatedAt) + fieldSeen[grouphistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[grouphistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldCreatedBy) + fieldSeen[grouphistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[grouphistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldUpdatedBy) + fieldSeen[grouphistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[grouphistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldDeletedAt) + fieldSeen[grouphistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[grouphistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldDeletedBy) + fieldSeen[grouphistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[grouphistory.FieldTags]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldTags) + fieldSeen[grouphistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[grouphistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldOwnerID) + fieldSeen[grouphistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[grouphistory.FieldName]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldName) + fieldSeen[grouphistory.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[grouphistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldDescription) + fieldSeen[grouphistory.FieldDescription] = struct{}{} + } + case "gravatarLogoURL": + if _, ok := fieldSeen[grouphistory.FieldGravatarLogoURL]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldGravatarLogoURL) + fieldSeen[grouphistory.FieldGravatarLogoURL] = struct{}{} + } + case "logoURL": + if _, ok := fieldSeen[grouphistory.FieldLogoURL]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldLogoURL) + fieldSeen[grouphistory.FieldLogoURL] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[grouphistory.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, grouphistory.FieldDisplayName) + fieldSeen[grouphistory.FieldDisplayName] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + gh.Select(selectedFields...) + } + return nil +} + +type grouphistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []GroupHistoryPaginateOption +} + +func newGroupHistoryPaginateArgs(rv map[string]any) *grouphistoryPaginateArgs { + args := &grouphistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &GroupHistoryOrder{Field: &GroupHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithGroupHistoryOrder(order)) + } + case *GroupHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithGroupHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*GroupHistoryWhereInput); ok { + args.opts = append(args.opts, WithGroupHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (gm *GroupMembershipQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupMembershipQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return gm, nil + } + if err := gm.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return gm, nil +} + +func (gm *GroupMembershipQuery) 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(groupmembership.Columns)) + selectedFields = []string{groupmembership.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "group": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupClient{config: gm.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, groupImplementors)...); err != nil { + return err + } + gm.withGroup = query + if _, ok := fieldSeen[groupmembership.FieldGroupID]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldGroupID) + fieldSeen[groupmembership.FieldGroupID] = struct{}{} + } + + case "user": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: gm.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + gm.withUser = query + if _, ok := fieldSeen[groupmembership.FieldUserID]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldUserID) + fieldSeen[groupmembership.FieldUserID] = struct{}{} + } + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: gm.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + gm.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[groupmembership.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldCreatedAt) + fieldSeen[groupmembership.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[groupmembership.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldUpdatedAt) + fieldSeen[groupmembership.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[groupmembership.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldCreatedBy) + fieldSeen[groupmembership.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[groupmembership.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldUpdatedBy) + fieldSeen[groupmembership.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[groupmembership.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldDeletedAt) + fieldSeen[groupmembership.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[groupmembership.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldDeletedBy) + fieldSeen[groupmembership.FieldDeletedBy] = struct{}{} + } + case "role": + if _, ok := fieldSeen[groupmembership.FieldRole]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldRole) + fieldSeen[groupmembership.FieldRole] = struct{}{} + } + case "groupID": + if _, ok := fieldSeen[groupmembership.FieldGroupID]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldGroupID) + fieldSeen[groupmembership.FieldGroupID] = struct{}{} + } + case "userID": + if _, ok := fieldSeen[groupmembership.FieldUserID]; !ok { + selectedFields = append(selectedFields, groupmembership.FieldUserID) + fieldSeen[groupmembership.FieldUserID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + gm.Select(selectedFields...) + } + return nil +} + +type groupmembershipPaginateArgs struct { + first, last *int + after, before *Cursor + opts []GroupMembershipPaginateOption +} + +func newGroupMembershipPaginateArgs(rv map[string]any) *groupmembershipPaginateArgs { + args := &groupmembershipPaginateArgs{} + 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].(*GroupMembershipWhereInput); ok { + args.opts = append(args.opts, WithGroupMembershipFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (gmh *GroupMembershipHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupMembershipHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return gmh, nil + } + if err := gmh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return gmh, nil +} + +func (gmh *GroupMembershipHistoryQuery) 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(groupmembershiphistory.Columns)) + selectedFields = []string{groupmembershiphistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[groupmembershiphistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldHistoryTime) + fieldSeen[groupmembershiphistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[groupmembershiphistory.FieldRef]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldRef) + fieldSeen[groupmembershiphistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[groupmembershiphistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldOperation) + fieldSeen[groupmembershiphistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[groupmembershiphistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldCreatedAt) + fieldSeen[groupmembershiphistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[groupmembershiphistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldUpdatedAt) + fieldSeen[groupmembershiphistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[groupmembershiphistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldCreatedBy) + fieldSeen[groupmembershiphistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[groupmembershiphistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldUpdatedBy) + fieldSeen[groupmembershiphistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[groupmembershiphistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldDeletedAt) + fieldSeen[groupmembershiphistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[groupmembershiphistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldDeletedBy) + fieldSeen[groupmembershiphistory.FieldDeletedBy] = struct{}{} + } + case "role": + if _, ok := fieldSeen[groupmembershiphistory.FieldRole]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldRole) + fieldSeen[groupmembershiphistory.FieldRole] = struct{}{} + } + case "groupID": + if _, ok := fieldSeen[groupmembershiphistory.FieldGroupID]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldGroupID) + fieldSeen[groupmembershiphistory.FieldGroupID] = struct{}{} + } + case "userID": + if _, ok := fieldSeen[groupmembershiphistory.FieldUserID]; !ok { + selectedFields = append(selectedFields, groupmembershiphistory.FieldUserID) + fieldSeen[groupmembershiphistory.FieldUserID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + gmh.Select(selectedFields...) + } + return nil +} + +type groupmembershiphistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []GroupMembershipHistoryPaginateOption +} + +func newGroupMembershipHistoryPaginateArgs(rv map[string]any) *groupmembershiphistoryPaginateArgs { + args := &groupmembershiphistoryPaginateArgs{} + 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].(*GroupMembershipHistoryWhereInput); ok { + args.opts = append(args.opts, WithGroupMembershipHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (gs *GroupSettingQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupSettingQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return gs, nil + } + if err := gs.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return gs, nil +} + +func (gs *GroupSettingQuery) 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(groupsetting.Columns)) + selectedFields = []string{groupsetting.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "group": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupClient{config: gs.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, groupImplementors)...); err != nil { + return err + } + gs.withGroup = query + if _, ok := fieldSeen[groupsetting.FieldGroupID]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldGroupID) + fieldSeen[groupsetting.FieldGroupID] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[groupsetting.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldCreatedAt) + fieldSeen[groupsetting.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[groupsetting.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldUpdatedAt) + fieldSeen[groupsetting.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[groupsetting.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldCreatedBy) + fieldSeen[groupsetting.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[groupsetting.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldUpdatedBy) + fieldSeen[groupsetting.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[groupsetting.FieldTags]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldTags) + fieldSeen[groupsetting.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[groupsetting.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldDeletedAt) + fieldSeen[groupsetting.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[groupsetting.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldDeletedBy) + fieldSeen[groupsetting.FieldDeletedBy] = struct{}{} + } + case "visibility": + if _, ok := fieldSeen[groupsetting.FieldVisibility]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldVisibility) + fieldSeen[groupsetting.FieldVisibility] = struct{}{} + } + case "joinPolicy": + if _, ok := fieldSeen[groupsetting.FieldJoinPolicy]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldJoinPolicy) + fieldSeen[groupsetting.FieldJoinPolicy] = struct{}{} + } + case "syncToSlack": + if _, ok := fieldSeen[groupsetting.FieldSyncToSlack]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldSyncToSlack) + fieldSeen[groupsetting.FieldSyncToSlack] = struct{}{} + } + case "syncToGithub": + if _, ok := fieldSeen[groupsetting.FieldSyncToGithub]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldSyncToGithub) + fieldSeen[groupsetting.FieldSyncToGithub] = struct{}{} + } + case "groupID": + if _, ok := fieldSeen[groupsetting.FieldGroupID]; !ok { + selectedFields = append(selectedFields, groupsetting.FieldGroupID) + fieldSeen[groupsetting.FieldGroupID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + gs.Select(selectedFields...) + } + return nil +} + +type groupsettingPaginateArgs struct { + first, last *int + after, before *Cursor + opts []GroupSettingPaginateOption +} + +func newGroupSettingPaginateArgs(rv map[string]any) *groupsettingPaginateArgs { + args := &groupsettingPaginateArgs{} + 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].(*GroupSettingWhereInput); ok { + args.opts = append(args.opts, WithGroupSettingFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (gsh *GroupSettingHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupSettingHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return gsh, nil + } + if err := gsh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return gsh, nil +} + +func (gsh *GroupSettingHistoryQuery) 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(groupsettinghistory.Columns)) + selectedFields = []string{groupsettinghistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[groupsettinghistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldHistoryTime) + fieldSeen[groupsettinghistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[groupsettinghistory.FieldRef]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldRef) + fieldSeen[groupsettinghistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[groupsettinghistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldOperation) + fieldSeen[groupsettinghistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[groupsettinghistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldCreatedAt) + fieldSeen[groupsettinghistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[groupsettinghistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldUpdatedAt) + fieldSeen[groupsettinghistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[groupsettinghistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldCreatedBy) + fieldSeen[groupsettinghistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[groupsettinghistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldUpdatedBy) + fieldSeen[groupsettinghistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[groupsettinghistory.FieldTags]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldTags) + fieldSeen[groupsettinghistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[groupsettinghistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldDeletedAt) + fieldSeen[groupsettinghistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[groupsettinghistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldDeletedBy) + fieldSeen[groupsettinghistory.FieldDeletedBy] = struct{}{} + } + case "visibility": + if _, ok := fieldSeen[groupsettinghistory.FieldVisibility]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldVisibility) + fieldSeen[groupsettinghistory.FieldVisibility] = struct{}{} + } + case "joinPolicy": + if _, ok := fieldSeen[groupsettinghistory.FieldJoinPolicy]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldJoinPolicy) + fieldSeen[groupsettinghistory.FieldJoinPolicy] = struct{}{} + } + case "syncToSlack": + if _, ok := fieldSeen[groupsettinghistory.FieldSyncToSlack]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldSyncToSlack) + fieldSeen[groupsettinghistory.FieldSyncToSlack] = struct{}{} + } + case "syncToGithub": + if _, ok := fieldSeen[groupsettinghistory.FieldSyncToGithub]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldSyncToGithub) + fieldSeen[groupsettinghistory.FieldSyncToGithub] = struct{}{} + } + case "groupID": + if _, ok := fieldSeen[groupsettinghistory.FieldGroupID]; !ok { + selectedFields = append(selectedFields, groupsettinghistory.FieldGroupID) + fieldSeen[groupsettinghistory.FieldGroupID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + gsh.Select(selectedFields...) + } + return nil +} + +type groupsettinghistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []GroupSettingHistoryPaginateOption +} + +func newGroupSettingHistoryPaginateArgs(rv map[string]any) *groupsettinghistoryPaginateArgs { + args := &groupsettinghistoryPaginateArgs{} + 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].(*GroupSettingHistoryWhereInput); ok { + args.opts = append(args.opts, WithGroupSettingHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (h *HushQuery) CollectFields(ctx context.Context, satisfies ...string) (*HushQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return h, nil + } + if err := h.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return h, nil +} + +func (h *HushQuery) 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(hush.Columns)) + selectedFields = []string{hush.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "integrations": + var ( + alias = field.Alias + path = append(path, alias) + query = (&IntegrationClient{config: h.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, integrationImplementors)...); err != nil { + return err + } + h.WithNamedIntegrations(alias, func(wq *IntegrationQuery) { + *wq = *query + }) + + case "organization": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: h.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + h.WithNamedOrganization(alias, func(wq *OrganizationQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: h.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + h.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[hush.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, hush.FieldCreatedAt) + fieldSeen[hush.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[hush.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, hush.FieldUpdatedAt) + fieldSeen[hush.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[hush.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, hush.FieldCreatedBy) + fieldSeen[hush.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[hush.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, hush.FieldUpdatedBy) + fieldSeen[hush.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[hush.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, hush.FieldDeletedAt) + fieldSeen[hush.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[hush.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, hush.FieldDeletedBy) + fieldSeen[hush.FieldDeletedBy] = struct{}{} + } + case "name": + if _, ok := fieldSeen[hush.FieldName]; !ok { + selectedFields = append(selectedFields, hush.FieldName) + fieldSeen[hush.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[hush.FieldDescription]; !ok { + selectedFields = append(selectedFields, hush.FieldDescription) + fieldSeen[hush.FieldDescription] = struct{}{} + } + case "kind": + if _, ok := fieldSeen[hush.FieldKind]; !ok { + selectedFields = append(selectedFields, hush.FieldKind) + fieldSeen[hush.FieldKind] = struct{}{} + } + case "secretName": + if _, ok := fieldSeen[hush.FieldSecretName]; !ok { + selectedFields = append(selectedFields, hush.FieldSecretName) + fieldSeen[hush.FieldSecretName] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + h.Select(selectedFields...) + } + return nil +} + +type hushPaginateArgs struct { + first, last *int + after, before *Cursor + opts []HushPaginateOption +} + +func newHushPaginateArgs(rv map[string]any) *hushPaginateArgs { + args := &hushPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &HushOrder{Field: &HushOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithHushOrder(order)) + } + case *HushOrder: + if v != nil { + args.opts = append(args.opts, WithHushOrder(v)) + } + } + } + if v, ok := rv[whereField].(*HushWhereInput); ok { + args.opts = append(args.opts, WithHushFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (hh *HushHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*HushHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return hh, nil + } + if err := hh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return hh, nil +} + +func (hh *HushHistoryQuery) 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(hushhistory.Columns)) + selectedFields = []string{hushhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[hushhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldHistoryTime) + fieldSeen[hushhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[hushhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldRef) + fieldSeen[hushhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[hushhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldOperation) + fieldSeen[hushhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[hushhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldCreatedAt) + fieldSeen[hushhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[hushhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldUpdatedAt) + fieldSeen[hushhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[hushhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldCreatedBy) + fieldSeen[hushhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[hushhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldUpdatedBy) + fieldSeen[hushhistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[hushhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldDeletedAt) + fieldSeen[hushhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[hushhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldDeletedBy) + fieldSeen[hushhistory.FieldDeletedBy] = struct{}{} + } + case "name": + if _, ok := fieldSeen[hushhistory.FieldName]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldName) + fieldSeen[hushhistory.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[hushhistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldDescription) + fieldSeen[hushhistory.FieldDescription] = struct{}{} + } + case "kind": + if _, ok := fieldSeen[hushhistory.FieldKind]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldKind) + fieldSeen[hushhistory.FieldKind] = struct{}{} + } + case "secretName": + if _, ok := fieldSeen[hushhistory.FieldSecretName]; !ok { + selectedFields = append(selectedFields, hushhistory.FieldSecretName) + fieldSeen[hushhistory.FieldSecretName] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + hh.Select(selectedFields...) + } + return nil +} + +type hushhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []HushHistoryPaginateOption +} + +func newHushHistoryPaginateArgs(rv map[string]any) *hushhistoryPaginateArgs { + args := &hushhistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &HushHistoryOrder{Field: &HushHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithHushHistoryOrder(order)) + } + case *HushHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithHushHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*HushHistoryWhereInput); ok { + args.opts = append(args.opts, WithHushHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (i *IntegrationQuery) CollectFields(ctx context.Context, satisfies ...string) (*IntegrationQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return i, nil + } + if err := i.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return i, nil +} + +func (i *IntegrationQuery) 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(integration.Columns)) + selectedFields = []string{integration.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: i.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + i.withOwner = query + if _, ok := fieldSeen[integration.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, integration.FieldOwnerID) + fieldSeen[integration.FieldOwnerID] = struct{}{} + } + + case "secrets": + var ( + alias = field.Alias + path = append(path, alias) + query = (&HushClient{config: i.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, hushImplementors)...); err != nil { + return err + } + i.WithNamedSecrets(alias, func(wq *HushQuery) { + *wq = *query + }) + + case "oauth2tokens": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OhAuthTooTokenClient{config: i.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, ohauthtootokenImplementors)...); err != nil { + return err + } + i.WithNamedOauth2tokens(alias, func(wq *OhAuthTooTokenQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: i.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + i.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + + case "webhooks": + var ( + alias = field.Alias + path = append(path, alias) + query = (&WebhookClient{config: i.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, webhookImplementors)...); err != nil { + return err + } + i.WithNamedWebhooks(alias, func(wq *WebhookQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[integration.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, integration.FieldCreatedAt) + fieldSeen[integration.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[integration.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, integration.FieldUpdatedAt) + fieldSeen[integration.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[integration.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, integration.FieldCreatedBy) + fieldSeen[integration.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[integration.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, integration.FieldUpdatedBy) + fieldSeen[integration.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[integration.FieldTags]; !ok { + selectedFields = append(selectedFields, integration.FieldTags) + fieldSeen[integration.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[integration.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, integration.FieldDeletedAt) + fieldSeen[integration.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[integration.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, integration.FieldDeletedBy) + fieldSeen[integration.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[integration.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, integration.FieldOwnerID) + fieldSeen[integration.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[integration.FieldName]; !ok { + selectedFields = append(selectedFields, integration.FieldName) + fieldSeen[integration.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[integration.FieldDescription]; !ok { + selectedFields = append(selectedFields, integration.FieldDescription) + fieldSeen[integration.FieldDescription] = struct{}{} + } + case "kind": + if _, ok := fieldSeen[integration.FieldKind]; !ok { + selectedFields = append(selectedFields, integration.FieldKind) + fieldSeen[integration.FieldKind] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + i.Select(selectedFields...) + } + return nil +} + +type integrationPaginateArgs struct { + first, last *int + after, before *Cursor + opts []IntegrationPaginateOption +} + +func newIntegrationPaginateArgs(rv map[string]any) *integrationPaginateArgs { + args := &integrationPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &IntegrationOrder{Field: &IntegrationOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithIntegrationOrder(order)) + } + case *IntegrationOrder: + if v != nil { + args.opts = append(args.opts, WithIntegrationOrder(v)) + } + } + } + if v, ok := rv[whereField].(*IntegrationWhereInput); ok { + args.opts = append(args.opts, WithIntegrationFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ih *IntegrationHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*IntegrationHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ih, nil + } + if err := ih.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ih, nil +} + +func (ih *IntegrationHistoryQuery) 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(integrationhistory.Columns)) + selectedFields = []string{integrationhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[integrationhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldHistoryTime) + fieldSeen[integrationhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[integrationhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldRef) + fieldSeen[integrationhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[integrationhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldOperation) + fieldSeen[integrationhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[integrationhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldCreatedAt) + fieldSeen[integrationhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[integrationhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldUpdatedAt) + fieldSeen[integrationhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[integrationhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldCreatedBy) + fieldSeen[integrationhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[integrationhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldUpdatedBy) + fieldSeen[integrationhistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[integrationhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldTags) + fieldSeen[integrationhistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[integrationhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldDeletedAt) + fieldSeen[integrationhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[integrationhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldDeletedBy) + fieldSeen[integrationhistory.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[integrationhistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldOwnerID) + fieldSeen[integrationhistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[integrationhistory.FieldName]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldName) + fieldSeen[integrationhistory.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[integrationhistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldDescription) + fieldSeen[integrationhistory.FieldDescription] = struct{}{} + } + case "kind": + if _, ok := fieldSeen[integrationhistory.FieldKind]; !ok { + selectedFields = append(selectedFields, integrationhistory.FieldKind) + fieldSeen[integrationhistory.FieldKind] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ih.Select(selectedFields...) + } + return nil +} + +type integrationhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []IntegrationHistoryPaginateOption +} + +func newIntegrationHistoryPaginateArgs(rv map[string]any) *integrationhistoryPaginateArgs { + args := &integrationhistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &IntegrationHistoryOrder{Field: &IntegrationHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithIntegrationHistoryOrder(order)) + } + case *IntegrationHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithIntegrationHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*IntegrationHistoryWhereInput); ok { + args.opts = append(args.opts, WithIntegrationHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (i *InviteQuery) CollectFields(ctx context.Context, satisfies ...string) (*InviteQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return i, nil + } + if err := i.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return i, nil +} + +func (i *InviteQuery) 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(invite.Columns)) + selectedFields = []string{invite.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: i.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + i.withOwner = query + if _, ok := fieldSeen[invite.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, invite.FieldOwnerID) + fieldSeen[invite.FieldOwnerID] = struct{}{} + } + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: i.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + i.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[invite.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, invite.FieldCreatedAt) + fieldSeen[invite.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[invite.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, invite.FieldUpdatedAt) + fieldSeen[invite.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[invite.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, invite.FieldCreatedBy) + fieldSeen[invite.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[invite.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, invite.FieldUpdatedBy) + fieldSeen[invite.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[invite.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, invite.FieldDeletedAt) + fieldSeen[invite.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[invite.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, invite.FieldDeletedBy) + fieldSeen[invite.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[invite.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, invite.FieldOwnerID) + fieldSeen[invite.FieldOwnerID] = struct{}{} + } + case "expires": + if _, ok := fieldSeen[invite.FieldExpires]; !ok { + selectedFields = append(selectedFields, invite.FieldExpires) + fieldSeen[invite.FieldExpires] = struct{}{} + } + case "recipient": + if _, ok := fieldSeen[invite.FieldRecipient]; !ok { + selectedFields = append(selectedFields, invite.FieldRecipient) + fieldSeen[invite.FieldRecipient] = struct{}{} + } + case "status": + if _, ok := fieldSeen[invite.FieldStatus]; !ok { + selectedFields = append(selectedFields, invite.FieldStatus) + fieldSeen[invite.FieldStatus] = struct{}{} + } + case "role": + if _, ok := fieldSeen[invite.FieldRole]; !ok { + selectedFields = append(selectedFields, invite.FieldRole) + fieldSeen[invite.FieldRole] = struct{}{} + } + case "sendAttempts": + if _, ok := fieldSeen[invite.FieldSendAttempts]; !ok { + selectedFields = append(selectedFields, invite.FieldSendAttempts) + fieldSeen[invite.FieldSendAttempts] = struct{}{} + } + case "requestorID": + if _, ok := fieldSeen[invite.FieldRequestorID]; !ok { + selectedFields = append(selectedFields, invite.FieldRequestorID) + fieldSeen[invite.FieldRequestorID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + i.Select(selectedFields...) + } + return nil +} + +type invitePaginateArgs struct { + first, last *int + after, before *Cursor + opts []InvitePaginateOption +} + +func newInvitePaginateArgs(rv map[string]any) *invitePaginateArgs { + args := &invitePaginateArgs{} + 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].(*InviteWhereInput); ok { + args.opts = append(args.opts, WithInviteFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (n *NoteQuery) CollectFields(ctx context.Context, satisfies ...string) (*NoteQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return n, nil + } + if err := n.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return n, nil +} + +func (n *NoteQuery) 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(note.Columns)) + selectedFields = []string{note.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: n.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + n.withOwner = query + if _, ok := fieldSeen[note.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, note.FieldOwnerID) + fieldSeen[note.FieldOwnerID] = struct{}{} + } + + case "entity": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityClient{config: n.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, entityImplementors)...); err != nil { + return err + } + n.withEntity = query + case "createdAt": + if _, ok := fieldSeen[note.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, note.FieldCreatedAt) + fieldSeen[note.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[note.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, note.FieldUpdatedAt) + fieldSeen[note.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[note.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, note.FieldCreatedBy) + fieldSeen[note.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[note.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, note.FieldUpdatedBy) + fieldSeen[note.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[note.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, note.FieldDeletedAt) + fieldSeen[note.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[note.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, note.FieldDeletedBy) + fieldSeen[note.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[note.FieldTags]; !ok { + selectedFields = append(selectedFields, note.FieldTags) + fieldSeen[note.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[note.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, note.FieldOwnerID) + fieldSeen[note.FieldOwnerID] = struct{}{} + } + case "text": + if _, ok := fieldSeen[note.FieldText]; !ok { + selectedFields = append(selectedFields, note.FieldText) + fieldSeen[note.FieldText] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + n.Select(selectedFields...) + } + return nil +} + +type notePaginateArgs struct { + first, last *int + after, before *Cursor + opts []NotePaginateOption +} + +func newNotePaginateArgs(rv map[string]any) *notePaginateArgs { + args := ¬ePaginateArgs{} + 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].(*NoteWhereInput); ok { + args.opts = append(args.opts, WithNoteFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (nh *NoteHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*NoteHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return nh, nil + } + if err := nh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return nh, nil +} + +func (nh *NoteHistoryQuery) 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(notehistory.Columns)) + selectedFields = []string{notehistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[notehistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, notehistory.FieldHistoryTime) + fieldSeen[notehistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[notehistory.FieldRef]; !ok { + selectedFields = append(selectedFields, notehistory.FieldRef) + fieldSeen[notehistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[notehistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, notehistory.FieldOperation) + fieldSeen[notehistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[notehistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, notehistory.FieldCreatedAt) + fieldSeen[notehistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[notehistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, notehistory.FieldUpdatedAt) + fieldSeen[notehistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[notehistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, notehistory.FieldCreatedBy) + fieldSeen[notehistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[notehistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, notehistory.FieldUpdatedBy) + fieldSeen[notehistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[notehistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, notehistory.FieldDeletedAt) + fieldSeen[notehistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[notehistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, notehistory.FieldDeletedBy) + fieldSeen[notehistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[notehistory.FieldTags]; !ok { + selectedFields = append(selectedFields, notehistory.FieldTags) + fieldSeen[notehistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[notehistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, notehistory.FieldOwnerID) + fieldSeen[notehistory.FieldOwnerID] = struct{}{} + } + case "text": + if _, ok := fieldSeen[notehistory.FieldText]; !ok { + selectedFields = append(selectedFields, notehistory.FieldText) + fieldSeen[notehistory.FieldText] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + nh.Select(selectedFields...) + } + return nil +} + +type notehistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []NoteHistoryPaginateOption +} + +func newNoteHistoryPaginateArgs(rv map[string]any) *notehistoryPaginateArgs { + args := ¬ehistoryPaginateArgs{} + 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].(*NoteHistoryWhereInput); ok { + args.opts = append(args.opts, WithNoteHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (op *OauthProviderQuery) CollectFields(ctx context.Context, satisfies ...string) (*OauthProviderQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return op, nil + } + if err := op.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return op, nil +} + +func (op *OauthProviderQuery) 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(oauthprovider.Columns)) + selectedFields = []string{oauthprovider.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: op.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + op.withOwner = query + if _, ok := fieldSeen[oauthprovider.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldOwnerID) + fieldSeen[oauthprovider.FieldOwnerID] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[oauthprovider.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldCreatedAt) + fieldSeen[oauthprovider.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[oauthprovider.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldUpdatedAt) + fieldSeen[oauthprovider.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[oauthprovider.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldCreatedBy) + fieldSeen[oauthprovider.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[oauthprovider.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldUpdatedBy) + fieldSeen[oauthprovider.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[oauthprovider.FieldTags]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldTags) + fieldSeen[oauthprovider.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[oauthprovider.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldDeletedAt) + fieldSeen[oauthprovider.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[oauthprovider.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldDeletedBy) + fieldSeen[oauthprovider.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[oauthprovider.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldOwnerID) + fieldSeen[oauthprovider.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[oauthprovider.FieldName]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldName) + fieldSeen[oauthprovider.FieldName] = struct{}{} + } + case "clientID": + if _, ok := fieldSeen[oauthprovider.FieldClientID]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldClientID) + fieldSeen[oauthprovider.FieldClientID] = struct{}{} + } + case "clientSecret": + if _, ok := fieldSeen[oauthprovider.FieldClientSecret]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldClientSecret) + fieldSeen[oauthprovider.FieldClientSecret] = struct{}{} + } + case "redirectURL": + if _, ok := fieldSeen[oauthprovider.FieldRedirectURL]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldRedirectURL) + fieldSeen[oauthprovider.FieldRedirectURL] = struct{}{} + } + case "scopes": + if _, ok := fieldSeen[oauthprovider.FieldScopes]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldScopes) + fieldSeen[oauthprovider.FieldScopes] = struct{}{} + } + case "authURL": + if _, ok := fieldSeen[oauthprovider.FieldAuthURL]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldAuthURL) + fieldSeen[oauthprovider.FieldAuthURL] = struct{}{} + } + case "tokenURL": + if _, ok := fieldSeen[oauthprovider.FieldTokenURL]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldTokenURL) + fieldSeen[oauthprovider.FieldTokenURL] = struct{}{} + } + case "authStyle": + if _, ok := fieldSeen[oauthprovider.FieldAuthStyle]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldAuthStyle) + fieldSeen[oauthprovider.FieldAuthStyle] = struct{}{} + } + case "infoURL": + if _, ok := fieldSeen[oauthprovider.FieldInfoURL]; !ok { + selectedFields = append(selectedFields, oauthprovider.FieldInfoURL) + fieldSeen[oauthprovider.FieldInfoURL] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + op.Select(selectedFields...) + } + return nil +} + +type oauthproviderPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OauthProviderPaginateOption +} + +func newOauthProviderPaginateArgs(rv map[string]any) *oauthproviderPaginateArgs { + args := &oauthproviderPaginateArgs{} + 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].(*OauthProviderWhereInput); ok { + args.opts = append(args.opts, WithOauthProviderFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (oph *OauthProviderHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*OauthProviderHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return oph, nil + } + if err := oph.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return oph, nil +} + +func (oph *OauthProviderHistoryQuery) 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(oauthproviderhistory.Columns)) + selectedFields = []string{oauthproviderhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[oauthproviderhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldHistoryTime) + fieldSeen[oauthproviderhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[oauthproviderhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldRef) + fieldSeen[oauthproviderhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[oauthproviderhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldOperation) + fieldSeen[oauthproviderhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[oauthproviderhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldCreatedAt) + fieldSeen[oauthproviderhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[oauthproviderhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldUpdatedAt) + fieldSeen[oauthproviderhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[oauthproviderhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldCreatedBy) + fieldSeen[oauthproviderhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[oauthproviderhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldUpdatedBy) + fieldSeen[oauthproviderhistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[oauthproviderhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldTags) + fieldSeen[oauthproviderhistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[oauthproviderhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldDeletedAt) + fieldSeen[oauthproviderhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[oauthproviderhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldDeletedBy) + fieldSeen[oauthproviderhistory.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[oauthproviderhistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldOwnerID) + fieldSeen[oauthproviderhistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[oauthproviderhistory.FieldName]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldName) + fieldSeen[oauthproviderhistory.FieldName] = struct{}{} + } + case "clientID": + if _, ok := fieldSeen[oauthproviderhistory.FieldClientID]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldClientID) + fieldSeen[oauthproviderhistory.FieldClientID] = struct{}{} + } + case "clientSecret": + if _, ok := fieldSeen[oauthproviderhistory.FieldClientSecret]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldClientSecret) + fieldSeen[oauthproviderhistory.FieldClientSecret] = struct{}{} + } + case "redirectURL": + if _, ok := fieldSeen[oauthproviderhistory.FieldRedirectURL]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldRedirectURL) + fieldSeen[oauthproviderhistory.FieldRedirectURL] = struct{}{} + } + case "scopes": + if _, ok := fieldSeen[oauthproviderhistory.FieldScopes]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldScopes) + fieldSeen[oauthproviderhistory.FieldScopes] = struct{}{} + } + case "authURL": + if _, ok := fieldSeen[oauthproviderhistory.FieldAuthURL]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldAuthURL) + fieldSeen[oauthproviderhistory.FieldAuthURL] = struct{}{} + } + case "tokenURL": + if _, ok := fieldSeen[oauthproviderhistory.FieldTokenURL]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldTokenURL) + fieldSeen[oauthproviderhistory.FieldTokenURL] = struct{}{} + } + case "authStyle": + if _, ok := fieldSeen[oauthproviderhistory.FieldAuthStyle]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldAuthStyle) + fieldSeen[oauthproviderhistory.FieldAuthStyle] = struct{}{} + } + case "infoURL": + if _, ok := fieldSeen[oauthproviderhistory.FieldInfoURL]; !ok { + selectedFields = append(selectedFields, oauthproviderhistory.FieldInfoURL) + fieldSeen[oauthproviderhistory.FieldInfoURL] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + oph.Select(selectedFields...) + } + return nil +} + +type oauthproviderhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OauthProviderHistoryPaginateOption +} + +func newOauthProviderHistoryPaginateArgs(rv map[string]any) *oauthproviderhistoryPaginateArgs { + args := &oauthproviderhistoryPaginateArgs{} + 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].(*OauthProviderHistoryWhereInput); ok { + args.opts = append(args.opts, WithOauthProviderHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (oatt *OhAuthTooTokenQuery) CollectFields(ctx context.Context, satisfies ...string) (*OhAuthTooTokenQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return oatt, nil + } + if err := oatt.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return oatt, nil +} + +func (oatt *OhAuthTooTokenQuery) 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(ohauthtootoken.Columns)) + selectedFields = []string{ohauthtootoken.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "integration": + var ( + alias = field.Alias + path = append(path, alias) + query = (&IntegrationClient{config: oatt.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, integrationImplementors)...); err != nil { + return err + } + oatt.WithNamedIntegration(alias, func(wq *IntegrationQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: oatt.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + oatt.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "tags": + if _, ok := fieldSeen[ohauthtootoken.FieldTags]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldTags) + fieldSeen[ohauthtootoken.FieldTags] = struct{}{} + } + case "clientID": + if _, ok := fieldSeen[ohauthtootoken.FieldClientID]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldClientID) + fieldSeen[ohauthtootoken.FieldClientID] = struct{}{} + } + case "scopes": + if _, ok := fieldSeen[ohauthtootoken.FieldScopes]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldScopes) + fieldSeen[ohauthtootoken.FieldScopes] = struct{}{} + } + case "nonce": + if _, ok := fieldSeen[ohauthtootoken.FieldNonce]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldNonce) + fieldSeen[ohauthtootoken.FieldNonce] = struct{}{} + } + case "claimsUserID": + if _, ok := fieldSeen[ohauthtootoken.FieldClaimsUserID]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldClaimsUserID) + fieldSeen[ohauthtootoken.FieldClaimsUserID] = struct{}{} + } + case "claimsUsername": + if _, ok := fieldSeen[ohauthtootoken.FieldClaimsUsername]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldClaimsUsername) + fieldSeen[ohauthtootoken.FieldClaimsUsername] = struct{}{} + } + case "claimsEmail": + if _, ok := fieldSeen[ohauthtootoken.FieldClaimsEmail]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldClaimsEmail) + fieldSeen[ohauthtootoken.FieldClaimsEmail] = struct{}{} + } + case "claimsEmailVerified": + if _, ok := fieldSeen[ohauthtootoken.FieldClaimsEmailVerified]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldClaimsEmailVerified) + fieldSeen[ohauthtootoken.FieldClaimsEmailVerified] = struct{}{} + } + case "claimsGroups": + if _, ok := fieldSeen[ohauthtootoken.FieldClaimsGroups]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldClaimsGroups) + fieldSeen[ohauthtootoken.FieldClaimsGroups] = struct{}{} + } + case "claimsPreferredUsername": + if _, ok := fieldSeen[ohauthtootoken.FieldClaimsPreferredUsername]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldClaimsPreferredUsername) + fieldSeen[ohauthtootoken.FieldClaimsPreferredUsername] = struct{}{} + } + case "connectorID": + if _, ok := fieldSeen[ohauthtootoken.FieldConnectorID]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldConnectorID) + fieldSeen[ohauthtootoken.FieldConnectorID] = struct{}{} + } + case "connectorData": + if _, ok := fieldSeen[ohauthtootoken.FieldConnectorData]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldConnectorData) + fieldSeen[ohauthtootoken.FieldConnectorData] = struct{}{} + } + case "lastUsed": + if _, ok := fieldSeen[ohauthtootoken.FieldLastUsed]; !ok { + selectedFields = append(selectedFields, ohauthtootoken.FieldLastUsed) + fieldSeen[ohauthtootoken.FieldLastUsed] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + oatt.Select(selectedFields...) + } + return nil +} + +type ohauthtootokenPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OhAuthTooTokenPaginateOption +} + +func newOhAuthTooTokenPaginateArgs(rv map[string]any) *ohauthtootokenPaginateArgs { + args := &ohauthtootokenPaginateArgs{} + 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].(*OhAuthTooTokenWhereInput); ok { + args.opts = append(args.opts, WithOhAuthTooTokenFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (om *OrgMembershipQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrgMembershipQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return om, nil + } + if err := om.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return om, nil +} + +func (om *OrgMembershipQuery) 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(orgmembership.Columns)) + selectedFields = []string{orgmembership.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "organization": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: om.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + om.withOrganization = query + if _, ok := fieldSeen[orgmembership.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldOrganizationID) + fieldSeen[orgmembership.FieldOrganizationID] = struct{}{} + } + + case "user": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: om.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + om.withUser = query + if _, ok := fieldSeen[orgmembership.FieldUserID]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldUserID) + fieldSeen[orgmembership.FieldUserID] = struct{}{} + } + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: om.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + om.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[orgmembership.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldCreatedAt) + fieldSeen[orgmembership.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[orgmembership.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldUpdatedAt) + fieldSeen[orgmembership.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[orgmembership.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldCreatedBy) + fieldSeen[orgmembership.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[orgmembership.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldUpdatedBy) + fieldSeen[orgmembership.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[orgmembership.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldDeletedAt) + fieldSeen[orgmembership.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[orgmembership.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldDeletedBy) + fieldSeen[orgmembership.FieldDeletedBy] = struct{}{} + } + case "role": + if _, ok := fieldSeen[orgmembership.FieldRole]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldRole) + fieldSeen[orgmembership.FieldRole] = struct{}{} + } + case "organizationID": + if _, ok := fieldSeen[orgmembership.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldOrganizationID) + fieldSeen[orgmembership.FieldOrganizationID] = struct{}{} + } + case "userID": + if _, ok := fieldSeen[orgmembership.FieldUserID]; !ok { + selectedFields = append(selectedFields, orgmembership.FieldUserID) + fieldSeen[orgmembership.FieldUserID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + om.Select(selectedFields...) + } + return nil +} + +type orgmembershipPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OrgMembershipPaginateOption +} + +func newOrgMembershipPaginateArgs(rv map[string]any) *orgmembershipPaginateArgs { + args := &orgmembershipPaginateArgs{} + 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].(*OrgMembershipWhereInput); ok { + args.opts = append(args.opts, WithOrgMembershipFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (omh *OrgMembershipHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrgMembershipHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return omh, nil + } + if err := omh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return omh, nil +} + +func (omh *OrgMembershipHistoryQuery) 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(orgmembershiphistory.Columns)) + selectedFields = []string{orgmembershiphistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[orgmembershiphistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldHistoryTime) + fieldSeen[orgmembershiphistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[orgmembershiphistory.FieldRef]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldRef) + fieldSeen[orgmembershiphistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[orgmembershiphistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldOperation) + fieldSeen[orgmembershiphistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[orgmembershiphistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldCreatedAt) + fieldSeen[orgmembershiphistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[orgmembershiphistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldUpdatedAt) + fieldSeen[orgmembershiphistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[orgmembershiphistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldCreatedBy) + fieldSeen[orgmembershiphistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[orgmembershiphistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldUpdatedBy) + fieldSeen[orgmembershiphistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[orgmembershiphistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldDeletedAt) + fieldSeen[orgmembershiphistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[orgmembershiphistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldDeletedBy) + fieldSeen[orgmembershiphistory.FieldDeletedBy] = struct{}{} + } + case "role": + if _, ok := fieldSeen[orgmembershiphistory.FieldRole]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldRole) + fieldSeen[orgmembershiphistory.FieldRole] = struct{}{} + } + case "organizationID": + if _, ok := fieldSeen[orgmembershiphistory.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldOrganizationID) + fieldSeen[orgmembershiphistory.FieldOrganizationID] = struct{}{} + } + case "userID": + if _, ok := fieldSeen[orgmembershiphistory.FieldUserID]; !ok { + selectedFields = append(selectedFields, orgmembershiphistory.FieldUserID) + fieldSeen[orgmembershiphistory.FieldUserID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + omh.Select(selectedFields...) + } + return nil +} + +type orgmembershiphistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OrgMembershipHistoryPaginateOption +} + +func newOrgMembershipHistoryPaginateArgs(rv map[string]any) *orgmembershiphistoryPaginateArgs { + args := &orgmembershiphistoryPaginateArgs{} + 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].(*OrgMembershipHistoryWhereInput); ok { + args.opts = append(args.opts, WithOrgMembershipHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (o *OrganizationQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrganizationQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return o, nil + } + if err := o.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return o, nil +} + +func (o *OrganizationQuery) 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(organization.Columns)) + selectedFields = []string{organization.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "parent": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + o.withParent = query + if _, ok := fieldSeen[organization.FieldParentOrganizationID]; !ok { + selectedFields = append(selectedFields, organization.FieldParentOrganizationID) + fieldSeen[organization.FieldParentOrganizationID] = struct{}{} + } + + case "children": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: o.config}).Query() + ) + args := newOrganizationPaginateArgs(fieldArgs(ctx, new(OrganizationWhereInput), path...)) + if err := validateFirstLast(args.first, args.last); err != nil { + return fmt.Errorf("validate first and last in path %q: %w", path, err) + } + pager, err := newOrganizationPager(args.opts, args.last != nil) + if err != nil { + return fmt.Errorf("create new pager in path %q: %w", path, err) + } + if query, err = pager.applyFilter(query); err != nil { + return err + } + ignoredEdges := !hasCollectedField(ctx, append(path, edgesField)...) + if hasCollectedField(ctx, append(path, totalCountField)...) || hasCollectedField(ctx, append(path, pageInfoField)...) { + hasPagination := args.after != nil || args.first != nil || args.before != nil || args.last != nil + if hasPagination || ignoredEdges { + query := query.Clone() + o.loadTotal = append(o.loadTotal, func(ctx context.Context, nodes []*Organization) error { + ids := make([]driver.Value, len(nodes)) + for i := range nodes { + ids[i] = nodes[i].ID + } + var v []struct { + NodeID string `sql:"parent_organization_id"` + Count int `sql:"count"` + } + query.Where(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.ChildrenColumn), ids...)) + }) + if err := query.GroupBy(organization.ChildrenColumn).Aggregate(Count()).Scan(ctx, &v); err != nil { + return err + } + m := make(map[string]int, len(v)) + for i := range v { + m[v[i].NodeID] = v[i].Count + } + for i := range nodes { + n := m[nodes[i].ID] + if nodes[i].Edges.totalCount[1] == nil { + nodes[i].Edges.totalCount[1] = make(map[string]int) + } + nodes[i].Edges.totalCount[1][alias] = n + } + return nil + }) + } else { + o.loadTotal = append(o.loadTotal, func(_ context.Context, nodes []*Organization) error { + for i := range nodes { + n := len(nodes[i].Edges.Children) + if nodes[i].Edges.totalCount[1] == nil { + nodes[i].Edges.totalCount[1] = make(map[string]int) + } + nodes[i].Edges.totalCount[1][alias] = n + } + return nil + }) + } + } + if ignoredEdges || (args.first != nil && *args.first == 0) || (args.last != nil && *args.last == 0) { + continue + } + if query, err = pager.applyCursors(query, args.after, args.before); err != nil { + return err + } + path = append(path, edgesField, nodeField) + if field := collectedField(ctx, path...); field != nil { + if err := query.collectField(ctx, false, opCtx, *field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + } + if limit := paginateLimit(args.first, args.last); limit > 0 { + if oneNode { + pager.applyOrder(query.Limit(limit)) + } else { + modify := entgql.LimitPerRow(organization.ChildrenColumn, limit, pager.orderExpr(query)) + query.modifiers = append(query.modifiers, modify) + } + } else { + query = pager.applyOrder(query) + } + o.WithNamedChildren(alias, func(wq *OrganizationQuery) { + *wq = *query + }) + + case "groups": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, groupImplementors)...); err != nil { + return err + } + o.WithNamedGroups(alias, func(wq *GroupQuery) { + *wq = *query + }) + + case "templates": + var ( + alias = field.Alias + path = append(path, alias) + query = (&TemplateClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, templateImplementors)...); err != nil { + return err + } + o.WithNamedTemplates(alias, func(wq *TemplateQuery) { + *wq = *query + }) + + case "integrations": + var ( + alias = field.Alias + path = append(path, alias) + query = (&IntegrationClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, integrationImplementors)...); err != nil { + return err + } + o.WithNamedIntegrations(alias, func(wq *IntegrationQuery) { + *wq = *query + }) + + case "setting": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationSettingClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationsettingImplementors)...); err != nil { + return err + } + o.withSetting = query + + case "documentdata": + var ( + alias = field.Alias + path = append(path, alias) + query = (&DocumentDataClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, documentdataImplementors)...); err != nil { + return err + } + o.WithNamedDocumentdata(alias, func(wq *DocumentDataQuery) { + *wq = *query + }) + + case "entitlements": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementImplementors)...); err != nil { + return err + } + o.WithNamedEntitlements(alias, func(wq *EntitlementQuery) { + *wq = *query + }) + + case "organizationEntitlement": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementImplementors)...); err != nil { + return err + } + o.WithNamedOrganizationEntitlement(alias, func(wq *EntitlementQuery) { + *wq = *query + }) + + case "personalAccessTokens": + var ( + alias = field.Alias + path = append(path, alias) + query = (&PersonalAccessTokenClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, personalaccesstokenImplementors)...); err != nil { + return err + } + o.WithNamedPersonalAccessTokens(alias, func(wq *PersonalAccessTokenQuery) { + *wq = *query + }) + + case "apiTokens": + var ( + alias = field.Alias + path = append(path, alias) + query = (&APITokenClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, apitokenImplementors)...); err != nil { + return err + } + o.WithNamedAPITokens(alias, func(wq *APITokenQuery) { + *wq = *query + }) + + case "oauthprovider": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OauthProviderClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, oauthproviderImplementors)...); err != nil { + return err + } + o.WithNamedOauthprovider(alias, func(wq *OauthProviderQuery) { + *wq = *query + }) + + case "users": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + o.WithNamedUsers(alias, func(wq *UserQuery) { + *wq = *query + }) + + case "invites": + var ( + alias = field.Alias + path = append(path, alias) + query = (&InviteClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, inviteImplementors)...); err != nil { + return err + } + o.WithNamedInvites(alias, func(wq *InviteQuery) { + *wq = *query + }) + + case "subscribers": + var ( + alias = field.Alias + path = append(path, alias) + query = (&SubscriberClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, subscriberImplementors)...); err != nil { + return err + } + o.WithNamedSubscribers(alias, func(wq *SubscriberQuery) { + *wq = *query + }) + + case "webhooks": + var ( + alias = field.Alias + path = append(path, alias) + query = (&WebhookClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, webhookImplementors)...); err != nil { + return err + } + o.WithNamedWebhooks(alias, func(wq *WebhookQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + o.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + + case "secrets": + var ( + alias = field.Alias + path = append(path, alias) + query = (&HushClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, hushImplementors)...); err != nil { + return err + } + o.WithNamedSecrets(alias, func(wq *HushQuery) { + *wq = *query + }) + + case "features": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FeatureClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, featureImplementors)...); err != nil { + return err + } + o.WithNamedFeatures(alias, func(wq *FeatureQuery) { + *wq = *query + }) + + case "files": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FileClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, fileImplementors)...); err != nil { + return err + } + o.WithNamedFiles(alias, func(wq *FileQuery) { + *wq = *query + }) + + case "entitlementplans": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementplanImplementors)...); err != nil { + return err + } + o.WithNamedEntitlementplans(alias, func(wq *EntitlementPlanQuery) { + *wq = *query + }) + + case "entitlementplanfeatures": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntitlementPlanFeatureClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitlementplanfeatureImplementors)...); err != nil { + return err + } + o.WithNamedEntitlementplanfeatures(alias, func(wq *EntitlementPlanFeatureQuery) { + *wq = *query + }) + + case "entities": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entityImplementors)...); err != nil { + return err + } + o.WithNamedEntities(alias, func(wq *EntityQuery) { + *wq = *query + }) + + case "entitytypes": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EntityTypeClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, entitytypeImplementors)...); err != nil { + return err + } + o.WithNamedEntitytypes(alias, func(wq *EntityTypeQuery) { + *wq = *query + }) + + case "contacts": + var ( + alias = field.Alias + path = append(path, alias) + query = (&ContactClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, contactImplementors)...); err != nil { + return err + } + o.WithNamedContacts(alias, func(wq *ContactQuery) { + *wq = *query + }) + + case "notes": + var ( + alias = field.Alias + path = append(path, alias) + query = (&NoteClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, noteImplementors)...); err != nil { + return err + } + o.WithNamedNotes(alias, func(wq *NoteQuery) { + *wq = *query + }) + + case "members": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrgMembershipClient{config: o.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, orgmembershipImplementors)...); err != nil { + return err + } + o.WithNamedMembers(alias, func(wq *OrgMembershipQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[organization.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, organization.FieldCreatedAt) + fieldSeen[organization.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[organization.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, organization.FieldUpdatedAt) + fieldSeen[organization.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[organization.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, organization.FieldCreatedBy) + fieldSeen[organization.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[organization.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, organization.FieldUpdatedBy) + fieldSeen[organization.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[organization.FieldTags]; !ok { + selectedFields = append(selectedFields, organization.FieldTags) + fieldSeen[organization.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[organization.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, organization.FieldDeletedAt) + fieldSeen[organization.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[organization.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, organization.FieldDeletedBy) + fieldSeen[organization.FieldDeletedBy] = struct{}{} + } + case "name": + if _, ok := fieldSeen[organization.FieldName]; !ok { + selectedFields = append(selectedFields, organization.FieldName) + fieldSeen[organization.FieldName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[organization.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, organization.FieldDisplayName) + fieldSeen[organization.FieldDisplayName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[organization.FieldDescription]; !ok { + selectedFields = append(selectedFields, organization.FieldDescription) + fieldSeen[organization.FieldDescription] = struct{}{} + } + case "personalOrg": + if _, ok := fieldSeen[organization.FieldPersonalOrg]; !ok { + selectedFields = append(selectedFields, organization.FieldPersonalOrg) + fieldSeen[organization.FieldPersonalOrg] = struct{}{} + } + case "avatarRemoteURL": + if _, ok := fieldSeen[organization.FieldAvatarRemoteURL]; !ok { + selectedFields = append(selectedFields, organization.FieldAvatarRemoteURL) + fieldSeen[organization.FieldAvatarRemoteURL] = struct{}{} + } + case "dedicatedDb": + if _, ok := fieldSeen[organization.FieldDedicatedDb]; !ok { + selectedFields = append(selectedFields, organization.FieldDedicatedDb) + fieldSeen[organization.FieldDedicatedDb] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + o.Select(selectedFields...) + } + return nil +} + +type organizationPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OrganizationPaginateOption +} + +func newOrganizationPaginateArgs(rv map[string]any) *organizationPaginateArgs { + args := &organizationPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &OrganizationOrder{Field: &OrganizationOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithOrganizationOrder(order)) + } + case *OrganizationOrder: + if v != nil { + args.opts = append(args.opts, WithOrganizationOrder(v)) + } + } + } + if v, ok := rv[whereField].(*OrganizationWhereInput); ok { + args.opts = append(args.opts, WithOrganizationFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (oh *OrganizationHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrganizationHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return oh, nil + } + if err := oh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return oh, nil +} + +func (oh *OrganizationHistoryQuery) 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(organizationhistory.Columns)) + selectedFields = []string{organizationhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[organizationhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldHistoryTime) + fieldSeen[organizationhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[organizationhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldRef) + fieldSeen[organizationhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[organizationhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldOperation) + fieldSeen[organizationhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[organizationhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldCreatedAt) + fieldSeen[organizationhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[organizationhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldUpdatedAt) + fieldSeen[organizationhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[organizationhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldCreatedBy) + fieldSeen[organizationhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[organizationhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldUpdatedBy) + fieldSeen[organizationhistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[organizationhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldTags) + fieldSeen[organizationhistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[organizationhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldDeletedAt) + fieldSeen[organizationhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[organizationhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldDeletedBy) + fieldSeen[organizationhistory.FieldDeletedBy] = struct{}{} + } + case "name": + if _, ok := fieldSeen[organizationhistory.FieldName]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldName) + fieldSeen[organizationhistory.FieldName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[organizationhistory.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldDisplayName) + fieldSeen[organizationhistory.FieldDisplayName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[organizationhistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldDescription) + fieldSeen[organizationhistory.FieldDescription] = struct{}{} + } + case "personalOrg": + if _, ok := fieldSeen[organizationhistory.FieldPersonalOrg]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldPersonalOrg) + fieldSeen[organizationhistory.FieldPersonalOrg] = struct{}{} + } + case "avatarRemoteURL": + if _, ok := fieldSeen[organizationhistory.FieldAvatarRemoteURL]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldAvatarRemoteURL) + fieldSeen[organizationhistory.FieldAvatarRemoteURL] = struct{}{} + } + case "dedicatedDb": + if _, ok := fieldSeen[organizationhistory.FieldDedicatedDb]; !ok { + selectedFields = append(selectedFields, organizationhistory.FieldDedicatedDb) + fieldSeen[organizationhistory.FieldDedicatedDb] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + oh.Select(selectedFields...) + } + return nil +} + +type organizationhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OrganizationHistoryPaginateOption +} + +func newOrganizationHistoryPaginateArgs(rv map[string]any) *organizationhistoryPaginateArgs { + args := &organizationhistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &OrganizationHistoryOrder{Field: &OrganizationHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithOrganizationHistoryOrder(order)) + } + case *OrganizationHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithOrganizationHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*OrganizationHistoryWhereInput); ok { + args.opts = append(args.opts, WithOrganizationHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (os *OrganizationSettingQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrganizationSettingQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return os, nil + } + if err := os.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return os, nil +} + +func (os *OrganizationSettingQuery) 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(organizationsetting.Columns)) + selectedFields = []string{organizationsetting.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "organization": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: os.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + os.withOrganization = query + if _, ok := fieldSeen[organizationsetting.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldOrganizationID) + fieldSeen[organizationsetting.FieldOrganizationID] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[organizationsetting.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldCreatedAt) + fieldSeen[organizationsetting.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[organizationsetting.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldUpdatedAt) + fieldSeen[organizationsetting.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[organizationsetting.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldCreatedBy) + fieldSeen[organizationsetting.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[organizationsetting.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldUpdatedBy) + fieldSeen[organizationsetting.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[organizationsetting.FieldTags]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldTags) + fieldSeen[organizationsetting.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[organizationsetting.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldDeletedAt) + fieldSeen[organizationsetting.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[organizationsetting.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldDeletedBy) + fieldSeen[organizationsetting.FieldDeletedBy] = struct{}{} + } + case "domains": + if _, ok := fieldSeen[organizationsetting.FieldDomains]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldDomains) + fieldSeen[organizationsetting.FieldDomains] = struct{}{} + } + case "billingContact": + if _, ok := fieldSeen[organizationsetting.FieldBillingContact]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldBillingContact) + fieldSeen[organizationsetting.FieldBillingContact] = struct{}{} + } + case "billingEmail": + if _, ok := fieldSeen[organizationsetting.FieldBillingEmail]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldBillingEmail) + fieldSeen[organizationsetting.FieldBillingEmail] = struct{}{} + } + case "billingPhone": + if _, ok := fieldSeen[organizationsetting.FieldBillingPhone]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldBillingPhone) + fieldSeen[organizationsetting.FieldBillingPhone] = struct{}{} + } + case "billingAddress": + if _, ok := fieldSeen[organizationsetting.FieldBillingAddress]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldBillingAddress) + fieldSeen[organizationsetting.FieldBillingAddress] = struct{}{} + } + case "taxIdentifier": + if _, ok := fieldSeen[organizationsetting.FieldTaxIdentifier]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldTaxIdentifier) + fieldSeen[organizationsetting.FieldTaxIdentifier] = struct{}{} + } + case "geoLocation": + if _, ok := fieldSeen[organizationsetting.FieldGeoLocation]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldGeoLocation) + fieldSeen[organizationsetting.FieldGeoLocation] = struct{}{} + } + case "organizationID": + if _, ok := fieldSeen[organizationsetting.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, organizationsetting.FieldOrganizationID) + fieldSeen[organizationsetting.FieldOrganizationID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + os.Select(selectedFields...) + } + return nil +} + +type organizationsettingPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OrganizationSettingPaginateOption +} + +func newOrganizationSettingPaginateArgs(rv map[string]any) *organizationsettingPaginateArgs { + args := &organizationsettingPaginateArgs{} + 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].(*OrganizationSettingWhereInput); ok { + args.opts = append(args.opts, WithOrganizationSettingFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (osh *OrganizationSettingHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrganizationSettingHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return osh, nil + } + if err := osh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return osh, nil +} + +func (osh *OrganizationSettingHistoryQuery) 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(organizationsettinghistory.Columns)) + selectedFields = []string{organizationsettinghistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[organizationsettinghistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldHistoryTime) + fieldSeen[organizationsettinghistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[organizationsettinghistory.FieldRef]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldRef) + fieldSeen[organizationsettinghistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[organizationsettinghistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldOperation) + fieldSeen[organizationsettinghistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[organizationsettinghistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldCreatedAt) + fieldSeen[organizationsettinghistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[organizationsettinghistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldUpdatedAt) + fieldSeen[organizationsettinghistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[organizationsettinghistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldCreatedBy) + fieldSeen[organizationsettinghistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[organizationsettinghistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldUpdatedBy) + fieldSeen[organizationsettinghistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[organizationsettinghistory.FieldTags]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldTags) + fieldSeen[organizationsettinghistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[organizationsettinghistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldDeletedAt) + fieldSeen[organizationsettinghistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[organizationsettinghistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldDeletedBy) + fieldSeen[organizationsettinghistory.FieldDeletedBy] = struct{}{} + } + case "domains": + if _, ok := fieldSeen[organizationsettinghistory.FieldDomains]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldDomains) + fieldSeen[organizationsettinghistory.FieldDomains] = struct{}{} + } + case "billingContact": + if _, ok := fieldSeen[organizationsettinghistory.FieldBillingContact]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldBillingContact) + fieldSeen[organizationsettinghistory.FieldBillingContact] = struct{}{} + } + case "billingEmail": + if _, ok := fieldSeen[organizationsettinghistory.FieldBillingEmail]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldBillingEmail) + fieldSeen[organizationsettinghistory.FieldBillingEmail] = struct{}{} + } + case "billingPhone": + if _, ok := fieldSeen[organizationsettinghistory.FieldBillingPhone]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldBillingPhone) + fieldSeen[organizationsettinghistory.FieldBillingPhone] = struct{}{} + } + case "billingAddress": + if _, ok := fieldSeen[organizationsettinghistory.FieldBillingAddress]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldBillingAddress) + fieldSeen[organizationsettinghistory.FieldBillingAddress] = struct{}{} + } + case "taxIdentifier": + if _, ok := fieldSeen[organizationsettinghistory.FieldTaxIdentifier]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldTaxIdentifier) + fieldSeen[organizationsettinghistory.FieldTaxIdentifier] = struct{}{} + } + case "geoLocation": + if _, ok := fieldSeen[organizationsettinghistory.FieldGeoLocation]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldGeoLocation) + fieldSeen[organizationsettinghistory.FieldGeoLocation] = struct{}{} + } + case "organizationID": + if _, ok := fieldSeen[organizationsettinghistory.FieldOrganizationID]; !ok { + selectedFields = append(selectedFields, organizationsettinghistory.FieldOrganizationID) + fieldSeen[organizationsettinghistory.FieldOrganizationID] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + osh.Select(selectedFields...) + } + return nil +} + +type organizationsettinghistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []OrganizationSettingHistoryPaginateOption +} + +func newOrganizationSettingHistoryPaginateArgs(rv map[string]any) *organizationsettinghistoryPaginateArgs { + args := &organizationsettinghistoryPaginateArgs{} + 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].(*OrganizationSettingHistoryWhereInput); ok { + args.opts = append(args.opts, WithOrganizationSettingHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (pat *PersonalAccessTokenQuery) CollectFields(ctx context.Context, satisfies ...string) (*PersonalAccessTokenQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return pat, nil + } + if err := pat.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return pat, nil +} + +func (pat *PersonalAccessTokenQuery) 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(personalaccesstoken.Columns)) + selectedFields = []string{personalaccesstoken.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: pat.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + pat.withOwner = query + if _, ok := fieldSeen[personalaccesstoken.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldOwnerID) + fieldSeen[personalaccesstoken.FieldOwnerID] = struct{}{} + } + + case "organizations": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: pat.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + pat.WithNamedOrganizations(alias, func(wq *OrganizationQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: pat.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + pat.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[personalaccesstoken.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldCreatedAt) + fieldSeen[personalaccesstoken.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[personalaccesstoken.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldUpdatedAt) + fieldSeen[personalaccesstoken.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[personalaccesstoken.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldCreatedBy) + fieldSeen[personalaccesstoken.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[personalaccesstoken.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldUpdatedBy) + fieldSeen[personalaccesstoken.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[personalaccesstoken.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldDeletedAt) + fieldSeen[personalaccesstoken.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[personalaccesstoken.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldDeletedBy) + fieldSeen[personalaccesstoken.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[personalaccesstoken.FieldTags]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldTags) + fieldSeen[personalaccesstoken.FieldTags] = struct{}{} + } + case "name": + if _, ok := fieldSeen[personalaccesstoken.FieldName]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldName) + fieldSeen[personalaccesstoken.FieldName] = struct{}{} + } + case "token": + if _, ok := fieldSeen[personalaccesstoken.FieldToken]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldToken) + fieldSeen[personalaccesstoken.FieldToken] = struct{}{} + } + case "expiresAt": + if _, ok := fieldSeen[personalaccesstoken.FieldExpiresAt]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldExpiresAt) + fieldSeen[personalaccesstoken.FieldExpiresAt] = struct{}{} + } + case "description": + if _, ok := fieldSeen[personalaccesstoken.FieldDescription]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldDescription) + fieldSeen[personalaccesstoken.FieldDescription] = struct{}{} + } + case "scopes": + if _, ok := fieldSeen[personalaccesstoken.FieldScopes]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldScopes) + fieldSeen[personalaccesstoken.FieldScopes] = struct{}{} + } + case "lastUsedAt": + if _, ok := fieldSeen[personalaccesstoken.FieldLastUsedAt]; !ok { + selectedFields = append(selectedFields, personalaccesstoken.FieldLastUsedAt) + fieldSeen[personalaccesstoken.FieldLastUsedAt] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + pat.Select(selectedFields...) + } + return nil +} + +type personalaccesstokenPaginateArgs struct { + first, last *int + after, before *Cursor + opts []PersonalAccessTokenPaginateOption +} + +func newPersonalAccessTokenPaginateArgs(rv map[string]any) *personalaccesstokenPaginateArgs { + args := &personalaccesstokenPaginateArgs{} + 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].(*PersonalAccessTokenWhereInput); ok { + args.opts = append(args.opts, WithPersonalAccessTokenFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (s *SubscriberQuery) CollectFields(ctx context.Context, satisfies ...string) (*SubscriberQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return s, nil + } + if err := s.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return s, nil +} + +func (s *SubscriberQuery) 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(subscriber.Columns)) + selectedFields = []string{subscriber.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: s.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + s.withOwner = query + if _, ok := fieldSeen[subscriber.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, subscriber.FieldOwnerID) + fieldSeen[subscriber.FieldOwnerID] = struct{}{} + } + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: s.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + s.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[subscriber.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, subscriber.FieldCreatedAt) + fieldSeen[subscriber.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[subscriber.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, subscriber.FieldUpdatedAt) + fieldSeen[subscriber.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[subscriber.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, subscriber.FieldCreatedBy) + fieldSeen[subscriber.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[subscriber.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, subscriber.FieldUpdatedBy) + fieldSeen[subscriber.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[subscriber.FieldTags]; !ok { + selectedFields = append(selectedFields, subscriber.FieldTags) + fieldSeen[subscriber.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[subscriber.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, subscriber.FieldDeletedAt) + fieldSeen[subscriber.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[subscriber.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, subscriber.FieldDeletedBy) + fieldSeen[subscriber.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[subscriber.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, subscriber.FieldOwnerID) + fieldSeen[subscriber.FieldOwnerID] = struct{}{} + } + case "email": + if _, ok := fieldSeen[subscriber.FieldEmail]; !ok { + selectedFields = append(selectedFields, subscriber.FieldEmail) + fieldSeen[subscriber.FieldEmail] = struct{}{} + } + case "phoneNumber": + if _, ok := fieldSeen[subscriber.FieldPhoneNumber]; !ok { + selectedFields = append(selectedFields, subscriber.FieldPhoneNumber) + fieldSeen[subscriber.FieldPhoneNumber] = struct{}{} + } + case "verifiedEmail": + if _, ok := fieldSeen[subscriber.FieldVerifiedEmail]; !ok { + selectedFields = append(selectedFields, subscriber.FieldVerifiedEmail) + fieldSeen[subscriber.FieldVerifiedEmail] = struct{}{} + } + case "verifiedPhone": + if _, ok := fieldSeen[subscriber.FieldVerifiedPhone]; !ok { + selectedFields = append(selectedFields, subscriber.FieldVerifiedPhone) + fieldSeen[subscriber.FieldVerifiedPhone] = struct{}{} + } + case "active": + if _, ok := fieldSeen[subscriber.FieldActive]; !ok { + selectedFields = append(selectedFields, subscriber.FieldActive) + fieldSeen[subscriber.FieldActive] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + s.Select(selectedFields...) + } + return nil +} + +type subscriberPaginateArgs struct { + first, last *int + after, before *Cursor + opts []SubscriberPaginateOption +} + +func newSubscriberPaginateArgs(rv map[string]any) *subscriberPaginateArgs { + args := &subscriberPaginateArgs{} + 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].(*SubscriberWhereInput); ok { + args.opts = append(args.opts, WithSubscriberFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ts *TFASettingQuery) CollectFields(ctx context.Context, satisfies ...string) (*TFASettingQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ts, nil + } + if err := ts.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ts, nil +} + +func (ts *TFASettingQuery) 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(tfasetting.Columns)) + selectedFields = []string{tfasetting.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: ts.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + ts.withOwner = query + if _, ok := fieldSeen[tfasetting.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldOwnerID) + fieldSeen[tfasetting.FieldOwnerID] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[tfasetting.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldCreatedAt) + fieldSeen[tfasetting.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[tfasetting.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldUpdatedAt) + fieldSeen[tfasetting.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[tfasetting.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldCreatedBy) + fieldSeen[tfasetting.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[tfasetting.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldUpdatedBy) + fieldSeen[tfasetting.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[tfasetting.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldDeletedAt) + fieldSeen[tfasetting.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[tfasetting.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldDeletedBy) + fieldSeen[tfasetting.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[tfasetting.FieldTags]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldTags) + fieldSeen[tfasetting.FieldTags] = struct{}{} + } + case "tfaSecret": + if _, ok := fieldSeen[tfasetting.FieldTfaSecret]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldTfaSecret) + fieldSeen[tfasetting.FieldTfaSecret] = struct{}{} + } + case "verified": + if _, ok := fieldSeen[tfasetting.FieldVerified]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldVerified) + fieldSeen[tfasetting.FieldVerified] = struct{}{} + } + case "recoveryCodes": + if _, ok := fieldSeen[tfasetting.FieldRecoveryCodes]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldRecoveryCodes) + fieldSeen[tfasetting.FieldRecoveryCodes] = struct{}{} + } + case "totpAllowed": + if _, ok := fieldSeen[tfasetting.FieldTotpAllowed]; !ok { + selectedFields = append(selectedFields, tfasetting.FieldTotpAllowed) + fieldSeen[tfasetting.FieldTotpAllowed] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ts.Select(selectedFields...) + } + return nil +} + +type tfasettingPaginateArgs struct { + first, last *int + after, before *Cursor + opts []TFASettingPaginateOption +} + +func newTFASettingPaginateArgs(rv map[string]any) *tfasettingPaginateArgs { + args := &tfasettingPaginateArgs{} + 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].(*TFASettingWhereInput); ok { + args.opts = append(args.opts, WithTFASettingFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (t *TemplateQuery) CollectFields(ctx context.Context, satisfies ...string) (*TemplateQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return t, nil + } + if err := t.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return t, nil +} + +func (t *TemplateQuery) 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(template.Columns)) + selectedFields = []string{template.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: t.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + t.withOwner = query + if _, ok := fieldSeen[template.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, template.FieldOwnerID) + fieldSeen[template.FieldOwnerID] = struct{}{} + } + + case "documents": + var ( + alias = field.Alias + path = append(path, alias) + query = (&DocumentDataClient{config: t.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, documentdataImplementors)...); err != nil { + return err + } + t.WithNamedDocuments(alias, func(wq *DocumentDataQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[template.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, template.FieldCreatedAt) + fieldSeen[template.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[template.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, template.FieldUpdatedAt) + fieldSeen[template.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[template.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, template.FieldCreatedBy) + fieldSeen[template.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[template.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, template.FieldUpdatedBy) + fieldSeen[template.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[template.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, template.FieldDeletedAt) + fieldSeen[template.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[template.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, template.FieldDeletedBy) + fieldSeen[template.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[template.FieldTags]; !ok { + selectedFields = append(selectedFields, template.FieldTags) + fieldSeen[template.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[template.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, template.FieldOwnerID) + fieldSeen[template.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[template.FieldName]; !ok { + selectedFields = append(selectedFields, template.FieldName) + fieldSeen[template.FieldName] = struct{}{} + } + case "templateType": + if _, ok := fieldSeen[template.FieldTemplateType]; !ok { + selectedFields = append(selectedFields, template.FieldTemplateType) + fieldSeen[template.FieldTemplateType] = struct{}{} + } + case "description": + if _, ok := fieldSeen[template.FieldDescription]; !ok { + selectedFields = append(selectedFields, template.FieldDescription) + fieldSeen[template.FieldDescription] = struct{}{} + } + case "jsonconfig": + if _, ok := fieldSeen[template.FieldJsonconfig]; !ok { + selectedFields = append(selectedFields, template.FieldJsonconfig) + fieldSeen[template.FieldJsonconfig] = struct{}{} + } + case "uischema": + if _, ok := fieldSeen[template.FieldUischema]; !ok { + selectedFields = append(selectedFields, template.FieldUischema) + fieldSeen[template.FieldUischema] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + t.Select(selectedFields...) + } + return nil +} + +type templatePaginateArgs struct { + first, last *int + after, before *Cursor + opts []TemplatePaginateOption +} + +func newTemplatePaginateArgs(rv map[string]any) *templatePaginateArgs { + args := &templatePaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &TemplateOrder{Field: &TemplateOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithTemplateOrder(order)) + } + case *TemplateOrder: + if v != nil { + args.opts = append(args.opts, WithTemplateOrder(v)) + } + } + } + if v, ok := rv[whereField].(*TemplateWhereInput); ok { + args.opts = append(args.opts, WithTemplateFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (th *TemplateHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*TemplateHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return th, nil + } + if err := th.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return th, nil +} + +func (th *TemplateHistoryQuery) 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(templatehistory.Columns)) + selectedFields = []string{templatehistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[templatehistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldHistoryTime) + fieldSeen[templatehistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[templatehistory.FieldRef]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldRef) + fieldSeen[templatehistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[templatehistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldOperation) + fieldSeen[templatehistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[templatehistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldCreatedAt) + fieldSeen[templatehistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[templatehistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldUpdatedAt) + fieldSeen[templatehistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[templatehistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldCreatedBy) + fieldSeen[templatehistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[templatehistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldUpdatedBy) + fieldSeen[templatehistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[templatehistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldDeletedAt) + fieldSeen[templatehistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[templatehistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldDeletedBy) + fieldSeen[templatehistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[templatehistory.FieldTags]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldTags) + fieldSeen[templatehistory.FieldTags] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[templatehistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldOwnerID) + fieldSeen[templatehistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[templatehistory.FieldName]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldName) + fieldSeen[templatehistory.FieldName] = struct{}{} + } + case "templateType": + if _, ok := fieldSeen[templatehistory.FieldTemplateType]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldTemplateType) + fieldSeen[templatehistory.FieldTemplateType] = struct{}{} + } + case "description": + if _, ok := fieldSeen[templatehistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldDescription) + fieldSeen[templatehistory.FieldDescription] = struct{}{} + } + case "jsonconfig": + if _, ok := fieldSeen[templatehistory.FieldJsonconfig]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldJsonconfig) + fieldSeen[templatehistory.FieldJsonconfig] = struct{}{} + } + case "uischema": + if _, ok := fieldSeen[templatehistory.FieldUischema]; !ok { + selectedFields = append(selectedFields, templatehistory.FieldUischema) + fieldSeen[templatehistory.FieldUischema] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + th.Select(selectedFields...) + } + return nil +} + +type templatehistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []TemplateHistoryPaginateOption +} + +func newTemplateHistoryPaginateArgs(rv map[string]any) *templatehistoryPaginateArgs { + args := &templatehistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &TemplateHistoryOrder{Field: &TemplateHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithTemplateHistoryOrder(order)) + } + case *TemplateHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithTemplateHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*TemplateHistoryWhereInput); ok { + args.opts = append(args.opts, WithTemplateHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return u, nil + } + if err := u.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return u, nil +} + +func (u *UserQuery) 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(user.Columns)) + selectedFields = []string{user.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "personalAccessTokens": + var ( + alias = field.Alias + path = append(path, alias) + query = (&PersonalAccessTokenClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, personalaccesstokenImplementors)...); err != nil { + return err + } + u.WithNamedPersonalAccessTokens(alias, func(wq *PersonalAccessTokenQuery) { + *wq = *query + }) + + case "tfaSettings": + var ( + alias = field.Alias + path = append(path, alias) + query = (&TFASettingClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, tfasettingImplementors)...); err != nil { + return err + } + u.WithNamedTfaSettings(alias, func(wq *TFASettingQuery) { + *wq = *query + }) + + case "setting": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserSettingClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, usersettingImplementors)...); err != nil { + return err + } + u.withSetting = query + + case "groups": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, groupImplementors)...); err != nil { + return err + } + u.WithNamedGroups(alias, func(wq *GroupQuery) { + *wq = *query + }) + + case "organizations": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + u.WithNamedOrganizations(alias, func(wq *OrganizationQuery) { + *wq = *query + }) + + case "files": + var ( + alias = field.Alias + path = append(path, alias) + query = (&FileClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, fileImplementors)...); err != nil { + return err + } + u.WithNamedFiles(alias, func(wq *FileQuery) { + *wq = *query + }) + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + u.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + + case "groupMemberships": + var ( + alias = field.Alias + path = append(path, alias) + query = (&GroupMembershipClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, groupmembershipImplementors)...); err != nil { + return err + } + u.WithNamedGroupMemberships(alias, func(wq *GroupMembershipQuery) { + *wq = *query + }) + + case "orgMemberships": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrgMembershipClient{config: u.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, orgmembershipImplementors)...); err != nil { + return err + } + u.WithNamedOrgMemberships(alias, func(wq *OrgMembershipQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[user.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, user.FieldCreatedAt) + fieldSeen[user.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[user.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, user.FieldUpdatedAt) + fieldSeen[user.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[user.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, user.FieldCreatedBy) + fieldSeen[user.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[user.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, user.FieldUpdatedBy) + fieldSeen[user.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[user.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, user.FieldDeletedAt) + fieldSeen[user.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[user.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, user.FieldDeletedBy) + fieldSeen[user.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[user.FieldTags]; !ok { + selectedFields = append(selectedFields, user.FieldTags) + fieldSeen[user.FieldTags] = struct{}{} + } + case "email": + if _, ok := fieldSeen[user.FieldEmail]; !ok { + selectedFields = append(selectedFields, user.FieldEmail) + fieldSeen[user.FieldEmail] = struct{}{} + } + case "firstName": + if _, ok := fieldSeen[user.FieldFirstName]; !ok { + selectedFields = append(selectedFields, user.FieldFirstName) + fieldSeen[user.FieldFirstName] = struct{}{} + } + case "lastName": + if _, ok := fieldSeen[user.FieldLastName]; !ok { + selectedFields = append(selectedFields, user.FieldLastName) + fieldSeen[user.FieldLastName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[user.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, user.FieldDisplayName) + fieldSeen[user.FieldDisplayName] = struct{}{} + } + case "avatarRemoteURL": + if _, ok := fieldSeen[user.FieldAvatarRemoteURL]; !ok { + selectedFields = append(selectedFields, user.FieldAvatarRemoteURL) + fieldSeen[user.FieldAvatarRemoteURL] = struct{}{} + } + case "avatarLocalFile": + if _, ok := fieldSeen[user.FieldAvatarLocalFile]; !ok { + selectedFields = append(selectedFields, user.FieldAvatarLocalFile) + fieldSeen[user.FieldAvatarLocalFile] = struct{}{} + } + case "avatarUpdatedAt": + if _, ok := fieldSeen[user.FieldAvatarUpdatedAt]; !ok { + selectedFields = append(selectedFields, user.FieldAvatarUpdatedAt) + fieldSeen[user.FieldAvatarUpdatedAt] = struct{}{} + } + case "lastSeen": + if _, ok := fieldSeen[user.FieldLastSeen]; !ok { + selectedFields = append(selectedFields, user.FieldLastSeen) + fieldSeen[user.FieldLastSeen] = struct{}{} + } + case "sub": + if _, ok := fieldSeen[user.FieldSub]; !ok { + selectedFields = append(selectedFields, user.FieldSub) + fieldSeen[user.FieldSub] = struct{}{} + } + case "authProvider": + if _, ok := fieldSeen[user.FieldAuthProvider]; !ok { + selectedFields = append(selectedFields, user.FieldAuthProvider) + fieldSeen[user.FieldAuthProvider] = struct{}{} + } + case "role": + if _, ok := fieldSeen[user.FieldRole]; !ok { + selectedFields = append(selectedFields, user.FieldRole) + fieldSeen[user.FieldRole] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + u.Select(selectedFields...) + } + return nil +} + +type userPaginateArgs struct { + first, last *int + after, before *Cursor + opts []UserPaginateOption +} + +func newUserPaginateArgs(rv map[string]any) *userPaginateArgs { + args := &userPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &UserOrder{Field: &UserOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithUserOrder(order)) + } + case *UserOrder: + if v != nil { + args.opts = append(args.opts, WithUserOrder(v)) + } + } + } + if v, ok := rv[whereField].(*UserWhereInput); ok { + args.opts = append(args.opts, WithUserFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (uh *UserHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return uh, nil + } + if err := uh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return uh, nil +} + +func (uh *UserHistoryQuery) 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(userhistory.Columns)) + selectedFields = []string{userhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[userhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, userhistory.FieldHistoryTime) + fieldSeen[userhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[userhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, userhistory.FieldRef) + fieldSeen[userhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[userhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, userhistory.FieldOperation) + fieldSeen[userhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[userhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, userhistory.FieldCreatedAt) + fieldSeen[userhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[userhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, userhistory.FieldUpdatedAt) + fieldSeen[userhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[userhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, userhistory.FieldCreatedBy) + fieldSeen[userhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[userhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, userhistory.FieldUpdatedBy) + fieldSeen[userhistory.FieldUpdatedBy] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[userhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, userhistory.FieldDeletedAt) + fieldSeen[userhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[userhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, userhistory.FieldDeletedBy) + fieldSeen[userhistory.FieldDeletedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[userhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, userhistory.FieldTags) + fieldSeen[userhistory.FieldTags] = struct{}{} + } + case "email": + if _, ok := fieldSeen[userhistory.FieldEmail]; !ok { + selectedFields = append(selectedFields, userhistory.FieldEmail) + fieldSeen[userhistory.FieldEmail] = struct{}{} + } + case "firstName": + if _, ok := fieldSeen[userhistory.FieldFirstName]; !ok { + selectedFields = append(selectedFields, userhistory.FieldFirstName) + fieldSeen[userhistory.FieldFirstName] = struct{}{} + } + case "lastName": + if _, ok := fieldSeen[userhistory.FieldLastName]; !ok { + selectedFields = append(selectedFields, userhistory.FieldLastName) + fieldSeen[userhistory.FieldLastName] = struct{}{} + } + case "displayName": + if _, ok := fieldSeen[userhistory.FieldDisplayName]; !ok { + selectedFields = append(selectedFields, userhistory.FieldDisplayName) + fieldSeen[userhistory.FieldDisplayName] = struct{}{} + } + case "avatarRemoteURL": + if _, ok := fieldSeen[userhistory.FieldAvatarRemoteURL]; !ok { + selectedFields = append(selectedFields, userhistory.FieldAvatarRemoteURL) + fieldSeen[userhistory.FieldAvatarRemoteURL] = struct{}{} + } + case "avatarLocalFile": + if _, ok := fieldSeen[userhistory.FieldAvatarLocalFile]; !ok { + selectedFields = append(selectedFields, userhistory.FieldAvatarLocalFile) + fieldSeen[userhistory.FieldAvatarLocalFile] = struct{}{} + } + case "avatarUpdatedAt": + if _, ok := fieldSeen[userhistory.FieldAvatarUpdatedAt]; !ok { + selectedFields = append(selectedFields, userhistory.FieldAvatarUpdatedAt) + fieldSeen[userhistory.FieldAvatarUpdatedAt] = struct{}{} + } + case "lastSeen": + if _, ok := fieldSeen[userhistory.FieldLastSeen]; !ok { + selectedFields = append(selectedFields, userhistory.FieldLastSeen) + fieldSeen[userhistory.FieldLastSeen] = struct{}{} + } + case "sub": + if _, ok := fieldSeen[userhistory.FieldSub]; !ok { + selectedFields = append(selectedFields, userhistory.FieldSub) + fieldSeen[userhistory.FieldSub] = struct{}{} + } + case "authProvider": + if _, ok := fieldSeen[userhistory.FieldAuthProvider]; !ok { + selectedFields = append(selectedFields, userhistory.FieldAuthProvider) + fieldSeen[userhistory.FieldAuthProvider] = struct{}{} + } + case "role": + if _, ok := fieldSeen[userhistory.FieldRole]; !ok { + selectedFields = append(selectedFields, userhistory.FieldRole) + fieldSeen[userhistory.FieldRole] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + uh.Select(selectedFields...) + } + return nil +} + +type userhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []UserHistoryPaginateOption +} + +func newUserHistoryPaginateArgs(rv map[string]any) *userhistoryPaginateArgs { + args := &userhistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &UserHistoryOrder{Field: &UserHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithUserHistoryOrder(order)) + } + case *UserHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithUserHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*UserHistoryWhereInput); ok { + args.opts = append(args.opts, WithUserHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (us *UserSettingQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserSettingQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return us, nil + } + if err := us.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return us, nil +} + +func (us *UserSettingQuery) 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(usersetting.Columns)) + selectedFields = []string{usersetting.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "user": + var ( + alias = field.Alias + path = append(path, alias) + query = (&UserClient{config: us.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, userImplementors)...); err != nil { + return err + } + us.withUser = query + if _, ok := fieldSeen[usersetting.FieldUserID]; !ok { + selectedFields = append(selectedFields, usersetting.FieldUserID) + fieldSeen[usersetting.FieldUserID] = struct{}{} + } + + case "defaultOrg": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: us.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + us.withDefaultOrg = query + case "createdAt": + if _, ok := fieldSeen[usersetting.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, usersetting.FieldCreatedAt) + fieldSeen[usersetting.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[usersetting.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, usersetting.FieldUpdatedAt) + fieldSeen[usersetting.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[usersetting.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, usersetting.FieldCreatedBy) + fieldSeen[usersetting.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[usersetting.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, usersetting.FieldUpdatedBy) + fieldSeen[usersetting.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[usersetting.FieldTags]; !ok { + selectedFields = append(selectedFields, usersetting.FieldTags) + fieldSeen[usersetting.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[usersetting.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, usersetting.FieldDeletedAt) + fieldSeen[usersetting.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[usersetting.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, usersetting.FieldDeletedBy) + fieldSeen[usersetting.FieldDeletedBy] = struct{}{} + } + case "userID": + if _, ok := fieldSeen[usersetting.FieldUserID]; !ok { + selectedFields = append(selectedFields, usersetting.FieldUserID) + fieldSeen[usersetting.FieldUserID] = struct{}{} + } + case "locked": + if _, ok := fieldSeen[usersetting.FieldLocked]; !ok { + selectedFields = append(selectedFields, usersetting.FieldLocked) + fieldSeen[usersetting.FieldLocked] = struct{}{} + } + case "silencedAt": + if _, ok := fieldSeen[usersetting.FieldSilencedAt]; !ok { + selectedFields = append(selectedFields, usersetting.FieldSilencedAt) + fieldSeen[usersetting.FieldSilencedAt] = struct{}{} + } + case "suspendedAt": + if _, ok := fieldSeen[usersetting.FieldSuspendedAt]; !ok { + selectedFields = append(selectedFields, usersetting.FieldSuspendedAt) + fieldSeen[usersetting.FieldSuspendedAt] = struct{}{} + } + case "status": + if _, ok := fieldSeen[usersetting.FieldStatus]; !ok { + selectedFields = append(selectedFields, usersetting.FieldStatus) + fieldSeen[usersetting.FieldStatus] = struct{}{} + } + case "emailConfirmed": + if _, ok := fieldSeen[usersetting.FieldEmailConfirmed]; !ok { + selectedFields = append(selectedFields, usersetting.FieldEmailConfirmed) + fieldSeen[usersetting.FieldEmailConfirmed] = struct{}{} + } + case "isWebauthnAllowed": + if _, ok := fieldSeen[usersetting.FieldIsWebauthnAllowed]; !ok { + selectedFields = append(selectedFields, usersetting.FieldIsWebauthnAllowed) + fieldSeen[usersetting.FieldIsWebauthnAllowed] = struct{}{} + } + case "isTfaEnabled": + if _, ok := fieldSeen[usersetting.FieldIsTfaEnabled]; !ok { + selectedFields = append(selectedFields, usersetting.FieldIsTfaEnabled) + fieldSeen[usersetting.FieldIsTfaEnabled] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + us.Select(selectedFields...) + } + return nil +} + +type usersettingPaginateArgs struct { + first, last *int + after, before *Cursor + opts []UserSettingPaginateOption +} + +func newUserSettingPaginateArgs(rv map[string]any) *usersettingPaginateArgs { + args := &usersettingPaginateArgs{} + 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].(*UserSettingWhereInput); ok { + args.opts = append(args.opts, WithUserSettingFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (ush *UserSettingHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserSettingHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return ush, nil + } + if err := ush.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return ush, nil +} + +func (ush *UserSettingHistoryQuery) 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(usersettinghistory.Columns)) + selectedFields = []string{usersettinghistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[usersettinghistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldHistoryTime) + fieldSeen[usersettinghistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[usersettinghistory.FieldRef]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldRef) + fieldSeen[usersettinghistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[usersettinghistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldOperation) + fieldSeen[usersettinghistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[usersettinghistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldCreatedAt) + fieldSeen[usersettinghistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[usersettinghistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldUpdatedAt) + fieldSeen[usersettinghistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[usersettinghistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldCreatedBy) + fieldSeen[usersettinghistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[usersettinghistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldUpdatedBy) + fieldSeen[usersettinghistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[usersettinghistory.FieldTags]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldTags) + fieldSeen[usersettinghistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[usersettinghistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldDeletedAt) + fieldSeen[usersettinghistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[usersettinghistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldDeletedBy) + fieldSeen[usersettinghistory.FieldDeletedBy] = struct{}{} + } + case "userID": + if _, ok := fieldSeen[usersettinghistory.FieldUserID]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldUserID) + fieldSeen[usersettinghistory.FieldUserID] = struct{}{} + } + case "locked": + if _, ok := fieldSeen[usersettinghistory.FieldLocked]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldLocked) + fieldSeen[usersettinghistory.FieldLocked] = struct{}{} + } + case "silencedAt": + if _, ok := fieldSeen[usersettinghistory.FieldSilencedAt]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldSilencedAt) + fieldSeen[usersettinghistory.FieldSilencedAt] = struct{}{} + } + case "suspendedAt": + if _, ok := fieldSeen[usersettinghistory.FieldSuspendedAt]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldSuspendedAt) + fieldSeen[usersettinghistory.FieldSuspendedAt] = struct{}{} + } + case "status": + if _, ok := fieldSeen[usersettinghistory.FieldStatus]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldStatus) + fieldSeen[usersettinghistory.FieldStatus] = struct{}{} + } + case "emailConfirmed": + if _, ok := fieldSeen[usersettinghistory.FieldEmailConfirmed]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldEmailConfirmed) + fieldSeen[usersettinghistory.FieldEmailConfirmed] = struct{}{} + } + case "isWebauthnAllowed": + if _, ok := fieldSeen[usersettinghistory.FieldIsWebauthnAllowed]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldIsWebauthnAllowed) + fieldSeen[usersettinghistory.FieldIsWebauthnAllowed] = struct{}{} + } + case "isTfaEnabled": + if _, ok := fieldSeen[usersettinghistory.FieldIsTfaEnabled]; !ok { + selectedFields = append(selectedFields, usersettinghistory.FieldIsTfaEnabled) + fieldSeen[usersettinghistory.FieldIsTfaEnabled] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + ush.Select(selectedFields...) + } + return nil +} + +type usersettinghistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []UserSettingHistoryPaginateOption +} + +func newUserSettingHistoryPaginateArgs(rv map[string]any) *usersettinghistoryPaginateArgs { + args := &usersettinghistoryPaginateArgs{} + 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].(*UserSettingHistoryWhereInput); ok { + args.opts = append(args.opts, WithUserSettingHistoryFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (w *WebhookQuery) CollectFields(ctx context.Context, satisfies ...string) (*WebhookQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return w, nil + } + if err := w.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return w, nil +} + +func (w *WebhookQuery) 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(webhook.Columns)) + selectedFields = []string{webhook.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + + case "owner": + var ( + alias = field.Alias + path = append(path, alias) + query = (&OrganizationClient{config: w.config}).Query() + ) + if err := query.collectField(ctx, oneNode, opCtx, field, path, mayAddCondition(satisfies, organizationImplementors)...); err != nil { + return err + } + w.withOwner = query + if _, ok := fieldSeen[webhook.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, webhook.FieldOwnerID) + fieldSeen[webhook.FieldOwnerID] = struct{}{} + } + + case "events": + var ( + alias = field.Alias + path = append(path, alias) + query = (&EventClient{config: w.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, eventImplementors)...); err != nil { + return err + } + w.WithNamedEvents(alias, func(wq *EventQuery) { + *wq = *query + }) + + case "integrations": + var ( + alias = field.Alias + path = append(path, alias) + query = (&IntegrationClient{config: w.config}).Query() + ) + if err := query.collectField(ctx, false, opCtx, field, path, mayAddCondition(satisfies, integrationImplementors)...); err != nil { + return err + } + w.WithNamedIntegrations(alias, func(wq *IntegrationQuery) { + *wq = *query + }) + case "createdAt": + if _, ok := fieldSeen[webhook.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, webhook.FieldCreatedAt) + fieldSeen[webhook.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[webhook.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, webhook.FieldUpdatedAt) + fieldSeen[webhook.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[webhook.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, webhook.FieldCreatedBy) + fieldSeen[webhook.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[webhook.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, webhook.FieldUpdatedBy) + fieldSeen[webhook.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[webhook.FieldTags]; !ok { + selectedFields = append(selectedFields, webhook.FieldTags) + fieldSeen[webhook.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[webhook.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, webhook.FieldDeletedAt) + fieldSeen[webhook.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[webhook.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, webhook.FieldDeletedBy) + fieldSeen[webhook.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[webhook.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, webhook.FieldOwnerID) + fieldSeen[webhook.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[webhook.FieldName]; !ok { + selectedFields = append(selectedFields, webhook.FieldName) + fieldSeen[webhook.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[webhook.FieldDescription]; !ok { + selectedFields = append(selectedFields, webhook.FieldDescription) + fieldSeen[webhook.FieldDescription] = struct{}{} + } + case "destinationURL": + if _, ok := fieldSeen[webhook.FieldDestinationURL]; !ok { + selectedFields = append(selectedFields, webhook.FieldDestinationURL) + fieldSeen[webhook.FieldDestinationURL] = struct{}{} + } + case "enabled": + if _, ok := fieldSeen[webhook.FieldEnabled]; !ok { + selectedFields = append(selectedFields, webhook.FieldEnabled) + fieldSeen[webhook.FieldEnabled] = struct{}{} + } + case "failures": + if _, ok := fieldSeen[webhook.FieldFailures]; !ok { + selectedFields = append(selectedFields, webhook.FieldFailures) + fieldSeen[webhook.FieldFailures] = struct{}{} + } + case "lastError": + if _, ok := fieldSeen[webhook.FieldLastError]; !ok { + selectedFields = append(selectedFields, webhook.FieldLastError) + fieldSeen[webhook.FieldLastError] = struct{}{} + } + case "lastResponse": + if _, ok := fieldSeen[webhook.FieldLastResponse]; !ok { + selectedFields = append(selectedFields, webhook.FieldLastResponse) + fieldSeen[webhook.FieldLastResponse] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + w.Select(selectedFields...) + } + return nil +} + +type webhookPaginateArgs struct { + first, last *int + after, before *Cursor + opts []WebhookPaginateOption +} + +func newWebhookPaginateArgs(rv map[string]any) *webhookPaginateArgs { + args := &webhookPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &WebhookOrder{Field: &WebhookOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithWebhookOrder(order)) + } + case *WebhookOrder: + if v != nil { + args.opts = append(args.opts, WithWebhookOrder(v)) + } + } + } + if v, ok := rv[whereField].(*WebhookWhereInput); ok { + args.opts = append(args.opts, WithWebhookFilter(v.Filter)) + } + return args +} + +// CollectFields tells the query-builder to eagerly load connected nodes by resolver context. +func (wh *WebhookHistoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*WebhookHistoryQuery, error) { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return wh, nil + } + if err := wh.collectField(ctx, false, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + return nil, err + } + return wh, nil +} + +func (wh *WebhookHistoryQuery) 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(webhookhistory.Columns)) + selectedFields = []string{webhookhistory.FieldID} + ) + for _, field := range graphql.CollectFields(opCtx, collected.Selections, satisfies) { + switch field.Name { + case "historyTime": + if _, ok := fieldSeen[webhookhistory.FieldHistoryTime]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldHistoryTime) + fieldSeen[webhookhistory.FieldHistoryTime] = struct{}{} + } + case "ref": + if _, ok := fieldSeen[webhookhistory.FieldRef]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldRef) + fieldSeen[webhookhistory.FieldRef] = struct{}{} + } + case "operation": + if _, ok := fieldSeen[webhookhistory.FieldOperation]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldOperation) + fieldSeen[webhookhistory.FieldOperation] = struct{}{} + } + case "createdAt": + if _, ok := fieldSeen[webhookhistory.FieldCreatedAt]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldCreatedAt) + fieldSeen[webhookhistory.FieldCreatedAt] = struct{}{} + } + case "updatedAt": + if _, ok := fieldSeen[webhookhistory.FieldUpdatedAt]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldUpdatedAt) + fieldSeen[webhookhistory.FieldUpdatedAt] = struct{}{} + } + case "createdBy": + if _, ok := fieldSeen[webhookhistory.FieldCreatedBy]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldCreatedBy) + fieldSeen[webhookhistory.FieldCreatedBy] = struct{}{} + } + case "updatedBy": + if _, ok := fieldSeen[webhookhistory.FieldUpdatedBy]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldUpdatedBy) + fieldSeen[webhookhistory.FieldUpdatedBy] = struct{}{} + } + case "tags": + if _, ok := fieldSeen[webhookhistory.FieldTags]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldTags) + fieldSeen[webhookhistory.FieldTags] = struct{}{} + } + case "deletedAt": + if _, ok := fieldSeen[webhookhistory.FieldDeletedAt]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldDeletedAt) + fieldSeen[webhookhistory.FieldDeletedAt] = struct{}{} + } + case "deletedBy": + if _, ok := fieldSeen[webhookhistory.FieldDeletedBy]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldDeletedBy) + fieldSeen[webhookhistory.FieldDeletedBy] = struct{}{} + } + case "ownerID": + if _, ok := fieldSeen[webhookhistory.FieldOwnerID]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldOwnerID) + fieldSeen[webhookhistory.FieldOwnerID] = struct{}{} + } + case "name": + if _, ok := fieldSeen[webhookhistory.FieldName]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldName) + fieldSeen[webhookhistory.FieldName] = struct{}{} + } + case "description": + if _, ok := fieldSeen[webhookhistory.FieldDescription]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldDescription) + fieldSeen[webhookhistory.FieldDescription] = struct{}{} + } + case "destinationURL": + if _, ok := fieldSeen[webhookhistory.FieldDestinationURL]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldDestinationURL) + fieldSeen[webhookhistory.FieldDestinationURL] = struct{}{} + } + case "enabled": + if _, ok := fieldSeen[webhookhistory.FieldEnabled]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldEnabled) + fieldSeen[webhookhistory.FieldEnabled] = struct{}{} + } + case "failures": + if _, ok := fieldSeen[webhookhistory.FieldFailures]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldFailures) + fieldSeen[webhookhistory.FieldFailures] = struct{}{} + } + case "lastError": + if _, ok := fieldSeen[webhookhistory.FieldLastError]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldLastError) + fieldSeen[webhookhistory.FieldLastError] = struct{}{} + } + case "lastResponse": + if _, ok := fieldSeen[webhookhistory.FieldLastResponse]; !ok { + selectedFields = append(selectedFields, webhookhistory.FieldLastResponse) + fieldSeen[webhookhistory.FieldLastResponse] = struct{}{} + } + case "id": + case "__typename": + default: + unknownSeen = true + } + } + if !unknownSeen { + wh.Select(selectedFields...) + } + return nil +} + +type webhookhistoryPaginateArgs struct { + first, last *int + after, before *Cursor + opts []WebhookHistoryPaginateOption +} + +func newWebhookHistoryPaginateArgs(rv map[string]any) *webhookhistoryPaginateArgs { + args := &webhookhistoryPaginateArgs{} + if rv == nil { + return args + } + if v := rv[firstField]; v != nil { + args.first = v.(*int) + } + if v := rv[lastField]; v != nil { + args.last = v.(*int) + } + if v := rv[afterField]; v != nil { + args.after = v.(*Cursor) + } + if v := rv[beforeField]; v != nil { + args.before = v.(*Cursor) + } + if v, ok := rv[orderByField]; ok { + switch v := v.(type) { + case map[string]any: + var ( + err1, err2 error + order = &WebhookHistoryOrder{Field: &WebhookHistoryOrderField{}, Direction: entgql.OrderDirectionAsc} + ) + if d, ok := v[directionField]; ok { + err1 = order.Direction.UnmarshalGQL(d) + } + if f, ok := v[fieldField]; ok { + err2 = order.Field.UnmarshalGQL(f) + } + if err1 == nil && err2 == nil { + args.opts = append(args.opts, WithWebhookHistoryOrder(order)) + } + case *WebhookHistoryOrder: + if v != nil { + args.opts = append(args.opts, WithWebhookHistoryOrder(v)) + } + } + } + if v, ok := rv[whereField].(*WebhookHistoryWhereInput); ok { + args.opts = append(args.opts, WithWebhookHistoryFilter(v.Filter)) + } + return args +} + +const ( + afterField = "after" + firstField = "first" + beforeField = "before" + lastField = "last" + orderByField = "orderBy" + directionField = "direction" + fieldField = "field" + whereField = "where" +) + +func fieldArgs(ctx context.Context, whereInput any, path ...string) map[string]any { + field := collectedField(ctx, path...) + if field == nil || field.Arguments == nil { + return nil + } + oc := graphql.GetOperationContext(ctx) + args := field.ArgumentMap(oc.Variables) + return unmarshalArgs(ctx, whereInput, args) +} + +// unmarshalArgs allows extracting the field arguments from their raw representation. +func unmarshalArgs(ctx context.Context, whereInput any, args map[string]any) map[string]any { + for _, k := range []string{firstField, lastField} { + v, ok := args[k] + if !ok { + continue + } + i, err := graphql.UnmarshalInt(v) + if err == nil { + args[k] = &i + } + } + for _, k := range []string{beforeField, afterField} { + v, ok := args[k] + if !ok { + continue + } + c := &Cursor{} + if c.UnmarshalGQL(v) == nil { + args[k] = c + } + } + if v, ok := args[whereField]; ok && whereInput != nil { + if err := graphql.UnmarshalInputFromContext(ctx, v, whereInput); err == nil { + args[whereField] = whereInput + } + } + + return args +} + +// mayAddCondition appends another type condition to the satisfies list +// if it does not exist in the list. +func mayAddCondition(satisfies []string, typeCond []string) []string { +Cond: + for _, c := range typeCond { + for _, s := range satisfies { + if c == s { + continue Cond + } + } + satisfies = append(satisfies, c) + } + return satisfies +} diff --git a/internal/ent/generated/gql_edge.go b/internal/ent/generated/gql_edge.go new file mode 100644 index 0000000..46e880b --- /dev/null +++ b/internal/ent/generated/gql_edge.go @@ -0,0 +1,1422 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" +) + +func (at *APIToken) Owner(ctx context.Context) (*Organization, error) { + result, err := at.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = at.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (c *Contact) Owner(ctx context.Context) (*Organization, error) { + result, err := c.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = c.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (c *Contact) Entities(ctx context.Context) (result []*Entity, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = c.NamedEntities(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = c.Edges.EntitiesOrErr() + } + if IsNotLoaded(err) { + result, err = c.QueryEntities().All(ctx) + } + return result, err +} + +func (dd *DocumentData) Owner(ctx context.Context) (*Organization, error) { + result, err := dd.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = dd.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (dd *DocumentData) Template(ctx context.Context) (*Template, error) { + result, err := dd.Edges.TemplateOrErr() + if IsNotLoaded(err) { + result, err = dd.QueryTemplate().Only(ctx) + } + return result, err +} + +func (dd *DocumentData) Entity(ctx context.Context) (result []*Entity, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = dd.NamedEntity(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = dd.Edges.EntityOrErr() + } + if IsNotLoaded(err) { + result, err = dd.QueryEntity().All(ctx) + } + return result, err +} + +func (e *Entitlement) Owner(ctx context.Context) (*Organization, error) { + result, err := e.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = e.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (e *Entitlement) Plan(ctx context.Context) (*EntitlementPlan, error) { + result, err := e.Edges.PlanOrErr() + if IsNotLoaded(err) { + result, err = e.QueryPlan().Only(ctx) + } + return result, err +} + +func (e *Entitlement) Organization(ctx context.Context) (*Organization, error) { + result, err := e.Edges.OrganizationOrErr() + if IsNotLoaded(err) { + result, err = e.QueryOrganization().Only(ctx) + } + return result, err +} + +func (e *Entitlement) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryEvents().All(ctx) + } + return result, err +} + +func (ep *EntitlementPlan) Owner(ctx context.Context) (*Organization, error) { + result, err := ep.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = ep.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (ep *EntitlementPlan) Entitlements(ctx context.Context) (result []*Entitlement, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = ep.NamedEntitlements(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = ep.Edges.EntitlementsOrErr() + } + if IsNotLoaded(err) { + result, err = ep.QueryEntitlements().All(ctx) + } + return result, err +} + +func (ep *EntitlementPlan) BaseFeatures(ctx context.Context) (result []*Feature, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = ep.NamedBaseFeatures(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = ep.Edges.BaseFeaturesOrErr() + } + if IsNotLoaded(err) { + result, err = ep.QueryBaseFeatures().All(ctx) + } + return result, err +} + +func (ep *EntitlementPlan) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = ep.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = ep.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = ep.QueryEvents().All(ctx) + } + return result, err +} + +func (ep *EntitlementPlan) Features(ctx context.Context) (result []*EntitlementPlanFeature, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = ep.NamedFeatures(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = ep.Edges.FeaturesOrErr() + } + if IsNotLoaded(err) { + result, err = ep.QueryFeatures().All(ctx) + } + return result, err +} + +func (epf *EntitlementPlanFeature) Owner(ctx context.Context) (*Organization, error) { + result, err := epf.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = epf.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (epf *EntitlementPlanFeature) Plan(ctx context.Context) (*EntitlementPlan, error) { + result, err := epf.Edges.PlanOrErr() + if IsNotLoaded(err) { + result, err = epf.QueryPlan().Only(ctx) + } + return result, err +} + +func (epf *EntitlementPlanFeature) Feature(ctx context.Context) (*Feature, error) { + result, err := epf.Edges.FeatureOrErr() + if IsNotLoaded(err) { + result, err = epf.QueryFeature().Only(ctx) + } + return result, err +} + +func (epf *EntitlementPlanFeature) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = epf.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = epf.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = epf.QueryEvents().All(ctx) + } + return result, err +} + +func (e *Entity) Owner(ctx context.Context) (*Organization, error) { + result, err := e.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = e.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (e *Entity) Contacts(ctx context.Context) (result []*Contact, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedContacts(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.ContactsOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryContacts().All(ctx) + } + return result, err +} + +func (e *Entity) Documents(ctx context.Context) (result []*DocumentData, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedDocuments(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.DocumentsOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryDocuments().All(ctx) + } + return result, err +} + +func (e *Entity) Notes(ctx context.Context) (result []*Note, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedNotes(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.NotesOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryNotes().All(ctx) + } + return result, err +} + +func (e *Entity) Files(ctx context.Context) (result []*File, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedFiles(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.FilesOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryFiles().All(ctx) + } + return result, err +} + +func (e *Entity) EntityType(ctx context.Context) (*EntityType, error) { + result, err := e.Edges.EntityTypeOrErr() + if IsNotLoaded(err) { + result, err = e.QueryEntityType().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (et *EntityType) Owner(ctx context.Context) (*Organization, error) { + result, err := et.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = et.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (et *EntityType) Entities(ctx context.Context) (result []*Entity, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = et.NamedEntities(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = et.Edges.EntitiesOrErr() + } + if IsNotLoaded(err) { + result, err = et.QueryEntities().All(ctx) + } + return result, err +} + +func (e *Event) User(ctx context.Context) (result []*User, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedUser(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.UserOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryUser().All(ctx) + } + return result, err +} + +func (e *Event) Group(ctx context.Context) (result []*Group, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedGroup(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.GroupOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryGroup().All(ctx) + } + return result, err +} + +func (e *Event) Integration(ctx context.Context) (result []*Integration, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedIntegration(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.IntegrationOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryIntegration().All(ctx) + } + return result, err +} + +func (e *Event) Organization(ctx context.Context) (result []*Organization, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedOrganization(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.OrganizationOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryOrganization().All(ctx) + } + return result, err +} + +func (e *Event) Invite(ctx context.Context) (result []*Invite, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedInvite(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.InviteOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryInvite().All(ctx) + } + return result, err +} + +func (e *Event) Feature(ctx context.Context) (result []*Feature, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedFeature(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.FeatureOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryFeature().All(ctx) + } + return result, err +} + +func (e *Event) Entitlementplan(ctx context.Context) (result []*EntitlementPlan, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedEntitlementplan(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.EntitlementplanOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryEntitlementplan().All(ctx) + } + return result, err +} + +func (e *Event) Entitlementplanfeature(ctx context.Context) (result []*EntitlementPlanFeature, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedEntitlementplanfeature(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.EntitlementplanfeatureOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryEntitlementplanfeature().All(ctx) + } + return result, err +} + +func (e *Event) PersonalAccessToken(ctx context.Context) (result []*PersonalAccessToken, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedPersonalAccessToken(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.PersonalAccessTokenOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryPersonalAccessToken().All(ctx) + } + return result, err +} + +func (e *Event) Oauth2token(ctx context.Context) (result []*OhAuthTooToken, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedOauth2token(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.Oauth2tokenOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryOauth2token().All(ctx) + } + return result, err +} + +func (e *Event) Hush(ctx context.Context) (result []*Hush, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedHush(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.HushOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryHush().All(ctx) + } + return result, err +} + +func (e *Event) Orgmembership(ctx context.Context) (result []*OrgMembership, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedOrgmembership(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.OrgmembershipOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryOrgmembership().All(ctx) + } + return result, err +} + +func (e *Event) Groupmembership(ctx context.Context) (result []*GroupMembership, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedGroupmembership(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.GroupmembershipOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryGroupmembership().All(ctx) + } + return result, err +} + +func (e *Event) Entitlement(ctx context.Context) (result []*Entitlement, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedEntitlement(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.EntitlementOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryEntitlement().All(ctx) + } + return result, err +} + +func (e *Event) Webhook(ctx context.Context) (result []*Webhook, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedWebhook(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.WebhookOrErr() + } + if IsNotLoaded(err) { + result, err = e.QueryWebhook().All(ctx) + } + return result, err +} + +func (e *Event) Subscriber(ctx context.Context) (result []*Subscriber, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = e.NamedSubscriber(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = e.Edges.SubscriberOrErr() + } + if IsNotLoaded(err) { + result, err = e.QuerySubscriber().All(ctx) + } + return result, err +} + +func (f *Feature) Owner(ctx context.Context) (*Organization, error) { + result, err := f.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = f.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (f *Feature) Plans(ctx context.Context) (result []*EntitlementPlan, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = f.NamedPlans(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = f.Edges.PlansOrErr() + } + if IsNotLoaded(err) { + result, err = f.QueryPlans().All(ctx) + } + return result, err +} + +func (f *Feature) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = f.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = f.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = f.QueryEvents().All(ctx) + } + return result, err +} + +func (f *Feature) Features(ctx context.Context) (result []*EntitlementPlanFeature, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = f.NamedFeatures(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = f.Edges.FeaturesOrErr() + } + if IsNotLoaded(err) { + result, err = f.QueryFeatures().All(ctx) + } + return result, err +} + +func (f *File) User(ctx context.Context) (*User, error) { + result, err := f.Edges.UserOrErr() + if IsNotLoaded(err) { + result, err = f.QueryUser().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (f *File) Organization(ctx context.Context) (result []*Organization, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = f.NamedOrganization(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = f.Edges.OrganizationOrErr() + } + if IsNotLoaded(err) { + result, err = f.QueryOrganization().All(ctx) + } + return result, err +} + +func (f *File) Entity(ctx context.Context) (result []*Entity, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = f.NamedEntity(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = f.Edges.EntityOrErr() + } + if IsNotLoaded(err) { + result, err = f.QueryEntity().All(ctx) + } + return result, err +} + +func (f *File) Group(ctx context.Context) (result []*Group, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = f.NamedGroup(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = f.Edges.GroupOrErr() + } + if IsNotLoaded(err) { + result, err = f.QueryGroup().All(ctx) + } + return result, err +} + +func (gr *Group) Owner(ctx context.Context) (*Organization, error) { + result, err := gr.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = gr.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (gr *Group) Setting(ctx context.Context) (*GroupSetting, error) { + result, err := gr.Edges.SettingOrErr() + if IsNotLoaded(err) { + result, err = gr.QuerySetting().Only(ctx) + } + return result, err +} + +func (gr *Group) Users(ctx context.Context) (result []*User, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = gr.NamedUsers(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = gr.Edges.UsersOrErr() + } + if IsNotLoaded(err) { + result, err = gr.QueryUsers().All(ctx) + } + return result, err +} + +func (gr *Group) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = gr.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = gr.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = gr.QueryEvents().All(ctx) + } + return result, err +} + +func (gr *Group) Integrations(ctx context.Context) (result []*Integration, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = gr.NamedIntegrations(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = gr.Edges.IntegrationsOrErr() + } + if IsNotLoaded(err) { + result, err = gr.QueryIntegrations().All(ctx) + } + return result, err +} + +func (gr *Group) Files(ctx context.Context) (result []*File, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = gr.NamedFiles(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = gr.Edges.FilesOrErr() + } + if IsNotLoaded(err) { + result, err = gr.QueryFiles().All(ctx) + } + return result, err +} + +func (gr *Group) Members(ctx context.Context) (result []*GroupMembership, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = gr.NamedMembers(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = gr.Edges.MembersOrErr() + } + if IsNotLoaded(err) { + result, err = gr.QueryMembers().All(ctx) + } + return result, err +} + +func (gm *GroupMembership) Group(ctx context.Context) (*Group, error) { + result, err := gm.Edges.GroupOrErr() + if IsNotLoaded(err) { + result, err = gm.QueryGroup().Only(ctx) + } + return result, err +} + +func (gm *GroupMembership) User(ctx context.Context) (*User, error) { + result, err := gm.Edges.UserOrErr() + if IsNotLoaded(err) { + result, err = gm.QueryUser().Only(ctx) + } + return result, err +} + +func (gm *GroupMembership) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = gm.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = gm.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = gm.QueryEvents().All(ctx) + } + return result, err +} + +func (gs *GroupSetting) Group(ctx context.Context) (*Group, error) { + result, err := gs.Edges.GroupOrErr() + if IsNotLoaded(err) { + result, err = gs.QueryGroup().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (h *Hush) Integrations(ctx context.Context) (result []*Integration, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = h.NamedIntegrations(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = h.Edges.IntegrationsOrErr() + } + if IsNotLoaded(err) { + result, err = h.QueryIntegrations().All(ctx) + } + return result, err +} + +func (h *Hush) Organization(ctx context.Context) (result []*Organization, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = h.NamedOrganization(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = h.Edges.OrganizationOrErr() + } + if IsNotLoaded(err) { + result, err = h.QueryOrganization().All(ctx) + } + return result, err +} + +func (h *Hush) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = h.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = h.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = h.QueryEvents().All(ctx) + } + return result, err +} + +func (i *Integration) Owner(ctx context.Context) (*Organization, error) { + result, err := i.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = i.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (i *Integration) Secrets(ctx context.Context) (result []*Hush, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = i.NamedSecrets(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = i.Edges.SecretsOrErr() + } + if IsNotLoaded(err) { + result, err = i.QuerySecrets().All(ctx) + } + return result, err +} + +func (i *Integration) Oauth2tokens(ctx context.Context) (result []*OhAuthTooToken, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = i.NamedOauth2tokens(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = i.Edges.Oauth2tokensOrErr() + } + if IsNotLoaded(err) { + result, err = i.QueryOauth2tokens().All(ctx) + } + return result, err +} + +func (i *Integration) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = i.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = i.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = i.QueryEvents().All(ctx) + } + return result, err +} + +func (i *Integration) Webhooks(ctx context.Context) (result []*Webhook, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = i.NamedWebhooks(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = i.Edges.WebhooksOrErr() + } + if IsNotLoaded(err) { + result, err = i.QueryWebhooks().All(ctx) + } + return result, err +} + +func (i *Invite) Owner(ctx context.Context) (*Organization, error) { + result, err := i.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = i.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (i *Invite) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = i.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = i.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = i.QueryEvents().All(ctx) + } + return result, err +} + +func (n *Note) Owner(ctx context.Context) (*Organization, error) { + result, err := n.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = n.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (n *Note) Entity(ctx context.Context) (*Entity, error) { + result, err := n.Edges.EntityOrErr() + if IsNotLoaded(err) { + result, err = n.QueryEntity().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (op *OauthProvider) Owner(ctx context.Context) (*Organization, error) { + result, err := op.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = op.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (oatt *OhAuthTooToken) Integration(ctx context.Context) (result []*Integration, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = oatt.NamedIntegration(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = oatt.Edges.IntegrationOrErr() + } + if IsNotLoaded(err) { + result, err = oatt.QueryIntegration().All(ctx) + } + return result, err +} + +func (oatt *OhAuthTooToken) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = oatt.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = oatt.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = oatt.QueryEvents().All(ctx) + } + return result, err +} + +func (om *OrgMembership) Organization(ctx context.Context) (*Organization, error) { + result, err := om.Edges.OrganizationOrErr() + if IsNotLoaded(err) { + result, err = om.QueryOrganization().Only(ctx) + } + return result, err +} + +func (om *OrgMembership) User(ctx context.Context) (*User, error) { + result, err := om.Edges.UserOrErr() + if IsNotLoaded(err) { + result, err = om.QueryUser().Only(ctx) + } + return result, err +} + +func (om *OrgMembership) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = om.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = om.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = om.QueryEvents().All(ctx) + } + return result, err +} + +func (o *Organization) Parent(ctx context.Context) (*Organization, error) { + result, err := o.Edges.ParentOrErr() + if IsNotLoaded(err) { + result, err = o.QueryParent().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (o *Organization) Children( + ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *OrganizationOrder, where *OrganizationWhereInput, +) (*OrganizationConnection, error) { + opts := []OrganizationPaginateOption{ + WithOrganizationOrder(orderBy), + WithOrganizationFilter(where.Filter), + } + alias := graphql.GetFieldContext(ctx).Field.Alias + totalCount, hasTotalCount := o.Edges.totalCount[1][alias] + if nodes, err := o.NamedChildren(alias); err == nil || hasTotalCount { + pager, err := newOrganizationPager(opts, last != nil) + if err != nil { + return nil, err + } + conn := &OrganizationConnection{Edges: []*OrganizationEdge{}, TotalCount: totalCount} + conn.build(nodes, pager, after, first, before, last) + return conn, nil + } + return o.QueryChildren().Paginate(ctx, after, first, before, last, opts...) +} + +func (o *Organization) Groups(ctx context.Context) (result []*Group, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedGroups(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.GroupsOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryGroups().All(ctx) + } + return result, err +} + +func (o *Organization) Templates(ctx context.Context) (result []*Template, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedTemplates(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.TemplatesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryTemplates().All(ctx) + } + return result, err +} + +func (o *Organization) Integrations(ctx context.Context) (result []*Integration, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedIntegrations(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.IntegrationsOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryIntegrations().All(ctx) + } + return result, err +} + +func (o *Organization) Setting(ctx context.Context) (*OrganizationSetting, error) { + result, err := o.Edges.SettingOrErr() + if IsNotLoaded(err) { + result, err = o.QuerySetting().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (o *Organization) Documentdata(ctx context.Context) (result []*DocumentData, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedDocumentdata(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.DocumentdataOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryDocumentdata().All(ctx) + } + return result, err +} + +func (o *Organization) Entitlements(ctx context.Context) (result []*Entitlement, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedEntitlements(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.EntitlementsOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryEntitlements().All(ctx) + } + return result, err +} + +func (o *Organization) OrganizationEntitlement(ctx context.Context) (result []*Entitlement, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedOrganizationEntitlement(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.OrganizationEntitlementOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryOrganizationEntitlement().All(ctx) + } + return result, err +} + +func (o *Organization) PersonalAccessTokens(ctx context.Context) (result []*PersonalAccessToken, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedPersonalAccessTokens(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.PersonalAccessTokensOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryPersonalAccessTokens().All(ctx) + } + return result, err +} + +func (o *Organization) APITokens(ctx context.Context) (result []*APIToken, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedAPITokens(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.APITokensOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryAPITokens().All(ctx) + } + return result, err +} + +func (o *Organization) Oauthprovider(ctx context.Context) (result []*OauthProvider, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedOauthprovider(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.OauthproviderOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryOauthprovider().All(ctx) + } + return result, err +} + +func (o *Organization) Users(ctx context.Context) (result []*User, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedUsers(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.UsersOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryUsers().All(ctx) + } + return result, err +} + +func (o *Organization) Invites(ctx context.Context) (result []*Invite, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedInvites(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.InvitesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryInvites().All(ctx) + } + return result, err +} + +func (o *Organization) Subscribers(ctx context.Context) (result []*Subscriber, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedSubscribers(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.SubscribersOrErr() + } + if IsNotLoaded(err) { + result, err = o.QuerySubscribers().All(ctx) + } + return result, err +} + +func (o *Organization) Webhooks(ctx context.Context) (result []*Webhook, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedWebhooks(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.WebhooksOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryWebhooks().All(ctx) + } + return result, err +} + +func (o *Organization) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryEvents().All(ctx) + } + return result, err +} + +func (o *Organization) Secrets(ctx context.Context) (result []*Hush, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedSecrets(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.SecretsOrErr() + } + if IsNotLoaded(err) { + result, err = o.QuerySecrets().All(ctx) + } + return result, err +} + +func (o *Organization) Features(ctx context.Context) (result []*Feature, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedFeatures(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.FeaturesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryFeatures().All(ctx) + } + return result, err +} + +func (o *Organization) Files(ctx context.Context) (result []*File, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedFiles(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.FilesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryFiles().All(ctx) + } + return result, err +} + +func (o *Organization) Entitlementplans(ctx context.Context) (result []*EntitlementPlan, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedEntitlementplans(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.EntitlementplansOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryEntitlementplans().All(ctx) + } + return result, err +} + +func (o *Organization) Entitlementplanfeatures(ctx context.Context) (result []*EntitlementPlanFeature, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedEntitlementplanfeatures(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.EntitlementplanfeaturesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryEntitlementplanfeatures().All(ctx) + } + return result, err +} + +func (o *Organization) Entities(ctx context.Context) (result []*Entity, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedEntities(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.EntitiesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryEntities().All(ctx) + } + return result, err +} + +func (o *Organization) Entitytypes(ctx context.Context) (result []*EntityType, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedEntitytypes(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.EntitytypesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryEntitytypes().All(ctx) + } + return result, err +} + +func (o *Organization) Contacts(ctx context.Context) (result []*Contact, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedContacts(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.ContactsOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryContacts().All(ctx) + } + return result, err +} + +func (o *Organization) Notes(ctx context.Context) (result []*Note, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedNotes(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.NotesOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryNotes().All(ctx) + } + return result, err +} + +func (o *Organization) Members(ctx context.Context) (result []*OrgMembership, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = o.NamedMembers(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = o.Edges.MembersOrErr() + } + if IsNotLoaded(err) { + result, err = o.QueryMembers().All(ctx) + } + return result, err +} + +func (os *OrganizationSetting) Organization(ctx context.Context) (*Organization, error) { + result, err := os.Edges.OrganizationOrErr() + if IsNotLoaded(err) { + result, err = os.QueryOrganization().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (pat *PersonalAccessToken) Owner(ctx context.Context) (*User, error) { + result, err := pat.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = pat.QueryOwner().Only(ctx) + } + return result, err +} + +func (pat *PersonalAccessToken) Organizations(ctx context.Context) (result []*Organization, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = pat.NamedOrganizations(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = pat.Edges.OrganizationsOrErr() + } + if IsNotLoaded(err) { + result, err = pat.QueryOrganizations().All(ctx) + } + return result, err +} + +func (pat *PersonalAccessToken) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = pat.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = pat.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = pat.QueryEvents().All(ctx) + } + return result, err +} + +func (s *Subscriber) Owner(ctx context.Context) (*Organization, error) { + result, err := s.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = s.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (s *Subscriber) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = s.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = s.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = s.QueryEvents().All(ctx) + } + return result, err +} + +func (ts *TFASetting) Owner(ctx context.Context) (*User, error) { + result, err := ts.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = ts.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (t *Template) Owner(ctx context.Context) (*Organization, error) { + result, err := t.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = t.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (t *Template) Documents(ctx context.Context) (result []*DocumentData, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = t.NamedDocuments(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = t.Edges.DocumentsOrErr() + } + if IsNotLoaded(err) { + result, err = t.QueryDocuments().All(ctx) + } + return result, err +} + +func (u *User) PersonalAccessTokens(ctx context.Context) (result []*PersonalAccessToken, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedPersonalAccessTokens(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.PersonalAccessTokensOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryPersonalAccessTokens().All(ctx) + } + return result, err +} + +func (u *User) TfaSettings(ctx context.Context) (result []*TFASetting, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedTfaSettings(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.TfaSettingsOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryTfaSettings().All(ctx) + } + return result, err +} + +func (u *User) Setting(ctx context.Context) (*UserSetting, error) { + result, err := u.Edges.SettingOrErr() + if IsNotLoaded(err) { + result, err = u.QuerySetting().Only(ctx) + } + return result, err +} + +func (u *User) Groups(ctx context.Context) (result []*Group, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedGroups(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.GroupsOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryGroups().All(ctx) + } + return result, err +} + +func (u *User) Organizations(ctx context.Context) (result []*Organization, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedOrganizations(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.OrganizationsOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryOrganizations().All(ctx) + } + return result, err +} + +func (u *User) Files(ctx context.Context) (result []*File, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedFiles(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.FilesOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryFiles().All(ctx) + } + return result, err +} + +func (u *User) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryEvents().All(ctx) + } + return result, err +} + +func (u *User) GroupMemberships(ctx context.Context) (result []*GroupMembership, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedGroupMemberships(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.GroupMembershipsOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryGroupMemberships().All(ctx) + } + return result, err +} + +func (u *User) OrgMemberships(ctx context.Context) (result []*OrgMembership, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = u.NamedOrgMemberships(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = u.Edges.OrgMembershipsOrErr() + } + if IsNotLoaded(err) { + result, err = u.QueryOrgMemberships().All(ctx) + } + return result, err +} + +func (us *UserSetting) User(ctx context.Context) (*User, error) { + result, err := us.Edges.UserOrErr() + if IsNotLoaded(err) { + result, err = us.QueryUser().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (us *UserSetting) DefaultOrg(ctx context.Context) (*Organization, error) { + result, err := us.Edges.DefaultOrgOrErr() + if IsNotLoaded(err) { + result, err = us.QueryDefaultOrg().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (w *Webhook) Owner(ctx context.Context) (*Organization, error) { + result, err := w.Edges.OwnerOrErr() + if IsNotLoaded(err) { + result, err = w.QueryOwner().Only(ctx) + } + return result, MaskNotFound(err) +} + +func (w *Webhook) Events(ctx context.Context) (result []*Event, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = w.NamedEvents(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = w.Edges.EventsOrErr() + } + if IsNotLoaded(err) { + result, err = w.QueryEvents().All(ctx) + } + return result, err +} + +func (w *Webhook) Integrations(ctx context.Context) (result []*Integration, err error) { + if fc := graphql.GetFieldContext(ctx); fc != nil && fc.Field.Alias != "" { + result, err = w.NamedIntegrations(graphql.GetFieldContext(ctx).Field.Alias) + } else { + result, err = w.Edges.IntegrationsOrErr() + } + if IsNotLoaded(err) { + result, err = w.QueryIntegrations().All(ctx) + } + return result, err +} diff --git a/internal/ent/generated/gql_mutation_input.go b/internal/ent/generated/gql_mutation_input.go new file mode 100644 index 0000000..173f769 --- /dev/null +++ b/internal/ent/generated/gql_mutation_input.go @@ -0,0 +1,4476 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "time" + + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/pkg/enums" +) + +// CreateAPITokenInput represents a mutation input for creating apitokens. +type CreateAPITokenInput struct { + Tags []string + Name string + ExpiresAt *time.Time + Description *string + Scopes []string + LastUsedAt *time.Time + OwnerID *string +} + +// Mutate applies the CreateAPITokenInput on the APITokenMutation builder. +func (i *CreateAPITokenInput) Mutate(m *APITokenMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.ExpiresAt; v != nil { + m.SetExpiresAt(*v) + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Scopes; v != nil { + m.SetScopes(v) + } + if v := i.LastUsedAt; v != nil { + m.SetLastUsedAt(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } +} + +// SetInput applies the change-set in the CreateAPITokenInput on the APITokenCreate builder. +func (c *APITokenCreate) SetInput(i CreateAPITokenInput) *APITokenCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateAPITokenInput represents a mutation input for updating apitokens. +type UpdateAPITokenInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + ClearDescription bool + Description *string + ClearScopes bool + Scopes []string + AppendScopes []string + ClearLastUsedAt bool + LastUsedAt *time.Time + ClearOwner bool + OwnerID *string +} + +// Mutate applies the UpdateAPITokenInput on the APITokenMutation builder. +func (i *UpdateAPITokenInput) Mutate(m *APITokenMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearScopes { + m.ClearScopes() + } + if v := i.Scopes; v != nil { + m.SetScopes(v) + } + if i.AppendScopes != nil { + m.AppendScopes(i.Scopes) + } + if i.ClearLastUsedAt { + m.ClearLastUsedAt() + } + if v := i.LastUsedAt; v != nil { + m.SetLastUsedAt(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } +} + +// SetInput applies the change-set in the UpdateAPITokenInput on the APITokenUpdate builder. +func (c *APITokenUpdate) SetInput(i UpdateAPITokenInput) *APITokenUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateAPITokenInput on the APITokenUpdateOne builder. +func (c *APITokenUpdateOne) SetInput(i UpdateAPITokenInput) *APITokenUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateContactInput represents a mutation input for creating contacts. +type CreateContactInput struct { + Tags []string + FullName string + Title *string + Company *string + Email *string + PhoneNumber *string + Address *string + Status *enums.UserStatus + OwnerID *string + EntityIDs []string +} + +// Mutate applies the CreateContactInput on the ContactMutation builder. +func (i *CreateContactInput) Mutate(m *ContactMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetFullName(i.FullName) + if v := i.Title; v != nil { + m.SetTitle(*v) + } + if v := i.Company; v != nil { + m.SetCompany(*v) + } + if v := i.Email; v != nil { + m.SetEmail(*v) + } + if v := i.PhoneNumber; v != nil { + m.SetPhoneNumber(*v) + } + if v := i.Address; v != nil { + m.SetAddress(*v) + } + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.EntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } +} + +// SetInput applies the change-set in the CreateContactInput on the ContactCreate builder. +func (c *ContactCreate) SetInput(i CreateContactInput) *ContactCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateContactInput represents a mutation input for updating contacts. +type UpdateContactInput struct { + ClearTags bool + Tags []string + AppendTags []string + FullName *string + ClearTitle bool + Title *string + ClearCompany bool + Company *string + ClearEmail bool + Email *string + ClearPhoneNumber bool + PhoneNumber *string + ClearAddress bool + Address *string + Status *enums.UserStatus + ClearOwner bool + OwnerID *string + ClearEntities bool + AddEntityIDs []string + RemoveEntityIDs []string +} + +// Mutate applies the UpdateContactInput on the ContactMutation builder. +func (i *UpdateContactInput) Mutate(m *ContactMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.FullName; v != nil { + m.SetFullName(*v) + } + if i.ClearTitle { + m.ClearTitle() + } + if v := i.Title; v != nil { + m.SetTitle(*v) + } + if i.ClearCompany { + m.ClearCompany() + } + if v := i.Company; v != nil { + m.SetCompany(*v) + } + if i.ClearEmail { + m.ClearEmail() + } + if v := i.Email; v != nil { + m.SetEmail(*v) + } + if i.ClearPhoneNumber { + m.ClearPhoneNumber() + } + if v := i.PhoneNumber; v != nil { + m.SetPhoneNumber(*v) + } + if i.ClearAddress { + m.ClearAddress() + } + if v := i.Address; v != nil { + m.SetAddress(*v) + } + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEntities { + m.ClearEntities() + } + if v := i.AddEntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } + if v := i.RemoveEntityIDs; len(v) > 0 { + m.RemoveEntityIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateContactInput on the ContactUpdate builder. +func (c *ContactUpdate) SetInput(i UpdateContactInput) *ContactUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateContactInput on the ContactUpdateOne builder. +func (c *ContactUpdateOne) SetInput(i UpdateContactInput) *ContactUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateDocumentDataInput represents a mutation input for creating documentdataslice. +type CreateDocumentDataInput struct { + Tags []string + Data customtypes.JSONObject + OwnerID *string + TemplateID string + EntityIDs []string +} + +// Mutate applies the CreateDocumentDataInput on the DocumentDataMutation builder. +func (i *CreateDocumentDataInput) Mutate(m *DocumentDataMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.Data; v != nil { + m.SetData(v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + m.SetTemplateID(i.TemplateID) + if v := i.EntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } +} + +// SetInput applies the change-set in the CreateDocumentDataInput on the DocumentDataCreate builder. +func (c *DocumentDataCreate) SetInput(i CreateDocumentDataInput) *DocumentDataCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateDocumentDataInput represents a mutation input for updating documentdataslice. +type UpdateDocumentDataInput struct { + ClearTags bool + Tags []string + AppendTags []string + Data customtypes.JSONObject + ClearOwner bool + OwnerID *string + TemplateID *string + ClearEntity bool + AddEntityIDs []string + RemoveEntityIDs []string +} + +// Mutate applies the UpdateDocumentDataInput on the DocumentDataMutation builder. +func (i *UpdateDocumentDataInput) Mutate(m *DocumentDataMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Data; v != nil { + m.SetData(v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.TemplateID; v != nil { + m.SetTemplateID(*v) + } + if i.ClearEntity { + m.ClearEntity() + } + if v := i.AddEntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } + if v := i.RemoveEntityIDs; len(v) > 0 { + m.RemoveEntityIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateDocumentDataInput on the DocumentDataUpdate builder. +func (c *DocumentDataUpdate) SetInput(i UpdateDocumentDataInput) *DocumentDataUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateDocumentDataInput on the DocumentDataUpdateOne builder. +func (c *DocumentDataUpdateOne) SetInput(i UpdateDocumentDataInput) *DocumentDataUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateEntitlementInput represents a mutation input for creating entitlements. +type CreateEntitlementInput struct { + Tags []string + ExternalCustomerID *string + ExternalSubscriptionID *string + ExpiresAt *time.Time + Cancelled *bool + OwnerID *string + PlanID string + OrganizationID string + EventIDs []string +} + +// Mutate applies the CreateEntitlementInput on the EntitlementMutation builder. +func (i *CreateEntitlementInput) Mutate(m *EntitlementMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.ExternalCustomerID; v != nil { + m.SetExternalCustomerID(*v) + } + if v := i.ExternalSubscriptionID; v != nil { + m.SetExternalSubscriptionID(*v) + } + if v := i.ExpiresAt; v != nil { + m.SetExpiresAt(*v) + } + if v := i.Cancelled; v != nil { + m.SetCancelled(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + m.SetPlanID(i.PlanID) + m.SetOrganizationID(i.OrganizationID) + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateEntitlementInput on the EntitlementCreate builder. +func (c *EntitlementCreate) SetInput(i CreateEntitlementInput) *EntitlementCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateEntitlementInput represents a mutation input for updating entitlements. +type UpdateEntitlementInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClearExternalCustomerID bool + ExternalCustomerID *string + ClearExternalSubscriptionID bool + ExternalSubscriptionID *string + ClearExpiresAt bool + ExpiresAt *time.Time + Cancelled *bool + ClearOwner bool + OwnerID *string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateEntitlementInput on the EntitlementMutation builder. +func (i *UpdateEntitlementInput) Mutate(m *EntitlementMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if i.ClearExternalCustomerID { + m.ClearExternalCustomerID() + } + if v := i.ExternalCustomerID; v != nil { + m.SetExternalCustomerID(*v) + } + if i.ClearExternalSubscriptionID { + m.ClearExternalSubscriptionID() + } + if v := i.ExternalSubscriptionID; v != nil { + m.SetExternalSubscriptionID(*v) + } + if i.ClearExpiresAt { + m.ClearExpiresAt() + } + if v := i.ExpiresAt; v != nil { + m.SetExpiresAt(*v) + } + if v := i.Cancelled; v != nil { + m.SetCancelled(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateEntitlementInput on the EntitlementUpdate builder. +func (c *EntitlementUpdate) SetInput(i UpdateEntitlementInput) *EntitlementUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateEntitlementInput on the EntitlementUpdateOne builder. +func (c *EntitlementUpdateOne) SetInput(i UpdateEntitlementInput) *EntitlementUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateEntitlementPlanInput represents a mutation input for creating entitlementplans. +type CreateEntitlementPlanInput struct { + Tags []string + DisplayName *string + Name string + Description *string + Version string + Metadata map[string]interface{} + OwnerID *string + EntitlementIDs []string + BaseFeatureIDs []string + EventIDs []string +} + +// Mutate applies the CreateEntitlementPlanInput on the EntitlementPlanMutation builder. +func (i *CreateEntitlementPlanInput) Mutate(m *EntitlementPlanMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + m.SetName(i.Name) + if v := i.Description; v != nil { + m.SetDescription(*v) + } + m.SetVersion(i.Version) + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.EntitlementIDs; len(v) > 0 { + m.AddEntitlementIDs(v...) + } + if v := i.BaseFeatureIDs; len(v) > 0 { + m.AddBaseFeatureIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateEntitlementPlanInput on the EntitlementPlanCreate builder. +func (c *EntitlementPlanCreate) SetInput(i CreateEntitlementPlanInput) *EntitlementPlanCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateEntitlementPlanInput represents a mutation input for updating entitlementplans. +type UpdateEntitlementPlanInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClearDisplayName bool + DisplayName *string + ClearDescription bool + Description *string + ClearMetadata bool + Metadata map[string]interface{} + ClearOwner bool + OwnerID *string + ClearEntitlements bool + AddEntitlementIDs []string + RemoveEntitlementIDs []string + ClearBaseFeatures bool + AddBaseFeatureIDs []string + RemoveBaseFeatureIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateEntitlementPlanInput on the EntitlementPlanMutation builder. +func (i *UpdateEntitlementPlanInput) Mutate(m *EntitlementPlanMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if i.ClearDisplayName { + m.ClearDisplayName() + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearMetadata { + m.ClearMetadata() + } + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEntitlements { + m.ClearEntitlements() + } + if v := i.AddEntitlementIDs; len(v) > 0 { + m.AddEntitlementIDs(v...) + } + if v := i.RemoveEntitlementIDs; len(v) > 0 { + m.RemoveEntitlementIDs(v...) + } + if i.ClearBaseFeatures { + m.ClearBaseFeatures() + } + if v := i.AddBaseFeatureIDs; len(v) > 0 { + m.AddBaseFeatureIDs(v...) + } + if v := i.RemoveBaseFeatureIDs; len(v) > 0 { + m.RemoveBaseFeatureIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateEntitlementPlanInput on the EntitlementPlanUpdate builder. +func (c *EntitlementPlanUpdate) SetInput(i UpdateEntitlementPlanInput) *EntitlementPlanUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateEntitlementPlanInput on the EntitlementPlanUpdateOne builder. +func (c *EntitlementPlanUpdateOne) SetInput(i UpdateEntitlementPlanInput) *EntitlementPlanUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateEntitlementPlanFeatureInput represents a mutation input for creating entitlementplanfeatures. +type CreateEntitlementPlanFeatureInput struct { + Tags []string + Metadata map[string]interface{} + OwnerID *string + PlanID string + FeatureID string + EventIDs []string +} + +// Mutate applies the CreateEntitlementPlanFeatureInput on the EntitlementPlanFeatureMutation builder. +func (i *CreateEntitlementPlanFeatureInput) Mutate(m *EntitlementPlanFeatureMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + m.SetPlanID(i.PlanID) + m.SetFeatureID(i.FeatureID) + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateEntitlementPlanFeatureInput on the EntitlementPlanFeatureCreate builder. +func (c *EntitlementPlanFeatureCreate) SetInput(i CreateEntitlementPlanFeatureInput) *EntitlementPlanFeatureCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateEntitlementPlanFeatureInput represents a mutation input for updating entitlementplanfeatures. +type UpdateEntitlementPlanFeatureInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClearMetadata bool + Metadata map[string]interface{} + ClearOwner bool + OwnerID *string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateEntitlementPlanFeatureInput on the EntitlementPlanFeatureMutation builder. +func (i *UpdateEntitlementPlanFeatureInput) Mutate(m *EntitlementPlanFeatureMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if i.ClearMetadata { + m.ClearMetadata() + } + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateEntitlementPlanFeatureInput on the EntitlementPlanFeatureUpdate builder. +func (c *EntitlementPlanFeatureUpdate) SetInput(i UpdateEntitlementPlanFeatureInput) *EntitlementPlanFeatureUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateEntitlementPlanFeatureInput on the EntitlementPlanFeatureUpdateOne builder. +func (c *EntitlementPlanFeatureUpdateOne) SetInput(i UpdateEntitlementPlanFeatureInput) *EntitlementPlanFeatureUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateEntityInput represents a mutation input for creating entities. +type CreateEntityInput struct { + Tags []string + Name *string + DisplayName *string + Description *string + Domains []string + Status *string + OwnerID *string + ContactIDs []string + DocumentIDs []string + NoteIDs []string + FileIDs []string + EntityTypeID *string +} + +// Mutate applies the CreateEntityInput on the EntityMutation builder. +func (i *CreateEntityInput) Mutate(m *EntityMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Domains; v != nil { + m.SetDomains(v) + } + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.ContactIDs; len(v) > 0 { + m.AddContactIDs(v...) + } + if v := i.DocumentIDs; len(v) > 0 { + m.AddDocumentIDs(v...) + } + if v := i.NoteIDs; len(v) > 0 { + m.AddNoteIDs(v...) + } + if v := i.FileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } + if v := i.EntityTypeID; v != nil { + m.SetEntityTypeID(*v) + } +} + +// SetInput applies the change-set in the CreateEntityInput on the EntityCreate builder. +func (c *EntityCreate) SetInput(i CreateEntityInput) *EntityCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateEntityInput represents a mutation input for updating entities. +type UpdateEntityInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClearName bool + Name *string + ClearDisplayName bool + DisplayName *string + ClearDescription bool + Description *string + ClearDomains bool + Domains []string + AppendDomains []string + ClearStatus bool + Status *string + ClearOwner bool + OwnerID *string + ClearContacts bool + AddContactIDs []string + RemoveContactIDs []string + ClearDocuments bool + AddDocumentIDs []string + RemoveDocumentIDs []string + ClearNotes bool + AddNoteIDs []string + RemoveNoteIDs []string + ClearFiles bool + AddFileIDs []string + RemoveFileIDs []string + ClearEntityType bool + EntityTypeID *string +} + +// Mutate applies the UpdateEntityInput on the EntityMutation builder. +func (i *UpdateEntityInput) Mutate(m *EntityMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if i.ClearName { + m.ClearName() + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearDisplayName { + m.ClearDisplayName() + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearDomains { + m.ClearDomains() + } + if v := i.Domains; v != nil { + m.SetDomains(v) + } + if i.AppendDomains != nil { + m.AppendDomains(i.Domains) + } + if i.ClearStatus { + m.ClearStatus() + } + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearContacts { + m.ClearContacts() + } + if v := i.AddContactIDs; len(v) > 0 { + m.AddContactIDs(v...) + } + if v := i.RemoveContactIDs; len(v) > 0 { + m.RemoveContactIDs(v...) + } + if i.ClearDocuments { + m.ClearDocuments() + } + if v := i.AddDocumentIDs; len(v) > 0 { + m.AddDocumentIDs(v...) + } + if v := i.RemoveDocumentIDs; len(v) > 0 { + m.RemoveDocumentIDs(v...) + } + if i.ClearNotes { + m.ClearNotes() + } + if v := i.AddNoteIDs; len(v) > 0 { + m.AddNoteIDs(v...) + } + if v := i.RemoveNoteIDs; len(v) > 0 { + m.RemoveNoteIDs(v...) + } + if i.ClearFiles { + m.ClearFiles() + } + if v := i.AddFileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } + if v := i.RemoveFileIDs; len(v) > 0 { + m.RemoveFileIDs(v...) + } + if i.ClearEntityType { + m.ClearEntityType() + } + if v := i.EntityTypeID; v != nil { + m.SetEntityTypeID(*v) + } +} + +// SetInput applies the change-set in the UpdateEntityInput on the EntityUpdate builder. +func (c *EntityUpdate) SetInput(i UpdateEntityInput) *EntityUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateEntityInput on the EntityUpdateOne builder. +func (c *EntityUpdateOne) SetInput(i UpdateEntityInput) *EntityUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateEntityTypeInput represents a mutation input for creating entitytypes. +type CreateEntityTypeInput struct { + Tags []string + Name string + OwnerID *string + EntityIDs []string +} + +// Mutate applies the CreateEntityTypeInput on the EntityTypeMutation builder. +func (i *CreateEntityTypeInput) Mutate(m *EntityTypeMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.EntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } +} + +// SetInput applies the change-set in the CreateEntityTypeInput on the EntityTypeCreate builder. +func (c *EntityTypeCreate) SetInput(i CreateEntityTypeInput) *EntityTypeCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateEntityTypeInput represents a mutation input for updating entitytypes. +type UpdateEntityTypeInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + ClearOwner bool + OwnerID *string + ClearEntities bool + AddEntityIDs []string + RemoveEntityIDs []string +} + +// Mutate applies the UpdateEntityTypeInput on the EntityTypeMutation builder. +func (i *UpdateEntityTypeInput) Mutate(m *EntityTypeMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEntities { + m.ClearEntities() + } + if v := i.AddEntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } + if v := i.RemoveEntityIDs; len(v) > 0 { + m.RemoveEntityIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateEntityTypeInput on the EntityTypeUpdate builder. +func (c *EntityTypeUpdate) SetInput(i UpdateEntityTypeInput) *EntityTypeUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateEntityTypeInput on the EntityTypeUpdateOne builder. +func (c *EntityTypeUpdateOne) SetInput(i UpdateEntityTypeInput) *EntityTypeUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateEventInput represents a mutation input for creating events. +type CreateEventInput struct { + Tags []string + EventID *string + CorrelationID *string + EventType string + Metadata map[string]interface{} + UserIDs []string + GroupIDs []string + IntegrationIDs []string + OrganizationIDs []string + InviteIDs []string + FeatureIDs []string + EntitlementplanIDs []string + PersonalAccessTokenIDs []string + Oauth2tokenIDs []string + HushIDs []string + EntitlementIDs []string + WebhookIDs []string + SubscriberIDs []string +} + +// Mutate applies the CreateEventInput on the EventMutation builder. +func (i *CreateEventInput) Mutate(m *EventMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.EventID; v != nil { + m.SetEventID(*v) + } + if v := i.CorrelationID; v != nil { + m.SetCorrelationID(*v) + } + m.SetEventType(i.EventType) + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if v := i.UserIDs; len(v) > 0 { + m.AddUserIDs(v...) + } + if v := i.GroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } + if v := i.IntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.OrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.InviteIDs; len(v) > 0 { + m.AddInviteIDs(v...) + } + if v := i.FeatureIDs; len(v) > 0 { + m.AddFeatureIDs(v...) + } + if v := i.EntitlementplanIDs; len(v) > 0 { + m.AddEntitlementplanIDs(v...) + } + if v := i.PersonalAccessTokenIDs; len(v) > 0 { + m.AddPersonalAccessTokenIDs(v...) + } + if v := i.Oauth2tokenIDs; len(v) > 0 { + m.AddOauth2tokenIDs(v...) + } + if v := i.HushIDs; len(v) > 0 { + m.AddHushIDs(v...) + } + if v := i.EntitlementIDs; len(v) > 0 { + m.AddEntitlementIDs(v...) + } + if v := i.WebhookIDs; len(v) > 0 { + m.AddWebhookIDs(v...) + } + if v := i.SubscriberIDs; len(v) > 0 { + m.AddSubscriberIDs(v...) + } +} + +// SetInput applies the change-set in the CreateEventInput on the EventCreate builder. +func (c *EventCreate) SetInput(i CreateEventInput) *EventCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateEventInput represents a mutation input for updating events. +type UpdateEventInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClearEventID bool + EventID *string + ClearCorrelationID bool + CorrelationID *string + EventType *string + ClearMetadata bool + Metadata map[string]interface{} + ClearUser bool + AddUserIDs []string + RemoveUserIDs []string + ClearGroup bool + AddGroupIDs []string + RemoveGroupIDs []string + ClearIntegration bool + AddIntegrationIDs []string + RemoveIntegrationIDs []string + ClearOrganization bool + AddOrganizationIDs []string + RemoveOrganizationIDs []string + ClearInvite bool + AddInviteIDs []string + RemoveInviteIDs []string + ClearFeature bool + AddFeatureIDs []string + RemoveFeatureIDs []string + ClearEntitlementplan bool + AddEntitlementplanIDs []string + RemoveEntitlementplanIDs []string + ClearPersonalAccessToken bool + AddPersonalAccessTokenIDs []string + RemovePersonalAccessTokenIDs []string + ClearOauth2token bool + AddOauth2tokenIDs []string + RemoveOauth2tokenIDs []string + ClearHush bool + AddHushIDs []string + RemoveHushIDs []string + ClearEntitlement bool + AddEntitlementIDs []string + RemoveEntitlementIDs []string + ClearWebhook bool + AddWebhookIDs []string + RemoveWebhookIDs []string + ClearSubscriber bool + AddSubscriberIDs []string + RemoveSubscriberIDs []string +} + +// Mutate applies the UpdateEventInput on the EventMutation builder. +func (i *UpdateEventInput) Mutate(m *EventMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if i.ClearEventID { + m.ClearEventID() + } + if v := i.EventID; v != nil { + m.SetEventID(*v) + } + if i.ClearCorrelationID { + m.ClearCorrelationID() + } + if v := i.CorrelationID; v != nil { + m.SetCorrelationID(*v) + } + if v := i.EventType; v != nil { + m.SetEventType(*v) + } + if i.ClearMetadata { + m.ClearMetadata() + } + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if i.ClearUser { + m.ClearUser() + } + if v := i.AddUserIDs; len(v) > 0 { + m.AddUserIDs(v...) + } + if v := i.RemoveUserIDs; len(v) > 0 { + m.RemoveUserIDs(v...) + } + if i.ClearGroup { + m.ClearGroup() + } + if v := i.AddGroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } + if v := i.RemoveGroupIDs; len(v) > 0 { + m.RemoveGroupIDs(v...) + } + if i.ClearIntegration { + m.ClearIntegration() + } + if v := i.AddIntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.RemoveIntegrationIDs; len(v) > 0 { + m.RemoveIntegrationIDs(v...) + } + if i.ClearOrganization { + m.ClearOrganization() + } + if v := i.AddOrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.RemoveOrganizationIDs; len(v) > 0 { + m.RemoveOrganizationIDs(v...) + } + if i.ClearInvite { + m.ClearInvite() + } + if v := i.AddInviteIDs; len(v) > 0 { + m.AddInviteIDs(v...) + } + if v := i.RemoveInviteIDs; len(v) > 0 { + m.RemoveInviteIDs(v...) + } + if i.ClearFeature { + m.ClearFeature() + } + if v := i.AddFeatureIDs; len(v) > 0 { + m.AddFeatureIDs(v...) + } + if v := i.RemoveFeatureIDs; len(v) > 0 { + m.RemoveFeatureIDs(v...) + } + if i.ClearEntitlementplan { + m.ClearEntitlementplan() + } + if v := i.AddEntitlementplanIDs; len(v) > 0 { + m.AddEntitlementplanIDs(v...) + } + if v := i.RemoveEntitlementplanIDs; len(v) > 0 { + m.RemoveEntitlementplanIDs(v...) + } + if i.ClearPersonalAccessToken { + m.ClearPersonalAccessToken() + } + if v := i.AddPersonalAccessTokenIDs; len(v) > 0 { + m.AddPersonalAccessTokenIDs(v...) + } + if v := i.RemovePersonalAccessTokenIDs; len(v) > 0 { + m.RemovePersonalAccessTokenIDs(v...) + } + if i.ClearOauth2token { + m.ClearOauth2token() + } + if v := i.AddOauth2tokenIDs; len(v) > 0 { + m.AddOauth2tokenIDs(v...) + } + if v := i.RemoveOauth2tokenIDs; len(v) > 0 { + m.RemoveOauth2tokenIDs(v...) + } + if i.ClearHush { + m.ClearHush() + } + if v := i.AddHushIDs; len(v) > 0 { + m.AddHushIDs(v...) + } + if v := i.RemoveHushIDs; len(v) > 0 { + m.RemoveHushIDs(v...) + } + if i.ClearEntitlement { + m.ClearEntitlement() + } + if v := i.AddEntitlementIDs; len(v) > 0 { + m.AddEntitlementIDs(v...) + } + if v := i.RemoveEntitlementIDs; len(v) > 0 { + m.RemoveEntitlementIDs(v...) + } + if i.ClearWebhook { + m.ClearWebhook() + } + if v := i.AddWebhookIDs; len(v) > 0 { + m.AddWebhookIDs(v...) + } + if v := i.RemoveWebhookIDs; len(v) > 0 { + m.RemoveWebhookIDs(v...) + } + if i.ClearSubscriber { + m.ClearSubscriber() + } + if v := i.AddSubscriberIDs; len(v) > 0 { + m.AddSubscriberIDs(v...) + } + if v := i.RemoveSubscriberIDs; len(v) > 0 { + m.RemoveSubscriberIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateEventInput on the EventUpdate builder. +func (c *EventUpdate) SetInput(i UpdateEventInput) *EventUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateEventInput on the EventUpdateOne builder. +func (c *EventUpdateOne) SetInput(i UpdateEventInput) *EventUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateFeatureInput represents a mutation input for creating features. +type CreateFeatureInput struct { + Tags []string + Name string + DisplayName *string + Enabled *bool + Description *string + Metadata map[string]interface{} + OwnerID *string + PlanIDs []string + EventIDs []string +} + +// Mutate applies the CreateFeatureInput on the FeatureMutation builder. +func (i *CreateFeatureInput) Mutate(m *FeatureMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if v := i.Enabled; v != nil { + m.SetEnabled(*v) + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.PlanIDs; len(v) > 0 { + m.AddPlanIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateFeatureInput on the FeatureCreate builder. +func (c *FeatureCreate) SetInput(i CreateFeatureInput) *FeatureCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateFeatureInput represents a mutation input for updating features. +type UpdateFeatureInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClearDisplayName bool + DisplayName *string + Enabled *bool + ClearDescription bool + Description *string + ClearMetadata bool + Metadata map[string]interface{} + ClearOwner bool + OwnerID *string + ClearPlans bool + AddPlanIDs []string + RemovePlanIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateFeatureInput on the FeatureMutation builder. +func (i *UpdateFeatureInput) Mutate(m *FeatureMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if i.ClearDisplayName { + m.ClearDisplayName() + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if v := i.Enabled; v != nil { + m.SetEnabled(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearMetadata { + m.ClearMetadata() + } + if v := i.Metadata; v != nil { + m.SetMetadata(v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearPlans { + m.ClearPlans() + } + if v := i.AddPlanIDs; len(v) > 0 { + m.AddPlanIDs(v...) + } + if v := i.RemovePlanIDs; len(v) > 0 { + m.RemovePlanIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateFeatureInput on the FeatureUpdate builder. +func (c *FeatureUpdate) SetInput(i UpdateFeatureInput) *FeatureUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateFeatureInput on the FeatureUpdateOne builder. +func (c *FeatureUpdateOne) SetInput(i UpdateFeatureInput) *FeatureUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateFileInput represents a mutation input for creating files. +type CreateFileInput struct { + Tags []string + FileName string + FileExtension string + FileSize *int + ContentType string + StoreKey string + Category *string + Annotation *string + UserID *string + OrganizationIDs []string + EntityIDs []string + GroupIDs []string +} + +// Mutate applies the CreateFileInput on the FileMutation builder. +func (i *CreateFileInput) Mutate(m *FileMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetFileName(i.FileName) + m.SetFileExtension(i.FileExtension) + if v := i.FileSize; v != nil { + m.SetFileSize(*v) + } + m.SetContentType(i.ContentType) + m.SetStoreKey(i.StoreKey) + if v := i.Category; v != nil { + m.SetCategory(*v) + } + if v := i.Annotation; v != nil { + m.SetAnnotation(*v) + } + if v := i.UserID; v != nil { + m.SetUserID(*v) + } + if v := i.OrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.EntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } + if v := i.GroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } +} + +// SetInput applies the change-set in the CreateFileInput on the FileCreate builder. +func (c *FileCreate) SetInput(i CreateFileInput) *FileCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateFileInput represents a mutation input for updating files. +type UpdateFileInput struct { + ClearTags bool + Tags []string + AppendTags []string + FileName *string + FileExtension *string + ClearFileSize bool + FileSize *int + ContentType *string + StoreKey *string + ClearCategory bool + Category *string + ClearAnnotation bool + Annotation *string + ClearUser bool + UserID *string + ClearOrganization bool + AddOrganizationIDs []string + RemoveOrganizationIDs []string + ClearEntity bool + AddEntityIDs []string + RemoveEntityIDs []string + ClearGroup bool + AddGroupIDs []string + RemoveGroupIDs []string +} + +// Mutate applies the UpdateFileInput on the FileMutation builder. +func (i *UpdateFileInput) Mutate(m *FileMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.FileName; v != nil { + m.SetFileName(*v) + } + if v := i.FileExtension; v != nil { + m.SetFileExtension(*v) + } + if i.ClearFileSize { + m.ClearFileSize() + } + if v := i.FileSize; v != nil { + m.SetFileSize(*v) + } + if v := i.ContentType; v != nil { + m.SetContentType(*v) + } + if v := i.StoreKey; v != nil { + m.SetStoreKey(*v) + } + if i.ClearCategory { + m.ClearCategory() + } + if v := i.Category; v != nil { + m.SetCategory(*v) + } + if i.ClearAnnotation { + m.ClearAnnotation() + } + if v := i.Annotation; v != nil { + m.SetAnnotation(*v) + } + if i.ClearUser { + m.ClearUser() + } + if v := i.UserID; v != nil { + m.SetUserID(*v) + } + if i.ClearOrganization { + m.ClearOrganization() + } + if v := i.AddOrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.RemoveOrganizationIDs; len(v) > 0 { + m.RemoveOrganizationIDs(v...) + } + if i.ClearEntity { + m.ClearEntity() + } + if v := i.AddEntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } + if v := i.RemoveEntityIDs; len(v) > 0 { + m.RemoveEntityIDs(v...) + } + if i.ClearGroup { + m.ClearGroup() + } + if v := i.AddGroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } + if v := i.RemoveGroupIDs; len(v) > 0 { + m.RemoveGroupIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateFileInput on the FileUpdate builder. +func (c *FileUpdate) SetInput(i UpdateFileInput) *FileUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateFileInput on the FileUpdateOne builder. +func (c *FileUpdateOne) SetInput(i UpdateFileInput) *FileUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateGroupInput represents a mutation input for creating groups. +type CreateGroupInput struct { + Tags []string + Name string + Description *string + GravatarLogoURL *string + LogoURL *string + DisplayName *string + OwnerID *string + SettingID string + UserIDs []string + EventIDs []string + IntegrationIDs []string + FileIDs []string +} + +// Mutate applies the CreateGroupInput on the GroupMutation builder. +func (i *CreateGroupInput) Mutate(m *GroupMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.GravatarLogoURL; v != nil { + m.SetGravatarLogoURL(*v) + } + if v := i.LogoURL; v != nil { + m.SetLogoURL(*v) + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + m.SetSettingID(i.SettingID) + if v := i.UserIDs; len(v) > 0 { + m.AddUserIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.IntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.FileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } +} + +// SetInput applies the change-set in the CreateGroupInput on the GroupCreate builder. +func (c *GroupCreate) SetInput(i CreateGroupInput) *GroupCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateGroupInput represents a mutation input for updating groups. +type UpdateGroupInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + ClearDescription bool + Description *string + ClearGravatarLogoURL bool + GravatarLogoURL *string + ClearLogoURL bool + LogoURL *string + DisplayName *string + ClearOwner bool + OwnerID *string + SettingID *string + ClearUsers bool + AddUserIDs []string + RemoveUserIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string + ClearIntegrations bool + AddIntegrationIDs []string + RemoveIntegrationIDs []string + ClearFiles bool + AddFileIDs []string + RemoveFileIDs []string +} + +// Mutate applies the UpdateGroupInput on the GroupMutation builder. +func (i *UpdateGroupInput) Mutate(m *GroupMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearGravatarLogoURL { + m.ClearGravatarLogoURL() + } + if v := i.GravatarLogoURL; v != nil { + m.SetGravatarLogoURL(*v) + } + if i.ClearLogoURL { + m.ClearLogoURL() + } + if v := i.LogoURL; v != nil { + m.SetLogoURL(*v) + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.SettingID; v != nil { + m.SetSettingID(*v) + } + if i.ClearUsers { + m.ClearUsers() + } + if v := i.AddUserIDs; len(v) > 0 { + m.AddUserIDs(v...) + } + if v := i.RemoveUserIDs; len(v) > 0 { + m.RemoveUserIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } + if i.ClearIntegrations { + m.ClearIntegrations() + } + if v := i.AddIntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.RemoveIntegrationIDs; len(v) > 0 { + m.RemoveIntegrationIDs(v...) + } + if i.ClearFiles { + m.ClearFiles() + } + if v := i.AddFileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } + if v := i.RemoveFileIDs; len(v) > 0 { + m.RemoveFileIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateGroupInput on the GroupUpdate builder. +func (c *GroupUpdate) SetInput(i UpdateGroupInput) *GroupUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateGroupInput on the GroupUpdateOne builder. +func (c *GroupUpdateOne) SetInput(i UpdateGroupInput) *GroupUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateGroupMembershipInput represents a mutation input for creating groupmemberships. +type CreateGroupMembershipInput struct { + Role *enums.Role + GroupID string + UserID string + EventIDs []string +} + +// Mutate applies the CreateGroupMembershipInput on the GroupMembershipMutation builder. +func (i *CreateGroupMembershipInput) Mutate(m *GroupMembershipMutation) { + if v := i.Role; v != nil { + m.SetRole(*v) + } + m.SetGroupID(i.GroupID) + m.SetUserID(i.UserID) + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateGroupMembershipInput on the GroupMembershipCreate builder. +func (c *GroupMembershipCreate) SetInput(i CreateGroupMembershipInput) *GroupMembershipCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateGroupMembershipInput represents a mutation input for updating groupmemberships. +type UpdateGroupMembershipInput struct { + Role *enums.Role + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateGroupMembershipInput on the GroupMembershipMutation builder. +func (i *UpdateGroupMembershipInput) Mutate(m *GroupMembershipMutation) { + if v := i.Role; v != nil { + m.SetRole(*v) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateGroupMembershipInput on the GroupMembershipUpdate builder. +func (c *GroupMembershipUpdate) SetInput(i UpdateGroupMembershipInput) *GroupMembershipUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateGroupMembershipInput on the GroupMembershipUpdateOne builder. +func (c *GroupMembershipUpdateOne) SetInput(i UpdateGroupMembershipInput) *GroupMembershipUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateGroupSettingInput represents a mutation input for creating groupsettings. +type CreateGroupSettingInput struct { + Tags []string + Visibility *enums.Visibility + JoinPolicy *enums.JoinPolicy + SyncToSlack *bool + SyncToGithub *bool + GroupID *string +} + +// Mutate applies the CreateGroupSettingInput on the GroupSettingMutation builder. +func (i *CreateGroupSettingInput) Mutate(m *GroupSettingMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.Visibility; v != nil { + m.SetVisibility(*v) + } + if v := i.JoinPolicy; v != nil { + m.SetJoinPolicy(*v) + } + if v := i.SyncToSlack; v != nil { + m.SetSyncToSlack(*v) + } + if v := i.SyncToGithub; v != nil { + m.SetSyncToGithub(*v) + } + if v := i.GroupID; v != nil { + m.SetGroupID(*v) + } +} + +// SetInput applies the change-set in the CreateGroupSettingInput on the GroupSettingCreate builder. +func (c *GroupSettingCreate) SetInput(i CreateGroupSettingInput) *GroupSettingCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateGroupSettingInput represents a mutation input for updating groupsettings. +type UpdateGroupSettingInput struct { + ClearTags bool + Tags []string + AppendTags []string + Visibility *enums.Visibility + JoinPolicy *enums.JoinPolicy + ClearSyncToSlack bool + SyncToSlack *bool + ClearSyncToGithub bool + SyncToGithub *bool + ClearGroup bool + GroupID *string +} + +// Mutate applies the UpdateGroupSettingInput on the GroupSettingMutation builder. +func (i *UpdateGroupSettingInput) Mutate(m *GroupSettingMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Visibility; v != nil { + m.SetVisibility(*v) + } + if v := i.JoinPolicy; v != nil { + m.SetJoinPolicy(*v) + } + if i.ClearSyncToSlack { + m.ClearSyncToSlack() + } + if v := i.SyncToSlack; v != nil { + m.SetSyncToSlack(*v) + } + if i.ClearSyncToGithub { + m.ClearSyncToGithub() + } + if v := i.SyncToGithub; v != nil { + m.SetSyncToGithub(*v) + } + if i.ClearGroup { + m.ClearGroup() + } + if v := i.GroupID; v != nil { + m.SetGroupID(*v) + } +} + +// SetInput applies the change-set in the UpdateGroupSettingInput on the GroupSettingUpdate builder. +func (c *GroupSettingUpdate) SetInput(i UpdateGroupSettingInput) *GroupSettingUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateGroupSettingInput on the GroupSettingUpdateOne builder. +func (c *GroupSettingUpdateOne) SetInput(i UpdateGroupSettingInput) *GroupSettingUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateHushInput represents a mutation input for creating hushes. +type CreateHushInput struct { + Name string + Description *string + Kind *string + SecretName *string + SecretValue *string + IntegrationIDs []string + OrganizationIDs []string + EventIDs []string +} + +// Mutate applies the CreateHushInput on the HushMutation builder. +func (i *CreateHushInput) Mutate(m *HushMutation) { + m.SetName(i.Name) + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Kind; v != nil { + m.SetKind(*v) + } + if v := i.SecretName; v != nil { + m.SetSecretName(*v) + } + if v := i.SecretValue; v != nil { + m.SetSecretValue(*v) + } + if v := i.IntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.OrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateHushInput on the HushCreate builder. +func (c *HushCreate) SetInput(i CreateHushInput) *HushCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateHushInput represents a mutation input for updating hushes. +type UpdateHushInput struct { + Name *string + ClearDescription bool + Description *string + ClearKind bool + Kind *string + ClearIntegrations bool + AddIntegrationIDs []string + RemoveIntegrationIDs []string + ClearOrganization bool + AddOrganizationIDs []string + RemoveOrganizationIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateHushInput on the HushMutation builder. +func (i *UpdateHushInput) Mutate(m *HushMutation) { + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearKind { + m.ClearKind() + } + if v := i.Kind; v != nil { + m.SetKind(*v) + } + if i.ClearIntegrations { + m.ClearIntegrations() + } + if v := i.AddIntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.RemoveIntegrationIDs; len(v) > 0 { + m.RemoveIntegrationIDs(v...) + } + if i.ClearOrganization { + m.ClearOrganization() + } + if v := i.AddOrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.RemoveOrganizationIDs; len(v) > 0 { + m.RemoveOrganizationIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateHushInput on the HushUpdate builder. +func (c *HushUpdate) SetInput(i UpdateHushInput) *HushUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateHushInput on the HushUpdateOne builder. +func (c *HushUpdateOne) SetInput(i UpdateHushInput) *HushUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateIntegrationInput represents a mutation input for creating integrations. +type CreateIntegrationInput struct { + Tags []string + Name string + Description *string + Kind *string + OwnerID *string + SecretIDs []string + Oauth2tokenIDs []string + EventIDs []string + WebhookIDs []string +} + +// Mutate applies the CreateIntegrationInput on the IntegrationMutation builder. +func (i *CreateIntegrationInput) Mutate(m *IntegrationMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Kind; v != nil { + m.SetKind(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.SecretIDs; len(v) > 0 { + m.AddSecretIDs(v...) + } + if v := i.Oauth2tokenIDs; len(v) > 0 { + m.AddOauth2tokenIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.WebhookIDs; len(v) > 0 { + m.AddWebhookIDs(v...) + } +} + +// SetInput applies the change-set in the CreateIntegrationInput on the IntegrationCreate builder. +func (c *IntegrationCreate) SetInput(i CreateIntegrationInput) *IntegrationCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateIntegrationInput represents a mutation input for updating integrations. +type UpdateIntegrationInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + ClearDescription bool + Description *string + ClearKind bool + Kind *string + ClearOwner bool + OwnerID *string + ClearSecrets bool + AddSecretIDs []string + RemoveSecretIDs []string + ClearOauth2tokens bool + AddOauth2tokenIDs []string + RemoveOauth2tokenIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string + ClearWebhooks bool + AddWebhookIDs []string + RemoveWebhookIDs []string +} + +// Mutate applies the UpdateIntegrationInput on the IntegrationMutation builder. +func (i *UpdateIntegrationInput) Mutate(m *IntegrationMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearKind { + m.ClearKind() + } + if v := i.Kind; v != nil { + m.SetKind(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearSecrets { + m.ClearSecrets() + } + if v := i.AddSecretIDs; len(v) > 0 { + m.AddSecretIDs(v...) + } + if v := i.RemoveSecretIDs; len(v) > 0 { + m.RemoveSecretIDs(v...) + } + if i.ClearOauth2tokens { + m.ClearOauth2tokens() + } + if v := i.AddOauth2tokenIDs; len(v) > 0 { + m.AddOauth2tokenIDs(v...) + } + if v := i.RemoveOauth2tokenIDs; len(v) > 0 { + m.RemoveOauth2tokenIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } + if i.ClearWebhooks { + m.ClearWebhooks() + } + if v := i.AddWebhookIDs; len(v) > 0 { + m.AddWebhookIDs(v...) + } + if v := i.RemoveWebhookIDs; len(v) > 0 { + m.RemoveWebhookIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateIntegrationInput on the IntegrationUpdate builder. +func (c *IntegrationUpdate) SetInput(i UpdateIntegrationInput) *IntegrationUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateIntegrationInput on the IntegrationUpdateOne builder. +func (c *IntegrationUpdateOne) SetInput(i UpdateIntegrationInput) *IntegrationUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateInviteInput represents a mutation input for creating invites. +type CreateInviteInput struct { + Expires *time.Time + Recipient string + Status *enums.InviteStatus + Role *enums.Role + SendAttempts *int + RequestorID *string + OwnerID *string + EventIDs []string +} + +// Mutate applies the CreateInviteInput on the InviteMutation builder. +func (i *CreateInviteInput) Mutate(m *InviteMutation) { + if v := i.Expires; v != nil { + m.SetExpires(*v) + } + m.SetRecipient(i.Recipient) + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if v := i.Role; v != nil { + m.SetRole(*v) + } + if v := i.SendAttempts; v != nil { + m.SetSendAttempts(*v) + } + if v := i.RequestorID; v != nil { + m.SetRequestorID(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateInviteInput on the InviteCreate builder. +func (c *InviteCreate) SetInput(i CreateInviteInput) *InviteCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateInviteInput represents a mutation input for updating invites. +type UpdateInviteInput struct { + ClearExpires bool + Expires *time.Time + Status *enums.InviteStatus + Role *enums.Role + SendAttempts *int + ClearOwner bool + OwnerID *string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateInviteInput on the InviteMutation builder. +func (i *UpdateInviteInput) Mutate(m *InviteMutation) { + if i.ClearExpires { + m.ClearExpires() + } + if v := i.Expires; v != nil { + m.SetExpires(*v) + } + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if v := i.Role; v != nil { + m.SetRole(*v) + } + if v := i.SendAttempts; v != nil { + m.SetSendAttempts(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateInviteInput on the InviteUpdate builder. +func (c *InviteUpdate) SetInput(i UpdateInviteInput) *InviteUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateInviteInput on the InviteUpdateOne builder. +func (c *InviteUpdateOne) SetInput(i UpdateInviteInput) *InviteUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateNoteInput represents a mutation input for creating notes. +type CreateNoteInput struct { + Tags []string + Text string + OwnerID *string + EntityID *string +} + +// Mutate applies the CreateNoteInput on the NoteMutation builder. +func (i *CreateNoteInput) Mutate(m *NoteMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetText(i.Text) + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.EntityID; v != nil { + m.SetEntityID(*v) + } +} + +// SetInput applies the change-set in the CreateNoteInput on the NoteCreate builder. +func (c *NoteCreate) SetInput(i CreateNoteInput) *NoteCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateNoteInput represents a mutation input for updating notes. +type UpdateNoteInput struct { + ClearTags bool + Tags []string + AppendTags []string + Text *string + ClearOwner bool + OwnerID *string + ClearEntity bool + EntityID *string +} + +// Mutate applies the UpdateNoteInput on the NoteMutation builder. +func (i *UpdateNoteInput) Mutate(m *NoteMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Text; v != nil { + m.SetText(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEntity { + m.ClearEntity() + } + if v := i.EntityID; v != nil { + m.SetEntityID(*v) + } +} + +// SetInput applies the change-set in the UpdateNoteInput on the NoteUpdate builder. +func (c *NoteUpdate) SetInput(i UpdateNoteInput) *NoteUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateNoteInput on the NoteUpdateOne builder. +func (c *NoteUpdateOne) SetInput(i UpdateNoteInput) *NoteUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateOauthProviderInput represents a mutation input for creating oauthproviders. +type CreateOauthProviderInput struct { + Tags []string + Name string + ClientID string + ClientSecret string + RedirectURL string + Scopes string + AuthURL string + TokenURL string + AuthStyle customtypes.Uint8 + InfoURL string + OwnerID *string +} + +// Mutate applies the CreateOauthProviderInput on the OauthProviderMutation builder. +func (i *CreateOauthProviderInput) Mutate(m *OauthProviderMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + m.SetClientID(i.ClientID) + m.SetClientSecret(i.ClientSecret) + m.SetRedirectURL(i.RedirectURL) + m.SetScopes(i.Scopes) + m.SetAuthURL(i.AuthURL) + m.SetTokenURL(i.TokenURL) + m.SetAuthStyle(i.AuthStyle) + m.SetInfoURL(i.InfoURL) + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } +} + +// SetInput applies the change-set in the CreateOauthProviderInput on the OauthProviderCreate builder. +func (c *OauthProviderCreate) SetInput(i CreateOauthProviderInput) *OauthProviderCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateOauthProviderInput represents a mutation input for updating oauthproviders. +type UpdateOauthProviderInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + ClientID *string + ClientSecret *string + RedirectURL *string + Scopes *string + AuthURL *string + TokenURL *string + AuthStyle *customtypes.Uint8 + InfoURL *string + ClearOwner bool + OwnerID *string +} + +// Mutate applies the UpdateOauthProviderInput on the OauthProviderMutation builder. +func (i *UpdateOauthProviderInput) Mutate(m *OauthProviderMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if v := i.ClientID; v != nil { + m.SetClientID(*v) + } + if v := i.ClientSecret; v != nil { + m.SetClientSecret(*v) + } + if v := i.RedirectURL; v != nil { + m.SetRedirectURL(*v) + } + if v := i.Scopes; v != nil { + m.SetScopes(*v) + } + if v := i.AuthURL; v != nil { + m.SetAuthURL(*v) + } + if v := i.TokenURL; v != nil { + m.SetTokenURL(*v) + } + if v := i.AuthStyle; v != nil { + m.SetAuthStyle(*v) + } + if v := i.InfoURL; v != nil { + m.SetInfoURL(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } +} + +// SetInput applies the change-set in the UpdateOauthProviderInput on the OauthProviderUpdate builder. +func (c *OauthProviderUpdate) SetInput(i UpdateOauthProviderInput) *OauthProviderUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateOauthProviderInput on the OauthProviderUpdateOne builder. +func (c *OauthProviderUpdateOne) SetInput(i UpdateOauthProviderInput) *OauthProviderUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateOhAuthTooTokenInput represents a mutation input for creating ohauthtootokens. +type CreateOhAuthTooTokenInput struct { + Tags []string + ClientID string + Scopes []string + Nonce string + ClaimsUserID string + ClaimsUsername string + ClaimsEmail string + ClaimsEmailVerified bool + ClaimsGroups []string + ClaimsPreferredUsername string + ConnectorID string + ConnectorData []string + LastUsed *time.Time + IntegrationIDs []string + EventIDs []string +} + +// Mutate applies the CreateOhAuthTooTokenInput on the OhAuthTooTokenMutation builder. +func (i *CreateOhAuthTooTokenInput) Mutate(m *OhAuthTooTokenMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetClientID(i.ClientID) + if v := i.Scopes; v != nil { + m.SetScopes(v) + } + m.SetNonce(i.Nonce) + m.SetClaimsUserID(i.ClaimsUserID) + m.SetClaimsUsername(i.ClaimsUsername) + m.SetClaimsEmail(i.ClaimsEmail) + m.SetClaimsEmailVerified(i.ClaimsEmailVerified) + if v := i.ClaimsGroups; v != nil { + m.SetClaimsGroups(v) + } + m.SetClaimsPreferredUsername(i.ClaimsPreferredUsername) + m.SetConnectorID(i.ConnectorID) + if v := i.ConnectorData; v != nil { + m.SetConnectorData(v) + } + if v := i.LastUsed; v != nil { + m.SetLastUsed(*v) + } + if v := i.IntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateOhAuthTooTokenInput on the OhAuthTooTokenCreate builder. +func (c *OhAuthTooTokenCreate) SetInput(i CreateOhAuthTooTokenInput) *OhAuthTooTokenCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateOhAuthTooTokenInput represents a mutation input for updating ohauthtootokens. +type UpdateOhAuthTooTokenInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClientID *string + ClearScopes bool + Scopes []string + AppendScopes []string + Nonce *string + ClaimsUserID *string + ClaimsUsername *string + ClaimsEmail *string + ClaimsEmailVerified *bool + ClearClaimsGroups bool + ClaimsGroups []string + AppendClaimsGroups []string + ClaimsPreferredUsername *string + ConnectorID *string + ClearConnectorData bool + ConnectorData []string + AppendConnectorData []string + LastUsed *time.Time + ClearIntegration bool + AddIntegrationIDs []string + RemoveIntegrationIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateOhAuthTooTokenInput on the OhAuthTooTokenMutation builder. +func (i *UpdateOhAuthTooTokenInput) Mutate(m *OhAuthTooTokenMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.ClientID; v != nil { + m.SetClientID(*v) + } + if i.ClearScopes { + m.ClearScopes() + } + if v := i.Scopes; v != nil { + m.SetScopes(v) + } + if i.AppendScopes != nil { + m.AppendScopes(i.Scopes) + } + if v := i.Nonce; v != nil { + m.SetNonce(*v) + } + if v := i.ClaimsUserID; v != nil { + m.SetClaimsUserID(*v) + } + if v := i.ClaimsUsername; v != nil { + m.SetClaimsUsername(*v) + } + if v := i.ClaimsEmail; v != nil { + m.SetClaimsEmail(*v) + } + if v := i.ClaimsEmailVerified; v != nil { + m.SetClaimsEmailVerified(*v) + } + if i.ClearClaimsGroups { + m.ClearClaimsGroups() + } + if v := i.ClaimsGroups; v != nil { + m.SetClaimsGroups(v) + } + if i.AppendClaimsGroups != nil { + m.AppendClaimsGroups(i.ClaimsGroups) + } + if v := i.ClaimsPreferredUsername; v != nil { + m.SetClaimsPreferredUsername(*v) + } + if v := i.ConnectorID; v != nil { + m.SetConnectorID(*v) + } + if i.ClearConnectorData { + m.ClearConnectorData() + } + if v := i.ConnectorData; v != nil { + m.SetConnectorData(v) + } + if i.AppendConnectorData != nil { + m.AppendConnectorData(i.ConnectorData) + } + if v := i.LastUsed; v != nil { + m.SetLastUsed(*v) + } + if i.ClearIntegration { + m.ClearIntegration() + } + if v := i.AddIntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.RemoveIntegrationIDs; len(v) > 0 { + m.RemoveIntegrationIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateOhAuthTooTokenInput on the OhAuthTooTokenUpdate builder. +func (c *OhAuthTooTokenUpdate) SetInput(i UpdateOhAuthTooTokenInput) *OhAuthTooTokenUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateOhAuthTooTokenInput on the OhAuthTooTokenUpdateOne builder. +func (c *OhAuthTooTokenUpdateOne) SetInput(i UpdateOhAuthTooTokenInput) *OhAuthTooTokenUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateOrgMembershipInput represents a mutation input for creating orgmemberships. +type CreateOrgMembershipInput struct { + Role *enums.Role + OrganizationID string + UserID string + EventIDs []string +} + +// Mutate applies the CreateOrgMembershipInput on the OrgMembershipMutation builder. +func (i *CreateOrgMembershipInput) Mutate(m *OrgMembershipMutation) { + if v := i.Role; v != nil { + m.SetRole(*v) + } + m.SetOrganizationID(i.OrganizationID) + m.SetUserID(i.UserID) + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateOrgMembershipInput on the OrgMembershipCreate builder. +func (c *OrgMembershipCreate) SetInput(i CreateOrgMembershipInput) *OrgMembershipCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateOrgMembershipInput represents a mutation input for updating orgmemberships. +type UpdateOrgMembershipInput struct { + Role *enums.Role + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateOrgMembershipInput on the OrgMembershipMutation builder. +func (i *UpdateOrgMembershipInput) Mutate(m *OrgMembershipMutation) { + if v := i.Role; v != nil { + m.SetRole(*v) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateOrgMembershipInput on the OrgMembershipUpdate builder. +func (c *OrgMembershipUpdate) SetInput(i UpdateOrgMembershipInput) *OrgMembershipUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateOrgMembershipInput on the OrgMembershipUpdateOne builder. +func (c *OrgMembershipUpdateOne) SetInput(i UpdateOrgMembershipInput) *OrgMembershipUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateOrganizationInput represents a mutation input for creating organizations. +type CreateOrganizationInput struct { + Tags []string + Name string + DisplayName *string + Description *string + PersonalOrg *bool + AvatarRemoteURL *string + DedicatedDb *bool + ParentID *string + GroupIDs []string + TemplateIDs []string + IntegrationIDs []string + SettingID *string + DocumentdatumIDs []string + EntitlementIDs []string + OrganizationEntitlementIDs []string + PersonalAccessTokenIDs []string + APITokenIDs []string + OauthproviderIDs []string + UserIDs []string + InviteIDs []string + SubscriberIDs []string + WebhookIDs []string + EventIDs []string + SecretIDs []string + FeatureIDs []string + FileIDs []string + EntitlementplanIDs []string + EntityIDs []string + EntitytypeIDs []string + ContactIDs []string + NoteIDs []string +} + +// Mutate applies the CreateOrganizationInput on the OrganizationMutation builder. +func (i *CreateOrganizationInput) Mutate(m *OrganizationMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.PersonalOrg; v != nil { + m.SetPersonalOrg(*v) + } + if v := i.AvatarRemoteURL; v != nil { + m.SetAvatarRemoteURL(*v) + } + if v := i.DedicatedDb; v != nil { + m.SetDedicatedDb(*v) + } + if v := i.ParentID; v != nil { + m.SetParentID(*v) + } + if v := i.GroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } + if v := i.TemplateIDs; len(v) > 0 { + m.AddTemplateIDs(v...) + } + if v := i.IntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.SettingID; v != nil { + m.SetSettingID(*v) + } + if v := i.DocumentdatumIDs; len(v) > 0 { + m.AddDocumentdatumIDs(v...) + } + if v := i.EntitlementIDs; len(v) > 0 { + m.AddEntitlementIDs(v...) + } + if v := i.OrganizationEntitlementIDs; len(v) > 0 { + m.AddOrganizationEntitlementIDs(v...) + } + if v := i.PersonalAccessTokenIDs; len(v) > 0 { + m.AddPersonalAccessTokenIDs(v...) + } + if v := i.APITokenIDs; len(v) > 0 { + m.AddAPITokenIDs(v...) + } + if v := i.OauthproviderIDs; len(v) > 0 { + m.AddOauthproviderIDs(v...) + } + if v := i.UserIDs; len(v) > 0 { + m.AddUserIDs(v...) + } + if v := i.InviteIDs; len(v) > 0 { + m.AddInviteIDs(v...) + } + if v := i.SubscriberIDs; len(v) > 0 { + m.AddSubscriberIDs(v...) + } + if v := i.WebhookIDs; len(v) > 0 { + m.AddWebhookIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.SecretIDs; len(v) > 0 { + m.AddSecretIDs(v...) + } + if v := i.FeatureIDs; len(v) > 0 { + m.AddFeatureIDs(v...) + } + if v := i.FileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } + if v := i.EntitlementplanIDs; len(v) > 0 { + m.AddEntitlementplanIDs(v...) + } + if v := i.EntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } + if v := i.EntitytypeIDs; len(v) > 0 { + m.AddEntitytypeIDs(v...) + } + if v := i.ContactIDs; len(v) > 0 { + m.AddContactIDs(v...) + } + if v := i.NoteIDs; len(v) > 0 { + m.AddNoteIDs(v...) + } +} + +// SetInput applies the change-set in the CreateOrganizationInput on the OrganizationCreate builder. +func (c *OrganizationCreate) SetInput(i CreateOrganizationInput) *OrganizationCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateOrganizationInput represents a mutation input for updating organizations. +type UpdateOrganizationInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + DisplayName *string + ClearDescription bool + Description *string + ClearAvatarRemoteURL bool + AvatarRemoteURL *string + ClearGroups bool + AddGroupIDs []string + RemoveGroupIDs []string + ClearTemplates bool + AddTemplateIDs []string + RemoveTemplateIDs []string + ClearIntegrations bool + AddIntegrationIDs []string + RemoveIntegrationIDs []string + ClearSetting bool + SettingID *string + ClearDocumentdata bool + AddDocumentdatumIDs []string + RemoveDocumentdatumIDs []string + ClearEntitlements bool + AddEntitlementIDs []string + RemoveEntitlementIDs []string + ClearOrganizationEntitlement bool + AddOrganizationEntitlementIDs []string + RemoveOrganizationEntitlementIDs []string + ClearPersonalAccessTokens bool + AddPersonalAccessTokenIDs []string + RemovePersonalAccessTokenIDs []string + ClearAPITokens bool + AddAPITokenIDs []string + RemoveAPITokenIDs []string + ClearOauthprovider bool + AddOauthproviderIDs []string + RemoveOauthproviderIDs []string + ClearUsers bool + AddUserIDs []string + RemoveUserIDs []string + ClearInvites bool + AddInviteIDs []string + RemoveInviteIDs []string + ClearSubscribers bool + AddSubscriberIDs []string + RemoveSubscriberIDs []string + ClearWebhooks bool + AddWebhookIDs []string + RemoveWebhookIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string + ClearSecrets bool + AddSecretIDs []string + RemoveSecretIDs []string + ClearFeatures bool + AddFeatureIDs []string + RemoveFeatureIDs []string + ClearFiles bool + AddFileIDs []string + RemoveFileIDs []string + ClearEntitlementplans bool + AddEntitlementplanIDs []string + RemoveEntitlementplanIDs []string + ClearEntities bool + AddEntityIDs []string + RemoveEntityIDs []string + ClearEntitytypes bool + AddEntitytypeIDs []string + RemoveEntitytypeIDs []string + ClearContacts bool + AddContactIDs []string + RemoveContactIDs []string + ClearNotes bool + AddNoteIDs []string + RemoveNoteIDs []string +} + +// Mutate applies the UpdateOrganizationInput on the OrganizationMutation builder. +func (i *UpdateOrganizationInput) Mutate(m *OrganizationMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearAvatarRemoteURL { + m.ClearAvatarRemoteURL() + } + if v := i.AvatarRemoteURL; v != nil { + m.SetAvatarRemoteURL(*v) + } + if i.ClearGroups { + m.ClearGroups() + } + if v := i.AddGroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } + if v := i.RemoveGroupIDs; len(v) > 0 { + m.RemoveGroupIDs(v...) + } + if i.ClearTemplates { + m.ClearTemplates() + } + if v := i.AddTemplateIDs; len(v) > 0 { + m.AddTemplateIDs(v...) + } + if v := i.RemoveTemplateIDs; len(v) > 0 { + m.RemoveTemplateIDs(v...) + } + if i.ClearIntegrations { + m.ClearIntegrations() + } + if v := i.AddIntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.RemoveIntegrationIDs; len(v) > 0 { + m.RemoveIntegrationIDs(v...) + } + if i.ClearSetting { + m.ClearSetting() + } + if v := i.SettingID; v != nil { + m.SetSettingID(*v) + } + if i.ClearDocumentdata { + m.ClearDocumentdata() + } + if v := i.AddDocumentdatumIDs; len(v) > 0 { + m.AddDocumentdatumIDs(v...) + } + if v := i.RemoveDocumentdatumIDs; len(v) > 0 { + m.RemoveDocumentdatumIDs(v...) + } + if i.ClearEntitlements { + m.ClearEntitlements() + } + if v := i.AddEntitlementIDs; len(v) > 0 { + m.AddEntitlementIDs(v...) + } + if v := i.RemoveEntitlementIDs; len(v) > 0 { + m.RemoveEntitlementIDs(v...) + } + if i.ClearOrganizationEntitlement { + m.ClearOrganizationEntitlement() + } + if v := i.AddOrganizationEntitlementIDs; len(v) > 0 { + m.AddOrganizationEntitlementIDs(v...) + } + if v := i.RemoveOrganizationEntitlementIDs; len(v) > 0 { + m.RemoveOrganizationEntitlementIDs(v...) + } + if i.ClearPersonalAccessTokens { + m.ClearPersonalAccessTokens() + } + if v := i.AddPersonalAccessTokenIDs; len(v) > 0 { + m.AddPersonalAccessTokenIDs(v...) + } + if v := i.RemovePersonalAccessTokenIDs; len(v) > 0 { + m.RemovePersonalAccessTokenIDs(v...) + } + if i.ClearAPITokens { + m.ClearAPITokens() + } + if v := i.AddAPITokenIDs; len(v) > 0 { + m.AddAPITokenIDs(v...) + } + if v := i.RemoveAPITokenIDs; len(v) > 0 { + m.RemoveAPITokenIDs(v...) + } + if i.ClearOauthprovider { + m.ClearOauthprovider() + } + if v := i.AddOauthproviderIDs; len(v) > 0 { + m.AddOauthproviderIDs(v...) + } + if v := i.RemoveOauthproviderIDs; len(v) > 0 { + m.RemoveOauthproviderIDs(v...) + } + if i.ClearUsers { + m.ClearUsers() + } + if v := i.AddUserIDs; len(v) > 0 { + m.AddUserIDs(v...) + } + if v := i.RemoveUserIDs; len(v) > 0 { + m.RemoveUserIDs(v...) + } + if i.ClearInvites { + m.ClearInvites() + } + if v := i.AddInviteIDs; len(v) > 0 { + m.AddInviteIDs(v...) + } + if v := i.RemoveInviteIDs; len(v) > 0 { + m.RemoveInviteIDs(v...) + } + if i.ClearSubscribers { + m.ClearSubscribers() + } + if v := i.AddSubscriberIDs; len(v) > 0 { + m.AddSubscriberIDs(v...) + } + if v := i.RemoveSubscriberIDs; len(v) > 0 { + m.RemoveSubscriberIDs(v...) + } + if i.ClearWebhooks { + m.ClearWebhooks() + } + if v := i.AddWebhookIDs; len(v) > 0 { + m.AddWebhookIDs(v...) + } + if v := i.RemoveWebhookIDs; len(v) > 0 { + m.RemoveWebhookIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } + if i.ClearSecrets { + m.ClearSecrets() + } + if v := i.AddSecretIDs; len(v) > 0 { + m.AddSecretIDs(v...) + } + if v := i.RemoveSecretIDs; len(v) > 0 { + m.RemoveSecretIDs(v...) + } + if i.ClearFeatures { + m.ClearFeatures() + } + if v := i.AddFeatureIDs; len(v) > 0 { + m.AddFeatureIDs(v...) + } + if v := i.RemoveFeatureIDs; len(v) > 0 { + m.RemoveFeatureIDs(v...) + } + if i.ClearFiles { + m.ClearFiles() + } + if v := i.AddFileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } + if v := i.RemoveFileIDs; len(v) > 0 { + m.RemoveFileIDs(v...) + } + if i.ClearEntitlementplans { + m.ClearEntitlementplans() + } + if v := i.AddEntitlementplanIDs; len(v) > 0 { + m.AddEntitlementplanIDs(v...) + } + if v := i.RemoveEntitlementplanIDs; len(v) > 0 { + m.RemoveEntitlementplanIDs(v...) + } + if i.ClearEntities { + m.ClearEntities() + } + if v := i.AddEntityIDs; len(v) > 0 { + m.AddEntityIDs(v...) + } + if v := i.RemoveEntityIDs; len(v) > 0 { + m.RemoveEntityIDs(v...) + } + if i.ClearEntitytypes { + m.ClearEntitytypes() + } + if v := i.AddEntitytypeIDs; len(v) > 0 { + m.AddEntitytypeIDs(v...) + } + if v := i.RemoveEntitytypeIDs; len(v) > 0 { + m.RemoveEntitytypeIDs(v...) + } + if i.ClearContacts { + m.ClearContacts() + } + if v := i.AddContactIDs; len(v) > 0 { + m.AddContactIDs(v...) + } + if v := i.RemoveContactIDs; len(v) > 0 { + m.RemoveContactIDs(v...) + } + if i.ClearNotes { + m.ClearNotes() + } + if v := i.AddNoteIDs; len(v) > 0 { + m.AddNoteIDs(v...) + } + if v := i.RemoveNoteIDs; len(v) > 0 { + m.RemoveNoteIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateOrganizationInput on the OrganizationUpdate builder. +func (c *OrganizationUpdate) SetInput(i UpdateOrganizationInput) *OrganizationUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateOrganizationInput on the OrganizationUpdateOne builder. +func (c *OrganizationUpdateOne) SetInput(i UpdateOrganizationInput) *OrganizationUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateOrganizationSettingInput represents a mutation input for creating organizationsettings. +type CreateOrganizationSettingInput struct { + Tags []string + Domains []string + BillingContact *string + BillingEmail *string + BillingPhone *string + BillingAddress *string + TaxIdentifier *string + GeoLocation *enums.Region + OrganizationID *string +} + +// Mutate applies the CreateOrganizationSettingInput on the OrganizationSettingMutation builder. +func (i *CreateOrganizationSettingInput) Mutate(m *OrganizationSettingMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.Domains; v != nil { + m.SetDomains(v) + } + if v := i.BillingContact; v != nil { + m.SetBillingContact(*v) + } + if v := i.BillingEmail; v != nil { + m.SetBillingEmail(*v) + } + if v := i.BillingPhone; v != nil { + m.SetBillingPhone(*v) + } + if v := i.BillingAddress; v != nil { + m.SetBillingAddress(*v) + } + if v := i.TaxIdentifier; v != nil { + m.SetTaxIdentifier(*v) + } + if v := i.GeoLocation; v != nil { + m.SetGeoLocation(*v) + } + if v := i.OrganizationID; v != nil { + m.SetOrganizationID(*v) + } +} + +// SetInput applies the change-set in the CreateOrganizationSettingInput on the OrganizationSettingCreate builder. +func (c *OrganizationSettingCreate) SetInput(i CreateOrganizationSettingInput) *OrganizationSettingCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateOrganizationSettingInput represents a mutation input for updating organizationsettings. +type UpdateOrganizationSettingInput struct { + ClearTags bool + Tags []string + AppendTags []string + ClearDomains bool + Domains []string + AppendDomains []string + ClearBillingContact bool + BillingContact *string + ClearBillingEmail bool + BillingEmail *string + ClearBillingPhone bool + BillingPhone *string + ClearBillingAddress bool + BillingAddress *string + ClearTaxIdentifier bool + TaxIdentifier *string + ClearGeoLocation bool + GeoLocation *enums.Region + ClearOrganization bool + OrganizationID *string +} + +// Mutate applies the UpdateOrganizationSettingInput on the OrganizationSettingMutation builder. +func (i *UpdateOrganizationSettingInput) Mutate(m *OrganizationSettingMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if i.ClearDomains { + m.ClearDomains() + } + if v := i.Domains; v != nil { + m.SetDomains(v) + } + if i.AppendDomains != nil { + m.AppendDomains(i.Domains) + } + if i.ClearBillingContact { + m.ClearBillingContact() + } + if v := i.BillingContact; v != nil { + m.SetBillingContact(*v) + } + if i.ClearBillingEmail { + m.ClearBillingEmail() + } + if v := i.BillingEmail; v != nil { + m.SetBillingEmail(*v) + } + if i.ClearBillingPhone { + m.ClearBillingPhone() + } + if v := i.BillingPhone; v != nil { + m.SetBillingPhone(*v) + } + if i.ClearBillingAddress { + m.ClearBillingAddress() + } + if v := i.BillingAddress; v != nil { + m.SetBillingAddress(*v) + } + if i.ClearTaxIdentifier { + m.ClearTaxIdentifier() + } + if v := i.TaxIdentifier; v != nil { + m.SetTaxIdentifier(*v) + } + if i.ClearGeoLocation { + m.ClearGeoLocation() + } + if v := i.GeoLocation; v != nil { + m.SetGeoLocation(*v) + } + if i.ClearOrganization { + m.ClearOrganization() + } + if v := i.OrganizationID; v != nil { + m.SetOrganizationID(*v) + } +} + +// SetInput applies the change-set in the UpdateOrganizationSettingInput on the OrganizationSettingUpdate builder. +func (c *OrganizationSettingUpdate) SetInput(i UpdateOrganizationSettingInput) *OrganizationSettingUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateOrganizationSettingInput on the OrganizationSettingUpdateOne builder. +func (c *OrganizationSettingUpdateOne) SetInput(i UpdateOrganizationSettingInput) *OrganizationSettingUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreatePersonalAccessTokenInput represents a mutation input for creating personalaccesstokens. +type CreatePersonalAccessTokenInput struct { + Tags []string + Name string + ExpiresAt *time.Time + Description *string + Scopes []string + LastUsedAt *time.Time + OwnerID string + OrganizationIDs []string + EventIDs []string +} + +// Mutate applies the CreatePersonalAccessTokenInput on the PersonalAccessTokenMutation builder. +func (i *CreatePersonalAccessTokenInput) Mutate(m *PersonalAccessTokenMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.ExpiresAt; v != nil { + m.SetExpiresAt(*v) + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Scopes; v != nil { + m.SetScopes(v) + } + if v := i.LastUsedAt; v != nil { + m.SetLastUsedAt(*v) + } + m.SetOwnerID(i.OwnerID) + if v := i.OrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreatePersonalAccessTokenInput on the PersonalAccessTokenCreate builder. +func (c *PersonalAccessTokenCreate) SetInput(i CreatePersonalAccessTokenInput) *PersonalAccessTokenCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdatePersonalAccessTokenInput represents a mutation input for updating personalaccesstokens. +type UpdatePersonalAccessTokenInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + ClearDescription bool + Description *string + ClearScopes bool + Scopes []string + AppendScopes []string + ClearLastUsedAt bool + LastUsedAt *time.Time + ClearOrganizations bool + AddOrganizationIDs []string + RemoveOrganizationIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdatePersonalAccessTokenInput on the PersonalAccessTokenMutation builder. +func (i *UpdatePersonalAccessTokenInput) Mutate(m *PersonalAccessTokenMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if i.ClearScopes { + m.ClearScopes() + } + if v := i.Scopes; v != nil { + m.SetScopes(v) + } + if i.AppendScopes != nil { + m.AppendScopes(i.Scopes) + } + if i.ClearLastUsedAt { + m.ClearLastUsedAt() + } + if v := i.LastUsedAt; v != nil { + m.SetLastUsedAt(*v) + } + if i.ClearOrganizations { + m.ClearOrganizations() + } + if v := i.AddOrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.RemoveOrganizationIDs; len(v) > 0 { + m.RemoveOrganizationIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdatePersonalAccessTokenInput on the PersonalAccessTokenUpdate builder. +func (c *PersonalAccessTokenUpdate) SetInput(i UpdatePersonalAccessTokenInput) *PersonalAccessTokenUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdatePersonalAccessTokenInput on the PersonalAccessTokenUpdateOne builder. +func (c *PersonalAccessTokenUpdateOne) SetInput(i UpdatePersonalAccessTokenInput) *PersonalAccessTokenUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateSubscriberInput represents a mutation input for creating subscribers. +type CreateSubscriberInput struct { + Tags []string + Email string + PhoneNumber *string + OwnerID *string + EventIDs []string +} + +// Mutate applies the CreateSubscriberInput on the SubscriberMutation builder. +func (i *CreateSubscriberInput) Mutate(m *SubscriberMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetEmail(i.Email) + if v := i.PhoneNumber; v != nil { + m.SetPhoneNumber(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateSubscriberInput on the SubscriberCreate builder. +func (c *SubscriberCreate) SetInput(i CreateSubscriberInput) *SubscriberCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateSubscriberInput represents a mutation input for updating subscribers. +type UpdateSubscriberInput struct { + ClearTags bool + Tags []string + AppendTags []string + Email *string + ClearPhoneNumber bool + PhoneNumber *string + ClearOwner bool + OwnerID *string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateSubscriberInput on the SubscriberMutation builder. +func (i *UpdateSubscriberInput) Mutate(m *SubscriberMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Email; v != nil { + m.SetEmail(*v) + } + if i.ClearPhoneNumber { + m.ClearPhoneNumber() + } + if v := i.PhoneNumber; v != nil { + m.SetPhoneNumber(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateSubscriberInput on the SubscriberUpdate builder. +func (c *SubscriberUpdate) SetInput(i UpdateSubscriberInput) *SubscriberUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateSubscriberInput on the SubscriberUpdateOne builder. +func (c *SubscriberUpdateOne) SetInput(i UpdateSubscriberInput) *SubscriberUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateTFASettingInput represents a mutation input for creating tfasettings. +type CreateTFASettingInput struct { + Tags []string + TotpAllowed *bool + OwnerID *string +} + +// Mutate applies the CreateTFASettingInput on the TFASettingMutation builder. +func (i *CreateTFASettingInput) Mutate(m *TFASettingMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.TotpAllowed; v != nil { + m.SetTotpAllowed(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } +} + +// SetInput applies the change-set in the CreateTFASettingInput on the TFASettingCreate builder. +func (c *TFASettingCreate) SetInput(i CreateTFASettingInput) *TFASettingCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateTFASettingInput represents a mutation input for updating tfasettings. +type UpdateTFASettingInput struct { + ClearTags bool + Tags []string + AppendTags []string + Verified *bool + ClearTotpAllowed bool + TotpAllowed *bool +} + +// Mutate applies the UpdateTFASettingInput on the TFASettingMutation builder. +func (i *UpdateTFASettingInput) Mutate(m *TFASettingMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Verified; v != nil { + m.SetVerified(*v) + } + if i.ClearTotpAllowed { + m.ClearTotpAllowed() + } + if v := i.TotpAllowed; v != nil { + m.SetTotpAllowed(*v) + } +} + +// SetInput applies the change-set in the UpdateTFASettingInput on the TFASettingUpdate builder. +func (c *TFASettingUpdate) SetInput(i UpdateTFASettingInput) *TFASettingUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateTFASettingInput on the TFASettingUpdateOne builder. +func (c *TFASettingUpdateOne) SetInput(i UpdateTFASettingInput) *TFASettingUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateTemplateInput represents a mutation input for creating templates. +type CreateTemplateInput struct { + Tags []string + Name string + TemplateType *enums.DocumentType + Description *string + Jsonconfig customtypes.JSONObject + Uischema customtypes.JSONObject + OwnerID *string + DocumentIDs []string +} + +// Mutate applies the CreateTemplateInput on the TemplateMutation builder. +func (i *CreateTemplateInput) Mutate(m *TemplateMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.TemplateType; v != nil { + m.SetTemplateType(*v) + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Jsonconfig; v != nil { + m.SetJsonconfig(v) + } + if v := i.Uischema; v != nil { + m.SetUischema(v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.DocumentIDs; len(v) > 0 { + m.AddDocumentIDs(v...) + } +} + +// SetInput applies the change-set in the CreateTemplateInput on the TemplateCreate builder. +func (c *TemplateCreate) SetInput(i CreateTemplateInput) *TemplateCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateTemplateInput represents a mutation input for updating templates. +type UpdateTemplateInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + TemplateType *enums.DocumentType + ClearDescription bool + Description *string + Jsonconfig customtypes.JSONObject + ClearUischema bool + Uischema customtypes.JSONObject + ClearOwner bool + OwnerID *string + ClearDocuments bool + AddDocumentIDs []string + RemoveDocumentIDs []string +} + +// Mutate applies the UpdateTemplateInput on the TemplateMutation builder. +func (i *UpdateTemplateInput) Mutate(m *TemplateMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if v := i.TemplateType; v != nil { + m.SetTemplateType(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.Jsonconfig; v != nil { + m.SetJsonconfig(v) + } + if i.ClearUischema { + m.ClearUischema() + } + if v := i.Uischema; v != nil { + m.SetUischema(v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearDocuments { + m.ClearDocuments() + } + if v := i.AddDocumentIDs; len(v) > 0 { + m.AddDocumentIDs(v...) + } + if v := i.RemoveDocumentIDs; len(v) > 0 { + m.RemoveDocumentIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateTemplateInput on the TemplateUpdate builder. +func (c *TemplateUpdate) SetInput(i UpdateTemplateInput) *TemplateUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateTemplateInput on the TemplateUpdateOne builder. +func (c *TemplateUpdateOne) SetInput(i UpdateTemplateInput) *TemplateUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateUserInput represents a mutation input for creating users. +type CreateUserInput struct { + Tags []string + Email string + FirstName *string + LastName *string + DisplayName string + AvatarRemoteURL *string + AvatarLocalFile *string + AvatarUpdatedAt *time.Time + LastSeen *time.Time + Password *string + Sub *string + AuthProvider *enums.AuthProvider + Role *enums.Role + PersonalAccessTokenIDs []string + TfaSettingIDs []string + SettingID string + EmailVerificationTokenIDs []string + PasswordResetTokenIDs []string + GroupIDs []string + OrganizationIDs []string + WebauthnIDs []string + FileIDs []string + EventIDs []string +} + +// Mutate applies the CreateUserInput on the UserMutation builder. +func (i *CreateUserInput) Mutate(m *UserMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetEmail(i.Email) + if v := i.FirstName; v != nil { + m.SetFirstName(*v) + } + if v := i.LastName; v != nil { + m.SetLastName(*v) + } + m.SetDisplayName(i.DisplayName) + if v := i.AvatarRemoteURL; v != nil { + m.SetAvatarRemoteURL(*v) + } + if v := i.AvatarLocalFile; v != nil { + m.SetAvatarLocalFile(*v) + } + if v := i.AvatarUpdatedAt; v != nil { + m.SetAvatarUpdatedAt(*v) + } + if v := i.LastSeen; v != nil { + m.SetLastSeen(*v) + } + if v := i.Password; v != nil { + m.SetPassword(*v) + } + if v := i.Sub; v != nil { + m.SetSub(*v) + } + if v := i.AuthProvider; v != nil { + m.SetAuthProvider(*v) + } + if v := i.Role; v != nil { + m.SetRole(*v) + } + if v := i.PersonalAccessTokenIDs; len(v) > 0 { + m.AddPersonalAccessTokenIDs(v...) + } + if v := i.TfaSettingIDs; len(v) > 0 { + m.AddTfaSettingIDs(v...) + } + m.SetSettingID(i.SettingID) + if v := i.EmailVerificationTokenIDs; len(v) > 0 { + m.AddEmailVerificationTokenIDs(v...) + } + if v := i.PasswordResetTokenIDs; len(v) > 0 { + m.AddPasswordResetTokenIDs(v...) + } + if v := i.GroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } + if v := i.OrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.WebauthnIDs; len(v) > 0 { + m.AddWebauthnIDs(v...) + } + if v := i.FileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } +} + +// SetInput applies the change-set in the CreateUserInput on the UserCreate builder. +func (c *UserCreate) SetInput(i CreateUserInput) *UserCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateUserInput represents a mutation input for updating users. +type UpdateUserInput struct { + ClearTags bool + Tags []string + AppendTags []string + Email *string + ClearFirstName bool + FirstName *string + ClearLastName bool + LastName *string + DisplayName *string + ClearAvatarRemoteURL bool + AvatarRemoteURL *string + ClearAvatarLocalFile bool + AvatarLocalFile *string + ClearAvatarUpdatedAt bool + AvatarUpdatedAt *time.Time + ClearLastSeen bool + LastSeen *time.Time + ClearPassword bool + Password *string + ClearSub bool + Sub *string + AuthProvider *enums.AuthProvider + ClearRole bool + Role *enums.Role + ClearPersonalAccessTokens bool + AddPersonalAccessTokenIDs []string + RemovePersonalAccessTokenIDs []string + ClearTfaSettings bool + AddTfaSettingIDs []string + RemoveTfaSettingIDs []string + SettingID *string + ClearEmailVerificationTokens bool + AddEmailVerificationTokenIDs []string + RemoveEmailVerificationTokenIDs []string + ClearPasswordResetTokens bool + AddPasswordResetTokenIDs []string + RemovePasswordResetTokenIDs []string + ClearGroups bool + AddGroupIDs []string + RemoveGroupIDs []string + ClearOrganizations bool + AddOrganizationIDs []string + RemoveOrganizationIDs []string + ClearWebauthn bool + AddWebauthnIDs []string + RemoveWebauthnIDs []string + ClearFiles bool + AddFileIDs []string + RemoveFileIDs []string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string +} + +// Mutate applies the UpdateUserInput on the UserMutation builder. +func (i *UpdateUserInput) Mutate(m *UserMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Email; v != nil { + m.SetEmail(*v) + } + if i.ClearFirstName { + m.ClearFirstName() + } + if v := i.FirstName; v != nil { + m.SetFirstName(*v) + } + if i.ClearLastName { + m.ClearLastName() + } + if v := i.LastName; v != nil { + m.SetLastName(*v) + } + if v := i.DisplayName; v != nil { + m.SetDisplayName(*v) + } + if i.ClearAvatarRemoteURL { + m.ClearAvatarRemoteURL() + } + if v := i.AvatarRemoteURL; v != nil { + m.SetAvatarRemoteURL(*v) + } + if i.ClearAvatarLocalFile { + m.ClearAvatarLocalFile() + } + if v := i.AvatarLocalFile; v != nil { + m.SetAvatarLocalFile(*v) + } + if i.ClearAvatarUpdatedAt { + m.ClearAvatarUpdatedAt() + } + if v := i.AvatarUpdatedAt; v != nil { + m.SetAvatarUpdatedAt(*v) + } + if i.ClearLastSeen { + m.ClearLastSeen() + } + if v := i.LastSeen; v != nil { + m.SetLastSeen(*v) + } + if i.ClearPassword { + m.ClearPassword() + } + if v := i.Password; v != nil { + m.SetPassword(*v) + } + if i.ClearSub { + m.ClearSub() + } + if v := i.Sub; v != nil { + m.SetSub(*v) + } + if v := i.AuthProvider; v != nil { + m.SetAuthProvider(*v) + } + if i.ClearRole { + m.ClearRole() + } + if v := i.Role; v != nil { + m.SetRole(*v) + } + if i.ClearPersonalAccessTokens { + m.ClearPersonalAccessTokens() + } + if v := i.AddPersonalAccessTokenIDs; len(v) > 0 { + m.AddPersonalAccessTokenIDs(v...) + } + if v := i.RemovePersonalAccessTokenIDs; len(v) > 0 { + m.RemovePersonalAccessTokenIDs(v...) + } + if i.ClearTfaSettings { + m.ClearTfaSettings() + } + if v := i.AddTfaSettingIDs; len(v) > 0 { + m.AddTfaSettingIDs(v...) + } + if v := i.RemoveTfaSettingIDs; len(v) > 0 { + m.RemoveTfaSettingIDs(v...) + } + if v := i.SettingID; v != nil { + m.SetSettingID(*v) + } + if i.ClearEmailVerificationTokens { + m.ClearEmailVerificationTokens() + } + if v := i.AddEmailVerificationTokenIDs; len(v) > 0 { + m.AddEmailVerificationTokenIDs(v...) + } + if v := i.RemoveEmailVerificationTokenIDs; len(v) > 0 { + m.RemoveEmailVerificationTokenIDs(v...) + } + if i.ClearPasswordResetTokens { + m.ClearPasswordResetTokens() + } + if v := i.AddPasswordResetTokenIDs; len(v) > 0 { + m.AddPasswordResetTokenIDs(v...) + } + if v := i.RemovePasswordResetTokenIDs; len(v) > 0 { + m.RemovePasswordResetTokenIDs(v...) + } + if i.ClearGroups { + m.ClearGroups() + } + if v := i.AddGroupIDs; len(v) > 0 { + m.AddGroupIDs(v...) + } + if v := i.RemoveGroupIDs; len(v) > 0 { + m.RemoveGroupIDs(v...) + } + if i.ClearOrganizations { + m.ClearOrganizations() + } + if v := i.AddOrganizationIDs; len(v) > 0 { + m.AddOrganizationIDs(v...) + } + if v := i.RemoveOrganizationIDs; len(v) > 0 { + m.RemoveOrganizationIDs(v...) + } + if i.ClearWebauthn { + m.ClearWebauthn() + } + if v := i.AddWebauthnIDs; len(v) > 0 { + m.AddWebauthnIDs(v...) + } + if v := i.RemoveWebauthnIDs; len(v) > 0 { + m.RemoveWebauthnIDs(v...) + } + if i.ClearFiles { + m.ClearFiles() + } + if v := i.AddFileIDs; len(v) > 0 { + m.AddFileIDs(v...) + } + if v := i.RemoveFileIDs; len(v) > 0 { + m.RemoveFileIDs(v...) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateUserInput on the UserUpdate builder. +func (c *UserUpdate) SetInput(i UpdateUserInput) *UserUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateUserInput on the UserUpdateOne builder. +func (c *UserUpdateOne) SetInput(i UpdateUserInput) *UserUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateUserSettingInput represents a mutation input for creating usersettings. +type CreateUserSettingInput struct { + Tags []string + Locked *bool + SilencedAt *time.Time + SuspendedAt *time.Time + Status *enums.UserStatus + EmailConfirmed *bool + IsWebauthnAllowed *bool + IsTfaEnabled *bool + UserID *string + DefaultOrgID *string +} + +// Mutate applies the CreateUserSettingInput on the UserSettingMutation builder. +func (i *CreateUserSettingInput) Mutate(m *UserSettingMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + if v := i.Locked; v != nil { + m.SetLocked(*v) + } + if v := i.SilencedAt; v != nil { + m.SetSilencedAt(*v) + } + if v := i.SuspendedAt; v != nil { + m.SetSuspendedAt(*v) + } + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if v := i.EmailConfirmed; v != nil { + m.SetEmailConfirmed(*v) + } + if v := i.IsWebauthnAllowed; v != nil { + m.SetIsWebauthnAllowed(*v) + } + if v := i.IsTfaEnabled; v != nil { + m.SetIsTfaEnabled(*v) + } + if v := i.UserID; v != nil { + m.SetUserID(*v) + } + if v := i.DefaultOrgID; v != nil { + m.SetDefaultOrgID(*v) + } +} + +// SetInput applies the change-set in the CreateUserSettingInput on the UserSettingCreate builder. +func (c *UserSettingCreate) SetInput(i CreateUserSettingInput) *UserSettingCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateUserSettingInput represents a mutation input for updating usersettings. +type UpdateUserSettingInput struct { + ClearTags bool + Tags []string + AppendTags []string + Locked *bool + ClearSilencedAt bool + SilencedAt *time.Time + ClearSuspendedAt bool + SuspendedAt *time.Time + Status *enums.UserStatus + EmailConfirmed *bool + ClearIsWebauthnAllowed bool + IsWebauthnAllowed *bool + ClearIsTfaEnabled bool + IsTfaEnabled *bool + ClearUser bool + UserID *string + ClearDefaultOrg bool + DefaultOrgID *string +} + +// Mutate applies the UpdateUserSettingInput on the UserSettingMutation builder. +func (i *UpdateUserSettingInput) Mutate(m *UserSettingMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Locked; v != nil { + m.SetLocked(*v) + } + if i.ClearSilencedAt { + m.ClearSilencedAt() + } + if v := i.SilencedAt; v != nil { + m.SetSilencedAt(*v) + } + if i.ClearSuspendedAt { + m.ClearSuspendedAt() + } + if v := i.SuspendedAt; v != nil { + m.SetSuspendedAt(*v) + } + if v := i.Status; v != nil { + m.SetStatus(*v) + } + if v := i.EmailConfirmed; v != nil { + m.SetEmailConfirmed(*v) + } + if i.ClearIsWebauthnAllowed { + m.ClearIsWebauthnAllowed() + } + if v := i.IsWebauthnAllowed; v != nil { + m.SetIsWebauthnAllowed(*v) + } + if i.ClearIsTfaEnabled { + m.ClearIsTfaEnabled() + } + if v := i.IsTfaEnabled; v != nil { + m.SetIsTfaEnabled(*v) + } + if i.ClearUser { + m.ClearUser() + } + if v := i.UserID; v != nil { + m.SetUserID(*v) + } + if i.ClearDefaultOrg { + m.ClearDefaultOrg() + } + if v := i.DefaultOrgID; v != nil { + m.SetDefaultOrgID(*v) + } +} + +// SetInput applies the change-set in the UpdateUserSettingInput on the UserSettingUpdate builder. +func (c *UserSettingUpdate) SetInput(i UpdateUserSettingInput) *UserSettingUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateUserSettingInput on the UserSettingUpdateOne builder. +func (c *UserSettingUpdateOne) SetInput(i UpdateUserSettingInput) *UserSettingUpdateOne { + i.Mutate(c.Mutation()) + return c +} + +// CreateWebhookInput represents a mutation input for creating webhooks. +type CreateWebhookInput struct { + Tags []string + Name string + Description *string + DestinationURL string + Enabled *bool + Failures *int + LastError *string + LastResponse *string + OwnerID *string + EventIDs []string + IntegrationIDs []string +} + +// Mutate applies the CreateWebhookInput on the WebhookMutation builder. +func (i *CreateWebhookInput) Mutate(m *WebhookMutation) { + if v := i.Tags; v != nil { + m.SetTags(v) + } + m.SetName(i.Name) + if v := i.Description; v != nil { + m.SetDescription(*v) + } + m.SetDestinationURL(i.DestinationURL) + if v := i.Enabled; v != nil { + m.SetEnabled(*v) + } + if v := i.Failures; v != nil { + m.SetFailures(*v) + } + if v := i.LastError; v != nil { + m.SetLastError(*v) + } + if v := i.LastResponse; v != nil { + m.SetLastResponse(*v) + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if v := i.EventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.IntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } +} + +// SetInput applies the change-set in the CreateWebhookInput on the WebhookCreate builder. +func (c *WebhookCreate) SetInput(i CreateWebhookInput) *WebhookCreate { + i.Mutate(c.Mutation()) + return c +} + +// UpdateWebhookInput represents a mutation input for updating webhooks. +type UpdateWebhookInput struct { + ClearTags bool + Tags []string + AppendTags []string + Name *string + ClearDescription bool + Description *string + DestinationURL *string + Enabled *bool + ClearFailures bool + Failures *int + ClearLastError bool + LastError *string + ClearLastResponse bool + LastResponse *string + ClearOwner bool + OwnerID *string + ClearEvents bool + AddEventIDs []string + RemoveEventIDs []string + ClearIntegrations bool + AddIntegrationIDs []string + RemoveIntegrationIDs []string +} + +// Mutate applies the UpdateWebhookInput on the WebhookMutation builder. +func (i *UpdateWebhookInput) Mutate(m *WebhookMutation) { + if i.ClearTags { + m.ClearTags() + } + if v := i.Tags; v != nil { + m.SetTags(v) + } + if i.AppendTags != nil { + m.AppendTags(i.Tags) + } + if v := i.Name; v != nil { + m.SetName(*v) + } + if i.ClearDescription { + m.ClearDescription() + } + if v := i.Description; v != nil { + m.SetDescription(*v) + } + if v := i.DestinationURL; v != nil { + m.SetDestinationURL(*v) + } + if v := i.Enabled; v != nil { + m.SetEnabled(*v) + } + if i.ClearFailures { + m.ClearFailures() + } + if v := i.Failures; v != nil { + m.SetFailures(*v) + } + if i.ClearLastError { + m.ClearLastError() + } + if v := i.LastError; v != nil { + m.SetLastError(*v) + } + if i.ClearLastResponse { + m.ClearLastResponse() + } + if v := i.LastResponse; v != nil { + m.SetLastResponse(*v) + } + if i.ClearOwner { + m.ClearOwner() + } + if v := i.OwnerID; v != nil { + m.SetOwnerID(*v) + } + if i.ClearEvents { + m.ClearEvents() + } + if v := i.AddEventIDs; len(v) > 0 { + m.AddEventIDs(v...) + } + if v := i.RemoveEventIDs; len(v) > 0 { + m.RemoveEventIDs(v...) + } + if i.ClearIntegrations { + m.ClearIntegrations() + } + if v := i.AddIntegrationIDs; len(v) > 0 { + m.AddIntegrationIDs(v...) + } + if v := i.RemoveIntegrationIDs; len(v) > 0 { + m.RemoveIntegrationIDs(v...) + } +} + +// SetInput applies the change-set in the UpdateWebhookInput on the WebhookUpdate builder. +func (c *WebhookUpdate) SetInput(i UpdateWebhookInput) *WebhookUpdate { + i.Mutate(c.Mutation()) + return c +} + +// SetInput applies the change-set in the UpdateWebhookInput on the WebhookUpdateOne builder. +func (c *WebhookUpdateOne) SetInput(i UpdateWebhookInput) *WebhookUpdateOne { + i.Mutate(c.Mutation()) + return c +} diff --git a/internal/ent/generated/gql_node.go b/internal/ent/generated/gql_node.go new file mode 100644 index 0000000..49da825 --- /dev/null +++ b/internal/ent/generated/gql_node.go @@ -0,0 +1,1828 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + + "entgo.io/contrib/entgql" + "github.com/99designs/gqlgen/graphql" + "github.com/hashicorp/go-multierror" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" +) + +// Noder wraps the basic Node method. +type Noder interface { + IsNode() +} + +var apitokenImplementors = []string{"APIToken", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*APIToken) IsNode() {} + +var contactImplementors = []string{"Contact", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Contact) IsNode() {} + +var contacthistoryImplementors = []string{"ContactHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*ContactHistory) IsNode() {} + +var documentdataImplementors = []string{"DocumentData", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*DocumentData) IsNode() {} + +var documentdatahistoryImplementors = []string{"DocumentDataHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*DocumentDataHistory) IsNode() {} + +var entitlementImplementors = []string{"Entitlement", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Entitlement) IsNode() {} + +var entitlementhistoryImplementors = []string{"EntitlementHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntitlementHistory) IsNode() {} + +var entitlementplanImplementors = []string{"EntitlementPlan", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntitlementPlan) IsNode() {} + +var entitlementplanfeatureImplementors = []string{"EntitlementPlanFeature", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntitlementPlanFeature) IsNode() {} + +var entitlementplanfeaturehistoryImplementors = []string{"EntitlementPlanFeatureHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntitlementPlanFeatureHistory) IsNode() {} + +var entitlementplanhistoryImplementors = []string{"EntitlementPlanHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntitlementPlanHistory) IsNode() {} + +var entityImplementors = []string{"Entity", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Entity) IsNode() {} + +var entityhistoryImplementors = []string{"EntityHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntityHistory) IsNode() {} + +var entitytypeImplementors = []string{"EntityType", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntityType) IsNode() {} + +var entitytypehistoryImplementors = []string{"EntityTypeHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EntityTypeHistory) IsNode() {} + +var eventImplementors = []string{"Event", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Event) IsNode() {} + +var eventhistoryImplementors = []string{"EventHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*EventHistory) IsNode() {} + +var featureImplementors = []string{"Feature", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Feature) IsNode() {} + +var featurehistoryImplementors = []string{"FeatureHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*FeatureHistory) IsNode() {} + +var fileImplementors = []string{"File", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*File) IsNode() {} + +var filehistoryImplementors = []string{"FileHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*FileHistory) IsNode() {} + +var groupImplementors = []string{"Group", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Group) IsNode() {} + +var grouphistoryImplementors = []string{"GroupHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*GroupHistory) IsNode() {} + +var groupmembershipImplementors = []string{"GroupMembership", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*GroupMembership) IsNode() {} + +var groupmembershiphistoryImplementors = []string{"GroupMembershipHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*GroupMembershipHistory) IsNode() {} + +var groupsettingImplementors = []string{"GroupSetting", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*GroupSetting) IsNode() {} + +var groupsettinghistoryImplementors = []string{"GroupSettingHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*GroupSettingHistory) IsNode() {} + +var hushImplementors = []string{"Hush", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Hush) IsNode() {} + +var hushhistoryImplementors = []string{"HushHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*HushHistory) IsNode() {} + +var integrationImplementors = []string{"Integration", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Integration) IsNode() {} + +var integrationhistoryImplementors = []string{"IntegrationHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*IntegrationHistory) IsNode() {} + +var inviteImplementors = []string{"Invite", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Invite) IsNode() {} + +var noteImplementors = []string{"Note", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Note) IsNode() {} + +var notehistoryImplementors = []string{"NoteHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*NoteHistory) IsNode() {} + +var oauthproviderImplementors = []string{"OauthProvider", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OauthProvider) IsNode() {} + +var oauthproviderhistoryImplementors = []string{"OauthProviderHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OauthProviderHistory) IsNode() {} + +var ohauthtootokenImplementors = []string{"OhAuthTooToken", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OhAuthTooToken) IsNode() {} + +var orgmembershipImplementors = []string{"OrgMembership", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OrgMembership) IsNode() {} + +var orgmembershiphistoryImplementors = []string{"OrgMembershipHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OrgMembershipHistory) IsNode() {} + +var organizationImplementors = []string{"Organization", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Organization) IsNode() {} + +var organizationhistoryImplementors = []string{"OrganizationHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OrganizationHistory) IsNode() {} + +var organizationsettingImplementors = []string{"OrganizationSetting", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OrganizationSetting) IsNode() {} + +var organizationsettinghistoryImplementors = []string{"OrganizationSettingHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*OrganizationSettingHistory) IsNode() {} + +var personalaccesstokenImplementors = []string{"PersonalAccessToken", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*PersonalAccessToken) IsNode() {} + +var subscriberImplementors = []string{"Subscriber", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Subscriber) IsNode() {} + +var tfasettingImplementors = []string{"TFASetting", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*TFASetting) IsNode() {} + +var templateImplementors = []string{"Template", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Template) IsNode() {} + +var templatehistoryImplementors = []string{"TemplateHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*TemplateHistory) IsNode() {} + +var userImplementors = []string{"User", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*User) IsNode() {} + +var userhistoryImplementors = []string{"UserHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*UserHistory) IsNode() {} + +var usersettingImplementors = []string{"UserSetting", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*UserSetting) IsNode() {} + +var usersettinghistoryImplementors = []string{"UserSettingHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*UserSettingHistory) IsNode() {} + +var webhookImplementors = []string{"Webhook", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*Webhook) IsNode() {} + +var webhookhistoryImplementors = []string{"WebhookHistory", "Node"} + +// IsNode implements the Node interface check for GQLGen. +func (*WebhookHistory) IsNode() {} + +var errNodeInvalidID = &NotFoundError{"node"} + +// NodeOption allows configuring the Noder execution using functional options. +type NodeOption func(*nodeOptions) + +// WithNodeType sets the node Type resolver function (i.e. the table to query). +// If was not provided, the table will be derived from the universal-id +// configuration as described in: https://entgo.io/docs/migrate/#universal-ids. +func WithNodeType(f func(context.Context, string) (string, error)) NodeOption { + return func(o *nodeOptions) { + o.nodeType = f + } +} + +// WithFixedNodeType sets the Type of the node to a fixed value. +func WithFixedNodeType(t string) NodeOption { + return WithNodeType(func(context.Context, string) (string, error) { + return t, nil + }) +} + +type nodeOptions struct { + nodeType func(context.Context, string) (string, error) +} + +func (c *Client) newNodeOpts(opts []NodeOption) *nodeOptions { + nopts := &nodeOptions{} + for _, opt := range opts { + opt(nopts) + } + if nopts.nodeType == nil { + nopts.nodeType = func(ctx context.Context, id string) (string, error) { + return "", fmt.Errorf("cannot resolve noder (%v) without its type", id) + } + } + return nopts +} + +// Noder returns a Node by its id. If the NodeType was not provided, it will +// be derived from the id value according to the universal-id configuration. +// +// c.Noder(ctx, id) +// c.Noder(ctx, id, ent.WithNodeType(typeResolver)) +func (c *Client) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error) { + defer func() { + if IsNotFound(err) { + err = multierror.Append(err, entgql.ErrNodeNotFound(id)) + } + }() + table, err := c.newNodeOpts(opts).nodeType(ctx, id) + if err != nil { + return nil, err + } + return c.noder(ctx, table, id) +} + +func (c *Client) noder(ctx context.Context, table string, id string) (Noder, error) { + switch table { + case apitoken.Table: + query := c.APIToken.Query(). + Where(apitoken.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, apitokenImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case contact.Table: + query := c.Contact.Query(). + Where(contact.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, contactImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case contacthistory.Table: + query := c.ContactHistory.Query(). + Where(contacthistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, contacthistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case documentdata.Table: + query := c.DocumentData.Query(). + Where(documentdata.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, documentdataImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case documentdatahistory.Table: + query := c.DocumentDataHistory.Query(). + Where(documentdatahistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, documentdatahistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitlement.Table: + query := c.Entitlement.Query(). + Where(entitlement.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitlementImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitlementhistory.Table: + query := c.EntitlementHistory.Query(). + Where(entitlementhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitlementhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitlementplan.Table: + query := c.EntitlementPlan.Query(). + Where(entitlementplan.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitlementplanImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitlementplanfeature.Table: + query := c.EntitlementPlanFeature.Query(). + Where(entitlementplanfeature.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitlementplanfeatureImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitlementplanfeaturehistory.Table: + query := c.EntitlementPlanFeatureHistory.Query(). + Where(entitlementplanfeaturehistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitlementplanfeaturehistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitlementplanhistory.Table: + query := c.EntitlementPlanHistory.Query(). + Where(entitlementplanhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitlementplanhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entity.Table: + query := c.Entity.Query(). + Where(entity.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entityImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entityhistory.Table: + query := c.EntityHistory.Query(). + Where(entityhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entityhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitytype.Table: + query := c.EntityType.Query(). + Where(entitytype.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitytypeImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case entitytypehistory.Table: + query := c.EntityTypeHistory.Query(). + Where(entitytypehistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, entitytypehistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case event.Table: + query := c.Event.Query(). + Where(event.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, eventImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case eventhistory.Table: + query := c.EventHistory.Query(). + Where(eventhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, eventhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case feature.Table: + query := c.Feature.Query(). + Where(feature.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, featureImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case featurehistory.Table: + query := c.FeatureHistory.Query(). + Where(featurehistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, featurehistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case file.Table: + query := c.File.Query(). + Where(file.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, fileImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case filehistory.Table: + query := c.FileHistory.Query(). + Where(filehistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, filehistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case group.Table: + query := c.Group.Query(). + Where(group.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, groupImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case grouphistory.Table: + query := c.GroupHistory.Query(). + Where(grouphistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, grouphistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case groupmembership.Table: + query := c.GroupMembership.Query(). + Where(groupmembership.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, groupmembershipImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case groupmembershiphistory.Table: + query := c.GroupMembershipHistory.Query(). + Where(groupmembershiphistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, groupmembershiphistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case groupsetting.Table: + query := c.GroupSetting.Query(). + Where(groupsetting.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, groupsettingImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case groupsettinghistory.Table: + query := c.GroupSettingHistory.Query(). + Where(groupsettinghistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, groupsettinghistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case hush.Table: + query := c.Hush.Query(). + Where(hush.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, hushImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case hushhistory.Table: + query := c.HushHistory.Query(). + Where(hushhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, hushhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case integration.Table: + query := c.Integration.Query(). + Where(integration.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, integrationImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case integrationhistory.Table: + query := c.IntegrationHistory.Query(). + Where(integrationhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, integrationhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case invite.Table: + query := c.Invite.Query(). + Where(invite.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, inviteImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case note.Table: + query := c.Note.Query(). + Where(note.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, noteImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case notehistory.Table: + query := c.NoteHistory.Query(). + Where(notehistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, notehistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case oauthprovider.Table: + query := c.OauthProvider.Query(). + Where(oauthprovider.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, oauthproviderImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case oauthproviderhistory.Table: + query := c.OauthProviderHistory.Query(). + Where(oauthproviderhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, oauthproviderhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case ohauthtootoken.Table: + query := c.OhAuthTooToken.Query(). + Where(ohauthtootoken.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, ohauthtootokenImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case orgmembership.Table: + query := c.OrgMembership.Query(). + Where(orgmembership.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, orgmembershipImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case orgmembershiphistory.Table: + query := c.OrgMembershipHistory.Query(). + Where(orgmembershiphistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, orgmembershiphistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case organization.Table: + query := c.Organization.Query(). + Where(organization.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, organizationImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case organizationhistory.Table: + query := c.OrganizationHistory.Query(). + Where(organizationhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, organizationhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case organizationsetting.Table: + query := c.OrganizationSetting.Query(). + Where(organizationsetting.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, organizationsettingImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case organizationsettinghistory.Table: + query := c.OrganizationSettingHistory.Query(). + Where(organizationsettinghistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, organizationsettinghistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case personalaccesstoken.Table: + query := c.PersonalAccessToken.Query(). + Where(personalaccesstoken.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, personalaccesstokenImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case subscriber.Table: + query := c.Subscriber.Query(). + Where(subscriber.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, subscriberImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case tfasetting.Table: + query := c.TFASetting.Query(). + Where(tfasetting.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, tfasettingImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case template.Table: + query := c.Template.Query(). + Where(template.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, templateImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case templatehistory.Table: + query := c.TemplateHistory.Query(). + Where(templatehistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, templatehistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case user.Table: + query := c.User.Query(). + Where(user.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, userImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case userhistory.Table: + query := c.UserHistory.Query(). + Where(userhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, userhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case usersetting.Table: + query := c.UserSetting.Query(). + Where(usersetting.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, usersettingImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case usersettinghistory.Table: + query := c.UserSettingHistory.Query(). + Where(usersettinghistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, usersettinghistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case webhook.Table: + query := c.Webhook.Query(). + Where(webhook.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, webhookImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + case webhookhistory.Table: + query := c.WebhookHistory.Query(). + Where(webhookhistory.ID(id)) + if fc := graphql.GetFieldContext(ctx); fc != nil { + if err := query.collectField(ctx, true, graphql.GetOperationContext(ctx), fc.Field, nil, webhookhistoryImplementors...); err != nil { + return nil, err + } + } + return query.Only(ctx) + default: + return nil, fmt.Errorf("cannot resolve noder from table %q: %w", table, errNodeInvalidID) + } +} + +func (c *Client) Noders(ctx context.Context, ids []string, opts ...NodeOption) ([]Noder, error) { + switch len(ids) { + case 1: + noder, err := c.Noder(ctx, ids[0], opts...) + if err != nil { + return nil, err + } + return []Noder{noder}, nil + case 0: + return []Noder{}, nil + } + + noders := make([]Noder, len(ids)) + errors := make([]error, len(ids)) + tables := make(map[string][]string) + id2idx := make(map[string][]int, len(ids)) + nopts := c.newNodeOpts(opts) + for i, id := range ids { + table, err := nopts.nodeType(ctx, id) + if err != nil { + errors[i] = err + continue + } + tables[table] = append(tables[table], id) + id2idx[id] = append(id2idx[id], i) + } + + for table, ids := range tables { + nodes, err := c.noders(ctx, table, ids) + if err != nil { + for _, id := range ids { + for _, idx := range id2idx[id] { + errors[idx] = err + } + } + } else { + for i, id := range ids { + for _, idx := range id2idx[id] { + noders[idx] = nodes[i] + } + } + } + } + + for i, id := range ids { + if errors[i] == nil { + if noders[i] != nil { + continue + } + errors[i] = entgql.ErrNodeNotFound(id) + } else if IsNotFound(errors[i]) { + errors[i] = multierror.Append(errors[i], entgql.ErrNodeNotFound(id)) + } + ctx := graphql.WithPathContext(ctx, + graphql.NewPathWithIndex(i), + ) + graphql.AddError(ctx, errors[i]) + } + return noders, nil +} + +func (c *Client) noders(ctx context.Context, table string, ids []string) ([]Noder, error) { + noders := make([]Noder, len(ids)) + idmap := make(map[string][]*Noder, len(ids)) + for i, id := range ids { + idmap[id] = append(idmap[id], &noders[i]) + } + switch table { + case apitoken.Table: + query := c.APIToken.Query(). + Where(apitoken.IDIn(ids...)) + query, err := query.CollectFields(ctx, apitokenImplementors...) + 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 contact.Table: + query := c.Contact.Query(). + Where(contact.IDIn(ids...)) + query, err := query.CollectFields(ctx, contactImplementors...) + 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 contacthistory.Table: + query := c.ContactHistory.Query(). + Where(contacthistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, contacthistoryImplementors...) + 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 documentdata.Table: + query := c.DocumentData.Query(). + Where(documentdata.IDIn(ids...)) + query, err := query.CollectFields(ctx, documentdataImplementors...) + 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 documentdatahistory.Table: + query := c.DocumentDataHistory.Query(). + Where(documentdatahistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, documentdatahistoryImplementors...) + 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 entitlement.Table: + query := c.Entitlement.Query(). + Where(entitlement.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitlementImplementors...) + 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 entitlementhistory.Table: + query := c.EntitlementHistory.Query(). + Where(entitlementhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitlementhistoryImplementors...) + 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 entitlementplan.Table: + query := c.EntitlementPlan.Query(). + Where(entitlementplan.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitlementplanImplementors...) + 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 entitlementplanfeature.Table: + query := c.EntitlementPlanFeature.Query(). + Where(entitlementplanfeature.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitlementplanfeatureImplementors...) + 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 entitlementplanfeaturehistory.Table: + query := c.EntitlementPlanFeatureHistory.Query(). + Where(entitlementplanfeaturehistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitlementplanfeaturehistoryImplementors...) + 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 entitlementplanhistory.Table: + query := c.EntitlementPlanHistory.Query(). + Where(entitlementplanhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitlementplanhistoryImplementors...) + 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 entity.Table: + query := c.Entity.Query(). + Where(entity.IDIn(ids...)) + query, err := query.CollectFields(ctx, entityImplementors...) + 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 entityhistory.Table: + query := c.EntityHistory.Query(). + Where(entityhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, entityhistoryImplementors...) + 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 entitytype.Table: + query := c.EntityType.Query(). + Where(entitytype.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitytypeImplementors...) + 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 entitytypehistory.Table: + query := c.EntityTypeHistory.Query(). + Where(entitytypehistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, entitytypehistoryImplementors...) + 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 event.Table: + query := c.Event.Query(). + Where(event.IDIn(ids...)) + query, err := query.CollectFields(ctx, eventImplementors...) + 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 eventhistory.Table: + query := c.EventHistory.Query(). + Where(eventhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, eventhistoryImplementors...) + 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 feature.Table: + query := c.Feature.Query(). + Where(feature.IDIn(ids...)) + query, err := query.CollectFields(ctx, featureImplementors...) + 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 featurehistory.Table: + query := c.FeatureHistory.Query(). + Where(featurehistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, featurehistoryImplementors...) + 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 file.Table: + query := c.File.Query(). + Where(file.IDIn(ids...)) + query, err := query.CollectFields(ctx, fileImplementors...) + 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 filehistory.Table: + query := c.FileHistory.Query(). + Where(filehistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, filehistoryImplementors...) + 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 group.Table: + query := c.Group.Query(). + Where(group.IDIn(ids...)) + query, err := query.CollectFields(ctx, groupImplementors...) + 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 grouphistory.Table: + query := c.GroupHistory.Query(). + Where(grouphistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, grouphistoryImplementors...) + 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 groupmembership.Table: + query := c.GroupMembership.Query(). + Where(groupmembership.IDIn(ids...)) + query, err := query.CollectFields(ctx, groupmembershipImplementors...) + 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 groupmembershiphistory.Table: + query := c.GroupMembershipHistory.Query(). + Where(groupmembershiphistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, groupmembershiphistoryImplementors...) + 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 groupsetting.Table: + query := c.GroupSetting.Query(). + Where(groupsetting.IDIn(ids...)) + query, err := query.CollectFields(ctx, groupsettingImplementors...) + 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 groupsettinghistory.Table: + query := c.GroupSettingHistory.Query(). + Where(groupsettinghistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, groupsettinghistoryImplementors...) + 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 hush.Table: + query := c.Hush.Query(). + Where(hush.IDIn(ids...)) + query, err := query.CollectFields(ctx, hushImplementors...) + 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 hushhistory.Table: + query := c.HushHistory.Query(). + Where(hushhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, hushhistoryImplementors...) + 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 integration.Table: + query := c.Integration.Query(). + Where(integration.IDIn(ids...)) + query, err := query.CollectFields(ctx, integrationImplementors...) + 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 integrationhistory.Table: + query := c.IntegrationHistory.Query(). + Where(integrationhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, integrationhistoryImplementors...) + 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 invite.Table: + query := c.Invite.Query(). + Where(invite.IDIn(ids...)) + query, err := query.CollectFields(ctx, inviteImplementors...) + 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 note.Table: + query := c.Note.Query(). + Where(note.IDIn(ids...)) + query, err := query.CollectFields(ctx, noteImplementors...) + 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 notehistory.Table: + query := c.NoteHistory.Query(). + Where(notehistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, notehistoryImplementors...) + 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 oauthprovider.Table: + query := c.OauthProvider.Query(). + Where(oauthprovider.IDIn(ids...)) + query, err := query.CollectFields(ctx, oauthproviderImplementors...) + 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 oauthproviderhistory.Table: + query := c.OauthProviderHistory.Query(). + Where(oauthproviderhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, oauthproviderhistoryImplementors...) + 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 ohauthtootoken.Table: + query := c.OhAuthTooToken.Query(). + Where(ohauthtootoken.IDIn(ids...)) + query, err := query.CollectFields(ctx, ohauthtootokenImplementors...) + 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 orgmembership.Table: + query := c.OrgMembership.Query(). + Where(orgmembership.IDIn(ids...)) + query, err := query.CollectFields(ctx, orgmembershipImplementors...) + 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 orgmembershiphistory.Table: + query := c.OrgMembershipHistory.Query(). + Where(orgmembershiphistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, orgmembershiphistoryImplementors...) + 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 organization.Table: + query := c.Organization.Query(). + Where(organization.IDIn(ids...)) + query, err := query.CollectFields(ctx, organizationImplementors...) + 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 organizationhistory.Table: + query := c.OrganizationHistory.Query(). + Where(organizationhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, organizationhistoryImplementors...) + 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 organizationsetting.Table: + query := c.OrganizationSetting.Query(). + Where(organizationsetting.IDIn(ids...)) + query, err := query.CollectFields(ctx, organizationsettingImplementors...) + 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 organizationsettinghistory.Table: + query := c.OrganizationSettingHistory.Query(). + Where(organizationsettinghistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, organizationsettinghistoryImplementors...) + 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 personalaccesstoken.Table: + query := c.PersonalAccessToken.Query(). + Where(personalaccesstoken.IDIn(ids...)) + query, err := query.CollectFields(ctx, personalaccesstokenImplementors...) + 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 subscriber.Table: + query := c.Subscriber.Query(). + Where(subscriber.IDIn(ids...)) + query, err := query.CollectFields(ctx, subscriberImplementors...) + 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 tfasetting.Table: + query := c.TFASetting.Query(). + Where(tfasetting.IDIn(ids...)) + query, err := query.CollectFields(ctx, tfasettingImplementors...) + 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 template.Table: + query := c.Template.Query(). + Where(template.IDIn(ids...)) + query, err := query.CollectFields(ctx, templateImplementors...) + 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 templatehistory.Table: + query := c.TemplateHistory.Query(). + Where(templatehistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, templatehistoryImplementors...) + 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 user.Table: + query := c.User.Query(). + Where(user.IDIn(ids...)) + query, err := query.CollectFields(ctx, userImplementors...) + 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 userhistory.Table: + query := c.UserHistory.Query(). + Where(userhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, userhistoryImplementors...) + 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 usersetting.Table: + query := c.UserSetting.Query(). + Where(usersetting.IDIn(ids...)) + query, err := query.CollectFields(ctx, usersettingImplementors...) + 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 usersettinghistory.Table: + query := c.UserSettingHistory.Query(). + Where(usersettinghistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, usersettinghistoryImplementors...) + 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 webhook.Table: + query := c.Webhook.Query(). + Where(webhook.IDIn(ids...)) + query, err := query.CollectFields(ctx, webhookImplementors...) + 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 webhookhistory.Table: + query := c.WebhookHistory.Query(). + Where(webhookhistory.IDIn(ids...)) + query, err := query.CollectFields(ctx, webhookhistoryImplementors...) + 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 + } + } + default: + return nil, fmt.Errorf("cannot resolve noders from table %q: %w", table, errNodeInvalidID) + } + return noders, nil +} diff --git a/internal/ent/generated/gql_pagination.go b/internal/ent/generated/gql_pagination.go new file mode 100644 index 0000000..48b086e --- /dev/null +++ b/internal/ent/generated/gql_pagination.go @@ -0,0 +1,14732 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "io" + "strconv" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/errcode" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/vektah/gqlparser/v2/gqlerror" +) + +// Common entgql types. +type ( + Cursor = entgql.Cursor[string] + PageInfo = entgql.PageInfo[string] + OrderDirection = entgql.OrderDirection +) + +func orderFunc(o OrderDirection, field string) func(*sql.Selector) { + if o == entgql.OrderDirectionDesc { + return Desc(field) + } + return Asc(field) +} + +const errInvalidPagination = "INVALID_PAGINATION" + +func validateFirstLast(first, last *int) (err *gqlerror.Error) { + switch { + case first != nil && last != nil: + err = &gqlerror.Error{ + Message: "Passing both `first` and `last` to paginate a connection is not supported.", + } + case first != nil && *first < 0: + err = &gqlerror.Error{ + Message: "`first` on a connection cannot be less than zero.", + } + errcode.Set(err, errInvalidPagination) + case last != nil && *last < 0: + err = &gqlerror.Error{ + Message: "`last` on a connection cannot be less than zero.", + } + errcode.Set(err, errInvalidPagination) + } + return err +} + +func collectedField(ctx context.Context, path ...string) *graphql.CollectedField { + fc := graphql.GetFieldContext(ctx) + if fc == nil { + return nil + } + field := fc.Field + oc := graphql.GetOperationContext(ctx) +walk: + for _, name := range path { + for _, f := range graphql.CollectFields(oc, field.Selections, nil) { + if f.Alias == name { + field = f + continue walk + } + } + return nil + } + return &field +} + +func hasCollectedField(ctx context.Context, path ...string) bool { + if graphql.GetFieldContext(ctx) == nil { + return true + } + return collectedField(ctx, path...) != nil +} + +const ( + edgesField = "edges" + nodeField = "node" + pageInfoField = "pageInfo" + totalCountField = "totalCount" +) + +func paginateLimit(first, last *int) int { + var limit int + if first != nil { + limit = *first + 1 + } else if last != nil { + limit = *last + 1 + } + return limit +} + +// APITokenEdge is the edge representation of APIToken. +type APITokenEdge struct { + Node *APIToken `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// APITokenConnection is the connection containing edges to APIToken. +type APITokenConnection struct { + Edges []*APITokenEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *APITokenConnection) build(nodes []*APIToken, pager *apitokenPager, 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) *APIToken + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *APIToken { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *APIToken { + return nodes[i] + } + } + c.Edges = make([]*APITokenEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &APITokenEdge{ + 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) + } +} + +// APITokenPaginateOption enables pagination customization. +type APITokenPaginateOption func(*apitokenPager) error + +// WithAPITokenOrder configures pagination ordering. +func WithAPITokenOrder(order *APITokenOrder) APITokenPaginateOption { + if order == nil { + order = DefaultAPITokenOrder + } + o := *order + return func(pager *apitokenPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultAPITokenOrder.Field + } + pager.order = &o + return nil + } +} + +// WithAPITokenFilter configures pagination filter. +func WithAPITokenFilter(filter func(*APITokenQuery) (*APITokenQuery, error)) APITokenPaginateOption { + return func(pager *apitokenPager) error { + if filter == nil { + return errors.New("APITokenQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type apitokenPager struct { + reverse bool + order *APITokenOrder + filter func(*APITokenQuery) (*APITokenQuery, error) +} + +func newAPITokenPager(opts []APITokenPaginateOption, reverse bool) (*apitokenPager, error) { + pager := &apitokenPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultAPITokenOrder + } + return pager, nil +} + +func (p *apitokenPager) applyFilter(query *APITokenQuery) (*APITokenQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *apitokenPager) toCursor(at *APIToken) Cursor { + return p.order.Field.toCursor(at) +} + +func (p *apitokenPager) applyCursors(query *APITokenQuery, after, before *Cursor) (*APITokenQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultAPITokenOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *apitokenPager) applyOrder(query *APITokenQuery) *APITokenQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultAPITokenOrder.Field { + query = query.Order(DefaultAPITokenOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *apitokenPager) orderExpr(query *APITokenQuery) 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 != DefaultAPITokenOrder.Field { + b.Comma().Ident(DefaultAPITokenOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to APIToken. +func (at *APITokenQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...APITokenPaginateOption, +) (*APITokenConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newAPITokenPager(opts, last != nil) + if err != nil { + return nil, err + } + if at, err = pager.applyFilter(at); err != nil { + return nil, err + } + conn := &APITokenConnection{Edges: []*APITokenEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := at.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 at, err = pager.applyCursors(at, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + at.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := at.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + at = pager.applyOrder(at) + nodes, err := at.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// APITokenOrderField defines the ordering field of APIToken. +type APITokenOrderField struct { + // Value extracts the ordering value from the given APIToken. + Value func(*APIToken) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) apitoken.OrderOption + toCursor func(*APIToken) Cursor +} + +// APITokenOrder defines the ordering of APIToken. +type APITokenOrder struct { + Direction OrderDirection `json:"direction"` + Field *APITokenOrderField `json:"field"` +} + +// DefaultAPITokenOrder is the default ordering of APIToken. +var DefaultAPITokenOrder = &APITokenOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &APITokenOrderField{ + Value: func(at *APIToken) (ent.Value, error) { + return at.ID, nil + }, + column: apitoken.FieldID, + toTerm: apitoken.ByID, + toCursor: func(at *APIToken) Cursor { + return Cursor{ID: at.ID} + }, + }, +} + +// ToEdge converts APIToken into APITokenEdge. +func (at *APIToken) ToEdge(order *APITokenOrder) *APITokenEdge { + if order == nil { + order = DefaultAPITokenOrder + } + return &APITokenEdge{ + Node: at, + Cursor: order.Field.toCursor(at), + } +} + +// ContactEdge is the edge representation of Contact. +type ContactEdge struct { + Node *Contact `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// ContactConnection is the connection containing edges to Contact. +type ContactConnection struct { + Edges []*ContactEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *ContactConnection) build(nodes []*Contact, pager *contactPager, 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) *Contact + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Contact { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Contact { + return nodes[i] + } + } + c.Edges = make([]*ContactEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &ContactEdge{ + 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) + } +} + +// ContactPaginateOption enables pagination customization. +type ContactPaginateOption func(*contactPager) error + +// WithContactOrder configures pagination ordering. +func WithContactOrder(order *ContactOrder) ContactPaginateOption { + if order == nil { + order = DefaultContactOrder + } + o := *order + return func(pager *contactPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultContactOrder.Field + } + pager.order = &o + return nil + } +} + +// WithContactFilter configures pagination filter. +func WithContactFilter(filter func(*ContactQuery) (*ContactQuery, error)) ContactPaginateOption { + return func(pager *contactPager) error { + if filter == nil { + return errors.New("ContactQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type contactPager struct { + reverse bool + order *ContactOrder + filter func(*ContactQuery) (*ContactQuery, error) +} + +func newContactPager(opts []ContactPaginateOption, reverse bool) (*contactPager, error) { + pager := &contactPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultContactOrder + } + return pager, nil +} + +func (p *contactPager) applyFilter(query *ContactQuery) (*ContactQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *contactPager) toCursor(c *Contact) Cursor { + return p.order.Field.toCursor(c) +} + +func (p *contactPager) applyCursors(query *ContactQuery, after, before *Cursor) (*ContactQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultContactOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *contactPager) applyOrder(query *ContactQuery) *ContactQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultContactOrder.Field { + query = query.Order(DefaultContactOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *contactPager) orderExpr(query *ContactQuery) 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 != DefaultContactOrder.Field { + b.Comma().Ident(DefaultContactOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Contact. +func (c *ContactQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...ContactPaginateOption, +) (*ContactConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newContactPager(opts, last != nil) + if err != nil { + return nil, err + } + if c, err = pager.applyFilter(c); err != nil { + return nil, err + } + conn := &ContactConnection{Edges: []*ContactEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := c.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 c, err = pager.applyCursors(c, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + c.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := c.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + c = pager.applyOrder(c) + nodes, err := c.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// ContactOrderField defines the ordering field of Contact. +type ContactOrderField struct { + // Value extracts the ordering value from the given Contact. + Value func(*Contact) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) contact.OrderOption + toCursor func(*Contact) Cursor +} + +// ContactOrder defines the ordering of Contact. +type ContactOrder struct { + Direction OrderDirection `json:"direction"` + Field *ContactOrderField `json:"field"` +} + +// DefaultContactOrder is the default ordering of Contact. +var DefaultContactOrder = &ContactOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &ContactOrderField{ + Value: func(c *Contact) (ent.Value, error) { + return c.ID, nil + }, + column: contact.FieldID, + toTerm: contact.ByID, + toCursor: func(c *Contact) Cursor { + return Cursor{ID: c.ID} + }, + }, +} + +// ToEdge converts Contact into ContactEdge. +func (c *Contact) ToEdge(order *ContactOrder) *ContactEdge { + if order == nil { + order = DefaultContactOrder + } + return &ContactEdge{ + Node: c, + Cursor: order.Field.toCursor(c), + } +} + +// ContactHistoryEdge is the edge representation of ContactHistory. +type ContactHistoryEdge struct { + Node *ContactHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// ContactHistoryConnection is the connection containing edges to ContactHistory. +type ContactHistoryConnection struct { + Edges []*ContactHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *ContactHistoryConnection) build(nodes []*ContactHistory, pager *contacthistoryPager, 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) *ContactHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *ContactHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *ContactHistory { + return nodes[i] + } + } + c.Edges = make([]*ContactHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &ContactHistoryEdge{ + 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) + } +} + +// ContactHistoryPaginateOption enables pagination customization. +type ContactHistoryPaginateOption func(*contacthistoryPager) error + +// WithContactHistoryOrder configures pagination ordering. +func WithContactHistoryOrder(order *ContactHistoryOrder) ContactHistoryPaginateOption { + if order == nil { + order = DefaultContactHistoryOrder + } + o := *order + return func(pager *contacthistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultContactHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithContactHistoryFilter configures pagination filter. +func WithContactHistoryFilter(filter func(*ContactHistoryQuery) (*ContactHistoryQuery, error)) ContactHistoryPaginateOption { + return func(pager *contacthistoryPager) error { + if filter == nil { + return errors.New("ContactHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type contacthistoryPager struct { + reverse bool + order *ContactHistoryOrder + filter func(*ContactHistoryQuery) (*ContactHistoryQuery, error) +} + +func newContactHistoryPager(opts []ContactHistoryPaginateOption, reverse bool) (*contacthistoryPager, error) { + pager := &contacthistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultContactHistoryOrder + } + return pager, nil +} + +func (p *contacthistoryPager) applyFilter(query *ContactHistoryQuery) (*ContactHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *contacthistoryPager) toCursor(ch *ContactHistory) Cursor { + return p.order.Field.toCursor(ch) +} + +func (p *contacthistoryPager) applyCursors(query *ContactHistoryQuery, after, before *Cursor) (*ContactHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultContactHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *contacthistoryPager) applyOrder(query *ContactHistoryQuery) *ContactHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultContactHistoryOrder.Field { + query = query.Order(DefaultContactHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *contacthistoryPager) orderExpr(query *ContactHistoryQuery) 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 != DefaultContactHistoryOrder.Field { + b.Comma().Ident(DefaultContactHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to ContactHistory. +func (ch *ContactHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...ContactHistoryPaginateOption, +) (*ContactHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newContactHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if ch, err = pager.applyFilter(ch); err != nil { + return nil, err + } + conn := &ContactHistoryConnection{Edges: []*ContactHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := ch.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 ch, err = pager.applyCursors(ch, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + ch.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ch.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ch = pager.applyOrder(ch) + nodes, err := ch.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// ContactHistoryOrderField defines the ordering field of ContactHistory. +type ContactHistoryOrderField struct { + // Value extracts the ordering value from the given ContactHistory. + Value func(*ContactHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) contacthistory.OrderOption + toCursor func(*ContactHistory) Cursor +} + +// ContactHistoryOrder defines the ordering of ContactHistory. +type ContactHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *ContactHistoryOrderField `json:"field"` +} + +// DefaultContactHistoryOrder is the default ordering of ContactHistory. +var DefaultContactHistoryOrder = &ContactHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &ContactHistoryOrderField{ + Value: func(ch *ContactHistory) (ent.Value, error) { + return ch.ID, nil + }, + column: contacthistory.FieldID, + toTerm: contacthistory.ByID, + toCursor: func(ch *ContactHistory) Cursor { + return Cursor{ID: ch.ID} + }, + }, +} + +// ToEdge converts ContactHistory into ContactHistoryEdge. +func (ch *ContactHistory) ToEdge(order *ContactHistoryOrder) *ContactHistoryEdge { + if order == nil { + order = DefaultContactHistoryOrder + } + return &ContactHistoryEdge{ + Node: ch, + Cursor: order.Field.toCursor(ch), + } +} + +// DocumentDataEdge is the edge representation of DocumentData. +type DocumentDataEdge struct { + Node *DocumentData `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// DocumentDataConnection is the connection containing edges to DocumentData. +type DocumentDataConnection struct { + Edges []*DocumentDataEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *DocumentDataConnection) build(nodes []*DocumentData, pager *documentdataPager, 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) *DocumentData + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *DocumentData { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *DocumentData { + return nodes[i] + } + } + c.Edges = make([]*DocumentDataEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &DocumentDataEdge{ + 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) + } +} + +// DocumentDataPaginateOption enables pagination customization. +type DocumentDataPaginateOption func(*documentdataPager) error + +// WithDocumentDataOrder configures pagination ordering. +func WithDocumentDataOrder(order *DocumentDataOrder) DocumentDataPaginateOption { + if order == nil { + order = DefaultDocumentDataOrder + } + o := *order + return func(pager *documentdataPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultDocumentDataOrder.Field + } + pager.order = &o + return nil + } +} + +// WithDocumentDataFilter configures pagination filter. +func WithDocumentDataFilter(filter func(*DocumentDataQuery) (*DocumentDataQuery, error)) DocumentDataPaginateOption { + return func(pager *documentdataPager) error { + if filter == nil { + return errors.New("DocumentDataQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type documentdataPager struct { + reverse bool + order *DocumentDataOrder + filter func(*DocumentDataQuery) (*DocumentDataQuery, error) +} + +func newDocumentDataPager(opts []DocumentDataPaginateOption, reverse bool) (*documentdataPager, error) { + pager := &documentdataPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultDocumentDataOrder + } + return pager, nil +} + +func (p *documentdataPager) applyFilter(query *DocumentDataQuery) (*DocumentDataQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *documentdataPager) toCursor(dd *DocumentData) Cursor { + return p.order.Field.toCursor(dd) +} + +func (p *documentdataPager) applyCursors(query *DocumentDataQuery, after, before *Cursor) (*DocumentDataQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultDocumentDataOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *documentdataPager) applyOrder(query *DocumentDataQuery) *DocumentDataQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultDocumentDataOrder.Field { + query = query.Order(DefaultDocumentDataOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *documentdataPager) orderExpr(query *DocumentDataQuery) 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 != DefaultDocumentDataOrder.Field { + b.Comma().Ident(DefaultDocumentDataOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to DocumentData. +func (dd *DocumentDataQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...DocumentDataPaginateOption, +) (*DocumentDataConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newDocumentDataPager(opts, last != nil) + if err != nil { + return nil, err + } + if dd, err = pager.applyFilter(dd); err != nil { + return nil, err + } + conn := &DocumentDataConnection{Edges: []*DocumentDataEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := dd.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 dd, err = pager.applyCursors(dd, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + dd.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := dd.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + dd = pager.applyOrder(dd) + nodes, err := dd.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// DocumentDataOrderField defines the ordering field of DocumentData. +type DocumentDataOrderField struct { + // Value extracts the ordering value from the given DocumentData. + Value func(*DocumentData) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) documentdata.OrderOption + toCursor func(*DocumentData) Cursor +} + +// DocumentDataOrder defines the ordering of DocumentData. +type DocumentDataOrder struct { + Direction OrderDirection `json:"direction"` + Field *DocumentDataOrderField `json:"field"` +} + +// DefaultDocumentDataOrder is the default ordering of DocumentData. +var DefaultDocumentDataOrder = &DocumentDataOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &DocumentDataOrderField{ + Value: func(dd *DocumentData) (ent.Value, error) { + return dd.ID, nil + }, + column: documentdata.FieldID, + toTerm: documentdata.ByID, + toCursor: func(dd *DocumentData) Cursor { + return Cursor{ID: dd.ID} + }, + }, +} + +// ToEdge converts DocumentData into DocumentDataEdge. +func (dd *DocumentData) ToEdge(order *DocumentDataOrder) *DocumentDataEdge { + if order == nil { + order = DefaultDocumentDataOrder + } + return &DocumentDataEdge{ + Node: dd, + Cursor: order.Field.toCursor(dd), + } +} + +// DocumentDataHistoryEdge is the edge representation of DocumentDataHistory. +type DocumentDataHistoryEdge struct { + Node *DocumentDataHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// DocumentDataHistoryConnection is the connection containing edges to DocumentDataHistory. +type DocumentDataHistoryConnection struct { + Edges []*DocumentDataHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *DocumentDataHistoryConnection) build(nodes []*DocumentDataHistory, pager *documentdatahistoryPager, 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) *DocumentDataHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *DocumentDataHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *DocumentDataHistory { + return nodes[i] + } + } + c.Edges = make([]*DocumentDataHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &DocumentDataHistoryEdge{ + 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) + } +} + +// DocumentDataHistoryPaginateOption enables pagination customization. +type DocumentDataHistoryPaginateOption func(*documentdatahistoryPager) error + +// WithDocumentDataHistoryOrder configures pagination ordering. +func WithDocumentDataHistoryOrder(order *DocumentDataHistoryOrder) DocumentDataHistoryPaginateOption { + if order == nil { + order = DefaultDocumentDataHistoryOrder + } + o := *order + return func(pager *documentdatahistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultDocumentDataHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithDocumentDataHistoryFilter configures pagination filter. +func WithDocumentDataHistoryFilter(filter func(*DocumentDataHistoryQuery) (*DocumentDataHistoryQuery, error)) DocumentDataHistoryPaginateOption { + return func(pager *documentdatahistoryPager) error { + if filter == nil { + return errors.New("DocumentDataHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type documentdatahistoryPager struct { + reverse bool + order *DocumentDataHistoryOrder + filter func(*DocumentDataHistoryQuery) (*DocumentDataHistoryQuery, error) +} + +func newDocumentDataHistoryPager(opts []DocumentDataHistoryPaginateOption, reverse bool) (*documentdatahistoryPager, error) { + pager := &documentdatahistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultDocumentDataHistoryOrder + } + return pager, nil +} + +func (p *documentdatahistoryPager) applyFilter(query *DocumentDataHistoryQuery) (*DocumentDataHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *documentdatahistoryPager) toCursor(ddh *DocumentDataHistory) Cursor { + return p.order.Field.toCursor(ddh) +} + +func (p *documentdatahistoryPager) applyCursors(query *DocumentDataHistoryQuery, after, before *Cursor) (*DocumentDataHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultDocumentDataHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *documentdatahistoryPager) applyOrder(query *DocumentDataHistoryQuery) *DocumentDataHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultDocumentDataHistoryOrder.Field { + query = query.Order(DefaultDocumentDataHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *documentdatahistoryPager) orderExpr(query *DocumentDataHistoryQuery) 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 != DefaultDocumentDataHistoryOrder.Field { + b.Comma().Ident(DefaultDocumentDataHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to DocumentDataHistory. +func (ddh *DocumentDataHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...DocumentDataHistoryPaginateOption, +) (*DocumentDataHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newDocumentDataHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if ddh, err = pager.applyFilter(ddh); err != nil { + return nil, err + } + conn := &DocumentDataHistoryConnection{Edges: []*DocumentDataHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := ddh.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 ddh, err = pager.applyCursors(ddh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + ddh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ddh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ddh = pager.applyOrder(ddh) + nodes, err := ddh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// DocumentDataHistoryOrderField defines the ordering field of DocumentDataHistory. +type DocumentDataHistoryOrderField struct { + // Value extracts the ordering value from the given DocumentDataHistory. + Value func(*DocumentDataHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) documentdatahistory.OrderOption + toCursor func(*DocumentDataHistory) Cursor +} + +// DocumentDataHistoryOrder defines the ordering of DocumentDataHistory. +type DocumentDataHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *DocumentDataHistoryOrderField `json:"field"` +} + +// DefaultDocumentDataHistoryOrder is the default ordering of DocumentDataHistory. +var DefaultDocumentDataHistoryOrder = &DocumentDataHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &DocumentDataHistoryOrderField{ + Value: func(ddh *DocumentDataHistory) (ent.Value, error) { + return ddh.ID, nil + }, + column: documentdatahistory.FieldID, + toTerm: documentdatahistory.ByID, + toCursor: func(ddh *DocumentDataHistory) Cursor { + return Cursor{ID: ddh.ID} + }, + }, +} + +// ToEdge converts DocumentDataHistory into DocumentDataHistoryEdge. +func (ddh *DocumentDataHistory) ToEdge(order *DocumentDataHistoryOrder) *DocumentDataHistoryEdge { + if order == nil { + order = DefaultDocumentDataHistoryOrder + } + return &DocumentDataHistoryEdge{ + Node: ddh, + Cursor: order.Field.toCursor(ddh), + } +} + +// EntitlementEdge is the edge representation of Entitlement. +type EntitlementEdge struct { + Node *Entitlement `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntitlementConnection is the connection containing edges to Entitlement. +type EntitlementConnection struct { + Edges []*EntitlementEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntitlementConnection) build(nodes []*Entitlement, pager *entitlementPager, 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) *Entitlement + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Entitlement { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Entitlement { + return nodes[i] + } + } + c.Edges = make([]*EntitlementEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntitlementEdge{ + 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) + } +} + +// EntitlementPaginateOption enables pagination customization. +type EntitlementPaginateOption func(*entitlementPager) error + +// WithEntitlementOrder configures pagination ordering. +func WithEntitlementOrder(order *EntitlementOrder) EntitlementPaginateOption { + if order == nil { + order = DefaultEntitlementOrder + } + o := *order + return func(pager *entitlementPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntitlementOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntitlementFilter configures pagination filter. +func WithEntitlementFilter(filter func(*EntitlementQuery) (*EntitlementQuery, error)) EntitlementPaginateOption { + return func(pager *entitlementPager) error { + if filter == nil { + return errors.New("EntitlementQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitlementPager struct { + reverse bool + order *EntitlementOrder + filter func(*EntitlementQuery) (*EntitlementQuery, error) +} + +func newEntitlementPager(opts []EntitlementPaginateOption, reverse bool) (*entitlementPager, error) { + pager := &entitlementPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntitlementOrder + } + return pager, nil +} + +func (p *entitlementPager) applyFilter(query *EntitlementQuery) (*EntitlementQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitlementPager) toCursor(e *Entitlement) Cursor { + return p.order.Field.toCursor(e) +} + +func (p *entitlementPager) applyCursors(query *EntitlementQuery, after, before *Cursor) (*EntitlementQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntitlementOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitlementPager) applyOrder(query *EntitlementQuery) *EntitlementQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntitlementOrder.Field { + query = query.Order(DefaultEntitlementOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitlementPager) orderExpr(query *EntitlementQuery) 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 != DefaultEntitlementOrder.Field { + b.Comma().Ident(DefaultEntitlementOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Entitlement. +func (e *EntitlementQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntitlementPaginateOption, +) (*EntitlementConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntitlementPager(opts, last != nil) + if err != nil { + return nil, err + } + if e, err = pager.applyFilter(e); err != nil { + return nil, err + } + conn := &EntitlementConnection{Edges: []*EntitlementEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := e.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 e, err = pager.applyCursors(e, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + e.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := e.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + e = pager.applyOrder(e) + nodes, err := e.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EntitlementOrderField defines the ordering field of Entitlement. +type EntitlementOrderField struct { + // Value extracts the ordering value from the given Entitlement. + Value func(*Entitlement) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitlement.OrderOption + toCursor func(*Entitlement) Cursor +} + +// EntitlementOrder defines the ordering of Entitlement. +type EntitlementOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntitlementOrderField `json:"field"` +} + +// DefaultEntitlementOrder is the default ordering of Entitlement. +var DefaultEntitlementOrder = &EntitlementOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntitlementOrderField{ + Value: func(e *Entitlement) (ent.Value, error) { + return e.ID, nil + }, + column: entitlement.FieldID, + toTerm: entitlement.ByID, + toCursor: func(e *Entitlement) Cursor { + return Cursor{ID: e.ID} + }, + }, +} + +// ToEdge converts Entitlement into EntitlementEdge. +func (e *Entitlement) ToEdge(order *EntitlementOrder) *EntitlementEdge { + if order == nil { + order = DefaultEntitlementOrder + } + return &EntitlementEdge{ + Node: e, + Cursor: order.Field.toCursor(e), + } +} + +// EntitlementHistoryEdge is the edge representation of EntitlementHistory. +type EntitlementHistoryEdge struct { + Node *EntitlementHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntitlementHistoryConnection is the connection containing edges to EntitlementHistory. +type EntitlementHistoryConnection struct { + Edges []*EntitlementHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntitlementHistoryConnection) build(nodes []*EntitlementHistory, pager *entitlementhistoryPager, 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) *EntitlementHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntitlementHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntitlementHistory { + return nodes[i] + } + } + c.Edges = make([]*EntitlementHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntitlementHistoryEdge{ + 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) + } +} + +// EntitlementHistoryPaginateOption enables pagination customization. +type EntitlementHistoryPaginateOption func(*entitlementhistoryPager) error + +// WithEntitlementHistoryOrder configures pagination ordering. +func WithEntitlementHistoryOrder(order *EntitlementHistoryOrder) EntitlementHistoryPaginateOption { + if order == nil { + order = DefaultEntitlementHistoryOrder + } + o := *order + return func(pager *entitlementhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntitlementHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntitlementHistoryFilter configures pagination filter. +func WithEntitlementHistoryFilter(filter func(*EntitlementHistoryQuery) (*EntitlementHistoryQuery, error)) EntitlementHistoryPaginateOption { + return func(pager *entitlementhistoryPager) error { + if filter == nil { + return errors.New("EntitlementHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitlementhistoryPager struct { + reverse bool + order *EntitlementHistoryOrder + filter func(*EntitlementHistoryQuery) (*EntitlementHistoryQuery, error) +} + +func newEntitlementHistoryPager(opts []EntitlementHistoryPaginateOption, reverse bool) (*entitlementhistoryPager, error) { + pager := &entitlementhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntitlementHistoryOrder + } + return pager, nil +} + +func (p *entitlementhistoryPager) applyFilter(query *EntitlementHistoryQuery) (*EntitlementHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitlementhistoryPager) toCursor(eh *EntitlementHistory) Cursor { + return p.order.Field.toCursor(eh) +} + +func (p *entitlementhistoryPager) applyCursors(query *EntitlementHistoryQuery, after, before *Cursor) (*EntitlementHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntitlementHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitlementhistoryPager) applyOrder(query *EntitlementHistoryQuery) *EntitlementHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntitlementHistoryOrder.Field { + query = query.Order(DefaultEntitlementHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitlementhistoryPager) orderExpr(query *EntitlementHistoryQuery) 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 != DefaultEntitlementHistoryOrder.Field { + b.Comma().Ident(DefaultEntitlementHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntitlementHistory. +func (eh *EntitlementHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntitlementHistoryPaginateOption, +) (*EntitlementHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntitlementHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if eh, err = pager.applyFilter(eh); err != nil { + return nil, err + } + conn := &EntitlementHistoryConnection{Edges: []*EntitlementHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := eh.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 eh, err = pager.applyCursors(eh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + eh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := eh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + eh = pager.applyOrder(eh) + nodes, err := eh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EntitlementHistoryOrderField defines the ordering field of EntitlementHistory. +type EntitlementHistoryOrderField struct { + // Value extracts the ordering value from the given EntitlementHistory. + Value func(*EntitlementHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitlementhistory.OrderOption + toCursor func(*EntitlementHistory) Cursor +} + +// EntitlementHistoryOrder defines the ordering of EntitlementHistory. +type EntitlementHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntitlementHistoryOrderField `json:"field"` +} + +// DefaultEntitlementHistoryOrder is the default ordering of EntitlementHistory. +var DefaultEntitlementHistoryOrder = &EntitlementHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntitlementHistoryOrderField{ + Value: func(eh *EntitlementHistory) (ent.Value, error) { + return eh.ID, nil + }, + column: entitlementhistory.FieldID, + toTerm: entitlementhistory.ByID, + toCursor: func(eh *EntitlementHistory) Cursor { + return Cursor{ID: eh.ID} + }, + }, +} + +// ToEdge converts EntitlementHistory into EntitlementHistoryEdge. +func (eh *EntitlementHistory) ToEdge(order *EntitlementHistoryOrder) *EntitlementHistoryEdge { + if order == nil { + order = DefaultEntitlementHistoryOrder + } + return &EntitlementHistoryEdge{ + Node: eh, + Cursor: order.Field.toCursor(eh), + } +} + +// EntitlementPlanEdge is the edge representation of EntitlementPlan. +type EntitlementPlanEdge struct { + Node *EntitlementPlan `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntitlementPlanConnection is the connection containing edges to EntitlementPlan. +type EntitlementPlanConnection struct { + Edges []*EntitlementPlanEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntitlementPlanConnection) build(nodes []*EntitlementPlan, pager *entitlementplanPager, 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) *EntitlementPlan + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntitlementPlan { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntitlementPlan { + return nodes[i] + } + } + c.Edges = make([]*EntitlementPlanEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntitlementPlanEdge{ + 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) + } +} + +// EntitlementPlanPaginateOption enables pagination customization. +type EntitlementPlanPaginateOption func(*entitlementplanPager) error + +// WithEntitlementPlanOrder configures pagination ordering. +func WithEntitlementPlanOrder(order *EntitlementPlanOrder) EntitlementPlanPaginateOption { + if order == nil { + order = DefaultEntitlementPlanOrder + } + o := *order + return func(pager *entitlementplanPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntitlementPlanOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntitlementPlanFilter configures pagination filter. +func WithEntitlementPlanFilter(filter func(*EntitlementPlanQuery) (*EntitlementPlanQuery, error)) EntitlementPlanPaginateOption { + return func(pager *entitlementplanPager) error { + if filter == nil { + return errors.New("EntitlementPlanQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitlementplanPager struct { + reverse bool + order *EntitlementPlanOrder + filter func(*EntitlementPlanQuery) (*EntitlementPlanQuery, error) +} + +func newEntitlementPlanPager(opts []EntitlementPlanPaginateOption, reverse bool) (*entitlementplanPager, error) { + pager := &entitlementplanPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntitlementPlanOrder + } + return pager, nil +} + +func (p *entitlementplanPager) applyFilter(query *EntitlementPlanQuery) (*EntitlementPlanQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitlementplanPager) toCursor(ep *EntitlementPlan) Cursor { + return p.order.Field.toCursor(ep) +} + +func (p *entitlementplanPager) applyCursors(query *EntitlementPlanQuery, after, before *Cursor) (*EntitlementPlanQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntitlementPlanOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitlementplanPager) applyOrder(query *EntitlementPlanQuery) *EntitlementPlanQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntitlementPlanOrder.Field { + query = query.Order(DefaultEntitlementPlanOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitlementplanPager) orderExpr(query *EntitlementPlanQuery) 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 != DefaultEntitlementPlanOrder.Field { + b.Comma().Ident(DefaultEntitlementPlanOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntitlementPlan. +func (ep *EntitlementPlanQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntitlementPlanPaginateOption, +) (*EntitlementPlanConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntitlementPlanPager(opts, last != nil) + if err != nil { + return nil, err + } + if ep, err = pager.applyFilter(ep); err != nil { + return nil, err + } + conn := &EntitlementPlanConnection{Edges: []*EntitlementPlanEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := ep.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 ep, err = pager.applyCursors(ep, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + ep.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ep.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ep = pager.applyOrder(ep) + nodes, err := ep.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EntitlementPlanOrderField defines the ordering field of EntitlementPlan. +type EntitlementPlanOrderField struct { + // Value extracts the ordering value from the given EntitlementPlan. + Value func(*EntitlementPlan) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitlementplan.OrderOption + toCursor func(*EntitlementPlan) Cursor +} + +// EntitlementPlanOrder defines the ordering of EntitlementPlan. +type EntitlementPlanOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntitlementPlanOrderField `json:"field"` +} + +// DefaultEntitlementPlanOrder is the default ordering of EntitlementPlan. +var DefaultEntitlementPlanOrder = &EntitlementPlanOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntitlementPlanOrderField{ + Value: func(ep *EntitlementPlan) (ent.Value, error) { + return ep.ID, nil + }, + column: entitlementplan.FieldID, + toTerm: entitlementplan.ByID, + toCursor: func(ep *EntitlementPlan) Cursor { + return Cursor{ID: ep.ID} + }, + }, +} + +// ToEdge converts EntitlementPlan into EntitlementPlanEdge. +func (ep *EntitlementPlan) ToEdge(order *EntitlementPlanOrder) *EntitlementPlanEdge { + if order == nil { + order = DefaultEntitlementPlanOrder + } + return &EntitlementPlanEdge{ + Node: ep, + Cursor: order.Field.toCursor(ep), + } +} + +// EntitlementPlanFeatureEdge is the edge representation of EntitlementPlanFeature. +type EntitlementPlanFeatureEdge struct { + Node *EntitlementPlanFeature `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntitlementPlanFeatureConnection is the connection containing edges to EntitlementPlanFeature. +type EntitlementPlanFeatureConnection struct { + Edges []*EntitlementPlanFeatureEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntitlementPlanFeatureConnection) build(nodes []*EntitlementPlanFeature, pager *entitlementplanfeaturePager, 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) *EntitlementPlanFeature + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntitlementPlanFeature { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntitlementPlanFeature { + return nodes[i] + } + } + c.Edges = make([]*EntitlementPlanFeatureEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntitlementPlanFeatureEdge{ + 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) + } +} + +// EntitlementPlanFeaturePaginateOption enables pagination customization. +type EntitlementPlanFeaturePaginateOption func(*entitlementplanfeaturePager) error + +// WithEntitlementPlanFeatureOrder configures pagination ordering. +func WithEntitlementPlanFeatureOrder(order *EntitlementPlanFeatureOrder) EntitlementPlanFeaturePaginateOption { + if order == nil { + order = DefaultEntitlementPlanFeatureOrder + } + o := *order + return func(pager *entitlementplanfeaturePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntitlementPlanFeatureOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntitlementPlanFeatureFilter configures pagination filter. +func WithEntitlementPlanFeatureFilter(filter func(*EntitlementPlanFeatureQuery) (*EntitlementPlanFeatureQuery, error)) EntitlementPlanFeaturePaginateOption { + return func(pager *entitlementplanfeaturePager) error { + if filter == nil { + return errors.New("EntitlementPlanFeatureQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitlementplanfeaturePager struct { + reverse bool + order *EntitlementPlanFeatureOrder + filter func(*EntitlementPlanFeatureQuery) (*EntitlementPlanFeatureQuery, error) +} + +func newEntitlementPlanFeaturePager(opts []EntitlementPlanFeaturePaginateOption, reverse bool) (*entitlementplanfeaturePager, error) { + pager := &entitlementplanfeaturePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntitlementPlanFeatureOrder + } + return pager, nil +} + +func (p *entitlementplanfeaturePager) applyFilter(query *EntitlementPlanFeatureQuery) (*EntitlementPlanFeatureQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitlementplanfeaturePager) toCursor(epf *EntitlementPlanFeature) Cursor { + return p.order.Field.toCursor(epf) +} + +func (p *entitlementplanfeaturePager) applyCursors(query *EntitlementPlanFeatureQuery, after, before *Cursor) (*EntitlementPlanFeatureQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntitlementPlanFeatureOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitlementplanfeaturePager) applyOrder(query *EntitlementPlanFeatureQuery) *EntitlementPlanFeatureQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntitlementPlanFeatureOrder.Field { + query = query.Order(DefaultEntitlementPlanFeatureOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitlementplanfeaturePager) orderExpr(query *EntitlementPlanFeatureQuery) 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 != DefaultEntitlementPlanFeatureOrder.Field { + b.Comma().Ident(DefaultEntitlementPlanFeatureOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntitlementPlanFeature. +func (epf *EntitlementPlanFeatureQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntitlementPlanFeaturePaginateOption, +) (*EntitlementPlanFeatureConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntitlementPlanFeaturePager(opts, last != nil) + if err != nil { + return nil, err + } + if epf, err = pager.applyFilter(epf); err != nil { + return nil, err + } + conn := &EntitlementPlanFeatureConnection{Edges: []*EntitlementPlanFeatureEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := epf.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 epf, err = pager.applyCursors(epf, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + epf.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := epf.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + epf = pager.applyOrder(epf) + nodes, err := epf.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EntitlementPlanFeatureOrderField defines the ordering field of EntitlementPlanFeature. +type EntitlementPlanFeatureOrderField struct { + // Value extracts the ordering value from the given EntitlementPlanFeature. + Value func(*EntitlementPlanFeature) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitlementplanfeature.OrderOption + toCursor func(*EntitlementPlanFeature) Cursor +} + +// EntitlementPlanFeatureOrder defines the ordering of EntitlementPlanFeature. +type EntitlementPlanFeatureOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntitlementPlanFeatureOrderField `json:"field"` +} + +// DefaultEntitlementPlanFeatureOrder is the default ordering of EntitlementPlanFeature. +var DefaultEntitlementPlanFeatureOrder = &EntitlementPlanFeatureOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntitlementPlanFeatureOrderField{ + Value: func(epf *EntitlementPlanFeature) (ent.Value, error) { + return epf.ID, nil + }, + column: entitlementplanfeature.FieldID, + toTerm: entitlementplanfeature.ByID, + toCursor: func(epf *EntitlementPlanFeature) Cursor { + return Cursor{ID: epf.ID} + }, + }, +} + +// ToEdge converts EntitlementPlanFeature into EntitlementPlanFeatureEdge. +func (epf *EntitlementPlanFeature) ToEdge(order *EntitlementPlanFeatureOrder) *EntitlementPlanFeatureEdge { + if order == nil { + order = DefaultEntitlementPlanFeatureOrder + } + return &EntitlementPlanFeatureEdge{ + Node: epf, + Cursor: order.Field.toCursor(epf), + } +} + +// EntitlementPlanFeatureHistoryEdge is the edge representation of EntitlementPlanFeatureHistory. +type EntitlementPlanFeatureHistoryEdge struct { + Node *EntitlementPlanFeatureHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntitlementPlanFeatureHistoryConnection is the connection containing edges to EntitlementPlanFeatureHistory. +type EntitlementPlanFeatureHistoryConnection struct { + Edges []*EntitlementPlanFeatureHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntitlementPlanFeatureHistoryConnection) build(nodes []*EntitlementPlanFeatureHistory, pager *entitlementplanfeaturehistoryPager, 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) *EntitlementPlanFeatureHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntitlementPlanFeatureHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntitlementPlanFeatureHistory { + return nodes[i] + } + } + c.Edges = make([]*EntitlementPlanFeatureHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntitlementPlanFeatureHistoryEdge{ + 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) + } +} + +// EntitlementPlanFeatureHistoryPaginateOption enables pagination customization. +type EntitlementPlanFeatureHistoryPaginateOption func(*entitlementplanfeaturehistoryPager) error + +// WithEntitlementPlanFeatureHistoryOrder configures pagination ordering. +func WithEntitlementPlanFeatureHistoryOrder(order *EntitlementPlanFeatureHistoryOrder) EntitlementPlanFeatureHistoryPaginateOption { + if order == nil { + order = DefaultEntitlementPlanFeatureHistoryOrder + } + o := *order + return func(pager *entitlementplanfeaturehistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntitlementPlanFeatureHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntitlementPlanFeatureHistoryFilter configures pagination filter. +func WithEntitlementPlanFeatureHistoryFilter(filter func(*EntitlementPlanFeatureHistoryQuery) (*EntitlementPlanFeatureHistoryQuery, error)) EntitlementPlanFeatureHistoryPaginateOption { + return func(pager *entitlementplanfeaturehistoryPager) error { + if filter == nil { + return errors.New("EntitlementPlanFeatureHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitlementplanfeaturehistoryPager struct { + reverse bool + order *EntitlementPlanFeatureHistoryOrder + filter func(*EntitlementPlanFeatureHistoryQuery) (*EntitlementPlanFeatureHistoryQuery, error) +} + +func newEntitlementPlanFeatureHistoryPager(opts []EntitlementPlanFeatureHistoryPaginateOption, reverse bool) (*entitlementplanfeaturehistoryPager, error) { + pager := &entitlementplanfeaturehistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntitlementPlanFeatureHistoryOrder + } + return pager, nil +} + +func (p *entitlementplanfeaturehistoryPager) applyFilter(query *EntitlementPlanFeatureHistoryQuery) (*EntitlementPlanFeatureHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitlementplanfeaturehistoryPager) toCursor(epfh *EntitlementPlanFeatureHistory) Cursor { + return p.order.Field.toCursor(epfh) +} + +func (p *entitlementplanfeaturehistoryPager) applyCursors(query *EntitlementPlanFeatureHistoryQuery, after, before *Cursor) (*EntitlementPlanFeatureHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntitlementPlanFeatureHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitlementplanfeaturehistoryPager) applyOrder(query *EntitlementPlanFeatureHistoryQuery) *EntitlementPlanFeatureHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntitlementPlanFeatureHistoryOrder.Field { + query = query.Order(DefaultEntitlementPlanFeatureHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitlementplanfeaturehistoryPager) orderExpr(query *EntitlementPlanFeatureHistoryQuery) 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 != DefaultEntitlementPlanFeatureHistoryOrder.Field { + b.Comma().Ident(DefaultEntitlementPlanFeatureHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntitlementPlanFeatureHistory. +func (epfh *EntitlementPlanFeatureHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntitlementPlanFeatureHistoryPaginateOption, +) (*EntitlementPlanFeatureHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntitlementPlanFeatureHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if epfh, err = pager.applyFilter(epfh); err != nil { + return nil, err + } + conn := &EntitlementPlanFeatureHistoryConnection{Edges: []*EntitlementPlanFeatureHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := epfh.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 epfh, err = pager.applyCursors(epfh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + epfh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := epfh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + epfh = pager.applyOrder(epfh) + nodes, err := epfh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EntitlementPlanFeatureHistoryOrderField defines the ordering field of EntitlementPlanFeatureHistory. +type EntitlementPlanFeatureHistoryOrderField struct { + // Value extracts the ordering value from the given EntitlementPlanFeatureHistory. + Value func(*EntitlementPlanFeatureHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitlementplanfeaturehistory.OrderOption + toCursor func(*EntitlementPlanFeatureHistory) Cursor +} + +// EntitlementPlanFeatureHistoryOrder defines the ordering of EntitlementPlanFeatureHistory. +type EntitlementPlanFeatureHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntitlementPlanFeatureHistoryOrderField `json:"field"` +} + +// DefaultEntitlementPlanFeatureHistoryOrder is the default ordering of EntitlementPlanFeatureHistory. +var DefaultEntitlementPlanFeatureHistoryOrder = &EntitlementPlanFeatureHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntitlementPlanFeatureHistoryOrderField{ + Value: func(epfh *EntitlementPlanFeatureHistory) (ent.Value, error) { + return epfh.ID, nil + }, + column: entitlementplanfeaturehistory.FieldID, + toTerm: entitlementplanfeaturehistory.ByID, + toCursor: func(epfh *EntitlementPlanFeatureHistory) Cursor { + return Cursor{ID: epfh.ID} + }, + }, +} + +// ToEdge converts EntitlementPlanFeatureHistory into EntitlementPlanFeatureHistoryEdge. +func (epfh *EntitlementPlanFeatureHistory) ToEdge(order *EntitlementPlanFeatureHistoryOrder) *EntitlementPlanFeatureHistoryEdge { + if order == nil { + order = DefaultEntitlementPlanFeatureHistoryOrder + } + return &EntitlementPlanFeatureHistoryEdge{ + Node: epfh, + Cursor: order.Field.toCursor(epfh), + } +} + +// EntitlementPlanHistoryEdge is the edge representation of EntitlementPlanHistory. +type EntitlementPlanHistoryEdge struct { + Node *EntitlementPlanHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntitlementPlanHistoryConnection is the connection containing edges to EntitlementPlanHistory. +type EntitlementPlanHistoryConnection struct { + Edges []*EntitlementPlanHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntitlementPlanHistoryConnection) build(nodes []*EntitlementPlanHistory, pager *entitlementplanhistoryPager, 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) *EntitlementPlanHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntitlementPlanHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntitlementPlanHistory { + return nodes[i] + } + } + c.Edges = make([]*EntitlementPlanHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntitlementPlanHistoryEdge{ + 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) + } +} + +// EntitlementPlanHistoryPaginateOption enables pagination customization. +type EntitlementPlanHistoryPaginateOption func(*entitlementplanhistoryPager) error + +// WithEntitlementPlanHistoryOrder configures pagination ordering. +func WithEntitlementPlanHistoryOrder(order *EntitlementPlanHistoryOrder) EntitlementPlanHistoryPaginateOption { + if order == nil { + order = DefaultEntitlementPlanHistoryOrder + } + o := *order + return func(pager *entitlementplanhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntitlementPlanHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntitlementPlanHistoryFilter configures pagination filter. +func WithEntitlementPlanHistoryFilter(filter func(*EntitlementPlanHistoryQuery) (*EntitlementPlanHistoryQuery, error)) EntitlementPlanHistoryPaginateOption { + return func(pager *entitlementplanhistoryPager) error { + if filter == nil { + return errors.New("EntitlementPlanHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitlementplanhistoryPager struct { + reverse bool + order *EntitlementPlanHistoryOrder + filter func(*EntitlementPlanHistoryQuery) (*EntitlementPlanHistoryQuery, error) +} + +func newEntitlementPlanHistoryPager(opts []EntitlementPlanHistoryPaginateOption, reverse bool) (*entitlementplanhistoryPager, error) { + pager := &entitlementplanhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntitlementPlanHistoryOrder + } + return pager, nil +} + +func (p *entitlementplanhistoryPager) applyFilter(query *EntitlementPlanHistoryQuery) (*EntitlementPlanHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitlementplanhistoryPager) toCursor(eph *EntitlementPlanHistory) Cursor { + return p.order.Field.toCursor(eph) +} + +func (p *entitlementplanhistoryPager) applyCursors(query *EntitlementPlanHistoryQuery, after, before *Cursor) (*EntitlementPlanHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntitlementPlanHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitlementplanhistoryPager) applyOrder(query *EntitlementPlanHistoryQuery) *EntitlementPlanHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntitlementPlanHistoryOrder.Field { + query = query.Order(DefaultEntitlementPlanHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitlementplanhistoryPager) orderExpr(query *EntitlementPlanHistoryQuery) 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 != DefaultEntitlementPlanHistoryOrder.Field { + b.Comma().Ident(DefaultEntitlementPlanHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntitlementPlanHistory. +func (eph *EntitlementPlanHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntitlementPlanHistoryPaginateOption, +) (*EntitlementPlanHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntitlementPlanHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if eph, err = pager.applyFilter(eph); err != nil { + return nil, err + } + conn := &EntitlementPlanHistoryConnection{Edges: []*EntitlementPlanHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := eph.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 eph, err = pager.applyCursors(eph, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + eph.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := eph.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + eph = pager.applyOrder(eph) + nodes, err := eph.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EntitlementPlanHistoryOrderField defines the ordering field of EntitlementPlanHistory. +type EntitlementPlanHistoryOrderField struct { + // Value extracts the ordering value from the given EntitlementPlanHistory. + Value func(*EntitlementPlanHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitlementplanhistory.OrderOption + toCursor func(*EntitlementPlanHistory) Cursor +} + +// EntitlementPlanHistoryOrder defines the ordering of EntitlementPlanHistory. +type EntitlementPlanHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntitlementPlanHistoryOrderField `json:"field"` +} + +// DefaultEntitlementPlanHistoryOrder is the default ordering of EntitlementPlanHistory. +var DefaultEntitlementPlanHistoryOrder = &EntitlementPlanHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntitlementPlanHistoryOrderField{ + Value: func(eph *EntitlementPlanHistory) (ent.Value, error) { + return eph.ID, nil + }, + column: entitlementplanhistory.FieldID, + toTerm: entitlementplanhistory.ByID, + toCursor: func(eph *EntitlementPlanHistory) Cursor { + return Cursor{ID: eph.ID} + }, + }, +} + +// ToEdge converts EntitlementPlanHistory into EntitlementPlanHistoryEdge. +func (eph *EntitlementPlanHistory) ToEdge(order *EntitlementPlanHistoryOrder) *EntitlementPlanHistoryEdge { + if order == nil { + order = DefaultEntitlementPlanHistoryOrder + } + return &EntitlementPlanHistoryEdge{ + Node: eph, + Cursor: order.Field.toCursor(eph), + } +} + +// EntityEdge is the edge representation of Entity. +type EntityEdge struct { + Node *Entity `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntityConnection is the connection containing edges to Entity. +type EntityConnection struct { + Edges []*EntityEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntityConnection) build(nodes []*Entity, pager *entityPager, 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) *Entity + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Entity { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Entity { + return nodes[i] + } + } + c.Edges = make([]*EntityEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntityEdge{ + 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) + } +} + +// EntityPaginateOption enables pagination customization. +type EntityPaginateOption func(*entityPager) error + +// WithEntityOrder configures pagination ordering. +func WithEntityOrder(order *EntityOrder) EntityPaginateOption { + if order == nil { + order = DefaultEntityOrder + } + o := *order + return func(pager *entityPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntityOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntityFilter configures pagination filter. +func WithEntityFilter(filter func(*EntityQuery) (*EntityQuery, error)) EntityPaginateOption { + return func(pager *entityPager) error { + if filter == nil { + return errors.New("EntityQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entityPager struct { + reverse bool + order *EntityOrder + filter func(*EntityQuery) (*EntityQuery, error) +} + +func newEntityPager(opts []EntityPaginateOption, reverse bool) (*entityPager, error) { + pager := &entityPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntityOrder + } + return pager, nil +} + +func (p *entityPager) applyFilter(query *EntityQuery) (*EntityQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entityPager) toCursor(e *Entity) Cursor { + return p.order.Field.toCursor(e) +} + +func (p *entityPager) applyCursors(query *EntityQuery, after, before *Cursor) (*EntityQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntityOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entityPager) applyOrder(query *EntityQuery) *EntityQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntityOrder.Field { + query = query.Order(DefaultEntityOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entityPager) orderExpr(query *EntityQuery) 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 != DefaultEntityOrder.Field { + b.Comma().Ident(DefaultEntityOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Entity. +func (e *EntityQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntityPaginateOption, +) (*EntityConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntityPager(opts, last != nil) + if err != nil { + return nil, err + } + if e, err = pager.applyFilter(e); err != nil { + return nil, err + } + conn := &EntityConnection{Edges: []*EntityEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := e.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 e, err = pager.applyCursors(e, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + e.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := e.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + e = pager.applyOrder(e) + nodes, err := e.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // EntityOrderFieldName orders Entity by name. + EntityOrderFieldName = &EntityOrderField{ + Value: func(e *Entity) (ent.Value, error) { + return e.Name, nil + }, + column: entity.FieldName, + toTerm: entity.ByName, + toCursor: func(e *Entity) Cursor { + return Cursor{ + ID: e.ID, + Value: e.Name, + } + }, + } + // EntityOrderFieldDisplayName orders Entity by display_name. + EntityOrderFieldDisplayName = &EntityOrderField{ + Value: func(e *Entity) (ent.Value, error) { + return e.DisplayName, nil + }, + column: entity.FieldDisplayName, + toTerm: entity.ByDisplayName, + toCursor: func(e *Entity) Cursor { + return Cursor{ + ID: e.ID, + Value: e.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f EntityOrderField) String() string { + var str string + switch f.column { + case EntityOrderFieldName.column: + str = "name" + case EntityOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f EntityOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *EntityOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("EntityOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *EntityOrderFieldName + case "display_name": + *f = *EntityOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid EntityOrderField", str) + } + return nil +} + +// EntityOrderField defines the ordering field of Entity. +type EntityOrderField struct { + // Value extracts the ordering value from the given Entity. + Value func(*Entity) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entity.OrderOption + toCursor func(*Entity) Cursor +} + +// EntityOrder defines the ordering of Entity. +type EntityOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntityOrderField `json:"field"` +} + +// DefaultEntityOrder is the default ordering of Entity. +var DefaultEntityOrder = &EntityOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntityOrderField{ + Value: func(e *Entity) (ent.Value, error) { + return e.ID, nil + }, + column: entity.FieldID, + toTerm: entity.ByID, + toCursor: func(e *Entity) Cursor { + return Cursor{ID: e.ID} + }, + }, +} + +// ToEdge converts Entity into EntityEdge. +func (e *Entity) ToEdge(order *EntityOrder) *EntityEdge { + if order == nil { + order = DefaultEntityOrder + } + return &EntityEdge{ + Node: e, + Cursor: order.Field.toCursor(e), + } +} + +// EntityHistoryEdge is the edge representation of EntityHistory. +type EntityHistoryEdge struct { + Node *EntityHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntityHistoryConnection is the connection containing edges to EntityHistory. +type EntityHistoryConnection struct { + Edges []*EntityHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntityHistoryConnection) build(nodes []*EntityHistory, pager *entityhistoryPager, 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) *EntityHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntityHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntityHistory { + return nodes[i] + } + } + c.Edges = make([]*EntityHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntityHistoryEdge{ + 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) + } +} + +// EntityHistoryPaginateOption enables pagination customization. +type EntityHistoryPaginateOption func(*entityhistoryPager) error + +// WithEntityHistoryOrder configures pagination ordering. +func WithEntityHistoryOrder(order *EntityHistoryOrder) EntityHistoryPaginateOption { + if order == nil { + order = DefaultEntityHistoryOrder + } + o := *order + return func(pager *entityhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntityHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntityHistoryFilter configures pagination filter. +func WithEntityHistoryFilter(filter func(*EntityHistoryQuery) (*EntityHistoryQuery, error)) EntityHistoryPaginateOption { + return func(pager *entityhistoryPager) error { + if filter == nil { + return errors.New("EntityHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entityhistoryPager struct { + reverse bool + order *EntityHistoryOrder + filter func(*EntityHistoryQuery) (*EntityHistoryQuery, error) +} + +func newEntityHistoryPager(opts []EntityHistoryPaginateOption, reverse bool) (*entityhistoryPager, error) { + pager := &entityhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntityHistoryOrder + } + return pager, nil +} + +func (p *entityhistoryPager) applyFilter(query *EntityHistoryQuery) (*EntityHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entityhistoryPager) toCursor(eh *EntityHistory) Cursor { + return p.order.Field.toCursor(eh) +} + +func (p *entityhistoryPager) applyCursors(query *EntityHistoryQuery, after, before *Cursor) (*EntityHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntityHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entityhistoryPager) applyOrder(query *EntityHistoryQuery) *EntityHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntityHistoryOrder.Field { + query = query.Order(DefaultEntityHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entityhistoryPager) orderExpr(query *EntityHistoryQuery) 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 != DefaultEntityHistoryOrder.Field { + b.Comma().Ident(DefaultEntityHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntityHistory. +func (eh *EntityHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntityHistoryPaginateOption, +) (*EntityHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntityHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if eh, err = pager.applyFilter(eh); err != nil { + return nil, err + } + conn := &EntityHistoryConnection{Edges: []*EntityHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := eh.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 eh, err = pager.applyCursors(eh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + eh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := eh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + eh = pager.applyOrder(eh) + nodes, err := eh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // EntityHistoryOrderFieldName orders EntityHistory by name. + EntityHistoryOrderFieldName = &EntityHistoryOrderField{ + Value: func(eh *EntityHistory) (ent.Value, error) { + return eh.Name, nil + }, + column: entityhistory.FieldName, + toTerm: entityhistory.ByName, + toCursor: func(eh *EntityHistory) Cursor { + return Cursor{ + ID: eh.ID, + Value: eh.Name, + } + }, + } + // EntityHistoryOrderFieldDisplayName orders EntityHistory by display_name. + EntityHistoryOrderFieldDisplayName = &EntityHistoryOrderField{ + Value: func(eh *EntityHistory) (ent.Value, error) { + return eh.DisplayName, nil + }, + column: entityhistory.FieldDisplayName, + toTerm: entityhistory.ByDisplayName, + toCursor: func(eh *EntityHistory) Cursor { + return Cursor{ + ID: eh.ID, + Value: eh.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f EntityHistoryOrderField) String() string { + var str string + switch f.column { + case EntityHistoryOrderFieldName.column: + str = "name" + case EntityHistoryOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f EntityHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *EntityHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("EntityHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *EntityHistoryOrderFieldName + case "display_name": + *f = *EntityHistoryOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid EntityHistoryOrderField", str) + } + return nil +} + +// EntityHistoryOrderField defines the ordering field of EntityHistory. +type EntityHistoryOrderField struct { + // Value extracts the ordering value from the given EntityHistory. + Value func(*EntityHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entityhistory.OrderOption + toCursor func(*EntityHistory) Cursor +} + +// EntityHistoryOrder defines the ordering of EntityHistory. +type EntityHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntityHistoryOrderField `json:"field"` +} + +// DefaultEntityHistoryOrder is the default ordering of EntityHistory. +var DefaultEntityHistoryOrder = &EntityHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntityHistoryOrderField{ + Value: func(eh *EntityHistory) (ent.Value, error) { + return eh.ID, nil + }, + column: entityhistory.FieldID, + toTerm: entityhistory.ByID, + toCursor: func(eh *EntityHistory) Cursor { + return Cursor{ID: eh.ID} + }, + }, +} + +// ToEdge converts EntityHistory into EntityHistoryEdge. +func (eh *EntityHistory) ToEdge(order *EntityHistoryOrder) *EntityHistoryEdge { + if order == nil { + order = DefaultEntityHistoryOrder + } + return &EntityHistoryEdge{ + Node: eh, + Cursor: order.Field.toCursor(eh), + } +} + +// EntityTypeEdge is the edge representation of EntityType. +type EntityTypeEdge struct { + Node *EntityType `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntityTypeConnection is the connection containing edges to EntityType. +type EntityTypeConnection struct { + Edges []*EntityTypeEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntityTypeConnection) build(nodes []*EntityType, pager *entitytypePager, 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) *EntityType + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntityType { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntityType { + return nodes[i] + } + } + c.Edges = make([]*EntityTypeEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntityTypeEdge{ + 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) + } +} + +// EntityTypePaginateOption enables pagination customization. +type EntityTypePaginateOption func(*entitytypePager) error + +// WithEntityTypeOrder configures pagination ordering. +func WithEntityTypeOrder(order *EntityTypeOrder) EntityTypePaginateOption { + if order == nil { + order = DefaultEntityTypeOrder + } + o := *order + return func(pager *entitytypePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntityTypeOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntityTypeFilter configures pagination filter. +func WithEntityTypeFilter(filter func(*EntityTypeQuery) (*EntityTypeQuery, error)) EntityTypePaginateOption { + return func(pager *entitytypePager) error { + if filter == nil { + return errors.New("EntityTypeQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitytypePager struct { + reverse bool + order *EntityTypeOrder + filter func(*EntityTypeQuery) (*EntityTypeQuery, error) +} + +func newEntityTypePager(opts []EntityTypePaginateOption, reverse bool) (*entitytypePager, error) { + pager := &entitytypePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntityTypeOrder + } + return pager, nil +} + +func (p *entitytypePager) applyFilter(query *EntityTypeQuery) (*EntityTypeQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitytypePager) toCursor(et *EntityType) Cursor { + return p.order.Field.toCursor(et) +} + +func (p *entitytypePager) applyCursors(query *EntityTypeQuery, after, before *Cursor) (*EntityTypeQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntityTypeOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitytypePager) applyOrder(query *EntityTypeQuery) *EntityTypeQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntityTypeOrder.Field { + query = query.Order(DefaultEntityTypeOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitytypePager) orderExpr(query *EntityTypeQuery) 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 != DefaultEntityTypeOrder.Field { + b.Comma().Ident(DefaultEntityTypeOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntityType. +func (et *EntityTypeQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntityTypePaginateOption, +) (*EntityTypeConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntityTypePager(opts, last != nil) + if err != nil { + return nil, err + } + if et, err = pager.applyFilter(et); err != nil { + return nil, err + } + conn := &EntityTypeConnection{Edges: []*EntityTypeEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := et.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 et, err = pager.applyCursors(et, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + et.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := et.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + et = pager.applyOrder(et) + nodes, err := et.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // EntityTypeOrderFieldName orders EntityType by name. + EntityTypeOrderFieldName = &EntityTypeOrderField{ + Value: func(et *EntityType) (ent.Value, error) { + return et.Name, nil + }, + column: entitytype.FieldName, + toTerm: entitytype.ByName, + toCursor: func(et *EntityType) Cursor { + return Cursor{ + ID: et.ID, + Value: et.Name, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f EntityTypeOrderField) String() string { + var str string + switch f.column { + case EntityTypeOrderFieldName.column: + str = "name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f EntityTypeOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *EntityTypeOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("EntityTypeOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *EntityTypeOrderFieldName + default: + return fmt.Errorf("%s is not a valid EntityTypeOrderField", str) + } + return nil +} + +// EntityTypeOrderField defines the ordering field of EntityType. +type EntityTypeOrderField struct { + // Value extracts the ordering value from the given EntityType. + Value func(*EntityType) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitytype.OrderOption + toCursor func(*EntityType) Cursor +} + +// EntityTypeOrder defines the ordering of EntityType. +type EntityTypeOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntityTypeOrderField `json:"field"` +} + +// DefaultEntityTypeOrder is the default ordering of EntityType. +var DefaultEntityTypeOrder = &EntityTypeOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntityTypeOrderField{ + Value: func(et *EntityType) (ent.Value, error) { + return et.ID, nil + }, + column: entitytype.FieldID, + toTerm: entitytype.ByID, + toCursor: func(et *EntityType) Cursor { + return Cursor{ID: et.ID} + }, + }, +} + +// ToEdge converts EntityType into EntityTypeEdge. +func (et *EntityType) ToEdge(order *EntityTypeOrder) *EntityTypeEdge { + if order == nil { + order = DefaultEntityTypeOrder + } + return &EntityTypeEdge{ + Node: et, + Cursor: order.Field.toCursor(et), + } +} + +// EntityTypeHistoryEdge is the edge representation of EntityTypeHistory. +type EntityTypeHistoryEdge struct { + Node *EntityTypeHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EntityTypeHistoryConnection is the connection containing edges to EntityTypeHistory. +type EntityTypeHistoryConnection struct { + Edges []*EntityTypeHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EntityTypeHistoryConnection) build(nodes []*EntityTypeHistory, pager *entitytypehistoryPager, 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) *EntityTypeHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EntityTypeHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EntityTypeHistory { + return nodes[i] + } + } + c.Edges = make([]*EntityTypeHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EntityTypeHistoryEdge{ + 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) + } +} + +// EntityTypeHistoryPaginateOption enables pagination customization. +type EntityTypeHistoryPaginateOption func(*entitytypehistoryPager) error + +// WithEntityTypeHistoryOrder configures pagination ordering. +func WithEntityTypeHistoryOrder(order *EntityTypeHistoryOrder) EntityTypeHistoryPaginateOption { + if order == nil { + order = DefaultEntityTypeHistoryOrder + } + o := *order + return func(pager *entitytypehistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEntityTypeHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEntityTypeHistoryFilter configures pagination filter. +func WithEntityTypeHistoryFilter(filter func(*EntityTypeHistoryQuery) (*EntityTypeHistoryQuery, error)) EntityTypeHistoryPaginateOption { + return func(pager *entitytypehistoryPager) error { + if filter == nil { + return errors.New("EntityTypeHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type entitytypehistoryPager struct { + reverse bool + order *EntityTypeHistoryOrder + filter func(*EntityTypeHistoryQuery) (*EntityTypeHistoryQuery, error) +} + +func newEntityTypeHistoryPager(opts []EntityTypeHistoryPaginateOption, reverse bool) (*entitytypehistoryPager, error) { + pager := &entitytypehistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEntityTypeHistoryOrder + } + return pager, nil +} + +func (p *entitytypehistoryPager) applyFilter(query *EntityTypeHistoryQuery) (*EntityTypeHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *entitytypehistoryPager) toCursor(eth *EntityTypeHistory) Cursor { + return p.order.Field.toCursor(eth) +} + +func (p *entitytypehistoryPager) applyCursors(query *EntityTypeHistoryQuery, after, before *Cursor) (*EntityTypeHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEntityTypeHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *entitytypehistoryPager) applyOrder(query *EntityTypeHistoryQuery) *EntityTypeHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEntityTypeHistoryOrder.Field { + query = query.Order(DefaultEntityTypeHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *entitytypehistoryPager) orderExpr(query *EntityTypeHistoryQuery) 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 != DefaultEntityTypeHistoryOrder.Field { + b.Comma().Ident(DefaultEntityTypeHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EntityTypeHistory. +func (eth *EntityTypeHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EntityTypeHistoryPaginateOption, +) (*EntityTypeHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEntityTypeHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if eth, err = pager.applyFilter(eth); err != nil { + return nil, err + } + conn := &EntityTypeHistoryConnection{Edges: []*EntityTypeHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := eth.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 eth, err = pager.applyCursors(eth, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + eth.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := eth.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + eth = pager.applyOrder(eth) + nodes, err := eth.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // EntityTypeHistoryOrderFieldName orders EntityTypeHistory by name. + EntityTypeHistoryOrderFieldName = &EntityTypeHistoryOrderField{ + Value: func(eth *EntityTypeHistory) (ent.Value, error) { + return eth.Name, nil + }, + column: entitytypehistory.FieldName, + toTerm: entitytypehistory.ByName, + toCursor: func(eth *EntityTypeHistory) Cursor { + return Cursor{ + ID: eth.ID, + Value: eth.Name, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f EntityTypeHistoryOrderField) String() string { + var str string + switch f.column { + case EntityTypeHistoryOrderFieldName.column: + str = "name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f EntityTypeHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *EntityTypeHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("EntityTypeHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *EntityTypeHistoryOrderFieldName + default: + return fmt.Errorf("%s is not a valid EntityTypeHistoryOrderField", str) + } + return nil +} + +// EntityTypeHistoryOrderField defines the ordering field of EntityTypeHistory. +type EntityTypeHistoryOrderField struct { + // Value extracts the ordering value from the given EntityTypeHistory. + Value func(*EntityTypeHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) entitytypehistory.OrderOption + toCursor func(*EntityTypeHistory) Cursor +} + +// EntityTypeHistoryOrder defines the ordering of EntityTypeHistory. +type EntityTypeHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *EntityTypeHistoryOrderField `json:"field"` +} + +// DefaultEntityTypeHistoryOrder is the default ordering of EntityTypeHistory. +var DefaultEntityTypeHistoryOrder = &EntityTypeHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EntityTypeHistoryOrderField{ + Value: func(eth *EntityTypeHistory) (ent.Value, error) { + return eth.ID, nil + }, + column: entitytypehistory.FieldID, + toTerm: entitytypehistory.ByID, + toCursor: func(eth *EntityTypeHistory) Cursor { + return Cursor{ID: eth.ID} + }, + }, +} + +// ToEdge converts EntityTypeHistory into EntityTypeHistoryEdge. +func (eth *EntityTypeHistory) ToEdge(order *EntityTypeHistoryOrder) *EntityTypeHistoryEdge { + if order == nil { + order = DefaultEntityTypeHistoryOrder + } + return &EntityTypeHistoryEdge{ + Node: eth, + Cursor: order.Field.toCursor(eth), + } +} + +// EventEdge is the edge representation of Event. +type EventEdge struct { + Node *Event `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EventConnection is the connection containing edges to Event. +type EventConnection struct { + Edges []*EventEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EventConnection) build(nodes []*Event, pager *eventPager, 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) *Event + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Event { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Event { + return nodes[i] + } + } + c.Edges = make([]*EventEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EventEdge{ + 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) + } +} + +// EventPaginateOption enables pagination customization. +type EventPaginateOption func(*eventPager) error + +// WithEventOrder configures pagination ordering. +func WithEventOrder(order *EventOrder) EventPaginateOption { + if order == nil { + order = DefaultEventOrder + } + o := *order + return func(pager *eventPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEventOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEventFilter configures pagination filter. +func WithEventFilter(filter func(*EventQuery) (*EventQuery, error)) EventPaginateOption { + return func(pager *eventPager) error { + if filter == nil { + return errors.New("EventQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type eventPager struct { + reverse bool + order *EventOrder + filter func(*EventQuery) (*EventQuery, error) +} + +func newEventPager(opts []EventPaginateOption, reverse bool) (*eventPager, error) { + pager := &eventPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEventOrder + } + return pager, nil +} + +func (p *eventPager) applyFilter(query *EventQuery) (*EventQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *eventPager) toCursor(e *Event) Cursor { + return p.order.Field.toCursor(e) +} + +func (p *eventPager) applyCursors(query *EventQuery, after, before *Cursor) (*EventQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEventOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *eventPager) applyOrder(query *EventQuery) *EventQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEventOrder.Field { + query = query.Order(DefaultEventOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *eventPager) orderExpr(query *EventQuery) 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 != DefaultEventOrder.Field { + b.Comma().Ident(DefaultEventOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Event. +func (e *EventQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EventPaginateOption, +) (*EventConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEventPager(opts, last != nil) + if err != nil { + return nil, err + } + if e, err = pager.applyFilter(e); err != nil { + return nil, err + } + conn := &EventConnection{Edges: []*EventEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := e.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 e, err = pager.applyCursors(e, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + e.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := e.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + e = pager.applyOrder(e) + nodes, err := e.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EventOrderField defines the ordering field of Event. +type EventOrderField struct { + // Value extracts the ordering value from the given Event. + Value func(*Event) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) event.OrderOption + toCursor func(*Event) Cursor +} + +// EventOrder defines the ordering of Event. +type EventOrder struct { + Direction OrderDirection `json:"direction"` + Field *EventOrderField `json:"field"` +} + +// DefaultEventOrder is the default ordering of Event. +var DefaultEventOrder = &EventOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EventOrderField{ + Value: func(e *Event) (ent.Value, error) { + return e.ID, nil + }, + column: event.FieldID, + toTerm: event.ByID, + toCursor: func(e *Event) Cursor { + return Cursor{ID: e.ID} + }, + }, +} + +// ToEdge converts Event into EventEdge. +func (e *Event) ToEdge(order *EventOrder) *EventEdge { + if order == nil { + order = DefaultEventOrder + } + return &EventEdge{ + Node: e, + Cursor: order.Field.toCursor(e), + } +} + +// EventHistoryEdge is the edge representation of EventHistory. +type EventHistoryEdge struct { + Node *EventHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// EventHistoryConnection is the connection containing edges to EventHistory. +type EventHistoryConnection struct { + Edges []*EventHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *EventHistoryConnection) build(nodes []*EventHistory, pager *eventhistoryPager, 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) *EventHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *EventHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *EventHistory { + return nodes[i] + } + } + c.Edges = make([]*EventHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &EventHistoryEdge{ + 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) + } +} + +// EventHistoryPaginateOption enables pagination customization. +type EventHistoryPaginateOption func(*eventhistoryPager) error + +// WithEventHistoryOrder configures pagination ordering. +func WithEventHistoryOrder(order *EventHistoryOrder) EventHistoryPaginateOption { + if order == nil { + order = DefaultEventHistoryOrder + } + o := *order + return func(pager *eventhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultEventHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithEventHistoryFilter configures pagination filter. +func WithEventHistoryFilter(filter func(*EventHistoryQuery) (*EventHistoryQuery, error)) EventHistoryPaginateOption { + return func(pager *eventhistoryPager) error { + if filter == nil { + return errors.New("EventHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type eventhistoryPager struct { + reverse bool + order *EventHistoryOrder + filter func(*EventHistoryQuery) (*EventHistoryQuery, error) +} + +func newEventHistoryPager(opts []EventHistoryPaginateOption, reverse bool) (*eventhistoryPager, error) { + pager := &eventhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultEventHistoryOrder + } + return pager, nil +} + +func (p *eventhistoryPager) applyFilter(query *EventHistoryQuery) (*EventHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *eventhistoryPager) toCursor(eh *EventHistory) Cursor { + return p.order.Field.toCursor(eh) +} + +func (p *eventhistoryPager) applyCursors(query *EventHistoryQuery, after, before *Cursor) (*EventHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultEventHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *eventhistoryPager) applyOrder(query *EventHistoryQuery) *EventHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultEventHistoryOrder.Field { + query = query.Order(DefaultEventHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *eventhistoryPager) orderExpr(query *EventHistoryQuery) 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 != DefaultEventHistoryOrder.Field { + b.Comma().Ident(DefaultEventHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to EventHistory. +func (eh *EventHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...EventHistoryPaginateOption, +) (*EventHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newEventHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if eh, err = pager.applyFilter(eh); err != nil { + return nil, err + } + conn := &EventHistoryConnection{Edges: []*EventHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := eh.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 eh, err = pager.applyCursors(eh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + eh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := eh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + eh = pager.applyOrder(eh) + nodes, err := eh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// EventHistoryOrderField defines the ordering field of EventHistory. +type EventHistoryOrderField struct { + // Value extracts the ordering value from the given EventHistory. + Value func(*EventHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) eventhistory.OrderOption + toCursor func(*EventHistory) Cursor +} + +// EventHistoryOrder defines the ordering of EventHistory. +type EventHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *EventHistoryOrderField `json:"field"` +} + +// DefaultEventHistoryOrder is the default ordering of EventHistory. +var DefaultEventHistoryOrder = &EventHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &EventHistoryOrderField{ + Value: func(eh *EventHistory) (ent.Value, error) { + return eh.ID, nil + }, + column: eventhistory.FieldID, + toTerm: eventhistory.ByID, + toCursor: func(eh *EventHistory) Cursor { + return Cursor{ID: eh.ID} + }, + }, +} + +// ToEdge converts EventHistory into EventHistoryEdge. +func (eh *EventHistory) ToEdge(order *EventHistoryOrder) *EventHistoryEdge { + if order == nil { + order = DefaultEventHistoryOrder + } + return &EventHistoryEdge{ + Node: eh, + Cursor: order.Field.toCursor(eh), + } +} + +// FeatureEdge is the edge representation of Feature. +type FeatureEdge struct { + Node *Feature `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// FeatureConnection is the connection containing edges to Feature. +type FeatureConnection struct { + Edges []*FeatureEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *FeatureConnection) build(nodes []*Feature, pager *featurePager, 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) *Feature + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Feature { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Feature { + return nodes[i] + } + } + c.Edges = make([]*FeatureEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &FeatureEdge{ + 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) + } +} + +// FeaturePaginateOption enables pagination customization. +type FeaturePaginateOption func(*featurePager) error + +// WithFeatureOrder configures pagination ordering. +func WithFeatureOrder(order *FeatureOrder) FeaturePaginateOption { + if order == nil { + order = DefaultFeatureOrder + } + o := *order + return func(pager *featurePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultFeatureOrder.Field + } + pager.order = &o + return nil + } +} + +// WithFeatureFilter configures pagination filter. +func WithFeatureFilter(filter func(*FeatureQuery) (*FeatureQuery, error)) FeaturePaginateOption { + return func(pager *featurePager) error { + if filter == nil { + return errors.New("FeatureQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type featurePager struct { + reverse bool + order *FeatureOrder + filter func(*FeatureQuery) (*FeatureQuery, error) +} + +func newFeaturePager(opts []FeaturePaginateOption, reverse bool) (*featurePager, error) { + pager := &featurePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultFeatureOrder + } + return pager, nil +} + +func (p *featurePager) applyFilter(query *FeatureQuery) (*FeatureQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *featurePager) toCursor(f *Feature) Cursor { + return p.order.Field.toCursor(f) +} + +func (p *featurePager) applyCursors(query *FeatureQuery, after, before *Cursor) (*FeatureQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultFeatureOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *featurePager) applyOrder(query *FeatureQuery) *FeatureQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultFeatureOrder.Field { + query = query.Order(DefaultFeatureOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *featurePager) orderExpr(query *FeatureQuery) 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 != DefaultFeatureOrder.Field { + b.Comma().Ident(DefaultFeatureOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Feature. +func (f *FeatureQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...FeaturePaginateOption, +) (*FeatureConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newFeaturePager(opts, last != nil) + if err != nil { + return nil, err + } + if f, err = pager.applyFilter(f); err != nil { + return nil, err + } + conn := &FeatureConnection{Edges: []*FeatureEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := f.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 f, err = pager.applyCursors(f, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + f.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := f.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + f = pager.applyOrder(f) + nodes, err := f.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// FeatureOrderField defines the ordering field of Feature. +type FeatureOrderField struct { + // Value extracts the ordering value from the given Feature. + Value func(*Feature) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) feature.OrderOption + toCursor func(*Feature) Cursor +} + +// FeatureOrder defines the ordering of Feature. +type FeatureOrder struct { + Direction OrderDirection `json:"direction"` + Field *FeatureOrderField `json:"field"` +} + +// DefaultFeatureOrder is the default ordering of Feature. +var DefaultFeatureOrder = &FeatureOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &FeatureOrderField{ + Value: func(f *Feature) (ent.Value, error) { + return f.ID, nil + }, + column: feature.FieldID, + toTerm: feature.ByID, + toCursor: func(f *Feature) Cursor { + return Cursor{ID: f.ID} + }, + }, +} + +// ToEdge converts Feature into FeatureEdge. +func (f *Feature) ToEdge(order *FeatureOrder) *FeatureEdge { + if order == nil { + order = DefaultFeatureOrder + } + return &FeatureEdge{ + Node: f, + Cursor: order.Field.toCursor(f), + } +} + +// FeatureHistoryEdge is the edge representation of FeatureHistory. +type FeatureHistoryEdge struct { + Node *FeatureHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// FeatureHistoryConnection is the connection containing edges to FeatureHistory. +type FeatureHistoryConnection struct { + Edges []*FeatureHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *FeatureHistoryConnection) build(nodes []*FeatureHistory, pager *featurehistoryPager, 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) *FeatureHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *FeatureHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *FeatureHistory { + return nodes[i] + } + } + c.Edges = make([]*FeatureHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &FeatureHistoryEdge{ + 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) + } +} + +// FeatureHistoryPaginateOption enables pagination customization. +type FeatureHistoryPaginateOption func(*featurehistoryPager) error + +// WithFeatureHistoryOrder configures pagination ordering. +func WithFeatureHistoryOrder(order *FeatureHistoryOrder) FeatureHistoryPaginateOption { + if order == nil { + order = DefaultFeatureHistoryOrder + } + o := *order + return func(pager *featurehistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultFeatureHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithFeatureHistoryFilter configures pagination filter. +func WithFeatureHistoryFilter(filter func(*FeatureHistoryQuery) (*FeatureHistoryQuery, error)) FeatureHistoryPaginateOption { + return func(pager *featurehistoryPager) error { + if filter == nil { + return errors.New("FeatureHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type featurehistoryPager struct { + reverse bool + order *FeatureHistoryOrder + filter func(*FeatureHistoryQuery) (*FeatureHistoryQuery, error) +} + +func newFeatureHistoryPager(opts []FeatureHistoryPaginateOption, reverse bool) (*featurehistoryPager, error) { + pager := &featurehistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultFeatureHistoryOrder + } + return pager, nil +} + +func (p *featurehistoryPager) applyFilter(query *FeatureHistoryQuery) (*FeatureHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *featurehistoryPager) toCursor(fh *FeatureHistory) Cursor { + return p.order.Field.toCursor(fh) +} + +func (p *featurehistoryPager) applyCursors(query *FeatureHistoryQuery, after, before *Cursor) (*FeatureHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultFeatureHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *featurehistoryPager) applyOrder(query *FeatureHistoryQuery) *FeatureHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultFeatureHistoryOrder.Field { + query = query.Order(DefaultFeatureHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *featurehistoryPager) orderExpr(query *FeatureHistoryQuery) 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 != DefaultFeatureHistoryOrder.Field { + b.Comma().Ident(DefaultFeatureHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to FeatureHistory. +func (fh *FeatureHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...FeatureHistoryPaginateOption, +) (*FeatureHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newFeatureHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if fh, err = pager.applyFilter(fh); err != nil { + return nil, err + } + conn := &FeatureHistoryConnection{Edges: []*FeatureHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := fh.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 fh, err = pager.applyCursors(fh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + fh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := fh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + fh = pager.applyOrder(fh) + nodes, err := fh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// FeatureHistoryOrderField defines the ordering field of FeatureHistory. +type FeatureHistoryOrderField struct { + // Value extracts the ordering value from the given FeatureHistory. + Value func(*FeatureHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) featurehistory.OrderOption + toCursor func(*FeatureHistory) Cursor +} + +// FeatureHistoryOrder defines the ordering of FeatureHistory. +type FeatureHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *FeatureHistoryOrderField `json:"field"` +} + +// DefaultFeatureHistoryOrder is the default ordering of FeatureHistory. +var DefaultFeatureHistoryOrder = &FeatureHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &FeatureHistoryOrderField{ + Value: func(fh *FeatureHistory) (ent.Value, error) { + return fh.ID, nil + }, + column: featurehistory.FieldID, + toTerm: featurehistory.ByID, + toCursor: func(fh *FeatureHistory) Cursor { + return Cursor{ID: fh.ID} + }, + }, +} + +// ToEdge converts FeatureHistory into FeatureHistoryEdge. +func (fh *FeatureHistory) ToEdge(order *FeatureHistoryOrder) *FeatureHistoryEdge { + if order == nil { + order = DefaultFeatureHistoryOrder + } + return &FeatureHistoryEdge{ + Node: fh, + Cursor: order.Field.toCursor(fh), + } +} + +// FileEdge is the edge representation of File. +type FileEdge struct { + Node *File `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// FileConnection is the connection containing edges to File. +type FileConnection struct { + Edges []*FileEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *FileConnection) build(nodes []*File, pager *filePager, 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) *File + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *File { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *File { + return nodes[i] + } + } + c.Edges = make([]*FileEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &FileEdge{ + 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) + } +} + +// FilePaginateOption enables pagination customization. +type FilePaginateOption func(*filePager) error + +// WithFileOrder configures pagination ordering. +func WithFileOrder(order *FileOrder) FilePaginateOption { + if order == nil { + order = DefaultFileOrder + } + o := *order + return func(pager *filePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultFileOrder.Field + } + pager.order = &o + return nil + } +} + +// WithFileFilter configures pagination filter. +func WithFileFilter(filter func(*FileQuery) (*FileQuery, error)) FilePaginateOption { + return func(pager *filePager) error { + if filter == nil { + return errors.New("FileQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type filePager struct { + reverse bool + order *FileOrder + filter func(*FileQuery) (*FileQuery, error) +} + +func newFilePager(opts []FilePaginateOption, reverse bool) (*filePager, error) { + pager := &filePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultFileOrder + } + return pager, nil +} + +func (p *filePager) applyFilter(query *FileQuery) (*FileQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *filePager) toCursor(f *File) Cursor { + return p.order.Field.toCursor(f) +} + +func (p *filePager) applyCursors(query *FileQuery, after, before *Cursor) (*FileQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultFileOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *filePager) applyOrder(query *FileQuery) *FileQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultFileOrder.Field { + query = query.Order(DefaultFileOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *filePager) orderExpr(query *FileQuery) 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 != DefaultFileOrder.Field { + b.Comma().Ident(DefaultFileOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to File. +func (f *FileQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...FilePaginateOption, +) (*FileConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newFilePager(opts, last != nil) + if err != nil { + return nil, err + } + if f, err = pager.applyFilter(f); err != nil { + return nil, err + } + conn := &FileConnection{Edges: []*FileEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := f.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 f, err = pager.applyCursors(f, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + f.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := f.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + f = pager.applyOrder(f) + nodes, err := f.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// FileOrderField defines the ordering field of File. +type FileOrderField struct { + // Value extracts the ordering value from the given File. + Value func(*File) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) file.OrderOption + toCursor func(*File) Cursor +} + +// FileOrder defines the ordering of File. +type FileOrder struct { + Direction OrderDirection `json:"direction"` + Field *FileOrderField `json:"field"` +} + +// DefaultFileOrder is the default ordering of File. +var DefaultFileOrder = &FileOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &FileOrderField{ + Value: func(f *File) (ent.Value, error) { + return f.ID, nil + }, + column: file.FieldID, + toTerm: file.ByID, + toCursor: func(f *File) Cursor { + return Cursor{ID: f.ID} + }, + }, +} + +// ToEdge converts File into FileEdge. +func (f *File) ToEdge(order *FileOrder) *FileEdge { + if order == nil { + order = DefaultFileOrder + } + return &FileEdge{ + Node: f, + Cursor: order.Field.toCursor(f), + } +} + +// FileHistoryEdge is the edge representation of FileHistory. +type FileHistoryEdge struct { + Node *FileHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// FileHistoryConnection is the connection containing edges to FileHistory. +type FileHistoryConnection struct { + Edges []*FileHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *FileHistoryConnection) build(nodes []*FileHistory, pager *filehistoryPager, 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) *FileHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *FileHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *FileHistory { + return nodes[i] + } + } + c.Edges = make([]*FileHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &FileHistoryEdge{ + 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) + } +} + +// FileHistoryPaginateOption enables pagination customization. +type FileHistoryPaginateOption func(*filehistoryPager) error + +// WithFileHistoryOrder configures pagination ordering. +func WithFileHistoryOrder(order *FileHistoryOrder) FileHistoryPaginateOption { + if order == nil { + order = DefaultFileHistoryOrder + } + o := *order + return func(pager *filehistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultFileHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithFileHistoryFilter configures pagination filter. +func WithFileHistoryFilter(filter func(*FileHistoryQuery) (*FileHistoryQuery, error)) FileHistoryPaginateOption { + return func(pager *filehistoryPager) error { + if filter == nil { + return errors.New("FileHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type filehistoryPager struct { + reverse bool + order *FileHistoryOrder + filter func(*FileHistoryQuery) (*FileHistoryQuery, error) +} + +func newFileHistoryPager(opts []FileHistoryPaginateOption, reverse bool) (*filehistoryPager, error) { + pager := &filehistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultFileHistoryOrder + } + return pager, nil +} + +func (p *filehistoryPager) applyFilter(query *FileHistoryQuery) (*FileHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *filehistoryPager) toCursor(fh *FileHistory) Cursor { + return p.order.Field.toCursor(fh) +} + +func (p *filehistoryPager) applyCursors(query *FileHistoryQuery, after, before *Cursor) (*FileHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultFileHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *filehistoryPager) applyOrder(query *FileHistoryQuery) *FileHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultFileHistoryOrder.Field { + query = query.Order(DefaultFileHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *filehistoryPager) orderExpr(query *FileHistoryQuery) 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 != DefaultFileHistoryOrder.Field { + b.Comma().Ident(DefaultFileHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to FileHistory. +func (fh *FileHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...FileHistoryPaginateOption, +) (*FileHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newFileHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if fh, err = pager.applyFilter(fh); err != nil { + return nil, err + } + conn := &FileHistoryConnection{Edges: []*FileHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := fh.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 fh, err = pager.applyCursors(fh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + fh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := fh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + fh = pager.applyOrder(fh) + nodes, err := fh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// FileHistoryOrderField defines the ordering field of FileHistory. +type FileHistoryOrderField struct { + // Value extracts the ordering value from the given FileHistory. + Value func(*FileHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) filehistory.OrderOption + toCursor func(*FileHistory) Cursor +} + +// FileHistoryOrder defines the ordering of FileHistory. +type FileHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *FileHistoryOrderField `json:"field"` +} + +// DefaultFileHistoryOrder is the default ordering of FileHistory. +var DefaultFileHistoryOrder = &FileHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &FileHistoryOrderField{ + Value: func(fh *FileHistory) (ent.Value, error) { + return fh.ID, nil + }, + column: filehistory.FieldID, + toTerm: filehistory.ByID, + toCursor: func(fh *FileHistory) Cursor { + return Cursor{ID: fh.ID} + }, + }, +} + +// ToEdge converts FileHistory into FileHistoryEdge. +func (fh *FileHistory) ToEdge(order *FileHistoryOrder) *FileHistoryEdge { + if order == nil { + order = DefaultFileHistoryOrder + } + return &FileHistoryEdge{ + Node: fh, + Cursor: order.Field.toCursor(fh), + } +} + +// GroupEdge is the edge representation of Group. +type GroupEdge struct { + Node *Group `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// GroupConnection is the connection containing edges to Group. +type GroupConnection struct { + Edges []*GroupEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *GroupConnection) build(nodes []*Group, pager *groupPager, 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) *Group + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Group { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Group { + return nodes[i] + } + } + c.Edges = make([]*GroupEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &GroupEdge{ + 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) + } +} + +// GroupPaginateOption enables pagination customization. +type GroupPaginateOption func(*groupPager) error + +// WithGroupOrder configures pagination ordering. +func WithGroupOrder(order *GroupOrder) GroupPaginateOption { + if order == nil { + order = DefaultGroupOrder + } + o := *order + return func(pager *groupPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultGroupOrder.Field + } + pager.order = &o + return nil + } +} + +// WithGroupFilter configures pagination filter. +func WithGroupFilter(filter func(*GroupQuery) (*GroupQuery, error)) GroupPaginateOption { + return func(pager *groupPager) error { + if filter == nil { + return errors.New("GroupQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type groupPager struct { + reverse bool + order *GroupOrder + filter func(*GroupQuery) (*GroupQuery, error) +} + +func newGroupPager(opts []GroupPaginateOption, reverse bool) (*groupPager, error) { + pager := &groupPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultGroupOrder + } + return pager, nil +} + +func (p *groupPager) applyFilter(query *GroupQuery) (*GroupQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *groupPager) toCursor(gr *Group) Cursor { + return p.order.Field.toCursor(gr) +} + +func (p *groupPager) applyCursors(query *GroupQuery, after, before *Cursor) (*GroupQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultGroupOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *groupPager) applyOrder(query *GroupQuery) *GroupQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultGroupOrder.Field { + query = query.Order(DefaultGroupOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *groupPager) orderExpr(query *GroupQuery) 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 != DefaultGroupOrder.Field { + b.Comma().Ident(DefaultGroupOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Group. +func (gr *GroupQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...GroupPaginateOption, +) (*GroupConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newGroupPager(opts, last != nil) + if err != nil { + return nil, err + } + if gr, err = pager.applyFilter(gr); err != nil { + return nil, err + } + conn := &GroupConnection{Edges: []*GroupEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := gr.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 gr, err = pager.applyCursors(gr, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + gr.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := gr.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + gr = pager.applyOrder(gr) + nodes, err := gr.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // GroupOrderFieldName orders Group by name. + GroupOrderFieldName = &GroupOrderField{ + Value: func(gr *Group) (ent.Value, error) { + return gr.Name, nil + }, + column: group.FieldName, + toTerm: group.ByName, + toCursor: func(gr *Group) Cursor { + return Cursor{ + ID: gr.ID, + Value: gr.Name, + } + }, + } + // GroupOrderFieldDisplayName orders Group by display_name. + GroupOrderFieldDisplayName = &GroupOrderField{ + Value: func(gr *Group) (ent.Value, error) { + return gr.DisplayName, nil + }, + column: group.FieldDisplayName, + toTerm: group.ByDisplayName, + toCursor: func(gr *Group) Cursor { + return Cursor{ + ID: gr.ID, + Value: gr.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f GroupOrderField) String() string { + var str string + switch f.column { + case GroupOrderFieldName.column: + str = "name" + case GroupOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f GroupOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *GroupOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("GroupOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *GroupOrderFieldName + case "display_name": + *f = *GroupOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid GroupOrderField", str) + } + return nil +} + +// GroupOrderField defines the ordering field of Group. +type GroupOrderField struct { + // Value extracts the ordering value from the given Group. + Value func(*Group) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) group.OrderOption + toCursor func(*Group) Cursor +} + +// GroupOrder defines the ordering of Group. +type GroupOrder struct { + Direction OrderDirection `json:"direction"` + Field *GroupOrderField `json:"field"` +} + +// DefaultGroupOrder is the default ordering of Group. +var DefaultGroupOrder = &GroupOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &GroupOrderField{ + Value: func(gr *Group) (ent.Value, error) { + return gr.ID, nil + }, + column: group.FieldID, + toTerm: group.ByID, + toCursor: func(gr *Group) Cursor { + return Cursor{ID: gr.ID} + }, + }, +} + +// ToEdge converts Group into GroupEdge. +func (gr *Group) ToEdge(order *GroupOrder) *GroupEdge { + if order == nil { + order = DefaultGroupOrder + } + return &GroupEdge{ + Node: gr, + Cursor: order.Field.toCursor(gr), + } +} + +// GroupHistoryEdge is the edge representation of GroupHistory. +type GroupHistoryEdge struct { + Node *GroupHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// GroupHistoryConnection is the connection containing edges to GroupHistory. +type GroupHistoryConnection struct { + Edges []*GroupHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *GroupHistoryConnection) build(nodes []*GroupHistory, pager *grouphistoryPager, 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) *GroupHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *GroupHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *GroupHistory { + return nodes[i] + } + } + c.Edges = make([]*GroupHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &GroupHistoryEdge{ + 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) + } +} + +// GroupHistoryPaginateOption enables pagination customization. +type GroupHistoryPaginateOption func(*grouphistoryPager) error + +// WithGroupHistoryOrder configures pagination ordering. +func WithGroupHistoryOrder(order *GroupHistoryOrder) GroupHistoryPaginateOption { + if order == nil { + order = DefaultGroupHistoryOrder + } + o := *order + return func(pager *grouphistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultGroupHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithGroupHistoryFilter configures pagination filter. +func WithGroupHistoryFilter(filter func(*GroupHistoryQuery) (*GroupHistoryQuery, error)) GroupHistoryPaginateOption { + return func(pager *grouphistoryPager) error { + if filter == nil { + return errors.New("GroupHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type grouphistoryPager struct { + reverse bool + order *GroupHistoryOrder + filter func(*GroupHistoryQuery) (*GroupHistoryQuery, error) +} + +func newGroupHistoryPager(opts []GroupHistoryPaginateOption, reverse bool) (*grouphistoryPager, error) { + pager := &grouphistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultGroupHistoryOrder + } + return pager, nil +} + +func (p *grouphistoryPager) applyFilter(query *GroupHistoryQuery) (*GroupHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *grouphistoryPager) toCursor(gh *GroupHistory) Cursor { + return p.order.Field.toCursor(gh) +} + +func (p *grouphistoryPager) applyCursors(query *GroupHistoryQuery, after, before *Cursor) (*GroupHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultGroupHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *grouphistoryPager) applyOrder(query *GroupHistoryQuery) *GroupHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultGroupHistoryOrder.Field { + query = query.Order(DefaultGroupHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *grouphistoryPager) orderExpr(query *GroupHistoryQuery) 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 != DefaultGroupHistoryOrder.Field { + b.Comma().Ident(DefaultGroupHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to GroupHistory. +func (gh *GroupHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...GroupHistoryPaginateOption, +) (*GroupHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newGroupHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if gh, err = pager.applyFilter(gh); err != nil { + return nil, err + } + conn := &GroupHistoryConnection{Edges: []*GroupHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := gh.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 gh, err = pager.applyCursors(gh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + gh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := gh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + gh = pager.applyOrder(gh) + nodes, err := gh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // GroupHistoryOrderFieldName orders GroupHistory by name. + GroupHistoryOrderFieldName = &GroupHistoryOrderField{ + Value: func(gh *GroupHistory) (ent.Value, error) { + return gh.Name, nil + }, + column: grouphistory.FieldName, + toTerm: grouphistory.ByName, + toCursor: func(gh *GroupHistory) Cursor { + return Cursor{ + ID: gh.ID, + Value: gh.Name, + } + }, + } + // GroupHistoryOrderFieldDisplayName orders GroupHistory by display_name. + GroupHistoryOrderFieldDisplayName = &GroupHistoryOrderField{ + Value: func(gh *GroupHistory) (ent.Value, error) { + return gh.DisplayName, nil + }, + column: grouphistory.FieldDisplayName, + toTerm: grouphistory.ByDisplayName, + toCursor: func(gh *GroupHistory) Cursor { + return Cursor{ + ID: gh.ID, + Value: gh.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f GroupHistoryOrderField) String() string { + var str string + switch f.column { + case GroupHistoryOrderFieldName.column: + str = "name" + case GroupHistoryOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f GroupHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *GroupHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("GroupHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *GroupHistoryOrderFieldName + case "display_name": + *f = *GroupHistoryOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid GroupHistoryOrderField", str) + } + return nil +} + +// GroupHistoryOrderField defines the ordering field of GroupHistory. +type GroupHistoryOrderField struct { + // Value extracts the ordering value from the given GroupHistory. + Value func(*GroupHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) grouphistory.OrderOption + toCursor func(*GroupHistory) Cursor +} + +// GroupHistoryOrder defines the ordering of GroupHistory. +type GroupHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *GroupHistoryOrderField `json:"field"` +} + +// DefaultGroupHistoryOrder is the default ordering of GroupHistory. +var DefaultGroupHistoryOrder = &GroupHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &GroupHistoryOrderField{ + Value: func(gh *GroupHistory) (ent.Value, error) { + return gh.ID, nil + }, + column: grouphistory.FieldID, + toTerm: grouphistory.ByID, + toCursor: func(gh *GroupHistory) Cursor { + return Cursor{ID: gh.ID} + }, + }, +} + +// ToEdge converts GroupHistory into GroupHistoryEdge. +func (gh *GroupHistory) ToEdge(order *GroupHistoryOrder) *GroupHistoryEdge { + if order == nil { + order = DefaultGroupHistoryOrder + } + return &GroupHistoryEdge{ + Node: gh, + Cursor: order.Field.toCursor(gh), + } +} + +// GroupMembershipEdge is the edge representation of GroupMembership. +type GroupMembershipEdge struct { + Node *GroupMembership `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// GroupMembershipConnection is the connection containing edges to GroupMembership. +type GroupMembershipConnection struct { + Edges []*GroupMembershipEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *GroupMembershipConnection) build(nodes []*GroupMembership, pager *groupmembershipPager, 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) *GroupMembership + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *GroupMembership { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *GroupMembership { + return nodes[i] + } + } + c.Edges = make([]*GroupMembershipEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &GroupMembershipEdge{ + 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) + } +} + +// GroupMembershipPaginateOption enables pagination customization. +type GroupMembershipPaginateOption func(*groupmembershipPager) error + +// WithGroupMembershipOrder configures pagination ordering. +func WithGroupMembershipOrder(order *GroupMembershipOrder) GroupMembershipPaginateOption { + if order == nil { + order = DefaultGroupMembershipOrder + } + o := *order + return func(pager *groupmembershipPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultGroupMembershipOrder.Field + } + pager.order = &o + return nil + } +} + +// WithGroupMembershipFilter configures pagination filter. +func WithGroupMembershipFilter(filter func(*GroupMembershipQuery) (*GroupMembershipQuery, error)) GroupMembershipPaginateOption { + return func(pager *groupmembershipPager) error { + if filter == nil { + return errors.New("GroupMembershipQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type groupmembershipPager struct { + reverse bool + order *GroupMembershipOrder + filter func(*GroupMembershipQuery) (*GroupMembershipQuery, error) +} + +func newGroupMembershipPager(opts []GroupMembershipPaginateOption, reverse bool) (*groupmembershipPager, error) { + pager := &groupmembershipPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultGroupMembershipOrder + } + return pager, nil +} + +func (p *groupmembershipPager) applyFilter(query *GroupMembershipQuery) (*GroupMembershipQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *groupmembershipPager) toCursor(gm *GroupMembership) Cursor { + return p.order.Field.toCursor(gm) +} + +func (p *groupmembershipPager) applyCursors(query *GroupMembershipQuery, after, before *Cursor) (*GroupMembershipQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultGroupMembershipOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *groupmembershipPager) applyOrder(query *GroupMembershipQuery) *GroupMembershipQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultGroupMembershipOrder.Field { + query = query.Order(DefaultGroupMembershipOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *groupmembershipPager) orderExpr(query *GroupMembershipQuery) 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 != DefaultGroupMembershipOrder.Field { + b.Comma().Ident(DefaultGroupMembershipOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to GroupMembership. +func (gm *GroupMembershipQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...GroupMembershipPaginateOption, +) (*GroupMembershipConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newGroupMembershipPager(opts, last != nil) + if err != nil { + return nil, err + } + if gm, err = pager.applyFilter(gm); err != nil { + return nil, err + } + conn := &GroupMembershipConnection{Edges: []*GroupMembershipEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := gm.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 gm, err = pager.applyCursors(gm, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + gm.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := gm.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + gm = pager.applyOrder(gm) + nodes, err := gm.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// GroupMembershipOrderField defines the ordering field of GroupMembership. +type GroupMembershipOrderField struct { + // Value extracts the ordering value from the given GroupMembership. + Value func(*GroupMembership) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) groupmembership.OrderOption + toCursor func(*GroupMembership) Cursor +} + +// GroupMembershipOrder defines the ordering of GroupMembership. +type GroupMembershipOrder struct { + Direction OrderDirection `json:"direction"` + Field *GroupMembershipOrderField `json:"field"` +} + +// DefaultGroupMembershipOrder is the default ordering of GroupMembership. +var DefaultGroupMembershipOrder = &GroupMembershipOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &GroupMembershipOrderField{ + Value: func(gm *GroupMembership) (ent.Value, error) { + return gm.ID, nil + }, + column: groupmembership.FieldID, + toTerm: groupmembership.ByID, + toCursor: func(gm *GroupMembership) Cursor { + return Cursor{ID: gm.ID} + }, + }, +} + +// ToEdge converts GroupMembership into GroupMembershipEdge. +func (gm *GroupMembership) ToEdge(order *GroupMembershipOrder) *GroupMembershipEdge { + if order == nil { + order = DefaultGroupMembershipOrder + } + return &GroupMembershipEdge{ + Node: gm, + Cursor: order.Field.toCursor(gm), + } +} + +// GroupMembershipHistoryEdge is the edge representation of GroupMembershipHistory. +type GroupMembershipHistoryEdge struct { + Node *GroupMembershipHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// GroupMembershipHistoryConnection is the connection containing edges to GroupMembershipHistory. +type GroupMembershipHistoryConnection struct { + Edges []*GroupMembershipHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *GroupMembershipHistoryConnection) build(nodes []*GroupMembershipHistory, pager *groupmembershiphistoryPager, 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) *GroupMembershipHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *GroupMembershipHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *GroupMembershipHistory { + return nodes[i] + } + } + c.Edges = make([]*GroupMembershipHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &GroupMembershipHistoryEdge{ + 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) + } +} + +// GroupMembershipHistoryPaginateOption enables pagination customization. +type GroupMembershipHistoryPaginateOption func(*groupmembershiphistoryPager) error + +// WithGroupMembershipHistoryOrder configures pagination ordering. +func WithGroupMembershipHistoryOrder(order *GroupMembershipHistoryOrder) GroupMembershipHistoryPaginateOption { + if order == nil { + order = DefaultGroupMembershipHistoryOrder + } + o := *order + return func(pager *groupmembershiphistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultGroupMembershipHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithGroupMembershipHistoryFilter configures pagination filter. +func WithGroupMembershipHistoryFilter(filter func(*GroupMembershipHistoryQuery) (*GroupMembershipHistoryQuery, error)) GroupMembershipHistoryPaginateOption { + return func(pager *groupmembershiphistoryPager) error { + if filter == nil { + return errors.New("GroupMembershipHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type groupmembershiphistoryPager struct { + reverse bool + order *GroupMembershipHistoryOrder + filter func(*GroupMembershipHistoryQuery) (*GroupMembershipHistoryQuery, error) +} + +func newGroupMembershipHistoryPager(opts []GroupMembershipHistoryPaginateOption, reverse bool) (*groupmembershiphistoryPager, error) { + pager := &groupmembershiphistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultGroupMembershipHistoryOrder + } + return pager, nil +} + +func (p *groupmembershiphistoryPager) applyFilter(query *GroupMembershipHistoryQuery) (*GroupMembershipHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *groupmembershiphistoryPager) toCursor(gmh *GroupMembershipHistory) Cursor { + return p.order.Field.toCursor(gmh) +} + +func (p *groupmembershiphistoryPager) applyCursors(query *GroupMembershipHistoryQuery, after, before *Cursor) (*GroupMembershipHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultGroupMembershipHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *groupmembershiphistoryPager) applyOrder(query *GroupMembershipHistoryQuery) *GroupMembershipHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultGroupMembershipHistoryOrder.Field { + query = query.Order(DefaultGroupMembershipHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *groupmembershiphistoryPager) orderExpr(query *GroupMembershipHistoryQuery) 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 != DefaultGroupMembershipHistoryOrder.Field { + b.Comma().Ident(DefaultGroupMembershipHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to GroupMembershipHistory. +func (gmh *GroupMembershipHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...GroupMembershipHistoryPaginateOption, +) (*GroupMembershipHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newGroupMembershipHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if gmh, err = pager.applyFilter(gmh); err != nil { + return nil, err + } + conn := &GroupMembershipHistoryConnection{Edges: []*GroupMembershipHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := gmh.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 gmh, err = pager.applyCursors(gmh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + gmh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := gmh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + gmh = pager.applyOrder(gmh) + nodes, err := gmh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// GroupMembershipHistoryOrderField defines the ordering field of GroupMembershipHistory. +type GroupMembershipHistoryOrderField struct { + // Value extracts the ordering value from the given GroupMembershipHistory. + Value func(*GroupMembershipHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) groupmembershiphistory.OrderOption + toCursor func(*GroupMembershipHistory) Cursor +} + +// GroupMembershipHistoryOrder defines the ordering of GroupMembershipHistory. +type GroupMembershipHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *GroupMembershipHistoryOrderField `json:"field"` +} + +// DefaultGroupMembershipHistoryOrder is the default ordering of GroupMembershipHistory. +var DefaultGroupMembershipHistoryOrder = &GroupMembershipHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &GroupMembershipHistoryOrderField{ + Value: func(gmh *GroupMembershipHistory) (ent.Value, error) { + return gmh.ID, nil + }, + column: groupmembershiphistory.FieldID, + toTerm: groupmembershiphistory.ByID, + toCursor: func(gmh *GroupMembershipHistory) Cursor { + return Cursor{ID: gmh.ID} + }, + }, +} + +// ToEdge converts GroupMembershipHistory into GroupMembershipHistoryEdge. +func (gmh *GroupMembershipHistory) ToEdge(order *GroupMembershipHistoryOrder) *GroupMembershipHistoryEdge { + if order == nil { + order = DefaultGroupMembershipHistoryOrder + } + return &GroupMembershipHistoryEdge{ + Node: gmh, + Cursor: order.Field.toCursor(gmh), + } +} + +// GroupSettingEdge is the edge representation of GroupSetting. +type GroupSettingEdge struct { + Node *GroupSetting `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// GroupSettingConnection is the connection containing edges to GroupSetting. +type GroupSettingConnection struct { + Edges []*GroupSettingEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *GroupSettingConnection) build(nodes []*GroupSetting, pager *groupsettingPager, 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) *GroupSetting + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *GroupSetting { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *GroupSetting { + return nodes[i] + } + } + c.Edges = make([]*GroupSettingEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &GroupSettingEdge{ + 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) + } +} + +// GroupSettingPaginateOption enables pagination customization. +type GroupSettingPaginateOption func(*groupsettingPager) error + +// WithGroupSettingOrder configures pagination ordering. +func WithGroupSettingOrder(order *GroupSettingOrder) GroupSettingPaginateOption { + if order == nil { + order = DefaultGroupSettingOrder + } + o := *order + return func(pager *groupsettingPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultGroupSettingOrder.Field + } + pager.order = &o + return nil + } +} + +// WithGroupSettingFilter configures pagination filter. +func WithGroupSettingFilter(filter func(*GroupSettingQuery) (*GroupSettingQuery, error)) GroupSettingPaginateOption { + return func(pager *groupsettingPager) error { + if filter == nil { + return errors.New("GroupSettingQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type groupsettingPager struct { + reverse bool + order *GroupSettingOrder + filter func(*GroupSettingQuery) (*GroupSettingQuery, error) +} + +func newGroupSettingPager(opts []GroupSettingPaginateOption, reverse bool) (*groupsettingPager, error) { + pager := &groupsettingPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultGroupSettingOrder + } + return pager, nil +} + +func (p *groupsettingPager) applyFilter(query *GroupSettingQuery) (*GroupSettingQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *groupsettingPager) toCursor(gs *GroupSetting) Cursor { + return p.order.Field.toCursor(gs) +} + +func (p *groupsettingPager) applyCursors(query *GroupSettingQuery, after, before *Cursor) (*GroupSettingQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultGroupSettingOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *groupsettingPager) applyOrder(query *GroupSettingQuery) *GroupSettingQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultGroupSettingOrder.Field { + query = query.Order(DefaultGroupSettingOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *groupsettingPager) orderExpr(query *GroupSettingQuery) 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 != DefaultGroupSettingOrder.Field { + b.Comma().Ident(DefaultGroupSettingOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to GroupSetting. +func (gs *GroupSettingQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...GroupSettingPaginateOption, +) (*GroupSettingConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newGroupSettingPager(opts, last != nil) + if err != nil { + return nil, err + } + if gs, err = pager.applyFilter(gs); err != nil { + return nil, err + } + conn := &GroupSettingConnection{Edges: []*GroupSettingEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := gs.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 gs, err = pager.applyCursors(gs, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + gs.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := gs.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + gs = pager.applyOrder(gs) + nodes, err := gs.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// GroupSettingOrderField defines the ordering field of GroupSetting. +type GroupSettingOrderField struct { + // Value extracts the ordering value from the given GroupSetting. + Value func(*GroupSetting) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) groupsetting.OrderOption + toCursor func(*GroupSetting) Cursor +} + +// GroupSettingOrder defines the ordering of GroupSetting. +type GroupSettingOrder struct { + Direction OrderDirection `json:"direction"` + Field *GroupSettingOrderField `json:"field"` +} + +// DefaultGroupSettingOrder is the default ordering of GroupSetting. +var DefaultGroupSettingOrder = &GroupSettingOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &GroupSettingOrderField{ + Value: func(gs *GroupSetting) (ent.Value, error) { + return gs.ID, nil + }, + column: groupsetting.FieldID, + toTerm: groupsetting.ByID, + toCursor: func(gs *GroupSetting) Cursor { + return Cursor{ID: gs.ID} + }, + }, +} + +// ToEdge converts GroupSetting into GroupSettingEdge. +func (gs *GroupSetting) ToEdge(order *GroupSettingOrder) *GroupSettingEdge { + if order == nil { + order = DefaultGroupSettingOrder + } + return &GroupSettingEdge{ + Node: gs, + Cursor: order.Field.toCursor(gs), + } +} + +// GroupSettingHistoryEdge is the edge representation of GroupSettingHistory. +type GroupSettingHistoryEdge struct { + Node *GroupSettingHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// GroupSettingHistoryConnection is the connection containing edges to GroupSettingHistory. +type GroupSettingHistoryConnection struct { + Edges []*GroupSettingHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *GroupSettingHistoryConnection) build(nodes []*GroupSettingHistory, pager *groupsettinghistoryPager, 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) *GroupSettingHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *GroupSettingHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *GroupSettingHistory { + return nodes[i] + } + } + c.Edges = make([]*GroupSettingHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &GroupSettingHistoryEdge{ + 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) + } +} + +// GroupSettingHistoryPaginateOption enables pagination customization. +type GroupSettingHistoryPaginateOption func(*groupsettinghistoryPager) error + +// WithGroupSettingHistoryOrder configures pagination ordering. +func WithGroupSettingHistoryOrder(order *GroupSettingHistoryOrder) GroupSettingHistoryPaginateOption { + if order == nil { + order = DefaultGroupSettingHistoryOrder + } + o := *order + return func(pager *groupsettinghistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultGroupSettingHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithGroupSettingHistoryFilter configures pagination filter. +func WithGroupSettingHistoryFilter(filter func(*GroupSettingHistoryQuery) (*GroupSettingHistoryQuery, error)) GroupSettingHistoryPaginateOption { + return func(pager *groupsettinghistoryPager) error { + if filter == nil { + return errors.New("GroupSettingHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type groupsettinghistoryPager struct { + reverse bool + order *GroupSettingHistoryOrder + filter func(*GroupSettingHistoryQuery) (*GroupSettingHistoryQuery, error) +} + +func newGroupSettingHistoryPager(opts []GroupSettingHistoryPaginateOption, reverse bool) (*groupsettinghistoryPager, error) { + pager := &groupsettinghistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultGroupSettingHistoryOrder + } + return pager, nil +} + +func (p *groupsettinghistoryPager) applyFilter(query *GroupSettingHistoryQuery) (*GroupSettingHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *groupsettinghistoryPager) toCursor(gsh *GroupSettingHistory) Cursor { + return p.order.Field.toCursor(gsh) +} + +func (p *groupsettinghistoryPager) applyCursors(query *GroupSettingHistoryQuery, after, before *Cursor) (*GroupSettingHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultGroupSettingHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *groupsettinghistoryPager) applyOrder(query *GroupSettingHistoryQuery) *GroupSettingHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultGroupSettingHistoryOrder.Field { + query = query.Order(DefaultGroupSettingHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *groupsettinghistoryPager) orderExpr(query *GroupSettingHistoryQuery) 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 != DefaultGroupSettingHistoryOrder.Field { + b.Comma().Ident(DefaultGroupSettingHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to GroupSettingHistory. +func (gsh *GroupSettingHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...GroupSettingHistoryPaginateOption, +) (*GroupSettingHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newGroupSettingHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if gsh, err = pager.applyFilter(gsh); err != nil { + return nil, err + } + conn := &GroupSettingHistoryConnection{Edges: []*GroupSettingHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := gsh.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 gsh, err = pager.applyCursors(gsh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + gsh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := gsh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + gsh = pager.applyOrder(gsh) + nodes, err := gsh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// GroupSettingHistoryOrderField defines the ordering field of GroupSettingHistory. +type GroupSettingHistoryOrderField struct { + // Value extracts the ordering value from the given GroupSettingHistory. + Value func(*GroupSettingHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) groupsettinghistory.OrderOption + toCursor func(*GroupSettingHistory) Cursor +} + +// GroupSettingHistoryOrder defines the ordering of GroupSettingHistory. +type GroupSettingHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *GroupSettingHistoryOrderField `json:"field"` +} + +// DefaultGroupSettingHistoryOrder is the default ordering of GroupSettingHistory. +var DefaultGroupSettingHistoryOrder = &GroupSettingHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &GroupSettingHistoryOrderField{ + Value: func(gsh *GroupSettingHistory) (ent.Value, error) { + return gsh.ID, nil + }, + column: groupsettinghistory.FieldID, + toTerm: groupsettinghistory.ByID, + toCursor: func(gsh *GroupSettingHistory) Cursor { + return Cursor{ID: gsh.ID} + }, + }, +} + +// ToEdge converts GroupSettingHistory into GroupSettingHistoryEdge. +func (gsh *GroupSettingHistory) ToEdge(order *GroupSettingHistoryOrder) *GroupSettingHistoryEdge { + if order == nil { + order = DefaultGroupSettingHistoryOrder + } + return &GroupSettingHistoryEdge{ + Node: gsh, + Cursor: order.Field.toCursor(gsh), + } +} + +// HushEdge is the edge representation of Hush. +type HushEdge struct { + Node *Hush `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// HushConnection is the connection containing edges to Hush. +type HushConnection struct { + Edges []*HushEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *HushConnection) build(nodes []*Hush, pager *hushPager, 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) *Hush + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Hush { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Hush { + return nodes[i] + } + } + c.Edges = make([]*HushEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &HushEdge{ + 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) + } +} + +// HushPaginateOption enables pagination customization. +type HushPaginateOption func(*hushPager) error + +// WithHushOrder configures pagination ordering. +func WithHushOrder(order *HushOrder) HushPaginateOption { + if order == nil { + order = DefaultHushOrder + } + o := *order + return func(pager *hushPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultHushOrder.Field + } + pager.order = &o + return nil + } +} + +// WithHushFilter configures pagination filter. +func WithHushFilter(filter func(*HushQuery) (*HushQuery, error)) HushPaginateOption { + return func(pager *hushPager) error { + if filter == nil { + return errors.New("HushQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type hushPager struct { + reverse bool + order *HushOrder + filter func(*HushQuery) (*HushQuery, error) +} + +func newHushPager(opts []HushPaginateOption, reverse bool) (*hushPager, error) { + pager := &hushPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultHushOrder + } + return pager, nil +} + +func (p *hushPager) applyFilter(query *HushQuery) (*HushQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *hushPager) toCursor(h *Hush) Cursor { + return p.order.Field.toCursor(h) +} + +func (p *hushPager) applyCursors(query *HushQuery, after, before *Cursor) (*HushQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultHushOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *hushPager) applyOrder(query *HushQuery) *HushQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultHushOrder.Field { + query = query.Order(DefaultHushOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *hushPager) orderExpr(query *HushQuery) 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 != DefaultHushOrder.Field { + b.Comma().Ident(DefaultHushOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Hush. +func (h *HushQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...HushPaginateOption, +) (*HushConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newHushPager(opts, last != nil) + if err != nil { + return nil, err + } + if h, err = pager.applyFilter(h); err != nil { + return nil, err + } + conn := &HushConnection{Edges: []*HushEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := h.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 h, err = pager.applyCursors(h, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + h.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := h.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + h = pager.applyOrder(h) + nodes, err := h.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // HushOrderFieldName orders Hush by name. + HushOrderFieldName = &HushOrderField{ + Value: func(h *Hush) (ent.Value, error) { + return h.Name, nil + }, + column: hush.FieldName, + toTerm: hush.ByName, + toCursor: func(h *Hush) Cursor { + return Cursor{ + ID: h.ID, + Value: h.Name, + } + }, + } + // HushOrderFieldKind orders Hush by kind. + HushOrderFieldKind = &HushOrderField{ + Value: func(h *Hush) (ent.Value, error) { + return h.Kind, nil + }, + column: hush.FieldKind, + toTerm: hush.ByKind, + toCursor: func(h *Hush) Cursor { + return Cursor{ + ID: h.ID, + Value: h.Kind, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f HushOrderField) String() string { + var str string + switch f.column { + case HushOrderFieldName.column: + str = "name" + case HushOrderFieldKind.column: + str = "kind" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f HushOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *HushOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("HushOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *HushOrderFieldName + case "kind": + *f = *HushOrderFieldKind + default: + return fmt.Errorf("%s is not a valid HushOrderField", str) + } + return nil +} + +// HushOrderField defines the ordering field of Hush. +type HushOrderField struct { + // Value extracts the ordering value from the given Hush. + Value func(*Hush) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) hush.OrderOption + toCursor func(*Hush) Cursor +} + +// HushOrder defines the ordering of Hush. +type HushOrder struct { + Direction OrderDirection `json:"direction"` + Field *HushOrderField `json:"field"` +} + +// DefaultHushOrder is the default ordering of Hush. +var DefaultHushOrder = &HushOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &HushOrderField{ + Value: func(h *Hush) (ent.Value, error) { + return h.ID, nil + }, + column: hush.FieldID, + toTerm: hush.ByID, + toCursor: func(h *Hush) Cursor { + return Cursor{ID: h.ID} + }, + }, +} + +// ToEdge converts Hush into HushEdge. +func (h *Hush) ToEdge(order *HushOrder) *HushEdge { + if order == nil { + order = DefaultHushOrder + } + return &HushEdge{ + Node: h, + Cursor: order.Field.toCursor(h), + } +} + +// HushHistoryEdge is the edge representation of HushHistory. +type HushHistoryEdge struct { + Node *HushHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// HushHistoryConnection is the connection containing edges to HushHistory. +type HushHistoryConnection struct { + Edges []*HushHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *HushHistoryConnection) build(nodes []*HushHistory, pager *hushhistoryPager, 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) *HushHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *HushHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *HushHistory { + return nodes[i] + } + } + c.Edges = make([]*HushHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &HushHistoryEdge{ + 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) + } +} + +// HushHistoryPaginateOption enables pagination customization. +type HushHistoryPaginateOption func(*hushhistoryPager) error + +// WithHushHistoryOrder configures pagination ordering. +func WithHushHistoryOrder(order *HushHistoryOrder) HushHistoryPaginateOption { + if order == nil { + order = DefaultHushHistoryOrder + } + o := *order + return func(pager *hushhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultHushHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithHushHistoryFilter configures pagination filter. +func WithHushHistoryFilter(filter func(*HushHistoryQuery) (*HushHistoryQuery, error)) HushHistoryPaginateOption { + return func(pager *hushhistoryPager) error { + if filter == nil { + return errors.New("HushHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type hushhistoryPager struct { + reverse bool + order *HushHistoryOrder + filter func(*HushHistoryQuery) (*HushHistoryQuery, error) +} + +func newHushHistoryPager(opts []HushHistoryPaginateOption, reverse bool) (*hushhistoryPager, error) { + pager := &hushhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultHushHistoryOrder + } + return pager, nil +} + +func (p *hushhistoryPager) applyFilter(query *HushHistoryQuery) (*HushHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *hushhistoryPager) toCursor(hh *HushHistory) Cursor { + return p.order.Field.toCursor(hh) +} + +func (p *hushhistoryPager) applyCursors(query *HushHistoryQuery, after, before *Cursor) (*HushHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultHushHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *hushhistoryPager) applyOrder(query *HushHistoryQuery) *HushHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultHushHistoryOrder.Field { + query = query.Order(DefaultHushHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *hushhistoryPager) orderExpr(query *HushHistoryQuery) 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 != DefaultHushHistoryOrder.Field { + b.Comma().Ident(DefaultHushHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to HushHistory. +func (hh *HushHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...HushHistoryPaginateOption, +) (*HushHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newHushHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if hh, err = pager.applyFilter(hh); err != nil { + return nil, err + } + conn := &HushHistoryConnection{Edges: []*HushHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := hh.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 hh, err = pager.applyCursors(hh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + hh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := hh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + hh = pager.applyOrder(hh) + nodes, err := hh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // HushHistoryOrderFieldName orders HushHistory by name. + HushHistoryOrderFieldName = &HushHistoryOrderField{ + Value: func(hh *HushHistory) (ent.Value, error) { + return hh.Name, nil + }, + column: hushhistory.FieldName, + toTerm: hushhistory.ByName, + toCursor: func(hh *HushHistory) Cursor { + return Cursor{ + ID: hh.ID, + Value: hh.Name, + } + }, + } + // HushHistoryOrderFieldKind orders HushHistory by kind. + HushHistoryOrderFieldKind = &HushHistoryOrderField{ + Value: func(hh *HushHistory) (ent.Value, error) { + return hh.Kind, nil + }, + column: hushhistory.FieldKind, + toTerm: hushhistory.ByKind, + toCursor: func(hh *HushHistory) Cursor { + return Cursor{ + ID: hh.ID, + Value: hh.Kind, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f HushHistoryOrderField) String() string { + var str string + switch f.column { + case HushHistoryOrderFieldName.column: + str = "name" + case HushHistoryOrderFieldKind.column: + str = "kind" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f HushHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *HushHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("HushHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *HushHistoryOrderFieldName + case "kind": + *f = *HushHistoryOrderFieldKind + default: + return fmt.Errorf("%s is not a valid HushHistoryOrderField", str) + } + return nil +} + +// HushHistoryOrderField defines the ordering field of HushHistory. +type HushHistoryOrderField struct { + // Value extracts the ordering value from the given HushHistory. + Value func(*HushHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) hushhistory.OrderOption + toCursor func(*HushHistory) Cursor +} + +// HushHistoryOrder defines the ordering of HushHistory. +type HushHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *HushHistoryOrderField `json:"field"` +} + +// DefaultHushHistoryOrder is the default ordering of HushHistory. +var DefaultHushHistoryOrder = &HushHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &HushHistoryOrderField{ + Value: func(hh *HushHistory) (ent.Value, error) { + return hh.ID, nil + }, + column: hushhistory.FieldID, + toTerm: hushhistory.ByID, + toCursor: func(hh *HushHistory) Cursor { + return Cursor{ID: hh.ID} + }, + }, +} + +// ToEdge converts HushHistory into HushHistoryEdge. +func (hh *HushHistory) ToEdge(order *HushHistoryOrder) *HushHistoryEdge { + if order == nil { + order = DefaultHushHistoryOrder + } + return &HushHistoryEdge{ + Node: hh, + Cursor: order.Field.toCursor(hh), + } +} + +// IntegrationEdge is the edge representation of Integration. +type IntegrationEdge struct { + Node *Integration `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// IntegrationConnection is the connection containing edges to Integration. +type IntegrationConnection struct { + Edges []*IntegrationEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *IntegrationConnection) build(nodes []*Integration, pager *integrationPager, 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) *Integration + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Integration { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Integration { + return nodes[i] + } + } + c.Edges = make([]*IntegrationEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &IntegrationEdge{ + 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) + } +} + +// IntegrationPaginateOption enables pagination customization. +type IntegrationPaginateOption func(*integrationPager) error + +// WithIntegrationOrder configures pagination ordering. +func WithIntegrationOrder(order *IntegrationOrder) IntegrationPaginateOption { + if order == nil { + order = DefaultIntegrationOrder + } + o := *order + return func(pager *integrationPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultIntegrationOrder.Field + } + pager.order = &o + return nil + } +} + +// WithIntegrationFilter configures pagination filter. +func WithIntegrationFilter(filter func(*IntegrationQuery) (*IntegrationQuery, error)) IntegrationPaginateOption { + return func(pager *integrationPager) error { + if filter == nil { + return errors.New("IntegrationQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type integrationPager struct { + reverse bool + order *IntegrationOrder + filter func(*IntegrationQuery) (*IntegrationQuery, error) +} + +func newIntegrationPager(opts []IntegrationPaginateOption, reverse bool) (*integrationPager, error) { + pager := &integrationPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultIntegrationOrder + } + return pager, nil +} + +func (p *integrationPager) applyFilter(query *IntegrationQuery) (*IntegrationQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *integrationPager) toCursor(i *Integration) Cursor { + return p.order.Field.toCursor(i) +} + +func (p *integrationPager) applyCursors(query *IntegrationQuery, after, before *Cursor) (*IntegrationQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultIntegrationOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *integrationPager) applyOrder(query *IntegrationQuery) *IntegrationQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultIntegrationOrder.Field { + query = query.Order(DefaultIntegrationOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *integrationPager) orderExpr(query *IntegrationQuery) 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 != DefaultIntegrationOrder.Field { + b.Comma().Ident(DefaultIntegrationOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Integration. +func (i *IntegrationQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...IntegrationPaginateOption, +) (*IntegrationConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newIntegrationPager(opts, last != nil) + if err != nil { + return nil, err + } + if i, err = pager.applyFilter(i); err != nil { + return nil, err + } + conn := &IntegrationConnection{Edges: []*IntegrationEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := i.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 i, err = pager.applyCursors(i, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + i.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := i.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + i = pager.applyOrder(i) + nodes, err := i.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // IntegrationOrderFieldName orders Integration by name. + IntegrationOrderFieldName = &IntegrationOrderField{ + Value: func(i *Integration) (ent.Value, error) { + return i.Name, nil + }, + column: integration.FieldName, + toTerm: integration.ByName, + toCursor: func(i *Integration) Cursor { + return Cursor{ + ID: i.ID, + Value: i.Name, + } + }, + } + // IntegrationOrderFieldKind orders Integration by kind. + IntegrationOrderFieldKind = &IntegrationOrderField{ + Value: func(i *Integration) (ent.Value, error) { + return i.Kind, nil + }, + column: integration.FieldKind, + toTerm: integration.ByKind, + toCursor: func(i *Integration) Cursor { + return Cursor{ + ID: i.ID, + Value: i.Kind, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f IntegrationOrderField) String() string { + var str string + switch f.column { + case IntegrationOrderFieldName.column: + str = "name" + case IntegrationOrderFieldKind.column: + str = "kind" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f IntegrationOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *IntegrationOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("IntegrationOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *IntegrationOrderFieldName + case "kind": + *f = *IntegrationOrderFieldKind + default: + return fmt.Errorf("%s is not a valid IntegrationOrderField", str) + } + return nil +} + +// IntegrationOrderField defines the ordering field of Integration. +type IntegrationOrderField struct { + // Value extracts the ordering value from the given Integration. + Value func(*Integration) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) integration.OrderOption + toCursor func(*Integration) Cursor +} + +// IntegrationOrder defines the ordering of Integration. +type IntegrationOrder struct { + Direction OrderDirection `json:"direction"` + Field *IntegrationOrderField `json:"field"` +} + +// DefaultIntegrationOrder is the default ordering of Integration. +var DefaultIntegrationOrder = &IntegrationOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &IntegrationOrderField{ + Value: func(i *Integration) (ent.Value, error) { + return i.ID, nil + }, + column: integration.FieldID, + toTerm: integration.ByID, + toCursor: func(i *Integration) Cursor { + return Cursor{ID: i.ID} + }, + }, +} + +// ToEdge converts Integration into IntegrationEdge. +func (i *Integration) ToEdge(order *IntegrationOrder) *IntegrationEdge { + if order == nil { + order = DefaultIntegrationOrder + } + return &IntegrationEdge{ + Node: i, + Cursor: order.Field.toCursor(i), + } +} + +// IntegrationHistoryEdge is the edge representation of IntegrationHistory. +type IntegrationHistoryEdge struct { + Node *IntegrationHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// IntegrationHistoryConnection is the connection containing edges to IntegrationHistory. +type IntegrationHistoryConnection struct { + Edges []*IntegrationHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *IntegrationHistoryConnection) build(nodes []*IntegrationHistory, pager *integrationhistoryPager, 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) *IntegrationHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *IntegrationHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *IntegrationHistory { + return nodes[i] + } + } + c.Edges = make([]*IntegrationHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &IntegrationHistoryEdge{ + 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) + } +} + +// IntegrationHistoryPaginateOption enables pagination customization. +type IntegrationHistoryPaginateOption func(*integrationhistoryPager) error + +// WithIntegrationHistoryOrder configures pagination ordering. +func WithIntegrationHistoryOrder(order *IntegrationHistoryOrder) IntegrationHistoryPaginateOption { + if order == nil { + order = DefaultIntegrationHistoryOrder + } + o := *order + return func(pager *integrationhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultIntegrationHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithIntegrationHistoryFilter configures pagination filter. +func WithIntegrationHistoryFilter(filter func(*IntegrationHistoryQuery) (*IntegrationHistoryQuery, error)) IntegrationHistoryPaginateOption { + return func(pager *integrationhistoryPager) error { + if filter == nil { + return errors.New("IntegrationHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type integrationhistoryPager struct { + reverse bool + order *IntegrationHistoryOrder + filter func(*IntegrationHistoryQuery) (*IntegrationHistoryQuery, error) +} + +func newIntegrationHistoryPager(opts []IntegrationHistoryPaginateOption, reverse bool) (*integrationhistoryPager, error) { + pager := &integrationhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultIntegrationHistoryOrder + } + return pager, nil +} + +func (p *integrationhistoryPager) applyFilter(query *IntegrationHistoryQuery) (*IntegrationHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *integrationhistoryPager) toCursor(ih *IntegrationHistory) Cursor { + return p.order.Field.toCursor(ih) +} + +func (p *integrationhistoryPager) applyCursors(query *IntegrationHistoryQuery, after, before *Cursor) (*IntegrationHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultIntegrationHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *integrationhistoryPager) applyOrder(query *IntegrationHistoryQuery) *IntegrationHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultIntegrationHistoryOrder.Field { + query = query.Order(DefaultIntegrationHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *integrationhistoryPager) orderExpr(query *IntegrationHistoryQuery) 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 != DefaultIntegrationHistoryOrder.Field { + b.Comma().Ident(DefaultIntegrationHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to IntegrationHistory. +func (ih *IntegrationHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...IntegrationHistoryPaginateOption, +) (*IntegrationHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newIntegrationHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if ih, err = pager.applyFilter(ih); err != nil { + return nil, err + } + conn := &IntegrationHistoryConnection{Edges: []*IntegrationHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := ih.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 ih, err = pager.applyCursors(ih, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + ih.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ih.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ih = pager.applyOrder(ih) + nodes, err := ih.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // IntegrationHistoryOrderFieldName orders IntegrationHistory by name. + IntegrationHistoryOrderFieldName = &IntegrationHistoryOrderField{ + Value: func(ih *IntegrationHistory) (ent.Value, error) { + return ih.Name, nil + }, + column: integrationhistory.FieldName, + toTerm: integrationhistory.ByName, + toCursor: func(ih *IntegrationHistory) Cursor { + return Cursor{ + ID: ih.ID, + Value: ih.Name, + } + }, + } + // IntegrationHistoryOrderFieldKind orders IntegrationHistory by kind. + IntegrationHistoryOrderFieldKind = &IntegrationHistoryOrderField{ + Value: func(ih *IntegrationHistory) (ent.Value, error) { + return ih.Kind, nil + }, + column: integrationhistory.FieldKind, + toTerm: integrationhistory.ByKind, + toCursor: func(ih *IntegrationHistory) Cursor { + return Cursor{ + ID: ih.ID, + Value: ih.Kind, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f IntegrationHistoryOrderField) String() string { + var str string + switch f.column { + case IntegrationHistoryOrderFieldName.column: + str = "name" + case IntegrationHistoryOrderFieldKind.column: + str = "kind" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f IntegrationHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *IntegrationHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("IntegrationHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *IntegrationHistoryOrderFieldName + case "kind": + *f = *IntegrationHistoryOrderFieldKind + default: + return fmt.Errorf("%s is not a valid IntegrationHistoryOrderField", str) + } + return nil +} + +// IntegrationHistoryOrderField defines the ordering field of IntegrationHistory. +type IntegrationHistoryOrderField struct { + // Value extracts the ordering value from the given IntegrationHistory. + Value func(*IntegrationHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) integrationhistory.OrderOption + toCursor func(*IntegrationHistory) Cursor +} + +// IntegrationHistoryOrder defines the ordering of IntegrationHistory. +type IntegrationHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *IntegrationHistoryOrderField `json:"field"` +} + +// DefaultIntegrationHistoryOrder is the default ordering of IntegrationHistory. +var DefaultIntegrationHistoryOrder = &IntegrationHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &IntegrationHistoryOrderField{ + Value: func(ih *IntegrationHistory) (ent.Value, error) { + return ih.ID, nil + }, + column: integrationhistory.FieldID, + toTerm: integrationhistory.ByID, + toCursor: func(ih *IntegrationHistory) Cursor { + return Cursor{ID: ih.ID} + }, + }, +} + +// ToEdge converts IntegrationHistory into IntegrationHistoryEdge. +func (ih *IntegrationHistory) ToEdge(order *IntegrationHistoryOrder) *IntegrationHistoryEdge { + if order == nil { + order = DefaultIntegrationHistoryOrder + } + return &IntegrationHistoryEdge{ + Node: ih, + Cursor: order.Field.toCursor(ih), + } +} + +// InviteEdge is the edge representation of Invite. +type InviteEdge struct { + Node *Invite `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// InviteConnection is the connection containing edges to Invite. +type InviteConnection struct { + Edges []*InviteEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *InviteConnection) build(nodes []*Invite, pager *invitePager, 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) *Invite + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Invite { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Invite { + return nodes[i] + } + } + c.Edges = make([]*InviteEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &InviteEdge{ + 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) + } +} + +// InvitePaginateOption enables pagination customization. +type InvitePaginateOption func(*invitePager) error + +// WithInviteOrder configures pagination ordering. +func WithInviteOrder(order *InviteOrder) InvitePaginateOption { + if order == nil { + order = DefaultInviteOrder + } + o := *order + return func(pager *invitePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultInviteOrder.Field + } + pager.order = &o + return nil + } +} + +// WithInviteFilter configures pagination filter. +func WithInviteFilter(filter func(*InviteQuery) (*InviteQuery, error)) InvitePaginateOption { + return func(pager *invitePager) error { + if filter == nil { + return errors.New("InviteQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type invitePager struct { + reverse bool + order *InviteOrder + filter func(*InviteQuery) (*InviteQuery, error) +} + +func newInvitePager(opts []InvitePaginateOption, reverse bool) (*invitePager, error) { + pager := &invitePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultInviteOrder + } + return pager, nil +} + +func (p *invitePager) applyFilter(query *InviteQuery) (*InviteQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *invitePager) toCursor(i *Invite) Cursor { + return p.order.Field.toCursor(i) +} + +func (p *invitePager) applyCursors(query *InviteQuery, after, before *Cursor) (*InviteQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultInviteOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *invitePager) applyOrder(query *InviteQuery) *InviteQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultInviteOrder.Field { + query = query.Order(DefaultInviteOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *invitePager) orderExpr(query *InviteQuery) 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 != DefaultInviteOrder.Field { + b.Comma().Ident(DefaultInviteOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Invite. +func (i *InviteQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...InvitePaginateOption, +) (*InviteConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newInvitePager(opts, last != nil) + if err != nil { + return nil, err + } + if i, err = pager.applyFilter(i); err != nil { + return nil, err + } + conn := &InviteConnection{Edges: []*InviteEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := i.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 i, err = pager.applyCursors(i, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + i.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := i.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + i = pager.applyOrder(i) + nodes, err := i.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// InviteOrderField defines the ordering field of Invite. +type InviteOrderField struct { + // Value extracts the ordering value from the given Invite. + Value func(*Invite) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) invite.OrderOption + toCursor func(*Invite) Cursor +} + +// InviteOrder defines the ordering of Invite. +type InviteOrder struct { + Direction OrderDirection `json:"direction"` + Field *InviteOrderField `json:"field"` +} + +// DefaultInviteOrder is the default ordering of Invite. +var DefaultInviteOrder = &InviteOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &InviteOrderField{ + Value: func(i *Invite) (ent.Value, error) { + return i.ID, nil + }, + column: invite.FieldID, + toTerm: invite.ByID, + toCursor: func(i *Invite) Cursor { + return Cursor{ID: i.ID} + }, + }, +} + +// ToEdge converts Invite into InviteEdge. +func (i *Invite) ToEdge(order *InviteOrder) *InviteEdge { + if order == nil { + order = DefaultInviteOrder + } + return &InviteEdge{ + Node: i, + Cursor: order.Field.toCursor(i), + } +} + +// NoteEdge is the edge representation of Note. +type NoteEdge struct { + Node *Note `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// NoteConnection is the connection containing edges to Note. +type NoteConnection struct { + Edges []*NoteEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *NoteConnection) build(nodes []*Note, pager *notePager, 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) *Note + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Note { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Note { + return nodes[i] + } + } + c.Edges = make([]*NoteEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &NoteEdge{ + 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) + } +} + +// NotePaginateOption enables pagination customization. +type NotePaginateOption func(*notePager) error + +// WithNoteOrder configures pagination ordering. +func WithNoteOrder(order *NoteOrder) NotePaginateOption { + if order == nil { + order = DefaultNoteOrder + } + o := *order + return func(pager *notePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultNoteOrder.Field + } + pager.order = &o + return nil + } +} + +// WithNoteFilter configures pagination filter. +func WithNoteFilter(filter func(*NoteQuery) (*NoteQuery, error)) NotePaginateOption { + return func(pager *notePager) error { + if filter == nil { + return errors.New("NoteQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type notePager struct { + reverse bool + order *NoteOrder + filter func(*NoteQuery) (*NoteQuery, error) +} + +func newNotePager(opts []NotePaginateOption, reverse bool) (*notePager, error) { + pager := ¬ePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultNoteOrder + } + return pager, nil +} + +func (p *notePager) applyFilter(query *NoteQuery) (*NoteQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *notePager) toCursor(n *Note) Cursor { + return p.order.Field.toCursor(n) +} + +func (p *notePager) applyCursors(query *NoteQuery, after, before *Cursor) (*NoteQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultNoteOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *notePager) applyOrder(query *NoteQuery) *NoteQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultNoteOrder.Field { + query = query.Order(DefaultNoteOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *notePager) orderExpr(query *NoteQuery) 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 != DefaultNoteOrder.Field { + b.Comma().Ident(DefaultNoteOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Note. +func (n *NoteQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...NotePaginateOption, +) (*NoteConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newNotePager(opts, last != nil) + if err != nil { + return nil, err + } + if n, err = pager.applyFilter(n); err != nil { + return nil, err + } + conn := &NoteConnection{Edges: []*NoteEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := n.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 n, err = pager.applyCursors(n, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + n.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := n.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + n = pager.applyOrder(n) + nodes, err := n.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// NoteOrderField defines the ordering field of Note. +type NoteOrderField struct { + // Value extracts the ordering value from the given Note. + Value func(*Note) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) note.OrderOption + toCursor func(*Note) Cursor +} + +// NoteOrder defines the ordering of Note. +type NoteOrder struct { + Direction OrderDirection `json:"direction"` + Field *NoteOrderField `json:"field"` +} + +// DefaultNoteOrder is the default ordering of Note. +var DefaultNoteOrder = &NoteOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &NoteOrderField{ + Value: func(n *Note) (ent.Value, error) { + return n.ID, nil + }, + column: note.FieldID, + toTerm: note.ByID, + toCursor: func(n *Note) Cursor { + return Cursor{ID: n.ID} + }, + }, +} + +// ToEdge converts Note into NoteEdge. +func (n *Note) ToEdge(order *NoteOrder) *NoteEdge { + if order == nil { + order = DefaultNoteOrder + } + return &NoteEdge{ + Node: n, + Cursor: order.Field.toCursor(n), + } +} + +// NoteHistoryEdge is the edge representation of NoteHistory. +type NoteHistoryEdge struct { + Node *NoteHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// NoteHistoryConnection is the connection containing edges to NoteHistory. +type NoteHistoryConnection struct { + Edges []*NoteHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *NoteHistoryConnection) build(nodes []*NoteHistory, pager *notehistoryPager, 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) *NoteHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *NoteHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *NoteHistory { + return nodes[i] + } + } + c.Edges = make([]*NoteHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &NoteHistoryEdge{ + 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) + } +} + +// NoteHistoryPaginateOption enables pagination customization. +type NoteHistoryPaginateOption func(*notehistoryPager) error + +// WithNoteHistoryOrder configures pagination ordering. +func WithNoteHistoryOrder(order *NoteHistoryOrder) NoteHistoryPaginateOption { + if order == nil { + order = DefaultNoteHistoryOrder + } + o := *order + return func(pager *notehistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultNoteHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithNoteHistoryFilter configures pagination filter. +func WithNoteHistoryFilter(filter func(*NoteHistoryQuery) (*NoteHistoryQuery, error)) NoteHistoryPaginateOption { + return func(pager *notehistoryPager) error { + if filter == nil { + return errors.New("NoteHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type notehistoryPager struct { + reverse bool + order *NoteHistoryOrder + filter func(*NoteHistoryQuery) (*NoteHistoryQuery, error) +} + +func newNoteHistoryPager(opts []NoteHistoryPaginateOption, reverse bool) (*notehistoryPager, error) { + pager := ¬ehistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultNoteHistoryOrder + } + return pager, nil +} + +func (p *notehistoryPager) applyFilter(query *NoteHistoryQuery) (*NoteHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *notehistoryPager) toCursor(nh *NoteHistory) Cursor { + return p.order.Field.toCursor(nh) +} + +func (p *notehistoryPager) applyCursors(query *NoteHistoryQuery, after, before *Cursor) (*NoteHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultNoteHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *notehistoryPager) applyOrder(query *NoteHistoryQuery) *NoteHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultNoteHistoryOrder.Field { + query = query.Order(DefaultNoteHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *notehistoryPager) orderExpr(query *NoteHistoryQuery) 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 != DefaultNoteHistoryOrder.Field { + b.Comma().Ident(DefaultNoteHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to NoteHistory. +func (nh *NoteHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...NoteHistoryPaginateOption, +) (*NoteHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newNoteHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if nh, err = pager.applyFilter(nh); err != nil { + return nil, err + } + conn := &NoteHistoryConnection{Edges: []*NoteHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := nh.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 nh, err = pager.applyCursors(nh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + nh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := nh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + nh = pager.applyOrder(nh) + nodes, err := nh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// NoteHistoryOrderField defines the ordering field of NoteHistory. +type NoteHistoryOrderField struct { + // Value extracts the ordering value from the given NoteHistory. + Value func(*NoteHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) notehistory.OrderOption + toCursor func(*NoteHistory) Cursor +} + +// NoteHistoryOrder defines the ordering of NoteHistory. +type NoteHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *NoteHistoryOrderField `json:"field"` +} + +// DefaultNoteHistoryOrder is the default ordering of NoteHistory. +var DefaultNoteHistoryOrder = &NoteHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &NoteHistoryOrderField{ + Value: func(nh *NoteHistory) (ent.Value, error) { + return nh.ID, nil + }, + column: notehistory.FieldID, + toTerm: notehistory.ByID, + toCursor: func(nh *NoteHistory) Cursor { + return Cursor{ID: nh.ID} + }, + }, +} + +// ToEdge converts NoteHistory into NoteHistoryEdge. +func (nh *NoteHistory) ToEdge(order *NoteHistoryOrder) *NoteHistoryEdge { + if order == nil { + order = DefaultNoteHistoryOrder + } + return &NoteHistoryEdge{ + Node: nh, + Cursor: order.Field.toCursor(nh), + } +} + +// OauthProviderEdge is the edge representation of OauthProvider. +type OauthProviderEdge struct { + Node *OauthProvider `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OauthProviderConnection is the connection containing edges to OauthProvider. +type OauthProviderConnection struct { + Edges []*OauthProviderEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OauthProviderConnection) build(nodes []*OauthProvider, pager *oauthproviderPager, 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) *OauthProvider + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OauthProvider { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OauthProvider { + return nodes[i] + } + } + c.Edges = make([]*OauthProviderEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OauthProviderEdge{ + 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) + } +} + +// OauthProviderPaginateOption enables pagination customization. +type OauthProviderPaginateOption func(*oauthproviderPager) error + +// WithOauthProviderOrder configures pagination ordering. +func WithOauthProviderOrder(order *OauthProviderOrder) OauthProviderPaginateOption { + if order == nil { + order = DefaultOauthProviderOrder + } + o := *order + return func(pager *oauthproviderPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOauthProviderOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOauthProviderFilter configures pagination filter. +func WithOauthProviderFilter(filter func(*OauthProviderQuery) (*OauthProviderQuery, error)) OauthProviderPaginateOption { + return func(pager *oauthproviderPager) error { + if filter == nil { + return errors.New("OauthProviderQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type oauthproviderPager struct { + reverse bool + order *OauthProviderOrder + filter func(*OauthProviderQuery) (*OauthProviderQuery, error) +} + +func newOauthProviderPager(opts []OauthProviderPaginateOption, reverse bool) (*oauthproviderPager, error) { + pager := &oauthproviderPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOauthProviderOrder + } + return pager, nil +} + +func (p *oauthproviderPager) applyFilter(query *OauthProviderQuery) (*OauthProviderQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *oauthproviderPager) toCursor(op *OauthProvider) Cursor { + return p.order.Field.toCursor(op) +} + +func (p *oauthproviderPager) applyCursors(query *OauthProviderQuery, after, before *Cursor) (*OauthProviderQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOauthProviderOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *oauthproviderPager) applyOrder(query *OauthProviderQuery) *OauthProviderQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOauthProviderOrder.Field { + query = query.Order(DefaultOauthProviderOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *oauthproviderPager) orderExpr(query *OauthProviderQuery) 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 != DefaultOauthProviderOrder.Field { + b.Comma().Ident(DefaultOauthProviderOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OauthProvider. +func (op *OauthProviderQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OauthProviderPaginateOption, +) (*OauthProviderConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOauthProviderPager(opts, last != nil) + if err != nil { + return nil, err + } + if op, err = pager.applyFilter(op); err != nil { + return nil, err + } + conn := &OauthProviderConnection{Edges: []*OauthProviderEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := op.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 op, err = pager.applyCursors(op, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + op.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := op.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + op = pager.applyOrder(op) + nodes, err := op.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// OauthProviderOrderField defines the ordering field of OauthProvider. +type OauthProviderOrderField struct { + // Value extracts the ordering value from the given OauthProvider. + Value func(*OauthProvider) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) oauthprovider.OrderOption + toCursor func(*OauthProvider) Cursor +} + +// OauthProviderOrder defines the ordering of OauthProvider. +type OauthProviderOrder struct { + Direction OrderDirection `json:"direction"` + Field *OauthProviderOrderField `json:"field"` +} + +// DefaultOauthProviderOrder is the default ordering of OauthProvider. +var DefaultOauthProviderOrder = &OauthProviderOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OauthProviderOrderField{ + Value: func(op *OauthProvider) (ent.Value, error) { + return op.ID, nil + }, + column: oauthprovider.FieldID, + toTerm: oauthprovider.ByID, + toCursor: func(op *OauthProvider) Cursor { + return Cursor{ID: op.ID} + }, + }, +} + +// ToEdge converts OauthProvider into OauthProviderEdge. +func (op *OauthProvider) ToEdge(order *OauthProviderOrder) *OauthProviderEdge { + if order == nil { + order = DefaultOauthProviderOrder + } + return &OauthProviderEdge{ + Node: op, + Cursor: order.Field.toCursor(op), + } +} + +// OauthProviderHistoryEdge is the edge representation of OauthProviderHistory. +type OauthProviderHistoryEdge struct { + Node *OauthProviderHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OauthProviderHistoryConnection is the connection containing edges to OauthProviderHistory. +type OauthProviderHistoryConnection struct { + Edges []*OauthProviderHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OauthProviderHistoryConnection) build(nodes []*OauthProviderHistory, pager *oauthproviderhistoryPager, 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) *OauthProviderHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OauthProviderHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OauthProviderHistory { + return nodes[i] + } + } + c.Edges = make([]*OauthProviderHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OauthProviderHistoryEdge{ + 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) + } +} + +// OauthProviderHistoryPaginateOption enables pagination customization. +type OauthProviderHistoryPaginateOption func(*oauthproviderhistoryPager) error + +// WithOauthProviderHistoryOrder configures pagination ordering. +func WithOauthProviderHistoryOrder(order *OauthProviderHistoryOrder) OauthProviderHistoryPaginateOption { + if order == nil { + order = DefaultOauthProviderHistoryOrder + } + o := *order + return func(pager *oauthproviderhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOauthProviderHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOauthProviderHistoryFilter configures pagination filter. +func WithOauthProviderHistoryFilter(filter func(*OauthProviderHistoryQuery) (*OauthProviderHistoryQuery, error)) OauthProviderHistoryPaginateOption { + return func(pager *oauthproviderhistoryPager) error { + if filter == nil { + return errors.New("OauthProviderHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type oauthproviderhistoryPager struct { + reverse bool + order *OauthProviderHistoryOrder + filter func(*OauthProviderHistoryQuery) (*OauthProviderHistoryQuery, error) +} + +func newOauthProviderHistoryPager(opts []OauthProviderHistoryPaginateOption, reverse bool) (*oauthproviderhistoryPager, error) { + pager := &oauthproviderhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOauthProviderHistoryOrder + } + return pager, nil +} + +func (p *oauthproviderhistoryPager) applyFilter(query *OauthProviderHistoryQuery) (*OauthProviderHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *oauthproviderhistoryPager) toCursor(oph *OauthProviderHistory) Cursor { + return p.order.Field.toCursor(oph) +} + +func (p *oauthproviderhistoryPager) applyCursors(query *OauthProviderHistoryQuery, after, before *Cursor) (*OauthProviderHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOauthProviderHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *oauthproviderhistoryPager) applyOrder(query *OauthProviderHistoryQuery) *OauthProviderHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOauthProviderHistoryOrder.Field { + query = query.Order(DefaultOauthProviderHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *oauthproviderhistoryPager) orderExpr(query *OauthProviderHistoryQuery) 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 != DefaultOauthProviderHistoryOrder.Field { + b.Comma().Ident(DefaultOauthProviderHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OauthProviderHistory. +func (oph *OauthProviderHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OauthProviderHistoryPaginateOption, +) (*OauthProviderHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOauthProviderHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if oph, err = pager.applyFilter(oph); err != nil { + return nil, err + } + conn := &OauthProviderHistoryConnection{Edges: []*OauthProviderHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := oph.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 oph, err = pager.applyCursors(oph, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + oph.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := oph.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + oph = pager.applyOrder(oph) + nodes, err := oph.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// OauthProviderHistoryOrderField defines the ordering field of OauthProviderHistory. +type OauthProviderHistoryOrderField struct { + // Value extracts the ordering value from the given OauthProviderHistory. + Value func(*OauthProviderHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) oauthproviderhistory.OrderOption + toCursor func(*OauthProviderHistory) Cursor +} + +// OauthProviderHistoryOrder defines the ordering of OauthProviderHistory. +type OauthProviderHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *OauthProviderHistoryOrderField `json:"field"` +} + +// DefaultOauthProviderHistoryOrder is the default ordering of OauthProviderHistory. +var DefaultOauthProviderHistoryOrder = &OauthProviderHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OauthProviderHistoryOrderField{ + Value: func(oph *OauthProviderHistory) (ent.Value, error) { + return oph.ID, nil + }, + column: oauthproviderhistory.FieldID, + toTerm: oauthproviderhistory.ByID, + toCursor: func(oph *OauthProviderHistory) Cursor { + return Cursor{ID: oph.ID} + }, + }, +} + +// ToEdge converts OauthProviderHistory into OauthProviderHistoryEdge. +func (oph *OauthProviderHistory) ToEdge(order *OauthProviderHistoryOrder) *OauthProviderHistoryEdge { + if order == nil { + order = DefaultOauthProviderHistoryOrder + } + return &OauthProviderHistoryEdge{ + Node: oph, + Cursor: order.Field.toCursor(oph), + } +} + +// OhAuthTooTokenEdge is the edge representation of OhAuthTooToken. +type OhAuthTooTokenEdge struct { + Node *OhAuthTooToken `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OhAuthTooTokenConnection is the connection containing edges to OhAuthTooToken. +type OhAuthTooTokenConnection struct { + Edges []*OhAuthTooTokenEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OhAuthTooTokenConnection) build(nodes []*OhAuthTooToken, pager *ohauthtootokenPager, 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) *OhAuthTooToken + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OhAuthTooToken { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OhAuthTooToken { + return nodes[i] + } + } + c.Edges = make([]*OhAuthTooTokenEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OhAuthTooTokenEdge{ + 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) + } +} + +// OhAuthTooTokenPaginateOption enables pagination customization. +type OhAuthTooTokenPaginateOption func(*ohauthtootokenPager) error + +// WithOhAuthTooTokenOrder configures pagination ordering. +func WithOhAuthTooTokenOrder(order *OhAuthTooTokenOrder) OhAuthTooTokenPaginateOption { + if order == nil { + order = DefaultOhAuthTooTokenOrder + } + o := *order + return func(pager *ohauthtootokenPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOhAuthTooTokenOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOhAuthTooTokenFilter configures pagination filter. +func WithOhAuthTooTokenFilter(filter func(*OhAuthTooTokenQuery) (*OhAuthTooTokenQuery, error)) OhAuthTooTokenPaginateOption { + return func(pager *ohauthtootokenPager) error { + if filter == nil { + return errors.New("OhAuthTooTokenQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type ohauthtootokenPager struct { + reverse bool + order *OhAuthTooTokenOrder + filter func(*OhAuthTooTokenQuery) (*OhAuthTooTokenQuery, error) +} + +func newOhAuthTooTokenPager(opts []OhAuthTooTokenPaginateOption, reverse bool) (*ohauthtootokenPager, error) { + pager := &ohauthtootokenPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOhAuthTooTokenOrder + } + return pager, nil +} + +func (p *ohauthtootokenPager) applyFilter(query *OhAuthTooTokenQuery) (*OhAuthTooTokenQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *ohauthtootokenPager) toCursor(oatt *OhAuthTooToken) Cursor { + return p.order.Field.toCursor(oatt) +} + +func (p *ohauthtootokenPager) applyCursors(query *OhAuthTooTokenQuery, after, before *Cursor) (*OhAuthTooTokenQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOhAuthTooTokenOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *ohauthtootokenPager) applyOrder(query *OhAuthTooTokenQuery) *OhAuthTooTokenQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOhAuthTooTokenOrder.Field { + query = query.Order(DefaultOhAuthTooTokenOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *ohauthtootokenPager) orderExpr(query *OhAuthTooTokenQuery) 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 != DefaultOhAuthTooTokenOrder.Field { + b.Comma().Ident(DefaultOhAuthTooTokenOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OhAuthTooToken. +func (oatt *OhAuthTooTokenQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OhAuthTooTokenPaginateOption, +) (*OhAuthTooTokenConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOhAuthTooTokenPager(opts, last != nil) + if err != nil { + return nil, err + } + if oatt, err = pager.applyFilter(oatt); err != nil { + return nil, err + } + conn := &OhAuthTooTokenConnection{Edges: []*OhAuthTooTokenEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := oatt.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 oatt, err = pager.applyCursors(oatt, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + oatt.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := oatt.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + oatt = pager.applyOrder(oatt) + nodes, err := oatt.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// OhAuthTooTokenOrderField defines the ordering field of OhAuthTooToken. +type OhAuthTooTokenOrderField struct { + // Value extracts the ordering value from the given OhAuthTooToken. + Value func(*OhAuthTooToken) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) ohauthtootoken.OrderOption + toCursor func(*OhAuthTooToken) Cursor +} + +// OhAuthTooTokenOrder defines the ordering of OhAuthTooToken. +type OhAuthTooTokenOrder struct { + Direction OrderDirection `json:"direction"` + Field *OhAuthTooTokenOrderField `json:"field"` +} + +// DefaultOhAuthTooTokenOrder is the default ordering of OhAuthTooToken. +var DefaultOhAuthTooTokenOrder = &OhAuthTooTokenOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OhAuthTooTokenOrderField{ + Value: func(oatt *OhAuthTooToken) (ent.Value, error) { + return oatt.ID, nil + }, + column: ohauthtootoken.FieldID, + toTerm: ohauthtootoken.ByID, + toCursor: func(oatt *OhAuthTooToken) Cursor { + return Cursor{ID: oatt.ID} + }, + }, +} + +// ToEdge converts OhAuthTooToken into OhAuthTooTokenEdge. +func (oatt *OhAuthTooToken) ToEdge(order *OhAuthTooTokenOrder) *OhAuthTooTokenEdge { + if order == nil { + order = DefaultOhAuthTooTokenOrder + } + return &OhAuthTooTokenEdge{ + Node: oatt, + Cursor: order.Field.toCursor(oatt), + } +} + +// OrgMembershipEdge is the edge representation of OrgMembership. +type OrgMembershipEdge struct { + Node *OrgMembership `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OrgMembershipConnection is the connection containing edges to OrgMembership. +type OrgMembershipConnection struct { + Edges []*OrgMembershipEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OrgMembershipConnection) build(nodes []*OrgMembership, pager *orgmembershipPager, 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) *OrgMembership + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OrgMembership { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OrgMembership { + return nodes[i] + } + } + c.Edges = make([]*OrgMembershipEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OrgMembershipEdge{ + 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) + } +} + +// OrgMembershipPaginateOption enables pagination customization. +type OrgMembershipPaginateOption func(*orgmembershipPager) error + +// WithOrgMembershipOrder configures pagination ordering. +func WithOrgMembershipOrder(order *OrgMembershipOrder) OrgMembershipPaginateOption { + if order == nil { + order = DefaultOrgMembershipOrder + } + o := *order + return func(pager *orgmembershipPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOrgMembershipOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOrgMembershipFilter configures pagination filter. +func WithOrgMembershipFilter(filter func(*OrgMembershipQuery) (*OrgMembershipQuery, error)) OrgMembershipPaginateOption { + return func(pager *orgmembershipPager) error { + if filter == nil { + return errors.New("OrgMembershipQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type orgmembershipPager struct { + reverse bool + order *OrgMembershipOrder + filter func(*OrgMembershipQuery) (*OrgMembershipQuery, error) +} + +func newOrgMembershipPager(opts []OrgMembershipPaginateOption, reverse bool) (*orgmembershipPager, error) { + pager := &orgmembershipPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOrgMembershipOrder + } + return pager, nil +} + +func (p *orgmembershipPager) applyFilter(query *OrgMembershipQuery) (*OrgMembershipQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *orgmembershipPager) toCursor(om *OrgMembership) Cursor { + return p.order.Field.toCursor(om) +} + +func (p *orgmembershipPager) applyCursors(query *OrgMembershipQuery, after, before *Cursor) (*OrgMembershipQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOrgMembershipOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *orgmembershipPager) applyOrder(query *OrgMembershipQuery) *OrgMembershipQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOrgMembershipOrder.Field { + query = query.Order(DefaultOrgMembershipOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *orgmembershipPager) orderExpr(query *OrgMembershipQuery) 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 != DefaultOrgMembershipOrder.Field { + b.Comma().Ident(DefaultOrgMembershipOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OrgMembership. +func (om *OrgMembershipQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OrgMembershipPaginateOption, +) (*OrgMembershipConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOrgMembershipPager(opts, last != nil) + if err != nil { + return nil, err + } + if om, err = pager.applyFilter(om); err != nil { + return nil, err + } + conn := &OrgMembershipConnection{Edges: []*OrgMembershipEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := om.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 om, err = pager.applyCursors(om, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + om.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := om.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + om = pager.applyOrder(om) + nodes, err := om.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// OrgMembershipOrderField defines the ordering field of OrgMembership. +type OrgMembershipOrderField struct { + // Value extracts the ordering value from the given OrgMembership. + Value func(*OrgMembership) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) orgmembership.OrderOption + toCursor func(*OrgMembership) Cursor +} + +// OrgMembershipOrder defines the ordering of OrgMembership. +type OrgMembershipOrder struct { + Direction OrderDirection `json:"direction"` + Field *OrgMembershipOrderField `json:"field"` +} + +// DefaultOrgMembershipOrder is the default ordering of OrgMembership. +var DefaultOrgMembershipOrder = &OrgMembershipOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OrgMembershipOrderField{ + Value: func(om *OrgMembership) (ent.Value, error) { + return om.ID, nil + }, + column: orgmembership.FieldID, + toTerm: orgmembership.ByID, + toCursor: func(om *OrgMembership) Cursor { + return Cursor{ID: om.ID} + }, + }, +} + +// ToEdge converts OrgMembership into OrgMembershipEdge. +func (om *OrgMembership) ToEdge(order *OrgMembershipOrder) *OrgMembershipEdge { + if order == nil { + order = DefaultOrgMembershipOrder + } + return &OrgMembershipEdge{ + Node: om, + Cursor: order.Field.toCursor(om), + } +} + +// OrgMembershipHistoryEdge is the edge representation of OrgMembershipHistory. +type OrgMembershipHistoryEdge struct { + Node *OrgMembershipHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OrgMembershipHistoryConnection is the connection containing edges to OrgMembershipHistory. +type OrgMembershipHistoryConnection struct { + Edges []*OrgMembershipHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OrgMembershipHistoryConnection) build(nodes []*OrgMembershipHistory, pager *orgmembershiphistoryPager, 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) *OrgMembershipHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OrgMembershipHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OrgMembershipHistory { + return nodes[i] + } + } + c.Edges = make([]*OrgMembershipHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OrgMembershipHistoryEdge{ + 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) + } +} + +// OrgMembershipHistoryPaginateOption enables pagination customization. +type OrgMembershipHistoryPaginateOption func(*orgmembershiphistoryPager) error + +// WithOrgMembershipHistoryOrder configures pagination ordering. +func WithOrgMembershipHistoryOrder(order *OrgMembershipHistoryOrder) OrgMembershipHistoryPaginateOption { + if order == nil { + order = DefaultOrgMembershipHistoryOrder + } + o := *order + return func(pager *orgmembershiphistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOrgMembershipHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOrgMembershipHistoryFilter configures pagination filter. +func WithOrgMembershipHistoryFilter(filter func(*OrgMembershipHistoryQuery) (*OrgMembershipHistoryQuery, error)) OrgMembershipHistoryPaginateOption { + return func(pager *orgmembershiphistoryPager) error { + if filter == nil { + return errors.New("OrgMembershipHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type orgmembershiphistoryPager struct { + reverse bool + order *OrgMembershipHistoryOrder + filter func(*OrgMembershipHistoryQuery) (*OrgMembershipHistoryQuery, error) +} + +func newOrgMembershipHistoryPager(opts []OrgMembershipHistoryPaginateOption, reverse bool) (*orgmembershiphistoryPager, error) { + pager := &orgmembershiphistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOrgMembershipHistoryOrder + } + return pager, nil +} + +func (p *orgmembershiphistoryPager) applyFilter(query *OrgMembershipHistoryQuery) (*OrgMembershipHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *orgmembershiphistoryPager) toCursor(omh *OrgMembershipHistory) Cursor { + return p.order.Field.toCursor(omh) +} + +func (p *orgmembershiphistoryPager) applyCursors(query *OrgMembershipHistoryQuery, after, before *Cursor) (*OrgMembershipHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOrgMembershipHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *orgmembershiphistoryPager) applyOrder(query *OrgMembershipHistoryQuery) *OrgMembershipHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOrgMembershipHistoryOrder.Field { + query = query.Order(DefaultOrgMembershipHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *orgmembershiphistoryPager) orderExpr(query *OrgMembershipHistoryQuery) 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 != DefaultOrgMembershipHistoryOrder.Field { + b.Comma().Ident(DefaultOrgMembershipHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OrgMembershipHistory. +func (omh *OrgMembershipHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OrgMembershipHistoryPaginateOption, +) (*OrgMembershipHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOrgMembershipHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if omh, err = pager.applyFilter(omh); err != nil { + return nil, err + } + conn := &OrgMembershipHistoryConnection{Edges: []*OrgMembershipHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := omh.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 omh, err = pager.applyCursors(omh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + omh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := omh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + omh = pager.applyOrder(omh) + nodes, err := omh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// OrgMembershipHistoryOrderField defines the ordering field of OrgMembershipHistory. +type OrgMembershipHistoryOrderField struct { + // Value extracts the ordering value from the given OrgMembershipHistory. + Value func(*OrgMembershipHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) orgmembershiphistory.OrderOption + toCursor func(*OrgMembershipHistory) Cursor +} + +// OrgMembershipHistoryOrder defines the ordering of OrgMembershipHistory. +type OrgMembershipHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *OrgMembershipHistoryOrderField `json:"field"` +} + +// DefaultOrgMembershipHistoryOrder is the default ordering of OrgMembershipHistory. +var DefaultOrgMembershipHistoryOrder = &OrgMembershipHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OrgMembershipHistoryOrderField{ + Value: func(omh *OrgMembershipHistory) (ent.Value, error) { + return omh.ID, nil + }, + column: orgmembershiphistory.FieldID, + toTerm: orgmembershiphistory.ByID, + toCursor: func(omh *OrgMembershipHistory) Cursor { + return Cursor{ID: omh.ID} + }, + }, +} + +// ToEdge converts OrgMembershipHistory into OrgMembershipHistoryEdge. +func (omh *OrgMembershipHistory) ToEdge(order *OrgMembershipHistoryOrder) *OrgMembershipHistoryEdge { + if order == nil { + order = DefaultOrgMembershipHistoryOrder + } + return &OrgMembershipHistoryEdge{ + Node: omh, + Cursor: order.Field.toCursor(omh), + } +} + +// OrganizationEdge is the edge representation of Organization. +type OrganizationEdge struct { + Node *Organization `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OrganizationConnection is the connection containing edges to Organization. +type OrganizationConnection struct { + Edges []*OrganizationEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OrganizationConnection) build(nodes []*Organization, pager *organizationPager, 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) *Organization + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Organization { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Organization { + return nodes[i] + } + } + c.Edges = make([]*OrganizationEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OrganizationEdge{ + 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) + } +} + +// OrganizationPaginateOption enables pagination customization. +type OrganizationPaginateOption func(*organizationPager) error + +// WithOrganizationOrder configures pagination ordering. +func WithOrganizationOrder(order *OrganizationOrder) OrganizationPaginateOption { + if order == nil { + order = DefaultOrganizationOrder + } + o := *order + return func(pager *organizationPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOrganizationOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOrganizationFilter configures pagination filter. +func WithOrganizationFilter(filter func(*OrganizationQuery) (*OrganizationQuery, error)) OrganizationPaginateOption { + return func(pager *organizationPager) error { + if filter == nil { + return errors.New("OrganizationQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type organizationPager struct { + reverse bool + order *OrganizationOrder + filter func(*OrganizationQuery) (*OrganizationQuery, error) +} + +func newOrganizationPager(opts []OrganizationPaginateOption, reverse bool) (*organizationPager, error) { + pager := &organizationPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOrganizationOrder + } + return pager, nil +} + +func (p *organizationPager) applyFilter(query *OrganizationQuery) (*OrganizationQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *organizationPager) toCursor(o *Organization) Cursor { + return p.order.Field.toCursor(o) +} + +func (p *organizationPager) applyCursors(query *OrganizationQuery, after, before *Cursor) (*OrganizationQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOrganizationOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *organizationPager) applyOrder(query *OrganizationQuery) *OrganizationQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOrganizationOrder.Field { + query = query.Order(DefaultOrganizationOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *organizationPager) orderExpr(query *OrganizationQuery) 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 != DefaultOrganizationOrder.Field { + b.Comma().Ident(DefaultOrganizationOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Organization. +func (o *OrganizationQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OrganizationPaginateOption, +) (*OrganizationConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOrganizationPager(opts, last != nil) + if err != nil { + return nil, err + } + if o, err = pager.applyFilter(o); err != nil { + return nil, err + } + conn := &OrganizationConnection{Edges: []*OrganizationEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := o.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 o, err = pager.applyCursors(o, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + o.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := o.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + o = pager.applyOrder(o) + nodes, err := o.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // OrganizationOrderFieldName orders Organization by name. + OrganizationOrderFieldName = &OrganizationOrderField{ + Value: func(o *Organization) (ent.Value, error) { + return o.Name, nil + }, + column: organization.FieldName, + toTerm: organization.ByName, + toCursor: func(o *Organization) Cursor { + return Cursor{ + ID: o.ID, + Value: o.Name, + } + }, + } + // OrganizationOrderFieldDisplayName orders Organization by display_name. + OrganizationOrderFieldDisplayName = &OrganizationOrderField{ + Value: func(o *Organization) (ent.Value, error) { + return o.DisplayName, nil + }, + column: organization.FieldDisplayName, + toTerm: organization.ByDisplayName, + toCursor: func(o *Organization) Cursor { + return Cursor{ + ID: o.ID, + Value: o.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f OrganizationOrderField) String() string { + var str string + switch f.column { + case OrganizationOrderFieldName.column: + str = "name" + case OrganizationOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f OrganizationOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *OrganizationOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("OrganizationOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *OrganizationOrderFieldName + case "display_name": + *f = *OrganizationOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid OrganizationOrderField", str) + } + return nil +} + +// OrganizationOrderField defines the ordering field of Organization. +type OrganizationOrderField struct { + // Value extracts the ordering value from the given Organization. + Value func(*Organization) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) organization.OrderOption + toCursor func(*Organization) Cursor +} + +// OrganizationOrder defines the ordering of Organization. +type OrganizationOrder struct { + Direction OrderDirection `json:"direction"` + Field *OrganizationOrderField `json:"field"` +} + +// DefaultOrganizationOrder is the default ordering of Organization. +var DefaultOrganizationOrder = &OrganizationOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OrganizationOrderField{ + Value: func(o *Organization) (ent.Value, error) { + return o.ID, nil + }, + column: organization.FieldID, + toTerm: organization.ByID, + toCursor: func(o *Organization) Cursor { + return Cursor{ID: o.ID} + }, + }, +} + +// ToEdge converts Organization into OrganizationEdge. +func (o *Organization) ToEdge(order *OrganizationOrder) *OrganizationEdge { + if order == nil { + order = DefaultOrganizationOrder + } + return &OrganizationEdge{ + Node: o, + Cursor: order.Field.toCursor(o), + } +} + +// OrganizationHistoryEdge is the edge representation of OrganizationHistory. +type OrganizationHistoryEdge struct { + Node *OrganizationHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OrganizationHistoryConnection is the connection containing edges to OrganizationHistory. +type OrganizationHistoryConnection struct { + Edges []*OrganizationHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OrganizationHistoryConnection) build(nodes []*OrganizationHistory, pager *organizationhistoryPager, 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) *OrganizationHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OrganizationHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OrganizationHistory { + return nodes[i] + } + } + c.Edges = make([]*OrganizationHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OrganizationHistoryEdge{ + 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) + } +} + +// OrganizationHistoryPaginateOption enables pagination customization. +type OrganizationHistoryPaginateOption func(*organizationhistoryPager) error + +// WithOrganizationHistoryOrder configures pagination ordering. +func WithOrganizationHistoryOrder(order *OrganizationHistoryOrder) OrganizationHistoryPaginateOption { + if order == nil { + order = DefaultOrganizationHistoryOrder + } + o := *order + return func(pager *organizationhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOrganizationHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOrganizationHistoryFilter configures pagination filter. +func WithOrganizationHistoryFilter(filter func(*OrganizationHistoryQuery) (*OrganizationHistoryQuery, error)) OrganizationHistoryPaginateOption { + return func(pager *organizationhistoryPager) error { + if filter == nil { + return errors.New("OrganizationHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type organizationhistoryPager struct { + reverse bool + order *OrganizationHistoryOrder + filter func(*OrganizationHistoryQuery) (*OrganizationHistoryQuery, error) +} + +func newOrganizationHistoryPager(opts []OrganizationHistoryPaginateOption, reverse bool) (*organizationhistoryPager, error) { + pager := &organizationhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOrganizationHistoryOrder + } + return pager, nil +} + +func (p *organizationhistoryPager) applyFilter(query *OrganizationHistoryQuery) (*OrganizationHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *organizationhistoryPager) toCursor(oh *OrganizationHistory) Cursor { + return p.order.Field.toCursor(oh) +} + +func (p *organizationhistoryPager) applyCursors(query *OrganizationHistoryQuery, after, before *Cursor) (*OrganizationHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOrganizationHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *organizationhistoryPager) applyOrder(query *OrganizationHistoryQuery) *OrganizationHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOrganizationHistoryOrder.Field { + query = query.Order(DefaultOrganizationHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *organizationhistoryPager) orderExpr(query *OrganizationHistoryQuery) 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 != DefaultOrganizationHistoryOrder.Field { + b.Comma().Ident(DefaultOrganizationHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OrganizationHistory. +func (oh *OrganizationHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OrganizationHistoryPaginateOption, +) (*OrganizationHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOrganizationHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if oh, err = pager.applyFilter(oh); err != nil { + return nil, err + } + conn := &OrganizationHistoryConnection{Edges: []*OrganizationHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := oh.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 oh, err = pager.applyCursors(oh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + oh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := oh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + oh = pager.applyOrder(oh) + nodes, err := oh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // OrganizationHistoryOrderFieldName orders OrganizationHistory by name. + OrganizationHistoryOrderFieldName = &OrganizationHistoryOrderField{ + Value: func(oh *OrganizationHistory) (ent.Value, error) { + return oh.Name, nil + }, + column: organizationhistory.FieldName, + toTerm: organizationhistory.ByName, + toCursor: func(oh *OrganizationHistory) Cursor { + return Cursor{ + ID: oh.ID, + Value: oh.Name, + } + }, + } + // OrganizationHistoryOrderFieldDisplayName orders OrganizationHistory by display_name. + OrganizationHistoryOrderFieldDisplayName = &OrganizationHistoryOrderField{ + Value: func(oh *OrganizationHistory) (ent.Value, error) { + return oh.DisplayName, nil + }, + column: organizationhistory.FieldDisplayName, + toTerm: organizationhistory.ByDisplayName, + toCursor: func(oh *OrganizationHistory) Cursor { + return Cursor{ + ID: oh.ID, + Value: oh.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f OrganizationHistoryOrderField) String() string { + var str string + switch f.column { + case OrganizationHistoryOrderFieldName.column: + str = "name" + case OrganizationHistoryOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f OrganizationHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *OrganizationHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("OrganizationHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *OrganizationHistoryOrderFieldName + case "display_name": + *f = *OrganizationHistoryOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid OrganizationHistoryOrderField", str) + } + return nil +} + +// OrganizationHistoryOrderField defines the ordering field of OrganizationHistory. +type OrganizationHistoryOrderField struct { + // Value extracts the ordering value from the given OrganizationHistory. + Value func(*OrganizationHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) organizationhistory.OrderOption + toCursor func(*OrganizationHistory) Cursor +} + +// OrganizationHistoryOrder defines the ordering of OrganizationHistory. +type OrganizationHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *OrganizationHistoryOrderField `json:"field"` +} + +// DefaultOrganizationHistoryOrder is the default ordering of OrganizationHistory. +var DefaultOrganizationHistoryOrder = &OrganizationHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OrganizationHistoryOrderField{ + Value: func(oh *OrganizationHistory) (ent.Value, error) { + return oh.ID, nil + }, + column: organizationhistory.FieldID, + toTerm: organizationhistory.ByID, + toCursor: func(oh *OrganizationHistory) Cursor { + return Cursor{ID: oh.ID} + }, + }, +} + +// ToEdge converts OrganizationHistory into OrganizationHistoryEdge. +func (oh *OrganizationHistory) ToEdge(order *OrganizationHistoryOrder) *OrganizationHistoryEdge { + if order == nil { + order = DefaultOrganizationHistoryOrder + } + return &OrganizationHistoryEdge{ + Node: oh, + Cursor: order.Field.toCursor(oh), + } +} + +// OrganizationSettingEdge is the edge representation of OrganizationSetting. +type OrganizationSettingEdge struct { + Node *OrganizationSetting `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OrganizationSettingConnection is the connection containing edges to OrganizationSetting. +type OrganizationSettingConnection struct { + Edges []*OrganizationSettingEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OrganizationSettingConnection) build(nodes []*OrganizationSetting, pager *organizationsettingPager, 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) *OrganizationSetting + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OrganizationSetting { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OrganizationSetting { + return nodes[i] + } + } + c.Edges = make([]*OrganizationSettingEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OrganizationSettingEdge{ + 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) + } +} + +// OrganizationSettingPaginateOption enables pagination customization. +type OrganizationSettingPaginateOption func(*organizationsettingPager) error + +// WithOrganizationSettingOrder configures pagination ordering. +func WithOrganizationSettingOrder(order *OrganizationSettingOrder) OrganizationSettingPaginateOption { + if order == nil { + order = DefaultOrganizationSettingOrder + } + o := *order + return func(pager *organizationsettingPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOrganizationSettingOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOrganizationSettingFilter configures pagination filter. +func WithOrganizationSettingFilter(filter func(*OrganizationSettingQuery) (*OrganizationSettingQuery, error)) OrganizationSettingPaginateOption { + return func(pager *organizationsettingPager) error { + if filter == nil { + return errors.New("OrganizationSettingQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type organizationsettingPager struct { + reverse bool + order *OrganizationSettingOrder + filter func(*OrganizationSettingQuery) (*OrganizationSettingQuery, error) +} + +func newOrganizationSettingPager(opts []OrganizationSettingPaginateOption, reverse bool) (*organizationsettingPager, error) { + pager := &organizationsettingPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOrganizationSettingOrder + } + return pager, nil +} + +func (p *organizationsettingPager) applyFilter(query *OrganizationSettingQuery) (*OrganizationSettingQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *organizationsettingPager) toCursor(os *OrganizationSetting) Cursor { + return p.order.Field.toCursor(os) +} + +func (p *organizationsettingPager) applyCursors(query *OrganizationSettingQuery, after, before *Cursor) (*OrganizationSettingQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOrganizationSettingOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *organizationsettingPager) applyOrder(query *OrganizationSettingQuery) *OrganizationSettingQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOrganizationSettingOrder.Field { + query = query.Order(DefaultOrganizationSettingOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *organizationsettingPager) orderExpr(query *OrganizationSettingQuery) 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 != DefaultOrganizationSettingOrder.Field { + b.Comma().Ident(DefaultOrganizationSettingOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OrganizationSetting. +func (os *OrganizationSettingQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OrganizationSettingPaginateOption, +) (*OrganizationSettingConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOrganizationSettingPager(opts, last != nil) + if err != nil { + return nil, err + } + if os, err = pager.applyFilter(os); err != nil { + return nil, err + } + conn := &OrganizationSettingConnection{Edges: []*OrganizationSettingEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := os.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 os, err = pager.applyCursors(os, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + os.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := os.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + os = pager.applyOrder(os) + nodes, err := os.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// OrganizationSettingOrderField defines the ordering field of OrganizationSetting. +type OrganizationSettingOrderField struct { + // Value extracts the ordering value from the given OrganizationSetting. + Value func(*OrganizationSetting) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) organizationsetting.OrderOption + toCursor func(*OrganizationSetting) Cursor +} + +// OrganizationSettingOrder defines the ordering of OrganizationSetting. +type OrganizationSettingOrder struct { + Direction OrderDirection `json:"direction"` + Field *OrganizationSettingOrderField `json:"field"` +} + +// DefaultOrganizationSettingOrder is the default ordering of OrganizationSetting. +var DefaultOrganizationSettingOrder = &OrganizationSettingOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OrganizationSettingOrderField{ + Value: func(os *OrganizationSetting) (ent.Value, error) { + return os.ID, nil + }, + column: organizationsetting.FieldID, + toTerm: organizationsetting.ByID, + toCursor: func(os *OrganizationSetting) Cursor { + return Cursor{ID: os.ID} + }, + }, +} + +// ToEdge converts OrganizationSetting into OrganizationSettingEdge. +func (os *OrganizationSetting) ToEdge(order *OrganizationSettingOrder) *OrganizationSettingEdge { + if order == nil { + order = DefaultOrganizationSettingOrder + } + return &OrganizationSettingEdge{ + Node: os, + Cursor: order.Field.toCursor(os), + } +} + +// OrganizationSettingHistoryEdge is the edge representation of OrganizationSettingHistory. +type OrganizationSettingHistoryEdge struct { + Node *OrganizationSettingHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// OrganizationSettingHistoryConnection is the connection containing edges to OrganizationSettingHistory. +type OrganizationSettingHistoryConnection struct { + Edges []*OrganizationSettingHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *OrganizationSettingHistoryConnection) build(nodes []*OrganizationSettingHistory, pager *organizationsettinghistoryPager, 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) *OrganizationSettingHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *OrganizationSettingHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *OrganizationSettingHistory { + return nodes[i] + } + } + c.Edges = make([]*OrganizationSettingHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &OrganizationSettingHistoryEdge{ + 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) + } +} + +// OrganizationSettingHistoryPaginateOption enables pagination customization. +type OrganizationSettingHistoryPaginateOption func(*organizationsettinghistoryPager) error + +// WithOrganizationSettingHistoryOrder configures pagination ordering. +func WithOrganizationSettingHistoryOrder(order *OrganizationSettingHistoryOrder) OrganizationSettingHistoryPaginateOption { + if order == nil { + order = DefaultOrganizationSettingHistoryOrder + } + o := *order + return func(pager *organizationsettinghistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultOrganizationSettingHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithOrganizationSettingHistoryFilter configures pagination filter. +func WithOrganizationSettingHistoryFilter(filter func(*OrganizationSettingHistoryQuery) (*OrganizationSettingHistoryQuery, error)) OrganizationSettingHistoryPaginateOption { + return func(pager *organizationsettinghistoryPager) error { + if filter == nil { + return errors.New("OrganizationSettingHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type organizationsettinghistoryPager struct { + reverse bool + order *OrganizationSettingHistoryOrder + filter func(*OrganizationSettingHistoryQuery) (*OrganizationSettingHistoryQuery, error) +} + +func newOrganizationSettingHistoryPager(opts []OrganizationSettingHistoryPaginateOption, reverse bool) (*organizationsettinghistoryPager, error) { + pager := &organizationsettinghistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultOrganizationSettingHistoryOrder + } + return pager, nil +} + +func (p *organizationsettinghistoryPager) applyFilter(query *OrganizationSettingHistoryQuery) (*OrganizationSettingHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *organizationsettinghistoryPager) toCursor(osh *OrganizationSettingHistory) Cursor { + return p.order.Field.toCursor(osh) +} + +func (p *organizationsettinghistoryPager) applyCursors(query *OrganizationSettingHistoryQuery, after, before *Cursor) (*OrganizationSettingHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultOrganizationSettingHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *organizationsettinghistoryPager) applyOrder(query *OrganizationSettingHistoryQuery) *OrganizationSettingHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultOrganizationSettingHistoryOrder.Field { + query = query.Order(DefaultOrganizationSettingHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *organizationsettinghistoryPager) orderExpr(query *OrganizationSettingHistoryQuery) 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 != DefaultOrganizationSettingHistoryOrder.Field { + b.Comma().Ident(DefaultOrganizationSettingHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to OrganizationSettingHistory. +func (osh *OrganizationSettingHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...OrganizationSettingHistoryPaginateOption, +) (*OrganizationSettingHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newOrganizationSettingHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if osh, err = pager.applyFilter(osh); err != nil { + return nil, err + } + conn := &OrganizationSettingHistoryConnection{Edges: []*OrganizationSettingHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := osh.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 osh, err = pager.applyCursors(osh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + osh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := osh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + osh = pager.applyOrder(osh) + nodes, err := osh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// OrganizationSettingHistoryOrderField defines the ordering field of OrganizationSettingHistory. +type OrganizationSettingHistoryOrderField struct { + // Value extracts the ordering value from the given OrganizationSettingHistory. + Value func(*OrganizationSettingHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) organizationsettinghistory.OrderOption + toCursor func(*OrganizationSettingHistory) Cursor +} + +// OrganizationSettingHistoryOrder defines the ordering of OrganizationSettingHistory. +type OrganizationSettingHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *OrganizationSettingHistoryOrderField `json:"field"` +} + +// DefaultOrganizationSettingHistoryOrder is the default ordering of OrganizationSettingHistory. +var DefaultOrganizationSettingHistoryOrder = &OrganizationSettingHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &OrganizationSettingHistoryOrderField{ + Value: func(osh *OrganizationSettingHistory) (ent.Value, error) { + return osh.ID, nil + }, + column: organizationsettinghistory.FieldID, + toTerm: organizationsettinghistory.ByID, + toCursor: func(osh *OrganizationSettingHistory) Cursor { + return Cursor{ID: osh.ID} + }, + }, +} + +// ToEdge converts OrganizationSettingHistory into OrganizationSettingHistoryEdge. +func (osh *OrganizationSettingHistory) ToEdge(order *OrganizationSettingHistoryOrder) *OrganizationSettingHistoryEdge { + if order == nil { + order = DefaultOrganizationSettingHistoryOrder + } + return &OrganizationSettingHistoryEdge{ + Node: osh, + Cursor: order.Field.toCursor(osh), + } +} + +// PersonalAccessTokenEdge is the edge representation of PersonalAccessToken. +type PersonalAccessTokenEdge struct { + Node *PersonalAccessToken `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// PersonalAccessTokenConnection is the connection containing edges to PersonalAccessToken. +type PersonalAccessTokenConnection struct { + Edges []*PersonalAccessTokenEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *PersonalAccessTokenConnection) build(nodes []*PersonalAccessToken, pager *personalaccesstokenPager, 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) *PersonalAccessToken + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *PersonalAccessToken { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *PersonalAccessToken { + return nodes[i] + } + } + c.Edges = make([]*PersonalAccessTokenEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &PersonalAccessTokenEdge{ + 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) + } +} + +// PersonalAccessTokenPaginateOption enables pagination customization. +type PersonalAccessTokenPaginateOption func(*personalaccesstokenPager) error + +// WithPersonalAccessTokenOrder configures pagination ordering. +func WithPersonalAccessTokenOrder(order *PersonalAccessTokenOrder) PersonalAccessTokenPaginateOption { + if order == nil { + order = DefaultPersonalAccessTokenOrder + } + o := *order + return func(pager *personalaccesstokenPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultPersonalAccessTokenOrder.Field + } + pager.order = &o + return nil + } +} + +// WithPersonalAccessTokenFilter configures pagination filter. +func WithPersonalAccessTokenFilter(filter func(*PersonalAccessTokenQuery) (*PersonalAccessTokenQuery, error)) PersonalAccessTokenPaginateOption { + return func(pager *personalaccesstokenPager) error { + if filter == nil { + return errors.New("PersonalAccessTokenQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type personalaccesstokenPager struct { + reverse bool + order *PersonalAccessTokenOrder + filter func(*PersonalAccessTokenQuery) (*PersonalAccessTokenQuery, error) +} + +func newPersonalAccessTokenPager(opts []PersonalAccessTokenPaginateOption, reverse bool) (*personalaccesstokenPager, error) { + pager := &personalaccesstokenPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultPersonalAccessTokenOrder + } + return pager, nil +} + +func (p *personalaccesstokenPager) applyFilter(query *PersonalAccessTokenQuery) (*PersonalAccessTokenQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *personalaccesstokenPager) toCursor(pat *PersonalAccessToken) Cursor { + return p.order.Field.toCursor(pat) +} + +func (p *personalaccesstokenPager) applyCursors(query *PersonalAccessTokenQuery, after, before *Cursor) (*PersonalAccessTokenQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultPersonalAccessTokenOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *personalaccesstokenPager) applyOrder(query *PersonalAccessTokenQuery) *PersonalAccessTokenQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultPersonalAccessTokenOrder.Field { + query = query.Order(DefaultPersonalAccessTokenOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *personalaccesstokenPager) orderExpr(query *PersonalAccessTokenQuery) 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 != DefaultPersonalAccessTokenOrder.Field { + b.Comma().Ident(DefaultPersonalAccessTokenOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to PersonalAccessToken. +func (pat *PersonalAccessTokenQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...PersonalAccessTokenPaginateOption, +) (*PersonalAccessTokenConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newPersonalAccessTokenPager(opts, last != nil) + if err != nil { + return nil, err + } + if pat, err = pager.applyFilter(pat); err != nil { + return nil, err + } + conn := &PersonalAccessTokenConnection{Edges: []*PersonalAccessTokenEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := pat.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 pat, err = pager.applyCursors(pat, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + pat.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := pat.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + pat = pager.applyOrder(pat) + nodes, err := pat.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// PersonalAccessTokenOrderField defines the ordering field of PersonalAccessToken. +type PersonalAccessTokenOrderField struct { + // Value extracts the ordering value from the given PersonalAccessToken. + Value func(*PersonalAccessToken) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) personalaccesstoken.OrderOption + toCursor func(*PersonalAccessToken) Cursor +} + +// PersonalAccessTokenOrder defines the ordering of PersonalAccessToken. +type PersonalAccessTokenOrder struct { + Direction OrderDirection `json:"direction"` + Field *PersonalAccessTokenOrderField `json:"field"` +} + +// DefaultPersonalAccessTokenOrder is the default ordering of PersonalAccessToken. +var DefaultPersonalAccessTokenOrder = &PersonalAccessTokenOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &PersonalAccessTokenOrderField{ + Value: func(pat *PersonalAccessToken) (ent.Value, error) { + return pat.ID, nil + }, + column: personalaccesstoken.FieldID, + toTerm: personalaccesstoken.ByID, + toCursor: func(pat *PersonalAccessToken) Cursor { + return Cursor{ID: pat.ID} + }, + }, +} + +// ToEdge converts PersonalAccessToken into PersonalAccessTokenEdge. +func (pat *PersonalAccessToken) ToEdge(order *PersonalAccessTokenOrder) *PersonalAccessTokenEdge { + if order == nil { + order = DefaultPersonalAccessTokenOrder + } + return &PersonalAccessTokenEdge{ + Node: pat, + Cursor: order.Field.toCursor(pat), + } +} + +// SubscriberEdge is the edge representation of Subscriber. +type SubscriberEdge struct { + Node *Subscriber `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// SubscriberConnection is the connection containing edges to Subscriber. +type SubscriberConnection struct { + Edges []*SubscriberEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *SubscriberConnection) build(nodes []*Subscriber, pager *subscriberPager, 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) *Subscriber + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Subscriber { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Subscriber { + return nodes[i] + } + } + c.Edges = make([]*SubscriberEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &SubscriberEdge{ + 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) + } +} + +// SubscriberPaginateOption enables pagination customization. +type SubscriberPaginateOption func(*subscriberPager) error + +// WithSubscriberOrder configures pagination ordering. +func WithSubscriberOrder(order *SubscriberOrder) SubscriberPaginateOption { + if order == nil { + order = DefaultSubscriberOrder + } + o := *order + return func(pager *subscriberPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultSubscriberOrder.Field + } + pager.order = &o + return nil + } +} + +// WithSubscriberFilter configures pagination filter. +func WithSubscriberFilter(filter func(*SubscriberQuery) (*SubscriberQuery, error)) SubscriberPaginateOption { + return func(pager *subscriberPager) error { + if filter == nil { + return errors.New("SubscriberQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type subscriberPager struct { + reverse bool + order *SubscriberOrder + filter func(*SubscriberQuery) (*SubscriberQuery, error) +} + +func newSubscriberPager(opts []SubscriberPaginateOption, reverse bool) (*subscriberPager, error) { + pager := &subscriberPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultSubscriberOrder + } + return pager, nil +} + +func (p *subscriberPager) applyFilter(query *SubscriberQuery) (*SubscriberQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *subscriberPager) toCursor(s *Subscriber) Cursor { + return p.order.Field.toCursor(s) +} + +func (p *subscriberPager) applyCursors(query *SubscriberQuery, after, before *Cursor) (*SubscriberQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultSubscriberOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *subscriberPager) applyOrder(query *SubscriberQuery) *SubscriberQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultSubscriberOrder.Field { + query = query.Order(DefaultSubscriberOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *subscriberPager) orderExpr(query *SubscriberQuery) 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 != DefaultSubscriberOrder.Field { + b.Comma().Ident(DefaultSubscriberOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Subscriber. +func (s *SubscriberQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...SubscriberPaginateOption, +) (*SubscriberConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newSubscriberPager(opts, last != nil) + if err != nil { + return nil, err + } + if s, err = pager.applyFilter(s); err != nil { + return nil, err + } + conn := &SubscriberConnection{Edges: []*SubscriberEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := s.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 s, err = pager.applyCursors(s, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + s.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := s.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + s = pager.applyOrder(s) + nodes, err := s.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// SubscriberOrderField defines the ordering field of Subscriber. +type SubscriberOrderField struct { + // Value extracts the ordering value from the given Subscriber. + Value func(*Subscriber) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) subscriber.OrderOption + toCursor func(*Subscriber) Cursor +} + +// SubscriberOrder defines the ordering of Subscriber. +type SubscriberOrder struct { + Direction OrderDirection `json:"direction"` + Field *SubscriberOrderField `json:"field"` +} + +// DefaultSubscriberOrder is the default ordering of Subscriber. +var DefaultSubscriberOrder = &SubscriberOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &SubscriberOrderField{ + Value: func(s *Subscriber) (ent.Value, error) { + return s.ID, nil + }, + column: subscriber.FieldID, + toTerm: subscriber.ByID, + toCursor: func(s *Subscriber) Cursor { + return Cursor{ID: s.ID} + }, + }, +} + +// ToEdge converts Subscriber into SubscriberEdge. +func (s *Subscriber) ToEdge(order *SubscriberOrder) *SubscriberEdge { + if order == nil { + order = DefaultSubscriberOrder + } + return &SubscriberEdge{ + Node: s, + Cursor: order.Field.toCursor(s), + } +} + +// TFASettingEdge is the edge representation of TFASetting. +type TFASettingEdge struct { + Node *TFASetting `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// TFASettingConnection is the connection containing edges to TFASetting. +type TFASettingConnection struct { + Edges []*TFASettingEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *TFASettingConnection) build(nodes []*TFASetting, pager *tfasettingPager, 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) *TFASetting + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *TFASetting { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *TFASetting { + return nodes[i] + } + } + c.Edges = make([]*TFASettingEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &TFASettingEdge{ + 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) + } +} + +// TFASettingPaginateOption enables pagination customization. +type TFASettingPaginateOption func(*tfasettingPager) error + +// WithTFASettingOrder configures pagination ordering. +func WithTFASettingOrder(order *TFASettingOrder) TFASettingPaginateOption { + if order == nil { + order = DefaultTFASettingOrder + } + o := *order + return func(pager *tfasettingPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultTFASettingOrder.Field + } + pager.order = &o + return nil + } +} + +// WithTFASettingFilter configures pagination filter. +func WithTFASettingFilter(filter func(*TFASettingQuery) (*TFASettingQuery, error)) TFASettingPaginateOption { + return func(pager *tfasettingPager) error { + if filter == nil { + return errors.New("TFASettingQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type tfasettingPager struct { + reverse bool + order *TFASettingOrder + filter func(*TFASettingQuery) (*TFASettingQuery, error) +} + +func newTFASettingPager(opts []TFASettingPaginateOption, reverse bool) (*tfasettingPager, error) { + pager := &tfasettingPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultTFASettingOrder + } + return pager, nil +} + +func (p *tfasettingPager) applyFilter(query *TFASettingQuery) (*TFASettingQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *tfasettingPager) toCursor(ts *TFASetting) Cursor { + return p.order.Field.toCursor(ts) +} + +func (p *tfasettingPager) applyCursors(query *TFASettingQuery, after, before *Cursor) (*TFASettingQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultTFASettingOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *tfasettingPager) applyOrder(query *TFASettingQuery) *TFASettingQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultTFASettingOrder.Field { + query = query.Order(DefaultTFASettingOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *tfasettingPager) orderExpr(query *TFASettingQuery) 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 != DefaultTFASettingOrder.Field { + b.Comma().Ident(DefaultTFASettingOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to TFASetting. +func (ts *TFASettingQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...TFASettingPaginateOption, +) (*TFASettingConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newTFASettingPager(opts, last != nil) + if err != nil { + return nil, err + } + if ts, err = pager.applyFilter(ts); err != nil { + return nil, err + } + conn := &TFASettingConnection{Edges: []*TFASettingEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := ts.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 ts, err = pager.applyCursors(ts, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + ts.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ts.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ts = pager.applyOrder(ts) + nodes, err := ts.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// TFASettingOrderField defines the ordering field of TFASetting. +type TFASettingOrderField struct { + // Value extracts the ordering value from the given TFASetting. + Value func(*TFASetting) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) tfasetting.OrderOption + toCursor func(*TFASetting) Cursor +} + +// TFASettingOrder defines the ordering of TFASetting. +type TFASettingOrder struct { + Direction OrderDirection `json:"direction"` + Field *TFASettingOrderField `json:"field"` +} + +// DefaultTFASettingOrder is the default ordering of TFASetting. +var DefaultTFASettingOrder = &TFASettingOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &TFASettingOrderField{ + Value: func(ts *TFASetting) (ent.Value, error) { + return ts.ID, nil + }, + column: tfasetting.FieldID, + toTerm: tfasetting.ByID, + toCursor: func(ts *TFASetting) Cursor { + return Cursor{ID: ts.ID} + }, + }, +} + +// ToEdge converts TFASetting into TFASettingEdge. +func (ts *TFASetting) ToEdge(order *TFASettingOrder) *TFASettingEdge { + if order == nil { + order = DefaultTFASettingOrder + } + return &TFASettingEdge{ + Node: ts, + Cursor: order.Field.toCursor(ts), + } +} + +// TemplateEdge is the edge representation of Template. +type TemplateEdge struct { + Node *Template `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// TemplateConnection is the connection containing edges to Template. +type TemplateConnection struct { + Edges []*TemplateEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *TemplateConnection) build(nodes []*Template, pager *templatePager, 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) *Template + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Template { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Template { + return nodes[i] + } + } + c.Edges = make([]*TemplateEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &TemplateEdge{ + 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) + } +} + +// TemplatePaginateOption enables pagination customization. +type TemplatePaginateOption func(*templatePager) error + +// WithTemplateOrder configures pagination ordering. +func WithTemplateOrder(order *TemplateOrder) TemplatePaginateOption { + if order == nil { + order = DefaultTemplateOrder + } + o := *order + return func(pager *templatePager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultTemplateOrder.Field + } + pager.order = &o + return nil + } +} + +// WithTemplateFilter configures pagination filter. +func WithTemplateFilter(filter func(*TemplateQuery) (*TemplateQuery, error)) TemplatePaginateOption { + return func(pager *templatePager) error { + if filter == nil { + return errors.New("TemplateQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type templatePager struct { + reverse bool + order *TemplateOrder + filter func(*TemplateQuery) (*TemplateQuery, error) +} + +func newTemplatePager(opts []TemplatePaginateOption, reverse bool) (*templatePager, error) { + pager := &templatePager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultTemplateOrder + } + return pager, nil +} + +func (p *templatePager) applyFilter(query *TemplateQuery) (*TemplateQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *templatePager) toCursor(t *Template) Cursor { + return p.order.Field.toCursor(t) +} + +func (p *templatePager) applyCursors(query *TemplateQuery, after, before *Cursor) (*TemplateQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultTemplateOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *templatePager) applyOrder(query *TemplateQuery) *TemplateQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultTemplateOrder.Field { + query = query.Order(DefaultTemplateOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *templatePager) orderExpr(query *TemplateQuery) 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 != DefaultTemplateOrder.Field { + b.Comma().Ident(DefaultTemplateOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Template. +func (t *TemplateQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...TemplatePaginateOption, +) (*TemplateConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newTemplatePager(opts, last != nil) + if err != nil { + return nil, err + } + if t, err = pager.applyFilter(t); err != nil { + return nil, err + } + conn := &TemplateConnection{Edges: []*TemplateEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := t.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 t, err = pager.applyCursors(t, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + t.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := t.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + t = pager.applyOrder(t) + nodes, err := t.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // TemplateOrderFieldName orders Template by name. + TemplateOrderFieldName = &TemplateOrderField{ + Value: func(t *Template) (ent.Value, error) { + return t.Name, nil + }, + column: template.FieldName, + toTerm: template.ByName, + toCursor: func(t *Template) Cursor { + return Cursor{ + ID: t.ID, + Value: t.Name, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f TemplateOrderField) String() string { + var str string + switch f.column { + case TemplateOrderFieldName.column: + str = "name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f TemplateOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *TemplateOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("TemplateOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *TemplateOrderFieldName + default: + return fmt.Errorf("%s is not a valid TemplateOrderField", str) + } + return nil +} + +// TemplateOrderField defines the ordering field of Template. +type TemplateOrderField struct { + // Value extracts the ordering value from the given Template. + Value func(*Template) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) template.OrderOption + toCursor func(*Template) Cursor +} + +// TemplateOrder defines the ordering of Template. +type TemplateOrder struct { + Direction OrderDirection `json:"direction"` + Field *TemplateOrderField `json:"field"` +} + +// DefaultTemplateOrder is the default ordering of Template. +var DefaultTemplateOrder = &TemplateOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &TemplateOrderField{ + Value: func(t *Template) (ent.Value, error) { + return t.ID, nil + }, + column: template.FieldID, + toTerm: template.ByID, + toCursor: func(t *Template) Cursor { + return Cursor{ID: t.ID} + }, + }, +} + +// ToEdge converts Template into TemplateEdge. +func (t *Template) ToEdge(order *TemplateOrder) *TemplateEdge { + if order == nil { + order = DefaultTemplateOrder + } + return &TemplateEdge{ + Node: t, + Cursor: order.Field.toCursor(t), + } +} + +// TemplateHistoryEdge is the edge representation of TemplateHistory. +type TemplateHistoryEdge struct { + Node *TemplateHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// TemplateHistoryConnection is the connection containing edges to TemplateHistory. +type TemplateHistoryConnection struct { + Edges []*TemplateHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *TemplateHistoryConnection) build(nodes []*TemplateHistory, pager *templatehistoryPager, 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) *TemplateHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *TemplateHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *TemplateHistory { + return nodes[i] + } + } + c.Edges = make([]*TemplateHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &TemplateHistoryEdge{ + 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) + } +} + +// TemplateHistoryPaginateOption enables pagination customization. +type TemplateHistoryPaginateOption func(*templatehistoryPager) error + +// WithTemplateHistoryOrder configures pagination ordering. +func WithTemplateHistoryOrder(order *TemplateHistoryOrder) TemplateHistoryPaginateOption { + if order == nil { + order = DefaultTemplateHistoryOrder + } + o := *order + return func(pager *templatehistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultTemplateHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithTemplateHistoryFilter configures pagination filter. +func WithTemplateHistoryFilter(filter func(*TemplateHistoryQuery) (*TemplateHistoryQuery, error)) TemplateHistoryPaginateOption { + return func(pager *templatehistoryPager) error { + if filter == nil { + return errors.New("TemplateHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type templatehistoryPager struct { + reverse bool + order *TemplateHistoryOrder + filter func(*TemplateHistoryQuery) (*TemplateHistoryQuery, error) +} + +func newTemplateHistoryPager(opts []TemplateHistoryPaginateOption, reverse bool) (*templatehistoryPager, error) { + pager := &templatehistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultTemplateHistoryOrder + } + return pager, nil +} + +func (p *templatehistoryPager) applyFilter(query *TemplateHistoryQuery) (*TemplateHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *templatehistoryPager) toCursor(th *TemplateHistory) Cursor { + return p.order.Field.toCursor(th) +} + +func (p *templatehistoryPager) applyCursors(query *TemplateHistoryQuery, after, before *Cursor) (*TemplateHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultTemplateHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *templatehistoryPager) applyOrder(query *TemplateHistoryQuery) *TemplateHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultTemplateHistoryOrder.Field { + query = query.Order(DefaultTemplateHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *templatehistoryPager) orderExpr(query *TemplateHistoryQuery) 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 != DefaultTemplateHistoryOrder.Field { + b.Comma().Ident(DefaultTemplateHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to TemplateHistory. +func (th *TemplateHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...TemplateHistoryPaginateOption, +) (*TemplateHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newTemplateHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if th, err = pager.applyFilter(th); err != nil { + return nil, err + } + conn := &TemplateHistoryConnection{Edges: []*TemplateHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := th.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 th, err = pager.applyCursors(th, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + th.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := th.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + th = pager.applyOrder(th) + nodes, err := th.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // TemplateHistoryOrderFieldName orders TemplateHistory by name. + TemplateHistoryOrderFieldName = &TemplateHistoryOrderField{ + Value: func(th *TemplateHistory) (ent.Value, error) { + return th.Name, nil + }, + column: templatehistory.FieldName, + toTerm: templatehistory.ByName, + toCursor: func(th *TemplateHistory) Cursor { + return Cursor{ + ID: th.ID, + Value: th.Name, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f TemplateHistoryOrderField) String() string { + var str string + switch f.column { + case TemplateHistoryOrderFieldName.column: + str = "name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f TemplateHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *TemplateHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("TemplateHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *TemplateHistoryOrderFieldName + default: + return fmt.Errorf("%s is not a valid TemplateHistoryOrderField", str) + } + return nil +} + +// TemplateHistoryOrderField defines the ordering field of TemplateHistory. +type TemplateHistoryOrderField struct { + // Value extracts the ordering value from the given TemplateHistory. + Value func(*TemplateHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) templatehistory.OrderOption + toCursor func(*TemplateHistory) Cursor +} + +// TemplateHistoryOrder defines the ordering of TemplateHistory. +type TemplateHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *TemplateHistoryOrderField `json:"field"` +} + +// DefaultTemplateHistoryOrder is the default ordering of TemplateHistory. +var DefaultTemplateHistoryOrder = &TemplateHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &TemplateHistoryOrderField{ + Value: func(th *TemplateHistory) (ent.Value, error) { + return th.ID, nil + }, + column: templatehistory.FieldID, + toTerm: templatehistory.ByID, + toCursor: func(th *TemplateHistory) Cursor { + return Cursor{ID: th.ID} + }, + }, +} + +// ToEdge converts TemplateHistory into TemplateHistoryEdge. +func (th *TemplateHistory) ToEdge(order *TemplateHistoryOrder) *TemplateHistoryEdge { + if order == nil { + order = DefaultTemplateHistoryOrder + } + return &TemplateHistoryEdge{ + Node: th, + Cursor: order.Field.toCursor(th), + } +} + +// UserEdge is the edge representation of User. +type UserEdge struct { + Node *User `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// UserConnection is the connection containing edges to User. +type UserConnection struct { + Edges []*UserEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *UserConnection) build(nodes []*User, pager *userPager, 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) *User + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *User { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *User { + return nodes[i] + } + } + c.Edges = make([]*UserEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &UserEdge{ + 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) + } +} + +// UserPaginateOption enables pagination customization. +type UserPaginateOption func(*userPager) error + +// WithUserOrder configures pagination ordering. +func WithUserOrder(order *UserOrder) UserPaginateOption { + if order == nil { + order = DefaultUserOrder + } + o := *order + return func(pager *userPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultUserOrder.Field + } + pager.order = &o + return nil + } +} + +// WithUserFilter configures pagination filter. +func WithUserFilter(filter func(*UserQuery) (*UserQuery, error)) UserPaginateOption { + return func(pager *userPager) error { + if filter == nil { + return errors.New("UserQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type userPager struct { + reverse bool + order *UserOrder + filter func(*UserQuery) (*UserQuery, error) +} + +func newUserPager(opts []UserPaginateOption, reverse bool) (*userPager, error) { + pager := &userPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultUserOrder + } + return pager, nil +} + +func (p *userPager) applyFilter(query *UserQuery) (*UserQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *userPager) toCursor(u *User) Cursor { + return p.order.Field.toCursor(u) +} + +func (p *userPager) applyCursors(query *UserQuery, after, before *Cursor) (*UserQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultUserOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *userPager) applyOrder(query *UserQuery) *UserQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultUserOrder.Field { + query = query.Order(DefaultUserOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *userPager) orderExpr(query *UserQuery) 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 != DefaultUserOrder.Field { + b.Comma().Ident(DefaultUserOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to User. +func (u *UserQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...UserPaginateOption, +) (*UserConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newUserPager(opts, last != nil) + if err != nil { + return nil, err + } + if u, err = pager.applyFilter(u); err != nil { + return nil, err + } + conn := &UserConnection{Edges: []*UserEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := u.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 u, err = pager.applyCursors(u, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + u.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := u.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + u = pager.applyOrder(u) + nodes, err := u.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // UserOrderFieldFirstName orders User by first_name. + UserOrderFieldFirstName = &UserOrderField{ + Value: func(u *User) (ent.Value, error) { + return u.FirstName, nil + }, + column: user.FieldFirstName, + toTerm: user.ByFirstName, + toCursor: func(u *User) Cursor { + return Cursor{ + ID: u.ID, + Value: u.FirstName, + } + }, + } + // UserOrderFieldLastName orders User by last_name. + UserOrderFieldLastName = &UserOrderField{ + Value: func(u *User) (ent.Value, error) { + return u.LastName, nil + }, + column: user.FieldLastName, + toTerm: user.ByLastName, + toCursor: func(u *User) Cursor { + return Cursor{ + ID: u.ID, + Value: u.LastName, + } + }, + } + // UserOrderFieldDisplayName orders User by display_name. + UserOrderFieldDisplayName = &UserOrderField{ + Value: func(u *User) (ent.Value, error) { + return u.DisplayName, nil + }, + column: user.FieldDisplayName, + toTerm: user.ByDisplayName, + toCursor: func(u *User) Cursor { + return Cursor{ + ID: u.ID, + Value: u.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f UserOrderField) String() string { + var str string + switch f.column { + case UserOrderFieldFirstName.column: + str = "first_name" + case UserOrderFieldLastName.column: + str = "last_name" + case UserOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f UserOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *UserOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("UserOrderField %T must be a string", v) + } + switch str { + case "first_name": + *f = *UserOrderFieldFirstName + case "last_name": + *f = *UserOrderFieldLastName + case "display_name": + *f = *UserOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid UserOrderField", str) + } + return nil +} + +// UserOrderField defines the ordering field of User. +type UserOrderField struct { + // Value extracts the ordering value from the given User. + Value func(*User) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) user.OrderOption + toCursor func(*User) Cursor +} + +// UserOrder defines the ordering of User. +type UserOrder struct { + Direction OrderDirection `json:"direction"` + Field *UserOrderField `json:"field"` +} + +// DefaultUserOrder is the default ordering of User. +var DefaultUserOrder = &UserOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &UserOrderField{ + Value: func(u *User) (ent.Value, error) { + return u.ID, nil + }, + column: user.FieldID, + toTerm: user.ByID, + toCursor: func(u *User) Cursor { + return Cursor{ID: u.ID} + }, + }, +} + +// ToEdge converts User into UserEdge. +func (u *User) ToEdge(order *UserOrder) *UserEdge { + if order == nil { + order = DefaultUserOrder + } + return &UserEdge{ + Node: u, + Cursor: order.Field.toCursor(u), + } +} + +// UserHistoryEdge is the edge representation of UserHistory. +type UserHistoryEdge struct { + Node *UserHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// UserHistoryConnection is the connection containing edges to UserHistory. +type UserHistoryConnection struct { + Edges []*UserHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *UserHistoryConnection) build(nodes []*UserHistory, pager *userhistoryPager, 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) *UserHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *UserHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *UserHistory { + return nodes[i] + } + } + c.Edges = make([]*UserHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &UserHistoryEdge{ + 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) + } +} + +// UserHistoryPaginateOption enables pagination customization. +type UserHistoryPaginateOption func(*userhistoryPager) error + +// WithUserHistoryOrder configures pagination ordering. +func WithUserHistoryOrder(order *UserHistoryOrder) UserHistoryPaginateOption { + if order == nil { + order = DefaultUserHistoryOrder + } + o := *order + return func(pager *userhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultUserHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithUserHistoryFilter configures pagination filter. +func WithUserHistoryFilter(filter func(*UserHistoryQuery) (*UserHistoryQuery, error)) UserHistoryPaginateOption { + return func(pager *userhistoryPager) error { + if filter == nil { + return errors.New("UserHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type userhistoryPager struct { + reverse bool + order *UserHistoryOrder + filter func(*UserHistoryQuery) (*UserHistoryQuery, error) +} + +func newUserHistoryPager(opts []UserHistoryPaginateOption, reverse bool) (*userhistoryPager, error) { + pager := &userhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultUserHistoryOrder + } + return pager, nil +} + +func (p *userhistoryPager) applyFilter(query *UserHistoryQuery) (*UserHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *userhistoryPager) toCursor(uh *UserHistory) Cursor { + return p.order.Field.toCursor(uh) +} + +func (p *userhistoryPager) applyCursors(query *UserHistoryQuery, after, before *Cursor) (*UserHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultUserHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *userhistoryPager) applyOrder(query *UserHistoryQuery) *UserHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultUserHistoryOrder.Field { + query = query.Order(DefaultUserHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *userhistoryPager) orderExpr(query *UserHistoryQuery) 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 != DefaultUserHistoryOrder.Field { + b.Comma().Ident(DefaultUserHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to UserHistory. +func (uh *UserHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...UserHistoryPaginateOption, +) (*UserHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newUserHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if uh, err = pager.applyFilter(uh); err != nil { + return nil, err + } + conn := &UserHistoryConnection{Edges: []*UserHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := uh.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 uh, err = pager.applyCursors(uh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + uh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := uh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + uh = pager.applyOrder(uh) + nodes, err := uh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // UserHistoryOrderFieldFirstName orders UserHistory by first_name. + UserHistoryOrderFieldFirstName = &UserHistoryOrderField{ + Value: func(uh *UserHistory) (ent.Value, error) { + return uh.FirstName, nil + }, + column: userhistory.FieldFirstName, + toTerm: userhistory.ByFirstName, + toCursor: func(uh *UserHistory) Cursor { + return Cursor{ + ID: uh.ID, + Value: uh.FirstName, + } + }, + } + // UserHistoryOrderFieldLastName orders UserHistory by last_name. + UserHistoryOrderFieldLastName = &UserHistoryOrderField{ + Value: func(uh *UserHistory) (ent.Value, error) { + return uh.LastName, nil + }, + column: userhistory.FieldLastName, + toTerm: userhistory.ByLastName, + toCursor: func(uh *UserHistory) Cursor { + return Cursor{ + ID: uh.ID, + Value: uh.LastName, + } + }, + } + // UserHistoryOrderFieldDisplayName orders UserHistory by display_name. + UserHistoryOrderFieldDisplayName = &UserHistoryOrderField{ + Value: func(uh *UserHistory) (ent.Value, error) { + return uh.DisplayName, nil + }, + column: userhistory.FieldDisplayName, + toTerm: userhistory.ByDisplayName, + toCursor: func(uh *UserHistory) Cursor { + return Cursor{ + ID: uh.ID, + Value: uh.DisplayName, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f UserHistoryOrderField) String() string { + var str string + switch f.column { + case UserHistoryOrderFieldFirstName.column: + str = "first_name" + case UserHistoryOrderFieldLastName.column: + str = "last_name" + case UserHistoryOrderFieldDisplayName.column: + str = "display_name" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f UserHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *UserHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("UserHistoryOrderField %T must be a string", v) + } + switch str { + case "first_name": + *f = *UserHistoryOrderFieldFirstName + case "last_name": + *f = *UserHistoryOrderFieldLastName + case "display_name": + *f = *UserHistoryOrderFieldDisplayName + default: + return fmt.Errorf("%s is not a valid UserHistoryOrderField", str) + } + return nil +} + +// UserHistoryOrderField defines the ordering field of UserHistory. +type UserHistoryOrderField struct { + // Value extracts the ordering value from the given UserHistory. + Value func(*UserHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) userhistory.OrderOption + toCursor func(*UserHistory) Cursor +} + +// UserHistoryOrder defines the ordering of UserHistory. +type UserHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *UserHistoryOrderField `json:"field"` +} + +// DefaultUserHistoryOrder is the default ordering of UserHistory. +var DefaultUserHistoryOrder = &UserHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &UserHistoryOrderField{ + Value: func(uh *UserHistory) (ent.Value, error) { + return uh.ID, nil + }, + column: userhistory.FieldID, + toTerm: userhistory.ByID, + toCursor: func(uh *UserHistory) Cursor { + return Cursor{ID: uh.ID} + }, + }, +} + +// ToEdge converts UserHistory into UserHistoryEdge. +func (uh *UserHistory) ToEdge(order *UserHistoryOrder) *UserHistoryEdge { + if order == nil { + order = DefaultUserHistoryOrder + } + return &UserHistoryEdge{ + Node: uh, + Cursor: order.Field.toCursor(uh), + } +} + +// UserSettingEdge is the edge representation of UserSetting. +type UserSettingEdge struct { + Node *UserSetting `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// UserSettingConnection is the connection containing edges to UserSetting. +type UserSettingConnection struct { + Edges []*UserSettingEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *UserSettingConnection) build(nodes []*UserSetting, pager *usersettingPager, 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) *UserSetting + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *UserSetting { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *UserSetting { + return nodes[i] + } + } + c.Edges = make([]*UserSettingEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &UserSettingEdge{ + 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) + } +} + +// UserSettingPaginateOption enables pagination customization. +type UserSettingPaginateOption func(*usersettingPager) error + +// WithUserSettingOrder configures pagination ordering. +func WithUserSettingOrder(order *UserSettingOrder) UserSettingPaginateOption { + if order == nil { + order = DefaultUserSettingOrder + } + o := *order + return func(pager *usersettingPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultUserSettingOrder.Field + } + pager.order = &o + return nil + } +} + +// WithUserSettingFilter configures pagination filter. +func WithUserSettingFilter(filter func(*UserSettingQuery) (*UserSettingQuery, error)) UserSettingPaginateOption { + return func(pager *usersettingPager) error { + if filter == nil { + return errors.New("UserSettingQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type usersettingPager struct { + reverse bool + order *UserSettingOrder + filter func(*UserSettingQuery) (*UserSettingQuery, error) +} + +func newUserSettingPager(opts []UserSettingPaginateOption, reverse bool) (*usersettingPager, error) { + pager := &usersettingPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultUserSettingOrder + } + return pager, nil +} + +func (p *usersettingPager) applyFilter(query *UserSettingQuery) (*UserSettingQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *usersettingPager) toCursor(us *UserSetting) Cursor { + return p.order.Field.toCursor(us) +} + +func (p *usersettingPager) applyCursors(query *UserSettingQuery, after, before *Cursor) (*UserSettingQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultUserSettingOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *usersettingPager) applyOrder(query *UserSettingQuery) *UserSettingQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultUserSettingOrder.Field { + query = query.Order(DefaultUserSettingOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *usersettingPager) orderExpr(query *UserSettingQuery) 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 != DefaultUserSettingOrder.Field { + b.Comma().Ident(DefaultUserSettingOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to UserSetting. +func (us *UserSettingQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...UserSettingPaginateOption, +) (*UserSettingConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newUserSettingPager(opts, last != nil) + if err != nil { + return nil, err + } + if us, err = pager.applyFilter(us); err != nil { + return nil, err + } + conn := &UserSettingConnection{Edges: []*UserSettingEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := us.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 us, err = pager.applyCursors(us, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + us.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := us.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + us = pager.applyOrder(us) + nodes, err := us.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// UserSettingOrderField defines the ordering field of UserSetting. +type UserSettingOrderField struct { + // Value extracts the ordering value from the given UserSetting. + Value func(*UserSetting) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) usersetting.OrderOption + toCursor func(*UserSetting) Cursor +} + +// UserSettingOrder defines the ordering of UserSetting. +type UserSettingOrder struct { + Direction OrderDirection `json:"direction"` + Field *UserSettingOrderField `json:"field"` +} + +// DefaultUserSettingOrder is the default ordering of UserSetting. +var DefaultUserSettingOrder = &UserSettingOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &UserSettingOrderField{ + Value: func(us *UserSetting) (ent.Value, error) { + return us.ID, nil + }, + column: usersetting.FieldID, + toTerm: usersetting.ByID, + toCursor: func(us *UserSetting) Cursor { + return Cursor{ID: us.ID} + }, + }, +} + +// ToEdge converts UserSetting into UserSettingEdge. +func (us *UserSetting) ToEdge(order *UserSettingOrder) *UserSettingEdge { + if order == nil { + order = DefaultUserSettingOrder + } + return &UserSettingEdge{ + Node: us, + Cursor: order.Field.toCursor(us), + } +} + +// UserSettingHistoryEdge is the edge representation of UserSettingHistory. +type UserSettingHistoryEdge struct { + Node *UserSettingHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// UserSettingHistoryConnection is the connection containing edges to UserSettingHistory. +type UserSettingHistoryConnection struct { + Edges []*UserSettingHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *UserSettingHistoryConnection) build(nodes []*UserSettingHistory, pager *usersettinghistoryPager, 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) *UserSettingHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *UserSettingHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *UserSettingHistory { + return nodes[i] + } + } + c.Edges = make([]*UserSettingHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &UserSettingHistoryEdge{ + 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) + } +} + +// UserSettingHistoryPaginateOption enables pagination customization. +type UserSettingHistoryPaginateOption func(*usersettinghistoryPager) error + +// WithUserSettingHistoryOrder configures pagination ordering. +func WithUserSettingHistoryOrder(order *UserSettingHistoryOrder) UserSettingHistoryPaginateOption { + if order == nil { + order = DefaultUserSettingHistoryOrder + } + o := *order + return func(pager *usersettinghistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultUserSettingHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithUserSettingHistoryFilter configures pagination filter. +func WithUserSettingHistoryFilter(filter func(*UserSettingHistoryQuery) (*UserSettingHistoryQuery, error)) UserSettingHistoryPaginateOption { + return func(pager *usersettinghistoryPager) error { + if filter == nil { + return errors.New("UserSettingHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type usersettinghistoryPager struct { + reverse bool + order *UserSettingHistoryOrder + filter func(*UserSettingHistoryQuery) (*UserSettingHistoryQuery, error) +} + +func newUserSettingHistoryPager(opts []UserSettingHistoryPaginateOption, reverse bool) (*usersettinghistoryPager, error) { + pager := &usersettinghistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultUserSettingHistoryOrder + } + return pager, nil +} + +func (p *usersettinghistoryPager) applyFilter(query *UserSettingHistoryQuery) (*UserSettingHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *usersettinghistoryPager) toCursor(ush *UserSettingHistory) Cursor { + return p.order.Field.toCursor(ush) +} + +func (p *usersettinghistoryPager) applyCursors(query *UserSettingHistoryQuery, after, before *Cursor) (*UserSettingHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultUserSettingHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *usersettinghistoryPager) applyOrder(query *UserSettingHistoryQuery) *UserSettingHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultUserSettingHistoryOrder.Field { + query = query.Order(DefaultUserSettingHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *usersettinghistoryPager) orderExpr(query *UserSettingHistoryQuery) 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 != DefaultUserSettingHistoryOrder.Field { + b.Comma().Ident(DefaultUserSettingHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to UserSettingHistory. +func (ush *UserSettingHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...UserSettingHistoryPaginateOption, +) (*UserSettingHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newUserSettingHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if ush, err = pager.applyFilter(ush); err != nil { + return nil, err + } + conn := &UserSettingHistoryConnection{Edges: []*UserSettingHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := ush.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 ush, err = pager.applyCursors(ush, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + ush.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := ush.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + ush = pager.applyOrder(ush) + nodes, err := ush.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +// UserSettingHistoryOrderField defines the ordering field of UserSettingHistory. +type UserSettingHistoryOrderField struct { + // Value extracts the ordering value from the given UserSettingHistory. + Value func(*UserSettingHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) usersettinghistory.OrderOption + toCursor func(*UserSettingHistory) Cursor +} + +// UserSettingHistoryOrder defines the ordering of UserSettingHistory. +type UserSettingHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *UserSettingHistoryOrderField `json:"field"` +} + +// DefaultUserSettingHistoryOrder is the default ordering of UserSettingHistory. +var DefaultUserSettingHistoryOrder = &UserSettingHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &UserSettingHistoryOrderField{ + Value: func(ush *UserSettingHistory) (ent.Value, error) { + return ush.ID, nil + }, + column: usersettinghistory.FieldID, + toTerm: usersettinghistory.ByID, + toCursor: func(ush *UserSettingHistory) Cursor { + return Cursor{ID: ush.ID} + }, + }, +} + +// ToEdge converts UserSettingHistory into UserSettingHistoryEdge. +func (ush *UserSettingHistory) ToEdge(order *UserSettingHistoryOrder) *UserSettingHistoryEdge { + if order == nil { + order = DefaultUserSettingHistoryOrder + } + return &UserSettingHistoryEdge{ + Node: ush, + Cursor: order.Field.toCursor(ush), + } +} + +// WebhookEdge is the edge representation of Webhook. +type WebhookEdge struct { + Node *Webhook `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// WebhookConnection is the connection containing edges to Webhook. +type WebhookConnection struct { + Edges []*WebhookEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *WebhookConnection) build(nodes []*Webhook, pager *webhookPager, 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) *Webhook + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *Webhook { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *Webhook { + return nodes[i] + } + } + c.Edges = make([]*WebhookEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &WebhookEdge{ + 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) + } +} + +// WebhookPaginateOption enables pagination customization. +type WebhookPaginateOption func(*webhookPager) error + +// WithWebhookOrder configures pagination ordering. +func WithWebhookOrder(order *WebhookOrder) WebhookPaginateOption { + if order == nil { + order = DefaultWebhookOrder + } + o := *order + return func(pager *webhookPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultWebhookOrder.Field + } + pager.order = &o + return nil + } +} + +// WithWebhookFilter configures pagination filter. +func WithWebhookFilter(filter func(*WebhookQuery) (*WebhookQuery, error)) WebhookPaginateOption { + return func(pager *webhookPager) error { + if filter == nil { + return errors.New("WebhookQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type webhookPager struct { + reverse bool + order *WebhookOrder + filter func(*WebhookQuery) (*WebhookQuery, error) +} + +func newWebhookPager(opts []WebhookPaginateOption, reverse bool) (*webhookPager, error) { + pager := &webhookPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultWebhookOrder + } + return pager, nil +} + +func (p *webhookPager) applyFilter(query *WebhookQuery) (*WebhookQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *webhookPager) toCursor(w *Webhook) Cursor { + return p.order.Field.toCursor(w) +} + +func (p *webhookPager) applyCursors(query *WebhookQuery, after, before *Cursor) (*WebhookQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultWebhookOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *webhookPager) applyOrder(query *WebhookQuery) *WebhookQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultWebhookOrder.Field { + query = query.Order(DefaultWebhookOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *webhookPager) orderExpr(query *WebhookQuery) 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 != DefaultWebhookOrder.Field { + b.Comma().Ident(DefaultWebhookOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to Webhook. +func (w *WebhookQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...WebhookPaginateOption, +) (*WebhookConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newWebhookPager(opts, last != nil) + if err != nil { + return nil, err + } + if w, err = pager.applyFilter(w); err != nil { + return nil, err + } + conn := &WebhookConnection{Edges: []*WebhookEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := w.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 w, err = pager.applyCursors(w, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + w.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := w.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + w = pager.applyOrder(w) + nodes, err := w.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // WebhookOrderFieldName orders Webhook by name. + WebhookOrderFieldName = &WebhookOrderField{ + Value: func(w *Webhook) (ent.Value, error) { + return w.Name, nil + }, + column: webhook.FieldName, + toTerm: webhook.ByName, + toCursor: func(w *Webhook) Cursor { + return Cursor{ + ID: w.ID, + Value: w.Name, + } + }, + } + // WebhookOrderFieldDestinationURL orders Webhook by destination_url. + WebhookOrderFieldDestinationURL = &WebhookOrderField{ + Value: func(w *Webhook) (ent.Value, error) { + return w.DestinationURL, nil + }, + column: webhook.FieldDestinationURL, + toTerm: webhook.ByDestinationURL, + toCursor: func(w *Webhook) Cursor { + return Cursor{ + ID: w.ID, + Value: w.DestinationURL, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f WebhookOrderField) String() string { + var str string + switch f.column { + case WebhookOrderFieldName.column: + str = "name" + case WebhookOrderFieldDestinationURL.column: + str = "url" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f WebhookOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *WebhookOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("WebhookOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *WebhookOrderFieldName + case "url": + *f = *WebhookOrderFieldDestinationURL + default: + return fmt.Errorf("%s is not a valid WebhookOrderField", str) + } + return nil +} + +// WebhookOrderField defines the ordering field of Webhook. +type WebhookOrderField struct { + // Value extracts the ordering value from the given Webhook. + Value func(*Webhook) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) webhook.OrderOption + toCursor func(*Webhook) Cursor +} + +// WebhookOrder defines the ordering of Webhook. +type WebhookOrder struct { + Direction OrderDirection `json:"direction"` + Field *WebhookOrderField `json:"field"` +} + +// DefaultWebhookOrder is the default ordering of Webhook. +var DefaultWebhookOrder = &WebhookOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &WebhookOrderField{ + Value: func(w *Webhook) (ent.Value, error) { + return w.ID, nil + }, + column: webhook.FieldID, + toTerm: webhook.ByID, + toCursor: func(w *Webhook) Cursor { + return Cursor{ID: w.ID} + }, + }, +} + +// ToEdge converts Webhook into WebhookEdge. +func (w *Webhook) ToEdge(order *WebhookOrder) *WebhookEdge { + if order == nil { + order = DefaultWebhookOrder + } + return &WebhookEdge{ + Node: w, + Cursor: order.Field.toCursor(w), + } +} + +// WebhookHistoryEdge is the edge representation of WebhookHistory. +type WebhookHistoryEdge struct { + Node *WebhookHistory `json:"node"` + Cursor Cursor `json:"cursor"` +} + +// WebhookHistoryConnection is the connection containing edges to WebhookHistory. +type WebhookHistoryConnection struct { + Edges []*WebhookHistoryEdge `json:"edges"` + PageInfo PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +func (c *WebhookHistoryConnection) build(nodes []*WebhookHistory, pager *webhookhistoryPager, 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) *WebhookHistory + if last != nil { + n := len(nodes) - 1 + nodeAt = func(i int) *WebhookHistory { + return nodes[n-i] + } + } else { + nodeAt = func(i int) *WebhookHistory { + return nodes[i] + } + } + c.Edges = make([]*WebhookHistoryEdge, len(nodes)) + for i := range nodes { + node := nodeAt(i) + c.Edges[i] = &WebhookHistoryEdge{ + 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) + } +} + +// WebhookHistoryPaginateOption enables pagination customization. +type WebhookHistoryPaginateOption func(*webhookhistoryPager) error + +// WithWebhookHistoryOrder configures pagination ordering. +func WithWebhookHistoryOrder(order *WebhookHistoryOrder) WebhookHistoryPaginateOption { + if order == nil { + order = DefaultWebhookHistoryOrder + } + o := *order + return func(pager *webhookhistoryPager) error { + if err := o.Direction.Validate(); err != nil { + return err + } + if o.Field == nil { + o.Field = DefaultWebhookHistoryOrder.Field + } + pager.order = &o + return nil + } +} + +// WithWebhookHistoryFilter configures pagination filter. +func WithWebhookHistoryFilter(filter func(*WebhookHistoryQuery) (*WebhookHistoryQuery, error)) WebhookHistoryPaginateOption { + return func(pager *webhookhistoryPager) error { + if filter == nil { + return errors.New("WebhookHistoryQuery filter cannot be nil") + } + pager.filter = filter + return nil + } +} + +type webhookhistoryPager struct { + reverse bool + order *WebhookHistoryOrder + filter func(*WebhookHistoryQuery) (*WebhookHistoryQuery, error) +} + +func newWebhookHistoryPager(opts []WebhookHistoryPaginateOption, reverse bool) (*webhookhistoryPager, error) { + pager := &webhookhistoryPager{reverse: reverse} + for _, opt := range opts { + if err := opt(pager); err != nil { + return nil, err + } + } + if pager.order == nil { + pager.order = DefaultWebhookHistoryOrder + } + return pager, nil +} + +func (p *webhookhistoryPager) applyFilter(query *WebhookHistoryQuery) (*WebhookHistoryQuery, error) { + if p.filter != nil { + return p.filter(query) + } + return query, nil +} + +func (p *webhookhistoryPager) toCursor(wh *WebhookHistory) Cursor { + return p.order.Field.toCursor(wh) +} + +func (p *webhookhistoryPager) applyCursors(query *WebhookHistoryQuery, after, before *Cursor) (*WebhookHistoryQuery, error) { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + for _, predicate := range entgql.CursorsPredicate(after, before, DefaultWebhookHistoryOrder.Field.column, p.order.Field.column, direction) { + query = query.Where(predicate) + } + return query, nil +} + +func (p *webhookhistoryPager) applyOrder(query *WebhookHistoryQuery) *WebhookHistoryQuery { + direction := p.order.Direction + if p.reverse { + direction = direction.Reverse() + } + query = query.Order(p.order.Field.toTerm(direction.OrderTermOption())) + if p.order.Field != DefaultWebhookHistoryOrder.Field { + query = query.Order(DefaultWebhookHistoryOrder.Field.toTerm(direction.OrderTermOption())) + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(p.order.Field.column) + } + return query +} + +func (p *webhookhistoryPager) orderExpr(query *WebhookHistoryQuery) 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 != DefaultWebhookHistoryOrder.Field { + b.Comma().Ident(DefaultWebhookHistoryOrder.Field.column).Pad().WriteString(string(direction)) + } + }) +} + +// Paginate executes the query and returns a relay based cursor connection to WebhookHistory. +func (wh *WebhookHistoryQuery) Paginate( + ctx context.Context, after *Cursor, first *int, + before *Cursor, last *int, opts ...WebhookHistoryPaginateOption, +) (*WebhookHistoryConnection, error) { + if err := validateFirstLast(first, last); err != nil { + return nil, err + } + pager, err := newWebhookHistoryPager(opts, last != nil) + if err != nil { + return nil, err + } + if wh, err = pager.applyFilter(wh); err != nil { + return nil, err + } + conn := &WebhookHistoryConnection{Edges: []*WebhookHistoryEdge{}} + ignoredEdges := !hasCollectedField(ctx, edgesField) + if hasCollectedField(ctx, totalCountField) || hasCollectedField(ctx, pageInfoField) { + hasPagination := after != nil || first != nil || before != nil || last != nil + if hasPagination || ignoredEdges { + c := wh.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 wh, err = pager.applyCursors(wh, after, before); err != nil { + return nil, err + } + limit := paginateLimit(first, last) + if limit != 0 { + wh.Limit(limit) + } + if field := collectedField(ctx, edgesField, nodeField); field != nil { + if err := wh.collectField(ctx, limit == 1, graphql.GetOperationContext(ctx), *field, []string{edgesField, nodeField}); err != nil { + return nil, err + } + } + wh = pager.applyOrder(wh) + nodes, err := wh.All(ctx) + if err != nil { + return nil, err + } + conn.build(nodes, pager, after, first, before, last) + return conn, nil +} + +var ( + // WebhookHistoryOrderFieldName orders WebhookHistory by name. + WebhookHistoryOrderFieldName = &WebhookHistoryOrderField{ + Value: func(wh *WebhookHistory) (ent.Value, error) { + return wh.Name, nil + }, + column: webhookhistory.FieldName, + toTerm: webhookhistory.ByName, + toCursor: func(wh *WebhookHistory) Cursor { + return Cursor{ + ID: wh.ID, + Value: wh.Name, + } + }, + } + // WebhookHistoryOrderFieldDestinationURL orders WebhookHistory by destination_url. + WebhookHistoryOrderFieldDestinationURL = &WebhookHistoryOrderField{ + Value: func(wh *WebhookHistory) (ent.Value, error) { + return wh.DestinationURL, nil + }, + column: webhookhistory.FieldDestinationURL, + toTerm: webhookhistory.ByDestinationURL, + toCursor: func(wh *WebhookHistory) Cursor { + return Cursor{ + ID: wh.ID, + Value: wh.DestinationURL, + } + }, + } +) + +// String implement fmt.Stringer interface. +func (f WebhookHistoryOrderField) String() string { + var str string + switch f.column { + case WebhookHistoryOrderFieldName.column: + str = "name" + case WebhookHistoryOrderFieldDestinationURL.column: + str = "url" + } + return str +} + +// MarshalGQL implements graphql.Marshaler interface. +func (f WebhookHistoryOrderField) MarshalGQL(w io.Writer) { + io.WriteString(w, strconv.Quote(f.String())) +} + +// UnmarshalGQL implements graphql.Unmarshaler interface. +func (f *WebhookHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("WebhookHistoryOrderField %T must be a string", v) + } + switch str { + case "name": + *f = *WebhookHistoryOrderFieldName + case "url": + *f = *WebhookHistoryOrderFieldDestinationURL + default: + return fmt.Errorf("%s is not a valid WebhookHistoryOrderField", str) + } + return nil +} + +// WebhookHistoryOrderField defines the ordering field of WebhookHistory. +type WebhookHistoryOrderField struct { + // Value extracts the ordering value from the given WebhookHistory. + Value func(*WebhookHistory) (ent.Value, error) + column string // field or computed. + toTerm func(...sql.OrderTermOption) webhookhistory.OrderOption + toCursor func(*WebhookHistory) Cursor +} + +// WebhookHistoryOrder defines the ordering of WebhookHistory. +type WebhookHistoryOrder struct { + Direction OrderDirection `json:"direction"` + Field *WebhookHistoryOrderField `json:"field"` +} + +// DefaultWebhookHistoryOrder is the default ordering of WebhookHistory. +var DefaultWebhookHistoryOrder = &WebhookHistoryOrder{ + Direction: entgql.OrderDirectionAsc, + Field: &WebhookHistoryOrderField{ + Value: func(wh *WebhookHistory) (ent.Value, error) { + return wh.ID, nil + }, + column: webhookhistory.FieldID, + toTerm: webhookhistory.ByID, + toCursor: func(wh *WebhookHistory) Cursor { + return Cursor{ID: wh.ID} + }, + }, +} + +// ToEdge converts WebhookHistory into WebhookHistoryEdge. +func (wh *WebhookHistory) ToEdge(order *WebhookHistoryOrder) *WebhookHistoryEdge { + if order == nil { + order = DefaultWebhookHistoryOrder + } + return &WebhookHistoryEdge{ + Node: wh, + Cursor: order.Field.toCursor(wh), + } +} diff --git a/internal/ent/generated/gql_transaction.go b/internal/ent/generated/gql_transaction.go new file mode 100644 index 0000000..40087a4 --- /dev/null +++ b/internal/ent/generated/gql_transaction.go @@ -0,0 +1,30 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" +) + +// OpenTx opens a transaction and returns a transactional +// context along with the created transaction. +func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error) { + tx, err := c.Tx(ctx) + if err != nil { + return nil, nil, err + } + ctx = NewTxContext(ctx, tx) + ctx = NewContext(ctx, tx.Client()) + return ctx, tx, nil +} + +// OpenTxFromContext open transactions from client stored in context. +func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error) { + client := FromContext(ctx) + if client == nil { + return nil, nil, errors.New("no client attached to context") + } + return client.OpenTx(ctx) +} diff --git a/internal/ent/generated/gql_where_input.go b/internal/ent/generated/gql_where_input.go new file mode 100644 index 0000000..257707e --- /dev/null +++ b/internal/ent/generated/gql_where_input.go @@ -0,0 +1,42740 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "errors" + "fmt" + "time" + + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// APITokenWhereInput represents a where input for filtering APIToken queries. +type APITokenWhereInput struct { + Predicates []predicate.APIToken `json:"-"` + Not *APITokenWhereInput `json:"not,omitempty"` + Or []*APITokenWhereInput `json:"or,omitempty"` + And []*APITokenWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "expires_at" field predicates. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNEQ *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGT *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGTE *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLT *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLTE *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil bool `json:"expiresAtNotNil,omitempty"` + + // "last_used_at" field predicates. + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + LastUsedAtNEQ *time.Time `json:"lastUsedAtNEQ,omitempty"` + LastUsedAtIn []time.Time `json:"lastUsedAtIn,omitempty"` + LastUsedAtNotIn []time.Time `json:"lastUsedAtNotIn,omitempty"` + LastUsedAtGT *time.Time `json:"lastUsedAtGT,omitempty"` + LastUsedAtGTE *time.Time `json:"lastUsedAtGTE,omitempty"` + LastUsedAtLT *time.Time `json:"lastUsedAtLT,omitempty"` + LastUsedAtLTE *time.Time `json:"lastUsedAtLTE,omitempty"` + LastUsedAtIsNil bool `json:"lastUsedAtIsNil,omitempty"` + LastUsedAtNotNil bool `json:"lastUsedAtNotNil,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *APITokenWhereInput) AddPredicates(predicates ...predicate.APIToken) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the APITokenWhereInput filter on the APITokenQuery builder. +func (i *APITokenWhereInput) Filter(q *APITokenQuery) (*APITokenQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyAPITokenWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyAPITokenWhereInput is returned in case the APITokenWhereInput is empty. +var ErrEmptyAPITokenWhereInput = errors.New("generated: empty predicate APITokenWhereInput") + +// P returns a predicate for filtering apitokens. +// An error is returned if the input is empty or invalid. +func (i *APITokenWhereInput) P() (predicate.APIToken, error) { + var predicates []predicate.APIToken + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, apitoken.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.APIToken, 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, apitoken.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.APIToken, 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, apitoken.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, apitoken.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, apitoken.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, apitoken.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, apitoken.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, apitoken.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, apitoken.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, apitoken.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, apitoken.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, apitoken.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, apitoken.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, apitoken.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, apitoken.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, apitoken.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, apitoken.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, apitoken.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, apitoken.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, apitoken.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, apitoken.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, apitoken.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, apitoken.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, apitoken.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, apitoken.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, apitoken.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, apitoken.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, apitoken.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, apitoken.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, apitoken.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, apitoken.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, apitoken.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, apitoken.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, apitoken.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, apitoken.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, apitoken.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, apitoken.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, apitoken.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, apitoken.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, apitoken.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, apitoken.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, apitoken.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, apitoken.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, apitoken.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, apitoken.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, apitoken.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, apitoken.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, apitoken.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, apitoken.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, apitoken.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, apitoken.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, apitoken.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, apitoken.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, apitoken.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, apitoken.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, apitoken.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, apitoken.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, apitoken.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, apitoken.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, apitoken.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, apitoken.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, apitoken.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, apitoken.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, apitoken.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, apitoken.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, apitoken.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, apitoken.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, apitoken.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, apitoken.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, apitoken.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, apitoken.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, apitoken.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, apitoken.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, apitoken.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, apitoken.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, apitoken.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, apitoken.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, apitoken.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, apitoken.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, apitoken.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, apitoken.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, apitoken.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, apitoken.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, apitoken.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, apitoken.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, apitoken.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, apitoken.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, apitoken.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, apitoken.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, apitoken.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, apitoken.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, apitoken.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, apitoken.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, apitoken.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, apitoken.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, apitoken.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, apitoken.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, apitoken.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, apitoken.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, apitoken.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, apitoken.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, apitoken.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, apitoken.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, apitoken.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, apitoken.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, apitoken.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, apitoken.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, apitoken.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, apitoken.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, apitoken.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, apitoken.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, apitoken.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, apitoken.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, apitoken.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, apitoken.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, apitoken.NameContainsFold(*i.NameContainsFold)) + } + if i.ExpiresAt != nil { + predicates = append(predicates, apitoken.ExpiresAtEQ(*i.ExpiresAt)) + } + if i.ExpiresAtNEQ != nil { + predicates = append(predicates, apitoken.ExpiresAtNEQ(*i.ExpiresAtNEQ)) + } + if len(i.ExpiresAtIn) > 0 { + predicates = append(predicates, apitoken.ExpiresAtIn(i.ExpiresAtIn...)) + } + if len(i.ExpiresAtNotIn) > 0 { + predicates = append(predicates, apitoken.ExpiresAtNotIn(i.ExpiresAtNotIn...)) + } + if i.ExpiresAtGT != nil { + predicates = append(predicates, apitoken.ExpiresAtGT(*i.ExpiresAtGT)) + } + if i.ExpiresAtGTE != nil { + predicates = append(predicates, apitoken.ExpiresAtGTE(*i.ExpiresAtGTE)) + } + if i.ExpiresAtLT != nil { + predicates = append(predicates, apitoken.ExpiresAtLT(*i.ExpiresAtLT)) + } + if i.ExpiresAtLTE != nil { + predicates = append(predicates, apitoken.ExpiresAtLTE(*i.ExpiresAtLTE)) + } + if i.ExpiresAtIsNil { + predicates = append(predicates, apitoken.ExpiresAtIsNil()) + } + if i.ExpiresAtNotNil { + predicates = append(predicates, apitoken.ExpiresAtNotNil()) + } + if i.LastUsedAt != nil { + predicates = append(predicates, apitoken.LastUsedAtEQ(*i.LastUsedAt)) + } + if i.LastUsedAtNEQ != nil { + predicates = append(predicates, apitoken.LastUsedAtNEQ(*i.LastUsedAtNEQ)) + } + if len(i.LastUsedAtIn) > 0 { + predicates = append(predicates, apitoken.LastUsedAtIn(i.LastUsedAtIn...)) + } + if len(i.LastUsedAtNotIn) > 0 { + predicates = append(predicates, apitoken.LastUsedAtNotIn(i.LastUsedAtNotIn...)) + } + if i.LastUsedAtGT != nil { + predicates = append(predicates, apitoken.LastUsedAtGT(*i.LastUsedAtGT)) + } + if i.LastUsedAtGTE != nil { + predicates = append(predicates, apitoken.LastUsedAtGTE(*i.LastUsedAtGTE)) + } + if i.LastUsedAtLT != nil { + predicates = append(predicates, apitoken.LastUsedAtLT(*i.LastUsedAtLT)) + } + if i.LastUsedAtLTE != nil { + predicates = append(predicates, apitoken.LastUsedAtLTE(*i.LastUsedAtLTE)) + } + if i.LastUsedAtIsNil { + predicates = append(predicates, apitoken.LastUsedAtIsNil()) + } + if i.LastUsedAtNotNil { + predicates = append(predicates, apitoken.LastUsedAtNotNil()) + } + + if i.HasOwner != nil { + p := apitoken.HasOwner() + if !*i.HasOwner { + p = apitoken.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, apitoken.HasOwnerWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyAPITokenWhereInput + case 1: + return predicates[0], nil + default: + return apitoken.And(predicates...), nil + } +} + +// ContactWhereInput represents a where input for filtering Contact queries. +type ContactWhereInput struct { + Predicates []predicate.Contact `json:"-"` + Not *ContactWhereInput `json:"not,omitempty"` + Or []*ContactWhereInput `json:"or,omitempty"` + And []*ContactWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "full_name" field predicates. + FullName *string `json:"fullName,omitempty"` + FullNameNEQ *string `json:"fullNameNEQ,omitempty"` + FullNameIn []string `json:"fullNameIn,omitempty"` + FullNameNotIn []string `json:"fullNameNotIn,omitempty"` + FullNameGT *string `json:"fullNameGT,omitempty"` + FullNameGTE *string `json:"fullNameGTE,omitempty"` + FullNameLT *string `json:"fullNameLT,omitempty"` + FullNameLTE *string `json:"fullNameLTE,omitempty"` + FullNameContains *string `json:"fullNameContains,omitempty"` + FullNameHasPrefix *string `json:"fullNameHasPrefix,omitempty"` + FullNameHasSuffix *string `json:"fullNameHasSuffix,omitempty"` + FullNameEqualFold *string `json:"fullNameEqualFold,omitempty"` + FullNameContainsFold *string `json:"fullNameContainsFold,omitempty"` + + // "title" field predicates. + Title *string `json:"title,omitempty"` + TitleNEQ *string `json:"titleNEQ,omitempty"` + TitleIn []string `json:"titleIn,omitempty"` + TitleNotIn []string `json:"titleNotIn,omitempty"` + TitleGT *string `json:"titleGT,omitempty"` + TitleGTE *string `json:"titleGTE,omitempty"` + TitleLT *string `json:"titleLT,omitempty"` + TitleLTE *string `json:"titleLTE,omitempty"` + TitleContains *string `json:"titleContains,omitempty"` + TitleHasPrefix *string `json:"titleHasPrefix,omitempty"` + TitleHasSuffix *string `json:"titleHasSuffix,omitempty"` + TitleIsNil bool `json:"titleIsNil,omitempty"` + TitleNotNil bool `json:"titleNotNil,omitempty"` + TitleEqualFold *string `json:"titleEqualFold,omitempty"` + TitleContainsFold *string `json:"titleContainsFold,omitempty"` + + // "company" field predicates. + Company *string `json:"company,omitempty"` + CompanyNEQ *string `json:"companyNEQ,omitempty"` + CompanyIn []string `json:"companyIn,omitempty"` + CompanyNotIn []string `json:"companyNotIn,omitempty"` + CompanyGT *string `json:"companyGT,omitempty"` + CompanyGTE *string `json:"companyGTE,omitempty"` + CompanyLT *string `json:"companyLT,omitempty"` + CompanyLTE *string `json:"companyLTE,omitempty"` + CompanyContains *string `json:"companyContains,omitempty"` + CompanyHasPrefix *string `json:"companyHasPrefix,omitempty"` + CompanyHasSuffix *string `json:"companyHasSuffix,omitempty"` + CompanyIsNil bool `json:"companyIsNil,omitempty"` + CompanyNotNil bool `json:"companyNotNil,omitempty"` + CompanyEqualFold *string `json:"companyEqualFold,omitempty"` + CompanyContainsFold *string `json:"companyContainsFold,omitempty"` + + // "email" field predicates. + Email *string `json:"email,omitempty"` + EmailNEQ *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGT *string `json:"emailGT,omitempty"` + EmailGTE *string `json:"emailGTE,omitempty"` + EmailLT *string `json:"emailLT,omitempty"` + EmailLTE *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailIsNil bool `json:"emailIsNil,omitempty"` + EmailNotNil bool `json:"emailNotNil,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + + // "phone_number" field predicates. + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNEQ *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGT *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGTE *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLT *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLTE *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + + // "address" field predicates. + Address *string `json:"address,omitempty"` + AddressNEQ *string `json:"addressNEQ,omitempty"` + AddressIn []string `json:"addressIn,omitempty"` + AddressNotIn []string `json:"addressNotIn,omitempty"` + AddressGT *string `json:"addressGT,omitempty"` + AddressGTE *string `json:"addressGTE,omitempty"` + AddressLT *string `json:"addressLT,omitempty"` + AddressLTE *string `json:"addressLTE,omitempty"` + AddressContains *string `json:"addressContains,omitempty"` + AddressHasPrefix *string `json:"addressHasPrefix,omitempty"` + AddressHasSuffix *string `json:"addressHasSuffix,omitempty"` + AddressIsNil bool `json:"addressIsNil,omitempty"` + AddressNotNil bool `json:"addressNotNil,omitempty"` + AddressEqualFold *string `json:"addressEqualFold,omitempty"` + AddressContainsFold *string `json:"addressContainsFold,omitempty"` + + // "status" field predicates. + Status *enums.UserStatus `json:"status,omitempty"` + StatusNEQ *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "entities" edge predicates. + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *ContactWhereInput) AddPredicates(predicates ...predicate.Contact) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the ContactWhereInput filter on the ContactQuery builder. +func (i *ContactWhereInput) Filter(q *ContactQuery) (*ContactQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyContactWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyContactWhereInput is returned in case the ContactWhereInput is empty. +var ErrEmptyContactWhereInput = errors.New("generated: empty predicate ContactWhereInput") + +// P returns a predicate for filtering contacts. +// An error is returned if the input is empty or invalid. +func (i *ContactWhereInput) P() (predicate.Contact, error) { + var predicates []predicate.Contact + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, contact.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.Contact, 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, contact.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.Contact, 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, contact.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, contact.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, contact.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, contact.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, contact.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, contact.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, contact.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, contact.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, contact.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, contact.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, contact.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, contact.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, contact.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, contact.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, contact.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, contact.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, contact.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, contact.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, contact.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, contact.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, contact.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, contact.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, contact.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, contact.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, contact.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, contact.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, contact.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, contact.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, contact.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, contact.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, contact.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, contact.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, contact.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, contact.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, contact.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, contact.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, contact.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, contact.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, contact.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, contact.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, contact.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, contact.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, contact.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, contact.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, contact.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, contact.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, contact.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, contact.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, contact.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, contact.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, contact.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, contact.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, contact.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, contact.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, contact.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, contact.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, contact.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, contact.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, contact.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, contact.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, contact.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, contact.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, contact.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, contact.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, contact.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, contact.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, contact.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, contact.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, contact.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, contact.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, contact.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, contact.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, contact.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, contact.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, contact.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, contact.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, contact.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, contact.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, contact.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, contact.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, contact.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, contact.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, contact.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, contact.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, contact.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, contact.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, contact.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, contact.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, contact.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, contact.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, contact.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, contact.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, contact.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, contact.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, contact.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, contact.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, contact.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, contact.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, contact.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, contact.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, contact.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.FullName != nil { + predicates = append(predicates, contact.FullNameEQ(*i.FullName)) + } + if i.FullNameNEQ != nil { + predicates = append(predicates, contact.FullNameNEQ(*i.FullNameNEQ)) + } + if len(i.FullNameIn) > 0 { + predicates = append(predicates, contact.FullNameIn(i.FullNameIn...)) + } + if len(i.FullNameNotIn) > 0 { + predicates = append(predicates, contact.FullNameNotIn(i.FullNameNotIn...)) + } + if i.FullNameGT != nil { + predicates = append(predicates, contact.FullNameGT(*i.FullNameGT)) + } + if i.FullNameGTE != nil { + predicates = append(predicates, contact.FullNameGTE(*i.FullNameGTE)) + } + if i.FullNameLT != nil { + predicates = append(predicates, contact.FullNameLT(*i.FullNameLT)) + } + if i.FullNameLTE != nil { + predicates = append(predicates, contact.FullNameLTE(*i.FullNameLTE)) + } + if i.FullNameContains != nil { + predicates = append(predicates, contact.FullNameContains(*i.FullNameContains)) + } + if i.FullNameHasPrefix != nil { + predicates = append(predicates, contact.FullNameHasPrefix(*i.FullNameHasPrefix)) + } + if i.FullNameHasSuffix != nil { + predicates = append(predicates, contact.FullNameHasSuffix(*i.FullNameHasSuffix)) + } + if i.FullNameEqualFold != nil { + predicates = append(predicates, contact.FullNameEqualFold(*i.FullNameEqualFold)) + } + if i.FullNameContainsFold != nil { + predicates = append(predicates, contact.FullNameContainsFold(*i.FullNameContainsFold)) + } + if i.Title != nil { + predicates = append(predicates, contact.TitleEQ(*i.Title)) + } + if i.TitleNEQ != nil { + predicates = append(predicates, contact.TitleNEQ(*i.TitleNEQ)) + } + if len(i.TitleIn) > 0 { + predicates = append(predicates, contact.TitleIn(i.TitleIn...)) + } + if len(i.TitleNotIn) > 0 { + predicates = append(predicates, contact.TitleNotIn(i.TitleNotIn...)) + } + if i.TitleGT != nil { + predicates = append(predicates, contact.TitleGT(*i.TitleGT)) + } + if i.TitleGTE != nil { + predicates = append(predicates, contact.TitleGTE(*i.TitleGTE)) + } + if i.TitleLT != nil { + predicates = append(predicates, contact.TitleLT(*i.TitleLT)) + } + if i.TitleLTE != nil { + predicates = append(predicates, contact.TitleLTE(*i.TitleLTE)) + } + if i.TitleContains != nil { + predicates = append(predicates, contact.TitleContains(*i.TitleContains)) + } + if i.TitleHasPrefix != nil { + predicates = append(predicates, contact.TitleHasPrefix(*i.TitleHasPrefix)) + } + if i.TitleHasSuffix != nil { + predicates = append(predicates, contact.TitleHasSuffix(*i.TitleHasSuffix)) + } + if i.TitleIsNil { + predicates = append(predicates, contact.TitleIsNil()) + } + if i.TitleNotNil { + predicates = append(predicates, contact.TitleNotNil()) + } + if i.TitleEqualFold != nil { + predicates = append(predicates, contact.TitleEqualFold(*i.TitleEqualFold)) + } + if i.TitleContainsFold != nil { + predicates = append(predicates, contact.TitleContainsFold(*i.TitleContainsFold)) + } + if i.Company != nil { + predicates = append(predicates, contact.CompanyEQ(*i.Company)) + } + if i.CompanyNEQ != nil { + predicates = append(predicates, contact.CompanyNEQ(*i.CompanyNEQ)) + } + if len(i.CompanyIn) > 0 { + predicates = append(predicates, contact.CompanyIn(i.CompanyIn...)) + } + if len(i.CompanyNotIn) > 0 { + predicates = append(predicates, contact.CompanyNotIn(i.CompanyNotIn...)) + } + if i.CompanyGT != nil { + predicates = append(predicates, contact.CompanyGT(*i.CompanyGT)) + } + if i.CompanyGTE != nil { + predicates = append(predicates, contact.CompanyGTE(*i.CompanyGTE)) + } + if i.CompanyLT != nil { + predicates = append(predicates, contact.CompanyLT(*i.CompanyLT)) + } + if i.CompanyLTE != nil { + predicates = append(predicates, contact.CompanyLTE(*i.CompanyLTE)) + } + if i.CompanyContains != nil { + predicates = append(predicates, contact.CompanyContains(*i.CompanyContains)) + } + if i.CompanyHasPrefix != nil { + predicates = append(predicates, contact.CompanyHasPrefix(*i.CompanyHasPrefix)) + } + if i.CompanyHasSuffix != nil { + predicates = append(predicates, contact.CompanyHasSuffix(*i.CompanyHasSuffix)) + } + if i.CompanyIsNil { + predicates = append(predicates, contact.CompanyIsNil()) + } + if i.CompanyNotNil { + predicates = append(predicates, contact.CompanyNotNil()) + } + if i.CompanyEqualFold != nil { + predicates = append(predicates, contact.CompanyEqualFold(*i.CompanyEqualFold)) + } + if i.CompanyContainsFold != nil { + predicates = append(predicates, contact.CompanyContainsFold(*i.CompanyContainsFold)) + } + if i.Email != nil { + predicates = append(predicates, contact.EmailEQ(*i.Email)) + } + if i.EmailNEQ != nil { + predicates = append(predicates, contact.EmailNEQ(*i.EmailNEQ)) + } + if len(i.EmailIn) > 0 { + predicates = append(predicates, contact.EmailIn(i.EmailIn...)) + } + if len(i.EmailNotIn) > 0 { + predicates = append(predicates, contact.EmailNotIn(i.EmailNotIn...)) + } + if i.EmailGT != nil { + predicates = append(predicates, contact.EmailGT(*i.EmailGT)) + } + if i.EmailGTE != nil { + predicates = append(predicates, contact.EmailGTE(*i.EmailGTE)) + } + if i.EmailLT != nil { + predicates = append(predicates, contact.EmailLT(*i.EmailLT)) + } + if i.EmailLTE != nil { + predicates = append(predicates, contact.EmailLTE(*i.EmailLTE)) + } + if i.EmailContains != nil { + predicates = append(predicates, contact.EmailContains(*i.EmailContains)) + } + if i.EmailHasPrefix != nil { + predicates = append(predicates, contact.EmailHasPrefix(*i.EmailHasPrefix)) + } + if i.EmailHasSuffix != nil { + predicates = append(predicates, contact.EmailHasSuffix(*i.EmailHasSuffix)) + } + if i.EmailIsNil { + predicates = append(predicates, contact.EmailIsNil()) + } + if i.EmailNotNil { + predicates = append(predicates, contact.EmailNotNil()) + } + if i.EmailEqualFold != nil { + predicates = append(predicates, contact.EmailEqualFold(*i.EmailEqualFold)) + } + if i.EmailContainsFold != nil { + predicates = append(predicates, contact.EmailContainsFold(*i.EmailContainsFold)) + } + if i.PhoneNumber != nil { + predicates = append(predicates, contact.PhoneNumberEQ(*i.PhoneNumber)) + } + if i.PhoneNumberNEQ != nil { + predicates = append(predicates, contact.PhoneNumberNEQ(*i.PhoneNumberNEQ)) + } + if len(i.PhoneNumberIn) > 0 { + predicates = append(predicates, contact.PhoneNumberIn(i.PhoneNumberIn...)) + } + if len(i.PhoneNumberNotIn) > 0 { + predicates = append(predicates, contact.PhoneNumberNotIn(i.PhoneNumberNotIn...)) + } + if i.PhoneNumberGT != nil { + predicates = append(predicates, contact.PhoneNumberGT(*i.PhoneNumberGT)) + } + if i.PhoneNumberGTE != nil { + predicates = append(predicates, contact.PhoneNumberGTE(*i.PhoneNumberGTE)) + } + if i.PhoneNumberLT != nil { + predicates = append(predicates, contact.PhoneNumberLT(*i.PhoneNumberLT)) + } + if i.PhoneNumberLTE != nil { + predicates = append(predicates, contact.PhoneNumberLTE(*i.PhoneNumberLTE)) + } + if i.PhoneNumberContains != nil { + predicates = append(predicates, contact.PhoneNumberContains(*i.PhoneNumberContains)) + } + if i.PhoneNumberHasPrefix != nil { + predicates = append(predicates, contact.PhoneNumberHasPrefix(*i.PhoneNumberHasPrefix)) + } + if i.PhoneNumberHasSuffix != nil { + predicates = append(predicates, contact.PhoneNumberHasSuffix(*i.PhoneNumberHasSuffix)) + } + if i.PhoneNumberIsNil { + predicates = append(predicates, contact.PhoneNumberIsNil()) + } + if i.PhoneNumberNotNil { + predicates = append(predicates, contact.PhoneNumberNotNil()) + } + if i.PhoneNumberEqualFold != nil { + predicates = append(predicates, contact.PhoneNumberEqualFold(*i.PhoneNumberEqualFold)) + } + if i.PhoneNumberContainsFold != nil { + predicates = append(predicates, contact.PhoneNumberContainsFold(*i.PhoneNumberContainsFold)) + } + if i.Address != nil { + predicates = append(predicates, contact.AddressEQ(*i.Address)) + } + if i.AddressNEQ != nil { + predicates = append(predicates, contact.AddressNEQ(*i.AddressNEQ)) + } + if len(i.AddressIn) > 0 { + predicates = append(predicates, contact.AddressIn(i.AddressIn...)) + } + if len(i.AddressNotIn) > 0 { + predicates = append(predicates, contact.AddressNotIn(i.AddressNotIn...)) + } + if i.AddressGT != nil { + predicates = append(predicates, contact.AddressGT(*i.AddressGT)) + } + if i.AddressGTE != nil { + predicates = append(predicates, contact.AddressGTE(*i.AddressGTE)) + } + if i.AddressLT != nil { + predicates = append(predicates, contact.AddressLT(*i.AddressLT)) + } + if i.AddressLTE != nil { + predicates = append(predicates, contact.AddressLTE(*i.AddressLTE)) + } + if i.AddressContains != nil { + predicates = append(predicates, contact.AddressContains(*i.AddressContains)) + } + if i.AddressHasPrefix != nil { + predicates = append(predicates, contact.AddressHasPrefix(*i.AddressHasPrefix)) + } + if i.AddressHasSuffix != nil { + predicates = append(predicates, contact.AddressHasSuffix(*i.AddressHasSuffix)) + } + if i.AddressIsNil { + predicates = append(predicates, contact.AddressIsNil()) + } + if i.AddressNotNil { + predicates = append(predicates, contact.AddressNotNil()) + } + if i.AddressEqualFold != nil { + predicates = append(predicates, contact.AddressEqualFold(*i.AddressEqualFold)) + } + if i.AddressContainsFold != nil { + predicates = append(predicates, contact.AddressContainsFold(*i.AddressContainsFold)) + } + if i.Status != nil { + predicates = append(predicates, contact.StatusEQ(*i.Status)) + } + if i.StatusNEQ != nil { + predicates = append(predicates, contact.StatusNEQ(*i.StatusNEQ)) + } + if len(i.StatusIn) > 0 { + predicates = append(predicates, contact.StatusIn(i.StatusIn...)) + } + if len(i.StatusNotIn) > 0 { + predicates = append(predicates, contact.StatusNotIn(i.StatusNotIn...)) + } + + if i.HasOwner != nil { + p := contact.HasOwner() + if !*i.HasOwner { + p = contact.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, contact.HasOwnerWith(with...)) + } + if i.HasEntities != nil { + p := contact.HasEntities() + if !*i.HasEntities { + p = contact.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitiesWith) > 0 { + with := make([]predicate.Entity, 0, len(i.HasEntitiesWith)) + for _, w := range i.HasEntitiesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitiesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, contact.HasEntitiesWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyContactWhereInput + case 1: + return predicates[0], nil + default: + return contact.And(predicates...), nil + } +} + +// ContactHistoryWhereInput represents a where input for filtering ContactHistory queries. +type ContactHistoryWhereInput struct { + Predicates []predicate.ContactHistory `json:"-"` + Not *ContactHistoryWhereInput `json:"not,omitempty"` + Or []*ContactHistoryWhereInput `json:"or,omitempty"` + And []*ContactHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "full_name" field predicates. + FullName *string `json:"fullName,omitempty"` + FullNameNEQ *string `json:"fullNameNEQ,omitempty"` + FullNameIn []string `json:"fullNameIn,omitempty"` + FullNameNotIn []string `json:"fullNameNotIn,omitempty"` + FullNameGT *string `json:"fullNameGT,omitempty"` + FullNameGTE *string `json:"fullNameGTE,omitempty"` + FullNameLT *string `json:"fullNameLT,omitempty"` + FullNameLTE *string `json:"fullNameLTE,omitempty"` + FullNameContains *string `json:"fullNameContains,omitempty"` + FullNameHasPrefix *string `json:"fullNameHasPrefix,omitempty"` + FullNameHasSuffix *string `json:"fullNameHasSuffix,omitempty"` + FullNameEqualFold *string `json:"fullNameEqualFold,omitempty"` + FullNameContainsFold *string `json:"fullNameContainsFold,omitempty"` + + // "title" field predicates. + Title *string `json:"title,omitempty"` + TitleNEQ *string `json:"titleNEQ,omitempty"` + TitleIn []string `json:"titleIn,omitempty"` + TitleNotIn []string `json:"titleNotIn,omitempty"` + TitleGT *string `json:"titleGT,omitempty"` + TitleGTE *string `json:"titleGTE,omitempty"` + TitleLT *string `json:"titleLT,omitempty"` + TitleLTE *string `json:"titleLTE,omitempty"` + TitleContains *string `json:"titleContains,omitempty"` + TitleHasPrefix *string `json:"titleHasPrefix,omitempty"` + TitleHasSuffix *string `json:"titleHasSuffix,omitempty"` + TitleIsNil bool `json:"titleIsNil,omitempty"` + TitleNotNil bool `json:"titleNotNil,omitempty"` + TitleEqualFold *string `json:"titleEqualFold,omitempty"` + TitleContainsFold *string `json:"titleContainsFold,omitempty"` + + // "company" field predicates. + Company *string `json:"company,omitempty"` + CompanyNEQ *string `json:"companyNEQ,omitempty"` + CompanyIn []string `json:"companyIn,omitempty"` + CompanyNotIn []string `json:"companyNotIn,omitempty"` + CompanyGT *string `json:"companyGT,omitempty"` + CompanyGTE *string `json:"companyGTE,omitempty"` + CompanyLT *string `json:"companyLT,omitempty"` + CompanyLTE *string `json:"companyLTE,omitempty"` + CompanyContains *string `json:"companyContains,omitempty"` + CompanyHasPrefix *string `json:"companyHasPrefix,omitempty"` + CompanyHasSuffix *string `json:"companyHasSuffix,omitempty"` + CompanyIsNil bool `json:"companyIsNil,omitempty"` + CompanyNotNil bool `json:"companyNotNil,omitempty"` + CompanyEqualFold *string `json:"companyEqualFold,omitempty"` + CompanyContainsFold *string `json:"companyContainsFold,omitempty"` + + // "email" field predicates. + Email *string `json:"email,omitempty"` + EmailNEQ *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGT *string `json:"emailGT,omitempty"` + EmailGTE *string `json:"emailGTE,omitempty"` + EmailLT *string `json:"emailLT,omitempty"` + EmailLTE *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailIsNil bool `json:"emailIsNil,omitempty"` + EmailNotNil bool `json:"emailNotNil,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + + // "phone_number" field predicates. + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNEQ *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGT *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGTE *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLT *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLTE *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + + // "address" field predicates. + Address *string `json:"address,omitempty"` + AddressNEQ *string `json:"addressNEQ,omitempty"` + AddressIn []string `json:"addressIn,omitempty"` + AddressNotIn []string `json:"addressNotIn,omitempty"` + AddressGT *string `json:"addressGT,omitempty"` + AddressGTE *string `json:"addressGTE,omitempty"` + AddressLT *string `json:"addressLT,omitempty"` + AddressLTE *string `json:"addressLTE,omitempty"` + AddressContains *string `json:"addressContains,omitempty"` + AddressHasPrefix *string `json:"addressHasPrefix,omitempty"` + AddressHasSuffix *string `json:"addressHasSuffix,omitempty"` + AddressIsNil bool `json:"addressIsNil,omitempty"` + AddressNotNil bool `json:"addressNotNil,omitempty"` + AddressEqualFold *string `json:"addressEqualFold,omitempty"` + AddressContainsFold *string `json:"addressContainsFold,omitempty"` + + // "status" field predicates. + Status *enums.UserStatus `json:"status,omitempty"` + StatusNEQ *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *ContactHistoryWhereInput) AddPredicates(predicates ...predicate.ContactHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the ContactHistoryWhereInput filter on the ContactHistoryQuery builder. +func (i *ContactHistoryWhereInput) Filter(q *ContactHistoryQuery) (*ContactHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyContactHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyContactHistoryWhereInput is returned in case the ContactHistoryWhereInput is empty. +var ErrEmptyContactHistoryWhereInput = errors.New("generated: empty predicate ContactHistoryWhereInput") + +// P returns a predicate for filtering contacthistories. +// An error is returned if the input is empty or invalid. +func (i *ContactHistoryWhereInput) P() (predicate.ContactHistory, error) { + var predicates []predicate.ContactHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, contacthistory.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.ContactHistory, 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, contacthistory.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.ContactHistory, 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, contacthistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, contacthistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, contacthistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, contacthistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, contacthistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, contacthistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, contacthistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, contacthistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, contacthistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, contacthistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, contacthistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, contacthistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, contacthistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, contacthistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, contacthistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, contacthistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, contacthistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, contacthistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, contacthistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, contacthistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, contacthistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, contacthistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, contacthistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, contacthistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, contacthistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, contacthistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, contacthistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, contacthistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, contacthistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, contacthistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, contacthistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, contacthistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, contacthistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, contacthistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, contacthistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, contacthistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, contacthistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, contacthistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, contacthistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, contacthistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, contacthistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, contacthistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, contacthistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, contacthistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, contacthistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, contacthistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, contacthistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, contacthistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, contacthistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, contacthistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, contacthistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, contacthistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, contacthistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, contacthistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, contacthistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, contacthistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, contacthistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, contacthistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, contacthistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, contacthistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, contacthistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, contacthistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, contacthistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, contacthistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, contacthistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, contacthistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, contacthistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, contacthistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, contacthistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, contacthistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, contacthistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, contacthistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, contacthistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, contacthistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, contacthistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, contacthistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, contacthistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, contacthistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, contacthistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, contacthistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, contacthistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, contacthistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, contacthistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, contacthistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, contacthistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, contacthistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, contacthistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, contacthistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, contacthistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, contacthistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, contacthistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, contacthistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, contacthistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, contacthistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, contacthistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, contacthistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, contacthistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, contacthistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, contacthistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, contacthistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, contacthistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, contacthistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, contacthistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, contacthistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, contacthistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, contacthistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, contacthistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, contacthistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, contacthistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, contacthistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, contacthistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, contacthistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, contacthistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, contacthistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, contacthistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, contacthistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, contacthistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, contacthistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, contacthistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, contacthistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, contacthistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, contacthistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, contacthistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, contacthistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, contacthistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, contacthistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, contacthistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, contacthistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.FullName != nil { + predicates = append(predicates, contacthistory.FullNameEQ(*i.FullName)) + } + if i.FullNameNEQ != nil { + predicates = append(predicates, contacthistory.FullNameNEQ(*i.FullNameNEQ)) + } + if len(i.FullNameIn) > 0 { + predicates = append(predicates, contacthistory.FullNameIn(i.FullNameIn...)) + } + if len(i.FullNameNotIn) > 0 { + predicates = append(predicates, contacthistory.FullNameNotIn(i.FullNameNotIn...)) + } + if i.FullNameGT != nil { + predicates = append(predicates, contacthistory.FullNameGT(*i.FullNameGT)) + } + if i.FullNameGTE != nil { + predicates = append(predicates, contacthistory.FullNameGTE(*i.FullNameGTE)) + } + if i.FullNameLT != nil { + predicates = append(predicates, contacthistory.FullNameLT(*i.FullNameLT)) + } + if i.FullNameLTE != nil { + predicates = append(predicates, contacthistory.FullNameLTE(*i.FullNameLTE)) + } + if i.FullNameContains != nil { + predicates = append(predicates, contacthistory.FullNameContains(*i.FullNameContains)) + } + if i.FullNameHasPrefix != nil { + predicates = append(predicates, contacthistory.FullNameHasPrefix(*i.FullNameHasPrefix)) + } + if i.FullNameHasSuffix != nil { + predicates = append(predicates, contacthistory.FullNameHasSuffix(*i.FullNameHasSuffix)) + } + if i.FullNameEqualFold != nil { + predicates = append(predicates, contacthistory.FullNameEqualFold(*i.FullNameEqualFold)) + } + if i.FullNameContainsFold != nil { + predicates = append(predicates, contacthistory.FullNameContainsFold(*i.FullNameContainsFold)) + } + if i.Title != nil { + predicates = append(predicates, contacthistory.TitleEQ(*i.Title)) + } + if i.TitleNEQ != nil { + predicates = append(predicates, contacthistory.TitleNEQ(*i.TitleNEQ)) + } + if len(i.TitleIn) > 0 { + predicates = append(predicates, contacthistory.TitleIn(i.TitleIn...)) + } + if len(i.TitleNotIn) > 0 { + predicates = append(predicates, contacthistory.TitleNotIn(i.TitleNotIn...)) + } + if i.TitleGT != nil { + predicates = append(predicates, contacthistory.TitleGT(*i.TitleGT)) + } + if i.TitleGTE != nil { + predicates = append(predicates, contacthistory.TitleGTE(*i.TitleGTE)) + } + if i.TitleLT != nil { + predicates = append(predicates, contacthistory.TitleLT(*i.TitleLT)) + } + if i.TitleLTE != nil { + predicates = append(predicates, contacthistory.TitleLTE(*i.TitleLTE)) + } + if i.TitleContains != nil { + predicates = append(predicates, contacthistory.TitleContains(*i.TitleContains)) + } + if i.TitleHasPrefix != nil { + predicates = append(predicates, contacthistory.TitleHasPrefix(*i.TitleHasPrefix)) + } + if i.TitleHasSuffix != nil { + predicates = append(predicates, contacthistory.TitleHasSuffix(*i.TitleHasSuffix)) + } + if i.TitleIsNil { + predicates = append(predicates, contacthistory.TitleIsNil()) + } + if i.TitleNotNil { + predicates = append(predicates, contacthistory.TitleNotNil()) + } + if i.TitleEqualFold != nil { + predicates = append(predicates, contacthistory.TitleEqualFold(*i.TitleEqualFold)) + } + if i.TitleContainsFold != nil { + predicates = append(predicates, contacthistory.TitleContainsFold(*i.TitleContainsFold)) + } + if i.Company != nil { + predicates = append(predicates, contacthistory.CompanyEQ(*i.Company)) + } + if i.CompanyNEQ != nil { + predicates = append(predicates, contacthistory.CompanyNEQ(*i.CompanyNEQ)) + } + if len(i.CompanyIn) > 0 { + predicates = append(predicates, contacthistory.CompanyIn(i.CompanyIn...)) + } + if len(i.CompanyNotIn) > 0 { + predicates = append(predicates, contacthistory.CompanyNotIn(i.CompanyNotIn...)) + } + if i.CompanyGT != nil { + predicates = append(predicates, contacthistory.CompanyGT(*i.CompanyGT)) + } + if i.CompanyGTE != nil { + predicates = append(predicates, contacthistory.CompanyGTE(*i.CompanyGTE)) + } + if i.CompanyLT != nil { + predicates = append(predicates, contacthistory.CompanyLT(*i.CompanyLT)) + } + if i.CompanyLTE != nil { + predicates = append(predicates, contacthistory.CompanyLTE(*i.CompanyLTE)) + } + if i.CompanyContains != nil { + predicates = append(predicates, contacthistory.CompanyContains(*i.CompanyContains)) + } + if i.CompanyHasPrefix != nil { + predicates = append(predicates, contacthistory.CompanyHasPrefix(*i.CompanyHasPrefix)) + } + if i.CompanyHasSuffix != nil { + predicates = append(predicates, contacthistory.CompanyHasSuffix(*i.CompanyHasSuffix)) + } + if i.CompanyIsNil { + predicates = append(predicates, contacthistory.CompanyIsNil()) + } + if i.CompanyNotNil { + predicates = append(predicates, contacthistory.CompanyNotNil()) + } + if i.CompanyEqualFold != nil { + predicates = append(predicates, contacthistory.CompanyEqualFold(*i.CompanyEqualFold)) + } + if i.CompanyContainsFold != nil { + predicates = append(predicates, contacthistory.CompanyContainsFold(*i.CompanyContainsFold)) + } + if i.Email != nil { + predicates = append(predicates, contacthistory.EmailEQ(*i.Email)) + } + if i.EmailNEQ != nil { + predicates = append(predicates, contacthistory.EmailNEQ(*i.EmailNEQ)) + } + if len(i.EmailIn) > 0 { + predicates = append(predicates, contacthistory.EmailIn(i.EmailIn...)) + } + if len(i.EmailNotIn) > 0 { + predicates = append(predicates, contacthistory.EmailNotIn(i.EmailNotIn...)) + } + if i.EmailGT != nil { + predicates = append(predicates, contacthistory.EmailGT(*i.EmailGT)) + } + if i.EmailGTE != nil { + predicates = append(predicates, contacthistory.EmailGTE(*i.EmailGTE)) + } + if i.EmailLT != nil { + predicates = append(predicates, contacthistory.EmailLT(*i.EmailLT)) + } + if i.EmailLTE != nil { + predicates = append(predicates, contacthistory.EmailLTE(*i.EmailLTE)) + } + if i.EmailContains != nil { + predicates = append(predicates, contacthistory.EmailContains(*i.EmailContains)) + } + if i.EmailHasPrefix != nil { + predicates = append(predicates, contacthistory.EmailHasPrefix(*i.EmailHasPrefix)) + } + if i.EmailHasSuffix != nil { + predicates = append(predicates, contacthistory.EmailHasSuffix(*i.EmailHasSuffix)) + } + if i.EmailIsNil { + predicates = append(predicates, contacthistory.EmailIsNil()) + } + if i.EmailNotNil { + predicates = append(predicates, contacthistory.EmailNotNil()) + } + if i.EmailEqualFold != nil { + predicates = append(predicates, contacthistory.EmailEqualFold(*i.EmailEqualFold)) + } + if i.EmailContainsFold != nil { + predicates = append(predicates, contacthistory.EmailContainsFold(*i.EmailContainsFold)) + } + if i.PhoneNumber != nil { + predicates = append(predicates, contacthistory.PhoneNumberEQ(*i.PhoneNumber)) + } + if i.PhoneNumberNEQ != nil { + predicates = append(predicates, contacthistory.PhoneNumberNEQ(*i.PhoneNumberNEQ)) + } + if len(i.PhoneNumberIn) > 0 { + predicates = append(predicates, contacthistory.PhoneNumberIn(i.PhoneNumberIn...)) + } + if len(i.PhoneNumberNotIn) > 0 { + predicates = append(predicates, contacthistory.PhoneNumberNotIn(i.PhoneNumberNotIn...)) + } + if i.PhoneNumberGT != nil { + predicates = append(predicates, contacthistory.PhoneNumberGT(*i.PhoneNumberGT)) + } + if i.PhoneNumberGTE != nil { + predicates = append(predicates, contacthistory.PhoneNumberGTE(*i.PhoneNumberGTE)) + } + if i.PhoneNumberLT != nil { + predicates = append(predicates, contacthistory.PhoneNumberLT(*i.PhoneNumberLT)) + } + if i.PhoneNumberLTE != nil { + predicates = append(predicates, contacthistory.PhoneNumberLTE(*i.PhoneNumberLTE)) + } + if i.PhoneNumberContains != nil { + predicates = append(predicates, contacthistory.PhoneNumberContains(*i.PhoneNumberContains)) + } + if i.PhoneNumberHasPrefix != nil { + predicates = append(predicates, contacthistory.PhoneNumberHasPrefix(*i.PhoneNumberHasPrefix)) + } + if i.PhoneNumberHasSuffix != nil { + predicates = append(predicates, contacthistory.PhoneNumberHasSuffix(*i.PhoneNumberHasSuffix)) + } + if i.PhoneNumberIsNil { + predicates = append(predicates, contacthistory.PhoneNumberIsNil()) + } + if i.PhoneNumberNotNil { + predicates = append(predicates, contacthistory.PhoneNumberNotNil()) + } + if i.PhoneNumberEqualFold != nil { + predicates = append(predicates, contacthistory.PhoneNumberEqualFold(*i.PhoneNumberEqualFold)) + } + if i.PhoneNumberContainsFold != nil { + predicates = append(predicates, contacthistory.PhoneNumberContainsFold(*i.PhoneNumberContainsFold)) + } + if i.Address != nil { + predicates = append(predicates, contacthistory.AddressEQ(*i.Address)) + } + if i.AddressNEQ != nil { + predicates = append(predicates, contacthistory.AddressNEQ(*i.AddressNEQ)) + } + if len(i.AddressIn) > 0 { + predicates = append(predicates, contacthistory.AddressIn(i.AddressIn...)) + } + if len(i.AddressNotIn) > 0 { + predicates = append(predicates, contacthistory.AddressNotIn(i.AddressNotIn...)) + } + if i.AddressGT != nil { + predicates = append(predicates, contacthistory.AddressGT(*i.AddressGT)) + } + if i.AddressGTE != nil { + predicates = append(predicates, contacthistory.AddressGTE(*i.AddressGTE)) + } + if i.AddressLT != nil { + predicates = append(predicates, contacthistory.AddressLT(*i.AddressLT)) + } + if i.AddressLTE != nil { + predicates = append(predicates, contacthistory.AddressLTE(*i.AddressLTE)) + } + if i.AddressContains != nil { + predicates = append(predicates, contacthistory.AddressContains(*i.AddressContains)) + } + if i.AddressHasPrefix != nil { + predicates = append(predicates, contacthistory.AddressHasPrefix(*i.AddressHasPrefix)) + } + if i.AddressHasSuffix != nil { + predicates = append(predicates, contacthistory.AddressHasSuffix(*i.AddressHasSuffix)) + } + if i.AddressIsNil { + predicates = append(predicates, contacthistory.AddressIsNil()) + } + if i.AddressNotNil { + predicates = append(predicates, contacthistory.AddressNotNil()) + } + if i.AddressEqualFold != nil { + predicates = append(predicates, contacthistory.AddressEqualFold(*i.AddressEqualFold)) + } + if i.AddressContainsFold != nil { + predicates = append(predicates, contacthistory.AddressContainsFold(*i.AddressContainsFold)) + } + if i.Status != nil { + predicates = append(predicates, contacthistory.StatusEQ(*i.Status)) + } + if i.StatusNEQ != nil { + predicates = append(predicates, contacthistory.StatusNEQ(*i.StatusNEQ)) + } + if len(i.StatusIn) > 0 { + predicates = append(predicates, contacthistory.StatusIn(i.StatusIn...)) + } + if len(i.StatusNotIn) > 0 { + predicates = append(predicates, contacthistory.StatusNotIn(i.StatusNotIn...)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyContactHistoryWhereInput + case 1: + return predicates[0], nil + default: + return contacthistory.And(predicates...), nil + } +} + +// DocumentDataWhereInput represents a where input for filtering DocumentData queries. +type DocumentDataWhereInput struct { + Predicates []predicate.DocumentData `json:"-"` + Not *DocumentDataWhereInput `json:"not,omitempty"` + Or []*DocumentDataWhereInput `json:"or,omitempty"` + And []*DocumentDataWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "template_id" field predicates. + TemplateID *string `json:"templateID,omitempty"` + TemplateIDNEQ *string `json:"templateIDNEQ,omitempty"` + TemplateIDIn []string `json:"templateIDIn,omitempty"` + TemplateIDNotIn []string `json:"templateIDNotIn,omitempty"` + TemplateIDGT *string `json:"templateIDGT,omitempty"` + TemplateIDGTE *string `json:"templateIDGTE,omitempty"` + TemplateIDLT *string `json:"templateIDLT,omitempty"` + TemplateIDLTE *string `json:"templateIDLTE,omitempty"` + TemplateIDContains *string `json:"templateIDContains,omitempty"` + TemplateIDHasPrefix *string `json:"templateIDHasPrefix,omitempty"` + TemplateIDHasSuffix *string `json:"templateIDHasSuffix,omitempty"` + TemplateIDEqualFold *string `json:"templateIDEqualFold,omitempty"` + TemplateIDContainsFold *string `json:"templateIDContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "template" edge predicates. + HasTemplate *bool `json:"hasTemplate,omitempty"` + HasTemplateWith []*TemplateWhereInput `json:"hasTemplateWith,omitempty"` + + // "entity" edge predicates. + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *DocumentDataWhereInput) AddPredicates(predicates ...predicate.DocumentData) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the DocumentDataWhereInput filter on the DocumentDataQuery builder. +func (i *DocumentDataWhereInput) Filter(q *DocumentDataQuery) (*DocumentDataQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyDocumentDataWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyDocumentDataWhereInput is returned in case the DocumentDataWhereInput is empty. +var ErrEmptyDocumentDataWhereInput = errors.New("generated: empty predicate DocumentDataWhereInput") + +// P returns a predicate for filtering documentdataslice. +// An error is returned if the input is empty or invalid. +func (i *DocumentDataWhereInput) P() (predicate.DocumentData, error) { + var predicates []predicate.DocumentData + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, documentdata.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.DocumentData, 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, documentdata.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.DocumentData, 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, documentdata.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, documentdata.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, documentdata.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, documentdata.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, documentdata.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, documentdata.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, documentdata.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, documentdata.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, documentdata.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, documentdata.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, documentdata.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, documentdata.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, documentdata.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, documentdata.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, documentdata.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, documentdata.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, documentdata.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, documentdata.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, documentdata.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, documentdata.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, documentdata.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, documentdata.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, documentdata.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, documentdata.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, documentdata.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, documentdata.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, documentdata.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, documentdata.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, documentdata.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, documentdata.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, documentdata.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, documentdata.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, documentdata.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, documentdata.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, documentdata.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, documentdata.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, documentdata.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, documentdata.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, documentdata.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, documentdata.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, documentdata.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, documentdata.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, documentdata.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, documentdata.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, documentdata.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, documentdata.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, documentdata.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, documentdata.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, documentdata.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, documentdata.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, documentdata.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, documentdata.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, documentdata.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, documentdata.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, documentdata.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, documentdata.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, documentdata.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, documentdata.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, documentdata.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, documentdata.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, documentdata.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, documentdata.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, documentdata.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, documentdata.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, documentdata.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, documentdata.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, documentdata.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, documentdata.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, documentdata.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, documentdata.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, documentdata.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, documentdata.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, documentdata.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, documentdata.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, documentdata.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, documentdata.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, documentdata.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, documentdata.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, documentdata.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, documentdata.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, documentdata.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, documentdata.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, documentdata.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, documentdata.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, documentdata.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, documentdata.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, documentdata.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, documentdata.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, documentdata.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, documentdata.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, documentdata.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, documentdata.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, documentdata.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, documentdata.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, documentdata.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, documentdata.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, documentdata.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, documentdata.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, documentdata.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, documentdata.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, documentdata.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.TemplateID != nil { + predicates = append(predicates, documentdata.TemplateIDEQ(*i.TemplateID)) + } + if i.TemplateIDNEQ != nil { + predicates = append(predicates, documentdata.TemplateIDNEQ(*i.TemplateIDNEQ)) + } + if len(i.TemplateIDIn) > 0 { + predicates = append(predicates, documentdata.TemplateIDIn(i.TemplateIDIn...)) + } + if len(i.TemplateIDNotIn) > 0 { + predicates = append(predicates, documentdata.TemplateIDNotIn(i.TemplateIDNotIn...)) + } + if i.TemplateIDGT != nil { + predicates = append(predicates, documentdata.TemplateIDGT(*i.TemplateIDGT)) + } + if i.TemplateIDGTE != nil { + predicates = append(predicates, documentdata.TemplateIDGTE(*i.TemplateIDGTE)) + } + if i.TemplateIDLT != nil { + predicates = append(predicates, documentdata.TemplateIDLT(*i.TemplateIDLT)) + } + if i.TemplateIDLTE != nil { + predicates = append(predicates, documentdata.TemplateIDLTE(*i.TemplateIDLTE)) + } + if i.TemplateIDContains != nil { + predicates = append(predicates, documentdata.TemplateIDContains(*i.TemplateIDContains)) + } + if i.TemplateIDHasPrefix != nil { + predicates = append(predicates, documentdata.TemplateIDHasPrefix(*i.TemplateIDHasPrefix)) + } + if i.TemplateIDHasSuffix != nil { + predicates = append(predicates, documentdata.TemplateIDHasSuffix(*i.TemplateIDHasSuffix)) + } + if i.TemplateIDEqualFold != nil { + predicates = append(predicates, documentdata.TemplateIDEqualFold(*i.TemplateIDEqualFold)) + } + if i.TemplateIDContainsFold != nil { + predicates = append(predicates, documentdata.TemplateIDContainsFold(*i.TemplateIDContainsFold)) + } + + if i.HasOwner != nil { + p := documentdata.HasOwner() + if !*i.HasOwner { + p = documentdata.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, documentdata.HasOwnerWith(with...)) + } + if i.HasTemplate != nil { + p := documentdata.HasTemplate() + if !*i.HasTemplate { + p = documentdata.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasTemplateWith) > 0 { + with := make([]predicate.Template, 0, len(i.HasTemplateWith)) + for _, w := range i.HasTemplateWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasTemplateWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, documentdata.HasTemplateWith(with...)) + } + if i.HasEntity != nil { + p := documentdata.HasEntity() + if !*i.HasEntity { + p = documentdata.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntityWith) > 0 { + with := make([]predicate.Entity, 0, len(i.HasEntityWith)) + for _, w := range i.HasEntityWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntityWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, documentdata.HasEntityWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyDocumentDataWhereInput + case 1: + return predicates[0], nil + default: + return documentdata.And(predicates...), nil + } +} + +// DocumentDataHistoryWhereInput represents a where input for filtering DocumentDataHistory queries. +type DocumentDataHistoryWhereInput struct { + Predicates []predicate.DocumentDataHistory `json:"-"` + Not *DocumentDataHistoryWhereInput `json:"not,omitempty"` + Or []*DocumentDataHistoryWhereInput `json:"or,omitempty"` + And []*DocumentDataHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "template_id" field predicates. + TemplateID *string `json:"templateID,omitempty"` + TemplateIDNEQ *string `json:"templateIDNEQ,omitempty"` + TemplateIDIn []string `json:"templateIDIn,omitempty"` + TemplateIDNotIn []string `json:"templateIDNotIn,omitempty"` + TemplateIDGT *string `json:"templateIDGT,omitempty"` + TemplateIDGTE *string `json:"templateIDGTE,omitempty"` + TemplateIDLT *string `json:"templateIDLT,omitempty"` + TemplateIDLTE *string `json:"templateIDLTE,omitempty"` + TemplateIDContains *string `json:"templateIDContains,omitempty"` + TemplateIDHasPrefix *string `json:"templateIDHasPrefix,omitempty"` + TemplateIDHasSuffix *string `json:"templateIDHasSuffix,omitempty"` + TemplateIDEqualFold *string `json:"templateIDEqualFold,omitempty"` + TemplateIDContainsFold *string `json:"templateIDContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *DocumentDataHistoryWhereInput) AddPredicates(predicates ...predicate.DocumentDataHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the DocumentDataHistoryWhereInput filter on the DocumentDataHistoryQuery builder. +func (i *DocumentDataHistoryWhereInput) Filter(q *DocumentDataHistoryQuery) (*DocumentDataHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyDocumentDataHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyDocumentDataHistoryWhereInput is returned in case the DocumentDataHistoryWhereInput is empty. +var ErrEmptyDocumentDataHistoryWhereInput = errors.New("generated: empty predicate DocumentDataHistoryWhereInput") + +// P returns a predicate for filtering documentdatahistories. +// An error is returned if the input is empty or invalid. +func (i *DocumentDataHistoryWhereInput) P() (predicate.DocumentDataHistory, error) { + var predicates []predicate.DocumentDataHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, documentdatahistory.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.DocumentDataHistory, 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, documentdatahistory.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.DocumentDataHistory, 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, documentdatahistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, documentdatahistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, documentdatahistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, documentdatahistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, documentdatahistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, documentdatahistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, documentdatahistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, documentdatahistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, documentdatahistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, documentdatahistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, documentdatahistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, documentdatahistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, documentdatahistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, documentdatahistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, documentdatahistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, documentdatahistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, documentdatahistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, documentdatahistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, documentdatahistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, documentdatahistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, documentdatahistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, documentdatahistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, documentdatahistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, documentdatahistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, documentdatahistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, documentdatahistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, documentdatahistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, documentdatahistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, documentdatahistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, documentdatahistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, documentdatahistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, documentdatahistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, documentdatahistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, documentdatahistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, documentdatahistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, documentdatahistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, documentdatahistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, documentdatahistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, documentdatahistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, documentdatahistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, documentdatahistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, documentdatahistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, documentdatahistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, documentdatahistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, documentdatahistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, documentdatahistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, documentdatahistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, documentdatahistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, documentdatahistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, documentdatahistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, documentdatahistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, documentdatahistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, documentdatahistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, documentdatahistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, documentdatahistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, documentdatahistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, documentdatahistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, documentdatahistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, documentdatahistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, documentdatahistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, documentdatahistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, documentdatahistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, documentdatahistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, documentdatahistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, documentdatahistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, documentdatahistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, documentdatahistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, documentdatahistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, documentdatahistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, documentdatahistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, documentdatahistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, documentdatahistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, documentdatahistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, documentdatahistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, documentdatahistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, documentdatahistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, documentdatahistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, documentdatahistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, documentdatahistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, documentdatahistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, documentdatahistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, documentdatahistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, documentdatahistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, documentdatahistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, documentdatahistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, documentdatahistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, documentdatahistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, documentdatahistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, documentdatahistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, documentdatahistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, documentdatahistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, documentdatahistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, documentdatahistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, documentdatahistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, documentdatahistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, documentdatahistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, documentdatahistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, documentdatahistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, documentdatahistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, documentdatahistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, documentdatahistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, documentdatahistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, documentdatahistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, documentdatahistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, documentdatahistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, documentdatahistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, documentdatahistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, documentdatahistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, documentdatahistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, documentdatahistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, documentdatahistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, documentdatahistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, documentdatahistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, documentdatahistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, documentdatahistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, documentdatahistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, documentdatahistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, documentdatahistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, documentdatahistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, documentdatahistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, documentdatahistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, documentdatahistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, documentdatahistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, documentdatahistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, documentdatahistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, documentdatahistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, documentdatahistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, documentdatahistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.TemplateID != nil { + predicates = append(predicates, documentdatahistory.TemplateIDEQ(*i.TemplateID)) + } + if i.TemplateIDNEQ != nil { + predicates = append(predicates, documentdatahistory.TemplateIDNEQ(*i.TemplateIDNEQ)) + } + if len(i.TemplateIDIn) > 0 { + predicates = append(predicates, documentdatahistory.TemplateIDIn(i.TemplateIDIn...)) + } + if len(i.TemplateIDNotIn) > 0 { + predicates = append(predicates, documentdatahistory.TemplateIDNotIn(i.TemplateIDNotIn...)) + } + if i.TemplateIDGT != nil { + predicates = append(predicates, documentdatahistory.TemplateIDGT(*i.TemplateIDGT)) + } + if i.TemplateIDGTE != nil { + predicates = append(predicates, documentdatahistory.TemplateIDGTE(*i.TemplateIDGTE)) + } + if i.TemplateIDLT != nil { + predicates = append(predicates, documentdatahistory.TemplateIDLT(*i.TemplateIDLT)) + } + if i.TemplateIDLTE != nil { + predicates = append(predicates, documentdatahistory.TemplateIDLTE(*i.TemplateIDLTE)) + } + if i.TemplateIDContains != nil { + predicates = append(predicates, documentdatahistory.TemplateIDContains(*i.TemplateIDContains)) + } + if i.TemplateIDHasPrefix != nil { + predicates = append(predicates, documentdatahistory.TemplateIDHasPrefix(*i.TemplateIDHasPrefix)) + } + if i.TemplateIDHasSuffix != nil { + predicates = append(predicates, documentdatahistory.TemplateIDHasSuffix(*i.TemplateIDHasSuffix)) + } + if i.TemplateIDEqualFold != nil { + predicates = append(predicates, documentdatahistory.TemplateIDEqualFold(*i.TemplateIDEqualFold)) + } + if i.TemplateIDContainsFold != nil { + predicates = append(predicates, documentdatahistory.TemplateIDContainsFold(*i.TemplateIDContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyDocumentDataHistoryWhereInput + case 1: + return predicates[0], nil + default: + return documentdatahistory.And(predicates...), nil + } +} + +// EntitlementWhereInput represents a where input for filtering Entitlement queries. +type EntitlementWhereInput struct { + Predicates []predicate.Entitlement `json:"-"` + Not *EntitlementWhereInput `json:"not,omitempty"` + Or []*EntitlementWhereInput `json:"or,omitempty"` + And []*EntitlementWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "plan_id" field predicates. + PlanID *string `json:"planID,omitempty"` + PlanIDNEQ *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGT *string `json:"planIDGT,omitempty"` + PlanIDGTE *string `json:"planIDGTE,omitempty"` + PlanIDLT *string `json:"planIDLT,omitempty"` + PlanIDLTE *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + + // "organization_id" field predicates. + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNEQ *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGT *string `json:"organizationIDGT,omitempty"` + OrganizationIDGTE *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLT *string `json:"organizationIDLT,omitempty"` + OrganizationIDLTE *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + + // "external_customer_id" field predicates. + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ExternalCustomerIDNEQ *string `json:"externalCustomerIDNEQ,omitempty"` + ExternalCustomerIDIn []string `json:"externalCustomerIDIn,omitempty"` + ExternalCustomerIDNotIn []string `json:"externalCustomerIDNotIn,omitempty"` + ExternalCustomerIDGT *string `json:"externalCustomerIDGT,omitempty"` + ExternalCustomerIDGTE *string `json:"externalCustomerIDGTE,omitempty"` + ExternalCustomerIDLT *string `json:"externalCustomerIDLT,omitempty"` + ExternalCustomerIDLTE *string `json:"externalCustomerIDLTE,omitempty"` + ExternalCustomerIDContains *string `json:"externalCustomerIDContains,omitempty"` + ExternalCustomerIDHasPrefix *string `json:"externalCustomerIDHasPrefix,omitempty"` + ExternalCustomerIDHasSuffix *string `json:"externalCustomerIDHasSuffix,omitempty"` + ExternalCustomerIDIsNil bool `json:"externalCustomerIDIsNil,omitempty"` + ExternalCustomerIDNotNil bool `json:"externalCustomerIDNotNil,omitempty"` + ExternalCustomerIDEqualFold *string `json:"externalCustomerIDEqualFold,omitempty"` + ExternalCustomerIDContainsFold *string `json:"externalCustomerIDContainsFold,omitempty"` + + // "external_subscription_id" field predicates. + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ExternalSubscriptionIDNEQ *string `json:"externalSubscriptionIDNEQ,omitempty"` + ExternalSubscriptionIDIn []string `json:"externalSubscriptionIDIn,omitempty"` + ExternalSubscriptionIDNotIn []string `json:"externalSubscriptionIDNotIn,omitempty"` + ExternalSubscriptionIDGT *string `json:"externalSubscriptionIDGT,omitempty"` + ExternalSubscriptionIDGTE *string `json:"externalSubscriptionIDGTE,omitempty"` + ExternalSubscriptionIDLT *string `json:"externalSubscriptionIDLT,omitempty"` + ExternalSubscriptionIDLTE *string `json:"externalSubscriptionIDLTE,omitempty"` + ExternalSubscriptionIDContains *string `json:"externalSubscriptionIDContains,omitempty"` + ExternalSubscriptionIDHasPrefix *string `json:"externalSubscriptionIDHasPrefix,omitempty"` + ExternalSubscriptionIDHasSuffix *string `json:"externalSubscriptionIDHasSuffix,omitempty"` + ExternalSubscriptionIDIsNil bool `json:"externalSubscriptionIDIsNil,omitempty"` + ExternalSubscriptionIDNotNil bool `json:"externalSubscriptionIDNotNil,omitempty"` + ExternalSubscriptionIDEqualFold *string `json:"externalSubscriptionIDEqualFold,omitempty"` + ExternalSubscriptionIDContainsFold *string `json:"externalSubscriptionIDContainsFold,omitempty"` + + // "expires" field predicates. + Expires *bool `json:"expires,omitempty"` + ExpiresNEQ *bool `json:"expiresNEQ,omitempty"` + + // "expires_at" field predicates. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNEQ *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGT *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGTE *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLT *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLTE *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil bool `json:"expiresAtNotNil,omitempty"` + + // "cancelled" field predicates. + Cancelled *bool `json:"cancelled,omitempty"` + CancelledNEQ *bool `json:"cancelledNEQ,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "plan" edge predicates. + HasPlan *bool `json:"hasPlan,omitempty"` + HasPlanWith []*EntitlementPlanWhereInput `json:"hasPlanWith,omitempty"` + + // "organization" edge predicates. + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntitlementWhereInput) AddPredicates(predicates ...predicate.Entitlement) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntitlementWhereInput filter on the EntitlementQuery builder. +func (i *EntitlementWhereInput) Filter(q *EntitlementQuery) (*EntitlementQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntitlementWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntitlementWhereInput is returned in case the EntitlementWhereInput is empty. +var ErrEmptyEntitlementWhereInput = errors.New("generated: empty predicate EntitlementWhereInput") + +// P returns a predicate for filtering entitlements. +// An error is returned if the input is empty or invalid. +func (i *EntitlementWhereInput) P() (predicate.Entitlement, error) { + var predicates []predicate.Entitlement + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitlement.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.Entitlement, 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, entitlement.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.Entitlement, 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, entitlement.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitlement.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitlement.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitlement.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitlement.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitlement.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitlement.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitlement.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitlement.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitlement.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitlement.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitlement.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitlement.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitlement.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitlement.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitlement.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitlement.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitlement.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitlement.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitlement.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitlement.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitlement.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitlement.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitlement.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitlement.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitlement.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitlement.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitlement.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitlement.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitlement.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitlement.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitlement.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitlement.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitlement.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitlement.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitlement.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitlement.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitlement.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitlement.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitlement.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitlement.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitlement.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitlement.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitlement.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitlement.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitlement.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitlement.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitlement.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitlement.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitlement.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitlement.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitlement.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitlement.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitlement.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitlement.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitlement.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitlement.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitlement.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitlement.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitlement.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitlement.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitlement.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitlement.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitlement.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitlement.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitlement.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitlement.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitlement.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitlement.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitlement.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitlement.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitlement.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitlement.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitlement.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitlement.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitlement.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitlement.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitlement.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitlement.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitlement.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitlement.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitlement.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitlement.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitlement.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitlement.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitlement.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitlement.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitlement.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitlement.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitlement.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitlement.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitlement.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitlement.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitlement.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitlement.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitlement.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitlement.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitlement.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitlement.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitlement.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitlement.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.PlanID != nil { + predicates = append(predicates, entitlement.PlanIDEQ(*i.PlanID)) + } + if i.PlanIDNEQ != nil { + predicates = append(predicates, entitlement.PlanIDNEQ(*i.PlanIDNEQ)) + } + if len(i.PlanIDIn) > 0 { + predicates = append(predicates, entitlement.PlanIDIn(i.PlanIDIn...)) + } + if len(i.PlanIDNotIn) > 0 { + predicates = append(predicates, entitlement.PlanIDNotIn(i.PlanIDNotIn...)) + } + if i.PlanIDGT != nil { + predicates = append(predicates, entitlement.PlanIDGT(*i.PlanIDGT)) + } + if i.PlanIDGTE != nil { + predicates = append(predicates, entitlement.PlanIDGTE(*i.PlanIDGTE)) + } + if i.PlanIDLT != nil { + predicates = append(predicates, entitlement.PlanIDLT(*i.PlanIDLT)) + } + if i.PlanIDLTE != nil { + predicates = append(predicates, entitlement.PlanIDLTE(*i.PlanIDLTE)) + } + if i.PlanIDContains != nil { + predicates = append(predicates, entitlement.PlanIDContains(*i.PlanIDContains)) + } + if i.PlanIDHasPrefix != nil { + predicates = append(predicates, entitlement.PlanIDHasPrefix(*i.PlanIDHasPrefix)) + } + if i.PlanIDHasSuffix != nil { + predicates = append(predicates, entitlement.PlanIDHasSuffix(*i.PlanIDHasSuffix)) + } + if i.PlanIDEqualFold != nil { + predicates = append(predicates, entitlement.PlanIDEqualFold(*i.PlanIDEqualFold)) + } + if i.PlanIDContainsFold != nil { + predicates = append(predicates, entitlement.PlanIDContainsFold(*i.PlanIDContainsFold)) + } + if i.OrganizationID != nil { + predicates = append(predicates, entitlement.OrganizationIDEQ(*i.OrganizationID)) + } + if i.OrganizationIDNEQ != nil { + predicates = append(predicates, entitlement.OrganizationIDNEQ(*i.OrganizationIDNEQ)) + } + if len(i.OrganizationIDIn) > 0 { + predicates = append(predicates, entitlement.OrganizationIDIn(i.OrganizationIDIn...)) + } + if len(i.OrganizationIDNotIn) > 0 { + predicates = append(predicates, entitlement.OrganizationIDNotIn(i.OrganizationIDNotIn...)) + } + if i.OrganizationIDGT != nil { + predicates = append(predicates, entitlement.OrganizationIDGT(*i.OrganizationIDGT)) + } + if i.OrganizationIDGTE != nil { + predicates = append(predicates, entitlement.OrganizationIDGTE(*i.OrganizationIDGTE)) + } + if i.OrganizationIDLT != nil { + predicates = append(predicates, entitlement.OrganizationIDLT(*i.OrganizationIDLT)) + } + if i.OrganizationIDLTE != nil { + predicates = append(predicates, entitlement.OrganizationIDLTE(*i.OrganizationIDLTE)) + } + if i.OrganizationIDContains != nil { + predicates = append(predicates, entitlement.OrganizationIDContains(*i.OrganizationIDContains)) + } + if i.OrganizationIDHasPrefix != nil { + predicates = append(predicates, entitlement.OrganizationIDHasPrefix(*i.OrganizationIDHasPrefix)) + } + if i.OrganizationIDHasSuffix != nil { + predicates = append(predicates, entitlement.OrganizationIDHasSuffix(*i.OrganizationIDHasSuffix)) + } + if i.OrganizationIDEqualFold != nil { + predicates = append(predicates, entitlement.OrganizationIDEqualFold(*i.OrganizationIDEqualFold)) + } + if i.OrganizationIDContainsFold != nil { + predicates = append(predicates, entitlement.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) + } + if i.ExternalCustomerID != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDEQ(*i.ExternalCustomerID)) + } + if i.ExternalCustomerIDNEQ != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDNEQ(*i.ExternalCustomerIDNEQ)) + } + if len(i.ExternalCustomerIDIn) > 0 { + predicates = append(predicates, entitlement.ExternalCustomerIDIn(i.ExternalCustomerIDIn...)) + } + if len(i.ExternalCustomerIDNotIn) > 0 { + predicates = append(predicates, entitlement.ExternalCustomerIDNotIn(i.ExternalCustomerIDNotIn...)) + } + if i.ExternalCustomerIDGT != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDGT(*i.ExternalCustomerIDGT)) + } + if i.ExternalCustomerIDGTE != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDGTE(*i.ExternalCustomerIDGTE)) + } + if i.ExternalCustomerIDLT != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDLT(*i.ExternalCustomerIDLT)) + } + if i.ExternalCustomerIDLTE != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDLTE(*i.ExternalCustomerIDLTE)) + } + if i.ExternalCustomerIDContains != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDContains(*i.ExternalCustomerIDContains)) + } + if i.ExternalCustomerIDHasPrefix != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDHasPrefix(*i.ExternalCustomerIDHasPrefix)) + } + if i.ExternalCustomerIDHasSuffix != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDHasSuffix(*i.ExternalCustomerIDHasSuffix)) + } + if i.ExternalCustomerIDIsNil { + predicates = append(predicates, entitlement.ExternalCustomerIDIsNil()) + } + if i.ExternalCustomerIDNotNil { + predicates = append(predicates, entitlement.ExternalCustomerIDNotNil()) + } + if i.ExternalCustomerIDEqualFold != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDEqualFold(*i.ExternalCustomerIDEqualFold)) + } + if i.ExternalCustomerIDContainsFold != nil { + predicates = append(predicates, entitlement.ExternalCustomerIDContainsFold(*i.ExternalCustomerIDContainsFold)) + } + if i.ExternalSubscriptionID != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDEQ(*i.ExternalSubscriptionID)) + } + if i.ExternalSubscriptionIDNEQ != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDNEQ(*i.ExternalSubscriptionIDNEQ)) + } + if len(i.ExternalSubscriptionIDIn) > 0 { + predicates = append(predicates, entitlement.ExternalSubscriptionIDIn(i.ExternalSubscriptionIDIn...)) + } + if len(i.ExternalSubscriptionIDNotIn) > 0 { + predicates = append(predicates, entitlement.ExternalSubscriptionIDNotIn(i.ExternalSubscriptionIDNotIn...)) + } + if i.ExternalSubscriptionIDGT != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDGT(*i.ExternalSubscriptionIDGT)) + } + if i.ExternalSubscriptionIDGTE != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDGTE(*i.ExternalSubscriptionIDGTE)) + } + if i.ExternalSubscriptionIDLT != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDLT(*i.ExternalSubscriptionIDLT)) + } + if i.ExternalSubscriptionIDLTE != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDLTE(*i.ExternalSubscriptionIDLTE)) + } + if i.ExternalSubscriptionIDContains != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDContains(*i.ExternalSubscriptionIDContains)) + } + if i.ExternalSubscriptionIDHasPrefix != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDHasPrefix(*i.ExternalSubscriptionIDHasPrefix)) + } + if i.ExternalSubscriptionIDHasSuffix != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDHasSuffix(*i.ExternalSubscriptionIDHasSuffix)) + } + if i.ExternalSubscriptionIDIsNil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDIsNil()) + } + if i.ExternalSubscriptionIDNotNil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDNotNil()) + } + if i.ExternalSubscriptionIDEqualFold != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDEqualFold(*i.ExternalSubscriptionIDEqualFold)) + } + if i.ExternalSubscriptionIDContainsFold != nil { + predicates = append(predicates, entitlement.ExternalSubscriptionIDContainsFold(*i.ExternalSubscriptionIDContainsFold)) + } + if i.Expires != nil { + predicates = append(predicates, entitlement.ExpiresEQ(*i.Expires)) + } + if i.ExpiresNEQ != nil { + predicates = append(predicates, entitlement.ExpiresNEQ(*i.ExpiresNEQ)) + } + if i.ExpiresAt != nil { + predicates = append(predicates, entitlement.ExpiresAtEQ(*i.ExpiresAt)) + } + if i.ExpiresAtNEQ != nil { + predicates = append(predicates, entitlement.ExpiresAtNEQ(*i.ExpiresAtNEQ)) + } + if len(i.ExpiresAtIn) > 0 { + predicates = append(predicates, entitlement.ExpiresAtIn(i.ExpiresAtIn...)) + } + if len(i.ExpiresAtNotIn) > 0 { + predicates = append(predicates, entitlement.ExpiresAtNotIn(i.ExpiresAtNotIn...)) + } + if i.ExpiresAtGT != nil { + predicates = append(predicates, entitlement.ExpiresAtGT(*i.ExpiresAtGT)) + } + if i.ExpiresAtGTE != nil { + predicates = append(predicates, entitlement.ExpiresAtGTE(*i.ExpiresAtGTE)) + } + if i.ExpiresAtLT != nil { + predicates = append(predicates, entitlement.ExpiresAtLT(*i.ExpiresAtLT)) + } + if i.ExpiresAtLTE != nil { + predicates = append(predicates, entitlement.ExpiresAtLTE(*i.ExpiresAtLTE)) + } + if i.ExpiresAtIsNil { + predicates = append(predicates, entitlement.ExpiresAtIsNil()) + } + if i.ExpiresAtNotNil { + predicates = append(predicates, entitlement.ExpiresAtNotNil()) + } + if i.Cancelled != nil { + predicates = append(predicates, entitlement.CancelledEQ(*i.Cancelled)) + } + if i.CancelledNEQ != nil { + predicates = append(predicates, entitlement.CancelledNEQ(*i.CancelledNEQ)) + } + + if i.HasOwner != nil { + p := entitlement.HasOwner() + if !*i.HasOwner { + p = entitlement.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlement.HasOwnerWith(with...)) + } + if i.HasPlan != nil { + p := entitlement.HasPlan() + if !*i.HasPlan { + p = entitlement.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasPlanWith) > 0 { + with := make([]predicate.EntitlementPlan, 0, len(i.HasPlanWith)) + for _, w := range i.HasPlanWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasPlanWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlement.HasPlanWith(with...)) + } + if i.HasOrganization != nil { + p := entitlement.HasOrganization() + if !*i.HasOrganization { + p = entitlement.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationWith)) + for _, w := range i.HasOrganizationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlement.HasOrganizationWith(with...)) + } + if i.HasEvents != nil { + p := entitlement.HasEvents() + if !*i.HasEvents { + p = entitlement.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlement.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyEntitlementWhereInput + case 1: + return predicates[0], nil + default: + return entitlement.And(predicates...), nil + } +} + +// EntitlementHistoryWhereInput represents a where input for filtering EntitlementHistory queries. +type EntitlementHistoryWhereInput struct { + Predicates []predicate.EntitlementHistory `json:"-"` + Not *EntitlementHistoryWhereInput `json:"not,omitempty"` + Or []*EntitlementHistoryWhereInput `json:"or,omitempty"` + And []*EntitlementHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "plan_id" field predicates. + PlanID *string `json:"planID,omitempty"` + PlanIDNEQ *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGT *string `json:"planIDGT,omitempty"` + PlanIDGTE *string `json:"planIDGTE,omitempty"` + PlanIDLT *string `json:"planIDLT,omitempty"` + PlanIDLTE *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + + // "organization_id" field predicates. + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNEQ *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGT *string `json:"organizationIDGT,omitempty"` + OrganizationIDGTE *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLT *string `json:"organizationIDLT,omitempty"` + OrganizationIDLTE *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + + // "external_customer_id" field predicates. + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ExternalCustomerIDNEQ *string `json:"externalCustomerIDNEQ,omitempty"` + ExternalCustomerIDIn []string `json:"externalCustomerIDIn,omitempty"` + ExternalCustomerIDNotIn []string `json:"externalCustomerIDNotIn,omitempty"` + ExternalCustomerIDGT *string `json:"externalCustomerIDGT,omitempty"` + ExternalCustomerIDGTE *string `json:"externalCustomerIDGTE,omitempty"` + ExternalCustomerIDLT *string `json:"externalCustomerIDLT,omitempty"` + ExternalCustomerIDLTE *string `json:"externalCustomerIDLTE,omitempty"` + ExternalCustomerIDContains *string `json:"externalCustomerIDContains,omitempty"` + ExternalCustomerIDHasPrefix *string `json:"externalCustomerIDHasPrefix,omitempty"` + ExternalCustomerIDHasSuffix *string `json:"externalCustomerIDHasSuffix,omitempty"` + ExternalCustomerIDIsNil bool `json:"externalCustomerIDIsNil,omitempty"` + ExternalCustomerIDNotNil bool `json:"externalCustomerIDNotNil,omitempty"` + ExternalCustomerIDEqualFold *string `json:"externalCustomerIDEqualFold,omitempty"` + ExternalCustomerIDContainsFold *string `json:"externalCustomerIDContainsFold,omitempty"` + + // "external_subscription_id" field predicates. + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ExternalSubscriptionIDNEQ *string `json:"externalSubscriptionIDNEQ,omitempty"` + ExternalSubscriptionIDIn []string `json:"externalSubscriptionIDIn,omitempty"` + ExternalSubscriptionIDNotIn []string `json:"externalSubscriptionIDNotIn,omitempty"` + ExternalSubscriptionIDGT *string `json:"externalSubscriptionIDGT,omitempty"` + ExternalSubscriptionIDGTE *string `json:"externalSubscriptionIDGTE,omitempty"` + ExternalSubscriptionIDLT *string `json:"externalSubscriptionIDLT,omitempty"` + ExternalSubscriptionIDLTE *string `json:"externalSubscriptionIDLTE,omitempty"` + ExternalSubscriptionIDContains *string `json:"externalSubscriptionIDContains,omitempty"` + ExternalSubscriptionIDHasPrefix *string `json:"externalSubscriptionIDHasPrefix,omitempty"` + ExternalSubscriptionIDHasSuffix *string `json:"externalSubscriptionIDHasSuffix,omitempty"` + ExternalSubscriptionIDIsNil bool `json:"externalSubscriptionIDIsNil,omitempty"` + ExternalSubscriptionIDNotNil bool `json:"externalSubscriptionIDNotNil,omitempty"` + ExternalSubscriptionIDEqualFold *string `json:"externalSubscriptionIDEqualFold,omitempty"` + ExternalSubscriptionIDContainsFold *string `json:"externalSubscriptionIDContainsFold,omitempty"` + + // "expires" field predicates. + Expires *bool `json:"expires,omitempty"` + ExpiresNEQ *bool `json:"expiresNEQ,omitempty"` + + // "expires_at" field predicates. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNEQ *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGT *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGTE *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLT *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLTE *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil bool `json:"expiresAtNotNil,omitempty"` + + // "cancelled" field predicates. + Cancelled *bool `json:"cancelled,omitempty"` + CancelledNEQ *bool `json:"cancelledNEQ,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntitlementHistoryWhereInput) AddPredicates(predicates ...predicate.EntitlementHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntitlementHistoryWhereInput filter on the EntitlementHistoryQuery builder. +func (i *EntitlementHistoryWhereInput) Filter(q *EntitlementHistoryQuery) (*EntitlementHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntitlementHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntitlementHistoryWhereInput is returned in case the EntitlementHistoryWhereInput is empty. +var ErrEmptyEntitlementHistoryWhereInput = errors.New("generated: empty predicate EntitlementHistoryWhereInput") + +// P returns a predicate for filtering entitlementhistories. +// An error is returned if the input is empty or invalid. +func (i *EntitlementHistoryWhereInput) P() (predicate.EntitlementHistory, error) { + var predicates []predicate.EntitlementHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitlementhistory.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.EntitlementHistory, 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, entitlementhistory.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.EntitlementHistory, 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, entitlementhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitlementhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitlementhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitlementhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitlementhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitlementhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitlementhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitlementhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitlementhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitlementhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitlementhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, entitlementhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, entitlementhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, entitlementhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, entitlementhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, entitlementhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, entitlementhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, entitlementhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, entitlementhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, entitlementhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, entitlementhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, entitlementhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, entitlementhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, entitlementhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, entitlementhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, entitlementhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, entitlementhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, entitlementhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, entitlementhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, entitlementhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, entitlementhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, entitlementhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, entitlementhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, entitlementhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, entitlementhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, entitlementhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, entitlementhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, entitlementhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitlementhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitlementhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitlementhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitlementhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitlementhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitlementhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitlementhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitlementhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitlementhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitlementhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitlementhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitlementhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitlementhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitlementhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitlementhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitlementhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitlementhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitlementhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitlementhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitlementhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitlementhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitlementhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitlementhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitlementhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitlementhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitlementhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitlementhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitlementhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitlementhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitlementhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitlementhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitlementhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitlementhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitlementhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitlementhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitlementhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitlementhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitlementhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitlementhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitlementhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitlementhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitlementhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitlementhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitlementhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitlementhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitlementhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitlementhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitlementhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitlementhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitlementhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitlementhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitlementhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitlementhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitlementhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitlementhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitlementhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitlementhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitlementhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitlementhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitlementhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitlementhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitlementhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitlementhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitlementhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitlementhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitlementhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitlementhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitlementhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitlementhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitlementhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitlementhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitlementhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitlementhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitlementhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitlementhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitlementhistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitlementhistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitlementhistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitlementhistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitlementhistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitlementhistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitlementhistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitlementhistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitlementhistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitlementhistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitlementhistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitlementhistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitlementhistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitlementhistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitlementhistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.PlanID != nil { + predicates = append(predicates, entitlementhistory.PlanIDEQ(*i.PlanID)) + } + if i.PlanIDNEQ != nil { + predicates = append(predicates, entitlementhistory.PlanIDNEQ(*i.PlanIDNEQ)) + } + if len(i.PlanIDIn) > 0 { + predicates = append(predicates, entitlementhistory.PlanIDIn(i.PlanIDIn...)) + } + if len(i.PlanIDNotIn) > 0 { + predicates = append(predicates, entitlementhistory.PlanIDNotIn(i.PlanIDNotIn...)) + } + if i.PlanIDGT != nil { + predicates = append(predicates, entitlementhistory.PlanIDGT(*i.PlanIDGT)) + } + if i.PlanIDGTE != nil { + predicates = append(predicates, entitlementhistory.PlanIDGTE(*i.PlanIDGTE)) + } + if i.PlanIDLT != nil { + predicates = append(predicates, entitlementhistory.PlanIDLT(*i.PlanIDLT)) + } + if i.PlanIDLTE != nil { + predicates = append(predicates, entitlementhistory.PlanIDLTE(*i.PlanIDLTE)) + } + if i.PlanIDContains != nil { + predicates = append(predicates, entitlementhistory.PlanIDContains(*i.PlanIDContains)) + } + if i.PlanIDHasPrefix != nil { + predicates = append(predicates, entitlementhistory.PlanIDHasPrefix(*i.PlanIDHasPrefix)) + } + if i.PlanIDHasSuffix != nil { + predicates = append(predicates, entitlementhistory.PlanIDHasSuffix(*i.PlanIDHasSuffix)) + } + if i.PlanIDEqualFold != nil { + predicates = append(predicates, entitlementhistory.PlanIDEqualFold(*i.PlanIDEqualFold)) + } + if i.PlanIDContainsFold != nil { + predicates = append(predicates, entitlementhistory.PlanIDContainsFold(*i.PlanIDContainsFold)) + } + if i.OrganizationID != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDEQ(*i.OrganizationID)) + } + if i.OrganizationIDNEQ != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDNEQ(*i.OrganizationIDNEQ)) + } + if len(i.OrganizationIDIn) > 0 { + predicates = append(predicates, entitlementhistory.OrganizationIDIn(i.OrganizationIDIn...)) + } + if len(i.OrganizationIDNotIn) > 0 { + predicates = append(predicates, entitlementhistory.OrganizationIDNotIn(i.OrganizationIDNotIn...)) + } + if i.OrganizationIDGT != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDGT(*i.OrganizationIDGT)) + } + if i.OrganizationIDGTE != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDGTE(*i.OrganizationIDGTE)) + } + if i.OrganizationIDLT != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDLT(*i.OrganizationIDLT)) + } + if i.OrganizationIDLTE != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDLTE(*i.OrganizationIDLTE)) + } + if i.OrganizationIDContains != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDContains(*i.OrganizationIDContains)) + } + if i.OrganizationIDHasPrefix != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDHasPrefix(*i.OrganizationIDHasPrefix)) + } + if i.OrganizationIDHasSuffix != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDHasSuffix(*i.OrganizationIDHasSuffix)) + } + if i.OrganizationIDEqualFold != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDEqualFold(*i.OrganizationIDEqualFold)) + } + if i.OrganizationIDContainsFold != nil { + predicates = append(predicates, entitlementhistory.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) + } + if i.ExternalCustomerID != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDEQ(*i.ExternalCustomerID)) + } + if i.ExternalCustomerIDNEQ != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDNEQ(*i.ExternalCustomerIDNEQ)) + } + if len(i.ExternalCustomerIDIn) > 0 { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDIn(i.ExternalCustomerIDIn...)) + } + if len(i.ExternalCustomerIDNotIn) > 0 { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDNotIn(i.ExternalCustomerIDNotIn...)) + } + if i.ExternalCustomerIDGT != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDGT(*i.ExternalCustomerIDGT)) + } + if i.ExternalCustomerIDGTE != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDGTE(*i.ExternalCustomerIDGTE)) + } + if i.ExternalCustomerIDLT != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDLT(*i.ExternalCustomerIDLT)) + } + if i.ExternalCustomerIDLTE != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDLTE(*i.ExternalCustomerIDLTE)) + } + if i.ExternalCustomerIDContains != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDContains(*i.ExternalCustomerIDContains)) + } + if i.ExternalCustomerIDHasPrefix != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDHasPrefix(*i.ExternalCustomerIDHasPrefix)) + } + if i.ExternalCustomerIDHasSuffix != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDHasSuffix(*i.ExternalCustomerIDHasSuffix)) + } + if i.ExternalCustomerIDIsNil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDIsNil()) + } + if i.ExternalCustomerIDNotNil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDNotNil()) + } + if i.ExternalCustomerIDEqualFold != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDEqualFold(*i.ExternalCustomerIDEqualFold)) + } + if i.ExternalCustomerIDContainsFold != nil { + predicates = append(predicates, entitlementhistory.ExternalCustomerIDContainsFold(*i.ExternalCustomerIDContainsFold)) + } + if i.ExternalSubscriptionID != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDEQ(*i.ExternalSubscriptionID)) + } + if i.ExternalSubscriptionIDNEQ != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDNEQ(*i.ExternalSubscriptionIDNEQ)) + } + if len(i.ExternalSubscriptionIDIn) > 0 { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDIn(i.ExternalSubscriptionIDIn...)) + } + if len(i.ExternalSubscriptionIDNotIn) > 0 { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDNotIn(i.ExternalSubscriptionIDNotIn...)) + } + if i.ExternalSubscriptionIDGT != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDGT(*i.ExternalSubscriptionIDGT)) + } + if i.ExternalSubscriptionIDGTE != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDGTE(*i.ExternalSubscriptionIDGTE)) + } + if i.ExternalSubscriptionIDLT != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDLT(*i.ExternalSubscriptionIDLT)) + } + if i.ExternalSubscriptionIDLTE != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDLTE(*i.ExternalSubscriptionIDLTE)) + } + if i.ExternalSubscriptionIDContains != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDContains(*i.ExternalSubscriptionIDContains)) + } + if i.ExternalSubscriptionIDHasPrefix != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDHasPrefix(*i.ExternalSubscriptionIDHasPrefix)) + } + if i.ExternalSubscriptionIDHasSuffix != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDHasSuffix(*i.ExternalSubscriptionIDHasSuffix)) + } + if i.ExternalSubscriptionIDIsNil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDIsNil()) + } + if i.ExternalSubscriptionIDNotNil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDNotNil()) + } + if i.ExternalSubscriptionIDEqualFold != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDEqualFold(*i.ExternalSubscriptionIDEqualFold)) + } + if i.ExternalSubscriptionIDContainsFold != nil { + predicates = append(predicates, entitlementhistory.ExternalSubscriptionIDContainsFold(*i.ExternalSubscriptionIDContainsFold)) + } + if i.Expires != nil { + predicates = append(predicates, entitlementhistory.ExpiresEQ(*i.Expires)) + } + if i.ExpiresNEQ != nil { + predicates = append(predicates, entitlementhistory.ExpiresNEQ(*i.ExpiresNEQ)) + } + if i.ExpiresAt != nil { + predicates = append(predicates, entitlementhistory.ExpiresAtEQ(*i.ExpiresAt)) + } + if i.ExpiresAtNEQ != nil { + predicates = append(predicates, entitlementhistory.ExpiresAtNEQ(*i.ExpiresAtNEQ)) + } + if len(i.ExpiresAtIn) > 0 { + predicates = append(predicates, entitlementhistory.ExpiresAtIn(i.ExpiresAtIn...)) + } + if len(i.ExpiresAtNotIn) > 0 { + predicates = append(predicates, entitlementhistory.ExpiresAtNotIn(i.ExpiresAtNotIn...)) + } + if i.ExpiresAtGT != nil { + predicates = append(predicates, entitlementhistory.ExpiresAtGT(*i.ExpiresAtGT)) + } + if i.ExpiresAtGTE != nil { + predicates = append(predicates, entitlementhistory.ExpiresAtGTE(*i.ExpiresAtGTE)) + } + if i.ExpiresAtLT != nil { + predicates = append(predicates, entitlementhistory.ExpiresAtLT(*i.ExpiresAtLT)) + } + if i.ExpiresAtLTE != nil { + predicates = append(predicates, entitlementhistory.ExpiresAtLTE(*i.ExpiresAtLTE)) + } + if i.ExpiresAtIsNil { + predicates = append(predicates, entitlementhistory.ExpiresAtIsNil()) + } + if i.ExpiresAtNotNil { + predicates = append(predicates, entitlementhistory.ExpiresAtNotNil()) + } + if i.Cancelled != nil { + predicates = append(predicates, entitlementhistory.CancelledEQ(*i.Cancelled)) + } + if i.CancelledNEQ != nil { + predicates = append(predicates, entitlementhistory.CancelledNEQ(*i.CancelledNEQ)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyEntitlementHistoryWhereInput + case 1: + return predicates[0], nil + default: + return entitlementhistory.And(predicates...), nil + } +} + +// EntitlementPlanWhereInput represents a where input for filtering EntitlementPlan queries. +type EntitlementPlanWhereInput struct { + Predicates []predicate.EntitlementPlan `json:"-"` + Not *EntitlementPlanWhereInput `json:"not,omitempty"` + Or []*EntitlementPlanWhereInput `json:"or,omitempty"` + And []*EntitlementPlanWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "description" field predicates. + Description *string `json:"description,omitempty"` + DescriptionNEQ *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGT *string `json:"descriptionGT,omitempty"` + DescriptionGTE *string `json:"descriptionGTE,omitempty"` + DescriptionLT *string `json:"descriptionLT,omitempty"` + DescriptionLTE *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + + // "version" field predicates. + Version *string `json:"version,omitempty"` + VersionNEQ *string `json:"versionNEQ,omitempty"` + VersionIn []string `json:"versionIn,omitempty"` + VersionNotIn []string `json:"versionNotIn,omitempty"` + VersionGT *string `json:"versionGT,omitempty"` + VersionGTE *string `json:"versionGTE,omitempty"` + VersionLT *string `json:"versionLT,omitempty"` + VersionLTE *string `json:"versionLTE,omitempty"` + VersionContains *string `json:"versionContains,omitempty"` + VersionHasPrefix *string `json:"versionHasPrefix,omitempty"` + VersionHasSuffix *string `json:"versionHasSuffix,omitempty"` + VersionEqualFold *string `json:"versionEqualFold,omitempty"` + VersionContainsFold *string `json:"versionContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "entitlements" edge predicates. + HasEntitlements *bool `json:"hasEntitlements,omitempty"` + HasEntitlementsWith []*EntitlementWhereInput `json:"hasEntitlementsWith,omitempty"` + + // "base_features" edge predicates. + HasBaseFeatures *bool `json:"hasBaseFeatures,omitempty"` + HasBaseFeaturesWith []*FeatureWhereInput `json:"hasBaseFeaturesWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + + // "features" edge predicates. + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasFeaturesWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntitlementPlanWhereInput) AddPredicates(predicates ...predicate.EntitlementPlan) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntitlementPlanWhereInput filter on the EntitlementPlanQuery builder. +func (i *EntitlementPlanWhereInput) Filter(q *EntitlementPlanQuery) (*EntitlementPlanQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntitlementPlanWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntitlementPlanWhereInput is returned in case the EntitlementPlanWhereInput is empty. +var ErrEmptyEntitlementPlanWhereInput = errors.New("generated: empty predicate EntitlementPlanWhereInput") + +// P returns a predicate for filtering entitlementplans. +// An error is returned if the input is empty or invalid. +func (i *EntitlementPlanWhereInput) P() (predicate.EntitlementPlan, error) { + var predicates []predicate.EntitlementPlan + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitlementplan.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.EntitlementPlan, 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, entitlementplan.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.EntitlementPlan, 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, entitlementplan.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitlementplan.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitlementplan.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitlementplan.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitlementplan.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitlementplan.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitlementplan.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitlementplan.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitlementplan.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitlementplan.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitlementplan.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitlementplan.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitlementplan.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitlementplan.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplan.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitlementplan.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitlementplan.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitlementplan.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitlementplan.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitlementplan.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitlementplan.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitlementplan.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitlementplan.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitlementplan.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplan.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitlementplan.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitlementplan.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitlementplan.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitlementplan.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitlementplan.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitlementplan.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitlementplan.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitlementplan.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitlementplan.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitlementplan.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitlementplan.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitlementplan.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitlementplan.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitlementplan.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitlementplan.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitlementplan.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitlementplan.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitlementplan.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitlementplan.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitlementplan.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitlementplan.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitlementplan.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitlementplan.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitlementplan.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitlementplan.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitlementplan.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitlementplan.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitlementplan.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitlementplan.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitlementplan.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitlementplan.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitlementplan.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitlementplan.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitlementplan.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitlementplan.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitlementplan.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitlementplan.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitlementplan.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitlementplan.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitlementplan.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitlementplan.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitlementplan.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitlementplan.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitlementplan.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitlementplan.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitlementplan.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitlementplan.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitlementplan.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitlementplan.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitlementplan.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitlementplan.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitlementplan.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitlementplan.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitlementplan.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitlementplan.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitlementplan.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitlementplan.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitlementplan.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitlementplan.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitlementplan.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitlementplan.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitlementplan.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitlementplan.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitlementplan.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitlementplan.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitlementplan.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitlementplan.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitlementplan.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitlementplan.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitlementplan.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitlementplan.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitlementplan.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitlementplan.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitlementplan.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitlementplan.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitlementplan.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, entitlementplan.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, entitlementplan.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, entitlementplan.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, entitlementplan.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, entitlementplan.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, entitlementplan.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, entitlementplan.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, entitlementplan.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, entitlementplan.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, entitlementplan.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, entitlementplan.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameIsNil { + predicates = append(predicates, entitlementplan.DisplayNameIsNil()) + } + if i.DisplayNameNotNil { + predicates = append(predicates, entitlementplan.DisplayNameNotNil()) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, entitlementplan.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, entitlementplan.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, entitlementplan.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, entitlementplan.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, entitlementplan.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, entitlementplan.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, entitlementplan.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, entitlementplan.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, entitlementplan.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, entitlementplan.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, entitlementplan.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, entitlementplan.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, entitlementplan.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, entitlementplan.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, entitlementplan.NameContainsFold(*i.NameContainsFold)) + } + if i.Description != nil { + predicates = append(predicates, entitlementplan.DescriptionEQ(*i.Description)) + } + if i.DescriptionNEQ != nil { + predicates = append(predicates, entitlementplan.DescriptionNEQ(*i.DescriptionNEQ)) + } + if len(i.DescriptionIn) > 0 { + predicates = append(predicates, entitlementplan.DescriptionIn(i.DescriptionIn...)) + } + if len(i.DescriptionNotIn) > 0 { + predicates = append(predicates, entitlementplan.DescriptionNotIn(i.DescriptionNotIn...)) + } + if i.DescriptionGT != nil { + predicates = append(predicates, entitlementplan.DescriptionGT(*i.DescriptionGT)) + } + if i.DescriptionGTE != nil { + predicates = append(predicates, entitlementplan.DescriptionGTE(*i.DescriptionGTE)) + } + if i.DescriptionLT != nil { + predicates = append(predicates, entitlementplan.DescriptionLT(*i.DescriptionLT)) + } + if i.DescriptionLTE != nil { + predicates = append(predicates, entitlementplan.DescriptionLTE(*i.DescriptionLTE)) + } + if i.DescriptionContains != nil { + predicates = append(predicates, entitlementplan.DescriptionContains(*i.DescriptionContains)) + } + if i.DescriptionHasPrefix != nil { + predicates = append(predicates, entitlementplan.DescriptionHasPrefix(*i.DescriptionHasPrefix)) + } + if i.DescriptionHasSuffix != nil { + predicates = append(predicates, entitlementplan.DescriptionHasSuffix(*i.DescriptionHasSuffix)) + } + if i.DescriptionIsNil { + predicates = append(predicates, entitlementplan.DescriptionIsNil()) + } + if i.DescriptionNotNil { + predicates = append(predicates, entitlementplan.DescriptionNotNil()) + } + if i.DescriptionEqualFold != nil { + predicates = append(predicates, entitlementplan.DescriptionEqualFold(*i.DescriptionEqualFold)) + } + if i.DescriptionContainsFold != nil { + predicates = append(predicates, entitlementplan.DescriptionContainsFold(*i.DescriptionContainsFold)) + } + if i.Version != nil { + predicates = append(predicates, entitlementplan.VersionEQ(*i.Version)) + } + if i.VersionNEQ != nil { + predicates = append(predicates, entitlementplan.VersionNEQ(*i.VersionNEQ)) + } + if len(i.VersionIn) > 0 { + predicates = append(predicates, entitlementplan.VersionIn(i.VersionIn...)) + } + if len(i.VersionNotIn) > 0 { + predicates = append(predicates, entitlementplan.VersionNotIn(i.VersionNotIn...)) + } + if i.VersionGT != nil { + predicates = append(predicates, entitlementplan.VersionGT(*i.VersionGT)) + } + if i.VersionGTE != nil { + predicates = append(predicates, entitlementplan.VersionGTE(*i.VersionGTE)) + } + if i.VersionLT != nil { + predicates = append(predicates, entitlementplan.VersionLT(*i.VersionLT)) + } + if i.VersionLTE != nil { + predicates = append(predicates, entitlementplan.VersionLTE(*i.VersionLTE)) + } + if i.VersionContains != nil { + predicates = append(predicates, entitlementplan.VersionContains(*i.VersionContains)) + } + if i.VersionHasPrefix != nil { + predicates = append(predicates, entitlementplan.VersionHasPrefix(*i.VersionHasPrefix)) + } + if i.VersionHasSuffix != nil { + predicates = append(predicates, entitlementplan.VersionHasSuffix(*i.VersionHasSuffix)) + } + if i.VersionEqualFold != nil { + predicates = append(predicates, entitlementplan.VersionEqualFold(*i.VersionEqualFold)) + } + if i.VersionContainsFold != nil { + predicates = append(predicates, entitlementplan.VersionContainsFold(*i.VersionContainsFold)) + } + + if i.HasOwner != nil { + p := entitlementplan.HasOwner() + if !*i.HasOwner { + p = entitlementplan.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplan.HasOwnerWith(with...)) + } + if i.HasEntitlements != nil { + p := entitlementplan.HasEntitlements() + if !*i.HasEntitlements { + p = entitlementplan.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitlementsWith) > 0 { + with := make([]predicate.Entitlement, 0, len(i.HasEntitlementsWith)) + for _, w := range i.HasEntitlementsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitlementsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplan.HasEntitlementsWith(with...)) + } + if i.HasBaseFeatures != nil { + p := entitlementplan.HasBaseFeatures() + if !*i.HasBaseFeatures { + p = entitlementplan.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasBaseFeaturesWith) > 0 { + with := make([]predicate.Feature, 0, len(i.HasBaseFeaturesWith)) + for _, w := range i.HasBaseFeaturesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasBaseFeaturesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplan.HasBaseFeaturesWith(with...)) + } + if i.HasEvents != nil { + p := entitlementplan.HasEvents() + if !*i.HasEvents { + p = entitlementplan.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplan.HasEventsWith(with...)) + } + if i.HasFeatures != nil { + p := entitlementplan.HasFeatures() + if !*i.HasFeatures { + p = entitlementplan.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFeaturesWith) > 0 { + with := make([]predicate.EntitlementPlanFeature, 0, len(i.HasFeaturesWith)) + for _, w := range i.HasFeaturesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFeaturesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplan.HasFeaturesWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyEntitlementPlanWhereInput + case 1: + return predicates[0], nil + default: + return entitlementplan.And(predicates...), nil + } +} + +// EntitlementPlanFeatureWhereInput represents a where input for filtering EntitlementPlanFeature queries. +type EntitlementPlanFeatureWhereInput struct { + Predicates []predicate.EntitlementPlanFeature `json:"-"` + Not *EntitlementPlanFeatureWhereInput `json:"not,omitempty"` + Or []*EntitlementPlanFeatureWhereInput `json:"or,omitempty"` + And []*EntitlementPlanFeatureWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "plan_id" field predicates. + PlanID *string `json:"planID,omitempty"` + PlanIDNEQ *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGT *string `json:"planIDGT,omitempty"` + PlanIDGTE *string `json:"planIDGTE,omitempty"` + PlanIDLT *string `json:"planIDLT,omitempty"` + PlanIDLTE *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + + // "feature_id" field predicates. + FeatureID *string `json:"featureID,omitempty"` + FeatureIDNEQ *string `json:"featureIDNEQ,omitempty"` + FeatureIDIn []string `json:"featureIDIn,omitempty"` + FeatureIDNotIn []string `json:"featureIDNotIn,omitempty"` + FeatureIDGT *string `json:"featureIDGT,omitempty"` + FeatureIDGTE *string `json:"featureIDGTE,omitempty"` + FeatureIDLT *string `json:"featureIDLT,omitempty"` + FeatureIDLTE *string `json:"featureIDLTE,omitempty"` + FeatureIDContains *string `json:"featureIDContains,omitempty"` + FeatureIDHasPrefix *string `json:"featureIDHasPrefix,omitempty"` + FeatureIDHasSuffix *string `json:"featureIDHasSuffix,omitempty"` + FeatureIDEqualFold *string `json:"featureIDEqualFold,omitempty"` + FeatureIDContainsFold *string `json:"featureIDContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "plan" edge predicates. + HasPlan *bool `json:"hasPlan,omitempty"` + HasPlanWith []*EntitlementPlanWhereInput `json:"hasPlanWith,omitempty"` + + // "feature" edge predicates. + HasFeature *bool `json:"hasFeature,omitempty"` + HasFeatureWith []*FeatureWhereInput `json:"hasFeatureWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntitlementPlanFeatureWhereInput) AddPredicates(predicates ...predicate.EntitlementPlanFeature) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntitlementPlanFeatureWhereInput filter on the EntitlementPlanFeatureQuery builder. +func (i *EntitlementPlanFeatureWhereInput) Filter(q *EntitlementPlanFeatureQuery) (*EntitlementPlanFeatureQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntitlementPlanFeatureWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntitlementPlanFeatureWhereInput is returned in case the EntitlementPlanFeatureWhereInput is empty. +var ErrEmptyEntitlementPlanFeatureWhereInput = errors.New("generated: empty predicate EntitlementPlanFeatureWhereInput") + +// P returns a predicate for filtering entitlementplanfeatures. +// An error is returned if the input is empty or invalid. +func (i *EntitlementPlanFeatureWhereInput) P() (predicate.EntitlementPlanFeature, error) { + var predicates []predicate.EntitlementPlanFeature + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitlementplanfeature.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.EntitlementPlanFeature, 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, entitlementplanfeature.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.EntitlementPlanFeature, 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, entitlementplanfeature.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitlementplanfeature.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitlementplanfeature.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitlementplanfeature.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitlementplanfeature.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitlementplanfeature.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitlementplanfeature.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitlementplanfeature.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitlementplanfeature.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitlementplanfeature.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitlementplanfeature.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitlementplanfeature.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitlementplanfeature.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitlementplanfeature.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitlementplanfeature.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitlementplanfeature.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitlementplanfeature.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitlementplanfeature.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitlementplanfeature.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitlementplanfeature.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitlementplanfeature.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitlementplanfeature.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitlementplanfeature.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitlementplanfeature.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitlementplanfeature.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitlementplanfeature.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitlementplanfeature.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitlementplanfeature.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitlementplanfeature.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitlementplanfeature.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitlementplanfeature.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitlementplanfeature.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitlementplanfeature.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitlementplanfeature.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitlementplanfeature.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitlementplanfeature.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitlementplanfeature.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitlementplanfeature.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitlementplanfeature.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitlementplanfeature.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitlementplanfeature.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitlementplanfeature.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitlementplanfeature.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitlementplanfeature.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitlementplanfeature.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitlementplanfeature.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.PlanID != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDEQ(*i.PlanID)) + } + if i.PlanIDNEQ != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDNEQ(*i.PlanIDNEQ)) + } + if len(i.PlanIDIn) > 0 { + predicates = append(predicates, entitlementplanfeature.PlanIDIn(i.PlanIDIn...)) + } + if len(i.PlanIDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.PlanIDNotIn(i.PlanIDNotIn...)) + } + if i.PlanIDGT != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDGT(*i.PlanIDGT)) + } + if i.PlanIDGTE != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDGTE(*i.PlanIDGTE)) + } + if i.PlanIDLT != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDLT(*i.PlanIDLT)) + } + if i.PlanIDLTE != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDLTE(*i.PlanIDLTE)) + } + if i.PlanIDContains != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDContains(*i.PlanIDContains)) + } + if i.PlanIDHasPrefix != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDHasPrefix(*i.PlanIDHasPrefix)) + } + if i.PlanIDHasSuffix != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDHasSuffix(*i.PlanIDHasSuffix)) + } + if i.PlanIDEqualFold != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDEqualFold(*i.PlanIDEqualFold)) + } + if i.PlanIDContainsFold != nil { + predicates = append(predicates, entitlementplanfeature.PlanIDContainsFold(*i.PlanIDContainsFold)) + } + if i.FeatureID != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDEQ(*i.FeatureID)) + } + if i.FeatureIDNEQ != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDNEQ(*i.FeatureIDNEQ)) + } + if len(i.FeatureIDIn) > 0 { + predicates = append(predicates, entitlementplanfeature.FeatureIDIn(i.FeatureIDIn...)) + } + if len(i.FeatureIDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeature.FeatureIDNotIn(i.FeatureIDNotIn...)) + } + if i.FeatureIDGT != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDGT(*i.FeatureIDGT)) + } + if i.FeatureIDGTE != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDGTE(*i.FeatureIDGTE)) + } + if i.FeatureIDLT != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDLT(*i.FeatureIDLT)) + } + if i.FeatureIDLTE != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDLTE(*i.FeatureIDLTE)) + } + if i.FeatureIDContains != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDContains(*i.FeatureIDContains)) + } + if i.FeatureIDHasPrefix != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDHasPrefix(*i.FeatureIDHasPrefix)) + } + if i.FeatureIDHasSuffix != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDHasSuffix(*i.FeatureIDHasSuffix)) + } + if i.FeatureIDEqualFold != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDEqualFold(*i.FeatureIDEqualFold)) + } + if i.FeatureIDContainsFold != nil { + predicates = append(predicates, entitlementplanfeature.FeatureIDContainsFold(*i.FeatureIDContainsFold)) + } + + if i.HasOwner != nil { + p := entitlementplanfeature.HasOwner() + if !*i.HasOwner { + p = entitlementplanfeature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplanfeature.HasOwnerWith(with...)) + } + if i.HasPlan != nil { + p := entitlementplanfeature.HasPlan() + if !*i.HasPlan { + p = entitlementplanfeature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasPlanWith) > 0 { + with := make([]predicate.EntitlementPlan, 0, len(i.HasPlanWith)) + for _, w := range i.HasPlanWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasPlanWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplanfeature.HasPlanWith(with...)) + } + if i.HasFeature != nil { + p := entitlementplanfeature.HasFeature() + if !*i.HasFeature { + p = entitlementplanfeature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFeatureWith) > 0 { + with := make([]predicate.Feature, 0, len(i.HasFeatureWith)) + for _, w := range i.HasFeatureWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFeatureWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplanfeature.HasFeatureWith(with...)) + } + if i.HasEvents != nil { + p := entitlementplanfeature.HasEvents() + if !*i.HasEvents { + p = entitlementplanfeature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitlementplanfeature.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyEntitlementPlanFeatureWhereInput + case 1: + return predicates[0], nil + default: + return entitlementplanfeature.And(predicates...), nil + } +} + +// EntitlementPlanFeatureHistoryWhereInput represents a where input for filtering EntitlementPlanFeatureHistory queries. +type EntitlementPlanFeatureHistoryWhereInput struct { + Predicates []predicate.EntitlementPlanFeatureHistory `json:"-"` + Not *EntitlementPlanFeatureHistoryWhereInput `json:"not,omitempty"` + Or []*EntitlementPlanFeatureHistoryWhereInput `json:"or,omitempty"` + And []*EntitlementPlanFeatureHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "plan_id" field predicates. + PlanID *string `json:"planID,omitempty"` + PlanIDNEQ *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGT *string `json:"planIDGT,omitempty"` + PlanIDGTE *string `json:"planIDGTE,omitempty"` + PlanIDLT *string `json:"planIDLT,omitempty"` + PlanIDLTE *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + + // "feature_id" field predicates. + FeatureID *string `json:"featureID,omitempty"` + FeatureIDNEQ *string `json:"featureIDNEQ,omitempty"` + FeatureIDIn []string `json:"featureIDIn,omitempty"` + FeatureIDNotIn []string `json:"featureIDNotIn,omitempty"` + FeatureIDGT *string `json:"featureIDGT,omitempty"` + FeatureIDGTE *string `json:"featureIDGTE,omitempty"` + FeatureIDLT *string `json:"featureIDLT,omitempty"` + FeatureIDLTE *string `json:"featureIDLTE,omitempty"` + FeatureIDContains *string `json:"featureIDContains,omitempty"` + FeatureIDHasPrefix *string `json:"featureIDHasPrefix,omitempty"` + FeatureIDHasSuffix *string `json:"featureIDHasSuffix,omitempty"` + FeatureIDEqualFold *string `json:"featureIDEqualFold,omitempty"` + FeatureIDContainsFold *string `json:"featureIDContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntitlementPlanFeatureHistoryWhereInput) AddPredicates(predicates ...predicate.EntitlementPlanFeatureHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntitlementPlanFeatureHistoryWhereInput filter on the EntitlementPlanFeatureHistoryQuery builder. +func (i *EntitlementPlanFeatureHistoryWhereInput) Filter(q *EntitlementPlanFeatureHistoryQuery) (*EntitlementPlanFeatureHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntitlementPlanFeatureHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntitlementPlanFeatureHistoryWhereInput is returned in case the EntitlementPlanFeatureHistoryWhereInput is empty. +var ErrEmptyEntitlementPlanFeatureHistoryWhereInput = errors.New("generated: empty predicate EntitlementPlanFeatureHistoryWhereInput") + +// P returns a predicate for filtering entitlementplanfeaturehistories. +// An error is returned if the input is empty or invalid. +func (i *EntitlementPlanFeatureHistoryWhereInput) P() (predicate.EntitlementPlanFeatureHistory, error) { + var predicates []predicate.EntitlementPlanFeatureHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitlementplanfeaturehistory.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.EntitlementPlanFeatureHistory, 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, entitlementplanfeaturehistory.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.EntitlementPlanFeatureHistory, 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, entitlementplanfeaturehistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.PlanID != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDEQ(*i.PlanID)) + } + if i.PlanIDNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDNEQ(*i.PlanIDNEQ)) + } + if len(i.PlanIDIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDIn(i.PlanIDIn...)) + } + if len(i.PlanIDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDNotIn(i.PlanIDNotIn...)) + } + if i.PlanIDGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDGT(*i.PlanIDGT)) + } + if i.PlanIDGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDGTE(*i.PlanIDGTE)) + } + if i.PlanIDLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDLT(*i.PlanIDLT)) + } + if i.PlanIDLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDLTE(*i.PlanIDLTE)) + } + if i.PlanIDContains != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDContains(*i.PlanIDContains)) + } + if i.PlanIDHasPrefix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDHasPrefix(*i.PlanIDHasPrefix)) + } + if i.PlanIDHasSuffix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDHasSuffix(*i.PlanIDHasSuffix)) + } + if i.PlanIDEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDEqualFold(*i.PlanIDEqualFold)) + } + if i.PlanIDContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.PlanIDContainsFold(*i.PlanIDContainsFold)) + } + if i.FeatureID != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDEQ(*i.FeatureID)) + } + if i.FeatureIDNEQ != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDNEQ(*i.FeatureIDNEQ)) + } + if len(i.FeatureIDIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDIn(i.FeatureIDIn...)) + } + if len(i.FeatureIDNotIn) > 0 { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDNotIn(i.FeatureIDNotIn...)) + } + if i.FeatureIDGT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDGT(*i.FeatureIDGT)) + } + if i.FeatureIDGTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDGTE(*i.FeatureIDGTE)) + } + if i.FeatureIDLT != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDLT(*i.FeatureIDLT)) + } + if i.FeatureIDLTE != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDLTE(*i.FeatureIDLTE)) + } + if i.FeatureIDContains != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDContains(*i.FeatureIDContains)) + } + if i.FeatureIDHasPrefix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDHasPrefix(*i.FeatureIDHasPrefix)) + } + if i.FeatureIDHasSuffix != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDHasSuffix(*i.FeatureIDHasSuffix)) + } + if i.FeatureIDEqualFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDEqualFold(*i.FeatureIDEqualFold)) + } + if i.FeatureIDContainsFold != nil { + predicates = append(predicates, entitlementplanfeaturehistory.FeatureIDContainsFold(*i.FeatureIDContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyEntitlementPlanFeatureHistoryWhereInput + case 1: + return predicates[0], nil + default: + return entitlementplanfeaturehistory.And(predicates...), nil + } +} + +// EntitlementPlanHistoryWhereInput represents a where input for filtering EntitlementPlanHistory queries. +type EntitlementPlanHistoryWhereInput struct { + Predicates []predicate.EntitlementPlanHistory `json:"-"` + Not *EntitlementPlanHistoryWhereInput `json:"not,omitempty"` + Or []*EntitlementPlanHistoryWhereInput `json:"or,omitempty"` + And []*EntitlementPlanHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "description" field predicates. + Description *string `json:"description,omitempty"` + DescriptionNEQ *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGT *string `json:"descriptionGT,omitempty"` + DescriptionGTE *string `json:"descriptionGTE,omitempty"` + DescriptionLT *string `json:"descriptionLT,omitempty"` + DescriptionLTE *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + + // "version" field predicates. + Version *string `json:"version,omitempty"` + VersionNEQ *string `json:"versionNEQ,omitempty"` + VersionIn []string `json:"versionIn,omitempty"` + VersionNotIn []string `json:"versionNotIn,omitempty"` + VersionGT *string `json:"versionGT,omitempty"` + VersionGTE *string `json:"versionGTE,omitempty"` + VersionLT *string `json:"versionLT,omitempty"` + VersionLTE *string `json:"versionLTE,omitempty"` + VersionContains *string `json:"versionContains,omitempty"` + VersionHasPrefix *string `json:"versionHasPrefix,omitempty"` + VersionHasSuffix *string `json:"versionHasSuffix,omitempty"` + VersionEqualFold *string `json:"versionEqualFold,omitempty"` + VersionContainsFold *string `json:"versionContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntitlementPlanHistoryWhereInput) AddPredicates(predicates ...predicate.EntitlementPlanHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntitlementPlanHistoryWhereInput filter on the EntitlementPlanHistoryQuery builder. +func (i *EntitlementPlanHistoryWhereInput) Filter(q *EntitlementPlanHistoryQuery) (*EntitlementPlanHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntitlementPlanHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntitlementPlanHistoryWhereInput is returned in case the EntitlementPlanHistoryWhereInput is empty. +var ErrEmptyEntitlementPlanHistoryWhereInput = errors.New("generated: empty predicate EntitlementPlanHistoryWhereInput") + +// P returns a predicate for filtering entitlementplanhistories. +// An error is returned if the input is empty or invalid. +func (i *EntitlementPlanHistoryWhereInput) P() (predicate.EntitlementPlanHistory, error) { + var predicates []predicate.EntitlementPlanHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitlementplanhistory.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.EntitlementPlanHistory, 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, entitlementplanhistory.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.EntitlementPlanHistory, 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, entitlementplanhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitlementplanhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitlementplanhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitlementplanhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitlementplanhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitlementplanhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitlementplanhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitlementplanhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, entitlementplanhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, entitlementplanhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, entitlementplanhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, entitlementplanhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, entitlementplanhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, entitlementplanhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, entitlementplanhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, entitlementplanhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, entitlementplanhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, entitlementplanhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, entitlementplanhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, entitlementplanhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, entitlementplanhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, entitlementplanhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, entitlementplanhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, entitlementplanhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, entitlementplanhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, entitlementplanhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, entitlementplanhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, entitlementplanhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitlementplanhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitlementplanhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitlementplanhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitlementplanhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitlementplanhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitlementplanhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitlementplanhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitlementplanhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitlementplanhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitlementplanhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitlementplanhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitlementplanhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitlementplanhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitlementplanhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitlementplanhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitlementplanhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitlementplanhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitlementplanhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitlementplanhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitlementplanhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitlementplanhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitlementplanhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitlementplanhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitlementplanhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitlementplanhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitlementplanhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitlementplanhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitlementplanhistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitlementplanhistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitlementplanhistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameIsNil { + predicates = append(predicates, entitlementplanhistory.DisplayNameIsNil()) + } + if i.DisplayNameNotNil { + predicates = append(predicates, entitlementplanhistory.DisplayNameNotNil()) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, entitlementplanhistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, entitlementplanhistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, entitlementplanhistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, entitlementplanhistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, entitlementplanhistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, entitlementplanhistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, entitlementplanhistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, entitlementplanhistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.NameContainsFold(*i.NameContainsFold)) + } + if i.Description != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionEQ(*i.Description)) + } + if i.DescriptionNEQ != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionNEQ(*i.DescriptionNEQ)) + } + if len(i.DescriptionIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DescriptionIn(i.DescriptionIn...)) + } + if len(i.DescriptionNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.DescriptionNotIn(i.DescriptionNotIn...)) + } + if i.DescriptionGT != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionGT(*i.DescriptionGT)) + } + if i.DescriptionGTE != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionGTE(*i.DescriptionGTE)) + } + if i.DescriptionLT != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionLT(*i.DescriptionLT)) + } + if i.DescriptionLTE != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionLTE(*i.DescriptionLTE)) + } + if i.DescriptionContains != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionContains(*i.DescriptionContains)) + } + if i.DescriptionHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionHasPrefix(*i.DescriptionHasPrefix)) + } + if i.DescriptionHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionHasSuffix(*i.DescriptionHasSuffix)) + } + if i.DescriptionIsNil { + predicates = append(predicates, entitlementplanhistory.DescriptionIsNil()) + } + if i.DescriptionNotNil { + predicates = append(predicates, entitlementplanhistory.DescriptionNotNil()) + } + if i.DescriptionEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionEqualFold(*i.DescriptionEqualFold)) + } + if i.DescriptionContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.DescriptionContainsFold(*i.DescriptionContainsFold)) + } + if i.Version != nil { + predicates = append(predicates, entitlementplanhistory.VersionEQ(*i.Version)) + } + if i.VersionNEQ != nil { + predicates = append(predicates, entitlementplanhistory.VersionNEQ(*i.VersionNEQ)) + } + if len(i.VersionIn) > 0 { + predicates = append(predicates, entitlementplanhistory.VersionIn(i.VersionIn...)) + } + if len(i.VersionNotIn) > 0 { + predicates = append(predicates, entitlementplanhistory.VersionNotIn(i.VersionNotIn...)) + } + if i.VersionGT != nil { + predicates = append(predicates, entitlementplanhistory.VersionGT(*i.VersionGT)) + } + if i.VersionGTE != nil { + predicates = append(predicates, entitlementplanhistory.VersionGTE(*i.VersionGTE)) + } + if i.VersionLT != nil { + predicates = append(predicates, entitlementplanhistory.VersionLT(*i.VersionLT)) + } + if i.VersionLTE != nil { + predicates = append(predicates, entitlementplanhistory.VersionLTE(*i.VersionLTE)) + } + if i.VersionContains != nil { + predicates = append(predicates, entitlementplanhistory.VersionContains(*i.VersionContains)) + } + if i.VersionHasPrefix != nil { + predicates = append(predicates, entitlementplanhistory.VersionHasPrefix(*i.VersionHasPrefix)) + } + if i.VersionHasSuffix != nil { + predicates = append(predicates, entitlementplanhistory.VersionHasSuffix(*i.VersionHasSuffix)) + } + if i.VersionEqualFold != nil { + predicates = append(predicates, entitlementplanhistory.VersionEqualFold(*i.VersionEqualFold)) + } + if i.VersionContainsFold != nil { + predicates = append(predicates, entitlementplanhistory.VersionContainsFold(*i.VersionContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyEntitlementPlanHistoryWhereInput + case 1: + return predicates[0], nil + default: + return entitlementplanhistory.And(predicates...), nil + } +} + +// EntityWhereInput represents a where input for filtering Entity queries. +type EntityWhereInput struct { + Predicates []predicate.Entity `json:"-"` + Not *EntityWhereInput `json:"not,omitempty"` + Or []*EntityWhereInput `json:"or,omitempty"` + And []*EntityWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameIsNil bool `json:"nameIsNil,omitempty"` + NameNotNil bool `json:"nameNotNil,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "entity_type_id" field predicates. + EntityTypeID *string `json:"entityTypeID,omitempty"` + EntityTypeIDNEQ *string `json:"entityTypeIDNEQ,omitempty"` + EntityTypeIDIn []string `json:"entityTypeIDIn,omitempty"` + EntityTypeIDNotIn []string `json:"entityTypeIDNotIn,omitempty"` + EntityTypeIDGT *string `json:"entityTypeIDGT,omitempty"` + EntityTypeIDGTE *string `json:"entityTypeIDGTE,omitempty"` + EntityTypeIDLT *string `json:"entityTypeIDLT,omitempty"` + EntityTypeIDLTE *string `json:"entityTypeIDLTE,omitempty"` + EntityTypeIDContains *string `json:"entityTypeIDContains,omitempty"` + EntityTypeIDHasPrefix *string `json:"entityTypeIDHasPrefix,omitempty"` + EntityTypeIDHasSuffix *string `json:"entityTypeIDHasSuffix,omitempty"` + EntityTypeIDIsNil bool `json:"entityTypeIDIsNil,omitempty"` + EntityTypeIDNotNil bool `json:"entityTypeIDNotNil,omitempty"` + EntityTypeIDEqualFold *string `json:"entityTypeIDEqualFold,omitempty"` + EntityTypeIDContainsFold *string `json:"entityTypeIDContainsFold,omitempty"` + + // "status" field predicates. + Status *string `json:"status,omitempty"` + StatusNEQ *string `json:"statusNEQ,omitempty"` + StatusIn []string `json:"statusIn,omitempty"` + StatusNotIn []string `json:"statusNotIn,omitempty"` + StatusGT *string `json:"statusGT,omitempty"` + StatusGTE *string `json:"statusGTE,omitempty"` + StatusLT *string `json:"statusLT,omitempty"` + StatusLTE *string `json:"statusLTE,omitempty"` + StatusContains *string `json:"statusContains,omitempty"` + StatusHasPrefix *string `json:"statusHasPrefix,omitempty"` + StatusHasSuffix *string `json:"statusHasSuffix,omitempty"` + StatusIsNil bool `json:"statusIsNil,omitempty"` + StatusNotNil bool `json:"statusNotNil,omitempty"` + StatusEqualFold *string `json:"statusEqualFold,omitempty"` + StatusContainsFold *string `json:"statusContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "contacts" edge predicates. + HasContacts *bool `json:"hasContacts,omitempty"` + HasContactsWith []*ContactWhereInput `json:"hasContactsWith,omitempty"` + + // "documents" edge predicates. + HasDocuments *bool `json:"hasDocuments,omitempty"` + HasDocumentsWith []*DocumentDataWhereInput `json:"hasDocumentsWith,omitempty"` + + // "notes" edge predicates. + HasNotes *bool `json:"hasNotes,omitempty"` + HasNotesWith []*NoteWhereInput `json:"hasNotesWith,omitempty"` + + // "files" edge predicates. + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + + // "entity_type" edge predicates. + HasEntityType *bool `json:"hasEntityType,omitempty"` + HasEntityTypeWith []*EntityTypeWhereInput `json:"hasEntityTypeWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntityWhereInput) AddPredicates(predicates ...predicate.Entity) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntityWhereInput filter on the EntityQuery builder. +func (i *EntityWhereInput) Filter(q *EntityQuery) (*EntityQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntityWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntityWhereInput is returned in case the EntityWhereInput is empty. +var ErrEmptyEntityWhereInput = errors.New("generated: empty predicate EntityWhereInput") + +// P returns a predicate for filtering entities. +// An error is returned if the input is empty or invalid. +func (i *EntityWhereInput) P() (predicate.Entity, error) { + var predicates []predicate.Entity + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entity.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.Entity, 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, entity.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.Entity, 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, entity.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entity.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entity.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entity.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entity.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entity.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entity.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entity.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entity.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entity.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entity.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entity.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entity.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entity.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entity.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entity.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entity.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entity.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entity.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entity.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entity.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entity.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entity.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entity.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entity.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entity.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entity.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entity.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entity.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entity.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entity.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entity.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entity.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entity.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entity.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entity.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entity.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entity.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entity.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entity.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entity.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entity.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entity.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entity.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entity.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entity.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entity.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entity.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entity.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entity.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entity.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entity.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entity.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entity.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entity.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entity.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entity.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entity.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entity.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entity.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entity.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entity.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entity.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entity.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entity.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entity.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entity.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entity.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entity.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entity.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entity.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entity.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entity.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entity.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entity.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entity.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entity.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entity.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entity.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entity.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entity.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entity.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entity.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entity.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entity.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entity.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entity.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entity.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entity.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entity.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entity.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entity.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entity.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entity.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entity.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entity.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entity.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entity.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entity.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entity.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entity.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, entity.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, entity.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, entity.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, entity.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, entity.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, entity.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, entity.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, entity.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, entity.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, entity.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, entity.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameIsNil { + predicates = append(predicates, entity.NameIsNil()) + } + if i.NameNotNil { + predicates = append(predicates, entity.NameNotNil()) + } + if i.NameEqualFold != nil { + predicates = append(predicates, entity.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, entity.NameContainsFold(*i.NameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, entity.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, entity.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, entity.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, entity.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, entity.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, entity.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, entity.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, entity.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, entity.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, entity.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, entity.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameIsNil { + predicates = append(predicates, entity.DisplayNameIsNil()) + } + if i.DisplayNameNotNil { + predicates = append(predicates, entity.DisplayNameNotNil()) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, entity.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, entity.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.EntityTypeID != nil { + predicates = append(predicates, entity.EntityTypeIDEQ(*i.EntityTypeID)) + } + if i.EntityTypeIDNEQ != nil { + predicates = append(predicates, entity.EntityTypeIDNEQ(*i.EntityTypeIDNEQ)) + } + if len(i.EntityTypeIDIn) > 0 { + predicates = append(predicates, entity.EntityTypeIDIn(i.EntityTypeIDIn...)) + } + if len(i.EntityTypeIDNotIn) > 0 { + predicates = append(predicates, entity.EntityTypeIDNotIn(i.EntityTypeIDNotIn...)) + } + if i.EntityTypeIDGT != nil { + predicates = append(predicates, entity.EntityTypeIDGT(*i.EntityTypeIDGT)) + } + if i.EntityTypeIDGTE != nil { + predicates = append(predicates, entity.EntityTypeIDGTE(*i.EntityTypeIDGTE)) + } + if i.EntityTypeIDLT != nil { + predicates = append(predicates, entity.EntityTypeIDLT(*i.EntityTypeIDLT)) + } + if i.EntityTypeIDLTE != nil { + predicates = append(predicates, entity.EntityTypeIDLTE(*i.EntityTypeIDLTE)) + } + if i.EntityTypeIDContains != nil { + predicates = append(predicates, entity.EntityTypeIDContains(*i.EntityTypeIDContains)) + } + if i.EntityTypeIDHasPrefix != nil { + predicates = append(predicates, entity.EntityTypeIDHasPrefix(*i.EntityTypeIDHasPrefix)) + } + if i.EntityTypeIDHasSuffix != nil { + predicates = append(predicates, entity.EntityTypeIDHasSuffix(*i.EntityTypeIDHasSuffix)) + } + if i.EntityTypeIDIsNil { + predicates = append(predicates, entity.EntityTypeIDIsNil()) + } + if i.EntityTypeIDNotNil { + predicates = append(predicates, entity.EntityTypeIDNotNil()) + } + if i.EntityTypeIDEqualFold != nil { + predicates = append(predicates, entity.EntityTypeIDEqualFold(*i.EntityTypeIDEqualFold)) + } + if i.EntityTypeIDContainsFold != nil { + predicates = append(predicates, entity.EntityTypeIDContainsFold(*i.EntityTypeIDContainsFold)) + } + if i.Status != nil { + predicates = append(predicates, entity.StatusEQ(*i.Status)) + } + if i.StatusNEQ != nil { + predicates = append(predicates, entity.StatusNEQ(*i.StatusNEQ)) + } + if len(i.StatusIn) > 0 { + predicates = append(predicates, entity.StatusIn(i.StatusIn...)) + } + if len(i.StatusNotIn) > 0 { + predicates = append(predicates, entity.StatusNotIn(i.StatusNotIn...)) + } + if i.StatusGT != nil { + predicates = append(predicates, entity.StatusGT(*i.StatusGT)) + } + if i.StatusGTE != nil { + predicates = append(predicates, entity.StatusGTE(*i.StatusGTE)) + } + if i.StatusLT != nil { + predicates = append(predicates, entity.StatusLT(*i.StatusLT)) + } + if i.StatusLTE != nil { + predicates = append(predicates, entity.StatusLTE(*i.StatusLTE)) + } + if i.StatusContains != nil { + predicates = append(predicates, entity.StatusContains(*i.StatusContains)) + } + if i.StatusHasPrefix != nil { + predicates = append(predicates, entity.StatusHasPrefix(*i.StatusHasPrefix)) + } + if i.StatusHasSuffix != nil { + predicates = append(predicates, entity.StatusHasSuffix(*i.StatusHasSuffix)) + } + if i.StatusIsNil { + predicates = append(predicates, entity.StatusIsNil()) + } + if i.StatusNotNil { + predicates = append(predicates, entity.StatusNotNil()) + } + if i.StatusEqualFold != nil { + predicates = append(predicates, entity.StatusEqualFold(*i.StatusEqualFold)) + } + if i.StatusContainsFold != nil { + predicates = append(predicates, entity.StatusContainsFold(*i.StatusContainsFold)) + } + + if i.HasOwner != nil { + p := entity.HasOwner() + if !*i.HasOwner { + p = entity.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entity.HasOwnerWith(with...)) + } + if i.HasContacts != nil { + p := entity.HasContacts() + if !*i.HasContacts { + p = entity.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasContactsWith) > 0 { + with := make([]predicate.Contact, 0, len(i.HasContactsWith)) + for _, w := range i.HasContactsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasContactsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entity.HasContactsWith(with...)) + } + if i.HasDocuments != nil { + p := entity.HasDocuments() + if !*i.HasDocuments { + p = entity.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasDocumentsWith) > 0 { + with := make([]predicate.DocumentData, 0, len(i.HasDocumentsWith)) + for _, w := range i.HasDocumentsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasDocumentsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entity.HasDocumentsWith(with...)) + } + if i.HasNotes != nil { + p := entity.HasNotes() + if !*i.HasNotes { + p = entity.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasNotesWith) > 0 { + with := make([]predicate.Note, 0, len(i.HasNotesWith)) + for _, w := range i.HasNotesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasNotesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entity.HasNotesWith(with...)) + } + if i.HasFiles != nil { + p := entity.HasFiles() + if !*i.HasFiles { + p = entity.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFilesWith) > 0 { + with := make([]predicate.File, 0, len(i.HasFilesWith)) + for _, w := range i.HasFilesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFilesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entity.HasFilesWith(with...)) + } + if i.HasEntityType != nil { + p := entity.HasEntityType() + if !*i.HasEntityType { + p = entity.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntityTypeWith) > 0 { + with := make([]predicate.EntityType, 0, len(i.HasEntityTypeWith)) + for _, w := range i.HasEntityTypeWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntityTypeWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entity.HasEntityTypeWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyEntityWhereInput + case 1: + return predicates[0], nil + default: + return entity.And(predicates...), nil + } +} + +// EntityHistoryWhereInput represents a where input for filtering EntityHistory queries. +type EntityHistoryWhereInput struct { + Predicates []predicate.EntityHistory `json:"-"` + Not *EntityHistoryWhereInput `json:"not,omitempty"` + Or []*EntityHistoryWhereInput `json:"or,omitempty"` + And []*EntityHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameIsNil bool `json:"nameIsNil,omitempty"` + NameNotNil bool `json:"nameNotNil,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "entity_type_id" field predicates. + EntityTypeID *string `json:"entityTypeID,omitempty"` + EntityTypeIDNEQ *string `json:"entityTypeIDNEQ,omitempty"` + EntityTypeIDIn []string `json:"entityTypeIDIn,omitempty"` + EntityTypeIDNotIn []string `json:"entityTypeIDNotIn,omitempty"` + EntityTypeIDGT *string `json:"entityTypeIDGT,omitempty"` + EntityTypeIDGTE *string `json:"entityTypeIDGTE,omitempty"` + EntityTypeIDLT *string `json:"entityTypeIDLT,omitempty"` + EntityTypeIDLTE *string `json:"entityTypeIDLTE,omitempty"` + EntityTypeIDContains *string `json:"entityTypeIDContains,omitempty"` + EntityTypeIDHasPrefix *string `json:"entityTypeIDHasPrefix,omitempty"` + EntityTypeIDHasSuffix *string `json:"entityTypeIDHasSuffix,omitempty"` + EntityTypeIDIsNil bool `json:"entityTypeIDIsNil,omitempty"` + EntityTypeIDNotNil bool `json:"entityTypeIDNotNil,omitempty"` + EntityTypeIDEqualFold *string `json:"entityTypeIDEqualFold,omitempty"` + EntityTypeIDContainsFold *string `json:"entityTypeIDContainsFold,omitempty"` + + // "status" field predicates. + Status *string `json:"status,omitempty"` + StatusNEQ *string `json:"statusNEQ,omitempty"` + StatusIn []string `json:"statusIn,omitempty"` + StatusNotIn []string `json:"statusNotIn,omitempty"` + StatusGT *string `json:"statusGT,omitempty"` + StatusGTE *string `json:"statusGTE,omitempty"` + StatusLT *string `json:"statusLT,omitempty"` + StatusLTE *string `json:"statusLTE,omitempty"` + StatusContains *string `json:"statusContains,omitempty"` + StatusHasPrefix *string `json:"statusHasPrefix,omitempty"` + StatusHasSuffix *string `json:"statusHasSuffix,omitempty"` + StatusIsNil bool `json:"statusIsNil,omitempty"` + StatusNotNil bool `json:"statusNotNil,omitempty"` + StatusEqualFold *string `json:"statusEqualFold,omitempty"` + StatusContainsFold *string `json:"statusContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntityHistoryWhereInput) AddPredicates(predicates ...predicate.EntityHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntityHistoryWhereInput filter on the EntityHistoryQuery builder. +func (i *EntityHistoryWhereInput) Filter(q *EntityHistoryQuery) (*EntityHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntityHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntityHistoryWhereInput is returned in case the EntityHistoryWhereInput is empty. +var ErrEmptyEntityHistoryWhereInput = errors.New("generated: empty predicate EntityHistoryWhereInput") + +// P returns a predicate for filtering entityhistories. +// An error is returned if the input is empty or invalid. +func (i *EntityHistoryWhereInput) P() (predicate.EntityHistory, error) { + var predicates []predicate.EntityHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entityhistory.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.EntityHistory, 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, entityhistory.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.EntityHistory, 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, entityhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entityhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entityhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entityhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entityhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entityhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entityhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entityhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entityhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entityhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entityhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, entityhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, entityhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, entityhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, entityhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, entityhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, entityhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, entityhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, entityhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, entityhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, entityhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, entityhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, entityhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, entityhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, entityhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, entityhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, entityhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, entityhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, entityhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, entityhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, entityhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, entityhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, entityhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, entityhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, entityhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, entityhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, entityhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, entityhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entityhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entityhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entityhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entityhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entityhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entityhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entityhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entityhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entityhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entityhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entityhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entityhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entityhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entityhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entityhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entityhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entityhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entityhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entityhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entityhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entityhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entityhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entityhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entityhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entityhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entityhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entityhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entityhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entityhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entityhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entityhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entityhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entityhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entityhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entityhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entityhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entityhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entityhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entityhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entityhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entityhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entityhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entityhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entityhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entityhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entityhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entityhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entityhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entityhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entityhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entityhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entityhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entityhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entityhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entityhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entityhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entityhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entityhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entityhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entityhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entityhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entityhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entityhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entityhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entityhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entityhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entityhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entityhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entityhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entityhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entityhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entityhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entityhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entityhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entityhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entityhistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entityhistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entityhistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entityhistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entityhistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entityhistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entityhistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entityhistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entityhistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entityhistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entityhistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entityhistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entityhistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entityhistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entityhistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, entityhistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, entityhistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, entityhistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, entityhistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, entityhistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, entityhistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, entityhistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, entityhistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, entityhistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, entityhistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, entityhistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameIsNil { + predicates = append(predicates, entityhistory.NameIsNil()) + } + if i.NameNotNil { + predicates = append(predicates, entityhistory.NameNotNil()) + } + if i.NameEqualFold != nil { + predicates = append(predicates, entityhistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, entityhistory.NameContainsFold(*i.NameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, entityhistory.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, entityhistory.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, entityhistory.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, entityhistory.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, entityhistory.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, entityhistory.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, entityhistory.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, entityhistory.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, entityhistory.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, entityhistory.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, entityhistory.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameIsNil { + predicates = append(predicates, entityhistory.DisplayNameIsNil()) + } + if i.DisplayNameNotNil { + predicates = append(predicates, entityhistory.DisplayNameNotNil()) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, entityhistory.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, entityhistory.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.EntityTypeID != nil { + predicates = append(predicates, entityhistory.EntityTypeIDEQ(*i.EntityTypeID)) + } + if i.EntityTypeIDNEQ != nil { + predicates = append(predicates, entityhistory.EntityTypeIDNEQ(*i.EntityTypeIDNEQ)) + } + if len(i.EntityTypeIDIn) > 0 { + predicates = append(predicates, entityhistory.EntityTypeIDIn(i.EntityTypeIDIn...)) + } + if len(i.EntityTypeIDNotIn) > 0 { + predicates = append(predicates, entityhistory.EntityTypeIDNotIn(i.EntityTypeIDNotIn...)) + } + if i.EntityTypeIDGT != nil { + predicates = append(predicates, entityhistory.EntityTypeIDGT(*i.EntityTypeIDGT)) + } + if i.EntityTypeIDGTE != nil { + predicates = append(predicates, entityhistory.EntityTypeIDGTE(*i.EntityTypeIDGTE)) + } + if i.EntityTypeIDLT != nil { + predicates = append(predicates, entityhistory.EntityTypeIDLT(*i.EntityTypeIDLT)) + } + if i.EntityTypeIDLTE != nil { + predicates = append(predicates, entityhistory.EntityTypeIDLTE(*i.EntityTypeIDLTE)) + } + if i.EntityTypeIDContains != nil { + predicates = append(predicates, entityhistory.EntityTypeIDContains(*i.EntityTypeIDContains)) + } + if i.EntityTypeIDHasPrefix != nil { + predicates = append(predicates, entityhistory.EntityTypeIDHasPrefix(*i.EntityTypeIDHasPrefix)) + } + if i.EntityTypeIDHasSuffix != nil { + predicates = append(predicates, entityhistory.EntityTypeIDHasSuffix(*i.EntityTypeIDHasSuffix)) + } + if i.EntityTypeIDIsNil { + predicates = append(predicates, entityhistory.EntityTypeIDIsNil()) + } + if i.EntityTypeIDNotNil { + predicates = append(predicates, entityhistory.EntityTypeIDNotNil()) + } + if i.EntityTypeIDEqualFold != nil { + predicates = append(predicates, entityhistory.EntityTypeIDEqualFold(*i.EntityTypeIDEqualFold)) + } + if i.EntityTypeIDContainsFold != nil { + predicates = append(predicates, entityhistory.EntityTypeIDContainsFold(*i.EntityTypeIDContainsFold)) + } + if i.Status != nil { + predicates = append(predicates, entityhistory.StatusEQ(*i.Status)) + } + if i.StatusNEQ != nil { + predicates = append(predicates, entityhistory.StatusNEQ(*i.StatusNEQ)) + } + if len(i.StatusIn) > 0 { + predicates = append(predicates, entityhistory.StatusIn(i.StatusIn...)) + } + if len(i.StatusNotIn) > 0 { + predicates = append(predicates, entityhistory.StatusNotIn(i.StatusNotIn...)) + } + if i.StatusGT != nil { + predicates = append(predicates, entityhistory.StatusGT(*i.StatusGT)) + } + if i.StatusGTE != nil { + predicates = append(predicates, entityhistory.StatusGTE(*i.StatusGTE)) + } + if i.StatusLT != nil { + predicates = append(predicates, entityhistory.StatusLT(*i.StatusLT)) + } + if i.StatusLTE != nil { + predicates = append(predicates, entityhistory.StatusLTE(*i.StatusLTE)) + } + if i.StatusContains != nil { + predicates = append(predicates, entityhistory.StatusContains(*i.StatusContains)) + } + if i.StatusHasPrefix != nil { + predicates = append(predicates, entityhistory.StatusHasPrefix(*i.StatusHasPrefix)) + } + if i.StatusHasSuffix != nil { + predicates = append(predicates, entityhistory.StatusHasSuffix(*i.StatusHasSuffix)) + } + if i.StatusIsNil { + predicates = append(predicates, entityhistory.StatusIsNil()) + } + if i.StatusNotNil { + predicates = append(predicates, entityhistory.StatusNotNil()) + } + if i.StatusEqualFold != nil { + predicates = append(predicates, entityhistory.StatusEqualFold(*i.StatusEqualFold)) + } + if i.StatusContainsFold != nil { + predicates = append(predicates, entityhistory.StatusContainsFold(*i.StatusContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyEntityHistoryWhereInput + case 1: + return predicates[0], nil + default: + return entityhistory.And(predicates...), nil + } +} + +// EntityTypeWhereInput represents a where input for filtering EntityType queries. +type EntityTypeWhereInput struct { + Predicates []predicate.EntityType `json:"-"` + Not *EntityTypeWhereInput `json:"not,omitempty"` + Or []*EntityTypeWhereInput `json:"or,omitempty"` + And []*EntityTypeWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "entities" edge predicates. + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntityTypeWhereInput) AddPredicates(predicates ...predicate.EntityType) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntityTypeWhereInput filter on the EntityTypeQuery builder. +func (i *EntityTypeWhereInput) Filter(q *EntityTypeQuery) (*EntityTypeQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntityTypeWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntityTypeWhereInput is returned in case the EntityTypeWhereInput is empty. +var ErrEmptyEntityTypeWhereInput = errors.New("generated: empty predicate EntityTypeWhereInput") + +// P returns a predicate for filtering entitytypes. +// An error is returned if the input is empty or invalid. +func (i *EntityTypeWhereInput) P() (predicate.EntityType, error) { + var predicates []predicate.EntityType + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitytype.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.EntityType, 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, entitytype.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.EntityType, 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, entitytype.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitytype.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitytype.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitytype.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitytype.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitytype.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitytype.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitytype.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitytype.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitytype.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitytype.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitytype.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitytype.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitytype.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitytype.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitytype.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitytype.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitytype.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitytype.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitytype.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitytype.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitytype.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitytype.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitytype.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitytype.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitytype.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitytype.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitytype.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitytype.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitytype.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitytype.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitytype.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitytype.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitytype.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitytype.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitytype.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitytype.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitytype.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitytype.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitytype.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitytype.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitytype.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitytype.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitytype.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitytype.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitytype.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitytype.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitytype.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitytype.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitytype.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitytype.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitytype.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitytype.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitytype.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitytype.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitytype.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitytype.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitytype.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitytype.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitytype.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitytype.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitytype.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitytype.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitytype.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitytype.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitytype.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitytype.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitytype.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitytype.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitytype.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitytype.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitytype.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitytype.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitytype.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitytype.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitytype.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitytype.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitytype.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitytype.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitytype.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitytype.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitytype.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitytype.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitytype.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitytype.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitytype.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitytype.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitytype.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitytype.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitytype.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitytype.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitytype.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitytype.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitytype.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitytype.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitytype.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitytype.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitytype.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitytype.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitytype.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitytype.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, entitytype.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, entitytype.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, entitytype.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, entitytype.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, entitytype.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, entitytype.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, entitytype.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, entitytype.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, entitytype.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, entitytype.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, entitytype.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, entitytype.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, entitytype.NameContainsFold(*i.NameContainsFold)) + } + + if i.HasOwner != nil { + p := entitytype.HasOwner() + if !*i.HasOwner { + p = entitytype.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitytype.HasOwnerWith(with...)) + } + if i.HasEntities != nil { + p := entitytype.HasEntities() + if !*i.HasEntities { + p = entitytype.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitiesWith) > 0 { + with := make([]predicate.Entity, 0, len(i.HasEntitiesWith)) + for _, w := range i.HasEntitiesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitiesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, entitytype.HasEntitiesWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyEntityTypeWhereInput + case 1: + return predicates[0], nil + default: + return entitytype.And(predicates...), nil + } +} + +// EntityTypeHistoryWhereInput represents a where input for filtering EntityTypeHistory queries. +type EntityTypeHistoryWhereInput struct { + Predicates []predicate.EntityTypeHistory `json:"-"` + Not *EntityTypeHistoryWhereInput `json:"not,omitempty"` + Or []*EntityTypeHistoryWhereInput `json:"or,omitempty"` + And []*EntityTypeHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EntityTypeHistoryWhereInput) AddPredicates(predicates ...predicate.EntityTypeHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EntityTypeHistoryWhereInput filter on the EntityTypeHistoryQuery builder. +func (i *EntityTypeHistoryWhereInput) Filter(q *EntityTypeHistoryQuery) (*EntityTypeHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEntityTypeHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEntityTypeHistoryWhereInput is returned in case the EntityTypeHistoryWhereInput is empty. +var ErrEmptyEntityTypeHistoryWhereInput = errors.New("generated: empty predicate EntityTypeHistoryWhereInput") + +// P returns a predicate for filtering entitytypehistories. +// An error is returned if the input is empty or invalid. +func (i *EntityTypeHistoryWhereInput) P() (predicate.EntityTypeHistory, error) { + var predicates []predicate.EntityTypeHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, entitytypehistory.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.EntityTypeHistory, 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, entitytypehistory.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.EntityTypeHistory, 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, entitytypehistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, entitytypehistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, entitytypehistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, entitytypehistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, entitytypehistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, entitytypehistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, entitytypehistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, entitytypehistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, entitytypehistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, entitytypehistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, entitytypehistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, entitytypehistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, entitytypehistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, entitytypehistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, entitytypehistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, entitytypehistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, entitytypehistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, entitytypehistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, entitytypehistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, entitytypehistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, entitytypehistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, entitytypehistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, entitytypehistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, entitytypehistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, entitytypehistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, entitytypehistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, entitytypehistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, entitytypehistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, entitytypehistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, entitytypehistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, entitytypehistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, entitytypehistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, entitytypehistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, entitytypehistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, entitytypehistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, entitytypehistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, entitytypehistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, entitytypehistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, entitytypehistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, entitytypehistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, entitytypehistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, entitytypehistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, entitytypehistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, entitytypehistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, entitytypehistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, entitytypehistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, entitytypehistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, entitytypehistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, entitytypehistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, entitytypehistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, entitytypehistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, entitytypehistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, entitytypehistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, entitytypehistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, entitytypehistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, entitytypehistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, entitytypehistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, entitytypehistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, entitytypehistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, entitytypehistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, entitytypehistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, entitytypehistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, entitytypehistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, entitytypehistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, entitytypehistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, entitytypehistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, entitytypehistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, entitytypehistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, entitytypehistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, entitytypehistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, entitytypehistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, entitytypehistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, entitytypehistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, entitytypehistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, entitytypehistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, entitytypehistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, entitytypehistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, entitytypehistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, entitytypehistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, entitytypehistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, entitytypehistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, entitytypehistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, entitytypehistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, entitytypehistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, entitytypehistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, entitytypehistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, entitytypehistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, entitytypehistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, entitytypehistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, entitytypehistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, entitytypehistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, entitytypehistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, entitytypehistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, entitytypehistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, entitytypehistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, entitytypehistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, entitytypehistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, entitytypehistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, entitytypehistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, entitytypehistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, entitytypehistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, entitytypehistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, entitytypehistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, entitytypehistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, entitytypehistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, entitytypehistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, entitytypehistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, entitytypehistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, entitytypehistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, entitytypehistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, entitytypehistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, entitytypehistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, entitytypehistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, entitytypehistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, entitytypehistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, entitytypehistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, entitytypehistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, entitytypehistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, entitytypehistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, entitytypehistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, entitytypehistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, entitytypehistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, entitytypehistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, entitytypehistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, entitytypehistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, entitytypehistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, entitytypehistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, entitytypehistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, entitytypehistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, entitytypehistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, entitytypehistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, entitytypehistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, entitytypehistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, entitytypehistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, entitytypehistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, entitytypehistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, entitytypehistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, entitytypehistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, entitytypehistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, entitytypehistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, entitytypehistory.NameContainsFold(*i.NameContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyEntityTypeHistoryWhereInput + case 1: + return predicates[0], nil + default: + return entitytypehistory.And(predicates...), nil + } +} + +// EventWhereInput represents a where input for filtering Event queries. +type EventWhereInput struct { + Predicates []predicate.Event `json:"-"` + Not *EventWhereInput `json:"not,omitempty"` + Or []*EventWhereInput `json:"or,omitempty"` + And []*EventWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "event_id" field predicates. + EventID *string `json:"eventID,omitempty"` + EventIDNEQ *string `json:"eventIDNEQ,omitempty"` + EventIDIn []string `json:"eventIDIn,omitempty"` + EventIDNotIn []string `json:"eventIDNotIn,omitempty"` + EventIDGT *string `json:"eventIDGT,omitempty"` + EventIDGTE *string `json:"eventIDGTE,omitempty"` + EventIDLT *string `json:"eventIDLT,omitempty"` + EventIDLTE *string `json:"eventIDLTE,omitempty"` + EventIDContains *string `json:"eventIDContains,omitempty"` + EventIDHasPrefix *string `json:"eventIDHasPrefix,omitempty"` + EventIDHasSuffix *string `json:"eventIDHasSuffix,omitempty"` + EventIDIsNil bool `json:"eventIDIsNil,omitempty"` + EventIDNotNil bool `json:"eventIDNotNil,omitempty"` + EventIDEqualFold *string `json:"eventIDEqualFold,omitempty"` + EventIDContainsFold *string `json:"eventIDContainsFold,omitempty"` + + // "correlation_id" field predicates. + CorrelationID *string `json:"correlationID,omitempty"` + CorrelationIDNEQ *string `json:"correlationIDNEQ,omitempty"` + CorrelationIDIn []string `json:"correlationIDIn,omitempty"` + CorrelationIDNotIn []string `json:"correlationIDNotIn,omitempty"` + CorrelationIDGT *string `json:"correlationIDGT,omitempty"` + CorrelationIDGTE *string `json:"correlationIDGTE,omitempty"` + CorrelationIDLT *string `json:"correlationIDLT,omitempty"` + CorrelationIDLTE *string `json:"correlationIDLTE,omitempty"` + CorrelationIDContains *string `json:"correlationIDContains,omitempty"` + CorrelationIDHasPrefix *string `json:"correlationIDHasPrefix,omitempty"` + CorrelationIDHasSuffix *string `json:"correlationIDHasSuffix,omitempty"` + CorrelationIDIsNil bool `json:"correlationIDIsNil,omitempty"` + CorrelationIDNotNil bool `json:"correlationIDNotNil,omitempty"` + CorrelationIDEqualFold *string `json:"correlationIDEqualFold,omitempty"` + CorrelationIDContainsFold *string `json:"correlationIDContainsFold,omitempty"` + + // "event_type" field predicates. + EventType *string `json:"eventType,omitempty"` + EventTypeNEQ *string `json:"eventTypeNEQ,omitempty"` + EventTypeIn []string `json:"eventTypeIn,omitempty"` + EventTypeNotIn []string `json:"eventTypeNotIn,omitempty"` + EventTypeGT *string `json:"eventTypeGT,omitempty"` + EventTypeGTE *string `json:"eventTypeGTE,omitempty"` + EventTypeLT *string `json:"eventTypeLT,omitempty"` + EventTypeLTE *string `json:"eventTypeLTE,omitempty"` + EventTypeContains *string `json:"eventTypeContains,omitempty"` + EventTypeHasPrefix *string `json:"eventTypeHasPrefix,omitempty"` + EventTypeHasSuffix *string `json:"eventTypeHasSuffix,omitempty"` + EventTypeEqualFold *string `json:"eventTypeEqualFold,omitempty"` + EventTypeContainsFold *string `json:"eventTypeContainsFold,omitempty"` + + // "user" edge predicates. + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + + // "group" edge predicates. + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` + + // "integration" edge predicates. + HasIntegration *bool `json:"hasIntegration,omitempty"` + HasIntegrationWith []*IntegrationWhereInput `json:"hasIntegrationWith,omitempty"` + + // "organization" edge predicates. + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + + // "invite" edge predicates. + HasInvite *bool `json:"hasInvite,omitempty"` + HasInviteWith []*InviteWhereInput `json:"hasInviteWith,omitempty"` + + // "feature" edge predicates. + HasFeature *bool `json:"hasFeature,omitempty"` + HasFeatureWith []*FeatureWhereInput `json:"hasFeatureWith,omitempty"` + + // "entitlementplan" edge predicates. + HasEntitlementplan *bool `json:"hasEntitlementplan,omitempty"` + HasEntitlementplanWith []*EntitlementPlanWhereInput `json:"hasEntitlementplanWith,omitempty"` + + // "entitlementplanfeature" edge predicates. + HasEntitlementplanfeature *bool `json:"hasEntitlementplanfeature,omitempty"` + HasEntitlementplanfeatureWith []*EntitlementPlanFeatureWhereInput `json:"hasEntitlementplanfeatureWith,omitempty"` + + // "personal_access_token" edge predicates. + HasPersonalAccessToken *bool `json:"hasPersonalAccessToken,omitempty"` + HasPersonalAccessTokenWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokenWith,omitempty"` + + // "oauth2token" edge predicates. + HasOauth2token *bool `json:"hasOauth2token,omitempty"` + HasOauth2tokenWith []*OhAuthTooTokenWhereInput `json:"hasOauth2tokenWith,omitempty"` + + // "hush" edge predicates. + HasHush *bool `json:"hasHush,omitempty"` + HasHushWith []*HushWhereInput `json:"hasHushWith,omitempty"` + + // "orgmembership" edge predicates. + HasOrgmembership *bool `json:"hasOrgmembership,omitempty"` + HasOrgmembershipWith []*OrgMembershipWhereInput `json:"hasOrgmembershipWith,omitempty"` + + // "groupmembership" edge predicates. + HasGroupmembership *bool `json:"hasGroupmembership,omitempty"` + HasGroupmembershipWith []*GroupMembershipWhereInput `json:"hasGroupmembershipWith,omitempty"` + + // "entitlement" edge predicates. + HasEntitlement *bool `json:"hasEntitlement,omitempty"` + HasEntitlementWith []*EntitlementWhereInput `json:"hasEntitlementWith,omitempty"` + + // "webhook" edge predicates. + HasWebhook *bool `json:"hasWebhook,omitempty"` + HasWebhookWith []*WebhookWhereInput `json:"hasWebhookWith,omitempty"` + + // "subscriber" edge predicates. + HasSubscriber *bool `json:"hasSubscriber,omitempty"` + HasSubscriberWith []*SubscriberWhereInput `json:"hasSubscriberWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EventWhereInput) AddPredicates(predicates ...predicate.Event) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EventWhereInput filter on the EventQuery builder. +func (i *EventWhereInput) Filter(q *EventQuery) (*EventQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEventWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEventWhereInput is returned in case the EventWhereInput is empty. +var ErrEmptyEventWhereInput = errors.New("generated: empty predicate EventWhereInput") + +// P returns a predicate for filtering events. +// An error is returned if the input is empty or invalid. +func (i *EventWhereInput) P() (predicate.Event, error) { + var predicates []predicate.Event + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, event.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.Event, 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, event.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.Event, 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, event.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, event.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, event.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, event.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, event.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, event.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, event.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, event.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, event.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, event.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, event.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, event.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, event.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, event.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, event.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, event.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, event.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, event.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, event.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, event.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, event.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, event.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, event.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, event.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, event.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, event.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, event.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, event.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, event.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, event.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, event.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, event.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, event.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, event.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, event.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, event.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, event.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, event.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, event.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, event.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, event.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, event.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, event.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, event.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, event.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, event.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, event.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, event.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, event.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, event.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, event.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, event.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, event.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, event.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, event.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, event.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, event.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, event.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, event.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, event.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, event.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.EventID != nil { + predicates = append(predicates, event.EventIDEQ(*i.EventID)) + } + if i.EventIDNEQ != nil { + predicates = append(predicates, event.EventIDNEQ(*i.EventIDNEQ)) + } + if len(i.EventIDIn) > 0 { + predicates = append(predicates, event.EventIDIn(i.EventIDIn...)) + } + if len(i.EventIDNotIn) > 0 { + predicates = append(predicates, event.EventIDNotIn(i.EventIDNotIn...)) + } + if i.EventIDGT != nil { + predicates = append(predicates, event.EventIDGT(*i.EventIDGT)) + } + if i.EventIDGTE != nil { + predicates = append(predicates, event.EventIDGTE(*i.EventIDGTE)) + } + if i.EventIDLT != nil { + predicates = append(predicates, event.EventIDLT(*i.EventIDLT)) + } + if i.EventIDLTE != nil { + predicates = append(predicates, event.EventIDLTE(*i.EventIDLTE)) + } + if i.EventIDContains != nil { + predicates = append(predicates, event.EventIDContains(*i.EventIDContains)) + } + if i.EventIDHasPrefix != nil { + predicates = append(predicates, event.EventIDHasPrefix(*i.EventIDHasPrefix)) + } + if i.EventIDHasSuffix != nil { + predicates = append(predicates, event.EventIDHasSuffix(*i.EventIDHasSuffix)) + } + if i.EventIDIsNil { + predicates = append(predicates, event.EventIDIsNil()) + } + if i.EventIDNotNil { + predicates = append(predicates, event.EventIDNotNil()) + } + if i.EventIDEqualFold != nil { + predicates = append(predicates, event.EventIDEqualFold(*i.EventIDEqualFold)) + } + if i.EventIDContainsFold != nil { + predicates = append(predicates, event.EventIDContainsFold(*i.EventIDContainsFold)) + } + if i.CorrelationID != nil { + predicates = append(predicates, event.CorrelationIDEQ(*i.CorrelationID)) + } + if i.CorrelationIDNEQ != nil { + predicates = append(predicates, event.CorrelationIDNEQ(*i.CorrelationIDNEQ)) + } + if len(i.CorrelationIDIn) > 0 { + predicates = append(predicates, event.CorrelationIDIn(i.CorrelationIDIn...)) + } + if len(i.CorrelationIDNotIn) > 0 { + predicates = append(predicates, event.CorrelationIDNotIn(i.CorrelationIDNotIn...)) + } + if i.CorrelationIDGT != nil { + predicates = append(predicates, event.CorrelationIDGT(*i.CorrelationIDGT)) + } + if i.CorrelationIDGTE != nil { + predicates = append(predicates, event.CorrelationIDGTE(*i.CorrelationIDGTE)) + } + if i.CorrelationIDLT != nil { + predicates = append(predicates, event.CorrelationIDLT(*i.CorrelationIDLT)) + } + if i.CorrelationIDLTE != nil { + predicates = append(predicates, event.CorrelationIDLTE(*i.CorrelationIDLTE)) + } + if i.CorrelationIDContains != nil { + predicates = append(predicates, event.CorrelationIDContains(*i.CorrelationIDContains)) + } + if i.CorrelationIDHasPrefix != nil { + predicates = append(predicates, event.CorrelationIDHasPrefix(*i.CorrelationIDHasPrefix)) + } + if i.CorrelationIDHasSuffix != nil { + predicates = append(predicates, event.CorrelationIDHasSuffix(*i.CorrelationIDHasSuffix)) + } + if i.CorrelationIDIsNil { + predicates = append(predicates, event.CorrelationIDIsNil()) + } + if i.CorrelationIDNotNil { + predicates = append(predicates, event.CorrelationIDNotNil()) + } + if i.CorrelationIDEqualFold != nil { + predicates = append(predicates, event.CorrelationIDEqualFold(*i.CorrelationIDEqualFold)) + } + if i.CorrelationIDContainsFold != nil { + predicates = append(predicates, event.CorrelationIDContainsFold(*i.CorrelationIDContainsFold)) + } + if i.EventType != nil { + predicates = append(predicates, event.EventTypeEQ(*i.EventType)) + } + if i.EventTypeNEQ != nil { + predicates = append(predicates, event.EventTypeNEQ(*i.EventTypeNEQ)) + } + if len(i.EventTypeIn) > 0 { + predicates = append(predicates, event.EventTypeIn(i.EventTypeIn...)) + } + if len(i.EventTypeNotIn) > 0 { + predicates = append(predicates, event.EventTypeNotIn(i.EventTypeNotIn...)) + } + if i.EventTypeGT != nil { + predicates = append(predicates, event.EventTypeGT(*i.EventTypeGT)) + } + if i.EventTypeGTE != nil { + predicates = append(predicates, event.EventTypeGTE(*i.EventTypeGTE)) + } + if i.EventTypeLT != nil { + predicates = append(predicates, event.EventTypeLT(*i.EventTypeLT)) + } + if i.EventTypeLTE != nil { + predicates = append(predicates, event.EventTypeLTE(*i.EventTypeLTE)) + } + if i.EventTypeContains != nil { + predicates = append(predicates, event.EventTypeContains(*i.EventTypeContains)) + } + if i.EventTypeHasPrefix != nil { + predicates = append(predicates, event.EventTypeHasPrefix(*i.EventTypeHasPrefix)) + } + if i.EventTypeHasSuffix != nil { + predicates = append(predicates, event.EventTypeHasSuffix(*i.EventTypeHasSuffix)) + } + if i.EventTypeEqualFold != nil { + predicates = append(predicates, event.EventTypeEqualFold(*i.EventTypeEqualFold)) + } + if i.EventTypeContainsFold != nil { + predicates = append(predicates, event.EventTypeContainsFold(*i.EventTypeContainsFold)) + } + + if i.HasUser != nil { + p := event.HasUser() + if !*i.HasUser { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasUserWith) > 0 { + with := make([]predicate.User, 0, len(i.HasUserWith)) + for _, w := range i.HasUserWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasUserWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasUserWith(with...)) + } + if i.HasGroup != nil { + p := event.HasGroup() + if !*i.HasGroup { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupWith) > 0 { + with := make([]predicate.Group, 0, len(i.HasGroupWith)) + for _, w := range i.HasGroupWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasGroupWith(with...)) + } + if i.HasIntegration != nil { + p := event.HasIntegration() + if !*i.HasIntegration { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasIntegrationWith) > 0 { + with := make([]predicate.Integration, 0, len(i.HasIntegrationWith)) + for _, w := range i.HasIntegrationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasIntegrationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasIntegrationWith(with...)) + } + if i.HasOrganization != nil { + p := event.HasOrganization() + if !*i.HasOrganization { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationWith)) + for _, w := range i.HasOrganizationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasOrganizationWith(with...)) + } + if i.HasInvite != nil { + p := event.HasInvite() + if !*i.HasInvite { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasInviteWith) > 0 { + with := make([]predicate.Invite, 0, len(i.HasInviteWith)) + for _, w := range i.HasInviteWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasInviteWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasInviteWith(with...)) + } + if i.HasFeature != nil { + p := event.HasFeature() + if !*i.HasFeature { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFeatureWith) > 0 { + with := make([]predicate.Feature, 0, len(i.HasFeatureWith)) + for _, w := range i.HasFeatureWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFeatureWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasFeatureWith(with...)) + } + if i.HasEntitlementplan != nil { + p := event.HasEntitlementplan() + if !*i.HasEntitlementplan { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitlementplanWith) > 0 { + with := make([]predicate.EntitlementPlan, 0, len(i.HasEntitlementplanWith)) + for _, w := range i.HasEntitlementplanWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitlementplanWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasEntitlementplanWith(with...)) + } + if i.HasEntitlementplanfeature != nil { + p := event.HasEntitlementplanfeature() + if !*i.HasEntitlementplanfeature { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitlementplanfeatureWith) > 0 { + with := make([]predicate.EntitlementPlanFeature, 0, len(i.HasEntitlementplanfeatureWith)) + for _, w := range i.HasEntitlementplanfeatureWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitlementplanfeatureWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasEntitlementplanfeatureWith(with...)) + } + if i.HasPersonalAccessToken != nil { + p := event.HasPersonalAccessToken() + if !*i.HasPersonalAccessToken { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasPersonalAccessTokenWith) > 0 { + with := make([]predicate.PersonalAccessToken, 0, len(i.HasPersonalAccessTokenWith)) + for _, w := range i.HasPersonalAccessTokenWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasPersonalAccessTokenWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasPersonalAccessTokenWith(with...)) + } + if i.HasOauth2token != nil { + p := event.HasOauth2token() + if !*i.HasOauth2token { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOauth2tokenWith) > 0 { + with := make([]predicate.OhAuthTooToken, 0, len(i.HasOauth2tokenWith)) + for _, w := range i.HasOauth2tokenWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOauth2tokenWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasOauth2tokenWith(with...)) + } + if i.HasHush != nil { + p := event.HasHush() + if !*i.HasHush { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasHushWith) > 0 { + with := make([]predicate.Hush, 0, len(i.HasHushWith)) + for _, w := range i.HasHushWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasHushWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasHushWith(with...)) + } + if i.HasOrgmembership != nil { + p := event.HasOrgmembership() + if !*i.HasOrgmembership { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrgmembershipWith) > 0 { + with := make([]predicate.OrgMembership, 0, len(i.HasOrgmembershipWith)) + for _, w := range i.HasOrgmembershipWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrgmembershipWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasOrgmembershipWith(with...)) + } + if i.HasGroupmembership != nil { + p := event.HasGroupmembership() + if !*i.HasGroupmembership { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupmembershipWith) > 0 { + with := make([]predicate.GroupMembership, 0, len(i.HasGroupmembershipWith)) + for _, w := range i.HasGroupmembershipWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupmembershipWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasGroupmembershipWith(with...)) + } + if i.HasEntitlement != nil { + p := event.HasEntitlement() + if !*i.HasEntitlement { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitlementWith) > 0 { + with := make([]predicate.Entitlement, 0, len(i.HasEntitlementWith)) + for _, w := range i.HasEntitlementWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitlementWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasEntitlementWith(with...)) + } + if i.HasWebhook != nil { + p := event.HasWebhook() + if !*i.HasWebhook { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasWebhookWith) > 0 { + with := make([]predicate.Webhook, 0, len(i.HasWebhookWith)) + for _, w := range i.HasWebhookWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasWebhookWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasWebhookWith(with...)) + } + if i.HasSubscriber != nil { + p := event.HasSubscriber() + if !*i.HasSubscriber { + p = event.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasSubscriberWith) > 0 { + with := make([]predicate.Subscriber, 0, len(i.HasSubscriberWith)) + for _, w := range i.HasSubscriberWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasSubscriberWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, event.HasSubscriberWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyEventWhereInput + case 1: + return predicates[0], nil + default: + return event.And(predicates...), nil + } +} + +// EventHistoryWhereInput represents a where input for filtering EventHistory queries. +type EventHistoryWhereInput struct { + Predicates []predicate.EventHistory `json:"-"` + Not *EventHistoryWhereInput `json:"not,omitempty"` + Or []*EventHistoryWhereInput `json:"or,omitempty"` + And []*EventHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "event_id" field predicates. + EventID *string `json:"eventID,omitempty"` + EventIDNEQ *string `json:"eventIDNEQ,omitempty"` + EventIDIn []string `json:"eventIDIn,omitempty"` + EventIDNotIn []string `json:"eventIDNotIn,omitempty"` + EventIDGT *string `json:"eventIDGT,omitempty"` + EventIDGTE *string `json:"eventIDGTE,omitempty"` + EventIDLT *string `json:"eventIDLT,omitempty"` + EventIDLTE *string `json:"eventIDLTE,omitempty"` + EventIDContains *string `json:"eventIDContains,omitempty"` + EventIDHasPrefix *string `json:"eventIDHasPrefix,omitempty"` + EventIDHasSuffix *string `json:"eventIDHasSuffix,omitempty"` + EventIDIsNil bool `json:"eventIDIsNil,omitempty"` + EventIDNotNil bool `json:"eventIDNotNil,omitempty"` + EventIDEqualFold *string `json:"eventIDEqualFold,omitempty"` + EventIDContainsFold *string `json:"eventIDContainsFold,omitempty"` + + // "correlation_id" field predicates. + CorrelationID *string `json:"correlationID,omitempty"` + CorrelationIDNEQ *string `json:"correlationIDNEQ,omitempty"` + CorrelationIDIn []string `json:"correlationIDIn,omitempty"` + CorrelationIDNotIn []string `json:"correlationIDNotIn,omitempty"` + CorrelationIDGT *string `json:"correlationIDGT,omitempty"` + CorrelationIDGTE *string `json:"correlationIDGTE,omitempty"` + CorrelationIDLT *string `json:"correlationIDLT,omitempty"` + CorrelationIDLTE *string `json:"correlationIDLTE,omitempty"` + CorrelationIDContains *string `json:"correlationIDContains,omitempty"` + CorrelationIDHasPrefix *string `json:"correlationIDHasPrefix,omitempty"` + CorrelationIDHasSuffix *string `json:"correlationIDHasSuffix,omitempty"` + CorrelationIDIsNil bool `json:"correlationIDIsNil,omitempty"` + CorrelationIDNotNil bool `json:"correlationIDNotNil,omitempty"` + CorrelationIDEqualFold *string `json:"correlationIDEqualFold,omitempty"` + CorrelationIDContainsFold *string `json:"correlationIDContainsFold,omitempty"` + + // "event_type" field predicates. + EventType *string `json:"eventType,omitempty"` + EventTypeNEQ *string `json:"eventTypeNEQ,omitempty"` + EventTypeIn []string `json:"eventTypeIn,omitempty"` + EventTypeNotIn []string `json:"eventTypeNotIn,omitempty"` + EventTypeGT *string `json:"eventTypeGT,omitempty"` + EventTypeGTE *string `json:"eventTypeGTE,omitempty"` + EventTypeLT *string `json:"eventTypeLT,omitempty"` + EventTypeLTE *string `json:"eventTypeLTE,omitempty"` + EventTypeContains *string `json:"eventTypeContains,omitempty"` + EventTypeHasPrefix *string `json:"eventTypeHasPrefix,omitempty"` + EventTypeHasSuffix *string `json:"eventTypeHasSuffix,omitempty"` + EventTypeEqualFold *string `json:"eventTypeEqualFold,omitempty"` + EventTypeContainsFold *string `json:"eventTypeContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *EventHistoryWhereInput) AddPredicates(predicates ...predicate.EventHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the EventHistoryWhereInput filter on the EventHistoryQuery builder. +func (i *EventHistoryWhereInput) Filter(q *EventHistoryQuery) (*EventHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyEventHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyEventHistoryWhereInput is returned in case the EventHistoryWhereInput is empty. +var ErrEmptyEventHistoryWhereInput = errors.New("generated: empty predicate EventHistoryWhereInput") + +// P returns a predicate for filtering eventhistories. +// An error is returned if the input is empty or invalid. +func (i *EventHistoryWhereInput) P() (predicate.EventHistory, error) { + var predicates []predicate.EventHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, eventhistory.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.EventHistory, 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, eventhistory.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.EventHistory, 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, eventhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, eventhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, eventhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, eventhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, eventhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, eventhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, eventhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, eventhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, eventhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, eventhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, eventhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, eventhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, eventhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, eventhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, eventhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, eventhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, eventhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, eventhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, eventhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, eventhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, eventhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, eventhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, eventhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, eventhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, eventhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, eventhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, eventhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, eventhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, eventhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, eventhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, eventhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, eventhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, eventhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, eventhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, eventhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, eventhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, eventhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, eventhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, eventhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, eventhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, eventhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, eventhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, eventhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, eventhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, eventhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, eventhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, eventhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, eventhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, eventhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, eventhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, eventhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, eventhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, eventhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, eventhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, eventhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, eventhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, eventhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, eventhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, eventhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, eventhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, eventhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, eventhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, eventhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, eventhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, eventhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, eventhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, eventhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, eventhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, eventhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, eventhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, eventhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, eventhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, eventhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, eventhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, eventhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, eventhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, eventhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, eventhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, eventhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, eventhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, eventhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, eventhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, eventhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, eventhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, eventhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, eventhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, eventhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, eventhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.EventID != nil { + predicates = append(predicates, eventhistory.EventIDEQ(*i.EventID)) + } + if i.EventIDNEQ != nil { + predicates = append(predicates, eventhistory.EventIDNEQ(*i.EventIDNEQ)) + } + if len(i.EventIDIn) > 0 { + predicates = append(predicates, eventhistory.EventIDIn(i.EventIDIn...)) + } + if len(i.EventIDNotIn) > 0 { + predicates = append(predicates, eventhistory.EventIDNotIn(i.EventIDNotIn...)) + } + if i.EventIDGT != nil { + predicates = append(predicates, eventhistory.EventIDGT(*i.EventIDGT)) + } + if i.EventIDGTE != nil { + predicates = append(predicates, eventhistory.EventIDGTE(*i.EventIDGTE)) + } + if i.EventIDLT != nil { + predicates = append(predicates, eventhistory.EventIDLT(*i.EventIDLT)) + } + if i.EventIDLTE != nil { + predicates = append(predicates, eventhistory.EventIDLTE(*i.EventIDLTE)) + } + if i.EventIDContains != nil { + predicates = append(predicates, eventhistory.EventIDContains(*i.EventIDContains)) + } + if i.EventIDHasPrefix != nil { + predicates = append(predicates, eventhistory.EventIDHasPrefix(*i.EventIDHasPrefix)) + } + if i.EventIDHasSuffix != nil { + predicates = append(predicates, eventhistory.EventIDHasSuffix(*i.EventIDHasSuffix)) + } + if i.EventIDIsNil { + predicates = append(predicates, eventhistory.EventIDIsNil()) + } + if i.EventIDNotNil { + predicates = append(predicates, eventhistory.EventIDNotNil()) + } + if i.EventIDEqualFold != nil { + predicates = append(predicates, eventhistory.EventIDEqualFold(*i.EventIDEqualFold)) + } + if i.EventIDContainsFold != nil { + predicates = append(predicates, eventhistory.EventIDContainsFold(*i.EventIDContainsFold)) + } + if i.CorrelationID != nil { + predicates = append(predicates, eventhistory.CorrelationIDEQ(*i.CorrelationID)) + } + if i.CorrelationIDNEQ != nil { + predicates = append(predicates, eventhistory.CorrelationIDNEQ(*i.CorrelationIDNEQ)) + } + if len(i.CorrelationIDIn) > 0 { + predicates = append(predicates, eventhistory.CorrelationIDIn(i.CorrelationIDIn...)) + } + if len(i.CorrelationIDNotIn) > 0 { + predicates = append(predicates, eventhistory.CorrelationIDNotIn(i.CorrelationIDNotIn...)) + } + if i.CorrelationIDGT != nil { + predicates = append(predicates, eventhistory.CorrelationIDGT(*i.CorrelationIDGT)) + } + if i.CorrelationIDGTE != nil { + predicates = append(predicates, eventhistory.CorrelationIDGTE(*i.CorrelationIDGTE)) + } + if i.CorrelationIDLT != nil { + predicates = append(predicates, eventhistory.CorrelationIDLT(*i.CorrelationIDLT)) + } + if i.CorrelationIDLTE != nil { + predicates = append(predicates, eventhistory.CorrelationIDLTE(*i.CorrelationIDLTE)) + } + if i.CorrelationIDContains != nil { + predicates = append(predicates, eventhistory.CorrelationIDContains(*i.CorrelationIDContains)) + } + if i.CorrelationIDHasPrefix != nil { + predicates = append(predicates, eventhistory.CorrelationIDHasPrefix(*i.CorrelationIDHasPrefix)) + } + if i.CorrelationIDHasSuffix != nil { + predicates = append(predicates, eventhistory.CorrelationIDHasSuffix(*i.CorrelationIDHasSuffix)) + } + if i.CorrelationIDIsNil { + predicates = append(predicates, eventhistory.CorrelationIDIsNil()) + } + if i.CorrelationIDNotNil { + predicates = append(predicates, eventhistory.CorrelationIDNotNil()) + } + if i.CorrelationIDEqualFold != nil { + predicates = append(predicates, eventhistory.CorrelationIDEqualFold(*i.CorrelationIDEqualFold)) + } + if i.CorrelationIDContainsFold != nil { + predicates = append(predicates, eventhistory.CorrelationIDContainsFold(*i.CorrelationIDContainsFold)) + } + if i.EventType != nil { + predicates = append(predicates, eventhistory.EventTypeEQ(*i.EventType)) + } + if i.EventTypeNEQ != nil { + predicates = append(predicates, eventhistory.EventTypeNEQ(*i.EventTypeNEQ)) + } + if len(i.EventTypeIn) > 0 { + predicates = append(predicates, eventhistory.EventTypeIn(i.EventTypeIn...)) + } + if len(i.EventTypeNotIn) > 0 { + predicates = append(predicates, eventhistory.EventTypeNotIn(i.EventTypeNotIn...)) + } + if i.EventTypeGT != nil { + predicates = append(predicates, eventhistory.EventTypeGT(*i.EventTypeGT)) + } + if i.EventTypeGTE != nil { + predicates = append(predicates, eventhistory.EventTypeGTE(*i.EventTypeGTE)) + } + if i.EventTypeLT != nil { + predicates = append(predicates, eventhistory.EventTypeLT(*i.EventTypeLT)) + } + if i.EventTypeLTE != nil { + predicates = append(predicates, eventhistory.EventTypeLTE(*i.EventTypeLTE)) + } + if i.EventTypeContains != nil { + predicates = append(predicates, eventhistory.EventTypeContains(*i.EventTypeContains)) + } + if i.EventTypeHasPrefix != nil { + predicates = append(predicates, eventhistory.EventTypeHasPrefix(*i.EventTypeHasPrefix)) + } + if i.EventTypeHasSuffix != nil { + predicates = append(predicates, eventhistory.EventTypeHasSuffix(*i.EventTypeHasSuffix)) + } + if i.EventTypeEqualFold != nil { + predicates = append(predicates, eventhistory.EventTypeEqualFold(*i.EventTypeEqualFold)) + } + if i.EventTypeContainsFold != nil { + predicates = append(predicates, eventhistory.EventTypeContainsFold(*i.EventTypeContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyEventHistoryWhereInput + case 1: + return predicates[0], nil + default: + return eventhistory.And(predicates...), nil + } +} + +// FeatureWhereInput represents a where input for filtering Feature queries. +type FeatureWhereInput struct { + Predicates []predicate.Feature `json:"-"` + Not *FeatureWhereInput `json:"not,omitempty"` + Or []*FeatureWhereInput `json:"or,omitempty"` + And []*FeatureWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "enabled" field predicates. + Enabled *bool `json:"enabled,omitempty"` + EnabledNEQ *bool `json:"enabledNEQ,omitempty"` + + // "description" field predicates. + Description *string `json:"description,omitempty"` + DescriptionNEQ *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGT *string `json:"descriptionGT,omitempty"` + DescriptionGTE *string `json:"descriptionGTE,omitempty"` + DescriptionLT *string `json:"descriptionLT,omitempty"` + DescriptionLTE *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "plans" edge predicates. + HasPlans *bool `json:"hasPlans,omitempty"` + HasPlansWith []*EntitlementPlanWhereInput `json:"hasPlansWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + + // "features" edge predicates. + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasFeaturesWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *FeatureWhereInput) AddPredicates(predicates ...predicate.Feature) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the FeatureWhereInput filter on the FeatureQuery builder. +func (i *FeatureWhereInput) Filter(q *FeatureQuery) (*FeatureQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyFeatureWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyFeatureWhereInput is returned in case the FeatureWhereInput is empty. +var ErrEmptyFeatureWhereInput = errors.New("generated: empty predicate FeatureWhereInput") + +// P returns a predicate for filtering features. +// An error is returned if the input is empty or invalid. +func (i *FeatureWhereInput) P() (predicate.Feature, error) { + var predicates []predicate.Feature + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, feature.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.Feature, 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, feature.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.Feature, 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, feature.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, feature.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, feature.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, feature.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, feature.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, feature.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, feature.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, feature.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, feature.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, feature.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, feature.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, feature.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, feature.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, feature.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, feature.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, feature.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, feature.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, feature.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, feature.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, feature.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, feature.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, feature.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, feature.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, feature.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, feature.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, feature.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, feature.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, feature.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, feature.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, feature.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, feature.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, feature.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, feature.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, feature.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, feature.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, feature.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, feature.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, feature.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, feature.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, feature.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, feature.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, feature.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, feature.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, feature.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, feature.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, feature.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, feature.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, feature.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, feature.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, feature.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, feature.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, feature.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, feature.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, feature.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, feature.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, feature.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, feature.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, feature.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, feature.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, feature.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, feature.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, feature.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, feature.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, feature.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, feature.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, feature.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, feature.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, feature.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, feature.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, feature.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, feature.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, feature.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, feature.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, feature.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, feature.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, feature.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, feature.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, feature.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, feature.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, feature.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, feature.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, feature.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, feature.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, feature.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, feature.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, feature.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, feature.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, feature.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, feature.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, feature.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, feature.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, feature.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, feature.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, feature.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, feature.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, feature.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, feature.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, feature.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, feature.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, feature.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, feature.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, feature.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, feature.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, feature.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, feature.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, feature.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, feature.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, feature.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, feature.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, feature.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, feature.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, feature.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, feature.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, feature.NameContainsFold(*i.NameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, feature.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, feature.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, feature.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, feature.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, feature.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, feature.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, feature.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, feature.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, feature.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, feature.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, feature.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameIsNil { + predicates = append(predicates, feature.DisplayNameIsNil()) + } + if i.DisplayNameNotNil { + predicates = append(predicates, feature.DisplayNameNotNil()) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, feature.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, feature.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.Enabled != nil { + predicates = append(predicates, feature.EnabledEQ(*i.Enabled)) + } + if i.EnabledNEQ != nil { + predicates = append(predicates, feature.EnabledNEQ(*i.EnabledNEQ)) + } + if i.Description != nil { + predicates = append(predicates, feature.DescriptionEQ(*i.Description)) + } + if i.DescriptionNEQ != nil { + predicates = append(predicates, feature.DescriptionNEQ(*i.DescriptionNEQ)) + } + if len(i.DescriptionIn) > 0 { + predicates = append(predicates, feature.DescriptionIn(i.DescriptionIn...)) + } + if len(i.DescriptionNotIn) > 0 { + predicates = append(predicates, feature.DescriptionNotIn(i.DescriptionNotIn...)) + } + if i.DescriptionGT != nil { + predicates = append(predicates, feature.DescriptionGT(*i.DescriptionGT)) + } + if i.DescriptionGTE != nil { + predicates = append(predicates, feature.DescriptionGTE(*i.DescriptionGTE)) + } + if i.DescriptionLT != nil { + predicates = append(predicates, feature.DescriptionLT(*i.DescriptionLT)) + } + if i.DescriptionLTE != nil { + predicates = append(predicates, feature.DescriptionLTE(*i.DescriptionLTE)) + } + if i.DescriptionContains != nil { + predicates = append(predicates, feature.DescriptionContains(*i.DescriptionContains)) + } + if i.DescriptionHasPrefix != nil { + predicates = append(predicates, feature.DescriptionHasPrefix(*i.DescriptionHasPrefix)) + } + if i.DescriptionHasSuffix != nil { + predicates = append(predicates, feature.DescriptionHasSuffix(*i.DescriptionHasSuffix)) + } + if i.DescriptionIsNil { + predicates = append(predicates, feature.DescriptionIsNil()) + } + if i.DescriptionNotNil { + predicates = append(predicates, feature.DescriptionNotNil()) + } + if i.DescriptionEqualFold != nil { + predicates = append(predicates, feature.DescriptionEqualFold(*i.DescriptionEqualFold)) + } + if i.DescriptionContainsFold != nil { + predicates = append(predicates, feature.DescriptionContainsFold(*i.DescriptionContainsFold)) + } + + if i.HasOwner != nil { + p := feature.HasOwner() + if !*i.HasOwner { + p = feature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, feature.HasOwnerWith(with...)) + } + if i.HasPlans != nil { + p := feature.HasPlans() + if !*i.HasPlans { + p = feature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasPlansWith) > 0 { + with := make([]predicate.EntitlementPlan, 0, len(i.HasPlansWith)) + for _, w := range i.HasPlansWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasPlansWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, feature.HasPlansWith(with...)) + } + if i.HasEvents != nil { + p := feature.HasEvents() + if !*i.HasEvents { + p = feature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, feature.HasEventsWith(with...)) + } + if i.HasFeatures != nil { + p := feature.HasFeatures() + if !*i.HasFeatures { + p = feature.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFeaturesWith) > 0 { + with := make([]predicate.EntitlementPlanFeature, 0, len(i.HasFeaturesWith)) + for _, w := range i.HasFeaturesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFeaturesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, feature.HasFeaturesWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyFeatureWhereInput + case 1: + return predicates[0], nil + default: + return feature.And(predicates...), nil + } +} + +// FeatureHistoryWhereInput represents a where input for filtering FeatureHistory queries. +type FeatureHistoryWhereInput struct { + Predicates []predicate.FeatureHistory `json:"-"` + Not *FeatureHistoryWhereInput `json:"not,omitempty"` + Or []*FeatureHistoryWhereInput `json:"or,omitempty"` + And []*FeatureHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "enabled" field predicates. + Enabled *bool `json:"enabled,omitempty"` + EnabledNEQ *bool `json:"enabledNEQ,omitempty"` + + // "description" field predicates. + Description *string `json:"description,omitempty"` + DescriptionNEQ *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGT *string `json:"descriptionGT,omitempty"` + DescriptionGTE *string `json:"descriptionGTE,omitempty"` + DescriptionLT *string `json:"descriptionLT,omitempty"` + DescriptionLTE *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *FeatureHistoryWhereInput) AddPredicates(predicates ...predicate.FeatureHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the FeatureHistoryWhereInput filter on the FeatureHistoryQuery builder. +func (i *FeatureHistoryWhereInput) Filter(q *FeatureHistoryQuery) (*FeatureHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyFeatureHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyFeatureHistoryWhereInput is returned in case the FeatureHistoryWhereInput is empty. +var ErrEmptyFeatureHistoryWhereInput = errors.New("generated: empty predicate FeatureHistoryWhereInput") + +// P returns a predicate for filtering featurehistories. +// An error is returned if the input is empty or invalid. +func (i *FeatureHistoryWhereInput) P() (predicate.FeatureHistory, error) { + var predicates []predicate.FeatureHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, featurehistory.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.FeatureHistory, 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, featurehistory.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.FeatureHistory, 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, featurehistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, featurehistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, featurehistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, featurehistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, featurehistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, featurehistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, featurehistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, featurehistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, featurehistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, featurehistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, featurehistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, featurehistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, featurehistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, featurehistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, featurehistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, featurehistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, featurehistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, featurehistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, featurehistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, featurehistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, featurehistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, featurehistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, featurehistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, featurehistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, featurehistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, featurehistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, featurehistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, featurehistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, featurehistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, featurehistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, featurehistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, featurehistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, featurehistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, featurehistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, featurehistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, featurehistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, featurehistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, featurehistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, featurehistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, featurehistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, featurehistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, featurehistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, featurehistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, featurehistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, featurehistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, featurehistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, featurehistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, featurehistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, featurehistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, featurehistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, featurehistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, featurehistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, featurehistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, featurehistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, featurehistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, featurehistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, featurehistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, featurehistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, featurehistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, featurehistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, featurehistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, featurehistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, featurehistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, featurehistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, featurehistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, featurehistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, featurehistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, featurehistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, featurehistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, featurehistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, featurehistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, featurehistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, featurehistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, featurehistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, featurehistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, featurehistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, featurehistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, featurehistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, featurehistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, featurehistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, featurehistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, featurehistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, featurehistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, featurehistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, featurehistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, featurehistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, featurehistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, featurehistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, featurehistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, featurehistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, featurehistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, featurehistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, featurehistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, featurehistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, featurehistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, featurehistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, featurehistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, featurehistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, featurehistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, featurehistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, featurehistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, featurehistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, featurehistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, featurehistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, featurehistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, featurehistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, featurehistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, featurehistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, featurehistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, featurehistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, featurehistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, featurehistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, featurehistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, featurehistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, featurehistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, featurehistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, featurehistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, featurehistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, featurehistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, featurehistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, featurehistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, featurehistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, featurehistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, featurehistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, featurehistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, featurehistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, featurehistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, featurehistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, featurehistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, featurehistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, featurehistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, featurehistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, featurehistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, featurehistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, featurehistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, featurehistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, featurehistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, featurehistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, featurehistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, featurehistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, featurehistory.NameContainsFold(*i.NameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, featurehistory.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, featurehistory.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, featurehistory.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, featurehistory.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, featurehistory.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, featurehistory.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, featurehistory.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, featurehistory.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, featurehistory.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, featurehistory.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, featurehistory.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameIsNil { + predicates = append(predicates, featurehistory.DisplayNameIsNil()) + } + if i.DisplayNameNotNil { + predicates = append(predicates, featurehistory.DisplayNameNotNil()) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, featurehistory.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, featurehistory.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.Enabled != nil { + predicates = append(predicates, featurehistory.EnabledEQ(*i.Enabled)) + } + if i.EnabledNEQ != nil { + predicates = append(predicates, featurehistory.EnabledNEQ(*i.EnabledNEQ)) + } + if i.Description != nil { + predicates = append(predicates, featurehistory.DescriptionEQ(*i.Description)) + } + if i.DescriptionNEQ != nil { + predicates = append(predicates, featurehistory.DescriptionNEQ(*i.DescriptionNEQ)) + } + if len(i.DescriptionIn) > 0 { + predicates = append(predicates, featurehistory.DescriptionIn(i.DescriptionIn...)) + } + if len(i.DescriptionNotIn) > 0 { + predicates = append(predicates, featurehistory.DescriptionNotIn(i.DescriptionNotIn...)) + } + if i.DescriptionGT != nil { + predicates = append(predicates, featurehistory.DescriptionGT(*i.DescriptionGT)) + } + if i.DescriptionGTE != nil { + predicates = append(predicates, featurehistory.DescriptionGTE(*i.DescriptionGTE)) + } + if i.DescriptionLT != nil { + predicates = append(predicates, featurehistory.DescriptionLT(*i.DescriptionLT)) + } + if i.DescriptionLTE != nil { + predicates = append(predicates, featurehistory.DescriptionLTE(*i.DescriptionLTE)) + } + if i.DescriptionContains != nil { + predicates = append(predicates, featurehistory.DescriptionContains(*i.DescriptionContains)) + } + if i.DescriptionHasPrefix != nil { + predicates = append(predicates, featurehistory.DescriptionHasPrefix(*i.DescriptionHasPrefix)) + } + if i.DescriptionHasSuffix != nil { + predicates = append(predicates, featurehistory.DescriptionHasSuffix(*i.DescriptionHasSuffix)) + } + if i.DescriptionIsNil { + predicates = append(predicates, featurehistory.DescriptionIsNil()) + } + if i.DescriptionNotNil { + predicates = append(predicates, featurehistory.DescriptionNotNil()) + } + if i.DescriptionEqualFold != nil { + predicates = append(predicates, featurehistory.DescriptionEqualFold(*i.DescriptionEqualFold)) + } + if i.DescriptionContainsFold != nil { + predicates = append(predicates, featurehistory.DescriptionContainsFold(*i.DescriptionContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyFeatureHistoryWhereInput + case 1: + return predicates[0], nil + default: + return featurehistory.And(predicates...), nil + } +} + +// FileWhereInput represents a where input for filtering File queries. +type FileWhereInput struct { + Predicates []predicate.File `json:"-"` + Not *FileWhereInput `json:"not,omitempty"` + Or []*FileWhereInput `json:"or,omitempty"` + And []*FileWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "file_name" field predicates. + FileName *string `json:"fileName,omitempty"` + FileNameNEQ *string `json:"fileNameNEQ,omitempty"` + FileNameIn []string `json:"fileNameIn,omitempty"` + FileNameNotIn []string `json:"fileNameNotIn,omitempty"` + FileNameGT *string `json:"fileNameGT,omitempty"` + FileNameGTE *string `json:"fileNameGTE,omitempty"` + FileNameLT *string `json:"fileNameLT,omitempty"` + FileNameLTE *string `json:"fileNameLTE,omitempty"` + FileNameContains *string `json:"fileNameContains,omitempty"` + FileNameHasPrefix *string `json:"fileNameHasPrefix,omitempty"` + FileNameHasSuffix *string `json:"fileNameHasSuffix,omitempty"` + FileNameEqualFold *string `json:"fileNameEqualFold,omitempty"` + FileNameContainsFold *string `json:"fileNameContainsFold,omitempty"` + + // "file_extension" field predicates. + FileExtension *string `json:"fileExtension,omitempty"` + FileExtensionNEQ *string `json:"fileExtensionNEQ,omitempty"` + FileExtensionIn []string `json:"fileExtensionIn,omitempty"` + FileExtensionNotIn []string `json:"fileExtensionNotIn,omitempty"` + FileExtensionGT *string `json:"fileExtensionGT,omitempty"` + FileExtensionGTE *string `json:"fileExtensionGTE,omitempty"` + FileExtensionLT *string `json:"fileExtensionLT,omitempty"` + FileExtensionLTE *string `json:"fileExtensionLTE,omitempty"` + FileExtensionContains *string `json:"fileExtensionContains,omitempty"` + FileExtensionHasPrefix *string `json:"fileExtensionHasPrefix,omitempty"` + FileExtensionHasSuffix *string `json:"fileExtensionHasSuffix,omitempty"` + FileExtensionEqualFold *string `json:"fileExtensionEqualFold,omitempty"` + FileExtensionContainsFold *string `json:"fileExtensionContainsFold,omitempty"` + + // "file_size" field predicates. + FileSize *int `json:"fileSize,omitempty"` + FileSizeNEQ *int `json:"fileSizeNEQ,omitempty"` + FileSizeIn []int `json:"fileSizeIn,omitempty"` + FileSizeNotIn []int `json:"fileSizeNotIn,omitempty"` + FileSizeGT *int `json:"fileSizeGT,omitempty"` + FileSizeGTE *int `json:"fileSizeGTE,omitempty"` + FileSizeLT *int `json:"fileSizeLT,omitempty"` + FileSizeLTE *int `json:"fileSizeLTE,omitempty"` + FileSizeIsNil bool `json:"fileSizeIsNil,omitempty"` + FileSizeNotNil bool `json:"fileSizeNotNil,omitempty"` + + // "content_type" field predicates. + ContentType *string `json:"contentType,omitempty"` + ContentTypeNEQ *string `json:"contentTypeNEQ,omitempty"` + ContentTypeIn []string `json:"contentTypeIn,omitempty"` + ContentTypeNotIn []string `json:"contentTypeNotIn,omitempty"` + ContentTypeGT *string `json:"contentTypeGT,omitempty"` + ContentTypeGTE *string `json:"contentTypeGTE,omitempty"` + ContentTypeLT *string `json:"contentTypeLT,omitempty"` + ContentTypeLTE *string `json:"contentTypeLTE,omitempty"` + ContentTypeContains *string `json:"contentTypeContains,omitempty"` + ContentTypeHasPrefix *string `json:"contentTypeHasPrefix,omitempty"` + ContentTypeHasSuffix *string `json:"contentTypeHasSuffix,omitempty"` + ContentTypeEqualFold *string `json:"contentTypeEqualFold,omitempty"` + ContentTypeContainsFold *string `json:"contentTypeContainsFold,omitempty"` + + // "store_key" field predicates. + StoreKey *string `json:"storeKey,omitempty"` + StoreKeyNEQ *string `json:"storeKeyNEQ,omitempty"` + StoreKeyIn []string `json:"storeKeyIn,omitempty"` + StoreKeyNotIn []string `json:"storeKeyNotIn,omitempty"` + StoreKeyGT *string `json:"storeKeyGT,omitempty"` + StoreKeyGTE *string `json:"storeKeyGTE,omitempty"` + StoreKeyLT *string `json:"storeKeyLT,omitempty"` + StoreKeyLTE *string `json:"storeKeyLTE,omitempty"` + StoreKeyContains *string `json:"storeKeyContains,omitempty"` + StoreKeyHasPrefix *string `json:"storeKeyHasPrefix,omitempty"` + StoreKeyHasSuffix *string `json:"storeKeyHasSuffix,omitempty"` + StoreKeyEqualFold *string `json:"storeKeyEqualFold,omitempty"` + StoreKeyContainsFold *string `json:"storeKeyContainsFold,omitempty"` + + // "category" field predicates. + Category *string `json:"category,omitempty"` + CategoryNEQ *string `json:"categoryNEQ,omitempty"` + CategoryIn []string `json:"categoryIn,omitempty"` + CategoryNotIn []string `json:"categoryNotIn,omitempty"` + CategoryGT *string `json:"categoryGT,omitempty"` + CategoryGTE *string `json:"categoryGTE,omitempty"` + CategoryLT *string `json:"categoryLT,omitempty"` + CategoryLTE *string `json:"categoryLTE,omitempty"` + CategoryContains *string `json:"categoryContains,omitempty"` + CategoryHasPrefix *string `json:"categoryHasPrefix,omitempty"` + CategoryHasSuffix *string `json:"categoryHasSuffix,omitempty"` + CategoryIsNil bool `json:"categoryIsNil,omitempty"` + CategoryNotNil bool `json:"categoryNotNil,omitempty"` + CategoryEqualFold *string `json:"categoryEqualFold,omitempty"` + CategoryContainsFold *string `json:"categoryContainsFold,omitempty"` + + // "annotation" field predicates. + Annotation *string `json:"annotation,omitempty"` + AnnotationNEQ *string `json:"annotationNEQ,omitempty"` + AnnotationIn []string `json:"annotationIn,omitempty"` + AnnotationNotIn []string `json:"annotationNotIn,omitempty"` + AnnotationGT *string `json:"annotationGT,omitempty"` + AnnotationGTE *string `json:"annotationGTE,omitempty"` + AnnotationLT *string `json:"annotationLT,omitempty"` + AnnotationLTE *string `json:"annotationLTE,omitempty"` + AnnotationContains *string `json:"annotationContains,omitempty"` + AnnotationHasPrefix *string `json:"annotationHasPrefix,omitempty"` + AnnotationHasSuffix *string `json:"annotationHasSuffix,omitempty"` + AnnotationIsNil bool `json:"annotationIsNil,omitempty"` + AnnotationNotNil bool `json:"annotationNotNil,omitempty"` + AnnotationEqualFold *string `json:"annotationEqualFold,omitempty"` + AnnotationContainsFold *string `json:"annotationContainsFold,omitempty"` + + // "user" edge predicates. + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + + // "organization" edge predicates. + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + + // "entity" edge predicates. + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` + + // "group" edge predicates. + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *FileWhereInput) AddPredicates(predicates ...predicate.File) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the FileWhereInput filter on the FileQuery builder. +func (i *FileWhereInput) Filter(q *FileQuery) (*FileQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyFileWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyFileWhereInput is returned in case the FileWhereInput is empty. +var ErrEmptyFileWhereInput = errors.New("generated: empty predicate FileWhereInput") + +// P returns a predicate for filtering files. +// An error is returned if the input is empty or invalid. +func (i *FileWhereInput) P() (predicate.File, error) { + var predicates []predicate.File + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, file.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.File, 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, file.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.File, 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, file.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, file.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, file.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, file.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, file.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, file.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, file.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, file.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, file.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, file.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, file.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, file.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, file.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, file.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, file.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, file.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, file.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, file.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, file.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, file.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, file.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, file.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, file.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, file.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, file.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, file.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, file.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, file.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, file.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, file.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, file.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, file.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, file.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, file.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, file.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, file.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, file.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, file.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, file.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, file.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, file.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, file.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, file.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, file.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, file.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, file.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, file.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, file.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, file.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, file.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, file.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, file.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, file.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, file.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, file.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, file.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, file.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, file.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, file.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, file.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, file.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, file.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, file.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, file.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, file.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, file.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, file.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, file.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, file.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, file.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, file.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, file.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, file.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, file.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, file.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, file.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, file.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, file.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, file.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, file.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, file.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, file.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, file.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, file.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, file.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, file.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.FileName != nil { + predicates = append(predicates, file.FileNameEQ(*i.FileName)) + } + if i.FileNameNEQ != nil { + predicates = append(predicates, file.FileNameNEQ(*i.FileNameNEQ)) + } + if len(i.FileNameIn) > 0 { + predicates = append(predicates, file.FileNameIn(i.FileNameIn...)) + } + if len(i.FileNameNotIn) > 0 { + predicates = append(predicates, file.FileNameNotIn(i.FileNameNotIn...)) + } + if i.FileNameGT != nil { + predicates = append(predicates, file.FileNameGT(*i.FileNameGT)) + } + if i.FileNameGTE != nil { + predicates = append(predicates, file.FileNameGTE(*i.FileNameGTE)) + } + if i.FileNameLT != nil { + predicates = append(predicates, file.FileNameLT(*i.FileNameLT)) + } + if i.FileNameLTE != nil { + predicates = append(predicates, file.FileNameLTE(*i.FileNameLTE)) + } + if i.FileNameContains != nil { + predicates = append(predicates, file.FileNameContains(*i.FileNameContains)) + } + if i.FileNameHasPrefix != nil { + predicates = append(predicates, file.FileNameHasPrefix(*i.FileNameHasPrefix)) + } + if i.FileNameHasSuffix != nil { + predicates = append(predicates, file.FileNameHasSuffix(*i.FileNameHasSuffix)) + } + if i.FileNameEqualFold != nil { + predicates = append(predicates, file.FileNameEqualFold(*i.FileNameEqualFold)) + } + if i.FileNameContainsFold != nil { + predicates = append(predicates, file.FileNameContainsFold(*i.FileNameContainsFold)) + } + if i.FileExtension != nil { + predicates = append(predicates, file.FileExtensionEQ(*i.FileExtension)) + } + if i.FileExtensionNEQ != nil { + predicates = append(predicates, file.FileExtensionNEQ(*i.FileExtensionNEQ)) + } + if len(i.FileExtensionIn) > 0 { + predicates = append(predicates, file.FileExtensionIn(i.FileExtensionIn...)) + } + if len(i.FileExtensionNotIn) > 0 { + predicates = append(predicates, file.FileExtensionNotIn(i.FileExtensionNotIn...)) + } + if i.FileExtensionGT != nil { + predicates = append(predicates, file.FileExtensionGT(*i.FileExtensionGT)) + } + if i.FileExtensionGTE != nil { + predicates = append(predicates, file.FileExtensionGTE(*i.FileExtensionGTE)) + } + if i.FileExtensionLT != nil { + predicates = append(predicates, file.FileExtensionLT(*i.FileExtensionLT)) + } + if i.FileExtensionLTE != nil { + predicates = append(predicates, file.FileExtensionLTE(*i.FileExtensionLTE)) + } + if i.FileExtensionContains != nil { + predicates = append(predicates, file.FileExtensionContains(*i.FileExtensionContains)) + } + if i.FileExtensionHasPrefix != nil { + predicates = append(predicates, file.FileExtensionHasPrefix(*i.FileExtensionHasPrefix)) + } + if i.FileExtensionHasSuffix != nil { + predicates = append(predicates, file.FileExtensionHasSuffix(*i.FileExtensionHasSuffix)) + } + if i.FileExtensionEqualFold != nil { + predicates = append(predicates, file.FileExtensionEqualFold(*i.FileExtensionEqualFold)) + } + if i.FileExtensionContainsFold != nil { + predicates = append(predicates, file.FileExtensionContainsFold(*i.FileExtensionContainsFold)) + } + if i.FileSize != nil { + predicates = append(predicates, file.FileSizeEQ(*i.FileSize)) + } + if i.FileSizeNEQ != nil { + predicates = append(predicates, file.FileSizeNEQ(*i.FileSizeNEQ)) + } + if len(i.FileSizeIn) > 0 { + predicates = append(predicates, file.FileSizeIn(i.FileSizeIn...)) + } + if len(i.FileSizeNotIn) > 0 { + predicates = append(predicates, file.FileSizeNotIn(i.FileSizeNotIn...)) + } + if i.FileSizeGT != nil { + predicates = append(predicates, file.FileSizeGT(*i.FileSizeGT)) + } + if i.FileSizeGTE != nil { + predicates = append(predicates, file.FileSizeGTE(*i.FileSizeGTE)) + } + if i.FileSizeLT != nil { + predicates = append(predicates, file.FileSizeLT(*i.FileSizeLT)) + } + if i.FileSizeLTE != nil { + predicates = append(predicates, file.FileSizeLTE(*i.FileSizeLTE)) + } + if i.FileSizeIsNil { + predicates = append(predicates, file.FileSizeIsNil()) + } + if i.FileSizeNotNil { + predicates = append(predicates, file.FileSizeNotNil()) + } + if i.ContentType != nil { + predicates = append(predicates, file.ContentTypeEQ(*i.ContentType)) + } + if i.ContentTypeNEQ != nil { + predicates = append(predicates, file.ContentTypeNEQ(*i.ContentTypeNEQ)) + } + if len(i.ContentTypeIn) > 0 { + predicates = append(predicates, file.ContentTypeIn(i.ContentTypeIn...)) + } + if len(i.ContentTypeNotIn) > 0 { + predicates = append(predicates, file.ContentTypeNotIn(i.ContentTypeNotIn...)) + } + if i.ContentTypeGT != nil { + predicates = append(predicates, file.ContentTypeGT(*i.ContentTypeGT)) + } + if i.ContentTypeGTE != nil { + predicates = append(predicates, file.ContentTypeGTE(*i.ContentTypeGTE)) + } + if i.ContentTypeLT != nil { + predicates = append(predicates, file.ContentTypeLT(*i.ContentTypeLT)) + } + if i.ContentTypeLTE != nil { + predicates = append(predicates, file.ContentTypeLTE(*i.ContentTypeLTE)) + } + if i.ContentTypeContains != nil { + predicates = append(predicates, file.ContentTypeContains(*i.ContentTypeContains)) + } + if i.ContentTypeHasPrefix != nil { + predicates = append(predicates, file.ContentTypeHasPrefix(*i.ContentTypeHasPrefix)) + } + if i.ContentTypeHasSuffix != nil { + predicates = append(predicates, file.ContentTypeHasSuffix(*i.ContentTypeHasSuffix)) + } + if i.ContentTypeEqualFold != nil { + predicates = append(predicates, file.ContentTypeEqualFold(*i.ContentTypeEqualFold)) + } + if i.ContentTypeContainsFold != nil { + predicates = append(predicates, file.ContentTypeContainsFold(*i.ContentTypeContainsFold)) + } + if i.StoreKey != nil { + predicates = append(predicates, file.StoreKeyEQ(*i.StoreKey)) + } + if i.StoreKeyNEQ != nil { + predicates = append(predicates, file.StoreKeyNEQ(*i.StoreKeyNEQ)) + } + if len(i.StoreKeyIn) > 0 { + predicates = append(predicates, file.StoreKeyIn(i.StoreKeyIn...)) + } + if len(i.StoreKeyNotIn) > 0 { + predicates = append(predicates, file.StoreKeyNotIn(i.StoreKeyNotIn...)) + } + if i.StoreKeyGT != nil { + predicates = append(predicates, file.StoreKeyGT(*i.StoreKeyGT)) + } + if i.StoreKeyGTE != nil { + predicates = append(predicates, file.StoreKeyGTE(*i.StoreKeyGTE)) + } + if i.StoreKeyLT != nil { + predicates = append(predicates, file.StoreKeyLT(*i.StoreKeyLT)) + } + if i.StoreKeyLTE != nil { + predicates = append(predicates, file.StoreKeyLTE(*i.StoreKeyLTE)) + } + if i.StoreKeyContains != nil { + predicates = append(predicates, file.StoreKeyContains(*i.StoreKeyContains)) + } + if i.StoreKeyHasPrefix != nil { + predicates = append(predicates, file.StoreKeyHasPrefix(*i.StoreKeyHasPrefix)) + } + if i.StoreKeyHasSuffix != nil { + predicates = append(predicates, file.StoreKeyHasSuffix(*i.StoreKeyHasSuffix)) + } + if i.StoreKeyEqualFold != nil { + predicates = append(predicates, file.StoreKeyEqualFold(*i.StoreKeyEqualFold)) + } + if i.StoreKeyContainsFold != nil { + predicates = append(predicates, file.StoreKeyContainsFold(*i.StoreKeyContainsFold)) + } + if i.Category != nil { + predicates = append(predicates, file.CategoryEQ(*i.Category)) + } + if i.CategoryNEQ != nil { + predicates = append(predicates, file.CategoryNEQ(*i.CategoryNEQ)) + } + if len(i.CategoryIn) > 0 { + predicates = append(predicates, file.CategoryIn(i.CategoryIn...)) + } + if len(i.CategoryNotIn) > 0 { + predicates = append(predicates, file.CategoryNotIn(i.CategoryNotIn...)) + } + if i.CategoryGT != nil { + predicates = append(predicates, file.CategoryGT(*i.CategoryGT)) + } + if i.CategoryGTE != nil { + predicates = append(predicates, file.CategoryGTE(*i.CategoryGTE)) + } + if i.CategoryLT != nil { + predicates = append(predicates, file.CategoryLT(*i.CategoryLT)) + } + if i.CategoryLTE != nil { + predicates = append(predicates, file.CategoryLTE(*i.CategoryLTE)) + } + if i.CategoryContains != nil { + predicates = append(predicates, file.CategoryContains(*i.CategoryContains)) + } + if i.CategoryHasPrefix != nil { + predicates = append(predicates, file.CategoryHasPrefix(*i.CategoryHasPrefix)) + } + if i.CategoryHasSuffix != nil { + predicates = append(predicates, file.CategoryHasSuffix(*i.CategoryHasSuffix)) + } + if i.CategoryIsNil { + predicates = append(predicates, file.CategoryIsNil()) + } + if i.CategoryNotNil { + predicates = append(predicates, file.CategoryNotNil()) + } + if i.CategoryEqualFold != nil { + predicates = append(predicates, file.CategoryEqualFold(*i.CategoryEqualFold)) + } + if i.CategoryContainsFold != nil { + predicates = append(predicates, file.CategoryContainsFold(*i.CategoryContainsFold)) + } + if i.Annotation != nil { + predicates = append(predicates, file.AnnotationEQ(*i.Annotation)) + } + if i.AnnotationNEQ != nil { + predicates = append(predicates, file.AnnotationNEQ(*i.AnnotationNEQ)) + } + if len(i.AnnotationIn) > 0 { + predicates = append(predicates, file.AnnotationIn(i.AnnotationIn...)) + } + if len(i.AnnotationNotIn) > 0 { + predicates = append(predicates, file.AnnotationNotIn(i.AnnotationNotIn...)) + } + if i.AnnotationGT != nil { + predicates = append(predicates, file.AnnotationGT(*i.AnnotationGT)) + } + if i.AnnotationGTE != nil { + predicates = append(predicates, file.AnnotationGTE(*i.AnnotationGTE)) + } + if i.AnnotationLT != nil { + predicates = append(predicates, file.AnnotationLT(*i.AnnotationLT)) + } + if i.AnnotationLTE != nil { + predicates = append(predicates, file.AnnotationLTE(*i.AnnotationLTE)) + } + if i.AnnotationContains != nil { + predicates = append(predicates, file.AnnotationContains(*i.AnnotationContains)) + } + if i.AnnotationHasPrefix != nil { + predicates = append(predicates, file.AnnotationHasPrefix(*i.AnnotationHasPrefix)) + } + if i.AnnotationHasSuffix != nil { + predicates = append(predicates, file.AnnotationHasSuffix(*i.AnnotationHasSuffix)) + } + if i.AnnotationIsNil { + predicates = append(predicates, file.AnnotationIsNil()) + } + if i.AnnotationNotNil { + predicates = append(predicates, file.AnnotationNotNil()) + } + if i.AnnotationEqualFold != nil { + predicates = append(predicates, file.AnnotationEqualFold(*i.AnnotationEqualFold)) + } + if i.AnnotationContainsFold != nil { + predicates = append(predicates, file.AnnotationContainsFold(*i.AnnotationContainsFold)) + } + + if i.HasUser != nil { + p := file.HasUser() + if !*i.HasUser { + p = file.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasUserWith) > 0 { + with := make([]predicate.User, 0, len(i.HasUserWith)) + for _, w := range i.HasUserWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasUserWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, file.HasUserWith(with...)) + } + if i.HasOrganization != nil { + p := file.HasOrganization() + if !*i.HasOrganization { + p = file.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationWith)) + for _, w := range i.HasOrganizationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, file.HasOrganizationWith(with...)) + } + if i.HasEntity != nil { + p := file.HasEntity() + if !*i.HasEntity { + p = file.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntityWith) > 0 { + with := make([]predicate.Entity, 0, len(i.HasEntityWith)) + for _, w := range i.HasEntityWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntityWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, file.HasEntityWith(with...)) + } + if i.HasGroup != nil { + p := file.HasGroup() + if !*i.HasGroup { + p = file.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupWith) > 0 { + with := make([]predicate.Group, 0, len(i.HasGroupWith)) + for _, w := range i.HasGroupWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, file.HasGroupWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyFileWhereInput + case 1: + return predicates[0], nil + default: + return file.And(predicates...), nil + } +} + +// FileHistoryWhereInput represents a where input for filtering FileHistory queries. +type FileHistoryWhereInput struct { + Predicates []predicate.FileHistory `json:"-"` + Not *FileHistoryWhereInput `json:"not,omitempty"` + Or []*FileHistoryWhereInput `json:"or,omitempty"` + And []*FileHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "file_name" field predicates. + FileName *string `json:"fileName,omitempty"` + FileNameNEQ *string `json:"fileNameNEQ,omitempty"` + FileNameIn []string `json:"fileNameIn,omitempty"` + FileNameNotIn []string `json:"fileNameNotIn,omitempty"` + FileNameGT *string `json:"fileNameGT,omitempty"` + FileNameGTE *string `json:"fileNameGTE,omitempty"` + FileNameLT *string `json:"fileNameLT,omitempty"` + FileNameLTE *string `json:"fileNameLTE,omitempty"` + FileNameContains *string `json:"fileNameContains,omitempty"` + FileNameHasPrefix *string `json:"fileNameHasPrefix,omitempty"` + FileNameHasSuffix *string `json:"fileNameHasSuffix,omitempty"` + FileNameEqualFold *string `json:"fileNameEqualFold,omitempty"` + FileNameContainsFold *string `json:"fileNameContainsFold,omitempty"` + + // "file_extension" field predicates. + FileExtension *string `json:"fileExtension,omitempty"` + FileExtensionNEQ *string `json:"fileExtensionNEQ,omitempty"` + FileExtensionIn []string `json:"fileExtensionIn,omitempty"` + FileExtensionNotIn []string `json:"fileExtensionNotIn,omitempty"` + FileExtensionGT *string `json:"fileExtensionGT,omitempty"` + FileExtensionGTE *string `json:"fileExtensionGTE,omitempty"` + FileExtensionLT *string `json:"fileExtensionLT,omitempty"` + FileExtensionLTE *string `json:"fileExtensionLTE,omitempty"` + FileExtensionContains *string `json:"fileExtensionContains,omitempty"` + FileExtensionHasPrefix *string `json:"fileExtensionHasPrefix,omitempty"` + FileExtensionHasSuffix *string `json:"fileExtensionHasSuffix,omitempty"` + FileExtensionEqualFold *string `json:"fileExtensionEqualFold,omitempty"` + FileExtensionContainsFold *string `json:"fileExtensionContainsFold,omitempty"` + + // "file_size" field predicates. + FileSize *int `json:"fileSize,omitempty"` + FileSizeNEQ *int `json:"fileSizeNEQ,omitempty"` + FileSizeIn []int `json:"fileSizeIn,omitempty"` + FileSizeNotIn []int `json:"fileSizeNotIn,omitempty"` + FileSizeGT *int `json:"fileSizeGT,omitempty"` + FileSizeGTE *int `json:"fileSizeGTE,omitempty"` + FileSizeLT *int `json:"fileSizeLT,omitempty"` + FileSizeLTE *int `json:"fileSizeLTE,omitempty"` + FileSizeIsNil bool `json:"fileSizeIsNil,omitempty"` + FileSizeNotNil bool `json:"fileSizeNotNil,omitempty"` + + // "content_type" field predicates. + ContentType *string `json:"contentType,omitempty"` + ContentTypeNEQ *string `json:"contentTypeNEQ,omitempty"` + ContentTypeIn []string `json:"contentTypeIn,omitempty"` + ContentTypeNotIn []string `json:"contentTypeNotIn,omitempty"` + ContentTypeGT *string `json:"contentTypeGT,omitempty"` + ContentTypeGTE *string `json:"contentTypeGTE,omitempty"` + ContentTypeLT *string `json:"contentTypeLT,omitempty"` + ContentTypeLTE *string `json:"contentTypeLTE,omitempty"` + ContentTypeContains *string `json:"contentTypeContains,omitempty"` + ContentTypeHasPrefix *string `json:"contentTypeHasPrefix,omitempty"` + ContentTypeHasSuffix *string `json:"contentTypeHasSuffix,omitempty"` + ContentTypeEqualFold *string `json:"contentTypeEqualFold,omitempty"` + ContentTypeContainsFold *string `json:"contentTypeContainsFold,omitempty"` + + // "store_key" field predicates. + StoreKey *string `json:"storeKey,omitempty"` + StoreKeyNEQ *string `json:"storeKeyNEQ,omitempty"` + StoreKeyIn []string `json:"storeKeyIn,omitempty"` + StoreKeyNotIn []string `json:"storeKeyNotIn,omitempty"` + StoreKeyGT *string `json:"storeKeyGT,omitempty"` + StoreKeyGTE *string `json:"storeKeyGTE,omitempty"` + StoreKeyLT *string `json:"storeKeyLT,omitempty"` + StoreKeyLTE *string `json:"storeKeyLTE,omitempty"` + StoreKeyContains *string `json:"storeKeyContains,omitempty"` + StoreKeyHasPrefix *string `json:"storeKeyHasPrefix,omitempty"` + StoreKeyHasSuffix *string `json:"storeKeyHasSuffix,omitempty"` + StoreKeyEqualFold *string `json:"storeKeyEqualFold,omitempty"` + StoreKeyContainsFold *string `json:"storeKeyContainsFold,omitempty"` + + // "category" field predicates. + Category *string `json:"category,omitempty"` + CategoryNEQ *string `json:"categoryNEQ,omitempty"` + CategoryIn []string `json:"categoryIn,omitempty"` + CategoryNotIn []string `json:"categoryNotIn,omitempty"` + CategoryGT *string `json:"categoryGT,omitempty"` + CategoryGTE *string `json:"categoryGTE,omitempty"` + CategoryLT *string `json:"categoryLT,omitempty"` + CategoryLTE *string `json:"categoryLTE,omitempty"` + CategoryContains *string `json:"categoryContains,omitempty"` + CategoryHasPrefix *string `json:"categoryHasPrefix,omitempty"` + CategoryHasSuffix *string `json:"categoryHasSuffix,omitempty"` + CategoryIsNil bool `json:"categoryIsNil,omitempty"` + CategoryNotNil bool `json:"categoryNotNil,omitempty"` + CategoryEqualFold *string `json:"categoryEqualFold,omitempty"` + CategoryContainsFold *string `json:"categoryContainsFold,omitempty"` + + // "annotation" field predicates. + Annotation *string `json:"annotation,omitempty"` + AnnotationNEQ *string `json:"annotationNEQ,omitempty"` + AnnotationIn []string `json:"annotationIn,omitempty"` + AnnotationNotIn []string `json:"annotationNotIn,omitempty"` + AnnotationGT *string `json:"annotationGT,omitempty"` + AnnotationGTE *string `json:"annotationGTE,omitempty"` + AnnotationLT *string `json:"annotationLT,omitempty"` + AnnotationLTE *string `json:"annotationLTE,omitempty"` + AnnotationContains *string `json:"annotationContains,omitempty"` + AnnotationHasPrefix *string `json:"annotationHasPrefix,omitempty"` + AnnotationHasSuffix *string `json:"annotationHasSuffix,omitempty"` + AnnotationIsNil bool `json:"annotationIsNil,omitempty"` + AnnotationNotNil bool `json:"annotationNotNil,omitempty"` + AnnotationEqualFold *string `json:"annotationEqualFold,omitempty"` + AnnotationContainsFold *string `json:"annotationContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *FileHistoryWhereInput) AddPredicates(predicates ...predicate.FileHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the FileHistoryWhereInput filter on the FileHistoryQuery builder. +func (i *FileHistoryWhereInput) Filter(q *FileHistoryQuery) (*FileHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyFileHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyFileHistoryWhereInput is returned in case the FileHistoryWhereInput is empty. +var ErrEmptyFileHistoryWhereInput = errors.New("generated: empty predicate FileHistoryWhereInput") + +// P returns a predicate for filtering filehistories. +// An error is returned if the input is empty or invalid. +func (i *FileHistoryWhereInput) P() (predicate.FileHistory, error) { + var predicates []predicate.FileHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, filehistory.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.FileHistory, 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, filehistory.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.FileHistory, 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, filehistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, filehistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, filehistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, filehistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, filehistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, filehistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, filehistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, filehistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, filehistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, filehistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, filehistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, filehistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, filehistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, filehistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, filehistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, filehistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, filehistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, filehistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, filehistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, filehistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, filehistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, filehistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, filehistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, filehistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, filehistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, filehistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, filehistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, filehistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, filehistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, filehistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, filehistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, filehistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, filehistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, filehistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, filehistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, filehistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, filehistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, filehistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, filehistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, filehistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, filehistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, filehistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, filehistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, filehistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, filehistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, filehistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, filehistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, filehistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, filehistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, filehistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, filehistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, filehistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, filehistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, filehistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, filehistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, filehistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, filehistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, filehistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, filehistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, filehistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, filehistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, filehistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, filehistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, filehistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, filehistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, filehistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, filehistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, filehistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, filehistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, filehistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, filehistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, filehistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, filehistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, filehistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, filehistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, filehistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, filehistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, filehistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, filehistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, filehistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, filehistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, filehistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, filehistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, filehistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, filehistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, filehistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, filehistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, filehistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, filehistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, filehistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, filehistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, filehistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, filehistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, filehistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, filehistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, filehistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, filehistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, filehistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, filehistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, filehistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, filehistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, filehistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, filehistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, filehistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, filehistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, filehistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, filehistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, filehistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, filehistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, filehistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, filehistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, filehistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, filehistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.FileName != nil { + predicates = append(predicates, filehistory.FileNameEQ(*i.FileName)) + } + if i.FileNameNEQ != nil { + predicates = append(predicates, filehistory.FileNameNEQ(*i.FileNameNEQ)) + } + if len(i.FileNameIn) > 0 { + predicates = append(predicates, filehistory.FileNameIn(i.FileNameIn...)) + } + if len(i.FileNameNotIn) > 0 { + predicates = append(predicates, filehistory.FileNameNotIn(i.FileNameNotIn...)) + } + if i.FileNameGT != nil { + predicates = append(predicates, filehistory.FileNameGT(*i.FileNameGT)) + } + if i.FileNameGTE != nil { + predicates = append(predicates, filehistory.FileNameGTE(*i.FileNameGTE)) + } + if i.FileNameLT != nil { + predicates = append(predicates, filehistory.FileNameLT(*i.FileNameLT)) + } + if i.FileNameLTE != nil { + predicates = append(predicates, filehistory.FileNameLTE(*i.FileNameLTE)) + } + if i.FileNameContains != nil { + predicates = append(predicates, filehistory.FileNameContains(*i.FileNameContains)) + } + if i.FileNameHasPrefix != nil { + predicates = append(predicates, filehistory.FileNameHasPrefix(*i.FileNameHasPrefix)) + } + if i.FileNameHasSuffix != nil { + predicates = append(predicates, filehistory.FileNameHasSuffix(*i.FileNameHasSuffix)) + } + if i.FileNameEqualFold != nil { + predicates = append(predicates, filehistory.FileNameEqualFold(*i.FileNameEqualFold)) + } + if i.FileNameContainsFold != nil { + predicates = append(predicates, filehistory.FileNameContainsFold(*i.FileNameContainsFold)) + } + if i.FileExtension != nil { + predicates = append(predicates, filehistory.FileExtensionEQ(*i.FileExtension)) + } + if i.FileExtensionNEQ != nil { + predicates = append(predicates, filehistory.FileExtensionNEQ(*i.FileExtensionNEQ)) + } + if len(i.FileExtensionIn) > 0 { + predicates = append(predicates, filehistory.FileExtensionIn(i.FileExtensionIn...)) + } + if len(i.FileExtensionNotIn) > 0 { + predicates = append(predicates, filehistory.FileExtensionNotIn(i.FileExtensionNotIn...)) + } + if i.FileExtensionGT != nil { + predicates = append(predicates, filehistory.FileExtensionGT(*i.FileExtensionGT)) + } + if i.FileExtensionGTE != nil { + predicates = append(predicates, filehistory.FileExtensionGTE(*i.FileExtensionGTE)) + } + if i.FileExtensionLT != nil { + predicates = append(predicates, filehistory.FileExtensionLT(*i.FileExtensionLT)) + } + if i.FileExtensionLTE != nil { + predicates = append(predicates, filehistory.FileExtensionLTE(*i.FileExtensionLTE)) + } + if i.FileExtensionContains != nil { + predicates = append(predicates, filehistory.FileExtensionContains(*i.FileExtensionContains)) + } + if i.FileExtensionHasPrefix != nil { + predicates = append(predicates, filehistory.FileExtensionHasPrefix(*i.FileExtensionHasPrefix)) + } + if i.FileExtensionHasSuffix != nil { + predicates = append(predicates, filehistory.FileExtensionHasSuffix(*i.FileExtensionHasSuffix)) + } + if i.FileExtensionEqualFold != nil { + predicates = append(predicates, filehistory.FileExtensionEqualFold(*i.FileExtensionEqualFold)) + } + if i.FileExtensionContainsFold != nil { + predicates = append(predicates, filehistory.FileExtensionContainsFold(*i.FileExtensionContainsFold)) + } + if i.FileSize != nil { + predicates = append(predicates, filehistory.FileSizeEQ(*i.FileSize)) + } + if i.FileSizeNEQ != nil { + predicates = append(predicates, filehistory.FileSizeNEQ(*i.FileSizeNEQ)) + } + if len(i.FileSizeIn) > 0 { + predicates = append(predicates, filehistory.FileSizeIn(i.FileSizeIn...)) + } + if len(i.FileSizeNotIn) > 0 { + predicates = append(predicates, filehistory.FileSizeNotIn(i.FileSizeNotIn...)) + } + if i.FileSizeGT != nil { + predicates = append(predicates, filehistory.FileSizeGT(*i.FileSizeGT)) + } + if i.FileSizeGTE != nil { + predicates = append(predicates, filehistory.FileSizeGTE(*i.FileSizeGTE)) + } + if i.FileSizeLT != nil { + predicates = append(predicates, filehistory.FileSizeLT(*i.FileSizeLT)) + } + if i.FileSizeLTE != nil { + predicates = append(predicates, filehistory.FileSizeLTE(*i.FileSizeLTE)) + } + if i.FileSizeIsNil { + predicates = append(predicates, filehistory.FileSizeIsNil()) + } + if i.FileSizeNotNil { + predicates = append(predicates, filehistory.FileSizeNotNil()) + } + if i.ContentType != nil { + predicates = append(predicates, filehistory.ContentTypeEQ(*i.ContentType)) + } + if i.ContentTypeNEQ != nil { + predicates = append(predicates, filehistory.ContentTypeNEQ(*i.ContentTypeNEQ)) + } + if len(i.ContentTypeIn) > 0 { + predicates = append(predicates, filehistory.ContentTypeIn(i.ContentTypeIn...)) + } + if len(i.ContentTypeNotIn) > 0 { + predicates = append(predicates, filehistory.ContentTypeNotIn(i.ContentTypeNotIn...)) + } + if i.ContentTypeGT != nil { + predicates = append(predicates, filehistory.ContentTypeGT(*i.ContentTypeGT)) + } + if i.ContentTypeGTE != nil { + predicates = append(predicates, filehistory.ContentTypeGTE(*i.ContentTypeGTE)) + } + if i.ContentTypeLT != nil { + predicates = append(predicates, filehistory.ContentTypeLT(*i.ContentTypeLT)) + } + if i.ContentTypeLTE != nil { + predicates = append(predicates, filehistory.ContentTypeLTE(*i.ContentTypeLTE)) + } + if i.ContentTypeContains != nil { + predicates = append(predicates, filehistory.ContentTypeContains(*i.ContentTypeContains)) + } + if i.ContentTypeHasPrefix != nil { + predicates = append(predicates, filehistory.ContentTypeHasPrefix(*i.ContentTypeHasPrefix)) + } + if i.ContentTypeHasSuffix != nil { + predicates = append(predicates, filehistory.ContentTypeHasSuffix(*i.ContentTypeHasSuffix)) + } + if i.ContentTypeEqualFold != nil { + predicates = append(predicates, filehistory.ContentTypeEqualFold(*i.ContentTypeEqualFold)) + } + if i.ContentTypeContainsFold != nil { + predicates = append(predicates, filehistory.ContentTypeContainsFold(*i.ContentTypeContainsFold)) + } + if i.StoreKey != nil { + predicates = append(predicates, filehistory.StoreKeyEQ(*i.StoreKey)) + } + if i.StoreKeyNEQ != nil { + predicates = append(predicates, filehistory.StoreKeyNEQ(*i.StoreKeyNEQ)) + } + if len(i.StoreKeyIn) > 0 { + predicates = append(predicates, filehistory.StoreKeyIn(i.StoreKeyIn...)) + } + if len(i.StoreKeyNotIn) > 0 { + predicates = append(predicates, filehistory.StoreKeyNotIn(i.StoreKeyNotIn...)) + } + if i.StoreKeyGT != nil { + predicates = append(predicates, filehistory.StoreKeyGT(*i.StoreKeyGT)) + } + if i.StoreKeyGTE != nil { + predicates = append(predicates, filehistory.StoreKeyGTE(*i.StoreKeyGTE)) + } + if i.StoreKeyLT != nil { + predicates = append(predicates, filehistory.StoreKeyLT(*i.StoreKeyLT)) + } + if i.StoreKeyLTE != nil { + predicates = append(predicates, filehistory.StoreKeyLTE(*i.StoreKeyLTE)) + } + if i.StoreKeyContains != nil { + predicates = append(predicates, filehistory.StoreKeyContains(*i.StoreKeyContains)) + } + if i.StoreKeyHasPrefix != nil { + predicates = append(predicates, filehistory.StoreKeyHasPrefix(*i.StoreKeyHasPrefix)) + } + if i.StoreKeyHasSuffix != nil { + predicates = append(predicates, filehistory.StoreKeyHasSuffix(*i.StoreKeyHasSuffix)) + } + if i.StoreKeyEqualFold != nil { + predicates = append(predicates, filehistory.StoreKeyEqualFold(*i.StoreKeyEqualFold)) + } + if i.StoreKeyContainsFold != nil { + predicates = append(predicates, filehistory.StoreKeyContainsFold(*i.StoreKeyContainsFold)) + } + if i.Category != nil { + predicates = append(predicates, filehistory.CategoryEQ(*i.Category)) + } + if i.CategoryNEQ != nil { + predicates = append(predicates, filehistory.CategoryNEQ(*i.CategoryNEQ)) + } + if len(i.CategoryIn) > 0 { + predicates = append(predicates, filehistory.CategoryIn(i.CategoryIn...)) + } + if len(i.CategoryNotIn) > 0 { + predicates = append(predicates, filehistory.CategoryNotIn(i.CategoryNotIn...)) + } + if i.CategoryGT != nil { + predicates = append(predicates, filehistory.CategoryGT(*i.CategoryGT)) + } + if i.CategoryGTE != nil { + predicates = append(predicates, filehistory.CategoryGTE(*i.CategoryGTE)) + } + if i.CategoryLT != nil { + predicates = append(predicates, filehistory.CategoryLT(*i.CategoryLT)) + } + if i.CategoryLTE != nil { + predicates = append(predicates, filehistory.CategoryLTE(*i.CategoryLTE)) + } + if i.CategoryContains != nil { + predicates = append(predicates, filehistory.CategoryContains(*i.CategoryContains)) + } + if i.CategoryHasPrefix != nil { + predicates = append(predicates, filehistory.CategoryHasPrefix(*i.CategoryHasPrefix)) + } + if i.CategoryHasSuffix != nil { + predicates = append(predicates, filehistory.CategoryHasSuffix(*i.CategoryHasSuffix)) + } + if i.CategoryIsNil { + predicates = append(predicates, filehistory.CategoryIsNil()) + } + if i.CategoryNotNil { + predicates = append(predicates, filehistory.CategoryNotNil()) + } + if i.CategoryEqualFold != nil { + predicates = append(predicates, filehistory.CategoryEqualFold(*i.CategoryEqualFold)) + } + if i.CategoryContainsFold != nil { + predicates = append(predicates, filehistory.CategoryContainsFold(*i.CategoryContainsFold)) + } + if i.Annotation != nil { + predicates = append(predicates, filehistory.AnnotationEQ(*i.Annotation)) + } + if i.AnnotationNEQ != nil { + predicates = append(predicates, filehistory.AnnotationNEQ(*i.AnnotationNEQ)) + } + if len(i.AnnotationIn) > 0 { + predicates = append(predicates, filehistory.AnnotationIn(i.AnnotationIn...)) + } + if len(i.AnnotationNotIn) > 0 { + predicates = append(predicates, filehistory.AnnotationNotIn(i.AnnotationNotIn...)) + } + if i.AnnotationGT != nil { + predicates = append(predicates, filehistory.AnnotationGT(*i.AnnotationGT)) + } + if i.AnnotationGTE != nil { + predicates = append(predicates, filehistory.AnnotationGTE(*i.AnnotationGTE)) + } + if i.AnnotationLT != nil { + predicates = append(predicates, filehistory.AnnotationLT(*i.AnnotationLT)) + } + if i.AnnotationLTE != nil { + predicates = append(predicates, filehistory.AnnotationLTE(*i.AnnotationLTE)) + } + if i.AnnotationContains != nil { + predicates = append(predicates, filehistory.AnnotationContains(*i.AnnotationContains)) + } + if i.AnnotationHasPrefix != nil { + predicates = append(predicates, filehistory.AnnotationHasPrefix(*i.AnnotationHasPrefix)) + } + if i.AnnotationHasSuffix != nil { + predicates = append(predicates, filehistory.AnnotationHasSuffix(*i.AnnotationHasSuffix)) + } + if i.AnnotationIsNil { + predicates = append(predicates, filehistory.AnnotationIsNil()) + } + if i.AnnotationNotNil { + predicates = append(predicates, filehistory.AnnotationNotNil()) + } + if i.AnnotationEqualFold != nil { + predicates = append(predicates, filehistory.AnnotationEqualFold(*i.AnnotationEqualFold)) + } + if i.AnnotationContainsFold != nil { + predicates = append(predicates, filehistory.AnnotationContainsFold(*i.AnnotationContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyFileHistoryWhereInput + case 1: + return predicates[0], nil + default: + return filehistory.And(predicates...), nil + } +} + +// GroupWhereInput represents a where input for filtering Group queries. +type GroupWhereInput struct { + Predicates []predicate.Group `json:"-"` + Not *GroupWhereInput `json:"not,omitempty"` + Or []*GroupWhereInput `json:"or,omitempty"` + And []*GroupWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "setting" edge predicates. + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*GroupSettingWhereInput `json:"hasSettingWith,omitempty"` + + // "users" edge predicates. + HasUsers *bool `json:"hasUsers,omitempty"` + HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + + // "integrations" edge predicates. + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + + // "files" edge predicates. + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + + // "members" edge predicates. + HasMembers *bool `json:"hasMembers,omitempty"` + HasMembersWith []*GroupMembershipWhereInput `json:"hasMembersWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *GroupWhereInput) AddPredicates(predicates ...predicate.Group) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the GroupWhereInput filter on the GroupQuery builder. +func (i *GroupWhereInput) Filter(q *GroupQuery) (*GroupQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyGroupWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyGroupWhereInput is returned in case the GroupWhereInput is empty. +var ErrEmptyGroupWhereInput = errors.New("generated: empty predicate GroupWhereInput") + +// P returns a predicate for filtering groups. +// An error is returned if the input is empty or invalid. +func (i *GroupWhereInput) P() (predicate.Group, error) { + var predicates []predicate.Group + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, group.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.Group, 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, group.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.Group, 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, group.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, group.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, group.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, group.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, group.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, group.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, group.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, group.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, group.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, group.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, group.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, group.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, group.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, group.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, group.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, group.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, group.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, group.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, group.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, group.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, group.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, group.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, group.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, group.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, group.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, group.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, group.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, group.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, group.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, group.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, group.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, group.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, group.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, group.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, group.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, group.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, group.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, group.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, group.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, group.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, group.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, group.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, group.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, group.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, group.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, group.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, group.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, group.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, group.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, group.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, group.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, group.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, group.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, group.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, group.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, group.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, group.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, group.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, group.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, group.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, group.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, group.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, group.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, group.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, group.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, group.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, group.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, group.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, group.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, group.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, group.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, group.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, group.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, group.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, group.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, group.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, group.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, group.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, group.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, group.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, group.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, group.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, group.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, group.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, group.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, group.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, group.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, group.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, group.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, group.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, group.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, group.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, group.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, group.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, group.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, group.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, group.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, group.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, group.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, group.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, group.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, group.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, group.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, group.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, group.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, group.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, group.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, group.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, group.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, group.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, group.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, group.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, group.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, group.NameContainsFold(*i.NameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, group.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, group.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, group.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, group.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, group.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, group.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, group.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, group.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, group.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, group.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, group.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, group.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, group.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + + if i.HasOwner != nil { + p := group.HasOwner() + if !*i.HasOwner { + p = group.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, group.HasOwnerWith(with...)) + } + if i.HasSetting != nil { + p := group.HasSetting() + if !*i.HasSetting { + p = group.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasSettingWith) > 0 { + with := make([]predicate.GroupSetting, 0, len(i.HasSettingWith)) + for _, w := range i.HasSettingWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasSettingWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, group.HasSettingWith(with...)) + } + if i.HasUsers != nil { + p := group.HasUsers() + if !*i.HasUsers { + p = group.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasUsersWith) > 0 { + with := make([]predicate.User, 0, len(i.HasUsersWith)) + for _, w := range i.HasUsersWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasUsersWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, group.HasUsersWith(with...)) + } + if i.HasEvents != nil { + p := group.HasEvents() + if !*i.HasEvents { + p = group.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, group.HasEventsWith(with...)) + } + if i.HasIntegrations != nil { + p := group.HasIntegrations() + if !*i.HasIntegrations { + p = group.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasIntegrationsWith) > 0 { + with := make([]predicate.Integration, 0, len(i.HasIntegrationsWith)) + for _, w := range i.HasIntegrationsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasIntegrationsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, group.HasIntegrationsWith(with...)) + } + if i.HasFiles != nil { + p := group.HasFiles() + if !*i.HasFiles { + p = group.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFilesWith) > 0 { + with := make([]predicate.File, 0, len(i.HasFilesWith)) + for _, w := range i.HasFilesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFilesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, group.HasFilesWith(with...)) + } + if i.HasMembers != nil { + p := group.HasMembers() + if !*i.HasMembers { + p = group.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasMembersWith) > 0 { + with := make([]predicate.GroupMembership, 0, len(i.HasMembersWith)) + for _, w := range i.HasMembersWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasMembersWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, group.HasMembersWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyGroupWhereInput + case 1: + return predicates[0], nil + default: + return group.And(predicates...), nil + } +} + +// GroupHistoryWhereInput represents a where input for filtering GroupHistory queries. +type GroupHistoryWhereInput struct { + Predicates []predicate.GroupHistory `json:"-"` + Not *GroupHistoryWhereInput `json:"not,omitempty"` + Or []*GroupHistoryWhereInput `json:"or,omitempty"` + And []*GroupHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *GroupHistoryWhereInput) AddPredicates(predicates ...predicate.GroupHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the GroupHistoryWhereInput filter on the GroupHistoryQuery builder. +func (i *GroupHistoryWhereInput) Filter(q *GroupHistoryQuery) (*GroupHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyGroupHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyGroupHistoryWhereInput is returned in case the GroupHistoryWhereInput is empty. +var ErrEmptyGroupHistoryWhereInput = errors.New("generated: empty predicate GroupHistoryWhereInput") + +// P returns a predicate for filtering grouphistories. +// An error is returned if the input is empty or invalid. +func (i *GroupHistoryWhereInput) P() (predicate.GroupHistory, error) { + var predicates []predicate.GroupHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, grouphistory.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.GroupHistory, 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, grouphistory.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.GroupHistory, 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, grouphistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, grouphistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, grouphistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, grouphistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, grouphistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, grouphistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, grouphistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, grouphistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, grouphistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, grouphistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, grouphistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, grouphistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, grouphistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, grouphistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, grouphistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, grouphistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, grouphistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, grouphistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, grouphistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, grouphistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, grouphistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, grouphistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, grouphistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, grouphistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, grouphistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, grouphistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, grouphistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, grouphistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, grouphistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, grouphistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, grouphistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, grouphistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, grouphistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, grouphistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, grouphistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, grouphistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, grouphistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, grouphistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, grouphistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, grouphistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, grouphistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, grouphistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, grouphistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, grouphistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, grouphistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, grouphistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, grouphistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, grouphistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, grouphistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, grouphistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, grouphistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, grouphistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, grouphistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, grouphistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, grouphistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, grouphistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, grouphistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, grouphistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, grouphistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, grouphistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, grouphistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, grouphistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, grouphistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, grouphistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, grouphistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, grouphistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, grouphistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, grouphistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, grouphistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, grouphistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, grouphistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, grouphistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, grouphistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, grouphistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, grouphistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, grouphistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, grouphistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, grouphistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, grouphistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, grouphistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, grouphistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, grouphistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, grouphistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, grouphistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, grouphistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, grouphistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, grouphistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, grouphistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, grouphistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, grouphistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, grouphistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, grouphistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, grouphistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, grouphistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, grouphistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, grouphistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, grouphistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, grouphistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, grouphistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, grouphistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, grouphistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, grouphistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, grouphistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, grouphistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, grouphistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, grouphistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, grouphistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, grouphistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, grouphistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, grouphistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, grouphistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, grouphistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, grouphistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, grouphistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, grouphistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, grouphistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, grouphistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, grouphistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, grouphistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, grouphistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, grouphistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, grouphistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, grouphistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, grouphistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, grouphistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, grouphistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, grouphistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, grouphistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, grouphistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, grouphistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, grouphistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, grouphistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, grouphistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, grouphistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, grouphistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, grouphistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, grouphistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, grouphistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, grouphistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, grouphistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, grouphistory.NameContainsFold(*i.NameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, grouphistory.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, grouphistory.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, grouphistory.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, grouphistory.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, grouphistory.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, grouphistory.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, grouphistory.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, grouphistory.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, grouphistory.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, grouphistory.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, grouphistory.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, grouphistory.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, grouphistory.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyGroupHistoryWhereInput + case 1: + return predicates[0], nil + default: + return grouphistory.And(predicates...), nil + } +} + +// GroupMembershipWhereInput represents a where input for filtering GroupMembership queries. +type GroupMembershipWhereInput struct { + Predicates []predicate.GroupMembership `json:"-"` + Not *GroupMembershipWhereInput `json:"not,omitempty"` + Or []*GroupMembershipWhereInput `json:"or,omitempty"` + And []*GroupMembershipWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "role" field predicates. + Role *enums.Role `json:"role,omitempty"` + RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + + // "group_id" field predicates. + GroupID *string `json:"groupID,omitempty"` + GroupIDNEQ *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGT *string `json:"groupIDGT,omitempty"` + GroupIDGTE *string `json:"groupIDGTE,omitempty"` + GroupIDLT *string `json:"groupIDLT,omitempty"` + GroupIDLTE *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` + + // "user_id" field predicates. + UserID *string `json:"userID,omitempty"` + UserIDNEQ *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGT *string `json:"userIDGT,omitempty"` + UserIDGTE *string `json:"userIDGTE,omitempty"` + UserIDLT *string `json:"userIDLT,omitempty"` + UserIDLTE *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + + // "group" edge predicates. + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` + + // "user" edge predicates. + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *GroupMembershipWhereInput) AddPredicates(predicates ...predicate.GroupMembership) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the GroupMembershipWhereInput filter on the GroupMembershipQuery builder. +func (i *GroupMembershipWhereInput) Filter(q *GroupMembershipQuery) (*GroupMembershipQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyGroupMembershipWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyGroupMembershipWhereInput is returned in case the GroupMembershipWhereInput is empty. +var ErrEmptyGroupMembershipWhereInput = errors.New("generated: empty predicate GroupMembershipWhereInput") + +// P returns a predicate for filtering groupmemberships. +// An error is returned if the input is empty or invalid. +func (i *GroupMembershipWhereInput) P() (predicate.GroupMembership, error) { + var predicates []predicate.GroupMembership + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, groupmembership.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.GroupMembership, 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, groupmembership.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.GroupMembership, 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, groupmembership.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, groupmembership.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, groupmembership.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, groupmembership.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, groupmembership.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, groupmembership.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, groupmembership.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, groupmembership.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, groupmembership.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, groupmembership.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, groupmembership.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, groupmembership.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, groupmembership.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, groupmembership.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, groupmembership.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, groupmembership.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, groupmembership.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, groupmembership.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, groupmembership.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, groupmembership.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, groupmembership.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, groupmembership.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, groupmembership.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, groupmembership.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, groupmembership.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, groupmembership.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, groupmembership.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, groupmembership.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, groupmembership.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, groupmembership.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, groupmembership.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, groupmembership.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, groupmembership.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, groupmembership.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, groupmembership.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, groupmembership.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, groupmembership.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, groupmembership.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, groupmembership.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, groupmembership.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, groupmembership.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, groupmembership.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, groupmembership.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, groupmembership.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, groupmembership.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, groupmembership.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, groupmembership.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, groupmembership.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, groupmembership.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, groupmembership.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, groupmembership.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, groupmembership.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, groupmembership.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, groupmembership.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, groupmembership.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, groupmembership.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, groupmembership.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, groupmembership.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, groupmembership.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, groupmembership.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, groupmembership.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, groupmembership.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, groupmembership.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, groupmembership.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, groupmembership.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, groupmembership.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, groupmembership.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, groupmembership.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, groupmembership.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, groupmembership.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, groupmembership.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, groupmembership.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, groupmembership.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, groupmembership.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, groupmembership.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, groupmembership.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, groupmembership.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, groupmembership.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, groupmembership.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, groupmembership.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, groupmembership.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, groupmembership.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, groupmembership.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, groupmembership.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, groupmembership.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, groupmembership.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Role != nil { + predicates = append(predicates, groupmembership.RoleEQ(*i.Role)) + } + if i.RoleNEQ != nil { + predicates = append(predicates, groupmembership.RoleNEQ(*i.RoleNEQ)) + } + if len(i.RoleIn) > 0 { + predicates = append(predicates, groupmembership.RoleIn(i.RoleIn...)) + } + if len(i.RoleNotIn) > 0 { + predicates = append(predicates, groupmembership.RoleNotIn(i.RoleNotIn...)) + } + if i.GroupID != nil { + predicates = append(predicates, groupmembership.GroupIDEQ(*i.GroupID)) + } + if i.GroupIDNEQ != nil { + predicates = append(predicates, groupmembership.GroupIDNEQ(*i.GroupIDNEQ)) + } + if len(i.GroupIDIn) > 0 { + predicates = append(predicates, groupmembership.GroupIDIn(i.GroupIDIn...)) + } + if len(i.GroupIDNotIn) > 0 { + predicates = append(predicates, groupmembership.GroupIDNotIn(i.GroupIDNotIn...)) + } + if i.GroupIDGT != nil { + predicates = append(predicates, groupmembership.GroupIDGT(*i.GroupIDGT)) + } + if i.GroupIDGTE != nil { + predicates = append(predicates, groupmembership.GroupIDGTE(*i.GroupIDGTE)) + } + if i.GroupIDLT != nil { + predicates = append(predicates, groupmembership.GroupIDLT(*i.GroupIDLT)) + } + if i.GroupIDLTE != nil { + predicates = append(predicates, groupmembership.GroupIDLTE(*i.GroupIDLTE)) + } + if i.GroupIDContains != nil { + predicates = append(predicates, groupmembership.GroupIDContains(*i.GroupIDContains)) + } + if i.GroupIDHasPrefix != nil { + predicates = append(predicates, groupmembership.GroupIDHasPrefix(*i.GroupIDHasPrefix)) + } + if i.GroupIDHasSuffix != nil { + predicates = append(predicates, groupmembership.GroupIDHasSuffix(*i.GroupIDHasSuffix)) + } + if i.GroupIDEqualFold != nil { + predicates = append(predicates, groupmembership.GroupIDEqualFold(*i.GroupIDEqualFold)) + } + if i.GroupIDContainsFold != nil { + predicates = append(predicates, groupmembership.GroupIDContainsFold(*i.GroupIDContainsFold)) + } + if i.UserID != nil { + predicates = append(predicates, groupmembership.UserIDEQ(*i.UserID)) + } + if i.UserIDNEQ != nil { + predicates = append(predicates, groupmembership.UserIDNEQ(*i.UserIDNEQ)) + } + if len(i.UserIDIn) > 0 { + predicates = append(predicates, groupmembership.UserIDIn(i.UserIDIn...)) + } + if len(i.UserIDNotIn) > 0 { + predicates = append(predicates, groupmembership.UserIDNotIn(i.UserIDNotIn...)) + } + if i.UserIDGT != nil { + predicates = append(predicates, groupmembership.UserIDGT(*i.UserIDGT)) + } + if i.UserIDGTE != nil { + predicates = append(predicates, groupmembership.UserIDGTE(*i.UserIDGTE)) + } + if i.UserIDLT != nil { + predicates = append(predicates, groupmembership.UserIDLT(*i.UserIDLT)) + } + if i.UserIDLTE != nil { + predicates = append(predicates, groupmembership.UserIDLTE(*i.UserIDLTE)) + } + if i.UserIDContains != nil { + predicates = append(predicates, groupmembership.UserIDContains(*i.UserIDContains)) + } + if i.UserIDHasPrefix != nil { + predicates = append(predicates, groupmembership.UserIDHasPrefix(*i.UserIDHasPrefix)) + } + if i.UserIDHasSuffix != nil { + predicates = append(predicates, groupmembership.UserIDHasSuffix(*i.UserIDHasSuffix)) + } + if i.UserIDEqualFold != nil { + predicates = append(predicates, groupmembership.UserIDEqualFold(*i.UserIDEqualFold)) + } + if i.UserIDContainsFold != nil { + predicates = append(predicates, groupmembership.UserIDContainsFold(*i.UserIDContainsFold)) + } + + if i.HasGroup != nil { + p := groupmembership.HasGroup() + if !*i.HasGroup { + p = groupmembership.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupWith) > 0 { + with := make([]predicate.Group, 0, len(i.HasGroupWith)) + for _, w := range i.HasGroupWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, groupmembership.HasGroupWith(with...)) + } + if i.HasUser != nil { + p := groupmembership.HasUser() + if !*i.HasUser { + p = groupmembership.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasUserWith) > 0 { + with := make([]predicate.User, 0, len(i.HasUserWith)) + for _, w := range i.HasUserWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasUserWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, groupmembership.HasUserWith(with...)) + } + if i.HasEvents != nil { + p := groupmembership.HasEvents() + if !*i.HasEvents { + p = groupmembership.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, groupmembership.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyGroupMembershipWhereInput + case 1: + return predicates[0], nil + default: + return groupmembership.And(predicates...), nil + } +} + +// GroupMembershipHistoryWhereInput represents a where input for filtering GroupMembershipHistory queries. +type GroupMembershipHistoryWhereInput struct { + Predicates []predicate.GroupMembershipHistory `json:"-"` + Not *GroupMembershipHistoryWhereInput `json:"not,omitempty"` + Or []*GroupMembershipHistoryWhereInput `json:"or,omitempty"` + And []*GroupMembershipHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "role" field predicates. + Role *enums.Role `json:"role,omitempty"` + RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + + // "group_id" field predicates. + GroupID *string `json:"groupID,omitempty"` + GroupIDNEQ *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGT *string `json:"groupIDGT,omitempty"` + GroupIDGTE *string `json:"groupIDGTE,omitempty"` + GroupIDLT *string `json:"groupIDLT,omitempty"` + GroupIDLTE *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` + + // "user_id" field predicates. + UserID *string `json:"userID,omitempty"` + UserIDNEQ *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGT *string `json:"userIDGT,omitempty"` + UserIDGTE *string `json:"userIDGTE,omitempty"` + UserIDLT *string `json:"userIDLT,omitempty"` + UserIDLTE *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *GroupMembershipHistoryWhereInput) AddPredicates(predicates ...predicate.GroupMembershipHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the GroupMembershipHistoryWhereInput filter on the GroupMembershipHistoryQuery builder. +func (i *GroupMembershipHistoryWhereInput) Filter(q *GroupMembershipHistoryQuery) (*GroupMembershipHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyGroupMembershipHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyGroupMembershipHistoryWhereInput is returned in case the GroupMembershipHistoryWhereInput is empty. +var ErrEmptyGroupMembershipHistoryWhereInput = errors.New("generated: empty predicate GroupMembershipHistoryWhereInput") + +// P returns a predicate for filtering groupmembershiphistories. +// An error is returned if the input is empty or invalid. +func (i *GroupMembershipHistoryWhereInput) P() (predicate.GroupMembershipHistory, error) { + var predicates []predicate.GroupMembershipHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, groupmembershiphistory.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.GroupMembershipHistory, 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, groupmembershiphistory.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.GroupMembershipHistory, 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, groupmembershiphistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, groupmembershiphistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, groupmembershiphistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, groupmembershiphistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, groupmembershiphistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, groupmembershiphistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, groupmembershiphistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, groupmembershiphistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, groupmembershiphistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, groupmembershiphistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, groupmembershiphistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, groupmembershiphistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, groupmembershiphistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, groupmembershiphistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, groupmembershiphistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, groupmembershiphistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, groupmembershiphistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, groupmembershiphistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, groupmembershiphistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, groupmembershiphistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, groupmembershiphistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, groupmembershiphistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, groupmembershiphistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, groupmembershiphistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, groupmembershiphistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, groupmembershiphistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, groupmembershiphistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, groupmembershiphistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, groupmembershiphistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, groupmembershiphistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, groupmembershiphistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, groupmembershiphistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, groupmembershiphistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, groupmembershiphistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, groupmembershiphistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, groupmembershiphistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, groupmembershiphistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, groupmembershiphistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, groupmembershiphistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, groupmembershiphistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, groupmembershiphistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, groupmembershiphistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, groupmembershiphistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, groupmembershiphistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, groupmembershiphistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, groupmembershiphistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, groupmembershiphistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, groupmembershiphistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, groupmembershiphistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, groupmembershiphistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, groupmembershiphistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, groupmembershiphistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, groupmembershiphistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, groupmembershiphistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, groupmembershiphistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, groupmembershiphistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, groupmembershiphistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, groupmembershiphistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, groupmembershiphistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, groupmembershiphistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, groupmembershiphistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, groupmembershiphistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, groupmembershiphistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, groupmembershiphistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, groupmembershiphistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, groupmembershiphistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Role != nil { + predicates = append(predicates, groupmembershiphistory.RoleEQ(*i.Role)) + } + if i.RoleNEQ != nil { + predicates = append(predicates, groupmembershiphistory.RoleNEQ(*i.RoleNEQ)) + } + if len(i.RoleIn) > 0 { + predicates = append(predicates, groupmembershiphistory.RoleIn(i.RoleIn...)) + } + if len(i.RoleNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.RoleNotIn(i.RoleNotIn...)) + } + if i.GroupID != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDEQ(*i.GroupID)) + } + if i.GroupIDNEQ != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDNEQ(*i.GroupIDNEQ)) + } + if len(i.GroupIDIn) > 0 { + predicates = append(predicates, groupmembershiphistory.GroupIDIn(i.GroupIDIn...)) + } + if len(i.GroupIDNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.GroupIDNotIn(i.GroupIDNotIn...)) + } + if i.GroupIDGT != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDGT(*i.GroupIDGT)) + } + if i.GroupIDGTE != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDGTE(*i.GroupIDGTE)) + } + if i.GroupIDLT != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDLT(*i.GroupIDLT)) + } + if i.GroupIDLTE != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDLTE(*i.GroupIDLTE)) + } + if i.GroupIDContains != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDContains(*i.GroupIDContains)) + } + if i.GroupIDHasPrefix != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDHasPrefix(*i.GroupIDHasPrefix)) + } + if i.GroupIDHasSuffix != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDHasSuffix(*i.GroupIDHasSuffix)) + } + if i.GroupIDEqualFold != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDEqualFold(*i.GroupIDEqualFold)) + } + if i.GroupIDContainsFold != nil { + predicates = append(predicates, groupmembershiphistory.GroupIDContainsFold(*i.GroupIDContainsFold)) + } + if i.UserID != nil { + predicates = append(predicates, groupmembershiphistory.UserIDEQ(*i.UserID)) + } + if i.UserIDNEQ != nil { + predicates = append(predicates, groupmembershiphistory.UserIDNEQ(*i.UserIDNEQ)) + } + if len(i.UserIDIn) > 0 { + predicates = append(predicates, groupmembershiphistory.UserIDIn(i.UserIDIn...)) + } + if len(i.UserIDNotIn) > 0 { + predicates = append(predicates, groupmembershiphistory.UserIDNotIn(i.UserIDNotIn...)) + } + if i.UserIDGT != nil { + predicates = append(predicates, groupmembershiphistory.UserIDGT(*i.UserIDGT)) + } + if i.UserIDGTE != nil { + predicates = append(predicates, groupmembershiphistory.UserIDGTE(*i.UserIDGTE)) + } + if i.UserIDLT != nil { + predicates = append(predicates, groupmembershiphistory.UserIDLT(*i.UserIDLT)) + } + if i.UserIDLTE != nil { + predicates = append(predicates, groupmembershiphistory.UserIDLTE(*i.UserIDLTE)) + } + if i.UserIDContains != nil { + predicates = append(predicates, groupmembershiphistory.UserIDContains(*i.UserIDContains)) + } + if i.UserIDHasPrefix != nil { + predicates = append(predicates, groupmembershiphistory.UserIDHasPrefix(*i.UserIDHasPrefix)) + } + if i.UserIDHasSuffix != nil { + predicates = append(predicates, groupmembershiphistory.UserIDHasSuffix(*i.UserIDHasSuffix)) + } + if i.UserIDEqualFold != nil { + predicates = append(predicates, groupmembershiphistory.UserIDEqualFold(*i.UserIDEqualFold)) + } + if i.UserIDContainsFold != nil { + predicates = append(predicates, groupmembershiphistory.UserIDContainsFold(*i.UserIDContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyGroupMembershipHistoryWhereInput + case 1: + return predicates[0], nil + default: + return groupmembershiphistory.And(predicates...), nil + } +} + +// GroupSettingWhereInput represents a where input for filtering GroupSetting queries. +type GroupSettingWhereInput struct { + Predicates []predicate.GroupSetting `json:"-"` + Not *GroupSettingWhereInput `json:"not,omitempty"` + Or []*GroupSettingWhereInput `json:"or,omitempty"` + And []*GroupSettingWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "visibility" field predicates. + Visibility *enums.Visibility `json:"visibility,omitempty"` + VisibilityNEQ *enums.Visibility `json:"visibilityNEQ,omitempty"` + VisibilityIn []enums.Visibility `json:"visibilityIn,omitempty"` + VisibilityNotIn []enums.Visibility `json:"visibilityNotIn,omitempty"` + + // "join_policy" field predicates. + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + JoinPolicyNEQ *enums.JoinPolicy `json:"joinPolicyNEQ,omitempty"` + JoinPolicyIn []enums.JoinPolicy `json:"joinPolicyIn,omitempty"` + JoinPolicyNotIn []enums.JoinPolicy `json:"joinPolicyNotIn,omitempty"` + + // "sync_to_slack" field predicates. + SyncToSlack *bool `json:"syncToSlack,omitempty"` + SyncToSlackNEQ *bool `json:"syncToSlackNEQ,omitempty"` + SyncToSlackIsNil bool `json:"syncToSlackIsNil,omitempty"` + SyncToSlackNotNil bool `json:"syncToSlackNotNil,omitempty"` + + // "sync_to_github" field predicates. + SyncToGithub *bool `json:"syncToGithub,omitempty"` + SyncToGithubNEQ *bool `json:"syncToGithubNEQ,omitempty"` + SyncToGithubIsNil bool `json:"syncToGithubIsNil,omitempty"` + SyncToGithubNotNil bool `json:"syncToGithubNotNil,omitempty"` + + // "group_id" field predicates. + GroupID *string `json:"groupID,omitempty"` + GroupIDNEQ *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGT *string `json:"groupIDGT,omitempty"` + GroupIDGTE *string `json:"groupIDGTE,omitempty"` + GroupIDLT *string `json:"groupIDLT,omitempty"` + GroupIDLTE *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDIsNil bool `json:"groupIDIsNil,omitempty"` + GroupIDNotNil bool `json:"groupIDNotNil,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` + + // "group" edge predicates. + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *GroupSettingWhereInput) AddPredicates(predicates ...predicate.GroupSetting) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the GroupSettingWhereInput filter on the GroupSettingQuery builder. +func (i *GroupSettingWhereInput) Filter(q *GroupSettingQuery) (*GroupSettingQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyGroupSettingWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyGroupSettingWhereInput is returned in case the GroupSettingWhereInput is empty. +var ErrEmptyGroupSettingWhereInput = errors.New("generated: empty predicate GroupSettingWhereInput") + +// P returns a predicate for filtering groupsettings. +// An error is returned if the input is empty or invalid. +func (i *GroupSettingWhereInput) P() (predicate.GroupSetting, error) { + var predicates []predicate.GroupSetting + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, groupsetting.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.GroupSetting, 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, groupsetting.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.GroupSetting, 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, groupsetting.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, groupsetting.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, groupsetting.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, groupsetting.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, groupsetting.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, groupsetting.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, groupsetting.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, groupsetting.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, groupsetting.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, groupsetting.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, groupsetting.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, groupsetting.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, groupsetting.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, groupsetting.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, groupsetting.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, groupsetting.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, groupsetting.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, groupsetting.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, groupsetting.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, groupsetting.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, groupsetting.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, groupsetting.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, groupsetting.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, groupsetting.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, groupsetting.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, groupsetting.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, groupsetting.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, groupsetting.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, groupsetting.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, groupsetting.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, groupsetting.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, groupsetting.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, groupsetting.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, groupsetting.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, groupsetting.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, groupsetting.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, groupsetting.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, groupsetting.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, groupsetting.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, groupsetting.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, groupsetting.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, groupsetting.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, groupsetting.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, groupsetting.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, groupsetting.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, groupsetting.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, groupsetting.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, groupsetting.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, groupsetting.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, groupsetting.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, groupsetting.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, groupsetting.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, groupsetting.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, groupsetting.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, groupsetting.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, groupsetting.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, groupsetting.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, groupsetting.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, groupsetting.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, groupsetting.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, groupsetting.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, groupsetting.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, groupsetting.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, groupsetting.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, groupsetting.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, groupsetting.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, groupsetting.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, groupsetting.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, groupsetting.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, groupsetting.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, groupsetting.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, groupsetting.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, groupsetting.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, groupsetting.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, groupsetting.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, groupsetting.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, groupsetting.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, groupsetting.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, groupsetting.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, groupsetting.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, groupsetting.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, groupsetting.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, groupsetting.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, groupsetting.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, groupsetting.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, groupsetting.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Visibility != nil { + predicates = append(predicates, groupsetting.VisibilityEQ(*i.Visibility)) + } + if i.VisibilityNEQ != nil { + predicates = append(predicates, groupsetting.VisibilityNEQ(*i.VisibilityNEQ)) + } + if len(i.VisibilityIn) > 0 { + predicates = append(predicates, groupsetting.VisibilityIn(i.VisibilityIn...)) + } + if len(i.VisibilityNotIn) > 0 { + predicates = append(predicates, groupsetting.VisibilityNotIn(i.VisibilityNotIn...)) + } + if i.JoinPolicy != nil { + predicates = append(predicates, groupsetting.JoinPolicyEQ(*i.JoinPolicy)) + } + if i.JoinPolicyNEQ != nil { + predicates = append(predicates, groupsetting.JoinPolicyNEQ(*i.JoinPolicyNEQ)) + } + if len(i.JoinPolicyIn) > 0 { + predicates = append(predicates, groupsetting.JoinPolicyIn(i.JoinPolicyIn...)) + } + if len(i.JoinPolicyNotIn) > 0 { + predicates = append(predicates, groupsetting.JoinPolicyNotIn(i.JoinPolicyNotIn...)) + } + if i.SyncToSlack != nil { + predicates = append(predicates, groupsetting.SyncToSlackEQ(*i.SyncToSlack)) + } + if i.SyncToSlackNEQ != nil { + predicates = append(predicates, groupsetting.SyncToSlackNEQ(*i.SyncToSlackNEQ)) + } + if i.SyncToSlackIsNil { + predicates = append(predicates, groupsetting.SyncToSlackIsNil()) + } + if i.SyncToSlackNotNil { + predicates = append(predicates, groupsetting.SyncToSlackNotNil()) + } + if i.SyncToGithub != nil { + predicates = append(predicates, groupsetting.SyncToGithubEQ(*i.SyncToGithub)) + } + if i.SyncToGithubNEQ != nil { + predicates = append(predicates, groupsetting.SyncToGithubNEQ(*i.SyncToGithubNEQ)) + } + if i.SyncToGithubIsNil { + predicates = append(predicates, groupsetting.SyncToGithubIsNil()) + } + if i.SyncToGithubNotNil { + predicates = append(predicates, groupsetting.SyncToGithubNotNil()) + } + if i.GroupID != nil { + predicates = append(predicates, groupsetting.GroupIDEQ(*i.GroupID)) + } + if i.GroupIDNEQ != nil { + predicates = append(predicates, groupsetting.GroupIDNEQ(*i.GroupIDNEQ)) + } + if len(i.GroupIDIn) > 0 { + predicates = append(predicates, groupsetting.GroupIDIn(i.GroupIDIn...)) + } + if len(i.GroupIDNotIn) > 0 { + predicates = append(predicates, groupsetting.GroupIDNotIn(i.GroupIDNotIn...)) + } + if i.GroupIDGT != nil { + predicates = append(predicates, groupsetting.GroupIDGT(*i.GroupIDGT)) + } + if i.GroupIDGTE != nil { + predicates = append(predicates, groupsetting.GroupIDGTE(*i.GroupIDGTE)) + } + if i.GroupIDLT != nil { + predicates = append(predicates, groupsetting.GroupIDLT(*i.GroupIDLT)) + } + if i.GroupIDLTE != nil { + predicates = append(predicates, groupsetting.GroupIDLTE(*i.GroupIDLTE)) + } + if i.GroupIDContains != nil { + predicates = append(predicates, groupsetting.GroupIDContains(*i.GroupIDContains)) + } + if i.GroupIDHasPrefix != nil { + predicates = append(predicates, groupsetting.GroupIDHasPrefix(*i.GroupIDHasPrefix)) + } + if i.GroupIDHasSuffix != nil { + predicates = append(predicates, groupsetting.GroupIDHasSuffix(*i.GroupIDHasSuffix)) + } + if i.GroupIDIsNil { + predicates = append(predicates, groupsetting.GroupIDIsNil()) + } + if i.GroupIDNotNil { + predicates = append(predicates, groupsetting.GroupIDNotNil()) + } + if i.GroupIDEqualFold != nil { + predicates = append(predicates, groupsetting.GroupIDEqualFold(*i.GroupIDEqualFold)) + } + if i.GroupIDContainsFold != nil { + predicates = append(predicates, groupsetting.GroupIDContainsFold(*i.GroupIDContainsFold)) + } + + if i.HasGroup != nil { + p := groupsetting.HasGroup() + if !*i.HasGroup { + p = groupsetting.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupWith) > 0 { + with := make([]predicate.Group, 0, len(i.HasGroupWith)) + for _, w := range i.HasGroupWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, groupsetting.HasGroupWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyGroupSettingWhereInput + case 1: + return predicates[0], nil + default: + return groupsetting.And(predicates...), nil + } +} + +// GroupSettingHistoryWhereInput represents a where input for filtering GroupSettingHistory queries. +type GroupSettingHistoryWhereInput struct { + Predicates []predicate.GroupSettingHistory `json:"-"` + Not *GroupSettingHistoryWhereInput `json:"not,omitempty"` + Or []*GroupSettingHistoryWhereInput `json:"or,omitempty"` + And []*GroupSettingHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "visibility" field predicates. + Visibility *enums.Visibility `json:"visibility,omitempty"` + VisibilityNEQ *enums.Visibility `json:"visibilityNEQ,omitempty"` + VisibilityIn []enums.Visibility `json:"visibilityIn,omitempty"` + VisibilityNotIn []enums.Visibility `json:"visibilityNotIn,omitempty"` + + // "join_policy" field predicates. + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + JoinPolicyNEQ *enums.JoinPolicy `json:"joinPolicyNEQ,omitempty"` + JoinPolicyIn []enums.JoinPolicy `json:"joinPolicyIn,omitempty"` + JoinPolicyNotIn []enums.JoinPolicy `json:"joinPolicyNotIn,omitempty"` + + // "sync_to_slack" field predicates. + SyncToSlack *bool `json:"syncToSlack,omitempty"` + SyncToSlackNEQ *bool `json:"syncToSlackNEQ,omitempty"` + SyncToSlackIsNil bool `json:"syncToSlackIsNil,omitempty"` + SyncToSlackNotNil bool `json:"syncToSlackNotNil,omitempty"` + + // "sync_to_github" field predicates. + SyncToGithub *bool `json:"syncToGithub,omitempty"` + SyncToGithubNEQ *bool `json:"syncToGithubNEQ,omitempty"` + SyncToGithubIsNil bool `json:"syncToGithubIsNil,omitempty"` + SyncToGithubNotNil bool `json:"syncToGithubNotNil,omitempty"` + + // "group_id" field predicates. + GroupID *string `json:"groupID,omitempty"` + GroupIDNEQ *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGT *string `json:"groupIDGT,omitempty"` + GroupIDGTE *string `json:"groupIDGTE,omitempty"` + GroupIDLT *string `json:"groupIDLT,omitempty"` + GroupIDLTE *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDIsNil bool `json:"groupIDIsNil,omitempty"` + GroupIDNotNil bool `json:"groupIDNotNil,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *GroupSettingHistoryWhereInput) AddPredicates(predicates ...predicate.GroupSettingHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the GroupSettingHistoryWhereInput filter on the GroupSettingHistoryQuery builder. +func (i *GroupSettingHistoryWhereInput) Filter(q *GroupSettingHistoryQuery) (*GroupSettingHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyGroupSettingHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyGroupSettingHistoryWhereInput is returned in case the GroupSettingHistoryWhereInput is empty. +var ErrEmptyGroupSettingHistoryWhereInput = errors.New("generated: empty predicate GroupSettingHistoryWhereInput") + +// P returns a predicate for filtering groupsettinghistories. +// An error is returned if the input is empty or invalid. +func (i *GroupSettingHistoryWhereInput) P() (predicate.GroupSettingHistory, error) { + var predicates []predicate.GroupSettingHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, groupsettinghistory.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.GroupSettingHistory, 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, groupsettinghistory.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.GroupSettingHistory, 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, groupsettinghistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, groupsettinghistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, groupsettinghistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, groupsettinghistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, groupsettinghistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, groupsettinghistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, groupsettinghistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, groupsettinghistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, groupsettinghistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, groupsettinghistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, groupsettinghistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, groupsettinghistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, groupsettinghistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, groupsettinghistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, groupsettinghistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, groupsettinghistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, groupsettinghistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, groupsettinghistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, groupsettinghistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, groupsettinghistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, groupsettinghistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, groupsettinghistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, groupsettinghistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, groupsettinghistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, groupsettinghistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, groupsettinghistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, groupsettinghistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, groupsettinghistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, groupsettinghistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, groupsettinghistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, groupsettinghistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, groupsettinghistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, groupsettinghistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, groupsettinghistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, groupsettinghistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, groupsettinghistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, groupsettinghistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, groupsettinghistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, groupsettinghistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, groupsettinghistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, groupsettinghistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, groupsettinghistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, groupsettinghistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, groupsettinghistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, groupsettinghistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, groupsettinghistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, groupsettinghistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, groupsettinghistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, groupsettinghistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, groupsettinghistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, groupsettinghistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, groupsettinghistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, groupsettinghistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, groupsettinghistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, groupsettinghistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, groupsettinghistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, groupsettinghistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, groupsettinghistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, groupsettinghistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, groupsettinghistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, groupsettinghistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, groupsettinghistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, groupsettinghistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, groupsettinghistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, groupsettinghistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, groupsettinghistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, groupsettinghistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, groupsettinghistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, groupsettinghistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, groupsettinghistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, groupsettinghistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, groupsettinghistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, groupsettinghistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, groupsettinghistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, groupsettinghistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, groupsettinghistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, groupsettinghistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, groupsettinghistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, groupsettinghistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, groupsettinghistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, groupsettinghistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, groupsettinghistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, groupsettinghistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, groupsettinghistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, groupsettinghistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, groupsettinghistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, groupsettinghistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, groupsettinghistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, groupsettinghistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, groupsettinghistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, groupsettinghistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, groupsettinghistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, groupsettinghistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Visibility != nil { + predicates = append(predicates, groupsettinghistory.VisibilityEQ(*i.Visibility)) + } + if i.VisibilityNEQ != nil { + predicates = append(predicates, groupsettinghistory.VisibilityNEQ(*i.VisibilityNEQ)) + } + if len(i.VisibilityIn) > 0 { + predicates = append(predicates, groupsettinghistory.VisibilityIn(i.VisibilityIn...)) + } + if len(i.VisibilityNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.VisibilityNotIn(i.VisibilityNotIn...)) + } + if i.JoinPolicy != nil { + predicates = append(predicates, groupsettinghistory.JoinPolicyEQ(*i.JoinPolicy)) + } + if i.JoinPolicyNEQ != nil { + predicates = append(predicates, groupsettinghistory.JoinPolicyNEQ(*i.JoinPolicyNEQ)) + } + if len(i.JoinPolicyIn) > 0 { + predicates = append(predicates, groupsettinghistory.JoinPolicyIn(i.JoinPolicyIn...)) + } + if len(i.JoinPolicyNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.JoinPolicyNotIn(i.JoinPolicyNotIn...)) + } + if i.SyncToSlack != nil { + predicates = append(predicates, groupsettinghistory.SyncToSlackEQ(*i.SyncToSlack)) + } + if i.SyncToSlackNEQ != nil { + predicates = append(predicates, groupsettinghistory.SyncToSlackNEQ(*i.SyncToSlackNEQ)) + } + if i.SyncToSlackIsNil { + predicates = append(predicates, groupsettinghistory.SyncToSlackIsNil()) + } + if i.SyncToSlackNotNil { + predicates = append(predicates, groupsettinghistory.SyncToSlackNotNil()) + } + if i.SyncToGithub != nil { + predicates = append(predicates, groupsettinghistory.SyncToGithubEQ(*i.SyncToGithub)) + } + if i.SyncToGithubNEQ != nil { + predicates = append(predicates, groupsettinghistory.SyncToGithubNEQ(*i.SyncToGithubNEQ)) + } + if i.SyncToGithubIsNil { + predicates = append(predicates, groupsettinghistory.SyncToGithubIsNil()) + } + if i.SyncToGithubNotNil { + predicates = append(predicates, groupsettinghistory.SyncToGithubNotNil()) + } + if i.GroupID != nil { + predicates = append(predicates, groupsettinghistory.GroupIDEQ(*i.GroupID)) + } + if i.GroupIDNEQ != nil { + predicates = append(predicates, groupsettinghistory.GroupIDNEQ(*i.GroupIDNEQ)) + } + if len(i.GroupIDIn) > 0 { + predicates = append(predicates, groupsettinghistory.GroupIDIn(i.GroupIDIn...)) + } + if len(i.GroupIDNotIn) > 0 { + predicates = append(predicates, groupsettinghistory.GroupIDNotIn(i.GroupIDNotIn...)) + } + if i.GroupIDGT != nil { + predicates = append(predicates, groupsettinghistory.GroupIDGT(*i.GroupIDGT)) + } + if i.GroupIDGTE != nil { + predicates = append(predicates, groupsettinghistory.GroupIDGTE(*i.GroupIDGTE)) + } + if i.GroupIDLT != nil { + predicates = append(predicates, groupsettinghistory.GroupIDLT(*i.GroupIDLT)) + } + if i.GroupIDLTE != nil { + predicates = append(predicates, groupsettinghistory.GroupIDLTE(*i.GroupIDLTE)) + } + if i.GroupIDContains != nil { + predicates = append(predicates, groupsettinghistory.GroupIDContains(*i.GroupIDContains)) + } + if i.GroupIDHasPrefix != nil { + predicates = append(predicates, groupsettinghistory.GroupIDHasPrefix(*i.GroupIDHasPrefix)) + } + if i.GroupIDHasSuffix != nil { + predicates = append(predicates, groupsettinghistory.GroupIDHasSuffix(*i.GroupIDHasSuffix)) + } + if i.GroupIDIsNil { + predicates = append(predicates, groupsettinghistory.GroupIDIsNil()) + } + if i.GroupIDNotNil { + predicates = append(predicates, groupsettinghistory.GroupIDNotNil()) + } + if i.GroupIDEqualFold != nil { + predicates = append(predicates, groupsettinghistory.GroupIDEqualFold(*i.GroupIDEqualFold)) + } + if i.GroupIDContainsFold != nil { + predicates = append(predicates, groupsettinghistory.GroupIDContainsFold(*i.GroupIDContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyGroupSettingHistoryWhereInput + case 1: + return predicates[0], nil + default: + return groupsettinghistory.And(predicates...), nil + } +} + +// HushWhereInput represents a where input for filtering Hush queries. +type HushWhereInput struct { + Predicates []predicate.Hush `json:"-"` + Not *HushWhereInput `json:"not,omitempty"` + Or []*HushWhereInput `json:"or,omitempty"` + And []*HushWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "kind" field predicates. + Kind *string `json:"kind,omitempty"` + KindNEQ *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGT *string `json:"kindGT,omitempty"` + KindGTE *string `json:"kindGTE,omitempty"` + KindLT *string `json:"kindLT,omitempty"` + KindLTE *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil bool `json:"kindIsNil,omitempty"` + KindNotNil bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + + // "secret_name" field predicates. + SecretName *string `json:"secretName,omitempty"` + SecretNameNEQ *string `json:"secretNameNEQ,omitempty"` + SecretNameIn []string `json:"secretNameIn,omitempty"` + SecretNameNotIn []string `json:"secretNameNotIn,omitempty"` + SecretNameGT *string `json:"secretNameGT,omitempty"` + SecretNameGTE *string `json:"secretNameGTE,omitempty"` + SecretNameLT *string `json:"secretNameLT,omitempty"` + SecretNameLTE *string `json:"secretNameLTE,omitempty"` + SecretNameContains *string `json:"secretNameContains,omitempty"` + SecretNameHasPrefix *string `json:"secretNameHasPrefix,omitempty"` + SecretNameHasSuffix *string `json:"secretNameHasSuffix,omitempty"` + SecretNameIsNil bool `json:"secretNameIsNil,omitempty"` + SecretNameNotNil bool `json:"secretNameNotNil,omitempty"` + SecretNameEqualFold *string `json:"secretNameEqualFold,omitempty"` + SecretNameContainsFold *string `json:"secretNameContainsFold,omitempty"` + + // "integrations" edge predicates. + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + + // "organization" edge predicates. + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *HushWhereInput) AddPredicates(predicates ...predicate.Hush) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the HushWhereInput filter on the HushQuery builder. +func (i *HushWhereInput) Filter(q *HushQuery) (*HushQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyHushWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyHushWhereInput is returned in case the HushWhereInput is empty. +var ErrEmptyHushWhereInput = errors.New("generated: empty predicate HushWhereInput") + +// P returns a predicate for filtering hushes. +// An error is returned if the input is empty or invalid. +func (i *HushWhereInput) P() (predicate.Hush, error) { + var predicates []predicate.Hush + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, hush.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.Hush, 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, hush.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.Hush, 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, hush.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, hush.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, hush.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, hush.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, hush.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, hush.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, hush.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, hush.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, hush.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, hush.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, hush.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, hush.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, hush.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, hush.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, hush.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, hush.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, hush.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, hush.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, hush.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, hush.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, hush.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, hush.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, hush.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, hush.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, hush.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, hush.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, hush.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, hush.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, hush.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, hush.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, hush.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, hush.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, hush.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, hush.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, hush.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, hush.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, hush.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, hush.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, hush.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, hush.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, hush.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, hush.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, hush.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, hush.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, hush.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, hush.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, hush.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, hush.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, hush.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, hush.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, hush.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, hush.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, hush.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, hush.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, hush.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, hush.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, hush.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, hush.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, hush.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, hush.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, hush.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, hush.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, hush.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, hush.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, hush.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, hush.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, hush.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, hush.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, hush.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, hush.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, hush.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, hush.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, hush.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, hush.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, hush.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, hush.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, hush.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, hush.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, hush.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, hush.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, hush.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, hush.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, hush.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, hush.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, hush.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, hush.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, hush.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, hush.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, hush.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, hush.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, hush.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, hush.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, hush.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, hush.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, hush.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, hush.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, hush.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, hush.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, hush.NameContainsFold(*i.NameContainsFold)) + } + if i.Kind != nil { + predicates = append(predicates, hush.KindEQ(*i.Kind)) + } + if i.KindNEQ != nil { + predicates = append(predicates, hush.KindNEQ(*i.KindNEQ)) + } + if len(i.KindIn) > 0 { + predicates = append(predicates, hush.KindIn(i.KindIn...)) + } + if len(i.KindNotIn) > 0 { + predicates = append(predicates, hush.KindNotIn(i.KindNotIn...)) + } + if i.KindGT != nil { + predicates = append(predicates, hush.KindGT(*i.KindGT)) + } + if i.KindGTE != nil { + predicates = append(predicates, hush.KindGTE(*i.KindGTE)) + } + if i.KindLT != nil { + predicates = append(predicates, hush.KindLT(*i.KindLT)) + } + if i.KindLTE != nil { + predicates = append(predicates, hush.KindLTE(*i.KindLTE)) + } + if i.KindContains != nil { + predicates = append(predicates, hush.KindContains(*i.KindContains)) + } + if i.KindHasPrefix != nil { + predicates = append(predicates, hush.KindHasPrefix(*i.KindHasPrefix)) + } + if i.KindHasSuffix != nil { + predicates = append(predicates, hush.KindHasSuffix(*i.KindHasSuffix)) + } + if i.KindIsNil { + predicates = append(predicates, hush.KindIsNil()) + } + if i.KindNotNil { + predicates = append(predicates, hush.KindNotNil()) + } + if i.KindEqualFold != nil { + predicates = append(predicates, hush.KindEqualFold(*i.KindEqualFold)) + } + if i.KindContainsFold != nil { + predicates = append(predicates, hush.KindContainsFold(*i.KindContainsFold)) + } + if i.SecretName != nil { + predicates = append(predicates, hush.SecretNameEQ(*i.SecretName)) + } + if i.SecretNameNEQ != nil { + predicates = append(predicates, hush.SecretNameNEQ(*i.SecretNameNEQ)) + } + if len(i.SecretNameIn) > 0 { + predicates = append(predicates, hush.SecretNameIn(i.SecretNameIn...)) + } + if len(i.SecretNameNotIn) > 0 { + predicates = append(predicates, hush.SecretNameNotIn(i.SecretNameNotIn...)) + } + if i.SecretNameGT != nil { + predicates = append(predicates, hush.SecretNameGT(*i.SecretNameGT)) + } + if i.SecretNameGTE != nil { + predicates = append(predicates, hush.SecretNameGTE(*i.SecretNameGTE)) + } + if i.SecretNameLT != nil { + predicates = append(predicates, hush.SecretNameLT(*i.SecretNameLT)) + } + if i.SecretNameLTE != nil { + predicates = append(predicates, hush.SecretNameLTE(*i.SecretNameLTE)) + } + if i.SecretNameContains != nil { + predicates = append(predicates, hush.SecretNameContains(*i.SecretNameContains)) + } + if i.SecretNameHasPrefix != nil { + predicates = append(predicates, hush.SecretNameHasPrefix(*i.SecretNameHasPrefix)) + } + if i.SecretNameHasSuffix != nil { + predicates = append(predicates, hush.SecretNameHasSuffix(*i.SecretNameHasSuffix)) + } + if i.SecretNameIsNil { + predicates = append(predicates, hush.SecretNameIsNil()) + } + if i.SecretNameNotNil { + predicates = append(predicates, hush.SecretNameNotNil()) + } + if i.SecretNameEqualFold != nil { + predicates = append(predicates, hush.SecretNameEqualFold(*i.SecretNameEqualFold)) + } + if i.SecretNameContainsFold != nil { + predicates = append(predicates, hush.SecretNameContainsFold(*i.SecretNameContainsFold)) + } + + if i.HasIntegrations != nil { + p := hush.HasIntegrations() + if !*i.HasIntegrations { + p = hush.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasIntegrationsWith) > 0 { + with := make([]predicate.Integration, 0, len(i.HasIntegrationsWith)) + for _, w := range i.HasIntegrationsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasIntegrationsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, hush.HasIntegrationsWith(with...)) + } + if i.HasOrganization != nil { + p := hush.HasOrganization() + if !*i.HasOrganization { + p = hush.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationWith)) + for _, w := range i.HasOrganizationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, hush.HasOrganizationWith(with...)) + } + if i.HasEvents != nil { + p := hush.HasEvents() + if !*i.HasEvents { + p = hush.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, hush.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyHushWhereInput + case 1: + return predicates[0], nil + default: + return hush.And(predicates...), nil + } +} + +// HushHistoryWhereInput represents a where input for filtering HushHistory queries. +type HushHistoryWhereInput struct { + Predicates []predicate.HushHistory `json:"-"` + Not *HushHistoryWhereInput `json:"not,omitempty"` + Or []*HushHistoryWhereInput `json:"or,omitempty"` + And []*HushHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "kind" field predicates. + Kind *string `json:"kind,omitempty"` + KindNEQ *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGT *string `json:"kindGT,omitempty"` + KindGTE *string `json:"kindGTE,omitempty"` + KindLT *string `json:"kindLT,omitempty"` + KindLTE *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil bool `json:"kindIsNil,omitempty"` + KindNotNil bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + + // "secret_name" field predicates. + SecretName *string `json:"secretName,omitempty"` + SecretNameNEQ *string `json:"secretNameNEQ,omitempty"` + SecretNameIn []string `json:"secretNameIn,omitempty"` + SecretNameNotIn []string `json:"secretNameNotIn,omitempty"` + SecretNameGT *string `json:"secretNameGT,omitempty"` + SecretNameGTE *string `json:"secretNameGTE,omitempty"` + SecretNameLT *string `json:"secretNameLT,omitempty"` + SecretNameLTE *string `json:"secretNameLTE,omitempty"` + SecretNameContains *string `json:"secretNameContains,omitempty"` + SecretNameHasPrefix *string `json:"secretNameHasPrefix,omitempty"` + SecretNameHasSuffix *string `json:"secretNameHasSuffix,omitempty"` + SecretNameIsNil bool `json:"secretNameIsNil,omitempty"` + SecretNameNotNil bool `json:"secretNameNotNil,omitempty"` + SecretNameEqualFold *string `json:"secretNameEqualFold,omitempty"` + SecretNameContainsFold *string `json:"secretNameContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *HushHistoryWhereInput) AddPredicates(predicates ...predicate.HushHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the HushHistoryWhereInput filter on the HushHistoryQuery builder. +func (i *HushHistoryWhereInput) Filter(q *HushHistoryQuery) (*HushHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyHushHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyHushHistoryWhereInput is returned in case the HushHistoryWhereInput is empty. +var ErrEmptyHushHistoryWhereInput = errors.New("generated: empty predicate HushHistoryWhereInput") + +// P returns a predicate for filtering hushhistories. +// An error is returned if the input is empty or invalid. +func (i *HushHistoryWhereInput) P() (predicate.HushHistory, error) { + var predicates []predicate.HushHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, hushhistory.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.HushHistory, 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, hushhistory.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.HushHistory, 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, hushhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, hushhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, hushhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, hushhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, hushhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, hushhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, hushhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, hushhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, hushhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, hushhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, hushhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, hushhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, hushhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, hushhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, hushhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, hushhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, hushhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, hushhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, hushhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, hushhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, hushhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, hushhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, hushhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, hushhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, hushhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, hushhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, hushhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, hushhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, hushhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, hushhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, hushhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, hushhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, hushhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, hushhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, hushhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, hushhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, hushhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, hushhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, hushhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, hushhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, hushhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, hushhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, hushhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, hushhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, hushhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, hushhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, hushhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, hushhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, hushhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, hushhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, hushhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, hushhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, hushhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, hushhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, hushhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, hushhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, hushhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, hushhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, hushhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, hushhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, hushhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, hushhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, hushhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, hushhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, hushhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, hushhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, hushhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, hushhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, hushhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, hushhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, hushhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, hushhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, hushhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, hushhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, hushhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, hushhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, hushhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, hushhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, hushhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, hushhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, hushhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, hushhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, hushhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, hushhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, hushhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, hushhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, hushhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, hushhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, hushhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, hushhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, hushhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, hushhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, hushhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, hushhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, hushhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, hushhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, hushhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, hushhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, hushhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, hushhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, hushhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, hushhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, hushhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, hushhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, hushhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, hushhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, hushhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, hushhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, hushhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, hushhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, hushhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, hushhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, hushhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, hushhistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, hushhistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, hushhistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, hushhistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, hushhistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, hushhistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, hushhistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, hushhistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, hushhistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, hushhistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, hushhistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, hushhistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, hushhistory.NameContainsFold(*i.NameContainsFold)) + } + if i.Kind != nil { + predicates = append(predicates, hushhistory.KindEQ(*i.Kind)) + } + if i.KindNEQ != nil { + predicates = append(predicates, hushhistory.KindNEQ(*i.KindNEQ)) + } + if len(i.KindIn) > 0 { + predicates = append(predicates, hushhistory.KindIn(i.KindIn...)) + } + if len(i.KindNotIn) > 0 { + predicates = append(predicates, hushhistory.KindNotIn(i.KindNotIn...)) + } + if i.KindGT != nil { + predicates = append(predicates, hushhistory.KindGT(*i.KindGT)) + } + if i.KindGTE != nil { + predicates = append(predicates, hushhistory.KindGTE(*i.KindGTE)) + } + if i.KindLT != nil { + predicates = append(predicates, hushhistory.KindLT(*i.KindLT)) + } + if i.KindLTE != nil { + predicates = append(predicates, hushhistory.KindLTE(*i.KindLTE)) + } + if i.KindContains != nil { + predicates = append(predicates, hushhistory.KindContains(*i.KindContains)) + } + if i.KindHasPrefix != nil { + predicates = append(predicates, hushhistory.KindHasPrefix(*i.KindHasPrefix)) + } + if i.KindHasSuffix != nil { + predicates = append(predicates, hushhistory.KindHasSuffix(*i.KindHasSuffix)) + } + if i.KindIsNil { + predicates = append(predicates, hushhistory.KindIsNil()) + } + if i.KindNotNil { + predicates = append(predicates, hushhistory.KindNotNil()) + } + if i.KindEqualFold != nil { + predicates = append(predicates, hushhistory.KindEqualFold(*i.KindEqualFold)) + } + if i.KindContainsFold != nil { + predicates = append(predicates, hushhistory.KindContainsFold(*i.KindContainsFold)) + } + if i.SecretName != nil { + predicates = append(predicates, hushhistory.SecretNameEQ(*i.SecretName)) + } + if i.SecretNameNEQ != nil { + predicates = append(predicates, hushhistory.SecretNameNEQ(*i.SecretNameNEQ)) + } + if len(i.SecretNameIn) > 0 { + predicates = append(predicates, hushhistory.SecretNameIn(i.SecretNameIn...)) + } + if len(i.SecretNameNotIn) > 0 { + predicates = append(predicates, hushhistory.SecretNameNotIn(i.SecretNameNotIn...)) + } + if i.SecretNameGT != nil { + predicates = append(predicates, hushhistory.SecretNameGT(*i.SecretNameGT)) + } + if i.SecretNameGTE != nil { + predicates = append(predicates, hushhistory.SecretNameGTE(*i.SecretNameGTE)) + } + if i.SecretNameLT != nil { + predicates = append(predicates, hushhistory.SecretNameLT(*i.SecretNameLT)) + } + if i.SecretNameLTE != nil { + predicates = append(predicates, hushhistory.SecretNameLTE(*i.SecretNameLTE)) + } + if i.SecretNameContains != nil { + predicates = append(predicates, hushhistory.SecretNameContains(*i.SecretNameContains)) + } + if i.SecretNameHasPrefix != nil { + predicates = append(predicates, hushhistory.SecretNameHasPrefix(*i.SecretNameHasPrefix)) + } + if i.SecretNameHasSuffix != nil { + predicates = append(predicates, hushhistory.SecretNameHasSuffix(*i.SecretNameHasSuffix)) + } + if i.SecretNameIsNil { + predicates = append(predicates, hushhistory.SecretNameIsNil()) + } + if i.SecretNameNotNil { + predicates = append(predicates, hushhistory.SecretNameNotNil()) + } + if i.SecretNameEqualFold != nil { + predicates = append(predicates, hushhistory.SecretNameEqualFold(*i.SecretNameEqualFold)) + } + if i.SecretNameContainsFold != nil { + predicates = append(predicates, hushhistory.SecretNameContainsFold(*i.SecretNameContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyHushHistoryWhereInput + case 1: + return predicates[0], nil + default: + return hushhistory.And(predicates...), nil + } +} + +// IntegrationWhereInput represents a where input for filtering Integration queries. +type IntegrationWhereInput struct { + Predicates []predicate.Integration `json:"-"` + Not *IntegrationWhereInput `json:"not,omitempty"` + Or []*IntegrationWhereInput `json:"or,omitempty"` + And []*IntegrationWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "kind" field predicates. + Kind *string `json:"kind,omitempty"` + KindNEQ *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGT *string `json:"kindGT,omitempty"` + KindGTE *string `json:"kindGTE,omitempty"` + KindLT *string `json:"kindLT,omitempty"` + KindLTE *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil bool `json:"kindIsNil,omitempty"` + KindNotNil bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "secrets" edge predicates. + HasSecrets *bool `json:"hasSecrets,omitempty"` + HasSecretsWith []*HushWhereInput `json:"hasSecretsWith,omitempty"` + + // "oauth2tokens" edge predicates. + HasOauth2tokens *bool `json:"hasOauth2tokens,omitempty"` + HasOauth2tokensWith []*OhAuthTooTokenWhereInput `json:"hasOauth2tokensWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + + // "webhooks" edge predicates. + HasWebhooks *bool `json:"hasWebhooks,omitempty"` + HasWebhooksWith []*WebhookWhereInput `json:"hasWebhooksWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *IntegrationWhereInput) AddPredicates(predicates ...predicate.Integration) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the IntegrationWhereInput filter on the IntegrationQuery builder. +func (i *IntegrationWhereInput) Filter(q *IntegrationQuery) (*IntegrationQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyIntegrationWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyIntegrationWhereInput is returned in case the IntegrationWhereInput is empty. +var ErrEmptyIntegrationWhereInput = errors.New("generated: empty predicate IntegrationWhereInput") + +// P returns a predicate for filtering integrations. +// An error is returned if the input is empty or invalid. +func (i *IntegrationWhereInput) P() (predicate.Integration, error) { + var predicates []predicate.Integration + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, integration.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.Integration, 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, integration.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.Integration, 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, integration.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, integration.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, integration.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, integration.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, integration.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, integration.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, integration.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, integration.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, integration.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, integration.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, integration.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, integration.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, integration.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, integration.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, integration.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, integration.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, integration.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, integration.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, integration.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, integration.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, integration.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, integration.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, integration.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, integration.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, integration.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, integration.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, integration.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, integration.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, integration.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, integration.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, integration.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, integration.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, integration.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, integration.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, integration.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, integration.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, integration.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, integration.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, integration.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, integration.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, integration.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, integration.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, integration.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, integration.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, integration.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, integration.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, integration.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, integration.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, integration.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, integration.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, integration.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, integration.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, integration.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, integration.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, integration.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, integration.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, integration.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, integration.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, integration.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, integration.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, integration.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, integration.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, integration.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, integration.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, integration.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, integration.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, integration.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, integration.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, integration.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, integration.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, integration.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, integration.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, integration.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, integration.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, integration.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, integration.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, integration.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, integration.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, integration.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, integration.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, integration.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, integration.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, integration.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, integration.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, integration.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, integration.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, integration.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, integration.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, integration.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, integration.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, integration.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, integration.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, integration.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, integration.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, integration.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, integration.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, integration.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, integration.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, integration.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, integration.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, integration.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, integration.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, integration.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, integration.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, integration.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, integration.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, integration.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, integration.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, integration.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, integration.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, integration.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, integration.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, integration.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, integration.NameContainsFold(*i.NameContainsFold)) + } + if i.Kind != nil { + predicates = append(predicates, integration.KindEQ(*i.Kind)) + } + if i.KindNEQ != nil { + predicates = append(predicates, integration.KindNEQ(*i.KindNEQ)) + } + if len(i.KindIn) > 0 { + predicates = append(predicates, integration.KindIn(i.KindIn...)) + } + if len(i.KindNotIn) > 0 { + predicates = append(predicates, integration.KindNotIn(i.KindNotIn...)) + } + if i.KindGT != nil { + predicates = append(predicates, integration.KindGT(*i.KindGT)) + } + if i.KindGTE != nil { + predicates = append(predicates, integration.KindGTE(*i.KindGTE)) + } + if i.KindLT != nil { + predicates = append(predicates, integration.KindLT(*i.KindLT)) + } + if i.KindLTE != nil { + predicates = append(predicates, integration.KindLTE(*i.KindLTE)) + } + if i.KindContains != nil { + predicates = append(predicates, integration.KindContains(*i.KindContains)) + } + if i.KindHasPrefix != nil { + predicates = append(predicates, integration.KindHasPrefix(*i.KindHasPrefix)) + } + if i.KindHasSuffix != nil { + predicates = append(predicates, integration.KindHasSuffix(*i.KindHasSuffix)) + } + if i.KindIsNil { + predicates = append(predicates, integration.KindIsNil()) + } + if i.KindNotNil { + predicates = append(predicates, integration.KindNotNil()) + } + if i.KindEqualFold != nil { + predicates = append(predicates, integration.KindEqualFold(*i.KindEqualFold)) + } + if i.KindContainsFold != nil { + predicates = append(predicates, integration.KindContainsFold(*i.KindContainsFold)) + } + + if i.HasOwner != nil { + p := integration.HasOwner() + if !*i.HasOwner { + p = integration.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, integration.HasOwnerWith(with...)) + } + if i.HasSecrets != nil { + p := integration.HasSecrets() + if !*i.HasSecrets { + p = integration.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasSecretsWith) > 0 { + with := make([]predicate.Hush, 0, len(i.HasSecretsWith)) + for _, w := range i.HasSecretsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasSecretsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, integration.HasSecretsWith(with...)) + } + if i.HasOauth2tokens != nil { + p := integration.HasOauth2tokens() + if !*i.HasOauth2tokens { + p = integration.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOauth2tokensWith) > 0 { + with := make([]predicate.OhAuthTooToken, 0, len(i.HasOauth2tokensWith)) + for _, w := range i.HasOauth2tokensWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOauth2tokensWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, integration.HasOauth2tokensWith(with...)) + } + if i.HasEvents != nil { + p := integration.HasEvents() + if !*i.HasEvents { + p = integration.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, integration.HasEventsWith(with...)) + } + if i.HasWebhooks != nil { + p := integration.HasWebhooks() + if !*i.HasWebhooks { + p = integration.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasWebhooksWith) > 0 { + with := make([]predicate.Webhook, 0, len(i.HasWebhooksWith)) + for _, w := range i.HasWebhooksWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasWebhooksWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, integration.HasWebhooksWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyIntegrationWhereInput + case 1: + return predicates[0], nil + default: + return integration.And(predicates...), nil + } +} + +// IntegrationHistoryWhereInput represents a where input for filtering IntegrationHistory queries. +type IntegrationHistoryWhereInput struct { + Predicates []predicate.IntegrationHistory `json:"-"` + Not *IntegrationHistoryWhereInput `json:"not,omitempty"` + Or []*IntegrationHistoryWhereInput `json:"or,omitempty"` + And []*IntegrationHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "kind" field predicates. + Kind *string `json:"kind,omitempty"` + KindNEQ *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGT *string `json:"kindGT,omitempty"` + KindGTE *string `json:"kindGTE,omitempty"` + KindLT *string `json:"kindLT,omitempty"` + KindLTE *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil bool `json:"kindIsNil,omitempty"` + KindNotNil bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *IntegrationHistoryWhereInput) AddPredicates(predicates ...predicate.IntegrationHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the IntegrationHistoryWhereInput filter on the IntegrationHistoryQuery builder. +func (i *IntegrationHistoryWhereInput) Filter(q *IntegrationHistoryQuery) (*IntegrationHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyIntegrationHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyIntegrationHistoryWhereInput is returned in case the IntegrationHistoryWhereInput is empty. +var ErrEmptyIntegrationHistoryWhereInput = errors.New("generated: empty predicate IntegrationHistoryWhereInput") + +// P returns a predicate for filtering integrationhistories. +// An error is returned if the input is empty or invalid. +func (i *IntegrationHistoryWhereInput) P() (predicate.IntegrationHistory, error) { + var predicates []predicate.IntegrationHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, integrationhistory.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.IntegrationHistory, 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, integrationhistory.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.IntegrationHistory, 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, integrationhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, integrationhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, integrationhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, integrationhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, integrationhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, integrationhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, integrationhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, integrationhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, integrationhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, integrationhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, integrationhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, integrationhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, integrationhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, integrationhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, integrationhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, integrationhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, integrationhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, integrationhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, integrationhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, integrationhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, integrationhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, integrationhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, integrationhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, integrationhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, integrationhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, integrationhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, integrationhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, integrationhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, integrationhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, integrationhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, integrationhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, integrationhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, integrationhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, integrationhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, integrationhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, integrationhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, integrationhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, integrationhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, integrationhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, integrationhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, integrationhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, integrationhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, integrationhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, integrationhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, integrationhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, integrationhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, integrationhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, integrationhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, integrationhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, integrationhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, integrationhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, integrationhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, integrationhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, integrationhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, integrationhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, integrationhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, integrationhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, integrationhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, integrationhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, integrationhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, integrationhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, integrationhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, integrationhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, integrationhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, integrationhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, integrationhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, integrationhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, integrationhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, integrationhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, integrationhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, integrationhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, integrationhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, integrationhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, integrationhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, integrationhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, integrationhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, integrationhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, integrationhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, integrationhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, integrationhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, integrationhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, integrationhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, integrationhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, integrationhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, integrationhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, integrationhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, integrationhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, integrationhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, integrationhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, integrationhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, integrationhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, integrationhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, integrationhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, integrationhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, integrationhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, integrationhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, integrationhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, integrationhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, integrationhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, integrationhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, integrationhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, integrationhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, integrationhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, integrationhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, integrationhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, integrationhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, integrationhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, integrationhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, integrationhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, integrationhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, integrationhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, integrationhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, integrationhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, integrationhistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, integrationhistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, integrationhistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, integrationhistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, integrationhistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, integrationhistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, integrationhistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, integrationhistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, integrationhistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, integrationhistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, integrationhistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, integrationhistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, integrationhistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, integrationhistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, integrationhistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, integrationhistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, integrationhistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, integrationhistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, integrationhistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, integrationhistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, integrationhistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, integrationhistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, integrationhistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, integrationhistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, integrationhistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, integrationhistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, integrationhistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, integrationhistory.NameContainsFold(*i.NameContainsFold)) + } + if i.Kind != nil { + predicates = append(predicates, integrationhistory.KindEQ(*i.Kind)) + } + if i.KindNEQ != nil { + predicates = append(predicates, integrationhistory.KindNEQ(*i.KindNEQ)) + } + if len(i.KindIn) > 0 { + predicates = append(predicates, integrationhistory.KindIn(i.KindIn...)) + } + if len(i.KindNotIn) > 0 { + predicates = append(predicates, integrationhistory.KindNotIn(i.KindNotIn...)) + } + if i.KindGT != nil { + predicates = append(predicates, integrationhistory.KindGT(*i.KindGT)) + } + if i.KindGTE != nil { + predicates = append(predicates, integrationhistory.KindGTE(*i.KindGTE)) + } + if i.KindLT != nil { + predicates = append(predicates, integrationhistory.KindLT(*i.KindLT)) + } + if i.KindLTE != nil { + predicates = append(predicates, integrationhistory.KindLTE(*i.KindLTE)) + } + if i.KindContains != nil { + predicates = append(predicates, integrationhistory.KindContains(*i.KindContains)) + } + if i.KindHasPrefix != nil { + predicates = append(predicates, integrationhistory.KindHasPrefix(*i.KindHasPrefix)) + } + if i.KindHasSuffix != nil { + predicates = append(predicates, integrationhistory.KindHasSuffix(*i.KindHasSuffix)) + } + if i.KindIsNil { + predicates = append(predicates, integrationhistory.KindIsNil()) + } + if i.KindNotNil { + predicates = append(predicates, integrationhistory.KindNotNil()) + } + if i.KindEqualFold != nil { + predicates = append(predicates, integrationhistory.KindEqualFold(*i.KindEqualFold)) + } + if i.KindContainsFold != nil { + predicates = append(predicates, integrationhistory.KindContainsFold(*i.KindContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyIntegrationHistoryWhereInput + case 1: + return predicates[0], nil + default: + return integrationhistory.And(predicates...), nil + } +} + +// InviteWhereInput represents a where input for filtering Invite queries. +type InviteWhereInput struct { + Predicates []predicate.Invite `json:"-"` + Not *InviteWhereInput `json:"not,omitempty"` + Or []*InviteWhereInput `json:"or,omitempty"` + And []*InviteWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "expires" field predicates. + Expires *time.Time `json:"expires,omitempty"` + ExpiresNEQ *time.Time `json:"expiresNEQ,omitempty"` + ExpiresIn []time.Time `json:"expiresIn,omitempty"` + ExpiresNotIn []time.Time `json:"expiresNotIn,omitempty"` + ExpiresGT *time.Time `json:"expiresGT,omitempty"` + ExpiresGTE *time.Time `json:"expiresGTE,omitempty"` + ExpiresLT *time.Time `json:"expiresLT,omitempty"` + ExpiresLTE *time.Time `json:"expiresLTE,omitempty"` + ExpiresIsNil bool `json:"expiresIsNil,omitempty"` + ExpiresNotNil bool `json:"expiresNotNil,omitempty"` + + // "recipient" field predicates. + Recipient *string `json:"recipient,omitempty"` + RecipientNEQ *string `json:"recipientNEQ,omitempty"` + RecipientIn []string `json:"recipientIn,omitempty"` + RecipientNotIn []string `json:"recipientNotIn,omitempty"` + RecipientGT *string `json:"recipientGT,omitempty"` + RecipientGTE *string `json:"recipientGTE,omitempty"` + RecipientLT *string `json:"recipientLT,omitempty"` + RecipientLTE *string `json:"recipientLTE,omitempty"` + RecipientContains *string `json:"recipientContains,omitempty"` + RecipientHasPrefix *string `json:"recipientHasPrefix,omitempty"` + RecipientHasSuffix *string `json:"recipientHasSuffix,omitempty"` + RecipientEqualFold *string `json:"recipientEqualFold,omitempty"` + RecipientContainsFold *string `json:"recipientContainsFold,omitempty"` + + // "status" field predicates. + Status *enums.InviteStatus `json:"status,omitempty"` + StatusNEQ *enums.InviteStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.InviteStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.InviteStatus `json:"statusNotIn,omitempty"` + + // "role" field predicates. + Role *enums.Role `json:"role,omitempty"` + RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + + // "send_attempts" field predicates. + SendAttempts *int `json:"sendAttempts,omitempty"` + SendAttemptsNEQ *int `json:"sendAttemptsNEQ,omitempty"` + SendAttemptsIn []int `json:"sendAttemptsIn,omitempty"` + SendAttemptsNotIn []int `json:"sendAttemptsNotIn,omitempty"` + SendAttemptsGT *int `json:"sendAttemptsGT,omitempty"` + SendAttemptsGTE *int `json:"sendAttemptsGTE,omitempty"` + SendAttemptsLT *int `json:"sendAttemptsLT,omitempty"` + SendAttemptsLTE *int `json:"sendAttemptsLTE,omitempty"` + + // "requestor_id" field predicates. + RequestorID *string `json:"requestorID,omitempty"` + RequestorIDNEQ *string `json:"requestorIDNEQ,omitempty"` + RequestorIDIn []string `json:"requestorIDIn,omitempty"` + RequestorIDNotIn []string `json:"requestorIDNotIn,omitempty"` + RequestorIDGT *string `json:"requestorIDGT,omitempty"` + RequestorIDGTE *string `json:"requestorIDGTE,omitempty"` + RequestorIDLT *string `json:"requestorIDLT,omitempty"` + RequestorIDLTE *string `json:"requestorIDLTE,omitempty"` + RequestorIDContains *string `json:"requestorIDContains,omitempty"` + RequestorIDHasPrefix *string `json:"requestorIDHasPrefix,omitempty"` + RequestorIDHasSuffix *string `json:"requestorIDHasSuffix,omitempty"` + RequestorIDIsNil bool `json:"requestorIDIsNil,omitempty"` + RequestorIDNotNil bool `json:"requestorIDNotNil,omitempty"` + RequestorIDEqualFold *string `json:"requestorIDEqualFold,omitempty"` + RequestorIDContainsFold *string `json:"requestorIDContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *InviteWhereInput) AddPredicates(predicates ...predicate.Invite) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the InviteWhereInput filter on the InviteQuery builder. +func (i *InviteWhereInput) Filter(q *InviteQuery) (*InviteQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyInviteWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyInviteWhereInput is returned in case the InviteWhereInput is empty. +var ErrEmptyInviteWhereInput = errors.New("generated: empty predicate InviteWhereInput") + +// P returns a predicate for filtering invites. +// An error is returned if the input is empty or invalid. +func (i *InviteWhereInput) P() (predicate.Invite, error) { + var predicates []predicate.Invite + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, invite.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.Invite, 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, invite.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.Invite, 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, invite.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, invite.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, invite.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, invite.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, invite.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, invite.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, invite.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, invite.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, invite.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, invite.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, invite.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, invite.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, invite.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, invite.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, invite.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, invite.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, invite.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, invite.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, invite.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, invite.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, invite.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, invite.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, invite.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, invite.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, invite.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, invite.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, invite.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, invite.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, invite.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, invite.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, invite.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, invite.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, invite.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, invite.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, invite.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, invite.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, invite.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, invite.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, invite.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, invite.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, invite.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, invite.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, invite.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, invite.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, invite.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, invite.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, invite.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, invite.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, invite.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, invite.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, invite.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, invite.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, invite.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, invite.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, invite.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, invite.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, invite.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, invite.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, invite.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, invite.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, invite.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, invite.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, invite.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, invite.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, invite.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, invite.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, invite.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, invite.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, invite.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, invite.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, invite.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, invite.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, invite.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, invite.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, invite.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, invite.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, invite.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, invite.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, invite.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, invite.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, invite.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, invite.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, invite.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, invite.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, invite.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, invite.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, invite.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, invite.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, invite.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, invite.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, invite.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, invite.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, invite.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, invite.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, invite.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, invite.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, invite.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, invite.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, invite.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, invite.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, invite.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Expires != nil { + predicates = append(predicates, invite.ExpiresEQ(*i.Expires)) + } + if i.ExpiresNEQ != nil { + predicates = append(predicates, invite.ExpiresNEQ(*i.ExpiresNEQ)) + } + if len(i.ExpiresIn) > 0 { + predicates = append(predicates, invite.ExpiresIn(i.ExpiresIn...)) + } + if len(i.ExpiresNotIn) > 0 { + predicates = append(predicates, invite.ExpiresNotIn(i.ExpiresNotIn...)) + } + if i.ExpiresGT != nil { + predicates = append(predicates, invite.ExpiresGT(*i.ExpiresGT)) + } + if i.ExpiresGTE != nil { + predicates = append(predicates, invite.ExpiresGTE(*i.ExpiresGTE)) + } + if i.ExpiresLT != nil { + predicates = append(predicates, invite.ExpiresLT(*i.ExpiresLT)) + } + if i.ExpiresLTE != nil { + predicates = append(predicates, invite.ExpiresLTE(*i.ExpiresLTE)) + } + if i.ExpiresIsNil { + predicates = append(predicates, invite.ExpiresIsNil()) + } + if i.ExpiresNotNil { + predicates = append(predicates, invite.ExpiresNotNil()) + } + if i.Recipient != nil { + predicates = append(predicates, invite.RecipientEQ(*i.Recipient)) + } + if i.RecipientNEQ != nil { + predicates = append(predicates, invite.RecipientNEQ(*i.RecipientNEQ)) + } + if len(i.RecipientIn) > 0 { + predicates = append(predicates, invite.RecipientIn(i.RecipientIn...)) + } + if len(i.RecipientNotIn) > 0 { + predicates = append(predicates, invite.RecipientNotIn(i.RecipientNotIn...)) + } + if i.RecipientGT != nil { + predicates = append(predicates, invite.RecipientGT(*i.RecipientGT)) + } + if i.RecipientGTE != nil { + predicates = append(predicates, invite.RecipientGTE(*i.RecipientGTE)) + } + if i.RecipientLT != nil { + predicates = append(predicates, invite.RecipientLT(*i.RecipientLT)) + } + if i.RecipientLTE != nil { + predicates = append(predicates, invite.RecipientLTE(*i.RecipientLTE)) + } + if i.RecipientContains != nil { + predicates = append(predicates, invite.RecipientContains(*i.RecipientContains)) + } + if i.RecipientHasPrefix != nil { + predicates = append(predicates, invite.RecipientHasPrefix(*i.RecipientHasPrefix)) + } + if i.RecipientHasSuffix != nil { + predicates = append(predicates, invite.RecipientHasSuffix(*i.RecipientHasSuffix)) + } + if i.RecipientEqualFold != nil { + predicates = append(predicates, invite.RecipientEqualFold(*i.RecipientEqualFold)) + } + if i.RecipientContainsFold != nil { + predicates = append(predicates, invite.RecipientContainsFold(*i.RecipientContainsFold)) + } + if i.Status != nil { + predicates = append(predicates, invite.StatusEQ(*i.Status)) + } + if i.StatusNEQ != nil { + predicates = append(predicates, invite.StatusNEQ(*i.StatusNEQ)) + } + if len(i.StatusIn) > 0 { + predicates = append(predicates, invite.StatusIn(i.StatusIn...)) + } + if len(i.StatusNotIn) > 0 { + predicates = append(predicates, invite.StatusNotIn(i.StatusNotIn...)) + } + if i.Role != nil { + predicates = append(predicates, invite.RoleEQ(*i.Role)) + } + if i.RoleNEQ != nil { + predicates = append(predicates, invite.RoleNEQ(*i.RoleNEQ)) + } + if len(i.RoleIn) > 0 { + predicates = append(predicates, invite.RoleIn(i.RoleIn...)) + } + if len(i.RoleNotIn) > 0 { + predicates = append(predicates, invite.RoleNotIn(i.RoleNotIn...)) + } + if i.SendAttempts != nil { + predicates = append(predicates, invite.SendAttemptsEQ(*i.SendAttempts)) + } + if i.SendAttemptsNEQ != nil { + predicates = append(predicates, invite.SendAttemptsNEQ(*i.SendAttemptsNEQ)) + } + if len(i.SendAttemptsIn) > 0 { + predicates = append(predicates, invite.SendAttemptsIn(i.SendAttemptsIn...)) + } + if len(i.SendAttemptsNotIn) > 0 { + predicates = append(predicates, invite.SendAttemptsNotIn(i.SendAttemptsNotIn...)) + } + if i.SendAttemptsGT != nil { + predicates = append(predicates, invite.SendAttemptsGT(*i.SendAttemptsGT)) + } + if i.SendAttemptsGTE != nil { + predicates = append(predicates, invite.SendAttemptsGTE(*i.SendAttemptsGTE)) + } + if i.SendAttemptsLT != nil { + predicates = append(predicates, invite.SendAttemptsLT(*i.SendAttemptsLT)) + } + if i.SendAttemptsLTE != nil { + predicates = append(predicates, invite.SendAttemptsLTE(*i.SendAttemptsLTE)) + } + if i.RequestorID != nil { + predicates = append(predicates, invite.RequestorIDEQ(*i.RequestorID)) + } + if i.RequestorIDNEQ != nil { + predicates = append(predicates, invite.RequestorIDNEQ(*i.RequestorIDNEQ)) + } + if len(i.RequestorIDIn) > 0 { + predicates = append(predicates, invite.RequestorIDIn(i.RequestorIDIn...)) + } + if len(i.RequestorIDNotIn) > 0 { + predicates = append(predicates, invite.RequestorIDNotIn(i.RequestorIDNotIn...)) + } + if i.RequestorIDGT != nil { + predicates = append(predicates, invite.RequestorIDGT(*i.RequestorIDGT)) + } + if i.RequestorIDGTE != nil { + predicates = append(predicates, invite.RequestorIDGTE(*i.RequestorIDGTE)) + } + if i.RequestorIDLT != nil { + predicates = append(predicates, invite.RequestorIDLT(*i.RequestorIDLT)) + } + if i.RequestorIDLTE != nil { + predicates = append(predicates, invite.RequestorIDLTE(*i.RequestorIDLTE)) + } + if i.RequestorIDContains != nil { + predicates = append(predicates, invite.RequestorIDContains(*i.RequestorIDContains)) + } + if i.RequestorIDHasPrefix != nil { + predicates = append(predicates, invite.RequestorIDHasPrefix(*i.RequestorIDHasPrefix)) + } + if i.RequestorIDHasSuffix != nil { + predicates = append(predicates, invite.RequestorIDHasSuffix(*i.RequestorIDHasSuffix)) + } + if i.RequestorIDIsNil { + predicates = append(predicates, invite.RequestorIDIsNil()) + } + if i.RequestorIDNotNil { + predicates = append(predicates, invite.RequestorIDNotNil()) + } + if i.RequestorIDEqualFold != nil { + predicates = append(predicates, invite.RequestorIDEqualFold(*i.RequestorIDEqualFold)) + } + if i.RequestorIDContainsFold != nil { + predicates = append(predicates, invite.RequestorIDContainsFold(*i.RequestorIDContainsFold)) + } + + if i.HasOwner != nil { + p := invite.HasOwner() + if !*i.HasOwner { + p = invite.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, invite.HasOwnerWith(with...)) + } + if i.HasEvents != nil { + p := invite.HasEvents() + if !*i.HasEvents { + p = invite.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, invite.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyInviteWhereInput + case 1: + return predicates[0], nil + default: + return invite.And(predicates...), nil + } +} + +// NoteWhereInput represents a where input for filtering Note queries. +type NoteWhereInput struct { + Predicates []predicate.Note `json:"-"` + Not *NoteWhereInput `json:"not,omitempty"` + Or []*NoteWhereInput `json:"or,omitempty"` + And []*NoteWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "text" field predicates. + Text *string `json:"text,omitempty"` + TextNEQ *string `json:"textNEQ,omitempty"` + TextIn []string `json:"textIn,omitempty"` + TextNotIn []string `json:"textNotIn,omitempty"` + TextGT *string `json:"textGT,omitempty"` + TextGTE *string `json:"textGTE,omitempty"` + TextLT *string `json:"textLT,omitempty"` + TextLTE *string `json:"textLTE,omitempty"` + TextContains *string `json:"textContains,omitempty"` + TextHasPrefix *string `json:"textHasPrefix,omitempty"` + TextHasSuffix *string `json:"textHasSuffix,omitempty"` + TextEqualFold *string `json:"textEqualFold,omitempty"` + TextContainsFold *string `json:"textContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "entity" edge predicates. + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *NoteWhereInput) AddPredicates(predicates ...predicate.Note) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the NoteWhereInput filter on the NoteQuery builder. +func (i *NoteWhereInput) Filter(q *NoteQuery) (*NoteQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyNoteWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyNoteWhereInput is returned in case the NoteWhereInput is empty. +var ErrEmptyNoteWhereInput = errors.New("generated: empty predicate NoteWhereInput") + +// P returns a predicate for filtering notes. +// An error is returned if the input is empty or invalid. +func (i *NoteWhereInput) P() (predicate.Note, error) { + var predicates []predicate.Note + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, note.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.Note, 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, note.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.Note, 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, note.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, note.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, note.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, note.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, note.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, note.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, note.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, note.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, note.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, note.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, note.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, note.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, note.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, note.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, note.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, note.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, note.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, note.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, note.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, note.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, note.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, note.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, note.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, note.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, note.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, note.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, note.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, note.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, note.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, note.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, note.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, note.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, note.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, note.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, note.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, note.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, note.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, note.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, note.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, note.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, note.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, note.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, note.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, note.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, note.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, note.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, note.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, note.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, note.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, note.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, note.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, note.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, note.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, note.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, note.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, note.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, note.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, note.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, note.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, note.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, note.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, note.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, note.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, note.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, note.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, note.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, note.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, note.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, note.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, note.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, note.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, note.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, note.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, note.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, note.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, note.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, note.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, note.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, note.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, note.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, note.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, note.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, note.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, note.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, note.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, note.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, note.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, note.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, note.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, note.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, note.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, note.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, note.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, note.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, note.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, note.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, note.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, note.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, note.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, note.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, note.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Text != nil { + predicates = append(predicates, note.TextEQ(*i.Text)) + } + if i.TextNEQ != nil { + predicates = append(predicates, note.TextNEQ(*i.TextNEQ)) + } + if len(i.TextIn) > 0 { + predicates = append(predicates, note.TextIn(i.TextIn...)) + } + if len(i.TextNotIn) > 0 { + predicates = append(predicates, note.TextNotIn(i.TextNotIn...)) + } + if i.TextGT != nil { + predicates = append(predicates, note.TextGT(*i.TextGT)) + } + if i.TextGTE != nil { + predicates = append(predicates, note.TextGTE(*i.TextGTE)) + } + if i.TextLT != nil { + predicates = append(predicates, note.TextLT(*i.TextLT)) + } + if i.TextLTE != nil { + predicates = append(predicates, note.TextLTE(*i.TextLTE)) + } + if i.TextContains != nil { + predicates = append(predicates, note.TextContains(*i.TextContains)) + } + if i.TextHasPrefix != nil { + predicates = append(predicates, note.TextHasPrefix(*i.TextHasPrefix)) + } + if i.TextHasSuffix != nil { + predicates = append(predicates, note.TextHasSuffix(*i.TextHasSuffix)) + } + if i.TextEqualFold != nil { + predicates = append(predicates, note.TextEqualFold(*i.TextEqualFold)) + } + if i.TextContainsFold != nil { + predicates = append(predicates, note.TextContainsFold(*i.TextContainsFold)) + } + + if i.HasOwner != nil { + p := note.HasOwner() + if !*i.HasOwner { + p = note.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, note.HasOwnerWith(with...)) + } + if i.HasEntity != nil { + p := note.HasEntity() + if !*i.HasEntity { + p = note.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntityWith) > 0 { + with := make([]predicate.Entity, 0, len(i.HasEntityWith)) + for _, w := range i.HasEntityWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntityWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, note.HasEntityWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyNoteWhereInput + case 1: + return predicates[0], nil + default: + return note.And(predicates...), nil + } +} + +// NoteHistoryWhereInput represents a where input for filtering NoteHistory queries. +type NoteHistoryWhereInput struct { + Predicates []predicate.NoteHistory `json:"-"` + Not *NoteHistoryWhereInput `json:"not,omitempty"` + Or []*NoteHistoryWhereInput `json:"or,omitempty"` + And []*NoteHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "text" field predicates. + Text *string `json:"text,omitempty"` + TextNEQ *string `json:"textNEQ,omitempty"` + TextIn []string `json:"textIn,omitempty"` + TextNotIn []string `json:"textNotIn,omitempty"` + TextGT *string `json:"textGT,omitempty"` + TextGTE *string `json:"textGTE,omitempty"` + TextLT *string `json:"textLT,omitempty"` + TextLTE *string `json:"textLTE,omitempty"` + TextContains *string `json:"textContains,omitempty"` + TextHasPrefix *string `json:"textHasPrefix,omitempty"` + TextHasSuffix *string `json:"textHasSuffix,omitempty"` + TextEqualFold *string `json:"textEqualFold,omitempty"` + TextContainsFold *string `json:"textContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *NoteHistoryWhereInput) AddPredicates(predicates ...predicate.NoteHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the NoteHistoryWhereInput filter on the NoteHistoryQuery builder. +func (i *NoteHistoryWhereInput) Filter(q *NoteHistoryQuery) (*NoteHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyNoteHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyNoteHistoryWhereInput is returned in case the NoteHistoryWhereInput is empty. +var ErrEmptyNoteHistoryWhereInput = errors.New("generated: empty predicate NoteHistoryWhereInput") + +// P returns a predicate for filtering notehistories. +// An error is returned if the input is empty or invalid. +func (i *NoteHistoryWhereInput) P() (predicate.NoteHistory, error) { + var predicates []predicate.NoteHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, notehistory.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.NoteHistory, 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, notehistory.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.NoteHistory, 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, notehistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, notehistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, notehistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, notehistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, notehistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, notehistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, notehistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, notehistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, notehistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, notehistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, notehistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, notehistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, notehistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, notehistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, notehistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, notehistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, notehistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, notehistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, notehistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, notehistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, notehistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, notehistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, notehistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, notehistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, notehistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, notehistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, notehistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, notehistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, notehistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, notehistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, notehistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, notehistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, notehistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, notehistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, notehistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, notehistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, notehistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, notehistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, notehistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, notehistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, notehistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, notehistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, notehistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, notehistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, notehistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, notehistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, notehistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, notehistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, notehistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, notehistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, notehistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, notehistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, notehistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, notehistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, notehistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, notehistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, notehistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, notehistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, notehistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, notehistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, notehistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, notehistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, notehistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, notehistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, notehistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, notehistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, notehistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, notehistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, notehistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, notehistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, notehistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, notehistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, notehistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, notehistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, notehistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, notehistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, notehistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, notehistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, notehistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, notehistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, notehistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, notehistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, notehistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, notehistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, notehistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, notehistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, notehistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, notehistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, notehistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, notehistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, notehistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, notehistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, notehistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, notehistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, notehistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, notehistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, notehistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, notehistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, notehistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, notehistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, notehistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, notehistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, notehistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, notehistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, notehistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, notehistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, notehistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, notehistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, notehistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, notehistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, notehistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, notehistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, notehistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, notehistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, notehistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, notehistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, notehistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, notehistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, notehistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, notehistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, notehistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, notehistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, notehistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, notehistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, notehistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, notehistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, notehistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, notehistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Text != nil { + predicates = append(predicates, notehistory.TextEQ(*i.Text)) + } + if i.TextNEQ != nil { + predicates = append(predicates, notehistory.TextNEQ(*i.TextNEQ)) + } + if len(i.TextIn) > 0 { + predicates = append(predicates, notehistory.TextIn(i.TextIn...)) + } + if len(i.TextNotIn) > 0 { + predicates = append(predicates, notehistory.TextNotIn(i.TextNotIn...)) + } + if i.TextGT != nil { + predicates = append(predicates, notehistory.TextGT(*i.TextGT)) + } + if i.TextGTE != nil { + predicates = append(predicates, notehistory.TextGTE(*i.TextGTE)) + } + if i.TextLT != nil { + predicates = append(predicates, notehistory.TextLT(*i.TextLT)) + } + if i.TextLTE != nil { + predicates = append(predicates, notehistory.TextLTE(*i.TextLTE)) + } + if i.TextContains != nil { + predicates = append(predicates, notehistory.TextContains(*i.TextContains)) + } + if i.TextHasPrefix != nil { + predicates = append(predicates, notehistory.TextHasPrefix(*i.TextHasPrefix)) + } + if i.TextHasSuffix != nil { + predicates = append(predicates, notehistory.TextHasSuffix(*i.TextHasSuffix)) + } + if i.TextEqualFold != nil { + predicates = append(predicates, notehistory.TextEqualFold(*i.TextEqualFold)) + } + if i.TextContainsFold != nil { + predicates = append(predicates, notehistory.TextContainsFold(*i.TextContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyNoteHistoryWhereInput + case 1: + return predicates[0], nil + default: + return notehistory.And(predicates...), nil + } +} + +// OauthProviderWhereInput represents a where input for filtering OauthProvider queries. +type OauthProviderWhereInput struct { + Predicates []predicate.OauthProvider `json:"-"` + Not *OauthProviderWhereInput `json:"not,omitempty"` + Or []*OauthProviderWhereInput `json:"or,omitempty"` + And []*OauthProviderWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "client_id" field predicates. + ClientID *string `json:"clientID,omitempty"` + ClientIDNEQ *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGT *string `json:"clientIDGT,omitempty"` + ClientIDGTE *string `json:"clientIDGTE,omitempty"` + ClientIDLT *string `json:"clientIDLT,omitempty"` + ClientIDLTE *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + + // "client_secret" field predicates. + ClientSecret *string `json:"clientSecret,omitempty"` + ClientSecretNEQ *string `json:"clientSecretNEQ,omitempty"` + ClientSecretIn []string `json:"clientSecretIn,omitempty"` + ClientSecretNotIn []string `json:"clientSecretNotIn,omitempty"` + ClientSecretGT *string `json:"clientSecretGT,omitempty"` + ClientSecretGTE *string `json:"clientSecretGTE,omitempty"` + ClientSecretLT *string `json:"clientSecretLT,omitempty"` + ClientSecretLTE *string `json:"clientSecretLTE,omitempty"` + ClientSecretContains *string `json:"clientSecretContains,omitempty"` + ClientSecretHasPrefix *string `json:"clientSecretHasPrefix,omitempty"` + ClientSecretHasSuffix *string `json:"clientSecretHasSuffix,omitempty"` + ClientSecretEqualFold *string `json:"clientSecretEqualFold,omitempty"` + ClientSecretContainsFold *string `json:"clientSecretContainsFold,omitempty"` + + // "redirect_url" field predicates. + RedirectURL *string `json:"redirectURL,omitempty"` + RedirectURLNEQ *string `json:"redirectURLNEQ,omitempty"` + RedirectURLIn []string `json:"redirectURLIn,omitempty"` + RedirectURLNotIn []string `json:"redirectURLNotIn,omitempty"` + RedirectURLGT *string `json:"redirectURLGT,omitempty"` + RedirectURLGTE *string `json:"redirectURLGTE,omitempty"` + RedirectURLLT *string `json:"redirectURLLT,omitempty"` + RedirectURLLTE *string `json:"redirectURLLTE,omitempty"` + RedirectURLContains *string `json:"redirectURLContains,omitempty"` + RedirectURLHasPrefix *string `json:"redirectURLHasPrefix,omitempty"` + RedirectURLHasSuffix *string `json:"redirectURLHasSuffix,omitempty"` + RedirectURLEqualFold *string `json:"redirectURLEqualFold,omitempty"` + RedirectURLContainsFold *string `json:"redirectURLContainsFold,omitempty"` + + // "scopes" field predicates. + Scopes *string `json:"scopes,omitempty"` + ScopesNEQ *string `json:"scopesNEQ,omitempty"` + ScopesIn []string `json:"scopesIn,omitempty"` + ScopesNotIn []string `json:"scopesNotIn,omitempty"` + ScopesGT *string `json:"scopesGT,omitempty"` + ScopesGTE *string `json:"scopesGTE,omitempty"` + ScopesLT *string `json:"scopesLT,omitempty"` + ScopesLTE *string `json:"scopesLTE,omitempty"` + ScopesContains *string `json:"scopesContains,omitempty"` + ScopesHasPrefix *string `json:"scopesHasPrefix,omitempty"` + ScopesHasSuffix *string `json:"scopesHasSuffix,omitempty"` + ScopesEqualFold *string `json:"scopesEqualFold,omitempty"` + ScopesContainsFold *string `json:"scopesContainsFold,omitempty"` + + // "auth_url" field predicates. + AuthURL *string `json:"authURL,omitempty"` + AuthURLNEQ *string `json:"authURLNEQ,omitempty"` + AuthURLIn []string `json:"authURLIn,omitempty"` + AuthURLNotIn []string `json:"authURLNotIn,omitempty"` + AuthURLGT *string `json:"authURLGT,omitempty"` + AuthURLGTE *string `json:"authURLGTE,omitempty"` + AuthURLLT *string `json:"authURLLT,omitempty"` + AuthURLLTE *string `json:"authURLLTE,omitempty"` + AuthURLContains *string `json:"authURLContains,omitempty"` + AuthURLHasPrefix *string `json:"authURLHasPrefix,omitempty"` + AuthURLHasSuffix *string `json:"authURLHasSuffix,omitempty"` + AuthURLEqualFold *string `json:"authURLEqualFold,omitempty"` + AuthURLContainsFold *string `json:"authURLContainsFold,omitempty"` + + // "token_url" field predicates. + TokenURL *string `json:"tokenURL,omitempty"` + TokenURLNEQ *string `json:"tokenURLNEQ,omitempty"` + TokenURLIn []string `json:"tokenURLIn,omitempty"` + TokenURLNotIn []string `json:"tokenURLNotIn,omitempty"` + TokenURLGT *string `json:"tokenURLGT,omitempty"` + TokenURLGTE *string `json:"tokenURLGTE,omitempty"` + TokenURLLT *string `json:"tokenURLLT,omitempty"` + TokenURLLTE *string `json:"tokenURLLTE,omitempty"` + TokenURLContains *string `json:"tokenURLContains,omitempty"` + TokenURLHasPrefix *string `json:"tokenURLHasPrefix,omitempty"` + TokenURLHasSuffix *string `json:"tokenURLHasSuffix,omitempty"` + TokenURLEqualFold *string `json:"tokenURLEqualFold,omitempty"` + TokenURLContainsFold *string `json:"tokenURLContainsFold,omitempty"` + + // "auth_style" field predicates. + AuthStyle *customtypes.Uint8 `json:"authStyle,omitempty"` + AuthStyleNEQ *customtypes.Uint8 `json:"authStyleNEQ,omitempty"` + AuthStyleIn []customtypes.Uint8 `json:"authStyleIn,omitempty"` + AuthStyleNotIn []customtypes.Uint8 `json:"authStyleNotIn,omitempty"` + AuthStyleGT *customtypes.Uint8 `json:"authStyleGT,omitempty"` + AuthStyleGTE *customtypes.Uint8 `json:"authStyleGTE,omitempty"` + AuthStyleLT *customtypes.Uint8 `json:"authStyleLT,omitempty"` + AuthStyleLTE *customtypes.Uint8 `json:"authStyleLTE,omitempty"` + + // "info_url" field predicates. + InfoURL *string `json:"infoURL,omitempty"` + InfoURLNEQ *string `json:"infoURLNEQ,omitempty"` + InfoURLIn []string `json:"infoURLIn,omitempty"` + InfoURLNotIn []string `json:"infoURLNotIn,omitempty"` + InfoURLGT *string `json:"infoURLGT,omitempty"` + InfoURLGTE *string `json:"infoURLGTE,omitempty"` + InfoURLLT *string `json:"infoURLLT,omitempty"` + InfoURLLTE *string `json:"infoURLLTE,omitempty"` + InfoURLContains *string `json:"infoURLContains,omitempty"` + InfoURLHasPrefix *string `json:"infoURLHasPrefix,omitempty"` + InfoURLHasSuffix *string `json:"infoURLHasSuffix,omitempty"` + InfoURLEqualFold *string `json:"infoURLEqualFold,omitempty"` + InfoURLContainsFold *string `json:"infoURLContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OauthProviderWhereInput) AddPredicates(predicates ...predicate.OauthProvider) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OauthProviderWhereInput filter on the OauthProviderQuery builder. +func (i *OauthProviderWhereInput) Filter(q *OauthProviderQuery) (*OauthProviderQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOauthProviderWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOauthProviderWhereInput is returned in case the OauthProviderWhereInput is empty. +var ErrEmptyOauthProviderWhereInput = errors.New("generated: empty predicate OauthProviderWhereInput") + +// P returns a predicate for filtering oauthproviders. +// An error is returned if the input is empty or invalid. +func (i *OauthProviderWhereInput) P() (predicate.OauthProvider, error) { + var predicates []predicate.OauthProvider + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, oauthprovider.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.OauthProvider, 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, oauthprovider.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.OauthProvider, 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, oauthprovider.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, oauthprovider.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, oauthprovider.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, oauthprovider.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, oauthprovider.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, oauthprovider.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, oauthprovider.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, oauthprovider.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, oauthprovider.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, oauthprovider.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, oauthprovider.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, oauthprovider.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, oauthprovider.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, oauthprovider.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, oauthprovider.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, oauthprovider.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, oauthprovider.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, oauthprovider.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, oauthprovider.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, oauthprovider.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, oauthprovider.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, oauthprovider.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, oauthprovider.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, oauthprovider.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, oauthprovider.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, oauthprovider.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, oauthprovider.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, oauthprovider.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, oauthprovider.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, oauthprovider.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, oauthprovider.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, oauthprovider.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, oauthprovider.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, oauthprovider.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, oauthprovider.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, oauthprovider.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, oauthprovider.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, oauthprovider.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, oauthprovider.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, oauthprovider.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, oauthprovider.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, oauthprovider.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, oauthprovider.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, oauthprovider.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, oauthprovider.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, oauthprovider.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, oauthprovider.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, oauthprovider.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, oauthprovider.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, oauthprovider.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, oauthprovider.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, oauthprovider.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, oauthprovider.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, oauthprovider.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, oauthprovider.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, oauthprovider.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, oauthprovider.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, oauthprovider.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, oauthprovider.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, oauthprovider.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, oauthprovider.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, oauthprovider.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, oauthprovider.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, oauthprovider.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, oauthprovider.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, oauthprovider.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, oauthprovider.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, oauthprovider.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, oauthprovider.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, oauthprovider.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, oauthprovider.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, oauthprovider.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, oauthprovider.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, oauthprovider.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, oauthprovider.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, oauthprovider.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, oauthprovider.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, oauthprovider.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, oauthprovider.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, oauthprovider.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, oauthprovider.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, oauthprovider.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, oauthprovider.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, oauthprovider.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, oauthprovider.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, oauthprovider.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, oauthprovider.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, oauthprovider.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, oauthprovider.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, oauthprovider.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, oauthprovider.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, oauthprovider.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, oauthprovider.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, oauthprovider.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, oauthprovider.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, oauthprovider.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, oauthprovider.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, oauthprovider.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, oauthprovider.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, oauthprovider.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, oauthprovider.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, oauthprovider.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, oauthprovider.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, oauthprovider.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, oauthprovider.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, oauthprovider.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, oauthprovider.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, oauthprovider.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, oauthprovider.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, oauthprovider.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, oauthprovider.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, oauthprovider.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, oauthprovider.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, oauthprovider.NameContainsFold(*i.NameContainsFold)) + } + if i.ClientID != nil { + predicates = append(predicates, oauthprovider.ClientIDEQ(*i.ClientID)) + } + if i.ClientIDNEQ != nil { + predicates = append(predicates, oauthprovider.ClientIDNEQ(*i.ClientIDNEQ)) + } + if len(i.ClientIDIn) > 0 { + predicates = append(predicates, oauthprovider.ClientIDIn(i.ClientIDIn...)) + } + if len(i.ClientIDNotIn) > 0 { + predicates = append(predicates, oauthprovider.ClientIDNotIn(i.ClientIDNotIn...)) + } + if i.ClientIDGT != nil { + predicates = append(predicates, oauthprovider.ClientIDGT(*i.ClientIDGT)) + } + if i.ClientIDGTE != nil { + predicates = append(predicates, oauthprovider.ClientIDGTE(*i.ClientIDGTE)) + } + if i.ClientIDLT != nil { + predicates = append(predicates, oauthprovider.ClientIDLT(*i.ClientIDLT)) + } + if i.ClientIDLTE != nil { + predicates = append(predicates, oauthprovider.ClientIDLTE(*i.ClientIDLTE)) + } + if i.ClientIDContains != nil { + predicates = append(predicates, oauthprovider.ClientIDContains(*i.ClientIDContains)) + } + if i.ClientIDHasPrefix != nil { + predicates = append(predicates, oauthprovider.ClientIDHasPrefix(*i.ClientIDHasPrefix)) + } + if i.ClientIDHasSuffix != nil { + predicates = append(predicates, oauthprovider.ClientIDHasSuffix(*i.ClientIDHasSuffix)) + } + if i.ClientIDEqualFold != nil { + predicates = append(predicates, oauthprovider.ClientIDEqualFold(*i.ClientIDEqualFold)) + } + if i.ClientIDContainsFold != nil { + predicates = append(predicates, oauthprovider.ClientIDContainsFold(*i.ClientIDContainsFold)) + } + if i.ClientSecret != nil { + predicates = append(predicates, oauthprovider.ClientSecretEQ(*i.ClientSecret)) + } + if i.ClientSecretNEQ != nil { + predicates = append(predicates, oauthprovider.ClientSecretNEQ(*i.ClientSecretNEQ)) + } + if len(i.ClientSecretIn) > 0 { + predicates = append(predicates, oauthprovider.ClientSecretIn(i.ClientSecretIn...)) + } + if len(i.ClientSecretNotIn) > 0 { + predicates = append(predicates, oauthprovider.ClientSecretNotIn(i.ClientSecretNotIn...)) + } + if i.ClientSecretGT != nil { + predicates = append(predicates, oauthprovider.ClientSecretGT(*i.ClientSecretGT)) + } + if i.ClientSecretGTE != nil { + predicates = append(predicates, oauthprovider.ClientSecretGTE(*i.ClientSecretGTE)) + } + if i.ClientSecretLT != nil { + predicates = append(predicates, oauthprovider.ClientSecretLT(*i.ClientSecretLT)) + } + if i.ClientSecretLTE != nil { + predicates = append(predicates, oauthprovider.ClientSecretLTE(*i.ClientSecretLTE)) + } + if i.ClientSecretContains != nil { + predicates = append(predicates, oauthprovider.ClientSecretContains(*i.ClientSecretContains)) + } + if i.ClientSecretHasPrefix != nil { + predicates = append(predicates, oauthprovider.ClientSecretHasPrefix(*i.ClientSecretHasPrefix)) + } + if i.ClientSecretHasSuffix != nil { + predicates = append(predicates, oauthprovider.ClientSecretHasSuffix(*i.ClientSecretHasSuffix)) + } + if i.ClientSecretEqualFold != nil { + predicates = append(predicates, oauthprovider.ClientSecretEqualFold(*i.ClientSecretEqualFold)) + } + if i.ClientSecretContainsFold != nil { + predicates = append(predicates, oauthprovider.ClientSecretContainsFold(*i.ClientSecretContainsFold)) + } + if i.RedirectURL != nil { + predicates = append(predicates, oauthprovider.RedirectURLEQ(*i.RedirectURL)) + } + if i.RedirectURLNEQ != nil { + predicates = append(predicates, oauthprovider.RedirectURLNEQ(*i.RedirectURLNEQ)) + } + if len(i.RedirectURLIn) > 0 { + predicates = append(predicates, oauthprovider.RedirectURLIn(i.RedirectURLIn...)) + } + if len(i.RedirectURLNotIn) > 0 { + predicates = append(predicates, oauthprovider.RedirectURLNotIn(i.RedirectURLNotIn...)) + } + if i.RedirectURLGT != nil { + predicates = append(predicates, oauthprovider.RedirectURLGT(*i.RedirectURLGT)) + } + if i.RedirectURLGTE != nil { + predicates = append(predicates, oauthprovider.RedirectURLGTE(*i.RedirectURLGTE)) + } + if i.RedirectURLLT != nil { + predicates = append(predicates, oauthprovider.RedirectURLLT(*i.RedirectURLLT)) + } + if i.RedirectURLLTE != nil { + predicates = append(predicates, oauthprovider.RedirectURLLTE(*i.RedirectURLLTE)) + } + if i.RedirectURLContains != nil { + predicates = append(predicates, oauthprovider.RedirectURLContains(*i.RedirectURLContains)) + } + if i.RedirectURLHasPrefix != nil { + predicates = append(predicates, oauthprovider.RedirectURLHasPrefix(*i.RedirectURLHasPrefix)) + } + if i.RedirectURLHasSuffix != nil { + predicates = append(predicates, oauthprovider.RedirectURLHasSuffix(*i.RedirectURLHasSuffix)) + } + if i.RedirectURLEqualFold != nil { + predicates = append(predicates, oauthprovider.RedirectURLEqualFold(*i.RedirectURLEqualFold)) + } + if i.RedirectURLContainsFold != nil { + predicates = append(predicates, oauthprovider.RedirectURLContainsFold(*i.RedirectURLContainsFold)) + } + if i.Scopes != nil { + predicates = append(predicates, oauthprovider.ScopesEQ(*i.Scopes)) + } + if i.ScopesNEQ != nil { + predicates = append(predicates, oauthprovider.ScopesNEQ(*i.ScopesNEQ)) + } + if len(i.ScopesIn) > 0 { + predicates = append(predicates, oauthprovider.ScopesIn(i.ScopesIn...)) + } + if len(i.ScopesNotIn) > 0 { + predicates = append(predicates, oauthprovider.ScopesNotIn(i.ScopesNotIn...)) + } + if i.ScopesGT != nil { + predicates = append(predicates, oauthprovider.ScopesGT(*i.ScopesGT)) + } + if i.ScopesGTE != nil { + predicates = append(predicates, oauthprovider.ScopesGTE(*i.ScopesGTE)) + } + if i.ScopesLT != nil { + predicates = append(predicates, oauthprovider.ScopesLT(*i.ScopesLT)) + } + if i.ScopesLTE != nil { + predicates = append(predicates, oauthprovider.ScopesLTE(*i.ScopesLTE)) + } + if i.ScopesContains != nil { + predicates = append(predicates, oauthprovider.ScopesContains(*i.ScopesContains)) + } + if i.ScopesHasPrefix != nil { + predicates = append(predicates, oauthprovider.ScopesHasPrefix(*i.ScopesHasPrefix)) + } + if i.ScopesHasSuffix != nil { + predicates = append(predicates, oauthprovider.ScopesHasSuffix(*i.ScopesHasSuffix)) + } + if i.ScopesEqualFold != nil { + predicates = append(predicates, oauthprovider.ScopesEqualFold(*i.ScopesEqualFold)) + } + if i.ScopesContainsFold != nil { + predicates = append(predicates, oauthprovider.ScopesContainsFold(*i.ScopesContainsFold)) + } + if i.AuthURL != nil { + predicates = append(predicates, oauthprovider.AuthURLEQ(*i.AuthURL)) + } + if i.AuthURLNEQ != nil { + predicates = append(predicates, oauthprovider.AuthURLNEQ(*i.AuthURLNEQ)) + } + if len(i.AuthURLIn) > 0 { + predicates = append(predicates, oauthprovider.AuthURLIn(i.AuthURLIn...)) + } + if len(i.AuthURLNotIn) > 0 { + predicates = append(predicates, oauthprovider.AuthURLNotIn(i.AuthURLNotIn...)) + } + if i.AuthURLGT != nil { + predicates = append(predicates, oauthprovider.AuthURLGT(*i.AuthURLGT)) + } + if i.AuthURLGTE != nil { + predicates = append(predicates, oauthprovider.AuthURLGTE(*i.AuthURLGTE)) + } + if i.AuthURLLT != nil { + predicates = append(predicates, oauthprovider.AuthURLLT(*i.AuthURLLT)) + } + if i.AuthURLLTE != nil { + predicates = append(predicates, oauthprovider.AuthURLLTE(*i.AuthURLLTE)) + } + if i.AuthURLContains != nil { + predicates = append(predicates, oauthprovider.AuthURLContains(*i.AuthURLContains)) + } + if i.AuthURLHasPrefix != nil { + predicates = append(predicates, oauthprovider.AuthURLHasPrefix(*i.AuthURLHasPrefix)) + } + if i.AuthURLHasSuffix != nil { + predicates = append(predicates, oauthprovider.AuthURLHasSuffix(*i.AuthURLHasSuffix)) + } + if i.AuthURLEqualFold != nil { + predicates = append(predicates, oauthprovider.AuthURLEqualFold(*i.AuthURLEqualFold)) + } + if i.AuthURLContainsFold != nil { + predicates = append(predicates, oauthprovider.AuthURLContainsFold(*i.AuthURLContainsFold)) + } + if i.TokenURL != nil { + predicates = append(predicates, oauthprovider.TokenURLEQ(*i.TokenURL)) + } + if i.TokenURLNEQ != nil { + predicates = append(predicates, oauthprovider.TokenURLNEQ(*i.TokenURLNEQ)) + } + if len(i.TokenURLIn) > 0 { + predicates = append(predicates, oauthprovider.TokenURLIn(i.TokenURLIn...)) + } + if len(i.TokenURLNotIn) > 0 { + predicates = append(predicates, oauthprovider.TokenURLNotIn(i.TokenURLNotIn...)) + } + if i.TokenURLGT != nil { + predicates = append(predicates, oauthprovider.TokenURLGT(*i.TokenURLGT)) + } + if i.TokenURLGTE != nil { + predicates = append(predicates, oauthprovider.TokenURLGTE(*i.TokenURLGTE)) + } + if i.TokenURLLT != nil { + predicates = append(predicates, oauthprovider.TokenURLLT(*i.TokenURLLT)) + } + if i.TokenURLLTE != nil { + predicates = append(predicates, oauthprovider.TokenURLLTE(*i.TokenURLLTE)) + } + if i.TokenURLContains != nil { + predicates = append(predicates, oauthprovider.TokenURLContains(*i.TokenURLContains)) + } + if i.TokenURLHasPrefix != nil { + predicates = append(predicates, oauthprovider.TokenURLHasPrefix(*i.TokenURLHasPrefix)) + } + if i.TokenURLHasSuffix != nil { + predicates = append(predicates, oauthprovider.TokenURLHasSuffix(*i.TokenURLHasSuffix)) + } + if i.TokenURLEqualFold != nil { + predicates = append(predicates, oauthprovider.TokenURLEqualFold(*i.TokenURLEqualFold)) + } + if i.TokenURLContainsFold != nil { + predicates = append(predicates, oauthprovider.TokenURLContainsFold(*i.TokenURLContainsFold)) + } + if i.AuthStyle != nil { + predicates = append(predicates, oauthprovider.AuthStyleEQ(*i.AuthStyle)) + } + if i.AuthStyleNEQ != nil { + predicates = append(predicates, oauthprovider.AuthStyleNEQ(*i.AuthStyleNEQ)) + } + if len(i.AuthStyleIn) > 0 { + predicates = append(predicates, oauthprovider.AuthStyleIn(i.AuthStyleIn...)) + } + if len(i.AuthStyleNotIn) > 0 { + predicates = append(predicates, oauthprovider.AuthStyleNotIn(i.AuthStyleNotIn...)) + } + if i.AuthStyleGT != nil { + predicates = append(predicates, oauthprovider.AuthStyleGT(*i.AuthStyleGT)) + } + if i.AuthStyleGTE != nil { + predicates = append(predicates, oauthprovider.AuthStyleGTE(*i.AuthStyleGTE)) + } + if i.AuthStyleLT != nil { + predicates = append(predicates, oauthprovider.AuthStyleLT(*i.AuthStyleLT)) + } + if i.AuthStyleLTE != nil { + predicates = append(predicates, oauthprovider.AuthStyleLTE(*i.AuthStyleLTE)) + } + if i.InfoURL != nil { + predicates = append(predicates, oauthprovider.InfoURLEQ(*i.InfoURL)) + } + if i.InfoURLNEQ != nil { + predicates = append(predicates, oauthprovider.InfoURLNEQ(*i.InfoURLNEQ)) + } + if len(i.InfoURLIn) > 0 { + predicates = append(predicates, oauthprovider.InfoURLIn(i.InfoURLIn...)) + } + if len(i.InfoURLNotIn) > 0 { + predicates = append(predicates, oauthprovider.InfoURLNotIn(i.InfoURLNotIn...)) + } + if i.InfoURLGT != nil { + predicates = append(predicates, oauthprovider.InfoURLGT(*i.InfoURLGT)) + } + if i.InfoURLGTE != nil { + predicates = append(predicates, oauthprovider.InfoURLGTE(*i.InfoURLGTE)) + } + if i.InfoURLLT != nil { + predicates = append(predicates, oauthprovider.InfoURLLT(*i.InfoURLLT)) + } + if i.InfoURLLTE != nil { + predicates = append(predicates, oauthprovider.InfoURLLTE(*i.InfoURLLTE)) + } + if i.InfoURLContains != nil { + predicates = append(predicates, oauthprovider.InfoURLContains(*i.InfoURLContains)) + } + if i.InfoURLHasPrefix != nil { + predicates = append(predicates, oauthprovider.InfoURLHasPrefix(*i.InfoURLHasPrefix)) + } + if i.InfoURLHasSuffix != nil { + predicates = append(predicates, oauthprovider.InfoURLHasSuffix(*i.InfoURLHasSuffix)) + } + if i.InfoURLEqualFold != nil { + predicates = append(predicates, oauthprovider.InfoURLEqualFold(*i.InfoURLEqualFold)) + } + if i.InfoURLContainsFold != nil { + predicates = append(predicates, oauthprovider.InfoURLContainsFold(*i.InfoURLContainsFold)) + } + + if i.HasOwner != nil { + p := oauthprovider.HasOwner() + if !*i.HasOwner { + p = oauthprovider.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, oauthprovider.HasOwnerWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyOauthProviderWhereInput + case 1: + return predicates[0], nil + default: + return oauthprovider.And(predicates...), nil + } +} + +// OauthProviderHistoryWhereInput represents a where input for filtering OauthProviderHistory queries. +type OauthProviderHistoryWhereInput struct { + Predicates []predicate.OauthProviderHistory `json:"-"` + Not *OauthProviderHistoryWhereInput `json:"not,omitempty"` + Or []*OauthProviderHistoryWhereInput `json:"or,omitempty"` + And []*OauthProviderHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "client_id" field predicates. + ClientID *string `json:"clientID,omitempty"` + ClientIDNEQ *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGT *string `json:"clientIDGT,omitempty"` + ClientIDGTE *string `json:"clientIDGTE,omitempty"` + ClientIDLT *string `json:"clientIDLT,omitempty"` + ClientIDLTE *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + + // "client_secret" field predicates. + ClientSecret *string `json:"clientSecret,omitempty"` + ClientSecretNEQ *string `json:"clientSecretNEQ,omitempty"` + ClientSecretIn []string `json:"clientSecretIn,omitempty"` + ClientSecretNotIn []string `json:"clientSecretNotIn,omitempty"` + ClientSecretGT *string `json:"clientSecretGT,omitempty"` + ClientSecretGTE *string `json:"clientSecretGTE,omitempty"` + ClientSecretLT *string `json:"clientSecretLT,omitempty"` + ClientSecretLTE *string `json:"clientSecretLTE,omitempty"` + ClientSecretContains *string `json:"clientSecretContains,omitempty"` + ClientSecretHasPrefix *string `json:"clientSecretHasPrefix,omitempty"` + ClientSecretHasSuffix *string `json:"clientSecretHasSuffix,omitempty"` + ClientSecretEqualFold *string `json:"clientSecretEqualFold,omitempty"` + ClientSecretContainsFold *string `json:"clientSecretContainsFold,omitempty"` + + // "redirect_url" field predicates. + RedirectURL *string `json:"redirectURL,omitempty"` + RedirectURLNEQ *string `json:"redirectURLNEQ,omitempty"` + RedirectURLIn []string `json:"redirectURLIn,omitempty"` + RedirectURLNotIn []string `json:"redirectURLNotIn,omitempty"` + RedirectURLGT *string `json:"redirectURLGT,omitempty"` + RedirectURLGTE *string `json:"redirectURLGTE,omitempty"` + RedirectURLLT *string `json:"redirectURLLT,omitempty"` + RedirectURLLTE *string `json:"redirectURLLTE,omitempty"` + RedirectURLContains *string `json:"redirectURLContains,omitempty"` + RedirectURLHasPrefix *string `json:"redirectURLHasPrefix,omitempty"` + RedirectURLHasSuffix *string `json:"redirectURLHasSuffix,omitempty"` + RedirectURLEqualFold *string `json:"redirectURLEqualFold,omitempty"` + RedirectURLContainsFold *string `json:"redirectURLContainsFold,omitempty"` + + // "scopes" field predicates. + Scopes *string `json:"scopes,omitempty"` + ScopesNEQ *string `json:"scopesNEQ,omitempty"` + ScopesIn []string `json:"scopesIn,omitempty"` + ScopesNotIn []string `json:"scopesNotIn,omitempty"` + ScopesGT *string `json:"scopesGT,omitempty"` + ScopesGTE *string `json:"scopesGTE,omitempty"` + ScopesLT *string `json:"scopesLT,omitempty"` + ScopesLTE *string `json:"scopesLTE,omitempty"` + ScopesContains *string `json:"scopesContains,omitempty"` + ScopesHasPrefix *string `json:"scopesHasPrefix,omitempty"` + ScopesHasSuffix *string `json:"scopesHasSuffix,omitempty"` + ScopesEqualFold *string `json:"scopesEqualFold,omitempty"` + ScopesContainsFold *string `json:"scopesContainsFold,omitempty"` + + // "auth_url" field predicates. + AuthURL *string `json:"authURL,omitempty"` + AuthURLNEQ *string `json:"authURLNEQ,omitempty"` + AuthURLIn []string `json:"authURLIn,omitempty"` + AuthURLNotIn []string `json:"authURLNotIn,omitempty"` + AuthURLGT *string `json:"authURLGT,omitempty"` + AuthURLGTE *string `json:"authURLGTE,omitempty"` + AuthURLLT *string `json:"authURLLT,omitempty"` + AuthURLLTE *string `json:"authURLLTE,omitempty"` + AuthURLContains *string `json:"authURLContains,omitempty"` + AuthURLHasPrefix *string `json:"authURLHasPrefix,omitempty"` + AuthURLHasSuffix *string `json:"authURLHasSuffix,omitempty"` + AuthURLEqualFold *string `json:"authURLEqualFold,omitempty"` + AuthURLContainsFold *string `json:"authURLContainsFold,omitempty"` + + // "token_url" field predicates. + TokenURL *string `json:"tokenURL,omitempty"` + TokenURLNEQ *string `json:"tokenURLNEQ,omitempty"` + TokenURLIn []string `json:"tokenURLIn,omitempty"` + TokenURLNotIn []string `json:"tokenURLNotIn,omitempty"` + TokenURLGT *string `json:"tokenURLGT,omitempty"` + TokenURLGTE *string `json:"tokenURLGTE,omitempty"` + TokenURLLT *string `json:"tokenURLLT,omitempty"` + TokenURLLTE *string `json:"tokenURLLTE,omitempty"` + TokenURLContains *string `json:"tokenURLContains,omitempty"` + TokenURLHasPrefix *string `json:"tokenURLHasPrefix,omitempty"` + TokenURLHasSuffix *string `json:"tokenURLHasSuffix,omitempty"` + TokenURLEqualFold *string `json:"tokenURLEqualFold,omitempty"` + TokenURLContainsFold *string `json:"tokenURLContainsFold,omitempty"` + + // "auth_style" field predicates. + AuthStyle *customtypes.Uint8 `json:"authStyle,omitempty"` + AuthStyleNEQ *customtypes.Uint8 `json:"authStyleNEQ,omitempty"` + AuthStyleIn []customtypes.Uint8 `json:"authStyleIn,omitempty"` + AuthStyleNotIn []customtypes.Uint8 `json:"authStyleNotIn,omitempty"` + AuthStyleGT *customtypes.Uint8 `json:"authStyleGT,omitempty"` + AuthStyleGTE *customtypes.Uint8 `json:"authStyleGTE,omitempty"` + AuthStyleLT *customtypes.Uint8 `json:"authStyleLT,omitempty"` + AuthStyleLTE *customtypes.Uint8 `json:"authStyleLTE,omitempty"` + + // "info_url" field predicates. + InfoURL *string `json:"infoURL,omitempty"` + InfoURLNEQ *string `json:"infoURLNEQ,omitempty"` + InfoURLIn []string `json:"infoURLIn,omitempty"` + InfoURLNotIn []string `json:"infoURLNotIn,omitempty"` + InfoURLGT *string `json:"infoURLGT,omitempty"` + InfoURLGTE *string `json:"infoURLGTE,omitempty"` + InfoURLLT *string `json:"infoURLLT,omitempty"` + InfoURLLTE *string `json:"infoURLLTE,omitempty"` + InfoURLContains *string `json:"infoURLContains,omitempty"` + InfoURLHasPrefix *string `json:"infoURLHasPrefix,omitempty"` + InfoURLHasSuffix *string `json:"infoURLHasSuffix,omitempty"` + InfoURLEqualFold *string `json:"infoURLEqualFold,omitempty"` + InfoURLContainsFold *string `json:"infoURLContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OauthProviderHistoryWhereInput) AddPredicates(predicates ...predicate.OauthProviderHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OauthProviderHistoryWhereInput filter on the OauthProviderHistoryQuery builder. +func (i *OauthProviderHistoryWhereInput) Filter(q *OauthProviderHistoryQuery) (*OauthProviderHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOauthProviderHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOauthProviderHistoryWhereInput is returned in case the OauthProviderHistoryWhereInput is empty. +var ErrEmptyOauthProviderHistoryWhereInput = errors.New("generated: empty predicate OauthProviderHistoryWhereInput") + +// P returns a predicate for filtering oauthproviderhistories. +// An error is returned if the input is empty or invalid. +func (i *OauthProviderHistoryWhereInput) P() (predicate.OauthProviderHistory, error) { + var predicates []predicate.OauthProviderHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, oauthproviderhistory.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.OauthProviderHistory, 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, oauthproviderhistory.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.OauthProviderHistory, 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, oauthproviderhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, oauthproviderhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, oauthproviderhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, oauthproviderhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, oauthproviderhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, oauthproviderhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, oauthproviderhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, oauthproviderhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, oauthproviderhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, oauthproviderhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, oauthproviderhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, oauthproviderhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, oauthproviderhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, oauthproviderhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, oauthproviderhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, oauthproviderhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, oauthproviderhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, oauthproviderhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, oauthproviderhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, oauthproviderhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, oauthproviderhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, oauthproviderhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, oauthproviderhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, oauthproviderhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, oauthproviderhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, oauthproviderhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, oauthproviderhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, oauthproviderhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, oauthproviderhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, oauthproviderhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, oauthproviderhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, oauthproviderhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, oauthproviderhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, oauthproviderhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, oauthproviderhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, oauthproviderhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, oauthproviderhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, oauthproviderhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, oauthproviderhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, oauthproviderhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, oauthproviderhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, oauthproviderhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, oauthproviderhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, oauthproviderhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, oauthproviderhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, oauthproviderhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, oauthproviderhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, oauthproviderhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, oauthproviderhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, oauthproviderhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, oauthproviderhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, oauthproviderhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, oauthproviderhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, oauthproviderhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, oauthproviderhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, oauthproviderhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, oauthproviderhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, oauthproviderhistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, oauthproviderhistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, oauthproviderhistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, oauthproviderhistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, oauthproviderhistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, oauthproviderhistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, oauthproviderhistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, oauthproviderhistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, oauthproviderhistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, oauthproviderhistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, oauthproviderhistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.NameContainsFold(*i.NameContainsFold)) + } + if i.ClientID != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDEQ(*i.ClientID)) + } + if i.ClientIDNEQ != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDNEQ(*i.ClientIDNEQ)) + } + if len(i.ClientIDIn) > 0 { + predicates = append(predicates, oauthproviderhistory.ClientIDIn(i.ClientIDIn...)) + } + if len(i.ClientIDNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.ClientIDNotIn(i.ClientIDNotIn...)) + } + if i.ClientIDGT != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDGT(*i.ClientIDGT)) + } + if i.ClientIDGTE != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDGTE(*i.ClientIDGTE)) + } + if i.ClientIDLT != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDLT(*i.ClientIDLT)) + } + if i.ClientIDLTE != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDLTE(*i.ClientIDLTE)) + } + if i.ClientIDContains != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDContains(*i.ClientIDContains)) + } + if i.ClientIDHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDHasPrefix(*i.ClientIDHasPrefix)) + } + if i.ClientIDHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDHasSuffix(*i.ClientIDHasSuffix)) + } + if i.ClientIDEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDEqualFold(*i.ClientIDEqualFold)) + } + if i.ClientIDContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.ClientIDContainsFold(*i.ClientIDContainsFold)) + } + if i.ClientSecret != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretEQ(*i.ClientSecret)) + } + if i.ClientSecretNEQ != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretNEQ(*i.ClientSecretNEQ)) + } + if len(i.ClientSecretIn) > 0 { + predicates = append(predicates, oauthproviderhistory.ClientSecretIn(i.ClientSecretIn...)) + } + if len(i.ClientSecretNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.ClientSecretNotIn(i.ClientSecretNotIn...)) + } + if i.ClientSecretGT != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretGT(*i.ClientSecretGT)) + } + if i.ClientSecretGTE != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretGTE(*i.ClientSecretGTE)) + } + if i.ClientSecretLT != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretLT(*i.ClientSecretLT)) + } + if i.ClientSecretLTE != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretLTE(*i.ClientSecretLTE)) + } + if i.ClientSecretContains != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretContains(*i.ClientSecretContains)) + } + if i.ClientSecretHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretHasPrefix(*i.ClientSecretHasPrefix)) + } + if i.ClientSecretHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretHasSuffix(*i.ClientSecretHasSuffix)) + } + if i.ClientSecretEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretEqualFold(*i.ClientSecretEqualFold)) + } + if i.ClientSecretContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.ClientSecretContainsFold(*i.ClientSecretContainsFold)) + } + if i.RedirectURL != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLEQ(*i.RedirectURL)) + } + if i.RedirectURLNEQ != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLNEQ(*i.RedirectURLNEQ)) + } + if len(i.RedirectURLIn) > 0 { + predicates = append(predicates, oauthproviderhistory.RedirectURLIn(i.RedirectURLIn...)) + } + if len(i.RedirectURLNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.RedirectURLNotIn(i.RedirectURLNotIn...)) + } + if i.RedirectURLGT != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLGT(*i.RedirectURLGT)) + } + if i.RedirectURLGTE != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLGTE(*i.RedirectURLGTE)) + } + if i.RedirectURLLT != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLLT(*i.RedirectURLLT)) + } + if i.RedirectURLLTE != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLLTE(*i.RedirectURLLTE)) + } + if i.RedirectURLContains != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLContains(*i.RedirectURLContains)) + } + if i.RedirectURLHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLHasPrefix(*i.RedirectURLHasPrefix)) + } + if i.RedirectURLHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLHasSuffix(*i.RedirectURLHasSuffix)) + } + if i.RedirectURLEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLEqualFold(*i.RedirectURLEqualFold)) + } + if i.RedirectURLContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.RedirectURLContainsFold(*i.RedirectURLContainsFold)) + } + if i.Scopes != nil { + predicates = append(predicates, oauthproviderhistory.ScopesEQ(*i.Scopes)) + } + if i.ScopesNEQ != nil { + predicates = append(predicates, oauthproviderhistory.ScopesNEQ(*i.ScopesNEQ)) + } + if len(i.ScopesIn) > 0 { + predicates = append(predicates, oauthproviderhistory.ScopesIn(i.ScopesIn...)) + } + if len(i.ScopesNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.ScopesNotIn(i.ScopesNotIn...)) + } + if i.ScopesGT != nil { + predicates = append(predicates, oauthproviderhistory.ScopesGT(*i.ScopesGT)) + } + if i.ScopesGTE != nil { + predicates = append(predicates, oauthproviderhistory.ScopesGTE(*i.ScopesGTE)) + } + if i.ScopesLT != nil { + predicates = append(predicates, oauthproviderhistory.ScopesLT(*i.ScopesLT)) + } + if i.ScopesLTE != nil { + predicates = append(predicates, oauthproviderhistory.ScopesLTE(*i.ScopesLTE)) + } + if i.ScopesContains != nil { + predicates = append(predicates, oauthproviderhistory.ScopesContains(*i.ScopesContains)) + } + if i.ScopesHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.ScopesHasPrefix(*i.ScopesHasPrefix)) + } + if i.ScopesHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.ScopesHasSuffix(*i.ScopesHasSuffix)) + } + if i.ScopesEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.ScopesEqualFold(*i.ScopesEqualFold)) + } + if i.ScopesContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.ScopesContainsFold(*i.ScopesContainsFold)) + } + if i.AuthURL != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLEQ(*i.AuthURL)) + } + if i.AuthURLNEQ != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLNEQ(*i.AuthURLNEQ)) + } + if len(i.AuthURLIn) > 0 { + predicates = append(predicates, oauthproviderhistory.AuthURLIn(i.AuthURLIn...)) + } + if len(i.AuthURLNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.AuthURLNotIn(i.AuthURLNotIn...)) + } + if i.AuthURLGT != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLGT(*i.AuthURLGT)) + } + if i.AuthURLGTE != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLGTE(*i.AuthURLGTE)) + } + if i.AuthURLLT != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLLT(*i.AuthURLLT)) + } + if i.AuthURLLTE != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLLTE(*i.AuthURLLTE)) + } + if i.AuthURLContains != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLContains(*i.AuthURLContains)) + } + if i.AuthURLHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLHasPrefix(*i.AuthURLHasPrefix)) + } + if i.AuthURLHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLHasSuffix(*i.AuthURLHasSuffix)) + } + if i.AuthURLEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLEqualFold(*i.AuthURLEqualFold)) + } + if i.AuthURLContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.AuthURLContainsFold(*i.AuthURLContainsFold)) + } + if i.TokenURL != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLEQ(*i.TokenURL)) + } + if i.TokenURLNEQ != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLNEQ(*i.TokenURLNEQ)) + } + if len(i.TokenURLIn) > 0 { + predicates = append(predicates, oauthproviderhistory.TokenURLIn(i.TokenURLIn...)) + } + if len(i.TokenURLNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.TokenURLNotIn(i.TokenURLNotIn...)) + } + if i.TokenURLGT != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLGT(*i.TokenURLGT)) + } + if i.TokenURLGTE != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLGTE(*i.TokenURLGTE)) + } + if i.TokenURLLT != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLLT(*i.TokenURLLT)) + } + if i.TokenURLLTE != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLLTE(*i.TokenURLLTE)) + } + if i.TokenURLContains != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLContains(*i.TokenURLContains)) + } + if i.TokenURLHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLHasPrefix(*i.TokenURLHasPrefix)) + } + if i.TokenURLHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLHasSuffix(*i.TokenURLHasSuffix)) + } + if i.TokenURLEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLEqualFold(*i.TokenURLEqualFold)) + } + if i.TokenURLContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.TokenURLContainsFold(*i.TokenURLContainsFold)) + } + if i.AuthStyle != nil { + predicates = append(predicates, oauthproviderhistory.AuthStyleEQ(*i.AuthStyle)) + } + if i.AuthStyleNEQ != nil { + predicates = append(predicates, oauthproviderhistory.AuthStyleNEQ(*i.AuthStyleNEQ)) + } + if len(i.AuthStyleIn) > 0 { + predicates = append(predicates, oauthproviderhistory.AuthStyleIn(i.AuthStyleIn...)) + } + if len(i.AuthStyleNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.AuthStyleNotIn(i.AuthStyleNotIn...)) + } + if i.AuthStyleGT != nil { + predicates = append(predicates, oauthproviderhistory.AuthStyleGT(*i.AuthStyleGT)) + } + if i.AuthStyleGTE != nil { + predicates = append(predicates, oauthproviderhistory.AuthStyleGTE(*i.AuthStyleGTE)) + } + if i.AuthStyleLT != nil { + predicates = append(predicates, oauthproviderhistory.AuthStyleLT(*i.AuthStyleLT)) + } + if i.AuthStyleLTE != nil { + predicates = append(predicates, oauthproviderhistory.AuthStyleLTE(*i.AuthStyleLTE)) + } + if i.InfoURL != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLEQ(*i.InfoURL)) + } + if i.InfoURLNEQ != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLNEQ(*i.InfoURLNEQ)) + } + if len(i.InfoURLIn) > 0 { + predicates = append(predicates, oauthproviderhistory.InfoURLIn(i.InfoURLIn...)) + } + if len(i.InfoURLNotIn) > 0 { + predicates = append(predicates, oauthproviderhistory.InfoURLNotIn(i.InfoURLNotIn...)) + } + if i.InfoURLGT != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLGT(*i.InfoURLGT)) + } + if i.InfoURLGTE != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLGTE(*i.InfoURLGTE)) + } + if i.InfoURLLT != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLLT(*i.InfoURLLT)) + } + if i.InfoURLLTE != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLLTE(*i.InfoURLLTE)) + } + if i.InfoURLContains != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLContains(*i.InfoURLContains)) + } + if i.InfoURLHasPrefix != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLHasPrefix(*i.InfoURLHasPrefix)) + } + if i.InfoURLHasSuffix != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLHasSuffix(*i.InfoURLHasSuffix)) + } + if i.InfoURLEqualFold != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLEqualFold(*i.InfoURLEqualFold)) + } + if i.InfoURLContainsFold != nil { + predicates = append(predicates, oauthproviderhistory.InfoURLContainsFold(*i.InfoURLContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyOauthProviderHistoryWhereInput + case 1: + return predicates[0], nil + default: + return oauthproviderhistory.And(predicates...), nil + } +} + +// OhAuthTooTokenWhereInput represents a where input for filtering OhAuthTooToken queries. +type OhAuthTooTokenWhereInput struct { + Predicates []predicate.OhAuthTooToken `json:"-"` + Not *OhAuthTooTokenWhereInput `json:"not,omitempty"` + Or []*OhAuthTooTokenWhereInput `json:"or,omitempty"` + And []*OhAuthTooTokenWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "client_id" field predicates. + ClientID *string `json:"clientID,omitempty"` + ClientIDNEQ *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGT *string `json:"clientIDGT,omitempty"` + ClientIDGTE *string `json:"clientIDGTE,omitempty"` + ClientIDLT *string `json:"clientIDLT,omitempty"` + ClientIDLTE *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + + // "nonce" field predicates. + Nonce *string `json:"nonce,omitempty"` + NonceNEQ *string `json:"nonceNEQ,omitempty"` + NonceIn []string `json:"nonceIn,omitempty"` + NonceNotIn []string `json:"nonceNotIn,omitempty"` + NonceGT *string `json:"nonceGT,omitempty"` + NonceGTE *string `json:"nonceGTE,omitempty"` + NonceLT *string `json:"nonceLT,omitempty"` + NonceLTE *string `json:"nonceLTE,omitempty"` + NonceContains *string `json:"nonceContains,omitempty"` + NonceHasPrefix *string `json:"nonceHasPrefix,omitempty"` + NonceHasSuffix *string `json:"nonceHasSuffix,omitempty"` + NonceEqualFold *string `json:"nonceEqualFold,omitempty"` + NonceContainsFold *string `json:"nonceContainsFold,omitempty"` + + // "claims_user_id" field predicates. + ClaimsUserID *string `json:"claimsUserID,omitempty"` + ClaimsUserIDNEQ *string `json:"claimsUserIDNEQ,omitempty"` + ClaimsUserIDIn []string `json:"claimsUserIDIn,omitempty"` + ClaimsUserIDNotIn []string `json:"claimsUserIDNotIn,omitempty"` + ClaimsUserIDGT *string `json:"claimsUserIDGT,omitempty"` + ClaimsUserIDGTE *string `json:"claimsUserIDGTE,omitempty"` + ClaimsUserIDLT *string `json:"claimsUserIDLT,omitempty"` + ClaimsUserIDLTE *string `json:"claimsUserIDLTE,omitempty"` + ClaimsUserIDContains *string `json:"claimsUserIDContains,omitempty"` + ClaimsUserIDHasPrefix *string `json:"claimsUserIDHasPrefix,omitempty"` + ClaimsUserIDHasSuffix *string `json:"claimsUserIDHasSuffix,omitempty"` + ClaimsUserIDEqualFold *string `json:"claimsUserIDEqualFold,omitempty"` + ClaimsUserIDContainsFold *string `json:"claimsUserIDContainsFold,omitempty"` + + // "claims_username" field predicates. + ClaimsUsername *string `json:"claimsUsername,omitempty"` + ClaimsUsernameNEQ *string `json:"claimsUsernameNEQ,omitempty"` + ClaimsUsernameIn []string `json:"claimsUsernameIn,omitempty"` + ClaimsUsernameNotIn []string `json:"claimsUsernameNotIn,omitempty"` + ClaimsUsernameGT *string `json:"claimsUsernameGT,omitempty"` + ClaimsUsernameGTE *string `json:"claimsUsernameGTE,omitempty"` + ClaimsUsernameLT *string `json:"claimsUsernameLT,omitempty"` + ClaimsUsernameLTE *string `json:"claimsUsernameLTE,omitempty"` + ClaimsUsernameContains *string `json:"claimsUsernameContains,omitempty"` + ClaimsUsernameHasPrefix *string `json:"claimsUsernameHasPrefix,omitempty"` + ClaimsUsernameHasSuffix *string `json:"claimsUsernameHasSuffix,omitempty"` + ClaimsUsernameEqualFold *string `json:"claimsUsernameEqualFold,omitempty"` + ClaimsUsernameContainsFold *string `json:"claimsUsernameContainsFold,omitempty"` + + // "claims_email" field predicates. + ClaimsEmail *string `json:"claimsEmail,omitempty"` + ClaimsEmailNEQ *string `json:"claimsEmailNEQ,omitempty"` + ClaimsEmailIn []string `json:"claimsEmailIn,omitempty"` + ClaimsEmailNotIn []string `json:"claimsEmailNotIn,omitempty"` + ClaimsEmailGT *string `json:"claimsEmailGT,omitempty"` + ClaimsEmailGTE *string `json:"claimsEmailGTE,omitempty"` + ClaimsEmailLT *string `json:"claimsEmailLT,omitempty"` + ClaimsEmailLTE *string `json:"claimsEmailLTE,omitempty"` + ClaimsEmailContains *string `json:"claimsEmailContains,omitempty"` + ClaimsEmailHasPrefix *string `json:"claimsEmailHasPrefix,omitempty"` + ClaimsEmailHasSuffix *string `json:"claimsEmailHasSuffix,omitempty"` + ClaimsEmailEqualFold *string `json:"claimsEmailEqualFold,omitempty"` + ClaimsEmailContainsFold *string `json:"claimsEmailContainsFold,omitempty"` + + // "claims_email_verified" field predicates. + ClaimsEmailVerified *bool `json:"claimsEmailVerified,omitempty"` + ClaimsEmailVerifiedNEQ *bool `json:"claimsEmailVerifiedNEQ,omitempty"` + + // "claims_preferred_username" field predicates. + ClaimsPreferredUsername *string `json:"claimsPreferredUsername,omitempty"` + ClaimsPreferredUsernameNEQ *string `json:"claimsPreferredUsernameNEQ,omitempty"` + ClaimsPreferredUsernameIn []string `json:"claimsPreferredUsernameIn,omitempty"` + ClaimsPreferredUsernameNotIn []string `json:"claimsPreferredUsernameNotIn,omitempty"` + ClaimsPreferredUsernameGT *string `json:"claimsPreferredUsernameGT,omitempty"` + ClaimsPreferredUsernameGTE *string `json:"claimsPreferredUsernameGTE,omitempty"` + ClaimsPreferredUsernameLT *string `json:"claimsPreferredUsernameLT,omitempty"` + ClaimsPreferredUsernameLTE *string `json:"claimsPreferredUsernameLTE,omitempty"` + ClaimsPreferredUsernameContains *string `json:"claimsPreferredUsernameContains,omitempty"` + ClaimsPreferredUsernameHasPrefix *string `json:"claimsPreferredUsernameHasPrefix,omitempty"` + ClaimsPreferredUsernameHasSuffix *string `json:"claimsPreferredUsernameHasSuffix,omitempty"` + ClaimsPreferredUsernameEqualFold *string `json:"claimsPreferredUsernameEqualFold,omitempty"` + ClaimsPreferredUsernameContainsFold *string `json:"claimsPreferredUsernameContainsFold,omitempty"` + + // "connector_id" field predicates. + ConnectorID *string `json:"connectorID,omitempty"` + ConnectorIDNEQ *string `json:"connectorIDNEQ,omitempty"` + ConnectorIDIn []string `json:"connectorIDIn,omitempty"` + ConnectorIDNotIn []string `json:"connectorIDNotIn,omitempty"` + ConnectorIDGT *string `json:"connectorIDGT,omitempty"` + ConnectorIDGTE *string `json:"connectorIDGTE,omitempty"` + ConnectorIDLT *string `json:"connectorIDLT,omitempty"` + ConnectorIDLTE *string `json:"connectorIDLTE,omitempty"` + ConnectorIDContains *string `json:"connectorIDContains,omitempty"` + ConnectorIDHasPrefix *string `json:"connectorIDHasPrefix,omitempty"` + ConnectorIDHasSuffix *string `json:"connectorIDHasSuffix,omitempty"` + ConnectorIDEqualFold *string `json:"connectorIDEqualFold,omitempty"` + ConnectorIDContainsFold *string `json:"connectorIDContainsFold,omitempty"` + + // "last_used" field predicates. + LastUsed *time.Time `json:"lastUsed,omitempty"` + LastUsedNEQ *time.Time `json:"lastUsedNEQ,omitempty"` + LastUsedIn []time.Time `json:"lastUsedIn,omitempty"` + LastUsedNotIn []time.Time `json:"lastUsedNotIn,omitempty"` + LastUsedGT *time.Time `json:"lastUsedGT,omitempty"` + LastUsedGTE *time.Time `json:"lastUsedGTE,omitempty"` + LastUsedLT *time.Time `json:"lastUsedLT,omitempty"` + LastUsedLTE *time.Time `json:"lastUsedLTE,omitempty"` + + // "integration" edge predicates. + HasIntegration *bool `json:"hasIntegration,omitempty"` + HasIntegrationWith []*IntegrationWhereInput `json:"hasIntegrationWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OhAuthTooTokenWhereInput) AddPredicates(predicates ...predicate.OhAuthTooToken) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OhAuthTooTokenWhereInput filter on the OhAuthTooTokenQuery builder. +func (i *OhAuthTooTokenWhereInput) Filter(q *OhAuthTooTokenQuery) (*OhAuthTooTokenQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOhAuthTooTokenWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOhAuthTooTokenWhereInput is returned in case the OhAuthTooTokenWhereInput is empty. +var ErrEmptyOhAuthTooTokenWhereInput = errors.New("generated: empty predicate OhAuthTooTokenWhereInput") + +// P returns a predicate for filtering ohauthtootokens. +// An error is returned if the input is empty or invalid. +func (i *OhAuthTooTokenWhereInput) P() (predicate.OhAuthTooToken, error) { + var predicates []predicate.OhAuthTooToken + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, ohauthtootoken.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.OhAuthTooToken, 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, ohauthtootoken.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.OhAuthTooToken, 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, ohauthtootoken.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, ohauthtootoken.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, ohauthtootoken.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, ohauthtootoken.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, ohauthtootoken.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, ohauthtootoken.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, ohauthtootoken.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, ohauthtootoken.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, ohauthtootoken.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, ohauthtootoken.IDContainsFold(*i.IDContainsFold)) + } + if i.ClientID != nil { + predicates = append(predicates, ohauthtootoken.ClientIDEQ(*i.ClientID)) + } + if i.ClientIDNEQ != nil { + predicates = append(predicates, ohauthtootoken.ClientIDNEQ(*i.ClientIDNEQ)) + } + if len(i.ClientIDIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClientIDIn(i.ClientIDIn...)) + } + if len(i.ClientIDNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClientIDNotIn(i.ClientIDNotIn...)) + } + if i.ClientIDGT != nil { + predicates = append(predicates, ohauthtootoken.ClientIDGT(*i.ClientIDGT)) + } + if i.ClientIDGTE != nil { + predicates = append(predicates, ohauthtootoken.ClientIDGTE(*i.ClientIDGTE)) + } + if i.ClientIDLT != nil { + predicates = append(predicates, ohauthtootoken.ClientIDLT(*i.ClientIDLT)) + } + if i.ClientIDLTE != nil { + predicates = append(predicates, ohauthtootoken.ClientIDLTE(*i.ClientIDLTE)) + } + if i.ClientIDContains != nil { + predicates = append(predicates, ohauthtootoken.ClientIDContains(*i.ClientIDContains)) + } + if i.ClientIDHasPrefix != nil { + predicates = append(predicates, ohauthtootoken.ClientIDHasPrefix(*i.ClientIDHasPrefix)) + } + if i.ClientIDHasSuffix != nil { + predicates = append(predicates, ohauthtootoken.ClientIDHasSuffix(*i.ClientIDHasSuffix)) + } + if i.ClientIDEqualFold != nil { + predicates = append(predicates, ohauthtootoken.ClientIDEqualFold(*i.ClientIDEqualFold)) + } + if i.ClientIDContainsFold != nil { + predicates = append(predicates, ohauthtootoken.ClientIDContainsFold(*i.ClientIDContainsFold)) + } + if i.Nonce != nil { + predicates = append(predicates, ohauthtootoken.NonceEQ(*i.Nonce)) + } + if i.NonceNEQ != nil { + predicates = append(predicates, ohauthtootoken.NonceNEQ(*i.NonceNEQ)) + } + if len(i.NonceIn) > 0 { + predicates = append(predicates, ohauthtootoken.NonceIn(i.NonceIn...)) + } + if len(i.NonceNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.NonceNotIn(i.NonceNotIn...)) + } + if i.NonceGT != nil { + predicates = append(predicates, ohauthtootoken.NonceGT(*i.NonceGT)) + } + if i.NonceGTE != nil { + predicates = append(predicates, ohauthtootoken.NonceGTE(*i.NonceGTE)) + } + if i.NonceLT != nil { + predicates = append(predicates, ohauthtootoken.NonceLT(*i.NonceLT)) + } + if i.NonceLTE != nil { + predicates = append(predicates, ohauthtootoken.NonceLTE(*i.NonceLTE)) + } + if i.NonceContains != nil { + predicates = append(predicates, ohauthtootoken.NonceContains(*i.NonceContains)) + } + if i.NonceHasPrefix != nil { + predicates = append(predicates, ohauthtootoken.NonceHasPrefix(*i.NonceHasPrefix)) + } + if i.NonceHasSuffix != nil { + predicates = append(predicates, ohauthtootoken.NonceHasSuffix(*i.NonceHasSuffix)) + } + if i.NonceEqualFold != nil { + predicates = append(predicates, ohauthtootoken.NonceEqualFold(*i.NonceEqualFold)) + } + if i.NonceContainsFold != nil { + predicates = append(predicates, ohauthtootoken.NonceContainsFold(*i.NonceContainsFold)) + } + if i.ClaimsUserID != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDEQ(*i.ClaimsUserID)) + } + if i.ClaimsUserIDNEQ != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDNEQ(*i.ClaimsUserIDNEQ)) + } + if len(i.ClaimsUserIDIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDIn(i.ClaimsUserIDIn...)) + } + if len(i.ClaimsUserIDNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDNotIn(i.ClaimsUserIDNotIn...)) + } + if i.ClaimsUserIDGT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDGT(*i.ClaimsUserIDGT)) + } + if i.ClaimsUserIDGTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDGTE(*i.ClaimsUserIDGTE)) + } + if i.ClaimsUserIDLT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDLT(*i.ClaimsUserIDLT)) + } + if i.ClaimsUserIDLTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDLTE(*i.ClaimsUserIDLTE)) + } + if i.ClaimsUserIDContains != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDContains(*i.ClaimsUserIDContains)) + } + if i.ClaimsUserIDHasPrefix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDHasPrefix(*i.ClaimsUserIDHasPrefix)) + } + if i.ClaimsUserIDHasSuffix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDHasSuffix(*i.ClaimsUserIDHasSuffix)) + } + if i.ClaimsUserIDEqualFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDEqualFold(*i.ClaimsUserIDEqualFold)) + } + if i.ClaimsUserIDContainsFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUserIDContainsFold(*i.ClaimsUserIDContainsFold)) + } + if i.ClaimsUsername != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameEQ(*i.ClaimsUsername)) + } + if i.ClaimsUsernameNEQ != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameNEQ(*i.ClaimsUsernameNEQ)) + } + if len(i.ClaimsUsernameIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameIn(i.ClaimsUsernameIn...)) + } + if len(i.ClaimsUsernameNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameNotIn(i.ClaimsUsernameNotIn...)) + } + if i.ClaimsUsernameGT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameGT(*i.ClaimsUsernameGT)) + } + if i.ClaimsUsernameGTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameGTE(*i.ClaimsUsernameGTE)) + } + if i.ClaimsUsernameLT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameLT(*i.ClaimsUsernameLT)) + } + if i.ClaimsUsernameLTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameLTE(*i.ClaimsUsernameLTE)) + } + if i.ClaimsUsernameContains != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameContains(*i.ClaimsUsernameContains)) + } + if i.ClaimsUsernameHasPrefix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameHasPrefix(*i.ClaimsUsernameHasPrefix)) + } + if i.ClaimsUsernameHasSuffix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameHasSuffix(*i.ClaimsUsernameHasSuffix)) + } + if i.ClaimsUsernameEqualFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameEqualFold(*i.ClaimsUsernameEqualFold)) + } + if i.ClaimsUsernameContainsFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsUsernameContainsFold(*i.ClaimsUsernameContainsFold)) + } + if i.ClaimsEmail != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailEQ(*i.ClaimsEmail)) + } + if i.ClaimsEmailNEQ != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailNEQ(*i.ClaimsEmailNEQ)) + } + if len(i.ClaimsEmailIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsEmailIn(i.ClaimsEmailIn...)) + } + if len(i.ClaimsEmailNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsEmailNotIn(i.ClaimsEmailNotIn...)) + } + if i.ClaimsEmailGT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailGT(*i.ClaimsEmailGT)) + } + if i.ClaimsEmailGTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailGTE(*i.ClaimsEmailGTE)) + } + if i.ClaimsEmailLT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailLT(*i.ClaimsEmailLT)) + } + if i.ClaimsEmailLTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailLTE(*i.ClaimsEmailLTE)) + } + if i.ClaimsEmailContains != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailContains(*i.ClaimsEmailContains)) + } + if i.ClaimsEmailHasPrefix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailHasPrefix(*i.ClaimsEmailHasPrefix)) + } + if i.ClaimsEmailHasSuffix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailHasSuffix(*i.ClaimsEmailHasSuffix)) + } + if i.ClaimsEmailEqualFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailEqualFold(*i.ClaimsEmailEqualFold)) + } + if i.ClaimsEmailContainsFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailContainsFold(*i.ClaimsEmailContainsFold)) + } + if i.ClaimsEmailVerified != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailVerifiedEQ(*i.ClaimsEmailVerified)) + } + if i.ClaimsEmailVerifiedNEQ != nil { + predicates = append(predicates, ohauthtootoken.ClaimsEmailVerifiedNEQ(*i.ClaimsEmailVerifiedNEQ)) + } + if i.ClaimsPreferredUsername != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameEQ(*i.ClaimsPreferredUsername)) + } + if i.ClaimsPreferredUsernameNEQ != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameNEQ(*i.ClaimsPreferredUsernameNEQ)) + } + if len(i.ClaimsPreferredUsernameIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameIn(i.ClaimsPreferredUsernameIn...)) + } + if len(i.ClaimsPreferredUsernameNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameNotIn(i.ClaimsPreferredUsernameNotIn...)) + } + if i.ClaimsPreferredUsernameGT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameGT(*i.ClaimsPreferredUsernameGT)) + } + if i.ClaimsPreferredUsernameGTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameGTE(*i.ClaimsPreferredUsernameGTE)) + } + if i.ClaimsPreferredUsernameLT != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameLT(*i.ClaimsPreferredUsernameLT)) + } + if i.ClaimsPreferredUsernameLTE != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameLTE(*i.ClaimsPreferredUsernameLTE)) + } + if i.ClaimsPreferredUsernameContains != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameContains(*i.ClaimsPreferredUsernameContains)) + } + if i.ClaimsPreferredUsernameHasPrefix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameHasPrefix(*i.ClaimsPreferredUsernameHasPrefix)) + } + if i.ClaimsPreferredUsernameHasSuffix != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameHasSuffix(*i.ClaimsPreferredUsernameHasSuffix)) + } + if i.ClaimsPreferredUsernameEqualFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameEqualFold(*i.ClaimsPreferredUsernameEqualFold)) + } + if i.ClaimsPreferredUsernameContainsFold != nil { + predicates = append(predicates, ohauthtootoken.ClaimsPreferredUsernameContainsFold(*i.ClaimsPreferredUsernameContainsFold)) + } + if i.ConnectorID != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDEQ(*i.ConnectorID)) + } + if i.ConnectorIDNEQ != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDNEQ(*i.ConnectorIDNEQ)) + } + if len(i.ConnectorIDIn) > 0 { + predicates = append(predicates, ohauthtootoken.ConnectorIDIn(i.ConnectorIDIn...)) + } + if len(i.ConnectorIDNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.ConnectorIDNotIn(i.ConnectorIDNotIn...)) + } + if i.ConnectorIDGT != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDGT(*i.ConnectorIDGT)) + } + if i.ConnectorIDGTE != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDGTE(*i.ConnectorIDGTE)) + } + if i.ConnectorIDLT != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDLT(*i.ConnectorIDLT)) + } + if i.ConnectorIDLTE != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDLTE(*i.ConnectorIDLTE)) + } + if i.ConnectorIDContains != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDContains(*i.ConnectorIDContains)) + } + if i.ConnectorIDHasPrefix != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDHasPrefix(*i.ConnectorIDHasPrefix)) + } + if i.ConnectorIDHasSuffix != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDHasSuffix(*i.ConnectorIDHasSuffix)) + } + if i.ConnectorIDEqualFold != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDEqualFold(*i.ConnectorIDEqualFold)) + } + if i.ConnectorIDContainsFold != nil { + predicates = append(predicates, ohauthtootoken.ConnectorIDContainsFold(*i.ConnectorIDContainsFold)) + } + if i.LastUsed != nil { + predicates = append(predicates, ohauthtootoken.LastUsedEQ(*i.LastUsed)) + } + if i.LastUsedNEQ != nil { + predicates = append(predicates, ohauthtootoken.LastUsedNEQ(*i.LastUsedNEQ)) + } + if len(i.LastUsedIn) > 0 { + predicates = append(predicates, ohauthtootoken.LastUsedIn(i.LastUsedIn...)) + } + if len(i.LastUsedNotIn) > 0 { + predicates = append(predicates, ohauthtootoken.LastUsedNotIn(i.LastUsedNotIn...)) + } + if i.LastUsedGT != nil { + predicates = append(predicates, ohauthtootoken.LastUsedGT(*i.LastUsedGT)) + } + if i.LastUsedGTE != nil { + predicates = append(predicates, ohauthtootoken.LastUsedGTE(*i.LastUsedGTE)) + } + if i.LastUsedLT != nil { + predicates = append(predicates, ohauthtootoken.LastUsedLT(*i.LastUsedLT)) + } + if i.LastUsedLTE != nil { + predicates = append(predicates, ohauthtootoken.LastUsedLTE(*i.LastUsedLTE)) + } + + if i.HasIntegration != nil { + p := ohauthtootoken.HasIntegration() + if !*i.HasIntegration { + p = ohauthtootoken.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasIntegrationWith) > 0 { + with := make([]predicate.Integration, 0, len(i.HasIntegrationWith)) + for _, w := range i.HasIntegrationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasIntegrationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, ohauthtootoken.HasIntegrationWith(with...)) + } + if i.HasEvents != nil { + p := ohauthtootoken.HasEvents() + if !*i.HasEvents { + p = ohauthtootoken.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, ohauthtootoken.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyOhAuthTooTokenWhereInput + case 1: + return predicates[0], nil + default: + return ohauthtootoken.And(predicates...), nil + } +} + +// OrgMembershipWhereInput represents a where input for filtering OrgMembership queries. +type OrgMembershipWhereInput struct { + Predicates []predicate.OrgMembership `json:"-"` + Not *OrgMembershipWhereInput `json:"not,omitempty"` + Or []*OrgMembershipWhereInput `json:"or,omitempty"` + And []*OrgMembershipWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "role" field predicates. + Role *enums.Role `json:"role,omitempty"` + RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + + // "organization_id" field predicates. + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNEQ *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGT *string `json:"organizationIDGT,omitempty"` + OrganizationIDGTE *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLT *string `json:"organizationIDLT,omitempty"` + OrganizationIDLTE *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + + // "user_id" field predicates. + UserID *string `json:"userID,omitempty"` + UserIDNEQ *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGT *string `json:"userIDGT,omitempty"` + UserIDGTE *string `json:"userIDGTE,omitempty"` + UserIDLT *string `json:"userIDLT,omitempty"` + UserIDLTE *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + + // "organization" edge predicates. + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + + // "user" edge predicates. + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OrgMembershipWhereInput) AddPredicates(predicates ...predicate.OrgMembership) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OrgMembershipWhereInput filter on the OrgMembershipQuery builder. +func (i *OrgMembershipWhereInput) Filter(q *OrgMembershipQuery) (*OrgMembershipQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOrgMembershipWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOrgMembershipWhereInput is returned in case the OrgMembershipWhereInput is empty. +var ErrEmptyOrgMembershipWhereInput = errors.New("generated: empty predicate OrgMembershipWhereInput") + +// P returns a predicate for filtering orgmemberships. +// An error is returned if the input is empty or invalid. +func (i *OrgMembershipWhereInput) P() (predicate.OrgMembership, error) { + var predicates []predicate.OrgMembership + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, orgmembership.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.OrgMembership, 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, orgmembership.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.OrgMembership, 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, orgmembership.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, orgmembership.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, orgmembership.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, orgmembership.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, orgmembership.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, orgmembership.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, orgmembership.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, orgmembership.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, orgmembership.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, orgmembership.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, orgmembership.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, orgmembership.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, orgmembership.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, orgmembership.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, orgmembership.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, orgmembership.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, orgmembership.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, orgmembership.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, orgmembership.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, orgmembership.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, orgmembership.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, orgmembership.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, orgmembership.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, orgmembership.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, orgmembership.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, orgmembership.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, orgmembership.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, orgmembership.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, orgmembership.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, orgmembership.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, orgmembership.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, orgmembership.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, orgmembership.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, orgmembership.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, orgmembership.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, orgmembership.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, orgmembership.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, orgmembership.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, orgmembership.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, orgmembership.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, orgmembership.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, orgmembership.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, orgmembership.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, orgmembership.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, orgmembership.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, orgmembership.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, orgmembership.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, orgmembership.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, orgmembership.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, orgmembership.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, orgmembership.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, orgmembership.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, orgmembership.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, orgmembership.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, orgmembership.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, orgmembership.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, orgmembership.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, orgmembership.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, orgmembership.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, orgmembership.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, orgmembership.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, orgmembership.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, orgmembership.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, orgmembership.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, orgmembership.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, orgmembership.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, orgmembership.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, orgmembership.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, orgmembership.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, orgmembership.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, orgmembership.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, orgmembership.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, orgmembership.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, orgmembership.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, orgmembership.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, orgmembership.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, orgmembership.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, orgmembership.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, orgmembership.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, orgmembership.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, orgmembership.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, orgmembership.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, orgmembership.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, orgmembership.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, orgmembership.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, orgmembership.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Role != nil { + predicates = append(predicates, orgmembership.RoleEQ(*i.Role)) + } + if i.RoleNEQ != nil { + predicates = append(predicates, orgmembership.RoleNEQ(*i.RoleNEQ)) + } + if len(i.RoleIn) > 0 { + predicates = append(predicates, orgmembership.RoleIn(i.RoleIn...)) + } + if len(i.RoleNotIn) > 0 { + predicates = append(predicates, orgmembership.RoleNotIn(i.RoleNotIn...)) + } + if i.OrganizationID != nil { + predicates = append(predicates, orgmembership.OrganizationIDEQ(*i.OrganizationID)) + } + if i.OrganizationIDNEQ != nil { + predicates = append(predicates, orgmembership.OrganizationIDNEQ(*i.OrganizationIDNEQ)) + } + if len(i.OrganizationIDIn) > 0 { + predicates = append(predicates, orgmembership.OrganizationIDIn(i.OrganizationIDIn...)) + } + if len(i.OrganizationIDNotIn) > 0 { + predicates = append(predicates, orgmembership.OrganizationIDNotIn(i.OrganizationIDNotIn...)) + } + if i.OrganizationIDGT != nil { + predicates = append(predicates, orgmembership.OrganizationIDGT(*i.OrganizationIDGT)) + } + if i.OrganizationIDGTE != nil { + predicates = append(predicates, orgmembership.OrganizationIDGTE(*i.OrganizationIDGTE)) + } + if i.OrganizationIDLT != nil { + predicates = append(predicates, orgmembership.OrganizationIDLT(*i.OrganizationIDLT)) + } + if i.OrganizationIDLTE != nil { + predicates = append(predicates, orgmembership.OrganizationIDLTE(*i.OrganizationIDLTE)) + } + if i.OrganizationIDContains != nil { + predicates = append(predicates, orgmembership.OrganizationIDContains(*i.OrganizationIDContains)) + } + if i.OrganizationIDHasPrefix != nil { + predicates = append(predicates, orgmembership.OrganizationIDHasPrefix(*i.OrganizationIDHasPrefix)) + } + if i.OrganizationIDHasSuffix != nil { + predicates = append(predicates, orgmembership.OrganizationIDHasSuffix(*i.OrganizationIDHasSuffix)) + } + if i.OrganizationIDEqualFold != nil { + predicates = append(predicates, orgmembership.OrganizationIDEqualFold(*i.OrganizationIDEqualFold)) + } + if i.OrganizationIDContainsFold != nil { + predicates = append(predicates, orgmembership.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) + } + if i.UserID != nil { + predicates = append(predicates, orgmembership.UserIDEQ(*i.UserID)) + } + if i.UserIDNEQ != nil { + predicates = append(predicates, orgmembership.UserIDNEQ(*i.UserIDNEQ)) + } + if len(i.UserIDIn) > 0 { + predicates = append(predicates, orgmembership.UserIDIn(i.UserIDIn...)) + } + if len(i.UserIDNotIn) > 0 { + predicates = append(predicates, orgmembership.UserIDNotIn(i.UserIDNotIn...)) + } + if i.UserIDGT != nil { + predicates = append(predicates, orgmembership.UserIDGT(*i.UserIDGT)) + } + if i.UserIDGTE != nil { + predicates = append(predicates, orgmembership.UserIDGTE(*i.UserIDGTE)) + } + if i.UserIDLT != nil { + predicates = append(predicates, orgmembership.UserIDLT(*i.UserIDLT)) + } + if i.UserIDLTE != nil { + predicates = append(predicates, orgmembership.UserIDLTE(*i.UserIDLTE)) + } + if i.UserIDContains != nil { + predicates = append(predicates, orgmembership.UserIDContains(*i.UserIDContains)) + } + if i.UserIDHasPrefix != nil { + predicates = append(predicates, orgmembership.UserIDHasPrefix(*i.UserIDHasPrefix)) + } + if i.UserIDHasSuffix != nil { + predicates = append(predicates, orgmembership.UserIDHasSuffix(*i.UserIDHasSuffix)) + } + if i.UserIDEqualFold != nil { + predicates = append(predicates, orgmembership.UserIDEqualFold(*i.UserIDEqualFold)) + } + if i.UserIDContainsFold != nil { + predicates = append(predicates, orgmembership.UserIDContainsFold(*i.UserIDContainsFold)) + } + + if i.HasOrganization != nil { + p := orgmembership.HasOrganization() + if !*i.HasOrganization { + p = orgmembership.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationWith)) + for _, w := range i.HasOrganizationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, orgmembership.HasOrganizationWith(with...)) + } + if i.HasUser != nil { + p := orgmembership.HasUser() + if !*i.HasUser { + p = orgmembership.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasUserWith) > 0 { + with := make([]predicate.User, 0, len(i.HasUserWith)) + for _, w := range i.HasUserWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasUserWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, orgmembership.HasUserWith(with...)) + } + if i.HasEvents != nil { + p := orgmembership.HasEvents() + if !*i.HasEvents { + p = orgmembership.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, orgmembership.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyOrgMembershipWhereInput + case 1: + return predicates[0], nil + default: + return orgmembership.And(predicates...), nil + } +} + +// OrgMembershipHistoryWhereInput represents a where input for filtering OrgMembershipHistory queries. +type OrgMembershipHistoryWhereInput struct { + Predicates []predicate.OrgMembershipHistory `json:"-"` + Not *OrgMembershipHistoryWhereInput `json:"not,omitempty"` + Or []*OrgMembershipHistoryWhereInput `json:"or,omitempty"` + And []*OrgMembershipHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "role" field predicates. + Role *enums.Role `json:"role,omitempty"` + RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + + // "organization_id" field predicates. + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNEQ *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGT *string `json:"organizationIDGT,omitempty"` + OrganizationIDGTE *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLT *string `json:"organizationIDLT,omitempty"` + OrganizationIDLTE *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + + // "user_id" field predicates. + UserID *string `json:"userID,omitempty"` + UserIDNEQ *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGT *string `json:"userIDGT,omitempty"` + UserIDGTE *string `json:"userIDGTE,omitempty"` + UserIDLT *string `json:"userIDLT,omitempty"` + UserIDLTE *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OrgMembershipHistoryWhereInput) AddPredicates(predicates ...predicate.OrgMembershipHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OrgMembershipHistoryWhereInput filter on the OrgMembershipHistoryQuery builder. +func (i *OrgMembershipHistoryWhereInput) Filter(q *OrgMembershipHistoryQuery) (*OrgMembershipHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOrgMembershipHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOrgMembershipHistoryWhereInput is returned in case the OrgMembershipHistoryWhereInput is empty. +var ErrEmptyOrgMembershipHistoryWhereInput = errors.New("generated: empty predicate OrgMembershipHistoryWhereInput") + +// P returns a predicate for filtering orgmembershiphistories. +// An error is returned if the input is empty or invalid. +func (i *OrgMembershipHistoryWhereInput) P() (predicate.OrgMembershipHistory, error) { + var predicates []predicate.OrgMembershipHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, orgmembershiphistory.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.OrgMembershipHistory, 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, orgmembershiphistory.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.OrgMembershipHistory, 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, orgmembershiphistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, orgmembershiphistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, orgmembershiphistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, orgmembershiphistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, orgmembershiphistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, orgmembershiphistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, orgmembershiphistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, orgmembershiphistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, orgmembershiphistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, orgmembershiphistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, orgmembershiphistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, orgmembershiphistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, orgmembershiphistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, orgmembershiphistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, orgmembershiphistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, orgmembershiphistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, orgmembershiphistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, orgmembershiphistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, orgmembershiphistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, orgmembershiphistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, orgmembershiphistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, orgmembershiphistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, orgmembershiphistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, orgmembershiphistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, orgmembershiphistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, orgmembershiphistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, orgmembershiphistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, orgmembershiphistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, orgmembershiphistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, orgmembershiphistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, orgmembershiphistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, orgmembershiphistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, orgmembershiphistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, orgmembershiphistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, orgmembershiphistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, orgmembershiphistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, orgmembershiphistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, orgmembershiphistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, orgmembershiphistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, orgmembershiphistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, orgmembershiphistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, orgmembershiphistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, orgmembershiphistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, orgmembershiphistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, orgmembershiphistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, orgmembershiphistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, orgmembershiphistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, orgmembershiphistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, orgmembershiphistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, orgmembershiphistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, orgmembershiphistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, orgmembershiphistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, orgmembershiphistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, orgmembershiphistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, orgmembershiphistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, orgmembershiphistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, orgmembershiphistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, orgmembershiphistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, orgmembershiphistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, orgmembershiphistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, orgmembershiphistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, orgmembershiphistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, orgmembershiphistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, orgmembershiphistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, orgmembershiphistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, orgmembershiphistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Role != nil { + predicates = append(predicates, orgmembershiphistory.RoleEQ(*i.Role)) + } + if i.RoleNEQ != nil { + predicates = append(predicates, orgmembershiphistory.RoleNEQ(*i.RoleNEQ)) + } + if len(i.RoleIn) > 0 { + predicates = append(predicates, orgmembershiphistory.RoleIn(i.RoleIn...)) + } + if len(i.RoleNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.RoleNotIn(i.RoleNotIn...)) + } + if i.OrganizationID != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDEQ(*i.OrganizationID)) + } + if i.OrganizationIDNEQ != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDNEQ(*i.OrganizationIDNEQ)) + } + if len(i.OrganizationIDIn) > 0 { + predicates = append(predicates, orgmembershiphistory.OrganizationIDIn(i.OrganizationIDIn...)) + } + if len(i.OrganizationIDNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.OrganizationIDNotIn(i.OrganizationIDNotIn...)) + } + if i.OrganizationIDGT != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDGT(*i.OrganizationIDGT)) + } + if i.OrganizationIDGTE != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDGTE(*i.OrganizationIDGTE)) + } + if i.OrganizationIDLT != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDLT(*i.OrganizationIDLT)) + } + if i.OrganizationIDLTE != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDLTE(*i.OrganizationIDLTE)) + } + if i.OrganizationIDContains != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDContains(*i.OrganizationIDContains)) + } + if i.OrganizationIDHasPrefix != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDHasPrefix(*i.OrganizationIDHasPrefix)) + } + if i.OrganizationIDHasSuffix != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDHasSuffix(*i.OrganizationIDHasSuffix)) + } + if i.OrganizationIDEqualFold != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDEqualFold(*i.OrganizationIDEqualFold)) + } + if i.OrganizationIDContainsFold != nil { + predicates = append(predicates, orgmembershiphistory.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) + } + if i.UserID != nil { + predicates = append(predicates, orgmembershiphistory.UserIDEQ(*i.UserID)) + } + if i.UserIDNEQ != nil { + predicates = append(predicates, orgmembershiphistory.UserIDNEQ(*i.UserIDNEQ)) + } + if len(i.UserIDIn) > 0 { + predicates = append(predicates, orgmembershiphistory.UserIDIn(i.UserIDIn...)) + } + if len(i.UserIDNotIn) > 0 { + predicates = append(predicates, orgmembershiphistory.UserIDNotIn(i.UserIDNotIn...)) + } + if i.UserIDGT != nil { + predicates = append(predicates, orgmembershiphistory.UserIDGT(*i.UserIDGT)) + } + if i.UserIDGTE != nil { + predicates = append(predicates, orgmembershiphistory.UserIDGTE(*i.UserIDGTE)) + } + if i.UserIDLT != nil { + predicates = append(predicates, orgmembershiphistory.UserIDLT(*i.UserIDLT)) + } + if i.UserIDLTE != nil { + predicates = append(predicates, orgmembershiphistory.UserIDLTE(*i.UserIDLTE)) + } + if i.UserIDContains != nil { + predicates = append(predicates, orgmembershiphistory.UserIDContains(*i.UserIDContains)) + } + if i.UserIDHasPrefix != nil { + predicates = append(predicates, orgmembershiphistory.UserIDHasPrefix(*i.UserIDHasPrefix)) + } + if i.UserIDHasSuffix != nil { + predicates = append(predicates, orgmembershiphistory.UserIDHasSuffix(*i.UserIDHasSuffix)) + } + if i.UserIDEqualFold != nil { + predicates = append(predicates, orgmembershiphistory.UserIDEqualFold(*i.UserIDEqualFold)) + } + if i.UserIDContainsFold != nil { + predicates = append(predicates, orgmembershiphistory.UserIDContainsFold(*i.UserIDContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyOrgMembershipHistoryWhereInput + case 1: + return predicates[0], nil + default: + return orgmembershiphistory.And(predicates...), nil + } +} + +// OrganizationWhereInput represents a where input for filtering Organization queries. +type OrganizationWhereInput struct { + Predicates []predicate.Organization `json:"-"` + Not *OrganizationWhereInput `json:"not,omitempty"` + Or []*OrganizationWhereInput `json:"or,omitempty"` + And []*OrganizationWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "parent_organization_id" field predicates. + ParentOrganizationID *string `json:"parentOrganizationID,omitempty"` + ParentOrganizationIDNEQ *string `json:"parentOrganizationIDNEQ,omitempty"` + ParentOrganizationIDIn []string `json:"parentOrganizationIDIn,omitempty"` + ParentOrganizationIDNotIn []string `json:"parentOrganizationIDNotIn,omitempty"` + ParentOrganizationIDGT *string `json:"parentOrganizationIDGT,omitempty"` + ParentOrganizationIDGTE *string `json:"parentOrganizationIDGTE,omitempty"` + ParentOrganizationIDLT *string `json:"parentOrganizationIDLT,omitempty"` + ParentOrganizationIDLTE *string `json:"parentOrganizationIDLTE,omitempty"` + ParentOrganizationIDContains *string `json:"parentOrganizationIDContains,omitempty"` + ParentOrganizationIDHasPrefix *string `json:"parentOrganizationIDHasPrefix,omitempty"` + ParentOrganizationIDHasSuffix *string `json:"parentOrganizationIDHasSuffix,omitempty"` + ParentOrganizationIDIsNil bool `json:"parentOrganizationIDIsNil,omitempty"` + ParentOrganizationIDNotNil bool `json:"parentOrganizationIDNotNil,omitempty"` + ParentOrganizationIDEqualFold *string `json:"parentOrganizationIDEqualFold,omitempty"` + ParentOrganizationIDContainsFold *string `json:"parentOrganizationIDContainsFold,omitempty"` + + // "personal_org" field predicates. + PersonalOrg *bool `json:"personalOrg,omitempty"` + PersonalOrgNEQ *bool `json:"personalOrgNEQ,omitempty"` + PersonalOrgIsNil bool `json:"personalOrgIsNil,omitempty"` + PersonalOrgNotNil bool `json:"personalOrgNotNil,omitempty"` + + // "avatar_remote_url" field predicates. + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNEQ *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGT *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGTE *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLT *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLTE *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + + // "parent" edge predicates. + HasParent *bool `json:"hasParent,omitempty"` + HasParentWith []*OrganizationWhereInput `json:"hasParentWith,omitempty"` + + // "children" edge predicates. + HasChildren *bool `json:"hasChildren,omitempty"` + HasChildrenWith []*OrganizationWhereInput `json:"hasChildrenWith,omitempty"` + + // "groups" edge predicates. + HasGroups *bool `json:"hasGroups,omitempty"` + HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"` + + // "templates" edge predicates. + HasTemplates *bool `json:"hasTemplates,omitempty"` + HasTemplatesWith []*TemplateWhereInput `json:"hasTemplatesWith,omitempty"` + + // "integrations" edge predicates. + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + + // "setting" edge predicates. + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*OrganizationSettingWhereInput `json:"hasSettingWith,omitempty"` + + // "documentdata" edge predicates. + HasDocumentdata *bool `json:"hasDocumentdata,omitempty"` + HasDocumentdataWith []*DocumentDataWhereInput `json:"hasDocumentdataWith,omitempty"` + + // "entitlements" edge predicates. + HasEntitlements *bool `json:"hasEntitlements,omitempty"` + HasEntitlementsWith []*EntitlementWhereInput `json:"hasEntitlementsWith,omitempty"` + + // "organization_entitlement" edge predicates. + HasOrganizationEntitlement *bool `json:"hasOrganizationEntitlement,omitempty"` + HasOrganizationEntitlementWith []*EntitlementWhereInput `json:"hasOrganizationEntitlementWith,omitempty"` + + // "personal_access_tokens" edge predicates. + HasPersonalAccessTokens *bool `json:"hasPersonalAccessTokens,omitempty"` + HasPersonalAccessTokensWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokensWith,omitempty"` + + // "api_tokens" edge predicates. + HasAPITokens *bool `json:"hasAPITokens,omitempty"` + HasAPITokensWith []*APITokenWhereInput `json:"hasAPITokensWith,omitempty"` + + // "oauthprovider" edge predicates. + HasOauthprovider *bool `json:"hasOauthprovider,omitempty"` + HasOauthproviderWith []*OauthProviderWhereInput `json:"hasOauthproviderWith,omitempty"` + + // "users" edge predicates. + HasUsers *bool `json:"hasUsers,omitempty"` + HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"` + + // "invites" edge predicates. + HasInvites *bool `json:"hasInvites,omitempty"` + HasInvitesWith []*InviteWhereInput `json:"hasInvitesWith,omitempty"` + + // "subscribers" edge predicates. + HasSubscribers *bool `json:"hasSubscribers,omitempty"` + HasSubscribersWith []*SubscriberWhereInput `json:"hasSubscribersWith,omitempty"` + + // "webhooks" edge predicates. + HasWebhooks *bool `json:"hasWebhooks,omitempty"` + HasWebhooksWith []*WebhookWhereInput `json:"hasWebhooksWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + + // "secrets" edge predicates. + HasSecrets *bool `json:"hasSecrets,omitempty"` + HasSecretsWith []*HushWhereInput `json:"hasSecretsWith,omitempty"` + + // "features" edge predicates. + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*FeatureWhereInput `json:"hasFeaturesWith,omitempty"` + + // "files" edge predicates. + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + + // "entitlementplans" edge predicates. + HasEntitlementplans *bool `json:"hasEntitlementplans,omitempty"` + HasEntitlementplansWith []*EntitlementPlanWhereInput `json:"hasEntitlementplansWith,omitempty"` + + // "entitlementplanfeatures" edge predicates. + HasEntitlementplanfeatures *bool `json:"hasEntitlementplanfeatures,omitempty"` + HasEntitlementplanfeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasEntitlementplanfeaturesWith,omitempty"` + + // "entities" edge predicates. + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` + + // "entitytypes" edge predicates. + HasEntitytypes *bool `json:"hasEntitytypes,omitempty"` + HasEntitytypesWith []*EntityTypeWhereInput `json:"hasEntitytypesWith,omitempty"` + + // "contacts" edge predicates. + HasContacts *bool `json:"hasContacts,omitempty"` + HasContactsWith []*ContactWhereInput `json:"hasContactsWith,omitempty"` + + // "notes" edge predicates. + HasNotes *bool `json:"hasNotes,omitempty"` + HasNotesWith []*NoteWhereInput `json:"hasNotesWith,omitempty"` + + // "members" edge predicates. + HasMembers *bool `json:"hasMembers,omitempty"` + HasMembersWith []*OrgMembershipWhereInput `json:"hasMembersWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OrganizationWhereInput) AddPredicates(predicates ...predicate.Organization) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OrganizationWhereInput filter on the OrganizationQuery builder. +func (i *OrganizationWhereInput) Filter(q *OrganizationQuery) (*OrganizationQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOrganizationWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOrganizationWhereInput is returned in case the OrganizationWhereInput is empty. +var ErrEmptyOrganizationWhereInput = errors.New("generated: empty predicate OrganizationWhereInput") + +// P returns a predicate for filtering organizations. +// An error is returned if the input is empty or invalid. +func (i *OrganizationWhereInput) P() (predicate.Organization, error) { + var predicates []predicate.Organization + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, organization.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.Organization, 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, organization.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.Organization, 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, organization.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, organization.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, organization.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, organization.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, organization.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, organization.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, organization.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, organization.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, organization.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, organization.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, organization.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, organization.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, organization.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, organization.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, organization.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, organization.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, organization.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, organization.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, organization.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, organization.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, organization.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, organization.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, organization.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, organization.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, organization.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, organization.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, organization.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, organization.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, organization.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, organization.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, organization.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, organization.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, organization.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, organization.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, organization.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, organization.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, organization.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, organization.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, organization.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, organization.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, organization.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, organization.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, organization.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, organization.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, organization.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, organization.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, organization.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, organization.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, organization.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, organization.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, organization.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, organization.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, organization.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, organization.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, organization.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, organization.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, organization.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, organization.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, organization.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, organization.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, organization.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, organization.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, organization.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, organization.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, organization.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, organization.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, organization.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, organization.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, organization.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, organization.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, organization.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, organization.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, organization.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, organization.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, organization.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, organization.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, organization.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, organization.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, organization.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, organization.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, organization.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, organization.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, organization.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, organization.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, organization.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, organization.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, organization.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, organization.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, organization.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, organization.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, organization.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, organization.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, organization.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, organization.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, organization.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, organization.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, organization.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, organization.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, organization.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.ParentOrganizationID != nil { + predicates = append(predicates, organization.ParentOrganizationIDEQ(*i.ParentOrganizationID)) + } + if i.ParentOrganizationIDNEQ != nil { + predicates = append(predicates, organization.ParentOrganizationIDNEQ(*i.ParentOrganizationIDNEQ)) + } + if len(i.ParentOrganizationIDIn) > 0 { + predicates = append(predicates, organization.ParentOrganizationIDIn(i.ParentOrganizationIDIn...)) + } + if len(i.ParentOrganizationIDNotIn) > 0 { + predicates = append(predicates, organization.ParentOrganizationIDNotIn(i.ParentOrganizationIDNotIn...)) + } + if i.ParentOrganizationIDGT != nil { + predicates = append(predicates, organization.ParentOrganizationIDGT(*i.ParentOrganizationIDGT)) + } + if i.ParentOrganizationIDGTE != nil { + predicates = append(predicates, organization.ParentOrganizationIDGTE(*i.ParentOrganizationIDGTE)) + } + if i.ParentOrganizationIDLT != nil { + predicates = append(predicates, organization.ParentOrganizationIDLT(*i.ParentOrganizationIDLT)) + } + if i.ParentOrganizationIDLTE != nil { + predicates = append(predicates, organization.ParentOrganizationIDLTE(*i.ParentOrganizationIDLTE)) + } + if i.ParentOrganizationIDContains != nil { + predicates = append(predicates, organization.ParentOrganizationIDContains(*i.ParentOrganizationIDContains)) + } + if i.ParentOrganizationIDHasPrefix != nil { + predicates = append(predicates, organization.ParentOrganizationIDHasPrefix(*i.ParentOrganizationIDHasPrefix)) + } + if i.ParentOrganizationIDHasSuffix != nil { + predicates = append(predicates, organization.ParentOrganizationIDHasSuffix(*i.ParentOrganizationIDHasSuffix)) + } + if i.ParentOrganizationIDIsNil { + predicates = append(predicates, organization.ParentOrganizationIDIsNil()) + } + if i.ParentOrganizationIDNotNil { + predicates = append(predicates, organization.ParentOrganizationIDNotNil()) + } + if i.ParentOrganizationIDEqualFold != nil { + predicates = append(predicates, organization.ParentOrganizationIDEqualFold(*i.ParentOrganizationIDEqualFold)) + } + if i.ParentOrganizationIDContainsFold != nil { + predicates = append(predicates, organization.ParentOrganizationIDContainsFold(*i.ParentOrganizationIDContainsFold)) + } + if i.PersonalOrg != nil { + predicates = append(predicates, organization.PersonalOrgEQ(*i.PersonalOrg)) + } + if i.PersonalOrgNEQ != nil { + predicates = append(predicates, organization.PersonalOrgNEQ(*i.PersonalOrgNEQ)) + } + if i.PersonalOrgIsNil { + predicates = append(predicates, organization.PersonalOrgIsNil()) + } + if i.PersonalOrgNotNil { + predicates = append(predicates, organization.PersonalOrgNotNil()) + } + if i.AvatarRemoteURL != nil { + predicates = append(predicates, organization.AvatarRemoteURLEQ(*i.AvatarRemoteURL)) + } + if i.AvatarRemoteURLNEQ != nil { + predicates = append(predicates, organization.AvatarRemoteURLNEQ(*i.AvatarRemoteURLNEQ)) + } + if len(i.AvatarRemoteURLIn) > 0 { + predicates = append(predicates, organization.AvatarRemoteURLIn(i.AvatarRemoteURLIn...)) + } + if len(i.AvatarRemoteURLNotIn) > 0 { + predicates = append(predicates, organization.AvatarRemoteURLNotIn(i.AvatarRemoteURLNotIn...)) + } + if i.AvatarRemoteURLGT != nil { + predicates = append(predicates, organization.AvatarRemoteURLGT(*i.AvatarRemoteURLGT)) + } + if i.AvatarRemoteURLGTE != nil { + predicates = append(predicates, organization.AvatarRemoteURLGTE(*i.AvatarRemoteURLGTE)) + } + if i.AvatarRemoteURLLT != nil { + predicates = append(predicates, organization.AvatarRemoteURLLT(*i.AvatarRemoteURLLT)) + } + if i.AvatarRemoteURLLTE != nil { + predicates = append(predicates, organization.AvatarRemoteURLLTE(*i.AvatarRemoteURLLTE)) + } + if i.AvatarRemoteURLContains != nil { + predicates = append(predicates, organization.AvatarRemoteURLContains(*i.AvatarRemoteURLContains)) + } + if i.AvatarRemoteURLHasPrefix != nil { + predicates = append(predicates, organization.AvatarRemoteURLHasPrefix(*i.AvatarRemoteURLHasPrefix)) + } + if i.AvatarRemoteURLHasSuffix != nil { + predicates = append(predicates, organization.AvatarRemoteURLHasSuffix(*i.AvatarRemoteURLHasSuffix)) + } + if i.AvatarRemoteURLIsNil { + predicates = append(predicates, organization.AvatarRemoteURLIsNil()) + } + if i.AvatarRemoteURLNotNil { + predicates = append(predicates, organization.AvatarRemoteURLNotNil()) + } + if i.AvatarRemoteURLEqualFold != nil { + predicates = append(predicates, organization.AvatarRemoteURLEqualFold(*i.AvatarRemoteURLEqualFold)) + } + if i.AvatarRemoteURLContainsFold != nil { + predicates = append(predicates, organization.AvatarRemoteURLContainsFold(*i.AvatarRemoteURLContainsFold)) + } + + if i.HasParent != nil { + p := organization.HasParent() + if !*i.HasParent { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasParentWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasParentWith)) + for _, w := range i.HasParentWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasParentWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasParentWith(with...)) + } + if i.HasChildren != nil { + p := organization.HasChildren() + if !*i.HasChildren { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasChildrenWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasChildrenWith)) + for _, w := range i.HasChildrenWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasChildrenWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasChildrenWith(with...)) + } + if i.HasGroups != nil { + p := organization.HasGroups() + if !*i.HasGroups { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupsWith) > 0 { + with := make([]predicate.Group, 0, len(i.HasGroupsWith)) + for _, w := range i.HasGroupsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasGroupsWith(with...)) + } + if i.HasTemplates != nil { + p := organization.HasTemplates() + if !*i.HasTemplates { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasTemplatesWith) > 0 { + with := make([]predicate.Template, 0, len(i.HasTemplatesWith)) + for _, w := range i.HasTemplatesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasTemplatesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasTemplatesWith(with...)) + } + if i.HasIntegrations != nil { + p := organization.HasIntegrations() + if !*i.HasIntegrations { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasIntegrationsWith) > 0 { + with := make([]predicate.Integration, 0, len(i.HasIntegrationsWith)) + for _, w := range i.HasIntegrationsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasIntegrationsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasIntegrationsWith(with...)) + } + if i.HasSetting != nil { + p := organization.HasSetting() + if !*i.HasSetting { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasSettingWith) > 0 { + with := make([]predicate.OrganizationSetting, 0, len(i.HasSettingWith)) + for _, w := range i.HasSettingWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasSettingWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasSettingWith(with...)) + } + if i.HasDocumentdata != nil { + p := organization.HasDocumentdata() + if !*i.HasDocumentdata { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasDocumentdataWith) > 0 { + with := make([]predicate.DocumentData, 0, len(i.HasDocumentdataWith)) + for _, w := range i.HasDocumentdataWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasDocumentdataWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasDocumentdataWith(with...)) + } + if i.HasEntitlements != nil { + p := organization.HasEntitlements() + if !*i.HasEntitlements { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitlementsWith) > 0 { + with := make([]predicate.Entitlement, 0, len(i.HasEntitlementsWith)) + for _, w := range i.HasEntitlementsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitlementsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasEntitlementsWith(with...)) + } + if i.HasOrganizationEntitlement != nil { + p := organization.HasOrganizationEntitlement() + if !*i.HasOrganizationEntitlement { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationEntitlementWith) > 0 { + with := make([]predicate.Entitlement, 0, len(i.HasOrganizationEntitlementWith)) + for _, w := range i.HasOrganizationEntitlementWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationEntitlementWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasOrganizationEntitlementWith(with...)) + } + if i.HasPersonalAccessTokens != nil { + p := organization.HasPersonalAccessTokens() + if !*i.HasPersonalAccessTokens { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasPersonalAccessTokensWith) > 0 { + with := make([]predicate.PersonalAccessToken, 0, len(i.HasPersonalAccessTokensWith)) + for _, w := range i.HasPersonalAccessTokensWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasPersonalAccessTokensWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasPersonalAccessTokensWith(with...)) + } + if i.HasAPITokens != nil { + p := organization.HasAPITokens() + if !*i.HasAPITokens { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasAPITokensWith) > 0 { + with := make([]predicate.APIToken, 0, len(i.HasAPITokensWith)) + for _, w := range i.HasAPITokensWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasAPITokensWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasAPITokensWith(with...)) + } + if i.HasOauthprovider != nil { + p := organization.HasOauthprovider() + if !*i.HasOauthprovider { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOauthproviderWith) > 0 { + with := make([]predicate.OauthProvider, 0, len(i.HasOauthproviderWith)) + for _, w := range i.HasOauthproviderWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOauthproviderWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasOauthproviderWith(with...)) + } + if i.HasUsers != nil { + p := organization.HasUsers() + if !*i.HasUsers { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasUsersWith) > 0 { + with := make([]predicate.User, 0, len(i.HasUsersWith)) + for _, w := range i.HasUsersWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasUsersWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasUsersWith(with...)) + } + if i.HasInvites != nil { + p := organization.HasInvites() + if !*i.HasInvites { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasInvitesWith) > 0 { + with := make([]predicate.Invite, 0, len(i.HasInvitesWith)) + for _, w := range i.HasInvitesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasInvitesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasInvitesWith(with...)) + } + if i.HasSubscribers != nil { + p := organization.HasSubscribers() + if !*i.HasSubscribers { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasSubscribersWith) > 0 { + with := make([]predicate.Subscriber, 0, len(i.HasSubscribersWith)) + for _, w := range i.HasSubscribersWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasSubscribersWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasSubscribersWith(with...)) + } + if i.HasWebhooks != nil { + p := organization.HasWebhooks() + if !*i.HasWebhooks { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasWebhooksWith) > 0 { + with := make([]predicate.Webhook, 0, len(i.HasWebhooksWith)) + for _, w := range i.HasWebhooksWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasWebhooksWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasWebhooksWith(with...)) + } + if i.HasEvents != nil { + p := organization.HasEvents() + if !*i.HasEvents { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasEventsWith(with...)) + } + if i.HasSecrets != nil { + p := organization.HasSecrets() + if !*i.HasSecrets { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasSecretsWith) > 0 { + with := make([]predicate.Hush, 0, len(i.HasSecretsWith)) + for _, w := range i.HasSecretsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasSecretsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasSecretsWith(with...)) + } + if i.HasFeatures != nil { + p := organization.HasFeatures() + if !*i.HasFeatures { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFeaturesWith) > 0 { + with := make([]predicate.Feature, 0, len(i.HasFeaturesWith)) + for _, w := range i.HasFeaturesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFeaturesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasFeaturesWith(with...)) + } + if i.HasFiles != nil { + p := organization.HasFiles() + if !*i.HasFiles { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFilesWith) > 0 { + with := make([]predicate.File, 0, len(i.HasFilesWith)) + for _, w := range i.HasFilesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFilesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasFilesWith(with...)) + } + if i.HasEntitlementplans != nil { + p := organization.HasEntitlementplans() + if !*i.HasEntitlementplans { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitlementplansWith) > 0 { + with := make([]predicate.EntitlementPlan, 0, len(i.HasEntitlementplansWith)) + for _, w := range i.HasEntitlementplansWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitlementplansWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasEntitlementplansWith(with...)) + } + if i.HasEntitlementplanfeatures != nil { + p := organization.HasEntitlementplanfeatures() + if !*i.HasEntitlementplanfeatures { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitlementplanfeaturesWith) > 0 { + with := make([]predicate.EntitlementPlanFeature, 0, len(i.HasEntitlementplanfeaturesWith)) + for _, w := range i.HasEntitlementplanfeaturesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitlementplanfeaturesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasEntitlementplanfeaturesWith(with...)) + } + if i.HasEntities != nil { + p := organization.HasEntities() + if !*i.HasEntities { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitiesWith) > 0 { + with := make([]predicate.Entity, 0, len(i.HasEntitiesWith)) + for _, w := range i.HasEntitiesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitiesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasEntitiesWith(with...)) + } + if i.HasEntitytypes != nil { + p := organization.HasEntitytypes() + if !*i.HasEntitytypes { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEntitytypesWith) > 0 { + with := make([]predicate.EntityType, 0, len(i.HasEntitytypesWith)) + for _, w := range i.HasEntitytypesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEntitytypesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasEntitytypesWith(with...)) + } + if i.HasContacts != nil { + p := organization.HasContacts() + if !*i.HasContacts { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasContactsWith) > 0 { + with := make([]predicate.Contact, 0, len(i.HasContactsWith)) + for _, w := range i.HasContactsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasContactsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasContactsWith(with...)) + } + if i.HasNotes != nil { + p := organization.HasNotes() + if !*i.HasNotes { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasNotesWith) > 0 { + with := make([]predicate.Note, 0, len(i.HasNotesWith)) + for _, w := range i.HasNotesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasNotesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasNotesWith(with...)) + } + if i.HasMembers != nil { + p := organization.HasMembers() + if !*i.HasMembers { + p = organization.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasMembersWith) > 0 { + with := make([]predicate.OrgMembership, 0, len(i.HasMembersWith)) + for _, w := range i.HasMembersWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasMembersWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organization.HasMembersWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyOrganizationWhereInput + case 1: + return predicates[0], nil + default: + return organization.And(predicates...), nil + } +} + +// OrganizationHistoryWhereInput represents a where input for filtering OrganizationHistory queries. +type OrganizationHistoryWhereInput struct { + Predicates []predicate.OrganizationHistory `json:"-"` + Not *OrganizationHistoryWhereInput `json:"not,omitempty"` + Or []*OrganizationHistoryWhereInput `json:"or,omitempty"` + And []*OrganizationHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "parent_organization_id" field predicates. + ParentOrganizationID *string `json:"parentOrganizationID,omitempty"` + ParentOrganizationIDNEQ *string `json:"parentOrganizationIDNEQ,omitempty"` + ParentOrganizationIDIn []string `json:"parentOrganizationIDIn,omitempty"` + ParentOrganizationIDNotIn []string `json:"parentOrganizationIDNotIn,omitempty"` + ParentOrganizationIDGT *string `json:"parentOrganizationIDGT,omitempty"` + ParentOrganizationIDGTE *string `json:"parentOrganizationIDGTE,omitempty"` + ParentOrganizationIDLT *string `json:"parentOrganizationIDLT,omitempty"` + ParentOrganizationIDLTE *string `json:"parentOrganizationIDLTE,omitempty"` + ParentOrganizationIDContains *string `json:"parentOrganizationIDContains,omitempty"` + ParentOrganizationIDHasPrefix *string `json:"parentOrganizationIDHasPrefix,omitempty"` + ParentOrganizationIDHasSuffix *string `json:"parentOrganizationIDHasSuffix,omitempty"` + ParentOrganizationIDIsNil bool `json:"parentOrganizationIDIsNil,omitempty"` + ParentOrganizationIDNotNil bool `json:"parentOrganizationIDNotNil,omitempty"` + ParentOrganizationIDEqualFold *string `json:"parentOrganizationIDEqualFold,omitempty"` + ParentOrganizationIDContainsFold *string `json:"parentOrganizationIDContainsFold,omitempty"` + + // "personal_org" field predicates. + PersonalOrg *bool `json:"personalOrg,omitempty"` + PersonalOrgNEQ *bool `json:"personalOrgNEQ,omitempty"` + PersonalOrgIsNil bool `json:"personalOrgIsNil,omitempty"` + PersonalOrgNotNil bool `json:"personalOrgNotNil,omitempty"` + + // "avatar_remote_url" field predicates. + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNEQ *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGT *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGTE *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLT *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLTE *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OrganizationHistoryWhereInput) AddPredicates(predicates ...predicate.OrganizationHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OrganizationHistoryWhereInput filter on the OrganizationHistoryQuery builder. +func (i *OrganizationHistoryWhereInput) Filter(q *OrganizationHistoryQuery) (*OrganizationHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOrganizationHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOrganizationHistoryWhereInput is returned in case the OrganizationHistoryWhereInput is empty. +var ErrEmptyOrganizationHistoryWhereInput = errors.New("generated: empty predicate OrganizationHistoryWhereInput") + +// P returns a predicate for filtering organizationhistories. +// An error is returned if the input is empty or invalid. +func (i *OrganizationHistoryWhereInput) P() (predicate.OrganizationHistory, error) { + var predicates []predicate.OrganizationHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, organizationhistory.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.OrganizationHistory, 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, organizationhistory.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.OrganizationHistory, 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, organizationhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, organizationhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, organizationhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, organizationhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, organizationhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, organizationhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, organizationhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, organizationhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, organizationhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, organizationhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, organizationhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, organizationhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, organizationhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, organizationhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, organizationhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, organizationhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, organizationhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, organizationhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, organizationhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, organizationhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, organizationhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, organizationhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, organizationhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, organizationhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, organizationhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, organizationhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, organizationhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, organizationhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, organizationhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, organizationhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, organizationhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, organizationhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, organizationhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, organizationhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, organizationhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, organizationhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, organizationhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, organizationhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, organizationhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, organizationhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, organizationhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, organizationhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, organizationhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, organizationhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, organizationhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, organizationhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, organizationhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, organizationhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, organizationhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, organizationhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, organizationhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, organizationhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, organizationhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, organizationhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, organizationhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, organizationhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, organizationhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, organizationhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, organizationhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, organizationhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, organizationhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, organizationhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, organizationhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, organizationhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, organizationhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, organizationhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, organizationhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, organizationhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, organizationhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, organizationhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, organizationhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, organizationhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, organizationhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, organizationhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, organizationhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, organizationhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, organizationhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, organizationhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, organizationhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, organizationhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, organizationhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, organizationhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, organizationhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, organizationhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, organizationhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, organizationhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, organizationhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, organizationhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, organizationhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, organizationhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, organizationhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, organizationhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, organizationhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, organizationhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, organizationhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, organizationhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, organizationhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, organizationhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, organizationhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, organizationhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, organizationhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, organizationhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, organizationhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, organizationhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, organizationhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, organizationhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, organizationhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, organizationhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, organizationhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, organizationhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, organizationhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, organizationhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, organizationhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, organizationhistory.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, organizationhistory.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, organizationhistory.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, organizationhistory.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, organizationhistory.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, organizationhistory.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, organizationhistory.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, organizationhistory.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, organizationhistory.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, organizationhistory.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, organizationhistory.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, organizationhistory.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, organizationhistory.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.ParentOrganizationID != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDEQ(*i.ParentOrganizationID)) + } + if i.ParentOrganizationIDNEQ != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDNEQ(*i.ParentOrganizationIDNEQ)) + } + if len(i.ParentOrganizationIDIn) > 0 { + predicates = append(predicates, organizationhistory.ParentOrganizationIDIn(i.ParentOrganizationIDIn...)) + } + if len(i.ParentOrganizationIDNotIn) > 0 { + predicates = append(predicates, organizationhistory.ParentOrganizationIDNotIn(i.ParentOrganizationIDNotIn...)) + } + if i.ParentOrganizationIDGT != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDGT(*i.ParentOrganizationIDGT)) + } + if i.ParentOrganizationIDGTE != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDGTE(*i.ParentOrganizationIDGTE)) + } + if i.ParentOrganizationIDLT != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDLT(*i.ParentOrganizationIDLT)) + } + if i.ParentOrganizationIDLTE != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDLTE(*i.ParentOrganizationIDLTE)) + } + if i.ParentOrganizationIDContains != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDContains(*i.ParentOrganizationIDContains)) + } + if i.ParentOrganizationIDHasPrefix != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDHasPrefix(*i.ParentOrganizationIDHasPrefix)) + } + if i.ParentOrganizationIDHasSuffix != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDHasSuffix(*i.ParentOrganizationIDHasSuffix)) + } + if i.ParentOrganizationIDIsNil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDIsNil()) + } + if i.ParentOrganizationIDNotNil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDNotNil()) + } + if i.ParentOrganizationIDEqualFold != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDEqualFold(*i.ParentOrganizationIDEqualFold)) + } + if i.ParentOrganizationIDContainsFold != nil { + predicates = append(predicates, organizationhistory.ParentOrganizationIDContainsFold(*i.ParentOrganizationIDContainsFold)) + } + if i.PersonalOrg != nil { + predicates = append(predicates, organizationhistory.PersonalOrgEQ(*i.PersonalOrg)) + } + if i.PersonalOrgNEQ != nil { + predicates = append(predicates, organizationhistory.PersonalOrgNEQ(*i.PersonalOrgNEQ)) + } + if i.PersonalOrgIsNil { + predicates = append(predicates, organizationhistory.PersonalOrgIsNil()) + } + if i.PersonalOrgNotNil { + predicates = append(predicates, organizationhistory.PersonalOrgNotNil()) + } + if i.AvatarRemoteURL != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLEQ(*i.AvatarRemoteURL)) + } + if i.AvatarRemoteURLNEQ != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLNEQ(*i.AvatarRemoteURLNEQ)) + } + if len(i.AvatarRemoteURLIn) > 0 { + predicates = append(predicates, organizationhistory.AvatarRemoteURLIn(i.AvatarRemoteURLIn...)) + } + if len(i.AvatarRemoteURLNotIn) > 0 { + predicates = append(predicates, organizationhistory.AvatarRemoteURLNotIn(i.AvatarRemoteURLNotIn...)) + } + if i.AvatarRemoteURLGT != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLGT(*i.AvatarRemoteURLGT)) + } + if i.AvatarRemoteURLGTE != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLGTE(*i.AvatarRemoteURLGTE)) + } + if i.AvatarRemoteURLLT != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLLT(*i.AvatarRemoteURLLT)) + } + if i.AvatarRemoteURLLTE != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLLTE(*i.AvatarRemoteURLLTE)) + } + if i.AvatarRemoteURLContains != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLContains(*i.AvatarRemoteURLContains)) + } + if i.AvatarRemoteURLHasPrefix != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLHasPrefix(*i.AvatarRemoteURLHasPrefix)) + } + if i.AvatarRemoteURLHasSuffix != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLHasSuffix(*i.AvatarRemoteURLHasSuffix)) + } + if i.AvatarRemoteURLIsNil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLIsNil()) + } + if i.AvatarRemoteURLNotNil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLNotNil()) + } + if i.AvatarRemoteURLEqualFold != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLEqualFold(*i.AvatarRemoteURLEqualFold)) + } + if i.AvatarRemoteURLContainsFold != nil { + predicates = append(predicates, organizationhistory.AvatarRemoteURLContainsFold(*i.AvatarRemoteURLContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyOrganizationHistoryWhereInput + case 1: + return predicates[0], nil + default: + return organizationhistory.And(predicates...), nil + } +} + +// OrganizationSettingWhereInput represents a where input for filtering OrganizationSetting queries. +type OrganizationSettingWhereInput struct { + Predicates []predicate.OrganizationSetting `json:"-"` + Not *OrganizationSettingWhereInput `json:"not,omitempty"` + Or []*OrganizationSettingWhereInput `json:"or,omitempty"` + And []*OrganizationSettingWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "billing_contact" field predicates. + BillingContact *string `json:"billingContact,omitempty"` + BillingContactNEQ *string `json:"billingContactNEQ,omitempty"` + BillingContactIn []string `json:"billingContactIn,omitempty"` + BillingContactNotIn []string `json:"billingContactNotIn,omitempty"` + BillingContactGT *string `json:"billingContactGT,omitempty"` + BillingContactGTE *string `json:"billingContactGTE,omitempty"` + BillingContactLT *string `json:"billingContactLT,omitempty"` + BillingContactLTE *string `json:"billingContactLTE,omitempty"` + BillingContactContains *string `json:"billingContactContains,omitempty"` + BillingContactHasPrefix *string `json:"billingContactHasPrefix,omitempty"` + BillingContactHasSuffix *string `json:"billingContactHasSuffix,omitempty"` + BillingContactIsNil bool `json:"billingContactIsNil,omitempty"` + BillingContactNotNil bool `json:"billingContactNotNil,omitempty"` + BillingContactEqualFold *string `json:"billingContactEqualFold,omitempty"` + BillingContactContainsFold *string `json:"billingContactContainsFold,omitempty"` + + // "billing_email" field predicates. + BillingEmail *string `json:"billingEmail,omitempty"` + BillingEmailNEQ *string `json:"billingEmailNEQ,omitempty"` + BillingEmailIn []string `json:"billingEmailIn,omitempty"` + BillingEmailNotIn []string `json:"billingEmailNotIn,omitempty"` + BillingEmailGT *string `json:"billingEmailGT,omitempty"` + BillingEmailGTE *string `json:"billingEmailGTE,omitempty"` + BillingEmailLT *string `json:"billingEmailLT,omitempty"` + BillingEmailLTE *string `json:"billingEmailLTE,omitempty"` + BillingEmailContains *string `json:"billingEmailContains,omitempty"` + BillingEmailHasPrefix *string `json:"billingEmailHasPrefix,omitempty"` + BillingEmailHasSuffix *string `json:"billingEmailHasSuffix,omitempty"` + BillingEmailIsNil bool `json:"billingEmailIsNil,omitempty"` + BillingEmailNotNil bool `json:"billingEmailNotNil,omitempty"` + BillingEmailEqualFold *string `json:"billingEmailEqualFold,omitempty"` + BillingEmailContainsFold *string `json:"billingEmailContainsFold,omitempty"` + + // "billing_phone" field predicates. + BillingPhone *string `json:"billingPhone,omitempty"` + BillingPhoneNEQ *string `json:"billingPhoneNEQ,omitempty"` + BillingPhoneIn []string `json:"billingPhoneIn,omitempty"` + BillingPhoneNotIn []string `json:"billingPhoneNotIn,omitempty"` + BillingPhoneGT *string `json:"billingPhoneGT,omitempty"` + BillingPhoneGTE *string `json:"billingPhoneGTE,omitempty"` + BillingPhoneLT *string `json:"billingPhoneLT,omitempty"` + BillingPhoneLTE *string `json:"billingPhoneLTE,omitempty"` + BillingPhoneContains *string `json:"billingPhoneContains,omitempty"` + BillingPhoneHasPrefix *string `json:"billingPhoneHasPrefix,omitempty"` + BillingPhoneHasSuffix *string `json:"billingPhoneHasSuffix,omitempty"` + BillingPhoneIsNil bool `json:"billingPhoneIsNil,omitempty"` + BillingPhoneNotNil bool `json:"billingPhoneNotNil,omitempty"` + BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` + BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` + + // "billing_address" field predicates. + BillingAddress *string `json:"billingAddress,omitempty"` + BillingAddressNEQ *string `json:"billingAddressNEQ,omitempty"` + BillingAddressIn []string `json:"billingAddressIn,omitempty"` + BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` + BillingAddressGT *string `json:"billingAddressGT,omitempty"` + BillingAddressGTE *string `json:"billingAddressGTE,omitempty"` + BillingAddressLT *string `json:"billingAddressLT,omitempty"` + BillingAddressLTE *string `json:"billingAddressLTE,omitempty"` + BillingAddressContains *string `json:"billingAddressContains,omitempty"` + BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` + BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` + BillingAddressIsNil bool `json:"billingAddressIsNil,omitempty"` + BillingAddressNotNil bool `json:"billingAddressNotNil,omitempty"` + BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` + BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` + + // "tax_identifier" field predicates. + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + TaxIdentifierNEQ *string `json:"taxIdentifierNEQ,omitempty"` + TaxIdentifierIn []string `json:"taxIdentifierIn,omitempty"` + TaxIdentifierNotIn []string `json:"taxIdentifierNotIn,omitempty"` + TaxIdentifierGT *string `json:"taxIdentifierGT,omitempty"` + TaxIdentifierGTE *string `json:"taxIdentifierGTE,omitempty"` + TaxIdentifierLT *string `json:"taxIdentifierLT,omitempty"` + TaxIdentifierLTE *string `json:"taxIdentifierLTE,omitempty"` + TaxIdentifierContains *string `json:"taxIdentifierContains,omitempty"` + TaxIdentifierHasPrefix *string `json:"taxIdentifierHasPrefix,omitempty"` + TaxIdentifierHasSuffix *string `json:"taxIdentifierHasSuffix,omitempty"` + TaxIdentifierIsNil bool `json:"taxIdentifierIsNil,omitempty"` + TaxIdentifierNotNil bool `json:"taxIdentifierNotNil,omitempty"` + TaxIdentifierEqualFold *string `json:"taxIdentifierEqualFold,omitempty"` + TaxIdentifierContainsFold *string `json:"taxIdentifierContainsFold,omitempty"` + + // "geo_location" field predicates. + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + GeoLocationNEQ *enums.Region `json:"geoLocationNEQ,omitempty"` + GeoLocationIn []enums.Region `json:"geoLocationIn,omitempty"` + GeoLocationNotIn []enums.Region `json:"geoLocationNotIn,omitempty"` + GeoLocationIsNil bool `json:"geoLocationIsNil,omitempty"` + GeoLocationNotNil bool `json:"geoLocationNotNil,omitempty"` + + // "organization_id" field predicates. + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNEQ *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGT *string `json:"organizationIDGT,omitempty"` + OrganizationIDGTE *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLT *string `json:"organizationIDLT,omitempty"` + OrganizationIDLTE *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDIsNil bool `json:"organizationIDIsNil,omitempty"` + OrganizationIDNotNil bool `json:"organizationIDNotNil,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + + // "organization" edge predicates. + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OrganizationSettingWhereInput) AddPredicates(predicates ...predicate.OrganizationSetting) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OrganizationSettingWhereInput filter on the OrganizationSettingQuery builder. +func (i *OrganizationSettingWhereInput) Filter(q *OrganizationSettingQuery) (*OrganizationSettingQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOrganizationSettingWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOrganizationSettingWhereInput is returned in case the OrganizationSettingWhereInput is empty. +var ErrEmptyOrganizationSettingWhereInput = errors.New("generated: empty predicate OrganizationSettingWhereInput") + +// P returns a predicate for filtering organizationsettings. +// An error is returned if the input is empty or invalid. +func (i *OrganizationSettingWhereInput) P() (predicate.OrganizationSetting, error) { + var predicates []predicate.OrganizationSetting + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, organizationsetting.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.OrganizationSetting, 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, organizationsetting.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.OrganizationSetting, 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, organizationsetting.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, organizationsetting.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, organizationsetting.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, organizationsetting.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, organizationsetting.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, organizationsetting.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, organizationsetting.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, organizationsetting.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, organizationsetting.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, organizationsetting.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, organizationsetting.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, organizationsetting.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, organizationsetting.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, organizationsetting.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, organizationsetting.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, organizationsetting.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, organizationsetting.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, organizationsetting.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, organizationsetting.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, organizationsetting.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, organizationsetting.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, organizationsetting.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, organizationsetting.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, organizationsetting.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, organizationsetting.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, organizationsetting.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, organizationsetting.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, organizationsetting.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, organizationsetting.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, organizationsetting.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, organizationsetting.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, organizationsetting.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, organizationsetting.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, organizationsetting.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, organizationsetting.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, organizationsetting.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, organizationsetting.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, organizationsetting.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, organizationsetting.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, organizationsetting.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, organizationsetting.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, organizationsetting.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, organizationsetting.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, organizationsetting.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, organizationsetting.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, organizationsetting.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, organizationsetting.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, organizationsetting.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, organizationsetting.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, organizationsetting.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, organizationsetting.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, organizationsetting.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, organizationsetting.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, organizationsetting.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, organizationsetting.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, organizationsetting.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, organizationsetting.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, organizationsetting.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, organizationsetting.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, organizationsetting.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, organizationsetting.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, organizationsetting.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, organizationsetting.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, organizationsetting.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, organizationsetting.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, organizationsetting.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, organizationsetting.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, organizationsetting.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, organizationsetting.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, organizationsetting.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, organizationsetting.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, organizationsetting.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, organizationsetting.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, organizationsetting.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, organizationsetting.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, organizationsetting.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, organizationsetting.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, organizationsetting.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, organizationsetting.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, organizationsetting.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, organizationsetting.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, organizationsetting.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, organizationsetting.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, organizationsetting.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, organizationsetting.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, organizationsetting.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.BillingContact != nil { + predicates = append(predicates, organizationsetting.BillingContactEQ(*i.BillingContact)) + } + if i.BillingContactNEQ != nil { + predicates = append(predicates, organizationsetting.BillingContactNEQ(*i.BillingContactNEQ)) + } + if len(i.BillingContactIn) > 0 { + predicates = append(predicates, organizationsetting.BillingContactIn(i.BillingContactIn...)) + } + if len(i.BillingContactNotIn) > 0 { + predicates = append(predicates, organizationsetting.BillingContactNotIn(i.BillingContactNotIn...)) + } + if i.BillingContactGT != nil { + predicates = append(predicates, organizationsetting.BillingContactGT(*i.BillingContactGT)) + } + if i.BillingContactGTE != nil { + predicates = append(predicates, organizationsetting.BillingContactGTE(*i.BillingContactGTE)) + } + if i.BillingContactLT != nil { + predicates = append(predicates, organizationsetting.BillingContactLT(*i.BillingContactLT)) + } + if i.BillingContactLTE != nil { + predicates = append(predicates, organizationsetting.BillingContactLTE(*i.BillingContactLTE)) + } + if i.BillingContactContains != nil { + predicates = append(predicates, organizationsetting.BillingContactContains(*i.BillingContactContains)) + } + if i.BillingContactHasPrefix != nil { + predicates = append(predicates, organizationsetting.BillingContactHasPrefix(*i.BillingContactHasPrefix)) + } + if i.BillingContactHasSuffix != nil { + predicates = append(predicates, organizationsetting.BillingContactHasSuffix(*i.BillingContactHasSuffix)) + } + if i.BillingContactIsNil { + predicates = append(predicates, organizationsetting.BillingContactIsNil()) + } + if i.BillingContactNotNil { + predicates = append(predicates, organizationsetting.BillingContactNotNil()) + } + if i.BillingContactEqualFold != nil { + predicates = append(predicates, organizationsetting.BillingContactEqualFold(*i.BillingContactEqualFold)) + } + if i.BillingContactContainsFold != nil { + predicates = append(predicates, organizationsetting.BillingContactContainsFold(*i.BillingContactContainsFold)) + } + if i.BillingEmail != nil { + predicates = append(predicates, organizationsetting.BillingEmailEQ(*i.BillingEmail)) + } + if i.BillingEmailNEQ != nil { + predicates = append(predicates, organizationsetting.BillingEmailNEQ(*i.BillingEmailNEQ)) + } + if len(i.BillingEmailIn) > 0 { + predicates = append(predicates, organizationsetting.BillingEmailIn(i.BillingEmailIn...)) + } + if len(i.BillingEmailNotIn) > 0 { + predicates = append(predicates, organizationsetting.BillingEmailNotIn(i.BillingEmailNotIn...)) + } + if i.BillingEmailGT != nil { + predicates = append(predicates, organizationsetting.BillingEmailGT(*i.BillingEmailGT)) + } + if i.BillingEmailGTE != nil { + predicates = append(predicates, organizationsetting.BillingEmailGTE(*i.BillingEmailGTE)) + } + if i.BillingEmailLT != nil { + predicates = append(predicates, organizationsetting.BillingEmailLT(*i.BillingEmailLT)) + } + if i.BillingEmailLTE != nil { + predicates = append(predicates, organizationsetting.BillingEmailLTE(*i.BillingEmailLTE)) + } + if i.BillingEmailContains != nil { + predicates = append(predicates, organizationsetting.BillingEmailContains(*i.BillingEmailContains)) + } + if i.BillingEmailHasPrefix != nil { + predicates = append(predicates, organizationsetting.BillingEmailHasPrefix(*i.BillingEmailHasPrefix)) + } + if i.BillingEmailHasSuffix != nil { + predicates = append(predicates, organizationsetting.BillingEmailHasSuffix(*i.BillingEmailHasSuffix)) + } + if i.BillingEmailIsNil { + predicates = append(predicates, organizationsetting.BillingEmailIsNil()) + } + if i.BillingEmailNotNil { + predicates = append(predicates, organizationsetting.BillingEmailNotNil()) + } + if i.BillingEmailEqualFold != nil { + predicates = append(predicates, organizationsetting.BillingEmailEqualFold(*i.BillingEmailEqualFold)) + } + if i.BillingEmailContainsFold != nil { + predicates = append(predicates, organizationsetting.BillingEmailContainsFold(*i.BillingEmailContainsFold)) + } + if i.BillingPhone != nil { + predicates = append(predicates, organizationsetting.BillingPhoneEQ(*i.BillingPhone)) + } + if i.BillingPhoneNEQ != nil { + predicates = append(predicates, organizationsetting.BillingPhoneNEQ(*i.BillingPhoneNEQ)) + } + if len(i.BillingPhoneIn) > 0 { + predicates = append(predicates, organizationsetting.BillingPhoneIn(i.BillingPhoneIn...)) + } + if len(i.BillingPhoneNotIn) > 0 { + predicates = append(predicates, organizationsetting.BillingPhoneNotIn(i.BillingPhoneNotIn...)) + } + if i.BillingPhoneGT != nil { + predicates = append(predicates, organizationsetting.BillingPhoneGT(*i.BillingPhoneGT)) + } + if i.BillingPhoneGTE != nil { + predicates = append(predicates, organizationsetting.BillingPhoneGTE(*i.BillingPhoneGTE)) + } + if i.BillingPhoneLT != nil { + predicates = append(predicates, organizationsetting.BillingPhoneLT(*i.BillingPhoneLT)) + } + if i.BillingPhoneLTE != nil { + predicates = append(predicates, organizationsetting.BillingPhoneLTE(*i.BillingPhoneLTE)) + } + if i.BillingPhoneContains != nil { + predicates = append(predicates, organizationsetting.BillingPhoneContains(*i.BillingPhoneContains)) + } + if i.BillingPhoneHasPrefix != nil { + predicates = append(predicates, organizationsetting.BillingPhoneHasPrefix(*i.BillingPhoneHasPrefix)) + } + if i.BillingPhoneHasSuffix != nil { + predicates = append(predicates, organizationsetting.BillingPhoneHasSuffix(*i.BillingPhoneHasSuffix)) + } + if i.BillingPhoneIsNil { + predicates = append(predicates, organizationsetting.BillingPhoneIsNil()) + } + if i.BillingPhoneNotNil { + predicates = append(predicates, organizationsetting.BillingPhoneNotNil()) + } + if i.BillingPhoneEqualFold != nil { + predicates = append(predicates, organizationsetting.BillingPhoneEqualFold(*i.BillingPhoneEqualFold)) + } + if i.BillingPhoneContainsFold != nil { + predicates = append(predicates, organizationsetting.BillingPhoneContainsFold(*i.BillingPhoneContainsFold)) + } + if i.BillingAddress != nil { + predicates = append(predicates, organizationsetting.BillingAddressEQ(*i.BillingAddress)) + } + if i.BillingAddressNEQ != nil { + predicates = append(predicates, organizationsetting.BillingAddressNEQ(*i.BillingAddressNEQ)) + } + if len(i.BillingAddressIn) > 0 { + predicates = append(predicates, organizationsetting.BillingAddressIn(i.BillingAddressIn...)) + } + if len(i.BillingAddressNotIn) > 0 { + predicates = append(predicates, organizationsetting.BillingAddressNotIn(i.BillingAddressNotIn...)) + } + if i.BillingAddressGT != nil { + predicates = append(predicates, organizationsetting.BillingAddressGT(*i.BillingAddressGT)) + } + if i.BillingAddressGTE != nil { + predicates = append(predicates, organizationsetting.BillingAddressGTE(*i.BillingAddressGTE)) + } + if i.BillingAddressLT != nil { + predicates = append(predicates, organizationsetting.BillingAddressLT(*i.BillingAddressLT)) + } + if i.BillingAddressLTE != nil { + predicates = append(predicates, organizationsetting.BillingAddressLTE(*i.BillingAddressLTE)) + } + if i.BillingAddressContains != nil { + predicates = append(predicates, organizationsetting.BillingAddressContains(*i.BillingAddressContains)) + } + if i.BillingAddressHasPrefix != nil { + predicates = append(predicates, organizationsetting.BillingAddressHasPrefix(*i.BillingAddressHasPrefix)) + } + if i.BillingAddressHasSuffix != nil { + predicates = append(predicates, organizationsetting.BillingAddressHasSuffix(*i.BillingAddressHasSuffix)) + } + if i.BillingAddressIsNil { + predicates = append(predicates, organizationsetting.BillingAddressIsNil()) + } + if i.BillingAddressNotNil { + predicates = append(predicates, organizationsetting.BillingAddressNotNil()) + } + if i.BillingAddressEqualFold != nil { + predicates = append(predicates, organizationsetting.BillingAddressEqualFold(*i.BillingAddressEqualFold)) + } + if i.BillingAddressContainsFold != nil { + predicates = append(predicates, organizationsetting.BillingAddressContainsFold(*i.BillingAddressContainsFold)) + } + if i.TaxIdentifier != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierEQ(*i.TaxIdentifier)) + } + if i.TaxIdentifierNEQ != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierNEQ(*i.TaxIdentifierNEQ)) + } + if len(i.TaxIdentifierIn) > 0 { + predicates = append(predicates, organizationsetting.TaxIdentifierIn(i.TaxIdentifierIn...)) + } + if len(i.TaxIdentifierNotIn) > 0 { + predicates = append(predicates, organizationsetting.TaxIdentifierNotIn(i.TaxIdentifierNotIn...)) + } + if i.TaxIdentifierGT != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierGT(*i.TaxIdentifierGT)) + } + if i.TaxIdentifierGTE != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierGTE(*i.TaxIdentifierGTE)) + } + if i.TaxIdentifierLT != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierLT(*i.TaxIdentifierLT)) + } + if i.TaxIdentifierLTE != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierLTE(*i.TaxIdentifierLTE)) + } + if i.TaxIdentifierContains != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierContains(*i.TaxIdentifierContains)) + } + if i.TaxIdentifierHasPrefix != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierHasPrefix(*i.TaxIdentifierHasPrefix)) + } + if i.TaxIdentifierHasSuffix != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierHasSuffix(*i.TaxIdentifierHasSuffix)) + } + if i.TaxIdentifierIsNil { + predicates = append(predicates, organizationsetting.TaxIdentifierIsNil()) + } + if i.TaxIdentifierNotNil { + predicates = append(predicates, organizationsetting.TaxIdentifierNotNil()) + } + if i.TaxIdentifierEqualFold != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierEqualFold(*i.TaxIdentifierEqualFold)) + } + if i.TaxIdentifierContainsFold != nil { + predicates = append(predicates, organizationsetting.TaxIdentifierContainsFold(*i.TaxIdentifierContainsFold)) + } + if i.GeoLocation != nil { + predicates = append(predicates, organizationsetting.GeoLocationEQ(*i.GeoLocation)) + } + if i.GeoLocationNEQ != nil { + predicates = append(predicates, organizationsetting.GeoLocationNEQ(*i.GeoLocationNEQ)) + } + if len(i.GeoLocationIn) > 0 { + predicates = append(predicates, organizationsetting.GeoLocationIn(i.GeoLocationIn...)) + } + if len(i.GeoLocationNotIn) > 0 { + predicates = append(predicates, organizationsetting.GeoLocationNotIn(i.GeoLocationNotIn...)) + } + if i.GeoLocationIsNil { + predicates = append(predicates, organizationsetting.GeoLocationIsNil()) + } + if i.GeoLocationNotNil { + predicates = append(predicates, organizationsetting.GeoLocationNotNil()) + } + if i.OrganizationID != nil { + predicates = append(predicates, organizationsetting.OrganizationIDEQ(*i.OrganizationID)) + } + if i.OrganizationIDNEQ != nil { + predicates = append(predicates, organizationsetting.OrganizationIDNEQ(*i.OrganizationIDNEQ)) + } + if len(i.OrganizationIDIn) > 0 { + predicates = append(predicates, organizationsetting.OrganizationIDIn(i.OrganizationIDIn...)) + } + if len(i.OrganizationIDNotIn) > 0 { + predicates = append(predicates, organizationsetting.OrganizationIDNotIn(i.OrganizationIDNotIn...)) + } + if i.OrganizationIDGT != nil { + predicates = append(predicates, organizationsetting.OrganizationIDGT(*i.OrganizationIDGT)) + } + if i.OrganizationIDGTE != nil { + predicates = append(predicates, organizationsetting.OrganizationIDGTE(*i.OrganizationIDGTE)) + } + if i.OrganizationIDLT != nil { + predicates = append(predicates, organizationsetting.OrganizationIDLT(*i.OrganizationIDLT)) + } + if i.OrganizationIDLTE != nil { + predicates = append(predicates, organizationsetting.OrganizationIDLTE(*i.OrganizationIDLTE)) + } + if i.OrganizationIDContains != nil { + predicates = append(predicates, organizationsetting.OrganizationIDContains(*i.OrganizationIDContains)) + } + if i.OrganizationIDHasPrefix != nil { + predicates = append(predicates, organizationsetting.OrganizationIDHasPrefix(*i.OrganizationIDHasPrefix)) + } + if i.OrganizationIDHasSuffix != nil { + predicates = append(predicates, organizationsetting.OrganizationIDHasSuffix(*i.OrganizationIDHasSuffix)) + } + if i.OrganizationIDIsNil { + predicates = append(predicates, organizationsetting.OrganizationIDIsNil()) + } + if i.OrganizationIDNotNil { + predicates = append(predicates, organizationsetting.OrganizationIDNotNil()) + } + if i.OrganizationIDEqualFold != nil { + predicates = append(predicates, organizationsetting.OrganizationIDEqualFold(*i.OrganizationIDEqualFold)) + } + if i.OrganizationIDContainsFold != nil { + predicates = append(predicates, organizationsetting.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) + } + + if i.HasOrganization != nil { + p := organizationsetting.HasOrganization() + if !*i.HasOrganization { + p = organizationsetting.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationWith)) + for _, w := range i.HasOrganizationWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, organizationsetting.HasOrganizationWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyOrganizationSettingWhereInput + case 1: + return predicates[0], nil + default: + return organizationsetting.And(predicates...), nil + } +} + +// OrganizationSettingHistoryWhereInput represents a where input for filtering OrganizationSettingHistory queries. +type OrganizationSettingHistoryWhereInput struct { + Predicates []predicate.OrganizationSettingHistory `json:"-"` + Not *OrganizationSettingHistoryWhereInput `json:"not,omitempty"` + Or []*OrganizationSettingHistoryWhereInput `json:"or,omitempty"` + And []*OrganizationSettingHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "billing_contact" field predicates. + BillingContact *string `json:"billingContact,omitempty"` + BillingContactNEQ *string `json:"billingContactNEQ,omitempty"` + BillingContactIn []string `json:"billingContactIn,omitempty"` + BillingContactNotIn []string `json:"billingContactNotIn,omitempty"` + BillingContactGT *string `json:"billingContactGT,omitempty"` + BillingContactGTE *string `json:"billingContactGTE,omitempty"` + BillingContactLT *string `json:"billingContactLT,omitempty"` + BillingContactLTE *string `json:"billingContactLTE,omitempty"` + BillingContactContains *string `json:"billingContactContains,omitempty"` + BillingContactHasPrefix *string `json:"billingContactHasPrefix,omitempty"` + BillingContactHasSuffix *string `json:"billingContactHasSuffix,omitempty"` + BillingContactIsNil bool `json:"billingContactIsNil,omitempty"` + BillingContactNotNil bool `json:"billingContactNotNil,omitempty"` + BillingContactEqualFold *string `json:"billingContactEqualFold,omitempty"` + BillingContactContainsFold *string `json:"billingContactContainsFold,omitempty"` + + // "billing_email" field predicates. + BillingEmail *string `json:"billingEmail,omitempty"` + BillingEmailNEQ *string `json:"billingEmailNEQ,omitempty"` + BillingEmailIn []string `json:"billingEmailIn,omitempty"` + BillingEmailNotIn []string `json:"billingEmailNotIn,omitempty"` + BillingEmailGT *string `json:"billingEmailGT,omitempty"` + BillingEmailGTE *string `json:"billingEmailGTE,omitempty"` + BillingEmailLT *string `json:"billingEmailLT,omitempty"` + BillingEmailLTE *string `json:"billingEmailLTE,omitempty"` + BillingEmailContains *string `json:"billingEmailContains,omitempty"` + BillingEmailHasPrefix *string `json:"billingEmailHasPrefix,omitempty"` + BillingEmailHasSuffix *string `json:"billingEmailHasSuffix,omitempty"` + BillingEmailIsNil bool `json:"billingEmailIsNil,omitempty"` + BillingEmailNotNil bool `json:"billingEmailNotNil,omitempty"` + BillingEmailEqualFold *string `json:"billingEmailEqualFold,omitempty"` + BillingEmailContainsFold *string `json:"billingEmailContainsFold,omitempty"` + + // "billing_phone" field predicates. + BillingPhone *string `json:"billingPhone,omitempty"` + BillingPhoneNEQ *string `json:"billingPhoneNEQ,omitempty"` + BillingPhoneIn []string `json:"billingPhoneIn,omitempty"` + BillingPhoneNotIn []string `json:"billingPhoneNotIn,omitempty"` + BillingPhoneGT *string `json:"billingPhoneGT,omitempty"` + BillingPhoneGTE *string `json:"billingPhoneGTE,omitempty"` + BillingPhoneLT *string `json:"billingPhoneLT,omitempty"` + BillingPhoneLTE *string `json:"billingPhoneLTE,omitempty"` + BillingPhoneContains *string `json:"billingPhoneContains,omitempty"` + BillingPhoneHasPrefix *string `json:"billingPhoneHasPrefix,omitempty"` + BillingPhoneHasSuffix *string `json:"billingPhoneHasSuffix,omitempty"` + BillingPhoneIsNil bool `json:"billingPhoneIsNil,omitempty"` + BillingPhoneNotNil bool `json:"billingPhoneNotNil,omitempty"` + BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` + BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` + + // "billing_address" field predicates. + BillingAddress *string `json:"billingAddress,omitempty"` + BillingAddressNEQ *string `json:"billingAddressNEQ,omitempty"` + BillingAddressIn []string `json:"billingAddressIn,omitempty"` + BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` + BillingAddressGT *string `json:"billingAddressGT,omitempty"` + BillingAddressGTE *string `json:"billingAddressGTE,omitempty"` + BillingAddressLT *string `json:"billingAddressLT,omitempty"` + BillingAddressLTE *string `json:"billingAddressLTE,omitempty"` + BillingAddressContains *string `json:"billingAddressContains,omitempty"` + BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` + BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` + BillingAddressIsNil bool `json:"billingAddressIsNil,omitempty"` + BillingAddressNotNil bool `json:"billingAddressNotNil,omitempty"` + BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` + BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` + + // "tax_identifier" field predicates. + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + TaxIdentifierNEQ *string `json:"taxIdentifierNEQ,omitempty"` + TaxIdentifierIn []string `json:"taxIdentifierIn,omitempty"` + TaxIdentifierNotIn []string `json:"taxIdentifierNotIn,omitempty"` + TaxIdentifierGT *string `json:"taxIdentifierGT,omitempty"` + TaxIdentifierGTE *string `json:"taxIdentifierGTE,omitempty"` + TaxIdentifierLT *string `json:"taxIdentifierLT,omitempty"` + TaxIdentifierLTE *string `json:"taxIdentifierLTE,omitempty"` + TaxIdentifierContains *string `json:"taxIdentifierContains,omitempty"` + TaxIdentifierHasPrefix *string `json:"taxIdentifierHasPrefix,omitempty"` + TaxIdentifierHasSuffix *string `json:"taxIdentifierHasSuffix,omitempty"` + TaxIdentifierIsNil bool `json:"taxIdentifierIsNil,omitempty"` + TaxIdentifierNotNil bool `json:"taxIdentifierNotNil,omitempty"` + TaxIdentifierEqualFold *string `json:"taxIdentifierEqualFold,omitempty"` + TaxIdentifierContainsFold *string `json:"taxIdentifierContainsFold,omitempty"` + + // "geo_location" field predicates. + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + GeoLocationNEQ *enums.Region `json:"geoLocationNEQ,omitempty"` + GeoLocationIn []enums.Region `json:"geoLocationIn,omitempty"` + GeoLocationNotIn []enums.Region `json:"geoLocationNotIn,omitempty"` + GeoLocationIsNil bool `json:"geoLocationIsNil,omitempty"` + GeoLocationNotNil bool `json:"geoLocationNotNil,omitempty"` + + // "organization_id" field predicates. + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNEQ *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGT *string `json:"organizationIDGT,omitempty"` + OrganizationIDGTE *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLT *string `json:"organizationIDLT,omitempty"` + OrganizationIDLTE *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDIsNil bool `json:"organizationIDIsNil,omitempty"` + OrganizationIDNotNil bool `json:"organizationIDNotNil,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *OrganizationSettingHistoryWhereInput) AddPredicates(predicates ...predicate.OrganizationSettingHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the OrganizationSettingHistoryWhereInput filter on the OrganizationSettingHistoryQuery builder. +func (i *OrganizationSettingHistoryWhereInput) Filter(q *OrganizationSettingHistoryQuery) (*OrganizationSettingHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyOrganizationSettingHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyOrganizationSettingHistoryWhereInput is returned in case the OrganizationSettingHistoryWhereInput is empty. +var ErrEmptyOrganizationSettingHistoryWhereInput = errors.New("generated: empty predicate OrganizationSettingHistoryWhereInput") + +// P returns a predicate for filtering organizationsettinghistories. +// An error is returned if the input is empty or invalid. +func (i *OrganizationSettingHistoryWhereInput) P() (predicate.OrganizationSettingHistory, error) { + var predicates []predicate.OrganizationSettingHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, organizationsettinghistory.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.OrganizationSettingHistory, 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, organizationsettinghistory.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.OrganizationSettingHistory, 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, organizationsettinghistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, organizationsettinghistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, organizationsettinghistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, organizationsettinghistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, organizationsettinghistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, organizationsettinghistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, organizationsettinghistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, organizationsettinghistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, organizationsettinghistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, organizationsettinghistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, organizationsettinghistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, organizationsettinghistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, organizationsettinghistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, organizationsettinghistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, organizationsettinghistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, organizationsettinghistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, organizationsettinghistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, organizationsettinghistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, organizationsettinghistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, organizationsettinghistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, organizationsettinghistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, organizationsettinghistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, organizationsettinghistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, organizationsettinghistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, organizationsettinghistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, organizationsettinghistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, organizationsettinghistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, organizationsettinghistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, organizationsettinghistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, organizationsettinghistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, organizationsettinghistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, organizationsettinghistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, organizationsettinghistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, organizationsettinghistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, organizationsettinghistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, organizationsettinghistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, organizationsettinghistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, organizationsettinghistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, organizationsettinghistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, organizationsettinghistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, organizationsettinghistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, organizationsettinghistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, organizationsettinghistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, organizationsettinghistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, organizationsettinghistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, organizationsettinghistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, organizationsettinghistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, organizationsettinghistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, organizationsettinghistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, organizationsettinghistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, organizationsettinghistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, organizationsettinghistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, organizationsettinghistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, organizationsettinghistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, organizationsettinghistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, organizationsettinghistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, organizationsettinghistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.BillingContact != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactEQ(*i.BillingContact)) + } + if i.BillingContactNEQ != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactNEQ(*i.BillingContactNEQ)) + } + if len(i.BillingContactIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingContactIn(i.BillingContactIn...)) + } + if len(i.BillingContactNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingContactNotIn(i.BillingContactNotIn...)) + } + if i.BillingContactGT != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactGT(*i.BillingContactGT)) + } + if i.BillingContactGTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactGTE(*i.BillingContactGTE)) + } + if i.BillingContactLT != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactLT(*i.BillingContactLT)) + } + if i.BillingContactLTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactLTE(*i.BillingContactLTE)) + } + if i.BillingContactContains != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactContains(*i.BillingContactContains)) + } + if i.BillingContactHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactHasPrefix(*i.BillingContactHasPrefix)) + } + if i.BillingContactHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactHasSuffix(*i.BillingContactHasSuffix)) + } + if i.BillingContactIsNil { + predicates = append(predicates, organizationsettinghistory.BillingContactIsNil()) + } + if i.BillingContactNotNil { + predicates = append(predicates, organizationsettinghistory.BillingContactNotNil()) + } + if i.BillingContactEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactEqualFold(*i.BillingContactEqualFold)) + } + if i.BillingContactContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingContactContainsFold(*i.BillingContactContainsFold)) + } + if i.BillingEmail != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailEQ(*i.BillingEmail)) + } + if i.BillingEmailNEQ != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailNEQ(*i.BillingEmailNEQ)) + } + if len(i.BillingEmailIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingEmailIn(i.BillingEmailIn...)) + } + if len(i.BillingEmailNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingEmailNotIn(i.BillingEmailNotIn...)) + } + if i.BillingEmailGT != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailGT(*i.BillingEmailGT)) + } + if i.BillingEmailGTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailGTE(*i.BillingEmailGTE)) + } + if i.BillingEmailLT != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailLT(*i.BillingEmailLT)) + } + if i.BillingEmailLTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailLTE(*i.BillingEmailLTE)) + } + if i.BillingEmailContains != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailContains(*i.BillingEmailContains)) + } + if i.BillingEmailHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailHasPrefix(*i.BillingEmailHasPrefix)) + } + if i.BillingEmailHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailHasSuffix(*i.BillingEmailHasSuffix)) + } + if i.BillingEmailIsNil { + predicates = append(predicates, organizationsettinghistory.BillingEmailIsNil()) + } + if i.BillingEmailNotNil { + predicates = append(predicates, organizationsettinghistory.BillingEmailNotNil()) + } + if i.BillingEmailEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailEqualFold(*i.BillingEmailEqualFold)) + } + if i.BillingEmailContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingEmailContainsFold(*i.BillingEmailContainsFold)) + } + if i.BillingPhone != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneEQ(*i.BillingPhone)) + } + if i.BillingPhoneNEQ != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneNEQ(*i.BillingPhoneNEQ)) + } + if len(i.BillingPhoneIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingPhoneIn(i.BillingPhoneIn...)) + } + if len(i.BillingPhoneNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingPhoneNotIn(i.BillingPhoneNotIn...)) + } + if i.BillingPhoneGT != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneGT(*i.BillingPhoneGT)) + } + if i.BillingPhoneGTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneGTE(*i.BillingPhoneGTE)) + } + if i.BillingPhoneLT != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneLT(*i.BillingPhoneLT)) + } + if i.BillingPhoneLTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneLTE(*i.BillingPhoneLTE)) + } + if i.BillingPhoneContains != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneContains(*i.BillingPhoneContains)) + } + if i.BillingPhoneHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneHasPrefix(*i.BillingPhoneHasPrefix)) + } + if i.BillingPhoneHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneHasSuffix(*i.BillingPhoneHasSuffix)) + } + if i.BillingPhoneIsNil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneIsNil()) + } + if i.BillingPhoneNotNil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneNotNil()) + } + if i.BillingPhoneEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneEqualFold(*i.BillingPhoneEqualFold)) + } + if i.BillingPhoneContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingPhoneContainsFold(*i.BillingPhoneContainsFold)) + } + if i.BillingAddress != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressEQ(*i.BillingAddress)) + } + if i.BillingAddressNEQ != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressNEQ(*i.BillingAddressNEQ)) + } + if len(i.BillingAddressIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingAddressIn(i.BillingAddressIn...)) + } + if len(i.BillingAddressNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.BillingAddressNotIn(i.BillingAddressNotIn...)) + } + if i.BillingAddressGT != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressGT(*i.BillingAddressGT)) + } + if i.BillingAddressGTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressGTE(*i.BillingAddressGTE)) + } + if i.BillingAddressLT != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressLT(*i.BillingAddressLT)) + } + if i.BillingAddressLTE != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressLTE(*i.BillingAddressLTE)) + } + if i.BillingAddressContains != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressContains(*i.BillingAddressContains)) + } + if i.BillingAddressHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressHasPrefix(*i.BillingAddressHasPrefix)) + } + if i.BillingAddressHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressHasSuffix(*i.BillingAddressHasSuffix)) + } + if i.BillingAddressIsNil { + predicates = append(predicates, organizationsettinghistory.BillingAddressIsNil()) + } + if i.BillingAddressNotNil { + predicates = append(predicates, organizationsettinghistory.BillingAddressNotNil()) + } + if i.BillingAddressEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressEqualFold(*i.BillingAddressEqualFold)) + } + if i.BillingAddressContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.BillingAddressContainsFold(*i.BillingAddressContainsFold)) + } + if i.TaxIdentifier != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierEQ(*i.TaxIdentifier)) + } + if i.TaxIdentifierNEQ != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierNEQ(*i.TaxIdentifierNEQ)) + } + if len(i.TaxIdentifierIn) > 0 { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierIn(i.TaxIdentifierIn...)) + } + if len(i.TaxIdentifierNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierNotIn(i.TaxIdentifierNotIn...)) + } + if i.TaxIdentifierGT != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierGT(*i.TaxIdentifierGT)) + } + if i.TaxIdentifierGTE != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierGTE(*i.TaxIdentifierGTE)) + } + if i.TaxIdentifierLT != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierLT(*i.TaxIdentifierLT)) + } + if i.TaxIdentifierLTE != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierLTE(*i.TaxIdentifierLTE)) + } + if i.TaxIdentifierContains != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierContains(*i.TaxIdentifierContains)) + } + if i.TaxIdentifierHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierHasPrefix(*i.TaxIdentifierHasPrefix)) + } + if i.TaxIdentifierHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierHasSuffix(*i.TaxIdentifierHasSuffix)) + } + if i.TaxIdentifierIsNil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierIsNil()) + } + if i.TaxIdentifierNotNil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierNotNil()) + } + if i.TaxIdentifierEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierEqualFold(*i.TaxIdentifierEqualFold)) + } + if i.TaxIdentifierContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.TaxIdentifierContainsFold(*i.TaxIdentifierContainsFold)) + } + if i.GeoLocation != nil { + predicates = append(predicates, organizationsettinghistory.GeoLocationEQ(*i.GeoLocation)) + } + if i.GeoLocationNEQ != nil { + predicates = append(predicates, organizationsettinghistory.GeoLocationNEQ(*i.GeoLocationNEQ)) + } + if len(i.GeoLocationIn) > 0 { + predicates = append(predicates, organizationsettinghistory.GeoLocationIn(i.GeoLocationIn...)) + } + if len(i.GeoLocationNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.GeoLocationNotIn(i.GeoLocationNotIn...)) + } + if i.GeoLocationIsNil { + predicates = append(predicates, organizationsettinghistory.GeoLocationIsNil()) + } + if i.GeoLocationNotNil { + predicates = append(predicates, organizationsettinghistory.GeoLocationNotNil()) + } + if i.OrganizationID != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDEQ(*i.OrganizationID)) + } + if i.OrganizationIDNEQ != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDNEQ(*i.OrganizationIDNEQ)) + } + if len(i.OrganizationIDIn) > 0 { + predicates = append(predicates, organizationsettinghistory.OrganizationIDIn(i.OrganizationIDIn...)) + } + if len(i.OrganizationIDNotIn) > 0 { + predicates = append(predicates, organizationsettinghistory.OrganizationIDNotIn(i.OrganizationIDNotIn...)) + } + if i.OrganizationIDGT != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDGT(*i.OrganizationIDGT)) + } + if i.OrganizationIDGTE != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDGTE(*i.OrganizationIDGTE)) + } + if i.OrganizationIDLT != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDLT(*i.OrganizationIDLT)) + } + if i.OrganizationIDLTE != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDLTE(*i.OrganizationIDLTE)) + } + if i.OrganizationIDContains != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDContains(*i.OrganizationIDContains)) + } + if i.OrganizationIDHasPrefix != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDHasPrefix(*i.OrganizationIDHasPrefix)) + } + if i.OrganizationIDHasSuffix != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDHasSuffix(*i.OrganizationIDHasSuffix)) + } + if i.OrganizationIDIsNil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDIsNil()) + } + if i.OrganizationIDNotNil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDNotNil()) + } + if i.OrganizationIDEqualFold != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDEqualFold(*i.OrganizationIDEqualFold)) + } + if i.OrganizationIDContainsFold != nil { + predicates = append(predicates, organizationsettinghistory.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyOrganizationSettingHistoryWhereInput + case 1: + return predicates[0], nil + default: + return organizationsettinghistory.And(predicates...), nil + } +} + +// PersonalAccessTokenWhereInput represents a where input for filtering PersonalAccessToken queries. +type PersonalAccessTokenWhereInput struct { + Predicates []predicate.PersonalAccessToken `json:"-"` + Not *PersonalAccessTokenWhereInput `json:"not,omitempty"` + Or []*PersonalAccessTokenWhereInput `json:"or,omitempty"` + And []*PersonalAccessTokenWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "expires_at" field predicates. + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNEQ *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGT *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGTE *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLT *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLTE *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil bool `json:"expiresAtNotNil,omitempty"` + + // "last_used_at" field predicates. + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + LastUsedAtNEQ *time.Time `json:"lastUsedAtNEQ,omitempty"` + LastUsedAtIn []time.Time `json:"lastUsedAtIn,omitempty"` + LastUsedAtNotIn []time.Time `json:"lastUsedAtNotIn,omitempty"` + LastUsedAtGT *time.Time `json:"lastUsedAtGT,omitempty"` + LastUsedAtGTE *time.Time `json:"lastUsedAtGTE,omitempty"` + LastUsedAtLT *time.Time `json:"lastUsedAtLT,omitempty"` + LastUsedAtLTE *time.Time `json:"lastUsedAtLTE,omitempty"` + LastUsedAtIsNil bool `json:"lastUsedAtIsNil,omitempty"` + LastUsedAtNotNil bool `json:"lastUsedAtNotNil,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*UserWhereInput `json:"hasOwnerWith,omitempty"` + + // "organizations" edge predicates. + HasOrganizations *bool `json:"hasOrganizations,omitempty"` + HasOrganizationsWith []*OrganizationWhereInput `json:"hasOrganizationsWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *PersonalAccessTokenWhereInput) AddPredicates(predicates ...predicate.PersonalAccessToken) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the PersonalAccessTokenWhereInput filter on the PersonalAccessTokenQuery builder. +func (i *PersonalAccessTokenWhereInput) Filter(q *PersonalAccessTokenQuery) (*PersonalAccessTokenQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyPersonalAccessTokenWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyPersonalAccessTokenWhereInput is returned in case the PersonalAccessTokenWhereInput is empty. +var ErrEmptyPersonalAccessTokenWhereInput = errors.New("generated: empty predicate PersonalAccessTokenWhereInput") + +// P returns a predicate for filtering personalaccesstokens. +// An error is returned if the input is empty or invalid. +func (i *PersonalAccessTokenWhereInput) P() (predicate.PersonalAccessToken, error) { + var predicates []predicate.PersonalAccessToken + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, personalaccesstoken.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.PersonalAccessToken, 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, personalaccesstoken.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.PersonalAccessToken, 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, personalaccesstoken.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, personalaccesstoken.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, personalaccesstoken.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, personalaccesstoken.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, personalaccesstoken.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, personalaccesstoken.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, personalaccesstoken.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, personalaccesstoken.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, personalaccesstoken.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, personalaccesstoken.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, personalaccesstoken.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, personalaccesstoken.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, personalaccesstoken.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, personalaccesstoken.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, personalaccesstoken.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, personalaccesstoken.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, personalaccesstoken.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, personalaccesstoken.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, personalaccesstoken.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, personalaccesstoken.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, personalaccesstoken.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, personalaccesstoken.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, personalaccesstoken.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, personalaccesstoken.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, personalaccesstoken.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, personalaccesstoken.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, personalaccesstoken.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, personalaccesstoken.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, personalaccesstoken.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, personalaccesstoken.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, personalaccesstoken.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, personalaccesstoken.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, personalaccesstoken.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, personalaccesstoken.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, personalaccesstoken.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, personalaccesstoken.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, personalaccesstoken.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, personalaccesstoken.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, personalaccesstoken.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, personalaccesstoken.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, personalaccesstoken.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, personalaccesstoken.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, personalaccesstoken.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, personalaccesstoken.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, personalaccesstoken.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, personalaccesstoken.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, personalaccesstoken.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, personalaccesstoken.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, personalaccesstoken.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, personalaccesstoken.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, personalaccesstoken.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, personalaccesstoken.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, personalaccesstoken.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, personalaccesstoken.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, personalaccesstoken.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, personalaccesstoken.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, personalaccesstoken.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, personalaccesstoken.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, personalaccesstoken.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, personalaccesstoken.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, personalaccesstoken.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, personalaccesstoken.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, personalaccesstoken.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, personalaccesstoken.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, personalaccesstoken.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, personalaccesstoken.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, personalaccesstoken.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, personalaccesstoken.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, personalaccesstoken.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, personalaccesstoken.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, personalaccesstoken.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, personalaccesstoken.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, personalaccesstoken.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, personalaccesstoken.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, personalaccesstoken.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, personalaccesstoken.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, personalaccesstoken.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, personalaccesstoken.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, personalaccesstoken.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, personalaccesstoken.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, personalaccesstoken.NameContainsFold(*i.NameContainsFold)) + } + if i.ExpiresAt != nil { + predicates = append(predicates, personalaccesstoken.ExpiresAtEQ(*i.ExpiresAt)) + } + if i.ExpiresAtNEQ != nil { + predicates = append(predicates, personalaccesstoken.ExpiresAtNEQ(*i.ExpiresAtNEQ)) + } + if len(i.ExpiresAtIn) > 0 { + predicates = append(predicates, personalaccesstoken.ExpiresAtIn(i.ExpiresAtIn...)) + } + if len(i.ExpiresAtNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.ExpiresAtNotIn(i.ExpiresAtNotIn...)) + } + if i.ExpiresAtGT != nil { + predicates = append(predicates, personalaccesstoken.ExpiresAtGT(*i.ExpiresAtGT)) + } + if i.ExpiresAtGTE != nil { + predicates = append(predicates, personalaccesstoken.ExpiresAtGTE(*i.ExpiresAtGTE)) + } + if i.ExpiresAtLT != nil { + predicates = append(predicates, personalaccesstoken.ExpiresAtLT(*i.ExpiresAtLT)) + } + if i.ExpiresAtLTE != nil { + predicates = append(predicates, personalaccesstoken.ExpiresAtLTE(*i.ExpiresAtLTE)) + } + if i.ExpiresAtIsNil { + predicates = append(predicates, personalaccesstoken.ExpiresAtIsNil()) + } + if i.ExpiresAtNotNil { + predicates = append(predicates, personalaccesstoken.ExpiresAtNotNil()) + } + if i.LastUsedAt != nil { + predicates = append(predicates, personalaccesstoken.LastUsedAtEQ(*i.LastUsedAt)) + } + if i.LastUsedAtNEQ != nil { + predicates = append(predicates, personalaccesstoken.LastUsedAtNEQ(*i.LastUsedAtNEQ)) + } + if len(i.LastUsedAtIn) > 0 { + predicates = append(predicates, personalaccesstoken.LastUsedAtIn(i.LastUsedAtIn...)) + } + if len(i.LastUsedAtNotIn) > 0 { + predicates = append(predicates, personalaccesstoken.LastUsedAtNotIn(i.LastUsedAtNotIn...)) + } + if i.LastUsedAtGT != nil { + predicates = append(predicates, personalaccesstoken.LastUsedAtGT(*i.LastUsedAtGT)) + } + if i.LastUsedAtGTE != nil { + predicates = append(predicates, personalaccesstoken.LastUsedAtGTE(*i.LastUsedAtGTE)) + } + if i.LastUsedAtLT != nil { + predicates = append(predicates, personalaccesstoken.LastUsedAtLT(*i.LastUsedAtLT)) + } + if i.LastUsedAtLTE != nil { + predicates = append(predicates, personalaccesstoken.LastUsedAtLTE(*i.LastUsedAtLTE)) + } + if i.LastUsedAtIsNil { + predicates = append(predicates, personalaccesstoken.LastUsedAtIsNil()) + } + if i.LastUsedAtNotNil { + predicates = append(predicates, personalaccesstoken.LastUsedAtNotNil()) + } + + if i.HasOwner != nil { + p := personalaccesstoken.HasOwner() + if !*i.HasOwner { + p = personalaccesstoken.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.User, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, personalaccesstoken.HasOwnerWith(with...)) + } + if i.HasOrganizations != nil { + p := personalaccesstoken.HasOrganizations() + if !*i.HasOrganizations { + p = personalaccesstoken.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationsWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationsWith)) + for _, w := range i.HasOrganizationsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, personalaccesstoken.HasOrganizationsWith(with...)) + } + if i.HasEvents != nil { + p := personalaccesstoken.HasEvents() + if !*i.HasEvents { + p = personalaccesstoken.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, personalaccesstoken.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyPersonalAccessTokenWhereInput + case 1: + return predicates[0], nil + default: + return personalaccesstoken.And(predicates...), nil + } +} + +// SubscriberWhereInput represents a where input for filtering Subscriber queries. +type SubscriberWhereInput struct { + Predicates []predicate.Subscriber `json:"-"` + Not *SubscriberWhereInput `json:"not,omitempty"` + Or []*SubscriberWhereInput `json:"or,omitempty"` + And []*SubscriberWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "email" field predicates. + Email *string `json:"email,omitempty"` + EmailNEQ *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGT *string `json:"emailGT,omitempty"` + EmailGTE *string `json:"emailGTE,omitempty"` + EmailLT *string `json:"emailLT,omitempty"` + EmailLTE *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + + // "phone_number" field predicates. + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNEQ *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGT *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGTE *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLT *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLTE *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + + // "verified_email" field predicates. + VerifiedEmail *bool `json:"verifiedEmail,omitempty"` + VerifiedEmailNEQ *bool `json:"verifiedEmailNEQ,omitempty"` + + // "verified_phone" field predicates. + VerifiedPhone *bool `json:"verifiedPhone,omitempty"` + VerifiedPhoneNEQ *bool `json:"verifiedPhoneNEQ,omitempty"` + + // "active" field predicates. + Active *bool `json:"active,omitempty"` + ActiveNEQ *bool `json:"activeNEQ,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *SubscriberWhereInput) AddPredicates(predicates ...predicate.Subscriber) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the SubscriberWhereInput filter on the SubscriberQuery builder. +func (i *SubscriberWhereInput) Filter(q *SubscriberQuery) (*SubscriberQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptySubscriberWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptySubscriberWhereInput is returned in case the SubscriberWhereInput is empty. +var ErrEmptySubscriberWhereInput = errors.New("generated: empty predicate SubscriberWhereInput") + +// P returns a predicate for filtering subscribers. +// An error is returned if the input is empty or invalid. +func (i *SubscriberWhereInput) P() (predicate.Subscriber, error) { + var predicates []predicate.Subscriber + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, subscriber.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.Subscriber, 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, subscriber.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.Subscriber, 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, subscriber.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, subscriber.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, subscriber.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, subscriber.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, subscriber.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, subscriber.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, subscriber.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, subscriber.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, subscriber.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, subscriber.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, subscriber.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, subscriber.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, subscriber.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, subscriber.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, subscriber.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, subscriber.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, subscriber.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, subscriber.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, subscriber.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, subscriber.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, subscriber.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, subscriber.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, subscriber.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, subscriber.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, subscriber.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, subscriber.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, subscriber.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, subscriber.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, subscriber.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, subscriber.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, subscriber.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, subscriber.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, subscriber.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, subscriber.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, subscriber.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, subscriber.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, subscriber.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, subscriber.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, subscriber.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, subscriber.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, subscriber.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, subscriber.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, subscriber.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, subscriber.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, subscriber.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, subscriber.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, subscriber.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, subscriber.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, subscriber.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, subscriber.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, subscriber.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, subscriber.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, subscriber.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, subscriber.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, subscriber.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, subscriber.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, subscriber.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, subscriber.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, subscriber.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, subscriber.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, subscriber.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, subscriber.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, subscriber.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, subscriber.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, subscriber.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, subscriber.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, subscriber.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, subscriber.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, subscriber.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, subscriber.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, subscriber.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, subscriber.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, subscriber.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, subscriber.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, subscriber.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, subscriber.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, subscriber.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, subscriber.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, subscriber.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, subscriber.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, subscriber.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, subscriber.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, subscriber.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, subscriber.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, subscriber.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, subscriber.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, subscriber.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, subscriber.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, subscriber.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, subscriber.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, subscriber.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, subscriber.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, subscriber.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, subscriber.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, subscriber.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, subscriber.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, subscriber.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, subscriber.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, subscriber.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, subscriber.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, subscriber.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Email != nil { + predicates = append(predicates, subscriber.EmailEQ(*i.Email)) + } + if i.EmailNEQ != nil { + predicates = append(predicates, subscriber.EmailNEQ(*i.EmailNEQ)) + } + if len(i.EmailIn) > 0 { + predicates = append(predicates, subscriber.EmailIn(i.EmailIn...)) + } + if len(i.EmailNotIn) > 0 { + predicates = append(predicates, subscriber.EmailNotIn(i.EmailNotIn...)) + } + if i.EmailGT != nil { + predicates = append(predicates, subscriber.EmailGT(*i.EmailGT)) + } + if i.EmailGTE != nil { + predicates = append(predicates, subscriber.EmailGTE(*i.EmailGTE)) + } + if i.EmailLT != nil { + predicates = append(predicates, subscriber.EmailLT(*i.EmailLT)) + } + if i.EmailLTE != nil { + predicates = append(predicates, subscriber.EmailLTE(*i.EmailLTE)) + } + if i.EmailContains != nil { + predicates = append(predicates, subscriber.EmailContains(*i.EmailContains)) + } + if i.EmailHasPrefix != nil { + predicates = append(predicates, subscriber.EmailHasPrefix(*i.EmailHasPrefix)) + } + if i.EmailHasSuffix != nil { + predicates = append(predicates, subscriber.EmailHasSuffix(*i.EmailHasSuffix)) + } + if i.EmailEqualFold != nil { + predicates = append(predicates, subscriber.EmailEqualFold(*i.EmailEqualFold)) + } + if i.EmailContainsFold != nil { + predicates = append(predicates, subscriber.EmailContainsFold(*i.EmailContainsFold)) + } + if i.PhoneNumber != nil { + predicates = append(predicates, subscriber.PhoneNumberEQ(*i.PhoneNumber)) + } + if i.PhoneNumberNEQ != nil { + predicates = append(predicates, subscriber.PhoneNumberNEQ(*i.PhoneNumberNEQ)) + } + if len(i.PhoneNumberIn) > 0 { + predicates = append(predicates, subscriber.PhoneNumberIn(i.PhoneNumberIn...)) + } + if len(i.PhoneNumberNotIn) > 0 { + predicates = append(predicates, subscriber.PhoneNumberNotIn(i.PhoneNumberNotIn...)) + } + if i.PhoneNumberGT != nil { + predicates = append(predicates, subscriber.PhoneNumberGT(*i.PhoneNumberGT)) + } + if i.PhoneNumberGTE != nil { + predicates = append(predicates, subscriber.PhoneNumberGTE(*i.PhoneNumberGTE)) + } + if i.PhoneNumberLT != nil { + predicates = append(predicates, subscriber.PhoneNumberLT(*i.PhoneNumberLT)) + } + if i.PhoneNumberLTE != nil { + predicates = append(predicates, subscriber.PhoneNumberLTE(*i.PhoneNumberLTE)) + } + if i.PhoneNumberContains != nil { + predicates = append(predicates, subscriber.PhoneNumberContains(*i.PhoneNumberContains)) + } + if i.PhoneNumberHasPrefix != nil { + predicates = append(predicates, subscriber.PhoneNumberHasPrefix(*i.PhoneNumberHasPrefix)) + } + if i.PhoneNumberHasSuffix != nil { + predicates = append(predicates, subscriber.PhoneNumberHasSuffix(*i.PhoneNumberHasSuffix)) + } + if i.PhoneNumberIsNil { + predicates = append(predicates, subscriber.PhoneNumberIsNil()) + } + if i.PhoneNumberNotNil { + predicates = append(predicates, subscriber.PhoneNumberNotNil()) + } + if i.PhoneNumberEqualFold != nil { + predicates = append(predicates, subscriber.PhoneNumberEqualFold(*i.PhoneNumberEqualFold)) + } + if i.PhoneNumberContainsFold != nil { + predicates = append(predicates, subscriber.PhoneNumberContainsFold(*i.PhoneNumberContainsFold)) + } + if i.VerifiedEmail != nil { + predicates = append(predicates, subscriber.VerifiedEmailEQ(*i.VerifiedEmail)) + } + if i.VerifiedEmailNEQ != nil { + predicates = append(predicates, subscriber.VerifiedEmailNEQ(*i.VerifiedEmailNEQ)) + } + if i.VerifiedPhone != nil { + predicates = append(predicates, subscriber.VerifiedPhoneEQ(*i.VerifiedPhone)) + } + if i.VerifiedPhoneNEQ != nil { + predicates = append(predicates, subscriber.VerifiedPhoneNEQ(*i.VerifiedPhoneNEQ)) + } + if i.Active != nil { + predicates = append(predicates, subscriber.ActiveEQ(*i.Active)) + } + if i.ActiveNEQ != nil { + predicates = append(predicates, subscriber.ActiveNEQ(*i.ActiveNEQ)) + } + + if i.HasOwner != nil { + p := subscriber.HasOwner() + if !*i.HasOwner { + p = subscriber.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, subscriber.HasOwnerWith(with...)) + } + if i.HasEvents != nil { + p := subscriber.HasEvents() + if !*i.HasEvents { + p = subscriber.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, subscriber.HasEventsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptySubscriberWhereInput + case 1: + return predicates[0], nil + default: + return subscriber.And(predicates...), nil + } +} + +// TFASettingWhereInput represents a where input for filtering TFASetting queries. +type TFASettingWhereInput struct { + Predicates []predicate.TFASetting `json:"-"` + Not *TFASettingWhereInput `json:"not,omitempty"` + Or []*TFASettingWhereInput `json:"or,omitempty"` + And []*TFASettingWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "tfa_secret" field predicates. + TfaSecret *string `json:"tfaSecret,omitempty"` + TfaSecretNEQ *string `json:"tfaSecretNEQ,omitempty"` + TfaSecretIn []string `json:"tfaSecretIn,omitempty"` + TfaSecretNotIn []string `json:"tfaSecretNotIn,omitempty"` + TfaSecretGT *string `json:"tfaSecretGT,omitempty"` + TfaSecretGTE *string `json:"tfaSecretGTE,omitempty"` + TfaSecretLT *string `json:"tfaSecretLT,omitempty"` + TfaSecretLTE *string `json:"tfaSecretLTE,omitempty"` + TfaSecretContains *string `json:"tfaSecretContains,omitempty"` + TfaSecretHasPrefix *string `json:"tfaSecretHasPrefix,omitempty"` + TfaSecretHasSuffix *string `json:"tfaSecretHasSuffix,omitempty"` + TfaSecretIsNil bool `json:"tfaSecretIsNil,omitempty"` + TfaSecretNotNil bool `json:"tfaSecretNotNil,omitempty"` + TfaSecretEqualFold *string `json:"tfaSecretEqualFold,omitempty"` + TfaSecretContainsFold *string `json:"tfaSecretContainsFold,omitempty"` + + // "verified" field predicates. + Verified *bool `json:"verified,omitempty"` + VerifiedNEQ *bool `json:"verifiedNEQ,omitempty"` + + // "totp_allowed" field predicates. + TotpAllowed *bool `json:"totpAllowed,omitempty"` + TotpAllowedNEQ *bool `json:"totpAllowedNEQ,omitempty"` + TotpAllowedIsNil bool `json:"totpAllowedIsNil,omitempty"` + TotpAllowedNotNil bool `json:"totpAllowedNotNil,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*UserWhereInput `json:"hasOwnerWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *TFASettingWhereInput) AddPredicates(predicates ...predicate.TFASetting) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the TFASettingWhereInput filter on the TFASettingQuery builder. +func (i *TFASettingWhereInput) Filter(q *TFASettingQuery) (*TFASettingQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyTFASettingWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyTFASettingWhereInput is returned in case the TFASettingWhereInput is empty. +var ErrEmptyTFASettingWhereInput = errors.New("generated: empty predicate TFASettingWhereInput") + +// P returns a predicate for filtering tfasettings. +// An error is returned if the input is empty or invalid. +func (i *TFASettingWhereInput) P() (predicate.TFASetting, error) { + var predicates []predicate.TFASetting + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, tfasetting.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.TFASetting, 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, tfasetting.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.TFASetting, 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, tfasetting.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, tfasetting.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, tfasetting.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, tfasetting.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, tfasetting.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, tfasetting.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, tfasetting.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, tfasetting.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, tfasetting.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, tfasetting.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, tfasetting.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, tfasetting.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, tfasetting.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, tfasetting.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, tfasetting.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, tfasetting.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, tfasetting.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, tfasetting.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, tfasetting.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, tfasetting.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, tfasetting.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, tfasetting.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, tfasetting.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, tfasetting.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, tfasetting.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, tfasetting.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, tfasetting.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, tfasetting.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, tfasetting.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, tfasetting.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, tfasetting.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, tfasetting.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, tfasetting.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, tfasetting.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, tfasetting.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, tfasetting.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, tfasetting.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, tfasetting.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, tfasetting.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, tfasetting.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, tfasetting.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, tfasetting.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, tfasetting.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, tfasetting.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, tfasetting.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, tfasetting.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, tfasetting.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, tfasetting.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, tfasetting.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, tfasetting.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, tfasetting.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, tfasetting.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, tfasetting.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, tfasetting.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, tfasetting.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, tfasetting.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, tfasetting.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, tfasetting.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, tfasetting.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, tfasetting.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, tfasetting.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, tfasetting.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, tfasetting.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, tfasetting.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, tfasetting.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, tfasetting.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, tfasetting.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, tfasetting.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, tfasetting.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, tfasetting.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, tfasetting.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, tfasetting.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, tfasetting.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, tfasetting.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, tfasetting.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, tfasetting.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, tfasetting.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, tfasetting.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, tfasetting.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, tfasetting.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, tfasetting.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, tfasetting.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, tfasetting.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, tfasetting.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, tfasetting.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, tfasetting.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.TfaSecret != nil { + predicates = append(predicates, tfasetting.TfaSecretEQ(*i.TfaSecret)) + } + if i.TfaSecretNEQ != nil { + predicates = append(predicates, tfasetting.TfaSecretNEQ(*i.TfaSecretNEQ)) + } + if len(i.TfaSecretIn) > 0 { + predicates = append(predicates, tfasetting.TfaSecretIn(i.TfaSecretIn...)) + } + if len(i.TfaSecretNotIn) > 0 { + predicates = append(predicates, tfasetting.TfaSecretNotIn(i.TfaSecretNotIn...)) + } + if i.TfaSecretGT != nil { + predicates = append(predicates, tfasetting.TfaSecretGT(*i.TfaSecretGT)) + } + if i.TfaSecretGTE != nil { + predicates = append(predicates, tfasetting.TfaSecretGTE(*i.TfaSecretGTE)) + } + if i.TfaSecretLT != nil { + predicates = append(predicates, tfasetting.TfaSecretLT(*i.TfaSecretLT)) + } + if i.TfaSecretLTE != nil { + predicates = append(predicates, tfasetting.TfaSecretLTE(*i.TfaSecretLTE)) + } + if i.TfaSecretContains != nil { + predicates = append(predicates, tfasetting.TfaSecretContains(*i.TfaSecretContains)) + } + if i.TfaSecretHasPrefix != nil { + predicates = append(predicates, tfasetting.TfaSecretHasPrefix(*i.TfaSecretHasPrefix)) + } + if i.TfaSecretHasSuffix != nil { + predicates = append(predicates, tfasetting.TfaSecretHasSuffix(*i.TfaSecretHasSuffix)) + } + if i.TfaSecretIsNil { + predicates = append(predicates, tfasetting.TfaSecretIsNil()) + } + if i.TfaSecretNotNil { + predicates = append(predicates, tfasetting.TfaSecretNotNil()) + } + if i.TfaSecretEqualFold != nil { + predicates = append(predicates, tfasetting.TfaSecretEqualFold(*i.TfaSecretEqualFold)) + } + if i.TfaSecretContainsFold != nil { + predicates = append(predicates, tfasetting.TfaSecretContainsFold(*i.TfaSecretContainsFold)) + } + if i.Verified != nil { + predicates = append(predicates, tfasetting.VerifiedEQ(*i.Verified)) + } + if i.VerifiedNEQ != nil { + predicates = append(predicates, tfasetting.VerifiedNEQ(*i.VerifiedNEQ)) + } + if i.TotpAllowed != nil { + predicates = append(predicates, tfasetting.TotpAllowedEQ(*i.TotpAllowed)) + } + if i.TotpAllowedNEQ != nil { + predicates = append(predicates, tfasetting.TotpAllowedNEQ(*i.TotpAllowedNEQ)) + } + if i.TotpAllowedIsNil { + predicates = append(predicates, tfasetting.TotpAllowedIsNil()) + } + if i.TotpAllowedNotNil { + predicates = append(predicates, tfasetting.TotpAllowedNotNil()) + } + + if i.HasOwner != nil { + p := tfasetting.HasOwner() + if !*i.HasOwner { + p = tfasetting.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.User, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, tfasetting.HasOwnerWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyTFASettingWhereInput + case 1: + return predicates[0], nil + default: + return tfasetting.And(predicates...), nil + } +} + +// TemplateWhereInput represents a where input for filtering Template queries. +type TemplateWhereInput struct { + Predicates []predicate.Template `json:"-"` + Not *TemplateWhereInput `json:"not,omitempty"` + Or []*TemplateWhereInput `json:"or,omitempty"` + And []*TemplateWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "template_type" field predicates. + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + TemplateTypeNEQ *enums.DocumentType `json:"templateTypeNEQ,omitempty"` + TemplateTypeIn []enums.DocumentType `json:"templateTypeIn,omitempty"` + TemplateTypeNotIn []enums.DocumentType `json:"templateTypeNotIn,omitempty"` + + // "description" field predicates. + Description *string `json:"description,omitempty"` + DescriptionNEQ *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGT *string `json:"descriptionGT,omitempty"` + DescriptionGTE *string `json:"descriptionGTE,omitempty"` + DescriptionLT *string `json:"descriptionLT,omitempty"` + DescriptionLTE *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "documents" edge predicates. + HasDocuments *bool `json:"hasDocuments,omitempty"` + HasDocumentsWith []*DocumentDataWhereInput `json:"hasDocumentsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *TemplateWhereInput) AddPredicates(predicates ...predicate.Template) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the TemplateWhereInput filter on the TemplateQuery builder. +func (i *TemplateWhereInput) Filter(q *TemplateQuery) (*TemplateQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyTemplateWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyTemplateWhereInput is returned in case the TemplateWhereInput is empty. +var ErrEmptyTemplateWhereInput = errors.New("generated: empty predicate TemplateWhereInput") + +// P returns a predicate for filtering templates. +// An error is returned if the input is empty or invalid. +func (i *TemplateWhereInput) P() (predicate.Template, error) { + var predicates []predicate.Template + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, template.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.Template, 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, template.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.Template, 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, template.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, template.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, template.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, template.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, template.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, template.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, template.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, template.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, template.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, template.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, template.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, template.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, template.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, template.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, template.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, template.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, template.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, template.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, template.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, template.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, template.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, template.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, template.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, template.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, template.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, template.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, template.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, template.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, template.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, template.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, template.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, template.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, template.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, template.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, template.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, template.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, template.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, template.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, template.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, template.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, template.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, template.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, template.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, template.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, template.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, template.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, template.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, template.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, template.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, template.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, template.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, template.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, template.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, template.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, template.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, template.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, template.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, template.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, template.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, template.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, template.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, template.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, template.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, template.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, template.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, template.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, template.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, template.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, template.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, template.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, template.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, template.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, template.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, template.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, template.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, template.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, template.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, template.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, template.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, template.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, template.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, template.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, template.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, template.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, template.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, template.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, template.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, template.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, template.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, template.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, template.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, template.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, template.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, template.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, template.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, template.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, template.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, template.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, template.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, template.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, template.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, template.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, template.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, template.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, template.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, template.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, template.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, template.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, template.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, template.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, template.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, template.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, template.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, template.NameContainsFold(*i.NameContainsFold)) + } + if i.TemplateType != nil { + predicates = append(predicates, template.TemplateTypeEQ(*i.TemplateType)) + } + if i.TemplateTypeNEQ != nil { + predicates = append(predicates, template.TemplateTypeNEQ(*i.TemplateTypeNEQ)) + } + if len(i.TemplateTypeIn) > 0 { + predicates = append(predicates, template.TemplateTypeIn(i.TemplateTypeIn...)) + } + if len(i.TemplateTypeNotIn) > 0 { + predicates = append(predicates, template.TemplateTypeNotIn(i.TemplateTypeNotIn...)) + } + if i.Description != nil { + predicates = append(predicates, template.DescriptionEQ(*i.Description)) + } + if i.DescriptionNEQ != nil { + predicates = append(predicates, template.DescriptionNEQ(*i.DescriptionNEQ)) + } + if len(i.DescriptionIn) > 0 { + predicates = append(predicates, template.DescriptionIn(i.DescriptionIn...)) + } + if len(i.DescriptionNotIn) > 0 { + predicates = append(predicates, template.DescriptionNotIn(i.DescriptionNotIn...)) + } + if i.DescriptionGT != nil { + predicates = append(predicates, template.DescriptionGT(*i.DescriptionGT)) + } + if i.DescriptionGTE != nil { + predicates = append(predicates, template.DescriptionGTE(*i.DescriptionGTE)) + } + if i.DescriptionLT != nil { + predicates = append(predicates, template.DescriptionLT(*i.DescriptionLT)) + } + if i.DescriptionLTE != nil { + predicates = append(predicates, template.DescriptionLTE(*i.DescriptionLTE)) + } + if i.DescriptionContains != nil { + predicates = append(predicates, template.DescriptionContains(*i.DescriptionContains)) + } + if i.DescriptionHasPrefix != nil { + predicates = append(predicates, template.DescriptionHasPrefix(*i.DescriptionHasPrefix)) + } + if i.DescriptionHasSuffix != nil { + predicates = append(predicates, template.DescriptionHasSuffix(*i.DescriptionHasSuffix)) + } + if i.DescriptionIsNil { + predicates = append(predicates, template.DescriptionIsNil()) + } + if i.DescriptionNotNil { + predicates = append(predicates, template.DescriptionNotNil()) + } + if i.DescriptionEqualFold != nil { + predicates = append(predicates, template.DescriptionEqualFold(*i.DescriptionEqualFold)) + } + if i.DescriptionContainsFold != nil { + predicates = append(predicates, template.DescriptionContainsFold(*i.DescriptionContainsFold)) + } + + if i.HasOwner != nil { + p := template.HasOwner() + if !*i.HasOwner { + p = template.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, template.HasOwnerWith(with...)) + } + if i.HasDocuments != nil { + p := template.HasDocuments() + if !*i.HasDocuments { + p = template.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasDocumentsWith) > 0 { + with := make([]predicate.DocumentData, 0, len(i.HasDocumentsWith)) + for _, w := range i.HasDocumentsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasDocumentsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, template.HasDocumentsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyTemplateWhereInput + case 1: + return predicates[0], nil + default: + return template.And(predicates...), nil + } +} + +// TemplateHistoryWhereInput represents a where input for filtering TemplateHistory queries. +type TemplateHistoryWhereInput struct { + Predicates []predicate.TemplateHistory `json:"-"` + Not *TemplateHistoryWhereInput `json:"not,omitempty"` + Or []*TemplateHistoryWhereInput `json:"or,omitempty"` + And []*TemplateHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "template_type" field predicates. + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + TemplateTypeNEQ *enums.DocumentType `json:"templateTypeNEQ,omitempty"` + TemplateTypeIn []enums.DocumentType `json:"templateTypeIn,omitempty"` + TemplateTypeNotIn []enums.DocumentType `json:"templateTypeNotIn,omitempty"` + + // "description" field predicates. + Description *string `json:"description,omitempty"` + DescriptionNEQ *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGT *string `json:"descriptionGT,omitempty"` + DescriptionGTE *string `json:"descriptionGTE,omitempty"` + DescriptionLT *string `json:"descriptionLT,omitempty"` + DescriptionLTE *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *TemplateHistoryWhereInput) AddPredicates(predicates ...predicate.TemplateHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the TemplateHistoryWhereInput filter on the TemplateHistoryQuery builder. +func (i *TemplateHistoryWhereInput) Filter(q *TemplateHistoryQuery) (*TemplateHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyTemplateHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyTemplateHistoryWhereInput is returned in case the TemplateHistoryWhereInput is empty. +var ErrEmptyTemplateHistoryWhereInput = errors.New("generated: empty predicate TemplateHistoryWhereInput") + +// P returns a predicate for filtering templatehistories. +// An error is returned if the input is empty or invalid. +func (i *TemplateHistoryWhereInput) P() (predicate.TemplateHistory, error) { + var predicates []predicate.TemplateHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, templatehistory.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.TemplateHistory, 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, templatehistory.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.TemplateHistory, 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, templatehistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, templatehistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, templatehistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, templatehistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, templatehistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, templatehistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, templatehistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, templatehistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, templatehistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, templatehistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, templatehistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, templatehistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, templatehistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, templatehistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, templatehistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, templatehistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, templatehistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, templatehistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, templatehistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, templatehistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, templatehistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, templatehistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, templatehistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, templatehistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, templatehistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, templatehistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, templatehistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, templatehistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, templatehistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, templatehistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, templatehistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, templatehistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, templatehistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, templatehistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, templatehistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, templatehistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, templatehistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, templatehistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, templatehistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, templatehistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, templatehistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, templatehistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, templatehistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, templatehistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, templatehistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, templatehistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, templatehistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, templatehistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, templatehistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, templatehistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, templatehistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, templatehistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, templatehistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, templatehistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, templatehistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, templatehistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, templatehistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, templatehistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, templatehistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, templatehistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, templatehistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, templatehistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, templatehistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, templatehistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, templatehistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, templatehistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, templatehistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, templatehistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, templatehistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, templatehistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, templatehistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, templatehistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, templatehistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, templatehistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, templatehistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, templatehistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, templatehistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, templatehistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, templatehistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, templatehistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, templatehistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, templatehistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, templatehistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, templatehistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, templatehistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, templatehistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, templatehistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, templatehistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, templatehistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, templatehistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, templatehistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, templatehistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, templatehistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, templatehistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, templatehistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, templatehistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, templatehistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, templatehistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, templatehistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, templatehistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, templatehistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, templatehistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, templatehistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, templatehistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, templatehistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, templatehistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, templatehistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, templatehistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, templatehistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, templatehistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, templatehistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, templatehistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, templatehistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, templatehistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, templatehistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, templatehistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, templatehistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, templatehistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, templatehistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, templatehistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, templatehistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, templatehistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, templatehistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, templatehistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, templatehistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, templatehistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, templatehistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, templatehistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, templatehistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, templatehistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, templatehistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, templatehistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, templatehistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, templatehistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, templatehistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, templatehistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, templatehistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, templatehistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, templatehistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, templatehistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, templatehistory.NameContainsFold(*i.NameContainsFold)) + } + if i.TemplateType != nil { + predicates = append(predicates, templatehistory.TemplateTypeEQ(*i.TemplateType)) + } + if i.TemplateTypeNEQ != nil { + predicates = append(predicates, templatehistory.TemplateTypeNEQ(*i.TemplateTypeNEQ)) + } + if len(i.TemplateTypeIn) > 0 { + predicates = append(predicates, templatehistory.TemplateTypeIn(i.TemplateTypeIn...)) + } + if len(i.TemplateTypeNotIn) > 0 { + predicates = append(predicates, templatehistory.TemplateTypeNotIn(i.TemplateTypeNotIn...)) + } + if i.Description != nil { + predicates = append(predicates, templatehistory.DescriptionEQ(*i.Description)) + } + if i.DescriptionNEQ != nil { + predicates = append(predicates, templatehistory.DescriptionNEQ(*i.DescriptionNEQ)) + } + if len(i.DescriptionIn) > 0 { + predicates = append(predicates, templatehistory.DescriptionIn(i.DescriptionIn...)) + } + if len(i.DescriptionNotIn) > 0 { + predicates = append(predicates, templatehistory.DescriptionNotIn(i.DescriptionNotIn...)) + } + if i.DescriptionGT != nil { + predicates = append(predicates, templatehistory.DescriptionGT(*i.DescriptionGT)) + } + if i.DescriptionGTE != nil { + predicates = append(predicates, templatehistory.DescriptionGTE(*i.DescriptionGTE)) + } + if i.DescriptionLT != nil { + predicates = append(predicates, templatehistory.DescriptionLT(*i.DescriptionLT)) + } + if i.DescriptionLTE != nil { + predicates = append(predicates, templatehistory.DescriptionLTE(*i.DescriptionLTE)) + } + if i.DescriptionContains != nil { + predicates = append(predicates, templatehistory.DescriptionContains(*i.DescriptionContains)) + } + if i.DescriptionHasPrefix != nil { + predicates = append(predicates, templatehistory.DescriptionHasPrefix(*i.DescriptionHasPrefix)) + } + if i.DescriptionHasSuffix != nil { + predicates = append(predicates, templatehistory.DescriptionHasSuffix(*i.DescriptionHasSuffix)) + } + if i.DescriptionIsNil { + predicates = append(predicates, templatehistory.DescriptionIsNil()) + } + if i.DescriptionNotNil { + predicates = append(predicates, templatehistory.DescriptionNotNil()) + } + if i.DescriptionEqualFold != nil { + predicates = append(predicates, templatehistory.DescriptionEqualFold(*i.DescriptionEqualFold)) + } + if i.DescriptionContainsFold != nil { + predicates = append(predicates, templatehistory.DescriptionContainsFold(*i.DescriptionContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyTemplateHistoryWhereInput + case 1: + return predicates[0], nil + default: + return templatehistory.And(predicates...), nil + } +} + +// UserWhereInput represents a where input for filtering User queries. +type UserWhereInput struct { + Predicates []predicate.User `json:"-"` + Not *UserWhereInput `json:"not,omitempty"` + Or []*UserWhereInput `json:"or,omitempty"` + And []*UserWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "email" field predicates. + Email *string `json:"email,omitempty"` + EmailNEQ *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGT *string `json:"emailGT,omitempty"` + EmailGTE *string `json:"emailGTE,omitempty"` + EmailLT *string `json:"emailLT,omitempty"` + EmailLTE *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + + // "first_name" field predicates. + FirstName *string `json:"firstName,omitempty"` + FirstNameNEQ *string `json:"firstNameNEQ,omitempty"` + FirstNameIn []string `json:"firstNameIn,omitempty"` + FirstNameNotIn []string `json:"firstNameNotIn,omitempty"` + FirstNameGT *string `json:"firstNameGT,omitempty"` + FirstNameGTE *string `json:"firstNameGTE,omitempty"` + FirstNameLT *string `json:"firstNameLT,omitempty"` + FirstNameLTE *string `json:"firstNameLTE,omitempty"` + FirstNameContains *string `json:"firstNameContains,omitempty"` + FirstNameHasPrefix *string `json:"firstNameHasPrefix,omitempty"` + FirstNameHasSuffix *string `json:"firstNameHasSuffix,omitempty"` + FirstNameIsNil bool `json:"firstNameIsNil,omitempty"` + FirstNameNotNil bool `json:"firstNameNotNil,omitempty"` + FirstNameEqualFold *string `json:"firstNameEqualFold,omitempty"` + FirstNameContainsFold *string `json:"firstNameContainsFold,omitempty"` + + // "last_name" field predicates. + LastName *string `json:"lastName,omitempty"` + LastNameNEQ *string `json:"lastNameNEQ,omitempty"` + LastNameIn []string `json:"lastNameIn,omitempty"` + LastNameNotIn []string `json:"lastNameNotIn,omitempty"` + LastNameGT *string `json:"lastNameGT,omitempty"` + LastNameGTE *string `json:"lastNameGTE,omitempty"` + LastNameLT *string `json:"lastNameLT,omitempty"` + LastNameLTE *string `json:"lastNameLTE,omitempty"` + LastNameContains *string `json:"lastNameContains,omitempty"` + LastNameHasPrefix *string `json:"lastNameHasPrefix,omitempty"` + LastNameHasSuffix *string `json:"lastNameHasSuffix,omitempty"` + LastNameIsNil bool `json:"lastNameIsNil,omitempty"` + LastNameNotNil bool `json:"lastNameNotNil,omitempty"` + LastNameEqualFold *string `json:"lastNameEqualFold,omitempty"` + LastNameContainsFold *string `json:"lastNameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "avatar_remote_url" field predicates. + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNEQ *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGT *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGTE *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLT *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLTE *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + + // "avatar_local_file" field predicates. + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + AvatarLocalFileNEQ *string `json:"avatarLocalFileNEQ,omitempty"` + AvatarLocalFileIn []string `json:"avatarLocalFileIn,omitempty"` + AvatarLocalFileNotIn []string `json:"avatarLocalFileNotIn,omitempty"` + AvatarLocalFileGT *string `json:"avatarLocalFileGT,omitempty"` + AvatarLocalFileGTE *string `json:"avatarLocalFileGTE,omitempty"` + AvatarLocalFileLT *string `json:"avatarLocalFileLT,omitempty"` + AvatarLocalFileLTE *string `json:"avatarLocalFileLTE,omitempty"` + AvatarLocalFileContains *string `json:"avatarLocalFileContains,omitempty"` + AvatarLocalFileHasPrefix *string `json:"avatarLocalFileHasPrefix,omitempty"` + AvatarLocalFileHasSuffix *string `json:"avatarLocalFileHasSuffix,omitempty"` + AvatarLocalFileIsNil bool `json:"avatarLocalFileIsNil,omitempty"` + AvatarLocalFileNotNil bool `json:"avatarLocalFileNotNil,omitempty"` + AvatarLocalFileEqualFold *string `json:"avatarLocalFileEqualFold,omitempty"` + AvatarLocalFileContainsFold *string `json:"avatarLocalFileContainsFold,omitempty"` + + // "avatar_updated_at" field predicates. + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + AvatarUpdatedAtNEQ *time.Time `json:"avatarUpdatedAtNEQ,omitempty"` + AvatarUpdatedAtIn []time.Time `json:"avatarUpdatedAtIn,omitempty"` + AvatarUpdatedAtNotIn []time.Time `json:"avatarUpdatedAtNotIn,omitempty"` + AvatarUpdatedAtGT *time.Time `json:"avatarUpdatedAtGT,omitempty"` + AvatarUpdatedAtGTE *time.Time `json:"avatarUpdatedAtGTE,omitempty"` + AvatarUpdatedAtLT *time.Time `json:"avatarUpdatedAtLT,omitempty"` + AvatarUpdatedAtLTE *time.Time `json:"avatarUpdatedAtLTE,omitempty"` + AvatarUpdatedAtIsNil bool `json:"avatarUpdatedAtIsNil,omitempty"` + AvatarUpdatedAtNotNil bool `json:"avatarUpdatedAtNotNil,omitempty"` + + // "last_seen" field predicates. + LastSeen *time.Time `json:"lastSeen,omitempty"` + LastSeenNEQ *time.Time `json:"lastSeenNEQ,omitempty"` + LastSeenIn []time.Time `json:"lastSeenIn,omitempty"` + LastSeenNotIn []time.Time `json:"lastSeenNotIn,omitempty"` + LastSeenGT *time.Time `json:"lastSeenGT,omitempty"` + LastSeenGTE *time.Time `json:"lastSeenGTE,omitempty"` + LastSeenLT *time.Time `json:"lastSeenLT,omitempty"` + LastSeenLTE *time.Time `json:"lastSeenLTE,omitempty"` + LastSeenIsNil bool `json:"lastSeenIsNil,omitempty"` + LastSeenNotNil bool `json:"lastSeenNotNil,omitempty"` + + // "password" field predicates. + Password *string `json:"password,omitempty"` + PasswordNEQ *string `json:"passwordNEQ,omitempty"` + PasswordIn []string `json:"passwordIn,omitempty"` + PasswordNotIn []string `json:"passwordNotIn,omitempty"` + PasswordGT *string `json:"passwordGT,omitempty"` + PasswordGTE *string `json:"passwordGTE,omitempty"` + PasswordLT *string `json:"passwordLT,omitempty"` + PasswordLTE *string `json:"passwordLTE,omitempty"` + PasswordContains *string `json:"passwordContains,omitempty"` + PasswordHasPrefix *string `json:"passwordHasPrefix,omitempty"` + PasswordHasSuffix *string `json:"passwordHasSuffix,omitempty"` + PasswordIsNil bool `json:"passwordIsNil,omitempty"` + PasswordNotNil bool `json:"passwordNotNil,omitempty"` + PasswordEqualFold *string `json:"passwordEqualFold,omitempty"` + PasswordContainsFold *string `json:"passwordContainsFold,omitempty"` + + // "sub" field predicates. + Sub *string `json:"sub,omitempty"` + SubNEQ *string `json:"subNEQ,omitempty"` + SubIn []string `json:"subIn,omitempty"` + SubNotIn []string `json:"subNotIn,omitempty"` + SubGT *string `json:"subGT,omitempty"` + SubGTE *string `json:"subGTE,omitempty"` + SubLT *string `json:"subLT,omitempty"` + SubLTE *string `json:"subLTE,omitempty"` + SubContains *string `json:"subContains,omitempty"` + SubHasPrefix *string `json:"subHasPrefix,omitempty"` + SubHasSuffix *string `json:"subHasSuffix,omitempty"` + SubIsNil bool `json:"subIsNil,omitempty"` + SubNotNil bool `json:"subNotNil,omitempty"` + SubEqualFold *string `json:"subEqualFold,omitempty"` + SubContainsFold *string `json:"subContainsFold,omitempty"` + + // "auth_provider" field predicates. + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + AuthProviderNEQ *enums.AuthProvider `json:"authProviderNEQ,omitempty"` + AuthProviderIn []enums.AuthProvider `json:"authProviderIn,omitempty"` + AuthProviderNotIn []enums.AuthProvider `json:"authProviderNotIn,omitempty"` + + // "role" field predicates. + Role *enums.Role `json:"role,omitempty"` + RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + RoleIsNil bool `json:"roleIsNil,omitempty"` + RoleNotNil bool `json:"roleNotNil,omitempty"` + + // "personal_access_tokens" edge predicates. + HasPersonalAccessTokens *bool `json:"hasPersonalAccessTokens,omitempty"` + HasPersonalAccessTokensWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokensWith,omitempty"` + + // "tfa_settings" edge predicates. + HasTfaSettings *bool `json:"hasTfaSettings,omitempty"` + HasTfaSettingsWith []*TFASettingWhereInput `json:"hasTfaSettingsWith,omitempty"` + + // "setting" edge predicates. + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*UserSettingWhereInput `json:"hasSettingWith,omitempty"` + + // "groups" edge predicates. + HasGroups *bool `json:"hasGroups,omitempty"` + HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"` + + // "organizations" edge predicates. + HasOrganizations *bool `json:"hasOrganizations,omitempty"` + HasOrganizationsWith []*OrganizationWhereInput `json:"hasOrganizationsWith,omitempty"` + + // "files" edge predicates. + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + + // "group_memberships" edge predicates. + HasGroupMemberships *bool `json:"hasGroupMemberships,omitempty"` + HasGroupMembershipsWith []*GroupMembershipWhereInput `json:"hasGroupMembershipsWith,omitempty"` + + // "org_memberships" edge predicates. + HasOrgMemberships *bool `json:"hasOrgMemberships,omitempty"` + HasOrgMembershipsWith []*OrgMembershipWhereInput `json:"hasOrgMembershipsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *UserWhereInput) AddPredicates(predicates ...predicate.User) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the UserWhereInput filter on the UserQuery builder. +func (i *UserWhereInput) Filter(q *UserQuery) (*UserQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyUserWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyUserWhereInput is returned in case the UserWhereInput is empty. +var ErrEmptyUserWhereInput = errors.New("generated: empty predicate UserWhereInput") + +// P returns a predicate for filtering users. +// An error is returned if the input is empty or invalid. +func (i *UserWhereInput) P() (predicate.User, error) { + var predicates []predicate.User + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, user.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.User, 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, user.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.User, 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, user.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, user.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, user.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, user.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, user.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, user.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, user.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, user.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, user.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, user.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, user.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, user.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, user.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, user.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, user.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, user.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, user.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, user.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, user.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, user.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, user.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, user.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, user.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, user.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, user.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, user.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, user.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, user.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, user.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, user.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, user.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, user.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, user.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, user.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, user.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, user.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, user.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, user.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, user.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, user.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, user.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, user.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, user.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, user.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, user.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, user.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, user.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, user.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, user.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, user.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, user.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, user.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, user.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, user.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, user.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, user.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, user.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, user.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, user.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, user.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, user.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, user.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, user.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, user.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, user.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, user.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, user.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, user.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, user.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, user.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, user.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, user.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, user.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, user.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, user.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, user.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, user.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, user.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, user.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, user.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, user.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, user.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, user.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, user.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, user.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, user.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Email != nil { + predicates = append(predicates, user.EmailEQ(*i.Email)) + } + if i.EmailNEQ != nil { + predicates = append(predicates, user.EmailNEQ(*i.EmailNEQ)) + } + if len(i.EmailIn) > 0 { + predicates = append(predicates, user.EmailIn(i.EmailIn...)) + } + if len(i.EmailNotIn) > 0 { + predicates = append(predicates, user.EmailNotIn(i.EmailNotIn...)) + } + if i.EmailGT != nil { + predicates = append(predicates, user.EmailGT(*i.EmailGT)) + } + if i.EmailGTE != nil { + predicates = append(predicates, user.EmailGTE(*i.EmailGTE)) + } + if i.EmailLT != nil { + predicates = append(predicates, user.EmailLT(*i.EmailLT)) + } + if i.EmailLTE != nil { + predicates = append(predicates, user.EmailLTE(*i.EmailLTE)) + } + if i.EmailContains != nil { + predicates = append(predicates, user.EmailContains(*i.EmailContains)) + } + if i.EmailHasPrefix != nil { + predicates = append(predicates, user.EmailHasPrefix(*i.EmailHasPrefix)) + } + if i.EmailHasSuffix != nil { + predicates = append(predicates, user.EmailHasSuffix(*i.EmailHasSuffix)) + } + if i.EmailEqualFold != nil { + predicates = append(predicates, user.EmailEqualFold(*i.EmailEqualFold)) + } + if i.EmailContainsFold != nil { + predicates = append(predicates, user.EmailContainsFold(*i.EmailContainsFold)) + } + if i.FirstName != nil { + predicates = append(predicates, user.FirstNameEQ(*i.FirstName)) + } + if i.FirstNameNEQ != nil { + predicates = append(predicates, user.FirstNameNEQ(*i.FirstNameNEQ)) + } + if len(i.FirstNameIn) > 0 { + predicates = append(predicates, user.FirstNameIn(i.FirstNameIn...)) + } + if len(i.FirstNameNotIn) > 0 { + predicates = append(predicates, user.FirstNameNotIn(i.FirstNameNotIn...)) + } + if i.FirstNameGT != nil { + predicates = append(predicates, user.FirstNameGT(*i.FirstNameGT)) + } + if i.FirstNameGTE != nil { + predicates = append(predicates, user.FirstNameGTE(*i.FirstNameGTE)) + } + if i.FirstNameLT != nil { + predicates = append(predicates, user.FirstNameLT(*i.FirstNameLT)) + } + if i.FirstNameLTE != nil { + predicates = append(predicates, user.FirstNameLTE(*i.FirstNameLTE)) + } + if i.FirstNameContains != nil { + predicates = append(predicates, user.FirstNameContains(*i.FirstNameContains)) + } + if i.FirstNameHasPrefix != nil { + predicates = append(predicates, user.FirstNameHasPrefix(*i.FirstNameHasPrefix)) + } + if i.FirstNameHasSuffix != nil { + predicates = append(predicates, user.FirstNameHasSuffix(*i.FirstNameHasSuffix)) + } + if i.FirstNameIsNil { + predicates = append(predicates, user.FirstNameIsNil()) + } + if i.FirstNameNotNil { + predicates = append(predicates, user.FirstNameNotNil()) + } + if i.FirstNameEqualFold != nil { + predicates = append(predicates, user.FirstNameEqualFold(*i.FirstNameEqualFold)) + } + if i.FirstNameContainsFold != nil { + predicates = append(predicates, user.FirstNameContainsFold(*i.FirstNameContainsFold)) + } + if i.LastName != nil { + predicates = append(predicates, user.LastNameEQ(*i.LastName)) + } + if i.LastNameNEQ != nil { + predicates = append(predicates, user.LastNameNEQ(*i.LastNameNEQ)) + } + if len(i.LastNameIn) > 0 { + predicates = append(predicates, user.LastNameIn(i.LastNameIn...)) + } + if len(i.LastNameNotIn) > 0 { + predicates = append(predicates, user.LastNameNotIn(i.LastNameNotIn...)) + } + if i.LastNameGT != nil { + predicates = append(predicates, user.LastNameGT(*i.LastNameGT)) + } + if i.LastNameGTE != nil { + predicates = append(predicates, user.LastNameGTE(*i.LastNameGTE)) + } + if i.LastNameLT != nil { + predicates = append(predicates, user.LastNameLT(*i.LastNameLT)) + } + if i.LastNameLTE != nil { + predicates = append(predicates, user.LastNameLTE(*i.LastNameLTE)) + } + if i.LastNameContains != nil { + predicates = append(predicates, user.LastNameContains(*i.LastNameContains)) + } + if i.LastNameHasPrefix != nil { + predicates = append(predicates, user.LastNameHasPrefix(*i.LastNameHasPrefix)) + } + if i.LastNameHasSuffix != nil { + predicates = append(predicates, user.LastNameHasSuffix(*i.LastNameHasSuffix)) + } + if i.LastNameIsNil { + predicates = append(predicates, user.LastNameIsNil()) + } + if i.LastNameNotNil { + predicates = append(predicates, user.LastNameNotNil()) + } + if i.LastNameEqualFold != nil { + predicates = append(predicates, user.LastNameEqualFold(*i.LastNameEqualFold)) + } + if i.LastNameContainsFold != nil { + predicates = append(predicates, user.LastNameContainsFold(*i.LastNameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, user.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, user.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, user.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, user.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, user.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, user.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, user.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, user.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, user.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, user.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, user.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, user.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, user.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.AvatarRemoteURL != nil { + predicates = append(predicates, user.AvatarRemoteURLEQ(*i.AvatarRemoteURL)) + } + if i.AvatarRemoteURLNEQ != nil { + predicates = append(predicates, user.AvatarRemoteURLNEQ(*i.AvatarRemoteURLNEQ)) + } + if len(i.AvatarRemoteURLIn) > 0 { + predicates = append(predicates, user.AvatarRemoteURLIn(i.AvatarRemoteURLIn...)) + } + if len(i.AvatarRemoteURLNotIn) > 0 { + predicates = append(predicates, user.AvatarRemoteURLNotIn(i.AvatarRemoteURLNotIn...)) + } + if i.AvatarRemoteURLGT != nil { + predicates = append(predicates, user.AvatarRemoteURLGT(*i.AvatarRemoteURLGT)) + } + if i.AvatarRemoteURLGTE != nil { + predicates = append(predicates, user.AvatarRemoteURLGTE(*i.AvatarRemoteURLGTE)) + } + if i.AvatarRemoteURLLT != nil { + predicates = append(predicates, user.AvatarRemoteURLLT(*i.AvatarRemoteURLLT)) + } + if i.AvatarRemoteURLLTE != nil { + predicates = append(predicates, user.AvatarRemoteURLLTE(*i.AvatarRemoteURLLTE)) + } + if i.AvatarRemoteURLContains != nil { + predicates = append(predicates, user.AvatarRemoteURLContains(*i.AvatarRemoteURLContains)) + } + if i.AvatarRemoteURLHasPrefix != nil { + predicates = append(predicates, user.AvatarRemoteURLHasPrefix(*i.AvatarRemoteURLHasPrefix)) + } + if i.AvatarRemoteURLHasSuffix != nil { + predicates = append(predicates, user.AvatarRemoteURLHasSuffix(*i.AvatarRemoteURLHasSuffix)) + } + if i.AvatarRemoteURLIsNil { + predicates = append(predicates, user.AvatarRemoteURLIsNil()) + } + if i.AvatarRemoteURLNotNil { + predicates = append(predicates, user.AvatarRemoteURLNotNil()) + } + if i.AvatarRemoteURLEqualFold != nil { + predicates = append(predicates, user.AvatarRemoteURLEqualFold(*i.AvatarRemoteURLEqualFold)) + } + if i.AvatarRemoteURLContainsFold != nil { + predicates = append(predicates, user.AvatarRemoteURLContainsFold(*i.AvatarRemoteURLContainsFold)) + } + if i.AvatarLocalFile != nil { + predicates = append(predicates, user.AvatarLocalFileEQ(*i.AvatarLocalFile)) + } + if i.AvatarLocalFileNEQ != nil { + predicates = append(predicates, user.AvatarLocalFileNEQ(*i.AvatarLocalFileNEQ)) + } + if len(i.AvatarLocalFileIn) > 0 { + predicates = append(predicates, user.AvatarLocalFileIn(i.AvatarLocalFileIn...)) + } + if len(i.AvatarLocalFileNotIn) > 0 { + predicates = append(predicates, user.AvatarLocalFileNotIn(i.AvatarLocalFileNotIn...)) + } + if i.AvatarLocalFileGT != nil { + predicates = append(predicates, user.AvatarLocalFileGT(*i.AvatarLocalFileGT)) + } + if i.AvatarLocalFileGTE != nil { + predicates = append(predicates, user.AvatarLocalFileGTE(*i.AvatarLocalFileGTE)) + } + if i.AvatarLocalFileLT != nil { + predicates = append(predicates, user.AvatarLocalFileLT(*i.AvatarLocalFileLT)) + } + if i.AvatarLocalFileLTE != nil { + predicates = append(predicates, user.AvatarLocalFileLTE(*i.AvatarLocalFileLTE)) + } + if i.AvatarLocalFileContains != nil { + predicates = append(predicates, user.AvatarLocalFileContains(*i.AvatarLocalFileContains)) + } + if i.AvatarLocalFileHasPrefix != nil { + predicates = append(predicates, user.AvatarLocalFileHasPrefix(*i.AvatarLocalFileHasPrefix)) + } + if i.AvatarLocalFileHasSuffix != nil { + predicates = append(predicates, user.AvatarLocalFileHasSuffix(*i.AvatarLocalFileHasSuffix)) + } + if i.AvatarLocalFileIsNil { + predicates = append(predicates, user.AvatarLocalFileIsNil()) + } + if i.AvatarLocalFileNotNil { + predicates = append(predicates, user.AvatarLocalFileNotNil()) + } + if i.AvatarLocalFileEqualFold != nil { + predicates = append(predicates, user.AvatarLocalFileEqualFold(*i.AvatarLocalFileEqualFold)) + } + if i.AvatarLocalFileContainsFold != nil { + predicates = append(predicates, user.AvatarLocalFileContainsFold(*i.AvatarLocalFileContainsFold)) + } + if i.AvatarUpdatedAt != nil { + predicates = append(predicates, user.AvatarUpdatedAtEQ(*i.AvatarUpdatedAt)) + } + if i.AvatarUpdatedAtNEQ != nil { + predicates = append(predicates, user.AvatarUpdatedAtNEQ(*i.AvatarUpdatedAtNEQ)) + } + if len(i.AvatarUpdatedAtIn) > 0 { + predicates = append(predicates, user.AvatarUpdatedAtIn(i.AvatarUpdatedAtIn...)) + } + if len(i.AvatarUpdatedAtNotIn) > 0 { + predicates = append(predicates, user.AvatarUpdatedAtNotIn(i.AvatarUpdatedAtNotIn...)) + } + if i.AvatarUpdatedAtGT != nil { + predicates = append(predicates, user.AvatarUpdatedAtGT(*i.AvatarUpdatedAtGT)) + } + if i.AvatarUpdatedAtGTE != nil { + predicates = append(predicates, user.AvatarUpdatedAtGTE(*i.AvatarUpdatedAtGTE)) + } + if i.AvatarUpdatedAtLT != nil { + predicates = append(predicates, user.AvatarUpdatedAtLT(*i.AvatarUpdatedAtLT)) + } + if i.AvatarUpdatedAtLTE != nil { + predicates = append(predicates, user.AvatarUpdatedAtLTE(*i.AvatarUpdatedAtLTE)) + } + if i.AvatarUpdatedAtIsNil { + predicates = append(predicates, user.AvatarUpdatedAtIsNil()) + } + if i.AvatarUpdatedAtNotNil { + predicates = append(predicates, user.AvatarUpdatedAtNotNil()) + } + if i.LastSeen != nil { + predicates = append(predicates, user.LastSeenEQ(*i.LastSeen)) + } + if i.LastSeenNEQ != nil { + predicates = append(predicates, user.LastSeenNEQ(*i.LastSeenNEQ)) + } + if len(i.LastSeenIn) > 0 { + predicates = append(predicates, user.LastSeenIn(i.LastSeenIn...)) + } + if len(i.LastSeenNotIn) > 0 { + predicates = append(predicates, user.LastSeenNotIn(i.LastSeenNotIn...)) + } + if i.LastSeenGT != nil { + predicates = append(predicates, user.LastSeenGT(*i.LastSeenGT)) + } + if i.LastSeenGTE != nil { + predicates = append(predicates, user.LastSeenGTE(*i.LastSeenGTE)) + } + if i.LastSeenLT != nil { + predicates = append(predicates, user.LastSeenLT(*i.LastSeenLT)) + } + if i.LastSeenLTE != nil { + predicates = append(predicates, user.LastSeenLTE(*i.LastSeenLTE)) + } + if i.LastSeenIsNil { + predicates = append(predicates, user.LastSeenIsNil()) + } + if i.LastSeenNotNil { + predicates = append(predicates, user.LastSeenNotNil()) + } + if i.Password != nil { + predicates = append(predicates, user.PasswordEQ(*i.Password)) + } + if i.PasswordNEQ != nil { + predicates = append(predicates, user.PasswordNEQ(*i.PasswordNEQ)) + } + if len(i.PasswordIn) > 0 { + predicates = append(predicates, user.PasswordIn(i.PasswordIn...)) + } + if len(i.PasswordNotIn) > 0 { + predicates = append(predicates, user.PasswordNotIn(i.PasswordNotIn...)) + } + if i.PasswordGT != nil { + predicates = append(predicates, user.PasswordGT(*i.PasswordGT)) + } + if i.PasswordGTE != nil { + predicates = append(predicates, user.PasswordGTE(*i.PasswordGTE)) + } + if i.PasswordLT != nil { + predicates = append(predicates, user.PasswordLT(*i.PasswordLT)) + } + if i.PasswordLTE != nil { + predicates = append(predicates, user.PasswordLTE(*i.PasswordLTE)) + } + if i.PasswordContains != nil { + predicates = append(predicates, user.PasswordContains(*i.PasswordContains)) + } + if i.PasswordHasPrefix != nil { + predicates = append(predicates, user.PasswordHasPrefix(*i.PasswordHasPrefix)) + } + if i.PasswordHasSuffix != nil { + predicates = append(predicates, user.PasswordHasSuffix(*i.PasswordHasSuffix)) + } + if i.PasswordIsNil { + predicates = append(predicates, user.PasswordIsNil()) + } + if i.PasswordNotNil { + predicates = append(predicates, user.PasswordNotNil()) + } + if i.PasswordEqualFold != nil { + predicates = append(predicates, user.PasswordEqualFold(*i.PasswordEqualFold)) + } + if i.PasswordContainsFold != nil { + predicates = append(predicates, user.PasswordContainsFold(*i.PasswordContainsFold)) + } + if i.Sub != nil { + predicates = append(predicates, user.SubEQ(*i.Sub)) + } + if i.SubNEQ != nil { + predicates = append(predicates, user.SubNEQ(*i.SubNEQ)) + } + if len(i.SubIn) > 0 { + predicates = append(predicates, user.SubIn(i.SubIn...)) + } + if len(i.SubNotIn) > 0 { + predicates = append(predicates, user.SubNotIn(i.SubNotIn...)) + } + if i.SubGT != nil { + predicates = append(predicates, user.SubGT(*i.SubGT)) + } + if i.SubGTE != nil { + predicates = append(predicates, user.SubGTE(*i.SubGTE)) + } + if i.SubLT != nil { + predicates = append(predicates, user.SubLT(*i.SubLT)) + } + if i.SubLTE != nil { + predicates = append(predicates, user.SubLTE(*i.SubLTE)) + } + if i.SubContains != nil { + predicates = append(predicates, user.SubContains(*i.SubContains)) + } + if i.SubHasPrefix != nil { + predicates = append(predicates, user.SubHasPrefix(*i.SubHasPrefix)) + } + if i.SubHasSuffix != nil { + predicates = append(predicates, user.SubHasSuffix(*i.SubHasSuffix)) + } + if i.SubIsNil { + predicates = append(predicates, user.SubIsNil()) + } + if i.SubNotNil { + predicates = append(predicates, user.SubNotNil()) + } + if i.SubEqualFold != nil { + predicates = append(predicates, user.SubEqualFold(*i.SubEqualFold)) + } + if i.SubContainsFold != nil { + predicates = append(predicates, user.SubContainsFold(*i.SubContainsFold)) + } + if i.AuthProvider != nil { + predicates = append(predicates, user.AuthProviderEQ(*i.AuthProvider)) + } + if i.AuthProviderNEQ != nil { + predicates = append(predicates, user.AuthProviderNEQ(*i.AuthProviderNEQ)) + } + if len(i.AuthProviderIn) > 0 { + predicates = append(predicates, user.AuthProviderIn(i.AuthProviderIn...)) + } + if len(i.AuthProviderNotIn) > 0 { + predicates = append(predicates, user.AuthProviderNotIn(i.AuthProviderNotIn...)) + } + if i.Role != nil { + predicates = append(predicates, user.RoleEQ(*i.Role)) + } + if i.RoleNEQ != nil { + predicates = append(predicates, user.RoleNEQ(*i.RoleNEQ)) + } + if len(i.RoleIn) > 0 { + predicates = append(predicates, user.RoleIn(i.RoleIn...)) + } + if len(i.RoleNotIn) > 0 { + predicates = append(predicates, user.RoleNotIn(i.RoleNotIn...)) + } + if i.RoleIsNil { + predicates = append(predicates, user.RoleIsNil()) + } + if i.RoleNotNil { + predicates = append(predicates, user.RoleNotNil()) + } + + if i.HasPersonalAccessTokens != nil { + p := user.HasPersonalAccessTokens() + if !*i.HasPersonalAccessTokens { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasPersonalAccessTokensWith) > 0 { + with := make([]predicate.PersonalAccessToken, 0, len(i.HasPersonalAccessTokensWith)) + for _, w := range i.HasPersonalAccessTokensWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasPersonalAccessTokensWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasPersonalAccessTokensWith(with...)) + } + if i.HasTfaSettings != nil { + p := user.HasTfaSettings() + if !*i.HasTfaSettings { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasTfaSettingsWith) > 0 { + with := make([]predicate.TFASetting, 0, len(i.HasTfaSettingsWith)) + for _, w := range i.HasTfaSettingsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasTfaSettingsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasTfaSettingsWith(with...)) + } + if i.HasSetting != nil { + p := user.HasSetting() + if !*i.HasSetting { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasSettingWith) > 0 { + with := make([]predicate.UserSetting, 0, len(i.HasSettingWith)) + for _, w := range i.HasSettingWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasSettingWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasSettingWith(with...)) + } + if i.HasGroups != nil { + p := user.HasGroups() + if !*i.HasGroups { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupsWith) > 0 { + with := make([]predicate.Group, 0, len(i.HasGroupsWith)) + for _, w := range i.HasGroupsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasGroupsWith(with...)) + } + if i.HasOrganizations != nil { + p := user.HasOrganizations() + if !*i.HasOrganizations { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrganizationsWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOrganizationsWith)) + for _, w := range i.HasOrganizationsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrganizationsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasOrganizationsWith(with...)) + } + if i.HasFiles != nil { + p := user.HasFiles() + if !*i.HasFiles { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasFilesWith) > 0 { + with := make([]predicate.File, 0, len(i.HasFilesWith)) + for _, w := range i.HasFilesWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasFilesWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasFilesWith(with...)) + } + if i.HasEvents != nil { + p := user.HasEvents() + if !*i.HasEvents { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasEventsWith(with...)) + } + if i.HasGroupMemberships != nil { + p := user.HasGroupMemberships() + if !*i.HasGroupMemberships { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasGroupMembershipsWith) > 0 { + with := make([]predicate.GroupMembership, 0, len(i.HasGroupMembershipsWith)) + for _, w := range i.HasGroupMembershipsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasGroupMembershipsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasGroupMembershipsWith(with...)) + } + if i.HasOrgMemberships != nil { + p := user.HasOrgMemberships() + if !*i.HasOrgMemberships { + p = user.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOrgMembershipsWith) > 0 { + with := make([]predicate.OrgMembership, 0, len(i.HasOrgMembershipsWith)) + for _, w := range i.HasOrgMembershipsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOrgMembershipsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, user.HasOrgMembershipsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyUserWhereInput + case 1: + return predicates[0], nil + default: + return user.And(predicates...), nil + } +} + +// UserHistoryWhereInput represents a where input for filtering UserHistory queries. +type UserHistoryWhereInput struct { + Predicates []predicate.UserHistory `json:"-"` + Not *UserHistoryWhereInput `json:"not,omitempty"` + Or []*UserHistoryWhereInput `json:"or,omitempty"` + And []*UserHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "email" field predicates. + Email *string `json:"email,omitempty"` + EmailNEQ *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGT *string `json:"emailGT,omitempty"` + EmailGTE *string `json:"emailGTE,omitempty"` + EmailLT *string `json:"emailLT,omitempty"` + EmailLTE *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + + // "first_name" field predicates. + FirstName *string `json:"firstName,omitempty"` + FirstNameNEQ *string `json:"firstNameNEQ,omitempty"` + FirstNameIn []string `json:"firstNameIn,omitempty"` + FirstNameNotIn []string `json:"firstNameNotIn,omitempty"` + FirstNameGT *string `json:"firstNameGT,omitempty"` + FirstNameGTE *string `json:"firstNameGTE,omitempty"` + FirstNameLT *string `json:"firstNameLT,omitempty"` + FirstNameLTE *string `json:"firstNameLTE,omitempty"` + FirstNameContains *string `json:"firstNameContains,omitempty"` + FirstNameHasPrefix *string `json:"firstNameHasPrefix,omitempty"` + FirstNameHasSuffix *string `json:"firstNameHasSuffix,omitempty"` + FirstNameIsNil bool `json:"firstNameIsNil,omitempty"` + FirstNameNotNil bool `json:"firstNameNotNil,omitempty"` + FirstNameEqualFold *string `json:"firstNameEqualFold,omitempty"` + FirstNameContainsFold *string `json:"firstNameContainsFold,omitempty"` + + // "last_name" field predicates. + LastName *string `json:"lastName,omitempty"` + LastNameNEQ *string `json:"lastNameNEQ,omitempty"` + LastNameIn []string `json:"lastNameIn,omitempty"` + LastNameNotIn []string `json:"lastNameNotIn,omitempty"` + LastNameGT *string `json:"lastNameGT,omitempty"` + LastNameGTE *string `json:"lastNameGTE,omitempty"` + LastNameLT *string `json:"lastNameLT,omitempty"` + LastNameLTE *string `json:"lastNameLTE,omitempty"` + LastNameContains *string `json:"lastNameContains,omitempty"` + LastNameHasPrefix *string `json:"lastNameHasPrefix,omitempty"` + LastNameHasSuffix *string `json:"lastNameHasSuffix,omitempty"` + LastNameIsNil bool `json:"lastNameIsNil,omitempty"` + LastNameNotNil bool `json:"lastNameNotNil,omitempty"` + LastNameEqualFold *string `json:"lastNameEqualFold,omitempty"` + LastNameContainsFold *string `json:"lastNameContainsFold,omitempty"` + + // "display_name" field predicates. + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNEQ *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGT *string `json:"displayNameGT,omitempty"` + DisplayNameGTE *string `json:"displayNameGTE,omitempty"` + DisplayNameLT *string `json:"displayNameLT,omitempty"` + DisplayNameLTE *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + + // "avatar_remote_url" field predicates. + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNEQ *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGT *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGTE *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLT *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLTE *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + + // "avatar_local_file" field predicates. + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + AvatarLocalFileNEQ *string `json:"avatarLocalFileNEQ,omitempty"` + AvatarLocalFileIn []string `json:"avatarLocalFileIn,omitempty"` + AvatarLocalFileNotIn []string `json:"avatarLocalFileNotIn,omitempty"` + AvatarLocalFileGT *string `json:"avatarLocalFileGT,omitempty"` + AvatarLocalFileGTE *string `json:"avatarLocalFileGTE,omitempty"` + AvatarLocalFileLT *string `json:"avatarLocalFileLT,omitempty"` + AvatarLocalFileLTE *string `json:"avatarLocalFileLTE,omitempty"` + AvatarLocalFileContains *string `json:"avatarLocalFileContains,omitempty"` + AvatarLocalFileHasPrefix *string `json:"avatarLocalFileHasPrefix,omitempty"` + AvatarLocalFileHasSuffix *string `json:"avatarLocalFileHasSuffix,omitempty"` + AvatarLocalFileIsNil bool `json:"avatarLocalFileIsNil,omitempty"` + AvatarLocalFileNotNil bool `json:"avatarLocalFileNotNil,omitempty"` + AvatarLocalFileEqualFold *string `json:"avatarLocalFileEqualFold,omitempty"` + AvatarLocalFileContainsFold *string `json:"avatarLocalFileContainsFold,omitempty"` + + // "avatar_updated_at" field predicates. + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + AvatarUpdatedAtNEQ *time.Time `json:"avatarUpdatedAtNEQ,omitempty"` + AvatarUpdatedAtIn []time.Time `json:"avatarUpdatedAtIn,omitempty"` + AvatarUpdatedAtNotIn []time.Time `json:"avatarUpdatedAtNotIn,omitempty"` + AvatarUpdatedAtGT *time.Time `json:"avatarUpdatedAtGT,omitempty"` + AvatarUpdatedAtGTE *time.Time `json:"avatarUpdatedAtGTE,omitempty"` + AvatarUpdatedAtLT *time.Time `json:"avatarUpdatedAtLT,omitempty"` + AvatarUpdatedAtLTE *time.Time `json:"avatarUpdatedAtLTE,omitempty"` + AvatarUpdatedAtIsNil bool `json:"avatarUpdatedAtIsNil,omitempty"` + AvatarUpdatedAtNotNil bool `json:"avatarUpdatedAtNotNil,omitempty"` + + // "last_seen" field predicates. + LastSeen *time.Time `json:"lastSeen,omitempty"` + LastSeenNEQ *time.Time `json:"lastSeenNEQ,omitempty"` + LastSeenIn []time.Time `json:"lastSeenIn,omitempty"` + LastSeenNotIn []time.Time `json:"lastSeenNotIn,omitempty"` + LastSeenGT *time.Time `json:"lastSeenGT,omitempty"` + LastSeenGTE *time.Time `json:"lastSeenGTE,omitempty"` + LastSeenLT *time.Time `json:"lastSeenLT,omitempty"` + LastSeenLTE *time.Time `json:"lastSeenLTE,omitempty"` + LastSeenIsNil bool `json:"lastSeenIsNil,omitempty"` + LastSeenNotNil bool `json:"lastSeenNotNil,omitempty"` + + // "password" field predicates. + Password *string `json:"password,omitempty"` + PasswordNEQ *string `json:"passwordNEQ,omitempty"` + PasswordIn []string `json:"passwordIn,omitempty"` + PasswordNotIn []string `json:"passwordNotIn,omitempty"` + PasswordGT *string `json:"passwordGT,omitempty"` + PasswordGTE *string `json:"passwordGTE,omitempty"` + PasswordLT *string `json:"passwordLT,omitempty"` + PasswordLTE *string `json:"passwordLTE,omitempty"` + PasswordContains *string `json:"passwordContains,omitempty"` + PasswordHasPrefix *string `json:"passwordHasPrefix,omitempty"` + PasswordHasSuffix *string `json:"passwordHasSuffix,omitempty"` + PasswordIsNil bool `json:"passwordIsNil,omitempty"` + PasswordNotNil bool `json:"passwordNotNil,omitempty"` + PasswordEqualFold *string `json:"passwordEqualFold,omitempty"` + PasswordContainsFold *string `json:"passwordContainsFold,omitempty"` + + // "sub" field predicates. + Sub *string `json:"sub,omitempty"` + SubNEQ *string `json:"subNEQ,omitempty"` + SubIn []string `json:"subIn,omitempty"` + SubNotIn []string `json:"subNotIn,omitempty"` + SubGT *string `json:"subGT,omitempty"` + SubGTE *string `json:"subGTE,omitempty"` + SubLT *string `json:"subLT,omitempty"` + SubLTE *string `json:"subLTE,omitempty"` + SubContains *string `json:"subContains,omitempty"` + SubHasPrefix *string `json:"subHasPrefix,omitempty"` + SubHasSuffix *string `json:"subHasSuffix,omitempty"` + SubIsNil bool `json:"subIsNil,omitempty"` + SubNotNil bool `json:"subNotNil,omitempty"` + SubEqualFold *string `json:"subEqualFold,omitempty"` + SubContainsFold *string `json:"subContainsFold,omitempty"` + + // "auth_provider" field predicates. + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + AuthProviderNEQ *enums.AuthProvider `json:"authProviderNEQ,omitempty"` + AuthProviderIn []enums.AuthProvider `json:"authProviderIn,omitempty"` + AuthProviderNotIn []enums.AuthProvider `json:"authProviderNotIn,omitempty"` + + // "role" field predicates. + Role *enums.Role `json:"role,omitempty"` + RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + RoleIsNil bool `json:"roleIsNil,omitempty"` + RoleNotNil bool `json:"roleNotNil,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *UserHistoryWhereInput) AddPredicates(predicates ...predicate.UserHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the UserHistoryWhereInput filter on the UserHistoryQuery builder. +func (i *UserHistoryWhereInput) Filter(q *UserHistoryQuery) (*UserHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyUserHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyUserHistoryWhereInput is returned in case the UserHistoryWhereInput is empty. +var ErrEmptyUserHistoryWhereInput = errors.New("generated: empty predicate UserHistoryWhereInput") + +// P returns a predicate for filtering userhistories. +// An error is returned if the input is empty or invalid. +func (i *UserHistoryWhereInput) P() (predicate.UserHistory, error) { + var predicates []predicate.UserHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, userhistory.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.UserHistory, 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, userhistory.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.UserHistory, 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, userhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, userhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, userhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, userhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, userhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, userhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, userhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, userhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, userhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, userhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, userhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, userhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, userhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, userhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, userhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, userhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, userhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, userhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, userhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, userhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, userhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, userhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, userhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, userhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, userhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, userhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, userhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, userhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, userhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, userhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, userhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, userhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, userhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, userhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, userhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, userhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, userhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, userhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, userhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, userhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, userhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, userhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, userhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, userhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, userhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, userhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, userhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, userhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, userhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, userhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, userhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, userhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, userhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, userhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, userhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, userhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, userhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, userhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, userhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, userhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, userhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, userhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, userhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, userhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, userhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, userhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, userhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, userhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, userhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, userhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, userhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, userhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, userhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, userhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, userhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, userhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, userhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, userhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, userhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, userhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, userhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, userhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, userhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, userhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, userhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, userhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, userhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, userhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, userhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, userhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, userhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, userhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, userhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, userhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, userhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, userhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, userhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, userhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, userhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, userhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, userhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, userhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, userhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, userhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, userhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, userhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, userhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, userhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, userhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, userhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, userhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, userhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, userhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.Email != nil { + predicates = append(predicates, userhistory.EmailEQ(*i.Email)) + } + if i.EmailNEQ != nil { + predicates = append(predicates, userhistory.EmailNEQ(*i.EmailNEQ)) + } + if len(i.EmailIn) > 0 { + predicates = append(predicates, userhistory.EmailIn(i.EmailIn...)) + } + if len(i.EmailNotIn) > 0 { + predicates = append(predicates, userhistory.EmailNotIn(i.EmailNotIn...)) + } + if i.EmailGT != nil { + predicates = append(predicates, userhistory.EmailGT(*i.EmailGT)) + } + if i.EmailGTE != nil { + predicates = append(predicates, userhistory.EmailGTE(*i.EmailGTE)) + } + if i.EmailLT != nil { + predicates = append(predicates, userhistory.EmailLT(*i.EmailLT)) + } + if i.EmailLTE != nil { + predicates = append(predicates, userhistory.EmailLTE(*i.EmailLTE)) + } + if i.EmailContains != nil { + predicates = append(predicates, userhistory.EmailContains(*i.EmailContains)) + } + if i.EmailHasPrefix != nil { + predicates = append(predicates, userhistory.EmailHasPrefix(*i.EmailHasPrefix)) + } + if i.EmailHasSuffix != nil { + predicates = append(predicates, userhistory.EmailHasSuffix(*i.EmailHasSuffix)) + } + if i.EmailEqualFold != nil { + predicates = append(predicates, userhistory.EmailEqualFold(*i.EmailEqualFold)) + } + if i.EmailContainsFold != nil { + predicates = append(predicates, userhistory.EmailContainsFold(*i.EmailContainsFold)) + } + if i.FirstName != nil { + predicates = append(predicates, userhistory.FirstNameEQ(*i.FirstName)) + } + if i.FirstNameNEQ != nil { + predicates = append(predicates, userhistory.FirstNameNEQ(*i.FirstNameNEQ)) + } + if len(i.FirstNameIn) > 0 { + predicates = append(predicates, userhistory.FirstNameIn(i.FirstNameIn...)) + } + if len(i.FirstNameNotIn) > 0 { + predicates = append(predicates, userhistory.FirstNameNotIn(i.FirstNameNotIn...)) + } + if i.FirstNameGT != nil { + predicates = append(predicates, userhistory.FirstNameGT(*i.FirstNameGT)) + } + if i.FirstNameGTE != nil { + predicates = append(predicates, userhistory.FirstNameGTE(*i.FirstNameGTE)) + } + if i.FirstNameLT != nil { + predicates = append(predicates, userhistory.FirstNameLT(*i.FirstNameLT)) + } + if i.FirstNameLTE != nil { + predicates = append(predicates, userhistory.FirstNameLTE(*i.FirstNameLTE)) + } + if i.FirstNameContains != nil { + predicates = append(predicates, userhistory.FirstNameContains(*i.FirstNameContains)) + } + if i.FirstNameHasPrefix != nil { + predicates = append(predicates, userhistory.FirstNameHasPrefix(*i.FirstNameHasPrefix)) + } + if i.FirstNameHasSuffix != nil { + predicates = append(predicates, userhistory.FirstNameHasSuffix(*i.FirstNameHasSuffix)) + } + if i.FirstNameIsNil { + predicates = append(predicates, userhistory.FirstNameIsNil()) + } + if i.FirstNameNotNil { + predicates = append(predicates, userhistory.FirstNameNotNil()) + } + if i.FirstNameEqualFold != nil { + predicates = append(predicates, userhistory.FirstNameEqualFold(*i.FirstNameEqualFold)) + } + if i.FirstNameContainsFold != nil { + predicates = append(predicates, userhistory.FirstNameContainsFold(*i.FirstNameContainsFold)) + } + if i.LastName != nil { + predicates = append(predicates, userhistory.LastNameEQ(*i.LastName)) + } + if i.LastNameNEQ != nil { + predicates = append(predicates, userhistory.LastNameNEQ(*i.LastNameNEQ)) + } + if len(i.LastNameIn) > 0 { + predicates = append(predicates, userhistory.LastNameIn(i.LastNameIn...)) + } + if len(i.LastNameNotIn) > 0 { + predicates = append(predicates, userhistory.LastNameNotIn(i.LastNameNotIn...)) + } + if i.LastNameGT != nil { + predicates = append(predicates, userhistory.LastNameGT(*i.LastNameGT)) + } + if i.LastNameGTE != nil { + predicates = append(predicates, userhistory.LastNameGTE(*i.LastNameGTE)) + } + if i.LastNameLT != nil { + predicates = append(predicates, userhistory.LastNameLT(*i.LastNameLT)) + } + if i.LastNameLTE != nil { + predicates = append(predicates, userhistory.LastNameLTE(*i.LastNameLTE)) + } + if i.LastNameContains != nil { + predicates = append(predicates, userhistory.LastNameContains(*i.LastNameContains)) + } + if i.LastNameHasPrefix != nil { + predicates = append(predicates, userhistory.LastNameHasPrefix(*i.LastNameHasPrefix)) + } + if i.LastNameHasSuffix != nil { + predicates = append(predicates, userhistory.LastNameHasSuffix(*i.LastNameHasSuffix)) + } + if i.LastNameIsNil { + predicates = append(predicates, userhistory.LastNameIsNil()) + } + if i.LastNameNotNil { + predicates = append(predicates, userhistory.LastNameNotNil()) + } + if i.LastNameEqualFold != nil { + predicates = append(predicates, userhistory.LastNameEqualFold(*i.LastNameEqualFold)) + } + if i.LastNameContainsFold != nil { + predicates = append(predicates, userhistory.LastNameContainsFold(*i.LastNameContainsFold)) + } + if i.DisplayName != nil { + predicates = append(predicates, userhistory.DisplayNameEQ(*i.DisplayName)) + } + if i.DisplayNameNEQ != nil { + predicates = append(predicates, userhistory.DisplayNameNEQ(*i.DisplayNameNEQ)) + } + if len(i.DisplayNameIn) > 0 { + predicates = append(predicates, userhistory.DisplayNameIn(i.DisplayNameIn...)) + } + if len(i.DisplayNameNotIn) > 0 { + predicates = append(predicates, userhistory.DisplayNameNotIn(i.DisplayNameNotIn...)) + } + if i.DisplayNameGT != nil { + predicates = append(predicates, userhistory.DisplayNameGT(*i.DisplayNameGT)) + } + if i.DisplayNameGTE != nil { + predicates = append(predicates, userhistory.DisplayNameGTE(*i.DisplayNameGTE)) + } + if i.DisplayNameLT != nil { + predicates = append(predicates, userhistory.DisplayNameLT(*i.DisplayNameLT)) + } + if i.DisplayNameLTE != nil { + predicates = append(predicates, userhistory.DisplayNameLTE(*i.DisplayNameLTE)) + } + if i.DisplayNameContains != nil { + predicates = append(predicates, userhistory.DisplayNameContains(*i.DisplayNameContains)) + } + if i.DisplayNameHasPrefix != nil { + predicates = append(predicates, userhistory.DisplayNameHasPrefix(*i.DisplayNameHasPrefix)) + } + if i.DisplayNameHasSuffix != nil { + predicates = append(predicates, userhistory.DisplayNameHasSuffix(*i.DisplayNameHasSuffix)) + } + if i.DisplayNameEqualFold != nil { + predicates = append(predicates, userhistory.DisplayNameEqualFold(*i.DisplayNameEqualFold)) + } + if i.DisplayNameContainsFold != nil { + predicates = append(predicates, userhistory.DisplayNameContainsFold(*i.DisplayNameContainsFold)) + } + if i.AvatarRemoteURL != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLEQ(*i.AvatarRemoteURL)) + } + if i.AvatarRemoteURLNEQ != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLNEQ(*i.AvatarRemoteURLNEQ)) + } + if len(i.AvatarRemoteURLIn) > 0 { + predicates = append(predicates, userhistory.AvatarRemoteURLIn(i.AvatarRemoteURLIn...)) + } + if len(i.AvatarRemoteURLNotIn) > 0 { + predicates = append(predicates, userhistory.AvatarRemoteURLNotIn(i.AvatarRemoteURLNotIn...)) + } + if i.AvatarRemoteURLGT != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLGT(*i.AvatarRemoteURLGT)) + } + if i.AvatarRemoteURLGTE != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLGTE(*i.AvatarRemoteURLGTE)) + } + if i.AvatarRemoteURLLT != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLLT(*i.AvatarRemoteURLLT)) + } + if i.AvatarRemoteURLLTE != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLLTE(*i.AvatarRemoteURLLTE)) + } + if i.AvatarRemoteURLContains != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLContains(*i.AvatarRemoteURLContains)) + } + if i.AvatarRemoteURLHasPrefix != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLHasPrefix(*i.AvatarRemoteURLHasPrefix)) + } + if i.AvatarRemoteURLHasSuffix != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLHasSuffix(*i.AvatarRemoteURLHasSuffix)) + } + if i.AvatarRemoteURLIsNil { + predicates = append(predicates, userhistory.AvatarRemoteURLIsNil()) + } + if i.AvatarRemoteURLNotNil { + predicates = append(predicates, userhistory.AvatarRemoteURLNotNil()) + } + if i.AvatarRemoteURLEqualFold != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLEqualFold(*i.AvatarRemoteURLEqualFold)) + } + if i.AvatarRemoteURLContainsFold != nil { + predicates = append(predicates, userhistory.AvatarRemoteURLContainsFold(*i.AvatarRemoteURLContainsFold)) + } + if i.AvatarLocalFile != nil { + predicates = append(predicates, userhistory.AvatarLocalFileEQ(*i.AvatarLocalFile)) + } + if i.AvatarLocalFileNEQ != nil { + predicates = append(predicates, userhistory.AvatarLocalFileNEQ(*i.AvatarLocalFileNEQ)) + } + if len(i.AvatarLocalFileIn) > 0 { + predicates = append(predicates, userhistory.AvatarLocalFileIn(i.AvatarLocalFileIn...)) + } + if len(i.AvatarLocalFileNotIn) > 0 { + predicates = append(predicates, userhistory.AvatarLocalFileNotIn(i.AvatarLocalFileNotIn...)) + } + if i.AvatarLocalFileGT != nil { + predicates = append(predicates, userhistory.AvatarLocalFileGT(*i.AvatarLocalFileGT)) + } + if i.AvatarLocalFileGTE != nil { + predicates = append(predicates, userhistory.AvatarLocalFileGTE(*i.AvatarLocalFileGTE)) + } + if i.AvatarLocalFileLT != nil { + predicates = append(predicates, userhistory.AvatarLocalFileLT(*i.AvatarLocalFileLT)) + } + if i.AvatarLocalFileLTE != nil { + predicates = append(predicates, userhistory.AvatarLocalFileLTE(*i.AvatarLocalFileLTE)) + } + if i.AvatarLocalFileContains != nil { + predicates = append(predicates, userhistory.AvatarLocalFileContains(*i.AvatarLocalFileContains)) + } + if i.AvatarLocalFileHasPrefix != nil { + predicates = append(predicates, userhistory.AvatarLocalFileHasPrefix(*i.AvatarLocalFileHasPrefix)) + } + if i.AvatarLocalFileHasSuffix != nil { + predicates = append(predicates, userhistory.AvatarLocalFileHasSuffix(*i.AvatarLocalFileHasSuffix)) + } + if i.AvatarLocalFileIsNil { + predicates = append(predicates, userhistory.AvatarLocalFileIsNil()) + } + if i.AvatarLocalFileNotNil { + predicates = append(predicates, userhistory.AvatarLocalFileNotNil()) + } + if i.AvatarLocalFileEqualFold != nil { + predicates = append(predicates, userhistory.AvatarLocalFileEqualFold(*i.AvatarLocalFileEqualFold)) + } + if i.AvatarLocalFileContainsFold != nil { + predicates = append(predicates, userhistory.AvatarLocalFileContainsFold(*i.AvatarLocalFileContainsFold)) + } + if i.AvatarUpdatedAt != nil { + predicates = append(predicates, userhistory.AvatarUpdatedAtEQ(*i.AvatarUpdatedAt)) + } + if i.AvatarUpdatedAtNEQ != nil { + predicates = append(predicates, userhistory.AvatarUpdatedAtNEQ(*i.AvatarUpdatedAtNEQ)) + } + if len(i.AvatarUpdatedAtIn) > 0 { + predicates = append(predicates, userhistory.AvatarUpdatedAtIn(i.AvatarUpdatedAtIn...)) + } + if len(i.AvatarUpdatedAtNotIn) > 0 { + predicates = append(predicates, userhistory.AvatarUpdatedAtNotIn(i.AvatarUpdatedAtNotIn...)) + } + if i.AvatarUpdatedAtGT != nil { + predicates = append(predicates, userhistory.AvatarUpdatedAtGT(*i.AvatarUpdatedAtGT)) + } + if i.AvatarUpdatedAtGTE != nil { + predicates = append(predicates, userhistory.AvatarUpdatedAtGTE(*i.AvatarUpdatedAtGTE)) + } + if i.AvatarUpdatedAtLT != nil { + predicates = append(predicates, userhistory.AvatarUpdatedAtLT(*i.AvatarUpdatedAtLT)) + } + if i.AvatarUpdatedAtLTE != nil { + predicates = append(predicates, userhistory.AvatarUpdatedAtLTE(*i.AvatarUpdatedAtLTE)) + } + if i.AvatarUpdatedAtIsNil { + predicates = append(predicates, userhistory.AvatarUpdatedAtIsNil()) + } + if i.AvatarUpdatedAtNotNil { + predicates = append(predicates, userhistory.AvatarUpdatedAtNotNil()) + } + if i.LastSeen != nil { + predicates = append(predicates, userhistory.LastSeenEQ(*i.LastSeen)) + } + if i.LastSeenNEQ != nil { + predicates = append(predicates, userhistory.LastSeenNEQ(*i.LastSeenNEQ)) + } + if len(i.LastSeenIn) > 0 { + predicates = append(predicates, userhistory.LastSeenIn(i.LastSeenIn...)) + } + if len(i.LastSeenNotIn) > 0 { + predicates = append(predicates, userhistory.LastSeenNotIn(i.LastSeenNotIn...)) + } + if i.LastSeenGT != nil { + predicates = append(predicates, userhistory.LastSeenGT(*i.LastSeenGT)) + } + if i.LastSeenGTE != nil { + predicates = append(predicates, userhistory.LastSeenGTE(*i.LastSeenGTE)) + } + if i.LastSeenLT != nil { + predicates = append(predicates, userhistory.LastSeenLT(*i.LastSeenLT)) + } + if i.LastSeenLTE != nil { + predicates = append(predicates, userhistory.LastSeenLTE(*i.LastSeenLTE)) + } + if i.LastSeenIsNil { + predicates = append(predicates, userhistory.LastSeenIsNil()) + } + if i.LastSeenNotNil { + predicates = append(predicates, userhistory.LastSeenNotNil()) + } + if i.Password != nil { + predicates = append(predicates, userhistory.PasswordEQ(*i.Password)) + } + if i.PasswordNEQ != nil { + predicates = append(predicates, userhistory.PasswordNEQ(*i.PasswordNEQ)) + } + if len(i.PasswordIn) > 0 { + predicates = append(predicates, userhistory.PasswordIn(i.PasswordIn...)) + } + if len(i.PasswordNotIn) > 0 { + predicates = append(predicates, userhistory.PasswordNotIn(i.PasswordNotIn...)) + } + if i.PasswordGT != nil { + predicates = append(predicates, userhistory.PasswordGT(*i.PasswordGT)) + } + if i.PasswordGTE != nil { + predicates = append(predicates, userhistory.PasswordGTE(*i.PasswordGTE)) + } + if i.PasswordLT != nil { + predicates = append(predicates, userhistory.PasswordLT(*i.PasswordLT)) + } + if i.PasswordLTE != nil { + predicates = append(predicates, userhistory.PasswordLTE(*i.PasswordLTE)) + } + if i.PasswordContains != nil { + predicates = append(predicates, userhistory.PasswordContains(*i.PasswordContains)) + } + if i.PasswordHasPrefix != nil { + predicates = append(predicates, userhistory.PasswordHasPrefix(*i.PasswordHasPrefix)) + } + if i.PasswordHasSuffix != nil { + predicates = append(predicates, userhistory.PasswordHasSuffix(*i.PasswordHasSuffix)) + } + if i.PasswordIsNil { + predicates = append(predicates, userhistory.PasswordIsNil()) + } + if i.PasswordNotNil { + predicates = append(predicates, userhistory.PasswordNotNil()) + } + if i.PasswordEqualFold != nil { + predicates = append(predicates, userhistory.PasswordEqualFold(*i.PasswordEqualFold)) + } + if i.PasswordContainsFold != nil { + predicates = append(predicates, userhistory.PasswordContainsFold(*i.PasswordContainsFold)) + } + if i.Sub != nil { + predicates = append(predicates, userhistory.SubEQ(*i.Sub)) + } + if i.SubNEQ != nil { + predicates = append(predicates, userhistory.SubNEQ(*i.SubNEQ)) + } + if len(i.SubIn) > 0 { + predicates = append(predicates, userhistory.SubIn(i.SubIn...)) + } + if len(i.SubNotIn) > 0 { + predicates = append(predicates, userhistory.SubNotIn(i.SubNotIn...)) + } + if i.SubGT != nil { + predicates = append(predicates, userhistory.SubGT(*i.SubGT)) + } + if i.SubGTE != nil { + predicates = append(predicates, userhistory.SubGTE(*i.SubGTE)) + } + if i.SubLT != nil { + predicates = append(predicates, userhistory.SubLT(*i.SubLT)) + } + if i.SubLTE != nil { + predicates = append(predicates, userhistory.SubLTE(*i.SubLTE)) + } + if i.SubContains != nil { + predicates = append(predicates, userhistory.SubContains(*i.SubContains)) + } + if i.SubHasPrefix != nil { + predicates = append(predicates, userhistory.SubHasPrefix(*i.SubHasPrefix)) + } + if i.SubHasSuffix != nil { + predicates = append(predicates, userhistory.SubHasSuffix(*i.SubHasSuffix)) + } + if i.SubIsNil { + predicates = append(predicates, userhistory.SubIsNil()) + } + if i.SubNotNil { + predicates = append(predicates, userhistory.SubNotNil()) + } + if i.SubEqualFold != nil { + predicates = append(predicates, userhistory.SubEqualFold(*i.SubEqualFold)) + } + if i.SubContainsFold != nil { + predicates = append(predicates, userhistory.SubContainsFold(*i.SubContainsFold)) + } + if i.AuthProvider != nil { + predicates = append(predicates, userhistory.AuthProviderEQ(*i.AuthProvider)) + } + if i.AuthProviderNEQ != nil { + predicates = append(predicates, userhistory.AuthProviderNEQ(*i.AuthProviderNEQ)) + } + if len(i.AuthProviderIn) > 0 { + predicates = append(predicates, userhistory.AuthProviderIn(i.AuthProviderIn...)) + } + if len(i.AuthProviderNotIn) > 0 { + predicates = append(predicates, userhistory.AuthProviderNotIn(i.AuthProviderNotIn...)) + } + if i.Role != nil { + predicates = append(predicates, userhistory.RoleEQ(*i.Role)) + } + if i.RoleNEQ != nil { + predicates = append(predicates, userhistory.RoleNEQ(*i.RoleNEQ)) + } + if len(i.RoleIn) > 0 { + predicates = append(predicates, userhistory.RoleIn(i.RoleIn...)) + } + if len(i.RoleNotIn) > 0 { + predicates = append(predicates, userhistory.RoleNotIn(i.RoleNotIn...)) + } + if i.RoleIsNil { + predicates = append(predicates, userhistory.RoleIsNil()) + } + if i.RoleNotNil { + predicates = append(predicates, userhistory.RoleNotNil()) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyUserHistoryWhereInput + case 1: + return predicates[0], nil + default: + return userhistory.And(predicates...), nil + } +} + +// UserSettingWhereInput represents a where input for filtering UserSetting queries. +type UserSettingWhereInput struct { + Predicates []predicate.UserSetting `json:"-"` + Not *UserSettingWhereInput `json:"not,omitempty"` + Or []*UserSettingWhereInput `json:"or,omitempty"` + And []*UserSettingWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "user_id" field predicates. + UserID *string `json:"userID,omitempty"` + UserIDNEQ *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGT *string `json:"userIDGT,omitempty"` + UserIDGTE *string `json:"userIDGTE,omitempty"` + UserIDLT *string `json:"userIDLT,omitempty"` + UserIDLTE *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDIsNil bool `json:"userIDIsNil,omitempty"` + UserIDNotNil bool `json:"userIDNotNil,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + + // "locked" field predicates. + Locked *bool `json:"locked,omitempty"` + LockedNEQ *bool `json:"lockedNEQ,omitempty"` + + // "silenced_at" field predicates. + SilencedAt *time.Time `json:"silencedAt,omitempty"` + SilencedAtNEQ *time.Time `json:"silencedAtNEQ,omitempty"` + SilencedAtIn []time.Time `json:"silencedAtIn,omitempty"` + SilencedAtNotIn []time.Time `json:"silencedAtNotIn,omitempty"` + SilencedAtGT *time.Time `json:"silencedAtGT,omitempty"` + SilencedAtGTE *time.Time `json:"silencedAtGTE,omitempty"` + SilencedAtLT *time.Time `json:"silencedAtLT,omitempty"` + SilencedAtLTE *time.Time `json:"silencedAtLTE,omitempty"` + SilencedAtIsNil bool `json:"silencedAtIsNil,omitempty"` + SilencedAtNotNil bool `json:"silencedAtNotNil,omitempty"` + + // "suspended_at" field predicates. + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + SuspendedAtNEQ *time.Time `json:"suspendedAtNEQ,omitempty"` + SuspendedAtIn []time.Time `json:"suspendedAtIn,omitempty"` + SuspendedAtNotIn []time.Time `json:"suspendedAtNotIn,omitempty"` + SuspendedAtGT *time.Time `json:"suspendedAtGT,omitempty"` + SuspendedAtGTE *time.Time `json:"suspendedAtGTE,omitempty"` + SuspendedAtLT *time.Time `json:"suspendedAtLT,omitempty"` + SuspendedAtLTE *time.Time `json:"suspendedAtLTE,omitempty"` + SuspendedAtIsNil bool `json:"suspendedAtIsNil,omitempty"` + SuspendedAtNotNil bool `json:"suspendedAtNotNil,omitempty"` + + // "status" field predicates. + Status *enums.UserStatus `json:"status,omitempty"` + StatusNEQ *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + + // "email_confirmed" field predicates. + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + EmailConfirmedNEQ *bool `json:"emailConfirmedNEQ,omitempty"` + + // "is_webauthn_allowed" field predicates. + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + IsWebauthnAllowedNEQ *bool `json:"isWebauthnAllowedNEQ,omitempty"` + IsWebauthnAllowedIsNil bool `json:"isWebauthnAllowedIsNil,omitempty"` + IsWebauthnAllowedNotNil bool `json:"isWebauthnAllowedNotNil,omitempty"` + + // "is_tfa_enabled" field predicates. + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + IsTfaEnabledNEQ *bool `json:"isTfaEnabledNEQ,omitempty"` + IsTfaEnabledIsNil bool `json:"isTfaEnabledIsNil,omitempty"` + IsTfaEnabledNotNil bool `json:"isTfaEnabledNotNil,omitempty"` + + // "user" edge predicates. + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + + // "default_org" edge predicates. + HasDefaultOrg *bool `json:"hasDefaultOrg,omitempty"` + HasDefaultOrgWith []*OrganizationWhereInput `json:"hasDefaultOrgWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *UserSettingWhereInput) AddPredicates(predicates ...predicate.UserSetting) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the UserSettingWhereInput filter on the UserSettingQuery builder. +func (i *UserSettingWhereInput) Filter(q *UserSettingQuery) (*UserSettingQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyUserSettingWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyUserSettingWhereInput is returned in case the UserSettingWhereInput is empty. +var ErrEmptyUserSettingWhereInput = errors.New("generated: empty predicate UserSettingWhereInput") + +// P returns a predicate for filtering usersettings. +// An error is returned if the input is empty or invalid. +func (i *UserSettingWhereInput) P() (predicate.UserSetting, error) { + var predicates []predicate.UserSetting + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, usersetting.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.UserSetting, 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, usersetting.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.UserSetting, 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, usersetting.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, usersetting.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, usersetting.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, usersetting.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, usersetting.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, usersetting.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, usersetting.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, usersetting.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, usersetting.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, usersetting.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, usersetting.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, usersetting.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, usersetting.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, usersetting.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, usersetting.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, usersetting.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, usersetting.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, usersetting.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, usersetting.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, usersetting.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, usersetting.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, usersetting.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, usersetting.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, usersetting.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, usersetting.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, usersetting.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, usersetting.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, usersetting.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, usersetting.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, usersetting.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, usersetting.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, usersetting.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, usersetting.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, usersetting.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, usersetting.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, usersetting.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, usersetting.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, usersetting.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, usersetting.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, usersetting.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, usersetting.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, usersetting.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, usersetting.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, usersetting.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, usersetting.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, usersetting.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, usersetting.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, usersetting.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, usersetting.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, usersetting.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, usersetting.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, usersetting.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, usersetting.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, usersetting.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, usersetting.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, usersetting.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, usersetting.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, usersetting.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, usersetting.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, usersetting.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, usersetting.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, usersetting.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, usersetting.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, usersetting.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, usersetting.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, usersetting.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, usersetting.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, usersetting.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, usersetting.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, usersetting.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, usersetting.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, usersetting.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, usersetting.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, usersetting.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, usersetting.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, usersetting.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, usersetting.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, usersetting.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, usersetting.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, usersetting.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, usersetting.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, usersetting.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, usersetting.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, usersetting.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, usersetting.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, usersetting.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.UserID != nil { + predicates = append(predicates, usersetting.UserIDEQ(*i.UserID)) + } + if i.UserIDNEQ != nil { + predicates = append(predicates, usersetting.UserIDNEQ(*i.UserIDNEQ)) + } + if len(i.UserIDIn) > 0 { + predicates = append(predicates, usersetting.UserIDIn(i.UserIDIn...)) + } + if len(i.UserIDNotIn) > 0 { + predicates = append(predicates, usersetting.UserIDNotIn(i.UserIDNotIn...)) + } + if i.UserIDGT != nil { + predicates = append(predicates, usersetting.UserIDGT(*i.UserIDGT)) + } + if i.UserIDGTE != nil { + predicates = append(predicates, usersetting.UserIDGTE(*i.UserIDGTE)) + } + if i.UserIDLT != nil { + predicates = append(predicates, usersetting.UserIDLT(*i.UserIDLT)) + } + if i.UserIDLTE != nil { + predicates = append(predicates, usersetting.UserIDLTE(*i.UserIDLTE)) + } + if i.UserIDContains != nil { + predicates = append(predicates, usersetting.UserIDContains(*i.UserIDContains)) + } + if i.UserIDHasPrefix != nil { + predicates = append(predicates, usersetting.UserIDHasPrefix(*i.UserIDHasPrefix)) + } + if i.UserIDHasSuffix != nil { + predicates = append(predicates, usersetting.UserIDHasSuffix(*i.UserIDHasSuffix)) + } + if i.UserIDIsNil { + predicates = append(predicates, usersetting.UserIDIsNil()) + } + if i.UserIDNotNil { + predicates = append(predicates, usersetting.UserIDNotNil()) + } + if i.UserIDEqualFold != nil { + predicates = append(predicates, usersetting.UserIDEqualFold(*i.UserIDEqualFold)) + } + if i.UserIDContainsFold != nil { + predicates = append(predicates, usersetting.UserIDContainsFold(*i.UserIDContainsFold)) + } + if i.Locked != nil { + predicates = append(predicates, usersetting.LockedEQ(*i.Locked)) + } + if i.LockedNEQ != nil { + predicates = append(predicates, usersetting.LockedNEQ(*i.LockedNEQ)) + } + if i.SilencedAt != nil { + predicates = append(predicates, usersetting.SilencedAtEQ(*i.SilencedAt)) + } + if i.SilencedAtNEQ != nil { + predicates = append(predicates, usersetting.SilencedAtNEQ(*i.SilencedAtNEQ)) + } + if len(i.SilencedAtIn) > 0 { + predicates = append(predicates, usersetting.SilencedAtIn(i.SilencedAtIn...)) + } + if len(i.SilencedAtNotIn) > 0 { + predicates = append(predicates, usersetting.SilencedAtNotIn(i.SilencedAtNotIn...)) + } + if i.SilencedAtGT != nil { + predicates = append(predicates, usersetting.SilencedAtGT(*i.SilencedAtGT)) + } + if i.SilencedAtGTE != nil { + predicates = append(predicates, usersetting.SilencedAtGTE(*i.SilencedAtGTE)) + } + if i.SilencedAtLT != nil { + predicates = append(predicates, usersetting.SilencedAtLT(*i.SilencedAtLT)) + } + if i.SilencedAtLTE != nil { + predicates = append(predicates, usersetting.SilencedAtLTE(*i.SilencedAtLTE)) + } + if i.SilencedAtIsNil { + predicates = append(predicates, usersetting.SilencedAtIsNil()) + } + if i.SilencedAtNotNil { + predicates = append(predicates, usersetting.SilencedAtNotNil()) + } + if i.SuspendedAt != nil { + predicates = append(predicates, usersetting.SuspendedAtEQ(*i.SuspendedAt)) + } + if i.SuspendedAtNEQ != nil { + predicates = append(predicates, usersetting.SuspendedAtNEQ(*i.SuspendedAtNEQ)) + } + if len(i.SuspendedAtIn) > 0 { + predicates = append(predicates, usersetting.SuspendedAtIn(i.SuspendedAtIn...)) + } + if len(i.SuspendedAtNotIn) > 0 { + predicates = append(predicates, usersetting.SuspendedAtNotIn(i.SuspendedAtNotIn...)) + } + if i.SuspendedAtGT != nil { + predicates = append(predicates, usersetting.SuspendedAtGT(*i.SuspendedAtGT)) + } + if i.SuspendedAtGTE != nil { + predicates = append(predicates, usersetting.SuspendedAtGTE(*i.SuspendedAtGTE)) + } + if i.SuspendedAtLT != nil { + predicates = append(predicates, usersetting.SuspendedAtLT(*i.SuspendedAtLT)) + } + if i.SuspendedAtLTE != nil { + predicates = append(predicates, usersetting.SuspendedAtLTE(*i.SuspendedAtLTE)) + } + if i.SuspendedAtIsNil { + predicates = append(predicates, usersetting.SuspendedAtIsNil()) + } + if i.SuspendedAtNotNil { + predicates = append(predicates, usersetting.SuspendedAtNotNil()) + } + if i.Status != nil { + predicates = append(predicates, usersetting.StatusEQ(*i.Status)) + } + if i.StatusNEQ != nil { + predicates = append(predicates, usersetting.StatusNEQ(*i.StatusNEQ)) + } + if len(i.StatusIn) > 0 { + predicates = append(predicates, usersetting.StatusIn(i.StatusIn...)) + } + if len(i.StatusNotIn) > 0 { + predicates = append(predicates, usersetting.StatusNotIn(i.StatusNotIn...)) + } + if i.EmailConfirmed != nil { + predicates = append(predicates, usersetting.EmailConfirmedEQ(*i.EmailConfirmed)) + } + if i.EmailConfirmedNEQ != nil { + predicates = append(predicates, usersetting.EmailConfirmedNEQ(*i.EmailConfirmedNEQ)) + } + if i.IsWebauthnAllowed != nil { + predicates = append(predicates, usersetting.IsWebauthnAllowedEQ(*i.IsWebauthnAllowed)) + } + if i.IsWebauthnAllowedNEQ != nil { + predicates = append(predicates, usersetting.IsWebauthnAllowedNEQ(*i.IsWebauthnAllowedNEQ)) + } + if i.IsWebauthnAllowedIsNil { + predicates = append(predicates, usersetting.IsWebauthnAllowedIsNil()) + } + if i.IsWebauthnAllowedNotNil { + predicates = append(predicates, usersetting.IsWebauthnAllowedNotNil()) + } + if i.IsTfaEnabled != nil { + predicates = append(predicates, usersetting.IsTfaEnabledEQ(*i.IsTfaEnabled)) + } + if i.IsTfaEnabledNEQ != nil { + predicates = append(predicates, usersetting.IsTfaEnabledNEQ(*i.IsTfaEnabledNEQ)) + } + if i.IsTfaEnabledIsNil { + predicates = append(predicates, usersetting.IsTfaEnabledIsNil()) + } + if i.IsTfaEnabledNotNil { + predicates = append(predicates, usersetting.IsTfaEnabledNotNil()) + } + + if i.HasUser != nil { + p := usersetting.HasUser() + if !*i.HasUser { + p = usersetting.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasUserWith) > 0 { + with := make([]predicate.User, 0, len(i.HasUserWith)) + for _, w := range i.HasUserWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasUserWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, usersetting.HasUserWith(with...)) + } + if i.HasDefaultOrg != nil { + p := usersetting.HasDefaultOrg() + if !*i.HasDefaultOrg { + p = usersetting.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasDefaultOrgWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasDefaultOrgWith)) + for _, w := range i.HasDefaultOrgWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasDefaultOrgWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, usersetting.HasDefaultOrgWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyUserSettingWhereInput + case 1: + return predicates[0], nil + default: + return usersetting.And(predicates...), nil + } +} + +// UserSettingHistoryWhereInput represents a where input for filtering UserSettingHistory queries. +type UserSettingHistoryWhereInput struct { + Predicates []predicate.UserSettingHistory `json:"-"` + Not *UserSettingHistoryWhereInput `json:"not,omitempty"` + Or []*UserSettingHistoryWhereInput `json:"or,omitempty"` + And []*UserSettingHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "user_id" field predicates. + UserID *string `json:"userID,omitempty"` + UserIDNEQ *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGT *string `json:"userIDGT,omitempty"` + UserIDGTE *string `json:"userIDGTE,omitempty"` + UserIDLT *string `json:"userIDLT,omitempty"` + UserIDLTE *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDIsNil bool `json:"userIDIsNil,omitempty"` + UserIDNotNil bool `json:"userIDNotNil,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + + // "locked" field predicates. + Locked *bool `json:"locked,omitempty"` + LockedNEQ *bool `json:"lockedNEQ,omitempty"` + + // "silenced_at" field predicates. + SilencedAt *time.Time `json:"silencedAt,omitempty"` + SilencedAtNEQ *time.Time `json:"silencedAtNEQ,omitempty"` + SilencedAtIn []time.Time `json:"silencedAtIn,omitempty"` + SilencedAtNotIn []time.Time `json:"silencedAtNotIn,omitempty"` + SilencedAtGT *time.Time `json:"silencedAtGT,omitempty"` + SilencedAtGTE *time.Time `json:"silencedAtGTE,omitempty"` + SilencedAtLT *time.Time `json:"silencedAtLT,omitempty"` + SilencedAtLTE *time.Time `json:"silencedAtLTE,omitempty"` + SilencedAtIsNil bool `json:"silencedAtIsNil,omitempty"` + SilencedAtNotNil bool `json:"silencedAtNotNil,omitempty"` + + // "suspended_at" field predicates. + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + SuspendedAtNEQ *time.Time `json:"suspendedAtNEQ,omitempty"` + SuspendedAtIn []time.Time `json:"suspendedAtIn,omitempty"` + SuspendedAtNotIn []time.Time `json:"suspendedAtNotIn,omitempty"` + SuspendedAtGT *time.Time `json:"suspendedAtGT,omitempty"` + SuspendedAtGTE *time.Time `json:"suspendedAtGTE,omitempty"` + SuspendedAtLT *time.Time `json:"suspendedAtLT,omitempty"` + SuspendedAtLTE *time.Time `json:"suspendedAtLTE,omitempty"` + SuspendedAtIsNil bool `json:"suspendedAtIsNil,omitempty"` + SuspendedAtNotNil bool `json:"suspendedAtNotNil,omitempty"` + + // "status" field predicates. + Status *enums.UserStatus `json:"status,omitempty"` + StatusNEQ *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + + // "email_confirmed" field predicates. + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + EmailConfirmedNEQ *bool `json:"emailConfirmedNEQ,omitempty"` + + // "is_webauthn_allowed" field predicates. + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + IsWebauthnAllowedNEQ *bool `json:"isWebauthnAllowedNEQ,omitempty"` + IsWebauthnAllowedIsNil bool `json:"isWebauthnAllowedIsNil,omitempty"` + IsWebauthnAllowedNotNil bool `json:"isWebauthnAllowedNotNil,omitempty"` + + // "is_tfa_enabled" field predicates. + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + IsTfaEnabledNEQ *bool `json:"isTfaEnabledNEQ,omitempty"` + IsTfaEnabledIsNil bool `json:"isTfaEnabledIsNil,omitempty"` + IsTfaEnabledNotNil bool `json:"isTfaEnabledNotNil,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *UserSettingHistoryWhereInput) AddPredicates(predicates ...predicate.UserSettingHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the UserSettingHistoryWhereInput filter on the UserSettingHistoryQuery builder. +func (i *UserSettingHistoryWhereInput) Filter(q *UserSettingHistoryQuery) (*UserSettingHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyUserSettingHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyUserSettingHistoryWhereInput is returned in case the UserSettingHistoryWhereInput is empty. +var ErrEmptyUserSettingHistoryWhereInput = errors.New("generated: empty predicate UserSettingHistoryWhereInput") + +// P returns a predicate for filtering usersettinghistories. +// An error is returned if the input is empty or invalid. +func (i *UserSettingHistoryWhereInput) P() (predicate.UserSettingHistory, error) { + var predicates []predicate.UserSettingHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, usersettinghistory.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.UserSettingHistory, 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, usersettinghistory.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.UserSettingHistory, 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, usersettinghistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, usersettinghistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, usersettinghistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, usersettinghistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, usersettinghistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, usersettinghistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, usersettinghistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, usersettinghistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, usersettinghistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, usersettinghistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, usersettinghistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, usersettinghistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, usersettinghistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, usersettinghistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, usersettinghistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, usersettinghistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, usersettinghistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, usersettinghistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, usersettinghistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, usersettinghistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, usersettinghistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, usersettinghistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, usersettinghistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, usersettinghistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, usersettinghistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, usersettinghistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, usersettinghistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, usersettinghistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, usersettinghistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, usersettinghistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, usersettinghistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, usersettinghistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, usersettinghistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, usersettinghistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, usersettinghistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, usersettinghistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, usersettinghistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, usersettinghistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, usersettinghistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, usersettinghistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, usersettinghistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, usersettinghistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, usersettinghistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, usersettinghistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, usersettinghistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, usersettinghistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, usersettinghistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, usersettinghistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, usersettinghistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, usersettinghistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, usersettinghistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, usersettinghistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, usersettinghistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, usersettinghistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, usersettinghistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, usersettinghistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, usersettinghistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, usersettinghistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, usersettinghistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, usersettinghistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, usersettinghistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, usersettinghistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, usersettinghistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, usersettinghistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, usersettinghistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, usersettinghistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, usersettinghistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, usersettinghistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, usersettinghistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, usersettinghistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, usersettinghistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, usersettinghistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, usersettinghistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, usersettinghistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, usersettinghistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, usersettinghistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, usersettinghistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, usersettinghistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, usersettinghistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, usersettinghistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, usersettinghistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, usersettinghistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, usersettinghistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, usersettinghistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, usersettinghistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, usersettinghistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, usersettinghistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, usersettinghistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, usersettinghistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, usersettinghistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, usersettinghistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, usersettinghistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, usersettinghistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, usersettinghistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, usersettinghistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, usersettinghistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, usersettinghistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, usersettinghistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, usersettinghistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, usersettinghistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, usersettinghistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, usersettinghistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, usersettinghistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, usersettinghistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, usersettinghistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, usersettinghistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, usersettinghistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, usersettinghistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, usersettinghistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, usersettinghistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, usersettinghistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, usersettinghistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, usersettinghistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.UserID != nil { + predicates = append(predicates, usersettinghistory.UserIDEQ(*i.UserID)) + } + if i.UserIDNEQ != nil { + predicates = append(predicates, usersettinghistory.UserIDNEQ(*i.UserIDNEQ)) + } + if len(i.UserIDIn) > 0 { + predicates = append(predicates, usersettinghistory.UserIDIn(i.UserIDIn...)) + } + if len(i.UserIDNotIn) > 0 { + predicates = append(predicates, usersettinghistory.UserIDNotIn(i.UserIDNotIn...)) + } + if i.UserIDGT != nil { + predicates = append(predicates, usersettinghistory.UserIDGT(*i.UserIDGT)) + } + if i.UserIDGTE != nil { + predicates = append(predicates, usersettinghistory.UserIDGTE(*i.UserIDGTE)) + } + if i.UserIDLT != nil { + predicates = append(predicates, usersettinghistory.UserIDLT(*i.UserIDLT)) + } + if i.UserIDLTE != nil { + predicates = append(predicates, usersettinghistory.UserIDLTE(*i.UserIDLTE)) + } + if i.UserIDContains != nil { + predicates = append(predicates, usersettinghistory.UserIDContains(*i.UserIDContains)) + } + if i.UserIDHasPrefix != nil { + predicates = append(predicates, usersettinghistory.UserIDHasPrefix(*i.UserIDHasPrefix)) + } + if i.UserIDHasSuffix != nil { + predicates = append(predicates, usersettinghistory.UserIDHasSuffix(*i.UserIDHasSuffix)) + } + if i.UserIDIsNil { + predicates = append(predicates, usersettinghistory.UserIDIsNil()) + } + if i.UserIDNotNil { + predicates = append(predicates, usersettinghistory.UserIDNotNil()) + } + if i.UserIDEqualFold != nil { + predicates = append(predicates, usersettinghistory.UserIDEqualFold(*i.UserIDEqualFold)) + } + if i.UserIDContainsFold != nil { + predicates = append(predicates, usersettinghistory.UserIDContainsFold(*i.UserIDContainsFold)) + } + if i.Locked != nil { + predicates = append(predicates, usersettinghistory.LockedEQ(*i.Locked)) + } + if i.LockedNEQ != nil { + predicates = append(predicates, usersettinghistory.LockedNEQ(*i.LockedNEQ)) + } + if i.SilencedAt != nil { + predicates = append(predicates, usersettinghistory.SilencedAtEQ(*i.SilencedAt)) + } + if i.SilencedAtNEQ != nil { + predicates = append(predicates, usersettinghistory.SilencedAtNEQ(*i.SilencedAtNEQ)) + } + if len(i.SilencedAtIn) > 0 { + predicates = append(predicates, usersettinghistory.SilencedAtIn(i.SilencedAtIn...)) + } + if len(i.SilencedAtNotIn) > 0 { + predicates = append(predicates, usersettinghistory.SilencedAtNotIn(i.SilencedAtNotIn...)) + } + if i.SilencedAtGT != nil { + predicates = append(predicates, usersettinghistory.SilencedAtGT(*i.SilencedAtGT)) + } + if i.SilencedAtGTE != nil { + predicates = append(predicates, usersettinghistory.SilencedAtGTE(*i.SilencedAtGTE)) + } + if i.SilencedAtLT != nil { + predicates = append(predicates, usersettinghistory.SilencedAtLT(*i.SilencedAtLT)) + } + if i.SilencedAtLTE != nil { + predicates = append(predicates, usersettinghistory.SilencedAtLTE(*i.SilencedAtLTE)) + } + if i.SilencedAtIsNil { + predicates = append(predicates, usersettinghistory.SilencedAtIsNil()) + } + if i.SilencedAtNotNil { + predicates = append(predicates, usersettinghistory.SilencedAtNotNil()) + } + if i.SuspendedAt != nil { + predicates = append(predicates, usersettinghistory.SuspendedAtEQ(*i.SuspendedAt)) + } + if i.SuspendedAtNEQ != nil { + predicates = append(predicates, usersettinghistory.SuspendedAtNEQ(*i.SuspendedAtNEQ)) + } + if len(i.SuspendedAtIn) > 0 { + predicates = append(predicates, usersettinghistory.SuspendedAtIn(i.SuspendedAtIn...)) + } + if len(i.SuspendedAtNotIn) > 0 { + predicates = append(predicates, usersettinghistory.SuspendedAtNotIn(i.SuspendedAtNotIn...)) + } + if i.SuspendedAtGT != nil { + predicates = append(predicates, usersettinghistory.SuspendedAtGT(*i.SuspendedAtGT)) + } + if i.SuspendedAtGTE != nil { + predicates = append(predicates, usersettinghistory.SuspendedAtGTE(*i.SuspendedAtGTE)) + } + if i.SuspendedAtLT != nil { + predicates = append(predicates, usersettinghistory.SuspendedAtLT(*i.SuspendedAtLT)) + } + if i.SuspendedAtLTE != nil { + predicates = append(predicates, usersettinghistory.SuspendedAtLTE(*i.SuspendedAtLTE)) + } + if i.SuspendedAtIsNil { + predicates = append(predicates, usersettinghistory.SuspendedAtIsNil()) + } + if i.SuspendedAtNotNil { + predicates = append(predicates, usersettinghistory.SuspendedAtNotNil()) + } + if i.Status != nil { + predicates = append(predicates, usersettinghistory.StatusEQ(*i.Status)) + } + if i.StatusNEQ != nil { + predicates = append(predicates, usersettinghistory.StatusNEQ(*i.StatusNEQ)) + } + if len(i.StatusIn) > 0 { + predicates = append(predicates, usersettinghistory.StatusIn(i.StatusIn...)) + } + if len(i.StatusNotIn) > 0 { + predicates = append(predicates, usersettinghistory.StatusNotIn(i.StatusNotIn...)) + } + if i.EmailConfirmed != nil { + predicates = append(predicates, usersettinghistory.EmailConfirmedEQ(*i.EmailConfirmed)) + } + if i.EmailConfirmedNEQ != nil { + predicates = append(predicates, usersettinghistory.EmailConfirmedNEQ(*i.EmailConfirmedNEQ)) + } + if i.IsWebauthnAllowed != nil { + predicates = append(predicates, usersettinghistory.IsWebauthnAllowedEQ(*i.IsWebauthnAllowed)) + } + if i.IsWebauthnAllowedNEQ != nil { + predicates = append(predicates, usersettinghistory.IsWebauthnAllowedNEQ(*i.IsWebauthnAllowedNEQ)) + } + if i.IsWebauthnAllowedIsNil { + predicates = append(predicates, usersettinghistory.IsWebauthnAllowedIsNil()) + } + if i.IsWebauthnAllowedNotNil { + predicates = append(predicates, usersettinghistory.IsWebauthnAllowedNotNil()) + } + if i.IsTfaEnabled != nil { + predicates = append(predicates, usersettinghistory.IsTfaEnabledEQ(*i.IsTfaEnabled)) + } + if i.IsTfaEnabledNEQ != nil { + predicates = append(predicates, usersettinghistory.IsTfaEnabledNEQ(*i.IsTfaEnabledNEQ)) + } + if i.IsTfaEnabledIsNil { + predicates = append(predicates, usersettinghistory.IsTfaEnabledIsNil()) + } + if i.IsTfaEnabledNotNil { + predicates = append(predicates, usersettinghistory.IsTfaEnabledNotNil()) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyUserSettingHistoryWhereInput + case 1: + return predicates[0], nil + default: + return usersettinghistory.And(predicates...), nil + } +} + +// WebhookWhereInput represents a where input for filtering Webhook queries. +type WebhookWhereInput struct { + Predicates []predicate.Webhook `json:"-"` + Not *WebhookWhereInput `json:"not,omitempty"` + Or []*WebhookWhereInput `json:"or,omitempty"` + And []*WebhookWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "destination_url" field predicates. + DestinationURL *string `json:"destinationURL,omitempty"` + DestinationURLNEQ *string `json:"destinationURLNEQ,omitempty"` + DestinationURLIn []string `json:"destinationURLIn,omitempty"` + DestinationURLNotIn []string `json:"destinationURLNotIn,omitempty"` + DestinationURLGT *string `json:"destinationURLGT,omitempty"` + DestinationURLGTE *string `json:"destinationURLGTE,omitempty"` + DestinationURLLT *string `json:"destinationURLLT,omitempty"` + DestinationURLLTE *string `json:"destinationURLLTE,omitempty"` + DestinationURLContains *string `json:"destinationURLContains,omitempty"` + DestinationURLHasPrefix *string `json:"destinationURLHasPrefix,omitempty"` + DestinationURLHasSuffix *string `json:"destinationURLHasSuffix,omitempty"` + DestinationURLEqualFold *string `json:"destinationURLEqualFold,omitempty"` + DestinationURLContainsFold *string `json:"destinationURLContainsFold,omitempty"` + + // "enabled" field predicates. + Enabled *bool `json:"enabled,omitempty"` + EnabledNEQ *bool `json:"enabledNEQ,omitempty"` + + // "failures" field predicates. + Failures *int `json:"failures,omitempty"` + FailuresNEQ *int `json:"failuresNEQ,omitempty"` + FailuresIn []int `json:"failuresIn,omitempty"` + FailuresNotIn []int `json:"failuresNotIn,omitempty"` + FailuresGT *int `json:"failuresGT,omitempty"` + FailuresGTE *int `json:"failuresGTE,omitempty"` + FailuresLT *int `json:"failuresLT,omitempty"` + FailuresLTE *int `json:"failuresLTE,omitempty"` + FailuresIsNil bool `json:"failuresIsNil,omitempty"` + FailuresNotNil bool `json:"failuresNotNil,omitempty"` + + // "last_error" field predicates. + LastError *string `json:"lastError,omitempty"` + LastErrorNEQ *string `json:"lastErrorNEQ,omitempty"` + LastErrorIn []string `json:"lastErrorIn,omitempty"` + LastErrorNotIn []string `json:"lastErrorNotIn,omitempty"` + LastErrorGT *string `json:"lastErrorGT,omitempty"` + LastErrorGTE *string `json:"lastErrorGTE,omitempty"` + LastErrorLT *string `json:"lastErrorLT,omitempty"` + LastErrorLTE *string `json:"lastErrorLTE,omitempty"` + LastErrorContains *string `json:"lastErrorContains,omitempty"` + LastErrorHasPrefix *string `json:"lastErrorHasPrefix,omitempty"` + LastErrorHasSuffix *string `json:"lastErrorHasSuffix,omitempty"` + LastErrorIsNil bool `json:"lastErrorIsNil,omitempty"` + LastErrorNotNil bool `json:"lastErrorNotNil,omitempty"` + LastErrorEqualFold *string `json:"lastErrorEqualFold,omitempty"` + LastErrorContainsFold *string `json:"lastErrorContainsFold,omitempty"` + + // "last_response" field predicates. + LastResponse *string `json:"lastResponse,omitempty"` + LastResponseNEQ *string `json:"lastResponseNEQ,omitempty"` + LastResponseIn []string `json:"lastResponseIn,omitempty"` + LastResponseNotIn []string `json:"lastResponseNotIn,omitempty"` + LastResponseGT *string `json:"lastResponseGT,omitempty"` + LastResponseGTE *string `json:"lastResponseGTE,omitempty"` + LastResponseLT *string `json:"lastResponseLT,omitempty"` + LastResponseLTE *string `json:"lastResponseLTE,omitempty"` + LastResponseContains *string `json:"lastResponseContains,omitempty"` + LastResponseHasPrefix *string `json:"lastResponseHasPrefix,omitempty"` + LastResponseHasSuffix *string `json:"lastResponseHasSuffix,omitempty"` + LastResponseIsNil bool `json:"lastResponseIsNil,omitempty"` + LastResponseNotNil bool `json:"lastResponseNotNil,omitempty"` + LastResponseEqualFold *string `json:"lastResponseEqualFold,omitempty"` + LastResponseContainsFold *string `json:"lastResponseContainsFold,omitempty"` + + // "owner" edge predicates. + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + + // "events" edge predicates. + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + + // "integrations" edge predicates. + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *WebhookWhereInput) AddPredicates(predicates ...predicate.Webhook) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the WebhookWhereInput filter on the WebhookQuery builder. +func (i *WebhookWhereInput) Filter(q *WebhookQuery) (*WebhookQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyWebhookWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyWebhookWhereInput is returned in case the WebhookWhereInput is empty. +var ErrEmptyWebhookWhereInput = errors.New("generated: empty predicate WebhookWhereInput") + +// P returns a predicate for filtering webhooks. +// An error is returned if the input is empty or invalid. +func (i *WebhookWhereInput) P() (predicate.Webhook, error) { + var predicates []predicate.Webhook + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, webhook.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.Webhook, 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, webhook.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.Webhook, 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, webhook.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, webhook.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, webhook.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, webhook.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, webhook.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, webhook.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, webhook.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, webhook.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, webhook.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, webhook.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, webhook.IDContainsFold(*i.IDContainsFold)) + } + if i.CreatedAt != nil { + predicates = append(predicates, webhook.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, webhook.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, webhook.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, webhook.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, webhook.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, webhook.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, webhook.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, webhook.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, webhook.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, webhook.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, webhook.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, webhook.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, webhook.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, webhook.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, webhook.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, webhook.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, webhook.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, webhook.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, webhook.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, webhook.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, webhook.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, webhook.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, webhook.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, webhook.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, webhook.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, webhook.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, webhook.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, webhook.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, webhook.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, webhook.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, webhook.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, webhook.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, webhook.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, webhook.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, webhook.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, webhook.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, webhook.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, webhook.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, webhook.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, webhook.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, webhook.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, webhook.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, webhook.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, webhook.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, webhook.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, webhook.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, webhook.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, webhook.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, webhook.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, webhook.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, webhook.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, webhook.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, webhook.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, webhook.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, webhook.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, webhook.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, webhook.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, webhook.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, webhook.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, webhook.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, webhook.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, webhook.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, webhook.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, webhook.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, webhook.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, webhook.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, webhook.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, webhook.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, webhook.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, webhook.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, webhook.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, webhook.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, webhook.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, webhook.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, webhook.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, webhook.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, webhook.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, webhook.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, webhook.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, webhook.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, webhook.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, webhook.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, webhook.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, webhook.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, webhook.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, webhook.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, webhook.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, webhook.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, webhook.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, webhook.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, webhook.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, webhook.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, webhook.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, webhook.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, webhook.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, webhook.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, webhook.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, webhook.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, webhook.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, webhook.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, webhook.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, webhook.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, webhook.NameContainsFold(*i.NameContainsFold)) + } + if i.DestinationURL != nil { + predicates = append(predicates, webhook.DestinationURLEQ(*i.DestinationURL)) + } + if i.DestinationURLNEQ != nil { + predicates = append(predicates, webhook.DestinationURLNEQ(*i.DestinationURLNEQ)) + } + if len(i.DestinationURLIn) > 0 { + predicates = append(predicates, webhook.DestinationURLIn(i.DestinationURLIn...)) + } + if len(i.DestinationURLNotIn) > 0 { + predicates = append(predicates, webhook.DestinationURLNotIn(i.DestinationURLNotIn...)) + } + if i.DestinationURLGT != nil { + predicates = append(predicates, webhook.DestinationURLGT(*i.DestinationURLGT)) + } + if i.DestinationURLGTE != nil { + predicates = append(predicates, webhook.DestinationURLGTE(*i.DestinationURLGTE)) + } + if i.DestinationURLLT != nil { + predicates = append(predicates, webhook.DestinationURLLT(*i.DestinationURLLT)) + } + if i.DestinationURLLTE != nil { + predicates = append(predicates, webhook.DestinationURLLTE(*i.DestinationURLLTE)) + } + if i.DestinationURLContains != nil { + predicates = append(predicates, webhook.DestinationURLContains(*i.DestinationURLContains)) + } + if i.DestinationURLHasPrefix != nil { + predicates = append(predicates, webhook.DestinationURLHasPrefix(*i.DestinationURLHasPrefix)) + } + if i.DestinationURLHasSuffix != nil { + predicates = append(predicates, webhook.DestinationURLHasSuffix(*i.DestinationURLHasSuffix)) + } + if i.DestinationURLEqualFold != nil { + predicates = append(predicates, webhook.DestinationURLEqualFold(*i.DestinationURLEqualFold)) + } + if i.DestinationURLContainsFold != nil { + predicates = append(predicates, webhook.DestinationURLContainsFold(*i.DestinationURLContainsFold)) + } + if i.Enabled != nil { + predicates = append(predicates, webhook.EnabledEQ(*i.Enabled)) + } + if i.EnabledNEQ != nil { + predicates = append(predicates, webhook.EnabledNEQ(*i.EnabledNEQ)) + } + if i.Failures != nil { + predicates = append(predicates, webhook.FailuresEQ(*i.Failures)) + } + if i.FailuresNEQ != nil { + predicates = append(predicates, webhook.FailuresNEQ(*i.FailuresNEQ)) + } + if len(i.FailuresIn) > 0 { + predicates = append(predicates, webhook.FailuresIn(i.FailuresIn...)) + } + if len(i.FailuresNotIn) > 0 { + predicates = append(predicates, webhook.FailuresNotIn(i.FailuresNotIn...)) + } + if i.FailuresGT != nil { + predicates = append(predicates, webhook.FailuresGT(*i.FailuresGT)) + } + if i.FailuresGTE != nil { + predicates = append(predicates, webhook.FailuresGTE(*i.FailuresGTE)) + } + if i.FailuresLT != nil { + predicates = append(predicates, webhook.FailuresLT(*i.FailuresLT)) + } + if i.FailuresLTE != nil { + predicates = append(predicates, webhook.FailuresLTE(*i.FailuresLTE)) + } + if i.FailuresIsNil { + predicates = append(predicates, webhook.FailuresIsNil()) + } + if i.FailuresNotNil { + predicates = append(predicates, webhook.FailuresNotNil()) + } + if i.LastError != nil { + predicates = append(predicates, webhook.LastErrorEQ(*i.LastError)) + } + if i.LastErrorNEQ != nil { + predicates = append(predicates, webhook.LastErrorNEQ(*i.LastErrorNEQ)) + } + if len(i.LastErrorIn) > 0 { + predicates = append(predicates, webhook.LastErrorIn(i.LastErrorIn...)) + } + if len(i.LastErrorNotIn) > 0 { + predicates = append(predicates, webhook.LastErrorNotIn(i.LastErrorNotIn...)) + } + if i.LastErrorGT != nil { + predicates = append(predicates, webhook.LastErrorGT(*i.LastErrorGT)) + } + if i.LastErrorGTE != nil { + predicates = append(predicates, webhook.LastErrorGTE(*i.LastErrorGTE)) + } + if i.LastErrorLT != nil { + predicates = append(predicates, webhook.LastErrorLT(*i.LastErrorLT)) + } + if i.LastErrorLTE != nil { + predicates = append(predicates, webhook.LastErrorLTE(*i.LastErrorLTE)) + } + if i.LastErrorContains != nil { + predicates = append(predicates, webhook.LastErrorContains(*i.LastErrorContains)) + } + if i.LastErrorHasPrefix != nil { + predicates = append(predicates, webhook.LastErrorHasPrefix(*i.LastErrorHasPrefix)) + } + if i.LastErrorHasSuffix != nil { + predicates = append(predicates, webhook.LastErrorHasSuffix(*i.LastErrorHasSuffix)) + } + if i.LastErrorIsNil { + predicates = append(predicates, webhook.LastErrorIsNil()) + } + if i.LastErrorNotNil { + predicates = append(predicates, webhook.LastErrorNotNil()) + } + if i.LastErrorEqualFold != nil { + predicates = append(predicates, webhook.LastErrorEqualFold(*i.LastErrorEqualFold)) + } + if i.LastErrorContainsFold != nil { + predicates = append(predicates, webhook.LastErrorContainsFold(*i.LastErrorContainsFold)) + } + if i.LastResponse != nil { + predicates = append(predicates, webhook.LastResponseEQ(*i.LastResponse)) + } + if i.LastResponseNEQ != nil { + predicates = append(predicates, webhook.LastResponseNEQ(*i.LastResponseNEQ)) + } + if len(i.LastResponseIn) > 0 { + predicates = append(predicates, webhook.LastResponseIn(i.LastResponseIn...)) + } + if len(i.LastResponseNotIn) > 0 { + predicates = append(predicates, webhook.LastResponseNotIn(i.LastResponseNotIn...)) + } + if i.LastResponseGT != nil { + predicates = append(predicates, webhook.LastResponseGT(*i.LastResponseGT)) + } + if i.LastResponseGTE != nil { + predicates = append(predicates, webhook.LastResponseGTE(*i.LastResponseGTE)) + } + if i.LastResponseLT != nil { + predicates = append(predicates, webhook.LastResponseLT(*i.LastResponseLT)) + } + if i.LastResponseLTE != nil { + predicates = append(predicates, webhook.LastResponseLTE(*i.LastResponseLTE)) + } + if i.LastResponseContains != nil { + predicates = append(predicates, webhook.LastResponseContains(*i.LastResponseContains)) + } + if i.LastResponseHasPrefix != nil { + predicates = append(predicates, webhook.LastResponseHasPrefix(*i.LastResponseHasPrefix)) + } + if i.LastResponseHasSuffix != nil { + predicates = append(predicates, webhook.LastResponseHasSuffix(*i.LastResponseHasSuffix)) + } + if i.LastResponseIsNil { + predicates = append(predicates, webhook.LastResponseIsNil()) + } + if i.LastResponseNotNil { + predicates = append(predicates, webhook.LastResponseNotNil()) + } + if i.LastResponseEqualFold != nil { + predicates = append(predicates, webhook.LastResponseEqualFold(*i.LastResponseEqualFold)) + } + if i.LastResponseContainsFold != nil { + predicates = append(predicates, webhook.LastResponseContainsFold(*i.LastResponseContainsFold)) + } + + if i.HasOwner != nil { + p := webhook.HasOwner() + if !*i.HasOwner { + p = webhook.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasOwnerWith) > 0 { + with := make([]predicate.Organization, 0, len(i.HasOwnerWith)) + for _, w := range i.HasOwnerWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasOwnerWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, webhook.HasOwnerWith(with...)) + } + if i.HasEvents != nil { + p := webhook.HasEvents() + if !*i.HasEvents { + p = webhook.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasEventsWith) > 0 { + with := make([]predicate.Event, 0, len(i.HasEventsWith)) + for _, w := range i.HasEventsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasEventsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, webhook.HasEventsWith(with...)) + } + if i.HasIntegrations != nil { + p := webhook.HasIntegrations() + if !*i.HasIntegrations { + p = webhook.Not(p) + } + predicates = append(predicates, p) + } + if len(i.HasIntegrationsWith) > 0 { + with := make([]predicate.Integration, 0, len(i.HasIntegrationsWith)) + for _, w := range i.HasIntegrationsWith { + p, err := w.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'HasIntegrationsWith'", err) + } + with = append(with, p) + } + predicates = append(predicates, webhook.HasIntegrationsWith(with...)) + } + switch len(predicates) { + case 0: + return nil, ErrEmptyWebhookWhereInput + case 1: + return predicates[0], nil + default: + return webhook.And(predicates...), nil + } +} + +// WebhookHistoryWhereInput represents a where input for filtering WebhookHistory queries. +type WebhookHistoryWhereInput struct { + Predicates []predicate.WebhookHistory `json:"-"` + Not *WebhookHistoryWhereInput `json:"not,omitempty"` + Or []*WebhookHistoryWhereInput `json:"or,omitempty"` + And []*WebhookHistoryWhereInput `json:"and,omitempty"` + + // "id" field predicates. + ID *string `json:"id,omitempty"` + IDNEQ *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGT *string `json:"idGT,omitempty"` + IDGTE *string `json:"idGTE,omitempty"` + IDLT *string `json:"idLT,omitempty"` + IDLTE *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + + // "history_time" field predicates. + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNEQ *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGT *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGTE *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLT *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLTE *time.Time `json:"historyTimeLTE,omitempty"` + + // "ref" field predicates. + Ref *string `json:"ref,omitempty"` + RefNEQ *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGT *string `json:"refGT,omitempty"` + RefGTE *string `json:"refGTE,omitempty"` + RefLT *string `json:"refLT,omitempty"` + RefLTE *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil bool `json:"refIsNil,omitempty"` + RefNotNil bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + + // "operation" field predicates. + Operation *history.OpType `json:"operation,omitempty"` + OperationNEQ *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + + // "created_at" field predicates. + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil bool `json:"createdAtNotNil,omitempty"` + + // "updated_at" field predicates. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil bool `json:"updatedAtNotNil,omitempty"` + + // "created_by" field predicates. + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNEQ *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGT *string `json:"createdByGT,omitempty"` + CreatedByGTE *string `json:"createdByGTE,omitempty"` + CreatedByLT *string `json:"createdByLT,omitempty"` + CreatedByLTE *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + + // "updated_by" field predicates. + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNEQ *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGT *string `json:"updatedByGT,omitempty"` + UpdatedByGTE *string `json:"updatedByGTE,omitempty"` + UpdatedByLT *string `json:"updatedByLT,omitempty"` + UpdatedByLTE *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + + // "deleted_at" field predicates. + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNEQ *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGT *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGTE *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLT *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLTE *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil bool `json:"deletedAtNotNil,omitempty"` + + // "deleted_by" field predicates. + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNEQ *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGT *string `json:"deletedByGT,omitempty"` + DeletedByGTE *string `json:"deletedByGTE,omitempty"` + DeletedByLT *string `json:"deletedByLT,omitempty"` + DeletedByLTE *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + + // "owner_id" field predicates. + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNEQ *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGT *string `json:"ownerIDGT,omitempty"` + OwnerIDGTE *string `json:"ownerIDGTE,omitempty"` + OwnerIDLT *string `json:"ownerIDLT,omitempty"` + OwnerIDLTE *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + + // "name" field predicates. + Name *string `json:"name,omitempty"` + NameNEQ *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGT *string `json:"nameGT,omitempty"` + NameGTE *string `json:"nameGTE,omitempty"` + NameLT *string `json:"nameLT,omitempty"` + NameLTE *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + + // "destination_url" field predicates. + DestinationURL *string `json:"destinationURL,omitempty"` + DestinationURLNEQ *string `json:"destinationURLNEQ,omitempty"` + DestinationURLIn []string `json:"destinationURLIn,omitempty"` + DestinationURLNotIn []string `json:"destinationURLNotIn,omitempty"` + DestinationURLGT *string `json:"destinationURLGT,omitempty"` + DestinationURLGTE *string `json:"destinationURLGTE,omitempty"` + DestinationURLLT *string `json:"destinationURLLT,omitempty"` + DestinationURLLTE *string `json:"destinationURLLTE,omitempty"` + DestinationURLContains *string `json:"destinationURLContains,omitempty"` + DestinationURLHasPrefix *string `json:"destinationURLHasPrefix,omitempty"` + DestinationURLHasSuffix *string `json:"destinationURLHasSuffix,omitempty"` + DestinationURLEqualFold *string `json:"destinationURLEqualFold,omitempty"` + DestinationURLContainsFold *string `json:"destinationURLContainsFold,omitempty"` + + // "enabled" field predicates. + Enabled *bool `json:"enabled,omitempty"` + EnabledNEQ *bool `json:"enabledNEQ,omitempty"` + + // "failures" field predicates. + Failures *int `json:"failures,omitempty"` + FailuresNEQ *int `json:"failuresNEQ,omitempty"` + FailuresIn []int `json:"failuresIn,omitempty"` + FailuresNotIn []int `json:"failuresNotIn,omitempty"` + FailuresGT *int `json:"failuresGT,omitempty"` + FailuresGTE *int `json:"failuresGTE,omitempty"` + FailuresLT *int `json:"failuresLT,omitempty"` + FailuresLTE *int `json:"failuresLTE,omitempty"` + FailuresIsNil bool `json:"failuresIsNil,omitempty"` + FailuresNotNil bool `json:"failuresNotNil,omitempty"` + + // "last_error" field predicates. + LastError *string `json:"lastError,omitempty"` + LastErrorNEQ *string `json:"lastErrorNEQ,omitempty"` + LastErrorIn []string `json:"lastErrorIn,omitempty"` + LastErrorNotIn []string `json:"lastErrorNotIn,omitempty"` + LastErrorGT *string `json:"lastErrorGT,omitempty"` + LastErrorGTE *string `json:"lastErrorGTE,omitempty"` + LastErrorLT *string `json:"lastErrorLT,omitempty"` + LastErrorLTE *string `json:"lastErrorLTE,omitempty"` + LastErrorContains *string `json:"lastErrorContains,omitempty"` + LastErrorHasPrefix *string `json:"lastErrorHasPrefix,omitempty"` + LastErrorHasSuffix *string `json:"lastErrorHasSuffix,omitempty"` + LastErrorIsNil bool `json:"lastErrorIsNil,omitempty"` + LastErrorNotNil bool `json:"lastErrorNotNil,omitempty"` + LastErrorEqualFold *string `json:"lastErrorEqualFold,omitempty"` + LastErrorContainsFold *string `json:"lastErrorContainsFold,omitempty"` + + // "last_response" field predicates. + LastResponse *string `json:"lastResponse,omitempty"` + LastResponseNEQ *string `json:"lastResponseNEQ,omitempty"` + LastResponseIn []string `json:"lastResponseIn,omitempty"` + LastResponseNotIn []string `json:"lastResponseNotIn,omitempty"` + LastResponseGT *string `json:"lastResponseGT,omitempty"` + LastResponseGTE *string `json:"lastResponseGTE,omitempty"` + LastResponseLT *string `json:"lastResponseLT,omitempty"` + LastResponseLTE *string `json:"lastResponseLTE,omitempty"` + LastResponseContains *string `json:"lastResponseContains,omitempty"` + LastResponseHasPrefix *string `json:"lastResponseHasPrefix,omitempty"` + LastResponseHasSuffix *string `json:"lastResponseHasSuffix,omitempty"` + LastResponseIsNil bool `json:"lastResponseIsNil,omitempty"` + LastResponseNotNil bool `json:"lastResponseNotNil,omitempty"` + LastResponseEqualFold *string `json:"lastResponseEqualFold,omitempty"` + LastResponseContainsFold *string `json:"lastResponseContainsFold,omitempty"` +} + +// AddPredicates adds custom predicates to the where input to be used during the filtering phase. +func (i *WebhookHistoryWhereInput) AddPredicates(predicates ...predicate.WebhookHistory) { + i.Predicates = append(i.Predicates, predicates...) +} + +// Filter applies the WebhookHistoryWhereInput filter on the WebhookHistoryQuery builder. +func (i *WebhookHistoryWhereInput) Filter(q *WebhookHistoryQuery) (*WebhookHistoryQuery, error) { + if i == nil { + return q, nil + } + p, err := i.P() + if err != nil { + if err == ErrEmptyWebhookHistoryWhereInput { + return q, nil + } + return nil, err + } + return q.Where(p), nil +} + +// ErrEmptyWebhookHistoryWhereInput is returned in case the WebhookHistoryWhereInput is empty. +var ErrEmptyWebhookHistoryWhereInput = errors.New("generated: empty predicate WebhookHistoryWhereInput") + +// P returns a predicate for filtering webhookhistories. +// An error is returned if the input is empty or invalid. +func (i *WebhookHistoryWhereInput) P() (predicate.WebhookHistory, error) { + var predicates []predicate.WebhookHistory + if i.Not != nil { + p, err := i.Not.P() + if err != nil { + return nil, fmt.Errorf("%w: field 'not'", err) + } + predicates = append(predicates, webhookhistory.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.WebhookHistory, 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, webhookhistory.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.WebhookHistory, 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, webhookhistory.And(and...)) + } + predicates = append(predicates, i.Predicates...) + if i.ID != nil { + predicates = append(predicates, webhookhistory.IDEQ(*i.ID)) + } + if i.IDNEQ != nil { + predicates = append(predicates, webhookhistory.IDNEQ(*i.IDNEQ)) + } + if len(i.IDIn) > 0 { + predicates = append(predicates, webhookhistory.IDIn(i.IDIn...)) + } + if len(i.IDNotIn) > 0 { + predicates = append(predicates, webhookhistory.IDNotIn(i.IDNotIn...)) + } + if i.IDGT != nil { + predicates = append(predicates, webhookhistory.IDGT(*i.IDGT)) + } + if i.IDGTE != nil { + predicates = append(predicates, webhookhistory.IDGTE(*i.IDGTE)) + } + if i.IDLT != nil { + predicates = append(predicates, webhookhistory.IDLT(*i.IDLT)) + } + if i.IDLTE != nil { + predicates = append(predicates, webhookhistory.IDLTE(*i.IDLTE)) + } + if i.IDEqualFold != nil { + predicates = append(predicates, webhookhistory.IDEqualFold(*i.IDEqualFold)) + } + if i.IDContainsFold != nil { + predicates = append(predicates, webhookhistory.IDContainsFold(*i.IDContainsFold)) + } + if i.HistoryTime != nil { + predicates = append(predicates, webhookhistory.HistoryTimeEQ(*i.HistoryTime)) + } + if i.HistoryTimeNEQ != nil { + predicates = append(predicates, webhookhistory.HistoryTimeNEQ(*i.HistoryTimeNEQ)) + } + if len(i.HistoryTimeIn) > 0 { + predicates = append(predicates, webhookhistory.HistoryTimeIn(i.HistoryTimeIn...)) + } + if len(i.HistoryTimeNotIn) > 0 { + predicates = append(predicates, webhookhistory.HistoryTimeNotIn(i.HistoryTimeNotIn...)) + } + if i.HistoryTimeGT != nil { + predicates = append(predicates, webhookhistory.HistoryTimeGT(*i.HistoryTimeGT)) + } + if i.HistoryTimeGTE != nil { + predicates = append(predicates, webhookhistory.HistoryTimeGTE(*i.HistoryTimeGTE)) + } + if i.HistoryTimeLT != nil { + predicates = append(predicates, webhookhistory.HistoryTimeLT(*i.HistoryTimeLT)) + } + if i.HistoryTimeLTE != nil { + predicates = append(predicates, webhookhistory.HistoryTimeLTE(*i.HistoryTimeLTE)) + } + if i.Ref != nil { + predicates = append(predicates, webhookhistory.RefEQ(*i.Ref)) + } + if i.RefNEQ != nil { + predicates = append(predicates, webhookhistory.RefNEQ(*i.RefNEQ)) + } + if len(i.RefIn) > 0 { + predicates = append(predicates, webhookhistory.RefIn(i.RefIn...)) + } + if len(i.RefNotIn) > 0 { + predicates = append(predicates, webhookhistory.RefNotIn(i.RefNotIn...)) + } + if i.RefGT != nil { + predicates = append(predicates, webhookhistory.RefGT(*i.RefGT)) + } + if i.RefGTE != nil { + predicates = append(predicates, webhookhistory.RefGTE(*i.RefGTE)) + } + if i.RefLT != nil { + predicates = append(predicates, webhookhistory.RefLT(*i.RefLT)) + } + if i.RefLTE != nil { + predicates = append(predicates, webhookhistory.RefLTE(*i.RefLTE)) + } + if i.RefContains != nil { + predicates = append(predicates, webhookhistory.RefContains(*i.RefContains)) + } + if i.RefHasPrefix != nil { + predicates = append(predicates, webhookhistory.RefHasPrefix(*i.RefHasPrefix)) + } + if i.RefHasSuffix != nil { + predicates = append(predicates, webhookhistory.RefHasSuffix(*i.RefHasSuffix)) + } + if i.RefIsNil { + predicates = append(predicates, webhookhistory.RefIsNil()) + } + if i.RefNotNil { + predicates = append(predicates, webhookhistory.RefNotNil()) + } + if i.RefEqualFold != nil { + predicates = append(predicates, webhookhistory.RefEqualFold(*i.RefEqualFold)) + } + if i.RefContainsFold != nil { + predicates = append(predicates, webhookhistory.RefContainsFold(*i.RefContainsFold)) + } + if i.Operation != nil { + predicates = append(predicates, webhookhistory.OperationEQ(*i.Operation)) + } + if i.OperationNEQ != nil { + predicates = append(predicates, webhookhistory.OperationNEQ(*i.OperationNEQ)) + } + if len(i.OperationIn) > 0 { + predicates = append(predicates, webhookhistory.OperationIn(i.OperationIn...)) + } + if len(i.OperationNotIn) > 0 { + predicates = append(predicates, webhookhistory.OperationNotIn(i.OperationNotIn...)) + } + if i.CreatedAt != nil { + predicates = append(predicates, webhookhistory.CreatedAtEQ(*i.CreatedAt)) + } + if i.CreatedAtNEQ != nil { + predicates = append(predicates, webhookhistory.CreatedAtNEQ(*i.CreatedAtNEQ)) + } + if len(i.CreatedAtIn) > 0 { + predicates = append(predicates, webhookhistory.CreatedAtIn(i.CreatedAtIn...)) + } + if len(i.CreatedAtNotIn) > 0 { + predicates = append(predicates, webhookhistory.CreatedAtNotIn(i.CreatedAtNotIn...)) + } + if i.CreatedAtGT != nil { + predicates = append(predicates, webhookhistory.CreatedAtGT(*i.CreatedAtGT)) + } + if i.CreatedAtGTE != nil { + predicates = append(predicates, webhookhistory.CreatedAtGTE(*i.CreatedAtGTE)) + } + if i.CreatedAtLT != nil { + predicates = append(predicates, webhookhistory.CreatedAtLT(*i.CreatedAtLT)) + } + if i.CreatedAtLTE != nil { + predicates = append(predicates, webhookhistory.CreatedAtLTE(*i.CreatedAtLTE)) + } + if i.CreatedAtIsNil { + predicates = append(predicates, webhookhistory.CreatedAtIsNil()) + } + if i.CreatedAtNotNil { + predicates = append(predicates, webhookhistory.CreatedAtNotNil()) + } + if i.UpdatedAt != nil { + predicates = append(predicates, webhookhistory.UpdatedAtEQ(*i.UpdatedAt)) + } + if i.UpdatedAtNEQ != nil { + predicates = append(predicates, webhookhistory.UpdatedAtNEQ(*i.UpdatedAtNEQ)) + } + if len(i.UpdatedAtIn) > 0 { + predicates = append(predicates, webhookhistory.UpdatedAtIn(i.UpdatedAtIn...)) + } + if len(i.UpdatedAtNotIn) > 0 { + predicates = append(predicates, webhookhistory.UpdatedAtNotIn(i.UpdatedAtNotIn...)) + } + if i.UpdatedAtGT != nil { + predicates = append(predicates, webhookhistory.UpdatedAtGT(*i.UpdatedAtGT)) + } + if i.UpdatedAtGTE != nil { + predicates = append(predicates, webhookhistory.UpdatedAtGTE(*i.UpdatedAtGTE)) + } + if i.UpdatedAtLT != nil { + predicates = append(predicates, webhookhistory.UpdatedAtLT(*i.UpdatedAtLT)) + } + if i.UpdatedAtLTE != nil { + predicates = append(predicates, webhookhistory.UpdatedAtLTE(*i.UpdatedAtLTE)) + } + if i.UpdatedAtIsNil { + predicates = append(predicates, webhookhistory.UpdatedAtIsNil()) + } + if i.UpdatedAtNotNil { + predicates = append(predicates, webhookhistory.UpdatedAtNotNil()) + } + if i.CreatedBy != nil { + predicates = append(predicates, webhookhistory.CreatedByEQ(*i.CreatedBy)) + } + if i.CreatedByNEQ != nil { + predicates = append(predicates, webhookhistory.CreatedByNEQ(*i.CreatedByNEQ)) + } + if len(i.CreatedByIn) > 0 { + predicates = append(predicates, webhookhistory.CreatedByIn(i.CreatedByIn...)) + } + if len(i.CreatedByNotIn) > 0 { + predicates = append(predicates, webhookhistory.CreatedByNotIn(i.CreatedByNotIn...)) + } + if i.CreatedByGT != nil { + predicates = append(predicates, webhookhistory.CreatedByGT(*i.CreatedByGT)) + } + if i.CreatedByGTE != nil { + predicates = append(predicates, webhookhistory.CreatedByGTE(*i.CreatedByGTE)) + } + if i.CreatedByLT != nil { + predicates = append(predicates, webhookhistory.CreatedByLT(*i.CreatedByLT)) + } + if i.CreatedByLTE != nil { + predicates = append(predicates, webhookhistory.CreatedByLTE(*i.CreatedByLTE)) + } + if i.CreatedByContains != nil { + predicates = append(predicates, webhookhistory.CreatedByContains(*i.CreatedByContains)) + } + if i.CreatedByHasPrefix != nil { + predicates = append(predicates, webhookhistory.CreatedByHasPrefix(*i.CreatedByHasPrefix)) + } + if i.CreatedByHasSuffix != nil { + predicates = append(predicates, webhookhistory.CreatedByHasSuffix(*i.CreatedByHasSuffix)) + } + if i.CreatedByIsNil { + predicates = append(predicates, webhookhistory.CreatedByIsNil()) + } + if i.CreatedByNotNil { + predicates = append(predicates, webhookhistory.CreatedByNotNil()) + } + if i.CreatedByEqualFold != nil { + predicates = append(predicates, webhookhistory.CreatedByEqualFold(*i.CreatedByEqualFold)) + } + if i.CreatedByContainsFold != nil { + predicates = append(predicates, webhookhistory.CreatedByContainsFold(*i.CreatedByContainsFold)) + } + if i.UpdatedBy != nil { + predicates = append(predicates, webhookhistory.UpdatedByEQ(*i.UpdatedBy)) + } + if i.UpdatedByNEQ != nil { + predicates = append(predicates, webhookhistory.UpdatedByNEQ(*i.UpdatedByNEQ)) + } + if len(i.UpdatedByIn) > 0 { + predicates = append(predicates, webhookhistory.UpdatedByIn(i.UpdatedByIn...)) + } + if len(i.UpdatedByNotIn) > 0 { + predicates = append(predicates, webhookhistory.UpdatedByNotIn(i.UpdatedByNotIn...)) + } + if i.UpdatedByGT != nil { + predicates = append(predicates, webhookhistory.UpdatedByGT(*i.UpdatedByGT)) + } + if i.UpdatedByGTE != nil { + predicates = append(predicates, webhookhistory.UpdatedByGTE(*i.UpdatedByGTE)) + } + if i.UpdatedByLT != nil { + predicates = append(predicates, webhookhistory.UpdatedByLT(*i.UpdatedByLT)) + } + if i.UpdatedByLTE != nil { + predicates = append(predicates, webhookhistory.UpdatedByLTE(*i.UpdatedByLTE)) + } + if i.UpdatedByContains != nil { + predicates = append(predicates, webhookhistory.UpdatedByContains(*i.UpdatedByContains)) + } + if i.UpdatedByHasPrefix != nil { + predicates = append(predicates, webhookhistory.UpdatedByHasPrefix(*i.UpdatedByHasPrefix)) + } + if i.UpdatedByHasSuffix != nil { + predicates = append(predicates, webhookhistory.UpdatedByHasSuffix(*i.UpdatedByHasSuffix)) + } + if i.UpdatedByIsNil { + predicates = append(predicates, webhookhistory.UpdatedByIsNil()) + } + if i.UpdatedByNotNil { + predicates = append(predicates, webhookhistory.UpdatedByNotNil()) + } + if i.UpdatedByEqualFold != nil { + predicates = append(predicates, webhookhistory.UpdatedByEqualFold(*i.UpdatedByEqualFold)) + } + if i.UpdatedByContainsFold != nil { + predicates = append(predicates, webhookhistory.UpdatedByContainsFold(*i.UpdatedByContainsFold)) + } + if i.DeletedAt != nil { + predicates = append(predicates, webhookhistory.DeletedAtEQ(*i.DeletedAt)) + } + if i.DeletedAtNEQ != nil { + predicates = append(predicates, webhookhistory.DeletedAtNEQ(*i.DeletedAtNEQ)) + } + if len(i.DeletedAtIn) > 0 { + predicates = append(predicates, webhookhistory.DeletedAtIn(i.DeletedAtIn...)) + } + if len(i.DeletedAtNotIn) > 0 { + predicates = append(predicates, webhookhistory.DeletedAtNotIn(i.DeletedAtNotIn...)) + } + if i.DeletedAtGT != nil { + predicates = append(predicates, webhookhistory.DeletedAtGT(*i.DeletedAtGT)) + } + if i.DeletedAtGTE != nil { + predicates = append(predicates, webhookhistory.DeletedAtGTE(*i.DeletedAtGTE)) + } + if i.DeletedAtLT != nil { + predicates = append(predicates, webhookhistory.DeletedAtLT(*i.DeletedAtLT)) + } + if i.DeletedAtLTE != nil { + predicates = append(predicates, webhookhistory.DeletedAtLTE(*i.DeletedAtLTE)) + } + if i.DeletedAtIsNil { + predicates = append(predicates, webhookhistory.DeletedAtIsNil()) + } + if i.DeletedAtNotNil { + predicates = append(predicates, webhookhistory.DeletedAtNotNil()) + } + if i.DeletedBy != nil { + predicates = append(predicates, webhookhistory.DeletedByEQ(*i.DeletedBy)) + } + if i.DeletedByNEQ != nil { + predicates = append(predicates, webhookhistory.DeletedByNEQ(*i.DeletedByNEQ)) + } + if len(i.DeletedByIn) > 0 { + predicates = append(predicates, webhookhistory.DeletedByIn(i.DeletedByIn...)) + } + if len(i.DeletedByNotIn) > 0 { + predicates = append(predicates, webhookhistory.DeletedByNotIn(i.DeletedByNotIn...)) + } + if i.DeletedByGT != nil { + predicates = append(predicates, webhookhistory.DeletedByGT(*i.DeletedByGT)) + } + if i.DeletedByGTE != nil { + predicates = append(predicates, webhookhistory.DeletedByGTE(*i.DeletedByGTE)) + } + if i.DeletedByLT != nil { + predicates = append(predicates, webhookhistory.DeletedByLT(*i.DeletedByLT)) + } + if i.DeletedByLTE != nil { + predicates = append(predicates, webhookhistory.DeletedByLTE(*i.DeletedByLTE)) + } + if i.DeletedByContains != nil { + predicates = append(predicates, webhookhistory.DeletedByContains(*i.DeletedByContains)) + } + if i.DeletedByHasPrefix != nil { + predicates = append(predicates, webhookhistory.DeletedByHasPrefix(*i.DeletedByHasPrefix)) + } + if i.DeletedByHasSuffix != nil { + predicates = append(predicates, webhookhistory.DeletedByHasSuffix(*i.DeletedByHasSuffix)) + } + if i.DeletedByIsNil { + predicates = append(predicates, webhookhistory.DeletedByIsNil()) + } + if i.DeletedByNotNil { + predicates = append(predicates, webhookhistory.DeletedByNotNil()) + } + if i.DeletedByEqualFold != nil { + predicates = append(predicates, webhookhistory.DeletedByEqualFold(*i.DeletedByEqualFold)) + } + if i.DeletedByContainsFold != nil { + predicates = append(predicates, webhookhistory.DeletedByContainsFold(*i.DeletedByContainsFold)) + } + if i.OwnerID != nil { + predicates = append(predicates, webhookhistory.OwnerIDEQ(*i.OwnerID)) + } + if i.OwnerIDNEQ != nil { + predicates = append(predicates, webhookhistory.OwnerIDNEQ(*i.OwnerIDNEQ)) + } + if len(i.OwnerIDIn) > 0 { + predicates = append(predicates, webhookhistory.OwnerIDIn(i.OwnerIDIn...)) + } + if len(i.OwnerIDNotIn) > 0 { + predicates = append(predicates, webhookhistory.OwnerIDNotIn(i.OwnerIDNotIn...)) + } + if i.OwnerIDGT != nil { + predicates = append(predicates, webhookhistory.OwnerIDGT(*i.OwnerIDGT)) + } + if i.OwnerIDGTE != nil { + predicates = append(predicates, webhookhistory.OwnerIDGTE(*i.OwnerIDGTE)) + } + if i.OwnerIDLT != nil { + predicates = append(predicates, webhookhistory.OwnerIDLT(*i.OwnerIDLT)) + } + if i.OwnerIDLTE != nil { + predicates = append(predicates, webhookhistory.OwnerIDLTE(*i.OwnerIDLTE)) + } + if i.OwnerIDContains != nil { + predicates = append(predicates, webhookhistory.OwnerIDContains(*i.OwnerIDContains)) + } + if i.OwnerIDHasPrefix != nil { + predicates = append(predicates, webhookhistory.OwnerIDHasPrefix(*i.OwnerIDHasPrefix)) + } + if i.OwnerIDHasSuffix != nil { + predicates = append(predicates, webhookhistory.OwnerIDHasSuffix(*i.OwnerIDHasSuffix)) + } + if i.OwnerIDIsNil { + predicates = append(predicates, webhookhistory.OwnerIDIsNil()) + } + if i.OwnerIDNotNil { + predicates = append(predicates, webhookhistory.OwnerIDNotNil()) + } + if i.OwnerIDEqualFold != nil { + predicates = append(predicates, webhookhistory.OwnerIDEqualFold(*i.OwnerIDEqualFold)) + } + if i.OwnerIDContainsFold != nil { + predicates = append(predicates, webhookhistory.OwnerIDContainsFold(*i.OwnerIDContainsFold)) + } + if i.Name != nil { + predicates = append(predicates, webhookhistory.NameEQ(*i.Name)) + } + if i.NameNEQ != nil { + predicates = append(predicates, webhookhistory.NameNEQ(*i.NameNEQ)) + } + if len(i.NameIn) > 0 { + predicates = append(predicates, webhookhistory.NameIn(i.NameIn...)) + } + if len(i.NameNotIn) > 0 { + predicates = append(predicates, webhookhistory.NameNotIn(i.NameNotIn...)) + } + if i.NameGT != nil { + predicates = append(predicates, webhookhistory.NameGT(*i.NameGT)) + } + if i.NameGTE != nil { + predicates = append(predicates, webhookhistory.NameGTE(*i.NameGTE)) + } + if i.NameLT != nil { + predicates = append(predicates, webhookhistory.NameLT(*i.NameLT)) + } + if i.NameLTE != nil { + predicates = append(predicates, webhookhistory.NameLTE(*i.NameLTE)) + } + if i.NameContains != nil { + predicates = append(predicates, webhookhistory.NameContains(*i.NameContains)) + } + if i.NameHasPrefix != nil { + predicates = append(predicates, webhookhistory.NameHasPrefix(*i.NameHasPrefix)) + } + if i.NameHasSuffix != nil { + predicates = append(predicates, webhookhistory.NameHasSuffix(*i.NameHasSuffix)) + } + if i.NameEqualFold != nil { + predicates = append(predicates, webhookhistory.NameEqualFold(*i.NameEqualFold)) + } + if i.NameContainsFold != nil { + predicates = append(predicates, webhookhistory.NameContainsFold(*i.NameContainsFold)) + } + if i.DestinationURL != nil { + predicates = append(predicates, webhookhistory.DestinationURLEQ(*i.DestinationURL)) + } + if i.DestinationURLNEQ != nil { + predicates = append(predicates, webhookhistory.DestinationURLNEQ(*i.DestinationURLNEQ)) + } + if len(i.DestinationURLIn) > 0 { + predicates = append(predicates, webhookhistory.DestinationURLIn(i.DestinationURLIn...)) + } + if len(i.DestinationURLNotIn) > 0 { + predicates = append(predicates, webhookhistory.DestinationURLNotIn(i.DestinationURLNotIn...)) + } + if i.DestinationURLGT != nil { + predicates = append(predicates, webhookhistory.DestinationURLGT(*i.DestinationURLGT)) + } + if i.DestinationURLGTE != nil { + predicates = append(predicates, webhookhistory.DestinationURLGTE(*i.DestinationURLGTE)) + } + if i.DestinationURLLT != nil { + predicates = append(predicates, webhookhistory.DestinationURLLT(*i.DestinationURLLT)) + } + if i.DestinationURLLTE != nil { + predicates = append(predicates, webhookhistory.DestinationURLLTE(*i.DestinationURLLTE)) + } + if i.DestinationURLContains != nil { + predicates = append(predicates, webhookhistory.DestinationURLContains(*i.DestinationURLContains)) + } + if i.DestinationURLHasPrefix != nil { + predicates = append(predicates, webhookhistory.DestinationURLHasPrefix(*i.DestinationURLHasPrefix)) + } + if i.DestinationURLHasSuffix != nil { + predicates = append(predicates, webhookhistory.DestinationURLHasSuffix(*i.DestinationURLHasSuffix)) + } + if i.DestinationURLEqualFold != nil { + predicates = append(predicates, webhookhistory.DestinationURLEqualFold(*i.DestinationURLEqualFold)) + } + if i.DestinationURLContainsFold != nil { + predicates = append(predicates, webhookhistory.DestinationURLContainsFold(*i.DestinationURLContainsFold)) + } + if i.Enabled != nil { + predicates = append(predicates, webhookhistory.EnabledEQ(*i.Enabled)) + } + if i.EnabledNEQ != nil { + predicates = append(predicates, webhookhistory.EnabledNEQ(*i.EnabledNEQ)) + } + if i.Failures != nil { + predicates = append(predicates, webhookhistory.FailuresEQ(*i.Failures)) + } + if i.FailuresNEQ != nil { + predicates = append(predicates, webhookhistory.FailuresNEQ(*i.FailuresNEQ)) + } + if len(i.FailuresIn) > 0 { + predicates = append(predicates, webhookhistory.FailuresIn(i.FailuresIn...)) + } + if len(i.FailuresNotIn) > 0 { + predicates = append(predicates, webhookhistory.FailuresNotIn(i.FailuresNotIn...)) + } + if i.FailuresGT != nil { + predicates = append(predicates, webhookhistory.FailuresGT(*i.FailuresGT)) + } + if i.FailuresGTE != nil { + predicates = append(predicates, webhookhistory.FailuresGTE(*i.FailuresGTE)) + } + if i.FailuresLT != nil { + predicates = append(predicates, webhookhistory.FailuresLT(*i.FailuresLT)) + } + if i.FailuresLTE != nil { + predicates = append(predicates, webhookhistory.FailuresLTE(*i.FailuresLTE)) + } + if i.FailuresIsNil { + predicates = append(predicates, webhookhistory.FailuresIsNil()) + } + if i.FailuresNotNil { + predicates = append(predicates, webhookhistory.FailuresNotNil()) + } + if i.LastError != nil { + predicates = append(predicates, webhookhistory.LastErrorEQ(*i.LastError)) + } + if i.LastErrorNEQ != nil { + predicates = append(predicates, webhookhistory.LastErrorNEQ(*i.LastErrorNEQ)) + } + if len(i.LastErrorIn) > 0 { + predicates = append(predicates, webhookhistory.LastErrorIn(i.LastErrorIn...)) + } + if len(i.LastErrorNotIn) > 0 { + predicates = append(predicates, webhookhistory.LastErrorNotIn(i.LastErrorNotIn...)) + } + if i.LastErrorGT != nil { + predicates = append(predicates, webhookhistory.LastErrorGT(*i.LastErrorGT)) + } + if i.LastErrorGTE != nil { + predicates = append(predicates, webhookhistory.LastErrorGTE(*i.LastErrorGTE)) + } + if i.LastErrorLT != nil { + predicates = append(predicates, webhookhistory.LastErrorLT(*i.LastErrorLT)) + } + if i.LastErrorLTE != nil { + predicates = append(predicates, webhookhistory.LastErrorLTE(*i.LastErrorLTE)) + } + if i.LastErrorContains != nil { + predicates = append(predicates, webhookhistory.LastErrorContains(*i.LastErrorContains)) + } + if i.LastErrorHasPrefix != nil { + predicates = append(predicates, webhookhistory.LastErrorHasPrefix(*i.LastErrorHasPrefix)) + } + if i.LastErrorHasSuffix != nil { + predicates = append(predicates, webhookhistory.LastErrorHasSuffix(*i.LastErrorHasSuffix)) + } + if i.LastErrorIsNil { + predicates = append(predicates, webhookhistory.LastErrorIsNil()) + } + if i.LastErrorNotNil { + predicates = append(predicates, webhookhistory.LastErrorNotNil()) + } + if i.LastErrorEqualFold != nil { + predicates = append(predicates, webhookhistory.LastErrorEqualFold(*i.LastErrorEqualFold)) + } + if i.LastErrorContainsFold != nil { + predicates = append(predicates, webhookhistory.LastErrorContainsFold(*i.LastErrorContainsFold)) + } + if i.LastResponse != nil { + predicates = append(predicates, webhookhistory.LastResponseEQ(*i.LastResponse)) + } + if i.LastResponseNEQ != nil { + predicates = append(predicates, webhookhistory.LastResponseNEQ(*i.LastResponseNEQ)) + } + if len(i.LastResponseIn) > 0 { + predicates = append(predicates, webhookhistory.LastResponseIn(i.LastResponseIn...)) + } + if len(i.LastResponseNotIn) > 0 { + predicates = append(predicates, webhookhistory.LastResponseNotIn(i.LastResponseNotIn...)) + } + if i.LastResponseGT != nil { + predicates = append(predicates, webhookhistory.LastResponseGT(*i.LastResponseGT)) + } + if i.LastResponseGTE != nil { + predicates = append(predicates, webhookhistory.LastResponseGTE(*i.LastResponseGTE)) + } + if i.LastResponseLT != nil { + predicates = append(predicates, webhookhistory.LastResponseLT(*i.LastResponseLT)) + } + if i.LastResponseLTE != nil { + predicates = append(predicates, webhookhistory.LastResponseLTE(*i.LastResponseLTE)) + } + if i.LastResponseContains != nil { + predicates = append(predicates, webhookhistory.LastResponseContains(*i.LastResponseContains)) + } + if i.LastResponseHasPrefix != nil { + predicates = append(predicates, webhookhistory.LastResponseHasPrefix(*i.LastResponseHasPrefix)) + } + if i.LastResponseHasSuffix != nil { + predicates = append(predicates, webhookhistory.LastResponseHasSuffix(*i.LastResponseHasSuffix)) + } + if i.LastResponseIsNil { + predicates = append(predicates, webhookhistory.LastResponseIsNil()) + } + if i.LastResponseNotNil { + predicates = append(predicates, webhookhistory.LastResponseNotNil()) + } + if i.LastResponseEqualFold != nil { + predicates = append(predicates, webhookhistory.LastResponseEqualFold(*i.LastResponseEqualFold)) + } + if i.LastResponseContainsFold != nil { + predicates = append(predicates, webhookhistory.LastResponseContainsFold(*i.LastResponseContainsFold)) + } + + switch len(predicates) { + case 0: + return nil, ErrEmptyWebhookHistoryWhereInput + case 1: + return predicates[0], nil + default: + return webhookhistory.And(predicates...), nil + } +} diff --git a/internal/ent/generated/group.go b/internal/ent/generated/group.go new file mode 100644 index 0000000..f2ecd2b --- /dev/null +++ b/internal/ent/generated/group.go @@ -0,0 +1,508 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// Group is the model entity for the Group schema. +type Group struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name,omitempty"` + // the groups description + Description string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL string `json:"gravatar_logo_url,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL string `json:"logo_url,omitempty"` + // The group's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the GroupQuery when eager-loading is set. + Edges GroupEdges `json:"edges"` + selectValues sql.SelectValues +} + +// GroupEdges holds the relations/edges for other nodes in the graph. +type GroupEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Setting holds the value of the setting edge. + Setting *GroupSetting `json:"setting,omitempty"` + // Users holds the value of the users edge. + Users []*User `json:"users,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // Integrations holds the value of the integrations edge. + Integrations []*Integration `json:"integrations,omitempty"` + // Files holds the value of the files edge. + Files []*File `json:"files,omitempty"` + // Members holds the value of the members edge. + Members []*GroupMembership `json:"members,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [7]bool + // totalCount holds the count of the edges above. + totalCount [7]map[string]int + + namedUsers map[string][]*User + namedEvents map[string][]*Event + namedIntegrations map[string][]*Integration + namedFiles map[string][]*File + namedMembers map[string][]*GroupMembership +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e GroupEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// SettingOrErr returns the Setting value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e GroupEdges) SettingOrErr() (*GroupSetting, error) { + if e.Setting != nil { + return e.Setting, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: groupsetting.Label} + } + return nil, &NotLoadedError{edge: "setting"} +} + +// UsersOrErr returns the Users value or an error if the edge +// was not loaded in eager-loading. +func (e GroupEdges) UsersOrErr() ([]*User, error) { + if e.loadedTypes[2] { + return e.Users, nil + } + return nil, &NotLoadedError{edge: "users"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e GroupEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[3] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// IntegrationsOrErr returns the Integrations value or an error if the edge +// was not loaded in eager-loading. +func (e GroupEdges) IntegrationsOrErr() ([]*Integration, error) { + if e.loadedTypes[4] { + return e.Integrations, nil + } + return nil, &NotLoadedError{edge: "integrations"} +} + +// FilesOrErr returns the Files value or an error if the edge +// was not loaded in eager-loading. +func (e GroupEdges) FilesOrErr() ([]*File, error) { + if e.loadedTypes[5] { + return e.Files, nil + } + return nil, &NotLoadedError{edge: "files"} +} + +// MembersOrErr returns the Members value or an error if the edge +// was not loaded in eager-loading. +func (e GroupEdges) MembersOrErr() ([]*GroupMembership, error) { + if e.loadedTypes[6] { + return e.Members, nil + } + return nil, &NotLoadedError{edge: "members"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Group) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case group.FieldTags: + values[i] = new([]byte) + case group.FieldID, group.FieldCreatedBy, group.FieldUpdatedBy, group.FieldDeletedBy, group.FieldMappingID, group.FieldOwnerID, group.FieldName, group.FieldDescription, group.FieldGravatarLogoURL, group.FieldLogoURL, group.FieldDisplayName: + values[i] = new(sql.NullString) + case group.FieldCreatedAt, group.FieldUpdatedAt, group.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Group fields. +func (gr *Group) 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 group.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + gr.ID = value.String + } + case group.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + gr.CreatedAt = value.Time + } + case group.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + gr.UpdatedAt = value.Time + } + case group.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + gr.CreatedBy = value.String + } + case group.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + gr.UpdatedBy = value.String + } + case group.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + gr.DeletedAt = value.Time + } + case group.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + gr.DeletedBy = value.String + } + case group.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + gr.MappingID = value.String + } + case group.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &gr.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case group.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + gr.OwnerID = value.String + } + case group.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + gr.Name = value.String + } + case group.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + gr.Description = value.String + } + case group.FieldGravatarLogoURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field gravatar_logo_url", values[i]) + } else if value.Valid { + gr.GravatarLogoURL = value.String + } + case group.FieldLogoURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field logo_url", values[i]) + } else if value.Valid { + gr.LogoURL = value.String + } + case group.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + gr.DisplayName = value.String + } + default: + gr.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Group. +// This includes values selected through modifiers, order, etc. +func (gr *Group) Value(name string) (ent.Value, error) { + return gr.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Group entity. +func (gr *Group) QueryOwner() *OrganizationQuery { + return NewGroupClient(gr.config).QueryOwner(gr) +} + +// QuerySetting queries the "setting" edge of the Group entity. +func (gr *Group) QuerySetting() *GroupSettingQuery { + return NewGroupClient(gr.config).QuerySetting(gr) +} + +// QueryUsers queries the "users" edge of the Group entity. +func (gr *Group) QueryUsers() *UserQuery { + return NewGroupClient(gr.config).QueryUsers(gr) +} + +// QueryEvents queries the "events" edge of the Group entity. +func (gr *Group) QueryEvents() *EventQuery { + return NewGroupClient(gr.config).QueryEvents(gr) +} + +// QueryIntegrations queries the "integrations" edge of the Group entity. +func (gr *Group) QueryIntegrations() *IntegrationQuery { + return NewGroupClient(gr.config).QueryIntegrations(gr) +} + +// QueryFiles queries the "files" edge of the Group entity. +func (gr *Group) QueryFiles() *FileQuery { + return NewGroupClient(gr.config).QueryFiles(gr) +} + +// QueryMembers queries the "members" edge of the Group entity. +func (gr *Group) QueryMembers() *GroupMembershipQuery { + return NewGroupClient(gr.config).QueryMembers(gr) +} + +// Update returns a builder for updating this Group. +// Note that you need to call Group.Unwrap() before calling this method if this Group +// was returned from a transaction, and the transaction was committed or rolled back. +func (gr *Group) Update() *GroupUpdateOne { + return NewGroupClient(gr.config).UpdateOne(gr) +} + +// Unwrap unwraps the Group 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 (gr *Group) Unwrap() *Group { + _tx, ok := gr.config.driver.(*txDriver) + if !ok { + panic("generated: Group is not a transactional entity") + } + gr.config.driver = _tx.drv + return gr +} + +// String implements the fmt.Stringer. +func (gr *Group) String() string { + var builder strings.Builder + builder.WriteString("Group(") + builder.WriteString(fmt.Sprintf("id=%v, ", gr.ID)) + builder.WriteString("created_at=") + builder.WriteString(gr.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(gr.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(gr.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(gr.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(gr.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(gr.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(gr.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", gr.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(gr.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(gr.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(gr.Description) + builder.WriteString(", ") + builder.WriteString("gravatar_logo_url=") + builder.WriteString(gr.GravatarLogoURL) + builder.WriteString(", ") + builder.WriteString("logo_url=") + builder.WriteString(gr.LogoURL) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(gr.DisplayName) + builder.WriteByte(')') + return builder.String() +} + +// NamedUsers returns the Users named value or an error if the edge was not +// loaded in eager-loading with this name. +func (gr *Group) NamedUsers(name string) ([]*User, error) { + if gr.Edges.namedUsers == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := gr.Edges.namedUsers[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (gr *Group) appendNamedUsers(name string, edges ...*User) { + if gr.Edges.namedUsers == nil { + gr.Edges.namedUsers = make(map[string][]*User) + } + if len(edges) == 0 { + gr.Edges.namedUsers[name] = []*User{} + } else { + gr.Edges.namedUsers[name] = append(gr.Edges.namedUsers[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (gr *Group) NamedEvents(name string) ([]*Event, error) { + if gr.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := gr.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (gr *Group) appendNamedEvents(name string, edges ...*Event) { + if gr.Edges.namedEvents == nil { + gr.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + gr.Edges.namedEvents[name] = []*Event{} + } else { + gr.Edges.namedEvents[name] = append(gr.Edges.namedEvents[name], edges...) + } +} + +// NamedIntegrations returns the Integrations named value or an error if the edge was not +// loaded in eager-loading with this name. +func (gr *Group) NamedIntegrations(name string) ([]*Integration, error) { + if gr.Edges.namedIntegrations == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := gr.Edges.namedIntegrations[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (gr *Group) appendNamedIntegrations(name string, edges ...*Integration) { + if gr.Edges.namedIntegrations == nil { + gr.Edges.namedIntegrations = make(map[string][]*Integration) + } + if len(edges) == 0 { + gr.Edges.namedIntegrations[name] = []*Integration{} + } else { + gr.Edges.namedIntegrations[name] = append(gr.Edges.namedIntegrations[name], edges...) + } +} + +// NamedFiles returns the Files named value or an error if the edge was not +// loaded in eager-loading with this name. +func (gr *Group) NamedFiles(name string) ([]*File, error) { + if gr.Edges.namedFiles == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := gr.Edges.namedFiles[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (gr *Group) appendNamedFiles(name string, edges ...*File) { + if gr.Edges.namedFiles == nil { + gr.Edges.namedFiles = make(map[string][]*File) + } + if len(edges) == 0 { + gr.Edges.namedFiles[name] = []*File{} + } else { + gr.Edges.namedFiles[name] = append(gr.Edges.namedFiles[name], edges...) + } +} + +// NamedMembers returns the Members named value or an error if the edge was not +// loaded in eager-loading with this name. +func (gr *Group) NamedMembers(name string) ([]*GroupMembership, error) { + if gr.Edges.namedMembers == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := gr.Edges.namedMembers[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (gr *Group) appendNamedMembers(name string, edges ...*GroupMembership) { + if gr.Edges.namedMembers == nil { + gr.Edges.namedMembers = make(map[string][]*GroupMembership) + } + if len(edges) == 0 { + gr.Edges.namedMembers[name] = []*GroupMembership{} + } else { + gr.Edges.namedMembers[name] = append(gr.Edges.namedMembers[name], edges...) + } +} + +// Groups is a parsable slice of Group. +type Groups []*Group diff --git a/internal/ent/generated/group/group.go b/internal/ent/generated/group/group.go new file mode 100644 index 0000000..860d5c4 --- /dev/null +++ b/internal/ent/generated/group/group.go @@ -0,0 +1,383 @@ +// Code generated by ent, DO NOT EDIT. + +package group + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the group type in the database. + Label = "group" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldGravatarLogoURL holds the string denoting the gravatar_logo_url field in the database. + FieldGravatarLogoURL = "gravatar_logo_url" + // FieldLogoURL holds the string denoting the logo_url field in the database. + FieldLogoURL = "logo_url" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeSetting holds the string denoting the setting edge name in mutations. + EdgeSetting = "setting" + // EdgeUsers holds the string denoting the users edge name in mutations. + EdgeUsers = "users" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // EdgeIntegrations holds the string denoting the integrations edge name in mutations. + EdgeIntegrations = "integrations" + // EdgeFiles holds the string denoting the files edge name in mutations. + EdgeFiles = "files" + // EdgeMembers holds the string denoting the members edge name in mutations. + EdgeMembers = "members" + // Table holds the table name of the group in the database. + Table = "groups" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "groups" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // SettingTable is the table that holds the setting relation/edge. + SettingTable = "group_settings" + // SettingInverseTable is the table name for the GroupSetting entity. + // It exists in this package in order to avoid circular dependency with the "groupsetting" package. + SettingInverseTable = "group_settings" + // SettingColumn is the table column denoting the setting relation/edge. + SettingColumn = "group_id" + // UsersTable is the table that holds the users relation/edge. The primary key declared below. + UsersTable = "group_memberships" + // UsersInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + UsersInverseTable = "users" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "group_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" + // IntegrationsTable is the table that holds the integrations relation/edge. + IntegrationsTable = "integrations" + // IntegrationsInverseTable is the table name for the Integration entity. + // It exists in this package in order to avoid circular dependency with the "integration" package. + IntegrationsInverseTable = "integrations" + // IntegrationsColumn is the table column denoting the integrations relation/edge. + IntegrationsColumn = "group_integrations" + // FilesTable is the table that holds the files relation/edge. The primary key declared below. + FilesTable = "group_files" + // FilesInverseTable is the table name for the File entity. + // It exists in this package in order to avoid circular dependency with the "file" package. + FilesInverseTable = "files" + // MembersTable is the table that holds the members relation/edge. + MembersTable = "group_memberships" + // MembersInverseTable is the table name for the GroupMembership entity. + // It exists in this package in order to avoid circular dependency with the "groupmembership" package. + MembersInverseTable = "group_memberships" + // MembersColumn is the table column denoting the members relation/edge. + MembersColumn = "group_id" +) + +// Columns holds all SQL columns for group fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldDescription, + FieldGravatarLogoURL, + FieldLogoURL, + FieldDisplayName, +} + +var ( + // UsersPrimaryKey and UsersColumn2 are the table columns denoting the + // primary key for the users relation (M2M). + UsersPrimaryKey = []string{"user_id", "group_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"group_id", "event_id"} + // FilesPrimaryKey and FilesColumn2 are the table columns denoting the + // primary key for the files relation (M2M). + FilesPrimaryKey = []string{"group_id", "file_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [6]ent.Hook + Interceptors [3]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultDisplayName holds the default value on creation for the "display_name" field. + DefaultDisplayName string + // DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + DisplayNameValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Group queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByGravatarLogoURL orders the results by the gravatar_logo_url field. +func ByGravatarLogoURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGravatarLogoURL, opts...).ToFunc() +} + +// ByLogoURL orders the results by the logo_url field. +func ByLogoURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLogoURL, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// BySettingField orders the results by setting field. +func BySettingField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newSettingStep(), sql.OrderByField(field, opts...)) + } +} + +// ByUsersCount orders the results by users count. +func ByUsersCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newUsersStep(), opts...) + } +} + +// ByUsers orders the results by users terms. +func ByUsers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newUsersStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByIntegrationsCount orders the results by integrations count. +func ByIntegrationsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newIntegrationsStep(), opts...) + } +} + +// ByIntegrations orders the results by integrations terms. +func ByIntegrations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newIntegrationsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFilesCount orders the results by files count. +func ByFilesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFilesStep(), opts...) + } +} + +// ByFiles orders the results by files terms. +func ByFiles(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFilesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByMembersCount orders the results by members count. +func ByMembersCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newMembersStep(), opts...) + } +} + +// ByMembers orders the results by members terms. +func ByMembers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newMembersStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newSettingStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(SettingInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, SettingTable, SettingColumn), + ) +} +func newUsersStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(UsersInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, UsersTable, UsersPrimaryKey...), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} +func newIntegrationsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(IntegrationsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, IntegrationsTable, IntegrationsColumn), + ) +} +func newFilesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FilesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, FilesTable, FilesPrimaryKey...), + ) +} +func newMembersStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(MembersInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, MembersTable, MembersColumn), + ) +} diff --git a/internal/ent/generated/group/where.go b/internal/ent/generated/group/where.go new file mode 100644 index 0000000..f6c2a0e --- /dev/null +++ b/internal/ent/generated/group/where.go @@ -0,0 +1,1231 @@ +// Code generated by ent, DO NOT EDIT. + +package group + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDescription, v)) +} + +// GravatarLogoURL applies equality check predicate on the "gravatar_logo_url" field. It's identical to GravatarLogoURLEQ. +func GravatarLogoURL(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldGravatarLogoURL, v)) +} + +// LogoURL applies equality check predicate on the "logo_url" field. It's identical to LogoURLEQ. +func LogoURL(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldLogoURL, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDisplayName, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Group { + return predicate.Group(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Group { + return predicate.Group(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Group { + return predicate.Group(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Group { + return predicate.Group(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Group { + return predicate.Group(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Group { + return predicate.Group(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Group { + return predicate.Group(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Group { + return predicate.Group(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Group { + return predicate.Group(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldDescription, v)) +} + +// GravatarLogoURLEQ applies the EQ predicate on the "gravatar_logo_url" field. +func GravatarLogoURLEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLNEQ applies the NEQ predicate on the "gravatar_logo_url" field. +func GravatarLogoURLNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLIn applies the In predicate on the "gravatar_logo_url" field. +func GravatarLogoURLIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldGravatarLogoURL, vs...)) +} + +// GravatarLogoURLNotIn applies the NotIn predicate on the "gravatar_logo_url" field. +func GravatarLogoURLNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldGravatarLogoURL, vs...)) +} + +// GravatarLogoURLGT applies the GT predicate on the "gravatar_logo_url" field. +func GravatarLogoURLGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLGTE applies the GTE predicate on the "gravatar_logo_url" field. +func GravatarLogoURLGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLLT applies the LT predicate on the "gravatar_logo_url" field. +func GravatarLogoURLLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLLTE applies the LTE predicate on the "gravatar_logo_url" field. +func GravatarLogoURLLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLContains applies the Contains predicate on the "gravatar_logo_url" field. +func GravatarLogoURLContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLHasPrefix applies the HasPrefix predicate on the "gravatar_logo_url" field. +func GravatarLogoURLHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLHasSuffix applies the HasSuffix predicate on the "gravatar_logo_url" field. +func GravatarLogoURLHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLIsNil applies the IsNil predicate on the "gravatar_logo_url" field. +func GravatarLogoURLIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldGravatarLogoURL)) +} + +// GravatarLogoURLNotNil applies the NotNil predicate on the "gravatar_logo_url" field. +func GravatarLogoURLNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldGravatarLogoURL)) +} + +// GravatarLogoURLEqualFold applies the EqualFold predicate on the "gravatar_logo_url" field. +func GravatarLogoURLEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLContainsFold applies the ContainsFold predicate on the "gravatar_logo_url" field. +func GravatarLogoURLContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldGravatarLogoURL, v)) +} + +// LogoURLEQ applies the EQ predicate on the "logo_url" field. +func LogoURLEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldLogoURL, v)) +} + +// LogoURLNEQ applies the NEQ predicate on the "logo_url" field. +func LogoURLNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldLogoURL, v)) +} + +// LogoURLIn applies the In predicate on the "logo_url" field. +func LogoURLIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldLogoURL, vs...)) +} + +// LogoURLNotIn applies the NotIn predicate on the "logo_url" field. +func LogoURLNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldLogoURL, vs...)) +} + +// LogoURLGT applies the GT predicate on the "logo_url" field. +func LogoURLGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldLogoURL, v)) +} + +// LogoURLGTE applies the GTE predicate on the "logo_url" field. +func LogoURLGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldLogoURL, v)) +} + +// LogoURLLT applies the LT predicate on the "logo_url" field. +func LogoURLLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldLogoURL, v)) +} + +// LogoURLLTE applies the LTE predicate on the "logo_url" field. +func LogoURLLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldLogoURL, v)) +} + +// LogoURLContains applies the Contains predicate on the "logo_url" field. +func LogoURLContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldLogoURL, v)) +} + +// LogoURLHasPrefix applies the HasPrefix predicate on the "logo_url" field. +func LogoURLHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldLogoURL, v)) +} + +// LogoURLHasSuffix applies the HasSuffix predicate on the "logo_url" field. +func LogoURLHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldLogoURL, v)) +} + +// LogoURLIsNil applies the IsNil predicate on the "logo_url" field. +func LogoURLIsNil() predicate.Group { + return predicate.Group(sql.FieldIsNull(FieldLogoURL)) +} + +// LogoURLNotNil applies the NotNil predicate on the "logo_url" field. +func LogoURLNotNil() predicate.Group { + return predicate.Group(sql.FieldNotNull(FieldLogoURL)) +} + +// LogoURLEqualFold applies the EqualFold predicate on the "logo_url" field. +func LogoURLEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldLogoURL, v)) +} + +// LogoURLContainsFold applies the ContainsFold predicate on the "logo_url" field. +func LogoURLContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldLogoURL, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.Group { + return predicate.Group(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.Group { + return predicate.Group(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.Group { + return predicate.Group(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.Group { + return predicate.Group(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.Group { + return predicate.Group(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.Group { + return predicate.Group(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.Group { + return predicate.Group(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.Group { + return predicate.Group(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.Group { + return predicate.Group(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.Group { + return predicate.Group(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.Group { + return predicate.Group(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.Group { + return predicate.Group(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Group + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Group + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasSetting applies the HasEdge predicate on the "setting" edge. +func HasSetting() predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, SettingTable, SettingColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupSetting + step.Edge.Schema = schemaConfig.GroupSetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasSettingWith applies the HasEdge predicate on the "setting" edge with a given conditions (other predicates). +func HasSettingWith(preds ...predicate.GroupSetting) predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := newSettingStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupSetting + step.Edge.Schema = schemaConfig.GroupSetting + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasUsers applies the HasEdge predicate on the "users" edge. +func HasUsers() predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, UsersTable, UsersPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). +func HasUsersWith(preds ...predicate.User) predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := newUsersStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasIntegrations applies the HasEdge predicate on the "integrations" edge. +func HasIntegrations() predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, IntegrationsTable, IntegrationsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasIntegrationsWith applies the HasEdge predicate on the "integrations" edge with a given conditions (other predicates). +func HasIntegrationsWith(preds ...predicate.Integration) predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := newIntegrationsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFiles applies the HasEdge predicate on the "files" edge. +func HasFiles() predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, FilesTable, FilesPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.GroupFiles + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). +func HasFilesWith(preds ...predicate.File) predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := newFilesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.GroupFiles + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasMembers applies the HasEdge predicate on the "members" edge. +func HasMembers() predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, MembersTable, MembersColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasMembersWith applies the HasEdge predicate on the "members" edge with a given conditions (other predicates). +func HasMembersWith(preds ...predicate.GroupMembership) predicate.Group { + return predicate.Group(func(s *sql.Selector) { + step := newMembersStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + 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.Group) predicate.Group { + return predicate.Group(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Group) predicate.Group { + return predicate.Group(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Group) predicate.Group { + return predicate.Group(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/group_create.go b/internal/ent/generated/group_create.go new file mode 100644 index 0000000..72338b0 --- /dev/null +++ b/internal/ent/generated/group_create.go @@ -0,0 +1,720 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// GroupCreate is the builder for creating a Group entity. +type GroupCreate struct { + config + mutation *GroupMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (gc *GroupCreate) SetCreatedAt(t time.Time) *GroupCreate { + gc.mutation.SetCreatedAt(t) + return gc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate { + if t != nil { + gc.SetCreatedAt(*t) + } + return gc +} + +// SetUpdatedAt sets the "updated_at" field. +func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate { + gc.mutation.SetUpdatedAt(t) + return gc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate { + if t != nil { + gc.SetUpdatedAt(*t) + } + return gc +} + +// SetCreatedBy sets the "created_by" field. +func (gc *GroupCreate) SetCreatedBy(s string) *GroupCreate { + gc.mutation.SetCreatedBy(s) + return gc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (gc *GroupCreate) SetNillableCreatedBy(s *string) *GroupCreate { + if s != nil { + gc.SetCreatedBy(*s) + } + return gc +} + +// SetUpdatedBy sets the "updated_by" field. +func (gc *GroupCreate) SetUpdatedBy(s string) *GroupCreate { + gc.mutation.SetUpdatedBy(s) + return gc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gc *GroupCreate) SetNillableUpdatedBy(s *string) *GroupCreate { + if s != nil { + gc.SetUpdatedBy(*s) + } + return gc +} + +// SetDeletedAt sets the "deleted_at" field. +func (gc *GroupCreate) SetDeletedAt(t time.Time) *GroupCreate { + gc.mutation.SetDeletedAt(t) + return gc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gc *GroupCreate) SetNillableDeletedAt(t *time.Time) *GroupCreate { + if t != nil { + gc.SetDeletedAt(*t) + } + return gc +} + +// SetDeletedBy sets the "deleted_by" field. +func (gc *GroupCreate) SetDeletedBy(s string) *GroupCreate { + gc.mutation.SetDeletedBy(s) + return gc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gc *GroupCreate) SetNillableDeletedBy(s *string) *GroupCreate { + if s != nil { + gc.SetDeletedBy(*s) + } + return gc +} + +// SetMappingID sets the "mapping_id" field. +func (gc *GroupCreate) SetMappingID(s string) *GroupCreate { + gc.mutation.SetMappingID(s) + return gc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (gc *GroupCreate) SetNillableMappingID(s *string) *GroupCreate { + if s != nil { + gc.SetMappingID(*s) + } + return gc +} + +// SetTags sets the "tags" field. +func (gc *GroupCreate) SetTags(s []string) *GroupCreate { + gc.mutation.SetTags(s) + return gc +} + +// SetOwnerID sets the "owner_id" field. +func (gc *GroupCreate) SetOwnerID(s string) *GroupCreate { + gc.mutation.SetOwnerID(s) + return gc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (gc *GroupCreate) SetNillableOwnerID(s *string) *GroupCreate { + if s != nil { + gc.SetOwnerID(*s) + } + return gc +} + +// SetName sets the "name" field. +func (gc *GroupCreate) SetName(s string) *GroupCreate { + gc.mutation.SetName(s) + return gc +} + +// SetDescription sets the "description" field. +func (gc *GroupCreate) SetDescription(s string) *GroupCreate { + gc.mutation.SetDescription(s) + return gc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (gc *GroupCreate) SetNillableDescription(s *string) *GroupCreate { + if s != nil { + gc.SetDescription(*s) + } + return gc +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (gc *GroupCreate) SetGravatarLogoURL(s string) *GroupCreate { + gc.mutation.SetGravatarLogoURL(s) + return gc +} + +// SetNillableGravatarLogoURL sets the "gravatar_logo_url" field if the given value is not nil. +func (gc *GroupCreate) SetNillableGravatarLogoURL(s *string) *GroupCreate { + if s != nil { + gc.SetGravatarLogoURL(*s) + } + return gc +} + +// SetLogoURL sets the "logo_url" field. +func (gc *GroupCreate) SetLogoURL(s string) *GroupCreate { + gc.mutation.SetLogoURL(s) + return gc +} + +// SetNillableLogoURL sets the "logo_url" field if the given value is not nil. +func (gc *GroupCreate) SetNillableLogoURL(s *string) *GroupCreate { + if s != nil { + gc.SetLogoURL(*s) + } + return gc +} + +// SetDisplayName sets the "display_name" field. +func (gc *GroupCreate) SetDisplayName(s string) *GroupCreate { + gc.mutation.SetDisplayName(s) + return gc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (gc *GroupCreate) SetNillableDisplayName(s *string) *GroupCreate { + if s != nil { + gc.SetDisplayName(*s) + } + return gc +} + +// SetID sets the "id" field. +func (gc *GroupCreate) SetID(s string) *GroupCreate { + gc.mutation.SetID(s) + return gc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (gc *GroupCreate) SetNillableID(s *string) *GroupCreate { + if s != nil { + gc.SetID(*s) + } + return gc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (gc *GroupCreate) SetOwner(o *Organization) *GroupCreate { + return gc.SetOwnerID(o.ID) +} + +// SetSettingID sets the "setting" edge to the GroupSetting entity by ID. +func (gc *GroupCreate) SetSettingID(id string) *GroupCreate { + gc.mutation.SetSettingID(id) + return gc +} + +// SetSetting sets the "setting" edge to the GroupSetting entity. +func (gc *GroupCreate) SetSetting(g *GroupSetting) *GroupCreate { + return gc.SetSettingID(g.ID) +} + +// AddUserIDs adds the "users" edge to the User entity by IDs. +func (gc *GroupCreate) AddUserIDs(ids ...string) *GroupCreate { + gc.mutation.AddUserIDs(ids...) + return gc +} + +// AddUsers adds the "users" edges to the User entity. +func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return gc.AddUserIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (gc *GroupCreate) AddEventIDs(ids ...string) *GroupCreate { + gc.mutation.AddEventIDs(ids...) + return gc +} + +// AddEvents adds the "events" edges to the Event entity. +func (gc *GroupCreate) AddEvents(e ...*Event) *GroupCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gc.AddEventIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (gc *GroupCreate) AddIntegrationIDs(ids ...string) *GroupCreate { + gc.mutation.AddIntegrationIDs(ids...) + return gc +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (gc *GroupCreate) AddIntegrations(i ...*Integration) *GroupCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return gc.AddIntegrationIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (gc *GroupCreate) AddFileIDs(ids ...string) *GroupCreate { + gc.mutation.AddFileIDs(ids...) + return gc +} + +// AddFiles adds the "files" edges to the File entity. +func (gc *GroupCreate) AddFiles(f ...*File) *GroupCreate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return gc.AddFileIDs(ids...) +} + +// AddMemberIDs adds the "members" edge to the GroupMembership entity by IDs. +func (gc *GroupCreate) AddMemberIDs(ids ...string) *GroupCreate { + gc.mutation.AddMemberIDs(ids...) + return gc +} + +// AddMembers adds the "members" edges to the GroupMembership entity. +func (gc *GroupCreate) AddMembers(g ...*GroupMembership) *GroupCreate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return gc.AddMemberIDs(ids...) +} + +// Mutation returns the GroupMutation object of the builder. +func (gc *GroupCreate) Mutation() *GroupMutation { + return gc.mutation +} + +// Save creates the Group in the database. +func (gc *GroupCreate) Save(ctx context.Context) (*Group, error) { + if err := gc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gc.sqlSave, gc.mutation, gc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (gc *GroupCreate) SaveX(ctx context.Context) *Group { + v, err := gc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gc *GroupCreate) Exec(ctx context.Context) error { + _, err := gc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gc *GroupCreate) ExecX(ctx context.Context) { + if err := gc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gc *GroupCreate) defaults() error { + if _, ok := gc.mutation.CreatedAt(); !ok { + if group.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized group.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := group.DefaultCreatedAt() + gc.mutation.SetCreatedAt(v) + } + if _, ok := gc.mutation.UpdatedAt(); !ok { + if group.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized group.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := group.DefaultUpdatedAt() + gc.mutation.SetUpdatedAt(v) + } + if _, ok := gc.mutation.MappingID(); !ok { + if group.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized group.DefaultMappingID (forgotten import generated/runtime?)") + } + v := group.DefaultMappingID() + gc.mutation.SetMappingID(v) + } + if _, ok := gc.mutation.Tags(); !ok { + v := group.DefaultTags + gc.mutation.SetTags(v) + } + if _, ok := gc.mutation.DisplayName(); !ok { + v := group.DefaultDisplayName + gc.mutation.SetDisplayName(v) + } + if _, ok := gc.mutation.ID(); !ok { + if group.DefaultID == nil { + return fmt.Errorf("generated: uninitialized group.DefaultID (forgotten import generated/runtime?)") + } + v := group.DefaultID() + gc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gc *GroupCreate) check() error { + if _, ok := gc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Group.mapping_id"`)} + } + if v, ok := gc.mutation.OwnerID(); ok { + if err := group.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Group.owner_id": %w`, err)} + } + } + if _, ok := gc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "Group.name"`)} + } + if v, ok := gc.mutation.Name(); ok { + if err := group.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Group.name": %w`, err)} + } + } + if _, ok := gc.mutation.DisplayName(); !ok { + return &ValidationError{Name: "display_name", err: errors.New(`generated: missing required field "Group.display_name"`)} + } + if v, ok := gc.mutation.DisplayName(); ok { + if err := group.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Group.display_name": %w`, err)} + } + } + if len(gc.mutation.SettingIDs()) == 0 { + return &ValidationError{Name: "setting", err: errors.New(`generated: missing required edge "Group.setting"`)} + } + return nil +} + +func (gc *GroupCreate) sqlSave(ctx context.Context) (*Group, error) { + if err := gc.check(); err != nil { + return nil, err + } + _node, _spec := gc.createSpec() + if err := sqlgraph.CreateNode(ctx, gc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Group.ID type: %T", _spec.ID.Value) + } + } + gc.mutation.id = &_node.ID + gc.mutation.done = true + return _node, nil +} + +func (gc *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) { + var ( + _node = &Group{config: gc.config} + _spec = sqlgraph.NewCreateSpec(group.Table, sqlgraph.NewFieldSpec(group.FieldID, field.TypeString)) + ) + _spec.Schema = gc.schemaConfig.Group + if id, ok := gc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := gc.mutation.CreatedAt(); ok { + _spec.SetField(group.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := gc.mutation.UpdatedAt(); ok { + _spec.SetField(group.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := gc.mutation.CreatedBy(); ok { + _spec.SetField(group.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := gc.mutation.UpdatedBy(); ok { + _spec.SetField(group.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := gc.mutation.DeletedAt(); ok { + _spec.SetField(group.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := gc.mutation.DeletedBy(); ok { + _spec.SetField(group.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := gc.mutation.MappingID(); ok { + _spec.SetField(group.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := gc.mutation.Tags(); ok { + _spec.SetField(group.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := gc.mutation.Name(); ok { + _spec.SetField(group.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := gc.mutation.Description(); ok { + _spec.SetField(group.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := gc.mutation.GravatarLogoURL(); ok { + _spec.SetField(group.FieldGravatarLogoURL, field.TypeString, value) + _node.GravatarLogoURL = value + } + if value, ok := gc.mutation.LogoURL(); ok { + _spec.SetField(group.FieldLogoURL, field.TypeString, value) + _node.LogoURL = value + } + if value, ok := gc.mutation.DisplayName(); ok { + _spec.SetField(group.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if nodes := gc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: group.OwnerTable, + Columns: []string{group.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = gc.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gc.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: group.SettingTable, + Columns: []string{group.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString), + }, + } + edge.Schema = gc.schemaConfig.GroupSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gc.mutation.UsersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = gc.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: gc.config, mutation: newGroupMembershipMutation(gc.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gc.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gc.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = gc.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gc.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = gc.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gc.mutation.MembersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = gc.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// GroupCreateBulk is the builder for creating many Group entities in bulk. +type GroupCreateBulk struct { + config + err error + builders []*GroupCreate +} + +// Save creates the Group entities in the database. +func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) { + if gcb.err != nil { + return nil, gcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(gcb.builders)) + nodes := make([]*Group, len(gcb.builders)) + mutators := make([]Mutator, len(gcb.builders)) + for i := range gcb.builders { + func(i int, root context.Context) { + builder := gcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*GroupMutation) + 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, gcb.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, gcb.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, gcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group { + v, err := gcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gcb *GroupCreateBulk) Exec(ctx context.Context) error { + _, err := gcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gcb *GroupCreateBulk) ExecX(ctx context.Context) { + if err := gcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/group_delete.go b/internal/ent/generated/group_delete.go new file mode 100644 index 0000000..79a1738 --- /dev/null +++ b/internal/ent/generated/group_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupDelete is the builder for deleting a Group entity. +type GroupDelete struct { + config + hooks []Hook + mutation *GroupMutation +} + +// Where appends a list predicates to the GroupDelete builder. +func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete { + gd.mutation.Where(ps...) + return gd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (gd *GroupDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, gd.sqlExec, gd.mutation, gd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (gd *GroupDelete) ExecX(ctx context.Context) int { + n, err := gd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (gd *GroupDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(group.Table, sqlgraph.NewFieldSpec(group.FieldID, field.TypeString)) + _spec.Node.Schema = gd.schemaConfig.Group + ctx = internal.NewSchemaConfigContext(ctx, gd.schemaConfig) + if ps := gd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, gd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + gd.mutation.done = true + return affected, err +} + +// GroupDeleteOne is the builder for deleting a single Group entity. +type GroupDeleteOne struct { + gd *GroupDelete +} + +// Where appends a list predicates to the GroupDelete builder. +func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne { + gdo.gd.mutation.Where(ps...) + return gdo +} + +// Exec executes the deletion query. +func (gdo *GroupDeleteOne) Exec(ctx context.Context) error { + n, err := gdo.gd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{group.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (gdo *GroupDeleteOne) ExecX(ctx context.Context) { + if err := gdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/group_query.go b/internal/ent/generated/group_query.go new file mode 100644 index 0000000..2889257 --- /dev/null +++ b/internal/ent/generated/group_query.go @@ -0,0 +1,1304 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupQuery is the builder for querying Group entities. +type GroupQuery struct { + config + ctx *QueryContext + order []group.OrderOption + inters []Interceptor + predicates []predicate.Group + withOwner *OrganizationQuery + withSetting *GroupSettingQuery + withUsers *UserQuery + withEvents *EventQuery + withIntegrations *IntegrationQuery + withFiles *FileQuery + withMembers *GroupMembershipQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Group) error + withNamedUsers map[string]*UserQuery + withNamedEvents map[string]*EventQuery + withNamedIntegrations map[string]*IntegrationQuery + withNamedFiles map[string]*FileQuery + withNamedMembers map[string]*GroupMembershipQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the GroupQuery builder. +func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery { + gq.predicates = append(gq.predicates, ps...) + return gq +} + +// Limit the number of records to be returned by this query. +func (gq *GroupQuery) Limit(limit int) *GroupQuery { + gq.ctx.Limit = &limit + return gq +} + +// Offset to start from. +func (gq *GroupQuery) Offset(offset int) *GroupQuery { + gq.ctx.Offset = &offset + return gq +} + +// 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 (gq *GroupQuery) Unique(unique bool) *GroupQuery { + gq.ctx.Unique = &unique + return gq +} + +// Order specifies how the records should be ordered. +func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery { + gq.order = append(gq.order, o...) + return gq +} + +// QueryOwner chains the current query on the "owner" edge. +func (gq *GroupQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: gq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, group.OwnerTable, group.OwnerColumn), + ) + schemaConfig := gq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Group + fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QuerySetting chains the current query on the "setting" edge. +func (gq *GroupQuery) QuerySetting() *GroupSettingQuery { + query := (&GroupSettingClient{config: gq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, selector), + sqlgraph.To(groupsetting.Table, groupsetting.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, group.SettingTable, group.SettingColumn), + ) + schemaConfig := gq.schemaConfig + step.To.Schema = schemaConfig.GroupSetting + step.Edge.Schema = schemaConfig.GroupSetting + fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryUsers chains the current query on the "users" edge. +func (gq *GroupQuery) QueryUsers() *UserQuery { + query := (&UserClient{config: gq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, group.UsersTable, group.UsersPrimaryKey...), + ) + schemaConfig := gq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (gq *GroupQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: gq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, group.EventsTable, group.EventsPrimaryKey...), + ) + schemaConfig := gq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupEvents + fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryIntegrations chains the current query on the "integrations" edge. +func (gq *GroupQuery) QueryIntegrations() *IntegrationQuery { + query := (&IntegrationClient{config: gq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, selector), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, group.IntegrationsTable, group.IntegrationsColumn), + ) + schemaConfig := gq.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFiles chains the current query on the "files" edge. +func (gq *GroupQuery) QueryFiles() *FileQuery { + query := (&FileClient{config: gq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, selector), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, group.FilesTable, group.FilesPrimaryKey...), + ) + schemaConfig := gq.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.GroupFiles + fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryMembers chains the current query on the "members" edge. +func (gq *GroupQuery) QueryMembers() *GroupMembershipQuery { + query := (&GroupMembershipClient{config: gq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(group.Table, group.FieldID, selector), + sqlgraph.To(groupmembership.Table, groupmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, group.MembersTable, group.MembersColumn), + ) + schemaConfig := gq.schemaConfig + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + fromU = sqlgraph.SetNeighbors(gq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Group entity from the query. +// Returns a *NotFoundError when no Group was found. +func (gq *GroupQuery) First(ctx context.Context) (*Group, error) { + nodes, err := gq.Limit(1).All(setContextOp(ctx, gq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{group.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (gq *GroupQuery) FirstX(ctx context.Context) *Group { + node, err := gq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Group ID from the query. +// Returns a *NotFoundError when no Group ID was found. +func (gq *GroupQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gq.Limit(1).IDs(setContextOp(ctx, gq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{group.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (gq *GroupQuery) FirstIDX(ctx context.Context) string { + id, err := gq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Group entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Group entity is found. +// Returns a *NotFoundError when no Group entities are found. +func (gq *GroupQuery) Only(ctx context.Context) (*Group, error) { + nodes, err := gq.Limit(2).All(setContextOp(ctx, gq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{group.Label} + default: + return nil, &NotSingularError{group.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (gq *GroupQuery) OnlyX(ctx context.Context) *Group { + node, err := gq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Group ID in the query. +// Returns a *NotSingularError when more than one Group ID is found. +// Returns a *NotFoundError when no entities are found. +func (gq *GroupQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gq.Limit(2).IDs(setContextOp(ctx, gq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{group.Label} + default: + err = &NotSingularError{group.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (gq *GroupQuery) OnlyIDX(ctx context.Context) string { + id, err := gq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Groups. +func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error) { + ctx = setContextOp(ctx, gq.ctx, ent.OpQueryAll) + if err := gq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Group, *GroupQuery]() + return withInterceptors[[]*Group](ctx, gq, qr, gq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (gq *GroupQuery) AllX(ctx context.Context) []*Group { + nodes, err := gq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Group IDs. +func (gq *GroupQuery) IDs(ctx context.Context) (ids []string, err error) { + if gq.ctx.Unique == nil && gq.path != nil { + gq.Unique(true) + } + ctx = setContextOp(ctx, gq.ctx, ent.OpQueryIDs) + if err = gq.Select(group.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (gq *GroupQuery) IDsX(ctx context.Context) []string { + ids, err := gq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (gq *GroupQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, gq.ctx, ent.OpQueryCount) + if err := gq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, gq, querierCount[*GroupQuery](), gq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (gq *GroupQuery) CountX(ctx context.Context) int { + count, err := gq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (gq *GroupQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, gq.ctx, ent.OpQueryExist) + switch _, err := gq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (gq *GroupQuery) ExistX(ctx context.Context) bool { + exist, err := gq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the GroupQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (gq *GroupQuery) Clone() *GroupQuery { + if gq == nil { + return nil + } + return &GroupQuery{ + config: gq.config, + ctx: gq.ctx.Clone(), + order: append([]group.OrderOption{}, gq.order...), + inters: append([]Interceptor{}, gq.inters...), + predicates: append([]predicate.Group{}, gq.predicates...), + withOwner: gq.withOwner.Clone(), + withSetting: gq.withSetting.Clone(), + withUsers: gq.withUsers.Clone(), + withEvents: gq.withEvents.Clone(), + withIntegrations: gq.withIntegrations.Clone(), + withFiles: gq.withFiles.Clone(), + withMembers: gq.withMembers.Clone(), + // clone intermediate query. + sql: gq.sql.Clone(), + path: gq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithOwner(opts ...func(*OrganizationQuery)) *GroupQuery { + query := (&OrganizationClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + gq.withOwner = query + return gq +} + +// WithSetting tells the query-builder to eager-load the nodes that are connected to +// the "setting" edge. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithSetting(opts ...func(*GroupSettingQuery)) *GroupQuery { + query := (&GroupSettingClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + gq.withSetting = query + return gq +} + +// WithUsers tells the query-builder to eager-load the nodes that are connected to +// the "users" edge. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery { + query := (&UserClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + gq.withUsers = query + return gq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithEvents(opts ...func(*EventQuery)) *GroupQuery { + query := (&EventClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + gq.withEvents = query + return gq +} + +// WithIntegrations tells the query-builder to eager-load the nodes that are connected to +// the "integrations" edge. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithIntegrations(opts ...func(*IntegrationQuery)) *GroupQuery { + query := (&IntegrationClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + gq.withIntegrations = query + return gq +} + +// WithFiles tells the query-builder to eager-load the nodes that are connected to +// the "files" edge. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithFiles(opts ...func(*FileQuery)) *GroupQuery { + query := (&FileClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + gq.withFiles = query + return gq +} + +// WithMembers tells the query-builder to eager-load the nodes that are connected to +// the "members" edge. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithMembers(opts ...func(*GroupMembershipQuery)) *GroupQuery { + query := (&GroupMembershipClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + gq.withMembers = query + return gq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Group.Query(). +// GroupBy(group.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy { + gq.ctx.Fields = append([]string{field}, fields...) + grbuild := &GroupGroupBy{build: gq} + grbuild.flds = &gq.ctx.Fields + grbuild.label = group.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Group.Query(). +// Select(group.FieldCreatedAt). +// Scan(ctx, &v) +func (gq *GroupQuery) Select(fields ...string) *GroupSelect { + gq.ctx.Fields = append(gq.ctx.Fields, fields...) + sbuild := &GroupSelect{GroupQuery: gq} + sbuild.label = group.Label + sbuild.flds, sbuild.scan = &gq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a GroupSelect configured with the given aggregations. +func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect { + return gq.Select().Aggregate(fns...) +} + +func (gq *GroupQuery) prepareQuery(ctx context.Context) error { + for _, inter := range gq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, gq); err != nil { + return err + } + } + } + for _, f := range gq.ctx.Fields { + if !group.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if gq.path != nil { + prev, err := gq.path(ctx) + if err != nil { + return err + } + gq.sql = prev + } + if group.Policy == nil { + return errors.New("generated: uninitialized group.Policy (forgotten import generated/runtime?)") + } + if err := group.Policy.EvalQuery(ctx, gq); err != nil { + return err + } + return nil +} + +func (gq *GroupQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Group, error) { + var ( + nodes = []*Group{} + _spec = gq.querySpec() + loadedTypes = [7]bool{ + gq.withOwner != nil, + gq.withSetting != nil, + gq.withUsers != nil, + gq.withEvents != nil, + gq.withIntegrations != nil, + gq.withFiles != nil, + gq.withMembers != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Group).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Group{config: gq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = gq.schemaConfig.Group + ctx = internal.NewSchemaConfigContext(ctx, gq.schemaConfig) + if len(gq.modifiers) > 0 { + _spec.Modifiers = gq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, gq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := gq.withOwner; query != nil { + if err := gq.loadOwner(ctx, query, nodes, nil, + func(n *Group, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := gq.withSetting; query != nil { + if err := gq.loadSetting(ctx, query, nodes, nil, + func(n *Group, e *GroupSetting) { n.Edges.Setting = e }); err != nil { + return nil, err + } + } + if query := gq.withUsers; query != nil { + if err := gq.loadUsers(ctx, query, nodes, + func(n *Group) { n.Edges.Users = []*User{} }, + func(n *Group, e *User) { n.Edges.Users = append(n.Edges.Users, e) }); err != nil { + return nil, err + } + } + if query := gq.withEvents; query != nil { + if err := gq.loadEvents(ctx, query, nodes, + func(n *Group) { n.Edges.Events = []*Event{} }, + func(n *Group, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + if query := gq.withIntegrations; query != nil { + if err := gq.loadIntegrations(ctx, query, nodes, + func(n *Group) { n.Edges.Integrations = []*Integration{} }, + func(n *Group, e *Integration) { n.Edges.Integrations = append(n.Edges.Integrations, e) }); err != nil { + return nil, err + } + } + if query := gq.withFiles; query != nil { + if err := gq.loadFiles(ctx, query, nodes, + func(n *Group) { n.Edges.Files = []*File{} }, + func(n *Group, e *File) { n.Edges.Files = append(n.Edges.Files, e) }); err != nil { + return nil, err + } + } + if query := gq.withMembers; query != nil { + if err := gq.loadMembers(ctx, query, nodes, + func(n *Group) { n.Edges.Members = []*GroupMembership{} }, + func(n *Group, e *GroupMembership) { n.Edges.Members = append(n.Edges.Members, e) }); err != nil { + return nil, err + } + } + for name, query := range gq.withNamedUsers { + if err := gq.loadUsers(ctx, query, nodes, + func(n *Group) { n.appendNamedUsers(name) }, + func(n *Group, e *User) { n.appendNamedUsers(name, e) }); err != nil { + return nil, err + } + } + for name, query := range gq.withNamedEvents { + if err := gq.loadEvents(ctx, query, nodes, + func(n *Group) { n.appendNamedEvents(name) }, + func(n *Group, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for name, query := range gq.withNamedIntegrations { + if err := gq.loadIntegrations(ctx, query, nodes, + func(n *Group) { n.appendNamedIntegrations(name) }, + func(n *Group, e *Integration) { n.appendNamedIntegrations(name, e) }); err != nil { + return nil, err + } + } + for name, query := range gq.withNamedFiles { + if err := gq.loadFiles(ctx, query, nodes, + func(n *Group) { n.appendNamedFiles(name) }, + func(n *Group, e *File) { n.appendNamedFiles(name, e) }); err != nil { + return nil, err + } + } + for name, query := range gq.withNamedMembers { + if err := gq.loadMembers(ctx, query, nodes, + func(n *Group) { n.appendNamedMembers(name) }, + func(n *Group, e *GroupMembership) { n.appendNamedMembers(name, e) }); err != nil { + return nil, err + } + } + for i := range gq.loadTotal { + if err := gq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (gq *GroupQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Group, init func(*Group), assign func(*Group, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Group) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (gq *GroupQuery) loadSetting(ctx context.Context, query *GroupSettingQuery, nodes []*Group, init func(*Group), assign func(*Group, *GroupSetting)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Group) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(groupsetting.FieldGroupID) + } + query.Where(predicate.GroupSetting(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(group.SettingColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.GroupID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "group_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (gq *GroupQuery) loadUsers(ctx context.Context, query *UserQuery, nodes []*Group, init func(*Group), assign func(*Group, *User)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Group) + nids := make(map[string]map[*Group]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(group.UsersTable) + joinT.Schema(gq.schemaConfig.GroupMembership) + s.Join(joinT).On(s.C(user.FieldID), joinT.C(group.UsersPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(group.UsersPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(group.UsersPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Group]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*User](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "users" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (gq *GroupQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Group, init func(*Group), assign func(*Group, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Group) + nids := make(map[string]map[*Group]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(group.EventsTable) + joinT.Schema(gq.schemaConfig.GroupEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(group.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(group.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(group.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Group]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (gq *GroupQuery) loadIntegrations(ctx context.Context, query *IntegrationQuery, nodes []*Group, init func(*Group), assign func(*Group, *Integration)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Group) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + query.withFKs = true + query.Where(predicate.Integration(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(group.IntegrationsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.group_integrations + if fk == nil { + return fmt.Errorf(`foreign-key "group_integrations" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "group_integrations" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} +func (gq *GroupQuery) loadFiles(ctx context.Context, query *FileQuery, nodes []*Group, init func(*Group), assign func(*Group, *File)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Group) + nids := make(map[string]map[*Group]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(group.FilesTable) + joinT.Schema(gq.schemaConfig.GroupFiles) + s.Join(joinT).On(s.C(file.FieldID), joinT.C(group.FilesPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(group.FilesPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(group.FilesPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Group]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*File](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "files" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (gq *GroupQuery) loadMembers(ctx context.Context, query *GroupMembershipQuery, nodes []*Group, init func(*Group), assign func(*Group, *GroupMembership)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Group) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(groupmembership.FieldGroupID) + } + query.Where(predicate.GroupMembership(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(group.MembersColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.GroupID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "group_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (gq *GroupQuery) sqlCount(ctx context.Context) (int, error) { + _spec := gq.querySpec() + _spec.Node.Schema = gq.schemaConfig.Group + ctx = internal.NewSchemaConfigContext(ctx, gq.schemaConfig) + if len(gq.modifiers) > 0 { + _spec.Modifiers = gq.modifiers + } + _spec.Node.Columns = gq.ctx.Fields + if len(gq.ctx.Fields) > 0 { + _spec.Unique = gq.ctx.Unique != nil && *gq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, gq.driver, _spec) +} + +func (gq *GroupQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(group.Table, group.Columns, sqlgraph.NewFieldSpec(group.FieldID, field.TypeString)) + _spec.From = gq.sql + if unique := gq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if gq.path != nil { + _spec.Unique = true + } + if fields := gq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, group.FieldID) + for i := range fields { + if fields[i] != group.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if gq.withOwner != nil { + _spec.Node.AddColumnOnce(group.FieldOwnerID) + } + } + if ps := gq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := gq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := gq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := gq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (gq *GroupQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(gq.driver.Dialect()) + t1 := builder.Table(group.Table) + columns := gq.ctx.Fields + if len(columns) == 0 { + columns = group.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if gq.sql != nil { + selector = gq.sql + selector.Select(selector.Columns(columns...)...) + } + if gq.ctx.Unique != nil && *gq.ctx.Unique { + selector.Distinct() + } + t1.Schema(gq.schemaConfig.Group) + ctx = internal.NewSchemaConfigContext(ctx, gq.schemaConfig) + selector.WithContext(ctx) + for _, p := range gq.predicates { + p(selector) + } + for _, p := range gq.order { + p(selector) + } + if offset := gq.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 := gq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedUsers tells the query-builder to eager-load the nodes that are connected to the "users" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithNamedUsers(name string, opts ...func(*UserQuery)) *GroupQuery { + query := (&UserClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + if gq.withNamedUsers == nil { + gq.withNamedUsers = make(map[string]*UserQuery) + } + gq.withNamedUsers[name] = query + return gq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *GroupQuery { + query := (&EventClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + if gq.withNamedEvents == nil { + gq.withNamedEvents = make(map[string]*EventQuery) + } + gq.withNamedEvents[name] = query + return gq +} + +// WithNamedIntegrations tells the query-builder to eager-load the nodes that are connected to the "integrations" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithNamedIntegrations(name string, opts ...func(*IntegrationQuery)) *GroupQuery { + query := (&IntegrationClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + if gq.withNamedIntegrations == nil { + gq.withNamedIntegrations = make(map[string]*IntegrationQuery) + } + gq.withNamedIntegrations[name] = query + return gq +} + +// WithNamedFiles tells the query-builder to eager-load the nodes that are connected to the "files" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithNamedFiles(name string, opts ...func(*FileQuery)) *GroupQuery { + query := (&FileClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + if gq.withNamedFiles == nil { + gq.withNamedFiles = make(map[string]*FileQuery) + } + gq.withNamedFiles[name] = query + return gq +} + +// WithNamedMembers tells the query-builder to eager-load the nodes that are connected to the "members" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (gq *GroupQuery) WithNamedMembers(name string, opts ...func(*GroupMembershipQuery)) *GroupQuery { + query := (&GroupMembershipClient{config: gq.config}).Query() + for _, opt := range opts { + opt(query) + } + if gq.withNamedMembers == nil { + gq.withNamedMembers = make(map[string]*GroupMembershipQuery) + } + gq.withNamedMembers[name] = query + return gq +} + +// GroupGroupBy is the group-by builder for Group entities. +type GroupGroupBy struct { + selector + build *GroupQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy { + ggb.fns = append(ggb.fns, fns...) + return ggb +} + +// Scan applies the selector query and scans the result into the given value. +func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ggb.build.ctx, ent.OpQueryGroupBy) + if err := ggb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupQuery, *GroupGroupBy](ctx, ggb.build, ggb, ggb.build.inters, v) +} + +func (ggb *GroupGroupBy) sqlScan(ctx context.Context, root *GroupQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ggb.fns)) + for _, fn := range ggb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ggb.flds)+len(ggb.fns)) + for _, f := range *ggb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ggb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ggb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// GroupSelect is the builder for selecting fields of Group entities. +type GroupSelect struct { + *GroupQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect { + gs.fns = append(gs.fns, fns...) + return gs +} + +// Scan applies the selector query and scans the result into the given value. +func (gs *GroupSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gs.ctx, ent.OpQuerySelect) + if err := gs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupQuery, *GroupSelect](ctx, gs.GroupQuery, gs, gs.inters, v) +} + +func (gs *GroupSelect) sqlScan(ctx context.Context, root *GroupQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(gs.fns)) + for _, fn := range gs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*gs.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 := gs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/group_update.go b/internal/ent/generated/group_update.go new file mode 100644 index 0000000..49a3623 --- /dev/null +++ b/internal/ent/generated/group_update.go @@ -0,0 +1,1860 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupUpdate is the builder for updating Group entities. +type GroupUpdate struct { + config + hooks []Hook + mutation *GroupMutation +} + +// Where appends a list predicates to the GroupUpdate builder. +func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate { + gu.mutation.Where(ps...) + return gu +} + +// SetUpdatedAt sets the "updated_at" field. +func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate { + gu.mutation.SetUpdatedAt(t) + return gu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gu *GroupUpdate) ClearUpdatedAt() *GroupUpdate { + gu.mutation.ClearUpdatedAt() + return gu +} + +// SetUpdatedBy sets the "updated_by" field. +func (gu *GroupUpdate) SetUpdatedBy(s string) *GroupUpdate { + gu.mutation.SetUpdatedBy(s) + return gu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableUpdatedBy(s *string) *GroupUpdate { + if s != nil { + gu.SetUpdatedBy(*s) + } + return gu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gu *GroupUpdate) ClearUpdatedBy() *GroupUpdate { + gu.mutation.ClearUpdatedBy() + return gu +} + +// SetDeletedAt sets the "deleted_at" field. +func (gu *GroupUpdate) SetDeletedAt(t time.Time) *GroupUpdate { + gu.mutation.SetDeletedAt(t) + return gu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableDeletedAt(t *time.Time) *GroupUpdate { + if t != nil { + gu.SetDeletedAt(*t) + } + return gu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gu *GroupUpdate) ClearDeletedAt() *GroupUpdate { + gu.mutation.ClearDeletedAt() + return gu +} + +// SetDeletedBy sets the "deleted_by" field. +func (gu *GroupUpdate) SetDeletedBy(s string) *GroupUpdate { + gu.mutation.SetDeletedBy(s) + return gu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableDeletedBy(s *string) *GroupUpdate { + if s != nil { + gu.SetDeletedBy(*s) + } + return gu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gu *GroupUpdate) ClearDeletedBy() *GroupUpdate { + gu.mutation.ClearDeletedBy() + return gu +} + +// SetTags sets the "tags" field. +func (gu *GroupUpdate) SetTags(s []string) *GroupUpdate { + gu.mutation.SetTags(s) + return gu +} + +// AppendTags appends s to the "tags" field. +func (gu *GroupUpdate) AppendTags(s []string) *GroupUpdate { + gu.mutation.AppendTags(s) + return gu +} + +// ClearTags clears the value of the "tags" field. +func (gu *GroupUpdate) ClearTags() *GroupUpdate { + gu.mutation.ClearTags() + return gu +} + +// SetOwnerID sets the "owner_id" field. +func (gu *GroupUpdate) SetOwnerID(s string) *GroupUpdate { + gu.mutation.SetOwnerID(s) + return gu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableOwnerID(s *string) *GroupUpdate { + if s != nil { + gu.SetOwnerID(*s) + } + return gu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (gu *GroupUpdate) ClearOwnerID() *GroupUpdate { + gu.mutation.ClearOwnerID() + return gu +} + +// SetName sets the "name" field. +func (gu *GroupUpdate) SetName(s string) *GroupUpdate { + gu.mutation.SetName(s) + return gu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate { + if s != nil { + gu.SetName(*s) + } + return gu +} + +// SetDescription sets the "description" field. +func (gu *GroupUpdate) SetDescription(s string) *GroupUpdate { + gu.mutation.SetDescription(s) + return gu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableDescription(s *string) *GroupUpdate { + if s != nil { + gu.SetDescription(*s) + } + return gu +} + +// ClearDescription clears the value of the "description" field. +func (gu *GroupUpdate) ClearDescription() *GroupUpdate { + gu.mutation.ClearDescription() + return gu +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (gu *GroupUpdate) SetGravatarLogoURL(s string) *GroupUpdate { + gu.mutation.SetGravatarLogoURL(s) + return gu +} + +// SetNillableGravatarLogoURL sets the "gravatar_logo_url" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableGravatarLogoURL(s *string) *GroupUpdate { + if s != nil { + gu.SetGravatarLogoURL(*s) + } + return gu +} + +// ClearGravatarLogoURL clears the value of the "gravatar_logo_url" field. +func (gu *GroupUpdate) ClearGravatarLogoURL() *GroupUpdate { + gu.mutation.ClearGravatarLogoURL() + return gu +} + +// SetLogoURL sets the "logo_url" field. +func (gu *GroupUpdate) SetLogoURL(s string) *GroupUpdate { + gu.mutation.SetLogoURL(s) + return gu +} + +// SetNillableLogoURL sets the "logo_url" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableLogoURL(s *string) *GroupUpdate { + if s != nil { + gu.SetLogoURL(*s) + } + return gu +} + +// ClearLogoURL clears the value of the "logo_url" field. +func (gu *GroupUpdate) ClearLogoURL() *GroupUpdate { + gu.mutation.ClearLogoURL() + return gu +} + +// SetDisplayName sets the "display_name" field. +func (gu *GroupUpdate) SetDisplayName(s string) *GroupUpdate { + gu.mutation.SetDisplayName(s) + return gu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (gu *GroupUpdate) SetNillableDisplayName(s *string) *GroupUpdate { + if s != nil { + gu.SetDisplayName(*s) + } + return gu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (gu *GroupUpdate) SetOwner(o *Organization) *GroupUpdate { + return gu.SetOwnerID(o.ID) +} + +// SetSettingID sets the "setting" edge to the GroupSetting entity by ID. +func (gu *GroupUpdate) SetSettingID(id string) *GroupUpdate { + gu.mutation.SetSettingID(id) + return gu +} + +// SetSetting sets the "setting" edge to the GroupSetting entity. +func (gu *GroupUpdate) SetSetting(g *GroupSetting) *GroupUpdate { + return gu.SetSettingID(g.ID) +} + +// AddUserIDs adds the "users" edge to the User entity by IDs. +func (gu *GroupUpdate) AddUserIDs(ids ...string) *GroupUpdate { + gu.mutation.AddUserIDs(ids...) + return gu +} + +// AddUsers adds the "users" edges to the User entity. +func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return gu.AddUserIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (gu *GroupUpdate) AddEventIDs(ids ...string) *GroupUpdate { + gu.mutation.AddEventIDs(ids...) + return gu +} + +// AddEvents adds the "events" edges to the Event entity. +func (gu *GroupUpdate) AddEvents(e ...*Event) *GroupUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gu.AddEventIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (gu *GroupUpdate) AddIntegrationIDs(ids ...string) *GroupUpdate { + gu.mutation.AddIntegrationIDs(ids...) + return gu +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (gu *GroupUpdate) AddIntegrations(i ...*Integration) *GroupUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return gu.AddIntegrationIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (gu *GroupUpdate) AddFileIDs(ids ...string) *GroupUpdate { + gu.mutation.AddFileIDs(ids...) + return gu +} + +// AddFiles adds the "files" edges to the File entity. +func (gu *GroupUpdate) AddFiles(f ...*File) *GroupUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return gu.AddFileIDs(ids...) +} + +// AddMemberIDs adds the "members" edge to the GroupMembership entity by IDs. +func (gu *GroupUpdate) AddMemberIDs(ids ...string) *GroupUpdate { + gu.mutation.AddMemberIDs(ids...) + return gu +} + +// AddMembers adds the "members" edges to the GroupMembership entity. +func (gu *GroupUpdate) AddMembers(g ...*GroupMembership) *GroupUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return gu.AddMemberIDs(ids...) +} + +// Mutation returns the GroupMutation object of the builder. +func (gu *GroupUpdate) Mutation() *GroupMutation { + return gu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (gu *GroupUpdate) ClearOwner() *GroupUpdate { + gu.mutation.ClearOwner() + return gu +} + +// ClearSetting clears the "setting" edge to the GroupSetting entity. +func (gu *GroupUpdate) ClearSetting() *GroupUpdate { + gu.mutation.ClearSetting() + return gu +} + +// ClearUsers clears all "users" edges to the User entity. +func (gu *GroupUpdate) ClearUsers() *GroupUpdate { + gu.mutation.ClearUsers() + return gu +} + +// RemoveUserIDs removes the "users" edge to User entities by IDs. +func (gu *GroupUpdate) RemoveUserIDs(ids ...string) *GroupUpdate { + gu.mutation.RemoveUserIDs(ids...) + return gu +} + +// RemoveUsers removes "users" edges to User entities. +func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return gu.RemoveUserIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (gu *GroupUpdate) ClearEvents() *GroupUpdate { + gu.mutation.ClearEvents() + return gu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (gu *GroupUpdate) RemoveEventIDs(ids ...string) *GroupUpdate { + gu.mutation.RemoveEventIDs(ids...) + return gu +} + +// RemoveEvents removes "events" edges to Event entities. +func (gu *GroupUpdate) RemoveEvents(e ...*Event) *GroupUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gu.RemoveEventIDs(ids...) +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (gu *GroupUpdate) ClearIntegrations() *GroupUpdate { + gu.mutation.ClearIntegrations() + return gu +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (gu *GroupUpdate) RemoveIntegrationIDs(ids ...string) *GroupUpdate { + gu.mutation.RemoveIntegrationIDs(ids...) + return gu +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (gu *GroupUpdate) RemoveIntegrations(i ...*Integration) *GroupUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return gu.RemoveIntegrationIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (gu *GroupUpdate) ClearFiles() *GroupUpdate { + gu.mutation.ClearFiles() + return gu +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (gu *GroupUpdate) RemoveFileIDs(ids ...string) *GroupUpdate { + gu.mutation.RemoveFileIDs(ids...) + return gu +} + +// RemoveFiles removes "files" edges to File entities. +func (gu *GroupUpdate) RemoveFiles(f ...*File) *GroupUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return gu.RemoveFileIDs(ids...) +} + +// ClearMembers clears all "members" edges to the GroupMembership entity. +func (gu *GroupUpdate) ClearMembers() *GroupUpdate { + gu.mutation.ClearMembers() + return gu +} + +// RemoveMemberIDs removes the "members" edge to GroupMembership entities by IDs. +func (gu *GroupUpdate) RemoveMemberIDs(ids ...string) *GroupUpdate { + gu.mutation.RemoveMemberIDs(ids...) + return gu +} + +// RemoveMembers removes "members" edges to GroupMembership entities. +func (gu *GroupUpdate) RemoveMembers(g ...*GroupMembership) *GroupUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return gu.RemoveMemberIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (gu *GroupUpdate) Save(ctx context.Context) (int, error) { + if err := gu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, gu.sqlSave, gu.mutation, gu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gu *GroupUpdate) SaveX(ctx context.Context) int { + affected, err := gu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (gu *GroupUpdate) Exec(ctx context.Context) error { + _, err := gu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gu *GroupUpdate) ExecX(ctx context.Context) { + if err := gu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gu *GroupUpdate) defaults() error { + if _, ok := gu.mutation.UpdatedAt(); !ok && !gu.mutation.UpdatedAtCleared() { + if group.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized group.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := group.UpdateDefaultUpdatedAt() + gu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gu *GroupUpdate) check() error { + if v, ok := gu.mutation.OwnerID(); ok { + if err := group.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Group.owner_id": %w`, err)} + } + } + if v, ok := gu.mutation.Name(); ok { + if err := group.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Group.name": %w`, err)} + } + } + if v, ok := gu.mutation.DisplayName(); ok { + if err := group.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Group.display_name": %w`, err)} + } + } + if gu.mutation.SettingCleared() && len(gu.mutation.SettingIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Group.setting"`) + } + return nil +} + +func (gu *GroupUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := gu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(group.Table, group.Columns, sqlgraph.NewFieldSpec(group.FieldID, field.TypeString)) + if ps := gu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gu.mutation.CreatedAtCleared() { + _spec.ClearField(group.FieldCreatedAt, field.TypeTime) + } + if value, ok := gu.mutation.UpdatedAt(); ok { + _spec.SetField(group.FieldUpdatedAt, field.TypeTime, value) + } + if gu.mutation.UpdatedAtCleared() { + _spec.ClearField(group.FieldUpdatedAt, field.TypeTime) + } + if gu.mutation.CreatedByCleared() { + _spec.ClearField(group.FieldCreatedBy, field.TypeString) + } + if value, ok := gu.mutation.UpdatedBy(); ok { + _spec.SetField(group.FieldUpdatedBy, field.TypeString, value) + } + if gu.mutation.UpdatedByCleared() { + _spec.ClearField(group.FieldUpdatedBy, field.TypeString) + } + if value, ok := gu.mutation.DeletedAt(); ok { + _spec.SetField(group.FieldDeletedAt, field.TypeTime, value) + } + if gu.mutation.DeletedAtCleared() { + _spec.ClearField(group.FieldDeletedAt, field.TypeTime) + } + if value, ok := gu.mutation.DeletedBy(); ok { + _spec.SetField(group.FieldDeletedBy, field.TypeString, value) + } + if gu.mutation.DeletedByCleared() { + _spec.ClearField(group.FieldDeletedBy, field.TypeString) + } + if value, ok := gu.mutation.Tags(); ok { + _spec.SetField(group.FieldTags, field.TypeJSON, value) + } + if value, ok := gu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, group.FieldTags, value) + }) + } + if gu.mutation.TagsCleared() { + _spec.ClearField(group.FieldTags, field.TypeJSON) + } + if value, ok := gu.mutation.Name(); ok { + _spec.SetField(group.FieldName, field.TypeString, value) + } + if value, ok := gu.mutation.Description(); ok { + _spec.SetField(group.FieldDescription, field.TypeString, value) + } + if gu.mutation.DescriptionCleared() { + _spec.ClearField(group.FieldDescription, field.TypeString) + } + if value, ok := gu.mutation.GravatarLogoURL(); ok { + _spec.SetField(group.FieldGravatarLogoURL, field.TypeString, value) + } + if gu.mutation.GravatarLogoURLCleared() { + _spec.ClearField(group.FieldGravatarLogoURL, field.TypeString) + } + if value, ok := gu.mutation.LogoURL(); ok { + _spec.SetField(group.FieldLogoURL, field.TypeString, value) + } + if gu.mutation.LogoURLCleared() { + _spec.ClearField(group.FieldLogoURL, field.TypeString) + } + if value, ok := gu.mutation.DisplayName(); ok { + _spec.SetField(group.FieldDisplayName, field.TypeString, value) + } + if gu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: group.OwnerTable, + Columns: []string{group.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.Group + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: group.OwnerTable, + Columns: []string{group.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if gu.mutation.SettingCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: group.SettingTable, + Columns: []string{group.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: group.SettingTable, + Columns: []string{group.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if gu.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupMembership + createE := &GroupMembershipCreate{config: gu.config, mutation: newGroupMembershipMutation(gu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.RemovedUsersIDs(); len(nodes) > 0 && !gu.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: gu.config, mutation: newGroupMembershipMutation(gu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.UsersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: gu.config, mutation: newGroupMembershipMutation(gu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if gu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !gu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if gu.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.Integration + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !gu.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if gu.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.RemovedFilesIDs(); len(nodes) > 0 && !gu.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if gu.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.RemovedMembersIDs(); len(nodes) > 0 && !gu.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gu.mutation.MembersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = gu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = gu.schemaConfig.Group + ctx = internal.NewSchemaConfigContext(ctx, gu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, gu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{group.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + gu.mutation.done = true + return n, nil +} + +// GroupUpdateOne is the builder for updating a single Group entity. +type GroupUpdateOne struct { + config + fields []string + hooks []Hook + mutation *GroupMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne { + guo.mutation.SetUpdatedAt(t) + return guo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (guo *GroupUpdateOne) ClearUpdatedAt() *GroupUpdateOne { + guo.mutation.ClearUpdatedAt() + return guo +} + +// SetUpdatedBy sets the "updated_by" field. +func (guo *GroupUpdateOne) SetUpdatedBy(s string) *GroupUpdateOne { + guo.mutation.SetUpdatedBy(s) + return guo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableUpdatedBy(s *string) *GroupUpdateOne { + if s != nil { + guo.SetUpdatedBy(*s) + } + return guo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (guo *GroupUpdateOne) ClearUpdatedBy() *GroupUpdateOne { + guo.mutation.ClearUpdatedBy() + return guo +} + +// SetDeletedAt sets the "deleted_at" field. +func (guo *GroupUpdateOne) SetDeletedAt(t time.Time) *GroupUpdateOne { + guo.mutation.SetDeletedAt(t) + return guo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableDeletedAt(t *time.Time) *GroupUpdateOne { + if t != nil { + guo.SetDeletedAt(*t) + } + return guo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (guo *GroupUpdateOne) ClearDeletedAt() *GroupUpdateOne { + guo.mutation.ClearDeletedAt() + return guo +} + +// SetDeletedBy sets the "deleted_by" field. +func (guo *GroupUpdateOne) SetDeletedBy(s string) *GroupUpdateOne { + guo.mutation.SetDeletedBy(s) + return guo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableDeletedBy(s *string) *GroupUpdateOne { + if s != nil { + guo.SetDeletedBy(*s) + } + return guo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (guo *GroupUpdateOne) ClearDeletedBy() *GroupUpdateOne { + guo.mutation.ClearDeletedBy() + return guo +} + +// SetTags sets the "tags" field. +func (guo *GroupUpdateOne) SetTags(s []string) *GroupUpdateOne { + guo.mutation.SetTags(s) + return guo +} + +// AppendTags appends s to the "tags" field. +func (guo *GroupUpdateOne) AppendTags(s []string) *GroupUpdateOne { + guo.mutation.AppendTags(s) + return guo +} + +// ClearTags clears the value of the "tags" field. +func (guo *GroupUpdateOne) ClearTags() *GroupUpdateOne { + guo.mutation.ClearTags() + return guo +} + +// SetOwnerID sets the "owner_id" field. +func (guo *GroupUpdateOne) SetOwnerID(s string) *GroupUpdateOne { + guo.mutation.SetOwnerID(s) + return guo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableOwnerID(s *string) *GroupUpdateOne { + if s != nil { + guo.SetOwnerID(*s) + } + return guo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (guo *GroupUpdateOne) ClearOwnerID() *GroupUpdateOne { + guo.mutation.ClearOwnerID() + return guo +} + +// SetName sets the "name" field. +func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne { + guo.mutation.SetName(s) + return guo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne { + if s != nil { + guo.SetName(*s) + } + return guo +} + +// SetDescription sets the "description" field. +func (guo *GroupUpdateOne) SetDescription(s string) *GroupUpdateOne { + guo.mutation.SetDescription(s) + return guo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableDescription(s *string) *GroupUpdateOne { + if s != nil { + guo.SetDescription(*s) + } + return guo +} + +// ClearDescription clears the value of the "description" field. +func (guo *GroupUpdateOne) ClearDescription() *GroupUpdateOne { + guo.mutation.ClearDescription() + return guo +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (guo *GroupUpdateOne) SetGravatarLogoURL(s string) *GroupUpdateOne { + guo.mutation.SetGravatarLogoURL(s) + return guo +} + +// SetNillableGravatarLogoURL sets the "gravatar_logo_url" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableGravatarLogoURL(s *string) *GroupUpdateOne { + if s != nil { + guo.SetGravatarLogoURL(*s) + } + return guo +} + +// ClearGravatarLogoURL clears the value of the "gravatar_logo_url" field. +func (guo *GroupUpdateOne) ClearGravatarLogoURL() *GroupUpdateOne { + guo.mutation.ClearGravatarLogoURL() + return guo +} + +// SetLogoURL sets the "logo_url" field. +func (guo *GroupUpdateOne) SetLogoURL(s string) *GroupUpdateOne { + guo.mutation.SetLogoURL(s) + return guo +} + +// SetNillableLogoURL sets the "logo_url" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableLogoURL(s *string) *GroupUpdateOne { + if s != nil { + guo.SetLogoURL(*s) + } + return guo +} + +// ClearLogoURL clears the value of the "logo_url" field. +func (guo *GroupUpdateOne) ClearLogoURL() *GroupUpdateOne { + guo.mutation.ClearLogoURL() + return guo +} + +// SetDisplayName sets the "display_name" field. +func (guo *GroupUpdateOne) SetDisplayName(s string) *GroupUpdateOne { + guo.mutation.SetDisplayName(s) + return guo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (guo *GroupUpdateOne) SetNillableDisplayName(s *string) *GroupUpdateOne { + if s != nil { + guo.SetDisplayName(*s) + } + return guo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (guo *GroupUpdateOne) SetOwner(o *Organization) *GroupUpdateOne { + return guo.SetOwnerID(o.ID) +} + +// SetSettingID sets the "setting" edge to the GroupSetting entity by ID. +func (guo *GroupUpdateOne) SetSettingID(id string) *GroupUpdateOne { + guo.mutation.SetSettingID(id) + return guo +} + +// SetSetting sets the "setting" edge to the GroupSetting entity. +func (guo *GroupUpdateOne) SetSetting(g *GroupSetting) *GroupUpdateOne { + return guo.SetSettingID(g.ID) +} + +// AddUserIDs adds the "users" edge to the User entity by IDs. +func (guo *GroupUpdateOne) AddUserIDs(ids ...string) *GroupUpdateOne { + guo.mutation.AddUserIDs(ids...) + return guo +} + +// AddUsers adds the "users" edges to the User entity. +func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return guo.AddUserIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (guo *GroupUpdateOne) AddEventIDs(ids ...string) *GroupUpdateOne { + guo.mutation.AddEventIDs(ids...) + return guo +} + +// AddEvents adds the "events" edges to the Event entity. +func (guo *GroupUpdateOne) AddEvents(e ...*Event) *GroupUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return guo.AddEventIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (guo *GroupUpdateOne) AddIntegrationIDs(ids ...string) *GroupUpdateOne { + guo.mutation.AddIntegrationIDs(ids...) + return guo +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (guo *GroupUpdateOne) AddIntegrations(i ...*Integration) *GroupUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return guo.AddIntegrationIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (guo *GroupUpdateOne) AddFileIDs(ids ...string) *GroupUpdateOne { + guo.mutation.AddFileIDs(ids...) + return guo +} + +// AddFiles adds the "files" edges to the File entity. +func (guo *GroupUpdateOne) AddFiles(f ...*File) *GroupUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return guo.AddFileIDs(ids...) +} + +// AddMemberIDs adds the "members" edge to the GroupMembership entity by IDs. +func (guo *GroupUpdateOne) AddMemberIDs(ids ...string) *GroupUpdateOne { + guo.mutation.AddMemberIDs(ids...) + return guo +} + +// AddMembers adds the "members" edges to the GroupMembership entity. +func (guo *GroupUpdateOne) AddMembers(g ...*GroupMembership) *GroupUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return guo.AddMemberIDs(ids...) +} + +// Mutation returns the GroupMutation object of the builder. +func (guo *GroupUpdateOne) Mutation() *GroupMutation { + return guo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (guo *GroupUpdateOne) ClearOwner() *GroupUpdateOne { + guo.mutation.ClearOwner() + return guo +} + +// ClearSetting clears the "setting" edge to the GroupSetting entity. +func (guo *GroupUpdateOne) ClearSetting() *GroupUpdateOne { + guo.mutation.ClearSetting() + return guo +} + +// ClearUsers clears all "users" edges to the User entity. +func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne { + guo.mutation.ClearUsers() + return guo +} + +// RemoveUserIDs removes the "users" edge to User entities by IDs. +func (guo *GroupUpdateOne) RemoveUserIDs(ids ...string) *GroupUpdateOne { + guo.mutation.RemoveUserIDs(ids...) + return guo +} + +// RemoveUsers removes "users" edges to User entities. +func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return guo.RemoveUserIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (guo *GroupUpdateOne) ClearEvents() *GroupUpdateOne { + guo.mutation.ClearEvents() + return guo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (guo *GroupUpdateOne) RemoveEventIDs(ids ...string) *GroupUpdateOne { + guo.mutation.RemoveEventIDs(ids...) + return guo +} + +// RemoveEvents removes "events" edges to Event entities. +func (guo *GroupUpdateOne) RemoveEvents(e ...*Event) *GroupUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return guo.RemoveEventIDs(ids...) +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (guo *GroupUpdateOne) ClearIntegrations() *GroupUpdateOne { + guo.mutation.ClearIntegrations() + return guo +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (guo *GroupUpdateOne) RemoveIntegrationIDs(ids ...string) *GroupUpdateOne { + guo.mutation.RemoveIntegrationIDs(ids...) + return guo +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (guo *GroupUpdateOne) RemoveIntegrations(i ...*Integration) *GroupUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return guo.RemoveIntegrationIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (guo *GroupUpdateOne) ClearFiles() *GroupUpdateOne { + guo.mutation.ClearFiles() + return guo +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (guo *GroupUpdateOne) RemoveFileIDs(ids ...string) *GroupUpdateOne { + guo.mutation.RemoveFileIDs(ids...) + return guo +} + +// RemoveFiles removes "files" edges to File entities. +func (guo *GroupUpdateOne) RemoveFiles(f ...*File) *GroupUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return guo.RemoveFileIDs(ids...) +} + +// ClearMembers clears all "members" edges to the GroupMembership entity. +func (guo *GroupUpdateOne) ClearMembers() *GroupUpdateOne { + guo.mutation.ClearMembers() + return guo +} + +// RemoveMemberIDs removes the "members" edge to GroupMembership entities by IDs. +func (guo *GroupUpdateOne) RemoveMemberIDs(ids ...string) *GroupUpdateOne { + guo.mutation.RemoveMemberIDs(ids...) + return guo +} + +// RemoveMembers removes "members" edges to GroupMembership entities. +func (guo *GroupUpdateOne) RemoveMembers(g ...*GroupMembership) *GroupUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return guo.RemoveMemberIDs(ids...) +} + +// Where appends a list predicates to the GroupUpdate builder. +func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne { + guo.mutation.Where(ps...) + return guo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne { + guo.fields = append([]string{field}, fields...) + return guo +} + +// Save executes the query and returns the updated Group entity. +func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error) { + if err := guo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, guo.sqlSave, guo.mutation, guo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group { + node, err := guo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (guo *GroupUpdateOne) Exec(ctx context.Context) error { + _, err := guo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (guo *GroupUpdateOne) ExecX(ctx context.Context) { + if err := guo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (guo *GroupUpdateOne) defaults() error { + if _, ok := guo.mutation.UpdatedAt(); !ok && !guo.mutation.UpdatedAtCleared() { + if group.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized group.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := group.UpdateDefaultUpdatedAt() + guo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (guo *GroupUpdateOne) check() error { + if v, ok := guo.mutation.OwnerID(); ok { + if err := group.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Group.owner_id": %w`, err)} + } + } + if v, ok := guo.mutation.Name(); ok { + if err := group.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Group.name": %w`, err)} + } + } + if v, ok := guo.mutation.DisplayName(); ok { + if err := group.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Group.display_name": %w`, err)} + } + } + if guo.mutation.SettingCleared() && len(guo.mutation.SettingIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Group.setting"`) + } + return nil +} + +func (guo *GroupUpdateOne) sqlSave(ctx context.Context) (_node *Group, err error) { + if err := guo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(group.Table, group.Columns, sqlgraph.NewFieldSpec(group.FieldID, field.TypeString)) + id, ok := guo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Group.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := guo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, group.FieldID) + for _, f := range fields { + if !group.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != group.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := guo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if guo.mutation.CreatedAtCleared() { + _spec.ClearField(group.FieldCreatedAt, field.TypeTime) + } + if value, ok := guo.mutation.UpdatedAt(); ok { + _spec.SetField(group.FieldUpdatedAt, field.TypeTime, value) + } + if guo.mutation.UpdatedAtCleared() { + _spec.ClearField(group.FieldUpdatedAt, field.TypeTime) + } + if guo.mutation.CreatedByCleared() { + _spec.ClearField(group.FieldCreatedBy, field.TypeString) + } + if value, ok := guo.mutation.UpdatedBy(); ok { + _spec.SetField(group.FieldUpdatedBy, field.TypeString, value) + } + if guo.mutation.UpdatedByCleared() { + _spec.ClearField(group.FieldUpdatedBy, field.TypeString) + } + if value, ok := guo.mutation.DeletedAt(); ok { + _spec.SetField(group.FieldDeletedAt, field.TypeTime, value) + } + if guo.mutation.DeletedAtCleared() { + _spec.ClearField(group.FieldDeletedAt, field.TypeTime) + } + if value, ok := guo.mutation.DeletedBy(); ok { + _spec.SetField(group.FieldDeletedBy, field.TypeString, value) + } + if guo.mutation.DeletedByCleared() { + _spec.ClearField(group.FieldDeletedBy, field.TypeString) + } + if value, ok := guo.mutation.Tags(); ok { + _spec.SetField(group.FieldTags, field.TypeJSON, value) + } + if value, ok := guo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, group.FieldTags, value) + }) + } + if guo.mutation.TagsCleared() { + _spec.ClearField(group.FieldTags, field.TypeJSON) + } + if value, ok := guo.mutation.Name(); ok { + _spec.SetField(group.FieldName, field.TypeString, value) + } + if value, ok := guo.mutation.Description(); ok { + _spec.SetField(group.FieldDescription, field.TypeString, value) + } + if guo.mutation.DescriptionCleared() { + _spec.ClearField(group.FieldDescription, field.TypeString) + } + if value, ok := guo.mutation.GravatarLogoURL(); ok { + _spec.SetField(group.FieldGravatarLogoURL, field.TypeString, value) + } + if guo.mutation.GravatarLogoURLCleared() { + _spec.ClearField(group.FieldGravatarLogoURL, field.TypeString) + } + if value, ok := guo.mutation.LogoURL(); ok { + _spec.SetField(group.FieldLogoURL, field.TypeString, value) + } + if guo.mutation.LogoURLCleared() { + _spec.ClearField(group.FieldLogoURL, field.TypeString) + } + if value, ok := guo.mutation.DisplayName(); ok { + _spec.SetField(group.FieldDisplayName, field.TypeString, value) + } + if guo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: group.OwnerTable, + Columns: []string{group.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.Group + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: group.OwnerTable, + Columns: []string{group.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if guo.mutation.SettingCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: group.SettingTable, + Columns: []string{group.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: group.SettingTable, + Columns: []string{group.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if guo.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupMembership + createE := &GroupMembershipCreate{config: guo.config, mutation: newGroupMembershipMutation(guo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.RemovedUsersIDs(); len(nodes) > 0 && !guo.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: guo.config, mutation: newGroupMembershipMutation(guo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.UsersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: group.UsersTable, + Columns: group.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: guo.config, mutation: newGroupMembershipMutation(guo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if guo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !guo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.EventsTable, + Columns: group.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if guo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.Integration + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !guo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: group.IntegrationsTable, + Columns: []string{group.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if guo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.RemovedFilesIDs(); len(nodes) > 0 && !guo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: group.FilesTable, + Columns: group.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if guo.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.RemovedMembersIDs(); len(nodes) > 0 && !guo.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := guo.mutation.MembersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: group.MembersTable, + Columns: []string{group.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = guo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = guo.schemaConfig.Group + ctx = internal.NewSchemaConfigContext(ctx, guo.schemaConfig) + _node = &Group{config: guo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, guo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{group.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + guo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/grouphistory.go b/internal/ent/generated/grouphistory.go new file mode 100644 index 0000000..694a882 --- /dev/null +++ b/internal/ent/generated/grouphistory.go @@ -0,0 +1,288 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/entx/history" +) + +// GroupHistory is the model entity for the GroupHistory schema. +type GroupHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name,omitempty"` + // the groups description + Description string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL string `json:"gravatar_logo_url,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL string `json:"logo_url,omitempty"` + // The group's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*GroupHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case grouphistory.FieldTags: + values[i] = new([]byte) + case grouphistory.FieldOperation: + values[i] = new(history.OpType) + case grouphistory.FieldID, grouphistory.FieldRef, grouphistory.FieldCreatedBy, grouphistory.FieldUpdatedBy, grouphistory.FieldDeletedBy, grouphistory.FieldMappingID, grouphistory.FieldOwnerID, grouphistory.FieldName, grouphistory.FieldDescription, grouphistory.FieldGravatarLogoURL, grouphistory.FieldLogoURL, grouphistory.FieldDisplayName: + values[i] = new(sql.NullString) + case grouphistory.FieldHistoryTime, grouphistory.FieldCreatedAt, grouphistory.FieldUpdatedAt, grouphistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the GroupHistory fields. +func (gh *GroupHistory) 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 grouphistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + gh.ID = value.String + } + case grouphistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + gh.HistoryTime = value.Time + } + case grouphistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + gh.Ref = value.String + } + case grouphistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + gh.Operation = *value + } + case grouphistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + gh.CreatedAt = value.Time + } + case grouphistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + gh.UpdatedAt = value.Time + } + case grouphistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + gh.CreatedBy = value.String + } + case grouphistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + gh.UpdatedBy = value.String + } + case grouphistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + gh.DeletedAt = value.Time + } + case grouphistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + gh.DeletedBy = value.String + } + case grouphistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + gh.MappingID = value.String + } + case grouphistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &gh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case grouphistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + gh.OwnerID = value.String + } + case grouphistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + gh.Name = value.String + } + case grouphistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + gh.Description = value.String + } + case grouphistory.FieldGravatarLogoURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field gravatar_logo_url", values[i]) + } else if value.Valid { + gh.GravatarLogoURL = value.String + } + case grouphistory.FieldLogoURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field logo_url", values[i]) + } else if value.Valid { + gh.LogoURL = value.String + } + case grouphistory.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + gh.DisplayName = value.String + } + default: + gh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the GroupHistory. +// This includes values selected through modifiers, order, etc. +func (gh *GroupHistory) Value(name string) (ent.Value, error) { + return gh.selectValues.Get(name) +} + +// Update returns a builder for updating this GroupHistory. +// Note that you need to call GroupHistory.Unwrap() before calling this method if this GroupHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (gh *GroupHistory) Update() *GroupHistoryUpdateOne { + return NewGroupHistoryClient(gh.config).UpdateOne(gh) +} + +// Unwrap unwraps the GroupHistory 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 (gh *GroupHistory) Unwrap() *GroupHistory { + _tx, ok := gh.config.driver.(*txDriver) + if !ok { + panic("generated: GroupHistory is not a transactional entity") + } + gh.config.driver = _tx.drv + return gh +} + +// String implements the fmt.Stringer. +func (gh *GroupHistory) String() string { + var builder strings.Builder + builder.WriteString("GroupHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", gh.ID)) + builder.WriteString("history_time=") + builder.WriteString(gh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(gh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", gh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(gh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(gh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(gh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(gh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(gh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(gh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(gh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", gh.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(gh.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(gh.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(gh.Description) + builder.WriteString(", ") + builder.WriteString("gravatar_logo_url=") + builder.WriteString(gh.GravatarLogoURL) + builder.WriteString(", ") + builder.WriteString("logo_url=") + builder.WriteString(gh.LogoURL) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(gh.DisplayName) + builder.WriteByte(')') + return builder.String() +} + +// GroupHistories is a parsable slice of GroupHistory. +type GroupHistories []*GroupHistory diff --git a/internal/ent/generated/grouphistory/grouphistory.go b/internal/ent/generated/grouphistory/grouphistory.go new file mode 100644 index 0000000..0f0d089 --- /dev/null +++ b/internal/ent/generated/grouphistory/grouphistory.go @@ -0,0 +1,220 @@ +// Code generated by ent, DO NOT EDIT. + +package grouphistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the grouphistory type in the database. + Label = "group_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldGravatarLogoURL holds the string denoting the gravatar_logo_url field in the database. + FieldGravatarLogoURL = "gravatar_logo_url" + // FieldLogoURL holds the string denoting the logo_url field in the database. + FieldLogoURL = "logo_url" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // Table holds the table name of the grouphistory in the database. + Table = "group_history" +) + +// Columns holds all SQL columns for grouphistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldDescription, + FieldGravatarLogoURL, + FieldLogoURL, + FieldDisplayName, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultDisplayName holds the default value on creation for the "display_name" field. + DefaultDisplayName string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("grouphistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the GroupHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByGravatarLogoURL orders the results by the gravatar_logo_url field. +func ByGravatarLogoURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGravatarLogoURL, opts...).ToFunc() +} + +// ByLogoURL orders the results by the logo_url field. +func ByLogoURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLogoURL, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/grouphistory/where.go b/internal/ent/generated/grouphistory/where.go new file mode 100644 index 0000000..7764459 --- /dev/null +++ b/internal/ent/generated/grouphistory/where.go @@ -0,0 +1,1171 @@ +// Code generated by ent, DO NOT EDIT. + +package grouphistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDescription, v)) +} + +// GravatarLogoURL applies equality check predicate on the "gravatar_logo_url" field. It's identical to GravatarLogoURLEQ. +func GravatarLogoURL(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldGravatarLogoURL, v)) +} + +// LogoURL applies equality check predicate on the "logo_url" field. It's identical to LogoURLEQ. +func LogoURL(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldLogoURL, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// GravatarLogoURLEQ applies the EQ predicate on the "gravatar_logo_url" field. +func GravatarLogoURLEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLNEQ applies the NEQ predicate on the "gravatar_logo_url" field. +func GravatarLogoURLNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLIn applies the In predicate on the "gravatar_logo_url" field. +func GravatarLogoURLIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldGravatarLogoURL, vs...)) +} + +// GravatarLogoURLNotIn applies the NotIn predicate on the "gravatar_logo_url" field. +func GravatarLogoURLNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldGravatarLogoURL, vs...)) +} + +// GravatarLogoURLGT applies the GT predicate on the "gravatar_logo_url" field. +func GravatarLogoURLGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLGTE applies the GTE predicate on the "gravatar_logo_url" field. +func GravatarLogoURLGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLLT applies the LT predicate on the "gravatar_logo_url" field. +func GravatarLogoURLLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLLTE applies the LTE predicate on the "gravatar_logo_url" field. +func GravatarLogoURLLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLContains applies the Contains predicate on the "gravatar_logo_url" field. +func GravatarLogoURLContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLHasPrefix applies the HasPrefix predicate on the "gravatar_logo_url" field. +func GravatarLogoURLHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLHasSuffix applies the HasSuffix predicate on the "gravatar_logo_url" field. +func GravatarLogoURLHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLIsNil applies the IsNil predicate on the "gravatar_logo_url" field. +func GravatarLogoURLIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldGravatarLogoURL)) +} + +// GravatarLogoURLNotNil applies the NotNil predicate on the "gravatar_logo_url" field. +func GravatarLogoURLNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldGravatarLogoURL)) +} + +// GravatarLogoURLEqualFold applies the EqualFold predicate on the "gravatar_logo_url" field. +func GravatarLogoURLEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldGravatarLogoURL, v)) +} + +// GravatarLogoURLContainsFold applies the ContainsFold predicate on the "gravatar_logo_url" field. +func GravatarLogoURLContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldGravatarLogoURL, v)) +} + +// LogoURLEQ applies the EQ predicate on the "logo_url" field. +func LogoURLEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldLogoURL, v)) +} + +// LogoURLNEQ applies the NEQ predicate on the "logo_url" field. +func LogoURLNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldLogoURL, v)) +} + +// LogoURLIn applies the In predicate on the "logo_url" field. +func LogoURLIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldLogoURL, vs...)) +} + +// LogoURLNotIn applies the NotIn predicate on the "logo_url" field. +func LogoURLNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldLogoURL, vs...)) +} + +// LogoURLGT applies the GT predicate on the "logo_url" field. +func LogoURLGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldLogoURL, v)) +} + +// LogoURLGTE applies the GTE predicate on the "logo_url" field. +func LogoURLGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldLogoURL, v)) +} + +// LogoURLLT applies the LT predicate on the "logo_url" field. +func LogoURLLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldLogoURL, v)) +} + +// LogoURLLTE applies the LTE predicate on the "logo_url" field. +func LogoURLLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldLogoURL, v)) +} + +// LogoURLContains applies the Contains predicate on the "logo_url" field. +func LogoURLContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldLogoURL, v)) +} + +// LogoURLHasPrefix applies the HasPrefix predicate on the "logo_url" field. +func LogoURLHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldLogoURL, v)) +} + +// LogoURLHasSuffix applies the HasSuffix predicate on the "logo_url" field. +func LogoURLHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldLogoURL, v)) +} + +// LogoURLIsNil applies the IsNil predicate on the "logo_url" field. +func LogoURLIsNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIsNull(FieldLogoURL)) +} + +// LogoURLNotNil applies the NotNil predicate on the "logo_url" field. +func LogoURLNotNil() predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotNull(FieldLogoURL)) +} + +// LogoURLEqualFold applies the EqualFold predicate on the "logo_url" field. +func LogoURLEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldLogoURL, v)) +} + +// LogoURLContainsFold applies the ContainsFold predicate on the "logo_url" field. +func LogoURLContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldLogoURL, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.GroupHistory { + return predicate.GroupHistory(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.GroupHistory) predicate.GroupHistory { + return predicate.GroupHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.GroupHistory) predicate.GroupHistory { + return predicate.GroupHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.GroupHistory) predicate.GroupHistory { + return predicate.GroupHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/grouphistory_create.go b/internal/ent/generated/grouphistory_create.go new file mode 100644 index 0000000..66c71fa --- /dev/null +++ b/internal/ent/generated/grouphistory_create.go @@ -0,0 +1,546 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/entx/history" +) + +// GroupHistoryCreate is the builder for creating a GroupHistory entity. +type GroupHistoryCreate struct { + config + mutation *GroupHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ghc *GroupHistoryCreate) SetHistoryTime(t time.Time) *GroupHistoryCreate { + ghc.mutation.SetHistoryTime(t) + return ghc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableHistoryTime(t *time.Time) *GroupHistoryCreate { + if t != nil { + ghc.SetHistoryTime(*t) + } + return ghc +} + +// SetRef sets the "ref" field. +func (ghc *GroupHistoryCreate) SetRef(s string) *GroupHistoryCreate { + ghc.mutation.SetRef(s) + return ghc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableRef(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetRef(*s) + } + return ghc +} + +// SetOperation sets the "operation" field. +func (ghc *GroupHistoryCreate) SetOperation(ht history.OpType) *GroupHistoryCreate { + ghc.mutation.SetOperation(ht) + return ghc +} + +// SetCreatedAt sets the "created_at" field. +func (ghc *GroupHistoryCreate) SetCreatedAt(t time.Time) *GroupHistoryCreate { + ghc.mutation.SetCreatedAt(t) + return ghc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableCreatedAt(t *time.Time) *GroupHistoryCreate { + if t != nil { + ghc.SetCreatedAt(*t) + } + return ghc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ghc *GroupHistoryCreate) SetUpdatedAt(t time.Time) *GroupHistoryCreate { + ghc.mutation.SetUpdatedAt(t) + return ghc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableUpdatedAt(t *time.Time) *GroupHistoryCreate { + if t != nil { + ghc.SetUpdatedAt(*t) + } + return ghc +} + +// SetCreatedBy sets the "created_by" field. +func (ghc *GroupHistoryCreate) SetCreatedBy(s string) *GroupHistoryCreate { + ghc.mutation.SetCreatedBy(s) + return ghc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableCreatedBy(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetCreatedBy(*s) + } + return ghc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ghc *GroupHistoryCreate) SetUpdatedBy(s string) *GroupHistoryCreate { + ghc.mutation.SetUpdatedBy(s) + return ghc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableUpdatedBy(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetUpdatedBy(*s) + } + return ghc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ghc *GroupHistoryCreate) SetDeletedAt(t time.Time) *GroupHistoryCreate { + ghc.mutation.SetDeletedAt(t) + return ghc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableDeletedAt(t *time.Time) *GroupHistoryCreate { + if t != nil { + ghc.SetDeletedAt(*t) + } + return ghc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ghc *GroupHistoryCreate) SetDeletedBy(s string) *GroupHistoryCreate { + ghc.mutation.SetDeletedBy(s) + return ghc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableDeletedBy(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetDeletedBy(*s) + } + return ghc +} + +// SetMappingID sets the "mapping_id" field. +func (ghc *GroupHistoryCreate) SetMappingID(s string) *GroupHistoryCreate { + ghc.mutation.SetMappingID(s) + return ghc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableMappingID(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetMappingID(*s) + } + return ghc +} + +// SetTags sets the "tags" field. +func (ghc *GroupHistoryCreate) SetTags(s []string) *GroupHistoryCreate { + ghc.mutation.SetTags(s) + return ghc +} + +// SetOwnerID sets the "owner_id" field. +func (ghc *GroupHistoryCreate) SetOwnerID(s string) *GroupHistoryCreate { + ghc.mutation.SetOwnerID(s) + return ghc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableOwnerID(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetOwnerID(*s) + } + return ghc +} + +// SetName sets the "name" field. +func (ghc *GroupHistoryCreate) SetName(s string) *GroupHistoryCreate { + ghc.mutation.SetName(s) + return ghc +} + +// SetDescription sets the "description" field. +func (ghc *GroupHistoryCreate) SetDescription(s string) *GroupHistoryCreate { + ghc.mutation.SetDescription(s) + return ghc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableDescription(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetDescription(*s) + } + return ghc +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (ghc *GroupHistoryCreate) SetGravatarLogoURL(s string) *GroupHistoryCreate { + ghc.mutation.SetGravatarLogoURL(s) + return ghc +} + +// SetNillableGravatarLogoURL sets the "gravatar_logo_url" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableGravatarLogoURL(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetGravatarLogoURL(*s) + } + return ghc +} + +// SetLogoURL sets the "logo_url" field. +func (ghc *GroupHistoryCreate) SetLogoURL(s string) *GroupHistoryCreate { + ghc.mutation.SetLogoURL(s) + return ghc +} + +// SetNillableLogoURL sets the "logo_url" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableLogoURL(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetLogoURL(*s) + } + return ghc +} + +// SetDisplayName sets the "display_name" field. +func (ghc *GroupHistoryCreate) SetDisplayName(s string) *GroupHistoryCreate { + ghc.mutation.SetDisplayName(s) + return ghc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableDisplayName(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetDisplayName(*s) + } + return ghc +} + +// SetID sets the "id" field. +func (ghc *GroupHistoryCreate) SetID(s string) *GroupHistoryCreate { + ghc.mutation.SetID(s) + return ghc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ghc *GroupHistoryCreate) SetNillableID(s *string) *GroupHistoryCreate { + if s != nil { + ghc.SetID(*s) + } + return ghc +} + +// Mutation returns the GroupHistoryMutation object of the builder. +func (ghc *GroupHistoryCreate) Mutation() *GroupHistoryMutation { + return ghc.mutation +} + +// Save creates the GroupHistory in the database. +func (ghc *GroupHistoryCreate) Save(ctx context.Context) (*GroupHistory, error) { + if err := ghc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ghc.sqlSave, ghc.mutation, ghc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ghc *GroupHistoryCreate) SaveX(ctx context.Context) *GroupHistory { + v, err := ghc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ghc *GroupHistoryCreate) Exec(ctx context.Context) error { + _, err := ghc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ghc *GroupHistoryCreate) ExecX(ctx context.Context) { + if err := ghc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ghc *GroupHistoryCreate) defaults() error { + if _, ok := ghc.mutation.HistoryTime(); !ok { + if grouphistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized grouphistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := grouphistory.DefaultHistoryTime() + ghc.mutation.SetHistoryTime(v) + } + if _, ok := ghc.mutation.CreatedAt(); !ok { + if grouphistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized grouphistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := grouphistory.DefaultCreatedAt() + ghc.mutation.SetCreatedAt(v) + } + if _, ok := ghc.mutation.UpdatedAt(); !ok { + if grouphistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized grouphistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := grouphistory.DefaultUpdatedAt() + ghc.mutation.SetUpdatedAt(v) + } + if _, ok := ghc.mutation.MappingID(); !ok { + if grouphistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized grouphistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := grouphistory.DefaultMappingID() + ghc.mutation.SetMappingID(v) + } + if _, ok := ghc.mutation.Tags(); !ok { + v := grouphistory.DefaultTags + ghc.mutation.SetTags(v) + } + if _, ok := ghc.mutation.DisplayName(); !ok { + v := grouphistory.DefaultDisplayName + ghc.mutation.SetDisplayName(v) + } + if _, ok := ghc.mutation.ID(); !ok { + if grouphistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized grouphistory.DefaultID (forgotten import generated/runtime?)") + } + v := grouphistory.DefaultID() + ghc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ghc *GroupHistoryCreate) check() error { + if _, ok := ghc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "GroupHistory.history_time"`)} + } + if _, ok := ghc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "GroupHistory.operation"`)} + } + if v, ok := ghc.mutation.Operation(); ok { + if err := grouphistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "GroupHistory.operation": %w`, err)} + } + } + if _, ok := ghc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "GroupHistory.mapping_id"`)} + } + if _, ok := ghc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "GroupHistory.name"`)} + } + if _, ok := ghc.mutation.DisplayName(); !ok { + return &ValidationError{Name: "display_name", err: errors.New(`generated: missing required field "GroupHistory.display_name"`)} + } + return nil +} + +func (ghc *GroupHistoryCreate) sqlSave(ctx context.Context) (*GroupHistory, error) { + if err := ghc.check(); err != nil { + return nil, err + } + _node, _spec := ghc.createSpec() + if err := sqlgraph.CreateNode(ctx, ghc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected GroupHistory.ID type: %T", _spec.ID.Value) + } + } + ghc.mutation.id = &_node.ID + ghc.mutation.done = true + return _node, nil +} + +func (ghc *GroupHistoryCreate) createSpec() (*GroupHistory, *sqlgraph.CreateSpec) { + var ( + _node = &GroupHistory{config: ghc.config} + _spec = sqlgraph.NewCreateSpec(grouphistory.Table, sqlgraph.NewFieldSpec(grouphistory.FieldID, field.TypeString)) + ) + _spec.Schema = ghc.schemaConfig.GroupHistory + if id, ok := ghc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ghc.mutation.HistoryTime(); ok { + _spec.SetField(grouphistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ghc.mutation.Ref(); ok { + _spec.SetField(grouphistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ghc.mutation.Operation(); ok { + _spec.SetField(grouphistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ghc.mutation.CreatedAt(); ok { + _spec.SetField(grouphistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ghc.mutation.UpdatedAt(); ok { + _spec.SetField(grouphistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ghc.mutation.CreatedBy(); ok { + _spec.SetField(grouphistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ghc.mutation.UpdatedBy(); ok { + _spec.SetField(grouphistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ghc.mutation.DeletedAt(); ok { + _spec.SetField(grouphistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ghc.mutation.DeletedBy(); ok { + _spec.SetField(grouphistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ghc.mutation.MappingID(); ok { + _spec.SetField(grouphistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ghc.mutation.Tags(); ok { + _spec.SetField(grouphistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ghc.mutation.OwnerID(); ok { + _spec.SetField(grouphistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ghc.mutation.Name(); ok { + _spec.SetField(grouphistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ghc.mutation.Description(); ok { + _spec.SetField(grouphistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := ghc.mutation.GravatarLogoURL(); ok { + _spec.SetField(grouphistory.FieldGravatarLogoURL, field.TypeString, value) + _node.GravatarLogoURL = value + } + if value, ok := ghc.mutation.LogoURL(); ok { + _spec.SetField(grouphistory.FieldLogoURL, field.TypeString, value) + _node.LogoURL = value + } + if value, ok := ghc.mutation.DisplayName(); ok { + _spec.SetField(grouphistory.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + return _node, _spec +} + +// GroupHistoryCreateBulk is the builder for creating many GroupHistory entities in bulk. +type GroupHistoryCreateBulk struct { + config + err error + builders []*GroupHistoryCreate +} + +// Save creates the GroupHistory entities in the database. +func (ghcb *GroupHistoryCreateBulk) Save(ctx context.Context) ([]*GroupHistory, error) { + if ghcb.err != nil { + return nil, ghcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ghcb.builders)) + nodes := make([]*GroupHistory, len(ghcb.builders)) + mutators := make([]Mutator, len(ghcb.builders)) + for i := range ghcb.builders { + func(i int, root context.Context) { + builder := ghcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*GroupHistoryMutation) + 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, ghcb.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, ghcb.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, ghcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ghcb *GroupHistoryCreateBulk) SaveX(ctx context.Context) []*GroupHistory { + v, err := ghcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ghcb *GroupHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ghcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ghcb *GroupHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ghcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/grouphistory_delete.go b/internal/ent/generated/grouphistory_delete.go new file mode 100644 index 0000000..6cdf24e --- /dev/null +++ b/internal/ent/generated/grouphistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupHistoryDelete is the builder for deleting a GroupHistory entity. +type GroupHistoryDelete struct { + config + hooks []Hook + mutation *GroupHistoryMutation +} + +// Where appends a list predicates to the GroupHistoryDelete builder. +func (ghd *GroupHistoryDelete) Where(ps ...predicate.GroupHistory) *GroupHistoryDelete { + ghd.mutation.Where(ps...) + return ghd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ghd *GroupHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ghd.sqlExec, ghd.mutation, ghd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ghd *GroupHistoryDelete) ExecX(ctx context.Context) int { + n, err := ghd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ghd *GroupHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(grouphistory.Table, sqlgraph.NewFieldSpec(grouphistory.FieldID, field.TypeString)) + _spec.Node.Schema = ghd.schemaConfig.GroupHistory + ctx = internal.NewSchemaConfigContext(ctx, ghd.schemaConfig) + if ps := ghd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ghd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ghd.mutation.done = true + return affected, err +} + +// GroupHistoryDeleteOne is the builder for deleting a single GroupHistory entity. +type GroupHistoryDeleteOne struct { + ghd *GroupHistoryDelete +} + +// Where appends a list predicates to the GroupHistoryDelete builder. +func (ghdo *GroupHistoryDeleteOne) Where(ps ...predicate.GroupHistory) *GroupHistoryDeleteOne { + ghdo.ghd.mutation.Where(ps...) + return ghdo +} + +// Exec executes the deletion query. +func (ghdo *GroupHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ghdo.ghd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{grouphistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ghdo *GroupHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ghdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/grouphistory_query.go b/internal/ent/generated/grouphistory_query.go new file mode 100644 index 0000000..3a413ac --- /dev/null +++ b/internal/ent/generated/grouphistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupHistoryQuery is the builder for querying GroupHistory entities. +type GroupHistoryQuery struct { + config + ctx *QueryContext + order []grouphistory.OrderOption + inters []Interceptor + predicates []predicate.GroupHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*GroupHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the GroupHistoryQuery builder. +func (ghq *GroupHistoryQuery) Where(ps ...predicate.GroupHistory) *GroupHistoryQuery { + ghq.predicates = append(ghq.predicates, ps...) + return ghq +} + +// Limit the number of records to be returned by this query. +func (ghq *GroupHistoryQuery) Limit(limit int) *GroupHistoryQuery { + ghq.ctx.Limit = &limit + return ghq +} + +// Offset to start from. +func (ghq *GroupHistoryQuery) Offset(offset int) *GroupHistoryQuery { + ghq.ctx.Offset = &offset + return ghq +} + +// 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 (ghq *GroupHistoryQuery) Unique(unique bool) *GroupHistoryQuery { + ghq.ctx.Unique = &unique + return ghq +} + +// Order specifies how the records should be ordered. +func (ghq *GroupHistoryQuery) Order(o ...grouphistory.OrderOption) *GroupHistoryQuery { + ghq.order = append(ghq.order, o...) + return ghq +} + +// First returns the first GroupHistory entity from the query. +// Returns a *NotFoundError when no GroupHistory was found. +func (ghq *GroupHistoryQuery) First(ctx context.Context) (*GroupHistory, error) { + nodes, err := ghq.Limit(1).All(setContextOp(ctx, ghq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{grouphistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ghq *GroupHistoryQuery) FirstX(ctx context.Context) *GroupHistory { + node, err := ghq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first GroupHistory ID from the query. +// Returns a *NotFoundError when no GroupHistory ID was found. +func (ghq *GroupHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ghq.Limit(1).IDs(setContextOp(ctx, ghq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{grouphistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ghq *GroupHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ghq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single GroupHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one GroupHistory entity is found. +// Returns a *NotFoundError when no GroupHistory entities are found. +func (ghq *GroupHistoryQuery) Only(ctx context.Context) (*GroupHistory, error) { + nodes, err := ghq.Limit(2).All(setContextOp(ctx, ghq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{grouphistory.Label} + default: + return nil, &NotSingularError{grouphistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ghq *GroupHistoryQuery) OnlyX(ctx context.Context) *GroupHistory { + node, err := ghq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only GroupHistory ID in the query. +// Returns a *NotSingularError when more than one GroupHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ghq *GroupHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ghq.Limit(2).IDs(setContextOp(ctx, ghq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{grouphistory.Label} + default: + err = &NotSingularError{grouphistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ghq *GroupHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ghq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of GroupHistories. +func (ghq *GroupHistoryQuery) All(ctx context.Context) ([]*GroupHistory, error) { + ctx = setContextOp(ctx, ghq.ctx, ent.OpQueryAll) + if err := ghq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*GroupHistory, *GroupHistoryQuery]() + return withInterceptors[[]*GroupHistory](ctx, ghq, qr, ghq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ghq *GroupHistoryQuery) AllX(ctx context.Context) []*GroupHistory { + nodes, err := ghq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of GroupHistory IDs. +func (ghq *GroupHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ghq.ctx.Unique == nil && ghq.path != nil { + ghq.Unique(true) + } + ctx = setContextOp(ctx, ghq.ctx, ent.OpQueryIDs) + if err = ghq.Select(grouphistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ghq *GroupHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ghq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ghq *GroupHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ghq.ctx, ent.OpQueryCount) + if err := ghq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ghq, querierCount[*GroupHistoryQuery](), ghq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ghq *GroupHistoryQuery) CountX(ctx context.Context) int { + count, err := ghq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ghq *GroupHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ghq.ctx, ent.OpQueryExist) + switch _, err := ghq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ghq *GroupHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ghq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the GroupHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ghq *GroupHistoryQuery) Clone() *GroupHistoryQuery { + if ghq == nil { + return nil + } + return &GroupHistoryQuery{ + config: ghq.config, + ctx: ghq.ctx.Clone(), + order: append([]grouphistory.OrderOption{}, ghq.order...), + inters: append([]Interceptor{}, ghq.inters...), + predicates: append([]predicate.GroupHistory{}, ghq.predicates...), + // clone intermediate query. + sql: ghq.sql.Clone(), + path: ghq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.GroupHistory.Query(). +// GroupBy(grouphistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ghq *GroupHistoryQuery) GroupBy(field string, fields ...string) *GroupHistoryGroupBy { + ghq.ctx.Fields = append([]string{field}, fields...) + grbuild := &GroupHistoryGroupBy{build: ghq} + grbuild.flds = &ghq.ctx.Fields + grbuild.label = grouphistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.GroupHistory.Query(). +// Select(grouphistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ghq *GroupHistoryQuery) Select(fields ...string) *GroupHistorySelect { + ghq.ctx.Fields = append(ghq.ctx.Fields, fields...) + sbuild := &GroupHistorySelect{GroupHistoryQuery: ghq} + sbuild.label = grouphistory.Label + sbuild.flds, sbuild.scan = &ghq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a GroupHistorySelect configured with the given aggregations. +func (ghq *GroupHistoryQuery) Aggregate(fns ...AggregateFunc) *GroupHistorySelect { + return ghq.Select().Aggregate(fns...) +} + +func (ghq *GroupHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ghq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ghq); err != nil { + return err + } + } + } + for _, f := range ghq.ctx.Fields { + if !grouphistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ghq.path != nil { + prev, err := ghq.path(ctx) + if err != nil { + return err + } + ghq.sql = prev + } + if grouphistory.Policy == nil { + return errors.New("generated: uninitialized grouphistory.Policy (forgotten import generated/runtime?)") + } + if err := grouphistory.Policy.EvalQuery(ctx, ghq); err != nil { + return err + } + return nil +} + +func (ghq *GroupHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GroupHistory, error) { + var ( + nodes = []*GroupHistory{} + _spec = ghq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*GroupHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &GroupHistory{config: ghq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ghq.schemaConfig.GroupHistory + ctx = internal.NewSchemaConfigContext(ctx, ghq.schemaConfig) + if len(ghq.modifiers) > 0 { + _spec.Modifiers = ghq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ghq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ghq.loadTotal { + if err := ghq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ghq *GroupHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ghq.querySpec() + _spec.Node.Schema = ghq.schemaConfig.GroupHistory + ctx = internal.NewSchemaConfigContext(ctx, ghq.schemaConfig) + if len(ghq.modifiers) > 0 { + _spec.Modifiers = ghq.modifiers + } + _spec.Node.Columns = ghq.ctx.Fields + if len(ghq.ctx.Fields) > 0 { + _spec.Unique = ghq.ctx.Unique != nil && *ghq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ghq.driver, _spec) +} + +func (ghq *GroupHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(grouphistory.Table, grouphistory.Columns, sqlgraph.NewFieldSpec(grouphistory.FieldID, field.TypeString)) + _spec.From = ghq.sql + if unique := ghq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ghq.path != nil { + _spec.Unique = true + } + if fields := ghq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, grouphistory.FieldID) + for i := range fields { + if fields[i] != grouphistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ghq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ghq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ghq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ghq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ghq *GroupHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ghq.driver.Dialect()) + t1 := builder.Table(grouphistory.Table) + columns := ghq.ctx.Fields + if len(columns) == 0 { + columns = grouphistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ghq.sql != nil { + selector = ghq.sql + selector.Select(selector.Columns(columns...)...) + } + if ghq.ctx.Unique != nil && *ghq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ghq.schemaConfig.GroupHistory) + ctx = internal.NewSchemaConfigContext(ctx, ghq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ghq.predicates { + p(selector) + } + for _, p := range ghq.order { + p(selector) + } + if offset := ghq.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 := ghq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// GroupHistoryGroupBy is the group-by builder for GroupHistory entities. +type GroupHistoryGroupBy struct { + selector + build *GroupHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ghgb *GroupHistoryGroupBy) Aggregate(fns ...AggregateFunc) *GroupHistoryGroupBy { + ghgb.fns = append(ghgb.fns, fns...) + return ghgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ghgb *GroupHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ghgb.build.ctx, ent.OpQueryGroupBy) + if err := ghgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupHistoryQuery, *GroupHistoryGroupBy](ctx, ghgb.build, ghgb, ghgb.build.inters, v) +} + +func (ghgb *GroupHistoryGroupBy) sqlScan(ctx context.Context, root *GroupHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ghgb.fns)) + for _, fn := range ghgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ghgb.flds)+len(ghgb.fns)) + for _, f := range *ghgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ghgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ghgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// GroupHistorySelect is the builder for selecting fields of GroupHistory entities. +type GroupHistorySelect struct { + *GroupHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ghs *GroupHistorySelect) Aggregate(fns ...AggregateFunc) *GroupHistorySelect { + ghs.fns = append(ghs.fns, fns...) + return ghs +} + +// Scan applies the selector query and scans the result into the given value. +func (ghs *GroupHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ghs.ctx, ent.OpQuerySelect) + if err := ghs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupHistoryQuery, *GroupHistorySelect](ctx, ghs.GroupHistoryQuery, ghs, ghs.inters, v) +} + +func (ghs *GroupHistorySelect) sqlScan(ctx context.Context, root *GroupHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ghs.fns)) + for _, fn := range ghs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ghs.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 := ghs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/grouphistory_update.go b/internal/ent/generated/grouphistory_update.go new file mode 100644 index 0000000..2a34ebe --- /dev/null +++ b/internal/ent/generated/grouphistory_update.go @@ -0,0 +1,757 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupHistoryUpdate is the builder for updating GroupHistory entities. +type GroupHistoryUpdate struct { + config + hooks []Hook + mutation *GroupHistoryMutation +} + +// Where appends a list predicates to the GroupHistoryUpdate builder. +func (ghu *GroupHistoryUpdate) Where(ps ...predicate.GroupHistory) *GroupHistoryUpdate { + ghu.mutation.Where(ps...) + return ghu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ghu *GroupHistoryUpdate) SetUpdatedAt(t time.Time) *GroupHistoryUpdate { + ghu.mutation.SetUpdatedAt(t) + return ghu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ghu *GroupHistoryUpdate) ClearUpdatedAt() *GroupHistoryUpdate { + ghu.mutation.ClearUpdatedAt() + return ghu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ghu *GroupHistoryUpdate) SetUpdatedBy(s string) *GroupHistoryUpdate { + ghu.mutation.SetUpdatedBy(s) + return ghu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableUpdatedBy(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetUpdatedBy(*s) + } + return ghu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ghu *GroupHistoryUpdate) ClearUpdatedBy() *GroupHistoryUpdate { + ghu.mutation.ClearUpdatedBy() + return ghu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ghu *GroupHistoryUpdate) SetDeletedAt(t time.Time) *GroupHistoryUpdate { + ghu.mutation.SetDeletedAt(t) + return ghu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableDeletedAt(t *time.Time) *GroupHistoryUpdate { + if t != nil { + ghu.SetDeletedAt(*t) + } + return ghu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ghu *GroupHistoryUpdate) ClearDeletedAt() *GroupHistoryUpdate { + ghu.mutation.ClearDeletedAt() + return ghu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ghu *GroupHistoryUpdate) SetDeletedBy(s string) *GroupHistoryUpdate { + ghu.mutation.SetDeletedBy(s) + return ghu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableDeletedBy(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetDeletedBy(*s) + } + return ghu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ghu *GroupHistoryUpdate) ClearDeletedBy() *GroupHistoryUpdate { + ghu.mutation.ClearDeletedBy() + return ghu +} + +// SetTags sets the "tags" field. +func (ghu *GroupHistoryUpdate) SetTags(s []string) *GroupHistoryUpdate { + ghu.mutation.SetTags(s) + return ghu +} + +// AppendTags appends s to the "tags" field. +func (ghu *GroupHistoryUpdate) AppendTags(s []string) *GroupHistoryUpdate { + ghu.mutation.AppendTags(s) + return ghu +} + +// ClearTags clears the value of the "tags" field. +func (ghu *GroupHistoryUpdate) ClearTags() *GroupHistoryUpdate { + ghu.mutation.ClearTags() + return ghu +} + +// SetOwnerID sets the "owner_id" field. +func (ghu *GroupHistoryUpdate) SetOwnerID(s string) *GroupHistoryUpdate { + ghu.mutation.SetOwnerID(s) + return ghu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableOwnerID(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetOwnerID(*s) + } + return ghu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ghu *GroupHistoryUpdate) ClearOwnerID() *GroupHistoryUpdate { + ghu.mutation.ClearOwnerID() + return ghu +} + +// SetName sets the "name" field. +func (ghu *GroupHistoryUpdate) SetName(s string) *GroupHistoryUpdate { + ghu.mutation.SetName(s) + return ghu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableName(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetName(*s) + } + return ghu +} + +// SetDescription sets the "description" field. +func (ghu *GroupHistoryUpdate) SetDescription(s string) *GroupHistoryUpdate { + ghu.mutation.SetDescription(s) + return ghu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableDescription(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetDescription(*s) + } + return ghu +} + +// ClearDescription clears the value of the "description" field. +func (ghu *GroupHistoryUpdate) ClearDescription() *GroupHistoryUpdate { + ghu.mutation.ClearDescription() + return ghu +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (ghu *GroupHistoryUpdate) SetGravatarLogoURL(s string) *GroupHistoryUpdate { + ghu.mutation.SetGravatarLogoURL(s) + return ghu +} + +// SetNillableGravatarLogoURL sets the "gravatar_logo_url" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableGravatarLogoURL(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetGravatarLogoURL(*s) + } + return ghu +} + +// ClearGravatarLogoURL clears the value of the "gravatar_logo_url" field. +func (ghu *GroupHistoryUpdate) ClearGravatarLogoURL() *GroupHistoryUpdate { + ghu.mutation.ClearGravatarLogoURL() + return ghu +} + +// SetLogoURL sets the "logo_url" field. +func (ghu *GroupHistoryUpdate) SetLogoURL(s string) *GroupHistoryUpdate { + ghu.mutation.SetLogoURL(s) + return ghu +} + +// SetNillableLogoURL sets the "logo_url" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableLogoURL(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetLogoURL(*s) + } + return ghu +} + +// ClearLogoURL clears the value of the "logo_url" field. +func (ghu *GroupHistoryUpdate) ClearLogoURL() *GroupHistoryUpdate { + ghu.mutation.ClearLogoURL() + return ghu +} + +// SetDisplayName sets the "display_name" field. +func (ghu *GroupHistoryUpdate) SetDisplayName(s string) *GroupHistoryUpdate { + ghu.mutation.SetDisplayName(s) + return ghu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ghu *GroupHistoryUpdate) SetNillableDisplayName(s *string) *GroupHistoryUpdate { + if s != nil { + ghu.SetDisplayName(*s) + } + return ghu +} + +// Mutation returns the GroupHistoryMutation object of the builder. +func (ghu *GroupHistoryUpdate) Mutation() *GroupHistoryMutation { + return ghu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ghu *GroupHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ghu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ghu.sqlSave, ghu.mutation, ghu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ghu *GroupHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ghu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ghu *GroupHistoryUpdate) Exec(ctx context.Context) error { + _, err := ghu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ghu *GroupHistoryUpdate) ExecX(ctx context.Context) { + if err := ghu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ghu *GroupHistoryUpdate) defaults() error { + if _, ok := ghu.mutation.UpdatedAt(); !ok && !ghu.mutation.UpdatedAtCleared() { + if grouphistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized grouphistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := grouphistory.UpdateDefaultUpdatedAt() + ghu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ghu *GroupHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(grouphistory.Table, grouphistory.Columns, sqlgraph.NewFieldSpec(grouphistory.FieldID, field.TypeString)) + if ps := ghu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ghu.mutation.RefCleared() { + _spec.ClearField(grouphistory.FieldRef, field.TypeString) + } + if ghu.mutation.CreatedAtCleared() { + _spec.ClearField(grouphistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ghu.mutation.UpdatedAt(); ok { + _spec.SetField(grouphistory.FieldUpdatedAt, field.TypeTime, value) + } + if ghu.mutation.UpdatedAtCleared() { + _spec.ClearField(grouphistory.FieldUpdatedAt, field.TypeTime) + } + if ghu.mutation.CreatedByCleared() { + _spec.ClearField(grouphistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ghu.mutation.UpdatedBy(); ok { + _spec.SetField(grouphistory.FieldUpdatedBy, field.TypeString, value) + } + if ghu.mutation.UpdatedByCleared() { + _spec.ClearField(grouphistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ghu.mutation.DeletedAt(); ok { + _spec.SetField(grouphistory.FieldDeletedAt, field.TypeTime, value) + } + if ghu.mutation.DeletedAtCleared() { + _spec.ClearField(grouphistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ghu.mutation.DeletedBy(); ok { + _spec.SetField(grouphistory.FieldDeletedBy, field.TypeString, value) + } + if ghu.mutation.DeletedByCleared() { + _spec.ClearField(grouphistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ghu.mutation.Tags(); ok { + _spec.SetField(grouphistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ghu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, grouphistory.FieldTags, value) + }) + } + if ghu.mutation.TagsCleared() { + _spec.ClearField(grouphistory.FieldTags, field.TypeJSON) + } + if value, ok := ghu.mutation.OwnerID(); ok { + _spec.SetField(grouphistory.FieldOwnerID, field.TypeString, value) + } + if ghu.mutation.OwnerIDCleared() { + _spec.ClearField(grouphistory.FieldOwnerID, field.TypeString) + } + if value, ok := ghu.mutation.Name(); ok { + _spec.SetField(grouphistory.FieldName, field.TypeString, value) + } + if value, ok := ghu.mutation.Description(); ok { + _spec.SetField(grouphistory.FieldDescription, field.TypeString, value) + } + if ghu.mutation.DescriptionCleared() { + _spec.ClearField(grouphistory.FieldDescription, field.TypeString) + } + if value, ok := ghu.mutation.GravatarLogoURL(); ok { + _spec.SetField(grouphistory.FieldGravatarLogoURL, field.TypeString, value) + } + if ghu.mutation.GravatarLogoURLCleared() { + _spec.ClearField(grouphistory.FieldGravatarLogoURL, field.TypeString) + } + if value, ok := ghu.mutation.LogoURL(); ok { + _spec.SetField(grouphistory.FieldLogoURL, field.TypeString, value) + } + if ghu.mutation.LogoURLCleared() { + _spec.ClearField(grouphistory.FieldLogoURL, field.TypeString) + } + if value, ok := ghu.mutation.DisplayName(); ok { + _spec.SetField(grouphistory.FieldDisplayName, field.TypeString, value) + } + _spec.Node.Schema = ghu.schemaConfig.GroupHistory + ctx = internal.NewSchemaConfigContext(ctx, ghu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ghu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{grouphistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ghu.mutation.done = true + return n, nil +} + +// GroupHistoryUpdateOne is the builder for updating a single GroupHistory entity. +type GroupHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *GroupHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ghuo *GroupHistoryUpdateOne) SetUpdatedAt(t time.Time) *GroupHistoryUpdateOne { + ghuo.mutation.SetUpdatedAt(t) + return ghuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ghuo *GroupHistoryUpdateOne) ClearUpdatedAt() *GroupHistoryUpdateOne { + ghuo.mutation.ClearUpdatedAt() + return ghuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ghuo *GroupHistoryUpdateOne) SetUpdatedBy(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetUpdatedBy(s) + return ghuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableUpdatedBy(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetUpdatedBy(*s) + } + return ghuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ghuo *GroupHistoryUpdateOne) ClearUpdatedBy() *GroupHistoryUpdateOne { + ghuo.mutation.ClearUpdatedBy() + return ghuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ghuo *GroupHistoryUpdateOne) SetDeletedAt(t time.Time) *GroupHistoryUpdateOne { + ghuo.mutation.SetDeletedAt(t) + return ghuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *GroupHistoryUpdateOne { + if t != nil { + ghuo.SetDeletedAt(*t) + } + return ghuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ghuo *GroupHistoryUpdateOne) ClearDeletedAt() *GroupHistoryUpdateOne { + ghuo.mutation.ClearDeletedAt() + return ghuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ghuo *GroupHistoryUpdateOne) SetDeletedBy(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetDeletedBy(s) + return ghuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableDeletedBy(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetDeletedBy(*s) + } + return ghuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ghuo *GroupHistoryUpdateOne) ClearDeletedBy() *GroupHistoryUpdateOne { + ghuo.mutation.ClearDeletedBy() + return ghuo +} + +// SetTags sets the "tags" field. +func (ghuo *GroupHistoryUpdateOne) SetTags(s []string) *GroupHistoryUpdateOne { + ghuo.mutation.SetTags(s) + return ghuo +} + +// AppendTags appends s to the "tags" field. +func (ghuo *GroupHistoryUpdateOne) AppendTags(s []string) *GroupHistoryUpdateOne { + ghuo.mutation.AppendTags(s) + return ghuo +} + +// ClearTags clears the value of the "tags" field. +func (ghuo *GroupHistoryUpdateOne) ClearTags() *GroupHistoryUpdateOne { + ghuo.mutation.ClearTags() + return ghuo +} + +// SetOwnerID sets the "owner_id" field. +func (ghuo *GroupHistoryUpdateOne) SetOwnerID(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetOwnerID(s) + return ghuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableOwnerID(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetOwnerID(*s) + } + return ghuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ghuo *GroupHistoryUpdateOne) ClearOwnerID() *GroupHistoryUpdateOne { + ghuo.mutation.ClearOwnerID() + return ghuo +} + +// SetName sets the "name" field. +func (ghuo *GroupHistoryUpdateOne) SetName(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetName(s) + return ghuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableName(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetName(*s) + } + return ghuo +} + +// SetDescription sets the "description" field. +func (ghuo *GroupHistoryUpdateOne) SetDescription(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetDescription(s) + return ghuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableDescription(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetDescription(*s) + } + return ghuo +} + +// ClearDescription clears the value of the "description" field. +func (ghuo *GroupHistoryUpdateOne) ClearDescription() *GroupHistoryUpdateOne { + ghuo.mutation.ClearDescription() + return ghuo +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (ghuo *GroupHistoryUpdateOne) SetGravatarLogoURL(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetGravatarLogoURL(s) + return ghuo +} + +// SetNillableGravatarLogoURL sets the "gravatar_logo_url" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableGravatarLogoURL(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetGravatarLogoURL(*s) + } + return ghuo +} + +// ClearGravatarLogoURL clears the value of the "gravatar_logo_url" field. +func (ghuo *GroupHistoryUpdateOne) ClearGravatarLogoURL() *GroupHistoryUpdateOne { + ghuo.mutation.ClearGravatarLogoURL() + return ghuo +} + +// SetLogoURL sets the "logo_url" field. +func (ghuo *GroupHistoryUpdateOne) SetLogoURL(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetLogoURL(s) + return ghuo +} + +// SetNillableLogoURL sets the "logo_url" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableLogoURL(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetLogoURL(*s) + } + return ghuo +} + +// ClearLogoURL clears the value of the "logo_url" field. +func (ghuo *GroupHistoryUpdateOne) ClearLogoURL() *GroupHistoryUpdateOne { + ghuo.mutation.ClearLogoURL() + return ghuo +} + +// SetDisplayName sets the "display_name" field. +func (ghuo *GroupHistoryUpdateOne) SetDisplayName(s string) *GroupHistoryUpdateOne { + ghuo.mutation.SetDisplayName(s) + return ghuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ghuo *GroupHistoryUpdateOne) SetNillableDisplayName(s *string) *GroupHistoryUpdateOne { + if s != nil { + ghuo.SetDisplayName(*s) + } + return ghuo +} + +// Mutation returns the GroupHistoryMutation object of the builder. +func (ghuo *GroupHistoryUpdateOne) Mutation() *GroupHistoryMutation { + return ghuo.mutation +} + +// Where appends a list predicates to the GroupHistoryUpdate builder. +func (ghuo *GroupHistoryUpdateOne) Where(ps ...predicate.GroupHistory) *GroupHistoryUpdateOne { + ghuo.mutation.Where(ps...) + return ghuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ghuo *GroupHistoryUpdateOne) Select(field string, fields ...string) *GroupHistoryUpdateOne { + ghuo.fields = append([]string{field}, fields...) + return ghuo +} + +// Save executes the query and returns the updated GroupHistory entity. +func (ghuo *GroupHistoryUpdateOne) Save(ctx context.Context) (*GroupHistory, error) { + if err := ghuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ghuo.sqlSave, ghuo.mutation, ghuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ghuo *GroupHistoryUpdateOne) SaveX(ctx context.Context) *GroupHistory { + node, err := ghuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ghuo *GroupHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ghuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ghuo *GroupHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ghuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ghuo *GroupHistoryUpdateOne) defaults() error { + if _, ok := ghuo.mutation.UpdatedAt(); !ok && !ghuo.mutation.UpdatedAtCleared() { + if grouphistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized grouphistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := grouphistory.UpdateDefaultUpdatedAt() + ghuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ghuo *GroupHistoryUpdateOne) sqlSave(ctx context.Context) (_node *GroupHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(grouphistory.Table, grouphistory.Columns, sqlgraph.NewFieldSpec(grouphistory.FieldID, field.TypeString)) + id, ok := ghuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "GroupHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ghuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, grouphistory.FieldID) + for _, f := range fields { + if !grouphistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != grouphistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ghuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ghuo.mutation.RefCleared() { + _spec.ClearField(grouphistory.FieldRef, field.TypeString) + } + if ghuo.mutation.CreatedAtCleared() { + _spec.ClearField(grouphistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ghuo.mutation.UpdatedAt(); ok { + _spec.SetField(grouphistory.FieldUpdatedAt, field.TypeTime, value) + } + if ghuo.mutation.UpdatedAtCleared() { + _spec.ClearField(grouphistory.FieldUpdatedAt, field.TypeTime) + } + if ghuo.mutation.CreatedByCleared() { + _spec.ClearField(grouphistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ghuo.mutation.UpdatedBy(); ok { + _spec.SetField(grouphistory.FieldUpdatedBy, field.TypeString, value) + } + if ghuo.mutation.UpdatedByCleared() { + _spec.ClearField(grouphistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ghuo.mutation.DeletedAt(); ok { + _spec.SetField(grouphistory.FieldDeletedAt, field.TypeTime, value) + } + if ghuo.mutation.DeletedAtCleared() { + _spec.ClearField(grouphistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ghuo.mutation.DeletedBy(); ok { + _spec.SetField(grouphistory.FieldDeletedBy, field.TypeString, value) + } + if ghuo.mutation.DeletedByCleared() { + _spec.ClearField(grouphistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ghuo.mutation.Tags(); ok { + _spec.SetField(grouphistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ghuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, grouphistory.FieldTags, value) + }) + } + if ghuo.mutation.TagsCleared() { + _spec.ClearField(grouphistory.FieldTags, field.TypeJSON) + } + if value, ok := ghuo.mutation.OwnerID(); ok { + _spec.SetField(grouphistory.FieldOwnerID, field.TypeString, value) + } + if ghuo.mutation.OwnerIDCleared() { + _spec.ClearField(grouphistory.FieldOwnerID, field.TypeString) + } + if value, ok := ghuo.mutation.Name(); ok { + _spec.SetField(grouphistory.FieldName, field.TypeString, value) + } + if value, ok := ghuo.mutation.Description(); ok { + _spec.SetField(grouphistory.FieldDescription, field.TypeString, value) + } + if ghuo.mutation.DescriptionCleared() { + _spec.ClearField(grouphistory.FieldDescription, field.TypeString) + } + if value, ok := ghuo.mutation.GravatarLogoURL(); ok { + _spec.SetField(grouphistory.FieldGravatarLogoURL, field.TypeString, value) + } + if ghuo.mutation.GravatarLogoURLCleared() { + _spec.ClearField(grouphistory.FieldGravatarLogoURL, field.TypeString) + } + if value, ok := ghuo.mutation.LogoURL(); ok { + _spec.SetField(grouphistory.FieldLogoURL, field.TypeString, value) + } + if ghuo.mutation.LogoURLCleared() { + _spec.ClearField(grouphistory.FieldLogoURL, field.TypeString) + } + if value, ok := ghuo.mutation.DisplayName(); ok { + _spec.SetField(grouphistory.FieldDisplayName, field.TypeString, value) + } + _spec.Node.Schema = ghuo.schemaConfig.GroupHistory + ctx = internal.NewSchemaConfigContext(ctx, ghuo.schemaConfig) + _node = &GroupHistory{config: ghuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ghuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{grouphistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ghuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/groupmembership.go b/internal/ent/generated/groupmembership.go new file mode 100644 index 0000000..a75292c --- /dev/null +++ b/internal/ent/generated/groupmembership.go @@ -0,0 +1,296 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/pkg/enums" +) + +// GroupMembership is the model entity for the GroupMembership schema. +type GroupMembership struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // Role holds the value of the "role" field. + Role enums.Role `json:"role,omitempty"` + // GroupID holds the value of the "group_id" field. + GroupID string `json:"group_id,omitempty"` + // UserID holds the value of the "user_id" field. + UserID string `json:"user_id,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the GroupMembershipQuery when eager-loading is set. + Edges GroupMembershipEdges `json:"edges"` + selectValues sql.SelectValues +} + +// GroupMembershipEdges holds the relations/edges for other nodes in the graph. +type GroupMembershipEdges struct { + // Group holds the value of the group edge. + Group *Group `json:"group,omitempty"` + // User holds the value of the user edge. + User *User `json:"user,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [3]bool + // totalCount holds the count of the edges above. + totalCount [3]map[string]int + + namedEvents map[string][]*Event +} + +// GroupOrErr returns the Group value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e GroupMembershipEdges) GroupOrErr() (*Group, error) { + if e.Group != nil { + return e.Group, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: group.Label} + } + return nil, &NotLoadedError{edge: "group"} +} + +// UserOrErr returns the User value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e GroupMembershipEdges) UserOrErr() (*User, error) { + if e.User != nil { + return e.User, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "user"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e GroupMembershipEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[2] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*GroupMembership) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case groupmembership.FieldID, groupmembership.FieldCreatedBy, groupmembership.FieldUpdatedBy, groupmembership.FieldMappingID, groupmembership.FieldDeletedBy, groupmembership.FieldRole, groupmembership.FieldGroupID, groupmembership.FieldUserID: + values[i] = new(sql.NullString) + case groupmembership.FieldCreatedAt, groupmembership.FieldUpdatedAt, groupmembership.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the GroupMembership fields. +func (gm *GroupMembership) 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 groupmembership.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + gm.ID = value.String + } + case groupmembership.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + gm.CreatedAt = value.Time + } + case groupmembership.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + gm.UpdatedAt = value.Time + } + case groupmembership.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + gm.CreatedBy = value.String + } + case groupmembership.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + gm.UpdatedBy = value.String + } + case groupmembership.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + gm.MappingID = value.String + } + case groupmembership.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + gm.DeletedAt = value.Time + } + case groupmembership.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + gm.DeletedBy = value.String + } + case groupmembership.FieldRole: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field role", values[i]) + } else if value.Valid { + gm.Role = enums.Role(value.String) + } + case groupmembership.FieldGroupID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field group_id", values[i]) + } else if value.Valid { + gm.GroupID = value.String + } + case groupmembership.FieldUserID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_id", values[i]) + } else if value.Valid { + gm.UserID = value.String + } + default: + gm.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the GroupMembership. +// This includes values selected through modifiers, order, etc. +func (gm *GroupMembership) Value(name string) (ent.Value, error) { + return gm.selectValues.Get(name) +} + +// QueryGroup queries the "group" edge of the GroupMembership entity. +func (gm *GroupMembership) QueryGroup() *GroupQuery { + return NewGroupMembershipClient(gm.config).QueryGroup(gm) +} + +// QueryUser queries the "user" edge of the GroupMembership entity. +func (gm *GroupMembership) QueryUser() *UserQuery { + return NewGroupMembershipClient(gm.config).QueryUser(gm) +} + +// QueryEvents queries the "events" edge of the GroupMembership entity. +func (gm *GroupMembership) QueryEvents() *EventQuery { + return NewGroupMembershipClient(gm.config).QueryEvents(gm) +} + +// Update returns a builder for updating this GroupMembership. +// Note that you need to call GroupMembership.Unwrap() before calling this method if this GroupMembership +// was returned from a transaction, and the transaction was committed or rolled back. +func (gm *GroupMembership) Update() *GroupMembershipUpdateOne { + return NewGroupMembershipClient(gm.config).UpdateOne(gm) +} + +// Unwrap unwraps the GroupMembership 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 (gm *GroupMembership) Unwrap() *GroupMembership { + _tx, ok := gm.config.driver.(*txDriver) + if !ok { + panic("generated: GroupMembership is not a transactional entity") + } + gm.config.driver = _tx.drv + return gm +} + +// String implements the fmt.Stringer. +func (gm *GroupMembership) String() string { + var builder strings.Builder + builder.WriteString("GroupMembership(") + builder.WriteString(fmt.Sprintf("id=%v, ", gm.ID)) + builder.WriteString("created_at=") + builder.WriteString(gm.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(gm.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(gm.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(gm.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(gm.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(gm.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(gm.DeletedBy) + builder.WriteString(", ") + builder.WriteString("role=") + builder.WriteString(fmt.Sprintf("%v", gm.Role)) + builder.WriteString(", ") + builder.WriteString("group_id=") + builder.WriteString(gm.GroupID) + builder.WriteString(", ") + builder.WriteString("user_id=") + builder.WriteString(gm.UserID) + builder.WriteByte(')') + return builder.String() +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (gm *GroupMembership) NamedEvents(name string) ([]*Event, error) { + if gm.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := gm.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (gm *GroupMembership) appendNamedEvents(name string, edges ...*Event) { + if gm.Edges.namedEvents == nil { + gm.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + gm.Edges.namedEvents[name] = []*Event{} + } else { + gm.Edges.namedEvents[name] = append(gm.Edges.namedEvents[name], edges...) + } +} + +// GroupMemberships is a parsable slice of GroupMembership. +type GroupMemberships []*GroupMembership diff --git a/internal/ent/generated/groupmembership/groupmembership.go b/internal/ent/generated/groupmembership/groupmembership.go new file mode 100644 index 0000000..a2e0174 --- /dev/null +++ b/internal/ent/generated/groupmembership/groupmembership.go @@ -0,0 +1,246 @@ +// Code generated by ent, DO NOT EDIT. + +package groupmembership + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the groupmembership type in the database. + Label = "group_membership" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldRole holds the string denoting the role field in the database. + FieldRole = "role" + // FieldGroupID holds the string denoting the group_id field in the database. + FieldGroupID = "group_id" + // FieldUserID holds the string denoting the user_id field in the database. + FieldUserID = "user_id" + // EdgeGroup holds the string denoting the group edge name in mutations. + EdgeGroup = "group" + // EdgeUser holds the string denoting the user edge name in mutations. + EdgeUser = "user" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the groupmembership in the database. + Table = "group_memberships" + // GroupTable is the table that holds the group relation/edge. + GroupTable = "group_memberships" + // GroupInverseTable is the table name for the Group entity. + // It exists in this package in order to avoid circular dependency with the "group" package. + GroupInverseTable = "groups" + // GroupColumn is the table column denoting the group relation/edge. + GroupColumn = "group_id" + // UserTable is the table that holds the user relation/edge. + UserTable = "group_memberships" + // UserInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + UserInverseTable = "users" + // UserColumn is the table column denoting the user relation/edge. + UserColumn = "user_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "group_membership_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for groupmembership fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldRole, + FieldGroupID, + FieldUserID, +} + +var ( + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"group_membership_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultRole enums.Role = "MEMBER" + +// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save. +func RoleValidator(r enums.Role) error { + switch r.String() { + case "ADMIN", "MEMBER", "USER": + return nil + default: + return fmt.Errorf("groupmembership: invalid enum value for role field: %q", r) + } +} + +// OrderOption defines the ordering options for the GroupMembership queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByRole orders the results by the role field. +func ByRole(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRole, opts...).ToFunc() +} + +// ByGroupID orders the results by the group_id field. +func ByGroupID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGroupID, opts...).ToFunc() +} + +// ByUserID orders the results by the user_id field. +func ByUserID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserID, opts...).ToFunc() +} + +// ByGroupField orders the results by group field. +func ByGroupField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupStep(), sql.OrderByField(field, opts...)) + } +} + +// ByUserField orders the results by user field. +func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newGroupStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, GroupTable, GroupColumn), + ) +} +func newUserStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(UserInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, UserTable, UserColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} + +var ( + // enums.Role must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Role)(nil) + // enums.Role must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Role)(nil) +) diff --git a/internal/ent/generated/groupmembership/where.go b/internal/ent/generated/groupmembership/where.go new file mode 100644 index 0000000..b7782af --- /dev/null +++ b/internal/ent/generated/groupmembership/where.go @@ -0,0 +1,816 @@ +// Code generated by ent, DO NOT EDIT. + +package groupmembership + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldDeletedBy, v)) +} + +// GroupID applies equality check predicate on the "group_id" field. It's identical to GroupIDEQ. +func GroupID(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldGroupID, v)) +} + +// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. +func UserID(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldUserID, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v enums.Role) predicate.GroupMembership { + vc := v + return predicate.GroupMembership(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v enums.Role) predicate.GroupMembership { + vc := v + return predicate.GroupMembership(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...enums.Role) predicate.GroupMembership { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupMembership(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...enums.Role) predicate.GroupMembership { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupMembership(sql.FieldNotIn(FieldRole, v...)) +} + +// GroupIDEQ applies the EQ predicate on the "group_id" field. +func GroupIDEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldGroupID, v)) +} + +// GroupIDNEQ applies the NEQ predicate on the "group_id" field. +func GroupIDNEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldGroupID, v)) +} + +// GroupIDIn applies the In predicate on the "group_id" field. +func GroupIDIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldGroupID, vs...)) +} + +// GroupIDNotIn applies the NotIn predicate on the "group_id" field. +func GroupIDNotIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldGroupID, vs...)) +} + +// GroupIDGT applies the GT predicate on the "group_id" field. +func GroupIDGT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldGroupID, v)) +} + +// GroupIDGTE applies the GTE predicate on the "group_id" field. +func GroupIDGTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldGroupID, v)) +} + +// GroupIDLT applies the LT predicate on the "group_id" field. +func GroupIDLT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldGroupID, v)) +} + +// GroupIDLTE applies the LTE predicate on the "group_id" field. +func GroupIDLTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldGroupID, v)) +} + +// GroupIDContains applies the Contains predicate on the "group_id" field. +func GroupIDContains(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContains(FieldGroupID, v)) +} + +// GroupIDHasPrefix applies the HasPrefix predicate on the "group_id" field. +func GroupIDHasPrefix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasPrefix(FieldGroupID, v)) +} + +// GroupIDHasSuffix applies the HasSuffix predicate on the "group_id" field. +func GroupIDHasSuffix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasSuffix(FieldGroupID, v)) +} + +// GroupIDEqualFold applies the EqualFold predicate on the "group_id" field. +func GroupIDEqualFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEqualFold(FieldGroupID, v)) +} + +// GroupIDContainsFold applies the ContainsFold predicate on the "group_id" field. +func GroupIDContainsFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContainsFold(FieldGroupID, v)) +} + +// UserIDEQ applies the EQ predicate on the "user_id" field. +func UserIDEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEQ(FieldUserID, v)) +} + +// UserIDNEQ applies the NEQ predicate on the "user_id" field. +func UserIDNEQ(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNEQ(FieldUserID, v)) +} + +// UserIDIn applies the In predicate on the "user_id" field. +func UserIDIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldIn(FieldUserID, vs...)) +} + +// UserIDNotIn applies the NotIn predicate on the "user_id" field. +func UserIDNotIn(vs ...string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldNotIn(FieldUserID, vs...)) +} + +// UserIDGT applies the GT predicate on the "user_id" field. +func UserIDGT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGT(FieldUserID, v)) +} + +// UserIDGTE applies the GTE predicate on the "user_id" field. +func UserIDGTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldGTE(FieldUserID, v)) +} + +// UserIDLT applies the LT predicate on the "user_id" field. +func UserIDLT(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLT(FieldUserID, v)) +} + +// UserIDLTE applies the LTE predicate on the "user_id" field. +func UserIDLTE(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldLTE(FieldUserID, v)) +} + +// UserIDContains applies the Contains predicate on the "user_id" field. +func UserIDContains(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContains(FieldUserID, v)) +} + +// UserIDHasPrefix applies the HasPrefix predicate on the "user_id" field. +func UserIDHasPrefix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasPrefix(FieldUserID, v)) +} + +// UserIDHasSuffix applies the HasSuffix predicate on the "user_id" field. +func UserIDHasSuffix(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldHasSuffix(FieldUserID, v)) +} + +// UserIDEqualFold applies the EqualFold predicate on the "user_id" field. +func UserIDEqualFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldEqualFold(FieldUserID, v)) +} + +// UserIDContainsFold applies the ContainsFold predicate on the "user_id" field. +func UserIDContainsFold(v string) predicate.GroupMembership { + return predicate.GroupMembership(sql.FieldContainsFold(FieldUserID, v)) +} + +// HasGroup applies the HasEdge predicate on the "group" edge. +func HasGroup() predicate.GroupMembership { + return predicate.GroupMembership(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, GroupTable, GroupColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates). +func HasGroupWith(preds ...predicate.Group) predicate.GroupMembership { + return predicate.GroupMembership(func(s *sql.Selector) { + step := newGroupStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasUser applies the HasEdge predicate on the "user" edge. +func HasUser() predicate.GroupMembership { + return predicate.GroupMembership(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, UserTable, UserColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates). +func HasUserWith(preds ...predicate.User) predicate.GroupMembership { + return predicate.GroupMembership(func(s *sql.Selector) { + step := newUserStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.GroupMembership { + return predicate.GroupMembership(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupMembershipEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.GroupMembership { + return predicate.GroupMembership(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupMembershipEvents + 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.GroupMembership) predicate.GroupMembership { + return predicate.GroupMembership(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.GroupMembership) predicate.GroupMembership { + return predicate.GroupMembership(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.GroupMembership) predicate.GroupMembership { + return predicate.GroupMembership(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/groupmembership_create.go b/internal/ent/generated/groupmembership_create.go new file mode 100644 index 0000000..3b935f7 --- /dev/null +++ b/internal/ent/generated/groupmembership_create.go @@ -0,0 +1,493 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/pkg/enums" +) + +// GroupMembershipCreate is the builder for creating a GroupMembership entity. +type GroupMembershipCreate struct { + config + mutation *GroupMembershipMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (gmc *GroupMembershipCreate) SetCreatedAt(t time.Time) *GroupMembershipCreate { + gmc.mutation.SetCreatedAt(t) + return gmc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableCreatedAt(t *time.Time) *GroupMembershipCreate { + if t != nil { + gmc.SetCreatedAt(*t) + } + return gmc +} + +// SetUpdatedAt sets the "updated_at" field. +func (gmc *GroupMembershipCreate) SetUpdatedAt(t time.Time) *GroupMembershipCreate { + gmc.mutation.SetUpdatedAt(t) + return gmc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableUpdatedAt(t *time.Time) *GroupMembershipCreate { + if t != nil { + gmc.SetUpdatedAt(*t) + } + return gmc +} + +// SetCreatedBy sets the "created_by" field. +func (gmc *GroupMembershipCreate) SetCreatedBy(s string) *GroupMembershipCreate { + gmc.mutation.SetCreatedBy(s) + return gmc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableCreatedBy(s *string) *GroupMembershipCreate { + if s != nil { + gmc.SetCreatedBy(*s) + } + return gmc +} + +// SetUpdatedBy sets the "updated_by" field. +func (gmc *GroupMembershipCreate) SetUpdatedBy(s string) *GroupMembershipCreate { + gmc.mutation.SetUpdatedBy(s) + return gmc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableUpdatedBy(s *string) *GroupMembershipCreate { + if s != nil { + gmc.SetUpdatedBy(*s) + } + return gmc +} + +// SetMappingID sets the "mapping_id" field. +func (gmc *GroupMembershipCreate) SetMappingID(s string) *GroupMembershipCreate { + gmc.mutation.SetMappingID(s) + return gmc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableMappingID(s *string) *GroupMembershipCreate { + if s != nil { + gmc.SetMappingID(*s) + } + return gmc +} + +// SetDeletedAt sets the "deleted_at" field. +func (gmc *GroupMembershipCreate) SetDeletedAt(t time.Time) *GroupMembershipCreate { + gmc.mutation.SetDeletedAt(t) + return gmc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableDeletedAt(t *time.Time) *GroupMembershipCreate { + if t != nil { + gmc.SetDeletedAt(*t) + } + return gmc +} + +// SetDeletedBy sets the "deleted_by" field. +func (gmc *GroupMembershipCreate) SetDeletedBy(s string) *GroupMembershipCreate { + gmc.mutation.SetDeletedBy(s) + return gmc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableDeletedBy(s *string) *GroupMembershipCreate { + if s != nil { + gmc.SetDeletedBy(*s) + } + return gmc +} + +// SetRole sets the "role" field. +func (gmc *GroupMembershipCreate) SetRole(e enums.Role) *GroupMembershipCreate { + gmc.mutation.SetRole(e) + return gmc +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableRole(e *enums.Role) *GroupMembershipCreate { + if e != nil { + gmc.SetRole(*e) + } + return gmc +} + +// SetGroupID sets the "group_id" field. +func (gmc *GroupMembershipCreate) SetGroupID(s string) *GroupMembershipCreate { + gmc.mutation.SetGroupID(s) + return gmc +} + +// SetUserID sets the "user_id" field. +func (gmc *GroupMembershipCreate) SetUserID(s string) *GroupMembershipCreate { + gmc.mutation.SetUserID(s) + return gmc +} + +// SetID sets the "id" field. +func (gmc *GroupMembershipCreate) SetID(s string) *GroupMembershipCreate { + gmc.mutation.SetID(s) + return gmc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (gmc *GroupMembershipCreate) SetNillableID(s *string) *GroupMembershipCreate { + if s != nil { + gmc.SetID(*s) + } + return gmc +} + +// SetGroup sets the "group" edge to the Group entity. +func (gmc *GroupMembershipCreate) SetGroup(g *Group) *GroupMembershipCreate { + return gmc.SetGroupID(g.ID) +} + +// SetUser sets the "user" edge to the User entity. +func (gmc *GroupMembershipCreate) SetUser(u *User) *GroupMembershipCreate { + return gmc.SetUserID(u.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (gmc *GroupMembershipCreate) AddEventIDs(ids ...string) *GroupMembershipCreate { + gmc.mutation.AddEventIDs(ids...) + return gmc +} + +// AddEvents adds the "events" edges to the Event entity. +func (gmc *GroupMembershipCreate) AddEvents(e ...*Event) *GroupMembershipCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gmc.AddEventIDs(ids...) +} + +// Mutation returns the GroupMembershipMutation object of the builder. +func (gmc *GroupMembershipCreate) Mutation() *GroupMembershipMutation { + return gmc.mutation +} + +// Save creates the GroupMembership in the database. +func (gmc *GroupMembershipCreate) Save(ctx context.Context) (*GroupMembership, error) { + if err := gmc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gmc.sqlSave, gmc.mutation, gmc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (gmc *GroupMembershipCreate) SaveX(ctx context.Context) *GroupMembership { + v, err := gmc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gmc *GroupMembershipCreate) Exec(ctx context.Context) error { + _, err := gmc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmc *GroupMembershipCreate) ExecX(ctx context.Context) { + if err := gmc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gmc *GroupMembershipCreate) defaults() error { + if _, ok := gmc.mutation.CreatedAt(); !ok { + if groupmembership.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembership.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := groupmembership.DefaultCreatedAt() + gmc.mutation.SetCreatedAt(v) + } + if _, ok := gmc.mutation.UpdatedAt(); !ok { + if groupmembership.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembership.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupmembership.DefaultUpdatedAt() + gmc.mutation.SetUpdatedAt(v) + } + if _, ok := gmc.mutation.MappingID(); !ok { + if groupmembership.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized groupmembership.DefaultMappingID (forgotten import generated/runtime?)") + } + v := groupmembership.DefaultMappingID() + gmc.mutation.SetMappingID(v) + } + if _, ok := gmc.mutation.Role(); !ok { + v := groupmembership.DefaultRole + gmc.mutation.SetRole(v) + } + if _, ok := gmc.mutation.ID(); !ok { + if groupmembership.DefaultID == nil { + return fmt.Errorf("generated: uninitialized groupmembership.DefaultID (forgotten import generated/runtime?)") + } + v := groupmembership.DefaultID() + gmc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gmc *GroupMembershipCreate) check() error { + if _, ok := gmc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "GroupMembership.mapping_id"`)} + } + if _, ok := gmc.mutation.Role(); !ok { + return &ValidationError{Name: "role", err: errors.New(`generated: missing required field "GroupMembership.role"`)} + } + if v, ok := gmc.mutation.Role(); ok { + if err := groupmembership.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "GroupMembership.role": %w`, err)} + } + } + if _, ok := gmc.mutation.GroupID(); !ok { + return &ValidationError{Name: "group_id", err: errors.New(`generated: missing required field "GroupMembership.group_id"`)} + } + if _, ok := gmc.mutation.UserID(); !ok { + return &ValidationError{Name: "user_id", err: errors.New(`generated: missing required field "GroupMembership.user_id"`)} + } + if len(gmc.mutation.GroupIDs()) == 0 { + return &ValidationError{Name: "group", err: errors.New(`generated: missing required edge "GroupMembership.group"`)} + } + if len(gmc.mutation.UserIDs()) == 0 { + return &ValidationError{Name: "user", err: errors.New(`generated: missing required edge "GroupMembership.user"`)} + } + return nil +} + +func (gmc *GroupMembershipCreate) sqlSave(ctx context.Context) (*GroupMembership, error) { + if err := gmc.check(); err != nil { + return nil, err + } + _node, _spec := gmc.createSpec() + if err := sqlgraph.CreateNode(ctx, gmc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected GroupMembership.ID type: %T", _spec.ID.Value) + } + } + gmc.mutation.id = &_node.ID + gmc.mutation.done = true + return _node, nil +} + +func (gmc *GroupMembershipCreate) createSpec() (*GroupMembership, *sqlgraph.CreateSpec) { + var ( + _node = &GroupMembership{config: gmc.config} + _spec = sqlgraph.NewCreateSpec(groupmembership.Table, sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString)) + ) + _spec.Schema = gmc.schemaConfig.GroupMembership + if id, ok := gmc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := gmc.mutation.CreatedAt(); ok { + _spec.SetField(groupmembership.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := gmc.mutation.UpdatedAt(); ok { + _spec.SetField(groupmembership.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := gmc.mutation.CreatedBy(); ok { + _spec.SetField(groupmembership.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := gmc.mutation.UpdatedBy(); ok { + _spec.SetField(groupmembership.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := gmc.mutation.MappingID(); ok { + _spec.SetField(groupmembership.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := gmc.mutation.DeletedAt(); ok { + _spec.SetField(groupmembership.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := gmc.mutation.DeletedBy(); ok { + _spec.SetField(groupmembership.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := gmc.mutation.Role(); ok { + _spec.SetField(groupmembership.FieldRole, field.TypeEnum, value) + _node.Role = value + } + if nodes := gmc.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: groupmembership.GroupTable, + Columns: []string{groupmembership.GroupColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = gmc.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.GroupID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gmc.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: groupmembership.UserTable, + Columns: []string{groupmembership.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = gmc.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.UserID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := gmc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gmc.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// GroupMembershipCreateBulk is the builder for creating many GroupMembership entities in bulk. +type GroupMembershipCreateBulk struct { + config + err error + builders []*GroupMembershipCreate +} + +// Save creates the GroupMembership entities in the database. +func (gmcb *GroupMembershipCreateBulk) Save(ctx context.Context) ([]*GroupMembership, error) { + if gmcb.err != nil { + return nil, gmcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(gmcb.builders)) + nodes := make([]*GroupMembership, len(gmcb.builders)) + mutators := make([]Mutator, len(gmcb.builders)) + for i := range gmcb.builders { + func(i int, root context.Context) { + builder := gmcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*GroupMembershipMutation) + 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, gmcb.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, gmcb.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, gmcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (gmcb *GroupMembershipCreateBulk) SaveX(ctx context.Context) []*GroupMembership { + v, err := gmcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gmcb *GroupMembershipCreateBulk) Exec(ctx context.Context) error { + _, err := gmcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmcb *GroupMembershipCreateBulk) ExecX(ctx context.Context) { + if err := gmcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupmembership_delete.go b/internal/ent/generated/groupmembership_delete.go new file mode 100644 index 0000000..42aba15 --- /dev/null +++ b/internal/ent/generated/groupmembership_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupMembershipDelete is the builder for deleting a GroupMembership entity. +type GroupMembershipDelete struct { + config + hooks []Hook + mutation *GroupMembershipMutation +} + +// Where appends a list predicates to the GroupMembershipDelete builder. +func (gmd *GroupMembershipDelete) Where(ps ...predicate.GroupMembership) *GroupMembershipDelete { + gmd.mutation.Where(ps...) + return gmd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (gmd *GroupMembershipDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, gmd.sqlExec, gmd.mutation, gmd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmd *GroupMembershipDelete) ExecX(ctx context.Context) int { + n, err := gmd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (gmd *GroupMembershipDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(groupmembership.Table, sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString)) + _spec.Node.Schema = gmd.schemaConfig.GroupMembership + ctx = internal.NewSchemaConfigContext(ctx, gmd.schemaConfig) + if ps := gmd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, gmd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + gmd.mutation.done = true + return affected, err +} + +// GroupMembershipDeleteOne is the builder for deleting a single GroupMembership entity. +type GroupMembershipDeleteOne struct { + gmd *GroupMembershipDelete +} + +// Where appends a list predicates to the GroupMembershipDelete builder. +func (gmdo *GroupMembershipDeleteOne) Where(ps ...predicate.GroupMembership) *GroupMembershipDeleteOne { + gmdo.gmd.mutation.Where(ps...) + return gmdo +} + +// Exec executes the deletion query. +func (gmdo *GroupMembershipDeleteOne) Exec(ctx context.Context) error { + n, err := gmdo.gmd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{groupmembership.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmdo *GroupMembershipDeleteOne) ExecX(ctx context.Context) { + if err := gmdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupmembership_query.go b/internal/ent/generated/groupmembership_query.go new file mode 100644 index 0000000..47bf00e --- /dev/null +++ b/internal/ent/generated/groupmembership_query.go @@ -0,0 +1,848 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupMembershipQuery is the builder for querying GroupMembership entities. +type GroupMembershipQuery struct { + config + ctx *QueryContext + order []groupmembership.OrderOption + inters []Interceptor + predicates []predicate.GroupMembership + withGroup *GroupQuery + withUser *UserQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*GroupMembership) error + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the GroupMembershipQuery builder. +func (gmq *GroupMembershipQuery) Where(ps ...predicate.GroupMembership) *GroupMembershipQuery { + gmq.predicates = append(gmq.predicates, ps...) + return gmq +} + +// Limit the number of records to be returned by this query. +func (gmq *GroupMembershipQuery) Limit(limit int) *GroupMembershipQuery { + gmq.ctx.Limit = &limit + return gmq +} + +// Offset to start from. +func (gmq *GroupMembershipQuery) Offset(offset int) *GroupMembershipQuery { + gmq.ctx.Offset = &offset + return gmq +} + +// 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 (gmq *GroupMembershipQuery) Unique(unique bool) *GroupMembershipQuery { + gmq.ctx.Unique = &unique + return gmq +} + +// Order specifies how the records should be ordered. +func (gmq *GroupMembershipQuery) Order(o ...groupmembership.OrderOption) *GroupMembershipQuery { + gmq.order = append(gmq.order, o...) + return gmq +} + +// QueryGroup chains the current query on the "group" edge. +func (gmq *GroupMembershipQuery) QueryGroup() *GroupQuery { + query := (&GroupClient{config: gmq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gmq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gmq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(groupmembership.Table, groupmembership.FieldID, selector), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, groupmembership.GroupTable, groupmembership.GroupColumn), + ) + schemaConfig := gmq.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + fromU = sqlgraph.SetNeighbors(gmq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryUser chains the current query on the "user" edge. +func (gmq *GroupMembershipQuery) QueryUser() *UserQuery { + query := (&UserClient{config: gmq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gmq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gmq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(groupmembership.Table, groupmembership.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, groupmembership.UserTable, groupmembership.UserColumn), + ) + schemaConfig := gmq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.GroupMembership + fromU = sqlgraph.SetNeighbors(gmq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (gmq *GroupMembershipQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: gmq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gmq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gmq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(groupmembership.Table, groupmembership.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, groupmembership.EventsTable, groupmembership.EventsPrimaryKey...), + ) + schemaConfig := gmq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.GroupMembershipEvents + fromU = sqlgraph.SetNeighbors(gmq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first GroupMembership entity from the query. +// Returns a *NotFoundError when no GroupMembership was found. +func (gmq *GroupMembershipQuery) First(ctx context.Context) (*GroupMembership, error) { + nodes, err := gmq.Limit(1).All(setContextOp(ctx, gmq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{groupmembership.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (gmq *GroupMembershipQuery) FirstX(ctx context.Context) *GroupMembership { + node, err := gmq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first GroupMembership ID from the query. +// Returns a *NotFoundError when no GroupMembership ID was found. +func (gmq *GroupMembershipQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gmq.Limit(1).IDs(setContextOp(ctx, gmq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{groupmembership.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (gmq *GroupMembershipQuery) FirstIDX(ctx context.Context) string { + id, err := gmq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single GroupMembership entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one GroupMembership entity is found. +// Returns a *NotFoundError when no GroupMembership entities are found. +func (gmq *GroupMembershipQuery) Only(ctx context.Context) (*GroupMembership, error) { + nodes, err := gmq.Limit(2).All(setContextOp(ctx, gmq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{groupmembership.Label} + default: + return nil, &NotSingularError{groupmembership.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (gmq *GroupMembershipQuery) OnlyX(ctx context.Context) *GroupMembership { + node, err := gmq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only GroupMembership ID in the query. +// Returns a *NotSingularError when more than one GroupMembership ID is found. +// Returns a *NotFoundError when no entities are found. +func (gmq *GroupMembershipQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gmq.Limit(2).IDs(setContextOp(ctx, gmq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{groupmembership.Label} + default: + err = &NotSingularError{groupmembership.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (gmq *GroupMembershipQuery) OnlyIDX(ctx context.Context) string { + id, err := gmq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of GroupMemberships. +func (gmq *GroupMembershipQuery) All(ctx context.Context) ([]*GroupMembership, error) { + ctx = setContextOp(ctx, gmq.ctx, ent.OpQueryAll) + if err := gmq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*GroupMembership, *GroupMembershipQuery]() + return withInterceptors[[]*GroupMembership](ctx, gmq, qr, gmq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (gmq *GroupMembershipQuery) AllX(ctx context.Context) []*GroupMembership { + nodes, err := gmq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of GroupMembership IDs. +func (gmq *GroupMembershipQuery) IDs(ctx context.Context) (ids []string, err error) { + if gmq.ctx.Unique == nil && gmq.path != nil { + gmq.Unique(true) + } + ctx = setContextOp(ctx, gmq.ctx, ent.OpQueryIDs) + if err = gmq.Select(groupmembership.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (gmq *GroupMembershipQuery) IDsX(ctx context.Context) []string { + ids, err := gmq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (gmq *GroupMembershipQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, gmq.ctx, ent.OpQueryCount) + if err := gmq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, gmq, querierCount[*GroupMembershipQuery](), gmq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (gmq *GroupMembershipQuery) CountX(ctx context.Context) int { + count, err := gmq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (gmq *GroupMembershipQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, gmq.ctx, ent.OpQueryExist) + switch _, err := gmq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (gmq *GroupMembershipQuery) ExistX(ctx context.Context) bool { + exist, err := gmq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the GroupMembershipQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (gmq *GroupMembershipQuery) Clone() *GroupMembershipQuery { + if gmq == nil { + return nil + } + return &GroupMembershipQuery{ + config: gmq.config, + ctx: gmq.ctx.Clone(), + order: append([]groupmembership.OrderOption{}, gmq.order...), + inters: append([]Interceptor{}, gmq.inters...), + predicates: append([]predicate.GroupMembership{}, gmq.predicates...), + withGroup: gmq.withGroup.Clone(), + withUser: gmq.withUser.Clone(), + withEvents: gmq.withEvents.Clone(), + // clone intermediate query. + sql: gmq.sql.Clone(), + path: gmq.path, + } +} + +// WithGroup tells the query-builder to eager-load the nodes that are connected to +// the "group" edge. The optional arguments are used to configure the query builder of the edge. +func (gmq *GroupMembershipQuery) WithGroup(opts ...func(*GroupQuery)) *GroupMembershipQuery { + query := (&GroupClient{config: gmq.config}).Query() + for _, opt := range opts { + opt(query) + } + gmq.withGroup = query + return gmq +} + +// WithUser tells the query-builder to eager-load the nodes that are connected to +// the "user" edge. The optional arguments are used to configure the query builder of the edge. +func (gmq *GroupMembershipQuery) WithUser(opts ...func(*UserQuery)) *GroupMembershipQuery { + query := (&UserClient{config: gmq.config}).Query() + for _, opt := range opts { + opt(query) + } + gmq.withUser = query + return gmq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (gmq *GroupMembershipQuery) WithEvents(opts ...func(*EventQuery)) *GroupMembershipQuery { + query := (&EventClient{config: gmq.config}).Query() + for _, opt := range opts { + opt(query) + } + gmq.withEvents = query + return gmq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.GroupMembership.Query(). +// GroupBy(groupmembership.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (gmq *GroupMembershipQuery) GroupBy(field string, fields ...string) *GroupMembershipGroupBy { + gmq.ctx.Fields = append([]string{field}, fields...) + grbuild := &GroupMembershipGroupBy{build: gmq} + grbuild.flds = &gmq.ctx.Fields + grbuild.label = groupmembership.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.GroupMembership.Query(). +// Select(groupmembership.FieldCreatedAt). +// Scan(ctx, &v) +func (gmq *GroupMembershipQuery) Select(fields ...string) *GroupMembershipSelect { + gmq.ctx.Fields = append(gmq.ctx.Fields, fields...) + sbuild := &GroupMembershipSelect{GroupMembershipQuery: gmq} + sbuild.label = groupmembership.Label + sbuild.flds, sbuild.scan = &gmq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a GroupMembershipSelect configured with the given aggregations. +func (gmq *GroupMembershipQuery) Aggregate(fns ...AggregateFunc) *GroupMembershipSelect { + return gmq.Select().Aggregate(fns...) +} + +func (gmq *GroupMembershipQuery) prepareQuery(ctx context.Context) error { + for _, inter := range gmq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, gmq); err != nil { + return err + } + } + } + for _, f := range gmq.ctx.Fields { + if !groupmembership.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if gmq.path != nil { + prev, err := gmq.path(ctx) + if err != nil { + return err + } + gmq.sql = prev + } + if groupmembership.Policy == nil { + return errors.New("generated: uninitialized groupmembership.Policy (forgotten import generated/runtime?)") + } + if err := groupmembership.Policy.EvalQuery(ctx, gmq); err != nil { + return err + } + return nil +} + +func (gmq *GroupMembershipQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GroupMembership, error) { + var ( + nodes = []*GroupMembership{} + _spec = gmq.querySpec() + loadedTypes = [3]bool{ + gmq.withGroup != nil, + gmq.withUser != nil, + gmq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*GroupMembership).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &GroupMembership{config: gmq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = gmq.schemaConfig.GroupMembership + ctx = internal.NewSchemaConfigContext(ctx, gmq.schemaConfig) + if len(gmq.modifiers) > 0 { + _spec.Modifiers = gmq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, gmq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := gmq.withGroup; query != nil { + if err := gmq.loadGroup(ctx, query, nodes, nil, + func(n *GroupMembership, e *Group) { n.Edges.Group = e }); err != nil { + return nil, err + } + } + if query := gmq.withUser; query != nil { + if err := gmq.loadUser(ctx, query, nodes, nil, + func(n *GroupMembership, e *User) { n.Edges.User = e }); err != nil { + return nil, err + } + } + if query := gmq.withEvents; query != nil { + if err := gmq.loadEvents(ctx, query, nodes, + func(n *GroupMembership) { n.Edges.Events = []*Event{} }, + func(n *GroupMembership, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range gmq.withNamedEvents { + if err := gmq.loadEvents(ctx, query, nodes, + func(n *GroupMembership) { n.appendNamedEvents(name) }, + func(n *GroupMembership, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range gmq.loadTotal { + if err := gmq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (gmq *GroupMembershipQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []*GroupMembership, init func(*GroupMembership), assign func(*GroupMembership, *Group)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*GroupMembership) + for i := range nodes { + fk := nodes[i].GroupID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(group.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 "group_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (gmq *GroupMembershipQuery) loadUser(ctx context.Context, query *UserQuery, nodes []*GroupMembership, init func(*GroupMembership), assign func(*GroupMembership, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*GroupMembership) + for i := range nodes { + fk := nodes[i].UserID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "user_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (gmq *GroupMembershipQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*GroupMembership, init func(*GroupMembership), assign func(*GroupMembership, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*GroupMembership) + nids := make(map[string]map[*GroupMembership]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(groupmembership.EventsTable) + joinT.Schema(gmq.schemaConfig.GroupMembershipEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(groupmembership.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(groupmembership.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(groupmembership.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*GroupMembership]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (gmq *GroupMembershipQuery) sqlCount(ctx context.Context) (int, error) { + _spec := gmq.querySpec() + _spec.Node.Schema = gmq.schemaConfig.GroupMembership + ctx = internal.NewSchemaConfigContext(ctx, gmq.schemaConfig) + if len(gmq.modifiers) > 0 { + _spec.Modifiers = gmq.modifiers + } + _spec.Node.Columns = gmq.ctx.Fields + if len(gmq.ctx.Fields) > 0 { + _spec.Unique = gmq.ctx.Unique != nil && *gmq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, gmq.driver, _spec) +} + +func (gmq *GroupMembershipQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(groupmembership.Table, groupmembership.Columns, sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString)) + _spec.From = gmq.sql + if unique := gmq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if gmq.path != nil { + _spec.Unique = true + } + if fields := gmq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupmembership.FieldID) + for i := range fields { + if fields[i] != groupmembership.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if gmq.withGroup != nil { + _spec.Node.AddColumnOnce(groupmembership.FieldGroupID) + } + if gmq.withUser != nil { + _spec.Node.AddColumnOnce(groupmembership.FieldUserID) + } + } + if ps := gmq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := gmq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := gmq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := gmq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (gmq *GroupMembershipQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(gmq.driver.Dialect()) + t1 := builder.Table(groupmembership.Table) + columns := gmq.ctx.Fields + if len(columns) == 0 { + columns = groupmembership.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if gmq.sql != nil { + selector = gmq.sql + selector.Select(selector.Columns(columns...)...) + } + if gmq.ctx.Unique != nil && *gmq.ctx.Unique { + selector.Distinct() + } + t1.Schema(gmq.schemaConfig.GroupMembership) + ctx = internal.NewSchemaConfigContext(ctx, gmq.schemaConfig) + selector.WithContext(ctx) + for _, p := range gmq.predicates { + p(selector) + } + for _, p := range gmq.order { + p(selector) + } + if offset := gmq.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 := gmq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (gmq *GroupMembershipQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *GroupMembershipQuery { + query := (&EventClient{config: gmq.config}).Query() + for _, opt := range opts { + opt(query) + } + if gmq.withNamedEvents == nil { + gmq.withNamedEvents = make(map[string]*EventQuery) + } + gmq.withNamedEvents[name] = query + return gmq +} + +// GroupMembershipGroupBy is the group-by builder for GroupMembership entities. +type GroupMembershipGroupBy struct { + selector + build *GroupMembershipQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (gmgb *GroupMembershipGroupBy) Aggregate(fns ...AggregateFunc) *GroupMembershipGroupBy { + gmgb.fns = append(gmgb.fns, fns...) + return gmgb +} + +// Scan applies the selector query and scans the result into the given value. +func (gmgb *GroupMembershipGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gmgb.build.ctx, ent.OpQueryGroupBy) + if err := gmgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupMembershipQuery, *GroupMembershipGroupBy](ctx, gmgb.build, gmgb, gmgb.build.inters, v) +} + +func (gmgb *GroupMembershipGroupBy) sqlScan(ctx context.Context, root *GroupMembershipQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(gmgb.fns)) + for _, fn := range gmgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*gmgb.flds)+len(gmgb.fns)) + for _, f := range *gmgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*gmgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := gmgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// GroupMembershipSelect is the builder for selecting fields of GroupMembership entities. +type GroupMembershipSelect struct { + *GroupMembershipQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (gms *GroupMembershipSelect) Aggregate(fns ...AggregateFunc) *GroupMembershipSelect { + gms.fns = append(gms.fns, fns...) + return gms +} + +// Scan applies the selector query and scans the result into the given value. +func (gms *GroupMembershipSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gms.ctx, ent.OpQuerySelect) + if err := gms.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupMembershipQuery, *GroupMembershipSelect](ctx, gms.GroupMembershipQuery, gms, gms.inters, v) +} + +func (gms *GroupMembershipSelect) sqlScan(ctx context.Context, root *GroupMembershipQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(gms.fns)) + for _, fn := range gms.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*gms.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 := gms.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/groupmembership_update.go b/internal/ent/generated/groupmembership_update.go new file mode 100644 index 0000000..c1cff6c --- /dev/null +++ b/internal/ent/generated/groupmembership_update.go @@ -0,0 +1,658 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupMembershipUpdate is the builder for updating GroupMembership entities. +type GroupMembershipUpdate struct { + config + hooks []Hook + mutation *GroupMembershipMutation +} + +// Where appends a list predicates to the GroupMembershipUpdate builder. +func (gmu *GroupMembershipUpdate) Where(ps ...predicate.GroupMembership) *GroupMembershipUpdate { + gmu.mutation.Where(ps...) + return gmu +} + +// SetUpdatedAt sets the "updated_at" field. +func (gmu *GroupMembershipUpdate) SetUpdatedAt(t time.Time) *GroupMembershipUpdate { + gmu.mutation.SetUpdatedAt(t) + return gmu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gmu *GroupMembershipUpdate) ClearUpdatedAt() *GroupMembershipUpdate { + gmu.mutation.ClearUpdatedAt() + return gmu +} + +// SetUpdatedBy sets the "updated_by" field. +func (gmu *GroupMembershipUpdate) SetUpdatedBy(s string) *GroupMembershipUpdate { + gmu.mutation.SetUpdatedBy(s) + return gmu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gmu *GroupMembershipUpdate) SetNillableUpdatedBy(s *string) *GroupMembershipUpdate { + if s != nil { + gmu.SetUpdatedBy(*s) + } + return gmu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gmu *GroupMembershipUpdate) ClearUpdatedBy() *GroupMembershipUpdate { + gmu.mutation.ClearUpdatedBy() + return gmu +} + +// SetDeletedAt sets the "deleted_at" field. +func (gmu *GroupMembershipUpdate) SetDeletedAt(t time.Time) *GroupMembershipUpdate { + gmu.mutation.SetDeletedAt(t) + return gmu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gmu *GroupMembershipUpdate) SetNillableDeletedAt(t *time.Time) *GroupMembershipUpdate { + if t != nil { + gmu.SetDeletedAt(*t) + } + return gmu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gmu *GroupMembershipUpdate) ClearDeletedAt() *GroupMembershipUpdate { + gmu.mutation.ClearDeletedAt() + return gmu +} + +// SetDeletedBy sets the "deleted_by" field. +func (gmu *GroupMembershipUpdate) SetDeletedBy(s string) *GroupMembershipUpdate { + gmu.mutation.SetDeletedBy(s) + return gmu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gmu *GroupMembershipUpdate) SetNillableDeletedBy(s *string) *GroupMembershipUpdate { + if s != nil { + gmu.SetDeletedBy(*s) + } + return gmu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gmu *GroupMembershipUpdate) ClearDeletedBy() *GroupMembershipUpdate { + gmu.mutation.ClearDeletedBy() + return gmu +} + +// SetRole sets the "role" field. +func (gmu *GroupMembershipUpdate) SetRole(e enums.Role) *GroupMembershipUpdate { + gmu.mutation.SetRole(e) + return gmu +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (gmu *GroupMembershipUpdate) SetNillableRole(e *enums.Role) *GroupMembershipUpdate { + if e != nil { + gmu.SetRole(*e) + } + return gmu +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (gmu *GroupMembershipUpdate) AddEventIDs(ids ...string) *GroupMembershipUpdate { + gmu.mutation.AddEventIDs(ids...) + return gmu +} + +// AddEvents adds the "events" edges to the Event entity. +func (gmu *GroupMembershipUpdate) AddEvents(e ...*Event) *GroupMembershipUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gmu.AddEventIDs(ids...) +} + +// Mutation returns the GroupMembershipMutation object of the builder. +func (gmu *GroupMembershipUpdate) Mutation() *GroupMembershipMutation { + return gmu.mutation +} + +// ClearEvents clears all "events" edges to the Event entity. +func (gmu *GroupMembershipUpdate) ClearEvents() *GroupMembershipUpdate { + gmu.mutation.ClearEvents() + return gmu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (gmu *GroupMembershipUpdate) RemoveEventIDs(ids ...string) *GroupMembershipUpdate { + gmu.mutation.RemoveEventIDs(ids...) + return gmu +} + +// RemoveEvents removes "events" edges to Event entities. +func (gmu *GroupMembershipUpdate) RemoveEvents(e ...*Event) *GroupMembershipUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gmu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (gmu *GroupMembershipUpdate) Save(ctx context.Context) (int, error) { + if err := gmu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, gmu.sqlSave, gmu.mutation, gmu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gmu *GroupMembershipUpdate) SaveX(ctx context.Context) int { + affected, err := gmu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (gmu *GroupMembershipUpdate) Exec(ctx context.Context) error { + _, err := gmu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmu *GroupMembershipUpdate) ExecX(ctx context.Context) { + if err := gmu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gmu *GroupMembershipUpdate) defaults() error { + if _, ok := gmu.mutation.UpdatedAt(); !ok && !gmu.mutation.UpdatedAtCleared() { + if groupmembership.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembership.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupmembership.UpdateDefaultUpdatedAt() + gmu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gmu *GroupMembershipUpdate) check() error { + if v, ok := gmu.mutation.Role(); ok { + if err := groupmembership.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "GroupMembership.role": %w`, err)} + } + } + if gmu.mutation.GroupCleared() && len(gmu.mutation.GroupIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "GroupMembership.group"`) + } + if gmu.mutation.UserCleared() && len(gmu.mutation.UserIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "GroupMembership.user"`) + } + return nil +} + +func (gmu *GroupMembershipUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := gmu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(groupmembership.Table, groupmembership.Columns, sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString)) + if ps := gmu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gmu.mutation.CreatedAtCleared() { + _spec.ClearField(groupmembership.FieldCreatedAt, field.TypeTime) + } + if value, ok := gmu.mutation.UpdatedAt(); ok { + _spec.SetField(groupmembership.FieldUpdatedAt, field.TypeTime, value) + } + if gmu.mutation.UpdatedAtCleared() { + _spec.ClearField(groupmembership.FieldUpdatedAt, field.TypeTime) + } + if gmu.mutation.CreatedByCleared() { + _spec.ClearField(groupmembership.FieldCreatedBy, field.TypeString) + } + if value, ok := gmu.mutation.UpdatedBy(); ok { + _spec.SetField(groupmembership.FieldUpdatedBy, field.TypeString, value) + } + if gmu.mutation.UpdatedByCleared() { + _spec.ClearField(groupmembership.FieldUpdatedBy, field.TypeString) + } + if value, ok := gmu.mutation.DeletedAt(); ok { + _spec.SetField(groupmembership.FieldDeletedAt, field.TypeTime, value) + } + if gmu.mutation.DeletedAtCleared() { + _spec.ClearField(groupmembership.FieldDeletedAt, field.TypeTime) + } + if value, ok := gmu.mutation.DeletedBy(); ok { + _spec.SetField(groupmembership.FieldDeletedBy, field.TypeString, value) + } + if gmu.mutation.DeletedByCleared() { + _spec.ClearField(groupmembership.FieldDeletedBy, field.TypeString) + } + if value, ok := gmu.mutation.Role(); ok { + _spec.SetField(groupmembership.FieldRole, field.TypeEnum, value) + } + if gmu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gmu.schemaConfig.GroupMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gmu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !gmu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gmu.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gmu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gmu.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = gmu.schemaConfig.GroupMembership + ctx = internal.NewSchemaConfigContext(ctx, gmu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, gmu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupmembership.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + gmu.mutation.done = true + return n, nil +} + +// GroupMembershipUpdateOne is the builder for updating a single GroupMembership entity. +type GroupMembershipUpdateOne struct { + config + fields []string + hooks []Hook + mutation *GroupMembershipMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (gmuo *GroupMembershipUpdateOne) SetUpdatedAt(t time.Time) *GroupMembershipUpdateOne { + gmuo.mutation.SetUpdatedAt(t) + return gmuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gmuo *GroupMembershipUpdateOne) ClearUpdatedAt() *GroupMembershipUpdateOne { + gmuo.mutation.ClearUpdatedAt() + return gmuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (gmuo *GroupMembershipUpdateOne) SetUpdatedBy(s string) *GroupMembershipUpdateOne { + gmuo.mutation.SetUpdatedBy(s) + return gmuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gmuo *GroupMembershipUpdateOne) SetNillableUpdatedBy(s *string) *GroupMembershipUpdateOne { + if s != nil { + gmuo.SetUpdatedBy(*s) + } + return gmuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gmuo *GroupMembershipUpdateOne) ClearUpdatedBy() *GroupMembershipUpdateOne { + gmuo.mutation.ClearUpdatedBy() + return gmuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (gmuo *GroupMembershipUpdateOne) SetDeletedAt(t time.Time) *GroupMembershipUpdateOne { + gmuo.mutation.SetDeletedAt(t) + return gmuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gmuo *GroupMembershipUpdateOne) SetNillableDeletedAt(t *time.Time) *GroupMembershipUpdateOne { + if t != nil { + gmuo.SetDeletedAt(*t) + } + return gmuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gmuo *GroupMembershipUpdateOne) ClearDeletedAt() *GroupMembershipUpdateOne { + gmuo.mutation.ClearDeletedAt() + return gmuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (gmuo *GroupMembershipUpdateOne) SetDeletedBy(s string) *GroupMembershipUpdateOne { + gmuo.mutation.SetDeletedBy(s) + return gmuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gmuo *GroupMembershipUpdateOne) SetNillableDeletedBy(s *string) *GroupMembershipUpdateOne { + if s != nil { + gmuo.SetDeletedBy(*s) + } + return gmuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gmuo *GroupMembershipUpdateOne) ClearDeletedBy() *GroupMembershipUpdateOne { + gmuo.mutation.ClearDeletedBy() + return gmuo +} + +// SetRole sets the "role" field. +func (gmuo *GroupMembershipUpdateOne) SetRole(e enums.Role) *GroupMembershipUpdateOne { + gmuo.mutation.SetRole(e) + return gmuo +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (gmuo *GroupMembershipUpdateOne) SetNillableRole(e *enums.Role) *GroupMembershipUpdateOne { + if e != nil { + gmuo.SetRole(*e) + } + return gmuo +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (gmuo *GroupMembershipUpdateOne) AddEventIDs(ids ...string) *GroupMembershipUpdateOne { + gmuo.mutation.AddEventIDs(ids...) + return gmuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (gmuo *GroupMembershipUpdateOne) AddEvents(e ...*Event) *GroupMembershipUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gmuo.AddEventIDs(ids...) +} + +// Mutation returns the GroupMembershipMutation object of the builder. +func (gmuo *GroupMembershipUpdateOne) Mutation() *GroupMembershipMutation { + return gmuo.mutation +} + +// ClearEvents clears all "events" edges to the Event entity. +func (gmuo *GroupMembershipUpdateOne) ClearEvents() *GroupMembershipUpdateOne { + gmuo.mutation.ClearEvents() + return gmuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (gmuo *GroupMembershipUpdateOne) RemoveEventIDs(ids ...string) *GroupMembershipUpdateOne { + gmuo.mutation.RemoveEventIDs(ids...) + return gmuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (gmuo *GroupMembershipUpdateOne) RemoveEvents(e ...*Event) *GroupMembershipUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return gmuo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the GroupMembershipUpdate builder. +func (gmuo *GroupMembershipUpdateOne) Where(ps ...predicate.GroupMembership) *GroupMembershipUpdateOne { + gmuo.mutation.Where(ps...) + return gmuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (gmuo *GroupMembershipUpdateOne) Select(field string, fields ...string) *GroupMembershipUpdateOne { + gmuo.fields = append([]string{field}, fields...) + return gmuo +} + +// Save executes the query and returns the updated GroupMembership entity. +func (gmuo *GroupMembershipUpdateOne) Save(ctx context.Context) (*GroupMembership, error) { + if err := gmuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gmuo.sqlSave, gmuo.mutation, gmuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gmuo *GroupMembershipUpdateOne) SaveX(ctx context.Context) *GroupMembership { + node, err := gmuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (gmuo *GroupMembershipUpdateOne) Exec(ctx context.Context) error { + _, err := gmuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmuo *GroupMembershipUpdateOne) ExecX(ctx context.Context) { + if err := gmuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gmuo *GroupMembershipUpdateOne) defaults() error { + if _, ok := gmuo.mutation.UpdatedAt(); !ok && !gmuo.mutation.UpdatedAtCleared() { + if groupmembership.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembership.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupmembership.UpdateDefaultUpdatedAt() + gmuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gmuo *GroupMembershipUpdateOne) check() error { + if v, ok := gmuo.mutation.Role(); ok { + if err := groupmembership.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "GroupMembership.role": %w`, err)} + } + } + if gmuo.mutation.GroupCleared() && len(gmuo.mutation.GroupIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "GroupMembership.group"`) + } + if gmuo.mutation.UserCleared() && len(gmuo.mutation.UserIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "GroupMembership.user"`) + } + return nil +} + +func (gmuo *GroupMembershipUpdateOne) sqlSave(ctx context.Context) (_node *GroupMembership, err error) { + if err := gmuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(groupmembership.Table, groupmembership.Columns, sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString)) + id, ok := gmuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "GroupMembership.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := gmuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupmembership.FieldID) + for _, f := range fields { + if !groupmembership.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != groupmembership.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := gmuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gmuo.mutation.CreatedAtCleared() { + _spec.ClearField(groupmembership.FieldCreatedAt, field.TypeTime) + } + if value, ok := gmuo.mutation.UpdatedAt(); ok { + _spec.SetField(groupmembership.FieldUpdatedAt, field.TypeTime, value) + } + if gmuo.mutation.UpdatedAtCleared() { + _spec.ClearField(groupmembership.FieldUpdatedAt, field.TypeTime) + } + if gmuo.mutation.CreatedByCleared() { + _spec.ClearField(groupmembership.FieldCreatedBy, field.TypeString) + } + if value, ok := gmuo.mutation.UpdatedBy(); ok { + _spec.SetField(groupmembership.FieldUpdatedBy, field.TypeString, value) + } + if gmuo.mutation.UpdatedByCleared() { + _spec.ClearField(groupmembership.FieldUpdatedBy, field.TypeString) + } + if value, ok := gmuo.mutation.DeletedAt(); ok { + _spec.SetField(groupmembership.FieldDeletedAt, field.TypeTime, value) + } + if gmuo.mutation.DeletedAtCleared() { + _spec.ClearField(groupmembership.FieldDeletedAt, field.TypeTime) + } + if value, ok := gmuo.mutation.DeletedBy(); ok { + _spec.SetField(groupmembership.FieldDeletedBy, field.TypeString, value) + } + if gmuo.mutation.DeletedByCleared() { + _spec.ClearField(groupmembership.FieldDeletedBy, field.TypeString) + } + if value, ok := gmuo.mutation.Role(); ok { + _spec.SetField(groupmembership.FieldRole, field.TypeEnum, value) + } + if gmuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gmuo.schemaConfig.GroupMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gmuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !gmuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gmuo.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gmuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: groupmembership.EventsTable, + Columns: groupmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = gmuo.schemaConfig.GroupMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = gmuo.schemaConfig.GroupMembership + ctx = internal.NewSchemaConfigContext(ctx, gmuo.schemaConfig) + _node = &GroupMembership{config: gmuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, gmuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupmembership.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + gmuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/groupmembershiphistory.go b/internal/ent/generated/groupmembershiphistory.go new file mode 100644 index 0000000..46b6b2e --- /dev/null +++ b/internal/ent/generated/groupmembershiphistory.go @@ -0,0 +1,240 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// GroupMembershipHistory is the model entity for the GroupMembershipHistory schema. +type GroupMembershipHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // Role holds the value of the "role" field. + Role enums.Role `json:"role,omitempty"` + // GroupID holds the value of the "group_id" field. + GroupID string `json:"group_id,omitempty"` + // UserID holds the value of the "user_id" field. + UserID string `json:"user_id,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*GroupMembershipHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case groupmembershiphistory.FieldOperation: + values[i] = new(history.OpType) + case groupmembershiphistory.FieldID, groupmembershiphistory.FieldRef, groupmembershiphistory.FieldCreatedBy, groupmembershiphistory.FieldUpdatedBy, groupmembershiphistory.FieldMappingID, groupmembershiphistory.FieldDeletedBy, groupmembershiphistory.FieldRole, groupmembershiphistory.FieldGroupID, groupmembershiphistory.FieldUserID: + values[i] = new(sql.NullString) + case groupmembershiphistory.FieldHistoryTime, groupmembershiphistory.FieldCreatedAt, groupmembershiphistory.FieldUpdatedAt, groupmembershiphistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the GroupMembershipHistory fields. +func (gmh *GroupMembershipHistory) 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 groupmembershiphistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + gmh.ID = value.String + } + case groupmembershiphistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + gmh.HistoryTime = value.Time + } + case groupmembershiphistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + gmh.Ref = value.String + } + case groupmembershiphistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + gmh.Operation = *value + } + case groupmembershiphistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + gmh.CreatedAt = value.Time + } + case groupmembershiphistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + gmh.UpdatedAt = value.Time + } + case groupmembershiphistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + gmh.CreatedBy = value.String + } + case groupmembershiphistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + gmh.UpdatedBy = value.String + } + case groupmembershiphistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + gmh.MappingID = value.String + } + case groupmembershiphistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + gmh.DeletedAt = value.Time + } + case groupmembershiphistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + gmh.DeletedBy = value.String + } + case groupmembershiphistory.FieldRole: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field role", values[i]) + } else if value.Valid { + gmh.Role = enums.Role(value.String) + } + case groupmembershiphistory.FieldGroupID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field group_id", values[i]) + } else if value.Valid { + gmh.GroupID = value.String + } + case groupmembershiphistory.FieldUserID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_id", values[i]) + } else if value.Valid { + gmh.UserID = value.String + } + default: + gmh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the GroupMembershipHistory. +// This includes values selected through modifiers, order, etc. +func (gmh *GroupMembershipHistory) Value(name string) (ent.Value, error) { + return gmh.selectValues.Get(name) +} + +// Update returns a builder for updating this GroupMembershipHistory. +// Note that you need to call GroupMembershipHistory.Unwrap() before calling this method if this GroupMembershipHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (gmh *GroupMembershipHistory) Update() *GroupMembershipHistoryUpdateOne { + return NewGroupMembershipHistoryClient(gmh.config).UpdateOne(gmh) +} + +// Unwrap unwraps the GroupMembershipHistory 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 (gmh *GroupMembershipHistory) Unwrap() *GroupMembershipHistory { + _tx, ok := gmh.config.driver.(*txDriver) + if !ok { + panic("generated: GroupMembershipHistory is not a transactional entity") + } + gmh.config.driver = _tx.drv + return gmh +} + +// String implements the fmt.Stringer. +func (gmh *GroupMembershipHistory) String() string { + var builder strings.Builder + builder.WriteString("GroupMembershipHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", gmh.ID)) + builder.WriteString("history_time=") + builder.WriteString(gmh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(gmh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", gmh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(gmh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(gmh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(gmh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(gmh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(gmh.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(gmh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(gmh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("role=") + builder.WriteString(fmt.Sprintf("%v", gmh.Role)) + builder.WriteString(", ") + builder.WriteString("group_id=") + builder.WriteString(gmh.GroupID) + builder.WriteString(", ") + builder.WriteString("user_id=") + builder.WriteString(gmh.UserID) + builder.WriteByte(')') + return builder.String() +} + +// GroupMembershipHistories is a parsable slice of GroupMembershipHistory. +type GroupMembershipHistories []*GroupMembershipHistory diff --git a/internal/ent/generated/groupmembershiphistory/groupmembershiphistory.go b/internal/ent/generated/groupmembershiphistory/groupmembershiphistory.go new file mode 100644 index 0000000..eaae434 --- /dev/null +++ b/internal/ent/generated/groupmembershiphistory/groupmembershiphistory.go @@ -0,0 +1,209 @@ +// Code generated by ent, DO NOT EDIT. + +package groupmembershiphistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the groupmembershiphistory type in the database. + Label = "group_membership_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldRole holds the string denoting the role field in the database. + FieldRole = "role" + // FieldGroupID holds the string denoting the group_id field in the database. + FieldGroupID = "group_id" + // FieldUserID holds the string denoting the user_id field in the database. + FieldUserID = "user_id" + // Table holds the table name of the groupmembershiphistory in the database. + Table = "group_membership_history" +) + +// Columns holds all SQL columns for groupmembershiphistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldRole, + FieldGroupID, + FieldUserID, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("groupmembershiphistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultRole enums.Role = "MEMBER" + +// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save. +func RoleValidator(r enums.Role) error { + switch r.String() { + case "ADMIN", "MEMBER", "USER": + return nil + default: + return fmt.Errorf("groupmembershiphistory: invalid enum value for role field: %q", r) + } +} + +// OrderOption defines the ordering options for the GroupMembershipHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByRole orders the results by the role field. +func ByRole(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRole, opts...).ToFunc() +} + +// ByGroupID orders the results by the group_id field. +func ByGroupID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGroupID, opts...).ToFunc() +} + +// ByUserID orders the results by the user_id field. +func ByUserID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserID, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.Role must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Role)(nil) + // enums.Role must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Role)(nil) +) diff --git a/internal/ent/generated/groupmembershiphistory/where.go b/internal/ent/generated/groupmembershiphistory/where.go new file mode 100644 index 0000000..6353f47 --- /dev/null +++ b/internal/ent/generated/groupmembershiphistory/where.go @@ -0,0 +1,872 @@ +// Code generated by ent, DO NOT EDIT. + +package groupmembershiphistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// GroupID applies equality check predicate on the "group_id" field. It's identical to GroupIDEQ. +func GroupID(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldGroupID, v)) +} + +// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. +func UserID(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldUserID, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v enums.Role) predicate.GroupMembershipHistory { + vc := v + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v enums.Role) predicate.GroupMembershipHistory { + vc := v + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...enums.Role) predicate.GroupMembershipHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupMembershipHistory(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...enums.Role) predicate.GroupMembershipHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldRole, v...)) +} + +// GroupIDEQ applies the EQ predicate on the "group_id" field. +func GroupIDEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldGroupID, v)) +} + +// GroupIDNEQ applies the NEQ predicate on the "group_id" field. +func GroupIDNEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldGroupID, v)) +} + +// GroupIDIn applies the In predicate on the "group_id" field. +func GroupIDIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldGroupID, vs...)) +} + +// GroupIDNotIn applies the NotIn predicate on the "group_id" field. +func GroupIDNotIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldGroupID, vs...)) +} + +// GroupIDGT applies the GT predicate on the "group_id" field. +func GroupIDGT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldGroupID, v)) +} + +// GroupIDGTE applies the GTE predicate on the "group_id" field. +func GroupIDGTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldGroupID, v)) +} + +// GroupIDLT applies the LT predicate on the "group_id" field. +func GroupIDLT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldGroupID, v)) +} + +// GroupIDLTE applies the LTE predicate on the "group_id" field. +func GroupIDLTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldGroupID, v)) +} + +// GroupIDContains applies the Contains predicate on the "group_id" field. +func GroupIDContains(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContains(FieldGroupID, v)) +} + +// GroupIDHasPrefix applies the HasPrefix predicate on the "group_id" field. +func GroupIDHasPrefix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasPrefix(FieldGroupID, v)) +} + +// GroupIDHasSuffix applies the HasSuffix predicate on the "group_id" field. +func GroupIDHasSuffix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasSuffix(FieldGroupID, v)) +} + +// GroupIDEqualFold applies the EqualFold predicate on the "group_id" field. +func GroupIDEqualFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldGroupID, v)) +} + +// GroupIDContainsFold applies the ContainsFold predicate on the "group_id" field. +func GroupIDContainsFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldGroupID, v)) +} + +// UserIDEQ applies the EQ predicate on the "user_id" field. +func UserIDEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEQ(FieldUserID, v)) +} + +// UserIDNEQ applies the NEQ predicate on the "user_id" field. +func UserIDNEQ(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNEQ(FieldUserID, v)) +} + +// UserIDIn applies the In predicate on the "user_id" field. +func UserIDIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldIn(FieldUserID, vs...)) +} + +// UserIDNotIn applies the NotIn predicate on the "user_id" field. +func UserIDNotIn(vs ...string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldNotIn(FieldUserID, vs...)) +} + +// UserIDGT applies the GT predicate on the "user_id" field. +func UserIDGT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGT(FieldUserID, v)) +} + +// UserIDGTE applies the GTE predicate on the "user_id" field. +func UserIDGTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldGTE(FieldUserID, v)) +} + +// UserIDLT applies the LT predicate on the "user_id" field. +func UserIDLT(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLT(FieldUserID, v)) +} + +// UserIDLTE applies the LTE predicate on the "user_id" field. +func UserIDLTE(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldLTE(FieldUserID, v)) +} + +// UserIDContains applies the Contains predicate on the "user_id" field. +func UserIDContains(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContains(FieldUserID, v)) +} + +// UserIDHasPrefix applies the HasPrefix predicate on the "user_id" field. +func UserIDHasPrefix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasPrefix(FieldUserID, v)) +} + +// UserIDHasSuffix applies the HasSuffix predicate on the "user_id" field. +func UserIDHasSuffix(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldHasSuffix(FieldUserID, v)) +} + +// UserIDEqualFold applies the EqualFold predicate on the "user_id" field. +func UserIDEqualFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldEqualFold(FieldUserID, v)) +} + +// UserIDContainsFold applies the ContainsFold predicate on the "user_id" field. +func UserIDContainsFold(v string) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.FieldContainsFold(FieldUserID, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.GroupMembershipHistory) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.GroupMembershipHistory) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.GroupMembershipHistory) predicate.GroupMembershipHistory { + return predicate.GroupMembershipHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/groupmembershiphistory_create.go b/internal/ent/generated/groupmembershiphistory_create.go new file mode 100644 index 0000000..8c536d3 --- /dev/null +++ b/internal/ent/generated/groupmembershiphistory_create.go @@ -0,0 +1,479 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// GroupMembershipHistoryCreate is the builder for creating a GroupMembershipHistory entity. +type GroupMembershipHistoryCreate struct { + config + mutation *GroupMembershipHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (gmhc *GroupMembershipHistoryCreate) SetHistoryTime(t time.Time) *GroupMembershipHistoryCreate { + gmhc.mutation.SetHistoryTime(t) + return gmhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableHistoryTime(t *time.Time) *GroupMembershipHistoryCreate { + if t != nil { + gmhc.SetHistoryTime(*t) + } + return gmhc +} + +// SetRef sets the "ref" field. +func (gmhc *GroupMembershipHistoryCreate) SetRef(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetRef(s) + return gmhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableRef(s *string) *GroupMembershipHistoryCreate { + if s != nil { + gmhc.SetRef(*s) + } + return gmhc +} + +// SetOperation sets the "operation" field. +func (gmhc *GroupMembershipHistoryCreate) SetOperation(ht history.OpType) *GroupMembershipHistoryCreate { + gmhc.mutation.SetOperation(ht) + return gmhc +} + +// SetCreatedAt sets the "created_at" field. +func (gmhc *GroupMembershipHistoryCreate) SetCreatedAt(t time.Time) *GroupMembershipHistoryCreate { + gmhc.mutation.SetCreatedAt(t) + return gmhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableCreatedAt(t *time.Time) *GroupMembershipHistoryCreate { + if t != nil { + gmhc.SetCreatedAt(*t) + } + return gmhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (gmhc *GroupMembershipHistoryCreate) SetUpdatedAt(t time.Time) *GroupMembershipHistoryCreate { + gmhc.mutation.SetUpdatedAt(t) + return gmhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableUpdatedAt(t *time.Time) *GroupMembershipHistoryCreate { + if t != nil { + gmhc.SetUpdatedAt(*t) + } + return gmhc +} + +// SetCreatedBy sets the "created_by" field. +func (gmhc *GroupMembershipHistoryCreate) SetCreatedBy(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetCreatedBy(s) + return gmhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableCreatedBy(s *string) *GroupMembershipHistoryCreate { + if s != nil { + gmhc.SetCreatedBy(*s) + } + return gmhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (gmhc *GroupMembershipHistoryCreate) SetUpdatedBy(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetUpdatedBy(s) + return gmhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableUpdatedBy(s *string) *GroupMembershipHistoryCreate { + if s != nil { + gmhc.SetUpdatedBy(*s) + } + return gmhc +} + +// SetMappingID sets the "mapping_id" field. +func (gmhc *GroupMembershipHistoryCreate) SetMappingID(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetMappingID(s) + return gmhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableMappingID(s *string) *GroupMembershipHistoryCreate { + if s != nil { + gmhc.SetMappingID(*s) + } + return gmhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (gmhc *GroupMembershipHistoryCreate) SetDeletedAt(t time.Time) *GroupMembershipHistoryCreate { + gmhc.mutation.SetDeletedAt(t) + return gmhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableDeletedAt(t *time.Time) *GroupMembershipHistoryCreate { + if t != nil { + gmhc.SetDeletedAt(*t) + } + return gmhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (gmhc *GroupMembershipHistoryCreate) SetDeletedBy(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetDeletedBy(s) + return gmhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableDeletedBy(s *string) *GroupMembershipHistoryCreate { + if s != nil { + gmhc.SetDeletedBy(*s) + } + return gmhc +} + +// SetRole sets the "role" field. +func (gmhc *GroupMembershipHistoryCreate) SetRole(e enums.Role) *GroupMembershipHistoryCreate { + gmhc.mutation.SetRole(e) + return gmhc +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableRole(e *enums.Role) *GroupMembershipHistoryCreate { + if e != nil { + gmhc.SetRole(*e) + } + return gmhc +} + +// SetGroupID sets the "group_id" field. +func (gmhc *GroupMembershipHistoryCreate) SetGroupID(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetGroupID(s) + return gmhc +} + +// SetUserID sets the "user_id" field. +func (gmhc *GroupMembershipHistoryCreate) SetUserID(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetUserID(s) + return gmhc +} + +// SetID sets the "id" field. +func (gmhc *GroupMembershipHistoryCreate) SetID(s string) *GroupMembershipHistoryCreate { + gmhc.mutation.SetID(s) + return gmhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (gmhc *GroupMembershipHistoryCreate) SetNillableID(s *string) *GroupMembershipHistoryCreate { + if s != nil { + gmhc.SetID(*s) + } + return gmhc +} + +// Mutation returns the GroupMembershipHistoryMutation object of the builder. +func (gmhc *GroupMembershipHistoryCreate) Mutation() *GroupMembershipHistoryMutation { + return gmhc.mutation +} + +// Save creates the GroupMembershipHistory in the database. +func (gmhc *GroupMembershipHistoryCreate) Save(ctx context.Context) (*GroupMembershipHistory, error) { + if err := gmhc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gmhc.sqlSave, gmhc.mutation, gmhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (gmhc *GroupMembershipHistoryCreate) SaveX(ctx context.Context) *GroupMembershipHistory { + v, err := gmhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gmhc *GroupMembershipHistoryCreate) Exec(ctx context.Context) error { + _, err := gmhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmhc *GroupMembershipHistoryCreate) ExecX(ctx context.Context) { + if err := gmhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gmhc *GroupMembershipHistoryCreate) defaults() error { + if _, ok := gmhc.mutation.HistoryTime(); !ok { + if groupmembershiphistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized groupmembershiphistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := groupmembershiphistory.DefaultHistoryTime() + gmhc.mutation.SetHistoryTime(v) + } + if _, ok := gmhc.mutation.CreatedAt(); !ok { + if groupmembershiphistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembershiphistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := groupmembershiphistory.DefaultCreatedAt() + gmhc.mutation.SetCreatedAt(v) + } + if _, ok := gmhc.mutation.UpdatedAt(); !ok { + if groupmembershiphistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembershiphistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupmembershiphistory.DefaultUpdatedAt() + gmhc.mutation.SetUpdatedAt(v) + } + if _, ok := gmhc.mutation.MappingID(); !ok { + if groupmembershiphistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized groupmembershiphistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := groupmembershiphistory.DefaultMappingID() + gmhc.mutation.SetMappingID(v) + } + if _, ok := gmhc.mutation.Role(); !ok { + v := groupmembershiphistory.DefaultRole + gmhc.mutation.SetRole(v) + } + if _, ok := gmhc.mutation.ID(); !ok { + if groupmembershiphistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized groupmembershiphistory.DefaultID (forgotten import generated/runtime?)") + } + v := groupmembershiphistory.DefaultID() + gmhc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gmhc *GroupMembershipHistoryCreate) check() error { + if _, ok := gmhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "GroupMembershipHistory.history_time"`)} + } + if _, ok := gmhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "GroupMembershipHistory.operation"`)} + } + if v, ok := gmhc.mutation.Operation(); ok { + if err := groupmembershiphistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "GroupMembershipHistory.operation": %w`, err)} + } + } + if _, ok := gmhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "GroupMembershipHistory.mapping_id"`)} + } + if _, ok := gmhc.mutation.Role(); !ok { + return &ValidationError{Name: "role", err: errors.New(`generated: missing required field "GroupMembershipHistory.role"`)} + } + if v, ok := gmhc.mutation.Role(); ok { + if err := groupmembershiphistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "GroupMembershipHistory.role": %w`, err)} + } + } + if _, ok := gmhc.mutation.GroupID(); !ok { + return &ValidationError{Name: "group_id", err: errors.New(`generated: missing required field "GroupMembershipHistory.group_id"`)} + } + if _, ok := gmhc.mutation.UserID(); !ok { + return &ValidationError{Name: "user_id", err: errors.New(`generated: missing required field "GroupMembershipHistory.user_id"`)} + } + return nil +} + +func (gmhc *GroupMembershipHistoryCreate) sqlSave(ctx context.Context) (*GroupMembershipHistory, error) { + if err := gmhc.check(); err != nil { + return nil, err + } + _node, _spec := gmhc.createSpec() + if err := sqlgraph.CreateNode(ctx, gmhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected GroupMembershipHistory.ID type: %T", _spec.ID.Value) + } + } + gmhc.mutation.id = &_node.ID + gmhc.mutation.done = true + return _node, nil +} + +func (gmhc *GroupMembershipHistoryCreate) createSpec() (*GroupMembershipHistory, *sqlgraph.CreateSpec) { + var ( + _node = &GroupMembershipHistory{config: gmhc.config} + _spec = sqlgraph.NewCreateSpec(groupmembershiphistory.Table, sqlgraph.NewFieldSpec(groupmembershiphistory.FieldID, field.TypeString)) + ) + _spec.Schema = gmhc.schemaConfig.GroupMembershipHistory + if id, ok := gmhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := gmhc.mutation.HistoryTime(); ok { + _spec.SetField(groupmembershiphistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := gmhc.mutation.Ref(); ok { + _spec.SetField(groupmembershiphistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := gmhc.mutation.Operation(); ok { + _spec.SetField(groupmembershiphistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := gmhc.mutation.CreatedAt(); ok { + _spec.SetField(groupmembershiphistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := gmhc.mutation.UpdatedAt(); ok { + _spec.SetField(groupmembershiphistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := gmhc.mutation.CreatedBy(); ok { + _spec.SetField(groupmembershiphistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := gmhc.mutation.UpdatedBy(); ok { + _spec.SetField(groupmembershiphistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := gmhc.mutation.MappingID(); ok { + _spec.SetField(groupmembershiphistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := gmhc.mutation.DeletedAt(); ok { + _spec.SetField(groupmembershiphistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := gmhc.mutation.DeletedBy(); ok { + _spec.SetField(groupmembershiphistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := gmhc.mutation.Role(); ok { + _spec.SetField(groupmembershiphistory.FieldRole, field.TypeEnum, value) + _node.Role = value + } + if value, ok := gmhc.mutation.GroupID(); ok { + _spec.SetField(groupmembershiphistory.FieldGroupID, field.TypeString, value) + _node.GroupID = value + } + if value, ok := gmhc.mutation.UserID(); ok { + _spec.SetField(groupmembershiphistory.FieldUserID, field.TypeString, value) + _node.UserID = value + } + return _node, _spec +} + +// GroupMembershipHistoryCreateBulk is the builder for creating many GroupMembershipHistory entities in bulk. +type GroupMembershipHistoryCreateBulk struct { + config + err error + builders []*GroupMembershipHistoryCreate +} + +// Save creates the GroupMembershipHistory entities in the database. +func (gmhcb *GroupMembershipHistoryCreateBulk) Save(ctx context.Context) ([]*GroupMembershipHistory, error) { + if gmhcb.err != nil { + return nil, gmhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(gmhcb.builders)) + nodes := make([]*GroupMembershipHistory, len(gmhcb.builders)) + mutators := make([]Mutator, len(gmhcb.builders)) + for i := range gmhcb.builders { + func(i int, root context.Context) { + builder := gmhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*GroupMembershipHistoryMutation) + 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, gmhcb.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, gmhcb.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, gmhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (gmhcb *GroupMembershipHistoryCreateBulk) SaveX(ctx context.Context) []*GroupMembershipHistory { + v, err := gmhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gmhcb *GroupMembershipHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := gmhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmhcb *GroupMembershipHistoryCreateBulk) ExecX(ctx context.Context) { + if err := gmhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupmembershiphistory_delete.go b/internal/ent/generated/groupmembershiphistory_delete.go new file mode 100644 index 0000000..889800f --- /dev/null +++ b/internal/ent/generated/groupmembershiphistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupMembershipHistoryDelete is the builder for deleting a GroupMembershipHistory entity. +type GroupMembershipHistoryDelete struct { + config + hooks []Hook + mutation *GroupMembershipHistoryMutation +} + +// Where appends a list predicates to the GroupMembershipHistoryDelete builder. +func (gmhd *GroupMembershipHistoryDelete) Where(ps ...predicate.GroupMembershipHistory) *GroupMembershipHistoryDelete { + gmhd.mutation.Where(ps...) + return gmhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (gmhd *GroupMembershipHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, gmhd.sqlExec, gmhd.mutation, gmhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmhd *GroupMembershipHistoryDelete) ExecX(ctx context.Context) int { + n, err := gmhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (gmhd *GroupMembershipHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(groupmembershiphistory.Table, sqlgraph.NewFieldSpec(groupmembershiphistory.FieldID, field.TypeString)) + _spec.Node.Schema = gmhd.schemaConfig.GroupMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, gmhd.schemaConfig) + if ps := gmhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, gmhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + gmhd.mutation.done = true + return affected, err +} + +// GroupMembershipHistoryDeleteOne is the builder for deleting a single GroupMembershipHistory entity. +type GroupMembershipHistoryDeleteOne struct { + gmhd *GroupMembershipHistoryDelete +} + +// Where appends a list predicates to the GroupMembershipHistoryDelete builder. +func (gmhdo *GroupMembershipHistoryDeleteOne) Where(ps ...predicate.GroupMembershipHistory) *GroupMembershipHistoryDeleteOne { + gmhdo.gmhd.mutation.Where(ps...) + return gmhdo +} + +// Exec executes the deletion query. +func (gmhdo *GroupMembershipHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := gmhdo.gmhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{groupmembershiphistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmhdo *GroupMembershipHistoryDeleteOne) ExecX(ctx context.Context) { + if err := gmhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupmembershiphistory_query.go b/internal/ent/generated/groupmembershiphistory_query.go new file mode 100644 index 0000000..f9b7976 --- /dev/null +++ b/internal/ent/generated/groupmembershiphistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupMembershipHistoryQuery is the builder for querying GroupMembershipHistory entities. +type GroupMembershipHistoryQuery struct { + config + ctx *QueryContext + order []groupmembershiphistory.OrderOption + inters []Interceptor + predicates []predicate.GroupMembershipHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*GroupMembershipHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the GroupMembershipHistoryQuery builder. +func (gmhq *GroupMembershipHistoryQuery) Where(ps ...predicate.GroupMembershipHistory) *GroupMembershipHistoryQuery { + gmhq.predicates = append(gmhq.predicates, ps...) + return gmhq +} + +// Limit the number of records to be returned by this query. +func (gmhq *GroupMembershipHistoryQuery) Limit(limit int) *GroupMembershipHistoryQuery { + gmhq.ctx.Limit = &limit + return gmhq +} + +// Offset to start from. +func (gmhq *GroupMembershipHistoryQuery) Offset(offset int) *GroupMembershipHistoryQuery { + gmhq.ctx.Offset = &offset + return gmhq +} + +// 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 (gmhq *GroupMembershipHistoryQuery) Unique(unique bool) *GroupMembershipHistoryQuery { + gmhq.ctx.Unique = &unique + return gmhq +} + +// Order specifies how the records should be ordered. +func (gmhq *GroupMembershipHistoryQuery) Order(o ...groupmembershiphistory.OrderOption) *GroupMembershipHistoryQuery { + gmhq.order = append(gmhq.order, o...) + return gmhq +} + +// First returns the first GroupMembershipHistory entity from the query. +// Returns a *NotFoundError when no GroupMembershipHistory was found. +func (gmhq *GroupMembershipHistoryQuery) First(ctx context.Context) (*GroupMembershipHistory, error) { + nodes, err := gmhq.Limit(1).All(setContextOp(ctx, gmhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{groupmembershiphistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) FirstX(ctx context.Context) *GroupMembershipHistory { + node, err := gmhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first GroupMembershipHistory ID from the query. +// Returns a *NotFoundError when no GroupMembershipHistory ID was found. +func (gmhq *GroupMembershipHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gmhq.Limit(1).IDs(setContextOp(ctx, gmhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{groupmembershiphistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := gmhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single GroupMembershipHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one GroupMembershipHistory entity is found. +// Returns a *NotFoundError when no GroupMembershipHistory entities are found. +func (gmhq *GroupMembershipHistoryQuery) Only(ctx context.Context) (*GroupMembershipHistory, error) { + nodes, err := gmhq.Limit(2).All(setContextOp(ctx, gmhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{groupmembershiphistory.Label} + default: + return nil, &NotSingularError{groupmembershiphistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) OnlyX(ctx context.Context) *GroupMembershipHistory { + node, err := gmhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only GroupMembershipHistory ID in the query. +// Returns a *NotSingularError when more than one GroupMembershipHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (gmhq *GroupMembershipHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gmhq.Limit(2).IDs(setContextOp(ctx, gmhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{groupmembershiphistory.Label} + default: + err = &NotSingularError{groupmembershiphistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := gmhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of GroupMembershipHistories. +func (gmhq *GroupMembershipHistoryQuery) All(ctx context.Context) ([]*GroupMembershipHistory, error) { + ctx = setContextOp(ctx, gmhq.ctx, ent.OpQueryAll) + if err := gmhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*GroupMembershipHistory, *GroupMembershipHistoryQuery]() + return withInterceptors[[]*GroupMembershipHistory](ctx, gmhq, qr, gmhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) AllX(ctx context.Context) []*GroupMembershipHistory { + nodes, err := gmhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of GroupMembershipHistory IDs. +func (gmhq *GroupMembershipHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if gmhq.ctx.Unique == nil && gmhq.path != nil { + gmhq.Unique(true) + } + ctx = setContextOp(ctx, gmhq.ctx, ent.OpQueryIDs) + if err = gmhq.Select(groupmembershiphistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := gmhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (gmhq *GroupMembershipHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, gmhq.ctx, ent.OpQueryCount) + if err := gmhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, gmhq, querierCount[*GroupMembershipHistoryQuery](), gmhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) CountX(ctx context.Context) int { + count, err := gmhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (gmhq *GroupMembershipHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, gmhq.ctx, ent.OpQueryExist) + switch _, err := gmhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (gmhq *GroupMembershipHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := gmhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the GroupMembershipHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (gmhq *GroupMembershipHistoryQuery) Clone() *GroupMembershipHistoryQuery { + if gmhq == nil { + return nil + } + return &GroupMembershipHistoryQuery{ + config: gmhq.config, + ctx: gmhq.ctx.Clone(), + order: append([]groupmembershiphistory.OrderOption{}, gmhq.order...), + inters: append([]Interceptor{}, gmhq.inters...), + predicates: append([]predicate.GroupMembershipHistory{}, gmhq.predicates...), + // clone intermediate query. + sql: gmhq.sql.Clone(), + path: gmhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.GroupMembershipHistory.Query(). +// GroupBy(groupmembershiphistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (gmhq *GroupMembershipHistoryQuery) GroupBy(field string, fields ...string) *GroupMembershipHistoryGroupBy { + gmhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &GroupMembershipHistoryGroupBy{build: gmhq} + grbuild.flds = &gmhq.ctx.Fields + grbuild.label = groupmembershiphistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.GroupMembershipHistory.Query(). +// Select(groupmembershiphistory.FieldHistoryTime). +// Scan(ctx, &v) +func (gmhq *GroupMembershipHistoryQuery) Select(fields ...string) *GroupMembershipHistorySelect { + gmhq.ctx.Fields = append(gmhq.ctx.Fields, fields...) + sbuild := &GroupMembershipHistorySelect{GroupMembershipHistoryQuery: gmhq} + sbuild.label = groupmembershiphistory.Label + sbuild.flds, sbuild.scan = &gmhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a GroupMembershipHistorySelect configured with the given aggregations. +func (gmhq *GroupMembershipHistoryQuery) Aggregate(fns ...AggregateFunc) *GroupMembershipHistorySelect { + return gmhq.Select().Aggregate(fns...) +} + +func (gmhq *GroupMembershipHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range gmhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, gmhq); err != nil { + return err + } + } + } + for _, f := range gmhq.ctx.Fields { + if !groupmembershiphistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if gmhq.path != nil { + prev, err := gmhq.path(ctx) + if err != nil { + return err + } + gmhq.sql = prev + } + if groupmembershiphistory.Policy == nil { + return errors.New("generated: uninitialized groupmembershiphistory.Policy (forgotten import generated/runtime?)") + } + if err := groupmembershiphistory.Policy.EvalQuery(ctx, gmhq); err != nil { + return err + } + return nil +} + +func (gmhq *GroupMembershipHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GroupMembershipHistory, error) { + var ( + nodes = []*GroupMembershipHistory{} + _spec = gmhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*GroupMembershipHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &GroupMembershipHistory{config: gmhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = gmhq.schemaConfig.GroupMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, gmhq.schemaConfig) + if len(gmhq.modifiers) > 0 { + _spec.Modifiers = gmhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, gmhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range gmhq.loadTotal { + if err := gmhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (gmhq *GroupMembershipHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := gmhq.querySpec() + _spec.Node.Schema = gmhq.schemaConfig.GroupMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, gmhq.schemaConfig) + if len(gmhq.modifiers) > 0 { + _spec.Modifiers = gmhq.modifiers + } + _spec.Node.Columns = gmhq.ctx.Fields + if len(gmhq.ctx.Fields) > 0 { + _spec.Unique = gmhq.ctx.Unique != nil && *gmhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, gmhq.driver, _spec) +} + +func (gmhq *GroupMembershipHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(groupmembershiphistory.Table, groupmembershiphistory.Columns, sqlgraph.NewFieldSpec(groupmembershiphistory.FieldID, field.TypeString)) + _spec.From = gmhq.sql + if unique := gmhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if gmhq.path != nil { + _spec.Unique = true + } + if fields := gmhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupmembershiphistory.FieldID) + for i := range fields { + if fields[i] != groupmembershiphistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := gmhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := gmhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := gmhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := gmhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (gmhq *GroupMembershipHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(gmhq.driver.Dialect()) + t1 := builder.Table(groupmembershiphistory.Table) + columns := gmhq.ctx.Fields + if len(columns) == 0 { + columns = groupmembershiphistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if gmhq.sql != nil { + selector = gmhq.sql + selector.Select(selector.Columns(columns...)...) + } + if gmhq.ctx.Unique != nil && *gmhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(gmhq.schemaConfig.GroupMembershipHistory) + ctx = internal.NewSchemaConfigContext(ctx, gmhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range gmhq.predicates { + p(selector) + } + for _, p := range gmhq.order { + p(selector) + } + if offset := gmhq.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 := gmhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// GroupMembershipHistoryGroupBy is the group-by builder for GroupMembershipHistory entities. +type GroupMembershipHistoryGroupBy struct { + selector + build *GroupMembershipHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (gmhgb *GroupMembershipHistoryGroupBy) Aggregate(fns ...AggregateFunc) *GroupMembershipHistoryGroupBy { + gmhgb.fns = append(gmhgb.fns, fns...) + return gmhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (gmhgb *GroupMembershipHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gmhgb.build.ctx, ent.OpQueryGroupBy) + if err := gmhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupMembershipHistoryQuery, *GroupMembershipHistoryGroupBy](ctx, gmhgb.build, gmhgb, gmhgb.build.inters, v) +} + +func (gmhgb *GroupMembershipHistoryGroupBy) sqlScan(ctx context.Context, root *GroupMembershipHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(gmhgb.fns)) + for _, fn := range gmhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*gmhgb.flds)+len(gmhgb.fns)) + for _, f := range *gmhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*gmhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := gmhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// GroupMembershipHistorySelect is the builder for selecting fields of GroupMembershipHistory entities. +type GroupMembershipHistorySelect struct { + *GroupMembershipHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (gmhs *GroupMembershipHistorySelect) Aggregate(fns ...AggregateFunc) *GroupMembershipHistorySelect { + gmhs.fns = append(gmhs.fns, fns...) + return gmhs +} + +// Scan applies the selector query and scans the result into the given value. +func (gmhs *GroupMembershipHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gmhs.ctx, ent.OpQuerySelect) + if err := gmhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupMembershipHistoryQuery, *GroupMembershipHistorySelect](ctx, gmhs.GroupMembershipHistoryQuery, gmhs, gmhs.inters, v) +} + +func (gmhs *GroupMembershipHistorySelect) sqlScan(ctx context.Context, root *GroupMembershipHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(gmhs.fns)) + for _, fn := range gmhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*gmhs.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 := gmhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/groupmembershiphistory_update.go b/internal/ent/generated/groupmembershiphistory_update.go new file mode 100644 index 0000000..bf94591 --- /dev/null +++ b/internal/ent/generated/groupmembershiphistory_update.go @@ -0,0 +1,483 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupMembershipHistoryUpdate is the builder for updating GroupMembershipHistory entities. +type GroupMembershipHistoryUpdate struct { + config + hooks []Hook + mutation *GroupMembershipHistoryMutation +} + +// Where appends a list predicates to the GroupMembershipHistoryUpdate builder. +func (gmhu *GroupMembershipHistoryUpdate) Where(ps ...predicate.GroupMembershipHistory) *GroupMembershipHistoryUpdate { + gmhu.mutation.Where(ps...) + return gmhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (gmhu *GroupMembershipHistoryUpdate) SetUpdatedAt(t time.Time) *GroupMembershipHistoryUpdate { + gmhu.mutation.SetUpdatedAt(t) + return gmhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gmhu *GroupMembershipHistoryUpdate) ClearUpdatedAt() *GroupMembershipHistoryUpdate { + gmhu.mutation.ClearUpdatedAt() + return gmhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (gmhu *GroupMembershipHistoryUpdate) SetUpdatedBy(s string) *GroupMembershipHistoryUpdate { + gmhu.mutation.SetUpdatedBy(s) + return gmhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gmhu *GroupMembershipHistoryUpdate) SetNillableUpdatedBy(s *string) *GroupMembershipHistoryUpdate { + if s != nil { + gmhu.SetUpdatedBy(*s) + } + return gmhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gmhu *GroupMembershipHistoryUpdate) ClearUpdatedBy() *GroupMembershipHistoryUpdate { + gmhu.mutation.ClearUpdatedBy() + return gmhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (gmhu *GroupMembershipHistoryUpdate) SetDeletedAt(t time.Time) *GroupMembershipHistoryUpdate { + gmhu.mutation.SetDeletedAt(t) + return gmhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gmhu *GroupMembershipHistoryUpdate) SetNillableDeletedAt(t *time.Time) *GroupMembershipHistoryUpdate { + if t != nil { + gmhu.SetDeletedAt(*t) + } + return gmhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gmhu *GroupMembershipHistoryUpdate) ClearDeletedAt() *GroupMembershipHistoryUpdate { + gmhu.mutation.ClearDeletedAt() + return gmhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (gmhu *GroupMembershipHistoryUpdate) SetDeletedBy(s string) *GroupMembershipHistoryUpdate { + gmhu.mutation.SetDeletedBy(s) + return gmhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gmhu *GroupMembershipHistoryUpdate) SetNillableDeletedBy(s *string) *GroupMembershipHistoryUpdate { + if s != nil { + gmhu.SetDeletedBy(*s) + } + return gmhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gmhu *GroupMembershipHistoryUpdate) ClearDeletedBy() *GroupMembershipHistoryUpdate { + gmhu.mutation.ClearDeletedBy() + return gmhu +} + +// SetRole sets the "role" field. +func (gmhu *GroupMembershipHistoryUpdate) SetRole(e enums.Role) *GroupMembershipHistoryUpdate { + gmhu.mutation.SetRole(e) + return gmhu +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (gmhu *GroupMembershipHistoryUpdate) SetNillableRole(e *enums.Role) *GroupMembershipHistoryUpdate { + if e != nil { + gmhu.SetRole(*e) + } + return gmhu +} + +// Mutation returns the GroupMembershipHistoryMutation object of the builder. +func (gmhu *GroupMembershipHistoryUpdate) Mutation() *GroupMembershipHistoryMutation { + return gmhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (gmhu *GroupMembershipHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := gmhu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, gmhu.sqlSave, gmhu.mutation, gmhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gmhu *GroupMembershipHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := gmhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (gmhu *GroupMembershipHistoryUpdate) Exec(ctx context.Context) error { + _, err := gmhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmhu *GroupMembershipHistoryUpdate) ExecX(ctx context.Context) { + if err := gmhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gmhu *GroupMembershipHistoryUpdate) defaults() error { + if _, ok := gmhu.mutation.UpdatedAt(); !ok && !gmhu.mutation.UpdatedAtCleared() { + if groupmembershiphistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembershiphistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupmembershiphistory.UpdateDefaultUpdatedAt() + gmhu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gmhu *GroupMembershipHistoryUpdate) check() error { + if v, ok := gmhu.mutation.Role(); ok { + if err := groupmembershiphistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "GroupMembershipHistory.role": %w`, err)} + } + } + return nil +} + +func (gmhu *GroupMembershipHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := gmhu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(groupmembershiphistory.Table, groupmembershiphistory.Columns, sqlgraph.NewFieldSpec(groupmembershiphistory.FieldID, field.TypeString)) + if ps := gmhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gmhu.mutation.RefCleared() { + _spec.ClearField(groupmembershiphistory.FieldRef, field.TypeString) + } + if gmhu.mutation.CreatedAtCleared() { + _spec.ClearField(groupmembershiphistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := gmhu.mutation.UpdatedAt(); ok { + _spec.SetField(groupmembershiphistory.FieldUpdatedAt, field.TypeTime, value) + } + if gmhu.mutation.UpdatedAtCleared() { + _spec.ClearField(groupmembershiphistory.FieldUpdatedAt, field.TypeTime) + } + if gmhu.mutation.CreatedByCleared() { + _spec.ClearField(groupmembershiphistory.FieldCreatedBy, field.TypeString) + } + if value, ok := gmhu.mutation.UpdatedBy(); ok { + _spec.SetField(groupmembershiphistory.FieldUpdatedBy, field.TypeString, value) + } + if gmhu.mutation.UpdatedByCleared() { + _spec.ClearField(groupmembershiphistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := gmhu.mutation.DeletedAt(); ok { + _spec.SetField(groupmembershiphistory.FieldDeletedAt, field.TypeTime, value) + } + if gmhu.mutation.DeletedAtCleared() { + _spec.ClearField(groupmembershiphistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := gmhu.mutation.DeletedBy(); ok { + _spec.SetField(groupmembershiphistory.FieldDeletedBy, field.TypeString, value) + } + if gmhu.mutation.DeletedByCleared() { + _spec.ClearField(groupmembershiphistory.FieldDeletedBy, field.TypeString) + } + if value, ok := gmhu.mutation.Role(); ok { + _spec.SetField(groupmembershiphistory.FieldRole, field.TypeEnum, value) + } + _spec.Node.Schema = gmhu.schemaConfig.GroupMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, gmhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, gmhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupmembershiphistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + gmhu.mutation.done = true + return n, nil +} + +// GroupMembershipHistoryUpdateOne is the builder for updating a single GroupMembershipHistory entity. +type GroupMembershipHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *GroupMembershipHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetUpdatedAt(t time.Time) *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.SetUpdatedAt(t) + return gmhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) ClearUpdatedAt() *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.ClearUpdatedAt() + return gmhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetUpdatedBy(s string) *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.SetUpdatedBy(s) + return gmhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetNillableUpdatedBy(s *string) *GroupMembershipHistoryUpdateOne { + if s != nil { + gmhuo.SetUpdatedBy(*s) + } + return gmhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) ClearUpdatedBy() *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.ClearUpdatedBy() + return gmhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetDeletedAt(t time.Time) *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.SetDeletedAt(t) + return gmhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *GroupMembershipHistoryUpdateOne { + if t != nil { + gmhuo.SetDeletedAt(*t) + } + return gmhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) ClearDeletedAt() *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.ClearDeletedAt() + return gmhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetDeletedBy(s string) *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.SetDeletedBy(s) + return gmhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetNillableDeletedBy(s *string) *GroupMembershipHistoryUpdateOne { + if s != nil { + gmhuo.SetDeletedBy(*s) + } + return gmhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) ClearDeletedBy() *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.ClearDeletedBy() + return gmhuo +} + +// SetRole sets the "role" field. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetRole(e enums.Role) *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.SetRole(e) + return gmhuo +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (gmhuo *GroupMembershipHistoryUpdateOne) SetNillableRole(e *enums.Role) *GroupMembershipHistoryUpdateOne { + if e != nil { + gmhuo.SetRole(*e) + } + return gmhuo +} + +// Mutation returns the GroupMembershipHistoryMutation object of the builder. +func (gmhuo *GroupMembershipHistoryUpdateOne) Mutation() *GroupMembershipHistoryMutation { + return gmhuo.mutation +} + +// Where appends a list predicates to the GroupMembershipHistoryUpdate builder. +func (gmhuo *GroupMembershipHistoryUpdateOne) Where(ps ...predicate.GroupMembershipHistory) *GroupMembershipHistoryUpdateOne { + gmhuo.mutation.Where(ps...) + return gmhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (gmhuo *GroupMembershipHistoryUpdateOne) Select(field string, fields ...string) *GroupMembershipHistoryUpdateOne { + gmhuo.fields = append([]string{field}, fields...) + return gmhuo +} + +// Save executes the query and returns the updated GroupMembershipHistory entity. +func (gmhuo *GroupMembershipHistoryUpdateOne) Save(ctx context.Context) (*GroupMembershipHistory, error) { + if err := gmhuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gmhuo.sqlSave, gmhuo.mutation, gmhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gmhuo *GroupMembershipHistoryUpdateOne) SaveX(ctx context.Context) *GroupMembershipHistory { + node, err := gmhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (gmhuo *GroupMembershipHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := gmhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gmhuo *GroupMembershipHistoryUpdateOne) ExecX(ctx context.Context) { + if err := gmhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gmhuo *GroupMembershipHistoryUpdateOne) defaults() error { + if _, ok := gmhuo.mutation.UpdatedAt(); !ok && !gmhuo.mutation.UpdatedAtCleared() { + if groupmembershiphistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupmembershiphistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupmembershiphistory.UpdateDefaultUpdatedAt() + gmhuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gmhuo *GroupMembershipHistoryUpdateOne) check() error { + if v, ok := gmhuo.mutation.Role(); ok { + if err := groupmembershiphistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "GroupMembershipHistory.role": %w`, err)} + } + } + return nil +} + +func (gmhuo *GroupMembershipHistoryUpdateOne) sqlSave(ctx context.Context) (_node *GroupMembershipHistory, err error) { + if err := gmhuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(groupmembershiphistory.Table, groupmembershiphistory.Columns, sqlgraph.NewFieldSpec(groupmembershiphistory.FieldID, field.TypeString)) + id, ok := gmhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "GroupMembershipHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := gmhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupmembershiphistory.FieldID) + for _, f := range fields { + if !groupmembershiphistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != groupmembershiphistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := gmhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gmhuo.mutation.RefCleared() { + _spec.ClearField(groupmembershiphistory.FieldRef, field.TypeString) + } + if gmhuo.mutation.CreatedAtCleared() { + _spec.ClearField(groupmembershiphistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := gmhuo.mutation.UpdatedAt(); ok { + _spec.SetField(groupmembershiphistory.FieldUpdatedAt, field.TypeTime, value) + } + if gmhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(groupmembershiphistory.FieldUpdatedAt, field.TypeTime) + } + if gmhuo.mutation.CreatedByCleared() { + _spec.ClearField(groupmembershiphistory.FieldCreatedBy, field.TypeString) + } + if value, ok := gmhuo.mutation.UpdatedBy(); ok { + _spec.SetField(groupmembershiphistory.FieldUpdatedBy, field.TypeString, value) + } + if gmhuo.mutation.UpdatedByCleared() { + _spec.ClearField(groupmembershiphistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := gmhuo.mutation.DeletedAt(); ok { + _spec.SetField(groupmembershiphistory.FieldDeletedAt, field.TypeTime, value) + } + if gmhuo.mutation.DeletedAtCleared() { + _spec.ClearField(groupmembershiphistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := gmhuo.mutation.DeletedBy(); ok { + _spec.SetField(groupmembershiphistory.FieldDeletedBy, field.TypeString, value) + } + if gmhuo.mutation.DeletedByCleared() { + _spec.ClearField(groupmembershiphistory.FieldDeletedBy, field.TypeString) + } + if value, ok := gmhuo.mutation.Role(); ok { + _spec.SetField(groupmembershiphistory.FieldRole, field.TypeEnum, value) + } + _spec.Node.Schema = gmhuo.schemaConfig.GroupMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, gmhuo.schemaConfig) + _node = &GroupMembershipHistory{config: gmhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, gmhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupmembershiphistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + gmhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/groupsetting.go b/internal/ent/generated/groupsetting.go new file mode 100644 index 0000000..dd3f606 --- /dev/null +++ b/internal/ent/generated/groupsetting.go @@ -0,0 +1,275 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/pkg/enums" +) + +// GroupSetting is the model entity for the GroupSetting schema. +type GroupSetting struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility enums.Visibility `json:"visibility,omitempty"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy enums.JoinPolicy `json:"join_policy,omitempty"` + // whether to sync group members to slack groups + SyncToSlack bool `json:"sync_to_slack,omitempty"` + // whether to sync group members to github groups + SyncToGithub bool `json:"sync_to_github,omitempty"` + // the group id associated with the settings + GroupID string `json:"group_id,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the GroupSettingQuery when eager-loading is set. + Edges GroupSettingEdges `json:"edges"` + selectValues sql.SelectValues +} + +// GroupSettingEdges holds the relations/edges for other nodes in the graph. +type GroupSettingEdges struct { + // Group holds the value of the group edge. + Group *Group `json:"group,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 +} + +// GroupOrErr returns the Group value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e GroupSettingEdges) GroupOrErr() (*Group, error) { + if e.Group != nil { + return e.Group, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: group.Label} + } + return nil, &NotLoadedError{edge: "group"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*GroupSetting) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case groupsetting.FieldTags: + values[i] = new([]byte) + case groupsetting.FieldSyncToSlack, groupsetting.FieldSyncToGithub: + values[i] = new(sql.NullBool) + case groupsetting.FieldID, groupsetting.FieldCreatedBy, groupsetting.FieldUpdatedBy, groupsetting.FieldMappingID, groupsetting.FieldDeletedBy, groupsetting.FieldVisibility, groupsetting.FieldJoinPolicy, groupsetting.FieldGroupID: + values[i] = new(sql.NullString) + case groupsetting.FieldCreatedAt, groupsetting.FieldUpdatedAt, groupsetting.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the GroupSetting fields. +func (gs *GroupSetting) 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 groupsetting.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + gs.ID = value.String + } + case groupsetting.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + gs.CreatedAt = value.Time + } + case groupsetting.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + gs.UpdatedAt = value.Time + } + case groupsetting.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + gs.CreatedBy = value.String + } + case groupsetting.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + gs.UpdatedBy = value.String + } + case groupsetting.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + gs.MappingID = value.String + } + case groupsetting.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &gs.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case groupsetting.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + gs.DeletedAt = value.Time + } + case groupsetting.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + gs.DeletedBy = value.String + } + case groupsetting.FieldVisibility: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field visibility", values[i]) + } else if value.Valid { + gs.Visibility = enums.Visibility(value.String) + } + case groupsetting.FieldJoinPolicy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field join_policy", values[i]) + } else if value.Valid { + gs.JoinPolicy = enums.JoinPolicy(value.String) + } + case groupsetting.FieldSyncToSlack: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field sync_to_slack", values[i]) + } else if value.Valid { + gs.SyncToSlack = value.Bool + } + case groupsetting.FieldSyncToGithub: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field sync_to_github", values[i]) + } else if value.Valid { + gs.SyncToGithub = value.Bool + } + case groupsetting.FieldGroupID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field group_id", values[i]) + } else if value.Valid { + gs.GroupID = value.String + } + default: + gs.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the GroupSetting. +// This includes values selected through modifiers, order, etc. +func (gs *GroupSetting) Value(name string) (ent.Value, error) { + return gs.selectValues.Get(name) +} + +// QueryGroup queries the "group" edge of the GroupSetting entity. +func (gs *GroupSetting) QueryGroup() *GroupQuery { + return NewGroupSettingClient(gs.config).QueryGroup(gs) +} + +// Update returns a builder for updating this GroupSetting. +// Note that you need to call GroupSetting.Unwrap() before calling this method if this GroupSetting +// was returned from a transaction, and the transaction was committed or rolled back. +func (gs *GroupSetting) Update() *GroupSettingUpdateOne { + return NewGroupSettingClient(gs.config).UpdateOne(gs) +} + +// Unwrap unwraps the GroupSetting 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 (gs *GroupSetting) Unwrap() *GroupSetting { + _tx, ok := gs.config.driver.(*txDriver) + if !ok { + panic("generated: GroupSetting is not a transactional entity") + } + gs.config.driver = _tx.drv + return gs +} + +// String implements the fmt.Stringer. +func (gs *GroupSetting) String() string { + var builder strings.Builder + builder.WriteString("GroupSetting(") + builder.WriteString(fmt.Sprintf("id=%v, ", gs.ID)) + builder.WriteString("created_at=") + builder.WriteString(gs.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(gs.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(gs.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(gs.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(gs.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", gs.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(gs.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(gs.DeletedBy) + builder.WriteString(", ") + builder.WriteString("visibility=") + builder.WriteString(fmt.Sprintf("%v", gs.Visibility)) + builder.WriteString(", ") + builder.WriteString("join_policy=") + builder.WriteString(fmt.Sprintf("%v", gs.JoinPolicy)) + builder.WriteString(", ") + builder.WriteString("sync_to_slack=") + builder.WriteString(fmt.Sprintf("%v", gs.SyncToSlack)) + builder.WriteString(", ") + builder.WriteString("sync_to_github=") + builder.WriteString(fmt.Sprintf("%v", gs.SyncToGithub)) + builder.WriteString(", ") + builder.WriteString("group_id=") + builder.WriteString(gs.GroupID) + builder.WriteByte(')') + return builder.String() +} + +// GroupSettings is a parsable slice of GroupSetting. +type GroupSettings []*GroupSetting diff --git a/internal/ent/generated/groupsetting/groupsetting.go b/internal/ent/generated/groupsetting/groupsetting.go new file mode 100644 index 0000000..453bdc8 --- /dev/null +++ b/internal/ent/generated/groupsetting/groupsetting.go @@ -0,0 +1,233 @@ +// Code generated by ent, DO NOT EDIT. + +package groupsetting + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the groupsetting type in the database. + Label = "group_setting" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldVisibility holds the string denoting the visibility field in the database. + FieldVisibility = "visibility" + // FieldJoinPolicy holds the string denoting the join_policy field in the database. + FieldJoinPolicy = "join_policy" + // FieldSyncToSlack holds the string denoting the sync_to_slack field in the database. + FieldSyncToSlack = "sync_to_slack" + // FieldSyncToGithub holds the string denoting the sync_to_github field in the database. + FieldSyncToGithub = "sync_to_github" + // FieldGroupID holds the string denoting the group_id field in the database. + FieldGroupID = "group_id" + // EdgeGroup holds the string denoting the group edge name in mutations. + EdgeGroup = "group" + // Table holds the table name of the groupsetting in the database. + Table = "group_settings" + // GroupTable is the table that holds the group relation/edge. + GroupTable = "group_settings" + // GroupInverseTable is the table name for the Group entity. + // It exists in this package in order to avoid circular dependency with the "group" package. + GroupInverseTable = "groups" + // GroupColumn is the table column denoting the group relation/edge. + GroupColumn = "group_id" +) + +// Columns holds all SQL columns for groupsetting fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldVisibility, + FieldJoinPolicy, + FieldSyncToSlack, + FieldSyncToGithub, + FieldGroupID, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [3]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultSyncToSlack holds the default value on creation for the "sync_to_slack" field. + DefaultSyncToSlack bool + // DefaultSyncToGithub holds the default value on creation for the "sync_to_github" field. + DefaultSyncToGithub bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultVisibility enums.Visibility = "PUBLIC" + +// VisibilityValidator is a validator for the "visibility" field enum values. It is called by the builders before save. +func VisibilityValidator(v enums.Visibility) error { + switch v.String() { + case "PUBLIC", "PRIVATE": + return nil + default: + return fmt.Errorf("groupsetting: invalid enum value for visibility field: %q", v) + } +} + +const DefaultJoinPolicy enums.JoinPolicy = "INVITE_OR_APPLICATION" + +// JoinPolicyValidator is a validator for the "join_policy" field enum values. It is called by the builders before save. +func JoinPolicyValidator(jp enums.JoinPolicy) error { + switch jp.String() { + case "OPEN", "INVITE_ONLY", "APPLICATION_ONLY", "INVITE_OR_APPLICATION": + return nil + default: + return fmt.Errorf("groupsetting: invalid enum value for join_policy field: %q", jp) + } +} + +// OrderOption defines the ordering options for the GroupSetting queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByVisibility orders the results by the visibility field. +func ByVisibility(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldVisibility, opts...).ToFunc() +} + +// ByJoinPolicy orders the results by the join_policy field. +func ByJoinPolicy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldJoinPolicy, opts...).ToFunc() +} + +// BySyncToSlack orders the results by the sync_to_slack field. +func BySyncToSlack(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSyncToSlack, opts...).ToFunc() +} + +// BySyncToGithub orders the results by the sync_to_github field. +func BySyncToGithub(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSyncToGithub, opts...).ToFunc() +} + +// ByGroupID orders the results by the group_id field. +func ByGroupID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGroupID, opts...).ToFunc() +} + +// ByGroupField orders the results by group field. +func ByGroupField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupStep(), sql.OrderByField(field, opts...)) + } +} +func newGroupStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, GroupTable, GroupColumn), + ) +} + +var ( + // enums.Visibility must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Visibility)(nil) + // enums.Visibility must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Visibility)(nil) +) + +var ( + // enums.JoinPolicy must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.JoinPolicy)(nil) + // enums.JoinPolicy must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.JoinPolicy)(nil) +) diff --git a/internal/ent/generated/groupsetting/where.go b/internal/ent/generated/groupsetting/where.go new file mode 100644 index 0000000..237e8fa --- /dev/null +++ b/internal/ent/generated/groupsetting/where.go @@ -0,0 +1,788 @@ +// Code generated by ent, DO NOT EDIT. + +package groupsetting + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// SyncToSlack applies equality check predicate on the "sync_to_slack" field. It's identical to SyncToSlackEQ. +func SyncToSlack(v bool) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldSyncToSlack, v)) +} + +// SyncToGithub applies equality check predicate on the "sync_to_github" field. It's identical to SyncToGithubEQ. +func SyncToGithub(v bool) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldSyncToGithub, v)) +} + +// GroupID applies equality check predicate on the "group_id" field. It's identical to GroupIDEQ. +func GroupID(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldGroupID, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// VisibilityEQ applies the EQ predicate on the "visibility" field. +func VisibilityEQ(v enums.Visibility) predicate.GroupSetting { + vc := v + return predicate.GroupSetting(sql.FieldEQ(FieldVisibility, vc)) +} + +// VisibilityNEQ applies the NEQ predicate on the "visibility" field. +func VisibilityNEQ(v enums.Visibility) predicate.GroupSetting { + vc := v + return predicate.GroupSetting(sql.FieldNEQ(FieldVisibility, vc)) +} + +// VisibilityIn applies the In predicate on the "visibility" field. +func VisibilityIn(vs ...enums.Visibility) predicate.GroupSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSetting(sql.FieldIn(FieldVisibility, v...)) +} + +// VisibilityNotIn applies the NotIn predicate on the "visibility" field. +func VisibilityNotIn(vs ...enums.Visibility) predicate.GroupSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSetting(sql.FieldNotIn(FieldVisibility, v...)) +} + +// JoinPolicyEQ applies the EQ predicate on the "join_policy" field. +func JoinPolicyEQ(v enums.JoinPolicy) predicate.GroupSetting { + vc := v + return predicate.GroupSetting(sql.FieldEQ(FieldJoinPolicy, vc)) +} + +// JoinPolicyNEQ applies the NEQ predicate on the "join_policy" field. +func JoinPolicyNEQ(v enums.JoinPolicy) predicate.GroupSetting { + vc := v + return predicate.GroupSetting(sql.FieldNEQ(FieldJoinPolicy, vc)) +} + +// JoinPolicyIn applies the In predicate on the "join_policy" field. +func JoinPolicyIn(vs ...enums.JoinPolicy) predicate.GroupSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSetting(sql.FieldIn(FieldJoinPolicy, v...)) +} + +// JoinPolicyNotIn applies the NotIn predicate on the "join_policy" field. +func JoinPolicyNotIn(vs ...enums.JoinPolicy) predicate.GroupSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSetting(sql.FieldNotIn(FieldJoinPolicy, v...)) +} + +// SyncToSlackEQ applies the EQ predicate on the "sync_to_slack" field. +func SyncToSlackEQ(v bool) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldSyncToSlack, v)) +} + +// SyncToSlackNEQ applies the NEQ predicate on the "sync_to_slack" field. +func SyncToSlackNEQ(v bool) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldSyncToSlack, v)) +} + +// SyncToSlackIsNil applies the IsNil predicate on the "sync_to_slack" field. +func SyncToSlackIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldSyncToSlack)) +} + +// SyncToSlackNotNil applies the NotNil predicate on the "sync_to_slack" field. +func SyncToSlackNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldSyncToSlack)) +} + +// SyncToGithubEQ applies the EQ predicate on the "sync_to_github" field. +func SyncToGithubEQ(v bool) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldSyncToGithub, v)) +} + +// SyncToGithubNEQ applies the NEQ predicate on the "sync_to_github" field. +func SyncToGithubNEQ(v bool) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldSyncToGithub, v)) +} + +// SyncToGithubIsNil applies the IsNil predicate on the "sync_to_github" field. +func SyncToGithubIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldSyncToGithub)) +} + +// SyncToGithubNotNil applies the NotNil predicate on the "sync_to_github" field. +func SyncToGithubNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldSyncToGithub)) +} + +// GroupIDEQ applies the EQ predicate on the "group_id" field. +func GroupIDEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEQ(FieldGroupID, v)) +} + +// GroupIDNEQ applies the NEQ predicate on the "group_id" field. +func GroupIDNEQ(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNEQ(FieldGroupID, v)) +} + +// GroupIDIn applies the In predicate on the "group_id" field. +func GroupIDIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIn(FieldGroupID, vs...)) +} + +// GroupIDNotIn applies the NotIn predicate on the "group_id" field. +func GroupIDNotIn(vs ...string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotIn(FieldGroupID, vs...)) +} + +// GroupIDGT applies the GT predicate on the "group_id" field. +func GroupIDGT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGT(FieldGroupID, v)) +} + +// GroupIDGTE applies the GTE predicate on the "group_id" field. +func GroupIDGTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldGTE(FieldGroupID, v)) +} + +// GroupIDLT applies the LT predicate on the "group_id" field. +func GroupIDLT(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLT(FieldGroupID, v)) +} + +// GroupIDLTE applies the LTE predicate on the "group_id" field. +func GroupIDLTE(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldLTE(FieldGroupID, v)) +} + +// GroupIDContains applies the Contains predicate on the "group_id" field. +func GroupIDContains(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContains(FieldGroupID, v)) +} + +// GroupIDHasPrefix applies the HasPrefix predicate on the "group_id" field. +func GroupIDHasPrefix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasPrefix(FieldGroupID, v)) +} + +// GroupIDHasSuffix applies the HasSuffix predicate on the "group_id" field. +func GroupIDHasSuffix(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldHasSuffix(FieldGroupID, v)) +} + +// GroupIDIsNil applies the IsNil predicate on the "group_id" field. +func GroupIDIsNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldIsNull(FieldGroupID)) +} + +// GroupIDNotNil applies the NotNil predicate on the "group_id" field. +func GroupIDNotNil() predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldNotNull(FieldGroupID)) +} + +// GroupIDEqualFold applies the EqualFold predicate on the "group_id" field. +func GroupIDEqualFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldEqualFold(FieldGroupID, v)) +} + +// GroupIDContainsFold applies the ContainsFold predicate on the "group_id" field. +func GroupIDContainsFold(v string) predicate.GroupSetting { + return predicate.GroupSetting(sql.FieldContainsFold(FieldGroupID, v)) +} + +// HasGroup applies the HasEdge predicate on the "group" edge. +func HasGroup() predicate.GroupSetting { + return predicate.GroupSetting(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, GroupTable, GroupColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupSetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupWith applies the HasEdge predicate on the "group" edge with a given conditions (other predicates). +func HasGroupWith(preds ...predicate.Group) predicate.GroupSetting { + return predicate.GroupSetting(func(s *sql.Selector) { + step := newGroupStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupSetting + 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.GroupSetting) predicate.GroupSetting { + return predicate.GroupSetting(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.GroupSetting) predicate.GroupSetting { + return predicate.GroupSetting(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.GroupSetting) predicate.GroupSetting { + return predicate.GroupSetting(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/groupsetting_create.go b/internal/ent/generated/groupsetting_create.go new file mode 100644 index 0000000..8bbf403 --- /dev/null +++ b/internal/ent/generated/groupsetting_create.go @@ -0,0 +1,514 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/pkg/enums" +) + +// GroupSettingCreate is the builder for creating a GroupSetting entity. +type GroupSettingCreate struct { + config + mutation *GroupSettingMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (gsc *GroupSettingCreate) SetCreatedAt(t time.Time) *GroupSettingCreate { + gsc.mutation.SetCreatedAt(t) + return gsc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableCreatedAt(t *time.Time) *GroupSettingCreate { + if t != nil { + gsc.SetCreatedAt(*t) + } + return gsc +} + +// SetUpdatedAt sets the "updated_at" field. +func (gsc *GroupSettingCreate) SetUpdatedAt(t time.Time) *GroupSettingCreate { + gsc.mutation.SetUpdatedAt(t) + return gsc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableUpdatedAt(t *time.Time) *GroupSettingCreate { + if t != nil { + gsc.SetUpdatedAt(*t) + } + return gsc +} + +// SetCreatedBy sets the "created_by" field. +func (gsc *GroupSettingCreate) SetCreatedBy(s string) *GroupSettingCreate { + gsc.mutation.SetCreatedBy(s) + return gsc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableCreatedBy(s *string) *GroupSettingCreate { + if s != nil { + gsc.SetCreatedBy(*s) + } + return gsc +} + +// SetUpdatedBy sets the "updated_by" field. +func (gsc *GroupSettingCreate) SetUpdatedBy(s string) *GroupSettingCreate { + gsc.mutation.SetUpdatedBy(s) + return gsc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableUpdatedBy(s *string) *GroupSettingCreate { + if s != nil { + gsc.SetUpdatedBy(*s) + } + return gsc +} + +// SetMappingID sets the "mapping_id" field. +func (gsc *GroupSettingCreate) SetMappingID(s string) *GroupSettingCreate { + gsc.mutation.SetMappingID(s) + return gsc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableMappingID(s *string) *GroupSettingCreate { + if s != nil { + gsc.SetMappingID(*s) + } + return gsc +} + +// SetTags sets the "tags" field. +func (gsc *GroupSettingCreate) SetTags(s []string) *GroupSettingCreate { + gsc.mutation.SetTags(s) + return gsc +} + +// SetDeletedAt sets the "deleted_at" field. +func (gsc *GroupSettingCreate) SetDeletedAt(t time.Time) *GroupSettingCreate { + gsc.mutation.SetDeletedAt(t) + return gsc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableDeletedAt(t *time.Time) *GroupSettingCreate { + if t != nil { + gsc.SetDeletedAt(*t) + } + return gsc +} + +// SetDeletedBy sets the "deleted_by" field. +func (gsc *GroupSettingCreate) SetDeletedBy(s string) *GroupSettingCreate { + gsc.mutation.SetDeletedBy(s) + return gsc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableDeletedBy(s *string) *GroupSettingCreate { + if s != nil { + gsc.SetDeletedBy(*s) + } + return gsc +} + +// SetVisibility sets the "visibility" field. +func (gsc *GroupSettingCreate) SetVisibility(e enums.Visibility) *GroupSettingCreate { + gsc.mutation.SetVisibility(e) + return gsc +} + +// SetNillableVisibility sets the "visibility" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableVisibility(e *enums.Visibility) *GroupSettingCreate { + if e != nil { + gsc.SetVisibility(*e) + } + return gsc +} + +// SetJoinPolicy sets the "join_policy" field. +func (gsc *GroupSettingCreate) SetJoinPolicy(ep enums.JoinPolicy) *GroupSettingCreate { + gsc.mutation.SetJoinPolicy(ep) + return gsc +} + +// SetNillableJoinPolicy sets the "join_policy" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableJoinPolicy(ep *enums.JoinPolicy) *GroupSettingCreate { + if ep != nil { + gsc.SetJoinPolicy(*ep) + } + return gsc +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (gsc *GroupSettingCreate) SetSyncToSlack(b bool) *GroupSettingCreate { + gsc.mutation.SetSyncToSlack(b) + return gsc +} + +// SetNillableSyncToSlack sets the "sync_to_slack" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableSyncToSlack(b *bool) *GroupSettingCreate { + if b != nil { + gsc.SetSyncToSlack(*b) + } + return gsc +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (gsc *GroupSettingCreate) SetSyncToGithub(b bool) *GroupSettingCreate { + gsc.mutation.SetSyncToGithub(b) + return gsc +} + +// SetNillableSyncToGithub sets the "sync_to_github" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableSyncToGithub(b *bool) *GroupSettingCreate { + if b != nil { + gsc.SetSyncToGithub(*b) + } + return gsc +} + +// SetGroupID sets the "group_id" field. +func (gsc *GroupSettingCreate) SetGroupID(s string) *GroupSettingCreate { + gsc.mutation.SetGroupID(s) + return gsc +} + +// SetNillableGroupID sets the "group_id" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableGroupID(s *string) *GroupSettingCreate { + if s != nil { + gsc.SetGroupID(*s) + } + return gsc +} + +// SetID sets the "id" field. +func (gsc *GroupSettingCreate) SetID(s string) *GroupSettingCreate { + gsc.mutation.SetID(s) + return gsc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (gsc *GroupSettingCreate) SetNillableID(s *string) *GroupSettingCreate { + if s != nil { + gsc.SetID(*s) + } + return gsc +} + +// SetGroup sets the "group" edge to the Group entity. +func (gsc *GroupSettingCreate) SetGroup(g *Group) *GroupSettingCreate { + return gsc.SetGroupID(g.ID) +} + +// Mutation returns the GroupSettingMutation object of the builder. +func (gsc *GroupSettingCreate) Mutation() *GroupSettingMutation { + return gsc.mutation +} + +// Save creates the GroupSetting in the database. +func (gsc *GroupSettingCreate) Save(ctx context.Context) (*GroupSetting, error) { + if err := gsc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gsc.sqlSave, gsc.mutation, gsc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (gsc *GroupSettingCreate) SaveX(ctx context.Context) *GroupSetting { + v, err := gsc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gsc *GroupSettingCreate) Exec(ctx context.Context) error { + _, err := gsc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gsc *GroupSettingCreate) ExecX(ctx context.Context) { + if err := gsc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gsc *GroupSettingCreate) defaults() error { + if _, ok := gsc.mutation.CreatedAt(); !ok { + if groupsetting.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsetting.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := groupsetting.DefaultCreatedAt() + gsc.mutation.SetCreatedAt(v) + } + if _, ok := gsc.mutation.UpdatedAt(); !ok { + if groupsetting.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsetting.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupsetting.DefaultUpdatedAt() + gsc.mutation.SetUpdatedAt(v) + } + if _, ok := gsc.mutation.MappingID(); !ok { + if groupsetting.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized groupsetting.DefaultMappingID (forgotten import generated/runtime?)") + } + v := groupsetting.DefaultMappingID() + gsc.mutation.SetMappingID(v) + } + if _, ok := gsc.mutation.Tags(); !ok { + v := groupsetting.DefaultTags + gsc.mutation.SetTags(v) + } + if _, ok := gsc.mutation.Visibility(); !ok { + v := groupsetting.DefaultVisibility + gsc.mutation.SetVisibility(v) + } + if _, ok := gsc.mutation.JoinPolicy(); !ok { + v := groupsetting.DefaultJoinPolicy + gsc.mutation.SetJoinPolicy(v) + } + if _, ok := gsc.mutation.SyncToSlack(); !ok { + v := groupsetting.DefaultSyncToSlack + gsc.mutation.SetSyncToSlack(v) + } + if _, ok := gsc.mutation.SyncToGithub(); !ok { + v := groupsetting.DefaultSyncToGithub + gsc.mutation.SetSyncToGithub(v) + } + if _, ok := gsc.mutation.ID(); !ok { + if groupsetting.DefaultID == nil { + return fmt.Errorf("generated: uninitialized groupsetting.DefaultID (forgotten import generated/runtime?)") + } + v := groupsetting.DefaultID() + gsc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gsc *GroupSettingCreate) check() error { + if _, ok := gsc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "GroupSetting.mapping_id"`)} + } + if _, ok := gsc.mutation.Visibility(); !ok { + return &ValidationError{Name: "visibility", err: errors.New(`generated: missing required field "GroupSetting.visibility"`)} + } + if v, ok := gsc.mutation.Visibility(); ok { + if err := groupsetting.VisibilityValidator(v); err != nil { + return &ValidationError{Name: "visibility", err: fmt.Errorf(`generated: validator failed for field "GroupSetting.visibility": %w`, err)} + } + } + if _, ok := gsc.mutation.JoinPolicy(); !ok { + return &ValidationError{Name: "join_policy", err: errors.New(`generated: missing required field "GroupSetting.join_policy"`)} + } + if v, ok := gsc.mutation.JoinPolicy(); ok { + if err := groupsetting.JoinPolicyValidator(v); err != nil { + return &ValidationError{Name: "join_policy", err: fmt.Errorf(`generated: validator failed for field "GroupSetting.join_policy": %w`, err)} + } + } + return nil +} + +func (gsc *GroupSettingCreate) sqlSave(ctx context.Context) (*GroupSetting, error) { + if err := gsc.check(); err != nil { + return nil, err + } + _node, _spec := gsc.createSpec() + if err := sqlgraph.CreateNode(ctx, gsc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected GroupSetting.ID type: %T", _spec.ID.Value) + } + } + gsc.mutation.id = &_node.ID + gsc.mutation.done = true + return _node, nil +} + +func (gsc *GroupSettingCreate) createSpec() (*GroupSetting, *sqlgraph.CreateSpec) { + var ( + _node = &GroupSetting{config: gsc.config} + _spec = sqlgraph.NewCreateSpec(groupsetting.Table, sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString)) + ) + _spec.Schema = gsc.schemaConfig.GroupSetting + if id, ok := gsc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := gsc.mutation.CreatedAt(); ok { + _spec.SetField(groupsetting.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := gsc.mutation.UpdatedAt(); ok { + _spec.SetField(groupsetting.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := gsc.mutation.CreatedBy(); ok { + _spec.SetField(groupsetting.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := gsc.mutation.UpdatedBy(); ok { + _spec.SetField(groupsetting.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := gsc.mutation.MappingID(); ok { + _spec.SetField(groupsetting.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := gsc.mutation.Tags(); ok { + _spec.SetField(groupsetting.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := gsc.mutation.DeletedAt(); ok { + _spec.SetField(groupsetting.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := gsc.mutation.DeletedBy(); ok { + _spec.SetField(groupsetting.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := gsc.mutation.Visibility(); ok { + _spec.SetField(groupsetting.FieldVisibility, field.TypeEnum, value) + _node.Visibility = value + } + if value, ok := gsc.mutation.JoinPolicy(); ok { + _spec.SetField(groupsetting.FieldJoinPolicy, field.TypeEnum, value) + _node.JoinPolicy = value + } + if value, ok := gsc.mutation.SyncToSlack(); ok { + _spec.SetField(groupsetting.FieldSyncToSlack, field.TypeBool, value) + _node.SyncToSlack = value + } + if value, ok := gsc.mutation.SyncToGithub(); ok { + _spec.SetField(groupsetting.FieldSyncToGithub, field.TypeBool, value) + _node.SyncToGithub = value + } + if nodes := gsc.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: groupsetting.GroupTable, + Columns: []string{groupsetting.GroupColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = gsc.schemaConfig.GroupSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.GroupID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// GroupSettingCreateBulk is the builder for creating many GroupSetting entities in bulk. +type GroupSettingCreateBulk struct { + config + err error + builders []*GroupSettingCreate +} + +// Save creates the GroupSetting entities in the database. +func (gscb *GroupSettingCreateBulk) Save(ctx context.Context) ([]*GroupSetting, error) { + if gscb.err != nil { + return nil, gscb.err + } + specs := make([]*sqlgraph.CreateSpec, len(gscb.builders)) + nodes := make([]*GroupSetting, len(gscb.builders)) + mutators := make([]Mutator, len(gscb.builders)) + for i := range gscb.builders { + func(i int, root context.Context) { + builder := gscb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*GroupSettingMutation) + 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, gscb.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, gscb.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, gscb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (gscb *GroupSettingCreateBulk) SaveX(ctx context.Context) []*GroupSetting { + v, err := gscb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gscb *GroupSettingCreateBulk) Exec(ctx context.Context) error { + _, err := gscb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gscb *GroupSettingCreateBulk) ExecX(ctx context.Context) { + if err := gscb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupsetting_delete.go b/internal/ent/generated/groupsetting_delete.go new file mode 100644 index 0000000..8f4ef9f --- /dev/null +++ b/internal/ent/generated/groupsetting_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupSettingDelete is the builder for deleting a GroupSetting entity. +type GroupSettingDelete struct { + config + hooks []Hook + mutation *GroupSettingMutation +} + +// Where appends a list predicates to the GroupSettingDelete builder. +func (gsd *GroupSettingDelete) Where(ps ...predicate.GroupSetting) *GroupSettingDelete { + gsd.mutation.Where(ps...) + return gsd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (gsd *GroupSettingDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, gsd.sqlExec, gsd.mutation, gsd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (gsd *GroupSettingDelete) ExecX(ctx context.Context) int { + n, err := gsd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (gsd *GroupSettingDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(groupsetting.Table, sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString)) + _spec.Node.Schema = gsd.schemaConfig.GroupSetting + ctx = internal.NewSchemaConfigContext(ctx, gsd.schemaConfig) + if ps := gsd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, gsd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + gsd.mutation.done = true + return affected, err +} + +// GroupSettingDeleteOne is the builder for deleting a single GroupSetting entity. +type GroupSettingDeleteOne struct { + gsd *GroupSettingDelete +} + +// Where appends a list predicates to the GroupSettingDelete builder. +func (gsdo *GroupSettingDeleteOne) Where(ps ...predicate.GroupSetting) *GroupSettingDeleteOne { + gsdo.gsd.mutation.Where(ps...) + return gsdo +} + +// Exec executes the deletion query. +func (gsdo *GroupSettingDeleteOne) Exec(ctx context.Context) error { + n, err := gsdo.gsd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{groupsetting.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (gsdo *GroupSettingDeleteOne) ExecX(ctx context.Context) { + if err := gsdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupsetting_query.go b/internal/ent/generated/groupsetting_query.go new file mode 100644 index 0000000..95248e6 --- /dev/null +++ b/internal/ent/generated/groupsetting_query.go @@ -0,0 +1,638 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupSettingQuery is the builder for querying GroupSetting entities. +type GroupSettingQuery struct { + config + ctx *QueryContext + order []groupsetting.OrderOption + inters []Interceptor + predicates []predicate.GroupSetting + withGroup *GroupQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*GroupSetting) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the GroupSettingQuery builder. +func (gsq *GroupSettingQuery) Where(ps ...predicate.GroupSetting) *GroupSettingQuery { + gsq.predicates = append(gsq.predicates, ps...) + return gsq +} + +// Limit the number of records to be returned by this query. +func (gsq *GroupSettingQuery) Limit(limit int) *GroupSettingQuery { + gsq.ctx.Limit = &limit + return gsq +} + +// Offset to start from. +func (gsq *GroupSettingQuery) Offset(offset int) *GroupSettingQuery { + gsq.ctx.Offset = &offset + return gsq +} + +// 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 (gsq *GroupSettingQuery) Unique(unique bool) *GroupSettingQuery { + gsq.ctx.Unique = &unique + return gsq +} + +// Order specifies how the records should be ordered. +func (gsq *GroupSettingQuery) Order(o ...groupsetting.OrderOption) *GroupSettingQuery { + gsq.order = append(gsq.order, o...) + return gsq +} + +// QueryGroup chains the current query on the "group" edge. +func (gsq *GroupSettingQuery) QueryGroup() *GroupQuery { + query := (&GroupClient{config: gsq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := gsq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := gsq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(groupsetting.Table, groupsetting.FieldID, selector), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, groupsetting.GroupTable, groupsetting.GroupColumn), + ) + schemaConfig := gsq.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupSetting + fromU = sqlgraph.SetNeighbors(gsq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first GroupSetting entity from the query. +// Returns a *NotFoundError when no GroupSetting was found. +func (gsq *GroupSettingQuery) First(ctx context.Context) (*GroupSetting, error) { + nodes, err := gsq.Limit(1).All(setContextOp(ctx, gsq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{groupsetting.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (gsq *GroupSettingQuery) FirstX(ctx context.Context) *GroupSetting { + node, err := gsq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first GroupSetting ID from the query. +// Returns a *NotFoundError when no GroupSetting ID was found. +func (gsq *GroupSettingQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gsq.Limit(1).IDs(setContextOp(ctx, gsq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{groupsetting.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (gsq *GroupSettingQuery) FirstIDX(ctx context.Context) string { + id, err := gsq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single GroupSetting entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one GroupSetting entity is found. +// Returns a *NotFoundError when no GroupSetting entities are found. +func (gsq *GroupSettingQuery) Only(ctx context.Context) (*GroupSetting, error) { + nodes, err := gsq.Limit(2).All(setContextOp(ctx, gsq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{groupsetting.Label} + default: + return nil, &NotSingularError{groupsetting.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (gsq *GroupSettingQuery) OnlyX(ctx context.Context) *GroupSetting { + node, err := gsq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only GroupSetting ID in the query. +// Returns a *NotSingularError when more than one GroupSetting ID is found. +// Returns a *NotFoundError when no entities are found. +func (gsq *GroupSettingQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gsq.Limit(2).IDs(setContextOp(ctx, gsq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{groupsetting.Label} + default: + err = &NotSingularError{groupsetting.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (gsq *GroupSettingQuery) OnlyIDX(ctx context.Context) string { + id, err := gsq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of GroupSettings. +func (gsq *GroupSettingQuery) All(ctx context.Context) ([]*GroupSetting, error) { + ctx = setContextOp(ctx, gsq.ctx, ent.OpQueryAll) + if err := gsq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*GroupSetting, *GroupSettingQuery]() + return withInterceptors[[]*GroupSetting](ctx, gsq, qr, gsq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (gsq *GroupSettingQuery) AllX(ctx context.Context) []*GroupSetting { + nodes, err := gsq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of GroupSetting IDs. +func (gsq *GroupSettingQuery) IDs(ctx context.Context) (ids []string, err error) { + if gsq.ctx.Unique == nil && gsq.path != nil { + gsq.Unique(true) + } + ctx = setContextOp(ctx, gsq.ctx, ent.OpQueryIDs) + if err = gsq.Select(groupsetting.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (gsq *GroupSettingQuery) IDsX(ctx context.Context) []string { + ids, err := gsq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (gsq *GroupSettingQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, gsq.ctx, ent.OpQueryCount) + if err := gsq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, gsq, querierCount[*GroupSettingQuery](), gsq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (gsq *GroupSettingQuery) CountX(ctx context.Context) int { + count, err := gsq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (gsq *GroupSettingQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, gsq.ctx, ent.OpQueryExist) + switch _, err := gsq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (gsq *GroupSettingQuery) ExistX(ctx context.Context) bool { + exist, err := gsq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the GroupSettingQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (gsq *GroupSettingQuery) Clone() *GroupSettingQuery { + if gsq == nil { + return nil + } + return &GroupSettingQuery{ + config: gsq.config, + ctx: gsq.ctx.Clone(), + order: append([]groupsetting.OrderOption{}, gsq.order...), + inters: append([]Interceptor{}, gsq.inters...), + predicates: append([]predicate.GroupSetting{}, gsq.predicates...), + withGroup: gsq.withGroup.Clone(), + // clone intermediate query. + sql: gsq.sql.Clone(), + path: gsq.path, + } +} + +// WithGroup tells the query-builder to eager-load the nodes that are connected to +// the "group" edge. The optional arguments are used to configure the query builder of the edge. +func (gsq *GroupSettingQuery) WithGroup(opts ...func(*GroupQuery)) *GroupSettingQuery { + query := (&GroupClient{config: gsq.config}).Query() + for _, opt := range opts { + opt(query) + } + gsq.withGroup = query + return gsq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.GroupSetting.Query(). +// GroupBy(groupsetting.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (gsq *GroupSettingQuery) GroupBy(field string, fields ...string) *GroupSettingGroupBy { + gsq.ctx.Fields = append([]string{field}, fields...) + grbuild := &GroupSettingGroupBy{build: gsq} + grbuild.flds = &gsq.ctx.Fields + grbuild.label = groupsetting.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.GroupSetting.Query(). +// Select(groupsetting.FieldCreatedAt). +// Scan(ctx, &v) +func (gsq *GroupSettingQuery) Select(fields ...string) *GroupSettingSelect { + gsq.ctx.Fields = append(gsq.ctx.Fields, fields...) + sbuild := &GroupSettingSelect{GroupSettingQuery: gsq} + sbuild.label = groupsetting.Label + sbuild.flds, sbuild.scan = &gsq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a GroupSettingSelect configured with the given aggregations. +func (gsq *GroupSettingQuery) Aggregate(fns ...AggregateFunc) *GroupSettingSelect { + return gsq.Select().Aggregate(fns...) +} + +func (gsq *GroupSettingQuery) prepareQuery(ctx context.Context) error { + for _, inter := range gsq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, gsq); err != nil { + return err + } + } + } + for _, f := range gsq.ctx.Fields { + if !groupsetting.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if gsq.path != nil { + prev, err := gsq.path(ctx) + if err != nil { + return err + } + gsq.sql = prev + } + if groupsetting.Policy == nil { + return errors.New("generated: uninitialized groupsetting.Policy (forgotten import generated/runtime?)") + } + if err := groupsetting.Policy.EvalQuery(ctx, gsq); err != nil { + return err + } + return nil +} + +func (gsq *GroupSettingQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GroupSetting, error) { + var ( + nodes = []*GroupSetting{} + _spec = gsq.querySpec() + loadedTypes = [1]bool{ + gsq.withGroup != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*GroupSetting).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &GroupSetting{config: gsq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = gsq.schemaConfig.GroupSetting + ctx = internal.NewSchemaConfigContext(ctx, gsq.schemaConfig) + if len(gsq.modifiers) > 0 { + _spec.Modifiers = gsq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, gsq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := gsq.withGroup; query != nil { + if err := gsq.loadGroup(ctx, query, nodes, nil, + func(n *GroupSetting, e *Group) { n.Edges.Group = e }); err != nil { + return nil, err + } + } + for i := range gsq.loadTotal { + if err := gsq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (gsq *GroupSettingQuery) loadGroup(ctx context.Context, query *GroupQuery, nodes []*GroupSetting, init func(*GroupSetting), assign func(*GroupSetting, *Group)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*GroupSetting) + for i := range nodes { + fk := nodes[i].GroupID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(group.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 "group_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (gsq *GroupSettingQuery) sqlCount(ctx context.Context) (int, error) { + _spec := gsq.querySpec() + _spec.Node.Schema = gsq.schemaConfig.GroupSetting + ctx = internal.NewSchemaConfigContext(ctx, gsq.schemaConfig) + if len(gsq.modifiers) > 0 { + _spec.Modifiers = gsq.modifiers + } + _spec.Node.Columns = gsq.ctx.Fields + if len(gsq.ctx.Fields) > 0 { + _spec.Unique = gsq.ctx.Unique != nil && *gsq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, gsq.driver, _spec) +} + +func (gsq *GroupSettingQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(groupsetting.Table, groupsetting.Columns, sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString)) + _spec.From = gsq.sql + if unique := gsq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if gsq.path != nil { + _spec.Unique = true + } + if fields := gsq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupsetting.FieldID) + for i := range fields { + if fields[i] != groupsetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if gsq.withGroup != nil { + _spec.Node.AddColumnOnce(groupsetting.FieldGroupID) + } + } + if ps := gsq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := gsq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := gsq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := gsq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (gsq *GroupSettingQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(gsq.driver.Dialect()) + t1 := builder.Table(groupsetting.Table) + columns := gsq.ctx.Fields + if len(columns) == 0 { + columns = groupsetting.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if gsq.sql != nil { + selector = gsq.sql + selector.Select(selector.Columns(columns...)...) + } + if gsq.ctx.Unique != nil && *gsq.ctx.Unique { + selector.Distinct() + } + t1.Schema(gsq.schemaConfig.GroupSetting) + ctx = internal.NewSchemaConfigContext(ctx, gsq.schemaConfig) + selector.WithContext(ctx) + for _, p := range gsq.predicates { + p(selector) + } + for _, p := range gsq.order { + p(selector) + } + if offset := gsq.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 := gsq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// GroupSettingGroupBy is the group-by builder for GroupSetting entities. +type GroupSettingGroupBy struct { + selector + build *GroupSettingQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (gsgb *GroupSettingGroupBy) Aggregate(fns ...AggregateFunc) *GroupSettingGroupBy { + gsgb.fns = append(gsgb.fns, fns...) + return gsgb +} + +// Scan applies the selector query and scans the result into the given value. +func (gsgb *GroupSettingGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gsgb.build.ctx, ent.OpQueryGroupBy) + if err := gsgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupSettingQuery, *GroupSettingGroupBy](ctx, gsgb.build, gsgb, gsgb.build.inters, v) +} + +func (gsgb *GroupSettingGroupBy) sqlScan(ctx context.Context, root *GroupSettingQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(gsgb.fns)) + for _, fn := range gsgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*gsgb.flds)+len(gsgb.fns)) + for _, f := range *gsgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*gsgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := gsgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// GroupSettingSelect is the builder for selecting fields of GroupSetting entities. +type GroupSettingSelect struct { + *GroupSettingQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (gss *GroupSettingSelect) Aggregate(fns ...AggregateFunc) *GroupSettingSelect { + gss.fns = append(gss.fns, fns...) + return gss +} + +// Scan applies the selector query and scans the result into the given value. +func (gss *GroupSettingSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gss.ctx, ent.OpQuerySelect) + if err := gss.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupSettingQuery, *GroupSettingSelect](ctx, gss.GroupSettingQuery, gss, gss.inters, v) +} + +func (gss *GroupSettingSelect) sqlScan(ctx context.Context, root *GroupSettingQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(gss.fns)) + for _, fn := range gss.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*gss.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 := gss.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/groupsetting_update.go b/internal/ent/generated/groupsetting_update.go new file mode 100644 index 0000000..15deaaa --- /dev/null +++ b/internal/ent/generated/groupsetting_update.go @@ -0,0 +1,809 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupSettingUpdate is the builder for updating GroupSetting entities. +type GroupSettingUpdate struct { + config + hooks []Hook + mutation *GroupSettingMutation +} + +// Where appends a list predicates to the GroupSettingUpdate builder. +func (gsu *GroupSettingUpdate) Where(ps ...predicate.GroupSetting) *GroupSettingUpdate { + gsu.mutation.Where(ps...) + return gsu +} + +// SetUpdatedAt sets the "updated_at" field. +func (gsu *GroupSettingUpdate) SetUpdatedAt(t time.Time) *GroupSettingUpdate { + gsu.mutation.SetUpdatedAt(t) + return gsu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gsu *GroupSettingUpdate) ClearUpdatedAt() *GroupSettingUpdate { + gsu.mutation.ClearUpdatedAt() + return gsu +} + +// SetUpdatedBy sets the "updated_by" field. +func (gsu *GroupSettingUpdate) SetUpdatedBy(s string) *GroupSettingUpdate { + gsu.mutation.SetUpdatedBy(s) + return gsu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableUpdatedBy(s *string) *GroupSettingUpdate { + if s != nil { + gsu.SetUpdatedBy(*s) + } + return gsu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gsu *GroupSettingUpdate) ClearUpdatedBy() *GroupSettingUpdate { + gsu.mutation.ClearUpdatedBy() + return gsu +} + +// SetTags sets the "tags" field. +func (gsu *GroupSettingUpdate) SetTags(s []string) *GroupSettingUpdate { + gsu.mutation.SetTags(s) + return gsu +} + +// AppendTags appends s to the "tags" field. +func (gsu *GroupSettingUpdate) AppendTags(s []string) *GroupSettingUpdate { + gsu.mutation.AppendTags(s) + return gsu +} + +// ClearTags clears the value of the "tags" field. +func (gsu *GroupSettingUpdate) ClearTags() *GroupSettingUpdate { + gsu.mutation.ClearTags() + return gsu +} + +// SetDeletedAt sets the "deleted_at" field. +func (gsu *GroupSettingUpdate) SetDeletedAt(t time.Time) *GroupSettingUpdate { + gsu.mutation.SetDeletedAt(t) + return gsu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableDeletedAt(t *time.Time) *GroupSettingUpdate { + if t != nil { + gsu.SetDeletedAt(*t) + } + return gsu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gsu *GroupSettingUpdate) ClearDeletedAt() *GroupSettingUpdate { + gsu.mutation.ClearDeletedAt() + return gsu +} + +// SetDeletedBy sets the "deleted_by" field. +func (gsu *GroupSettingUpdate) SetDeletedBy(s string) *GroupSettingUpdate { + gsu.mutation.SetDeletedBy(s) + return gsu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableDeletedBy(s *string) *GroupSettingUpdate { + if s != nil { + gsu.SetDeletedBy(*s) + } + return gsu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gsu *GroupSettingUpdate) ClearDeletedBy() *GroupSettingUpdate { + gsu.mutation.ClearDeletedBy() + return gsu +} + +// SetVisibility sets the "visibility" field. +func (gsu *GroupSettingUpdate) SetVisibility(e enums.Visibility) *GroupSettingUpdate { + gsu.mutation.SetVisibility(e) + return gsu +} + +// SetNillableVisibility sets the "visibility" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableVisibility(e *enums.Visibility) *GroupSettingUpdate { + if e != nil { + gsu.SetVisibility(*e) + } + return gsu +} + +// SetJoinPolicy sets the "join_policy" field. +func (gsu *GroupSettingUpdate) SetJoinPolicy(ep enums.JoinPolicy) *GroupSettingUpdate { + gsu.mutation.SetJoinPolicy(ep) + return gsu +} + +// SetNillableJoinPolicy sets the "join_policy" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableJoinPolicy(ep *enums.JoinPolicy) *GroupSettingUpdate { + if ep != nil { + gsu.SetJoinPolicy(*ep) + } + return gsu +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (gsu *GroupSettingUpdate) SetSyncToSlack(b bool) *GroupSettingUpdate { + gsu.mutation.SetSyncToSlack(b) + return gsu +} + +// SetNillableSyncToSlack sets the "sync_to_slack" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableSyncToSlack(b *bool) *GroupSettingUpdate { + if b != nil { + gsu.SetSyncToSlack(*b) + } + return gsu +} + +// ClearSyncToSlack clears the value of the "sync_to_slack" field. +func (gsu *GroupSettingUpdate) ClearSyncToSlack() *GroupSettingUpdate { + gsu.mutation.ClearSyncToSlack() + return gsu +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (gsu *GroupSettingUpdate) SetSyncToGithub(b bool) *GroupSettingUpdate { + gsu.mutation.SetSyncToGithub(b) + return gsu +} + +// SetNillableSyncToGithub sets the "sync_to_github" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableSyncToGithub(b *bool) *GroupSettingUpdate { + if b != nil { + gsu.SetSyncToGithub(*b) + } + return gsu +} + +// ClearSyncToGithub clears the value of the "sync_to_github" field. +func (gsu *GroupSettingUpdate) ClearSyncToGithub() *GroupSettingUpdate { + gsu.mutation.ClearSyncToGithub() + return gsu +} + +// SetGroupID sets the "group_id" field. +func (gsu *GroupSettingUpdate) SetGroupID(s string) *GroupSettingUpdate { + gsu.mutation.SetGroupID(s) + return gsu +} + +// SetNillableGroupID sets the "group_id" field if the given value is not nil. +func (gsu *GroupSettingUpdate) SetNillableGroupID(s *string) *GroupSettingUpdate { + if s != nil { + gsu.SetGroupID(*s) + } + return gsu +} + +// ClearGroupID clears the value of the "group_id" field. +func (gsu *GroupSettingUpdate) ClearGroupID() *GroupSettingUpdate { + gsu.mutation.ClearGroupID() + return gsu +} + +// SetGroup sets the "group" edge to the Group entity. +func (gsu *GroupSettingUpdate) SetGroup(g *Group) *GroupSettingUpdate { + return gsu.SetGroupID(g.ID) +} + +// Mutation returns the GroupSettingMutation object of the builder. +func (gsu *GroupSettingUpdate) Mutation() *GroupSettingMutation { + return gsu.mutation +} + +// ClearGroup clears the "group" edge to the Group entity. +func (gsu *GroupSettingUpdate) ClearGroup() *GroupSettingUpdate { + gsu.mutation.ClearGroup() + return gsu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (gsu *GroupSettingUpdate) Save(ctx context.Context) (int, error) { + if err := gsu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, gsu.sqlSave, gsu.mutation, gsu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gsu *GroupSettingUpdate) SaveX(ctx context.Context) int { + affected, err := gsu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (gsu *GroupSettingUpdate) Exec(ctx context.Context) error { + _, err := gsu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gsu *GroupSettingUpdate) ExecX(ctx context.Context) { + if err := gsu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gsu *GroupSettingUpdate) defaults() error { + if _, ok := gsu.mutation.UpdatedAt(); !ok && !gsu.mutation.UpdatedAtCleared() { + if groupsetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupsetting.UpdateDefaultUpdatedAt() + gsu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gsu *GroupSettingUpdate) check() error { + if v, ok := gsu.mutation.Visibility(); ok { + if err := groupsetting.VisibilityValidator(v); err != nil { + return &ValidationError{Name: "visibility", err: fmt.Errorf(`generated: validator failed for field "GroupSetting.visibility": %w`, err)} + } + } + if v, ok := gsu.mutation.JoinPolicy(); ok { + if err := groupsetting.JoinPolicyValidator(v); err != nil { + return &ValidationError{Name: "join_policy", err: fmt.Errorf(`generated: validator failed for field "GroupSetting.join_policy": %w`, err)} + } + } + return nil +} + +func (gsu *GroupSettingUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := gsu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(groupsetting.Table, groupsetting.Columns, sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString)) + if ps := gsu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gsu.mutation.CreatedAtCleared() { + _spec.ClearField(groupsetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := gsu.mutation.UpdatedAt(); ok { + _spec.SetField(groupsetting.FieldUpdatedAt, field.TypeTime, value) + } + if gsu.mutation.UpdatedAtCleared() { + _spec.ClearField(groupsetting.FieldUpdatedAt, field.TypeTime) + } + if gsu.mutation.CreatedByCleared() { + _spec.ClearField(groupsetting.FieldCreatedBy, field.TypeString) + } + if value, ok := gsu.mutation.UpdatedBy(); ok { + _spec.SetField(groupsetting.FieldUpdatedBy, field.TypeString, value) + } + if gsu.mutation.UpdatedByCleared() { + _spec.ClearField(groupsetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := gsu.mutation.Tags(); ok { + _spec.SetField(groupsetting.FieldTags, field.TypeJSON, value) + } + if value, ok := gsu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, groupsetting.FieldTags, value) + }) + } + if gsu.mutation.TagsCleared() { + _spec.ClearField(groupsetting.FieldTags, field.TypeJSON) + } + if value, ok := gsu.mutation.DeletedAt(); ok { + _spec.SetField(groupsetting.FieldDeletedAt, field.TypeTime, value) + } + if gsu.mutation.DeletedAtCleared() { + _spec.ClearField(groupsetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := gsu.mutation.DeletedBy(); ok { + _spec.SetField(groupsetting.FieldDeletedBy, field.TypeString, value) + } + if gsu.mutation.DeletedByCleared() { + _spec.ClearField(groupsetting.FieldDeletedBy, field.TypeString) + } + if value, ok := gsu.mutation.Visibility(); ok { + _spec.SetField(groupsetting.FieldVisibility, field.TypeEnum, value) + } + if value, ok := gsu.mutation.JoinPolicy(); ok { + _spec.SetField(groupsetting.FieldJoinPolicy, field.TypeEnum, value) + } + if value, ok := gsu.mutation.SyncToSlack(); ok { + _spec.SetField(groupsetting.FieldSyncToSlack, field.TypeBool, value) + } + if gsu.mutation.SyncToSlackCleared() { + _spec.ClearField(groupsetting.FieldSyncToSlack, field.TypeBool) + } + if value, ok := gsu.mutation.SyncToGithub(); ok { + _spec.SetField(groupsetting.FieldSyncToGithub, field.TypeBool, value) + } + if gsu.mutation.SyncToGithubCleared() { + _spec.ClearField(groupsetting.FieldSyncToGithub, field.TypeBool) + } + if gsu.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: groupsetting.GroupTable, + Columns: []string{groupsetting.GroupColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = gsu.schemaConfig.GroupSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gsu.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: groupsetting.GroupTable, + Columns: []string{groupsetting.GroupColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = gsu.schemaConfig.GroupSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = gsu.schemaConfig.GroupSetting + ctx = internal.NewSchemaConfigContext(ctx, gsu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, gsu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupsetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + gsu.mutation.done = true + return n, nil +} + +// GroupSettingUpdateOne is the builder for updating a single GroupSetting entity. +type GroupSettingUpdateOne struct { + config + fields []string + hooks []Hook + mutation *GroupSettingMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (gsuo *GroupSettingUpdateOne) SetUpdatedAt(t time.Time) *GroupSettingUpdateOne { + gsuo.mutation.SetUpdatedAt(t) + return gsuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gsuo *GroupSettingUpdateOne) ClearUpdatedAt() *GroupSettingUpdateOne { + gsuo.mutation.ClearUpdatedAt() + return gsuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (gsuo *GroupSettingUpdateOne) SetUpdatedBy(s string) *GroupSettingUpdateOne { + gsuo.mutation.SetUpdatedBy(s) + return gsuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableUpdatedBy(s *string) *GroupSettingUpdateOne { + if s != nil { + gsuo.SetUpdatedBy(*s) + } + return gsuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gsuo *GroupSettingUpdateOne) ClearUpdatedBy() *GroupSettingUpdateOne { + gsuo.mutation.ClearUpdatedBy() + return gsuo +} + +// SetTags sets the "tags" field. +func (gsuo *GroupSettingUpdateOne) SetTags(s []string) *GroupSettingUpdateOne { + gsuo.mutation.SetTags(s) + return gsuo +} + +// AppendTags appends s to the "tags" field. +func (gsuo *GroupSettingUpdateOne) AppendTags(s []string) *GroupSettingUpdateOne { + gsuo.mutation.AppendTags(s) + return gsuo +} + +// ClearTags clears the value of the "tags" field. +func (gsuo *GroupSettingUpdateOne) ClearTags() *GroupSettingUpdateOne { + gsuo.mutation.ClearTags() + return gsuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (gsuo *GroupSettingUpdateOne) SetDeletedAt(t time.Time) *GroupSettingUpdateOne { + gsuo.mutation.SetDeletedAt(t) + return gsuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableDeletedAt(t *time.Time) *GroupSettingUpdateOne { + if t != nil { + gsuo.SetDeletedAt(*t) + } + return gsuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gsuo *GroupSettingUpdateOne) ClearDeletedAt() *GroupSettingUpdateOne { + gsuo.mutation.ClearDeletedAt() + return gsuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (gsuo *GroupSettingUpdateOne) SetDeletedBy(s string) *GroupSettingUpdateOne { + gsuo.mutation.SetDeletedBy(s) + return gsuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableDeletedBy(s *string) *GroupSettingUpdateOne { + if s != nil { + gsuo.SetDeletedBy(*s) + } + return gsuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gsuo *GroupSettingUpdateOne) ClearDeletedBy() *GroupSettingUpdateOne { + gsuo.mutation.ClearDeletedBy() + return gsuo +} + +// SetVisibility sets the "visibility" field. +func (gsuo *GroupSettingUpdateOne) SetVisibility(e enums.Visibility) *GroupSettingUpdateOne { + gsuo.mutation.SetVisibility(e) + return gsuo +} + +// SetNillableVisibility sets the "visibility" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableVisibility(e *enums.Visibility) *GroupSettingUpdateOne { + if e != nil { + gsuo.SetVisibility(*e) + } + return gsuo +} + +// SetJoinPolicy sets the "join_policy" field. +func (gsuo *GroupSettingUpdateOne) SetJoinPolicy(ep enums.JoinPolicy) *GroupSettingUpdateOne { + gsuo.mutation.SetJoinPolicy(ep) + return gsuo +} + +// SetNillableJoinPolicy sets the "join_policy" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableJoinPolicy(ep *enums.JoinPolicy) *GroupSettingUpdateOne { + if ep != nil { + gsuo.SetJoinPolicy(*ep) + } + return gsuo +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (gsuo *GroupSettingUpdateOne) SetSyncToSlack(b bool) *GroupSettingUpdateOne { + gsuo.mutation.SetSyncToSlack(b) + return gsuo +} + +// SetNillableSyncToSlack sets the "sync_to_slack" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableSyncToSlack(b *bool) *GroupSettingUpdateOne { + if b != nil { + gsuo.SetSyncToSlack(*b) + } + return gsuo +} + +// ClearSyncToSlack clears the value of the "sync_to_slack" field. +func (gsuo *GroupSettingUpdateOne) ClearSyncToSlack() *GroupSettingUpdateOne { + gsuo.mutation.ClearSyncToSlack() + return gsuo +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (gsuo *GroupSettingUpdateOne) SetSyncToGithub(b bool) *GroupSettingUpdateOne { + gsuo.mutation.SetSyncToGithub(b) + return gsuo +} + +// SetNillableSyncToGithub sets the "sync_to_github" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableSyncToGithub(b *bool) *GroupSettingUpdateOne { + if b != nil { + gsuo.SetSyncToGithub(*b) + } + return gsuo +} + +// ClearSyncToGithub clears the value of the "sync_to_github" field. +func (gsuo *GroupSettingUpdateOne) ClearSyncToGithub() *GroupSettingUpdateOne { + gsuo.mutation.ClearSyncToGithub() + return gsuo +} + +// SetGroupID sets the "group_id" field. +func (gsuo *GroupSettingUpdateOne) SetGroupID(s string) *GroupSettingUpdateOne { + gsuo.mutation.SetGroupID(s) + return gsuo +} + +// SetNillableGroupID sets the "group_id" field if the given value is not nil. +func (gsuo *GroupSettingUpdateOne) SetNillableGroupID(s *string) *GroupSettingUpdateOne { + if s != nil { + gsuo.SetGroupID(*s) + } + return gsuo +} + +// ClearGroupID clears the value of the "group_id" field. +func (gsuo *GroupSettingUpdateOne) ClearGroupID() *GroupSettingUpdateOne { + gsuo.mutation.ClearGroupID() + return gsuo +} + +// SetGroup sets the "group" edge to the Group entity. +func (gsuo *GroupSettingUpdateOne) SetGroup(g *Group) *GroupSettingUpdateOne { + return gsuo.SetGroupID(g.ID) +} + +// Mutation returns the GroupSettingMutation object of the builder. +func (gsuo *GroupSettingUpdateOne) Mutation() *GroupSettingMutation { + return gsuo.mutation +} + +// ClearGroup clears the "group" edge to the Group entity. +func (gsuo *GroupSettingUpdateOne) ClearGroup() *GroupSettingUpdateOne { + gsuo.mutation.ClearGroup() + return gsuo +} + +// Where appends a list predicates to the GroupSettingUpdate builder. +func (gsuo *GroupSettingUpdateOne) Where(ps ...predicate.GroupSetting) *GroupSettingUpdateOne { + gsuo.mutation.Where(ps...) + return gsuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (gsuo *GroupSettingUpdateOne) Select(field string, fields ...string) *GroupSettingUpdateOne { + gsuo.fields = append([]string{field}, fields...) + return gsuo +} + +// Save executes the query and returns the updated GroupSetting entity. +func (gsuo *GroupSettingUpdateOne) Save(ctx context.Context) (*GroupSetting, error) { + if err := gsuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gsuo.sqlSave, gsuo.mutation, gsuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gsuo *GroupSettingUpdateOne) SaveX(ctx context.Context) *GroupSetting { + node, err := gsuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (gsuo *GroupSettingUpdateOne) Exec(ctx context.Context) error { + _, err := gsuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gsuo *GroupSettingUpdateOne) ExecX(ctx context.Context) { + if err := gsuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gsuo *GroupSettingUpdateOne) defaults() error { + if _, ok := gsuo.mutation.UpdatedAt(); !ok && !gsuo.mutation.UpdatedAtCleared() { + if groupsetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupsetting.UpdateDefaultUpdatedAt() + gsuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gsuo *GroupSettingUpdateOne) check() error { + if v, ok := gsuo.mutation.Visibility(); ok { + if err := groupsetting.VisibilityValidator(v); err != nil { + return &ValidationError{Name: "visibility", err: fmt.Errorf(`generated: validator failed for field "GroupSetting.visibility": %w`, err)} + } + } + if v, ok := gsuo.mutation.JoinPolicy(); ok { + if err := groupsetting.JoinPolicyValidator(v); err != nil { + return &ValidationError{Name: "join_policy", err: fmt.Errorf(`generated: validator failed for field "GroupSetting.join_policy": %w`, err)} + } + } + return nil +} + +func (gsuo *GroupSettingUpdateOne) sqlSave(ctx context.Context) (_node *GroupSetting, err error) { + if err := gsuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(groupsetting.Table, groupsetting.Columns, sqlgraph.NewFieldSpec(groupsetting.FieldID, field.TypeString)) + id, ok := gsuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "GroupSetting.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := gsuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupsetting.FieldID) + for _, f := range fields { + if !groupsetting.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != groupsetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := gsuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gsuo.mutation.CreatedAtCleared() { + _spec.ClearField(groupsetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := gsuo.mutation.UpdatedAt(); ok { + _spec.SetField(groupsetting.FieldUpdatedAt, field.TypeTime, value) + } + if gsuo.mutation.UpdatedAtCleared() { + _spec.ClearField(groupsetting.FieldUpdatedAt, field.TypeTime) + } + if gsuo.mutation.CreatedByCleared() { + _spec.ClearField(groupsetting.FieldCreatedBy, field.TypeString) + } + if value, ok := gsuo.mutation.UpdatedBy(); ok { + _spec.SetField(groupsetting.FieldUpdatedBy, field.TypeString, value) + } + if gsuo.mutation.UpdatedByCleared() { + _spec.ClearField(groupsetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := gsuo.mutation.Tags(); ok { + _spec.SetField(groupsetting.FieldTags, field.TypeJSON, value) + } + if value, ok := gsuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, groupsetting.FieldTags, value) + }) + } + if gsuo.mutation.TagsCleared() { + _spec.ClearField(groupsetting.FieldTags, field.TypeJSON) + } + if value, ok := gsuo.mutation.DeletedAt(); ok { + _spec.SetField(groupsetting.FieldDeletedAt, field.TypeTime, value) + } + if gsuo.mutation.DeletedAtCleared() { + _spec.ClearField(groupsetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := gsuo.mutation.DeletedBy(); ok { + _spec.SetField(groupsetting.FieldDeletedBy, field.TypeString, value) + } + if gsuo.mutation.DeletedByCleared() { + _spec.ClearField(groupsetting.FieldDeletedBy, field.TypeString) + } + if value, ok := gsuo.mutation.Visibility(); ok { + _spec.SetField(groupsetting.FieldVisibility, field.TypeEnum, value) + } + if value, ok := gsuo.mutation.JoinPolicy(); ok { + _spec.SetField(groupsetting.FieldJoinPolicy, field.TypeEnum, value) + } + if value, ok := gsuo.mutation.SyncToSlack(); ok { + _spec.SetField(groupsetting.FieldSyncToSlack, field.TypeBool, value) + } + if gsuo.mutation.SyncToSlackCleared() { + _spec.ClearField(groupsetting.FieldSyncToSlack, field.TypeBool) + } + if value, ok := gsuo.mutation.SyncToGithub(); ok { + _spec.SetField(groupsetting.FieldSyncToGithub, field.TypeBool, value) + } + if gsuo.mutation.SyncToGithubCleared() { + _spec.ClearField(groupsetting.FieldSyncToGithub, field.TypeBool) + } + if gsuo.mutation.GroupCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: groupsetting.GroupTable, + Columns: []string{groupsetting.GroupColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = gsuo.schemaConfig.GroupSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := gsuo.mutation.GroupIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: groupsetting.GroupTable, + Columns: []string{groupsetting.GroupColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = gsuo.schemaConfig.GroupSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = gsuo.schemaConfig.GroupSetting + ctx = internal.NewSchemaConfigContext(ctx, gsuo.schemaConfig) + _node = &GroupSetting{config: gsuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, gsuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupsetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + gsuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/groupsettinghistory.go b/internal/ent/generated/groupsettinghistory.go new file mode 100644 index 0000000..bb051f8 --- /dev/null +++ b/internal/ent/generated/groupsettinghistory.go @@ -0,0 +1,280 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// GroupSettingHistory is the model entity for the GroupSettingHistory schema. +type GroupSettingHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility enums.Visibility `json:"visibility,omitempty"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy enums.JoinPolicy `json:"join_policy,omitempty"` + // whether to sync group members to slack groups + SyncToSlack bool `json:"sync_to_slack,omitempty"` + // whether to sync group members to github groups + SyncToGithub bool `json:"sync_to_github,omitempty"` + // the group id associated with the settings + GroupID string `json:"group_id,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*GroupSettingHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case groupsettinghistory.FieldTags: + values[i] = new([]byte) + case groupsettinghistory.FieldOperation: + values[i] = new(history.OpType) + case groupsettinghistory.FieldSyncToSlack, groupsettinghistory.FieldSyncToGithub: + values[i] = new(sql.NullBool) + case groupsettinghistory.FieldID, groupsettinghistory.FieldRef, groupsettinghistory.FieldCreatedBy, groupsettinghistory.FieldUpdatedBy, groupsettinghistory.FieldMappingID, groupsettinghistory.FieldDeletedBy, groupsettinghistory.FieldVisibility, groupsettinghistory.FieldJoinPolicy, groupsettinghistory.FieldGroupID: + values[i] = new(sql.NullString) + case groupsettinghistory.FieldHistoryTime, groupsettinghistory.FieldCreatedAt, groupsettinghistory.FieldUpdatedAt, groupsettinghistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the GroupSettingHistory fields. +func (gsh *GroupSettingHistory) 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 groupsettinghistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + gsh.ID = value.String + } + case groupsettinghistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + gsh.HistoryTime = value.Time + } + case groupsettinghistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + gsh.Ref = value.String + } + case groupsettinghistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + gsh.Operation = *value + } + case groupsettinghistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + gsh.CreatedAt = value.Time + } + case groupsettinghistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + gsh.UpdatedAt = value.Time + } + case groupsettinghistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + gsh.CreatedBy = value.String + } + case groupsettinghistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + gsh.UpdatedBy = value.String + } + case groupsettinghistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + gsh.MappingID = value.String + } + case groupsettinghistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &gsh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case groupsettinghistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + gsh.DeletedAt = value.Time + } + case groupsettinghistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + gsh.DeletedBy = value.String + } + case groupsettinghistory.FieldVisibility: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field visibility", values[i]) + } else if value.Valid { + gsh.Visibility = enums.Visibility(value.String) + } + case groupsettinghistory.FieldJoinPolicy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field join_policy", values[i]) + } else if value.Valid { + gsh.JoinPolicy = enums.JoinPolicy(value.String) + } + case groupsettinghistory.FieldSyncToSlack: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field sync_to_slack", values[i]) + } else if value.Valid { + gsh.SyncToSlack = value.Bool + } + case groupsettinghistory.FieldSyncToGithub: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field sync_to_github", values[i]) + } else if value.Valid { + gsh.SyncToGithub = value.Bool + } + case groupsettinghistory.FieldGroupID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field group_id", values[i]) + } else if value.Valid { + gsh.GroupID = value.String + } + default: + gsh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the GroupSettingHistory. +// This includes values selected through modifiers, order, etc. +func (gsh *GroupSettingHistory) Value(name string) (ent.Value, error) { + return gsh.selectValues.Get(name) +} + +// Update returns a builder for updating this GroupSettingHistory. +// Note that you need to call GroupSettingHistory.Unwrap() before calling this method if this GroupSettingHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (gsh *GroupSettingHistory) Update() *GroupSettingHistoryUpdateOne { + return NewGroupSettingHistoryClient(gsh.config).UpdateOne(gsh) +} + +// Unwrap unwraps the GroupSettingHistory 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 (gsh *GroupSettingHistory) Unwrap() *GroupSettingHistory { + _tx, ok := gsh.config.driver.(*txDriver) + if !ok { + panic("generated: GroupSettingHistory is not a transactional entity") + } + gsh.config.driver = _tx.drv + return gsh +} + +// String implements the fmt.Stringer. +func (gsh *GroupSettingHistory) String() string { + var builder strings.Builder + builder.WriteString("GroupSettingHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", gsh.ID)) + builder.WriteString("history_time=") + builder.WriteString(gsh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(gsh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", gsh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(gsh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(gsh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(gsh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(gsh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(gsh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", gsh.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(gsh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(gsh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("visibility=") + builder.WriteString(fmt.Sprintf("%v", gsh.Visibility)) + builder.WriteString(", ") + builder.WriteString("join_policy=") + builder.WriteString(fmt.Sprintf("%v", gsh.JoinPolicy)) + builder.WriteString(", ") + builder.WriteString("sync_to_slack=") + builder.WriteString(fmt.Sprintf("%v", gsh.SyncToSlack)) + builder.WriteString(", ") + builder.WriteString("sync_to_github=") + builder.WriteString(fmt.Sprintf("%v", gsh.SyncToGithub)) + builder.WriteString(", ") + builder.WriteString("group_id=") + builder.WriteString(gsh.GroupID) + builder.WriteByte(')') + return builder.String() +} + +// GroupSettingHistories is a parsable slice of GroupSettingHistory. +type GroupSettingHistories []*GroupSettingHistory diff --git a/internal/ent/generated/groupsettinghistory/groupsettinghistory.go b/internal/ent/generated/groupsettinghistory/groupsettinghistory.go new file mode 100644 index 0000000..3710e8d --- /dev/null +++ b/internal/ent/generated/groupsettinghistory/groupsettinghistory.go @@ -0,0 +1,253 @@ +// Code generated by ent, DO NOT EDIT. + +package groupsettinghistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the groupsettinghistory type in the database. + Label = "group_setting_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldVisibility holds the string denoting the visibility field in the database. + FieldVisibility = "visibility" + // FieldJoinPolicy holds the string denoting the join_policy field in the database. + FieldJoinPolicy = "join_policy" + // FieldSyncToSlack holds the string denoting the sync_to_slack field in the database. + FieldSyncToSlack = "sync_to_slack" + // FieldSyncToGithub holds the string denoting the sync_to_github field in the database. + FieldSyncToGithub = "sync_to_github" + // FieldGroupID holds the string denoting the group_id field in the database. + FieldGroupID = "group_id" + // Table holds the table name of the groupsettinghistory in the database. + Table = "group_setting_history" +) + +// Columns holds all SQL columns for groupsettinghistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldVisibility, + FieldJoinPolicy, + FieldSyncToSlack, + FieldSyncToGithub, + FieldGroupID, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultSyncToSlack holds the default value on creation for the "sync_to_slack" field. + DefaultSyncToSlack bool + // DefaultSyncToGithub holds the default value on creation for the "sync_to_github" field. + DefaultSyncToGithub bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("groupsettinghistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultVisibility enums.Visibility = "PUBLIC" + +// VisibilityValidator is a validator for the "visibility" field enum values. It is called by the builders before save. +func VisibilityValidator(v enums.Visibility) error { + switch v.String() { + case "PUBLIC", "PRIVATE": + return nil + default: + return fmt.Errorf("groupsettinghistory: invalid enum value for visibility field: %q", v) + } +} + +const DefaultJoinPolicy enums.JoinPolicy = "INVITE_OR_APPLICATION" + +// JoinPolicyValidator is a validator for the "join_policy" field enum values. It is called by the builders before save. +func JoinPolicyValidator(jp enums.JoinPolicy) error { + switch jp.String() { + case "OPEN", "INVITE_ONLY", "APPLICATION_ONLY", "INVITE_OR_APPLICATION": + return nil + default: + return fmt.Errorf("groupsettinghistory: invalid enum value for join_policy field: %q", jp) + } +} + +// OrderOption defines the ordering options for the GroupSettingHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByVisibility orders the results by the visibility field. +func ByVisibility(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldVisibility, opts...).ToFunc() +} + +// ByJoinPolicy orders the results by the join_policy field. +func ByJoinPolicy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldJoinPolicy, opts...).ToFunc() +} + +// BySyncToSlack orders the results by the sync_to_slack field. +func BySyncToSlack(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSyncToSlack, opts...).ToFunc() +} + +// BySyncToGithub orders the results by the sync_to_github field. +func BySyncToGithub(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSyncToGithub, opts...).ToFunc() +} + +// ByGroupID orders the results by the group_id field. +func ByGroupID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGroupID, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.Visibility must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Visibility)(nil) + // enums.Visibility must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Visibility)(nil) +) + +var ( + // enums.JoinPolicy must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.JoinPolicy)(nil) + // enums.JoinPolicy must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.JoinPolicy)(nil) +) diff --git a/internal/ent/generated/groupsettinghistory/where.go b/internal/ent/generated/groupsettinghistory/where.go new file mode 100644 index 0000000..04b9015 --- /dev/null +++ b/internal/ent/generated/groupsettinghistory/where.go @@ -0,0 +1,902 @@ +// Code generated by ent, DO NOT EDIT. + +package groupsettinghistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// SyncToSlack applies equality check predicate on the "sync_to_slack" field. It's identical to SyncToSlackEQ. +func SyncToSlack(v bool) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldSyncToSlack, v)) +} + +// SyncToGithub applies equality check predicate on the "sync_to_github" field. It's identical to SyncToGithubEQ. +func SyncToGithub(v bool) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldSyncToGithub, v)) +} + +// GroupID applies equality check predicate on the "group_id" field. It's identical to GroupIDEQ. +func GroupID(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldGroupID, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// VisibilityEQ applies the EQ predicate on the "visibility" field. +func VisibilityEQ(v enums.Visibility) predicate.GroupSettingHistory { + vc := v + return predicate.GroupSettingHistory(sql.FieldEQ(FieldVisibility, vc)) +} + +// VisibilityNEQ applies the NEQ predicate on the "visibility" field. +func VisibilityNEQ(v enums.Visibility) predicate.GroupSettingHistory { + vc := v + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldVisibility, vc)) +} + +// VisibilityIn applies the In predicate on the "visibility" field. +func VisibilityIn(vs ...enums.Visibility) predicate.GroupSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSettingHistory(sql.FieldIn(FieldVisibility, v...)) +} + +// VisibilityNotIn applies the NotIn predicate on the "visibility" field. +func VisibilityNotIn(vs ...enums.Visibility) predicate.GroupSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldVisibility, v...)) +} + +// JoinPolicyEQ applies the EQ predicate on the "join_policy" field. +func JoinPolicyEQ(v enums.JoinPolicy) predicate.GroupSettingHistory { + vc := v + return predicate.GroupSettingHistory(sql.FieldEQ(FieldJoinPolicy, vc)) +} + +// JoinPolicyNEQ applies the NEQ predicate on the "join_policy" field. +func JoinPolicyNEQ(v enums.JoinPolicy) predicate.GroupSettingHistory { + vc := v + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldJoinPolicy, vc)) +} + +// JoinPolicyIn applies the In predicate on the "join_policy" field. +func JoinPolicyIn(vs ...enums.JoinPolicy) predicate.GroupSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSettingHistory(sql.FieldIn(FieldJoinPolicy, v...)) +} + +// JoinPolicyNotIn applies the NotIn predicate on the "join_policy" field. +func JoinPolicyNotIn(vs ...enums.JoinPolicy) predicate.GroupSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldJoinPolicy, v...)) +} + +// SyncToSlackEQ applies the EQ predicate on the "sync_to_slack" field. +func SyncToSlackEQ(v bool) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldSyncToSlack, v)) +} + +// SyncToSlackNEQ applies the NEQ predicate on the "sync_to_slack" field. +func SyncToSlackNEQ(v bool) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldSyncToSlack, v)) +} + +// SyncToSlackIsNil applies the IsNil predicate on the "sync_to_slack" field. +func SyncToSlackIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldSyncToSlack)) +} + +// SyncToSlackNotNil applies the NotNil predicate on the "sync_to_slack" field. +func SyncToSlackNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldSyncToSlack)) +} + +// SyncToGithubEQ applies the EQ predicate on the "sync_to_github" field. +func SyncToGithubEQ(v bool) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldSyncToGithub, v)) +} + +// SyncToGithubNEQ applies the NEQ predicate on the "sync_to_github" field. +func SyncToGithubNEQ(v bool) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldSyncToGithub, v)) +} + +// SyncToGithubIsNil applies the IsNil predicate on the "sync_to_github" field. +func SyncToGithubIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldSyncToGithub)) +} + +// SyncToGithubNotNil applies the NotNil predicate on the "sync_to_github" field. +func SyncToGithubNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldSyncToGithub)) +} + +// GroupIDEQ applies the EQ predicate on the "group_id" field. +func GroupIDEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEQ(FieldGroupID, v)) +} + +// GroupIDNEQ applies the NEQ predicate on the "group_id" field. +func GroupIDNEQ(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNEQ(FieldGroupID, v)) +} + +// GroupIDIn applies the In predicate on the "group_id" field. +func GroupIDIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIn(FieldGroupID, vs...)) +} + +// GroupIDNotIn applies the NotIn predicate on the "group_id" field. +func GroupIDNotIn(vs ...string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotIn(FieldGroupID, vs...)) +} + +// GroupIDGT applies the GT predicate on the "group_id" field. +func GroupIDGT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGT(FieldGroupID, v)) +} + +// GroupIDGTE applies the GTE predicate on the "group_id" field. +func GroupIDGTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldGTE(FieldGroupID, v)) +} + +// GroupIDLT applies the LT predicate on the "group_id" field. +func GroupIDLT(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLT(FieldGroupID, v)) +} + +// GroupIDLTE applies the LTE predicate on the "group_id" field. +func GroupIDLTE(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldLTE(FieldGroupID, v)) +} + +// GroupIDContains applies the Contains predicate on the "group_id" field. +func GroupIDContains(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContains(FieldGroupID, v)) +} + +// GroupIDHasPrefix applies the HasPrefix predicate on the "group_id" field. +func GroupIDHasPrefix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasPrefix(FieldGroupID, v)) +} + +// GroupIDHasSuffix applies the HasSuffix predicate on the "group_id" field. +func GroupIDHasSuffix(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldHasSuffix(FieldGroupID, v)) +} + +// GroupIDIsNil applies the IsNil predicate on the "group_id" field. +func GroupIDIsNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldIsNull(FieldGroupID)) +} + +// GroupIDNotNil applies the NotNil predicate on the "group_id" field. +func GroupIDNotNil() predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldNotNull(FieldGroupID)) +} + +// GroupIDEqualFold applies the EqualFold predicate on the "group_id" field. +func GroupIDEqualFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldEqualFold(FieldGroupID, v)) +} + +// GroupIDContainsFold applies the ContainsFold predicate on the "group_id" field. +func GroupIDContainsFold(v string) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.FieldContainsFold(FieldGroupID, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.GroupSettingHistory) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.GroupSettingHistory) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.GroupSettingHistory) predicate.GroupSettingHistory { + return predicate.GroupSettingHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/groupsettinghistory_create.go b/internal/ent/generated/groupsettinghistory_create.go new file mode 100644 index 0000000..fdc17cd --- /dev/null +++ b/internal/ent/generated/groupsettinghistory_create.go @@ -0,0 +1,559 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// GroupSettingHistoryCreate is the builder for creating a GroupSettingHistory entity. +type GroupSettingHistoryCreate struct { + config + mutation *GroupSettingHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (gshc *GroupSettingHistoryCreate) SetHistoryTime(t time.Time) *GroupSettingHistoryCreate { + gshc.mutation.SetHistoryTime(t) + return gshc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableHistoryTime(t *time.Time) *GroupSettingHistoryCreate { + if t != nil { + gshc.SetHistoryTime(*t) + } + return gshc +} + +// SetRef sets the "ref" field. +func (gshc *GroupSettingHistoryCreate) SetRef(s string) *GroupSettingHistoryCreate { + gshc.mutation.SetRef(s) + return gshc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableRef(s *string) *GroupSettingHistoryCreate { + if s != nil { + gshc.SetRef(*s) + } + return gshc +} + +// SetOperation sets the "operation" field. +func (gshc *GroupSettingHistoryCreate) SetOperation(ht history.OpType) *GroupSettingHistoryCreate { + gshc.mutation.SetOperation(ht) + return gshc +} + +// SetCreatedAt sets the "created_at" field. +func (gshc *GroupSettingHistoryCreate) SetCreatedAt(t time.Time) *GroupSettingHistoryCreate { + gshc.mutation.SetCreatedAt(t) + return gshc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableCreatedAt(t *time.Time) *GroupSettingHistoryCreate { + if t != nil { + gshc.SetCreatedAt(*t) + } + return gshc +} + +// SetUpdatedAt sets the "updated_at" field. +func (gshc *GroupSettingHistoryCreate) SetUpdatedAt(t time.Time) *GroupSettingHistoryCreate { + gshc.mutation.SetUpdatedAt(t) + return gshc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableUpdatedAt(t *time.Time) *GroupSettingHistoryCreate { + if t != nil { + gshc.SetUpdatedAt(*t) + } + return gshc +} + +// SetCreatedBy sets the "created_by" field. +func (gshc *GroupSettingHistoryCreate) SetCreatedBy(s string) *GroupSettingHistoryCreate { + gshc.mutation.SetCreatedBy(s) + return gshc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableCreatedBy(s *string) *GroupSettingHistoryCreate { + if s != nil { + gshc.SetCreatedBy(*s) + } + return gshc +} + +// SetUpdatedBy sets the "updated_by" field. +func (gshc *GroupSettingHistoryCreate) SetUpdatedBy(s string) *GroupSettingHistoryCreate { + gshc.mutation.SetUpdatedBy(s) + return gshc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableUpdatedBy(s *string) *GroupSettingHistoryCreate { + if s != nil { + gshc.SetUpdatedBy(*s) + } + return gshc +} + +// SetMappingID sets the "mapping_id" field. +func (gshc *GroupSettingHistoryCreate) SetMappingID(s string) *GroupSettingHistoryCreate { + gshc.mutation.SetMappingID(s) + return gshc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableMappingID(s *string) *GroupSettingHistoryCreate { + if s != nil { + gshc.SetMappingID(*s) + } + return gshc +} + +// SetTags sets the "tags" field. +func (gshc *GroupSettingHistoryCreate) SetTags(s []string) *GroupSettingHistoryCreate { + gshc.mutation.SetTags(s) + return gshc +} + +// SetDeletedAt sets the "deleted_at" field. +func (gshc *GroupSettingHistoryCreate) SetDeletedAt(t time.Time) *GroupSettingHistoryCreate { + gshc.mutation.SetDeletedAt(t) + return gshc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableDeletedAt(t *time.Time) *GroupSettingHistoryCreate { + if t != nil { + gshc.SetDeletedAt(*t) + } + return gshc +} + +// SetDeletedBy sets the "deleted_by" field. +func (gshc *GroupSettingHistoryCreate) SetDeletedBy(s string) *GroupSettingHistoryCreate { + gshc.mutation.SetDeletedBy(s) + return gshc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableDeletedBy(s *string) *GroupSettingHistoryCreate { + if s != nil { + gshc.SetDeletedBy(*s) + } + return gshc +} + +// SetVisibility sets the "visibility" field. +func (gshc *GroupSettingHistoryCreate) SetVisibility(e enums.Visibility) *GroupSettingHistoryCreate { + gshc.mutation.SetVisibility(e) + return gshc +} + +// SetNillableVisibility sets the "visibility" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableVisibility(e *enums.Visibility) *GroupSettingHistoryCreate { + if e != nil { + gshc.SetVisibility(*e) + } + return gshc +} + +// SetJoinPolicy sets the "join_policy" field. +func (gshc *GroupSettingHistoryCreate) SetJoinPolicy(ep enums.JoinPolicy) *GroupSettingHistoryCreate { + gshc.mutation.SetJoinPolicy(ep) + return gshc +} + +// SetNillableJoinPolicy sets the "join_policy" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableJoinPolicy(ep *enums.JoinPolicy) *GroupSettingHistoryCreate { + if ep != nil { + gshc.SetJoinPolicy(*ep) + } + return gshc +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (gshc *GroupSettingHistoryCreate) SetSyncToSlack(b bool) *GroupSettingHistoryCreate { + gshc.mutation.SetSyncToSlack(b) + return gshc +} + +// SetNillableSyncToSlack sets the "sync_to_slack" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableSyncToSlack(b *bool) *GroupSettingHistoryCreate { + if b != nil { + gshc.SetSyncToSlack(*b) + } + return gshc +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (gshc *GroupSettingHistoryCreate) SetSyncToGithub(b bool) *GroupSettingHistoryCreate { + gshc.mutation.SetSyncToGithub(b) + return gshc +} + +// SetNillableSyncToGithub sets the "sync_to_github" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableSyncToGithub(b *bool) *GroupSettingHistoryCreate { + if b != nil { + gshc.SetSyncToGithub(*b) + } + return gshc +} + +// SetGroupID sets the "group_id" field. +func (gshc *GroupSettingHistoryCreate) SetGroupID(s string) *GroupSettingHistoryCreate { + gshc.mutation.SetGroupID(s) + return gshc +} + +// SetNillableGroupID sets the "group_id" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableGroupID(s *string) *GroupSettingHistoryCreate { + if s != nil { + gshc.SetGroupID(*s) + } + return gshc +} + +// SetID sets the "id" field. +func (gshc *GroupSettingHistoryCreate) SetID(s string) *GroupSettingHistoryCreate { + gshc.mutation.SetID(s) + return gshc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (gshc *GroupSettingHistoryCreate) SetNillableID(s *string) *GroupSettingHistoryCreate { + if s != nil { + gshc.SetID(*s) + } + return gshc +} + +// Mutation returns the GroupSettingHistoryMutation object of the builder. +func (gshc *GroupSettingHistoryCreate) Mutation() *GroupSettingHistoryMutation { + return gshc.mutation +} + +// Save creates the GroupSettingHistory in the database. +func (gshc *GroupSettingHistoryCreate) Save(ctx context.Context) (*GroupSettingHistory, error) { + if err := gshc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gshc.sqlSave, gshc.mutation, gshc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (gshc *GroupSettingHistoryCreate) SaveX(ctx context.Context) *GroupSettingHistory { + v, err := gshc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gshc *GroupSettingHistoryCreate) Exec(ctx context.Context) error { + _, err := gshc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gshc *GroupSettingHistoryCreate) ExecX(ctx context.Context) { + if err := gshc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gshc *GroupSettingHistoryCreate) defaults() error { + if _, ok := gshc.mutation.HistoryTime(); !ok { + if groupsettinghistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized groupsettinghistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := groupsettinghistory.DefaultHistoryTime() + gshc.mutation.SetHistoryTime(v) + } + if _, ok := gshc.mutation.CreatedAt(); !ok { + if groupsettinghistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsettinghistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := groupsettinghistory.DefaultCreatedAt() + gshc.mutation.SetCreatedAt(v) + } + if _, ok := gshc.mutation.UpdatedAt(); !ok { + if groupsettinghistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsettinghistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupsettinghistory.DefaultUpdatedAt() + gshc.mutation.SetUpdatedAt(v) + } + if _, ok := gshc.mutation.MappingID(); !ok { + if groupsettinghistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized groupsettinghistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := groupsettinghistory.DefaultMappingID() + gshc.mutation.SetMappingID(v) + } + if _, ok := gshc.mutation.Tags(); !ok { + v := groupsettinghistory.DefaultTags + gshc.mutation.SetTags(v) + } + if _, ok := gshc.mutation.Visibility(); !ok { + v := groupsettinghistory.DefaultVisibility + gshc.mutation.SetVisibility(v) + } + if _, ok := gshc.mutation.JoinPolicy(); !ok { + v := groupsettinghistory.DefaultJoinPolicy + gshc.mutation.SetJoinPolicy(v) + } + if _, ok := gshc.mutation.SyncToSlack(); !ok { + v := groupsettinghistory.DefaultSyncToSlack + gshc.mutation.SetSyncToSlack(v) + } + if _, ok := gshc.mutation.SyncToGithub(); !ok { + v := groupsettinghistory.DefaultSyncToGithub + gshc.mutation.SetSyncToGithub(v) + } + if _, ok := gshc.mutation.ID(); !ok { + if groupsettinghistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized groupsettinghistory.DefaultID (forgotten import generated/runtime?)") + } + v := groupsettinghistory.DefaultID() + gshc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gshc *GroupSettingHistoryCreate) check() error { + if _, ok := gshc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "GroupSettingHistory.history_time"`)} + } + if _, ok := gshc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "GroupSettingHistory.operation"`)} + } + if v, ok := gshc.mutation.Operation(); ok { + if err := groupsettinghistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "GroupSettingHistory.operation": %w`, err)} + } + } + if _, ok := gshc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "GroupSettingHistory.mapping_id"`)} + } + if _, ok := gshc.mutation.Visibility(); !ok { + return &ValidationError{Name: "visibility", err: errors.New(`generated: missing required field "GroupSettingHistory.visibility"`)} + } + if v, ok := gshc.mutation.Visibility(); ok { + if err := groupsettinghistory.VisibilityValidator(v); err != nil { + return &ValidationError{Name: "visibility", err: fmt.Errorf(`generated: validator failed for field "GroupSettingHistory.visibility": %w`, err)} + } + } + if _, ok := gshc.mutation.JoinPolicy(); !ok { + return &ValidationError{Name: "join_policy", err: errors.New(`generated: missing required field "GroupSettingHistory.join_policy"`)} + } + if v, ok := gshc.mutation.JoinPolicy(); ok { + if err := groupsettinghistory.JoinPolicyValidator(v); err != nil { + return &ValidationError{Name: "join_policy", err: fmt.Errorf(`generated: validator failed for field "GroupSettingHistory.join_policy": %w`, err)} + } + } + return nil +} + +func (gshc *GroupSettingHistoryCreate) sqlSave(ctx context.Context) (*GroupSettingHistory, error) { + if err := gshc.check(); err != nil { + return nil, err + } + _node, _spec := gshc.createSpec() + if err := sqlgraph.CreateNode(ctx, gshc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected GroupSettingHistory.ID type: %T", _spec.ID.Value) + } + } + gshc.mutation.id = &_node.ID + gshc.mutation.done = true + return _node, nil +} + +func (gshc *GroupSettingHistoryCreate) createSpec() (*GroupSettingHistory, *sqlgraph.CreateSpec) { + var ( + _node = &GroupSettingHistory{config: gshc.config} + _spec = sqlgraph.NewCreateSpec(groupsettinghistory.Table, sqlgraph.NewFieldSpec(groupsettinghistory.FieldID, field.TypeString)) + ) + _spec.Schema = gshc.schemaConfig.GroupSettingHistory + if id, ok := gshc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := gshc.mutation.HistoryTime(); ok { + _spec.SetField(groupsettinghistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := gshc.mutation.Ref(); ok { + _spec.SetField(groupsettinghistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := gshc.mutation.Operation(); ok { + _spec.SetField(groupsettinghistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := gshc.mutation.CreatedAt(); ok { + _spec.SetField(groupsettinghistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := gshc.mutation.UpdatedAt(); ok { + _spec.SetField(groupsettinghistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := gshc.mutation.CreatedBy(); ok { + _spec.SetField(groupsettinghistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := gshc.mutation.UpdatedBy(); ok { + _spec.SetField(groupsettinghistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := gshc.mutation.MappingID(); ok { + _spec.SetField(groupsettinghistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := gshc.mutation.Tags(); ok { + _spec.SetField(groupsettinghistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := gshc.mutation.DeletedAt(); ok { + _spec.SetField(groupsettinghistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := gshc.mutation.DeletedBy(); ok { + _spec.SetField(groupsettinghistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := gshc.mutation.Visibility(); ok { + _spec.SetField(groupsettinghistory.FieldVisibility, field.TypeEnum, value) + _node.Visibility = value + } + if value, ok := gshc.mutation.JoinPolicy(); ok { + _spec.SetField(groupsettinghistory.FieldJoinPolicy, field.TypeEnum, value) + _node.JoinPolicy = value + } + if value, ok := gshc.mutation.SyncToSlack(); ok { + _spec.SetField(groupsettinghistory.FieldSyncToSlack, field.TypeBool, value) + _node.SyncToSlack = value + } + if value, ok := gshc.mutation.SyncToGithub(); ok { + _spec.SetField(groupsettinghistory.FieldSyncToGithub, field.TypeBool, value) + _node.SyncToGithub = value + } + if value, ok := gshc.mutation.GroupID(); ok { + _spec.SetField(groupsettinghistory.FieldGroupID, field.TypeString, value) + _node.GroupID = value + } + return _node, _spec +} + +// GroupSettingHistoryCreateBulk is the builder for creating many GroupSettingHistory entities in bulk. +type GroupSettingHistoryCreateBulk struct { + config + err error + builders []*GroupSettingHistoryCreate +} + +// Save creates the GroupSettingHistory entities in the database. +func (gshcb *GroupSettingHistoryCreateBulk) Save(ctx context.Context) ([]*GroupSettingHistory, error) { + if gshcb.err != nil { + return nil, gshcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(gshcb.builders)) + nodes := make([]*GroupSettingHistory, len(gshcb.builders)) + mutators := make([]Mutator, len(gshcb.builders)) + for i := range gshcb.builders { + func(i int, root context.Context) { + builder := gshcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*GroupSettingHistoryMutation) + 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, gshcb.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, gshcb.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, gshcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (gshcb *GroupSettingHistoryCreateBulk) SaveX(ctx context.Context) []*GroupSettingHistory { + v, err := gshcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (gshcb *GroupSettingHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := gshcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gshcb *GroupSettingHistoryCreateBulk) ExecX(ctx context.Context) { + if err := gshcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupsettinghistory_delete.go b/internal/ent/generated/groupsettinghistory_delete.go new file mode 100644 index 0000000..040b76b --- /dev/null +++ b/internal/ent/generated/groupsettinghistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupSettingHistoryDelete is the builder for deleting a GroupSettingHistory entity. +type GroupSettingHistoryDelete struct { + config + hooks []Hook + mutation *GroupSettingHistoryMutation +} + +// Where appends a list predicates to the GroupSettingHistoryDelete builder. +func (gshd *GroupSettingHistoryDelete) Where(ps ...predicate.GroupSettingHistory) *GroupSettingHistoryDelete { + gshd.mutation.Where(ps...) + return gshd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (gshd *GroupSettingHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, gshd.sqlExec, gshd.mutation, gshd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (gshd *GroupSettingHistoryDelete) ExecX(ctx context.Context) int { + n, err := gshd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (gshd *GroupSettingHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(groupsettinghistory.Table, sqlgraph.NewFieldSpec(groupsettinghistory.FieldID, field.TypeString)) + _spec.Node.Schema = gshd.schemaConfig.GroupSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, gshd.schemaConfig) + if ps := gshd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, gshd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + gshd.mutation.done = true + return affected, err +} + +// GroupSettingHistoryDeleteOne is the builder for deleting a single GroupSettingHistory entity. +type GroupSettingHistoryDeleteOne struct { + gshd *GroupSettingHistoryDelete +} + +// Where appends a list predicates to the GroupSettingHistoryDelete builder. +func (gshdo *GroupSettingHistoryDeleteOne) Where(ps ...predicate.GroupSettingHistory) *GroupSettingHistoryDeleteOne { + gshdo.gshd.mutation.Where(ps...) + return gshdo +} + +// Exec executes the deletion query. +func (gshdo *GroupSettingHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := gshdo.gshd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{groupsettinghistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (gshdo *GroupSettingHistoryDeleteOne) ExecX(ctx context.Context) { + if err := gshdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/groupsettinghistory_query.go b/internal/ent/generated/groupsettinghistory_query.go new file mode 100644 index 0000000..05246ed --- /dev/null +++ b/internal/ent/generated/groupsettinghistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupSettingHistoryQuery is the builder for querying GroupSettingHistory entities. +type GroupSettingHistoryQuery struct { + config + ctx *QueryContext + order []groupsettinghistory.OrderOption + inters []Interceptor + predicates []predicate.GroupSettingHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*GroupSettingHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the GroupSettingHistoryQuery builder. +func (gshq *GroupSettingHistoryQuery) Where(ps ...predicate.GroupSettingHistory) *GroupSettingHistoryQuery { + gshq.predicates = append(gshq.predicates, ps...) + return gshq +} + +// Limit the number of records to be returned by this query. +func (gshq *GroupSettingHistoryQuery) Limit(limit int) *GroupSettingHistoryQuery { + gshq.ctx.Limit = &limit + return gshq +} + +// Offset to start from. +func (gshq *GroupSettingHistoryQuery) Offset(offset int) *GroupSettingHistoryQuery { + gshq.ctx.Offset = &offset + return gshq +} + +// 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 (gshq *GroupSettingHistoryQuery) Unique(unique bool) *GroupSettingHistoryQuery { + gshq.ctx.Unique = &unique + return gshq +} + +// Order specifies how the records should be ordered. +func (gshq *GroupSettingHistoryQuery) Order(o ...groupsettinghistory.OrderOption) *GroupSettingHistoryQuery { + gshq.order = append(gshq.order, o...) + return gshq +} + +// First returns the first GroupSettingHistory entity from the query. +// Returns a *NotFoundError when no GroupSettingHistory was found. +func (gshq *GroupSettingHistoryQuery) First(ctx context.Context) (*GroupSettingHistory, error) { + nodes, err := gshq.Limit(1).All(setContextOp(ctx, gshq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{groupsettinghistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) FirstX(ctx context.Context) *GroupSettingHistory { + node, err := gshq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first GroupSettingHistory ID from the query. +// Returns a *NotFoundError when no GroupSettingHistory ID was found. +func (gshq *GroupSettingHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gshq.Limit(1).IDs(setContextOp(ctx, gshq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{groupsettinghistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := gshq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single GroupSettingHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one GroupSettingHistory entity is found. +// Returns a *NotFoundError when no GroupSettingHistory entities are found. +func (gshq *GroupSettingHistoryQuery) Only(ctx context.Context) (*GroupSettingHistory, error) { + nodes, err := gshq.Limit(2).All(setContextOp(ctx, gshq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{groupsettinghistory.Label} + default: + return nil, &NotSingularError{groupsettinghistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) OnlyX(ctx context.Context) *GroupSettingHistory { + node, err := gshq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only GroupSettingHistory ID in the query. +// Returns a *NotSingularError when more than one GroupSettingHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (gshq *GroupSettingHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = gshq.Limit(2).IDs(setContextOp(ctx, gshq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{groupsettinghistory.Label} + default: + err = &NotSingularError{groupsettinghistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := gshq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of GroupSettingHistories. +func (gshq *GroupSettingHistoryQuery) All(ctx context.Context) ([]*GroupSettingHistory, error) { + ctx = setContextOp(ctx, gshq.ctx, ent.OpQueryAll) + if err := gshq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*GroupSettingHistory, *GroupSettingHistoryQuery]() + return withInterceptors[[]*GroupSettingHistory](ctx, gshq, qr, gshq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) AllX(ctx context.Context) []*GroupSettingHistory { + nodes, err := gshq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of GroupSettingHistory IDs. +func (gshq *GroupSettingHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if gshq.ctx.Unique == nil && gshq.path != nil { + gshq.Unique(true) + } + ctx = setContextOp(ctx, gshq.ctx, ent.OpQueryIDs) + if err = gshq.Select(groupsettinghistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := gshq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (gshq *GroupSettingHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, gshq.ctx, ent.OpQueryCount) + if err := gshq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, gshq, querierCount[*GroupSettingHistoryQuery](), gshq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) CountX(ctx context.Context) int { + count, err := gshq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (gshq *GroupSettingHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, gshq.ctx, ent.OpQueryExist) + switch _, err := gshq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (gshq *GroupSettingHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := gshq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the GroupSettingHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (gshq *GroupSettingHistoryQuery) Clone() *GroupSettingHistoryQuery { + if gshq == nil { + return nil + } + return &GroupSettingHistoryQuery{ + config: gshq.config, + ctx: gshq.ctx.Clone(), + order: append([]groupsettinghistory.OrderOption{}, gshq.order...), + inters: append([]Interceptor{}, gshq.inters...), + predicates: append([]predicate.GroupSettingHistory{}, gshq.predicates...), + // clone intermediate query. + sql: gshq.sql.Clone(), + path: gshq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.GroupSettingHistory.Query(). +// GroupBy(groupsettinghistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (gshq *GroupSettingHistoryQuery) GroupBy(field string, fields ...string) *GroupSettingHistoryGroupBy { + gshq.ctx.Fields = append([]string{field}, fields...) + grbuild := &GroupSettingHistoryGroupBy{build: gshq} + grbuild.flds = &gshq.ctx.Fields + grbuild.label = groupsettinghistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.GroupSettingHistory.Query(). +// Select(groupsettinghistory.FieldHistoryTime). +// Scan(ctx, &v) +func (gshq *GroupSettingHistoryQuery) Select(fields ...string) *GroupSettingHistorySelect { + gshq.ctx.Fields = append(gshq.ctx.Fields, fields...) + sbuild := &GroupSettingHistorySelect{GroupSettingHistoryQuery: gshq} + sbuild.label = groupsettinghistory.Label + sbuild.flds, sbuild.scan = &gshq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a GroupSettingHistorySelect configured with the given aggregations. +func (gshq *GroupSettingHistoryQuery) Aggregate(fns ...AggregateFunc) *GroupSettingHistorySelect { + return gshq.Select().Aggregate(fns...) +} + +func (gshq *GroupSettingHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range gshq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, gshq); err != nil { + return err + } + } + } + for _, f := range gshq.ctx.Fields { + if !groupsettinghistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if gshq.path != nil { + prev, err := gshq.path(ctx) + if err != nil { + return err + } + gshq.sql = prev + } + if groupsettinghistory.Policy == nil { + return errors.New("generated: uninitialized groupsettinghistory.Policy (forgotten import generated/runtime?)") + } + if err := groupsettinghistory.Policy.EvalQuery(ctx, gshq); err != nil { + return err + } + return nil +} + +func (gshq *GroupSettingHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GroupSettingHistory, error) { + var ( + nodes = []*GroupSettingHistory{} + _spec = gshq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*GroupSettingHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &GroupSettingHistory{config: gshq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = gshq.schemaConfig.GroupSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, gshq.schemaConfig) + if len(gshq.modifiers) > 0 { + _spec.Modifiers = gshq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, gshq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range gshq.loadTotal { + if err := gshq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (gshq *GroupSettingHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := gshq.querySpec() + _spec.Node.Schema = gshq.schemaConfig.GroupSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, gshq.schemaConfig) + if len(gshq.modifiers) > 0 { + _spec.Modifiers = gshq.modifiers + } + _spec.Node.Columns = gshq.ctx.Fields + if len(gshq.ctx.Fields) > 0 { + _spec.Unique = gshq.ctx.Unique != nil && *gshq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, gshq.driver, _spec) +} + +func (gshq *GroupSettingHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(groupsettinghistory.Table, groupsettinghistory.Columns, sqlgraph.NewFieldSpec(groupsettinghistory.FieldID, field.TypeString)) + _spec.From = gshq.sql + if unique := gshq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if gshq.path != nil { + _spec.Unique = true + } + if fields := gshq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupsettinghistory.FieldID) + for i := range fields { + if fields[i] != groupsettinghistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := gshq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := gshq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := gshq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := gshq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (gshq *GroupSettingHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(gshq.driver.Dialect()) + t1 := builder.Table(groupsettinghistory.Table) + columns := gshq.ctx.Fields + if len(columns) == 0 { + columns = groupsettinghistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if gshq.sql != nil { + selector = gshq.sql + selector.Select(selector.Columns(columns...)...) + } + if gshq.ctx.Unique != nil && *gshq.ctx.Unique { + selector.Distinct() + } + t1.Schema(gshq.schemaConfig.GroupSettingHistory) + ctx = internal.NewSchemaConfigContext(ctx, gshq.schemaConfig) + selector.WithContext(ctx) + for _, p := range gshq.predicates { + p(selector) + } + for _, p := range gshq.order { + p(selector) + } + if offset := gshq.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 := gshq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// GroupSettingHistoryGroupBy is the group-by builder for GroupSettingHistory entities. +type GroupSettingHistoryGroupBy struct { + selector + build *GroupSettingHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (gshgb *GroupSettingHistoryGroupBy) Aggregate(fns ...AggregateFunc) *GroupSettingHistoryGroupBy { + gshgb.fns = append(gshgb.fns, fns...) + return gshgb +} + +// Scan applies the selector query and scans the result into the given value. +func (gshgb *GroupSettingHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gshgb.build.ctx, ent.OpQueryGroupBy) + if err := gshgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupSettingHistoryQuery, *GroupSettingHistoryGroupBy](ctx, gshgb.build, gshgb, gshgb.build.inters, v) +} + +func (gshgb *GroupSettingHistoryGroupBy) sqlScan(ctx context.Context, root *GroupSettingHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(gshgb.fns)) + for _, fn := range gshgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*gshgb.flds)+len(gshgb.fns)) + for _, f := range *gshgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*gshgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := gshgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// GroupSettingHistorySelect is the builder for selecting fields of GroupSettingHistory entities. +type GroupSettingHistorySelect struct { + *GroupSettingHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (gshs *GroupSettingHistorySelect) Aggregate(fns ...AggregateFunc) *GroupSettingHistorySelect { + gshs.fns = append(gshs.fns, fns...) + return gshs +} + +// Scan applies the selector query and scans the result into the given value. +func (gshs *GroupSettingHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, gshs.ctx, ent.OpQuerySelect) + if err := gshs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*GroupSettingHistoryQuery, *GroupSettingHistorySelect](ctx, gshs.GroupSettingHistoryQuery, gshs, gshs.inters, v) +} + +func (gshs *GroupSettingHistorySelect) sqlScan(ctx context.Context, root *GroupSettingHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(gshs.fns)) + for _, fn := range gshs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*gshs.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 := gshs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/groupsettinghistory_update.go b/internal/ent/generated/groupsettinghistory_update.go new file mode 100644 index 0000000..6288765 --- /dev/null +++ b/internal/ent/generated/groupsettinghistory_update.go @@ -0,0 +1,742 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// GroupSettingHistoryUpdate is the builder for updating GroupSettingHistory entities. +type GroupSettingHistoryUpdate struct { + config + hooks []Hook + mutation *GroupSettingHistoryMutation +} + +// Where appends a list predicates to the GroupSettingHistoryUpdate builder. +func (gshu *GroupSettingHistoryUpdate) Where(ps ...predicate.GroupSettingHistory) *GroupSettingHistoryUpdate { + gshu.mutation.Where(ps...) + return gshu +} + +// SetUpdatedAt sets the "updated_at" field. +func (gshu *GroupSettingHistoryUpdate) SetUpdatedAt(t time.Time) *GroupSettingHistoryUpdate { + gshu.mutation.SetUpdatedAt(t) + return gshu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gshu *GroupSettingHistoryUpdate) ClearUpdatedAt() *GroupSettingHistoryUpdate { + gshu.mutation.ClearUpdatedAt() + return gshu +} + +// SetUpdatedBy sets the "updated_by" field. +func (gshu *GroupSettingHistoryUpdate) SetUpdatedBy(s string) *GroupSettingHistoryUpdate { + gshu.mutation.SetUpdatedBy(s) + return gshu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableUpdatedBy(s *string) *GroupSettingHistoryUpdate { + if s != nil { + gshu.SetUpdatedBy(*s) + } + return gshu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gshu *GroupSettingHistoryUpdate) ClearUpdatedBy() *GroupSettingHistoryUpdate { + gshu.mutation.ClearUpdatedBy() + return gshu +} + +// SetTags sets the "tags" field. +func (gshu *GroupSettingHistoryUpdate) SetTags(s []string) *GroupSettingHistoryUpdate { + gshu.mutation.SetTags(s) + return gshu +} + +// AppendTags appends s to the "tags" field. +func (gshu *GroupSettingHistoryUpdate) AppendTags(s []string) *GroupSettingHistoryUpdate { + gshu.mutation.AppendTags(s) + return gshu +} + +// ClearTags clears the value of the "tags" field. +func (gshu *GroupSettingHistoryUpdate) ClearTags() *GroupSettingHistoryUpdate { + gshu.mutation.ClearTags() + return gshu +} + +// SetDeletedAt sets the "deleted_at" field. +func (gshu *GroupSettingHistoryUpdate) SetDeletedAt(t time.Time) *GroupSettingHistoryUpdate { + gshu.mutation.SetDeletedAt(t) + return gshu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableDeletedAt(t *time.Time) *GroupSettingHistoryUpdate { + if t != nil { + gshu.SetDeletedAt(*t) + } + return gshu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gshu *GroupSettingHistoryUpdate) ClearDeletedAt() *GroupSettingHistoryUpdate { + gshu.mutation.ClearDeletedAt() + return gshu +} + +// SetDeletedBy sets the "deleted_by" field. +func (gshu *GroupSettingHistoryUpdate) SetDeletedBy(s string) *GroupSettingHistoryUpdate { + gshu.mutation.SetDeletedBy(s) + return gshu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableDeletedBy(s *string) *GroupSettingHistoryUpdate { + if s != nil { + gshu.SetDeletedBy(*s) + } + return gshu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gshu *GroupSettingHistoryUpdate) ClearDeletedBy() *GroupSettingHistoryUpdate { + gshu.mutation.ClearDeletedBy() + return gshu +} + +// SetVisibility sets the "visibility" field. +func (gshu *GroupSettingHistoryUpdate) SetVisibility(e enums.Visibility) *GroupSettingHistoryUpdate { + gshu.mutation.SetVisibility(e) + return gshu +} + +// SetNillableVisibility sets the "visibility" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableVisibility(e *enums.Visibility) *GroupSettingHistoryUpdate { + if e != nil { + gshu.SetVisibility(*e) + } + return gshu +} + +// SetJoinPolicy sets the "join_policy" field. +func (gshu *GroupSettingHistoryUpdate) SetJoinPolicy(ep enums.JoinPolicy) *GroupSettingHistoryUpdate { + gshu.mutation.SetJoinPolicy(ep) + return gshu +} + +// SetNillableJoinPolicy sets the "join_policy" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableJoinPolicy(ep *enums.JoinPolicy) *GroupSettingHistoryUpdate { + if ep != nil { + gshu.SetJoinPolicy(*ep) + } + return gshu +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (gshu *GroupSettingHistoryUpdate) SetSyncToSlack(b bool) *GroupSettingHistoryUpdate { + gshu.mutation.SetSyncToSlack(b) + return gshu +} + +// SetNillableSyncToSlack sets the "sync_to_slack" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableSyncToSlack(b *bool) *GroupSettingHistoryUpdate { + if b != nil { + gshu.SetSyncToSlack(*b) + } + return gshu +} + +// ClearSyncToSlack clears the value of the "sync_to_slack" field. +func (gshu *GroupSettingHistoryUpdate) ClearSyncToSlack() *GroupSettingHistoryUpdate { + gshu.mutation.ClearSyncToSlack() + return gshu +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (gshu *GroupSettingHistoryUpdate) SetSyncToGithub(b bool) *GroupSettingHistoryUpdate { + gshu.mutation.SetSyncToGithub(b) + return gshu +} + +// SetNillableSyncToGithub sets the "sync_to_github" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableSyncToGithub(b *bool) *GroupSettingHistoryUpdate { + if b != nil { + gshu.SetSyncToGithub(*b) + } + return gshu +} + +// ClearSyncToGithub clears the value of the "sync_to_github" field. +func (gshu *GroupSettingHistoryUpdate) ClearSyncToGithub() *GroupSettingHistoryUpdate { + gshu.mutation.ClearSyncToGithub() + return gshu +} + +// SetGroupID sets the "group_id" field. +func (gshu *GroupSettingHistoryUpdate) SetGroupID(s string) *GroupSettingHistoryUpdate { + gshu.mutation.SetGroupID(s) + return gshu +} + +// SetNillableGroupID sets the "group_id" field if the given value is not nil. +func (gshu *GroupSettingHistoryUpdate) SetNillableGroupID(s *string) *GroupSettingHistoryUpdate { + if s != nil { + gshu.SetGroupID(*s) + } + return gshu +} + +// ClearGroupID clears the value of the "group_id" field. +func (gshu *GroupSettingHistoryUpdate) ClearGroupID() *GroupSettingHistoryUpdate { + gshu.mutation.ClearGroupID() + return gshu +} + +// Mutation returns the GroupSettingHistoryMutation object of the builder. +func (gshu *GroupSettingHistoryUpdate) Mutation() *GroupSettingHistoryMutation { + return gshu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (gshu *GroupSettingHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := gshu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, gshu.sqlSave, gshu.mutation, gshu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gshu *GroupSettingHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := gshu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (gshu *GroupSettingHistoryUpdate) Exec(ctx context.Context) error { + _, err := gshu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gshu *GroupSettingHistoryUpdate) ExecX(ctx context.Context) { + if err := gshu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gshu *GroupSettingHistoryUpdate) defaults() error { + if _, ok := gshu.mutation.UpdatedAt(); !ok && !gshu.mutation.UpdatedAtCleared() { + if groupsettinghistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsettinghistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupsettinghistory.UpdateDefaultUpdatedAt() + gshu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gshu *GroupSettingHistoryUpdate) check() error { + if v, ok := gshu.mutation.Visibility(); ok { + if err := groupsettinghistory.VisibilityValidator(v); err != nil { + return &ValidationError{Name: "visibility", err: fmt.Errorf(`generated: validator failed for field "GroupSettingHistory.visibility": %w`, err)} + } + } + if v, ok := gshu.mutation.JoinPolicy(); ok { + if err := groupsettinghistory.JoinPolicyValidator(v); err != nil { + return &ValidationError{Name: "join_policy", err: fmt.Errorf(`generated: validator failed for field "GroupSettingHistory.join_policy": %w`, err)} + } + } + return nil +} + +func (gshu *GroupSettingHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := gshu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(groupsettinghistory.Table, groupsettinghistory.Columns, sqlgraph.NewFieldSpec(groupsettinghistory.FieldID, field.TypeString)) + if ps := gshu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gshu.mutation.RefCleared() { + _spec.ClearField(groupsettinghistory.FieldRef, field.TypeString) + } + if gshu.mutation.CreatedAtCleared() { + _spec.ClearField(groupsettinghistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := gshu.mutation.UpdatedAt(); ok { + _spec.SetField(groupsettinghistory.FieldUpdatedAt, field.TypeTime, value) + } + if gshu.mutation.UpdatedAtCleared() { + _spec.ClearField(groupsettinghistory.FieldUpdatedAt, field.TypeTime) + } + if gshu.mutation.CreatedByCleared() { + _spec.ClearField(groupsettinghistory.FieldCreatedBy, field.TypeString) + } + if value, ok := gshu.mutation.UpdatedBy(); ok { + _spec.SetField(groupsettinghistory.FieldUpdatedBy, field.TypeString, value) + } + if gshu.mutation.UpdatedByCleared() { + _spec.ClearField(groupsettinghistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := gshu.mutation.Tags(); ok { + _spec.SetField(groupsettinghistory.FieldTags, field.TypeJSON, value) + } + if value, ok := gshu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, groupsettinghistory.FieldTags, value) + }) + } + if gshu.mutation.TagsCleared() { + _spec.ClearField(groupsettinghistory.FieldTags, field.TypeJSON) + } + if value, ok := gshu.mutation.DeletedAt(); ok { + _spec.SetField(groupsettinghistory.FieldDeletedAt, field.TypeTime, value) + } + if gshu.mutation.DeletedAtCleared() { + _spec.ClearField(groupsettinghistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := gshu.mutation.DeletedBy(); ok { + _spec.SetField(groupsettinghistory.FieldDeletedBy, field.TypeString, value) + } + if gshu.mutation.DeletedByCleared() { + _spec.ClearField(groupsettinghistory.FieldDeletedBy, field.TypeString) + } + if value, ok := gshu.mutation.Visibility(); ok { + _spec.SetField(groupsettinghistory.FieldVisibility, field.TypeEnum, value) + } + if value, ok := gshu.mutation.JoinPolicy(); ok { + _spec.SetField(groupsettinghistory.FieldJoinPolicy, field.TypeEnum, value) + } + if value, ok := gshu.mutation.SyncToSlack(); ok { + _spec.SetField(groupsettinghistory.FieldSyncToSlack, field.TypeBool, value) + } + if gshu.mutation.SyncToSlackCleared() { + _spec.ClearField(groupsettinghistory.FieldSyncToSlack, field.TypeBool) + } + if value, ok := gshu.mutation.SyncToGithub(); ok { + _spec.SetField(groupsettinghistory.FieldSyncToGithub, field.TypeBool, value) + } + if gshu.mutation.SyncToGithubCleared() { + _spec.ClearField(groupsettinghistory.FieldSyncToGithub, field.TypeBool) + } + if value, ok := gshu.mutation.GroupID(); ok { + _spec.SetField(groupsettinghistory.FieldGroupID, field.TypeString, value) + } + if gshu.mutation.GroupIDCleared() { + _spec.ClearField(groupsettinghistory.FieldGroupID, field.TypeString) + } + _spec.Node.Schema = gshu.schemaConfig.GroupSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, gshu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, gshu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupsettinghistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + gshu.mutation.done = true + return n, nil +} + +// GroupSettingHistoryUpdateOne is the builder for updating a single GroupSettingHistory entity. +type GroupSettingHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *GroupSettingHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetUpdatedAt(t time.Time) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetUpdatedAt(t) + return gshuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearUpdatedAt() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearUpdatedAt() + return gshuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetUpdatedBy(s string) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetUpdatedBy(s) + return gshuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableUpdatedBy(s *string) *GroupSettingHistoryUpdateOne { + if s != nil { + gshuo.SetUpdatedBy(*s) + } + return gshuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearUpdatedBy() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearUpdatedBy() + return gshuo +} + +// SetTags sets the "tags" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetTags(s []string) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetTags(s) + return gshuo +} + +// AppendTags appends s to the "tags" field. +func (gshuo *GroupSettingHistoryUpdateOne) AppendTags(s []string) *GroupSettingHistoryUpdateOne { + gshuo.mutation.AppendTags(s) + return gshuo +} + +// ClearTags clears the value of the "tags" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearTags() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearTags() + return gshuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetDeletedAt(t time.Time) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetDeletedAt(t) + return gshuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *GroupSettingHistoryUpdateOne { + if t != nil { + gshuo.SetDeletedAt(*t) + } + return gshuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearDeletedAt() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearDeletedAt() + return gshuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetDeletedBy(s string) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetDeletedBy(s) + return gshuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableDeletedBy(s *string) *GroupSettingHistoryUpdateOne { + if s != nil { + gshuo.SetDeletedBy(*s) + } + return gshuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearDeletedBy() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearDeletedBy() + return gshuo +} + +// SetVisibility sets the "visibility" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetVisibility(e enums.Visibility) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetVisibility(e) + return gshuo +} + +// SetNillableVisibility sets the "visibility" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableVisibility(e *enums.Visibility) *GroupSettingHistoryUpdateOne { + if e != nil { + gshuo.SetVisibility(*e) + } + return gshuo +} + +// SetJoinPolicy sets the "join_policy" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetJoinPolicy(ep enums.JoinPolicy) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetJoinPolicy(ep) + return gshuo +} + +// SetNillableJoinPolicy sets the "join_policy" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableJoinPolicy(ep *enums.JoinPolicy) *GroupSettingHistoryUpdateOne { + if ep != nil { + gshuo.SetJoinPolicy(*ep) + } + return gshuo +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetSyncToSlack(b bool) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetSyncToSlack(b) + return gshuo +} + +// SetNillableSyncToSlack sets the "sync_to_slack" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableSyncToSlack(b *bool) *GroupSettingHistoryUpdateOne { + if b != nil { + gshuo.SetSyncToSlack(*b) + } + return gshuo +} + +// ClearSyncToSlack clears the value of the "sync_to_slack" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearSyncToSlack() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearSyncToSlack() + return gshuo +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetSyncToGithub(b bool) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetSyncToGithub(b) + return gshuo +} + +// SetNillableSyncToGithub sets the "sync_to_github" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableSyncToGithub(b *bool) *GroupSettingHistoryUpdateOne { + if b != nil { + gshuo.SetSyncToGithub(*b) + } + return gshuo +} + +// ClearSyncToGithub clears the value of the "sync_to_github" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearSyncToGithub() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearSyncToGithub() + return gshuo +} + +// SetGroupID sets the "group_id" field. +func (gshuo *GroupSettingHistoryUpdateOne) SetGroupID(s string) *GroupSettingHistoryUpdateOne { + gshuo.mutation.SetGroupID(s) + return gshuo +} + +// SetNillableGroupID sets the "group_id" field if the given value is not nil. +func (gshuo *GroupSettingHistoryUpdateOne) SetNillableGroupID(s *string) *GroupSettingHistoryUpdateOne { + if s != nil { + gshuo.SetGroupID(*s) + } + return gshuo +} + +// ClearGroupID clears the value of the "group_id" field. +func (gshuo *GroupSettingHistoryUpdateOne) ClearGroupID() *GroupSettingHistoryUpdateOne { + gshuo.mutation.ClearGroupID() + return gshuo +} + +// Mutation returns the GroupSettingHistoryMutation object of the builder. +func (gshuo *GroupSettingHistoryUpdateOne) Mutation() *GroupSettingHistoryMutation { + return gshuo.mutation +} + +// Where appends a list predicates to the GroupSettingHistoryUpdate builder. +func (gshuo *GroupSettingHistoryUpdateOne) Where(ps ...predicate.GroupSettingHistory) *GroupSettingHistoryUpdateOne { + gshuo.mutation.Where(ps...) + return gshuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (gshuo *GroupSettingHistoryUpdateOne) Select(field string, fields ...string) *GroupSettingHistoryUpdateOne { + gshuo.fields = append([]string{field}, fields...) + return gshuo +} + +// Save executes the query and returns the updated GroupSettingHistory entity. +func (gshuo *GroupSettingHistoryUpdateOne) Save(ctx context.Context) (*GroupSettingHistory, error) { + if err := gshuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, gshuo.sqlSave, gshuo.mutation, gshuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (gshuo *GroupSettingHistoryUpdateOne) SaveX(ctx context.Context) *GroupSettingHistory { + node, err := gshuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (gshuo *GroupSettingHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := gshuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (gshuo *GroupSettingHistoryUpdateOne) ExecX(ctx context.Context) { + if err := gshuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (gshuo *GroupSettingHistoryUpdateOne) defaults() error { + if _, ok := gshuo.mutation.UpdatedAt(); !ok && !gshuo.mutation.UpdatedAtCleared() { + if groupsettinghistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized groupsettinghistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := groupsettinghistory.UpdateDefaultUpdatedAt() + gshuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (gshuo *GroupSettingHistoryUpdateOne) check() error { + if v, ok := gshuo.mutation.Visibility(); ok { + if err := groupsettinghistory.VisibilityValidator(v); err != nil { + return &ValidationError{Name: "visibility", err: fmt.Errorf(`generated: validator failed for field "GroupSettingHistory.visibility": %w`, err)} + } + } + if v, ok := gshuo.mutation.JoinPolicy(); ok { + if err := groupsettinghistory.JoinPolicyValidator(v); err != nil { + return &ValidationError{Name: "join_policy", err: fmt.Errorf(`generated: validator failed for field "GroupSettingHistory.join_policy": %w`, err)} + } + } + return nil +} + +func (gshuo *GroupSettingHistoryUpdateOne) sqlSave(ctx context.Context) (_node *GroupSettingHistory, err error) { + if err := gshuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(groupsettinghistory.Table, groupsettinghistory.Columns, sqlgraph.NewFieldSpec(groupsettinghistory.FieldID, field.TypeString)) + id, ok := gshuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "GroupSettingHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := gshuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, groupsettinghistory.FieldID) + for _, f := range fields { + if !groupsettinghistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != groupsettinghistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := gshuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if gshuo.mutation.RefCleared() { + _spec.ClearField(groupsettinghistory.FieldRef, field.TypeString) + } + if gshuo.mutation.CreatedAtCleared() { + _spec.ClearField(groupsettinghistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := gshuo.mutation.UpdatedAt(); ok { + _spec.SetField(groupsettinghistory.FieldUpdatedAt, field.TypeTime, value) + } + if gshuo.mutation.UpdatedAtCleared() { + _spec.ClearField(groupsettinghistory.FieldUpdatedAt, field.TypeTime) + } + if gshuo.mutation.CreatedByCleared() { + _spec.ClearField(groupsettinghistory.FieldCreatedBy, field.TypeString) + } + if value, ok := gshuo.mutation.UpdatedBy(); ok { + _spec.SetField(groupsettinghistory.FieldUpdatedBy, field.TypeString, value) + } + if gshuo.mutation.UpdatedByCleared() { + _spec.ClearField(groupsettinghistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := gshuo.mutation.Tags(); ok { + _spec.SetField(groupsettinghistory.FieldTags, field.TypeJSON, value) + } + if value, ok := gshuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, groupsettinghistory.FieldTags, value) + }) + } + if gshuo.mutation.TagsCleared() { + _spec.ClearField(groupsettinghistory.FieldTags, field.TypeJSON) + } + if value, ok := gshuo.mutation.DeletedAt(); ok { + _spec.SetField(groupsettinghistory.FieldDeletedAt, field.TypeTime, value) + } + if gshuo.mutation.DeletedAtCleared() { + _spec.ClearField(groupsettinghistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := gshuo.mutation.DeletedBy(); ok { + _spec.SetField(groupsettinghistory.FieldDeletedBy, field.TypeString, value) + } + if gshuo.mutation.DeletedByCleared() { + _spec.ClearField(groupsettinghistory.FieldDeletedBy, field.TypeString) + } + if value, ok := gshuo.mutation.Visibility(); ok { + _spec.SetField(groupsettinghistory.FieldVisibility, field.TypeEnum, value) + } + if value, ok := gshuo.mutation.JoinPolicy(); ok { + _spec.SetField(groupsettinghistory.FieldJoinPolicy, field.TypeEnum, value) + } + if value, ok := gshuo.mutation.SyncToSlack(); ok { + _spec.SetField(groupsettinghistory.FieldSyncToSlack, field.TypeBool, value) + } + if gshuo.mutation.SyncToSlackCleared() { + _spec.ClearField(groupsettinghistory.FieldSyncToSlack, field.TypeBool) + } + if value, ok := gshuo.mutation.SyncToGithub(); ok { + _spec.SetField(groupsettinghistory.FieldSyncToGithub, field.TypeBool, value) + } + if gshuo.mutation.SyncToGithubCleared() { + _spec.ClearField(groupsettinghistory.FieldSyncToGithub, field.TypeBool) + } + if value, ok := gshuo.mutation.GroupID(); ok { + _spec.SetField(groupsettinghistory.FieldGroupID, field.TypeString, value) + } + if gshuo.mutation.GroupIDCleared() { + _spec.ClearField(groupsettinghistory.FieldGroupID, field.TypeString) + } + _spec.Node.Schema = gshuo.schemaConfig.GroupSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, gshuo.schemaConfig) + _node = &GroupSettingHistory{config: gshuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, gshuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{groupsettinghistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + gshuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/history_client.go b/internal/ent/generated/history_client.go new file mode 100644 index 0000000..4aafe05 --- /dev/null +++ b/internal/ent/generated/history_client.go @@ -0,0 +1,83 @@ +// Code generated by entx.history, DO NOT EDIT. + +// Code generated by ent, DO NOT EDIT. + +package generated + +import "github.com/theopenlane/entx/history" + +// withHistory adds the history hooks to the appropriate schemas - generated by entx.history +func (c *Client) WithHistory() { + for _, hook := range history.HistoryHooks[*ContactMutation]() { + c.Contact.Use(hook) + } + for _, hook := range history.HistoryHooks[*DocumentDataMutation]() { + c.DocumentData.Use(hook) + } + for _, hook := range history.HistoryHooks[*EntitlementMutation]() { + c.Entitlement.Use(hook) + } + for _, hook := range history.HistoryHooks[*EntitlementPlanMutation]() { + c.EntitlementPlan.Use(hook) + } + for _, hook := range history.HistoryHooks[*EntitlementPlanFeatureMutation]() { + c.EntitlementPlanFeature.Use(hook) + } + for _, hook := range history.HistoryHooks[*EntityMutation]() { + c.Entity.Use(hook) + } + for _, hook := range history.HistoryHooks[*EntityTypeMutation]() { + c.EntityType.Use(hook) + } + for _, hook := range history.HistoryHooks[*EventMutation]() { + c.Event.Use(hook) + } + for _, hook := range history.HistoryHooks[*FeatureMutation]() { + c.Feature.Use(hook) + } + for _, hook := range history.HistoryHooks[*FileMutation]() { + c.File.Use(hook) + } + for _, hook := range history.HistoryHooks[*GroupMutation]() { + c.Group.Use(hook) + } + for _, hook := range history.HistoryHooks[*GroupMembershipMutation]() { + c.GroupMembership.Use(hook) + } + for _, hook := range history.HistoryHooks[*GroupSettingMutation]() { + c.GroupSetting.Use(hook) + } + for _, hook := range history.HistoryHooks[*HushMutation]() { + c.Hush.Use(hook) + } + for _, hook := range history.HistoryHooks[*IntegrationMutation]() { + c.Integration.Use(hook) + } + for _, hook := range history.HistoryHooks[*NoteMutation]() { + c.Note.Use(hook) + } + for _, hook := range history.HistoryHooks[*OauthProviderMutation]() { + c.OauthProvider.Use(hook) + } + for _, hook := range history.HistoryHooks[*OrgMembershipMutation]() { + c.OrgMembership.Use(hook) + } + for _, hook := range history.HistoryHooks[*OrganizationMutation]() { + c.Organization.Use(hook) + } + for _, hook := range history.HistoryHooks[*OrganizationSettingMutation]() { + c.OrganizationSetting.Use(hook) + } + for _, hook := range history.HistoryHooks[*TemplateMutation]() { + c.Template.Use(hook) + } + for _, hook := range history.HistoryHooks[*UserMutation]() { + c.User.Use(hook) + } + for _, hook := range history.HistoryHooks[*UserSettingMutation]() { + c.UserSetting.Use(hook) + } + for _, hook := range history.HistoryHooks[*WebhookMutation]() { + c.Webhook.Use(hook) + } +} diff --git a/internal/ent/generated/history_from_mutation.go b/internal/ent/generated/history_from_mutation.go new file mode 100644 index 0000000..4e25e80 --- /dev/null +++ b/internal/ent/generated/history_from_mutation.go @@ -0,0 +1,5758 @@ +// Code generated by entx.history, DO NOT EDIT. + +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" +) + +var ( + idNotFoundError = errors.New("could not get id from mutation") +) + +func EntOpToHistoryOp(op ent.Op) history.OpType { + switch op { + case ent.OpDelete, ent.OpDeleteOne: + return history.OpTypeDelete + case ent.OpUpdate, ent.OpUpdateOne: + return history.OpTypeUpdate + default: + return history.OpTypeInsert + } +} + +func (m *ContactMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.ContactHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if fullName, exists := m.FullName(); exists { + create = create.SetFullName(fullName) + } + + if title, exists := m.Title(); exists { + create = create.SetTitle(title) + } + + if company, exists := m.Company(); exists { + create = create.SetCompany(company) + } + + if email, exists := m.Email(); exists { + create = create.SetEmail(email) + } + + if phoneNumber, exists := m.PhoneNumber(); exists { + create = create.SetPhoneNumber(phoneNumber) + } + + if address, exists := m.Address(); exists { + create = create.SetAddress(address) + } + + if status, exists := m.Status(); exists { + create = create.SetStatus(status) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *ContactMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + contact, err := client.Contact.Get(ctx, id) + if err != nil { + return err + } + + create := client.ContactHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(contact.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(contact.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(contact.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(contact.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(contact.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(contact.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(contact.DeletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(contact.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(contact.OwnerID) + } + + if fullName, exists := m.FullName(); exists { + create = create.SetFullName(fullName) + } else { + create = create.SetFullName(contact.FullName) + } + + if title, exists := m.Title(); exists { + create = create.SetTitle(title) + } else { + create = create.SetTitle(contact.Title) + } + + if company, exists := m.Company(); exists { + create = create.SetCompany(company) + } else { + create = create.SetCompany(contact.Company) + } + + if email, exists := m.Email(); exists { + create = create.SetEmail(email) + } else { + create = create.SetEmail(contact.Email) + } + + if phoneNumber, exists := m.PhoneNumber(); exists { + create = create.SetPhoneNumber(phoneNumber) + } else { + create = create.SetPhoneNumber(contact.PhoneNumber) + } + + if address, exists := m.Address(); exists { + create = create.SetAddress(address) + } else { + create = create.SetAddress(contact.Address) + } + + if status, exists := m.Status(); exists { + create = create.SetStatus(status) + } else { + create = create.SetStatus(contact.Status) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *ContactMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + contact, err := client.Contact.Get(ctx, id) + if err != nil { + return err + } + + create := client.ContactHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(contact.CreatedAt). + SetUpdatedAt(contact.UpdatedAt). + SetCreatedBy(contact.CreatedBy). + SetUpdatedBy(contact.UpdatedBy). + SetMappingID(contact.MappingID). + SetDeletedAt(contact.DeletedAt). + SetDeletedBy(contact.DeletedBy). + SetTags(contact.Tags). + SetOwnerID(contact.OwnerID). + SetFullName(contact.FullName). + SetTitle(contact.Title). + SetCompany(contact.Company). + SetEmail(contact.Email). + SetPhoneNumber(contact.PhoneNumber). + SetAddress(contact.Address). + SetStatus(contact.Status). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *DocumentDataMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.DocumentDataHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if templateID, exists := m.TemplateID(); exists { + create = create.SetTemplateID(templateID) + } + + if data, exists := m.Data(); exists { + create = create.SetData(data) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *DocumentDataMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + documentdata, err := client.DocumentData.Get(ctx, id) + if err != nil { + return err + } + + create := client.DocumentDataHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(documentdata.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(documentdata.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(documentdata.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(documentdata.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(documentdata.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(documentdata.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(documentdata.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(documentdata.DeletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(documentdata.OwnerID) + } + + if templateID, exists := m.TemplateID(); exists { + create = create.SetTemplateID(templateID) + } else { + create = create.SetTemplateID(documentdata.TemplateID) + } + + if data, exists := m.Data(); exists { + create = create.SetData(data) + } else { + create = create.SetData(documentdata.Data) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *DocumentDataMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + documentdata, err := client.DocumentData.Get(ctx, id) + if err != nil { + return err + } + + create := client.DocumentDataHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(documentdata.CreatedAt). + SetUpdatedAt(documentdata.UpdatedAt). + SetCreatedBy(documentdata.CreatedBy). + SetUpdatedBy(documentdata.UpdatedBy). + SetMappingID(documentdata.MappingID). + SetTags(documentdata.Tags). + SetDeletedAt(documentdata.DeletedAt). + SetDeletedBy(documentdata.DeletedBy). + SetOwnerID(documentdata.OwnerID). + SetTemplateID(documentdata.TemplateID). + SetData(documentdata.Data). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *EntitlementMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.EntitlementHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if planID, exists := m.PlanID(); exists { + create = create.SetPlanID(planID) + } + + if organizationID, exists := m.OrganizationID(); exists { + create = create.SetOrganizationID(organizationID) + } + + if externalCustomerID, exists := m.ExternalCustomerID(); exists { + create = create.SetExternalCustomerID(externalCustomerID) + } + + if externalSubscriptionID, exists := m.ExternalSubscriptionID(); exists { + create = create.SetExternalSubscriptionID(externalSubscriptionID) + } + + if expires, exists := m.Expires(); exists { + create = create.SetExpires(expires) + } + + if expiresAt, exists := m.ExpiresAt(); exists { + create = create.SetNillableExpiresAt(&expiresAt) + } + + if cancelled, exists := m.Cancelled(); exists { + create = create.SetCancelled(cancelled) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *EntitlementMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitlement, err := client.Entitlement.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntitlementHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(entitlement.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(entitlement.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(entitlement.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(entitlement.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(entitlement.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(entitlement.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(entitlement.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(entitlement.DeletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(entitlement.OwnerID) + } + + if planID, exists := m.PlanID(); exists { + create = create.SetPlanID(planID) + } else { + create = create.SetPlanID(entitlement.PlanID) + } + + if organizationID, exists := m.OrganizationID(); exists { + create = create.SetOrganizationID(organizationID) + } else { + create = create.SetOrganizationID(entitlement.OrganizationID) + } + + if externalCustomerID, exists := m.ExternalCustomerID(); exists { + create = create.SetExternalCustomerID(externalCustomerID) + } else { + create = create.SetExternalCustomerID(entitlement.ExternalCustomerID) + } + + if externalSubscriptionID, exists := m.ExternalSubscriptionID(); exists { + create = create.SetExternalSubscriptionID(externalSubscriptionID) + } else { + create = create.SetExternalSubscriptionID(entitlement.ExternalSubscriptionID) + } + + if expires, exists := m.Expires(); exists { + create = create.SetExpires(expires) + } else { + create = create.SetExpires(entitlement.Expires) + } + + if expiresAt, exists := m.ExpiresAt(); exists { + create = create.SetNillableExpiresAt(&expiresAt) + } else { + create = create.SetNillableExpiresAt(entitlement.ExpiresAt) + } + + if cancelled, exists := m.Cancelled(); exists { + create = create.SetCancelled(cancelled) + } else { + create = create.SetCancelled(entitlement.Cancelled) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *EntitlementMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitlement, err := client.Entitlement.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntitlementHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(entitlement.CreatedAt). + SetUpdatedAt(entitlement.UpdatedAt). + SetCreatedBy(entitlement.CreatedBy). + SetUpdatedBy(entitlement.UpdatedBy). + SetMappingID(entitlement.MappingID). + SetTags(entitlement.Tags). + SetDeletedAt(entitlement.DeletedAt). + SetDeletedBy(entitlement.DeletedBy). + SetOwnerID(entitlement.OwnerID). + SetPlanID(entitlement.PlanID). + SetOrganizationID(entitlement.OrganizationID). + SetExternalCustomerID(entitlement.ExternalCustomerID). + SetExternalSubscriptionID(entitlement.ExternalSubscriptionID). + SetExpires(entitlement.Expires). + SetNillableExpiresAt(entitlement.ExpiresAt). + SetCancelled(entitlement.Cancelled). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *EntitlementPlanMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.EntitlementPlanHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if version, exists := m.Version(); exists { + create = create.SetVersion(version) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *EntitlementPlanMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitlementplan, err := client.EntitlementPlan.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntitlementPlanHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(entitlementplan.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(entitlementplan.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(entitlementplan.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(entitlementplan.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(entitlementplan.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(entitlementplan.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(entitlementplan.DeletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(entitlementplan.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(entitlementplan.OwnerID) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } else { + create = create.SetDisplayName(entitlementplan.DisplayName) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(entitlementplan.Name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(entitlementplan.Description) + } + + if version, exists := m.Version(); exists { + create = create.SetVersion(version) + } else { + create = create.SetVersion(entitlementplan.Version) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } else { + create = create.SetMetadata(entitlementplan.Metadata) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *EntitlementPlanMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitlementplan, err := client.EntitlementPlan.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntitlementPlanHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(entitlementplan.CreatedAt). + SetUpdatedAt(entitlementplan.UpdatedAt). + SetCreatedBy(entitlementplan.CreatedBy). + SetUpdatedBy(entitlementplan.UpdatedBy). + SetMappingID(entitlementplan.MappingID). + SetDeletedAt(entitlementplan.DeletedAt). + SetDeletedBy(entitlementplan.DeletedBy). + SetTags(entitlementplan.Tags). + SetOwnerID(entitlementplan.OwnerID). + SetDisplayName(entitlementplan.DisplayName). + SetName(entitlementplan.Name). + SetDescription(entitlementplan.Description). + SetVersion(entitlementplan.Version). + SetMetadata(entitlementplan.Metadata). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *EntitlementPlanFeatureMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.EntitlementPlanFeatureHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } + + if planID, exists := m.PlanID(); exists { + create = create.SetPlanID(planID) + } + + if featureID, exists := m.FeatureID(); exists { + create = create.SetFeatureID(featureID) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *EntitlementPlanFeatureMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitlementplanfeature, err := client.EntitlementPlanFeature.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntitlementPlanFeatureHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(entitlementplanfeature.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(entitlementplanfeature.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(entitlementplanfeature.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(entitlementplanfeature.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(entitlementplanfeature.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(entitlementplanfeature.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(entitlementplanfeature.DeletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(entitlementplanfeature.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(entitlementplanfeature.OwnerID) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } else { + create = create.SetMetadata(entitlementplanfeature.Metadata) + } + + if planID, exists := m.PlanID(); exists { + create = create.SetPlanID(planID) + } else { + create = create.SetPlanID(entitlementplanfeature.PlanID) + } + + if featureID, exists := m.FeatureID(); exists { + create = create.SetFeatureID(featureID) + } else { + create = create.SetFeatureID(entitlementplanfeature.FeatureID) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *EntitlementPlanFeatureMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitlementplanfeature, err := client.EntitlementPlanFeature.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntitlementPlanFeatureHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(entitlementplanfeature.CreatedAt). + SetUpdatedAt(entitlementplanfeature.UpdatedAt). + SetCreatedBy(entitlementplanfeature.CreatedBy). + SetUpdatedBy(entitlementplanfeature.UpdatedBy). + SetMappingID(entitlementplanfeature.MappingID). + SetDeletedAt(entitlementplanfeature.DeletedAt). + SetDeletedBy(entitlementplanfeature.DeletedBy). + SetTags(entitlementplanfeature.Tags). + SetOwnerID(entitlementplanfeature.OwnerID). + SetMetadata(entitlementplanfeature.Metadata). + SetPlanID(entitlementplanfeature.PlanID). + SetFeatureID(entitlementplanfeature.FeatureID). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *EntityMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.EntityHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if domains, exists := m.Domains(); exists { + create = create.SetDomains(domains) + } + + if entityTypeID, exists := m.EntityTypeID(); exists { + create = create.SetEntityTypeID(entityTypeID) + } + + if status, exists := m.Status(); exists { + create = create.SetStatus(status) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *EntityMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entity, err := client.Entity.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntityHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(entity.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(entity.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(entity.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(entity.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(entity.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(entity.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(entity.DeletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(entity.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(entity.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(entity.Name) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } else { + create = create.SetDisplayName(entity.DisplayName) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(entity.Description) + } + + if domains, exists := m.Domains(); exists { + create = create.SetDomains(domains) + } else { + create = create.SetDomains(entity.Domains) + } + + if entityTypeID, exists := m.EntityTypeID(); exists { + create = create.SetEntityTypeID(entityTypeID) + } else { + create = create.SetEntityTypeID(entity.EntityTypeID) + } + + if status, exists := m.Status(); exists { + create = create.SetStatus(status) + } else { + create = create.SetStatus(entity.Status) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *EntityMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entity, err := client.Entity.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntityHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(entity.CreatedAt). + SetUpdatedAt(entity.UpdatedAt). + SetCreatedBy(entity.CreatedBy). + SetUpdatedBy(entity.UpdatedBy). + SetMappingID(entity.MappingID). + SetDeletedAt(entity.DeletedAt). + SetDeletedBy(entity.DeletedBy). + SetTags(entity.Tags). + SetOwnerID(entity.OwnerID). + SetName(entity.Name). + SetDisplayName(entity.DisplayName). + SetDescription(entity.Description). + SetDomains(entity.Domains). + SetEntityTypeID(entity.EntityTypeID). + SetStatus(entity.Status). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *EntityTypeMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.EntityTypeHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *EntityTypeMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitytype, err := client.EntityType.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntityTypeHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(entitytype.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(entitytype.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(entitytype.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(entitytype.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(entitytype.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(entitytype.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(entitytype.DeletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(entitytype.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(entitytype.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(entitytype.Name) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *EntityTypeMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + entitytype, err := client.EntityType.Get(ctx, id) + if err != nil { + return err + } + + create := client.EntityTypeHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(entitytype.CreatedAt). + SetUpdatedAt(entitytype.UpdatedAt). + SetCreatedBy(entitytype.CreatedBy). + SetUpdatedBy(entitytype.UpdatedBy). + SetMappingID(entitytype.MappingID). + SetDeletedAt(entitytype.DeletedAt). + SetDeletedBy(entitytype.DeletedBy). + SetTags(entitytype.Tags). + SetOwnerID(entitytype.OwnerID). + SetName(entitytype.Name). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *EventMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.EventHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if eventID, exists := m.EventID(); exists { + create = create.SetEventID(eventID) + } + + if correlationID, exists := m.CorrelationID(); exists { + create = create.SetCorrelationID(correlationID) + } + + if eventType, exists := m.EventType(); exists { + create = create.SetEventType(eventType) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *EventMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + event, err := client.Event.Get(ctx, id) + if err != nil { + return err + } + + create := client.EventHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(event.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(event.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(event.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(event.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(event.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(event.Tags) + } + + if eventID, exists := m.EventID(); exists { + create = create.SetEventID(eventID) + } else { + create = create.SetEventID(event.EventID) + } + + if correlationID, exists := m.CorrelationID(); exists { + create = create.SetCorrelationID(correlationID) + } else { + create = create.SetCorrelationID(event.CorrelationID) + } + + if eventType, exists := m.EventType(); exists { + create = create.SetEventType(eventType) + } else { + create = create.SetEventType(event.EventType) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } else { + create = create.SetMetadata(event.Metadata) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *EventMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + event, err := client.Event.Get(ctx, id) + if err != nil { + return err + } + + create := client.EventHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(event.CreatedAt). + SetUpdatedAt(event.UpdatedAt). + SetCreatedBy(event.CreatedBy). + SetUpdatedBy(event.UpdatedBy). + SetMappingID(event.MappingID). + SetTags(event.Tags). + SetEventID(event.EventID). + SetCorrelationID(event.CorrelationID). + SetEventType(event.EventType). + SetMetadata(event.Metadata). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *FeatureMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.FeatureHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } + + if enabled, exists := m.Enabled(); exists { + create = create.SetEnabled(enabled) + } + + if description, exists := m.Description(); exists { + create = create.SetNillableDescription(&description) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *FeatureMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + feature, err := client.Feature.Get(ctx, id) + if err != nil { + return err + } + + create := client.FeatureHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(feature.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(feature.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(feature.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(feature.UpdatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(feature.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(feature.DeletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(feature.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(feature.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(feature.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(feature.Name) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } else { + create = create.SetDisplayName(feature.DisplayName) + } + + if enabled, exists := m.Enabled(); exists { + create = create.SetEnabled(enabled) + } else { + create = create.SetEnabled(feature.Enabled) + } + + if description, exists := m.Description(); exists { + create = create.SetNillableDescription(&description) + } else { + create = create.SetNillableDescription(feature.Description) + } + + if metadata, exists := m.Metadata(); exists { + create = create.SetMetadata(metadata) + } else { + create = create.SetMetadata(feature.Metadata) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *FeatureMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + feature, err := client.Feature.Get(ctx, id) + if err != nil { + return err + } + + create := client.FeatureHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(feature.CreatedAt). + SetUpdatedAt(feature.UpdatedAt). + SetCreatedBy(feature.CreatedBy). + SetUpdatedBy(feature.UpdatedBy). + SetDeletedAt(feature.DeletedAt). + SetDeletedBy(feature.DeletedBy). + SetMappingID(feature.MappingID). + SetTags(feature.Tags). + SetOwnerID(feature.OwnerID). + SetName(feature.Name). + SetDisplayName(feature.DisplayName). + SetEnabled(feature.Enabled). + SetNillableDescription(feature.Description). + SetMetadata(feature.Metadata). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *FileMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.FileHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if fileName, exists := m.FileName(); exists { + create = create.SetFileName(fileName) + } + + if fileExtension, exists := m.FileExtension(); exists { + create = create.SetFileExtension(fileExtension) + } + + if fileSize, exists := m.FileSize(); exists { + create = create.SetFileSize(fileSize) + } + + if contentType, exists := m.ContentType(); exists { + create = create.SetContentType(contentType) + } + + if storeKey, exists := m.StoreKey(); exists { + create = create.SetStoreKey(storeKey) + } + + if category, exists := m.Category(); exists { + create = create.SetCategory(category) + } + + if annotation, exists := m.Annotation(); exists { + create = create.SetAnnotation(annotation) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *FileMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + file, err := client.File.Get(ctx, id) + if err != nil { + return err + } + + create := client.FileHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(file.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(file.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(file.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(file.UpdatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(file.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(file.DeletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(file.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(file.Tags) + } + + if fileName, exists := m.FileName(); exists { + create = create.SetFileName(fileName) + } else { + create = create.SetFileName(file.FileName) + } + + if fileExtension, exists := m.FileExtension(); exists { + create = create.SetFileExtension(fileExtension) + } else { + create = create.SetFileExtension(file.FileExtension) + } + + if fileSize, exists := m.FileSize(); exists { + create = create.SetFileSize(fileSize) + } else { + create = create.SetFileSize(file.FileSize) + } + + if contentType, exists := m.ContentType(); exists { + create = create.SetContentType(contentType) + } else { + create = create.SetContentType(file.ContentType) + } + + if storeKey, exists := m.StoreKey(); exists { + create = create.SetStoreKey(storeKey) + } else { + create = create.SetStoreKey(file.StoreKey) + } + + if category, exists := m.Category(); exists { + create = create.SetCategory(category) + } else { + create = create.SetCategory(file.Category) + } + + if annotation, exists := m.Annotation(); exists { + create = create.SetAnnotation(annotation) + } else { + create = create.SetAnnotation(file.Annotation) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *FileMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + file, err := client.File.Get(ctx, id) + if err != nil { + return err + } + + create := client.FileHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(file.CreatedAt). + SetUpdatedAt(file.UpdatedAt). + SetCreatedBy(file.CreatedBy). + SetUpdatedBy(file.UpdatedBy). + SetDeletedAt(file.DeletedAt). + SetDeletedBy(file.DeletedBy). + SetMappingID(file.MappingID). + SetTags(file.Tags). + SetFileName(file.FileName). + SetFileExtension(file.FileExtension). + SetFileSize(file.FileSize). + SetContentType(file.ContentType). + SetStoreKey(file.StoreKey). + SetCategory(file.Category). + SetAnnotation(file.Annotation). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *GroupMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.GroupHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if gravatarLogoURL, exists := m.GravatarLogoURL(); exists { + create = create.SetGravatarLogoURL(gravatarLogoURL) + } + + if logoURL, exists := m.LogoURL(); exists { + create = create.SetLogoURL(logoURL) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *GroupMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + group, err := client.Group.Get(ctx, id) + if err != nil { + return err + } + + create := client.GroupHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(group.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(group.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(group.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(group.UpdatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(group.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(group.DeletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(group.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(group.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(group.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(group.Name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(group.Description) + } + + if gravatarLogoURL, exists := m.GravatarLogoURL(); exists { + create = create.SetGravatarLogoURL(gravatarLogoURL) + } else { + create = create.SetGravatarLogoURL(group.GravatarLogoURL) + } + + if logoURL, exists := m.LogoURL(); exists { + create = create.SetLogoURL(logoURL) + } else { + create = create.SetLogoURL(group.LogoURL) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } else { + create = create.SetDisplayName(group.DisplayName) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *GroupMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + group, err := client.Group.Get(ctx, id) + if err != nil { + return err + } + + create := client.GroupHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(group.CreatedAt). + SetUpdatedAt(group.UpdatedAt). + SetCreatedBy(group.CreatedBy). + SetUpdatedBy(group.UpdatedBy). + SetDeletedAt(group.DeletedAt). + SetDeletedBy(group.DeletedBy). + SetMappingID(group.MappingID). + SetTags(group.Tags). + SetOwnerID(group.OwnerID). + SetName(group.Name). + SetDescription(group.Description). + SetGravatarLogoURL(group.GravatarLogoURL). + SetLogoURL(group.LogoURL). + SetDisplayName(group.DisplayName). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *GroupMembershipMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.GroupMembershipHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if role, exists := m.Role(); exists { + create = create.SetRole(role) + } + + if groupID, exists := m.GroupID(); exists { + create = create.SetGroupID(groupID) + } + + if userID, exists := m.UserID(); exists { + create = create.SetUserID(userID) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *GroupMembershipMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + groupmembership, err := client.GroupMembership.Get(ctx, id) + if err != nil { + return err + } + + create := client.GroupMembershipHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(groupmembership.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(groupmembership.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(groupmembership.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(groupmembership.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(groupmembership.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(groupmembership.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(groupmembership.DeletedBy) + } + + if role, exists := m.Role(); exists { + create = create.SetRole(role) + } else { + create = create.SetRole(groupmembership.Role) + } + + if groupID, exists := m.GroupID(); exists { + create = create.SetGroupID(groupID) + } else { + create = create.SetGroupID(groupmembership.GroupID) + } + + if userID, exists := m.UserID(); exists { + create = create.SetUserID(userID) + } else { + create = create.SetUserID(groupmembership.UserID) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *GroupMembershipMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + groupmembership, err := client.GroupMembership.Get(ctx, id) + if err != nil { + return err + } + + create := client.GroupMembershipHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(groupmembership.CreatedAt). + SetUpdatedAt(groupmembership.UpdatedAt). + SetCreatedBy(groupmembership.CreatedBy). + SetUpdatedBy(groupmembership.UpdatedBy). + SetMappingID(groupmembership.MappingID). + SetDeletedAt(groupmembership.DeletedAt). + SetDeletedBy(groupmembership.DeletedBy). + SetRole(groupmembership.Role). + SetGroupID(groupmembership.GroupID). + SetUserID(groupmembership.UserID). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *GroupSettingMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.GroupSettingHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if visibility, exists := m.Visibility(); exists { + create = create.SetVisibility(visibility) + } + + if joinPolicy, exists := m.JoinPolicy(); exists { + create = create.SetJoinPolicy(joinPolicy) + } + + if syncToSlack, exists := m.SyncToSlack(); exists { + create = create.SetSyncToSlack(syncToSlack) + } + + if syncToGithub, exists := m.SyncToGithub(); exists { + create = create.SetSyncToGithub(syncToGithub) + } + + if groupID, exists := m.GroupID(); exists { + create = create.SetGroupID(groupID) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *GroupSettingMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + groupsetting, err := client.GroupSetting.Get(ctx, id) + if err != nil { + return err + } + + create := client.GroupSettingHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(groupsetting.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(groupsetting.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(groupsetting.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(groupsetting.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(groupsetting.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(groupsetting.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(groupsetting.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(groupsetting.DeletedBy) + } + + if visibility, exists := m.Visibility(); exists { + create = create.SetVisibility(visibility) + } else { + create = create.SetVisibility(groupsetting.Visibility) + } + + if joinPolicy, exists := m.JoinPolicy(); exists { + create = create.SetJoinPolicy(joinPolicy) + } else { + create = create.SetJoinPolicy(groupsetting.JoinPolicy) + } + + if syncToSlack, exists := m.SyncToSlack(); exists { + create = create.SetSyncToSlack(syncToSlack) + } else { + create = create.SetSyncToSlack(groupsetting.SyncToSlack) + } + + if syncToGithub, exists := m.SyncToGithub(); exists { + create = create.SetSyncToGithub(syncToGithub) + } else { + create = create.SetSyncToGithub(groupsetting.SyncToGithub) + } + + if groupID, exists := m.GroupID(); exists { + create = create.SetGroupID(groupID) + } else { + create = create.SetGroupID(groupsetting.GroupID) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *GroupSettingMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + groupsetting, err := client.GroupSetting.Get(ctx, id) + if err != nil { + return err + } + + create := client.GroupSettingHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(groupsetting.CreatedAt). + SetUpdatedAt(groupsetting.UpdatedAt). + SetCreatedBy(groupsetting.CreatedBy). + SetUpdatedBy(groupsetting.UpdatedBy). + SetMappingID(groupsetting.MappingID). + SetTags(groupsetting.Tags). + SetDeletedAt(groupsetting.DeletedAt). + SetDeletedBy(groupsetting.DeletedBy). + SetVisibility(groupsetting.Visibility). + SetJoinPolicy(groupsetting.JoinPolicy). + SetSyncToSlack(groupsetting.SyncToSlack). + SetSyncToGithub(groupsetting.SyncToGithub). + SetGroupID(groupsetting.GroupID). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *HushMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.HushHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if kind, exists := m.Kind(); exists { + create = create.SetKind(kind) + } + + if secretName, exists := m.SecretName(); exists { + create = create.SetSecretName(secretName) + } + + if secretValue, exists := m.SecretValue(); exists { + create = create.SetSecretValue(secretValue) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *HushMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + hush, err := client.Hush.Get(ctx, id) + if err != nil { + return err + } + + create := client.HushHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(hush.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(hush.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(hush.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(hush.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(hush.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(hush.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(hush.DeletedBy) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(hush.Name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(hush.Description) + } + + if kind, exists := m.Kind(); exists { + create = create.SetKind(kind) + } else { + create = create.SetKind(hush.Kind) + } + + if secretName, exists := m.SecretName(); exists { + create = create.SetSecretName(secretName) + } else { + create = create.SetSecretName(hush.SecretName) + } + + if secretValue, exists := m.SecretValue(); exists { + create = create.SetSecretValue(secretValue) + } else { + create = create.SetSecretValue(hush.SecretValue) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *HushMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + hush, err := client.Hush.Get(ctx, id) + if err != nil { + return err + } + + create := client.HushHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(hush.CreatedAt). + SetUpdatedAt(hush.UpdatedAt). + SetCreatedBy(hush.CreatedBy). + SetUpdatedBy(hush.UpdatedBy). + SetMappingID(hush.MappingID). + SetDeletedAt(hush.DeletedAt). + SetDeletedBy(hush.DeletedBy). + SetName(hush.Name). + SetDescription(hush.Description). + SetKind(hush.Kind). + SetSecretName(hush.SecretName). + SetSecretValue(hush.SecretValue). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *IntegrationMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.IntegrationHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if kind, exists := m.Kind(); exists { + create = create.SetKind(kind) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *IntegrationMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + integration, err := client.Integration.Get(ctx, id) + if err != nil { + return err + } + + create := client.IntegrationHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(integration.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(integration.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(integration.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(integration.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(integration.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(integration.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(integration.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(integration.DeletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(integration.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(integration.Name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(integration.Description) + } + + if kind, exists := m.Kind(); exists { + create = create.SetKind(kind) + } else { + create = create.SetKind(integration.Kind) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *IntegrationMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + integration, err := client.Integration.Get(ctx, id) + if err != nil { + return err + } + + create := client.IntegrationHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(integration.CreatedAt). + SetUpdatedAt(integration.UpdatedAt). + SetCreatedBy(integration.CreatedBy). + SetUpdatedBy(integration.UpdatedBy). + SetMappingID(integration.MappingID). + SetTags(integration.Tags). + SetDeletedAt(integration.DeletedAt). + SetDeletedBy(integration.DeletedBy). + SetOwnerID(integration.OwnerID). + SetName(integration.Name). + SetDescription(integration.Description). + SetKind(integration.Kind). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *NoteMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.NoteHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if text, exists := m.Text(); exists { + create = create.SetText(text) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *NoteMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + note, err := client.Note.Get(ctx, id) + if err != nil { + return err + } + + create := client.NoteHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(note.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(note.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(note.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(note.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(note.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(note.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(note.DeletedBy) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(note.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(note.OwnerID) + } + + if text, exists := m.Text(); exists { + create = create.SetText(text) + } else { + create = create.SetText(note.Text) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *NoteMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + note, err := client.Note.Get(ctx, id) + if err != nil { + return err + } + + create := client.NoteHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(note.CreatedAt). + SetUpdatedAt(note.UpdatedAt). + SetCreatedBy(note.CreatedBy). + SetUpdatedBy(note.UpdatedBy). + SetMappingID(note.MappingID). + SetDeletedAt(note.DeletedAt). + SetDeletedBy(note.DeletedBy). + SetTags(note.Tags). + SetOwnerID(note.OwnerID). + SetText(note.Text). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *OauthProviderMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.OauthProviderHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if clientID, exists := m.ClientID(); exists { + create = create.SetClientID(clientID) + } + + if clientSecret, exists := m.ClientSecret(); exists { + create = create.SetClientSecret(clientSecret) + } + + if redirectURL, exists := m.RedirectURL(); exists { + create = create.SetRedirectURL(redirectURL) + } + + if scopes, exists := m.Scopes(); exists { + create = create.SetScopes(scopes) + } + + if authURL, exists := m.AuthURL(); exists { + create = create.SetAuthURL(authURL) + } + + if tokenURL, exists := m.TokenURL(); exists { + create = create.SetTokenURL(tokenURL) + } + + if authStyle, exists := m.AuthStyle(); exists { + create = create.SetAuthStyle(authStyle) + } + + if infoURL, exists := m.InfoURL(); exists { + create = create.SetInfoURL(infoURL) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *OauthProviderMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + oauthprovider, err := client.OauthProvider.Get(ctx, id) + if err != nil { + return err + } + + create := client.OauthProviderHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(oauthprovider.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(oauthprovider.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(oauthprovider.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(oauthprovider.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(oauthprovider.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(oauthprovider.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(oauthprovider.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(oauthprovider.DeletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(oauthprovider.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(oauthprovider.Name) + } + + if clientID, exists := m.ClientID(); exists { + create = create.SetClientID(clientID) + } else { + create = create.SetClientID(oauthprovider.ClientID) + } + + if clientSecret, exists := m.ClientSecret(); exists { + create = create.SetClientSecret(clientSecret) + } else { + create = create.SetClientSecret(oauthprovider.ClientSecret) + } + + if redirectURL, exists := m.RedirectURL(); exists { + create = create.SetRedirectURL(redirectURL) + } else { + create = create.SetRedirectURL(oauthprovider.RedirectURL) + } + + if scopes, exists := m.Scopes(); exists { + create = create.SetScopes(scopes) + } else { + create = create.SetScopes(oauthprovider.Scopes) + } + + if authURL, exists := m.AuthURL(); exists { + create = create.SetAuthURL(authURL) + } else { + create = create.SetAuthURL(oauthprovider.AuthURL) + } + + if tokenURL, exists := m.TokenURL(); exists { + create = create.SetTokenURL(tokenURL) + } else { + create = create.SetTokenURL(oauthprovider.TokenURL) + } + + if authStyle, exists := m.AuthStyle(); exists { + create = create.SetAuthStyle(authStyle) + } else { + create = create.SetAuthStyle(oauthprovider.AuthStyle) + } + + if infoURL, exists := m.InfoURL(); exists { + create = create.SetInfoURL(infoURL) + } else { + create = create.SetInfoURL(oauthprovider.InfoURL) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *OauthProviderMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + oauthprovider, err := client.OauthProvider.Get(ctx, id) + if err != nil { + return err + } + + create := client.OauthProviderHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(oauthprovider.CreatedAt). + SetUpdatedAt(oauthprovider.UpdatedAt). + SetCreatedBy(oauthprovider.CreatedBy). + SetUpdatedBy(oauthprovider.UpdatedBy). + SetMappingID(oauthprovider.MappingID). + SetTags(oauthprovider.Tags). + SetDeletedAt(oauthprovider.DeletedAt). + SetDeletedBy(oauthprovider.DeletedBy). + SetOwnerID(oauthprovider.OwnerID). + SetName(oauthprovider.Name). + SetClientID(oauthprovider.ClientID). + SetClientSecret(oauthprovider.ClientSecret). + SetRedirectURL(oauthprovider.RedirectURL). + SetScopes(oauthprovider.Scopes). + SetAuthURL(oauthprovider.AuthURL). + SetTokenURL(oauthprovider.TokenURL). + SetAuthStyle(oauthprovider.AuthStyle). + SetInfoURL(oauthprovider.InfoURL). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *OrgMembershipMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.OrgMembershipHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if role, exists := m.Role(); exists { + create = create.SetRole(role) + } + + if organizationID, exists := m.OrganizationID(); exists { + create = create.SetOrganizationID(organizationID) + } + + if userID, exists := m.UserID(); exists { + create = create.SetUserID(userID) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *OrgMembershipMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + orgmembership, err := client.OrgMembership.Get(ctx, id) + if err != nil { + return err + } + + create := client.OrgMembershipHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(orgmembership.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(orgmembership.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(orgmembership.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(orgmembership.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(orgmembership.MappingID) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(orgmembership.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(orgmembership.DeletedBy) + } + + if role, exists := m.Role(); exists { + create = create.SetRole(role) + } else { + create = create.SetRole(orgmembership.Role) + } + + if organizationID, exists := m.OrganizationID(); exists { + create = create.SetOrganizationID(organizationID) + } else { + create = create.SetOrganizationID(orgmembership.OrganizationID) + } + + if userID, exists := m.UserID(); exists { + create = create.SetUserID(userID) + } else { + create = create.SetUserID(orgmembership.UserID) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *OrgMembershipMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + orgmembership, err := client.OrgMembership.Get(ctx, id) + if err != nil { + return err + } + + create := client.OrgMembershipHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(orgmembership.CreatedAt). + SetUpdatedAt(orgmembership.UpdatedAt). + SetCreatedBy(orgmembership.CreatedBy). + SetUpdatedBy(orgmembership.UpdatedBy). + SetMappingID(orgmembership.MappingID). + SetDeletedAt(orgmembership.DeletedAt). + SetDeletedBy(orgmembership.DeletedBy). + SetRole(orgmembership.Role). + SetOrganizationID(orgmembership.OrganizationID). + SetUserID(orgmembership.UserID). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *OrganizationMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.OrganizationHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if parentOrganizationID, exists := m.ParentOrganizationID(); exists { + create = create.SetParentOrganizationID(parentOrganizationID) + } + + if personalOrg, exists := m.PersonalOrg(); exists { + create = create.SetPersonalOrg(personalOrg) + } + + if avatarRemoteURL, exists := m.AvatarRemoteURL(); exists { + create = create.SetNillableAvatarRemoteURL(&avatarRemoteURL) + } + + if dedicatedDb, exists := m.DedicatedDb(); exists { + create = create.SetDedicatedDb(dedicatedDb) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *OrganizationMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + organization, err := client.Organization.Get(ctx, id) + if err != nil { + return err + } + + create := client.OrganizationHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(organization.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(organization.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(organization.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(organization.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(organization.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(organization.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(organization.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(organization.DeletedBy) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(organization.Name) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } else { + create = create.SetDisplayName(organization.DisplayName) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(organization.Description) + } + + if parentOrganizationID, exists := m.ParentOrganizationID(); exists { + create = create.SetParentOrganizationID(parentOrganizationID) + } else { + create = create.SetParentOrganizationID(organization.ParentOrganizationID) + } + + if personalOrg, exists := m.PersonalOrg(); exists { + create = create.SetPersonalOrg(personalOrg) + } else { + create = create.SetPersonalOrg(organization.PersonalOrg) + } + + if avatarRemoteURL, exists := m.AvatarRemoteURL(); exists { + create = create.SetNillableAvatarRemoteURL(&avatarRemoteURL) + } else { + create = create.SetNillableAvatarRemoteURL(organization.AvatarRemoteURL) + } + + if dedicatedDb, exists := m.DedicatedDb(); exists { + create = create.SetDedicatedDb(dedicatedDb) + } else { + create = create.SetDedicatedDb(organization.DedicatedDb) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *OrganizationMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + organization, err := client.Organization.Get(ctx, id) + if err != nil { + return err + } + + create := client.OrganizationHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(organization.CreatedAt). + SetUpdatedAt(organization.UpdatedAt). + SetCreatedBy(organization.CreatedBy). + SetUpdatedBy(organization.UpdatedBy). + SetMappingID(organization.MappingID). + SetTags(organization.Tags). + SetDeletedAt(organization.DeletedAt). + SetDeletedBy(organization.DeletedBy). + SetName(organization.Name). + SetDisplayName(organization.DisplayName). + SetDescription(organization.Description). + SetParentOrganizationID(organization.ParentOrganizationID). + SetPersonalOrg(organization.PersonalOrg). + SetNillableAvatarRemoteURL(organization.AvatarRemoteURL). + SetDedicatedDb(organization.DedicatedDb). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *OrganizationSettingMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.OrganizationSettingHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if domains, exists := m.Domains(); exists { + create = create.SetDomains(domains) + } + + if billingContact, exists := m.BillingContact(); exists { + create = create.SetBillingContact(billingContact) + } + + if billingEmail, exists := m.BillingEmail(); exists { + create = create.SetBillingEmail(billingEmail) + } + + if billingPhone, exists := m.BillingPhone(); exists { + create = create.SetBillingPhone(billingPhone) + } + + if billingAddress, exists := m.BillingAddress(); exists { + create = create.SetBillingAddress(billingAddress) + } + + if taxIdentifier, exists := m.TaxIdentifier(); exists { + create = create.SetTaxIdentifier(taxIdentifier) + } + + if geoLocation, exists := m.GeoLocation(); exists { + create = create.SetGeoLocation(geoLocation) + } + + if organizationID, exists := m.OrganizationID(); exists { + create = create.SetOrganizationID(organizationID) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *OrganizationSettingMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + organizationsetting, err := client.OrganizationSetting.Get(ctx, id) + if err != nil { + return err + } + + create := client.OrganizationSettingHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(organizationsetting.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(organizationsetting.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(organizationsetting.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(organizationsetting.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(organizationsetting.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(organizationsetting.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(organizationsetting.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(organizationsetting.DeletedBy) + } + + if domains, exists := m.Domains(); exists { + create = create.SetDomains(domains) + } else { + create = create.SetDomains(organizationsetting.Domains) + } + + if billingContact, exists := m.BillingContact(); exists { + create = create.SetBillingContact(billingContact) + } else { + create = create.SetBillingContact(organizationsetting.BillingContact) + } + + if billingEmail, exists := m.BillingEmail(); exists { + create = create.SetBillingEmail(billingEmail) + } else { + create = create.SetBillingEmail(organizationsetting.BillingEmail) + } + + if billingPhone, exists := m.BillingPhone(); exists { + create = create.SetBillingPhone(billingPhone) + } else { + create = create.SetBillingPhone(organizationsetting.BillingPhone) + } + + if billingAddress, exists := m.BillingAddress(); exists { + create = create.SetBillingAddress(billingAddress) + } else { + create = create.SetBillingAddress(organizationsetting.BillingAddress) + } + + if taxIdentifier, exists := m.TaxIdentifier(); exists { + create = create.SetTaxIdentifier(taxIdentifier) + } else { + create = create.SetTaxIdentifier(organizationsetting.TaxIdentifier) + } + + if geoLocation, exists := m.GeoLocation(); exists { + create = create.SetGeoLocation(geoLocation) + } else { + create = create.SetGeoLocation(organizationsetting.GeoLocation) + } + + if organizationID, exists := m.OrganizationID(); exists { + create = create.SetOrganizationID(organizationID) + } else { + create = create.SetOrganizationID(organizationsetting.OrganizationID) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *OrganizationSettingMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + organizationsetting, err := client.OrganizationSetting.Get(ctx, id) + if err != nil { + return err + } + + create := client.OrganizationSettingHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(organizationsetting.CreatedAt). + SetUpdatedAt(organizationsetting.UpdatedAt). + SetCreatedBy(organizationsetting.CreatedBy). + SetUpdatedBy(organizationsetting.UpdatedBy). + SetMappingID(organizationsetting.MappingID). + SetTags(organizationsetting.Tags). + SetDeletedAt(organizationsetting.DeletedAt). + SetDeletedBy(organizationsetting.DeletedBy). + SetDomains(organizationsetting.Domains). + SetBillingContact(organizationsetting.BillingContact). + SetBillingEmail(organizationsetting.BillingEmail). + SetBillingPhone(organizationsetting.BillingPhone). + SetBillingAddress(organizationsetting.BillingAddress). + SetTaxIdentifier(organizationsetting.TaxIdentifier). + SetGeoLocation(organizationsetting.GeoLocation). + SetOrganizationID(organizationsetting.OrganizationID). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *TemplateMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.TemplateHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if templateType, exists := m.TemplateType(); exists { + create = create.SetTemplateType(templateType) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if jsonconfig, exists := m.Jsonconfig(); exists { + create = create.SetJsonconfig(jsonconfig) + } + + if uischema, exists := m.Uischema(); exists { + create = create.SetUischema(uischema) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *TemplateMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + template, err := client.Template.Get(ctx, id) + if err != nil { + return err + } + + create := client.TemplateHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(template.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(template.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(template.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(template.UpdatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(template.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(template.DeletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(template.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(template.Tags) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(template.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(template.Name) + } + + if templateType, exists := m.TemplateType(); exists { + create = create.SetTemplateType(templateType) + } else { + create = create.SetTemplateType(template.TemplateType) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(template.Description) + } + + if jsonconfig, exists := m.Jsonconfig(); exists { + create = create.SetJsonconfig(jsonconfig) + } else { + create = create.SetJsonconfig(template.Jsonconfig) + } + + if uischema, exists := m.Uischema(); exists { + create = create.SetUischema(uischema) + } else { + create = create.SetUischema(template.Uischema) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *TemplateMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + template, err := client.Template.Get(ctx, id) + if err != nil { + return err + } + + create := client.TemplateHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(template.CreatedAt). + SetUpdatedAt(template.UpdatedAt). + SetCreatedBy(template.CreatedBy). + SetUpdatedBy(template.UpdatedBy). + SetDeletedAt(template.DeletedAt). + SetDeletedBy(template.DeletedBy). + SetMappingID(template.MappingID). + SetTags(template.Tags). + SetOwnerID(template.OwnerID). + SetName(template.Name). + SetTemplateType(template.TemplateType). + SetDescription(template.Description). + SetJsonconfig(template.Jsonconfig). + SetUischema(template.Uischema). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *UserMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.UserHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if email, exists := m.Email(); exists { + create = create.SetEmail(email) + } + + if firstName, exists := m.FirstName(); exists { + create = create.SetFirstName(firstName) + } + + if lastName, exists := m.LastName(); exists { + create = create.SetLastName(lastName) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } + + if avatarRemoteURL, exists := m.AvatarRemoteURL(); exists { + create = create.SetNillableAvatarRemoteURL(&avatarRemoteURL) + } + + if avatarLocalFile, exists := m.AvatarLocalFile(); exists { + create = create.SetNillableAvatarLocalFile(&avatarLocalFile) + } + + if avatarUpdatedAt, exists := m.AvatarUpdatedAt(); exists { + create = create.SetNillableAvatarUpdatedAt(&avatarUpdatedAt) + } + + if lastSeen, exists := m.LastSeen(); exists { + create = create.SetNillableLastSeen(&lastSeen) + } + + if password, exists := m.Password(); exists { + create = create.SetNillablePassword(&password) + } + + if sub, exists := m.Sub(); exists { + create = create.SetSub(sub) + } + + if authProvider, exists := m.AuthProvider(); exists { + create = create.SetAuthProvider(authProvider) + } + + if role, exists := m.Role(); exists { + create = create.SetRole(role) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *UserMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + user, err := client.User.Get(ctx, id) + if err != nil { + return err + } + + create := client.UserHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(user.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(user.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(user.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(user.UpdatedBy) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(user.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(user.DeletedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(user.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(user.Tags) + } + + if email, exists := m.Email(); exists { + create = create.SetEmail(email) + } else { + create = create.SetEmail(user.Email) + } + + if firstName, exists := m.FirstName(); exists { + create = create.SetFirstName(firstName) + } else { + create = create.SetFirstName(user.FirstName) + } + + if lastName, exists := m.LastName(); exists { + create = create.SetLastName(lastName) + } else { + create = create.SetLastName(user.LastName) + } + + if displayName, exists := m.DisplayName(); exists { + create = create.SetDisplayName(displayName) + } else { + create = create.SetDisplayName(user.DisplayName) + } + + if avatarRemoteURL, exists := m.AvatarRemoteURL(); exists { + create = create.SetNillableAvatarRemoteURL(&avatarRemoteURL) + } else { + create = create.SetNillableAvatarRemoteURL(user.AvatarRemoteURL) + } + + if avatarLocalFile, exists := m.AvatarLocalFile(); exists { + create = create.SetNillableAvatarLocalFile(&avatarLocalFile) + } else { + create = create.SetNillableAvatarLocalFile(user.AvatarLocalFile) + } + + if avatarUpdatedAt, exists := m.AvatarUpdatedAt(); exists { + create = create.SetNillableAvatarUpdatedAt(&avatarUpdatedAt) + } else { + create = create.SetNillableAvatarUpdatedAt(user.AvatarUpdatedAt) + } + + if lastSeen, exists := m.LastSeen(); exists { + create = create.SetNillableLastSeen(&lastSeen) + } else { + create = create.SetNillableLastSeen(user.LastSeen) + } + + if password, exists := m.Password(); exists { + create = create.SetNillablePassword(&password) + } else { + create = create.SetNillablePassword(user.Password) + } + + if sub, exists := m.Sub(); exists { + create = create.SetSub(sub) + } else { + create = create.SetSub(user.Sub) + } + + if authProvider, exists := m.AuthProvider(); exists { + create = create.SetAuthProvider(authProvider) + } else { + create = create.SetAuthProvider(user.AuthProvider) + } + + if role, exists := m.Role(); exists { + create = create.SetRole(role) + } else { + create = create.SetRole(user.Role) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *UserMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + user, err := client.User.Get(ctx, id) + if err != nil { + return err + } + + create := client.UserHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(user.CreatedAt). + SetUpdatedAt(user.UpdatedAt). + SetCreatedBy(user.CreatedBy). + SetUpdatedBy(user.UpdatedBy). + SetDeletedAt(user.DeletedAt). + SetDeletedBy(user.DeletedBy). + SetMappingID(user.MappingID). + SetTags(user.Tags). + SetEmail(user.Email). + SetFirstName(user.FirstName). + SetLastName(user.LastName). + SetDisplayName(user.DisplayName). + SetNillableAvatarRemoteURL(user.AvatarRemoteURL). + SetNillableAvatarLocalFile(user.AvatarLocalFile). + SetNillableAvatarUpdatedAt(user.AvatarUpdatedAt). + SetNillableLastSeen(user.LastSeen). + SetNillablePassword(user.Password). + SetSub(user.Sub). + SetAuthProvider(user.AuthProvider). + SetRole(user.Role). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *UserSettingMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.UserSettingHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if userID, exists := m.UserID(); exists { + create = create.SetUserID(userID) + } + + if locked, exists := m.Locked(); exists { + create = create.SetLocked(locked) + } + + if silencedAt, exists := m.SilencedAt(); exists { + create = create.SetNillableSilencedAt(&silencedAt) + } + + if suspendedAt, exists := m.SuspendedAt(); exists { + create = create.SetNillableSuspendedAt(&suspendedAt) + } + + if status, exists := m.Status(); exists { + create = create.SetStatus(status) + } + + if emailConfirmed, exists := m.EmailConfirmed(); exists { + create = create.SetEmailConfirmed(emailConfirmed) + } + + if isWebauthnAllowed, exists := m.IsWebauthnAllowed(); exists { + create = create.SetIsWebauthnAllowed(isWebauthnAllowed) + } + + if isTfaEnabled, exists := m.IsTfaEnabled(); exists { + create = create.SetIsTfaEnabled(isTfaEnabled) + } + + if phoneNumber, exists := m.PhoneNumber(); exists { + create = create.SetNillablePhoneNumber(&phoneNumber) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *UserSettingMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + usersetting, err := client.UserSetting.Get(ctx, id) + if err != nil { + return err + } + + create := client.UserSettingHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(usersetting.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(usersetting.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(usersetting.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(usersetting.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(usersetting.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(usersetting.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(usersetting.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(usersetting.DeletedBy) + } + + if userID, exists := m.UserID(); exists { + create = create.SetUserID(userID) + } else { + create = create.SetUserID(usersetting.UserID) + } + + if locked, exists := m.Locked(); exists { + create = create.SetLocked(locked) + } else { + create = create.SetLocked(usersetting.Locked) + } + + if silencedAt, exists := m.SilencedAt(); exists { + create = create.SetNillableSilencedAt(&silencedAt) + } else { + create = create.SetNillableSilencedAt(usersetting.SilencedAt) + } + + if suspendedAt, exists := m.SuspendedAt(); exists { + create = create.SetNillableSuspendedAt(&suspendedAt) + } else { + create = create.SetNillableSuspendedAt(usersetting.SuspendedAt) + } + + if status, exists := m.Status(); exists { + create = create.SetStatus(status) + } else { + create = create.SetStatus(usersetting.Status) + } + + if emailConfirmed, exists := m.EmailConfirmed(); exists { + create = create.SetEmailConfirmed(emailConfirmed) + } else { + create = create.SetEmailConfirmed(usersetting.EmailConfirmed) + } + + if isWebauthnAllowed, exists := m.IsWebauthnAllowed(); exists { + create = create.SetIsWebauthnAllowed(isWebauthnAllowed) + } else { + create = create.SetIsWebauthnAllowed(usersetting.IsWebauthnAllowed) + } + + if isTfaEnabled, exists := m.IsTfaEnabled(); exists { + create = create.SetIsTfaEnabled(isTfaEnabled) + } else { + create = create.SetIsTfaEnabled(usersetting.IsTfaEnabled) + } + + if phoneNumber, exists := m.PhoneNumber(); exists { + create = create.SetNillablePhoneNumber(&phoneNumber) + } else { + create = create.SetNillablePhoneNumber(usersetting.PhoneNumber) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *UserSettingMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + usersetting, err := client.UserSetting.Get(ctx, id) + if err != nil { + return err + } + + create := client.UserSettingHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(usersetting.CreatedAt). + SetUpdatedAt(usersetting.UpdatedAt). + SetCreatedBy(usersetting.CreatedBy). + SetUpdatedBy(usersetting.UpdatedBy). + SetMappingID(usersetting.MappingID). + SetTags(usersetting.Tags). + SetDeletedAt(usersetting.DeletedAt). + SetDeletedBy(usersetting.DeletedBy). + SetUserID(usersetting.UserID). + SetLocked(usersetting.Locked). + SetNillableSilencedAt(usersetting.SilencedAt). + SetNillableSuspendedAt(usersetting.SuspendedAt). + SetStatus(usersetting.Status). + SetEmailConfirmed(usersetting.EmailConfirmed). + SetIsWebauthnAllowed(usersetting.IsWebauthnAllowed). + SetIsTfaEnabled(usersetting.IsTfaEnabled). + SetNillablePhoneNumber(usersetting.PhoneNumber). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (m *WebhookMutation) CreateHistoryFromCreate(ctx context.Context) error { + client := m.Client() + + id, ok := m.ID() + if !ok { + return idNotFoundError + } + + create := client.WebhookHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } + + if destinationURL, exists := m.DestinationURL(); exists { + create = create.SetDestinationURL(destinationURL) + } + + if enabled, exists := m.Enabled(); exists { + create = create.SetEnabled(enabled) + } + + if callback, exists := m.Callback(); exists { + create = create.SetCallback(callback) + } + + if expiresAt, exists := m.ExpiresAt(); exists { + create = create.SetExpiresAt(expiresAt) + } + + if secret, exists := m.Secret(); exists { + create = create.SetSecret(secret) + } + + if failures, exists := m.Failures(); exists { + create = create.SetFailures(failures) + } + + if lastError, exists := m.LastError(); exists { + create = create.SetLastError(lastError) + } + + if lastResponse, exists := m.LastResponse(); exists { + create = create.SetLastResponse(lastResponse) + } + + _, err := create.Save(ctx) + + return err +} + +func (m *WebhookMutation) CreateHistoryFromUpdate(ctx context.Context) error { + // check for soft delete operation and delete instead + if entx.CheckIsSoftDelete(ctx) { + return m.CreateHistoryFromDelete(ctx) + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + webhook, err := client.Webhook.Get(ctx, id) + if err != nil { + return err + } + + create := client.WebhookHistory.Create() + + create = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id) + + if createdAt, exists := m.CreatedAt(); exists { + create = create.SetCreatedAt(createdAt) + } else { + create = create.SetCreatedAt(webhook.CreatedAt) + } + + if updatedAt, exists := m.UpdatedAt(); exists { + create = create.SetUpdatedAt(updatedAt) + } else { + create = create.SetUpdatedAt(webhook.UpdatedAt) + } + + if createdBy, exists := m.CreatedBy(); exists { + create = create.SetCreatedBy(createdBy) + } else { + create = create.SetCreatedBy(webhook.CreatedBy) + } + + if updatedBy, exists := m.UpdatedBy(); exists { + create = create.SetUpdatedBy(updatedBy) + } else { + create = create.SetUpdatedBy(webhook.UpdatedBy) + } + + if mappingID, exists := m.MappingID(); exists { + create = create.SetMappingID(mappingID) + } else { + create = create.SetMappingID(webhook.MappingID) + } + + if tags, exists := m.Tags(); exists { + create = create.SetTags(tags) + } else { + create = create.SetTags(webhook.Tags) + } + + if deletedAt, exists := m.DeletedAt(); exists { + create = create.SetDeletedAt(deletedAt) + } else { + create = create.SetDeletedAt(webhook.DeletedAt) + } + + if deletedBy, exists := m.DeletedBy(); exists { + create = create.SetDeletedBy(deletedBy) + } else { + create = create.SetDeletedBy(webhook.DeletedBy) + } + + if ownerID, exists := m.OwnerID(); exists { + create = create.SetOwnerID(ownerID) + } else { + create = create.SetOwnerID(webhook.OwnerID) + } + + if name, exists := m.Name(); exists { + create = create.SetName(name) + } else { + create = create.SetName(webhook.Name) + } + + if description, exists := m.Description(); exists { + create = create.SetDescription(description) + } else { + create = create.SetDescription(webhook.Description) + } + + if destinationURL, exists := m.DestinationURL(); exists { + create = create.SetDestinationURL(destinationURL) + } else { + create = create.SetDestinationURL(webhook.DestinationURL) + } + + if enabled, exists := m.Enabled(); exists { + create = create.SetEnabled(enabled) + } else { + create = create.SetEnabled(webhook.Enabled) + } + + if callback, exists := m.Callback(); exists { + create = create.SetCallback(callback) + } else { + create = create.SetCallback(webhook.Callback) + } + + if expiresAt, exists := m.ExpiresAt(); exists { + create = create.SetExpiresAt(expiresAt) + } else { + create = create.SetExpiresAt(webhook.ExpiresAt) + } + + if secret, exists := m.Secret(); exists { + create = create.SetSecret(secret) + } else { + create = create.SetSecret(webhook.Secret) + } + + if failures, exists := m.Failures(); exists { + create = create.SetFailures(failures) + } else { + create = create.SetFailures(webhook.Failures) + } + + if lastError, exists := m.LastError(); exists { + create = create.SetLastError(lastError) + } else { + create = create.SetLastError(webhook.LastError) + } + + if lastResponse, exists := m.LastResponse(); exists { + create = create.SetLastResponse(lastResponse) + } else { + create = create.SetLastResponse(webhook.LastResponse) + } + + if _, err := create.Save(ctx); err != nil { + return err + } + } + + return nil +} + +func (m *WebhookMutation) CreateHistoryFromDelete(ctx context.Context) error { + // check for soft delete operation and skip so it happens on update + if entx.CheckIsSoftDelete(ctx) { + return nil + } + client := m.Client() + + ids, err := m.IDs(ctx) + if err != nil { + return fmt.Errorf("getting ids: %w", err) + } + + for _, id := range ids { + webhook, err := client.Webhook.Get(ctx, id) + if err != nil { + return err + } + + create := client.WebhookHistory.Create() + + _, err = create. + SetOperation(EntOpToHistoryOp(m.Op())). + SetHistoryTime(time.Now()). + SetRef(id). + SetCreatedAt(webhook.CreatedAt). + SetUpdatedAt(webhook.UpdatedAt). + SetCreatedBy(webhook.CreatedBy). + SetUpdatedBy(webhook.UpdatedBy). + SetMappingID(webhook.MappingID). + SetTags(webhook.Tags). + SetDeletedAt(webhook.DeletedAt). + SetDeletedBy(webhook.DeletedBy). + SetOwnerID(webhook.OwnerID). + SetName(webhook.Name). + SetDescription(webhook.Description). + SetDestinationURL(webhook.DestinationURL). + SetEnabled(webhook.Enabled). + SetCallback(webhook.Callback). + SetExpiresAt(webhook.ExpiresAt). + SetSecret(webhook.Secret). + SetFailures(webhook.Failures). + SetLastError(webhook.LastError). + SetLastResponse(webhook.LastResponse). + Save(ctx) + if err != nil { + return err + } + } + + return nil +} diff --git a/internal/ent/generated/history_query.go b/internal/ent/generated/history_query.go new file mode 100644 index 0000000..b13fa56 --- /dev/null +++ b/internal/ent/generated/history_query.go @@ -0,0 +1,1139 @@ +// Code generated by entx.history, DO NOT EDIT. +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" +) + +func (c *Contact) History() *ContactHistoryQuery { + historyClient := NewContactHistoryClient(c.config) + return historyClient.Query().Where(contacthistory.Ref(c.ID)) +} + +func (ch *ContactHistory) Next(ctx context.Context) (*ContactHistory, error) { + client := NewContactHistoryClient(ch.config) + return client.Query(). + Where( + contacthistory.Ref(ch.Ref), + contacthistory.HistoryTimeGT(ch.HistoryTime), + ). + Order(contacthistory.ByHistoryTime()). + First(ctx) +} + +func (ch *ContactHistory) Prev(ctx context.Context) (*ContactHistory, error) { + client := NewContactHistoryClient(ch.config) + return client.Query(). + Where( + contacthistory.Ref(ch.Ref), + contacthistory.HistoryTimeLT(ch.HistoryTime), + ). + Order(contacthistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (chq *ContactHistoryQuery) Earliest(ctx context.Context) (*ContactHistory, error) { + return chq. + Order(contacthistory.ByHistoryTime()). + First(ctx) +} + +func (chq *ContactHistoryQuery) Latest(ctx context.Context) (*ContactHistory, error) { + return chq. + Order(contacthistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (chq *ContactHistoryQuery) AsOf(ctx context.Context, time time.Time) (*ContactHistory, error) { + return chq. + Where(contacthistory.HistoryTimeLTE(time)). + Order(contacthistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (dd *DocumentData) History() *DocumentDataHistoryQuery { + historyClient := NewDocumentDataHistoryClient(dd.config) + return historyClient.Query().Where(documentdatahistory.Ref(dd.ID)) +} + +func (ddh *DocumentDataHistory) Next(ctx context.Context) (*DocumentDataHistory, error) { + client := NewDocumentDataHistoryClient(ddh.config) + return client.Query(). + Where( + documentdatahistory.Ref(ddh.Ref), + documentdatahistory.HistoryTimeGT(ddh.HistoryTime), + ). + Order(documentdatahistory.ByHistoryTime()). + First(ctx) +} + +func (ddh *DocumentDataHistory) Prev(ctx context.Context) (*DocumentDataHistory, error) { + client := NewDocumentDataHistoryClient(ddh.config) + return client.Query(). + Where( + documentdatahistory.Ref(ddh.Ref), + documentdatahistory.HistoryTimeLT(ddh.HistoryTime), + ). + Order(documentdatahistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ddhq *DocumentDataHistoryQuery) Earliest(ctx context.Context) (*DocumentDataHistory, error) { + return ddhq. + Order(documentdatahistory.ByHistoryTime()). + First(ctx) +} + +func (ddhq *DocumentDataHistoryQuery) Latest(ctx context.Context) (*DocumentDataHistory, error) { + return ddhq. + Order(documentdatahistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ddhq *DocumentDataHistoryQuery) AsOf(ctx context.Context, time time.Time) (*DocumentDataHistory, error) { + return ddhq. + Where(documentdatahistory.HistoryTimeLTE(time)). + Order(documentdatahistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (e *Entitlement) History() *EntitlementHistoryQuery { + historyClient := NewEntitlementHistoryClient(e.config) + return historyClient.Query().Where(entitlementhistory.Ref(e.ID)) +} + +func (eh *EntitlementHistory) Next(ctx context.Context) (*EntitlementHistory, error) { + client := NewEntitlementHistoryClient(eh.config) + return client.Query(). + Where( + entitlementhistory.Ref(eh.Ref), + entitlementhistory.HistoryTimeGT(eh.HistoryTime), + ). + Order(entitlementhistory.ByHistoryTime()). + First(ctx) +} + +func (eh *EntitlementHistory) Prev(ctx context.Context) (*EntitlementHistory, error) { + client := NewEntitlementHistoryClient(eh.config) + return client.Query(). + Where( + entitlementhistory.Ref(eh.Ref), + entitlementhistory.HistoryTimeLT(eh.HistoryTime), + ). + Order(entitlementhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ehq *EntitlementHistoryQuery) Earliest(ctx context.Context) (*EntitlementHistory, error) { + return ehq. + Order(entitlementhistory.ByHistoryTime()). + First(ctx) +} + +func (ehq *EntitlementHistoryQuery) Latest(ctx context.Context) (*EntitlementHistory, error) { + return ehq. + Order(entitlementhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ehq *EntitlementHistoryQuery) AsOf(ctx context.Context, time time.Time) (*EntitlementHistory, error) { + return ehq. + Where(entitlementhistory.HistoryTimeLTE(time)). + Order(entitlementhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ep *EntitlementPlan) History() *EntitlementPlanHistoryQuery { + historyClient := NewEntitlementPlanHistoryClient(ep.config) + return historyClient.Query().Where(entitlementplanhistory.Ref(ep.ID)) +} + +func (eph *EntitlementPlanHistory) Next(ctx context.Context) (*EntitlementPlanHistory, error) { + client := NewEntitlementPlanHistoryClient(eph.config) + return client.Query(). + Where( + entitlementplanhistory.Ref(eph.Ref), + entitlementplanhistory.HistoryTimeGT(eph.HistoryTime), + ). + Order(entitlementplanhistory.ByHistoryTime()). + First(ctx) +} + +func (eph *EntitlementPlanHistory) Prev(ctx context.Context) (*EntitlementPlanHistory, error) { + client := NewEntitlementPlanHistoryClient(eph.config) + return client.Query(). + Where( + entitlementplanhistory.Ref(eph.Ref), + entitlementplanhistory.HistoryTimeLT(eph.HistoryTime), + ). + Order(entitlementplanhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ephq *EntitlementPlanHistoryQuery) Earliest(ctx context.Context) (*EntitlementPlanHistory, error) { + return ephq. + Order(entitlementplanhistory.ByHistoryTime()). + First(ctx) +} + +func (ephq *EntitlementPlanHistoryQuery) Latest(ctx context.Context) (*EntitlementPlanHistory, error) { + return ephq. + Order(entitlementplanhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ephq *EntitlementPlanHistoryQuery) AsOf(ctx context.Context, time time.Time) (*EntitlementPlanHistory, error) { + return ephq. + Where(entitlementplanhistory.HistoryTimeLTE(time)). + Order(entitlementplanhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (epf *EntitlementPlanFeature) History() *EntitlementPlanFeatureHistoryQuery { + historyClient := NewEntitlementPlanFeatureHistoryClient(epf.config) + return historyClient.Query().Where(entitlementplanfeaturehistory.Ref(epf.ID)) +} + +func (epfh *EntitlementPlanFeatureHistory) Next(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + client := NewEntitlementPlanFeatureHistoryClient(epfh.config) + return client.Query(). + Where( + entitlementplanfeaturehistory.Ref(epfh.Ref), + entitlementplanfeaturehistory.HistoryTimeGT(epfh.HistoryTime), + ). + Order(entitlementplanfeaturehistory.ByHistoryTime()). + First(ctx) +} + +func (epfh *EntitlementPlanFeatureHistory) Prev(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + client := NewEntitlementPlanFeatureHistoryClient(epfh.config) + return client.Query(). + Where( + entitlementplanfeaturehistory.Ref(epfh.Ref), + entitlementplanfeaturehistory.HistoryTimeLT(epfh.HistoryTime), + ). + Order(entitlementplanfeaturehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) Earliest(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + return epfhq. + Order(entitlementplanfeaturehistory.ByHistoryTime()). + First(ctx) +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) Latest(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + return epfhq. + Order(entitlementplanfeaturehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (epfhq *EntitlementPlanFeatureHistoryQuery) AsOf(ctx context.Context, time time.Time) (*EntitlementPlanFeatureHistory, error) { + return epfhq. + Where(entitlementplanfeaturehistory.HistoryTimeLTE(time)). + Order(entitlementplanfeaturehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (e *Entity) History() *EntityHistoryQuery { + historyClient := NewEntityHistoryClient(e.config) + return historyClient.Query().Where(entityhistory.Ref(e.ID)) +} + +func (eh *EntityHistory) Next(ctx context.Context) (*EntityHistory, error) { + client := NewEntityHistoryClient(eh.config) + return client.Query(). + Where( + entityhistory.Ref(eh.Ref), + entityhistory.HistoryTimeGT(eh.HistoryTime), + ). + Order(entityhistory.ByHistoryTime()). + First(ctx) +} + +func (eh *EntityHistory) Prev(ctx context.Context) (*EntityHistory, error) { + client := NewEntityHistoryClient(eh.config) + return client.Query(). + Where( + entityhistory.Ref(eh.Ref), + entityhistory.HistoryTimeLT(eh.HistoryTime), + ). + Order(entityhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ehq *EntityHistoryQuery) Earliest(ctx context.Context) (*EntityHistory, error) { + return ehq. + Order(entityhistory.ByHistoryTime()). + First(ctx) +} + +func (ehq *EntityHistoryQuery) Latest(ctx context.Context) (*EntityHistory, error) { + return ehq. + Order(entityhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ehq *EntityHistoryQuery) AsOf(ctx context.Context, time time.Time) (*EntityHistory, error) { + return ehq. + Where(entityhistory.HistoryTimeLTE(time)). + Order(entityhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (et *EntityType) History() *EntityTypeHistoryQuery { + historyClient := NewEntityTypeHistoryClient(et.config) + return historyClient.Query().Where(entitytypehistory.Ref(et.ID)) +} + +func (eth *EntityTypeHistory) Next(ctx context.Context) (*EntityTypeHistory, error) { + client := NewEntityTypeHistoryClient(eth.config) + return client.Query(). + Where( + entitytypehistory.Ref(eth.Ref), + entitytypehistory.HistoryTimeGT(eth.HistoryTime), + ). + Order(entitytypehistory.ByHistoryTime()). + First(ctx) +} + +func (eth *EntityTypeHistory) Prev(ctx context.Context) (*EntityTypeHistory, error) { + client := NewEntityTypeHistoryClient(eth.config) + return client.Query(). + Where( + entitytypehistory.Ref(eth.Ref), + entitytypehistory.HistoryTimeLT(eth.HistoryTime), + ). + Order(entitytypehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ethq *EntityTypeHistoryQuery) Earliest(ctx context.Context) (*EntityTypeHistory, error) { + return ethq. + Order(entitytypehistory.ByHistoryTime()). + First(ctx) +} + +func (ethq *EntityTypeHistoryQuery) Latest(ctx context.Context) (*EntityTypeHistory, error) { + return ethq. + Order(entitytypehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ethq *EntityTypeHistoryQuery) AsOf(ctx context.Context, time time.Time) (*EntityTypeHistory, error) { + return ethq. + Where(entitytypehistory.HistoryTimeLTE(time)). + Order(entitytypehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (e *Event) History() *EventHistoryQuery { + historyClient := NewEventHistoryClient(e.config) + return historyClient.Query().Where(eventhistory.Ref(e.ID)) +} + +func (eh *EventHistory) Next(ctx context.Context) (*EventHistory, error) { + client := NewEventHistoryClient(eh.config) + return client.Query(). + Where( + eventhistory.Ref(eh.Ref), + eventhistory.HistoryTimeGT(eh.HistoryTime), + ). + Order(eventhistory.ByHistoryTime()). + First(ctx) +} + +func (eh *EventHistory) Prev(ctx context.Context) (*EventHistory, error) { + client := NewEventHistoryClient(eh.config) + return client.Query(). + Where( + eventhistory.Ref(eh.Ref), + eventhistory.HistoryTimeLT(eh.HistoryTime), + ). + Order(eventhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ehq *EventHistoryQuery) Earliest(ctx context.Context) (*EventHistory, error) { + return ehq. + Order(eventhistory.ByHistoryTime()). + First(ctx) +} + +func (ehq *EventHistoryQuery) Latest(ctx context.Context) (*EventHistory, error) { + return ehq. + Order(eventhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ehq *EventHistoryQuery) AsOf(ctx context.Context, time time.Time) (*EventHistory, error) { + return ehq. + Where(eventhistory.HistoryTimeLTE(time)). + Order(eventhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (f *Feature) History() *FeatureHistoryQuery { + historyClient := NewFeatureHistoryClient(f.config) + return historyClient.Query().Where(featurehistory.Ref(f.ID)) +} + +func (fh *FeatureHistory) Next(ctx context.Context) (*FeatureHistory, error) { + client := NewFeatureHistoryClient(fh.config) + return client.Query(). + Where( + featurehistory.Ref(fh.Ref), + featurehistory.HistoryTimeGT(fh.HistoryTime), + ). + Order(featurehistory.ByHistoryTime()). + First(ctx) +} + +func (fh *FeatureHistory) Prev(ctx context.Context) (*FeatureHistory, error) { + client := NewFeatureHistoryClient(fh.config) + return client.Query(). + Where( + featurehistory.Ref(fh.Ref), + featurehistory.HistoryTimeLT(fh.HistoryTime), + ). + Order(featurehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (fhq *FeatureHistoryQuery) Earliest(ctx context.Context) (*FeatureHistory, error) { + return fhq. + Order(featurehistory.ByHistoryTime()). + First(ctx) +} + +func (fhq *FeatureHistoryQuery) Latest(ctx context.Context) (*FeatureHistory, error) { + return fhq. + Order(featurehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (fhq *FeatureHistoryQuery) AsOf(ctx context.Context, time time.Time) (*FeatureHistory, error) { + return fhq. + Where(featurehistory.HistoryTimeLTE(time)). + Order(featurehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (f *File) History() *FileHistoryQuery { + historyClient := NewFileHistoryClient(f.config) + return historyClient.Query().Where(filehistory.Ref(f.ID)) +} + +func (fh *FileHistory) Next(ctx context.Context) (*FileHistory, error) { + client := NewFileHistoryClient(fh.config) + return client.Query(). + Where( + filehistory.Ref(fh.Ref), + filehistory.HistoryTimeGT(fh.HistoryTime), + ). + Order(filehistory.ByHistoryTime()). + First(ctx) +} + +func (fh *FileHistory) Prev(ctx context.Context) (*FileHistory, error) { + client := NewFileHistoryClient(fh.config) + return client.Query(). + Where( + filehistory.Ref(fh.Ref), + filehistory.HistoryTimeLT(fh.HistoryTime), + ). + Order(filehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (fhq *FileHistoryQuery) Earliest(ctx context.Context) (*FileHistory, error) { + return fhq. + Order(filehistory.ByHistoryTime()). + First(ctx) +} + +func (fhq *FileHistoryQuery) Latest(ctx context.Context) (*FileHistory, error) { + return fhq. + Order(filehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (fhq *FileHistoryQuery) AsOf(ctx context.Context, time time.Time) (*FileHistory, error) { + return fhq. + Where(filehistory.HistoryTimeLTE(time)). + Order(filehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (gr *Group) History() *GroupHistoryQuery { + historyClient := NewGroupHistoryClient(gr.config) + return historyClient.Query().Where(grouphistory.Ref(gr.ID)) +} + +func (gh *GroupHistory) Next(ctx context.Context) (*GroupHistory, error) { + client := NewGroupHistoryClient(gh.config) + return client.Query(). + Where( + grouphistory.Ref(gh.Ref), + grouphistory.HistoryTimeGT(gh.HistoryTime), + ). + Order(grouphistory.ByHistoryTime()). + First(ctx) +} + +func (gh *GroupHistory) Prev(ctx context.Context) (*GroupHistory, error) { + client := NewGroupHistoryClient(gh.config) + return client.Query(). + Where( + grouphistory.Ref(gh.Ref), + grouphistory.HistoryTimeLT(gh.HistoryTime), + ). + Order(grouphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ghq *GroupHistoryQuery) Earliest(ctx context.Context) (*GroupHistory, error) { + return ghq. + Order(grouphistory.ByHistoryTime()). + First(ctx) +} + +func (ghq *GroupHistoryQuery) Latest(ctx context.Context) (*GroupHistory, error) { + return ghq. + Order(grouphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ghq *GroupHistoryQuery) AsOf(ctx context.Context, time time.Time) (*GroupHistory, error) { + return ghq. + Where(grouphistory.HistoryTimeLTE(time)). + Order(grouphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (gm *GroupMembership) History() *GroupMembershipHistoryQuery { + historyClient := NewGroupMembershipHistoryClient(gm.config) + return historyClient.Query().Where(groupmembershiphistory.Ref(gm.ID)) +} + +func (gmh *GroupMembershipHistory) Next(ctx context.Context) (*GroupMembershipHistory, error) { + client := NewGroupMembershipHistoryClient(gmh.config) + return client.Query(). + Where( + groupmembershiphistory.Ref(gmh.Ref), + groupmembershiphistory.HistoryTimeGT(gmh.HistoryTime), + ). + Order(groupmembershiphistory.ByHistoryTime()). + First(ctx) +} + +func (gmh *GroupMembershipHistory) Prev(ctx context.Context) (*GroupMembershipHistory, error) { + client := NewGroupMembershipHistoryClient(gmh.config) + return client.Query(). + Where( + groupmembershiphistory.Ref(gmh.Ref), + groupmembershiphistory.HistoryTimeLT(gmh.HistoryTime), + ). + Order(groupmembershiphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (gmhq *GroupMembershipHistoryQuery) Earliest(ctx context.Context) (*GroupMembershipHistory, error) { + return gmhq. + Order(groupmembershiphistory.ByHistoryTime()). + First(ctx) +} + +func (gmhq *GroupMembershipHistoryQuery) Latest(ctx context.Context) (*GroupMembershipHistory, error) { + return gmhq. + Order(groupmembershiphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (gmhq *GroupMembershipHistoryQuery) AsOf(ctx context.Context, time time.Time) (*GroupMembershipHistory, error) { + return gmhq. + Where(groupmembershiphistory.HistoryTimeLTE(time)). + Order(groupmembershiphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (gs *GroupSetting) History() *GroupSettingHistoryQuery { + historyClient := NewGroupSettingHistoryClient(gs.config) + return historyClient.Query().Where(groupsettinghistory.Ref(gs.ID)) +} + +func (gsh *GroupSettingHistory) Next(ctx context.Context) (*GroupSettingHistory, error) { + client := NewGroupSettingHistoryClient(gsh.config) + return client.Query(). + Where( + groupsettinghistory.Ref(gsh.Ref), + groupsettinghistory.HistoryTimeGT(gsh.HistoryTime), + ). + Order(groupsettinghistory.ByHistoryTime()). + First(ctx) +} + +func (gsh *GroupSettingHistory) Prev(ctx context.Context) (*GroupSettingHistory, error) { + client := NewGroupSettingHistoryClient(gsh.config) + return client.Query(). + Where( + groupsettinghistory.Ref(gsh.Ref), + groupsettinghistory.HistoryTimeLT(gsh.HistoryTime), + ). + Order(groupsettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (gshq *GroupSettingHistoryQuery) Earliest(ctx context.Context) (*GroupSettingHistory, error) { + return gshq. + Order(groupsettinghistory.ByHistoryTime()). + First(ctx) +} + +func (gshq *GroupSettingHistoryQuery) Latest(ctx context.Context) (*GroupSettingHistory, error) { + return gshq. + Order(groupsettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (gshq *GroupSettingHistoryQuery) AsOf(ctx context.Context, time time.Time) (*GroupSettingHistory, error) { + return gshq. + Where(groupsettinghistory.HistoryTimeLTE(time)). + Order(groupsettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (h *Hush) History() *HushHistoryQuery { + historyClient := NewHushHistoryClient(h.config) + return historyClient.Query().Where(hushhistory.Ref(h.ID)) +} + +func (hh *HushHistory) Next(ctx context.Context) (*HushHistory, error) { + client := NewHushHistoryClient(hh.config) + return client.Query(). + Where( + hushhistory.Ref(hh.Ref), + hushhistory.HistoryTimeGT(hh.HistoryTime), + ). + Order(hushhistory.ByHistoryTime()). + First(ctx) +} + +func (hh *HushHistory) Prev(ctx context.Context) (*HushHistory, error) { + client := NewHushHistoryClient(hh.config) + return client.Query(). + Where( + hushhistory.Ref(hh.Ref), + hushhistory.HistoryTimeLT(hh.HistoryTime), + ). + Order(hushhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (hhq *HushHistoryQuery) Earliest(ctx context.Context) (*HushHistory, error) { + return hhq. + Order(hushhistory.ByHistoryTime()). + First(ctx) +} + +func (hhq *HushHistoryQuery) Latest(ctx context.Context) (*HushHistory, error) { + return hhq. + Order(hushhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (hhq *HushHistoryQuery) AsOf(ctx context.Context, time time.Time) (*HushHistory, error) { + return hhq. + Where(hushhistory.HistoryTimeLTE(time)). + Order(hushhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (i *Integration) History() *IntegrationHistoryQuery { + historyClient := NewIntegrationHistoryClient(i.config) + return historyClient.Query().Where(integrationhistory.Ref(i.ID)) +} + +func (ih *IntegrationHistory) Next(ctx context.Context) (*IntegrationHistory, error) { + client := NewIntegrationHistoryClient(ih.config) + return client.Query(). + Where( + integrationhistory.Ref(ih.Ref), + integrationhistory.HistoryTimeGT(ih.HistoryTime), + ). + Order(integrationhistory.ByHistoryTime()). + First(ctx) +} + +func (ih *IntegrationHistory) Prev(ctx context.Context) (*IntegrationHistory, error) { + client := NewIntegrationHistoryClient(ih.config) + return client.Query(). + Where( + integrationhistory.Ref(ih.Ref), + integrationhistory.HistoryTimeLT(ih.HistoryTime), + ). + Order(integrationhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ihq *IntegrationHistoryQuery) Earliest(ctx context.Context) (*IntegrationHistory, error) { + return ihq. + Order(integrationhistory.ByHistoryTime()). + First(ctx) +} + +func (ihq *IntegrationHistoryQuery) Latest(ctx context.Context) (*IntegrationHistory, error) { + return ihq. + Order(integrationhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ihq *IntegrationHistoryQuery) AsOf(ctx context.Context, time time.Time) (*IntegrationHistory, error) { + return ihq. + Where(integrationhistory.HistoryTimeLTE(time)). + Order(integrationhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (n *Note) History() *NoteHistoryQuery { + historyClient := NewNoteHistoryClient(n.config) + return historyClient.Query().Where(notehistory.Ref(n.ID)) +} + +func (nh *NoteHistory) Next(ctx context.Context) (*NoteHistory, error) { + client := NewNoteHistoryClient(nh.config) + return client.Query(). + Where( + notehistory.Ref(nh.Ref), + notehistory.HistoryTimeGT(nh.HistoryTime), + ). + Order(notehistory.ByHistoryTime()). + First(ctx) +} + +func (nh *NoteHistory) Prev(ctx context.Context) (*NoteHistory, error) { + client := NewNoteHistoryClient(nh.config) + return client.Query(). + Where( + notehistory.Ref(nh.Ref), + notehistory.HistoryTimeLT(nh.HistoryTime), + ). + Order(notehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (nhq *NoteHistoryQuery) Earliest(ctx context.Context) (*NoteHistory, error) { + return nhq. + Order(notehistory.ByHistoryTime()). + First(ctx) +} + +func (nhq *NoteHistoryQuery) Latest(ctx context.Context) (*NoteHistory, error) { + return nhq. + Order(notehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (nhq *NoteHistoryQuery) AsOf(ctx context.Context, time time.Time) (*NoteHistory, error) { + return nhq. + Where(notehistory.HistoryTimeLTE(time)). + Order(notehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (op *OauthProvider) History() *OauthProviderHistoryQuery { + historyClient := NewOauthProviderHistoryClient(op.config) + return historyClient.Query().Where(oauthproviderhistory.Ref(op.ID)) +} + +func (oph *OauthProviderHistory) Next(ctx context.Context) (*OauthProviderHistory, error) { + client := NewOauthProviderHistoryClient(oph.config) + return client.Query(). + Where( + oauthproviderhistory.Ref(oph.Ref), + oauthproviderhistory.HistoryTimeGT(oph.HistoryTime), + ). + Order(oauthproviderhistory.ByHistoryTime()). + First(ctx) +} + +func (oph *OauthProviderHistory) Prev(ctx context.Context) (*OauthProviderHistory, error) { + client := NewOauthProviderHistoryClient(oph.config) + return client.Query(). + Where( + oauthproviderhistory.Ref(oph.Ref), + oauthproviderhistory.HistoryTimeLT(oph.HistoryTime), + ). + Order(oauthproviderhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ophq *OauthProviderHistoryQuery) Earliest(ctx context.Context) (*OauthProviderHistory, error) { + return ophq. + Order(oauthproviderhistory.ByHistoryTime()). + First(ctx) +} + +func (ophq *OauthProviderHistoryQuery) Latest(ctx context.Context) (*OauthProviderHistory, error) { + return ophq. + Order(oauthproviderhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ophq *OauthProviderHistoryQuery) AsOf(ctx context.Context, time time.Time) (*OauthProviderHistory, error) { + return ophq. + Where(oauthproviderhistory.HistoryTimeLTE(time)). + Order(oauthproviderhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (om *OrgMembership) History() *OrgMembershipHistoryQuery { + historyClient := NewOrgMembershipHistoryClient(om.config) + return historyClient.Query().Where(orgmembershiphistory.Ref(om.ID)) +} + +func (omh *OrgMembershipHistory) Next(ctx context.Context) (*OrgMembershipHistory, error) { + client := NewOrgMembershipHistoryClient(omh.config) + return client.Query(). + Where( + orgmembershiphistory.Ref(omh.Ref), + orgmembershiphistory.HistoryTimeGT(omh.HistoryTime), + ). + Order(orgmembershiphistory.ByHistoryTime()). + First(ctx) +} + +func (omh *OrgMembershipHistory) Prev(ctx context.Context) (*OrgMembershipHistory, error) { + client := NewOrgMembershipHistoryClient(omh.config) + return client.Query(). + Where( + orgmembershiphistory.Ref(omh.Ref), + orgmembershiphistory.HistoryTimeLT(omh.HistoryTime), + ). + Order(orgmembershiphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (omhq *OrgMembershipHistoryQuery) Earliest(ctx context.Context) (*OrgMembershipHistory, error) { + return omhq. + Order(orgmembershiphistory.ByHistoryTime()). + First(ctx) +} + +func (omhq *OrgMembershipHistoryQuery) Latest(ctx context.Context) (*OrgMembershipHistory, error) { + return omhq. + Order(orgmembershiphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (omhq *OrgMembershipHistoryQuery) AsOf(ctx context.Context, time time.Time) (*OrgMembershipHistory, error) { + return omhq. + Where(orgmembershiphistory.HistoryTimeLTE(time)). + Order(orgmembershiphistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (o *Organization) History() *OrganizationHistoryQuery { + historyClient := NewOrganizationHistoryClient(o.config) + return historyClient.Query().Where(organizationhistory.Ref(o.ID)) +} + +func (oh *OrganizationHistory) Next(ctx context.Context) (*OrganizationHistory, error) { + client := NewOrganizationHistoryClient(oh.config) + return client.Query(). + Where( + organizationhistory.Ref(oh.Ref), + organizationhistory.HistoryTimeGT(oh.HistoryTime), + ). + Order(organizationhistory.ByHistoryTime()). + First(ctx) +} + +func (oh *OrganizationHistory) Prev(ctx context.Context) (*OrganizationHistory, error) { + client := NewOrganizationHistoryClient(oh.config) + return client.Query(). + Where( + organizationhistory.Ref(oh.Ref), + organizationhistory.HistoryTimeLT(oh.HistoryTime), + ). + Order(organizationhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ohq *OrganizationHistoryQuery) Earliest(ctx context.Context) (*OrganizationHistory, error) { + return ohq. + Order(organizationhistory.ByHistoryTime()). + First(ctx) +} + +func (ohq *OrganizationHistoryQuery) Latest(ctx context.Context) (*OrganizationHistory, error) { + return ohq. + Order(organizationhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ohq *OrganizationHistoryQuery) AsOf(ctx context.Context, time time.Time) (*OrganizationHistory, error) { + return ohq. + Where(organizationhistory.HistoryTimeLTE(time)). + Order(organizationhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (os *OrganizationSetting) History() *OrganizationSettingHistoryQuery { + historyClient := NewOrganizationSettingHistoryClient(os.config) + return historyClient.Query().Where(organizationsettinghistory.Ref(os.ID)) +} + +func (osh *OrganizationSettingHistory) Next(ctx context.Context) (*OrganizationSettingHistory, error) { + client := NewOrganizationSettingHistoryClient(osh.config) + return client.Query(). + Where( + organizationsettinghistory.Ref(osh.Ref), + organizationsettinghistory.HistoryTimeGT(osh.HistoryTime), + ). + Order(organizationsettinghistory.ByHistoryTime()). + First(ctx) +} + +func (osh *OrganizationSettingHistory) Prev(ctx context.Context) (*OrganizationSettingHistory, error) { + client := NewOrganizationSettingHistoryClient(osh.config) + return client.Query(). + Where( + organizationsettinghistory.Ref(osh.Ref), + organizationsettinghistory.HistoryTimeLT(osh.HistoryTime), + ). + Order(organizationsettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (oshq *OrganizationSettingHistoryQuery) Earliest(ctx context.Context) (*OrganizationSettingHistory, error) { + return oshq. + Order(organizationsettinghistory.ByHistoryTime()). + First(ctx) +} + +func (oshq *OrganizationSettingHistoryQuery) Latest(ctx context.Context) (*OrganizationSettingHistory, error) { + return oshq. + Order(organizationsettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (oshq *OrganizationSettingHistoryQuery) AsOf(ctx context.Context, time time.Time) (*OrganizationSettingHistory, error) { + return oshq. + Where(organizationsettinghistory.HistoryTimeLTE(time)). + Order(organizationsettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (t *Template) History() *TemplateHistoryQuery { + historyClient := NewTemplateHistoryClient(t.config) + return historyClient.Query().Where(templatehistory.Ref(t.ID)) +} + +func (th *TemplateHistory) Next(ctx context.Context) (*TemplateHistory, error) { + client := NewTemplateHistoryClient(th.config) + return client.Query(). + Where( + templatehistory.Ref(th.Ref), + templatehistory.HistoryTimeGT(th.HistoryTime), + ). + Order(templatehistory.ByHistoryTime()). + First(ctx) +} + +func (th *TemplateHistory) Prev(ctx context.Context) (*TemplateHistory, error) { + client := NewTemplateHistoryClient(th.config) + return client.Query(). + Where( + templatehistory.Ref(th.Ref), + templatehistory.HistoryTimeLT(th.HistoryTime), + ). + Order(templatehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (thq *TemplateHistoryQuery) Earliest(ctx context.Context) (*TemplateHistory, error) { + return thq. + Order(templatehistory.ByHistoryTime()). + First(ctx) +} + +func (thq *TemplateHistoryQuery) Latest(ctx context.Context) (*TemplateHistory, error) { + return thq. + Order(templatehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (thq *TemplateHistoryQuery) AsOf(ctx context.Context, time time.Time) (*TemplateHistory, error) { + return thq. + Where(templatehistory.HistoryTimeLTE(time)). + Order(templatehistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (u *User) History() *UserHistoryQuery { + historyClient := NewUserHistoryClient(u.config) + return historyClient.Query().Where(userhistory.Ref(u.ID)) +} + +func (uh *UserHistory) Next(ctx context.Context) (*UserHistory, error) { + client := NewUserHistoryClient(uh.config) + return client.Query(). + Where( + userhistory.Ref(uh.Ref), + userhistory.HistoryTimeGT(uh.HistoryTime), + ). + Order(userhistory.ByHistoryTime()). + First(ctx) +} + +func (uh *UserHistory) Prev(ctx context.Context) (*UserHistory, error) { + client := NewUserHistoryClient(uh.config) + return client.Query(). + Where( + userhistory.Ref(uh.Ref), + userhistory.HistoryTimeLT(uh.HistoryTime), + ). + Order(userhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (uhq *UserHistoryQuery) Earliest(ctx context.Context) (*UserHistory, error) { + return uhq. + Order(userhistory.ByHistoryTime()). + First(ctx) +} + +func (uhq *UserHistoryQuery) Latest(ctx context.Context) (*UserHistory, error) { + return uhq. + Order(userhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (uhq *UserHistoryQuery) AsOf(ctx context.Context, time time.Time) (*UserHistory, error) { + return uhq. + Where(userhistory.HistoryTimeLTE(time)). + Order(userhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (us *UserSetting) History() *UserSettingHistoryQuery { + historyClient := NewUserSettingHistoryClient(us.config) + return historyClient.Query().Where(usersettinghistory.Ref(us.ID)) +} + +func (ush *UserSettingHistory) Next(ctx context.Context) (*UserSettingHistory, error) { + client := NewUserSettingHistoryClient(ush.config) + return client.Query(). + Where( + usersettinghistory.Ref(ush.Ref), + usersettinghistory.HistoryTimeGT(ush.HistoryTime), + ). + Order(usersettinghistory.ByHistoryTime()). + First(ctx) +} + +func (ush *UserSettingHistory) Prev(ctx context.Context) (*UserSettingHistory, error) { + client := NewUserSettingHistoryClient(ush.config) + return client.Query(). + Where( + usersettinghistory.Ref(ush.Ref), + usersettinghistory.HistoryTimeLT(ush.HistoryTime), + ). + Order(usersettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ushq *UserSettingHistoryQuery) Earliest(ctx context.Context) (*UserSettingHistory, error) { + return ushq. + Order(usersettinghistory.ByHistoryTime()). + First(ctx) +} + +func (ushq *UserSettingHistoryQuery) Latest(ctx context.Context) (*UserSettingHistory, error) { + return ushq. + Order(usersettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (ushq *UserSettingHistoryQuery) AsOf(ctx context.Context, time time.Time) (*UserSettingHistory, error) { + return ushq. + Where(usersettinghistory.HistoryTimeLTE(time)). + Order(usersettinghistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (w *Webhook) History() *WebhookHistoryQuery { + historyClient := NewWebhookHistoryClient(w.config) + return historyClient.Query().Where(webhookhistory.Ref(w.ID)) +} + +func (wh *WebhookHistory) Next(ctx context.Context) (*WebhookHistory, error) { + client := NewWebhookHistoryClient(wh.config) + return client.Query(). + Where( + webhookhistory.Ref(wh.Ref), + webhookhistory.HistoryTimeGT(wh.HistoryTime), + ). + Order(webhookhistory.ByHistoryTime()). + First(ctx) +} + +func (wh *WebhookHistory) Prev(ctx context.Context) (*WebhookHistory, error) { + client := NewWebhookHistoryClient(wh.config) + return client.Query(). + Where( + webhookhistory.Ref(wh.Ref), + webhookhistory.HistoryTimeLT(wh.HistoryTime), + ). + Order(webhookhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (whq *WebhookHistoryQuery) Earliest(ctx context.Context) (*WebhookHistory, error) { + return whq. + Order(webhookhistory.ByHistoryTime()). + First(ctx) +} + +func (whq *WebhookHistoryQuery) Latest(ctx context.Context) (*WebhookHistory, error) { + return whq. + Order(webhookhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} + +func (whq *WebhookHistoryQuery) AsOf(ctx context.Context, time time.Time) (*WebhookHistory, error) { + return whq. + Where(webhookhistory.HistoryTimeLTE(time)). + Order(webhookhistory.ByHistoryTime(sql.OrderDesc())). + First(ctx) +} diff --git a/internal/ent/generated/hook/hook.go b/internal/ent/generated/hook/hook.go new file mode 100644 index 0000000..5f15259 --- /dev/null +++ b/internal/ent/generated/hook/hook.go @@ -0,0 +1,871 @@ +// Code generated by ent, DO NOT EDIT. + +package hook + +import ( + "context" + "fmt" + + "github.com/theopenlane/core/internal/ent/generated" +) + +// The APITokenFunc type is an adapter to allow the use of ordinary +// function as APIToken mutator. +type APITokenFunc func(context.Context, *generated.APITokenMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f APITokenFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.APITokenMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.APITokenMutation", m) +} + +// The ContactFunc type is an adapter to allow the use of ordinary +// function as Contact mutator. +type ContactFunc func(context.Context, *generated.ContactMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f ContactFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.ContactMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.ContactMutation", m) +} + +// The ContactHistoryFunc type is an adapter to allow the use of ordinary +// function as ContactHistory mutator. +type ContactHistoryFunc func(context.Context, *generated.ContactHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f ContactHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.ContactHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.ContactHistoryMutation", m) +} + +// The DocumentDataFunc type is an adapter to allow the use of ordinary +// function as DocumentData mutator. +type DocumentDataFunc func(context.Context, *generated.DocumentDataMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f DocumentDataFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.DocumentDataMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.DocumentDataMutation", m) +} + +// The DocumentDataHistoryFunc type is an adapter to allow the use of ordinary +// function as DocumentDataHistory mutator. +type DocumentDataHistoryFunc func(context.Context, *generated.DocumentDataHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f DocumentDataHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.DocumentDataHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.DocumentDataHistoryMutation", m) +} + +// The EmailVerificationTokenFunc type is an adapter to allow the use of ordinary +// function as EmailVerificationToken mutator. +type EmailVerificationTokenFunc func(context.Context, *generated.EmailVerificationTokenMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EmailVerificationTokenFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EmailVerificationTokenMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EmailVerificationTokenMutation", m) +} + +// The EntitlementFunc type is an adapter to allow the use of ordinary +// function as Entitlement mutator. +type EntitlementFunc func(context.Context, *generated.EntitlementMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntitlementFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntitlementMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntitlementMutation", m) +} + +// The EntitlementHistoryFunc type is an adapter to allow the use of ordinary +// function as EntitlementHistory mutator. +type EntitlementHistoryFunc func(context.Context, *generated.EntitlementHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntitlementHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntitlementHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntitlementHistoryMutation", m) +} + +// The EntitlementPlanFunc type is an adapter to allow the use of ordinary +// function as EntitlementPlan mutator. +type EntitlementPlanFunc func(context.Context, *generated.EntitlementPlanMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntitlementPlanFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntitlementPlanMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntitlementPlanMutation", m) +} + +// The EntitlementPlanFeatureFunc type is an adapter to allow the use of ordinary +// function as EntitlementPlanFeature mutator. +type EntitlementPlanFeatureFunc func(context.Context, *generated.EntitlementPlanFeatureMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntitlementPlanFeatureFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntitlementPlanFeatureMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntitlementPlanFeatureMutation", m) +} + +// The EntitlementPlanFeatureHistoryFunc type is an adapter to allow the use of ordinary +// function as EntitlementPlanFeatureHistory mutator. +type EntitlementPlanFeatureHistoryFunc func(context.Context, *generated.EntitlementPlanFeatureHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntitlementPlanFeatureHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntitlementPlanFeatureHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntitlementPlanFeatureHistoryMutation", m) +} + +// The EntitlementPlanHistoryFunc type is an adapter to allow the use of ordinary +// function as EntitlementPlanHistory mutator. +type EntitlementPlanHistoryFunc func(context.Context, *generated.EntitlementPlanHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntitlementPlanHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntitlementPlanHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntitlementPlanHistoryMutation", m) +} + +// The EntityFunc type is an adapter to allow the use of ordinary +// function as Entity mutator. +type EntityFunc func(context.Context, *generated.EntityMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntityFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntityMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntityMutation", m) +} + +// The EntityHistoryFunc type is an adapter to allow the use of ordinary +// function as EntityHistory mutator. +type EntityHistoryFunc func(context.Context, *generated.EntityHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntityHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntityHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntityHistoryMutation", m) +} + +// The EntityTypeFunc type is an adapter to allow the use of ordinary +// function as EntityType mutator. +type EntityTypeFunc func(context.Context, *generated.EntityTypeMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntityTypeFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntityTypeMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntityTypeMutation", m) +} + +// The EntityTypeHistoryFunc type is an adapter to allow the use of ordinary +// function as EntityTypeHistory mutator. +type EntityTypeHistoryFunc func(context.Context, *generated.EntityTypeHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EntityTypeHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EntityTypeHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EntityTypeHistoryMutation", m) +} + +// The EventFunc type is an adapter to allow the use of ordinary +// function as Event mutator. +type EventFunc func(context.Context, *generated.EventMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EventFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EventMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EventMutation", m) +} + +// The EventHistoryFunc type is an adapter to allow the use of ordinary +// function as EventHistory mutator. +type EventHistoryFunc func(context.Context, *generated.EventHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f EventHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.EventHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.EventHistoryMutation", m) +} + +// The FeatureFunc type is an adapter to allow the use of ordinary +// function as Feature mutator. +type FeatureFunc func(context.Context, *generated.FeatureMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f FeatureFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.FeatureMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.FeatureMutation", m) +} + +// The FeatureHistoryFunc type is an adapter to allow the use of ordinary +// function as FeatureHistory mutator. +type FeatureHistoryFunc func(context.Context, *generated.FeatureHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f FeatureHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.FeatureHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.FeatureHistoryMutation", m) +} + +// The FileFunc type is an adapter to allow the use of ordinary +// function as File mutator. +type FileFunc func(context.Context, *generated.FileMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f FileFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.FileMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.FileMutation", m) +} + +// The FileHistoryFunc type is an adapter to allow the use of ordinary +// function as FileHistory mutator. +type FileHistoryFunc func(context.Context, *generated.FileHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f FileHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.FileHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.FileHistoryMutation", m) +} + +// The GroupFunc type is an adapter to allow the use of ordinary +// function as Group mutator. +type GroupFunc func(context.Context, *generated.GroupMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f GroupFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.GroupMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.GroupMutation", m) +} + +// The GroupHistoryFunc type is an adapter to allow the use of ordinary +// function as GroupHistory mutator. +type GroupHistoryFunc func(context.Context, *generated.GroupHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f GroupHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.GroupHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.GroupHistoryMutation", m) +} + +// The GroupMembershipFunc type is an adapter to allow the use of ordinary +// function as GroupMembership mutator. +type GroupMembershipFunc func(context.Context, *generated.GroupMembershipMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f GroupMembershipFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.GroupMembershipMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.GroupMembershipMutation", m) +} + +// The GroupMembershipHistoryFunc type is an adapter to allow the use of ordinary +// function as GroupMembershipHistory mutator. +type GroupMembershipHistoryFunc func(context.Context, *generated.GroupMembershipHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f GroupMembershipHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.GroupMembershipHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.GroupMembershipHistoryMutation", m) +} + +// The GroupSettingFunc type is an adapter to allow the use of ordinary +// function as GroupSetting mutator. +type GroupSettingFunc func(context.Context, *generated.GroupSettingMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f GroupSettingFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.GroupSettingMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.GroupSettingMutation", m) +} + +// The GroupSettingHistoryFunc type is an adapter to allow the use of ordinary +// function as GroupSettingHistory mutator. +type GroupSettingHistoryFunc func(context.Context, *generated.GroupSettingHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f GroupSettingHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.GroupSettingHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.GroupSettingHistoryMutation", m) +} + +// The HushFunc type is an adapter to allow the use of ordinary +// function as Hush mutator. +type HushFunc func(context.Context, *generated.HushMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f HushFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.HushMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.HushMutation", m) +} + +// The HushHistoryFunc type is an adapter to allow the use of ordinary +// function as HushHistory mutator. +type HushHistoryFunc func(context.Context, *generated.HushHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f HushHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.HushHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.HushHistoryMutation", m) +} + +// The IntegrationFunc type is an adapter to allow the use of ordinary +// function as Integration mutator. +type IntegrationFunc func(context.Context, *generated.IntegrationMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f IntegrationFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.IntegrationMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.IntegrationMutation", m) +} + +// The IntegrationHistoryFunc type is an adapter to allow the use of ordinary +// function as IntegrationHistory mutator. +type IntegrationHistoryFunc func(context.Context, *generated.IntegrationHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f IntegrationHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.IntegrationHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.IntegrationHistoryMutation", m) +} + +// The InviteFunc type is an adapter to allow the use of ordinary +// function as Invite mutator. +type InviteFunc func(context.Context, *generated.InviteMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f InviteFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.InviteMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.InviteMutation", m) +} + +// The NoteFunc type is an adapter to allow the use of ordinary +// function as Note mutator. +type NoteFunc func(context.Context, *generated.NoteMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f NoteFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.NoteMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.NoteMutation", m) +} + +// The NoteHistoryFunc type is an adapter to allow the use of ordinary +// function as NoteHistory mutator. +type NoteHistoryFunc func(context.Context, *generated.NoteHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f NoteHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.NoteHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.NoteHistoryMutation", m) +} + +// The OauthProviderFunc type is an adapter to allow the use of ordinary +// function as OauthProvider mutator. +type OauthProviderFunc func(context.Context, *generated.OauthProviderMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OauthProviderFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OauthProviderMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OauthProviderMutation", m) +} + +// The OauthProviderHistoryFunc type is an adapter to allow the use of ordinary +// function as OauthProviderHistory mutator. +type OauthProviderHistoryFunc func(context.Context, *generated.OauthProviderHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OauthProviderHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OauthProviderHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OauthProviderHistoryMutation", m) +} + +// The OhAuthTooTokenFunc type is an adapter to allow the use of ordinary +// function as OhAuthTooToken mutator. +type OhAuthTooTokenFunc func(context.Context, *generated.OhAuthTooTokenMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OhAuthTooTokenFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OhAuthTooTokenMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OhAuthTooTokenMutation", m) +} + +// The OrgMembershipFunc type is an adapter to allow the use of ordinary +// function as OrgMembership mutator. +type OrgMembershipFunc func(context.Context, *generated.OrgMembershipMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OrgMembershipFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OrgMembershipMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OrgMembershipMutation", m) +} + +// The OrgMembershipHistoryFunc type is an adapter to allow the use of ordinary +// function as OrgMembershipHistory mutator. +type OrgMembershipHistoryFunc func(context.Context, *generated.OrgMembershipHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OrgMembershipHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OrgMembershipHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OrgMembershipHistoryMutation", m) +} + +// The OrganizationFunc type is an adapter to allow the use of ordinary +// function as Organization mutator. +type OrganizationFunc func(context.Context, *generated.OrganizationMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OrganizationFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OrganizationMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OrganizationMutation", m) +} + +// The OrganizationHistoryFunc type is an adapter to allow the use of ordinary +// function as OrganizationHistory mutator. +type OrganizationHistoryFunc func(context.Context, *generated.OrganizationHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OrganizationHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OrganizationHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OrganizationHistoryMutation", m) +} + +// The OrganizationSettingFunc type is an adapter to allow the use of ordinary +// function as OrganizationSetting mutator. +type OrganizationSettingFunc func(context.Context, *generated.OrganizationSettingMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OrganizationSettingFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OrganizationSettingMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OrganizationSettingMutation", m) +} + +// The OrganizationSettingHistoryFunc type is an adapter to allow the use of ordinary +// function as OrganizationSettingHistory mutator. +type OrganizationSettingHistoryFunc func(context.Context, *generated.OrganizationSettingHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f OrganizationSettingHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.OrganizationSettingHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.OrganizationSettingHistoryMutation", m) +} + +// The PasswordResetTokenFunc type is an adapter to allow the use of ordinary +// function as PasswordResetToken mutator. +type PasswordResetTokenFunc func(context.Context, *generated.PasswordResetTokenMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f PasswordResetTokenFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.PasswordResetTokenMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.PasswordResetTokenMutation", m) +} + +// The PersonalAccessTokenFunc type is an adapter to allow the use of ordinary +// function as PersonalAccessToken mutator. +type PersonalAccessTokenFunc func(context.Context, *generated.PersonalAccessTokenMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f PersonalAccessTokenFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.PersonalAccessTokenMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.PersonalAccessTokenMutation", m) +} + +// The SubscriberFunc type is an adapter to allow the use of ordinary +// function as Subscriber mutator. +type SubscriberFunc func(context.Context, *generated.SubscriberMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f SubscriberFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.SubscriberMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.SubscriberMutation", m) +} + +// The TFASettingFunc type is an adapter to allow the use of ordinary +// function as TFASetting mutator. +type TFASettingFunc func(context.Context, *generated.TFASettingMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f TFASettingFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.TFASettingMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.TFASettingMutation", m) +} + +// The TemplateFunc type is an adapter to allow the use of ordinary +// function as Template mutator. +type TemplateFunc func(context.Context, *generated.TemplateMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f TemplateFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.TemplateMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.TemplateMutation", m) +} + +// The TemplateHistoryFunc type is an adapter to allow the use of ordinary +// function as TemplateHistory mutator. +type TemplateHistoryFunc func(context.Context, *generated.TemplateHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f TemplateHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.TemplateHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.TemplateHistoryMutation", m) +} + +// The UserFunc type is an adapter to allow the use of ordinary +// function as User mutator. +type UserFunc func(context.Context, *generated.UserMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f UserFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.UserMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.UserMutation", m) +} + +// The UserHistoryFunc type is an adapter to allow the use of ordinary +// function as UserHistory mutator. +type UserHistoryFunc func(context.Context, *generated.UserHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f UserHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.UserHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.UserHistoryMutation", m) +} + +// The UserSettingFunc type is an adapter to allow the use of ordinary +// function as UserSetting mutator. +type UserSettingFunc func(context.Context, *generated.UserSettingMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f UserSettingFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.UserSettingMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.UserSettingMutation", m) +} + +// The UserSettingHistoryFunc type is an adapter to allow the use of ordinary +// function as UserSettingHistory mutator. +type UserSettingHistoryFunc func(context.Context, *generated.UserSettingHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f UserSettingHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.UserSettingHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.UserSettingHistoryMutation", m) +} + +// The WebauthnFunc type is an adapter to allow the use of ordinary +// function as Webauthn mutator. +type WebauthnFunc func(context.Context, *generated.WebauthnMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f WebauthnFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.WebauthnMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.WebauthnMutation", m) +} + +// The WebhookFunc type is an adapter to allow the use of ordinary +// function as Webhook mutator. +type WebhookFunc func(context.Context, *generated.WebhookMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f WebhookFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.WebhookMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.WebhookMutation", m) +} + +// The WebhookHistoryFunc type is an adapter to allow the use of ordinary +// function as WebhookHistory mutator. +type WebhookHistoryFunc func(context.Context, *generated.WebhookHistoryMutation) (generated.Value, error) + +// Mutate calls f(ctx, m). +func (f WebhookHistoryFunc) Mutate(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if mv, ok := m.(*generated.WebhookHistoryMutation); ok { + return f(ctx, mv) + } + return nil, fmt.Errorf("unexpected mutation type %T. expect *generated.WebhookHistoryMutation", m) +} + +// Condition is a hook condition function. +type Condition func(context.Context, generated.Mutation) bool + +// And groups conditions with the AND operator. +func And(first, second Condition, rest ...Condition) Condition { + return func(ctx context.Context, m generated.Mutation) bool { + if !first(ctx, m) || !second(ctx, m) { + return false + } + for _, cond := range rest { + if !cond(ctx, m) { + return false + } + } + return true + } +} + +// Or groups conditions with the OR operator. +func Or(first, second Condition, rest ...Condition) Condition { + return func(ctx context.Context, m generated.Mutation) bool { + if first(ctx, m) || second(ctx, m) { + return true + } + for _, cond := range rest { + if cond(ctx, m) { + return true + } + } + return false + } +} + +// Not negates a given condition. +func Not(cond Condition) Condition { + return func(ctx context.Context, m generated.Mutation) bool { + return !cond(ctx, m) + } +} + +// HasOp is a condition testing mutation operation. +func HasOp(op generated.Op) Condition { + return func(_ context.Context, m generated.Mutation) bool { + return m.Op().Is(op) + } +} + +// HasAddedFields is a condition validating `.AddedField` on fields. +func HasAddedFields(field string, fields ...string) Condition { + return func(_ context.Context, m generated.Mutation) bool { + if _, exists := m.AddedField(field); !exists { + return false + } + for _, field := range fields { + if _, exists := m.AddedField(field); !exists { + return false + } + } + return true + } +} + +// HasClearedFields is a condition validating `.FieldCleared` on fields. +func HasClearedFields(field string, fields ...string) Condition { + return func(_ context.Context, m generated.Mutation) bool { + if exists := m.FieldCleared(field); !exists { + return false + } + for _, field := range fields { + if exists := m.FieldCleared(field); !exists { + return false + } + } + return true + } +} + +// HasFields is a condition validating `.Field` on fields. +func HasFields(field string, fields ...string) Condition { + return func(_ context.Context, m generated.Mutation) bool { + if _, exists := m.Field(field); !exists { + return false + } + for _, field := range fields { + if _, exists := m.Field(field); !exists { + return false + } + } + return true + } +} + +// If executes the given hook under condition. +// +// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...))) +func If(hk generated.Hook, cond Condition) generated.Hook { + return func(next generated.Mutator) generated.Mutator { + return generated.MutateFunc(func(ctx context.Context, m generated.Mutation) (generated.Value, error) { + if cond(ctx, m) { + return hk(next).Mutate(ctx, m) + } + return next.Mutate(ctx, m) + }) + } +} + +// On executes the given hook only for the given operation. +// +// hook.On(Log, generated.Delete|generated.Create) +func On(hk generated.Hook, op generated.Op) generated.Hook { + return If(hk, HasOp(op)) +} + +// Unless skips the given hook only for the given operation. +// +// hook.Unless(Log, generated.Update|generated.UpdateOne) +func Unless(hk generated.Hook, op generated.Op) generated.Hook { + return If(hk, Not(HasOp(op))) +} + +// FixedError is a hook returning a fixed error. +func FixedError(err error) generated.Hook { + return func(generated.Mutator) generated.Mutator { + return generated.MutateFunc(func(context.Context, generated.Mutation) (generated.Value, error) { + return nil, err + }) + } +} + +// Reject returns a hook that rejects all operations that match op. +// +// func (T) Hooks() []generated.Hook { +// return []generated.Hook{ +// Reject(generated.Delete|generated.Update), +// } +// } +func Reject(op generated.Op) generated.Hook { + hk := FixedError(fmt.Errorf("%s operation is not allowed", op)) + return On(hk, op) +} + +// Chain acts as a list of hooks and is effectively immutable. +// Once created, it will always hold the same set of hooks in the same order. +type Chain struct { + hooks []generated.Hook +} + +// NewChain creates a new chain of hooks. +func NewChain(hooks ...generated.Hook) Chain { + return Chain{append([]generated.Hook(nil), hooks...)} +} + +// Hook chains the list of hooks and returns the final hook. +func (c Chain) Hook() generated.Hook { + return func(mutator generated.Mutator) generated.Mutator { + for i := len(c.hooks) - 1; i >= 0; i-- { + mutator = c.hooks[i](mutator) + } + return mutator + } +} + +// Append extends a chain, adding the specified hook +// as the last ones in the mutation flow. +func (c Chain) Append(hooks ...generated.Hook) Chain { + newHooks := make([]generated.Hook, 0, len(c.hooks)+len(hooks)) + newHooks = append(newHooks, c.hooks...) + newHooks = append(newHooks, hooks...) + return Chain{newHooks} +} + +// Extend extends a chain, adding the specified chain +// as the last ones in the mutation flow. +func (c Chain) Extend(chain Chain) Chain { + return c.Append(chain.hooks...) +} diff --git a/internal/ent/generated/hush.go b/internal/ent/generated/hush.go new file mode 100644 index 0000000..f1aec18 --- /dev/null +++ b/internal/ent/generated/hush.go @@ -0,0 +1,360 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/hush" +) + +// Hush is the model entity for the Hush schema. +type Hush struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name,omitempty"` + // a description of the hush value or purpose, such as github PAT + Description string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName string `json:"secret_name,omitempty"` + // the secret value + SecretValue string `json:"-"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the HushQuery when eager-loading is set. + Edges HushEdges `json:"edges"` + selectValues sql.SelectValues +} + +// HushEdges holds the relations/edges for other nodes in the graph. +type HushEdges struct { + // the integration associated with the secret + Integrations []*Integration `json:"integrations,omitempty"` + // Organization holds the value of the organization edge. + Organization []*Organization `json:"organization,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [3]bool + // totalCount holds the count of the edges above. + totalCount [3]map[string]int + + namedIntegrations map[string][]*Integration + namedOrganization map[string][]*Organization + namedEvents map[string][]*Event +} + +// IntegrationsOrErr returns the Integrations value or an error if the edge +// was not loaded in eager-loading. +func (e HushEdges) IntegrationsOrErr() ([]*Integration, error) { + if e.loadedTypes[0] { + return e.Integrations, nil + } + return nil, &NotLoadedError{edge: "integrations"} +} + +// OrganizationOrErr returns the Organization value or an error if the edge +// was not loaded in eager-loading. +func (e HushEdges) OrganizationOrErr() ([]*Organization, error) { + if e.loadedTypes[1] { + return e.Organization, nil + } + return nil, &NotLoadedError{edge: "organization"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e HushEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[2] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Hush) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case hush.FieldID, hush.FieldCreatedBy, hush.FieldUpdatedBy, hush.FieldMappingID, hush.FieldDeletedBy, hush.FieldName, hush.FieldDescription, hush.FieldKind, hush.FieldSecretName, hush.FieldSecretValue: + values[i] = new(sql.NullString) + case hush.FieldCreatedAt, hush.FieldUpdatedAt, hush.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Hush fields. +func (h *Hush) 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 hush.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + h.ID = value.String + } + case hush.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + h.CreatedAt = value.Time + } + case hush.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + h.UpdatedAt = value.Time + } + case hush.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + h.CreatedBy = value.String + } + case hush.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + h.UpdatedBy = value.String + } + case hush.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + h.MappingID = value.String + } + case hush.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + h.DeletedAt = value.Time + } + case hush.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + h.DeletedBy = value.String + } + case hush.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + h.Name = value.String + } + case hush.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + h.Description = value.String + } + case hush.FieldKind: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field kind", values[i]) + } else if value.Valid { + h.Kind = value.String + } + case hush.FieldSecretName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field secret_name", values[i]) + } else if value.Valid { + h.SecretName = value.String + } + case hush.FieldSecretValue: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field secret_value", values[i]) + } else if value.Valid { + h.SecretValue = value.String + } + default: + h.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Hush. +// This includes values selected through modifiers, order, etc. +func (h *Hush) Value(name string) (ent.Value, error) { + return h.selectValues.Get(name) +} + +// QueryIntegrations queries the "integrations" edge of the Hush entity. +func (h *Hush) QueryIntegrations() *IntegrationQuery { + return NewHushClient(h.config).QueryIntegrations(h) +} + +// QueryOrganization queries the "organization" edge of the Hush entity. +func (h *Hush) QueryOrganization() *OrganizationQuery { + return NewHushClient(h.config).QueryOrganization(h) +} + +// QueryEvents queries the "events" edge of the Hush entity. +func (h *Hush) QueryEvents() *EventQuery { + return NewHushClient(h.config).QueryEvents(h) +} + +// Update returns a builder for updating this Hush. +// Note that you need to call Hush.Unwrap() before calling this method if this Hush +// was returned from a transaction, and the transaction was committed or rolled back. +func (h *Hush) Update() *HushUpdateOne { + return NewHushClient(h.config).UpdateOne(h) +} + +// Unwrap unwraps the Hush 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 (h *Hush) Unwrap() *Hush { + _tx, ok := h.config.driver.(*txDriver) + if !ok { + panic("generated: Hush is not a transactional entity") + } + h.config.driver = _tx.drv + return h +} + +// String implements the fmt.Stringer. +func (h *Hush) String() string { + var builder strings.Builder + builder.WriteString("Hush(") + builder.WriteString(fmt.Sprintf("id=%v, ", h.ID)) + builder.WriteString("created_at=") + builder.WriteString(h.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(h.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(h.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(h.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(h.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(h.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(h.DeletedBy) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(h.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(h.Description) + builder.WriteString(", ") + builder.WriteString("kind=") + builder.WriteString(h.Kind) + builder.WriteString(", ") + builder.WriteString("secret_name=") + builder.WriteString(h.SecretName) + builder.WriteString(", ") + builder.WriteString("secret_value=") + builder.WriteByte(')') + return builder.String() +} + +// NamedIntegrations returns the Integrations named value or an error if the edge was not +// loaded in eager-loading with this name. +func (h *Hush) NamedIntegrations(name string) ([]*Integration, error) { + if h.Edges.namedIntegrations == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := h.Edges.namedIntegrations[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (h *Hush) appendNamedIntegrations(name string, edges ...*Integration) { + if h.Edges.namedIntegrations == nil { + h.Edges.namedIntegrations = make(map[string][]*Integration) + } + if len(edges) == 0 { + h.Edges.namedIntegrations[name] = []*Integration{} + } else { + h.Edges.namedIntegrations[name] = append(h.Edges.namedIntegrations[name], edges...) + } +} + +// NamedOrganization returns the Organization named value or an error if the edge was not +// loaded in eager-loading with this name. +func (h *Hush) NamedOrganization(name string) ([]*Organization, error) { + if h.Edges.namedOrganization == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := h.Edges.namedOrganization[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (h *Hush) appendNamedOrganization(name string, edges ...*Organization) { + if h.Edges.namedOrganization == nil { + h.Edges.namedOrganization = make(map[string][]*Organization) + } + if len(edges) == 0 { + h.Edges.namedOrganization[name] = []*Organization{} + } else { + h.Edges.namedOrganization[name] = append(h.Edges.namedOrganization[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (h *Hush) NamedEvents(name string) ([]*Event, error) { + if h.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := h.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (h *Hush) appendNamedEvents(name string, edges ...*Event) { + if h.Edges.namedEvents == nil { + h.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + h.Edges.namedEvents[name] = []*Event{} + } else { + h.Edges.namedEvents[name] = append(h.Edges.namedEvents[name], edges...) + } +} + +// Hushes is a parsable slice of Hush. +type Hushes []*Hush diff --git a/internal/ent/generated/hush/hush.go b/internal/ent/generated/hush/hush.go new file mode 100644 index 0000000..8ef5389 --- /dev/null +++ b/internal/ent/generated/hush/hush.go @@ -0,0 +1,257 @@ +// Code generated by ent, DO NOT EDIT. + +package hush + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the hush type in the database. + Label = "hush" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldKind holds the string denoting the kind field in the database. + FieldKind = "kind" + // FieldSecretName holds the string denoting the secret_name field in the database. + FieldSecretName = "secret_name" + // FieldSecretValue holds the string denoting the secret_value field in the database. + FieldSecretValue = "secret_value" + // EdgeIntegrations holds the string denoting the integrations edge name in mutations. + EdgeIntegrations = "integrations" + // EdgeOrganization holds the string denoting the organization edge name in mutations. + EdgeOrganization = "organization" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the hush in the database. + Table = "hushes" + // IntegrationsTable is the table that holds the integrations relation/edge. The primary key declared below. + IntegrationsTable = "integration_secrets" + // IntegrationsInverseTable is the table name for the Integration entity. + // It exists in this package in order to avoid circular dependency with the "integration" package. + IntegrationsInverseTable = "integrations" + // OrganizationTable is the table that holds the organization relation/edge. The primary key declared below. + OrganizationTable = "organization_secrets" + // OrganizationInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationInverseTable = "organizations" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "hush_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for hush fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldName, + FieldDescription, + FieldKind, + FieldSecretName, + FieldSecretValue, +} + +var ( + // IntegrationsPrimaryKey and IntegrationsColumn2 are the table columns denoting the + // primary key for the integrations relation (M2M). + IntegrationsPrimaryKey = []string{"integration_id", "hush_id"} + // OrganizationPrimaryKey and OrganizationColumn2 are the table columns denoting the + // primary key for the organization relation (M2M). + OrganizationPrimaryKey = []string{"organization_id", "hush_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"hush_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [3]ent.Hook + Interceptors [2]ent.Interceptor + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Hush queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByKind orders the results by the kind field. +func ByKind(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldKind, opts...).ToFunc() +} + +// BySecretName orders the results by the secret_name field. +func BySecretName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSecretName, opts...).ToFunc() +} + +// BySecretValue orders the results by the secret_value field. +func BySecretValue(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSecretValue, opts...).ToFunc() +} + +// ByIntegrationsCount orders the results by integrations count. +func ByIntegrationsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newIntegrationsStep(), opts...) + } +} + +// ByIntegrations orders the results by integrations terms. +func ByIntegrations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newIntegrationsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOrganizationCount orders the results by organization count. +func ByOrganizationCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrganizationStep(), opts...) + } +} + +// ByOrganization orders the results by organization terms. +func ByOrganization(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newIntegrationsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(IntegrationsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationsTable, IntegrationsPrimaryKey...), + ) +} +func newOrganizationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationTable, OrganizationPrimaryKey...), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} diff --git a/internal/ent/generated/hush/where.go b/internal/ent/generated/hush/where.go new file mode 100644 index 0000000..f9e2161 --- /dev/null +++ b/internal/ent/generated/hush/where.go @@ -0,0 +1,1035 @@ +// Code generated by ent, DO NOT EDIT. + +package hush + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldDeletedBy, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldDescription, v)) +} + +// Kind applies equality check predicate on the "kind" field. It's identical to KindEQ. +func Kind(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldKind, v)) +} + +// SecretName applies equality check predicate on the "secret_name" field. It's identical to SecretNameEQ. +func SecretName(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldSecretName, v)) +} + +// SecretValue applies equality check predicate on the "secret_value" field. It's identical to SecretValueEQ. +func SecretValue(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldSecretValue, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldDescription, v)) +} + +// KindEQ applies the EQ predicate on the "kind" field. +func KindEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldKind, v)) +} + +// KindNEQ applies the NEQ predicate on the "kind" field. +func KindNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldKind, v)) +} + +// KindIn applies the In predicate on the "kind" field. +func KindIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldKind, vs...)) +} + +// KindNotIn applies the NotIn predicate on the "kind" field. +func KindNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldKind, vs...)) +} + +// KindGT applies the GT predicate on the "kind" field. +func KindGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldKind, v)) +} + +// KindGTE applies the GTE predicate on the "kind" field. +func KindGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldKind, v)) +} + +// KindLT applies the LT predicate on the "kind" field. +func KindLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldKind, v)) +} + +// KindLTE applies the LTE predicate on the "kind" field. +func KindLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldKind, v)) +} + +// KindContains applies the Contains predicate on the "kind" field. +func KindContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldKind, v)) +} + +// KindHasPrefix applies the HasPrefix predicate on the "kind" field. +func KindHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldKind, v)) +} + +// KindHasSuffix applies the HasSuffix predicate on the "kind" field. +func KindHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldKind, v)) +} + +// KindIsNil applies the IsNil predicate on the "kind" field. +func KindIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldKind)) +} + +// KindNotNil applies the NotNil predicate on the "kind" field. +func KindNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldKind)) +} + +// KindEqualFold applies the EqualFold predicate on the "kind" field. +func KindEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldKind, v)) +} + +// KindContainsFold applies the ContainsFold predicate on the "kind" field. +func KindContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldKind, v)) +} + +// SecretNameEQ applies the EQ predicate on the "secret_name" field. +func SecretNameEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldSecretName, v)) +} + +// SecretNameNEQ applies the NEQ predicate on the "secret_name" field. +func SecretNameNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldSecretName, v)) +} + +// SecretNameIn applies the In predicate on the "secret_name" field. +func SecretNameIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldSecretName, vs...)) +} + +// SecretNameNotIn applies the NotIn predicate on the "secret_name" field. +func SecretNameNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldSecretName, vs...)) +} + +// SecretNameGT applies the GT predicate on the "secret_name" field. +func SecretNameGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldSecretName, v)) +} + +// SecretNameGTE applies the GTE predicate on the "secret_name" field. +func SecretNameGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldSecretName, v)) +} + +// SecretNameLT applies the LT predicate on the "secret_name" field. +func SecretNameLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldSecretName, v)) +} + +// SecretNameLTE applies the LTE predicate on the "secret_name" field. +func SecretNameLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldSecretName, v)) +} + +// SecretNameContains applies the Contains predicate on the "secret_name" field. +func SecretNameContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldSecretName, v)) +} + +// SecretNameHasPrefix applies the HasPrefix predicate on the "secret_name" field. +func SecretNameHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldSecretName, v)) +} + +// SecretNameHasSuffix applies the HasSuffix predicate on the "secret_name" field. +func SecretNameHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldSecretName, v)) +} + +// SecretNameIsNil applies the IsNil predicate on the "secret_name" field. +func SecretNameIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldSecretName)) +} + +// SecretNameNotNil applies the NotNil predicate on the "secret_name" field. +func SecretNameNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldSecretName)) +} + +// SecretNameEqualFold applies the EqualFold predicate on the "secret_name" field. +func SecretNameEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldSecretName, v)) +} + +// SecretNameContainsFold applies the ContainsFold predicate on the "secret_name" field. +func SecretNameContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldSecretName, v)) +} + +// SecretValueEQ applies the EQ predicate on the "secret_value" field. +func SecretValueEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldEQ(FieldSecretValue, v)) +} + +// SecretValueNEQ applies the NEQ predicate on the "secret_value" field. +func SecretValueNEQ(v string) predicate.Hush { + return predicate.Hush(sql.FieldNEQ(FieldSecretValue, v)) +} + +// SecretValueIn applies the In predicate on the "secret_value" field. +func SecretValueIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldIn(FieldSecretValue, vs...)) +} + +// SecretValueNotIn applies the NotIn predicate on the "secret_value" field. +func SecretValueNotIn(vs ...string) predicate.Hush { + return predicate.Hush(sql.FieldNotIn(FieldSecretValue, vs...)) +} + +// SecretValueGT applies the GT predicate on the "secret_value" field. +func SecretValueGT(v string) predicate.Hush { + return predicate.Hush(sql.FieldGT(FieldSecretValue, v)) +} + +// SecretValueGTE applies the GTE predicate on the "secret_value" field. +func SecretValueGTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldGTE(FieldSecretValue, v)) +} + +// SecretValueLT applies the LT predicate on the "secret_value" field. +func SecretValueLT(v string) predicate.Hush { + return predicate.Hush(sql.FieldLT(FieldSecretValue, v)) +} + +// SecretValueLTE applies the LTE predicate on the "secret_value" field. +func SecretValueLTE(v string) predicate.Hush { + return predicate.Hush(sql.FieldLTE(FieldSecretValue, v)) +} + +// SecretValueContains applies the Contains predicate on the "secret_value" field. +func SecretValueContains(v string) predicate.Hush { + return predicate.Hush(sql.FieldContains(FieldSecretValue, v)) +} + +// SecretValueHasPrefix applies the HasPrefix predicate on the "secret_value" field. +func SecretValueHasPrefix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasPrefix(FieldSecretValue, v)) +} + +// SecretValueHasSuffix applies the HasSuffix predicate on the "secret_value" field. +func SecretValueHasSuffix(v string) predicate.Hush { + return predicate.Hush(sql.FieldHasSuffix(FieldSecretValue, v)) +} + +// SecretValueIsNil applies the IsNil predicate on the "secret_value" field. +func SecretValueIsNil() predicate.Hush { + return predicate.Hush(sql.FieldIsNull(FieldSecretValue)) +} + +// SecretValueNotNil applies the NotNil predicate on the "secret_value" field. +func SecretValueNotNil() predicate.Hush { + return predicate.Hush(sql.FieldNotNull(FieldSecretValue)) +} + +// SecretValueEqualFold applies the EqualFold predicate on the "secret_value" field. +func SecretValueEqualFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldEqualFold(FieldSecretValue, v)) +} + +// SecretValueContainsFold applies the ContainsFold predicate on the "secret_value" field. +func SecretValueContainsFold(v string) predicate.Hush { + return predicate.Hush(sql.FieldContainsFold(FieldSecretValue, v)) +} + +// HasIntegrations applies the HasEdge predicate on the "integrations" edge. +func HasIntegrations() predicate.Hush { + return predicate.Hush(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationsTable, IntegrationsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationSecrets + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasIntegrationsWith applies the HasEdge predicate on the "integrations" edge with a given conditions (other predicates). +func HasIntegrationsWith(preds ...predicate.Integration) predicate.Hush { + return predicate.Hush(func(s *sql.Selector) { + step := newIntegrationsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationSecrets + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrganization applies the HasEdge predicate on the "organization" edge. +func HasOrganization() predicate.Hush { + return predicate.Hush(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationTable, OrganizationPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSecrets + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationWith applies the HasEdge predicate on the "organization" edge with a given conditions (other predicates). +func HasOrganizationWith(preds ...predicate.Organization) predicate.Hush { + return predicate.Hush(func(s *sql.Selector) { + step := newOrganizationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSecrets + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Hush { + return predicate.Hush(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.HushEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Hush { + return predicate.Hush(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.HushEvents + 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.Hush) predicate.Hush { + return predicate.Hush(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Hush) predicate.Hush { + return predicate.Hush(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Hush) predicate.Hush { + return predicate.Hush(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/hush_create.go b/internal/ent/generated/hush_create.go new file mode 100644 index 0000000..89f96cd --- /dev/null +++ b/internal/ent/generated/hush_create.go @@ -0,0 +1,546 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// HushCreate is the builder for creating a Hush entity. +type HushCreate struct { + config + mutation *HushMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (hc *HushCreate) SetCreatedAt(t time.Time) *HushCreate { + hc.mutation.SetCreatedAt(t) + return hc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (hc *HushCreate) SetNillableCreatedAt(t *time.Time) *HushCreate { + if t != nil { + hc.SetCreatedAt(*t) + } + return hc +} + +// SetUpdatedAt sets the "updated_at" field. +func (hc *HushCreate) SetUpdatedAt(t time.Time) *HushCreate { + hc.mutation.SetUpdatedAt(t) + return hc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (hc *HushCreate) SetNillableUpdatedAt(t *time.Time) *HushCreate { + if t != nil { + hc.SetUpdatedAt(*t) + } + return hc +} + +// SetCreatedBy sets the "created_by" field. +func (hc *HushCreate) SetCreatedBy(s string) *HushCreate { + hc.mutation.SetCreatedBy(s) + return hc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (hc *HushCreate) SetNillableCreatedBy(s *string) *HushCreate { + if s != nil { + hc.SetCreatedBy(*s) + } + return hc +} + +// SetUpdatedBy sets the "updated_by" field. +func (hc *HushCreate) SetUpdatedBy(s string) *HushCreate { + hc.mutation.SetUpdatedBy(s) + return hc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (hc *HushCreate) SetNillableUpdatedBy(s *string) *HushCreate { + if s != nil { + hc.SetUpdatedBy(*s) + } + return hc +} + +// SetMappingID sets the "mapping_id" field. +func (hc *HushCreate) SetMappingID(s string) *HushCreate { + hc.mutation.SetMappingID(s) + return hc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (hc *HushCreate) SetNillableMappingID(s *string) *HushCreate { + if s != nil { + hc.SetMappingID(*s) + } + return hc +} + +// SetDeletedAt sets the "deleted_at" field. +func (hc *HushCreate) SetDeletedAt(t time.Time) *HushCreate { + hc.mutation.SetDeletedAt(t) + return hc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (hc *HushCreate) SetNillableDeletedAt(t *time.Time) *HushCreate { + if t != nil { + hc.SetDeletedAt(*t) + } + return hc +} + +// SetDeletedBy sets the "deleted_by" field. +func (hc *HushCreate) SetDeletedBy(s string) *HushCreate { + hc.mutation.SetDeletedBy(s) + return hc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (hc *HushCreate) SetNillableDeletedBy(s *string) *HushCreate { + if s != nil { + hc.SetDeletedBy(*s) + } + return hc +} + +// SetName sets the "name" field. +func (hc *HushCreate) SetName(s string) *HushCreate { + hc.mutation.SetName(s) + return hc +} + +// SetDescription sets the "description" field. +func (hc *HushCreate) SetDescription(s string) *HushCreate { + hc.mutation.SetDescription(s) + return hc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (hc *HushCreate) SetNillableDescription(s *string) *HushCreate { + if s != nil { + hc.SetDescription(*s) + } + return hc +} + +// SetKind sets the "kind" field. +func (hc *HushCreate) SetKind(s string) *HushCreate { + hc.mutation.SetKind(s) + return hc +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (hc *HushCreate) SetNillableKind(s *string) *HushCreate { + if s != nil { + hc.SetKind(*s) + } + return hc +} + +// SetSecretName sets the "secret_name" field. +func (hc *HushCreate) SetSecretName(s string) *HushCreate { + hc.mutation.SetSecretName(s) + return hc +} + +// SetNillableSecretName sets the "secret_name" field if the given value is not nil. +func (hc *HushCreate) SetNillableSecretName(s *string) *HushCreate { + if s != nil { + hc.SetSecretName(*s) + } + return hc +} + +// SetSecretValue sets the "secret_value" field. +func (hc *HushCreate) SetSecretValue(s string) *HushCreate { + hc.mutation.SetSecretValue(s) + return hc +} + +// SetNillableSecretValue sets the "secret_value" field if the given value is not nil. +func (hc *HushCreate) SetNillableSecretValue(s *string) *HushCreate { + if s != nil { + hc.SetSecretValue(*s) + } + return hc +} + +// SetID sets the "id" field. +func (hc *HushCreate) SetID(s string) *HushCreate { + hc.mutation.SetID(s) + return hc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (hc *HushCreate) SetNillableID(s *string) *HushCreate { + if s != nil { + hc.SetID(*s) + } + return hc +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (hc *HushCreate) AddIntegrationIDs(ids ...string) *HushCreate { + hc.mutation.AddIntegrationIDs(ids...) + return hc +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (hc *HushCreate) AddIntegrations(i ...*Integration) *HushCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return hc.AddIntegrationIDs(ids...) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (hc *HushCreate) AddOrganizationIDs(ids ...string) *HushCreate { + hc.mutation.AddOrganizationIDs(ids...) + return hc +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (hc *HushCreate) AddOrganization(o ...*Organization) *HushCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return hc.AddOrganizationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (hc *HushCreate) AddEventIDs(ids ...string) *HushCreate { + hc.mutation.AddEventIDs(ids...) + return hc +} + +// AddEvents adds the "events" edges to the Event entity. +func (hc *HushCreate) AddEvents(e ...*Event) *HushCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return hc.AddEventIDs(ids...) +} + +// Mutation returns the HushMutation object of the builder. +func (hc *HushCreate) Mutation() *HushMutation { + return hc.mutation +} + +// Save creates the Hush in the database. +func (hc *HushCreate) Save(ctx context.Context) (*Hush, error) { + if err := hc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, hc.sqlSave, hc.mutation, hc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (hc *HushCreate) SaveX(ctx context.Context) *Hush { + v, err := hc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (hc *HushCreate) Exec(ctx context.Context) error { + _, err := hc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (hc *HushCreate) ExecX(ctx context.Context) { + if err := hc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (hc *HushCreate) defaults() error { + if _, ok := hc.mutation.CreatedAt(); !ok { + if hush.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized hush.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := hush.DefaultCreatedAt() + hc.mutation.SetCreatedAt(v) + } + if _, ok := hc.mutation.UpdatedAt(); !ok { + if hush.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized hush.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := hush.DefaultUpdatedAt() + hc.mutation.SetUpdatedAt(v) + } + if _, ok := hc.mutation.MappingID(); !ok { + if hush.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized hush.DefaultMappingID (forgotten import generated/runtime?)") + } + v := hush.DefaultMappingID() + hc.mutation.SetMappingID(v) + } + if _, ok := hc.mutation.ID(); !ok { + if hush.DefaultID == nil { + return fmt.Errorf("generated: uninitialized hush.DefaultID (forgotten import generated/runtime?)") + } + v := hush.DefaultID() + hc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (hc *HushCreate) check() error { + if _, ok := hc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Hush.mapping_id"`)} + } + if _, ok := hc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "Hush.name"`)} + } + if v, ok := hc.mutation.Name(); ok { + if err := hush.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Hush.name": %w`, err)} + } + } + return nil +} + +func (hc *HushCreate) sqlSave(ctx context.Context) (*Hush, error) { + if err := hc.check(); err != nil { + return nil, err + } + _node, _spec := hc.createSpec() + if err := sqlgraph.CreateNode(ctx, hc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Hush.ID type: %T", _spec.ID.Value) + } + } + hc.mutation.id = &_node.ID + hc.mutation.done = true + return _node, nil +} + +func (hc *HushCreate) createSpec() (*Hush, *sqlgraph.CreateSpec) { + var ( + _node = &Hush{config: hc.config} + _spec = sqlgraph.NewCreateSpec(hush.Table, sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString)) + ) + _spec.Schema = hc.schemaConfig.Hush + if id, ok := hc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := hc.mutation.CreatedAt(); ok { + _spec.SetField(hush.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := hc.mutation.UpdatedAt(); ok { + _spec.SetField(hush.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := hc.mutation.CreatedBy(); ok { + _spec.SetField(hush.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := hc.mutation.UpdatedBy(); ok { + _spec.SetField(hush.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := hc.mutation.MappingID(); ok { + _spec.SetField(hush.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := hc.mutation.DeletedAt(); ok { + _spec.SetField(hush.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := hc.mutation.DeletedBy(); ok { + _spec.SetField(hush.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := hc.mutation.Name(); ok { + _spec.SetField(hush.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := hc.mutation.Description(); ok { + _spec.SetField(hush.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := hc.mutation.Kind(); ok { + _spec.SetField(hush.FieldKind, field.TypeString, value) + _node.Kind = value + } + if value, ok := hc.mutation.SecretName(); ok { + _spec.SetField(hush.FieldSecretName, field.TypeString, value) + _node.SecretName = value + } + if value, ok := hc.mutation.SecretValue(); ok { + _spec.SetField(hush.FieldSecretValue, field.TypeString, value) + _node.SecretValue = value + } + if nodes := hc.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = hc.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := hc.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = hc.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := hc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = hc.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// HushCreateBulk is the builder for creating many Hush entities in bulk. +type HushCreateBulk struct { + config + err error + builders []*HushCreate +} + +// Save creates the Hush entities in the database. +func (hcb *HushCreateBulk) Save(ctx context.Context) ([]*Hush, error) { + if hcb.err != nil { + return nil, hcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(hcb.builders)) + nodes := make([]*Hush, len(hcb.builders)) + mutators := make([]Mutator, len(hcb.builders)) + for i := range hcb.builders { + func(i int, root context.Context) { + builder := hcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*HushMutation) + 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, hcb.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, hcb.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, hcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (hcb *HushCreateBulk) SaveX(ctx context.Context) []*Hush { + v, err := hcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (hcb *HushCreateBulk) Exec(ctx context.Context) error { + _, err := hcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (hcb *HushCreateBulk) ExecX(ctx context.Context) { + if err := hcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/hush_delete.go b/internal/ent/generated/hush_delete.go new file mode 100644 index 0000000..922990f --- /dev/null +++ b/internal/ent/generated/hush_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// HushDelete is the builder for deleting a Hush entity. +type HushDelete struct { + config + hooks []Hook + mutation *HushMutation +} + +// Where appends a list predicates to the HushDelete builder. +func (hd *HushDelete) Where(ps ...predicate.Hush) *HushDelete { + hd.mutation.Where(ps...) + return hd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (hd *HushDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, hd.sqlExec, hd.mutation, hd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (hd *HushDelete) ExecX(ctx context.Context) int { + n, err := hd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (hd *HushDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(hush.Table, sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString)) + _spec.Node.Schema = hd.schemaConfig.Hush + ctx = internal.NewSchemaConfigContext(ctx, hd.schemaConfig) + if ps := hd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, hd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + hd.mutation.done = true + return affected, err +} + +// HushDeleteOne is the builder for deleting a single Hush entity. +type HushDeleteOne struct { + hd *HushDelete +} + +// Where appends a list predicates to the HushDelete builder. +func (hdo *HushDeleteOne) Where(ps ...predicate.Hush) *HushDeleteOne { + hdo.hd.mutation.Where(ps...) + return hdo +} + +// Exec executes the deletion query. +func (hdo *HushDeleteOne) Exec(ctx context.Context) error { + n, err := hdo.hd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{hush.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (hdo *HushDeleteOne) ExecX(ctx context.Context) { + if err := hdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/hush_query.go b/internal/ent/generated/hush_query.go new file mode 100644 index 0000000..d81bb6e --- /dev/null +++ b/internal/ent/generated/hush_query.go @@ -0,0 +1,947 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// HushQuery is the builder for querying Hush entities. +type HushQuery struct { + config + ctx *QueryContext + order []hush.OrderOption + inters []Interceptor + predicates []predicate.Hush + withIntegrations *IntegrationQuery + withOrganization *OrganizationQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Hush) error + withNamedIntegrations map[string]*IntegrationQuery + withNamedOrganization map[string]*OrganizationQuery + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the HushQuery builder. +func (hq *HushQuery) Where(ps ...predicate.Hush) *HushQuery { + hq.predicates = append(hq.predicates, ps...) + return hq +} + +// Limit the number of records to be returned by this query. +func (hq *HushQuery) Limit(limit int) *HushQuery { + hq.ctx.Limit = &limit + return hq +} + +// Offset to start from. +func (hq *HushQuery) Offset(offset int) *HushQuery { + hq.ctx.Offset = &offset + return hq +} + +// 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 (hq *HushQuery) Unique(unique bool) *HushQuery { + hq.ctx.Unique = &unique + return hq +} + +// Order specifies how the records should be ordered. +func (hq *HushQuery) Order(o ...hush.OrderOption) *HushQuery { + hq.order = append(hq.order, o...) + return hq +} + +// QueryIntegrations chains the current query on the "integrations" edge. +func (hq *HushQuery) QueryIntegrations() *IntegrationQuery { + query := (&IntegrationClient{config: hq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := hq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := hq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(hush.Table, hush.FieldID, selector), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, hush.IntegrationsTable, hush.IntegrationsPrimaryKey...), + ) + schemaConfig := hq.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationSecrets + fromU = sqlgraph.SetNeighbors(hq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrganization chains the current query on the "organization" edge. +func (hq *HushQuery) QueryOrganization() *OrganizationQuery { + query := (&OrganizationClient{config: hq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := hq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := hq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(hush.Table, hush.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, hush.OrganizationTable, hush.OrganizationPrimaryKey...), + ) + schemaConfig := hq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSecrets + fromU = sqlgraph.SetNeighbors(hq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (hq *HushQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: hq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := hq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := hq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(hush.Table, hush.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, hush.EventsTable, hush.EventsPrimaryKey...), + ) + schemaConfig := hq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.HushEvents + fromU = sqlgraph.SetNeighbors(hq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Hush entity from the query. +// Returns a *NotFoundError when no Hush was found. +func (hq *HushQuery) First(ctx context.Context) (*Hush, error) { + nodes, err := hq.Limit(1).All(setContextOp(ctx, hq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{hush.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (hq *HushQuery) FirstX(ctx context.Context) *Hush { + node, err := hq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Hush ID from the query. +// Returns a *NotFoundError when no Hush ID was found. +func (hq *HushQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = hq.Limit(1).IDs(setContextOp(ctx, hq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{hush.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (hq *HushQuery) FirstIDX(ctx context.Context) string { + id, err := hq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Hush entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Hush entity is found. +// Returns a *NotFoundError when no Hush entities are found. +func (hq *HushQuery) Only(ctx context.Context) (*Hush, error) { + nodes, err := hq.Limit(2).All(setContextOp(ctx, hq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{hush.Label} + default: + return nil, &NotSingularError{hush.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (hq *HushQuery) OnlyX(ctx context.Context) *Hush { + node, err := hq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Hush ID in the query. +// Returns a *NotSingularError when more than one Hush ID is found. +// Returns a *NotFoundError when no entities are found. +func (hq *HushQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = hq.Limit(2).IDs(setContextOp(ctx, hq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{hush.Label} + default: + err = &NotSingularError{hush.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (hq *HushQuery) OnlyIDX(ctx context.Context) string { + id, err := hq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Hushes. +func (hq *HushQuery) All(ctx context.Context) ([]*Hush, error) { + ctx = setContextOp(ctx, hq.ctx, ent.OpQueryAll) + if err := hq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Hush, *HushQuery]() + return withInterceptors[[]*Hush](ctx, hq, qr, hq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (hq *HushQuery) AllX(ctx context.Context) []*Hush { + nodes, err := hq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Hush IDs. +func (hq *HushQuery) IDs(ctx context.Context) (ids []string, err error) { + if hq.ctx.Unique == nil && hq.path != nil { + hq.Unique(true) + } + ctx = setContextOp(ctx, hq.ctx, ent.OpQueryIDs) + if err = hq.Select(hush.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (hq *HushQuery) IDsX(ctx context.Context) []string { + ids, err := hq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (hq *HushQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, hq.ctx, ent.OpQueryCount) + if err := hq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, hq, querierCount[*HushQuery](), hq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (hq *HushQuery) CountX(ctx context.Context) int { + count, err := hq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (hq *HushQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, hq.ctx, ent.OpQueryExist) + switch _, err := hq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (hq *HushQuery) ExistX(ctx context.Context) bool { + exist, err := hq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the HushQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (hq *HushQuery) Clone() *HushQuery { + if hq == nil { + return nil + } + return &HushQuery{ + config: hq.config, + ctx: hq.ctx.Clone(), + order: append([]hush.OrderOption{}, hq.order...), + inters: append([]Interceptor{}, hq.inters...), + predicates: append([]predicate.Hush{}, hq.predicates...), + withIntegrations: hq.withIntegrations.Clone(), + withOrganization: hq.withOrganization.Clone(), + withEvents: hq.withEvents.Clone(), + // clone intermediate query. + sql: hq.sql.Clone(), + path: hq.path, + } +} + +// WithIntegrations tells the query-builder to eager-load the nodes that are connected to +// the "integrations" edge. The optional arguments are used to configure the query builder of the edge. +func (hq *HushQuery) WithIntegrations(opts ...func(*IntegrationQuery)) *HushQuery { + query := (&IntegrationClient{config: hq.config}).Query() + for _, opt := range opts { + opt(query) + } + hq.withIntegrations = query + return hq +} + +// WithOrganization tells the query-builder to eager-load the nodes that are connected to +// the "organization" edge. The optional arguments are used to configure the query builder of the edge. +func (hq *HushQuery) WithOrganization(opts ...func(*OrganizationQuery)) *HushQuery { + query := (&OrganizationClient{config: hq.config}).Query() + for _, opt := range opts { + opt(query) + } + hq.withOrganization = query + return hq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (hq *HushQuery) WithEvents(opts ...func(*EventQuery)) *HushQuery { + query := (&EventClient{config: hq.config}).Query() + for _, opt := range opts { + opt(query) + } + hq.withEvents = query + return hq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Hush.Query(). +// GroupBy(hush.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (hq *HushQuery) GroupBy(field string, fields ...string) *HushGroupBy { + hq.ctx.Fields = append([]string{field}, fields...) + grbuild := &HushGroupBy{build: hq} + grbuild.flds = &hq.ctx.Fields + grbuild.label = hush.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Hush.Query(). +// Select(hush.FieldCreatedAt). +// Scan(ctx, &v) +func (hq *HushQuery) Select(fields ...string) *HushSelect { + hq.ctx.Fields = append(hq.ctx.Fields, fields...) + sbuild := &HushSelect{HushQuery: hq} + sbuild.label = hush.Label + sbuild.flds, sbuild.scan = &hq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a HushSelect configured with the given aggregations. +func (hq *HushQuery) Aggregate(fns ...AggregateFunc) *HushSelect { + return hq.Select().Aggregate(fns...) +} + +func (hq *HushQuery) prepareQuery(ctx context.Context) error { + for _, inter := range hq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, hq); err != nil { + return err + } + } + } + for _, f := range hq.ctx.Fields { + if !hush.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if hq.path != nil { + prev, err := hq.path(ctx) + if err != nil { + return err + } + hq.sql = prev + } + return nil +} + +func (hq *HushQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Hush, error) { + var ( + nodes = []*Hush{} + _spec = hq.querySpec() + loadedTypes = [3]bool{ + hq.withIntegrations != nil, + hq.withOrganization != nil, + hq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Hush).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Hush{config: hq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = hq.schemaConfig.Hush + ctx = internal.NewSchemaConfigContext(ctx, hq.schemaConfig) + if len(hq.modifiers) > 0 { + _spec.Modifiers = hq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, hq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := hq.withIntegrations; query != nil { + if err := hq.loadIntegrations(ctx, query, nodes, + func(n *Hush) { n.Edges.Integrations = []*Integration{} }, + func(n *Hush, e *Integration) { n.Edges.Integrations = append(n.Edges.Integrations, e) }); err != nil { + return nil, err + } + } + if query := hq.withOrganization; query != nil { + if err := hq.loadOrganization(ctx, query, nodes, + func(n *Hush) { n.Edges.Organization = []*Organization{} }, + func(n *Hush, e *Organization) { n.Edges.Organization = append(n.Edges.Organization, e) }); err != nil { + return nil, err + } + } + if query := hq.withEvents; query != nil { + if err := hq.loadEvents(ctx, query, nodes, + func(n *Hush) { n.Edges.Events = []*Event{} }, + func(n *Hush, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range hq.withNamedIntegrations { + if err := hq.loadIntegrations(ctx, query, nodes, + func(n *Hush) { n.appendNamedIntegrations(name) }, + func(n *Hush, e *Integration) { n.appendNamedIntegrations(name, e) }); err != nil { + return nil, err + } + } + for name, query := range hq.withNamedOrganization { + if err := hq.loadOrganization(ctx, query, nodes, + func(n *Hush) { n.appendNamedOrganization(name) }, + func(n *Hush, e *Organization) { n.appendNamedOrganization(name, e) }); err != nil { + return nil, err + } + } + for name, query := range hq.withNamedEvents { + if err := hq.loadEvents(ctx, query, nodes, + func(n *Hush) { n.appendNamedEvents(name) }, + func(n *Hush, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range hq.loadTotal { + if err := hq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (hq *HushQuery) loadIntegrations(ctx context.Context, query *IntegrationQuery, nodes []*Hush, init func(*Hush), assign func(*Hush, *Integration)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Hush) + nids := make(map[string]map[*Hush]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(hush.IntegrationsTable) + joinT.Schema(hq.schemaConfig.IntegrationSecrets) + s.Join(joinT).On(s.C(integration.FieldID), joinT.C(hush.IntegrationsPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(hush.IntegrationsPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(hush.IntegrationsPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Hush]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Integration](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "integrations" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (hq *HushQuery) loadOrganization(ctx context.Context, query *OrganizationQuery, nodes []*Hush, init func(*Hush), assign func(*Hush, *Organization)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Hush) + nids := make(map[string]map[*Hush]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(hush.OrganizationTable) + joinT.Schema(hq.schemaConfig.OrganizationSecrets) + s.Join(joinT).On(s.C(organization.FieldID), joinT.C(hush.OrganizationPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(hush.OrganizationPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(hush.OrganizationPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Hush]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Organization](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "organization" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (hq *HushQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Hush, init func(*Hush), assign func(*Hush, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Hush) + nids := make(map[string]map[*Hush]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(hush.EventsTable) + joinT.Schema(hq.schemaConfig.HushEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(hush.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(hush.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(hush.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Hush]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (hq *HushQuery) sqlCount(ctx context.Context) (int, error) { + _spec := hq.querySpec() + _spec.Node.Schema = hq.schemaConfig.Hush + ctx = internal.NewSchemaConfigContext(ctx, hq.schemaConfig) + if len(hq.modifiers) > 0 { + _spec.Modifiers = hq.modifiers + } + _spec.Node.Columns = hq.ctx.Fields + if len(hq.ctx.Fields) > 0 { + _spec.Unique = hq.ctx.Unique != nil && *hq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, hq.driver, _spec) +} + +func (hq *HushQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(hush.Table, hush.Columns, sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString)) + _spec.From = hq.sql + if unique := hq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if hq.path != nil { + _spec.Unique = true + } + if fields := hq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, hush.FieldID) + for i := range fields { + if fields[i] != hush.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := hq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := hq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := hq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := hq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (hq *HushQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(hq.driver.Dialect()) + t1 := builder.Table(hush.Table) + columns := hq.ctx.Fields + if len(columns) == 0 { + columns = hush.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if hq.sql != nil { + selector = hq.sql + selector.Select(selector.Columns(columns...)...) + } + if hq.ctx.Unique != nil && *hq.ctx.Unique { + selector.Distinct() + } + t1.Schema(hq.schemaConfig.Hush) + ctx = internal.NewSchemaConfigContext(ctx, hq.schemaConfig) + selector.WithContext(ctx) + for _, p := range hq.predicates { + p(selector) + } + for _, p := range hq.order { + p(selector) + } + if offset := hq.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 := hq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedIntegrations tells the query-builder to eager-load the nodes that are connected to the "integrations" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (hq *HushQuery) WithNamedIntegrations(name string, opts ...func(*IntegrationQuery)) *HushQuery { + query := (&IntegrationClient{config: hq.config}).Query() + for _, opt := range opts { + opt(query) + } + if hq.withNamedIntegrations == nil { + hq.withNamedIntegrations = make(map[string]*IntegrationQuery) + } + hq.withNamedIntegrations[name] = query + return hq +} + +// WithNamedOrganization tells the query-builder to eager-load the nodes that are connected to the "organization" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (hq *HushQuery) WithNamedOrganization(name string, opts ...func(*OrganizationQuery)) *HushQuery { + query := (&OrganizationClient{config: hq.config}).Query() + for _, opt := range opts { + opt(query) + } + if hq.withNamedOrganization == nil { + hq.withNamedOrganization = make(map[string]*OrganizationQuery) + } + hq.withNamedOrganization[name] = query + return hq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (hq *HushQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *HushQuery { + query := (&EventClient{config: hq.config}).Query() + for _, opt := range opts { + opt(query) + } + if hq.withNamedEvents == nil { + hq.withNamedEvents = make(map[string]*EventQuery) + } + hq.withNamedEvents[name] = query + return hq +} + +// HushGroupBy is the group-by builder for Hush entities. +type HushGroupBy struct { + selector + build *HushQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (hgb *HushGroupBy) Aggregate(fns ...AggregateFunc) *HushGroupBy { + hgb.fns = append(hgb.fns, fns...) + return hgb +} + +// Scan applies the selector query and scans the result into the given value. +func (hgb *HushGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, hgb.build.ctx, ent.OpQueryGroupBy) + if err := hgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*HushQuery, *HushGroupBy](ctx, hgb.build, hgb, hgb.build.inters, v) +} + +func (hgb *HushGroupBy) sqlScan(ctx context.Context, root *HushQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(hgb.fns)) + for _, fn := range hgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*hgb.flds)+len(hgb.fns)) + for _, f := range *hgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*hgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := hgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// HushSelect is the builder for selecting fields of Hush entities. +type HushSelect struct { + *HushQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (hs *HushSelect) Aggregate(fns ...AggregateFunc) *HushSelect { + hs.fns = append(hs.fns, fns...) + return hs +} + +// Scan applies the selector query and scans the result into the given value. +func (hs *HushSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, hs.ctx, ent.OpQuerySelect) + if err := hs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*HushQuery, *HushSelect](ctx, hs.HushQuery, hs, hs.inters, v) +} + +func (hs *HushSelect) sqlScan(ctx context.Context, root *HushQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(hs.fns)) + for _, fn := range hs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*hs.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 := hs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/hush_update.go b/internal/ent/generated/hush_update.go new file mode 100644 index 0000000..7c05238 --- /dev/null +++ b/internal/ent/generated/hush_update.go @@ -0,0 +1,1099 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// HushUpdate is the builder for updating Hush entities. +type HushUpdate struct { + config + hooks []Hook + mutation *HushMutation +} + +// Where appends a list predicates to the HushUpdate builder. +func (hu *HushUpdate) Where(ps ...predicate.Hush) *HushUpdate { + hu.mutation.Where(ps...) + return hu +} + +// SetUpdatedAt sets the "updated_at" field. +func (hu *HushUpdate) SetUpdatedAt(t time.Time) *HushUpdate { + hu.mutation.SetUpdatedAt(t) + return hu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (hu *HushUpdate) ClearUpdatedAt() *HushUpdate { + hu.mutation.ClearUpdatedAt() + return hu +} + +// SetUpdatedBy sets the "updated_by" field. +func (hu *HushUpdate) SetUpdatedBy(s string) *HushUpdate { + hu.mutation.SetUpdatedBy(s) + return hu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (hu *HushUpdate) SetNillableUpdatedBy(s *string) *HushUpdate { + if s != nil { + hu.SetUpdatedBy(*s) + } + return hu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (hu *HushUpdate) ClearUpdatedBy() *HushUpdate { + hu.mutation.ClearUpdatedBy() + return hu +} + +// SetDeletedAt sets the "deleted_at" field. +func (hu *HushUpdate) SetDeletedAt(t time.Time) *HushUpdate { + hu.mutation.SetDeletedAt(t) + return hu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (hu *HushUpdate) SetNillableDeletedAt(t *time.Time) *HushUpdate { + if t != nil { + hu.SetDeletedAt(*t) + } + return hu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (hu *HushUpdate) ClearDeletedAt() *HushUpdate { + hu.mutation.ClearDeletedAt() + return hu +} + +// SetDeletedBy sets the "deleted_by" field. +func (hu *HushUpdate) SetDeletedBy(s string) *HushUpdate { + hu.mutation.SetDeletedBy(s) + return hu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (hu *HushUpdate) SetNillableDeletedBy(s *string) *HushUpdate { + if s != nil { + hu.SetDeletedBy(*s) + } + return hu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (hu *HushUpdate) ClearDeletedBy() *HushUpdate { + hu.mutation.ClearDeletedBy() + return hu +} + +// SetName sets the "name" field. +func (hu *HushUpdate) SetName(s string) *HushUpdate { + hu.mutation.SetName(s) + return hu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (hu *HushUpdate) SetNillableName(s *string) *HushUpdate { + if s != nil { + hu.SetName(*s) + } + return hu +} + +// SetDescription sets the "description" field. +func (hu *HushUpdate) SetDescription(s string) *HushUpdate { + hu.mutation.SetDescription(s) + return hu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (hu *HushUpdate) SetNillableDescription(s *string) *HushUpdate { + if s != nil { + hu.SetDescription(*s) + } + return hu +} + +// ClearDescription clears the value of the "description" field. +func (hu *HushUpdate) ClearDescription() *HushUpdate { + hu.mutation.ClearDescription() + return hu +} + +// SetKind sets the "kind" field. +func (hu *HushUpdate) SetKind(s string) *HushUpdate { + hu.mutation.SetKind(s) + return hu +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (hu *HushUpdate) SetNillableKind(s *string) *HushUpdate { + if s != nil { + hu.SetKind(*s) + } + return hu +} + +// ClearKind clears the value of the "kind" field. +func (hu *HushUpdate) ClearKind() *HushUpdate { + hu.mutation.ClearKind() + return hu +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (hu *HushUpdate) AddIntegrationIDs(ids ...string) *HushUpdate { + hu.mutation.AddIntegrationIDs(ids...) + return hu +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (hu *HushUpdate) AddIntegrations(i ...*Integration) *HushUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return hu.AddIntegrationIDs(ids...) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (hu *HushUpdate) AddOrganizationIDs(ids ...string) *HushUpdate { + hu.mutation.AddOrganizationIDs(ids...) + return hu +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (hu *HushUpdate) AddOrganization(o ...*Organization) *HushUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return hu.AddOrganizationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (hu *HushUpdate) AddEventIDs(ids ...string) *HushUpdate { + hu.mutation.AddEventIDs(ids...) + return hu +} + +// AddEvents adds the "events" edges to the Event entity. +func (hu *HushUpdate) AddEvents(e ...*Event) *HushUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return hu.AddEventIDs(ids...) +} + +// Mutation returns the HushMutation object of the builder. +func (hu *HushUpdate) Mutation() *HushMutation { + return hu.mutation +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (hu *HushUpdate) ClearIntegrations() *HushUpdate { + hu.mutation.ClearIntegrations() + return hu +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (hu *HushUpdate) RemoveIntegrationIDs(ids ...string) *HushUpdate { + hu.mutation.RemoveIntegrationIDs(ids...) + return hu +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (hu *HushUpdate) RemoveIntegrations(i ...*Integration) *HushUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return hu.RemoveIntegrationIDs(ids...) +} + +// ClearOrganization clears all "organization" edges to the Organization entity. +func (hu *HushUpdate) ClearOrganization() *HushUpdate { + hu.mutation.ClearOrganization() + return hu +} + +// RemoveOrganizationIDs removes the "organization" edge to Organization entities by IDs. +func (hu *HushUpdate) RemoveOrganizationIDs(ids ...string) *HushUpdate { + hu.mutation.RemoveOrganizationIDs(ids...) + return hu +} + +// RemoveOrganization removes "organization" edges to Organization entities. +func (hu *HushUpdate) RemoveOrganization(o ...*Organization) *HushUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return hu.RemoveOrganizationIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (hu *HushUpdate) ClearEvents() *HushUpdate { + hu.mutation.ClearEvents() + return hu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (hu *HushUpdate) RemoveEventIDs(ids ...string) *HushUpdate { + hu.mutation.RemoveEventIDs(ids...) + return hu +} + +// RemoveEvents removes "events" edges to Event entities. +func (hu *HushUpdate) RemoveEvents(e ...*Event) *HushUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return hu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (hu *HushUpdate) Save(ctx context.Context) (int, error) { + if err := hu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, hu.sqlSave, hu.mutation, hu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (hu *HushUpdate) SaveX(ctx context.Context) int { + affected, err := hu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (hu *HushUpdate) Exec(ctx context.Context) error { + _, err := hu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (hu *HushUpdate) ExecX(ctx context.Context) { + if err := hu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (hu *HushUpdate) defaults() error { + if _, ok := hu.mutation.UpdatedAt(); !ok && !hu.mutation.UpdatedAtCleared() { + if hush.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized hush.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := hush.UpdateDefaultUpdatedAt() + hu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (hu *HushUpdate) check() error { + if v, ok := hu.mutation.Name(); ok { + if err := hush.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Hush.name": %w`, err)} + } + } + return nil +} + +func (hu *HushUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := hu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(hush.Table, hush.Columns, sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString)) + if ps := hu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if hu.mutation.CreatedAtCleared() { + _spec.ClearField(hush.FieldCreatedAt, field.TypeTime) + } + if value, ok := hu.mutation.UpdatedAt(); ok { + _spec.SetField(hush.FieldUpdatedAt, field.TypeTime, value) + } + if hu.mutation.UpdatedAtCleared() { + _spec.ClearField(hush.FieldUpdatedAt, field.TypeTime) + } + if hu.mutation.CreatedByCleared() { + _spec.ClearField(hush.FieldCreatedBy, field.TypeString) + } + if value, ok := hu.mutation.UpdatedBy(); ok { + _spec.SetField(hush.FieldUpdatedBy, field.TypeString, value) + } + if hu.mutation.UpdatedByCleared() { + _spec.ClearField(hush.FieldUpdatedBy, field.TypeString) + } + if value, ok := hu.mutation.DeletedAt(); ok { + _spec.SetField(hush.FieldDeletedAt, field.TypeTime, value) + } + if hu.mutation.DeletedAtCleared() { + _spec.ClearField(hush.FieldDeletedAt, field.TypeTime) + } + if value, ok := hu.mutation.DeletedBy(); ok { + _spec.SetField(hush.FieldDeletedBy, field.TypeString, value) + } + if hu.mutation.DeletedByCleared() { + _spec.ClearField(hush.FieldDeletedBy, field.TypeString) + } + if value, ok := hu.mutation.Name(); ok { + _spec.SetField(hush.FieldName, field.TypeString, value) + } + if value, ok := hu.mutation.Description(); ok { + _spec.SetField(hush.FieldDescription, field.TypeString, value) + } + if hu.mutation.DescriptionCleared() { + _spec.ClearField(hush.FieldDescription, field.TypeString) + } + if value, ok := hu.mutation.Kind(); ok { + _spec.SetField(hush.FieldKind, field.TypeString, value) + } + if hu.mutation.KindCleared() { + _spec.ClearField(hush.FieldKind, field.TypeString) + } + if hu.mutation.SecretNameCleared() { + _spec.ClearField(hush.FieldSecretName, field.TypeString) + } + if hu.mutation.SecretValueCleared() { + _spec.ClearField(hush.FieldSecretValue, field.TypeString) + } + if hu.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.IntegrationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := hu.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !hu.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := hu.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if hu.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.OrganizationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := hu.mutation.RemovedOrganizationIDs(); len(nodes) > 0 && !hu.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := hu.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if hu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.HushEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := hu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !hu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := hu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = hu.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = hu.schemaConfig.Hush + ctx = internal.NewSchemaConfigContext(ctx, hu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, hu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{hush.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + hu.mutation.done = true + return n, nil +} + +// HushUpdateOne is the builder for updating a single Hush entity. +type HushUpdateOne struct { + config + fields []string + hooks []Hook + mutation *HushMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (huo *HushUpdateOne) SetUpdatedAt(t time.Time) *HushUpdateOne { + huo.mutation.SetUpdatedAt(t) + return huo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (huo *HushUpdateOne) ClearUpdatedAt() *HushUpdateOne { + huo.mutation.ClearUpdatedAt() + return huo +} + +// SetUpdatedBy sets the "updated_by" field. +func (huo *HushUpdateOne) SetUpdatedBy(s string) *HushUpdateOne { + huo.mutation.SetUpdatedBy(s) + return huo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (huo *HushUpdateOne) SetNillableUpdatedBy(s *string) *HushUpdateOne { + if s != nil { + huo.SetUpdatedBy(*s) + } + return huo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (huo *HushUpdateOne) ClearUpdatedBy() *HushUpdateOne { + huo.mutation.ClearUpdatedBy() + return huo +} + +// SetDeletedAt sets the "deleted_at" field. +func (huo *HushUpdateOne) SetDeletedAt(t time.Time) *HushUpdateOne { + huo.mutation.SetDeletedAt(t) + return huo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (huo *HushUpdateOne) SetNillableDeletedAt(t *time.Time) *HushUpdateOne { + if t != nil { + huo.SetDeletedAt(*t) + } + return huo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (huo *HushUpdateOne) ClearDeletedAt() *HushUpdateOne { + huo.mutation.ClearDeletedAt() + return huo +} + +// SetDeletedBy sets the "deleted_by" field. +func (huo *HushUpdateOne) SetDeletedBy(s string) *HushUpdateOne { + huo.mutation.SetDeletedBy(s) + return huo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (huo *HushUpdateOne) SetNillableDeletedBy(s *string) *HushUpdateOne { + if s != nil { + huo.SetDeletedBy(*s) + } + return huo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (huo *HushUpdateOne) ClearDeletedBy() *HushUpdateOne { + huo.mutation.ClearDeletedBy() + return huo +} + +// SetName sets the "name" field. +func (huo *HushUpdateOne) SetName(s string) *HushUpdateOne { + huo.mutation.SetName(s) + return huo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (huo *HushUpdateOne) SetNillableName(s *string) *HushUpdateOne { + if s != nil { + huo.SetName(*s) + } + return huo +} + +// SetDescription sets the "description" field. +func (huo *HushUpdateOne) SetDescription(s string) *HushUpdateOne { + huo.mutation.SetDescription(s) + return huo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (huo *HushUpdateOne) SetNillableDescription(s *string) *HushUpdateOne { + if s != nil { + huo.SetDescription(*s) + } + return huo +} + +// ClearDescription clears the value of the "description" field. +func (huo *HushUpdateOne) ClearDescription() *HushUpdateOne { + huo.mutation.ClearDescription() + return huo +} + +// SetKind sets the "kind" field. +func (huo *HushUpdateOne) SetKind(s string) *HushUpdateOne { + huo.mutation.SetKind(s) + return huo +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (huo *HushUpdateOne) SetNillableKind(s *string) *HushUpdateOne { + if s != nil { + huo.SetKind(*s) + } + return huo +} + +// ClearKind clears the value of the "kind" field. +func (huo *HushUpdateOne) ClearKind() *HushUpdateOne { + huo.mutation.ClearKind() + return huo +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (huo *HushUpdateOne) AddIntegrationIDs(ids ...string) *HushUpdateOne { + huo.mutation.AddIntegrationIDs(ids...) + return huo +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (huo *HushUpdateOne) AddIntegrations(i ...*Integration) *HushUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return huo.AddIntegrationIDs(ids...) +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by IDs. +func (huo *HushUpdateOne) AddOrganizationIDs(ids ...string) *HushUpdateOne { + huo.mutation.AddOrganizationIDs(ids...) + return huo +} + +// AddOrganization adds the "organization" edges to the Organization entity. +func (huo *HushUpdateOne) AddOrganization(o ...*Organization) *HushUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return huo.AddOrganizationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (huo *HushUpdateOne) AddEventIDs(ids ...string) *HushUpdateOne { + huo.mutation.AddEventIDs(ids...) + return huo +} + +// AddEvents adds the "events" edges to the Event entity. +func (huo *HushUpdateOne) AddEvents(e ...*Event) *HushUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return huo.AddEventIDs(ids...) +} + +// Mutation returns the HushMutation object of the builder. +func (huo *HushUpdateOne) Mutation() *HushMutation { + return huo.mutation +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (huo *HushUpdateOne) ClearIntegrations() *HushUpdateOne { + huo.mutation.ClearIntegrations() + return huo +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (huo *HushUpdateOne) RemoveIntegrationIDs(ids ...string) *HushUpdateOne { + huo.mutation.RemoveIntegrationIDs(ids...) + return huo +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (huo *HushUpdateOne) RemoveIntegrations(i ...*Integration) *HushUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return huo.RemoveIntegrationIDs(ids...) +} + +// ClearOrganization clears all "organization" edges to the Organization entity. +func (huo *HushUpdateOne) ClearOrganization() *HushUpdateOne { + huo.mutation.ClearOrganization() + return huo +} + +// RemoveOrganizationIDs removes the "organization" edge to Organization entities by IDs. +func (huo *HushUpdateOne) RemoveOrganizationIDs(ids ...string) *HushUpdateOne { + huo.mutation.RemoveOrganizationIDs(ids...) + return huo +} + +// RemoveOrganization removes "organization" edges to Organization entities. +func (huo *HushUpdateOne) RemoveOrganization(o ...*Organization) *HushUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return huo.RemoveOrganizationIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (huo *HushUpdateOne) ClearEvents() *HushUpdateOne { + huo.mutation.ClearEvents() + return huo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (huo *HushUpdateOne) RemoveEventIDs(ids ...string) *HushUpdateOne { + huo.mutation.RemoveEventIDs(ids...) + return huo +} + +// RemoveEvents removes "events" edges to Event entities. +func (huo *HushUpdateOne) RemoveEvents(e ...*Event) *HushUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return huo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the HushUpdate builder. +func (huo *HushUpdateOne) Where(ps ...predicate.Hush) *HushUpdateOne { + huo.mutation.Where(ps...) + return huo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (huo *HushUpdateOne) Select(field string, fields ...string) *HushUpdateOne { + huo.fields = append([]string{field}, fields...) + return huo +} + +// Save executes the query and returns the updated Hush entity. +func (huo *HushUpdateOne) Save(ctx context.Context) (*Hush, error) { + if err := huo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, huo.sqlSave, huo.mutation, huo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (huo *HushUpdateOne) SaveX(ctx context.Context) *Hush { + node, err := huo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (huo *HushUpdateOne) Exec(ctx context.Context) error { + _, err := huo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (huo *HushUpdateOne) ExecX(ctx context.Context) { + if err := huo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (huo *HushUpdateOne) defaults() error { + if _, ok := huo.mutation.UpdatedAt(); !ok && !huo.mutation.UpdatedAtCleared() { + if hush.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized hush.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := hush.UpdateDefaultUpdatedAt() + huo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (huo *HushUpdateOne) check() error { + if v, ok := huo.mutation.Name(); ok { + if err := hush.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Hush.name": %w`, err)} + } + } + return nil +} + +func (huo *HushUpdateOne) sqlSave(ctx context.Context) (_node *Hush, err error) { + if err := huo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(hush.Table, hush.Columns, sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString)) + id, ok := huo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Hush.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := huo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, hush.FieldID) + for _, f := range fields { + if !hush.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != hush.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := huo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if huo.mutation.CreatedAtCleared() { + _spec.ClearField(hush.FieldCreatedAt, field.TypeTime) + } + if value, ok := huo.mutation.UpdatedAt(); ok { + _spec.SetField(hush.FieldUpdatedAt, field.TypeTime, value) + } + if huo.mutation.UpdatedAtCleared() { + _spec.ClearField(hush.FieldUpdatedAt, field.TypeTime) + } + if huo.mutation.CreatedByCleared() { + _spec.ClearField(hush.FieldCreatedBy, field.TypeString) + } + if value, ok := huo.mutation.UpdatedBy(); ok { + _spec.SetField(hush.FieldUpdatedBy, field.TypeString, value) + } + if huo.mutation.UpdatedByCleared() { + _spec.ClearField(hush.FieldUpdatedBy, field.TypeString) + } + if value, ok := huo.mutation.DeletedAt(); ok { + _spec.SetField(hush.FieldDeletedAt, field.TypeTime, value) + } + if huo.mutation.DeletedAtCleared() { + _spec.ClearField(hush.FieldDeletedAt, field.TypeTime) + } + if value, ok := huo.mutation.DeletedBy(); ok { + _spec.SetField(hush.FieldDeletedBy, field.TypeString, value) + } + if huo.mutation.DeletedByCleared() { + _spec.ClearField(hush.FieldDeletedBy, field.TypeString) + } + if value, ok := huo.mutation.Name(); ok { + _spec.SetField(hush.FieldName, field.TypeString, value) + } + if value, ok := huo.mutation.Description(); ok { + _spec.SetField(hush.FieldDescription, field.TypeString, value) + } + if huo.mutation.DescriptionCleared() { + _spec.ClearField(hush.FieldDescription, field.TypeString) + } + if value, ok := huo.mutation.Kind(); ok { + _spec.SetField(hush.FieldKind, field.TypeString, value) + } + if huo.mutation.KindCleared() { + _spec.ClearField(hush.FieldKind, field.TypeString) + } + if huo.mutation.SecretNameCleared() { + _spec.ClearField(hush.FieldSecretName, field.TypeString) + } + if huo.mutation.SecretValueCleared() { + _spec.ClearField(hush.FieldSecretValue, field.TypeString) + } + if huo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.IntegrationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := huo.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !huo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := huo.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.IntegrationsTable, + Columns: hush.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if huo.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.OrganizationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := huo.mutation.RemovedOrganizationIDs(); len(nodes) > 0 && !huo.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := huo.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: hush.OrganizationTable, + Columns: hush.OrganizationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if huo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.HushEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := huo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !huo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := huo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: hush.EventsTable, + Columns: hush.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = huo.schemaConfig.HushEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = huo.schemaConfig.Hush + ctx = internal.NewSchemaConfigContext(ctx, huo.schemaConfig) + _node = &Hush{config: huo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, huo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{hush.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + huo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/hushhistory.go b/internal/ent/generated/hushhistory.go new file mode 100644 index 0000000..ca400b5 --- /dev/null +++ b/internal/ent/generated/hushhistory.go @@ -0,0 +1,260 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/entx/history" +) + +// HushHistory is the model entity for the HushHistory schema. +type HushHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name,omitempty"` + // a description of the hush value or purpose, such as github PAT + Description string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName string `json:"secret_name,omitempty"` + // the secret value + SecretValue string `json:"-"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*HushHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case hushhistory.FieldOperation: + values[i] = new(history.OpType) + case hushhistory.FieldID, hushhistory.FieldRef, hushhistory.FieldCreatedBy, hushhistory.FieldUpdatedBy, hushhistory.FieldMappingID, hushhistory.FieldDeletedBy, hushhistory.FieldName, hushhistory.FieldDescription, hushhistory.FieldKind, hushhistory.FieldSecretName, hushhistory.FieldSecretValue: + values[i] = new(sql.NullString) + case hushhistory.FieldHistoryTime, hushhistory.FieldCreatedAt, hushhistory.FieldUpdatedAt, hushhistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the HushHistory fields. +func (hh *HushHistory) 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 hushhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + hh.ID = value.String + } + case hushhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + hh.HistoryTime = value.Time + } + case hushhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + hh.Ref = value.String + } + case hushhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + hh.Operation = *value + } + case hushhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + hh.CreatedAt = value.Time + } + case hushhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + hh.UpdatedAt = value.Time + } + case hushhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + hh.CreatedBy = value.String + } + case hushhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + hh.UpdatedBy = value.String + } + case hushhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + hh.MappingID = value.String + } + case hushhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + hh.DeletedAt = value.Time + } + case hushhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + hh.DeletedBy = value.String + } + case hushhistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + hh.Name = value.String + } + case hushhistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + hh.Description = value.String + } + case hushhistory.FieldKind: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field kind", values[i]) + } else if value.Valid { + hh.Kind = value.String + } + case hushhistory.FieldSecretName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field secret_name", values[i]) + } else if value.Valid { + hh.SecretName = value.String + } + case hushhistory.FieldSecretValue: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field secret_value", values[i]) + } else if value.Valid { + hh.SecretValue = value.String + } + default: + hh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the HushHistory. +// This includes values selected through modifiers, order, etc. +func (hh *HushHistory) Value(name string) (ent.Value, error) { + return hh.selectValues.Get(name) +} + +// Update returns a builder for updating this HushHistory. +// Note that you need to call HushHistory.Unwrap() before calling this method if this HushHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (hh *HushHistory) Update() *HushHistoryUpdateOne { + return NewHushHistoryClient(hh.config).UpdateOne(hh) +} + +// Unwrap unwraps the HushHistory 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 (hh *HushHistory) Unwrap() *HushHistory { + _tx, ok := hh.config.driver.(*txDriver) + if !ok { + panic("generated: HushHistory is not a transactional entity") + } + hh.config.driver = _tx.drv + return hh +} + +// String implements the fmt.Stringer. +func (hh *HushHistory) String() string { + var builder strings.Builder + builder.WriteString("HushHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", hh.ID)) + builder.WriteString("history_time=") + builder.WriteString(hh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(hh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", hh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(hh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(hh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(hh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(hh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(hh.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(hh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(hh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(hh.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(hh.Description) + builder.WriteString(", ") + builder.WriteString("kind=") + builder.WriteString(hh.Kind) + builder.WriteString(", ") + builder.WriteString("secret_name=") + builder.WriteString(hh.SecretName) + builder.WriteString(", ") + builder.WriteString("secret_value=") + builder.WriteByte(')') + return builder.String() +} + +// HushHistories is a parsable slice of HushHistory. +type HushHistories []*HushHistory diff --git a/internal/ent/generated/hushhistory/hushhistory.go b/internal/ent/generated/hushhistory/hushhistory.go new file mode 100644 index 0000000..935c0f3 --- /dev/null +++ b/internal/ent/generated/hushhistory/hushhistory.go @@ -0,0 +1,196 @@ +// Code generated by ent, DO NOT EDIT. + +package hushhistory + +import ( + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the hushhistory type in the database. + Label = "hush_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldKind holds the string denoting the kind field in the database. + FieldKind = "kind" + // FieldSecretName holds the string denoting the secret_name field in the database. + FieldSecretName = "secret_name" + // FieldSecretValue holds the string denoting the secret_value field in the database. + FieldSecretValue = "secret_value" + // Table holds the table name of the hushhistory in the database. + Table = "hush_history" +) + +// Columns holds all SQL columns for hushhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldName, + FieldDescription, + FieldKind, + FieldSecretName, + FieldSecretValue, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("hushhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the HushHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByKind orders the results by the kind field. +func ByKind(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldKind, opts...).ToFunc() +} + +// BySecretName orders the results by the secret_name field. +func BySecretName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSecretName, opts...).ToFunc() +} + +// BySecretValue orders the results by the secret_value field. +func BySecretValue(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSecretValue, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/hushhistory/where.go b/internal/ent/generated/hushhistory/where.go new file mode 100644 index 0000000..0a9f995 --- /dev/null +++ b/internal/ent/generated/hushhistory/where.go @@ -0,0 +1,1091 @@ +// Code generated by ent, DO NOT EDIT. + +package hushhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldDescription, v)) +} + +// Kind applies equality check predicate on the "kind" field. It's identical to KindEQ. +func Kind(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldKind, v)) +} + +// SecretName applies equality check predicate on the "secret_name" field. It's identical to SecretNameEQ. +func SecretName(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldSecretName, v)) +} + +// SecretValue applies equality check predicate on the "secret_value" field. It's identical to SecretValueEQ. +func SecretValue(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldSecretValue, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// KindEQ applies the EQ predicate on the "kind" field. +func KindEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldKind, v)) +} + +// KindNEQ applies the NEQ predicate on the "kind" field. +func KindNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldKind, v)) +} + +// KindIn applies the In predicate on the "kind" field. +func KindIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldKind, vs...)) +} + +// KindNotIn applies the NotIn predicate on the "kind" field. +func KindNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldKind, vs...)) +} + +// KindGT applies the GT predicate on the "kind" field. +func KindGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldKind, v)) +} + +// KindGTE applies the GTE predicate on the "kind" field. +func KindGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldKind, v)) +} + +// KindLT applies the LT predicate on the "kind" field. +func KindLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldKind, v)) +} + +// KindLTE applies the LTE predicate on the "kind" field. +func KindLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldKind, v)) +} + +// KindContains applies the Contains predicate on the "kind" field. +func KindContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldKind, v)) +} + +// KindHasPrefix applies the HasPrefix predicate on the "kind" field. +func KindHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldKind, v)) +} + +// KindHasSuffix applies the HasSuffix predicate on the "kind" field. +func KindHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldKind, v)) +} + +// KindIsNil applies the IsNil predicate on the "kind" field. +func KindIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldKind)) +} + +// KindNotNil applies the NotNil predicate on the "kind" field. +func KindNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldKind)) +} + +// KindEqualFold applies the EqualFold predicate on the "kind" field. +func KindEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldKind, v)) +} + +// KindContainsFold applies the ContainsFold predicate on the "kind" field. +func KindContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldKind, v)) +} + +// SecretNameEQ applies the EQ predicate on the "secret_name" field. +func SecretNameEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldSecretName, v)) +} + +// SecretNameNEQ applies the NEQ predicate on the "secret_name" field. +func SecretNameNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldSecretName, v)) +} + +// SecretNameIn applies the In predicate on the "secret_name" field. +func SecretNameIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldSecretName, vs...)) +} + +// SecretNameNotIn applies the NotIn predicate on the "secret_name" field. +func SecretNameNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldSecretName, vs...)) +} + +// SecretNameGT applies the GT predicate on the "secret_name" field. +func SecretNameGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldSecretName, v)) +} + +// SecretNameGTE applies the GTE predicate on the "secret_name" field. +func SecretNameGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldSecretName, v)) +} + +// SecretNameLT applies the LT predicate on the "secret_name" field. +func SecretNameLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldSecretName, v)) +} + +// SecretNameLTE applies the LTE predicate on the "secret_name" field. +func SecretNameLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldSecretName, v)) +} + +// SecretNameContains applies the Contains predicate on the "secret_name" field. +func SecretNameContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldSecretName, v)) +} + +// SecretNameHasPrefix applies the HasPrefix predicate on the "secret_name" field. +func SecretNameHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldSecretName, v)) +} + +// SecretNameHasSuffix applies the HasSuffix predicate on the "secret_name" field. +func SecretNameHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldSecretName, v)) +} + +// SecretNameIsNil applies the IsNil predicate on the "secret_name" field. +func SecretNameIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldSecretName)) +} + +// SecretNameNotNil applies the NotNil predicate on the "secret_name" field. +func SecretNameNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldSecretName)) +} + +// SecretNameEqualFold applies the EqualFold predicate on the "secret_name" field. +func SecretNameEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldSecretName, v)) +} + +// SecretNameContainsFold applies the ContainsFold predicate on the "secret_name" field. +func SecretNameContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldSecretName, v)) +} + +// SecretValueEQ applies the EQ predicate on the "secret_value" field. +func SecretValueEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEQ(FieldSecretValue, v)) +} + +// SecretValueNEQ applies the NEQ predicate on the "secret_value" field. +func SecretValueNEQ(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNEQ(FieldSecretValue, v)) +} + +// SecretValueIn applies the In predicate on the "secret_value" field. +func SecretValueIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldIn(FieldSecretValue, vs...)) +} + +// SecretValueNotIn applies the NotIn predicate on the "secret_value" field. +func SecretValueNotIn(vs ...string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotIn(FieldSecretValue, vs...)) +} + +// SecretValueGT applies the GT predicate on the "secret_value" field. +func SecretValueGT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGT(FieldSecretValue, v)) +} + +// SecretValueGTE applies the GTE predicate on the "secret_value" field. +func SecretValueGTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldGTE(FieldSecretValue, v)) +} + +// SecretValueLT applies the LT predicate on the "secret_value" field. +func SecretValueLT(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLT(FieldSecretValue, v)) +} + +// SecretValueLTE applies the LTE predicate on the "secret_value" field. +func SecretValueLTE(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldLTE(FieldSecretValue, v)) +} + +// SecretValueContains applies the Contains predicate on the "secret_value" field. +func SecretValueContains(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContains(FieldSecretValue, v)) +} + +// SecretValueHasPrefix applies the HasPrefix predicate on the "secret_value" field. +func SecretValueHasPrefix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasPrefix(FieldSecretValue, v)) +} + +// SecretValueHasSuffix applies the HasSuffix predicate on the "secret_value" field. +func SecretValueHasSuffix(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldHasSuffix(FieldSecretValue, v)) +} + +// SecretValueIsNil applies the IsNil predicate on the "secret_value" field. +func SecretValueIsNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldIsNull(FieldSecretValue)) +} + +// SecretValueNotNil applies the NotNil predicate on the "secret_value" field. +func SecretValueNotNil() predicate.HushHistory { + return predicate.HushHistory(sql.FieldNotNull(FieldSecretValue)) +} + +// SecretValueEqualFold applies the EqualFold predicate on the "secret_value" field. +func SecretValueEqualFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldEqualFold(FieldSecretValue, v)) +} + +// SecretValueContainsFold applies the ContainsFold predicate on the "secret_value" field. +func SecretValueContainsFold(v string) predicate.HushHistory { + return predicate.HushHistory(sql.FieldContainsFold(FieldSecretValue, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.HushHistory) predicate.HushHistory { + return predicate.HushHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.HushHistory) predicate.HushHistory { + return predicate.HushHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.HushHistory) predicate.HushHistory { + return predicate.HushHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/hushhistory_create.go b/internal/ent/generated/hushhistory_create.go new file mode 100644 index 0000000..0781c09 --- /dev/null +++ b/internal/ent/generated/hushhistory_create.go @@ -0,0 +1,489 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/entx/history" +) + +// HushHistoryCreate is the builder for creating a HushHistory entity. +type HushHistoryCreate struct { + config + mutation *HushHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (hhc *HushHistoryCreate) SetHistoryTime(t time.Time) *HushHistoryCreate { + hhc.mutation.SetHistoryTime(t) + return hhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableHistoryTime(t *time.Time) *HushHistoryCreate { + if t != nil { + hhc.SetHistoryTime(*t) + } + return hhc +} + +// SetRef sets the "ref" field. +func (hhc *HushHistoryCreate) SetRef(s string) *HushHistoryCreate { + hhc.mutation.SetRef(s) + return hhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableRef(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetRef(*s) + } + return hhc +} + +// SetOperation sets the "operation" field. +func (hhc *HushHistoryCreate) SetOperation(ht history.OpType) *HushHistoryCreate { + hhc.mutation.SetOperation(ht) + return hhc +} + +// SetCreatedAt sets the "created_at" field. +func (hhc *HushHistoryCreate) SetCreatedAt(t time.Time) *HushHistoryCreate { + hhc.mutation.SetCreatedAt(t) + return hhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableCreatedAt(t *time.Time) *HushHistoryCreate { + if t != nil { + hhc.SetCreatedAt(*t) + } + return hhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (hhc *HushHistoryCreate) SetUpdatedAt(t time.Time) *HushHistoryCreate { + hhc.mutation.SetUpdatedAt(t) + return hhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableUpdatedAt(t *time.Time) *HushHistoryCreate { + if t != nil { + hhc.SetUpdatedAt(*t) + } + return hhc +} + +// SetCreatedBy sets the "created_by" field. +func (hhc *HushHistoryCreate) SetCreatedBy(s string) *HushHistoryCreate { + hhc.mutation.SetCreatedBy(s) + return hhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableCreatedBy(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetCreatedBy(*s) + } + return hhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (hhc *HushHistoryCreate) SetUpdatedBy(s string) *HushHistoryCreate { + hhc.mutation.SetUpdatedBy(s) + return hhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableUpdatedBy(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetUpdatedBy(*s) + } + return hhc +} + +// SetMappingID sets the "mapping_id" field. +func (hhc *HushHistoryCreate) SetMappingID(s string) *HushHistoryCreate { + hhc.mutation.SetMappingID(s) + return hhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableMappingID(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetMappingID(*s) + } + return hhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (hhc *HushHistoryCreate) SetDeletedAt(t time.Time) *HushHistoryCreate { + hhc.mutation.SetDeletedAt(t) + return hhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableDeletedAt(t *time.Time) *HushHistoryCreate { + if t != nil { + hhc.SetDeletedAt(*t) + } + return hhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (hhc *HushHistoryCreate) SetDeletedBy(s string) *HushHistoryCreate { + hhc.mutation.SetDeletedBy(s) + return hhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableDeletedBy(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetDeletedBy(*s) + } + return hhc +} + +// SetName sets the "name" field. +func (hhc *HushHistoryCreate) SetName(s string) *HushHistoryCreate { + hhc.mutation.SetName(s) + return hhc +} + +// SetDescription sets the "description" field. +func (hhc *HushHistoryCreate) SetDescription(s string) *HushHistoryCreate { + hhc.mutation.SetDescription(s) + return hhc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableDescription(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetDescription(*s) + } + return hhc +} + +// SetKind sets the "kind" field. +func (hhc *HushHistoryCreate) SetKind(s string) *HushHistoryCreate { + hhc.mutation.SetKind(s) + return hhc +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableKind(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetKind(*s) + } + return hhc +} + +// SetSecretName sets the "secret_name" field. +func (hhc *HushHistoryCreate) SetSecretName(s string) *HushHistoryCreate { + hhc.mutation.SetSecretName(s) + return hhc +} + +// SetNillableSecretName sets the "secret_name" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableSecretName(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetSecretName(*s) + } + return hhc +} + +// SetSecretValue sets the "secret_value" field. +func (hhc *HushHistoryCreate) SetSecretValue(s string) *HushHistoryCreate { + hhc.mutation.SetSecretValue(s) + return hhc +} + +// SetNillableSecretValue sets the "secret_value" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableSecretValue(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetSecretValue(*s) + } + return hhc +} + +// SetID sets the "id" field. +func (hhc *HushHistoryCreate) SetID(s string) *HushHistoryCreate { + hhc.mutation.SetID(s) + return hhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (hhc *HushHistoryCreate) SetNillableID(s *string) *HushHistoryCreate { + if s != nil { + hhc.SetID(*s) + } + return hhc +} + +// Mutation returns the HushHistoryMutation object of the builder. +func (hhc *HushHistoryCreate) Mutation() *HushHistoryMutation { + return hhc.mutation +} + +// Save creates the HushHistory in the database. +func (hhc *HushHistoryCreate) Save(ctx context.Context) (*HushHistory, error) { + hhc.defaults() + return withHooks(ctx, hhc.sqlSave, hhc.mutation, hhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (hhc *HushHistoryCreate) SaveX(ctx context.Context) *HushHistory { + v, err := hhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (hhc *HushHistoryCreate) Exec(ctx context.Context) error { + _, err := hhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (hhc *HushHistoryCreate) ExecX(ctx context.Context) { + if err := hhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (hhc *HushHistoryCreate) defaults() { + if _, ok := hhc.mutation.HistoryTime(); !ok { + v := hushhistory.DefaultHistoryTime() + hhc.mutation.SetHistoryTime(v) + } + if _, ok := hhc.mutation.CreatedAt(); !ok { + v := hushhistory.DefaultCreatedAt() + hhc.mutation.SetCreatedAt(v) + } + if _, ok := hhc.mutation.UpdatedAt(); !ok { + v := hushhistory.DefaultUpdatedAt() + hhc.mutation.SetUpdatedAt(v) + } + if _, ok := hhc.mutation.MappingID(); !ok { + v := hushhistory.DefaultMappingID() + hhc.mutation.SetMappingID(v) + } + if _, ok := hhc.mutation.ID(); !ok { + v := hushhistory.DefaultID() + hhc.mutation.SetID(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (hhc *HushHistoryCreate) check() error { + if _, ok := hhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "HushHistory.history_time"`)} + } + if _, ok := hhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "HushHistory.operation"`)} + } + if v, ok := hhc.mutation.Operation(); ok { + if err := hushhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "HushHistory.operation": %w`, err)} + } + } + if _, ok := hhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "HushHistory.mapping_id"`)} + } + if _, ok := hhc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "HushHistory.name"`)} + } + return nil +} + +func (hhc *HushHistoryCreate) sqlSave(ctx context.Context) (*HushHistory, error) { + if err := hhc.check(); err != nil { + return nil, err + } + _node, _spec := hhc.createSpec() + if err := sqlgraph.CreateNode(ctx, hhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected HushHistory.ID type: %T", _spec.ID.Value) + } + } + hhc.mutation.id = &_node.ID + hhc.mutation.done = true + return _node, nil +} + +func (hhc *HushHistoryCreate) createSpec() (*HushHistory, *sqlgraph.CreateSpec) { + var ( + _node = &HushHistory{config: hhc.config} + _spec = sqlgraph.NewCreateSpec(hushhistory.Table, sqlgraph.NewFieldSpec(hushhistory.FieldID, field.TypeString)) + ) + _spec.Schema = hhc.schemaConfig.HushHistory + if id, ok := hhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := hhc.mutation.HistoryTime(); ok { + _spec.SetField(hushhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := hhc.mutation.Ref(); ok { + _spec.SetField(hushhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := hhc.mutation.Operation(); ok { + _spec.SetField(hushhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := hhc.mutation.CreatedAt(); ok { + _spec.SetField(hushhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := hhc.mutation.UpdatedAt(); ok { + _spec.SetField(hushhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := hhc.mutation.CreatedBy(); ok { + _spec.SetField(hushhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := hhc.mutation.UpdatedBy(); ok { + _spec.SetField(hushhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := hhc.mutation.MappingID(); ok { + _spec.SetField(hushhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := hhc.mutation.DeletedAt(); ok { + _spec.SetField(hushhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := hhc.mutation.DeletedBy(); ok { + _spec.SetField(hushhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := hhc.mutation.Name(); ok { + _spec.SetField(hushhistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := hhc.mutation.Description(); ok { + _spec.SetField(hushhistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := hhc.mutation.Kind(); ok { + _spec.SetField(hushhistory.FieldKind, field.TypeString, value) + _node.Kind = value + } + if value, ok := hhc.mutation.SecretName(); ok { + _spec.SetField(hushhistory.FieldSecretName, field.TypeString, value) + _node.SecretName = value + } + if value, ok := hhc.mutation.SecretValue(); ok { + _spec.SetField(hushhistory.FieldSecretValue, field.TypeString, value) + _node.SecretValue = value + } + return _node, _spec +} + +// HushHistoryCreateBulk is the builder for creating many HushHistory entities in bulk. +type HushHistoryCreateBulk struct { + config + err error + builders []*HushHistoryCreate +} + +// Save creates the HushHistory entities in the database. +func (hhcb *HushHistoryCreateBulk) Save(ctx context.Context) ([]*HushHistory, error) { + if hhcb.err != nil { + return nil, hhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(hhcb.builders)) + nodes := make([]*HushHistory, len(hhcb.builders)) + mutators := make([]Mutator, len(hhcb.builders)) + for i := range hhcb.builders { + func(i int, root context.Context) { + builder := hhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*HushHistoryMutation) + 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, hhcb.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, hhcb.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, hhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (hhcb *HushHistoryCreateBulk) SaveX(ctx context.Context) []*HushHistory { + v, err := hhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (hhcb *HushHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := hhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (hhcb *HushHistoryCreateBulk) ExecX(ctx context.Context) { + if err := hhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/hushhistory_delete.go b/internal/ent/generated/hushhistory_delete.go new file mode 100644 index 0000000..c57caa1 --- /dev/null +++ b/internal/ent/generated/hushhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// HushHistoryDelete is the builder for deleting a HushHistory entity. +type HushHistoryDelete struct { + config + hooks []Hook + mutation *HushHistoryMutation +} + +// Where appends a list predicates to the HushHistoryDelete builder. +func (hhd *HushHistoryDelete) Where(ps ...predicate.HushHistory) *HushHistoryDelete { + hhd.mutation.Where(ps...) + return hhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (hhd *HushHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, hhd.sqlExec, hhd.mutation, hhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (hhd *HushHistoryDelete) ExecX(ctx context.Context) int { + n, err := hhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (hhd *HushHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(hushhistory.Table, sqlgraph.NewFieldSpec(hushhistory.FieldID, field.TypeString)) + _spec.Node.Schema = hhd.schemaConfig.HushHistory + ctx = internal.NewSchemaConfigContext(ctx, hhd.schemaConfig) + if ps := hhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, hhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + hhd.mutation.done = true + return affected, err +} + +// HushHistoryDeleteOne is the builder for deleting a single HushHistory entity. +type HushHistoryDeleteOne struct { + hhd *HushHistoryDelete +} + +// Where appends a list predicates to the HushHistoryDelete builder. +func (hhdo *HushHistoryDeleteOne) Where(ps ...predicate.HushHistory) *HushHistoryDeleteOne { + hhdo.hhd.mutation.Where(ps...) + return hhdo +} + +// Exec executes the deletion query. +func (hhdo *HushHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := hhdo.hhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{hushhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (hhdo *HushHistoryDeleteOne) ExecX(ctx context.Context) { + if err := hhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/hushhistory_query.go b/internal/ent/generated/hushhistory_query.go new file mode 100644 index 0000000..f1f0c2c --- /dev/null +++ b/internal/ent/generated/hushhistory_query.go @@ -0,0 +1,549 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// HushHistoryQuery is the builder for querying HushHistory entities. +type HushHistoryQuery struct { + config + ctx *QueryContext + order []hushhistory.OrderOption + inters []Interceptor + predicates []predicate.HushHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*HushHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the HushHistoryQuery builder. +func (hhq *HushHistoryQuery) Where(ps ...predicate.HushHistory) *HushHistoryQuery { + hhq.predicates = append(hhq.predicates, ps...) + return hhq +} + +// Limit the number of records to be returned by this query. +func (hhq *HushHistoryQuery) Limit(limit int) *HushHistoryQuery { + hhq.ctx.Limit = &limit + return hhq +} + +// Offset to start from. +func (hhq *HushHistoryQuery) Offset(offset int) *HushHistoryQuery { + hhq.ctx.Offset = &offset + return hhq +} + +// 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 (hhq *HushHistoryQuery) Unique(unique bool) *HushHistoryQuery { + hhq.ctx.Unique = &unique + return hhq +} + +// Order specifies how the records should be ordered. +func (hhq *HushHistoryQuery) Order(o ...hushhistory.OrderOption) *HushHistoryQuery { + hhq.order = append(hhq.order, o...) + return hhq +} + +// First returns the first HushHistory entity from the query. +// Returns a *NotFoundError when no HushHistory was found. +func (hhq *HushHistoryQuery) First(ctx context.Context) (*HushHistory, error) { + nodes, err := hhq.Limit(1).All(setContextOp(ctx, hhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{hushhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (hhq *HushHistoryQuery) FirstX(ctx context.Context) *HushHistory { + node, err := hhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first HushHistory ID from the query. +// Returns a *NotFoundError when no HushHistory ID was found. +func (hhq *HushHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = hhq.Limit(1).IDs(setContextOp(ctx, hhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{hushhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (hhq *HushHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := hhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single HushHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one HushHistory entity is found. +// Returns a *NotFoundError when no HushHistory entities are found. +func (hhq *HushHistoryQuery) Only(ctx context.Context) (*HushHistory, error) { + nodes, err := hhq.Limit(2).All(setContextOp(ctx, hhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{hushhistory.Label} + default: + return nil, &NotSingularError{hushhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (hhq *HushHistoryQuery) OnlyX(ctx context.Context) *HushHistory { + node, err := hhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only HushHistory ID in the query. +// Returns a *NotSingularError when more than one HushHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (hhq *HushHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = hhq.Limit(2).IDs(setContextOp(ctx, hhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{hushhistory.Label} + default: + err = &NotSingularError{hushhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (hhq *HushHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := hhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of HushHistories. +func (hhq *HushHistoryQuery) All(ctx context.Context) ([]*HushHistory, error) { + ctx = setContextOp(ctx, hhq.ctx, ent.OpQueryAll) + if err := hhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*HushHistory, *HushHistoryQuery]() + return withInterceptors[[]*HushHistory](ctx, hhq, qr, hhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (hhq *HushHistoryQuery) AllX(ctx context.Context) []*HushHistory { + nodes, err := hhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of HushHistory IDs. +func (hhq *HushHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if hhq.ctx.Unique == nil && hhq.path != nil { + hhq.Unique(true) + } + ctx = setContextOp(ctx, hhq.ctx, ent.OpQueryIDs) + if err = hhq.Select(hushhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (hhq *HushHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := hhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (hhq *HushHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, hhq.ctx, ent.OpQueryCount) + if err := hhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, hhq, querierCount[*HushHistoryQuery](), hhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (hhq *HushHistoryQuery) CountX(ctx context.Context) int { + count, err := hhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (hhq *HushHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, hhq.ctx, ent.OpQueryExist) + switch _, err := hhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (hhq *HushHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := hhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the HushHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (hhq *HushHistoryQuery) Clone() *HushHistoryQuery { + if hhq == nil { + return nil + } + return &HushHistoryQuery{ + config: hhq.config, + ctx: hhq.ctx.Clone(), + order: append([]hushhistory.OrderOption{}, hhq.order...), + inters: append([]Interceptor{}, hhq.inters...), + predicates: append([]predicate.HushHistory{}, hhq.predicates...), + // clone intermediate query. + sql: hhq.sql.Clone(), + path: hhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.HushHistory.Query(). +// GroupBy(hushhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (hhq *HushHistoryQuery) GroupBy(field string, fields ...string) *HushHistoryGroupBy { + hhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &HushHistoryGroupBy{build: hhq} + grbuild.flds = &hhq.ctx.Fields + grbuild.label = hushhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.HushHistory.Query(). +// Select(hushhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (hhq *HushHistoryQuery) Select(fields ...string) *HushHistorySelect { + hhq.ctx.Fields = append(hhq.ctx.Fields, fields...) + sbuild := &HushHistorySelect{HushHistoryQuery: hhq} + sbuild.label = hushhistory.Label + sbuild.flds, sbuild.scan = &hhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a HushHistorySelect configured with the given aggregations. +func (hhq *HushHistoryQuery) Aggregate(fns ...AggregateFunc) *HushHistorySelect { + return hhq.Select().Aggregate(fns...) +} + +func (hhq *HushHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range hhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, hhq); err != nil { + return err + } + } + } + for _, f := range hhq.ctx.Fields { + if !hushhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if hhq.path != nil { + prev, err := hhq.path(ctx) + if err != nil { + return err + } + hhq.sql = prev + } + return nil +} + +func (hhq *HushHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*HushHistory, error) { + var ( + nodes = []*HushHistory{} + _spec = hhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*HushHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &HushHistory{config: hhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = hhq.schemaConfig.HushHistory + ctx = internal.NewSchemaConfigContext(ctx, hhq.schemaConfig) + if len(hhq.modifiers) > 0 { + _spec.Modifiers = hhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, hhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range hhq.loadTotal { + if err := hhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (hhq *HushHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := hhq.querySpec() + _spec.Node.Schema = hhq.schemaConfig.HushHistory + ctx = internal.NewSchemaConfigContext(ctx, hhq.schemaConfig) + if len(hhq.modifiers) > 0 { + _spec.Modifiers = hhq.modifiers + } + _spec.Node.Columns = hhq.ctx.Fields + if len(hhq.ctx.Fields) > 0 { + _spec.Unique = hhq.ctx.Unique != nil && *hhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, hhq.driver, _spec) +} + +func (hhq *HushHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(hushhistory.Table, hushhistory.Columns, sqlgraph.NewFieldSpec(hushhistory.FieldID, field.TypeString)) + _spec.From = hhq.sql + if unique := hhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if hhq.path != nil { + _spec.Unique = true + } + if fields := hhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, hushhistory.FieldID) + for i := range fields { + if fields[i] != hushhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := hhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := hhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := hhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := hhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (hhq *HushHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(hhq.driver.Dialect()) + t1 := builder.Table(hushhistory.Table) + columns := hhq.ctx.Fields + if len(columns) == 0 { + columns = hushhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if hhq.sql != nil { + selector = hhq.sql + selector.Select(selector.Columns(columns...)...) + } + if hhq.ctx.Unique != nil && *hhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(hhq.schemaConfig.HushHistory) + ctx = internal.NewSchemaConfigContext(ctx, hhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range hhq.predicates { + p(selector) + } + for _, p := range hhq.order { + p(selector) + } + if offset := hhq.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 := hhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// HushHistoryGroupBy is the group-by builder for HushHistory entities. +type HushHistoryGroupBy struct { + selector + build *HushHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (hhgb *HushHistoryGroupBy) Aggregate(fns ...AggregateFunc) *HushHistoryGroupBy { + hhgb.fns = append(hhgb.fns, fns...) + return hhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (hhgb *HushHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, hhgb.build.ctx, ent.OpQueryGroupBy) + if err := hhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*HushHistoryQuery, *HushHistoryGroupBy](ctx, hhgb.build, hhgb, hhgb.build.inters, v) +} + +func (hhgb *HushHistoryGroupBy) sqlScan(ctx context.Context, root *HushHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(hhgb.fns)) + for _, fn := range hhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*hhgb.flds)+len(hhgb.fns)) + for _, f := range *hhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*hhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := hhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// HushHistorySelect is the builder for selecting fields of HushHistory entities. +type HushHistorySelect struct { + *HushHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (hhs *HushHistorySelect) Aggregate(fns ...AggregateFunc) *HushHistorySelect { + hhs.fns = append(hhs.fns, fns...) + return hhs +} + +// Scan applies the selector query and scans the result into the given value. +func (hhs *HushHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, hhs.ctx, ent.OpQuerySelect) + if err := hhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*HushHistoryQuery, *HushHistorySelect](ctx, hhs.HushHistoryQuery, hhs, hhs.inters, v) +} + +func (hhs *HushHistorySelect) sqlScan(ctx context.Context, root *HushHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(hhs.fns)) + for _, fn := range hhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*hhs.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 := hhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/hushhistory_update.go b/internal/ent/generated/hushhistory_update.go new file mode 100644 index 0000000..e337e8e --- /dev/null +++ b/internal/ent/generated/hushhistory_update.go @@ -0,0 +1,560 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// HushHistoryUpdate is the builder for updating HushHistory entities. +type HushHistoryUpdate struct { + config + hooks []Hook + mutation *HushHistoryMutation +} + +// Where appends a list predicates to the HushHistoryUpdate builder. +func (hhu *HushHistoryUpdate) Where(ps ...predicate.HushHistory) *HushHistoryUpdate { + hhu.mutation.Where(ps...) + return hhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (hhu *HushHistoryUpdate) SetUpdatedAt(t time.Time) *HushHistoryUpdate { + hhu.mutation.SetUpdatedAt(t) + return hhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (hhu *HushHistoryUpdate) ClearUpdatedAt() *HushHistoryUpdate { + hhu.mutation.ClearUpdatedAt() + return hhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (hhu *HushHistoryUpdate) SetUpdatedBy(s string) *HushHistoryUpdate { + hhu.mutation.SetUpdatedBy(s) + return hhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (hhu *HushHistoryUpdate) SetNillableUpdatedBy(s *string) *HushHistoryUpdate { + if s != nil { + hhu.SetUpdatedBy(*s) + } + return hhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (hhu *HushHistoryUpdate) ClearUpdatedBy() *HushHistoryUpdate { + hhu.mutation.ClearUpdatedBy() + return hhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (hhu *HushHistoryUpdate) SetDeletedAt(t time.Time) *HushHistoryUpdate { + hhu.mutation.SetDeletedAt(t) + return hhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (hhu *HushHistoryUpdate) SetNillableDeletedAt(t *time.Time) *HushHistoryUpdate { + if t != nil { + hhu.SetDeletedAt(*t) + } + return hhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (hhu *HushHistoryUpdate) ClearDeletedAt() *HushHistoryUpdate { + hhu.mutation.ClearDeletedAt() + return hhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (hhu *HushHistoryUpdate) SetDeletedBy(s string) *HushHistoryUpdate { + hhu.mutation.SetDeletedBy(s) + return hhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (hhu *HushHistoryUpdate) SetNillableDeletedBy(s *string) *HushHistoryUpdate { + if s != nil { + hhu.SetDeletedBy(*s) + } + return hhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (hhu *HushHistoryUpdate) ClearDeletedBy() *HushHistoryUpdate { + hhu.mutation.ClearDeletedBy() + return hhu +} + +// SetName sets the "name" field. +func (hhu *HushHistoryUpdate) SetName(s string) *HushHistoryUpdate { + hhu.mutation.SetName(s) + return hhu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (hhu *HushHistoryUpdate) SetNillableName(s *string) *HushHistoryUpdate { + if s != nil { + hhu.SetName(*s) + } + return hhu +} + +// SetDescription sets the "description" field. +func (hhu *HushHistoryUpdate) SetDescription(s string) *HushHistoryUpdate { + hhu.mutation.SetDescription(s) + return hhu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (hhu *HushHistoryUpdate) SetNillableDescription(s *string) *HushHistoryUpdate { + if s != nil { + hhu.SetDescription(*s) + } + return hhu +} + +// ClearDescription clears the value of the "description" field. +func (hhu *HushHistoryUpdate) ClearDescription() *HushHistoryUpdate { + hhu.mutation.ClearDescription() + return hhu +} + +// SetKind sets the "kind" field. +func (hhu *HushHistoryUpdate) SetKind(s string) *HushHistoryUpdate { + hhu.mutation.SetKind(s) + return hhu +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (hhu *HushHistoryUpdate) SetNillableKind(s *string) *HushHistoryUpdate { + if s != nil { + hhu.SetKind(*s) + } + return hhu +} + +// ClearKind clears the value of the "kind" field. +func (hhu *HushHistoryUpdate) ClearKind() *HushHistoryUpdate { + hhu.mutation.ClearKind() + return hhu +} + +// Mutation returns the HushHistoryMutation object of the builder. +func (hhu *HushHistoryUpdate) Mutation() *HushHistoryMutation { + return hhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (hhu *HushHistoryUpdate) Save(ctx context.Context) (int, error) { + hhu.defaults() + return withHooks(ctx, hhu.sqlSave, hhu.mutation, hhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (hhu *HushHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := hhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (hhu *HushHistoryUpdate) Exec(ctx context.Context) error { + _, err := hhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (hhu *HushHistoryUpdate) ExecX(ctx context.Context) { + if err := hhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (hhu *HushHistoryUpdate) defaults() { + if _, ok := hhu.mutation.UpdatedAt(); !ok && !hhu.mutation.UpdatedAtCleared() { + v := hushhistory.UpdateDefaultUpdatedAt() + hhu.mutation.SetUpdatedAt(v) + } +} + +func (hhu *HushHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(hushhistory.Table, hushhistory.Columns, sqlgraph.NewFieldSpec(hushhistory.FieldID, field.TypeString)) + if ps := hhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if hhu.mutation.RefCleared() { + _spec.ClearField(hushhistory.FieldRef, field.TypeString) + } + if hhu.mutation.CreatedAtCleared() { + _spec.ClearField(hushhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := hhu.mutation.UpdatedAt(); ok { + _spec.SetField(hushhistory.FieldUpdatedAt, field.TypeTime, value) + } + if hhu.mutation.UpdatedAtCleared() { + _spec.ClearField(hushhistory.FieldUpdatedAt, field.TypeTime) + } + if hhu.mutation.CreatedByCleared() { + _spec.ClearField(hushhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := hhu.mutation.UpdatedBy(); ok { + _spec.SetField(hushhistory.FieldUpdatedBy, field.TypeString, value) + } + if hhu.mutation.UpdatedByCleared() { + _spec.ClearField(hushhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := hhu.mutation.DeletedAt(); ok { + _spec.SetField(hushhistory.FieldDeletedAt, field.TypeTime, value) + } + if hhu.mutation.DeletedAtCleared() { + _spec.ClearField(hushhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := hhu.mutation.DeletedBy(); ok { + _spec.SetField(hushhistory.FieldDeletedBy, field.TypeString, value) + } + if hhu.mutation.DeletedByCleared() { + _spec.ClearField(hushhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := hhu.mutation.Name(); ok { + _spec.SetField(hushhistory.FieldName, field.TypeString, value) + } + if value, ok := hhu.mutation.Description(); ok { + _spec.SetField(hushhistory.FieldDescription, field.TypeString, value) + } + if hhu.mutation.DescriptionCleared() { + _spec.ClearField(hushhistory.FieldDescription, field.TypeString) + } + if value, ok := hhu.mutation.Kind(); ok { + _spec.SetField(hushhistory.FieldKind, field.TypeString, value) + } + if hhu.mutation.KindCleared() { + _spec.ClearField(hushhistory.FieldKind, field.TypeString) + } + if hhu.mutation.SecretNameCleared() { + _spec.ClearField(hushhistory.FieldSecretName, field.TypeString) + } + if hhu.mutation.SecretValueCleared() { + _spec.ClearField(hushhistory.FieldSecretValue, field.TypeString) + } + _spec.Node.Schema = hhu.schemaConfig.HushHistory + ctx = internal.NewSchemaConfigContext(ctx, hhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, hhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{hushhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + hhu.mutation.done = true + return n, nil +} + +// HushHistoryUpdateOne is the builder for updating a single HushHistory entity. +type HushHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *HushHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (hhuo *HushHistoryUpdateOne) SetUpdatedAt(t time.Time) *HushHistoryUpdateOne { + hhuo.mutation.SetUpdatedAt(t) + return hhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (hhuo *HushHistoryUpdateOne) ClearUpdatedAt() *HushHistoryUpdateOne { + hhuo.mutation.ClearUpdatedAt() + return hhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (hhuo *HushHistoryUpdateOne) SetUpdatedBy(s string) *HushHistoryUpdateOne { + hhuo.mutation.SetUpdatedBy(s) + return hhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (hhuo *HushHistoryUpdateOne) SetNillableUpdatedBy(s *string) *HushHistoryUpdateOne { + if s != nil { + hhuo.SetUpdatedBy(*s) + } + return hhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (hhuo *HushHistoryUpdateOne) ClearUpdatedBy() *HushHistoryUpdateOne { + hhuo.mutation.ClearUpdatedBy() + return hhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (hhuo *HushHistoryUpdateOne) SetDeletedAt(t time.Time) *HushHistoryUpdateOne { + hhuo.mutation.SetDeletedAt(t) + return hhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (hhuo *HushHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *HushHistoryUpdateOne { + if t != nil { + hhuo.SetDeletedAt(*t) + } + return hhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (hhuo *HushHistoryUpdateOne) ClearDeletedAt() *HushHistoryUpdateOne { + hhuo.mutation.ClearDeletedAt() + return hhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (hhuo *HushHistoryUpdateOne) SetDeletedBy(s string) *HushHistoryUpdateOne { + hhuo.mutation.SetDeletedBy(s) + return hhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (hhuo *HushHistoryUpdateOne) SetNillableDeletedBy(s *string) *HushHistoryUpdateOne { + if s != nil { + hhuo.SetDeletedBy(*s) + } + return hhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (hhuo *HushHistoryUpdateOne) ClearDeletedBy() *HushHistoryUpdateOne { + hhuo.mutation.ClearDeletedBy() + return hhuo +} + +// SetName sets the "name" field. +func (hhuo *HushHistoryUpdateOne) SetName(s string) *HushHistoryUpdateOne { + hhuo.mutation.SetName(s) + return hhuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (hhuo *HushHistoryUpdateOne) SetNillableName(s *string) *HushHistoryUpdateOne { + if s != nil { + hhuo.SetName(*s) + } + return hhuo +} + +// SetDescription sets the "description" field. +func (hhuo *HushHistoryUpdateOne) SetDescription(s string) *HushHistoryUpdateOne { + hhuo.mutation.SetDescription(s) + return hhuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (hhuo *HushHistoryUpdateOne) SetNillableDescription(s *string) *HushHistoryUpdateOne { + if s != nil { + hhuo.SetDescription(*s) + } + return hhuo +} + +// ClearDescription clears the value of the "description" field. +func (hhuo *HushHistoryUpdateOne) ClearDescription() *HushHistoryUpdateOne { + hhuo.mutation.ClearDescription() + return hhuo +} + +// SetKind sets the "kind" field. +func (hhuo *HushHistoryUpdateOne) SetKind(s string) *HushHistoryUpdateOne { + hhuo.mutation.SetKind(s) + return hhuo +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (hhuo *HushHistoryUpdateOne) SetNillableKind(s *string) *HushHistoryUpdateOne { + if s != nil { + hhuo.SetKind(*s) + } + return hhuo +} + +// ClearKind clears the value of the "kind" field. +func (hhuo *HushHistoryUpdateOne) ClearKind() *HushHistoryUpdateOne { + hhuo.mutation.ClearKind() + return hhuo +} + +// Mutation returns the HushHistoryMutation object of the builder. +func (hhuo *HushHistoryUpdateOne) Mutation() *HushHistoryMutation { + return hhuo.mutation +} + +// Where appends a list predicates to the HushHistoryUpdate builder. +func (hhuo *HushHistoryUpdateOne) Where(ps ...predicate.HushHistory) *HushHistoryUpdateOne { + hhuo.mutation.Where(ps...) + return hhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (hhuo *HushHistoryUpdateOne) Select(field string, fields ...string) *HushHistoryUpdateOne { + hhuo.fields = append([]string{field}, fields...) + return hhuo +} + +// Save executes the query and returns the updated HushHistory entity. +func (hhuo *HushHistoryUpdateOne) Save(ctx context.Context) (*HushHistory, error) { + hhuo.defaults() + return withHooks(ctx, hhuo.sqlSave, hhuo.mutation, hhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (hhuo *HushHistoryUpdateOne) SaveX(ctx context.Context) *HushHistory { + node, err := hhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (hhuo *HushHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := hhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (hhuo *HushHistoryUpdateOne) ExecX(ctx context.Context) { + if err := hhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (hhuo *HushHistoryUpdateOne) defaults() { + if _, ok := hhuo.mutation.UpdatedAt(); !ok && !hhuo.mutation.UpdatedAtCleared() { + v := hushhistory.UpdateDefaultUpdatedAt() + hhuo.mutation.SetUpdatedAt(v) + } +} + +func (hhuo *HushHistoryUpdateOne) sqlSave(ctx context.Context) (_node *HushHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(hushhistory.Table, hushhistory.Columns, sqlgraph.NewFieldSpec(hushhistory.FieldID, field.TypeString)) + id, ok := hhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "HushHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := hhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, hushhistory.FieldID) + for _, f := range fields { + if !hushhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != hushhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := hhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if hhuo.mutation.RefCleared() { + _spec.ClearField(hushhistory.FieldRef, field.TypeString) + } + if hhuo.mutation.CreatedAtCleared() { + _spec.ClearField(hushhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := hhuo.mutation.UpdatedAt(); ok { + _spec.SetField(hushhistory.FieldUpdatedAt, field.TypeTime, value) + } + if hhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(hushhistory.FieldUpdatedAt, field.TypeTime) + } + if hhuo.mutation.CreatedByCleared() { + _spec.ClearField(hushhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := hhuo.mutation.UpdatedBy(); ok { + _spec.SetField(hushhistory.FieldUpdatedBy, field.TypeString, value) + } + if hhuo.mutation.UpdatedByCleared() { + _spec.ClearField(hushhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := hhuo.mutation.DeletedAt(); ok { + _spec.SetField(hushhistory.FieldDeletedAt, field.TypeTime, value) + } + if hhuo.mutation.DeletedAtCleared() { + _spec.ClearField(hushhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := hhuo.mutation.DeletedBy(); ok { + _spec.SetField(hushhistory.FieldDeletedBy, field.TypeString, value) + } + if hhuo.mutation.DeletedByCleared() { + _spec.ClearField(hushhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := hhuo.mutation.Name(); ok { + _spec.SetField(hushhistory.FieldName, field.TypeString, value) + } + if value, ok := hhuo.mutation.Description(); ok { + _spec.SetField(hushhistory.FieldDescription, field.TypeString, value) + } + if hhuo.mutation.DescriptionCleared() { + _spec.ClearField(hushhistory.FieldDescription, field.TypeString) + } + if value, ok := hhuo.mutation.Kind(); ok { + _spec.SetField(hushhistory.FieldKind, field.TypeString, value) + } + if hhuo.mutation.KindCleared() { + _spec.ClearField(hushhistory.FieldKind, field.TypeString) + } + if hhuo.mutation.SecretNameCleared() { + _spec.ClearField(hushhistory.FieldSecretName, field.TypeString) + } + if hhuo.mutation.SecretValueCleared() { + _spec.ClearField(hushhistory.FieldSecretValue, field.TypeString) + } + _spec.Node.Schema = hhuo.schemaConfig.HushHistory + ctx = internal.NewSchemaConfigContext(ctx, hhuo.schemaConfig) + _node = &HushHistory{config: hhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, hhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{hushhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + hhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/integration.go b/internal/ent/generated/integration.go new file mode 100644 index 0000000..7e4fc74 --- /dev/null +++ b/internal/ent/generated/integration.go @@ -0,0 +1,436 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// Integration is the model entity for the Integration schema. +type Integration struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name,omitempty"` + // a description of the integration + Description string `json:"description,omitempty"` + // Kind holds the value of the "kind" field. + Kind string `json:"kind,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the IntegrationQuery when eager-loading is set. + Edges IntegrationEdges `json:"edges"` + group_integrations *string + selectValues sql.SelectValues +} + +// IntegrationEdges holds the relations/edges for other nodes in the graph. +type IntegrationEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // the secrets associated with the integration + Secrets []*Hush `json:"secrets,omitempty"` + // the oauth2 tokens associated with the integration + Oauth2tokens []*OhAuthTooToken `json:"oauth2tokens,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // Webhooks holds the value of the webhooks edge. + Webhooks []*Webhook `json:"webhooks,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [5]bool + // totalCount holds the count of the edges above. + totalCount [5]map[string]int + + namedSecrets map[string][]*Hush + namedOauth2tokens map[string][]*OhAuthTooToken + namedEvents map[string][]*Event + namedWebhooks map[string][]*Webhook +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e IntegrationEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// SecretsOrErr returns the Secrets value or an error if the edge +// was not loaded in eager-loading. +func (e IntegrationEdges) SecretsOrErr() ([]*Hush, error) { + if e.loadedTypes[1] { + return e.Secrets, nil + } + return nil, &NotLoadedError{edge: "secrets"} +} + +// Oauth2tokensOrErr returns the Oauth2tokens value or an error if the edge +// was not loaded in eager-loading. +func (e IntegrationEdges) Oauth2tokensOrErr() ([]*OhAuthTooToken, error) { + if e.loadedTypes[2] { + return e.Oauth2tokens, nil + } + return nil, &NotLoadedError{edge: "oauth2tokens"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e IntegrationEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[3] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// WebhooksOrErr returns the Webhooks value or an error if the edge +// was not loaded in eager-loading. +func (e IntegrationEdges) WebhooksOrErr() ([]*Webhook, error) { + if e.loadedTypes[4] { + return e.Webhooks, nil + } + return nil, &NotLoadedError{edge: "webhooks"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Integration) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case integration.FieldTags: + values[i] = new([]byte) + case integration.FieldID, integration.FieldCreatedBy, integration.FieldUpdatedBy, integration.FieldMappingID, integration.FieldDeletedBy, integration.FieldOwnerID, integration.FieldName, integration.FieldDescription, integration.FieldKind: + values[i] = new(sql.NullString) + case integration.FieldCreatedAt, integration.FieldUpdatedAt, integration.FieldDeletedAt: + values[i] = new(sql.NullTime) + case integration.ForeignKeys[0]: // group_integrations + values[i] = new(sql.NullString) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Integration fields. +func (i *Integration) 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 j := range columns { + switch columns[j] { + case integration.FieldID: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[j]) + } else if value.Valid { + i.ID = value.String + } + case integration.FieldCreatedAt: + if value, ok := values[j].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[j]) + } else if value.Valid { + i.CreatedAt = value.Time + } + case integration.FieldUpdatedAt: + if value, ok := values[j].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[j]) + } else if value.Valid { + i.UpdatedAt = value.Time + } + case integration.FieldCreatedBy: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[j]) + } else if value.Valid { + i.CreatedBy = value.String + } + case integration.FieldUpdatedBy: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[j]) + } else if value.Valid { + i.UpdatedBy = value.String + } + case integration.FieldMappingID: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[j]) + } else if value.Valid { + i.MappingID = value.String + } + case integration.FieldTags: + if value, ok := values[j].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[j]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &i.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case integration.FieldDeletedAt: + if value, ok := values[j].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[j]) + } else if value.Valid { + i.DeletedAt = value.Time + } + case integration.FieldDeletedBy: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[j]) + } else if value.Valid { + i.DeletedBy = value.String + } + case integration.FieldOwnerID: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[j]) + } else if value.Valid { + i.OwnerID = value.String + } + case integration.FieldName: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[j]) + } else if value.Valid { + i.Name = value.String + } + case integration.FieldDescription: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[j]) + } else if value.Valid { + i.Description = value.String + } + case integration.FieldKind: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field kind", values[j]) + } else if value.Valid { + i.Kind = value.String + } + case integration.ForeignKeys[0]: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field group_integrations", values[j]) + } else if value.Valid { + i.group_integrations = new(string) + *i.group_integrations = value.String + } + default: + i.selectValues.Set(columns[j], values[j]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Integration. +// This includes values selected through modifiers, order, etc. +func (i *Integration) Value(name string) (ent.Value, error) { + return i.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Integration entity. +func (i *Integration) QueryOwner() *OrganizationQuery { + return NewIntegrationClient(i.config).QueryOwner(i) +} + +// QuerySecrets queries the "secrets" edge of the Integration entity. +func (i *Integration) QuerySecrets() *HushQuery { + return NewIntegrationClient(i.config).QuerySecrets(i) +} + +// QueryOauth2tokens queries the "oauth2tokens" edge of the Integration entity. +func (i *Integration) QueryOauth2tokens() *OhAuthTooTokenQuery { + return NewIntegrationClient(i.config).QueryOauth2tokens(i) +} + +// QueryEvents queries the "events" edge of the Integration entity. +func (i *Integration) QueryEvents() *EventQuery { + return NewIntegrationClient(i.config).QueryEvents(i) +} + +// QueryWebhooks queries the "webhooks" edge of the Integration entity. +func (i *Integration) QueryWebhooks() *WebhookQuery { + return NewIntegrationClient(i.config).QueryWebhooks(i) +} + +// Update returns a builder for updating this Integration. +// Note that you need to call Integration.Unwrap() before calling this method if this Integration +// was returned from a transaction, and the transaction was committed or rolled back. +func (i *Integration) Update() *IntegrationUpdateOne { + return NewIntegrationClient(i.config).UpdateOne(i) +} + +// Unwrap unwraps the Integration 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 (i *Integration) Unwrap() *Integration { + _tx, ok := i.config.driver.(*txDriver) + if !ok { + panic("generated: Integration is not a transactional entity") + } + i.config.driver = _tx.drv + return i +} + +// String implements the fmt.Stringer. +func (i *Integration) String() string { + var builder strings.Builder + builder.WriteString("Integration(") + builder.WriteString(fmt.Sprintf("id=%v, ", i.ID)) + builder.WriteString("created_at=") + builder.WriteString(i.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(i.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(i.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(i.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(i.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", i.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(i.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(i.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(i.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(i.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(i.Description) + builder.WriteString(", ") + builder.WriteString("kind=") + builder.WriteString(i.Kind) + builder.WriteByte(')') + return builder.String() +} + +// NamedSecrets returns the Secrets named value or an error if the edge was not +// loaded in eager-loading with this name. +func (i *Integration) NamedSecrets(name string) ([]*Hush, error) { + if i.Edges.namedSecrets == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := i.Edges.namedSecrets[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (i *Integration) appendNamedSecrets(name string, edges ...*Hush) { + if i.Edges.namedSecrets == nil { + i.Edges.namedSecrets = make(map[string][]*Hush) + } + if len(edges) == 0 { + i.Edges.namedSecrets[name] = []*Hush{} + } else { + i.Edges.namedSecrets[name] = append(i.Edges.namedSecrets[name], edges...) + } +} + +// NamedOauth2tokens returns the Oauth2tokens named value or an error if the edge was not +// loaded in eager-loading with this name. +func (i *Integration) NamedOauth2tokens(name string) ([]*OhAuthTooToken, error) { + if i.Edges.namedOauth2tokens == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := i.Edges.namedOauth2tokens[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (i *Integration) appendNamedOauth2tokens(name string, edges ...*OhAuthTooToken) { + if i.Edges.namedOauth2tokens == nil { + i.Edges.namedOauth2tokens = make(map[string][]*OhAuthTooToken) + } + if len(edges) == 0 { + i.Edges.namedOauth2tokens[name] = []*OhAuthTooToken{} + } else { + i.Edges.namedOauth2tokens[name] = append(i.Edges.namedOauth2tokens[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (i *Integration) NamedEvents(name string) ([]*Event, error) { + if i.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := i.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (i *Integration) appendNamedEvents(name string, edges ...*Event) { + if i.Edges.namedEvents == nil { + i.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + i.Edges.namedEvents[name] = []*Event{} + } else { + i.Edges.namedEvents[name] = append(i.Edges.namedEvents[name], edges...) + } +} + +// NamedWebhooks returns the Webhooks named value or an error if the edge was not +// loaded in eager-loading with this name. +func (i *Integration) NamedWebhooks(name string) ([]*Webhook, error) { + if i.Edges.namedWebhooks == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := i.Edges.namedWebhooks[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (i *Integration) appendNamedWebhooks(name string, edges ...*Webhook) { + if i.Edges.namedWebhooks == nil { + i.Edges.namedWebhooks = make(map[string][]*Webhook) + } + if len(edges) == 0 { + i.Edges.namedWebhooks[name] = []*Webhook{} + } else { + i.Edges.namedWebhooks[name] = append(i.Edges.namedWebhooks[name], edges...) + } +} + +// Integrations is a parsable slice of Integration. +type Integrations []*Integration diff --git a/internal/ent/generated/integration/integration.go b/internal/ent/generated/integration/integration.go new file mode 100644 index 0000000..f667922 --- /dev/null +++ b/internal/ent/generated/integration/integration.go @@ -0,0 +1,322 @@ +// Code generated by ent, DO NOT EDIT. + +package integration + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the integration type in the database. + Label = "integration" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldKind holds the string denoting the kind field in the database. + FieldKind = "kind" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeSecrets holds the string denoting the secrets edge name in mutations. + EdgeSecrets = "secrets" + // EdgeOauth2tokens holds the string denoting the oauth2tokens edge name in mutations. + EdgeOauth2tokens = "oauth2tokens" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // EdgeWebhooks holds the string denoting the webhooks edge name in mutations. + EdgeWebhooks = "webhooks" + // Table holds the table name of the integration in the database. + Table = "integrations" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "integrations" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // SecretsTable is the table that holds the secrets relation/edge. The primary key declared below. + SecretsTable = "integration_secrets" + // SecretsInverseTable is the table name for the Hush entity. + // It exists in this package in order to avoid circular dependency with the "hush" package. + SecretsInverseTable = "hushes" + // Oauth2tokensTable is the table that holds the oauth2tokens relation/edge. The primary key declared below. + Oauth2tokensTable = "integration_oauth2tokens" + // Oauth2tokensInverseTable is the table name for the OhAuthTooToken entity. + // It exists in this package in order to avoid circular dependency with the "ohauthtootoken" package. + Oauth2tokensInverseTable = "oh_auth_too_tokens" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "integration_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" + // WebhooksTable is the table that holds the webhooks relation/edge. The primary key declared below. + WebhooksTable = "integration_webhooks" + // WebhooksInverseTable is the table name for the Webhook entity. + // It exists in this package in order to avoid circular dependency with the "webhook" package. + WebhooksInverseTable = "webhooks" +) + +// Columns holds all SQL columns for integration fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldName, + FieldDescription, + FieldKind, +} + +// ForeignKeys holds the SQL foreign-keys that are owned by the "integrations" +// table and are not defined as standalone fields in the schema. +var ForeignKeys = []string{ + "group_integrations", +} + +var ( + // SecretsPrimaryKey and SecretsColumn2 are the table columns denoting the + // primary key for the secrets relation (M2M). + SecretsPrimaryKey = []string{"integration_id", "hush_id"} + // Oauth2tokensPrimaryKey and Oauth2tokensColumn2 are the table columns denoting the + // primary key for the oauth2tokens relation (M2M). + Oauth2tokensPrimaryKey = []string{"integration_id", "oh_auth_too_token_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"integration_id", "event_id"} + // WebhooksPrimaryKey and WebhooksColumn2 are the table columns denoting the + // primary key for the webhooks relation (M2M). + WebhooksPrimaryKey = []string{"integration_id", "webhook_id"} +) + +// 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 +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Integration queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByKind orders the results by the kind field. +func ByKind(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldKind, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// BySecretsCount orders the results by secrets count. +func BySecretsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newSecretsStep(), opts...) + } +} + +// BySecrets orders the results by secrets terms. +func BySecrets(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newSecretsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOauth2tokensCount orders the results by oauth2tokens count. +func ByOauth2tokensCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOauth2tokensStep(), opts...) + } +} + +// ByOauth2tokens orders the results by oauth2tokens terms. +func ByOauth2tokens(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOauth2tokensStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByWebhooksCount orders the results by webhooks count. +func ByWebhooksCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newWebhooksStep(), opts...) + } +} + +// ByWebhooks orders the results by webhooks terms. +func ByWebhooks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newWebhooksStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newSecretsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(SecretsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, SecretsTable, SecretsPrimaryKey...), + ) +} +func newOauth2tokensStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Oauth2tokensInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, Oauth2tokensTable, Oauth2tokensPrimaryKey...), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} +func newWebhooksStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(WebhooksInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, WebhooksTable, WebhooksPrimaryKey...), + ) +} diff --git a/internal/ent/generated/integration/where.go b/internal/ent/generated/integration/where.go new file mode 100644 index 0000000..4dc32d5 --- /dev/null +++ b/internal/ent/generated/integration/where.go @@ -0,0 +1,1023 @@ +// Code generated by ent, DO NOT EDIT. + +package integration + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldDescription, v)) +} + +// Kind applies equality check predicate on the "kind" field. It's identical to KindEQ. +func Kind(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldKind, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldDescription, v)) +} + +// KindEQ applies the EQ predicate on the "kind" field. +func KindEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldEQ(FieldKind, v)) +} + +// KindNEQ applies the NEQ predicate on the "kind" field. +func KindNEQ(v string) predicate.Integration { + return predicate.Integration(sql.FieldNEQ(FieldKind, v)) +} + +// KindIn applies the In predicate on the "kind" field. +func KindIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldIn(FieldKind, vs...)) +} + +// KindNotIn applies the NotIn predicate on the "kind" field. +func KindNotIn(vs ...string) predicate.Integration { + return predicate.Integration(sql.FieldNotIn(FieldKind, vs...)) +} + +// KindGT applies the GT predicate on the "kind" field. +func KindGT(v string) predicate.Integration { + return predicate.Integration(sql.FieldGT(FieldKind, v)) +} + +// KindGTE applies the GTE predicate on the "kind" field. +func KindGTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldGTE(FieldKind, v)) +} + +// KindLT applies the LT predicate on the "kind" field. +func KindLT(v string) predicate.Integration { + return predicate.Integration(sql.FieldLT(FieldKind, v)) +} + +// KindLTE applies the LTE predicate on the "kind" field. +func KindLTE(v string) predicate.Integration { + return predicate.Integration(sql.FieldLTE(FieldKind, v)) +} + +// KindContains applies the Contains predicate on the "kind" field. +func KindContains(v string) predicate.Integration { + return predicate.Integration(sql.FieldContains(FieldKind, v)) +} + +// KindHasPrefix applies the HasPrefix predicate on the "kind" field. +func KindHasPrefix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasPrefix(FieldKind, v)) +} + +// KindHasSuffix applies the HasSuffix predicate on the "kind" field. +func KindHasSuffix(v string) predicate.Integration { + return predicate.Integration(sql.FieldHasSuffix(FieldKind, v)) +} + +// KindIsNil applies the IsNil predicate on the "kind" field. +func KindIsNil() predicate.Integration { + return predicate.Integration(sql.FieldIsNull(FieldKind)) +} + +// KindNotNil applies the NotNil predicate on the "kind" field. +func KindNotNil() predicate.Integration { + return predicate.Integration(sql.FieldNotNull(FieldKind)) +} + +// KindEqualFold applies the EqualFold predicate on the "kind" field. +func KindEqualFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldEqualFold(FieldKind, v)) +} + +// KindContainsFold applies the ContainsFold predicate on the "kind" field. +func KindContainsFold(v string) predicate.Integration { + return predicate.Integration(sql.FieldContainsFold(FieldKind, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Integration + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Integration + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasSecrets applies the HasEdge predicate on the "secrets" edge. +func HasSecrets() predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, SecretsTable, SecretsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.IntegrationSecrets + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasSecretsWith applies the HasEdge predicate on the "secrets" edge with a given conditions (other predicates). +func HasSecretsWith(preds ...predicate.Hush) predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := newSecretsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.IntegrationSecrets + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOauth2tokens applies the HasEdge predicate on the "oauth2tokens" edge. +func HasOauth2tokens() predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, Oauth2tokensTable, Oauth2tokensPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOauth2tokensWith applies the HasEdge predicate on the "oauth2tokens" edge with a given conditions (other predicates). +func HasOauth2tokensWith(preds ...predicate.OhAuthTooToken) predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := newOauth2tokensStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.IntegrationEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.IntegrationEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasWebhooks applies the HasEdge predicate on the "webhooks" edge. +func HasWebhooks() predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, WebhooksTable, WebhooksPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.IntegrationWebhooks + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasWebhooksWith applies the HasEdge predicate on the "webhooks" edge with a given conditions (other predicates). +func HasWebhooksWith(preds ...predicate.Webhook) predicate.Integration { + return predicate.Integration(func(s *sql.Selector) { + step := newWebhooksStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.IntegrationWebhooks + 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.Integration) predicate.Integration { + return predicate.Integration(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Integration) predicate.Integration { + return predicate.Integration(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Integration) predicate.Integration { + return predicate.Integration(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/integration_create.go b/internal/ent/generated/integration_create.go new file mode 100644 index 0000000..9b2dcc5 --- /dev/null +++ b/internal/ent/generated/integration_create.go @@ -0,0 +1,600 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/webhook" +) + +// IntegrationCreate is the builder for creating a Integration entity. +type IntegrationCreate struct { + config + mutation *IntegrationMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (ic *IntegrationCreate) SetCreatedAt(t time.Time) *IntegrationCreate { + ic.mutation.SetCreatedAt(t) + return ic +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableCreatedAt(t *time.Time) *IntegrationCreate { + if t != nil { + ic.SetCreatedAt(*t) + } + return ic +} + +// SetUpdatedAt sets the "updated_at" field. +func (ic *IntegrationCreate) SetUpdatedAt(t time.Time) *IntegrationCreate { + ic.mutation.SetUpdatedAt(t) + return ic +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableUpdatedAt(t *time.Time) *IntegrationCreate { + if t != nil { + ic.SetUpdatedAt(*t) + } + return ic +} + +// SetCreatedBy sets the "created_by" field. +func (ic *IntegrationCreate) SetCreatedBy(s string) *IntegrationCreate { + ic.mutation.SetCreatedBy(s) + return ic +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableCreatedBy(s *string) *IntegrationCreate { + if s != nil { + ic.SetCreatedBy(*s) + } + return ic +} + +// SetUpdatedBy sets the "updated_by" field. +func (ic *IntegrationCreate) SetUpdatedBy(s string) *IntegrationCreate { + ic.mutation.SetUpdatedBy(s) + return ic +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableUpdatedBy(s *string) *IntegrationCreate { + if s != nil { + ic.SetUpdatedBy(*s) + } + return ic +} + +// SetMappingID sets the "mapping_id" field. +func (ic *IntegrationCreate) SetMappingID(s string) *IntegrationCreate { + ic.mutation.SetMappingID(s) + return ic +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableMappingID(s *string) *IntegrationCreate { + if s != nil { + ic.SetMappingID(*s) + } + return ic +} + +// SetTags sets the "tags" field. +func (ic *IntegrationCreate) SetTags(s []string) *IntegrationCreate { + ic.mutation.SetTags(s) + return ic +} + +// SetDeletedAt sets the "deleted_at" field. +func (ic *IntegrationCreate) SetDeletedAt(t time.Time) *IntegrationCreate { + ic.mutation.SetDeletedAt(t) + return ic +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableDeletedAt(t *time.Time) *IntegrationCreate { + if t != nil { + ic.SetDeletedAt(*t) + } + return ic +} + +// SetDeletedBy sets the "deleted_by" field. +func (ic *IntegrationCreate) SetDeletedBy(s string) *IntegrationCreate { + ic.mutation.SetDeletedBy(s) + return ic +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableDeletedBy(s *string) *IntegrationCreate { + if s != nil { + ic.SetDeletedBy(*s) + } + return ic +} + +// SetOwnerID sets the "owner_id" field. +func (ic *IntegrationCreate) SetOwnerID(s string) *IntegrationCreate { + ic.mutation.SetOwnerID(s) + return ic +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableOwnerID(s *string) *IntegrationCreate { + if s != nil { + ic.SetOwnerID(*s) + } + return ic +} + +// SetName sets the "name" field. +func (ic *IntegrationCreate) SetName(s string) *IntegrationCreate { + ic.mutation.SetName(s) + return ic +} + +// SetDescription sets the "description" field. +func (ic *IntegrationCreate) SetDescription(s string) *IntegrationCreate { + ic.mutation.SetDescription(s) + return ic +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableDescription(s *string) *IntegrationCreate { + if s != nil { + ic.SetDescription(*s) + } + return ic +} + +// SetKind sets the "kind" field. +func (ic *IntegrationCreate) SetKind(s string) *IntegrationCreate { + ic.mutation.SetKind(s) + return ic +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableKind(s *string) *IntegrationCreate { + if s != nil { + ic.SetKind(*s) + } + return ic +} + +// SetID sets the "id" field. +func (ic *IntegrationCreate) SetID(s string) *IntegrationCreate { + ic.mutation.SetID(s) + return ic +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ic *IntegrationCreate) SetNillableID(s *string) *IntegrationCreate { + if s != nil { + ic.SetID(*s) + } + return ic +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (ic *IntegrationCreate) SetOwner(o *Organization) *IntegrationCreate { + return ic.SetOwnerID(o.ID) +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by IDs. +func (ic *IntegrationCreate) AddSecretIDs(ids ...string) *IntegrationCreate { + ic.mutation.AddSecretIDs(ids...) + return ic +} + +// AddSecrets adds the "secrets" edges to the Hush entity. +func (ic *IntegrationCreate) AddSecrets(h ...*Hush) *IntegrationCreate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return ic.AddSecretIDs(ids...) +} + +// AddOauth2tokenIDs adds the "oauth2tokens" edge to the OhAuthTooToken entity by IDs. +func (ic *IntegrationCreate) AddOauth2tokenIDs(ids ...string) *IntegrationCreate { + ic.mutation.AddOauth2tokenIDs(ids...) + return ic +} + +// AddOauth2tokens adds the "oauth2tokens" edges to the OhAuthTooToken entity. +func (ic *IntegrationCreate) AddOauth2tokens(o ...*OhAuthTooToken) *IntegrationCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ic.AddOauth2tokenIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (ic *IntegrationCreate) AddEventIDs(ids ...string) *IntegrationCreate { + ic.mutation.AddEventIDs(ids...) + return ic +} + +// AddEvents adds the "events" edges to the Event entity. +func (ic *IntegrationCreate) AddEvents(e ...*Event) *IntegrationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ic.AddEventIDs(ids...) +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by IDs. +func (ic *IntegrationCreate) AddWebhookIDs(ids ...string) *IntegrationCreate { + ic.mutation.AddWebhookIDs(ids...) + return ic +} + +// AddWebhooks adds the "webhooks" edges to the Webhook entity. +func (ic *IntegrationCreate) AddWebhooks(w ...*Webhook) *IntegrationCreate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return ic.AddWebhookIDs(ids...) +} + +// Mutation returns the IntegrationMutation object of the builder. +func (ic *IntegrationCreate) Mutation() *IntegrationMutation { + return ic.mutation +} + +// Save creates the Integration in the database. +func (ic *IntegrationCreate) Save(ctx context.Context) (*Integration, error) { + if err := ic.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ic.sqlSave, ic.mutation, ic.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ic *IntegrationCreate) SaveX(ctx context.Context) *Integration { + v, err := ic.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ic *IntegrationCreate) Exec(ctx context.Context) error { + _, err := ic.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ic *IntegrationCreate) ExecX(ctx context.Context) { + if err := ic.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ic *IntegrationCreate) defaults() error { + if _, ok := ic.mutation.CreatedAt(); !ok { + if integration.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized integration.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := integration.DefaultCreatedAt() + ic.mutation.SetCreatedAt(v) + } + if _, ok := ic.mutation.UpdatedAt(); !ok { + if integration.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized integration.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := integration.DefaultUpdatedAt() + ic.mutation.SetUpdatedAt(v) + } + if _, ok := ic.mutation.MappingID(); !ok { + if integration.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized integration.DefaultMappingID (forgotten import generated/runtime?)") + } + v := integration.DefaultMappingID() + ic.mutation.SetMappingID(v) + } + if _, ok := ic.mutation.Tags(); !ok { + v := integration.DefaultTags + ic.mutation.SetTags(v) + } + if _, ok := ic.mutation.ID(); !ok { + if integration.DefaultID == nil { + return fmt.Errorf("generated: uninitialized integration.DefaultID (forgotten import generated/runtime?)") + } + v := integration.DefaultID() + ic.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ic *IntegrationCreate) check() error { + if _, ok := ic.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Integration.mapping_id"`)} + } + if v, ok := ic.mutation.OwnerID(); ok { + if err := integration.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Integration.owner_id": %w`, err)} + } + } + if _, ok := ic.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "Integration.name"`)} + } + if v, ok := ic.mutation.Name(); ok { + if err := integration.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Integration.name": %w`, err)} + } + } + return nil +} + +func (ic *IntegrationCreate) sqlSave(ctx context.Context) (*Integration, error) { + if err := ic.check(); err != nil { + return nil, err + } + _node, _spec := ic.createSpec() + if err := sqlgraph.CreateNode(ctx, ic.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Integration.ID type: %T", _spec.ID.Value) + } + } + ic.mutation.id = &_node.ID + ic.mutation.done = true + return _node, nil +} + +func (ic *IntegrationCreate) createSpec() (*Integration, *sqlgraph.CreateSpec) { + var ( + _node = &Integration{config: ic.config} + _spec = sqlgraph.NewCreateSpec(integration.Table, sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString)) + ) + _spec.Schema = ic.schemaConfig.Integration + if id, ok := ic.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ic.mutation.CreatedAt(); ok { + _spec.SetField(integration.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ic.mutation.UpdatedAt(); ok { + _spec.SetField(integration.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ic.mutation.CreatedBy(); ok { + _spec.SetField(integration.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ic.mutation.UpdatedBy(); ok { + _spec.SetField(integration.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ic.mutation.MappingID(); ok { + _spec.SetField(integration.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ic.mutation.Tags(); ok { + _spec.SetField(integration.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ic.mutation.DeletedAt(); ok { + _spec.SetField(integration.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ic.mutation.DeletedBy(); ok { + _spec.SetField(integration.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ic.mutation.Name(); ok { + _spec.SetField(integration.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ic.mutation.Description(); ok { + _spec.SetField(integration.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := ic.mutation.Kind(); ok { + _spec.SetField(integration.FieldKind, field.TypeString, value) + _node.Kind = value + } + if nodes := ic.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: integration.OwnerTable, + Columns: []string{integration.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ic.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ic.mutation.SecretsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ic.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ic.mutation.Oauth2tokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = ic.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ic.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ic.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ic.mutation.WebhooksIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ic.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// IntegrationCreateBulk is the builder for creating many Integration entities in bulk. +type IntegrationCreateBulk struct { + config + err error + builders []*IntegrationCreate +} + +// Save creates the Integration entities in the database. +func (icb *IntegrationCreateBulk) Save(ctx context.Context) ([]*Integration, error) { + if icb.err != nil { + return nil, icb.err + } + specs := make([]*sqlgraph.CreateSpec, len(icb.builders)) + nodes := make([]*Integration, len(icb.builders)) + mutators := make([]Mutator, len(icb.builders)) + for i := range icb.builders { + func(i int, root context.Context) { + builder := icb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*IntegrationMutation) + 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, icb.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, icb.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, icb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (icb *IntegrationCreateBulk) SaveX(ctx context.Context) []*Integration { + v, err := icb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (icb *IntegrationCreateBulk) Exec(ctx context.Context) error { + _, err := icb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (icb *IntegrationCreateBulk) ExecX(ctx context.Context) { + if err := icb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/integration_delete.go b/internal/ent/generated/integration_delete.go new file mode 100644 index 0000000..390234d --- /dev/null +++ b/internal/ent/generated/integration_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// IntegrationDelete is the builder for deleting a Integration entity. +type IntegrationDelete struct { + config + hooks []Hook + mutation *IntegrationMutation +} + +// Where appends a list predicates to the IntegrationDelete builder. +func (id *IntegrationDelete) Where(ps ...predicate.Integration) *IntegrationDelete { + id.mutation.Where(ps...) + return id +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (id *IntegrationDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, id.sqlExec, id.mutation, id.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (id *IntegrationDelete) ExecX(ctx context.Context) int { + n, err := id.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (id *IntegrationDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(integration.Table, sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString)) + _spec.Node.Schema = id.schemaConfig.Integration + ctx = internal.NewSchemaConfigContext(ctx, id.schemaConfig) + if ps := id.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, id.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + id.mutation.done = true + return affected, err +} + +// IntegrationDeleteOne is the builder for deleting a single Integration entity. +type IntegrationDeleteOne struct { + id *IntegrationDelete +} + +// Where appends a list predicates to the IntegrationDelete builder. +func (ido *IntegrationDeleteOne) Where(ps ...predicate.Integration) *IntegrationDeleteOne { + ido.id.mutation.Where(ps...) + return ido +} + +// Exec executes the deletion query. +func (ido *IntegrationDeleteOne) Exec(ctx context.Context) error { + n, err := ido.id.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{integration.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ido *IntegrationDeleteOne) ExecX(ctx context.Context) { + if err := ido.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/integration_query.go b/internal/ent/generated/integration_query.go new file mode 100644 index 0000000..ce24efb --- /dev/null +++ b/internal/ent/generated/integration_query.go @@ -0,0 +1,1168 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// IntegrationQuery is the builder for querying Integration entities. +type IntegrationQuery struct { + config + ctx *QueryContext + order []integration.OrderOption + inters []Interceptor + predicates []predicate.Integration + withOwner *OrganizationQuery + withSecrets *HushQuery + withOauth2tokens *OhAuthTooTokenQuery + withEvents *EventQuery + withWebhooks *WebhookQuery + withFKs bool + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Integration) error + withNamedSecrets map[string]*HushQuery + withNamedOauth2tokens map[string]*OhAuthTooTokenQuery + withNamedEvents map[string]*EventQuery + withNamedWebhooks map[string]*WebhookQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the IntegrationQuery builder. +func (iq *IntegrationQuery) Where(ps ...predicate.Integration) *IntegrationQuery { + iq.predicates = append(iq.predicates, ps...) + return iq +} + +// Limit the number of records to be returned by this query. +func (iq *IntegrationQuery) Limit(limit int) *IntegrationQuery { + iq.ctx.Limit = &limit + return iq +} + +// Offset to start from. +func (iq *IntegrationQuery) Offset(offset int) *IntegrationQuery { + iq.ctx.Offset = &offset + return iq +} + +// 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 (iq *IntegrationQuery) Unique(unique bool) *IntegrationQuery { + iq.ctx.Unique = &unique + return iq +} + +// Order specifies how the records should be ordered. +func (iq *IntegrationQuery) Order(o ...integration.OrderOption) *IntegrationQuery { + iq.order = append(iq.order, o...) + return iq +} + +// QueryOwner chains the current query on the "owner" edge. +func (iq *IntegrationQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: iq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := iq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, integration.OwnerTable, integration.OwnerColumn), + ) + schemaConfig := iq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Integration + fromU = sqlgraph.SetNeighbors(iq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QuerySecrets chains the current query on the "secrets" edge. +func (iq *IntegrationQuery) QuerySecrets() *HushQuery { + query := (&HushClient{config: iq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := iq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, selector), + sqlgraph.To(hush.Table, hush.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.SecretsTable, integration.SecretsPrimaryKey...), + ) + schemaConfig := iq.schemaConfig + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.IntegrationSecrets + fromU = sqlgraph.SetNeighbors(iq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOauth2tokens chains the current query on the "oauth2tokens" edge. +func (iq *IntegrationQuery) QueryOauth2tokens() *OhAuthTooTokenQuery { + query := (&OhAuthTooTokenClient{config: iq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := iq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, selector), + sqlgraph.To(ohauthtootoken.Table, ohauthtootoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.Oauth2tokensTable, integration.Oauth2tokensPrimaryKey...), + ) + schemaConfig := iq.schemaConfig + step.To.Schema = schemaConfig.OhAuthTooToken + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + fromU = sqlgraph.SetNeighbors(iq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (iq *IntegrationQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: iq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := iq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.EventsTable, integration.EventsPrimaryKey...), + ) + schemaConfig := iq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.IntegrationEvents + fromU = sqlgraph.SetNeighbors(iq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryWebhooks chains the current query on the "webhooks" edge. +func (iq *IntegrationQuery) QueryWebhooks() *WebhookQuery { + query := (&WebhookClient{config: iq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := iq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(integration.Table, integration.FieldID, selector), + sqlgraph.To(webhook.Table, webhook.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, integration.WebhooksTable, integration.WebhooksPrimaryKey...), + ) + schemaConfig := iq.schemaConfig + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.IntegrationWebhooks + fromU = sqlgraph.SetNeighbors(iq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Integration entity from the query. +// Returns a *NotFoundError when no Integration was found. +func (iq *IntegrationQuery) First(ctx context.Context) (*Integration, error) { + nodes, err := iq.Limit(1).All(setContextOp(ctx, iq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{integration.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (iq *IntegrationQuery) FirstX(ctx context.Context) *Integration { + node, err := iq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Integration ID from the query. +// Returns a *NotFoundError when no Integration ID was found. +func (iq *IntegrationQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = iq.Limit(1).IDs(setContextOp(ctx, iq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{integration.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (iq *IntegrationQuery) FirstIDX(ctx context.Context) string { + id, err := iq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Integration entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Integration entity is found. +// Returns a *NotFoundError when no Integration entities are found. +func (iq *IntegrationQuery) Only(ctx context.Context) (*Integration, error) { + nodes, err := iq.Limit(2).All(setContextOp(ctx, iq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{integration.Label} + default: + return nil, &NotSingularError{integration.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (iq *IntegrationQuery) OnlyX(ctx context.Context) *Integration { + node, err := iq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Integration ID in the query. +// Returns a *NotSingularError when more than one Integration ID is found. +// Returns a *NotFoundError when no entities are found. +func (iq *IntegrationQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = iq.Limit(2).IDs(setContextOp(ctx, iq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{integration.Label} + default: + err = &NotSingularError{integration.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (iq *IntegrationQuery) OnlyIDX(ctx context.Context) string { + id, err := iq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Integrations. +func (iq *IntegrationQuery) All(ctx context.Context) ([]*Integration, error) { + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryAll) + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Integration, *IntegrationQuery]() + return withInterceptors[[]*Integration](ctx, iq, qr, iq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (iq *IntegrationQuery) AllX(ctx context.Context) []*Integration { + nodes, err := iq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Integration IDs. +func (iq *IntegrationQuery) IDs(ctx context.Context) (ids []string, err error) { + if iq.ctx.Unique == nil && iq.path != nil { + iq.Unique(true) + } + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryIDs) + if err = iq.Select(integration.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (iq *IntegrationQuery) IDsX(ctx context.Context) []string { + ids, err := iq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (iq *IntegrationQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryCount) + if err := iq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, iq, querierCount[*IntegrationQuery](), iq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (iq *IntegrationQuery) CountX(ctx context.Context) int { + count, err := iq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (iq *IntegrationQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryExist) + switch _, err := iq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (iq *IntegrationQuery) ExistX(ctx context.Context) bool { + exist, err := iq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the IntegrationQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (iq *IntegrationQuery) Clone() *IntegrationQuery { + if iq == nil { + return nil + } + return &IntegrationQuery{ + config: iq.config, + ctx: iq.ctx.Clone(), + order: append([]integration.OrderOption{}, iq.order...), + inters: append([]Interceptor{}, iq.inters...), + predicates: append([]predicate.Integration{}, iq.predicates...), + withOwner: iq.withOwner.Clone(), + withSecrets: iq.withSecrets.Clone(), + withOauth2tokens: iq.withOauth2tokens.Clone(), + withEvents: iq.withEvents.Clone(), + withWebhooks: iq.withWebhooks.Clone(), + // clone intermediate query. + sql: iq.sql.Clone(), + path: iq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithOwner(opts ...func(*OrganizationQuery)) *IntegrationQuery { + query := (&OrganizationClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + iq.withOwner = query + return iq +} + +// WithSecrets tells the query-builder to eager-load the nodes that are connected to +// the "secrets" edge. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithSecrets(opts ...func(*HushQuery)) *IntegrationQuery { + query := (&HushClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + iq.withSecrets = query + return iq +} + +// WithOauth2tokens tells the query-builder to eager-load the nodes that are connected to +// the "oauth2tokens" edge. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithOauth2tokens(opts ...func(*OhAuthTooTokenQuery)) *IntegrationQuery { + query := (&OhAuthTooTokenClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + iq.withOauth2tokens = query + return iq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithEvents(opts ...func(*EventQuery)) *IntegrationQuery { + query := (&EventClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + iq.withEvents = query + return iq +} + +// WithWebhooks tells the query-builder to eager-load the nodes that are connected to +// the "webhooks" edge. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithWebhooks(opts ...func(*WebhookQuery)) *IntegrationQuery { + query := (&WebhookClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + iq.withWebhooks = query + return iq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Integration.Query(). +// GroupBy(integration.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (iq *IntegrationQuery) GroupBy(field string, fields ...string) *IntegrationGroupBy { + iq.ctx.Fields = append([]string{field}, fields...) + grbuild := &IntegrationGroupBy{build: iq} + grbuild.flds = &iq.ctx.Fields + grbuild.label = integration.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Integration.Query(). +// Select(integration.FieldCreatedAt). +// Scan(ctx, &v) +func (iq *IntegrationQuery) Select(fields ...string) *IntegrationSelect { + iq.ctx.Fields = append(iq.ctx.Fields, fields...) + sbuild := &IntegrationSelect{IntegrationQuery: iq} + sbuild.label = integration.Label + sbuild.flds, sbuild.scan = &iq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a IntegrationSelect configured with the given aggregations. +func (iq *IntegrationQuery) Aggregate(fns ...AggregateFunc) *IntegrationSelect { + return iq.Select().Aggregate(fns...) +} + +func (iq *IntegrationQuery) prepareQuery(ctx context.Context) error { + for _, inter := range iq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, iq); err != nil { + return err + } + } + } + for _, f := range iq.ctx.Fields { + if !integration.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if iq.path != nil { + prev, err := iq.path(ctx) + if err != nil { + return err + } + iq.sql = prev + } + if integration.Policy == nil { + return errors.New("generated: uninitialized integration.Policy (forgotten import generated/runtime?)") + } + if err := integration.Policy.EvalQuery(ctx, iq); err != nil { + return err + } + return nil +} + +func (iq *IntegrationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Integration, error) { + var ( + nodes = []*Integration{} + withFKs = iq.withFKs + _spec = iq.querySpec() + loadedTypes = [5]bool{ + iq.withOwner != nil, + iq.withSecrets != nil, + iq.withOauth2tokens != nil, + iq.withEvents != nil, + iq.withWebhooks != nil, + } + ) + if withFKs { + _spec.Node.Columns = append(_spec.Node.Columns, integration.ForeignKeys...) + } + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Integration).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Integration{config: iq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = iq.schemaConfig.Integration + ctx = internal.NewSchemaConfigContext(ctx, iq.schemaConfig) + if len(iq.modifiers) > 0 { + _spec.Modifiers = iq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, iq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := iq.withOwner; query != nil { + if err := iq.loadOwner(ctx, query, nodes, nil, + func(n *Integration, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := iq.withSecrets; query != nil { + if err := iq.loadSecrets(ctx, query, nodes, + func(n *Integration) { n.Edges.Secrets = []*Hush{} }, + func(n *Integration, e *Hush) { n.Edges.Secrets = append(n.Edges.Secrets, e) }); err != nil { + return nil, err + } + } + if query := iq.withOauth2tokens; query != nil { + if err := iq.loadOauth2tokens(ctx, query, nodes, + func(n *Integration) { n.Edges.Oauth2tokens = []*OhAuthTooToken{} }, + func(n *Integration, e *OhAuthTooToken) { n.Edges.Oauth2tokens = append(n.Edges.Oauth2tokens, e) }); err != nil { + return nil, err + } + } + if query := iq.withEvents; query != nil { + if err := iq.loadEvents(ctx, query, nodes, + func(n *Integration) { n.Edges.Events = []*Event{} }, + func(n *Integration, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + if query := iq.withWebhooks; query != nil { + if err := iq.loadWebhooks(ctx, query, nodes, + func(n *Integration) { n.Edges.Webhooks = []*Webhook{} }, + func(n *Integration, e *Webhook) { n.Edges.Webhooks = append(n.Edges.Webhooks, e) }); err != nil { + return nil, err + } + } + for name, query := range iq.withNamedSecrets { + if err := iq.loadSecrets(ctx, query, nodes, + func(n *Integration) { n.appendNamedSecrets(name) }, + func(n *Integration, e *Hush) { n.appendNamedSecrets(name, e) }); err != nil { + return nil, err + } + } + for name, query := range iq.withNamedOauth2tokens { + if err := iq.loadOauth2tokens(ctx, query, nodes, + func(n *Integration) { n.appendNamedOauth2tokens(name) }, + func(n *Integration, e *OhAuthTooToken) { n.appendNamedOauth2tokens(name, e) }); err != nil { + return nil, err + } + } + for name, query := range iq.withNamedEvents { + if err := iq.loadEvents(ctx, query, nodes, + func(n *Integration) { n.appendNamedEvents(name) }, + func(n *Integration, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for name, query := range iq.withNamedWebhooks { + if err := iq.loadWebhooks(ctx, query, nodes, + func(n *Integration) { n.appendNamedWebhooks(name) }, + func(n *Integration, e *Webhook) { n.appendNamedWebhooks(name, e) }); err != nil { + return nil, err + } + } + for i := range iq.loadTotal { + if err := iq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (iq *IntegrationQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Integration, init func(*Integration), assign func(*Integration, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Integration) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (iq *IntegrationQuery) loadSecrets(ctx context.Context, query *HushQuery, nodes []*Integration, init func(*Integration), assign func(*Integration, *Hush)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Integration) + nids := make(map[string]map[*Integration]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(integration.SecretsTable) + joinT.Schema(iq.schemaConfig.IntegrationSecrets) + s.Join(joinT).On(s.C(hush.FieldID), joinT.C(integration.SecretsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(integration.SecretsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(integration.SecretsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Integration]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Hush](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "secrets" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (iq *IntegrationQuery) loadOauth2tokens(ctx context.Context, query *OhAuthTooTokenQuery, nodes []*Integration, init func(*Integration), assign func(*Integration, *OhAuthTooToken)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Integration) + nids := make(map[string]map[*Integration]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(integration.Oauth2tokensTable) + joinT.Schema(iq.schemaConfig.IntegrationOauth2tokens) + s.Join(joinT).On(s.C(ohauthtootoken.FieldID), joinT.C(integration.Oauth2tokensPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(integration.Oauth2tokensPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(integration.Oauth2tokensPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Integration]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*OhAuthTooToken](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "oauth2tokens" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (iq *IntegrationQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Integration, init func(*Integration), assign func(*Integration, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Integration) + nids := make(map[string]map[*Integration]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(integration.EventsTable) + joinT.Schema(iq.schemaConfig.IntegrationEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(integration.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(integration.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(integration.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Integration]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (iq *IntegrationQuery) loadWebhooks(ctx context.Context, query *WebhookQuery, nodes []*Integration, init func(*Integration), assign func(*Integration, *Webhook)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Integration) + nids := make(map[string]map[*Integration]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(integration.WebhooksTable) + joinT.Schema(iq.schemaConfig.IntegrationWebhooks) + s.Join(joinT).On(s.C(webhook.FieldID), joinT.C(integration.WebhooksPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(integration.WebhooksPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(integration.WebhooksPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Integration]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Webhook](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "webhooks" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (iq *IntegrationQuery) sqlCount(ctx context.Context) (int, error) { + _spec := iq.querySpec() + _spec.Node.Schema = iq.schemaConfig.Integration + ctx = internal.NewSchemaConfigContext(ctx, iq.schemaConfig) + if len(iq.modifiers) > 0 { + _spec.Modifiers = iq.modifiers + } + _spec.Node.Columns = iq.ctx.Fields + if len(iq.ctx.Fields) > 0 { + _spec.Unique = iq.ctx.Unique != nil && *iq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, iq.driver, _spec) +} + +func (iq *IntegrationQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(integration.Table, integration.Columns, sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString)) + _spec.From = iq.sql + if unique := iq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if iq.path != nil { + _spec.Unique = true + } + if fields := iq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, integration.FieldID) + for i := range fields { + if fields[i] != integration.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if iq.withOwner != nil { + _spec.Node.AddColumnOnce(integration.FieldOwnerID) + } + } + if ps := iq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := iq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := iq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := iq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (iq *IntegrationQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(iq.driver.Dialect()) + t1 := builder.Table(integration.Table) + columns := iq.ctx.Fields + if len(columns) == 0 { + columns = integration.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if iq.sql != nil { + selector = iq.sql + selector.Select(selector.Columns(columns...)...) + } + if iq.ctx.Unique != nil && *iq.ctx.Unique { + selector.Distinct() + } + t1.Schema(iq.schemaConfig.Integration) + ctx = internal.NewSchemaConfigContext(ctx, iq.schemaConfig) + selector.WithContext(ctx) + for _, p := range iq.predicates { + p(selector) + } + for _, p := range iq.order { + p(selector) + } + if offset := iq.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 := iq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedSecrets tells the query-builder to eager-load the nodes that are connected to the "secrets" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithNamedSecrets(name string, opts ...func(*HushQuery)) *IntegrationQuery { + query := (&HushClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + if iq.withNamedSecrets == nil { + iq.withNamedSecrets = make(map[string]*HushQuery) + } + iq.withNamedSecrets[name] = query + return iq +} + +// WithNamedOauth2tokens tells the query-builder to eager-load the nodes that are connected to the "oauth2tokens" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithNamedOauth2tokens(name string, opts ...func(*OhAuthTooTokenQuery)) *IntegrationQuery { + query := (&OhAuthTooTokenClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + if iq.withNamedOauth2tokens == nil { + iq.withNamedOauth2tokens = make(map[string]*OhAuthTooTokenQuery) + } + iq.withNamedOauth2tokens[name] = query + return iq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *IntegrationQuery { + query := (&EventClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + if iq.withNamedEvents == nil { + iq.withNamedEvents = make(map[string]*EventQuery) + } + iq.withNamedEvents[name] = query + return iq +} + +// WithNamedWebhooks tells the query-builder to eager-load the nodes that are connected to the "webhooks" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (iq *IntegrationQuery) WithNamedWebhooks(name string, opts ...func(*WebhookQuery)) *IntegrationQuery { + query := (&WebhookClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + if iq.withNamedWebhooks == nil { + iq.withNamedWebhooks = make(map[string]*WebhookQuery) + } + iq.withNamedWebhooks[name] = query + return iq +} + +// IntegrationGroupBy is the group-by builder for Integration entities. +type IntegrationGroupBy struct { + selector + build *IntegrationQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (igb *IntegrationGroupBy) Aggregate(fns ...AggregateFunc) *IntegrationGroupBy { + igb.fns = append(igb.fns, fns...) + return igb +} + +// Scan applies the selector query and scans the result into the given value. +func (igb *IntegrationGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, igb.build.ctx, ent.OpQueryGroupBy) + if err := igb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*IntegrationQuery, *IntegrationGroupBy](ctx, igb.build, igb, igb.build.inters, v) +} + +func (igb *IntegrationGroupBy) sqlScan(ctx context.Context, root *IntegrationQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(igb.fns)) + for _, fn := range igb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*igb.flds)+len(igb.fns)) + for _, f := range *igb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*igb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := igb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// IntegrationSelect is the builder for selecting fields of Integration entities. +type IntegrationSelect struct { + *IntegrationQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (is *IntegrationSelect) Aggregate(fns ...AggregateFunc) *IntegrationSelect { + is.fns = append(is.fns, fns...) + return is +} + +// Scan applies the selector query and scans the result into the given value. +func (is *IntegrationSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, is.ctx, ent.OpQuerySelect) + if err := is.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*IntegrationQuery, *IntegrationSelect](ctx, is.IntegrationQuery, is, is.inters, v) +} + +func (is *IntegrationSelect) sqlScan(ctx context.Context, root *IntegrationQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(is.fns)) + for _, fn := range is.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*is.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 := is.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/integration_update.go b/internal/ent/generated/integration_update.go new file mode 100644 index 0000000..25e1ec7 --- /dev/null +++ b/internal/ent/generated/integration_update.go @@ -0,0 +1,1450 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// IntegrationUpdate is the builder for updating Integration entities. +type IntegrationUpdate struct { + config + hooks []Hook + mutation *IntegrationMutation +} + +// Where appends a list predicates to the IntegrationUpdate builder. +func (iu *IntegrationUpdate) Where(ps ...predicate.Integration) *IntegrationUpdate { + iu.mutation.Where(ps...) + return iu +} + +// SetUpdatedAt sets the "updated_at" field. +func (iu *IntegrationUpdate) SetUpdatedAt(t time.Time) *IntegrationUpdate { + iu.mutation.SetUpdatedAt(t) + return iu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (iu *IntegrationUpdate) ClearUpdatedAt() *IntegrationUpdate { + iu.mutation.ClearUpdatedAt() + return iu +} + +// SetUpdatedBy sets the "updated_by" field. +func (iu *IntegrationUpdate) SetUpdatedBy(s string) *IntegrationUpdate { + iu.mutation.SetUpdatedBy(s) + return iu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (iu *IntegrationUpdate) SetNillableUpdatedBy(s *string) *IntegrationUpdate { + if s != nil { + iu.SetUpdatedBy(*s) + } + return iu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (iu *IntegrationUpdate) ClearUpdatedBy() *IntegrationUpdate { + iu.mutation.ClearUpdatedBy() + return iu +} + +// SetTags sets the "tags" field. +func (iu *IntegrationUpdate) SetTags(s []string) *IntegrationUpdate { + iu.mutation.SetTags(s) + return iu +} + +// AppendTags appends s to the "tags" field. +func (iu *IntegrationUpdate) AppendTags(s []string) *IntegrationUpdate { + iu.mutation.AppendTags(s) + return iu +} + +// ClearTags clears the value of the "tags" field. +func (iu *IntegrationUpdate) ClearTags() *IntegrationUpdate { + iu.mutation.ClearTags() + return iu +} + +// SetDeletedAt sets the "deleted_at" field. +func (iu *IntegrationUpdate) SetDeletedAt(t time.Time) *IntegrationUpdate { + iu.mutation.SetDeletedAt(t) + return iu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (iu *IntegrationUpdate) SetNillableDeletedAt(t *time.Time) *IntegrationUpdate { + if t != nil { + iu.SetDeletedAt(*t) + } + return iu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (iu *IntegrationUpdate) ClearDeletedAt() *IntegrationUpdate { + iu.mutation.ClearDeletedAt() + return iu +} + +// SetDeletedBy sets the "deleted_by" field. +func (iu *IntegrationUpdate) SetDeletedBy(s string) *IntegrationUpdate { + iu.mutation.SetDeletedBy(s) + return iu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (iu *IntegrationUpdate) SetNillableDeletedBy(s *string) *IntegrationUpdate { + if s != nil { + iu.SetDeletedBy(*s) + } + return iu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (iu *IntegrationUpdate) ClearDeletedBy() *IntegrationUpdate { + iu.mutation.ClearDeletedBy() + return iu +} + +// SetOwnerID sets the "owner_id" field. +func (iu *IntegrationUpdate) SetOwnerID(s string) *IntegrationUpdate { + iu.mutation.SetOwnerID(s) + return iu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (iu *IntegrationUpdate) SetNillableOwnerID(s *string) *IntegrationUpdate { + if s != nil { + iu.SetOwnerID(*s) + } + return iu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (iu *IntegrationUpdate) ClearOwnerID() *IntegrationUpdate { + iu.mutation.ClearOwnerID() + return iu +} + +// SetName sets the "name" field. +func (iu *IntegrationUpdate) SetName(s string) *IntegrationUpdate { + iu.mutation.SetName(s) + return iu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (iu *IntegrationUpdate) SetNillableName(s *string) *IntegrationUpdate { + if s != nil { + iu.SetName(*s) + } + return iu +} + +// SetDescription sets the "description" field. +func (iu *IntegrationUpdate) SetDescription(s string) *IntegrationUpdate { + iu.mutation.SetDescription(s) + return iu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (iu *IntegrationUpdate) SetNillableDescription(s *string) *IntegrationUpdate { + if s != nil { + iu.SetDescription(*s) + } + return iu +} + +// ClearDescription clears the value of the "description" field. +func (iu *IntegrationUpdate) ClearDescription() *IntegrationUpdate { + iu.mutation.ClearDescription() + return iu +} + +// SetKind sets the "kind" field. +func (iu *IntegrationUpdate) SetKind(s string) *IntegrationUpdate { + iu.mutation.SetKind(s) + return iu +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (iu *IntegrationUpdate) SetNillableKind(s *string) *IntegrationUpdate { + if s != nil { + iu.SetKind(*s) + } + return iu +} + +// ClearKind clears the value of the "kind" field. +func (iu *IntegrationUpdate) ClearKind() *IntegrationUpdate { + iu.mutation.ClearKind() + return iu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (iu *IntegrationUpdate) SetOwner(o *Organization) *IntegrationUpdate { + return iu.SetOwnerID(o.ID) +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by IDs. +func (iu *IntegrationUpdate) AddSecretIDs(ids ...string) *IntegrationUpdate { + iu.mutation.AddSecretIDs(ids...) + return iu +} + +// AddSecrets adds the "secrets" edges to the Hush entity. +func (iu *IntegrationUpdate) AddSecrets(h ...*Hush) *IntegrationUpdate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return iu.AddSecretIDs(ids...) +} + +// AddOauth2tokenIDs adds the "oauth2tokens" edge to the OhAuthTooToken entity by IDs. +func (iu *IntegrationUpdate) AddOauth2tokenIDs(ids ...string) *IntegrationUpdate { + iu.mutation.AddOauth2tokenIDs(ids...) + return iu +} + +// AddOauth2tokens adds the "oauth2tokens" edges to the OhAuthTooToken entity. +func (iu *IntegrationUpdate) AddOauth2tokens(o ...*OhAuthTooToken) *IntegrationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return iu.AddOauth2tokenIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (iu *IntegrationUpdate) AddEventIDs(ids ...string) *IntegrationUpdate { + iu.mutation.AddEventIDs(ids...) + return iu +} + +// AddEvents adds the "events" edges to the Event entity. +func (iu *IntegrationUpdate) AddEvents(e ...*Event) *IntegrationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iu.AddEventIDs(ids...) +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by IDs. +func (iu *IntegrationUpdate) AddWebhookIDs(ids ...string) *IntegrationUpdate { + iu.mutation.AddWebhookIDs(ids...) + return iu +} + +// AddWebhooks adds the "webhooks" edges to the Webhook entity. +func (iu *IntegrationUpdate) AddWebhooks(w ...*Webhook) *IntegrationUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return iu.AddWebhookIDs(ids...) +} + +// Mutation returns the IntegrationMutation object of the builder. +func (iu *IntegrationUpdate) Mutation() *IntegrationMutation { + return iu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (iu *IntegrationUpdate) ClearOwner() *IntegrationUpdate { + iu.mutation.ClearOwner() + return iu +} + +// ClearSecrets clears all "secrets" edges to the Hush entity. +func (iu *IntegrationUpdate) ClearSecrets() *IntegrationUpdate { + iu.mutation.ClearSecrets() + return iu +} + +// RemoveSecretIDs removes the "secrets" edge to Hush entities by IDs. +func (iu *IntegrationUpdate) RemoveSecretIDs(ids ...string) *IntegrationUpdate { + iu.mutation.RemoveSecretIDs(ids...) + return iu +} + +// RemoveSecrets removes "secrets" edges to Hush entities. +func (iu *IntegrationUpdate) RemoveSecrets(h ...*Hush) *IntegrationUpdate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return iu.RemoveSecretIDs(ids...) +} + +// ClearOauth2tokens clears all "oauth2tokens" edges to the OhAuthTooToken entity. +func (iu *IntegrationUpdate) ClearOauth2tokens() *IntegrationUpdate { + iu.mutation.ClearOauth2tokens() + return iu +} + +// RemoveOauth2tokenIDs removes the "oauth2tokens" edge to OhAuthTooToken entities by IDs. +func (iu *IntegrationUpdate) RemoveOauth2tokenIDs(ids ...string) *IntegrationUpdate { + iu.mutation.RemoveOauth2tokenIDs(ids...) + return iu +} + +// RemoveOauth2tokens removes "oauth2tokens" edges to OhAuthTooToken entities. +func (iu *IntegrationUpdate) RemoveOauth2tokens(o ...*OhAuthTooToken) *IntegrationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return iu.RemoveOauth2tokenIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (iu *IntegrationUpdate) ClearEvents() *IntegrationUpdate { + iu.mutation.ClearEvents() + return iu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (iu *IntegrationUpdate) RemoveEventIDs(ids ...string) *IntegrationUpdate { + iu.mutation.RemoveEventIDs(ids...) + return iu +} + +// RemoveEvents removes "events" edges to Event entities. +func (iu *IntegrationUpdate) RemoveEvents(e ...*Event) *IntegrationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iu.RemoveEventIDs(ids...) +} + +// ClearWebhooks clears all "webhooks" edges to the Webhook entity. +func (iu *IntegrationUpdate) ClearWebhooks() *IntegrationUpdate { + iu.mutation.ClearWebhooks() + return iu +} + +// RemoveWebhookIDs removes the "webhooks" edge to Webhook entities by IDs. +func (iu *IntegrationUpdate) RemoveWebhookIDs(ids ...string) *IntegrationUpdate { + iu.mutation.RemoveWebhookIDs(ids...) + return iu +} + +// RemoveWebhooks removes "webhooks" edges to Webhook entities. +func (iu *IntegrationUpdate) RemoveWebhooks(w ...*Webhook) *IntegrationUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return iu.RemoveWebhookIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (iu *IntegrationUpdate) Save(ctx context.Context) (int, error) { + if err := iu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, iu.sqlSave, iu.mutation, iu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (iu *IntegrationUpdate) SaveX(ctx context.Context) int { + affected, err := iu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (iu *IntegrationUpdate) Exec(ctx context.Context) error { + _, err := iu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (iu *IntegrationUpdate) ExecX(ctx context.Context) { + if err := iu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (iu *IntegrationUpdate) defaults() error { + if _, ok := iu.mutation.UpdatedAt(); !ok && !iu.mutation.UpdatedAtCleared() { + if integration.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized integration.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := integration.UpdateDefaultUpdatedAt() + iu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (iu *IntegrationUpdate) check() error { + if v, ok := iu.mutation.OwnerID(); ok { + if err := integration.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Integration.owner_id": %w`, err)} + } + } + if v, ok := iu.mutation.Name(); ok { + if err := integration.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Integration.name": %w`, err)} + } + } + return nil +} + +func (iu *IntegrationUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := iu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(integration.Table, integration.Columns, sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString)) + if ps := iu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if iu.mutation.CreatedAtCleared() { + _spec.ClearField(integration.FieldCreatedAt, field.TypeTime) + } + if value, ok := iu.mutation.UpdatedAt(); ok { + _spec.SetField(integration.FieldUpdatedAt, field.TypeTime, value) + } + if iu.mutation.UpdatedAtCleared() { + _spec.ClearField(integration.FieldUpdatedAt, field.TypeTime) + } + if iu.mutation.CreatedByCleared() { + _spec.ClearField(integration.FieldCreatedBy, field.TypeString) + } + if value, ok := iu.mutation.UpdatedBy(); ok { + _spec.SetField(integration.FieldUpdatedBy, field.TypeString, value) + } + if iu.mutation.UpdatedByCleared() { + _spec.ClearField(integration.FieldUpdatedBy, field.TypeString) + } + if value, ok := iu.mutation.Tags(); ok { + _spec.SetField(integration.FieldTags, field.TypeJSON, value) + } + if value, ok := iu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, integration.FieldTags, value) + }) + } + if iu.mutation.TagsCleared() { + _spec.ClearField(integration.FieldTags, field.TypeJSON) + } + if value, ok := iu.mutation.DeletedAt(); ok { + _spec.SetField(integration.FieldDeletedAt, field.TypeTime, value) + } + if iu.mutation.DeletedAtCleared() { + _spec.ClearField(integration.FieldDeletedAt, field.TypeTime) + } + if value, ok := iu.mutation.DeletedBy(); ok { + _spec.SetField(integration.FieldDeletedBy, field.TypeString, value) + } + if iu.mutation.DeletedByCleared() { + _spec.ClearField(integration.FieldDeletedBy, field.TypeString) + } + if value, ok := iu.mutation.Name(); ok { + _spec.SetField(integration.FieldName, field.TypeString, value) + } + if value, ok := iu.mutation.Description(); ok { + _spec.SetField(integration.FieldDescription, field.TypeString, value) + } + if iu.mutation.DescriptionCleared() { + _spec.ClearField(integration.FieldDescription, field.TypeString) + } + if value, ok := iu.mutation.Kind(); ok { + _spec.SetField(integration.FieldKind, field.TypeString, value) + } + if iu.mutation.KindCleared() { + _spec.ClearField(integration.FieldKind, field.TypeString) + } + if iu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: integration.OwnerTable, + Columns: []string{integration.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.Integration + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: integration.OwnerTable, + Columns: []string{integration.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iu.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.RemovedSecretsIDs(); len(nodes) > 0 && !iu.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.SecretsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iu.mutation.Oauth2tokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationOauth2tokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.RemovedOauth2tokensIDs(); len(nodes) > 0 && !iu.mutation.Oauth2tokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.Oauth2tokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !iu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iu.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationWebhooks + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.RemovedWebhooksIDs(); len(nodes) > 0 && !iu.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.WebhooksIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = iu.schemaConfig.Integration + ctx = internal.NewSchemaConfigContext(ctx, iu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, iu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{integration.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + iu.mutation.done = true + return n, nil +} + +// IntegrationUpdateOne is the builder for updating a single Integration entity. +type IntegrationUpdateOne struct { + config + fields []string + hooks []Hook + mutation *IntegrationMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (iuo *IntegrationUpdateOne) SetUpdatedAt(t time.Time) *IntegrationUpdateOne { + iuo.mutation.SetUpdatedAt(t) + return iuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (iuo *IntegrationUpdateOne) ClearUpdatedAt() *IntegrationUpdateOne { + iuo.mutation.ClearUpdatedAt() + return iuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (iuo *IntegrationUpdateOne) SetUpdatedBy(s string) *IntegrationUpdateOne { + iuo.mutation.SetUpdatedBy(s) + return iuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (iuo *IntegrationUpdateOne) SetNillableUpdatedBy(s *string) *IntegrationUpdateOne { + if s != nil { + iuo.SetUpdatedBy(*s) + } + return iuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (iuo *IntegrationUpdateOne) ClearUpdatedBy() *IntegrationUpdateOne { + iuo.mutation.ClearUpdatedBy() + return iuo +} + +// SetTags sets the "tags" field. +func (iuo *IntegrationUpdateOne) SetTags(s []string) *IntegrationUpdateOne { + iuo.mutation.SetTags(s) + return iuo +} + +// AppendTags appends s to the "tags" field. +func (iuo *IntegrationUpdateOne) AppendTags(s []string) *IntegrationUpdateOne { + iuo.mutation.AppendTags(s) + return iuo +} + +// ClearTags clears the value of the "tags" field. +func (iuo *IntegrationUpdateOne) ClearTags() *IntegrationUpdateOne { + iuo.mutation.ClearTags() + return iuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (iuo *IntegrationUpdateOne) SetDeletedAt(t time.Time) *IntegrationUpdateOne { + iuo.mutation.SetDeletedAt(t) + return iuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (iuo *IntegrationUpdateOne) SetNillableDeletedAt(t *time.Time) *IntegrationUpdateOne { + if t != nil { + iuo.SetDeletedAt(*t) + } + return iuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (iuo *IntegrationUpdateOne) ClearDeletedAt() *IntegrationUpdateOne { + iuo.mutation.ClearDeletedAt() + return iuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (iuo *IntegrationUpdateOne) SetDeletedBy(s string) *IntegrationUpdateOne { + iuo.mutation.SetDeletedBy(s) + return iuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (iuo *IntegrationUpdateOne) SetNillableDeletedBy(s *string) *IntegrationUpdateOne { + if s != nil { + iuo.SetDeletedBy(*s) + } + return iuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (iuo *IntegrationUpdateOne) ClearDeletedBy() *IntegrationUpdateOne { + iuo.mutation.ClearDeletedBy() + return iuo +} + +// SetOwnerID sets the "owner_id" field. +func (iuo *IntegrationUpdateOne) SetOwnerID(s string) *IntegrationUpdateOne { + iuo.mutation.SetOwnerID(s) + return iuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (iuo *IntegrationUpdateOne) SetNillableOwnerID(s *string) *IntegrationUpdateOne { + if s != nil { + iuo.SetOwnerID(*s) + } + return iuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (iuo *IntegrationUpdateOne) ClearOwnerID() *IntegrationUpdateOne { + iuo.mutation.ClearOwnerID() + return iuo +} + +// SetName sets the "name" field. +func (iuo *IntegrationUpdateOne) SetName(s string) *IntegrationUpdateOne { + iuo.mutation.SetName(s) + return iuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (iuo *IntegrationUpdateOne) SetNillableName(s *string) *IntegrationUpdateOne { + if s != nil { + iuo.SetName(*s) + } + return iuo +} + +// SetDescription sets the "description" field. +func (iuo *IntegrationUpdateOne) SetDescription(s string) *IntegrationUpdateOne { + iuo.mutation.SetDescription(s) + return iuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (iuo *IntegrationUpdateOne) SetNillableDescription(s *string) *IntegrationUpdateOne { + if s != nil { + iuo.SetDescription(*s) + } + return iuo +} + +// ClearDescription clears the value of the "description" field. +func (iuo *IntegrationUpdateOne) ClearDescription() *IntegrationUpdateOne { + iuo.mutation.ClearDescription() + return iuo +} + +// SetKind sets the "kind" field. +func (iuo *IntegrationUpdateOne) SetKind(s string) *IntegrationUpdateOne { + iuo.mutation.SetKind(s) + return iuo +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (iuo *IntegrationUpdateOne) SetNillableKind(s *string) *IntegrationUpdateOne { + if s != nil { + iuo.SetKind(*s) + } + return iuo +} + +// ClearKind clears the value of the "kind" field. +func (iuo *IntegrationUpdateOne) ClearKind() *IntegrationUpdateOne { + iuo.mutation.ClearKind() + return iuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (iuo *IntegrationUpdateOne) SetOwner(o *Organization) *IntegrationUpdateOne { + return iuo.SetOwnerID(o.ID) +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by IDs. +func (iuo *IntegrationUpdateOne) AddSecretIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.AddSecretIDs(ids...) + return iuo +} + +// AddSecrets adds the "secrets" edges to the Hush entity. +func (iuo *IntegrationUpdateOne) AddSecrets(h ...*Hush) *IntegrationUpdateOne { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return iuo.AddSecretIDs(ids...) +} + +// AddOauth2tokenIDs adds the "oauth2tokens" edge to the OhAuthTooToken entity by IDs. +func (iuo *IntegrationUpdateOne) AddOauth2tokenIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.AddOauth2tokenIDs(ids...) + return iuo +} + +// AddOauth2tokens adds the "oauth2tokens" edges to the OhAuthTooToken entity. +func (iuo *IntegrationUpdateOne) AddOauth2tokens(o ...*OhAuthTooToken) *IntegrationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return iuo.AddOauth2tokenIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (iuo *IntegrationUpdateOne) AddEventIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.AddEventIDs(ids...) + return iuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (iuo *IntegrationUpdateOne) AddEvents(e ...*Event) *IntegrationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iuo.AddEventIDs(ids...) +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by IDs. +func (iuo *IntegrationUpdateOne) AddWebhookIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.AddWebhookIDs(ids...) + return iuo +} + +// AddWebhooks adds the "webhooks" edges to the Webhook entity. +func (iuo *IntegrationUpdateOne) AddWebhooks(w ...*Webhook) *IntegrationUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return iuo.AddWebhookIDs(ids...) +} + +// Mutation returns the IntegrationMutation object of the builder. +func (iuo *IntegrationUpdateOne) Mutation() *IntegrationMutation { + return iuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (iuo *IntegrationUpdateOne) ClearOwner() *IntegrationUpdateOne { + iuo.mutation.ClearOwner() + return iuo +} + +// ClearSecrets clears all "secrets" edges to the Hush entity. +func (iuo *IntegrationUpdateOne) ClearSecrets() *IntegrationUpdateOne { + iuo.mutation.ClearSecrets() + return iuo +} + +// RemoveSecretIDs removes the "secrets" edge to Hush entities by IDs. +func (iuo *IntegrationUpdateOne) RemoveSecretIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.RemoveSecretIDs(ids...) + return iuo +} + +// RemoveSecrets removes "secrets" edges to Hush entities. +func (iuo *IntegrationUpdateOne) RemoveSecrets(h ...*Hush) *IntegrationUpdateOne { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return iuo.RemoveSecretIDs(ids...) +} + +// ClearOauth2tokens clears all "oauth2tokens" edges to the OhAuthTooToken entity. +func (iuo *IntegrationUpdateOne) ClearOauth2tokens() *IntegrationUpdateOne { + iuo.mutation.ClearOauth2tokens() + return iuo +} + +// RemoveOauth2tokenIDs removes the "oauth2tokens" edge to OhAuthTooToken entities by IDs. +func (iuo *IntegrationUpdateOne) RemoveOauth2tokenIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.RemoveOauth2tokenIDs(ids...) + return iuo +} + +// RemoveOauth2tokens removes "oauth2tokens" edges to OhAuthTooToken entities. +func (iuo *IntegrationUpdateOne) RemoveOauth2tokens(o ...*OhAuthTooToken) *IntegrationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return iuo.RemoveOauth2tokenIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (iuo *IntegrationUpdateOne) ClearEvents() *IntegrationUpdateOne { + iuo.mutation.ClearEvents() + return iuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (iuo *IntegrationUpdateOne) RemoveEventIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.RemoveEventIDs(ids...) + return iuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (iuo *IntegrationUpdateOne) RemoveEvents(e ...*Event) *IntegrationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iuo.RemoveEventIDs(ids...) +} + +// ClearWebhooks clears all "webhooks" edges to the Webhook entity. +func (iuo *IntegrationUpdateOne) ClearWebhooks() *IntegrationUpdateOne { + iuo.mutation.ClearWebhooks() + return iuo +} + +// RemoveWebhookIDs removes the "webhooks" edge to Webhook entities by IDs. +func (iuo *IntegrationUpdateOne) RemoveWebhookIDs(ids ...string) *IntegrationUpdateOne { + iuo.mutation.RemoveWebhookIDs(ids...) + return iuo +} + +// RemoveWebhooks removes "webhooks" edges to Webhook entities. +func (iuo *IntegrationUpdateOne) RemoveWebhooks(w ...*Webhook) *IntegrationUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return iuo.RemoveWebhookIDs(ids...) +} + +// Where appends a list predicates to the IntegrationUpdate builder. +func (iuo *IntegrationUpdateOne) Where(ps ...predicate.Integration) *IntegrationUpdateOne { + iuo.mutation.Where(ps...) + return iuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (iuo *IntegrationUpdateOne) Select(field string, fields ...string) *IntegrationUpdateOne { + iuo.fields = append([]string{field}, fields...) + return iuo +} + +// Save executes the query and returns the updated Integration entity. +func (iuo *IntegrationUpdateOne) Save(ctx context.Context) (*Integration, error) { + if err := iuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, iuo.sqlSave, iuo.mutation, iuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (iuo *IntegrationUpdateOne) SaveX(ctx context.Context) *Integration { + node, err := iuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (iuo *IntegrationUpdateOne) Exec(ctx context.Context) error { + _, err := iuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (iuo *IntegrationUpdateOne) ExecX(ctx context.Context) { + if err := iuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (iuo *IntegrationUpdateOne) defaults() error { + if _, ok := iuo.mutation.UpdatedAt(); !ok && !iuo.mutation.UpdatedAtCleared() { + if integration.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized integration.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := integration.UpdateDefaultUpdatedAt() + iuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (iuo *IntegrationUpdateOne) check() error { + if v, ok := iuo.mutation.OwnerID(); ok { + if err := integration.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Integration.owner_id": %w`, err)} + } + } + if v, ok := iuo.mutation.Name(); ok { + if err := integration.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Integration.name": %w`, err)} + } + } + return nil +} + +func (iuo *IntegrationUpdateOne) sqlSave(ctx context.Context) (_node *Integration, err error) { + if err := iuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(integration.Table, integration.Columns, sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString)) + id, ok := iuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Integration.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := iuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, integration.FieldID) + for _, f := range fields { + if !integration.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != integration.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := iuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if iuo.mutation.CreatedAtCleared() { + _spec.ClearField(integration.FieldCreatedAt, field.TypeTime) + } + if value, ok := iuo.mutation.UpdatedAt(); ok { + _spec.SetField(integration.FieldUpdatedAt, field.TypeTime, value) + } + if iuo.mutation.UpdatedAtCleared() { + _spec.ClearField(integration.FieldUpdatedAt, field.TypeTime) + } + if iuo.mutation.CreatedByCleared() { + _spec.ClearField(integration.FieldCreatedBy, field.TypeString) + } + if value, ok := iuo.mutation.UpdatedBy(); ok { + _spec.SetField(integration.FieldUpdatedBy, field.TypeString, value) + } + if iuo.mutation.UpdatedByCleared() { + _spec.ClearField(integration.FieldUpdatedBy, field.TypeString) + } + if value, ok := iuo.mutation.Tags(); ok { + _spec.SetField(integration.FieldTags, field.TypeJSON, value) + } + if value, ok := iuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, integration.FieldTags, value) + }) + } + if iuo.mutation.TagsCleared() { + _spec.ClearField(integration.FieldTags, field.TypeJSON) + } + if value, ok := iuo.mutation.DeletedAt(); ok { + _spec.SetField(integration.FieldDeletedAt, field.TypeTime, value) + } + if iuo.mutation.DeletedAtCleared() { + _spec.ClearField(integration.FieldDeletedAt, field.TypeTime) + } + if value, ok := iuo.mutation.DeletedBy(); ok { + _spec.SetField(integration.FieldDeletedBy, field.TypeString, value) + } + if iuo.mutation.DeletedByCleared() { + _spec.ClearField(integration.FieldDeletedBy, field.TypeString) + } + if value, ok := iuo.mutation.Name(); ok { + _spec.SetField(integration.FieldName, field.TypeString, value) + } + if value, ok := iuo.mutation.Description(); ok { + _spec.SetField(integration.FieldDescription, field.TypeString, value) + } + if iuo.mutation.DescriptionCleared() { + _spec.ClearField(integration.FieldDescription, field.TypeString) + } + if value, ok := iuo.mutation.Kind(); ok { + _spec.SetField(integration.FieldKind, field.TypeString, value) + } + if iuo.mutation.KindCleared() { + _spec.ClearField(integration.FieldKind, field.TypeString) + } + if iuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: integration.OwnerTable, + Columns: []string{integration.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.Integration + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: integration.OwnerTable, + Columns: []string{integration.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iuo.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.RemovedSecretsIDs(); len(nodes) > 0 && !iuo.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.SecretsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.SecretsTable, + Columns: integration.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iuo.mutation.Oauth2tokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationOauth2tokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.RemovedOauth2tokensIDs(); len(nodes) > 0 && !iuo.mutation.Oauth2tokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.Oauth2tokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.Oauth2tokensTable, + Columns: integration.Oauth2tokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !iuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.EventsTable, + Columns: integration.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iuo.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationWebhooks + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.RemovedWebhooksIDs(); len(nodes) > 0 && !iuo.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.WebhooksIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: integration.WebhooksTable, + Columns: integration.WebhooksPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = iuo.schemaConfig.Integration + ctx = internal.NewSchemaConfigContext(ctx, iuo.schemaConfig) + _node = &Integration{config: iuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, iuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{integration.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + iuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/integrationhistory.go b/internal/ent/generated/integrationhistory.go new file mode 100644 index 0000000..8251395 --- /dev/null +++ b/internal/ent/generated/integrationhistory.go @@ -0,0 +1,266 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/entx/history" +) + +// IntegrationHistory is the model entity for the IntegrationHistory schema. +type IntegrationHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name,omitempty"` + // a description of the integration + Description string `json:"description,omitempty"` + // Kind holds the value of the "kind" field. + Kind string `json:"kind,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*IntegrationHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case integrationhistory.FieldTags: + values[i] = new([]byte) + case integrationhistory.FieldOperation: + values[i] = new(history.OpType) + case integrationhistory.FieldID, integrationhistory.FieldRef, integrationhistory.FieldCreatedBy, integrationhistory.FieldUpdatedBy, integrationhistory.FieldMappingID, integrationhistory.FieldDeletedBy, integrationhistory.FieldOwnerID, integrationhistory.FieldName, integrationhistory.FieldDescription, integrationhistory.FieldKind: + values[i] = new(sql.NullString) + case integrationhistory.FieldHistoryTime, integrationhistory.FieldCreatedAt, integrationhistory.FieldUpdatedAt, integrationhistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the IntegrationHistory fields. +func (ih *IntegrationHistory) 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 integrationhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + ih.ID = value.String + } + case integrationhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + ih.HistoryTime = value.Time + } + case integrationhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + ih.Ref = value.String + } + case integrationhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + ih.Operation = *value + } + case integrationhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + ih.CreatedAt = value.Time + } + case integrationhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + ih.UpdatedAt = value.Time + } + case integrationhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + ih.CreatedBy = value.String + } + case integrationhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + ih.UpdatedBy = value.String + } + case integrationhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + ih.MappingID = value.String + } + case integrationhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ih.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case integrationhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + ih.DeletedAt = value.Time + } + case integrationhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + ih.DeletedBy = value.String + } + case integrationhistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + ih.OwnerID = value.String + } + case integrationhistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + ih.Name = value.String + } + case integrationhistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + ih.Description = value.String + } + case integrationhistory.FieldKind: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field kind", values[i]) + } else if value.Valid { + ih.Kind = value.String + } + default: + ih.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the IntegrationHistory. +// This includes values selected through modifiers, order, etc. +func (ih *IntegrationHistory) Value(name string) (ent.Value, error) { + return ih.selectValues.Get(name) +} + +// Update returns a builder for updating this IntegrationHistory. +// Note that you need to call IntegrationHistory.Unwrap() before calling this method if this IntegrationHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (ih *IntegrationHistory) Update() *IntegrationHistoryUpdateOne { + return NewIntegrationHistoryClient(ih.config).UpdateOne(ih) +} + +// Unwrap unwraps the IntegrationHistory 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 (ih *IntegrationHistory) Unwrap() *IntegrationHistory { + _tx, ok := ih.config.driver.(*txDriver) + if !ok { + panic("generated: IntegrationHistory is not a transactional entity") + } + ih.config.driver = _tx.drv + return ih +} + +// String implements the fmt.Stringer. +func (ih *IntegrationHistory) String() string { + var builder strings.Builder + builder.WriteString("IntegrationHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", ih.ID)) + builder.WriteString("history_time=") + builder.WriteString(ih.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(ih.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", ih.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(ih.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(ih.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(ih.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(ih.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(ih.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", ih.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(ih.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(ih.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(ih.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(ih.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(ih.Description) + builder.WriteString(", ") + builder.WriteString("kind=") + builder.WriteString(ih.Kind) + builder.WriteByte(')') + return builder.String() +} + +// IntegrationHistories is a parsable slice of IntegrationHistory. +type IntegrationHistories []*IntegrationHistory diff --git a/internal/ent/generated/integrationhistory/integrationhistory.go b/internal/ent/generated/integrationhistory/integrationhistory.go new file mode 100644 index 0000000..df6fb5b --- /dev/null +++ b/internal/ent/generated/integrationhistory/integrationhistory.go @@ -0,0 +1,202 @@ +// Code generated by ent, DO NOT EDIT. + +package integrationhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the integrationhistory type in the database. + Label = "integration_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldKind holds the string denoting the kind field in the database. + FieldKind = "kind" + // Table holds the table name of the integrationhistory in the database. + Table = "integration_history" +) + +// Columns holds all SQL columns for integrationhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldName, + FieldDescription, + FieldKind, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("integrationhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the IntegrationHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByKind orders the results by the kind field. +func ByKind(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldKind, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/integrationhistory/where.go b/internal/ent/generated/integrationhistory/where.go new file mode 100644 index 0000000..23d93e2 --- /dev/null +++ b/internal/ent/generated/integrationhistory/where.go @@ -0,0 +1,1021 @@ +// Code generated by ent, DO NOT EDIT. + +package integrationhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldDescription, v)) +} + +// Kind applies equality check predicate on the "kind" field. It's identical to KindEQ. +func Kind(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldKind, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// KindEQ applies the EQ predicate on the "kind" field. +func KindEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEQ(FieldKind, v)) +} + +// KindNEQ applies the NEQ predicate on the "kind" field. +func KindNEQ(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNEQ(FieldKind, v)) +} + +// KindIn applies the In predicate on the "kind" field. +func KindIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIn(FieldKind, vs...)) +} + +// KindNotIn applies the NotIn predicate on the "kind" field. +func KindNotIn(vs ...string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotIn(FieldKind, vs...)) +} + +// KindGT applies the GT predicate on the "kind" field. +func KindGT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGT(FieldKind, v)) +} + +// KindGTE applies the GTE predicate on the "kind" field. +func KindGTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldGTE(FieldKind, v)) +} + +// KindLT applies the LT predicate on the "kind" field. +func KindLT(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLT(FieldKind, v)) +} + +// KindLTE applies the LTE predicate on the "kind" field. +func KindLTE(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldLTE(FieldKind, v)) +} + +// KindContains applies the Contains predicate on the "kind" field. +func KindContains(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContains(FieldKind, v)) +} + +// KindHasPrefix applies the HasPrefix predicate on the "kind" field. +func KindHasPrefix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasPrefix(FieldKind, v)) +} + +// KindHasSuffix applies the HasSuffix predicate on the "kind" field. +func KindHasSuffix(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldHasSuffix(FieldKind, v)) +} + +// KindIsNil applies the IsNil predicate on the "kind" field. +func KindIsNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldIsNull(FieldKind)) +} + +// KindNotNil applies the NotNil predicate on the "kind" field. +func KindNotNil() predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldNotNull(FieldKind)) +} + +// KindEqualFold applies the EqualFold predicate on the "kind" field. +func KindEqualFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldEqualFold(FieldKind, v)) +} + +// KindContainsFold applies the ContainsFold predicate on the "kind" field. +func KindContainsFold(v string) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.FieldContainsFold(FieldKind, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.IntegrationHistory) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.IntegrationHistory) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.IntegrationHistory) predicate.IntegrationHistory { + return predicate.IntegrationHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/integrationhistory_create.go b/internal/ent/generated/integrationhistory_create.go new file mode 100644 index 0000000..120b2d3 --- /dev/null +++ b/internal/ent/generated/integrationhistory_create.go @@ -0,0 +1,503 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/entx/history" +) + +// IntegrationHistoryCreate is the builder for creating a IntegrationHistory entity. +type IntegrationHistoryCreate struct { + config + mutation *IntegrationHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ihc *IntegrationHistoryCreate) SetHistoryTime(t time.Time) *IntegrationHistoryCreate { + ihc.mutation.SetHistoryTime(t) + return ihc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableHistoryTime(t *time.Time) *IntegrationHistoryCreate { + if t != nil { + ihc.SetHistoryTime(*t) + } + return ihc +} + +// SetRef sets the "ref" field. +func (ihc *IntegrationHistoryCreate) SetRef(s string) *IntegrationHistoryCreate { + ihc.mutation.SetRef(s) + return ihc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableRef(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetRef(*s) + } + return ihc +} + +// SetOperation sets the "operation" field. +func (ihc *IntegrationHistoryCreate) SetOperation(ht history.OpType) *IntegrationHistoryCreate { + ihc.mutation.SetOperation(ht) + return ihc +} + +// SetCreatedAt sets the "created_at" field. +func (ihc *IntegrationHistoryCreate) SetCreatedAt(t time.Time) *IntegrationHistoryCreate { + ihc.mutation.SetCreatedAt(t) + return ihc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableCreatedAt(t *time.Time) *IntegrationHistoryCreate { + if t != nil { + ihc.SetCreatedAt(*t) + } + return ihc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ihc *IntegrationHistoryCreate) SetUpdatedAt(t time.Time) *IntegrationHistoryCreate { + ihc.mutation.SetUpdatedAt(t) + return ihc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableUpdatedAt(t *time.Time) *IntegrationHistoryCreate { + if t != nil { + ihc.SetUpdatedAt(*t) + } + return ihc +} + +// SetCreatedBy sets the "created_by" field. +func (ihc *IntegrationHistoryCreate) SetCreatedBy(s string) *IntegrationHistoryCreate { + ihc.mutation.SetCreatedBy(s) + return ihc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableCreatedBy(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetCreatedBy(*s) + } + return ihc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ihc *IntegrationHistoryCreate) SetUpdatedBy(s string) *IntegrationHistoryCreate { + ihc.mutation.SetUpdatedBy(s) + return ihc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableUpdatedBy(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetUpdatedBy(*s) + } + return ihc +} + +// SetMappingID sets the "mapping_id" field. +func (ihc *IntegrationHistoryCreate) SetMappingID(s string) *IntegrationHistoryCreate { + ihc.mutation.SetMappingID(s) + return ihc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableMappingID(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetMappingID(*s) + } + return ihc +} + +// SetTags sets the "tags" field. +func (ihc *IntegrationHistoryCreate) SetTags(s []string) *IntegrationHistoryCreate { + ihc.mutation.SetTags(s) + return ihc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ihc *IntegrationHistoryCreate) SetDeletedAt(t time.Time) *IntegrationHistoryCreate { + ihc.mutation.SetDeletedAt(t) + return ihc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableDeletedAt(t *time.Time) *IntegrationHistoryCreate { + if t != nil { + ihc.SetDeletedAt(*t) + } + return ihc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ihc *IntegrationHistoryCreate) SetDeletedBy(s string) *IntegrationHistoryCreate { + ihc.mutation.SetDeletedBy(s) + return ihc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableDeletedBy(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetDeletedBy(*s) + } + return ihc +} + +// SetOwnerID sets the "owner_id" field. +func (ihc *IntegrationHistoryCreate) SetOwnerID(s string) *IntegrationHistoryCreate { + ihc.mutation.SetOwnerID(s) + return ihc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableOwnerID(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetOwnerID(*s) + } + return ihc +} + +// SetName sets the "name" field. +func (ihc *IntegrationHistoryCreate) SetName(s string) *IntegrationHistoryCreate { + ihc.mutation.SetName(s) + return ihc +} + +// SetDescription sets the "description" field. +func (ihc *IntegrationHistoryCreate) SetDescription(s string) *IntegrationHistoryCreate { + ihc.mutation.SetDescription(s) + return ihc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableDescription(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetDescription(*s) + } + return ihc +} + +// SetKind sets the "kind" field. +func (ihc *IntegrationHistoryCreate) SetKind(s string) *IntegrationHistoryCreate { + ihc.mutation.SetKind(s) + return ihc +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableKind(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetKind(*s) + } + return ihc +} + +// SetID sets the "id" field. +func (ihc *IntegrationHistoryCreate) SetID(s string) *IntegrationHistoryCreate { + ihc.mutation.SetID(s) + return ihc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ihc *IntegrationHistoryCreate) SetNillableID(s *string) *IntegrationHistoryCreate { + if s != nil { + ihc.SetID(*s) + } + return ihc +} + +// Mutation returns the IntegrationHistoryMutation object of the builder. +func (ihc *IntegrationHistoryCreate) Mutation() *IntegrationHistoryMutation { + return ihc.mutation +} + +// Save creates the IntegrationHistory in the database. +func (ihc *IntegrationHistoryCreate) Save(ctx context.Context) (*IntegrationHistory, error) { + if err := ihc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ihc.sqlSave, ihc.mutation, ihc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ihc *IntegrationHistoryCreate) SaveX(ctx context.Context) *IntegrationHistory { + v, err := ihc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ihc *IntegrationHistoryCreate) Exec(ctx context.Context) error { + _, err := ihc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ihc *IntegrationHistoryCreate) ExecX(ctx context.Context) { + if err := ihc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ihc *IntegrationHistoryCreate) defaults() error { + if _, ok := ihc.mutation.HistoryTime(); !ok { + if integrationhistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized integrationhistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := integrationhistory.DefaultHistoryTime() + ihc.mutation.SetHistoryTime(v) + } + if _, ok := ihc.mutation.CreatedAt(); !ok { + if integrationhistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized integrationhistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := integrationhistory.DefaultCreatedAt() + ihc.mutation.SetCreatedAt(v) + } + if _, ok := ihc.mutation.UpdatedAt(); !ok { + if integrationhistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized integrationhistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := integrationhistory.DefaultUpdatedAt() + ihc.mutation.SetUpdatedAt(v) + } + if _, ok := ihc.mutation.MappingID(); !ok { + if integrationhistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized integrationhistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := integrationhistory.DefaultMappingID() + ihc.mutation.SetMappingID(v) + } + if _, ok := ihc.mutation.Tags(); !ok { + v := integrationhistory.DefaultTags + ihc.mutation.SetTags(v) + } + if _, ok := ihc.mutation.ID(); !ok { + if integrationhistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized integrationhistory.DefaultID (forgotten import generated/runtime?)") + } + v := integrationhistory.DefaultID() + ihc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ihc *IntegrationHistoryCreate) check() error { + if _, ok := ihc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "IntegrationHistory.history_time"`)} + } + if _, ok := ihc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "IntegrationHistory.operation"`)} + } + if v, ok := ihc.mutation.Operation(); ok { + if err := integrationhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "IntegrationHistory.operation": %w`, err)} + } + } + if _, ok := ihc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "IntegrationHistory.mapping_id"`)} + } + if _, ok := ihc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "IntegrationHistory.name"`)} + } + return nil +} + +func (ihc *IntegrationHistoryCreate) sqlSave(ctx context.Context) (*IntegrationHistory, error) { + if err := ihc.check(); err != nil { + return nil, err + } + _node, _spec := ihc.createSpec() + if err := sqlgraph.CreateNode(ctx, ihc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected IntegrationHistory.ID type: %T", _spec.ID.Value) + } + } + ihc.mutation.id = &_node.ID + ihc.mutation.done = true + return _node, nil +} + +func (ihc *IntegrationHistoryCreate) createSpec() (*IntegrationHistory, *sqlgraph.CreateSpec) { + var ( + _node = &IntegrationHistory{config: ihc.config} + _spec = sqlgraph.NewCreateSpec(integrationhistory.Table, sqlgraph.NewFieldSpec(integrationhistory.FieldID, field.TypeString)) + ) + _spec.Schema = ihc.schemaConfig.IntegrationHistory + if id, ok := ihc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ihc.mutation.HistoryTime(); ok { + _spec.SetField(integrationhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ihc.mutation.Ref(); ok { + _spec.SetField(integrationhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ihc.mutation.Operation(); ok { + _spec.SetField(integrationhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ihc.mutation.CreatedAt(); ok { + _spec.SetField(integrationhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ihc.mutation.UpdatedAt(); ok { + _spec.SetField(integrationhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ihc.mutation.CreatedBy(); ok { + _spec.SetField(integrationhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ihc.mutation.UpdatedBy(); ok { + _spec.SetField(integrationhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ihc.mutation.MappingID(); ok { + _spec.SetField(integrationhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ihc.mutation.Tags(); ok { + _spec.SetField(integrationhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ihc.mutation.DeletedAt(); ok { + _spec.SetField(integrationhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ihc.mutation.DeletedBy(); ok { + _spec.SetField(integrationhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ihc.mutation.OwnerID(); ok { + _spec.SetField(integrationhistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ihc.mutation.Name(); ok { + _spec.SetField(integrationhistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ihc.mutation.Description(); ok { + _spec.SetField(integrationhistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := ihc.mutation.Kind(); ok { + _spec.SetField(integrationhistory.FieldKind, field.TypeString, value) + _node.Kind = value + } + return _node, _spec +} + +// IntegrationHistoryCreateBulk is the builder for creating many IntegrationHistory entities in bulk. +type IntegrationHistoryCreateBulk struct { + config + err error + builders []*IntegrationHistoryCreate +} + +// Save creates the IntegrationHistory entities in the database. +func (ihcb *IntegrationHistoryCreateBulk) Save(ctx context.Context) ([]*IntegrationHistory, error) { + if ihcb.err != nil { + return nil, ihcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ihcb.builders)) + nodes := make([]*IntegrationHistory, len(ihcb.builders)) + mutators := make([]Mutator, len(ihcb.builders)) + for i := range ihcb.builders { + func(i int, root context.Context) { + builder := ihcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*IntegrationHistoryMutation) + 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, ihcb.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, ihcb.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, ihcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ihcb *IntegrationHistoryCreateBulk) SaveX(ctx context.Context) []*IntegrationHistory { + v, err := ihcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ihcb *IntegrationHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ihcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ihcb *IntegrationHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ihcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/integrationhistory_delete.go b/internal/ent/generated/integrationhistory_delete.go new file mode 100644 index 0000000..9d1a426 --- /dev/null +++ b/internal/ent/generated/integrationhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// IntegrationHistoryDelete is the builder for deleting a IntegrationHistory entity. +type IntegrationHistoryDelete struct { + config + hooks []Hook + mutation *IntegrationHistoryMutation +} + +// Where appends a list predicates to the IntegrationHistoryDelete builder. +func (ihd *IntegrationHistoryDelete) Where(ps ...predicate.IntegrationHistory) *IntegrationHistoryDelete { + ihd.mutation.Where(ps...) + return ihd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ihd *IntegrationHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ihd.sqlExec, ihd.mutation, ihd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ihd *IntegrationHistoryDelete) ExecX(ctx context.Context) int { + n, err := ihd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ihd *IntegrationHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(integrationhistory.Table, sqlgraph.NewFieldSpec(integrationhistory.FieldID, field.TypeString)) + _spec.Node.Schema = ihd.schemaConfig.IntegrationHistory + ctx = internal.NewSchemaConfigContext(ctx, ihd.schemaConfig) + if ps := ihd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ihd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ihd.mutation.done = true + return affected, err +} + +// IntegrationHistoryDeleteOne is the builder for deleting a single IntegrationHistory entity. +type IntegrationHistoryDeleteOne struct { + ihd *IntegrationHistoryDelete +} + +// Where appends a list predicates to the IntegrationHistoryDelete builder. +func (ihdo *IntegrationHistoryDeleteOne) Where(ps ...predicate.IntegrationHistory) *IntegrationHistoryDeleteOne { + ihdo.ihd.mutation.Where(ps...) + return ihdo +} + +// Exec executes the deletion query. +func (ihdo *IntegrationHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ihdo.ihd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{integrationhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ihdo *IntegrationHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ihdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/integrationhistory_query.go b/internal/ent/generated/integrationhistory_query.go new file mode 100644 index 0000000..f69220b --- /dev/null +++ b/internal/ent/generated/integrationhistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// IntegrationHistoryQuery is the builder for querying IntegrationHistory entities. +type IntegrationHistoryQuery struct { + config + ctx *QueryContext + order []integrationhistory.OrderOption + inters []Interceptor + predicates []predicate.IntegrationHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*IntegrationHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the IntegrationHistoryQuery builder. +func (ihq *IntegrationHistoryQuery) Where(ps ...predicate.IntegrationHistory) *IntegrationHistoryQuery { + ihq.predicates = append(ihq.predicates, ps...) + return ihq +} + +// Limit the number of records to be returned by this query. +func (ihq *IntegrationHistoryQuery) Limit(limit int) *IntegrationHistoryQuery { + ihq.ctx.Limit = &limit + return ihq +} + +// Offset to start from. +func (ihq *IntegrationHistoryQuery) Offset(offset int) *IntegrationHistoryQuery { + ihq.ctx.Offset = &offset + return ihq +} + +// 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 (ihq *IntegrationHistoryQuery) Unique(unique bool) *IntegrationHistoryQuery { + ihq.ctx.Unique = &unique + return ihq +} + +// Order specifies how the records should be ordered. +func (ihq *IntegrationHistoryQuery) Order(o ...integrationhistory.OrderOption) *IntegrationHistoryQuery { + ihq.order = append(ihq.order, o...) + return ihq +} + +// First returns the first IntegrationHistory entity from the query. +// Returns a *NotFoundError when no IntegrationHistory was found. +func (ihq *IntegrationHistoryQuery) First(ctx context.Context) (*IntegrationHistory, error) { + nodes, err := ihq.Limit(1).All(setContextOp(ctx, ihq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{integrationhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) FirstX(ctx context.Context) *IntegrationHistory { + node, err := ihq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first IntegrationHistory ID from the query. +// Returns a *NotFoundError when no IntegrationHistory ID was found. +func (ihq *IntegrationHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ihq.Limit(1).IDs(setContextOp(ctx, ihq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{integrationhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ihq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single IntegrationHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one IntegrationHistory entity is found. +// Returns a *NotFoundError when no IntegrationHistory entities are found. +func (ihq *IntegrationHistoryQuery) Only(ctx context.Context) (*IntegrationHistory, error) { + nodes, err := ihq.Limit(2).All(setContextOp(ctx, ihq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{integrationhistory.Label} + default: + return nil, &NotSingularError{integrationhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) OnlyX(ctx context.Context) *IntegrationHistory { + node, err := ihq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only IntegrationHistory ID in the query. +// Returns a *NotSingularError when more than one IntegrationHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ihq *IntegrationHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ihq.Limit(2).IDs(setContextOp(ctx, ihq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{integrationhistory.Label} + default: + err = &NotSingularError{integrationhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ihq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of IntegrationHistories. +func (ihq *IntegrationHistoryQuery) All(ctx context.Context) ([]*IntegrationHistory, error) { + ctx = setContextOp(ctx, ihq.ctx, ent.OpQueryAll) + if err := ihq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*IntegrationHistory, *IntegrationHistoryQuery]() + return withInterceptors[[]*IntegrationHistory](ctx, ihq, qr, ihq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) AllX(ctx context.Context) []*IntegrationHistory { + nodes, err := ihq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of IntegrationHistory IDs. +func (ihq *IntegrationHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ihq.ctx.Unique == nil && ihq.path != nil { + ihq.Unique(true) + } + ctx = setContextOp(ctx, ihq.ctx, ent.OpQueryIDs) + if err = ihq.Select(integrationhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ihq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ihq *IntegrationHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ihq.ctx, ent.OpQueryCount) + if err := ihq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ihq, querierCount[*IntegrationHistoryQuery](), ihq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) CountX(ctx context.Context) int { + count, err := ihq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ihq *IntegrationHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ihq.ctx, ent.OpQueryExist) + switch _, err := ihq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ihq *IntegrationHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ihq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the IntegrationHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ihq *IntegrationHistoryQuery) Clone() *IntegrationHistoryQuery { + if ihq == nil { + return nil + } + return &IntegrationHistoryQuery{ + config: ihq.config, + ctx: ihq.ctx.Clone(), + order: append([]integrationhistory.OrderOption{}, ihq.order...), + inters: append([]Interceptor{}, ihq.inters...), + predicates: append([]predicate.IntegrationHistory{}, ihq.predicates...), + // clone intermediate query. + sql: ihq.sql.Clone(), + path: ihq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.IntegrationHistory.Query(). +// GroupBy(integrationhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ihq *IntegrationHistoryQuery) GroupBy(field string, fields ...string) *IntegrationHistoryGroupBy { + ihq.ctx.Fields = append([]string{field}, fields...) + grbuild := &IntegrationHistoryGroupBy{build: ihq} + grbuild.flds = &ihq.ctx.Fields + grbuild.label = integrationhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.IntegrationHistory.Query(). +// Select(integrationhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ihq *IntegrationHistoryQuery) Select(fields ...string) *IntegrationHistorySelect { + ihq.ctx.Fields = append(ihq.ctx.Fields, fields...) + sbuild := &IntegrationHistorySelect{IntegrationHistoryQuery: ihq} + sbuild.label = integrationhistory.Label + sbuild.flds, sbuild.scan = &ihq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a IntegrationHistorySelect configured with the given aggregations. +func (ihq *IntegrationHistoryQuery) Aggregate(fns ...AggregateFunc) *IntegrationHistorySelect { + return ihq.Select().Aggregate(fns...) +} + +func (ihq *IntegrationHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ihq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ihq); err != nil { + return err + } + } + } + for _, f := range ihq.ctx.Fields { + if !integrationhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ihq.path != nil { + prev, err := ihq.path(ctx) + if err != nil { + return err + } + ihq.sql = prev + } + if integrationhistory.Policy == nil { + return errors.New("generated: uninitialized integrationhistory.Policy (forgotten import generated/runtime?)") + } + if err := integrationhistory.Policy.EvalQuery(ctx, ihq); err != nil { + return err + } + return nil +} + +func (ihq *IntegrationHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*IntegrationHistory, error) { + var ( + nodes = []*IntegrationHistory{} + _spec = ihq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*IntegrationHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &IntegrationHistory{config: ihq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ihq.schemaConfig.IntegrationHistory + ctx = internal.NewSchemaConfigContext(ctx, ihq.schemaConfig) + if len(ihq.modifiers) > 0 { + _spec.Modifiers = ihq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ihq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ihq.loadTotal { + if err := ihq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ihq *IntegrationHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ihq.querySpec() + _spec.Node.Schema = ihq.schemaConfig.IntegrationHistory + ctx = internal.NewSchemaConfigContext(ctx, ihq.schemaConfig) + if len(ihq.modifiers) > 0 { + _spec.Modifiers = ihq.modifiers + } + _spec.Node.Columns = ihq.ctx.Fields + if len(ihq.ctx.Fields) > 0 { + _spec.Unique = ihq.ctx.Unique != nil && *ihq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ihq.driver, _spec) +} + +func (ihq *IntegrationHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(integrationhistory.Table, integrationhistory.Columns, sqlgraph.NewFieldSpec(integrationhistory.FieldID, field.TypeString)) + _spec.From = ihq.sql + if unique := ihq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ihq.path != nil { + _spec.Unique = true + } + if fields := ihq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, integrationhistory.FieldID) + for i := range fields { + if fields[i] != integrationhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ihq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ihq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ihq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ihq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ihq *IntegrationHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ihq.driver.Dialect()) + t1 := builder.Table(integrationhistory.Table) + columns := ihq.ctx.Fields + if len(columns) == 0 { + columns = integrationhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ihq.sql != nil { + selector = ihq.sql + selector.Select(selector.Columns(columns...)...) + } + if ihq.ctx.Unique != nil && *ihq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ihq.schemaConfig.IntegrationHistory) + ctx = internal.NewSchemaConfigContext(ctx, ihq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ihq.predicates { + p(selector) + } + for _, p := range ihq.order { + p(selector) + } + if offset := ihq.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 := ihq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// IntegrationHistoryGroupBy is the group-by builder for IntegrationHistory entities. +type IntegrationHistoryGroupBy struct { + selector + build *IntegrationHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ihgb *IntegrationHistoryGroupBy) Aggregate(fns ...AggregateFunc) *IntegrationHistoryGroupBy { + ihgb.fns = append(ihgb.fns, fns...) + return ihgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ihgb *IntegrationHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ihgb.build.ctx, ent.OpQueryGroupBy) + if err := ihgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*IntegrationHistoryQuery, *IntegrationHistoryGroupBy](ctx, ihgb.build, ihgb, ihgb.build.inters, v) +} + +func (ihgb *IntegrationHistoryGroupBy) sqlScan(ctx context.Context, root *IntegrationHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ihgb.fns)) + for _, fn := range ihgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ihgb.flds)+len(ihgb.fns)) + for _, f := range *ihgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ihgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ihgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// IntegrationHistorySelect is the builder for selecting fields of IntegrationHistory entities. +type IntegrationHistorySelect struct { + *IntegrationHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ihs *IntegrationHistorySelect) Aggregate(fns ...AggregateFunc) *IntegrationHistorySelect { + ihs.fns = append(ihs.fns, fns...) + return ihs +} + +// Scan applies the selector query and scans the result into the given value. +func (ihs *IntegrationHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ihs.ctx, ent.OpQuerySelect) + if err := ihs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*IntegrationHistoryQuery, *IntegrationHistorySelect](ctx, ihs.IntegrationHistoryQuery, ihs, ihs.inters, v) +} + +func (ihs *IntegrationHistorySelect) sqlScan(ctx context.Context, root *IntegrationHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ihs.fns)) + for _, fn := range ihs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ihs.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 := ihs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/integrationhistory_update.go b/internal/ent/generated/integrationhistory_update.go new file mode 100644 index 0000000..53ffbfd --- /dev/null +++ b/internal/ent/generated/integrationhistory_update.go @@ -0,0 +1,671 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// IntegrationHistoryUpdate is the builder for updating IntegrationHistory entities. +type IntegrationHistoryUpdate struct { + config + hooks []Hook + mutation *IntegrationHistoryMutation +} + +// Where appends a list predicates to the IntegrationHistoryUpdate builder. +func (ihu *IntegrationHistoryUpdate) Where(ps ...predicate.IntegrationHistory) *IntegrationHistoryUpdate { + ihu.mutation.Where(ps...) + return ihu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ihu *IntegrationHistoryUpdate) SetUpdatedAt(t time.Time) *IntegrationHistoryUpdate { + ihu.mutation.SetUpdatedAt(t) + return ihu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ihu *IntegrationHistoryUpdate) ClearUpdatedAt() *IntegrationHistoryUpdate { + ihu.mutation.ClearUpdatedAt() + return ihu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ihu *IntegrationHistoryUpdate) SetUpdatedBy(s string) *IntegrationHistoryUpdate { + ihu.mutation.SetUpdatedBy(s) + return ihu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ihu *IntegrationHistoryUpdate) SetNillableUpdatedBy(s *string) *IntegrationHistoryUpdate { + if s != nil { + ihu.SetUpdatedBy(*s) + } + return ihu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ihu *IntegrationHistoryUpdate) ClearUpdatedBy() *IntegrationHistoryUpdate { + ihu.mutation.ClearUpdatedBy() + return ihu +} + +// SetTags sets the "tags" field. +func (ihu *IntegrationHistoryUpdate) SetTags(s []string) *IntegrationHistoryUpdate { + ihu.mutation.SetTags(s) + return ihu +} + +// AppendTags appends s to the "tags" field. +func (ihu *IntegrationHistoryUpdate) AppendTags(s []string) *IntegrationHistoryUpdate { + ihu.mutation.AppendTags(s) + return ihu +} + +// ClearTags clears the value of the "tags" field. +func (ihu *IntegrationHistoryUpdate) ClearTags() *IntegrationHistoryUpdate { + ihu.mutation.ClearTags() + return ihu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ihu *IntegrationHistoryUpdate) SetDeletedAt(t time.Time) *IntegrationHistoryUpdate { + ihu.mutation.SetDeletedAt(t) + return ihu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ihu *IntegrationHistoryUpdate) SetNillableDeletedAt(t *time.Time) *IntegrationHistoryUpdate { + if t != nil { + ihu.SetDeletedAt(*t) + } + return ihu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ihu *IntegrationHistoryUpdate) ClearDeletedAt() *IntegrationHistoryUpdate { + ihu.mutation.ClearDeletedAt() + return ihu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ihu *IntegrationHistoryUpdate) SetDeletedBy(s string) *IntegrationHistoryUpdate { + ihu.mutation.SetDeletedBy(s) + return ihu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ihu *IntegrationHistoryUpdate) SetNillableDeletedBy(s *string) *IntegrationHistoryUpdate { + if s != nil { + ihu.SetDeletedBy(*s) + } + return ihu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ihu *IntegrationHistoryUpdate) ClearDeletedBy() *IntegrationHistoryUpdate { + ihu.mutation.ClearDeletedBy() + return ihu +} + +// SetOwnerID sets the "owner_id" field. +func (ihu *IntegrationHistoryUpdate) SetOwnerID(s string) *IntegrationHistoryUpdate { + ihu.mutation.SetOwnerID(s) + return ihu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ihu *IntegrationHistoryUpdate) SetNillableOwnerID(s *string) *IntegrationHistoryUpdate { + if s != nil { + ihu.SetOwnerID(*s) + } + return ihu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ihu *IntegrationHistoryUpdate) ClearOwnerID() *IntegrationHistoryUpdate { + ihu.mutation.ClearOwnerID() + return ihu +} + +// SetName sets the "name" field. +func (ihu *IntegrationHistoryUpdate) SetName(s string) *IntegrationHistoryUpdate { + ihu.mutation.SetName(s) + return ihu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ihu *IntegrationHistoryUpdate) SetNillableName(s *string) *IntegrationHistoryUpdate { + if s != nil { + ihu.SetName(*s) + } + return ihu +} + +// SetDescription sets the "description" field. +func (ihu *IntegrationHistoryUpdate) SetDescription(s string) *IntegrationHistoryUpdate { + ihu.mutation.SetDescription(s) + return ihu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ihu *IntegrationHistoryUpdate) SetNillableDescription(s *string) *IntegrationHistoryUpdate { + if s != nil { + ihu.SetDescription(*s) + } + return ihu +} + +// ClearDescription clears the value of the "description" field. +func (ihu *IntegrationHistoryUpdate) ClearDescription() *IntegrationHistoryUpdate { + ihu.mutation.ClearDescription() + return ihu +} + +// SetKind sets the "kind" field. +func (ihu *IntegrationHistoryUpdate) SetKind(s string) *IntegrationHistoryUpdate { + ihu.mutation.SetKind(s) + return ihu +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (ihu *IntegrationHistoryUpdate) SetNillableKind(s *string) *IntegrationHistoryUpdate { + if s != nil { + ihu.SetKind(*s) + } + return ihu +} + +// ClearKind clears the value of the "kind" field. +func (ihu *IntegrationHistoryUpdate) ClearKind() *IntegrationHistoryUpdate { + ihu.mutation.ClearKind() + return ihu +} + +// Mutation returns the IntegrationHistoryMutation object of the builder. +func (ihu *IntegrationHistoryUpdate) Mutation() *IntegrationHistoryMutation { + return ihu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ihu *IntegrationHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ihu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ihu.sqlSave, ihu.mutation, ihu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ihu *IntegrationHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ihu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ihu *IntegrationHistoryUpdate) Exec(ctx context.Context) error { + _, err := ihu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ihu *IntegrationHistoryUpdate) ExecX(ctx context.Context) { + if err := ihu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ihu *IntegrationHistoryUpdate) defaults() error { + if _, ok := ihu.mutation.UpdatedAt(); !ok && !ihu.mutation.UpdatedAtCleared() { + if integrationhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized integrationhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := integrationhistory.UpdateDefaultUpdatedAt() + ihu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ihu *IntegrationHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(integrationhistory.Table, integrationhistory.Columns, sqlgraph.NewFieldSpec(integrationhistory.FieldID, field.TypeString)) + if ps := ihu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ihu.mutation.RefCleared() { + _spec.ClearField(integrationhistory.FieldRef, field.TypeString) + } + if ihu.mutation.CreatedAtCleared() { + _spec.ClearField(integrationhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ihu.mutation.UpdatedAt(); ok { + _spec.SetField(integrationhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ihu.mutation.UpdatedAtCleared() { + _spec.ClearField(integrationhistory.FieldUpdatedAt, field.TypeTime) + } + if ihu.mutation.CreatedByCleared() { + _spec.ClearField(integrationhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ihu.mutation.UpdatedBy(); ok { + _spec.SetField(integrationhistory.FieldUpdatedBy, field.TypeString, value) + } + if ihu.mutation.UpdatedByCleared() { + _spec.ClearField(integrationhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ihu.mutation.Tags(); ok { + _spec.SetField(integrationhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ihu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, integrationhistory.FieldTags, value) + }) + } + if ihu.mutation.TagsCleared() { + _spec.ClearField(integrationhistory.FieldTags, field.TypeJSON) + } + if value, ok := ihu.mutation.DeletedAt(); ok { + _spec.SetField(integrationhistory.FieldDeletedAt, field.TypeTime, value) + } + if ihu.mutation.DeletedAtCleared() { + _spec.ClearField(integrationhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ihu.mutation.DeletedBy(); ok { + _spec.SetField(integrationhistory.FieldDeletedBy, field.TypeString, value) + } + if ihu.mutation.DeletedByCleared() { + _spec.ClearField(integrationhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ihu.mutation.OwnerID(); ok { + _spec.SetField(integrationhistory.FieldOwnerID, field.TypeString, value) + } + if ihu.mutation.OwnerIDCleared() { + _spec.ClearField(integrationhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ihu.mutation.Name(); ok { + _spec.SetField(integrationhistory.FieldName, field.TypeString, value) + } + if value, ok := ihu.mutation.Description(); ok { + _spec.SetField(integrationhistory.FieldDescription, field.TypeString, value) + } + if ihu.mutation.DescriptionCleared() { + _spec.ClearField(integrationhistory.FieldDescription, field.TypeString) + } + if value, ok := ihu.mutation.Kind(); ok { + _spec.SetField(integrationhistory.FieldKind, field.TypeString, value) + } + if ihu.mutation.KindCleared() { + _spec.ClearField(integrationhistory.FieldKind, field.TypeString) + } + _spec.Node.Schema = ihu.schemaConfig.IntegrationHistory + ctx = internal.NewSchemaConfigContext(ctx, ihu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ihu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{integrationhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ihu.mutation.done = true + return n, nil +} + +// IntegrationHistoryUpdateOne is the builder for updating a single IntegrationHistory entity. +type IntegrationHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *IntegrationHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ihuo *IntegrationHistoryUpdateOne) SetUpdatedAt(t time.Time) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetUpdatedAt(t) + return ihuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearUpdatedAt() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearUpdatedAt() + return ihuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ihuo *IntegrationHistoryUpdateOne) SetUpdatedBy(s string) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetUpdatedBy(s) + return ihuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ihuo *IntegrationHistoryUpdateOne) SetNillableUpdatedBy(s *string) *IntegrationHistoryUpdateOne { + if s != nil { + ihuo.SetUpdatedBy(*s) + } + return ihuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearUpdatedBy() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearUpdatedBy() + return ihuo +} + +// SetTags sets the "tags" field. +func (ihuo *IntegrationHistoryUpdateOne) SetTags(s []string) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetTags(s) + return ihuo +} + +// AppendTags appends s to the "tags" field. +func (ihuo *IntegrationHistoryUpdateOne) AppendTags(s []string) *IntegrationHistoryUpdateOne { + ihuo.mutation.AppendTags(s) + return ihuo +} + +// ClearTags clears the value of the "tags" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearTags() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearTags() + return ihuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ihuo *IntegrationHistoryUpdateOne) SetDeletedAt(t time.Time) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetDeletedAt(t) + return ihuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ihuo *IntegrationHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *IntegrationHistoryUpdateOne { + if t != nil { + ihuo.SetDeletedAt(*t) + } + return ihuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearDeletedAt() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearDeletedAt() + return ihuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ihuo *IntegrationHistoryUpdateOne) SetDeletedBy(s string) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetDeletedBy(s) + return ihuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ihuo *IntegrationHistoryUpdateOne) SetNillableDeletedBy(s *string) *IntegrationHistoryUpdateOne { + if s != nil { + ihuo.SetDeletedBy(*s) + } + return ihuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearDeletedBy() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearDeletedBy() + return ihuo +} + +// SetOwnerID sets the "owner_id" field. +func (ihuo *IntegrationHistoryUpdateOne) SetOwnerID(s string) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetOwnerID(s) + return ihuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ihuo *IntegrationHistoryUpdateOne) SetNillableOwnerID(s *string) *IntegrationHistoryUpdateOne { + if s != nil { + ihuo.SetOwnerID(*s) + } + return ihuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearOwnerID() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearOwnerID() + return ihuo +} + +// SetName sets the "name" field. +func (ihuo *IntegrationHistoryUpdateOne) SetName(s string) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetName(s) + return ihuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ihuo *IntegrationHistoryUpdateOne) SetNillableName(s *string) *IntegrationHistoryUpdateOne { + if s != nil { + ihuo.SetName(*s) + } + return ihuo +} + +// SetDescription sets the "description" field. +func (ihuo *IntegrationHistoryUpdateOne) SetDescription(s string) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetDescription(s) + return ihuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ihuo *IntegrationHistoryUpdateOne) SetNillableDescription(s *string) *IntegrationHistoryUpdateOne { + if s != nil { + ihuo.SetDescription(*s) + } + return ihuo +} + +// ClearDescription clears the value of the "description" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearDescription() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearDescription() + return ihuo +} + +// SetKind sets the "kind" field. +func (ihuo *IntegrationHistoryUpdateOne) SetKind(s string) *IntegrationHistoryUpdateOne { + ihuo.mutation.SetKind(s) + return ihuo +} + +// SetNillableKind sets the "kind" field if the given value is not nil. +func (ihuo *IntegrationHistoryUpdateOne) SetNillableKind(s *string) *IntegrationHistoryUpdateOne { + if s != nil { + ihuo.SetKind(*s) + } + return ihuo +} + +// ClearKind clears the value of the "kind" field. +func (ihuo *IntegrationHistoryUpdateOne) ClearKind() *IntegrationHistoryUpdateOne { + ihuo.mutation.ClearKind() + return ihuo +} + +// Mutation returns the IntegrationHistoryMutation object of the builder. +func (ihuo *IntegrationHistoryUpdateOne) Mutation() *IntegrationHistoryMutation { + return ihuo.mutation +} + +// Where appends a list predicates to the IntegrationHistoryUpdate builder. +func (ihuo *IntegrationHistoryUpdateOne) Where(ps ...predicate.IntegrationHistory) *IntegrationHistoryUpdateOne { + ihuo.mutation.Where(ps...) + return ihuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ihuo *IntegrationHistoryUpdateOne) Select(field string, fields ...string) *IntegrationHistoryUpdateOne { + ihuo.fields = append([]string{field}, fields...) + return ihuo +} + +// Save executes the query and returns the updated IntegrationHistory entity. +func (ihuo *IntegrationHistoryUpdateOne) Save(ctx context.Context) (*IntegrationHistory, error) { + if err := ihuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ihuo.sqlSave, ihuo.mutation, ihuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ihuo *IntegrationHistoryUpdateOne) SaveX(ctx context.Context) *IntegrationHistory { + node, err := ihuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ihuo *IntegrationHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ihuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ihuo *IntegrationHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ihuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ihuo *IntegrationHistoryUpdateOne) defaults() error { + if _, ok := ihuo.mutation.UpdatedAt(); !ok && !ihuo.mutation.UpdatedAtCleared() { + if integrationhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized integrationhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := integrationhistory.UpdateDefaultUpdatedAt() + ihuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ihuo *IntegrationHistoryUpdateOne) sqlSave(ctx context.Context) (_node *IntegrationHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(integrationhistory.Table, integrationhistory.Columns, sqlgraph.NewFieldSpec(integrationhistory.FieldID, field.TypeString)) + id, ok := ihuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "IntegrationHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ihuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, integrationhistory.FieldID) + for _, f := range fields { + if !integrationhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != integrationhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ihuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ihuo.mutation.RefCleared() { + _spec.ClearField(integrationhistory.FieldRef, field.TypeString) + } + if ihuo.mutation.CreatedAtCleared() { + _spec.ClearField(integrationhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ihuo.mutation.UpdatedAt(); ok { + _spec.SetField(integrationhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ihuo.mutation.UpdatedAtCleared() { + _spec.ClearField(integrationhistory.FieldUpdatedAt, field.TypeTime) + } + if ihuo.mutation.CreatedByCleared() { + _spec.ClearField(integrationhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ihuo.mutation.UpdatedBy(); ok { + _spec.SetField(integrationhistory.FieldUpdatedBy, field.TypeString, value) + } + if ihuo.mutation.UpdatedByCleared() { + _spec.ClearField(integrationhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ihuo.mutation.Tags(); ok { + _spec.SetField(integrationhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ihuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, integrationhistory.FieldTags, value) + }) + } + if ihuo.mutation.TagsCleared() { + _spec.ClearField(integrationhistory.FieldTags, field.TypeJSON) + } + if value, ok := ihuo.mutation.DeletedAt(); ok { + _spec.SetField(integrationhistory.FieldDeletedAt, field.TypeTime, value) + } + if ihuo.mutation.DeletedAtCleared() { + _spec.ClearField(integrationhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ihuo.mutation.DeletedBy(); ok { + _spec.SetField(integrationhistory.FieldDeletedBy, field.TypeString, value) + } + if ihuo.mutation.DeletedByCleared() { + _spec.ClearField(integrationhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ihuo.mutation.OwnerID(); ok { + _spec.SetField(integrationhistory.FieldOwnerID, field.TypeString, value) + } + if ihuo.mutation.OwnerIDCleared() { + _spec.ClearField(integrationhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ihuo.mutation.Name(); ok { + _spec.SetField(integrationhistory.FieldName, field.TypeString, value) + } + if value, ok := ihuo.mutation.Description(); ok { + _spec.SetField(integrationhistory.FieldDescription, field.TypeString, value) + } + if ihuo.mutation.DescriptionCleared() { + _spec.ClearField(integrationhistory.FieldDescription, field.TypeString) + } + if value, ok := ihuo.mutation.Kind(); ok { + _spec.SetField(integrationhistory.FieldKind, field.TypeString, value) + } + if ihuo.mutation.KindCleared() { + _spec.ClearField(integrationhistory.FieldKind, field.TypeString) + } + _spec.Node.Schema = ihuo.schemaConfig.IntegrationHistory + ctx = internal.NewSchemaConfigContext(ctx, ihuo.schemaConfig) + _node = &IntegrationHistory{config: ihuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ihuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{integrationhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ihuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/intercept/intercept.go b/internal/ent/generated/intercept/intercept.go new file mode 100644 index 0000000..4ea06f5 --- /dev/null +++ b/internal/ent/generated/intercept/intercept.go @@ -0,0 +1,1829 @@ +// Code generated by ent, DO NOT EDIT. + +package intercept + +import ( + "context" + "fmt" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" +) + +// The Query interface represents an operation that queries a graph. +// By using this interface, users can write generic code that manipulates +// query builders of different types. +type Query interface { + // Type returns the string representation of the query type. + Type() string + // Limit the number of records to be returned by this query. + Limit(int) + // Offset to start from. + Offset(int) + // Unique configures the query builder to filter duplicate records. + Unique(bool) + // Order specifies how the records should be ordered. + Order(...func(*sql.Selector)) + // WhereP appends storage-level predicates to the query builder. Using this method, users + // can use type-assertion to append predicates that do not depend on any generated package. + WhereP(...func(*sql.Selector)) +} + +// The Func type is an adapter that allows ordinary functions to be used as interceptors. +// Unlike traversal functions, interceptors are skipped during graph traversals. Note that the +// implementation of Func is different from the one defined in entgo.io/ent.InterceptFunc. +type Func func(context.Context, Query) error + +// Intercept calls f(ctx, q) and then applied the next Querier. +func (f Func) Intercept(next generated.Querier) generated.Querier { + return generated.QuerierFunc(func(ctx context.Context, q generated.Query) (generated.Value, error) { + query, err := NewQuery(q) + if err != nil { + return nil, err + } + if err := f(ctx, query); err != nil { + return nil, err + } + return next.Query(ctx, q) + }) +} + +// The TraverseFunc type is an adapter to allow the use of ordinary function as Traverser. +// If f is a function with the appropriate signature, TraverseFunc(f) is a Traverser that calls f. +type TraverseFunc func(context.Context, Query) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseFunc) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseFunc) Traverse(ctx context.Context, q generated.Query) error { + query, err := NewQuery(q) + if err != nil { + return err + } + return f(ctx, query) +} + +// The APITokenFunc type is an adapter to allow the use of ordinary function as a Querier. +type APITokenFunc func(context.Context, *generated.APITokenQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f APITokenFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.APITokenQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.APITokenQuery", q) +} + +// The TraverseAPIToken type is an adapter to allow the use of ordinary function as Traverser. +type TraverseAPIToken func(context.Context, *generated.APITokenQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseAPIToken) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseAPIToken) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.APITokenQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.APITokenQuery", q) +} + +// The ContactFunc type is an adapter to allow the use of ordinary function as a Querier. +type ContactFunc func(context.Context, *generated.ContactQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f ContactFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.ContactQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.ContactQuery", q) +} + +// The TraverseContact type is an adapter to allow the use of ordinary function as Traverser. +type TraverseContact func(context.Context, *generated.ContactQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseContact) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseContact) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.ContactQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.ContactQuery", q) +} + +// The ContactHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type ContactHistoryFunc func(context.Context, *generated.ContactHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f ContactHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.ContactHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.ContactHistoryQuery", q) +} + +// The TraverseContactHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseContactHistory func(context.Context, *generated.ContactHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseContactHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseContactHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.ContactHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.ContactHistoryQuery", q) +} + +// The DocumentDataFunc type is an adapter to allow the use of ordinary function as a Querier. +type DocumentDataFunc func(context.Context, *generated.DocumentDataQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f DocumentDataFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.DocumentDataQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.DocumentDataQuery", q) +} + +// The TraverseDocumentData type is an adapter to allow the use of ordinary function as Traverser. +type TraverseDocumentData func(context.Context, *generated.DocumentDataQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseDocumentData) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseDocumentData) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.DocumentDataQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.DocumentDataQuery", q) +} + +// The DocumentDataHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type DocumentDataHistoryFunc func(context.Context, *generated.DocumentDataHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f DocumentDataHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.DocumentDataHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.DocumentDataHistoryQuery", q) +} + +// The TraverseDocumentDataHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseDocumentDataHistory func(context.Context, *generated.DocumentDataHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseDocumentDataHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseDocumentDataHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.DocumentDataHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.DocumentDataHistoryQuery", q) +} + +// The EmailVerificationTokenFunc type is an adapter to allow the use of ordinary function as a Querier. +type EmailVerificationTokenFunc func(context.Context, *generated.EmailVerificationTokenQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EmailVerificationTokenFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EmailVerificationTokenQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EmailVerificationTokenQuery", q) +} + +// The TraverseEmailVerificationToken type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEmailVerificationToken func(context.Context, *generated.EmailVerificationTokenQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEmailVerificationToken) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEmailVerificationToken) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EmailVerificationTokenQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EmailVerificationTokenQuery", q) +} + +// The EntitlementFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntitlementFunc func(context.Context, *generated.EntitlementQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntitlementFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntitlementQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntitlementQuery", q) +} + +// The TraverseEntitlement type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntitlement func(context.Context, *generated.EntitlementQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntitlement) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntitlement) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntitlementQuery", q) +} + +// The EntitlementHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntitlementHistoryFunc func(context.Context, *generated.EntitlementHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntitlementHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntitlementHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntitlementHistoryQuery", q) +} + +// The TraverseEntitlementHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntitlementHistory func(context.Context, *generated.EntitlementHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntitlementHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntitlementHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntitlementHistoryQuery", q) +} + +// The EntitlementPlanFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntitlementPlanFunc func(context.Context, *generated.EntitlementPlanQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntitlementPlanFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntitlementPlanQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanQuery", q) +} + +// The TraverseEntitlementPlan type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntitlementPlan func(context.Context, *generated.EntitlementPlanQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntitlementPlan) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntitlementPlan) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanQuery", q) +} + +// The EntitlementPlanFeatureFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntitlementPlanFeatureFunc func(context.Context, *generated.EntitlementPlanFeatureQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntitlementPlanFeatureFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntitlementPlanFeatureQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanFeatureQuery", q) +} + +// The TraverseEntitlementPlanFeature type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntitlementPlanFeature func(context.Context, *generated.EntitlementPlanFeatureQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntitlementPlanFeature) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntitlementPlanFeature) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanFeatureQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanFeatureQuery", q) +} + +// The EntitlementPlanFeatureHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntitlementPlanFeatureHistoryFunc func(context.Context, *generated.EntitlementPlanFeatureHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntitlementPlanFeatureHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntitlementPlanFeatureHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanFeatureHistoryQuery", q) +} + +// The TraverseEntitlementPlanFeatureHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntitlementPlanFeatureHistory func(context.Context, *generated.EntitlementPlanFeatureHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntitlementPlanFeatureHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntitlementPlanFeatureHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanFeatureHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanFeatureHistoryQuery", q) +} + +// The EntitlementPlanHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntitlementPlanHistoryFunc func(context.Context, *generated.EntitlementPlanHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntitlementPlanHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntitlementPlanHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanHistoryQuery", q) +} + +// The TraverseEntitlementPlanHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntitlementPlanHistory func(context.Context, *generated.EntitlementPlanHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntitlementPlanHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntitlementPlanHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntitlementPlanHistoryQuery", q) +} + +// The EntityFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntityFunc func(context.Context, *generated.EntityQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntityFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntityQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntityQuery", q) +} + +// The TraverseEntity type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntity func(context.Context, *generated.EntityQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntity) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntity) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntityQuery", q) +} + +// The EntityHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntityHistoryFunc func(context.Context, *generated.EntityHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntityHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntityHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntityHistoryQuery", q) +} + +// The TraverseEntityHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntityHistory func(context.Context, *generated.EntityHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntityHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntityHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntityHistoryQuery", q) +} + +// The EntityTypeFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntityTypeFunc func(context.Context, *generated.EntityTypeQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntityTypeFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntityTypeQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntityTypeQuery", q) +} + +// The TraverseEntityType type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntityType func(context.Context, *generated.EntityTypeQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntityType) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntityType) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityTypeQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntityTypeQuery", q) +} + +// The EntityTypeHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type EntityTypeHistoryFunc func(context.Context, *generated.EntityTypeHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EntityTypeHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EntityTypeHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EntityTypeHistoryQuery", q) +} + +// The TraverseEntityTypeHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEntityTypeHistory func(context.Context, *generated.EntityTypeHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEntityTypeHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEntityTypeHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityTypeHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EntityTypeHistoryQuery", q) +} + +// The EventFunc type is an adapter to allow the use of ordinary function as a Querier. +type EventFunc func(context.Context, *generated.EventQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EventFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EventQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EventQuery", q) +} + +// The TraverseEvent type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEvent func(context.Context, *generated.EventQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEvent) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEvent) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EventQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EventQuery", q) +} + +// The EventHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type EventHistoryFunc func(context.Context, *generated.EventHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f EventHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.EventHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.EventHistoryQuery", q) +} + +// The TraverseEventHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseEventHistory func(context.Context, *generated.EventHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseEventHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseEventHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EventHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.EventHistoryQuery", q) +} + +// The FeatureFunc type is an adapter to allow the use of ordinary function as a Querier. +type FeatureFunc func(context.Context, *generated.FeatureQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f FeatureFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.FeatureQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.FeatureQuery", q) +} + +// The TraverseFeature type is an adapter to allow the use of ordinary function as Traverser. +type TraverseFeature func(context.Context, *generated.FeatureQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseFeature) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseFeature) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FeatureQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.FeatureQuery", q) +} + +// The FeatureHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type FeatureHistoryFunc func(context.Context, *generated.FeatureHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f FeatureHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.FeatureHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.FeatureHistoryQuery", q) +} + +// The TraverseFeatureHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseFeatureHistory func(context.Context, *generated.FeatureHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseFeatureHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseFeatureHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FeatureHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.FeatureHistoryQuery", q) +} + +// The FileFunc type is an adapter to allow the use of ordinary function as a Querier. +type FileFunc func(context.Context, *generated.FileQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f FileFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.FileQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.FileQuery", q) +} + +// The TraverseFile type is an adapter to allow the use of ordinary function as Traverser. +type TraverseFile func(context.Context, *generated.FileQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseFile) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseFile) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FileQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.FileQuery", q) +} + +// The FileHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type FileHistoryFunc func(context.Context, *generated.FileHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f FileHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.FileHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.FileHistoryQuery", q) +} + +// The TraverseFileHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseFileHistory func(context.Context, *generated.FileHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseFileHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseFileHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FileHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.FileHistoryQuery", q) +} + +// The GroupFunc type is an adapter to allow the use of ordinary function as a Querier. +type GroupFunc func(context.Context, *generated.GroupQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f GroupFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.GroupQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.GroupQuery", q) +} + +// The TraverseGroup type is an adapter to allow the use of ordinary function as Traverser. +type TraverseGroup func(context.Context, *generated.GroupQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseGroup) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseGroup) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.GroupQuery", q) +} + +// The GroupHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type GroupHistoryFunc func(context.Context, *generated.GroupHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f GroupHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.GroupHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.GroupHistoryQuery", q) +} + +// The TraverseGroupHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseGroupHistory func(context.Context, *generated.GroupHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseGroupHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseGroupHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.GroupHistoryQuery", q) +} + +// The GroupMembershipFunc type is an adapter to allow the use of ordinary function as a Querier. +type GroupMembershipFunc func(context.Context, *generated.GroupMembershipQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f GroupMembershipFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.GroupMembershipQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.GroupMembershipQuery", q) +} + +// The TraverseGroupMembership type is an adapter to allow the use of ordinary function as Traverser. +type TraverseGroupMembership func(context.Context, *generated.GroupMembershipQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseGroupMembership) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseGroupMembership) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupMembershipQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.GroupMembershipQuery", q) +} + +// The GroupMembershipHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type GroupMembershipHistoryFunc func(context.Context, *generated.GroupMembershipHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f GroupMembershipHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.GroupMembershipHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.GroupMembershipHistoryQuery", q) +} + +// The TraverseGroupMembershipHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseGroupMembershipHistory func(context.Context, *generated.GroupMembershipHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseGroupMembershipHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseGroupMembershipHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupMembershipHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.GroupMembershipHistoryQuery", q) +} + +// The GroupSettingFunc type is an adapter to allow the use of ordinary function as a Querier. +type GroupSettingFunc func(context.Context, *generated.GroupSettingQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f GroupSettingFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.GroupSettingQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.GroupSettingQuery", q) +} + +// The TraverseGroupSetting type is an adapter to allow the use of ordinary function as Traverser. +type TraverseGroupSetting func(context.Context, *generated.GroupSettingQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseGroupSetting) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseGroupSetting) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupSettingQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.GroupSettingQuery", q) +} + +// The GroupSettingHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type GroupSettingHistoryFunc func(context.Context, *generated.GroupSettingHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f GroupSettingHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.GroupSettingHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.GroupSettingHistoryQuery", q) +} + +// The TraverseGroupSettingHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseGroupSettingHistory func(context.Context, *generated.GroupSettingHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseGroupSettingHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseGroupSettingHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupSettingHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.GroupSettingHistoryQuery", q) +} + +// The HushFunc type is an adapter to allow the use of ordinary function as a Querier. +type HushFunc func(context.Context, *generated.HushQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f HushFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.HushQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.HushQuery", q) +} + +// The TraverseHush type is an adapter to allow the use of ordinary function as Traverser. +type TraverseHush func(context.Context, *generated.HushQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseHush) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseHush) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.HushQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.HushQuery", q) +} + +// The HushHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type HushHistoryFunc func(context.Context, *generated.HushHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f HushHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.HushHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.HushHistoryQuery", q) +} + +// The TraverseHushHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseHushHistory func(context.Context, *generated.HushHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseHushHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseHushHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.HushHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.HushHistoryQuery", q) +} + +// The IntegrationFunc type is an adapter to allow the use of ordinary function as a Querier. +type IntegrationFunc func(context.Context, *generated.IntegrationQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f IntegrationFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.IntegrationQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.IntegrationQuery", q) +} + +// The TraverseIntegration type is an adapter to allow the use of ordinary function as Traverser. +type TraverseIntegration func(context.Context, *generated.IntegrationQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseIntegration) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseIntegration) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.IntegrationQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.IntegrationQuery", q) +} + +// The IntegrationHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type IntegrationHistoryFunc func(context.Context, *generated.IntegrationHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f IntegrationHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.IntegrationHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.IntegrationHistoryQuery", q) +} + +// The TraverseIntegrationHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseIntegrationHistory func(context.Context, *generated.IntegrationHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseIntegrationHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseIntegrationHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.IntegrationHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.IntegrationHistoryQuery", q) +} + +// The InviteFunc type is an adapter to allow the use of ordinary function as a Querier. +type InviteFunc func(context.Context, *generated.InviteQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f InviteFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.InviteQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.InviteQuery", q) +} + +// The TraverseInvite type is an adapter to allow the use of ordinary function as Traverser. +type TraverseInvite func(context.Context, *generated.InviteQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseInvite) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseInvite) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.InviteQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.InviteQuery", q) +} + +// The NoteFunc type is an adapter to allow the use of ordinary function as a Querier. +type NoteFunc func(context.Context, *generated.NoteQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f NoteFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.NoteQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.NoteQuery", q) +} + +// The TraverseNote type is an adapter to allow the use of ordinary function as Traverser. +type TraverseNote func(context.Context, *generated.NoteQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseNote) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseNote) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.NoteQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.NoteQuery", q) +} + +// The NoteHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type NoteHistoryFunc func(context.Context, *generated.NoteHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f NoteHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.NoteHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.NoteHistoryQuery", q) +} + +// The TraverseNoteHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseNoteHistory func(context.Context, *generated.NoteHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseNoteHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseNoteHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.NoteHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.NoteHistoryQuery", q) +} + +// The OauthProviderFunc type is an adapter to allow the use of ordinary function as a Querier. +type OauthProviderFunc func(context.Context, *generated.OauthProviderQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OauthProviderFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OauthProviderQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OauthProviderQuery", q) +} + +// The TraverseOauthProvider type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOauthProvider func(context.Context, *generated.OauthProviderQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOauthProvider) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOauthProvider) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OauthProviderQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OauthProviderQuery", q) +} + +// The OauthProviderHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type OauthProviderHistoryFunc func(context.Context, *generated.OauthProviderHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OauthProviderHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OauthProviderHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OauthProviderHistoryQuery", q) +} + +// The TraverseOauthProviderHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOauthProviderHistory func(context.Context, *generated.OauthProviderHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOauthProviderHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOauthProviderHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OauthProviderHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OauthProviderHistoryQuery", q) +} + +// The OhAuthTooTokenFunc type is an adapter to allow the use of ordinary function as a Querier. +type OhAuthTooTokenFunc func(context.Context, *generated.OhAuthTooTokenQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OhAuthTooTokenFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OhAuthTooTokenQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OhAuthTooTokenQuery", q) +} + +// The TraverseOhAuthTooToken type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOhAuthTooToken func(context.Context, *generated.OhAuthTooTokenQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOhAuthTooToken) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOhAuthTooToken) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OhAuthTooTokenQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OhAuthTooTokenQuery", q) +} + +// The OrgMembershipFunc type is an adapter to allow the use of ordinary function as a Querier. +type OrgMembershipFunc func(context.Context, *generated.OrgMembershipQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OrgMembershipFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OrgMembershipQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OrgMembershipQuery", q) +} + +// The TraverseOrgMembership type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOrgMembership func(context.Context, *generated.OrgMembershipQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOrgMembership) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOrgMembership) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrgMembershipQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OrgMembershipQuery", q) +} + +// The OrgMembershipHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type OrgMembershipHistoryFunc func(context.Context, *generated.OrgMembershipHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OrgMembershipHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OrgMembershipHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OrgMembershipHistoryQuery", q) +} + +// The TraverseOrgMembershipHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOrgMembershipHistory func(context.Context, *generated.OrgMembershipHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOrgMembershipHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOrgMembershipHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrgMembershipHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OrgMembershipHistoryQuery", q) +} + +// The OrganizationFunc type is an adapter to allow the use of ordinary function as a Querier. +type OrganizationFunc func(context.Context, *generated.OrganizationQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OrganizationFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OrganizationQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OrganizationQuery", q) +} + +// The TraverseOrganization type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOrganization func(context.Context, *generated.OrganizationQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOrganization) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOrganization) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OrganizationQuery", q) +} + +// The OrganizationHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type OrganizationHistoryFunc func(context.Context, *generated.OrganizationHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OrganizationHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OrganizationHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OrganizationHistoryQuery", q) +} + +// The TraverseOrganizationHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOrganizationHistory func(context.Context, *generated.OrganizationHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOrganizationHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOrganizationHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OrganizationHistoryQuery", q) +} + +// The OrganizationSettingFunc type is an adapter to allow the use of ordinary function as a Querier. +type OrganizationSettingFunc func(context.Context, *generated.OrganizationSettingQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OrganizationSettingFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OrganizationSettingQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OrganizationSettingQuery", q) +} + +// The TraverseOrganizationSetting type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOrganizationSetting func(context.Context, *generated.OrganizationSettingQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOrganizationSetting) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOrganizationSetting) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationSettingQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OrganizationSettingQuery", q) +} + +// The OrganizationSettingHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type OrganizationSettingHistoryFunc func(context.Context, *generated.OrganizationSettingHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f OrganizationSettingHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.OrganizationSettingHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.OrganizationSettingHistoryQuery", q) +} + +// The TraverseOrganizationSettingHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseOrganizationSettingHistory func(context.Context, *generated.OrganizationSettingHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseOrganizationSettingHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseOrganizationSettingHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationSettingHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.OrganizationSettingHistoryQuery", q) +} + +// The PasswordResetTokenFunc type is an adapter to allow the use of ordinary function as a Querier. +type PasswordResetTokenFunc func(context.Context, *generated.PasswordResetTokenQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f PasswordResetTokenFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.PasswordResetTokenQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.PasswordResetTokenQuery", q) +} + +// The TraversePasswordResetToken type is an adapter to allow the use of ordinary function as Traverser. +type TraversePasswordResetToken func(context.Context, *generated.PasswordResetTokenQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraversePasswordResetToken) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraversePasswordResetToken) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.PasswordResetTokenQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.PasswordResetTokenQuery", q) +} + +// The PersonalAccessTokenFunc type is an adapter to allow the use of ordinary function as a Querier. +type PersonalAccessTokenFunc func(context.Context, *generated.PersonalAccessTokenQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f PersonalAccessTokenFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.PersonalAccessTokenQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.PersonalAccessTokenQuery", q) +} + +// The TraversePersonalAccessToken type is an adapter to allow the use of ordinary function as Traverser. +type TraversePersonalAccessToken func(context.Context, *generated.PersonalAccessTokenQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraversePersonalAccessToken) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraversePersonalAccessToken) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.PersonalAccessTokenQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.PersonalAccessTokenQuery", q) +} + +// The SubscriberFunc type is an adapter to allow the use of ordinary function as a Querier. +type SubscriberFunc func(context.Context, *generated.SubscriberQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f SubscriberFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.SubscriberQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.SubscriberQuery", q) +} + +// The TraverseSubscriber type is an adapter to allow the use of ordinary function as Traverser. +type TraverseSubscriber func(context.Context, *generated.SubscriberQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseSubscriber) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseSubscriber) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.SubscriberQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.SubscriberQuery", q) +} + +// The TFASettingFunc type is an adapter to allow the use of ordinary function as a Querier. +type TFASettingFunc func(context.Context, *generated.TFASettingQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f TFASettingFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.TFASettingQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.TFASettingQuery", q) +} + +// The TraverseTFASetting type is an adapter to allow the use of ordinary function as Traverser. +type TraverseTFASetting func(context.Context, *generated.TFASettingQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseTFASetting) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseTFASetting) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.TFASettingQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.TFASettingQuery", q) +} + +// The TemplateFunc type is an adapter to allow the use of ordinary function as a Querier. +type TemplateFunc func(context.Context, *generated.TemplateQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f TemplateFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.TemplateQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.TemplateQuery", q) +} + +// The TraverseTemplate type is an adapter to allow the use of ordinary function as Traverser. +type TraverseTemplate func(context.Context, *generated.TemplateQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseTemplate) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseTemplate) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.TemplateQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.TemplateQuery", q) +} + +// The TemplateHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type TemplateHistoryFunc func(context.Context, *generated.TemplateHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f TemplateHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.TemplateHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.TemplateHistoryQuery", q) +} + +// The TraverseTemplateHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseTemplateHistory func(context.Context, *generated.TemplateHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseTemplateHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseTemplateHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.TemplateHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.TemplateHistoryQuery", q) +} + +// The UserFunc type is an adapter to allow the use of ordinary function as a Querier. +type UserFunc func(context.Context, *generated.UserQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f UserFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.UserQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.UserQuery", q) +} + +// The TraverseUser type is an adapter to allow the use of ordinary function as Traverser. +type TraverseUser func(context.Context, *generated.UserQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseUser) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseUser) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.UserQuery", q) +} + +// The UserHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type UserHistoryFunc func(context.Context, *generated.UserHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f UserHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.UserHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.UserHistoryQuery", q) +} + +// The TraverseUserHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseUserHistory func(context.Context, *generated.UserHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseUserHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseUserHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.UserHistoryQuery", q) +} + +// The UserSettingFunc type is an adapter to allow the use of ordinary function as a Querier. +type UserSettingFunc func(context.Context, *generated.UserSettingQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f UserSettingFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.UserSettingQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.UserSettingQuery", q) +} + +// The TraverseUserSetting type is an adapter to allow the use of ordinary function as Traverser. +type TraverseUserSetting func(context.Context, *generated.UserSettingQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseUserSetting) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseUserSetting) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserSettingQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.UserSettingQuery", q) +} + +// The UserSettingHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type UserSettingHistoryFunc func(context.Context, *generated.UserSettingHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f UserSettingHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.UserSettingHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.UserSettingHistoryQuery", q) +} + +// The TraverseUserSettingHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseUserSettingHistory func(context.Context, *generated.UserSettingHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseUserSettingHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseUserSettingHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserSettingHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.UserSettingHistoryQuery", q) +} + +// The WebauthnFunc type is an adapter to allow the use of ordinary function as a Querier. +type WebauthnFunc func(context.Context, *generated.WebauthnQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f WebauthnFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.WebauthnQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.WebauthnQuery", q) +} + +// The TraverseWebauthn type is an adapter to allow the use of ordinary function as Traverser. +type TraverseWebauthn func(context.Context, *generated.WebauthnQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseWebauthn) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseWebauthn) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.WebauthnQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.WebauthnQuery", q) +} + +// The WebhookFunc type is an adapter to allow the use of ordinary function as a Querier. +type WebhookFunc func(context.Context, *generated.WebhookQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f WebhookFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.WebhookQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.WebhookQuery", q) +} + +// The TraverseWebhook type is an adapter to allow the use of ordinary function as Traverser. +type TraverseWebhook func(context.Context, *generated.WebhookQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseWebhook) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseWebhook) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.WebhookQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.WebhookQuery", q) +} + +// The WebhookHistoryFunc type is an adapter to allow the use of ordinary function as a Querier. +type WebhookHistoryFunc func(context.Context, *generated.WebhookHistoryQuery) (generated.Value, error) + +// Query calls f(ctx, q). +func (f WebhookHistoryFunc) Query(ctx context.Context, q generated.Query) (generated.Value, error) { + if q, ok := q.(*generated.WebhookHistoryQuery); ok { + return f(ctx, q) + } + return nil, fmt.Errorf("unexpected query type %T. expect *generated.WebhookHistoryQuery", q) +} + +// The TraverseWebhookHistory type is an adapter to allow the use of ordinary function as Traverser. +type TraverseWebhookHistory func(context.Context, *generated.WebhookHistoryQuery) error + +// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline. +func (f TraverseWebhookHistory) Intercept(next generated.Querier) generated.Querier { + return next +} + +// Traverse calls f(ctx, q). +func (f TraverseWebhookHistory) Traverse(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.WebhookHistoryQuery); ok { + return f(ctx, q) + } + return fmt.Errorf("unexpected query type %T. expect *generated.WebhookHistoryQuery", q) +} + +// NewQuery returns the generic Query interface for the given typed query. +func NewQuery(q generated.Query) (Query, error) { + switch q := q.(type) { + case *generated.APITokenQuery: + return &query[*generated.APITokenQuery, predicate.APIToken, apitoken.OrderOption]{typ: generated.TypeAPIToken, tq: q}, nil + case *generated.ContactQuery: + return &query[*generated.ContactQuery, predicate.Contact, contact.OrderOption]{typ: generated.TypeContact, tq: q}, nil + case *generated.ContactHistoryQuery: + return &query[*generated.ContactHistoryQuery, predicate.ContactHistory, contacthistory.OrderOption]{typ: generated.TypeContactHistory, tq: q}, nil + case *generated.DocumentDataQuery: + return &query[*generated.DocumentDataQuery, predicate.DocumentData, documentdata.OrderOption]{typ: generated.TypeDocumentData, tq: q}, nil + case *generated.DocumentDataHistoryQuery: + return &query[*generated.DocumentDataHistoryQuery, predicate.DocumentDataHistory, documentdatahistory.OrderOption]{typ: generated.TypeDocumentDataHistory, tq: q}, nil + case *generated.EmailVerificationTokenQuery: + return &query[*generated.EmailVerificationTokenQuery, predicate.EmailVerificationToken, emailverificationtoken.OrderOption]{typ: generated.TypeEmailVerificationToken, tq: q}, nil + case *generated.EntitlementQuery: + return &query[*generated.EntitlementQuery, predicate.Entitlement, entitlement.OrderOption]{typ: generated.TypeEntitlement, tq: q}, nil + case *generated.EntitlementHistoryQuery: + return &query[*generated.EntitlementHistoryQuery, predicate.EntitlementHistory, entitlementhistory.OrderOption]{typ: generated.TypeEntitlementHistory, tq: q}, nil + case *generated.EntitlementPlanQuery: + return &query[*generated.EntitlementPlanQuery, predicate.EntitlementPlan, entitlementplan.OrderOption]{typ: generated.TypeEntitlementPlan, tq: q}, nil + case *generated.EntitlementPlanFeatureQuery: + return &query[*generated.EntitlementPlanFeatureQuery, predicate.EntitlementPlanFeature, entitlementplanfeature.OrderOption]{typ: generated.TypeEntitlementPlanFeature, tq: q}, nil + case *generated.EntitlementPlanFeatureHistoryQuery: + return &query[*generated.EntitlementPlanFeatureHistoryQuery, predicate.EntitlementPlanFeatureHistory, entitlementplanfeaturehistory.OrderOption]{typ: generated.TypeEntitlementPlanFeatureHistory, tq: q}, nil + case *generated.EntitlementPlanHistoryQuery: + return &query[*generated.EntitlementPlanHistoryQuery, predicate.EntitlementPlanHistory, entitlementplanhistory.OrderOption]{typ: generated.TypeEntitlementPlanHistory, tq: q}, nil + case *generated.EntityQuery: + return &query[*generated.EntityQuery, predicate.Entity, entity.OrderOption]{typ: generated.TypeEntity, tq: q}, nil + case *generated.EntityHistoryQuery: + return &query[*generated.EntityHistoryQuery, predicate.EntityHistory, entityhistory.OrderOption]{typ: generated.TypeEntityHistory, tq: q}, nil + case *generated.EntityTypeQuery: + return &query[*generated.EntityTypeQuery, predicate.EntityType, entitytype.OrderOption]{typ: generated.TypeEntityType, tq: q}, nil + case *generated.EntityTypeHistoryQuery: + return &query[*generated.EntityTypeHistoryQuery, predicate.EntityTypeHistory, entitytypehistory.OrderOption]{typ: generated.TypeEntityTypeHistory, tq: q}, nil + case *generated.EventQuery: + return &query[*generated.EventQuery, predicate.Event, event.OrderOption]{typ: generated.TypeEvent, tq: q}, nil + case *generated.EventHistoryQuery: + return &query[*generated.EventHistoryQuery, predicate.EventHistory, eventhistory.OrderOption]{typ: generated.TypeEventHistory, tq: q}, nil + case *generated.FeatureQuery: + return &query[*generated.FeatureQuery, predicate.Feature, feature.OrderOption]{typ: generated.TypeFeature, tq: q}, nil + case *generated.FeatureHistoryQuery: + return &query[*generated.FeatureHistoryQuery, predicate.FeatureHistory, featurehistory.OrderOption]{typ: generated.TypeFeatureHistory, tq: q}, nil + case *generated.FileQuery: + return &query[*generated.FileQuery, predicate.File, file.OrderOption]{typ: generated.TypeFile, tq: q}, nil + case *generated.FileHistoryQuery: + return &query[*generated.FileHistoryQuery, predicate.FileHistory, filehistory.OrderOption]{typ: generated.TypeFileHistory, tq: q}, nil + case *generated.GroupQuery: + return &query[*generated.GroupQuery, predicate.Group, group.OrderOption]{typ: generated.TypeGroup, tq: q}, nil + case *generated.GroupHistoryQuery: + return &query[*generated.GroupHistoryQuery, predicate.GroupHistory, grouphistory.OrderOption]{typ: generated.TypeGroupHistory, tq: q}, nil + case *generated.GroupMembershipQuery: + return &query[*generated.GroupMembershipQuery, predicate.GroupMembership, groupmembership.OrderOption]{typ: generated.TypeGroupMembership, tq: q}, nil + case *generated.GroupMembershipHistoryQuery: + return &query[*generated.GroupMembershipHistoryQuery, predicate.GroupMembershipHistory, groupmembershiphistory.OrderOption]{typ: generated.TypeGroupMembershipHistory, tq: q}, nil + case *generated.GroupSettingQuery: + return &query[*generated.GroupSettingQuery, predicate.GroupSetting, groupsetting.OrderOption]{typ: generated.TypeGroupSetting, tq: q}, nil + case *generated.GroupSettingHistoryQuery: + return &query[*generated.GroupSettingHistoryQuery, predicate.GroupSettingHistory, groupsettinghistory.OrderOption]{typ: generated.TypeGroupSettingHistory, tq: q}, nil + case *generated.HushQuery: + return &query[*generated.HushQuery, predicate.Hush, hush.OrderOption]{typ: generated.TypeHush, tq: q}, nil + case *generated.HushHistoryQuery: + return &query[*generated.HushHistoryQuery, predicate.HushHistory, hushhistory.OrderOption]{typ: generated.TypeHushHistory, tq: q}, nil + case *generated.IntegrationQuery: + return &query[*generated.IntegrationQuery, predicate.Integration, integration.OrderOption]{typ: generated.TypeIntegration, tq: q}, nil + case *generated.IntegrationHistoryQuery: + return &query[*generated.IntegrationHistoryQuery, predicate.IntegrationHistory, integrationhistory.OrderOption]{typ: generated.TypeIntegrationHistory, tq: q}, nil + case *generated.InviteQuery: + return &query[*generated.InviteQuery, predicate.Invite, invite.OrderOption]{typ: generated.TypeInvite, tq: q}, nil + case *generated.NoteQuery: + return &query[*generated.NoteQuery, predicate.Note, note.OrderOption]{typ: generated.TypeNote, tq: q}, nil + case *generated.NoteHistoryQuery: + return &query[*generated.NoteHistoryQuery, predicate.NoteHistory, notehistory.OrderOption]{typ: generated.TypeNoteHistory, tq: q}, nil + case *generated.OauthProviderQuery: + return &query[*generated.OauthProviderQuery, predicate.OauthProvider, oauthprovider.OrderOption]{typ: generated.TypeOauthProvider, tq: q}, nil + case *generated.OauthProviderHistoryQuery: + return &query[*generated.OauthProviderHistoryQuery, predicate.OauthProviderHistory, oauthproviderhistory.OrderOption]{typ: generated.TypeOauthProviderHistory, tq: q}, nil + case *generated.OhAuthTooTokenQuery: + return &query[*generated.OhAuthTooTokenQuery, predicate.OhAuthTooToken, ohauthtootoken.OrderOption]{typ: generated.TypeOhAuthTooToken, tq: q}, nil + case *generated.OrgMembershipQuery: + return &query[*generated.OrgMembershipQuery, predicate.OrgMembership, orgmembership.OrderOption]{typ: generated.TypeOrgMembership, tq: q}, nil + case *generated.OrgMembershipHistoryQuery: + return &query[*generated.OrgMembershipHistoryQuery, predicate.OrgMembershipHistory, orgmembershiphistory.OrderOption]{typ: generated.TypeOrgMembershipHistory, tq: q}, nil + case *generated.OrganizationQuery: + return &query[*generated.OrganizationQuery, predicate.Organization, organization.OrderOption]{typ: generated.TypeOrganization, tq: q}, nil + case *generated.OrganizationHistoryQuery: + return &query[*generated.OrganizationHistoryQuery, predicate.OrganizationHistory, organizationhistory.OrderOption]{typ: generated.TypeOrganizationHistory, tq: q}, nil + case *generated.OrganizationSettingQuery: + return &query[*generated.OrganizationSettingQuery, predicate.OrganizationSetting, organizationsetting.OrderOption]{typ: generated.TypeOrganizationSetting, tq: q}, nil + case *generated.OrganizationSettingHistoryQuery: + return &query[*generated.OrganizationSettingHistoryQuery, predicate.OrganizationSettingHistory, organizationsettinghistory.OrderOption]{typ: generated.TypeOrganizationSettingHistory, tq: q}, nil + case *generated.PasswordResetTokenQuery: + return &query[*generated.PasswordResetTokenQuery, predicate.PasswordResetToken, passwordresettoken.OrderOption]{typ: generated.TypePasswordResetToken, tq: q}, nil + case *generated.PersonalAccessTokenQuery: + return &query[*generated.PersonalAccessTokenQuery, predicate.PersonalAccessToken, personalaccesstoken.OrderOption]{typ: generated.TypePersonalAccessToken, tq: q}, nil + case *generated.SubscriberQuery: + return &query[*generated.SubscriberQuery, predicate.Subscriber, subscriber.OrderOption]{typ: generated.TypeSubscriber, tq: q}, nil + case *generated.TFASettingQuery: + return &query[*generated.TFASettingQuery, predicate.TFASetting, tfasetting.OrderOption]{typ: generated.TypeTFASetting, tq: q}, nil + case *generated.TemplateQuery: + return &query[*generated.TemplateQuery, predicate.Template, template.OrderOption]{typ: generated.TypeTemplate, tq: q}, nil + case *generated.TemplateHistoryQuery: + return &query[*generated.TemplateHistoryQuery, predicate.TemplateHistory, templatehistory.OrderOption]{typ: generated.TypeTemplateHistory, tq: q}, nil + case *generated.UserQuery: + return &query[*generated.UserQuery, predicate.User, user.OrderOption]{typ: generated.TypeUser, tq: q}, nil + case *generated.UserHistoryQuery: + return &query[*generated.UserHistoryQuery, predicate.UserHistory, userhistory.OrderOption]{typ: generated.TypeUserHistory, tq: q}, nil + case *generated.UserSettingQuery: + return &query[*generated.UserSettingQuery, predicate.UserSetting, usersetting.OrderOption]{typ: generated.TypeUserSetting, tq: q}, nil + case *generated.UserSettingHistoryQuery: + return &query[*generated.UserSettingHistoryQuery, predicate.UserSettingHistory, usersettinghistory.OrderOption]{typ: generated.TypeUserSettingHistory, tq: q}, nil + case *generated.WebauthnQuery: + return &query[*generated.WebauthnQuery, predicate.Webauthn, webauthn.OrderOption]{typ: generated.TypeWebauthn, tq: q}, nil + case *generated.WebhookQuery: + return &query[*generated.WebhookQuery, predicate.Webhook, webhook.OrderOption]{typ: generated.TypeWebhook, tq: q}, nil + case *generated.WebhookHistoryQuery: + return &query[*generated.WebhookHistoryQuery, predicate.WebhookHistory, webhookhistory.OrderOption]{typ: generated.TypeWebhookHistory, tq: q}, nil + default: + return nil, fmt.Errorf("unknown query type %T", q) + } +} + +type query[T any, P ~func(*sql.Selector), R ~func(*sql.Selector)] struct { + typ string + tq interface { + Limit(int) T + Offset(int) T + Unique(bool) T + Order(...R) T + Where(...P) T + } +} + +func (q query[T, P, R]) Type() string { + return q.typ +} + +func (q query[T, P, R]) Limit(limit int) { + q.tq.Limit(limit) +} + +func (q query[T, P, R]) Offset(offset int) { + q.tq.Offset(offset) +} + +func (q query[T, P, R]) Unique(unique bool) { + q.tq.Unique(unique) +} + +func (q query[T, P, R]) Order(orders ...func(*sql.Selector)) { + rs := make([]R, len(orders)) + for i := range orders { + rs[i] = orders[i] + } + q.tq.Order(rs...) +} + +func (q query[T, P, R]) WhereP(ps ...func(*sql.Selector)) { + p := make([]P, len(ps)) + for i := range ps { + p[i] = ps[i] + } + q.tq.Where(p...) +} diff --git a/internal/ent/generated/internal/schemaconfig.go b/internal/ent/generated/internal/schemaconfig.go new file mode 100644 index 0000000..4783375 --- /dev/null +++ b/internal/ent/generated/internal/schemaconfig.go @@ -0,0 +1,106 @@ +// Code generated by ent, DO NOT EDIT. + +package internal + +import "context" + +// SchemaConfig represents alternative schema names for all tables +// that can be passed at runtime. +type SchemaConfig struct { + APIToken string // APIToken table. + Contact string // Contact table. + ContactHistory string // ContactHistory table. + DocumentData string // DocumentData table. + DocumentDataHistory string // DocumentDataHistory table. + EmailVerificationToken string // EmailVerificationToken table. + Entitlement string // Entitlement table. + EntitlementEvents string // Entitlement-events->Event table. + EntitlementHistory string // EntitlementHistory table. + EntitlementPlan string // EntitlementPlan table. + EntitlementPlanEvents string // EntitlementPlan-events->Event table. + EntitlementPlanFeature string // EntitlementPlanFeature table. + EntitlementPlanFeatureEvents string // EntitlementPlanFeature-events->Event table. + EntitlementPlanFeatureHistory string // EntitlementPlanFeatureHistory table. + EntitlementPlanHistory string // EntitlementPlanHistory table. + Entity string // Entity table. + EntityContacts string // Entity-contacts->Contact table. + EntityDocuments string // Entity-documents->DocumentData table. + EntityFiles string // Entity-files->File table. + EntityHistory string // EntityHistory table. + EntityType string // EntityType table. + EntityTypeHistory string // EntityTypeHistory table. + Event string // Event table. + EventHistory string // EventHistory table. + Feature string // Feature table. + FeatureEvents string // Feature-events->Event table. + FeatureHistory string // FeatureHistory table. + File string // File table. + FileHistory string // FileHistory table. + Group string // Group table. + GroupEvents string // Group-events->Event table. + GroupFiles string // Group-files->File table. + GroupHistory string // GroupHistory table. + GroupMembership string // GroupMembership table. + GroupMembershipEvents string // GroupMembership-events->Event table. + GroupMembershipHistory string // GroupMembershipHistory table. + GroupSetting string // GroupSetting table. + GroupSettingHistory string // GroupSettingHistory table. + Hush string // Hush table. + HushEvents string // Hush-events->Event table. + HushHistory string // HushHistory table. + Integration string // Integration table. + IntegrationSecrets string // Integration-secrets->Hush table. + IntegrationOauth2tokens string // Integration-oauth2tokens->OhAuthTooToken table. + IntegrationEvents string // Integration-events->Event table. + IntegrationWebhooks string // Integration-webhooks->Webhook table. + IntegrationHistory string // IntegrationHistory table. + Invite string // Invite table. + InviteEvents string // Invite-events->Event table. + Note string // Note table. + NoteHistory string // NoteHistory table. + OauthProvider string // OauthProvider table. + OauthProviderHistory string // OauthProviderHistory table. + OhAuthTooToken string // OhAuthTooToken table. + OhAuthTooTokenEvents string // OhAuthTooToken-events->Event table. + OrgMembership string // OrgMembership table. + OrgMembershipEvents string // OrgMembership-events->Event table. + OrgMembershipHistory string // OrgMembershipHistory table. + Organization string // Organization table. + OrganizationPersonalAccessTokens string // Organization-personal_access_tokens->PersonalAccessToken table. + OrganizationEvents string // Organization-events->Event table. + OrganizationSecrets string // Organization-secrets->Hush table. + OrganizationFiles string // Organization-files->File table. + OrganizationHistory string // OrganizationHistory table. + OrganizationSetting string // OrganizationSetting table. + OrganizationSettingHistory string // OrganizationSettingHistory table. + PasswordResetToken string // PasswordResetToken table. + PersonalAccessToken string // PersonalAccessToken table. + PersonalAccessTokenEvents string // PersonalAccessToken-events->Event table. + Subscriber string // Subscriber table. + SubscriberEvents string // Subscriber-events->Event table. + TFASetting string // TFASetting table. + Template string // Template table. + TemplateHistory string // TemplateHistory table. + User string // User table. + UserEvents string // User-events->Event table. + UserHistory string // UserHistory table. + UserSetting string // UserSetting table. + UserSettingHistory string // UserSettingHistory table. + Webauthn string // Webauthn table. + Webhook string // Webhook table. + WebhookEvents string // Webhook-events->Event table. + WebhookHistory string // WebhookHistory table. +} + +type schemaCtxKey struct{} + +// SchemaConfigFromContext returns a SchemaConfig stored inside a context, or empty if there isn't one. +func SchemaConfigFromContext(ctx context.Context) SchemaConfig { + config, _ := ctx.Value(schemaCtxKey{}).(SchemaConfig) + return config +} + +// NewSchemaConfigContext returns a new context with the given SchemaConfig attached. +func NewSchemaConfigContext(parent context.Context, config SchemaConfig) context.Context { + return context.WithValue(parent, schemaCtxKey{}, config) +} diff --git a/internal/ent/generated/invite.go b/internal/ent/generated/invite.go new file mode 100644 index 0000000..9e2936d --- /dev/null +++ b/internal/ent/generated/invite.go @@ -0,0 +1,345 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/pkg/enums" +) + +// Invite is the model entity for the Invite schema. +type Invite struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the invitation token sent to the user via email which should only be provided to the /verify endpoint + handler + Token string `json:"-"` + // the expiration date of the invitation token which defaults to 14 days in the future from creation + Expires time.Time `json:"expires,omitempty"` + // the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + Recipient string `json:"recipient,omitempty"` + // the status of the invitation + Status enums.InviteStatus `json:"status,omitempty"` + // Role holds the value of the "role" field. + Role enums.Role `json:"role,omitempty"` + // the number of attempts made to perform email send of the invitation, maximum of 5 + SendAttempts int `json:"send_attempts,omitempty"` + // the user who initiated the invitation + RequestorID string `json:"requestor_id,omitempty"` + // the comparison secret to verify the token's signature + Secret *[]byte `json:"-"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the InviteQuery when eager-loading is set. + Edges InviteEdges `json:"edges"` + selectValues sql.SelectValues +} + +// InviteEdges holds the relations/edges for other nodes in the graph. +type InviteEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int + + namedEvents map[string][]*Event +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e InviteEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e InviteEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[1] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Invite) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case invite.FieldSecret: + values[i] = new([]byte) + case invite.FieldSendAttempts: + values[i] = new(sql.NullInt64) + case invite.FieldID, invite.FieldCreatedBy, invite.FieldUpdatedBy, invite.FieldMappingID, invite.FieldDeletedBy, invite.FieldOwnerID, invite.FieldToken, invite.FieldRecipient, invite.FieldStatus, invite.FieldRole, invite.FieldRequestorID: + values[i] = new(sql.NullString) + case invite.FieldCreatedAt, invite.FieldUpdatedAt, invite.FieldDeletedAt, invite.FieldExpires: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Invite fields. +func (i *Invite) 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 j := range columns { + switch columns[j] { + case invite.FieldID: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[j]) + } else if value.Valid { + i.ID = value.String + } + case invite.FieldCreatedAt: + if value, ok := values[j].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[j]) + } else if value.Valid { + i.CreatedAt = value.Time + } + case invite.FieldUpdatedAt: + if value, ok := values[j].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[j]) + } else if value.Valid { + i.UpdatedAt = value.Time + } + case invite.FieldCreatedBy: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[j]) + } else if value.Valid { + i.CreatedBy = value.String + } + case invite.FieldUpdatedBy: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[j]) + } else if value.Valid { + i.UpdatedBy = value.String + } + case invite.FieldMappingID: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[j]) + } else if value.Valid { + i.MappingID = value.String + } + case invite.FieldDeletedAt: + if value, ok := values[j].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[j]) + } else if value.Valid { + i.DeletedAt = value.Time + } + case invite.FieldDeletedBy: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[j]) + } else if value.Valid { + i.DeletedBy = value.String + } + case invite.FieldOwnerID: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[j]) + } else if value.Valid { + i.OwnerID = value.String + } + case invite.FieldToken: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token", values[j]) + } else if value.Valid { + i.Token = value.String + } + case invite.FieldExpires: + if value, ok := values[j].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field expires", values[j]) + } else if value.Valid { + i.Expires = value.Time + } + case invite.FieldRecipient: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field recipient", values[j]) + } else if value.Valid { + i.Recipient = value.String + } + case invite.FieldStatus: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[j]) + } else if value.Valid { + i.Status = enums.InviteStatus(value.String) + } + case invite.FieldRole: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field role", values[j]) + } else if value.Valid { + i.Role = enums.Role(value.String) + } + case invite.FieldSendAttempts: + if value, ok := values[j].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field send_attempts", values[j]) + } else if value.Valid { + i.SendAttempts = int(value.Int64) + } + case invite.FieldRequestorID: + if value, ok := values[j].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field requestor_id", values[j]) + } else if value.Valid { + i.RequestorID = value.String + } + case invite.FieldSecret: + if value, ok := values[j].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field secret", values[j]) + } else if value != nil { + i.Secret = value + } + default: + i.selectValues.Set(columns[j], values[j]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Invite. +// This includes values selected through modifiers, order, etc. +func (i *Invite) Value(name string) (ent.Value, error) { + return i.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Invite entity. +func (i *Invite) QueryOwner() *OrganizationQuery { + return NewInviteClient(i.config).QueryOwner(i) +} + +// QueryEvents queries the "events" edge of the Invite entity. +func (i *Invite) QueryEvents() *EventQuery { + return NewInviteClient(i.config).QueryEvents(i) +} + +// Update returns a builder for updating this Invite. +// Note that you need to call Invite.Unwrap() before calling this method if this Invite +// was returned from a transaction, and the transaction was committed or rolled back. +func (i *Invite) Update() *InviteUpdateOne { + return NewInviteClient(i.config).UpdateOne(i) +} + +// Unwrap unwraps the Invite 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 (i *Invite) Unwrap() *Invite { + _tx, ok := i.config.driver.(*txDriver) + if !ok { + panic("generated: Invite is not a transactional entity") + } + i.config.driver = _tx.drv + return i +} + +// String implements the fmt.Stringer. +func (i *Invite) String() string { + var builder strings.Builder + builder.WriteString("Invite(") + builder.WriteString(fmt.Sprintf("id=%v, ", i.ID)) + builder.WriteString("created_at=") + builder.WriteString(i.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(i.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(i.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(i.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(i.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(i.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(i.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(i.OwnerID) + builder.WriteString(", ") + builder.WriteString("token=") + builder.WriteString(", ") + builder.WriteString("expires=") + builder.WriteString(i.Expires.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("recipient=") + builder.WriteString(i.Recipient) + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", i.Status)) + builder.WriteString(", ") + builder.WriteString("role=") + builder.WriteString(fmt.Sprintf("%v", i.Role)) + builder.WriteString(", ") + builder.WriteString("send_attempts=") + builder.WriteString(fmt.Sprintf("%v", i.SendAttempts)) + builder.WriteString(", ") + builder.WriteString("requestor_id=") + builder.WriteString(i.RequestorID) + builder.WriteString(", ") + builder.WriteString("secret=") + builder.WriteByte(')') + return builder.String() +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (i *Invite) NamedEvents(name string) ([]*Event, error) { + if i.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := i.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (i *Invite) appendNamedEvents(name string, edges ...*Event) { + if i.Edges.namedEvents == nil { + i.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + i.Edges.namedEvents[name] = []*Event{} + } else { + i.Edges.namedEvents[name] = append(i.Edges.namedEvents[name], edges...) + } +} + +// Invites is a parsable slice of Invite. +type Invites []*Invite diff --git a/internal/ent/generated/invite/invite.go b/internal/ent/generated/invite/invite.go new file mode 100644 index 0000000..63b4e53 --- /dev/null +++ b/internal/ent/generated/invite/invite.go @@ -0,0 +1,299 @@ +// Code generated by ent, DO NOT EDIT. + +package invite + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the invite type in the database. + Label = "invite" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldToken holds the string denoting the token field in the database. + FieldToken = "token" + // FieldExpires holds the string denoting the expires field in the database. + FieldExpires = "expires" + // FieldRecipient holds the string denoting the recipient field in the database. + FieldRecipient = "recipient" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldRole holds the string denoting the role field in the database. + FieldRole = "role" + // FieldSendAttempts holds the string denoting the send_attempts field in the database. + FieldSendAttempts = "send_attempts" + // FieldRequestorID holds the string denoting the requestor_id field in the database. + FieldRequestorID = "requestor_id" + // FieldSecret holds the string denoting the secret field in the database. + FieldSecret = "secret" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the invite in the database. + Table = "invites" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "invites" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "invite_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for invite fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldToken, + FieldExpires, + FieldRecipient, + FieldStatus, + FieldRole, + FieldSendAttempts, + FieldRequestorID, + FieldSecret, +} + +var ( + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"invite_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [6]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // TokenValidator is a validator for the "token" field. It is called by the builders before save. + TokenValidator func(string) error + // DefaultExpires holds the default value on creation for the "expires" field. + DefaultExpires func() time.Time + // RecipientValidator is a validator for the "recipient" field. It is called by the builders before save. + RecipientValidator func(string) error + // DefaultSendAttempts holds the default value on creation for the "send_attempts" field. + DefaultSendAttempts int + // RequestorIDValidator is a validator for the "requestor_id" field. It is called by the builders before save. + RequestorIDValidator func(string) error + // SecretValidator is a validator for the "secret" field. It is called by the builders before save. + SecretValidator func([]byte) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultStatus enums.InviteStatus = "INVITATION_SENT" + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s enums.InviteStatus) error { + switch s.String() { + case "INVITATION_SENT", "APPROVAL_REQUIRED", "INVITATION_ACCEPTED", "INVITATION_EXPIRED": + return nil + default: + return fmt.Errorf("invite: invalid enum value for status field: %q", s) + } +} + +const DefaultRole enums.Role = "MEMBER" + +// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save. +func RoleValidator(r enums.Role) error { + switch r.String() { + case "ADMIN", "MEMBER", "USER": + return nil + default: + return fmt.Errorf("invite: invalid enum value for role field: %q", r) + } +} + +// OrderOption defines the ordering options for the Invite queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByToken orders the results by the token field. +func ByToken(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldToken, opts...).ToFunc() +} + +// ByExpires orders the results by the expires field. +func ByExpires(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpires, opts...).ToFunc() +} + +// ByRecipient orders the results by the recipient field. +func ByRecipient(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRecipient, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByRole orders the results by the role field. +func ByRole(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRole, opts...).ToFunc() +} + +// BySendAttempts orders the results by the send_attempts field. +func BySendAttempts(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSendAttempts, opts...).ToFunc() +} + +// ByRequestorID orders the results by the requestor_id field. +func ByRequestorID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRequestorID, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} + +var ( + // enums.InviteStatus must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.InviteStatus)(nil) + // enums.InviteStatus must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.InviteStatus)(nil) +) + +var ( + // enums.Role must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Role)(nil) + // enums.Role must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Role)(nil) +) diff --git a/internal/ent/generated/invite/where.go b/internal/ent/generated/invite/where.go new file mode 100644 index 0000000..783d11e --- /dev/null +++ b/internal/ent/generated/invite/where.go @@ -0,0 +1,1122 @@ +// Code generated by ent, DO NOT EDIT. + +package invite + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldOwnerID, v)) +} + +// Token applies equality check predicate on the "token" field. It's identical to TokenEQ. +func Token(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldToken, v)) +} + +// Expires applies equality check predicate on the "expires" field. It's identical to ExpiresEQ. +func Expires(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldExpires, v)) +} + +// Recipient applies equality check predicate on the "recipient" field. It's identical to RecipientEQ. +func Recipient(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldRecipient, v)) +} + +// SendAttempts applies equality check predicate on the "send_attempts" field. It's identical to SendAttemptsEQ. +func SendAttempts(v int) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldSendAttempts, v)) +} + +// RequestorID applies equality check predicate on the "requestor_id" field. It's identical to RequestorIDEQ. +func RequestorID(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldRequestorID, v)) +} + +// Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ. +func Secret(v []byte) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldSecret, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TokenEQ applies the EQ predicate on the "token" field. +func TokenEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldToken, v)) +} + +// TokenNEQ applies the NEQ predicate on the "token" field. +func TokenNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldToken, v)) +} + +// TokenIn applies the In predicate on the "token" field. +func TokenIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldToken, vs...)) +} + +// TokenNotIn applies the NotIn predicate on the "token" field. +func TokenNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldToken, vs...)) +} + +// TokenGT applies the GT predicate on the "token" field. +func TokenGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldToken, v)) +} + +// TokenGTE applies the GTE predicate on the "token" field. +func TokenGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldToken, v)) +} + +// TokenLT applies the LT predicate on the "token" field. +func TokenLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldToken, v)) +} + +// TokenLTE applies the LTE predicate on the "token" field. +func TokenLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldToken, v)) +} + +// TokenContains applies the Contains predicate on the "token" field. +func TokenContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldToken, v)) +} + +// TokenHasPrefix applies the HasPrefix predicate on the "token" field. +func TokenHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldToken, v)) +} + +// TokenHasSuffix applies the HasSuffix predicate on the "token" field. +func TokenHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldToken, v)) +} + +// TokenEqualFold applies the EqualFold predicate on the "token" field. +func TokenEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldToken, v)) +} + +// TokenContainsFold applies the ContainsFold predicate on the "token" field. +func TokenContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldToken, v)) +} + +// ExpiresEQ applies the EQ predicate on the "expires" field. +func ExpiresEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldExpires, v)) +} + +// ExpiresNEQ applies the NEQ predicate on the "expires" field. +func ExpiresNEQ(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldExpires, v)) +} + +// ExpiresIn applies the In predicate on the "expires" field. +func ExpiresIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldExpires, vs...)) +} + +// ExpiresNotIn applies the NotIn predicate on the "expires" field. +func ExpiresNotIn(vs ...time.Time) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldExpires, vs...)) +} + +// ExpiresGT applies the GT predicate on the "expires" field. +func ExpiresGT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldExpires, v)) +} + +// ExpiresGTE applies the GTE predicate on the "expires" field. +func ExpiresGTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldExpires, v)) +} + +// ExpiresLT applies the LT predicate on the "expires" field. +func ExpiresLT(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldExpires, v)) +} + +// ExpiresLTE applies the LTE predicate on the "expires" field. +func ExpiresLTE(v time.Time) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldExpires, v)) +} + +// ExpiresIsNil applies the IsNil predicate on the "expires" field. +func ExpiresIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldExpires)) +} + +// ExpiresNotNil applies the NotNil predicate on the "expires" field. +func ExpiresNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldExpires)) +} + +// RecipientEQ applies the EQ predicate on the "recipient" field. +func RecipientEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldRecipient, v)) +} + +// RecipientNEQ applies the NEQ predicate on the "recipient" field. +func RecipientNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldRecipient, v)) +} + +// RecipientIn applies the In predicate on the "recipient" field. +func RecipientIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldRecipient, vs...)) +} + +// RecipientNotIn applies the NotIn predicate on the "recipient" field. +func RecipientNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldRecipient, vs...)) +} + +// RecipientGT applies the GT predicate on the "recipient" field. +func RecipientGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldRecipient, v)) +} + +// RecipientGTE applies the GTE predicate on the "recipient" field. +func RecipientGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldRecipient, v)) +} + +// RecipientLT applies the LT predicate on the "recipient" field. +func RecipientLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldRecipient, v)) +} + +// RecipientLTE applies the LTE predicate on the "recipient" field. +func RecipientLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldRecipient, v)) +} + +// RecipientContains applies the Contains predicate on the "recipient" field. +func RecipientContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldRecipient, v)) +} + +// RecipientHasPrefix applies the HasPrefix predicate on the "recipient" field. +func RecipientHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldRecipient, v)) +} + +// RecipientHasSuffix applies the HasSuffix predicate on the "recipient" field. +func RecipientHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldRecipient, v)) +} + +// RecipientEqualFold applies the EqualFold predicate on the "recipient" field. +func RecipientEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldRecipient, v)) +} + +// RecipientContainsFold applies the ContainsFold predicate on the "recipient" field. +func RecipientContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldRecipient, v)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v enums.InviteStatus) predicate.Invite { + vc := v + return predicate.Invite(sql.FieldEQ(FieldStatus, vc)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v enums.InviteStatus) predicate.Invite { + vc := v + return predicate.Invite(sql.FieldNEQ(FieldStatus, vc)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...enums.InviteStatus) predicate.Invite { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Invite(sql.FieldIn(FieldStatus, v...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...enums.InviteStatus) predicate.Invite { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Invite(sql.FieldNotIn(FieldStatus, v...)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v enums.Role) predicate.Invite { + vc := v + return predicate.Invite(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v enums.Role) predicate.Invite { + vc := v + return predicate.Invite(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...enums.Role) predicate.Invite { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Invite(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...enums.Role) predicate.Invite { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Invite(sql.FieldNotIn(FieldRole, v...)) +} + +// SendAttemptsEQ applies the EQ predicate on the "send_attempts" field. +func SendAttemptsEQ(v int) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldSendAttempts, v)) +} + +// SendAttemptsNEQ applies the NEQ predicate on the "send_attempts" field. +func SendAttemptsNEQ(v int) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldSendAttempts, v)) +} + +// SendAttemptsIn applies the In predicate on the "send_attempts" field. +func SendAttemptsIn(vs ...int) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldSendAttempts, vs...)) +} + +// SendAttemptsNotIn applies the NotIn predicate on the "send_attempts" field. +func SendAttemptsNotIn(vs ...int) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldSendAttempts, vs...)) +} + +// SendAttemptsGT applies the GT predicate on the "send_attempts" field. +func SendAttemptsGT(v int) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldSendAttempts, v)) +} + +// SendAttemptsGTE applies the GTE predicate on the "send_attempts" field. +func SendAttemptsGTE(v int) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldSendAttempts, v)) +} + +// SendAttemptsLT applies the LT predicate on the "send_attempts" field. +func SendAttemptsLT(v int) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldSendAttempts, v)) +} + +// SendAttemptsLTE applies the LTE predicate on the "send_attempts" field. +func SendAttemptsLTE(v int) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldSendAttempts, v)) +} + +// RequestorIDEQ applies the EQ predicate on the "requestor_id" field. +func RequestorIDEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldRequestorID, v)) +} + +// RequestorIDNEQ applies the NEQ predicate on the "requestor_id" field. +func RequestorIDNEQ(v string) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldRequestorID, v)) +} + +// RequestorIDIn applies the In predicate on the "requestor_id" field. +func RequestorIDIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldRequestorID, vs...)) +} + +// RequestorIDNotIn applies the NotIn predicate on the "requestor_id" field. +func RequestorIDNotIn(vs ...string) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldRequestorID, vs...)) +} + +// RequestorIDGT applies the GT predicate on the "requestor_id" field. +func RequestorIDGT(v string) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldRequestorID, v)) +} + +// RequestorIDGTE applies the GTE predicate on the "requestor_id" field. +func RequestorIDGTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldRequestorID, v)) +} + +// RequestorIDLT applies the LT predicate on the "requestor_id" field. +func RequestorIDLT(v string) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldRequestorID, v)) +} + +// RequestorIDLTE applies the LTE predicate on the "requestor_id" field. +func RequestorIDLTE(v string) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldRequestorID, v)) +} + +// RequestorIDContains applies the Contains predicate on the "requestor_id" field. +func RequestorIDContains(v string) predicate.Invite { + return predicate.Invite(sql.FieldContains(FieldRequestorID, v)) +} + +// RequestorIDHasPrefix applies the HasPrefix predicate on the "requestor_id" field. +func RequestorIDHasPrefix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasPrefix(FieldRequestorID, v)) +} + +// RequestorIDHasSuffix applies the HasSuffix predicate on the "requestor_id" field. +func RequestorIDHasSuffix(v string) predicate.Invite { + return predicate.Invite(sql.FieldHasSuffix(FieldRequestorID, v)) +} + +// RequestorIDIsNil applies the IsNil predicate on the "requestor_id" field. +func RequestorIDIsNil() predicate.Invite { + return predicate.Invite(sql.FieldIsNull(FieldRequestorID)) +} + +// RequestorIDNotNil applies the NotNil predicate on the "requestor_id" field. +func RequestorIDNotNil() predicate.Invite { + return predicate.Invite(sql.FieldNotNull(FieldRequestorID)) +} + +// RequestorIDEqualFold applies the EqualFold predicate on the "requestor_id" field. +func RequestorIDEqualFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldEqualFold(FieldRequestorID, v)) +} + +// RequestorIDContainsFold applies the ContainsFold predicate on the "requestor_id" field. +func RequestorIDContainsFold(v string) predicate.Invite { + return predicate.Invite(sql.FieldContainsFold(FieldRequestorID, v)) +} + +// SecretEQ applies the EQ predicate on the "secret" field. +func SecretEQ(v []byte) predicate.Invite { + return predicate.Invite(sql.FieldEQ(FieldSecret, v)) +} + +// SecretNEQ applies the NEQ predicate on the "secret" field. +func SecretNEQ(v []byte) predicate.Invite { + return predicate.Invite(sql.FieldNEQ(FieldSecret, v)) +} + +// SecretIn applies the In predicate on the "secret" field. +func SecretIn(vs ...[]byte) predicate.Invite { + return predicate.Invite(sql.FieldIn(FieldSecret, vs...)) +} + +// SecretNotIn applies the NotIn predicate on the "secret" field. +func SecretNotIn(vs ...[]byte) predicate.Invite { + return predicate.Invite(sql.FieldNotIn(FieldSecret, vs...)) +} + +// SecretGT applies the GT predicate on the "secret" field. +func SecretGT(v []byte) predicate.Invite { + return predicate.Invite(sql.FieldGT(FieldSecret, v)) +} + +// SecretGTE applies the GTE predicate on the "secret" field. +func SecretGTE(v []byte) predicate.Invite { + return predicate.Invite(sql.FieldGTE(FieldSecret, v)) +} + +// SecretLT applies the LT predicate on the "secret" field. +func SecretLT(v []byte) predicate.Invite { + return predicate.Invite(sql.FieldLT(FieldSecret, v)) +} + +// SecretLTE applies the LTE predicate on the "secret" field. +func SecretLTE(v []byte) predicate.Invite { + return predicate.Invite(sql.FieldLTE(FieldSecret, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Invite { + return predicate.Invite(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Invite + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Invite { + return predicate.Invite(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Invite + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Invite { + return predicate.Invite(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.InviteEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Invite { + return predicate.Invite(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.InviteEvents + 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.Invite) predicate.Invite { + return predicate.Invite(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Invite) predicate.Invite { + return predicate.Invite(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Invite) predicate.Invite { + return predicate.Invite(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/invite_create.go b/internal/ent/generated/invite_create.go new file mode 100644 index 0000000..96e9f07 --- /dev/null +++ b/internal/ent/generated/invite_create.go @@ -0,0 +1,621 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/pkg/enums" +) + +// InviteCreate is the builder for creating a Invite entity. +type InviteCreate struct { + config + mutation *InviteMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (ic *InviteCreate) SetCreatedAt(t time.Time) *InviteCreate { + ic.mutation.SetCreatedAt(t) + return ic +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ic *InviteCreate) SetNillableCreatedAt(t *time.Time) *InviteCreate { + if t != nil { + ic.SetCreatedAt(*t) + } + return ic +} + +// SetUpdatedAt sets the "updated_at" field. +func (ic *InviteCreate) SetUpdatedAt(t time.Time) *InviteCreate { + ic.mutation.SetUpdatedAt(t) + return ic +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ic *InviteCreate) SetNillableUpdatedAt(t *time.Time) *InviteCreate { + if t != nil { + ic.SetUpdatedAt(*t) + } + return ic +} + +// SetCreatedBy sets the "created_by" field. +func (ic *InviteCreate) SetCreatedBy(s string) *InviteCreate { + ic.mutation.SetCreatedBy(s) + return ic +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ic *InviteCreate) SetNillableCreatedBy(s *string) *InviteCreate { + if s != nil { + ic.SetCreatedBy(*s) + } + return ic +} + +// SetUpdatedBy sets the "updated_by" field. +func (ic *InviteCreate) SetUpdatedBy(s string) *InviteCreate { + ic.mutation.SetUpdatedBy(s) + return ic +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ic *InviteCreate) SetNillableUpdatedBy(s *string) *InviteCreate { + if s != nil { + ic.SetUpdatedBy(*s) + } + return ic +} + +// SetMappingID sets the "mapping_id" field. +func (ic *InviteCreate) SetMappingID(s string) *InviteCreate { + ic.mutation.SetMappingID(s) + return ic +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ic *InviteCreate) SetNillableMappingID(s *string) *InviteCreate { + if s != nil { + ic.SetMappingID(*s) + } + return ic +} + +// SetDeletedAt sets the "deleted_at" field. +func (ic *InviteCreate) SetDeletedAt(t time.Time) *InviteCreate { + ic.mutation.SetDeletedAt(t) + return ic +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ic *InviteCreate) SetNillableDeletedAt(t *time.Time) *InviteCreate { + if t != nil { + ic.SetDeletedAt(*t) + } + return ic +} + +// SetDeletedBy sets the "deleted_by" field. +func (ic *InviteCreate) SetDeletedBy(s string) *InviteCreate { + ic.mutation.SetDeletedBy(s) + return ic +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ic *InviteCreate) SetNillableDeletedBy(s *string) *InviteCreate { + if s != nil { + ic.SetDeletedBy(*s) + } + return ic +} + +// SetOwnerID sets the "owner_id" field. +func (ic *InviteCreate) SetOwnerID(s string) *InviteCreate { + ic.mutation.SetOwnerID(s) + return ic +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ic *InviteCreate) SetNillableOwnerID(s *string) *InviteCreate { + if s != nil { + ic.SetOwnerID(*s) + } + return ic +} + +// SetToken sets the "token" field. +func (ic *InviteCreate) SetToken(s string) *InviteCreate { + ic.mutation.SetToken(s) + return ic +} + +// SetExpires sets the "expires" field. +func (ic *InviteCreate) SetExpires(t time.Time) *InviteCreate { + ic.mutation.SetExpires(t) + return ic +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (ic *InviteCreate) SetNillableExpires(t *time.Time) *InviteCreate { + if t != nil { + ic.SetExpires(*t) + } + return ic +} + +// SetRecipient sets the "recipient" field. +func (ic *InviteCreate) SetRecipient(s string) *InviteCreate { + ic.mutation.SetRecipient(s) + return ic +} + +// SetStatus sets the "status" field. +func (ic *InviteCreate) SetStatus(es enums.InviteStatus) *InviteCreate { + ic.mutation.SetStatus(es) + return ic +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ic *InviteCreate) SetNillableStatus(es *enums.InviteStatus) *InviteCreate { + if es != nil { + ic.SetStatus(*es) + } + return ic +} + +// SetRole sets the "role" field. +func (ic *InviteCreate) SetRole(e enums.Role) *InviteCreate { + ic.mutation.SetRole(e) + return ic +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (ic *InviteCreate) SetNillableRole(e *enums.Role) *InviteCreate { + if e != nil { + ic.SetRole(*e) + } + return ic +} + +// SetSendAttempts sets the "send_attempts" field. +func (ic *InviteCreate) SetSendAttempts(i int) *InviteCreate { + ic.mutation.SetSendAttempts(i) + return ic +} + +// SetNillableSendAttempts sets the "send_attempts" field if the given value is not nil. +func (ic *InviteCreate) SetNillableSendAttempts(i *int) *InviteCreate { + if i != nil { + ic.SetSendAttempts(*i) + } + return ic +} + +// SetRequestorID sets the "requestor_id" field. +func (ic *InviteCreate) SetRequestorID(s string) *InviteCreate { + ic.mutation.SetRequestorID(s) + return ic +} + +// SetNillableRequestorID sets the "requestor_id" field if the given value is not nil. +func (ic *InviteCreate) SetNillableRequestorID(s *string) *InviteCreate { + if s != nil { + ic.SetRequestorID(*s) + } + return ic +} + +// SetSecret sets the "secret" field. +func (ic *InviteCreate) SetSecret(b []byte) *InviteCreate { + ic.mutation.SetSecret(b) + return ic +} + +// SetID sets the "id" field. +func (ic *InviteCreate) SetID(s string) *InviteCreate { + ic.mutation.SetID(s) + return ic +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ic *InviteCreate) SetNillableID(s *string) *InviteCreate { + if s != nil { + ic.SetID(*s) + } + return ic +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (ic *InviteCreate) SetOwner(o *Organization) *InviteCreate { + return ic.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (ic *InviteCreate) AddEventIDs(ids ...string) *InviteCreate { + ic.mutation.AddEventIDs(ids...) + return ic +} + +// AddEvents adds the "events" edges to the Event entity. +func (ic *InviteCreate) AddEvents(e ...*Event) *InviteCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ic.AddEventIDs(ids...) +} + +// Mutation returns the InviteMutation object of the builder. +func (ic *InviteCreate) Mutation() *InviteMutation { + return ic.mutation +} + +// Save creates the Invite in the database. +func (ic *InviteCreate) Save(ctx context.Context) (*Invite, error) { + if err := ic.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ic.sqlSave, ic.mutation, ic.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ic *InviteCreate) SaveX(ctx context.Context) *Invite { + v, err := ic.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ic *InviteCreate) Exec(ctx context.Context) error { + _, err := ic.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ic *InviteCreate) ExecX(ctx context.Context) { + if err := ic.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ic *InviteCreate) defaults() error { + if _, ok := ic.mutation.CreatedAt(); !ok { + if invite.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized invite.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := invite.DefaultCreatedAt() + ic.mutation.SetCreatedAt(v) + } + if _, ok := ic.mutation.UpdatedAt(); !ok { + if invite.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized invite.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := invite.DefaultUpdatedAt() + ic.mutation.SetUpdatedAt(v) + } + if _, ok := ic.mutation.MappingID(); !ok { + if invite.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized invite.DefaultMappingID (forgotten import generated/runtime?)") + } + v := invite.DefaultMappingID() + ic.mutation.SetMappingID(v) + } + if _, ok := ic.mutation.Expires(); !ok { + if invite.DefaultExpires == nil { + return fmt.Errorf("generated: uninitialized invite.DefaultExpires (forgotten import generated/runtime?)") + } + v := invite.DefaultExpires() + ic.mutation.SetExpires(v) + } + if _, ok := ic.mutation.Status(); !ok { + v := invite.DefaultStatus + ic.mutation.SetStatus(v) + } + if _, ok := ic.mutation.Role(); !ok { + v := invite.DefaultRole + ic.mutation.SetRole(v) + } + if _, ok := ic.mutation.SendAttempts(); !ok { + v := invite.DefaultSendAttempts + ic.mutation.SetSendAttempts(v) + } + if _, ok := ic.mutation.ID(); !ok { + if invite.DefaultID == nil { + return fmt.Errorf("generated: uninitialized invite.DefaultID (forgotten import generated/runtime?)") + } + v := invite.DefaultID() + ic.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ic *InviteCreate) check() error { + if _, ok := ic.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Invite.mapping_id"`)} + } + if v, ok := ic.mutation.OwnerID(); ok { + if err := invite.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Invite.owner_id": %w`, err)} + } + } + if _, ok := ic.mutation.Token(); !ok { + return &ValidationError{Name: "token", err: errors.New(`generated: missing required field "Invite.token"`)} + } + if v, ok := ic.mutation.Token(); ok { + if err := invite.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "Invite.token": %w`, err)} + } + } + if _, ok := ic.mutation.Recipient(); !ok { + return &ValidationError{Name: "recipient", err: errors.New(`generated: missing required field "Invite.recipient"`)} + } + if v, ok := ic.mutation.Recipient(); ok { + if err := invite.RecipientValidator(v); err != nil { + return &ValidationError{Name: "recipient", err: fmt.Errorf(`generated: validator failed for field "Invite.recipient": %w`, err)} + } + } + if _, ok := ic.mutation.Status(); !ok { + return &ValidationError{Name: "status", err: errors.New(`generated: missing required field "Invite.status"`)} + } + if v, ok := ic.mutation.Status(); ok { + if err := invite.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "Invite.status": %w`, err)} + } + } + if _, ok := ic.mutation.Role(); !ok { + return &ValidationError{Name: "role", err: errors.New(`generated: missing required field "Invite.role"`)} + } + if v, ok := ic.mutation.Role(); ok { + if err := invite.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "Invite.role": %w`, err)} + } + } + if _, ok := ic.mutation.SendAttempts(); !ok { + return &ValidationError{Name: "send_attempts", err: errors.New(`generated: missing required field "Invite.send_attempts"`)} + } + if v, ok := ic.mutation.RequestorID(); ok { + if err := invite.RequestorIDValidator(v); err != nil { + return &ValidationError{Name: "requestor_id", err: fmt.Errorf(`generated: validator failed for field "Invite.requestor_id": %w`, err)} + } + } + if _, ok := ic.mutation.Secret(); !ok { + return &ValidationError{Name: "secret", err: errors.New(`generated: missing required field "Invite.secret"`)} + } + if v, ok := ic.mutation.Secret(); ok { + if err := invite.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "Invite.secret": %w`, err)} + } + } + return nil +} + +func (ic *InviteCreate) sqlSave(ctx context.Context) (*Invite, error) { + if err := ic.check(); err != nil { + return nil, err + } + _node, _spec := ic.createSpec() + if err := sqlgraph.CreateNode(ctx, ic.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Invite.ID type: %T", _spec.ID.Value) + } + } + ic.mutation.id = &_node.ID + ic.mutation.done = true + return _node, nil +} + +func (ic *InviteCreate) createSpec() (*Invite, *sqlgraph.CreateSpec) { + var ( + _node = &Invite{config: ic.config} + _spec = sqlgraph.NewCreateSpec(invite.Table, sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString)) + ) + _spec.Schema = ic.schemaConfig.Invite + if id, ok := ic.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ic.mutation.CreatedAt(); ok { + _spec.SetField(invite.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ic.mutation.UpdatedAt(); ok { + _spec.SetField(invite.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ic.mutation.CreatedBy(); ok { + _spec.SetField(invite.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ic.mutation.UpdatedBy(); ok { + _spec.SetField(invite.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ic.mutation.MappingID(); ok { + _spec.SetField(invite.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ic.mutation.DeletedAt(); ok { + _spec.SetField(invite.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ic.mutation.DeletedBy(); ok { + _spec.SetField(invite.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ic.mutation.Token(); ok { + _spec.SetField(invite.FieldToken, field.TypeString, value) + _node.Token = value + } + if value, ok := ic.mutation.Expires(); ok { + _spec.SetField(invite.FieldExpires, field.TypeTime, value) + _node.Expires = value + } + if value, ok := ic.mutation.Recipient(); ok { + _spec.SetField(invite.FieldRecipient, field.TypeString, value) + _node.Recipient = value + } + if value, ok := ic.mutation.Status(); ok { + _spec.SetField(invite.FieldStatus, field.TypeEnum, value) + _node.Status = value + } + if value, ok := ic.mutation.Role(); ok { + _spec.SetField(invite.FieldRole, field.TypeEnum, value) + _node.Role = value + } + if value, ok := ic.mutation.SendAttempts(); ok { + _spec.SetField(invite.FieldSendAttempts, field.TypeInt, value) + _node.SendAttempts = value + } + if value, ok := ic.mutation.RequestorID(); ok { + _spec.SetField(invite.FieldRequestorID, field.TypeString, value) + _node.RequestorID = value + } + if value, ok := ic.mutation.Secret(); ok { + _spec.SetField(invite.FieldSecret, field.TypeBytes, value) + _node.Secret = &value + } + if nodes := ic.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: invite.OwnerTable, + Columns: []string{invite.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ic.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := ic.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ic.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// InviteCreateBulk is the builder for creating many Invite entities in bulk. +type InviteCreateBulk struct { + config + err error + builders []*InviteCreate +} + +// Save creates the Invite entities in the database. +func (icb *InviteCreateBulk) Save(ctx context.Context) ([]*Invite, error) { + if icb.err != nil { + return nil, icb.err + } + specs := make([]*sqlgraph.CreateSpec, len(icb.builders)) + nodes := make([]*Invite, len(icb.builders)) + mutators := make([]Mutator, len(icb.builders)) + for i := range icb.builders { + func(i int, root context.Context) { + builder := icb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*InviteMutation) + 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, icb.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, icb.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, icb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (icb *InviteCreateBulk) SaveX(ctx context.Context) []*Invite { + v, err := icb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (icb *InviteCreateBulk) Exec(ctx context.Context) error { + _, err := icb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (icb *InviteCreateBulk) ExecX(ctx context.Context) { + if err := icb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/invite_delete.go b/internal/ent/generated/invite_delete.go new file mode 100644 index 0000000..d48e52c --- /dev/null +++ b/internal/ent/generated/invite_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/invite" +) + +// InviteDelete is the builder for deleting a Invite entity. +type InviteDelete struct { + config + hooks []Hook + mutation *InviteMutation +} + +// Where appends a list predicates to the InviteDelete builder. +func (id *InviteDelete) Where(ps ...predicate.Invite) *InviteDelete { + id.mutation.Where(ps...) + return id +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (id *InviteDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, id.sqlExec, id.mutation, id.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (id *InviteDelete) ExecX(ctx context.Context) int { + n, err := id.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (id *InviteDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(invite.Table, sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString)) + _spec.Node.Schema = id.schemaConfig.Invite + ctx = internal.NewSchemaConfigContext(ctx, id.schemaConfig) + if ps := id.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, id.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + id.mutation.done = true + return affected, err +} + +// InviteDeleteOne is the builder for deleting a single Invite entity. +type InviteDeleteOne struct { + id *InviteDelete +} + +// Where appends a list predicates to the InviteDelete builder. +func (ido *InviteDeleteOne) Where(ps ...predicate.Invite) *InviteDeleteOne { + ido.id.mutation.Where(ps...) + return ido +} + +// Exec executes the deletion query. +func (ido *InviteDeleteOne) Exec(ctx context.Context) error { + n, err := ido.id.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{invite.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ido *InviteDeleteOne) ExecX(ctx context.Context) { + if err := ido.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/invite_query.go b/internal/ent/generated/invite_query.go new file mode 100644 index 0000000..3895c12 --- /dev/null +++ b/internal/ent/generated/invite_query.go @@ -0,0 +1,770 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// InviteQuery is the builder for querying Invite entities. +type InviteQuery struct { + config + ctx *QueryContext + order []invite.OrderOption + inters []Interceptor + predicates []predicate.Invite + withOwner *OrganizationQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Invite) error + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the InviteQuery builder. +func (iq *InviteQuery) Where(ps ...predicate.Invite) *InviteQuery { + iq.predicates = append(iq.predicates, ps...) + return iq +} + +// Limit the number of records to be returned by this query. +func (iq *InviteQuery) Limit(limit int) *InviteQuery { + iq.ctx.Limit = &limit + return iq +} + +// Offset to start from. +func (iq *InviteQuery) Offset(offset int) *InviteQuery { + iq.ctx.Offset = &offset + return iq +} + +// 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 (iq *InviteQuery) Unique(unique bool) *InviteQuery { + iq.ctx.Unique = &unique + return iq +} + +// Order specifies how the records should be ordered. +func (iq *InviteQuery) Order(o ...invite.OrderOption) *InviteQuery { + iq.order = append(iq.order, o...) + return iq +} + +// QueryOwner chains the current query on the "owner" edge. +func (iq *InviteQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: iq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := iq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(invite.Table, invite.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, invite.OwnerTable, invite.OwnerColumn), + ) + schemaConfig := iq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Invite + fromU = sqlgraph.SetNeighbors(iq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (iq *InviteQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: iq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := iq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(invite.Table, invite.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, invite.EventsTable, invite.EventsPrimaryKey...), + ) + schemaConfig := iq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.InviteEvents + fromU = sqlgraph.SetNeighbors(iq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Invite entity from the query. +// Returns a *NotFoundError when no Invite was found. +func (iq *InviteQuery) First(ctx context.Context) (*Invite, error) { + nodes, err := iq.Limit(1).All(setContextOp(ctx, iq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{invite.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (iq *InviteQuery) FirstX(ctx context.Context) *Invite { + node, err := iq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Invite ID from the query. +// Returns a *NotFoundError when no Invite ID was found. +func (iq *InviteQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = iq.Limit(1).IDs(setContextOp(ctx, iq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{invite.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (iq *InviteQuery) FirstIDX(ctx context.Context) string { + id, err := iq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Invite entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Invite entity is found. +// Returns a *NotFoundError when no Invite entities are found. +func (iq *InviteQuery) Only(ctx context.Context) (*Invite, error) { + nodes, err := iq.Limit(2).All(setContextOp(ctx, iq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{invite.Label} + default: + return nil, &NotSingularError{invite.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (iq *InviteQuery) OnlyX(ctx context.Context) *Invite { + node, err := iq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Invite ID in the query. +// Returns a *NotSingularError when more than one Invite ID is found. +// Returns a *NotFoundError when no entities are found. +func (iq *InviteQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = iq.Limit(2).IDs(setContextOp(ctx, iq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{invite.Label} + default: + err = &NotSingularError{invite.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (iq *InviteQuery) OnlyIDX(ctx context.Context) string { + id, err := iq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Invites. +func (iq *InviteQuery) All(ctx context.Context) ([]*Invite, error) { + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryAll) + if err := iq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Invite, *InviteQuery]() + return withInterceptors[[]*Invite](ctx, iq, qr, iq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (iq *InviteQuery) AllX(ctx context.Context) []*Invite { + nodes, err := iq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Invite IDs. +func (iq *InviteQuery) IDs(ctx context.Context) (ids []string, err error) { + if iq.ctx.Unique == nil && iq.path != nil { + iq.Unique(true) + } + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryIDs) + if err = iq.Select(invite.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (iq *InviteQuery) IDsX(ctx context.Context) []string { + ids, err := iq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (iq *InviteQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryCount) + if err := iq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, iq, querierCount[*InviteQuery](), iq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (iq *InviteQuery) CountX(ctx context.Context) int { + count, err := iq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (iq *InviteQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, iq.ctx, ent.OpQueryExist) + switch _, err := iq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (iq *InviteQuery) ExistX(ctx context.Context) bool { + exist, err := iq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the InviteQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (iq *InviteQuery) Clone() *InviteQuery { + if iq == nil { + return nil + } + return &InviteQuery{ + config: iq.config, + ctx: iq.ctx.Clone(), + order: append([]invite.OrderOption{}, iq.order...), + inters: append([]Interceptor{}, iq.inters...), + predicates: append([]predicate.Invite{}, iq.predicates...), + withOwner: iq.withOwner.Clone(), + withEvents: iq.withEvents.Clone(), + // clone intermediate query. + sql: iq.sql.Clone(), + path: iq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (iq *InviteQuery) WithOwner(opts ...func(*OrganizationQuery)) *InviteQuery { + query := (&OrganizationClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + iq.withOwner = query + return iq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (iq *InviteQuery) WithEvents(opts ...func(*EventQuery)) *InviteQuery { + query := (&EventClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + iq.withEvents = query + return iq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Invite.Query(). +// GroupBy(invite.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (iq *InviteQuery) GroupBy(field string, fields ...string) *InviteGroupBy { + iq.ctx.Fields = append([]string{field}, fields...) + grbuild := &InviteGroupBy{build: iq} + grbuild.flds = &iq.ctx.Fields + grbuild.label = invite.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Invite.Query(). +// Select(invite.FieldCreatedAt). +// Scan(ctx, &v) +func (iq *InviteQuery) Select(fields ...string) *InviteSelect { + iq.ctx.Fields = append(iq.ctx.Fields, fields...) + sbuild := &InviteSelect{InviteQuery: iq} + sbuild.label = invite.Label + sbuild.flds, sbuild.scan = &iq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a InviteSelect configured with the given aggregations. +func (iq *InviteQuery) Aggregate(fns ...AggregateFunc) *InviteSelect { + return iq.Select().Aggregate(fns...) +} + +func (iq *InviteQuery) prepareQuery(ctx context.Context) error { + for _, inter := range iq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, iq); err != nil { + return err + } + } + } + for _, f := range iq.ctx.Fields { + if !invite.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if iq.path != nil { + prev, err := iq.path(ctx) + if err != nil { + return err + } + iq.sql = prev + } + if invite.Policy == nil { + return errors.New("generated: uninitialized invite.Policy (forgotten import generated/runtime?)") + } + if err := invite.Policy.EvalQuery(ctx, iq); err != nil { + return err + } + return nil +} + +func (iq *InviteQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Invite, error) { + var ( + nodes = []*Invite{} + _spec = iq.querySpec() + loadedTypes = [2]bool{ + iq.withOwner != nil, + iq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Invite).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Invite{config: iq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = iq.schemaConfig.Invite + ctx = internal.NewSchemaConfigContext(ctx, iq.schemaConfig) + if len(iq.modifiers) > 0 { + _spec.Modifiers = iq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, iq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := iq.withOwner; query != nil { + if err := iq.loadOwner(ctx, query, nodes, nil, + func(n *Invite, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := iq.withEvents; query != nil { + if err := iq.loadEvents(ctx, query, nodes, + func(n *Invite) { n.Edges.Events = []*Event{} }, + func(n *Invite, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range iq.withNamedEvents { + if err := iq.loadEvents(ctx, query, nodes, + func(n *Invite) { n.appendNamedEvents(name) }, + func(n *Invite, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range iq.loadTotal { + if err := iq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (iq *InviteQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Invite, init func(*Invite), assign func(*Invite, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Invite) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (iq *InviteQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Invite, init func(*Invite), assign func(*Invite, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Invite) + nids := make(map[string]map[*Invite]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(invite.EventsTable) + joinT.Schema(iq.schemaConfig.InviteEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(invite.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(invite.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(invite.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Invite]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (iq *InviteQuery) sqlCount(ctx context.Context) (int, error) { + _spec := iq.querySpec() + _spec.Node.Schema = iq.schemaConfig.Invite + ctx = internal.NewSchemaConfigContext(ctx, iq.schemaConfig) + if len(iq.modifiers) > 0 { + _spec.Modifiers = iq.modifiers + } + _spec.Node.Columns = iq.ctx.Fields + if len(iq.ctx.Fields) > 0 { + _spec.Unique = iq.ctx.Unique != nil && *iq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, iq.driver, _spec) +} + +func (iq *InviteQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(invite.Table, invite.Columns, sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString)) + _spec.From = iq.sql + if unique := iq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if iq.path != nil { + _spec.Unique = true + } + if fields := iq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, invite.FieldID) + for i := range fields { + if fields[i] != invite.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if iq.withOwner != nil { + _spec.Node.AddColumnOnce(invite.FieldOwnerID) + } + } + if ps := iq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := iq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := iq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := iq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (iq *InviteQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(iq.driver.Dialect()) + t1 := builder.Table(invite.Table) + columns := iq.ctx.Fields + if len(columns) == 0 { + columns = invite.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if iq.sql != nil { + selector = iq.sql + selector.Select(selector.Columns(columns...)...) + } + if iq.ctx.Unique != nil && *iq.ctx.Unique { + selector.Distinct() + } + t1.Schema(iq.schemaConfig.Invite) + ctx = internal.NewSchemaConfigContext(ctx, iq.schemaConfig) + selector.WithContext(ctx) + for _, p := range iq.predicates { + p(selector) + } + for _, p := range iq.order { + p(selector) + } + if offset := iq.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 := iq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (iq *InviteQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *InviteQuery { + query := (&EventClient{config: iq.config}).Query() + for _, opt := range opts { + opt(query) + } + if iq.withNamedEvents == nil { + iq.withNamedEvents = make(map[string]*EventQuery) + } + iq.withNamedEvents[name] = query + return iq +} + +// InviteGroupBy is the group-by builder for Invite entities. +type InviteGroupBy struct { + selector + build *InviteQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (igb *InviteGroupBy) Aggregate(fns ...AggregateFunc) *InviteGroupBy { + igb.fns = append(igb.fns, fns...) + return igb +} + +// Scan applies the selector query and scans the result into the given value. +func (igb *InviteGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, igb.build.ctx, ent.OpQueryGroupBy) + if err := igb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*InviteQuery, *InviteGroupBy](ctx, igb.build, igb, igb.build.inters, v) +} + +func (igb *InviteGroupBy) sqlScan(ctx context.Context, root *InviteQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(igb.fns)) + for _, fn := range igb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*igb.flds)+len(igb.fns)) + for _, f := range *igb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*igb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := igb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// InviteSelect is the builder for selecting fields of Invite entities. +type InviteSelect struct { + *InviteQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (is *InviteSelect) Aggregate(fns ...AggregateFunc) *InviteSelect { + is.fns = append(is.fns, fns...) + return is +} + +// Scan applies the selector query and scans the result into the given value. +func (is *InviteSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, is.ctx, ent.OpQuerySelect) + if err := is.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*InviteQuery, *InviteSelect](ctx, is.InviteQuery, is, is.inters, v) +} + +func (is *InviteSelect) sqlScan(ctx context.Context, root *InviteQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(is.fns)) + for _, fn := range is.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*is.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 := is.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/invite_update.go b/internal/ent/generated/invite_update.go new file mode 100644 index 0000000..f6fbe13 --- /dev/null +++ b/internal/ent/generated/invite_update.go @@ -0,0 +1,1009 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// InviteUpdate is the builder for updating Invite entities. +type InviteUpdate struct { + config + hooks []Hook + mutation *InviteMutation +} + +// Where appends a list predicates to the InviteUpdate builder. +func (iu *InviteUpdate) Where(ps ...predicate.Invite) *InviteUpdate { + iu.mutation.Where(ps...) + return iu +} + +// SetUpdatedAt sets the "updated_at" field. +func (iu *InviteUpdate) SetUpdatedAt(t time.Time) *InviteUpdate { + iu.mutation.SetUpdatedAt(t) + return iu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (iu *InviteUpdate) ClearUpdatedAt() *InviteUpdate { + iu.mutation.ClearUpdatedAt() + return iu +} + +// SetUpdatedBy sets the "updated_by" field. +func (iu *InviteUpdate) SetUpdatedBy(s string) *InviteUpdate { + iu.mutation.SetUpdatedBy(s) + return iu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableUpdatedBy(s *string) *InviteUpdate { + if s != nil { + iu.SetUpdatedBy(*s) + } + return iu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (iu *InviteUpdate) ClearUpdatedBy() *InviteUpdate { + iu.mutation.ClearUpdatedBy() + return iu +} + +// SetDeletedAt sets the "deleted_at" field. +func (iu *InviteUpdate) SetDeletedAt(t time.Time) *InviteUpdate { + iu.mutation.SetDeletedAt(t) + return iu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableDeletedAt(t *time.Time) *InviteUpdate { + if t != nil { + iu.SetDeletedAt(*t) + } + return iu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (iu *InviteUpdate) ClearDeletedAt() *InviteUpdate { + iu.mutation.ClearDeletedAt() + return iu +} + +// SetDeletedBy sets the "deleted_by" field. +func (iu *InviteUpdate) SetDeletedBy(s string) *InviteUpdate { + iu.mutation.SetDeletedBy(s) + return iu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableDeletedBy(s *string) *InviteUpdate { + if s != nil { + iu.SetDeletedBy(*s) + } + return iu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (iu *InviteUpdate) ClearDeletedBy() *InviteUpdate { + iu.mutation.ClearDeletedBy() + return iu +} + +// SetOwnerID sets the "owner_id" field. +func (iu *InviteUpdate) SetOwnerID(s string) *InviteUpdate { + iu.mutation.SetOwnerID(s) + return iu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableOwnerID(s *string) *InviteUpdate { + if s != nil { + iu.SetOwnerID(*s) + } + return iu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (iu *InviteUpdate) ClearOwnerID() *InviteUpdate { + iu.mutation.ClearOwnerID() + return iu +} + +// SetToken sets the "token" field. +func (iu *InviteUpdate) SetToken(s string) *InviteUpdate { + iu.mutation.SetToken(s) + return iu +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableToken(s *string) *InviteUpdate { + if s != nil { + iu.SetToken(*s) + } + return iu +} + +// SetExpires sets the "expires" field. +func (iu *InviteUpdate) SetExpires(t time.Time) *InviteUpdate { + iu.mutation.SetExpires(t) + return iu +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableExpires(t *time.Time) *InviteUpdate { + if t != nil { + iu.SetExpires(*t) + } + return iu +} + +// ClearExpires clears the value of the "expires" field. +func (iu *InviteUpdate) ClearExpires() *InviteUpdate { + iu.mutation.ClearExpires() + return iu +} + +// SetStatus sets the "status" field. +func (iu *InviteUpdate) SetStatus(es enums.InviteStatus) *InviteUpdate { + iu.mutation.SetStatus(es) + return iu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableStatus(es *enums.InviteStatus) *InviteUpdate { + if es != nil { + iu.SetStatus(*es) + } + return iu +} + +// SetRole sets the "role" field. +func (iu *InviteUpdate) SetRole(e enums.Role) *InviteUpdate { + iu.mutation.SetRole(e) + return iu +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableRole(e *enums.Role) *InviteUpdate { + if e != nil { + iu.SetRole(*e) + } + return iu +} + +// SetSendAttempts sets the "send_attempts" field. +func (iu *InviteUpdate) SetSendAttempts(i int) *InviteUpdate { + iu.mutation.ResetSendAttempts() + iu.mutation.SetSendAttempts(i) + return iu +} + +// SetNillableSendAttempts sets the "send_attempts" field if the given value is not nil. +func (iu *InviteUpdate) SetNillableSendAttempts(i *int) *InviteUpdate { + if i != nil { + iu.SetSendAttempts(*i) + } + return iu +} + +// AddSendAttempts adds i to the "send_attempts" field. +func (iu *InviteUpdate) AddSendAttempts(i int) *InviteUpdate { + iu.mutation.AddSendAttempts(i) + return iu +} + +// SetSecret sets the "secret" field. +func (iu *InviteUpdate) SetSecret(b []byte) *InviteUpdate { + iu.mutation.SetSecret(b) + return iu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (iu *InviteUpdate) SetOwner(o *Organization) *InviteUpdate { + return iu.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (iu *InviteUpdate) AddEventIDs(ids ...string) *InviteUpdate { + iu.mutation.AddEventIDs(ids...) + return iu +} + +// AddEvents adds the "events" edges to the Event entity. +func (iu *InviteUpdate) AddEvents(e ...*Event) *InviteUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iu.AddEventIDs(ids...) +} + +// Mutation returns the InviteMutation object of the builder. +func (iu *InviteUpdate) Mutation() *InviteMutation { + return iu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (iu *InviteUpdate) ClearOwner() *InviteUpdate { + iu.mutation.ClearOwner() + return iu +} + +// ClearEvents clears all "events" edges to the Event entity. +func (iu *InviteUpdate) ClearEvents() *InviteUpdate { + iu.mutation.ClearEvents() + return iu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (iu *InviteUpdate) RemoveEventIDs(ids ...string) *InviteUpdate { + iu.mutation.RemoveEventIDs(ids...) + return iu +} + +// RemoveEvents removes "events" edges to Event entities. +func (iu *InviteUpdate) RemoveEvents(e ...*Event) *InviteUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (iu *InviteUpdate) Save(ctx context.Context) (int, error) { + if err := iu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, iu.sqlSave, iu.mutation, iu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (iu *InviteUpdate) SaveX(ctx context.Context) int { + affected, err := iu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (iu *InviteUpdate) Exec(ctx context.Context) error { + _, err := iu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (iu *InviteUpdate) ExecX(ctx context.Context) { + if err := iu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (iu *InviteUpdate) defaults() error { + if _, ok := iu.mutation.UpdatedAt(); !ok && !iu.mutation.UpdatedAtCleared() { + if invite.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized invite.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := invite.UpdateDefaultUpdatedAt() + iu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (iu *InviteUpdate) check() error { + if v, ok := iu.mutation.OwnerID(); ok { + if err := invite.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Invite.owner_id": %w`, err)} + } + } + if v, ok := iu.mutation.Token(); ok { + if err := invite.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "Invite.token": %w`, err)} + } + } + if v, ok := iu.mutation.Status(); ok { + if err := invite.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "Invite.status": %w`, err)} + } + } + if v, ok := iu.mutation.Role(); ok { + if err := invite.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "Invite.role": %w`, err)} + } + } + if v, ok := iu.mutation.Secret(); ok { + if err := invite.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "Invite.secret": %w`, err)} + } + } + return nil +} + +func (iu *InviteUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := iu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(invite.Table, invite.Columns, sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString)) + if ps := iu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if iu.mutation.CreatedAtCleared() { + _spec.ClearField(invite.FieldCreatedAt, field.TypeTime) + } + if value, ok := iu.mutation.UpdatedAt(); ok { + _spec.SetField(invite.FieldUpdatedAt, field.TypeTime, value) + } + if iu.mutation.UpdatedAtCleared() { + _spec.ClearField(invite.FieldUpdatedAt, field.TypeTime) + } + if iu.mutation.CreatedByCleared() { + _spec.ClearField(invite.FieldCreatedBy, field.TypeString) + } + if value, ok := iu.mutation.UpdatedBy(); ok { + _spec.SetField(invite.FieldUpdatedBy, field.TypeString, value) + } + if iu.mutation.UpdatedByCleared() { + _spec.ClearField(invite.FieldUpdatedBy, field.TypeString) + } + if value, ok := iu.mutation.DeletedAt(); ok { + _spec.SetField(invite.FieldDeletedAt, field.TypeTime, value) + } + if iu.mutation.DeletedAtCleared() { + _spec.ClearField(invite.FieldDeletedAt, field.TypeTime) + } + if value, ok := iu.mutation.DeletedBy(); ok { + _spec.SetField(invite.FieldDeletedBy, field.TypeString, value) + } + if iu.mutation.DeletedByCleared() { + _spec.ClearField(invite.FieldDeletedBy, field.TypeString) + } + if value, ok := iu.mutation.Token(); ok { + _spec.SetField(invite.FieldToken, field.TypeString, value) + } + if value, ok := iu.mutation.Expires(); ok { + _spec.SetField(invite.FieldExpires, field.TypeTime, value) + } + if iu.mutation.ExpiresCleared() { + _spec.ClearField(invite.FieldExpires, field.TypeTime) + } + if value, ok := iu.mutation.Status(); ok { + _spec.SetField(invite.FieldStatus, field.TypeEnum, value) + } + if value, ok := iu.mutation.Role(); ok { + _spec.SetField(invite.FieldRole, field.TypeEnum, value) + } + if value, ok := iu.mutation.SendAttempts(); ok { + _spec.SetField(invite.FieldSendAttempts, field.TypeInt, value) + } + if value, ok := iu.mutation.AddedSendAttempts(); ok { + _spec.AddField(invite.FieldSendAttempts, field.TypeInt, value) + } + if iu.mutation.RequestorIDCleared() { + _spec.ClearField(invite.FieldRequestorID, field.TypeString) + } + if value, ok := iu.mutation.Secret(); ok { + _spec.SetField(invite.FieldSecret, field.TypeBytes, value) + } + if iu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: invite.OwnerTable, + Columns: []string{invite.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.Invite + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: invite.OwnerTable, + Columns: []string{invite.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.InviteEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !iu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iu.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = iu.schemaConfig.Invite + ctx = internal.NewSchemaConfigContext(ctx, iu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, iu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{invite.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + iu.mutation.done = true + return n, nil +} + +// InviteUpdateOne is the builder for updating a single Invite entity. +type InviteUpdateOne struct { + config + fields []string + hooks []Hook + mutation *InviteMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (iuo *InviteUpdateOne) SetUpdatedAt(t time.Time) *InviteUpdateOne { + iuo.mutation.SetUpdatedAt(t) + return iuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (iuo *InviteUpdateOne) ClearUpdatedAt() *InviteUpdateOne { + iuo.mutation.ClearUpdatedAt() + return iuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (iuo *InviteUpdateOne) SetUpdatedBy(s string) *InviteUpdateOne { + iuo.mutation.SetUpdatedBy(s) + return iuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableUpdatedBy(s *string) *InviteUpdateOne { + if s != nil { + iuo.SetUpdatedBy(*s) + } + return iuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (iuo *InviteUpdateOne) ClearUpdatedBy() *InviteUpdateOne { + iuo.mutation.ClearUpdatedBy() + return iuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (iuo *InviteUpdateOne) SetDeletedAt(t time.Time) *InviteUpdateOne { + iuo.mutation.SetDeletedAt(t) + return iuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableDeletedAt(t *time.Time) *InviteUpdateOne { + if t != nil { + iuo.SetDeletedAt(*t) + } + return iuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (iuo *InviteUpdateOne) ClearDeletedAt() *InviteUpdateOne { + iuo.mutation.ClearDeletedAt() + return iuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (iuo *InviteUpdateOne) SetDeletedBy(s string) *InviteUpdateOne { + iuo.mutation.SetDeletedBy(s) + return iuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableDeletedBy(s *string) *InviteUpdateOne { + if s != nil { + iuo.SetDeletedBy(*s) + } + return iuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (iuo *InviteUpdateOne) ClearDeletedBy() *InviteUpdateOne { + iuo.mutation.ClearDeletedBy() + return iuo +} + +// SetOwnerID sets the "owner_id" field. +func (iuo *InviteUpdateOne) SetOwnerID(s string) *InviteUpdateOne { + iuo.mutation.SetOwnerID(s) + return iuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableOwnerID(s *string) *InviteUpdateOne { + if s != nil { + iuo.SetOwnerID(*s) + } + return iuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (iuo *InviteUpdateOne) ClearOwnerID() *InviteUpdateOne { + iuo.mutation.ClearOwnerID() + return iuo +} + +// SetToken sets the "token" field. +func (iuo *InviteUpdateOne) SetToken(s string) *InviteUpdateOne { + iuo.mutation.SetToken(s) + return iuo +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableToken(s *string) *InviteUpdateOne { + if s != nil { + iuo.SetToken(*s) + } + return iuo +} + +// SetExpires sets the "expires" field. +func (iuo *InviteUpdateOne) SetExpires(t time.Time) *InviteUpdateOne { + iuo.mutation.SetExpires(t) + return iuo +} + +// SetNillableExpires sets the "expires" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableExpires(t *time.Time) *InviteUpdateOne { + if t != nil { + iuo.SetExpires(*t) + } + return iuo +} + +// ClearExpires clears the value of the "expires" field. +func (iuo *InviteUpdateOne) ClearExpires() *InviteUpdateOne { + iuo.mutation.ClearExpires() + return iuo +} + +// SetStatus sets the "status" field. +func (iuo *InviteUpdateOne) SetStatus(es enums.InviteStatus) *InviteUpdateOne { + iuo.mutation.SetStatus(es) + return iuo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableStatus(es *enums.InviteStatus) *InviteUpdateOne { + if es != nil { + iuo.SetStatus(*es) + } + return iuo +} + +// SetRole sets the "role" field. +func (iuo *InviteUpdateOne) SetRole(e enums.Role) *InviteUpdateOne { + iuo.mutation.SetRole(e) + return iuo +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableRole(e *enums.Role) *InviteUpdateOne { + if e != nil { + iuo.SetRole(*e) + } + return iuo +} + +// SetSendAttempts sets the "send_attempts" field. +func (iuo *InviteUpdateOne) SetSendAttempts(i int) *InviteUpdateOne { + iuo.mutation.ResetSendAttempts() + iuo.mutation.SetSendAttempts(i) + return iuo +} + +// SetNillableSendAttempts sets the "send_attempts" field if the given value is not nil. +func (iuo *InviteUpdateOne) SetNillableSendAttempts(i *int) *InviteUpdateOne { + if i != nil { + iuo.SetSendAttempts(*i) + } + return iuo +} + +// AddSendAttempts adds i to the "send_attempts" field. +func (iuo *InviteUpdateOne) AddSendAttempts(i int) *InviteUpdateOne { + iuo.mutation.AddSendAttempts(i) + return iuo +} + +// SetSecret sets the "secret" field. +func (iuo *InviteUpdateOne) SetSecret(b []byte) *InviteUpdateOne { + iuo.mutation.SetSecret(b) + return iuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (iuo *InviteUpdateOne) SetOwner(o *Organization) *InviteUpdateOne { + return iuo.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (iuo *InviteUpdateOne) AddEventIDs(ids ...string) *InviteUpdateOne { + iuo.mutation.AddEventIDs(ids...) + return iuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (iuo *InviteUpdateOne) AddEvents(e ...*Event) *InviteUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iuo.AddEventIDs(ids...) +} + +// Mutation returns the InviteMutation object of the builder. +func (iuo *InviteUpdateOne) Mutation() *InviteMutation { + return iuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (iuo *InviteUpdateOne) ClearOwner() *InviteUpdateOne { + iuo.mutation.ClearOwner() + return iuo +} + +// ClearEvents clears all "events" edges to the Event entity. +func (iuo *InviteUpdateOne) ClearEvents() *InviteUpdateOne { + iuo.mutation.ClearEvents() + return iuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (iuo *InviteUpdateOne) RemoveEventIDs(ids ...string) *InviteUpdateOne { + iuo.mutation.RemoveEventIDs(ids...) + return iuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (iuo *InviteUpdateOne) RemoveEvents(e ...*Event) *InviteUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return iuo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the InviteUpdate builder. +func (iuo *InviteUpdateOne) Where(ps ...predicate.Invite) *InviteUpdateOne { + iuo.mutation.Where(ps...) + return iuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (iuo *InviteUpdateOne) Select(field string, fields ...string) *InviteUpdateOne { + iuo.fields = append([]string{field}, fields...) + return iuo +} + +// Save executes the query and returns the updated Invite entity. +func (iuo *InviteUpdateOne) Save(ctx context.Context) (*Invite, error) { + if err := iuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, iuo.sqlSave, iuo.mutation, iuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (iuo *InviteUpdateOne) SaveX(ctx context.Context) *Invite { + node, err := iuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (iuo *InviteUpdateOne) Exec(ctx context.Context) error { + _, err := iuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (iuo *InviteUpdateOne) ExecX(ctx context.Context) { + if err := iuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (iuo *InviteUpdateOne) defaults() error { + if _, ok := iuo.mutation.UpdatedAt(); !ok && !iuo.mutation.UpdatedAtCleared() { + if invite.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized invite.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := invite.UpdateDefaultUpdatedAt() + iuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (iuo *InviteUpdateOne) check() error { + if v, ok := iuo.mutation.OwnerID(); ok { + if err := invite.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Invite.owner_id": %w`, err)} + } + } + if v, ok := iuo.mutation.Token(); ok { + if err := invite.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "Invite.token": %w`, err)} + } + } + if v, ok := iuo.mutation.Status(); ok { + if err := invite.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "Invite.status": %w`, err)} + } + } + if v, ok := iuo.mutation.Role(); ok { + if err := invite.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "Invite.role": %w`, err)} + } + } + if v, ok := iuo.mutation.Secret(); ok { + if err := invite.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "Invite.secret": %w`, err)} + } + } + return nil +} + +func (iuo *InviteUpdateOne) sqlSave(ctx context.Context) (_node *Invite, err error) { + if err := iuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(invite.Table, invite.Columns, sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString)) + id, ok := iuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Invite.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := iuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, invite.FieldID) + for _, f := range fields { + if !invite.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != invite.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := iuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if iuo.mutation.CreatedAtCleared() { + _spec.ClearField(invite.FieldCreatedAt, field.TypeTime) + } + if value, ok := iuo.mutation.UpdatedAt(); ok { + _spec.SetField(invite.FieldUpdatedAt, field.TypeTime, value) + } + if iuo.mutation.UpdatedAtCleared() { + _spec.ClearField(invite.FieldUpdatedAt, field.TypeTime) + } + if iuo.mutation.CreatedByCleared() { + _spec.ClearField(invite.FieldCreatedBy, field.TypeString) + } + if value, ok := iuo.mutation.UpdatedBy(); ok { + _spec.SetField(invite.FieldUpdatedBy, field.TypeString, value) + } + if iuo.mutation.UpdatedByCleared() { + _spec.ClearField(invite.FieldUpdatedBy, field.TypeString) + } + if value, ok := iuo.mutation.DeletedAt(); ok { + _spec.SetField(invite.FieldDeletedAt, field.TypeTime, value) + } + if iuo.mutation.DeletedAtCleared() { + _spec.ClearField(invite.FieldDeletedAt, field.TypeTime) + } + if value, ok := iuo.mutation.DeletedBy(); ok { + _spec.SetField(invite.FieldDeletedBy, field.TypeString, value) + } + if iuo.mutation.DeletedByCleared() { + _spec.ClearField(invite.FieldDeletedBy, field.TypeString) + } + if value, ok := iuo.mutation.Token(); ok { + _spec.SetField(invite.FieldToken, field.TypeString, value) + } + if value, ok := iuo.mutation.Expires(); ok { + _spec.SetField(invite.FieldExpires, field.TypeTime, value) + } + if iuo.mutation.ExpiresCleared() { + _spec.ClearField(invite.FieldExpires, field.TypeTime) + } + if value, ok := iuo.mutation.Status(); ok { + _spec.SetField(invite.FieldStatus, field.TypeEnum, value) + } + if value, ok := iuo.mutation.Role(); ok { + _spec.SetField(invite.FieldRole, field.TypeEnum, value) + } + if value, ok := iuo.mutation.SendAttempts(); ok { + _spec.SetField(invite.FieldSendAttempts, field.TypeInt, value) + } + if value, ok := iuo.mutation.AddedSendAttempts(); ok { + _spec.AddField(invite.FieldSendAttempts, field.TypeInt, value) + } + if iuo.mutation.RequestorIDCleared() { + _spec.ClearField(invite.FieldRequestorID, field.TypeString) + } + if value, ok := iuo.mutation.Secret(); ok { + _spec.SetField(invite.FieldSecret, field.TypeBytes, value) + } + if iuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: invite.OwnerTable, + Columns: []string{invite.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.Invite + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: invite.OwnerTable, + Columns: []string{invite.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if iuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.InviteEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !iuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := iuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: invite.EventsTable, + Columns: invite.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = iuo.schemaConfig.InviteEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = iuo.schemaConfig.Invite + ctx = internal.NewSchemaConfigContext(ctx, iuo.schemaConfig) + _node = &Invite{config: iuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, iuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{invite.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + iuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/migrate/migrate.go b/internal/ent/generated/migrate/migrate.go new file mode 100644 index 0000000..d8d3bcb --- /dev/null +++ b/internal/ent/generated/migrate/migrate.go @@ -0,0 +1,96 @@ +// Code generated by ent, DO NOT EDIT. + +package migrate + +import ( + "context" + "fmt" + "io" + + "entgo.io/ent/dialect" + "entgo.io/ent/dialect/sql/schema" +) + +var ( + // WithGlobalUniqueID sets the universal ids options to the migration. + // If this option is enabled, ent migration will allocate a 1<<32 range + // for the ids of each entity (table). + // Note that this option cannot be applied on tables that already exist. + WithGlobalUniqueID = schema.WithGlobalUniqueID + // WithDropColumn sets the drop column option to the migration. + // If this option is enabled, ent migration will drop old columns + // that were used for both fields and edges. This defaults to false. + WithDropColumn = schema.WithDropColumn + // WithDropIndex sets the drop index option to the migration. + // If this option is enabled, ent migration will drop old indexes + // that were defined in the schema. This defaults to false. + // Note that unique constraints are defined using `UNIQUE INDEX`, + // and therefore, it's recommended to enable this option to get more + // flexibility in the schema changes. + WithDropIndex = schema.WithDropIndex + // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true. + WithForeignKeys = schema.WithForeignKeys +) + +// Schema is the API for creating, migrating and dropping a schema. +type Schema struct { + drv dialect.Driver +} + +// NewSchema creates a new schema client. +func NewSchema(drv dialect.Driver) *Schema { return &Schema{drv: drv} } + +// Create creates all schema resources. +func (s *Schema) Create(ctx context.Context, opts ...schema.MigrateOption) error { + return Create(ctx, s, Tables, opts...) +} + +// Create creates all table resources using the given schema driver. +func Create(ctx context.Context, s *Schema, tables []*schema.Table, opts ...schema.MigrateOption) error { + migrate, err := schema.NewMigrate(s.drv, opts...) + if err != nil { + return fmt.Errorf("ent/migrate: %w", err) + } + return migrate.Create(ctx, tables...) +} + +// Diff compares the state read from a database connection or migration directory with +// the state defined by the Ent schema. Changes will be written to new migration files. +func Diff(ctx context.Context, url string, opts ...schema.MigrateOption) error { + return NamedDiff(ctx, url, "changes", opts...) +} + +// NamedDiff compares the state read from a database connection or migration directory with +// the state defined by the Ent schema. Changes will be written to new named migration files. +func NamedDiff(ctx context.Context, url, name string, opts ...schema.MigrateOption) error { + return schema.Diff(ctx, url, name, Tables, opts...) +} + +// Diff creates a migration file containing the statements to resolve the diff +// between the Ent schema and the connected database. +func (s *Schema) Diff(ctx context.Context, opts ...schema.MigrateOption) error { + migrate, err := schema.NewMigrate(s.drv, opts...) + if err != nil { + return fmt.Errorf("ent/migrate: %w", err) + } + return migrate.Diff(ctx, Tables...) +} + +// NamedDiff creates a named migration file containing the statements to resolve the diff +// between the Ent schema and the connected database. +func (s *Schema) NamedDiff(ctx context.Context, name string, opts ...schema.MigrateOption) error { + migrate, err := schema.NewMigrate(s.drv, opts...) + if err != nil { + return fmt.Errorf("ent/migrate: %w", err) + } + return migrate.NamedDiff(ctx, name, Tables...) +} + +// WriteTo writes the schema changes to w instead of running them against the database. +// +// if err := client.Schema.WriteTo(context.Background(), os.Stdout); err != nil { +// log.Fatal(err) +// } +func (s *Schema) WriteTo(ctx context.Context, w io.Writer, opts ...schema.MigrateOption) error { + return Create(ctx, &Schema{drv: &schema.WriteDriver{Writer: w, Driver: s.drv}}, Tables, opts...) +} diff --git a/internal/ent/generated/migrate/schema.go b/internal/ent/generated/migrate/schema.go new file mode 100644 index 0000000..1530783 --- /dev/null +++ b/internal/ent/generated/migrate/schema.go @@ -0,0 +1,3033 @@ +// Code generated by ent, DO NOT EDIT. + +package migrate + +import ( + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/dialect/sql/schema" + "entgo.io/ent/schema/field" +) + +var ( + // APITokensColumns holds the columns for the "api_tokens" table. + APITokensColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "token", Type: field.TypeString, Unique: true}, + {Name: "expires_at", Type: field.TypeTime, Nullable: true}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "scopes", Type: field.TypeJSON, Nullable: true}, + {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // APITokensTable holds the schema information for the "api_tokens" table. + APITokensTable = &schema.Table{ + Name: "api_tokens", + Columns: APITokensColumns, + PrimaryKey: []*schema.Column{APITokensColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "api_tokens_organizations_api_tokens", + Columns: []*schema.Column{APITokensColumns[15]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "apitoken_token", + Unique: false, + Columns: []*schema.Column{APITokensColumns[10]}, + }, + }, + } + // ContactsColumns holds the columns for the "contacts" table. + ContactsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "full_name", Type: field.TypeString, Size: 64}, + {Name: "title", Type: field.TypeString, Nullable: true}, + {Name: "company", Type: field.TypeString, Nullable: true}, + {Name: "email", Type: field.TypeString, Nullable: true}, + {Name: "phone_number", Type: field.TypeString, Nullable: true}, + {Name: "address", Type: field.TypeString, Nullable: true}, + {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // ContactsTable holds the schema information for the "contacts" table. + ContactsTable = &schema.Table{ + Name: "contacts", + Columns: ContactsColumns, + PrimaryKey: []*schema.Column{ContactsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "contacts_organizations_contacts", + Columns: []*schema.Column{ContactsColumns[16]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // ContactHistoryColumns holds the columns for the "contact_history" table. + ContactHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "full_name", Type: field.TypeString, Size: 64}, + {Name: "title", Type: field.TypeString, Nullable: true}, + {Name: "company", Type: field.TypeString, Nullable: true}, + {Name: "email", Type: field.TypeString, Nullable: true}, + {Name: "phone_number", Type: field.TypeString, Nullable: true}, + {Name: "address", Type: field.TypeString, Nullable: true}, + {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, + } + // ContactHistoryTable holds the schema information for the "contact_history" table. + ContactHistoryTable = &schema.Table{ + Name: "contact_history", + Columns: ContactHistoryColumns, + PrimaryKey: []*schema.Column{ContactHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "contacthistory_history_time", + Unique: false, + Columns: []*schema.Column{ContactHistoryColumns[1]}, + }, + }, + } + // DocumentDataColumns holds the columns for the "document_data" table. + DocumentDataColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "data", Type: field.TypeJSON}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "template_id", Type: field.TypeString}, + } + // DocumentDataTable holds the schema information for the "document_data" table. + DocumentDataTable = &schema.Table{ + Name: "document_data", + Columns: DocumentDataColumns, + PrimaryKey: []*schema.Column{DocumentDataColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "document_data_organizations_documentdata", + Columns: []*schema.Column{DocumentDataColumns[10]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + { + Symbol: "document_data_templates_documents", + Columns: []*schema.Column{DocumentDataColumns[11]}, + RefColumns: []*schema.Column{TemplatesColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + } + // DocumentDataHistoryColumns holds the columns for the "document_data_history" table. + DocumentDataHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "template_id", Type: field.TypeString}, + {Name: "data", Type: field.TypeJSON}, + } + // DocumentDataHistoryTable holds the schema information for the "document_data_history" table. + DocumentDataHistoryTable = &schema.Table{ + Name: "document_data_history", + Columns: DocumentDataHistoryColumns, + PrimaryKey: []*schema.Column{DocumentDataHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "documentdatahistory_history_time", + Unique: false, + Columns: []*schema.Column{DocumentDataHistoryColumns[1]}, + }, + }, + } + // EmailVerificationTokensColumns holds the columns for the "email_verification_tokens" table. + EmailVerificationTokensColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "token", Type: field.TypeString, Unique: true}, + {Name: "ttl", Type: field.TypeTime}, + {Name: "email", Type: field.TypeString}, + {Name: "secret", Type: field.TypeBytes}, + {Name: "owner_id", Type: field.TypeString}, + } + // EmailVerificationTokensTable holds the schema information for the "email_verification_tokens" table. + EmailVerificationTokensTable = &schema.Table{ + Name: "email_verification_tokens", + Columns: EmailVerificationTokensColumns, + PrimaryKey: []*schema.Column{EmailVerificationTokensColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "email_verification_tokens_users_email_verification_tokens", + Columns: []*schema.Column{EmailVerificationTokensColumns[12]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + Indexes: []*schema.Index{ + { + Name: "emailverificationtoken_token", + Unique: true, + Columns: []*schema.Column{EmailVerificationTokensColumns[8]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // EntitlementsColumns holds the columns for the "entitlements" table. + EntitlementsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "external_customer_id", Type: field.TypeString, Nullable: true}, + {Name: "external_subscription_id", Type: field.TypeString, Nullable: true}, + {Name: "expires", Type: field.TypeBool, Default: false}, + {Name: "expires_at", Type: field.TypeTime, Nullable: true}, + {Name: "cancelled", Type: field.TypeBool, Default: false}, + {Name: "plan_id", Type: field.TypeString}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "organization_id", Type: field.TypeString}, + } + // EntitlementsTable holds the schema information for the "entitlements" table. + EntitlementsTable = &schema.Table{ + Name: "entitlements", + Columns: EntitlementsColumns, + PrimaryKey: []*schema.Column{EntitlementsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entitlements_entitlement_plans_entitlements", + Columns: []*schema.Column{EntitlementsColumns[14]}, + RefColumns: []*schema.Column{EntitlementPlansColumns[0]}, + OnDelete: schema.NoAction, + }, + { + Symbol: "entitlements_organizations_entitlements", + Columns: []*schema.Column{EntitlementsColumns[15]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + { + Symbol: "entitlements_organizations_organization_entitlement", + Columns: []*schema.Column{EntitlementsColumns[16]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + Indexes: []*schema.Index{ + { + Name: "entitlement_organization_id_owner_id", + Unique: true, + Columns: []*schema.Column{EntitlementsColumns[16], EntitlementsColumns[15]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL and cancelled = false", + }, + }, + }, + } + // EntitlementHistoryColumns holds the columns for the "entitlement_history" table. + EntitlementHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "plan_id", Type: field.TypeString}, + {Name: "organization_id", Type: field.TypeString}, + {Name: "external_customer_id", Type: field.TypeString, Nullable: true}, + {Name: "external_subscription_id", Type: field.TypeString, Nullable: true}, + {Name: "expires", Type: field.TypeBool, Default: false}, + {Name: "expires_at", Type: field.TypeTime, Nullable: true}, + {Name: "cancelled", Type: field.TypeBool, Default: false}, + } + // EntitlementHistoryTable holds the schema information for the "entitlement_history" table. + EntitlementHistoryTable = &schema.Table{ + Name: "entitlement_history", + Columns: EntitlementHistoryColumns, + PrimaryKey: []*schema.Column{EntitlementHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "entitlementhistory_history_time", + Unique: false, + Columns: []*schema.Column{EntitlementHistoryColumns[1]}, + }, + }, + } + // EntitlementPlansColumns holds the columns for the "entitlement_plans" table. + EntitlementPlansColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "display_name", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "version", Type: field.TypeString}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // EntitlementPlansTable holds the schema information for the "entitlement_plans" table. + EntitlementPlansTable = &schema.Table{ + Name: "entitlement_plans", + Columns: EntitlementPlansColumns, + PrimaryKey: []*schema.Column{EntitlementPlansColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entitlement_plans_organizations_entitlementplans", + Columns: []*schema.Column{EntitlementPlansColumns[14]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "entitlementplan_name_version_owner_id", + Unique: true, + Columns: []*schema.Column{EntitlementPlansColumns[10], EntitlementPlansColumns[12], EntitlementPlansColumns[14]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // EntitlementPlanFeaturesColumns holds the columns for the "entitlement_plan_features" table. + EntitlementPlanFeaturesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + {Name: "plan_id", Type: field.TypeString}, + {Name: "feature_id", Type: field.TypeString}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // EntitlementPlanFeaturesTable holds the schema information for the "entitlement_plan_features" table. + EntitlementPlanFeaturesTable = &schema.Table{ + Name: "entitlement_plan_features", + Columns: EntitlementPlanFeaturesColumns, + PrimaryKey: []*schema.Column{EntitlementPlanFeaturesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entitlement_plan_features_entitlement_plans_plan", + Columns: []*schema.Column{EntitlementPlanFeaturesColumns[10]}, + RefColumns: []*schema.Column{EntitlementPlansColumns[0]}, + OnDelete: schema.NoAction, + }, + { + Symbol: "entitlement_plan_features_features_feature", + Columns: []*schema.Column{EntitlementPlanFeaturesColumns[11]}, + RefColumns: []*schema.Column{FeaturesColumns[0]}, + OnDelete: schema.NoAction, + }, + { + Symbol: "entitlement_plan_features_organizations_entitlementplanfeatures", + Columns: []*schema.Column{EntitlementPlanFeaturesColumns[12]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "entitlementplanfeature_feature_id_plan_id", + Unique: true, + Columns: []*schema.Column{EntitlementPlanFeaturesColumns[11], EntitlementPlanFeaturesColumns[10]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // EntitlementPlanFeatureHistoryColumns holds the columns for the "entitlement_plan_feature_history" table. + EntitlementPlanFeatureHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + {Name: "plan_id", Type: field.TypeString}, + {Name: "feature_id", Type: field.TypeString}, + } + // EntitlementPlanFeatureHistoryTable holds the schema information for the "entitlement_plan_feature_history" table. + EntitlementPlanFeatureHistoryTable = &schema.Table{ + Name: "entitlement_plan_feature_history", + Columns: EntitlementPlanFeatureHistoryColumns, + PrimaryKey: []*schema.Column{EntitlementPlanFeatureHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "entitlementplanfeaturehistory_history_time", + Unique: false, + Columns: []*schema.Column{EntitlementPlanFeatureHistoryColumns[1]}, + }, + }, + } + // EntitlementPlanHistoryColumns holds the columns for the "entitlement_plan_history" table. + EntitlementPlanHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "display_name", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "version", Type: field.TypeString}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + } + // EntitlementPlanHistoryTable holds the schema information for the "entitlement_plan_history" table. + EntitlementPlanHistoryTable = &schema.Table{ + Name: "entitlement_plan_history", + Columns: EntitlementPlanHistoryColumns, + PrimaryKey: []*schema.Column{EntitlementPlanHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "entitlementplanhistory_history_time", + Unique: false, + Columns: []*schema.Column{EntitlementPlanHistoryColumns[1]}, + }, + }, + } + // EntitiesColumns holds the columns for the "entities" table. + EntitiesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "name", Type: field.TypeString, Nullable: true, Size: 160}, + {Name: "display_name", Type: field.TypeString, Nullable: true, Size: 64}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "domains", Type: field.TypeJSON, Nullable: true}, + {Name: "status", Type: field.TypeString, Nullable: true, Default: "active"}, + {Name: "entity_type_id", Type: field.TypeString, Nullable: true}, + {Name: "entity_type_entities", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // EntitiesTable holds the schema information for the "entities" table. + EntitiesTable = &schema.Table{ + Name: "entities", + Columns: EntitiesColumns, + PrimaryKey: []*schema.Column{EntitiesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entities_entity_types_entity_type", + Columns: []*schema.Column{EntitiesColumns[14]}, + RefColumns: []*schema.Column{EntityTypesColumns[0]}, + OnDelete: schema.SetNull, + }, + { + Symbol: "entities_entity_types_entities", + Columns: []*schema.Column{EntitiesColumns[15]}, + RefColumns: []*schema.Column{EntityTypesColumns[0]}, + OnDelete: schema.SetNull, + }, + { + Symbol: "entities_organizations_entities", + Columns: []*schema.Column{EntitiesColumns[16]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "entity_name_owner_id", + Unique: true, + Columns: []*schema.Column{EntitiesColumns[9], EntitiesColumns[16]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // EntityHistoryColumns holds the columns for the "entity_history" table. + EntityHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString, Nullable: true, Size: 160}, + {Name: "display_name", Type: field.TypeString, Nullable: true, Size: 64}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "domains", Type: field.TypeJSON, Nullable: true}, + {Name: "entity_type_id", Type: field.TypeString, Nullable: true}, + {Name: "status", Type: field.TypeString, Nullable: true, Default: "active"}, + } + // EntityHistoryTable holds the schema information for the "entity_history" table. + EntityHistoryTable = &schema.Table{ + Name: "entity_history", + Columns: EntityHistoryColumns, + PrimaryKey: []*schema.Column{EntityHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "entityhistory_history_time", + Unique: false, + Columns: []*schema.Column{EntityHistoryColumns[1]}, + }, + }, + } + // EntityTypesColumns holds the columns for the "entity_types" table. + EntityTypesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "name", Type: field.TypeString, Size: 64}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // EntityTypesTable holds the schema information for the "entity_types" table. + EntityTypesTable = &schema.Table{ + Name: "entity_types", + Columns: EntityTypesColumns, + PrimaryKey: []*schema.Column{EntityTypesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entity_types_organizations_entitytypes", + Columns: []*schema.Column{EntityTypesColumns[10]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "entitytype_name_owner_id", + Unique: true, + Columns: []*schema.Column{EntityTypesColumns[9], EntityTypesColumns[10]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // EntityTypeHistoryColumns holds the columns for the "entity_type_history" table. + EntityTypeHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString, Size: 64}, + } + // EntityTypeHistoryTable holds the schema information for the "entity_type_history" table. + EntityTypeHistoryTable = &schema.Table{ + Name: "entity_type_history", + Columns: EntityTypeHistoryColumns, + PrimaryKey: []*schema.Column{EntityTypeHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "entitytypehistory_history_time", + Unique: false, + Columns: []*schema.Column{EntityTypeHistoryColumns[1]}, + }, + }, + } + // EventsColumns holds the columns for the "events" table. + EventsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "event_id", Type: field.TypeString, Nullable: true}, + {Name: "correlation_id", Type: field.TypeString, Nullable: true}, + {Name: "event_type", Type: field.TypeString}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + } + // EventsTable holds the schema information for the "events" table. + EventsTable = &schema.Table{ + Name: "events", + Columns: EventsColumns, + PrimaryKey: []*schema.Column{EventsColumns[0]}, + } + // EventHistoryColumns holds the columns for the "event_history" table. + EventHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "event_id", Type: field.TypeString, Nullable: true}, + {Name: "correlation_id", Type: field.TypeString, Nullable: true}, + {Name: "event_type", Type: field.TypeString}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + } + // EventHistoryTable holds the schema information for the "event_history" table. + EventHistoryTable = &schema.Table{ + Name: "event_history", + Columns: EventHistoryColumns, + PrimaryKey: []*schema.Column{EventHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "eventhistory_history_time", + Unique: false, + Columns: []*schema.Column{EventHistoryColumns[1]}, + }, + }, + } + // FeaturesColumns holds the columns for the "features" table. + FeaturesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "display_name", Type: field.TypeString, Nullable: true}, + {Name: "enabled", Type: field.TypeBool, Default: false}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // FeaturesTable holds the schema information for the "features" table. + FeaturesTable = &schema.Table{ + Name: "features", + Columns: FeaturesColumns, + PrimaryKey: []*schema.Column{FeaturesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "features_organizations_features", + Columns: []*schema.Column{FeaturesColumns[14]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "feature_name_owner_id", + Unique: true, + Columns: []*schema.Column{FeaturesColumns[9], FeaturesColumns[14]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // FeatureHistoryColumns holds the columns for the "feature_history" table. + FeatureHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "display_name", Type: field.TypeString, Nullable: true}, + {Name: "enabled", Type: field.TypeBool, Default: false}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "metadata", Type: field.TypeJSON, Nullable: true}, + } + // FeatureHistoryTable holds the schema information for the "feature_history" table. + FeatureHistoryTable = &schema.Table{ + Name: "feature_history", + Columns: FeatureHistoryColumns, + PrimaryKey: []*schema.Column{FeatureHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "featurehistory_history_time", + Unique: false, + Columns: []*schema.Column{FeatureHistoryColumns[1]}, + }, + }, + } + // FilesColumns holds the columns for the "files" table. + FilesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "file_name", Type: field.TypeString}, + {Name: "file_extension", Type: field.TypeString}, + {Name: "file_size", Type: field.TypeInt, Nullable: true}, + {Name: "content_type", Type: field.TypeString}, + {Name: "store_key", Type: field.TypeString}, + {Name: "category", Type: field.TypeString, Nullable: true}, + {Name: "annotation", Type: field.TypeString, Nullable: true}, + {Name: "user_files", Type: field.TypeString, Nullable: true}, + } + // FilesTable holds the schema information for the "files" table. + FilesTable = &schema.Table{ + Name: "files", + Columns: FilesColumns, + PrimaryKey: []*schema.Column{FilesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "files_users_files", + Columns: []*schema.Column{FilesColumns[16]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // FileHistoryColumns holds the columns for the "file_history" table. + FileHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "file_name", Type: field.TypeString}, + {Name: "file_extension", Type: field.TypeString}, + {Name: "file_size", Type: field.TypeInt, Nullable: true}, + {Name: "content_type", Type: field.TypeString}, + {Name: "store_key", Type: field.TypeString}, + {Name: "category", Type: field.TypeString, Nullable: true}, + {Name: "annotation", Type: field.TypeString, Nullable: true}, + } + // FileHistoryTable holds the schema information for the "file_history" table. + FileHistoryTable = &schema.Table{ + Name: "file_history", + Columns: FileHistoryColumns, + PrimaryKey: []*schema.Column{FileHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "filehistory_history_time", + Unique: false, + Columns: []*schema.Column{FileHistoryColumns[1]}, + }, + }, + } + // GroupsColumns holds the columns for the "groups" table. + GroupsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "gravatar_logo_url", Type: field.TypeString, Nullable: true}, + {Name: "logo_url", Type: field.TypeString, Nullable: true}, + {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // GroupsTable holds the schema information for the "groups" table. + GroupsTable = &schema.Table{ + Name: "groups", + Columns: GroupsColumns, + PrimaryKey: []*schema.Column{GroupsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "groups_organizations_groups", + Columns: []*schema.Column{GroupsColumns[14]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "group_name_owner_id", + Unique: true, + Columns: []*schema.Column{GroupsColumns[9], GroupsColumns[14]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // GroupHistoryColumns holds the columns for the "group_history" table. + GroupHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "gravatar_logo_url", Type: field.TypeString, Nullable: true}, + {Name: "logo_url", Type: field.TypeString, Nullable: true}, + {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, + } + // GroupHistoryTable holds the schema information for the "group_history" table. + GroupHistoryTable = &schema.Table{ + Name: "group_history", + Columns: GroupHistoryColumns, + PrimaryKey: []*schema.Column{GroupHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "grouphistory_history_time", + Unique: false, + Columns: []*schema.Column{GroupHistoryColumns[1]}, + }, + }, + } + // GroupMembershipsColumns holds the columns for the "group_memberships" table. + GroupMembershipsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER", "USER"}, Default: "MEMBER"}, + {Name: "group_id", Type: field.TypeString}, + {Name: "user_id", Type: field.TypeString}, + } + // GroupMembershipsTable holds the schema information for the "group_memberships" table. + GroupMembershipsTable = &schema.Table{ + Name: "group_memberships", + Columns: GroupMembershipsColumns, + PrimaryKey: []*schema.Column{GroupMembershipsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "group_memberships_groups_group", + Columns: []*schema.Column{GroupMembershipsColumns[9]}, + RefColumns: []*schema.Column{GroupsColumns[0]}, + OnDelete: schema.NoAction, + }, + { + Symbol: "group_memberships_users_user", + Columns: []*schema.Column{GroupMembershipsColumns[10]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + Indexes: []*schema.Index{ + { + Name: "groupmembership_user_id_group_id", + Unique: true, + Columns: []*schema.Column{GroupMembershipsColumns[10], GroupMembershipsColumns[9]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // GroupMembershipHistoryColumns holds the columns for the "group_membership_history" table. + GroupMembershipHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER", "USER"}, Default: "MEMBER"}, + {Name: "group_id", Type: field.TypeString}, + {Name: "user_id", Type: field.TypeString}, + } + // GroupMembershipHistoryTable holds the schema information for the "group_membership_history" table. + GroupMembershipHistoryTable = &schema.Table{ + Name: "group_membership_history", + Columns: GroupMembershipHistoryColumns, + PrimaryKey: []*schema.Column{GroupMembershipHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "groupmembershiphistory_history_time", + Unique: false, + Columns: []*schema.Column{GroupMembershipHistoryColumns[1]}, + }, + }, + } + // GroupSettingsColumns holds the columns for the "group_settings" table. + GroupSettingsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "visibility", Type: field.TypeEnum, Enums: []string{"PUBLIC", "PRIVATE"}, Default: "PUBLIC"}, + {Name: "join_policy", Type: field.TypeEnum, Enums: []string{"OPEN", "INVITE_ONLY", "APPLICATION_ONLY", "INVITE_OR_APPLICATION"}, Default: "INVITE_OR_APPLICATION"}, + {Name: "sync_to_slack", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "sync_to_github", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "group_id", Type: field.TypeString, Unique: true, Nullable: true}, + } + // GroupSettingsTable holds the schema information for the "group_settings" table. + GroupSettingsTable = &schema.Table{ + Name: "group_settings", + Columns: GroupSettingsColumns, + PrimaryKey: []*schema.Column{GroupSettingsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "group_settings_groups_setting", + Columns: []*schema.Column{GroupSettingsColumns[13]}, + RefColumns: []*schema.Column{GroupsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // GroupSettingHistoryColumns holds the columns for the "group_setting_history" table. + GroupSettingHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "visibility", Type: field.TypeEnum, Enums: []string{"PUBLIC", "PRIVATE"}, Default: "PUBLIC"}, + {Name: "join_policy", Type: field.TypeEnum, Enums: []string{"OPEN", "INVITE_ONLY", "APPLICATION_ONLY", "INVITE_OR_APPLICATION"}, Default: "INVITE_OR_APPLICATION"}, + {Name: "sync_to_slack", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "sync_to_github", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "group_id", Type: field.TypeString, Nullable: true}, + } + // GroupSettingHistoryTable holds the schema information for the "group_setting_history" table. + GroupSettingHistoryTable = &schema.Table{ + Name: "group_setting_history", + Columns: GroupSettingHistoryColumns, + PrimaryKey: []*schema.Column{GroupSettingHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "groupsettinghistory_history_time", + Unique: false, + Columns: []*schema.Column{GroupSettingHistoryColumns[1]}, + }, + }, + } + // HushesColumns holds the columns for the "hushes" table. + HushesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "kind", Type: field.TypeString, Nullable: true}, + {Name: "secret_name", Type: field.TypeString, Nullable: true}, + {Name: "secret_value", Type: field.TypeString, Nullable: true}, + } + // HushesTable holds the schema information for the "hushes" table. + HushesTable = &schema.Table{ + Name: "hushes", + Columns: HushesColumns, + PrimaryKey: []*schema.Column{HushesColumns[0]}, + } + // HushHistoryColumns holds the columns for the "hush_history" table. + HushHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "kind", Type: field.TypeString, Nullable: true}, + {Name: "secret_name", Type: field.TypeString, Nullable: true}, + {Name: "secret_value", Type: field.TypeString, Nullable: true}, + } + // HushHistoryTable holds the schema information for the "hush_history" table. + HushHistoryTable = &schema.Table{ + Name: "hush_history", + Columns: HushHistoryColumns, + PrimaryKey: []*schema.Column{HushHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "hushhistory_history_time", + Unique: false, + Columns: []*schema.Column{HushHistoryColumns[1]}, + }, + }, + } + // IntegrationsColumns holds the columns for the "integrations" table. + IntegrationsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "kind", Type: field.TypeString, Nullable: true}, + {Name: "group_integrations", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // IntegrationsTable holds the schema information for the "integrations" table. + IntegrationsTable = &schema.Table{ + Name: "integrations", + Columns: IntegrationsColumns, + PrimaryKey: []*schema.Column{IntegrationsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "integrations_groups_integrations", + Columns: []*schema.Column{IntegrationsColumns[12]}, + RefColumns: []*schema.Column{GroupsColumns[0]}, + OnDelete: schema.SetNull, + }, + { + Symbol: "integrations_organizations_integrations", + Columns: []*schema.Column{IntegrationsColumns[13]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // IntegrationHistoryColumns holds the columns for the "integration_history" table. + IntegrationHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "kind", Type: field.TypeString, Nullable: true}, + } + // IntegrationHistoryTable holds the schema information for the "integration_history" table. + IntegrationHistoryTable = &schema.Table{ + Name: "integration_history", + Columns: IntegrationHistoryColumns, + PrimaryKey: []*schema.Column{IntegrationHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "integrationhistory_history_time", + Unique: false, + Columns: []*schema.Column{IntegrationHistoryColumns[1]}, + }, + }, + } + // InvitesColumns holds the columns for the "invites" table. + InvitesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "token", Type: field.TypeString, Unique: true}, + {Name: "expires", Type: field.TypeTime, Nullable: true}, + {Name: "recipient", Type: field.TypeString}, + {Name: "status", Type: field.TypeEnum, Enums: []string{"INVITATION_SENT", "APPROVAL_REQUIRED", "INVITATION_ACCEPTED", "INVITATION_EXPIRED"}, Default: "INVITATION_SENT"}, + {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER", "USER"}, Default: "MEMBER"}, + {Name: "send_attempts", Type: field.TypeInt, Default: 0}, + {Name: "requestor_id", Type: field.TypeString, Nullable: true}, + {Name: "secret", Type: field.TypeBytes}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // InvitesTable holds the schema information for the "invites" table. + InvitesTable = &schema.Table{ + Name: "invites", + Columns: InvitesColumns, + PrimaryKey: []*schema.Column{InvitesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "invites_organizations_invites", + Columns: []*schema.Column{InvitesColumns[16]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "invite_recipient_owner_id", + Unique: true, + Columns: []*schema.Column{InvitesColumns[10], InvitesColumns[16]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // NotesColumns holds the columns for the "notes" table. + NotesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "text", Type: field.TypeString}, + {Name: "entity_notes", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // NotesTable holds the schema information for the "notes" table. + NotesTable = &schema.Table{ + Name: "notes", + Columns: NotesColumns, + PrimaryKey: []*schema.Column{NotesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "notes_entities_notes", + Columns: []*schema.Column{NotesColumns[10]}, + RefColumns: []*schema.Column{EntitiesColumns[0]}, + OnDelete: schema.SetNull, + }, + { + Symbol: "notes_organizations_notes", + Columns: []*schema.Column{NotesColumns[11]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // NoteHistoryColumns holds the columns for the "note_history" table. + NoteHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "text", Type: field.TypeString}, + } + // NoteHistoryTable holds the schema information for the "note_history" table. + NoteHistoryTable = &schema.Table{ + Name: "note_history", + Columns: NoteHistoryColumns, + PrimaryKey: []*schema.Column{NoteHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "notehistory_history_time", + Unique: false, + Columns: []*schema.Column{NoteHistoryColumns[1]}, + }, + }, + } + // OauthProvidersColumns holds the columns for the "oauth_providers" table. + OauthProvidersColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "client_id", Type: field.TypeString}, + {Name: "client_secret", Type: field.TypeString}, + {Name: "redirect_url", Type: field.TypeString}, + {Name: "scopes", Type: field.TypeString}, + {Name: "auth_url", Type: field.TypeString}, + {Name: "token_url", Type: field.TypeString}, + {Name: "auth_style", Type: field.TypeUint8}, + {Name: "info_url", Type: field.TypeString}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // OauthProvidersTable holds the schema information for the "oauth_providers" table. + OauthProvidersTable = &schema.Table{ + Name: "oauth_providers", + Columns: OauthProvidersColumns, + PrimaryKey: []*schema.Column{OauthProvidersColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "oauth_providers_organizations_oauthprovider", + Columns: []*schema.Column{OauthProvidersColumns[18]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // OauthProviderHistoryColumns holds the columns for the "oauth_provider_history" table. + OauthProviderHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "client_id", Type: field.TypeString}, + {Name: "client_secret", Type: field.TypeString}, + {Name: "redirect_url", Type: field.TypeString}, + {Name: "scopes", Type: field.TypeString}, + {Name: "auth_url", Type: field.TypeString}, + {Name: "token_url", Type: field.TypeString}, + {Name: "auth_style", Type: field.TypeUint8}, + {Name: "info_url", Type: field.TypeString}, + } + // OauthProviderHistoryTable holds the schema information for the "oauth_provider_history" table. + OauthProviderHistoryTable = &schema.Table{ + Name: "oauth_provider_history", + Columns: OauthProviderHistoryColumns, + PrimaryKey: []*schema.Column{OauthProviderHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "oauthproviderhistory_history_time", + Unique: false, + Columns: []*schema.Column{OauthProviderHistoryColumns[1]}, + }, + }, + } + // OhAuthTooTokensColumns holds the columns for the "oh_auth_too_tokens" table. + OhAuthTooTokensColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "client_id", Type: field.TypeString, Size: 2147483647}, + {Name: "scopes", Type: field.TypeJSON, Nullable: true}, + {Name: "nonce", Type: field.TypeString, Size: 2147483647}, + {Name: "claims_user_id", Type: field.TypeString, Size: 2147483647}, + {Name: "claims_username", Type: field.TypeString, Size: 2147483647}, + {Name: "claims_email", Type: field.TypeString, Size: 2147483647}, + {Name: "claims_email_verified", Type: field.TypeBool}, + {Name: "claims_groups", Type: field.TypeJSON, Nullable: true}, + {Name: "claims_preferred_username", Type: field.TypeString, Size: 2147483647}, + {Name: "connector_id", Type: field.TypeString, Size: 2147483647}, + {Name: "connector_data", Type: field.TypeJSON, Nullable: true}, + {Name: "last_used", Type: field.TypeTime}, + } + // OhAuthTooTokensTable holds the schema information for the "oh_auth_too_tokens" table. + OhAuthTooTokensTable = &schema.Table{ + Name: "oh_auth_too_tokens", + Columns: OhAuthTooTokensColumns, + PrimaryKey: []*schema.Column{OhAuthTooTokensColumns[0]}, + } + // OrgMembershipsColumns holds the columns for the "org_memberships" table. + OrgMembershipsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER", "USER", "OWNER"}, Default: "MEMBER"}, + {Name: "organization_id", Type: field.TypeString}, + {Name: "user_id", Type: field.TypeString}, + } + // OrgMembershipsTable holds the schema information for the "org_memberships" table. + OrgMembershipsTable = &schema.Table{ + Name: "org_memberships", + Columns: OrgMembershipsColumns, + PrimaryKey: []*schema.Column{OrgMembershipsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "org_memberships_organizations_organization", + Columns: []*schema.Column{OrgMembershipsColumns[9]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.NoAction, + }, + { + Symbol: "org_memberships_users_user", + Columns: []*schema.Column{OrgMembershipsColumns[10]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + Indexes: []*schema.Index{ + { + Name: "orgmembership_user_id_organization_id", + Unique: true, + Columns: []*schema.Column{OrgMembershipsColumns[10], OrgMembershipsColumns[9]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // OrgMembershipHistoryColumns holds the columns for the "org_membership_history" table. + OrgMembershipHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "role", Type: field.TypeEnum, Enums: []string{"ADMIN", "MEMBER", "USER", "OWNER"}, Default: "MEMBER"}, + {Name: "organization_id", Type: field.TypeString}, + {Name: "user_id", Type: field.TypeString}, + } + // OrgMembershipHistoryTable holds the schema information for the "org_membership_history" table. + OrgMembershipHistoryTable = &schema.Table{ + Name: "org_membership_history", + Columns: OrgMembershipHistoryColumns, + PrimaryKey: []*schema.Column{OrgMembershipHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "orgmembershiphistory_history_time", + Unique: false, + Columns: []*schema.Column{OrgMembershipHistoryColumns[1]}, + }, + }, + } + // OrganizationsColumns holds the columns for the "organizations" table. + OrganizationsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString, Size: 160}, + {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "personal_org", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 255}, + {Name: "dedicated_db", Type: field.TypeBool, Default: false}, + {Name: "parent_organization_id", Type: field.TypeString, Nullable: true}, + } + // OrganizationsTable holds the schema information for the "organizations" table. + OrganizationsTable = &schema.Table{ + Name: "organizations", + Columns: OrganizationsColumns, + PrimaryKey: []*schema.Column{OrganizationsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "organizations_organizations_children", + Columns: []*schema.Column{OrganizationsColumns[15]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "organization_name", + Unique: true, + Columns: []*schema.Column{OrganizationsColumns[9]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // OrganizationHistoryColumns holds the columns for the "organization_history" table. + OrganizationHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString, Size: 160}, + {Name: "display_name", Type: field.TypeString, Size: 64, Default: ""}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "parent_organization_id", Type: field.TypeString, Nullable: true}, + {Name: "personal_org", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 255}, + {Name: "dedicated_db", Type: field.TypeBool, Default: false}, + } + // OrganizationHistoryTable holds the schema information for the "organization_history" table. + OrganizationHistoryTable = &schema.Table{ + Name: "organization_history", + Columns: OrganizationHistoryColumns, + PrimaryKey: []*schema.Column{OrganizationHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "organizationhistory_history_time", + Unique: false, + Columns: []*schema.Column{OrganizationHistoryColumns[1]}, + }, + }, + } + // OrganizationSettingsColumns holds the columns for the "organization_settings" table. + OrganizationSettingsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "domains", Type: field.TypeJSON, Nullable: true}, + {Name: "billing_contact", Type: field.TypeString, Nullable: true}, + {Name: "billing_email", Type: field.TypeString, Nullable: true}, + {Name: "billing_phone", Type: field.TypeString, Nullable: true}, + {Name: "billing_address", Type: field.TypeString, Nullable: true}, + {Name: "tax_identifier", Type: field.TypeString, Nullable: true}, + {Name: "geo_location", Type: field.TypeEnum, Nullable: true, Enums: []string{"AMER", "EMEA", "APAC"}, Default: "AMER"}, + {Name: "organization_id", Type: field.TypeString, Unique: true, Nullable: true}, + } + // OrganizationSettingsTable holds the schema information for the "organization_settings" table. + OrganizationSettingsTable = &schema.Table{ + Name: "organization_settings", + Columns: OrganizationSettingsColumns, + PrimaryKey: []*schema.Column{OrganizationSettingsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "organization_settings_organizations_setting", + Columns: []*schema.Column{OrganizationSettingsColumns[16]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // OrganizationSettingHistoryColumns holds the columns for the "organization_setting_history" table. + OrganizationSettingHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "domains", Type: field.TypeJSON, Nullable: true}, + {Name: "billing_contact", Type: field.TypeString, Nullable: true}, + {Name: "billing_email", Type: field.TypeString, Nullable: true}, + {Name: "billing_phone", Type: field.TypeString, Nullable: true}, + {Name: "billing_address", Type: field.TypeString, Nullable: true}, + {Name: "tax_identifier", Type: field.TypeString, Nullable: true}, + {Name: "geo_location", Type: field.TypeEnum, Nullable: true, Enums: []string{"AMER", "EMEA", "APAC"}, Default: "AMER"}, + {Name: "organization_id", Type: field.TypeString, Nullable: true}, + } + // OrganizationSettingHistoryTable holds the schema information for the "organization_setting_history" table. + OrganizationSettingHistoryTable = &schema.Table{ + Name: "organization_setting_history", + Columns: OrganizationSettingHistoryColumns, + PrimaryKey: []*schema.Column{OrganizationSettingHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "organizationsettinghistory_history_time", + Unique: false, + Columns: []*schema.Column{OrganizationSettingHistoryColumns[1]}, + }, + }, + } + // PasswordResetTokensColumns holds the columns for the "password_reset_tokens" table. + PasswordResetTokensColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "token", Type: field.TypeString, Unique: true}, + {Name: "ttl", Type: field.TypeTime}, + {Name: "email", Type: field.TypeString}, + {Name: "secret", Type: field.TypeBytes}, + {Name: "owner_id", Type: field.TypeString}, + } + // PasswordResetTokensTable holds the schema information for the "password_reset_tokens" table. + PasswordResetTokensTable = &schema.Table{ + Name: "password_reset_tokens", + Columns: PasswordResetTokensColumns, + PrimaryKey: []*schema.Column{PasswordResetTokensColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "password_reset_tokens_users_password_reset_tokens", + Columns: []*schema.Column{PasswordResetTokensColumns[12]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + Indexes: []*schema.Index{ + { + Name: "passwordresettoken_token", + Unique: true, + Columns: []*schema.Column{PasswordResetTokensColumns[8]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // PersonalAccessTokensColumns holds the columns for the "personal_access_tokens" table. + PersonalAccessTokensColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "token", Type: field.TypeString, Unique: true}, + {Name: "expires_at", Type: field.TypeTime, Nullable: true}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "scopes", Type: field.TypeJSON, Nullable: true}, + {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, + {Name: "owner_id", Type: field.TypeString}, + } + // PersonalAccessTokensTable holds the schema information for the "personal_access_tokens" table. + PersonalAccessTokensTable = &schema.Table{ + Name: "personal_access_tokens", + Columns: PersonalAccessTokensColumns, + PrimaryKey: []*schema.Column{PersonalAccessTokensColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "personal_access_tokens_users_personal_access_tokens", + Columns: []*schema.Column{PersonalAccessTokensColumns[15]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + Indexes: []*schema.Index{ + { + Name: "personalaccesstoken_token", + Unique: false, + Columns: []*schema.Column{PersonalAccessTokensColumns[10]}, + }, + }, + } + // SubscribersColumns holds the columns for the "subscribers" table. + SubscribersColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "email", Type: field.TypeString}, + {Name: "phone_number", Type: field.TypeString, Nullable: true}, + {Name: "verified_email", Type: field.TypeBool, Default: false}, + {Name: "verified_phone", Type: field.TypeBool, Default: false}, + {Name: "active", Type: field.TypeBool, Default: false}, + {Name: "token", Type: field.TypeString, Unique: true}, + {Name: "ttl", Type: field.TypeTime}, + {Name: "secret", Type: field.TypeBytes}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // SubscribersTable holds the schema information for the "subscribers" table. + SubscribersTable = &schema.Table{ + Name: "subscribers", + Columns: SubscribersColumns, + PrimaryKey: []*schema.Column{SubscribersColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "subscribers_organizations_subscribers", + Columns: []*schema.Column{SubscribersColumns[17]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "subscriber_email_owner_id", + Unique: true, + Columns: []*schema.Column{SubscribersColumns[9], SubscribersColumns[17]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // TfaSettingsColumns holds the columns for the "tfa_settings" table. + TfaSettingsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "tfa_secret", Type: field.TypeString, Nullable: true}, + {Name: "verified", Type: field.TypeBool, Default: false}, + {Name: "recovery_codes", Type: field.TypeJSON, Nullable: true}, + {Name: "phone_otp_allowed", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "email_otp_allowed", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "totp_allowed", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // TfaSettingsTable holds the schema information for the "tfa_settings" table. + TfaSettingsTable = &schema.Table{ + Name: "tfa_settings", + Columns: TfaSettingsColumns, + PrimaryKey: []*schema.Column{TfaSettingsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "tfa_settings_users_tfa_settings", + Columns: []*schema.Column{TfaSettingsColumns[15]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "tfasetting_owner_id", + Unique: true, + Columns: []*schema.Column{TfaSettingsColumns[15]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // TemplatesColumns holds the columns for the "templates" table. + TemplatesColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "template_type", Type: field.TypeEnum, Enums: []string{"ROOTTEMPLATE", "DOCUMENT"}, Default: "DOCUMENT"}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "jsonconfig", Type: field.TypeJSON}, + {Name: "uischema", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // TemplatesTable holds the schema information for the "templates" table. + TemplatesTable = &schema.Table{ + Name: "templates", + Columns: TemplatesColumns, + PrimaryKey: []*schema.Column{TemplatesColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "templates_organizations_templates", + Columns: []*schema.Column{TemplatesColumns[14]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "template_name_owner_id_template_type", + Unique: true, + Columns: []*schema.Column{TemplatesColumns[9], TemplatesColumns[14], TemplatesColumns[10]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // TemplateHistoryColumns holds the columns for the "template_history" table. + TemplateHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "template_type", Type: field.TypeEnum, Enums: []string{"ROOTTEMPLATE", "DOCUMENT"}, Default: "DOCUMENT"}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "jsonconfig", Type: field.TypeJSON}, + {Name: "uischema", Type: field.TypeJSON, Nullable: true}, + } + // TemplateHistoryTable holds the schema information for the "template_history" table. + TemplateHistoryTable = &schema.Table{ + Name: "template_history", + Columns: TemplateHistoryColumns, + PrimaryKey: []*schema.Column{TemplateHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "templatehistory_history_time", + Unique: false, + Columns: []*schema.Column{TemplateHistoryColumns[1]}, + }, + }, + } + // UsersColumns holds the columns for the "users" table. + UsersColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "email", Type: field.TypeString}, + {Name: "first_name", Type: field.TypeString, Nullable: true, Size: 64}, + {Name: "last_name", Type: field.TypeString, Nullable: true, Size: 64}, + {Name: "display_name", Type: field.TypeString, Size: 64}, + {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 255}, + {Name: "avatar_local_file", Type: field.TypeString, Nullable: true, Size: 255}, + {Name: "avatar_updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "last_seen", Type: field.TypeTime, Nullable: true}, + {Name: "password", Type: field.TypeString, Nullable: true}, + {Name: "sub", Type: field.TypeString, Unique: true, Nullable: true}, + {Name: "auth_provider", Type: field.TypeEnum, Enums: []string{"CREDENTIALS", "GOOGLE", "GITHUB", "WEBAUTHN"}, Default: "CREDENTIALS"}, + {Name: "role", Type: field.TypeEnum, Nullable: true, Enums: []string{"ADMIN", "MEMBER", "USER"}, Default: "USER"}, + } + // UsersTable holds the schema information for the "users" table. + UsersTable = &schema.Table{ + Name: "users", + Columns: UsersColumns, + PrimaryKey: []*schema.Column{UsersColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "user_id", + Unique: true, + Columns: []*schema.Column{UsersColumns[0]}, + }, + { + Name: "user_email_auth_provider", + Unique: true, + Columns: []*schema.Column{UsersColumns[9], UsersColumns[19]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // UserHistoryColumns holds the columns for the "user_history" table. + UserHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "email", Type: field.TypeString}, + {Name: "first_name", Type: field.TypeString, Nullable: true, Size: 64}, + {Name: "last_name", Type: field.TypeString, Nullable: true, Size: 64}, + {Name: "display_name", Type: field.TypeString, Size: 64}, + {Name: "avatar_remote_url", Type: field.TypeString, Nullable: true, Size: 255}, + {Name: "avatar_local_file", Type: field.TypeString, Nullable: true, Size: 255}, + {Name: "avatar_updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "last_seen", Type: field.TypeTime, Nullable: true}, + {Name: "password", Type: field.TypeString, Nullable: true}, + {Name: "sub", Type: field.TypeString, Nullable: true}, + {Name: "auth_provider", Type: field.TypeEnum, Enums: []string{"CREDENTIALS", "GOOGLE", "GITHUB", "WEBAUTHN"}, Default: "CREDENTIALS"}, + {Name: "role", Type: field.TypeEnum, Nullable: true, Enums: []string{"ADMIN", "MEMBER", "USER"}, Default: "USER"}, + } + // UserHistoryTable holds the schema information for the "user_history" table. + UserHistoryTable = &schema.Table{ + Name: "user_history", + Columns: UserHistoryColumns, + PrimaryKey: []*schema.Column{UserHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "userhistory_history_time", + Unique: false, + Columns: []*schema.Column{UserHistoryColumns[1]}, + }, + }, + } + // UserSettingsColumns holds the columns for the "user_settings" table. + UserSettingsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "locked", Type: field.TypeBool, Default: false}, + {Name: "silenced_at", Type: field.TypeTime, Nullable: true}, + {Name: "suspended_at", Type: field.TypeTime, Nullable: true}, + {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, + {Name: "email_confirmed", Type: field.TypeBool, Default: false}, + {Name: "is_webauthn_allowed", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "is_tfa_enabled", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "phone_number", Type: field.TypeString, Nullable: true}, + {Name: "user_id", Type: field.TypeString, Unique: true, Nullable: true}, + {Name: "user_setting_default_org", Type: field.TypeString, Nullable: true}, + } + // UserSettingsTable holds the schema information for the "user_settings" table. + UserSettingsTable = &schema.Table{ + Name: "user_settings", + Columns: UserSettingsColumns, + PrimaryKey: []*schema.Column{UserSettingsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "user_settings_users_setting", + Columns: []*schema.Column{UserSettingsColumns[17]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.SetNull, + }, + { + Symbol: "user_settings_organizations_default_org", + Columns: []*schema.Column{UserSettingsColumns[18]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + } + // UserSettingHistoryColumns holds the columns for the "user_setting_history" table. + UserSettingHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "user_id", Type: field.TypeString, Nullable: true}, + {Name: "locked", Type: field.TypeBool, Default: false}, + {Name: "silenced_at", Type: field.TypeTime, Nullable: true}, + {Name: "suspended_at", Type: field.TypeTime, Nullable: true}, + {Name: "status", Type: field.TypeEnum, Enums: []string{"ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING"}, Default: "ACTIVE"}, + {Name: "email_confirmed", Type: field.TypeBool, Default: false}, + {Name: "is_webauthn_allowed", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "is_tfa_enabled", Type: field.TypeBool, Nullable: true, Default: false}, + {Name: "phone_number", Type: field.TypeString, Nullable: true}, + } + // UserSettingHistoryTable holds the schema information for the "user_setting_history" table. + UserSettingHistoryTable = &schema.Table{ + Name: "user_setting_history", + Columns: UserSettingHistoryColumns, + PrimaryKey: []*schema.Column{UserSettingHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "usersettinghistory_history_time", + Unique: false, + Columns: []*schema.Column{UserSettingHistoryColumns[1]}, + }, + }, + } + // WebauthnsColumns holds the columns for the "webauthns" table. + WebauthnsColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "credential_id", Type: field.TypeBytes, Unique: true, Nullable: true}, + {Name: "public_key", Type: field.TypeBytes, Nullable: true}, + {Name: "attestation_type", Type: field.TypeString, Nullable: true}, + {Name: "aaguid", Type: field.TypeBytes, Unique: true}, + {Name: "sign_count", Type: field.TypeInt32}, + {Name: "transports", Type: field.TypeJSON}, + {Name: "backup_eligible", Type: field.TypeBool, Default: false}, + {Name: "backup_state", Type: field.TypeBool, Default: false}, + {Name: "user_present", Type: field.TypeBool, Default: false}, + {Name: "user_verified", Type: field.TypeBool, Default: false}, + {Name: "owner_id", Type: field.TypeString}, + } + // WebauthnsTable holds the schema information for the "webauthns" table. + WebauthnsTable = &schema.Table{ + Name: "webauthns", + Columns: WebauthnsColumns, + PrimaryKey: []*schema.Column{WebauthnsColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "webauthns_users_webauthn", + Columns: []*schema.Column{WebauthnsColumns[17]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.NoAction, + }, + }, + } + // WebhooksColumns holds the columns for the "webhooks" table. + WebhooksColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString, Unique: true}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "destination_url", Type: field.TypeString}, + {Name: "enabled", Type: field.TypeBool, Default: true}, + {Name: "callback", Type: field.TypeString, Unique: true, Nullable: true}, + {Name: "expires_at", Type: field.TypeTime, Nullable: true}, + {Name: "secret", Type: field.TypeBytes, Nullable: true}, + {Name: "failures", Type: field.TypeInt, Nullable: true, Default: 0}, + {Name: "last_error", Type: field.TypeString, Nullable: true}, + {Name: "last_response", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + } + // WebhooksTable holds the schema information for the "webhooks" table. + WebhooksTable = &schema.Table{ + Name: "webhooks", + Columns: WebhooksColumns, + PrimaryKey: []*schema.Column{WebhooksColumns[0]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "webhooks_organizations_webhooks", + Columns: []*schema.Column{WebhooksColumns[19]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.SetNull, + }, + }, + Indexes: []*schema.Index{ + { + Name: "webhook_name_owner_id", + Unique: true, + Columns: []*schema.Column{WebhooksColumns[9], WebhooksColumns[19]}, + Annotation: &entsql.IndexAnnotation{ + Where: "deleted_at is NULL", + }, + }, + }, + } + // WebhookHistoryColumns holds the columns for the "webhook_history" table. + WebhookHistoryColumns = []*schema.Column{ + {Name: "id", Type: field.TypeString}, + {Name: "history_time", Type: field.TypeTime}, + {Name: "ref", Type: field.TypeString, Nullable: true}, + {Name: "operation", Type: field.TypeEnum, Enums: []string{"INSERT", "UPDATE", "DELETE"}}, + {Name: "created_at", Type: field.TypeTime, Nullable: true}, + {Name: "updated_at", Type: field.TypeTime, Nullable: true}, + {Name: "created_by", Type: field.TypeString, Nullable: true}, + {Name: "updated_by", Type: field.TypeString, Nullable: true}, + {Name: "mapping_id", Type: field.TypeString}, + {Name: "tags", Type: field.TypeJSON, Nullable: true}, + {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, + {Name: "deleted_by", Type: field.TypeString, Nullable: true}, + {Name: "owner_id", Type: field.TypeString, Nullable: true}, + {Name: "name", Type: field.TypeString}, + {Name: "description", Type: field.TypeString, Nullable: true}, + {Name: "destination_url", Type: field.TypeString}, + {Name: "enabled", Type: field.TypeBool, Default: true}, + {Name: "callback", Type: field.TypeString, Nullable: true}, + {Name: "expires_at", Type: field.TypeTime, Nullable: true}, + {Name: "secret", Type: field.TypeBytes, Nullable: true}, + {Name: "failures", Type: field.TypeInt, Nullable: true, Default: 0}, + {Name: "last_error", Type: field.TypeString, Nullable: true}, + {Name: "last_response", Type: field.TypeString, Nullable: true}, + } + // WebhookHistoryTable holds the schema information for the "webhook_history" table. + WebhookHistoryTable = &schema.Table{ + Name: "webhook_history", + Columns: WebhookHistoryColumns, + PrimaryKey: []*schema.Column{WebhookHistoryColumns[0]}, + Indexes: []*schema.Index{ + { + Name: "webhookhistory_history_time", + Unique: false, + Columns: []*schema.Column{WebhookHistoryColumns[1]}, + }, + }, + } + // EntitlementEventsColumns holds the columns for the "entitlement_events" table. + EntitlementEventsColumns = []*schema.Column{ + {Name: "entitlement_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // EntitlementEventsTable holds the schema information for the "entitlement_events" table. + EntitlementEventsTable = &schema.Table{ + Name: "entitlement_events", + Columns: EntitlementEventsColumns, + PrimaryKey: []*schema.Column{EntitlementEventsColumns[0], EntitlementEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entitlement_events_entitlement_id", + Columns: []*schema.Column{EntitlementEventsColumns[0]}, + RefColumns: []*schema.Column{EntitlementsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "entitlement_events_event_id", + Columns: []*schema.Column{EntitlementEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // EntitlementPlanEventsColumns holds the columns for the "entitlement_plan_events" table. + EntitlementPlanEventsColumns = []*schema.Column{ + {Name: "entitlement_plan_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // EntitlementPlanEventsTable holds the schema information for the "entitlement_plan_events" table. + EntitlementPlanEventsTable = &schema.Table{ + Name: "entitlement_plan_events", + Columns: EntitlementPlanEventsColumns, + PrimaryKey: []*schema.Column{EntitlementPlanEventsColumns[0], EntitlementPlanEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entitlement_plan_events_entitlement_plan_id", + Columns: []*schema.Column{EntitlementPlanEventsColumns[0]}, + RefColumns: []*schema.Column{EntitlementPlansColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "entitlement_plan_events_event_id", + Columns: []*schema.Column{EntitlementPlanEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // EntitlementPlanFeatureEventsColumns holds the columns for the "entitlement_plan_feature_events" table. + EntitlementPlanFeatureEventsColumns = []*schema.Column{ + {Name: "entitlement_plan_feature_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // EntitlementPlanFeatureEventsTable holds the schema information for the "entitlement_plan_feature_events" table. + EntitlementPlanFeatureEventsTable = &schema.Table{ + Name: "entitlement_plan_feature_events", + Columns: EntitlementPlanFeatureEventsColumns, + PrimaryKey: []*schema.Column{EntitlementPlanFeatureEventsColumns[0], EntitlementPlanFeatureEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entitlement_plan_feature_events_entitlement_plan_feature_id", + Columns: []*schema.Column{EntitlementPlanFeatureEventsColumns[0]}, + RefColumns: []*schema.Column{EntitlementPlanFeaturesColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "entitlement_plan_feature_events_event_id", + Columns: []*schema.Column{EntitlementPlanFeatureEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // EntityContactsColumns holds the columns for the "entity_contacts" table. + EntityContactsColumns = []*schema.Column{ + {Name: "entity_id", Type: field.TypeString}, + {Name: "contact_id", Type: field.TypeString}, + } + // EntityContactsTable holds the schema information for the "entity_contacts" table. + EntityContactsTable = &schema.Table{ + Name: "entity_contacts", + Columns: EntityContactsColumns, + PrimaryKey: []*schema.Column{EntityContactsColumns[0], EntityContactsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entity_contacts_entity_id", + Columns: []*schema.Column{EntityContactsColumns[0]}, + RefColumns: []*schema.Column{EntitiesColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "entity_contacts_contact_id", + Columns: []*schema.Column{EntityContactsColumns[1]}, + RefColumns: []*schema.Column{ContactsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // EntityDocumentsColumns holds the columns for the "entity_documents" table. + EntityDocumentsColumns = []*schema.Column{ + {Name: "entity_id", Type: field.TypeString}, + {Name: "document_data_id", Type: field.TypeString}, + } + // EntityDocumentsTable holds the schema information for the "entity_documents" table. + EntityDocumentsTable = &schema.Table{ + Name: "entity_documents", + Columns: EntityDocumentsColumns, + PrimaryKey: []*schema.Column{EntityDocumentsColumns[0], EntityDocumentsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entity_documents_entity_id", + Columns: []*schema.Column{EntityDocumentsColumns[0]}, + RefColumns: []*schema.Column{EntitiesColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "entity_documents_document_data_id", + Columns: []*schema.Column{EntityDocumentsColumns[1]}, + RefColumns: []*schema.Column{DocumentDataColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // EntityFilesColumns holds the columns for the "entity_files" table. + EntityFilesColumns = []*schema.Column{ + {Name: "entity_id", Type: field.TypeString}, + {Name: "file_id", Type: field.TypeString}, + } + // EntityFilesTable holds the schema information for the "entity_files" table. + EntityFilesTable = &schema.Table{ + Name: "entity_files", + Columns: EntityFilesColumns, + PrimaryKey: []*schema.Column{EntityFilesColumns[0], EntityFilesColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "entity_files_entity_id", + Columns: []*schema.Column{EntityFilesColumns[0]}, + RefColumns: []*schema.Column{EntitiesColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "entity_files_file_id", + Columns: []*schema.Column{EntityFilesColumns[1]}, + RefColumns: []*schema.Column{FilesColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // FeatureEventsColumns holds the columns for the "feature_events" table. + FeatureEventsColumns = []*schema.Column{ + {Name: "feature_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // FeatureEventsTable holds the schema information for the "feature_events" table. + FeatureEventsTable = &schema.Table{ + Name: "feature_events", + Columns: FeatureEventsColumns, + PrimaryKey: []*schema.Column{FeatureEventsColumns[0], FeatureEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "feature_events_feature_id", + Columns: []*schema.Column{FeatureEventsColumns[0]}, + RefColumns: []*schema.Column{FeaturesColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "feature_events_event_id", + Columns: []*schema.Column{FeatureEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // GroupEventsColumns holds the columns for the "group_events" table. + GroupEventsColumns = []*schema.Column{ + {Name: "group_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // GroupEventsTable holds the schema information for the "group_events" table. + GroupEventsTable = &schema.Table{ + Name: "group_events", + Columns: GroupEventsColumns, + PrimaryKey: []*schema.Column{GroupEventsColumns[0], GroupEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "group_events_group_id", + Columns: []*schema.Column{GroupEventsColumns[0]}, + RefColumns: []*schema.Column{GroupsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "group_events_event_id", + Columns: []*schema.Column{GroupEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // GroupFilesColumns holds the columns for the "group_files" table. + GroupFilesColumns = []*schema.Column{ + {Name: "group_id", Type: field.TypeString}, + {Name: "file_id", Type: field.TypeString}, + } + // GroupFilesTable holds the schema information for the "group_files" table. + GroupFilesTable = &schema.Table{ + Name: "group_files", + Columns: GroupFilesColumns, + PrimaryKey: []*schema.Column{GroupFilesColumns[0], GroupFilesColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "group_files_group_id", + Columns: []*schema.Column{GroupFilesColumns[0]}, + RefColumns: []*schema.Column{GroupsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "group_files_file_id", + Columns: []*schema.Column{GroupFilesColumns[1]}, + RefColumns: []*schema.Column{FilesColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // GroupMembershipEventsColumns holds the columns for the "group_membership_events" table. + GroupMembershipEventsColumns = []*schema.Column{ + {Name: "group_membership_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // GroupMembershipEventsTable holds the schema information for the "group_membership_events" table. + GroupMembershipEventsTable = &schema.Table{ + Name: "group_membership_events", + Columns: GroupMembershipEventsColumns, + PrimaryKey: []*schema.Column{GroupMembershipEventsColumns[0], GroupMembershipEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "group_membership_events_group_membership_id", + Columns: []*schema.Column{GroupMembershipEventsColumns[0]}, + RefColumns: []*schema.Column{GroupMembershipsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "group_membership_events_event_id", + Columns: []*schema.Column{GroupMembershipEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // HushEventsColumns holds the columns for the "hush_events" table. + HushEventsColumns = []*schema.Column{ + {Name: "hush_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // HushEventsTable holds the schema information for the "hush_events" table. + HushEventsTable = &schema.Table{ + Name: "hush_events", + Columns: HushEventsColumns, + PrimaryKey: []*schema.Column{HushEventsColumns[0], HushEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "hush_events_hush_id", + Columns: []*schema.Column{HushEventsColumns[0]}, + RefColumns: []*schema.Column{HushesColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "hush_events_event_id", + Columns: []*schema.Column{HushEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // IntegrationSecretsColumns holds the columns for the "integration_secrets" table. + IntegrationSecretsColumns = []*schema.Column{ + {Name: "integration_id", Type: field.TypeString}, + {Name: "hush_id", Type: field.TypeString}, + } + // IntegrationSecretsTable holds the schema information for the "integration_secrets" table. + IntegrationSecretsTable = &schema.Table{ + Name: "integration_secrets", + Columns: IntegrationSecretsColumns, + PrimaryKey: []*schema.Column{IntegrationSecretsColumns[0], IntegrationSecretsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "integration_secrets_integration_id", + Columns: []*schema.Column{IntegrationSecretsColumns[0]}, + RefColumns: []*schema.Column{IntegrationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "integration_secrets_hush_id", + Columns: []*schema.Column{IntegrationSecretsColumns[1]}, + RefColumns: []*schema.Column{HushesColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // IntegrationOauth2tokensColumns holds the columns for the "integration_oauth2tokens" table. + IntegrationOauth2tokensColumns = []*schema.Column{ + {Name: "integration_id", Type: field.TypeString}, + {Name: "oh_auth_too_token_id", Type: field.TypeString}, + } + // IntegrationOauth2tokensTable holds the schema information for the "integration_oauth2tokens" table. + IntegrationOauth2tokensTable = &schema.Table{ + Name: "integration_oauth2tokens", + Columns: IntegrationOauth2tokensColumns, + PrimaryKey: []*schema.Column{IntegrationOauth2tokensColumns[0], IntegrationOauth2tokensColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "integration_oauth2tokens_integration_id", + Columns: []*schema.Column{IntegrationOauth2tokensColumns[0]}, + RefColumns: []*schema.Column{IntegrationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "integration_oauth2tokens_oh_auth_too_token_id", + Columns: []*schema.Column{IntegrationOauth2tokensColumns[1]}, + RefColumns: []*schema.Column{OhAuthTooTokensColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // IntegrationEventsColumns holds the columns for the "integration_events" table. + IntegrationEventsColumns = []*schema.Column{ + {Name: "integration_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // IntegrationEventsTable holds the schema information for the "integration_events" table. + IntegrationEventsTable = &schema.Table{ + Name: "integration_events", + Columns: IntegrationEventsColumns, + PrimaryKey: []*schema.Column{IntegrationEventsColumns[0], IntegrationEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "integration_events_integration_id", + Columns: []*schema.Column{IntegrationEventsColumns[0]}, + RefColumns: []*schema.Column{IntegrationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "integration_events_event_id", + Columns: []*schema.Column{IntegrationEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // IntegrationWebhooksColumns holds the columns for the "integration_webhooks" table. + IntegrationWebhooksColumns = []*schema.Column{ + {Name: "integration_id", Type: field.TypeString}, + {Name: "webhook_id", Type: field.TypeString}, + } + // IntegrationWebhooksTable holds the schema information for the "integration_webhooks" table. + IntegrationWebhooksTable = &schema.Table{ + Name: "integration_webhooks", + Columns: IntegrationWebhooksColumns, + PrimaryKey: []*schema.Column{IntegrationWebhooksColumns[0], IntegrationWebhooksColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "integration_webhooks_integration_id", + Columns: []*schema.Column{IntegrationWebhooksColumns[0]}, + RefColumns: []*schema.Column{IntegrationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "integration_webhooks_webhook_id", + Columns: []*schema.Column{IntegrationWebhooksColumns[1]}, + RefColumns: []*schema.Column{WebhooksColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // InviteEventsColumns holds the columns for the "invite_events" table. + InviteEventsColumns = []*schema.Column{ + {Name: "invite_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // InviteEventsTable holds the schema information for the "invite_events" table. + InviteEventsTable = &schema.Table{ + Name: "invite_events", + Columns: InviteEventsColumns, + PrimaryKey: []*schema.Column{InviteEventsColumns[0], InviteEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "invite_events_invite_id", + Columns: []*schema.Column{InviteEventsColumns[0]}, + RefColumns: []*schema.Column{InvitesColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "invite_events_event_id", + Columns: []*schema.Column{InviteEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // OhAuthTooTokenEventsColumns holds the columns for the "oh_auth_too_token_events" table. + OhAuthTooTokenEventsColumns = []*schema.Column{ + {Name: "oh_auth_too_token_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // OhAuthTooTokenEventsTable holds the schema information for the "oh_auth_too_token_events" table. + OhAuthTooTokenEventsTable = &schema.Table{ + Name: "oh_auth_too_token_events", + Columns: OhAuthTooTokenEventsColumns, + PrimaryKey: []*schema.Column{OhAuthTooTokenEventsColumns[0], OhAuthTooTokenEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "oh_auth_too_token_events_oh_auth_too_token_id", + Columns: []*schema.Column{OhAuthTooTokenEventsColumns[0]}, + RefColumns: []*schema.Column{OhAuthTooTokensColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "oh_auth_too_token_events_event_id", + Columns: []*schema.Column{OhAuthTooTokenEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // OrgMembershipEventsColumns holds the columns for the "org_membership_events" table. + OrgMembershipEventsColumns = []*schema.Column{ + {Name: "org_membership_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // OrgMembershipEventsTable holds the schema information for the "org_membership_events" table. + OrgMembershipEventsTable = &schema.Table{ + Name: "org_membership_events", + Columns: OrgMembershipEventsColumns, + PrimaryKey: []*schema.Column{OrgMembershipEventsColumns[0], OrgMembershipEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "org_membership_events_org_membership_id", + Columns: []*schema.Column{OrgMembershipEventsColumns[0]}, + RefColumns: []*schema.Column{OrgMembershipsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "org_membership_events_event_id", + Columns: []*schema.Column{OrgMembershipEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // OrganizationPersonalAccessTokensColumns holds the columns for the "organization_personal_access_tokens" table. + OrganizationPersonalAccessTokensColumns = []*schema.Column{ + {Name: "organization_id", Type: field.TypeString}, + {Name: "personal_access_token_id", Type: field.TypeString}, + } + // OrganizationPersonalAccessTokensTable holds the schema information for the "organization_personal_access_tokens" table. + OrganizationPersonalAccessTokensTable = &schema.Table{ + Name: "organization_personal_access_tokens", + Columns: OrganizationPersonalAccessTokensColumns, + PrimaryKey: []*schema.Column{OrganizationPersonalAccessTokensColumns[0], OrganizationPersonalAccessTokensColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "organization_personal_access_tokens_organization_id", + Columns: []*schema.Column{OrganizationPersonalAccessTokensColumns[0]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "organization_personal_access_tokens_personal_access_token_id", + Columns: []*schema.Column{OrganizationPersonalAccessTokensColumns[1]}, + RefColumns: []*schema.Column{PersonalAccessTokensColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // OrganizationEventsColumns holds the columns for the "organization_events" table. + OrganizationEventsColumns = []*schema.Column{ + {Name: "organization_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // OrganizationEventsTable holds the schema information for the "organization_events" table. + OrganizationEventsTable = &schema.Table{ + Name: "organization_events", + Columns: OrganizationEventsColumns, + PrimaryKey: []*schema.Column{OrganizationEventsColumns[0], OrganizationEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "organization_events_organization_id", + Columns: []*schema.Column{OrganizationEventsColumns[0]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "organization_events_event_id", + Columns: []*schema.Column{OrganizationEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // OrganizationSecretsColumns holds the columns for the "organization_secrets" table. + OrganizationSecretsColumns = []*schema.Column{ + {Name: "organization_id", Type: field.TypeString}, + {Name: "hush_id", Type: field.TypeString}, + } + // OrganizationSecretsTable holds the schema information for the "organization_secrets" table. + OrganizationSecretsTable = &schema.Table{ + Name: "organization_secrets", + Columns: OrganizationSecretsColumns, + PrimaryKey: []*schema.Column{OrganizationSecretsColumns[0], OrganizationSecretsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "organization_secrets_organization_id", + Columns: []*schema.Column{OrganizationSecretsColumns[0]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "organization_secrets_hush_id", + Columns: []*schema.Column{OrganizationSecretsColumns[1]}, + RefColumns: []*schema.Column{HushesColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // OrganizationFilesColumns holds the columns for the "organization_files" table. + OrganizationFilesColumns = []*schema.Column{ + {Name: "organization_id", Type: field.TypeString}, + {Name: "file_id", Type: field.TypeString}, + } + // OrganizationFilesTable holds the schema information for the "organization_files" table. + OrganizationFilesTable = &schema.Table{ + Name: "organization_files", + Columns: OrganizationFilesColumns, + PrimaryKey: []*schema.Column{OrganizationFilesColumns[0], OrganizationFilesColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "organization_files_organization_id", + Columns: []*schema.Column{OrganizationFilesColumns[0]}, + RefColumns: []*schema.Column{OrganizationsColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "organization_files_file_id", + Columns: []*schema.Column{OrganizationFilesColumns[1]}, + RefColumns: []*schema.Column{FilesColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // PersonalAccessTokenEventsColumns holds the columns for the "personal_access_token_events" table. + PersonalAccessTokenEventsColumns = []*schema.Column{ + {Name: "personal_access_token_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // PersonalAccessTokenEventsTable holds the schema information for the "personal_access_token_events" table. + PersonalAccessTokenEventsTable = &schema.Table{ + Name: "personal_access_token_events", + Columns: PersonalAccessTokenEventsColumns, + PrimaryKey: []*schema.Column{PersonalAccessTokenEventsColumns[0], PersonalAccessTokenEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "personal_access_token_events_personal_access_token_id", + Columns: []*schema.Column{PersonalAccessTokenEventsColumns[0]}, + RefColumns: []*schema.Column{PersonalAccessTokensColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "personal_access_token_events_event_id", + Columns: []*schema.Column{PersonalAccessTokenEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // SubscriberEventsColumns holds the columns for the "subscriber_events" table. + SubscriberEventsColumns = []*schema.Column{ + {Name: "subscriber_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // SubscriberEventsTable holds the schema information for the "subscriber_events" table. + SubscriberEventsTable = &schema.Table{ + Name: "subscriber_events", + Columns: SubscriberEventsColumns, + PrimaryKey: []*schema.Column{SubscriberEventsColumns[0], SubscriberEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "subscriber_events_subscriber_id", + Columns: []*schema.Column{SubscriberEventsColumns[0]}, + RefColumns: []*schema.Column{SubscribersColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "subscriber_events_event_id", + Columns: []*schema.Column{SubscriberEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // UserEventsColumns holds the columns for the "user_events" table. + UserEventsColumns = []*schema.Column{ + {Name: "user_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // UserEventsTable holds the schema information for the "user_events" table. + UserEventsTable = &schema.Table{ + Name: "user_events", + Columns: UserEventsColumns, + PrimaryKey: []*schema.Column{UserEventsColumns[0], UserEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "user_events_user_id", + Columns: []*schema.Column{UserEventsColumns[0]}, + RefColumns: []*schema.Column{UsersColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "user_events_event_id", + Columns: []*schema.Column{UserEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // WebhookEventsColumns holds the columns for the "webhook_events" table. + WebhookEventsColumns = []*schema.Column{ + {Name: "webhook_id", Type: field.TypeString}, + {Name: "event_id", Type: field.TypeString}, + } + // WebhookEventsTable holds the schema information for the "webhook_events" table. + WebhookEventsTable = &schema.Table{ + Name: "webhook_events", + Columns: WebhookEventsColumns, + PrimaryKey: []*schema.Column{WebhookEventsColumns[0], WebhookEventsColumns[1]}, + ForeignKeys: []*schema.ForeignKey{ + { + Symbol: "webhook_events_webhook_id", + Columns: []*schema.Column{WebhookEventsColumns[0]}, + RefColumns: []*schema.Column{WebhooksColumns[0]}, + OnDelete: schema.Cascade, + }, + { + Symbol: "webhook_events_event_id", + Columns: []*schema.Column{WebhookEventsColumns[1]}, + RefColumns: []*schema.Column{EventsColumns[0]}, + OnDelete: schema.Cascade, + }, + }, + } + // Tables holds all the tables in the schema. + Tables = []*schema.Table{ + APITokensTable, + ContactsTable, + ContactHistoryTable, + DocumentDataTable, + DocumentDataHistoryTable, + EmailVerificationTokensTable, + EntitlementsTable, + EntitlementHistoryTable, + EntitlementPlansTable, + EntitlementPlanFeaturesTable, + EntitlementPlanFeatureHistoryTable, + EntitlementPlanHistoryTable, + EntitiesTable, + EntityHistoryTable, + EntityTypesTable, + EntityTypeHistoryTable, + EventsTable, + EventHistoryTable, + FeaturesTable, + FeatureHistoryTable, + FilesTable, + FileHistoryTable, + GroupsTable, + GroupHistoryTable, + GroupMembershipsTable, + GroupMembershipHistoryTable, + GroupSettingsTable, + GroupSettingHistoryTable, + HushesTable, + HushHistoryTable, + IntegrationsTable, + IntegrationHistoryTable, + InvitesTable, + NotesTable, + NoteHistoryTable, + OauthProvidersTable, + OauthProviderHistoryTable, + OhAuthTooTokensTable, + OrgMembershipsTable, + OrgMembershipHistoryTable, + OrganizationsTable, + OrganizationHistoryTable, + OrganizationSettingsTable, + OrganizationSettingHistoryTable, + PasswordResetTokensTable, + PersonalAccessTokensTable, + SubscribersTable, + TfaSettingsTable, + TemplatesTable, + TemplateHistoryTable, + UsersTable, + UserHistoryTable, + UserSettingsTable, + UserSettingHistoryTable, + WebauthnsTable, + WebhooksTable, + WebhookHistoryTable, + EntitlementEventsTable, + EntitlementPlanEventsTable, + EntitlementPlanFeatureEventsTable, + EntityContactsTable, + EntityDocumentsTable, + EntityFilesTable, + FeatureEventsTable, + GroupEventsTable, + GroupFilesTable, + GroupMembershipEventsTable, + HushEventsTable, + IntegrationSecretsTable, + IntegrationOauth2tokensTable, + IntegrationEventsTable, + IntegrationWebhooksTable, + InviteEventsTable, + OhAuthTooTokenEventsTable, + OrgMembershipEventsTable, + OrganizationPersonalAccessTokensTable, + OrganizationEventsTable, + OrganizationSecretsTable, + OrganizationFilesTable, + PersonalAccessTokenEventsTable, + SubscriberEventsTable, + UserEventsTable, + WebhookEventsTable, + } +) + +func init() { + APITokensTable.ForeignKeys[0].RefTable = OrganizationsTable + ContactsTable.ForeignKeys[0].RefTable = OrganizationsTable + ContactHistoryTable.Annotation = &entsql.Annotation{ + Table: "contact_history", + } + DocumentDataTable.ForeignKeys[0].RefTable = OrganizationsTable + DocumentDataTable.ForeignKeys[1].RefTable = TemplatesTable + DocumentDataHistoryTable.Annotation = &entsql.Annotation{ + Table: "document_data_history", + } + EmailVerificationTokensTable.ForeignKeys[0].RefTable = UsersTable + EntitlementsTable.ForeignKeys[0].RefTable = EntitlementPlansTable + EntitlementsTable.ForeignKeys[1].RefTable = OrganizationsTable + EntitlementsTable.ForeignKeys[2].RefTable = OrganizationsTable + EntitlementHistoryTable.Annotation = &entsql.Annotation{ + Table: "entitlement_history", + } + EntitlementPlansTable.ForeignKeys[0].RefTable = OrganizationsTable + EntitlementPlanFeaturesTable.ForeignKeys[0].RefTable = EntitlementPlansTable + EntitlementPlanFeaturesTable.ForeignKeys[1].RefTable = FeaturesTable + EntitlementPlanFeaturesTable.ForeignKeys[2].RefTable = OrganizationsTable + EntitlementPlanFeatureHistoryTable.Annotation = &entsql.Annotation{ + Table: "entitlement_plan_feature_history", + } + EntitlementPlanHistoryTable.Annotation = &entsql.Annotation{ + Table: "entitlement_plan_history", + } + EntitiesTable.ForeignKeys[0].RefTable = EntityTypesTable + EntitiesTable.ForeignKeys[1].RefTable = EntityTypesTable + EntitiesTable.ForeignKeys[2].RefTable = OrganizationsTable + EntityHistoryTable.Annotation = &entsql.Annotation{ + Table: "entity_history", + } + EntityTypesTable.ForeignKeys[0].RefTable = OrganizationsTable + EntityTypeHistoryTable.Annotation = &entsql.Annotation{ + Table: "entity_type_history", + } + EventHistoryTable.Annotation = &entsql.Annotation{ + Table: "event_history", + } + FeaturesTable.ForeignKeys[0].RefTable = OrganizationsTable + FeatureHistoryTable.Annotation = &entsql.Annotation{ + Table: "feature_history", + } + FilesTable.ForeignKeys[0].RefTable = UsersTable + FileHistoryTable.Annotation = &entsql.Annotation{ + Table: "file_history", + } + GroupsTable.ForeignKeys[0].RefTable = OrganizationsTable + GroupHistoryTable.Annotation = &entsql.Annotation{ + Table: "group_history", + } + GroupMembershipsTable.ForeignKeys[0].RefTable = GroupsTable + GroupMembershipsTable.ForeignKeys[1].RefTable = UsersTable + GroupMembershipHistoryTable.Annotation = &entsql.Annotation{ + Table: "group_membership_history", + } + GroupSettingsTable.ForeignKeys[0].RefTable = GroupsTable + GroupSettingHistoryTable.Annotation = &entsql.Annotation{ + Table: "group_setting_history", + } + HushHistoryTable.Annotation = &entsql.Annotation{ + Table: "hush_history", + } + IntegrationsTable.ForeignKeys[0].RefTable = GroupsTable + IntegrationsTable.ForeignKeys[1].RefTable = OrganizationsTable + IntegrationHistoryTable.Annotation = &entsql.Annotation{ + Table: "integration_history", + } + InvitesTable.ForeignKeys[0].RefTable = OrganizationsTable + NotesTable.ForeignKeys[0].RefTable = EntitiesTable + NotesTable.ForeignKeys[1].RefTable = OrganizationsTable + NoteHistoryTable.Annotation = &entsql.Annotation{ + Table: "note_history", + } + OauthProvidersTable.ForeignKeys[0].RefTable = OrganizationsTable + OauthProviderHistoryTable.Annotation = &entsql.Annotation{ + Table: "oauth_provider_history", + } + OrgMembershipsTable.ForeignKeys[0].RefTable = OrganizationsTable + OrgMembershipsTable.ForeignKeys[1].RefTable = UsersTable + OrgMembershipHistoryTable.Annotation = &entsql.Annotation{ + Table: "org_membership_history", + } + OrganizationsTable.ForeignKeys[0].RefTable = OrganizationsTable + OrganizationHistoryTable.Annotation = &entsql.Annotation{ + Table: "organization_history", + } + OrganizationSettingsTable.ForeignKeys[0].RefTable = OrganizationsTable + OrganizationSettingHistoryTable.Annotation = &entsql.Annotation{ + Table: "organization_setting_history", + } + PasswordResetTokensTable.ForeignKeys[0].RefTable = UsersTable + PersonalAccessTokensTable.ForeignKeys[0].RefTable = UsersTable + SubscribersTable.ForeignKeys[0].RefTable = OrganizationsTable + TfaSettingsTable.ForeignKeys[0].RefTable = UsersTable + TemplatesTable.ForeignKeys[0].RefTable = OrganizationsTable + TemplateHistoryTable.Annotation = &entsql.Annotation{ + Table: "template_history", + } + UserHistoryTable.Annotation = &entsql.Annotation{ + Table: "user_history", + } + UserSettingsTable.ForeignKeys[0].RefTable = UsersTable + UserSettingsTable.ForeignKeys[1].RefTable = OrganizationsTable + UserSettingHistoryTable.Annotation = &entsql.Annotation{ + Table: "user_setting_history", + } + WebauthnsTable.ForeignKeys[0].RefTable = UsersTable + WebhooksTable.ForeignKeys[0].RefTable = OrganizationsTable + WebhookHistoryTable.Annotation = &entsql.Annotation{ + Table: "webhook_history", + } + EntitlementEventsTable.ForeignKeys[0].RefTable = EntitlementsTable + EntitlementEventsTable.ForeignKeys[1].RefTable = EventsTable + EntitlementPlanEventsTable.ForeignKeys[0].RefTable = EntitlementPlansTable + EntitlementPlanEventsTable.ForeignKeys[1].RefTable = EventsTable + EntitlementPlanFeatureEventsTable.ForeignKeys[0].RefTable = EntitlementPlanFeaturesTable + EntitlementPlanFeatureEventsTable.ForeignKeys[1].RefTable = EventsTable + EntityContactsTable.ForeignKeys[0].RefTable = EntitiesTable + EntityContactsTable.ForeignKeys[1].RefTable = ContactsTable + EntityDocumentsTable.ForeignKeys[0].RefTable = EntitiesTable + EntityDocumentsTable.ForeignKeys[1].RefTable = DocumentDataTable + EntityFilesTable.ForeignKeys[0].RefTable = EntitiesTable + EntityFilesTable.ForeignKeys[1].RefTable = FilesTable + FeatureEventsTable.ForeignKeys[0].RefTable = FeaturesTable + FeatureEventsTable.ForeignKeys[1].RefTable = EventsTable + GroupEventsTable.ForeignKeys[0].RefTable = GroupsTable + GroupEventsTable.ForeignKeys[1].RefTable = EventsTable + GroupFilesTable.ForeignKeys[0].RefTable = GroupsTable + GroupFilesTable.ForeignKeys[1].RefTable = FilesTable + GroupMembershipEventsTable.ForeignKeys[0].RefTable = GroupMembershipsTable + GroupMembershipEventsTable.ForeignKeys[1].RefTable = EventsTable + HushEventsTable.ForeignKeys[0].RefTable = HushesTable + HushEventsTable.ForeignKeys[1].RefTable = EventsTable + IntegrationSecretsTable.ForeignKeys[0].RefTable = IntegrationsTable + IntegrationSecretsTable.ForeignKeys[1].RefTable = HushesTable + IntegrationOauth2tokensTable.ForeignKeys[0].RefTable = IntegrationsTable + IntegrationOauth2tokensTable.ForeignKeys[1].RefTable = OhAuthTooTokensTable + IntegrationEventsTable.ForeignKeys[0].RefTable = IntegrationsTable + IntegrationEventsTable.ForeignKeys[1].RefTable = EventsTable + IntegrationWebhooksTable.ForeignKeys[0].RefTable = IntegrationsTable + IntegrationWebhooksTable.ForeignKeys[1].RefTable = WebhooksTable + InviteEventsTable.ForeignKeys[0].RefTable = InvitesTable + InviteEventsTable.ForeignKeys[1].RefTable = EventsTable + OhAuthTooTokenEventsTable.ForeignKeys[0].RefTable = OhAuthTooTokensTable + OhAuthTooTokenEventsTable.ForeignKeys[1].RefTable = EventsTable + OrgMembershipEventsTable.ForeignKeys[0].RefTable = OrgMembershipsTable + OrgMembershipEventsTable.ForeignKeys[1].RefTable = EventsTable + OrganizationPersonalAccessTokensTable.ForeignKeys[0].RefTable = OrganizationsTable + OrganizationPersonalAccessTokensTable.ForeignKeys[1].RefTable = PersonalAccessTokensTable + OrganizationEventsTable.ForeignKeys[0].RefTable = OrganizationsTable + OrganizationEventsTable.ForeignKeys[1].RefTable = EventsTable + OrganizationSecretsTable.ForeignKeys[0].RefTable = OrganizationsTable + OrganizationSecretsTable.ForeignKeys[1].RefTable = HushesTable + OrganizationFilesTable.ForeignKeys[0].RefTable = OrganizationsTable + OrganizationFilesTable.ForeignKeys[1].RefTable = FilesTable + PersonalAccessTokenEventsTable.ForeignKeys[0].RefTable = PersonalAccessTokensTable + PersonalAccessTokenEventsTable.ForeignKeys[1].RefTable = EventsTable + SubscriberEventsTable.ForeignKeys[0].RefTable = SubscribersTable + SubscriberEventsTable.ForeignKeys[1].RefTable = EventsTable + UserEventsTable.ForeignKeys[0].RefTable = UsersTable + UserEventsTable.ForeignKeys[1].RefTable = EventsTable + WebhookEventsTable.ForeignKeys[0].RefTable = WebhooksTable + WebhookEventsTable.ForeignKeys[1].RefTable = EventsTable +} diff --git a/internal/ent/generated/mutation.go b/internal/ent/generated/mutation.go new file mode 100644 index 0000000..65a3bec --- /dev/null +++ b/internal/ent/generated/mutation.go @@ -0,0 +1,86137 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Operation types. + OpCreate = ent.OpCreate + OpDelete = ent.OpDelete + OpDeleteOne = ent.OpDeleteOne + OpUpdate = ent.OpUpdate + OpUpdateOne = ent.OpUpdateOne + + // Node types. + TypeAPIToken = "APIToken" + TypeContact = "Contact" + TypeContactHistory = "ContactHistory" + TypeDocumentData = "DocumentData" + TypeDocumentDataHistory = "DocumentDataHistory" + TypeEmailVerificationToken = "EmailVerificationToken" + TypeEntitlement = "Entitlement" + TypeEntitlementHistory = "EntitlementHistory" + TypeEntitlementPlan = "EntitlementPlan" + TypeEntitlementPlanFeature = "EntitlementPlanFeature" + TypeEntitlementPlanFeatureHistory = "EntitlementPlanFeatureHistory" + TypeEntitlementPlanHistory = "EntitlementPlanHistory" + TypeEntity = "Entity" + TypeEntityHistory = "EntityHistory" + TypeEntityType = "EntityType" + TypeEntityTypeHistory = "EntityTypeHistory" + TypeEvent = "Event" + TypeEventHistory = "EventHistory" + TypeFeature = "Feature" + TypeFeatureHistory = "FeatureHistory" + TypeFile = "File" + TypeFileHistory = "FileHistory" + TypeGroup = "Group" + TypeGroupHistory = "GroupHistory" + TypeGroupMembership = "GroupMembership" + TypeGroupMembershipHistory = "GroupMembershipHistory" + TypeGroupSetting = "GroupSetting" + TypeGroupSettingHistory = "GroupSettingHistory" + TypeHush = "Hush" + TypeHushHistory = "HushHistory" + TypeIntegration = "Integration" + TypeIntegrationHistory = "IntegrationHistory" + TypeInvite = "Invite" + TypeNote = "Note" + TypeNoteHistory = "NoteHistory" + TypeOauthProvider = "OauthProvider" + TypeOauthProviderHistory = "OauthProviderHistory" + TypeOhAuthTooToken = "OhAuthTooToken" + TypeOrgMembership = "OrgMembership" + TypeOrgMembershipHistory = "OrgMembershipHistory" + TypeOrganization = "Organization" + TypeOrganizationHistory = "OrganizationHistory" + TypeOrganizationSetting = "OrganizationSetting" + TypeOrganizationSettingHistory = "OrganizationSettingHistory" + TypePasswordResetToken = "PasswordResetToken" + TypePersonalAccessToken = "PersonalAccessToken" + TypeSubscriber = "Subscriber" + TypeTFASetting = "TFASetting" + TypeTemplate = "Template" + TypeTemplateHistory = "TemplateHistory" + TypeUser = "User" + TypeUserHistory = "UserHistory" + TypeUserSetting = "UserSetting" + TypeUserSettingHistory = "UserSettingHistory" + TypeWebauthn = "Webauthn" + TypeWebhook = "Webhook" + TypeWebhookHistory = "WebhookHistory" +) + +// APITokenMutation represents an operation that mutates the APIToken nodes in the graph. +type APITokenMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + name *string + token *string + expires_at *time.Time + description *string + scopes *[]string + appendscopes []string + last_used_at *time.Time + clearedFields map[string]struct{} + owner *string + clearedowner bool + done bool + oldValue func(context.Context) (*APIToken, error) + predicates []predicate.APIToken +} + +var _ ent.Mutation = (*APITokenMutation)(nil) + +// apitokenOption allows management of the mutation configuration using functional options. +type apitokenOption func(*APITokenMutation) + +// newAPITokenMutation creates new mutation for the APIToken entity. +func newAPITokenMutation(c config, op Op, opts ...apitokenOption) *APITokenMutation { + m := &APITokenMutation{ + config: c, + op: op, + typ: TypeAPIToken, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withAPITokenID sets the ID field of the mutation. +func withAPITokenID(id string) apitokenOption { + return func(m *APITokenMutation) { + var ( + err error + once sync.Once + value *APIToken + ) + m.oldValue = func(ctx context.Context) (*APIToken, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().APIToken.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withAPIToken sets the old APIToken of the mutation. +func withAPIToken(node *APIToken) apitokenOption { + return func(m *APITokenMutation) { + m.oldValue = func(context.Context) (*APIToken, 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 APITokenMutation) 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 APITokenMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of APIToken entities. +func (m *APITokenMutation) SetID(id string) { + 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 *APITokenMutation) ID() (id string, 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 *APITokenMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().APIToken.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *APITokenMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *APITokenMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *APITokenMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[apitoken.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *APITokenMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[apitoken.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *APITokenMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, apitoken.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *APITokenMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *APITokenMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *APITokenMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[apitoken.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *APITokenMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[apitoken.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *APITokenMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, apitoken.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *APITokenMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *APITokenMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *APITokenMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[apitoken.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *APITokenMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[apitoken.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *APITokenMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, apitoken.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *APITokenMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *APITokenMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *APITokenMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[apitoken.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *APITokenMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[apitoken.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *APITokenMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, apitoken.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *APITokenMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *APITokenMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *APITokenMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[apitoken.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *APITokenMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[apitoken.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *APITokenMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, apitoken.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *APITokenMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *APITokenMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *APITokenMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[apitoken.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *APITokenMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[apitoken.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *APITokenMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, apitoken.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *APITokenMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *APITokenMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *APITokenMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *APITokenMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *APITokenMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *APITokenMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *APITokenMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *APITokenMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[apitoken.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *APITokenMutation) TagsCleared() bool { + _, ok := m.clearedFields[apitoken.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *APITokenMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, apitoken.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *APITokenMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *APITokenMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *APITokenMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[apitoken.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *APITokenMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[apitoken.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *APITokenMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, apitoken.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *APITokenMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *APITokenMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *APITokenMutation) ResetName() { + m.name = nil +} + +// SetToken sets the "token" field. +func (m *APITokenMutation) SetToken(s string) { + m.token = &s +} + +// Token returns the value of the "token" field in the mutation. +func (m *APITokenMutation) Token() (r string, exists bool) { + v := m.token + if v == nil { + return + } + return *v, true +} + +// OldToken returns the old "token" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldToken(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldToken is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldToken requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldToken: %w", err) + } + return oldValue.Token, nil +} + +// ResetToken resets all changes to the "token" field. +func (m *APITokenMutation) ResetToken() { + m.token = nil +} + +// SetExpiresAt sets the "expires_at" field. +func (m *APITokenMutation) SetExpiresAt(t time.Time) { + m.expires_at = &t +} + +// ExpiresAt returns the value of the "expires_at" field in the mutation. +func (m *APITokenMutation) ExpiresAt() (r time.Time, exists bool) { + v := m.expires_at + if v == nil { + return + } + return *v, true +} + +// OldExpiresAt returns the old "expires_at" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpiresAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpiresAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpiresAt: %w", err) + } + return oldValue.ExpiresAt, nil +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (m *APITokenMutation) ClearExpiresAt() { + m.expires_at = nil + m.clearedFields[apitoken.FieldExpiresAt] = struct{}{} +} + +// ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation. +func (m *APITokenMutation) ExpiresAtCleared() bool { + _, ok := m.clearedFields[apitoken.FieldExpiresAt] + return ok +} + +// ResetExpiresAt resets all changes to the "expires_at" field. +func (m *APITokenMutation) ResetExpiresAt() { + m.expires_at = nil + delete(m.clearedFields, apitoken.FieldExpiresAt) +} + +// SetDescription sets the "description" field. +func (m *APITokenMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *APITokenMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldDescription(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *APITokenMutation) ClearDescription() { + m.description = nil + m.clearedFields[apitoken.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *APITokenMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[apitoken.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *APITokenMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, apitoken.FieldDescription) +} + +// SetScopes sets the "scopes" field. +func (m *APITokenMutation) SetScopes(s []string) { + m.scopes = &s + m.appendscopes = nil +} + +// Scopes returns the value of the "scopes" field in the mutation. +func (m *APITokenMutation) Scopes() (r []string, exists bool) { + v := m.scopes + if v == nil { + return + } + return *v, true +} + +// OldScopes returns the old "scopes" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldScopes(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldScopes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldScopes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldScopes: %w", err) + } + return oldValue.Scopes, nil +} + +// AppendScopes adds s to the "scopes" field. +func (m *APITokenMutation) AppendScopes(s []string) { + m.appendscopes = append(m.appendscopes, s...) +} + +// AppendedScopes returns the list of values that were appended to the "scopes" field in this mutation. +func (m *APITokenMutation) AppendedScopes() ([]string, bool) { + if len(m.appendscopes) == 0 { + return nil, false + } + return m.appendscopes, true +} + +// ClearScopes clears the value of the "scopes" field. +func (m *APITokenMutation) ClearScopes() { + m.scopes = nil + m.appendscopes = nil + m.clearedFields[apitoken.FieldScopes] = struct{}{} +} + +// ScopesCleared returns if the "scopes" field was cleared in this mutation. +func (m *APITokenMutation) ScopesCleared() bool { + _, ok := m.clearedFields[apitoken.FieldScopes] + return ok +} + +// ResetScopes resets all changes to the "scopes" field. +func (m *APITokenMutation) ResetScopes() { + m.scopes = nil + m.appendscopes = nil + delete(m.clearedFields, apitoken.FieldScopes) +} + +// SetLastUsedAt sets the "last_used_at" field. +func (m *APITokenMutation) SetLastUsedAt(t time.Time) { + m.last_used_at = &t +} + +// LastUsedAt returns the value of the "last_used_at" field in the mutation. +func (m *APITokenMutation) LastUsedAt() (r time.Time, exists bool) { + v := m.last_used_at + if v == nil { + return + } + return *v, true +} + +// OldLastUsedAt returns the old "last_used_at" field's value of the APIToken entity. +// If the APIToken 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 *APITokenMutation) OldLastUsedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastUsedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastUsedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastUsedAt: %w", err) + } + return oldValue.LastUsedAt, nil +} + +// ClearLastUsedAt clears the value of the "last_used_at" field. +func (m *APITokenMutation) ClearLastUsedAt() { + m.last_used_at = nil + m.clearedFields[apitoken.FieldLastUsedAt] = struct{}{} +} + +// LastUsedAtCleared returns if the "last_used_at" field was cleared in this mutation. +func (m *APITokenMutation) LastUsedAtCleared() bool { + _, ok := m.clearedFields[apitoken.FieldLastUsedAt] + return ok +} + +// ResetLastUsedAt resets all changes to the "last_used_at" field. +func (m *APITokenMutation) ResetLastUsedAt() { + m.last_used_at = nil + delete(m.clearedFields, apitoken.FieldLastUsedAt) +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *APITokenMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[apitoken.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *APITokenMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *APITokenMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *APITokenMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// Where appends a list predicates to the APITokenMutation builder. +func (m *APITokenMutation) Where(ps ...predicate.APIToken) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the APITokenMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *APITokenMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.APIToken, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *APITokenMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *APITokenMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (APIToken). +func (m *APITokenMutation) 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 *APITokenMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.created_at != nil { + fields = append(fields, apitoken.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, apitoken.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, apitoken.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, apitoken.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, apitoken.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, apitoken.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, apitoken.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, apitoken.FieldTags) + } + if m.owner != nil { + fields = append(fields, apitoken.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, apitoken.FieldName) + } + if m.token != nil { + fields = append(fields, apitoken.FieldToken) + } + if m.expires_at != nil { + fields = append(fields, apitoken.FieldExpiresAt) + } + if m.description != nil { + fields = append(fields, apitoken.FieldDescription) + } + if m.scopes != nil { + fields = append(fields, apitoken.FieldScopes) + } + if m.last_used_at != nil { + fields = append(fields, apitoken.FieldLastUsedAt) + } + 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 *APITokenMutation) Field(name string) (ent.Value, bool) { + switch name { + case apitoken.FieldCreatedAt: + return m.CreatedAt() + case apitoken.FieldUpdatedAt: + return m.UpdatedAt() + case apitoken.FieldCreatedBy: + return m.CreatedBy() + case apitoken.FieldUpdatedBy: + return m.UpdatedBy() + case apitoken.FieldDeletedAt: + return m.DeletedAt() + case apitoken.FieldDeletedBy: + return m.DeletedBy() + case apitoken.FieldMappingID: + return m.MappingID() + case apitoken.FieldTags: + return m.Tags() + case apitoken.FieldOwnerID: + return m.OwnerID() + case apitoken.FieldName: + return m.Name() + case apitoken.FieldToken: + return m.Token() + case apitoken.FieldExpiresAt: + return m.ExpiresAt() + case apitoken.FieldDescription: + return m.Description() + case apitoken.FieldScopes: + return m.Scopes() + case apitoken.FieldLastUsedAt: + return m.LastUsedAt() + } + 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 *APITokenMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case apitoken.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case apitoken.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case apitoken.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case apitoken.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case apitoken.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case apitoken.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case apitoken.FieldMappingID: + return m.OldMappingID(ctx) + case apitoken.FieldTags: + return m.OldTags(ctx) + case apitoken.FieldOwnerID: + return m.OldOwnerID(ctx) + case apitoken.FieldName: + return m.OldName(ctx) + case apitoken.FieldToken: + return m.OldToken(ctx) + case apitoken.FieldExpiresAt: + return m.OldExpiresAt(ctx) + case apitoken.FieldDescription: + return m.OldDescription(ctx) + case apitoken.FieldScopes: + return m.OldScopes(ctx) + case apitoken.FieldLastUsedAt: + return m.OldLastUsedAt(ctx) + } + return nil, fmt.Errorf("unknown APIToken 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 *APITokenMutation) SetField(name string, value ent.Value) error { + switch name { + case apitoken.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case apitoken.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case apitoken.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case apitoken.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case apitoken.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case apitoken.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case apitoken.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case apitoken.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case apitoken.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case apitoken.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case apitoken.FieldToken: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetToken(v) + return nil + case apitoken.FieldExpiresAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpiresAt(v) + return nil + case apitoken.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case apitoken.FieldScopes: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetScopes(v) + return nil + case apitoken.FieldLastUsedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastUsedAt(v) + return nil + } + return fmt.Errorf("unknown APIToken field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *APITokenMutation) 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 *APITokenMutation) 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 *APITokenMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown APIToken numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *APITokenMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(apitoken.FieldCreatedAt) { + fields = append(fields, apitoken.FieldCreatedAt) + } + if m.FieldCleared(apitoken.FieldUpdatedAt) { + fields = append(fields, apitoken.FieldUpdatedAt) + } + if m.FieldCleared(apitoken.FieldCreatedBy) { + fields = append(fields, apitoken.FieldCreatedBy) + } + if m.FieldCleared(apitoken.FieldUpdatedBy) { + fields = append(fields, apitoken.FieldUpdatedBy) + } + if m.FieldCleared(apitoken.FieldDeletedAt) { + fields = append(fields, apitoken.FieldDeletedAt) + } + if m.FieldCleared(apitoken.FieldDeletedBy) { + fields = append(fields, apitoken.FieldDeletedBy) + } + if m.FieldCleared(apitoken.FieldTags) { + fields = append(fields, apitoken.FieldTags) + } + if m.FieldCleared(apitoken.FieldOwnerID) { + fields = append(fields, apitoken.FieldOwnerID) + } + if m.FieldCleared(apitoken.FieldExpiresAt) { + fields = append(fields, apitoken.FieldExpiresAt) + } + if m.FieldCleared(apitoken.FieldDescription) { + fields = append(fields, apitoken.FieldDescription) + } + if m.FieldCleared(apitoken.FieldScopes) { + fields = append(fields, apitoken.FieldScopes) + } + if m.FieldCleared(apitoken.FieldLastUsedAt) { + fields = append(fields, apitoken.FieldLastUsedAt) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *APITokenMutation) 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 *APITokenMutation) ClearField(name string) error { + switch name { + case apitoken.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case apitoken.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case apitoken.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case apitoken.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case apitoken.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case apitoken.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case apitoken.FieldTags: + m.ClearTags() + return nil + case apitoken.FieldOwnerID: + m.ClearOwnerID() + return nil + case apitoken.FieldExpiresAt: + m.ClearExpiresAt() + return nil + case apitoken.FieldDescription: + m.ClearDescription() + return nil + case apitoken.FieldScopes: + m.ClearScopes() + return nil + case apitoken.FieldLastUsedAt: + m.ClearLastUsedAt() + return nil + } + return fmt.Errorf("unknown APIToken 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 *APITokenMutation) ResetField(name string) error { + switch name { + case apitoken.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case apitoken.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case apitoken.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case apitoken.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case apitoken.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case apitoken.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case apitoken.FieldMappingID: + m.ResetMappingID() + return nil + case apitoken.FieldTags: + m.ResetTags() + return nil + case apitoken.FieldOwnerID: + m.ResetOwnerID() + return nil + case apitoken.FieldName: + m.ResetName() + return nil + case apitoken.FieldToken: + m.ResetToken() + return nil + case apitoken.FieldExpiresAt: + m.ResetExpiresAt() + return nil + case apitoken.FieldDescription: + m.ResetDescription() + return nil + case apitoken.FieldScopes: + m.ResetScopes() + return nil + case apitoken.FieldLastUsedAt: + m.ResetLastUsedAt() + return nil + } + return fmt.Errorf("unknown APIToken field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *APITokenMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.owner != nil { + edges = append(edges, apitoken.EdgeOwner) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *APITokenMutation) AddedIDs(name string) []ent.Value { + switch name { + case apitoken.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *APITokenMutation) 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 *APITokenMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *APITokenMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedowner { + edges = append(edges, apitoken.EdgeOwner) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *APITokenMutation) EdgeCleared(name string) bool { + switch name { + case apitoken.EdgeOwner: + return m.clearedowner + } + 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 *APITokenMutation) ClearEdge(name string) error { + switch name { + case apitoken.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown APIToken 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 *APITokenMutation) ResetEdge(name string) error { + switch name { + case apitoken.EdgeOwner: + m.ResetOwner() + return nil + } + return fmt.Errorf("unknown APIToken edge %s", name) +} + +// ContactMutation represents an operation that mutates the Contact nodes in the graph. +type ContactMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + full_name *string + title *string + company *string + email *string + phone_number *string + address *string + status *enums.UserStatus + clearedFields map[string]struct{} + owner *string + clearedowner bool + entities map[string]struct{} + removedentities map[string]struct{} + clearedentities bool + done bool + oldValue func(context.Context) (*Contact, error) + predicates []predicate.Contact +} + +var _ ent.Mutation = (*ContactMutation)(nil) + +// contactOption allows management of the mutation configuration using functional options. +type contactOption func(*ContactMutation) + +// newContactMutation creates new mutation for the Contact entity. +func newContactMutation(c config, op Op, opts ...contactOption) *ContactMutation { + m := &ContactMutation{ + config: c, + op: op, + typ: TypeContact, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withContactID sets the ID field of the mutation. +func withContactID(id string) contactOption { + return func(m *ContactMutation) { + var ( + err error + once sync.Once + value *Contact + ) + m.oldValue = func(ctx context.Context) (*Contact, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Contact.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withContact sets the old Contact of the mutation. +func withContact(node *Contact) contactOption { + return func(m *ContactMutation) { + m.oldValue = func(context.Context) (*Contact, 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 ContactMutation) 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 ContactMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Contact entities. +func (m *ContactMutation) SetID(id string) { + 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 *ContactMutation) ID() (id string, 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 *ContactMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Contact.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *ContactMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *ContactMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *ContactMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[contact.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *ContactMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[contact.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *ContactMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, contact.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *ContactMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *ContactMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *ContactMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[contact.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *ContactMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[contact.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *ContactMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, contact.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *ContactMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *ContactMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *ContactMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[contact.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *ContactMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[contact.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *ContactMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, contact.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *ContactMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *ContactMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *ContactMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[contact.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *ContactMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[contact.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *ContactMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, contact.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *ContactMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *ContactMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *ContactMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *ContactMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *ContactMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *ContactMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[contact.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *ContactMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[contact.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *ContactMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, contact.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *ContactMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *ContactMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *ContactMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[contact.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *ContactMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[contact.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *ContactMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, contact.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *ContactMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *ContactMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *ContactMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *ContactMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *ContactMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[contact.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *ContactMutation) TagsCleared() bool { + _, ok := m.clearedFields[contact.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *ContactMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, contact.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *ContactMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *ContactMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *ContactMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[contact.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *ContactMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[contact.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *ContactMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, contact.FieldOwnerID) +} + +// SetFullName sets the "full_name" field. +func (m *ContactMutation) SetFullName(s string) { + m.full_name = &s +} + +// FullName returns the value of the "full_name" field in the mutation. +func (m *ContactMutation) FullName() (r string, exists bool) { + v := m.full_name + if v == nil { + return + } + return *v, true +} + +// OldFullName returns the old "full_name" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldFullName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFullName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFullName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFullName: %w", err) + } + return oldValue.FullName, nil +} + +// ResetFullName resets all changes to the "full_name" field. +func (m *ContactMutation) ResetFullName() { + m.full_name = nil +} + +// SetTitle sets the "title" field. +func (m *ContactMutation) SetTitle(s string) { + m.title = &s +} + +// Title returns the value of the "title" field in the mutation. +func (m *ContactMutation) Title() (r string, exists bool) { + v := m.title + if v == nil { + return + } + return *v, true +} + +// OldTitle returns the old "title" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldTitle(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTitle is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTitle requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTitle: %w", err) + } + return oldValue.Title, nil +} + +// ClearTitle clears the value of the "title" field. +func (m *ContactMutation) ClearTitle() { + m.title = nil + m.clearedFields[contact.FieldTitle] = struct{}{} +} + +// TitleCleared returns if the "title" field was cleared in this mutation. +func (m *ContactMutation) TitleCleared() bool { + _, ok := m.clearedFields[contact.FieldTitle] + return ok +} + +// ResetTitle resets all changes to the "title" field. +func (m *ContactMutation) ResetTitle() { + m.title = nil + delete(m.clearedFields, contact.FieldTitle) +} + +// SetCompany sets the "company" field. +func (m *ContactMutation) SetCompany(s string) { + m.company = &s +} + +// Company returns the value of the "company" field in the mutation. +func (m *ContactMutation) Company() (r string, exists bool) { + v := m.company + if v == nil { + return + } + return *v, true +} + +// OldCompany returns the old "company" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldCompany(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCompany is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCompany requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCompany: %w", err) + } + return oldValue.Company, nil +} + +// ClearCompany clears the value of the "company" field. +func (m *ContactMutation) ClearCompany() { + m.company = nil + m.clearedFields[contact.FieldCompany] = struct{}{} +} + +// CompanyCleared returns if the "company" field was cleared in this mutation. +func (m *ContactMutation) CompanyCleared() bool { + _, ok := m.clearedFields[contact.FieldCompany] + return ok +} + +// ResetCompany resets all changes to the "company" field. +func (m *ContactMutation) ResetCompany() { + m.company = nil + delete(m.clearedFields, contact.FieldCompany) +} + +// SetEmail sets the "email" field. +func (m *ContactMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *ContactMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ClearEmail clears the value of the "email" field. +func (m *ContactMutation) ClearEmail() { + m.email = nil + m.clearedFields[contact.FieldEmail] = struct{}{} +} + +// EmailCleared returns if the "email" field was cleared in this mutation. +func (m *ContactMutation) EmailCleared() bool { + _, ok := m.clearedFields[contact.FieldEmail] + return ok +} + +// ResetEmail resets all changes to the "email" field. +func (m *ContactMutation) ResetEmail() { + m.email = nil + delete(m.clearedFields, contact.FieldEmail) +} + +// SetPhoneNumber sets the "phone_number" field. +func (m *ContactMutation) SetPhoneNumber(s string) { + m.phone_number = &s +} + +// PhoneNumber returns the value of the "phone_number" field in the mutation. +func (m *ContactMutation) PhoneNumber() (r string, exists bool) { + v := m.phone_number + if v == nil { + return + } + return *v, true +} + +// OldPhoneNumber returns the old "phone_number" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldPhoneNumber(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPhoneNumber is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPhoneNumber requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhoneNumber: %w", err) + } + return oldValue.PhoneNumber, nil +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (m *ContactMutation) ClearPhoneNumber() { + m.phone_number = nil + m.clearedFields[contact.FieldPhoneNumber] = struct{}{} +} + +// PhoneNumberCleared returns if the "phone_number" field was cleared in this mutation. +func (m *ContactMutation) PhoneNumberCleared() bool { + _, ok := m.clearedFields[contact.FieldPhoneNumber] + return ok +} + +// ResetPhoneNumber resets all changes to the "phone_number" field. +func (m *ContactMutation) ResetPhoneNumber() { + m.phone_number = nil + delete(m.clearedFields, contact.FieldPhoneNumber) +} + +// SetAddress sets the "address" field. +func (m *ContactMutation) SetAddress(s string) { + m.address = &s +} + +// Address returns the value of the "address" field in the mutation. +func (m *ContactMutation) Address() (r string, exists bool) { + v := m.address + if v == nil { + return + } + return *v, true +} + +// OldAddress returns the old "address" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldAddress(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAddress is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAddress: %w", err) + } + return oldValue.Address, nil +} + +// ClearAddress clears the value of the "address" field. +func (m *ContactMutation) ClearAddress() { + m.address = nil + m.clearedFields[contact.FieldAddress] = struct{}{} +} + +// AddressCleared returns if the "address" field was cleared in this mutation. +func (m *ContactMutation) AddressCleared() bool { + _, ok := m.clearedFields[contact.FieldAddress] + return ok +} + +// ResetAddress resets all changes to the "address" field. +func (m *ContactMutation) ResetAddress() { + m.address = nil + delete(m.clearedFields, contact.FieldAddress) +} + +// SetStatus sets the "status" field. +func (m *ContactMutation) SetStatus(es enums.UserStatus) { + m.status = &es +} + +// Status returns the value of the "status" field in the mutation. +func (m *ContactMutation) Status() (r enums.UserStatus, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the Contact entity. +// If the Contact 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 *ContactMutation) OldStatus(ctx context.Context) (v enums.UserStatus, 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 +} + +// ResetStatus resets all changes to the "status" field. +func (m *ContactMutation) ResetStatus() { + m.status = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *ContactMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[contact.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *ContactMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *ContactMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *ContactMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by ids. +func (m *ContactMutation) AddEntityIDs(ids ...string) { + if m.entities == nil { + m.entities = make(map[string]struct{}) + } + for i := range ids { + m.entities[ids[i]] = struct{}{} + } +} + +// ClearEntities clears the "entities" edge to the Entity entity. +func (m *ContactMutation) ClearEntities() { + m.clearedentities = true +} + +// EntitiesCleared reports if the "entities" edge to the Entity entity was cleared. +func (m *ContactMutation) EntitiesCleared() bool { + return m.clearedentities +} + +// RemoveEntityIDs removes the "entities" edge to the Entity entity by IDs. +func (m *ContactMutation) RemoveEntityIDs(ids ...string) { + if m.removedentities == nil { + m.removedentities = make(map[string]struct{}) + } + for i := range ids { + delete(m.entities, ids[i]) + m.removedentities[ids[i]] = struct{}{} + } +} + +// RemovedEntities returns the removed IDs of the "entities" edge to the Entity entity. +func (m *ContactMutation) RemovedEntitiesIDs() (ids []string) { + for id := range m.removedentities { + ids = append(ids, id) + } + return +} + +// EntitiesIDs returns the "entities" edge IDs in the mutation. +func (m *ContactMutation) EntitiesIDs() (ids []string) { + for id := range m.entities { + ids = append(ids, id) + } + return +} + +// ResetEntities resets all changes to the "entities" edge. +func (m *ContactMutation) ResetEntities() { + m.entities = nil + m.clearedentities = false + m.removedentities = nil +} + +// Where appends a list predicates to the ContactMutation builder. +func (m *ContactMutation) Where(ps ...predicate.Contact) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the ContactMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *ContactMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Contact, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *ContactMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *ContactMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Contact). +func (m *ContactMutation) 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 *ContactMutation) Fields() []string { + fields := make([]string, 0, 16) + if m.created_at != nil { + fields = append(fields, contact.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, contact.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, contact.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, contact.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, contact.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, contact.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, contact.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, contact.FieldTags) + } + if m.owner != nil { + fields = append(fields, contact.FieldOwnerID) + } + if m.full_name != nil { + fields = append(fields, contact.FieldFullName) + } + if m.title != nil { + fields = append(fields, contact.FieldTitle) + } + if m.company != nil { + fields = append(fields, contact.FieldCompany) + } + if m.email != nil { + fields = append(fields, contact.FieldEmail) + } + if m.phone_number != nil { + fields = append(fields, contact.FieldPhoneNumber) + } + if m.address != nil { + fields = append(fields, contact.FieldAddress) + } + if m.status != nil { + fields = append(fields, contact.FieldStatus) + } + 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 *ContactMutation) Field(name string) (ent.Value, bool) { + switch name { + case contact.FieldCreatedAt: + return m.CreatedAt() + case contact.FieldUpdatedAt: + return m.UpdatedAt() + case contact.FieldCreatedBy: + return m.CreatedBy() + case contact.FieldUpdatedBy: + return m.UpdatedBy() + case contact.FieldMappingID: + return m.MappingID() + case contact.FieldDeletedAt: + return m.DeletedAt() + case contact.FieldDeletedBy: + return m.DeletedBy() + case contact.FieldTags: + return m.Tags() + case contact.FieldOwnerID: + return m.OwnerID() + case contact.FieldFullName: + return m.FullName() + case contact.FieldTitle: + return m.Title() + case contact.FieldCompany: + return m.Company() + case contact.FieldEmail: + return m.Email() + case contact.FieldPhoneNumber: + return m.PhoneNumber() + case contact.FieldAddress: + return m.Address() + case contact.FieldStatus: + return m.Status() + } + 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 *ContactMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case contact.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case contact.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case contact.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case contact.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case contact.FieldMappingID: + return m.OldMappingID(ctx) + case contact.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case contact.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case contact.FieldTags: + return m.OldTags(ctx) + case contact.FieldOwnerID: + return m.OldOwnerID(ctx) + case contact.FieldFullName: + return m.OldFullName(ctx) + case contact.FieldTitle: + return m.OldTitle(ctx) + case contact.FieldCompany: + return m.OldCompany(ctx) + case contact.FieldEmail: + return m.OldEmail(ctx) + case contact.FieldPhoneNumber: + return m.OldPhoneNumber(ctx) + case contact.FieldAddress: + return m.OldAddress(ctx) + case contact.FieldStatus: + return m.OldStatus(ctx) + } + return nil, fmt.Errorf("unknown Contact 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 *ContactMutation) SetField(name string, value ent.Value) error { + switch name { + case contact.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case contact.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case contact.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case contact.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case contact.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case contact.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case contact.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case contact.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case contact.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case contact.FieldFullName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFullName(v) + return nil + case contact.FieldTitle: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTitle(v) + return nil + case contact.FieldCompany: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCompany(v) + return nil + case contact.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case contact.FieldPhoneNumber: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPhoneNumber(v) + return nil + case contact.FieldAddress: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAddress(v) + return nil + case contact.FieldStatus: + v, ok := value.(enums.UserStatus) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + } + return fmt.Errorf("unknown Contact field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *ContactMutation) 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 *ContactMutation) 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 *ContactMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Contact numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *ContactMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(contact.FieldCreatedAt) { + fields = append(fields, contact.FieldCreatedAt) + } + if m.FieldCleared(contact.FieldUpdatedAt) { + fields = append(fields, contact.FieldUpdatedAt) + } + if m.FieldCleared(contact.FieldCreatedBy) { + fields = append(fields, contact.FieldCreatedBy) + } + if m.FieldCleared(contact.FieldUpdatedBy) { + fields = append(fields, contact.FieldUpdatedBy) + } + if m.FieldCleared(contact.FieldDeletedAt) { + fields = append(fields, contact.FieldDeletedAt) + } + if m.FieldCleared(contact.FieldDeletedBy) { + fields = append(fields, contact.FieldDeletedBy) + } + if m.FieldCleared(contact.FieldTags) { + fields = append(fields, contact.FieldTags) + } + if m.FieldCleared(contact.FieldOwnerID) { + fields = append(fields, contact.FieldOwnerID) + } + if m.FieldCleared(contact.FieldTitle) { + fields = append(fields, contact.FieldTitle) + } + if m.FieldCleared(contact.FieldCompany) { + fields = append(fields, contact.FieldCompany) + } + if m.FieldCleared(contact.FieldEmail) { + fields = append(fields, contact.FieldEmail) + } + if m.FieldCleared(contact.FieldPhoneNumber) { + fields = append(fields, contact.FieldPhoneNumber) + } + if m.FieldCleared(contact.FieldAddress) { + fields = append(fields, contact.FieldAddress) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *ContactMutation) 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 *ContactMutation) ClearField(name string) error { + switch name { + case contact.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case contact.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case contact.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case contact.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case contact.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case contact.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case contact.FieldTags: + m.ClearTags() + return nil + case contact.FieldOwnerID: + m.ClearOwnerID() + return nil + case contact.FieldTitle: + m.ClearTitle() + return nil + case contact.FieldCompany: + m.ClearCompany() + return nil + case contact.FieldEmail: + m.ClearEmail() + return nil + case contact.FieldPhoneNumber: + m.ClearPhoneNumber() + return nil + case contact.FieldAddress: + m.ClearAddress() + return nil + } + return fmt.Errorf("unknown Contact 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 *ContactMutation) ResetField(name string) error { + switch name { + case contact.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case contact.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case contact.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case contact.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case contact.FieldMappingID: + m.ResetMappingID() + return nil + case contact.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case contact.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case contact.FieldTags: + m.ResetTags() + return nil + case contact.FieldOwnerID: + m.ResetOwnerID() + return nil + case contact.FieldFullName: + m.ResetFullName() + return nil + case contact.FieldTitle: + m.ResetTitle() + return nil + case contact.FieldCompany: + m.ResetCompany() + return nil + case contact.FieldEmail: + m.ResetEmail() + return nil + case contact.FieldPhoneNumber: + m.ResetPhoneNumber() + return nil + case contact.FieldAddress: + m.ResetAddress() + return nil + case contact.FieldStatus: + m.ResetStatus() + return nil + } + return fmt.Errorf("unknown Contact field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *ContactMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.owner != nil { + edges = append(edges, contact.EdgeOwner) + } + if m.entities != nil { + edges = append(edges, contact.EdgeEntities) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *ContactMutation) AddedIDs(name string) []ent.Value { + switch name { + case contact.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case contact.EdgeEntities: + ids := make([]ent.Value, 0, len(m.entities)) + for id := range m.entities { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *ContactMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedentities != nil { + edges = append(edges, contact.EdgeEntities) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *ContactMutation) RemovedIDs(name string) []ent.Value { + switch name { + case contact.EdgeEntities: + ids := make([]ent.Value, 0, len(m.removedentities)) + for id := range m.removedentities { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *ContactMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedowner { + edges = append(edges, contact.EdgeOwner) + } + if m.clearedentities { + edges = append(edges, contact.EdgeEntities) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *ContactMutation) EdgeCleared(name string) bool { + switch name { + case contact.EdgeOwner: + return m.clearedowner + case contact.EdgeEntities: + return m.clearedentities + } + 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 *ContactMutation) ClearEdge(name string) error { + switch name { + case contact.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Contact 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 *ContactMutation) ResetEdge(name string) error { + switch name { + case contact.EdgeOwner: + m.ResetOwner() + return nil + case contact.EdgeEntities: + m.ResetEntities() + return nil + } + return fmt.Errorf("unknown Contact edge %s", name) +} + +// ContactHistoryMutation represents an operation that mutates the ContactHistory nodes in the graph. +type ContactHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + owner_id *string + full_name *string + title *string + company *string + email *string + phone_number *string + address *string + status *enums.UserStatus + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*ContactHistory, error) + predicates []predicate.ContactHistory +} + +var _ ent.Mutation = (*ContactHistoryMutation)(nil) + +// contacthistoryOption allows management of the mutation configuration using functional options. +type contacthistoryOption func(*ContactHistoryMutation) + +// newContactHistoryMutation creates new mutation for the ContactHistory entity. +func newContactHistoryMutation(c config, op Op, opts ...contacthistoryOption) *ContactHistoryMutation { + m := &ContactHistoryMutation{ + config: c, + op: op, + typ: TypeContactHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withContactHistoryID sets the ID field of the mutation. +func withContactHistoryID(id string) contacthistoryOption { + return func(m *ContactHistoryMutation) { + var ( + err error + once sync.Once + value *ContactHistory + ) + m.oldValue = func(ctx context.Context) (*ContactHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().ContactHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withContactHistory sets the old ContactHistory of the mutation. +func withContactHistory(node *ContactHistory) contacthistoryOption { + return func(m *ContactHistoryMutation) { + m.oldValue = func(context.Context) (*ContactHistory, 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 ContactHistoryMutation) 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 ContactHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of ContactHistory entities. +func (m *ContactHistoryMutation) SetID(id string) { + 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 *ContactHistoryMutation) ID() (id string, 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 *ContactHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().ContactHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *ContactHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *ContactHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *ContactHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *ContactHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *ContactHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *ContactHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[contacthistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *ContactHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *ContactHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, contacthistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *ContactHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *ContactHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *ContactHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *ContactHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *ContactHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *ContactHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[contacthistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *ContactHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *ContactHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, contacthistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *ContactHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *ContactHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *ContactHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[contacthistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *ContactHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *ContactHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, contacthistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *ContactHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *ContactHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *ContactHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[contacthistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *ContactHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *ContactHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, contacthistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *ContactHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *ContactHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *ContactHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[contacthistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *ContactHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *ContactHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, contacthistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *ContactHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *ContactHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *ContactHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *ContactHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *ContactHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *ContactHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[contacthistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *ContactHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *ContactHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, contacthistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *ContactHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *ContactHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *ContactHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[contacthistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *ContactHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *ContactHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, contacthistory.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *ContactHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *ContactHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *ContactHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *ContactHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *ContactHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[contacthistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *ContactHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *ContactHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, contacthistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *ContactHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *ContactHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *ContactHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[contacthistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *ContactHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *ContactHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, contacthistory.FieldOwnerID) +} + +// SetFullName sets the "full_name" field. +func (m *ContactHistoryMutation) SetFullName(s string) { + m.full_name = &s +} + +// FullName returns the value of the "full_name" field in the mutation. +func (m *ContactHistoryMutation) FullName() (r string, exists bool) { + v := m.full_name + if v == nil { + return + } + return *v, true +} + +// OldFullName returns the old "full_name" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldFullName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFullName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFullName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFullName: %w", err) + } + return oldValue.FullName, nil +} + +// ResetFullName resets all changes to the "full_name" field. +func (m *ContactHistoryMutation) ResetFullName() { + m.full_name = nil +} + +// SetTitle sets the "title" field. +func (m *ContactHistoryMutation) SetTitle(s string) { + m.title = &s +} + +// Title returns the value of the "title" field in the mutation. +func (m *ContactHistoryMutation) Title() (r string, exists bool) { + v := m.title + if v == nil { + return + } + return *v, true +} + +// OldTitle returns the old "title" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldTitle(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTitle is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTitle requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTitle: %w", err) + } + return oldValue.Title, nil +} + +// ClearTitle clears the value of the "title" field. +func (m *ContactHistoryMutation) ClearTitle() { + m.title = nil + m.clearedFields[contacthistory.FieldTitle] = struct{}{} +} + +// TitleCleared returns if the "title" field was cleared in this mutation. +func (m *ContactHistoryMutation) TitleCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldTitle] + return ok +} + +// ResetTitle resets all changes to the "title" field. +func (m *ContactHistoryMutation) ResetTitle() { + m.title = nil + delete(m.clearedFields, contacthistory.FieldTitle) +} + +// SetCompany sets the "company" field. +func (m *ContactHistoryMutation) SetCompany(s string) { + m.company = &s +} + +// Company returns the value of the "company" field in the mutation. +func (m *ContactHistoryMutation) Company() (r string, exists bool) { + v := m.company + if v == nil { + return + } + return *v, true +} + +// OldCompany returns the old "company" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldCompany(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCompany is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCompany requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCompany: %w", err) + } + return oldValue.Company, nil +} + +// ClearCompany clears the value of the "company" field. +func (m *ContactHistoryMutation) ClearCompany() { + m.company = nil + m.clearedFields[contacthistory.FieldCompany] = struct{}{} +} + +// CompanyCleared returns if the "company" field was cleared in this mutation. +func (m *ContactHistoryMutation) CompanyCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldCompany] + return ok +} + +// ResetCompany resets all changes to the "company" field. +func (m *ContactHistoryMutation) ResetCompany() { + m.company = nil + delete(m.clearedFields, contacthistory.FieldCompany) +} + +// SetEmail sets the "email" field. +func (m *ContactHistoryMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *ContactHistoryMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ClearEmail clears the value of the "email" field. +func (m *ContactHistoryMutation) ClearEmail() { + m.email = nil + m.clearedFields[contacthistory.FieldEmail] = struct{}{} +} + +// EmailCleared returns if the "email" field was cleared in this mutation. +func (m *ContactHistoryMutation) EmailCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldEmail] + return ok +} + +// ResetEmail resets all changes to the "email" field. +func (m *ContactHistoryMutation) ResetEmail() { + m.email = nil + delete(m.clearedFields, contacthistory.FieldEmail) +} + +// SetPhoneNumber sets the "phone_number" field. +func (m *ContactHistoryMutation) SetPhoneNumber(s string) { + m.phone_number = &s +} + +// PhoneNumber returns the value of the "phone_number" field in the mutation. +func (m *ContactHistoryMutation) PhoneNumber() (r string, exists bool) { + v := m.phone_number + if v == nil { + return + } + return *v, true +} + +// OldPhoneNumber returns the old "phone_number" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldPhoneNumber(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPhoneNumber is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPhoneNumber requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhoneNumber: %w", err) + } + return oldValue.PhoneNumber, nil +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (m *ContactHistoryMutation) ClearPhoneNumber() { + m.phone_number = nil + m.clearedFields[contacthistory.FieldPhoneNumber] = struct{}{} +} + +// PhoneNumberCleared returns if the "phone_number" field was cleared in this mutation. +func (m *ContactHistoryMutation) PhoneNumberCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldPhoneNumber] + return ok +} + +// ResetPhoneNumber resets all changes to the "phone_number" field. +func (m *ContactHistoryMutation) ResetPhoneNumber() { + m.phone_number = nil + delete(m.clearedFields, contacthistory.FieldPhoneNumber) +} + +// SetAddress sets the "address" field. +func (m *ContactHistoryMutation) SetAddress(s string) { + m.address = &s +} + +// Address returns the value of the "address" field in the mutation. +func (m *ContactHistoryMutation) Address() (r string, exists bool) { + v := m.address + if v == nil { + return + } + return *v, true +} + +// OldAddress returns the old "address" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldAddress(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAddress is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAddress: %w", err) + } + return oldValue.Address, nil +} + +// ClearAddress clears the value of the "address" field. +func (m *ContactHistoryMutation) ClearAddress() { + m.address = nil + m.clearedFields[contacthistory.FieldAddress] = struct{}{} +} + +// AddressCleared returns if the "address" field was cleared in this mutation. +func (m *ContactHistoryMutation) AddressCleared() bool { + _, ok := m.clearedFields[contacthistory.FieldAddress] + return ok +} + +// ResetAddress resets all changes to the "address" field. +func (m *ContactHistoryMutation) ResetAddress() { + m.address = nil + delete(m.clearedFields, contacthistory.FieldAddress) +} + +// SetStatus sets the "status" field. +func (m *ContactHistoryMutation) SetStatus(es enums.UserStatus) { + m.status = &es +} + +// Status returns the value of the "status" field in the mutation. +func (m *ContactHistoryMutation) Status() (r enums.UserStatus, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the ContactHistory entity. +// If the ContactHistory 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 *ContactHistoryMutation) OldStatus(ctx context.Context) (v enums.UserStatus, 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 +} + +// ResetStatus resets all changes to the "status" field. +func (m *ContactHistoryMutation) ResetStatus() { + m.status = nil +} + +// Where appends a list predicates to the ContactHistoryMutation builder. +func (m *ContactHistoryMutation) Where(ps ...predicate.ContactHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the ContactHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *ContactHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.ContactHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *ContactHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *ContactHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (ContactHistory). +func (m *ContactHistoryMutation) 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 *ContactHistoryMutation) Fields() []string { + fields := make([]string, 0, 19) + if m.history_time != nil { + fields = append(fields, contacthistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, contacthistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, contacthistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, contacthistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, contacthistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, contacthistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, contacthistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, contacthistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, contacthistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, contacthistory.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, contacthistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, contacthistory.FieldOwnerID) + } + if m.full_name != nil { + fields = append(fields, contacthistory.FieldFullName) + } + if m.title != nil { + fields = append(fields, contacthistory.FieldTitle) + } + if m.company != nil { + fields = append(fields, contacthistory.FieldCompany) + } + if m.email != nil { + fields = append(fields, contacthistory.FieldEmail) + } + if m.phone_number != nil { + fields = append(fields, contacthistory.FieldPhoneNumber) + } + if m.address != nil { + fields = append(fields, contacthistory.FieldAddress) + } + if m.status != nil { + fields = append(fields, contacthistory.FieldStatus) + } + 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 *ContactHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case contacthistory.FieldHistoryTime: + return m.HistoryTime() + case contacthistory.FieldRef: + return m.Ref() + case contacthistory.FieldOperation: + return m.Operation() + case contacthistory.FieldCreatedAt: + return m.CreatedAt() + case contacthistory.FieldUpdatedAt: + return m.UpdatedAt() + case contacthistory.FieldCreatedBy: + return m.CreatedBy() + case contacthistory.FieldUpdatedBy: + return m.UpdatedBy() + case contacthistory.FieldMappingID: + return m.MappingID() + case contacthistory.FieldDeletedAt: + return m.DeletedAt() + case contacthistory.FieldDeletedBy: + return m.DeletedBy() + case contacthistory.FieldTags: + return m.Tags() + case contacthistory.FieldOwnerID: + return m.OwnerID() + case contacthistory.FieldFullName: + return m.FullName() + case contacthistory.FieldTitle: + return m.Title() + case contacthistory.FieldCompany: + return m.Company() + case contacthistory.FieldEmail: + return m.Email() + case contacthistory.FieldPhoneNumber: + return m.PhoneNumber() + case contacthistory.FieldAddress: + return m.Address() + case contacthistory.FieldStatus: + return m.Status() + } + 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 *ContactHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case contacthistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case contacthistory.FieldRef: + return m.OldRef(ctx) + case contacthistory.FieldOperation: + return m.OldOperation(ctx) + case contacthistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case contacthistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case contacthistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case contacthistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case contacthistory.FieldMappingID: + return m.OldMappingID(ctx) + case contacthistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case contacthistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case contacthistory.FieldTags: + return m.OldTags(ctx) + case contacthistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case contacthistory.FieldFullName: + return m.OldFullName(ctx) + case contacthistory.FieldTitle: + return m.OldTitle(ctx) + case contacthistory.FieldCompany: + return m.OldCompany(ctx) + case contacthistory.FieldEmail: + return m.OldEmail(ctx) + case contacthistory.FieldPhoneNumber: + return m.OldPhoneNumber(ctx) + case contacthistory.FieldAddress: + return m.OldAddress(ctx) + case contacthistory.FieldStatus: + return m.OldStatus(ctx) + } + return nil, fmt.Errorf("unknown ContactHistory 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 *ContactHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case contacthistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case contacthistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case contacthistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case contacthistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case contacthistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case contacthistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case contacthistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case contacthistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case contacthistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case contacthistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case contacthistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case contacthistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case contacthistory.FieldFullName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFullName(v) + return nil + case contacthistory.FieldTitle: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTitle(v) + return nil + case contacthistory.FieldCompany: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCompany(v) + return nil + case contacthistory.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case contacthistory.FieldPhoneNumber: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPhoneNumber(v) + return nil + case contacthistory.FieldAddress: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAddress(v) + return nil + case contacthistory.FieldStatus: + v, ok := value.(enums.UserStatus) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + } + return fmt.Errorf("unknown ContactHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *ContactHistoryMutation) 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 *ContactHistoryMutation) 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 *ContactHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown ContactHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *ContactHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(contacthistory.FieldRef) { + fields = append(fields, contacthistory.FieldRef) + } + if m.FieldCleared(contacthistory.FieldCreatedAt) { + fields = append(fields, contacthistory.FieldCreatedAt) + } + if m.FieldCleared(contacthistory.FieldUpdatedAt) { + fields = append(fields, contacthistory.FieldUpdatedAt) + } + if m.FieldCleared(contacthistory.FieldCreatedBy) { + fields = append(fields, contacthistory.FieldCreatedBy) + } + if m.FieldCleared(contacthistory.FieldUpdatedBy) { + fields = append(fields, contacthistory.FieldUpdatedBy) + } + if m.FieldCleared(contacthistory.FieldDeletedAt) { + fields = append(fields, contacthistory.FieldDeletedAt) + } + if m.FieldCleared(contacthistory.FieldDeletedBy) { + fields = append(fields, contacthistory.FieldDeletedBy) + } + if m.FieldCleared(contacthistory.FieldTags) { + fields = append(fields, contacthistory.FieldTags) + } + if m.FieldCleared(contacthistory.FieldOwnerID) { + fields = append(fields, contacthistory.FieldOwnerID) + } + if m.FieldCleared(contacthistory.FieldTitle) { + fields = append(fields, contacthistory.FieldTitle) + } + if m.FieldCleared(contacthistory.FieldCompany) { + fields = append(fields, contacthistory.FieldCompany) + } + if m.FieldCleared(contacthistory.FieldEmail) { + fields = append(fields, contacthistory.FieldEmail) + } + if m.FieldCleared(contacthistory.FieldPhoneNumber) { + fields = append(fields, contacthistory.FieldPhoneNumber) + } + if m.FieldCleared(contacthistory.FieldAddress) { + fields = append(fields, contacthistory.FieldAddress) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *ContactHistoryMutation) 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 *ContactHistoryMutation) ClearField(name string) error { + switch name { + case contacthistory.FieldRef: + m.ClearRef() + return nil + case contacthistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case contacthistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case contacthistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case contacthistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case contacthistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case contacthistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case contacthistory.FieldTags: + m.ClearTags() + return nil + case contacthistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case contacthistory.FieldTitle: + m.ClearTitle() + return nil + case contacthistory.FieldCompany: + m.ClearCompany() + return nil + case contacthistory.FieldEmail: + m.ClearEmail() + return nil + case contacthistory.FieldPhoneNumber: + m.ClearPhoneNumber() + return nil + case contacthistory.FieldAddress: + m.ClearAddress() + return nil + } + return fmt.Errorf("unknown ContactHistory 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 *ContactHistoryMutation) ResetField(name string) error { + switch name { + case contacthistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case contacthistory.FieldRef: + m.ResetRef() + return nil + case contacthistory.FieldOperation: + m.ResetOperation() + return nil + case contacthistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case contacthistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case contacthistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case contacthistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case contacthistory.FieldMappingID: + m.ResetMappingID() + return nil + case contacthistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case contacthistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case contacthistory.FieldTags: + m.ResetTags() + return nil + case contacthistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case contacthistory.FieldFullName: + m.ResetFullName() + return nil + case contacthistory.FieldTitle: + m.ResetTitle() + return nil + case contacthistory.FieldCompany: + m.ResetCompany() + return nil + case contacthistory.FieldEmail: + m.ResetEmail() + return nil + case contacthistory.FieldPhoneNumber: + m.ResetPhoneNumber() + return nil + case contacthistory.FieldAddress: + m.ResetAddress() + return nil + case contacthistory.FieldStatus: + m.ResetStatus() + return nil + } + return fmt.Errorf("unknown ContactHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *ContactHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *ContactHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *ContactHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *ContactHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *ContactHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *ContactHistoryMutation) EdgeCleared(name string) bool { + 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 *ContactHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown ContactHistory 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 *ContactHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown ContactHistory edge %s", name) +} + +// DocumentDataMutation represents an operation that mutates the DocumentData nodes in the graph. +type DocumentDataMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + data *customtypes.JSONObject + clearedFields map[string]struct{} + owner *string + clearedowner bool + template *string + clearedtemplate bool + entity map[string]struct{} + removedentity map[string]struct{} + clearedentity bool + done bool + oldValue func(context.Context) (*DocumentData, error) + predicates []predicate.DocumentData +} + +var _ ent.Mutation = (*DocumentDataMutation)(nil) + +// documentdataOption allows management of the mutation configuration using functional options. +type documentdataOption func(*DocumentDataMutation) + +// newDocumentDataMutation creates new mutation for the DocumentData entity. +func newDocumentDataMutation(c config, op Op, opts ...documentdataOption) *DocumentDataMutation { + m := &DocumentDataMutation{ + config: c, + op: op, + typ: TypeDocumentData, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withDocumentDataID sets the ID field of the mutation. +func withDocumentDataID(id string) documentdataOption { + return func(m *DocumentDataMutation) { + var ( + err error + once sync.Once + value *DocumentData + ) + m.oldValue = func(ctx context.Context) (*DocumentData, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().DocumentData.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withDocumentData sets the old DocumentData of the mutation. +func withDocumentData(node *DocumentData) documentdataOption { + return func(m *DocumentDataMutation) { + m.oldValue = func(context.Context) (*DocumentData, 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 DocumentDataMutation) 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 DocumentDataMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of DocumentData entities. +func (m *DocumentDataMutation) SetID(id string) { + 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 *DocumentDataMutation) ID() (id string, 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 *DocumentDataMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().DocumentData.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *DocumentDataMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *DocumentDataMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *DocumentDataMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[documentdata.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *DocumentDataMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[documentdata.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *DocumentDataMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, documentdata.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *DocumentDataMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *DocumentDataMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *DocumentDataMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[documentdata.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *DocumentDataMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[documentdata.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *DocumentDataMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, documentdata.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *DocumentDataMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *DocumentDataMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *DocumentDataMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[documentdata.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *DocumentDataMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[documentdata.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *DocumentDataMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, documentdata.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *DocumentDataMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *DocumentDataMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *DocumentDataMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[documentdata.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *DocumentDataMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[documentdata.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *DocumentDataMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, documentdata.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *DocumentDataMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *DocumentDataMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *DocumentDataMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *DocumentDataMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *DocumentDataMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *DocumentDataMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *DocumentDataMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *DocumentDataMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[documentdata.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *DocumentDataMutation) TagsCleared() bool { + _, ok := m.clearedFields[documentdata.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *DocumentDataMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, documentdata.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *DocumentDataMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *DocumentDataMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *DocumentDataMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[documentdata.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *DocumentDataMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[documentdata.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *DocumentDataMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, documentdata.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *DocumentDataMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *DocumentDataMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *DocumentDataMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[documentdata.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *DocumentDataMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[documentdata.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *DocumentDataMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, documentdata.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *DocumentDataMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *DocumentDataMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *DocumentDataMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[documentdata.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *DocumentDataMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[documentdata.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *DocumentDataMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, documentdata.FieldOwnerID) +} + +// SetTemplateID sets the "template_id" field. +func (m *DocumentDataMutation) SetTemplateID(s string) { + m.template = &s +} + +// TemplateID returns the value of the "template_id" field in the mutation. +func (m *DocumentDataMutation) TemplateID() (r string, exists bool) { + v := m.template + if v == nil { + return + } + return *v, true +} + +// OldTemplateID returns the old "template_id" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldTemplateID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTemplateID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTemplateID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTemplateID: %w", err) + } + return oldValue.TemplateID, nil +} + +// ResetTemplateID resets all changes to the "template_id" field. +func (m *DocumentDataMutation) ResetTemplateID() { + m.template = nil +} + +// SetData sets the "data" field. +func (m *DocumentDataMutation) SetData(co customtypes.JSONObject) { + m.data = &co +} + +// Data returns the value of the "data" field in the mutation. +func (m *DocumentDataMutation) Data() (r customtypes.JSONObject, exists bool) { + v := m.data + if v == nil { + return + } + return *v, true +} + +// OldData returns the old "data" field's value of the DocumentData entity. +// If the DocumentData 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 *DocumentDataMutation) OldData(ctx context.Context) (v customtypes.JSONObject, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldData is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldData requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldData: %w", err) + } + return oldValue.Data, nil +} + +// ResetData resets all changes to the "data" field. +func (m *DocumentDataMutation) ResetData() { + m.data = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *DocumentDataMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[documentdata.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *DocumentDataMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *DocumentDataMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *DocumentDataMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// ClearTemplate clears the "template" edge to the Template entity. +func (m *DocumentDataMutation) ClearTemplate() { + m.clearedtemplate = true + m.clearedFields[documentdata.FieldTemplateID] = struct{}{} +} + +// TemplateCleared reports if the "template" edge to the Template entity was cleared. +func (m *DocumentDataMutation) TemplateCleared() bool { + return m.clearedtemplate +} + +// TemplateIDs returns the "template" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// TemplateID instead. It exists only for internal usage by the builders. +func (m *DocumentDataMutation) TemplateIDs() (ids []string) { + if id := m.template; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetTemplate resets all changes to the "template" edge. +func (m *DocumentDataMutation) ResetTemplate() { + m.template = nil + m.clearedtemplate = false +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by ids. +func (m *DocumentDataMutation) AddEntityIDs(ids ...string) { + if m.entity == nil { + m.entity = make(map[string]struct{}) + } + for i := range ids { + m.entity[ids[i]] = struct{}{} + } +} + +// ClearEntity clears the "entity" edge to the Entity entity. +func (m *DocumentDataMutation) ClearEntity() { + m.clearedentity = true +} + +// EntityCleared reports if the "entity" edge to the Entity entity was cleared. +func (m *DocumentDataMutation) EntityCleared() bool { + return m.clearedentity +} + +// RemoveEntityIDs removes the "entity" edge to the Entity entity by IDs. +func (m *DocumentDataMutation) RemoveEntityIDs(ids ...string) { + if m.removedentity == nil { + m.removedentity = make(map[string]struct{}) + } + for i := range ids { + delete(m.entity, ids[i]) + m.removedentity[ids[i]] = struct{}{} + } +} + +// RemovedEntity returns the removed IDs of the "entity" edge to the Entity entity. +func (m *DocumentDataMutation) RemovedEntityIDs() (ids []string) { + for id := range m.removedentity { + ids = append(ids, id) + } + return +} + +// EntityIDs returns the "entity" edge IDs in the mutation. +func (m *DocumentDataMutation) EntityIDs() (ids []string) { + for id := range m.entity { + ids = append(ids, id) + } + return +} + +// ResetEntity resets all changes to the "entity" edge. +func (m *DocumentDataMutation) ResetEntity() { + m.entity = nil + m.clearedentity = false + m.removedentity = nil +} + +// Where appends a list predicates to the DocumentDataMutation builder. +func (m *DocumentDataMutation) Where(ps ...predicate.DocumentData) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the DocumentDataMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *DocumentDataMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.DocumentData, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *DocumentDataMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *DocumentDataMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (DocumentData). +func (m *DocumentDataMutation) 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 *DocumentDataMutation) Fields() []string { + fields := make([]string, 0, 11) + if m.created_at != nil { + fields = append(fields, documentdata.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, documentdata.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, documentdata.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, documentdata.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, documentdata.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, documentdata.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, documentdata.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, documentdata.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, documentdata.FieldOwnerID) + } + if m.template != nil { + fields = append(fields, documentdata.FieldTemplateID) + } + if m.data != nil { + fields = append(fields, documentdata.FieldData) + } + 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 *DocumentDataMutation) Field(name string) (ent.Value, bool) { + switch name { + case documentdata.FieldCreatedAt: + return m.CreatedAt() + case documentdata.FieldUpdatedAt: + return m.UpdatedAt() + case documentdata.FieldCreatedBy: + return m.CreatedBy() + case documentdata.FieldUpdatedBy: + return m.UpdatedBy() + case documentdata.FieldMappingID: + return m.MappingID() + case documentdata.FieldTags: + return m.Tags() + case documentdata.FieldDeletedAt: + return m.DeletedAt() + case documentdata.FieldDeletedBy: + return m.DeletedBy() + case documentdata.FieldOwnerID: + return m.OwnerID() + case documentdata.FieldTemplateID: + return m.TemplateID() + case documentdata.FieldData: + return m.Data() + } + 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 *DocumentDataMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case documentdata.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case documentdata.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case documentdata.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case documentdata.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case documentdata.FieldMappingID: + return m.OldMappingID(ctx) + case documentdata.FieldTags: + return m.OldTags(ctx) + case documentdata.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case documentdata.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case documentdata.FieldOwnerID: + return m.OldOwnerID(ctx) + case documentdata.FieldTemplateID: + return m.OldTemplateID(ctx) + case documentdata.FieldData: + return m.OldData(ctx) + } + return nil, fmt.Errorf("unknown DocumentData 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 *DocumentDataMutation) SetField(name string, value ent.Value) error { + switch name { + case documentdata.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case documentdata.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case documentdata.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case documentdata.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case documentdata.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case documentdata.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case documentdata.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case documentdata.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case documentdata.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case documentdata.FieldTemplateID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTemplateID(v) + return nil + case documentdata.FieldData: + v, ok := value.(customtypes.JSONObject) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetData(v) + return nil + } + return fmt.Errorf("unknown DocumentData field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *DocumentDataMutation) 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 *DocumentDataMutation) 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 *DocumentDataMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown DocumentData numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *DocumentDataMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(documentdata.FieldCreatedAt) { + fields = append(fields, documentdata.FieldCreatedAt) + } + if m.FieldCleared(documentdata.FieldUpdatedAt) { + fields = append(fields, documentdata.FieldUpdatedAt) + } + if m.FieldCleared(documentdata.FieldCreatedBy) { + fields = append(fields, documentdata.FieldCreatedBy) + } + if m.FieldCleared(documentdata.FieldUpdatedBy) { + fields = append(fields, documentdata.FieldUpdatedBy) + } + if m.FieldCleared(documentdata.FieldTags) { + fields = append(fields, documentdata.FieldTags) + } + if m.FieldCleared(documentdata.FieldDeletedAt) { + fields = append(fields, documentdata.FieldDeletedAt) + } + if m.FieldCleared(documentdata.FieldDeletedBy) { + fields = append(fields, documentdata.FieldDeletedBy) + } + if m.FieldCleared(documentdata.FieldOwnerID) { + fields = append(fields, documentdata.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *DocumentDataMutation) 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 *DocumentDataMutation) ClearField(name string) error { + switch name { + case documentdata.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case documentdata.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case documentdata.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case documentdata.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case documentdata.FieldTags: + m.ClearTags() + return nil + case documentdata.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case documentdata.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case documentdata.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown DocumentData 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 *DocumentDataMutation) ResetField(name string) error { + switch name { + case documentdata.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case documentdata.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case documentdata.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case documentdata.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case documentdata.FieldMappingID: + m.ResetMappingID() + return nil + case documentdata.FieldTags: + m.ResetTags() + return nil + case documentdata.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case documentdata.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case documentdata.FieldOwnerID: + m.ResetOwnerID() + return nil + case documentdata.FieldTemplateID: + m.ResetTemplateID() + return nil + case documentdata.FieldData: + m.ResetData() + return nil + } + return fmt.Errorf("unknown DocumentData field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *DocumentDataMutation) AddedEdges() []string { + edges := make([]string, 0, 3) + if m.owner != nil { + edges = append(edges, documentdata.EdgeOwner) + } + if m.template != nil { + edges = append(edges, documentdata.EdgeTemplate) + } + if m.entity != nil { + edges = append(edges, documentdata.EdgeEntity) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *DocumentDataMutation) AddedIDs(name string) []ent.Value { + switch name { + case documentdata.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case documentdata.EdgeTemplate: + if id := m.template; id != nil { + return []ent.Value{*id} + } + case documentdata.EdgeEntity: + ids := make([]ent.Value, 0, len(m.entity)) + for id := range m.entity { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *DocumentDataMutation) RemovedEdges() []string { + edges := make([]string, 0, 3) + if m.removedentity != nil { + edges = append(edges, documentdata.EdgeEntity) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *DocumentDataMutation) RemovedIDs(name string) []ent.Value { + switch name { + case documentdata.EdgeEntity: + ids := make([]ent.Value, 0, len(m.removedentity)) + for id := range m.removedentity { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *DocumentDataMutation) ClearedEdges() []string { + edges := make([]string, 0, 3) + if m.clearedowner { + edges = append(edges, documentdata.EdgeOwner) + } + if m.clearedtemplate { + edges = append(edges, documentdata.EdgeTemplate) + } + if m.clearedentity { + edges = append(edges, documentdata.EdgeEntity) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *DocumentDataMutation) EdgeCleared(name string) bool { + switch name { + case documentdata.EdgeOwner: + return m.clearedowner + case documentdata.EdgeTemplate: + return m.clearedtemplate + case documentdata.EdgeEntity: + return m.clearedentity + } + 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 *DocumentDataMutation) ClearEdge(name string) error { + switch name { + case documentdata.EdgeOwner: + m.ClearOwner() + return nil + case documentdata.EdgeTemplate: + m.ClearTemplate() + return nil + } + return fmt.Errorf("unknown DocumentData 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 *DocumentDataMutation) ResetEdge(name string) error { + switch name { + case documentdata.EdgeOwner: + m.ResetOwner() + return nil + case documentdata.EdgeTemplate: + m.ResetTemplate() + return nil + case documentdata.EdgeEntity: + m.ResetEntity() + return nil + } + return fmt.Errorf("unknown DocumentData edge %s", name) +} + +// DocumentDataHistoryMutation represents an operation that mutates the DocumentDataHistory nodes in the graph. +type DocumentDataHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + owner_id *string + template_id *string + data *customtypes.JSONObject + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*DocumentDataHistory, error) + predicates []predicate.DocumentDataHistory +} + +var _ ent.Mutation = (*DocumentDataHistoryMutation)(nil) + +// documentdatahistoryOption allows management of the mutation configuration using functional options. +type documentdatahistoryOption func(*DocumentDataHistoryMutation) + +// newDocumentDataHistoryMutation creates new mutation for the DocumentDataHistory entity. +func newDocumentDataHistoryMutation(c config, op Op, opts ...documentdatahistoryOption) *DocumentDataHistoryMutation { + m := &DocumentDataHistoryMutation{ + config: c, + op: op, + typ: TypeDocumentDataHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withDocumentDataHistoryID sets the ID field of the mutation. +func withDocumentDataHistoryID(id string) documentdatahistoryOption { + return func(m *DocumentDataHistoryMutation) { + var ( + err error + once sync.Once + value *DocumentDataHistory + ) + m.oldValue = func(ctx context.Context) (*DocumentDataHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().DocumentDataHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withDocumentDataHistory sets the old DocumentDataHistory of the mutation. +func withDocumentDataHistory(node *DocumentDataHistory) documentdatahistoryOption { + return func(m *DocumentDataHistoryMutation) { + m.oldValue = func(context.Context) (*DocumentDataHistory, 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 DocumentDataHistoryMutation) 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 DocumentDataHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of DocumentDataHistory entities. +func (m *DocumentDataHistoryMutation) SetID(id string) { + 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 *DocumentDataHistoryMutation) ID() (id string, 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 *DocumentDataHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().DocumentDataHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *DocumentDataHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *DocumentDataHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *DocumentDataHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *DocumentDataHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *DocumentDataHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *DocumentDataHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[documentdatahistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *DocumentDataHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, documentdatahistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *DocumentDataHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *DocumentDataHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *DocumentDataHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *DocumentDataHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *DocumentDataHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *DocumentDataHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[documentdatahistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *DocumentDataHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, documentdatahistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *DocumentDataHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *DocumentDataHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *DocumentDataHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[documentdatahistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *DocumentDataHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, documentdatahistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *DocumentDataHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *DocumentDataHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *DocumentDataHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[documentdatahistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *DocumentDataHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, documentdatahistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *DocumentDataHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *DocumentDataHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *DocumentDataHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[documentdatahistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *DocumentDataHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, documentdatahistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *DocumentDataHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *DocumentDataHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *DocumentDataHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *DocumentDataHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *DocumentDataHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *DocumentDataHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *DocumentDataHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *DocumentDataHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[documentdatahistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *DocumentDataHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, documentdatahistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *DocumentDataHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *DocumentDataHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *DocumentDataHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[documentdatahistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *DocumentDataHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, documentdatahistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *DocumentDataHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *DocumentDataHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *DocumentDataHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[documentdatahistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *DocumentDataHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, documentdatahistory.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *DocumentDataHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *DocumentDataHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *DocumentDataHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[documentdatahistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *DocumentDataHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[documentdatahistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *DocumentDataHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, documentdatahistory.FieldOwnerID) +} + +// SetTemplateID sets the "template_id" field. +func (m *DocumentDataHistoryMutation) SetTemplateID(s string) { + m.template_id = &s +} + +// TemplateID returns the value of the "template_id" field in the mutation. +func (m *DocumentDataHistoryMutation) TemplateID() (r string, exists bool) { + v := m.template_id + if v == nil { + return + } + return *v, true +} + +// OldTemplateID returns the old "template_id" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldTemplateID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTemplateID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTemplateID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTemplateID: %w", err) + } + return oldValue.TemplateID, nil +} + +// ResetTemplateID resets all changes to the "template_id" field. +func (m *DocumentDataHistoryMutation) ResetTemplateID() { + m.template_id = nil +} + +// SetData sets the "data" field. +func (m *DocumentDataHistoryMutation) SetData(co customtypes.JSONObject) { + m.data = &co +} + +// Data returns the value of the "data" field in the mutation. +func (m *DocumentDataHistoryMutation) Data() (r customtypes.JSONObject, exists bool) { + v := m.data + if v == nil { + return + } + return *v, true +} + +// OldData returns the old "data" field's value of the DocumentDataHistory entity. +// If the DocumentDataHistory 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 *DocumentDataHistoryMutation) OldData(ctx context.Context) (v customtypes.JSONObject, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldData is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldData requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldData: %w", err) + } + return oldValue.Data, nil +} + +// ResetData resets all changes to the "data" field. +func (m *DocumentDataHistoryMutation) ResetData() { + m.data = nil +} + +// Where appends a list predicates to the DocumentDataHistoryMutation builder. +func (m *DocumentDataHistoryMutation) Where(ps ...predicate.DocumentDataHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the DocumentDataHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *DocumentDataHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.DocumentDataHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *DocumentDataHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *DocumentDataHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (DocumentDataHistory). +func (m *DocumentDataHistoryMutation) 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 *DocumentDataHistoryMutation) Fields() []string { + fields := make([]string, 0, 14) + if m.history_time != nil { + fields = append(fields, documentdatahistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, documentdatahistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, documentdatahistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, documentdatahistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, documentdatahistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, documentdatahistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, documentdatahistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, documentdatahistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, documentdatahistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, documentdatahistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, documentdatahistory.FieldDeletedBy) + } + if m.owner_id != nil { + fields = append(fields, documentdatahistory.FieldOwnerID) + } + if m.template_id != nil { + fields = append(fields, documentdatahistory.FieldTemplateID) + } + if m.data != nil { + fields = append(fields, documentdatahistory.FieldData) + } + 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 *DocumentDataHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case documentdatahistory.FieldHistoryTime: + return m.HistoryTime() + case documentdatahistory.FieldRef: + return m.Ref() + case documentdatahistory.FieldOperation: + return m.Operation() + case documentdatahistory.FieldCreatedAt: + return m.CreatedAt() + case documentdatahistory.FieldUpdatedAt: + return m.UpdatedAt() + case documentdatahistory.FieldCreatedBy: + return m.CreatedBy() + case documentdatahistory.FieldUpdatedBy: + return m.UpdatedBy() + case documentdatahistory.FieldMappingID: + return m.MappingID() + case documentdatahistory.FieldTags: + return m.Tags() + case documentdatahistory.FieldDeletedAt: + return m.DeletedAt() + case documentdatahistory.FieldDeletedBy: + return m.DeletedBy() + case documentdatahistory.FieldOwnerID: + return m.OwnerID() + case documentdatahistory.FieldTemplateID: + return m.TemplateID() + case documentdatahistory.FieldData: + return m.Data() + } + 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 *DocumentDataHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case documentdatahistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case documentdatahistory.FieldRef: + return m.OldRef(ctx) + case documentdatahistory.FieldOperation: + return m.OldOperation(ctx) + case documentdatahistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case documentdatahistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case documentdatahistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case documentdatahistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case documentdatahistory.FieldMappingID: + return m.OldMappingID(ctx) + case documentdatahistory.FieldTags: + return m.OldTags(ctx) + case documentdatahistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case documentdatahistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case documentdatahistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case documentdatahistory.FieldTemplateID: + return m.OldTemplateID(ctx) + case documentdatahistory.FieldData: + return m.OldData(ctx) + } + return nil, fmt.Errorf("unknown DocumentDataHistory 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 *DocumentDataHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case documentdatahistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case documentdatahistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case documentdatahistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case documentdatahistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case documentdatahistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case documentdatahistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case documentdatahistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case documentdatahistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case documentdatahistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case documentdatahistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case documentdatahistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case documentdatahistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case documentdatahistory.FieldTemplateID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTemplateID(v) + return nil + case documentdatahistory.FieldData: + v, ok := value.(customtypes.JSONObject) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetData(v) + return nil + } + return fmt.Errorf("unknown DocumentDataHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *DocumentDataHistoryMutation) 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 *DocumentDataHistoryMutation) 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 *DocumentDataHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown DocumentDataHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *DocumentDataHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(documentdatahistory.FieldRef) { + fields = append(fields, documentdatahistory.FieldRef) + } + if m.FieldCleared(documentdatahistory.FieldCreatedAt) { + fields = append(fields, documentdatahistory.FieldCreatedAt) + } + if m.FieldCleared(documentdatahistory.FieldUpdatedAt) { + fields = append(fields, documentdatahistory.FieldUpdatedAt) + } + if m.FieldCleared(documentdatahistory.FieldCreatedBy) { + fields = append(fields, documentdatahistory.FieldCreatedBy) + } + if m.FieldCleared(documentdatahistory.FieldUpdatedBy) { + fields = append(fields, documentdatahistory.FieldUpdatedBy) + } + if m.FieldCleared(documentdatahistory.FieldTags) { + fields = append(fields, documentdatahistory.FieldTags) + } + if m.FieldCleared(documentdatahistory.FieldDeletedAt) { + fields = append(fields, documentdatahistory.FieldDeletedAt) + } + if m.FieldCleared(documentdatahistory.FieldDeletedBy) { + fields = append(fields, documentdatahistory.FieldDeletedBy) + } + if m.FieldCleared(documentdatahistory.FieldOwnerID) { + fields = append(fields, documentdatahistory.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *DocumentDataHistoryMutation) 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 *DocumentDataHistoryMutation) ClearField(name string) error { + switch name { + case documentdatahistory.FieldRef: + m.ClearRef() + return nil + case documentdatahistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case documentdatahistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case documentdatahistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case documentdatahistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case documentdatahistory.FieldTags: + m.ClearTags() + return nil + case documentdatahistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case documentdatahistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case documentdatahistory.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown DocumentDataHistory 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 *DocumentDataHistoryMutation) ResetField(name string) error { + switch name { + case documentdatahistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case documentdatahistory.FieldRef: + m.ResetRef() + return nil + case documentdatahistory.FieldOperation: + m.ResetOperation() + return nil + case documentdatahistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case documentdatahistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case documentdatahistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case documentdatahistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case documentdatahistory.FieldMappingID: + m.ResetMappingID() + return nil + case documentdatahistory.FieldTags: + m.ResetTags() + return nil + case documentdatahistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case documentdatahistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case documentdatahistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case documentdatahistory.FieldTemplateID: + m.ResetTemplateID() + return nil + case documentdatahistory.FieldData: + m.ResetData() + return nil + } + return fmt.Errorf("unknown DocumentDataHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *DocumentDataHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *DocumentDataHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *DocumentDataHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *DocumentDataHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *DocumentDataHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *DocumentDataHistoryMutation) EdgeCleared(name string) bool { + 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 *DocumentDataHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown DocumentDataHistory 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 *DocumentDataHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown DocumentDataHistory edge %s", name) +} + +// EmailVerificationTokenMutation represents an operation that mutates the EmailVerificationToken nodes in the graph. +type EmailVerificationTokenMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + token *string + ttl *time.Time + email *string + secret *[]byte + clearedFields map[string]struct{} + owner *string + clearedowner bool + done bool + oldValue func(context.Context) (*EmailVerificationToken, error) + predicates []predicate.EmailVerificationToken +} + +var _ ent.Mutation = (*EmailVerificationTokenMutation)(nil) + +// emailverificationtokenOption allows management of the mutation configuration using functional options. +type emailverificationtokenOption func(*EmailVerificationTokenMutation) + +// newEmailVerificationTokenMutation creates new mutation for the EmailVerificationToken entity. +func newEmailVerificationTokenMutation(c config, op Op, opts ...emailverificationtokenOption) *EmailVerificationTokenMutation { + m := &EmailVerificationTokenMutation{ + config: c, + op: op, + typ: TypeEmailVerificationToken, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEmailVerificationTokenID sets the ID field of the mutation. +func withEmailVerificationTokenID(id string) emailverificationtokenOption { + return func(m *EmailVerificationTokenMutation) { + var ( + err error + once sync.Once + value *EmailVerificationToken + ) + m.oldValue = func(ctx context.Context) (*EmailVerificationToken, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EmailVerificationToken.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEmailVerificationToken sets the old EmailVerificationToken of the mutation. +func withEmailVerificationToken(node *EmailVerificationToken) emailverificationtokenOption { + return func(m *EmailVerificationTokenMutation) { + m.oldValue = func(context.Context) (*EmailVerificationToken, 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 EmailVerificationTokenMutation) 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 EmailVerificationTokenMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EmailVerificationToken entities. +func (m *EmailVerificationTokenMutation) SetID(id string) { + 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 *EmailVerificationTokenMutation) ID() (id string, 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 *EmailVerificationTokenMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EmailVerificationToken.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *EmailVerificationTokenMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EmailVerificationTokenMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EmailVerificationTokenMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[emailverificationtoken.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EmailVerificationTokenMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[emailverificationtoken.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EmailVerificationTokenMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, emailverificationtoken.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EmailVerificationTokenMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EmailVerificationTokenMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EmailVerificationTokenMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[emailverificationtoken.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EmailVerificationTokenMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[emailverificationtoken.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EmailVerificationTokenMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, emailverificationtoken.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EmailVerificationTokenMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EmailVerificationTokenMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EmailVerificationTokenMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[emailverificationtoken.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EmailVerificationTokenMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[emailverificationtoken.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EmailVerificationTokenMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, emailverificationtoken.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EmailVerificationTokenMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EmailVerificationTokenMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EmailVerificationTokenMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[emailverificationtoken.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EmailVerificationTokenMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[emailverificationtoken.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EmailVerificationTokenMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, emailverificationtoken.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EmailVerificationTokenMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EmailVerificationTokenMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EmailVerificationTokenMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EmailVerificationTokenMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EmailVerificationTokenMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EmailVerificationTokenMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[emailverificationtoken.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EmailVerificationTokenMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[emailverificationtoken.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EmailVerificationTokenMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, emailverificationtoken.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EmailVerificationTokenMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EmailVerificationTokenMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EmailVerificationTokenMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[emailverificationtoken.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EmailVerificationTokenMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[emailverificationtoken.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EmailVerificationTokenMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, emailverificationtoken.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EmailVerificationTokenMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EmailVerificationTokenMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EmailVerificationTokenMutation) ResetOwnerID() { + m.owner = nil +} + +// SetToken sets the "token" field. +func (m *EmailVerificationTokenMutation) SetToken(s string) { + m.token = &s +} + +// Token returns the value of the "token" field in the mutation. +func (m *EmailVerificationTokenMutation) Token() (r string, exists bool) { + v := m.token + if v == nil { + return + } + return *v, true +} + +// OldToken returns the old "token" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldToken(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldToken is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldToken requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldToken: %w", err) + } + return oldValue.Token, nil +} + +// ResetToken resets all changes to the "token" field. +func (m *EmailVerificationTokenMutation) ResetToken() { + m.token = nil +} + +// SetTTL sets the "ttl" field. +func (m *EmailVerificationTokenMutation) SetTTL(t time.Time) { + m.ttl = &t +} + +// TTL returns the value of the "ttl" field in the mutation. +func (m *EmailVerificationTokenMutation) TTL() (r time.Time, exists bool) { + v := m.ttl + if v == nil { + return + } + return *v, true +} + +// OldTTL returns the old "ttl" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldTTL(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTTL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTTL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTTL: %w", err) + } + return oldValue.TTL, nil +} + +// ResetTTL resets all changes to the "ttl" field. +func (m *EmailVerificationTokenMutation) ResetTTL() { + m.ttl = nil +} + +// SetEmail sets the "email" field. +func (m *EmailVerificationTokenMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *EmailVerificationTokenMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ResetEmail resets all changes to the "email" field. +func (m *EmailVerificationTokenMutation) ResetEmail() { + m.email = nil +} + +// SetSecret sets the "secret" field. +func (m *EmailVerificationTokenMutation) SetSecret(b []byte) { + m.secret = &b +} + +// Secret returns the value of the "secret" field in the mutation. +func (m *EmailVerificationTokenMutation) Secret() (r []byte, exists bool) { + v := m.secret + if v == nil { + return + } + return *v, true +} + +// OldSecret returns the old "secret" field's value of the EmailVerificationToken entity. +// If the EmailVerificationToken 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 *EmailVerificationTokenMutation) OldSecret(ctx context.Context) (v *[]byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecret: %w", err) + } + return oldValue.Secret, nil +} + +// ResetSecret resets all changes to the "secret" field. +func (m *EmailVerificationTokenMutation) ResetSecret() { + m.secret = nil +} + +// ClearOwner clears the "owner" edge to the User entity. +func (m *EmailVerificationTokenMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[emailverificationtoken.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the User entity was cleared. +func (m *EmailVerificationTokenMutation) OwnerCleared() bool { + return m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *EmailVerificationTokenMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *EmailVerificationTokenMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// Where appends a list predicates to the EmailVerificationTokenMutation builder. +func (m *EmailVerificationTokenMutation) Where(ps ...predicate.EmailVerificationToken) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EmailVerificationTokenMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EmailVerificationTokenMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EmailVerificationToken, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EmailVerificationTokenMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EmailVerificationTokenMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EmailVerificationToken). +func (m *EmailVerificationTokenMutation) 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 *EmailVerificationTokenMutation) Fields() []string { + fields := make([]string, 0, 12) + if m.created_at != nil { + fields = append(fields, emailverificationtoken.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, emailverificationtoken.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, emailverificationtoken.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, emailverificationtoken.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, emailverificationtoken.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, emailverificationtoken.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, emailverificationtoken.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, emailverificationtoken.FieldOwnerID) + } + if m.token != nil { + fields = append(fields, emailverificationtoken.FieldToken) + } + if m.ttl != nil { + fields = append(fields, emailverificationtoken.FieldTTL) + } + if m.email != nil { + fields = append(fields, emailverificationtoken.FieldEmail) + } + if m.secret != nil { + fields = append(fields, emailverificationtoken.FieldSecret) + } + 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 *EmailVerificationTokenMutation) Field(name string) (ent.Value, bool) { + switch name { + case emailverificationtoken.FieldCreatedAt: + return m.CreatedAt() + case emailverificationtoken.FieldUpdatedAt: + return m.UpdatedAt() + case emailverificationtoken.FieldCreatedBy: + return m.CreatedBy() + case emailverificationtoken.FieldUpdatedBy: + return m.UpdatedBy() + case emailverificationtoken.FieldMappingID: + return m.MappingID() + case emailverificationtoken.FieldDeletedAt: + return m.DeletedAt() + case emailverificationtoken.FieldDeletedBy: + return m.DeletedBy() + case emailverificationtoken.FieldOwnerID: + return m.OwnerID() + case emailverificationtoken.FieldToken: + return m.Token() + case emailverificationtoken.FieldTTL: + return m.TTL() + case emailverificationtoken.FieldEmail: + return m.Email() + case emailverificationtoken.FieldSecret: + return m.Secret() + } + 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 *EmailVerificationTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case emailverificationtoken.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case emailverificationtoken.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case emailverificationtoken.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case emailverificationtoken.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case emailverificationtoken.FieldMappingID: + return m.OldMappingID(ctx) + case emailverificationtoken.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case emailverificationtoken.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case emailverificationtoken.FieldOwnerID: + return m.OldOwnerID(ctx) + case emailverificationtoken.FieldToken: + return m.OldToken(ctx) + case emailverificationtoken.FieldTTL: + return m.OldTTL(ctx) + case emailverificationtoken.FieldEmail: + return m.OldEmail(ctx) + case emailverificationtoken.FieldSecret: + return m.OldSecret(ctx) + } + return nil, fmt.Errorf("unknown EmailVerificationToken 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 *EmailVerificationTokenMutation) SetField(name string, value ent.Value) error { + switch name { + case emailverificationtoken.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case emailverificationtoken.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case emailverificationtoken.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case emailverificationtoken.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case emailverificationtoken.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case emailverificationtoken.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case emailverificationtoken.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case emailverificationtoken.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case emailverificationtoken.FieldToken: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetToken(v) + return nil + case emailverificationtoken.FieldTTL: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTTL(v) + return nil + case emailverificationtoken.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case emailverificationtoken.FieldSecret: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecret(v) + return nil + } + return fmt.Errorf("unknown EmailVerificationToken field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EmailVerificationTokenMutation) 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 *EmailVerificationTokenMutation) 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 *EmailVerificationTokenMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EmailVerificationToken numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EmailVerificationTokenMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(emailverificationtoken.FieldCreatedAt) { + fields = append(fields, emailverificationtoken.FieldCreatedAt) + } + if m.FieldCleared(emailverificationtoken.FieldUpdatedAt) { + fields = append(fields, emailverificationtoken.FieldUpdatedAt) + } + if m.FieldCleared(emailverificationtoken.FieldCreatedBy) { + fields = append(fields, emailverificationtoken.FieldCreatedBy) + } + if m.FieldCleared(emailverificationtoken.FieldUpdatedBy) { + fields = append(fields, emailverificationtoken.FieldUpdatedBy) + } + if m.FieldCleared(emailverificationtoken.FieldDeletedAt) { + fields = append(fields, emailverificationtoken.FieldDeletedAt) + } + if m.FieldCleared(emailverificationtoken.FieldDeletedBy) { + fields = append(fields, emailverificationtoken.FieldDeletedBy) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EmailVerificationTokenMutation) 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 *EmailVerificationTokenMutation) ClearField(name string) error { + switch name { + case emailverificationtoken.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case emailverificationtoken.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case emailverificationtoken.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case emailverificationtoken.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case emailverificationtoken.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case emailverificationtoken.FieldDeletedBy: + m.ClearDeletedBy() + return nil + } + return fmt.Errorf("unknown EmailVerificationToken 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 *EmailVerificationTokenMutation) ResetField(name string) error { + switch name { + case emailverificationtoken.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case emailverificationtoken.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case emailverificationtoken.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case emailverificationtoken.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case emailverificationtoken.FieldMappingID: + m.ResetMappingID() + return nil + case emailverificationtoken.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case emailverificationtoken.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case emailverificationtoken.FieldOwnerID: + m.ResetOwnerID() + return nil + case emailverificationtoken.FieldToken: + m.ResetToken() + return nil + case emailverificationtoken.FieldTTL: + m.ResetTTL() + return nil + case emailverificationtoken.FieldEmail: + m.ResetEmail() + return nil + case emailverificationtoken.FieldSecret: + m.ResetSecret() + return nil + } + return fmt.Errorf("unknown EmailVerificationToken field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EmailVerificationTokenMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.owner != nil { + edges = append(edges, emailverificationtoken.EdgeOwner) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EmailVerificationTokenMutation) AddedIDs(name string) []ent.Value { + switch name { + case emailverificationtoken.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EmailVerificationTokenMutation) 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 *EmailVerificationTokenMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EmailVerificationTokenMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedowner { + edges = append(edges, emailverificationtoken.EdgeOwner) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EmailVerificationTokenMutation) EdgeCleared(name string) bool { + switch name { + case emailverificationtoken.EdgeOwner: + return m.clearedowner + } + 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 *EmailVerificationTokenMutation) ClearEdge(name string) error { + switch name { + case emailverificationtoken.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown EmailVerificationToken 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 *EmailVerificationTokenMutation) ResetEdge(name string) error { + switch name { + case emailverificationtoken.EdgeOwner: + m.ResetOwner() + return nil + } + return fmt.Errorf("unknown EmailVerificationToken edge %s", name) +} + +// EntitlementMutation represents an operation that mutates the Entitlement nodes in the graph. +type EntitlementMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + external_customer_id *string + external_subscription_id *string + expires *bool + expires_at *time.Time + cancelled *bool + clearedFields map[string]struct{} + owner *string + clearedowner bool + plan *string + clearedplan bool + organization *string + clearedorganization bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*Entitlement, error) + predicates []predicate.Entitlement +} + +var _ ent.Mutation = (*EntitlementMutation)(nil) + +// entitlementOption allows management of the mutation configuration using functional options. +type entitlementOption func(*EntitlementMutation) + +// newEntitlementMutation creates new mutation for the Entitlement entity. +func newEntitlementMutation(c config, op Op, opts ...entitlementOption) *EntitlementMutation { + m := &EntitlementMutation{ + config: c, + op: op, + typ: TypeEntitlement, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntitlementID sets the ID field of the mutation. +func withEntitlementID(id string) entitlementOption { + return func(m *EntitlementMutation) { + var ( + err error + once sync.Once + value *Entitlement + ) + m.oldValue = func(ctx context.Context) (*Entitlement, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Entitlement.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntitlement sets the old Entitlement of the mutation. +func withEntitlement(node *Entitlement) entitlementOption { + return func(m *EntitlementMutation) { + m.oldValue = func(context.Context) (*Entitlement, 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 EntitlementMutation) 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 EntitlementMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Entitlement entities. +func (m *EntitlementMutation) SetID(id string) { + 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 *EntitlementMutation) ID() (id string, 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 *EntitlementMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Entitlement.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntitlementMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntitlementMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntitlementMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitlement.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntitlementMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitlement.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntitlementMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitlement.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntitlementMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntitlementMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntitlementMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitlement.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntitlementMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitlement.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntitlementMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitlement.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntitlementMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntitlementMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntitlementMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitlement.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntitlementMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitlement.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntitlementMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitlement.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntitlementMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntitlementMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntitlementMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitlement.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntitlementMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitlement.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntitlementMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitlement.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntitlementMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntitlementMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntitlementMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *EntitlementMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntitlementMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntitlementMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntitlementMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntitlementMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitlement.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntitlementMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitlement.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntitlementMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitlement.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntitlementMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntitlementMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntitlementMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitlement.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntitlementMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitlement.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntitlementMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitlement.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntitlementMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntitlementMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntitlementMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitlement.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntitlementMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitlement.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntitlementMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitlement.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntitlementMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntitlementMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntitlementMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[entitlement.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntitlementMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitlement.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntitlementMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, entitlement.FieldOwnerID) +} + +// SetPlanID sets the "plan_id" field. +func (m *EntitlementMutation) SetPlanID(s string) { + m.plan = &s +} + +// PlanID returns the value of the "plan_id" field in the mutation. +func (m *EntitlementMutation) PlanID() (r string, exists bool) { + v := m.plan + if v == nil { + return + } + return *v, true +} + +// OldPlanID returns the old "plan_id" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldPlanID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPlanID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPlanID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPlanID: %w", err) + } + return oldValue.PlanID, nil +} + +// ResetPlanID resets all changes to the "plan_id" field. +func (m *EntitlementMutation) ResetPlanID() { + m.plan = nil +} + +// SetOrganizationID sets the "organization_id" field. +func (m *EntitlementMutation) SetOrganizationID(s string) { + m.organization = &s +} + +// OrganizationID returns the value of the "organization_id" field in the mutation. +func (m *EntitlementMutation) OrganizationID() (r string, exists bool) { + v := m.organization + if v == nil { + return + } + return *v, true +} + +// OldOrganizationID returns the old "organization_id" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err) + } + return oldValue.OrganizationID, nil +} + +// ResetOrganizationID resets all changes to the "organization_id" field. +func (m *EntitlementMutation) ResetOrganizationID() { + m.organization = nil +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (m *EntitlementMutation) SetExternalCustomerID(s string) { + m.external_customer_id = &s +} + +// ExternalCustomerID returns the value of the "external_customer_id" field in the mutation. +func (m *EntitlementMutation) ExternalCustomerID() (r string, exists bool) { + v := m.external_customer_id + if v == nil { + return + } + return *v, true +} + +// OldExternalCustomerID returns the old "external_customer_id" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldExternalCustomerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExternalCustomerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExternalCustomerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExternalCustomerID: %w", err) + } + return oldValue.ExternalCustomerID, nil +} + +// ClearExternalCustomerID clears the value of the "external_customer_id" field. +func (m *EntitlementMutation) ClearExternalCustomerID() { + m.external_customer_id = nil + m.clearedFields[entitlement.FieldExternalCustomerID] = struct{}{} +} + +// ExternalCustomerIDCleared returns if the "external_customer_id" field was cleared in this mutation. +func (m *EntitlementMutation) ExternalCustomerIDCleared() bool { + _, ok := m.clearedFields[entitlement.FieldExternalCustomerID] + return ok +} + +// ResetExternalCustomerID resets all changes to the "external_customer_id" field. +func (m *EntitlementMutation) ResetExternalCustomerID() { + m.external_customer_id = nil + delete(m.clearedFields, entitlement.FieldExternalCustomerID) +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (m *EntitlementMutation) SetExternalSubscriptionID(s string) { + m.external_subscription_id = &s +} + +// ExternalSubscriptionID returns the value of the "external_subscription_id" field in the mutation. +func (m *EntitlementMutation) ExternalSubscriptionID() (r string, exists bool) { + v := m.external_subscription_id + if v == nil { + return + } + return *v, true +} + +// OldExternalSubscriptionID returns the old "external_subscription_id" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldExternalSubscriptionID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExternalSubscriptionID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExternalSubscriptionID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExternalSubscriptionID: %w", err) + } + return oldValue.ExternalSubscriptionID, nil +} + +// ClearExternalSubscriptionID clears the value of the "external_subscription_id" field. +func (m *EntitlementMutation) ClearExternalSubscriptionID() { + m.external_subscription_id = nil + m.clearedFields[entitlement.FieldExternalSubscriptionID] = struct{}{} +} + +// ExternalSubscriptionIDCleared returns if the "external_subscription_id" field was cleared in this mutation. +func (m *EntitlementMutation) ExternalSubscriptionIDCleared() bool { + _, ok := m.clearedFields[entitlement.FieldExternalSubscriptionID] + return ok +} + +// ResetExternalSubscriptionID resets all changes to the "external_subscription_id" field. +func (m *EntitlementMutation) ResetExternalSubscriptionID() { + m.external_subscription_id = nil + delete(m.clearedFields, entitlement.FieldExternalSubscriptionID) +} + +// SetExpires sets the "expires" field. +func (m *EntitlementMutation) SetExpires(b bool) { + m.expires = &b +} + +// Expires returns the value of the "expires" field in the mutation. +func (m *EntitlementMutation) Expires() (r bool, exists bool) { + v := m.expires + if v == nil { + return + } + return *v, true +} + +// OldExpires returns the old "expires" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldExpires(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpires is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpires requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpires: %w", err) + } + return oldValue.Expires, nil +} + +// ResetExpires resets all changes to the "expires" field. +func (m *EntitlementMutation) ResetExpires() { + m.expires = nil +} + +// SetExpiresAt sets the "expires_at" field. +func (m *EntitlementMutation) SetExpiresAt(t time.Time) { + m.expires_at = &t +} + +// ExpiresAt returns the value of the "expires_at" field in the mutation. +func (m *EntitlementMutation) ExpiresAt() (r time.Time, exists bool) { + v := m.expires_at + if v == nil { + return + } + return *v, true +} + +// OldExpiresAt returns the old "expires_at" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpiresAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpiresAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpiresAt: %w", err) + } + return oldValue.ExpiresAt, nil +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (m *EntitlementMutation) ClearExpiresAt() { + m.expires_at = nil + m.clearedFields[entitlement.FieldExpiresAt] = struct{}{} +} + +// ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation. +func (m *EntitlementMutation) ExpiresAtCleared() bool { + _, ok := m.clearedFields[entitlement.FieldExpiresAt] + return ok +} + +// ResetExpiresAt resets all changes to the "expires_at" field. +func (m *EntitlementMutation) ResetExpiresAt() { + m.expires_at = nil + delete(m.clearedFields, entitlement.FieldExpiresAt) +} + +// SetCancelled sets the "cancelled" field. +func (m *EntitlementMutation) SetCancelled(b bool) { + m.cancelled = &b +} + +// Cancelled returns the value of the "cancelled" field in the mutation. +func (m *EntitlementMutation) Cancelled() (r bool, exists bool) { + v := m.cancelled + if v == nil { + return + } + return *v, true +} + +// OldCancelled returns the old "cancelled" field's value of the Entitlement entity. +// If the Entitlement 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 *EntitlementMutation) OldCancelled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCancelled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCancelled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCancelled: %w", err) + } + return oldValue.Cancelled, nil +} + +// ResetCancelled resets all changes to the "cancelled" field. +func (m *EntitlementMutation) ResetCancelled() { + m.cancelled = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *EntitlementMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[entitlement.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *EntitlementMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *EntitlementMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *EntitlementMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// ClearPlan clears the "plan" edge to the EntitlementPlan entity. +func (m *EntitlementMutation) ClearPlan() { + m.clearedplan = true + m.clearedFields[entitlement.FieldPlanID] = struct{}{} +} + +// PlanCleared reports if the "plan" edge to the EntitlementPlan entity was cleared. +func (m *EntitlementMutation) PlanCleared() bool { + return m.clearedplan +} + +// PlanIDs returns the "plan" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// PlanID instead. It exists only for internal usage by the builders. +func (m *EntitlementMutation) PlanIDs() (ids []string) { + if id := m.plan; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetPlan resets all changes to the "plan" edge. +func (m *EntitlementMutation) ResetPlan() { + m.plan = nil + m.clearedplan = false +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (m *EntitlementMutation) ClearOrganization() { + m.clearedorganization = true + m.clearedFields[entitlement.FieldOrganizationID] = struct{}{} +} + +// OrganizationCleared reports if the "organization" edge to the Organization entity was cleared. +func (m *EntitlementMutation) OrganizationCleared() bool { + return m.clearedorganization +} + +// OrganizationIDs returns the "organization" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OrganizationID instead. It exists only for internal usage by the builders. +func (m *EntitlementMutation) OrganizationIDs() (ids []string) { + if id := m.organization; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOrganization resets all changes to the "organization" edge. +func (m *EntitlementMutation) ResetOrganization() { + m.organization = nil + m.clearedorganization = false +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *EntitlementMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *EntitlementMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *EntitlementMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *EntitlementMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *EntitlementMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *EntitlementMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *EntitlementMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the EntitlementMutation builder. +func (m *EntitlementMutation) Where(ps ...predicate.Entitlement) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntitlementMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntitlementMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Entitlement, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntitlementMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntitlementMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Entitlement). +func (m *EntitlementMutation) 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 *EntitlementMutation) Fields() []string { + fields := make([]string, 0, 16) + if m.created_at != nil { + fields = append(fields, entitlement.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitlement.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitlement.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitlement.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitlement.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, entitlement.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, entitlement.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitlement.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, entitlement.FieldOwnerID) + } + if m.plan != nil { + fields = append(fields, entitlement.FieldPlanID) + } + if m.organization != nil { + fields = append(fields, entitlement.FieldOrganizationID) + } + if m.external_customer_id != nil { + fields = append(fields, entitlement.FieldExternalCustomerID) + } + if m.external_subscription_id != nil { + fields = append(fields, entitlement.FieldExternalSubscriptionID) + } + if m.expires != nil { + fields = append(fields, entitlement.FieldExpires) + } + if m.expires_at != nil { + fields = append(fields, entitlement.FieldExpiresAt) + } + if m.cancelled != nil { + fields = append(fields, entitlement.FieldCancelled) + } + 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 *EntitlementMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitlement.FieldCreatedAt: + return m.CreatedAt() + case entitlement.FieldUpdatedAt: + return m.UpdatedAt() + case entitlement.FieldCreatedBy: + return m.CreatedBy() + case entitlement.FieldUpdatedBy: + return m.UpdatedBy() + case entitlement.FieldMappingID: + return m.MappingID() + case entitlement.FieldTags: + return m.Tags() + case entitlement.FieldDeletedAt: + return m.DeletedAt() + case entitlement.FieldDeletedBy: + return m.DeletedBy() + case entitlement.FieldOwnerID: + return m.OwnerID() + case entitlement.FieldPlanID: + return m.PlanID() + case entitlement.FieldOrganizationID: + return m.OrganizationID() + case entitlement.FieldExternalCustomerID: + return m.ExternalCustomerID() + case entitlement.FieldExternalSubscriptionID: + return m.ExternalSubscriptionID() + case entitlement.FieldExpires: + return m.Expires() + case entitlement.FieldExpiresAt: + return m.ExpiresAt() + case entitlement.FieldCancelled: + return m.Cancelled() + } + 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 *EntitlementMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitlement.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitlement.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitlement.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitlement.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitlement.FieldMappingID: + return m.OldMappingID(ctx) + case entitlement.FieldTags: + return m.OldTags(ctx) + case entitlement.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitlement.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitlement.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitlement.FieldPlanID: + return m.OldPlanID(ctx) + case entitlement.FieldOrganizationID: + return m.OldOrganizationID(ctx) + case entitlement.FieldExternalCustomerID: + return m.OldExternalCustomerID(ctx) + case entitlement.FieldExternalSubscriptionID: + return m.OldExternalSubscriptionID(ctx) + case entitlement.FieldExpires: + return m.OldExpires(ctx) + case entitlement.FieldExpiresAt: + return m.OldExpiresAt(ctx) + case entitlement.FieldCancelled: + return m.OldCancelled(ctx) + } + return nil, fmt.Errorf("unknown Entitlement 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 *EntitlementMutation) SetField(name string, value ent.Value) error { + switch name { + case entitlement.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitlement.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitlement.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitlement.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitlement.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitlement.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitlement.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitlement.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitlement.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitlement.FieldPlanID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPlanID(v) + return nil + case entitlement.FieldOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrganizationID(v) + return nil + case entitlement.FieldExternalCustomerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExternalCustomerID(v) + return nil + case entitlement.FieldExternalSubscriptionID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExternalSubscriptionID(v) + return nil + case entitlement.FieldExpires: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpires(v) + return nil + case entitlement.FieldExpiresAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpiresAt(v) + return nil + case entitlement.FieldCancelled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCancelled(v) + return nil + } + return fmt.Errorf("unknown Entitlement field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntitlementMutation) 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 *EntitlementMutation) 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 *EntitlementMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Entitlement numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntitlementMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitlement.FieldCreatedAt) { + fields = append(fields, entitlement.FieldCreatedAt) + } + if m.FieldCleared(entitlement.FieldUpdatedAt) { + fields = append(fields, entitlement.FieldUpdatedAt) + } + if m.FieldCleared(entitlement.FieldCreatedBy) { + fields = append(fields, entitlement.FieldCreatedBy) + } + if m.FieldCleared(entitlement.FieldUpdatedBy) { + fields = append(fields, entitlement.FieldUpdatedBy) + } + if m.FieldCleared(entitlement.FieldTags) { + fields = append(fields, entitlement.FieldTags) + } + if m.FieldCleared(entitlement.FieldDeletedAt) { + fields = append(fields, entitlement.FieldDeletedAt) + } + if m.FieldCleared(entitlement.FieldDeletedBy) { + fields = append(fields, entitlement.FieldDeletedBy) + } + if m.FieldCleared(entitlement.FieldOwnerID) { + fields = append(fields, entitlement.FieldOwnerID) + } + if m.FieldCleared(entitlement.FieldExternalCustomerID) { + fields = append(fields, entitlement.FieldExternalCustomerID) + } + if m.FieldCleared(entitlement.FieldExternalSubscriptionID) { + fields = append(fields, entitlement.FieldExternalSubscriptionID) + } + if m.FieldCleared(entitlement.FieldExpiresAt) { + fields = append(fields, entitlement.FieldExpiresAt) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntitlementMutation) 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 *EntitlementMutation) ClearField(name string) error { + switch name { + case entitlement.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitlement.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitlement.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitlement.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitlement.FieldTags: + m.ClearTags() + return nil + case entitlement.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitlement.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitlement.FieldOwnerID: + m.ClearOwnerID() + return nil + case entitlement.FieldExternalCustomerID: + m.ClearExternalCustomerID() + return nil + case entitlement.FieldExternalSubscriptionID: + m.ClearExternalSubscriptionID() + return nil + case entitlement.FieldExpiresAt: + m.ClearExpiresAt() + return nil + } + return fmt.Errorf("unknown Entitlement 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 *EntitlementMutation) ResetField(name string) error { + switch name { + case entitlement.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitlement.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitlement.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitlement.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitlement.FieldMappingID: + m.ResetMappingID() + return nil + case entitlement.FieldTags: + m.ResetTags() + return nil + case entitlement.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitlement.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitlement.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitlement.FieldPlanID: + m.ResetPlanID() + return nil + case entitlement.FieldOrganizationID: + m.ResetOrganizationID() + return nil + case entitlement.FieldExternalCustomerID: + m.ResetExternalCustomerID() + return nil + case entitlement.FieldExternalSubscriptionID: + m.ResetExternalSubscriptionID() + return nil + case entitlement.FieldExpires: + m.ResetExpires() + return nil + case entitlement.FieldExpiresAt: + m.ResetExpiresAt() + return nil + case entitlement.FieldCancelled: + m.ResetCancelled() + return nil + } + return fmt.Errorf("unknown Entitlement field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntitlementMutation) AddedEdges() []string { + edges := make([]string, 0, 4) + if m.owner != nil { + edges = append(edges, entitlement.EdgeOwner) + } + if m.plan != nil { + edges = append(edges, entitlement.EdgePlan) + } + if m.organization != nil { + edges = append(edges, entitlement.EdgeOrganization) + } + if m.events != nil { + edges = append(edges, entitlement.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntitlementMutation) AddedIDs(name string) []ent.Value { + switch name { + case entitlement.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case entitlement.EdgePlan: + if id := m.plan; id != nil { + return []ent.Value{*id} + } + case entitlement.EdgeOrganization: + if id := m.organization; id != nil { + return []ent.Value{*id} + } + case entitlement.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntitlementMutation) RemovedEdges() []string { + edges := make([]string, 0, 4) + if m.removedevents != nil { + edges = append(edges, entitlement.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntitlementMutation) RemovedIDs(name string) []ent.Value { + switch name { + case entitlement.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntitlementMutation) ClearedEdges() []string { + edges := make([]string, 0, 4) + if m.clearedowner { + edges = append(edges, entitlement.EdgeOwner) + } + if m.clearedplan { + edges = append(edges, entitlement.EdgePlan) + } + if m.clearedorganization { + edges = append(edges, entitlement.EdgeOrganization) + } + if m.clearedevents { + edges = append(edges, entitlement.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntitlementMutation) EdgeCleared(name string) bool { + switch name { + case entitlement.EdgeOwner: + return m.clearedowner + case entitlement.EdgePlan: + return m.clearedplan + case entitlement.EdgeOrganization: + return m.clearedorganization + case entitlement.EdgeEvents: + return m.clearedevents + } + 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 *EntitlementMutation) ClearEdge(name string) error { + switch name { + case entitlement.EdgeOwner: + m.ClearOwner() + return nil + case entitlement.EdgePlan: + m.ClearPlan() + return nil + case entitlement.EdgeOrganization: + m.ClearOrganization() + return nil + } + return fmt.Errorf("unknown Entitlement 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 *EntitlementMutation) ResetEdge(name string) error { + switch name { + case entitlement.EdgeOwner: + m.ResetOwner() + return nil + case entitlement.EdgePlan: + m.ResetPlan() + return nil + case entitlement.EdgeOrganization: + m.ResetOrganization() + return nil + case entitlement.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown Entitlement edge %s", name) +} + +// EntitlementHistoryMutation represents an operation that mutates the EntitlementHistory nodes in the graph. +type EntitlementHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + owner_id *string + plan_id *string + organization_id *string + external_customer_id *string + external_subscription_id *string + expires *bool + expires_at *time.Time + cancelled *bool + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*EntitlementHistory, error) + predicates []predicate.EntitlementHistory +} + +var _ ent.Mutation = (*EntitlementHistoryMutation)(nil) + +// entitlementhistoryOption allows management of the mutation configuration using functional options. +type entitlementhistoryOption func(*EntitlementHistoryMutation) + +// newEntitlementHistoryMutation creates new mutation for the EntitlementHistory entity. +func newEntitlementHistoryMutation(c config, op Op, opts ...entitlementhistoryOption) *EntitlementHistoryMutation { + m := &EntitlementHistoryMutation{ + config: c, + op: op, + typ: TypeEntitlementHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntitlementHistoryID sets the ID field of the mutation. +func withEntitlementHistoryID(id string) entitlementhistoryOption { + return func(m *EntitlementHistoryMutation) { + var ( + err error + once sync.Once + value *EntitlementHistory + ) + m.oldValue = func(ctx context.Context) (*EntitlementHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntitlementHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntitlementHistory sets the old EntitlementHistory of the mutation. +func withEntitlementHistory(node *EntitlementHistory) entitlementhistoryOption { + return func(m *EntitlementHistoryMutation) { + m.oldValue = func(context.Context) (*EntitlementHistory, 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 EntitlementHistoryMutation) 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 EntitlementHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntitlementHistory entities. +func (m *EntitlementHistoryMutation) SetID(id string) { + 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 *EntitlementHistoryMutation) ID() (id string, 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 *EntitlementHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntitlementHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *EntitlementHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *EntitlementHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *EntitlementHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *EntitlementHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *EntitlementHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *EntitlementHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[entitlementhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *EntitlementHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, entitlementhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *EntitlementHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *EntitlementHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *EntitlementHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntitlementHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntitlementHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntitlementHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitlementhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntitlementHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitlementhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntitlementHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntitlementHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntitlementHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitlementhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntitlementHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitlementhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntitlementHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntitlementHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntitlementHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitlementhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntitlementHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitlementhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntitlementHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntitlementHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntitlementHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitlementhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntitlementHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitlementhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntitlementHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntitlementHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntitlementHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *EntitlementHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntitlementHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntitlementHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntitlementHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntitlementHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitlementhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntitlementHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitlementhistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntitlementHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntitlementHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntitlementHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitlementhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntitlementHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitlementhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntitlementHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntitlementHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntitlementHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitlementhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntitlementHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitlementhistory.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntitlementHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntitlementHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntitlementHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[entitlementhistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntitlementHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, entitlementhistory.FieldOwnerID) +} + +// SetPlanID sets the "plan_id" field. +func (m *EntitlementHistoryMutation) SetPlanID(s string) { + m.plan_id = &s +} + +// PlanID returns the value of the "plan_id" field in the mutation. +func (m *EntitlementHistoryMutation) PlanID() (r string, exists bool) { + v := m.plan_id + if v == nil { + return + } + return *v, true +} + +// OldPlanID returns the old "plan_id" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldPlanID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPlanID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPlanID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPlanID: %w", err) + } + return oldValue.PlanID, nil +} + +// ResetPlanID resets all changes to the "plan_id" field. +func (m *EntitlementHistoryMutation) ResetPlanID() { + m.plan_id = nil +} + +// SetOrganizationID sets the "organization_id" field. +func (m *EntitlementHistoryMutation) SetOrganizationID(s string) { + m.organization_id = &s +} + +// OrganizationID returns the value of the "organization_id" field in the mutation. +func (m *EntitlementHistoryMutation) OrganizationID() (r string, exists bool) { + v := m.organization_id + if v == nil { + return + } + return *v, true +} + +// OldOrganizationID returns the old "organization_id" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err) + } + return oldValue.OrganizationID, nil +} + +// ResetOrganizationID resets all changes to the "organization_id" field. +func (m *EntitlementHistoryMutation) ResetOrganizationID() { + m.organization_id = nil +} + +// SetExternalCustomerID sets the "external_customer_id" field. +func (m *EntitlementHistoryMutation) SetExternalCustomerID(s string) { + m.external_customer_id = &s +} + +// ExternalCustomerID returns the value of the "external_customer_id" field in the mutation. +func (m *EntitlementHistoryMutation) ExternalCustomerID() (r string, exists bool) { + v := m.external_customer_id + if v == nil { + return + } + return *v, true +} + +// OldExternalCustomerID returns the old "external_customer_id" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldExternalCustomerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExternalCustomerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExternalCustomerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExternalCustomerID: %w", err) + } + return oldValue.ExternalCustomerID, nil +} + +// ClearExternalCustomerID clears the value of the "external_customer_id" field. +func (m *EntitlementHistoryMutation) ClearExternalCustomerID() { + m.external_customer_id = nil + m.clearedFields[entitlementhistory.FieldExternalCustomerID] = struct{}{} +} + +// ExternalCustomerIDCleared returns if the "external_customer_id" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) ExternalCustomerIDCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldExternalCustomerID] + return ok +} + +// ResetExternalCustomerID resets all changes to the "external_customer_id" field. +func (m *EntitlementHistoryMutation) ResetExternalCustomerID() { + m.external_customer_id = nil + delete(m.clearedFields, entitlementhistory.FieldExternalCustomerID) +} + +// SetExternalSubscriptionID sets the "external_subscription_id" field. +func (m *EntitlementHistoryMutation) SetExternalSubscriptionID(s string) { + m.external_subscription_id = &s +} + +// ExternalSubscriptionID returns the value of the "external_subscription_id" field in the mutation. +func (m *EntitlementHistoryMutation) ExternalSubscriptionID() (r string, exists bool) { + v := m.external_subscription_id + if v == nil { + return + } + return *v, true +} + +// OldExternalSubscriptionID returns the old "external_subscription_id" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldExternalSubscriptionID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExternalSubscriptionID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExternalSubscriptionID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExternalSubscriptionID: %w", err) + } + return oldValue.ExternalSubscriptionID, nil +} + +// ClearExternalSubscriptionID clears the value of the "external_subscription_id" field. +func (m *EntitlementHistoryMutation) ClearExternalSubscriptionID() { + m.external_subscription_id = nil + m.clearedFields[entitlementhistory.FieldExternalSubscriptionID] = struct{}{} +} + +// ExternalSubscriptionIDCleared returns if the "external_subscription_id" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) ExternalSubscriptionIDCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldExternalSubscriptionID] + return ok +} + +// ResetExternalSubscriptionID resets all changes to the "external_subscription_id" field. +func (m *EntitlementHistoryMutation) ResetExternalSubscriptionID() { + m.external_subscription_id = nil + delete(m.clearedFields, entitlementhistory.FieldExternalSubscriptionID) +} + +// SetExpires sets the "expires" field. +func (m *EntitlementHistoryMutation) SetExpires(b bool) { + m.expires = &b +} + +// Expires returns the value of the "expires" field in the mutation. +func (m *EntitlementHistoryMutation) Expires() (r bool, exists bool) { + v := m.expires + if v == nil { + return + } + return *v, true +} + +// OldExpires returns the old "expires" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldExpires(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpires is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpires requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpires: %w", err) + } + return oldValue.Expires, nil +} + +// ResetExpires resets all changes to the "expires" field. +func (m *EntitlementHistoryMutation) ResetExpires() { + m.expires = nil +} + +// SetExpiresAt sets the "expires_at" field. +func (m *EntitlementHistoryMutation) SetExpiresAt(t time.Time) { + m.expires_at = &t +} + +// ExpiresAt returns the value of the "expires_at" field in the mutation. +func (m *EntitlementHistoryMutation) ExpiresAt() (r time.Time, exists bool) { + v := m.expires_at + if v == nil { + return + } + return *v, true +} + +// OldExpiresAt returns the old "expires_at" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpiresAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpiresAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpiresAt: %w", err) + } + return oldValue.ExpiresAt, nil +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (m *EntitlementHistoryMutation) ClearExpiresAt() { + m.expires_at = nil + m.clearedFields[entitlementhistory.FieldExpiresAt] = struct{}{} +} + +// ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation. +func (m *EntitlementHistoryMutation) ExpiresAtCleared() bool { + _, ok := m.clearedFields[entitlementhistory.FieldExpiresAt] + return ok +} + +// ResetExpiresAt resets all changes to the "expires_at" field. +func (m *EntitlementHistoryMutation) ResetExpiresAt() { + m.expires_at = nil + delete(m.clearedFields, entitlementhistory.FieldExpiresAt) +} + +// SetCancelled sets the "cancelled" field. +func (m *EntitlementHistoryMutation) SetCancelled(b bool) { + m.cancelled = &b +} + +// Cancelled returns the value of the "cancelled" field in the mutation. +func (m *EntitlementHistoryMutation) Cancelled() (r bool, exists bool) { + v := m.cancelled + if v == nil { + return + } + return *v, true +} + +// OldCancelled returns the old "cancelled" field's value of the EntitlementHistory entity. +// If the EntitlementHistory 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 *EntitlementHistoryMutation) OldCancelled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCancelled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCancelled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCancelled: %w", err) + } + return oldValue.Cancelled, nil +} + +// ResetCancelled resets all changes to the "cancelled" field. +func (m *EntitlementHistoryMutation) ResetCancelled() { + m.cancelled = nil +} + +// Where appends a list predicates to the EntitlementHistoryMutation builder. +func (m *EntitlementHistoryMutation) Where(ps ...predicate.EntitlementHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntitlementHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntitlementHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntitlementHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntitlementHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntitlementHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntitlementHistory). +func (m *EntitlementHistoryMutation) 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 *EntitlementHistoryMutation) Fields() []string { + fields := make([]string, 0, 19) + if m.history_time != nil { + fields = append(fields, entitlementhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, entitlementhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, entitlementhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, entitlementhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitlementhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitlementhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitlementhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitlementhistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, entitlementhistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, entitlementhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitlementhistory.FieldDeletedBy) + } + if m.owner_id != nil { + fields = append(fields, entitlementhistory.FieldOwnerID) + } + if m.plan_id != nil { + fields = append(fields, entitlementhistory.FieldPlanID) + } + if m.organization_id != nil { + fields = append(fields, entitlementhistory.FieldOrganizationID) + } + if m.external_customer_id != nil { + fields = append(fields, entitlementhistory.FieldExternalCustomerID) + } + if m.external_subscription_id != nil { + fields = append(fields, entitlementhistory.FieldExternalSubscriptionID) + } + if m.expires != nil { + fields = append(fields, entitlementhistory.FieldExpires) + } + if m.expires_at != nil { + fields = append(fields, entitlementhistory.FieldExpiresAt) + } + if m.cancelled != nil { + fields = append(fields, entitlementhistory.FieldCancelled) + } + 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 *EntitlementHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitlementhistory.FieldHistoryTime: + return m.HistoryTime() + case entitlementhistory.FieldRef: + return m.Ref() + case entitlementhistory.FieldOperation: + return m.Operation() + case entitlementhistory.FieldCreatedAt: + return m.CreatedAt() + case entitlementhistory.FieldUpdatedAt: + return m.UpdatedAt() + case entitlementhistory.FieldCreatedBy: + return m.CreatedBy() + case entitlementhistory.FieldUpdatedBy: + return m.UpdatedBy() + case entitlementhistory.FieldMappingID: + return m.MappingID() + case entitlementhistory.FieldTags: + return m.Tags() + case entitlementhistory.FieldDeletedAt: + return m.DeletedAt() + case entitlementhistory.FieldDeletedBy: + return m.DeletedBy() + case entitlementhistory.FieldOwnerID: + return m.OwnerID() + case entitlementhistory.FieldPlanID: + return m.PlanID() + case entitlementhistory.FieldOrganizationID: + return m.OrganizationID() + case entitlementhistory.FieldExternalCustomerID: + return m.ExternalCustomerID() + case entitlementhistory.FieldExternalSubscriptionID: + return m.ExternalSubscriptionID() + case entitlementhistory.FieldExpires: + return m.Expires() + case entitlementhistory.FieldExpiresAt: + return m.ExpiresAt() + case entitlementhistory.FieldCancelled: + return m.Cancelled() + } + 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 *EntitlementHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitlementhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case entitlementhistory.FieldRef: + return m.OldRef(ctx) + case entitlementhistory.FieldOperation: + return m.OldOperation(ctx) + case entitlementhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitlementhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitlementhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitlementhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitlementhistory.FieldMappingID: + return m.OldMappingID(ctx) + case entitlementhistory.FieldTags: + return m.OldTags(ctx) + case entitlementhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitlementhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitlementhistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitlementhistory.FieldPlanID: + return m.OldPlanID(ctx) + case entitlementhistory.FieldOrganizationID: + return m.OldOrganizationID(ctx) + case entitlementhistory.FieldExternalCustomerID: + return m.OldExternalCustomerID(ctx) + case entitlementhistory.FieldExternalSubscriptionID: + return m.OldExternalSubscriptionID(ctx) + case entitlementhistory.FieldExpires: + return m.OldExpires(ctx) + case entitlementhistory.FieldExpiresAt: + return m.OldExpiresAt(ctx) + case entitlementhistory.FieldCancelled: + return m.OldCancelled(ctx) + } + return nil, fmt.Errorf("unknown EntitlementHistory 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 *EntitlementHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case entitlementhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case entitlementhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case entitlementhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case entitlementhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitlementhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitlementhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitlementhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitlementhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitlementhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitlementhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitlementhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitlementhistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitlementhistory.FieldPlanID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPlanID(v) + return nil + case entitlementhistory.FieldOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrganizationID(v) + return nil + case entitlementhistory.FieldExternalCustomerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExternalCustomerID(v) + return nil + case entitlementhistory.FieldExternalSubscriptionID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExternalSubscriptionID(v) + return nil + case entitlementhistory.FieldExpires: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpires(v) + return nil + case entitlementhistory.FieldExpiresAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpiresAt(v) + return nil + case entitlementhistory.FieldCancelled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCancelled(v) + return nil + } + return fmt.Errorf("unknown EntitlementHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntitlementHistoryMutation) 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 *EntitlementHistoryMutation) 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 *EntitlementHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntitlementHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntitlementHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitlementhistory.FieldRef) { + fields = append(fields, entitlementhistory.FieldRef) + } + if m.FieldCleared(entitlementhistory.FieldCreatedAt) { + fields = append(fields, entitlementhistory.FieldCreatedAt) + } + if m.FieldCleared(entitlementhistory.FieldUpdatedAt) { + fields = append(fields, entitlementhistory.FieldUpdatedAt) + } + if m.FieldCleared(entitlementhistory.FieldCreatedBy) { + fields = append(fields, entitlementhistory.FieldCreatedBy) + } + if m.FieldCleared(entitlementhistory.FieldUpdatedBy) { + fields = append(fields, entitlementhistory.FieldUpdatedBy) + } + if m.FieldCleared(entitlementhistory.FieldTags) { + fields = append(fields, entitlementhistory.FieldTags) + } + if m.FieldCleared(entitlementhistory.FieldDeletedAt) { + fields = append(fields, entitlementhistory.FieldDeletedAt) + } + if m.FieldCleared(entitlementhistory.FieldDeletedBy) { + fields = append(fields, entitlementhistory.FieldDeletedBy) + } + if m.FieldCleared(entitlementhistory.FieldOwnerID) { + fields = append(fields, entitlementhistory.FieldOwnerID) + } + if m.FieldCleared(entitlementhistory.FieldExternalCustomerID) { + fields = append(fields, entitlementhistory.FieldExternalCustomerID) + } + if m.FieldCleared(entitlementhistory.FieldExternalSubscriptionID) { + fields = append(fields, entitlementhistory.FieldExternalSubscriptionID) + } + if m.FieldCleared(entitlementhistory.FieldExpiresAt) { + fields = append(fields, entitlementhistory.FieldExpiresAt) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntitlementHistoryMutation) 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 *EntitlementHistoryMutation) ClearField(name string) error { + switch name { + case entitlementhistory.FieldRef: + m.ClearRef() + return nil + case entitlementhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitlementhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitlementhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitlementhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitlementhistory.FieldTags: + m.ClearTags() + return nil + case entitlementhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitlementhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitlementhistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case entitlementhistory.FieldExternalCustomerID: + m.ClearExternalCustomerID() + return nil + case entitlementhistory.FieldExternalSubscriptionID: + m.ClearExternalSubscriptionID() + return nil + case entitlementhistory.FieldExpiresAt: + m.ClearExpiresAt() + return nil + } + return fmt.Errorf("unknown EntitlementHistory 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 *EntitlementHistoryMutation) ResetField(name string) error { + switch name { + case entitlementhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case entitlementhistory.FieldRef: + m.ResetRef() + return nil + case entitlementhistory.FieldOperation: + m.ResetOperation() + return nil + case entitlementhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitlementhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitlementhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitlementhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitlementhistory.FieldMappingID: + m.ResetMappingID() + return nil + case entitlementhistory.FieldTags: + m.ResetTags() + return nil + case entitlementhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitlementhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitlementhistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitlementhistory.FieldPlanID: + m.ResetPlanID() + return nil + case entitlementhistory.FieldOrganizationID: + m.ResetOrganizationID() + return nil + case entitlementhistory.FieldExternalCustomerID: + m.ResetExternalCustomerID() + return nil + case entitlementhistory.FieldExternalSubscriptionID: + m.ResetExternalSubscriptionID() + return nil + case entitlementhistory.FieldExpires: + m.ResetExpires() + return nil + case entitlementhistory.FieldExpiresAt: + m.ResetExpiresAt() + return nil + case entitlementhistory.FieldCancelled: + m.ResetCancelled() + return nil + } + return fmt.Errorf("unknown EntitlementHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntitlementHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntitlementHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntitlementHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntitlementHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntitlementHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntitlementHistoryMutation) EdgeCleared(name string) bool { + 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 *EntitlementHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown EntitlementHistory 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 *EntitlementHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown EntitlementHistory edge %s", name) +} + +// EntitlementPlanMutation represents an operation that mutates the EntitlementPlan nodes in the graph. +type EntitlementPlanMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + display_name *string + name *string + description *string + version *string + metadata *map[string]interface{} + clearedFields map[string]struct{} + owner *string + clearedowner bool + entitlements map[string]struct{} + removedentitlements map[string]struct{} + clearedentitlements bool + base_features map[string]struct{} + removedbase_features map[string]struct{} + clearedbase_features bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + features map[string]struct{} + removedfeatures map[string]struct{} + clearedfeatures bool + done bool + oldValue func(context.Context) (*EntitlementPlan, error) + predicates []predicate.EntitlementPlan +} + +var _ ent.Mutation = (*EntitlementPlanMutation)(nil) + +// entitlementplanOption allows management of the mutation configuration using functional options. +type entitlementplanOption func(*EntitlementPlanMutation) + +// newEntitlementPlanMutation creates new mutation for the EntitlementPlan entity. +func newEntitlementPlanMutation(c config, op Op, opts ...entitlementplanOption) *EntitlementPlanMutation { + m := &EntitlementPlanMutation{ + config: c, + op: op, + typ: TypeEntitlementPlan, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntitlementPlanID sets the ID field of the mutation. +func withEntitlementPlanID(id string) entitlementplanOption { + return func(m *EntitlementPlanMutation) { + var ( + err error + once sync.Once + value *EntitlementPlan + ) + m.oldValue = func(ctx context.Context) (*EntitlementPlan, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntitlementPlan.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntitlementPlan sets the old EntitlementPlan of the mutation. +func withEntitlementPlan(node *EntitlementPlan) entitlementplanOption { + return func(m *EntitlementPlanMutation) { + m.oldValue = func(context.Context) (*EntitlementPlan, 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 EntitlementPlanMutation) 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 EntitlementPlanMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntitlementPlan entities. +func (m *EntitlementPlanMutation) SetID(id string) { + 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 *EntitlementPlanMutation) ID() (id string, 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 *EntitlementPlanMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntitlementPlan.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntitlementPlanMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntitlementPlanMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntitlementPlanMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitlementplan.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntitlementPlanMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntitlementPlanMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitlementplan.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntitlementPlanMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntitlementPlanMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntitlementPlanMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitlementplan.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntitlementPlanMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntitlementPlanMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitlementplan.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntitlementPlanMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntitlementPlanMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntitlementPlanMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitlementplan.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntitlementPlanMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntitlementPlanMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitlementplan.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntitlementPlanMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntitlementPlanMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntitlementPlanMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitlementplan.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntitlementPlanMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntitlementPlanMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitlementplan.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntitlementPlanMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntitlementPlanMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntitlementPlanMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntitlementPlanMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntitlementPlanMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntitlementPlanMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitlementplan.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntitlementPlanMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntitlementPlanMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitlementplan.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntitlementPlanMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntitlementPlanMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntitlementPlanMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitlementplan.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntitlementPlanMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntitlementPlanMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitlementplan.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntitlementPlanMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntitlementPlanMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntitlementPlanMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntitlementPlanMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntitlementPlanMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitlementplan.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntitlementPlanMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntitlementPlanMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitlementplan.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntitlementPlanMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntitlementPlanMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntitlementPlanMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[entitlementplan.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntitlementPlanMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntitlementPlanMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, entitlementplan.FieldOwnerID) +} + +// SetDisplayName sets the "display_name" field. +func (m *EntitlementPlanMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *EntitlementPlanMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ClearDisplayName clears the value of the "display_name" field. +func (m *EntitlementPlanMutation) ClearDisplayName() { + m.display_name = nil + m.clearedFields[entitlementplan.FieldDisplayName] = struct{}{} +} + +// DisplayNameCleared returns if the "display_name" field was cleared in this mutation. +func (m *EntitlementPlanMutation) DisplayNameCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldDisplayName] + return ok +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *EntitlementPlanMutation) ResetDisplayName() { + m.display_name = nil + delete(m.clearedFields, entitlementplan.FieldDisplayName) +} + +// SetName sets the "name" field. +func (m *EntitlementPlanMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *EntitlementPlanMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *EntitlementPlanMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *EntitlementPlanMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *EntitlementPlanMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *EntitlementPlanMutation) ClearDescription() { + m.description = nil + m.clearedFields[entitlementplan.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *EntitlementPlanMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *EntitlementPlanMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, entitlementplan.FieldDescription) +} + +// SetVersion sets the "version" field. +func (m *EntitlementPlanMutation) SetVersion(s string) { + m.version = &s +} + +// Version returns the value of the "version" field in the mutation. +func (m *EntitlementPlanMutation) Version() (r string, exists bool) { + v := m.version + if v == nil { + return + } + return *v, true +} + +// OldVersion returns the old "version" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldVersion(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldVersion is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldVersion requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVersion: %w", err) + } + return oldValue.Version, nil +} + +// ResetVersion resets all changes to the "version" field. +func (m *EntitlementPlanMutation) ResetVersion() { + m.version = nil +} + +// SetMetadata sets the "metadata" field. +func (m *EntitlementPlanMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *EntitlementPlanMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the EntitlementPlan entity. +// If the EntitlementPlan 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 *EntitlementPlanMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *EntitlementPlanMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[entitlementplan.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *EntitlementPlanMutation) MetadataCleared() bool { + _, ok := m.clearedFields[entitlementplan.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *EntitlementPlanMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, entitlementplan.FieldMetadata) +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *EntitlementPlanMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[entitlementplan.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *EntitlementPlanMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *EntitlementPlanMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *EntitlementPlanMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by ids. +func (m *EntitlementPlanMutation) AddEntitlementIDs(ids ...string) { + if m.entitlements == nil { + m.entitlements = make(map[string]struct{}) + } + for i := range ids { + m.entitlements[ids[i]] = struct{}{} + } +} + +// ClearEntitlements clears the "entitlements" edge to the Entitlement entity. +func (m *EntitlementPlanMutation) ClearEntitlements() { + m.clearedentitlements = true +} + +// EntitlementsCleared reports if the "entitlements" edge to the Entitlement entity was cleared. +func (m *EntitlementPlanMutation) EntitlementsCleared() bool { + return m.clearedentitlements +} + +// RemoveEntitlementIDs removes the "entitlements" edge to the Entitlement entity by IDs. +func (m *EntitlementPlanMutation) RemoveEntitlementIDs(ids ...string) { + if m.removedentitlements == nil { + m.removedentitlements = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitlements, ids[i]) + m.removedentitlements[ids[i]] = struct{}{} + } +} + +// RemovedEntitlements returns the removed IDs of the "entitlements" edge to the Entitlement entity. +func (m *EntitlementPlanMutation) RemovedEntitlementsIDs() (ids []string) { + for id := range m.removedentitlements { + ids = append(ids, id) + } + return +} + +// EntitlementsIDs returns the "entitlements" edge IDs in the mutation. +func (m *EntitlementPlanMutation) EntitlementsIDs() (ids []string) { + for id := range m.entitlements { + ids = append(ids, id) + } + return +} + +// ResetEntitlements resets all changes to the "entitlements" edge. +func (m *EntitlementPlanMutation) ResetEntitlements() { + m.entitlements = nil + m.clearedentitlements = false + m.removedentitlements = nil +} + +// AddBaseFeatureIDs adds the "base_features" edge to the Feature entity by ids. +func (m *EntitlementPlanMutation) AddBaseFeatureIDs(ids ...string) { + if m.base_features == nil { + m.base_features = make(map[string]struct{}) + } + for i := range ids { + m.base_features[ids[i]] = struct{}{} + } +} + +// ClearBaseFeatures clears the "base_features" edge to the Feature entity. +func (m *EntitlementPlanMutation) ClearBaseFeatures() { + m.clearedbase_features = true +} + +// BaseFeaturesCleared reports if the "base_features" edge to the Feature entity was cleared. +func (m *EntitlementPlanMutation) BaseFeaturesCleared() bool { + return m.clearedbase_features +} + +// RemoveBaseFeatureIDs removes the "base_features" edge to the Feature entity by IDs. +func (m *EntitlementPlanMutation) RemoveBaseFeatureIDs(ids ...string) { + if m.removedbase_features == nil { + m.removedbase_features = make(map[string]struct{}) + } + for i := range ids { + delete(m.base_features, ids[i]) + m.removedbase_features[ids[i]] = struct{}{} + } +} + +// RemovedBaseFeatures returns the removed IDs of the "base_features" edge to the Feature entity. +func (m *EntitlementPlanMutation) RemovedBaseFeaturesIDs() (ids []string) { + for id := range m.removedbase_features { + ids = append(ids, id) + } + return +} + +// BaseFeaturesIDs returns the "base_features" edge IDs in the mutation. +func (m *EntitlementPlanMutation) BaseFeaturesIDs() (ids []string) { + for id := range m.base_features { + ids = append(ids, id) + } + return +} + +// ResetBaseFeatures resets all changes to the "base_features" edge. +func (m *EntitlementPlanMutation) ResetBaseFeatures() { + m.base_features = nil + m.clearedbase_features = false + m.removedbase_features = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *EntitlementPlanMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *EntitlementPlanMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *EntitlementPlanMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *EntitlementPlanMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *EntitlementPlanMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *EntitlementPlanMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *EntitlementPlanMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by ids. +func (m *EntitlementPlanMutation) AddFeatureIDs(ids ...string) { + if m.features == nil { + m.features = make(map[string]struct{}) + } + for i := range ids { + m.features[ids[i]] = struct{}{} + } +} + +// ClearFeatures clears the "features" edge to the EntitlementPlanFeature entity. +func (m *EntitlementPlanMutation) ClearFeatures() { + m.clearedfeatures = true +} + +// FeaturesCleared reports if the "features" edge to the EntitlementPlanFeature entity was cleared. +func (m *EntitlementPlanMutation) FeaturesCleared() bool { + return m.clearedfeatures +} + +// RemoveFeatureIDs removes the "features" edge to the EntitlementPlanFeature entity by IDs. +func (m *EntitlementPlanMutation) RemoveFeatureIDs(ids ...string) { + if m.removedfeatures == nil { + m.removedfeatures = make(map[string]struct{}) + } + for i := range ids { + delete(m.features, ids[i]) + m.removedfeatures[ids[i]] = struct{}{} + } +} + +// RemovedFeatures returns the removed IDs of the "features" edge to the EntitlementPlanFeature entity. +func (m *EntitlementPlanMutation) RemovedFeaturesIDs() (ids []string) { + for id := range m.removedfeatures { + ids = append(ids, id) + } + return +} + +// FeaturesIDs returns the "features" edge IDs in the mutation. +func (m *EntitlementPlanMutation) FeaturesIDs() (ids []string) { + for id := range m.features { + ids = append(ids, id) + } + return +} + +// ResetFeatures resets all changes to the "features" edge. +func (m *EntitlementPlanMutation) ResetFeatures() { + m.features = nil + m.clearedfeatures = false + m.removedfeatures = nil +} + +// Where appends a list predicates to the EntitlementPlanMutation builder. +func (m *EntitlementPlanMutation) Where(ps ...predicate.EntitlementPlan) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntitlementPlanMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntitlementPlanMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntitlementPlan, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntitlementPlanMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntitlementPlanMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntitlementPlan). +func (m *EntitlementPlanMutation) 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 *EntitlementPlanMutation) Fields() []string { + fields := make([]string, 0, 14) + if m.created_at != nil { + fields = append(fields, entitlementplan.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitlementplan.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitlementplan.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitlementplan.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitlementplan.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entitlementplan.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitlementplan.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entitlementplan.FieldTags) + } + if m.owner != nil { + fields = append(fields, entitlementplan.FieldOwnerID) + } + if m.display_name != nil { + fields = append(fields, entitlementplan.FieldDisplayName) + } + if m.name != nil { + fields = append(fields, entitlementplan.FieldName) + } + if m.description != nil { + fields = append(fields, entitlementplan.FieldDescription) + } + if m.version != nil { + fields = append(fields, entitlementplan.FieldVersion) + } + if m.metadata != nil { + fields = append(fields, entitlementplan.FieldMetadata) + } + 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 *EntitlementPlanMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitlementplan.FieldCreatedAt: + return m.CreatedAt() + case entitlementplan.FieldUpdatedAt: + return m.UpdatedAt() + case entitlementplan.FieldCreatedBy: + return m.CreatedBy() + case entitlementplan.FieldUpdatedBy: + return m.UpdatedBy() + case entitlementplan.FieldMappingID: + return m.MappingID() + case entitlementplan.FieldDeletedAt: + return m.DeletedAt() + case entitlementplan.FieldDeletedBy: + return m.DeletedBy() + case entitlementplan.FieldTags: + return m.Tags() + case entitlementplan.FieldOwnerID: + return m.OwnerID() + case entitlementplan.FieldDisplayName: + return m.DisplayName() + case entitlementplan.FieldName: + return m.Name() + case entitlementplan.FieldDescription: + return m.Description() + case entitlementplan.FieldVersion: + return m.Version() + case entitlementplan.FieldMetadata: + return m.Metadata() + } + 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 *EntitlementPlanMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitlementplan.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitlementplan.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitlementplan.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitlementplan.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitlementplan.FieldMappingID: + return m.OldMappingID(ctx) + case entitlementplan.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitlementplan.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitlementplan.FieldTags: + return m.OldTags(ctx) + case entitlementplan.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitlementplan.FieldDisplayName: + return m.OldDisplayName(ctx) + case entitlementplan.FieldName: + return m.OldName(ctx) + case entitlementplan.FieldDescription: + return m.OldDescription(ctx) + case entitlementplan.FieldVersion: + return m.OldVersion(ctx) + case entitlementplan.FieldMetadata: + return m.OldMetadata(ctx) + } + return nil, fmt.Errorf("unknown EntitlementPlan 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 *EntitlementPlanMutation) SetField(name string, value ent.Value) error { + switch name { + case entitlementplan.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitlementplan.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitlementplan.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitlementplan.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitlementplan.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitlementplan.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitlementplan.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitlementplan.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitlementplan.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitlementplan.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case entitlementplan.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case entitlementplan.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case entitlementplan.FieldVersion: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetVersion(v) + return nil + case entitlementplan.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + } + return fmt.Errorf("unknown EntitlementPlan field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntitlementPlanMutation) 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 *EntitlementPlanMutation) 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 *EntitlementPlanMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntitlementPlan numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntitlementPlanMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitlementplan.FieldCreatedAt) { + fields = append(fields, entitlementplan.FieldCreatedAt) + } + if m.FieldCleared(entitlementplan.FieldUpdatedAt) { + fields = append(fields, entitlementplan.FieldUpdatedAt) + } + if m.FieldCleared(entitlementplan.FieldCreatedBy) { + fields = append(fields, entitlementplan.FieldCreatedBy) + } + if m.FieldCleared(entitlementplan.FieldUpdatedBy) { + fields = append(fields, entitlementplan.FieldUpdatedBy) + } + if m.FieldCleared(entitlementplan.FieldDeletedAt) { + fields = append(fields, entitlementplan.FieldDeletedAt) + } + if m.FieldCleared(entitlementplan.FieldDeletedBy) { + fields = append(fields, entitlementplan.FieldDeletedBy) + } + if m.FieldCleared(entitlementplan.FieldTags) { + fields = append(fields, entitlementplan.FieldTags) + } + if m.FieldCleared(entitlementplan.FieldOwnerID) { + fields = append(fields, entitlementplan.FieldOwnerID) + } + if m.FieldCleared(entitlementplan.FieldDisplayName) { + fields = append(fields, entitlementplan.FieldDisplayName) + } + if m.FieldCleared(entitlementplan.FieldDescription) { + fields = append(fields, entitlementplan.FieldDescription) + } + if m.FieldCleared(entitlementplan.FieldMetadata) { + fields = append(fields, entitlementplan.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntitlementPlanMutation) 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 *EntitlementPlanMutation) ClearField(name string) error { + switch name { + case entitlementplan.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitlementplan.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitlementplan.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitlementplan.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitlementplan.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitlementplan.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitlementplan.FieldTags: + m.ClearTags() + return nil + case entitlementplan.FieldOwnerID: + m.ClearOwnerID() + return nil + case entitlementplan.FieldDisplayName: + m.ClearDisplayName() + return nil + case entitlementplan.FieldDescription: + m.ClearDescription() + return nil + case entitlementplan.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown EntitlementPlan 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 *EntitlementPlanMutation) ResetField(name string) error { + switch name { + case entitlementplan.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitlementplan.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitlementplan.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitlementplan.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitlementplan.FieldMappingID: + m.ResetMappingID() + return nil + case entitlementplan.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitlementplan.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitlementplan.FieldTags: + m.ResetTags() + return nil + case entitlementplan.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitlementplan.FieldDisplayName: + m.ResetDisplayName() + return nil + case entitlementplan.FieldName: + m.ResetName() + return nil + case entitlementplan.FieldDescription: + m.ResetDescription() + return nil + case entitlementplan.FieldVersion: + m.ResetVersion() + return nil + case entitlementplan.FieldMetadata: + m.ResetMetadata() + return nil + } + return fmt.Errorf("unknown EntitlementPlan field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntitlementPlanMutation) AddedEdges() []string { + edges := make([]string, 0, 5) + if m.owner != nil { + edges = append(edges, entitlementplan.EdgeOwner) + } + if m.entitlements != nil { + edges = append(edges, entitlementplan.EdgeEntitlements) + } + if m.base_features != nil { + edges = append(edges, entitlementplan.EdgeBaseFeatures) + } + if m.events != nil { + edges = append(edges, entitlementplan.EdgeEvents) + } + if m.features != nil { + edges = append(edges, entitlementplan.EdgeFeatures) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntitlementPlanMutation) AddedIDs(name string) []ent.Value { + switch name { + case entitlementplan.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case entitlementplan.EdgeEntitlements: + ids := make([]ent.Value, 0, len(m.entitlements)) + for id := range m.entitlements { + ids = append(ids, id) + } + return ids + case entitlementplan.EdgeBaseFeatures: + ids := make([]ent.Value, 0, len(m.base_features)) + for id := range m.base_features { + ids = append(ids, id) + } + return ids + case entitlementplan.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + case entitlementplan.EdgeFeatures: + ids := make([]ent.Value, 0, len(m.features)) + for id := range m.features { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntitlementPlanMutation) RemovedEdges() []string { + edges := make([]string, 0, 5) + if m.removedentitlements != nil { + edges = append(edges, entitlementplan.EdgeEntitlements) + } + if m.removedbase_features != nil { + edges = append(edges, entitlementplan.EdgeBaseFeatures) + } + if m.removedevents != nil { + edges = append(edges, entitlementplan.EdgeEvents) + } + if m.removedfeatures != nil { + edges = append(edges, entitlementplan.EdgeFeatures) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntitlementPlanMutation) RemovedIDs(name string) []ent.Value { + switch name { + case entitlementplan.EdgeEntitlements: + ids := make([]ent.Value, 0, len(m.removedentitlements)) + for id := range m.removedentitlements { + ids = append(ids, id) + } + return ids + case entitlementplan.EdgeBaseFeatures: + ids := make([]ent.Value, 0, len(m.removedbase_features)) + for id := range m.removedbase_features { + ids = append(ids, id) + } + return ids + case entitlementplan.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + case entitlementplan.EdgeFeatures: + ids := make([]ent.Value, 0, len(m.removedfeatures)) + for id := range m.removedfeatures { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntitlementPlanMutation) ClearedEdges() []string { + edges := make([]string, 0, 5) + if m.clearedowner { + edges = append(edges, entitlementplan.EdgeOwner) + } + if m.clearedentitlements { + edges = append(edges, entitlementplan.EdgeEntitlements) + } + if m.clearedbase_features { + edges = append(edges, entitlementplan.EdgeBaseFeatures) + } + if m.clearedevents { + edges = append(edges, entitlementplan.EdgeEvents) + } + if m.clearedfeatures { + edges = append(edges, entitlementplan.EdgeFeatures) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntitlementPlanMutation) EdgeCleared(name string) bool { + switch name { + case entitlementplan.EdgeOwner: + return m.clearedowner + case entitlementplan.EdgeEntitlements: + return m.clearedentitlements + case entitlementplan.EdgeBaseFeatures: + return m.clearedbase_features + case entitlementplan.EdgeEvents: + return m.clearedevents + case entitlementplan.EdgeFeatures: + return m.clearedfeatures + } + 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 *EntitlementPlanMutation) ClearEdge(name string) error { + switch name { + case entitlementplan.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown EntitlementPlan 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 *EntitlementPlanMutation) ResetEdge(name string) error { + switch name { + case entitlementplan.EdgeOwner: + m.ResetOwner() + return nil + case entitlementplan.EdgeEntitlements: + m.ResetEntitlements() + return nil + case entitlementplan.EdgeBaseFeatures: + m.ResetBaseFeatures() + return nil + case entitlementplan.EdgeEvents: + m.ResetEvents() + return nil + case entitlementplan.EdgeFeatures: + m.ResetFeatures() + return nil + } + return fmt.Errorf("unknown EntitlementPlan edge %s", name) +} + +// EntitlementPlanFeatureMutation represents an operation that mutates the EntitlementPlanFeature nodes in the graph. +type EntitlementPlanFeatureMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + metadata *map[string]interface{} + clearedFields map[string]struct{} + owner *string + clearedowner bool + plan *string + clearedplan bool + feature *string + clearedfeature bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*EntitlementPlanFeature, error) + predicates []predicate.EntitlementPlanFeature +} + +var _ ent.Mutation = (*EntitlementPlanFeatureMutation)(nil) + +// entitlementplanfeatureOption allows management of the mutation configuration using functional options. +type entitlementplanfeatureOption func(*EntitlementPlanFeatureMutation) + +// newEntitlementPlanFeatureMutation creates new mutation for the EntitlementPlanFeature entity. +func newEntitlementPlanFeatureMutation(c config, op Op, opts ...entitlementplanfeatureOption) *EntitlementPlanFeatureMutation { + m := &EntitlementPlanFeatureMutation{ + config: c, + op: op, + typ: TypeEntitlementPlanFeature, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntitlementPlanFeatureID sets the ID field of the mutation. +func withEntitlementPlanFeatureID(id string) entitlementplanfeatureOption { + return func(m *EntitlementPlanFeatureMutation) { + var ( + err error + once sync.Once + value *EntitlementPlanFeature + ) + m.oldValue = func(ctx context.Context) (*EntitlementPlanFeature, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntitlementPlanFeature.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntitlementPlanFeature sets the old EntitlementPlanFeature of the mutation. +func withEntitlementPlanFeature(node *EntitlementPlanFeature) entitlementplanfeatureOption { + return func(m *EntitlementPlanFeatureMutation) { + m.oldValue = func(context.Context) (*EntitlementPlanFeature, 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 EntitlementPlanFeatureMutation) 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 EntitlementPlanFeatureMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntitlementPlanFeature entities. +func (m *EntitlementPlanFeatureMutation) SetID(id string) { + 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 *EntitlementPlanFeatureMutation) ID() (id string, 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 *EntitlementPlanFeatureMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntitlementPlanFeature.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntitlementPlanFeatureMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntitlementPlanFeatureMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntitlementPlanFeatureMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitlementplanfeature.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntitlementPlanFeatureMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitlementplanfeature.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntitlementPlanFeatureMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntitlementPlanFeatureMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntitlementPlanFeatureMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitlementplanfeature.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntitlementPlanFeatureMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitlementplanfeature.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntitlementPlanFeatureMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntitlementPlanFeatureMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntitlementPlanFeatureMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitlementplanfeature.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntitlementPlanFeatureMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitlementplanfeature.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntitlementPlanFeatureMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntitlementPlanFeatureMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntitlementPlanFeatureMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitlementplanfeature.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntitlementPlanFeatureMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitlementplanfeature.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntitlementPlanFeatureMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntitlementPlanFeatureMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntitlementPlanFeatureMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntitlementPlanFeatureMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntitlementPlanFeatureMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntitlementPlanFeatureMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitlementplanfeature.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntitlementPlanFeatureMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitlementplanfeature.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntitlementPlanFeatureMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntitlementPlanFeatureMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntitlementPlanFeatureMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitlementplanfeature.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntitlementPlanFeatureMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitlementplanfeature.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntitlementPlanFeatureMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntitlementPlanFeatureMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntitlementPlanFeatureMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntitlementPlanFeatureMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntitlementPlanFeatureMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitlementplanfeature.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntitlementPlanFeatureMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitlementplanfeature.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntitlementPlanFeatureMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntitlementPlanFeatureMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntitlementPlanFeatureMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[entitlementplanfeature.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntitlementPlanFeatureMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, entitlementplanfeature.FieldOwnerID) +} + +// SetMetadata sets the "metadata" field. +func (m *EntitlementPlanFeatureMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *EntitlementPlanFeatureMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *EntitlementPlanFeatureMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[entitlementplanfeature.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) MetadataCleared() bool { + _, ok := m.clearedFields[entitlementplanfeature.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *EntitlementPlanFeatureMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, entitlementplanfeature.FieldMetadata) +} + +// SetPlanID sets the "plan_id" field. +func (m *EntitlementPlanFeatureMutation) SetPlanID(s string) { + m.plan = &s +} + +// PlanID returns the value of the "plan_id" field in the mutation. +func (m *EntitlementPlanFeatureMutation) PlanID() (r string, exists bool) { + v := m.plan + if v == nil { + return + } + return *v, true +} + +// OldPlanID returns the old "plan_id" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldPlanID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPlanID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPlanID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPlanID: %w", err) + } + return oldValue.PlanID, nil +} + +// ResetPlanID resets all changes to the "plan_id" field. +func (m *EntitlementPlanFeatureMutation) ResetPlanID() { + m.plan = nil +} + +// SetFeatureID sets the "feature_id" field. +func (m *EntitlementPlanFeatureMutation) SetFeatureID(s string) { + m.feature = &s +} + +// FeatureID returns the value of the "feature_id" field in the mutation. +func (m *EntitlementPlanFeatureMutation) FeatureID() (r string, exists bool) { + v := m.feature + if v == nil { + return + } + return *v, true +} + +// OldFeatureID returns the old "feature_id" field's value of the EntitlementPlanFeature entity. +// If the EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) OldFeatureID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFeatureID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFeatureID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFeatureID: %w", err) + } + return oldValue.FeatureID, nil +} + +// ResetFeatureID resets all changes to the "feature_id" field. +func (m *EntitlementPlanFeatureMutation) ResetFeatureID() { + m.feature = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *EntitlementPlanFeatureMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[entitlementplanfeature.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *EntitlementPlanFeatureMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *EntitlementPlanFeatureMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *EntitlementPlanFeatureMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// ClearPlan clears the "plan" edge to the EntitlementPlan entity. +func (m *EntitlementPlanFeatureMutation) ClearPlan() { + m.clearedplan = true + m.clearedFields[entitlementplanfeature.FieldPlanID] = struct{}{} +} + +// PlanCleared reports if the "plan" edge to the EntitlementPlan entity was cleared. +func (m *EntitlementPlanFeatureMutation) PlanCleared() bool { + return m.clearedplan +} + +// PlanIDs returns the "plan" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// PlanID instead. It exists only for internal usage by the builders. +func (m *EntitlementPlanFeatureMutation) PlanIDs() (ids []string) { + if id := m.plan; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetPlan resets all changes to the "plan" edge. +func (m *EntitlementPlanFeatureMutation) ResetPlan() { + m.plan = nil + m.clearedplan = false +} + +// ClearFeature clears the "feature" edge to the Feature entity. +func (m *EntitlementPlanFeatureMutation) ClearFeature() { + m.clearedfeature = true + m.clearedFields[entitlementplanfeature.FieldFeatureID] = struct{}{} +} + +// FeatureCleared reports if the "feature" edge to the Feature entity was cleared. +func (m *EntitlementPlanFeatureMutation) FeatureCleared() bool { + return m.clearedfeature +} + +// FeatureIDs returns the "feature" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// FeatureID instead. It exists only for internal usage by the builders. +func (m *EntitlementPlanFeatureMutation) FeatureIDs() (ids []string) { + if id := m.feature; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetFeature resets all changes to the "feature" edge. +func (m *EntitlementPlanFeatureMutation) ResetFeature() { + m.feature = nil + m.clearedfeature = false +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *EntitlementPlanFeatureMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *EntitlementPlanFeatureMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *EntitlementPlanFeatureMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *EntitlementPlanFeatureMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *EntitlementPlanFeatureMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *EntitlementPlanFeatureMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *EntitlementPlanFeatureMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the EntitlementPlanFeatureMutation builder. +func (m *EntitlementPlanFeatureMutation) Where(ps ...predicate.EntitlementPlanFeature) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntitlementPlanFeatureMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntitlementPlanFeatureMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntitlementPlanFeature, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntitlementPlanFeatureMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntitlementPlanFeatureMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntitlementPlanFeature). +func (m *EntitlementPlanFeatureMutation) 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 *EntitlementPlanFeatureMutation) Fields() []string { + fields := make([]string, 0, 12) + if m.created_at != nil { + fields = append(fields, entitlementplanfeature.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitlementplanfeature.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitlementplanfeature.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitlementplanfeature.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitlementplanfeature.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entitlementplanfeature.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitlementplanfeature.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entitlementplanfeature.FieldTags) + } + if m.owner != nil { + fields = append(fields, entitlementplanfeature.FieldOwnerID) + } + if m.metadata != nil { + fields = append(fields, entitlementplanfeature.FieldMetadata) + } + if m.plan != nil { + fields = append(fields, entitlementplanfeature.FieldPlanID) + } + if m.feature != nil { + fields = append(fields, entitlementplanfeature.FieldFeatureID) + } + 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 *EntitlementPlanFeatureMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitlementplanfeature.FieldCreatedAt: + return m.CreatedAt() + case entitlementplanfeature.FieldUpdatedAt: + return m.UpdatedAt() + case entitlementplanfeature.FieldCreatedBy: + return m.CreatedBy() + case entitlementplanfeature.FieldUpdatedBy: + return m.UpdatedBy() + case entitlementplanfeature.FieldMappingID: + return m.MappingID() + case entitlementplanfeature.FieldDeletedAt: + return m.DeletedAt() + case entitlementplanfeature.FieldDeletedBy: + return m.DeletedBy() + case entitlementplanfeature.FieldTags: + return m.Tags() + case entitlementplanfeature.FieldOwnerID: + return m.OwnerID() + case entitlementplanfeature.FieldMetadata: + return m.Metadata() + case entitlementplanfeature.FieldPlanID: + return m.PlanID() + case entitlementplanfeature.FieldFeatureID: + return m.FeatureID() + } + 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 *EntitlementPlanFeatureMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitlementplanfeature.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitlementplanfeature.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitlementplanfeature.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitlementplanfeature.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitlementplanfeature.FieldMappingID: + return m.OldMappingID(ctx) + case entitlementplanfeature.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitlementplanfeature.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitlementplanfeature.FieldTags: + return m.OldTags(ctx) + case entitlementplanfeature.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitlementplanfeature.FieldMetadata: + return m.OldMetadata(ctx) + case entitlementplanfeature.FieldPlanID: + return m.OldPlanID(ctx) + case entitlementplanfeature.FieldFeatureID: + return m.OldFeatureID(ctx) + } + return nil, fmt.Errorf("unknown EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) SetField(name string, value ent.Value) error { + switch name { + case entitlementplanfeature.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitlementplanfeature.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitlementplanfeature.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitlementplanfeature.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitlementplanfeature.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitlementplanfeature.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitlementplanfeature.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitlementplanfeature.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitlementplanfeature.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitlementplanfeature.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + case entitlementplanfeature.FieldPlanID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPlanID(v) + return nil + case entitlementplanfeature.FieldFeatureID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFeatureID(v) + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeature field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntitlementPlanFeatureMutation) 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 *EntitlementPlanFeatureMutation) 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 *EntitlementPlanFeatureMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntitlementPlanFeature numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntitlementPlanFeatureMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitlementplanfeature.FieldCreatedAt) { + fields = append(fields, entitlementplanfeature.FieldCreatedAt) + } + if m.FieldCleared(entitlementplanfeature.FieldUpdatedAt) { + fields = append(fields, entitlementplanfeature.FieldUpdatedAt) + } + if m.FieldCleared(entitlementplanfeature.FieldCreatedBy) { + fields = append(fields, entitlementplanfeature.FieldCreatedBy) + } + if m.FieldCleared(entitlementplanfeature.FieldUpdatedBy) { + fields = append(fields, entitlementplanfeature.FieldUpdatedBy) + } + if m.FieldCleared(entitlementplanfeature.FieldDeletedAt) { + fields = append(fields, entitlementplanfeature.FieldDeletedAt) + } + if m.FieldCleared(entitlementplanfeature.FieldDeletedBy) { + fields = append(fields, entitlementplanfeature.FieldDeletedBy) + } + if m.FieldCleared(entitlementplanfeature.FieldTags) { + fields = append(fields, entitlementplanfeature.FieldTags) + } + if m.FieldCleared(entitlementplanfeature.FieldOwnerID) { + fields = append(fields, entitlementplanfeature.FieldOwnerID) + } + if m.FieldCleared(entitlementplanfeature.FieldMetadata) { + fields = append(fields, entitlementplanfeature.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) 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 *EntitlementPlanFeatureMutation) ClearField(name string) error { + switch name { + case entitlementplanfeature.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitlementplanfeature.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitlementplanfeature.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitlementplanfeature.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitlementplanfeature.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitlementplanfeature.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitlementplanfeature.FieldTags: + m.ClearTags() + return nil + case entitlementplanfeature.FieldOwnerID: + m.ClearOwnerID() + return nil + case entitlementplanfeature.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) ResetField(name string) error { + switch name { + case entitlementplanfeature.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitlementplanfeature.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitlementplanfeature.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitlementplanfeature.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitlementplanfeature.FieldMappingID: + m.ResetMappingID() + return nil + case entitlementplanfeature.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitlementplanfeature.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitlementplanfeature.FieldTags: + m.ResetTags() + return nil + case entitlementplanfeature.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitlementplanfeature.FieldMetadata: + m.ResetMetadata() + return nil + case entitlementplanfeature.FieldPlanID: + m.ResetPlanID() + return nil + case entitlementplanfeature.FieldFeatureID: + m.ResetFeatureID() + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeature field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntitlementPlanFeatureMutation) AddedEdges() []string { + edges := make([]string, 0, 4) + if m.owner != nil { + edges = append(edges, entitlementplanfeature.EdgeOwner) + } + if m.plan != nil { + edges = append(edges, entitlementplanfeature.EdgePlan) + } + if m.feature != nil { + edges = append(edges, entitlementplanfeature.EdgeFeature) + } + if m.events != nil { + edges = append(edges, entitlementplanfeature.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntitlementPlanFeatureMutation) AddedIDs(name string) []ent.Value { + switch name { + case entitlementplanfeature.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case entitlementplanfeature.EdgePlan: + if id := m.plan; id != nil { + return []ent.Value{*id} + } + case entitlementplanfeature.EdgeFeature: + if id := m.feature; id != nil { + return []ent.Value{*id} + } + case entitlementplanfeature.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntitlementPlanFeatureMutation) RemovedEdges() []string { + edges := make([]string, 0, 4) + if m.removedevents != nil { + edges = append(edges, entitlementplanfeature.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntitlementPlanFeatureMutation) RemovedIDs(name string) []ent.Value { + switch name { + case entitlementplanfeature.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) ClearedEdges() []string { + edges := make([]string, 0, 4) + if m.clearedowner { + edges = append(edges, entitlementplanfeature.EdgeOwner) + } + if m.clearedplan { + edges = append(edges, entitlementplanfeature.EdgePlan) + } + if m.clearedfeature { + edges = append(edges, entitlementplanfeature.EdgeFeature) + } + if m.clearedevents { + edges = append(edges, entitlementplanfeature.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntitlementPlanFeatureMutation) EdgeCleared(name string) bool { + switch name { + case entitlementplanfeature.EdgeOwner: + return m.clearedowner + case entitlementplanfeature.EdgePlan: + return m.clearedplan + case entitlementplanfeature.EdgeFeature: + return m.clearedfeature + case entitlementplanfeature.EdgeEvents: + return m.clearedevents + } + 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 *EntitlementPlanFeatureMutation) ClearEdge(name string) error { + switch name { + case entitlementplanfeature.EdgeOwner: + m.ClearOwner() + return nil + case entitlementplanfeature.EdgePlan: + m.ClearPlan() + return nil + case entitlementplanfeature.EdgeFeature: + m.ClearFeature() + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeature 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 *EntitlementPlanFeatureMutation) ResetEdge(name string) error { + switch name { + case entitlementplanfeature.EdgeOwner: + m.ResetOwner() + return nil + case entitlementplanfeature.EdgePlan: + m.ResetPlan() + return nil + case entitlementplanfeature.EdgeFeature: + m.ResetFeature() + return nil + case entitlementplanfeature.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeature edge %s", name) +} + +// EntitlementPlanFeatureHistoryMutation represents an operation that mutates the EntitlementPlanFeatureHistory nodes in the graph. +type EntitlementPlanFeatureHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + owner_id *string + metadata *map[string]interface{} + plan_id *string + feature_id *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*EntitlementPlanFeatureHistory, error) + predicates []predicate.EntitlementPlanFeatureHistory +} + +var _ ent.Mutation = (*EntitlementPlanFeatureHistoryMutation)(nil) + +// entitlementplanfeaturehistoryOption allows management of the mutation configuration using functional options. +type entitlementplanfeaturehistoryOption func(*EntitlementPlanFeatureHistoryMutation) + +// newEntitlementPlanFeatureHistoryMutation creates new mutation for the EntitlementPlanFeatureHistory entity. +func newEntitlementPlanFeatureHistoryMutation(c config, op Op, opts ...entitlementplanfeaturehistoryOption) *EntitlementPlanFeatureHistoryMutation { + m := &EntitlementPlanFeatureHistoryMutation{ + config: c, + op: op, + typ: TypeEntitlementPlanFeatureHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntitlementPlanFeatureHistoryID sets the ID field of the mutation. +func withEntitlementPlanFeatureHistoryID(id string) entitlementplanfeaturehistoryOption { + return func(m *EntitlementPlanFeatureHistoryMutation) { + var ( + err error + once sync.Once + value *EntitlementPlanFeatureHistory + ) + m.oldValue = func(ctx context.Context) (*EntitlementPlanFeatureHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntitlementPlanFeatureHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntitlementPlanFeatureHistory sets the old EntitlementPlanFeatureHistory of the mutation. +func withEntitlementPlanFeatureHistory(node *EntitlementPlanFeatureHistory) entitlementplanfeaturehistoryOption { + return func(m *EntitlementPlanFeatureHistoryMutation) { + m.oldValue = func(context.Context) (*EntitlementPlanFeatureHistory, 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 EntitlementPlanFeatureHistoryMutation) 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 EntitlementPlanFeatureHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntitlementPlanFeatureHistory entities. +func (m *EntitlementPlanFeatureHistoryMutation) SetID(id string) { + 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 *EntitlementPlanFeatureHistoryMutation) ID() (id string, 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 *EntitlementPlanFeatureHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntitlementPlanFeatureHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[entitlementplanfeaturehistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitlementplanfeaturehistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitlementplanfeaturehistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitlementplanfeaturehistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitlementplanfeaturehistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitlementplanfeaturehistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitlementplanfeaturehistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntitlementPlanFeatureHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitlementplanfeaturehistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[entitlementplanfeaturehistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldOwnerID) +} + +// SetMetadata sets the "metadata" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *EntitlementPlanFeatureHistoryMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[entitlementplanfeaturehistory.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) MetadataCleared() bool { + _, ok := m.clearedFields[entitlementplanfeaturehistory.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, entitlementplanfeaturehistory.FieldMetadata) +} + +// SetPlanID sets the "plan_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetPlanID(s string) { + m.plan_id = &s +} + +// PlanID returns the value of the "plan_id" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) PlanID() (r string, exists bool) { + v := m.plan_id + if v == nil { + return + } + return *v, true +} + +// OldPlanID returns the old "plan_id" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldPlanID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPlanID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPlanID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPlanID: %w", err) + } + return oldValue.PlanID, nil +} + +// ResetPlanID resets all changes to the "plan_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetPlanID() { + m.plan_id = nil +} + +// SetFeatureID sets the "feature_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) SetFeatureID(s string) { + m.feature_id = &s +} + +// FeatureID returns the value of the "feature_id" field in the mutation. +func (m *EntitlementPlanFeatureHistoryMutation) FeatureID() (r string, exists bool) { + v := m.feature_id + if v == nil { + return + } + return *v, true +} + +// OldFeatureID returns the old "feature_id" field's value of the EntitlementPlanFeatureHistory entity. +// If the EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) OldFeatureID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFeatureID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFeatureID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFeatureID: %w", err) + } + return oldValue.FeatureID, nil +} + +// ResetFeatureID resets all changes to the "feature_id" field. +func (m *EntitlementPlanFeatureHistoryMutation) ResetFeatureID() { + m.feature_id = nil +} + +// Where appends a list predicates to the EntitlementPlanFeatureHistoryMutation builder. +func (m *EntitlementPlanFeatureHistoryMutation) Where(ps ...predicate.EntitlementPlanFeatureHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntitlementPlanFeatureHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntitlementPlanFeatureHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntitlementPlanFeatureHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntitlementPlanFeatureHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntitlementPlanFeatureHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntitlementPlanFeatureHistory). +func (m *EntitlementPlanFeatureHistoryMutation) 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 *EntitlementPlanFeatureHistoryMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.history_time != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldOwnerID) + } + if m.metadata != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldMetadata) + } + if m.plan_id != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldPlanID) + } + if m.feature_id != nil { + fields = append(fields, entitlementplanfeaturehistory.FieldFeatureID) + } + 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 *EntitlementPlanFeatureHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitlementplanfeaturehistory.FieldHistoryTime: + return m.HistoryTime() + case entitlementplanfeaturehistory.FieldRef: + return m.Ref() + case entitlementplanfeaturehistory.FieldOperation: + return m.Operation() + case entitlementplanfeaturehistory.FieldCreatedAt: + return m.CreatedAt() + case entitlementplanfeaturehistory.FieldUpdatedAt: + return m.UpdatedAt() + case entitlementplanfeaturehistory.FieldCreatedBy: + return m.CreatedBy() + case entitlementplanfeaturehistory.FieldUpdatedBy: + return m.UpdatedBy() + case entitlementplanfeaturehistory.FieldMappingID: + return m.MappingID() + case entitlementplanfeaturehistory.FieldDeletedAt: + return m.DeletedAt() + case entitlementplanfeaturehistory.FieldDeletedBy: + return m.DeletedBy() + case entitlementplanfeaturehistory.FieldTags: + return m.Tags() + case entitlementplanfeaturehistory.FieldOwnerID: + return m.OwnerID() + case entitlementplanfeaturehistory.FieldMetadata: + return m.Metadata() + case entitlementplanfeaturehistory.FieldPlanID: + return m.PlanID() + case entitlementplanfeaturehistory.FieldFeatureID: + return m.FeatureID() + } + 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 *EntitlementPlanFeatureHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitlementplanfeaturehistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case entitlementplanfeaturehistory.FieldRef: + return m.OldRef(ctx) + case entitlementplanfeaturehistory.FieldOperation: + return m.OldOperation(ctx) + case entitlementplanfeaturehistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitlementplanfeaturehistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitlementplanfeaturehistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitlementplanfeaturehistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitlementplanfeaturehistory.FieldMappingID: + return m.OldMappingID(ctx) + case entitlementplanfeaturehistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitlementplanfeaturehistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitlementplanfeaturehistory.FieldTags: + return m.OldTags(ctx) + case entitlementplanfeaturehistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitlementplanfeaturehistory.FieldMetadata: + return m.OldMetadata(ctx) + case entitlementplanfeaturehistory.FieldPlanID: + return m.OldPlanID(ctx) + case entitlementplanfeaturehistory.FieldFeatureID: + return m.OldFeatureID(ctx) + } + return nil, fmt.Errorf("unknown EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case entitlementplanfeaturehistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case entitlementplanfeaturehistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case entitlementplanfeaturehistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case entitlementplanfeaturehistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitlementplanfeaturehistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitlementplanfeaturehistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitlementplanfeaturehistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitlementplanfeaturehistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitlementplanfeaturehistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitlementplanfeaturehistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitlementplanfeaturehistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitlementplanfeaturehistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitlementplanfeaturehistory.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + case entitlementplanfeaturehistory.FieldPlanID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPlanID(v) + return nil + case entitlementplanfeaturehistory.FieldFeatureID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFeatureID(v) + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeatureHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) 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 *EntitlementPlanFeatureHistoryMutation) 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 *EntitlementPlanFeatureHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntitlementPlanFeatureHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntitlementPlanFeatureHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitlementplanfeaturehistory.FieldRef) { + fields = append(fields, entitlementplanfeaturehistory.FieldRef) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldCreatedAt) { + fields = append(fields, entitlementplanfeaturehistory.FieldCreatedAt) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldUpdatedAt) { + fields = append(fields, entitlementplanfeaturehistory.FieldUpdatedAt) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldCreatedBy) { + fields = append(fields, entitlementplanfeaturehistory.FieldCreatedBy) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldUpdatedBy) { + fields = append(fields, entitlementplanfeaturehistory.FieldUpdatedBy) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldDeletedAt) { + fields = append(fields, entitlementplanfeaturehistory.FieldDeletedAt) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldDeletedBy) { + fields = append(fields, entitlementplanfeaturehistory.FieldDeletedBy) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldTags) { + fields = append(fields, entitlementplanfeaturehistory.FieldTags) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldOwnerID) { + fields = append(fields, entitlementplanfeaturehistory.FieldOwnerID) + } + if m.FieldCleared(entitlementplanfeaturehistory.FieldMetadata) { + fields = append(fields, entitlementplanfeaturehistory.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) 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 *EntitlementPlanFeatureHistoryMutation) ClearField(name string) error { + switch name { + case entitlementplanfeaturehistory.FieldRef: + m.ClearRef() + return nil + case entitlementplanfeaturehistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitlementplanfeaturehistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitlementplanfeaturehistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitlementplanfeaturehistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitlementplanfeaturehistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitlementplanfeaturehistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitlementplanfeaturehistory.FieldTags: + m.ClearTags() + return nil + case entitlementplanfeaturehistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case entitlementplanfeaturehistory.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) ResetField(name string) error { + switch name { + case entitlementplanfeaturehistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case entitlementplanfeaturehistory.FieldRef: + m.ResetRef() + return nil + case entitlementplanfeaturehistory.FieldOperation: + m.ResetOperation() + return nil + case entitlementplanfeaturehistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitlementplanfeaturehistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitlementplanfeaturehistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitlementplanfeaturehistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitlementplanfeaturehistory.FieldMappingID: + m.ResetMappingID() + return nil + case entitlementplanfeaturehistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitlementplanfeaturehistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitlementplanfeaturehistory.FieldTags: + m.ResetTags() + return nil + case entitlementplanfeaturehistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitlementplanfeaturehistory.FieldMetadata: + m.ResetMetadata() + return nil + case entitlementplanfeaturehistory.FieldPlanID: + m.ResetPlanID() + return nil + case entitlementplanfeaturehistory.FieldFeatureID: + m.ResetFeatureID() + return nil + } + return fmt.Errorf("unknown EntitlementPlanFeatureHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntitlementPlanFeatureHistoryMutation) EdgeCleared(name string) bool { + 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 *EntitlementPlanFeatureHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown EntitlementPlanFeatureHistory 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 *EntitlementPlanFeatureHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown EntitlementPlanFeatureHistory edge %s", name) +} + +// EntitlementPlanHistoryMutation represents an operation that mutates the EntitlementPlanHistory nodes in the graph. +type EntitlementPlanHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + owner_id *string + display_name *string + name *string + description *string + version *string + metadata *map[string]interface{} + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*EntitlementPlanHistory, error) + predicates []predicate.EntitlementPlanHistory +} + +var _ ent.Mutation = (*EntitlementPlanHistoryMutation)(nil) + +// entitlementplanhistoryOption allows management of the mutation configuration using functional options. +type entitlementplanhistoryOption func(*EntitlementPlanHistoryMutation) + +// newEntitlementPlanHistoryMutation creates new mutation for the EntitlementPlanHistory entity. +func newEntitlementPlanHistoryMutation(c config, op Op, opts ...entitlementplanhistoryOption) *EntitlementPlanHistoryMutation { + m := &EntitlementPlanHistoryMutation{ + config: c, + op: op, + typ: TypeEntitlementPlanHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntitlementPlanHistoryID sets the ID field of the mutation. +func withEntitlementPlanHistoryID(id string) entitlementplanhistoryOption { + return func(m *EntitlementPlanHistoryMutation) { + var ( + err error + once sync.Once + value *EntitlementPlanHistory + ) + m.oldValue = func(ctx context.Context) (*EntitlementPlanHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntitlementPlanHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntitlementPlanHistory sets the old EntitlementPlanHistory of the mutation. +func withEntitlementPlanHistory(node *EntitlementPlanHistory) entitlementplanhistoryOption { + return func(m *EntitlementPlanHistoryMutation) { + m.oldValue = func(context.Context) (*EntitlementPlanHistory, 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 EntitlementPlanHistoryMutation) 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 EntitlementPlanHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntitlementPlanHistory entities. +func (m *EntitlementPlanHistoryMutation) SetID(id string) { + 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 *EntitlementPlanHistoryMutation) ID() (id string, 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 *EntitlementPlanHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntitlementPlanHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *EntitlementPlanHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *EntitlementPlanHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *EntitlementPlanHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *EntitlementPlanHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *EntitlementPlanHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *EntitlementPlanHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[entitlementplanhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *EntitlementPlanHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, entitlementplanhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *EntitlementPlanHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *EntitlementPlanHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *EntitlementPlanHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntitlementPlanHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntitlementPlanHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntitlementPlanHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitlementplanhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntitlementPlanHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitlementplanhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntitlementPlanHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntitlementPlanHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntitlementPlanHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitlementplanhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntitlementPlanHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitlementplanhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntitlementPlanHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntitlementPlanHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntitlementPlanHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitlementplanhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntitlementPlanHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitlementplanhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntitlementPlanHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntitlementPlanHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntitlementPlanHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitlementplanhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntitlementPlanHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitlementplanhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntitlementPlanHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntitlementPlanHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntitlementPlanHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntitlementPlanHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntitlementPlanHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntitlementPlanHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitlementplanhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntitlementPlanHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitlementplanhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntitlementPlanHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntitlementPlanHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntitlementPlanHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitlementplanhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntitlementPlanHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitlementplanhistory.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntitlementPlanHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntitlementPlanHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntitlementPlanHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntitlementPlanHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntitlementPlanHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitlementplanhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntitlementPlanHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitlementplanhistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntitlementPlanHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntitlementPlanHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntitlementPlanHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[entitlementplanhistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntitlementPlanHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, entitlementplanhistory.FieldOwnerID) +} + +// SetDisplayName sets the "display_name" field. +func (m *EntitlementPlanHistoryMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *EntitlementPlanHistoryMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ClearDisplayName clears the value of the "display_name" field. +func (m *EntitlementPlanHistoryMutation) ClearDisplayName() { + m.display_name = nil + m.clearedFields[entitlementplanhistory.FieldDisplayName] = struct{}{} +} + +// DisplayNameCleared returns if the "display_name" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) DisplayNameCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldDisplayName] + return ok +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *EntitlementPlanHistoryMutation) ResetDisplayName() { + m.display_name = nil + delete(m.clearedFields, entitlementplanhistory.FieldDisplayName) +} + +// SetName sets the "name" field. +func (m *EntitlementPlanHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *EntitlementPlanHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *EntitlementPlanHistoryMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *EntitlementPlanHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *EntitlementPlanHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *EntitlementPlanHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[entitlementplanhistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *EntitlementPlanHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, entitlementplanhistory.FieldDescription) +} + +// SetVersion sets the "version" field. +func (m *EntitlementPlanHistoryMutation) SetVersion(s string) { + m.version = &s +} + +// Version returns the value of the "version" field in the mutation. +func (m *EntitlementPlanHistoryMutation) Version() (r string, exists bool) { + v := m.version + if v == nil { + return + } + return *v, true +} + +// OldVersion returns the old "version" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldVersion(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldVersion is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldVersion requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVersion: %w", err) + } + return oldValue.Version, nil +} + +// ResetVersion resets all changes to the "version" field. +func (m *EntitlementPlanHistoryMutation) ResetVersion() { + m.version = nil +} + +// SetMetadata sets the "metadata" field. +func (m *EntitlementPlanHistoryMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *EntitlementPlanHistoryMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the EntitlementPlanHistory entity. +// If the EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *EntitlementPlanHistoryMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[entitlementplanhistory.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) MetadataCleared() bool { + _, ok := m.clearedFields[entitlementplanhistory.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *EntitlementPlanHistoryMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, entitlementplanhistory.FieldMetadata) +} + +// Where appends a list predicates to the EntitlementPlanHistoryMutation builder. +func (m *EntitlementPlanHistoryMutation) Where(ps ...predicate.EntitlementPlanHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntitlementPlanHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntitlementPlanHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntitlementPlanHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntitlementPlanHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntitlementPlanHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntitlementPlanHistory). +func (m *EntitlementPlanHistoryMutation) 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 *EntitlementPlanHistoryMutation) Fields() []string { + fields := make([]string, 0, 17) + if m.history_time != nil { + fields = append(fields, entitlementplanhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, entitlementplanhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, entitlementplanhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, entitlementplanhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitlementplanhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitlementplanhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitlementplanhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitlementplanhistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entitlementplanhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitlementplanhistory.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entitlementplanhistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, entitlementplanhistory.FieldOwnerID) + } + if m.display_name != nil { + fields = append(fields, entitlementplanhistory.FieldDisplayName) + } + if m.name != nil { + fields = append(fields, entitlementplanhistory.FieldName) + } + if m.description != nil { + fields = append(fields, entitlementplanhistory.FieldDescription) + } + if m.version != nil { + fields = append(fields, entitlementplanhistory.FieldVersion) + } + if m.metadata != nil { + fields = append(fields, entitlementplanhistory.FieldMetadata) + } + 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 *EntitlementPlanHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitlementplanhistory.FieldHistoryTime: + return m.HistoryTime() + case entitlementplanhistory.FieldRef: + return m.Ref() + case entitlementplanhistory.FieldOperation: + return m.Operation() + case entitlementplanhistory.FieldCreatedAt: + return m.CreatedAt() + case entitlementplanhistory.FieldUpdatedAt: + return m.UpdatedAt() + case entitlementplanhistory.FieldCreatedBy: + return m.CreatedBy() + case entitlementplanhistory.FieldUpdatedBy: + return m.UpdatedBy() + case entitlementplanhistory.FieldMappingID: + return m.MappingID() + case entitlementplanhistory.FieldDeletedAt: + return m.DeletedAt() + case entitlementplanhistory.FieldDeletedBy: + return m.DeletedBy() + case entitlementplanhistory.FieldTags: + return m.Tags() + case entitlementplanhistory.FieldOwnerID: + return m.OwnerID() + case entitlementplanhistory.FieldDisplayName: + return m.DisplayName() + case entitlementplanhistory.FieldName: + return m.Name() + case entitlementplanhistory.FieldDescription: + return m.Description() + case entitlementplanhistory.FieldVersion: + return m.Version() + case entitlementplanhistory.FieldMetadata: + return m.Metadata() + } + 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 *EntitlementPlanHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitlementplanhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case entitlementplanhistory.FieldRef: + return m.OldRef(ctx) + case entitlementplanhistory.FieldOperation: + return m.OldOperation(ctx) + case entitlementplanhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitlementplanhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitlementplanhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitlementplanhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitlementplanhistory.FieldMappingID: + return m.OldMappingID(ctx) + case entitlementplanhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitlementplanhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitlementplanhistory.FieldTags: + return m.OldTags(ctx) + case entitlementplanhistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitlementplanhistory.FieldDisplayName: + return m.OldDisplayName(ctx) + case entitlementplanhistory.FieldName: + return m.OldName(ctx) + case entitlementplanhistory.FieldDescription: + return m.OldDescription(ctx) + case entitlementplanhistory.FieldVersion: + return m.OldVersion(ctx) + case entitlementplanhistory.FieldMetadata: + return m.OldMetadata(ctx) + } + return nil, fmt.Errorf("unknown EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case entitlementplanhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case entitlementplanhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case entitlementplanhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case entitlementplanhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitlementplanhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitlementplanhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitlementplanhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitlementplanhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitlementplanhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitlementplanhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitlementplanhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitlementplanhistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitlementplanhistory.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case entitlementplanhistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case entitlementplanhistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case entitlementplanhistory.FieldVersion: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetVersion(v) + return nil + case entitlementplanhistory.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + } + return fmt.Errorf("unknown EntitlementPlanHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntitlementPlanHistoryMutation) 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 *EntitlementPlanHistoryMutation) 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 *EntitlementPlanHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntitlementPlanHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntitlementPlanHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitlementplanhistory.FieldRef) { + fields = append(fields, entitlementplanhistory.FieldRef) + } + if m.FieldCleared(entitlementplanhistory.FieldCreatedAt) { + fields = append(fields, entitlementplanhistory.FieldCreatedAt) + } + if m.FieldCleared(entitlementplanhistory.FieldUpdatedAt) { + fields = append(fields, entitlementplanhistory.FieldUpdatedAt) + } + if m.FieldCleared(entitlementplanhistory.FieldCreatedBy) { + fields = append(fields, entitlementplanhistory.FieldCreatedBy) + } + if m.FieldCleared(entitlementplanhistory.FieldUpdatedBy) { + fields = append(fields, entitlementplanhistory.FieldUpdatedBy) + } + if m.FieldCleared(entitlementplanhistory.FieldDeletedAt) { + fields = append(fields, entitlementplanhistory.FieldDeletedAt) + } + if m.FieldCleared(entitlementplanhistory.FieldDeletedBy) { + fields = append(fields, entitlementplanhistory.FieldDeletedBy) + } + if m.FieldCleared(entitlementplanhistory.FieldTags) { + fields = append(fields, entitlementplanhistory.FieldTags) + } + if m.FieldCleared(entitlementplanhistory.FieldOwnerID) { + fields = append(fields, entitlementplanhistory.FieldOwnerID) + } + if m.FieldCleared(entitlementplanhistory.FieldDisplayName) { + fields = append(fields, entitlementplanhistory.FieldDisplayName) + } + if m.FieldCleared(entitlementplanhistory.FieldDescription) { + fields = append(fields, entitlementplanhistory.FieldDescription) + } + if m.FieldCleared(entitlementplanhistory.FieldMetadata) { + fields = append(fields, entitlementplanhistory.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) 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 *EntitlementPlanHistoryMutation) ClearField(name string) error { + switch name { + case entitlementplanhistory.FieldRef: + m.ClearRef() + return nil + case entitlementplanhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitlementplanhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitlementplanhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitlementplanhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitlementplanhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitlementplanhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitlementplanhistory.FieldTags: + m.ClearTags() + return nil + case entitlementplanhistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case entitlementplanhistory.FieldDisplayName: + m.ClearDisplayName() + return nil + case entitlementplanhistory.FieldDescription: + m.ClearDescription() + return nil + case entitlementplanhistory.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) ResetField(name string) error { + switch name { + case entitlementplanhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case entitlementplanhistory.FieldRef: + m.ResetRef() + return nil + case entitlementplanhistory.FieldOperation: + m.ResetOperation() + return nil + case entitlementplanhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitlementplanhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitlementplanhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitlementplanhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitlementplanhistory.FieldMappingID: + m.ResetMappingID() + return nil + case entitlementplanhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitlementplanhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitlementplanhistory.FieldTags: + m.ResetTags() + return nil + case entitlementplanhistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitlementplanhistory.FieldDisplayName: + m.ResetDisplayName() + return nil + case entitlementplanhistory.FieldName: + m.ResetName() + return nil + case entitlementplanhistory.FieldDescription: + m.ResetDescription() + return nil + case entitlementplanhistory.FieldVersion: + m.ResetVersion() + return nil + case entitlementplanhistory.FieldMetadata: + m.ResetMetadata() + return nil + } + return fmt.Errorf("unknown EntitlementPlanHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntitlementPlanHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntitlementPlanHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntitlementPlanHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntitlementPlanHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntitlementPlanHistoryMutation) EdgeCleared(name string) bool { + 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 *EntitlementPlanHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown EntitlementPlanHistory 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 *EntitlementPlanHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown EntitlementPlanHistory edge %s", name) +} + +// EntityMutation represents an operation that mutates the Entity nodes in the graph. +type EntityMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + name *string + display_name *string + description *string + domains *[]string + appenddomains []string + status *string + clearedFields map[string]struct{} + owner *string + clearedowner bool + contacts map[string]struct{} + removedcontacts map[string]struct{} + clearedcontacts bool + documents map[string]struct{} + removeddocuments map[string]struct{} + cleareddocuments bool + notes map[string]struct{} + removednotes map[string]struct{} + clearednotes bool + files map[string]struct{} + removedfiles map[string]struct{} + clearedfiles bool + entity_type *string + clearedentity_type bool + done bool + oldValue func(context.Context) (*Entity, error) + predicates []predicate.Entity +} + +var _ ent.Mutation = (*EntityMutation)(nil) + +// entityOption allows management of the mutation configuration using functional options. +type entityOption func(*EntityMutation) + +// newEntityMutation creates new mutation for the Entity entity. +func newEntityMutation(c config, op Op, opts ...entityOption) *EntityMutation { + m := &EntityMutation{ + config: c, + op: op, + typ: TypeEntity, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntityID sets the ID field of the mutation. +func withEntityID(id string) entityOption { + return func(m *EntityMutation) { + var ( + err error + once sync.Once + value *Entity + ) + m.oldValue = func(ctx context.Context) (*Entity, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Entity.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntity sets the old Entity of the mutation. +func withEntity(node *Entity) entityOption { + return func(m *EntityMutation) { + m.oldValue = func(context.Context) (*Entity, 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 EntityMutation) 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 EntityMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Entity entities. +func (m *EntityMutation) SetID(id string) { + 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 *EntityMutation) ID() (id string, 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 *EntityMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Entity.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntityMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntityMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntityMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entity.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntityMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entity.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntityMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entity.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntityMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntityMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntityMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entity.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntityMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entity.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntityMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entity.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntityMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntityMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntityMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entity.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntityMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entity.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntityMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entity.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntityMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntityMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntityMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entity.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntityMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entity.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntityMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entity.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntityMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntityMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntityMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntityMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntityMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntityMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entity.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntityMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entity.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntityMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entity.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntityMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntityMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntityMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entity.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntityMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entity.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntityMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entity.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntityMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntityMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntityMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntityMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntityMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entity.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntityMutation) TagsCleared() bool { + _, ok := m.clearedFields[entity.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntityMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entity.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntityMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntityMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntityMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[entity.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntityMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entity.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntityMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, entity.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *EntityMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *EntityMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ClearName clears the value of the "name" field. +func (m *EntityMutation) ClearName() { + m.name = nil + m.clearedFields[entity.FieldName] = struct{}{} +} + +// NameCleared returns if the "name" field was cleared in this mutation. +func (m *EntityMutation) NameCleared() bool { + _, ok := m.clearedFields[entity.FieldName] + return ok +} + +// ResetName resets all changes to the "name" field. +func (m *EntityMutation) ResetName() { + m.name = nil + delete(m.clearedFields, entity.FieldName) +} + +// SetDisplayName sets the "display_name" field. +func (m *EntityMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *EntityMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ClearDisplayName clears the value of the "display_name" field. +func (m *EntityMutation) ClearDisplayName() { + m.display_name = nil + m.clearedFields[entity.FieldDisplayName] = struct{}{} +} + +// DisplayNameCleared returns if the "display_name" field was cleared in this mutation. +func (m *EntityMutation) DisplayNameCleared() bool { + _, ok := m.clearedFields[entity.FieldDisplayName] + return ok +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *EntityMutation) ResetDisplayName() { + m.display_name = nil + delete(m.clearedFields, entity.FieldDisplayName) +} + +// SetDescription sets the "description" field. +func (m *EntityMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *EntityMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *EntityMutation) ClearDescription() { + m.description = nil + m.clearedFields[entity.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *EntityMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[entity.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *EntityMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, entity.FieldDescription) +} + +// SetDomains sets the "domains" field. +func (m *EntityMutation) SetDomains(s []string) { + m.domains = &s + m.appenddomains = nil +} + +// Domains returns the value of the "domains" field in the mutation. +func (m *EntityMutation) Domains() (r []string, exists bool) { + v := m.domains + if v == nil { + return + } + return *v, true +} + +// OldDomains returns the old "domains" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldDomains(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDomains is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDomains requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDomains: %w", err) + } + return oldValue.Domains, nil +} + +// AppendDomains adds s to the "domains" field. +func (m *EntityMutation) AppendDomains(s []string) { + m.appenddomains = append(m.appenddomains, s...) +} + +// AppendedDomains returns the list of values that were appended to the "domains" field in this mutation. +func (m *EntityMutation) AppendedDomains() ([]string, bool) { + if len(m.appenddomains) == 0 { + return nil, false + } + return m.appenddomains, true +} + +// ClearDomains clears the value of the "domains" field. +func (m *EntityMutation) ClearDomains() { + m.domains = nil + m.appenddomains = nil + m.clearedFields[entity.FieldDomains] = struct{}{} +} + +// DomainsCleared returns if the "domains" field was cleared in this mutation. +func (m *EntityMutation) DomainsCleared() bool { + _, ok := m.clearedFields[entity.FieldDomains] + return ok +} + +// ResetDomains resets all changes to the "domains" field. +func (m *EntityMutation) ResetDomains() { + m.domains = nil + m.appenddomains = nil + delete(m.clearedFields, entity.FieldDomains) +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (m *EntityMutation) SetEntityTypeID(s string) { + m.entity_type = &s +} + +// EntityTypeID returns the value of the "entity_type_id" field in the mutation. +func (m *EntityMutation) EntityTypeID() (r string, exists bool) { + v := m.entity_type + if v == nil { + return + } + return *v, true +} + +// OldEntityTypeID returns the old "entity_type_id" field's value of the Entity entity. +// If the Entity 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 *EntityMutation) OldEntityTypeID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEntityTypeID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEntityTypeID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEntityTypeID: %w", err) + } + return oldValue.EntityTypeID, nil +} + +// ClearEntityTypeID clears the value of the "entity_type_id" field. +func (m *EntityMutation) ClearEntityTypeID() { + m.entity_type = nil + m.clearedFields[entity.FieldEntityTypeID] = struct{}{} +} + +// EntityTypeIDCleared returns if the "entity_type_id" field was cleared in this mutation. +func (m *EntityMutation) EntityTypeIDCleared() bool { + _, ok := m.clearedFields[entity.FieldEntityTypeID] + return ok +} + +// ResetEntityTypeID resets all changes to the "entity_type_id" field. +func (m *EntityMutation) ResetEntityTypeID() { + m.entity_type = nil + delete(m.clearedFields, entity.FieldEntityTypeID) +} + +// SetStatus sets the "status" field. +func (m *EntityMutation) SetStatus(s string) { + m.status = &s +} + +// Status returns the value of the "status" field in the mutation. +func (m *EntityMutation) 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 Entity entity. +// If the Entity 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 *EntityMutation) 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 +} + +// ClearStatus clears the value of the "status" field. +func (m *EntityMutation) ClearStatus() { + m.status = nil + m.clearedFields[entity.FieldStatus] = struct{}{} +} + +// StatusCleared returns if the "status" field was cleared in this mutation. +func (m *EntityMutation) StatusCleared() bool { + _, ok := m.clearedFields[entity.FieldStatus] + return ok +} + +// ResetStatus resets all changes to the "status" field. +func (m *EntityMutation) ResetStatus() { + m.status = nil + delete(m.clearedFields, entity.FieldStatus) +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *EntityMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[entity.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *EntityMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *EntityMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *EntityMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by ids. +func (m *EntityMutation) AddContactIDs(ids ...string) { + if m.contacts == nil { + m.contacts = make(map[string]struct{}) + } + for i := range ids { + m.contacts[ids[i]] = struct{}{} + } +} + +// ClearContacts clears the "contacts" edge to the Contact entity. +func (m *EntityMutation) ClearContacts() { + m.clearedcontacts = true +} + +// ContactsCleared reports if the "contacts" edge to the Contact entity was cleared. +func (m *EntityMutation) ContactsCleared() bool { + return m.clearedcontacts +} + +// RemoveContactIDs removes the "contacts" edge to the Contact entity by IDs. +func (m *EntityMutation) RemoveContactIDs(ids ...string) { + if m.removedcontacts == nil { + m.removedcontacts = make(map[string]struct{}) + } + for i := range ids { + delete(m.contacts, ids[i]) + m.removedcontacts[ids[i]] = struct{}{} + } +} + +// RemovedContacts returns the removed IDs of the "contacts" edge to the Contact entity. +func (m *EntityMutation) RemovedContactsIDs() (ids []string) { + for id := range m.removedcontacts { + ids = append(ids, id) + } + return +} + +// ContactsIDs returns the "contacts" edge IDs in the mutation. +func (m *EntityMutation) ContactsIDs() (ids []string) { + for id := range m.contacts { + ids = append(ids, id) + } + return +} + +// ResetContacts resets all changes to the "contacts" edge. +func (m *EntityMutation) ResetContacts() { + m.contacts = nil + m.clearedcontacts = false + m.removedcontacts = nil +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by ids. +func (m *EntityMutation) AddDocumentIDs(ids ...string) { + if m.documents == nil { + m.documents = make(map[string]struct{}) + } + for i := range ids { + m.documents[ids[i]] = struct{}{} + } +} + +// ClearDocuments clears the "documents" edge to the DocumentData entity. +func (m *EntityMutation) ClearDocuments() { + m.cleareddocuments = true +} + +// DocumentsCleared reports if the "documents" edge to the DocumentData entity was cleared. +func (m *EntityMutation) DocumentsCleared() bool { + return m.cleareddocuments +} + +// RemoveDocumentIDs removes the "documents" edge to the DocumentData entity by IDs. +func (m *EntityMutation) RemoveDocumentIDs(ids ...string) { + if m.removeddocuments == nil { + m.removeddocuments = make(map[string]struct{}) + } + for i := range ids { + delete(m.documents, ids[i]) + m.removeddocuments[ids[i]] = struct{}{} + } +} + +// RemovedDocuments returns the removed IDs of the "documents" edge to the DocumentData entity. +func (m *EntityMutation) RemovedDocumentsIDs() (ids []string) { + for id := range m.removeddocuments { + ids = append(ids, id) + } + return +} + +// DocumentsIDs returns the "documents" edge IDs in the mutation. +func (m *EntityMutation) DocumentsIDs() (ids []string) { + for id := range m.documents { + ids = append(ids, id) + } + return +} + +// ResetDocuments resets all changes to the "documents" edge. +func (m *EntityMutation) ResetDocuments() { + m.documents = nil + m.cleareddocuments = false + m.removeddocuments = nil +} + +// AddNoteIDs adds the "notes" edge to the Note entity by ids. +func (m *EntityMutation) AddNoteIDs(ids ...string) { + if m.notes == nil { + m.notes = make(map[string]struct{}) + } + for i := range ids { + m.notes[ids[i]] = struct{}{} + } +} + +// ClearNotes clears the "notes" edge to the Note entity. +func (m *EntityMutation) ClearNotes() { + m.clearednotes = true +} + +// NotesCleared reports if the "notes" edge to the Note entity was cleared. +func (m *EntityMutation) NotesCleared() bool { + return m.clearednotes +} + +// RemoveNoteIDs removes the "notes" edge to the Note entity by IDs. +func (m *EntityMutation) RemoveNoteIDs(ids ...string) { + if m.removednotes == nil { + m.removednotes = make(map[string]struct{}) + } + for i := range ids { + delete(m.notes, ids[i]) + m.removednotes[ids[i]] = struct{}{} + } +} + +// RemovedNotes returns the removed IDs of the "notes" edge to the Note entity. +func (m *EntityMutation) RemovedNotesIDs() (ids []string) { + for id := range m.removednotes { + ids = append(ids, id) + } + return +} + +// NotesIDs returns the "notes" edge IDs in the mutation. +func (m *EntityMutation) NotesIDs() (ids []string) { + for id := range m.notes { + ids = append(ids, id) + } + return +} + +// ResetNotes resets all changes to the "notes" edge. +func (m *EntityMutation) ResetNotes() { + m.notes = nil + m.clearednotes = false + m.removednotes = nil +} + +// AddFileIDs adds the "files" edge to the File entity by ids. +func (m *EntityMutation) AddFileIDs(ids ...string) { + if m.files == nil { + m.files = make(map[string]struct{}) + } + for i := range ids { + m.files[ids[i]] = struct{}{} + } +} + +// ClearFiles clears the "files" edge to the File entity. +func (m *EntityMutation) ClearFiles() { + m.clearedfiles = true +} + +// FilesCleared reports if the "files" edge to the File entity was cleared. +func (m *EntityMutation) FilesCleared() bool { + return m.clearedfiles +} + +// RemoveFileIDs removes the "files" edge to the File entity by IDs. +func (m *EntityMutation) RemoveFileIDs(ids ...string) { + if m.removedfiles == nil { + m.removedfiles = make(map[string]struct{}) + } + for i := range ids { + delete(m.files, ids[i]) + m.removedfiles[ids[i]] = struct{}{} + } +} + +// RemovedFiles returns the removed IDs of the "files" edge to the File entity. +func (m *EntityMutation) RemovedFilesIDs() (ids []string) { + for id := range m.removedfiles { + ids = append(ids, id) + } + return +} + +// FilesIDs returns the "files" edge IDs in the mutation. +func (m *EntityMutation) FilesIDs() (ids []string) { + for id := range m.files { + ids = append(ids, id) + } + return +} + +// ResetFiles resets all changes to the "files" edge. +func (m *EntityMutation) ResetFiles() { + m.files = nil + m.clearedfiles = false + m.removedfiles = nil +} + +// ClearEntityType clears the "entity_type" edge to the EntityType entity. +func (m *EntityMutation) ClearEntityType() { + m.clearedentity_type = true + m.clearedFields[entity.FieldEntityTypeID] = struct{}{} +} + +// EntityTypeCleared reports if the "entity_type" edge to the EntityType entity was cleared. +func (m *EntityMutation) EntityTypeCleared() bool { + return m.EntityTypeIDCleared() || m.clearedentity_type +} + +// EntityTypeIDs returns the "entity_type" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// EntityTypeID instead. It exists only for internal usage by the builders. +func (m *EntityMutation) EntityTypeIDs() (ids []string) { + if id := m.entity_type; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetEntityType resets all changes to the "entity_type" edge. +func (m *EntityMutation) ResetEntityType() { + m.entity_type = nil + m.clearedentity_type = false +} + +// Where appends a list predicates to the EntityMutation builder. +func (m *EntityMutation) Where(ps ...predicate.Entity) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntityMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntityMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Entity, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntityMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntityMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Entity). +func (m *EntityMutation) 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 *EntityMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.created_at != nil { + fields = append(fields, entity.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entity.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entity.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entity.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entity.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entity.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entity.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entity.FieldTags) + } + if m.owner != nil { + fields = append(fields, entity.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, entity.FieldName) + } + if m.display_name != nil { + fields = append(fields, entity.FieldDisplayName) + } + if m.description != nil { + fields = append(fields, entity.FieldDescription) + } + if m.domains != nil { + fields = append(fields, entity.FieldDomains) + } + if m.entity_type != nil { + fields = append(fields, entity.FieldEntityTypeID) + } + if m.status != nil { + fields = append(fields, entity.FieldStatus) + } + 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 *EntityMutation) Field(name string) (ent.Value, bool) { + switch name { + case entity.FieldCreatedAt: + return m.CreatedAt() + case entity.FieldUpdatedAt: + return m.UpdatedAt() + case entity.FieldCreatedBy: + return m.CreatedBy() + case entity.FieldUpdatedBy: + return m.UpdatedBy() + case entity.FieldMappingID: + return m.MappingID() + case entity.FieldDeletedAt: + return m.DeletedAt() + case entity.FieldDeletedBy: + return m.DeletedBy() + case entity.FieldTags: + return m.Tags() + case entity.FieldOwnerID: + return m.OwnerID() + case entity.FieldName: + return m.Name() + case entity.FieldDisplayName: + return m.DisplayName() + case entity.FieldDescription: + return m.Description() + case entity.FieldDomains: + return m.Domains() + case entity.FieldEntityTypeID: + return m.EntityTypeID() + case entity.FieldStatus: + return m.Status() + } + 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 *EntityMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entity.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entity.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entity.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entity.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entity.FieldMappingID: + return m.OldMappingID(ctx) + case entity.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entity.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entity.FieldTags: + return m.OldTags(ctx) + case entity.FieldOwnerID: + return m.OldOwnerID(ctx) + case entity.FieldName: + return m.OldName(ctx) + case entity.FieldDisplayName: + return m.OldDisplayName(ctx) + case entity.FieldDescription: + return m.OldDescription(ctx) + case entity.FieldDomains: + return m.OldDomains(ctx) + case entity.FieldEntityTypeID: + return m.OldEntityTypeID(ctx) + case entity.FieldStatus: + return m.OldStatus(ctx) + } + return nil, fmt.Errorf("unknown Entity 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 *EntityMutation) SetField(name string, value ent.Value) error { + switch name { + case entity.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entity.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entity.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entity.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entity.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entity.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entity.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entity.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entity.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entity.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case entity.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case entity.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case entity.FieldDomains: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDomains(v) + return nil + case entity.FieldEntityTypeID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEntityTypeID(v) + return nil + case entity.FieldStatus: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + } + return fmt.Errorf("unknown Entity field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntityMutation) 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 *EntityMutation) 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 *EntityMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Entity numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntityMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entity.FieldCreatedAt) { + fields = append(fields, entity.FieldCreatedAt) + } + if m.FieldCleared(entity.FieldUpdatedAt) { + fields = append(fields, entity.FieldUpdatedAt) + } + if m.FieldCleared(entity.FieldCreatedBy) { + fields = append(fields, entity.FieldCreatedBy) + } + if m.FieldCleared(entity.FieldUpdatedBy) { + fields = append(fields, entity.FieldUpdatedBy) + } + if m.FieldCleared(entity.FieldDeletedAt) { + fields = append(fields, entity.FieldDeletedAt) + } + if m.FieldCleared(entity.FieldDeletedBy) { + fields = append(fields, entity.FieldDeletedBy) + } + if m.FieldCleared(entity.FieldTags) { + fields = append(fields, entity.FieldTags) + } + if m.FieldCleared(entity.FieldOwnerID) { + fields = append(fields, entity.FieldOwnerID) + } + if m.FieldCleared(entity.FieldName) { + fields = append(fields, entity.FieldName) + } + if m.FieldCleared(entity.FieldDisplayName) { + fields = append(fields, entity.FieldDisplayName) + } + if m.FieldCleared(entity.FieldDescription) { + fields = append(fields, entity.FieldDescription) + } + if m.FieldCleared(entity.FieldDomains) { + fields = append(fields, entity.FieldDomains) + } + if m.FieldCleared(entity.FieldEntityTypeID) { + fields = append(fields, entity.FieldEntityTypeID) + } + if m.FieldCleared(entity.FieldStatus) { + fields = append(fields, entity.FieldStatus) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntityMutation) 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 *EntityMutation) ClearField(name string) error { + switch name { + case entity.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entity.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entity.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entity.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entity.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entity.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entity.FieldTags: + m.ClearTags() + return nil + case entity.FieldOwnerID: + m.ClearOwnerID() + return nil + case entity.FieldName: + m.ClearName() + return nil + case entity.FieldDisplayName: + m.ClearDisplayName() + return nil + case entity.FieldDescription: + m.ClearDescription() + return nil + case entity.FieldDomains: + m.ClearDomains() + return nil + case entity.FieldEntityTypeID: + m.ClearEntityTypeID() + return nil + case entity.FieldStatus: + m.ClearStatus() + return nil + } + return fmt.Errorf("unknown Entity 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 *EntityMutation) ResetField(name string) error { + switch name { + case entity.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entity.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entity.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entity.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entity.FieldMappingID: + m.ResetMappingID() + return nil + case entity.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entity.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entity.FieldTags: + m.ResetTags() + return nil + case entity.FieldOwnerID: + m.ResetOwnerID() + return nil + case entity.FieldName: + m.ResetName() + return nil + case entity.FieldDisplayName: + m.ResetDisplayName() + return nil + case entity.FieldDescription: + m.ResetDescription() + return nil + case entity.FieldDomains: + m.ResetDomains() + return nil + case entity.FieldEntityTypeID: + m.ResetEntityTypeID() + return nil + case entity.FieldStatus: + m.ResetStatus() + return nil + } + return fmt.Errorf("unknown Entity field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntityMutation) AddedEdges() []string { + edges := make([]string, 0, 6) + if m.owner != nil { + edges = append(edges, entity.EdgeOwner) + } + if m.contacts != nil { + edges = append(edges, entity.EdgeContacts) + } + if m.documents != nil { + edges = append(edges, entity.EdgeDocuments) + } + if m.notes != nil { + edges = append(edges, entity.EdgeNotes) + } + if m.files != nil { + edges = append(edges, entity.EdgeFiles) + } + if m.entity_type != nil { + edges = append(edges, entity.EdgeEntityType) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntityMutation) AddedIDs(name string) []ent.Value { + switch name { + case entity.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case entity.EdgeContacts: + ids := make([]ent.Value, 0, len(m.contacts)) + for id := range m.contacts { + ids = append(ids, id) + } + return ids + case entity.EdgeDocuments: + ids := make([]ent.Value, 0, len(m.documents)) + for id := range m.documents { + ids = append(ids, id) + } + return ids + case entity.EdgeNotes: + ids := make([]ent.Value, 0, len(m.notes)) + for id := range m.notes { + ids = append(ids, id) + } + return ids + case entity.EdgeFiles: + ids := make([]ent.Value, 0, len(m.files)) + for id := range m.files { + ids = append(ids, id) + } + return ids + case entity.EdgeEntityType: + if id := m.entity_type; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntityMutation) RemovedEdges() []string { + edges := make([]string, 0, 6) + if m.removedcontacts != nil { + edges = append(edges, entity.EdgeContacts) + } + if m.removeddocuments != nil { + edges = append(edges, entity.EdgeDocuments) + } + if m.removednotes != nil { + edges = append(edges, entity.EdgeNotes) + } + if m.removedfiles != nil { + edges = append(edges, entity.EdgeFiles) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntityMutation) RemovedIDs(name string) []ent.Value { + switch name { + case entity.EdgeContacts: + ids := make([]ent.Value, 0, len(m.removedcontacts)) + for id := range m.removedcontacts { + ids = append(ids, id) + } + return ids + case entity.EdgeDocuments: + ids := make([]ent.Value, 0, len(m.removeddocuments)) + for id := range m.removeddocuments { + ids = append(ids, id) + } + return ids + case entity.EdgeNotes: + ids := make([]ent.Value, 0, len(m.removednotes)) + for id := range m.removednotes { + ids = append(ids, id) + } + return ids + case entity.EdgeFiles: + ids := make([]ent.Value, 0, len(m.removedfiles)) + for id := range m.removedfiles { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntityMutation) ClearedEdges() []string { + edges := make([]string, 0, 6) + if m.clearedowner { + edges = append(edges, entity.EdgeOwner) + } + if m.clearedcontacts { + edges = append(edges, entity.EdgeContacts) + } + if m.cleareddocuments { + edges = append(edges, entity.EdgeDocuments) + } + if m.clearednotes { + edges = append(edges, entity.EdgeNotes) + } + if m.clearedfiles { + edges = append(edges, entity.EdgeFiles) + } + if m.clearedentity_type { + edges = append(edges, entity.EdgeEntityType) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntityMutation) EdgeCleared(name string) bool { + switch name { + case entity.EdgeOwner: + return m.clearedowner + case entity.EdgeContacts: + return m.clearedcontacts + case entity.EdgeDocuments: + return m.cleareddocuments + case entity.EdgeNotes: + return m.clearednotes + case entity.EdgeFiles: + return m.clearedfiles + case entity.EdgeEntityType: + return m.clearedentity_type + } + 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 *EntityMutation) ClearEdge(name string) error { + switch name { + case entity.EdgeOwner: + m.ClearOwner() + return nil + case entity.EdgeEntityType: + m.ClearEntityType() + return nil + } + return fmt.Errorf("unknown Entity 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 *EntityMutation) ResetEdge(name string) error { + switch name { + case entity.EdgeOwner: + m.ResetOwner() + return nil + case entity.EdgeContacts: + m.ResetContacts() + return nil + case entity.EdgeDocuments: + m.ResetDocuments() + return nil + case entity.EdgeNotes: + m.ResetNotes() + return nil + case entity.EdgeFiles: + m.ResetFiles() + return nil + case entity.EdgeEntityType: + m.ResetEntityType() + return nil + } + return fmt.Errorf("unknown Entity edge %s", name) +} + +// EntityHistoryMutation represents an operation that mutates the EntityHistory nodes in the graph. +type EntityHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + owner_id *string + name *string + display_name *string + description *string + domains *[]string + appenddomains []string + entity_type_id *string + status *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*EntityHistory, error) + predicates []predicate.EntityHistory +} + +var _ ent.Mutation = (*EntityHistoryMutation)(nil) + +// entityhistoryOption allows management of the mutation configuration using functional options. +type entityhistoryOption func(*EntityHistoryMutation) + +// newEntityHistoryMutation creates new mutation for the EntityHistory entity. +func newEntityHistoryMutation(c config, op Op, opts ...entityhistoryOption) *EntityHistoryMutation { + m := &EntityHistoryMutation{ + config: c, + op: op, + typ: TypeEntityHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntityHistoryID sets the ID field of the mutation. +func withEntityHistoryID(id string) entityhistoryOption { + return func(m *EntityHistoryMutation) { + var ( + err error + once sync.Once + value *EntityHistory + ) + m.oldValue = func(ctx context.Context) (*EntityHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntityHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntityHistory sets the old EntityHistory of the mutation. +func withEntityHistory(node *EntityHistory) entityhistoryOption { + return func(m *EntityHistoryMutation) { + m.oldValue = func(context.Context) (*EntityHistory, 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 EntityHistoryMutation) 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 EntityHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntityHistory entities. +func (m *EntityHistoryMutation) SetID(id string) { + 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 *EntityHistoryMutation) ID() (id string, 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 *EntityHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntityHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *EntityHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *EntityHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *EntityHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *EntityHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *EntityHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *EntityHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[entityhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *EntityHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *EntityHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, entityhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *EntityHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *EntityHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *EntityHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntityHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntityHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntityHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entityhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntityHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntityHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entityhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntityHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntityHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntityHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entityhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntityHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntityHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entityhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntityHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntityHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntityHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entityhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntityHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntityHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entityhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntityHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntityHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntityHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entityhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntityHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntityHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entityhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntityHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntityHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntityHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntityHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntityHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntityHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entityhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntityHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntityHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entityhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntityHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntityHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntityHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entityhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntityHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntityHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entityhistory.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntityHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntityHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntityHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntityHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntityHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entityhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntityHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntityHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entityhistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntityHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntityHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntityHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[entityhistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntityHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntityHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, entityhistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *EntityHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *EntityHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ClearName clears the value of the "name" field. +func (m *EntityHistoryMutation) ClearName() { + m.name = nil + m.clearedFields[entityhistory.FieldName] = struct{}{} +} + +// NameCleared returns if the "name" field was cleared in this mutation. +func (m *EntityHistoryMutation) NameCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldName] + return ok +} + +// ResetName resets all changes to the "name" field. +func (m *EntityHistoryMutation) ResetName() { + m.name = nil + delete(m.clearedFields, entityhistory.FieldName) +} + +// SetDisplayName sets the "display_name" field. +func (m *EntityHistoryMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *EntityHistoryMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ClearDisplayName clears the value of the "display_name" field. +func (m *EntityHistoryMutation) ClearDisplayName() { + m.display_name = nil + m.clearedFields[entityhistory.FieldDisplayName] = struct{}{} +} + +// DisplayNameCleared returns if the "display_name" field was cleared in this mutation. +func (m *EntityHistoryMutation) DisplayNameCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldDisplayName] + return ok +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *EntityHistoryMutation) ResetDisplayName() { + m.display_name = nil + delete(m.clearedFields, entityhistory.FieldDisplayName) +} + +// SetDescription sets the "description" field. +func (m *EntityHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *EntityHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *EntityHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[entityhistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *EntityHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *EntityHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, entityhistory.FieldDescription) +} + +// SetDomains sets the "domains" field. +func (m *EntityHistoryMutation) SetDomains(s []string) { + m.domains = &s + m.appenddomains = nil +} + +// Domains returns the value of the "domains" field in the mutation. +func (m *EntityHistoryMutation) Domains() (r []string, exists bool) { + v := m.domains + if v == nil { + return + } + return *v, true +} + +// OldDomains returns the old "domains" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldDomains(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDomains is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDomains requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDomains: %w", err) + } + return oldValue.Domains, nil +} + +// AppendDomains adds s to the "domains" field. +func (m *EntityHistoryMutation) AppendDomains(s []string) { + m.appenddomains = append(m.appenddomains, s...) +} + +// AppendedDomains returns the list of values that were appended to the "domains" field in this mutation. +func (m *EntityHistoryMutation) AppendedDomains() ([]string, bool) { + if len(m.appenddomains) == 0 { + return nil, false + } + return m.appenddomains, true +} + +// ClearDomains clears the value of the "domains" field. +func (m *EntityHistoryMutation) ClearDomains() { + m.domains = nil + m.appenddomains = nil + m.clearedFields[entityhistory.FieldDomains] = struct{}{} +} + +// DomainsCleared returns if the "domains" field was cleared in this mutation. +func (m *EntityHistoryMutation) DomainsCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldDomains] + return ok +} + +// ResetDomains resets all changes to the "domains" field. +func (m *EntityHistoryMutation) ResetDomains() { + m.domains = nil + m.appenddomains = nil + delete(m.clearedFields, entityhistory.FieldDomains) +} + +// SetEntityTypeID sets the "entity_type_id" field. +func (m *EntityHistoryMutation) SetEntityTypeID(s string) { + m.entity_type_id = &s +} + +// EntityTypeID returns the value of the "entity_type_id" field in the mutation. +func (m *EntityHistoryMutation) EntityTypeID() (r string, exists bool) { + v := m.entity_type_id + if v == nil { + return + } + return *v, true +} + +// OldEntityTypeID returns the old "entity_type_id" field's value of the EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) OldEntityTypeID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEntityTypeID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEntityTypeID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEntityTypeID: %w", err) + } + return oldValue.EntityTypeID, nil +} + +// ClearEntityTypeID clears the value of the "entity_type_id" field. +func (m *EntityHistoryMutation) ClearEntityTypeID() { + m.entity_type_id = nil + m.clearedFields[entityhistory.FieldEntityTypeID] = struct{}{} +} + +// EntityTypeIDCleared returns if the "entity_type_id" field was cleared in this mutation. +func (m *EntityHistoryMutation) EntityTypeIDCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldEntityTypeID] + return ok +} + +// ResetEntityTypeID resets all changes to the "entity_type_id" field. +func (m *EntityHistoryMutation) ResetEntityTypeID() { + m.entity_type_id = nil + delete(m.clearedFields, entityhistory.FieldEntityTypeID) +} + +// SetStatus sets the "status" field. +func (m *EntityHistoryMutation) SetStatus(s string) { + m.status = &s +} + +// Status returns the value of the "status" field in the mutation. +func (m *EntityHistoryMutation) 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 EntityHistory entity. +// If the EntityHistory 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 *EntityHistoryMutation) 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 +} + +// ClearStatus clears the value of the "status" field. +func (m *EntityHistoryMutation) ClearStatus() { + m.status = nil + m.clearedFields[entityhistory.FieldStatus] = struct{}{} +} + +// StatusCleared returns if the "status" field was cleared in this mutation. +func (m *EntityHistoryMutation) StatusCleared() bool { + _, ok := m.clearedFields[entityhistory.FieldStatus] + return ok +} + +// ResetStatus resets all changes to the "status" field. +func (m *EntityHistoryMutation) ResetStatus() { + m.status = nil + delete(m.clearedFields, entityhistory.FieldStatus) +} + +// Where appends a list predicates to the EntityHistoryMutation builder. +func (m *EntityHistoryMutation) Where(ps ...predicate.EntityHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntityHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntityHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntityHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntityHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntityHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntityHistory). +func (m *EntityHistoryMutation) 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 *EntityHistoryMutation) Fields() []string { + fields := make([]string, 0, 18) + if m.history_time != nil { + fields = append(fields, entityhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, entityhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, entityhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, entityhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entityhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entityhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entityhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entityhistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entityhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entityhistory.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entityhistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, entityhistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, entityhistory.FieldName) + } + if m.display_name != nil { + fields = append(fields, entityhistory.FieldDisplayName) + } + if m.description != nil { + fields = append(fields, entityhistory.FieldDescription) + } + if m.domains != nil { + fields = append(fields, entityhistory.FieldDomains) + } + if m.entity_type_id != nil { + fields = append(fields, entityhistory.FieldEntityTypeID) + } + if m.status != nil { + fields = append(fields, entityhistory.FieldStatus) + } + 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 *EntityHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case entityhistory.FieldHistoryTime: + return m.HistoryTime() + case entityhistory.FieldRef: + return m.Ref() + case entityhistory.FieldOperation: + return m.Operation() + case entityhistory.FieldCreatedAt: + return m.CreatedAt() + case entityhistory.FieldUpdatedAt: + return m.UpdatedAt() + case entityhistory.FieldCreatedBy: + return m.CreatedBy() + case entityhistory.FieldUpdatedBy: + return m.UpdatedBy() + case entityhistory.FieldMappingID: + return m.MappingID() + case entityhistory.FieldDeletedAt: + return m.DeletedAt() + case entityhistory.FieldDeletedBy: + return m.DeletedBy() + case entityhistory.FieldTags: + return m.Tags() + case entityhistory.FieldOwnerID: + return m.OwnerID() + case entityhistory.FieldName: + return m.Name() + case entityhistory.FieldDisplayName: + return m.DisplayName() + case entityhistory.FieldDescription: + return m.Description() + case entityhistory.FieldDomains: + return m.Domains() + case entityhistory.FieldEntityTypeID: + return m.EntityTypeID() + case entityhistory.FieldStatus: + return m.Status() + } + 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 *EntityHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entityhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case entityhistory.FieldRef: + return m.OldRef(ctx) + case entityhistory.FieldOperation: + return m.OldOperation(ctx) + case entityhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entityhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entityhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entityhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entityhistory.FieldMappingID: + return m.OldMappingID(ctx) + case entityhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entityhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entityhistory.FieldTags: + return m.OldTags(ctx) + case entityhistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case entityhistory.FieldName: + return m.OldName(ctx) + case entityhistory.FieldDisplayName: + return m.OldDisplayName(ctx) + case entityhistory.FieldDescription: + return m.OldDescription(ctx) + case entityhistory.FieldDomains: + return m.OldDomains(ctx) + case entityhistory.FieldEntityTypeID: + return m.OldEntityTypeID(ctx) + case entityhistory.FieldStatus: + return m.OldStatus(ctx) + } + return nil, fmt.Errorf("unknown EntityHistory 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 *EntityHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case entityhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case entityhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case entityhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case entityhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entityhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entityhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entityhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entityhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entityhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entityhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entityhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entityhistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entityhistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case entityhistory.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case entityhistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case entityhistory.FieldDomains: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDomains(v) + return nil + case entityhistory.FieldEntityTypeID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEntityTypeID(v) + return nil + case entityhistory.FieldStatus: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + } + return fmt.Errorf("unknown EntityHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntityHistoryMutation) 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 *EntityHistoryMutation) 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 *EntityHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntityHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntityHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entityhistory.FieldRef) { + fields = append(fields, entityhistory.FieldRef) + } + if m.FieldCleared(entityhistory.FieldCreatedAt) { + fields = append(fields, entityhistory.FieldCreatedAt) + } + if m.FieldCleared(entityhistory.FieldUpdatedAt) { + fields = append(fields, entityhistory.FieldUpdatedAt) + } + if m.FieldCleared(entityhistory.FieldCreatedBy) { + fields = append(fields, entityhistory.FieldCreatedBy) + } + if m.FieldCleared(entityhistory.FieldUpdatedBy) { + fields = append(fields, entityhistory.FieldUpdatedBy) + } + if m.FieldCleared(entityhistory.FieldDeletedAt) { + fields = append(fields, entityhistory.FieldDeletedAt) + } + if m.FieldCleared(entityhistory.FieldDeletedBy) { + fields = append(fields, entityhistory.FieldDeletedBy) + } + if m.FieldCleared(entityhistory.FieldTags) { + fields = append(fields, entityhistory.FieldTags) + } + if m.FieldCleared(entityhistory.FieldOwnerID) { + fields = append(fields, entityhistory.FieldOwnerID) + } + if m.FieldCleared(entityhistory.FieldName) { + fields = append(fields, entityhistory.FieldName) + } + if m.FieldCleared(entityhistory.FieldDisplayName) { + fields = append(fields, entityhistory.FieldDisplayName) + } + if m.FieldCleared(entityhistory.FieldDescription) { + fields = append(fields, entityhistory.FieldDescription) + } + if m.FieldCleared(entityhistory.FieldDomains) { + fields = append(fields, entityhistory.FieldDomains) + } + if m.FieldCleared(entityhistory.FieldEntityTypeID) { + fields = append(fields, entityhistory.FieldEntityTypeID) + } + if m.FieldCleared(entityhistory.FieldStatus) { + fields = append(fields, entityhistory.FieldStatus) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntityHistoryMutation) 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 *EntityHistoryMutation) ClearField(name string) error { + switch name { + case entityhistory.FieldRef: + m.ClearRef() + return nil + case entityhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entityhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entityhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entityhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entityhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entityhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entityhistory.FieldTags: + m.ClearTags() + return nil + case entityhistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case entityhistory.FieldName: + m.ClearName() + return nil + case entityhistory.FieldDisplayName: + m.ClearDisplayName() + return nil + case entityhistory.FieldDescription: + m.ClearDescription() + return nil + case entityhistory.FieldDomains: + m.ClearDomains() + return nil + case entityhistory.FieldEntityTypeID: + m.ClearEntityTypeID() + return nil + case entityhistory.FieldStatus: + m.ClearStatus() + return nil + } + return fmt.Errorf("unknown EntityHistory 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 *EntityHistoryMutation) ResetField(name string) error { + switch name { + case entityhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case entityhistory.FieldRef: + m.ResetRef() + return nil + case entityhistory.FieldOperation: + m.ResetOperation() + return nil + case entityhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entityhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entityhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entityhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entityhistory.FieldMappingID: + m.ResetMappingID() + return nil + case entityhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entityhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entityhistory.FieldTags: + m.ResetTags() + return nil + case entityhistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case entityhistory.FieldName: + m.ResetName() + return nil + case entityhistory.FieldDisplayName: + m.ResetDisplayName() + return nil + case entityhistory.FieldDescription: + m.ResetDescription() + return nil + case entityhistory.FieldDomains: + m.ResetDomains() + return nil + case entityhistory.FieldEntityTypeID: + m.ResetEntityTypeID() + return nil + case entityhistory.FieldStatus: + m.ResetStatus() + return nil + } + return fmt.Errorf("unknown EntityHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntityHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntityHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntityHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntityHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntityHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntityHistoryMutation) EdgeCleared(name string) bool { + 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 *EntityHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown EntityHistory 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 *EntityHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown EntityHistory edge %s", name) +} + +// EntityTypeMutation represents an operation that mutates the EntityType nodes in the graph. +type EntityTypeMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + name *string + clearedFields map[string]struct{} + owner *string + clearedowner bool + entities map[string]struct{} + removedentities map[string]struct{} + clearedentities bool + done bool + oldValue func(context.Context) (*EntityType, error) + predicates []predicate.EntityType +} + +var _ ent.Mutation = (*EntityTypeMutation)(nil) + +// entitytypeOption allows management of the mutation configuration using functional options. +type entitytypeOption func(*EntityTypeMutation) + +// newEntityTypeMutation creates new mutation for the EntityType entity. +func newEntityTypeMutation(c config, op Op, opts ...entitytypeOption) *EntityTypeMutation { + m := &EntityTypeMutation{ + config: c, + op: op, + typ: TypeEntityType, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntityTypeID sets the ID field of the mutation. +func withEntityTypeID(id string) entitytypeOption { + return func(m *EntityTypeMutation) { + var ( + err error + once sync.Once + value *EntityType + ) + m.oldValue = func(ctx context.Context) (*EntityType, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntityType.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntityType sets the old EntityType of the mutation. +func withEntityType(node *EntityType) entitytypeOption { + return func(m *EntityTypeMutation) { + m.oldValue = func(context.Context) (*EntityType, 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 EntityTypeMutation) 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 EntityTypeMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntityType entities. +func (m *EntityTypeMutation) SetID(id string) { + 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 *EntityTypeMutation) ID() (id string, 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 *EntityTypeMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntityType.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntityTypeMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntityTypeMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntityTypeMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitytype.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntityTypeMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitytype.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntityTypeMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitytype.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntityTypeMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntityTypeMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntityTypeMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitytype.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntityTypeMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitytype.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntityTypeMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitytype.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntityTypeMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntityTypeMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntityTypeMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitytype.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntityTypeMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitytype.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntityTypeMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitytype.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntityTypeMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntityTypeMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntityTypeMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitytype.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntityTypeMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitytype.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntityTypeMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitytype.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntityTypeMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntityTypeMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntityTypeMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntityTypeMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntityTypeMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntityTypeMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitytype.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntityTypeMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitytype.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntityTypeMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitytype.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntityTypeMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntityTypeMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntityTypeMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitytype.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntityTypeMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitytype.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntityTypeMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitytype.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntityTypeMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntityTypeMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntityTypeMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntityTypeMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntityTypeMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitytype.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntityTypeMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitytype.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntityTypeMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitytype.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntityTypeMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntityTypeMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntityTypeMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[entitytype.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntityTypeMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitytype.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntityTypeMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, entitytype.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *EntityTypeMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *EntityTypeMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the EntityType entity. +// If the EntityType 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 *EntityTypeMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *EntityTypeMutation) ResetName() { + m.name = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *EntityTypeMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[entitytype.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *EntityTypeMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *EntityTypeMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *EntityTypeMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by ids. +func (m *EntityTypeMutation) AddEntityIDs(ids ...string) { + if m.entities == nil { + m.entities = make(map[string]struct{}) + } + for i := range ids { + m.entities[ids[i]] = struct{}{} + } +} + +// ClearEntities clears the "entities" edge to the Entity entity. +func (m *EntityTypeMutation) ClearEntities() { + m.clearedentities = true +} + +// EntitiesCleared reports if the "entities" edge to the Entity entity was cleared. +func (m *EntityTypeMutation) EntitiesCleared() bool { + return m.clearedentities +} + +// RemoveEntityIDs removes the "entities" edge to the Entity entity by IDs. +func (m *EntityTypeMutation) RemoveEntityIDs(ids ...string) { + if m.removedentities == nil { + m.removedentities = make(map[string]struct{}) + } + for i := range ids { + delete(m.entities, ids[i]) + m.removedentities[ids[i]] = struct{}{} + } +} + +// RemovedEntities returns the removed IDs of the "entities" edge to the Entity entity. +func (m *EntityTypeMutation) RemovedEntitiesIDs() (ids []string) { + for id := range m.removedentities { + ids = append(ids, id) + } + return +} + +// EntitiesIDs returns the "entities" edge IDs in the mutation. +func (m *EntityTypeMutation) EntitiesIDs() (ids []string) { + for id := range m.entities { + ids = append(ids, id) + } + return +} + +// ResetEntities resets all changes to the "entities" edge. +func (m *EntityTypeMutation) ResetEntities() { + m.entities = nil + m.clearedentities = false + m.removedentities = nil +} + +// Where appends a list predicates to the EntityTypeMutation builder. +func (m *EntityTypeMutation) Where(ps ...predicate.EntityType) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntityTypeMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntityTypeMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntityType, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntityTypeMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntityTypeMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntityType). +func (m *EntityTypeMutation) 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 *EntityTypeMutation) Fields() []string { + fields := make([]string, 0, 10) + if m.created_at != nil { + fields = append(fields, entitytype.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitytype.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitytype.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitytype.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitytype.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entitytype.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitytype.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entitytype.FieldTags) + } + if m.owner != nil { + fields = append(fields, entitytype.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, entitytype.FieldName) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *EntityTypeMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitytype.FieldCreatedAt: + return m.CreatedAt() + case entitytype.FieldUpdatedAt: + return m.UpdatedAt() + case entitytype.FieldCreatedBy: + return m.CreatedBy() + case entitytype.FieldUpdatedBy: + return m.UpdatedBy() + case entitytype.FieldMappingID: + return m.MappingID() + case entitytype.FieldDeletedAt: + return m.DeletedAt() + case entitytype.FieldDeletedBy: + return m.DeletedBy() + case entitytype.FieldTags: + return m.Tags() + case entitytype.FieldOwnerID: + return m.OwnerID() + case entitytype.FieldName: + return m.Name() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *EntityTypeMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitytype.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitytype.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitytype.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitytype.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitytype.FieldMappingID: + return m.OldMappingID(ctx) + case entitytype.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitytype.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitytype.FieldTags: + return m.OldTags(ctx) + case entitytype.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitytype.FieldName: + return m.OldName(ctx) + } + return nil, fmt.Errorf("unknown EntityType 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 *EntityTypeMutation) SetField(name string, value ent.Value) error { + switch name { + case entitytype.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitytype.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitytype.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitytype.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitytype.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitytype.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitytype.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitytype.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitytype.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitytype.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + } + return fmt.Errorf("unknown EntityType field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntityTypeMutation) 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 *EntityTypeMutation) 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 *EntityTypeMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntityType numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntityTypeMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitytype.FieldCreatedAt) { + fields = append(fields, entitytype.FieldCreatedAt) + } + if m.FieldCleared(entitytype.FieldUpdatedAt) { + fields = append(fields, entitytype.FieldUpdatedAt) + } + if m.FieldCleared(entitytype.FieldCreatedBy) { + fields = append(fields, entitytype.FieldCreatedBy) + } + if m.FieldCleared(entitytype.FieldUpdatedBy) { + fields = append(fields, entitytype.FieldUpdatedBy) + } + if m.FieldCleared(entitytype.FieldDeletedAt) { + fields = append(fields, entitytype.FieldDeletedAt) + } + if m.FieldCleared(entitytype.FieldDeletedBy) { + fields = append(fields, entitytype.FieldDeletedBy) + } + if m.FieldCleared(entitytype.FieldTags) { + fields = append(fields, entitytype.FieldTags) + } + if m.FieldCleared(entitytype.FieldOwnerID) { + fields = append(fields, entitytype.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntityTypeMutation) 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 *EntityTypeMutation) ClearField(name string) error { + switch name { + case entitytype.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitytype.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitytype.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitytype.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitytype.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitytype.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitytype.FieldTags: + m.ClearTags() + return nil + case entitytype.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown EntityType 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 *EntityTypeMutation) ResetField(name string) error { + switch name { + case entitytype.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitytype.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitytype.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitytype.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitytype.FieldMappingID: + m.ResetMappingID() + return nil + case entitytype.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitytype.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitytype.FieldTags: + m.ResetTags() + return nil + case entitytype.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitytype.FieldName: + m.ResetName() + return nil + } + return fmt.Errorf("unknown EntityType field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntityTypeMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.owner != nil { + edges = append(edges, entitytype.EdgeOwner) + } + if m.entities != nil { + edges = append(edges, entitytype.EdgeEntities) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntityTypeMutation) AddedIDs(name string) []ent.Value { + switch name { + case entitytype.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case entitytype.EdgeEntities: + ids := make([]ent.Value, 0, len(m.entities)) + for id := range m.entities { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntityTypeMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedentities != nil { + edges = append(edges, entitytype.EdgeEntities) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntityTypeMutation) RemovedIDs(name string) []ent.Value { + switch name { + case entitytype.EdgeEntities: + ids := make([]ent.Value, 0, len(m.removedentities)) + for id := range m.removedentities { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntityTypeMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedowner { + edges = append(edges, entitytype.EdgeOwner) + } + if m.clearedentities { + edges = append(edges, entitytype.EdgeEntities) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntityTypeMutation) EdgeCleared(name string) bool { + switch name { + case entitytype.EdgeOwner: + return m.clearedowner + case entitytype.EdgeEntities: + return m.clearedentities + } + 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 *EntityTypeMutation) ClearEdge(name string) error { + switch name { + case entitytype.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown EntityType 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 *EntityTypeMutation) ResetEdge(name string) error { + switch name { + case entitytype.EdgeOwner: + m.ResetOwner() + return nil + case entitytype.EdgeEntities: + m.ResetEntities() + return nil + } + return fmt.Errorf("unknown EntityType edge %s", name) +} + +// EntityTypeHistoryMutation represents an operation that mutates the EntityTypeHistory nodes in the graph. +type EntityTypeHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + owner_id *string + name *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*EntityTypeHistory, error) + predicates []predicate.EntityTypeHistory +} + +var _ ent.Mutation = (*EntityTypeHistoryMutation)(nil) + +// entitytypehistoryOption allows management of the mutation configuration using functional options. +type entitytypehistoryOption func(*EntityTypeHistoryMutation) + +// newEntityTypeHistoryMutation creates new mutation for the EntityTypeHistory entity. +func newEntityTypeHistoryMutation(c config, op Op, opts ...entitytypehistoryOption) *EntityTypeHistoryMutation { + m := &EntityTypeHistoryMutation{ + config: c, + op: op, + typ: TypeEntityTypeHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEntityTypeHistoryID sets the ID field of the mutation. +func withEntityTypeHistoryID(id string) entitytypehistoryOption { + return func(m *EntityTypeHistoryMutation) { + var ( + err error + once sync.Once + value *EntityTypeHistory + ) + m.oldValue = func(ctx context.Context) (*EntityTypeHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EntityTypeHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEntityTypeHistory sets the old EntityTypeHistory of the mutation. +func withEntityTypeHistory(node *EntityTypeHistory) entitytypehistoryOption { + return func(m *EntityTypeHistoryMutation) { + m.oldValue = func(context.Context) (*EntityTypeHistory, 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 EntityTypeHistoryMutation) 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 EntityTypeHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EntityTypeHistory entities. +func (m *EntityTypeHistoryMutation) SetID(id string) { + 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 *EntityTypeHistoryMutation) ID() (id string, 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 *EntityTypeHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EntityTypeHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *EntityTypeHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *EntityTypeHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *EntityTypeHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *EntityTypeHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *EntityTypeHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *EntityTypeHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[entitytypehistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *EntityTypeHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, entitytypehistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *EntityTypeHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *EntityTypeHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *EntityTypeHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *EntityTypeHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EntityTypeHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EntityTypeHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[entitytypehistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EntityTypeHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, entitytypehistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EntityTypeHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EntityTypeHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EntityTypeHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[entitytypehistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EntityTypeHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, entitytypehistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EntityTypeHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EntityTypeHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EntityTypeHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[entitytypehistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EntityTypeHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, entitytypehistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EntityTypeHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EntityTypeHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EntityTypeHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[entitytypehistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EntityTypeHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, entitytypehistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EntityTypeHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EntityTypeHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EntityTypeHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *EntityTypeHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *EntityTypeHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *EntityTypeHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[entitytypehistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *EntityTypeHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, entitytypehistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *EntityTypeHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *EntityTypeHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *EntityTypeHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[entitytypehistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *EntityTypeHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, entitytypehistory.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *EntityTypeHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EntityTypeHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EntityTypeHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EntityTypeHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EntityTypeHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[entitytypehistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EntityTypeHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, entitytypehistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *EntityTypeHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *EntityTypeHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *EntityTypeHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[entitytypehistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *EntityTypeHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[entitytypehistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *EntityTypeHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, entitytypehistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *EntityTypeHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *EntityTypeHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the EntityTypeHistory entity. +// If the EntityTypeHistory 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 *EntityTypeHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *EntityTypeHistoryMutation) ResetName() { + m.name = nil +} + +// Where appends a list predicates to the EntityTypeHistoryMutation builder. +func (m *EntityTypeHistoryMutation) Where(ps ...predicate.EntityTypeHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EntityTypeHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EntityTypeHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EntityTypeHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EntityTypeHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EntityTypeHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EntityTypeHistory). +func (m *EntityTypeHistoryMutation) 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 *EntityTypeHistoryMutation) Fields() []string { + fields := make([]string, 0, 13) + if m.history_time != nil { + fields = append(fields, entitytypehistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, entitytypehistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, entitytypehistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, entitytypehistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, entitytypehistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, entitytypehistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, entitytypehistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, entitytypehistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, entitytypehistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, entitytypehistory.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, entitytypehistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, entitytypehistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, entitytypehistory.FieldName) + } + return fields +} + +// Field returns the value of a field with the given name. The second boolean +// return value indicates that this field was not set, or was not defined in the +// schema. +func (m *EntityTypeHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case entitytypehistory.FieldHistoryTime: + return m.HistoryTime() + case entitytypehistory.FieldRef: + return m.Ref() + case entitytypehistory.FieldOperation: + return m.Operation() + case entitytypehistory.FieldCreatedAt: + return m.CreatedAt() + case entitytypehistory.FieldUpdatedAt: + return m.UpdatedAt() + case entitytypehistory.FieldCreatedBy: + return m.CreatedBy() + case entitytypehistory.FieldUpdatedBy: + return m.UpdatedBy() + case entitytypehistory.FieldMappingID: + return m.MappingID() + case entitytypehistory.FieldDeletedAt: + return m.DeletedAt() + case entitytypehistory.FieldDeletedBy: + return m.DeletedBy() + case entitytypehistory.FieldTags: + return m.Tags() + case entitytypehistory.FieldOwnerID: + return m.OwnerID() + case entitytypehistory.FieldName: + return m.Name() + } + return nil, false +} + +// OldField returns the old value of the field from the database. An error is +// returned if the mutation operation is not UpdateOne, or the query to the +// database failed. +func (m *EntityTypeHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case entitytypehistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case entitytypehistory.FieldRef: + return m.OldRef(ctx) + case entitytypehistory.FieldOperation: + return m.OldOperation(ctx) + case entitytypehistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case entitytypehistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case entitytypehistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case entitytypehistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case entitytypehistory.FieldMappingID: + return m.OldMappingID(ctx) + case entitytypehistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case entitytypehistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case entitytypehistory.FieldTags: + return m.OldTags(ctx) + case entitytypehistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case entitytypehistory.FieldName: + return m.OldName(ctx) + } + return nil, fmt.Errorf("unknown EntityTypeHistory 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 *EntityTypeHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case entitytypehistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case entitytypehistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case entitytypehistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case entitytypehistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case entitytypehistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case entitytypehistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case entitytypehistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case entitytypehistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case entitytypehistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case entitytypehistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case entitytypehistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case entitytypehistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case entitytypehistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + } + return fmt.Errorf("unknown EntityTypeHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EntityTypeHistoryMutation) 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 *EntityTypeHistoryMutation) 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 *EntityTypeHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EntityTypeHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EntityTypeHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(entitytypehistory.FieldRef) { + fields = append(fields, entitytypehistory.FieldRef) + } + if m.FieldCleared(entitytypehistory.FieldCreatedAt) { + fields = append(fields, entitytypehistory.FieldCreatedAt) + } + if m.FieldCleared(entitytypehistory.FieldUpdatedAt) { + fields = append(fields, entitytypehistory.FieldUpdatedAt) + } + if m.FieldCleared(entitytypehistory.FieldCreatedBy) { + fields = append(fields, entitytypehistory.FieldCreatedBy) + } + if m.FieldCleared(entitytypehistory.FieldUpdatedBy) { + fields = append(fields, entitytypehistory.FieldUpdatedBy) + } + if m.FieldCleared(entitytypehistory.FieldDeletedAt) { + fields = append(fields, entitytypehistory.FieldDeletedAt) + } + if m.FieldCleared(entitytypehistory.FieldDeletedBy) { + fields = append(fields, entitytypehistory.FieldDeletedBy) + } + if m.FieldCleared(entitytypehistory.FieldTags) { + fields = append(fields, entitytypehistory.FieldTags) + } + if m.FieldCleared(entitytypehistory.FieldOwnerID) { + fields = append(fields, entitytypehistory.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EntityTypeHistoryMutation) 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 *EntityTypeHistoryMutation) ClearField(name string) error { + switch name { + case entitytypehistory.FieldRef: + m.ClearRef() + return nil + case entitytypehistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case entitytypehistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case entitytypehistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case entitytypehistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case entitytypehistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case entitytypehistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case entitytypehistory.FieldTags: + m.ClearTags() + return nil + case entitytypehistory.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown EntityTypeHistory 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 *EntityTypeHistoryMutation) ResetField(name string) error { + switch name { + case entitytypehistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case entitytypehistory.FieldRef: + m.ResetRef() + return nil + case entitytypehistory.FieldOperation: + m.ResetOperation() + return nil + case entitytypehistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case entitytypehistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case entitytypehistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case entitytypehistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case entitytypehistory.FieldMappingID: + m.ResetMappingID() + return nil + case entitytypehistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case entitytypehistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case entitytypehistory.FieldTags: + m.ResetTags() + return nil + case entitytypehistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case entitytypehistory.FieldName: + m.ResetName() + return nil + } + return fmt.Errorf("unknown EntityTypeHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EntityTypeHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EntityTypeHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EntityTypeHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EntityTypeHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EntityTypeHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EntityTypeHistoryMutation) EdgeCleared(name string) bool { + 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 *EntityTypeHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown EntityTypeHistory 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 *EntityTypeHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown EntityTypeHistory edge %s", name) +} + +// EventMutation represents an operation that mutates the Event nodes in the graph. +type EventMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + event_id *string + correlation_id *string + event_type *string + metadata *map[string]interface{} + clearedFields map[string]struct{} + user map[string]struct{} + removeduser map[string]struct{} + cleareduser bool + group map[string]struct{} + removedgroup map[string]struct{} + clearedgroup bool + integration map[string]struct{} + removedintegration map[string]struct{} + clearedintegration bool + organization map[string]struct{} + removedorganization map[string]struct{} + clearedorganization bool + invite map[string]struct{} + removedinvite map[string]struct{} + clearedinvite bool + feature map[string]struct{} + removedfeature map[string]struct{} + clearedfeature bool + entitlementplan map[string]struct{} + removedentitlementplan map[string]struct{} + clearedentitlementplan bool + entitlementplanfeature map[string]struct{} + removedentitlementplanfeature map[string]struct{} + clearedentitlementplanfeature bool + personal_access_token map[string]struct{} + removedpersonal_access_token map[string]struct{} + clearedpersonal_access_token bool + oauth2token map[string]struct{} + removedoauth2token map[string]struct{} + clearedoauth2token bool + hush map[string]struct{} + removedhush map[string]struct{} + clearedhush bool + orgmembership map[string]struct{} + removedorgmembership map[string]struct{} + clearedorgmembership bool + groupmembership map[string]struct{} + removedgroupmembership map[string]struct{} + clearedgroupmembership bool + entitlement map[string]struct{} + removedentitlement map[string]struct{} + clearedentitlement bool + webhook map[string]struct{} + removedwebhook map[string]struct{} + clearedwebhook bool + subscriber map[string]struct{} + removedsubscriber map[string]struct{} + clearedsubscriber bool + done bool + oldValue func(context.Context) (*Event, error) + predicates []predicate.Event +} + +var _ ent.Mutation = (*EventMutation)(nil) + +// eventOption allows management of the mutation configuration using functional options. +type eventOption func(*EventMutation) + +// newEventMutation creates new mutation for the Event entity. +func newEventMutation(c config, op Op, opts ...eventOption) *EventMutation { + m := &EventMutation{ + config: c, + op: op, + typ: TypeEvent, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEventID sets the ID field of the mutation. +func withEventID(id string) eventOption { + return func(m *EventMutation) { + var ( + err error + once sync.Once + value *Event + ) + m.oldValue = func(ctx context.Context) (*Event, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Event.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEvent sets the old Event of the mutation. +func withEvent(node *Event) eventOption { + return func(m *EventMutation) { + m.oldValue = func(context.Context) (*Event, 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 EventMutation) 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 EventMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Event entities. +func (m *EventMutation) SetID(id string) { + 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 *EventMutation) ID() (id string, 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 *EventMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Event.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *EventMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EventMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Event entity. +// If the Event 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 *EventMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EventMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[event.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EventMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[event.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EventMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, event.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EventMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EventMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Event entity. +// If the Event 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 *EventMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EventMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[event.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EventMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[event.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EventMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, event.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EventMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EventMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Event entity. +// If the Event 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 *EventMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EventMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[event.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EventMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[event.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EventMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, event.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EventMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EventMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Event entity. +// If the Event 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 *EventMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EventMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[event.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EventMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[event.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EventMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, event.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EventMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EventMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Event entity. +// If the Event 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 *EventMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EventMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *EventMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EventMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Event entity. +// If the Event 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 *EventMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EventMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EventMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EventMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[event.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EventMutation) TagsCleared() bool { + _, ok := m.clearedFields[event.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EventMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, event.FieldTags) +} + +// SetEventID sets the "event_id" field. +func (m *EventMutation) SetEventID(s string) { + m.event_id = &s +} + +// EventID returns the value of the "event_id" field in the mutation. +func (m *EventMutation) EventID() (r string, exists bool) { + v := m.event_id + if v == nil { + return + } + return *v, true +} + +// OldEventID returns the old "event_id" field's value of the Event entity. +// If the Event 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 *EventMutation) OldEventID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEventID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEventID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEventID: %w", err) + } + return oldValue.EventID, nil +} + +// ClearEventID clears the value of the "event_id" field. +func (m *EventMutation) ClearEventID() { + m.event_id = nil + m.clearedFields[event.FieldEventID] = struct{}{} +} + +// EventIDCleared returns if the "event_id" field was cleared in this mutation. +func (m *EventMutation) EventIDCleared() bool { + _, ok := m.clearedFields[event.FieldEventID] + return ok +} + +// ResetEventID resets all changes to the "event_id" field. +func (m *EventMutation) ResetEventID() { + m.event_id = nil + delete(m.clearedFields, event.FieldEventID) +} + +// SetCorrelationID sets the "correlation_id" field. +func (m *EventMutation) SetCorrelationID(s string) { + m.correlation_id = &s +} + +// CorrelationID returns the value of the "correlation_id" field in the mutation. +func (m *EventMutation) CorrelationID() (r string, exists bool) { + v := m.correlation_id + if v == nil { + return + } + return *v, true +} + +// OldCorrelationID returns the old "correlation_id" field's value of the Event entity. +// If the Event 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 *EventMutation) OldCorrelationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCorrelationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCorrelationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCorrelationID: %w", err) + } + return oldValue.CorrelationID, nil +} + +// ClearCorrelationID clears the value of the "correlation_id" field. +func (m *EventMutation) ClearCorrelationID() { + m.correlation_id = nil + m.clearedFields[event.FieldCorrelationID] = struct{}{} +} + +// CorrelationIDCleared returns if the "correlation_id" field was cleared in this mutation. +func (m *EventMutation) CorrelationIDCleared() bool { + _, ok := m.clearedFields[event.FieldCorrelationID] + return ok +} + +// ResetCorrelationID resets all changes to the "correlation_id" field. +func (m *EventMutation) ResetCorrelationID() { + m.correlation_id = nil + delete(m.clearedFields, event.FieldCorrelationID) +} + +// SetEventType sets the "event_type" field. +func (m *EventMutation) SetEventType(s string) { + m.event_type = &s +} + +// EventType returns the value of the "event_type" field in the mutation. +func (m *EventMutation) EventType() (r string, exists bool) { + v := m.event_type + if v == nil { + return + } + return *v, true +} + +// OldEventType returns the old "event_type" field's value of the Event entity. +// If the Event 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 *EventMutation) OldEventType(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEventType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEventType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEventType: %w", err) + } + return oldValue.EventType, nil +} + +// ResetEventType resets all changes to the "event_type" field. +func (m *EventMutation) ResetEventType() { + m.event_type = nil +} + +// SetMetadata sets the "metadata" field. +func (m *EventMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *EventMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the Event entity. +// If the Event 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 *EventMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *EventMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[event.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *EventMutation) MetadataCleared() bool { + _, ok := m.clearedFields[event.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *EventMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, event.FieldMetadata) +} + +// AddUserIDs adds the "user" edge to the User entity by ids. +func (m *EventMutation) AddUserIDs(ids ...string) { + if m.user == nil { + m.user = make(map[string]struct{}) + } + for i := range ids { + m.user[ids[i]] = struct{}{} + } +} + +// ClearUser clears the "user" edge to the User entity. +func (m *EventMutation) ClearUser() { + m.cleareduser = true +} + +// UserCleared reports if the "user" edge to the User entity was cleared. +func (m *EventMutation) UserCleared() bool { + return m.cleareduser +} + +// RemoveUserIDs removes the "user" edge to the User entity by IDs. +func (m *EventMutation) RemoveUserIDs(ids ...string) { + if m.removeduser == nil { + m.removeduser = make(map[string]struct{}) + } + for i := range ids { + delete(m.user, ids[i]) + m.removeduser[ids[i]] = struct{}{} + } +} + +// RemovedUser returns the removed IDs of the "user" edge to the User entity. +func (m *EventMutation) RemovedUserIDs() (ids []string) { + for id := range m.removeduser { + ids = append(ids, id) + } + return +} + +// UserIDs returns the "user" edge IDs in the mutation. +func (m *EventMutation) UserIDs() (ids []string) { + for id := range m.user { + ids = append(ids, id) + } + return +} + +// ResetUser resets all changes to the "user" edge. +func (m *EventMutation) ResetUser() { + m.user = nil + m.cleareduser = false + m.removeduser = nil +} + +// AddGroupIDs adds the "group" edge to the Group entity by ids. +func (m *EventMutation) AddGroupIDs(ids ...string) { + if m.group == nil { + m.group = make(map[string]struct{}) + } + for i := range ids { + m.group[ids[i]] = struct{}{} + } +} + +// ClearGroup clears the "group" edge to the Group entity. +func (m *EventMutation) ClearGroup() { + m.clearedgroup = true +} + +// GroupCleared reports if the "group" edge to the Group entity was cleared. +func (m *EventMutation) GroupCleared() bool { + return m.clearedgroup +} + +// RemoveGroupIDs removes the "group" edge to the Group entity by IDs. +func (m *EventMutation) RemoveGroupIDs(ids ...string) { + if m.removedgroup == nil { + m.removedgroup = make(map[string]struct{}) + } + for i := range ids { + delete(m.group, ids[i]) + m.removedgroup[ids[i]] = struct{}{} + } +} + +// RemovedGroup returns the removed IDs of the "group" edge to the Group entity. +func (m *EventMutation) RemovedGroupIDs() (ids []string) { + for id := range m.removedgroup { + ids = append(ids, id) + } + return +} + +// GroupIDs returns the "group" edge IDs in the mutation. +func (m *EventMutation) GroupIDs() (ids []string) { + for id := range m.group { + ids = append(ids, id) + } + return +} + +// ResetGroup resets all changes to the "group" edge. +func (m *EventMutation) ResetGroup() { + m.group = nil + m.clearedgroup = false + m.removedgroup = nil +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by ids. +func (m *EventMutation) AddIntegrationIDs(ids ...string) { + if m.integration == nil { + m.integration = make(map[string]struct{}) + } + for i := range ids { + m.integration[ids[i]] = struct{}{} + } +} + +// ClearIntegration clears the "integration" edge to the Integration entity. +func (m *EventMutation) ClearIntegration() { + m.clearedintegration = true +} + +// IntegrationCleared reports if the "integration" edge to the Integration entity was cleared. +func (m *EventMutation) IntegrationCleared() bool { + return m.clearedintegration +} + +// RemoveIntegrationIDs removes the "integration" edge to the Integration entity by IDs. +func (m *EventMutation) RemoveIntegrationIDs(ids ...string) { + if m.removedintegration == nil { + m.removedintegration = make(map[string]struct{}) + } + for i := range ids { + delete(m.integration, ids[i]) + m.removedintegration[ids[i]] = struct{}{} + } +} + +// RemovedIntegration returns the removed IDs of the "integration" edge to the Integration entity. +func (m *EventMutation) RemovedIntegrationIDs() (ids []string) { + for id := range m.removedintegration { + ids = append(ids, id) + } + return +} + +// IntegrationIDs returns the "integration" edge IDs in the mutation. +func (m *EventMutation) IntegrationIDs() (ids []string) { + for id := range m.integration { + ids = append(ids, id) + } + return +} + +// ResetIntegration resets all changes to the "integration" edge. +func (m *EventMutation) ResetIntegration() { + m.integration = nil + m.clearedintegration = false + m.removedintegration = nil +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by ids. +func (m *EventMutation) AddOrganizationIDs(ids ...string) { + if m.organization == nil { + m.organization = make(map[string]struct{}) + } + for i := range ids { + m.organization[ids[i]] = struct{}{} + } +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (m *EventMutation) ClearOrganization() { + m.clearedorganization = true +} + +// OrganizationCleared reports if the "organization" edge to the Organization entity was cleared. +func (m *EventMutation) OrganizationCleared() bool { + return m.clearedorganization +} + +// RemoveOrganizationIDs removes the "organization" edge to the Organization entity by IDs. +func (m *EventMutation) RemoveOrganizationIDs(ids ...string) { + if m.removedorganization == nil { + m.removedorganization = make(map[string]struct{}) + } + for i := range ids { + delete(m.organization, ids[i]) + m.removedorganization[ids[i]] = struct{}{} + } +} + +// RemovedOrganization returns the removed IDs of the "organization" edge to the Organization entity. +func (m *EventMutation) RemovedOrganizationIDs() (ids []string) { + for id := range m.removedorganization { + ids = append(ids, id) + } + return +} + +// OrganizationIDs returns the "organization" edge IDs in the mutation. +func (m *EventMutation) OrganizationIDs() (ids []string) { + for id := range m.organization { + ids = append(ids, id) + } + return +} + +// ResetOrganization resets all changes to the "organization" edge. +func (m *EventMutation) ResetOrganization() { + m.organization = nil + m.clearedorganization = false + m.removedorganization = nil +} + +// AddInviteIDs adds the "invite" edge to the Invite entity by ids. +func (m *EventMutation) AddInviteIDs(ids ...string) { + if m.invite == nil { + m.invite = make(map[string]struct{}) + } + for i := range ids { + m.invite[ids[i]] = struct{}{} + } +} + +// ClearInvite clears the "invite" edge to the Invite entity. +func (m *EventMutation) ClearInvite() { + m.clearedinvite = true +} + +// InviteCleared reports if the "invite" edge to the Invite entity was cleared. +func (m *EventMutation) InviteCleared() bool { + return m.clearedinvite +} + +// RemoveInviteIDs removes the "invite" edge to the Invite entity by IDs. +func (m *EventMutation) RemoveInviteIDs(ids ...string) { + if m.removedinvite == nil { + m.removedinvite = make(map[string]struct{}) + } + for i := range ids { + delete(m.invite, ids[i]) + m.removedinvite[ids[i]] = struct{}{} + } +} + +// RemovedInvite returns the removed IDs of the "invite" edge to the Invite entity. +func (m *EventMutation) RemovedInviteIDs() (ids []string) { + for id := range m.removedinvite { + ids = append(ids, id) + } + return +} + +// InviteIDs returns the "invite" edge IDs in the mutation. +func (m *EventMutation) InviteIDs() (ids []string) { + for id := range m.invite { + ids = append(ids, id) + } + return +} + +// ResetInvite resets all changes to the "invite" edge. +func (m *EventMutation) ResetInvite() { + m.invite = nil + m.clearedinvite = false + m.removedinvite = nil +} + +// AddFeatureIDs adds the "feature" edge to the Feature entity by ids. +func (m *EventMutation) AddFeatureIDs(ids ...string) { + if m.feature == nil { + m.feature = make(map[string]struct{}) + } + for i := range ids { + m.feature[ids[i]] = struct{}{} + } +} + +// ClearFeature clears the "feature" edge to the Feature entity. +func (m *EventMutation) ClearFeature() { + m.clearedfeature = true +} + +// FeatureCleared reports if the "feature" edge to the Feature entity was cleared. +func (m *EventMutation) FeatureCleared() bool { + return m.clearedfeature +} + +// RemoveFeatureIDs removes the "feature" edge to the Feature entity by IDs. +func (m *EventMutation) RemoveFeatureIDs(ids ...string) { + if m.removedfeature == nil { + m.removedfeature = make(map[string]struct{}) + } + for i := range ids { + delete(m.feature, ids[i]) + m.removedfeature[ids[i]] = struct{}{} + } +} + +// RemovedFeature returns the removed IDs of the "feature" edge to the Feature entity. +func (m *EventMutation) RemovedFeatureIDs() (ids []string) { + for id := range m.removedfeature { + ids = append(ids, id) + } + return +} + +// FeatureIDs returns the "feature" edge IDs in the mutation. +func (m *EventMutation) FeatureIDs() (ids []string) { + for id := range m.feature { + ids = append(ids, id) + } + return +} + +// ResetFeature resets all changes to the "feature" edge. +func (m *EventMutation) ResetFeature() { + m.feature = nil + m.clearedfeature = false + m.removedfeature = nil +} + +// AddEntitlementplanIDs adds the "entitlementplan" edge to the EntitlementPlan entity by ids. +func (m *EventMutation) AddEntitlementplanIDs(ids ...string) { + if m.entitlementplan == nil { + m.entitlementplan = make(map[string]struct{}) + } + for i := range ids { + m.entitlementplan[ids[i]] = struct{}{} + } +} + +// ClearEntitlementplan clears the "entitlementplan" edge to the EntitlementPlan entity. +func (m *EventMutation) ClearEntitlementplan() { + m.clearedentitlementplan = true +} + +// EntitlementplanCleared reports if the "entitlementplan" edge to the EntitlementPlan entity was cleared. +func (m *EventMutation) EntitlementplanCleared() bool { + return m.clearedentitlementplan +} + +// RemoveEntitlementplanIDs removes the "entitlementplan" edge to the EntitlementPlan entity by IDs. +func (m *EventMutation) RemoveEntitlementplanIDs(ids ...string) { + if m.removedentitlementplan == nil { + m.removedentitlementplan = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitlementplan, ids[i]) + m.removedentitlementplan[ids[i]] = struct{}{} + } +} + +// RemovedEntitlementplan returns the removed IDs of the "entitlementplan" edge to the EntitlementPlan entity. +func (m *EventMutation) RemovedEntitlementplanIDs() (ids []string) { + for id := range m.removedentitlementplan { + ids = append(ids, id) + } + return +} + +// EntitlementplanIDs returns the "entitlementplan" edge IDs in the mutation. +func (m *EventMutation) EntitlementplanIDs() (ids []string) { + for id := range m.entitlementplan { + ids = append(ids, id) + } + return +} + +// ResetEntitlementplan resets all changes to the "entitlementplan" edge. +func (m *EventMutation) ResetEntitlementplan() { + m.entitlementplan = nil + m.clearedentitlementplan = false + m.removedentitlementplan = nil +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeature" edge to the EntitlementPlanFeature entity by ids. +func (m *EventMutation) AddEntitlementplanfeatureIDs(ids ...string) { + if m.entitlementplanfeature == nil { + m.entitlementplanfeature = make(map[string]struct{}) + } + for i := range ids { + m.entitlementplanfeature[ids[i]] = struct{}{} + } +} + +// ClearEntitlementplanfeature clears the "entitlementplanfeature" edge to the EntitlementPlanFeature entity. +func (m *EventMutation) ClearEntitlementplanfeature() { + m.clearedentitlementplanfeature = true +} + +// EntitlementplanfeatureCleared reports if the "entitlementplanfeature" edge to the EntitlementPlanFeature entity was cleared. +func (m *EventMutation) EntitlementplanfeatureCleared() bool { + return m.clearedentitlementplanfeature +} + +// RemoveEntitlementplanfeatureIDs removes the "entitlementplanfeature" edge to the EntitlementPlanFeature entity by IDs. +func (m *EventMutation) RemoveEntitlementplanfeatureIDs(ids ...string) { + if m.removedentitlementplanfeature == nil { + m.removedentitlementplanfeature = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitlementplanfeature, ids[i]) + m.removedentitlementplanfeature[ids[i]] = struct{}{} + } +} + +// RemovedEntitlementplanfeature returns the removed IDs of the "entitlementplanfeature" edge to the EntitlementPlanFeature entity. +func (m *EventMutation) RemovedEntitlementplanfeatureIDs() (ids []string) { + for id := range m.removedentitlementplanfeature { + ids = append(ids, id) + } + return +} + +// EntitlementplanfeatureIDs returns the "entitlementplanfeature" edge IDs in the mutation. +func (m *EventMutation) EntitlementplanfeatureIDs() (ids []string) { + for id := range m.entitlementplanfeature { + ids = append(ids, id) + } + return +} + +// ResetEntitlementplanfeature resets all changes to the "entitlementplanfeature" edge. +func (m *EventMutation) ResetEntitlementplanfeature() { + m.entitlementplanfeature = nil + m.clearedentitlementplanfeature = false + m.removedentitlementplanfeature = nil +} + +// AddPersonalAccessTokenIDs adds the "personal_access_token" edge to the PersonalAccessToken entity by ids. +func (m *EventMutation) AddPersonalAccessTokenIDs(ids ...string) { + if m.personal_access_token == nil { + m.personal_access_token = make(map[string]struct{}) + } + for i := range ids { + m.personal_access_token[ids[i]] = struct{}{} + } +} + +// ClearPersonalAccessToken clears the "personal_access_token" edge to the PersonalAccessToken entity. +func (m *EventMutation) ClearPersonalAccessToken() { + m.clearedpersonal_access_token = true +} + +// PersonalAccessTokenCleared reports if the "personal_access_token" edge to the PersonalAccessToken entity was cleared. +func (m *EventMutation) PersonalAccessTokenCleared() bool { + return m.clearedpersonal_access_token +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_token" edge to the PersonalAccessToken entity by IDs. +func (m *EventMutation) RemovePersonalAccessTokenIDs(ids ...string) { + if m.removedpersonal_access_token == nil { + m.removedpersonal_access_token = make(map[string]struct{}) + } + for i := range ids { + delete(m.personal_access_token, ids[i]) + m.removedpersonal_access_token[ids[i]] = struct{}{} + } +} + +// RemovedPersonalAccessToken returns the removed IDs of the "personal_access_token" edge to the PersonalAccessToken entity. +func (m *EventMutation) RemovedPersonalAccessTokenIDs() (ids []string) { + for id := range m.removedpersonal_access_token { + ids = append(ids, id) + } + return +} + +// PersonalAccessTokenIDs returns the "personal_access_token" edge IDs in the mutation. +func (m *EventMutation) PersonalAccessTokenIDs() (ids []string) { + for id := range m.personal_access_token { + ids = append(ids, id) + } + return +} + +// ResetPersonalAccessToken resets all changes to the "personal_access_token" edge. +func (m *EventMutation) ResetPersonalAccessToken() { + m.personal_access_token = nil + m.clearedpersonal_access_token = false + m.removedpersonal_access_token = nil +} + +// AddOauth2tokenIDs adds the "oauth2token" edge to the OhAuthTooToken entity by ids. +func (m *EventMutation) AddOauth2tokenIDs(ids ...string) { + if m.oauth2token == nil { + m.oauth2token = make(map[string]struct{}) + } + for i := range ids { + m.oauth2token[ids[i]] = struct{}{} + } +} + +// ClearOauth2token clears the "oauth2token" edge to the OhAuthTooToken entity. +func (m *EventMutation) ClearOauth2token() { + m.clearedoauth2token = true +} + +// Oauth2tokenCleared reports if the "oauth2token" edge to the OhAuthTooToken entity was cleared. +func (m *EventMutation) Oauth2tokenCleared() bool { + return m.clearedoauth2token +} + +// RemoveOauth2tokenIDs removes the "oauth2token" edge to the OhAuthTooToken entity by IDs. +func (m *EventMutation) RemoveOauth2tokenIDs(ids ...string) { + if m.removedoauth2token == nil { + m.removedoauth2token = make(map[string]struct{}) + } + for i := range ids { + delete(m.oauth2token, ids[i]) + m.removedoauth2token[ids[i]] = struct{}{} + } +} + +// RemovedOauth2token returns the removed IDs of the "oauth2token" edge to the OhAuthTooToken entity. +func (m *EventMutation) RemovedOauth2tokenIDs() (ids []string) { + for id := range m.removedoauth2token { + ids = append(ids, id) + } + return +} + +// Oauth2tokenIDs returns the "oauth2token" edge IDs in the mutation. +func (m *EventMutation) Oauth2tokenIDs() (ids []string) { + for id := range m.oauth2token { + ids = append(ids, id) + } + return +} + +// ResetOauth2token resets all changes to the "oauth2token" edge. +func (m *EventMutation) ResetOauth2token() { + m.oauth2token = nil + m.clearedoauth2token = false + m.removedoauth2token = nil +} + +// AddHushIDs adds the "hush" edge to the Hush entity by ids. +func (m *EventMutation) AddHushIDs(ids ...string) { + if m.hush == nil { + m.hush = make(map[string]struct{}) + } + for i := range ids { + m.hush[ids[i]] = struct{}{} + } +} + +// ClearHush clears the "hush" edge to the Hush entity. +func (m *EventMutation) ClearHush() { + m.clearedhush = true +} + +// HushCleared reports if the "hush" edge to the Hush entity was cleared. +func (m *EventMutation) HushCleared() bool { + return m.clearedhush +} + +// RemoveHushIDs removes the "hush" edge to the Hush entity by IDs. +func (m *EventMutation) RemoveHushIDs(ids ...string) { + if m.removedhush == nil { + m.removedhush = make(map[string]struct{}) + } + for i := range ids { + delete(m.hush, ids[i]) + m.removedhush[ids[i]] = struct{}{} + } +} + +// RemovedHush returns the removed IDs of the "hush" edge to the Hush entity. +func (m *EventMutation) RemovedHushIDs() (ids []string) { + for id := range m.removedhush { + ids = append(ids, id) + } + return +} + +// HushIDs returns the "hush" edge IDs in the mutation. +func (m *EventMutation) HushIDs() (ids []string) { + for id := range m.hush { + ids = append(ids, id) + } + return +} + +// ResetHush resets all changes to the "hush" edge. +func (m *EventMutation) ResetHush() { + m.hush = nil + m.clearedhush = false + m.removedhush = nil +} + +// AddOrgmembershipIDs adds the "orgmembership" edge to the OrgMembership entity by ids. +func (m *EventMutation) AddOrgmembershipIDs(ids ...string) { + if m.orgmembership == nil { + m.orgmembership = make(map[string]struct{}) + } + for i := range ids { + m.orgmembership[ids[i]] = struct{}{} + } +} + +// ClearOrgmembership clears the "orgmembership" edge to the OrgMembership entity. +func (m *EventMutation) ClearOrgmembership() { + m.clearedorgmembership = true +} + +// OrgmembershipCleared reports if the "orgmembership" edge to the OrgMembership entity was cleared. +func (m *EventMutation) OrgmembershipCleared() bool { + return m.clearedorgmembership +} + +// RemoveOrgmembershipIDs removes the "orgmembership" edge to the OrgMembership entity by IDs. +func (m *EventMutation) RemoveOrgmembershipIDs(ids ...string) { + if m.removedorgmembership == nil { + m.removedorgmembership = make(map[string]struct{}) + } + for i := range ids { + delete(m.orgmembership, ids[i]) + m.removedorgmembership[ids[i]] = struct{}{} + } +} + +// RemovedOrgmembership returns the removed IDs of the "orgmembership" edge to the OrgMembership entity. +func (m *EventMutation) RemovedOrgmembershipIDs() (ids []string) { + for id := range m.removedorgmembership { + ids = append(ids, id) + } + return +} + +// OrgmembershipIDs returns the "orgmembership" edge IDs in the mutation. +func (m *EventMutation) OrgmembershipIDs() (ids []string) { + for id := range m.orgmembership { + ids = append(ids, id) + } + return +} + +// ResetOrgmembership resets all changes to the "orgmembership" edge. +func (m *EventMutation) ResetOrgmembership() { + m.orgmembership = nil + m.clearedorgmembership = false + m.removedorgmembership = nil +} + +// AddGroupmembershipIDs adds the "groupmembership" edge to the GroupMembership entity by ids. +func (m *EventMutation) AddGroupmembershipIDs(ids ...string) { + if m.groupmembership == nil { + m.groupmembership = make(map[string]struct{}) + } + for i := range ids { + m.groupmembership[ids[i]] = struct{}{} + } +} + +// ClearGroupmembership clears the "groupmembership" edge to the GroupMembership entity. +func (m *EventMutation) ClearGroupmembership() { + m.clearedgroupmembership = true +} + +// GroupmembershipCleared reports if the "groupmembership" edge to the GroupMembership entity was cleared. +func (m *EventMutation) GroupmembershipCleared() bool { + return m.clearedgroupmembership +} + +// RemoveGroupmembershipIDs removes the "groupmembership" edge to the GroupMembership entity by IDs. +func (m *EventMutation) RemoveGroupmembershipIDs(ids ...string) { + if m.removedgroupmembership == nil { + m.removedgroupmembership = make(map[string]struct{}) + } + for i := range ids { + delete(m.groupmembership, ids[i]) + m.removedgroupmembership[ids[i]] = struct{}{} + } +} + +// RemovedGroupmembership returns the removed IDs of the "groupmembership" edge to the GroupMembership entity. +func (m *EventMutation) RemovedGroupmembershipIDs() (ids []string) { + for id := range m.removedgroupmembership { + ids = append(ids, id) + } + return +} + +// GroupmembershipIDs returns the "groupmembership" edge IDs in the mutation. +func (m *EventMutation) GroupmembershipIDs() (ids []string) { + for id := range m.groupmembership { + ids = append(ids, id) + } + return +} + +// ResetGroupmembership resets all changes to the "groupmembership" edge. +func (m *EventMutation) ResetGroupmembership() { + m.groupmembership = nil + m.clearedgroupmembership = false + m.removedgroupmembership = nil +} + +// AddEntitlementIDs adds the "entitlement" edge to the Entitlement entity by ids. +func (m *EventMutation) AddEntitlementIDs(ids ...string) { + if m.entitlement == nil { + m.entitlement = make(map[string]struct{}) + } + for i := range ids { + m.entitlement[ids[i]] = struct{}{} + } +} + +// ClearEntitlement clears the "entitlement" edge to the Entitlement entity. +func (m *EventMutation) ClearEntitlement() { + m.clearedentitlement = true +} + +// EntitlementCleared reports if the "entitlement" edge to the Entitlement entity was cleared. +func (m *EventMutation) EntitlementCleared() bool { + return m.clearedentitlement +} + +// RemoveEntitlementIDs removes the "entitlement" edge to the Entitlement entity by IDs. +func (m *EventMutation) RemoveEntitlementIDs(ids ...string) { + if m.removedentitlement == nil { + m.removedentitlement = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitlement, ids[i]) + m.removedentitlement[ids[i]] = struct{}{} + } +} + +// RemovedEntitlement returns the removed IDs of the "entitlement" edge to the Entitlement entity. +func (m *EventMutation) RemovedEntitlementIDs() (ids []string) { + for id := range m.removedentitlement { + ids = append(ids, id) + } + return +} + +// EntitlementIDs returns the "entitlement" edge IDs in the mutation. +func (m *EventMutation) EntitlementIDs() (ids []string) { + for id := range m.entitlement { + ids = append(ids, id) + } + return +} + +// ResetEntitlement resets all changes to the "entitlement" edge. +func (m *EventMutation) ResetEntitlement() { + m.entitlement = nil + m.clearedentitlement = false + m.removedentitlement = nil +} + +// AddWebhookIDs adds the "webhook" edge to the Webhook entity by ids. +func (m *EventMutation) AddWebhookIDs(ids ...string) { + if m.webhook == nil { + m.webhook = make(map[string]struct{}) + } + for i := range ids { + m.webhook[ids[i]] = struct{}{} + } +} + +// ClearWebhook clears the "webhook" edge to the Webhook entity. +func (m *EventMutation) ClearWebhook() { + m.clearedwebhook = true +} + +// WebhookCleared reports if the "webhook" edge to the Webhook entity was cleared. +func (m *EventMutation) WebhookCleared() bool { + return m.clearedwebhook +} + +// RemoveWebhookIDs removes the "webhook" edge to the Webhook entity by IDs. +func (m *EventMutation) RemoveWebhookIDs(ids ...string) { + if m.removedwebhook == nil { + m.removedwebhook = make(map[string]struct{}) + } + for i := range ids { + delete(m.webhook, ids[i]) + m.removedwebhook[ids[i]] = struct{}{} + } +} + +// RemovedWebhook returns the removed IDs of the "webhook" edge to the Webhook entity. +func (m *EventMutation) RemovedWebhookIDs() (ids []string) { + for id := range m.removedwebhook { + ids = append(ids, id) + } + return +} + +// WebhookIDs returns the "webhook" edge IDs in the mutation. +func (m *EventMutation) WebhookIDs() (ids []string) { + for id := range m.webhook { + ids = append(ids, id) + } + return +} + +// ResetWebhook resets all changes to the "webhook" edge. +func (m *EventMutation) ResetWebhook() { + m.webhook = nil + m.clearedwebhook = false + m.removedwebhook = nil +} + +// AddSubscriberIDs adds the "subscriber" edge to the Subscriber entity by ids. +func (m *EventMutation) AddSubscriberIDs(ids ...string) { + if m.subscriber == nil { + m.subscriber = make(map[string]struct{}) + } + for i := range ids { + m.subscriber[ids[i]] = struct{}{} + } +} + +// ClearSubscriber clears the "subscriber" edge to the Subscriber entity. +func (m *EventMutation) ClearSubscriber() { + m.clearedsubscriber = true +} + +// SubscriberCleared reports if the "subscriber" edge to the Subscriber entity was cleared. +func (m *EventMutation) SubscriberCleared() bool { + return m.clearedsubscriber +} + +// RemoveSubscriberIDs removes the "subscriber" edge to the Subscriber entity by IDs. +func (m *EventMutation) RemoveSubscriberIDs(ids ...string) { + if m.removedsubscriber == nil { + m.removedsubscriber = make(map[string]struct{}) + } + for i := range ids { + delete(m.subscriber, ids[i]) + m.removedsubscriber[ids[i]] = struct{}{} + } +} + +// RemovedSubscriber returns the removed IDs of the "subscriber" edge to the Subscriber entity. +func (m *EventMutation) RemovedSubscriberIDs() (ids []string) { + for id := range m.removedsubscriber { + ids = append(ids, id) + } + return +} + +// SubscriberIDs returns the "subscriber" edge IDs in the mutation. +func (m *EventMutation) SubscriberIDs() (ids []string) { + for id := range m.subscriber { + ids = append(ids, id) + } + return +} + +// ResetSubscriber resets all changes to the "subscriber" edge. +func (m *EventMutation) ResetSubscriber() { + m.subscriber = nil + m.clearedsubscriber = false + m.removedsubscriber = nil +} + +// Where appends a list predicates to the EventMutation builder. +func (m *EventMutation) Where(ps ...predicate.Event) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EventMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EventMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Event, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EventMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EventMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Event). +func (m *EventMutation) 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 *EventMutation) Fields() []string { + fields := make([]string, 0, 10) + if m.created_at != nil { + fields = append(fields, event.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, event.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, event.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, event.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, event.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, event.FieldTags) + } + if m.event_id != nil { + fields = append(fields, event.FieldEventID) + } + if m.correlation_id != nil { + fields = append(fields, event.FieldCorrelationID) + } + if m.event_type != nil { + fields = append(fields, event.FieldEventType) + } + if m.metadata != nil { + fields = append(fields, event.FieldMetadata) + } + 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 *EventMutation) Field(name string) (ent.Value, bool) { + switch name { + case event.FieldCreatedAt: + return m.CreatedAt() + case event.FieldUpdatedAt: + return m.UpdatedAt() + case event.FieldCreatedBy: + return m.CreatedBy() + case event.FieldUpdatedBy: + return m.UpdatedBy() + case event.FieldMappingID: + return m.MappingID() + case event.FieldTags: + return m.Tags() + case event.FieldEventID: + return m.EventID() + case event.FieldCorrelationID: + return m.CorrelationID() + case event.FieldEventType: + return m.EventType() + case event.FieldMetadata: + return m.Metadata() + } + 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 *EventMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case event.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case event.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case event.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case event.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case event.FieldMappingID: + return m.OldMappingID(ctx) + case event.FieldTags: + return m.OldTags(ctx) + case event.FieldEventID: + return m.OldEventID(ctx) + case event.FieldCorrelationID: + return m.OldCorrelationID(ctx) + case event.FieldEventType: + return m.OldEventType(ctx) + case event.FieldMetadata: + return m.OldMetadata(ctx) + } + return nil, fmt.Errorf("unknown Event 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 *EventMutation) SetField(name string, value ent.Value) error { + switch name { + case event.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case event.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case event.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case event.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case event.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case event.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case event.FieldEventID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEventID(v) + return nil + case event.FieldCorrelationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCorrelationID(v) + return nil + case event.FieldEventType: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEventType(v) + return nil + case event.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + } + return fmt.Errorf("unknown Event field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EventMutation) 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 *EventMutation) 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 *EventMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Event numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EventMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(event.FieldCreatedAt) { + fields = append(fields, event.FieldCreatedAt) + } + if m.FieldCleared(event.FieldUpdatedAt) { + fields = append(fields, event.FieldUpdatedAt) + } + if m.FieldCleared(event.FieldCreatedBy) { + fields = append(fields, event.FieldCreatedBy) + } + if m.FieldCleared(event.FieldUpdatedBy) { + fields = append(fields, event.FieldUpdatedBy) + } + if m.FieldCleared(event.FieldTags) { + fields = append(fields, event.FieldTags) + } + if m.FieldCleared(event.FieldEventID) { + fields = append(fields, event.FieldEventID) + } + if m.FieldCleared(event.FieldCorrelationID) { + fields = append(fields, event.FieldCorrelationID) + } + if m.FieldCleared(event.FieldMetadata) { + fields = append(fields, event.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EventMutation) 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 *EventMutation) ClearField(name string) error { + switch name { + case event.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case event.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case event.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case event.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case event.FieldTags: + m.ClearTags() + return nil + case event.FieldEventID: + m.ClearEventID() + return nil + case event.FieldCorrelationID: + m.ClearCorrelationID() + return nil + case event.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown Event 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 *EventMutation) ResetField(name string) error { + switch name { + case event.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case event.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case event.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case event.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case event.FieldMappingID: + m.ResetMappingID() + return nil + case event.FieldTags: + m.ResetTags() + return nil + case event.FieldEventID: + m.ResetEventID() + return nil + case event.FieldCorrelationID: + m.ResetCorrelationID() + return nil + case event.FieldEventType: + m.ResetEventType() + return nil + case event.FieldMetadata: + m.ResetMetadata() + return nil + } + return fmt.Errorf("unknown Event field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EventMutation) AddedEdges() []string { + edges := make([]string, 0, 16) + if m.user != nil { + edges = append(edges, event.EdgeUser) + } + if m.group != nil { + edges = append(edges, event.EdgeGroup) + } + if m.integration != nil { + edges = append(edges, event.EdgeIntegration) + } + if m.organization != nil { + edges = append(edges, event.EdgeOrganization) + } + if m.invite != nil { + edges = append(edges, event.EdgeInvite) + } + if m.feature != nil { + edges = append(edges, event.EdgeFeature) + } + if m.entitlementplan != nil { + edges = append(edges, event.EdgeEntitlementplan) + } + if m.entitlementplanfeature != nil { + edges = append(edges, event.EdgeEntitlementplanfeature) + } + if m.personal_access_token != nil { + edges = append(edges, event.EdgePersonalAccessToken) + } + if m.oauth2token != nil { + edges = append(edges, event.EdgeOauth2token) + } + if m.hush != nil { + edges = append(edges, event.EdgeHush) + } + if m.orgmembership != nil { + edges = append(edges, event.EdgeOrgmembership) + } + if m.groupmembership != nil { + edges = append(edges, event.EdgeGroupmembership) + } + if m.entitlement != nil { + edges = append(edges, event.EdgeEntitlement) + } + if m.webhook != nil { + edges = append(edges, event.EdgeWebhook) + } + if m.subscriber != nil { + edges = append(edges, event.EdgeSubscriber) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EventMutation) AddedIDs(name string) []ent.Value { + switch name { + case event.EdgeUser: + ids := make([]ent.Value, 0, len(m.user)) + for id := range m.user { + ids = append(ids, id) + } + return ids + case event.EdgeGroup: + ids := make([]ent.Value, 0, len(m.group)) + for id := range m.group { + ids = append(ids, id) + } + return ids + case event.EdgeIntegration: + ids := make([]ent.Value, 0, len(m.integration)) + for id := range m.integration { + ids = append(ids, id) + } + return ids + case event.EdgeOrganization: + ids := make([]ent.Value, 0, len(m.organization)) + for id := range m.organization { + ids = append(ids, id) + } + return ids + case event.EdgeInvite: + ids := make([]ent.Value, 0, len(m.invite)) + for id := range m.invite { + ids = append(ids, id) + } + return ids + case event.EdgeFeature: + ids := make([]ent.Value, 0, len(m.feature)) + for id := range m.feature { + ids = append(ids, id) + } + return ids + case event.EdgeEntitlementplan: + ids := make([]ent.Value, 0, len(m.entitlementplan)) + for id := range m.entitlementplan { + ids = append(ids, id) + } + return ids + case event.EdgeEntitlementplanfeature: + ids := make([]ent.Value, 0, len(m.entitlementplanfeature)) + for id := range m.entitlementplanfeature { + ids = append(ids, id) + } + return ids + case event.EdgePersonalAccessToken: + ids := make([]ent.Value, 0, len(m.personal_access_token)) + for id := range m.personal_access_token { + ids = append(ids, id) + } + return ids + case event.EdgeOauth2token: + ids := make([]ent.Value, 0, len(m.oauth2token)) + for id := range m.oauth2token { + ids = append(ids, id) + } + return ids + case event.EdgeHush: + ids := make([]ent.Value, 0, len(m.hush)) + for id := range m.hush { + ids = append(ids, id) + } + return ids + case event.EdgeOrgmembership: + ids := make([]ent.Value, 0, len(m.orgmembership)) + for id := range m.orgmembership { + ids = append(ids, id) + } + return ids + case event.EdgeGroupmembership: + ids := make([]ent.Value, 0, len(m.groupmembership)) + for id := range m.groupmembership { + ids = append(ids, id) + } + return ids + case event.EdgeEntitlement: + ids := make([]ent.Value, 0, len(m.entitlement)) + for id := range m.entitlement { + ids = append(ids, id) + } + return ids + case event.EdgeWebhook: + ids := make([]ent.Value, 0, len(m.webhook)) + for id := range m.webhook { + ids = append(ids, id) + } + return ids + case event.EdgeSubscriber: + ids := make([]ent.Value, 0, len(m.subscriber)) + for id := range m.subscriber { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EventMutation) RemovedEdges() []string { + edges := make([]string, 0, 16) + if m.removeduser != nil { + edges = append(edges, event.EdgeUser) + } + if m.removedgroup != nil { + edges = append(edges, event.EdgeGroup) + } + if m.removedintegration != nil { + edges = append(edges, event.EdgeIntegration) + } + if m.removedorganization != nil { + edges = append(edges, event.EdgeOrganization) + } + if m.removedinvite != nil { + edges = append(edges, event.EdgeInvite) + } + if m.removedfeature != nil { + edges = append(edges, event.EdgeFeature) + } + if m.removedentitlementplan != nil { + edges = append(edges, event.EdgeEntitlementplan) + } + if m.removedentitlementplanfeature != nil { + edges = append(edges, event.EdgeEntitlementplanfeature) + } + if m.removedpersonal_access_token != nil { + edges = append(edges, event.EdgePersonalAccessToken) + } + if m.removedoauth2token != nil { + edges = append(edges, event.EdgeOauth2token) + } + if m.removedhush != nil { + edges = append(edges, event.EdgeHush) + } + if m.removedorgmembership != nil { + edges = append(edges, event.EdgeOrgmembership) + } + if m.removedgroupmembership != nil { + edges = append(edges, event.EdgeGroupmembership) + } + if m.removedentitlement != nil { + edges = append(edges, event.EdgeEntitlement) + } + if m.removedwebhook != nil { + edges = append(edges, event.EdgeWebhook) + } + if m.removedsubscriber != nil { + edges = append(edges, event.EdgeSubscriber) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EventMutation) RemovedIDs(name string) []ent.Value { + switch name { + case event.EdgeUser: + ids := make([]ent.Value, 0, len(m.removeduser)) + for id := range m.removeduser { + ids = append(ids, id) + } + return ids + case event.EdgeGroup: + ids := make([]ent.Value, 0, len(m.removedgroup)) + for id := range m.removedgroup { + ids = append(ids, id) + } + return ids + case event.EdgeIntegration: + ids := make([]ent.Value, 0, len(m.removedintegration)) + for id := range m.removedintegration { + ids = append(ids, id) + } + return ids + case event.EdgeOrganization: + ids := make([]ent.Value, 0, len(m.removedorganization)) + for id := range m.removedorganization { + ids = append(ids, id) + } + return ids + case event.EdgeInvite: + ids := make([]ent.Value, 0, len(m.removedinvite)) + for id := range m.removedinvite { + ids = append(ids, id) + } + return ids + case event.EdgeFeature: + ids := make([]ent.Value, 0, len(m.removedfeature)) + for id := range m.removedfeature { + ids = append(ids, id) + } + return ids + case event.EdgeEntitlementplan: + ids := make([]ent.Value, 0, len(m.removedentitlementplan)) + for id := range m.removedentitlementplan { + ids = append(ids, id) + } + return ids + case event.EdgeEntitlementplanfeature: + ids := make([]ent.Value, 0, len(m.removedentitlementplanfeature)) + for id := range m.removedentitlementplanfeature { + ids = append(ids, id) + } + return ids + case event.EdgePersonalAccessToken: + ids := make([]ent.Value, 0, len(m.removedpersonal_access_token)) + for id := range m.removedpersonal_access_token { + ids = append(ids, id) + } + return ids + case event.EdgeOauth2token: + ids := make([]ent.Value, 0, len(m.removedoauth2token)) + for id := range m.removedoauth2token { + ids = append(ids, id) + } + return ids + case event.EdgeHush: + ids := make([]ent.Value, 0, len(m.removedhush)) + for id := range m.removedhush { + ids = append(ids, id) + } + return ids + case event.EdgeOrgmembership: + ids := make([]ent.Value, 0, len(m.removedorgmembership)) + for id := range m.removedorgmembership { + ids = append(ids, id) + } + return ids + case event.EdgeGroupmembership: + ids := make([]ent.Value, 0, len(m.removedgroupmembership)) + for id := range m.removedgroupmembership { + ids = append(ids, id) + } + return ids + case event.EdgeEntitlement: + ids := make([]ent.Value, 0, len(m.removedentitlement)) + for id := range m.removedentitlement { + ids = append(ids, id) + } + return ids + case event.EdgeWebhook: + ids := make([]ent.Value, 0, len(m.removedwebhook)) + for id := range m.removedwebhook { + ids = append(ids, id) + } + return ids + case event.EdgeSubscriber: + ids := make([]ent.Value, 0, len(m.removedsubscriber)) + for id := range m.removedsubscriber { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EventMutation) ClearedEdges() []string { + edges := make([]string, 0, 16) + if m.cleareduser { + edges = append(edges, event.EdgeUser) + } + if m.clearedgroup { + edges = append(edges, event.EdgeGroup) + } + if m.clearedintegration { + edges = append(edges, event.EdgeIntegration) + } + if m.clearedorganization { + edges = append(edges, event.EdgeOrganization) + } + if m.clearedinvite { + edges = append(edges, event.EdgeInvite) + } + if m.clearedfeature { + edges = append(edges, event.EdgeFeature) + } + if m.clearedentitlementplan { + edges = append(edges, event.EdgeEntitlementplan) + } + if m.clearedentitlementplanfeature { + edges = append(edges, event.EdgeEntitlementplanfeature) + } + if m.clearedpersonal_access_token { + edges = append(edges, event.EdgePersonalAccessToken) + } + if m.clearedoauth2token { + edges = append(edges, event.EdgeOauth2token) + } + if m.clearedhush { + edges = append(edges, event.EdgeHush) + } + if m.clearedorgmembership { + edges = append(edges, event.EdgeOrgmembership) + } + if m.clearedgroupmembership { + edges = append(edges, event.EdgeGroupmembership) + } + if m.clearedentitlement { + edges = append(edges, event.EdgeEntitlement) + } + if m.clearedwebhook { + edges = append(edges, event.EdgeWebhook) + } + if m.clearedsubscriber { + edges = append(edges, event.EdgeSubscriber) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EventMutation) EdgeCleared(name string) bool { + switch name { + case event.EdgeUser: + return m.cleareduser + case event.EdgeGroup: + return m.clearedgroup + case event.EdgeIntegration: + return m.clearedintegration + case event.EdgeOrganization: + return m.clearedorganization + case event.EdgeInvite: + return m.clearedinvite + case event.EdgeFeature: + return m.clearedfeature + case event.EdgeEntitlementplan: + return m.clearedentitlementplan + case event.EdgeEntitlementplanfeature: + return m.clearedentitlementplanfeature + case event.EdgePersonalAccessToken: + return m.clearedpersonal_access_token + case event.EdgeOauth2token: + return m.clearedoauth2token + case event.EdgeHush: + return m.clearedhush + case event.EdgeOrgmembership: + return m.clearedorgmembership + case event.EdgeGroupmembership: + return m.clearedgroupmembership + case event.EdgeEntitlement: + return m.clearedentitlement + case event.EdgeWebhook: + return m.clearedwebhook + case event.EdgeSubscriber: + return m.clearedsubscriber + } + 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 *EventMutation) ClearEdge(name string) error { + switch name { + } + return fmt.Errorf("unknown Event 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 *EventMutation) ResetEdge(name string) error { + switch name { + case event.EdgeUser: + m.ResetUser() + return nil + case event.EdgeGroup: + m.ResetGroup() + return nil + case event.EdgeIntegration: + m.ResetIntegration() + return nil + case event.EdgeOrganization: + m.ResetOrganization() + return nil + case event.EdgeInvite: + m.ResetInvite() + return nil + case event.EdgeFeature: + m.ResetFeature() + return nil + case event.EdgeEntitlementplan: + m.ResetEntitlementplan() + return nil + case event.EdgeEntitlementplanfeature: + m.ResetEntitlementplanfeature() + return nil + case event.EdgePersonalAccessToken: + m.ResetPersonalAccessToken() + return nil + case event.EdgeOauth2token: + m.ResetOauth2token() + return nil + case event.EdgeHush: + m.ResetHush() + return nil + case event.EdgeOrgmembership: + m.ResetOrgmembership() + return nil + case event.EdgeGroupmembership: + m.ResetGroupmembership() + return nil + case event.EdgeEntitlement: + m.ResetEntitlement() + return nil + case event.EdgeWebhook: + m.ResetWebhook() + return nil + case event.EdgeSubscriber: + m.ResetSubscriber() + return nil + } + return fmt.Errorf("unknown Event edge %s", name) +} + +// EventHistoryMutation represents an operation that mutates the EventHistory nodes in the graph. +type EventHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + event_id *string + correlation_id *string + event_type *string + metadata *map[string]interface{} + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*EventHistory, error) + predicates []predicate.EventHistory +} + +var _ ent.Mutation = (*EventHistoryMutation)(nil) + +// eventhistoryOption allows management of the mutation configuration using functional options. +type eventhistoryOption func(*EventHistoryMutation) + +// newEventHistoryMutation creates new mutation for the EventHistory entity. +func newEventHistoryMutation(c config, op Op, opts ...eventhistoryOption) *EventHistoryMutation { + m := &EventHistoryMutation{ + config: c, + op: op, + typ: TypeEventHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withEventHistoryID sets the ID field of the mutation. +func withEventHistoryID(id string) eventhistoryOption { + return func(m *EventHistoryMutation) { + var ( + err error + once sync.Once + value *EventHistory + ) + m.oldValue = func(ctx context.Context) (*EventHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().EventHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withEventHistory sets the old EventHistory of the mutation. +func withEventHistory(node *EventHistory) eventhistoryOption { + return func(m *EventHistoryMutation) { + m.oldValue = func(context.Context) (*EventHistory, 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 EventHistoryMutation) 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 EventHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of EventHistory entities. +func (m *EventHistoryMutation) SetID(id string) { + 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 *EventHistoryMutation) ID() (id string, 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 *EventHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().EventHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *EventHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *EventHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *EventHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *EventHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *EventHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *EventHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[eventhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *EventHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *EventHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, eventhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *EventHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *EventHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *EventHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *EventHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *EventHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *EventHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[eventhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *EventHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *EventHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, eventhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *EventHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *EventHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *EventHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[eventhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *EventHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *EventHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, eventhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *EventHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *EventHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *EventHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[eventhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *EventHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *EventHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, eventhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *EventHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *EventHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *EventHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[eventhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *EventHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *EventHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, eventhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *EventHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *EventHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *EventHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *EventHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *EventHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *EventHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *EventHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *EventHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[eventhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *EventHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *EventHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, eventhistory.FieldTags) +} + +// SetEventID sets the "event_id" field. +func (m *EventHistoryMutation) SetEventID(s string) { + m.event_id = &s +} + +// EventID returns the value of the "event_id" field in the mutation. +func (m *EventHistoryMutation) EventID() (r string, exists bool) { + v := m.event_id + if v == nil { + return + } + return *v, true +} + +// OldEventID returns the old "event_id" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldEventID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEventID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEventID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEventID: %w", err) + } + return oldValue.EventID, nil +} + +// ClearEventID clears the value of the "event_id" field. +func (m *EventHistoryMutation) ClearEventID() { + m.event_id = nil + m.clearedFields[eventhistory.FieldEventID] = struct{}{} +} + +// EventIDCleared returns if the "event_id" field was cleared in this mutation. +func (m *EventHistoryMutation) EventIDCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldEventID] + return ok +} + +// ResetEventID resets all changes to the "event_id" field. +func (m *EventHistoryMutation) ResetEventID() { + m.event_id = nil + delete(m.clearedFields, eventhistory.FieldEventID) +} + +// SetCorrelationID sets the "correlation_id" field. +func (m *EventHistoryMutation) SetCorrelationID(s string) { + m.correlation_id = &s +} + +// CorrelationID returns the value of the "correlation_id" field in the mutation. +func (m *EventHistoryMutation) CorrelationID() (r string, exists bool) { + v := m.correlation_id + if v == nil { + return + } + return *v, true +} + +// OldCorrelationID returns the old "correlation_id" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldCorrelationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCorrelationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCorrelationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCorrelationID: %w", err) + } + return oldValue.CorrelationID, nil +} + +// ClearCorrelationID clears the value of the "correlation_id" field. +func (m *EventHistoryMutation) ClearCorrelationID() { + m.correlation_id = nil + m.clearedFields[eventhistory.FieldCorrelationID] = struct{}{} +} + +// CorrelationIDCleared returns if the "correlation_id" field was cleared in this mutation. +func (m *EventHistoryMutation) CorrelationIDCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldCorrelationID] + return ok +} + +// ResetCorrelationID resets all changes to the "correlation_id" field. +func (m *EventHistoryMutation) ResetCorrelationID() { + m.correlation_id = nil + delete(m.clearedFields, eventhistory.FieldCorrelationID) +} + +// SetEventType sets the "event_type" field. +func (m *EventHistoryMutation) SetEventType(s string) { + m.event_type = &s +} + +// EventType returns the value of the "event_type" field in the mutation. +func (m *EventHistoryMutation) EventType() (r string, exists bool) { + v := m.event_type + if v == nil { + return + } + return *v, true +} + +// OldEventType returns the old "event_type" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldEventType(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEventType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEventType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEventType: %w", err) + } + return oldValue.EventType, nil +} + +// ResetEventType resets all changes to the "event_type" field. +func (m *EventHistoryMutation) ResetEventType() { + m.event_type = nil +} + +// SetMetadata sets the "metadata" field. +func (m *EventHistoryMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *EventHistoryMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the EventHistory entity. +// If the EventHistory 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 *EventHistoryMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *EventHistoryMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[eventhistory.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *EventHistoryMutation) MetadataCleared() bool { + _, ok := m.clearedFields[eventhistory.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *EventHistoryMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, eventhistory.FieldMetadata) +} + +// Where appends a list predicates to the EventHistoryMutation builder. +func (m *EventHistoryMutation) Where(ps ...predicate.EventHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the EventHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *EventHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.EventHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *EventHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *EventHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (EventHistory). +func (m *EventHistoryMutation) 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 *EventHistoryMutation) Fields() []string { + fields := make([]string, 0, 13) + if m.history_time != nil { + fields = append(fields, eventhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, eventhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, eventhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, eventhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, eventhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, eventhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, eventhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, eventhistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, eventhistory.FieldTags) + } + if m.event_id != nil { + fields = append(fields, eventhistory.FieldEventID) + } + if m.correlation_id != nil { + fields = append(fields, eventhistory.FieldCorrelationID) + } + if m.event_type != nil { + fields = append(fields, eventhistory.FieldEventType) + } + if m.metadata != nil { + fields = append(fields, eventhistory.FieldMetadata) + } + 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 *EventHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case eventhistory.FieldHistoryTime: + return m.HistoryTime() + case eventhistory.FieldRef: + return m.Ref() + case eventhistory.FieldOperation: + return m.Operation() + case eventhistory.FieldCreatedAt: + return m.CreatedAt() + case eventhistory.FieldUpdatedAt: + return m.UpdatedAt() + case eventhistory.FieldCreatedBy: + return m.CreatedBy() + case eventhistory.FieldUpdatedBy: + return m.UpdatedBy() + case eventhistory.FieldMappingID: + return m.MappingID() + case eventhistory.FieldTags: + return m.Tags() + case eventhistory.FieldEventID: + return m.EventID() + case eventhistory.FieldCorrelationID: + return m.CorrelationID() + case eventhistory.FieldEventType: + return m.EventType() + case eventhistory.FieldMetadata: + return m.Metadata() + } + 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 *EventHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case eventhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case eventhistory.FieldRef: + return m.OldRef(ctx) + case eventhistory.FieldOperation: + return m.OldOperation(ctx) + case eventhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case eventhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case eventhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case eventhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case eventhistory.FieldMappingID: + return m.OldMappingID(ctx) + case eventhistory.FieldTags: + return m.OldTags(ctx) + case eventhistory.FieldEventID: + return m.OldEventID(ctx) + case eventhistory.FieldCorrelationID: + return m.OldCorrelationID(ctx) + case eventhistory.FieldEventType: + return m.OldEventType(ctx) + case eventhistory.FieldMetadata: + return m.OldMetadata(ctx) + } + return nil, fmt.Errorf("unknown EventHistory 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 *EventHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case eventhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case eventhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case eventhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case eventhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case eventhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case eventhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case eventhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case eventhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case eventhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case eventhistory.FieldEventID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEventID(v) + return nil + case eventhistory.FieldCorrelationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCorrelationID(v) + return nil + case eventhistory.FieldEventType: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEventType(v) + return nil + case eventhistory.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + } + return fmt.Errorf("unknown EventHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *EventHistoryMutation) 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 *EventHistoryMutation) 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 *EventHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown EventHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *EventHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(eventhistory.FieldRef) { + fields = append(fields, eventhistory.FieldRef) + } + if m.FieldCleared(eventhistory.FieldCreatedAt) { + fields = append(fields, eventhistory.FieldCreatedAt) + } + if m.FieldCleared(eventhistory.FieldUpdatedAt) { + fields = append(fields, eventhistory.FieldUpdatedAt) + } + if m.FieldCleared(eventhistory.FieldCreatedBy) { + fields = append(fields, eventhistory.FieldCreatedBy) + } + if m.FieldCleared(eventhistory.FieldUpdatedBy) { + fields = append(fields, eventhistory.FieldUpdatedBy) + } + if m.FieldCleared(eventhistory.FieldTags) { + fields = append(fields, eventhistory.FieldTags) + } + if m.FieldCleared(eventhistory.FieldEventID) { + fields = append(fields, eventhistory.FieldEventID) + } + if m.FieldCleared(eventhistory.FieldCorrelationID) { + fields = append(fields, eventhistory.FieldCorrelationID) + } + if m.FieldCleared(eventhistory.FieldMetadata) { + fields = append(fields, eventhistory.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *EventHistoryMutation) 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 *EventHistoryMutation) ClearField(name string) error { + switch name { + case eventhistory.FieldRef: + m.ClearRef() + return nil + case eventhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case eventhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case eventhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case eventhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case eventhistory.FieldTags: + m.ClearTags() + return nil + case eventhistory.FieldEventID: + m.ClearEventID() + return nil + case eventhistory.FieldCorrelationID: + m.ClearCorrelationID() + return nil + case eventhistory.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown EventHistory 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 *EventHistoryMutation) ResetField(name string) error { + switch name { + case eventhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case eventhistory.FieldRef: + m.ResetRef() + return nil + case eventhistory.FieldOperation: + m.ResetOperation() + return nil + case eventhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case eventhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case eventhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case eventhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case eventhistory.FieldMappingID: + m.ResetMappingID() + return nil + case eventhistory.FieldTags: + m.ResetTags() + return nil + case eventhistory.FieldEventID: + m.ResetEventID() + return nil + case eventhistory.FieldCorrelationID: + m.ResetCorrelationID() + return nil + case eventhistory.FieldEventType: + m.ResetEventType() + return nil + case eventhistory.FieldMetadata: + m.ResetMetadata() + return nil + } + return fmt.Errorf("unknown EventHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *EventHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *EventHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *EventHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *EventHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *EventHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *EventHistoryMutation) EdgeCleared(name string) bool { + 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 *EventHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown EventHistory 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 *EventHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown EventHistory edge %s", name) +} + +// FeatureMutation represents an operation that mutates the Feature nodes in the graph. +type FeatureMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + name *string + display_name *string + enabled *bool + description *string + metadata *map[string]interface{} + clearedFields map[string]struct{} + owner *string + clearedowner bool + plans map[string]struct{} + removedplans map[string]struct{} + clearedplans bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + features map[string]struct{} + removedfeatures map[string]struct{} + clearedfeatures bool + done bool + oldValue func(context.Context) (*Feature, error) + predicates []predicate.Feature +} + +var _ ent.Mutation = (*FeatureMutation)(nil) + +// featureOption allows management of the mutation configuration using functional options. +type featureOption func(*FeatureMutation) + +// newFeatureMutation creates new mutation for the Feature entity. +func newFeatureMutation(c config, op Op, opts ...featureOption) *FeatureMutation { + m := &FeatureMutation{ + config: c, + op: op, + typ: TypeFeature, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withFeatureID sets the ID field of the mutation. +func withFeatureID(id string) featureOption { + return func(m *FeatureMutation) { + var ( + err error + once sync.Once + value *Feature + ) + m.oldValue = func(ctx context.Context) (*Feature, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Feature.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFeature sets the old Feature of the mutation. +func withFeature(node *Feature) featureOption { + return func(m *FeatureMutation) { + m.oldValue = func(context.Context) (*Feature, 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 FeatureMutation) 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 FeatureMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Feature entities. +func (m *FeatureMutation) SetID(id string) { + 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 *FeatureMutation) ID() (id string, 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 *FeatureMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Feature.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *FeatureMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *FeatureMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *FeatureMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[feature.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *FeatureMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[feature.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *FeatureMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, feature.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *FeatureMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *FeatureMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *FeatureMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[feature.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *FeatureMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[feature.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *FeatureMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, feature.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *FeatureMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *FeatureMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *FeatureMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[feature.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *FeatureMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[feature.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *FeatureMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, feature.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *FeatureMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *FeatureMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *FeatureMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[feature.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *FeatureMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[feature.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *FeatureMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, feature.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *FeatureMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *FeatureMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *FeatureMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[feature.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *FeatureMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[feature.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *FeatureMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, feature.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *FeatureMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *FeatureMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *FeatureMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[feature.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *FeatureMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[feature.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *FeatureMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, feature.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *FeatureMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *FeatureMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *FeatureMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *FeatureMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *FeatureMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *FeatureMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *FeatureMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *FeatureMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[feature.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *FeatureMutation) TagsCleared() bool { + _, ok := m.clearedFields[feature.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *FeatureMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, feature.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *FeatureMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *FeatureMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *FeatureMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[feature.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *FeatureMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[feature.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *FeatureMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, feature.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *FeatureMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *FeatureMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *FeatureMutation) ResetName() { + m.name = nil +} + +// SetDisplayName sets the "display_name" field. +func (m *FeatureMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *FeatureMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ClearDisplayName clears the value of the "display_name" field. +func (m *FeatureMutation) ClearDisplayName() { + m.display_name = nil + m.clearedFields[feature.FieldDisplayName] = struct{}{} +} + +// DisplayNameCleared returns if the "display_name" field was cleared in this mutation. +func (m *FeatureMutation) DisplayNameCleared() bool { + _, ok := m.clearedFields[feature.FieldDisplayName] + return ok +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *FeatureMutation) ResetDisplayName() { + m.display_name = nil + delete(m.clearedFields, feature.FieldDisplayName) +} + +// SetEnabled sets the "enabled" field. +func (m *FeatureMutation) SetEnabled(b bool) { + m.enabled = &b +} + +// Enabled returns the value of the "enabled" field in the mutation. +func (m *FeatureMutation) Enabled() (r bool, exists bool) { + v := m.enabled + if v == nil { + return + } + return *v, true +} + +// OldEnabled returns the old "enabled" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldEnabled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEnabled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEnabled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEnabled: %w", err) + } + return oldValue.Enabled, nil +} + +// ResetEnabled resets all changes to the "enabled" field. +func (m *FeatureMutation) ResetEnabled() { + m.enabled = nil +} + +// SetDescription sets the "description" field. +func (m *FeatureMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *FeatureMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldDescription(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *FeatureMutation) ClearDescription() { + m.description = nil + m.clearedFields[feature.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *FeatureMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[feature.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *FeatureMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, feature.FieldDescription) +} + +// SetMetadata sets the "metadata" field. +func (m *FeatureMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *FeatureMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the Feature entity. +// If the Feature 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 *FeatureMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *FeatureMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[feature.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *FeatureMutation) MetadataCleared() bool { + _, ok := m.clearedFields[feature.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *FeatureMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, feature.FieldMetadata) +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *FeatureMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[feature.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *FeatureMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *FeatureMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *FeatureMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddPlanIDs adds the "plans" edge to the EntitlementPlan entity by ids. +func (m *FeatureMutation) AddPlanIDs(ids ...string) { + if m.plans == nil { + m.plans = make(map[string]struct{}) + } + for i := range ids { + m.plans[ids[i]] = struct{}{} + } +} + +// ClearPlans clears the "plans" edge to the EntitlementPlan entity. +func (m *FeatureMutation) ClearPlans() { + m.clearedplans = true +} + +// PlansCleared reports if the "plans" edge to the EntitlementPlan entity was cleared. +func (m *FeatureMutation) PlansCleared() bool { + return m.clearedplans +} + +// RemovePlanIDs removes the "plans" edge to the EntitlementPlan entity by IDs. +func (m *FeatureMutation) RemovePlanIDs(ids ...string) { + if m.removedplans == nil { + m.removedplans = make(map[string]struct{}) + } + for i := range ids { + delete(m.plans, ids[i]) + m.removedplans[ids[i]] = struct{}{} + } +} + +// RemovedPlans returns the removed IDs of the "plans" edge to the EntitlementPlan entity. +func (m *FeatureMutation) RemovedPlansIDs() (ids []string) { + for id := range m.removedplans { + ids = append(ids, id) + } + return +} + +// PlansIDs returns the "plans" edge IDs in the mutation. +func (m *FeatureMutation) PlansIDs() (ids []string) { + for id := range m.plans { + ids = append(ids, id) + } + return +} + +// ResetPlans resets all changes to the "plans" edge. +func (m *FeatureMutation) ResetPlans() { + m.plans = nil + m.clearedplans = false + m.removedplans = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *FeatureMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *FeatureMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *FeatureMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *FeatureMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *FeatureMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *FeatureMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *FeatureMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// AddFeatureIDs adds the "features" edge to the EntitlementPlanFeature entity by ids. +func (m *FeatureMutation) AddFeatureIDs(ids ...string) { + if m.features == nil { + m.features = make(map[string]struct{}) + } + for i := range ids { + m.features[ids[i]] = struct{}{} + } +} + +// ClearFeatures clears the "features" edge to the EntitlementPlanFeature entity. +func (m *FeatureMutation) ClearFeatures() { + m.clearedfeatures = true +} + +// FeaturesCleared reports if the "features" edge to the EntitlementPlanFeature entity was cleared. +func (m *FeatureMutation) FeaturesCleared() bool { + return m.clearedfeatures +} + +// RemoveFeatureIDs removes the "features" edge to the EntitlementPlanFeature entity by IDs. +func (m *FeatureMutation) RemoveFeatureIDs(ids ...string) { + if m.removedfeatures == nil { + m.removedfeatures = make(map[string]struct{}) + } + for i := range ids { + delete(m.features, ids[i]) + m.removedfeatures[ids[i]] = struct{}{} + } +} + +// RemovedFeatures returns the removed IDs of the "features" edge to the EntitlementPlanFeature entity. +func (m *FeatureMutation) RemovedFeaturesIDs() (ids []string) { + for id := range m.removedfeatures { + ids = append(ids, id) + } + return +} + +// FeaturesIDs returns the "features" edge IDs in the mutation. +func (m *FeatureMutation) FeaturesIDs() (ids []string) { + for id := range m.features { + ids = append(ids, id) + } + return +} + +// ResetFeatures resets all changes to the "features" edge. +func (m *FeatureMutation) ResetFeatures() { + m.features = nil + m.clearedfeatures = false + m.removedfeatures = nil +} + +// Where appends a list predicates to the FeatureMutation builder. +func (m *FeatureMutation) Where(ps ...predicate.Feature) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the FeatureMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *FeatureMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Feature, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *FeatureMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *FeatureMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Feature). +func (m *FeatureMutation) 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 *FeatureMutation) Fields() []string { + fields := make([]string, 0, 14) + if m.created_at != nil { + fields = append(fields, feature.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, feature.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, feature.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, feature.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, feature.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, feature.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, feature.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, feature.FieldTags) + } + if m.owner != nil { + fields = append(fields, feature.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, feature.FieldName) + } + if m.display_name != nil { + fields = append(fields, feature.FieldDisplayName) + } + if m.enabled != nil { + fields = append(fields, feature.FieldEnabled) + } + if m.description != nil { + fields = append(fields, feature.FieldDescription) + } + if m.metadata != nil { + fields = append(fields, feature.FieldMetadata) + } + 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 *FeatureMutation) Field(name string) (ent.Value, bool) { + switch name { + case feature.FieldCreatedAt: + return m.CreatedAt() + case feature.FieldUpdatedAt: + return m.UpdatedAt() + case feature.FieldCreatedBy: + return m.CreatedBy() + case feature.FieldUpdatedBy: + return m.UpdatedBy() + case feature.FieldDeletedAt: + return m.DeletedAt() + case feature.FieldDeletedBy: + return m.DeletedBy() + case feature.FieldMappingID: + return m.MappingID() + case feature.FieldTags: + return m.Tags() + case feature.FieldOwnerID: + return m.OwnerID() + case feature.FieldName: + return m.Name() + case feature.FieldDisplayName: + return m.DisplayName() + case feature.FieldEnabled: + return m.Enabled() + case feature.FieldDescription: + return m.Description() + case feature.FieldMetadata: + return m.Metadata() + } + 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 *FeatureMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case feature.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case feature.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case feature.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case feature.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case feature.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case feature.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case feature.FieldMappingID: + return m.OldMappingID(ctx) + case feature.FieldTags: + return m.OldTags(ctx) + case feature.FieldOwnerID: + return m.OldOwnerID(ctx) + case feature.FieldName: + return m.OldName(ctx) + case feature.FieldDisplayName: + return m.OldDisplayName(ctx) + case feature.FieldEnabled: + return m.OldEnabled(ctx) + case feature.FieldDescription: + return m.OldDescription(ctx) + case feature.FieldMetadata: + return m.OldMetadata(ctx) + } + return nil, fmt.Errorf("unknown Feature 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 *FeatureMutation) SetField(name string, value ent.Value) error { + switch name { + case feature.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case feature.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case feature.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case feature.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case feature.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case feature.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case feature.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case feature.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case feature.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case feature.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case feature.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case feature.FieldEnabled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEnabled(v) + return nil + case feature.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case feature.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + } + return fmt.Errorf("unknown Feature field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *FeatureMutation) 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 *FeatureMutation) 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 *FeatureMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Feature numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *FeatureMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(feature.FieldCreatedAt) { + fields = append(fields, feature.FieldCreatedAt) + } + if m.FieldCleared(feature.FieldUpdatedAt) { + fields = append(fields, feature.FieldUpdatedAt) + } + if m.FieldCleared(feature.FieldCreatedBy) { + fields = append(fields, feature.FieldCreatedBy) + } + if m.FieldCleared(feature.FieldUpdatedBy) { + fields = append(fields, feature.FieldUpdatedBy) + } + if m.FieldCleared(feature.FieldDeletedAt) { + fields = append(fields, feature.FieldDeletedAt) + } + if m.FieldCleared(feature.FieldDeletedBy) { + fields = append(fields, feature.FieldDeletedBy) + } + if m.FieldCleared(feature.FieldTags) { + fields = append(fields, feature.FieldTags) + } + if m.FieldCleared(feature.FieldOwnerID) { + fields = append(fields, feature.FieldOwnerID) + } + if m.FieldCleared(feature.FieldDisplayName) { + fields = append(fields, feature.FieldDisplayName) + } + if m.FieldCleared(feature.FieldDescription) { + fields = append(fields, feature.FieldDescription) + } + if m.FieldCleared(feature.FieldMetadata) { + fields = append(fields, feature.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *FeatureMutation) 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 *FeatureMutation) ClearField(name string) error { + switch name { + case feature.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case feature.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case feature.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case feature.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case feature.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case feature.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case feature.FieldTags: + m.ClearTags() + return nil + case feature.FieldOwnerID: + m.ClearOwnerID() + return nil + case feature.FieldDisplayName: + m.ClearDisplayName() + return nil + case feature.FieldDescription: + m.ClearDescription() + return nil + case feature.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown Feature 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 *FeatureMutation) ResetField(name string) error { + switch name { + case feature.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case feature.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case feature.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case feature.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case feature.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case feature.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case feature.FieldMappingID: + m.ResetMappingID() + return nil + case feature.FieldTags: + m.ResetTags() + return nil + case feature.FieldOwnerID: + m.ResetOwnerID() + return nil + case feature.FieldName: + m.ResetName() + return nil + case feature.FieldDisplayName: + m.ResetDisplayName() + return nil + case feature.FieldEnabled: + m.ResetEnabled() + return nil + case feature.FieldDescription: + m.ResetDescription() + return nil + case feature.FieldMetadata: + m.ResetMetadata() + return nil + } + return fmt.Errorf("unknown Feature field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *FeatureMutation) AddedEdges() []string { + edges := make([]string, 0, 4) + if m.owner != nil { + edges = append(edges, feature.EdgeOwner) + } + if m.plans != nil { + edges = append(edges, feature.EdgePlans) + } + if m.events != nil { + edges = append(edges, feature.EdgeEvents) + } + if m.features != nil { + edges = append(edges, feature.EdgeFeatures) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *FeatureMutation) AddedIDs(name string) []ent.Value { + switch name { + case feature.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case feature.EdgePlans: + ids := make([]ent.Value, 0, len(m.plans)) + for id := range m.plans { + ids = append(ids, id) + } + return ids + case feature.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + case feature.EdgeFeatures: + ids := make([]ent.Value, 0, len(m.features)) + for id := range m.features { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *FeatureMutation) RemovedEdges() []string { + edges := make([]string, 0, 4) + if m.removedplans != nil { + edges = append(edges, feature.EdgePlans) + } + if m.removedevents != nil { + edges = append(edges, feature.EdgeEvents) + } + if m.removedfeatures != nil { + edges = append(edges, feature.EdgeFeatures) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *FeatureMutation) RemovedIDs(name string) []ent.Value { + switch name { + case feature.EdgePlans: + ids := make([]ent.Value, 0, len(m.removedplans)) + for id := range m.removedplans { + ids = append(ids, id) + } + return ids + case feature.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + case feature.EdgeFeatures: + ids := make([]ent.Value, 0, len(m.removedfeatures)) + for id := range m.removedfeatures { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *FeatureMutation) ClearedEdges() []string { + edges := make([]string, 0, 4) + if m.clearedowner { + edges = append(edges, feature.EdgeOwner) + } + if m.clearedplans { + edges = append(edges, feature.EdgePlans) + } + if m.clearedevents { + edges = append(edges, feature.EdgeEvents) + } + if m.clearedfeatures { + edges = append(edges, feature.EdgeFeatures) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *FeatureMutation) EdgeCleared(name string) bool { + switch name { + case feature.EdgeOwner: + return m.clearedowner + case feature.EdgePlans: + return m.clearedplans + case feature.EdgeEvents: + return m.clearedevents + case feature.EdgeFeatures: + return m.clearedfeatures + } + 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 *FeatureMutation) ClearEdge(name string) error { + switch name { + case feature.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Feature 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 *FeatureMutation) ResetEdge(name string) error { + switch name { + case feature.EdgeOwner: + m.ResetOwner() + return nil + case feature.EdgePlans: + m.ResetPlans() + return nil + case feature.EdgeEvents: + m.ResetEvents() + return nil + case feature.EdgeFeatures: + m.ResetFeatures() + return nil + } + return fmt.Errorf("unknown Feature edge %s", name) +} + +// FeatureHistoryMutation represents an operation that mutates the FeatureHistory nodes in the graph. +type FeatureHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + owner_id *string + name *string + display_name *string + enabled *bool + description *string + metadata *map[string]interface{} + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*FeatureHistory, error) + predicates []predicate.FeatureHistory +} + +var _ ent.Mutation = (*FeatureHistoryMutation)(nil) + +// featurehistoryOption allows management of the mutation configuration using functional options. +type featurehistoryOption func(*FeatureHistoryMutation) + +// newFeatureHistoryMutation creates new mutation for the FeatureHistory entity. +func newFeatureHistoryMutation(c config, op Op, opts ...featurehistoryOption) *FeatureHistoryMutation { + m := &FeatureHistoryMutation{ + config: c, + op: op, + typ: TypeFeatureHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withFeatureHistoryID sets the ID field of the mutation. +func withFeatureHistoryID(id string) featurehistoryOption { + return func(m *FeatureHistoryMutation) { + var ( + err error + once sync.Once + value *FeatureHistory + ) + m.oldValue = func(ctx context.Context) (*FeatureHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().FeatureHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFeatureHistory sets the old FeatureHistory of the mutation. +func withFeatureHistory(node *FeatureHistory) featurehistoryOption { + return func(m *FeatureHistoryMutation) { + m.oldValue = func(context.Context) (*FeatureHistory, 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 FeatureHistoryMutation) 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 FeatureHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of FeatureHistory entities. +func (m *FeatureHistoryMutation) SetID(id string) { + 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 *FeatureHistoryMutation) ID() (id string, 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 *FeatureHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().FeatureHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *FeatureHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *FeatureHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *FeatureHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *FeatureHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *FeatureHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *FeatureHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[featurehistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *FeatureHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *FeatureHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, featurehistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *FeatureHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *FeatureHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *FeatureHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *FeatureHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *FeatureHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *FeatureHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[featurehistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *FeatureHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *FeatureHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, featurehistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *FeatureHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *FeatureHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *FeatureHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[featurehistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *FeatureHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *FeatureHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, featurehistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *FeatureHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *FeatureHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *FeatureHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[featurehistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *FeatureHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *FeatureHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, featurehistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *FeatureHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *FeatureHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *FeatureHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[featurehistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *FeatureHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *FeatureHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, featurehistory.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *FeatureHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *FeatureHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *FeatureHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[featurehistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *FeatureHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *FeatureHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, featurehistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *FeatureHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *FeatureHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *FeatureHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[featurehistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *FeatureHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *FeatureHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, featurehistory.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *FeatureHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *FeatureHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *FeatureHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *FeatureHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *FeatureHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *FeatureHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *FeatureHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *FeatureHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[featurehistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *FeatureHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *FeatureHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, featurehistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *FeatureHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *FeatureHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *FeatureHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[featurehistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *FeatureHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *FeatureHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, featurehistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *FeatureHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *FeatureHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *FeatureHistoryMutation) ResetName() { + m.name = nil +} + +// SetDisplayName sets the "display_name" field. +func (m *FeatureHistoryMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *FeatureHistoryMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ClearDisplayName clears the value of the "display_name" field. +func (m *FeatureHistoryMutation) ClearDisplayName() { + m.display_name = nil + m.clearedFields[featurehistory.FieldDisplayName] = struct{}{} +} + +// DisplayNameCleared returns if the "display_name" field was cleared in this mutation. +func (m *FeatureHistoryMutation) DisplayNameCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldDisplayName] + return ok +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *FeatureHistoryMutation) ResetDisplayName() { + m.display_name = nil + delete(m.clearedFields, featurehistory.FieldDisplayName) +} + +// SetEnabled sets the "enabled" field. +func (m *FeatureHistoryMutation) SetEnabled(b bool) { + m.enabled = &b +} + +// Enabled returns the value of the "enabled" field in the mutation. +func (m *FeatureHistoryMutation) Enabled() (r bool, exists bool) { + v := m.enabled + if v == nil { + return + } + return *v, true +} + +// OldEnabled returns the old "enabled" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldEnabled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEnabled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEnabled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEnabled: %w", err) + } + return oldValue.Enabled, nil +} + +// ResetEnabled resets all changes to the "enabled" field. +func (m *FeatureHistoryMutation) ResetEnabled() { + m.enabled = nil +} + +// SetDescription sets the "description" field. +func (m *FeatureHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *FeatureHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldDescription(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *FeatureHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[featurehistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *FeatureHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *FeatureHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, featurehistory.FieldDescription) +} + +// SetMetadata sets the "metadata" field. +func (m *FeatureHistoryMutation) SetMetadata(value map[string]interface{}) { + m.metadata = &value +} + +// Metadata returns the value of the "metadata" field in the mutation. +func (m *FeatureHistoryMutation) Metadata() (r map[string]interface{}, exists bool) { + v := m.metadata + if v == nil { + return + } + return *v, true +} + +// OldMetadata returns the old "metadata" field's value of the FeatureHistory entity. +// If the FeatureHistory 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 *FeatureHistoryMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMetadata is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMetadata requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMetadata: %w", err) + } + return oldValue.Metadata, nil +} + +// ClearMetadata clears the value of the "metadata" field. +func (m *FeatureHistoryMutation) ClearMetadata() { + m.metadata = nil + m.clearedFields[featurehistory.FieldMetadata] = struct{}{} +} + +// MetadataCleared returns if the "metadata" field was cleared in this mutation. +func (m *FeatureHistoryMutation) MetadataCleared() bool { + _, ok := m.clearedFields[featurehistory.FieldMetadata] + return ok +} + +// ResetMetadata resets all changes to the "metadata" field. +func (m *FeatureHistoryMutation) ResetMetadata() { + m.metadata = nil + delete(m.clearedFields, featurehistory.FieldMetadata) +} + +// Where appends a list predicates to the FeatureHistoryMutation builder. +func (m *FeatureHistoryMutation) Where(ps ...predicate.FeatureHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the FeatureHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *FeatureHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.FeatureHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *FeatureHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *FeatureHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (FeatureHistory). +func (m *FeatureHistoryMutation) 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 *FeatureHistoryMutation) Fields() []string { + fields := make([]string, 0, 17) + if m.history_time != nil { + fields = append(fields, featurehistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, featurehistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, featurehistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, featurehistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, featurehistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, featurehistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, featurehistory.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, featurehistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, featurehistory.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, featurehistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, featurehistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, featurehistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, featurehistory.FieldName) + } + if m.display_name != nil { + fields = append(fields, featurehistory.FieldDisplayName) + } + if m.enabled != nil { + fields = append(fields, featurehistory.FieldEnabled) + } + if m.description != nil { + fields = append(fields, featurehistory.FieldDescription) + } + if m.metadata != nil { + fields = append(fields, featurehistory.FieldMetadata) + } + 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 *FeatureHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case featurehistory.FieldHistoryTime: + return m.HistoryTime() + case featurehistory.FieldRef: + return m.Ref() + case featurehistory.FieldOperation: + return m.Operation() + case featurehistory.FieldCreatedAt: + return m.CreatedAt() + case featurehistory.FieldUpdatedAt: + return m.UpdatedAt() + case featurehistory.FieldCreatedBy: + return m.CreatedBy() + case featurehistory.FieldUpdatedBy: + return m.UpdatedBy() + case featurehistory.FieldDeletedAt: + return m.DeletedAt() + case featurehistory.FieldDeletedBy: + return m.DeletedBy() + case featurehistory.FieldMappingID: + return m.MappingID() + case featurehistory.FieldTags: + return m.Tags() + case featurehistory.FieldOwnerID: + return m.OwnerID() + case featurehistory.FieldName: + return m.Name() + case featurehistory.FieldDisplayName: + return m.DisplayName() + case featurehistory.FieldEnabled: + return m.Enabled() + case featurehistory.FieldDescription: + return m.Description() + case featurehistory.FieldMetadata: + return m.Metadata() + } + 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 *FeatureHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case featurehistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case featurehistory.FieldRef: + return m.OldRef(ctx) + case featurehistory.FieldOperation: + return m.OldOperation(ctx) + case featurehistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case featurehistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case featurehistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case featurehistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case featurehistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case featurehistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case featurehistory.FieldMappingID: + return m.OldMappingID(ctx) + case featurehistory.FieldTags: + return m.OldTags(ctx) + case featurehistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case featurehistory.FieldName: + return m.OldName(ctx) + case featurehistory.FieldDisplayName: + return m.OldDisplayName(ctx) + case featurehistory.FieldEnabled: + return m.OldEnabled(ctx) + case featurehistory.FieldDescription: + return m.OldDescription(ctx) + case featurehistory.FieldMetadata: + return m.OldMetadata(ctx) + } + return nil, fmt.Errorf("unknown FeatureHistory 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 *FeatureHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case featurehistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case featurehistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case featurehistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case featurehistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case featurehistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case featurehistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case featurehistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case featurehistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case featurehistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case featurehistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case featurehistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case featurehistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case featurehistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case featurehistory.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case featurehistory.FieldEnabled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEnabled(v) + return nil + case featurehistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case featurehistory.FieldMetadata: + v, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMetadata(v) + return nil + } + return fmt.Errorf("unknown FeatureHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *FeatureHistoryMutation) 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 *FeatureHistoryMutation) 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 *FeatureHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown FeatureHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *FeatureHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(featurehistory.FieldRef) { + fields = append(fields, featurehistory.FieldRef) + } + if m.FieldCleared(featurehistory.FieldCreatedAt) { + fields = append(fields, featurehistory.FieldCreatedAt) + } + if m.FieldCleared(featurehistory.FieldUpdatedAt) { + fields = append(fields, featurehistory.FieldUpdatedAt) + } + if m.FieldCleared(featurehistory.FieldCreatedBy) { + fields = append(fields, featurehistory.FieldCreatedBy) + } + if m.FieldCleared(featurehistory.FieldUpdatedBy) { + fields = append(fields, featurehistory.FieldUpdatedBy) + } + if m.FieldCleared(featurehistory.FieldDeletedAt) { + fields = append(fields, featurehistory.FieldDeletedAt) + } + if m.FieldCleared(featurehistory.FieldDeletedBy) { + fields = append(fields, featurehistory.FieldDeletedBy) + } + if m.FieldCleared(featurehistory.FieldTags) { + fields = append(fields, featurehistory.FieldTags) + } + if m.FieldCleared(featurehistory.FieldOwnerID) { + fields = append(fields, featurehistory.FieldOwnerID) + } + if m.FieldCleared(featurehistory.FieldDisplayName) { + fields = append(fields, featurehistory.FieldDisplayName) + } + if m.FieldCleared(featurehistory.FieldDescription) { + fields = append(fields, featurehistory.FieldDescription) + } + if m.FieldCleared(featurehistory.FieldMetadata) { + fields = append(fields, featurehistory.FieldMetadata) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *FeatureHistoryMutation) 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 *FeatureHistoryMutation) ClearField(name string) error { + switch name { + case featurehistory.FieldRef: + m.ClearRef() + return nil + case featurehistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case featurehistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case featurehistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case featurehistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case featurehistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case featurehistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case featurehistory.FieldTags: + m.ClearTags() + return nil + case featurehistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case featurehistory.FieldDisplayName: + m.ClearDisplayName() + return nil + case featurehistory.FieldDescription: + m.ClearDescription() + return nil + case featurehistory.FieldMetadata: + m.ClearMetadata() + return nil + } + return fmt.Errorf("unknown FeatureHistory 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 *FeatureHistoryMutation) ResetField(name string) error { + switch name { + case featurehistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case featurehistory.FieldRef: + m.ResetRef() + return nil + case featurehistory.FieldOperation: + m.ResetOperation() + return nil + case featurehistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case featurehistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case featurehistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case featurehistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case featurehistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case featurehistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case featurehistory.FieldMappingID: + m.ResetMappingID() + return nil + case featurehistory.FieldTags: + m.ResetTags() + return nil + case featurehistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case featurehistory.FieldName: + m.ResetName() + return nil + case featurehistory.FieldDisplayName: + m.ResetDisplayName() + return nil + case featurehistory.FieldEnabled: + m.ResetEnabled() + return nil + case featurehistory.FieldDescription: + m.ResetDescription() + return nil + case featurehistory.FieldMetadata: + m.ResetMetadata() + return nil + } + return fmt.Errorf("unknown FeatureHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *FeatureHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *FeatureHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *FeatureHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *FeatureHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *FeatureHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *FeatureHistoryMutation) EdgeCleared(name string) bool { + 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 *FeatureHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown FeatureHistory 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 *FeatureHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown FeatureHistory edge %s", name) +} + +// FileMutation represents an operation that mutates the File nodes in the graph. +type FileMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + file_name *string + file_extension *string + file_size *int + addfile_size *int + content_type *string + store_key *string + category *string + annotation *string + clearedFields map[string]struct{} + user *string + cleareduser bool + organization map[string]struct{} + removedorganization map[string]struct{} + clearedorganization bool + entity map[string]struct{} + removedentity map[string]struct{} + clearedentity bool + group map[string]struct{} + removedgroup map[string]struct{} + clearedgroup bool + done bool + oldValue func(context.Context) (*File, error) + predicates []predicate.File +} + +var _ ent.Mutation = (*FileMutation)(nil) + +// fileOption allows management of the mutation configuration using functional options. +type fileOption func(*FileMutation) + +// newFileMutation creates new mutation for the File entity. +func newFileMutation(c config, op Op, opts ...fileOption) *FileMutation { + m := &FileMutation{ + config: c, + op: op, + typ: TypeFile, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withFileID sets the ID field of the mutation. +func withFileID(id string) fileOption { + return func(m *FileMutation) { + var ( + err error + once sync.Once + value *File + ) + m.oldValue = func(ctx context.Context) (*File, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().File.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFile sets the old File of the mutation. +func withFile(node *File) fileOption { + return func(m *FileMutation) { + m.oldValue = func(context.Context) (*File, 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 FileMutation) 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 FileMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of File entities. +func (m *FileMutation) SetID(id string) { + 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 *FileMutation) ID() (id string, 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 *FileMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().File.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *FileMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *FileMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the File entity. +// If the File 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 *FileMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *FileMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[file.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *FileMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[file.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *FileMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, file.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *FileMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *FileMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the File entity. +// If the File 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 *FileMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *FileMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[file.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *FileMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[file.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *FileMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, file.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *FileMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *FileMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the File entity. +// If the File 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 *FileMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *FileMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[file.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *FileMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[file.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *FileMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, file.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *FileMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *FileMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the File entity. +// If the File 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 *FileMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *FileMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[file.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *FileMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[file.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *FileMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, file.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *FileMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *FileMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the File entity. +// If the File 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 *FileMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *FileMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[file.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *FileMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[file.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *FileMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, file.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *FileMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *FileMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the File entity. +// If the File 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 *FileMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *FileMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[file.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *FileMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[file.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *FileMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, file.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *FileMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *FileMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the File entity. +// If the File 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 *FileMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *FileMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *FileMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *FileMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the File entity. +// If the File 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 *FileMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *FileMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *FileMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *FileMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[file.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *FileMutation) TagsCleared() bool { + _, ok := m.clearedFields[file.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *FileMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, file.FieldTags) +} + +// SetFileName sets the "file_name" field. +func (m *FileMutation) SetFileName(s string) { + m.file_name = &s +} + +// FileName returns the value of the "file_name" field in the mutation. +func (m *FileMutation) FileName() (r string, exists bool) { + v := m.file_name + if v == nil { + return + } + return *v, true +} + +// OldFileName returns the old "file_name" field's value of the File entity. +// If the File 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 *FileMutation) OldFileName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFileName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFileName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFileName: %w", err) + } + return oldValue.FileName, nil +} + +// ResetFileName resets all changes to the "file_name" field. +func (m *FileMutation) ResetFileName() { + m.file_name = nil +} + +// SetFileExtension sets the "file_extension" field. +func (m *FileMutation) SetFileExtension(s string) { + m.file_extension = &s +} + +// FileExtension returns the value of the "file_extension" field in the mutation. +func (m *FileMutation) FileExtension() (r string, exists bool) { + v := m.file_extension + if v == nil { + return + } + return *v, true +} + +// OldFileExtension returns the old "file_extension" field's value of the File entity. +// If the File 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 *FileMutation) OldFileExtension(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFileExtension is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFileExtension requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFileExtension: %w", err) + } + return oldValue.FileExtension, nil +} + +// ResetFileExtension resets all changes to the "file_extension" field. +func (m *FileMutation) ResetFileExtension() { + m.file_extension = nil +} + +// SetFileSize sets the "file_size" field. +func (m *FileMutation) SetFileSize(i int) { + m.file_size = &i + m.addfile_size = nil +} + +// FileSize returns the value of the "file_size" field in the mutation. +func (m *FileMutation) FileSize() (r int, exists bool) { + v := m.file_size + if v == nil { + return + } + return *v, true +} + +// OldFileSize returns the old "file_size" field's value of the File entity. +// If the File 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 *FileMutation) OldFileSize(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFileSize is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFileSize requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFileSize: %w", err) + } + return oldValue.FileSize, nil +} + +// AddFileSize adds i to the "file_size" field. +func (m *FileMutation) AddFileSize(i int) { + if m.addfile_size != nil { + *m.addfile_size += i + } else { + m.addfile_size = &i + } +} + +// AddedFileSize returns the value that was added to the "file_size" field in this mutation. +func (m *FileMutation) AddedFileSize() (r int, exists bool) { + v := m.addfile_size + if v == nil { + return + } + return *v, true +} + +// ClearFileSize clears the value of the "file_size" field. +func (m *FileMutation) ClearFileSize() { + m.file_size = nil + m.addfile_size = nil + m.clearedFields[file.FieldFileSize] = struct{}{} +} + +// FileSizeCleared returns if the "file_size" field was cleared in this mutation. +func (m *FileMutation) FileSizeCleared() bool { + _, ok := m.clearedFields[file.FieldFileSize] + return ok +} + +// ResetFileSize resets all changes to the "file_size" field. +func (m *FileMutation) ResetFileSize() { + m.file_size = nil + m.addfile_size = nil + delete(m.clearedFields, file.FieldFileSize) +} + +// SetContentType sets the "content_type" field. +func (m *FileMutation) SetContentType(s string) { + m.content_type = &s +} + +// ContentType returns the value of the "content_type" field in the mutation. +func (m *FileMutation) ContentType() (r string, exists bool) { + v := m.content_type + if v == nil { + return + } + return *v, true +} + +// OldContentType returns the old "content_type" field's value of the File entity. +// If the File 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 *FileMutation) OldContentType(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldContentType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldContentType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldContentType: %w", err) + } + return oldValue.ContentType, nil +} + +// ResetContentType resets all changes to the "content_type" field. +func (m *FileMutation) ResetContentType() { + m.content_type = nil +} + +// SetStoreKey sets the "store_key" field. +func (m *FileMutation) SetStoreKey(s string) { + m.store_key = &s +} + +// StoreKey returns the value of the "store_key" field in the mutation. +func (m *FileMutation) StoreKey() (r string, exists bool) { + v := m.store_key + if v == nil { + return + } + return *v, true +} + +// OldStoreKey returns the old "store_key" field's value of the File entity. +// If the File 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 *FileMutation) OldStoreKey(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStoreKey is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStoreKey requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStoreKey: %w", err) + } + return oldValue.StoreKey, nil +} + +// ResetStoreKey resets all changes to the "store_key" field. +func (m *FileMutation) ResetStoreKey() { + m.store_key = nil +} + +// SetCategory sets the "category" field. +func (m *FileMutation) SetCategory(s string) { + m.category = &s +} + +// Category returns the value of the "category" field in the mutation. +func (m *FileMutation) Category() (r string, exists bool) { + v := m.category + if v == nil { + return + } + return *v, true +} + +// OldCategory returns the old "category" field's value of the File entity. +// If the File 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 *FileMutation) OldCategory(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCategory is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCategory requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCategory: %w", err) + } + return oldValue.Category, nil +} + +// ClearCategory clears the value of the "category" field. +func (m *FileMutation) ClearCategory() { + m.category = nil + m.clearedFields[file.FieldCategory] = struct{}{} +} + +// CategoryCleared returns if the "category" field was cleared in this mutation. +func (m *FileMutation) CategoryCleared() bool { + _, ok := m.clearedFields[file.FieldCategory] + return ok +} + +// ResetCategory resets all changes to the "category" field. +func (m *FileMutation) ResetCategory() { + m.category = nil + delete(m.clearedFields, file.FieldCategory) +} + +// SetAnnotation sets the "annotation" field. +func (m *FileMutation) SetAnnotation(s string) { + m.annotation = &s +} + +// Annotation returns the value of the "annotation" field in the mutation. +func (m *FileMutation) Annotation() (r string, exists bool) { + v := m.annotation + if v == nil { + return + } + return *v, true +} + +// OldAnnotation returns the old "annotation" field's value of the File entity. +// If the File 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 *FileMutation) OldAnnotation(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAnnotation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAnnotation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAnnotation: %w", err) + } + return oldValue.Annotation, nil +} + +// ClearAnnotation clears the value of the "annotation" field. +func (m *FileMutation) ClearAnnotation() { + m.annotation = nil + m.clearedFields[file.FieldAnnotation] = struct{}{} +} + +// AnnotationCleared returns if the "annotation" field was cleared in this mutation. +func (m *FileMutation) AnnotationCleared() bool { + _, ok := m.clearedFields[file.FieldAnnotation] + return ok +} + +// ResetAnnotation resets all changes to the "annotation" field. +func (m *FileMutation) ResetAnnotation() { + m.annotation = nil + delete(m.clearedFields, file.FieldAnnotation) +} + +// SetUserID sets the "user" edge to the User entity by id. +func (m *FileMutation) SetUserID(id string) { + m.user = &id +} + +// ClearUser clears the "user" edge to the User entity. +func (m *FileMutation) ClearUser() { + m.cleareduser = true +} + +// UserCleared reports if the "user" edge to the User entity was cleared. +func (m *FileMutation) UserCleared() bool { + return m.cleareduser +} + +// UserID returns the "user" edge ID in the mutation. +func (m *FileMutation) UserID() (id string, exists bool) { + if m.user != nil { + return *m.user, true + } + return +} + +// UserIDs returns the "user" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// UserID instead. It exists only for internal usage by the builders. +func (m *FileMutation) UserIDs() (ids []string) { + if id := m.user; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetUser resets all changes to the "user" edge. +func (m *FileMutation) ResetUser() { + m.user = nil + m.cleareduser = false +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by ids. +func (m *FileMutation) AddOrganizationIDs(ids ...string) { + if m.organization == nil { + m.organization = make(map[string]struct{}) + } + for i := range ids { + m.organization[ids[i]] = struct{}{} + } +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (m *FileMutation) ClearOrganization() { + m.clearedorganization = true +} + +// OrganizationCleared reports if the "organization" edge to the Organization entity was cleared. +func (m *FileMutation) OrganizationCleared() bool { + return m.clearedorganization +} + +// RemoveOrganizationIDs removes the "organization" edge to the Organization entity by IDs. +func (m *FileMutation) RemoveOrganizationIDs(ids ...string) { + if m.removedorganization == nil { + m.removedorganization = make(map[string]struct{}) + } + for i := range ids { + delete(m.organization, ids[i]) + m.removedorganization[ids[i]] = struct{}{} + } +} + +// RemovedOrganization returns the removed IDs of the "organization" edge to the Organization entity. +func (m *FileMutation) RemovedOrganizationIDs() (ids []string) { + for id := range m.removedorganization { + ids = append(ids, id) + } + return +} + +// OrganizationIDs returns the "organization" edge IDs in the mutation. +func (m *FileMutation) OrganizationIDs() (ids []string) { + for id := range m.organization { + ids = append(ids, id) + } + return +} + +// ResetOrganization resets all changes to the "organization" edge. +func (m *FileMutation) ResetOrganization() { + m.organization = nil + m.clearedorganization = false + m.removedorganization = nil +} + +// AddEntityIDs adds the "entity" edge to the Entity entity by ids. +func (m *FileMutation) AddEntityIDs(ids ...string) { + if m.entity == nil { + m.entity = make(map[string]struct{}) + } + for i := range ids { + m.entity[ids[i]] = struct{}{} + } +} + +// ClearEntity clears the "entity" edge to the Entity entity. +func (m *FileMutation) ClearEntity() { + m.clearedentity = true +} + +// EntityCleared reports if the "entity" edge to the Entity entity was cleared. +func (m *FileMutation) EntityCleared() bool { + return m.clearedentity +} + +// RemoveEntityIDs removes the "entity" edge to the Entity entity by IDs. +func (m *FileMutation) RemoveEntityIDs(ids ...string) { + if m.removedentity == nil { + m.removedentity = make(map[string]struct{}) + } + for i := range ids { + delete(m.entity, ids[i]) + m.removedentity[ids[i]] = struct{}{} + } +} + +// RemovedEntity returns the removed IDs of the "entity" edge to the Entity entity. +func (m *FileMutation) RemovedEntityIDs() (ids []string) { + for id := range m.removedentity { + ids = append(ids, id) + } + return +} + +// EntityIDs returns the "entity" edge IDs in the mutation. +func (m *FileMutation) EntityIDs() (ids []string) { + for id := range m.entity { + ids = append(ids, id) + } + return +} + +// ResetEntity resets all changes to the "entity" edge. +func (m *FileMutation) ResetEntity() { + m.entity = nil + m.clearedentity = false + m.removedentity = nil +} + +// AddGroupIDs adds the "group" edge to the Group entity by ids. +func (m *FileMutation) AddGroupIDs(ids ...string) { + if m.group == nil { + m.group = make(map[string]struct{}) + } + for i := range ids { + m.group[ids[i]] = struct{}{} + } +} + +// ClearGroup clears the "group" edge to the Group entity. +func (m *FileMutation) ClearGroup() { + m.clearedgroup = true +} + +// GroupCleared reports if the "group" edge to the Group entity was cleared. +func (m *FileMutation) GroupCleared() bool { + return m.clearedgroup +} + +// RemoveGroupIDs removes the "group" edge to the Group entity by IDs. +func (m *FileMutation) RemoveGroupIDs(ids ...string) { + if m.removedgroup == nil { + m.removedgroup = make(map[string]struct{}) + } + for i := range ids { + delete(m.group, ids[i]) + m.removedgroup[ids[i]] = struct{}{} + } +} + +// RemovedGroup returns the removed IDs of the "group" edge to the Group entity. +func (m *FileMutation) RemovedGroupIDs() (ids []string) { + for id := range m.removedgroup { + ids = append(ids, id) + } + return +} + +// GroupIDs returns the "group" edge IDs in the mutation. +func (m *FileMutation) GroupIDs() (ids []string) { + for id := range m.group { + ids = append(ids, id) + } + return +} + +// ResetGroup resets all changes to the "group" edge. +func (m *FileMutation) ResetGroup() { + m.group = nil + m.clearedgroup = false + m.removedgroup = nil +} + +// Where appends a list predicates to the FileMutation builder. +func (m *FileMutation) Where(ps ...predicate.File) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the FileMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *FileMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.File, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *FileMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *FileMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (File). +func (m *FileMutation) 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 *FileMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.created_at != nil { + fields = append(fields, file.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, file.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, file.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, file.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, file.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, file.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, file.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, file.FieldTags) + } + if m.file_name != nil { + fields = append(fields, file.FieldFileName) + } + if m.file_extension != nil { + fields = append(fields, file.FieldFileExtension) + } + if m.file_size != nil { + fields = append(fields, file.FieldFileSize) + } + if m.content_type != nil { + fields = append(fields, file.FieldContentType) + } + if m.store_key != nil { + fields = append(fields, file.FieldStoreKey) + } + if m.category != nil { + fields = append(fields, file.FieldCategory) + } + if m.annotation != nil { + fields = append(fields, file.FieldAnnotation) + } + 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 *FileMutation) Field(name string) (ent.Value, bool) { + switch name { + case file.FieldCreatedAt: + return m.CreatedAt() + case file.FieldUpdatedAt: + return m.UpdatedAt() + case file.FieldCreatedBy: + return m.CreatedBy() + case file.FieldUpdatedBy: + return m.UpdatedBy() + case file.FieldDeletedAt: + return m.DeletedAt() + case file.FieldDeletedBy: + return m.DeletedBy() + case file.FieldMappingID: + return m.MappingID() + case file.FieldTags: + return m.Tags() + case file.FieldFileName: + return m.FileName() + case file.FieldFileExtension: + return m.FileExtension() + case file.FieldFileSize: + return m.FileSize() + case file.FieldContentType: + return m.ContentType() + case file.FieldStoreKey: + return m.StoreKey() + case file.FieldCategory: + return m.Category() + case file.FieldAnnotation: + return m.Annotation() + } + 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 *FileMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case file.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case file.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case file.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case file.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case file.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case file.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case file.FieldMappingID: + return m.OldMappingID(ctx) + case file.FieldTags: + return m.OldTags(ctx) + case file.FieldFileName: + return m.OldFileName(ctx) + case file.FieldFileExtension: + return m.OldFileExtension(ctx) + case file.FieldFileSize: + return m.OldFileSize(ctx) + case file.FieldContentType: + return m.OldContentType(ctx) + case file.FieldStoreKey: + return m.OldStoreKey(ctx) + case file.FieldCategory: + return m.OldCategory(ctx) + case file.FieldAnnotation: + return m.OldAnnotation(ctx) + } + return nil, fmt.Errorf("unknown File 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 *FileMutation) SetField(name string, value ent.Value) error { + switch name { + case file.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case file.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case file.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case file.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case file.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case file.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case file.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case file.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case file.FieldFileName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFileName(v) + return nil + case file.FieldFileExtension: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFileExtension(v) + return nil + case file.FieldFileSize: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFileSize(v) + return nil + case file.FieldContentType: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetContentType(v) + return nil + case file.FieldStoreKey: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStoreKey(v) + return nil + case file.FieldCategory: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCategory(v) + return nil + case file.FieldAnnotation: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAnnotation(v) + return nil + } + return fmt.Errorf("unknown File field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *FileMutation) AddedFields() []string { + var fields []string + if m.addfile_size != nil { + fields = append(fields, file.FieldFileSize) + } + return fields +} + +// 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 *FileMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case file.FieldFileSize: + return m.AddedFileSize() + } + 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 *FileMutation) AddField(name string, value ent.Value) error { + switch name { + case file.FieldFileSize: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddFileSize(v) + return nil + } + return fmt.Errorf("unknown File numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *FileMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(file.FieldCreatedAt) { + fields = append(fields, file.FieldCreatedAt) + } + if m.FieldCleared(file.FieldUpdatedAt) { + fields = append(fields, file.FieldUpdatedAt) + } + if m.FieldCleared(file.FieldCreatedBy) { + fields = append(fields, file.FieldCreatedBy) + } + if m.FieldCleared(file.FieldUpdatedBy) { + fields = append(fields, file.FieldUpdatedBy) + } + if m.FieldCleared(file.FieldDeletedAt) { + fields = append(fields, file.FieldDeletedAt) + } + if m.FieldCleared(file.FieldDeletedBy) { + fields = append(fields, file.FieldDeletedBy) + } + if m.FieldCleared(file.FieldTags) { + fields = append(fields, file.FieldTags) + } + if m.FieldCleared(file.FieldFileSize) { + fields = append(fields, file.FieldFileSize) + } + if m.FieldCleared(file.FieldCategory) { + fields = append(fields, file.FieldCategory) + } + if m.FieldCleared(file.FieldAnnotation) { + fields = append(fields, file.FieldAnnotation) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *FileMutation) 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 *FileMutation) ClearField(name string) error { + switch name { + case file.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case file.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case file.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case file.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case file.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case file.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case file.FieldTags: + m.ClearTags() + return nil + case file.FieldFileSize: + m.ClearFileSize() + return nil + case file.FieldCategory: + m.ClearCategory() + return nil + case file.FieldAnnotation: + m.ClearAnnotation() + return nil + } + return fmt.Errorf("unknown File 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 *FileMutation) ResetField(name string) error { + switch name { + case file.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case file.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case file.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case file.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case file.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case file.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case file.FieldMappingID: + m.ResetMappingID() + return nil + case file.FieldTags: + m.ResetTags() + return nil + case file.FieldFileName: + m.ResetFileName() + return nil + case file.FieldFileExtension: + m.ResetFileExtension() + return nil + case file.FieldFileSize: + m.ResetFileSize() + return nil + case file.FieldContentType: + m.ResetContentType() + return nil + case file.FieldStoreKey: + m.ResetStoreKey() + return nil + case file.FieldCategory: + m.ResetCategory() + return nil + case file.FieldAnnotation: + m.ResetAnnotation() + return nil + } + return fmt.Errorf("unknown File field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *FileMutation) AddedEdges() []string { + edges := make([]string, 0, 4) + if m.user != nil { + edges = append(edges, file.EdgeUser) + } + if m.organization != nil { + edges = append(edges, file.EdgeOrganization) + } + if m.entity != nil { + edges = append(edges, file.EdgeEntity) + } + if m.group != nil { + edges = append(edges, file.EdgeGroup) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *FileMutation) AddedIDs(name string) []ent.Value { + switch name { + case file.EdgeUser: + if id := m.user; id != nil { + return []ent.Value{*id} + } + case file.EdgeOrganization: + ids := make([]ent.Value, 0, len(m.organization)) + for id := range m.organization { + ids = append(ids, id) + } + return ids + case file.EdgeEntity: + ids := make([]ent.Value, 0, len(m.entity)) + for id := range m.entity { + ids = append(ids, id) + } + return ids + case file.EdgeGroup: + ids := make([]ent.Value, 0, len(m.group)) + for id := range m.group { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *FileMutation) RemovedEdges() []string { + edges := make([]string, 0, 4) + if m.removedorganization != nil { + edges = append(edges, file.EdgeOrganization) + } + if m.removedentity != nil { + edges = append(edges, file.EdgeEntity) + } + if m.removedgroup != nil { + edges = append(edges, file.EdgeGroup) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *FileMutation) RemovedIDs(name string) []ent.Value { + switch name { + case file.EdgeOrganization: + ids := make([]ent.Value, 0, len(m.removedorganization)) + for id := range m.removedorganization { + ids = append(ids, id) + } + return ids + case file.EdgeEntity: + ids := make([]ent.Value, 0, len(m.removedentity)) + for id := range m.removedentity { + ids = append(ids, id) + } + return ids + case file.EdgeGroup: + ids := make([]ent.Value, 0, len(m.removedgroup)) + for id := range m.removedgroup { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *FileMutation) ClearedEdges() []string { + edges := make([]string, 0, 4) + if m.cleareduser { + edges = append(edges, file.EdgeUser) + } + if m.clearedorganization { + edges = append(edges, file.EdgeOrganization) + } + if m.clearedentity { + edges = append(edges, file.EdgeEntity) + } + if m.clearedgroup { + edges = append(edges, file.EdgeGroup) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *FileMutation) EdgeCleared(name string) bool { + switch name { + case file.EdgeUser: + return m.cleareduser + case file.EdgeOrganization: + return m.clearedorganization + case file.EdgeEntity: + return m.clearedentity + case file.EdgeGroup: + return m.clearedgroup + } + 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 *FileMutation) ClearEdge(name string) error { + switch name { + case file.EdgeUser: + m.ClearUser() + return nil + } + return fmt.Errorf("unknown File 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 *FileMutation) ResetEdge(name string) error { + switch name { + case file.EdgeUser: + m.ResetUser() + return nil + case file.EdgeOrganization: + m.ResetOrganization() + return nil + case file.EdgeEntity: + m.ResetEntity() + return nil + case file.EdgeGroup: + m.ResetGroup() + return nil + } + return fmt.Errorf("unknown File edge %s", name) +} + +// FileHistoryMutation represents an operation that mutates the FileHistory nodes in the graph. +type FileHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + file_name *string + file_extension *string + file_size *int + addfile_size *int + content_type *string + store_key *string + category *string + annotation *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*FileHistory, error) + predicates []predicate.FileHistory +} + +var _ ent.Mutation = (*FileHistoryMutation)(nil) + +// filehistoryOption allows management of the mutation configuration using functional options. +type filehistoryOption func(*FileHistoryMutation) + +// newFileHistoryMutation creates new mutation for the FileHistory entity. +func newFileHistoryMutation(c config, op Op, opts ...filehistoryOption) *FileHistoryMutation { + m := &FileHistoryMutation{ + config: c, + op: op, + typ: TypeFileHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withFileHistoryID sets the ID field of the mutation. +func withFileHistoryID(id string) filehistoryOption { + return func(m *FileHistoryMutation) { + var ( + err error + once sync.Once + value *FileHistory + ) + m.oldValue = func(ctx context.Context) (*FileHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().FileHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withFileHistory sets the old FileHistory of the mutation. +func withFileHistory(node *FileHistory) filehistoryOption { + return func(m *FileHistoryMutation) { + m.oldValue = func(context.Context) (*FileHistory, 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 FileHistoryMutation) 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 FileHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of FileHistory entities. +func (m *FileHistoryMutation) SetID(id string) { + 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 *FileHistoryMutation) ID() (id string, 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 *FileHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().FileHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *FileHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *FileHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *FileHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *FileHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *FileHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *FileHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[filehistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *FileHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[filehistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *FileHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, filehistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *FileHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *FileHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *FileHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *FileHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *FileHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *FileHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[filehistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *FileHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[filehistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *FileHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, filehistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *FileHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *FileHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *FileHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[filehistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *FileHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[filehistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *FileHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, filehistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *FileHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *FileHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *FileHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[filehistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *FileHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[filehistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *FileHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, filehistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *FileHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *FileHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *FileHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[filehistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *FileHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[filehistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *FileHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, filehistory.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *FileHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *FileHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *FileHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[filehistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *FileHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[filehistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *FileHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, filehistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *FileHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *FileHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *FileHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[filehistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *FileHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[filehistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *FileHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, filehistory.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *FileHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *FileHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *FileHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *FileHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *FileHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *FileHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *FileHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *FileHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[filehistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *FileHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[filehistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *FileHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, filehistory.FieldTags) +} + +// SetFileName sets the "file_name" field. +func (m *FileHistoryMutation) SetFileName(s string) { + m.file_name = &s +} + +// FileName returns the value of the "file_name" field in the mutation. +func (m *FileHistoryMutation) FileName() (r string, exists bool) { + v := m.file_name + if v == nil { + return + } + return *v, true +} + +// OldFileName returns the old "file_name" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldFileName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFileName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFileName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFileName: %w", err) + } + return oldValue.FileName, nil +} + +// ResetFileName resets all changes to the "file_name" field. +func (m *FileHistoryMutation) ResetFileName() { + m.file_name = nil +} + +// SetFileExtension sets the "file_extension" field. +func (m *FileHistoryMutation) SetFileExtension(s string) { + m.file_extension = &s +} + +// FileExtension returns the value of the "file_extension" field in the mutation. +func (m *FileHistoryMutation) FileExtension() (r string, exists bool) { + v := m.file_extension + if v == nil { + return + } + return *v, true +} + +// OldFileExtension returns the old "file_extension" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldFileExtension(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFileExtension is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFileExtension requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFileExtension: %w", err) + } + return oldValue.FileExtension, nil +} + +// ResetFileExtension resets all changes to the "file_extension" field. +func (m *FileHistoryMutation) ResetFileExtension() { + m.file_extension = nil +} + +// SetFileSize sets the "file_size" field. +func (m *FileHistoryMutation) SetFileSize(i int) { + m.file_size = &i + m.addfile_size = nil +} + +// FileSize returns the value of the "file_size" field in the mutation. +func (m *FileHistoryMutation) FileSize() (r int, exists bool) { + v := m.file_size + if v == nil { + return + } + return *v, true +} + +// OldFileSize returns the old "file_size" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldFileSize(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFileSize is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFileSize requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFileSize: %w", err) + } + return oldValue.FileSize, nil +} + +// AddFileSize adds i to the "file_size" field. +func (m *FileHistoryMutation) AddFileSize(i int) { + if m.addfile_size != nil { + *m.addfile_size += i + } else { + m.addfile_size = &i + } +} + +// AddedFileSize returns the value that was added to the "file_size" field in this mutation. +func (m *FileHistoryMutation) AddedFileSize() (r int, exists bool) { + v := m.addfile_size + if v == nil { + return + } + return *v, true +} + +// ClearFileSize clears the value of the "file_size" field. +func (m *FileHistoryMutation) ClearFileSize() { + m.file_size = nil + m.addfile_size = nil + m.clearedFields[filehistory.FieldFileSize] = struct{}{} +} + +// FileSizeCleared returns if the "file_size" field was cleared in this mutation. +func (m *FileHistoryMutation) FileSizeCleared() bool { + _, ok := m.clearedFields[filehistory.FieldFileSize] + return ok +} + +// ResetFileSize resets all changes to the "file_size" field. +func (m *FileHistoryMutation) ResetFileSize() { + m.file_size = nil + m.addfile_size = nil + delete(m.clearedFields, filehistory.FieldFileSize) +} + +// SetContentType sets the "content_type" field. +func (m *FileHistoryMutation) SetContentType(s string) { + m.content_type = &s +} + +// ContentType returns the value of the "content_type" field in the mutation. +func (m *FileHistoryMutation) ContentType() (r string, exists bool) { + v := m.content_type + if v == nil { + return + } + return *v, true +} + +// OldContentType returns the old "content_type" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldContentType(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldContentType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldContentType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldContentType: %w", err) + } + return oldValue.ContentType, nil +} + +// ResetContentType resets all changes to the "content_type" field. +func (m *FileHistoryMutation) ResetContentType() { + m.content_type = nil +} + +// SetStoreKey sets the "store_key" field. +func (m *FileHistoryMutation) SetStoreKey(s string) { + m.store_key = &s +} + +// StoreKey returns the value of the "store_key" field in the mutation. +func (m *FileHistoryMutation) StoreKey() (r string, exists bool) { + v := m.store_key + if v == nil { + return + } + return *v, true +} + +// OldStoreKey returns the old "store_key" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldStoreKey(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStoreKey is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStoreKey requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStoreKey: %w", err) + } + return oldValue.StoreKey, nil +} + +// ResetStoreKey resets all changes to the "store_key" field. +func (m *FileHistoryMutation) ResetStoreKey() { + m.store_key = nil +} + +// SetCategory sets the "category" field. +func (m *FileHistoryMutation) SetCategory(s string) { + m.category = &s +} + +// Category returns the value of the "category" field in the mutation. +func (m *FileHistoryMutation) Category() (r string, exists bool) { + v := m.category + if v == nil { + return + } + return *v, true +} + +// OldCategory returns the old "category" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldCategory(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCategory is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCategory requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCategory: %w", err) + } + return oldValue.Category, nil +} + +// ClearCategory clears the value of the "category" field. +func (m *FileHistoryMutation) ClearCategory() { + m.category = nil + m.clearedFields[filehistory.FieldCategory] = struct{}{} +} + +// CategoryCleared returns if the "category" field was cleared in this mutation. +func (m *FileHistoryMutation) CategoryCleared() bool { + _, ok := m.clearedFields[filehistory.FieldCategory] + return ok +} + +// ResetCategory resets all changes to the "category" field. +func (m *FileHistoryMutation) ResetCategory() { + m.category = nil + delete(m.clearedFields, filehistory.FieldCategory) +} + +// SetAnnotation sets the "annotation" field. +func (m *FileHistoryMutation) SetAnnotation(s string) { + m.annotation = &s +} + +// Annotation returns the value of the "annotation" field in the mutation. +func (m *FileHistoryMutation) Annotation() (r string, exists bool) { + v := m.annotation + if v == nil { + return + } + return *v, true +} + +// OldAnnotation returns the old "annotation" field's value of the FileHistory entity. +// If the FileHistory 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 *FileHistoryMutation) OldAnnotation(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAnnotation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAnnotation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAnnotation: %w", err) + } + return oldValue.Annotation, nil +} + +// ClearAnnotation clears the value of the "annotation" field. +func (m *FileHistoryMutation) ClearAnnotation() { + m.annotation = nil + m.clearedFields[filehistory.FieldAnnotation] = struct{}{} +} + +// AnnotationCleared returns if the "annotation" field was cleared in this mutation. +func (m *FileHistoryMutation) AnnotationCleared() bool { + _, ok := m.clearedFields[filehistory.FieldAnnotation] + return ok +} + +// ResetAnnotation resets all changes to the "annotation" field. +func (m *FileHistoryMutation) ResetAnnotation() { + m.annotation = nil + delete(m.clearedFields, filehistory.FieldAnnotation) +} + +// Where appends a list predicates to the FileHistoryMutation builder. +func (m *FileHistoryMutation) Where(ps ...predicate.FileHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the FileHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *FileHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.FileHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *FileHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *FileHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (FileHistory). +func (m *FileHistoryMutation) 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 *FileHistoryMutation) Fields() []string { + fields := make([]string, 0, 18) + if m.history_time != nil { + fields = append(fields, filehistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, filehistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, filehistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, filehistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, filehistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, filehistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, filehistory.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, filehistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, filehistory.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, filehistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, filehistory.FieldTags) + } + if m.file_name != nil { + fields = append(fields, filehistory.FieldFileName) + } + if m.file_extension != nil { + fields = append(fields, filehistory.FieldFileExtension) + } + if m.file_size != nil { + fields = append(fields, filehistory.FieldFileSize) + } + if m.content_type != nil { + fields = append(fields, filehistory.FieldContentType) + } + if m.store_key != nil { + fields = append(fields, filehistory.FieldStoreKey) + } + if m.category != nil { + fields = append(fields, filehistory.FieldCategory) + } + if m.annotation != nil { + fields = append(fields, filehistory.FieldAnnotation) + } + 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 *FileHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case filehistory.FieldHistoryTime: + return m.HistoryTime() + case filehistory.FieldRef: + return m.Ref() + case filehistory.FieldOperation: + return m.Operation() + case filehistory.FieldCreatedAt: + return m.CreatedAt() + case filehistory.FieldUpdatedAt: + return m.UpdatedAt() + case filehistory.FieldCreatedBy: + return m.CreatedBy() + case filehistory.FieldUpdatedBy: + return m.UpdatedBy() + case filehistory.FieldDeletedAt: + return m.DeletedAt() + case filehistory.FieldDeletedBy: + return m.DeletedBy() + case filehistory.FieldMappingID: + return m.MappingID() + case filehistory.FieldTags: + return m.Tags() + case filehistory.FieldFileName: + return m.FileName() + case filehistory.FieldFileExtension: + return m.FileExtension() + case filehistory.FieldFileSize: + return m.FileSize() + case filehistory.FieldContentType: + return m.ContentType() + case filehistory.FieldStoreKey: + return m.StoreKey() + case filehistory.FieldCategory: + return m.Category() + case filehistory.FieldAnnotation: + return m.Annotation() + } + 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 *FileHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case filehistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case filehistory.FieldRef: + return m.OldRef(ctx) + case filehistory.FieldOperation: + return m.OldOperation(ctx) + case filehistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case filehistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case filehistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case filehistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case filehistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case filehistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case filehistory.FieldMappingID: + return m.OldMappingID(ctx) + case filehistory.FieldTags: + return m.OldTags(ctx) + case filehistory.FieldFileName: + return m.OldFileName(ctx) + case filehistory.FieldFileExtension: + return m.OldFileExtension(ctx) + case filehistory.FieldFileSize: + return m.OldFileSize(ctx) + case filehistory.FieldContentType: + return m.OldContentType(ctx) + case filehistory.FieldStoreKey: + return m.OldStoreKey(ctx) + case filehistory.FieldCategory: + return m.OldCategory(ctx) + case filehistory.FieldAnnotation: + return m.OldAnnotation(ctx) + } + return nil, fmt.Errorf("unknown FileHistory 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 *FileHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case filehistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case filehistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case filehistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case filehistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case filehistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case filehistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case filehistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case filehistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case filehistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case filehistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case filehistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case filehistory.FieldFileName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFileName(v) + return nil + case filehistory.FieldFileExtension: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFileExtension(v) + return nil + case filehistory.FieldFileSize: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFileSize(v) + return nil + case filehistory.FieldContentType: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetContentType(v) + return nil + case filehistory.FieldStoreKey: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStoreKey(v) + return nil + case filehistory.FieldCategory: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCategory(v) + return nil + case filehistory.FieldAnnotation: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAnnotation(v) + return nil + } + return fmt.Errorf("unknown FileHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *FileHistoryMutation) AddedFields() []string { + var fields []string + if m.addfile_size != nil { + fields = append(fields, filehistory.FieldFileSize) + } + return fields +} + +// 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 *FileHistoryMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case filehistory.FieldFileSize: + return m.AddedFileSize() + } + 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 *FileHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + case filehistory.FieldFileSize: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddFileSize(v) + return nil + } + return fmt.Errorf("unknown FileHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *FileHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(filehistory.FieldRef) { + fields = append(fields, filehistory.FieldRef) + } + if m.FieldCleared(filehistory.FieldCreatedAt) { + fields = append(fields, filehistory.FieldCreatedAt) + } + if m.FieldCleared(filehistory.FieldUpdatedAt) { + fields = append(fields, filehistory.FieldUpdatedAt) + } + if m.FieldCleared(filehistory.FieldCreatedBy) { + fields = append(fields, filehistory.FieldCreatedBy) + } + if m.FieldCleared(filehistory.FieldUpdatedBy) { + fields = append(fields, filehistory.FieldUpdatedBy) + } + if m.FieldCleared(filehistory.FieldDeletedAt) { + fields = append(fields, filehistory.FieldDeletedAt) + } + if m.FieldCleared(filehistory.FieldDeletedBy) { + fields = append(fields, filehistory.FieldDeletedBy) + } + if m.FieldCleared(filehistory.FieldTags) { + fields = append(fields, filehistory.FieldTags) + } + if m.FieldCleared(filehistory.FieldFileSize) { + fields = append(fields, filehistory.FieldFileSize) + } + if m.FieldCleared(filehistory.FieldCategory) { + fields = append(fields, filehistory.FieldCategory) + } + if m.FieldCleared(filehistory.FieldAnnotation) { + fields = append(fields, filehistory.FieldAnnotation) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *FileHistoryMutation) 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 *FileHistoryMutation) ClearField(name string) error { + switch name { + case filehistory.FieldRef: + m.ClearRef() + return nil + case filehistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case filehistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case filehistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case filehistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case filehistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case filehistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case filehistory.FieldTags: + m.ClearTags() + return nil + case filehistory.FieldFileSize: + m.ClearFileSize() + return nil + case filehistory.FieldCategory: + m.ClearCategory() + return nil + case filehistory.FieldAnnotation: + m.ClearAnnotation() + return nil + } + return fmt.Errorf("unknown FileHistory 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 *FileHistoryMutation) ResetField(name string) error { + switch name { + case filehistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case filehistory.FieldRef: + m.ResetRef() + return nil + case filehistory.FieldOperation: + m.ResetOperation() + return nil + case filehistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case filehistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case filehistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case filehistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case filehistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case filehistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case filehistory.FieldMappingID: + m.ResetMappingID() + return nil + case filehistory.FieldTags: + m.ResetTags() + return nil + case filehistory.FieldFileName: + m.ResetFileName() + return nil + case filehistory.FieldFileExtension: + m.ResetFileExtension() + return nil + case filehistory.FieldFileSize: + m.ResetFileSize() + return nil + case filehistory.FieldContentType: + m.ResetContentType() + return nil + case filehistory.FieldStoreKey: + m.ResetStoreKey() + return nil + case filehistory.FieldCategory: + m.ResetCategory() + return nil + case filehistory.FieldAnnotation: + m.ResetAnnotation() + return nil + } + return fmt.Errorf("unknown FileHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *FileHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *FileHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *FileHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *FileHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *FileHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *FileHistoryMutation) EdgeCleared(name string) bool { + 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 *FileHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown FileHistory 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 *FileHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown FileHistory edge %s", name) +} + +// GroupMutation represents an operation that mutates the Group nodes in the graph. +type GroupMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + name *string + description *string + gravatar_logo_url *string + logo_url *string + display_name *string + clearedFields map[string]struct{} + owner *string + clearedowner bool + setting *string + clearedsetting bool + users map[string]struct{} + removedusers map[string]struct{} + clearedusers bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + integrations map[string]struct{} + removedintegrations map[string]struct{} + clearedintegrations bool + files map[string]struct{} + removedfiles map[string]struct{} + clearedfiles bool + members map[string]struct{} + removedmembers map[string]struct{} + clearedmembers bool + done bool + oldValue func(context.Context) (*Group, error) + predicates []predicate.Group +} + +var _ ent.Mutation = (*GroupMutation)(nil) + +// groupOption allows management of the mutation configuration using functional options. +type groupOption func(*GroupMutation) + +// newGroupMutation creates new mutation for the Group entity. +func newGroupMutation(c config, op Op, opts ...groupOption) *GroupMutation { + m := &GroupMutation{ + config: c, + op: op, + typ: TypeGroup, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withGroupID sets the ID field of the mutation. +func withGroupID(id string) groupOption { + return func(m *GroupMutation) { + var ( + err error + once sync.Once + value *Group + ) + m.oldValue = func(ctx context.Context) (*Group, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Group.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroup sets the old Group of the mutation. +func withGroup(node *Group) groupOption { + return func(m *GroupMutation) { + m.oldValue = func(context.Context) (*Group, 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 GroupMutation) 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 GroupMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Group entities. +func (m *GroupMutation) SetID(id string) { + 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 *GroupMutation) ID() (id string, 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 *GroupMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Group.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *GroupMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *GroupMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *GroupMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[group.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *GroupMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[group.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *GroupMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, group.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *GroupMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *GroupMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *GroupMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[group.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *GroupMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[group.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *GroupMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, group.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *GroupMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *GroupMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *GroupMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[group.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *GroupMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[group.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *GroupMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, group.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *GroupMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *GroupMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *GroupMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[group.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *GroupMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[group.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *GroupMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, group.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *GroupMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *GroupMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *GroupMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[group.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *GroupMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[group.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *GroupMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, group.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *GroupMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *GroupMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *GroupMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[group.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *GroupMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[group.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *GroupMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, group.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *GroupMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *GroupMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *GroupMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *GroupMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *GroupMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *GroupMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *GroupMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *GroupMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[group.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *GroupMutation) TagsCleared() bool { + _, ok := m.clearedFields[group.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *GroupMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, group.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *GroupMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *GroupMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *GroupMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[group.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *GroupMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[group.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *GroupMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, group.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *GroupMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *GroupMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *GroupMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *GroupMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *GroupMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *GroupMutation) ClearDescription() { + m.description = nil + m.clearedFields[group.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *GroupMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[group.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *GroupMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, group.FieldDescription) +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (m *GroupMutation) SetGravatarLogoURL(s string) { + m.gravatar_logo_url = &s +} + +// GravatarLogoURL returns the value of the "gravatar_logo_url" field in the mutation. +func (m *GroupMutation) GravatarLogoURL() (r string, exists bool) { + v := m.gravatar_logo_url + if v == nil { + return + } + return *v, true +} + +// OldGravatarLogoURL returns the old "gravatar_logo_url" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldGravatarLogoURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGravatarLogoURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGravatarLogoURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGravatarLogoURL: %w", err) + } + return oldValue.GravatarLogoURL, nil +} + +// ClearGravatarLogoURL clears the value of the "gravatar_logo_url" field. +func (m *GroupMutation) ClearGravatarLogoURL() { + m.gravatar_logo_url = nil + m.clearedFields[group.FieldGravatarLogoURL] = struct{}{} +} + +// GravatarLogoURLCleared returns if the "gravatar_logo_url" field was cleared in this mutation. +func (m *GroupMutation) GravatarLogoURLCleared() bool { + _, ok := m.clearedFields[group.FieldGravatarLogoURL] + return ok +} + +// ResetGravatarLogoURL resets all changes to the "gravatar_logo_url" field. +func (m *GroupMutation) ResetGravatarLogoURL() { + m.gravatar_logo_url = nil + delete(m.clearedFields, group.FieldGravatarLogoURL) +} + +// SetLogoURL sets the "logo_url" field. +func (m *GroupMutation) SetLogoURL(s string) { + m.logo_url = &s +} + +// LogoURL returns the value of the "logo_url" field in the mutation. +func (m *GroupMutation) LogoURL() (r string, exists bool) { + v := m.logo_url + if v == nil { + return + } + return *v, true +} + +// OldLogoURL returns the old "logo_url" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldLogoURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLogoURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLogoURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLogoURL: %w", err) + } + return oldValue.LogoURL, nil +} + +// ClearLogoURL clears the value of the "logo_url" field. +func (m *GroupMutation) ClearLogoURL() { + m.logo_url = nil + m.clearedFields[group.FieldLogoURL] = struct{}{} +} + +// LogoURLCleared returns if the "logo_url" field was cleared in this mutation. +func (m *GroupMutation) LogoURLCleared() bool { + _, ok := m.clearedFields[group.FieldLogoURL] + return ok +} + +// ResetLogoURL resets all changes to the "logo_url" field. +func (m *GroupMutation) ResetLogoURL() { + m.logo_url = nil + delete(m.clearedFields, group.FieldLogoURL) +} + +// SetDisplayName sets the "display_name" field. +func (m *GroupMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *GroupMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the Group entity. +// If the Group 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 *GroupMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *GroupMutation) ResetDisplayName() { + m.display_name = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *GroupMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[group.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *GroupMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *GroupMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *GroupMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// SetSettingID sets the "setting" edge to the GroupSetting entity by id. +func (m *GroupMutation) SetSettingID(id string) { + m.setting = &id +} + +// ClearSetting clears the "setting" edge to the GroupSetting entity. +func (m *GroupMutation) ClearSetting() { + m.clearedsetting = true +} + +// SettingCleared reports if the "setting" edge to the GroupSetting entity was cleared. +func (m *GroupMutation) SettingCleared() bool { + return m.clearedsetting +} + +// SettingID returns the "setting" edge ID in the mutation. +func (m *GroupMutation) SettingID() (id string, exists bool) { + if m.setting != nil { + return *m.setting, true + } + return +} + +// SettingIDs returns the "setting" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// SettingID instead. It exists only for internal usage by the builders. +func (m *GroupMutation) SettingIDs() (ids []string) { + if id := m.setting; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetSetting resets all changes to the "setting" edge. +func (m *GroupMutation) ResetSetting() { + m.setting = nil + m.clearedsetting = false +} + +// AddUserIDs adds the "users" edge to the User entity by ids. +func (m *GroupMutation) AddUserIDs(ids ...string) { + if m.users == nil { + m.users = make(map[string]struct{}) + } + for i := range ids { + m.users[ids[i]] = struct{}{} + } +} + +// ClearUsers clears the "users" edge to the User entity. +func (m *GroupMutation) ClearUsers() { + m.clearedusers = true +} + +// UsersCleared reports if the "users" edge to the User entity was cleared. +func (m *GroupMutation) UsersCleared() bool { + return m.clearedusers +} + +// RemoveUserIDs removes the "users" edge to the User entity by IDs. +func (m *GroupMutation) RemoveUserIDs(ids ...string) { + if m.removedusers == nil { + m.removedusers = make(map[string]struct{}) + } + for i := range ids { + delete(m.users, ids[i]) + m.removedusers[ids[i]] = struct{}{} + } +} + +// RemovedUsers returns the removed IDs of the "users" edge to the User entity. +func (m *GroupMutation) RemovedUsersIDs() (ids []string) { + for id := range m.removedusers { + ids = append(ids, id) + } + return +} + +// UsersIDs returns the "users" edge IDs in the mutation. +func (m *GroupMutation) UsersIDs() (ids []string) { + for id := range m.users { + ids = append(ids, id) + } + return +} + +// ResetUsers resets all changes to the "users" edge. +func (m *GroupMutation) ResetUsers() { + m.users = nil + m.clearedusers = false + m.removedusers = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *GroupMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *GroupMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *GroupMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *GroupMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *GroupMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *GroupMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *GroupMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by ids. +func (m *GroupMutation) AddIntegrationIDs(ids ...string) { + if m.integrations == nil { + m.integrations = make(map[string]struct{}) + } + for i := range ids { + m.integrations[ids[i]] = struct{}{} + } +} + +// ClearIntegrations clears the "integrations" edge to the Integration entity. +func (m *GroupMutation) ClearIntegrations() { + m.clearedintegrations = true +} + +// IntegrationsCleared reports if the "integrations" edge to the Integration entity was cleared. +func (m *GroupMutation) IntegrationsCleared() bool { + return m.clearedintegrations +} + +// RemoveIntegrationIDs removes the "integrations" edge to the Integration entity by IDs. +func (m *GroupMutation) RemoveIntegrationIDs(ids ...string) { + if m.removedintegrations == nil { + m.removedintegrations = make(map[string]struct{}) + } + for i := range ids { + delete(m.integrations, ids[i]) + m.removedintegrations[ids[i]] = struct{}{} + } +} + +// RemovedIntegrations returns the removed IDs of the "integrations" edge to the Integration entity. +func (m *GroupMutation) RemovedIntegrationsIDs() (ids []string) { + for id := range m.removedintegrations { + ids = append(ids, id) + } + return +} + +// IntegrationsIDs returns the "integrations" edge IDs in the mutation. +func (m *GroupMutation) IntegrationsIDs() (ids []string) { + for id := range m.integrations { + ids = append(ids, id) + } + return +} + +// ResetIntegrations resets all changes to the "integrations" edge. +func (m *GroupMutation) ResetIntegrations() { + m.integrations = nil + m.clearedintegrations = false + m.removedintegrations = nil +} + +// AddFileIDs adds the "files" edge to the File entity by ids. +func (m *GroupMutation) AddFileIDs(ids ...string) { + if m.files == nil { + m.files = make(map[string]struct{}) + } + for i := range ids { + m.files[ids[i]] = struct{}{} + } +} + +// ClearFiles clears the "files" edge to the File entity. +func (m *GroupMutation) ClearFiles() { + m.clearedfiles = true +} + +// FilesCleared reports if the "files" edge to the File entity was cleared. +func (m *GroupMutation) FilesCleared() bool { + return m.clearedfiles +} + +// RemoveFileIDs removes the "files" edge to the File entity by IDs. +func (m *GroupMutation) RemoveFileIDs(ids ...string) { + if m.removedfiles == nil { + m.removedfiles = make(map[string]struct{}) + } + for i := range ids { + delete(m.files, ids[i]) + m.removedfiles[ids[i]] = struct{}{} + } +} + +// RemovedFiles returns the removed IDs of the "files" edge to the File entity. +func (m *GroupMutation) RemovedFilesIDs() (ids []string) { + for id := range m.removedfiles { + ids = append(ids, id) + } + return +} + +// FilesIDs returns the "files" edge IDs in the mutation. +func (m *GroupMutation) FilesIDs() (ids []string) { + for id := range m.files { + ids = append(ids, id) + } + return +} + +// ResetFiles resets all changes to the "files" edge. +func (m *GroupMutation) ResetFiles() { + m.files = nil + m.clearedfiles = false + m.removedfiles = nil +} + +// AddMemberIDs adds the "members" edge to the GroupMembership entity by ids. +func (m *GroupMutation) AddMemberIDs(ids ...string) { + if m.members == nil { + m.members = make(map[string]struct{}) + } + for i := range ids { + m.members[ids[i]] = struct{}{} + } +} + +// ClearMembers clears the "members" edge to the GroupMembership entity. +func (m *GroupMutation) ClearMembers() { + m.clearedmembers = true +} + +// MembersCleared reports if the "members" edge to the GroupMembership entity was cleared. +func (m *GroupMutation) MembersCleared() bool { + return m.clearedmembers +} + +// RemoveMemberIDs removes the "members" edge to the GroupMembership entity by IDs. +func (m *GroupMutation) RemoveMemberIDs(ids ...string) { + if m.removedmembers == nil { + m.removedmembers = make(map[string]struct{}) + } + for i := range ids { + delete(m.members, ids[i]) + m.removedmembers[ids[i]] = struct{}{} + } +} + +// RemovedMembers returns the removed IDs of the "members" edge to the GroupMembership entity. +func (m *GroupMutation) RemovedMembersIDs() (ids []string) { + for id := range m.removedmembers { + ids = append(ids, id) + } + return +} + +// MembersIDs returns the "members" edge IDs in the mutation. +func (m *GroupMutation) MembersIDs() (ids []string) { + for id := range m.members { + ids = append(ids, id) + } + return +} + +// ResetMembers resets all changes to the "members" edge. +func (m *GroupMutation) ResetMembers() { + m.members = nil + m.clearedmembers = false + m.removedmembers = nil +} + +// Where appends a list predicates to the GroupMutation builder. +func (m *GroupMutation) Where(ps ...predicate.Group) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the GroupMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *GroupMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Group, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *GroupMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *GroupMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Group). +func (m *GroupMutation) 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 *GroupMutation) Fields() []string { + fields := make([]string, 0, 14) + if m.created_at != nil { + fields = append(fields, group.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, group.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, group.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, group.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, group.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, group.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, group.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, group.FieldTags) + } + if m.owner != nil { + fields = append(fields, group.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, group.FieldName) + } + if m.description != nil { + fields = append(fields, group.FieldDescription) + } + if m.gravatar_logo_url != nil { + fields = append(fields, group.FieldGravatarLogoURL) + } + if m.logo_url != nil { + fields = append(fields, group.FieldLogoURL) + } + if m.display_name != nil { + fields = append(fields, group.FieldDisplayName) + } + 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 *GroupMutation) Field(name string) (ent.Value, bool) { + switch name { + case group.FieldCreatedAt: + return m.CreatedAt() + case group.FieldUpdatedAt: + return m.UpdatedAt() + case group.FieldCreatedBy: + return m.CreatedBy() + case group.FieldUpdatedBy: + return m.UpdatedBy() + case group.FieldDeletedAt: + return m.DeletedAt() + case group.FieldDeletedBy: + return m.DeletedBy() + case group.FieldMappingID: + return m.MappingID() + case group.FieldTags: + return m.Tags() + case group.FieldOwnerID: + return m.OwnerID() + case group.FieldName: + return m.Name() + case group.FieldDescription: + return m.Description() + case group.FieldGravatarLogoURL: + return m.GravatarLogoURL() + case group.FieldLogoURL: + return m.LogoURL() + case group.FieldDisplayName: + return m.DisplayName() + } + 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 *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case group.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case group.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case group.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case group.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case group.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case group.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case group.FieldMappingID: + return m.OldMappingID(ctx) + case group.FieldTags: + return m.OldTags(ctx) + case group.FieldOwnerID: + return m.OldOwnerID(ctx) + case group.FieldName: + return m.OldName(ctx) + case group.FieldDescription: + return m.OldDescription(ctx) + case group.FieldGravatarLogoURL: + return m.OldGravatarLogoURL(ctx) + case group.FieldLogoURL: + return m.OldLogoURL(ctx) + case group.FieldDisplayName: + return m.OldDisplayName(ctx) + } + return nil, fmt.Errorf("unknown Group 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 *GroupMutation) SetField(name string, value ent.Value) error { + switch name { + case group.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case group.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case group.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case group.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case group.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case group.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case group.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case group.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case group.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case group.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case group.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case group.FieldGravatarLogoURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGravatarLogoURL(v) + return nil + case group.FieldLogoURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLogoURL(v) + return nil + case group.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + } + return fmt.Errorf("unknown Group field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *GroupMutation) 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 *GroupMutation) 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 *GroupMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Group numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *GroupMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(group.FieldCreatedAt) { + fields = append(fields, group.FieldCreatedAt) + } + if m.FieldCleared(group.FieldUpdatedAt) { + fields = append(fields, group.FieldUpdatedAt) + } + if m.FieldCleared(group.FieldCreatedBy) { + fields = append(fields, group.FieldCreatedBy) + } + if m.FieldCleared(group.FieldUpdatedBy) { + fields = append(fields, group.FieldUpdatedBy) + } + if m.FieldCleared(group.FieldDeletedAt) { + fields = append(fields, group.FieldDeletedAt) + } + if m.FieldCleared(group.FieldDeletedBy) { + fields = append(fields, group.FieldDeletedBy) + } + if m.FieldCleared(group.FieldTags) { + fields = append(fields, group.FieldTags) + } + if m.FieldCleared(group.FieldOwnerID) { + fields = append(fields, group.FieldOwnerID) + } + if m.FieldCleared(group.FieldDescription) { + fields = append(fields, group.FieldDescription) + } + if m.FieldCleared(group.FieldGravatarLogoURL) { + fields = append(fields, group.FieldGravatarLogoURL) + } + if m.FieldCleared(group.FieldLogoURL) { + fields = append(fields, group.FieldLogoURL) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *GroupMutation) 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 *GroupMutation) ClearField(name string) error { + switch name { + case group.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case group.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case group.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case group.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case group.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case group.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case group.FieldTags: + m.ClearTags() + return nil + case group.FieldOwnerID: + m.ClearOwnerID() + return nil + case group.FieldDescription: + m.ClearDescription() + return nil + case group.FieldGravatarLogoURL: + m.ClearGravatarLogoURL() + return nil + case group.FieldLogoURL: + m.ClearLogoURL() + return nil + } + return fmt.Errorf("unknown Group 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 *GroupMutation) ResetField(name string) error { + switch name { + case group.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case group.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case group.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case group.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case group.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case group.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case group.FieldMappingID: + m.ResetMappingID() + return nil + case group.FieldTags: + m.ResetTags() + return nil + case group.FieldOwnerID: + m.ResetOwnerID() + return nil + case group.FieldName: + m.ResetName() + return nil + case group.FieldDescription: + m.ResetDescription() + return nil + case group.FieldGravatarLogoURL: + m.ResetGravatarLogoURL() + return nil + case group.FieldLogoURL: + m.ResetLogoURL() + return nil + case group.FieldDisplayName: + m.ResetDisplayName() + return nil + } + return fmt.Errorf("unknown Group field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *GroupMutation) AddedEdges() []string { + edges := make([]string, 0, 7) + if m.owner != nil { + edges = append(edges, group.EdgeOwner) + } + if m.setting != nil { + edges = append(edges, group.EdgeSetting) + } + if m.users != nil { + edges = append(edges, group.EdgeUsers) + } + if m.events != nil { + edges = append(edges, group.EdgeEvents) + } + if m.integrations != nil { + edges = append(edges, group.EdgeIntegrations) + } + if m.files != nil { + edges = append(edges, group.EdgeFiles) + } + if m.members != nil { + edges = append(edges, group.EdgeMembers) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *GroupMutation) AddedIDs(name string) []ent.Value { + switch name { + case group.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case group.EdgeSetting: + if id := m.setting; id != nil { + return []ent.Value{*id} + } + case group.EdgeUsers: + ids := make([]ent.Value, 0, len(m.users)) + for id := range m.users { + ids = append(ids, id) + } + return ids + case group.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + case group.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.integrations)) + for id := range m.integrations { + ids = append(ids, id) + } + return ids + case group.EdgeFiles: + ids := make([]ent.Value, 0, len(m.files)) + for id := range m.files { + ids = append(ids, id) + } + return ids + case group.EdgeMembers: + ids := make([]ent.Value, 0, len(m.members)) + for id := range m.members { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *GroupMutation) RemovedEdges() []string { + edges := make([]string, 0, 7) + if m.removedusers != nil { + edges = append(edges, group.EdgeUsers) + } + if m.removedevents != nil { + edges = append(edges, group.EdgeEvents) + } + if m.removedintegrations != nil { + edges = append(edges, group.EdgeIntegrations) + } + if m.removedfiles != nil { + edges = append(edges, group.EdgeFiles) + } + if m.removedmembers != nil { + edges = append(edges, group.EdgeMembers) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *GroupMutation) RemovedIDs(name string) []ent.Value { + switch name { + case group.EdgeUsers: + ids := make([]ent.Value, 0, len(m.removedusers)) + for id := range m.removedusers { + ids = append(ids, id) + } + return ids + case group.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + case group.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.removedintegrations)) + for id := range m.removedintegrations { + ids = append(ids, id) + } + return ids + case group.EdgeFiles: + ids := make([]ent.Value, 0, len(m.removedfiles)) + for id := range m.removedfiles { + ids = append(ids, id) + } + return ids + case group.EdgeMembers: + ids := make([]ent.Value, 0, len(m.removedmembers)) + for id := range m.removedmembers { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *GroupMutation) ClearedEdges() []string { + edges := make([]string, 0, 7) + if m.clearedowner { + edges = append(edges, group.EdgeOwner) + } + if m.clearedsetting { + edges = append(edges, group.EdgeSetting) + } + if m.clearedusers { + edges = append(edges, group.EdgeUsers) + } + if m.clearedevents { + edges = append(edges, group.EdgeEvents) + } + if m.clearedintegrations { + edges = append(edges, group.EdgeIntegrations) + } + if m.clearedfiles { + edges = append(edges, group.EdgeFiles) + } + if m.clearedmembers { + edges = append(edges, group.EdgeMembers) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *GroupMutation) EdgeCleared(name string) bool { + switch name { + case group.EdgeOwner: + return m.clearedowner + case group.EdgeSetting: + return m.clearedsetting + case group.EdgeUsers: + return m.clearedusers + case group.EdgeEvents: + return m.clearedevents + case group.EdgeIntegrations: + return m.clearedintegrations + case group.EdgeFiles: + return m.clearedfiles + case group.EdgeMembers: + return m.clearedmembers + } + 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 *GroupMutation) ClearEdge(name string) error { + switch name { + case group.EdgeOwner: + m.ClearOwner() + return nil + case group.EdgeSetting: + m.ClearSetting() + return nil + } + return fmt.Errorf("unknown Group 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 *GroupMutation) ResetEdge(name string) error { + switch name { + case group.EdgeOwner: + m.ResetOwner() + return nil + case group.EdgeSetting: + m.ResetSetting() + return nil + case group.EdgeUsers: + m.ResetUsers() + return nil + case group.EdgeEvents: + m.ResetEvents() + return nil + case group.EdgeIntegrations: + m.ResetIntegrations() + return nil + case group.EdgeFiles: + m.ResetFiles() + return nil + case group.EdgeMembers: + m.ResetMembers() + return nil + } + return fmt.Errorf("unknown Group edge %s", name) +} + +// GroupHistoryMutation represents an operation that mutates the GroupHistory nodes in the graph. +type GroupHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + owner_id *string + name *string + description *string + gravatar_logo_url *string + logo_url *string + display_name *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*GroupHistory, error) + predicates []predicate.GroupHistory +} + +var _ ent.Mutation = (*GroupHistoryMutation)(nil) + +// grouphistoryOption allows management of the mutation configuration using functional options. +type grouphistoryOption func(*GroupHistoryMutation) + +// newGroupHistoryMutation creates new mutation for the GroupHistory entity. +func newGroupHistoryMutation(c config, op Op, opts ...grouphistoryOption) *GroupHistoryMutation { + m := &GroupHistoryMutation{ + config: c, + op: op, + typ: TypeGroupHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withGroupHistoryID sets the ID field of the mutation. +func withGroupHistoryID(id string) grouphistoryOption { + return func(m *GroupHistoryMutation) { + var ( + err error + once sync.Once + value *GroupHistory + ) + m.oldValue = func(ctx context.Context) (*GroupHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GroupHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroupHistory sets the old GroupHistory of the mutation. +func withGroupHistory(node *GroupHistory) grouphistoryOption { + return func(m *GroupHistoryMutation) { + m.oldValue = func(context.Context) (*GroupHistory, 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 GroupHistoryMutation) 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 GroupHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of GroupHistory entities. +func (m *GroupHistoryMutation) SetID(id string) { + 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 *GroupHistoryMutation) ID() (id string, 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 *GroupHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().GroupHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *GroupHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *GroupHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *GroupHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *GroupHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *GroupHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *GroupHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[grouphistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *GroupHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *GroupHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, grouphistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *GroupHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *GroupHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *GroupHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *GroupHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *GroupHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *GroupHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[grouphistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *GroupHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *GroupHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, grouphistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *GroupHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *GroupHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *GroupHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[grouphistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *GroupHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *GroupHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, grouphistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *GroupHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *GroupHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *GroupHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[grouphistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *GroupHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *GroupHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, grouphistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *GroupHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *GroupHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *GroupHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[grouphistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *GroupHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *GroupHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, grouphistory.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *GroupHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *GroupHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *GroupHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[grouphistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *GroupHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *GroupHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, grouphistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *GroupHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *GroupHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *GroupHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[grouphistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *GroupHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *GroupHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, grouphistory.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *GroupHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *GroupHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *GroupHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *GroupHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *GroupHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *GroupHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *GroupHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *GroupHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[grouphistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *GroupHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *GroupHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, grouphistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *GroupHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *GroupHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *GroupHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[grouphistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *GroupHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *GroupHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, grouphistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *GroupHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *GroupHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *GroupHistoryMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *GroupHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *GroupHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *GroupHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[grouphistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *GroupHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *GroupHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, grouphistory.FieldDescription) +} + +// SetGravatarLogoURL sets the "gravatar_logo_url" field. +func (m *GroupHistoryMutation) SetGravatarLogoURL(s string) { + m.gravatar_logo_url = &s +} + +// GravatarLogoURL returns the value of the "gravatar_logo_url" field in the mutation. +func (m *GroupHistoryMutation) GravatarLogoURL() (r string, exists bool) { + v := m.gravatar_logo_url + if v == nil { + return + } + return *v, true +} + +// OldGravatarLogoURL returns the old "gravatar_logo_url" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldGravatarLogoURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGravatarLogoURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGravatarLogoURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGravatarLogoURL: %w", err) + } + return oldValue.GravatarLogoURL, nil +} + +// ClearGravatarLogoURL clears the value of the "gravatar_logo_url" field. +func (m *GroupHistoryMutation) ClearGravatarLogoURL() { + m.gravatar_logo_url = nil + m.clearedFields[grouphistory.FieldGravatarLogoURL] = struct{}{} +} + +// GravatarLogoURLCleared returns if the "gravatar_logo_url" field was cleared in this mutation. +func (m *GroupHistoryMutation) GravatarLogoURLCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldGravatarLogoURL] + return ok +} + +// ResetGravatarLogoURL resets all changes to the "gravatar_logo_url" field. +func (m *GroupHistoryMutation) ResetGravatarLogoURL() { + m.gravatar_logo_url = nil + delete(m.clearedFields, grouphistory.FieldGravatarLogoURL) +} + +// SetLogoURL sets the "logo_url" field. +func (m *GroupHistoryMutation) SetLogoURL(s string) { + m.logo_url = &s +} + +// LogoURL returns the value of the "logo_url" field in the mutation. +func (m *GroupHistoryMutation) LogoURL() (r string, exists bool) { + v := m.logo_url + if v == nil { + return + } + return *v, true +} + +// OldLogoURL returns the old "logo_url" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldLogoURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLogoURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLogoURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLogoURL: %w", err) + } + return oldValue.LogoURL, nil +} + +// ClearLogoURL clears the value of the "logo_url" field. +func (m *GroupHistoryMutation) ClearLogoURL() { + m.logo_url = nil + m.clearedFields[grouphistory.FieldLogoURL] = struct{}{} +} + +// LogoURLCleared returns if the "logo_url" field was cleared in this mutation. +func (m *GroupHistoryMutation) LogoURLCleared() bool { + _, ok := m.clearedFields[grouphistory.FieldLogoURL] + return ok +} + +// ResetLogoURL resets all changes to the "logo_url" field. +func (m *GroupHistoryMutation) ResetLogoURL() { + m.logo_url = nil + delete(m.clearedFields, grouphistory.FieldLogoURL) +} + +// SetDisplayName sets the "display_name" field. +func (m *GroupHistoryMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *GroupHistoryMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the GroupHistory entity. +// If the GroupHistory 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 *GroupHistoryMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *GroupHistoryMutation) ResetDisplayName() { + m.display_name = nil +} + +// Where appends a list predicates to the GroupHistoryMutation builder. +func (m *GroupHistoryMutation) Where(ps ...predicate.GroupHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the GroupHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *GroupHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.GroupHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *GroupHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *GroupHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (GroupHistory). +func (m *GroupHistoryMutation) 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 *GroupHistoryMutation) Fields() []string { + fields := make([]string, 0, 17) + if m.history_time != nil { + fields = append(fields, grouphistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, grouphistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, grouphistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, grouphistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, grouphistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, grouphistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, grouphistory.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, grouphistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, grouphistory.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, grouphistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, grouphistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, grouphistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, grouphistory.FieldName) + } + if m.description != nil { + fields = append(fields, grouphistory.FieldDescription) + } + if m.gravatar_logo_url != nil { + fields = append(fields, grouphistory.FieldGravatarLogoURL) + } + if m.logo_url != nil { + fields = append(fields, grouphistory.FieldLogoURL) + } + if m.display_name != nil { + fields = append(fields, grouphistory.FieldDisplayName) + } + 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 *GroupHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case grouphistory.FieldHistoryTime: + return m.HistoryTime() + case grouphistory.FieldRef: + return m.Ref() + case grouphistory.FieldOperation: + return m.Operation() + case grouphistory.FieldCreatedAt: + return m.CreatedAt() + case grouphistory.FieldUpdatedAt: + return m.UpdatedAt() + case grouphistory.FieldCreatedBy: + return m.CreatedBy() + case grouphistory.FieldUpdatedBy: + return m.UpdatedBy() + case grouphistory.FieldDeletedAt: + return m.DeletedAt() + case grouphistory.FieldDeletedBy: + return m.DeletedBy() + case grouphistory.FieldMappingID: + return m.MappingID() + case grouphistory.FieldTags: + return m.Tags() + case grouphistory.FieldOwnerID: + return m.OwnerID() + case grouphistory.FieldName: + return m.Name() + case grouphistory.FieldDescription: + return m.Description() + case grouphistory.FieldGravatarLogoURL: + return m.GravatarLogoURL() + case grouphistory.FieldLogoURL: + return m.LogoURL() + case grouphistory.FieldDisplayName: + return m.DisplayName() + } + 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 *GroupHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case grouphistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case grouphistory.FieldRef: + return m.OldRef(ctx) + case grouphistory.FieldOperation: + return m.OldOperation(ctx) + case grouphistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case grouphistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case grouphistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case grouphistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case grouphistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case grouphistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case grouphistory.FieldMappingID: + return m.OldMappingID(ctx) + case grouphistory.FieldTags: + return m.OldTags(ctx) + case grouphistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case grouphistory.FieldName: + return m.OldName(ctx) + case grouphistory.FieldDescription: + return m.OldDescription(ctx) + case grouphistory.FieldGravatarLogoURL: + return m.OldGravatarLogoURL(ctx) + case grouphistory.FieldLogoURL: + return m.OldLogoURL(ctx) + case grouphistory.FieldDisplayName: + return m.OldDisplayName(ctx) + } + return nil, fmt.Errorf("unknown GroupHistory 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 *GroupHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case grouphistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case grouphistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case grouphistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case grouphistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case grouphistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case grouphistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case grouphistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case grouphistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case grouphistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case grouphistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case grouphistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case grouphistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case grouphistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case grouphistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case grouphistory.FieldGravatarLogoURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGravatarLogoURL(v) + return nil + case grouphistory.FieldLogoURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLogoURL(v) + return nil + case grouphistory.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + } + return fmt.Errorf("unknown GroupHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *GroupHistoryMutation) 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 *GroupHistoryMutation) 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 *GroupHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown GroupHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *GroupHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(grouphistory.FieldRef) { + fields = append(fields, grouphistory.FieldRef) + } + if m.FieldCleared(grouphistory.FieldCreatedAt) { + fields = append(fields, grouphistory.FieldCreatedAt) + } + if m.FieldCleared(grouphistory.FieldUpdatedAt) { + fields = append(fields, grouphistory.FieldUpdatedAt) + } + if m.FieldCleared(grouphistory.FieldCreatedBy) { + fields = append(fields, grouphistory.FieldCreatedBy) + } + if m.FieldCleared(grouphistory.FieldUpdatedBy) { + fields = append(fields, grouphistory.FieldUpdatedBy) + } + if m.FieldCleared(grouphistory.FieldDeletedAt) { + fields = append(fields, grouphistory.FieldDeletedAt) + } + if m.FieldCleared(grouphistory.FieldDeletedBy) { + fields = append(fields, grouphistory.FieldDeletedBy) + } + if m.FieldCleared(grouphistory.FieldTags) { + fields = append(fields, grouphistory.FieldTags) + } + if m.FieldCleared(grouphistory.FieldOwnerID) { + fields = append(fields, grouphistory.FieldOwnerID) + } + if m.FieldCleared(grouphistory.FieldDescription) { + fields = append(fields, grouphistory.FieldDescription) + } + if m.FieldCleared(grouphistory.FieldGravatarLogoURL) { + fields = append(fields, grouphistory.FieldGravatarLogoURL) + } + if m.FieldCleared(grouphistory.FieldLogoURL) { + fields = append(fields, grouphistory.FieldLogoURL) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *GroupHistoryMutation) 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 *GroupHistoryMutation) ClearField(name string) error { + switch name { + case grouphistory.FieldRef: + m.ClearRef() + return nil + case grouphistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case grouphistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case grouphistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case grouphistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case grouphistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case grouphistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case grouphistory.FieldTags: + m.ClearTags() + return nil + case grouphistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case grouphistory.FieldDescription: + m.ClearDescription() + return nil + case grouphistory.FieldGravatarLogoURL: + m.ClearGravatarLogoURL() + return nil + case grouphistory.FieldLogoURL: + m.ClearLogoURL() + return nil + } + return fmt.Errorf("unknown GroupHistory 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 *GroupHistoryMutation) ResetField(name string) error { + switch name { + case grouphistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case grouphistory.FieldRef: + m.ResetRef() + return nil + case grouphistory.FieldOperation: + m.ResetOperation() + return nil + case grouphistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case grouphistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case grouphistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case grouphistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case grouphistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case grouphistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case grouphistory.FieldMappingID: + m.ResetMappingID() + return nil + case grouphistory.FieldTags: + m.ResetTags() + return nil + case grouphistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case grouphistory.FieldName: + m.ResetName() + return nil + case grouphistory.FieldDescription: + m.ResetDescription() + return nil + case grouphistory.FieldGravatarLogoURL: + m.ResetGravatarLogoURL() + return nil + case grouphistory.FieldLogoURL: + m.ResetLogoURL() + return nil + case grouphistory.FieldDisplayName: + m.ResetDisplayName() + return nil + } + return fmt.Errorf("unknown GroupHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *GroupHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *GroupHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *GroupHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *GroupHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *GroupHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *GroupHistoryMutation) EdgeCleared(name string) bool { + 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 *GroupHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown GroupHistory 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 *GroupHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown GroupHistory edge %s", name) +} + +// GroupMembershipMutation represents an operation that mutates the GroupMembership nodes in the graph. +type GroupMembershipMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + role *enums.Role + clearedFields map[string]struct{} + group *string + clearedgroup bool + user *string + cleareduser bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*GroupMembership, error) + predicates []predicate.GroupMembership +} + +var _ ent.Mutation = (*GroupMembershipMutation)(nil) + +// groupmembershipOption allows management of the mutation configuration using functional options. +type groupmembershipOption func(*GroupMembershipMutation) + +// newGroupMembershipMutation creates new mutation for the GroupMembership entity. +func newGroupMembershipMutation(c config, op Op, opts ...groupmembershipOption) *GroupMembershipMutation { + m := &GroupMembershipMutation{ + config: c, + op: op, + typ: TypeGroupMembership, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withGroupMembershipID sets the ID field of the mutation. +func withGroupMembershipID(id string) groupmembershipOption { + return func(m *GroupMembershipMutation) { + var ( + err error + once sync.Once + value *GroupMembership + ) + m.oldValue = func(ctx context.Context) (*GroupMembership, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GroupMembership.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroupMembership sets the old GroupMembership of the mutation. +func withGroupMembership(node *GroupMembership) groupmembershipOption { + return func(m *GroupMembershipMutation) { + m.oldValue = func(context.Context) (*GroupMembership, 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 GroupMembershipMutation) 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 GroupMembershipMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of GroupMembership entities. +func (m *GroupMembershipMutation) SetID(id string) { + 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 *GroupMembershipMutation) ID() (id string, 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 *GroupMembershipMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().GroupMembership.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *GroupMembershipMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *GroupMembershipMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *GroupMembershipMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[groupmembership.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *GroupMembershipMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[groupmembership.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *GroupMembershipMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, groupmembership.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *GroupMembershipMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *GroupMembershipMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *GroupMembershipMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[groupmembership.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *GroupMembershipMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[groupmembership.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *GroupMembershipMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, groupmembership.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *GroupMembershipMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *GroupMembershipMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *GroupMembershipMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[groupmembership.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *GroupMembershipMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[groupmembership.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *GroupMembershipMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, groupmembership.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *GroupMembershipMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *GroupMembershipMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *GroupMembershipMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[groupmembership.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *GroupMembershipMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[groupmembership.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *GroupMembershipMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, groupmembership.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *GroupMembershipMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *GroupMembershipMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *GroupMembershipMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *GroupMembershipMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *GroupMembershipMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *GroupMembershipMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[groupmembership.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *GroupMembershipMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[groupmembership.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *GroupMembershipMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, groupmembership.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *GroupMembershipMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *GroupMembershipMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *GroupMembershipMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[groupmembership.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *GroupMembershipMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[groupmembership.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *GroupMembershipMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, groupmembership.FieldDeletedBy) +} + +// SetRole sets the "role" field. +func (m *GroupMembershipMutation) SetRole(e enums.Role) { + m.role = &e +} + +// Role returns the value of the "role" field in the mutation. +func (m *GroupMembershipMutation) Role() (r enums.Role, exists bool) { + v := m.role + if v == nil { + return + } + return *v, true +} + +// OldRole returns the old "role" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldRole(ctx context.Context) (v enums.Role, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// ResetRole resets all changes to the "role" field. +func (m *GroupMembershipMutation) ResetRole() { + m.role = nil +} + +// SetGroupID sets the "group_id" field. +func (m *GroupMembershipMutation) SetGroupID(s string) { + m.group = &s +} + +// GroupID returns the value of the "group_id" field in the mutation. +func (m *GroupMembershipMutation) GroupID() (r string, exists bool) { + v := m.group + if v == nil { + return + } + return *v, true +} + +// OldGroupID returns the old "group_id" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldGroupID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGroupID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGroupID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGroupID: %w", err) + } + return oldValue.GroupID, nil +} + +// ResetGroupID resets all changes to the "group_id" field. +func (m *GroupMembershipMutation) ResetGroupID() { + m.group = nil +} + +// SetUserID sets the "user_id" field. +func (m *GroupMembershipMutation) SetUserID(s string) { + m.user = &s +} + +// UserID returns the value of the "user_id" field in the mutation. +func (m *GroupMembershipMutation) UserID() (r string, exists bool) { + v := m.user + if v == nil { + return + } + return *v, true +} + +// OldUserID returns the old "user_id" field's value of the GroupMembership entity. +// If the GroupMembership 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 *GroupMembershipMutation) OldUserID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserID: %w", err) + } + return oldValue.UserID, nil +} + +// ResetUserID resets all changes to the "user_id" field. +func (m *GroupMembershipMutation) ResetUserID() { + m.user = nil +} + +// ClearGroup clears the "group" edge to the Group entity. +func (m *GroupMembershipMutation) ClearGroup() { + m.clearedgroup = true + m.clearedFields[groupmembership.FieldGroupID] = struct{}{} +} + +// GroupCleared reports if the "group" edge to the Group entity was cleared. +func (m *GroupMembershipMutation) GroupCleared() bool { + return m.clearedgroup +} + +// GroupIDs returns the "group" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// GroupID instead. It exists only for internal usage by the builders. +func (m *GroupMembershipMutation) GroupIDs() (ids []string) { + if id := m.group; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetGroup resets all changes to the "group" edge. +func (m *GroupMembershipMutation) ResetGroup() { + m.group = nil + m.clearedgroup = false +} + +// ClearUser clears the "user" edge to the User entity. +func (m *GroupMembershipMutation) ClearUser() { + m.cleareduser = true + m.clearedFields[groupmembership.FieldUserID] = struct{}{} +} + +// UserCleared reports if the "user" edge to the User entity was cleared. +func (m *GroupMembershipMutation) UserCleared() bool { + return m.cleareduser +} + +// UserIDs returns the "user" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// UserID instead. It exists only for internal usage by the builders. +func (m *GroupMembershipMutation) UserIDs() (ids []string) { + if id := m.user; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetUser resets all changes to the "user" edge. +func (m *GroupMembershipMutation) ResetUser() { + m.user = nil + m.cleareduser = false +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *GroupMembershipMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *GroupMembershipMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *GroupMembershipMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *GroupMembershipMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *GroupMembershipMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *GroupMembershipMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *GroupMembershipMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the GroupMembershipMutation builder. +func (m *GroupMembershipMutation) Where(ps ...predicate.GroupMembership) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the GroupMembershipMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *GroupMembershipMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.GroupMembership, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *GroupMembershipMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *GroupMembershipMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (GroupMembership). +func (m *GroupMembershipMutation) 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 *GroupMembershipMutation) Fields() []string { + fields := make([]string, 0, 10) + if m.created_at != nil { + fields = append(fields, groupmembership.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, groupmembership.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, groupmembership.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, groupmembership.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, groupmembership.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, groupmembership.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, groupmembership.FieldDeletedBy) + } + if m.role != nil { + fields = append(fields, groupmembership.FieldRole) + } + if m.group != nil { + fields = append(fields, groupmembership.FieldGroupID) + } + if m.user != nil { + fields = append(fields, groupmembership.FieldUserID) + } + 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 *GroupMembershipMutation) Field(name string) (ent.Value, bool) { + switch name { + case groupmembership.FieldCreatedAt: + return m.CreatedAt() + case groupmembership.FieldUpdatedAt: + return m.UpdatedAt() + case groupmembership.FieldCreatedBy: + return m.CreatedBy() + case groupmembership.FieldUpdatedBy: + return m.UpdatedBy() + case groupmembership.FieldMappingID: + return m.MappingID() + case groupmembership.FieldDeletedAt: + return m.DeletedAt() + case groupmembership.FieldDeletedBy: + return m.DeletedBy() + case groupmembership.FieldRole: + return m.Role() + case groupmembership.FieldGroupID: + return m.GroupID() + case groupmembership.FieldUserID: + return m.UserID() + } + 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 *GroupMembershipMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case groupmembership.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case groupmembership.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case groupmembership.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case groupmembership.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case groupmembership.FieldMappingID: + return m.OldMappingID(ctx) + case groupmembership.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case groupmembership.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case groupmembership.FieldRole: + return m.OldRole(ctx) + case groupmembership.FieldGroupID: + return m.OldGroupID(ctx) + case groupmembership.FieldUserID: + return m.OldUserID(ctx) + } + return nil, fmt.Errorf("unknown GroupMembership 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 *GroupMembershipMutation) SetField(name string, value ent.Value) error { + switch name { + case groupmembership.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case groupmembership.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case groupmembership.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case groupmembership.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case groupmembership.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case groupmembership.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case groupmembership.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case groupmembership.FieldRole: + v, ok := value.(enums.Role) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRole(v) + return nil + case groupmembership.FieldGroupID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGroupID(v) + return nil + case groupmembership.FieldUserID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserID(v) + return nil + } + return fmt.Errorf("unknown GroupMembership field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *GroupMembershipMutation) 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 *GroupMembershipMutation) 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 *GroupMembershipMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown GroupMembership numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *GroupMembershipMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(groupmembership.FieldCreatedAt) { + fields = append(fields, groupmembership.FieldCreatedAt) + } + if m.FieldCleared(groupmembership.FieldUpdatedAt) { + fields = append(fields, groupmembership.FieldUpdatedAt) + } + if m.FieldCleared(groupmembership.FieldCreatedBy) { + fields = append(fields, groupmembership.FieldCreatedBy) + } + if m.FieldCleared(groupmembership.FieldUpdatedBy) { + fields = append(fields, groupmembership.FieldUpdatedBy) + } + if m.FieldCleared(groupmembership.FieldDeletedAt) { + fields = append(fields, groupmembership.FieldDeletedAt) + } + if m.FieldCleared(groupmembership.FieldDeletedBy) { + fields = append(fields, groupmembership.FieldDeletedBy) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *GroupMembershipMutation) 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 *GroupMembershipMutation) ClearField(name string) error { + switch name { + case groupmembership.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case groupmembership.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case groupmembership.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case groupmembership.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case groupmembership.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case groupmembership.FieldDeletedBy: + m.ClearDeletedBy() + return nil + } + return fmt.Errorf("unknown GroupMembership 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 *GroupMembershipMutation) ResetField(name string) error { + switch name { + case groupmembership.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case groupmembership.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case groupmembership.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case groupmembership.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case groupmembership.FieldMappingID: + m.ResetMappingID() + return nil + case groupmembership.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case groupmembership.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case groupmembership.FieldRole: + m.ResetRole() + return nil + case groupmembership.FieldGroupID: + m.ResetGroupID() + return nil + case groupmembership.FieldUserID: + m.ResetUserID() + return nil + } + return fmt.Errorf("unknown GroupMembership field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *GroupMembershipMutation) AddedEdges() []string { + edges := make([]string, 0, 3) + if m.group != nil { + edges = append(edges, groupmembership.EdgeGroup) + } + if m.user != nil { + edges = append(edges, groupmembership.EdgeUser) + } + if m.events != nil { + edges = append(edges, groupmembership.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *GroupMembershipMutation) AddedIDs(name string) []ent.Value { + switch name { + case groupmembership.EdgeGroup: + if id := m.group; id != nil { + return []ent.Value{*id} + } + case groupmembership.EdgeUser: + if id := m.user; id != nil { + return []ent.Value{*id} + } + case groupmembership.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *GroupMembershipMutation) RemovedEdges() []string { + edges := make([]string, 0, 3) + if m.removedevents != nil { + edges = append(edges, groupmembership.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *GroupMembershipMutation) RemovedIDs(name string) []ent.Value { + switch name { + case groupmembership.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *GroupMembershipMutation) ClearedEdges() []string { + edges := make([]string, 0, 3) + if m.clearedgroup { + edges = append(edges, groupmembership.EdgeGroup) + } + if m.cleareduser { + edges = append(edges, groupmembership.EdgeUser) + } + if m.clearedevents { + edges = append(edges, groupmembership.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *GroupMembershipMutation) EdgeCleared(name string) bool { + switch name { + case groupmembership.EdgeGroup: + return m.clearedgroup + case groupmembership.EdgeUser: + return m.cleareduser + case groupmembership.EdgeEvents: + return m.clearedevents + } + 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 *GroupMembershipMutation) ClearEdge(name string) error { + switch name { + case groupmembership.EdgeGroup: + m.ClearGroup() + return nil + case groupmembership.EdgeUser: + m.ClearUser() + return nil + } + return fmt.Errorf("unknown GroupMembership 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 *GroupMembershipMutation) ResetEdge(name string) error { + switch name { + case groupmembership.EdgeGroup: + m.ResetGroup() + return nil + case groupmembership.EdgeUser: + m.ResetUser() + return nil + case groupmembership.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown GroupMembership edge %s", name) +} + +// GroupMembershipHistoryMutation represents an operation that mutates the GroupMembershipHistory nodes in the graph. +type GroupMembershipHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + role *enums.Role + group_id *string + user_id *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*GroupMembershipHistory, error) + predicates []predicate.GroupMembershipHistory +} + +var _ ent.Mutation = (*GroupMembershipHistoryMutation)(nil) + +// groupmembershiphistoryOption allows management of the mutation configuration using functional options. +type groupmembershiphistoryOption func(*GroupMembershipHistoryMutation) + +// newGroupMembershipHistoryMutation creates new mutation for the GroupMembershipHistory entity. +func newGroupMembershipHistoryMutation(c config, op Op, opts ...groupmembershiphistoryOption) *GroupMembershipHistoryMutation { + m := &GroupMembershipHistoryMutation{ + config: c, + op: op, + typ: TypeGroupMembershipHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withGroupMembershipHistoryID sets the ID field of the mutation. +func withGroupMembershipHistoryID(id string) groupmembershiphistoryOption { + return func(m *GroupMembershipHistoryMutation) { + var ( + err error + once sync.Once + value *GroupMembershipHistory + ) + m.oldValue = func(ctx context.Context) (*GroupMembershipHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GroupMembershipHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroupMembershipHistory sets the old GroupMembershipHistory of the mutation. +func withGroupMembershipHistory(node *GroupMembershipHistory) groupmembershiphistoryOption { + return func(m *GroupMembershipHistoryMutation) { + m.oldValue = func(context.Context) (*GroupMembershipHistory, 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 GroupMembershipHistoryMutation) 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 GroupMembershipHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of GroupMembershipHistory entities. +func (m *GroupMembershipHistoryMutation) SetID(id string) { + 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 *GroupMembershipHistoryMutation) ID() (id string, 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 *GroupMembershipHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().GroupMembershipHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *GroupMembershipHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *GroupMembershipHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *GroupMembershipHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *GroupMembershipHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *GroupMembershipHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *GroupMembershipHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[groupmembershiphistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[groupmembershiphistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *GroupMembershipHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, groupmembershiphistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *GroupMembershipHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *GroupMembershipHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *GroupMembershipHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *GroupMembershipHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *GroupMembershipHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *GroupMembershipHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[groupmembershiphistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[groupmembershiphistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *GroupMembershipHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, groupmembershiphistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *GroupMembershipHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *GroupMembershipHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *GroupMembershipHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[groupmembershiphistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[groupmembershiphistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *GroupMembershipHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, groupmembershiphistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *GroupMembershipHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *GroupMembershipHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *GroupMembershipHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[groupmembershiphistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[groupmembershiphistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *GroupMembershipHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, groupmembershiphistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *GroupMembershipHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *GroupMembershipHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *GroupMembershipHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[groupmembershiphistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[groupmembershiphistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *GroupMembershipHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, groupmembershiphistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *GroupMembershipHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *GroupMembershipHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *GroupMembershipHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *GroupMembershipHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *GroupMembershipHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *GroupMembershipHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[groupmembershiphistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[groupmembershiphistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *GroupMembershipHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, groupmembershiphistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *GroupMembershipHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *GroupMembershipHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *GroupMembershipHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[groupmembershiphistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[groupmembershiphistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *GroupMembershipHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, groupmembershiphistory.FieldDeletedBy) +} + +// SetRole sets the "role" field. +func (m *GroupMembershipHistoryMutation) SetRole(e enums.Role) { + m.role = &e +} + +// Role returns the value of the "role" field in the mutation. +func (m *GroupMembershipHistoryMutation) Role() (r enums.Role, exists bool) { + v := m.role + if v == nil { + return + } + return *v, true +} + +// OldRole returns the old "role" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldRole(ctx context.Context) (v enums.Role, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// ResetRole resets all changes to the "role" field. +func (m *GroupMembershipHistoryMutation) ResetRole() { + m.role = nil +} + +// SetGroupID sets the "group_id" field. +func (m *GroupMembershipHistoryMutation) SetGroupID(s string) { + m.group_id = &s +} + +// GroupID returns the value of the "group_id" field in the mutation. +func (m *GroupMembershipHistoryMutation) GroupID() (r string, exists bool) { + v := m.group_id + if v == nil { + return + } + return *v, true +} + +// OldGroupID returns the old "group_id" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldGroupID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGroupID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGroupID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGroupID: %w", err) + } + return oldValue.GroupID, nil +} + +// ResetGroupID resets all changes to the "group_id" field. +func (m *GroupMembershipHistoryMutation) ResetGroupID() { + m.group_id = nil +} + +// SetUserID sets the "user_id" field. +func (m *GroupMembershipHistoryMutation) SetUserID(s string) { + m.user_id = &s +} + +// UserID returns the value of the "user_id" field in the mutation. +func (m *GroupMembershipHistoryMutation) UserID() (r string, exists bool) { + v := m.user_id + if v == nil { + return + } + return *v, true +} + +// OldUserID returns the old "user_id" field's value of the GroupMembershipHistory entity. +// If the GroupMembershipHistory 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 *GroupMembershipHistoryMutation) OldUserID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserID: %w", err) + } + return oldValue.UserID, nil +} + +// ResetUserID resets all changes to the "user_id" field. +func (m *GroupMembershipHistoryMutation) ResetUserID() { + m.user_id = nil +} + +// Where appends a list predicates to the GroupMembershipHistoryMutation builder. +func (m *GroupMembershipHistoryMutation) Where(ps ...predicate.GroupMembershipHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the GroupMembershipHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *GroupMembershipHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.GroupMembershipHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *GroupMembershipHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *GroupMembershipHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (GroupMembershipHistory). +func (m *GroupMembershipHistoryMutation) 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 *GroupMembershipHistoryMutation) Fields() []string { + fields := make([]string, 0, 13) + if m.history_time != nil { + fields = append(fields, groupmembershiphistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, groupmembershiphistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, groupmembershiphistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, groupmembershiphistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, groupmembershiphistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, groupmembershiphistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, groupmembershiphistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, groupmembershiphistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, groupmembershiphistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, groupmembershiphistory.FieldDeletedBy) + } + if m.role != nil { + fields = append(fields, groupmembershiphistory.FieldRole) + } + if m.group_id != nil { + fields = append(fields, groupmembershiphistory.FieldGroupID) + } + if m.user_id != nil { + fields = append(fields, groupmembershiphistory.FieldUserID) + } + 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 *GroupMembershipHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case groupmembershiphistory.FieldHistoryTime: + return m.HistoryTime() + case groupmembershiphistory.FieldRef: + return m.Ref() + case groupmembershiphistory.FieldOperation: + return m.Operation() + case groupmembershiphistory.FieldCreatedAt: + return m.CreatedAt() + case groupmembershiphistory.FieldUpdatedAt: + return m.UpdatedAt() + case groupmembershiphistory.FieldCreatedBy: + return m.CreatedBy() + case groupmembershiphistory.FieldUpdatedBy: + return m.UpdatedBy() + case groupmembershiphistory.FieldMappingID: + return m.MappingID() + case groupmembershiphistory.FieldDeletedAt: + return m.DeletedAt() + case groupmembershiphistory.FieldDeletedBy: + return m.DeletedBy() + case groupmembershiphistory.FieldRole: + return m.Role() + case groupmembershiphistory.FieldGroupID: + return m.GroupID() + case groupmembershiphistory.FieldUserID: + return m.UserID() + } + 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 *GroupMembershipHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case groupmembershiphistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case groupmembershiphistory.FieldRef: + return m.OldRef(ctx) + case groupmembershiphistory.FieldOperation: + return m.OldOperation(ctx) + case groupmembershiphistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case groupmembershiphistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case groupmembershiphistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case groupmembershiphistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case groupmembershiphistory.FieldMappingID: + return m.OldMappingID(ctx) + case groupmembershiphistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case groupmembershiphistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case groupmembershiphistory.FieldRole: + return m.OldRole(ctx) + case groupmembershiphistory.FieldGroupID: + return m.OldGroupID(ctx) + case groupmembershiphistory.FieldUserID: + return m.OldUserID(ctx) + } + return nil, fmt.Errorf("unknown GroupMembershipHistory 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 *GroupMembershipHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case groupmembershiphistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case groupmembershiphistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case groupmembershiphistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case groupmembershiphistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case groupmembershiphistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case groupmembershiphistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case groupmembershiphistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case groupmembershiphistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case groupmembershiphistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case groupmembershiphistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case groupmembershiphistory.FieldRole: + v, ok := value.(enums.Role) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRole(v) + return nil + case groupmembershiphistory.FieldGroupID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGroupID(v) + return nil + case groupmembershiphistory.FieldUserID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserID(v) + return nil + } + return fmt.Errorf("unknown GroupMembershipHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *GroupMembershipHistoryMutation) 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 *GroupMembershipHistoryMutation) 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 *GroupMembershipHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown GroupMembershipHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *GroupMembershipHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(groupmembershiphistory.FieldRef) { + fields = append(fields, groupmembershiphistory.FieldRef) + } + if m.FieldCleared(groupmembershiphistory.FieldCreatedAt) { + fields = append(fields, groupmembershiphistory.FieldCreatedAt) + } + if m.FieldCleared(groupmembershiphistory.FieldUpdatedAt) { + fields = append(fields, groupmembershiphistory.FieldUpdatedAt) + } + if m.FieldCleared(groupmembershiphistory.FieldCreatedBy) { + fields = append(fields, groupmembershiphistory.FieldCreatedBy) + } + if m.FieldCleared(groupmembershiphistory.FieldUpdatedBy) { + fields = append(fields, groupmembershiphistory.FieldUpdatedBy) + } + if m.FieldCleared(groupmembershiphistory.FieldDeletedAt) { + fields = append(fields, groupmembershiphistory.FieldDeletedAt) + } + if m.FieldCleared(groupmembershiphistory.FieldDeletedBy) { + fields = append(fields, groupmembershiphistory.FieldDeletedBy) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *GroupMembershipHistoryMutation) 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 *GroupMembershipHistoryMutation) ClearField(name string) error { + switch name { + case groupmembershiphistory.FieldRef: + m.ClearRef() + return nil + case groupmembershiphistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case groupmembershiphistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case groupmembershiphistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case groupmembershiphistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case groupmembershiphistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case groupmembershiphistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + } + return fmt.Errorf("unknown GroupMembershipHistory 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 *GroupMembershipHistoryMutation) ResetField(name string) error { + switch name { + case groupmembershiphistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case groupmembershiphistory.FieldRef: + m.ResetRef() + return nil + case groupmembershiphistory.FieldOperation: + m.ResetOperation() + return nil + case groupmembershiphistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case groupmembershiphistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case groupmembershiphistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case groupmembershiphistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case groupmembershiphistory.FieldMappingID: + m.ResetMappingID() + return nil + case groupmembershiphistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case groupmembershiphistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case groupmembershiphistory.FieldRole: + m.ResetRole() + return nil + case groupmembershiphistory.FieldGroupID: + m.ResetGroupID() + return nil + case groupmembershiphistory.FieldUserID: + m.ResetUserID() + return nil + } + return fmt.Errorf("unknown GroupMembershipHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *GroupMembershipHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *GroupMembershipHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *GroupMembershipHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *GroupMembershipHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *GroupMembershipHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *GroupMembershipHistoryMutation) EdgeCleared(name string) bool { + 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 *GroupMembershipHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown GroupMembershipHistory 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 *GroupMembershipHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown GroupMembershipHistory edge %s", name) +} + +// GroupSettingMutation represents an operation that mutates the GroupSetting nodes in the graph. +type GroupSettingMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + visibility *enums.Visibility + join_policy *enums.JoinPolicy + sync_to_slack *bool + sync_to_github *bool + clearedFields map[string]struct{} + group *string + clearedgroup bool + done bool + oldValue func(context.Context) (*GroupSetting, error) + predicates []predicate.GroupSetting +} + +var _ ent.Mutation = (*GroupSettingMutation)(nil) + +// groupsettingOption allows management of the mutation configuration using functional options. +type groupsettingOption func(*GroupSettingMutation) + +// newGroupSettingMutation creates new mutation for the GroupSetting entity. +func newGroupSettingMutation(c config, op Op, opts ...groupsettingOption) *GroupSettingMutation { + m := &GroupSettingMutation{ + config: c, + op: op, + typ: TypeGroupSetting, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withGroupSettingID sets the ID field of the mutation. +func withGroupSettingID(id string) groupsettingOption { + return func(m *GroupSettingMutation) { + var ( + err error + once sync.Once + value *GroupSetting + ) + m.oldValue = func(ctx context.Context) (*GroupSetting, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GroupSetting.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroupSetting sets the old GroupSetting of the mutation. +func withGroupSetting(node *GroupSetting) groupsettingOption { + return func(m *GroupSettingMutation) { + m.oldValue = func(context.Context) (*GroupSetting, 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 GroupSettingMutation) 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 GroupSettingMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of GroupSetting entities. +func (m *GroupSettingMutation) SetID(id string) { + 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 *GroupSettingMutation) ID() (id string, 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 *GroupSettingMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().GroupSetting.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *GroupSettingMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *GroupSettingMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *GroupSettingMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[groupsetting.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *GroupSettingMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *GroupSettingMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, groupsetting.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *GroupSettingMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *GroupSettingMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *GroupSettingMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[groupsetting.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *GroupSettingMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *GroupSettingMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, groupsetting.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *GroupSettingMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *GroupSettingMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *GroupSettingMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[groupsetting.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *GroupSettingMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *GroupSettingMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, groupsetting.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *GroupSettingMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *GroupSettingMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *GroupSettingMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[groupsetting.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *GroupSettingMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *GroupSettingMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, groupsetting.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *GroupSettingMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *GroupSettingMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *GroupSettingMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *GroupSettingMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *GroupSettingMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *GroupSettingMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *GroupSettingMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *GroupSettingMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[groupsetting.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *GroupSettingMutation) TagsCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *GroupSettingMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, groupsetting.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *GroupSettingMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *GroupSettingMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *GroupSettingMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[groupsetting.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *GroupSettingMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *GroupSettingMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, groupsetting.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *GroupSettingMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *GroupSettingMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *GroupSettingMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[groupsetting.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *GroupSettingMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *GroupSettingMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, groupsetting.FieldDeletedBy) +} + +// SetVisibility sets the "visibility" field. +func (m *GroupSettingMutation) SetVisibility(e enums.Visibility) { + m.visibility = &e +} + +// Visibility returns the value of the "visibility" field in the mutation. +func (m *GroupSettingMutation) Visibility() (r enums.Visibility, exists bool) { + v := m.visibility + if v == nil { + return + } + return *v, true +} + +// OldVisibility returns the old "visibility" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldVisibility(ctx context.Context) (v enums.Visibility, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldVisibility is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldVisibility requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVisibility: %w", err) + } + return oldValue.Visibility, nil +} + +// ResetVisibility resets all changes to the "visibility" field. +func (m *GroupSettingMutation) ResetVisibility() { + m.visibility = nil +} + +// SetJoinPolicy sets the "join_policy" field. +func (m *GroupSettingMutation) SetJoinPolicy(ep enums.JoinPolicy) { + m.join_policy = &ep +} + +// JoinPolicy returns the value of the "join_policy" field in the mutation. +func (m *GroupSettingMutation) JoinPolicy() (r enums.JoinPolicy, exists bool) { + v := m.join_policy + if v == nil { + return + } + return *v, true +} + +// OldJoinPolicy returns the old "join_policy" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldJoinPolicy(ctx context.Context) (v enums.JoinPolicy, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldJoinPolicy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldJoinPolicy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldJoinPolicy: %w", err) + } + return oldValue.JoinPolicy, nil +} + +// ResetJoinPolicy resets all changes to the "join_policy" field. +func (m *GroupSettingMutation) ResetJoinPolicy() { + m.join_policy = nil +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (m *GroupSettingMutation) SetSyncToSlack(b bool) { + m.sync_to_slack = &b +} + +// SyncToSlack returns the value of the "sync_to_slack" field in the mutation. +func (m *GroupSettingMutation) SyncToSlack() (r bool, exists bool) { + v := m.sync_to_slack + if v == nil { + return + } + return *v, true +} + +// OldSyncToSlack returns the old "sync_to_slack" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldSyncToSlack(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSyncToSlack is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSyncToSlack requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSyncToSlack: %w", err) + } + return oldValue.SyncToSlack, nil +} + +// ClearSyncToSlack clears the value of the "sync_to_slack" field. +func (m *GroupSettingMutation) ClearSyncToSlack() { + m.sync_to_slack = nil + m.clearedFields[groupsetting.FieldSyncToSlack] = struct{}{} +} + +// SyncToSlackCleared returns if the "sync_to_slack" field was cleared in this mutation. +func (m *GroupSettingMutation) SyncToSlackCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldSyncToSlack] + return ok +} + +// ResetSyncToSlack resets all changes to the "sync_to_slack" field. +func (m *GroupSettingMutation) ResetSyncToSlack() { + m.sync_to_slack = nil + delete(m.clearedFields, groupsetting.FieldSyncToSlack) +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (m *GroupSettingMutation) SetSyncToGithub(b bool) { + m.sync_to_github = &b +} + +// SyncToGithub returns the value of the "sync_to_github" field in the mutation. +func (m *GroupSettingMutation) SyncToGithub() (r bool, exists bool) { + v := m.sync_to_github + if v == nil { + return + } + return *v, true +} + +// OldSyncToGithub returns the old "sync_to_github" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldSyncToGithub(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSyncToGithub is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSyncToGithub requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSyncToGithub: %w", err) + } + return oldValue.SyncToGithub, nil +} + +// ClearSyncToGithub clears the value of the "sync_to_github" field. +func (m *GroupSettingMutation) ClearSyncToGithub() { + m.sync_to_github = nil + m.clearedFields[groupsetting.FieldSyncToGithub] = struct{}{} +} + +// SyncToGithubCleared returns if the "sync_to_github" field was cleared in this mutation. +func (m *GroupSettingMutation) SyncToGithubCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldSyncToGithub] + return ok +} + +// ResetSyncToGithub resets all changes to the "sync_to_github" field. +func (m *GroupSettingMutation) ResetSyncToGithub() { + m.sync_to_github = nil + delete(m.clearedFields, groupsetting.FieldSyncToGithub) +} + +// SetGroupID sets the "group_id" field. +func (m *GroupSettingMutation) SetGroupID(s string) { + m.group = &s +} + +// GroupID returns the value of the "group_id" field in the mutation. +func (m *GroupSettingMutation) GroupID() (r string, exists bool) { + v := m.group + if v == nil { + return + } + return *v, true +} + +// OldGroupID returns the old "group_id" field's value of the GroupSetting entity. +// If the GroupSetting 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 *GroupSettingMutation) OldGroupID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGroupID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGroupID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGroupID: %w", err) + } + return oldValue.GroupID, nil +} + +// ClearGroupID clears the value of the "group_id" field. +func (m *GroupSettingMutation) ClearGroupID() { + m.group = nil + m.clearedFields[groupsetting.FieldGroupID] = struct{}{} +} + +// GroupIDCleared returns if the "group_id" field was cleared in this mutation. +func (m *GroupSettingMutation) GroupIDCleared() bool { + _, ok := m.clearedFields[groupsetting.FieldGroupID] + return ok +} + +// ResetGroupID resets all changes to the "group_id" field. +func (m *GroupSettingMutation) ResetGroupID() { + m.group = nil + delete(m.clearedFields, groupsetting.FieldGroupID) +} + +// ClearGroup clears the "group" edge to the Group entity. +func (m *GroupSettingMutation) ClearGroup() { + m.clearedgroup = true + m.clearedFields[groupsetting.FieldGroupID] = struct{}{} +} + +// GroupCleared reports if the "group" edge to the Group entity was cleared. +func (m *GroupSettingMutation) GroupCleared() bool { + return m.GroupIDCleared() || m.clearedgroup +} + +// GroupIDs returns the "group" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// GroupID instead. It exists only for internal usage by the builders. +func (m *GroupSettingMutation) GroupIDs() (ids []string) { + if id := m.group; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetGroup resets all changes to the "group" edge. +func (m *GroupSettingMutation) ResetGroup() { + m.group = nil + m.clearedgroup = false +} + +// Where appends a list predicates to the GroupSettingMutation builder. +func (m *GroupSettingMutation) Where(ps ...predicate.GroupSetting) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the GroupSettingMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *GroupSettingMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.GroupSetting, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *GroupSettingMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *GroupSettingMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (GroupSetting). +func (m *GroupSettingMutation) 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 *GroupSettingMutation) Fields() []string { + fields := make([]string, 0, 13) + if m.created_at != nil { + fields = append(fields, groupsetting.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, groupsetting.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, groupsetting.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, groupsetting.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, groupsetting.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, groupsetting.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, groupsetting.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, groupsetting.FieldDeletedBy) + } + if m.visibility != nil { + fields = append(fields, groupsetting.FieldVisibility) + } + if m.join_policy != nil { + fields = append(fields, groupsetting.FieldJoinPolicy) + } + if m.sync_to_slack != nil { + fields = append(fields, groupsetting.FieldSyncToSlack) + } + if m.sync_to_github != nil { + fields = append(fields, groupsetting.FieldSyncToGithub) + } + if m.group != nil { + fields = append(fields, groupsetting.FieldGroupID) + } + 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 *GroupSettingMutation) Field(name string) (ent.Value, bool) { + switch name { + case groupsetting.FieldCreatedAt: + return m.CreatedAt() + case groupsetting.FieldUpdatedAt: + return m.UpdatedAt() + case groupsetting.FieldCreatedBy: + return m.CreatedBy() + case groupsetting.FieldUpdatedBy: + return m.UpdatedBy() + case groupsetting.FieldMappingID: + return m.MappingID() + case groupsetting.FieldTags: + return m.Tags() + case groupsetting.FieldDeletedAt: + return m.DeletedAt() + case groupsetting.FieldDeletedBy: + return m.DeletedBy() + case groupsetting.FieldVisibility: + return m.Visibility() + case groupsetting.FieldJoinPolicy: + return m.JoinPolicy() + case groupsetting.FieldSyncToSlack: + return m.SyncToSlack() + case groupsetting.FieldSyncToGithub: + return m.SyncToGithub() + case groupsetting.FieldGroupID: + return m.GroupID() + } + 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 *GroupSettingMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case groupsetting.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case groupsetting.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case groupsetting.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case groupsetting.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case groupsetting.FieldMappingID: + return m.OldMappingID(ctx) + case groupsetting.FieldTags: + return m.OldTags(ctx) + case groupsetting.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case groupsetting.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case groupsetting.FieldVisibility: + return m.OldVisibility(ctx) + case groupsetting.FieldJoinPolicy: + return m.OldJoinPolicy(ctx) + case groupsetting.FieldSyncToSlack: + return m.OldSyncToSlack(ctx) + case groupsetting.FieldSyncToGithub: + return m.OldSyncToGithub(ctx) + case groupsetting.FieldGroupID: + return m.OldGroupID(ctx) + } + return nil, fmt.Errorf("unknown GroupSetting 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 *GroupSettingMutation) SetField(name string, value ent.Value) error { + switch name { + case groupsetting.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case groupsetting.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case groupsetting.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case groupsetting.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case groupsetting.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case groupsetting.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case groupsetting.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case groupsetting.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case groupsetting.FieldVisibility: + v, ok := value.(enums.Visibility) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetVisibility(v) + return nil + case groupsetting.FieldJoinPolicy: + v, ok := value.(enums.JoinPolicy) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetJoinPolicy(v) + return nil + case groupsetting.FieldSyncToSlack: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSyncToSlack(v) + return nil + case groupsetting.FieldSyncToGithub: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSyncToGithub(v) + return nil + case groupsetting.FieldGroupID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGroupID(v) + return nil + } + return fmt.Errorf("unknown GroupSetting field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *GroupSettingMutation) 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 *GroupSettingMutation) 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 *GroupSettingMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown GroupSetting numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *GroupSettingMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(groupsetting.FieldCreatedAt) { + fields = append(fields, groupsetting.FieldCreatedAt) + } + if m.FieldCleared(groupsetting.FieldUpdatedAt) { + fields = append(fields, groupsetting.FieldUpdatedAt) + } + if m.FieldCleared(groupsetting.FieldCreatedBy) { + fields = append(fields, groupsetting.FieldCreatedBy) + } + if m.FieldCleared(groupsetting.FieldUpdatedBy) { + fields = append(fields, groupsetting.FieldUpdatedBy) + } + if m.FieldCleared(groupsetting.FieldTags) { + fields = append(fields, groupsetting.FieldTags) + } + if m.FieldCleared(groupsetting.FieldDeletedAt) { + fields = append(fields, groupsetting.FieldDeletedAt) + } + if m.FieldCleared(groupsetting.FieldDeletedBy) { + fields = append(fields, groupsetting.FieldDeletedBy) + } + if m.FieldCleared(groupsetting.FieldSyncToSlack) { + fields = append(fields, groupsetting.FieldSyncToSlack) + } + if m.FieldCleared(groupsetting.FieldSyncToGithub) { + fields = append(fields, groupsetting.FieldSyncToGithub) + } + if m.FieldCleared(groupsetting.FieldGroupID) { + fields = append(fields, groupsetting.FieldGroupID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *GroupSettingMutation) 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 *GroupSettingMutation) ClearField(name string) error { + switch name { + case groupsetting.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case groupsetting.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case groupsetting.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case groupsetting.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case groupsetting.FieldTags: + m.ClearTags() + return nil + case groupsetting.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case groupsetting.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case groupsetting.FieldSyncToSlack: + m.ClearSyncToSlack() + return nil + case groupsetting.FieldSyncToGithub: + m.ClearSyncToGithub() + return nil + case groupsetting.FieldGroupID: + m.ClearGroupID() + return nil + } + return fmt.Errorf("unknown GroupSetting 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 *GroupSettingMutation) ResetField(name string) error { + switch name { + case groupsetting.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case groupsetting.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case groupsetting.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case groupsetting.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case groupsetting.FieldMappingID: + m.ResetMappingID() + return nil + case groupsetting.FieldTags: + m.ResetTags() + return nil + case groupsetting.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case groupsetting.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case groupsetting.FieldVisibility: + m.ResetVisibility() + return nil + case groupsetting.FieldJoinPolicy: + m.ResetJoinPolicy() + return nil + case groupsetting.FieldSyncToSlack: + m.ResetSyncToSlack() + return nil + case groupsetting.FieldSyncToGithub: + m.ResetSyncToGithub() + return nil + case groupsetting.FieldGroupID: + m.ResetGroupID() + return nil + } + return fmt.Errorf("unknown GroupSetting field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *GroupSettingMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.group != nil { + edges = append(edges, groupsetting.EdgeGroup) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *GroupSettingMutation) AddedIDs(name string) []ent.Value { + switch name { + case groupsetting.EdgeGroup: + if id := m.group; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *GroupSettingMutation) 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 *GroupSettingMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *GroupSettingMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedgroup { + edges = append(edges, groupsetting.EdgeGroup) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *GroupSettingMutation) EdgeCleared(name string) bool { + switch name { + case groupsetting.EdgeGroup: + return m.clearedgroup + } + 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 *GroupSettingMutation) ClearEdge(name string) error { + switch name { + case groupsetting.EdgeGroup: + m.ClearGroup() + return nil + } + return fmt.Errorf("unknown GroupSetting 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 *GroupSettingMutation) ResetEdge(name string) error { + switch name { + case groupsetting.EdgeGroup: + m.ResetGroup() + return nil + } + return fmt.Errorf("unknown GroupSetting edge %s", name) +} + +// GroupSettingHistoryMutation represents an operation that mutates the GroupSettingHistory nodes in the graph. +type GroupSettingHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + visibility *enums.Visibility + join_policy *enums.JoinPolicy + sync_to_slack *bool + sync_to_github *bool + group_id *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*GroupSettingHistory, error) + predicates []predicate.GroupSettingHistory +} + +var _ ent.Mutation = (*GroupSettingHistoryMutation)(nil) + +// groupsettinghistoryOption allows management of the mutation configuration using functional options. +type groupsettinghistoryOption func(*GroupSettingHistoryMutation) + +// newGroupSettingHistoryMutation creates new mutation for the GroupSettingHistory entity. +func newGroupSettingHistoryMutation(c config, op Op, opts ...groupsettinghistoryOption) *GroupSettingHistoryMutation { + m := &GroupSettingHistoryMutation{ + config: c, + op: op, + typ: TypeGroupSettingHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withGroupSettingHistoryID sets the ID field of the mutation. +func withGroupSettingHistoryID(id string) groupsettinghistoryOption { + return func(m *GroupSettingHistoryMutation) { + var ( + err error + once sync.Once + value *GroupSettingHistory + ) + m.oldValue = func(ctx context.Context) (*GroupSettingHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().GroupSettingHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withGroupSettingHistory sets the old GroupSettingHistory of the mutation. +func withGroupSettingHistory(node *GroupSettingHistory) groupsettinghistoryOption { + return func(m *GroupSettingHistoryMutation) { + m.oldValue = func(context.Context) (*GroupSettingHistory, 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 GroupSettingHistoryMutation) 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 GroupSettingHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of GroupSettingHistory entities. +func (m *GroupSettingHistoryMutation) SetID(id string) { + 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 *GroupSettingHistoryMutation) ID() (id string, 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 *GroupSettingHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().GroupSettingHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *GroupSettingHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *GroupSettingHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *GroupSettingHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *GroupSettingHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *GroupSettingHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *GroupSettingHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[groupsettinghistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *GroupSettingHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, groupsettinghistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *GroupSettingHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *GroupSettingHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *GroupSettingHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *GroupSettingHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *GroupSettingHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *GroupSettingHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[groupsettinghistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *GroupSettingHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, groupsettinghistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *GroupSettingHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *GroupSettingHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *GroupSettingHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[groupsettinghistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *GroupSettingHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, groupsettinghistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *GroupSettingHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *GroupSettingHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *GroupSettingHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[groupsettinghistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *GroupSettingHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, groupsettinghistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *GroupSettingHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *GroupSettingHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *GroupSettingHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[groupsettinghistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *GroupSettingHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, groupsettinghistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *GroupSettingHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *GroupSettingHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *GroupSettingHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *GroupSettingHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *GroupSettingHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *GroupSettingHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *GroupSettingHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *GroupSettingHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[groupsettinghistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *GroupSettingHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, groupsettinghistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *GroupSettingHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *GroupSettingHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *GroupSettingHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[groupsettinghistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *GroupSettingHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, groupsettinghistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *GroupSettingHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *GroupSettingHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *GroupSettingHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[groupsettinghistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *GroupSettingHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, groupsettinghistory.FieldDeletedBy) +} + +// SetVisibility sets the "visibility" field. +func (m *GroupSettingHistoryMutation) SetVisibility(e enums.Visibility) { + m.visibility = &e +} + +// Visibility returns the value of the "visibility" field in the mutation. +func (m *GroupSettingHistoryMutation) Visibility() (r enums.Visibility, exists bool) { + v := m.visibility + if v == nil { + return + } + return *v, true +} + +// OldVisibility returns the old "visibility" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldVisibility(ctx context.Context) (v enums.Visibility, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldVisibility is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldVisibility requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVisibility: %w", err) + } + return oldValue.Visibility, nil +} + +// ResetVisibility resets all changes to the "visibility" field. +func (m *GroupSettingHistoryMutation) ResetVisibility() { + m.visibility = nil +} + +// SetJoinPolicy sets the "join_policy" field. +func (m *GroupSettingHistoryMutation) SetJoinPolicy(ep enums.JoinPolicy) { + m.join_policy = &ep +} + +// JoinPolicy returns the value of the "join_policy" field in the mutation. +func (m *GroupSettingHistoryMutation) JoinPolicy() (r enums.JoinPolicy, exists bool) { + v := m.join_policy + if v == nil { + return + } + return *v, true +} + +// OldJoinPolicy returns the old "join_policy" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldJoinPolicy(ctx context.Context) (v enums.JoinPolicy, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldJoinPolicy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldJoinPolicy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldJoinPolicy: %w", err) + } + return oldValue.JoinPolicy, nil +} + +// ResetJoinPolicy resets all changes to the "join_policy" field. +func (m *GroupSettingHistoryMutation) ResetJoinPolicy() { + m.join_policy = nil +} + +// SetSyncToSlack sets the "sync_to_slack" field. +func (m *GroupSettingHistoryMutation) SetSyncToSlack(b bool) { + m.sync_to_slack = &b +} + +// SyncToSlack returns the value of the "sync_to_slack" field in the mutation. +func (m *GroupSettingHistoryMutation) SyncToSlack() (r bool, exists bool) { + v := m.sync_to_slack + if v == nil { + return + } + return *v, true +} + +// OldSyncToSlack returns the old "sync_to_slack" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldSyncToSlack(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSyncToSlack is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSyncToSlack requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSyncToSlack: %w", err) + } + return oldValue.SyncToSlack, nil +} + +// ClearSyncToSlack clears the value of the "sync_to_slack" field. +func (m *GroupSettingHistoryMutation) ClearSyncToSlack() { + m.sync_to_slack = nil + m.clearedFields[groupsettinghistory.FieldSyncToSlack] = struct{}{} +} + +// SyncToSlackCleared returns if the "sync_to_slack" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) SyncToSlackCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldSyncToSlack] + return ok +} + +// ResetSyncToSlack resets all changes to the "sync_to_slack" field. +func (m *GroupSettingHistoryMutation) ResetSyncToSlack() { + m.sync_to_slack = nil + delete(m.clearedFields, groupsettinghistory.FieldSyncToSlack) +} + +// SetSyncToGithub sets the "sync_to_github" field. +func (m *GroupSettingHistoryMutation) SetSyncToGithub(b bool) { + m.sync_to_github = &b +} + +// SyncToGithub returns the value of the "sync_to_github" field in the mutation. +func (m *GroupSettingHistoryMutation) SyncToGithub() (r bool, exists bool) { + v := m.sync_to_github + if v == nil { + return + } + return *v, true +} + +// OldSyncToGithub returns the old "sync_to_github" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldSyncToGithub(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSyncToGithub is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSyncToGithub requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSyncToGithub: %w", err) + } + return oldValue.SyncToGithub, nil +} + +// ClearSyncToGithub clears the value of the "sync_to_github" field. +func (m *GroupSettingHistoryMutation) ClearSyncToGithub() { + m.sync_to_github = nil + m.clearedFields[groupsettinghistory.FieldSyncToGithub] = struct{}{} +} + +// SyncToGithubCleared returns if the "sync_to_github" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) SyncToGithubCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldSyncToGithub] + return ok +} + +// ResetSyncToGithub resets all changes to the "sync_to_github" field. +func (m *GroupSettingHistoryMutation) ResetSyncToGithub() { + m.sync_to_github = nil + delete(m.clearedFields, groupsettinghistory.FieldSyncToGithub) +} + +// SetGroupID sets the "group_id" field. +func (m *GroupSettingHistoryMutation) SetGroupID(s string) { + m.group_id = &s +} + +// GroupID returns the value of the "group_id" field in the mutation. +func (m *GroupSettingHistoryMutation) GroupID() (r string, exists bool) { + v := m.group_id + if v == nil { + return + } + return *v, true +} + +// OldGroupID returns the old "group_id" field's value of the GroupSettingHistory entity. +// If the GroupSettingHistory 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 *GroupSettingHistoryMutation) OldGroupID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGroupID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGroupID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGroupID: %w", err) + } + return oldValue.GroupID, nil +} + +// ClearGroupID clears the value of the "group_id" field. +func (m *GroupSettingHistoryMutation) ClearGroupID() { + m.group_id = nil + m.clearedFields[groupsettinghistory.FieldGroupID] = struct{}{} +} + +// GroupIDCleared returns if the "group_id" field was cleared in this mutation. +func (m *GroupSettingHistoryMutation) GroupIDCleared() bool { + _, ok := m.clearedFields[groupsettinghistory.FieldGroupID] + return ok +} + +// ResetGroupID resets all changes to the "group_id" field. +func (m *GroupSettingHistoryMutation) ResetGroupID() { + m.group_id = nil + delete(m.clearedFields, groupsettinghistory.FieldGroupID) +} + +// Where appends a list predicates to the GroupSettingHistoryMutation builder. +func (m *GroupSettingHistoryMutation) Where(ps ...predicate.GroupSettingHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the GroupSettingHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *GroupSettingHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.GroupSettingHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *GroupSettingHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *GroupSettingHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (GroupSettingHistory). +func (m *GroupSettingHistoryMutation) 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 *GroupSettingHistoryMutation) Fields() []string { + fields := make([]string, 0, 16) + if m.history_time != nil { + fields = append(fields, groupsettinghistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, groupsettinghistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, groupsettinghistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, groupsettinghistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, groupsettinghistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, groupsettinghistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, groupsettinghistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, groupsettinghistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, groupsettinghistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, groupsettinghistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, groupsettinghistory.FieldDeletedBy) + } + if m.visibility != nil { + fields = append(fields, groupsettinghistory.FieldVisibility) + } + if m.join_policy != nil { + fields = append(fields, groupsettinghistory.FieldJoinPolicy) + } + if m.sync_to_slack != nil { + fields = append(fields, groupsettinghistory.FieldSyncToSlack) + } + if m.sync_to_github != nil { + fields = append(fields, groupsettinghistory.FieldSyncToGithub) + } + if m.group_id != nil { + fields = append(fields, groupsettinghistory.FieldGroupID) + } + 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 *GroupSettingHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case groupsettinghistory.FieldHistoryTime: + return m.HistoryTime() + case groupsettinghistory.FieldRef: + return m.Ref() + case groupsettinghistory.FieldOperation: + return m.Operation() + case groupsettinghistory.FieldCreatedAt: + return m.CreatedAt() + case groupsettinghistory.FieldUpdatedAt: + return m.UpdatedAt() + case groupsettinghistory.FieldCreatedBy: + return m.CreatedBy() + case groupsettinghistory.FieldUpdatedBy: + return m.UpdatedBy() + case groupsettinghistory.FieldMappingID: + return m.MappingID() + case groupsettinghistory.FieldTags: + return m.Tags() + case groupsettinghistory.FieldDeletedAt: + return m.DeletedAt() + case groupsettinghistory.FieldDeletedBy: + return m.DeletedBy() + case groupsettinghistory.FieldVisibility: + return m.Visibility() + case groupsettinghistory.FieldJoinPolicy: + return m.JoinPolicy() + case groupsettinghistory.FieldSyncToSlack: + return m.SyncToSlack() + case groupsettinghistory.FieldSyncToGithub: + return m.SyncToGithub() + case groupsettinghistory.FieldGroupID: + return m.GroupID() + } + 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 *GroupSettingHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case groupsettinghistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case groupsettinghistory.FieldRef: + return m.OldRef(ctx) + case groupsettinghistory.FieldOperation: + return m.OldOperation(ctx) + case groupsettinghistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case groupsettinghistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case groupsettinghistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case groupsettinghistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case groupsettinghistory.FieldMappingID: + return m.OldMappingID(ctx) + case groupsettinghistory.FieldTags: + return m.OldTags(ctx) + case groupsettinghistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case groupsettinghistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case groupsettinghistory.FieldVisibility: + return m.OldVisibility(ctx) + case groupsettinghistory.FieldJoinPolicy: + return m.OldJoinPolicy(ctx) + case groupsettinghistory.FieldSyncToSlack: + return m.OldSyncToSlack(ctx) + case groupsettinghistory.FieldSyncToGithub: + return m.OldSyncToGithub(ctx) + case groupsettinghistory.FieldGroupID: + return m.OldGroupID(ctx) + } + return nil, fmt.Errorf("unknown GroupSettingHistory 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 *GroupSettingHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case groupsettinghistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case groupsettinghistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case groupsettinghistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case groupsettinghistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case groupsettinghistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case groupsettinghistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case groupsettinghistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case groupsettinghistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case groupsettinghistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case groupsettinghistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case groupsettinghistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case groupsettinghistory.FieldVisibility: + v, ok := value.(enums.Visibility) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetVisibility(v) + return nil + case groupsettinghistory.FieldJoinPolicy: + v, ok := value.(enums.JoinPolicy) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetJoinPolicy(v) + return nil + case groupsettinghistory.FieldSyncToSlack: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSyncToSlack(v) + return nil + case groupsettinghistory.FieldSyncToGithub: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSyncToGithub(v) + return nil + case groupsettinghistory.FieldGroupID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGroupID(v) + return nil + } + return fmt.Errorf("unknown GroupSettingHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *GroupSettingHistoryMutation) 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 *GroupSettingHistoryMutation) 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 *GroupSettingHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown GroupSettingHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *GroupSettingHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(groupsettinghistory.FieldRef) { + fields = append(fields, groupsettinghistory.FieldRef) + } + if m.FieldCleared(groupsettinghistory.FieldCreatedAt) { + fields = append(fields, groupsettinghistory.FieldCreatedAt) + } + if m.FieldCleared(groupsettinghistory.FieldUpdatedAt) { + fields = append(fields, groupsettinghistory.FieldUpdatedAt) + } + if m.FieldCleared(groupsettinghistory.FieldCreatedBy) { + fields = append(fields, groupsettinghistory.FieldCreatedBy) + } + if m.FieldCleared(groupsettinghistory.FieldUpdatedBy) { + fields = append(fields, groupsettinghistory.FieldUpdatedBy) + } + if m.FieldCleared(groupsettinghistory.FieldTags) { + fields = append(fields, groupsettinghistory.FieldTags) + } + if m.FieldCleared(groupsettinghistory.FieldDeletedAt) { + fields = append(fields, groupsettinghistory.FieldDeletedAt) + } + if m.FieldCleared(groupsettinghistory.FieldDeletedBy) { + fields = append(fields, groupsettinghistory.FieldDeletedBy) + } + if m.FieldCleared(groupsettinghistory.FieldSyncToSlack) { + fields = append(fields, groupsettinghistory.FieldSyncToSlack) + } + if m.FieldCleared(groupsettinghistory.FieldSyncToGithub) { + fields = append(fields, groupsettinghistory.FieldSyncToGithub) + } + if m.FieldCleared(groupsettinghistory.FieldGroupID) { + fields = append(fields, groupsettinghistory.FieldGroupID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *GroupSettingHistoryMutation) 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 *GroupSettingHistoryMutation) ClearField(name string) error { + switch name { + case groupsettinghistory.FieldRef: + m.ClearRef() + return nil + case groupsettinghistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case groupsettinghistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case groupsettinghistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case groupsettinghistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case groupsettinghistory.FieldTags: + m.ClearTags() + return nil + case groupsettinghistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case groupsettinghistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case groupsettinghistory.FieldSyncToSlack: + m.ClearSyncToSlack() + return nil + case groupsettinghistory.FieldSyncToGithub: + m.ClearSyncToGithub() + return nil + case groupsettinghistory.FieldGroupID: + m.ClearGroupID() + return nil + } + return fmt.Errorf("unknown GroupSettingHistory 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 *GroupSettingHistoryMutation) ResetField(name string) error { + switch name { + case groupsettinghistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case groupsettinghistory.FieldRef: + m.ResetRef() + return nil + case groupsettinghistory.FieldOperation: + m.ResetOperation() + return nil + case groupsettinghistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case groupsettinghistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case groupsettinghistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case groupsettinghistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case groupsettinghistory.FieldMappingID: + m.ResetMappingID() + return nil + case groupsettinghistory.FieldTags: + m.ResetTags() + return nil + case groupsettinghistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case groupsettinghistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case groupsettinghistory.FieldVisibility: + m.ResetVisibility() + return nil + case groupsettinghistory.FieldJoinPolicy: + m.ResetJoinPolicy() + return nil + case groupsettinghistory.FieldSyncToSlack: + m.ResetSyncToSlack() + return nil + case groupsettinghistory.FieldSyncToGithub: + m.ResetSyncToGithub() + return nil + case groupsettinghistory.FieldGroupID: + m.ResetGroupID() + return nil + } + return fmt.Errorf("unknown GroupSettingHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *GroupSettingHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *GroupSettingHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *GroupSettingHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *GroupSettingHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *GroupSettingHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *GroupSettingHistoryMutation) EdgeCleared(name string) bool { + 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 *GroupSettingHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown GroupSettingHistory 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 *GroupSettingHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown GroupSettingHistory edge %s", name) +} + +// HushMutation represents an operation that mutates the Hush nodes in the graph. +type HushMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + name *string + description *string + kind *string + secret_name *string + secret_value *string + clearedFields map[string]struct{} + integrations map[string]struct{} + removedintegrations map[string]struct{} + clearedintegrations bool + organization map[string]struct{} + removedorganization map[string]struct{} + clearedorganization bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*Hush, error) + predicates []predicate.Hush +} + +var _ ent.Mutation = (*HushMutation)(nil) + +// hushOption allows management of the mutation configuration using functional options. +type hushOption func(*HushMutation) + +// newHushMutation creates new mutation for the Hush entity. +func newHushMutation(c config, op Op, opts ...hushOption) *HushMutation { + m := &HushMutation{ + config: c, + op: op, + typ: TypeHush, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withHushID sets the ID field of the mutation. +func withHushID(id string) hushOption { + return func(m *HushMutation) { + var ( + err error + once sync.Once + value *Hush + ) + m.oldValue = func(ctx context.Context) (*Hush, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Hush.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withHush sets the old Hush of the mutation. +func withHush(node *Hush) hushOption { + return func(m *HushMutation) { + m.oldValue = func(context.Context) (*Hush, 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 HushMutation) 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 HushMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Hush entities. +func (m *HushMutation) SetID(id string) { + 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 *HushMutation) ID() (id string, 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 *HushMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Hush.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *HushMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *HushMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *HushMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[hush.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *HushMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[hush.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *HushMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, hush.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *HushMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *HushMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *HushMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[hush.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *HushMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[hush.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *HushMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, hush.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *HushMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *HushMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *HushMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[hush.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *HushMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[hush.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *HushMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, hush.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *HushMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *HushMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *HushMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[hush.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *HushMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[hush.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *HushMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, hush.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *HushMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *HushMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *HushMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *HushMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *HushMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *HushMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[hush.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *HushMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[hush.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *HushMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, hush.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *HushMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *HushMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *HushMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[hush.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *HushMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[hush.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *HushMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, hush.FieldDeletedBy) +} + +// SetName sets the "name" field. +func (m *HushMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *HushMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *HushMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *HushMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *HushMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *HushMutation) ClearDescription() { + m.description = nil + m.clearedFields[hush.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *HushMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[hush.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *HushMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, hush.FieldDescription) +} + +// SetKind sets the "kind" field. +func (m *HushMutation) SetKind(s string) { + m.kind = &s +} + +// Kind returns the value of the "kind" field in the mutation. +func (m *HushMutation) Kind() (r string, exists bool) { + v := m.kind + if v == nil { + return + } + return *v, true +} + +// OldKind returns the old "kind" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldKind(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldKind is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldKind requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldKind: %w", err) + } + return oldValue.Kind, nil +} + +// ClearKind clears the value of the "kind" field. +func (m *HushMutation) ClearKind() { + m.kind = nil + m.clearedFields[hush.FieldKind] = struct{}{} +} + +// KindCleared returns if the "kind" field was cleared in this mutation. +func (m *HushMutation) KindCleared() bool { + _, ok := m.clearedFields[hush.FieldKind] + return ok +} + +// ResetKind resets all changes to the "kind" field. +func (m *HushMutation) ResetKind() { + m.kind = nil + delete(m.clearedFields, hush.FieldKind) +} + +// SetSecretName sets the "secret_name" field. +func (m *HushMutation) SetSecretName(s string) { + m.secret_name = &s +} + +// SecretName returns the value of the "secret_name" field in the mutation. +func (m *HushMutation) SecretName() (r string, exists bool) { + v := m.secret_name + if v == nil { + return + } + return *v, true +} + +// OldSecretName returns the old "secret_name" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldSecretName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecretName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecretName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecretName: %w", err) + } + return oldValue.SecretName, nil +} + +// ClearSecretName clears the value of the "secret_name" field. +func (m *HushMutation) ClearSecretName() { + m.secret_name = nil + m.clearedFields[hush.FieldSecretName] = struct{}{} +} + +// SecretNameCleared returns if the "secret_name" field was cleared in this mutation. +func (m *HushMutation) SecretNameCleared() bool { + _, ok := m.clearedFields[hush.FieldSecretName] + return ok +} + +// ResetSecretName resets all changes to the "secret_name" field. +func (m *HushMutation) ResetSecretName() { + m.secret_name = nil + delete(m.clearedFields, hush.FieldSecretName) +} + +// SetSecretValue sets the "secret_value" field. +func (m *HushMutation) SetSecretValue(s string) { + m.secret_value = &s +} + +// SecretValue returns the value of the "secret_value" field in the mutation. +func (m *HushMutation) SecretValue() (r string, exists bool) { + v := m.secret_value + if v == nil { + return + } + return *v, true +} + +// OldSecretValue returns the old "secret_value" field's value of the Hush entity. +// If the Hush 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 *HushMutation) OldSecretValue(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecretValue is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecretValue requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecretValue: %w", err) + } + return oldValue.SecretValue, nil +} + +// ClearSecretValue clears the value of the "secret_value" field. +func (m *HushMutation) ClearSecretValue() { + m.secret_value = nil + m.clearedFields[hush.FieldSecretValue] = struct{}{} +} + +// SecretValueCleared returns if the "secret_value" field was cleared in this mutation. +func (m *HushMutation) SecretValueCleared() bool { + _, ok := m.clearedFields[hush.FieldSecretValue] + return ok +} + +// ResetSecretValue resets all changes to the "secret_value" field. +func (m *HushMutation) ResetSecretValue() { + m.secret_value = nil + delete(m.clearedFields, hush.FieldSecretValue) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by ids. +func (m *HushMutation) AddIntegrationIDs(ids ...string) { + if m.integrations == nil { + m.integrations = make(map[string]struct{}) + } + for i := range ids { + m.integrations[ids[i]] = struct{}{} + } +} + +// ClearIntegrations clears the "integrations" edge to the Integration entity. +func (m *HushMutation) ClearIntegrations() { + m.clearedintegrations = true +} + +// IntegrationsCleared reports if the "integrations" edge to the Integration entity was cleared. +func (m *HushMutation) IntegrationsCleared() bool { + return m.clearedintegrations +} + +// RemoveIntegrationIDs removes the "integrations" edge to the Integration entity by IDs. +func (m *HushMutation) RemoveIntegrationIDs(ids ...string) { + if m.removedintegrations == nil { + m.removedintegrations = make(map[string]struct{}) + } + for i := range ids { + delete(m.integrations, ids[i]) + m.removedintegrations[ids[i]] = struct{}{} + } +} + +// RemovedIntegrations returns the removed IDs of the "integrations" edge to the Integration entity. +func (m *HushMutation) RemovedIntegrationsIDs() (ids []string) { + for id := range m.removedintegrations { + ids = append(ids, id) + } + return +} + +// IntegrationsIDs returns the "integrations" edge IDs in the mutation. +func (m *HushMutation) IntegrationsIDs() (ids []string) { + for id := range m.integrations { + ids = append(ids, id) + } + return +} + +// ResetIntegrations resets all changes to the "integrations" edge. +func (m *HushMutation) ResetIntegrations() { + m.integrations = nil + m.clearedintegrations = false + m.removedintegrations = nil +} + +// AddOrganizationIDs adds the "organization" edge to the Organization entity by ids. +func (m *HushMutation) AddOrganizationIDs(ids ...string) { + if m.organization == nil { + m.organization = make(map[string]struct{}) + } + for i := range ids { + m.organization[ids[i]] = struct{}{} + } +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (m *HushMutation) ClearOrganization() { + m.clearedorganization = true +} + +// OrganizationCleared reports if the "organization" edge to the Organization entity was cleared. +func (m *HushMutation) OrganizationCleared() bool { + return m.clearedorganization +} + +// RemoveOrganizationIDs removes the "organization" edge to the Organization entity by IDs. +func (m *HushMutation) RemoveOrganizationIDs(ids ...string) { + if m.removedorganization == nil { + m.removedorganization = make(map[string]struct{}) + } + for i := range ids { + delete(m.organization, ids[i]) + m.removedorganization[ids[i]] = struct{}{} + } +} + +// RemovedOrganization returns the removed IDs of the "organization" edge to the Organization entity. +func (m *HushMutation) RemovedOrganizationIDs() (ids []string) { + for id := range m.removedorganization { + ids = append(ids, id) + } + return +} + +// OrganizationIDs returns the "organization" edge IDs in the mutation. +func (m *HushMutation) OrganizationIDs() (ids []string) { + for id := range m.organization { + ids = append(ids, id) + } + return +} + +// ResetOrganization resets all changes to the "organization" edge. +func (m *HushMutation) ResetOrganization() { + m.organization = nil + m.clearedorganization = false + m.removedorganization = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *HushMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *HushMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *HushMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *HushMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *HushMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *HushMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *HushMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the HushMutation builder. +func (m *HushMutation) Where(ps ...predicate.Hush) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the HushMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *HushMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Hush, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *HushMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *HushMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Hush). +func (m *HushMutation) 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 *HushMutation) Fields() []string { + fields := make([]string, 0, 12) + if m.created_at != nil { + fields = append(fields, hush.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, hush.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, hush.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, hush.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, hush.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, hush.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, hush.FieldDeletedBy) + } + if m.name != nil { + fields = append(fields, hush.FieldName) + } + if m.description != nil { + fields = append(fields, hush.FieldDescription) + } + if m.kind != nil { + fields = append(fields, hush.FieldKind) + } + if m.secret_name != nil { + fields = append(fields, hush.FieldSecretName) + } + if m.secret_value != nil { + fields = append(fields, hush.FieldSecretValue) + } + 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 *HushMutation) Field(name string) (ent.Value, bool) { + switch name { + case hush.FieldCreatedAt: + return m.CreatedAt() + case hush.FieldUpdatedAt: + return m.UpdatedAt() + case hush.FieldCreatedBy: + return m.CreatedBy() + case hush.FieldUpdatedBy: + return m.UpdatedBy() + case hush.FieldMappingID: + return m.MappingID() + case hush.FieldDeletedAt: + return m.DeletedAt() + case hush.FieldDeletedBy: + return m.DeletedBy() + case hush.FieldName: + return m.Name() + case hush.FieldDescription: + return m.Description() + case hush.FieldKind: + return m.Kind() + case hush.FieldSecretName: + return m.SecretName() + case hush.FieldSecretValue: + return m.SecretValue() + } + 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 *HushMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case hush.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case hush.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case hush.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case hush.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case hush.FieldMappingID: + return m.OldMappingID(ctx) + case hush.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case hush.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case hush.FieldName: + return m.OldName(ctx) + case hush.FieldDescription: + return m.OldDescription(ctx) + case hush.FieldKind: + return m.OldKind(ctx) + case hush.FieldSecretName: + return m.OldSecretName(ctx) + case hush.FieldSecretValue: + return m.OldSecretValue(ctx) + } + return nil, fmt.Errorf("unknown Hush 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 *HushMutation) SetField(name string, value ent.Value) error { + switch name { + case hush.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case hush.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case hush.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case hush.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case hush.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case hush.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case hush.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case hush.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case hush.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case hush.FieldKind: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetKind(v) + return nil + case hush.FieldSecretName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecretName(v) + return nil + case hush.FieldSecretValue: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecretValue(v) + return nil + } + return fmt.Errorf("unknown Hush field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *HushMutation) 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 *HushMutation) 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 *HushMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Hush numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *HushMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(hush.FieldCreatedAt) { + fields = append(fields, hush.FieldCreatedAt) + } + if m.FieldCleared(hush.FieldUpdatedAt) { + fields = append(fields, hush.FieldUpdatedAt) + } + if m.FieldCleared(hush.FieldCreatedBy) { + fields = append(fields, hush.FieldCreatedBy) + } + if m.FieldCleared(hush.FieldUpdatedBy) { + fields = append(fields, hush.FieldUpdatedBy) + } + if m.FieldCleared(hush.FieldDeletedAt) { + fields = append(fields, hush.FieldDeletedAt) + } + if m.FieldCleared(hush.FieldDeletedBy) { + fields = append(fields, hush.FieldDeletedBy) + } + if m.FieldCleared(hush.FieldDescription) { + fields = append(fields, hush.FieldDescription) + } + if m.FieldCleared(hush.FieldKind) { + fields = append(fields, hush.FieldKind) + } + if m.FieldCleared(hush.FieldSecretName) { + fields = append(fields, hush.FieldSecretName) + } + if m.FieldCleared(hush.FieldSecretValue) { + fields = append(fields, hush.FieldSecretValue) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *HushMutation) 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 *HushMutation) ClearField(name string) error { + switch name { + case hush.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case hush.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case hush.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case hush.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case hush.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case hush.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case hush.FieldDescription: + m.ClearDescription() + return nil + case hush.FieldKind: + m.ClearKind() + return nil + case hush.FieldSecretName: + m.ClearSecretName() + return nil + case hush.FieldSecretValue: + m.ClearSecretValue() + return nil + } + return fmt.Errorf("unknown Hush 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 *HushMutation) ResetField(name string) error { + switch name { + case hush.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case hush.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case hush.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case hush.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case hush.FieldMappingID: + m.ResetMappingID() + return nil + case hush.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case hush.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case hush.FieldName: + m.ResetName() + return nil + case hush.FieldDescription: + m.ResetDescription() + return nil + case hush.FieldKind: + m.ResetKind() + return nil + case hush.FieldSecretName: + m.ResetSecretName() + return nil + case hush.FieldSecretValue: + m.ResetSecretValue() + return nil + } + return fmt.Errorf("unknown Hush field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *HushMutation) AddedEdges() []string { + edges := make([]string, 0, 3) + if m.integrations != nil { + edges = append(edges, hush.EdgeIntegrations) + } + if m.organization != nil { + edges = append(edges, hush.EdgeOrganization) + } + if m.events != nil { + edges = append(edges, hush.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *HushMutation) AddedIDs(name string) []ent.Value { + switch name { + case hush.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.integrations)) + for id := range m.integrations { + ids = append(ids, id) + } + return ids + case hush.EdgeOrganization: + ids := make([]ent.Value, 0, len(m.organization)) + for id := range m.organization { + ids = append(ids, id) + } + return ids + case hush.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *HushMutation) RemovedEdges() []string { + edges := make([]string, 0, 3) + if m.removedintegrations != nil { + edges = append(edges, hush.EdgeIntegrations) + } + if m.removedorganization != nil { + edges = append(edges, hush.EdgeOrganization) + } + if m.removedevents != nil { + edges = append(edges, hush.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *HushMutation) RemovedIDs(name string) []ent.Value { + switch name { + case hush.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.removedintegrations)) + for id := range m.removedintegrations { + ids = append(ids, id) + } + return ids + case hush.EdgeOrganization: + ids := make([]ent.Value, 0, len(m.removedorganization)) + for id := range m.removedorganization { + ids = append(ids, id) + } + return ids + case hush.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *HushMutation) ClearedEdges() []string { + edges := make([]string, 0, 3) + if m.clearedintegrations { + edges = append(edges, hush.EdgeIntegrations) + } + if m.clearedorganization { + edges = append(edges, hush.EdgeOrganization) + } + if m.clearedevents { + edges = append(edges, hush.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *HushMutation) EdgeCleared(name string) bool { + switch name { + case hush.EdgeIntegrations: + return m.clearedintegrations + case hush.EdgeOrganization: + return m.clearedorganization + case hush.EdgeEvents: + return m.clearedevents + } + 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 *HushMutation) ClearEdge(name string) error { + switch name { + } + return fmt.Errorf("unknown Hush 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 *HushMutation) ResetEdge(name string) error { + switch name { + case hush.EdgeIntegrations: + m.ResetIntegrations() + return nil + case hush.EdgeOrganization: + m.ResetOrganization() + return nil + case hush.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown Hush edge %s", name) +} + +// HushHistoryMutation represents an operation that mutates the HushHistory nodes in the graph. +type HushHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + name *string + description *string + kind *string + secret_name *string + secret_value *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*HushHistory, error) + predicates []predicate.HushHistory +} + +var _ ent.Mutation = (*HushHistoryMutation)(nil) + +// hushhistoryOption allows management of the mutation configuration using functional options. +type hushhistoryOption func(*HushHistoryMutation) + +// newHushHistoryMutation creates new mutation for the HushHistory entity. +func newHushHistoryMutation(c config, op Op, opts ...hushhistoryOption) *HushHistoryMutation { + m := &HushHistoryMutation{ + config: c, + op: op, + typ: TypeHushHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withHushHistoryID sets the ID field of the mutation. +func withHushHistoryID(id string) hushhistoryOption { + return func(m *HushHistoryMutation) { + var ( + err error + once sync.Once + value *HushHistory + ) + m.oldValue = func(ctx context.Context) (*HushHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().HushHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withHushHistory sets the old HushHistory of the mutation. +func withHushHistory(node *HushHistory) hushhistoryOption { + return func(m *HushHistoryMutation) { + m.oldValue = func(context.Context) (*HushHistory, 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 HushHistoryMutation) 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 HushHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of HushHistory entities. +func (m *HushHistoryMutation) SetID(id string) { + 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 *HushHistoryMutation) ID() (id string, 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 *HushHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().HushHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *HushHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *HushHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *HushHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *HushHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *HushHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *HushHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[hushhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *HushHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *HushHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, hushhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *HushHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *HushHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *HushHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *HushHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *HushHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *HushHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[hushhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *HushHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *HushHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, hushhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *HushHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *HushHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *HushHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[hushhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *HushHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *HushHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, hushhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *HushHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *HushHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *HushHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[hushhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *HushHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *HushHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, hushhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *HushHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *HushHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *HushHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[hushhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *HushHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *HushHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, hushhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *HushHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *HushHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *HushHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *HushHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *HushHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *HushHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[hushhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *HushHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *HushHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, hushhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *HushHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *HushHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *HushHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[hushhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *HushHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *HushHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, hushhistory.FieldDeletedBy) +} + +// SetName sets the "name" field. +func (m *HushHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *HushHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *HushHistoryMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *HushHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *HushHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *HushHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[hushhistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *HushHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *HushHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, hushhistory.FieldDescription) +} + +// SetKind sets the "kind" field. +func (m *HushHistoryMutation) SetKind(s string) { + m.kind = &s +} + +// Kind returns the value of the "kind" field in the mutation. +func (m *HushHistoryMutation) Kind() (r string, exists bool) { + v := m.kind + if v == nil { + return + } + return *v, true +} + +// OldKind returns the old "kind" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldKind(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldKind is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldKind requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldKind: %w", err) + } + return oldValue.Kind, nil +} + +// ClearKind clears the value of the "kind" field. +func (m *HushHistoryMutation) ClearKind() { + m.kind = nil + m.clearedFields[hushhistory.FieldKind] = struct{}{} +} + +// KindCleared returns if the "kind" field was cleared in this mutation. +func (m *HushHistoryMutation) KindCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldKind] + return ok +} + +// ResetKind resets all changes to the "kind" field. +func (m *HushHistoryMutation) ResetKind() { + m.kind = nil + delete(m.clearedFields, hushhistory.FieldKind) +} + +// SetSecretName sets the "secret_name" field. +func (m *HushHistoryMutation) SetSecretName(s string) { + m.secret_name = &s +} + +// SecretName returns the value of the "secret_name" field in the mutation. +func (m *HushHistoryMutation) SecretName() (r string, exists bool) { + v := m.secret_name + if v == nil { + return + } + return *v, true +} + +// OldSecretName returns the old "secret_name" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldSecretName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecretName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecretName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecretName: %w", err) + } + return oldValue.SecretName, nil +} + +// ClearSecretName clears the value of the "secret_name" field. +func (m *HushHistoryMutation) ClearSecretName() { + m.secret_name = nil + m.clearedFields[hushhistory.FieldSecretName] = struct{}{} +} + +// SecretNameCleared returns if the "secret_name" field was cleared in this mutation. +func (m *HushHistoryMutation) SecretNameCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldSecretName] + return ok +} + +// ResetSecretName resets all changes to the "secret_name" field. +func (m *HushHistoryMutation) ResetSecretName() { + m.secret_name = nil + delete(m.clearedFields, hushhistory.FieldSecretName) +} + +// SetSecretValue sets the "secret_value" field. +func (m *HushHistoryMutation) SetSecretValue(s string) { + m.secret_value = &s +} + +// SecretValue returns the value of the "secret_value" field in the mutation. +func (m *HushHistoryMutation) SecretValue() (r string, exists bool) { + v := m.secret_value + if v == nil { + return + } + return *v, true +} + +// OldSecretValue returns the old "secret_value" field's value of the HushHistory entity. +// If the HushHistory 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 *HushHistoryMutation) OldSecretValue(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecretValue is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecretValue requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecretValue: %w", err) + } + return oldValue.SecretValue, nil +} + +// ClearSecretValue clears the value of the "secret_value" field. +func (m *HushHistoryMutation) ClearSecretValue() { + m.secret_value = nil + m.clearedFields[hushhistory.FieldSecretValue] = struct{}{} +} + +// SecretValueCleared returns if the "secret_value" field was cleared in this mutation. +func (m *HushHistoryMutation) SecretValueCleared() bool { + _, ok := m.clearedFields[hushhistory.FieldSecretValue] + return ok +} + +// ResetSecretValue resets all changes to the "secret_value" field. +func (m *HushHistoryMutation) ResetSecretValue() { + m.secret_value = nil + delete(m.clearedFields, hushhistory.FieldSecretValue) +} + +// Where appends a list predicates to the HushHistoryMutation builder. +func (m *HushHistoryMutation) Where(ps ...predicate.HushHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the HushHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *HushHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.HushHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *HushHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *HushHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (HushHistory). +func (m *HushHistoryMutation) 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 *HushHistoryMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.history_time != nil { + fields = append(fields, hushhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, hushhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, hushhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, hushhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, hushhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, hushhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, hushhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, hushhistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, hushhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, hushhistory.FieldDeletedBy) + } + if m.name != nil { + fields = append(fields, hushhistory.FieldName) + } + if m.description != nil { + fields = append(fields, hushhistory.FieldDescription) + } + if m.kind != nil { + fields = append(fields, hushhistory.FieldKind) + } + if m.secret_name != nil { + fields = append(fields, hushhistory.FieldSecretName) + } + if m.secret_value != nil { + fields = append(fields, hushhistory.FieldSecretValue) + } + 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 *HushHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case hushhistory.FieldHistoryTime: + return m.HistoryTime() + case hushhistory.FieldRef: + return m.Ref() + case hushhistory.FieldOperation: + return m.Operation() + case hushhistory.FieldCreatedAt: + return m.CreatedAt() + case hushhistory.FieldUpdatedAt: + return m.UpdatedAt() + case hushhistory.FieldCreatedBy: + return m.CreatedBy() + case hushhistory.FieldUpdatedBy: + return m.UpdatedBy() + case hushhistory.FieldMappingID: + return m.MappingID() + case hushhistory.FieldDeletedAt: + return m.DeletedAt() + case hushhistory.FieldDeletedBy: + return m.DeletedBy() + case hushhistory.FieldName: + return m.Name() + case hushhistory.FieldDescription: + return m.Description() + case hushhistory.FieldKind: + return m.Kind() + case hushhistory.FieldSecretName: + return m.SecretName() + case hushhistory.FieldSecretValue: + return m.SecretValue() + } + 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 *HushHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case hushhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case hushhistory.FieldRef: + return m.OldRef(ctx) + case hushhistory.FieldOperation: + return m.OldOperation(ctx) + case hushhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case hushhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case hushhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case hushhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case hushhistory.FieldMappingID: + return m.OldMappingID(ctx) + case hushhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case hushhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case hushhistory.FieldName: + return m.OldName(ctx) + case hushhistory.FieldDescription: + return m.OldDescription(ctx) + case hushhistory.FieldKind: + return m.OldKind(ctx) + case hushhistory.FieldSecretName: + return m.OldSecretName(ctx) + case hushhistory.FieldSecretValue: + return m.OldSecretValue(ctx) + } + return nil, fmt.Errorf("unknown HushHistory 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 *HushHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case hushhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case hushhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case hushhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case hushhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case hushhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case hushhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case hushhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case hushhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case hushhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case hushhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case hushhistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case hushhistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case hushhistory.FieldKind: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetKind(v) + return nil + case hushhistory.FieldSecretName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecretName(v) + return nil + case hushhistory.FieldSecretValue: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecretValue(v) + return nil + } + return fmt.Errorf("unknown HushHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *HushHistoryMutation) 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 *HushHistoryMutation) 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 *HushHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown HushHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *HushHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(hushhistory.FieldRef) { + fields = append(fields, hushhistory.FieldRef) + } + if m.FieldCleared(hushhistory.FieldCreatedAt) { + fields = append(fields, hushhistory.FieldCreatedAt) + } + if m.FieldCleared(hushhistory.FieldUpdatedAt) { + fields = append(fields, hushhistory.FieldUpdatedAt) + } + if m.FieldCleared(hushhistory.FieldCreatedBy) { + fields = append(fields, hushhistory.FieldCreatedBy) + } + if m.FieldCleared(hushhistory.FieldUpdatedBy) { + fields = append(fields, hushhistory.FieldUpdatedBy) + } + if m.FieldCleared(hushhistory.FieldDeletedAt) { + fields = append(fields, hushhistory.FieldDeletedAt) + } + if m.FieldCleared(hushhistory.FieldDeletedBy) { + fields = append(fields, hushhistory.FieldDeletedBy) + } + if m.FieldCleared(hushhistory.FieldDescription) { + fields = append(fields, hushhistory.FieldDescription) + } + if m.FieldCleared(hushhistory.FieldKind) { + fields = append(fields, hushhistory.FieldKind) + } + if m.FieldCleared(hushhistory.FieldSecretName) { + fields = append(fields, hushhistory.FieldSecretName) + } + if m.FieldCleared(hushhistory.FieldSecretValue) { + fields = append(fields, hushhistory.FieldSecretValue) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *HushHistoryMutation) 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 *HushHistoryMutation) ClearField(name string) error { + switch name { + case hushhistory.FieldRef: + m.ClearRef() + return nil + case hushhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case hushhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case hushhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case hushhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case hushhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case hushhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case hushhistory.FieldDescription: + m.ClearDescription() + return nil + case hushhistory.FieldKind: + m.ClearKind() + return nil + case hushhistory.FieldSecretName: + m.ClearSecretName() + return nil + case hushhistory.FieldSecretValue: + m.ClearSecretValue() + return nil + } + return fmt.Errorf("unknown HushHistory 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 *HushHistoryMutation) ResetField(name string) error { + switch name { + case hushhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case hushhistory.FieldRef: + m.ResetRef() + return nil + case hushhistory.FieldOperation: + m.ResetOperation() + return nil + case hushhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case hushhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case hushhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case hushhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case hushhistory.FieldMappingID: + m.ResetMappingID() + return nil + case hushhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case hushhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case hushhistory.FieldName: + m.ResetName() + return nil + case hushhistory.FieldDescription: + m.ResetDescription() + return nil + case hushhistory.FieldKind: + m.ResetKind() + return nil + case hushhistory.FieldSecretName: + m.ResetSecretName() + return nil + case hushhistory.FieldSecretValue: + m.ResetSecretValue() + return nil + } + return fmt.Errorf("unknown HushHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *HushHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *HushHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *HushHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *HushHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *HushHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *HushHistoryMutation) EdgeCleared(name string) bool { + 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 *HushHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown HushHistory 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 *HushHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown HushHistory edge %s", name) +} + +// IntegrationMutation represents an operation that mutates the Integration nodes in the graph. +type IntegrationMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + name *string + description *string + kind *string + clearedFields map[string]struct{} + owner *string + clearedowner bool + secrets map[string]struct{} + removedsecrets map[string]struct{} + clearedsecrets bool + oauth2tokens map[string]struct{} + removedoauth2tokens map[string]struct{} + clearedoauth2tokens bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + webhooks map[string]struct{} + removedwebhooks map[string]struct{} + clearedwebhooks bool + done bool + oldValue func(context.Context) (*Integration, error) + predicates []predicate.Integration +} + +var _ ent.Mutation = (*IntegrationMutation)(nil) + +// integrationOption allows management of the mutation configuration using functional options. +type integrationOption func(*IntegrationMutation) + +// newIntegrationMutation creates new mutation for the Integration entity. +func newIntegrationMutation(c config, op Op, opts ...integrationOption) *IntegrationMutation { + m := &IntegrationMutation{ + config: c, + op: op, + typ: TypeIntegration, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withIntegrationID sets the ID field of the mutation. +func withIntegrationID(id string) integrationOption { + return func(m *IntegrationMutation) { + var ( + err error + once sync.Once + value *Integration + ) + m.oldValue = func(ctx context.Context) (*Integration, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Integration.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withIntegration sets the old Integration of the mutation. +func withIntegration(node *Integration) integrationOption { + return func(m *IntegrationMutation) { + m.oldValue = func(context.Context) (*Integration, 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 IntegrationMutation) 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 IntegrationMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Integration entities. +func (m *IntegrationMutation) SetID(id string) { + 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 *IntegrationMutation) ID() (id string, 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 *IntegrationMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Integration.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *IntegrationMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *IntegrationMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *IntegrationMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[integration.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *IntegrationMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[integration.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *IntegrationMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, integration.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *IntegrationMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *IntegrationMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *IntegrationMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[integration.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *IntegrationMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[integration.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *IntegrationMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, integration.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *IntegrationMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *IntegrationMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *IntegrationMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[integration.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *IntegrationMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[integration.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *IntegrationMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, integration.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *IntegrationMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *IntegrationMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *IntegrationMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[integration.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *IntegrationMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[integration.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *IntegrationMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, integration.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *IntegrationMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *IntegrationMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *IntegrationMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *IntegrationMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *IntegrationMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *IntegrationMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *IntegrationMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *IntegrationMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[integration.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *IntegrationMutation) TagsCleared() bool { + _, ok := m.clearedFields[integration.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *IntegrationMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, integration.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *IntegrationMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *IntegrationMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *IntegrationMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[integration.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *IntegrationMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[integration.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *IntegrationMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, integration.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *IntegrationMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *IntegrationMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *IntegrationMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[integration.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *IntegrationMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[integration.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *IntegrationMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, integration.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *IntegrationMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *IntegrationMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *IntegrationMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[integration.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *IntegrationMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[integration.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *IntegrationMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, integration.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *IntegrationMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *IntegrationMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *IntegrationMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *IntegrationMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *IntegrationMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *IntegrationMutation) ClearDescription() { + m.description = nil + m.clearedFields[integration.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *IntegrationMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[integration.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *IntegrationMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, integration.FieldDescription) +} + +// SetKind sets the "kind" field. +func (m *IntegrationMutation) SetKind(s string) { + m.kind = &s +} + +// Kind returns the value of the "kind" field in the mutation. +func (m *IntegrationMutation) Kind() (r string, exists bool) { + v := m.kind + if v == nil { + return + } + return *v, true +} + +// OldKind returns the old "kind" field's value of the Integration entity. +// If the Integration 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 *IntegrationMutation) OldKind(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldKind is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldKind requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldKind: %w", err) + } + return oldValue.Kind, nil +} + +// ClearKind clears the value of the "kind" field. +func (m *IntegrationMutation) ClearKind() { + m.kind = nil + m.clearedFields[integration.FieldKind] = struct{}{} +} + +// KindCleared returns if the "kind" field was cleared in this mutation. +func (m *IntegrationMutation) KindCleared() bool { + _, ok := m.clearedFields[integration.FieldKind] + return ok +} + +// ResetKind resets all changes to the "kind" field. +func (m *IntegrationMutation) ResetKind() { + m.kind = nil + delete(m.clearedFields, integration.FieldKind) +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *IntegrationMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[integration.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *IntegrationMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *IntegrationMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *IntegrationMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by ids. +func (m *IntegrationMutation) AddSecretIDs(ids ...string) { + if m.secrets == nil { + m.secrets = make(map[string]struct{}) + } + for i := range ids { + m.secrets[ids[i]] = struct{}{} + } +} + +// ClearSecrets clears the "secrets" edge to the Hush entity. +func (m *IntegrationMutation) ClearSecrets() { + m.clearedsecrets = true +} + +// SecretsCleared reports if the "secrets" edge to the Hush entity was cleared. +func (m *IntegrationMutation) SecretsCleared() bool { + return m.clearedsecrets +} + +// RemoveSecretIDs removes the "secrets" edge to the Hush entity by IDs. +func (m *IntegrationMutation) RemoveSecretIDs(ids ...string) { + if m.removedsecrets == nil { + m.removedsecrets = make(map[string]struct{}) + } + for i := range ids { + delete(m.secrets, ids[i]) + m.removedsecrets[ids[i]] = struct{}{} + } +} + +// RemovedSecrets returns the removed IDs of the "secrets" edge to the Hush entity. +func (m *IntegrationMutation) RemovedSecretsIDs() (ids []string) { + for id := range m.removedsecrets { + ids = append(ids, id) + } + return +} + +// SecretsIDs returns the "secrets" edge IDs in the mutation. +func (m *IntegrationMutation) SecretsIDs() (ids []string) { + for id := range m.secrets { + ids = append(ids, id) + } + return +} + +// ResetSecrets resets all changes to the "secrets" edge. +func (m *IntegrationMutation) ResetSecrets() { + m.secrets = nil + m.clearedsecrets = false + m.removedsecrets = nil +} + +// AddOauth2tokenIDs adds the "oauth2tokens" edge to the OhAuthTooToken entity by ids. +func (m *IntegrationMutation) AddOauth2tokenIDs(ids ...string) { + if m.oauth2tokens == nil { + m.oauth2tokens = make(map[string]struct{}) + } + for i := range ids { + m.oauth2tokens[ids[i]] = struct{}{} + } +} + +// ClearOauth2tokens clears the "oauth2tokens" edge to the OhAuthTooToken entity. +func (m *IntegrationMutation) ClearOauth2tokens() { + m.clearedoauth2tokens = true +} + +// Oauth2tokensCleared reports if the "oauth2tokens" edge to the OhAuthTooToken entity was cleared. +func (m *IntegrationMutation) Oauth2tokensCleared() bool { + return m.clearedoauth2tokens +} + +// RemoveOauth2tokenIDs removes the "oauth2tokens" edge to the OhAuthTooToken entity by IDs. +func (m *IntegrationMutation) RemoveOauth2tokenIDs(ids ...string) { + if m.removedoauth2tokens == nil { + m.removedoauth2tokens = make(map[string]struct{}) + } + for i := range ids { + delete(m.oauth2tokens, ids[i]) + m.removedoauth2tokens[ids[i]] = struct{}{} + } +} + +// RemovedOauth2tokens returns the removed IDs of the "oauth2tokens" edge to the OhAuthTooToken entity. +func (m *IntegrationMutation) RemovedOauth2tokensIDs() (ids []string) { + for id := range m.removedoauth2tokens { + ids = append(ids, id) + } + return +} + +// Oauth2tokensIDs returns the "oauth2tokens" edge IDs in the mutation. +func (m *IntegrationMutation) Oauth2tokensIDs() (ids []string) { + for id := range m.oauth2tokens { + ids = append(ids, id) + } + return +} + +// ResetOauth2tokens resets all changes to the "oauth2tokens" edge. +func (m *IntegrationMutation) ResetOauth2tokens() { + m.oauth2tokens = nil + m.clearedoauth2tokens = false + m.removedoauth2tokens = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *IntegrationMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *IntegrationMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *IntegrationMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *IntegrationMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *IntegrationMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *IntegrationMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *IntegrationMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by ids. +func (m *IntegrationMutation) AddWebhookIDs(ids ...string) { + if m.webhooks == nil { + m.webhooks = make(map[string]struct{}) + } + for i := range ids { + m.webhooks[ids[i]] = struct{}{} + } +} + +// ClearWebhooks clears the "webhooks" edge to the Webhook entity. +func (m *IntegrationMutation) ClearWebhooks() { + m.clearedwebhooks = true +} + +// WebhooksCleared reports if the "webhooks" edge to the Webhook entity was cleared. +func (m *IntegrationMutation) WebhooksCleared() bool { + return m.clearedwebhooks +} + +// RemoveWebhookIDs removes the "webhooks" edge to the Webhook entity by IDs. +func (m *IntegrationMutation) RemoveWebhookIDs(ids ...string) { + if m.removedwebhooks == nil { + m.removedwebhooks = make(map[string]struct{}) + } + for i := range ids { + delete(m.webhooks, ids[i]) + m.removedwebhooks[ids[i]] = struct{}{} + } +} + +// RemovedWebhooks returns the removed IDs of the "webhooks" edge to the Webhook entity. +func (m *IntegrationMutation) RemovedWebhooksIDs() (ids []string) { + for id := range m.removedwebhooks { + ids = append(ids, id) + } + return +} + +// WebhooksIDs returns the "webhooks" edge IDs in the mutation. +func (m *IntegrationMutation) WebhooksIDs() (ids []string) { + for id := range m.webhooks { + ids = append(ids, id) + } + return +} + +// ResetWebhooks resets all changes to the "webhooks" edge. +func (m *IntegrationMutation) ResetWebhooks() { + m.webhooks = nil + m.clearedwebhooks = false + m.removedwebhooks = nil +} + +// Where appends a list predicates to the IntegrationMutation builder. +func (m *IntegrationMutation) Where(ps ...predicate.Integration) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the IntegrationMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *IntegrationMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Integration, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *IntegrationMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *IntegrationMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Integration). +func (m *IntegrationMutation) 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 *IntegrationMutation) Fields() []string { + fields := make([]string, 0, 12) + if m.created_at != nil { + fields = append(fields, integration.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, integration.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, integration.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, integration.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, integration.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, integration.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, integration.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, integration.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, integration.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, integration.FieldName) + } + if m.description != nil { + fields = append(fields, integration.FieldDescription) + } + if m.kind != nil { + fields = append(fields, integration.FieldKind) + } + 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 *IntegrationMutation) Field(name string) (ent.Value, bool) { + switch name { + case integration.FieldCreatedAt: + return m.CreatedAt() + case integration.FieldUpdatedAt: + return m.UpdatedAt() + case integration.FieldCreatedBy: + return m.CreatedBy() + case integration.FieldUpdatedBy: + return m.UpdatedBy() + case integration.FieldMappingID: + return m.MappingID() + case integration.FieldTags: + return m.Tags() + case integration.FieldDeletedAt: + return m.DeletedAt() + case integration.FieldDeletedBy: + return m.DeletedBy() + case integration.FieldOwnerID: + return m.OwnerID() + case integration.FieldName: + return m.Name() + case integration.FieldDescription: + return m.Description() + case integration.FieldKind: + return m.Kind() + } + 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 *IntegrationMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case integration.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case integration.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case integration.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case integration.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case integration.FieldMappingID: + return m.OldMappingID(ctx) + case integration.FieldTags: + return m.OldTags(ctx) + case integration.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case integration.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case integration.FieldOwnerID: + return m.OldOwnerID(ctx) + case integration.FieldName: + return m.OldName(ctx) + case integration.FieldDescription: + return m.OldDescription(ctx) + case integration.FieldKind: + return m.OldKind(ctx) + } + return nil, fmt.Errorf("unknown Integration 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 *IntegrationMutation) SetField(name string, value ent.Value) error { + switch name { + case integration.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case integration.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case integration.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case integration.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case integration.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case integration.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case integration.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case integration.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case integration.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case integration.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case integration.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case integration.FieldKind: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetKind(v) + return nil + } + return fmt.Errorf("unknown Integration field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *IntegrationMutation) 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 *IntegrationMutation) 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 *IntegrationMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Integration numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *IntegrationMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(integration.FieldCreatedAt) { + fields = append(fields, integration.FieldCreatedAt) + } + if m.FieldCleared(integration.FieldUpdatedAt) { + fields = append(fields, integration.FieldUpdatedAt) + } + if m.FieldCleared(integration.FieldCreatedBy) { + fields = append(fields, integration.FieldCreatedBy) + } + if m.FieldCleared(integration.FieldUpdatedBy) { + fields = append(fields, integration.FieldUpdatedBy) + } + if m.FieldCleared(integration.FieldTags) { + fields = append(fields, integration.FieldTags) + } + if m.FieldCleared(integration.FieldDeletedAt) { + fields = append(fields, integration.FieldDeletedAt) + } + if m.FieldCleared(integration.FieldDeletedBy) { + fields = append(fields, integration.FieldDeletedBy) + } + if m.FieldCleared(integration.FieldOwnerID) { + fields = append(fields, integration.FieldOwnerID) + } + if m.FieldCleared(integration.FieldDescription) { + fields = append(fields, integration.FieldDescription) + } + if m.FieldCleared(integration.FieldKind) { + fields = append(fields, integration.FieldKind) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *IntegrationMutation) 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 *IntegrationMutation) ClearField(name string) error { + switch name { + case integration.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case integration.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case integration.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case integration.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case integration.FieldTags: + m.ClearTags() + return nil + case integration.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case integration.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case integration.FieldOwnerID: + m.ClearOwnerID() + return nil + case integration.FieldDescription: + m.ClearDescription() + return nil + case integration.FieldKind: + m.ClearKind() + return nil + } + return fmt.Errorf("unknown Integration 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 *IntegrationMutation) ResetField(name string) error { + switch name { + case integration.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case integration.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case integration.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case integration.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case integration.FieldMappingID: + m.ResetMappingID() + return nil + case integration.FieldTags: + m.ResetTags() + return nil + case integration.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case integration.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case integration.FieldOwnerID: + m.ResetOwnerID() + return nil + case integration.FieldName: + m.ResetName() + return nil + case integration.FieldDescription: + m.ResetDescription() + return nil + case integration.FieldKind: + m.ResetKind() + return nil + } + return fmt.Errorf("unknown Integration field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *IntegrationMutation) AddedEdges() []string { + edges := make([]string, 0, 5) + if m.owner != nil { + edges = append(edges, integration.EdgeOwner) + } + if m.secrets != nil { + edges = append(edges, integration.EdgeSecrets) + } + if m.oauth2tokens != nil { + edges = append(edges, integration.EdgeOauth2tokens) + } + if m.events != nil { + edges = append(edges, integration.EdgeEvents) + } + if m.webhooks != nil { + edges = append(edges, integration.EdgeWebhooks) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *IntegrationMutation) AddedIDs(name string) []ent.Value { + switch name { + case integration.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case integration.EdgeSecrets: + ids := make([]ent.Value, 0, len(m.secrets)) + for id := range m.secrets { + ids = append(ids, id) + } + return ids + case integration.EdgeOauth2tokens: + ids := make([]ent.Value, 0, len(m.oauth2tokens)) + for id := range m.oauth2tokens { + ids = append(ids, id) + } + return ids + case integration.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + case integration.EdgeWebhooks: + ids := make([]ent.Value, 0, len(m.webhooks)) + for id := range m.webhooks { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *IntegrationMutation) RemovedEdges() []string { + edges := make([]string, 0, 5) + if m.removedsecrets != nil { + edges = append(edges, integration.EdgeSecrets) + } + if m.removedoauth2tokens != nil { + edges = append(edges, integration.EdgeOauth2tokens) + } + if m.removedevents != nil { + edges = append(edges, integration.EdgeEvents) + } + if m.removedwebhooks != nil { + edges = append(edges, integration.EdgeWebhooks) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *IntegrationMutation) RemovedIDs(name string) []ent.Value { + switch name { + case integration.EdgeSecrets: + ids := make([]ent.Value, 0, len(m.removedsecrets)) + for id := range m.removedsecrets { + ids = append(ids, id) + } + return ids + case integration.EdgeOauth2tokens: + ids := make([]ent.Value, 0, len(m.removedoauth2tokens)) + for id := range m.removedoauth2tokens { + ids = append(ids, id) + } + return ids + case integration.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + case integration.EdgeWebhooks: + ids := make([]ent.Value, 0, len(m.removedwebhooks)) + for id := range m.removedwebhooks { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *IntegrationMutation) ClearedEdges() []string { + edges := make([]string, 0, 5) + if m.clearedowner { + edges = append(edges, integration.EdgeOwner) + } + if m.clearedsecrets { + edges = append(edges, integration.EdgeSecrets) + } + if m.clearedoauth2tokens { + edges = append(edges, integration.EdgeOauth2tokens) + } + if m.clearedevents { + edges = append(edges, integration.EdgeEvents) + } + if m.clearedwebhooks { + edges = append(edges, integration.EdgeWebhooks) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *IntegrationMutation) EdgeCleared(name string) bool { + switch name { + case integration.EdgeOwner: + return m.clearedowner + case integration.EdgeSecrets: + return m.clearedsecrets + case integration.EdgeOauth2tokens: + return m.clearedoauth2tokens + case integration.EdgeEvents: + return m.clearedevents + case integration.EdgeWebhooks: + return m.clearedwebhooks + } + 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 *IntegrationMutation) ClearEdge(name string) error { + switch name { + case integration.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Integration 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 *IntegrationMutation) ResetEdge(name string) error { + switch name { + case integration.EdgeOwner: + m.ResetOwner() + return nil + case integration.EdgeSecrets: + m.ResetSecrets() + return nil + case integration.EdgeOauth2tokens: + m.ResetOauth2tokens() + return nil + case integration.EdgeEvents: + m.ResetEvents() + return nil + case integration.EdgeWebhooks: + m.ResetWebhooks() + return nil + } + return fmt.Errorf("unknown Integration edge %s", name) +} + +// IntegrationHistoryMutation represents an operation that mutates the IntegrationHistory nodes in the graph. +type IntegrationHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + owner_id *string + name *string + description *string + kind *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*IntegrationHistory, error) + predicates []predicate.IntegrationHistory +} + +var _ ent.Mutation = (*IntegrationHistoryMutation)(nil) + +// integrationhistoryOption allows management of the mutation configuration using functional options. +type integrationhistoryOption func(*IntegrationHistoryMutation) + +// newIntegrationHistoryMutation creates new mutation for the IntegrationHistory entity. +func newIntegrationHistoryMutation(c config, op Op, opts ...integrationhistoryOption) *IntegrationHistoryMutation { + m := &IntegrationHistoryMutation{ + config: c, + op: op, + typ: TypeIntegrationHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withIntegrationHistoryID sets the ID field of the mutation. +func withIntegrationHistoryID(id string) integrationhistoryOption { + return func(m *IntegrationHistoryMutation) { + var ( + err error + once sync.Once + value *IntegrationHistory + ) + m.oldValue = func(ctx context.Context) (*IntegrationHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().IntegrationHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withIntegrationHistory sets the old IntegrationHistory of the mutation. +func withIntegrationHistory(node *IntegrationHistory) integrationhistoryOption { + return func(m *IntegrationHistoryMutation) { + m.oldValue = func(context.Context) (*IntegrationHistory, 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 IntegrationHistoryMutation) 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 IntegrationHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of IntegrationHistory entities. +func (m *IntegrationHistoryMutation) SetID(id string) { + 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 *IntegrationHistoryMutation) ID() (id string, 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 *IntegrationHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().IntegrationHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *IntegrationHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *IntegrationHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *IntegrationHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *IntegrationHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *IntegrationHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *IntegrationHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[integrationhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *IntegrationHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, integrationhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *IntegrationHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *IntegrationHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *IntegrationHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *IntegrationHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *IntegrationHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *IntegrationHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[integrationhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *IntegrationHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, integrationhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *IntegrationHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *IntegrationHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *IntegrationHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[integrationhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *IntegrationHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, integrationhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *IntegrationHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *IntegrationHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *IntegrationHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[integrationhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *IntegrationHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, integrationhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *IntegrationHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *IntegrationHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *IntegrationHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[integrationhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *IntegrationHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, integrationhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *IntegrationHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *IntegrationHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *IntegrationHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *IntegrationHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *IntegrationHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *IntegrationHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *IntegrationHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *IntegrationHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[integrationhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *IntegrationHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, integrationhistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *IntegrationHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *IntegrationHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *IntegrationHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[integrationhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *IntegrationHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, integrationhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *IntegrationHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *IntegrationHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *IntegrationHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[integrationhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *IntegrationHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, integrationhistory.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *IntegrationHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *IntegrationHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *IntegrationHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[integrationhistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *IntegrationHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, integrationhistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *IntegrationHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *IntegrationHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *IntegrationHistoryMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *IntegrationHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *IntegrationHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *IntegrationHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[integrationhistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *IntegrationHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, integrationhistory.FieldDescription) +} + +// SetKind sets the "kind" field. +func (m *IntegrationHistoryMutation) SetKind(s string) { + m.kind = &s +} + +// Kind returns the value of the "kind" field in the mutation. +func (m *IntegrationHistoryMutation) Kind() (r string, exists bool) { + v := m.kind + if v == nil { + return + } + return *v, true +} + +// OldKind returns the old "kind" field's value of the IntegrationHistory entity. +// If the IntegrationHistory 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 *IntegrationHistoryMutation) OldKind(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldKind is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldKind requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldKind: %w", err) + } + return oldValue.Kind, nil +} + +// ClearKind clears the value of the "kind" field. +func (m *IntegrationHistoryMutation) ClearKind() { + m.kind = nil + m.clearedFields[integrationhistory.FieldKind] = struct{}{} +} + +// KindCleared returns if the "kind" field was cleared in this mutation. +func (m *IntegrationHistoryMutation) KindCleared() bool { + _, ok := m.clearedFields[integrationhistory.FieldKind] + return ok +} + +// ResetKind resets all changes to the "kind" field. +func (m *IntegrationHistoryMutation) ResetKind() { + m.kind = nil + delete(m.clearedFields, integrationhistory.FieldKind) +} + +// Where appends a list predicates to the IntegrationHistoryMutation builder. +func (m *IntegrationHistoryMutation) Where(ps ...predicate.IntegrationHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the IntegrationHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *IntegrationHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.IntegrationHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *IntegrationHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *IntegrationHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (IntegrationHistory). +func (m *IntegrationHistoryMutation) 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 *IntegrationHistoryMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.history_time != nil { + fields = append(fields, integrationhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, integrationhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, integrationhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, integrationhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, integrationhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, integrationhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, integrationhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, integrationhistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, integrationhistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, integrationhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, integrationhistory.FieldDeletedBy) + } + if m.owner_id != nil { + fields = append(fields, integrationhistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, integrationhistory.FieldName) + } + if m.description != nil { + fields = append(fields, integrationhistory.FieldDescription) + } + if m.kind != nil { + fields = append(fields, integrationhistory.FieldKind) + } + 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 *IntegrationHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case integrationhistory.FieldHistoryTime: + return m.HistoryTime() + case integrationhistory.FieldRef: + return m.Ref() + case integrationhistory.FieldOperation: + return m.Operation() + case integrationhistory.FieldCreatedAt: + return m.CreatedAt() + case integrationhistory.FieldUpdatedAt: + return m.UpdatedAt() + case integrationhistory.FieldCreatedBy: + return m.CreatedBy() + case integrationhistory.FieldUpdatedBy: + return m.UpdatedBy() + case integrationhistory.FieldMappingID: + return m.MappingID() + case integrationhistory.FieldTags: + return m.Tags() + case integrationhistory.FieldDeletedAt: + return m.DeletedAt() + case integrationhistory.FieldDeletedBy: + return m.DeletedBy() + case integrationhistory.FieldOwnerID: + return m.OwnerID() + case integrationhistory.FieldName: + return m.Name() + case integrationhistory.FieldDescription: + return m.Description() + case integrationhistory.FieldKind: + return m.Kind() + } + 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 *IntegrationHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case integrationhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case integrationhistory.FieldRef: + return m.OldRef(ctx) + case integrationhistory.FieldOperation: + return m.OldOperation(ctx) + case integrationhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case integrationhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case integrationhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case integrationhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case integrationhistory.FieldMappingID: + return m.OldMappingID(ctx) + case integrationhistory.FieldTags: + return m.OldTags(ctx) + case integrationhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case integrationhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case integrationhistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case integrationhistory.FieldName: + return m.OldName(ctx) + case integrationhistory.FieldDescription: + return m.OldDescription(ctx) + case integrationhistory.FieldKind: + return m.OldKind(ctx) + } + return nil, fmt.Errorf("unknown IntegrationHistory 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 *IntegrationHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case integrationhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case integrationhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case integrationhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case integrationhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case integrationhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case integrationhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case integrationhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case integrationhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case integrationhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case integrationhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case integrationhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case integrationhistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case integrationhistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case integrationhistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case integrationhistory.FieldKind: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetKind(v) + return nil + } + return fmt.Errorf("unknown IntegrationHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *IntegrationHistoryMutation) 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 *IntegrationHistoryMutation) 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 *IntegrationHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown IntegrationHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *IntegrationHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(integrationhistory.FieldRef) { + fields = append(fields, integrationhistory.FieldRef) + } + if m.FieldCleared(integrationhistory.FieldCreatedAt) { + fields = append(fields, integrationhistory.FieldCreatedAt) + } + if m.FieldCleared(integrationhistory.FieldUpdatedAt) { + fields = append(fields, integrationhistory.FieldUpdatedAt) + } + if m.FieldCleared(integrationhistory.FieldCreatedBy) { + fields = append(fields, integrationhistory.FieldCreatedBy) + } + if m.FieldCleared(integrationhistory.FieldUpdatedBy) { + fields = append(fields, integrationhistory.FieldUpdatedBy) + } + if m.FieldCleared(integrationhistory.FieldTags) { + fields = append(fields, integrationhistory.FieldTags) + } + if m.FieldCleared(integrationhistory.FieldDeletedAt) { + fields = append(fields, integrationhistory.FieldDeletedAt) + } + if m.FieldCleared(integrationhistory.FieldDeletedBy) { + fields = append(fields, integrationhistory.FieldDeletedBy) + } + if m.FieldCleared(integrationhistory.FieldOwnerID) { + fields = append(fields, integrationhistory.FieldOwnerID) + } + if m.FieldCleared(integrationhistory.FieldDescription) { + fields = append(fields, integrationhistory.FieldDescription) + } + if m.FieldCleared(integrationhistory.FieldKind) { + fields = append(fields, integrationhistory.FieldKind) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *IntegrationHistoryMutation) 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 *IntegrationHistoryMutation) ClearField(name string) error { + switch name { + case integrationhistory.FieldRef: + m.ClearRef() + return nil + case integrationhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case integrationhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case integrationhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case integrationhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case integrationhistory.FieldTags: + m.ClearTags() + return nil + case integrationhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case integrationhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case integrationhistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case integrationhistory.FieldDescription: + m.ClearDescription() + return nil + case integrationhistory.FieldKind: + m.ClearKind() + return nil + } + return fmt.Errorf("unknown IntegrationHistory 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 *IntegrationHistoryMutation) ResetField(name string) error { + switch name { + case integrationhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case integrationhistory.FieldRef: + m.ResetRef() + return nil + case integrationhistory.FieldOperation: + m.ResetOperation() + return nil + case integrationhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case integrationhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case integrationhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case integrationhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case integrationhistory.FieldMappingID: + m.ResetMappingID() + return nil + case integrationhistory.FieldTags: + m.ResetTags() + return nil + case integrationhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case integrationhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case integrationhistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case integrationhistory.FieldName: + m.ResetName() + return nil + case integrationhistory.FieldDescription: + m.ResetDescription() + return nil + case integrationhistory.FieldKind: + m.ResetKind() + return nil + } + return fmt.Errorf("unknown IntegrationHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *IntegrationHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *IntegrationHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *IntegrationHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *IntegrationHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *IntegrationHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *IntegrationHistoryMutation) EdgeCleared(name string) bool { + 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 *IntegrationHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown IntegrationHistory 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 *IntegrationHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown IntegrationHistory edge %s", name) +} + +// InviteMutation represents an operation that mutates the Invite nodes in the graph. +type InviteMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + token *string + expires *time.Time + recipient *string + status *enums.InviteStatus + role *enums.Role + send_attempts *int + addsend_attempts *int + requestor_id *string + secret *[]byte + clearedFields map[string]struct{} + owner *string + clearedowner bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*Invite, error) + predicates []predicate.Invite +} + +var _ ent.Mutation = (*InviteMutation)(nil) + +// inviteOption allows management of the mutation configuration using functional options. +type inviteOption func(*InviteMutation) + +// newInviteMutation creates new mutation for the Invite entity. +func newInviteMutation(c config, op Op, opts ...inviteOption) *InviteMutation { + m := &InviteMutation{ + config: c, + op: op, + typ: TypeInvite, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withInviteID sets the ID field of the mutation. +func withInviteID(id string) inviteOption { + return func(m *InviteMutation) { + var ( + err error + once sync.Once + value *Invite + ) + m.oldValue = func(ctx context.Context) (*Invite, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Invite.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withInvite sets the old Invite of the mutation. +func withInvite(node *Invite) inviteOption { + return func(m *InviteMutation) { + m.oldValue = func(context.Context) (*Invite, 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 InviteMutation) 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 InviteMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Invite entities. +func (m *InviteMutation) SetID(id string) { + 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 *InviteMutation) ID() (id string, 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 *InviteMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Invite.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *InviteMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *InviteMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *InviteMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[invite.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *InviteMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[invite.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *InviteMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, invite.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *InviteMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *InviteMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *InviteMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[invite.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *InviteMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[invite.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *InviteMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, invite.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *InviteMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *InviteMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *InviteMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[invite.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *InviteMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[invite.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *InviteMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, invite.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *InviteMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *InviteMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *InviteMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[invite.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *InviteMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[invite.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *InviteMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, invite.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *InviteMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *InviteMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *InviteMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *InviteMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *InviteMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *InviteMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[invite.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *InviteMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[invite.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *InviteMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, invite.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *InviteMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *InviteMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *InviteMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[invite.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *InviteMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[invite.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *InviteMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, invite.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *InviteMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *InviteMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *InviteMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[invite.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *InviteMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[invite.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *InviteMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, invite.FieldOwnerID) +} + +// SetToken sets the "token" field. +func (m *InviteMutation) SetToken(s string) { + m.token = &s +} + +// Token returns the value of the "token" field in the mutation. +func (m *InviteMutation) Token() (r string, exists bool) { + v := m.token + if v == nil { + return + } + return *v, true +} + +// OldToken returns the old "token" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldToken(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldToken is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldToken requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldToken: %w", err) + } + return oldValue.Token, nil +} + +// ResetToken resets all changes to the "token" field. +func (m *InviteMutation) ResetToken() { + m.token = nil +} + +// SetExpires sets the "expires" field. +func (m *InviteMutation) SetExpires(t time.Time) { + m.expires = &t +} + +// Expires returns the value of the "expires" field in the mutation. +func (m *InviteMutation) Expires() (r time.Time, exists bool) { + v := m.expires + if v == nil { + return + } + return *v, true +} + +// OldExpires returns the old "expires" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldExpires(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpires is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpires requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpires: %w", err) + } + return oldValue.Expires, nil +} + +// ClearExpires clears the value of the "expires" field. +func (m *InviteMutation) ClearExpires() { + m.expires = nil + m.clearedFields[invite.FieldExpires] = struct{}{} +} + +// ExpiresCleared returns if the "expires" field was cleared in this mutation. +func (m *InviteMutation) ExpiresCleared() bool { + _, ok := m.clearedFields[invite.FieldExpires] + return ok +} + +// ResetExpires resets all changes to the "expires" field. +func (m *InviteMutation) ResetExpires() { + m.expires = nil + delete(m.clearedFields, invite.FieldExpires) +} + +// SetRecipient sets the "recipient" field. +func (m *InviteMutation) SetRecipient(s string) { + m.recipient = &s +} + +// Recipient returns the value of the "recipient" field in the mutation. +func (m *InviteMutation) Recipient() (r string, exists bool) { + v := m.recipient + if v == nil { + return + } + return *v, true +} + +// OldRecipient returns the old "recipient" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldRecipient(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRecipient is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRecipient requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRecipient: %w", err) + } + return oldValue.Recipient, nil +} + +// ResetRecipient resets all changes to the "recipient" field. +func (m *InviteMutation) ResetRecipient() { + m.recipient = nil +} + +// SetStatus sets the "status" field. +func (m *InviteMutation) SetStatus(es enums.InviteStatus) { + m.status = &es +} + +// Status returns the value of the "status" field in the mutation. +func (m *InviteMutation) Status() (r enums.InviteStatus, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldStatus(ctx context.Context) (v enums.InviteStatus, 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 +} + +// ResetStatus resets all changes to the "status" field. +func (m *InviteMutation) ResetStatus() { + m.status = nil +} + +// SetRole sets the "role" field. +func (m *InviteMutation) SetRole(e enums.Role) { + m.role = &e +} + +// Role returns the value of the "role" field in the mutation. +func (m *InviteMutation) Role() (r enums.Role, exists bool) { + v := m.role + if v == nil { + return + } + return *v, true +} + +// OldRole returns the old "role" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldRole(ctx context.Context) (v enums.Role, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// ResetRole resets all changes to the "role" field. +func (m *InviteMutation) ResetRole() { + m.role = nil +} + +// SetSendAttempts sets the "send_attempts" field. +func (m *InviteMutation) SetSendAttempts(i int) { + m.send_attempts = &i + m.addsend_attempts = nil +} + +// SendAttempts returns the value of the "send_attempts" field in the mutation. +func (m *InviteMutation) SendAttempts() (r int, exists bool) { + v := m.send_attempts + if v == nil { + return + } + return *v, true +} + +// OldSendAttempts returns the old "send_attempts" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldSendAttempts(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSendAttempts is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSendAttempts requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSendAttempts: %w", err) + } + return oldValue.SendAttempts, nil +} + +// AddSendAttempts adds i to the "send_attempts" field. +func (m *InviteMutation) AddSendAttempts(i int) { + if m.addsend_attempts != nil { + *m.addsend_attempts += i + } else { + m.addsend_attempts = &i + } +} + +// AddedSendAttempts returns the value that was added to the "send_attempts" field in this mutation. +func (m *InviteMutation) AddedSendAttempts() (r int, exists bool) { + v := m.addsend_attempts + if v == nil { + return + } + return *v, true +} + +// ResetSendAttempts resets all changes to the "send_attempts" field. +func (m *InviteMutation) ResetSendAttempts() { + m.send_attempts = nil + m.addsend_attempts = nil +} + +// SetRequestorID sets the "requestor_id" field. +func (m *InviteMutation) SetRequestorID(s string) { + m.requestor_id = &s +} + +// RequestorID returns the value of the "requestor_id" field in the mutation. +func (m *InviteMutation) RequestorID() (r string, exists bool) { + v := m.requestor_id + if v == nil { + return + } + return *v, true +} + +// OldRequestorID returns the old "requestor_id" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldRequestorID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRequestorID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRequestorID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRequestorID: %w", err) + } + return oldValue.RequestorID, nil +} + +// ClearRequestorID clears the value of the "requestor_id" field. +func (m *InviteMutation) ClearRequestorID() { + m.requestor_id = nil + m.clearedFields[invite.FieldRequestorID] = struct{}{} +} + +// RequestorIDCleared returns if the "requestor_id" field was cleared in this mutation. +func (m *InviteMutation) RequestorIDCleared() bool { + _, ok := m.clearedFields[invite.FieldRequestorID] + return ok +} + +// ResetRequestorID resets all changes to the "requestor_id" field. +func (m *InviteMutation) ResetRequestorID() { + m.requestor_id = nil + delete(m.clearedFields, invite.FieldRequestorID) +} + +// SetSecret sets the "secret" field. +func (m *InviteMutation) SetSecret(b []byte) { + m.secret = &b +} + +// Secret returns the value of the "secret" field in the mutation. +func (m *InviteMutation) Secret() (r []byte, exists bool) { + v := m.secret + if v == nil { + return + } + return *v, true +} + +// OldSecret returns the old "secret" field's value of the Invite entity. +// If the Invite 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 *InviteMutation) OldSecret(ctx context.Context) (v *[]byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecret: %w", err) + } + return oldValue.Secret, nil +} + +// ResetSecret resets all changes to the "secret" field. +func (m *InviteMutation) ResetSecret() { + m.secret = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *InviteMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[invite.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *InviteMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *InviteMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *InviteMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *InviteMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *InviteMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *InviteMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *InviteMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *InviteMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *InviteMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *InviteMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the InviteMutation builder. +func (m *InviteMutation) Where(ps ...predicate.Invite) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the InviteMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *InviteMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Invite, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *InviteMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *InviteMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Invite). +func (m *InviteMutation) 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 *InviteMutation) Fields() []string { + fields := make([]string, 0, 16) + if m.created_at != nil { + fields = append(fields, invite.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, invite.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, invite.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, invite.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, invite.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, invite.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, invite.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, invite.FieldOwnerID) + } + if m.token != nil { + fields = append(fields, invite.FieldToken) + } + if m.expires != nil { + fields = append(fields, invite.FieldExpires) + } + if m.recipient != nil { + fields = append(fields, invite.FieldRecipient) + } + if m.status != nil { + fields = append(fields, invite.FieldStatus) + } + if m.role != nil { + fields = append(fields, invite.FieldRole) + } + if m.send_attempts != nil { + fields = append(fields, invite.FieldSendAttempts) + } + if m.requestor_id != nil { + fields = append(fields, invite.FieldRequestorID) + } + if m.secret != nil { + fields = append(fields, invite.FieldSecret) + } + 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 *InviteMutation) Field(name string) (ent.Value, bool) { + switch name { + case invite.FieldCreatedAt: + return m.CreatedAt() + case invite.FieldUpdatedAt: + return m.UpdatedAt() + case invite.FieldCreatedBy: + return m.CreatedBy() + case invite.FieldUpdatedBy: + return m.UpdatedBy() + case invite.FieldMappingID: + return m.MappingID() + case invite.FieldDeletedAt: + return m.DeletedAt() + case invite.FieldDeletedBy: + return m.DeletedBy() + case invite.FieldOwnerID: + return m.OwnerID() + case invite.FieldToken: + return m.Token() + case invite.FieldExpires: + return m.Expires() + case invite.FieldRecipient: + return m.Recipient() + case invite.FieldStatus: + return m.Status() + case invite.FieldRole: + return m.Role() + case invite.FieldSendAttempts: + return m.SendAttempts() + case invite.FieldRequestorID: + return m.RequestorID() + case invite.FieldSecret: + return m.Secret() + } + 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 *InviteMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case invite.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case invite.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case invite.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case invite.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case invite.FieldMappingID: + return m.OldMappingID(ctx) + case invite.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case invite.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case invite.FieldOwnerID: + return m.OldOwnerID(ctx) + case invite.FieldToken: + return m.OldToken(ctx) + case invite.FieldExpires: + return m.OldExpires(ctx) + case invite.FieldRecipient: + return m.OldRecipient(ctx) + case invite.FieldStatus: + return m.OldStatus(ctx) + case invite.FieldRole: + return m.OldRole(ctx) + case invite.FieldSendAttempts: + return m.OldSendAttempts(ctx) + case invite.FieldRequestorID: + return m.OldRequestorID(ctx) + case invite.FieldSecret: + return m.OldSecret(ctx) + } + return nil, fmt.Errorf("unknown Invite 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 *InviteMutation) SetField(name string, value ent.Value) error { + switch name { + case invite.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case invite.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case invite.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case invite.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case invite.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case invite.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case invite.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case invite.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case invite.FieldToken: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetToken(v) + return nil + case invite.FieldExpires: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpires(v) + return nil + case invite.FieldRecipient: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRecipient(v) + return nil + case invite.FieldStatus: + v, ok := value.(enums.InviteStatus) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case invite.FieldRole: + v, ok := value.(enums.Role) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRole(v) + return nil + case invite.FieldSendAttempts: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSendAttempts(v) + return nil + case invite.FieldRequestorID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRequestorID(v) + return nil + case invite.FieldSecret: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecret(v) + return nil + } + return fmt.Errorf("unknown Invite field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *InviteMutation) AddedFields() []string { + var fields []string + if m.addsend_attempts != nil { + fields = append(fields, invite.FieldSendAttempts) + } + return fields +} + +// 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 *InviteMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case invite.FieldSendAttempts: + return m.AddedSendAttempts() + } + 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 *InviteMutation) AddField(name string, value ent.Value) error { + switch name { + case invite.FieldSendAttempts: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddSendAttempts(v) + return nil + } + return fmt.Errorf("unknown Invite numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *InviteMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(invite.FieldCreatedAt) { + fields = append(fields, invite.FieldCreatedAt) + } + if m.FieldCleared(invite.FieldUpdatedAt) { + fields = append(fields, invite.FieldUpdatedAt) + } + if m.FieldCleared(invite.FieldCreatedBy) { + fields = append(fields, invite.FieldCreatedBy) + } + if m.FieldCleared(invite.FieldUpdatedBy) { + fields = append(fields, invite.FieldUpdatedBy) + } + if m.FieldCleared(invite.FieldDeletedAt) { + fields = append(fields, invite.FieldDeletedAt) + } + if m.FieldCleared(invite.FieldDeletedBy) { + fields = append(fields, invite.FieldDeletedBy) + } + if m.FieldCleared(invite.FieldOwnerID) { + fields = append(fields, invite.FieldOwnerID) + } + if m.FieldCleared(invite.FieldExpires) { + fields = append(fields, invite.FieldExpires) + } + if m.FieldCleared(invite.FieldRequestorID) { + fields = append(fields, invite.FieldRequestorID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *InviteMutation) 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 *InviteMutation) ClearField(name string) error { + switch name { + case invite.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case invite.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case invite.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case invite.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case invite.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case invite.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case invite.FieldOwnerID: + m.ClearOwnerID() + return nil + case invite.FieldExpires: + m.ClearExpires() + return nil + case invite.FieldRequestorID: + m.ClearRequestorID() + return nil + } + return fmt.Errorf("unknown Invite 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 *InviteMutation) ResetField(name string) error { + switch name { + case invite.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case invite.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case invite.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case invite.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case invite.FieldMappingID: + m.ResetMappingID() + return nil + case invite.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case invite.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case invite.FieldOwnerID: + m.ResetOwnerID() + return nil + case invite.FieldToken: + m.ResetToken() + return nil + case invite.FieldExpires: + m.ResetExpires() + return nil + case invite.FieldRecipient: + m.ResetRecipient() + return nil + case invite.FieldStatus: + m.ResetStatus() + return nil + case invite.FieldRole: + m.ResetRole() + return nil + case invite.FieldSendAttempts: + m.ResetSendAttempts() + return nil + case invite.FieldRequestorID: + m.ResetRequestorID() + return nil + case invite.FieldSecret: + m.ResetSecret() + return nil + } + return fmt.Errorf("unknown Invite field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *InviteMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.owner != nil { + edges = append(edges, invite.EdgeOwner) + } + if m.events != nil { + edges = append(edges, invite.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *InviteMutation) AddedIDs(name string) []ent.Value { + switch name { + case invite.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case invite.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *InviteMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedevents != nil { + edges = append(edges, invite.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *InviteMutation) RemovedIDs(name string) []ent.Value { + switch name { + case invite.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *InviteMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedowner { + edges = append(edges, invite.EdgeOwner) + } + if m.clearedevents { + edges = append(edges, invite.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *InviteMutation) EdgeCleared(name string) bool { + switch name { + case invite.EdgeOwner: + return m.clearedowner + case invite.EdgeEvents: + return m.clearedevents + } + 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 *InviteMutation) ClearEdge(name string) error { + switch name { + case invite.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Invite 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 *InviteMutation) ResetEdge(name string) error { + switch name { + case invite.EdgeOwner: + m.ResetOwner() + return nil + case invite.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown Invite edge %s", name) +} + +// NoteMutation represents an operation that mutates the Note nodes in the graph. +type NoteMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + text *string + clearedFields map[string]struct{} + owner *string + clearedowner bool + entity *string + clearedentity bool + done bool + oldValue func(context.Context) (*Note, error) + predicates []predicate.Note +} + +var _ ent.Mutation = (*NoteMutation)(nil) + +// noteOption allows management of the mutation configuration using functional options. +type noteOption func(*NoteMutation) + +// newNoteMutation creates new mutation for the Note entity. +func newNoteMutation(c config, op Op, opts ...noteOption) *NoteMutation { + m := &NoteMutation{ + config: c, + op: op, + typ: TypeNote, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withNoteID sets the ID field of the mutation. +func withNoteID(id string) noteOption { + return func(m *NoteMutation) { + var ( + err error + once sync.Once + value *Note + ) + m.oldValue = func(ctx context.Context) (*Note, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Note.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withNote sets the old Note of the mutation. +func withNote(node *Note) noteOption { + return func(m *NoteMutation) { + m.oldValue = func(context.Context) (*Note, 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 NoteMutation) 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 NoteMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Note entities. +func (m *NoteMutation) SetID(id string) { + 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 *NoteMutation) ID() (id string, 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 *NoteMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Note.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *NoteMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *NoteMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *NoteMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[note.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *NoteMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[note.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *NoteMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, note.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *NoteMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *NoteMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *NoteMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[note.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *NoteMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[note.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *NoteMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, note.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *NoteMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *NoteMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *NoteMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[note.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *NoteMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[note.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *NoteMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, note.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *NoteMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *NoteMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *NoteMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[note.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *NoteMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[note.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *NoteMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, note.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *NoteMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *NoteMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *NoteMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *NoteMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *NoteMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *NoteMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[note.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *NoteMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[note.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *NoteMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, note.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *NoteMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *NoteMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *NoteMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[note.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *NoteMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[note.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *NoteMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, note.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *NoteMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *NoteMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *NoteMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *NoteMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *NoteMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[note.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *NoteMutation) TagsCleared() bool { + _, ok := m.clearedFields[note.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *NoteMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, note.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *NoteMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *NoteMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *NoteMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[note.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *NoteMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[note.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *NoteMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, note.FieldOwnerID) +} + +// SetText sets the "text" field. +func (m *NoteMutation) SetText(s string) { + m.text = &s +} + +// Text returns the value of the "text" field in the mutation. +func (m *NoteMutation) Text() (r string, exists bool) { + v := m.text + if v == nil { + return + } + return *v, true +} + +// OldText returns the old "text" field's value of the Note entity. +// If the Note 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 *NoteMutation) OldText(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// ResetText resets all changes to the "text" field. +func (m *NoteMutation) ResetText() { + m.text = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *NoteMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[note.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *NoteMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *NoteMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *NoteMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// SetEntityID sets the "entity" edge to the Entity entity by id. +func (m *NoteMutation) SetEntityID(id string) { + m.entity = &id +} + +// ClearEntity clears the "entity" edge to the Entity entity. +func (m *NoteMutation) ClearEntity() { + m.clearedentity = true +} + +// EntityCleared reports if the "entity" edge to the Entity entity was cleared. +func (m *NoteMutation) EntityCleared() bool { + return m.clearedentity +} + +// EntityID returns the "entity" edge ID in the mutation. +func (m *NoteMutation) EntityID() (id string, exists bool) { + if m.entity != nil { + return *m.entity, true + } + return +} + +// EntityIDs returns the "entity" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// EntityID instead. It exists only for internal usage by the builders. +func (m *NoteMutation) EntityIDs() (ids []string) { + if id := m.entity; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetEntity resets all changes to the "entity" edge. +func (m *NoteMutation) ResetEntity() { + m.entity = nil + m.clearedentity = false +} + +// Where appends a list predicates to the NoteMutation builder. +func (m *NoteMutation) Where(ps ...predicate.Note) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the NoteMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *NoteMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Note, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *NoteMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *NoteMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Note). +func (m *NoteMutation) 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 *NoteMutation) Fields() []string { + fields := make([]string, 0, 10) + if m.created_at != nil { + fields = append(fields, note.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, note.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, note.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, note.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, note.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, note.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, note.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, note.FieldTags) + } + if m.owner != nil { + fields = append(fields, note.FieldOwnerID) + } + if m.text != nil { + fields = append(fields, note.FieldText) + } + 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 *NoteMutation) Field(name string) (ent.Value, bool) { + switch name { + case note.FieldCreatedAt: + return m.CreatedAt() + case note.FieldUpdatedAt: + return m.UpdatedAt() + case note.FieldCreatedBy: + return m.CreatedBy() + case note.FieldUpdatedBy: + return m.UpdatedBy() + case note.FieldMappingID: + return m.MappingID() + case note.FieldDeletedAt: + return m.DeletedAt() + case note.FieldDeletedBy: + return m.DeletedBy() + case note.FieldTags: + return m.Tags() + case note.FieldOwnerID: + return m.OwnerID() + case note.FieldText: + return m.Text() + } + 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 *NoteMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case note.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case note.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case note.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case note.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case note.FieldMappingID: + return m.OldMappingID(ctx) + case note.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case note.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case note.FieldTags: + return m.OldTags(ctx) + case note.FieldOwnerID: + return m.OldOwnerID(ctx) + case note.FieldText: + return m.OldText(ctx) + } + return nil, fmt.Errorf("unknown Note 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 *NoteMutation) SetField(name string, value ent.Value) error { + switch name { + case note.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case note.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case note.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case note.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case note.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case note.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case note.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case note.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case note.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case note.FieldText: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetText(v) + return nil + } + return fmt.Errorf("unknown Note field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *NoteMutation) 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 *NoteMutation) 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 *NoteMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Note numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *NoteMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(note.FieldCreatedAt) { + fields = append(fields, note.FieldCreatedAt) + } + if m.FieldCleared(note.FieldUpdatedAt) { + fields = append(fields, note.FieldUpdatedAt) + } + if m.FieldCleared(note.FieldCreatedBy) { + fields = append(fields, note.FieldCreatedBy) + } + if m.FieldCleared(note.FieldUpdatedBy) { + fields = append(fields, note.FieldUpdatedBy) + } + if m.FieldCleared(note.FieldDeletedAt) { + fields = append(fields, note.FieldDeletedAt) + } + if m.FieldCleared(note.FieldDeletedBy) { + fields = append(fields, note.FieldDeletedBy) + } + if m.FieldCleared(note.FieldTags) { + fields = append(fields, note.FieldTags) + } + if m.FieldCleared(note.FieldOwnerID) { + fields = append(fields, note.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *NoteMutation) 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 *NoteMutation) ClearField(name string) error { + switch name { + case note.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case note.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case note.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case note.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case note.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case note.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case note.FieldTags: + m.ClearTags() + return nil + case note.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown Note 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 *NoteMutation) ResetField(name string) error { + switch name { + case note.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case note.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case note.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case note.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case note.FieldMappingID: + m.ResetMappingID() + return nil + case note.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case note.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case note.FieldTags: + m.ResetTags() + return nil + case note.FieldOwnerID: + m.ResetOwnerID() + return nil + case note.FieldText: + m.ResetText() + return nil + } + return fmt.Errorf("unknown Note field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *NoteMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.owner != nil { + edges = append(edges, note.EdgeOwner) + } + if m.entity != nil { + edges = append(edges, note.EdgeEntity) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *NoteMutation) AddedIDs(name string) []ent.Value { + switch name { + case note.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case note.EdgeEntity: + if id := m.entity; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *NoteMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *NoteMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *NoteMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedowner { + edges = append(edges, note.EdgeOwner) + } + if m.clearedentity { + edges = append(edges, note.EdgeEntity) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *NoteMutation) EdgeCleared(name string) bool { + switch name { + case note.EdgeOwner: + return m.clearedowner + case note.EdgeEntity: + return m.clearedentity + } + 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 *NoteMutation) ClearEdge(name string) error { + switch name { + case note.EdgeOwner: + m.ClearOwner() + return nil + case note.EdgeEntity: + m.ClearEntity() + return nil + } + return fmt.Errorf("unknown Note 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 *NoteMutation) ResetEdge(name string) error { + switch name { + case note.EdgeOwner: + m.ResetOwner() + return nil + case note.EdgeEntity: + m.ResetEntity() + return nil + } + return fmt.Errorf("unknown Note edge %s", name) +} + +// NoteHistoryMutation represents an operation that mutates the NoteHistory nodes in the graph. +type NoteHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + owner_id *string + text *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*NoteHistory, error) + predicates []predicate.NoteHistory +} + +var _ ent.Mutation = (*NoteHistoryMutation)(nil) + +// notehistoryOption allows management of the mutation configuration using functional options. +type notehistoryOption func(*NoteHistoryMutation) + +// newNoteHistoryMutation creates new mutation for the NoteHistory entity. +func newNoteHistoryMutation(c config, op Op, opts ...notehistoryOption) *NoteHistoryMutation { + m := &NoteHistoryMutation{ + config: c, + op: op, + typ: TypeNoteHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withNoteHistoryID sets the ID field of the mutation. +func withNoteHistoryID(id string) notehistoryOption { + return func(m *NoteHistoryMutation) { + var ( + err error + once sync.Once + value *NoteHistory + ) + m.oldValue = func(ctx context.Context) (*NoteHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().NoteHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withNoteHistory sets the old NoteHistory of the mutation. +func withNoteHistory(node *NoteHistory) notehistoryOption { + return func(m *NoteHistoryMutation) { + m.oldValue = func(context.Context) (*NoteHistory, 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 NoteHistoryMutation) 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 NoteHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of NoteHistory entities. +func (m *NoteHistoryMutation) SetID(id string) { + 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 *NoteHistoryMutation) ID() (id string, 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 *NoteHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().NoteHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *NoteHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *NoteHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *NoteHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *NoteHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *NoteHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *NoteHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[notehistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *NoteHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[notehistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *NoteHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, notehistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *NoteHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *NoteHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *NoteHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *NoteHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *NoteHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *NoteHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[notehistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *NoteHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[notehistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *NoteHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, notehistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *NoteHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *NoteHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *NoteHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[notehistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *NoteHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[notehistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *NoteHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, notehistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *NoteHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *NoteHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *NoteHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[notehistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *NoteHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[notehistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *NoteHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, notehistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *NoteHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *NoteHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *NoteHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[notehistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *NoteHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[notehistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *NoteHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, notehistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *NoteHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *NoteHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *NoteHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *NoteHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *NoteHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *NoteHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[notehistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *NoteHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[notehistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *NoteHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, notehistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *NoteHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *NoteHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *NoteHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[notehistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *NoteHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[notehistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *NoteHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, notehistory.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *NoteHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *NoteHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *NoteHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *NoteHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *NoteHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[notehistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *NoteHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[notehistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *NoteHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, notehistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *NoteHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *NoteHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *NoteHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[notehistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *NoteHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[notehistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *NoteHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, notehistory.FieldOwnerID) +} + +// SetText sets the "text" field. +func (m *NoteHistoryMutation) SetText(s string) { + m.text = &s +} + +// Text returns the value of the "text" field in the mutation. +func (m *NoteHistoryMutation) Text() (r string, exists bool) { + v := m.text + if v == nil { + return + } + return *v, true +} + +// OldText returns the old "text" field's value of the NoteHistory entity. +// If the NoteHistory 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 *NoteHistoryMutation) OldText(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldText is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldText: %w", err) + } + return oldValue.Text, nil +} + +// ResetText resets all changes to the "text" field. +func (m *NoteHistoryMutation) ResetText() { + m.text = nil +} + +// Where appends a list predicates to the NoteHistoryMutation builder. +func (m *NoteHistoryMutation) Where(ps ...predicate.NoteHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the NoteHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *NoteHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.NoteHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *NoteHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *NoteHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (NoteHistory). +func (m *NoteHistoryMutation) 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 *NoteHistoryMutation) Fields() []string { + fields := make([]string, 0, 13) + if m.history_time != nil { + fields = append(fields, notehistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, notehistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, notehistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, notehistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, notehistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, notehistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, notehistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, notehistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, notehistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, notehistory.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, notehistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, notehistory.FieldOwnerID) + } + if m.text != nil { + fields = append(fields, notehistory.FieldText) + } + 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 *NoteHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case notehistory.FieldHistoryTime: + return m.HistoryTime() + case notehistory.FieldRef: + return m.Ref() + case notehistory.FieldOperation: + return m.Operation() + case notehistory.FieldCreatedAt: + return m.CreatedAt() + case notehistory.FieldUpdatedAt: + return m.UpdatedAt() + case notehistory.FieldCreatedBy: + return m.CreatedBy() + case notehistory.FieldUpdatedBy: + return m.UpdatedBy() + case notehistory.FieldMappingID: + return m.MappingID() + case notehistory.FieldDeletedAt: + return m.DeletedAt() + case notehistory.FieldDeletedBy: + return m.DeletedBy() + case notehistory.FieldTags: + return m.Tags() + case notehistory.FieldOwnerID: + return m.OwnerID() + case notehistory.FieldText: + return m.Text() + } + 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 *NoteHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case notehistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case notehistory.FieldRef: + return m.OldRef(ctx) + case notehistory.FieldOperation: + return m.OldOperation(ctx) + case notehistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case notehistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case notehistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case notehistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case notehistory.FieldMappingID: + return m.OldMappingID(ctx) + case notehistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case notehistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case notehistory.FieldTags: + return m.OldTags(ctx) + case notehistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case notehistory.FieldText: + return m.OldText(ctx) + } + return nil, fmt.Errorf("unknown NoteHistory 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 *NoteHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case notehistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case notehistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case notehistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case notehistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case notehistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case notehistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case notehistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case notehistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case notehistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case notehistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case notehistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case notehistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case notehistory.FieldText: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetText(v) + return nil + } + return fmt.Errorf("unknown NoteHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *NoteHistoryMutation) 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 *NoteHistoryMutation) 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 *NoteHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown NoteHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *NoteHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(notehistory.FieldRef) { + fields = append(fields, notehistory.FieldRef) + } + if m.FieldCleared(notehistory.FieldCreatedAt) { + fields = append(fields, notehistory.FieldCreatedAt) + } + if m.FieldCleared(notehistory.FieldUpdatedAt) { + fields = append(fields, notehistory.FieldUpdatedAt) + } + if m.FieldCleared(notehistory.FieldCreatedBy) { + fields = append(fields, notehistory.FieldCreatedBy) + } + if m.FieldCleared(notehistory.FieldUpdatedBy) { + fields = append(fields, notehistory.FieldUpdatedBy) + } + if m.FieldCleared(notehistory.FieldDeletedAt) { + fields = append(fields, notehistory.FieldDeletedAt) + } + if m.FieldCleared(notehistory.FieldDeletedBy) { + fields = append(fields, notehistory.FieldDeletedBy) + } + if m.FieldCleared(notehistory.FieldTags) { + fields = append(fields, notehistory.FieldTags) + } + if m.FieldCleared(notehistory.FieldOwnerID) { + fields = append(fields, notehistory.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *NoteHistoryMutation) 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 *NoteHistoryMutation) ClearField(name string) error { + switch name { + case notehistory.FieldRef: + m.ClearRef() + return nil + case notehistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case notehistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case notehistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case notehistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case notehistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case notehistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case notehistory.FieldTags: + m.ClearTags() + return nil + case notehistory.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown NoteHistory 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 *NoteHistoryMutation) ResetField(name string) error { + switch name { + case notehistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case notehistory.FieldRef: + m.ResetRef() + return nil + case notehistory.FieldOperation: + m.ResetOperation() + return nil + case notehistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case notehistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case notehistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case notehistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case notehistory.FieldMappingID: + m.ResetMappingID() + return nil + case notehistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case notehistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case notehistory.FieldTags: + m.ResetTags() + return nil + case notehistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case notehistory.FieldText: + m.ResetText() + return nil + } + return fmt.Errorf("unknown NoteHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *NoteHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *NoteHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *NoteHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *NoteHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *NoteHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *NoteHistoryMutation) EdgeCleared(name string) bool { + 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 *NoteHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown NoteHistory 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 *NoteHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown NoteHistory edge %s", name) +} + +// OauthProviderMutation represents an operation that mutates the OauthProvider nodes in the graph. +type OauthProviderMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + name *string + client_id *string + client_secret *string + redirect_url *string + scopes *string + auth_url *string + token_url *string + auth_style *customtypes.Uint8 + addauth_style *customtypes.Uint8 + info_url *string + clearedFields map[string]struct{} + owner *string + clearedowner bool + done bool + oldValue func(context.Context) (*OauthProvider, error) + predicates []predicate.OauthProvider +} + +var _ ent.Mutation = (*OauthProviderMutation)(nil) + +// oauthproviderOption allows management of the mutation configuration using functional options. +type oauthproviderOption func(*OauthProviderMutation) + +// newOauthProviderMutation creates new mutation for the OauthProvider entity. +func newOauthProviderMutation(c config, op Op, opts ...oauthproviderOption) *OauthProviderMutation { + m := &OauthProviderMutation{ + config: c, + op: op, + typ: TypeOauthProvider, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOauthProviderID sets the ID field of the mutation. +func withOauthProviderID(id string) oauthproviderOption { + return func(m *OauthProviderMutation) { + var ( + err error + once sync.Once + value *OauthProvider + ) + m.oldValue = func(ctx context.Context) (*OauthProvider, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OauthProvider.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOauthProvider sets the old OauthProvider of the mutation. +func withOauthProvider(node *OauthProvider) oauthproviderOption { + return func(m *OauthProviderMutation) { + m.oldValue = func(context.Context) (*OauthProvider, 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 OauthProviderMutation) 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 OauthProviderMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OauthProvider entities. +func (m *OauthProviderMutation) SetID(id string) { + 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 *OauthProviderMutation) ID() (id string, 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 *OauthProviderMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OauthProvider.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *OauthProviderMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OauthProviderMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OauthProviderMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[oauthprovider.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OauthProviderMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OauthProviderMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, oauthprovider.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OauthProviderMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OauthProviderMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OauthProviderMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[oauthprovider.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OauthProviderMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OauthProviderMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, oauthprovider.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OauthProviderMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OauthProviderMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OauthProviderMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[oauthprovider.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OauthProviderMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OauthProviderMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, oauthprovider.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OauthProviderMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OauthProviderMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OauthProviderMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[oauthprovider.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OauthProviderMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OauthProviderMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, oauthprovider.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OauthProviderMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OauthProviderMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OauthProviderMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *OauthProviderMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *OauthProviderMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *OauthProviderMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *OauthProviderMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *OauthProviderMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[oauthprovider.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *OauthProviderMutation) TagsCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *OauthProviderMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, oauthprovider.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OauthProviderMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OauthProviderMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OauthProviderMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[oauthprovider.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OauthProviderMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OauthProviderMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, oauthprovider.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OauthProviderMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OauthProviderMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OauthProviderMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[oauthprovider.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OauthProviderMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OauthProviderMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, oauthprovider.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *OauthProviderMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *OauthProviderMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *OauthProviderMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[oauthprovider.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *OauthProviderMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[oauthprovider.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *OauthProviderMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, oauthprovider.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *OauthProviderMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *OauthProviderMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *OauthProviderMutation) ResetName() { + m.name = nil +} + +// SetClientID sets the "client_id" field. +func (m *OauthProviderMutation) SetClientID(s string) { + m.client_id = &s +} + +// ClientID returns the value of the "client_id" field in the mutation. +func (m *OauthProviderMutation) ClientID() (r string, exists bool) { + v := m.client_id + if v == nil { + return + } + return *v, true +} + +// OldClientID returns the old "client_id" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldClientID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClientID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClientID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClientID: %w", err) + } + return oldValue.ClientID, nil +} + +// ResetClientID resets all changes to the "client_id" field. +func (m *OauthProviderMutation) ResetClientID() { + m.client_id = nil +} + +// SetClientSecret sets the "client_secret" field. +func (m *OauthProviderMutation) SetClientSecret(s string) { + m.client_secret = &s +} + +// ClientSecret returns the value of the "client_secret" field in the mutation. +func (m *OauthProviderMutation) ClientSecret() (r string, exists bool) { + v := m.client_secret + if v == nil { + return + } + return *v, true +} + +// OldClientSecret returns the old "client_secret" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldClientSecret(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClientSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClientSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClientSecret: %w", err) + } + return oldValue.ClientSecret, nil +} + +// ResetClientSecret resets all changes to the "client_secret" field. +func (m *OauthProviderMutation) ResetClientSecret() { + m.client_secret = nil +} + +// SetRedirectURL sets the "redirect_url" field. +func (m *OauthProviderMutation) SetRedirectURL(s string) { + m.redirect_url = &s +} + +// RedirectURL returns the value of the "redirect_url" field in the mutation. +func (m *OauthProviderMutation) RedirectURL() (r string, exists bool) { + v := m.redirect_url + if v == nil { + return + } + return *v, true +} + +// OldRedirectURL returns the old "redirect_url" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldRedirectURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRedirectURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRedirectURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRedirectURL: %w", err) + } + return oldValue.RedirectURL, nil +} + +// ResetRedirectURL resets all changes to the "redirect_url" field. +func (m *OauthProviderMutation) ResetRedirectURL() { + m.redirect_url = nil +} + +// SetScopes sets the "scopes" field. +func (m *OauthProviderMutation) SetScopes(s string) { + m.scopes = &s +} + +// Scopes returns the value of the "scopes" field in the mutation. +func (m *OauthProviderMutation) Scopes() (r string, exists bool) { + v := m.scopes + if v == nil { + return + } + return *v, true +} + +// OldScopes returns the old "scopes" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldScopes(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldScopes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldScopes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldScopes: %w", err) + } + return oldValue.Scopes, nil +} + +// ResetScopes resets all changes to the "scopes" field. +func (m *OauthProviderMutation) ResetScopes() { + m.scopes = nil +} + +// SetAuthURL sets the "auth_url" field. +func (m *OauthProviderMutation) SetAuthURL(s string) { + m.auth_url = &s +} + +// AuthURL returns the value of the "auth_url" field in the mutation. +func (m *OauthProviderMutation) AuthURL() (r string, exists bool) { + v := m.auth_url + if v == nil { + return + } + return *v, true +} + +// OldAuthURL returns the old "auth_url" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldAuthURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthURL: %w", err) + } + return oldValue.AuthURL, nil +} + +// ResetAuthURL resets all changes to the "auth_url" field. +func (m *OauthProviderMutation) ResetAuthURL() { + m.auth_url = nil +} + +// SetTokenURL sets the "token_url" field. +func (m *OauthProviderMutation) SetTokenURL(s string) { + m.token_url = &s +} + +// TokenURL returns the value of the "token_url" field in the mutation. +func (m *OauthProviderMutation) TokenURL() (r string, exists bool) { + v := m.token_url + if v == nil { + return + } + return *v, true +} + +// OldTokenURL returns the old "token_url" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldTokenURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTokenURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTokenURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTokenURL: %w", err) + } + return oldValue.TokenURL, nil +} + +// ResetTokenURL resets all changes to the "token_url" field. +func (m *OauthProviderMutation) ResetTokenURL() { + m.token_url = nil +} + +// SetAuthStyle sets the "auth_style" field. +func (m *OauthProviderMutation) SetAuthStyle(c customtypes.Uint8) { + m.auth_style = &c + m.addauth_style = nil +} + +// AuthStyle returns the value of the "auth_style" field in the mutation. +func (m *OauthProviderMutation) AuthStyle() (r customtypes.Uint8, exists bool) { + v := m.auth_style + if v == nil { + return + } + return *v, true +} + +// OldAuthStyle returns the old "auth_style" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldAuthStyle(ctx context.Context) (v customtypes.Uint8, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthStyle is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthStyle requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthStyle: %w", err) + } + return oldValue.AuthStyle, nil +} + +// AddAuthStyle adds c to the "auth_style" field. +func (m *OauthProviderMutation) AddAuthStyle(c customtypes.Uint8) { + if m.addauth_style != nil { + *m.addauth_style += c + } else { + m.addauth_style = &c + } +} + +// AddedAuthStyle returns the value that was added to the "auth_style" field in this mutation. +func (m *OauthProviderMutation) AddedAuthStyle() (r customtypes.Uint8, exists bool) { + v := m.addauth_style + if v == nil { + return + } + return *v, true +} + +// ResetAuthStyle resets all changes to the "auth_style" field. +func (m *OauthProviderMutation) ResetAuthStyle() { + m.auth_style = nil + m.addauth_style = nil +} + +// SetInfoURL sets the "info_url" field. +func (m *OauthProviderMutation) SetInfoURL(s string) { + m.info_url = &s +} + +// InfoURL returns the value of the "info_url" field in the mutation. +func (m *OauthProviderMutation) InfoURL() (r string, exists bool) { + v := m.info_url + if v == nil { + return + } + return *v, true +} + +// OldInfoURL returns the old "info_url" field's value of the OauthProvider entity. +// If the OauthProvider 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 *OauthProviderMutation) OldInfoURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldInfoURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldInfoURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInfoURL: %w", err) + } + return oldValue.InfoURL, nil +} + +// ResetInfoURL resets all changes to the "info_url" field. +func (m *OauthProviderMutation) ResetInfoURL() { + m.info_url = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *OauthProviderMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[oauthprovider.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *OauthProviderMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *OauthProviderMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *OauthProviderMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// Where appends a list predicates to the OauthProviderMutation builder. +func (m *OauthProviderMutation) Where(ps ...predicate.OauthProvider) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OauthProviderMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OauthProviderMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OauthProvider, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OauthProviderMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OauthProviderMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OauthProvider). +func (m *OauthProviderMutation) 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 *OauthProviderMutation) Fields() []string { + fields := make([]string, 0, 18) + if m.created_at != nil { + fields = append(fields, oauthprovider.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, oauthprovider.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, oauthprovider.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, oauthprovider.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, oauthprovider.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, oauthprovider.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, oauthprovider.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, oauthprovider.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, oauthprovider.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, oauthprovider.FieldName) + } + if m.client_id != nil { + fields = append(fields, oauthprovider.FieldClientID) + } + if m.client_secret != nil { + fields = append(fields, oauthprovider.FieldClientSecret) + } + if m.redirect_url != nil { + fields = append(fields, oauthprovider.FieldRedirectURL) + } + if m.scopes != nil { + fields = append(fields, oauthprovider.FieldScopes) + } + if m.auth_url != nil { + fields = append(fields, oauthprovider.FieldAuthURL) + } + if m.token_url != nil { + fields = append(fields, oauthprovider.FieldTokenURL) + } + if m.auth_style != nil { + fields = append(fields, oauthprovider.FieldAuthStyle) + } + if m.info_url != nil { + fields = append(fields, oauthprovider.FieldInfoURL) + } + 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 *OauthProviderMutation) Field(name string) (ent.Value, bool) { + switch name { + case oauthprovider.FieldCreatedAt: + return m.CreatedAt() + case oauthprovider.FieldUpdatedAt: + return m.UpdatedAt() + case oauthprovider.FieldCreatedBy: + return m.CreatedBy() + case oauthprovider.FieldUpdatedBy: + return m.UpdatedBy() + case oauthprovider.FieldMappingID: + return m.MappingID() + case oauthprovider.FieldTags: + return m.Tags() + case oauthprovider.FieldDeletedAt: + return m.DeletedAt() + case oauthprovider.FieldDeletedBy: + return m.DeletedBy() + case oauthprovider.FieldOwnerID: + return m.OwnerID() + case oauthprovider.FieldName: + return m.Name() + case oauthprovider.FieldClientID: + return m.ClientID() + case oauthprovider.FieldClientSecret: + return m.ClientSecret() + case oauthprovider.FieldRedirectURL: + return m.RedirectURL() + case oauthprovider.FieldScopes: + return m.Scopes() + case oauthprovider.FieldAuthURL: + return m.AuthURL() + case oauthprovider.FieldTokenURL: + return m.TokenURL() + case oauthprovider.FieldAuthStyle: + return m.AuthStyle() + case oauthprovider.FieldInfoURL: + return m.InfoURL() + } + 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 *OauthProviderMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case oauthprovider.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case oauthprovider.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case oauthprovider.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case oauthprovider.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case oauthprovider.FieldMappingID: + return m.OldMappingID(ctx) + case oauthprovider.FieldTags: + return m.OldTags(ctx) + case oauthprovider.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case oauthprovider.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case oauthprovider.FieldOwnerID: + return m.OldOwnerID(ctx) + case oauthprovider.FieldName: + return m.OldName(ctx) + case oauthprovider.FieldClientID: + return m.OldClientID(ctx) + case oauthprovider.FieldClientSecret: + return m.OldClientSecret(ctx) + case oauthprovider.FieldRedirectURL: + return m.OldRedirectURL(ctx) + case oauthprovider.FieldScopes: + return m.OldScopes(ctx) + case oauthprovider.FieldAuthURL: + return m.OldAuthURL(ctx) + case oauthprovider.FieldTokenURL: + return m.OldTokenURL(ctx) + case oauthprovider.FieldAuthStyle: + return m.OldAuthStyle(ctx) + case oauthprovider.FieldInfoURL: + return m.OldInfoURL(ctx) + } + return nil, fmt.Errorf("unknown OauthProvider 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 *OauthProviderMutation) SetField(name string, value ent.Value) error { + switch name { + case oauthprovider.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case oauthprovider.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case oauthprovider.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case oauthprovider.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case oauthprovider.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case oauthprovider.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case oauthprovider.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case oauthprovider.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case oauthprovider.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case oauthprovider.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case oauthprovider.FieldClientID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClientID(v) + return nil + case oauthprovider.FieldClientSecret: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClientSecret(v) + return nil + case oauthprovider.FieldRedirectURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRedirectURL(v) + return nil + case oauthprovider.FieldScopes: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetScopes(v) + return nil + case oauthprovider.FieldAuthURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthURL(v) + return nil + case oauthprovider.FieldTokenURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTokenURL(v) + return nil + case oauthprovider.FieldAuthStyle: + v, ok := value.(customtypes.Uint8) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthStyle(v) + return nil + case oauthprovider.FieldInfoURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetInfoURL(v) + return nil + } + return fmt.Errorf("unknown OauthProvider field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OauthProviderMutation) AddedFields() []string { + var fields []string + if m.addauth_style != nil { + fields = append(fields, oauthprovider.FieldAuthStyle) + } + return fields +} + +// 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 *OauthProviderMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case oauthprovider.FieldAuthStyle: + return m.AddedAuthStyle() + } + 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 *OauthProviderMutation) AddField(name string, value ent.Value) error { + switch name { + case oauthprovider.FieldAuthStyle: + v, ok := value.(customtypes.Uint8) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddAuthStyle(v) + return nil + } + return fmt.Errorf("unknown OauthProvider numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OauthProviderMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(oauthprovider.FieldCreatedAt) { + fields = append(fields, oauthprovider.FieldCreatedAt) + } + if m.FieldCleared(oauthprovider.FieldUpdatedAt) { + fields = append(fields, oauthprovider.FieldUpdatedAt) + } + if m.FieldCleared(oauthprovider.FieldCreatedBy) { + fields = append(fields, oauthprovider.FieldCreatedBy) + } + if m.FieldCleared(oauthprovider.FieldUpdatedBy) { + fields = append(fields, oauthprovider.FieldUpdatedBy) + } + if m.FieldCleared(oauthprovider.FieldTags) { + fields = append(fields, oauthprovider.FieldTags) + } + if m.FieldCleared(oauthprovider.FieldDeletedAt) { + fields = append(fields, oauthprovider.FieldDeletedAt) + } + if m.FieldCleared(oauthprovider.FieldDeletedBy) { + fields = append(fields, oauthprovider.FieldDeletedBy) + } + if m.FieldCleared(oauthprovider.FieldOwnerID) { + fields = append(fields, oauthprovider.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OauthProviderMutation) 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 *OauthProviderMutation) ClearField(name string) error { + switch name { + case oauthprovider.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case oauthprovider.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case oauthprovider.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case oauthprovider.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case oauthprovider.FieldTags: + m.ClearTags() + return nil + case oauthprovider.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case oauthprovider.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case oauthprovider.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown OauthProvider 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 *OauthProviderMutation) ResetField(name string) error { + switch name { + case oauthprovider.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case oauthprovider.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case oauthprovider.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case oauthprovider.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case oauthprovider.FieldMappingID: + m.ResetMappingID() + return nil + case oauthprovider.FieldTags: + m.ResetTags() + return nil + case oauthprovider.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case oauthprovider.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case oauthprovider.FieldOwnerID: + m.ResetOwnerID() + return nil + case oauthprovider.FieldName: + m.ResetName() + return nil + case oauthprovider.FieldClientID: + m.ResetClientID() + return nil + case oauthprovider.FieldClientSecret: + m.ResetClientSecret() + return nil + case oauthprovider.FieldRedirectURL: + m.ResetRedirectURL() + return nil + case oauthprovider.FieldScopes: + m.ResetScopes() + return nil + case oauthprovider.FieldAuthURL: + m.ResetAuthURL() + return nil + case oauthprovider.FieldTokenURL: + m.ResetTokenURL() + return nil + case oauthprovider.FieldAuthStyle: + m.ResetAuthStyle() + return nil + case oauthprovider.FieldInfoURL: + m.ResetInfoURL() + return nil + } + return fmt.Errorf("unknown OauthProvider field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OauthProviderMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.owner != nil { + edges = append(edges, oauthprovider.EdgeOwner) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OauthProviderMutation) AddedIDs(name string) []ent.Value { + switch name { + case oauthprovider.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OauthProviderMutation) 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 *OauthProviderMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OauthProviderMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedowner { + edges = append(edges, oauthprovider.EdgeOwner) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OauthProviderMutation) EdgeCleared(name string) bool { + switch name { + case oauthprovider.EdgeOwner: + return m.clearedowner + } + 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 *OauthProviderMutation) ClearEdge(name string) error { + switch name { + case oauthprovider.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown OauthProvider 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 *OauthProviderMutation) ResetEdge(name string) error { + switch name { + case oauthprovider.EdgeOwner: + m.ResetOwner() + return nil + } + return fmt.Errorf("unknown OauthProvider edge %s", name) +} + +// OauthProviderHistoryMutation represents an operation that mutates the OauthProviderHistory nodes in the graph. +type OauthProviderHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + owner_id *string + name *string + client_id *string + client_secret *string + redirect_url *string + scopes *string + auth_url *string + token_url *string + auth_style *customtypes.Uint8 + addauth_style *customtypes.Uint8 + info_url *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*OauthProviderHistory, error) + predicates []predicate.OauthProviderHistory +} + +var _ ent.Mutation = (*OauthProviderHistoryMutation)(nil) + +// oauthproviderhistoryOption allows management of the mutation configuration using functional options. +type oauthproviderhistoryOption func(*OauthProviderHistoryMutation) + +// newOauthProviderHistoryMutation creates new mutation for the OauthProviderHistory entity. +func newOauthProviderHistoryMutation(c config, op Op, opts ...oauthproviderhistoryOption) *OauthProviderHistoryMutation { + m := &OauthProviderHistoryMutation{ + config: c, + op: op, + typ: TypeOauthProviderHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOauthProviderHistoryID sets the ID field of the mutation. +func withOauthProviderHistoryID(id string) oauthproviderhistoryOption { + return func(m *OauthProviderHistoryMutation) { + var ( + err error + once sync.Once + value *OauthProviderHistory + ) + m.oldValue = func(ctx context.Context) (*OauthProviderHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OauthProviderHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOauthProviderHistory sets the old OauthProviderHistory of the mutation. +func withOauthProviderHistory(node *OauthProviderHistory) oauthproviderhistoryOption { + return func(m *OauthProviderHistoryMutation) { + m.oldValue = func(context.Context) (*OauthProviderHistory, 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 OauthProviderHistoryMutation) 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 OauthProviderHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OauthProviderHistory entities. +func (m *OauthProviderHistoryMutation) SetID(id string) { + 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 *OauthProviderHistoryMutation) ID() (id string, 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 *OauthProviderHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OauthProviderHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *OauthProviderHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *OauthProviderHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *OauthProviderHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *OauthProviderHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *OauthProviderHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *OauthProviderHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[oauthproviderhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *OauthProviderHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, oauthproviderhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *OauthProviderHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *OauthProviderHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *OauthProviderHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *OauthProviderHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OauthProviderHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OauthProviderHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[oauthproviderhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OauthProviderHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, oauthproviderhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OauthProviderHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OauthProviderHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OauthProviderHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[oauthproviderhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OauthProviderHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, oauthproviderhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OauthProviderHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OauthProviderHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OauthProviderHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[oauthproviderhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OauthProviderHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, oauthproviderhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OauthProviderHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OauthProviderHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OauthProviderHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[oauthproviderhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OauthProviderHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, oauthproviderhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OauthProviderHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OauthProviderHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OauthProviderHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *OauthProviderHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *OauthProviderHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *OauthProviderHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *OauthProviderHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *OauthProviderHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[oauthproviderhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *OauthProviderHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, oauthproviderhistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OauthProviderHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OauthProviderHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OauthProviderHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[oauthproviderhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OauthProviderHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, oauthproviderhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OauthProviderHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OauthProviderHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OauthProviderHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[oauthproviderhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OauthProviderHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, oauthproviderhistory.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *OauthProviderHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *OauthProviderHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *OauthProviderHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[oauthproviderhistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *OauthProviderHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[oauthproviderhistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *OauthProviderHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, oauthproviderhistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *OauthProviderHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *OauthProviderHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *OauthProviderHistoryMutation) ResetName() { + m.name = nil +} + +// SetClientID sets the "client_id" field. +func (m *OauthProviderHistoryMutation) SetClientID(s string) { + m.client_id = &s +} + +// ClientID returns the value of the "client_id" field in the mutation. +func (m *OauthProviderHistoryMutation) ClientID() (r string, exists bool) { + v := m.client_id + if v == nil { + return + } + return *v, true +} + +// OldClientID returns the old "client_id" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldClientID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClientID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClientID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClientID: %w", err) + } + return oldValue.ClientID, nil +} + +// ResetClientID resets all changes to the "client_id" field. +func (m *OauthProviderHistoryMutation) ResetClientID() { + m.client_id = nil +} + +// SetClientSecret sets the "client_secret" field. +func (m *OauthProviderHistoryMutation) SetClientSecret(s string) { + m.client_secret = &s +} + +// ClientSecret returns the value of the "client_secret" field in the mutation. +func (m *OauthProviderHistoryMutation) ClientSecret() (r string, exists bool) { + v := m.client_secret + if v == nil { + return + } + return *v, true +} + +// OldClientSecret returns the old "client_secret" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldClientSecret(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClientSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClientSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClientSecret: %w", err) + } + return oldValue.ClientSecret, nil +} + +// ResetClientSecret resets all changes to the "client_secret" field. +func (m *OauthProviderHistoryMutation) ResetClientSecret() { + m.client_secret = nil +} + +// SetRedirectURL sets the "redirect_url" field. +func (m *OauthProviderHistoryMutation) SetRedirectURL(s string) { + m.redirect_url = &s +} + +// RedirectURL returns the value of the "redirect_url" field in the mutation. +func (m *OauthProviderHistoryMutation) RedirectURL() (r string, exists bool) { + v := m.redirect_url + if v == nil { + return + } + return *v, true +} + +// OldRedirectURL returns the old "redirect_url" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldRedirectURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRedirectURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRedirectURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRedirectURL: %w", err) + } + return oldValue.RedirectURL, nil +} + +// ResetRedirectURL resets all changes to the "redirect_url" field. +func (m *OauthProviderHistoryMutation) ResetRedirectURL() { + m.redirect_url = nil +} + +// SetScopes sets the "scopes" field. +func (m *OauthProviderHistoryMutation) SetScopes(s string) { + m.scopes = &s +} + +// Scopes returns the value of the "scopes" field in the mutation. +func (m *OauthProviderHistoryMutation) Scopes() (r string, exists bool) { + v := m.scopes + if v == nil { + return + } + return *v, true +} + +// OldScopes returns the old "scopes" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldScopes(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldScopes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldScopes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldScopes: %w", err) + } + return oldValue.Scopes, nil +} + +// ResetScopes resets all changes to the "scopes" field. +func (m *OauthProviderHistoryMutation) ResetScopes() { + m.scopes = nil +} + +// SetAuthURL sets the "auth_url" field. +func (m *OauthProviderHistoryMutation) SetAuthURL(s string) { + m.auth_url = &s +} + +// AuthURL returns the value of the "auth_url" field in the mutation. +func (m *OauthProviderHistoryMutation) AuthURL() (r string, exists bool) { + v := m.auth_url + if v == nil { + return + } + return *v, true +} + +// OldAuthURL returns the old "auth_url" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldAuthURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthURL: %w", err) + } + return oldValue.AuthURL, nil +} + +// ResetAuthURL resets all changes to the "auth_url" field. +func (m *OauthProviderHistoryMutation) ResetAuthURL() { + m.auth_url = nil +} + +// SetTokenURL sets the "token_url" field. +func (m *OauthProviderHistoryMutation) SetTokenURL(s string) { + m.token_url = &s +} + +// TokenURL returns the value of the "token_url" field in the mutation. +func (m *OauthProviderHistoryMutation) TokenURL() (r string, exists bool) { + v := m.token_url + if v == nil { + return + } + return *v, true +} + +// OldTokenURL returns the old "token_url" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldTokenURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTokenURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTokenURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTokenURL: %w", err) + } + return oldValue.TokenURL, nil +} + +// ResetTokenURL resets all changes to the "token_url" field. +func (m *OauthProviderHistoryMutation) ResetTokenURL() { + m.token_url = nil +} + +// SetAuthStyle sets the "auth_style" field. +func (m *OauthProviderHistoryMutation) SetAuthStyle(c customtypes.Uint8) { + m.auth_style = &c + m.addauth_style = nil +} + +// AuthStyle returns the value of the "auth_style" field in the mutation. +func (m *OauthProviderHistoryMutation) AuthStyle() (r customtypes.Uint8, exists bool) { + v := m.auth_style + if v == nil { + return + } + return *v, true +} + +// OldAuthStyle returns the old "auth_style" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldAuthStyle(ctx context.Context) (v customtypes.Uint8, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthStyle is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthStyle requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthStyle: %w", err) + } + return oldValue.AuthStyle, nil +} + +// AddAuthStyle adds c to the "auth_style" field. +func (m *OauthProviderHistoryMutation) AddAuthStyle(c customtypes.Uint8) { + if m.addauth_style != nil { + *m.addauth_style += c + } else { + m.addauth_style = &c + } +} + +// AddedAuthStyle returns the value that was added to the "auth_style" field in this mutation. +func (m *OauthProviderHistoryMutation) AddedAuthStyle() (r customtypes.Uint8, exists bool) { + v := m.addauth_style + if v == nil { + return + } + return *v, true +} + +// ResetAuthStyle resets all changes to the "auth_style" field. +func (m *OauthProviderHistoryMutation) ResetAuthStyle() { + m.auth_style = nil + m.addauth_style = nil +} + +// SetInfoURL sets the "info_url" field. +func (m *OauthProviderHistoryMutation) SetInfoURL(s string) { + m.info_url = &s +} + +// InfoURL returns the value of the "info_url" field in the mutation. +func (m *OauthProviderHistoryMutation) InfoURL() (r string, exists bool) { + v := m.info_url + if v == nil { + return + } + return *v, true +} + +// OldInfoURL returns the old "info_url" field's value of the OauthProviderHistory entity. +// If the OauthProviderHistory 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 *OauthProviderHistoryMutation) OldInfoURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldInfoURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldInfoURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldInfoURL: %w", err) + } + return oldValue.InfoURL, nil +} + +// ResetInfoURL resets all changes to the "info_url" field. +func (m *OauthProviderHistoryMutation) ResetInfoURL() { + m.info_url = nil +} + +// Where appends a list predicates to the OauthProviderHistoryMutation builder. +func (m *OauthProviderHistoryMutation) Where(ps ...predicate.OauthProviderHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OauthProviderHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OauthProviderHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OauthProviderHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OauthProviderHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OauthProviderHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OauthProviderHistory). +func (m *OauthProviderHistoryMutation) 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 *OauthProviderHistoryMutation) Fields() []string { + fields := make([]string, 0, 21) + if m.history_time != nil { + fields = append(fields, oauthproviderhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, oauthproviderhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, oauthproviderhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, oauthproviderhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, oauthproviderhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, oauthproviderhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, oauthproviderhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, oauthproviderhistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, oauthproviderhistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, oauthproviderhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, oauthproviderhistory.FieldDeletedBy) + } + if m.owner_id != nil { + fields = append(fields, oauthproviderhistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, oauthproviderhistory.FieldName) + } + if m.client_id != nil { + fields = append(fields, oauthproviderhistory.FieldClientID) + } + if m.client_secret != nil { + fields = append(fields, oauthproviderhistory.FieldClientSecret) + } + if m.redirect_url != nil { + fields = append(fields, oauthproviderhistory.FieldRedirectURL) + } + if m.scopes != nil { + fields = append(fields, oauthproviderhistory.FieldScopes) + } + if m.auth_url != nil { + fields = append(fields, oauthproviderhistory.FieldAuthURL) + } + if m.token_url != nil { + fields = append(fields, oauthproviderhistory.FieldTokenURL) + } + if m.auth_style != nil { + fields = append(fields, oauthproviderhistory.FieldAuthStyle) + } + if m.info_url != nil { + fields = append(fields, oauthproviderhistory.FieldInfoURL) + } + 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 *OauthProviderHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case oauthproviderhistory.FieldHistoryTime: + return m.HistoryTime() + case oauthproviderhistory.FieldRef: + return m.Ref() + case oauthproviderhistory.FieldOperation: + return m.Operation() + case oauthproviderhistory.FieldCreatedAt: + return m.CreatedAt() + case oauthproviderhistory.FieldUpdatedAt: + return m.UpdatedAt() + case oauthproviderhistory.FieldCreatedBy: + return m.CreatedBy() + case oauthproviderhistory.FieldUpdatedBy: + return m.UpdatedBy() + case oauthproviderhistory.FieldMappingID: + return m.MappingID() + case oauthproviderhistory.FieldTags: + return m.Tags() + case oauthproviderhistory.FieldDeletedAt: + return m.DeletedAt() + case oauthproviderhistory.FieldDeletedBy: + return m.DeletedBy() + case oauthproviderhistory.FieldOwnerID: + return m.OwnerID() + case oauthproviderhistory.FieldName: + return m.Name() + case oauthproviderhistory.FieldClientID: + return m.ClientID() + case oauthproviderhistory.FieldClientSecret: + return m.ClientSecret() + case oauthproviderhistory.FieldRedirectURL: + return m.RedirectURL() + case oauthproviderhistory.FieldScopes: + return m.Scopes() + case oauthproviderhistory.FieldAuthURL: + return m.AuthURL() + case oauthproviderhistory.FieldTokenURL: + return m.TokenURL() + case oauthproviderhistory.FieldAuthStyle: + return m.AuthStyle() + case oauthproviderhistory.FieldInfoURL: + return m.InfoURL() + } + 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 *OauthProviderHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case oauthproviderhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case oauthproviderhistory.FieldRef: + return m.OldRef(ctx) + case oauthproviderhistory.FieldOperation: + return m.OldOperation(ctx) + case oauthproviderhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case oauthproviderhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case oauthproviderhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case oauthproviderhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case oauthproviderhistory.FieldMappingID: + return m.OldMappingID(ctx) + case oauthproviderhistory.FieldTags: + return m.OldTags(ctx) + case oauthproviderhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case oauthproviderhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case oauthproviderhistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case oauthproviderhistory.FieldName: + return m.OldName(ctx) + case oauthproviderhistory.FieldClientID: + return m.OldClientID(ctx) + case oauthproviderhistory.FieldClientSecret: + return m.OldClientSecret(ctx) + case oauthproviderhistory.FieldRedirectURL: + return m.OldRedirectURL(ctx) + case oauthproviderhistory.FieldScopes: + return m.OldScopes(ctx) + case oauthproviderhistory.FieldAuthURL: + return m.OldAuthURL(ctx) + case oauthproviderhistory.FieldTokenURL: + return m.OldTokenURL(ctx) + case oauthproviderhistory.FieldAuthStyle: + return m.OldAuthStyle(ctx) + case oauthproviderhistory.FieldInfoURL: + return m.OldInfoURL(ctx) + } + return nil, fmt.Errorf("unknown OauthProviderHistory 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 *OauthProviderHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case oauthproviderhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case oauthproviderhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case oauthproviderhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case oauthproviderhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case oauthproviderhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case oauthproviderhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case oauthproviderhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case oauthproviderhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case oauthproviderhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case oauthproviderhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case oauthproviderhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case oauthproviderhistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case oauthproviderhistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case oauthproviderhistory.FieldClientID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClientID(v) + return nil + case oauthproviderhistory.FieldClientSecret: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClientSecret(v) + return nil + case oauthproviderhistory.FieldRedirectURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRedirectURL(v) + return nil + case oauthproviderhistory.FieldScopes: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetScopes(v) + return nil + case oauthproviderhistory.FieldAuthURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthURL(v) + return nil + case oauthproviderhistory.FieldTokenURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTokenURL(v) + return nil + case oauthproviderhistory.FieldAuthStyle: + v, ok := value.(customtypes.Uint8) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthStyle(v) + return nil + case oauthproviderhistory.FieldInfoURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetInfoURL(v) + return nil + } + return fmt.Errorf("unknown OauthProviderHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OauthProviderHistoryMutation) AddedFields() []string { + var fields []string + if m.addauth_style != nil { + fields = append(fields, oauthproviderhistory.FieldAuthStyle) + } + return fields +} + +// 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 *OauthProviderHistoryMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case oauthproviderhistory.FieldAuthStyle: + return m.AddedAuthStyle() + } + 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 *OauthProviderHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + case oauthproviderhistory.FieldAuthStyle: + v, ok := value.(customtypes.Uint8) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddAuthStyle(v) + return nil + } + return fmt.Errorf("unknown OauthProviderHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OauthProviderHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(oauthproviderhistory.FieldRef) { + fields = append(fields, oauthproviderhistory.FieldRef) + } + if m.FieldCleared(oauthproviderhistory.FieldCreatedAt) { + fields = append(fields, oauthproviderhistory.FieldCreatedAt) + } + if m.FieldCleared(oauthproviderhistory.FieldUpdatedAt) { + fields = append(fields, oauthproviderhistory.FieldUpdatedAt) + } + if m.FieldCleared(oauthproviderhistory.FieldCreatedBy) { + fields = append(fields, oauthproviderhistory.FieldCreatedBy) + } + if m.FieldCleared(oauthproviderhistory.FieldUpdatedBy) { + fields = append(fields, oauthproviderhistory.FieldUpdatedBy) + } + if m.FieldCleared(oauthproviderhistory.FieldTags) { + fields = append(fields, oauthproviderhistory.FieldTags) + } + if m.FieldCleared(oauthproviderhistory.FieldDeletedAt) { + fields = append(fields, oauthproviderhistory.FieldDeletedAt) + } + if m.FieldCleared(oauthproviderhistory.FieldDeletedBy) { + fields = append(fields, oauthproviderhistory.FieldDeletedBy) + } + if m.FieldCleared(oauthproviderhistory.FieldOwnerID) { + fields = append(fields, oauthproviderhistory.FieldOwnerID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OauthProviderHistoryMutation) 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 *OauthProviderHistoryMutation) ClearField(name string) error { + switch name { + case oauthproviderhistory.FieldRef: + m.ClearRef() + return nil + case oauthproviderhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case oauthproviderhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case oauthproviderhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case oauthproviderhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case oauthproviderhistory.FieldTags: + m.ClearTags() + return nil + case oauthproviderhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case oauthproviderhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case oauthproviderhistory.FieldOwnerID: + m.ClearOwnerID() + return nil + } + return fmt.Errorf("unknown OauthProviderHistory 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 *OauthProviderHistoryMutation) ResetField(name string) error { + switch name { + case oauthproviderhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case oauthproviderhistory.FieldRef: + m.ResetRef() + return nil + case oauthproviderhistory.FieldOperation: + m.ResetOperation() + return nil + case oauthproviderhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case oauthproviderhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case oauthproviderhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case oauthproviderhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case oauthproviderhistory.FieldMappingID: + m.ResetMappingID() + return nil + case oauthproviderhistory.FieldTags: + m.ResetTags() + return nil + case oauthproviderhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case oauthproviderhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case oauthproviderhistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case oauthproviderhistory.FieldName: + m.ResetName() + return nil + case oauthproviderhistory.FieldClientID: + m.ResetClientID() + return nil + case oauthproviderhistory.FieldClientSecret: + m.ResetClientSecret() + return nil + case oauthproviderhistory.FieldRedirectURL: + m.ResetRedirectURL() + return nil + case oauthproviderhistory.FieldScopes: + m.ResetScopes() + return nil + case oauthproviderhistory.FieldAuthURL: + m.ResetAuthURL() + return nil + case oauthproviderhistory.FieldTokenURL: + m.ResetTokenURL() + return nil + case oauthproviderhistory.FieldAuthStyle: + m.ResetAuthStyle() + return nil + case oauthproviderhistory.FieldInfoURL: + m.ResetInfoURL() + return nil + } + return fmt.Errorf("unknown OauthProviderHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OauthProviderHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OauthProviderHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OauthProviderHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OauthProviderHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OauthProviderHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OauthProviderHistoryMutation) EdgeCleared(name string) bool { + 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 *OauthProviderHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown OauthProviderHistory 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 *OauthProviderHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown OauthProviderHistory edge %s", name) +} + +// OhAuthTooTokenMutation represents an operation that mutates the OhAuthTooToken nodes in the graph. +type OhAuthTooTokenMutation struct { + config + op Op + typ string + id *string + mapping_id *string + tags *[]string + appendtags []string + client_id *string + scopes *[]string + appendscopes []string + nonce *string + claims_user_id *string + claims_username *string + claims_email *string + claims_email_verified *bool + claims_groups *[]string + appendclaims_groups []string + claims_preferred_username *string + connector_id *string + connector_data *[]string + appendconnector_data []string + last_used *time.Time + clearedFields map[string]struct{} + integration map[string]struct{} + removedintegration map[string]struct{} + clearedintegration bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*OhAuthTooToken, error) + predicates []predicate.OhAuthTooToken +} + +var _ ent.Mutation = (*OhAuthTooTokenMutation)(nil) + +// ohauthtootokenOption allows management of the mutation configuration using functional options. +type ohauthtootokenOption func(*OhAuthTooTokenMutation) + +// newOhAuthTooTokenMutation creates new mutation for the OhAuthTooToken entity. +func newOhAuthTooTokenMutation(c config, op Op, opts ...ohauthtootokenOption) *OhAuthTooTokenMutation { + m := &OhAuthTooTokenMutation{ + config: c, + op: op, + typ: TypeOhAuthTooToken, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOhAuthTooTokenID sets the ID field of the mutation. +func withOhAuthTooTokenID(id string) ohauthtootokenOption { + return func(m *OhAuthTooTokenMutation) { + var ( + err error + once sync.Once + value *OhAuthTooToken + ) + m.oldValue = func(ctx context.Context) (*OhAuthTooToken, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OhAuthTooToken.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOhAuthTooToken sets the old OhAuthTooToken of the mutation. +func withOhAuthTooToken(node *OhAuthTooToken) ohauthtootokenOption { + return func(m *OhAuthTooTokenMutation) { + m.oldValue = func(context.Context) (*OhAuthTooToken, 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 OhAuthTooTokenMutation) 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 OhAuthTooTokenMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OhAuthTooToken entities. +func (m *OhAuthTooTokenMutation) SetID(id string) { + 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 *OhAuthTooTokenMutation) ID() (id string, 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 *OhAuthTooTokenMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OhAuthTooToken.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetMappingID sets the "mapping_id" field. +func (m *OhAuthTooTokenMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OhAuthTooTokenMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OhAuthTooTokenMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *OhAuthTooTokenMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *OhAuthTooTokenMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *OhAuthTooTokenMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *OhAuthTooTokenMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *OhAuthTooTokenMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[ohauthtootoken.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *OhAuthTooTokenMutation) TagsCleared() bool { + _, ok := m.clearedFields[ohauthtootoken.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *OhAuthTooTokenMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, ohauthtootoken.FieldTags) +} + +// SetClientID sets the "client_id" field. +func (m *OhAuthTooTokenMutation) SetClientID(s string) { + m.client_id = &s +} + +// ClientID returns the value of the "client_id" field in the mutation. +func (m *OhAuthTooTokenMutation) ClientID() (r string, exists bool) { + v := m.client_id + if v == nil { + return + } + return *v, true +} + +// OldClientID returns the old "client_id" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldClientID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClientID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClientID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClientID: %w", err) + } + return oldValue.ClientID, nil +} + +// ResetClientID resets all changes to the "client_id" field. +func (m *OhAuthTooTokenMutation) ResetClientID() { + m.client_id = nil +} + +// SetScopes sets the "scopes" field. +func (m *OhAuthTooTokenMutation) SetScopes(s []string) { + m.scopes = &s + m.appendscopes = nil +} + +// Scopes returns the value of the "scopes" field in the mutation. +func (m *OhAuthTooTokenMutation) Scopes() (r []string, exists bool) { + v := m.scopes + if v == nil { + return + } + return *v, true +} + +// OldScopes returns the old "scopes" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldScopes(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldScopes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldScopes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldScopes: %w", err) + } + return oldValue.Scopes, nil +} + +// AppendScopes adds s to the "scopes" field. +func (m *OhAuthTooTokenMutation) AppendScopes(s []string) { + m.appendscopes = append(m.appendscopes, s...) +} + +// AppendedScopes returns the list of values that were appended to the "scopes" field in this mutation. +func (m *OhAuthTooTokenMutation) AppendedScopes() ([]string, bool) { + if len(m.appendscopes) == 0 { + return nil, false + } + return m.appendscopes, true +} + +// ClearScopes clears the value of the "scopes" field. +func (m *OhAuthTooTokenMutation) ClearScopes() { + m.scopes = nil + m.appendscopes = nil + m.clearedFields[ohauthtootoken.FieldScopes] = struct{}{} +} + +// ScopesCleared returns if the "scopes" field was cleared in this mutation. +func (m *OhAuthTooTokenMutation) ScopesCleared() bool { + _, ok := m.clearedFields[ohauthtootoken.FieldScopes] + return ok +} + +// ResetScopes resets all changes to the "scopes" field. +func (m *OhAuthTooTokenMutation) ResetScopes() { + m.scopes = nil + m.appendscopes = nil + delete(m.clearedFields, ohauthtootoken.FieldScopes) +} + +// SetNonce sets the "nonce" field. +func (m *OhAuthTooTokenMutation) SetNonce(s string) { + m.nonce = &s +} + +// Nonce returns the value of the "nonce" field in the mutation. +func (m *OhAuthTooTokenMutation) Nonce() (r string, exists bool) { + v := m.nonce + if v == nil { + return + } + return *v, true +} + +// OldNonce returns the old "nonce" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldNonce(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldNonce is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldNonce requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldNonce: %w", err) + } + return oldValue.Nonce, nil +} + +// ResetNonce resets all changes to the "nonce" field. +func (m *OhAuthTooTokenMutation) ResetNonce() { + m.nonce = nil +} + +// SetClaimsUserID sets the "claims_user_id" field. +func (m *OhAuthTooTokenMutation) SetClaimsUserID(s string) { + m.claims_user_id = &s +} + +// ClaimsUserID returns the value of the "claims_user_id" field in the mutation. +func (m *OhAuthTooTokenMutation) ClaimsUserID() (r string, exists bool) { + v := m.claims_user_id + if v == nil { + return + } + return *v, true +} + +// OldClaimsUserID returns the old "claims_user_id" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldClaimsUserID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClaimsUserID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClaimsUserID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClaimsUserID: %w", err) + } + return oldValue.ClaimsUserID, nil +} + +// ResetClaimsUserID resets all changes to the "claims_user_id" field. +func (m *OhAuthTooTokenMutation) ResetClaimsUserID() { + m.claims_user_id = nil +} + +// SetClaimsUsername sets the "claims_username" field. +func (m *OhAuthTooTokenMutation) SetClaimsUsername(s string) { + m.claims_username = &s +} + +// ClaimsUsername returns the value of the "claims_username" field in the mutation. +func (m *OhAuthTooTokenMutation) ClaimsUsername() (r string, exists bool) { + v := m.claims_username + if v == nil { + return + } + return *v, true +} + +// OldClaimsUsername returns the old "claims_username" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldClaimsUsername(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClaimsUsername is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClaimsUsername requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClaimsUsername: %w", err) + } + return oldValue.ClaimsUsername, nil +} + +// ResetClaimsUsername resets all changes to the "claims_username" field. +func (m *OhAuthTooTokenMutation) ResetClaimsUsername() { + m.claims_username = nil +} + +// SetClaimsEmail sets the "claims_email" field. +func (m *OhAuthTooTokenMutation) SetClaimsEmail(s string) { + m.claims_email = &s +} + +// ClaimsEmail returns the value of the "claims_email" field in the mutation. +func (m *OhAuthTooTokenMutation) ClaimsEmail() (r string, exists bool) { + v := m.claims_email + if v == nil { + return + } + return *v, true +} + +// OldClaimsEmail returns the old "claims_email" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldClaimsEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClaimsEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClaimsEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClaimsEmail: %w", err) + } + return oldValue.ClaimsEmail, nil +} + +// ResetClaimsEmail resets all changes to the "claims_email" field. +func (m *OhAuthTooTokenMutation) ResetClaimsEmail() { + m.claims_email = nil +} + +// SetClaimsEmailVerified sets the "claims_email_verified" field. +func (m *OhAuthTooTokenMutation) SetClaimsEmailVerified(b bool) { + m.claims_email_verified = &b +} + +// ClaimsEmailVerified returns the value of the "claims_email_verified" field in the mutation. +func (m *OhAuthTooTokenMutation) ClaimsEmailVerified() (r bool, exists bool) { + v := m.claims_email_verified + if v == nil { + return + } + return *v, true +} + +// OldClaimsEmailVerified returns the old "claims_email_verified" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldClaimsEmailVerified(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClaimsEmailVerified is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClaimsEmailVerified requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClaimsEmailVerified: %w", err) + } + return oldValue.ClaimsEmailVerified, nil +} + +// ResetClaimsEmailVerified resets all changes to the "claims_email_verified" field. +func (m *OhAuthTooTokenMutation) ResetClaimsEmailVerified() { + m.claims_email_verified = nil +} + +// SetClaimsGroups sets the "claims_groups" field. +func (m *OhAuthTooTokenMutation) SetClaimsGroups(s []string) { + m.claims_groups = &s + m.appendclaims_groups = nil +} + +// ClaimsGroups returns the value of the "claims_groups" field in the mutation. +func (m *OhAuthTooTokenMutation) ClaimsGroups() (r []string, exists bool) { + v := m.claims_groups + if v == nil { + return + } + return *v, true +} + +// OldClaimsGroups returns the old "claims_groups" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldClaimsGroups(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClaimsGroups is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClaimsGroups requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClaimsGroups: %w", err) + } + return oldValue.ClaimsGroups, nil +} + +// AppendClaimsGroups adds s to the "claims_groups" field. +func (m *OhAuthTooTokenMutation) AppendClaimsGroups(s []string) { + m.appendclaims_groups = append(m.appendclaims_groups, s...) +} + +// AppendedClaimsGroups returns the list of values that were appended to the "claims_groups" field in this mutation. +func (m *OhAuthTooTokenMutation) AppendedClaimsGroups() ([]string, bool) { + if len(m.appendclaims_groups) == 0 { + return nil, false + } + return m.appendclaims_groups, true +} + +// ClearClaimsGroups clears the value of the "claims_groups" field. +func (m *OhAuthTooTokenMutation) ClearClaimsGroups() { + m.claims_groups = nil + m.appendclaims_groups = nil + m.clearedFields[ohauthtootoken.FieldClaimsGroups] = struct{}{} +} + +// ClaimsGroupsCleared returns if the "claims_groups" field was cleared in this mutation. +func (m *OhAuthTooTokenMutation) ClaimsGroupsCleared() bool { + _, ok := m.clearedFields[ohauthtootoken.FieldClaimsGroups] + return ok +} + +// ResetClaimsGroups resets all changes to the "claims_groups" field. +func (m *OhAuthTooTokenMutation) ResetClaimsGroups() { + m.claims_groups = nil + m.appendclaims_groups = nil + delete(m.clearedFields, ohauthtootoken.FieldClaimsGroups) +} + +// SetClaimsPreferredUsername sets the "claims_preferred_username" field. +func (m *OhAuthTooTokenMutation) SetClaimsPreferredUsername(s string) { + m.claims_preferred_username = &s +} + +// ClaimsPreferredUsername returns the value of the "claims_preferred_username" field in the mutation. +func (m *OhAuthTooTokenMutation) ClaimsPreferredUsername() (r string, exists bool) { + v := m.claims_preferred_username + if v == nil { + return + } + return *v, true +} + +// OldClaimsPreferredUsername returns the old "claims_preferred_username" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldClaimsPreferredUsername(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldClaimsPreferredUsername is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldClaimsPreferredUsername requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldClaimsPreferredUsername: %w", err) + } + return oldValue.ClaimsPreferredUsername, nil +} + +// ResetClaimsPreferredUsername resets all changes to the "claims_preferred_username" field. +func (m *OhAuthTooTokenMutation) ResetClaimsPreferredUsername() { + m.claims_preferred_username = nil +} + +// SetConnectorID sets the "connector_id" field. +func (m *OhAuthTooTokenMutation) SetConnectorID(s string) { + m.connector_id = &s +} + +// ConnectorID returns the value of the "connector_id" field in the mutation. +func (m *OhAuthTooTokenMutation) ConnectorID() (r string, exists bool) { + v := m.connector_id + if v == nil { + return + } + return *v, true +} + +// OldConnectorID returns the old "connector_id" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldConnectorID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldConnectorID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldConnectorID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldConnectorID: %w", err) + } + return oldValue.ConnectorID, nil +} + +// ResetConnectorID resets all changes to the "connector_id" field. +func (m *OhAuthTooTokenMutation) ResetConnectorID() { + m.connector_id = nil +} + +// SetConnectorData sets the "connector_data" field. +func (m *OhAuthTooTokenMutation) SetConnectorData(s []string) { + m.connector_data = &s + m.appendconnector_data = nil +} + +// ConnectorData returns the value of the "connector_data" field in the mutation. +func (m *OhAuthTooTokenMutation) ConnectorData() (r []string, exists bool) { + v := m.connector_data + if v == nil { + return + } + return *v, true +} + +// OldConnectorData returns the old "connector_data" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldConnectorData(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldConnectorData is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldConnectorData requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldConnectorData: %w", err) + } + return oldValue.ConnectorData, nil +} + +// AppendConnectorData adds s to the "connector_data" field. +func (m *OhAuthTooTokenMutation) AppendConnectorData(s []string) { + m.appendconnector_data = append(m.appendconnector_data, s...) +} + +// AppendedConnectorData returns the list of values that were appended to the "connector_data" field in this mutation. +func (m *OhAuthTooTokenMutation) AppendedConnectorData() ([]string, bool) { + if len(m.appendconnector_data) == 0 { + return nil, false + } + return m.appendconnector_data, true +} + +// ClearConnectorData clears the value of the "connector_data" field. +func (m *OhAuthTooTokenMutation) ClearConnectorData() { + m.connector_data = nil + m.appendconnector_data = nil + m.clearedFields[ohauthtootoken.FieldConnectorData] = struct{}{} +} + +// ConnectorDataCleared returns if the "connector_data" field was cleared in this mutation. +func (m *OhAuthTooTokenMutation) ConnectorDataCleared() bool { + _, ok := m.clearedFields[ohauthtootoken.FieldConnectorData] + return ok +} + +// ResetConnectorData resets all changes to the "connector_data" field. +func (m *OhAuthTooTokenMutation) ResetConnectorData() { + m.connector_data = nil + m.appendconnector_data = nil + delete(m.clearedFields, ohauthtootoken.FieldConnectorData) +} + +// SetLastUsed sets the "last_used" field. +func (m *OhAuthTooTokenMutation) SetLastUsed(t time.Time) { + m.last_used = &t +} + +// LastUsed returns the value of the "last_used" field in the mutation. +func (m *OhAuthTooTokenMutation) LastUsed() (r time.Time, exists bool) { + v := m.last_used + if v == nil { + return + } + return *v, true +} + +// OldLastUsed returns the old "last_used" field's value of the OhAuthTooToken entity. +// If the OhAuthTooToken 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 *OhAuthTooTokenMutation) OldLastUsed(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastUsed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastUsed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastUsed: %w", err) + } + return oldValue.LastUsed, nil +} + +// ResetLastUsed resets all changes to the "last_used" field. +func (m *OhAuthTooTokenMutation) ResetLastUsed() { + m.last_used = nil +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by ids. +func (m *OhAuthTooTokenMutation) AddIntegrationIDs(ids ...string) { + if m.integration == nil { + m.integration = make(map[string]struct{}) + } + for i := range ids { + m.integration[ids[i]] = struct{}{} + } +} + +// ClearIntegration clears the "integration" edge to the Integration entity. +func (m *OhAuthTooTokenMutation) ClearIntegration() { + m.clearedintegration = true +} + +// IntegrationCleared reports if the "integration" edge to the Integration entity was cleared. +func (m *OhAuthTooTokenMutation) IntegrationCleared() bool { + return m.clearedintegration +} + +// RemoveIntegrationIDs removes the "integration" edge to the Integration entity by IDs. +func (m *OhAuthTooTokenMutation) RemoveIntegrationIDs(ids ...string) { + if m.removedintegration == nil { + m.removedintegration = make(map[string]struct{}) + } + for i := range ids { + delete(m.integration, ids[i]) + m.removedintegration[ids[i]] = struct{}{} + } +} + +// RemovedIntegration returns the removed IDs of the "integration" edge to the Integration entity. +func (m *OhAuthTooTokenMutation) RemovedIntegrationIDs() (ids []string) { + for id := range m.removedintegration { + ids = append(ids, id) + } + return +} + +// IntegrationIDs returns the "integration" edge IDs in the mutation. +func (m *OhAuthTooTokenMutation) IntegrationIDs() (ids []string) { + for id := range m.integration { + ids = append(ids, id) + } + return +} + +// ResetIntegration resets all changes to the "integration" edge. +func (m *OhAuthTooTokenMutation) ResetIntegration() { + m.integration = nil + m.clearedintegration = false + m.removedintegration = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *OhAuthTooTokenMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *OhAuthTooTokenMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *OhAuthTooTokenMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *OhAuthTooTokenMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *OhAuthTooTokenMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *OhAuthTooTokenMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *OhAuthTooTokenMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the OhAuthTooTokenMutation builder. +func (m *OhAuthTooTokenMutation) Where(ps ...predicate.OhAuthTooToken) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OhAuthTooTokenMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OhAuthTooTokenMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OhAuthTooToken, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OhAuthTooTokenMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OhAuthTooTokenMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OhAuthTooToken). +func (m *OhAuthTooTokenMutation) 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 *OhAuthTooTokenMutation) Fields() []string { + fields := make([]string, 0, 14) + if m.mapping_id != nil { + fields = append(fields, ohauthtootoken.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, ohauthtootoken.FieldTags) + } + if m.client_id != nil { + fields = append(fields, ohauthtootoken.FieldClientID) + } + if m.scopes != nil { + fields = append(fields, ohauthtootoken.FieldScopes) + } + if m.nonce != nil { + fields = append(fields, ohauthtootoken.FieldNonce) + } + if m.claims_user_id != nil { + fields = append(fields, ohauthtootoken.FieldClaimsUserID) + } + if m.claims_username != nil { + fields = append(fields, ohauthtootoken.FieldClaimsUsername) + } + if m.claims_email != nil { + fields = append(fields, ohauthtootoken.FieldClaimsEmail) + } + if m.claims_email_verified != nil { + fields = append(fields, ohauthtootoken.FieldClaimsEmailVerified) + } + if m.claims_groups != nil { + fields = append(fields, ohauthtootoken.FieldClaimsGroups) + } + if m.claims_preferred_username != nil { + fields = append(fields, ohauthtootoken.FieldClaimsPreferredUsername) + } + if m.connector_id != nil { + fields = append(fields, ohauthtootoken.FieldConnectorID) + } + if m.connector_data != nil { + fields = append(fields, ohauthtootoken.FieldConnectorData) + } + if m.last_used != nil { + fields = append(fields, ohauthtootoken.FieldLastUsed) + } + 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 *OhAuthTooTokenMutation) Field(name string) (ent.Value, bool) { + switch name { + case ohauthtootoken.FieldMappingID: + return m.MappingID() + case ohauthtootoken.FieldTags: + return m.Tags() + case ohauthtootoken.FieldClientID: + return m.ClientID() + case ohauthtootoken.FieldScopes: + return m.Scopes() + case ohauthtootoken.FieldNonce: + return m.Nonce() + case ohauthtootoken.FieldClaimsUserID: + return m.ClaimsUserID() + case ohauthtootoken.FieldClaimsUsername: + return m.ClaimsUsername() + case ohauthtootoken.FieldClaimsEmail: + return m.ClaimsEmail() + case ohauthtootoken.FieldClaimsEmailVerified: + return m.ClaimsEmailVerified() + case ohauthtootoken.FieldClaimsGroups: + return m.ClaimsGroups() + case ohauthtootoken.FieldClaimsPreferredUsername: + return m.ClaimsPreferredUsername() + case ohauthtootoken.FieldConnectorID: + return m.ConnectorID() + case ohauthtootoken.FieldConnectorData: + return m.ConnectorData() + case ohauthtootoken.FieldLastUsed: + return m.LastUsed() + } + 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 *OhAuthTooTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case ohauthtootoken.FieldMappingID: + return m.OldMappingID(ctx) + case ohauthtootoken.FieldTags: + return m.OldTags(ctx) + case ohauthtootoken.FieldClientID: + return m.OldClientID(ctx) + case ohauthtootoken.FieldScopes: + return m.OldScopes(ctx) + case ohauthtootoken.FieldNonce: + return m.OldNonce(ctx) + case ohauthtootoken.FieldClaimsUserID: + return m.OldClaimsUserID(ctx) + case ohauthtootoken.FieldClaimsUsername: + return m.OldClaimsUsername(ctx) + case ohauthtootoken.FieldClaimsEmail: + return m.OldClaimsEmail(ctx) + case ohauthtootoken.FieldClaimsEmailVerified: + return m.OldClaimsEmailVerified(ctx) + case ohauthtootoken.FieldClaimsGroups: + return m.OldClaimsGroups(ctx) + case ohauthtootoken.FieldClaimsPreferredUsername: + return m.OldClaimsPreferredUsername(ctx) + case ohauthtootoken.FieldConnectorID: + return m.OldConnectorID(ctx) + case ohauthtootoken.FieldConnectorData: + return m.OldConnectorData(ctx) + case ohauthtootoken.FieldLastUsed: + return m.OldLastUsed(ctx) + } + return nil, fmt.Errorf("unknown OhAuthTooToken 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 *OhAuthTooTokenMutation) SetField(name string, value ent.Value) error { + switch name { + case ohauthtootoken.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case ohauthtootoken.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case ohauthtootoken.FieldClientID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClientID(v) + return nil + case ohauthtootoken.FieldScopes: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetScopes(v) + return nil + case ohauthtootoken.FieldNonce: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetNonce(v) + return nil + case ohauthtootoken.FieldClaimsUserID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClaimsUserID(v) + return nil + case ohauthtootoken.FieldClaimsUsername: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClaimsUsername(v) + return nil + case ohauthtootoken.FieldClaimsEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClaimsEmail(v) + return nil + case ohauthtootoken.FieldClaimsEmailVerified: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClaimsEmailVerified(v) + return nil + case ohauthtootoken.FieldClaimsGroups: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClaimsGroups(v) + return nil + case ohauthtootoken.FieldClaimsPreferredUsername: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetClaimsPreferredUsername(v) + return nil + case ohauthtootoken.FieldConnectorID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetConnectorID(v) + return nil + case ohauthtootoken.FieldConnectorData: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetConnectorData(v) + return nil + case ohauthtootoken.FieldLastUsed: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastUsed(v) + return nil + } + return fmt.Errorf("unknown OhAuthTooToken field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OhAuthTooTokenMutation) 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 *OhAuthTooTokenMutation) 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 *OhAuthTooTokenMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown OhAuthTooToken numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OhAuthTooTokenMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(ohauthtootoken.FieldTags) { + fields = append(fields, ohauthtootoken.FieldTags) + } + if m.FieldCleared(ohauthtootoken.FieldScopes) { + fields = append(fields, ohauthtootoken.FieldScopes) + } + if m.FieldCleared(ohauthtootoken.FieldClaimsGroups) { + fields = append(fields, ohauthtootoken.FieldClaimsGroups) + } + if m.FieldCleared(ohauthtootoken.FieldConnectorData) { + fields = append(fields, ohauthtootoken.FieldConnectorData) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OhAuthTooTokenMutation) 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 *OhAuthTooTokenMutation) ClearField(name string) error { + switch name { + case ohauthtootoken.FieldTags: + m.ClearTags() + return nil + case ohauthtootoken.FieldScopes: + m.ClearScopes() + return nil + case ohauthtootoken.FieldClaimsGroups: + m.ClearClaimsGroups() + return nil + case ohauthtootoken.FieldConnectorData: + m.ClearConnectorData() + return nil + } + return fmt.Errorf("unknown OhAuthTooToken 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 *OhAuthTooTokenMutation) ResetField(name string) error { + switch name { + case ohauthtootoken.FieldMappingID: + m.ResetMappingID() + return nil + case ohauthtootoken.FieldTags: + m.ResetTags() + return nil + case ohauthtootoken.FieldClientID: + m.ResetClientID() + return nil + case ohauthtootoken.FieldScopes: + m.ResetScopes() + return nil + case ohauthtootoken.FieldNonce: + m.ResetNonce() + return nil + case ohauthtootoken.FieldClaimsUserID: + m.ResetClaimsUserID() + return nil + case ohauthtootoken.FieldClaimsUsername: + m.ResetClaimsUsername() + return nil + case ohauthtootoken.FieldClaimsEmail: + m.ResetClaimsEmail() + return nil + case ohauthtootoken.FieldClaimsEmailVerified: + m.ResetClaimsEmailVerified() + return nil + case ohauthtootoken.FieldClaimsGroups: + m.ResetClaimsGroups() + return nil + case ohauthtootoken.FieldClaimsPreferredUsername: + m.ResetClaimsPreferredUsername() + return nil + case ohauthtootoken.FieldConnectorID: + m.ResetConnectorID() + return nil + case ohauthtootoken.FieldConnectorData: + m.ResetConnectorData() + return nil + case ohauthtootoken.FieldLastUsed: + m.ResetLastUsed() + return nil + } + return fmt.Errorf("unknown OhAuthTooToken field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OhAuthTooTokenMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.integration != nil { + edges = append(edges, ohauthtootoken.EdgeIntegration) + } + if m.events != nil { + edges = append(edges, ohauthtootoken.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OhAuthTooTokenMutation) AddedIDs(name string) []ent.Value { + switch name { + case ohauthtootoken.EdgeIntegration: + ids := make([]ent.Value, 0, len(m.integration)) + for id := range m.integration { + ids = append(ids, id) + } + return ids + case ohauthtootoken.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OhAuthTooTokenMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedintegration != nil { + edges = append(edges, ohauthtootoken.EdgeIntegration) + } + if m.removedevents != nil { + edges = append(edges, ohauthtootoken.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OhAuthTooTokenMutation) RemovedIDs(name string) []ent.Value { + switch name { + case ohauthtootoken.EdgeIntegration: + ids := make([]ent.Value, 0, len(m.removedintegration)) + for id := range m.removedintegration { + ids = append(ids, id) + } + return ids + case ohauthtootoken.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OhAuthTooTokenMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedintegration { + edges = append(edges, ohauthtootoken.EdgeIntegration) + } + if m.clearedevents { + edges = append(edges, ohauthtootoken.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OhAuthTooTokenMutation) EdgeCleared(name string) bool { + switch name { + case ohauthtootoken.EdgeIntegration: + return m.clearedintegration + case ohauthtootoken.EdgeEvents: + return m.clearedevents + } + 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 *OhAuthTooTokenMutation) ClearEdge(name string) error { + switch name { + } + return fmt.Errorf("unknown OhAuthTooToken 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 *OhAuthTooTokenMutation) ResetEdge(name string) error { + switch name { + case ohauthtootoken.EdgeIntegration: + m.ResetIntegration() + return nil + case ohauthtootoken.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown OhAuthTooToken edge %s", name) +} + +// OrgMembershipMutation represents an operation that mutates the OrgMembership nodes in the graph. +type OrgMembershipMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + role *enums.Role + clearedFields map[string]struct{} + organization *string + clearedorganization bool + user *string + cleareduser bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*OrgMembership, error) + predicates []predicate.OrgMembership +} + +var _ ent.Mutation = (*OrgMembershipMutation)(nil) + +// orgmembershipOption allows management of the mutation configuration using functional options. +type orgmembershipOption func(*OrgMembershipMutation) + +// newOrgMembershipMutation creates new mutation for the OrgMembership entity. +func newOrgMembershipMutation(c config, op Op, opts ...orgmembershipOption) *OrgMembershipMutation { + m := &OrgMembershipMutation{ + config: c, + op: op, + typ: TypeOrgMembership, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOrgMembershipID sets the ID field of the mutation. +func withOrgMembershipID(id string) orgmembershipOption { + return func(m *OrgMembershipMutation) { + var ( + err error + once sync.Once + value *OrgMembership + ) + m.oldValue = func(ctx context.Context) (*OrgMembership, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OrgMembership.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOrgMembership sets the old OrgMembership of the mutation. +func withOrgMembership(node *OrgMembership) orgmembershipOption { + return func(m *OrgMembershipMutation) { + m.oldValue = func(context.Context) (*OrgMembership, 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 OrgMembershipMutation) 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 OrgMembershipMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OrgMembership entities. +func (m *OrgMembershipMutation) SetID(id string) { + 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 *OrgMembershipMutation) ID() (id string, 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 *OrgMembershipMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OrgMembership.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *OrgMembershipMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OrgMembershipMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OrgMembershipMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[orgmembership.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OrgMembershipMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[orgmembership.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OrgMembershipMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, orgmembership.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OrgMembershipMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OrgMembershipMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OrgMembershipMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[orgmembership.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OrgMembershipMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[orgmembership.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OrgMembershipMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, orgmembership.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OrgMembershipMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OrgMembershipMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OrgMembershipMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[orgmembership.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OrgMembershipMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[orgmembership.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OrgMembershipMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, orgmembership.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OrgMembershipMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OrgMembershipMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OrgMembershipMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[orgmembership.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OrgMembershipMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[orgmembership.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OrgMembershipMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, orgmembership.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OrgMembershipMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OrgMembershipMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OrgMembershipMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OrgMembershipMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OrgMembershipMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OrgMembershipMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[orgmembership.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OrgMembershipMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[orgmembership.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OrgMembershipMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, orgmembership.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OrgMembershipMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OrgMembershipMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OrgMembershipMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[orgmembership.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OrgMembershipMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[orgmembership.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OrgMembershipMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, orgmembership.FieldDeletedBy) +} + +// SetRole sets the "role" field. +func (m *OrgMembershipMutation) SetRole(e enums.Role) { + m.role = &e +} + +// Role returns the value of the "role" field in the mutation. +func (m *OrgMembershipMutation) Role() (r enums.Role, exists bool) { + v := m.role + if v == nil { + return + } + return *v, true +} + +// OldRole returns the old "role" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldRole(ctx context.Context) (v enums.Role, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// ResetRole resets all changes to the "role" field. +func (m *OrgMembershipMutation) ResetRole() { + m.role = nil +} + +// SetOrganizationID sets the "organization_id" field. +func (m *OrgMembershipMutation) SetOrganizationID(s string) { + m.organization = &s +} + +// OrganizationID returns the value of the "organization_id" field in the mutation. +func (m *OrgMembershipMutation) OrganizationID() (r string, exists bool) { + v := m.organization + if v == nil { + return + } + return *v, true +} + +// OldOrganizationID returns the old "organization_id" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err) + } + return oldValue.OrganizationID, nil +} + +// ResetOrganizationID resets all changes to the "organization_id" field. +func (m *OrgMembershipMutation) ResetOrganizationID() { + m.organization = nil +} + +// SetUserID sets the "user_id" field. +func (m *OrgMembershipMutation) SetUserID(s string) { + m.user = &s +} + +// UserID returns the value of the "user_id" field in the mutation. +func (m *OrgMembershipMutation) UserID() (r string, exists bool) { + v := m.user + if v == nil { + return + } + return *v, true +} + +// OldUserID returns the old "user_id" field's value of the OrgMembership entity. +// If the OrgMembership 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 *OrgMembershipMutation) OldUserID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserID: %w", err) + } + return oldValue.UserID, nil +} + +// ResetUserID resets all changes to the "user_id" field. +func (m *OrgMembershipMutation) ResetUserID() { + m.user = nil +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (m *OrgMembershipMutation) ClearOrganization() { + m.clearedorganization = true + m.clearedFields[orgmembership.FieldOrganizationID] = struct{}{} +} + +// OrganizationCleared reports if the "organization" edge to the Organization entity was cleared. +func (m *OrgMembershipMutation) OrganizationCleared() bool { + return m.clearedorganization +} + +// OrganizationIDs returns the "organization" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OrganizationID instead. It exists only for internal usage by the builders. +func (m *OrgMembershipMutation) OrganizationIDs() (ids []string) { + if id := m.organization; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOrganization resets all changes to the "organization" edge. +func (m *OrgMembershipMutation) ResetOrganization() { + m.organization = nil + m.clearedorganization = false +} + +// ClearUser clears the "user" edge to the User entity. +func (m *OrgMembershipMutation) ClearUser() { + m.cleareduser = true + m.clearedFields[orgmembership.FieldUserID] = struct{}{} +} + +// UserCleared reports if the "user" edge to the User entity was cleared. +func (m *OrgMembershipMutation) UserCleared() bool { + return m.cleareduser +} + +// UserIDs returns the "user" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// UserID instead. It exists only for internal usage by the builders. +func (m *OrgMembershipMutation) UserIDs() (ids []string) { + if id := m.user; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetUser resets all changes to the "user" edge. +func (m *OrgMembershipMutation) ResetUser() { + m.user = nil + m.cleareduser = false +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *OrgMembershipMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *OrgMembershipMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *OrgMembershipMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *OrgMembershipMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *OrgMembershipMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *OrgMembershipMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *OrgMembershipMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the OrgMembershipMutation builder. +func (m *OrgMembershipMutation) Where(ps ...predicate.OrgMembership) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OrgMembershipMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OrgMembershipMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OrgMembership, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OrgMembershipMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OrgMembershipMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OrgMembership). +func (m *OrgMembershipMutation) 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 *OrgMembershipMutation) Fields() []string { + fields := make([]string, 0, 10) + if m.created_at != nil { + fields = append(fields, orgmembership.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, orgmembership.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, orgmembership.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, orgmembership.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, orgmembership.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, orgmembership.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, orgmembership.FieldDeletedBy) + } + if m.role != nil { + fields = append(fields, orgmembership.FieldRole) + } + if m.organization != nil { + fields = append(fields, orgmembership.FieldOrganizationID) + } + if m.user != nil { + fields = append(fields, orgmembership.FieldUserID) + } + 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 *OrgMembershipMutation) Field(name string) (ent.Value, bool) { + switch name { + case orgmembership.FieldCreatedAt: + return m.CreatedAt() + case orgmembership.FieldUpdatedAt: + return m.UpdatedAt() + case orgmembership.FieldCreatedBy: + return m.CreatedBy() + case orgmembership.FieldUpdatedBy: + return m.UpdatedBy() + case orgmembership.FieldMappingID: + return m.MappingID() + case orgmembership.FieldDeletedAt: + return m.DeletedAt() + case orgmembership.FieldDeletedBy: + return m.DeletedBy() + case orgmembership.FieldRole: + return m.Role() + case orgmembership.FieldOrganizationID: + return m.OrganizationID() + case orgmembership.FieldUserID: + return m.UserID() + } + 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 *OrgMembershipMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case orgmembership.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case orgmembership.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case orgmembership.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case orgmembership.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case orgmembership.FieldMappingID: + return m.OldMappingID(ctx) + case orgmembership.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case orgmembership.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case orgmembership.FieldRole: + return m.OldRole(ctx) + case orgmembership.FieldOrganizationID: + return m.OldOrganizationID(ctx) + case orgmembership.FieldUserID: + return m.OldUserID(ctx) + } + return nil, fmt.Errorf("unknown OrgMembership 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 *OrgMembershipMutation) SetField(name string, value ent.Value) error { + switch name { + case orgmembership.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case orgmembership.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case orgmembership.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case orgmembership.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case orgmembership.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case orgmembership.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case orgmembership.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case orgmembership.FieldRole: + v, ok := value.(enums.Role) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRole(v) + return nil + case orgmembership.FieldOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrganizationID(v) + return nil + case orgmembership.FieldUserID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserID(v) + return nil + } + return fmt.Errorf("unknown OrgMembership field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OrgMembershipMutation) 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 *OrgMembershipMutation) 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 *OrgMembershipMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown OrgMembership numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OrgMembershipMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(orgmembership.FieldCreatedAt) { + fields = append(fields, orgmembership.FieldCreatedAt) + } + if m.FieldCleared(orgmembership.FieldUpdatedAt) { + fields = append(fields, orgmembership.FieldUpdatedAt) + } + if m.FieldCleared(orgmembership.FieldCreatedBy) { + fields = append(fields, orgmembership.FieldCreatedBy) + } + if m.FieldCleared(orgmembership.FieldUpdatedBy) { + fields = append(fields, orgmembership.FieldUpdatedBy) + } + if m.FieldCleared(orgmembership.FieldDeletedAt) { + fields = append(fields, orgmembership.FieldDeletedAt) + } + if m.FieldCleared(orgmembership.FieldDeletedBy) { + fields = append(fields, orgmembership.FieldDeletedBy) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OrgMembershipMutation) 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 *OrgMembershipMutation) ClearField(name string) error { + switch name { + case orgmembership.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case orgmembership.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case orgmembership.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case orgmembership.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case orgmembership.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case orgmembership.FieldDeletedBy: + m.ClearDeletedBy() + return nil + } + return fmt.Errorf("unknown OrgMembership 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 *OrgMembershipMutation) ResetField(name string) error { + switch name { + case orgmembership.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case orgmembership.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case orgmembership.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case orgmembership.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case orgmembership.FieldMappingID: + m.ResetMappingID() + return nil + case orgmembership.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case orgmembership.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case orgmembership.FieldRole: + m.ResetRole() + return nil + case orgmembership.FieldOrganizationID: + m.ResetOrganizationID() + return nil + case orgmembership.FieldUserID: + m.ResetUserID() + return nil + } + return fmt.Errorf("unknown OrgMembership field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OrgMembershipMutation) AddedEdges() []string { + edges := make([]string, 0, 3) + if m.organization != nil { + edges = append(edges, orgmembership.EdgeOrganization) + } + if m.user != nil { + edges = append(edges, orgmembership.EdgeUser) + } + if m.events != nil { + edges = append(edges, orgmembership.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OrgMembershipMutation) AddedIDs(name string) []ent.Value { + switch name { + case orgmembership.EdgeOrganization: + if id := m.organization; id != nil { + return []ent.Value{*id} + } + case orgmembership.EdgeUser: + if id := m.user; id != nil { + return []ent.Value{*id} + } + case orgmembership.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OrgMembershipMutation) RemovedEdges() []string { + edges := make([]string, 0, 3) + if m.removedevents != nil { + edges = append(edges, orgmembership.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OrgMembershipMutation) RemovedIDs(name string) []ent.Value { + switch name { + case orgmembership.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OrgMembershipMutation) ClearedEdges() []string { + edges := make([]string, 0, 3) + if m.clearedorganization { + edges = append(edges, orgmembership.EdgeOrganization) + } + if m.cleareduser { + edges = append(edges, orgmembership.EdgeUser) + } + if m.clearedevents { + edges = append(edges, orgmembership.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OrgMembershipMutation) EdgeCleared(name string) bool { + switch name { + case orgmembership.EdgeOrganization: + return m.clearedorganization + case orgmembership.EdgeUser: + return m.cleareduser + case orgmembership.EdgeEvents: + return m.clearedevents + } + 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 *OrgMembershipMutation) ClearEdge(name string) error { + switch name { + case orgmembership.EdgeOrganization: + m.ClearOrganization() + return nil + case orgmembership.EdgeUser: + m.ClearUser() + return nil + } + return fmt.Errorf("unknown OrgMembership 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 *OrgMembershipMutation) ResetEdge(name string) error { + switch name { + case orgmembership.EdgeOrganization: + m.ResetOrganization() + return nil + case orgmembership.EdgeUser: + m.ResetUser() + return nil + case orgmembership.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown OrgMembership edge %s", name) +} + +// OrgMembershipHistoryMutation represents an operation that mutates the OrgMembershipHistory nodes in the graph. +type OrgMembershipHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + role *enums.Role + organization_id *string + user_id *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*OrgMembershipHistory, error) + predicates []predicate.OrgMembershipHistory +} + +var _ ent.Mutation = (*OrgMembershipHistoryMutation)(nil) + +// orgmembershiphistoryOption allows management of the mutation configuration using functional options. +type orgmembershiphistoryOption func(*OrgMembershipHistoryMutation) + +// newOrgMembershipHistoryMutation creates new mutation for the OrgMembershipHistory entity. +func newOrgMembershipHistoryMutation(c config, op Op, opts ...orgmembershiphistoryOption) *OrgMembershipHistoryMutation { + m := &OrgMembershipHistoryMutation{ + config: c, + op: op, + typ: TypeOrgMembershipHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOrgMembershipHistoryID sets the ID field of the mutation. +func withOrgMembershipHistoryID(id string) orgmembershiphistoryOption { + return func(m *OrgMembershipHistoryMutation) { + var ( + err error + once sync.Once + value *OrgMembershipHistory + ) + m.oldValue = func(ctx context.Context) (*OrgMembershipHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OrgMembershipHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOrgMembershipHistory sets the old OrgMembershipHistory of the mutation. +func withOrgMembershipHistory(node *OrgMembershipHistory) orgmembershiphistoryOption { + return func(m *OrgMembershipHistoryMutation) { + m.oldValue = func(context.Context) (*OrgMembershipHistory, 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 OrgMembershipHistoryMutation) 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 OrgMembershipHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OrgMembershipHistory entities. +func (m *OrgMembershipHistoryMutation) SetID(id string) { + 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 *OrgMembershipHistoryMutation) ID() (id string, 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 *OrgMembershipHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OrgMembershipHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *OrgMembershipHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *OrgMembershipHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *OrgMembershipHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *OrgMembershipHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *OrgMembershipHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *OrgMembershipHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[orgmembershiphistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[orgmembershiphistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *OrgMembershipHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, orgmembershiphistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *OrgMembershipHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *OrgMembershipHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *OrgMembershipHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *OrgMembershipHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OrgMembershipHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OrgMembershipHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[orgmembershiphistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[orgmembershiphistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OrgMembershipHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, orgmembershiphistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OrgMembershipHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OrgMembershipHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OrgMembershipHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[orgmembershiphistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[orgmembershiphistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OrgMembershipHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, orgmembershiphistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OrgMembershipHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OrgMembershipHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OrgMembershipHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[orgmembershiphistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[orgmembershiphistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OrgMembershipHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, orgmembershiphistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OrgMembershipHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OrgMembershipHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OrgMembershipHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[orgmembershiphistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[orgmembershiphistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OrgMembershipHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, orgmembershiphistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OrgMembershipHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OrgMembershipHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OrgMembershipHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OrgMembershipHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OrgMembershipHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OrgMembershipHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[orgmembershiphistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[orgmembershiphistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OrgMembershipHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, orgmembershiphistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OrgMembershipHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OrgMembershipHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OrgMembershipHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[orgmembershiphistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[orgmembershiphistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OrgMembershipHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, orgmembershiphistory.FieldDeletedBy) +} + +// SetRole sets the "role" field. +func (m *OrgMembershipHistoryMutation) SetRole(e enums.Role) { + m.role = &e +} + +// Role returns the value of the "role" field in the mutation. +func (m *OrgMembershipHistoryMutation) Role() (r enums.Role, exists bool) { + v := m.role + if v == nil { + return + } + return *v, true +} + +// OldRole returns the old "role" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldRole(ctx context.Context) (v enums.Role, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// ResetRole resets all changes to the "role" field. +func (m *OrgMembershipHistoryMutation) ResetRole() { + m.role = nil +} + +// SetOrganizationID sets the "organization_id" field. +func (m *OrgMembershipHistoryMutation) SetOrganizationID(s string) { + m.organization_id = &s +} + +// OrganizationID returns the value of the "organization_id" field in the mutation. +func (m *OrgMembershipHistoryMutation) OrganizationID() (r string, exists bool) { + v := m.organization_id + if v == nil { + return + } + return *v, true +} + +// OldOrganizationID returns the old "organization_id" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err) + } + return oldValue.OrganizationID, nil +} + +// ResetOrganizationID resets all changes to the "organization_id" field. +func (m *OrgMembershipHistoryMutation) ResetOrganizationID() { + m.organization_id = nil +} + +// SetUserID sets the "user_id" field. +func (m *OrgMembershipHistoryMutation) SetUserID(s string) { + m.user_id = &s +} + +// UserID returns the value of the "user_id" field in the mutation. +func (m *OrgMembershipHistoryMutation) UserID() (r string, exists bool) { + v := m.user_id + if v == nil { + return + } + return *v, true +} + +// OldUserID returns the old "user_id" field's value of the OrgMembershipHistory entity. +// If the OrgMembershipHistory 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 *OrgMembershipHistoryMutation) OldUserID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserID: %w", err) + } + return oldValue.UserID, nil +} + +// ResetUserID resets all changes to the "user_id" field. +func (m *OrgMembershipHistoryMutation) ResetUserID() { + m.user_id = nil +} + +// Where appends a list predicates to the OrgMembershipHistoryMutation builder. +func (m *OrgMembershipHistoryMutation) Where(ps ...predicate.OrgMembershipHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OrgMembershipHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OrgMembershipHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OrgMembershipHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OrgMembershipHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OrgMembershipHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OrgMembershipHistory). +func (m *OrgMembershipHistoryMutation) 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 *OrgMembershipHistoryMutation) Fields() []string { + fields := make([]string, 0, 13) + if m.history_time != nil { + fields = append(fields, orgmembershiphistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, orgmembershiphistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, orgmembershiphistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, orgmembershiphistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, orgmembershiphistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, orgmembershiphistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, orgmembershiphistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, orgmembershiphistory.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, orgmembershiphistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, orgmembershiphistory.FieldDeletedBy) + } + if m.role != nil { + fields = append(fields, orgmembershiphistory.FieldRole) + } + if m.organization_id != nil { + fields = append(fields, orgmembershiphistory.FieldOrganizationID) + } + if m.user_id != nil { + fields = append(fields, orgmembershiphistory.FieldUserID) + } + 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 *OrgMembershipHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case orgmembershiphistory.FieldHistoryTime: + return m.HistoryTime() + case orgmembershiphistory.FieldRef: + return m.Ref() + case orgmembershiphistory.FieldOperation: + return m.Operation() + case orgmembershiphistory.FieldCreatedAt: + return m.CreatedAt() + case orgmembershiphistory.FieldUpdatedAt: + return m.UpdatedAt() + case orgmembershiphistory.FieldCreatedBy: + return m.CreatedBy() + case orgmembershiphistory.FieldUpdatedBy: + return m.UpdatedBy() + case orgmembershiphistory.FieldMappingID: + return m.MappingID() + case orgmembershiphistory.FieldDeletedAt: + return m.DeletedAt() + case orgmembershiphistory.FieldDeletedBy: + return m.DeletedBy() + case orgmembershiphistory.FieldRole: + return m.Role() + case orgmembershiphistory.FieldOrganizationID: + return m.OrganizationID() + case orgmembershiphistory.FieldUserID: + return m.UserID() + } + 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 *OrgMembershipHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case orgmembershiphistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case orgmembershiphistory.FieldRef: + return m.OldRef(ctx) + case orgmembershiphistory.FieldOperation: + return m.OldOperation(ctx) + case orgmembershiphistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case orgmembershiphistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case orgmembershiphistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case orgmembershiphistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case orgmembershiphistory.FieldMappingID: + return m.OldMappingID(ctx) + case orgmembershiphistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case orgmembershiphistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case orgmembershiphistory.FieldRole: + return m.OldRole(ctx) + case orgmembershiphistory.FieldOrganizationID: + return m.OldOrganizationID(ctx) + case orgmembershiphistory.FieldUserID: + return m.OldUserID(ctx) + } + return nil, fmt.Errorf("unknown OrgMembershipHistory 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 *OrgMembershipHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case orgmembershiphistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case orgmembershiphistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case orgmembershiphistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case orgmembershiphistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case orgmembershiphistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case orgmembershiphistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case orgmembershiphistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case orgmembershiphistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case orgmembershiphistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case orgmembershiphistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case orgmembershiphistory.FieldRole: + v, ok := value.(enums.Role) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRole(v) + return nil + case orgmembershiphistory.FieldOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrganizationID(v) + return nil + case orgmembershiphistory.FieldUserID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserID(v) + return nil + } + return fmt.Errorf("unknown OrgMembershipHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OrgMembershipHistoryMutation) 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 *OrgMembershipHistoryMutation) 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 *OrgMembershipHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown OrgMembershipHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OrgMembershipHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(orgmembershiphistory.FieldRef) { + fields = append(fields, orgmembershiphistory.FieldRef) + } + if m.FieldCleared(orgmembershiphistory.FieldCreatedAt) { + fields = append(fields, orgmembershiphistory.FieldCreatedAt) + } + if m.FieldCleared(orgmembershiphistory.FieldUpdatedAt) { + fields = append(fields, orgmembershiphistory.FieldUpdatedAt) + } + if m.FieldCleared(orgmembershiphistory.FieldCreatedBy) { + fields = append(fields, orgmembershiphistory.FieldCreatedBy) + } + if m.FieldCleared(orgmembershiphistory.FieldUpdatedBy) { + fields = append(fields, orgmembershiphistory.FieldUpdatedBy) + } + if m.FieldCleared(orgmembershiphistory.FieldDeletedAt) { + fields = append(fields, orgmembershiphistory.FieldDeletedAt) + } + if m.FieldCleared(orgmembershiphistory.FieldDeletedBy) { + fields = append(fields, orgmembershiphistory.FieldDeletedBy) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OrgMembershipHistoryMutation) 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 *OrgMembershipHistoryMutation) ClearField(name string) error { + switch name { + case orgmembershiphistory.FieldRef: + m.ClearRef() + return nil + case orgmembershiphistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case orgmembershiphistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case orgmembershiphistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case orgmembershiphistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case orgmembershiphistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case orgmembershiphistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + } + return fmt.Errorf("unknown OrgMembershipHistory 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 *OrgMembershipHistoryMutation) ResetField(name string) error { + switch name { + case orgmembershiphistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case orgmembershiphistory.FieldRef: + m.ResetRef() + return nil + case orgmembershiphistory.FieldOperation: + m.ResetOperation() + return nil + case orgmembershiphistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case orgmembershiphistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case orgmembershiphistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case orgmembershiphistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case orgmembershiphistory.FieldMappingID: + m.ResetMappingID() + return nil + case orgmembershiphistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case orgmembershiphistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case orgmembershiphistory.FieldRole: + m.ResetRole() + return nil + case orgmembershiphistory.FieldOrganizationID: + m.ResetOrganizationID() + return nil + case orgmembershiphistory.FieldUserID: + m.ResetUserID() + return nil + } + return fmt.Errorf("unknown OrgMembershipHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OrgMembershipHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OrgMembershipHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OrgMembershipHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OrgMembershipHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OrgMembershipHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OrgMembershipHistoryMutation) EdgeCleared(name string) bool { + 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 *OrgMembershipHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown OrgMembershipHistory 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 *OrgMembershipHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown OrgMembershipHistory edge %s", name) +} + +// OrganizationMutation represents an operation that mutates the Organization nodes in the graph. +type OrganizationMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + name *string + display_name *string + description *string + personal_org *bool + avatar_remote_url *string + dedicated_db *bool + clearedFields map[string]struct{} + parent *string + clearedparent bool + children map[string]struct{} + removedchildren map[string]struct{} + clearedchildren bool + groups map[string]struct{} + removedgroups map[string]struct{} + clearedgroups bool + templates map[string]struct{} + removedtemplates map[string]struct{} + clearedtemplates bool + integrations map[string]struct{} + removedintegrations map[string]struct{} + clearedintegrations bool + setting *string + clearedsetting bool + documentdata map[string]struct{} + removeddocumentdata map[string]struct{} + cleareddocumentdata bool + entitlements map[string]struct{} + removedentitlements map[string]struct{} + clearedentitlements bool + organization_entitlement map[string]struct{} + removedorganization_entitlement map[string]struct{} + clearedorganization_entitlement bool + personal_access_tokens map[string]struct{} + removedpersonal_access_tokens map[string]struct{} + clearedpersonal_access_tokens bool + api_tokens map[string]struct{} + removedapi_tokens map[string]struct{} + clearedapi_tokens bool + oauthprovider map[string]struct{} + removedoauthprovider map[string]struct{} + clearedoauthprovider bool + users map[string]struct{} + removedusers map[string]struct{} + clearedusers bool + invites map[string]struct{} + removedinvites map[string]struct{} + clearedinvites bool + subscribers map[string]struct{} + removedsubscribers map[string]struct{} + clearedsubscribers bool + webhooks map[string]struct{} + removedwebhooks map[string]struct{} + clearedwebhooks bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + secrets map[string]struct{} + removedsecrets map[string]struct{} + clearedsecrets bool + features map[string]struct{} + removedfeatures map[string]struct{} + clearedfeatures bool + files map[string]struct{} + removedfiles map[string]struct{} + clearedfiles bool + entitlementplans map[string]struct{} + removedentitlementplans map[string]struct{} + clearedentitlementplans bool + entitlementplanfeatures map[string]struct{} + removedentitlementplanfeatures map[string]struct{} + clearedentitlementplanfeatures bool + entities map[string]struct{} + removedentities map[string]struct{} + clearedentities bool + entitytypes map[string]struct{} + removedentitytypes map[string]struct{} + clearedentitytypes bool + contacts map[string]struct{} + removedcontacts map[string]struct{} + clearedcontacts bool + notes map[string]struct{} + removednotes map[string]struct{} + clearednotes bool + members map[string]struct{} + removedmembers map[string]struct{} + clearedmembers bool + done bool + oldValue func(context.Context) (*Organization, error) + predicates []predicate.Organization +} + +var _ ent.Mutation = (*OrganizationMutation)(nil) + +// organizationOption allows management of the mutation configuration using functional options. +type organizationOption func(*OrganizationMutation) + +// newOrganizationMutation creates new mutation for the Organization entity. +func newOrganizationMutation(c config, op Op, opts ...organizationOption) *OrganizationMutation { + m := &OrganizationMutation{ + config: c, + op: op, + typ: TypeOrganization, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOrganizationID sets the ID field of the mutation. +func withOrganizationID(id string) organizationOption { + return func(m *OrganizationMutation) { + var ( + err error + once sync.Once + value *Organization + ) + m.oldValue = func(ctx context.Context) (*Organization, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Organization.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOrganization sets the old Organization of the mutation. +func withOrganization(node *Organization) organizationOption { + return func(m *OrganizationMutation) { + m.oldValue = func(context.Context) (*Organization, 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 OrganizationMutation) 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 OrganizationMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Organization entities. +func (m *OrganizationMutation) SetID(id string) { + 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 *OrganizationMutation) ID() (id string, 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 *OrganizationMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Organization.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *OrganizationMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OrganizationMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OrganizationMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[organization.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OrganizationMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[organization.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OrganizationMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, organization.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OrganizationMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OrganizationMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OrganizationMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[organization.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OrganizationMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[organization.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OrganizationMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, organization.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OrganizationMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OrganizationMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OrganizationMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[organization.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OrganizationMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[organization.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OrganizationMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, organization.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OrganizationMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OrganizationMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OrganizationMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[organization.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OrganizationMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[organization.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OrganizationMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, organization.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OrganizationMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OrganizationMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OrganizationMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *OrganizationMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *OrganizationMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *OrganizationMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *OrganizationMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *OrganizationMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[organization.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *OrganizationMutation) TagsCleared() bool { + _, ok := m.clearedFields[organization.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *OrganizationMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, organization.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OrganizationMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OrganizationMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OrganizationMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[organization.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OrganizationMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[organization.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OrganizationMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, organization.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OrganizationMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OrganizationMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OrganizationMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[organization.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OrganizationMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[organization.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OrganizationMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, organization.FieldDeletedBy) +} + +// SetName sets the "name" field. +func (m *OrganizationMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *OrganizationMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *OrganizationMutation) ResetName() { + m.name = nil +} + +// SetDisplayName sets the "display_name" field. +func (m *OrganizationMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *OrganizationMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *OrganizationMutation) ResetDisplayName() { + m.display_name = nil +} + +// SetDescription sets the "description" field. +func (m *OrganizationMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *OrganizationMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *OrganizationMutation) ClearDescription() { + m.description = nil + m.clearedFields[organization.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *OrganizationMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[organization.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *OrganizationMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, organization.FieldDescription) +} + +// SetParentOrganizationID sets the "parent_organization_id" field. +func (m *OrganizationMutation) SetParentOrganizationID(s string) { + m.parent = &s +} + +// ParentOrganizationID returns the value of the "parent_organization_id" field in the mutation. +func (m *OrganizationMutation) ParentOrganizationID() (r string, exists bool) { + v := m.parent + if v == nil { + return + } + return *v, true +} + +// OldParentOrganizationID returns the old "parent_organization_id" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldParentOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldParentOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldParentOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldParentOrganizationID: %w", err) + } + return oldValue.ParentOrganizationID, nil +} + +// ClearParentOrganizationID clears the value of the "parent_organization_id" field. +func (m *OrganizationMutation) ClearParentOrganizationID() { + m.parent = nil + m.clearedFields[organization.FieldParentOrganizationID] = struct{}{} +} + +// ParentOrganizationIDCleared returns if the "parent_organization_id" field was cleared in this mutation. +func (m *OrganizationMutation) ParentOrganizationIDCleared() bool { + _, ok := m.clearedFields[organization.FieldParentOrganizationID] + return ok +} + +// ResetParentOrganizationID resets all changes to the "parent_organization_id" field. +func (m *OrganizationMutation) ResetParentOrganizationID() { + m.parent = nil + delete(m.clearedFields, organization.FieldParentOrganizationID) +} + +// SetPersonalOrg sets the "personal_org" field. +func (m *OrganizationMutation) SetPersonalOrg(b bool) { + m.personal_org = &b +} + +// PersonalOrg returns the value of the "personal_org" field in the mutation. +func (m *OrganizationMutation) PersonalOrg() (r bool, exists bool) { + v := m.personal_org + if v == nil { + return + } + return *v, true +} + +// OldPersonalOrg returns the old "personal_org" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldPersonalOrg(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPersonalOrg is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPersonalOrg requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPersonalOrg: %w", err) + } + return oldValue.PersonalOrg, nil +} + +// ClearPersonalOrg clears the value of the "personal_org" field. +func (m *OrganizationMutation) ClearPersonalOrg() { + m.personal_org = nil + m.clearedFields[organization.FieldPersonalOrg] = struct{}{} +} + +// PersonalOrgCleared returns if the "personal_org" field was cleared in this mutation. +func (m *OrganizationMutation) PersonalOrgCleared() bool { + _, ok := m.clearedFields[organization.FieldPersonalOrg] + return ok +} + +// ResetPersonalOrg resets all changes to the "personal_org" field. +func (m *OrganizationMutation) ResetPersonalOrg() { + m.personal_org = nil + delete(m.clearedFields, organization.FieldPersonalOrg) +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (m *OrganizationMutation) SetAvatarRemoteURL(s string) { + m.avatar_remote_url = &s +} + +// AvatarRemoteURL returns the value of the "avatar_remote_url" field in the mutation. +func (m *OrganizationMutation) AvatarRemoteURL() (r string, exists bool) { + v := m.avatar_remote_url + if v == nil { + return + } + return *v, true +} + +// OldAvatarRemoteURL returns the old "avatar_remote_url" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldAvatarRemoteURL(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarRemoteURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarRemoteURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarRemoteURL: %w", err) + } + return oldValue.AvatarRemoteURL, nil +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (m *OrganizationMutation) ClearAvatarRemoteURL() { + m.avatar_remote_url = nil + m.clearedFields[organization.FieldAvatarRemoteURL] = struct{}{} +} + +// AvatarRemoteURLCleared returns if the "avatar_remote_url" field was cleared in this mutation. +func (m *OrganizationMutation) AvatarRemoteURLCleared() bool { + _, ok := m.clearedFields[organization.FieldAvatarRemoteURL] + return ok +} + +// ResetAvatarRemoteURL resets all changes to the "avatar_remote_url" field. +func (m *OrganizationMutation) ResetAvatarRemoteURL() { + m.avatar_remote_url = nil + delete(m.clearedFields, organization.FieldAvatarRemoteURL) +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (m *OrganizationMutation) SetDedicatedDb(b bool) { + m.dedicated_db = &b +} + +// DedicatedDb returns the value of the "dedicated_db" field in the mutation. +func (m *OrganizationMutation) DedicatedDb() (r bool, exists bool) { + v := m.dedicated_db + if v == nil { + return + } + return *v, true +} + +// OldDedicatedDb returns the old "dedicated_db" field's value of the Organization entity. +// If the Organization 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 *OrganizationMutation) OldDedicatedDb(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDedicatedDb is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDedicatedDb requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDedicatedDb: %w", err) + } + return oldValue.DedicatedDb, nil +} + +// ResetDedicatedDb resets all changes to the "dedicated_db" field. +func (m *OrganizationMutation) ResetDedicatedDb() { + m.dedicated_db = nil +} + +// SetParentID sets the "parent" edge to the Organization entity by id. +func (m *OrganizationMutation) SetParentID(id string) { + m.parent = &id +} + +// ClearParent clears the "parent" edge to the Organization entity. +func (m *OrganizationMutation) ClearParent() { + m.clearedparent = true + m.clearedFields[organization.FieldParentOrganizationID] = struct{}{} +} + +// ParentCleared reports if the "parent" edge to the Organization entity was cleared. +func (m *OrganizationMutation) ParentCleared() bool { + return m.ParentOrganizationIDCleared() || m.clearedparent +} + +// ParentID returns the "parent" edge ID in the mutation. +func (m *OrganizationMutation) ParentID() (id string, exists bool) { + if m.parent != nil { + return *m.parent, true + } + return +} + +// ParentIDs returns the "parent" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// ParentID instead. It exists only for internal usage by the builders. +func (m *OrganizationMutation) ParentIDs() (ids []string) { + if id := m.parent; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetParent resets all changes to the "parent" edge. +func (m *OrganizationMutation) ResetParent() { + m.parent = nil + m.clearedparent = false +} + +// AddChildIDs adds the "children" edge to the Organization entity by ids. +func (m *OrganizationMutation) AddChildIDs(ids ...string) { + if m.children == nil { + m.children = make(map[string]struct{}) + } + for i := range ids { + m.children[ids[i]] = struct{}{} + } +} + +// ClearChildren clears the "children" edge to the Organization entity. +func (m *OrganizationMutation) ClearChildren() { + m.clearedchildren = true +} + +// ChildrenCleared reports if the "children" edge to the Organization entity was cleared. +func (m *OrganizationMutation) ChildrenCleared() bool { + return m.clearedchildren +} + +// RemoveChildIDs removes the "children" edge to the Organization entity by IDs. +func (m *OrganizationMutation) RemoveChildIDs(ids ...string) { + if m.removedchildren == nil { + m.removedchildren = make(map[string]struct{}) + } + for i := range ids { + delete(m.children, ids[i]) + m.removedchildren[ids[i]] = struct{}{} + } +} + +// RemovedChildren returns the removed IDs of the "children" edge to the Organization entity. +func (m *OrganizationMutation) RemovedChildrenIDs() (ids []string) { + for id := range m.removedchildren { + ids = append(ids, id) + } + return +} + +// ChildrenIDs returns the "children" edge IDs in the mutation. +func (m *OrganizationMutation) ChildrenIDs() (ids []string) { + for id := range m.children { + ids = append(ids, id) + } + return +} + +// ResetChildren resets all changes to the "children" edge. +func (m *OrganizationMutation) ResetChildren() { + m.children = nil + m.clearedchildren = false + m.removedchildren = nil +} + +// AddGroupIDs adds the "groups" edge to the Group entity by ids. +func (m *OrganizationMutation) AddGroupIDs(ids ...string) { + if m.groups == nil { + m.groups = make(map[string]struct{}) + } + for i := range ids { + m.groups[ids[i]] = struct{}{} + } +} + +// ClearGroups clears the "groups" edge to the Group entity. +func (m *OrganizationMutation) ClearGroups() { + m.clearedgroups = true +} + +// GroupsCleared reports if the "groups" edge to the Group entity was cleared. +func (m *OrganizationMutation) GroupsCleared() bool { + return m.clearedgroups +} + +// RemoveGroupIDs removes the "groups" edge to the Group entity by IDs. +func (m *OrganizationMutation) RemoveGroupIDs(ids ...string) { + if m.removedgroups == nil { + m.removedgroups = make(map[string]struct{}) + } + for i := range ids { + delete(m.groups, ids[i]) + m.removedgroups[ids[i]] = struct{}{} + } +} + +// RemovedGroups returns the removed IDs of the "groups" edge to the Group entity. +func (m *OrganizationMutation) RemovedGroupsIDs() (ids []string) { + for id := range m.removedgroups { + ids = append(ids, id) + } + return +} + +// GroupsIDs returns the "groups" edge IDs in the mutation. +func (m *OrganizationMutation) GroupsIDs() (ids []string) { + for id := range m.groups { + ids = append(ids, id) + } + return +} + +// ResetGroups resets all changes to the "groups" edge. +func (m *OrganizationMutation) ResetGroups() { + m.groups = nil + m.clearedgroups = false + m.removedgroups = nil +} + +// AddTemplateIDs adds the "templates" edge to the Template entity by ids. +func (m *OrganizationMutation) AddTemplateIDs(ids ...string) { + if m.templates == nil { + m.templates = make(map[string]struct{}) + } + for i := range ids { + m.templates[ids[i]] = struct{}{} + } +} + +// ClearTemplates clears the "templates" edge to the Template entity. +func (m *OrganizationMutation) ClearTemplates() { + m.clearedtemplates = true +} + +// TemplatesCleared reports if the "templates" edge to the Template entity was cleared. +func (m *OrganizationMutation) TemplatesCleared() bool { + return m.clearedtemplates +} + +// RemoveTemplateIDs removes the "templates" edge to the Template entity by IDs. +func (m *OrganizationMutation) RemoveTemplateIDs(ids ...string) { + if m.removedtemplates == nil { + m.removedtemplates = make(map[string]struct{}) + } + for i := range ids { + delete(m.templates, ids[i]) + m.removedtemplates[ids[i]] = struct{}{} + } +} + +// RemovedTemplates returns the removed IDs of the "templates" edge to the Template entity. +func (m *OrganizationMutation) RemovedTemplatesIDs() (ids []string) { + for id := range m.removedtemplates { + ids = append(ids, id) + } + return +} + +// TemplatesIDs returns the "templates" edge IDs in the mutation. +func (m *OrganizationMutation) TemplatesIDs() (ids []string) { + for id := range m.templates { + ids = append(ids, id) + } + return +} + +// ResetTemplates resets all changes to the "templates" edge. +func (m *OrganizationMutation) ResetTemplates() { + m.templates = nil + m.clearedtemplates = false + m.removedtemplates = nil +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by ids. +func (m *OrganizationMutation) AddIntegrationIDs(ids ...string) { + if m.integrations == nil { + m.integrations = make(map[string]struct{}) + } + for i := range ids { + m.integrations[ids[i]] = struct{}{} + } +} + +// ClearIntegrations clears the "integrations" edge to the Integration entity. +func (m *OrganizationMutation) ClearIntegrations() { + m.clearedintegrations = true +} + +// IntegrationsCleared reports if the "integrations" edge to the Integration entity was cleared. +func (m *OrganizationMutation) IntegrationsCleared() bool { + return m.clearedintegrations +} + +// RemoveIntegrationIDs removes the "integrations" edge to the Integration entity by IDs. +func (m *OrganizationMutation) RemoveIntegrationIDs(ids ...string) { + if m.removedintegrations == nil { + m.removedintegrations = make(map[string]struct{}) + } + for i := range ids { + delete(m.integrations, ids[i]) + m.removedintegrations[ids[i]] = struct{}{} + } +} + +// RemovedIntegrations returns the removed IDs of the "integrations" edge to the Integration entity. +func (m *OrganizationMutation) RemovedIntegrationsIDs() (ids []string) { + for id := range m.removedintegrations { + ids = append(ids, id) + } + return +} + +// IntegrationsIDs returns the "integrations" edge IDs in the mutation. +func (m *OrganizationMutation) IntegrationsIDs() (ids []string) { + for id := range m.integrations { + ids = append(ids, id) + } + return +} + +// ResetIntegrations resets all changes to the "integrations" edge. +func (m *OrganizationMutation) ResetIntegrations() { + m.integrations = nil + m.clearedintegrations = false + m.removedintegrations = nil +} + +// SetSettingID sets the "setting" edge to the OrganizationSetting entity by id. +func (m *OrganizationMutation) SetSettingID(id string) { + m.setting = &id +} + +// ClearSetting clears the "setting" edge to the OrganizationSetting entity. +func (m *OrganizationMutation) ClearSetting() { + m.clearedsetting = true +} + +// SettingCleared reports if the "setting" edge to the OrganizationSetting entity was cleared. +func (m *OrganizationMutation) SettingCleared() bool { + return m.clearedsetting +} + +// SettingID returns the "setting" edge ID in the mutation. +func (m *OrganizationMutation) SettingID() (id string, exists bool) { + if m.setting != nil { + return *m.setting, true + } + return +} + +// SettingIDs returns the "setting" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// SettingID instead. It exists only for internal usage by the builders. +func (m *OrganizationMutation) SettingIDs() (ids []string) { + if id := m.setting; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetSetting resets all changes to the "setting" edge. +func (m *OrganizationMutation) ResetSetting() { + m.setting = nil + m.clearedsetting = false +} + +// AddDocumentdatumIDs adds the "documentdata" edge to the DocumentData entity by ids. +func (m *OrganizationMutation) AddDocumentdatumIDs(ids ...string) { + if m.documentdata == nil { + m.documentdata = make(map[string]struct{}) + } + for i := range ids { + m.documentdata[ids[i]] = struct{}{} + } +} + +// ClearDocumentdata clears the "documentdata" edge to the DocumentData entity. +func (m *OrganizationMutation) ClearDocumentdata() { + m.cleareddocumentdata = true +} + +// DocumentdataCleared reports if the "documentdata" edge to the DocumentData entity was cleared. +func (m *OrganizationMutation) DocumentdataCleared() bool { + return m.cleareddocumentdata +} + +// RemoveDocumentdatumIDs removes the "documentdata" edge to the DocumentData entity by IDs. +func (m *OrganizationMutation) RemoveDocumentdatumIDs(ids ...string) { + if m.removeddocumentdata == nil { + m.removeddocumentdata = make(map[string]struct{}) + } + for i := range ids { + delete(m.documentdata, ids[i]) + m.removeddocumentdata[ids[i]] = struct{}{} + } +} + +// RemovedDocumentdata returns the removed IDs of the "documentdata" edge to the DocumentData entity. +func (m *OrganizationMutation) RemovedDocumentdataIDs() (ids []string) { + for id := range m.removeddocumentdata { + ids = append(ids, id) + } + return +} + +// DocumentdataIDs returns the "documentdata" edge IDs in the mutation. +func (m *OrganizationMutation) DocumentdataIDs() (ids []string) { + for id := range m.documentdata { + ids = append(ids, id) + } + return +} + +// ResetDocumentdata resets all changes to the "documentdata" edge. +func (m *OrganizationMutation) ResetDocumentdata() { + m.documentdata = nil + m.cleareddocumentdata = false + m.removeddocumentdata = nil +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by ids. +func (m *OrganizationMutation) AddEntitlementIDs(ids ...string) { + if m.entitlements == nil { + m.entitlements = make(map[string]struct{}) + } + for i := range ids { + m.entitlements[ids[i]] = struct{}{} + } +} + +// ClearEntitlements clears the "entitlements" edge to the Entitlement entity. +func (m *OrganizationMutation) ClearEntitlements() { + m.clearedentitlements = true +} + +// EntitlementsCleared reports if the "entitlements" edge to the Entitlement entity was cleared. +func (m *OrganizationMutation) EntitlementsCleared() bool { + return m.clearedentitlements +} + +// RemoveEntitlementIDs removes the "entitlements" edge to the Entitlement entity by IDs. +func (m *OrganizationMutation) RemoveEntitlementIDs(ids ...string) { + if m.removedentitlements == nil { + m.removedentitlements = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitlements, ids[i]) + m.removedentitlements[ids[i]] = struct{}{} + } +} + +// RemovedEntitlements returns the removed IDs of the "entitlements" edge to the Entitlement entity. +func (m *OrganizationMutation) RemovedEntitlementsIDs() (ids []string) { + for id := range m.removedentitlements { + ids = append(ids, id) + } + return +} + +// EntitlementsIDs returns the "entitlements" edge IDs in the mutation. +func (m *OrganizationMutation) EntitlementsIDs() (ids []string) { + for id := range m.entitlements { + ids = append(ids, id) + } + return +} + +// ResetEntitlements resets all changes to the "entitlements" edge. +func (m *OrganizationMutation) ResetEntitlements() { + m.entitlements = nil + m.clearedentitlements = false + m.removedentitlements = nil +} + +// AddOrganizationEntitlementIDs adds the "organization_entitlement" edge to the Entitlement entity by ids. +func (m *OrganizationMutation) AddOrganizationEntitlementIDs(ids ...string) { + if m.organization_entitlement == nil { + m.organization_entitlement = make(map[string]struct{}) + } + for i := range ids { + m.organization_entitlement[ids[i]] = struct{}{} + } +} + +// ClearOrganizationEntitlement clears the "organization_entitlement" edge to the Entitlement entity. +func (m *OrganizationMutation) ClearOrganizationEntitlement() { + m.clearedorganization_entitlement = true +} + +// OrganizationEntitlementCleared reports if the "organization_entitlement" edge to the Entitlement entity was cleared. +func (m *OrganizationMutation) OrganizationEntitlementCleared() bool { + return m.clearedorganization_entitlement +} + +// RemoveOrganizationEntitlementIDs removes the "organization_entitlement" edge to the Entitlement entity by IDs. +func (m *OrganizationMutation) RemoveOrganizationEntitlementIDs(ids ...string) { + if m.removedorganization_entitlement == nil { + m.removedorganization_entitlement = make(map[string]struct{}) + } + for i := range ids { + delete(m.organization_entitlement, ids[i]) + m.removedorganization_entitlement[ids[i]] = struct{}{} + } +} + +// RemovedOrganizationEntitlement returns the removed IDs of the "organization_entitlement" edge to the Entitlement entity. +func (m *OrganizationMutation) RemovedOrganizationEntitlementIDs() (ids []string) { + for id := range m.removedorganization_entitlement { + ids = append(ids, id) + } + return +} + +// OrganizationEntitlementIDs returns the "organization_entitlement" edge IDs in the mutation. +func (m *OrganizationMutation) OrganizationEntitlementIDs() (ids []string) { + for id := range m.organization_entitlement { + ids = append(ids, id) + } + return +} + +// ResetOrganizationEntitlement resets all changes to the "organization_entitlement" edge. +func (m *OrganizationMutation) ResetOrganizationEntitlement() { + m.organization_entitlement = nil + m.clearedorganization_entitlement = false + m.removedorganization_entitlement = nil +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by ids. +func (m *OrganizationMutation) AddPersonalAccessTokenIDs(ids ...string) { + if m.personal_access_tokens == nil { + m.personal_access_tokens = make(map[string]struct{}) + } + for i := range ids { + m.personal_access_tokens[ids[i]] = struct{}{} + } +} + +// ClearPersonalAccessTokens clears the "personal_access_tokens" edge to the PersonalAccessToken entity. +func (m *OrganizationMutation) ClearPersonalAccessTokens() { + m.clearedpersonal_access_tokens = true +} + +// PersonalAccessTokensCleared reports if the "personal_access_tokens" edge to the PersonalAccessToken entity was cleared. +func (m *OrganizationMutation) PersonalAccessTokensCleared() bool { + return m.clearedpersonal_access_tokens +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (m *OrganizationMutation) RemovePersonalAccessTokenIDs(ids ...string) { + if m.removedpersonal_access_tokens == nil { + m.removedpersonal_access_tokens = make(map[string]struct{}) + } + for i := range ids { + delete(m.personal_access_tokens, ids[i]) + m.removedpersonal_access_tokens[ids[i]] = struct{}{} + } +} + +// RemovedPersonalAccessTokens returns the removed IDs of the "personal_access_tokens" edge to the PersonalAccessToken entity. +func (m *OrganizationMutation) RemovedPersonalAccessTokensIDs() (ids []string) { + for id := range m.removedpersonal_access_tokens { + ids = append(ids, id) + } + return +} + +// PersonalAccessTokensIDs returns the "personal_access_tokens" edge IDs in the mutation. +func (m *OrganizationMutation) PersonalAccessTokensIDs() (ids []string) { + for id := range m.personal_access_tokens { + ids = append(ids, id) + } + return +} + +// ResetPersonalAccessTokens resets all changes to the "personal_access_tokens" edge. +func (m *OrganizationMutation) ResetPersonalAccessTokens() { + m.personal_access_tokens = nil + m.clearedpersonal_access_tokens = false + m.removedpersonal_access_tokens = nil +} + +// AddAPITokenIDs adds the "api_tokens" edge to the APIToken entity by ids. +func (m *OrganizationMutation) AddAPITokenIDs(ids ...string) { + if m.api_tokens == nil { + m.api_tokens = make(map[string]struct{}) + } + for i := range ids { + m.api_tokens[ids[i]] = struct{}{} + } +} + +// ClearAPITokens clears the "api_tokens" edge to the APIToken entity. +func (m *OrganizationMutation) ClearAPITokens() { + m.clearedapi_tokens = true +} + +// APITokensCleared reports if the "api_tokens" edge to the APIToken entity was cleared. +func (m *OrganizationMutation) APITokensCleared() bool { + return m.clearedapi_tokens +} + +// RemoveAPITokenIDs removes the "api_tokens" edge to the APIToken entity by IDs. +func (m *OrganizationMutation) RemoveAPITokenIDs(ids ...string) { + if m.removedapi_tokens == nil { + m.removedapi_tokens = make(map[string]struct{}) + } + for i := range ids { + delete(m.api_tokens, ids[i]) + m.removedapi_tokens[ids[i]] = struct{}{} + } +} + +// RemovedAPITokens returns the removed IDs of the "api_tokens" edge to the APIToken entity. +func (m *OrganizationMutation) RemovedAPITokensIDs() (ids []string) { + for id := range m.removedapi_tokens { + ids = append(ids, id) + } + return +} + +// APITokensIDs returns the "api_tokens" edge IDs in the mutation. +func (m *OrganizationMutation) APITokensIDs() (ids []string) { + for id := range m.api_tokens { + ids = append(ids, id) + } + return +} + +// ResetAPITokens resets all changes to the "api_tokens" edge. +func (m *OrganizationMutation) ResetAPITokens() { + m.api_tokens = nil + m.clearedapi_tokens = false + m.removedapi_tokens = nil +} + +// AddOauthproviderIDs adds the "oauthprovider" edge to the OauthProvider entity by ids. +func (m *OrganizationMutation) AddOauthproviderIDs(ids ...string) { + if m.oauthprovider == nil { + m.oauthprovider = make(map[string]struct{}) + } + for i := range ids { + m.oauthprovider[ids[i]] = struct{}{} + } +} + +// ClearOauthprovider clears the "oauthprovider" edge to the OauthProvider entity. +func (m *OrganizationMutation) ClearOauthprovider() { + m.clearedoauthprovider = true +} + +// OauthproviderCleared reports if the "oauthprovider" edge to the OauthProvider entity was cleared. +func (m *OrganizationMutation) OauthproviderCleared() bool { + return m.clearedoauthprovider +} + +// RemoveOauthproviderIDs removes the "oauthprovider" edge to the OauthProvider entity by IDs. +func (m *OrganizationMutation) RemoveOauthproviderIDs(ids ...string) { + if m.removedoauthprovider == nil { + m.removedoauthprovider = make(map[string]struct{}) + } + for i := range ids { + delete(m.oauthprovider, ids[i]) + m.removedoauthprovider[ids[i]] = struct{}{} + } +} + +// RemovedOauthprovider returns the removed IDs of the "oauthprovider" edge to the OauthProvider entity. +func (m *OrganizationMutation) RemovedOauthproviderIDs() (ids []string) { + for id := range m.removedoauthprovider { + ids = append(ids, id) + } + return +} + +// OauthproviderIDs returns the "oauthprovider" edge IDs in the mutation. +func (m *OrganizationMutation) OauthproviderIDs() (ids []string) { + for id := range m.oauthprovider { + ids = append(ids, id) + } + return +} + +// ResetOauthprovider resets all changes to the "oauthprovider" edge. +func (m *OrganizationMutation) ResetOauthprovider() { + m.oauthprovider = nil + m.clearedoauthprovider = false + m.removedoauthprovider = nil +} + +// AddUserIDs adds the "users" edge to the User entity by ids. +func (m *OrganizationMutation) AddUserIDs(ids ...string) { + if m.users == nil { + m.users = make(map[string]struct{}) + } + for i := range ids { + m.users[ids[i]] = struct{}{} + } +} + +// ClearUsers clears the "users" edge to the User entity. +func (m *OrganizationMutation) ClearUsers() { + m.clearedusers = true +} + +// UsersCleared reports if the "users" edge to the User entity was cleared. +func (m *OrganizationMutation) UsersCleared() bool { + return m.clearedusers +} + +// RemoveUserIDs removes the "users" edge to the User entity by IDs. +func (m *OrganizationMutation) RemoveUserIDs(ids ...string) { + if m.removedusers == nil { + m.removedusers = make(map[string]struct{}) + } + for i := range ids { + delete(m.users, ids[i]) + m.removedusers[ids[i]] = struct{}{} + } +} + +// RemovedUsers returns the removed IDs of the "users" edge to the User entity. +func (m *OrganizationMutation) RemovedUsersIDs() (ids []string) { + for id := range m.removedusers { + ids = append(ids, id) + } + return +} + +// UsersIDs returns the "users" edge IDs in the mutation. +func (m *OrganizationMutation) UsersIDs() (ids []string) { + for id := range m.users { + ids = append(ids, id) + } + return +} + +// ResetUsers resets all changes to the "users" edge. +func (m *OrganizationMutation) ResetUsers() { + m.users = nil + m.clearedusers = false + m.removedusers = nil +} + +// AddInviteIDs adds the "invites" edge to the Invite entity by ids. +func (m *OrganizationMutation) AddInviteIDs(ids ...string) { + if m.invites == nil { + m.invites = make(map[string]struct{}) + } + for i := range ids { + m.invites[ids[i]] = struct{}{} + } +} + +// ClearInvites clears the "invites" edge to the Invite entity. +func (m *OrganizationMutation) ClearInvites() { + m.clearedinvites = true +} + +// InvitesCleared reports if the "invites" edge to the Invite entity was cleared. +func (m *OrganizationMutation) InvitesCleared() bool { + return m.clearedinvites +} + +// RemoveInviteIDs removes the "invites" edge to the Invite entity by IDs. +func (m *OrganizationMutation) RemoveInviteIDs(ids ...string) { + if m.removedinvites == nil { + m.removedinvites = make(map[string]struct{}) + } + for i := range ids { + delete(m.invites, ids[i]) + m.removedinvites[ids[i]] = struct{}{} + } +} + +// RemovedInvites returns the removed IDs of the "invites" edge to the Invite entity. +func (m *OrganizationMutation) RemovedInvitesIDs() (ids []string) { + for id := range m.removedinvites { + ids = append(ids, id) + } + return +} + +// InvitesIDs returns the "invites" edge IDs in the mutation. +func (m *OrganizationMutation) InvitesIDs() (ids []string) { + for id := range m.invites { + ids = append(ids, id) + } + return +} + +// ResetInvites resets all changes to the "invites" edge. +func (m *OrganizationMutation) ResetInvites() { + m.invites = nil + m.clearedinvites = false + m.removedinvites = nil +} + +// AddSubscriberIDs adds the "subscribers" edge to the Subscriber entity by ids. +func (m *OrganizationMutation) AddSubscriberIDs(ids ...string) { + if m.subscribers == nil { + m.subscribers = make(map[string]struct{}) + } + for i := range ids { + m.subscribers[ids[i]] = struct{}{} + } +} + +// ClearSubscribers clears the "subscribers" edge to the Subscriber entity. +func (m *OrganizationMutation) ClearSubscribers() { + m.clearedsubscribers = true +} + +// SubscribersCleared reports if the "subscribers" edge to the Subscriber entity was cleared. +func (m *OrganizationMutation) SubscribersCleared() bool { + return m.clearedsubscribers +} + +// RemoveSubscriberIDs removes the "subscribers" edge to the Subscriber entity by IDs. +func (m *OrganizationMutation) RemoveSubscriberIDs(ids ...string) { + if m.removedsubscribers == nil { + m.removedsubscribers = make(map[string]struct{}) + } + for i := range ids { + delete(m.subscribers, ids[i]) + m.removedsubscribers[ids[i]] = struct{}{} + } +} + +// RemovedSubscribers returns the removed IDs of the "subscribers" edge to the Subscriber entity. +func (m *OrganizationMutation) RemovedSubscribersIDs() (ids []string) { + for id := range m.removedsubscribers { + ids = append(ids, id) + } + return +} + +// SubscribersIDs returns the "subscribers" edge IDs in the mutation. +func (m *OrganizationMutation) SubscribersIDs() (ids []string) { + for id := range m.subscribers { + ids = append(ids, id) + } + return +} + +// ResetSubscribers resets all changes to the "subscribers" edge. +func (m *OrganizationMutation) ResetSubscribers() { + m.subscribers = nil + m.clearedsubscribers = false + m.removedsubscribers = nil +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by ids. +func (m *OrganizationMutation) AddWebhookIDs(ids ...string) { + if m.webhooks == nil { + m.webhooks = make(map[string]struct{}) + } + for i := range ids { + m.webhooks[ids[i]] = struct{}{} + } +} + +// ClearWebhooks clears the "webhooks" edge to the Webhook entity. +func (m *OrganizationMutation) ClearWebhooks() { + m.clearedwebhooks = true +} + +// WebhooksCleared reports if the "webhooks" edge to the Webhook entity was cleared. +func (m *OrganizationMutation) WebhooksCleared() bool { + return m.clearedwebhooks +} + +// RemoveWebhookIDs removes the "webhooks" edge to the Webhook entity by IDs. +func (m *OrganizationMutation) RemoveWebhookIDs(ids ...string) { + if m.removedwebhooks == nil { + m.removedwebhooks = make(map[string]struct{}) + } + for i := range ids { + delete(m.webhooks, ids[i]) + m.removedwebhooks[ids[i]] = struct{}{} + } +} + +// RemovedWebhooks returns the removed IDs of the "webhooks" edge to the Webhook entity. +func (m *OrganizationMutation) RemovedWebhooksIDs() (ids []string) { + for id := range m.removedwebhooks { + ids = append(ids, id) + } + return +} + +// WebhooksIDs returns the "webhooks" edge IDs in the mutation. +func (m *OrganizationMutation) WebhooksIDs() (ids []string) { + for id := range m.webhooks { + ids = append(ids, id) + } + return +} + +// ResetWebhooks resets all changes to the "webhooks" edge. +func (m *OrganizationMutation) ResetWebhooks() { + m.webhooks = nil + m.clearedwebhooks = false + m.removedwebhooks = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *OrganizationMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *OrganizationMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *OrganizationMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *OrganizationMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *OrganizationMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *OrganizationMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *OrganizationMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by ids. +func (m *OrganizationMutation) AddSecretIDs(ids ...string) { + if m.secrets == nil { + m.secrets = make(map[string]struct{}) + } + for i := range ids { + m.secrets[ids[i]] = struct{}{} + } +} + +// ClearSecrets clears the "secrets" edge to the Hush entity. +func (m *OrganizationMutation) ClearSecrets() { + m.clearedsecrets = true +} + +// SecretsCleared reports if the "secrets" edge to the Hush entity was cleared. +func (m *OrganizationMutation) SecretsCleared() bool { + return m.clearedsecrets +} + +// RemoveSecretIDs removes the "secrets" edge to the Hush entity by IDs. +func (m *OrganizationMutation) RemoveSecretIDs(ids ...string) { + if m.removedsecrets == nil { + m.removedsecrets = make(map[string]struct{}) + } + for i := range ids { + delete(m.secrets, ids[i]) + m.removedsecrets[ids[i]] = struct{}{} + } +} + +// RemovedSecrets returns the removed IDs of the "secrets" edge to the Hush entity. +func (m *OrganizationMutation) RemovedSecretsIDs() (ids []string) { + for id := range m.removedsecrets { + ids = append(ids, id) + } + return +} + +// SecretsIDs returns the "secrets" edge IDs in the mutation. +func (m *OrganizationMutation) SecretsIDs() (ids []string) { + for id := range m.secrets { + ids = append(ids, id) + } + return +} + +// ResetSecrets resets all changes to the "secrets" edge. +func (m *OrganizationMutation) ResetSecrets() { + m.secrets = nil + m.clearedsecrets = false + m.removedsecrets = nil +} + +// AddFeatureIDs adds the "features" edge to the Feature entity by ids. +func (m *OrganizationMutation) AddFeatureIDs(ids ...string) { + if m.features == nil { + m.features = make(map[string]struct{}) + } + for i := range ids { + m.features[ids[i]] = struct{}{} + } +} + +// ClearFeatures clears the "features" edge to the Feature entity. +func (m *OrganizationMutation) ClearFeatures() { + m.clearedfeatures = true +} + +// FeaturesCleared reports if the "features" edge to the Feature entity was cleared. +func (m *OrganizationMutation) FeaturesCleared() bool { + return m.clearedfeatures +} + +// RemoveFeatureIDs removes the "features" edge to the Feature entity by IDs. +func (m *OrganizationMutation) RemoveFeatureIDs(ids ...string) { + if m.removedfeatures == nil { + m.removedfeatures = make(map[string]struct{}) + } + for i := range ids { + delete(m.features, ids[i]) + m.removedfeatures[ids[i]] = struct{}{} + } +} + +// RemovedFeatures returns the removed IDs of the "features" edge to the Feature entity. +func (m *OrganizationMutation) RemovedFeaturesIDs() (ids []string) { + for id := range m.removedfeatures { + ids = append(ids, id) + } + return +} + +// FeaturesIDs returns the "features" edge IDs in the mutation. +func (m *OrganizationMutation) FeaturesIDs() (ids []string) { + for id := range m.features { + ids = append(ids, id) + } + return +} + +// ResetFeatures resets all changes to the "features" edge. +func (m *OrganizationMutation) ResetFeatures() { + m.features = nil + m.clearedfeatures = false + m.removedfeatures = nil +} + +// AddFileIDs adds the "files" edge to the File entity by ids. +func (m *OrganizationMutation) AddFileIDs(ids ...string) { + if m.files == nil { + m.files = make(map[string]struct{}) + } + for i := range ids { + m.files[ids[i]] = struct{}{} + } +} + +// ClearFiles clears the "files" edge to the File entity. +func (m *OrganizationMutation) ClearFiles() { + m.clearedfiles = true +} + +// FilesCleared reports if the "files" edge to the File entity was cleared. +func (m *OrganizationMutation) FilesCleared() bool { + return m.clearedfiles +} + +// RemoveFileIDs removes the "files" edge to the File entity by IDs. +func (m *OrganizationMutation) RemoveFileIDs(ids ...string) { + if m.removedfiles == nil { + m.removedfiles = make(map[string]struct{}) + } + for i := range ids { + delete(m.files, ids[i]) + m.removedfiles[ids[i]] = struct{}{} + } +} + +// RemovedFiles returns the removed IDs of the "files" edge to the File entity. +func (m *OrganizationMutation) RemovedFilesIDs() (ids []string) { + for id := range m.removedfiles { + ids = append(ids, id) + } + return +} + +// FilesIDs returns the "files" edge IDs in the mutation. +func (m *OrganizationMutation) FilesIDs() (ids []string) { + for id := range m.files { + ids = append(ids, id) + } + return +} + +// ResetFiles resets all changes to the "files" edge. +func (m *OrganizationMutation) ResetFiles() { + m.files = nil + m.clearedfiles = false + m.removedfiles = nil +} + +// AddEntitlementplanIDs adds the "entitlementplans" edge to the EntitlementPlan entity by ids. +func (m *OrganizationMutation) AddEntitlementplanIDs(ids ...string) { + if m.entitlementplans == nil { + m.entitlementplans = make(map[string]struct{}) + } + for i := range ids { + m.entitlementplans[ids[i]] = struct{}{} + } +} + +// ClearEntitlementplans clears the "entitlementplans" edge to the EntitlementPlan entity. +func (m *OrganizationMutation) ClearEntitlementplans() { + m.clearedentitlementplans = true +} + +// EntitlementplansCleared reports if the "entitlementplans" edge to the EntitlementPlan entity was cleared. +func (m *OrganizationMutation) EntitlementplansCleared() bool { + return m.clearedentitlementplans +} + +// RemoveEntitlementplanIDs removes the "entitlementplans" edge to the EntitlementPlan entity by IDs. +func (m *OrganizationMutation) RemoveEntitlementplanIDs(ids ...string) { + if m.removedentitlementplans == nil { + m.removedentitlementplans = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitlementplans, ids[i]) + m.removedentitlementplans[ids[i]] = struct{}{} + } +} + +// RemovedEntitlementplans returns the removed IDs of the "entitlementplans" edge to the EntitlementPlan entity. +func (m *OrganizationMutation) RemovedEntitlementplansIDs() (ids []string) { + for id := range m.removedentitlementplans { + ids = append(ids, id) + } + return +} + +// EntitlementplansIDs returns the "entitlementplans" edge IDs in the mutation. +func (m *OrganizationMutation) EntitlementplansIDs() (ids []string) { + for id := range m.entitlementplans { + ids = append(ids, id) + } + return +} + +// ResetEntitlementplans resets all changes to the "entitlementplans" edge. +func (m *OrganizationMutation) ResetEntitlementplans() { + m.entitlementplans = nil + m.clearedentitlementplans = false + m.removedentitlementplans = nil +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity by ids. +func (m *OrganizationMutation) AddEntitlementplanfeatureIDs(ids ...string) { + if m.entitlementplanfeatures == nil { + m.entitlementplanfeatures = make(map[string]struct{}) + } + for i := range ids { + m.entitlementplanfeatures[ids[i]] = struct{}{} + } +} + +// ClearEntitlementplanfeatures clears the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity. +func (m *OrganizationMutation) ClearEntitlementplanfeatures() { + m.clearedentitlementplanfeatures = true +} + +// EntitlementplanfeaturesCleared reports if the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity was cleared. +func (m *OrganizationMutation) EntitlementplanfeaturesCleared() bool { + return m.clearedentitlementplanfeatures +} + +// RemoveEntitlementplanfeatureIDs removes the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity by IDs. +func (m *OrganizationMutation) RemoveEntitlementplanfeatureIDs(ids ...string) { + if m.removedentitlementplanfeatures == nil { + m.removedentitlementplanfeatures = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitlementplanfeatures, ids[i]) + m.removedentitlementplanfeatures[ids[i]] = struct{}{} + } +} + +// RemovedEntitlementplanfeatures returns the removed IDs of the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity. +func (m *OrganizationMutation) RemovedEntitlementplanfeaturesIDs() (ids []string) { + for id := range m.removedentitlementplanfeatures { + ids = append(ids, id) + } + return +} + +// EntitlementplanfeaturesIDs returns the "entitlementplanfeatures" edge IDs in the mutation. +func (m *OrganizationMutation) EntitlementplanfeaturesIDs() (ids []string) { + for id := range m.entitlementplanfeatures { + ids = append(ids, id) + } + return +} + +// ResetEntitlementplanfeatures resets all changes to the "entitlementplanfeatures" edge. +func (m *OrganizationMutation) ResetEntitlementplanfeatures() { + m.entitlementplanfeatures = nil + m.clearedentitlementplanfeatures = false + m.removedentitlementplanfeatures = nil +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by ids. +func (m *OrganizationMutation) AddEntityIDs(ids ...string) { + if m.entities == nil { + m.entities = make(map[string]struct{}) + } + for i := range ids { + m.entities[ids[i]] = struct{}{} + } +} + +// ClearEntities clears the "entities" edge to the Entity entity. +func (m *OrganizationMutation) ClearEntities() { + m.clearedentities = true +} + +// EntitiesCleared reports if the "entities" edge to the Entity entity was cleared. +func (m *OrganizationMutation) EntitiesCleared() bool { + return m.clearedentities +} + +// RemoveEntityIDs removes the "entities" edge to the Entity entity by IDs. +func (m *OrganizationMutation) RemoveEntityIDs(ids ...string) { + if m.removedentities == nil { + m.removedentities = make(map[string]struct{}) + } + for i := range ids { + delete(m.entities, ids[i]) + m.removedentities[ids[i]] = struct{}{} + } +} + +// RemovedEntities returns the removed IDs of the "entities" edge to the Entity entity. +func (m *OrganizationMutation) RemovedEntitiesIDs() (ids []string) { + for id := range m.removedentities { + ids = append(ids, id) + } + return +} + +// EntitiesIDs returns the "entities" edge IDs in the mutation. +func (m *OrganizationMutation) EntitiesIDs() (ids []string) { + for id := range m.entities { + ids = append(ids, id) + } + return +} + +// ResetEntities resets all changes to the "entities" edge. +func (m *OrganizationMutation) ResetEntities() { + m.entities = nil + m.clearedentities = false + m.removedentities = nil +} + +// AddEntitytypeIDs adds the "entitytypes" edge to the EntityType entity by ids. +func (m *OrganizationMutation) AddEntitytypeIDs(ids ...string) { + if m.entitytypes == nil { + m.entitytypes = make(map[string]struct{}) + } + for i := range ids { + m.entitytypes[ids[i]] = struct{}{} + } +} + +// ClearEntitytypes clears the "entitytypes" edge to the EntityType entity. +func (m *OrganizationMutation) ClearEntitytypes() { + m.clearedentitytypes = true +} + +// EntitytypesCleared reports if the "entitytypes" edge to the EntityType entity was cleared. +func (m *OrganizationMutation) EntitytypesCleared() bool { + return m.clearedentitytypes +} + +// RemoveEntitytypeIDs removes the "entitytypes" edge to the EntityType entity by IDs. +func (m *OrganizationMutation) RemoveEntitytypeIDs(ids ...string) { + if m.removedentitytypes == nil { + m.removedentitytypes = make(map[string]struct{}) + } + for i := range ids { + delete(m.entitytypes, ids[i]) + m.removedentitytypes[ids[i]] = struct{}{} + } +} + +// RemovedEntitytypes returns the removed IDs of the "entitytypes" edge to the EntityType entity. +func (m *OrganizationMutation) RemovedEntitytypesIDs() (ids []string) { + for id := range m.removedentitytypes { + ids = append(ids, id) + } + return +} + +// EntitytypesIDs returns the "entitytypes" edge IDs in the mutation. +func (m *OrganizationMutation) EntitytypesIDs() (ids []string) { + for id := range m.entitytypes { + ids = append(ids, id) + } + return +} + +// ResetEntitytypes resets all changes to the "entitytypes" edge. +func (m *OrganizationMutation) ResetEntitytypes() { + m.entitytypes = nil + m.clearedentitytypes = false + m.removedentitytypes = nil +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by ids. +func (m *OrganizationMutation) AddContactIDs(ids ...string) { + if m.contacts == nil { + m.contacts = make(map[string]struct{}) + } + for i := range ids { + m.contacts[ids[i]] = struct{}{} + } +} + +// ClearContacts clears the "contacts" edge to the Contact entity. +func (m *OrganizationMutation) ClearContacts() { + m.clearedcontacts = true +} + +// ContactsCleared reports if the "contacts" edge to the Contact entity was cleared. +func (m *OrganizationMutation) ContactsCleared() bool { + return m.clearedcontacts +} + +// RemoveContactIDs removes the "contacts" edge to the Contact entity by IDs. +func (m *OrganizationMutation) RemoveContactIDs(ids ...string) { + if m.removedcontacts == nil { + m.removedcontacts = make(map[string]struct{}) + } + for i := range ids { + delete(m.contacts, ids[i]) + m.removedcontacts[ids[i]] = struct{}{} + } +} + +// RemovedContacts returns the removed IDs of the "contacts" edge to the Contact entity. +func (m *OrganizationMutation) RemovedContactsIDs() (ids []string) { + for id := range m.removedcontacts { + ids = append(ids, id) + } + return +} + +// ContactsIDs returns the "contacts" edge IDs in the mutation. +func (m *OrganizationMutation) ContactsIDs() (ids []string) { + for id := range m.contacts { + ids = append(ids, id) + } + return +} + +// ResetContacts resets all changes to the "contacts" edge. +func (m *OrganizationMutation) ResetContacts() { + m.contacts = nil + m.clearedcontacts = false + m.removedcontacts = nil +} + +// AddNoteIDs adds the "notes" edge to the Note entity by ids. +func (m *OrganizationMutation) AddNoteIDs(ids ...string) { + if m.notes == nil { + m.notes = make(map[string]struct{}) + } + for i := range ids { + m.notes[ids[i]] = struct{}{} + } +} + +// ClearNotes clears the "notes" edge to the Note entity. +func (m *OrganizationMutation) ClearNotes() { + m.clearednotes = true +} + +// NotesCleared reports if the "notes" edge to the Note entity was cleared. +func (m *OrganizationMutation) NotesCleared() bool { + return m.clearednotes +} + +// RemoveNoteIDs removes the "notes" edge to the Note entity by IDs. +func (m *OrganizationMutation) RemoveNoteIDs(ids ...string) { + if m.removednotes == nil { + m.removednotes = make(map[string]struct{}) + } + for i := range ids { + delete(m.notes, ids[i]) + m.removednotes[ids[i]] = struct{}{} + } +} + +// RemovedNotes returns the removed IDs of the "notes" edge to the Note entity. +func (m *OrganizationMutation) RemovedNotesIDs() (ids []string) { + for id := range m.removednotes { + ids = append(ids, id) + } + return +} + +// NotesIDs returns the "notes" edge IDs in the mutation. +func (m *OrganizationMutation) NotesIDs() (ids []string) { + for id := range m.notes { + ids = append(ids, id) + } + return +} + +// ResetNotes resets all changes to the "notes" edge. +func (m *OrganizationMutation) ResetNotes() { + m.notes = nil + m.clearednotes = false + m.removednotes = nil +} + +// AddMemberIDs adds the "members" edge to the OrgMembership entity by ids. +func (m *OrganizationMutation) AddMemberIDs(ids ...string) { + if m.members == nil { + m.members = make(map[string]struct{}) + } + for i := range ids { + m.members[ids[i]] = struct{}{} + } +} + +// ClearMembers clears the "members" edge to the OrgMembership entity. +func (m *OrganizationMutation) ClearMembers() { + m.clearedmembers = true +} + +// MembersCleared reports if the "members" edge to the OrgMembership entity was cleared. +func (m *OrganizationMutation) MembersCleared() bool { + return m.clearedmembers +} + +// RemoveMemberIDs removes the "members" edge to the OrgMembership entity by IDs. +func (m *OrganizationMutation) RemoveMemberIDs(ids ...string) { + if m.removedmembers == nil { + m.removedmembers = make(map[string]struct{}) + } + for i := range ids { + delete(m.members, ids[i]) + m.removedmembers[ids[i]] = struct{}{} + } +} + +// RemovedMembers returns the removed IDs of the "members" edge to the OrgMembership entity. +func (m *OrganizationMutation) RemovedMembersIDs() (ids []string) { + for id := range m.removedmembers { + ids = append(ids, id) + } + return +} + +// MembersIDs returns the "members" edge IDs in the mutation. +func (m *OrganizationMutation) MembersIDs() (ids []string) { + for id := range m.members { + ids = append(ids, id) + } + return +} + +// ResetMembers resets all changes to the "members" edge. +func (m *OrganizationMutation) ResetMembers() { + m.members = nil + m.clearedmembers = false + m.removedmembers = nil +} + +// Where appends a list predicates to the OrganizationMutation builder. +func (m *OrganizationMutation) Where(ps ...predicate.Organization) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OrganizationMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OrganizationMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Organization, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OrganizationMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OrganizationMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Organization). +func (m *OrganizationMutation) 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 *OrganizationMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.created_at != nil { + fields = append(fields, organization.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, organization.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, organization.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, organization.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, organization.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, organization.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, organization.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, organization.FieldDeletedBy) + } + if m.name != nil { + fields = append(fields, organization.FieldName) + } + if m.display_name != nil { + fields = append(fields, organization.FieldDisplayName) + } + if m.description != nil { + fields = append(fields, organization.FieldDescription) + } + if m.parent != nil { + fields = append(fields, organization.FieldParentOrganizationID) + } + if m.personal_org != nil { + fields = append(fields, organization.FieldPersonalOrg) + } + if m.avatar_remote_url != nil { + fields = append(fields, organization.FieldAvatarRemoteURL) + } + if m.dedicated_db != nil { + fields = append(fields, organization.FieldDedicatedDb) + } + 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 *OrganizationMutation) Field(name string) (ent.Value, bool) { + switch name { + case organization.FieldCreatedAt: + return m.CreatedAt() + case organization.FieldUpdatedAt: + return m.UpdatedAt() + case organization.FieldCreatedBy: + return m.CreatedBy() + case organization.FieldUpdatedBy: + return m.UpdatedBy() + case organization.FieldMappingID: + return m.MappingID() + case organization.FieldTags: + return m.Tags() + case organization.FieldDeletedAt: + return m.DeletedAt() + case organization.FieldDeletedBy: + return m.DeletedBy() + case organization.FieldName: + return m.Name() + case organization.FieldDisplayName: + return m.DisplayName() + case organization.FieldDescription: + return m.Description() + case organization.FieldParentOrganizationID: + return m.ParentOrganizationID() + case organization.FieldPersonalOrg: + return m.PersonalOrg() + case organization.FieldAvatarRemoteURL: + return m.AvatarRemoteURL() + case organization.FieldDedicatedDb: + return m.DedicatedDb() + } + 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 *OrganizationMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case organization.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case organization.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case organization.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case organization.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case organization.FieldMappingID: + return m.OldMappingID(ctx) + case organization.FieldTags: + return m.OldTags(ctx) + case organization.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case organization.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case organization.FieldName: + return m.OldName(ctx) + case organization.FieldDisplayName: + return m.OldDisplayName(ctx) + case organization.FieldDescription: + return m.OldDescription(ctx) + case organization.FieldParentOrganizationID: + return m.OldParentOrganizationID(ctx) + case organization.FieldPersonalOrg: + return m.OldPersonalOrg(ctx) + case organization.FieldAvatarRemoteURL: + return m.OldAvatarRemoteURL(ctx) + case organization.FieldDedicatedDb: + return m.OldDedicatedDb(ctx) + } + return nil, fmt.Errorf("unknown Organization 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 *OrganizationMutation) SetField(name string, value ent.Value) error { + switch name { + case organization.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case organization.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case organization.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case organization.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case organization.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case organization.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case organization.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case organization.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case organization.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case organization.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case organization.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case organization.FieldParentOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetParentOrganizationID(v) + return nil + case organization.FieldPersonalOrg: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPersonalOrg(v) + return nil + case organization.FieldAvatarRemoteURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarRemoteURL(v) + return nil + case organization.FieldDedicatedDb: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDedicatedDb(v) + return nil + } + return fmt.Errorf("unknown Organization field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OrganizationMutation) 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 *OrganizationMutation) 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 *OrganizationMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Organization numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OrganizationMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(organization.FieldCreatedAt) { + fields = append(fields, organization.FieldCreatedAt) + } + if m.FieldCleared(organization.FieldUpdatedAt) { + fields = append(fields, organization.FieldUpdatedAt) + } + if m.FieldCleared(organization.FieldCreatedBy) { + fields = append(fields, organization.FieldCreatedBy) + } + if m.FieldCleared(organization.FieldUpdatedBy) { + fields = append(fields, organization.FieldUpdatedBy) + } + if m.FieldCleared(organization.FieldTags) { + fields = append(fields, organization.FieldTags) + } + if m.FieldCleared(organization.FieldDeletedAt) { + fields = append(fields, organization.FieldDeletedAt) + } + if m.FieldCleared(organization.FieldDeletedBy) { + fields = append(fields, organization.FieldDeletedBy) + } + if m.FieldCleared(organization.FieldDescription) { + fields = append(fields, organization.FieldDescription) + } + if m.FieldCleared(organization.FieldParentOrganizationID) { + fields = append(fields, organization.FieldParentOrganizationID) + } + if m.FieldCleared(organization.FieldPersonalOrg) { + fields = append(fields, organization.FieldPersonalOrg) + } + if m.FieldCleared(organization.FieldAvatarRemoteURL) { + fields = append(fields, organization.FieldAvatarRemoteURL) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OrganizationMutation) 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 *OrganizationMutation) ClearField(name string) error { + switch name { + case organization.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case organization.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case organization.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case organization.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case organization.FieldTags: + m.ClearTags() + return nil + case organization.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case organization.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case organization.FieldDescription: + m.ClearDescription() + return nil + case organization.FieldParentOrganizationID: + m.ClearParentOrganizationID() + return nil + case organization.FieldPersonalOrg: + m.ClearPersonalOrg() + return nil + case organization.FieldAvatarRemoteURL: + m.ClearAvatarRemoteURL() + return nil + } + return fmt.Errorf("unknown Organization 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 *OrganizationMutation) ResetField(name string) error { + switch name { + case organization.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case organization.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case organization.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case organization.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case organization.FieldMappingID: + m.ResetMappingID() + return nil + case organization.FieldTags: + m.ResetTags() + return nil + case organization.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case organization.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case organization.FieldName: + m.ResetName() + return nil + case organization.FieldDisplayName: + m.ResetDisplayName() + return nil + case organization.FieldDescription: + m.ResetDescription() + return nil + case organization.FieldParentOrganizationID: + m.ResetParentOrganizationID() + return nil + case organization.FieldPersonalOrg: + m.ResetPersonalOrg() + return nil + case organization.FieldAvatarRemoteURL: + m.ResetAvatarRemoteURL() + return nil + case organization.FieldDedicatedDb: + m.ResetDedicatedDb() + return nil + } + return fmt.Errorf("unknown Organization field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OrganizationMutation) AddedEdges() []string { + edges := make([]string, 0, 27) + if m.parent != nil { + edges = append(edges, organization.EdgeParent) + } + if m.children != nil { + edges = append(edges, organization.EdgeChildren) + } + if m.groups != nil { + edges = append(edges, organization.EdgeGroups) + } + if m.templates != nil { + edges = append(edges, organization.EdgeTemplates) + } + if m.integrations != nil { + edges = append(edges, organization.EdgeIntegrations) + } + if m.setting != nil { + edges = append(edges, organization.EdgeSetting) + } + if m.documentdata != nil { + edges = append(edges, organization.EdgeDocumentdata) + } + if m.entitlements != nil { + edges = append(edges, organization.EdgeEntitlements) + } + if m.organization_entitlement != nil { + edges = append(edges, organization.EdgeOrganizationEntitlement) + } + if m.personal_access_tokens != nil { + edges = append(edges, organization.EdgePersonalAccessTokens) + } + if m.api_tokens != nil { + edges = append(edges, organization.EdgeAPITokens) + } + if m.oauthprovider != nil { + edges = append(edges, organization.EdgeOauthprovider) + } + if m.users != nil { + edges = append(edges, organization.EdgeUsers) + } + if m.invites != nil { + edges = append(edges, organization.EdgeInvites) + } + if m.subscribers != nil { + edges = append(edges, organization.EdgeSubscribers) + } + if m.webhooks != nil { + edges = append(edges, organization.EdgeWebhooks) + } + if m.events != nil { + edges = append(edges, organization.EdgeEvents) + } + if m.secrets != nil { + edges = append(edges, organization.EdgeSecrets) + } + if m.features != nil { + edges = append(edges, organization.EdgeFeatures) + } + if m.files != nil { + edges = append(edges, organization.EdgeFiles) + } + if m.entitlementplans != nil { + edges = append(edges, organization.EdgeEntitlementplans) + } + if m.entitlementplanfeatures != nil { + edges = append(edges, organization.EdgeEntitlementplanfeatures) + } + if m.entities != nil { + edges = append(edges, organization.EdgeEntities) + } + if m.entitytypes != nil { + edges = append(edges, organization.EdgeEntitytypes) + } + if m.contacts != nil { + edges = append(edges, organization.EdgeContacts) + } + if m.notes != nil { + edges = append(edges, organization.EdgeNotes) + } + if m.members != nil { + edges = append(edges, organization.EdgeMembers) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OrganizationMutation) AddedIDs(name string) []ent.Value { + switch name { + case organization.EdgeParent: + if id := m.parent; id != nil { + return []ent.Value{*id} + } + case organization.EdgeChildren: + ids := make([]ent.Value, 0, len(m.children)) + for id := range m.children { + ids = append(ids, id) + } + return ids + case organization.EdgeGroups: + ids := make([]ent.Value, 0, len(m.groups)) + for id := range m.groups { + ids = append(ids, id) + } + return ids + case organization.EdgeTemplates: + ids := make([]ent.Value, 0, len(m.templates)) + for id := range m.templates { + ids = append(ids, id) + } + return ids + case organization.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.integrations)) + for id := range m.integrations { + ids = append(ids, id) + } + return ids + case organization.EdgeSetting: + if id := m.setting; id != nil { + return []ent.Value{*id} + } + case organization.EdgeDocumentdata: + ids := make([]ent.Value, 0, len(m.documentdata)) + for id := range m.documentdata { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitlements: + ids := make([]ent.Value, 0, len(m.entitlements)) + for id := range m.entitlements { + ids = append(ids, id) + } + return ids + case organization.EdgeOrganizationEntitlement: + ids := make([]ent.Value, 0, len(m.organization_entitlement)) + for id := range m.organization_entitlement { + ids = append(ids, id) + } + return ids + case organization.EdgePersonalAccessTokens: + ids := make([]ent.Value, 0, len(m.personal_access_tokens)) + for id := range m.personal_access_tokens { + ids = append(ids, id) + } + return ids + case organization.EdgeAPITokens: + ids := make([]ent.Value, 0, len(m.api_tokens)) + for id := range m.api_tokens { + ids = append(ids, id) + } + return ids + case organization.EdgeOauthprovider: + ids := make([]ent.Value, 0, len(m.oauthprovider)) + for id := range m.oauthprovider { + ids = append(ids, id) + } + return ids + case organization.EdgeUsers: + ids := make([]ent.Value, 0, len(m.users)) + for id := range m.users { + ids = append(ids, id) + } + return ids + case organization.EdgeInvites: + ids := make([]ent.Value, 0, len(m.invites)) + for id := range m.invites { + ids = append(ids, id) + } + return ids + case organization.EdgeSubscribers: + ids := make([]ent.Value, 0, len(m.subscribers)) + for id := range m.subscribers { + ids = append(ids, id) + } + return ids + case organization.EdgeWebhooks: + ids := make([]ent.Value, 0, len(m.webhooks)) + for id := range m.webhooks { + ids = append(ids, id) + } + return ids + case organization.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + case organization.EdgeSecrets: + ids := make([]ent.Value, 0, len(m.secrets)) + for id := range m.secrets { + ids = append(ids, id) + } + return ids + case organization.EdgeFeatures: + ids := make([]ent.Value, 0, len(m.features)) + for id := range m.features { + ids = append(ids, id) + } + return ids + case organization.EdgeFiles: + ids := make([]ent.Value, 0, len(m.files)) + for id := range m.files { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitlementplans: + ids := make([]ent.Value, 0, len(m.entitlementplans)) + for id := range m.entitlementplans { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitlementplanfeatures: + ids := make([]ent.Value, 0, len(m.entitlementplanfeatures)) + for id := range m.entitlementplanfeatures { + ids = append(ids, id) + } + return ids + case organization.EdgeEntities: + ids := make([]ent.Value, 0, len(m.entities)) + for id := range m.entities { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitytypes: + ids := make([]ent.Value, 0, len(m.entitytypes)) + for id := range m.entitytypes { + ids = append(ids, id) + } + return ids + case organization.EdgeContacts: + ids := make([]ent.Value, 0, len(m.contacts)) + for id := range m.contacts { + ids = append(ids, id) + } + return ids + case organization.EdgeNotes: + ids := make([]ent.Value, 0, len(m.notes)) + for id := range m.notes { + ids = append(ids, id) + } + return ids + case organization.EdgeMembers: + ids := make([]ent.Value, 0, len(m.members)) + for id := range m.members { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OrganizationMutation) RemovedEdges() []string { + edges := make([]string, 0, 27) + if m.removedchildren != nil { + edges = append(edges, organization.EdgeChildren) + } + if m.removedgroups != nil { + edges = append(edges, organization.EdgeGroups) + } + if m.removedtemplates != nil { + edges = append(edges, organization.EdgeTemplates) + } + if m.removedintegrations != nil { + edges = append(edges, organization.EdgeIntegrations) + } + if m.removeddocumentdata != nil { + edges = append(edges, organization.EdgeDocumentdata) + } + if m.removedentitlements != nil { + edges = append(edges, organization.EdgeEntitlements) + } + if m.removedorganization_entitlement != nil { + edges = append(edges, organization.EdgeOrganizationEntitlement) + } + if m.removedpersonal_access_tokens != nil { + edges = append(edges, organization.EdgePersonalAccessTokens) + } + if m.removedapi_tokens != nil { + edges = append(edges, organization.EdgeAPITokens) + } + if m.removedoauthprovider != nil { + edges = append(edges, organization.EdgeOauthprovider) + } + if m.removedusers != nil { + edges = append(edges, organization.EdgeUsers) + } + if m.removedinvites != nil { + edges = append(edges, organization.EdgeInvites) + } + if m.removedsubscribers != nil { + edges = append(edges, organization.EdgeSubscribers) + } + if m.removedwebhooks != nil { + edges = append(edges, organization.EdgeWebhooks) + } + if m.removedevents != nil { + edges = append(edges, organization.EdgeEvents) + } + if m.removedsecrets != nil { + edges = append(edges, organization.EdgeSecrets) + } + if m.removedfeatures != nil { + edges = append(edges, organization.EdgeFeatures) + } + if m.removedfiles != nil { + edges = append(edges, organization.EdgeFiles) + } + if m.removedentitlementplans != nil { + edges = append(edges, organization.EdgeEntitlementplans) + } + if m.removedentitlementplanfeatures != nil { + edges = append(edges, organization.EdgeEntitlementplanfeatures) + } + if m.removedentities != nil { + edges = append(edges, organization.EdgeEntities) + } + if m.removedentitytypes != nil { + edges = append(edges, organization.EdgeEntitytypes) + } + if m.removedcontacts != nil { + edges = append(edges, organization.EdgeContacts) + } + if m.removednotes != nil { + edges = append(edges, organization.EdgeNotes) + } + if m.removedmembers != nil { + edges = append(edges, organization.EdgeMembers) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OrganizationMutation) RemovedIDs(name string) []ent.Value { + switch name { + case organization.EdgeChildren: + ids := make([]ent.Value, 0, len(m.removedchildren)) + for id := range m.removedchildren { + ids = append(ids, id) + } + return ids + case organization.EdgeGroups: + ids := make([]ent.Value, 0, len(m.removedgroups)) + for id := range m.removedgroups { + ids = append(ids, id) + } + return ids + case organization.EdgeTemplates: + ids := make([]ent.Value, 0, len(m.removedtemplates)) + for id := range m.removedtemplates { + ids = append(ids, id) + } + return ids + case organization.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.removedintegrations)) + for id := range m.removedintegrations { + ids = append(ids, id) + } + return ids + case organization.EdgeDocumentdata: + ids := make([]ent.Value, 0, len(m.removeddocumentdata)) + for id := range m.removeddocumentdata { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitlements: + ids := make([]ent.Value, 0, len(m.removedentitlements)) + for id := range m.removedentitlements { + ids = append(ids, id) + } + return ids + case organization.EdgeOrganizationEntitlement: + ids := make([]ent.Value, 0, len(m.removedorganization_entitlement)) + for id := range m.removedorganization_entitlement { + ids = append(ids, id) + } + return ids + case organization.EdgePersonalAccessTokens: + ids := make([]ent.Value, 0, len(m.removedpersonal_access_tokens)) + for id := range m.removedpersonal_access_tokens { + ids = append(ids, id) + } + return ids + case organization.EdgeAPITokens: + ids := make([]ent.Value, 0, len(m.removedapi_tokens)) + for id := range m.removedapi_tokens { + ids = append(ids, id) + } + return ids + case organization.EdgeOauthprovider: + ids := make([]ent.Value, 0, len(m.removedoauthprovider)) + for id := range m.removedoauthprovider { + ids = append(ids, id) + } + return ids + case organization.EdgeUsers: + ids := make([]ent.Value, 0, len(m.removedusers)) + for id := range m.removedusers { + ids = append(ids, id) + } + return ids + case organization.EdgeInvites: + ids := make([]ent.Value, 0, len(m.removedinvites)) + for id := range m.removedinvites { + ids = append(ids, id) + } + return ids + case organization.EdgeSubscribers: + ids := make([]ent.Value, 0, len(m.removedsubscribers)) + for id := range m.removedsubscribers { + ids = append(ids, id) + } + return ids + case organization.EdgeWebhooks: + ids := make([]ent.Value, 0, len(m.removedwebhooks)) + for id := range m.removedwebhooks { + ids = append(ids, id) + } + return ids + case organization.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + case organization.EdgeSecrets: + ids := make([]ent.Value, 0, len(m.removedsecrets)) + for id := range m.removedsecrets { + ids = append(ids, id) + } + return ids + case organization.EdgeFeatures: + ids := make([]ent.Value, 0, len(m.removedfeatures)) + for id := range m.removedfeatures { + ids = append(ids, id) + } + return ids + case organization.EdgeFiles: + ids := make([]ent.Value, 0, len(m.removedfiles)) + for id := range m.removedfiles { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitlementplans: + ids := make([]ent.Value, 0, len(m.removedentitlementplans)) + for id := range m.removedentitlementplans { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitlementplanfeatures: + ids := make([]ent.Value, 0, len(m.removedentitlementplanfeatures)) + for id := range m.removedentitlementplanfeatures { + ids = append(ids, id) + } + return ids + case organization.EdgeEntities: + ids := make([]ent.Value, 0, len(m.removedentities)) + for id := range m.removedentities { + ids = append(ids, id) + } + return ids + case organization.EdgeEntitytypes: + ids := make([]ent.Value, 0, len(m.removedentitytypes)) + for id := range m.removedentitytypes { + ids = append(ids, id) + } + return ids + case organization.EdgeContacts: + ids := make([]ent.Value, 0, len(m.removedcontacts)) + for id := range m.removedcontacts { + ids = append(ids, id) + } + return ids + case organization.EdgeNotes: + ids := make([]ent.Value, 0, len(m.removednotes)) + for id := range m.removednotes { + ids = append(ids, id) + } + return ids + case organization.EdgeMembers: + ids := make([]ent.Value, 0, len(m.removedmembers)) + for id := range m.removedmembers { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OrganizationMutation) ClearedEdges() []string { + edges := make([]string, 0, 27) + if m.clearedparent { + edges = append(edges, organization.EdgeParent) + } + if m.clearedchildren { + edges = append(edges, organization.EdgeChildren) + } + if m.clearedgroups { + edges = append(edges, organization.EdgeGroups) + } + if m.clearedtemplates { + edges = append(edges, organization.EdgeTemplates) + } + if m.clearedintegrations { + edges = append(edges, organization.EdgeIntegrations) + } + if m.clearedsetting { + edges = append(edges, organization.EdgeSetting) + } + if m.cleareddocumentdata { + edges = append(edges, organization.EdgeDocumentdata) + } + if m.clearedentitlements { + edges = append(edges, organization.EdgeEntitlements) + } + if m.clearedorganization_entitlement { + edges = append(edges, organization.EdgeOrganizationEntitlement) + } + if m.clearedpersonal_access_tokens { + edges = append(edges, organization.EdgePersonalAccessTokens) + } + if m.clearedapi_tokens { + edges = append(edges, organization.EdgeAPITokens) + } + if m.clearedoauthprovider { + edges = append(edges, organization.EdgeOauthprovider) + } + if m.clearedusers { + edges = append(edges, organization.EdgeUsers) + } + if m.clearedinvites { + edges = append(edges, organization.EdgeInvites) + } + if m.clearedsubscribers { + edges = append(edges, organization.EdgeSubscribers) + } + if m.clearedwebhooks { + edges = append(edges, organization.EdgeWebhooks) + } + if m.clearedevents { + edges = append(edges, organization.EdgeEvents) + } + if m.clearedsecrets { + edges = append(edges, organization.EdgeSecrets) + } + if m.clearedfeatures { + edges = append(edges, organization.EdgeFeatures) + } + if m.clearedfiles { + edges = append(edges, organization.EdgeFiles) + } + if m.clearedentitlementplans { + edges = append(edges, organization.EdgeEntitlementplans) + } + if m.clearedentitlementplanfeatures { + edges = append(edges, organization.EdgeEntitlementplanfeatures) + } + if m.clearedentities { + edges = append(edges, organization.EdgeEntities) + } + if m.clearedentitytypes { + edges = append(edges, organization.EdgeEntitytypes) + } + if m.clearedcontacts { + edges = append(edges, organization.EdgeContacts) + } + if m.clearednotes { + edges = append(edges, organization.EdgeNotes) + } + if m.clearedmembers { + edges = append(edges, organization.EdgeMembers) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OrganizationMutation) EdgeCleared(name string) bool { + switch name { + case organization.EdgeParent: + return m.clearedparent + case organization.EdgeChildren: + return m.clearedchildren + case organization.EdgeGroups: + return m.clearedgroups + case organization.EdgeTemplates: + return m.clearedtemplates + case organization.EdgeIntegrations: + return m.clearedintegrations + case organization.EdgeSetting: + return m.clearedsetting + case organization.EdgeDocumentdata: + return m.cleareddocumentdata + case organization.EdgeEntitlements: + return m.clearedentitlements + case organization.EdgeOrganizationEntitlement: + return m.clearedorganization_entitlement + case organization.EdgePersonalAccessTokens: + return m.clearedpersonal_access_tokens + case organization.EdgeAPITokens: + return m.clearedapi_tokens + case organization.EdgeOauthprovider: + return m.clearedoauthprovider + case organization.EdgeUsers: + return m.clearedusers + case organization.EdgeInvites: + return m.clearedinvites + case organization.EdgeSubscribers: + return m.clearedsubscribers + case organization.EdgeWebhooks: + return m.clearedwebhooks + case organization.EdgeEvents: + return m.clearedevents + case organization.EdgeSecrets: + return m.clearedsecrets + case organization.EdgeFeatures: + return m.clearedfeatures + case organization.EdgeFiles: + return m.clearedfiles + case organization.EdgeEntitlementplans: + return m.clearedentitlementplans + case organization.EdgeEntitlementplanfeatures: + return m.clearedentitlementplanfeatures + case organization.EdgeEntities: + return m.clearedentities + case organization.EdgeEntitytypes: + return m.clearedentitytypes + case organization.EdgeContacts: + return m.clearedcontacts + case organization.EdgeNotes: + return m.clearednotes + case organization.EdgeMembers: + return m.clearedmembers + } + 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 *OrganizationMutation) ClearEdge(name string) error { + switch name { + case organization.EdgeParent: + m.ClearParent() + return nil + case organization.EdgeSetting: + m.ClearSetting() + return nil + } + return fmt.Errorf("unknown Organization 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 *OrganizationMutation) ResetEdge(name string) error { + switch name { + case organization.EdgeParent: + m.ResetParent() + return nil + case organization.EdgeChildren: + m.ResetChildren() + return nil + case organization.EdgeGroups: + m.ResetGroups() + return nil + case organization.EdgeTemplates: + m.ResetTemplates() + return nil + case organization.EdgeIntegrations: + m.ResetIntegrations() + return nil + case organization.EdgeSetting: + m.ResetSetting() + return nil + case organization.EdgeDocumentdata: + m.ResetDocumentdata() + return nil + case organization.EdgeEntitlements: + m.ResetEntitlements() + return nil + case organization.EdgeOrganizationEntitlement: + m.ResetOrganizationEntitlement() + return nil + case organization.EdgePersonalAccessTokens: + m.ResetPersonalAccessTokens() + return nil + case organization.EdgeAPITokens: + m.ResetAPITokens() + return nil + case organization.EdgeOauthprovider: + m.ResetOauthprovider() + return nil + case organization.EdgeUsers: + m.ResetUsers() + return nil + case organization.EdgeInvites: + m.ResetInvites() + return nil + case organization.EdgeSubscribers: + m.ResetSubscribers() + return nil + case organization.EdgeWebhooks: + m.ResetWebhooks() + return nil + case organization.EdgeEvents: + m.ResetEvents() + return nil + case organization.EdgeSecrets: + m.ResetSecrets() + return nil + case organization.EdgeFeatures: + m.ResetFeatures() + return nil + case organization.EdgeFiles: + m.ResetFiles() + return nil + case organization.EdgeEntitlementplans: + m.ResetEntitlementplans() + return nil + case organization.EdgeEntitlementplanfeatures: + m.ResetEntitlementplanfeatures() + return nil + case organization.EdgeEntities: + m.ResetEntities() + return nil + case organization.EdgeEntitytypes: + m.ResetEntitytypes() + return nil + case organization.EdgeContacts: + m.ResetContacts() + return nil + case organization.EdgeNotes: + m.ResetNotes() + return nil + case organization.EdgeMembers: + m.ResetMembers() + return nil + } + return fmt.Errorf("unknown Organization edge %s", name) +} + +// OrganizationHistoryMutation represents an operation that mutates the OrganizationHistory nodes in the graph. +type OrganizationHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + name *string + display_name *string + description *string + parent_organization_id *string + personal_org *bool + avatar_remote_url *string + dedicated_db *bool + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*OrganizationHistory, error) + predicates []predicate.OrganizationHistory +} + +var _ ent.Mutation = (*OrganizationHistoryMutation)(nil) + +// organizationhistoryOption allows management of the mutation configuration using functional options. +type organizationhistoryOption func(*OrganizationHistoryMutation) + +// newOrganizationHistoryMutation creates new mutation for the OrganizationHistory entity. +func newOrganizationHistoryMutation(c config, op Op, opts ...organizationhistoryOption) *OrganizationHistoryMutation { + m := &OrganizationHistoryMutation{ + config: c, + op: op, + typ: TypeOrganizationHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOrganizationHistoryID sets the ID field of the mutation. +func withOrganizationHistoryID(id string) organizationhistoryOption { + return func(m *OrganizationHistoryMutation) { + var ( + err error + once sync.Once + value *OrganizationHistory + ) + m.oldValue = func(ctx context.Context) (*OrganizationHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OrganizationHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOrganizationHistory sets the old OrganizationHistory of the mutation. +func withOrganizationHistory(node *OrganizationHistory) organizationhistoryOption { + return func(m *OrganizationHistoryMutation) { + m.oldValue = func(context.Context) (*OrganizationHistory, 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 OrganizationHistoryMutation) 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 OrganizationHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OrganizationHistory entities. +func (m *OrganizationHistoryMutation) SetID(id string) { + 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 *OrganizationHistoryMutation) ID() (id string, 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 *OrganizationHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OrganizationHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *OrganizationHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *OrganizationHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *OrganizationHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *OrganizationHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *OrganizationHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *OrganizationHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[organizationhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *OrganizationHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, organizationhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *OrganizationHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *OrganizationHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *OrganizationHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *OrganizationHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OrganizationHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OrganizationHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[organizationhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OrganizationHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, organizationhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OrganizationHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OrganizationHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OrganizationHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[organizationhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OrganizationHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, organizationhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OrganizationHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OrganizationHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OrganizationHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[organizationhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OrganizationHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, organizationhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OrganizationHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OrganizationHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OrganizationHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[organizationhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OrganizationHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, organizationhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OrganizationHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OrganizationHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OrganizationHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *OrganizationHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *OrganizationHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *OrganizationHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *OrganizationHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *OrganizationHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[organizationhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *OrganizationHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, organizationhistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OrganizationHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OrganizationHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OrganizationHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[organizationhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OrganizationHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, organizationhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OrganizationHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OrganizationHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OrganizationHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[organizationhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OrganizationHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, organizationhistory.FieldDeletedBy) +} + +// SetName sets the "name" field. +func (m *OrganizationHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *OrganizationHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *OrganizationHistoryMutation) ResetName() { + m.name = nil +} + +// SetDisplayName sets the "display_name" field. +func (m *OrganizationHistoryMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *OrganizationHistoryMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *OrganizationHistoryMutation) ResetDisplayName() { + m.display_name = nil +} + +// SetDescription sets the "description" field. +func (m *OrganizationHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *OrganizationHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *OrganizationHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[organizationhistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *OrganizationHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, organizationhistory.FieldDescription) +} + +// SetParentOrganizationID sets the "parent_organization_id" field. +func (m *OrganizationHistoryMutation) SetParentOrganizationID(s string) { + m.parent_organization_id = &s +} + +// ParentOrganizationID returns the value of the "parent_organization_id" field in the mutation. +func (m *OrganizationHistoryMutation) ParentOrganizationID() (r string, exists bool) { + v := m.parent_organization_id + if v == nil { + return + } + return *v, true +} + +// OldParentOrganizationID returns the old "parent_organization_id" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldParentOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldParentOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldParentOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldParentOrganizationID: %w", err) + } + return oldValue.ParentOrganizationID, nil +} + +// ClearParentOrganizationID clears the value of the "parent_organization_id" field. +func (m *OrganizationHistoryMutation) ClearParentOrganizationID() { + m.parent_organization_id = nil + m.clearedFields[organizationhistory.FieldParentOrganizationID] = struct{}{} +} + +// ParentOrganizationIDCleared returns if the "parent_organization_id" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) ParentOrganizationIDCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldParentOrganizationID] + return ok +} + +// ResetParentOrganizationID resets all changes to the "parent_organization_id" field. +func (m *OrganizationHistoryMutation) ResetParentOrganizationID() { + m.parent_organization_id = nil + delete(m.clearedFields, organizationhistory.FieldParentOrganizationID) +} + +// SetPersonalOrg sets the "personal_org" field. +func (m *OrganizationHistoryMutation) SetPersonalOrg(b bool) { + m.personal_org = &b +} + +// PersonalOrg returns the value of the "personal_org" field in the mutation. +func (m *OrganizationHistoryMutation) PersonalOrg() (r bool, exists bool) { + v := m.personal_org + if v == nil { + return + } + return *v, true +} + +// OldPersonalOrg returns the old "personal_org" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldPersonalOrg(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPersonalOrg is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPersonalOrg requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPersonalOrg: %w", err) + } + return oldValue.PersonalOrg, nil +} + +// ClearPersonalOrg clears the value of the "personal_org" field. +func (m *OrganizationHistoryMutation) ClearPersonalOrg() { + m.personal_org = nil + m.clearedFields[organizationhistory.FieldPersonalOrg] = struct{}{} +} + +// PersonalOrgCleared returns if the "personal_org" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) PersonalOrgCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldPersonalOrg] + return ok +} + +// ResetPersonalOrg resets all changes to the "personal_org" field. +func (m *OrganizationHistoryMutation) ResetPersonalOrg() { + m.personal_org = nil + delete(m.clearedFields, organizationhistory.FieldPersonalOrg) +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (m *OrganizationHistoryMutation) SetAvatarRemoteURL(s string) { + m.avatar_remote_url = &s +} + +// AvatarRemoteURL returns the value of the "avatar_remote_url" field in the mutation. +func (m *OrganizationHistoryMutation) AvatarRemoteURL() (r string, exists bool) { + v := m.avatar_remote_url + if v == nil { + return + } + return *v, true +} + +// OldAvatarRemoteURL returns the old "avatar_remote_url" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldAvatarRemoteURL(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarRemoteURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarRemoteURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarRemoteURL: %w", err) + } + return oldValue.AvatarRemoteURL, nil +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (m *OrganizationHistoryMutation) ClearAvatarRemoteURL() { + m.avatar_remote_url = nil + m.clearedFields[organizationhistory.FieldAvatarRemoteURL] = struct{}{} +} + +// AvatarRemoteURLCleared returns if the "avatar_remote_url" field was cleared in this mutation. +func (m *OrganizationHistoryMutation) AvatarRemoteURLCleared() bool { + _, ok := m.clearedFields[organizationhistory.FieldAvatarRemoteURL] + return ok +} + +// ResetAvatarRemoteURL resets all changes to the "avatar_remote_url" field. +func (m *OrganizationHistoryMutation) ResetAvatarRemoteURL() { + m.avatar_remote_url = nil + delete(m.clearedFields, organizationhistory.FieldAvatarRemoteURL) +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (m *OrganizationHistoryMutation) SetDedicatedDb(b bool) { + m.dedicated_db = &b +} + +// DedicatedDb returns the value of the "dedicated_db" field in the mutation. +func (m *OrganizationHistoryMutation) DedicatedDb() (r bool, exists bool) { + v := m.dedicated_db + if v == nil { + return + } + return *v, true +} + +// OldDedicatedDb returns the old "dedicated_db" field's value of the OrganizationHistory entity. +// If the OrganizationHistory 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 *OrganizationHistoryMutation) OldDedicatedDb(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDedicatedDb is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDedicatedDb requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDedicatedDb: %w", err) + } + return oldValue.DedicatedDb, nil +} + +// ResetDedicatedDb resets all changes to the "dedicated_db" field. +func (m *OrganizationHistoryMutation) ResetDedicatedDb() { + m.dedicated_db = nil +} + +// Where appends a list predicates to the OrganizationHistoryMutation builder. +func (m *OrganizationHistoryMutation) Where(ps ...predicate.OrganizationHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OrganizationHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OrganizationHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OrganizationHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OrganizationHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OrganizationHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OrganizationHistory). +func (m *OrganizationHistoryMutation) 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 *OrganizationHistoryMutation) Fields() []string { + fields := make([]string, 0, 18) + if m.history_time != nil { + fields = append(fields, organizationhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, organizationhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, organizationhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, organizationhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, organizationhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, organizationhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, organizationhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, organizationhistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, organizationhistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, organizationhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, organizationhistory.FieldDeletedBy) + } + if m.name != nil { + fields = append(fields, organizationhistory.FieldName) + } + if m.display_name != nil { + fields = append(fields, organizationhistory.FieldDisplayName) + } + if m.description != nil { + fields = append(fields, organizationhistory.FieldDescription) + } + if m.parent_organization_id != nil { + fields = append(fields, organizationhistory.FieldParentOrganizationID) + } + if m.personal_org != nil { + fields = append(fields, organizationhistory.FieldPersonalOrg) + } + if m.avatar_remote_url != nil { + fields = append(fields, organizationhistory.FieldAvatarRemoteURL) + } + if m.dedicated_db != nil { + fields = append(fields, organizationhistory.FieldDedicatedDb) + } + 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 *OrganizationHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case organizationhistory.FieldHistoryTime: + return m.HistoryTime() + case organizationhistory.FieldRef: + return m.Ref() + case organizationhistory.FieldOperation: + return m.Operation() + case organizationhistory.FieldCreatedAt: + return m.CreatedAt() + case organizationhistory.FieldUpdatedAt: + return m.UpdatedAt() + case organizationhistory.FieldCreatedBy: + return m.CreatedBy() + case organizationhistory.FieldUpdatedBy: + return m.UpdatedBy() + case organizationhistory.FieldMappingID: + return m.MappingID() + case organizationhistory.FieldTags: + return m.Tags() + case organizationhistory.FieldDeletedAt: + return m.DeletedAt() + case organizationhistory.FieldDeletedBy: + return m.DeletedBy() + case organizationhistory.FieldName: + return m.Name() + case organizationhistory.FieldDisplayName: + return m.DisplayName() + case organizationhistory.FieldDescription: + return m.Description() + case organizationhistory.FieldParentOrganizationID: + return m.ParentOrganizationID() + case organizationhistory.FieldPersonalOrg: + return m.PersonalOrg() + case organizationhistory.FieldAvatarRemoteURL: + return m.AvatarRemoteURL() + case organizationhistory.FieldDedicatedDb: + return m.DedicatedDb() + } + 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 *OrganizationHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case organizationhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case organizationhistory.FieldRef: + return m.OldRef(ctx) + case organizationhistory.FieldOperation: + return m.OldOperation(ctx) + case organizationhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case organizationhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case organizationhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case organizationhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case organizationhistory.FieldMappingID: + return m.OldMappingID(ctx) + case organizationhistory.FieldTags: + return m.OldTags(ctx) + case organizationhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case organizationhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case organizationhistory.FieldName: + return m.OldName(ctx) + case organizationhistory.FieldDisplayName: + return m.OldDisplayName(ctx) + case organizationhistory.FieldDescription: + return m.OldDescription(ctx) + case organizationhistory.FieldParentOrganizationID: + return m.OldParentOrganizationID(ctx) + case organizationhistory.FieldPersonalOrg: + return m.OldPersonalOrg(ctx) + case organizationhistory.FieldAvatarRemoteURL: + return m.OldAvatarRemoteURL(ctx) + case organizationhistory.FieldDedicatedDb: + return m.OldDedicatedDb(ctx) + } + return nil, fmt.Errorf("unknown OrganizationHistory 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 *OrganizationHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case organizationhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case organizationhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case organizationhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case organizationhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case organizationhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case organizationhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case organizationhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case organizationhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case organizationhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case organizationhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case organizationhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case organizationhistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case organizationhistory.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case organizationhistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case organizationhistory.FieldParentOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetParentOrganizationID(v) + return nil + case organizationhistory.FieldPersonalOrg: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPersonalOrg(v) + return nil + case organizationhistory.FieldAvatarRemoteURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarRemoteURL(v) + return nil + case organizationhistory.FieldDedicatedDb: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDedicatedDb(v) + return nil + } + return fmt.Errorf("unknown OrganizationHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OrganizationHistoryMutation) 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 *OrganizationHistoryMutation) 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 *OrganizationHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown OrganizationHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OrganizationHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(organizationhistory.FieldRef) { + fields = append(fields, organizationhistory.FieldRef) + } + if m.FieldCleared(organizationhistory.FieldCreatedAt) { + fields = append(fields, organizationhistory.FieldCreatedAt) + } + if m.FieldCleared(organizationhistory.FieldUpdatedAt) { + fields = append(fields, organizationhistory.FieldUpdatedAt) + } + if m.FieldCleared(organizationhistory.FieldCreatedBy) { + fields = append(fields, organizationhistory.FieldCreatedBy) + } + if m.FieldCleared(organizationhistory.FieldUpdatedBy) { + fields = append(fields, organizationhistory.FieldUpdatedBy) + } + if m.FieldCleared(organizationhistory.FieldTags) { + fields = append(fields, organizationhistory.FieldTags) + } + if m.FieldCleared(organizationhistory.FieldDeletedAt) { + fields = append(fields, organizationhistory.FieldDeletedAt) + } + if m.FieldCleared(organizationhistory.FieldDeletedBy) { + fields = append(fields, organizationhistory.FieldDeletedBy) + } + if m.FieldCleared(organizationhistory.FieldDescription) { + fields = append(fields, organizationhistory.FieldDescription) + } + if m.FieldCleared(organizationhistory.FieldParentOrganizationID) { + fields = append(fields, organizationhistory.FieldParentOrganizationID) + } + if m.FieldCleared(organizationhistory.FieldPersonalOrg) { + fields = append(fields, organizationhistory.FieldPersonalOrg) + } + if m.FieldCleared(organizationhistory.FieldAvatarRemoteURL) { + fields = append(fields, organizationhistory.FieldAvatarRemoteURL) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OrganizationHistoryMutation) 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 *OrganizationHistoryMutation) ClearField(name string) error { + switch name { + case organizationhistory.FieldRef: + m.ClearRef() + return nil + case organizationhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case organizationhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case organizationhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case organizationhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case organizationhistory.FieldTags: + m.ClearTags() + return nil + case organizationhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case organizationhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case organizationhistory.FieldDescription: + m.ClearDescription() + return nil + case organizationhistory.FieldParentOrganizationID: + m.ClearParentOrganizationID() + return nil + case organizationhistory.FieldPersonalOrg: + m.ClearPersonalOrg() + return nil + case organizationhistory.FieldAvatarRemoteURL: + m.ClearAvatarRemoteURL() + return nil + } + return fmt.Errorf("unknown OrganizationHistory 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 *OrganizationHistoryMutation) ResetField(name string) error { + switch name { + case organizationhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case organizationhistory.FieldRef: + m.ResetRef() + return nil + case organizationhistory.FieldOperation: + m.ResetOperation() + return nil + case organizationhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case organizationhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case organizationhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case organizationhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case organizationhistory.FieldMappingID: + m.ResetMappingID() + return nil + case organizationhistory.FieldTags: + m.ResetTags() + return nil + case organizationhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case organizationhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case organizationhistory.FieldName: + m.ResetName() + return nil + case organizationhistory.FieldDisplayName: + m.ResetDisplayName() + return nil + case organizationhistory.FieldDescription: + m.ResetDescription() + return nil + case organizationhistory.FieldParentOrganizationID: + m.ResetParentOrganizationID() + return nil + case organizationhistory.FieldPersonalOrg: + m.ResetPersonalOrg() + return nil + case organizationhistory.FieldAvatarRemoteURL: + m.ResetAvatarRemoteURL() + return nil + case organizationhistory.FieldDedicatedDb: + m.ResetDedicatedDb() + return nil + } + return fmt.Errorf("unknown OrganizationHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OrganizationHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OrganizationHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OrganizationHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OrganizationHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OrganizationHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OrganizationHistoryMutation) EdgeCleared(name string) bool { + 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 *OrganizationHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown OrganizationHistory 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 *OrganizationHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown OrganizationHistory edge %s", name) +} + +// OrganizationSettingMutation represents an operation that mutates the OrganizationSetting nodes in the graph. +type OrganizationSettingMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + domains *[]string + appenddomains []string + billing_contact *string + billing_email *string + billing_phone *string + billing_address *string + tax_identifier *string + geo_location *enums.Region + clearedFields map[string]struct{} + organization *string + clearedorganization bool + done bool + oldValue func(context.Context) (*OrganizationSetting, error) + predicates []predicate.OrganizationSetting +} + +var _ ent.Mutation = (*OrganizationSettingMutation)(nil) + +// organizationsettingOption allows management of the mutation configuration using functional options. +type organizationsettingOption func(*OrganizationSettingMutation) + +// newOrganizationSettingMutation creates new mutation for the OrganizationSetting entity. +func newOrganizationSettingMutation(c config, op Op, opts ...organizationsettingOption) *OrganizationSettingMutation { + m := &OrganizationSettingMutation{ + config: c, + op: op, + typ: TypeOrganizationSetting, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOrganizationSettingID sets the ID field of the mutation. +func withOrganizationSettingID(id string) organizationsettingOption { + return func(m *OrganizationSettingMutation) { + var ( + err error + once sync.Once + value *OrganizationSetting + ) + m.oldValue = func(ctx context.Context) (*OrganizationSetting, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OrganizationSetting.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOrganizationSetting sets the old OrganizationSetting of the mutation. +func withOrganizationSetting(node *OrganizationSetting) organizationsettingOption { + return func(m *OrganizationSettingMutation) { + m.oldValue = func(context.Context) (*OrganizationSetting, 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 OrganizationSettingMutation) 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 OrganizationSettingMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OrganizationSetting entities. +func (m *OrganizationSettingMutation) SetID(id string) { + 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 *OrganizationSettingMutation) ID() (id string, 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 *OrganizationSettingMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OrganizationSetting.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *OrganizationSettingMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OrganizationSettingMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OrganizationSettingMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[organizationsetting.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OrganizationSettingMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OrganizationSettingMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, organizationsetting.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OrganizationSettingMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OrganizationSettingMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OrganizationSettingMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[organizationsetting.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OrganizationSettingMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OrganizationSettingMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, organizationsetting.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OrganizationSettingMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OrganizationSettingMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OrganizationSettingMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[organizationsetting.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OrganizationSettingMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OrganizationSettingMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, organizationsetting.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OrganizationSettingMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OrganizationSettingMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OrganizationSettingMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[organizationsetting.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OrganizationSettingMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OrganizationSettingMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, organizationsetting.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OrganizationSettingMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OrganizationSettingMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OrganizationSettingMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *OrganizationSettingMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *OrganizationSettingMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *OrganizationSettingMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *OrganizationSettingMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *OrganizationSettingMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[organizationsetting.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *OrganizationSettingMutation) TagsCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *OrganizationSettingMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, organizationsetting.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OrganizationSettingMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OrganizationSettingMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OrganizationSettingMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[organizationsetting.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OrganizationSettingMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OrganizationSettingMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, organizationsetting.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OrganizationSettingMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OrganizationSettingMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OrganizationSettingMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[organizationsetting.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OrganizationSettingMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OrganizationSettingMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, organizationsetting.FieldDeletedBy) +} + +// SetDomains sets the "domains" field. +func (m *OrganizationSettingMutation) SetDomains(s []string) { + m.domains = &s + m.appenddomains = nil +} + +// Domains returns the value of the "domains" field in the mutation. +func (m *OrganizationSettingMutation) Domains() (r []string, exists bool) { + v := m.domains + if v == nil { + return + } + return *v, true +} + +// OldDomains returns the old "domains" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldDomains(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDomains is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDomains requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDomains: %w", err) + } + return oldValue.Domains, nil +} + +// AppendDomains adds s to the "domains" field. +func (m *OrganizationSettingMutation) AppendDomains(s []string) { + m.appenddomains = append(m.appenddomains, s...) +} + +// AppendedDomains returns the list of values that were appended to the "domains" field in this mutation. +func (m *OrganizationSettingMutation) AppendedDomains() ([]string, bool) { + if len(m.appenddomains) == 0 { + return nil, false + } + return m.appenddomains, true +} + +// ClearDomains clears the value of the "domains" field. +func (m *OrganizationSettingMutation) ClearDomains() { + m.domains = nil + m.appenddomains = nil + m.clearedFields[organizationsetting.FieldDomains] = struct{}{} +} + +// DomainsCleared returns if the "domains" field was cleared in this mutation. +func (m *OrganizationSettingMutation) DomainsCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldDomains] + return ok +} + +// ResetDomains resets all changes to the "domains" field. +func (m *OrganizationSettingMutation) ResetDomains() { + m.domains = nil + m.appenddomains = nil + delete(m.clearedFields, organizationsetting.FieldDomains) +} + +// SetBillingContact sets the "billing_contact" field. +func (m *OrganizationSettingMutation) SetBillingContact(s string) { + m.billing_contact = &s +} + +// BillingContact returns the value of the "billing_contact" field in the mutation. +func (m *OrganizationSettingMutation) BillingContact() (r string, exists bool) { + v := m.billing_contact + if v == nil { + return + } + return *v, true +} + +// OldBillingContact returns the old "billing_contact" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldBillingContact(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingContact is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingContact requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingContact: %w", err) + } + return oldValue.BillingContact, nil +} + +// ClearBillingContact clears the value of the "billing_contact" field. +func (m *OrganizationSettingMutation) ClearBillingContact() { + m.billing_contact = nil + m.clearedFields[organizationsetting.FieldBillingContact] = struct{}{} +} + +// BillingContactCleared returns if the "billing_contact" field was cleared in this mutation. +func (m *OrganizationSettingMutation) BillingContactCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldBillingContact] + return ok +} + +// ResetBillingContact resets all changes to the "billing_contact" field. +func (m *OrganizationSettingMutation) ResetBillingContact() { + m.billing_contact = nil + delete(m.clearedFields, organizationsetting.FieldBillingContact) +} + +// SetBillingEmail sets the "billing_email" field. +func (m *OrganizationSettingMutation) SetBillingEmail(s string) { + m.billing_email = &s +} + +// BillingEmail returns the value of the "billing_email" field in the mutation. +func (m *OrganizationSettingMutation) BillingEmail() (r string, exists bool) { + v := m.billing_email + if v == nil { + return + } + return *v, true +} + +// OldBillingEmail returns the old "billing_email" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldBillingEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingEmail: %w", err) + } + return oldValue.BillingEmail, nil +} + +// ClearBillingEmail clears the value of the "billing_email" field. +func (m *OrganizationSettingMutation) ClearBillingEmail() { + m.billing_email = nil + m.clearedFields[organizationsetting.FieldBillingEmail] = struct{}{} +} + +// BillingEmailCleared returns if the "billing_email" field was cleared in this mutation. +func (m *OrganizationSettingMutation) BillingEmailCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldBillingEmail] + return ok +} + +// ResetBillingEmail resets all changes to the "billing_email" field. +func (m *OrganizationSettingMutation) ResetBillingEmail() { + m.billing_email = nil + delete(m.clearedFields, organizationsetting.FieldBillingEmail) +} + +// SetBillingPhone sets the "billing_phone" field. +func (m *OrganizationSettingMutation) SetBillingPhone(s string) { + m.billing_phone = &s +} + +// BillingPhone returns the value of the "billing_phone" field in the mutation. +func (m *OrganizationSettingMutation) BillingPhone() (r string, exists bool) { + v := m.billing_phone + if v == nil { + return + } + return *v, true +} + +// OldBillingPhone returns the old "billing_phone" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldBillingPhone(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingPhone is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingPhone requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingPhone: %w", err) + } + return oldValue.BillingPhone, nil +} + +// ClearBillingPhone clears the value of the "billing_phone" field. +func (m *OrganizationSettingMutation) ClearBillingPhone() { + m.billing_phone = nil + m.clearedFields[organizationsetting.FieldBillingPhone] = struct{}{} +} + +// BillingPhoneCleared returns if the "billing_phone" field was cleared in this mutation. +func (m *OrganizationSettingMutation) BillingPhoneCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldBillingPhone] + return ok +} + +// ResetBillingPhone resets all changes to the "billing_phone" field. +func (m *OrganizationSettingMutation) ResetBillingPhone() { + m.billing_phone = nil + delete(m.clearedFields, organizationsetting.FieldBillingPhone) +} + +// SetBillingAddress sets the "billing_address" field. +func (m *OrganizationSettingMutation) SetBillingAddress(s string) { + m.billing_address = &s +} + +// BillingAddress returns the value of the "billing_address" field in the mutation. +func (m *OrganizationSettingMutation) BillingAddress() (r string, exists bool) { + v := m.billing_address + if v == nil { + return + } + return *v, true +} + +// OldBillingAddress returns the old "billing_address" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldBillingAddress(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingAddress is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingAddress: %w", err) + } + return oldValue.BillingAddress, nil +} + +// ClearBillingAddress clears the value of the "billing_address" field. +func (m *OrganizationSettingMutation) ClearBillingAddress() { + m.billing_address = nil + m.clearedFields[organizationsetting.FieldBillingAddress] = struct{}{} +} + +// BillingAddressCleared returns if the "billing_address" field was cleared in this mutation. +func (m *OrganizationSettingMutation) BillingAddressCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldBillingAddress] + return ok +} + +// ResetBillingAddress resets all changes to the "billing_address" field. +func (m *OrganizationSettingMutation) ResetBillingAddress() { + m.billing_address = nil + delete(m.clearedFields, organizationsetting.FieldBillingAddress) +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (m *OrganizationSettingMutation) SetTaxIdentifier(s string) { + m.tax_identifier = &s +} + +// TaxIdentifier returns the value of the "tax_identifier" field in the mutation. +func (m *OrganizationSettingMutation) TaxIdentifier() (r string, exists bool) { + v := m.tax_identifier + if v == nil { + return + } + return *v, true +} + +// OldTaxIdentifier returns the old "tax_identifier" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldTaxIdentifier(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTaxIdentifier is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTaxIdentifier requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTaxIdentifier: %w", err) + } + return oldValue.TaxIdentifier, nil +} + +// ClearTaxIdentifier clears the value of the "tax_identifier" field. +func (m *OrganizationSettingMutation) ClearTaxIdentifier() { + m.tax_identifier = nil + m.clearedFields[organizationsetting.FieldTaxIdentifier] = struct{}{} +} + +// TaxIdentifierCleared returns if the "tax_identifier" field was cleared in this mutation. +func (m *OrganizationSettingMutation) TaxIdentifierCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldTaxIdentifier] + return ok +} + +// ResetTaxIdentifier resets all changes to the "tax_identifier" field. +func (m *OrganizationSettingMutation) ResetTaxIdentifier() { + m.tax_identifier = nil + delete(m.clearedFields, organizationsetting.FieldTaxIdentifier) +} + +// SetGeoLocation sets the "geo_location" field. +func (m *OrganizationSettingMutation) SetGeoLocation(e enums.Region) { + m.geo_location = &e +} + +// GeoLocation returns the value of the "geo_location" field in the mutation. +func (m *OrganizationSettingMutation) GeoLocation() (r enums.Region, exists bool) { + v := m.geo_location + if v == nil { + return + } + return *v, true +} + +// OldGeoLocation returns the old "geo_location" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldGeoLocation(ctx context.Context) (v enums.Region, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGeoLocation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGeoLocation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGeoLocation: %w", err) + } + return oldValue.GeoLocation, nil +} + +// ClearGeoLocation clears the value of the "geo_location" field. +func (m *OrganizationSettingMutation) ClearGeoLocation() { + m.geo_location = nil + m.clearedFields[organizationsetting.FieldGeoLocation] = struct{}{} +} + +// GeoLocationCleared returns if the "geo_location" field was cleared in this mutation. +func (m *OrganizationSettingMutation) GeoLocationCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldGeoLocation] + return ok +} + +// ResetGeoLocation resets all changes to the "geo_location" field. +func (m *OrganizationSettingMutation) ResetGeoLocation() { + m.geo_location = nil + delete(m.clearedFields, organizationsetting.FieldGeoLocation) +} + +// SetOrganizationID sets the "organization_id" field. +func (m *OrganizationSettingMutation) SetOrganizationID(s string) { + m.organization = &s +} + +// OrganizationID returns the value of the "organization_id" field in the mutation. +func (m *OrganizationSettingMutation) OrganizationID() (r string, exists bool) { + v := m.organization + if v == nil { + return + } + return *v, true +} + +// OldOrganizationID returns the old "organization_id" field's value of the OrganizationSetting entity. +// If the OrganizationSetting 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 *OrganizationSettingMutation) OldOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err) + } + return oldValue.OrganizationID, nil +} + +// ClearOrganizationID clears the value of the "organization_id" field. +func (m *OrganizationSettingMutation) ClearOrganizationID() { + m.organization = nil + m.clearedFields[organizationsetting.FieldOrganizationID] = struct{}{} +} + +// OrganizationIDCleared returns if the "organization_id" field was cleared in this mutation. +func (m *OrganizationSettingMutation) OrganizationIDCleared() bool { + _, ok := m.clearedFields[organizationsetting.FieldOrganizationID] + return ok +} + +// ResetOrganizationID resets all changes to the "organization_id" field. +func (m *OrganizationSettingMutation) ResetOrganizationID() { + m.organization = nil + delete(m.clearedFields, organizationsetting.FieldOrganizationID) +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (m *OrganizationSettingMutation) ClearOrganization() { + m.clearedorganization = true + m.clearedFields[organizationsetting.FieldOrganizationID] = struct{}{} +} + +// OrganizationCleared reports if the "organization" edge to the Organization entity was cleared. +func (m *OrganizationSettingMutation) OrganizationCleared() bool { + return m.OrganizationIDCleared() || m.clearedorganization +} + +// OrganizationIDs returns the "organization" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OrganizationID instead. It exists only for internal usage by the builders. +func (m *OrganizationSettingMutation) OrganizationIDs() (ids []string) { + if id := m.organization; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOrganization resets all changes to the "organization" edge. +func (m *OrganizationSettingMutation) ResetOrganization() { + m.organization = nil + m.clearedorganization = false +} + +// Where appends a list predicates to the OrganizationSettingMutation builder. +func (m *OrganizationSettingMutation) Where(ps ...predicate.OrganizationSetting) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OrganizationSettingMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OrganizationSettingMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OrganizationSetting, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OrganizationSettingMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OrganizationSettingMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OrganizationSetting). +func (m *OrganizationSettingMutation) 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 *OrganizationSettingMutation) Fields() []string { + fields := make([]string, 0, 16) + if m.created_at != nil { + fields = append(fields, organizationsetting.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, organizationsetting.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, organizationsetting.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, organizationsetting.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, organizationsetting.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, organizationsetting.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, organizationsetting.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, organizationsetting.FieldDeletedBy) + } + if m.domains != nil { + fields = append(fields, organizationsetting.FieldDomains) + } + if m.billing_contact != nil { + fields = append(fields, organizationsetting.FieldBillingContact) + } + if m.billing_email != nil { + fields = append(fields, organizationsetting.FieldBillingEmail) + } + if m.billing_phone != nil { + fields = append(fields, organizationsetting.FieldBillingPhone) + } + if m.billing_address != nil { + fields = append(fields, organizationsetting.FieldBillingAddress) + } + if m.tax_identifier != nil { + fields = append(fields, organizationsetting.FieldTaxIdentifier) + } + if m.geo_location != nil { + fields = append(fields, organizationsetting.FieldGeoLocation) + } + if m.organization != nil { + fields = append(fields, organizationsetting.FieldOrganizationID) + } + 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 *OrganizationSettingMutation) Field(name string) (ent.Value, bool) { + switch name { + case organizationsetting.FieldCreatedAt: + return m.CreatedAt() + case organizationsetting.FieldUpdatedAt: + return m.UpdatedAt() + case organizationsetting.FieldCreatedBy: + return m.CreatedBy() + case organizationsetting.FieldUpdatedBy: + return m.UpdatedBy() + case organizationsetting.FieldMappingID: + return m.MappingID() + case organizationsetting.FieldTags: + return m.Tags() + case organizationsetting.FieldDeletedAt: + return m.DeletedAt() + case organizationsetting.FieldDeletedBy: + return m.DeletedBy() + case organizationsetting.FieldDomains: + return m.Domains() + case organizationsetting.FieldBillingContact: + return m.BillingContact() + case organizationsetting.FieldBillingEmail: + return m.BillingEmail() + case organizationsetting.FieldBillingPhone: + return m.BillingPhone() + case organizationsetting.FieldBillingAddress: + return m.BillingAddress() + case organizationsetting.FieldTaxIdentifier: + return m.TaxIdentifier() + case organizationsetting.FieldGeoLocation: + return m.GeoLocation() + case organizationsetting.FieldOrganizationID: + return m.OrganizationID() + } + 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 *OrganizationSettingMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case organizationsetting.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case organizationsetting.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case organizationsetting.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case organizationsetting.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case organizationsetting.FieldMappingID: + return m.OldMappingID(ctx) + case organizationsetting.FieldTags: + return m.OldTags(ctx) + case organizationsetting.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case organizationsetting.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case organizationsetting.FieldDomains: + return m.OldDomains(ctx) + case organizationsetting.FieldBillingContact: + return m.OldBillingContact(ctx) + case organizationsetting.FieldBillingEmail: + return m.OldBillingEmail(ctx) + case organizationsetting.FieldBillingPhone: + return m.OldBillingPhone(ctx) + case organizationsetting.FieldBillingAddress: + return m.OldBillingAddress(ctx) + case organizationsetting.FieldTaxIdentifier: + return m.OldTaxIdentifier(ctx) + case organizationsetting.FieldGeoLocation: + return m.OldGeoLocation(ctx) + case organizationsetting.FieldOrganizationID: + return m.OldOrganizationID(ctx) + } + return nil, fmt.Errorf("unknown OrganizationSetting 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 *OrganizationSettingMutation) SetField(name string, value ent.Value) error { + switch name { + case organizationsetting.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case organizationsetting.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case organizationsetting.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case organizationsetting.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case organizationsetting.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case organizationsetting.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case organizationsetting.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case organizationsetting.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case organizationsetting.FieldDomains: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDomains(v) + return nil + case organizationsetting.FieldBillingContact: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingContact(v) + return nil + case organizationsetting.FieldBillingEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingEmail(v) + return nil + case organizationsetting.FieldBillingPhone: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingPhone(v) + return nil + case organizationsetting.FieldBillingAddress: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingAddress(v) + return nil + case organizationsetting.FieldTaxIdentifier: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTaxIdentifier(v) + return nil + case organizationsetting.FieldGeoLocation: + v, ok := value.(enums.Region) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGeoLocation(v) + return nil + case organizationsetting.FieldOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrganizationID(v) + return nil + } + return fmt.Errorf("unknown OrganizationSetting field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OrganizationSettingMutation) 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 *OrganizationSettingMutation) 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 *OrganizationSettingMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown OrganizationSetting numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OrganizationSettingMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(organizationsetting.FieldCreatedAt) { + fields = append(fields, organizationsetting.FieldCreatedAt) + } + if m.FieldCleared(organizationsetting.FieldUpdatedAt) { + fields = append(fields, organizationsetting.FieldUpdatedAt) + } + if m.FieldCleared(organizationsetting.FieldCreatedBy) { + fields = append(fields, organizationsetting.FieldCreatedBy) + } + if m.FieldCleared(organizationsetting.FieldUpdatedBy) { + fields = append(fields, organizationsetting.FieldUpdatedBy) + } + if m.FieldCleared(organizationsetting.FieldTags) { + fields = append(fields, organizationsetting.FieldTags) + } + if m.FieldCleared(organizationsetting.FieldDeletedAt) { + fields = append(fields, organizationsetting.FieldDeletedAt) + } + if m.FieldCleared(organizationsetting.FieldDeletedBy) { + fields = append(fields, organizationsetting.FieldDeletedBy) + } + if m.FieldCleared(organizationsetting.FieldDomains) { + fields = append(fields, organizationsetting.FieldDomains) + } + if m.FieldCleared(organizationsetting.FieldBillingContact) { + fields = append(fields, organizationsetting.FieldBillingContact) + } + if m.FieldCleared(organizationsetting.FieldBillingEmail) { + fields = append(fields, organizationsetting.FieldBillingEmail) + } + if m.FieldCleared(organizationsetting.FieldBillingPhone) { + fields = append(fields, organizationsetting.FieldBillingPhone) + } + if m.FieldCleared(organizationsetting.FieldBillingAddress) { + fields = append(fields, organizationsetting.FieldBillingAddress) + } + if m.FieldCleared(organizationsetting.FieldTaxIdentifier) { + fields = append(fields, organizationsetting.FieldTaxIdentifier) + } + if m.FieldCleared(organizationsetting.FieldGeoLocation) { + fields = append(fields, organizationsetting.FieldGeoLocation) + } + if m.FieldCleared(organizationsetting.FieldOrganizationID) { + fields = append(fields, organizationsetting.FieldOrganizationID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OrganizationSettingMutation) 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 *OrganizationSettingMutation) ClearField(name string) error { + switch name { + case organizationsetting.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case organizationsetting.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case organizationsetting.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case organizationsetting.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case organizationsetting.FieldTags: + m.ClearTags() + return nil + case organizationsetting.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case organizationsetting.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case organizationsetting.FieldDomains: + m.ClearDomains() + return nil + case organizationsetting.FieldBillingContact: + m.ClearBillingContact() + return nil + case organizationsetting.FieldBillingEmail: + m.ClearBillingEmail() + return nil + case organizationsetting.FieldBillingPhone: + m.ClearBillingPhone() + return nil + case organizationsetting.FieldBillingAddress: + m.ClearBillingAddress() + return nil + case organizationsetting.FieldTaxIdentifier: + m.ClearTaxIdentifier() + return nil + case organizationsetting.FieldGeoLocation: + m.ClearGeoLocation() + return nil + case organizationsetting.FieldOrganizationID: + m.ClearOrganizationID() + return nil + } + return fmt.Errorf("unknown OrganizationSetting 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 *OrganizationSettingMutation) ResetField(name string) error { + switch name { + case organizationsetting.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case organizationsetting.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case organizationsetting.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case organizationsetting.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case organizationsetting.FieldMappingID: + m.ResetMappingID() + return nil + case organizationsetting.FieldTags: + m.ResetTags() + return nil + case organizationsetting.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case organizationsetting.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case organizationsetting.FieldDomains: + m.ResetDomains() + return nil + case organizationsetting.FieldBillingContact: + m.ResetBillingContact() + return nil + case organizationsetting.FieldBillingEmail: + m.ResetBillingEmail() + return nil + case organizationsetting.FieldBillingPhone: + m.ResetBillingPhone() + return nil + case organizationsetting.FieldBillingAddress: + m.ResetBillingAddress() + return nil + case organizationsetting.FieldTaxIdentifier: + m.ResetTaxIdentifier() + return nil + case organizationsetting.FieldGeoLocation: + m.ResetGeoLocation() + return nil + case organizationsetting.FieldOrganizationID: + m.ResetOrganizationID() + return nil + } + return fmt.Errorf("unknown OrganizationSetting field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OrganizationSettingMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.organization != nil { + edges = append(edges, organizationsetting.EdgeOrganization) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OrganizationSettingMutation) AddedIDs(name string) []ent.Value { + switch name { + case organizationsetting.EdgeOrganization: + if id := m.organization; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OrganizationSettingMutation) 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 *OrganizationSettingMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OrganizationSettingMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedorganization { + edges = append(edges, organizationsetting.EdgeOrganization) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OrganizationSettingMutation) EdgeCleared(name string) bool { + switch name { + case organizationsetting.EdgeOrganization: + return m.clearedorganization + } + 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 *OrganizationSettingMutation) ClearEdge(name string) error { + switch name { + case organizationsetting.EdgeOrganization: + m.ClearOrganization() + return nil + } + return fmt.Errorf("unknown OrganizationSetting 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 *OrganizationSettingMutation) ResetEdge(name string) error { + switch name { + case organizationsetting.EdgeOrganization: + m.ResetOrganization() + return nil + } + return fmt.Errorf("unknown OrganizationSetting edge %s", name) +} + +// OrganizationSettingHistoryMutation represents an operation that mutates the OrganizationSettingHistory nodes in the graph. +type OrganizationSettingHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + domains *[]string + appenddomains []string + billing_contact *string + billing_email *string + billing_phone *string + billing_address *string + tax_identifier *string + geo_location *enums.Region + organization_id *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*OrganizationSettingHistory, error) + predicates []predicate.OrganizationSettingHistory +} + +var _ ent.Mutation = (*OrganizationSettingHistoryMutation)(nil) + +// organizationsettinghistoryOption allows management of the mutation configuration using functional options. +type organizationsettinghistoryOption func(*OrganizationSettingHistoryMutation) + +// newOrganizationSettingHistoryMutation creates new mutation for the OrganizationSettingHistory entity. +func newOrganizationSettingHistoryMutation(c config, op Op, opts ...organizationsettinghistoryOption) *OrganizationSettingHistoryMutation { + m := &OrganizationSettingHistoryMutation{ + config: c, + op: op, + typ: TypeOrganizationSettingHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withOrganizationSettingHistoryID sets the ID field of the mutation. +func withOrganizationSettingHistoryID(id string) organizationsettinghistoryOption { + return func(m *OrganizationSettingHistoryMutation) { + var ( + err error + once sync.Once + value *OrganizationSettingHistory + ) + m.oldValue = func(ctx context.Context) (*OrganizationSettingHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().OrganizationSettingHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withOrganizationSettingHistory sets the old OrganizationSettingHistory of the mutation. +func withOrganizationSettingHistory(node *OrganizationSettingHistory) organizationsettinghistoryOption { + return func(m *OrganizationSettingHistoryMutation) { + m.oldValue = func(context.Context) (*OrganizationSettingHistory, 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 OrganizationSettingHistoryMutation) 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 OrganizationSettingHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of OrganizationSettingHistory entities. +func (m *OrganizationSettingHistoryMutation) SetID(id string) { + 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 *OrganizationSettingHistoryMutation) ID() (id string, 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 *OrganizationSettingHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().OrganizationSettingHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *OrganizationSettingHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *OrganizationSettingHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *OrganizationSettingHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *OrganizationSettingHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *OrganizationSettingHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *OrganizationSettingHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[organizationsettinghistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *OrganizationSettingHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, organizationsettinghistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *OrganizationSettingHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *OrganizationSettingHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *OrganizationSettingHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *OrganizationSettingHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *OrganizationSettingHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *OrganizationSettingHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[organizationsettinghistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *OrganizationSettingHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, organizationsettinghistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *OrganizationSettingHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *OrganizationSettingHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *OrganizationSettingHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[organizationsettinghistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *OrganizationSettingHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, organizationsettinghistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *OrganizationSettingHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *OrganizationSettingHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *OrganizationSettingHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[organizationsettinghistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *OrganizationSettingHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, organizationsettinghistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *OrganizationSettingHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *OrganizationSettingHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *OrganizationSettingHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[organizationsettinghistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *OrganizationSettingHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, organizationsettinghistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *OrganizationSettingHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *OrganizationSettingHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *OrganizationSettingHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *OrganizationSettingHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *OrganizationSettingHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *OrganizationSettingHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *OrganizationSettingHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *OrganizationSettingHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[organizationsettinghistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *OrganizationSettingHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, organizationsettinghistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *OrganizationSettingHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *OrganizationSettingHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *OrganizationSettingHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[organizationsettinghistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *OrganizationSettingHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, organizationsettinghistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *OrganizationSettingHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *OrganizationSettingHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *OrganizationSettingHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[organizationsettinghistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *OrganizationSettingHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, organizationsettinghistory.FieldDeletedBy) +} + +// SetDomains sets the "domains" field. +func (m *OrganizationSettingHistoryMutation) SetDomains(s []string) { + m.domains = &s + m.appenddomains = nil +} + +// Domains returns the value of the "domains" field in the mutation. +func (m *OrganizationSettingHistoryMutation) Domains() (r []string, exists bool) { + v := m.domains + if v == nil { + return + } + return *v, true +} + +// OldDomains returns the old "domains" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldDomains(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDomains is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDomains requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDomains: %w", err) + } + return oldValue.Domains, nil +} + +// AppendDomains adds s to the "domains" field. +func (m *OrganizationSettingHistoryMutation) AppendDomains(s []string) { + m.appenddomains = append(m.appenddomains, s...) +} + +// AppendedDomains returns the list of values that were appended to the "domains" field in this mutation. +func (m *OrganizationSettingHistoryMutation) AppendedDomains() ([]string, bool) { + if len(m.appenddomains) == 0 { + return nil, false + } + return m.appenddomains, true +} + +// ClearDomains clears the value of the "domains" field. +func (m *OrganizationSettingHistoryMutation) ClearDomains() { + m.domains = nil + m.appenddomains = nil + m.clearedFields[organizationsettinghistory.FieldDomains] = struct{}{} +} + +// DomainsCleared returns if the "domains" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) DomainsCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldDomains] + return ok +} + +// ResetDomains resets all changes to the "domains" field. +func (m *OrganizationSettingHistoryMutation) ResetDomains() { + m.domains = nil + m.appenddomains = nil + delete(m.clearedFields, organizationsettinghistory.FieldDomains) +} + +// SetBillingContact sets the "billing_contact" field. +func (m *OrganizationSettingHistoryMutation) SetBillingContact(s string) { + m.billing_contact = &s +} + +// BillingContact returns the value of the "billing_contact" field in the mutation. +func (m *OrganizationSettingHistoryMutation) BillingContact() (r string, exists bool) { + v := m.billing_contact + if v == nil { + return + } + return *v, true +} + +// OldBillingContact returns the old "billing_contact" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldBillingContact(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingContact is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingContact requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingContact: %w", err) + } + return oldValue.BillingContact, nil +} + +// ClearBillingContact clears the value of the "billing_contact" field. +func (m *OrganizationSettingHistoryMutation) ClearBillingContact() { + m.billing_contact = nil + m.clearedFields[organizationsettinghistory.FieldBillingContact] = struct{}{} +} + +// BillingContactCleared returns if the "billing_contact" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) BillingContactCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldBillingContact] + return ok +} + +// ResetBillingContact resets all changes to the "billing_contact" field. +func (m *OrganizationSettingHistoryMutation) ResetBillingContact() { + m.billing_contact = nil + delete(m.clearedFields, organizationsettinghistory.FieldBillingContact) +} + +// SetBillingEmail sets the "billing_email" field. +func (m *OrganizationSettingHistoryMutation) SetBillingEmail(s string) { + m.billing_email = &s +} + +// BillingEmail returns the value of the "billing_email" field in the mutation. +func (m *OrganizationSettingHistoryMutation) BillingEmail() (r string, exists bool) { + v := m.billing_email + if v == nil { + return + } + return *v, true +} + +// OldBillingEmail returns the old "billing_email" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldBillingEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingEmail: %w", err) + } + return oldValue.BillingEmail, nil +} + +// ClearBillingEmail clears the value of the "billing_email" field. +func (m *OrganizationSettingHistoryMutation) ClearBillingEmail() { + m.billing_email = nil + m.clearedFields[organizationsettinghistory.FieldBillingEmail] = struct{}{} +} + +// BillingEmailCleared returns if the "billing_email" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) BillingEmailCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldBillingEmail] + return ok +} + +// ResetBillingEmail resets all changes to the "billing_email" field. +func (m *OrganizationSettingHistoryMutation) ResetBillingEmail() { + m.billing_email = nil + delete(m.clearedFields, organizationsettinghistory.FieldBillingEmail) +} + +// SetBillingPhone sets the "billing_phone" field. +func (m *OrganizationSettingHistoryMutation) SetBillingPhone(s string) { + m.billing_phone = &s +} + +// BillingPhone returns the value of the "billing_phone" field in the mutation. +func (m *OrganizationSettingHistoryMutation) BillingPhone() (r string, exists bool) { + v := m.billing_phone + if v == nil { + return + } + return *v, true +} + +// OldBillingPhone returns the old "billing_phone" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldBillingPhone(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingPhone is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingPhone requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingPhone: %w", err) + } + return oldValue.BillingPhone, nil +} + +// ClearBillingPhone clears the value of the "billing_phone" field. +func (m *OrganizationSettingHistoryMutation) ClearBillingPhone() { + m.billing_phone = nil + m.clearedFields[organizationsettinghistory.FieldBillingPhone] = struct{}{} +} + +// BillingPhoneCleared returns if the "billing_phone" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) BillingPhoneCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldBillingPhone] + return ok +} + +// ResetBillingPhone resets all changes to the "billing_phone" field. +func (m *OrganizationSettingHistoryMutation) ResetBillingPhone() { + m.billing_phone = nil + delete(m.clearedFields, organizationsettinghistory.FieldBillingPhone) +} + +// SetBillingAddress sets the "billing_address" field. +func (m *OrganizationSettingHistoryMutation) SetBillingAddress(s string) { + m.billing_address = &s +} + +// BillingAddress returns the value of the "billing_address" field in the mutation. +func (m *OrganizationSettingHistoryMutation) BillingAddress() (r string, exists bool) { + v := m.billing_address + if v == nil { + return + } + return *v, true +} + +// OldBillingAddress returns the old "billing_address" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldBillingAddress(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBillingAddress is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBillingAddress requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBillingAddress: %w", err) + } + return oldValue.BillingAddress, nil +} + +// ClearBillingAddress clears the value of the "billing_address" field. +func (m *OrganizationSettingHistoryMutation) ClearBillingAddress() { + m.billing_address = nil + m.clearedFields[organizationsettinghistory.FieldBillingAddress] = struct{}{} +} + +// BillingAddressCleared returns if the "billing_address" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) BillingAddressCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldBillingAddress] + return ok +} + +// ResetBillingAddress resets all changes to the "billing_address" field. +func (m *OrganizationSettingHistoryMutation) ResetBillingAddress() { + m.billing_address = nil + delete(m.clearedFields, organizationsettinghistory.FieldBillingAddress) +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (m *OrganizationSettingHistoryMutation) SetTaxIdentifier(s string) { + m.tax_identifier = &s +} + +// TaxIdentifier returns the value of the "tax_identifier" field in the mutation. +func (m *OrganizationSettingHistoryMutation) TaxIdentifier() (r string, exists bool) { + v := m.tax_identifier + if v == nil { + return + } + return *v, true +} + +// OldTaxIdentifier returns the old "tax_identifier" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldTaxIdentifier(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTaxIdentifier is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTaxIdentifier requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTaxIdentifier: %w", err) + } + return oldValue.TaxIdentifier, nil +} + +// ClearTaxIdentifier clears the value of the "tax_identifier" field. +func (m *OrganizationSettingHistoryMutation) ClearTaxIdentifier() { + m.tax_identifier = nil + m.clearedFields[organizationsettinghistory.FieldTaxIdentifier] = struct{}{} +} + +// TaxIdentifierCleared returns if the "tax_identifier" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) TaxIdentifierCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldTaxIdentifier] + return ok +} + +// ResetTaxIdentifier resets all changes to the "tax_identifier" field. +func (m *OrganizationSettingHistoryMutation) ResetTaxIdentifier() { + m.tax_identifier = nil + delete(m.clearedFields, organizationsettinghistory.FieldTaxIdentifier) +} + +// SetGeoLocation sets the "geo_location" field. +func (m *OrganizationSettingHistoryMutation) SetGeoLocation(e enums.Region) { + m.geo_location = &e +} + +// GeoLocation returns the value of the "geo_location" field in the mutation. +func (m *OrganizationSettingHistoryMutation) GeoLocation() (r enums.Region, exists bool) { + v := m.geo_location + if v == nil { + return + } + return *v, true +} + +// OldGeoLocation returns the old "geo_location" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldGeoLocation(ctx context.Context) (v enums.Region, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldGeoLocation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldGeoLocation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldGeoLocation: %w", err) + } + return oldValue.GeoLocation, nil +} + +// ClearGeoLocation clears the value of the "geo_location" field. +func (m *OrganizationSettingHistoryMutation) ClearGeoLocation() { + m.geo_location = nil + m.clearedFields[organizationsettinghistory.FieldGeoLocation] = struct{}{} +} + +// GeoLocationCleared returns if the "geo_location" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) GeoLocationCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldGeoLocation] + return ok +} + +// ResetGeoLocation resets all changes to the "geo_location" field. +func (m *OrganizationSettingHistoryMutation) ResetGeoLocation() { + m.geo_location = nil + delete(m.clearedFields, organizationsettinghistory.FieldGeoLocation) +} + +// SetOrganizationID sets the "organization_id" field. +func (m *OrganizationSettingHistoryMutation) SetOrganizationID(s string) { + m.organization_id = &s +} + +// OrganizationID returns the value of the "organization_id" field in the mutation. +func (m *OrganizationSettingHistoryMutation) OrganizationID() (r string, exists bool) { + v := m.organization_id + if v == nil { + return + } + return *v, true +} + +// OldOrganizationID returns the old "organization_id" field's value of the OrganizationSettingHistory entity. +// If the OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) OldOrganizationID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOrganizationID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err) + } + return oldValue.OrganizationID, nil +} + +// ClearOrganizationID clears the value of the "organization_id" field. +func (m *OrganizationSettingHistoryMutation) ClearOrganizationID() { + m.organization_id = nil + m.clearedFields[organizationsettinghistory.FieldOrganizationID] = struct{}{} +} + +// OrganizationIDCleared returns if the "organization_id" field was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) OrganizationIDCleared() bool { + _, ok := m.clearedFields[organizationsettinghistory.FieldOrganizationID] + return ok +} + +// ResetOrganizationID resets all changes to the "organization_id" field. +func (m *OrganizationSettingHistoryMutation) ResetOrganizationID() { + m.organization_id = nil + delete(m.clearedFields, organizationsettinghistory.FieldOrganizationID) +} + +// Where appends a list predicates to the OrganizationSettingHistoryMutation builder. +func (m *OrganizationSettingHistoryMutation) Where(ps ...predicate.OrganizationSettingHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the OrganizationSettingHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *OrganizationSettingHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.OrganizationSettingHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *OrganizationSettingHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *OrganizationSettingHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (OrganizationSettingHistory). +func (m *OrganizationSettingHistoryMutation) 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 *OrganizationSettingHistoryMutation) Fields() []string { + fields := make([]string, 0, 19) + if m.history_time != nil { + fields = append(fields, organizationsettinghistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, organizationsettinghistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, organizationsettinghistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, organizationsettinghistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, organizationsettinghistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, organizationsettinghistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, organizationsettinghistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, organizationsettinghistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, organizationsettinghistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, organizationsettinghistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, organizationsettinghistory.FieldDeletedBy) + } + if m.domains != nil { + fields = append(fields, organizationsettinghistory.FieldDomains) + } + if m.billing_contact != nil { + fields = append(fields, organizationsettinghistory.FieldBillingContact) + } + if m.billing_email != nil { + fields = append(fields, organizationsettinghistory.FieldBillingEmail) + } + if m.billing_phone != nil { + fields = append(fields, organizationsettinghistory.FieldBillingPhone) + } + if m.billing_address != nil { + fields = append(fields, organizationsettinghistory.FieldBillingAddress) + } + if m.tax_identifier != nil { + fields = append(fields, organizationsettinghistory.FieldTaxIdentifier) + } + if m.geo_location != nil { + fields = append(fields, organizationsettinghistory.FieldGeoLocation) + } + if m.organization_id != nil { + fields = append(fields, organizationsettinghistory.FieldOrganizationID) + } + 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 *OrganizationSettingHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case organizationsettinghistory.FieldHistoryTime: + return m.HistoryTime() + case organizationsettinghistory.FieldRef: + return m.Ref() + case organizationsettinghistory.FieldOperation: + return m.Operation() + case organizationsettinghistory.FieldCreatedAt: + return m.CreatedAt() + case organizationsettinghistory.FieldUpdatedAt: + return m.UpdatedAt() + case organizationsettinghistory.FieldCreatedBy: + return m.CreatedBy() + case organizationsettinghistory.FieldUpdatedBy: + return m.UpdatedBy() + case organizationsettinghistory.FieldMappingID: + return m.MappingID() + case organizationsettinghistory.FieldTags: + return m.Tags() + case organizationsettinghistory.FieldDeletedAt: + return m.DeletedAt() + case organizationsettinghistory.FieldDeletedBy: + return m.DeletedBy() + case organizationsettinghistory.FieldDomains: + return m.Domains() + case organizationsettinghistory.FieldBillingContact: + return m.BillingContact() + case organizationsettinghistory.FieldBillingEmail: + return m.BillingEmail() + case organizationsettinghistory.FieldBillingPhone: + return m.BillingPhone() + case organizationsettinghistory.FieldBillingAddress: + return m.BillingAddress() + case organizationsettinghistory.FieldTaxIdentifier: + return m.TaxIdentifier() + case organizationsettinghistory.FieldGeoLocation: + return m.GeoLocation() + case organizationsettinghistory.FieldOrganizationID: + return m.OrganizationID() + } + 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 *OrganizationSettingHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case organizationsettinghistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case organizationsettinghistory.FieldRef: + return m.OldRef(ctx) + case organizationsettinghistory.FieldOperation: + return m.OldOperation(ctx) + case organizationsettinghistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case organizationsettinghistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case organizationsettinghistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case organizationsettinghistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case organizationsettinghistory.FieldMappingID: + return m.OldMappingID(ctx) + case organizationsettinghistory.FieldTags: + return m.OldTags(ctx) + case organizationsettinghistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case organizationsettinghistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case organizationsettinghistory.FieldDomains: + return m.OldDomains(ctx) + case organizationsettinghistory.FieldBillingContact: + return m.OldBillingContact(ctx) + case organizationsettinghistory.FieldBillingEmail: + return m.OldBillingEmail(ctx) + case organizationsettinghistory.FieldBillingPhone: + return m.OldBillingPhone(ctx) + case organizationsettinghistory.FieldBillingAddress: + return m.OldBillingAddress(ctx) + case organizationsettinghistory.FieldTaxIdentifier: + return m.OldTaxIdentifier(ctx) + case organizationsettinghistory.FieldGeoLocation: + return m.OldGeoLocation(ctx) + case organizationsettinghistory.FieldOrganizationID: + return m.OldOrganizationID(ctx) + } + return nil, fmt.Errorf("unknown OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case organizationsettinghistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case organizationsettinghistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case organizationsettinghistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case organizationsettinghistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case organizationsettinghistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case organizationsettinghistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case organizationsettinghistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case organizationsettinghistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case organizationsettinghistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case organizationsettinghistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case organizationsettinghistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case organizationsettinghistory.FieldDomains: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDomains(v) + return nil + case organizationsettinghistory.FieldBillingContact: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingContact(v) + return nil + case organizationsettinghistory.FieldBillingEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingEmail(v) + return nil + case organizationsettinghistory.FieldBillingPhone: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingPhone(v) + return nil + case organizationsettinghistory.FieldBillingAddress: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBillingAddress(v) + return nil + case organizationsettinghistory.FieldTaxIdentifier: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTaxIdentifier(v) + return nil + case organizationsettinghistory.FieldGeoLocation: + v, ok := value.(enums.Region) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetGeoLocation(v) + return nil + case organizationsettinghistory.FieldOrganizationID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOrganizationID(v) + return nil + } + return fmt.Errorf("unknown OrganizationSettingHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *OrganizationSettingHistoryMutation) 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 *OrganizationSettingHistoryMutation) 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 *OrganizationSettingHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown OrganizationSettingHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *OrganizationSettingHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(organizationsettinghistory.FieldRef) { + fields = append(fields, organizationsettinghistory.FieldRef) + } + if m.FieldCleared(organizationsettinghistory.FieldCreatedAt) { + fields = append(fields, organizationsettinghistory.FieldCreatedAt) + } + if m.FieldCleared(organizationsettinghistory.FieldUpdatedAt) { + fields = append(fields, organizationsettinghistory.FieldUpdatedAt) + } + if m.FieldCleared(organizationsettinghistory.FieldCreatedBy) { + fields = append(fields, organizationsettinghistory.FieldCreatedBy) + } + if m.FieldCleared(organizationsettinghistory.FieldUpdatedBy) { + fields = append(fields, organizationsettinghistory.FieldUpdatedBy) + } + if m.FieldCleared(organizationsettinghistory.FieldTags) { + fields = append(fields, organizationsettinghistory.FieldTags) + } + if m.FieldCleared(organizationsettinghistory.FieldDeletedAt) { + fields = append(fields, organizationsettinghistory.FieldDeletedAt) + } + if m.FieldCleared(organizationsettinghistory.FieldDeletedBy) { + fields = append(fields, organizationsettinghistory.FieldDeletedBy) + } + if m.FieldCleared(organizationsettinghistory.FieldDomains) { + fields = append(fields, organizationsettinghistory.FieldDomains) + } + if m.FieldCleared(organizationsettinghistory.FieldBillingContact) { + fields = append(fields, organizationsettinghistory.FieldBillingContact) + } + if m.FieldCleared(organizationsettinghistory.FieldBillingEmail) { + fields = append(fields, organizationsettinghistory.FieldBillingEmail) + } + if m.FieldCleared(organizationsettinghistory.FieldBillingPhone) { + fields = append(fields, organizationsettinghistory.FieldBillingPhone) + } + if m.FieldCleared(organizationsettinghistory.FieldBillingAddress) { + fields = append(fields, organizationsettinghistory.FieldBillingAddress) + } + if m.FieldCleared(organizationsettinghistory.FieldTaxIdentifier) { + fields = append(fields, organizationsettinghistory.FieldTaxIdentifier) + } + if m.FieldCleared(organizationsettinghistory.FieldGeoLocation) { + fields = append(fields, organizationsettinghistory.FieldGeoLocation) + } + if m.FieldCleared(organizationsettinghistory.FieldOrganizationID) { + fields = append(fields, organizationsettinghistory.FieldOrganizationID) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) 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 *OrganizationSettingHistoryMutation) ClearField(name string) error { + switch name { + case organizationsettinghistory.FieldRef: + m.ClearRef() + return nil + case organizationsettinghistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case organizationsettinghistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case organizationsettinghistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case organizationsettinghistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case organizationsettinghistory.FieldTags: + m.ClearTags() + return nil + case organizationsettinghistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case organizationsettinghistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case organizationsettinghistory.FieldDomains: + m.ClearDomains() + return nil + case organizationsettinghistory.FieldBillingContact: + m.ClearBillingContact() + return nil + case organizationsettinghistory.FieldBillingEmail: + m.ClearBillingEmail() + return nil + case organizationsettinghistory.FieldBillingPhone: + m.ClearBillingPhone() + return nil + case organizationsettinghistory.FieldBillingAddress: + m.ClearBillingAddress() + return nil + case organizationsettinghistory.FieldTaxIdentifier: + m.ClearTaxIdentifier() + return nil + case organizationsettinghistory.FieldGeoLocation: + m.ClearGeoLocation() + return nil + case organizationsettinghistory.FieldOrganizationID: + m.ClearOrganizationID() + return nil + } + return fmt.Errorf("unknown OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) ResetField(name string) error { + switch name { + case organizationsettinghistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case organizationsettinghistory.FieldRef: + m.ResetRef() + return nil + case organizationsettinghistory.FieldOperation: + m.ResetOperation() + return nil + case organizationsettinghistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case organizationsettinghistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case organizationsettinghistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case organizationsettinghistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case organizationsettinghistory.FieldMappingID: + m.ResetMappingID() + return nil + case organizationsettinghistory.FieldTags: + m.ResetTags() + return nil + case organizationsettinghistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case organizationsettinghistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case organizationsettinghistory.FieldDomains: + m.ResetDomains() + return nil + case organizationsettinghistory.FieldBillingContact: + m.ResetBillingContact() + return nil + case organizationsettinghistory.FieldBillingEmail: + m.ResetBillingEmail() + return nil + case organizationsettinghistory.FieldBillingPhone: + m.ResetBillingPhone() + return nil + case organizationsettinghistory.FieldBillingAddress: + m.ResetBillingAddress() + return nil + case organizationsettinghistory.FieldTaxIdentifier: + m.ResetTaxIdentifier() + return nil + case organizationsettinghistory.FieldGeoLocation: + m.ResetGeoLocation() + return nil + case organizationsettinghistory.FieldOrganizationID: + m.ResetOrganizationID() + return nil + } + return fmt.Errorf("unknown OrganizationSettingHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *OrganizationSettingHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *OrganizationSettingHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *OrganizationSettingHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *OrganizationSettingHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *OrganizationSettingHistoryMutation) EdgeCleared(name string) bool { + 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 *OrganizationSettingHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown OrganizationSettingHistory 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 *OrganizationSettingHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown OrganizationSettingHistory edge %s", name) +} + +// PasswordResetTokenMutation represents an operation that mutates the PasswordResetToken nodes in the graph. +type PasswordResetTokenMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + token *string + ttl *time.Time + email *string + secret *[]byte + clearedFields map[string]struct{} + owner *string + clearedowner bool + done bool + oldValue func(context.Context) (*PasswordResetToken, error) + predicates []predicate.PasswordResetToken +} + +var _ ent.Mutation = (*PasswordResetTokenMutation)(nil) + +// passwordresettokenOption allows management of the mutation configuration using functional options. +type passwordresettokenOption func(*PasswordResetTokenMutation) + +// newPasswordResetTokenMutation creates new mutation for the PasswordResetToken entity. +func newPasswordResetTokenMutation(c config, op Op, opts ...passwordresettokenOption) *PasswordResetTokenMutation { + m := &PasswordResetTokenMutation{ + config: c, + op: op, + typ: TypePasswordResetToken, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withPasswordResetTokenID sets the ID field of the mutation. +func withPasswordResetTokenID(id string) passwordresettokenOption { + return func(m *PasswordResetTokenMutation) { + var ( + err error + once sync.Once + value *PasswordResetToken + ) + m.oldValue = func(ctx context.Context) (*PasswordResetToken, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().PasswordResetToken.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withPasswordResetToken sets the old PasswordResetToken of the mutation. +func withPasswordResetToken(node *PasswordResetToken) passwordresettokenOption { + return func(m *PasswordResetTokenMutation) { + m.oldValue = func(context.Context) (*PasswordResetToken, 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 PasswordResetTokenMutation) 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 PasswordResetTokenMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of PasswordResetToken entities. +func (m *PasswordResetTokenMutation) SetID(id string) { + 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 *PasswordResetTokenMutation) ID() (id string, 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 *PasswordResetTokenMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().PasswordResetToken.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *PasswordResetTokenMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *PasswordResetTokenMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *PasswordResetTokenMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[passwordresettoken.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *PasswordResetTokenMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[passwordresettoken.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *PasswordResetTokenMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, passwordresettoken.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *PasswordResetTokenMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *PasswordResetTokenMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *PasswordResetTokenMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[passwordresettoken.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *PasswordResetTokenMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[passwordresettoken.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *PasswordResetTokenMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, passwordresettoken.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *PasswordResetTokenMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *PasswordResetTokenMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *PasswordResetTokenMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[passwordresettoken.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *PasswordResetTokenMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[passwordresettoken.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *PasswordResetTokenMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, passwordresettoken.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *PasswordResetTokenMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *PasswordResetTokenMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *PasswordResetTokenMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[passwordresettoken.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *PasswordResetTokenMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[passwordresettoken.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *PasswordResetTokenMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, passwordresettoken.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *PasswordResetTokenMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *PasswordResetTokenMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *PasswordResetTokenMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *PasswordResetTokenMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *PasswordResetTokenMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *PasswordResetTokenMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[passwordresettoken.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *PasswordResetTokenMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[passwordresettoken.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *PasswordResetTokenMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, passwordresettoken.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *PasswordResetTokenMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *PasswordResetTokenMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *PasswordResetTokenMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[passwordresettoken.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *PasswordResetTokenMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[passwordresettoken.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *PasswordResetTokenMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, passwordresettoken.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *PasswordResetTokenMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *PasswordResetTokenMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *PasswordResetTokenMutation) ResetOwnerID() { + m.owner = nil +} + +// SetToken sets the "token" field. +func (m *PasswordResetTokenMutation) SetToken(s string) { + m.token = &s +} + +// Token returns the value of the "token" field in the mutation. +func (m *PasswordResetTokenMutation) Token() (r string, exists bool) { + v := m.token + if v == nil { + return + } + return *v, true +} + +// OldToken returns the old "token" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldToken(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldToken is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldToken requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldToken: %w", err) + } + return oldValue.Token, nil +} + +// ResetToken resets all changes to the "token" field. +func (m *PasswordResetTokenMutation) ResetToken() { + m.token = nil +} + +// SetTTL sets the "ttl" field. +func (m *PasswordResetTokenMutation) SetTTL(t time.Time) { + m.ttl = &t +} + +// TTL returns the value of the "ttl" field in the mutation. +func (m *PasswordResetTokenMutation) TTL() (r time.Time, exists bool) { + v := m.ttl + if v == nil { + return + } + return *v, true +} + +// OldTTL returns the old "ttl" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldTTL(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTTL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTTL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTTL: %w", err) + } + return oldValue.TTL, nil +} + +// ResetTTL resets all changes to the "ttl" field. +func (m *PasswordResetTokenMutation) ResetTTL() { + m.ttl = nil +} + +// SetEmail sets the "email" field. +func (m *PasswordResetTokenMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *PasswordResetTokenMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ResetEmail resets all changes to the "email" field. +func (m *PasswordResetTokenMutation) ResetEmail() { + m.email = nil +} + +// SetSecret sets the "secret" field. +func (m *PasswordResetTokenMutation) SetSecret(b []byte) { + m.secret = &b +} + +// Secret returns the value of the "secret" field in the mutation. +func (m *PasswordResetTokenMutation) Secret() (r []byte, exists bool) { + v := m.secret + if v == nil { + return + } + return *v, true +} + +// OldSecret returns the old "secret" field's value of the PasswordResetToken entity. +// If the PasswordResetToken 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 *PasswordResetTokenMutation) OldSecret(ctx context.Context) (v *[]byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecret: %w", err) + } + return oldValue.Secret, nil +} + +// ResetSecret resets all changes to the "secret" field. +func (m *PasswordResetTokenMutation) ResetSecret() { + m.secret = nil +} + +// ClearOwner clears the "owner" edge to the User entity. +func (m *PasswordResetTokenMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[passwordresettoken.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the User entity was cleared. +func (m *PasswordResetTokenMutation) OwnerCleared() bool { + return m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *PasswordResetTokenMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *PasswordResetTokenMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// Where appends a list predicates to the PasswordResetTokenMutation builder. +func (m *PasswordResetTokenMutation) Where(ps ...predicate.PasswordResetToken) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the PasswordResetTokenMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *PasswordResetTokenMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.PasswordResetToken, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *PasswordResetTokenMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *PasswordResetTokenMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (PasswordResetToken). +func (m *PasswordResetTokenMutation) 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 *PasswordResetTokenMutation) Fields() []string { + fields := make([]string, 0, 12) + if m.created_at != nil { + fields = append(fields, passwordresettoken.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, passwordresettoken.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, passwordresettoken.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, passwordresettoken.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, passwordresettoken.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, passwordresettoken.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, passwordresettoken.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, passwordresettoken.FieldOwnerID) + } + if m.token != nil { + fields = append(fields, passwordresettoken.FieldToken) + } + if m.ttl != nil { + fields = append(fields, passwordresettoken.FieldTTL) + } + if m.email != nil { + fields = append(fields, passwordresettoken.FieldEmail) + } + if m.secret != nil { + fields = append(fields, passwordresettoken.FieldSecret) + } + 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 *PasswordResetTokenMutation) Field(name string) (ent.Value, bool) { + switch name { + case passwordresettoken.FieldCreatedAt: + return m.CreatedAt() + case passwordresettoken.FieldUpdatedAt: + return m.UpdatedAt() + case passwordresettoken.FieldCreatedBy: + return m.CreatedBy() + case passwordresettoken.FieldUpdatedBy: + return m.UpdatedBy() + case passwordresettoken.FieldMappingID: + return m.MappingID() + case passwordresettoken.FieldDeletedAt: + return m.DeletedAt() + case passwordresettoken.FieldDeletedBy: + return m.DeletedBy() + case passwordresettoken.FieldOwnerID: + return m.OwnerID() + case passwordresettoken.FieldToken: + return m.Token() + case passwordresettoken.FieldTTL: + return m.TTL() + case passwordresettoken.FieldEmail: + return m.Email() + case passwordresettoken.FieldSecret: + return m.Secret() + } + 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 *PasswordResetTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case passwordresettoken.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case passwordresettoken.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case passwordresettoken.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case passwordresettoken.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case passwordresettoken.FieldMappingID: + return m.OldMappingID(ctx) + case passwordresettoken.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case passwordresettoken.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case passwordresettoken.FieldOwnerID: + return m.OldOwnerID(ctx) + case passwordresettoken.FieldToken: + return m.OldToken(ctx) + case passwordresettoken.FieldTTL: + return m.OldTTL(ctx) + case passwordresettoken.FieldEmail: + return m.OldEmail(ctx) + case passwordresettoken.FieldSecret: + return m.OldSecret(ctx) + } + return nil, fmt.Errorf("unknown PasswordResetToken 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 *PasswordResetTokenMutation) SetField(name string, value ent.Value) error { + switch name { + case passwordresettoken.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case passwordresettoken.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case passwordresettoken.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case passwordresettoken.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case passwordresettoken.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case passwordresettoken.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case passwordresettoken.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case passwordresettoken.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case passwordresettoken.FieldToken: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetToken(v) + return nil + case passwordresettoken.FieldTTL: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTTL(v) + return nil + case passwordresettoken.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case passwordresettoken.FieldSecret: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecret(v) + return nil + } + return fmt.Errorf("unknown PasswordResetToken field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *PasswordResetTokenMutation) 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 *PasswordResetTokenMutation) 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 *PasswordResetTokenMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown PasswordResetToken numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *PasswordResetTokenMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(passwordresettoken.FieldCreatedAt) { + fields = append(fields, passwordresettoken.FieldCreatedAt) + } + if m.FieldCleared(passwordresettoken.FieldUpdatedAt) { + fields = append(fields, passwordresettoken.FieldUpdatedAt) + } + if m.FieldCleared(passwordresettoken.FieldCreatedBy) { + fields = append(fields, passwordresettoken.FieldCreatedBy) + } + if m.FieldCleared(passwordresettoken.FieldUpdatedBy) { + fields = append(fields, passwordresettoken.FieldUpdatedBy) + } + if m.FieldCleared(passwordresettoken.FieldDeletedAt) { + fields = append(fields, passwordresettoken.FieldDeletedAt) + } + if m.FieldCleared(passwordresettoken.FieldDeletedBy) { + fields = append(fields, passwordresettoken.FieldDeletedBy) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *PasswordResetTokenMutation) 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 *PasswordResetTokenMutation) ClearField(name string) error { + switch name { + case passwordresettoken.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case passwordresettoken.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case passwordresettoken.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case passwordresettoken.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case passwordresettoken.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case passwordresettoken.FieldDeletedBy: + m.ClearDeletedBy() + return nil + } + return fmt.Errorf("unknown PasswordResetToken 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 *PasswordResetTokenMutation) ResetField(name string) error { + switch name { + case passwordresettoken.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case passwordresettoken.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case passwordresettoken.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case passwordresettoken.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case passwordresettoken.FieldMappingID: + m.ResetMappingID() + return nil + case passwordresettoken.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case passwordresettoken.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case passwordresettoken.FieldOwnerID: + m.ResetOwnerID() + return nil + case passwordresettoken.FieldToken: + m.ResetToken() + return nil + case passwordresettoken.FieldTTL: + m.ResetTTL() + return nil + case passwordresettoken.FieldEmail: + m.ResetEmail() + return nil + case passwordresettoken.FieldSecret: + m.ResetSecret() + return nil + } + return fmt.Errorf("unknown PasswordResetToken field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *PasswordResetTokenMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.owner != nil { + edges = append(edges, passwordresettoken.EdgeOwner) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *PasswordResetTokenMutation) AddedIDs(name string) []ent.Value { + switch name { + case passwordresettoken.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *PasswordResetTokenMutation) 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 *PasswordResetTokenMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *PasswordResetTokenMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedowner { + edges = append(edges, passwordresettoken.EdgeOwner) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *PasswordResetTokenMutation) EdgeCleared(name string) bool { + switch name { + case passwordresettoken.EdgeOwner: + return m.clearedowner + } + 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 *PasswordResetTokenMutation) ClearEdge(name string) error { + switch name { + case passwordresettoken.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown PasswordResetToken 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 *PasswordResetTokenMutation) ResetEdge(name string) error { + switch name { + case passwordresettoken.EdgeOwner: + m.ResetOwner() + return nil + } + return fmt.Errorf("unknown PasswordResetToken edge %s", name) +} + +// PersonalAccessTokenMutation represents an operation that mutates the PersonalAccessToken nodes in the graph. +type PersonalAccessTokenMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + name *string + token *string + expires_at *time.Time + description *string + scopes *[]string + appendscopes []string + last_used_at *time.Time + clearedFields map[string]struct{} + owner *string + clearedowner bool + organizations map[string]struct{} + removedorganizations map[string]struct{} + clearedorganizations bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*PersonalAccessToken, error) + predicates []predicate.PersonalAccessToken +} + +var _ ent.Mutation = (*PersonalAccessTokenMutation)(nil) + +// personalaccesstokenOption allows management of the mutation configuration using functional options. +type personalaccesstokenOption func(*PersonalAccessTokenMutation) + +// newPersonalAccessTokenMutation creates new mutation for the PersonalAccessToken entity. +func newPersonalAccessTokenMutation(c config, op Op, opts ...personalaccesstokenOption) *PersonalAccessTokenMutation { + m := &PersonalAccessTokenMutation{ + config: c, + op: op, + typ: TypePersonalAccessToken, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withPersonalAccessTokenID sets the ID field of the mutation. +func withPersonalAccessTokenID(id string) personalaccesstokenOption { + return func(m *PersonalAccessTokenMutation) { + var ( + err error + once sync.Once + value *PersonalAccessToken + ) + m.oldValue = func(ctx context.Context) (*PersonalAccessToken, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().PersonalAccessToken.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withPersonalAccessToken sets the old PersonalAccessToken of the mutation. +func withPersonalAccessToken(node *PersonalAccessToken) personalaccesstokenOption { + return func(m *PersonalAccessTokenMutation) { + m.oldValue = func(context.Context) (*PersonalAccessToken, 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 PersonalAccessTokenMutation) 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 PersonalAccessTokenMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of PersonalAccessToken entities. +func (m *PersonalAccessTokenMutation) SetID(id string) { + 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 *PersonalAccessTokenMutation) ID() (id string, 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 *PersonalAccessTokenMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().PersonalAccessToken.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *PersonalAccessTokenMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *PersonalAccessTokenMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *PersonalAccessTokenMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[personalaccesstoken.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *PersonalAccessTokenMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, personalaccesstoken.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *PersonalAccessTokenMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *PersonalAccessTokenMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *PersonalAccessTokenMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[personalaccesstoken.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *PersonalAccessTokenMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, personalaccesstoken.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *PersonalAccessTokenMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *PersonalAccessTokenMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *PersonalAccessTokenMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[personalaccesstoken.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *PersonalAccessTokenMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, personalaccesstoken.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *PersonalAccessTokenMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *PersonalAccessTokenMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *PersonalAccessTokenMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[personalaccesstoken.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *PersonalAccessTokenMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, personalaccesstoken.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *PersonalAccessTokenMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *PersonalAccessTokenMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *PersonalAccessTokenMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[personalaccesstoken.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *PersonalAccessTokenMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, personalaccesstoken.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *PersonalAccessTokenMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *PersonalAccessTokenMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *PersonalAccessTokenMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[personalaccesstoken.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *PersonalAccessTokenMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, personalaccesstoken.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *PersonalAccessTokenMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *PersonalAccessTokenMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *PersonalAccessTokenMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *PersonalAccessTokenMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *PersonalAccessTokenMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *PersonalAccessTokenMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *PersonalAccessTokenMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *PersonalAccessTokenMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[personalaccesstoken.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) TagsCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *PersonalAccessTokenMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, personalaccesstoken.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *PersonalAccessTokenMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *PersonalAccessTokenMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *PersonalAccessTokenMutation) ResetOwnerID() { + m.owner = nil +} + +// SetName sets the "name" field. +func (m *PersonalAccessTokenMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *PersonalAccessTokenMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *PersonalAccessTokenMutation) ResetName() { + m.name = nil +} + +// SetToken sets the "token" field. +func (m *PersonalAccessTokenMutation) SetToken(s string) { + m.token = &s +} + +// Token returns the value of the "token" field in the mutation. +func (m *PersonalAccessTokenMutation) Token() (r string, exists bool) { + v := m.token + if v == nil { + return + } + return *v, true +} + +// OldToken returns the old "token" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldToken(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldToken is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldToken requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldToken: %w", err) + } + return oldValue.Token, nil +} + +// ResetToken resets all changes to the "token" field. +func (m *PersonalAccessTokenMutation) ResetToken() { + m.token = nil +} + +// SetExpiresAt sets the "expires_at" field. +func (m *PersonalAccessTokenMutation) SetExpiresAt(t time.Time) { + m.expires_at = &t +} + +// ExpiresAt returns the value of the "expires_at" field in the mutation. +func (m *PersonalAccessTokenMutation) ExpiresAt() (r time.Time, exists bool) { + v := m.expires_at + if v == nil { + return + } + return *v, true +} + +// OldExpiresAt returns the old "expires_at" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpiresAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpiresAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpiresAt: %w", err) + } + return oldValue.ExpiresAt, nil +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (m *PersonalAccessTokenMutation) ClearExpiresAt() { + m.expires_at = nil + m.clearedFields[personalaccesstoken.FieldExpiresAt] = struct{}{} +} + +// ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) ExpiresAtCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldExpiresAt] + return ok +} + +// ResetExpiresAt resets all changes to the "expires_at" field. +func (m *PersonalAccessTokenMutation) ResetExpiresAt() { + m.expires_at = nil + delete(m.clearedFields, personalaccesstoken.FieldExpiresAt) +} + +// SetDescription sets the "description" field. +func (m *PersonalAccessTokenMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *PersonalAccessTokenMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldDescription(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *PersonalAccessTokenMutation) ClearDescription() { + m.description = nil + m.clearedFields[personalaccesstoken.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *PersonalAccessTokenMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, personalaccesstoken.FieldDescription) +} + +// SetScopes sets the "scopes" field. +func (m *PersonalAccessTokenMutation) SetScopes(s []string) { + m.scopes = &s + m.appendscopes = nil +} + +// Scopes returns the value of the "scopes" field in the mutation. +func (m *PersonalAccessTokenMutation) Scopes() (r []string, exists bool) { + v := m.scopes + if v == nil { + return + } + return *v, true +} + +// OldScopes returns the old "scopes" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldScopes(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldScopes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldScopes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldScopes: %w", err) + } + return oldValue.Scopes, nil +} + +// AppendScopes adds s to the "scopes" field. +func (m *PersonalAccessTokenMutation) AppendScopes(s []string) { + m.appendscopes = append(m.appendscopes, s...) +} + +// AppendedScopes returns the list of values that were appended to the "scopes" field in this mutation. +func (m *PersonalAccessTokenMutation) AppendedScopes() ([]string, bool) { + if len(m.appendscopes) == 0 { + return nil, false + } + return m.appendscopes, true +} + +// ClearScopes clears the value of the "scopes" field. +func (m *PersonalAccessTokenMutation) ClearScopes() { + m.scopes = nil + m.appendscopes = nil + m.clearedFields[personalaccesstoken.FieldScopes] = struct{}{} +} + +// ScopesCleared returns if the "scopes" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) ScopesCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldScopes] + return ok +} + +// ResetScopes resets all changes to the "scopes" field. +func (m *PersonalAccessTokenMutation) ResetScopes() { + m.scopes = nil + m.appendscopes = nil + delete(m.clearedFields, personalaccesstoken.FieldScopes) +} + +// SetLastUsedAt sets the "last_used_at" field. +func (m *PersonalAccessTokenMutation) SetLastUsedAt(t time.Time) { + m.last_used_at = &t +} + +// LastUsedAt returns the value of the "last_used_at" field in the mutation. +func (m *PersonalAccessTokenMutation) LastUsedAt() (r time.Time, exists bool) { + v := m.last_used_at + if v == nil { + return + } + return *v, true +} + +// OldLastUsedAt returns the old "last_used_at" field's value of the PersonalAccessToken entity. +// If the PersonalAccessToken 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 *PersonalAccessTokenMutation) OldLastUsedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastUsedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastUsedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastUsedAt: %w", err) + } + return oldValue.LastUsedAt, nil +} + +// ClearLastUsedAt clears the value of the "last_used_at" field. +func (m *PersonalAccessTokenMutation) ClearLastUsedAt() { + m.last_used_at = nil + m.clearedFields[personalaccesstoken.FieldLastUsedAt] = struct{}{} +} + +// LastUsedAtCleared returns if the "last_used_at" field was cleared in this mutation. +func (m *PersonalAccessTokenMutation) LastUsedAtCleared() bool { + _, ok := m.clearedFields[personalaccesstoken.FieldLastUsedAt] + return ok +} + +// ResetLastUsedAt resets all changes to the "last_used_at" field. +func (m *PersonalAccessTokenMutation) ResetLastUsedAt() { + m.last_used_at = nil + delete(m.clearedFields, personalaccesstoken.FieldLastUsedAt) +} + +// ClearOwner clears the "owner" edge to the User entity. +func (m *PersonalAccessTokenMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[personalaccesstoken.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the User entity was cleared. +func (m *PersonalAccessTokenMutation) OwnerCleared() bool { + return m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *PersonalAccessTokenMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *PersonalAccessTokenMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by ids. +func (m *PersonalAccessTokenMutation) AddOrganizationIDs(ids ...string) { + if m.organizations == nil { + m.organizations = make(map[string]struct{}) + } + for i := range ids { + m.organizations[ids[i]] = struct{}{} + } +} + +// ClearOrganizations clears the "organizations" edge to the Organization entity. +func (m *PersonalAccessTokenMutation) ClearOrganizations() { + m.clearedorganizations = true +} + +// OrganizationsCleared reports if the "organizations" edge to the Organization entity was cleared. +func (m *PersonalAccessTokenMutation) OrganizationsCleared() bool { + return m.clearedorganizations +} + +// RemoveOrganizationIDs removes the "organizations" edge to the Organization entity by IDs. +func (m *PersonalAccessTokenMutation) RemoveOrganizationIDs(ids ...string) { + if m.removedorganizations == nil { + m.removedorganizations = make(map[string]struct{}) + } + for i := range ids { + delete(m.organizations, ids[i]) + m.removedorganizations[ids[i]] = struct{}{} + } +} + +// RemovedOrganizations returns the removed IDs of the "organizations" edge to the Organization entity. +func (m *PersonalAccessTokenMutation) RemovedOrganizationsIDs() (ids []string) { + for id := range m.removedorganizations { + ids = append(ids, id) + } + return +} + +// OrganizationsIDs returns the "organizations" edge IDs in the mutation. +func (m *PersonalAccessTokenMutation) OrganizationsIDs() (ids []string) { + for id := range m.organizations { + ids = append(ids, id) + } + return +} + +// ResetOrganizations resets all changes to the "organizations" edge. +func (m *PersonalAccessTokenMutation) ResetOrganizations() { + m.organizations = nil + m.clearedorganizations = false + m.removedorganizations = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *PersonalAccessTokenMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *PersonalAccessTokenMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *PersonalAccessTokenMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *PersonalAccessTokenMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *PersonalAccessTokenMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *PersonalAccessTokenMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *PersonalAccessTokenMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the PersonalAccessTokenMutation builder. +func (m *PersonalAccessTokenMutation) Where(ps ...predicate.PersonalAccessToken) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the PersonalAccessTokenMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *PersonalAccessTokenMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.PersonalAccessToken, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *PersonalAccessTokenMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *PersonalAccessTokenMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (PersonalAccessToken). +func (m *PersonalAccessTokenMutation) 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 *PersonalAccessTokenMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.created_at != nil { + fields = append(fields, personalaccesstoken.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, personalaccesstoken.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, personalaccesstoken.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, personalaccesstoken.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, personalaccesstoken.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, personalaccesstoken.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, personalaccesstoken.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, personalaccesstoken.FieldTags) + } + if m.owner != nil { + fields = append(fields, personalaccesstoken.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, personalaccesstoken.FieldName) + } + if m.token != nil { + fields = append(fields, personalaccesstoken.FieldToken) + } + if m.expires_at != nil { + fields = append(fields, personalaccesstoken.FieldExpiresAt) + } + if m.description != nil { + fields = append(fields, personalaccesstoken.FieldDescription) + } + if m.scopes != nil { + fields = append(fields, personalaccesstoken.FieldScopes) + } + if m.last_used_at != nil { + fields = append(fields, personalaccesstoken.FieldLastUsedAt) + } + 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 *PersonalAccessTokenMutation) Field(name string) (ent.Value, bool) { + switch name { + case personalaccesstoken.FieldCreatedAt: + return m.CreatedAt() + case personalaccesstoken.FieldUpdatedAt: + return m.UpdatedAt() + case personalaccesstoken.FieldCreatedBy: + return m.CreatedBy() + case personalaccesstoken.FieldUpdatedBy: + return m.UpdatedBy() + case personalaccesstoken.FieldDeletedAt: + return m.DeletedAt() + case personalaccesstoken.FieldDeletedBy: + return m.DeletedBy() + case personalaccesstoken.FieldMappingID: + return m.MappingID() + case personalaccesstoken.FieldTags: + return m.Tags() + case personalaccesstoken.FieldOwnerID: + return m.OwnerID() + case personalaccesstoken.FieldName: + return m.Name() + case personalaccesstoken.FieldToken: + return m.Token() + case personalaccesstoken.FieldExpiresAt: + return m.ExpiresAt() + case personalaccesstoken.FieldDescription: + return m.Description() + case personalaccesstoken.FieldScopes: + return m.Scopes() + case personalaccesstoken.FieldLastUsedAt: + return m.LastUsedAt() + } + 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 *PersonalAccessTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case personalaccesstoken.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case personalaccesstoken.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case personalaccesstoken.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case personalaccesstoken.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case personalaccesstoken.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case personalaccesstoken.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case personalaccesstoken.FieldMappingID: + return m.OldMappingID(ctx) + case personalaccesstoken.FieldTags: + return m.OldTags(ctx) + case personalaccesstoken.FieldOwnerID: + return m.OldOwnerID(ctx) + case personalaccesstoken.FieldName: + return m.OldName(ctx) + case personalaccesstoken.FieldToken: + return m.OldToken(ctx) + case personalaccesstoken.FieldExpiresAt: + return m.OldExpiresAt(ctx) + case personalaccesstoken.FieldDescription: + return m.OldDescription(ctx) + case personalaccesstoken.FieldScopes: + return m.OldScopes(ctx) + case personalaccesstoken.FieldLastUsedAt: + return m.OldLastUsedAt(ctx) + } + return nil, fmt.Errorf("unknown PersonalAccessToken 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 *PersonalAccessTokenMutation) SetField(name string, value ent.Value) error { + switch name { + case personalaccesstoken.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case personalaccesstoken.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case personalaccesstoken.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case personalaccesstoken.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case personalaccesstoken.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case personalaccesstoken.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case personalaccesstoken.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case personalaccesstoken.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case personalaccesstoken.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case personalaccesstoken.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case personalaccesstoken.FieldToken: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetToken(v) + return nil + case personalaccesstoken.FieldExpiresAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpiresAt(v) + return nil + case personalaccesstoken.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case personalaccesstoken.FieldScopes: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetScopes(v) + return nil + case personalaccesstoken.FieldLastUsedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastUsedAt(v) + return nil + } + return fmt.Errorf("unknown PersonalAccessToken field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *PersonalAccessTokenMutation) 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 *PersonalAccessTokenMutation) 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 *PersonalAccessTokenMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown PersonalAccessToken numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *PersonalAccessTokenMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(personalaccesstoken.FieldCreatedAt) { + fields = append(fields, personalaccesstoken.FieldCreatedAt) + } + if m.FieldCleared(personalaccesstoken.FieldUpdatedAt) { + fields = append(fields, personalaccesstoken.FieldUpdatedAt) + } + if m.FieldCleared(personalaccesstoken.FieldCreatedBy) { + fields = append(fields, personalaccesstoken.FieldCreatedBy) + } + if m.FieldCleared(personalaccesstoken.FieldUpdatedBy) { + fields = append(fields, personalaccesstoken.FieldUpdatedBy) + } + if m.FieldCleared(personalaccesstoken.FieldDeletedAt) { + fields = append(fields, personalaccesstoken.FieldDeletedAt) + } + if m.FieldCleared(personalaccesstoken.FieldDeletedBy) { + fields = append(fields, personalaccesstoken.FieldDeletedBy) + } + if m.FieldCleared(personalaccesstoken.FieldTags) { + fields = append(fields, personalaccesstoken.FieldTags) + } + if m.FieldCleared(personalaccesstoken.FieldExpiresAt) { + fields = append(fields, personalaccesstoken.FieldExpiresAt) + } + if m.FieldCleared(personalaccesstoken.FieldDescription) { + fields = append(fields, personalaccesstoken.FieldDescription) + } + if m.FieldCleared(personalaccesstoken.FieldScopes) { + fields = append(fields, personalaccesstoken.FieldScopes) + } + if m.FieldCleared(personalaccesstoken.FieldLastUsedAt) { + fields = append(fields, personalaccesstoken.FieldLastUsedAt) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *PersonalAccessTokenMutation) 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 *PersonalAccessTokenMutation) ClearField(name string) error { + switch name { + case personalaccesstoken.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case personalaccesstoken.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case personalaccesstoken.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case personalaccesstoken.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case personalaccesstoken.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case personalaccesstoken.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case personalaccesstoken.FieldTags: + m.ClearTags() + return nil + case personalaccesstoken.FieldExpiresAt: + m.ClearExpiresAt() + return nil + case personalaccesstoken.FieldDescription: + m.ClearDescription() + return nil + case personalaccesstoken.FieldScopes: + m.ClearScopes() + return nil + case personalaccesstoken.FieldLastUsedAt: + m.ClearLastUsedAt() + return nil + } + return fmt.Errorf("unknown PersonalAccessToken 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 *PersonalAccessTokenMutation) ResetField(name string) error { + switch name { + case personalaccesstoken.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case personalaccesstoken.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case personalaccesstoken.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case personalaccesstoken.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case personalaccesstoken.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case personalaccesstoken.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case personalaccesstoken.FieldMappingID: + m.ResetMappingID() + return nil + case personalaccesstoken.FieldTags: + m.ResetTags() + return nil + case personalaccesstoken.FieldOwnerID: + m.ResetOwnerID() + return nil + case personalaccesstoken.FieldName: + m.ResetName() + return nil + case personalaccesstoken.FieldToken: + m.ResetToken() + return nil + case personalaccesstoken.FieldExpiresAt: + m.ResetExpiresAt() + return nil + case personalaccesstoken.FieldDescription: + m.ResetDescription() + return nil + case personalaccesstoken.FieldScopes: + m.ResetScopes() + return nil + case personalaccesstoken.FieldLastUsedAt: + m.ResetLastUsedAt() + return nil + } + return fmt.Errorf("unknown PersonalAccessToken field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *PersonalAccessTokenMutation) AddedEdges() []string { + edges := make([]string, 0, 3) + if m.owner != nil { + edges = append(edges, personalaccesstoken.EdgeOwner) + } + if m.organizations != nil { + edges = append(edges, personalaccesstoken.EdgeOrganizations) + } + if m.events != nil { + edges = append(edges, personalaccesstoken.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *PersonalAccessTokenMutation) AddedIDs(name string) []ent.Value { + switch name { + case personalaccesstoken.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case personalaccesstoken.EdgeOrganizations: + ids := make([]ent.Value, 0, len(m.organizations)) + for id := range m.organizations { + ids = append(ids, id) + } + return ids + case personalaccesstoken.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *PersonalAccessTokenMutation) RemovedEdges() []string { + edges := make([]string, 0, 3) + if m.removedorganizations != nil { + edges = append(edges, personalaccesstoken.EdgeOrganizations) + } + if m.removedevents != nil { + edges = append(edges, personalaccesstoken.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *PersonalAccessTokenMutation) RemovedIDs(name string) []ent.Value { + switch name { + case personalaccesstoken.EdgeOrganizations: + ids := make([]ent.Value, 0, len(m.removedorganizations)) + for id := range m.removedorganizations { + ids = append(ids, id) + } + return ids + case personalaccesstoken.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *PersonalAccessTokenMutation) ClearedEdges() []string { + edges := make([]string, 0, 3) + if m.clearedowner { + edges = append(edges, personalaccesstoken.EdgeOwner) + } + if m.clearedorganizations { + edges = append(edges, personalaccesstoken.EdgeOrganizations) + } + if m.clearedevents { + edges = append(edges, personalaccesstoken.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *PersonalAccessTokenMutation) EdgeCleared(name string) bool { + switch name { + case personalaccesstoken.EdgeOwner: + return m.clearedowner + case personalaccesstoken.EdgeOrganizations: + return m.clearedorganizations + case personalaccesstoken.EdgeEvents: + return m.clearedevents + } + 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 *PersonalAccessTokenMutation) ClearEdge(name string) error { + switch name { + case personalaccesstoken.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown PersonalAccessToken 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 *PersonalAccessTokenMutation) ResetEdge(name string) error { + switch name { + case personalaccesstoken.EdgeOwner: + m.ResetOwner() + return nil + case personalaccesstoken.EdgeOrganizations: + m.ResetOrganizations() + return nil + case personalaccesstoken.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown PersonalAccessToken edge %s", name) +} + +// SubscriberMutation represents an operation that mutates the Subscriber nodes in the graph. +type SubscriberMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + email *string + phone_number *string + verified_email *bool + verified_phone *bool + active *bool + token *string + ttl *time.Time + secret *[]byte + clearedFields map[string]struct{} + owner *string + clearedowner bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + done bool + oldValue func(context.Context) (*Subscriber, error) + predicates []predicate.Subscriber +} + +var _ ent.Mutation = (*SubscriberMutation)(nil) + +// subscriberOption allows management of the mutation configuration using functional options. +type subscriberOption func(*SubscriberMutation) + +// newSubscriberMutation creates new mutation for the Subscriber entity. +func newSubscriberMutation(c config, op Op, opts ...subscriberOption) *SubscriberMutation { + m := &SubscriberMutation{ + config: c, + op: op, + typ: TypeSubscriber, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withSubscriberID sets the ID field of the mutation. +func withSubscriberID(id string) subscriberOption { + return func(m *SubscriberMutation) { + var ( + err error + once sync.Once + value *Subscriber + ) + m.oldValue = func(ctx context.Context) (*Subscriber, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Subscriber.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withSubscriber sets the old Subscriber of the mutation. +func withSubscriber(node *Subscriber) subscriberOption { + return func(m *SubscriberMutation) { + m.oldValue = func(context.Context) (*Subscriber, 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 SubscriberMutation) 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 SubscriberMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Subscriber entities. +func (m *SubscriberMutation) SetID(id string) { + 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 *SubscriberMutation) ID() (id string, 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 *SubscriberMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Subscriber.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *SubscriberMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *SubscriberMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *SubscriberMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[subscriber.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *SubscriberMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[subscriber.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *SubscriberMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, subscriber.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *SubscriberMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *SubscriberMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *SubscriberMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[subscriber.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *SubscriberMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[subscriber.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *SubscriberMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, subscriber.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *SubscriberMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *SubscriberMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *SubscriberMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[subscriber.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *SubscriberMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[subscriber.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *SubscriberMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, subscriber.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *SubscriberMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *SubscriberMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *SubscriberMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[subscriber.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *SubscriberMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[subscriber.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *SubscriberMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, subscriber.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *SubscriberMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *SubscriberMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *SubscriberMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *SubscriberMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *SubscriberMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *SubscriberMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *SubscriberMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *SubscriberMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[subscriber.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *SubscriberMutation) TagsCleared() bool { + _, ok := m.clearedFields[subscriber.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *SubscriberMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, subscriber.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *SubscriberMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *SubscriberMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *SubscriberMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[subscriber.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *SubscriberMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[subscriber.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *SubscriberMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, subscriber.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *SubscriberMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *SubscriberMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *SubscriberMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[subscriber.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *SubscriberMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[subscriber.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *SubscriberMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, subscriber.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *SubscriberMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *SubscriberMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *SubscriberMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[subscriber.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *SubscriberMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[subscriber.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *SubscriberMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, subscriber.FieldOwnerID) +} + +// SetEmail sets the "email" field. +func (m *SubscriberMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *SubscriberMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ResetEmail resets all changes to the "email" field. +func (m *SubscriberMutation) ResetEmail() { + m.email = nil +} + +// SetPhoneNumber sets the "phone_number" field. +func (m *SubscriberMutation) SetPhoneNumber(s string) { + m.phone_number = &s +} + +// PhoneNumber returns the value of the "phone_number" field in the mutation. +func (m *SubscriberMutation) PhoneNumber() (r string, exists bool) { + v := m.phone_number + if v == nil { + return + } + return *v, true +} + +// OldPhoneNumber returns the old "phone_number" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldPhoneNumber(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPhoneNumber is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPhoneNumber requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhoneNumber: %w", err) + } + return oldValue.PhoneNumber, nil +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (m *SubscriberMutation) ClearPhoneNumber() { + m.phone_number = nil + m.clearedFields[subscriber.FieldPhoneNumber] = struct{}{} +} + +// PhoneNumberCleared returns if the "phone_number" field was cleared in this mutation. +func (m *SubscriberMutation) PhoneNumberCleared() bool { + _, ok := m.clearedFields[subscriber.FieldPhoneNumber] + return ok +} + +// ResetPhoneNumber resets all changes to the "phone_number" field. +func (m *SubscriberMutation) ResetPhoneNumber() { + m.phone_number = nil + delete(m.clearedFields, subscriber.FieldPhoneNumber) +} + +// SetVerifiedEmail sets the "verified_email" field. +func (m *SubscriberMutation) SetVerifiedEmail(b bool) { + m.verified_email = &b +} + +// VerifiedEmail returns the value of the "verified_email" field in the mutation. +func (m *SubscriberMutation) VerifiedEmail() (r bool, exists bool) { + v := m.verified_email + if v == nil { + return + } + return *v, true +} + +// OldVerifiedEmail returns the old "verified_email" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldVerifiedEmail(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldVerifiedEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldVerifiedEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVerifiedEmail: %w", err) + } + return oldValue.VerifiedEmail, nil +} + +// ResetVerifiedEmail resets all changes to the "verified_email" field. +func (m *SubscriberMutation) ResetVerifiedEmail() { + m.verified_email = nil +} + +// SetVerifiedPhone sets the "verified_phone" field. +func (m *SubscriberMutation) SetVerifiedPhone(b bool) { + m.verified_phone = &b +} + +// VerifiedPhone returns the value of the "verified_phone" field in the mutation. +func (m *SubscriberMutation) VerifiedPhone() (r bool, exists bool) { + v := m.verified_phone + if v == nil { + return + } + return *v, true +} + +// OldVerifiedPhone returns the old "verified_phone" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldVerifiedPhone(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldVerifiedPhone is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldVerifiedPhone requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVerifiedPhone: %w", err) + } + return oldValue.VerifiedPhone, nil +} + +// ResetVerifiedPhone resets all changes to the "verified_phone" field. +func (m *SubscriberMutation) ResetVerifiedPhone() { + m.verified_phone = nil +} + +// SetActive sets the "active" field. +func (m *SubscriberMutation) SetActive(b bool) { + m.active = &b +} + +// Active returns the value of the "active" field in the mutation. +func (m *SubscriberMutation) Active() (r bool, exists bool) { + v := m.active + if v == nil { + return + } + return *v, true +} + +// OldActive returns the old "active" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldActive(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldActive is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldActive requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldActive: %w", err) + } + return oldValue.Active, nil +} + +// ResetActive resets all changes to the "active" field. +func (m *SubscriberMutation) ResetActive() { + m.active = nil +} + +// SetToken sets the "token" field. +func (m *SubscriberMutation) SetToken(s string) { + m.token = &s +} + +// Token returns the value of the "token" field in the mutation. +func (m *SubscriberMutation) Token() (r string, exists bool) { + v := m.token + if v == nil { + return + } + return *v, true +} + +// OldToken returns the old "token" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldToken(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldToken is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldToken requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldToken: %w", err) + } + return oldValue.Token, nil +} + +// ResetToken resets all changes to the "token" field. +func (m *SubscriberMutation) ResetToken() { + m.token = nil +} + +// SetTTL sets the "ttl" field. +func (m *SubscriberMutation) SetTTL(t time.Time) { + m.ttl = &t +} + +// TTL returns the value of the "ttl" field in the mutation. +func (m *SubscriberMutation) TTL() (r time.Time, exists bool) { + v := m.ttl + if v == nil { + return + } + return *v, true +} + +// OldTTL returns the old "ttl" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldTTL(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTTL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTTL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTTL: %w", err) + } + return oldValue.TTL, nil +} + +// ResetTTL resets all changes to the "ttl" field. +func (m *SubscriberMutation) ResetTTL() { + m.ttl = nil +} + +// SetSecret sets the "secret" field. +func (m *SubscriberMutation) SetSecret(b []byte) { + m.secret = &b +} + +// Secret returns the value of the "secret" field in the mutation. +func (m *SubscriberMutation) Secret() (r []byte, exists bool) { + v := m.secret + if v == nil { + return + } + return *v, true +} + +// OldSecret returns the old "secret" field's value of the Subscriber entity. +// If the Subscriber 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 *SubscriberMutation) OldSecret(ctx context.Context) (v *[]byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecret: %w", err) + } + return oldValue.Secret, nil +} + +// ResetSecret resets all changes to the "secret" field. +func (m *SubscriberMutation) ResetSecret() { + m.secret = nil +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *SubscriberMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[subscriber.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *SubscriberMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *SubscriberMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *SubscriberMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *SubscriberMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *SubscriberMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *SubscriberMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *SubscriberMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *SubscriberMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *SubscriberMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *SubscriberMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// Where appends a list predicates to the SubscriberMutation builder. +func (m *SubscriberMutation) Where(ps ...predicate.Subscriber) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the SubscriberMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *SubscriberMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Subscriber, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *SubscriberMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *SubscriberMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Subscriber). +func (m *SubscriberMutation) 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 *SubscriberMutation) Fields() []string { + fields := make([]string, 0, 17) + if m.created_at != nil { + fields = append(fields, subscriber.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, subscriber.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, subscriber.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, subscriber.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, subscriber.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, subscriber.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, subscriber.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, subscriber.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, subscriber.FieldOwnerID) + } + if m.email != nil { + fields = append(fields, subscriber.FieldEmail) + } + if m.phone_number != nil { + fields = append(fields, subscriber.FieldPhoneNumber) + } + if m.verified_email != nil { + fields = append(fields, subscriber.FieldVerifiedEmail) + } + if m.verified_phone != nil { + fields = append(fields, subscriber.FieldVerifiedPhone) + } + if m.active != nil { + fields = append(fields, subscriber.FieldActive) + } + if m.token != nil { + fields = append(fields, subscriber.FieldToken) + } + if m.ttl != nil { + fields = append(fields, subscriber.FieldTTL) + } + if m.secret != nil { + fields = append(fields, subscriber.FieldSecret) + } + 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 *SubscriberMutation) Field(name string) (ent.Value, bool) { + switch name { + case subscriber.FieldCreatedAt: + return m.CreatedAt() + case subscriber.FieldUpdatedAt: + return m.UpdatedAt() + case subscriber.FieldCreatedBy: + return m.CreatedBy() + case subscriber.FieldUpdatedBy: + return m.UpdatedBy() + case subscriber.FieldMappingID: + return m.MappingID() + case subscriber.FieldTags: + return m.Tags() + case subscriber.FieldDeletedAt: + return m.DeletedAt() + case subscriber.FieldDeletedBy: + return m.DeletedBy() + case subscriber.FieldOwnerID: + return m.OwnerID() + case subscriber.FieldEmail: + return m.Email() + case subscriber.FieldPhoneNumber: + return m.PhoneNumber() + case subscriber.FieldVerifiedEmail: + return m.VerifiedEmail() + case subscriber.FieldVerifiedPhone: + return m.VerifiedPhone() + case subscriber.FieldActive: + return m.Active() + case subscriber.FieldToken: + return m.Token() + case subscriber.FieldTTL: + return m.TTL() + case subscriber.FieldSecret: + return m.Secret() + } + 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 *SubscriberMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case subscriber.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case subscriber.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case subscriber.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case subscriber.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case subscriber.FieldMappingID: + return m.OldMappingID(ctx) + case subscriber.FieldTags: + return m.OldTags(ctx) + case subscriber.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case subscriber.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case subscriber.FieldOwnerID: + return m.OldOwnerID(ctx) + case subscriber.FieldEmail: + return m.OldEmail(ctx) + case subscriber.FieldPhoneNumber: + return m.OldPhoneNumber(ctx) + case subscriber.FieldVerifiedEmail: + return m.OldVerifiedEmail(ctx) + case subscriber.FieldVerifiedPhone: + return m.OldVerifiedPhone(ctx) + case subscriber.FieldActive: + return m.OldActive(ctx) + case subscriber.FieldToken: + return m.OldToken(ctx) + case subscriber.FieldTTL: + return m.OldTTL(ctx) + case subscriber.FieldSecret: + return m.OldSecret(ctx) + } + return nil, fmt.Errorf("unknown Subscriber 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 *SubscriberMutation) SetField(name string, value ent.Value) error { + switch name { + case subscriber.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case subscriber.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case subscriber.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case subscriber.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case subscriber.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case subscriber.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case subscriber.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case subscriber.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case subscriber.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case subscriber.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case subscriber.FieldPhoneNumber: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPhoneNumber(v) + return nil + case subscriber.FieldVerifiedEmail: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetVerifiedEmail(v) + return nil + case subscriber.FieldVerifiedPhone: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetVerifiedPhone(v) + return nil + case subscriber.FieldActive: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetActive(v) + return nil + case subscriber.FieldToken: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetToken(v) + return nil + case subscriber.FieldTTL: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTTL(v) + return nil + case subscriber.FieldSecret: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecret(v) + return nil + } + return fmt.Errorf("unknown Subscriber field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *SubscriberMutation) 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 *SubscriberMutation) 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 *SubscriberMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Subscriber numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *SubscriberMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(subscriber.FieldCreatedAt) { + fields = append(fields, subscriber.FieldCreatedAt) + } + if m.FieldCleared(subscriber.FieldUpdatedAt) { + fields = append(fields, subscriber.FieldUpdatedAt) + } + if m.FieldCleared(subscriber.FieldCreatedBy) { + fields = append(fields, subscriber.FieldCreatedBy) + } + if m.FieldCleared(subscriber.FieldUpdatedBy) { + fields = append(fields, subscriber.FieldUpdatedBy) + } + if m.FieldCleared(subscriber.FieldTags) { + fields = append(fields, subscriber.FieldTags) + } + if m.FieldCleared(subscriber.FieldDeletedAt) { + fields = append(fields, subscriber.FieldDeletedAt) + } + if m.FieldCleared(subscriber.FieldDeletedBy) { + fields = append(fields, subscriber.FieldDeletedBy) + } + if m.FieldCleared(subscriber.FieldOwnerID) { + fields = append(fields, subscriber.FieldOwnerID) + } + if m.FieldCleared(subscriber.FieldPhoneNumber) { + fields = append(fields, subscriber.FieldPhoneNumber) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *SubscriberMutation) 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 *SubscriberMutation) ClearField(name string) error { + switch name { + case subscriber.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case subscriber.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case subscriber.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case subscriber.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case subscriber.FieldTags: + m.ClearTags() + return nil + case subscriber.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case subscriber.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case subscriber.FieldOwnerID: + m.ClearOwnerID() + return nil + case subscriber.FieldPhoneNumber: + m.ClearPhoneNumber() + return nil + } + return fmt.Errorf("unknown Subscriber 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 *SubscriberMutation) ResetField(name string) error { + switch name { + case subscriber.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case subscriber.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case subscriber.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case subscriber.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case subscriber.FieldMappingID: + m.ResetMappingID() + return nil + case subscriber.FieldTags: + m.ResetTags() + return nil + case subscriber.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case subscriber.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case subscriber.FieldOwnerID: + m.ResetOwnerID() + return nil + case subscriber.FieldEmail: + m.ResetEmail() + return nil + case subscriber.FieldPhoneNumber: + m.ResetPhoneNumber() + return nil + case subscriber.FieldVerifiedEmail: + m.ResetVerifiedEmail() + return nil + case subscriber.FieldVerifiedPhone: + m.ResetVerifiedPhone() + return nil + case subscriber.FieldActive: + m.ResetActive() + return nil + case subscriber.FieldToken: + m.ResetToken() + return nil + case subscriber.FieldTTL: + m.ResetTTL() + return nil + case subscriber.FieldSecret: + m.ResetSecret() + return nil + } + return fmt.Errorf("unknown Subscriber field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *SubscriberMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.owner != nil { + edges = append(edges, subscriber.EdgeOwner) + } + if m.events != nil { + edges = append(edges, subscriber.EdgeEvents) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *SubscriberMutation) AddedIDs(name string) []ent.Value { + switch name { + case subscriber.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case subscriber.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *SubscriberMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removedevents != nil { + edges = append(edges, subscriber.EdgeEvents) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *SubscriberMutation) RemovedIDs(name string) []ent.Value { + switch name { + case subscriber.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *SubscriberMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedowner { + edges = append(edges, subscriber.EdgeOwner) + } + if m.clearedevents { + edges = append(edges, subscriber.EdgeEvents) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *SubscriberMutation) EdgeCleared(name string) bool { + switch name { + case subscriber.EdgeOwner: + return m.clearedowner + case subscriber.EdgeEvents: + return m.clearedevents + } + 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 *SubscriberMutation) ClearEdge(name string) error { + switch name { + case subscriber.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Subscriber 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 *SubscriberMutation) ResetEdge(name string) error { + switch name { + case subscriber.EdgeOwner: + m.ResetOwner() + return nil + case subscriber.EdgeEvents: + m.ResetEvents() + return nil + } + return fmt.Errorf("unknown Subscriber edge %s", name) +} + +// TFASettingMutation represents an operation that mutates the TFASetting nodes in the graph. +type TFASettingMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + deleted_at *time.Time + deleted_by *string + tags *[]string + appendtags []string + tfa_secret *string + verified *bool + recovery_codes *[]string + appendrecovery_codes []string + phone_otp_allowed *bool + email_otp_allowed *bool + totp_allowed *bool + clearedFields map[string]struct{} + owner *string + clearedowner bool + done bool + oldValue func(context.Context) (*TFASetting, error) + predicates []predicate.TFASetting +} + +var _ ent.Mutation = (*TFASettingMutation)(nil) + +// tfasettingOption allows management of the mutation configuration using functional options. +type tfasettingOption func(*TFASettingMutation) + +// newTFASettingMutation creates new mutation for the TFASetting entity. +func newTFASettingMutation(c config, op Op, opts ...tfasettingOption) *TFASettingMutation { + m := &TFASettingMutation{ + config: c, + op: op, + typ: TypeTFASetting, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withTFASettingID sets the ID field of the mutation. +func withTFASettingID(id string) tfasettingOption { + return func(m *TFASettingMutation) { + var ( + err error + once sync.Once + value *TFASetting + ) + m.oldValue = func(ctx context.Context) (*TFASetting, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().TFASetting.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withTFASetting sets the old TFASetting of the mutation. +func withTFASetting(node *TFASetting) tfasettingOption { + return func(m *TFASettingMutation) { + m.oldValue = func(context.Context) (*TFASetting, 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 TFASettingMutation) 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 TFASettingMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of TFASetting entities. +func (m *TFASettingMutation) SetID(id string) { + 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 *TFASettingMutation) ID() (id string, 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 *TFASettingMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().TFASetting.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *TFASettingMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *TFASettingMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *TFASettingMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[tfasetting.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *TFASettingMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *TFASettingMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, tfasetting.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *TFASettingMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *TFASettingMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *TFASettingMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[tfasetting.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *TFASettingMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *TFASettingMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, tfasetting.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *TFASettingMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *TFASettingMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *TFASettingMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[tfasetting.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *TFASettingMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *TFASettingMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, tfasetting.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *TFASettingMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *TFASettingMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *TFASettingMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[tfasetting.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *TFASettingMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *TFASettingMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, tfasetting.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *TFASettingMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *TFASettingMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *TFASettingMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *TFASettingMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *TFASettingMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *TFASettingMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[tfasetting.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *TFASettingMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *TFASettingMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, tfasetting.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *TFASettingMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *TFASettingMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *TFASettingMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[tfasetting.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *TFASettingMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *TFASettingMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, tfasetting.FieldDeletedBy) +} + +// SetTags sets the "tags" field. +func (m *TFASettingMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *TFASettingMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *TFASettingMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *TFASettingMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *TFASettingMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[tfasetting.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *TFASettingMutation) TagsCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *TFASettingMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, tfasetting.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *TFASettingMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *TFASettingMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *TFASettingMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[tfasetting.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *TFASettingMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *TFASettingMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, tfasetting.FieldOwnerID) +} + +// SetTfaSecret sets the "tfa_secret" field. +func (m *TFASettingMutation) SetTfaSecret(s string) { + m.tfa_secret = &s +} + +// TfaSecret returns the value of the "tfa_secret" field in the mutation. +func (m *TFASettingMutation) TfaSecret() (r string, exists bool) { + v := m.tfa_secret + if v == nil { + return + } + return *v, true +} + +// OldTfaSecret returns the old "tfa_secret" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldTfaSecret(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTfaSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTfaSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTfaSecret: %w", err) + } + return oldValue.TfaSecret, nil +} + +// ClearTfaSecret clears the value of the "tfa_secret" field. +func (m *TFASettingMutation) ClearTfaSecret() { + m.tfa_secret = nil + m.clearedFields[tfasetting.FieldTfaSecret] = struct{}{} +} + +// TfaSecretCleared returns if the "tfa_secret" field was cleared in this mutation. +func (m *TFASettingMutation) TfaSecretCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldTfaSecret] + return ok +} + +// ResetTfaSecret resets all changes to the "tfa_secret" field. +func (m *TFASettingMutation) ResetTfaSecret() { + m.tfa_secret = nil + delete(m.clearedFields, tfasetting.FieldTfaSecret) +} + +// SetVerified sets the "verified" field. +func (m *TFASettingMutation) SetVerified(b bool) { + m.verified = &b +} + +// Verified returns the value of the "verified" field in the mutation. +func (m *TFASettingMutation) Verified() (r bool, exists bool) { + v := m.verified + if v == nil { + return + } + return *v, true +} + +// OldVerified returns the old "verified" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldVerified(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldVerified is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldVerified requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldVerified: %w", err) + } + return oldValue.Verified, nil +} + +// ResetVerified resets all changes to the "verified" field. +func (m *TFASettingMutation) ResetVerified() { + m.verified = nil +} + +// SetRecoveryCodes sets the "recovery_codes" field. +func (m *TFASettingMutation) SetRecoveryCodes(s []string) { + m.recovery_codes = &s + m.appendrecovery_codes = nil +} + +// RecoveryCodes returns the value of the "recovery_codes" field in the mutation. +func (m *TFASettingMutation) RecoveryCodes() (r []string, exists bool) { + v := m.recovery_codes + if v == nil { + return + } + return *v, true +} + +// OldRecoveryCodes returns the old "recovery_codes" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldRecoveryCodes(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRecoveryCodes is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRecoveryCodes requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRecoveryCodes: %w", err) + } + return oldValue.RecoveryCodes, nil +} + +// AppendRecoveryCodes adds s to the "recovery_codes" field. +func (m *TFASettingMutation) AppendRecoveryCodes(s []string) { + m.appendrecovery_codes = append(m.appendrecovery_codes, s...) +} + +// AppendedRecoveryCodes returns the list of values that were appended to the "recovery_codes" field in this mutation. +func (m *TFASettingMutation) AppendedRecoveryCodes() ([]string, bool) { + if len(m.appendrecovery_codes) == 0 { + return nil, false + } + return m.appendrecovery_codes, true +} + +// ClearRecoveryCodes clears the value of the "recovery_codes" field. +func (m *TFASettingMutation) ClearRecoveryCodes() { + m.recovery_codes = nil + m.appendrecovery_codes = nil + m.clearedFields[tfasetting.FieldRecoveryCodes] = struct{}{} +} + +// RecoveryCodesCleared returns if the "recovery_codes" field was cleared in this mutation. +func (m *TFASettingMutation) RecoveryCodesCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldRecoveryCodes] + return ok +} + +// ResetRecoveryCodes resets all changes to the "recovery_codes" field. +func (m *TFASettingMutation) ResetRecoveryCodes() { + m.recovery_codes = nil + m.appendrecovery_codes = nil + delete(m.clearedFields, tfasetting.FieldRecoveryCodes) +} + +// SetPhoneOtpAllowed sets the "phone_otp_allowed" field. +func (m *TFASettingMutation) SetPhoneOtpAllowed(b bool) { + m.phone_otp_allowed = &b +} + +// PhoneOtpAllowed returns the value of the "phone_otp_allowed" field in the mutation. +func (m *TFASettingMutation) PhoneOtpAllowed() (r bool, exists bool) { + v := m.phone_otp_allowed + if v == nil { + return + } + return *v, true +} + +// OldPhoneOtpAllowed returns the old "phone_otp_allowed" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldPhoneOtpAllowed(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPhoneOtpAllowed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPhoneOtpAllowed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhoneOtpAllowed: %w", err) + } + return oldValue.PhoneOtpAllowed, nil +} + +// ClearPhoneOtpAllowed clears the value of the "phone_otp_allowed" field. +func (m *TFASettingMutation) ClearPhoneOtpAllowed() { + m.phone_otp_allowed = nil + m.clearedFields[tfasetting.FieldPhoneOtpAllowed] = struct{}{} +} + +// PhoneOtpAllowedCleared returns if the "phone_otp_allowed" field was cleared in this mutation. +func (m *TFASettingMutation) PhoneOtpAllowedCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldPhoneOtpAllowed] + return ok +} + +// ResetPhoneOtpAllowed resets all changes to the "phone_otp_allowed" field. +func (m *TFASettingMutation) ResetPhoneOtpAllowed() { + m.phone_otp_allowed = nil + delete(m.clearedFields, tfasetting.FieldPhoneOtpAllowed) +} + +// SetEmailOtpAllowed sets the "email_otp_allowed" field. +func (m *TFASettingMutation) SetEmailOtpAllowed(b bool) { + m.email_otp_allowed = &b +} + +// EmailOtpAllowed returns the value of the "email_otp_allowed" field in the mutation. +func (m *TFASettingMutation) EmailOtpAllowed() (r bool, exists bool) { + v := m.email_otp_allowed + if v == nil { + return + } + return *v, true +} + +// OldEmailOtpAllowed returns the old "email_otp_allowed" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldEmailOtpAllowed(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmailOtpAllowed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmailOtpAllowed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmailOtpAllowed: %w", err) + } + return oldValue.EmailOtpAllowed, nil +} + +// ClearEmailOtpAllowed clears the value of the "email_otp_allowed" field. +func (m *TFASettingMutation) ClearEmailOtpAllowed() { + m.email_otp_allowed = nil + m.clearedFields[tfasetting.FieldEmailOtpAllowed] = struct{}{} +} + +// EmailOtpAllowedCleared returns if the "email_otp_allowed" field was cleared in this mutation. +func (m *TFASettingMutation) EmailOtpAllowedCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldEmailOtpAllowed] + return ok +} + +// ResetEmailOtpAllowed resets all changes to the "email_otp_allowed" field. +func (m *TFASettingMutation) ResetEmailOtpAllowed() { + m.email_otp_allowed = nil + delete(m.clearedFields, tfasetting.FieldEmailOtpAllowed) +} + +// SetTotpAllowed sets the "totp_allowed" field. +func (m *TFASettingMutation) SetTotpAllowed(b bool) { + m.totp_allowed = &b +} + +// TotpAllowed returns the value of the "totp_allowed" field in the mutation. +func (m *TFASettingMutation) TotpAllowed() (r bool, exists bool) { + v := m.totp_allowed + if v == nil { + return + } + return *v, true +} + +// OldTotpAllowed returns the old "totp_allowed" field's value of the TFASetting entity. +// If the TFASetting 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 *TFASettingMutation) OldTotpAllowed(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTotpAllowed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTotpAllowed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTotpAllowed: %w", err) + } + return oldValue.TotpAllowed, nil +} + +// ClearTotpAllowed clears the value of the "totp_allowed" field. +func (m *TFASettingMutation) ClearTotpAllowed() { + m.totp_allowed = nil + m.clearedFields[tfasetting.FieldTotpAllowed] = struct{}{} +} + +// TotpAllowedCleared returns if the "totp_allowed" field was cleared in this mutation. +func (m *TFASettingMutation) TotpAllowedCleared() bool { + _, ok := m.clearedFields[tfasetting.FieldTotpAllowed] + return ok +} + +// ResetTotpAllowed resets all changes to the "totp_allowed" field. +func (m *TFASettingMutation) ResetTotpAllowed() { + m.totp_allowed = nil + delete(m.clearedFields, tfasetting.FieldTotpAllowed) +} + +// ClearOwner clears the "owner" edge to the User entity. +func (m *TFASettingMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[tfasetting.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the User entity was cleared. +func (m *TFASettingMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *TFASettingMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *TFASettingMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// Where appends a list predicates to the TFASettingMutation builder. +func (m *TFASettingMutation) Where(ps ...predicate.TFASetting) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the TFASettingMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *TFASettingMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.TFASetting, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *TFASettingMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *TFASettingMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (TFASetting). +func (m *TFASettingMutation) 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 *TFASettingMutation) Fields() []string { + fields := make([]string, 0, 15) + if m.created_at != nil { + fields = append(fields, tfasetting.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, tfasetting.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, tfasetting.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, tfasetting.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, tfasetting.FieldMappingID) + } + if m.deleted_at != nil { + fields = append(fields, tfasetting.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, tfasetting.FieldDeletedBy) + } + if m.tags != nil { + fields = append(fields, tfasetting.FieldTags) + } + if m.owner != nil { + fields = append(fields, tfasetting.FieldOwnerID) + } + if m.tfa_secret != nil { + fields = append(fields, tfasetting.FieldTfaSecret) + } + if m.verified != nil { + fields = append(fields, tfasetting.FieldVerified) + } + if m.recovery_codes != nil { + fields = append(fields, tfasetting.FieldRecoveryCodes) + } + if m.phone_otp_allowed != nil { + fields = append(fields, tfasetting.FieldPhoneOtpAllowed) + } + if m.email_otp_allowed != nil { + fields = append(fields, tfasetting.FieldEmailOtpAllowed) + } + if m.totp_allowed != nil { + fields = append(fields, tfasetting.FieldTotpAllowed) + } + 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 *TFASettingMutation) Field(name string) (ent.Value, bool) { + switch name { + case tfasetting.FieldCreatedAt: + return m.CreatedAt() + case tfasetting.FieldUpdatedAt: + return m.UpdatedAt() + case tfasetting.FieldCreatedBy: + return m.CreatedBy() + case tfasetting.FieldUpdatedBy: + return m.UpdatedBy() + case tfasetting.FieldMappingID: + return m.MappingID() + case tfasetting.FieldDeletedAt: + return m.DeletedAt() + case tfasetting.FieldDeletedBy: + return m.DeletedBy() + case tfasetting.FieldTags: + return m.Tags() + case tfasetting.FieldOwnerID: + return m.OwnerID() + case tfasetting.FieldTfaSecret: + return m.TfaSecret() + case tfasetting.FieldVerified: + return m.Verified() + case tfasetting.FieldRecoveryCodes: + return m.RecoveryCodes() + case tfasetting.FieldPhoneOtpAllowed: + return m.PhoneOtpAllowed() + case tfasetting.FieldEmailOtpAllowed: + return m.EmailOtpAllowed() + case tfasetting.FieldTotpAllowed: + return m.TotpAllowed() + } + 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 *TFASettingMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case tfasetting.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case tfasetting.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case tfasetting.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case tfasetting.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case tfasetting.FieldMappingID: + return m.OldMappingID(ctx) + case tfasetting.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case tfasetting.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case tfasetting.FieldTags: + return m.OldTags(ctx) + case tfasetting.FieldOwnerID: + return m.OldOwnerID(ctx) + case tfasetting.FieldTfaSecret: + return m.OldTfaSecret(ctx) + case tfasetting.FieldVerified: + return m.OldVerified(ctx) + case tfasetting.FieldRecoveryCodes: + return m.OldRecoveryCodes(ctx) + case tfasetting.FieldPhoneOtpAllowed: + return m.OldPhoneOtpAllowed(ctx) + case tfasetting.FieldEmailOtpAllowed: + return m.OldEmailOtpAllowed(ctx) + case tfasetting.FieldTotpAllowed: + return m.OldTotpAllowed(ctx) + } + return nil, fmt.Errorf("unknown TFASetting 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 *TFASettingMutation) SetField(name string, value ent.Value) error { + switch name { + case tfasetting.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case tfasetting.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case tfasetting.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case tfasetting.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case tfasetting.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case tfasetting.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case tfasetting.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case tfasetting.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case tfasetting.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case tfasetting.FieldTfaSecret: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTfaSecret(v) + return nil + case tfasetting.FieldVerified: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetVerified(v) + return nil + case tfasetting.FieldRecoveryCodes: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRecoveryCodes(v) + return nil + case tfasetting.FieldPhoneOtpAllowed: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPhoneOtpAllowed(v) + return nil + case tfasetting.FieldEmailOtpAllowed: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmailOtpAllowed(v) + return nil + case tfasetting.FieldTotpAllowed: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTotpAllowed(v) + return nil + } + return fmt.Errorf("unknown TFASetting field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *TFASettingMutation) 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 *TFASettingMutation) 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 *TFASettingMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown TFASetting numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *TFASettingMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(tfasetting.FieldCreatedAt) { + fields = append(fields, tfasetting.FieldCreatedAt) + } + if m.FieldCleared(tfasetting.FieldUpdatedAt) { + fields = append(fields, tfasetting.FieldUpdatedAt) + } + if m.FieldCleared(tfasetting.FieldCreatedBy) { + fields = append(fields, tfasetting.FieldCreatedBy) + } + if m.FieldCleared(tfasetting.FieldUpdatedBy) { + fields = append(fields, tfasetting.FieldUpdatedBy) + } + if m.FieldCleared(tfasetting.FieldDeletedAt) { + fields = append(fields, tfasetting.FieldDeletedAt) + } + if m.FieldCleared(tfasetting.FieldDeletedBy) { + fields = append(fields, tfasetting.FieldDeletedBy) + } + if m.FieldCleared(tfasetting.FieldTags) { + fields = append(fields, tfasetting.FieldTags) + } + if m.FieldCleared(tfasetting.FieldOwnerID) { + fields = append(fields, tfasetting.FieldOwnerID) + } + if m.FieldCleared(tfasetting.FieldTfaSecret) { + fields = append(fields, tfasetting.FieldTfaSecret) + } + if m.FieldCleared(tfasetting.FieldRecoveryCodes) { + fields = append(fields, tfasetting.FieldRecoveryCodes) + } + if m.FieldCleared(tfasetting.FieldPhoneOtpAllowed) { + fields = append(fields, tfasetting.FieldPhoneOtpAllowed) + } + if m.FieldCleared(tfasetting.FieldEmailOtpAllowed) { + fields = append(fields, tfasetting.FieldEmailOtpAllowed) + } + if m.FieldCleared(tfasetting.FieldTotpAllowed) { + fields = append(fields, tfasetting.FieldTotpAllowed) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *TFASettingMutation) 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 *TFASettingMutation) ClearField(name string) error { + switch name { + case tfasetting.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case tfasetting.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case tfasetting.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case tfasetting.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case tfasetting.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case tfasetting.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case tfasetting.FieldTags: + m.ClearTags() + return nil + case tfasetting.FieldOwnerID: + m.ClearOwnerID() + return nil + case tfasetting.FieldTfaSecret: + m.ClearTfaSecret() + return nil + case tfasetting.FieldRecoveryCodes: + m.ClearRecoveryCodes() + return nil + case tfasetting.FieldPhoneOtpAllowed: + m.ClearPhoneOtpAllowed() + return nil + case tfasetting.FieldEmailOtpAllowed: + m.ClearEmailOtpAllowed() + return nil + case tfasetting.FieldTotpAllowed: + m.ClearTotpAllowed() + return nil + } + return fmt.Errorf("unknown TFASetting 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 *TFASettingMutation) ResetField(name string) error { + switch name { + case tfasetting.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case tfasetting.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case tfasetting.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case tfasetting.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case tfasetting.FieldMappingID: + m.ResetMappingID() + return nil + case tfasetting.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case tfasetting.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case tfasetting.FieldTags: + m.ResetTags() + return nil + case tfasetting.FieldOwnerID: + m.ResetOwnerID() + return nil + case tfasetting.FieldTfaSecret: + m.ResetTfaSecret() + return nil + case tfasetting.FieldVerified: + m.ResetVerified() + return nil + case tfasetting.FieldRecoveryCodes: + m.ResetRecoveryCodes() + return nil + case tfasetting.FieldPhoneOtpAllowed: + m.ResetPhoneOtpAllowed() + return nil + case tfasetting.FieldEmailOtpAllowed: + m.ResetEmailOtpAllowed() + return nil + case tfasetting.FieldTotpAllowed: + m.ResetTotpAllowed() + return nil + } + return fmt.Errorf("unknown TFASetting field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *TFASettingMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.owner != nil { + edges = append(edges, tfasetting.EdgeOwner) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *TFASettingMutation) AddedIDs(name string) []ent.Value { + switch name { + case tfasetting.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *TFASettingMutation) 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 *TFASettingMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *TFASettingMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedowner { + edges = append(edges, tfasetting.EdgeOwner) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *TFASettingMutation) EdgeCleared(name string) bool { + switch name { + case tfasetting.EdgeOwner: + return m.clearedowner + } + 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 *TFASettingMutation) ClearEdge(name string) error { + switch name { + case tfasetting.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown TFASetting 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 *TFASettingMutation) ResetEdge(name string) error { + switch name { + case tfasetting.EdgeOwner: + m.ResetOwner() + return nil + } + return fmt.Errorf("unknown TFASetting edge %s", name) +} + +// TemplateMutation represents an operation that mutates the Template nodes in the graph. +type TemplateMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + name *string + template_type *enums.DocumentType + description *string + jsonconfig *customtypes.JSONObject + uischema *customtypes.JSONObject + clearedFields map[string]struct{} + owner *string + clearedowner bool + documents map[string]struct{} + removeddocuments map[string]struct{} + cleareddocuments bool + done bool + oldValue func(context.Context) (*Template, error) + predicates []predicate.Template +} + +var _ ent.Mutation = (*TemplateMutation)(nil) + +// templateOption allows management of the mutation configuration using functional options. +type templateOption func(*TemplateMutation) + +// newTemplateMutation creates new mutation for the Template entity. +func newTemplateMutation(c config, op Op, opts ...templateOption) *TemplateMutation { + m := &TemplateMutation{ + config: c, + op: op, + typ: TypeTemplate, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withTemplateID sets the ID field of the mutation. +func withTemplateID(id string) templateOption { + return func(m *TemplateMutation) { + var ( + err error + once sync.Once + value *Template + ) + m.oldValue = func(ctx context.Context) (*Template, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Template.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withTemplate sets the old Template of the mutation. +func withTemplate(node *Template) templateOption { + return func(m *TemplateMutation) { + m.oldValue = func(context.Context) (*Template, 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 TemplateMutation) 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 TemplateMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Template entities. +func (m *TemplateMutation) SetID(id string) { + 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 *TemplateMutation) ID() (id string, 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 *TemplateMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Template.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *TemplateMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *TemplateMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *TemplateMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[template.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *TemplateMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[template.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *TemplateMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, template.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *TemplateMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *TemplateMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *TemplateMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[template.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *TemplateMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[template.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *TemplateMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, template.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *TemplateMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *TemplateMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *TemplateMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[template.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *TemplateMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[template.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *TemplateMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, template.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *TemplateMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *TemplateMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *TemplateMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[template.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *TemplateMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[template.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *TemplateMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, template.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *TemplateMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *TemplateMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *TemplateMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[template.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *TemplateMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[template.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *TemplateMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, template.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *TemplateMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *TemplateMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *TemplateMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[template.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *TemplateMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[template.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *TemplateMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, template.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *TemplateMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *TemplateMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *TemplateMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *TemplateMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *TemplateMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *TemplateMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *TemplateMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *TemplateMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[template.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *TemplateMutation) TagsCleared() bool { + _, ok := m.clearedFields[template.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *TemplateMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, template.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *TemplateMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *TemplateMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *TemplateMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[template.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *TemplateMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[template.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *TemplateMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, template.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *TemplateMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *TemplateMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *TemplateMutation) ResetName() { + m.name = nil +} + +// SetTemplateType sets the "template_type" field. +func (m *TemplateMutation) SetTemplateType(et enums.DocumentType) { + m.template_type = &et +} + +// TemplateType returns the value of the "template_type" field in the mutation. +func (m *TemplateMutation) TemplateType() (r enums.DocumentType, exists bool) { + v := m.template_type + if v == nil { + return + } + return *v, true +} + +// OldTemplateType returns the old "template_type" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldTemplateType(ctx context.Context) (v enums.DocumentType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTemplateType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTemplateType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTemplateType: %w", err) + } + return oldValue.TemplateType, nil +} + +// ResetTemplateType resets all changes to the "template_type" field. +func (m *TemplateMutation) ResetTemplateType() { + m.template_type = nil +} + +// SetDescription sets the "description" field. +func (m *TemplateMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *TemplateMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *TemplateMutation) ClearDescription() { + m.description = nil + m.clearedFields[template.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *TemplateMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[template.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *TemplateMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, template.FieldDescription) +} + +// SetJsonconfig sets the "jsonconfig" field. +func (m *TemplateMutation) SetJsonconfig(co customtypes.JSONObject) { + m.jsonconfig = &co +} + +// Jsonconfig returns the value of the "jsonconfig" field in the mutation. +func (m *TemplateMutation) Jsonconfig() (r customtypes.JSONObject, exists bool) { + v := m.jsonconfig + if v == nil { + return + } + return *v, true +} + +// OldJsonconfig returns the old "jsonconfig" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldJsonconfig(ctx context.Context) (v customtypes.JSONObject, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldJsonconfig is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldJsonconfig requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldJsonconfig: %w", err) + } + return oldValue.Jsonconfig, nil +} + +// ResetJsonconfig resets all changes to the "jsonconfig" field. +func (m *TemplateMutation) ResetJsonconfig() { + m.jsonconfig = nil +} + +// SetUischema sets the "uischema" field. +func (m *TemplateMutation) SetUischema(co customtypes.JSONObject) { + m.uischema = &co +} + +// Uischema returns the value of the "uischema" field in the mutation. +func (m *TemplateMutation) Uischema() (r customtypes.JSONObject, exists bool) { + v := m.uischema + if v == nil { + return + } + return *v, true +} + +// OldUischema returns the old "uischema" field's value of the Template entity. +// If the Template 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 *TemplateMutation) OldUischema(ctx context.Context) (v customtypes.JSONObject, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUischema is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUischema requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUischema: %w", err) + } + return oldValue.Uischema, nil +} + +// ClearUischema clears the value of the "uischema" field. +func (m *TemplateMutation) ClearUischema() { + m.uischema = nil + m.clearedFields[template.FieldUischema] = struct{}{} +} + +// UischemaCleared returns if the "uischema" field was cleared in this mutation. +func (m *TemplateMutation) UischemaCleared() bool { + _, ok := m.clearedFields[template.FieldUischema] + return ok +} + +// ResetUischema resets all changes to the "uischema" field. +func (m *TemplateMutation) ResetUischema() { + m.uischema = nil + delete(m.clearedFields, template.FieldUischema) +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *TemplateMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[template.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *TemplateMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *TemplateMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *TemplateMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by ids. +func (m *TemplateMutation) AddDocumentIDs(ids ...string) { + if m.documents == nil { + m.documents = make(map[string]struct{}) + } + for i := range ids { + m.documents[ids[i]] = struct{}{} + } +} + +// ClearDocuments clears the "documents" edge to the DocumentData entity. +func (m *TemplateMutation) ClearDocuments() { + m.cleareddocuments = true +} + +// DocumentsCleared reports if the "documents" edge to the DocumentData entity was cleared. +func (m *TemplateMutation) DocumentsCleared() bool { + return m.cleareddocuments +} + +// RemoveDocumentIDs removes the "documents" edge to the DocumentData entity by IDs. +func (m *TemplateMutation) RemoveDocumentIDs(ids ...string) { + if m.removeddocuments == nil { + m.removeddocuments = make(map[string]struct{}) + } + for i := range ids { + delete(m.documents, ids[i]) + m.removeddocuments[ids[i]] = struct{}{} + } +} + +// RemovedDocuments returns the removed IDs of the "documents" edge to the DocumentData entity. +func (m *TemplateMutation) RemovedDocumentsIDs() (ids []string) { + for id := range m.removeddocuments { + ids = append(ids, id) + } + return +} + +// DocumentsIDs returns the "documents" edge IDs in the mutation. +func (m *TemplateMutation) DocumentsIDs() (ids []string) { + for id := range m.documents { + ids = append(ids, id) + } + return +} + +// ResetDocuments resets all changes to the "documents" edge. +func (m *TemplateMutation) ResetDocuments() { + m.documents = nil + m.cleareddocuments = false + m.removeddocuments = nil +} + +// Where appends a list predicates to the TemplateMutation builder. +func (m *TemplateMutation) Where(ps ...predicate.Template) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the TemplateMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *TemplateMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Template, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *TemplateMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *TemplateMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Template). +func (m *TemplateMutation) 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 *TemplateMutation) Fields() []string { + fields := make([]string, 0, 14) + if m.created_at != nil { + fields = append(fields, template.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, template.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, template.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, template.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, template.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, template.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, template.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, template.FieldTags) + } + if m.owner != nil { + fields = append(fields, template.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, template.FieldName) + } + if m.template_type != nil { + fields = append(fields, template.FieldTemplateType) + } + if m.description != nil { + fields = append(fields, template.FieldDescription) + } + if m.jsonconfig != nil { + fields = append(fields, template.FieldJsonconfig) + } + if m.uischema != nil { + fields = append(fields, template.FieldUischema) + } + 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 *TemplateMutation) Field(name string) (ent.Value, bool) { + switch name { + case template.FieldCreatedAt: + return m.CreatedAt() + case template.FieldUpdatedAt: + return m.UpdatedAt() + case template.FieldCreatedBy: + return m.CreatedBy() + case template.FieldUpdatedBy: + return m.UpdatedBy() + case template.FieldDeletedAt: + return m.DeletedAt() + case template.FieldDeletedBy: + return m.DeletedBy() + case template.FieldMappingID: + return m.MappingID() + case template.FieldTags: + return m.Tags() + case template.FieldOwnerID: + return m.OwnerID() + case template.FieldName: + return m.Name() + case template.FieldTemplateType: + return m.TemplateType() + case template.FieldDescription: + return m.Description() + case template.FieldJsonconfig: + return m.Jsonconfig() + case template.FieldUischema: + return m.Uischema() + } + 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 *TemplateMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case template.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case template.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case template.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case template.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case template.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case template.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case template.FieldMappingID: + return m.OldMappingID(ctx) + case template.FieldTags: + return m.OldTags(ctx) + case template.FieldOwnerID: + return m.OldOwnerID(ctx) + case template.FieldName: + return m.OldName(ctx) + case template.FieldTemplateType: + return m.OldTemplateType(ctx) + case template.FieldDescription: + return m.OldDescription(ctx) + case template.FieldJsonconfig: + return m.OldJsonconfig(ctx) + case template.FieldUischema: + return m.OldUischema(ctx) + } + return nil, fmt.Errorf("unknown Template 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 *TemplateMutation) SetField(name string, value ent.Value) error { + switch name { + case template.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case template.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case template.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case template.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case template.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case template.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case template.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case template.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case template.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case template.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case template.FieldTemplateType: + v, ok := value.(enums.DocumentType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTemplateType(v) + return nil + case template.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case template.FieldJsonconfig: + v, ok := value.(customtypes.JSONObject) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetJsonconfig(v) + return nil + case template.FieldUischema: + v, ok := value.(customtypes.JSONObject) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUischema(v) + return nil + } + return fmt.Errorf("unknown Template field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *TemplateMutation) 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 *TemplateMutation) 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 *TemplateMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown Template numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *TemplateMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(template.FieldCreatedAt) { + fields = append(fields, template.FieldCreatedAt) + } + if m.FieldCleared(template.FieldUpdatedAt) { + fields = append(fields, template.FieldUpdatedAt) + } + if m.FieldCleared(template.FieldCreatedBy) { + fields = append(fields, template.FieldCreatedBy) + } + if m.FieldCleared(template.FieldUpdatedBy) { + fields = append(fields, template.FieldUpdatedBy) + } + if m.FieldCleared(template.FieldDeletedAt) { + fields = append(fields, template.FieldDeletedAt) + } + if m.FieldCleared(template.FieldDeletedBy) { + fields = append(fields, template.FieldDeletedBy) + } + if m.FieldCleared(template.FieldTags) { + fields = append(fields, template.FieldTags) + } + if m.FieldCleared(template.FieldOwnerID) { + fields = append(fields, template.FieldOwnerID) + } + if m.FieldCleared(template.FieldDescription) { + fields = append(fields, template.FieldDescription) + } + if m.FieldCleared(template.FieldUischema) { + fields = append(fields, template.FieldUischema) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *TemplateMutation) 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 *TemplateMutation) ClearField(name string) error { + switch name { + case template.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case template.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case template.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case template.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case template.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case template.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case template.FieldTags: + m.ClearTags() + return nil + case template.FieldOwnerID: + m.ClearOwnerID() + return nil + case template.FieldDescription: + m.ClearDescription() + return nil + case template.FieldUischema: + m.ClearUischema() + return nil + } + return fmt.Errorf("unknown Template 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 *TemplateMutation) ResetField(name string) error { + switch name { + case template.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case template.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case template.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case template.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case template.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case template.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case template.FieldMappingID: + m.ResetMappingID() + return nil + case template.FieldTags: + m.ResetTags() + return nil + case template.FieldOwnerID: + m.ResetOwnerID() + return nil + case template.FieldName: + m.ResetName() + return nil + case template.FieldTemplateType: + m.ResetTemplateType() + return nil + case template.FieldDescription: + m.ResetDescription() + return nil + case template.FieldJsonconfig: + m.ResetJsonconfig() + return nil + case template.FieldUischema: + m.ResetUischema() + return nil + } + return fmt.Errorf("unknown Template field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *TemplateMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.owner != nil { + edges = append(edges, template.EdgeOwner) + } + if m.documents != nil { + edges = append(edges, template.EdgeDocuments) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *TemplateMutation) AddedIDs(name string) []ent.Value { + switch name { + case template.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case template.EdgeDocuments: + ids := make([]ent.Value, 0, len(m.documents)) + for id := range m.documents { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *TemplateMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + if m.removeddocuments != nil { + edges = append(edges, template.EdgeDocuments) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *TemplateMutation) RemovedIDs(name string) []ent.Value { + switch name { + case template.EdgeDocuments: + ids := make([]ent.Value, 0, len(m.removeddocuments)) + for id := range m.removeddocuments { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *TemplateMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.clearedowner { + edges = append(edges, template.EdgeOwner) + } + if m.cleareddocuments { + edges = append(edges, template.EdgeDocuments) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *TemplateMutation) EdgeCleared(name string) bool { + switch name { + case template.EdgeOwner: + return m.clearedowner + case template.EdgeDocuments: + return m.cleareddocuments + } + 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 *TemplateMutation) ClearEdge(name string) error { + switch name { + case template.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Template 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 *TemplateMutation) ResetEdge(name string) error { + switch name { + case template.EdgeOwner: + m.ResetOwner() + return nil + case template.EdgeDocuments: + m.ResetDocuments() + return nil + } + return fmt.Errorf("unknown Template edge %s", name) +} + +// TemplateHistoryMutation represents an operation that mutates the TemplateHistory nodes in the graph. +type TemplateHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + owner_id *string + name *string + template_type *enums.DocumentType + description *string + jsonconfig *customtypes.JSONObject + uischema *customtypes.JSONObject + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*TemplateHistory, error) + predicates []predicate.TemplateHistory +} + +var _ ent.Mutation = (*TemplateHistoryMutation)(nil) + +// templatehistoryOption allows management of the mutation configuration using functional options. +type templatehistoryOption func(*TemplateHistoryMutation) + +// newTemplateHistoryMutation creates new mutation for the TemplateHistory entity. +func newTemplateHistoryMutation(c config, op Op, opts ...templatehistoryOption) *TemplateHistoryMutation { + m := &TemplateHistoryMutation{ + config: c, + op: op, + typ: TypeTemplateHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withTemplateHistoryID sets the ID field of the mutation. +func withTemplateHistoryID(id string) templatehistoryOption { + return func(m *TemplateHistoryMutation) { + var ( + err error + once sync.Once + value *TemplateHistory + ) + m.oldValue = func(ctx context.Context) (*TemplateHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().TemplateHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withTemplateHistory sets the old TemplateHistory of the mutation. +func withTemplateHistory(node *TemplateHistory) templatehistoryOption { + return func(m *TemplateHistoryMutation) { + m.oldValue = func(context.Context) (*TemplateHistory, 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 TemplateHistoryMutation) 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 TemplateHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of TemplateHistory entities. +func (m *TemplateHistoryMutation) SetID(id string) { + 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 *TemplateHistoryMutation) ID() (id string, 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 *TemplateHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().TemplateHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *TemplateHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *TemplateHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *TemplateHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *TemplateHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *TemplateHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *TemplateHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[templatehistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *TemplateHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *TemplateHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, templatehistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *TemplateHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *TemplateHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *TemplateHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *TemplateHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *TemplateHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *TemplateHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[templatehistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *TemplateHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *TemplateHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, templatehistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *TemplateHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *TemplateHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *TemplateHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[templatehistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *TemplateHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *TemplateHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, templatehistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *TemplateHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *TemplateHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *TemplateHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[templatehistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *TemplateHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *TemplateHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, templatehistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *TemplateHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *TemplateHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *TemplateHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[templatehistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *TemplateHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *TemplateHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, templatehistory.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *TemplateHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *TemplateHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *TemplateHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[templatehistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *TemplateHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *TemplateHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, templatehistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *TemplateHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *TemplateHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *TemplateHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[templatehistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *TemplateHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *TemplateHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, templatehistory.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *TemplateHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *TemplateHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *TemplateHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *TemplateHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *TemplateHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *TemplateHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *TemplateHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *TemplateHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[templatehistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *TemplateHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *TemplateHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, templatehistory.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *TemplateHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *TemplateHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *TemplateHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[templatehistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *TemplateHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *TemplateHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, templatehistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *TemplateHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *TemplateHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *TemplateHistoryMutation) ResetName() { + m.name = nil +} + +// SetTemplateType sets the "template_type" field. +func (m *TemplateHistoryMutation) SetTemplateType(et enums.DocumentType) { + m.template_type = &et +} + +// TemplateType returns the value of the "template_type" field in the mutation. +func (m *TemplateHistoryMutation) TemplateType() (r enums.DocumentType, exists bool) { + v := m.template_type + if v == nil { + return + } + return *v, true +} + +// OldTemplateType returns the old "template_type" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldTemplateType(ctx context.Context) (v enums.DocumentType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTemplateType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTemplateType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTemplateType: %w", err) + } + return oldValue.TemplateType, nil +} + +// ResetTemplateType resets all changes to the "template_type" field. +func (m *TemplateHistoryMutation) ResetTemplateType() { + m.template_type = nil +} + +// SetDescription sets the "description" field. +func (m *TemplateHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *TemplateHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *TemplateHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[templatehistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *TemplateHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *TemplateHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, templatehistory.FieldDescription) +} + +// SetJsonconfig sets the "jsonconfig" field. +func (m *TemplateHistoryMutation) SetJsonconfig(co customtypes.JSONObject) { + m.jsonconfig = &co +} + +// Jsonconfig returns the value of the "jsonconfig" field in the mutation. +func (m *TemplateHistoryMutation) Jsonconfig() (r customtypes.JSONObject, exists bool) { + v := m.jsonconfig + if v == nil { + return + } + return *v, true +} + +// OldJsonconfig returns the old "jsonconfig" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldJsonconfig(ctx context.Context) (v customtypes.JSONObject, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldJsonconfig is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldJsonconfig requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldJsonconfig: %w", err) + } + return oldValue.Jsonconfig, nil +} + +// ResetJsonconfig resets all changes to the "jsonconfig" field. +func (m *TemplateHistoryMutation) ResetJsonconfig() { + m.jsonconfig = nil +} + +// SetUischema sets the "uischema" field. +func (m *TemplateHistoryMutation) SetUischema(co customtypes.JSONObject) { + m.uischema = &co +} + +// Uischema returns the value of the "uischema" field in the mutation. +func (m *TemplateHistoryMutation) Uischema() (r customtypes.JSONObject, exists bool) { + v := m.uischema + if v == nil { + return + } + return *v, true +} + +// OldUischema returns the old "uischema" field's value of the TemplateHistory entity. +// If the TemplateHistory 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 *TemplateHistoryMutation) OldUischema(ctx context.Context) (v customtypes.JSONObject, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUischema is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUischema requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUischema: %w", err) + } + return oldValue.Uischema, nil +} + +// ClearUischema clears the value of the "uischema" field. +func (m *TemplateHistoryMutation) ClearUischema() { + m.uischema = nil + m.clearedFields[templatehistory.FieldUischema] = struct{}{} +} + +// UischemaCleared returns if the "uischema" field was cleared in this mutation. +func (m *TemplateHistoryMutation) UischemaCleared() bool { + _, ok := m.clearedFields[templatehistory.FieldUischema] + return ok +} + +// ResetUischema resets all changes to the "uischema" field. +func (m *TemplateHistoryMutation) ResetUischema() { + m.uischema = nil + delete(m.clearedFields, templatehistory.FieldUischema) +} + +// Where appends a list predicates to the TemplateHistoryMutation builder. +func (m *TemplateHistoryMutation) Where(ps ...predicate.TemplateHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the TemplateHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *TemplateHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.TemplateHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *TemplateHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *TemplateHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (TemplateHistory). +func (m *TemplateHistoryMutation) 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 *TemplateHistoryMutation) Fields() []string { + fields := make([]string, 0, 17) + if m.history_time != nil { + fields = append(fields, templatehistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, templatehistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, templatehistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, templatehistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, templatehistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, templatehistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, templatehistory.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, templatehistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, templatehistory.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, templatehistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, templatehistory.FieldTags) + } + if m.owner_id != nil { + fields = append(fields, templatehistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, templatehistory.FieldName) + } + if m.template_type != nil { + fields = append(fields, templatehistory.FieldTemplateType) + } + if m.description != nil { + fields = append(fields, templatehistory.FieldDescription) + } + if m.jsonconfig != nil { + fields = append(fields, templatehistory.FieldJsonconfig) + } + if m.uischema != nil { + fields = append(fields, templatehistory.FieldUischema) + } + 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 *TemplateHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case templatehistory.FieldHistoryTime: + return m.HistoryTime() + case templatehistory.FieldRef: + return m.Ref() + case templatehistory.FieldOperation: + return m.Operation() + case templatehistory.FieldCreatedAt: + return m.CreatedAt() + case templatehistory.FieldUpdatedAt: + return m.UpdatedAt() + case templatehistory.FieldCreatedBy: + return m.CreatedBy() + case templatehistory.FieldUpdatedBy: + return m.UpdatedBy() + case templatehistory.FieldDeletedAt: + return m.DeletedAt() + case templatehistory.FieldDeletedBy: + return m.DeletedBy() + case templatehistory.FieldMappingID: + return m.MappingID() + case templatehistory.FieldTags: + return m.Tags() + case templatehistory.FieldOwnerID: + return m.OwnerID() + case templatehistory.FieldName: + return m.Name() + case templatehistory.FieldTemplateType: + return m.TemplateType() + case templatehistory.FieldDescription: + return m.Description() + case templatehistory.FieldJsonconfig: + return m.Jsonconfig() + case templatehistory.FieldUischema: + return m.Uischema() + } + 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 *TemplateHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case templatehistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case templatehistory.FieldRef: + return m.OldRef(ctx) + case templatehistory.FieldOperation: + return m.OldOperation(ctx) + case templatehistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case templatehistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case templatehistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case templatehistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case templatehistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case templatehistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case templatehistory.FieldMappingID: + return m.OldMappingID(ctx) + case templatehistory.FieldTags: + return m.OldTags(ctx) + case templatehistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case templatehistory.FieldName: + return m.OldName(ctx) + case templatehistory.FieldTemplateType: + return m.OldTemplateType(ctx) + case templatehistory.FieldDescription: + return m.OldDescription(ctx) + case templatehistory.FieldJsonconfig: + return m.OldJsonconfig(ctx) + case templatehistory.FieldUischema: + return m.OldUischema(ctx) + } + return nil, fmt.Errorf("unknown TemplateHistory 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 *TemplateHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case templatehistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case templatehistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case templatehistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case templatehistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case templatehistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case templatehistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case templatehistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case templatehistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case templatehistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case templatehistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case templatehistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case templatehistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case templatehistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case templatehistory.FieldTemplateType: + v, ok := value.(enums.DocumentType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTemplateType(v) + return nil + case templatehistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case templatehistory.FieldJsonconfig: + v, ok := value.(customtypes.JSONObject) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetJsonconfig(v) + return nil + case templatehistory.FieldUischema: + v, ok := value.(customtypes.JSONObject) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUischema(v) + return nil + } + return fmt.Errorf("unknown TemplateHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *TemplateHistoryMutation) 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 *TemplateHistoryMutation) 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 *TemplateHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown TemplateHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *TemplateHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(templatehistory.FieldRef) { + fields = append(fields, templatehistory.FieldRef) + } + if m.FieldCleared(templatehistory.FieldCreatedAt) { + fields = append(fields, templatehistory.FieldCreatedAt) + } + if m.FieldCleared(templatehistory.FieldUpdatedAt) { + fields = append(fields, templatehistory.FieldUpdatedAt) + } + if m.FieldCleared(templatehistory.FieldCreatedBy) { + fields = append(fields, templatehistory.FieldCreatedBy) + } + if m.FieldCleared(templatehistory.FieldUpdatedBy) { + fields = append(fields, templatehistory.FieldUpdatedBy) + } + if m.FieldCleared(templatehistory.FieldDeletedAt) { + fields = append(fields, templatehistory.FieldDeletedAt) + } + if m.FieldCleared(templatehistory.FieldDeletedBy) { + fields = append(fields, templatehistory.FieldDeletedBy) + } + if m.FieldCleared(templatehistory.FieldTags) { + fields = append(fields, templatehistory.FieldTags) + } + if m.FieldCleared(templatehistory.FieldOwnerID) { + fields = append(fields, templatehistory.FieldOwnerID) + } + if m.FieldCleared(templatehistory.FieldDescription) { + fields = append(fields, templatehistory.FieldDescription) + } + if m.FieldCleared(templatehistory.FieldUischema) { + fields = append(fields, templatehistory.FieldUischema) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *TemplateHistoryMutation) 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 *TemplateHistoryMutation) ClearField(name string) error { + switch name { + case templatehistory.FieldRef: + m.ClearRef() + return nil + case templatehistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case templatehistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case templatehistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case templatehistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case templatehistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case templatehistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case templatehistory.FieldTags: + m.ClearTags() + return nil + case templatehistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case templatehistory.FieldDescription: + m.ClearDescription() + return nil + case templatehistory.FieldUischema: + m.ClearUischema() + return nil + } + return fmt.Errorf("unknown TemplateHistory 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 *TemplateHistoryMutation) ResetField(name string) error { + switch name { + case templatehistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case templatehistory.FieldRef: + m.ResetRef() + return nil + case templatehistory.FieldOperation: + m.ResetOperation() + return nil + case templatehistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case templatehistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case templatehistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case templatehistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case templatehistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case templatehistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case templatehistory.FieldMappingID: + m.ResetMappingID() + return nil + case templatehistory.FieldTags: + m.ResetTags() + return nil + case templatehistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case templatehistory.FieldName: + m.ResetName() + return nil + case templatehistory.FieldTemplateType: + m.ResetTemplateType() + return nil + case templatehistory.FieldDescription: + m.ResetDescription() + return nil + case templatehistory.FieldJsonconfig: + m.ResetJsonconfig() + return nil + case templatehistory.FieldUischema: + m.ResetUischema() + return nil + } + return fmt.Errorf("unknown TemplateHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *TemplateHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *TemplateHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *TemplateHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *TemplateHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *TemplateHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *TemplateHistoryMutation) EdgeCleared(name string) bool { + 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 *TemplateHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown TemplateHistory 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 *TemplateHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown TemplateHistory edge %s", name) +} + +// UserMutation represents an operation that mutates the User nodes in the graph. +type UserMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + email *string + first_name *string + last_name *string + display_name *string + avatar_remote_url *string + avatar_local_file *string + avatar_updated_at *time.Time + last_seen *time.Time + password *string + sub *string + auth_provider *enums.AuthProvider + role *enums.Role + clearedFields map[string]struct{} + personal_access_tokens map[string]struct{} + removedpersonal_access_tokens map[string]struct{} + clearedpersonal_access_tokens bool + tfa_settings map[string]struct{} + removedtfa_settings map[string]struct{} + clearedtfa_settings bool + setting *string + clearedsetting bool + email_verification_tokens map[string]struct{} + removedemail_verification_tokens map[string]struct{} + clearedemail_verification_tokens bool + password_reset_tokens map[string]struct{} + removedpassword_reset_tokens map[string]struct{} + clearedpassword_reset_tokens bool + groups map[string]struct{} + removedgroups map[string]struct{} + clearedgroups bool + organizations map[string]struct{} + removedorganizations map[string]struct{} + clearedorganizations bool + webauthn map[string]struct{} + removedwebauthn map[string]struct{} + clearedwebauthn bool + files map[string]struct{} + removedfiles map[string]struct{} + clearedfiles bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + group_memberships map[string]struct{} + removedgroup_memberships map[string]struct{} + clearedgroup_memberships bool + org_memberships map[string]struct{} + removedorg_memberships map[string]struct{} + clearedorg_memberships bool + done bool + oldValue func(context.Context) (*User, error) + predicates []predicate.User +} + +var _ ent.Mutation = (*UserMutation)(nil) + +// userOption allows management of the mutation configuration using functional options. +type userOption func(*UserMutation) + +// newUserMutation creates new mutation for the User entity. +func newUserMutation(c config, op Op, opts ...userOption) *UserMutation { + m := &UserMutation{ + config: c, + op: op, + typ: TypeUser, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withUserID sets the ID field of the mutation. +func withUserID(id string) userOption { + return func(m *UserMutation) { + var ( + err error + once sync.Once + value *User + ) + m.oldValue = func(ctx context.Context) (*User, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().User.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUser sets the old User of the mutation. +func withUser(node *User) userOption { + return func(m *UserMutation) { + m.oldValue = func(context.Context) (*User, 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 UserMutation) 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 UserMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of User entities. +func (m *UserMutation) SetID(id string) { + 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 *UserMutation) ID() (id string, 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 *UserMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().User.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *UserMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *UserMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the User entity. +// If the User 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 *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *UserMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[user.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *UserMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[user.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *UserMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, user.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *UserMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *UserMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the User entity. +// If the User 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 *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *UserMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[user.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *UserMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[user.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *UserMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, user.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *UserMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *UserMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the User entity. +// If the User 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 *UserMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *UserMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[user.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *UserMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[user.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *UserMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, user.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *UserMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *UserMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the User entity. +// If the User 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 *UserMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *UserMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[user.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *UserMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[user.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *UserMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, user.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *UserMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *UserMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the User entity. +// If the User 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 *UserMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *UserMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[user.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *UserMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[user.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *UserMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, user.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *UserMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *UserMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the User entity. +// If the User 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 *UserMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *UserMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[user.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *UserMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[user.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *UserMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, user.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *UserMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *UserMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the User entity. +// If the User 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 *UserMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *UserMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *UserMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *UserMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the User entity. +// If the User 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 *UserMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *UserMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *UserMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *UserMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[user.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *UserMutation) TagsCleared() bool { + _, ok := m.clearedFields[user.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *UserMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, user.FieldTags) +} + +// SetEmail sets the "email" field. +func (m *UserMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *UserMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the User entity. +// If the User 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 *UserMutation) OldEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ResetEmail resets all changes to the "email" field. +func (m *UserMutation) ResetEmail() { + m.email = nil +} + +// SetFirstName sets the "first_name" field. +func (m *UserMutation) SetFirstName(s string) { + m.first_name = &s +} + +// FirstName returns the value of the "first_name" field in the mutation. +func (m *UserMutation) FirstName() (r string, exists bool) { + v := m.first_name + if v == nil { + return + } + return *v, true +} + +// OldFirstName returns the old "first_name" field's value of the User entity. +// If the User 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 *UserMutation) OldFirstName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFirstName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFirstName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFirstName: %w", err) + } + return oldValue.FirstName, nil +} + +// ClearFirstName clears the value of the "first_name" field. +func (m *UserMutation) ClearFirstName() { + m.first_name = nil + m.clearedFields[user.FieldFirstName] = struct{}{} +} + +// FirstNameCleared returns if the "first_name" field was cleared in this mutation. +func (m *UserMutation) FirstNameCleared() bool { + _, ok := m.clearedFields[user.FieldFirstName] + return ok +} + +// ResetFirstName resets all changes to the "first_name" field. +func (m *UserMutation) ResetFirstName() { + m.first_name = nil + delete(m.clearedFields, user.FieldFirstName) +} + +// SetLastName sets the "last_name" field. +func (m *UserMutation) SetLastName(s string) { + m.last_name = &s +} + +// LastName returns the value of the "last_name" field in the mutation. +func (m *UserMutation) LastName() (r string, exists bool) { + v := m.last_name + if v == nil { + return + } + return *v, true +} + +// OldLastName returns the old "last_name" field's value of the User entity. +// If the User 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 *UserMutation) OldLastName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastName: %w", err) + } + return oldValue.LastName, nil +} + +// ClearLastName clears the value of the "last_name" field. +func (m *UserMutation) ClearLastName() { + m.last_name = nil + m.clearedFields[user.FieldLastName] = struct{}{} +} + +// LastNameCleared returns if the "last_name" field was cleared in this mutation. +func (m *UserMutation) LastNameCleared() bool { + _, ok := m.clearedFields[user.FieldLastName] + return ok +} + +// ResetLastName resets all changes to the "last_name" field. +func (m *UserMutation) ResetLastName() { + m.last_name = nil + delete(m.clearedFields, user.FieldLastName) +} + +// SetDisplayName sets the "display_name" field. +func (m *UserMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *UserMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the User entity. +// If the User 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 *UserMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *UserMutation) ResetDisplayName() { + m.display_name = nil +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (m *UserMutation) SetAvatarRemoteURL(s string) { + m.avatar_remote_url = &s +} + +// AvatarRemoteURL returns the value of the "avatar_remote_url" field in the mutation. +func (m *UserMutation) AvatarRemoteURL() (r string, exists bool) { + v := m.avatar_remote_url + if v == nil { + return + } + return *v, true +} + +// OldAvatarRemoteURL returns the old "avatar_remote_url" field's value of the User entity. +// If the User 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 *UserMutation) OldAvatarRemoteURL(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarRemoteURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarRemoteURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarRemoteURL: %w", err) + } + return oldValue.AvatarRemoteURL, nil +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (m *UserMutation) ClearAvatarRemoteURL() { + m.avatar_remote_url = nil + m.clearedFields[user.FieldAvatarRemoteURL] = struct{}{} +} + +// AvatarRemoteURLCleared returns if the "avatar_remote_url" field was cleared in this mutation. +func (m *UserMutation) AvatarRemoteURLCleared() bool { + _, ok := m.clearedFields[user.FieldAvatarRemoteURL] + return ok +} + +// ResetAvatarRemoteURL resets all changes to the "avatar_remote_url" field. +func (m *UserMutation) ResetAvatarRemoteURL() { + m.avatar_remote_url = nil + delete(m.clearedFields, user.FieldAvatarRemoteURL) +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (m *UserMutation) SetAvatarLocalFile(s string) { + m.avatar_local_file = &s +} + +// AvatarLocalFile returns the value of the "avatar_local_file" field in the mutation. +func (m *UserMutation) AvatarLocalFile() (r string, exists bool) { + v := m.avatar_local_file + if v == nil { + return + } + return *v, true +} + +// OldAvatarLocalFile returns the old "avatar_local_file" field's value of the User entity. +// If the User 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 *UserMutation) OldAvatarLocalFile(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarLocalFile is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarLocalFile requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarLocalFile: %w", err) + } + return oldValue.AvatarLocalFile, nil +} + +// ClearAvatarLocalFile clears the value of the "avatar_local_file" field. +func (m *UserMutation) ClearAvatarLocalFile() { + m.avatar_local_file = nil + m.clearedFields[user.FieldAvatarLocalFile] = struct{}{} +} + +// AvatarLocalFileCleared returns if the "avatar_local_file" field was cleared in this mutation. +func (m *UserMutation) AvatarLocalFileCleared() bool { + _, ok := m.clearedFields[user.FieldAvatarLocalFile] + return ok +} + +// ResetAvatarLocalFile resets all changes to the "avatar_local_file" field. +func (m *UserMutation) ResetAvatarLocalFile() { + m.avatar_local_file = nil + delete(m.clearedFields, user.FieldAvatarLocalFile) +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (m *UserMutation) SetAvatarUpdatedAt(t time.Time) { + m.avatar_updated_at = &t +} + +// AvatarUpdatedAt returns the value of the "avatar_updated_at" field in the mutation. +func (m *UserMutation) AvatarUpdatedAt() (r time.Time, exists bool) { + v := m.avatar_updated_at + if v == nil { + return + } + return *v, true +} + +// OldAvatarUpdatedAt returns the old "avatar_updated_at" field's value of the User entity. +// If the User 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 *UserMutation) OldAvatarUpdatedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarUpdatedAt: %w", err) + } + return oldValue.AvatarUpdatedAt, nil +} + +// ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field. +func (m *UserMutation) ClearAvatarUpdatedAt() { + m.avatar_updated_at = nil + m.clearedFields[user.FieldAvatarUpdatedAt] = struct{}{} +} + +// AvatarUpdatedAtCleared returns if the "avatar_updated_at" field was cleared in this mutation. +func (m *UserMutation) AvatarUpdatedAtCleared() bool { + _, ok := m.clearedFields[user.FieldAvatarUpdatedAt] + return ok +} + +// ResetAvatarUpdatedAt resets all changes to the "avatar_updated_at" field. +func (m *UserMutation) ResetAvatarUpdatedAt() { + m.avatar_updated_at = nil + delete(m.clearedFields, user.FieldAvatarUpdatedAt) +} + +// SetLastSeen sets the "last_seen" field. +func (m *UserMutation) SetLastSeen(t time.Time) { + m.last_seen = &t +} + +// LastSeen returns the value of the "last_seen" field in the mutation. +func (m *UserMutation) LastSeen() (r time.Time, exists bool) { + v := m.last_seen + if v == nil { + return + } + return *v, true +} + +// OldLastSeen returns the old "last_seen" field's value of the User entity. +// If the User 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 *UserMutation) OldLastSeen(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastSeen is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastSeen requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastSeen: %w", err) + } + return oldValue.LastSeen, nil +} + +// ClearLastSeen clears the value of the "last_seen" field. +func (m *UserMutation) ClearLastSeen() { + m.last_seen = nil + m.clearedFields[user.FieldLastSeen] = struct{}{} +} + +// LastSeenCleared returns if the "last_seen" field was cleared in this mutation. +func (m *UserMutation) LastSeenCleared() bool { + _, ok := m.clearedFields[user.FieldLastSeen] + return ok +} + +// ResetLastSeen resets all changes to the "last_seen" field. +func (m *UserMutation) ResetLastSeen() { + m.last_seen = nil + delete(m.clearedFields, user.FieldLastSeen) +} + +// SetPassword sets the "password" field. +func (m *UserMutation) SetPassword(s string) { + m.password = &s +} + +// Password returns the value of the "password" field in the mutation. +func (m *UserMutation) Password() (r string, exists bool) { + v := m.password + if v == nil { + return + } + return *v, true +} + +// OldPassword returns the old "password" field's value of the User entity. +// If the User 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 *UserMutation) OldPassword(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// ClearPassword clears the value of the "password" field. +func (m *UserMutation) ClearPassword() { + m.password = nil + m.clearedFields[user.FieldPassword] = struct{}{} +} + +// PasswordCleared returns if the "password" field was cleared in this mutation. +func (m *UserMutation) PasswordCleared() bool { + _, ok := m.clearedFields[user.FieldPassword] + return ok +} + +// ResetPassword resets all changes to the "password" field. +func (m *UserMutation) ResetPassword() { + m.password = nil + delete(m.clearedFields, user.FieldPassword) +} + +// SetSub sets the "sub" field. +func (m *UserMutation) SetSub(s string) { + m.sub = &s +} + +// Sub returns the value of the "sub" field in the mutation. +func (m *UserMutation) Sub() (r string, exists bool) { + v := m.sub + if v == nil { + return + } + return *v, true +} + +// OldSub returns the old "sub" field's value of the User entity. +// If the User 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 *UserMutation) OldSub(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSub is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSub requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSub: %w", err) + } + return oldValue.Sub, nil +} + +// ClearSub clears the value of the "sub" field. +func (m *UserMutation) ClearSub() { + m.sub = nil + m.clearedFields[user.FieldSub] = struct{}{} +} + +// SubCleared returns if the "sub" field was cleared in this mutation. +func (m *UserMutation) SubCleared() bool { + _, ok := m.clearedFields[user.FieldSub] + return ok +} + +// ResetSub resets all changes to the "sub" field. +func (m *UserMutation) ResetSub() { + m.sub = nil + delete(m.clearedFields, user.FieldSub) +} + +// SetAuthProvider sets the "auth_provider" field. +func (m *UserMutation) SetAuthProvider(ep enums.AuthProvider) { + m.auth_provider = &ep +} + +// AuthProvider returns the value of the "auth_provider" field in the mutation. +func (m *UserMutation) AuthProvider() (r enums.AuthProvider, exists bool) { + v := m.auth_provider + if v == nil { + return + } + return *v, true +} + +// OldAuthProvider returns the old "auth_provider" field's value of the User entity. +// If the User 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 *UserMutation) OldAuthProvider(ctx context.Context) (v enums.AuthProvider, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthProvider is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthProvider requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthProvider: %w", err) + } + return oldValue.AuthProvider, nil +} + +// ResetAuthProvider resets all changes to the "auth_provider" field. +func (m *UserMutation) ResetAuthProvider() { + m.auth_provider = nil +} + +// SetRole sets the "role" field. +func (m *UserMutation) SetRole(e enums.Role) { + m.role = &e +} + +// Role returns the value of the "role" field in the mutation. +func (m *UserMutation) Role() (r enums.Role, exists bool) { + v := m.role + if v == nil { + return + } + return *v, true +} + +// OldRole returns the old "role" field's value of the User entity. +// If the User 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 *UserMutation) OldRole(ctx context.Context) (v enums.Role, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// ClearRole clears the value of the "role" field. +func (m *UserMutation) ClearRole() { + m.role = nil + m.clearedFields[user.FieldRole] = struct{}{} +} + +// RoleCleared returns if the "role" field was cleared in this mutation. +func (m *UserMutation) RoleCleared() bool { + _, ok := m.clearedFields[user.FieldRole] + return ok +} + +// ResetRole resets all changes to the "role" field. +func (m *UserMutation) ResetRole() { + m.role = nil + delete(m.clearedFields, user.FieldRole) +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by ids. +func (m *UserMutation) AddPersonalAccessTokenIDs(ids ...string) { + if m.personal_access_tokens == nil { + m.personal_access_tokens = make(map[string]struct{}) + } + for i := range ids { + m.personal_access_tokens[ids[i]] = struct{}{} + } +} + +// ClearPersonalAccessTokens clears the "personal_access_tokens" edge to the PersonalAccessToken entity. +func (m *UserMutation) ClearPersonalAccessTokens() { + m.clearedpersonal_access_tokens = true +} + +// PersonalAccessTokensCleared reports if the "personal_access_tokens" edge to the PersonalAccessToken entity was cleared. +func (m *UserMutation) PersonalAccessTokensCleared() bool { + return m.clearedpersonal_access_tokens +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (m *UserMutation) RemovePersonalAccessTokenIDs(ids ...string) { + if m.removedpersonal_access_tokens == nil { + m.removedpersonal_access_tokens = make(map[string]struct{}) + } + for i := range ids { + delete(m.personal_access_tokens, ids[i]) + m.removedpersonal_access_tokens[ids[i]] = struct{}{} + } +} + +// RemovedPersonalAccessTokens returns the removed IDs of the "personal_access_tokens" edge to the PersonalAccessToken entity. +func (m *UserMutation) RemovedPersonalAccessTokensIDs() (ids []string) { + for id := range m.removedpersonal_access_tokens { + ids = append(ids, id) + } + return +} + +// PersonalAccessTokensIDs returns the "personal_access_tokens" edge IDs in the mutation. +func (m *UserMutation) PersonalAccessTokensIDs() (ids []string) { + for id := range m.personal_access_tokens { + ids = append(ids, id) + } + return +} + +// ResetPersonalAccessTokens resets all changes to the "personal_access_tokens" edge. +func (m *UserMutation) ResetPersonalAccessTokens() { + m.personal_access_tokens = nil + m.clearedpersonal_access_tokens = false + m.removedpersonal_access_tokens = nil +} + +// AddTfaSettingIDs adds the "tfa_settings" edge to the TFASetting entity by ids. +func (m *UserMutation) AddTfaSettingIDs(ids ...string) { + if m.tfa_settings == nil { + m.tfa_settings = make(map[string]struct{}) + } + for i := range ids { + m.tfa_settings[ids[i]] = struct{}{} + } +} + +// ClearTfaSettings clears the "tfa_settings" edge to the TFASetting entity. +func (m *UserMutation) ClearTfaSettings() { + m.clearedtfa_settings = true +} + +// TfaSettingsCleared reports if the "tfa_settings" edge to the TFASetting entity was cleared. +func (m *UserMutation) TfaSettingsCleared() bool { + return m.clearedtfa_settings +} + +// RemoveTfaSettingIDs removes the "tfa_settings" edge to the TFASetting entity by IDs. +func (m *UserMutation) RemoveTfaSettingIDs(ids ...string) { + if m.removedtfa_settings == nil { + m.removedtfa_settings = make(map[string]struct{}) + } + for i := range ids { + delete(m.tfa_settings, ids[i]) + m.removedtfa_settings[ids[i]] = struct{}{} + } +} + +// RemovedTfaSettings returns the removed IDs of the "tfa_settings" edge to the TFASetting entity. +func (m *UserMutation) RemovedTfaSettingsIDs() (ids []string) { + for id := range m.removedtfa_settings { + ids = append(ids, id) + } + return +} + +// TfaSettingsIDs returns the "tfa_settings" edge IDs in the mutation. +func (m *UserMutation) TfaSettingsIDs() (ids []string) { + for id := range m.tfa_settings { + ids = append(ids, id) + } + return +} + +// ResetTfaSettings resets all changes to the "tfa_settings" edge. +func (m *UserMutation) ResetTfaSettings() { + m.tfa_settings = nil + m.clearedtfa_settings = false + m.removedtfa_settings = nil +} + +// SetSettingID sets the "setting" edge to the UserSetting entity by id. +func (m *UserMutation) SetSettingID(id string) { + m.setting = &id +} + +// ClearSetting clears the "setting" edge to the UserSetting entity. +func (m *UserMutation) ClearSetting() { + m.clearedsetting = true +} + +// SettingCleared reports if the "setting" edge to the UserSetting entity was cleared. +func (m *UserMutation) SettingCleared() bool { + return m.clearedsetting +} + +// SettingID returns the "setting" edge ID in the mutation. +func (m *UserMutation) SettingID() (id string, exists bool) { + if m.setting != nil { + return *m.setting, true + } + return +} + +// SettingIDs returns the "setting" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// SettingID instead. It exists only for internal usage by the builders. +func (m *UserMutation) SettingIDs() (ids []string) { + if id := m.setting; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetSetting resets all changes to the "setting" edge. +func (m *UserMutation) ResetSetting() { + m.setting = nil + m.clearedsetting = false +} + +// AddEmailVerificationTokenIDs adds the "email_verification_tokens" edge to the EmailVerificationToken entity by ids. +func (m *UserMutation) AddEmailVerificationTokenIDs(ids ...string) { + if m.email_verification_tokens == nil { + m.email_verification_tokens = make(map[string]struct{}) + } + for i := range ids { + m.email_verification_tokens[ids[i]] = struct{}{} + } +} + +// ClearEmailVerificationTokens clears the "email_verification_tokens" edge to the EmailVerificationToken entity. +func (m *UserMutation) ClearEmailVerificationTokens() { + m.clearedemail_verification_tokens = true +} + +// EmailVerificationTokensCleared reports if the "email_verification_tokens" edge to the EmailVerificationToken entity was cleared. +func (m *UserMutation) EmailVerificationTokensCleared() bool { + return m.clearedemail_verification_tokens +} + +// RemoveEmailVerificationTokenIDs removes the "email_verification_tokens" edge to the EmailVerificationToken entity by IDs. +func (m *UserMutation) RemoveEmailVerificationTokenIDs(ids ...string) { + if m.removedemail_verification_tokens == nil { + m.removedemail_verification_tokens = make(map[string]struct{}) + } + for i := range ids { + delete(m.email_verification_tokens, ids[i]) + m.removedemail_verification_tokens[ids[i]] = struct{}{} + } +} + +// RemovedEmailVerificationTokens returns the removed IDs of the "email_verification_tokens" edge to the EmailVerificationToken entity. +func (m *UserMutation) RemovedEmailVerificationTokensIDs() (ids []string) { + for id := range m.removedemail_verification_tokens { + ids = append(ids, id) + } + return +} + +// EmailVerificationTokensIDs returns the "email_verification_tokens" edge IDs in the mutation. +func (m *UserMutation) EmailVerificationTokensIDs() (ids []string) { + for id := range m.email_verification_tokens { + ids = append(ids, id) + } + return +} + +// ResetEmailVerificationTokens resets all changes to the "email_verification_tokens" edge. +func (m *UserMutation) ResetEmailVerificationTokens() { + m.email_verification_tokens = nil + m.clearedemail_verification_tokens = false + m.removedemail_verification_tokens = nil +} + +// AddPasswordResetTokenIDs adds the "password_reset_tokens" edge to the PasswordResetToken entity by ids. +func (m *UserMutation) AddPasswordResetTokenIDs(ids ...string) { + if m.password_reset_tokens == nil { + m.password_reset_tokens = make(map[string]struct{}) + } + for i := range ids { + m.password_reset_tokens[ids[i]] = struct{}{} + } +} + +// ClearPasswordResetTokens clears the "password_reset_tokens" edge to the PasswordResetToken entity. +func (m *UserMutation) ClearPasswordResetTokens() { + m.clearedpassword_reset_tokens = true +} + +// PasswordResetTokensCleared reports if the "password_reset_tokens" edge to the PasswordResetToken entity was cleared. +func (m *UserMutation) PasswordResetTokensCleared() bool { + return m.clearedpassword_reset_tokens +} + +// RemovePasswordResetTokenIDs removes the "password_reset_tokens" edge to the PasswordResetToken entity by IDs. +func (m *UserMutation) RemovePasswordResetTokenIDs(ids ...string) { + if m.removedpassword_reset_tokens == nil { + m.removedpassword_reset_tokens = make(map[string]struct{}) + } + for i := range ids { + delete(m.password_reset_tokens, ids[i]) + m.removedpassword_reset_tokens[ids[i]] = struct{}{} + } +} + +// RemovedPasswordResetTokens returns the removed IDs of the "password_reset_tokens" edge to the PasswordResetToken entity. +func (m *UserMutation) RemovedPasswordResetTokensIDs() (ids []string) { + for id := range m.removedpassword_reset_tokens { + ids = append(ids, id) + } + return +} + +// PasswordResetTokensIDs returns the "password_reset_tokens" edge IDs in the mutation. +func (m *UserMutation) PasswordResetTokensIDs() (ids []string) { + for id := range m.password_reset_tokens { + ids = append(ids, id) + } + return +} + +// ResetPasswordResetTokens resets all changes to the "password_reset_tokens" edge. +func (m *UserMutation) ResetPasswordResetTokens() { + m.password_reset_tokens = nil + m.clearedpassword_reset_tokens = false + m.removedpassword_reset_tokens = nil +} + +// AddGroupIDs adds the "groups" edge to the Group entity by ids. +func (m *UserMutation) AddGroupIDs(ids ...string) { + if m.groups == nil { + m.groups = make(map[string]struct{}) + } + for i := range ids { + m.groups[ids[i]] = struct{}{} + } +} + +// ClearGroups clears the "groups" edge to the Group entity. +func (m *UserMutation) ClearGroups() { + m.clearedgroups = true +} + +// GroupsCleared reports if the "groups" edge to the Group entity was cleared. +func (m *UserMutation) GroupsCleared() bool { + return m.clearedgroups +} + +// RemoveGroupIDs removes the "groups" edge to the Group entity by IDs. +func (m *UserMutation) RemoveGroupIDs(ids ...string) { + if m.removedgroups == nil { + m.removedgroups = make(map[string]struct{}) + } + for i := range ids { + delete(m.groups, ids[i]) + m.removedgroups[ids[i]] = struct{}{} + } +} + +// RemovedGroups returns the removed IDs of the "groups" edge to the Group entity. +func (m *UserMutation) RemovedGroupsIDs() (ids []string) { + for id := range m.removedgroups { + ids = append(ids, id) + } + return +} + +// GroupsIDs returns the "groups" edge IDs in the mutation. +func (m *UserMutation) GroupsIDs() (ids []string) { + for id := range m.groups { + ids = append(ids, id) + } + return +} + +// ResetGroups resets all changes to the "groups" edge. +func (m *UserMutation) ResetGroups() { + m.groups = nil + m.clearedgroups = false + m.removedgroups = nil +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by ids. +func (m *UserMutation) AddOrganizationIDs(ids ...string) { + if m.organizations == nil { + m.organizations = make(map[string]struct{}) + } + for i := range ids { + m.organizations[ids[i]] = struct{}{} + } +} + +// ClearOrganizations clears the "organizations" edge to the Organization entity. +func (m *UserMutation) ClearOrganizations() { + m.clearedorganizations = true +} + +// OrganizationsCleared reports if the "organizations" edge to the Organization entity was cleared. +func (m *UserMutation) OrganizationsCleared() bool { + return m.clearedorganizations +} + +// RemoveOrganizationIDs removes the "organizations" edge to the Organization entity by IDs. +func (m *UserMutation) RemoveOrganizationIDs(ids ...string) { + if m.removedorganizations == nil { + m.removedorganizations = make(map[string]struct{}) + } + for i := range ids { + delete(m.organizations, ids[i]) + m.removedorganizations[ids[i]] = struct{}{} + } +} + +// RemovedOrganizations returns the removed IDs of the "organizations" edge to the Organization entity. +func (m *UserMutation) RemovedOrganizationsIDs() (ids []string) { + for id := range m.removedorganizations { + ids = append(ids, id) + } + return +} + +// OrganizationsIDs returns the "organizations" edge IDs in the mutation. +func (m *UserMutation) OrganizationsIDs() (ids []string) { + for id := range m.organizations { + ids = append(ids, id) + } + return +} + +// ResetOrganizations resets all changes to the "organizations" edge. +func (m *UserMutation) ResetOrganizations() { + m.organizations = nil + m.clearedorganizations = false + m.removedorganizations = nil +} + +// AddWebauthnIDs adds the "webauthn" edge to the Webauthn entity by ids. +func (m *UserMutation) AddWebauthnIDs(ids ...string) { + if m.webauthn == nil { + m.webauthn = make(map[string]struct{}) + } + for i := range ids { + m.webauthn[ids[i]] = struct{}{} + } +} + +// ClearWebauthn clears the "webauthn" edge to the Webauthn entity. +func (m *UserMutation) ClearWebauthn() { + m.clearedwebauthn = true +} + +// WebauthnCleared reports if the "webauthn" edge to the Webauthn entity was cleared. +func (m *UserMutation) WebauthnCleared() bool { + return m.clearedwebauthn +} + +// RemoveWebauthnIDs removes the "webauthn" edge to the Webauthn entity by IDs. +func (m *UserMutation) RemoveWebauthnIDs(ids ...string) { + if m.removedwebauthn == nil { + m.removedwebauthn = make(map[string]struct{}) + } + for i := range ids { + delete(m.webauthn, ids[i]) + m.removedwebauthn[ids[i]] = struct{}{} + } +} + +// RemovedWebauthn returns the removed IDs of the "webauthn" edge to the Webauthn entity. +func (m *UserMutation) RemovedWebauthnIDs() (ids []string) { + for id := range m.removedwebauthn { + ids = append(ids, id) + } + return +} + +// WebauthnIDs returns the "webauthn" edge IDs in the mutation. +func (m *UserMutation) WebauthnIDs() (ids []string) { + for id := range m.webauthn { + ids = append(ids, id) + } + return +} + +// ResetWebauthn resets all changes to the "webauthn" edge. +func (m *UserMutation) ResetWebauthn() { + m.webauthn = nil + m.clearedwebauthn = false + m.removedwebauthn = nil +} + +// AddFileIDs adds the "files" edge to the File entity by ids. +func (m *UserMutation) AddFileIDs(ids ...string) { + if m.files == nil { + m.files = make(map[string]struct{}) + } + for i := range ids { + m.files[ids[i]] = struct{}{} + } +} + +// ClearFiles clears the "files" edge to the File entity. +func (m *UserMutation) ClearFiles() { + m.clearedfiles = true +} + +// FilesCleared reports if the "files" edge to the File entity was cleared. +func (m *UserMutation) FilesCleared() bool { + return m.clearedfiles +} + +// RemoveFileIDs removes the "files" edge to the File entity by IDs. +func (m *UserMutation) RemoveFileIDs(ids ...string) { + if m.removedfiles == nil { + m.removedfiles = make(map[string]struct{}) + } + for i := range ids { + delete(m.files, ids[i]) + m.removedfiles[ids[i]] = struct{}{} + } +} + +// RemovedFiles returns the removed IDs of the "files" edge to the File entity. +func (m *UserMutation) RemovedFilesIDs() (ids []string) { + for id := range m.removedfiles { + ids = append(ids, id) + } + return +} + +// FilesIDs returns the "files" edge IDs in the mutation. +func (m *UserMutation) FilesIDs() (ids []string) { + for id := range m.files { + ids = append(ids, id) + } + return +} + +// ResetFiles resets all changes to the "files" edge. +func (m *UserMutation) ResetFiles() { + m.files = nil + m.clearedfiles = false + m.removedfiles = nil +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *UserMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *UserMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *UserMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *UserMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *UserMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *UserMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *UserMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// AddGroupMembershipIDs adds the "group_memberships" edge to the GroupMembership entity by ids. +func (m *UserMutation) AddGroupMembershipIDs(ids ...string) { + if m.group_memberships == nil { + m.group_memberships = make(map[string]struct{}) + } + for i := range ids { + m.group_memberships[ids[i]] = struct{}{} + } +} + +// ClearGroupMemberships clears the "group_memberships" edge to the GroupMembership entity. +func (m *UserMutation) ClearGroupMemberships() { + m.clearedgroup_memberships = true +} + +// GroupMembershipsCleared reports if the "group_memberships" edge to the GroupMembership entity was cleared. +func (m *UserMutation) GroupMembershipsCleared() bool { + return m.clearedgroup_memberships +} + +// RemoveGroupMembershipIDs removes the "group_memberships" edge to the GroupMembership entity by IDs. +func (m *UserMutation) RemoveGroupMembershipIDs(ids ...string) { + if m.removedgroup_memberships == nil { + m.removedgroup_memberships = make(map[string]struct{}) + } + for i := range ids { + delete(m.group_memberships, ids[i]) + m.removedgroup_memberships[ids[i]] = struct{}{} + } +} + +// RemovedGroupMemberships returns the removed IDs of the "group_memberships" edge to the GroupMembership entity. +func (m *UserMutation) RemovedGroupMembershipsIDs() (ids []string) { + for id := range m.removedgroup_memberships { + ids = append(ids, id) + } + return +} + +// GroupMembershipsIDs returns the "group_memberships" edge IDs in the mutation. +func (m *UserMutation) GroupMembershipsIDs() (ids []string) { + for id := range m.group_memberships { + ids = append(ids, id) + } + return +} + +// ResetGroupMemberships resets all changes to the "group_memberships" edge. +func (m *UserMutation) ResetGroupMemberships() { + m.group_memberships = nil + m.clearedgroup_memberships = false + m.removedgroup_memberships = nil +} + +// AddOrgMembershipIDs adds the "org_memberships" edge to the OrgMembership entity by ids. +func (m *UserMutation) AddOrgMembershipIDs(ids ...string) { + if m.org_memberships == nil { + m.org_memberships = make(map[string]struct{}) + } + for i := range ids { + m.org_memberships[ids[i]] = struct{}{} + } +} + +// ClearOrgMemberships clears the "org_memberships" edge to the OrgMembership entity. +func (m *UserMutation) ClearOrgMemberships() { + m.clearedorg_memberships = true +} + +// OrgMembershipsCleared reports if the "org_memberships" edge to the OrgMembership entity was cleared. +func (m *UserMutation) OrgMembershipsCleared() bool { + return m.clearedorg_memberships +} + +// RemoveOrgMembershipIDs removes the "org_memberships" edge to the OrgMembership entity by IDs. +func (m *UserMutation) RemoveOrgMembershipIDs(ids ...string) { + if m.removedorg_memberships == nil { + m.removedorg_memberships = make(map[string]struct{}) + } + for i := range ids { + delete(m.org_memberships, ids[i]) + m.removedorg_memberships[ids[i]] = struct{}{} + } +} + +// RemovedOrgMemberships returns the removed IDs of the "org_memberships" edge to the OrgMembership entity. +func (m *UserMutation) RemovedOrgMembershipsIDs() (ids []string) { + for id := range m.removedorg_memberships { + ids = append(ids, id) + } + return +} + +// OrgMembershipsIDs returns the "org_memberships" edge IDs in the mutation. +func (m *UserMutation) OrgMembershipsIDs() (ids []string) { + for id := range m.org_memberships { + ids = append(ids, id) + } + return +} + +// ResetOrgMemberships resets all changes to the "org_memberships" edge. +func (m *UserMutation) ResetOrgMemberships() { + m.org_memberships = nil + m.clearedorg_memberships = false + m.removedorg_memberships = nil +} + +// Where appends a list predicates to the UserMutation builder. +func (m *UserMutation) Where(ps ...predicate.User) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the UserMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *UserMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.User, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *UserMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *UserMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (User). +func (m *UserMutation) 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 *UserMutation) Fields() []string { + fields := make([]string, 0, 20) + if m.created_at != nil { + fields = append(fields, user.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, user.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, user.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, user.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, user.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, user.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, user.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, user.FieldTags) + } + if m.email != nil { + fields = append(fields, user.FieldEmail) + } + if m.first_name != nil { + fields = append(fields, user.FieldFirstName) + } + if m.last_name != nil { + fields = append(fields, user.FieldLastName) + } + if m.display_name != nil { + fields = append(fields, user.FieldDisplayName) + } + if m.avatar_remote_url != nil { + fields = append(fields, user.FieldAvatarRemoteURL) + } + if m.avatar_local_file != nil { + fields = append(fields, user.FieldAvatarLocalFile) + } + if m.avatar_updated_at != nil { + fields = append(fields, user.FieldAvatarUpdatedAt) + } + if m.last_seen != nil { + fields = append(fields, user.FieldLastSeen) + } + if m.password != nil { + fields = append(fields, user.FieldPassword) + } + if m.sub != nil { + fields = append(fields, user.FieldSub) + } + if m.auth_provider != nil { + fields = append(fields, user.FieldAuthProvider) + } + if m.role != nil { + fields = append(fields, user.FieldRole) + } + 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 *UserMutation) Field(name string) (ent.Value, bool) { + switch name { + case user.FieldCreatedAt: + return m.CreatedAt() + case user.FieldUpdatedAt: + return m.UpdatedAt() + case user.FieldCreatedBy: + return m.CreatedBy() + case user.FieldUpdatedBy: + return m.UpdatedBy() + case user.FieldDeletedAt: + return m.DeletedAt() + case user.FieldDeletedBy: + return m.DeletedBy() + case user.FieldMappingID: + return m.MappingID() + case user.FieldTags: + return m.Tags() + case user.FieldEmail: + return m.Email() + case user.FieldFirstName: + return m.FirstName() + case user.FieldLastName: + return m.LastName() + case user.FieldDisplayName: + return m.DisplayName() + case user.FieldAvatarRemoteURL: + return m.AvatarRemoteURL() + case user.FieldAvatarLocalFile: + return m.AvatarLocalFile() + case user.FieldAvatarUpdatedAt: + return m.AvatarUpdatedAt() + case user.FieldLastSeen: + return m.LastSeen() + case user.FieldPassword: + return m.Password() + case user.FieldSub: + return m.Sub() + case user.FieldAuthProvider: + return m.AuthProvider() + case user.FieldRole: + return m.Role() + } + 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 *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case user.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case user.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case user.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case user.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case user.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case user.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case user.FieldMappingID: + return m.OldMappingID(ctx) + case user.FieldTags: + return m.OldTags(ctx) + case user.FieldEmail: + return m.OldEmail(ctx) + case user.FieldFirstName: + return m.OldFirstName(ctx) + case user.FieldLastName: + return m.OldLastName(ctx) + case user.FieldDisplayName: + return m.OldDisplayName(ctx) + case user.FieldAvatarRemoteURL: + return m.OldAvatarRemoteURL(ctx) + case user.FieldAvatarLocalFile: + return m.OldAvatarLocalFile(ctx) + case user.FieldAvatarUpdatedAt: + return m.OldAvatarUpdatedAt(ctx) + case user.FieldLastSeen: + return m.OldLastSeen(ctx) + case user.FieldPassword: + return m.OldPassword(ctx) + case user.FieldSub: + return m.OldSub(ctx) + case user.FieldAuthProvider: + return m.OldAuthProvider(ctx) + case user.FieldRole: + return m.OldRole(ctx) + } + return nil, fmt.Errorf("unknown User 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 *UserMutation) SetField(name string, value ent.Value) error { + switch name { + case user.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case user.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case user.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case user.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case user.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case user.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case user.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case user.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case user.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case user.FieldFirstName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFirstName(v) + return nil + case user.FieldLastName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastName(v) + return nil + case user.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case user.FieldAvatarRemoteURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarRemoteURL(v) + return nil + case user.FieldAvatarLocalFile: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarLocalFile(v) + return nil + case user.FieldAvatarUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarUpdatedAt(v) + return nil + case user.FieldLastSeen: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastSeen(v) + return nil + case user.FieldPassword: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPassword(v) + return nil + case user.FieldSub: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSub(v) + return nil + case user.FieldAuthProvider: + v, ok := value.(enums.AuthProvider) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthProvider(v) + return nil + case user.FieldRole: + v, ok := value.(enums.Role) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRole(v) + return nil + } + return fmt.Errorf("unknown User field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *UserMutation) 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 *UserMutation) 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 *UserMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown User numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *UserMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(user.FieldCreatedAt) { + fields = append(fields, user.FieldCreatedAt) + } + if m.FieldCleared(user.FieldUpdatedAt) { + fields = append(fields, user.FieldUpdatedAt) + } + if m.FieldCleared(user.FieldCreatedBy) { + fields = append(fields, user.FieldCreatedBy) + } + if m.FieldCleared(user.FieldUpdatedBy) { + fields = append(fields, user.FieldUpdatedBy) + } + if m.FieldCleared(user.FieldDeletedAt) { + fields = append(fields, user.FieldDeletedAt) + } + if m.FieldCleared(user.FieldDeletedBy) { + fields = append(fields, user.FieldDeletedBy) + } + if m.FieldCleared(user.FieldTags) { + fields = append(fields, user.FieldTags) + } + if m.FieldCleared(user.FieldFirstName) { + fields = append(fields, user.FieldFirstName) + } + if m.FieldCleared(user.FieldLastName) { + fields = append(fields, user.FieldLastName) + } + if m.FieldCleared(user.FieldAvatarRemoteURL) { + fields = append(fields, user.FieldAvatarRemoteURL) + } + if m.FieldCleared(user.FieldAvatarLocalFile) { + fields = append(fields, user.FieldAvatarLocalFile) + } + if m.FieldCleared(user.FieldAvatarUpdatedAt) { + fields = append(fields, user.FieldAvatarUpdatedAt) + } + if m.FieldCleared(user.FieldLastSeen) { + fields = append(fields, user.FieldLastSeen) + } + if m.FieldCleared(user.FieldPassword) { + fields = append(fields, user.FieldPassword) + } + if m.FieldCleared(user.FieldSub) { + fields = append(fields, user.FieldSub) + } + if m.FieldCleared(user.FieldRole) { + fields = append(fields, user.FieldRole) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *UserMutation) 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 *UserMutation) ClearField(name string) error { + switch name { + case user.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case user.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case user.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case user.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case user.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case user.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case user.FieldTags: + m.ClearTags() + return nil + case user.FieldFirstName: + m.ClearFirstName() + return nil + case user.FieldLastName: + m.ClearLastName() + return nil + case user.FieldAvatarRemoteURL: + m.ClearAvatarRemoteURL() + return nil + case user.FieldAvatarLocalFile: + m.ClearAvatarLocalFile() + return nil + case user.FieldAvatarUpdatedAt: + m.ClearAvatarUpdatedAt() + return nil + case user.FieldLastSeen: + m.ClearLastSeen() + return nil + case user.FieldPassword: + m.ClearPassword() + return nil + case user.FieldSub: + m.ClearSub() + return nil + case user.FieldRole: + m.ClearRole() + return nil + } + return fmt.Errorf("unknown User 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 *UserMutation) ResetField(name string) error { + switch name { + case user.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case user.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case user.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case user.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case user.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case user.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case user.FieldMappingID: + m.ResetMappingID() + return nil + case user.FieldTags: + m.ResetTags() + return nil + case user.FieldEmail: + m.ResetEmail() + return nil + case user.FieldFirstName: + m.ResetFirstName() + return nil + case user.FieldLastName: + m.ResetLastName() + return nil + case user.FieldDisplayName: + m.ResetDisplayName() + return nil + case user.FieldAvatarRemoteURL: + m.ResetAvatarRemoteURL() + return nil + case user.FieldAvatarLocalFile: + m.ResetAvatarLocalFile() + return nil + case user.FieldAvatarUpdatedAt: + m.ResetAvatarUpdatedAt() + return nil + case user.FieldLastSeen: + m.ResetLastSeen() + return nil + case user.FieldPassword: + m.ResetPassword() + return nil + case user.FieldSub: + m.ResetSub() + return nil + case user.FieldAuthProvider: + m.ResetAuthProvider() + return nil + case user.FieldRole: + m.ResetRole() + return nil + } + return fmt.Errorf("unknown User field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *UserMutation) AddedEdges() []string { + edges := make([]string, 0, 12) + if m.personal_access_tokens != nil { + edges = append(edges, user.EdgePersonalAccessTokens) + } + if m.tfa_settings != nil { + edges = append(edges, user.EdgeTfaSettings) + } + if m.setting != nil { + edges = append(edges, user.EdgeSetting) + } + if m.email_verification_tokens != nil { + edges = append(edges, user.EdgeEmailVerificationTokens) + } + if m.password_reset_tokens != nil { + edges = append(edges, user.EdgePasswordResetTokens) + } + if m.groups != nil { + edges = append(edges, user.EdgeGroups) + } + if m.organizations != nil { + edges = append(edges, user.EdgeOrganizations) + } + if m.webauthn != nil { + edges = append(edges, user.EdgeWebauthn) + } + if m.files != nil { + edges = append(edges, user.EdgeFiles) + } + if m.events != nil { + edges = append(edges, user.EdgeEvents) + } + if m.group_memberships != nil { + edges = append(edges, user.EdgeGroupMemberships) + } + if m.org_memberships != nil { + edges = append(edges, user.EdgeOrgMemberships) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *UserMutation) AddedIDs(name string) []ent.Value { + switch name { + case user.EdgePersonalAccessTokens: + ids := make([]ent.Value, 0, len(m.personal_access_tokens)) + for id := range m.personal_access_tokens { + ids = append(ids, id) + } + return ids + case user.EdgeTfaSettings: + ids := make([]ent.Value, 0, len(m.tfa_settings)) + for id := range m.tfa_settings { + ids = append(ids, id) + } + return ids + case user.EdgeSetting: + if id := m.setting; id != nil { + return []ent.Value{*id} + } + case user.EdgeEmailVerificationTokens: + ids := make([]ent.Value, 0, len(m.email_verification_tokens)) + for id := range m.email_verification_tokens { + ids = append(ids, id) + } + return ids + case user.EdgePasswordResetTokens: + ids := make([]ent.Value, 0, len(m.password_reset_tokens)) + for id := range m.password_reset_tokens { + ids = append(ids, id) + } + return ids + case user.EdgeGroups: + ids := make([]ent.Value, 0, len(m.groups)) + for id := range m.groups { + ids = append(ids, id) + } + return ids + case user.EdgeOrganizations: + ids := make([]ent.Value, 0, len(m.organizations)) + for id := range m.organizations { + ids = append(ids, id) + } + return ids + case user.EdgeWebauthn: + ids := make([]ent.Value, 0, len(m.webauthn)) + for id := range m.webauthn { + ids = append(ids, id) + } + return ids + case user.EdgeFiles: + ids := make([]ent.Value, 0, len(m.files)) + for id := range m.files { + ids = append(ids, id) + } + return ids + case user.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + case user.EdgeGroupMemberships: + ids := make([]ent.Value, 0, len(m.group_memberships)) + for id := range m.group_memberships { + ids = append(ids, id) + } + return ids + case user.EdgeOrgMemberships: + ids := make([]ent.Value, 0, len(m.org_memberships)) + for id := range m.org_memberships { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *UserMutation) RemovedEdges() []string { + edges := make([]string, 0, 12) + if m.removedpersonal_access_tokens != nil { + edges = append(edges, user.EdgePersonalAccessTokens) + } + if m.removedtfa_settings != nil { + edges = append(edges, user.EdgeTfaSettings) + } + if m.removedemail_verification_tokens != nil { + edges = append(edges, user.EdgeEmailVerificationTokens) + } + if m.removedpassword_reset_tokens != nil { + edges = append(edges, user.EdgePasswordResetTokens) + } + if m.removedgroups != nil { + edges = append(edges, user.EdgeGroups) + } + if m.removedorganizations != nil { + edges = append(edges, user.EdgeOrganizations) + } + if m.removedwebauthn != nil { + edges = append(edges, user.EdgeWebauthn) + } + if m.removedfiles != nil { + edges = append(edges, user.EdgeFiles) + } + if m.removedevents != nil { + edges = append(edges, user.EdgeEvents) + } + if m.removedgroup_memberships != nil { + edges = append(edges, user.EdgeGroupMemberships) + } + if m.removedorg_memberships != nil { + edges = append(edges, user.EdgeOrgMemberships) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *UserMutation) RemovedIDs(name string) []ent.Value { + switch name { + case user.EdgePersonalAccessTokens: + ids := make([]ent.Value, 0, len(m.removedpersonal_access_tokens)) + for id := range m.removedpersonal_access_tokens { + ids = append(ids, id) + } + return ids + case user.EdgeTfaSettings: + ids := make([]ent.Value, 0, len(m.removedtfa_settings)) + for id := range m.removedtfa_settings { + ids = append(ids, id) + } + return ids + case user.EdgeEmailVerificationTokens: + ids := make([]ent.Value, 0, len(m.removedemail_verification_tokens)) + for id := range m.removedemail_verification_tokens { + ids = append(ids, id) + } + return ids + case user.EdgePasswordResetTokens: + ids := make([]ent.Value, 0, len(m.removedpassword_reset_tokens)) + for id := range m.removedpassword_reset_tokens { + ids = append(ids, id) + } + return ids + case user.EdgeGroups: + ids := make([]ent.Value, 0, len(m.removedgroups)) + for id := range m.removedgroups { + ids = append(ids, id) + } + return ids + case user.EdgeOrganizations: + ids := make([]ent.Value, 0, len(m.removedorganizations)) + for id := range m.removedorganizations { + ids = append(ids, id) + } + return ids + case user.EdgeWebauthn: + ids := make([]ent.Value, 0, len(m.removedwebauthn)) + for id := range m.removedwebauthn { + ids = append(ids, id) + } + return ids + case user.EdgeFiles: + ids := make([]ent.Value, 0, len(m.removedfiles)) + for id := range m.removedfiles { + ids = append(ids, id) + } + return ids + case user.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + case user.EdgeGroupMemberships: + ids := make([]ent.Value, 0, len(m.removedgroup_memberships)) + for id := range m.removedgroup_memberships { + ids = append(ids, id) + } + return ids + case user.EdgeOrgMemberships: + ids := make([]ent.Value, 0, len(m.removedorg_memberships)) + for id := range m.removedorg_memberships { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *UserMutation) ClearedEdges() []string { + edges := make([]string, 0, 12) + if m.clearedpersonal_access_tokens { + edges = append(edges, user.EdgePersonalAccessTokens) + } + if m.clearedtfa_settings { + edges = append(edges, user.EdgeTfaSettings) + } + if m.clearedsetting { + edges = append(edges, user.EdgeSetting) + } + if m.clearedemail_verification_tokens { + edges = append(edges, user.EdgeEmailVerificationTokens) + } + if m.clearedpassword_reset_tokens { + edges = append(edges, user.EdgePasswordResetTokens) + } + if m.clearedgroups { + edges = append(edges, user.EdgeGroups) + } + if m.clearedorganizations { + edges = append(edges, user.EdgeOrganizations) + } + if m.clearedwebauthn { + edges = append(edges, user.EdgeWebauthn) + } + if m.clearedfiles { + edges = append(edges, user.EdgeFiles) + } + if m.clearedevents { + edges = append(edges, user.EdgeEvents) + } + if m.clearedgroup_memberships { + edges = append(edges, user.EdgeGroupMemberships) + } + if m.clearedorg_memberships { + edges = append(edges, user.EdgeOrgMemberships) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *UserMutation) EdgeCleared(name string) bool { + switch name { + case user.EdgePersonalAccessTokens: + return m.clearedpersonal_access_tokens + case user.EdgeTfaSettings: + return m.clearedtfa_settings + case user.EdgeSetting: + return m.clearedsetting + case user.EdgeEmailVerificationTokens: + return m.clearedemail_verification_tokens + case user.EdgePasswordResetTokens: + return m.clearedpassword_reset_tokens + case user.EdgeGroups: + return m.clearedgroups + case user.EdgeOrganizations: + return m.clearedorganizations + case user.EdgeWebauthn: + return m.clearedwebauthn + case user.EdgeFiles: + return m.clearedfiles + case user.EdgeEvents: + return m.clearedevents + case user.EdgeGroupMemberships: + return m.clearedgroup_memberships + case user.EdgeOrgMemberships: + return m.clearedorg_memberships + } + 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 *UserMutation) ClearEdge(name string) error { + switch name { + case user.EdgeSetting: + m.ClearSetting() + return nil + } + return fmt.Errorf("unknown User 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 *UserMutation) ResetEdge(name string) error { + switch name { + case user.EdgePersonalAccessTokens: + m.ResetPersonalAccessTokens() + return nil + case user.EdgeTfaSettings: + m.ResetTfaSettings() + return nil + case user.EdgeSetting: + m.ResetSetting() + return nil + case user.EdgeEmailVerificationTokens: + m.ResetEmailVerificationTokens() + return nil + case user.EdgePasswordResetTokens: + m.ResetPasswordResetTokens() + return nil + case user.EdgeGroups: + m.ResetGroups() + return nil + case user.EdgeOrganizations: + m.ResetOrganizations() + return nil + case user.EdgeWebauthn: + m.ResetWebauthn() + return nil + case user.EdgeFiles: + m.ResetFiles() + return nil + case user.EdgeEvents: + m.ResetEvents() + return nil + case user.EdgeGroupMemberships: + m.ResetGroupMemberships() + return nil + case user.EdgeOrgMemberships: + m.ResetOrgMemberships() + return nil + } + return fmt.Errorf("unknown User edge %s", name) +} + +// UserHistoryMutation represents an operation that mutates the UserHistory nodes in the graph. +type UserHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + deleted_at *time.Time + deleted_by *string + mapping_id *string + tags *[]string + appendtags []string + email *string + first_name *string + last_name *string + display_name *string + avatar_remote_url *string + avatar_local_file *string + avatar_updated_at *time.Time + last_seen *time.Time + password *string + sub *string + auth_provider *enums.AuthProvider + role *enums.Role + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*UserHistory, error) + predicates []predicate.UserHistory +} + +var _ ent.Mutation = (*UserHistoryMutation)(nil) + +// userhistoryOption allows management of the mutation configuration using functional options. +type userhistoryOption func(*UserHistoryMutation) + +// newUserHistoryMutation creates new mutation for the UserHistory entity. +func newUserHistoryMutation(c config, op Op, opts ...userhistoryOption) *UserHistoryMutation { + m := &UserHistoryMutation{ + config: c, + op: op, + typ: TypeUserHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withUserHistoryID sets the ID field of the mutation. +func withUserHistoryID(id string) userhistoryOption { + return func(m *UserHistoryMutation) { + var ( + err error + once sync.Once + value *UserHistory + ) + m.oldValue = func(ctx context.Context) (*UserHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().UserHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUserHistory sets the old UserHistory of the mutation. +func withUserHistory(node *UserHistory) userhistoryOption { + return func(m *UserHistoryMutation) { + m.oldValue = func(context.Context) (*UserHistory, 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 UserHistoryMutation) 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 UserHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of UserHistory entities. +func (m *UserHistoryMutation) SetID(id string) { + 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 *UserHistoryMutation) ID() (id string, 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 *UserHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().UserHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *UserHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *UserHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *UserHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *UserHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *UserHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *UserHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[userhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *UserHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[userhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *UserHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, userhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *UserHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *UserHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *UserHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *UserHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *UserHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *UserHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[userhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *UserHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[userhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *UserHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, userhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *UserHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *UserHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *UserHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[userhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *UserHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[userhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *UserHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, userhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *UserHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *UserHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *UserHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[userhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *UserHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[userhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *UserHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, userhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *UserHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *UserHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *UserHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[userhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *UserHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[userhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *UserHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, userhistory.FieldUpdatedBy) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *UserHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *UserHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *UserHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[userhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *UserHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[userhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *UserHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, userhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *UserHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *UserHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *UserHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[userhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *UserHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[userhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *UserHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, userhistory.FieldDeletedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *UserHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *UserHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *UserHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *UserHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *UserHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *UserHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *UserHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *UserHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[userhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *UserHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[userhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *UserHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, userhistory.FieldTags) +} + +// SetEmail sets the "email" field. +func (m *UserHistoryMutation) SetEmail(s string) { + m.email = &s +} + +// Email returns the value of the "email" field in the mutation. +func (m *UserHistoryMutation) Email() (r string, exists bool) { + v := m.email + if v == nil { + return + } + return *v, true +} + +// OldEmail returns the old "email" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldEmail(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmail is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmail requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmail: %w", err) + } + return oldValue.Email, nil +} + +// ResetEmail resets all changes to the "email" field. +func (m *UserHistoryMutation) ResetEmail() { + m.email = nil +} + +// SetFirstName sets the "first_name" field. +func (m *UserHistoryMutation) SetFirstName(s string) { + m.first_name = &s +} + +// FirstName returns the value of the "first_name" field in the mutation. +func (m *UserHistoryMutation) FirstName() (r string, exists bool) { + v := m.first_name + if v == nil { + return + } + return *v, true +} + +// OldFirstName returns the old "first_name" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldFirstName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFirstName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFirstName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFirstName: %w", err) + } + return oldValue.FirstName, nil +} + +// ClearFirstName clears the value of the "first_name" field. +func (m *UserHistoryMutation) ClearFirstName() { + m.first_name = nil + m.clearedFields[userhistory.FieldFirstName] = struct{}{} +} + +// FirstNameCleared returns if the "first_name" field was cleared in this mutation. +func (m *UserHistoryMutation) FirstNameCleared() bool { + _, ok := m.clearedFields[userhistory.FieldFirstName] + return ok +} + +// ResetFirstName resets all changes to the "first_name" field. +func (m *UserHistoryMutation) ResetFirstName() { + m.first_name = nil + delete(m.clearedFields, userhistory.FieldFirstName) +} + +// SetLastName sets the "last_name" field. +func (m *UserHistoryMutation) SetLastName(s string) { + m.last_name = &s +} + +// LastName returns the value of the "last_name" field in the mutation. +func (m *UserHistoryMutation) LastName() (r string, exists bool) { + v := m.last_name + if v == nil { + return + } + return *v, true +} + +// OldLastName returns the old "last_name" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldLastName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastName: %w", err) + } + return oldValue.LastName, nil +} + +// ClearLastName clears the value of the "last_name" field. +func (m *UserHistoryMutation) ClearLastName() { + m.last_name = nil + m.clearedFields[userhistory.FieldLastName] = struct{}{} +} + +// LastNameCleared returns if the "last_name" field was cleared in this mutation. +func (m *UserHistoryMutation) LastNameCleared() bool { + _, ok := m.clearedFields[userhistory.FieldLastName] + return ok +} + +// ResetLastName resets all changes to the "last_name" field. +func (m *UserHistoryMutation) ResetLastName() { + m.last_name = nil + delete(m.clearedFields, userhistory.FieldLastName) +} + +// SetDisplayName sets the "display_name" field. +func (m *UserHistoryMutation) SetDisplayName(s string) { + m.display_name = &s +} + +// DisplayName returns the value of the "display_name" field in the mutation. +func (m *UserHistoryMutation) DisplayName() (r string, exists bool) { + v := m.display_name + if v == nil { + return + } + return *v, true +} + +// OldDisplayName returns the old "display_name" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldDisplayName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDisplayName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDisplayName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDisplayName: %w", err) + } + return oldValue.DisplayName, nil +} + +// ResetDisplayName resets all changes to the "display_name" field. +func (m *UserHistoryMutation) ResetDisplayName() { + m.display_name = nil +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (m *UserHistoryMutation) SetAvatarRemoteURL(s string) { + m.avatar_remote_url = &s +} + +// AvatarRemoteURL returns the value of the "avatar_remote_url" field in the mutation. +func (m *UserHistoryMutation) AvatarRemoteURL() (r string, exists bool) { + v := m.avatar_remote_url + if v == nil { + return + } + return *v, true +} + +// OldAvatarRemoteURL returns the old "avatar_remote_url" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldAvatarRemoteURL(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarRemoteURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarRemoteURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarRemoteURL: %w", err) + } + return oldValue.AvatarRemoteURL, nil +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (m *UserHistoryMutation) ClearAvatarRemoteURL() { + m.avatar_remote_url = nil + m.clearedFields[userhistory.FieldAvatarRemoteURL] = struct{}{} +} + +// AvatarRemoteURLCleared returns if the "avatar_remote_url" field was cleared in this mutation. +func (m *UserHistoryMutation) AvatarRemoteURLCleared() bool { + _, ok := m.clearedFields[userhistory.FieldAvatarRemoteURL] + return ok +} + +// ResetAvatarRemoteURL resets all changes to the "avatar_remote_url" field. +func (m *UserHistoryMutation) ResetAvatarRemoteURL() { + m.avatar_remote_url = nil + delete(m.clearedFields, userhistory.FieldAvatarRemoteURL) +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (m *UserHistoryMutation) SetAvatarLocalFile(s string) { + m.avatar_local_file = &s +} + +// AvatarLocalFile returns the value of the "avatar_local_file" field in the mutation. +func (m *UserHistoryMutation) AvatarLocalFile() (r string, exists bool) { + v := m.avatar_local_file + if v == nil { + return + } + return *v, true +} + +// OldAvatarLocalFile returns the old "avatar_local_file" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldAvatarLocalFile(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarLocalFile is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarLocalFile requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarLocalFile: %w", err) + } + return oldValue.AvatarLocalFile, nil +} + +// ClearAvatarLocalFile clears the value of the "avatar_local_file" field. +func (m *UserHistoryMutation) ClearAvatarLocalFile() { + m.avatar_local_file = nil + m.clearedFields[userhistory.FieldAvatarLocalFile] = struct{}{} +} + +// AvatarLocalFileCleared returns if the "avatar_local_file" field was cleared in this mutation. +func (m *UserHistoryMutation) AvatarLocalFileCleared() bool { + _, ok := m.clearedFields[userhistory.FieldAvatarLocalFile] + return ok +} + +// ResetAvatarLocalFile resets all changes to the "avatar_local_file" field. +func (m *UserHistoryMutation) ResetAvatarLocalFile() { + m.avatar_local_file = nil + delete(m.clearedFields, userhistory.FieldAvatarLocalFile) +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (m *UserHistoryMutation) SetAvatarUpdatedAt(t time.Time) { + m.avatar_updated_at = &t +} + +// AvatarUpdatedAt returns the value of the "avatar_updated_at" field in the mutation. +func (m *UserHistoryMutation) AvatarUpdatedAt() (r time.Time, exists bool) { + v := m.avatar_updated_at + if v == nil { + return + } + return *v, true +} + +// OldAvatarUpdatedAt returns the old "avatar_updated_at" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldAvatarUpdatedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAvatarUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAvatarUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAvatarUpdatedAt: %w", err) + } + return oldValue.AvatarUpdatedAt, nil +} + +// ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field. +func (m *UserHistoryMutation) ClearAvatarUpdatedAt() { + m.avatar_updated_at = nil + m.clearedFields[userhistory.FieldAvatarUpdatedAt] = struct{}{} +} + +// AvatarUpdatedAtCleared returns if the "avatar_updated_at" field was cleared in this mutation. +func (m *UserHistoryMutation) AvatarUpdatedAtCleared() bool { + _, ok := m.clearedFields[userhistory.FieldAvatarUpdatedAt] + return ok +} + +// ResetAvatarUpdatedAt resets all changes to the "avatar_updated_at" field. +func (m *UserHistoryMutation) ResetAvatarUpdatedAt() { + m.avatar_updated_at = nil + delete(m.clearedFields, userhistory.FieldAvatarUpdatedAt) +} + +// SetLastSeen sets the "last_seen" field. +func (m *UserHistoryMutation) SetLastSeen(t time.Time) { + m.last_seen = &t +} + +// LastSeen returns the value of the "last_seen" field in the mutation. +func (m *UserHistoryMutation) LastSeen() (r time.Time, exists bool) { + v := m.last_seen + if v == nil { + return + } + return *v, true +} + +// OldLastSeen returns the old "last_seen" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldLastSeen(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastSeen is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastSeen requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastSeen: %w", err) + } + return oldValue.LastSeen, nil +} + +// ClearLastSeen clears the value of the "last_seen" field. +func (m *UserHistoryMutation) ClearLastSeen() { + m.last_seen = nil + m.clearedFields[userhistory.FieldLastSeen] = struct{}{} +} + +// LastSeenCleared returns if the "last_seen" field was cleared in this mutation. +func (m *UserHistoryMutation) LastSeenCleared() bool { + _, ok := m.clearedFields[userhistory.FieldLastSeen] + return ok +} + +// ResetLastSeen resets all changes to the "last_seen" field. +func (m *UserHistoryMutation) ResetLastSeen() { + m.last_seen = nil + delete(m.clearedFields, userhistory.FieldLastSeen) +} + +// SetPassword sets the "password" field. +func (m *UserHistoryMutation) SetPassword(s string) { + m.password = &s +} + +// Password returns the value of the "password" field in the mutation. +func (m *UserHistoryMutation) Password() (r string, exists bool) { + v := m.password + if v == nil { + return + } + return *v, true +} + +// OldPassword returns the old "password" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldPassword(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPassword is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPassword requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPassword: %w", err) + } + return oldValue.Password, nil +} + +// ClearPassword clears the value of the "password" field. +func (m *UserHistoryMutation) ClearPassword() { + m.password = nil + m.clearedFields[userhistory.FieldPassword] = struct{}{} +} + +// PasswordCleared returns if the "password" field was cleared in this mutation. +func (m *UserHistoryMutation) PasswordCleared() bool { + _, ok := m.clearedFields[userhistory.FieldPassword] + return ok +} + +// ResetPassword resets all changes to the "password" field. +func (m *UserHistoryMutation) ResetPassword() { + m.password = nil + delete(m.clearedFields, userhistory.FieldPassword) +} + +// SetSub sets the "sub" field. +func (m *UserHistoryMutation) SetSub(s string) { + m.sub = &s +} + +// Sub returns the value of the "sub" field in the mutation. +func (m *UserHistoryMutation) Sub() (r string, exists bool) { + v := m.sub + if v == nil { + return + } + return *v, true +} + +// OldSub returns the old "sub" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldSub(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSub is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSub requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSub: %w", err) + } + return oldValue.Sub, nil +} + +// ClearSub clears the value of the "sub" field. +func (m *UserHistoryMutation) ClearSub() { + m.sub = nil + m.clearedFields[userhistory.FieldSub] = struct{}{} +} + +// SubCleared returns if the "sub" field was cleared in this mutation. +func (m *UserHistoryMutation) SubCleared() bool { + _, ok := m.clearedFields[userhistory.FieldSub] + return ok +} + +// ResetSub resets all changes to the "sub" field. +func (m *UserHistoryMutation) ResetSub() { + m.sub = nil + delete(m.clearedFields, userhistory.FieldSub) +} + +// SetAuthProvider sets the "auth_provider" field. +func (m *UserHistoryMutation) SetAuthProvider(ep enums.AuthProvider) { + m.auth_provider = &ep +} + +// AuthProvider returns the value of the "auth_provider" field in the mutation. +func (m *UserHistoryMutation) AuthProvider() (r enums.AuthProvider, exists bool) { + v := m.auth_provider + if v == nil { + return + } + return *v, true +} + +// OldAuthProvider returns the old "auth_provider" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldAuthProvider(ctx context.Context) (v enums.AuthProvider, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAuthProvider is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAuthProvider requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAuthProvider: %w", err) + } + return oldValue.AuthProvider, nil +} + +// ResetAuthProvider resets all changes to the "auth_provider" field. +func (m *UserHistoryMutation) ResetAuthProvider() { + m.auth_provider = nil +} + +// SetRole sets the "role" field. +func (m *UserHistoryMutation) SetRole(e enums.Role) { + m.role = &e +} + +// Role returns the value of the "role" field in the mutation. +func (m *UserHistoryMutation) Role() (r enums.Role, exists bool) { + v := m.role + if v == nil { + return + } + return *v, true +} + +// OldRole returns the old "role" field's value of the UserHistory entity. +// If the UserHistory 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 *UserHistoryMutation) OldRole(ctx context.Context) (v enums.Role, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRole is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRole requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRole: %w", err) + } + return oldValue.Role, nil +} + +// ClearRole clears the value of the "role" field. +func (m *UserHistoryMutation) ClearRole() { + m.role = nil + m.clearedFields[userhistory.FieldRole] = struct{}{} +} + +// RoleCleared returns if the "role" field was cleared in this mutation. +func (m *UserHistoryMutation) RoleCleared() bool { + _, ok := m.clearedFields[userhistory.FieldRole] + return ok +} + +// ResetRole resets all changes to the "role" field. +func (m *UserHistoryMutation) ResetRole() { + m.role = nil + delete(m.clearedFields, userhistory.FieldRole) +} + +// Where appends a list predicates to the UserHistoryMutation builder. +func (m *UserHistoryMutation) Where(ps ...predicate.UserHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the UserHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *UserHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.UserHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *UserHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *UserHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (UserHistory). +func (m *UserHistoryMutation) 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 *UserHistoryMutation) Fields() []string { + fields := make([]string, 0, 23) + if m.history_time != nil { + fields = append(fields, userhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, userhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, userhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, userhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, userhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, userhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, userhistory.FieldUpdatedBy) + } + if m.deleted_at != nil { + fields = append(fields, userhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, userhistory.FieldDeletedBy) + } + if m.mapping_id != nil { + fields = append(fields, userhistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, userhistory.FieldTags) + } + if m.email != nil { + fields = append(fields, userhistory.FieldEmail) + } + if m.first_name != nil { + fields = append(fields, userhistory.FieldFirstName) + } + if m.last_name != nil { + fields = append(fields, userhistory.FieldLastName) + } + if m.display_name != nil { + fields = append(fields, userhistory.FieldDisplayName) + } + if m.avatar_remote_url != nil { + fields = append(fields, userhistory.FieldAvatarRemoteURL) + } + if m.avatar_local_file != nil { + fields = append(fields, userhistory.FieldAvatarLocalFile) + } + if m.avatar_updated_at != nil { + fields = append(fields, userhistory.FieldAvatarUpdatedAt) + } + if m.last_seen != nil { + fields = append(fields, userhistory.FieldLastSeen) + } + if m.password != nil { + fields = append(fields, userhistory.FieldPassword) + } + if m.sub != nil { + fields = append(fields, userhistory.FieldSub) + } + if m.auth_provider != nil { + fields = append(fields, userhistory.FieldAuthProvider) + } + if m.role != nil { + fields = append(fields, userhistory.FieldRole) + } + 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 *UserHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case userhistory.FieldHistoryTime: + return m.HistoryTime() + case userhistory.FieldRef: + return m.Ref() + case userhistory.FieldOperation: + return m.Operation() + case userhistory.FieldCreatedAt: + return m.CreatedAt() + case userhistory.FieldUpdatedAt: + return m.UpdatedAt() + case userhistory.FieldCreatedBy: + return m.CreatedBy() + case userhistory.FieldUpdatedBy: + return m.UpdatedBy() + case userhistory.FieldDeletedAt: + return m.DeletedAt() + case userhistory.FieldDeletedBy: + return m.DeletedBy() + case userhistory.FieldMappingID: + return m.MappingID() + case userhistory.FieldTags: + return m.Tags() + case userhistory.FieldEmail: + return m.Email() + case userhistory.FieldFirstName: + return m.FirstName() + case userhistory.FieldLastName: + return m.LastName() + case userhistory.FieldDisplayName: + return m.DisplayName() + case userhistory.FieldAvatarRemoteURL: + return m.AvatarRemoteURL() + case userhistory.FieldAvatarLocalFile: + return m.AvatarLocalFile() + case userhistory.FieldAvatarUpdatedAt: + return m.AvatarUpdatedAt() + case userhistory.FieldLastSeen: + return m.LastSeen() + case userhistory.FieldPassword: + return m.Password() + case userhistory.FieldSub: + return m.Sub() + case userhistory.FieldAuthProvider: + return m.AuthProvider() + case userhistory.FieldRole: + return m.Role() + } + 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 *UserHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case userhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case userhistory.FieldRef: + return m.OldRef(ctx) + case userhistory.FieldOperation: + return m.OldOperation(ctx) + case userhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case userhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case userhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case userhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case userhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case userhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case userhistory.FieldMappingID: + return m.OldMappingID(ctx) + case userhistory.FieldTags: + return m.OldTags(ctx) + case userhistory.FieldEmail: + return m.OldEmail(ctx) + case userhistory.FieldFirstName: + return m.OldFirstName(ctx) + case userhistory.FieldLastName: + return m.OldLastName(ctx) + case userhistory.FieldDisplayName: + return m.OldDisplayName(ctx) + case userhistory.FieldAvatarRemoteURL: + return m.OldAvatarRemoteURL(ctx) + case userhistory.FieldAvatarLocalFile: + return m.OldAvatarLocalFile(ctx) + case userhistory.FieldAvatarUpdatedAt: + return m.OldAvatarUpdatedAt(ctx) + case userhistory.FieldLastSeen: + return m.OldLastSeen(ctx) + case userhistory.FieldPassword: + return m.OldPassword(ctx) + case userhistory.FieldSub: + return m.OldSub(ctx) + case userhistory.FieldAuthProvider: + return m.OldAuthProvider(ctx) + case userhistory.FieldRole: + return m.OldRole(ctx) + } + return nil, fmt.Errorf("unknown UserHistory 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 *UserHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case userhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case userhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case userhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case userhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case userhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case userhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case userhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case userhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case userhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case userhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case userhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case userhistory.FieldEmail: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmail(v) + return nil + case userhistory.FieldFirstName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFirstName(v) + return nil + case userhistory.FieldLastName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastName(v) + return nil + case userhistory.FieldDisplayName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDisplayName(v) + return nil + case userhistory.FieldAvatarRemoteURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarRemoteURL(v) + return nil + case userhistory.FieldAvatarLocalFile: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarLocalFile(v) + return nil + case userhistory.FieldAvatarUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAvatarUpdatedAt(v) + return nil + case userhistory.FieldLastSeen: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastSeen(v) + return nil + case userhistory.FieldPassword: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPassword(v) + return nil + case userhistory.FieldSub: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSub(v) + return nil + case userhistory.FieldAuthProvider: + v, ok := value.(enums.AuthProvider) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAuthProvider(v) + return nil + case userhistory.FieldRole: + v, ok := value.(enums.Role) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRole(v) + return nil + } + return fmt.Errorf("unknown UserHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *UserHistoryMutation) 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 *UserHistoryMutation) 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 *UserHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown UserHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *UserHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(userhistory.FieldRef) { + fields = append(fields, userhistory.FieldRef) + } + if m.FieldCleared(userhistory.FieldCreatedAt) { + fields = append(fields, userhistory.FieldCreatedAt) + } + if m.FieldCleared(userhistory.FieldUpdatedAt) { + fields = append(fields, userhistory.FieldUpdatedAt) + } + if m.FieldCleared(userhistory.FieldCreatedBy) { + fields = append(fields, userhistory.FieldCreatedBy) + } + if m.FieldCleared(userhistory.FieldUpdatedBy) { + fields = append(fields, userhistory.FieldUpdatedBy) + } + if m.FieldCleared(userhistory.FieldDeletedAt) { + fields = append(fields, userhistory.FieldDeletedAt) + } + if m.FieldCleared(userhistory.FieldDeletedBy) { + fields = append(fields, userhistory.FieldDeletedBy) + } + if m.FieldCleared(userhistory.FieldTags) { + fields = append(fields, userhistory.FieldTags) + } + if m.FieldCleared(userhistory.FieldFirstName) { + fields = append(fields, userhistory.FieldFirstName) + } + if m.FieldCleared(userhistory.FieldLastName) { + fields = append(fields, userhistory.FieldLastName) + } + if m.FieldCleared(userhistory.FieldAvatarRemoteURL) { + fields = append(fields, userhistory.FieldAvatarRemoteURL) + } + if m.FieldCleared(userhistory.FieldAvatarLocalFile) { + fields = append(fields, userhistory.FieldAvatarLocalFile) + } + if m.FieldCleared(userhistory.FieldAvatarUpdatedAt) { + fields = append(fields, userhistory.FieldAvatarUpdatedAt) + } + if m.FieldCleared(userhistory.FieldLastSeen) { + fields = append(fields, userhistory.FieldLastSeen) + } + if m.FieldCleared(userhistory.FieldPassword) { + fields = append(fields, userhistory.FieldPassword) + } + if m.FieldCleared(userhistory.FieldSub) { + fields = append(fields, userhistory.FieldSub) + } + if m.FieldCleared(userhistory.FieldRole) { + fields = append(fields, userhistory.FieldRole) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *UserHistoryMutation) 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 *UserHistoryMutation) ClearField(name string) error { + switch name { + case userhistory.FieldRef: + m.ClearRef() + return nil + case userhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case userhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case userhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case userhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case userhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case userhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case userhistory.FieldTags: + m.ClearTags() + return nil + case userhistory.FieldFirstName: + m.ClearFirstName() + return nil + case userhistory.FieldLastName: + m.ClearLastName() + return nil + case userhistory.FieldAvatarRemoteURL: + m.ClearAvatarRemoteURL() + return nil + case userhistory.FieldAvatarLocalFile: + m.ClearAvatarLocalFile() + return nil + case userhistory.FieldAvatarUpdatedAt: + m.ClearAvatarUpdatedAt() + return nil + case userhistory.FieldLastSeen: + m.ClearLastSeen() + return nil + case userhistory.FieldPassword: + m.ClearPassword() + return nil + case userhistory.FieldSub: + m.ClearSub() + return nil + case userhistory.FieldRole: + m.ClearRole() + return nil + } + return fmt.Errorf("unknown UserHistory 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 *UserHistoryMutation) ResetField(name string) error { + switch name { + case userhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case userhistory.FieldRef: + m.ResetRef() + return nil + case userhistory.FieldOperation: + m.ResetOperation() + return nil + case userhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case userhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case userhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case userhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case userhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case userhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case userhistory.FieldMappingID: + m.ResetMappingID() + return nil + case userhistory.FieldTags: + m.ResetTags() + return nil + case userhistory.FieldEmail: + m.ResetEmail() + return nil + case userhistory.FieldFirstName: + m.ResetFirstName() + return nil + case userhistory.FieldLastName: + m.ResetLastName() + return nil + case userhistory.FieldDisplayName: + m.ResetDisplayName() + return nil + case userhistory.FieldAvatarRemoteURL: + m.ResetAvatarRemoteURL() + return nil + case userhistory.FieldAvatarLocalFile: + m.ResetAvatarLocalFile() + return nil + case userhistory.FieldAvatarUpdatedAt: + m.ResetAvatarUpdatedAt() + return nil + case userhistory.FieldLastSeen: + m.ResetLastSeen() + return nil + case userhistory.FieldPassword: + m.ResetPassword() + return nil + case userhistory.FieldSub: + m.ResetSub() + return nil + case userhistory.FieldAuthProvider: + m.ResetAuthProvider() + return nil + case userhistory.FieldRole: + m.ResetRole() + return nil + } + return fmt.Errorf("unknown UserHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *UserHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *UserHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *UserHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *UserHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *UserHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *UserHistoryMutation) EdgeCleared(name string) bool { + 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 *UserHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown UserHistory 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 *UserHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown UserHistory edge %s", name) +} + +// UserSettingMutation represents an operation that mutates the UserSetting nodes in the graph. +type UserSettingMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + locked *bool + silenced_at *time.Time + suspended_at *time.Time + status *enums.UserStatus + email_confirmed *bool + is_webauthn_allowed *bool + is_tfa_enabled *bool + phone_number *string + clearedFields map[string]struct{} + user *string + cleareduser bool + default_org *string + cleareddefault_org bool + done bool + oldValue func(context.Context) (*UserSetting, error) + predicates []predicate.UserSetting +} + +var _ ent.Mutation = (*UserSettingMutation)(nil) + +// usersettingOption allows management of the mutation configuration using functional options. +type usersettingOption func(*UserSettingMutation) + +// newUserSettingMutation creates new mutation for the UserSetting entity. +func newUserSettingMutation(c config, op Op, opts ...usersettingOption) *UserSettingMutation { + m := &UserSettingMutation{ + config: c, + op: op, + typ: TypeUserSetting, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withUserSettingID sets the ID field of the mutation. +func withUserSettingID(id string) usersettingOption { + return func(m *UserSettingMutation) { + var ( + err error + once sync.Once + value *UserSetting + ) + m.oldValue = func(ctx context.Context) (*UserSetting, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().UserSetting.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUserSetting sets the old UserSetting of the mutation. +func withUserSetting(node *UserSetting) usersettingOption { + return func(m *UserSettingMutation) { + m.oldValue = func(context.Context) (*UserSetting, 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 UserSettingMutation) 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 UserSettingMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of UserSetting entities. +func (m *UserSettingMutation) SetID(id string) { + 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 *UserSettingMutation) ID() (id string, 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 *UserSettingMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().UserSetting.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *UserSettingMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *UserSettingMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *UserSettingMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[usersetting.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *UserSettingMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[usersetting.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *UserSettingMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, usersetting.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *UserSettingMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *UserSettingMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *UserSettingMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[usersetting.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *UserSettingMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[usersetting.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *UserSettingMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, usersetting.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *UserSettingMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *UserSettingMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *UserSettingMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[usersetting.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *UserSettingMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[usersetting.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *UserSettingMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, usersetting.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *UserSettingMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *UserSettingMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *UserSettingMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[usersetting.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *UserSettingMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[usersetting.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *UserSettingMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, usersetting.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *UserSettingMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *UserSettingMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *UserSettingMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *UserSettingMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *UserSettingMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *UserSettingMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *UserSettingMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *UserSettingMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[usersetting.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *UserSettingMutation) TagsCleared() bool { + _, ok := m.clearedFields[usersetting.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *UserSettingMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, usersetting.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *UserSettingMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *UserSettingMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *UserSettingMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[usersetting.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *UserSettingMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[usersetting.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *UserSettingMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, usersetting.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *UserSettingMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *UserSettingMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *UserSettingMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[usersetting.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *UserSettingMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[usersetting.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *UserSettingMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, usersetting.FieldDeletedBy) +} + +// SetUserID sets the "user_id" field. +func (m *UserSettingMutation) SetUserID(s string) { + m.user = &s +} + +// UserID returns the value of the "user_id" field in the mutation. +func (m *UserSettingMutation) UserID() (r string, exists bool) { + v := m.user + if v == nil { + return + } + return *v, true +} + +// OldUserID returns the old "user_id" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldUserID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserID: %w", err) + } + return oldValue.UserID, nil +} + +// ClearUserID clears the value of the "user_id" field. +func (m *UserSettingMutation) ClearUserID() { + m.user = nil + m.clearedFields[usersetting.FieldUserID] = struct{}{} +} + +// UserIDCleared returns if the "user_id" field was cleared in this mutation. +func (m *UserSettingMutation) UserIDCleared() bool { + _, ok := m.clearedFields[usersetting.FieldUserID] + return ok +} + +// ResetUserID resets all changes to the "user_id" field. +func (m *UserSettingMutation) ResetUserID() { + m.user = nil + delete(m.clearedFields, usersetting.FieldUserID) +} + +// SetLocked sets the "locked" field. +func (m *UserSettingMutation) SetLocked(b bool) { + m.locked = &b +} + +// Locked returns the value of the "locked" field in the mutation. +func (m *UserSettingMutation) Locked() (r bool, exists bool) { + v := m.locked + if v == nil { + return + } + return *v, true +} + +// OldLocked returns the old "locked" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldLocked(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLocked is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLocked requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLocked: %w", err) + } + return oldValue.Locked, nil +} + +// ResetLocked resets all changes to the "locked" field. +func (m *UserSettingMutation) ResetLocked() { + m.locked = nil +} + +// SetSilencedAt sets the "silenced_at" field. +func (m *UserSettingMutation) SetSilencedAt(t time.Time) { + m.silenced_at = &t +} + +// SilencedAt returns the value of the "silenced_at" field in the mutation. +func (m *UserSettingMutation) SilencedAt() (r time.Time, exists bool) { + v := m.silenced_at + if v == nil { + return + } + return *v, true +} + +// OldSilencedAt returns the old "silenced_at" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldSilencedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSilencedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSilencedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSilencedAt: %w", err) + } + return oldValue.SilencedAt, nil +} + +// ClearSilencedAt clears the value of the "silenced_at" field. +func (m *UserSettingMutation) ClearSilencedAt() { + m.silenced_at = nil + m.clearedFields[usersetting.FieldSilencedAt] = struct{}{} +} + +// SilencedAtCleared returns if the "silenced_at" field was cleared in this mutation. +func (m *UserSettingMutation) SilencedAtCleared() bool { + _, ok := m.clearedFields[usersetting.FieldSilencedAt] + return ok +} + +// ResetSilencedAt resets all changes to the "silenced_at" field. +func (m *UserSettingMutation) ResetSilencedAt() { + m.silenced_at = nil + delete(m.clearedFields, usersetting.FieldSilencedAt) +} + +// SetSuspendedAt sets the "suspended_at" field. +func (m *UserSettingMutation) SetSuspendedAt(t time.Time) { + m.suspended_at = &t +} + +// SuspendedAt returns the value of the "suspended_at" field in the mutation. +func (m *UserSettingMutation) SuspendedAt() (r time.Time, exists bool) { + v := m.suspended_at + if v == nil { + return + } + return *v, true +} + +// OldSuspendedAt returns the old "suspended_at" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldSuspendedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSuspendedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSuspendedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSuspendedAt: %w", err) + } + return oldValue.SuspendedAt, nil +} + +// ClearSuspendedAt clears the value of the "suspended_at" field. +func (m *UserSettingMutation) ClearSuspendedAt() { + m.suspended_at = nil + m.clearedFields[usersetting.FieldSuspendedAt] = struct{}{} +} + +// SuspendedAtCleared returns if the "suspended_at" field was cleared in this mutation. +func (m *UserSettingMutation) SuspendedAtCleared() bool { + _, ok := m.clearedFields[usersetting.FieldSuspendedAt] + return ok +} + +// ResetSuspendedAt resets all changes to the "suspended_at" field. +func (m *UserSettingMutation) ResetSuspendedAt() { + m.suspended_at = nil + delete(m.clearedFields, usersetting.FieldSuspendedAt) +} + +// SetStatus sets the "status" field. +func (m *UserSettingMutation) SetStatus(es enums.UserStatus) { + m.status = &es +} + +// Status returns the value of the "status" field in the mutation. +func (m *UserSettingMutation) Status() (r enums.UserStatus, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldStatus(ctx context.Context) (v enums.UserStatus, 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 +} + +// ResetStatus resets all changes to the "status" field. +func (m *UserSettingMutation) ResetStatus() { + m.status = nil +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (m *UserSettingMutation) SetEmailConfirmed(b bool) { + m.email_confirmed = &b +} + +// EmailConfirmed returns the value of the "email_confirmed" field in the mutation. +func (m *UserSettingMutation) EmailConfirmed() (r bool, exists bool) { + v := m.email_confirmed + if v == nil { + return + } + return *v, true +} + +// OldEmailConfirmed returns the old "email_confirmed" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldEmailConfirmed(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmailConfirmed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmailConfirmed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmailConfirmed: %w", err) + } + return oldValue.EmailConfirmed, nil +} + +// ResetEmailConfirmed resets all changes to the "email_confirmed" field. +func (m *UserSettingMutation) ResetEmailConfirmed() { + m.email_confirmed = nil +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (m *UserSettingMutation) SetIsWebauthnAllowed(b bool) { + m.is_webauthn_allowed = &b +} + +// IsWebauthnAllowed returns the value of the "is_webauthn_allowed" field in the mutation. +func (m *UserSettingMutation) IsWebauthnAllowed() (r bool, exists bool) { + v := m.is_webauthn_allowed + if v == nil { + return + } + return *v, true +} + +// OldIsWebauthnAllowed returns the old "is_webauthn_allowed" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldIsWebauthnAllowed(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldIsWebauthnAllowed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldIsWebauthnAllowed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIsWebauthnAllowed: %w", err) + } + return oldValue.IsWebauthnAllowed, nil +} + +// ClearIsWebauthnAllowed clears the value of the "is_webauthn_allowed" field. +func (m *UserSettingMutation) ClearIsWebauthnAllowed() { + m.is_webauthn_allowed = nil + m.clearedFields[usersetting.FieldIsWebauthnAllowed] = struct{}{} +} + +// IsWebauthnAllowedCleared returns if the "is_webauthn_allowed" field was cleared in this mutation. +func (m *UserSettingMutation) IsWebauthnAllowedCleared() bool { + _, ok := m.clearedFields[usersetting.FieldIsWebauthnAllowed] + return ok +} + +// ResetIsWebauthnAllowed resets all changes to the "is_webauthn_allowed" field. +func (m *UserSettingMutation) ResetIsWebauthnAllowed() { + m.is_webauthn_allowed = nil + delete(m.clearedFields, usersetting.FieldIsWebauthnAllowed) +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (m *UserSettingMutation) SetIsTfaEnabled(b bool) { + m.is_tfa_enabled = &b +} + +// IsTfaEnabled returns the value of the "is_tfa_enabled" field in the mutation. +func (m *UserSettingMutation) IsTfaEnabled() (r bool, exists bool) { + v := m.is_tfa_enabled + if v == nil { + return + } + return *v, true +} + +// OldIsTfaEnabled returns the old "is_tfa_enabled" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldIsTfaEnabled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldIsTfaEnabled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldIsTfaEnabled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIsTfaEnabled: %w", err) + } + return oldValue.IsTfaEnabled, nil +} + +// ClearIsTfaEnabled clears the value of the "is_tfa_enabled" field. +func (m *UserSettingMutation) ClearIsTfaEnabled() { + m.is_tfa_enabled = nil + m.clearedFields[usersetting.FieldIsTfaEnabled] = struct{}{} +} + +// IsTfaEnabledCleared returns if the "is_tfa_enabled" field was cleared in this mutation. +func (m *UserSettingMutation) IsTfaEnabledCleared() bool { + _, ok := m.clearedFields[usersetting.FieldIsTfaEnabled] + return ok +} + +// ResetIsTfaEnabled resets all changes to the "is_tfa_enabled" field. +func (m *UserSettingMutation) ResetIsTfaEnabled() { + m.is_tfa_enabled = nil + delete(m.clearedFields, usersetting.FieldIsTfaEnabled) +} + +// SetPhoneNumber sets the "phone_number" field. +func (m *UserSettingMutation) SetPhoneNumber(s string) { + m.phone_number = &s +} + +// PhoneNumber returns the value of the "phone_number" field in the mutation. +func (m *UserSettingMutation) PhoneNumber() (r string, exists bool) { + v := m.phone_number + if v == nil { + return + } + return *v, true +} + +// OldPhoneNumber returns the old "phone_number" field's value of the UserSetting entity. +// If the UserSetting 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 *UserSettingMutation) OldPhoneNumber(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPhoneNumber is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPhoneNumber requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhoneNumber: %w", err) + } + return oldValue.PhoneNumber, nil +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (m *UserSettingMutation) ClearPhoneNumber() { + m.phone_number = nil + m.clearedFields[usersetting.FieldPhoneNumber] = struct{}{} +} + +// PhoneNumberCleared returns if the "phone_number" field was cleared in this mutation. +func (m *UserSettingMutation) PhoneNumberCleared() bool { + _, ok := m.clearedFields[usersetting.FieldPhoneNumber] + return ok +} + +// ResetPhoneNumber resets all changes to the "phone_number" field. +func (m *UserSettingMutation) ResetPhoneNumber() { + m.phone_number = nil + delete(m.clearedFields, usersetting.FieldPhoneNumber) +} + +// ClearUser clears the "user" edge to the User entity. +func (m *UserSettingMutation) ClearUser() { + m.cleareduser = true + m.clearedFields[usersetting.FieldUserID] = struct{}{} +} + +// UserCleared reports if the "user" edge to the User entity was cleared. +func (m *UserSettingMutation) UserCleared() bool { + return m.UserIDCleared() || m.cleareduser +} + +// UserIDs returns the "user" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// UserID instead. It exists only for internal usage by the builders. +func (m *UserSettingMutation) UserIDs() (ids []string) { + if id := m.user; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetUser resets all changes to the "user" edge. +func (m *UserSettingMutation) ResetUser() { + m.user = nil + m.cleareduser = false +} + +// SetDefaultOrgID sets the "default_org" edge to the Organization entity by id. +func (m *UserSettingMutation) SetDefaultOrgID(id string) { + m.default_org = &id +} + +// ClearDefaultOrg clears the "default_org" edge to the Organization entity. +func (m *UserSettingMutation) ClearDefaultOrg() { + m.cleareddefault_org = true +} + +// DefaultOrgCleared reports if the "default_org" edge to the Organization entity was cleared. +func (m *UserSettingMutation) DefaultOrgCleared() bool { + return m.cleareddefault_org +} + +// DefaultOrgID returns the "default_org" edge ID in the mutation. +func (m *UserSettingMutation) DefaultOrgID() (id string, exists bool) { + if m.default_org != nil { + return *m.default_org, true + } + return +} + +// DefaultOrgIDs returns the "default_org" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// DefaultOrgID instead. It exists only for internal usage by the builders. +func (m *UserSettingMutation) DefaultOrgIDs() (ids []string) { + if id := m.default_org; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetDefaultOrg resets all changes to the "default_org" edge. +func (m *UserSettingMutation) ResetDefaultOrg() { + m.default_org = nil + m.cleareddefault_org = false +} + +// Where appends a list predicates to the UserSettingMutation builder. +func (m *UserSettingMutation) Where(ps ...predicate.UserSetting) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the UserSettingMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *UserSettingMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.UserSetting, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *UserSettingMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *UserSettingMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (UserSetting). +func (m *UserSettingMutation) 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 *UserSettingMutation) Fields() []string { + fields := make([]string, 0, 17) + if m.created_at != nil { + fields = append(fields, usersetting.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, usersetting.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, usersetting.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, usersetting.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, usersetting.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, usersetting.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, usersetting.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, usersetting.FieldDeletedBy) + } + if m.user != nil { + fields = append(fields, usersetting.FieldUserID) + } + if m.locked != nil { + fields = append(fields, usersetting.FieldLocked) + } + if m.silenced_at != nil { + fields = append(fields, usersetting.FieldSilencedAt) + } + if m.suspended_at != nil { + fields = append(fields, usersetting.FieldSuspendedAt) + } + if m.status != nil { + fields = append(fields, usersetting.FieldStatus) + } + if m.email_confirmed != nil { + fields = append(fields, usersetting.FieldEmailConfirmed) + } + if m.is_webauthn_allowed != nil { + fields = append(fields, usersetting.FieldIsWebauthnAllowed) + } + if m.is_tfa_enabled != nil { + fields = append(fields, usersetting.FieldIsTfaEnabled) + } + if m.phone_number != nil { + fields = append(fields, usersetting.FieldPhoneNumber) + } + 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 *UserSettingMutation) Field(name string) (ent.Value, bool) { + switch name { + case usersetting.FieldCreatedAt: + return m.CreatedAt() + case usersetting.FieldUpdatedAt: + return m.UpdatedAt() + case usersetting.FieldCreatedBy: + return m.CreatedBy() + case usersetting.FieldUpdatedBy: + return m.UpdatedBy() + case usersetting.FieldMappingID: + return m.MappingID() + case usersetting.FieldTags: + return m.Tags() + case usersetting.FieldDeletedAt: + return m.DeletedAt() + case usersetting.FieldDeletedBy: + return m.DeletedBy() + case usersetting.FieldUserID: + return m.UserID() + case usersetting.FieldLocked: + return m.Locked() + case usersetting.FieldSilencedAt: + return m.SilencedAt() + case usersetting.FieldSuspendedAt: + return m.SuspendedAt() + case usersetting.FieldStatus: + return m.Status() + case usersetting.FieldEmailConfirmed: + return m.EmailConfirmed() + case usersetting.FieldIsWebauthnAllowed: + return m.IsWebauthnAllowed() + case usersetting.FieldIsTfaEnabled: + return m.IsTfaEnabled() + case usersetting.FieldPhoneNumber: + return m.PhoneNumber() + } + 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 *UserSettingMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case usersetting.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case usersetting.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case usersetting.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case usersetting.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case usersetting.FieldMappingID: + return m.OldMappingID(ctx) + case usersetting.FieldTags: + return m.OldTags(ctx) + case usersetting.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case usersetting.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case usersetting.FieldUserID: + return m.OldUserID(ctx) + case usersetting.FieldLocked: + return m.OldLocked(ctx) + case usersetting.FieldSilencedAt: + return m.OldSilencedAt(ctx) + case usersetting.FieldSuspendedAt: + return m.OldSuspendedAt(ctx) + case usersetting.FieldStatus: + return m.OldStatus(ctx) + case usersetting.FieldEmailConfirmed: + return m.OldEmailConfirmed(ctx) + case usersetting.FieldIsWebauthnAllowed: + return m.OldIsWebauthnAllowed(ctx) + case usersetting.FieldIsTfaEnabled: + return m.OldIsTfaEnabled(ctx) + case usersetting.FieldPhoneNumber: + return m.OldPhoneNumber(ctx) + } + return nil, fmt.Errorf("unknown UserSetting 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 *UserSettingMutation) SetField(name string, value ent.Value) error { + switch name { + case usersetting.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case usersetting.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case usersetting.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case usersetting.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case usersetting.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case usersetting.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case usersetting.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case usersetting.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case usersetting.FieldUserID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserID(v) + return nil + case usersetting.FieldLocked: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLocked(v) + return nil + case usersetting.FieldSilencedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSilencedAt(v) + return nil + case usersetting.FieldSuspendedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSuspendedAt(v) + return nil + case usersetting.FieldStatus: + v, ok := value.(enums.UserStatus) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case usersetting.FieldEmailConfirmed: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmailConfirmed(v) + return nil + case usersetting.FieldIsWebauthnAllowed: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetIsWebauthnAllowed(v) + return nil + case usersetting.FieldIsTfaEnabled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetIsTfaEnabled(v) + return nil + case usersetting.FieldPhoneNumber: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPhoneNumber(v) + return nil + } + return fmt.Errorf("unknown UserSetting field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *UserSettingMutation) 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 *UserSettingMutation) 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 *UserSettingMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown UserSetting numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *UserSettingMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(usersetting.FieldCreatedAt) { + fields = append(fields, usersetting.FieldCreatedAt) + } + if m.FieldCleared(usersetting.FieldUpdatedAt) { + fields = append(fields, usersetting.FieldUpdatedAt) + } + if m.FieldCleared(usersetting.FieldCreatedBy) { + fields = append(fields, usersetting.FieldCreatedBy) + } + if m.FieldCleared(usersetting.FieldUpdatedBy) { + fields = append(fields, usersetting.FieldUpdatedBy) + } + if m.FieldCleared(usersetting.FieldTags) { + fields = append(fields, usersetting.FieldTags) + } + if m.FieldCleared(usersetting.FieldDeletedAt) { + fields = append(fields, usersetting.FieldDeletedAt) + } + if m.FieldCleared(usersetting.FieldDeletedBy) { + fields = append(fields, usersetting.FieldDeletedBy) + } + if m.FieldCleared(usersetting.FieldUserID) { + fields = append(fields, usersetting.FieldUserID) + } + if m.FieldCleared(usersetting.FieldSilencedAt) { + fields = append(fields, usersetting.FieldSilencedAt) + } + if m.FieldCleared(usersetting.FieldSuspendedAt) { + fields = append(fields, usersetting.FieldSuspendedAt) + } + if m.FieldCleared(usersetting.FieldIsWebauthnAllowed) { + fields = append(fields, usersetting.FieldIsWebauthnAllowed) + } + if m.FieldCleared(usersetting.FieldIsTfaEnabled) { + fields = append(fields, usersetting.FieldIsTfaEnabled) + } + if m.FieldCleared(usersetting.FieldPhoneNumber) { + fields = append(fields, usersetting.FieldPhoneNumber) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *UserSettingMutation) 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 *UserSettingMutation) ClearField(name string) error { + switch name { + case usersetting.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case usersetting.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case usersetting.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case usersetting.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case usersetting.FieldTags: + m.ClearTags() + return nil + case usersetting.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case usersetting.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case usersetting.FieldUserID: + m.ClearUserID() + return nil + case usersetting.FieldSilencedAt: + m.ClearSilencedAt() + return nil + case usersetting.FieldSuspendedAt: + m.ClearSuspendedAt() + return nil + case usersetting.FieldIsWebauthnAllowed: + m.ClearIsWebauthnAllowed() + return nil + case usersetting.FieldIsTfaEnabled: + m.ClearIsTfaEnabled() + return nil + case usersetting.FieldPhoneNumber: + m.ClearPhoneNumber() + return nil + } + return fmt.Errorf("unknown UserSetting 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 *UserSettingMutation) ResetField(name string) error { + switch name { + case usersetting.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case usersetting.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case usersetting.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case usersetting.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case usersetting.FieldMappingID: + m.ResetMappingID() + return nil + case usersetting.FieldTags: + m.ResetTags() + return nil + case usersetting.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case usersetting.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case usersetting.FieldUserID: + m.ResetUserID() + return nil + case usersetting.FieldLocked: + m.ResetLocked() + return nil + case usersetting.FieldSilencedAt: + m.ResetSilencedAt() + return nil + case usersetting.FieldSuspendedAt: + m.ResetSuspendedAt() + return nil + case usersetting.FieldStatus: + m.ResetStatus() + return nil + case usersetting.FieldEmailConfirmed: + m.ResetEmailConfirmed() + return nil + case usersetting.FieldIsWebauthnAllowed: + m.ResetIsWebauthnAllowed() + return nil + case usersetting.FieldIsTfaEnabled: + m.ResetIsTfaEnabled() + return nil + case usersetting.FieldPhoneNumber: + m.ResetPhoneNumber() + return nil + } + return fmt.Errorf("unknown UserSetting field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *UserSettingMutation) AddedEdges() []string { + edges := make([]string, 0, 2) + if m.user != nil { + edges = append(edges, usersetting.EdgeUser) + } + if m.default_org != nil { + edges = append(edges, usersetting.EdgeDefaultOrg) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *UserSettingMutation) AddedIDs(name string) []ent.Value { + switch name { + case usersetting.EdgeUser: + if id := m.user; id != nil { + return []ent.Value{*id} + } + case usersetting.EdgeDefaultOrg: + if id := m.default_org; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *UserSettingMutation) RemovedEdges() []string { + edges := make([]string, 0, 2) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *UserSettingMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *UserSettingMutation) ClearedEdges() []string { + edges := make([]string, 0, 2) + if m.cleareduser { + edges = append(edges, usersetting.EdgeUser) + } + if m.cleareddefault_org { + edges = append(edges, usersetting.EdgeDefaultOrg) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *UserSettingMutation) EdgeCleared(name string) bool { + switch name { + case usersetting.EdgeUser: + return m.cleareduser + case usersetting.EdgeDefaultOrg: + return m.cleareddefault_org + } + 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 *UserSettingMutation) ClearEdge(name string) error { + switch name { + case usersetting.EdgeUser: + m.ClearUser() + return nil + case usersetting.EdgeDefaultOrg: + m.ClearDefaultOrg() + return nil + } + return fmt.Errorf("unknown UserSetting 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 *UserSettingMutation) ResetEdge(name string) error { + switch name { + case usersetting.EdgeUser: + m.ResetUser() + return nil + case usersetting.EdgeDefaultOrg: + m.ResetDefaultOrg() + return nil + } + return fmt.Errorf("unknown UserSetting edge %s", name) +} + +// UserSettingHistoryMutation represents an operation that mutates the UserSettingHistory nodes in the graph. +type UserSettingHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + user_id *string + locked *bool + silenced_at *time.Time + suspended_at *time.Time + status *enums.UserStatus + email_confirmed *bool + is_webauthn_allowed *bool + is_tfa_enabled *bool + phone_number *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*UserSettingHistory, error) + predicates []predicate.UserSettingHistory +} + +var _ ent.Mutation = (*UserSettingHistoryMutation)(nil) + +// usersettinghistoryOption allows management of the mutation configuration using functional options. +type usersettinghistoryOption func(*UserSettingHistoryMutation) + +// newUserSettingHistoryMutation creates new mutation for the UserSettingHistory entity. +func newUserSettingHistoryMutation(c config, op Op, opts ...usersettinghistoryOption) *UserSettingHistoryMutation { + m := &UserSettingHistoryMutation{ + config: c, + op: op, + typ: TypeUserSettingHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withUserSettingHistoryID sets the ID field of the mutation. +func withUserSettingHistoryID(id string) usersettinghistoryOption { + return func(m *UserSettingHistoryMutation) { + var ( + err error + once sync.Once + value *UserSettingHistory + ) + m.oldValue = func(ctx context.Context) (*UserSettingHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().UserSettingHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withUserSettingHistory sets the old UserSettingHistory of the mutation. +func withUserSettingHistory(node *UserSettingHistory) usersettinghistoryOption { + return func(m *UserSettingHistoryMutation) { + m.oldValue = func(context.Context) (*UserSettingHistory, 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 UserSettingHistoryMutation) 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 UserSettingHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of UserSettingHistory entities. +func (m *UserSettingHistoryMutation) SetID(id string) { + 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 *UserSettingHistoryMutation) ID() (id string, 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 *UserSettingHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().UserSettingHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *UserSettingHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *UserSettingHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *UserSettingHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *UserSettingHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *UserSettingHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *UserSettingHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[usersettinghistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *UserSettingHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, usersettinghistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *UserSettingHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *UserSettingHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *UserSettingHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *UserSettingHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *UserSettingHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *UserSettingHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[usersettinghistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *UserSettingHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, usersettinghistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *UserSettingHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *UserSettingHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *UserSettingHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[usersettinghistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *UserSettingHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, usersettinghistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *UserSettingHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *UserSettingHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *UserSettingHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[usersettinghistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *UserSettingHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, usersettinghistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *UserSettingHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *UserSettingHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *UserSettingHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[usersettinghistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *UserSettingHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, usersettinghistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *UserSettingHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *UserSettingHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *UserSettingHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *UserSettingHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *UserSettingHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *UserSettingHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *UserSettingHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *UserSettingHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[usersettinghistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *UserSettingHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, usersettinghistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *UserSettingHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *UserSettingHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *UserSettingHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[usersettinghistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *UserSettingHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, usersettinghistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *UserSettingHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *UserSettingHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *UserSettingHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[usersettinghistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *UserSettingHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, usersettinghistory.FieldDeletedBy) +} + +// SetUserID sets the "user_id" field. +func (m *UserSettingHistoryMutation) SetUserID(s string) { + m.user_id = &s +} + +// UserID returns the value of the "user_id" field in the mutation. +func (m *UserSettingHistoryMutation) UserID() (r string, exists bool) { + v := m.user_id + if v == nil { + return + } + return *v, true +} + +// OldUserID returns the old "user_id" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldUserID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserID: %w", err) + } + return oldValue.UserID, nil +} + +// ClearUserID clears the value of the "user_id" field. +func (m *UserSettingHistoryMutation) ClearUserID() { + m.user_id = nil + m.clearedFields[usersettinghistory.FieldUserID] = struct{}{} +} + +// UserIDCleared returns if the "user_id" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) UserIDCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldUserID] + return ok +} + +// ResetUserID resets all changes to the "user_id" field. +func (m *UserSettingHistoryMutation) ResetUserID() { + m.user_id = nil + delete(m.clearedFields, usersettinghistory.FieldUserID) +} + +// SetLocked sets the "locked" field. +func (m *UserSettingHistoryMutation) SetLocked(b bool) { + m.locked = &b +} + +// Locked returns the value of the "locked" field in the mutation. +func (m *UserSettingHistoryMutation) Locked() (r bool, exists bool) { + v := m.locked + if v == nil { + return + } + return *v, true +} + +// OldLocked returns the old "locked" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldLocked(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLocked is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLocked requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLocked: %w", err) + } + return oldValue.Locked, nil +} + +// ResetLocked resets all changes to the "locked" field. +func (m *UserSettingHistoryMutation) ResetLocked() { + m.locked = nil +} + +// SetSilencedAt sets the "silenced_at" field. +func (m *UserSettingHistoryMutation) SetSilencedAt(t time.Time) { + m.silenced_at = &t +} + +// SilencedAt returns the value of the "silenced_at" field in the mutation. +func (m *UserSettingHistoryMutation) SilencedAt() (r time.Time, exists bool) { + v := m.silenced_at + if v == nil { + return + } + return *v, true +} + +// OldSilencedAt returns the old "silenced_at" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldSilencedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSilencedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSilencedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSilencedAt: %w", err) + } + return oldValue.SilencedAt, nil +} + +// ClearSilencedAt clears the value of the "silenced_at" field. +func (m *UserSettingHistoryMutation) ClearSilencedAt() { + m.silenced_at = nil + m.clearedFields[usersettinghistory.FieldSilencedAt] = struct{}{} +} + +// SilencedAtCleared returns if the "silenced_at" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) SilencedAtCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldSilencedAt] + return ok +} + +// ResetSilencedAt resets all changes to the "silenced_at" field. +func (m *UserSettingHistoryMutation) ResetSilencedAt() { + m.silenced_at = nil + delete(m.clearedFields, usersettinghistory.FieldSilencedAt) +} + +// SetSuspendedAt sets the "suspended_at" field. +func (m *UserSettingHistoryMutation) SetSuspendedAt(t time.Time) { + m.suspended_at = &t +} + +// SuspendedAt returns the value of the "suspended_at" field in the mutation. +func (m *UserSettingHistoryMutation) SuspendedAt() (r time.Time, exists bool) { + v := m.suspended_at + if v == nil { + return + } + return *v, true +} + +// OldSuspendedAt returns the old "suspended_at" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldSuspendedAt(ctx context.Context) (v *time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSuspendedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSuspendedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSuspendedAt: %w", err) + } + return oldValue.SuspendedAt, nil +} + +// ClearSuspendedAt clears the value of the "suspended_at" field. +func (m *UserSettingHistoryMutation) ClearSuspendedAt() { + m.suspended_at = nil + m.clearedFields[usersettinghistory.FieldSuspendedAt] = struct{}{} +} + +// SuspendedAtCleared returns if the "suspended_at" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) SuspendedAtCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldSuspendedAt] + return ok +} + +// ResetSuspendedAt resets all changes to the "suspended_at" field. +func (m *UserSettingHistoryMutation) ResetSuspendedAt() { + m.suspended_at = nil + delete(m.clearedFields, usersettinghistory.FieldSuspendedAt) +} + +// SetStatus sets the "status" field. +func (m *UserSettingHistoryMutation) SetStatus(es enums.UserStatus) { + m.status = &es +} + +// Status returns the value of the "status" field in the mutation. +func (m *UserSettingHistoryMutation) Status() (r enums.UserStatus, exists bool) { + v := m.status + if v == nil { + return + } + return *v, true +} + +// OldStatus returns the old "status" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldStatus(ctx context.Context) (v enums.UserStatus, 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 +} + +// ResetStatus resets all changes to the "status" field. +func (m *UserSettingHistoryMutation) ResetStatus() { + m.status = nil +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (m *UserSettingHistoryMutation) SetEmailConfirmed(b bool) { + m.email_confirmed = &b +} + +// EmailConfirmed returns the value of the "email_confirmed" field in the mutation. +func (m *UserSettingHistoryMutation) EmailConfirmed() (r bool, exists bool) { + v := m.email_confirmed + if v == nil { + return + } + return *v, true +} + +// OldEmailConfirmed returns the old "email_confirmed" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldEmailConfirmed(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEmailConfirmed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEmailConfirmed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEmailConfirmed: %w", err) + } + return oldValue.EmailConfirmed, nil +} + +// ResetEmailConfirmed resets all changes to the "email_confirmed" field. +func (m *UserSettingHistoryMutation) ResetEmailConfirmed() { + m.email_confirmed = nil +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (m *UserSettingHistoryMutation) SetIsWebauthnAllowed(b bool) { + m.is_webauthn_allowed = &b +} + +// IsWebauthnAllowed returns the value of the "is_webauthn_allowed" field in the mutation. +func (m *UserSettingHistoryMutation) IsWebauthnAllowed() (r bool, exists bool) { + v := m.is_webauthn_allowed + if v == nil { + return + } + return *v, true +} + +// OldIsWebauthnAllowed returns the old "is_webauthn_allowed" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldIsWebauthnAllowed(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldIsWebauthnAllowed is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldIsWebauthnAllowed requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIsWebauthnAllowed: %w", err) + } + return oldValue.IsWebauthnAllowed, nil +} + +// ClearIsWebauthnAllowed clears the value of the "is_webauthn_allowed" field. +func (m *UserSettingHistoryMutation) ClearIsWebauthnAllowed() { + m.is_webauthn_allowed = nil + m.clearedFields[usersettinghistory.FieldIsWebauthnAllowed] = struct{}{} +} + +// IsWebauthnAllowedCleared returns if the "is_webauthn_allowed" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) IsWebauthnAllowedCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldIsWebauthnAllowed] + return ok +} + +// ResetIsWebauthnAllowed resets all changes to the "is_webauthn_allowed" field. +func (m *UserSettingHistoryMutation) ResetIsWebauthnAllowed() { + m.is_webauthn_allowed = nil + delete(m.clearedFields, usersettinghistory.FieldIsWebauthnAllowed) +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (m *UserSettingHistoryMutation) SetIsTfaEnabled(b bool) { + m.is_tfa_enabled = &b +} + +// IsTfaEnabled returns the value of the "is_tfa_enabled" field in the mutation. +func (m *UserSettingHistoryMutation) IsTfaEnabled() (r bool, exists bool) { + v := m.is_tfa_enabled + if v == nil { + return + } + return *v, true +} + +// OldIsTfaEnabled returns the old "is_tfa_enabled" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldIsTfaEnabled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldIsTfaEnabled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldIsTfaEnabled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldIsTfaEnabled: %w", err) + } + return oldValue.IsTfaEnabled, nil +} + +// ClearIsTfaEnabled clears the value of the "is_tfa_enabled" field. +func (m *UserSettingHistoryMutation) ClearIsTfaEnabled() { + m.is_tfa_enabled = nil + m.clearedFields[usersettinghistory.FieldIsTfaEnabled] = struct{}{} +} + +// IsTfaEnabledCleared returns if the "is_tfa_enabled" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) IsTfaEnabledCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldIsTfaEnabled] + return ok +} + +// ResetIsTfaEnabled resets all changes to the "is_tfa_enabled" field. +func (m *UserSettingHistoryMutation) ResetIsTfaEnabled() { + m.is_tfa_enabled = nil + delete(m.clearedFields, usersettinghistory.FieldIsTfaEnabled) +} + +// SetPhoneNumber sets the "phone_number" field. +func (m *UserSettingHistoryMutation) SetPhoneNumber(s string) { + m.phone_number = &s +} + +// PhoneNumber returns the value of the "phone_number" field in the mutation. +func (m *UserSettingHistoryMutation) PhoneNumber() (r string, exists bool) { + v := m.phone_number + if v == nil { + return + } + return *v, true +} + +// OldPhoneNumber returns the old "phone_number" field's value of the UserSettingHistory entity. +// If the UserSettingHistory 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 *UserSettingHistoryMutation) OldPhoneNumber(ctx context.Context) (v *string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPhoneNumber is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPhoneNumber requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPhoneNumber: %w", err) + } + return oldValue.PhoneNumber, nil +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (m *UserSettingHistoryMutation) ClearPhoneNumber() { + m.phone_number = nil + m.clearedFields[usersettinghistory.FieldPhoneNumber] = struct{}{} +} + +// PhoneNumberCleared returns if the "phone_number" field was cleared in this mutation. +func (m *UserSettingHistoryMutation) PhoneNumberCleared() bool { + _, ok := m.clearedFields[usersettinghistory.FieldPhoneNumber] + return ok +} + +// ResetPhoneNumber resets all changes to the "phone_number" field. +func (m *UserSettingHistoryMutation) ResetPhoneNumber() { + m.phone_number = nil + delete(m.clearedFields, usersettinghistory.FieldPhoneNumber) +} + +// Where appends a list predicates to the UserSettingHistoryMutation builder. +func (m *UserSettingHistoryMutation) Where(ps ...predicate.UserSettingHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the UserSettingHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *UserSettingHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.UserSettingHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *UserSettingHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *UserSettingHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (UserSettingHistory). +func (m *UserSettingHistoryMutation) 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 *UserSettingHistoryMutation) Fields() []string { + fields := make([]string, 0, 20) + if m.history_time != nil { + fields = append(fields, usersettinghistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, usersettinghistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, usersettinghistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, usersettinghistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, usersettinghistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, usersettinghistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, usersettinghistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, usersettinghistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, usersettinghistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, usersettinghistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, usersettinghistory.FieldDeletedBy) + } + if m.user_id != nil { + fields = append(fields, usersettinghistory.FieldUserID) + } + if m.locked != nil { + fields = append(fields, usersettinghistory.FieldLocked) + } + if m.silenced_at != nil { + fields = append(fields, usersettinghistory.FieldSilencedAt) + } + if m.suspended_at != nil { + fields = append(fields, usersettinghistory.FieldSuspendedAt) + } + if m.status != nil { + fields = append(fields, usersettinghistory.FieldStatus) + } + if m.email_confirmed != nil { + fields = append(fields, usersettinghistory.FieldEmailConfirmed) + } + if m.is_webauthn_allowed != nil { + fields = append(fields, usersettinghistory.FieldIsWebauthnAllowed) + } + if m.is_tfa_enabled != nil { + fields = append(fields, usersettinghistory.FieldIsTfaEnabled) + } + if m.phone_number != nil { + fields = append(fields, usersettinghistory.FieldPhoneNumber) + } + 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 *UserSettingHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case usersettinghistory.FieldHistoryTime: + return m.HistoryTime() + case usersettinghistory.FieldRef: + return m.Ref() + case usersettinghistory.FieldOperation: + return m.Operation() + case usersettinghistory.FieldCreatedAt: + return m.CreatedAt() + case usersettinghistory.FieldUpdatedAt: + return m.UpdatedAt() + case usersettinghistory.FieldCreatedBy: + return m.CreatedBy() + case usersettinghistory.FieldUpdatedBy: + return m.UpdatedBy() + case usersettinghistory.FieldMappingID: + return m.MappingID() + case usersettinghistory.FieldTags: + return m.Tags() + case usersettinghistory.FieldDeletedAt: + return m.DeletedAt() + case usersettinghistory.FieldDeletedBy: + return m.DeletedBy() + case usersettinghistory.FieldUserID: + return m.UserID() + case usersettinghistory.FieldLocked: + return m.Locked() + case usersettinghistory.FieldSilencedAt: + return m.SilencedAt() + case usersettinghistory.FieldSuspendedAt: + return m.SuspendedAt() + case usersettinghistory.FieldStatus: + return m.Status() + case usersettinghistory.FieldEmailConfirmed: + return m.EmailConfirmed() + case usersettinghistory.FieldIsWebauthnAllowed: + return m.IsWebauthnAllowed() + case usersettinghistory.FieldIsTfaEnabled: + return m.IsTfaEnabled() + case usersettinghistory.FieldPhoneNumber: + return m.PhoneNumber() + } + 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 *UserSettingHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case usersettinghistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case usersettinghistory.FieldRef: + return m.OldRef(ctx) + case usersettinghistory.FieldOperation: + return m.OldOperation(ctx) + case usersettinghistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case usersettinghistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case usersettinghistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case usersettinghistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case usersettinghistory.FieldMappingID: + return m.OldMappingID(ctx) + case usersettinghistory.FieldTags: + return m.OldTags(ctx) + case usersettinghistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case usersettinghistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case usersettinghistory.FieldUserID: + return m.OldUserID(ctx) + case usersettinghistory.FieldLocked: + return m.OldLocked(ctx) + case usersettinghistory.FieldSilencedAt: + return m.OldSilencedAt(ctx) + case usersettinghistory.FieldSuspendedAt: + return m.OldSuspendedAt(ctx) + case usersettinghistory.FieldStatus: + return m.OldStatus(ctx) + case usersettinghistory.FieldEmailConfirmed: + return m.OldEmailConfirmed(ctx) + case usersettinghistory.FieldIsWebauthnAllowed: + return m.OldIsWebauthnAllowed(ctx) + case usersettinghistory.FieldIsTfaEnabled: + return m.OldIsTfaEnabled(ctx) + case usersettinghistory.FieldPhoneNumber: + return m.OldPhoneNumber(ctx) + } + return nil, fmt.Errorf("unknown UserSettingHistory 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 *UserSettingHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case usersettinghistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case usersettinghistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case usersettinghistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case usersettinghistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case usersettinghistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case usersettinghistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case usersettinghistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case usersettinghistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case usersettinghistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case usersettinghistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case usersettinghistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case usersettinghistory.FieldUserID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserID(v) + return nil + case usersettinghistory.FieldLocked: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLocked(v) + return nil + case usersettinghistory.FieldSilencedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSilencedAt(v) + return nil + case usersettinghistory.FieldSuspendedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSuspendedAt(v) + return nil + case usersettinghistory.FieldStatus: + v, ok := value.(enums.UserStatus) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStatus(v) + return nil + case usersettinghistory.FieldEmailConfirmed: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEmailConfirmed(v) + return nil + case usersettinghistory.FieldIsWebauthnAllowed: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetIsWebauthnAllowed(v) + return nil + case usersettinghistory.FieldIsTfaEnabled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetIsTfaEnabled(v) + return nil + case usersettinghistory.FieldPhoneNumber: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPhoneNumber(v) + return nil + } + return fmt.Errorf("unknown UserSettingHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *UserSettingHistoryMutation) 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 *UserSettingHistoryMutation) 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 *UserSettingHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + } + return fmt.Errorf("unknown UserSettingHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *UserSettingHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(usersettinghistory.FieldRef) { + fields = append(fields, usersettinghistory.FieldRef) + } + if m.FieldCleared(usersettinghistory.FieldCreatedAt) { + fields = append(fields, usersettinghistory.FieldCreatedAt) + } + if m.FieldCleared(usersettinghistory.FieldUpdatedAt) { + fields = append(fields, usersettinghistory.FieldUpdatedAt) + } + if m.FieldCleared(usersettinghistory.FieldCreatedBy) { + fields = append(fields, usersettinghistory.FieldCreatedBy) + } + if m.FieldCleared(usersettinghistory.FieldUpdatedBy) { + fields = append(fields, usersettinghistory.FieldUpdatedBy) + } + if m.FieldCleared(usersettinghistory.FieldTags) { + fields = append(fields, usersettinghistory.FieldTags) + } + if m.FieldCleared(usersettinghistory.FieldDeletedAt) { + fields = append(fields, usersettinghistory.FieldDeletedAt) + } + if m.FieldCleared(usersettinghistory.FieldDeletedBy) { + fields = append(fields, usersettinghistory.FieldDeletedBy) + } + if m.FieldCleared(usersettinghistory.FieldUserID) { + fields = append(fields, usersettinghistory.FieldUserID) + } + if m.FieldCleared(usersettinghistory.FieldSilencedAt) { + fields = append(fields, usersettinghistory.FieldSilencedAt) + } + if m.FieldCleared(usersettinghistory.FieldSuspendedAt) { + fields = append(fields, usersettinghistory.FieldSuspendedAt) + } + if m.FieldCleared(usersettinghistory.FieldIsWebauthnAllowed) { + fields = append(fields, usersettinghistory.FieldIsWebauthnAllowed) + } + if m.FieldCleared(usersettinghistory.FieldIsTfaEnabled) { + fields = append(fields, usersettinghistory.FieldIsTfaEnabled) + } + if m.FieldCleared(usersettinghistory.FieldPhoneNumber) { + fields = append(fields, usersettinghistory.FieldPhoneNumber) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *UserSettingHistoryMutation) 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 *UserSettingHistoryMutation) ClearField(name string) error { + switch name { + case usersettinghistory.FieldRef: + m.ClearRef() + return nil + case usersettinghistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case usersettinghistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case usersettinghistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case usersettinghistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case usersettinghistory.FieldTags: + m.ClearTags() + return nil + case usersettinghistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case usersettinghistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case usersettinghistory.FieldUserID: + m.ClearUserID() + return nil + case usersettinghistory.FieldSilencedAt: + m.ClearSilencedAt() + return nil + case usersettinghistory.FieldSuspendedAt: + m.ClearSuspendedAt() + return nil + case usersettinghistory.FieldIsWebauthnAllowed: + m.ClearIsWebauthnAllowed() + return nil + case usersettinghistory.FieldIsTfaEnabled: + m.ClearIsTfaEnabled() + return nil + case usersettinghistory.FieldPhoneNumber: + m.ClearPhoneNumber() + return nil + } + return fmt.Errorf("unknown UserSettingHistory 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 *UserSettingHistoryMutation) ResetField(name string) error { + switch name { + case usersettinghistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case usersettinghistory.FieldRef: + m.ResetRef() + return nil + case usersettinghistory.FieldOperation: + m.ResetOperation() + return nil + case usersettinghistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case usersettinghistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case usersettinghistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case usersettinghistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case usersettinghistory.FieldMappingID: + m.ResetMappingID() + return nil + case usersettinghistory.FieldTags: + m.ResetTags() + return nil + case usersettinghistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case usersettinghistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case usersettinghistory.FieldUserID: + m.ResetUserID() + return nil + case usersettinghistory.FieldLocked: + m.ResetLocked() + return nil + case usersettinghistory.FieldSilencedAt: + m.ResetSilencedAt() + return nil + case usersettinghistory.FieldSuspendedAt: + m.ResetSuspendedAt() + return nil + case usersettinghistory.FieldStatus: + m.ResetStatus() + return nil + case usersettinghistory.FieldEmailConfirmed: + m.ResetEmailConfirmed() + return nil + case usersettinghistory.FieldIsWebauthnAllowed: + m.ResetIsWebauthnAllowed() + return nil + case usersettinghistory.FieldIsTfaEnabled: + m.ResetIsTfaEnabled() + return nil + case usersettinghistory.FieldPhoneNumber: + m.ResetPhoneNumber() + return nil + } + return fmt.Errorf("unknown UserSettingHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *UserSettingHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *UserSettingHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *UserSettingHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *UserSettingHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *UserSettingHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *UserSettingHistoryMutation) EdgeCleared(name string) bool { + 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 *UserSettingHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown UserSettingHistory 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 *UserSettingHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown UserSettingHistory edge %s", name) +} + +// WebauthnMutation represents an operation that mutates the Webauthn nodes in the graph. +type WebauthnMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + credential_id *[]byte + public_key *[]byte + attestation_type *string + aaguid *[]byte + sign_count *int32 + addsign_count *int32 + transports *[]string + appendtransports []string + backup_eligible *bool + backup_state *bool + user_present *bool + user_verified *bool + clearedFields map[string]struct{} + owner *string + clearedowner bool + done bool + oldValue func(context.Context) (*Webauthn, error) + predicates []predicate.Webauthn +} + +var _ ent.Mutation = (*WebauthnMutation)(nil) + +// webauthnOption allows management of the mutation configuration using functional options. +type webauthnOption func(*WebauthnMutation) + +// newWebauthnMutation creates new mutation for the Webauthn entity. +func newWebauthnMutation(c config, op Op, opts ...webauthnOption) *WebauthnMutation { + m := &WebauthnMutation{ + config: c, + op: op, + typ: TypeWebauthn, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withWebauthnID sets the ID field of the mutation. +func withWebauthnID(id string) webauthnOption { + return func(m *WebauthnMutation) { + var ( + err error + once sync.Once + value *Webauthn + ) + m.oldValue = func(ctx context.Context) (*Webauthn, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Webauthn.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withWebauthn sets the old Webauthn of the mutation. +func withWebauthn(node *Webauthn) webauthnOption { + return func(m *WebauthnMutation) { + m.oldValue = func(context.Context) (*Webauthn, 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 WebauthnMutation) 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 WebauthnMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Webauthn entities. +func (m *WebauthnMutation) SetID(id string) { + 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 *WebauthnMutation) ID() (id string, 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 *WebauthnMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Webauthn.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *WebauthnMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *WebauthnMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *WebauthnMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[webauthn.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *WebauthnMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[webauthn.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *WebauthnMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, webauthn.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *WebauthnMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *WebauthnMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *WebauthnMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[webauthn.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *WebauthnMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[webauthn.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *WebauthnMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, webauthn.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *WebauthnMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *WebauthnMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *WebauthnMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[webauthn.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *WebauthnMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[webauthn.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *WebauthnMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, webauthn.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *WebauthnMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *WebauthnMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *WebauthnMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[webauthn.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *WebauthnMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[webauthn.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *WebauthnMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, webauthn.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *WebauthnMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *WebauthnMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *WebauthnMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *WebauthnMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *WebauthnMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *WebauthnMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *WebauthnMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *WebauthnMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[webauthn.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *WebauthnMutation) TagsCleared() bool { + _, ok := m.clearedFields[webauthn.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *WebauthnMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, webauthn.FieldTags) +} + +// SetOwnerID sets the "owner_id" field. +func (m *WebauthnMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *WebauthnMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *WebauthnMutation) ResetOwnerID() { + m.owner = nil +} + +// SetCredentialID sets the "credential_id" field. +func (m *WebauthnMutation) SetCredentialID(b []byte) { + m.credential_id = &b +} + +// CredentialID returns the value of the "credential_id" field in the mutation. +func (m *WebauthnMutation) CredentialID() (r []byte, exists bool) { + v := m.credential_id + if v == nil { + return + } + return *v, true +} + +// OldCredentialID returns the old "credential_id" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldCredentialID(ctx context.Context) (v []byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCredentialID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCredentialID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCredentialID: %w", err) + } + return oldValue.CredentialID, nil +} + +// ClearCredentialID clears the value of the "credential_id" field. +func (m *WebauthnMutation) ClearCredentialID() { + m.credential_id = nil + m.clearedFields[webauthn.FieldCredentialID] = struct{}{} +} + +// CredentialIDCleared returns if the "credential_id" field was cleared in this mutation. +func (m *WebauthnMutation) CredentialIDCleared() bool { + _, ok := m.clearedFields[webauthn.FieldCredentialID] + return ok +} + +// ResetCredentialID resets all changes to the "credential_id" field. +func (m *WebauthnMutation) ResetCredentialID() { + m.credential_id = nil + delete(m.clearedFields, webauthn.FieldCredentialID) +} + +// SetPublicKey sets the "public_key" field. +func (m *WebauthnMutation) SetPublicKey(b []byte) { + m.public_key = &b +} + +// PublicKey returns the value of the "public_key" field in the mutation. +func (m *WebauthnMutation) PublicKey() (r []byte, exists bool) { + v := m.public_key + if v == nil { + return + } + return *v, true +} + +// OldPublicKey returns the old "public_key" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldPublicKey(ctx context.Context) (v []byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldPublicKey is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldPublicKey requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldPublicKey: %w", err) + } + return oldValue.PublicKey, nil +} + +// ClearPublicKey clears the value of the "public_key" field. +func (m *WebauthnMutation) ClearPublicKey() { + m.public_key = nil + m.clearedFields[webauthn.FieldPublicKey] = struct{}{} +} + +// PublicKeyCleared returns if the "public_key" field was cleared in this mutation. +func (m *WebauthnMutation) PublicKeyCleared() bool { + _, ok := m.clearedFields[webauthn.FieldPublicKey] + return ok +} + +// ResetPublicKey resets all changes to the "public_key" field. +func (m *WebauthnMutation) ResetPublicKey() { + m.public_key = nil + delete(m.clearedFields, webauthn.FieldPublicKey) +} + +// SetAttestationType sets the "attestation_type" field. +func (m *WebauthnMutation) SetAttestationType(s string) { + m.attestation_type = &s +} + +// AttestationType returns the value of the "attestation_type" field in the mutation. +func (m *WebauthnMutation) AttestationType() (r string, exists bool) { + v := m.attestation_type + if v == nil { + return + } + return *v, true +} + +// OldAttestationType returns the old "attestation_type" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldAttestationType(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAttestationType is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAttestationType requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAttestationType: %w", err) + } + return oldValue.AttestationType, nil +} + +// ClearAttestationType clears the value of the "attestation_type" field. +func (m *WebauthnMutation) ClearAttestationType() { + m.attestation_type = nil + m.clearedFields[webauthn.FieldAttestationType] = struct{}{} +} + +// AttestationTypeCleared returns if the "attestation_type" field was cleared in this mutation. +func (m *WebauthnMutation) AttestationTypeCleared() bool { + _, ok := m.clearedFields[webauthn.FieldAttestationType] + return ok +} + +// ResetAttestationType resets all changes to the "attestation_type" field. +func (m *WebauthnMutation) ResetAttestationType() { + m.attestation_type = nil + delete(m.clearedFields, webauthn.FieldAttestationType) +} + +// SetAaguid sets the "aaguid" field. +func (m *WebauthnMutation) SetAaguid(b []byte) { + m.aaguid = &b +} + +// Aaguid returns the value of the "aaguid" field in the mutation. +func (m *WebauthnMutation) Aaguid() (r []byte, exists bool) { + v := m.aaguid + if v == nil { + return + } + return *v, true +} + +// OldAaguid returns the old "aaguid" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldAaguid(ctx context.Context) (v []byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldAaguid is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldAaguid requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldAaguid: %w", err) + } + return oldValue.Aaguid, nil +} + +// ResetAaguid resets all changes to the "aaguid" field. +func (m *WebauthnMutation) ResetAaguid() { + m.aaguid = nil +} + +// SetSignCount sets the "sign_count" field. +func (m *WebauthnMutation) SetSignCount(i int32) { + m.sign_count = &i + m.addsign_count = nil +} + +// SignCount returns the value of the "sign_count" field in the mutation. +func (m *WebauthnMutation) SignCount() (r int32, exists bool) { + v := m.sign_count + if v == nil { + return + } + return *v, true +} + +// OldSignCount returns the old "sign_count" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldSignCount(ctx context.Context) (v int32, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSignCount is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSignCount requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSignCount: %w", err) + } + return oldValue.SignCount, nil +} + +// AddSignCount adds i to the "sign_count" field. +func (m *WebauthnMutation) AddSignCount(i int32) { + if m.addsign_count != nil { + *m.addsign_count += i + } else { + m.addsign_count = &i + } +} + +// AddedSignCount returns the value that was added to the "sign_count" field in this mutation. +func (m *WebauthnMutation) AddedSignCount() (r int32, exists bool) { + v := m.addsign_count + if v == nil { + return + } + return *v, true +} + +// ResetSignCount resets all changes to the "sign_count" field. +func (m *WebauthnMutation) ResetSignCount() { + m.sign_count = nil + m.addsign_count = nil +} + +// SetTransports sets the "transports" field. +func (m *WebauthnMutation) SetTransports(s []string) { + m.transports = &s + m.appendtransports = nil +} + +// Transports returns the value of the "transports" field in the mutation. +func (m *WebauthnMutation) Transports() (r []string, exists bool) { + v := m.transports + if v == nil { + return + } + return *v, true +} + +// OldTransports returns the old "transports" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldTransports(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTransports is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTransports requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTransports: %w", err) + } + return oldValue.Transports, nil +} + +// AppendTransports adds s to the "transports" field. +func (m *WebauthnMutation) AppendTransports(s []string) { + m.appendtransports = append(m.appendtransports, s...) +} + +// AppendedTransports returns the list of values that were appended to the "transports" field in this mutation. +func (m *WebauthnMutation) AppendedTransports() ([]string, bool) { + if len(m.appendtransports) == 0 { + return nil, false + } + return m.appendtransports, true +} + +// ResetTransports resets all changes to the "transports" field. +func (m *WebauthnMutation) ResetTransports() { + m.transports = nil + m.appendtransports = nil +} + +// SetBackupEligible sets the "backup_eligible" field. +func (m *WebauthnMutation) SetBackupEligible(b bool) { + m.backup_eligible = &b +} + +// BackupEligible returns the value of the "backup_eligible" field in the mutation. +func (m *WebauthnMutation) BackupEligible() (r bool, exists bool) { + v := m.backup_eligible + if v == nil { + return + } + return *v, true +} + +// OldBackupEligible returns the old "backup_eligible" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldBackupEligible(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBackupEligible is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBackupEligible requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBackupEligible: %w", err) + } + return oldValue.BackupEligible, nil +} + +// ResetBackupEligible resets all changes to the "backup_eligible" field. +func (m *WebauthnMutation) ResetBackupEligible() { + m.backup_eligible = nil +} + +// SetBackupState sets the "backup_state" field. +func (m *WebauthnMutation) SetBackupState(b bool) { + m.backup_state = &b +} + +// BackupState returns the value of the "backup_state" field in the mutation. +func (m *WebauthnMutation) BackupState() (r bool, exists bool) { + v := m.backup_state + if v == nil { + return + } + return *v, true +} + +// OldBackupState returns the old "backup_state" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldBackupState(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldBackupState is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldBackupState requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldBackupState: %w", err) + } + return oldValue.BackupState, nil +} + +// ResetBackupState resets all changes to the "backup_state" field. +func (m *WebauthnMutation) ResetBackupState() { + m.backup_state = nil +} + +// SetUserPresent sets the "user_present" field. +func (m *WebauthnMutation) SetUserPresent(b bool) { + m.user_present = &b +} + +// UserPresent returns the value of the "user_present" field in the mutation. +func (m *WebauthnMutation) UserPresent() (r bool, exists bool) { + v := m.user_present + if v == nil { + return + } + return *v, true +} + +// OldUserPresent returns the old "user_present" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldUserPresent(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserPresent is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserPresent requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserPresent: %w", err) + } + return oldValue.UserPresent, nil +} + +// ResetUserPresent resets all changes to the "user_present" field. +func (m *WebauthnMutation) ResetUserPresent() { + m.user_present = nil +} + +// SetUserVerified sets the "user_verified" field. +func (m *WebauthnMutation) SetUserVerified(b bool) { + m.user_verified = &b +} + +// UserVerified returns the value of the "user_verified" field in the mutation. +func (m *WebauthnMutation) UserVerified() (r bool, exists bool) { + v := m.user_verified + if v == nil { + return + } + return *v, true +} + +// OldUserVerified returns the old "user_verified" field's value of the Webauthn entity. +// If the Webauthn 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 *WebauthnMutation) OldUserVerified(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUserVerified is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUserVerified requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUserVerified: %w", err) + } + return oldValue.UserVerified, nil +} + +// ResetUserVerified resets all changes to the "user_verified" field. +func (m *WebauthnMutation) ResetUserVerified() { + m.user_verified = nil +} + +// ClearOwner clears the "owner" edge to the User entity. +func (m *WebauthnMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[webauthn.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the User entity was cleared. +func (m *WebauthnMutation) OwnerCleared() bool { + return m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *WebauthnMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *WebauthnMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// Where appends a list predicates to the WebauthnMutation builder. +func (m *WebauthnMutation) Where(ps ...predicate.Webauthn) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the WebauthnMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *WebauthnMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Webauthn, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *WebauthnMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *WebauthnMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Webauthn). +func (m *WebauthnMutation) 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 *WebauthnMutation) Fields() []string { + fields := make([]string, 0, 17) + if m.created_at != nil { + fields = append(fields, webauthn.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, webauthn.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, webauthn.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, webauthn.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, webauthn.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, webauthn.FieldTags) + } + if m.owner != nil { + fields = append(fields, webauthn.FieldOwnerID) + } + if m.credential_id != nil { + fields = append(fields, webauthn.FieldCredentialID) + } + if m.public_key != nil { + fields = append(fields, webauthn.FieldPublicKey) + } + if m.attestation_type != nil { + fields = append(fields, webauthn.FieldAttestationType) + } + if m.aaguid != nil { + fields = append(fields, webauthn.FieldAaguid) + } + if m.sign_count != nil { + fields = append(fields, webauthn.FieldSignCount) + } + if m.transports != nil { + fields = append(fields, webauthn.FieldTransports) + } + if m.backup_eligible != nil { + fields = append(fields, webauthn.FieldBackupEligible) + } + if m.backup_state != nil { + fields = append(fields, webauthn.FieldBackupState) + } + if m.user_present != nil { + fields = append(fields, webauthn.FieldUserPresent) + } + if m.user_verified != nil { + fields = append(fields, webauthn.FieldUserVerified) + } + 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 *WebauthnMutation) Field(name string) (ent.Value, bool) { + switch name { + case webauthn.FieldCreatedAt: + return m.CreatedAt() + case webauthn.FieldUpdatedAt: + return m.UpdatedAt() + case webauthn.FieldCreatedBy: + return m.CreatedBy() + case webauthn.FieldUpdatedBy: + return m.UpdatedBy() + case webauthn.FieldMappingID: + return m.MappingID() + case webauthn.FieldTags: + return m.Tags() + case webauthn.FieldOwnerID: + return m.OwnerID() + case webauthn.FieldCredentialID: + return m.CredentialID() + case webauthn.FieldPublicKey: + return m.PublicKey() + case webauthn.FieldAttestationType: + return m.AttestationType() + case webauthn.FieldAaguid: + return m.Aaguid() + case webauthn.FieldSignCount: + return m.SignCount() + case webauthn.FieldTransports: + return m.Transports() + case webauthn.FieldBackupEligible: + return m.BackupEligible() + case webauthn.FieldBackupState: + return m.BackupState() + case webauthn.FieldUserPresent: + return m.UserPresent() + case webauthn.FieldUserVerified: + return m.UserVerified() + } + 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 *WebauthnMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case webauthn.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case webauthn.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case webauthn.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case webauthn.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case webauthn.FieldMappingID: + return m.OldMappingID(ctx) + case webauthn.FieldTags: + return m.OldTags(ctx) + case webauthn.FieldOwnerID: + return m.OldOwnerID(ctx) + case webauthn.FieldCredentialID: + return m.OldCredentialID(ctx) + case webauthn.FieldPublicKey: + return m.OldPublicKey(ctx) + case webauthn.FieldAttestationType: + return m.OldAttestationType(ctx) + case webauthn.FieldAaguid: + return m.OldAaguid(ctx) + case webauthn.FieldSignCount: + return m.OldSignCount(ctx) + case webauthn.FieldTransports: + return m.OldTransports(ctx) + case webauthn.FieldBackupEligible: + return m.OldBackupEligible(ctx) + case webauthn.FieldBackupState: + return m.OldBackupState(ctx) + case webauthn.FieldUserPresent: + return m.OldUserPresent(ctx) + case webauthn.FieldUserVerified: + return m.OldUserVerified(ctx) + } + return nil, fmt.Errorf("unknown Webauthn 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 *WebauthnMutation) SetField(name string, value ent.Value) error { + switch name { + case webauthn.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case webauthn.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case webauthn.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case webauthn.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case webauthn.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case webauthn.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case webauthn.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case webauthn.FieldCredentialID: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCredentialID(v) + return nil + case webauthn.FieldPublicKey: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetPublicKey(v) + return nil + case webauthn.FieldAttestationType: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAttestationType(v) + return nil + case webauthn.FieldAaguid: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetAaguid(v) + return nil + case webauthn.FieldSignCount: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSignCount(v) + return nil + case webauthn.FieldTransports: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTransports(v) + return nil + case webauthn.FieldBackupEligible: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBackupEligible(v) + return nil + case webauthn.FieldBackupState: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetBackupState(v) + return nil + case webauthn.FieldUserPresent: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserPresent(v) + return nil + case webauthn.FieldUserVerified: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUserVerified(v) + return nil + } + return fmt.Errorf("unknown Webauthn field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *WebauthnMutation) AddedFields() []string { + var fields []string + if m.addsign_count != nil { + fields = append(fields, webauthn.FieldSignCount) + } + return fields +} + +// 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 *WebauthnMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case webauthn.FieldSignCount: + return m.AddedSignCount() + } + 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 *WebauthnMutation) AddField(name string, value ent.Value) error { + switch name { + case webauthn.FieldSignCount: + v, ok := value.(int32) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddSignCount(v) + return nil + } + return fmt.Errorf("unknown Webauthn numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *WebauthnMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(webauthn.FieldCreatedAt) { + fields = append(fields, webauthn.FieldCreatedAt) + } + if m.FieldCleared(webauthn.FieldUpdatedAt) { + fields = append(fields, webauthn.FieldUpdatedAt) + } + if m.FieldCleared(webauthn.FieldCreatedBy) { + fields = append(fields, webauthn.FieldCreatedBy) + } + if m.FieldCleared(webauthn.FieldUpdatedBy) { + fields = append(fields, webauthn.FieldUpdatedBy) + } + if m.FieldCleared(webauthn.FieldTags) { + fields = append(fields, webauthn.FieldTags) + } + if m.FieldCleared(webauthn.FieldCredentialID) { + fields = append(fields, webauthn.FieldCredentialID) + } + if m.FieldCleared(webauthn.FieldPublicKey) { + fields = append(fields, webauthn.FieldPublicKey) + } + if m.FieldCleared(webauthn.FieldAttestationType) { + fields = append(fields, webauthn.FieldAttestationType) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *WebauthnMutation) 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 *WebauthnMutation) ClearField(name string) error { + switch name { + case webauthn.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case webauthn.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case webauthn.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case webauthn.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case webauthn.FieldTags: + m.ClearTags() + return nil + case webauthn.FieldCredentialID: + m.ClearCredentialID() + return nil + case webauthn.FieldPublicKey: + m.ClearPublicKey() + return nil + case webauthn.FieldAttestationType: + m.ClearAttestationType() + return nil + } + return fmt.Errorf("unknown Webauthn 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 *WebauthnMutation) ResetField(name string) error { + switch name { + case webauthn.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case webauthn.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case webauthn.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case webauthn.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case webauthn.FieldMappingID: + m.ResetMappingID() + return nil + case webauthn.FieldTags: + m.ResetTags() + return nil + case webauthn.FieldOwnerID: + m.ResetOwnerID() + return nil + case webauthn.FieldCredentialID: + m.ResetCredentialID() + return nil + case webauthn.FieldPublicKey: + m.ResetPublicKey() + return nil + case webauthn.FieldAttestationType: + m.ResetAttestationType() + return nil + case webauthn.FieldAaguid: + m.ResetAaguid() + return nil + case webauthn.FieldSignCount: + m.ResetSignCount() + return nil + case webauthn.FieldTransports: + m.ResetTransports() + return nil + case webauthn.FieldBackupEligible: + m.ResetBackupEligible() + return nil + case webauthn.FieldBackupState: + m.ResetBackupState() + return nil + case webauthn.FieldUserPresent: + m.ResetUserPresent() + return nil + case webauthn.FieldUserVerified: + m.ResetUserVerified() + return nil + } + return fmt.Errorf("unknown Webauthn field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *WebauthnMutation) AddedEdges() []string { + edges := make([]string, 0, 1) + if m.owner != nil { + edges = append(edges, webauthn.EdgeOwner) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *WebauthnMutation) AddedIDs(name string) []ent.Value { + switch name { + case webauthn.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *WebauthnMutation) 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 *WebauthnMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *WebauthnMutation) ClearedEdges() []string { + edges := make([]string, 0, 1) + if m.clearedowner { + edges = append(edges, webauthn.EdgeOwner) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *WebauthnMutation) EdgeCleared(name string) bool { + switch name { + case webauthn.EdgeOwner: + return m.clearedowner + } + 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 *WebauthnMutation) ClearEdge(name string) error { + switch name { + case webauthn.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Webauthn 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 *WebauthnMutation) ResetEdge(name string) error { + switch name { + case webauthn.EdgeOwner: + m.ResetOwner() + return nil + } + return fmt.Errorf("unknown Webauthn edge %s", name) +} + +// WebhookMutation represents an operation that mutates the Webhook nodes in the graph. +type WebhookMutation struct { + config + op Op + typ string + id *string + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + name *string + description *string + destination_url *string + enabled *bool + callback *string + expires_at *time.Time + secret *[]byte + failures *int + addfailures *int + last_error *string + last_response *string + clearedFields map[string]struct{} + owner *string + clearedowner bool + events map[string]struct{} + removedevents map[string]struct{} + clearedevents bool + integrations map[string]struct{} + removedintegrations map[string]struct{} + clearedintegrations bool + done bool + oldValue func(context.Context) (*Webhook, error) + predicates []predicate.Webhook +} + +var _ ent.Mutation = (*WebhookMutation)(nil) + +// webhookOption allows management of the mutation configuration using functional options. +type webhookOption func(*WebhookMutation) + +// newWebhookMutation creates new mutation for the Webhook entity. +func newWebhookMutation(c config, op Op, opts ...webhookOption) *WebhookMutation { + m := &WebhookMutation{ + config: c, + op: op, + typ: TypeWebhook, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withWebhookID sets the ID field of the mutation. +func withWebhookID(id string) webhookOption { + return func(m *WebhookMutation) { + var ( + err error + once sync.Once + value *Webhook + ) + m.oldValue = func(ctx context.Context) (*Webhook, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().Webhook.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withWebhook sets the old Webhook of the mutation. +func withWebhook(node *Webhook) webhookOption { + return func(m *WebhookMutation) { + m.oldValue = func(context.Context) (*Webhook, 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 WebhookMutation) 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 WebhookMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of Webhook entities. +func (m *WebhookMutation) SetID(id string) { + 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 *WebhookMutation) ID() (id string, 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 *WebhookMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().Webhook.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetCreatedAt sets the "created_at" field. +func (m *WebhookMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *WebhookMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *WebhookMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[webhook.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *WebhookMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[webhook.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *WebhookMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, webhook.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *WebhookMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *WebhookMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *WebhookMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[webhook.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *WebhookMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[webhook.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *WebhookMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, webhook.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *WebhookMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *WebhookMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *WebhookMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[webhook.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *WebhookMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[webhook.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *WebhookMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, webhook.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *WebhookMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *WebhookMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *WebhookMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[webhook.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *WebhookMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[webhook.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *WebhookMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, webhook.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *WebhookMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *WebhookMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *WebhookMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *WebhookMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *WebhookMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *WebhookMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *WebhookMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *WebhookMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[webhook.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *WebhookMutation) TagsCleared() bool { + _, ok := m.clearedFields[webhook.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *WebhookMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, webhook.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *WebhookMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *WebhookMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *WebhookMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[webhook.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *WebhookMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[webhook.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *WebhookMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, webhook.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *WebhookMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *WebhookMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *WebhookMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[webhook.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *WebhookMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[webhook.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *WebhookMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, webhook.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *WebhookMutation) SetOwnerID(s string) { + m.owner = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *WebhookMutation) OwnerID() (r string, exists bool) { + v := m.owner + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *WebhookMutation) ClearOwnerID() { + m.owner = nil + m.clearedFields[webhook.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *WebhookMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[webhook.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *WebhookMutation) ResetOwnerID() { + m.owner = nil + delete(m.clearedFields, webhook.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *WebhookMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *WebhookMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *WebhookMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *WebhookMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *WebhookMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *WebhookMutation) ClearDescription() { + m.description = nil + m.clearedFields[webhook.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *WebhookMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[webhook.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *WebhookMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, webhook.FieldDescription) +} + +// SetDestinationURL sets the "destination_url" field. +func (m *WebhookMutation) SetDestinationURL(s string) { + m.destination_url = &s +} + +// DestinationURL returns the value of the "destination_url" field in the mutation. +func (m *WebhookMutation) DestinationURL() (r string, exists bool) { + v := m.destination_url + if v == nil { + return + } + return *v, true +} + +// OldDestinationURL returns the old "destination_url" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldDestinationURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDestinationURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDestinationURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDestinationURL: %w", err) + } + return oldValue.DestinationURL, nil +} + +// ResetDestinationURL resets all changes to the "destination_url" field. +func (m *WebhookMutation) ResetDestinationURL() { + m.destination_url = nil +} + +// SetEnabled sets the "enabled" field. +func (m *WebhookMutation) SetEnabled(b bool) { + m.enabled = &b +} + +// Enabled returns the value of the "enabled" field in the mutation. +func (m *WebhookMutation) Enabled() (r bool, exists bool) { + v := m.enabled + if v == nil { + return + } + return *v, true +} + +// OldEnabled returns the old "enabled" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldEnabled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEnabled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEnabled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEnabled: %w", err) + } + return oldValue.Enabled, nil +} + +// ResetEnabled resets all changes to the "enabled" field. +func (m *WebhookMutation) ResetEnabled() { + m.enabled = nil +} + +// SetCallback sets the "callback" field. +func (m *WebhookMutation) SetCallback(s string) { + m.callback = &s +} + +// Callback returns the value of the "callback" field in the mutation. +func (m *WebhookMutation) Callback() (r string, exists bool) { + v := m.callback + if v == nil { + return + } + return *v, true +} + +// OldCallback returns the old "callback" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldCallback(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCallback is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCallback requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCallback: %w", err) + } + return oldValue.Callback, nil +} + +// ClearCallback clears the value of the "callback" field. +func (m *WebhookMutation) ClearCallback() { + m.callback = nil + m.clearedFields[webhook.FieldCallback] = struct{}{} +} + +// CallbackCleared returns if the "callback" field was cleared in this mutation. +func (m *WebhookMutation) CallbackCleared() bool { + _, ok := m.clearedFields[webhook.FieldCallback] + return ok +} + +// ResetCallback resets all changes to the "callback" field. +func (m *WebhookMutation) ResetCallback() { + m.callback = nil + delete(m.clearedFields, webhook.FieldCallback) +} + +// SetExpiresAt sets the "expires_at" field. +func (m *WebhookMutation) SetExpiresAt(t time.Time) { + m.expires_at = &t +} + +// ExpiresAt returns the value of the "expires_at" field in the mutation. +func (m *WebhookMutation) ExpiresAt() (r time.Time, exists bool) { + v := m.expires_at + if v == nil { + return + } + return *v, true +} + +// OldExpiresAt returns the old "expires_at" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpiresAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpiresAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpiresAt: %w", err) + } + return oldValue.ExpiresAt, nil +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (m *WebhookMutation) ClearExpiresAt() { + m.expires_at = nil + m.clearedFields[webhook.FieldExpiresAt] = struct{}{} +} + +// ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation. +func (m *WebhookMutation) ExpiresAtCleared() bool { + _, ok := m.clearedFields[webhook.FieldExpiresAt] + return ok +} + +// ResetExpiresAt resets all changes to the "expires_at" field. +func (m *WebhookMutation) ResetExpiresAt() { + m.expires_at = nil + delete(m.clearedFields, webhook.FieldExpiresAt) +} + +// SetSecret sets the "secret" field. +func (m *WebhookMutation) SetSecret(b []byte) { + m.secret = &b +} + +// Secret returns the value of the "secret" field in the mutation. +func (m *WebhookMutation) Secret() (r []byte, exists bool) { + v := m.secret + if v == nil { + return + } + return *v, true +} + +// OldSecret returns the old "secret" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldSecret(ctx context.Context) (v []byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecret: %w", err) + } + return oldValue.Secret, nil +} + +// ClearSecret clears the value of the "secret" field. +func (m *WebhookMutation) ClearSecret() { + m.secret = nil + m.clearedFields[webhook.FieldSecret] = struct{}{} +} + +// SecretCleared returns if the "secret" field was cleared in this mutation. +func (m *WebhookMutation) SecretCleared() bool { + _, ok := m.clearedFields[webhook.FieldSecret] + return ok +} + +// ResetSecret resets all changes to the "secret" field. +func (m *WebhookMutation) ResetSecret() { + m.secret = nil + delete(m.clearedFields, webhook.FieldSecret) +} + +// SetFailures sets the "failures" field. +func (m *WebhookMutation) SetFailures(i int) { + m.failures = &i + m.addfailures = nil +} + +// Failures returns the value of the "failures" field in the mutation. +func (m *WebhookMutation) Failures() (r int, exists bool) { + v := m.failures + if v == nil { + return + } + return *v, true +} + +// OldFailures returns the old "failures" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldFailures(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFailures is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFailures requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFailures: %w", err) + } + return oldValue.Failures, nil +} + +// AddFailures adds i to the "failures" field. +func (m *WebhookMutation) AddFailures(i int) { + if m.addfailures != nil { + *m.addfailures += i + } else { + m.addfailures = &i + } +} + +// AddedFailures returns the value that was added to the "failures" field in this mutation. +func (m *WebhookMutation) AddedFailures() (r int, exists bool) { + v := m.addfailures + if v == nil { + return + } + return *v, true +} + +// ClearFailures clears the value of the "failures" field. +func (m *WebhookMutation) ClearFailures() { + m.failures = nil + m.addfailures = nil + m.clearedFields[webhook.FieldFailures] = struct{}{} +} + +// FailuresCleared returns if the "failures" field was cleared in this mutation. +func (m *WebhookMutation) FailuresCleared() bool { + _, ok := m.clearedFields[webhook.FieldFailures] + return ok +} + +// ResetFailures resets all changes to the "failures" field. +func (m *WebhookMutation) ResetFailures() { + m.failures = nil + m.addfailures = nil + delete(m.clearedFields, webhook.FieldFailures) +} + +// SetLastError sets the "last_error" field. +func (m *WebhookMutation) SetLastError(s string) { + m.last_error = &s +} + +// LastError returns the value of the "last_error" field in the mutation. +func (m *WebhookMutation) LastError() (r string, exists bool) { + v := m.last_error + if v == nil { + return + } + return *v, true +} + +// OldLastError returns the old "last_error" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldLastError(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastError is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastError requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastError: %w", err) + } + return oldValue.LastError, nil +} + +// ClearLastError clears the value of the "last_error" field. +func (m *WebhookMutation) ClearLastError() { + m.last_error = nil + m.clearedFields[webhook.FieldLastError] = struct{}{} +} + +// LastErrorCleared returns if the "last_error" field was cleared in this mutation. +func (m *WebhookMutation) LastErrorCleared() bool { + _, ok := m.clearedFields[webhook.FieldLastError] + return ok +} + +// ResetLastError resets all changes to the "last_error" field. +func (m *WebhookMutation) ResetLastError() { + m.last_error = nil + delete(m.clearedFields, webhook.FieldLastError) +} + +// SetLastResponse sets the "last_response" field. +func (m *WebhookMutation) SetLastResponse(s string) { + m.last_response = &s +} + +// LastResponse returns the value of the "last_response" field in the mutation. +func (m *WebhookMutation) LastResponse() (r string, exists bool) { + v := m.last_response + if v == nil { + return + } + return *v, true +} + +// OldLastResponse returns the old "last_response" field's value of the Webhook entity. +// If the Webhook 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 *WebhookMutation) OldLastResponse(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastResponse is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastResponse requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastResponse: %w", err) + } + return oldValue.LastResponse, nil +} + +// ClearLastResponse clears the value of the "last_response" field. +func (m *WebhookMutation) ClearLastResponse() { + m.last_response = nil + m.clearedFields[webhook.FieldLastResponse] = struct{}{} +} + +// LastResponseCleared returns if the "last_response" field was cleared in this mutation. +func (m *WebhookMutation) LastResponseCleared() bool { + _, ok := m.clearedFields[webhook.FieldLastResponse] + return ok +} + +// ResetLastResponse resets all changes to the "last_response" field. +func (m *WebhookMutation) ResetLastResponse() { + m.last_response = nil + delete(m.clearedFields, webhook.FieldLastResponse) +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (m *WebhookMutation) ClearOwner() { + m.clearedowner = true + m.clearedFields[webhook.FieldOwnerID] = struct{}{} +} + +// OwnerCleared reports if the "owner" edge to the Organization entity was cleared. +func (m *WebhookMutation) OwnerCleared() bool { + return m.OwnerIDCleared() || m.clearedowner +} + +// OwnerIDs returns the "owner" edge IDs in the mutation. +// Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use +// OwnerID instead. It exists only for internal usage by the builders. +func (m *WebhookMutation) OwnerIDs() (ids []string) { + if id := m.owner; id != nil { + ids = append(ids, *id) + } + return +} + +// ResetOwner resets all changes to the "owner" edge. +func (m *WebhookMutation) ResetOwner() { + m.owner = nil + m.clearedowner = false +} + +// AddEventIDs adds the "events" edge to the Event entity by ids. +func (m *WebhookMutation) AddEventIDs(ids ...string) { + if m.events == nil { + m.events = make(map[string]struct{}) + } + for i := range ids { + m.events[ids[i]] = struct{}{} + } +} + +// ClearEvents clears the "events" edge to the Event entity. +func (m *WebhookMutation) ClearEvents() { + m.clearedevents = true +} + +// EventsCleared reports if the "events" edge to the Event entity was cleared. +func (m *WebhookMutation) EventsCleared() bool { + return m.clearedevents +} + +// RemoveEventIDs removes the "events" edge to the Event entity by IDs. +func (m *WebhookMutation) RemoveEventIDs(ids ...string) { + if m.removedevents == nil { + m.removedevents = make(map[string]struct{}) + } + for i := range ids { + delete(m.events, ids[i]) + m.removedevents[ids[i]] = struct{}{} + } +} + +// RemovedEvents returns the removed IDs of the "events" edge to the Event entity. +func (m *WebhookMutation) RemovedEventsIDs() (ids []string) { + for id := range m.removedevents { + ids = append(ids, id) + } + return +} + +// EventsIDs returns the "events" edge IDs in the mutation. +func (m *WebhookMutation) EventsIDs() (ids []string) { + for id := range m.events { + ids = append(ids, id) + } + return +} + +// ResetEvents resets all changes to the "events" edge. +func (m *WebhookMutation) ResetEvents() { + m.events = nil + m.clearedevents = false + m.removedevents = nil +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by ids. +func (m *WebhookMutation) AddIntegrationIDs(ids ...string) { + if m.integrations == nil { + m.integrations = make(map[string]struct{}) + } + for i := range ids { + m.integrations[ids[i]] = struct{}{} + } +} + +// ClearIntegrations clears the "integrations" edge to the Integration entity. +func (m *WebhookMutation) ClearIntegrations() { + m.clearedintegrations = true +} + +// IntegrationsCleared reports if the "integrations" edge to the Integration entity was cleared. +func (m *WebhookMutation) IntegrationsCleared() bool { + return m.clearedintegrations +} + +// RemoveIntegrationIDs removes the "integrations" edge to the Integration entity by IDs. +func (m *WebhookMutation) RemoveIntegrationIDs(ids ...string) { + if m.removedintegrations == nil { + m.removedintegrations = make(map[string]struct{}) + } + for i := range ids { + delete(m.integrations, ids[i]) + m.removedintegrations[ids[i]] = struct{}{} + } +} + +// RemovedIntegrations returns the removed IDs of the "integrations" edge to the Integration entity. +func (m *WebhookMutation) RemovedIntegrationsIDs() (ids []string) { + for id := range m.removedintegrations { + ids = append(ids, id) + } + return +} + +// IntegrationsIDs returns the "integrations" edge IDs in the mutation. +func (m *WebhookMutation) IntegrationsIDs() (ids []string) { + for id := range m.integrations { + ids = append(ids, id) + } + return +} + +// ResetIntegrations resets all changes to the "integrations" edge. +func (m *WebhookMutation) ResetIntegrations() { + m.integrations = nil + m.clearedintegrations = false + m.removedintegrations = nil +} + +// Where appends a list predicates to the WebhookMutation builder. +func (m *WebhookMutation) Where(ps ...predicate.Webhook) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the WebhookMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *WebhookMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.Webhook, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *WebhookMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *WebhookMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (Webhook). +func (m *WebhookMutation) 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 *WebhookMutation) Fields() []string { + fields := make([]string, 0, 19) + if m.created_at != nil { + fields = append(fields, webhook.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, webhook.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, webhook.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, webhook.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, webhook.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, webhook.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, webhook.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, webhook.FieldDeletedBy) + } + if m.owner != nil { + fields = append(fields, webhook.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, webhook.FieldName) + } + if m.description != nil { + fields = append(fields, webhook.FieldDescription) + } + if m.destination_url != nil { + fields = append(fields, webhook.FieldDestinationURL) + } + if m.enabled != nil { + fields = append(fields, webhook.FieldEnabled) + } + if m.callback != nil { + fields = append(fields, webhook.FieldCallback) + } + if m.expires_at != nil { + fields = append(fields, webhook.FieldExpiresAt) + } + if m.secret != nil { + fields = append(fields, webhook.FieldSecret) + } + if m.failures != nil { + fields = append(fields, webhook.FieldFailures) + } + if m.last_error != nil { + fields = append(fields, webhook.FieldLastError) + } + if m.last_response != nil { + fields = append(fields, webhook.FieldLastResponse) + } + 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 *WebhookMutation) Field(name string) (ent.Value, bool) { + switch name { + case webhook.FieldCreatedAt: + return m.CreatedAt() + case webhook.FieldUpdatedAt: + return m.UpdatedAt() + case webhook.FieldCreatedBy: + return m.CreatedBy() + case webhook.FieldUpdatedBy: + return m.UpdatedBy() + case webhook.FieldMappingID: + return m.MappingID() + case webhook.FieldTags: + return m.Tags() + case webhook.FieldDeletedAt: + return m.DeletedAt() + case webhook.FieldDeletedBy: + return m.DeletedBy() + case webhook.FieldOwnerID: + return m.OwnerID() + case webhook.FieldName: + return m.Name() + case webhook.FieldDescription: + return m.Description() + case webhook.FieldDestinationURL: + return m.DestinationURL() + case webhook.FieldEnabled: + return m.Enabled() + case webhook.FieldCallback: + return m.Callback() + case webhook.FieldExpiresAt: + return m.ExpiresAt() + case webhook.FieldSecret: + return m.Secret() + case webhook.FieldFailures: + return m.Failures() + case webhook.FieldLastError: + return m.LastError() + case webhook.FieldLastResponse: + return m.LastResponse() + } + 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 *WebhookMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case webhook.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case webhook.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case webhook.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case webhook.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case webhook.FieldMappingID: + return m.OldMappingID(ctx) + case webhook.FieldTags: + return m.OldTags(ctx) + case webhook.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case webhook.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case webhook.FieldOwnerID: + return m.OldOwnerID(ctx) + case webhook.FieldName: + return m.OldName(ctx) + case webhook.FieldDescription: + return m.OldDescription(ctx) + case webhook.FieldDestinationURL: + return m.OldDestinationURL(ctx) + case webhook.FieldEnabled: + return m.OldEnabled(ctx) + case webhook.FieldCallback: + return m.OldCallback(ctx) + case webhook.FieldExpiresAt: + return m.OldExpiresAt(ctx) + case webhook.FieldSecret: + return m.OldSecret(ctx) + case webhook.FieldFailures: + return m.OldFailures(ctx) + case webhook.FieldLastError: + return m.OldLastError(ctx) + case webhook.FieldLastResponse: + return m.OldLastResponse(ctx) + } + return nil, fmt.Errorf("unknown Webhook 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 *WebhookMutation) SetField(name string, value ent.Value) error { + switch name { + case webhook.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case webhook.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case webhook.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case webhook.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case webhook.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case webhook.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case webhook.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case webhook.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case webhook.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case webhook.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case webhook.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case webhook.FieldDestinationURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDestinationURL(v) + return nil + case webhook.FieldEnabled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEnabled(v) + return nil + case webhook.FieldCallback: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCallback(v) + return nil + case webhook.FieldExpiresAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpiresAt(v) + return nil + case webhook.FieldSecret: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecret(v) + return nil + case webhook.FieldFailures: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFailures(v) + return nil + case webhook.FieldLastError: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastError(v) + return nil + case webhook.FieldLastResponse: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastResponse(v) + return nil + } + return fmt.Errorf("unknown Webhook field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *WebhookMutation) AddedFields() []string { + var fields []string + if m.addfailures != nil { + fields = append(fields, webhook.FieldFailures) + } + return fields +} + +// 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 *WebhookMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case webhook.FieldFailures: + return m.AddedFailures() + } + 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 *WebhookMutation) AddField(name string, value ent.Value) error { + switch name { + case webhook.FieldFailures: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddFailures(v) + return nil + } + return fmt.Errorf("unknown Webhook numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *WebhookMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(webhook.FieldCreatedAt) { + fields = append(fields, webhook.FieldCreatedAt) + } + if m.FieldCleared(webhook.FieldUpdatedAt) { + fields = append(fields, webhook.FieldUpdatedAt) + } + if m.FieldCleared(webhook.FieldCreatedBy) { + fields = append(fields, webhook.FieldCreatedBy) + } + if m.FieldCleared(webhook.FieldUpdatedBy) { + fields = append(fields, webhook.FieldUpdatedBy) + } + if m.FieldCleared(webhook.FieldTags) { + fields = append(fields, webhook.FieldTags) + } + if m.FieldCleared(webhook.FieldDeletedAt) { + fields = append(fields, webhook.FieldDeletedAt) + } + if m.FieldCleared(webhook.FieldDeletedBy) { + fields = append(fields, webhook.FieldDeletedBy) + } + if m.FieldCleared(webhook.FieldOwnerID) { + fields = append(fields, webhook.FieldOwnerID) + } + if m.FieldCleared(webhook.FieldDescription) { + fields = append(fields, webhook.FieldDescription) + } + if m.FieldCleared(webhook.FieldCallback) { + fields = append(fields, webhook.FieldCallback) + } + if m.FieldCleared(webhook.FieldExpiresAt) { + fields = append(fields, webhook.FieldExpiresAt) + } + if m.FieldCleared(webhook.FieldSecret) { + fields = append(fields, webhook.FieldSecret) + } + if m.FieldCleared(webhook.FieldFailures) { + fields = append(fields, webhook.FieldFailures) + } + if m.FieldCleared(webhook.FieldLastError) { + fields = append(fields, webhook.FieldLastError) + } + if m.FieldCleared(webhook.FieldLastResponse) { + fields = append(fields, webhook.FieldLastResponse) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *WebhookMutation) 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 *WebhookMutation) ClearField(name string) error { + switch name { + case webhook.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case webhook.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case webhook.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case webhook.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case webhook.FieldTags: + m.ClearTags() + return nil + case webhook.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case webhook.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case webhook.FieldOwnerID: + m.ClearOwnerID() + return nil + case webhook.FieldDescription: + m.ClearDescription() + return nil + case webhook.FieldCallback: + m.ClearCallback() + return nil + case webhook.FieldExpiresAt: + m.ClearExpiresAt() + return nil + case webhook.FieldSecret: + m.ClearSecret() + return nil + case webhook.FieldFailures: + m.ClearFailures() + return nil + case webhook.FieldLastError: + m.ClearLastError() + return nil + case webhook.FieldLastResponse: + m.ClearLastResponse() + return nil + } + return fmt.Errorf("unknown Webhook 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 *WebhookMutation) ResetField(name string) error { + switch name { + case webhook.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case webhook.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case webhook.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case webhook.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case webhook.FieldMappingID: + m.ResetMappingID() + return nil + case webhook.FieldTags: + m.ResetTags() + return nil + case webhook.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case webhook.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case webhook.FieldOwnerID: + m.ResetOwnerID() + return nil + case webhook.FieldName: + m.ResetName() + return nil + case webhook.FieldDescription: + m.ResetDescription() + return nil + case webhook.FieldDestinationURL: + m.ResetDestinationURL() + return nil + case webhook.FieldEnabled: + m.ResetEnabled() + return nil + case webhook.FieldCallback: + m.ResetCallback() + return nil + case webhook.FieldExpiresAt: + m.ResetExpiresAt() + return nil + case webhook.FieldSecret: + m.ResetSecret() + return nil + case webhook.FieldFailures: + m.ResetFailures() + return nil + case webhook.FieldLastError: + m.ResetLastError() + return nil + case webhook.FieldLastResponse: + m.ResetLastResponse() + return nil + } + return fmt.Errorf("unknown Webhook field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *WebhookMutation) AddedEdges() []string { + edges := make([]string, 0, 3) + if m.owner != nil { + edges = append(edges, webhook.EdgeOwner) + } + if m.events != nil { + edges = append(edges, webhook.EdgeEvents) + } + if m.integrations != nil { + edges = append(edges, webhook.EdgeIntegrations) + } + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *WebhookMutation) AddedIDs(name string) []ent.Value { + switch name { + case webhook.EdgeOwner: + if id := m.owner; id != nil { + return []ent.Value{*id} + } + case webhook.EdgeEvents: + ids := make([]ent.Value, 0, len(m.events)) + for id := range m.events { + ids = append(ids, id) + } + return ids + case webhook.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.integrations)) + for id := range m.integrations { + ids = append(ids, id) + } + return ids + } + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *WebhookMutation) RemovedEdges() []string { + edges := make([]string, 0, 3) + if m.removedevents != nil { + edges = append(edges, webhook.EdgeEvents) + } + if m.removedintegrations != nil { + edges = append(edges, webhook.EdgeIntegrations) + } + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *WebhookMutation) RemovedIDs(name string) []ent.Value { + switch name { + case webhook.EdgeEvents: + ids := make([]ent.Value, 0, len(m.removedevents)) + for id := range m.removedevents { + ids = append(ids, id) + } + return ids + case webhook.EdgeIntegrations: + ids := make([]ent.Value, 0, len(m.removedintegrations)) + for id := range m.removedintegrations { + ids = append(ids, id) + } + return ids + } + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *WebhookMutation) ClearedEdges() []string { + edges := make([]string, 0, 3) + if m.clearedowner { + edges = append(edges, webhook.EdgeOwner) + } + if m.clearedevents { + edges = append(edges, webhook.EdgeEvents) + } + if m.clearedintegrations { + edges = append(edges, webhook.EdgeIntegrations) + } + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *WebhookMutation) EdgeCleared(name string) bool { + switch name { + case webhook.EdgeOwner: + return m.clearedowner + case webhook.EdgeEvents: + return m.clearedevents + case webhook.EdgeIntegrations: + return m.clearedintegrations + } + 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 *WebhookMutation) ClearEdge(name string) error { + switch name { + case webhook.EdgeOwner: + m.ClearOwner() + return nil + } + return fmt.Errorf("unknown Webhook 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 *WebhookMutation) ResetEdge(name string) error { + switch name { + case webhook.EdgeOwner: + m.ResetOwner() + return nil + case webhook.EdgeEvents: + m.ResetEvents() + return nil + case webhook.EdgeIntegrations: + m.ResetIntegrations() + return nil + } + return fmt.Errorf("unknown Webhook edge %s", name) +} + +// WebhookHistoryMutation represents an operation that mutates the WebhookHistory nodes in the graph. +type WebhookHistoryMutation struct { + config + op Op + typ string + id *string + history_time *time.Time + ref *string + operation *history.OpType + created_at *time.Time + updated_at *time.Time + created_by *string + updated_by *string + mapping_id *string + tags *[]string + appendtags []string + deleted_at *time.Time + deleted_by *string + owner_id *string + name *string + description *string + destination_url *string + enabled *bool + callback *string + expires_at *time.Time + secret *[]byte + failures *int + addfailures *int + last_error *string + last_response *string + clearedFields map[string]struct{} + done bool + oldValue func(context.Context) (*WebhookHistory, error) + predicates []predicate.WebhookHistory +} + +var _ ent.Mutation = (*WebhookHistoryMutation)(nil) + +// webhookhistoryOption allows management of the mutation configuration using functional options. +type webhookhistoryOption func(*WebhookHistoryMutation) + +// newWebhookHistoryMutation creates new mutation for the WebhookHistory entity. +func newWebhookHistoryMutation(c config, op Op, opts ...webhookhistoryOption) *WebhookHistoryMutation { + m := &WebhookHistoryMutation{ + config: c, + op: op, + typ: TypeWebhookHistory, + clearedFields: make(map[string]struct{}), + } + for _, opt := range opts { + opt(m) + } + return m +} + +// withWebhookHistoryID sets the ID field of the mutation. +func withWebhookHistoryID(id string) webhookhistoryOption { + return func(m *WebhookHistoryMutation) { + var ( + err error + once sync.Once + value *WebhookHistory + ) + m.oldValue = func(ctx context.Context) (*WebhookHistory, error) { + once.Do(func() { + if m.done { + err = errors.New("querying old values post mutation is not allowed") + } else { + value, err = m.Client().WebhookHistory.Get(ctx, id) + } + }) + return value, err + } + m.id = &id + } +} + +// withWebhookHistory sets the old WebhookHistory of the mutation. +func withWebhookHistory(node *WebhookHistory) webhookhistoryOption { + return func(m *WebhookHistoryMutation) { + m.oldValue = func(context.Context) (*WebhookHistory, 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 WebhookHistoryMutation) 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 WebhookHistoryMutation) Tx() (*Tx, error) { + if _, ok := m.driver.(*txDriver); !ok { + return nil, errors.New("generated: mutation is not running in a transaction") + } + tx := &Tx{config: m.config} + tx.init() + return tx, nil +} + +// SetID sets the value of the id field. Note that this +// operation is only accepted on creation of WebhookHistory entities. +func (m *WebhookHistoryMutation) SetID(id string) { + 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 *WebhookHistoryMutation) ID() (id string, 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 *WebhookHistoryMutation) IDs(ctx context.Context) ([]string, error) { + switch { + case m.op.Is(OpUpdateOne | OpDeleteOne): + id, exists := m.ID() + if exists { + return []string{id}, nil + } + fallthrough + case m.op.Is(OpUpdate | OpDelete): + return m.Client().WebhookHistory.Query().Where(m.predicates...).IDs(ctx) + default: + return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) + } +} + +// SetHistoryTime sets the "history_time" field. +func (m *WebhookHistoryMutation) SetHistoryTime(t time.Time) { + m.history_time = &t +} + +// HistoryTime returns the value of the "history_time" field in the mutation. +func (m *WebhookHistoryMutation) HistoryTime() (r time.Time, exists bool) { + v := m.history_time + if v == nil { + return + } + return *v, true +} + +// OldHistoryTime returns the old "history_time" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldHistoryTime is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldHistoryTime requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldHistoryTime: %w", err) + } + return oldValue.HistoryTime, nil +} + +// ResetHistoryTime resets all changes to the "history_time" field. +func (m *WebhookHistoryMutation) ResetHistoryTime() { + m.history_time = nil +} + +// SetRef sets the "ref" field. +func (m *WebhookHistoryMutation) SetRef(s string) { + m.ref = &s +} + +// Ref returns the value of the "ref" field in the mutation. +func (m *WebhookHistoryMutation) Ref() (r string, exists bool) { + v := m.ref + if v == nil { + return + } + return *v, true +} + +// OldRef returns the old "ref" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldRef(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldRef is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldRef requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldRef: %w", err) + } + return oldValue.Ref, nil +} + +// ClearRef clears the value of the "ref" field. +func (m *WebhookHistoryMutation) ClearRef() { + m.ref = nil + m.clearedFields[webhookhistory.FieldRef] = struct{}{} +} + +// RefCleared returns if the "ref" field was cleared in this mutation. +func (m *WebhookHistoryMutation) RefCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldRef] + return ok +} + +// ResetRef resets all changes to the "ref" field. +func (m *WebhookHistoryMutation) ResetRef() { + m.ref = nil + delete(m.clearedFields, webhookhistory.FieldRef) +} + +// SetOperation sets the "operation" field. +func (m *WebhookHistoryMutation) SetOperation(ht history.OpType) { + m.operation = &ht +} + +// Operation returns the value of the "operation" field in the mutation. +func (m *WebhookHistoryMutation) Operation() (r history.OpType, exists bool) { + v := m.operation + if v == nil { + return + } + return *v, true +} + +// OldOperation returns the old "operation" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldOperation(ctx context.Context) (v history.OpType, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOperation is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOperation requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOperation: %w", err) + } + return oldValue.Operation, nil +} + +// ResetOperation resets all changes to the "operation" field. +func (m *WebhookHistoryMutation) ResetOperation() { + m.operation = nil +} + +// SetCreatedAt sets the "created_at" field. +func (m *WebhookHistoryMutation) SetCreatedAt(t time.Time) { + m.created_at = &t +} + +// CreatedAt returns the value of the "created_at" field in the mutation. +func (m *WebhookHistoryMutation) CreatedAt() (r time.Time, exists bool) { + v := m.created_at + if v == nil { + return + } + return *v, true +} + +// OldCreatedAt returns the old "created_at" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err) + } + return oldValue.CreatedAt, nil +} + +// ClearCreatedAt clears the value of the "created_at" field. +func (m *WebhookHistoryMutation) ClearCreatedAt() { + m.created_at = nil + m.clearedFields[webhookhistory.FieldCreatedAt] = struct{}{} +} + +// CreatedAtCleared returns if the "created_at" field was cleared in this mutation. +func (m *WebhookHistoryMutation) CreatedAtCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldCreatedAt] + return ok +} + +// ResetCreatedAt resets all changes to the "created_at" field. +func (m *WebhookHistoryMutation) ResetCreatedAt() { + m.created_at = nil + delete(m.clearedFields, webhookhistory.FieldCreatedAt) +} + +// SetUpdatedAt sets the "updated_at" field. +func (m *WebhookHistoryMutation) SetUpdatedAt(t time.Time) { + m.updated_at = &t +} + +// UpdatedAt returns the value of the "updated_at" field in the mutation. +func (m *WebhookHistoryMutation) UpdatedAt() (r time.Time, exists bool) { + v := m.updated_at + if v == nil { + return + } + return *v, true +} + +// OldUpdatedAt returns the old "updated_at" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err) + } + return oldValue.UpdatedAt, nil +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (m *WebhookHistoryMutation) ClearUpdatedAt() { + m.updated_at = nil + m.clearedFields[webhookhistory.FieldUpdatedAt] = struct{}{} +} + +// UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation. +func (m *WebhookHistoryMutation) UpdatedAtCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldUpdatedAt] + return ok +} + +// ResetUpdatedAt resets all changes to the "updated_at" field. +func (m *WebhookHistoryMutation) ResetUpdatedAt() { + m.updated_at = nil + delete(m.clearedFields, webhookhistory.FieldUpdatedAt) +} + +// SetCreatedBy sets the "created_by" field. +func (m *WebhookHistoryMutation) SetCreatedBy(s string) { + m.created_by = &s +} + +// CreatedBy returns the value of the "created_by" field in the mutation. +func (m *WebhookHistoryMutation) CreatedBy() (r string, exists bool) { + v := m.created_by + if v == nil { + return + } + return *v, true +} + +// OldCreatedBy returns the old "created_by" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldCreatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCreatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCreatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCreatedBy: %w", err) + } + return oldValue.CreatedBy, nil +} + +// ClearCreatedBy clears the value of the "created_by" field. +func (m *WebhookHistoryMutation) ClearCreatedBy() { + m.created_by = nil + m.clearedFields[webhookhistory.FieldCreatedBy] = struct{}{} +} + +// CreatedByCleared returns if the "created_by" field was cleared in this mutation. +func (m *WebhookHistoryMutation) CreatedByCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldCreatedBy] + return ok +} + +// ResetCreatedBy resets all changes to the "created_by" field. +func (m *WebhookHistoryMutation) ResetCreatedBy() { + m.created_by = nil + delete(m.clearedFields, webhookhistory.FieldCreatedBy) +} + +// SetUpdatedBy sets the "updated_by" field. +func (m *WebhookHistoryMutation) SetUpdatedBy(s string) { + m.updated_by = &s +} + +// UpdatedBy returns the value of the "updated_by" field in the mutation. +func (m *WebhookHistoryMutation) UpdatedBy() (r string, exists bool) { + v := m.updated_by + if v == nil { + return + } + return *v, true +} + +// OldUpdatedBy returns the old "updated_by" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldUpdatedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldUpdatedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldUpdatedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldUpdatedBy: %w", err) + } + return oldValue.UpdatedBy, nil +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (m *WebhookHistoryMutation) ClearUpdatedBy() { + m.updated_by = nil + m.clearedFields[webhookhistory.FieldUpdatedBy] = struct{}{} +} + +// UpdatedByCleared returns if the "updated_by" field was cleared in this mutation. +func (m *WebhookHistoryMutation) UpdatedByCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldUpdatedBy] + return ok +} + +// ResetUpdatedBy resets all changes to the "updated_by" field. +func (m *WebhookHistoryMutation) ResetUpdatedBy() { + m.updated_by = nil + delete(m.clearedFields, webhookhistory.FieldUpdatedBy) +} + +// SetMappingID sets the "mapping_id" field. +func (m *WebhookHistoryMutation) SetMappingID(s string) { + m.mapping_id = &s +} + +// MappingID returns the value of the "mapping_id" field in the mutation. +func (m *WebhookHistoryMutation) MappingID() (r string, exists bool) { + v := m.mapping_id + if v == nil { + return + } + return *v, true +} + +// OldMappingID returns the old "mapping_id" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldMappingID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldMappingID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldMappingID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldMappingID: %w", err) + } + return oldValue.MappingID, nil +} + +// ResetMappingID resets all changes to the "mapping_id" field. +func (m *WebhookHistoryMutation) ResetMappingID() { + m.mapping_id = nil +} + +// SetTags sets the "tags" field. +func (m *WebhookHistoryMutation) SetTags(s []string) { + m.tags = &s + m.appendtags = nil +} + +// Tags returns the value of the "tags" field in the mutation. +func (m *WebhookHistoryMutation) Tags() (r []string, exists bool) { + v := m.tags + if v == nil { + return + } + return *v, true +} + +// OldTags returns the old "tags" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldTags(ctx context.Context) (v []string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldTags is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldTags requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldTags: %w", err) + } + return oldValue.Tags, nil +} + +// AppendTags adds s to the "tags" field. +func (m *WebhookHistoryMutation) AppendTags(s []string) { + m.appendtags = append(m.appendtags, s...) +} + +// AppendedTags returns the list of values that were appended to the "tags" field in this mutation. +func (m *WebhookHistoryMutation) AppendedTags() ([]string, bool) { + if len(m.appendtags) == 0 { + return nil, false + } + return m.appendtags, true +} + +// ClearTags clears the value of the "tags" field. +func (m *WebhookHistoryMutation) ClearTags() { + m.tags = nil + m.appendtags = nil + m.clearedFields[webhookhistory.FieldTags] = struct{}{} +} + +// TagsCleared returns if the "tags" field was cleared in this mutation. +func (m *WebhookHistoryMutation) TagsCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldTags] + return ok +} + +// ResetTags resets all changes to the "tags" field. +func (m *WebhookHistoryMutation) ResetTags() { + m.tags = nil + m.appendtags = nil + delete(m.clearedFields, webhookhistory.FieldTags) +} + +// SetDeletedAt sets the "deleted_at" field. +func (m *WebhookHistoryMutation) SetDeletedAt(t time.Time) { + m.deleted_at = &t +} + +// DeletedAt returns the value of the "deleted_at" field in the mutation. +func (m *WebhookHistoryMutation) DeletedAt() (r time.Time, exists bool) { + v := m.deleted_at + if v == nil { + return + } + return *v, true +} + +// OldDeletedAt returns the old "deleted_at" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err) + } + return oldValue.DeletedAt, nil +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (m *WebhookHistoryMutation) ClearDeletedAt() { + m.deleted_at = nil + m.clearedFields[webhookhistory.FieldDeletedAt] = struct{}{} +} + +// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation. +func (m *WebhookHistoryMutation) DeletedAtCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldDeletedAt] + return ok +} + +// ResetDeletedAt resets all changes to the "deleted_at" field. +func (m *WebhookHistoryMutation) ResetDeletedAt() { + m.deleted_at = nil + delete(m.clearedFields, webhookhistory.FieldDeletedAt) +} + +// SetDeletedBy sets the "deleted_by" field. +func (m *WebhookHistoryMutation) SetDeletedBy(s string) { + m.deleted_by = &s +} + +// DeletedBy returns the value of the "deleted_by" field in the mutation. +func (m *WebhookHistoryMutation) DeletedBy() (r string, exists bool) { + v := m.deleted_by + if v == nil { + return + } + return *v, true +} + +// OldDeletedBy returns the old "deleted_by" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldDeletedBy(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDeletedBy is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDeletedBy requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDeletedBy: %w", err) + } + return oldValue.DeletedBy, nil +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (m *WebhookHistoryMutation) ClearDeletedBy() { + m.deleted_by = nil + m.clearedFields[webhookhistory.FieldDeletedBy] = struct{}{} +} + +// DeletedByCleared returns if the "deleted_by" field was cleared in this mutation. +func (m *WebhookHistoryMutation) DeletedByCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldDeletedBy] + return ok +} + +// ResetDeletedBy resets all changes to the "deleted_by" field. +func (m *WebhookHistoryMutation) ResetDeletedBy() { + m.deleted_by = nil + delete(m.clearedFields, webhookhistory.FieldDeletedBy) +} + +// SetOwnerID sets the "owner_id" field. +func (m *WebhookHistoryMutation) SetOwnerID(s string) { + m.owner_id = &s +} + +// OwnerID returns the value of the "owner_id" field in the mutation. +func (m *WebhookHistoryMutation) OwnerID() (r string, exists bool) { + v := m.owner_id + if v == nil { + return + } + return *v, true +} + +// OldOwnerID returns the old "owner_id" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldOwnerID(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldOwnerID is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldOwnerID requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldOwnerID: %w", err) + } + return oldValue.OwnerID, nil +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (m *WebhookHistoryMutation) ClearOwnerID() { + m.owner_id = nil + m.clearedFields[webhookhistory.FieldOwnerID] = struct{}{} +} + +// OwnerIDCleared returns if the "owner_id" field was cleared in this mutation. +func (m *WebhookHistoryMutation) OwnerIDCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldOwnerID] + return ok +} + +// ResetOwnerID resets all changes to the "owner_id" field. +func (m *WebhookHistoryMutation) ResetOwnerID() { + m.owner_id = nil + delete(m.clearedFields, webhookhistory.FieldOwnerID) +} + +// SetName sets the "name" field. +func (m *WebhookHistoryMutation) SetName(s string) { + m.name = &s +} + +// Name returns the value of the "name" field in the mutation. +func (m *WebhookHistoryMutation) Name() (r string, exists bool) { + v := m.name + if v == nil { + return + } + return *v, true +} + +// OldName returns the old "name" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldName(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldName is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldName requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldName: %w", err) + } + return oldValue.Name, nil +} + +// ResetName resets all changes to the "name" field. +func (m *WebhookHistoryMutation) ResetName() { + m.name = nil +} + +// SetDescription sets the "description" field. +func (m *WebhookHistoryMutation) SetDescription(s string) { + m.description = &s +} + +// Description returns the value of the "description" field in the mutation. +func (m *WebhookHistoryMutation) Description() (r string, exists bool) { + v := m.description + if v == nil { + return + } + return *v, true +} + +// OldDescription returns the old "description" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldDescription(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDescription is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDescription requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDescription: %w", err) + } + return oldValue.Description, nil +} + +// ClearDescription clears the value of the "description" field. +func (m *WebhookHistoryMutation) ClearDescription() { + m.description = nil + m.clearedFields[webhookhistory.FieldDescription] = struct{}{} +} + +// DescriptionCleared returns if the "description" field was cleared in this mutation. +func (m *WebhookHistoryMutation) DescriptionCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldDescription] + return ok +} + +// ResetDescription resets all changes to the "description" field. +func (m *WebhookHistoryMutation) ResetDescription() { + m.description = nil + delete(m.clearedFields, webhookhistory.FieldDescription) +} + +// SetDestinationURL sets the "destination_url" field. +func (m *WebhookHistoryMutation) SetDestinationURL(s string) { + m.destination_url = &s +} + +// DestinationURL returns the value of the "destination_url" field in the mutation. +func (m *WebhookHistoryMutation) DestinationURL() (r string, exists bool) { + v := m.destination_url + if v == nil { + return + } + return *v, true +} + +// OldDestinationURL returns the old "destination_url" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldDestinationURL(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldDestinationURL is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldDestinationURL requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldDestinationURL: %w", err) + } + return oldValue.DestinationURL, nil +} + +// ResetDestinationURL resets all changes to the "destination_url" field. +func (m *WebhookHistoryMutation) ResetDestinationURL() { + m.destination_url = nil +} + +// SetEnabled sets the "enabled" field. +func (m *WebhookHistoryMutation) SetEnabled(b bool) { + m.enabled = &b +} + +// Enabled returns the value of the "enabled" field in the mutation. +func (m *WebhookHistoryMutation) Enabled() (r bool, exists bool) { + v := m.enabled + if v == nil { + return + } + return *v, true +} + +// OldEnabled returns the old "enabled" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldEnabled(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldEnabled is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldEnabled requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldEnabled: %w", err) + } + return oldValue.Enabled, nil +} + +// ResetEnabled resets all changes to the "enabled" field. +func (m *WebhookHistoryMutation) ResetEnabled() { + m.enabled = nil +} + +// SetCallback sets the "callback" field. +func (m *WebhookHistoryMutation) SetCallback(s string) { + m.callback = &s +} + +// Callback returns the value of the "callback" field in the mutation. +func (m *WebhookHistoryMutation) Callback() (r string, exists bool) { + v := m.callback + if v == nil { + return + } + return *v, true +} + +// OldCallback returns the old "callback" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldCallback(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldCallback is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldCallback requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldCallback: %w", err) + } + return oldValue.Callback, nil +} + +// ClearCallback clears the value of the "callback" field. +func (m *WebhookHistoryMutation) ClearCallback() { + m.callback = nil + m.clearedFields[webhookhistory.FieldCallback] = struct{}{} +} + +// CallbackCleared returns if the "callback" field was cleared in this mutation. +func (m *WebhookHistoryMutation) CallbackCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldCallback] + return ok +} + +// ResetCallback resets all changes to the "callback" field. +func (m *WebhookHistoryMutation) ResetCallback() { + m.callback = nil + delete(m.clearedFields, webhookhistory.FieldCallback) +} + +// SetExpiresAt sets the "expires_at" field. +func (m *WebhookHistoryMutation) SetExpiresAt(t time.Time) { + m.expires_at = &t +} + +// ExpiresAt returns the value of the "expires_at" field in the mutation. +func (m *WebhookHistoryMutation) ExpiresAt() (r time.Time, exists bool) { + v := m.expires_at + if v == nil { + return + } + return *v, true +} + +// OldExpiresAt returns the old "expires_at" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldExpiresAt is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldExpiresAt requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldExpiresAt: %w", err) + } + return oldValue.ExpiresAt, nil +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (m *WebhookHistoryMutation) ClearExpiresAt() { + m.expires_at = nil + m.clearedFields[webhookhistory.FieldExpiresAt] = struct{}{} +} + +// ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation. +func (m *WebhookHistoryMutation) ExpiresAtCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldExpiresAt] + return ok +} + +// ResetExpiresAt resets all changes to the "expires_at" field. +func (m *WebhookHistoryMutation) ResetExpiresAt() { + m.expires_at = nil + delete(m.clearedFields, webhookhistory.FieldExpiresAt) +} + +// SetSecret sets the "secret" field. +func (m *WebhookHistoryMutation) SetSecret(b []byte) { + m.secret = &b +} + +// Secret returns the value of the "secret" field in the mutation. +func (m *WebhookHistoryMutation) Secret() (r []byte, exists bool) { + v := m.secret + if v == nil { + return + } + return *v, true +} + +// OldSecret returns the old "secret" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldSecret(ctx context.Context) (v []byte, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldSecret is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldSecret requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldSecret: %w", err) + } + return oldValue.Secret, nil +} + +// ClearSecret clears the value of the "secret" field. +func (m *WebhookHistoryMutation) ClearSecret() { + m.secret = nil + m.clearedFields[webhookhistory.FieldSecret] = struct{}{} +} + +// SecretCleared returns if the "secret" field was cleared in this mutation. +func (m *WebhookHistoryMutation) SecretCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldSecret] + return ok +} + +// ResetSecret resets all changes to the "secret" field. +func (m *WebhookHistoryMutation) ResetSecret() { + m.secret = nil + delete(m.clearedFields, webhookhistory.FieldSecret) +} + +// SetFailures sets the "failures" field. +func (m *WebhookHistoryMutation) SetFailures(i int) { + m.failures = &i + m.addfailures = nil +} + +// Failures returns the value of the "failures" field in the mutation. +func (m *WebhookHistoryMutation) Failures() (r int, exists bool) { + v := m.failures + if v == nil { + return + } + return *v, true +} + +// OldFailures returns the old "failures" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldFailures(ctx context.Context) (v int, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldFailures is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldFailures requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldFailures: %w", err) + } + return oldValue.Failures, nil +} + +// AddFailures adds i to the "failures" field. +func (m *WebhookHistoryMutation) AddFailures(i int) { + if m.addfailures != nil { + *m.addfailures += i + } else { + m.addfailures = &i + } +} + +// AddedFailures returns the value that was added to the "failures" field in this mutation. +func (m *WebhookHistoryMutation) AddedFailures() (r int, exists bool) { + v := m.addfailures + if v == nil { + return + } + return *v, true +} + +// ClearFailures clears the value of the "failures" field. +func (m *WebhookHistoryMutation) ClearFailures() { + m.failures = nil + m.addfailures = nil + m.clearedFields[webhookhistory.FieldFailures] = struct{}{} +} + +// FailuresCleared returns if the "failures" field was cleared in this mutation. +func (m *WebhookHistoryMutation) FailuresCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldFailures] + return ok +} + +// ResetFailures resets all changes to the "failures" field. +func (m *WebhookHistoryMutation) ResetFailures() { + m.failures = nil + m.addfailures = nil + delete(m.clearedFields, webhookhistory.FieldFailures) +} + +// SetLastError sets the "last_error" field. +func (m *WebhookHistoryMutation) SetLastError(s string) { + m.last_error = &s +} + +// LastError returns the value of the "last_error" field in the mutation. +func (m *WebhookHistoryMutation) LastError() (r string, exists bool) { + v := m.last_error + if v == nil { + return + } + return *v, true +} + +// OldLastError returns the old "last_error" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldLastError(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastError is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastError requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastError: %w", err) + } + return oldValue.LastError, nil +} + +// ClearLastError clears the value of the "last_error" field. +func (m *WebhookHistoryMutation) ClearLastError() { + m.last_error = nil + m.clearedFields[webhookhistory.FieldLastError] = struct{}{} +} + +// LastErrorCleared returns if the "last_error" field was cleared in this mutation. +func (m *WebhookHistoryMutation) LastErrorCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldLastError] + return ok +} + +// ResetLastError resets all changes to the "last_error" field. +func (m *WebhookHistoryMutation) ResetLastError() { + m.last_error = nil + delete(m.clearedFields, webhookhistory.FieldLastError) +} + +// SetLastResponse sets the "last_response" field. +func (m *WebhookHistoryMutation) SetLastResponse(s string) { + m.last_response = &s +} + +// LastResponse returns the value of the "last_response" field in the mutation. +func (m *WebhookHistoryMutation) LastResponse() (r string, exists bool) { + v := m.last_response + if v == nil { + return + } + return *v, true +} + +// OldLastResponse returns the old "last_response" field's value of the WebhookHistory entity. +// If the WebhookHistory 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 *WebhookHistoryMutation) OldLastResponse(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldLastResponse is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldLastResponse requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldLastResponse: %w", err) + } + return oldValue.LastResponse, nil +} + +// ClearLastResponse clears the value of the "last_response" field. +func (m *WebhookHistoryMutation) ClearLastResponse() { + m.last_response = nil + m.clearedFields[webhookhistory.FieldLastResponse] = struct{}{} +} + +// LastResponseCleared returns if the "last_response" field was cleared in this mutation. +func (m *WebhookHistoryMutation) LastResponseCleared() bool { + _, ok := m.clearedFields[webhookhistory.FieldLastResponse] + return ok +} + +// ResetLastResponse resets all changes to the "last_response" field. +func (m *WebhookHistoryMutation) ResetLastResponse() { + m.last_response = nil + delete(m.clearedFields, webhookhistory.FieldLastResponse) +} + +// Where appends a list predicates to the WebhookHistoryMutation builder. +func (m *WebhookHistoryMutation) Where(ps ...predicate.WebhookHistory) { + m.predicates = append(m.predicates, ps...) +} + +// WhereP appends storage-level predicates to the WebhookHistoryMutation builder. Using this method, +// users can use type-assertion to append predicates that do not depend on any generated package. +func (m *WebhookHistoryMutation) WhereP(ps ...func(*sql.Selector)) { + p := make([]predicate.WebhookHistory, len(ps)) + for i := range ps { + p[i] = ps[i] + } + m.Where(p...) +} + +// Op returns the operation name. +func (m *WebhookHistoryMutation) Op() Op { + return m.op +} + +// SetOp allows setting the mutation operation. +func (m *WebhookHistoryMutation) SetOp(op Op) { + m.op = op +} + +// Type returns the node type of this mutation (WebhookHistory). +func (m *WebhookHistoryMutation) 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 *WebhookHistoryMutation) Fields() []string { + fields := make([]string, 0, 22) + if m.history_time != nil { + fields = append(fields, webhookhistory.FieldHistoryTime) + } + if m.ref != nil { + fields = append(fields, webhookhistory.FieldRef) + } + if m.operation != nil { + fields = append(fields, webhookhistory.FieldOperation) + } + if m.created_at != nil { + fields = append(fields, webhookhistory.FieldCreatedAt) + } + if m.updated_at != nil { + fields = append(fields, webhookhistory.FieldUpdatedAt) + } + if m.created_by != nil { + fields = append(fields, webhookhistory.FieldCreatedBy) + } + if m.updated_by != nil { + fields = append(fields, webhookhistory.FieldUpdatedBy) + } + if m.mapping_id != nil { + fields = append(fields, webhookhistory.FieldMappingID) + } + if m.tags != nil { + fields = append(fields, webhookhistory.FieldTags) + } + if m.deleted_at != nil { + fields = append(fields, webhookhistory.FieldDeletedAt) + } + if m.deleted_by != nil { + fields = append(fields, webhookhistory.FieldDeletedBy) + } + if m.owner_id != nil { + fields = append(fields, webhookhistory.FieldOwnerID) + } + if m.name != nil { + fields = append(fields, webhookhistory.FieldName) + } + if m.description != nil { + fields = append(fields, webhookhistory.FieldDescription) + } + if m.destination_url != nil { + fields = append(fields, webhookhistory.FieldDestinationURL) + } + if m.enabled != nil { + fields = append(fields, webhookhistory.FieldEnabled) + } + if m.callback != nil { + fields = append(fields, webhookhistory.FieldCallback) + } + if m.expires_at != nil { + fields = append(fields, webhookhistory.FieldExpiresAt) + } + if m.secret != nil { + fields = append(fields, webhookhistory.FieldSecret) + } + if m.failures != nil { + fields = append(fields, webhookhistory.FieldFailures) + } + if m.last_error != nil { + fields = append(fields, webhookhistory.FieldLastError) + } + if m.last_response != nil { + fields = append(fields, webhookhistory.FieldLastResponse) + } + 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 *WebhookHistoryMutation) Field(name string) (ent.Value, bool) { + switch name { + case webhookhistory.FieldHistoryTime: + return m.HistoryTime() + case webhookhistory.FieldRef: + return m.Ref() + case webhookhistory.FieldOperation: + return m.Operation() + case webhookhistory.FieldCreatedAt: + return m.CreatedAt() + case webhookhistory.FieldUpdatedAt: + return m.UpdatedAt() + case webhookhistory.FieldCreatedBy: + return m.CreatedBy() + case webhookhistory.FieldUpdatedBy: + return m.UpdatedBy() + case webhookhistory.FieldMappingID: + return m.MappingID() + case webhookhistory.FieldTags: + return m.Tags() + case webhookhistory.FieldDeletedAt: + return m.DeletedAt() + case webhookhistory.FieldDeletedBy: + return m.DeletedBy() + case webhookhistory.FieldOwnerID: + return m.OwnerID() + case webhookhistory.FieldName: + return m.Name() + case webhookhistory.FieldDescription: + return m.Description() + case webhookhistory.FieldDestinationURL: + return m.DestinationURL() + case webhookhistory.FieldEnabled: + return m.Enabled() + case webhookhistory.FieldCallback: + return m.Callback() + case webhookhistory.FieldExpiresAt: + return m.ExpiresAt() + case webhookhistory.FieldSecret: + return m.Secret() + case webhookhistory.FieldFailures: + return m.Failures() + case webhookhistory.FieldLastError: + return m.LastError() + case webhookhistory.FieldLastResponse: + return m.LastResponse() + } + 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 *WebhookHistoryMutation) OldField(ctx context.Context, name string) (ent.Value, error) { + switch name { + case webhookhistory.FieldHistoryTime: + return m.OldHistoryTime(ctx) + case webhookhistory.FieldRef: + return m.OldRef(ctx) + case webhookhistory.FieldOperation: + return m.OldOperation(ctx) + case webhookhistory.FieldCreatedAt: + return m.OldCreatedAt(ctx) + case webhookhistory.FieldUpdatedAt: + return m.OldUpdatedAt(ctx) + case webhookhistory.FieldCreatedBy: + return m.OldCreatedBy(ctx) + case webhookhistory.FieldUpdatedBy: + return m.OldUpdatedBy(ctx) + case webhookhistory.FieldMappingID: + return m.OldMappingID(ctx) + case webhookhistory.FieldTags: + return m.OldTags(ctx) + case webhookhistory.FieldDeletedAt: + return m.OldDeletedAt(ctx) + case webhookhistory.FieldDeletedBy: + return m.OldDeletedBy(ctx) + case webhookhistory.FieldOwnerID: + return m.OldOwnerID(ctx) + case webhookhistory.FieldName: + return m.OldName(ctx) + case webhookhistory.FieldDescription: + return m.OldDescription(ctx) + case webhookhistory.FieldDestinationURL: + return m.OldDestinationURL(ctx) + case webhookhistory.FieldEnabled: + return m.OldEnabled(ctx) + case webhookhistory.FieldCallback: + return m.OldCallback(ctx) + case webhookhistory.FieldExpiresAt: + return m.OldExpiresAt(ctx) + case webhookhistory.FieldSecret: + return m.OldSecret(ctx) + case webhookhistory.FieldFailures: + return m.OldFailures(ctx) + case webhookhistory.FieldLastError: + return m.OldLastError(ctx) + case webhookhistory.FieldLastResponse: + return m.OldLastResponse(ctx) + } + return nil, fmt.Errorf("unknown WebhookHistory 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 *WebhookHistoryMutation) SetField(name string, value ent.Value) error { + switch name { + case webhookhistory.FieldHistoryTime: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetHistoryTime(v) + return nil + case webhookhistory.FieldRef: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetRef(v) + return nil + case webhookhistory.FieldOperation: + v, ok := value.(history.OpType) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOperation(v) + return nil + case webhookhistory.FieldCreatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedAt(v) + return nil + case webhookhistory.FieldUpdatedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedAt(v) + return nil + case webhookhistory.FieldCreatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCreatedBy(v) + return nil + case webhookhistory.FieldUpdatedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetUpdatedBy(v) + return nil + case webhookhistory.FieldMappingID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetMappingID(v) + return nil + case webhookhistory.FieldTags: + v, ok := value.([]string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetTags(v) + return nil + case webhookhistory.FieldDeletedAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedAt(v) + return nil + case webhookhistory.FieldDeletedBy: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDeletedBy(v) + return nil + case webhookhistory.FieldOwnerID: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetOwnerID(v) + return nil + case webhookhistory.FieldName: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetName(v) + return nil + case webhookhistory.FieldDescription: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDescription(v) + return nil + case webhookhistory.FieldDestinationURL: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetDestinationURL(v) + return nil + case webhookhistory.FieldEnabled: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetEnabled(v) + return nil + case webhookhistory.FieldCallback: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetCallback(v) + return nil + case webhookhistory.FieldExpiresAt: + v, ok := value.(time.Time) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetExpiresAt(v) + return nil + case webhookhistory.FieldSecret: + v, ok := value.([]byte) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetSecret(v) + return nil + case webhookhistory.FieldFailures: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetFailures(v) + return nil + case webhookhistory.FieldLastError: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastError(v) + return nil + case webhookhistory.FieldLastResponse: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetLastResponse(v) + return nil + } + return fmt.Errorf("unknown WebhookHistory field %s", name) +} + +// AddedFields returns all numeric fields that were incremented/decremented during +// this mutation. +func (m *WebhookHistoryMutation) AddedFields() []string { + var fields []string + if m.addfailures != nil { + fields = append(fields, webhookhistory.FieldFailures) + } + return fields +} + +// 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 *WebhookHistoryMutation) AddedField(name string) (ent.Value, bool) { + switch name { + case webhookhistory.FieldFailures: + return m.AddedFailures() + } + 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 *WebhookHistoryMutation) AddField(name string, value ent.Value) error { + switch name { + case webhookhistory.FieldFailures: + v, ok := value.(int) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddFailures(v) + return nil + } + return fmt.Errorf("unknown WebhookHistory numeric field %s", name) +} + +// ClearedFields returns all nullable fields that were cleared during this +// mutation. +func (m *WebhookHistoryMutation) ClearedFields() []string { + var fields []string + if m.FieldCleared(webhookhistory.FieldRef) { + fields = append(fields, webhookhistory.FieldRef) + } + if m.FieldCleared(webhookhistory.FieldCreatedAt) { + fields = append(fields, webhookhistory.FieldCreatedAt) + } + if m.FieldCleared(webhookhistory.FieldUpdatedAt) { + fields = append(fields, webhookhistory.FieldUpdatedAt) + } + if m.FieldCleared(webhookhistory.FieldCreatedBy) { + fields = append(fields, webhookhistory.FieldCreatedBy) + } + if m.FieldCleared(webhookhistory.FieldUpdatedBy) { + fields = append(fields, webhookhistory.FieldUpdatedBy) + } + if m.FieldCleared(webhookhistory.FieldTags) { + fields = append(fields, webhookhistory.FieldTags) + } + if m.FieldCleared(webhookhistory.FieldDeletedAt) { + fields = append(fields, webhookhistory.FieldDeletedAt) + } + if m.FieldCleared(webhookhistory.FieldDeletedBy) { + fields = append(fields, webhookhistory.FieldDeletedBy) + } + if m.FieldCleared(webhookhistory.FieldOwnerID) { + fields = append(fields, webhookhistory.FieldOwnerID) + } + if m.FieldCleared(webhookhistory.FieldDescription) { + fields = append(fields, webhookhistory.FieldDescription) + } + if m.FieldCleared(webhookhistory.FieldCallback) { + fields = append(fields, webhookhistory.FieldCallback) + } + if m.FieldCleared(webhookhistory.FieldExpiresAt) { + fields = append(fields, webhookhistory.FieldExpiresAt) + } + if m.FieldCleared(webhookhistory.FieldSecret) { + fields = append(fields, webhookhistory.FieldSecret) + } + if m.FieldCleared(webhookhistory.FieldFailures) { + fields = append(fields, webhookhistory.FieldFailures) + } + if m.FieldCleared(webhookhistory.FieldLastError) { + fields = append(fields, webhookhistory.FieldLastError) + } + if m.FieldCleared(webhookhistory.FieldLastResponse) { + fields = append(fields, webhookhistory.FieldLastResponse) + } + return fields +} + +// FieldCleared returns a boolean indicating if a field with the given name was +// cleared in this mutation. +func (m *WebhookHistoryMutation) 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 *WebhookHistoryMutation) ClearField(name string) error { + switch name { + case webhookhistory.FieldRef: + m.ClearRef() + return nil + case webhookhistory.FieldCreatedAt: + m.ClearCreatedAt() + return nil + case webhookhistory.FieldUpdatedAt: + m.ClearUpdatedAt() + return nil + case webhookhistory.FieldCreatedBy: + m.ClearCreatedBy() + return nil + case webhookhistory.FieldUpdatedBy: + m.ClearUpdatedBy() + return nil + case webhookhistory.FieldTags: + m.ClearTags() + return nil + case webhookhistory.FieldDeletedAt: + m.ClearDeletedAt() + return nil + case webhookhistory.FieldDeletedBy: + m.ClearDeletedBy() + return nil + case webhookhistory.FieldOwnerID: + m.ClearOwnerID() + return nil + case webhookhistory.FieldDescription: + m.ClearDescription() + return nil + case webhookhistory.FieldCallback: + m.ClearCallback() + return nil + case webhookhistory.FieldExpiresAt: + m.ClearExpiresAt() + return nil + case webhookhistory.FieldSecret: + m.ClearSecret() + return nil + case webhookhistory.FieldFailures: + m.ClearFailures() + return nil + case webhookhistory.FieldLastError: + m.ClearLastError() + return nil + case webhookhistory.FieldLastResponse: + m.ClearLastResponse() + return nil + } + return fmt.Errorf("unknown WebhookHistory 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 *WebhookHistoryMutation) ResetField(name string) error { + switch name { + case webhookhistory.FieldHistoryTime: + m.ResetHistoryTime() + return nil + case webhookhistory.FieldRef: + m.ResetRef() + return nil + case webhookhistory.FieldOperation: + m.ResetOperation() + return nil + case webhookhistory.FieldCreatedAt: + m.ResetCreatedAt() + return nil + case webhookhistory.FieldUpdatedAt: + m.ResetUpdatedAt() + return nil + case webhookhistory.FieldCreatedBy: + m.ResetCreatedBy() + return nil + case webhookhistory.FieldUpdatedBy: + m.ResetUpdatedBy() + return nil + case webhookhistory.FieldMappingID: + m.ResetMappingID() + return nil + case webhookhistory.FieldTags: + m.ResetTags() + return nil + case webhookhistory.FieldDeletedAt: + m.ResetDeletedAt() + return nil + case webhookhistory.FieldDeletedBy: + m.ResetDeletedBy() + return nil + case webhookhistory.FieldOwnerID: + m.ResetOwnerID() + return nil + case webhookhistory.FieldName: + m.ResetName() + return nil + case webhookhistory.FieldDescription: + m.ResetDescription() + return nil + case webhookhistory.FieldDestinationURL: + m.ResetDestinationURL() + return nil + case webhookhistory.FieldEnabled: + m.ResetEnabled() + return nil + case webhookhistory.FieldCallback: + m.ResetCallback() + return nil + case webhookhistory.FieldExpiresAt: + m.ResetExpiresAt() + return nil + case webhookhistory.FieldSecret: + m.ResetSecret() + return nil + case webhookhistory.FieldFailures: + m.ResetFailures() + return nil + case webhookhistory.FieldLastError: + m.ResetLastError() + return nil + case webhookhistory.FieldLastResponse: + m.ResetLastResponse() + return nil + } + return fmt.Errorf("unknown WebhookHistory field %s", name) +} + +// AddedEdges returns all edge names that were set/added in this mutation. +func (m *WebhookHistoryMutation) AddedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// AddedIDs returns all IDs (to other nodes) that were added for the given edge +// name in this mutation. +func (m *WebhookHistoryMutation) AddedIDs(name string) []ent.Value { + return nil +} + +// RemovedEdges returns all edge names that were removed in this mutation. +func (m *WebhookHistoryMutation) RemovedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with +// the given name in this mutation. +func (m *WebhookHistoryMutation) RemovedIDs(name string) []ent.Value { + return nil +} + +// ClearedEdges returns all edge names that were cleared in this mutation. +func (m *WebhookHistoryMutation) ClearedEdges() []string { + edges := make([]string, 0, 0) + return edges +} + +// EdgeCleared returns a boolean which indicates if the edge with the given name +// was cleared in this mutation. +func (m *WebhookHistoryMutation) EdgeCleared(name string) bool { + 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 *WebhookHistoryMutation) ClearEdge(name string) error { + return fmt.Errorf("unknown WebhookHistory 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 *WebhookHistoryMutation) ResetEdge(name string) error { + return fmt.Errorf("unknown WebhookHistory edge %s", name) +} diff --git a/internal/ent/generated/note.go b/internal/ent/generated/note.go new file mode 100644 index 0000000..1dacf43 --- /dev/null +++ b/internal/ent/generated/note.go @@ -0,0 +1,268 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// Note is the model entity for the Note schema. +type Note struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the text of the note + Text string `json:"text,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the NoteQuery when eager-loading is set. + Edges NoteEdges `json:"edges"` + entity_notes *string + selectValues sql.SelectValues +} + +// NoteEdges holds the relations/edges for other nodes in the graph. +type NoteEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Entity holds the value of the entity edge. + Entity *Entity `json:"entity,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e NoteEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// EntityOrErr returns the Entity value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e NoteEdges) EntityOrErr() (*Entity, error) { + if e.Entity != nil { + return e.Entity, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: entity.Label} + } + return nil, &NotLoadedError{edge: "entity"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Note) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case note.FieldTags: + values[i] = new([]byte) + case note.FieldID, note.FieldCreatedBy, note.FieldUpdatedBy, note.FieldMappingID, note.FieldDeletedBy, note.FieldOwnerID, note.FieldText: + values[i] = new(sql.NullString) + case note.FieldCreatedAt, note.FieldUpdatedAt, note.FieldDeletedAt: + values[i] = new(sql.NullTime) + case note.ForeignKeys[0]: // entity_notes + values[i] = new(sql.NullString) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Note fields. +func (n *Note) 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 note.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + n.ID = value.String + } + case note.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + n.CreatedAt = value.Time + } + case note.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + n.UpdatedAt = value.Time + } + case note.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + n.CreatedBy = value.String + } + case note.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + n.UpdatedBy = value.String + } + case note.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + n.MappingID = value.String + } + case note.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + n.DeletedAt = value.Time + } + case note.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + n.DeletedBy = value.String + } + case note.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &n.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case note.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + n.OwnerID = value.String + } + case note.FieldText: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field text", values[i]) + } else if value.Valid { + n.Text = value.String + } + case note.ForeignKeys[0]: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field entity_notes", values[i]) + } else if value.Valid { + n.entity_notes = new(string) + *n.entity_notes = value.String + } + default: + n.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Note. +// This includes values selected through modifiers, order, etc. +func (n *Note) Value(name string) (ent.Value, error) { + return n.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Note entity. +func (n *Note) QueryOwner() *OrganizationQuery { + return NewNoteClient(n.config).QueryOwner(n) +} + +// QueryEntity queries the "entity" edge of the Note entity. +func (n *Note) QueryEntity() *EntityQuery { + return NewNoteClient(n.config).QueryEntity(n) +} + +// Update returns a builder for updating this Note. +// Note that you need to call Note.Unwrap() before calling this method if this Note +// was returned from a transaction, and the transaction was committed or rolled back. +func (n *Note) Update() *NoteUpdateOne { + return NewNoteClient(n.config).UpdateOne(n) +} + +// Unwrap unwraps the Note 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 (n *Note) Unwrap() *Note { + _tx, ok := n.config.driver.(*txDriver) + if !ok { + panic("generated: Note is not a transactional entity") + } + n.config.driver = _tx.drv + return n +} + +// String implements the fmt.Stringer. +func (n *Note) String() string { + var builder strings.Builder + builder.WriteString("Note(") + builder.WriteString(fmt.Sprintf("id=%v, ", n.ID)) + builder.WriteString("created_at=") + builder.WriteString(n.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(n.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(n.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(n.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(n.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(n.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(n.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", n.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(n.OwnerID) + builder.WriteString(", ") + builder.WriteString("text=") + builder.WriteString(n.Text) + builder.WriteByte(')') + return builder.String() +} + +// Notes is a parsable slice of Note. +type Notes []*Note diff --git a/internal/ent/generated/note/note.go b/internal/ent/generated/note/note.go new file mode 100644 index 0000000..65043e4 --- /dev/null +++ b/internal/ent/generated/note/note.go @@ -0,0 +1,202 @@ +// Code generated by ent, DO NOT EDIT. + +package note + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the note type in the database. + Label = "note" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldText holds the string denoting the text field in the database. + FieldText = "text" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeEntity holds the string denoting the entity edge name in mutations. + EdgeEntity = "entity" + // Table holds the table name of the note in the database. + Table = "notes" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "notes" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // EntityTable is the table that holds the entity relation/edge. + EntityTable = "notes" + // EntityInverseTable is the table name for the Entity entity. + // It exists in this package in order to avoid circular dependency with the "entity" package. + EntityInverseTable = "entities" + // EntityColumn is the table column denoting the entity relation/edge. + EntityColumn = "entity_notes" +) + +// Columns holds all SQL columns for note fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldText, +} + +// ForeignKeys holds the SQL foreign-keys that are owned by the "notes" +// table and are not defined as standalone fields in the schema. +var ForeignKeys = []string{ + "entity_notes", +} + +// 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 +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // TextValidator is a validator for the "text" field. It is called by the builders before save. + TextValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Note queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByText orders the results by the text field. +func ByText(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldText, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEntityField orders the results by entity field. +func ByEntityField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntityStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newEntityStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntityInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, EntityTable, EntityColumn), + ) +} diff --git a/internal/ent/generated/note/where.go b/internal/ent/generated/note/where.go new file mode 100644 index 0000000..99a04e3 --- /dev/null +++ b/internal/ent/generated/note/where.go @@ -0,0 +1,776 @@ +// Code generated by ent, DO NOT EDIT. + +package note + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Note { + return predicate.Note(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Note { + return predicate.Note(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Note { + return predicate.Note(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Note { + return predicate.Note(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Note { + return predicate.Note(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldOwnerID, v)) +} + +// Text applies equality check predicate on the "text" field. It's identical to TextEQ. +func Text(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldText, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Note { + return predicate.Note(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Note { + return predicate.Note(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Note { + return predicate.Note(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Note { + return predicate.Note(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Note { + return predicate.Note(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Note { + return predicate.Note(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Note { + return predicate.Note(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Note { + return predicate.Note(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Note { + return predicate.Note(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Note { + return predicate.Note(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Note { + return predicate.Note(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Note { + return predicate.Note(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Note { + return predicate.Note(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Note { + return predicate.Note(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Note { + return predicate.Note(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Note { + return predicate.Note(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Note { + return predicate.Note(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Note { + return predicate.Note(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Note { + return predicate.Note(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Note { + return predicate.Note(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Note { + return predicate.Note(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Note { + return predicate.Note(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Note { + return predicate.Note(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Note { + return predicate.Note(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Note { + return predicate.Note(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Note { + return predicate.Note(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Note { + return predicate.Note(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Note { + return predicate.Note(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Note { + return predicate.Note(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Note { + return predicate.Note(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Note { + return predicate.Note(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Note { + return predicate.Note(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Note { + return predicate.Note(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Note { + return predicate.Note(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Note { + return predicate.Note(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Note { + return predicate.Note(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Note { + return predicate.Note(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Note { + return predicate.Note(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Note { + return predicate.Note(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Note { + return predicate.Note(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Note { + return predicate.Note(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Note { + return predicate.Note(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Note { + return predicate.Note(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Note { + return predicate.Note(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Note { + return predicate.Note(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Note { + return predicate.Note(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TextEQ applies the EQ predicate on the "text" field. +func TextEQ(v string) predicate.Note { + return predicate.Note(sql.FieldEQ(FieldText, v)) +} + +// TextNEQ applies the NEQ predicate on the "text" field. +func TextNEQ(v string) predicate.Note { + return predicate.Note(sql.FieldNEQ(FieldText, v)) +} + +// TextIn applies the In predicate on the "text" field. +func TextIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldIn(FieldText, vs...)) +} + +// TextNotIn applies the NotIn predicate on the "text" field. +func TextNotIn(vs ...string) predicate.Note { + return predicate.Note(sql.FieldNotIn(FieldText, vs...)) +} + +// TextGT applies the GT predicate on the "text" field. +func TextGT(v string) predicate.Note { + return predicate.Note(sql.FieldGT(FieldText, v)) +} + +// TextGTE applies the GTE predicate on the "text" field. +func TextGTE(v string) predicate.Note { + return predicate.Note(sql.FieldGTE(FieldText, v)) +} + +// TextLT applies the LT predicate on the "text" field. +func TextLT(v string) predicate.Note { + return predicate.Note(sql.FieldLT(FieldText, v)) +} + +// TextLTE applies the LTE predicate on the "text" field. +func TextLTE(v string) predicate.Note { + return predicate.Note(sql.FieldLTE(FieldText, v)) +} + +// TextContains applies the Contains predicate on the "text" field. +func TextContains(v string) predicate.Note { + return predicate.Note(sql.FieldContains(FieldText, v)) +} + +// TextHasPrefix applies the HasPrefix predicate on the "text" field. +func TextHasPrefix(v string) predicate.Note { + return predicate.Note(sql.FieldHasPrefix(FieldText, v)) +} + +// TextHasSuffix applies the HasSuffix predicate on the "text" field. +func TextHasSuffix(v string) predicate.Note { + return predicate.Note(sql.FieldHasSuffix(FieldText, v)) +} + +// TextEqualFold applies the EqualFold predicate on the "text" field. +func TextEqualFold(v string) predicate.Note { + return predicate.Note(sql.FieldEqualFold(FieldText, v)) +} + +// TextContainsFold applies the ContainsFold predicate on the "text" field. +func TextContainsFold(v string) predicate.Note { + return predicate.Note(sql.FieldContainsFold(FieldText, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Note { + return predicate.Note(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Note + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Note { + return predicate.Note(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Note + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntity applies the HasEdge predicate on the "entity" edge. +func HasEntity() predicate.Note { + return predicate.Note(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, EntityTable, EntityColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Note + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntityWith applies the HasEdge predicate on the "entity" edge with a given conditions (other predicates). +func HasEntityWith(preds ...predicate.Entity) predicate.Note { + return predicate.Note(func(s *sql.Selector) { + step := newEntityStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Note + 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.Note) predicate.Note { + return predicate.Note(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Note) predicate.Note { + return predicate.Note(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Note) predicate.Note { + return predicate.Note(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/note_create.go b/internal/ent/generated/note_create.go new file mode 100644 index 0000000..78632cc --- /dev/null +++ b/internal/ent/generated/note_create.go @@ -0,0 +1,470 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// NoteCreate is the builder for creating a Note entity. +type NoteCreate struct { + config + mutation *NoteMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (nc *NoteCreate) SetCreatedAt(t time.Time) *NoteCreate { + nc.mutation.SetCreatedAt(t) + return nc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (nc *NoteCreate) SetNillableCreatedAt(t *time.Time) *NoteCreate { + if t != nil { + nc.SetCreatedAt(*t) + } + return nc +} + +// SetUpdatedAt sets the "updated_at" field. +func (nc *NoteCreate) SetUpdatedAt(t time.Time) *NoteCreate { + nc.mutation.SetUpdatedAt(t) + return nc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (nc *NoteCreate) SetNillableUpdatedAt(t *time.Time) *NoteCreate { + if t != nil { + nc.SetUpdatedAt(*t) + } + return nc +} + +// SetCreatedBy sets the "created_by" field. +func (nc *NoteCreate) SetCreatedBy(s string) *NoteCreate { + nc.mutation.SetCreatedBy(s) + return nc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (nc *NoteCreate) SetNillableCreatedBy(s *string) *NoteCreate { + if s != nil { + nc.SetCreatedBy(*s) + } + return nc +} + +// SetUpdatedBy sets the "updated_by" field. +func (nc *NoteCreate) SetUpdatedBy(s string) *NoteCreate { + nc.mutation.SetUpdatedBy(s) + return nc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (nc *NoteCreate) SetNillableUpdatedBy(s *string) *NoteCreate { + if s != nil { + nc.SetUpdatedBy(*s) + } + return nc +} + +// SetMappingID sets the "mapping_id" field. +func (nc *NoteCreate) SetMappingID(s string) *NoteCreate { + nc.mutation.SetMappingID(s) + return nc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (nc *NoteCreate) SetNillableMappingID(s *string) *NoteCreate { + if s != nil { + nc.SetMappingID(*s) + } + return nc +} + +// SetDeletedAt sets the "deleted_at" field. +func (nc *NoteCreate) SetDeletedAt(t time.Time) *NoteCreate { + nc.mutation.SetDeletedAt(t) + return nc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (nc *NoteCreate) SetNillableDeletedAt(t *time.Time) *NoteCreate { + if t != nil { + nc.SetDeletedAt(*t) + } + return nc +} + +// SetDeletedBy sets the "deleted_by" field. +func (nc *NoteCreate) SetDeletedBy(s string) *NoteCreate { + nc.mutation.SetDeletedBy(s) + return nc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (nc *NoteCreate) SetNillableDeletedBy(s *string) *NoteCreate { + if s != nil { + nc.SetDeletedBy(*s) + } + return nc +} + +// SetTags sets the "tags" field. +func (nc *NoteCreate) SetTags(s []string) *NoteCreate { + nc.mutation.SetTags(s) + return nc +} + +// SetOwnerID sets the "owner_id" field. +func (nc *NoteCreate) SetOwnerID(s string) *NoteCreate { + nc.mutation.SetOwnerID(s) + return nc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (nc *NoteCreate) SetNillableOwnerID(s *string) *NoteCreate { + if s != nil { + nc.SetOwnerID(*s) + } + return nc +} + +// SetText sets the "text" field. +func (nc *NoteCreate) SetText(s string) *NoteCreate { + nc.mutation.SetText(s) + return nc +} + +// SetID sets the "id" field. +func (nc *NoteCreate) SetID(s string) *NoteCreate { + nc.mutation.SetID(s) + return nc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (nc *NoteCreate) SetNillableID(s *string) *NoteCreate { + if s != nil { + nc.SetID(*s) + } + return nc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (nc *NoteCreate) SetOwner(o *Organization) *NoteCreate { + return nc.SetOwnerID(o.ID) +} + +// SetEntityID sets the "entity" edge to the Entity entity by ID. +func (nc *NoteCreate) SetEntityID(id string) *NoteCreate { + nc.mutation.SetEntityID(id) + return nc +} + +// SetNillableEntityID sets the "entity" edge to the Entity entity by ID if the given value is not nil. +func (nc *NoteCreate) SetNillableEntityID(id *string) *NoteCreate { + if id != nil { + nc = nc.SetEntityID(*id) + } + return nc +} + +// SetEntity sets the "entity" edge to the Entity entity. +func (nc *NoteCreate) SetEntity(e *Entity) *NoteCreate { + return nc.SetEntityID(e.ID) +} + +// Mutation returns the NoteMutation object of the builder. +func (nc *NoteCreate) Mutation() *NoteMutation { + return nc.mutation +} + +// Save creates the Note in the database. +func (nc *NoteCreate) Save(ctx context.Context) (*Note, error) { + if err := nc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, nc.sqlSave, nc.mutation, nc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (nc *NoteCreate) SaveX(ctx context.Context) *Note { + v, err := nc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (nc *NoteCreate) Exec(ctx context.Context) error { + _, err := nc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (nc *NoteCreate) ExecX(ctx context.Context) { + if err := nc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (nc *NoteCreate) defaults() error { + if _, ok := nc.mutation.CreatedAt(); !ok { + if note.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized note.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := note.DefaultCreatedAt() + nc.mutation.SetCreatedAt(v) + } + if _, ok := nc.mutation.UpdatedAt(); !ok { + if note.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized note.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := note.DefaultUpdatedAt() + nc.mutation.SetUpdatedAt(v) + } + if _, ok := nc.mutation.MappingID(); !ok { + if note.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized note.DefaultMappingID (forgotten import generated/runtime?)") + } + v := note.DefaultMappingID() + nc.mutation.SetMappingID(v) + } + if _, ok := nc.mutation.Tags(); !ok { + v := note.DefaultTags + nc.mutation.SetTags(v) + } + if _, ok := nc.mutation.ID(); !ok { + if note.DefaultID == nil { + return fmt.Errorf("generated: uninitialized note.DefaultID (forgotten import generated/runtime?)") + } + v := note.DefaultID() + nc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (nc *NoteCreate) check() error { + if _, ok := nc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Note.mapping_id"`)} + } + if v, ok := nc.mutation.OwnerID(); ok { + if err := note.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Note.owner_id": %w`, err)} + } + } + if _, ok := nc.mutation.Text(); !ok { + return &ValidationError{Name: "text", err: errors.New(`generated: missing required field "Note.text"`)} + } + if v, ok := nc.mutation.Text(); ok { + if err := note.TextValidator(v); err != nil { + return &ValidationError{Name: "text", err: fmt.Errorf(`generated: validator failed for field "Note.text": %w`, err)} + } + } + return nil +} + +func (nc *NoteCreate) sqlSave(ctx context.Context) (*Note, error) { + if err := nc.check(); err != nil { + return nil, err + } + _node, _spec := nc.createSpec() + if err := sqlgraph.CreateNode(ctx, nc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Note.ID type: %T", _spec.ID.Value) + } + } + nc.mutation.id = &_node.ID + nc.mutation.done = true + return _node, nil +} + +func (nc *NoteCreate) createSpec() (*Note, *sqlgraph.CreateSpec) { + var ( + _node = &Note{config: nc.config} + _spec = sqlgraph.NewCreateSpec(note.Table, sqlgraph.NewFieldSpec(note.FieldID, field.TypeString)) + ) + _spec.Schema = nc.schemaConfig.Note + if id, ok := nc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := nc.mutation.CreatedAt(); ok { + _spec.SetField(note.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := nc.mutation.UpdatedAt(); ok { + _spec.SetField(note.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := nc.mutation.CreatedBy(); ok { + _spec.SetField(note.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := nc.mutation.UpdatedBy(); ok { + _spec.SetField(note.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := nc.mutation.MappingID(); ok { + _spec.SetField(note.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := nc.mutation.DeletedAt(); ok { + _spec.SetField(note.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := nc.mutation.DeletedBy(); ok { + _spec.SetField(note.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := nc.mutation.Tags(); ok { + _spec.SetField(note.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := nc.mutation.Text(); ok { + _spec.SetField(note.FieldText, field.TypeString, value) + _node.Text = value + } + if nodes := nc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.OwnerTable, + Columns: []string{note.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = nc.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := nc.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.EntityTable, + Columns: []string{note.EntityColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = nc.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.entity_notes = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// NoteCreateBulk is the builder for creating many Note entities in bulk. +type NoteCreateBulk struct { + config + err error + builders []*NoteCreate +} + +// Save creates the Note entities in the database. +func (ncb *NoteCreateBulk) Save(ctx context.Context) ([]*Note, error) { + if ncb.err != nil { + return nil, ncb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ncb.builders)) + nodes := make([]*Note, len(ncb.builders)) + mutators := make([]Mutator, len(ncb.builders)) + for i := range ncb.builders { + func(i int, root context.Context) { + builder := ncb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*NoteMutation) + 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, ncb.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, ncb.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, ncb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ncb *NoteCreateBulk) SaveX(ctx context.Context) []*Note { + v, err := ncb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ncb *NoteCreateBulk) Exec(ctx context.Context) error { + _, err := ncb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ncb *NoteCreateBulk) ExecX(ctx context.Context) { + if err := ncb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/note_delete.go b/internal/ent/generated/note_delete.go new file mode 100644 index 0000000..cb5ca1c --- /dev/null +++ b/internal/ent/generated/note_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/note" +) + +// NoteDelete is the builder for deleting a Note entity. +type NoteDelete struct { + config + hooks []Hook + mutation *NoteMutation +} + +// Where appends a list predicates to the NoteDelete builder. +func (nd *NoteDelete) Where(ps ...predicate.Note) *NoteDelete { + nd.mutation.Where(ps...) + return nd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (nd *NoteDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, nd.sqlExec, nd.mutation, nd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (nd *NoteDelete) ExecX(ctx context.Context) int { + n, err := nd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (nd *NoteDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(note.Table, sqlgraph.NewFieldSpec(note.FieldID, field.TypeString)) + _spec.Node.Schema = nd.schemaConfig.Note + ctx = internal.NewSchemaConfigContext(ctx, nd.schemaConfig) + if ps := nd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, nd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + nd.mutation.done = true + return affected, err +} + +// NoteDeleteOne is the builder for deleting a single Note entity. +type NoteDeleteOne struct { + nd *NoteDelete +} + +// Where appends a list predicates to the NoteDelete builder. +func (ndo *NoteDeleteOne) Where(ps ...predicate.Note) *NoteDeleteOne { + ndo.nd.mutation.Where(ps...) + return ndo +} + +// Exec executes the deletion query. +func (ndo *NoteDeleteOne) Exec(ctx context.Context) error { + n, err := ndo.nd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{note.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ndo *NoteDeleteOne) ExecX(ctx context.Context) { + if err := ndo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/note_query.go b/internal/ent/generated/note_query.go new file mode 100644 index 0000000..692af3f --- /dev/null +++ b/internal/ent/generated/note_query.go @@ -0,0 +1,724 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// NoteQuery is the builder for querying Note entities. +type NoteQuery struct { + config + ctx *QueryContext + order []note.OrderOption + inters []Interceptor + predicates []predicate.Note + withOwner *OrganizationQuery + withEntity *EntityQuery + withFKs bool + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Note) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the NoteQuery builder. +func (nq *NoteQuery) Where(ps ...predicate.Note) *NoteQuery { + nq.predicates = append(nq.predicates, ps...) + return nq +} + +// Limit the number of records to be returned by this query. +func (nq *NoteQuery) Limit(limit int) *NoteQuery { + nq.ctx.Limit = &limit + return nq +} + +// Offset to start from. +func (nq *NoteQuery) Offset(offset int) *NoteQuery { + nq.ctx.Offset = &offset + return nq +} + +// 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 (nq *NoteQuery) Unique(unique bool) *NoteQuery { + nq.ctx.Unique = &unique + return nq +} + +// Order specifies how the records should be ordered. +func (nq *NoteQuery) Order(o ...note.OrderOption) *NoteQuery { + nq.order = append(nq.order, o...) + return nq +} + +// QueryOwner chains the current query on the "owner" edge. +func (nq *NoteQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: nq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := nq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := nq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(note.Table, note.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, note.OwnerTable, note.OwnerColumn), + ) + schemaConfig := nq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Note + fromU = sqlgraph.SetNeighbors(nq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntity chains the current query on the "entity" edge. +func (nq *NoteQuery) QueryEntity() *EntityQuery { + query := (&EntityClient{config: nq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := nq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := nq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(note.Table, note.FieldID, selector), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, note.EntityTable, note.EntityColumn), + ) + schemaConfig := nq.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Note + fromU = sqlgraph.SetNeighbors(nq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Note entity from the query. +// Returns a *NotFoundError when no Note was found. +func (nq *NoteQuery) First(ctx context.Context) (*Note, error) { + nodes, err := nq.Limit(1).All(setContextOp(ctx, nq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{note.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (nq *NoteQuery) FirstX(ctx context.Context) *Note { + node, err := nq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Note ID from the query. +// Returns a *NotFoundError when no Note ID was found. +func (nq *NoteQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = nq.Limit(1).IDs(setContextOp(ctx, nq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{note.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (nq *NoteQuery) FirstIDX(ctx context.Context) string { + id, err := nq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Note entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Note entity is found. +// Returns a *NotFoundError when no Note entities are found. +func (nq *NoteQuery) Only(ctx context.Context) (*Note, error) { + nodes, err := nq.Limit(2).All(setContextOp(ctx, nq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{note.Label} + default: + return nil, &NotSingularError{note.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (nq *NoteQuery) OnlyX(ctx context.Context) *Note { + node, err := nq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Note ID in the query. +// Returns a *NotSingularError when more than one Note ID is found. +// Returns a *NotFoundError when no entities are found. +func (nq *NoteQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = nq.Limit(2).IDs(setContextOp(ctx, nq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{note.Label} + default: + err = &NotSingularError{note.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (nq *NoteQuery) OnlyIDX(ctx context.Context) string { + id, err := nq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Notes. +func (nq *NoteQuery) All(ctx context.Context) ([]*Note, error) { + ctx = setContextOp(ctx, nq.ctx, ent.OpQueryAll) + if err := nq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Note, *NoteQuery]() + return withInterceptors[[]*Note](ctx, nq, qr, nq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (nq *NoteQuery) AllX(ctx context.Context) []*Note { + nodes, err := nq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Note IDs. +func (nq *NoteQuery) IDs(ctx context.Context) (ids []string, err error) { + if nq.ctx.Unique == nil && nq.path != nil { + nq.Unique(true) + } + ctx = setContextOp(ctx, nq.ctx, ent.OpQueryIDs) + if err = nq.Select(note.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (nq *NoteQuery) IDsX(ctx context.Context) []string { + ids, err := nq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (nq *NoteQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, nq.ctx, ent.OpQueryCount) + if err := nq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, nq, querierCount[*NoteQuery](), nq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (nq *NoteQuery) CountX(ctx context.Context) int { + count, err := nq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (nq *NoteQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, nq.ctx, ent.OpQueryExist) + switch _, err := nq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (nq *NoteQuery) ExistX(ctx context.Context) bool { + exist, err := nq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the NoteQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (nq *NoteQuery) Clone() *NoteQuery { + if nq == nil { + return nil + } + return &NoteQuery{ + config: nq.config, + ctx: nq.ctx.Clone(), + order: append([]note.OrderOption{}, nq.order...), + inters: append([]Interceptor{}, nq.inters...), + predicates: append([]predicate.Note{}, nq.predicates...), + withOwner: nq.withOwner.Clone(), + withEntity: nq.withEntity.Clone(), + // clone intermediate query. + sql: nq.sql.Clone(), + path: nq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (nq *NoteQuery) WithOwner(opts ...func(*OrganizationQuery)) *NoteQuery { + query := (&OrganizationClient{config: nq.config}).Query() + for _, opt := range opts { + opt(query) + } + nq.withOwner = query + return nq +} + +// WithEntity tells the query-builder to eager-load the nodes that are connected to +// the "entity" edge. The optional arguments are used to configure the query builder of the edge. +func (nq *NoteQuery) WithEntity(opts ...func(*EntityQuery)) *NoteQuery { + query := (&EntityClient{config: nq.config}).Query() + for _, opt := range opts { + opt(query) + } + nq.withEntity = query + return nq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Note.Query(). +// GroupBy(note.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (nq *NoteQuery) GroupBy(field string, fields ...string) *NoteGroupBy { + nq.ctx.Fields = append([]string{field}, fields...) + grbuild := &NoteGroupBy{build: nq} + grbuild.flds = &nq.ctx.Fields + grbuild.label = note.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Note.Query(). +// Select(note.FieldCreatedAt). +// Scan(ctx, &v) +func (nq *NoteQuery) Select(fields ...string) *NoteSelect { + nq.ctx.Fields = append(nq.ctx.Fields, fields...) + sbuild := &NoteSelect{NoteQuery: nq} + sbuild.label = note.Label + sbuild.flds, sbuild.scan = &nq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a NoteSelect configured with the given aggregations. +func (nq *NoteQuery) Aggregate(fns ...AggregateFunc) *NoteSelect { + return nq.Select().Aggregate(fns...) +} + +func (nq *NoteQuery) prepareQuery(ctx context.Context) error { + for _, inter := range nq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, nq); err != nil { + return err + } + } + } + for _, f := range nq.ctx.Fields { + if !note.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if nq.path != nil { + prev, err := nq.path(ctx) + if err != nil { + return err + } + nq.sql = prev + } + if note.Policy == nil { + return errors.New("generated: uninitialized note.Policy (forgotten import generated/runtime?)") + } + if err := note.Policy.EvalQuery(ctx, nq); err != nil { + return err + } + return nil +} + +func (nq *NoteQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Note, error) { + var ( + nodes = []*Note{} + withFKs = nq.withFKs + _spec = nq.querySpec() + loadedTypes = [2]bool{ + nq.withOwner != nil, + nq.withEntity != nil, + } + ) + if nq.withEntity != nil { + withFKs = true + } + if withFKs { + _spec.Node.Columns = append(_spec.Node.Columns, note.ForeignKeys...) + } + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Note).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Note{config: nq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = nq.schemaConfig.Note + ctx = internal.NewSchemaConfigContext(ctx, nq.schemaConfig) + if len(nq.modifiers) > 0 { + _spec.Modifiers = nq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, nq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := nq.withOwner; query != nil { + if err := nq.loadOwner(ctx, query, nodes, nil, + func(n *Note, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := nq.withEntity; query != nil { + if err := nq.loadEntity(ctx, query, nodes, nil, + func(n *Note, e *Entity) { n.Edges.Entity = e }); err != nil { + return nil, err + } + } + for i := range nq.loadTotal { + if err := nq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (nq *NoteQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Note, init func(*Note), assign func(*Note, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Note) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (nq *NoteQuery) loadEntity(ctx context.Context, query *EntityQuery, nodes []*Note, init func(*Note), assign func(*Note, *Entity)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Note) + for i := range nodes { + if nodes[i].entity_notes == nil { + continue + } + fk := *nodes[i].entity_notes + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(entity.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 "entity_notes" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (nq *NoteQuery) sqlCount(ctx context.Context) (int, error) { + _spec := nq.querySpec() + _spec.Node.Schema = nq.schemaConfig.Note + ctx = internal.NewSchemaConfigContext(ctx, nq.schemaConfig) + if len(nq.modifiers) > 0 { + _spec.Modifiers = nq.modifiers + } + _spec.Node.Columns = nq.ctx.Fields + if len(nq.ctx.Fields) > 0 { + _spec.Unique = nq.ctx.Unique != nil && *nq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, nq.driver, _spec) +} + +func (nq *NoteQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(note.Table, note.Columns, sqlgraph.NewFieldSpec(note.FieldID, field.TypeString)) + _spec.From = nq.sql + if unique := nq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if nq.path != nil { + _spec.Unique = true + } + if fields := nq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, note.FieldID) + for i := range fields { + if fields[i] != note.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if nq.withOwner != nil { + _spec.Node.AddColumnOnce(note.FieldOwnerID) + } + } + if ps := nq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := nq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := nq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := nq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (nq *NoteQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(nq.driver.Dialect()) + t1 := builder.Table(note.Table) + columns := nq.ctx.Fields + if len(columns) == 0 { + columns = note.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if nq.sql != nil { + selector = nq.sql + selector.Select(selector.Columns(columns...)...) + } + if nq.ctx.Unique != nil && *nq.ctx.Unique { + selector.Distinct() + } + t1.Schema(nq.schemaConfig.Note) + ctx = internal.NewSchemaConfigContext(ctx, nq.schemaConfig) + selector.WithContext(ctx) + for _, p := range nq.predicates { + p(selector) + } + for _, p := range nq.order { + p(selector) + } + if offset := nq.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 := nq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// NoteGroupBy is the group-by builder for Note entities. +type NoteGroupBy struct { + selector + build *NoteQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ngb *NoteGroupBy) Aggregate(fns ...AggregateFunc) *NoteGroupBy { + ngb.fns = append(ngb.fns, fns...) + return ngb +} + +// Scan applies the selector query and scans the result into the given value. +func (ngb *NoteGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ngb.build.ctx, ent.OpQueryGroupBy) + if err := ngb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*NoteQuery, *NoteGroupBy](ctx, ngb.build, ngb, ngb.build.inters, v) +} + +func (ngb *NoteGroupBy) sqlScan(ctx context.Context, root *NoteQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ngb.fns)) + for _, fn := range ngb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ngb.flds)+len(ngb.fns)) + for _, f := range *ngb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ngb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ngb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// NoteSelect is the builder for selecting fields of Note entities. +type NoteSelect struct { + *NoteQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ns *NoteSelect) Aggregate(fns ...AggregateFunc) *NoteSelect { + ns.fns = append(ns.fns, fns...) + return ns +} + +// Scan applies the selector query and scans the result into the given value. +func (ns *NoteSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ns.ctx, ent.OpQuerySelect) + if err := ns.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*NoteQuery, *NoteSelect](ctx, ns.NoteQuery, ns, ns.inters, v) +} + +func (ns *NoteSelect) sqlScan(ctx context.Context, root *NoteQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ns.fns)) + for _, fn := range ns.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ns.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 := ns.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/note_update.go b/internal/ent/generated/note_update.go new file mode 100644 index 0000000..9d8d86a --- /dev/null +++ b/internal/ent/generated/note_update.go @@ -0,0 +1,783 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// NoteUpdate is the builder for updating Note entities. +type NoteUpdate struct { + config + hooks []Hook + mutation *NoteMutation +} + +// Where appends a list predicates to the NoteUpdate builder. +func (nu *NoteUpdate) Where(ps ...predicate.Note) *NoteUpdate { + nu.mutation.Where(ps...) + return nu +} + +// SetUpdatedAt sets the "updated_at" field. +func (nu *NoteUpdate) SetUpdatedAt(t time.Time) *NoteUpdate { + nu.mutation.SetUpdatedAt(t) + return nu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (nu *NoteUpdate) ClearUpdatedAt() *NoteUpdate { + nu.mutation.ClearUpdatedAt() + return nu +} + +// SetUpdatedBy sets the "updated_by" field. +func (nu *NoteUpdate) SetUpdatedBy(s string) *NoteUpdate { + nu.mutation.SetUpdatedBy(s) + return nu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (nu *NoteUpdate) SetNillableUpdatedBy(s *string) *NoteUpdate { + if s != nil { + nu.SetUpdatedBy(*s) + } + return nu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (nu *NoteUpdate) ClearUpdatedBy() *NoteUpdate { + nu.mutation.ClearUpdatedBy() + return nu +} + +// SetDeletedAt sets the "deleted_at" field. +func (nu *NoteUpdate) SetDeletedAt(t time.Time) *NoteUpdate { + nu.mutation.SetDeletedAt(t) + return nu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (nu *NoteUpdate) SetNillableDeletedAt(t *time.Time) *NoteUpdate { + if t != nil { + nu.SetDeletedAt(*t) + } + return nu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (nu *NoteUpdate) ClearDeletedAt() *NoteUpdate { + nu.mutation.ClearDeletedAt() + return nu +} + +// SetDeletedBy sets the "deleted_by" field. +func (nu *NoteUpdate) SetDeletedBy(s string) *NoteUpdate { + nu.mutation.SetDeletedBy(s) + return nu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (nu *NoteUpdate) SetNillableDeletedBy(s *string) *NoteUpdate { + if s != nil { + nu.SetDeletedBy(*s) + } + return nu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (nu *NoteUpdate) ClearDeletedBy() *NoteUpdate { + nu.mutation.ClearDeletedBy() + return nu +} + +// SetTags sets the "tags" field. +func (nu *NoteUpdate) SetTags(s []string) *NoteUpdate { + nu.mutation.SetTags(s) + return nu +} + +// AppendTags appends s to the "tags" field. +func (nu *NoteUpdate) AppendTags(s []string) *NoteUpdate { + nu.mutation.AppendTags(s) + return nu +} + +// ClearTags clears the value of the "tags" field. +func (nu *NoteUpdate) ClearTags() *NoteUpdate { + nu.mutation.ClearTags() + return nu +} + +// SetOwnerID sets the "owner_id" field. +func (nu *NoteUpdate) SetOwnerID(s string) *NoteUpdate { + nu.mutation.SetOwnerID(s) + return nu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (nu *NoteUpdate) SetNillableOwnerID(s *string) *NoteUpdate { + if s != nil { + nu.SetOwnerID(*s) + } + return nu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (nu *NoteUpdate) ClearOwnerID() *NoteUpdate { + nu.mutation.ClearOwnerID() + return nu +} + +// SetText sets the "text" field. +func (nu *NoteUpdate) SetText(s string) *NoteUpdate { + nu.mutation.SetText(s) + return nu +} + +// SetNillableText sets the "text" field if the given value is not nil. +func (nu *NoteUpdate) SetNillableText(s *string) *NoteUpdate { + if s != nil { + nu.SetText(*s) + } + return nu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (nu *NoteUpdate) SetOwner(o *Organization) *NoteUpdate { + return nu.SetOwnerID(o.ID) +} + +// SetEntityID sets the "entity" edge to the Entity entity by ID. +func (nu *NoteUpdate) SetEntityID(id string) *NoteUpdate { + nu.mutation.SetEntityID(id) + return nu +} + +// SetNillableEntityID sets the "entity" edge to the Entity entity by ID if the given value is not nil. +func (nu *NoteUpdate) SetNillableEntityID(id *string) *NoteUpdate { + if id != nil { + nu = nu.SetEntityID(*id) + } + return nu +} + +// SetEntity sets the "entity" edge to the Entity entity. +func (nu *NoteUpdate) SetEntity(e *Entity) *NoteUpdate { + return nu.SetEntityID(e.ID) +} + +// Mutation returns the NoteMutation object of the builder. +func (nu *NoteUpdate) Mutation() *NoteMutation { + return nu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (nu *NoteUpdate) ClearOwner() *NoteUpdate { + nu.mutation.ClearOwner() + return nu +} + +// ClearEntity clears the "entity" edge to the Entity entity. +func (nu *NoteUpdate) ClearEntity() *NoteUpdate { + nu.mutation.ClearEntity() + return nu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (nu *NoteUpdate) Save(ctx context.Context) (int, error) { + if err := nu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, nu.sqlSave, nu.mutation, nu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (nu *NoteUpdate) SaveX(ctx context.Context) int { + affected, err := nu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (nu *NoteUpdate) Exec(ctx context.Context) error { + _, err := nu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (nu *NoteUpdate) ExecX(ctx context.Context) { + if err := nu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (nu *NoteUpdate) defaults() error { + if _, ok := nu.mutation.UpdatedAt(); !ok && !nu.mutation.UpdatedAtCleared() { + if note.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized note.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := note.UpdateDefaultUpdatedAt() + nu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (nu *NoteUpdate) check() error { + if v, ok := nu.mutation.OwnerID(); ok { + if err := note.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Note.owner_id": %w`, err)} + } + } + if v, ok := nu.mutation.Text(); ok { + if err := note.TextValidator(v); err != nil { + return &ValidationError{Name: "text", err: fmt.Errorf(`generated: validator failed for field "Note.text": %w`, err)} + } + } + return nil +} + +func (nu *NoteUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := nu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(note.Table, note.Columns, sqlgraph.NewFieldSpec(note.FieldID, field.TypeString)) + if ps := nu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if nu.mutation.CreatedAtCleared() { + _spec.ClearField(note.FieldCreatedAt, field.TypeTime) + } + if value, ok := nu.mutation.UpdatedAt(); ok { + _spec.SetField(note.FieldUpdatedAt, field.TypeTime, value) + } + if nu.mutation.UpdatedAtCleared() { + _spec.ClearField(note.FieldUpdatedAt, field.TypeTime) + } + if nu.mutation.CreatedByCleared() { + _spec.ClearField(note.FieldCreatedBy, field.TypeString) + } + if value, ok := nu.mutation.UpdatedBy(); ok { + _spec.SetField(note.FieldUpdatedBy, field.TypeString, value) + } + if nu.mutation.UpdatedByCleared() { + _spec.ClearField(note.FieldUpdatedBy, field.TypeString) + } + if value, ok := nu.mutation.DeletedAt(); ok { + _spec.SetField(note.FieldDeletedAt, field.TypeTime, value) + } + if nu.mutation.DeletedAtCleared() { + _spec.ClearField(note.FieldDeletedAt, field.TypeTime) + } + if value, ok := nu.mutation.DeletedBy(); ok { + _spec.SetField(note.FieldDeletedBy, field.TypeString, value) + } + if nu.mutation.DeletedByCleared() { + _spec.ClearField(note.FieldDeletedBy, field.TypeString) + } + if value, ok := nu.mutation.Tags(); ok { + _spec.SetField(note.FieldTags, field.TypeJSON, value) + } + if value, ok := nu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, note.FieldTags, value) + }) + } + if nu.mutation.TagsCleared() { + _spec.ClearField(note.FieldTags, field.TypeJSON) + } + if value, ok := nu.mutation.Text(); ok { + _spec.SetField(note.FieldText, field.TypeString, value) + } + if nu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.OwnerTable, + Columns: []string{note.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = nu.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := nu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.OwnerTable, + Columns: []string{note.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = nu.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if nu.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.EntityTable, + Columns: []string{note.EntityColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = nu.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := nu.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.EntityTable, + Columns: []string{note.EntityColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = nu.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = nu.schemaConfig.Note + ctx = internal.NewSchemaConfigContext(ctx, nu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, nu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{note.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + nu.mutation.done = true + return n, nil +} + +// NoteUpdateOne is the builder for updating a single Note entity. +type NoteUpdateOne struct { + config + fields []string + hooks []Hook + mutation *NoteMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (nuo *NoteUpdateOne) SetUpdatedAt(t time.Time) *NoteUpdateOne { + nuo.mutation.SetUpdatedAt(t) + return nuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (nuo *NoteUpdateOne) ClearUpdatedAt() *NoteUpdateOne { + nuo.mutation.ClearUpdatedAt() + return nuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (nuo *NoteUpdateOne) SetUpdatedBy(s string) *NoteUpdateOne { + nuo.mutation.SetUpdatedBy(s) + return nuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (nuo *NoteUpdateOne) SetNillableUpdatedBy(s *string) *NoteUpdateOne { + if s != nil { + nuo.SetUpdatedBy(*s) + } + return nuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (nuo *NoteUpdateOne) ClearUpdatedBy() *NoteUpdateOne { + nuo.mutation.ClearUpdatedBy() + return nuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (nuo *NoteUpdateOne) SetDeletedAt(t time.Time) *NoteUpdateOne { + nuo.mutation.SetDeletedAt(t) + return nuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (nuo *NoteUpdateOne) SetNillableDeletedAt(t *time.Time) *NoteUpdateOne { + if t != nil { + nuo.SetDeletedAt(*t) + } + return nuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (nuo *NoteUpdateOne) ClearDeletedAt() *NoteUpdateOne { + nuo.mutation.ClearDeletedAt() + return nuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (nuo *NoteUpdateOne) SetDeletedBy(s string) *NoteUpdateOne { + nuo.mutation.SetDeletedBy(s) + return nuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (nuo *NoteUpdateOne) SetNillableDeletedBy(s *string) *NoteUpdateOne { + if s != nil { + nuo.SetDeletedBy(*s) + } + return nuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (nuo *NoteUpdateOne) ClearDeletedBy() *NoteUpdateOne { + nuo.mutation.ClearDeletedBy() + return nuo +} + +// SetTags sets the "tags" field. +func (nuo *NoteUpdateOne) SetTags(s []string) *NoteUpdateOne { + nuo.mutation.SetTags(s) + return nuo +} + +// AppendTags appends s to the "tags" field. +func (nuo *NoteUpdateOne) AppendTags(s []string) *NoteUpdateOne { + nuo.mutation.AppendTags(s) + return nuo +} + +// ClearTags clears the value of the "tags" field. +func (nuo *NoteUpdateOne) ClearTags() *NoteUpdateOne { + nuo.mutation.ClearTags() + return nuo +} + +// SetOwnerID sets the "owner_id" field. +func (nuo *NoteUpdateOne) SetOwnerID(s string) *NoteUpdateOne { + nuo.mutation.SetOwnerID(s) + return nuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (nuo *NoteUpdateOne) SetNillableOwnerID(s *string) *NoteUpdateOne { + if s != nil { + nuo.SetOwnerID(*s) + } + return nuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (nuo *NoteUpdateOne) ClearOwnerID() *NoteUpdateOne { + nuo.mutation.ClearOwnerID() + return nuo +} + +// SetText sets the "text" field. +func (nuo *NoteUpdateOne) SetText(s string) *NoteUpdateOne { + nuo.mutation.SetText(s) + return nuo +} + +// SetNillableText sets the "text" field if the given value is not nil. +func (nuo *NoteUpdateOne) SetNillableText(s *string) *NoteUpdateOne { + if s != nil { + nuo.SetText(*s) + } + return nuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (nuo *NoteUpdateOne) SetOwner(o *Organization) *NoteUpdateOne { + return nuo.SetOwnerID(o.ID) +} + +// SetEntityID sets the "entity" edge to the Entity entity by ID. +func (nuo *NoteUpdateOne) SetEntityID(id string) *NoteUpdateOne { + nuo.mutation.SetEntityID(id) + return nuo +} + +// SetNillableEntityID sets the "entity" edge to the Entity entity by ID if the given value is not nil. +func (nuo *NoteUpdateOne) SetNillableEntityID(id *string) *NoteUpdateOne { + if id != nil { + nuo = nuo.SetEntityID(*id) + } + return nuo +} + +// SetEntity sets the "entity" edge to the Entity entity. +func (nuo *NoteUpdateOne) SetEntity(e *Entity) *NoteUpdateOne { + return nuo.SetEntityID(e.ID) +} + +// Mutation returns the NoteMutation object of the builder. +func (nuo *NoteUpdateOne) Mutation() *NoteMutation { + return nuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (nuo *NoteUpdateOne) ClearOwner() *NoteUpdateOne { + nuo.mutation.ClearOwner() + return nuo +} + +// ClearEntity clears the "entity" edge to the Entity entity. +func (nuo *NoteUpdateOne) ClearEntity() *NoteUpdateOne { + nuo.mutation.ClearEntity() + return nuo +} + +// Where appends a list predicates to the NoteUpdate builder. +func (nuo *NoteUpdateOne) Where(ps ...predicate.Note) *NoteUpdateOne { + nuo.mutation.Where(ps...) + return nuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (nuo *NoteUpdateOne) Select(field string, fields ...string) *NoteUpdateOne { + nuo.fields = append([]string{field}, fields...) + return nuo +} + +// Save executes the query and returns the updated Note entity. +func (nuo *NoteUpdateOne) Save(ctx context.Context) (*Note, error) { + if err := nuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, nuo.sqlSave, nuo.mutation, nuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (nuo *NoteUpdateOne) SaveX(ctx context.Context) *Note { + node, err := nuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (nuo *NoteUpdateOne) Exec(ctx context.Context) error { + _, err := nuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (nuo *NoteUpdateOne) ExecX(ctx context.Context) { + if err := nuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (nuo *NoteUpdateOne) defaults() error { + if _, ok := nuo.mutation.UpdatedAt(); !ok && !nuo.mutation.UpdatedAtCleared() { + if note.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized note.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := note.UpdateDefaultUpdatedAt() + nuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (nuo *NoteUpdateOne) check() error { + if v, ok := nuo.mutation.OwnerID(); ok { + if err := note.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Note.owner_id": %w`, err)} + } + } + if v, ok := nuo.mutation.Text(); ok { + if err := note.TextValidator(v); err != nil { + return &ValidationError{Name: "text", err: fmt.Errorf(`generated: validator failed for field "Note.text": %w`, err)} + } + } + return nil +} + +func (nuo *NoteUpdateOne) sqlSave(ctx context.Context) (_node *Note, err error) { + if err := nuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(note.Table, note.Columns, sqlgraph.NewFieldSpec(note.FieldID, field.TypeString)) + id, ok := nuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Note.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := nuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, note.FieldID) + for _, f := range fields { + if !note.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != note.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := nuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if nuo.mutation.CreatedAtCleared() { + _spec.ClearField(note.FieldCreatedAt, field.TypeTime) + } + if value, ok := nuo.mutation.UpdatedAt(); ok { + _spec.SetField(note.FieldUpdatedAt, field.TypeTime, value) + } + if nuo.mutation.UpdatedAtCleared() { + _spec.ClearField(note.FieldUpdatedAt, field.TypeTime) + } + if nuo.mutation.CreatedByCleared() { + _spec.ClearField(note.FieldCreatedBy, field.TypeString) + } + if value, ok := nuo.mutation.UpdatedBy(); ok { + _spec.SetField(note.FieldUpdatedBy, field.TypeString, value) + } + if nuo.mutation.UpdatedByCleared() { + _spec.ClearField(note.FieldUpdatedBy, field.TypeString) + } + if value, ok := nuo.mutation.DeletedAt(); ok { + _spec.SetField(note.FieldDeletedAt, field.TypeTime, value) + } + if nuo.mutation.DeletedAtCleared() { + _spec.ClearField(note.FieldDeletedAt, field.TypeTime) + } + if value, ok := nuo.mutation.DeletedBy(); ok { + _spec.SetField(note.FieldDeletedBy, field.TypeString, value) + } + if nuo.mutation.DeletedByCleared() { + _spec.ClearField(note.FieldDeletedBy, field.TypeString) + } + if value, ok := nuo.mutation.Tags(); ok { + _spec.SetField(note.FieldTags, field.TypeJSON, value) + } + if value, ok := nuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, note.FieldTags, value) + }) + } + if nuo.mutation.TagsCleared() { + _spec.ClearField(note.FieldTags, field.TypeJSON) + } + if value, ok := nuo.mutation.Text(); ok { + _spec.SetField(note.FieldText, field.TypeString, value) + } + if nuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.OwnerTable, + Columns: []string{note.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = nuo.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := nuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.OwnerTable, + Columns: []string{note.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = nuo.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if nuo.mutation.EntityCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.EntityTable, + Columns: []string{note.EntityColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = nuo.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := nuo.mutation.EntityIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: note.EntityTable, + Columns: []string{note.EntityColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = nuo.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = nuo.schemaConfig.Note + ctx = internal.NewSchemaConfigContext(ctx, nuo.schemaConfig) + _node = &Note{config: nuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, nuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{note.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + nuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/notehistory.go b/internal/ent/generated/notehistory.go new file mode 100644 index 0000000..654e43a --- /dev/null +++ b/internal/ent/generated/notehistory.go @@ -0,0 +1,244 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/entx/history" +) + +// NoteHistory is the model entity for the NoteHistory schema. +type NoteHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the text of the note + Text string `json:"text,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*NoteHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case notehistory.FieldTags: + values[i] = new([]byte) + case notehistory.FieldOperation: + values[i] = new(history.OpType) + case notehistory.FieldID, notehistory.FieldRef, notehistory.FieldCreatedBy, notehistory.FieldUpdatedBy, notehistory.FieldMappingID, notehistory.FieldDeletedBy, notehistory.FieldOwnerID, notehistory.FieldText: + values[i] = new(sql.NullString) + case notehistory.FieldHistoryTime, notehistory.FieldCreatedAt, notehistory.FieldUpdatedAt, notehistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the NoteHistory fields. +func (nh *NoteHistory) 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 notehistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + nh.ID = value.String + } + case notehistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + nh.HistoryTime = value.Time + } + case notehistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + nh.Ref = value.String + } + case notehistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + nh.Operation = *value + } + case notehistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + nh.CreatedAt = value.Time + } + case notehistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + nh.UpdatedAt = value.Time + } + case notehistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + nh.CreatedBy = value.String + } + case notehistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + nh.UpdatedBy = value.String + } + case notehistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + nh.MappingID = value.String + } + case notehistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + nh.DeletedAt = value.Time + } + case notehistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + nh.DeletedBy = value.String + } + case notehistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &nh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case notehistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + nh.OwnerID = value.String + } + case notehistory.FieldText: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field text", values[i]) + } else if value.Valid { + nh.Text = value.String + } + default: + nh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the NoteHistory. +// This includes values selected through modifiers, order, etc. +func (nh *NoteHistory) Value(name string) (ent.Value, error) { + return nh.selectValues.Get(name) +} + +// Update returns a builder for updating this NoteHistory. +// Note that you need to call NoteHistory.Unwrap() before calling this method if this NoteHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (nh *NoteHistory) Update() *NoteHistoryUpdateOne { + return NewNoteHistoryClient(nh.config).UpdateOne(nh) +} + +// Unwrap unwraps the NoteHistory 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 (nh *NoteHistory) Unwrap() *NoteHistory { + _tx, ok := nh.config.driver.(*txDriver) + if !ok { + panic("generated: NoteHistory is not a transactional entity") + } + nh.config.driver = _tx.drv + return nh +} + +// String implements the fmt.Stringer. +func (nh *NoteHistory) String() string { + var builder strings.Builder + builder.WriteString("NoteHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", nh.ID)) + builder.WriteString("history_time=") + builder.WriteString(nh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(nh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", nh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(nh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(nh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(nh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(nh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(nh.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(nh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(nh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", nh.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(nh.OwnerID) + builder.WriteString(", ") + builder.WriteString("text=") + builder.WriteString(nh.Text) + builder.WriteByte(')') + return builder.String() +} + +// NoteHistories is a parsable slice of NoteHistory. +type NoteHistories []*NoteHistory diff --git a/internal/ent/generated/notehistory/notehistory.go b/internal/ent/generated/notehistory/notehistory.go new file mode 100644 index 0000000..17a65fb --- /dev/null +++ b/internal/ent/generated/notehistory/notehistory.go @@ -0,0 +1,186 @@ +// Code generated by ent, DO NOT EDIT. + +package notehistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the notehistory type in the database. + Label = "note_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldText holds the string denoting the text field in the database. + FieldText = "text" + // Table holds the table name of the notehistory in the database. + Table = "note_history" +) + +// Columns holds all SQL columns for notehistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldText, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("notehistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the NoteHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByText orders the results by the text field. +func ByText(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldText, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/notehistory/where.go b/internal/ent/generated/notehistory/where.go new file mode 100644 index 0000000..eb3dbda --- /dev/null +++ b/internal/ent/generated/notehistory/where.go @@ -0,0 +1,861 @@ +// Code generated by ent, DO NOT EDIT. + +package notehistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Text applies equality check predicate on the "text" field. It's identical to TextEQ. +func Text(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldText, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TextEQ applies the EQ predicate on the "text" field. +func TextEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEQ(FieldText, v)) +} + +// TextNEQ applies the NEQ predicate on the "text" field. +func TextNEQ(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNEQ(FieldText, v)) +} + +// TextIn applies the In predicate on the "text" field. +func TextIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldIn(FieldText, vs...)) +} + +// TextNotIn applies the NotIn predicate on the "text" field. +func TextNotIn(vs ...string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldNotIn(FieldText, vs...)) +} + +// TextGT applies the GT predicate on the "text" field. +func TextGT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGT(FieldText, v)) +} + +// TextGTE applies the GTE predicate on the "text" field. +func TextGTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldGTE(FieldText, v)) +} + +// TextLT applies the LT predicate on the "text" field. +func TextLT(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLT(FieldText, v)) +} + +// TextLTE applies the LTE predicate on the "text" field. +func TextLTE(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldLTE(FieldText, v)) +} + +// TextContains applies the Contains predicate on the "text" field. +func TextContains(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContains(FieldText, v)) +} + +// TextHasPrefix applies the HasPrefix predicate on the "text" field. +func TextHasPrefix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasPrefix(FieldText, v)) +} + +// TextHasSuffix applies the HasSuffix predicate on the "text" field. +func TextHasSuffix(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldHasSuffix(FieldText, v)) +} + +// TextEqualFold applies the EqualFold predicate on the "text" field. +func TextEqualFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldEqualFold(FieldText, v)) +} + +// TextContainsFold applies the ContainsFold predicate on the "text" field. +func TextContainsFold(v string) predicate.NoteHistory { + return predicate.NoteHistory(sql.FieldContainsFold(FieldText, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.NoteHistory) predicate.NoteHistory { + return predicate.NoteHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.NoteHistory) predicate.NoteHistory { + return predicate.NoteHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.NoteHistory) predicate.NoteHistory { + return predicate.NoteHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/notehistory_create.go b/internal/ent/generated/notehistory_create.go new file mode 100644 index 0000000..1b7be48 --- /dev/null +++ b/internal/ent/generated/notehistory_create.go @@ -0,0 +1,467 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/entx/history" +) + +// NoteHistoryCreate is the builder for creating a NoteHistory entity. +type NoteHistoryCreate struct { + config + mutation *NoteHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (nhc *NoteHistoryCreate) SetHistoryTime(t time.Time) *NoteHistoryCreate { + nhc.mutation.SetHistoryTime(t) + return nhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableHistoryTime(t *time.Time) *NoteHistoryCreate { + if t != nil { + nhc.SetHistoryTime(*t) + } + return nhc +} + +// SetRef sets the "ref" field. +func (nhc *NoteHistoryCreate) SetRef(s string) *NoteHistoryCreate { + nhc.mutation.SetRef(s) + return nhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableRef(s *string) *NoteHistoryCreate { + if s != nil { + nhc.SetRef(*s) + } + return nhc +} + +// SetOperation sets the "operation" field. +func (nhc *NoteHistoryCreate) SetOperation(ht history.OpType) *NoteHistoryCreate { + nhc.mutation.SetOperation(ht) + return nhc +} + +// SetCreatedAt sets the "created_at" field. +func (nhc *NoteHistoryCreate) SetCreatedAt(t time.Time) *NoteHistoryCreate { + nhc.mutation.SetCreatedAt(t) + return nhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableCreatedAt(t *time.Time) *NoteHistoryCreate { + if t != nil { + nhc.SetCreatedAt(*t) + } + return nhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (nhc *NoteHistoryCreate) SetUpdatedAt(t time.Time) *NoteHistoryCreate { + nhc.mutation.SetUpdatedAt(t) + return nhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableUpdatedAt(t *time.Time) *NoteHistoryCreate { + if t != nil { + nhc.SetUpdatedAt(*t) + } + return nhc +} + +// SetCreatedBy sets the "created_by" field. +func (nhc *NoteHistoryCreate) SetCreatedBy(s string) *NoteHistoryCreate { + nhc.mutation.SetCreatedBy(s) + return nhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableCreatedBy(s *string) *NoteHistoryCreate { + if s != nil { + nhc.SetCreatedBy(*s) + } + return nhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (nhc *NoteHistoryCreate) SetUpdatedBy(s string) *NoteHistoryCreate { + nhc.mutation.SetUpdatedBy(s) + return nhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableUpdatedBy(s *string) *NoteHistoryCreate { + if s != nil { + nhc.SetUpdatedBy(*s) + } + return nhc +} + +// SetMappingID sets the "mapping_id" field. +func (nhc *NoteHistoryCreate) SetMappingID(s string) *NoteHistoryCreate { + nhc.mutation.SetMappingID(s) + return nhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableMappingID(s *string) *NoteHistoryCreate { + if s != nil { + nhc.SetMappingID(*s) + } + return nhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (nhc *NoteHistoryCreate) SetDeletedAt(t time.Time) *NoteHistoryCreate { + nhc.mutation.SetDeletedAt(t) + return nhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableDeletedAt(t *time.Time) *NoteHistoryCreate { + if t != nil { + nhc.SetDeletedAt(*t) + } + return nhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (nhc *NoteHistoryCreate) SetDeletedBy(s string) *NoteHistoryCreate { + nhc.mutation.SetDeletedBy(s) + return nhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableDeletedBy(s *string) *NoteHistoryCreate { + if s != nil { + nhc.SetDeletedBy(*s) + } + return nhc +} + +// SetTags sets the "tags" field. +func (nhc *NoteHistoryCreate) SetTags(s []string) *NoteHistoryCreate { + nhc.mutation.SetTags(s) + return nhc +} + +// SetOwnerID sets the "owner_id" field. +func (nhc *NoteHistoryCreate) SetOwnerID(s string) *NoteHistoryCreate { + nhc.mutation.SetOwnerID(s) + return nhc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableOwnerID(s *string) *NoteHistoryCreate { + if s != nil { + nhc.SetOwnerID(*s) + } + return nhc +} + +// SetText sets the "text" field. +func (nhc *NoteHistoryCreate) SetText(s string) *NoteHistoryCreate { + nhc.mutation.SetText(s) + return nhc +} + +// SetID sets the "id" field. +func (nhc *NoteHistoryCreate) SetID(s string) *NoteHistoryCreate { + nhc.mutation.SetID(s) + return nhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (nhc *NoteHistoryCreate) SetNillableID(s *string) *NoteHistoryCreate { + if s != nil { + nhc.SetID(*s) + } + return nhc +} + +// Mutation returns the NoteHistoryMutation object of the builder. +func (nhc *NoteHistoryCreate) Mutation() *NoteHistoryMutation { + return nhc.mutation +} + +// Save creates the NoteHistory in the database. +func (nhc *NoteHistoryCreate) Save(ctx context.Context) (*NoteHistory, error) { + if err := nhc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, nhc.sqlSave, nhc.mutation, nhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (nhc *NoteHistoryCreate) SaveX(ctx context.Context) *NoteHistory { + v, err := nhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (nhc *NoteHistoryCreate) Exec(ctx context.Context) error { + _, err := nhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (nhc *NoteHistoryCreate) ExecX(ctx context.Context) { + if err := nhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (nhc *NoteHistoryCreate) defaults() error { + if _, ok := nhc.mutation.HistoryTime(); !ok { + if notehistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized notehistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := notehistory.DefaultHistoryTime() + nhc.mutation.SetHistoryTime(v) + } + if _, ok := nhc.mutation.CreatedAt(); !ok { + if notehistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized notehistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := notehistory.DefaultCreatedAt() + nhc.mutation.SetCreatedAt(v) + } + if _, ok := nhc.mutation.UpdatedAt(); !ok { + if notehistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized notehistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := notehistory.DefaultUpdatedAt() + nhc.mutation.SetUpdatedAt(v) + } + if _, ok := nhc.mutation.MappingID(); !ok { + if notehistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized notehistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := notehistory.DefaultMappingID() + nhc.mutation.SetMappingID(v) + } + if _, ok := nhc.mutation.Tags(); !ok { + v := notehistory.DefaultTags + nhc.mutation.SetTags(v) + } + if _, ok := nhc.mutation.ID(); !ok { + if notehistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized notehistory.DefaultID (forgotten import generated/runtime?)") + } + v := notehistory.DefaultID() + nhc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (nhc *NoteHistoryCreate) check() error { + if _, ok := nhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "NoteHistory.history_time"`)} + } + if _, ok := nhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "NoteHistory.operation"`)} + } + if v, ok := nhc.mutation.Operation(); ok { + if err := notehistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "NoteHistory.operation": %w`, err)} + } + } + if _, ok := nhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "NoteHistory.mapping_id"`)} + } + if _, ok := nhc.mutation.Text(); !ok { + return &ValidationError{Name: "text", err: errors.New(`generated: missing required field "NoteHistory.text"`)} + } + return nil +} + +func (nhc *NoteHistoryCreate) sqlSave(ctx context.Context) (*NoteHistory, error) { + if err := nhc.check(); err != nil { + return nil, err + } + _node, _spec := nhc.createSpec() + if err := sqlgraph.CreateNode(ctx, nhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected NoteHistory.ID type: %T", _spec.ID.Value) + } + } + nhc.mutation.id = &_node.ID + nhc.mutation.done = true + return _node, nil +} + +func (nhc *NoteHistoryCreate) createSpec() (*NoteHistory, *sqlgraph.CreateSpec) { + var ( + _node = &NoteHistory{config: nhc.config} + _spec = sqlgraph.NewCreateSpec(notehistory.Table, sqlgraph.NewFieldSpec(notehistory.FieldID, field.TypeString)) + ) + _spec.Schema = nhc.schemaConfig.NoteHistory + if id, ok := nhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := nhc.mutation.HistoryTime(); ok { + _spec.SetField(notehistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := nhc.mutation.Ref(); ok { + _spec.SetField(notehistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := nhc.mutation.Operation(); ok { + _spec.SetField(notehistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := nhc.mutation.CreatedAt(); ok { + _spec.SetField(notehistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := nhc.mutation.UpdatedAt(); ok { + _spec.SetField(notehistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := nhc.mutation.CreatedBy(); ok { + _spec.SetField(notehistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := nhc.mutation.UpdatedBy(); ok { + _spec.SetField(notehistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := nhc.mutation.MappingID(); ok { + _spec.SetField(notehistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := nhc.mutation.DeletedAt(); ok { + _spec.SetField(notehistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := nhc.mutation.DeletedBy(); ok { + _spec.SetField(notehistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := nhc.mutation.Tags(); ok { + _spec.SetField(notehistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := nhc.mutation.OwnerID(); ok { + _spec.SetField(notehistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := nhc.mutation.Text(); ok { + _spec.SetField(notehistory.FieldText, field.TypeString, value) + _node.Text = value + } + return _node, _spec +} + +// NoteHistoryCreateBulk is the builder for creating many NoteHistory entities in bulk. +type NoteHistoryCreateBulk struct { + config + err error + builders []*NoteHistoryCreate +} + +// Save creates the NoteHistory entities in the database. +func (nhcb *NoteHistoryCreateBulk) Save(ctx context.Context) ([]*NoteHistory, error) { + if nhcb.err != nil { + return nil, nhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(nhcb.builders)) + nodes := make([]*NoteHistory, len(nhcb.builders)) + mutators := make([]Mutator, len(nhcb.builders)) + for i := range nhcb.builders { + func(i int, root context.Context) { + builder := nhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*NoteHistoryMutation) + 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, nhcb.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, nhcb.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, nhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (nhcb *NoteHistoryCreateBulk) SaveX(ctx context.Context) []*NoteHistory { + v, err := nhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (nhcb *NoteHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := nhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (nhcb *NoteHistoryCreateBulk) ExecX(ctx context.Context) { + if err := nhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/notehistory_delete.go b/internal/ent/generated/notehistory_delete.go new file mode 100644 index 0000000..8a147cd --- /dev/null +++ b/internal/ent/generated/notehistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/notehistory" +) + +// NoteHistoryDelete is the builder for deleting a NoteHistory entity. +type NoteHistoryDelete struct { + config + hooks []Hook + mutation *NoteHistoryMutation +} + +// Where appends a list predicates to the NoteHistoryDelete builder. +func (nhd *NoteHistoryDelete) Where(ps ...predicate.NoteHistory) *NoteHistoryDelete { + nhd.mutation.Where(ps...) + return nhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (nhd *NoteHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, nhd.sqlExec, nhd.mutation, nhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (nhd *NoteHistoryDelete) ExecX(ctx context.Context) int { + n, err := nhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (nhd *NoteHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(notehistory.Table, sqlgraph.NewFieldSpec(notehistory.FieldID, field.TypeString)) + _spec.Node.Schema = nhd.schemaConfig.NoteHistory + ctx = internal.NewSchemaConfigContext(ctx, nhd.schemaConfig) + if ps := nhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, nhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + nhd.mutation.done = true + return affected, err +} + +// NoteHistoryDeleteOne is the builder for deleting a single NoteHistory entity. +type NoteHistoryDeleteOne struct { + nhd *NoteHistoryDelete +} + +// Where appends a list predicates to the NoteHistoryDelete builder. +func (nhdo *NoteHistoryDeleteOne) Where(ps ...predicate.NoteHistory) *NoteHistoryDeleteOne { + nhdo.nhd.mutation.Where(ps...) + return nhdo +} + +// Exec executes the deletion query. +func (nhdo *NoteHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := nhdo.nhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{notehistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (nhdo *NoteHistoryDeleteOne) ExecX(ctx context.Context) { + if err := nhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/notehistory_query.go b/internal/ent/generated/notehistory_query.go new file mode 100644 index 0000000..14264de --- /dev/null +++ b/internal/ent/generated/notehistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// NoteHistoryQuery is the builder for querying NoteHistory entities. +type NoteHistoryQuery struct { + config + ctx *QueryContext + order []notehistory.OrderOption + inters []Interceptor + predicates []predicate.NoteHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*NoteHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the NoteHistoryQuery builder. +func (nhq *NoteHistoryQuery) Where(ps ...predicate.NoteHistory) *NoteHistoryQuery { + nhq.predicates = append(nhq.predicates, ps...) + return nhq +} + +// Limit the number of records to be returned by this query. +func (nhq *NoteHistoryQuery) Limit(limit int) *NoteHistoryQuery { + nhq.ctx.Limit = &limit + return nhq +} + +// Offset to start from. +func (nhq *NoteHistoryQuery) Offset(offset int) *NoteHistoryQuery { + nhq.ctx.Offset = &offset + return nhq +} + +// 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 (nhq *NoteHistoryQuery) Unique(unique bool) *NoteHistoryQuery { + nhq.ctx.Unique = &unique + return nhq +} + +// Order specifies how the records should be ordered. +func (nhq *NoteHistoryQuery) Order(o ...notehistory.OrderOption) *NoteHistoryQuery { + nhq.order = append(nhq.order, o...) + return nhq +} + +// First returns the first NoteHistory entity from the query. +// Returns a *NotFoundError when no NoteHistory was found. +func (nhq *NoteHistoryQuery) First(ctx context.Context) (*NoteHistory, error) { + nodes, err := nhq.Limit(1).All(setContextOp(ctx, nhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{notehistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (nhq *NoteHistoryQuery) FirstX(ctx context.Context) *NoteHistory { + node, err := nhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first NoteHistory ID from the query. +// Returns a *NotFoundError when no NoteHistory ID was found. +func (nhq *NoteHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = nhq.Limit(1).IDs(setContextOp(ctx, nhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{notehistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (nhq *NoteHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := nhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single NoteHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one NoteHistory entity is found. +// Returns a *NotFoundError when no NoteHistory entities are found. +func (nhq *NoteHistoryQuery) Only(ctx context.Context) (*NoteHistory, error) { + nodes, err := nhq.Limit(2).All(setContextOp(ctx, nhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{notehistory.Label} + default: + return nil, &NotSingularError{notehistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (nhq *NoteHistoryQuery) OnlyX(ctx context.Context) *NoteHistory { + node, err := nhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only NoteHistory ID in the query. +// Returns a *NotSingularError when more than one NoteHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (nhq *NoteHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = nhq.Limit(2).IDs(setContextOp(ctx, nhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{notehistory.Label} + default: + err = &NotSingularError{notehistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (nhq *NoteHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := nhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of NoteHistories. +func (nhq *NoteHistoryQuery) All(ctx context.Context) ([]*NoteHistory, error) { + ctx = setContextOp(ctx, nhq.ctx, ent.OpQueryAll) + if err := nhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*NoteHistory, *NoteHistoryQuery]() + return withInterceptors[[]*NoteHistory](ctx, nhq, qr, nhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (nhq *NoteHistoryQuery) AllX(ctx context.Context) []*NoteHistory { + nodes, err := nhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of NoteHistory IDs. +func (nhq *NoteHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if nhq.ctx.Unique == nil && nhq.path != nil { + nhq.Unique(true) + } + ctx = setContextOp(ctx, nhq.ctx, ent.OpQueryIDs) + if err = nhq.Select(notehistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (nhq *NoteHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := nhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (nhq *NoteHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, nhq.ctx, ent.OpQueryCount) + if err := nhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, nhq, querierCount[*NoteHistoryQuery](), nhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (nhq *NoteHistoryQuery) CountX(ctx context.Context) int { + count, err := nhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (nhq *NoteHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, nhq.ctx, ent.OpQueryExist) + switch _, err := nhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (nhq *NoteHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := nhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the NoteHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (nhq *NoteHistoryQuery) Clone() *NoteHistoryQuery { + if nhq == nil { + return nil + } + return &NoteHistoryQuery{ + config: nhq.config, + ctx: nhq.ctx.Clone(), + order: append([]notehistory.OrderOption{}, nhq.order...), + inters: append([]Interceptor{}, nhq.inters...), + predicates: append([]predicate.NoteHistory{}, nhq.predicates...), + // clone intermediate query. + sql: nhq.sql.Clone(), + path: nhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.NoteHistory.Query(). +// GroupBy(notehistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (nhq *NoteHistoryQuery) GroupBy(field string, fields ...string) *NoteHistoryGroupBy { + nhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &NoteHistoryGroupBy{build: nhq} + grbuild.flds = &nhq.ctx.Fields + grbuild.label = notehistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.NoteHistory.Query(). +// Select(notehistory.FieldHistoryTime). +// Scan(ctx, &v) +func (nhq *NoteHistoryQuery) Select(fields ...string) *NoteHistorySelect { + nhq.ctx.Fields = append(nhq.ctx.Fields, fields...) + sbuild := &NoteHistorySelect{NoteHistoryQuery: nhq} + sbuild.label = notehistory.Label + sbuild.flds, sbuild.scan = &nhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a NoteHistorySelect configured with the given aggregations. +func (nhq *NoteHistoryQuery) Aggregate(fns ...AggregateFunc) *NoteHistorySelect { + return nhq.Select().Aggregate(fns...) +} + +func (nhq *NoteHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range nhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, nhq); err != nil { + return err + } + } + } + for _, f := range nhq.ctx.Fields { + if !notehistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if nhq.path != nil { + prev, err := nhq.path(ctx) + if err != nil { + return err + } + nhq.sql = prev + } + if notehistory.Policy == nil { + return errors.New("generated: uninitialized notehistory.Policy (forgotten import generated/runtime?)") + } + if err := notehistory.Policy.EvalQuery(ctx, nhq); err != nil { + return err + } + return nil +} + +func (nhq *NoteHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*NoteHistory, error) { + var ( + nodes = []*NoteHistory{} + _spec = nhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*NoteHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &NoteHistory{config: nhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = nhq.schemaConfig.NoteHistory + ctx = internal.NewSchemaConfigContext(ctx, nhq.schemaConfig) + if len(nhq.modifiers) > 0 { + _spec.Modifiers = nhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, nhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range nhq.loadTotal { + if err := nhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (nhq *NoteHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := nhq.querySpec() + _spec.Node.Schema = nhq.schemaConfig.NoteHistory + ctx = internal.NewSchemaConfigContext(ctx, nhq.schemaConfig) + if len(nhq.modifiers) > 0 { + _spec.Modifiers = nhq.modifiers + } + _spec.Node.Columns = nhq.ctx.Fields + if len(nhq.ctx.Fields) > 0 { + _spec.Unique = nhq.ctx.Unique != nil && *nhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, nhq.driver, _spec) +} + +func (nhq *NoteHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(notehistory.Table, notehistory.Columns, sqlgraph.NewFieldSpec(notehistory.FieldID, field.TypeString)) + _spec.From = nhq.sql + if unique := nhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if nhq.path != nil { + _spec.Unique = true + } + if fields := nhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, notehistory.FieldID) + for i := range fields { + if fields[i] != notehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := nhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := nhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := nhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := nhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (nhq *NoteHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(nhq.driver.Dialect()) + t1 := builder.Table(notehistory.Table) + columns := nhq.ctx.Fields + if len(columns) == 0 { + columns = notehistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if nhq.sql != nil { + selector = nhq.sql + selector.Select(selector.Columns(columns...)...) + } + if nhq.ctx.Unique != nil && *nhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(nhq.schemaConfig.NoteHistory) + ctx = internal.NewSchemaConfigContext(ctx, nhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range nhq.predicates { + p(selector) + } + for _, p := range nhq.order { + p(selector) + } + if offset := nhq.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 := nhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// NoteHistoryGroupBy is the group-by builder for NoteHistory entities. +type NoteHistoryGroupBy struct { + selector + build *NoteHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (nhgb *NoteHistoryGroupBy) Aggregate(fns ...AggregateFunc) *NoteHistoryGroupBy { + nhgb.fns = append(nhgb.fns, fns...) + return nhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (nhgb *NoteHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, nhgb.build.ctx, ent.OpQueryGroupBy) + if err := nhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*NoteHistoryQuery, *NoteHistoryGroupBy](ctx, nhgb.build, nhgb, nhgb.build.inters, v) +} + +func (nhgb *NoteHistoryGroupBy) sqlScan(ctx context.Context, root *NoteHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(nhgb.fns)) + for _, fn := range nhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*nhgb.flds)+len(nhgb.fns)) + for _, f := range *nhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*nhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := nhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// NoteHistorySelect is the builder for selecting fields of NoteHistory entities. +type NoteHistorySelect struct { + *NoteHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (nhs *NoteHistorySelect) Aggregate(fns ...AggregateFunc) *NoteHistorySelect { + nhs.fns = append(nhs.fns, fns...) + return nhs +} + +// Scan applies the selector query and scans the result into the given value. +func (nhs *NoteHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, nhs.ctx, ent.OpQuerySelect) + if err := nhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*NoteHistoryQuery, *NoteHistorySelect](ctx, nhs.NoteHistoryQuery, nhs, nhs.inters, v) +} + +func (nhs *NoteHistorySelect) sqlScan(ctx context.Context, root *NoteHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(nhs.fns)) + for _, fn := range nhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*nhs.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 := nhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/notehistory_update.go b/internal/ent/generated/notehistory_update.go new file mode 100644 index 0000000..2ac6f8a --- /dev/null +++ b/internal/ent/generated/notehistory_update.go @@ -0,0 +1,567 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// NoteHistoryUpdate is the builder for updating NoteHistory entities. +type NoteHistoryUpdate struct { + config + hooks []Hook + mutation *NoteHistoryMutation +} + +// Where appends a list predicates to the NoteHistoryUpdate builder. +func (nhu *NoteHistoryUpdate) Where(ps ...predicate.NoteHistory) *NoteHistoryUpdate { + nhu.mutation.Where(ps...) + return nhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (nhu *NoteHistoryUpdate) SetUpdatedAt(t time.Time) *NoteHistoryUpdate { + nhu.mutation.SetUpdatedAt(t) + return nhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (nhu *NoteHistoryUpdate) ClearUpdatedAt() *NoteHistoryUpdate { + nhu.mutation.ClearUpdatedAt() + return nhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (nhu *NoteHistoryUpdate) SetUpdatedBy(s string) *NoteHistoryUpdate { + nhu.mutation.SetUpdatedBy(s) + return nhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (nhu *NoteHistoryUpdate) SetNillableUpdatedBy(s *string) *NoteHistoryUpdate { + if s != nil { + nhu.SetUpdatedBy(*s) + } + return nhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (nhu *NoteHistoryUpdate) ClearUpdatedBy() *NoteHistoryUpdate { + nhu.mutation.ClearUpdatedBy() + return nhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (nhu *NoteHistoryUpdate) SetDeletedAt(t time.Time) *NoteHistoryUpdate { + nhu.mutation.SetDeletedAt(t) + return nhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (nhu *NoteHistoryUpdate) SetNillableDeletedAt(t *time.Time) *NoteHistoryUpdate { + if t != nil { + nhu.SetDeletedAt(*t) + } + return nhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (nhu *NoteHistoryUpdate) ClearDeletedAt() *NoteHistoryUpdate { + nhu.mutation.ClearDeletedAt() + return nhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (nhu *NoteHistoryUpdate) SetDeletedBy(s string) *NoteHistoryUpdate { + nhu.mutation.SetDeletedBy(s) + return nhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (nhu *NoteHistoryUpdate) SetNillableDeletedBy(s *string) *NoteHistoryUpdate { + if s != nil { + nhu.SetDeletedBy(*s) + } + return nhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (nhu *NoteHistoryUpdate) ClearDeletedBy() *NoteHistoryUpdate { + nhu.mutation.ClearDeletedBy() + return nhu +} + +// SetTags sets the "tags" field. +func (nhu *NoteHistoryUpdate) SetTags(s []string) *NoteHistoryUpdate { + nhu.mutation.SetTags(s) + return nhu +} + +// AppendTags appends s to the "tags" field. +func (nhu *NoteHistoryUpdate) AppendTags(s []string) *NoteHistoryUpdate { + nhu.mutation.AppendTags(s) + return nhu +} + +// ClearTags clears the value of the "tags" field. +func (nhu *NoteHistoryUpdate) ClearTags() *NoteHistoryUpdate { + nhu.mutation.ClearTags() + return nhu +} + +// SetOwnerID sets the "owner_id" field. +func (nhu *NoteHistoryUpdate) SetOwnerID(s string) *NoteHistoryUpdate { + nhu.mutation.SetOwnerID(s) + return nhu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (nhu *NoteHistoryUpdate) SetNillableOwnerID(s *string) *NoteHistoryUpdate { + if s != nil { + nhu.SetOwnerID(*s) + } + return nhu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (nhu *NoteHistoryUpdate) ClearOwnerID() *NoteHistoryUpdate { + nhu.mutation.ClearOwnerID() + return nhu +} + +// SetText sets the "text" field. +func (nhu *NoteHistoryUpdate) SetText(s string) *NoteHistoryUpdate { + nhu.mutation.SetText(s) + return nhu +} + +// SetNillableText sets the "text" field if the given value is not nil. +func (nhu *NoteHistoryUpdate) SetNillableText(s *string) *NoteHistoryUpdate { + if s != nil { + nhu.SetText(*s) + } + return nhu +} + +// Mutation returns the NoteHistoryMutation object of the builder. +func (nhu *NoteHistoryUpdate) Mutation() *NoteHistoryMutation { + return nhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (nhu *NoteHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := nhu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, nhu.sqlSave, nhu.mutation, nhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (nhu *NoteHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := nhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (nhu *NoteHistoryUpdate) Exec(ctx context.Context) error { + _, err := nhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (nhu *NoteHistoryUpdate) ExecX(ctx context.Context) { + if err := nhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (nhu *NoteHistoryUpdate) defaults() error { + if _, ok := nhu.mutation.UpdatedAt(); !ok && !nhu.mutation.UpdatedAtCleared() { + if notehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized notehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := notehistory.UpdateDefaultUpdatedAt() + nhu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (nhu *NoteHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(notehistory.Table, notehistory.Columns, sqlgraph.NewFieldSpec(notehistory.FieldID, field.TypeString)) + if ps := nhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if nhu.mutation.RefCleared() { + _spec.ClearField(notehistory.FieldRef, field.TypeString) + } + if nhu.mutation.CreatedAtCleared() { + _spec.ClearField(notehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := nhu.mutation.UpdatedAt(); ok { + _spec.SetField(notehistory.FieldUpdatedAt, field.TypeTime, value) + } + if nhu.mutation.UpdatedAtCleared() { + _spec.ClearField(notehistory.FieldUpdatedAt, field.TypeTime) + } + if nhu.mutation.CreatedByCleared() { + _spec.ClearField(notehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := nhu.mutation.UpdatedBy(); ok { + _spec.SetField(notehistory.FieldUpdatedBy, field.TypeString, value) + } + if nhu.mutation.UpdatedByCleared() { + _spec.ClearField(notehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := nhu.mutation.DeletedAt(); ok { + _spec.SetField(notehistory.FieldDeletedAt, field.TypeTime, value) + } + if nhu.mutation.DeletedAtCleared() { + _spec.ClearField(notehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := nhu.mutation.DeletedBy(); ok { + _spec.SetField(notehistory.FieldDeletedBy, field.TypeString, value) + } + if nhu.mutation.DeletedByCleared() { + _spec.ClearField(notehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := nhu.mutation.Tags(); ok { + _spec.SetField(notehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := nhu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, notehistory.FieldTags, value) + }) + } + if nhu.mutation.TagsCleared() { + _spec.ClearField(notehistory.FieldTags, field.TypeJSON) + } + if value, ok := nhu.mutation.OwnerID(); ok { + _spec.SetField(notehistory.FieldOwnerID, field.TypeString, value) + } + if nhu.mutation.OwnerIDCleared() { + _spec.ClearField(notehistory.FieldOwnerID, field.TypeString) + } + if value, ok := nhu.mutation.Text(); ok { + _spec.SetField(notehistory.FieldText, field.TypeString, value) + } + _spec.Node.Schema = nhu.schemaConfig.NoteHistory + ctx = internal.NewSchemaConfigContext(ctx, nhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, nhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{notehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + nhu.mutation.done = true + return n, nil +} + +// NoteHistoryUpdateOne is the builder for updating a single NoteHistory entity. +type NoteHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *NoteHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (nhuo *NoteHistoryUpdateOne) SetUpdatedAt(t time.Time) *NoteHistoryUpdateOne { + nhuo.mutation.SetUpdatedAt(t) + return nhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (nhuo *NoteHistoryUpdateOne) ClearUpdatedAt() *NoteHistoryUpdateOne { + nhuo.mutation.ClearUpdatedAt() + return nhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (nhuo *NoteHistoryUpdateOne) SetUpdatedBy(s string) *NoteHistoryUpdateOne { + nhuo.mutation.SetUpdatedBy(s) + return nhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (nhuo *NoteHistoryUpdateOne) SetNillableUpdatedBy(s *string) *NoteHistoryUpdateOne { + if s != nil { + nhuo.SetUpdatedBy(*s) + } + return nhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (nhuo *NoteHistoryUpdateOne) ClearUpdatedBy() *NoteHistoryUpdateOne { + nhuo.mutation.ClearUpdatedBy() + return nhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (nhuo *NoteHistoryUpdateOne) SetDeletedAt(t time.Time) *NoteHistoryUpdateOne { + nhuo.mutation.SetDeletedAt(t) + return nhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (nhuo *NoteHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *NoteHistoryUpdateOne { + if t != nil { + nhuo.SetDeletedAt(*t) + } + return nhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (nhuo *NoteHistoryUpdateOne) ClearDeletedAt() *NoteHistoryUpdateOne { + nhuo.mutation.ClearDeletedAt() + return nhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (nhuo *NoteHistoryUpdateOne) SetDeletedBy(s string) *NoteHistoryUpdateOne { + nhuo.mutation.SetDeletedBy(s) + return nhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (nhuo *NoteHistoryUpdateOne) SetNillableDeletedBy(s *string) *NoteHistoryUpdateOne { + if s != nil { + nhuo.SetDeletedBy(*s) + } + return nhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (nhuo *NoteHistoryUpdateOne) ClearDeletedBy() *NoteHistoryUpdateOne { + nhuo.mutation.ClearDeletedBy() + return nhuo +} + +// SetTags sets the "tags" field. +func (nhuo *NoteHistoryUpdateOne) SetTags(s []string) *NoteHistoryUpdateOne { + nhuo.mutation.SetTags(s) + return nhuo +} + +// AppendTags appends s to the "tags" field. +func (nhuo *NoteHistoryUpdateOne) AppendTags(s []string) *NoteHistoryUpdateOne { + nhuo.mutation.AppendTags(s) + return nhuo +} + +// ClearTags clears the value of the "tags" field. +func (nhuo *NoteHistoryUpdateOne) ClearTags() *NoteHistoryUpdateOne { + nhuo.mutation.ClearTags() + return nhuo +} + +// SetOwnerID sets the "owner_id" field. +func (nhuo *NoteHistoryUpdateOne) SetOwnerID(s string) *NoteHistoryUpdateOne { + nhuo.mutation.SetOwnerID(s) + return nhuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (nhuo *NoteHistoryUpdateOne) SetNillableOwnerID(s *string) *NoteHistoryUpdateOne { + if s != nil { + nhuo.SetOwnerID(*s) + } + return nhuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (nhuo *NoteHistoryUpdateOne) ClearOwnerID() *NoteHistoryUpdateOne { + nhuo.mutation.ClearOwnerID() + return nhuo +} + +// SetText sets the "text" field. +func (nhuo *NoteHistoryUpdateOne) SetText(s string) *NoteHistoryUpdateOne { + nhuo.mutation.SetText(s) + return nhuo +} + +// SetNillableText sets the "text" field if the given value is not nil. +func (nhuo *NoteHistoryUpdateOne) SetNillableText(s *string) *NoteHistoryUpdateOne { + if s != nil { + nhuo.SetText(*s) + } + return nhuo +} + +// Mutation returns the NoteHistoryMutation object of the builder. +func (nhuo *NoteHistoryUpdateOne) Mutation() *NoteHistoryMutation { + return nhuo.mutation +} + +// Where appends a list predicates to the NoteHistoryUpdate builder. +func (nhuo *NoteHistoryUpdateOne) Where(ps ...predicate.NoteHistory) *NoteHistoryUpdateOne { + nhuo.mutation.Where(ps...) + return nhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (nhuo *NoteHistoryUpdateOne) Select(field string, fields ...string) *NoteHistoryUpdateOne { + nhuo.fields = append([]string{field}, fields...) + return nhuo +} + +// Save executes the query and returns the updated NoteHistory entity. +func (nhuo *NoteHistoryUpdateOne) Save(ctx context.Context) (*NoteHistory, error) { + if err := nhuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, nhuo.sqlSave, nhuo.mutation, nhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (nhuo *NoteHistoryUpdateOne) SaveX(ctx context.Context) *NoteHistory { + node, err := nhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (nhuo *NoteHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := nhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (nhuo *NoteHistoryUpdateOne) ExecX(ctx context.Context) { + if err := nhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (nhuo *NoteHistoryUpdateOne) defaults() error { + if _, ok := nhuo.mutation.UpdatedAt(); !ok && !nhuo.mutation.UpdatedAtCleared() { + if notehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized notehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := notehistory.UpdateDefaultUpdatedAt() + nhuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (nhuo *NoteHistoryUpdateOne) sqlSave(ctx context.Context) (_node *NoteHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(notehistory.Table, notehistory.Columns, sqlgraph.NewFieldSpec(notehistory.FieldID, field.TypeString)) + id, ok := nhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "NoteHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := nhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, notehistory.FieldID) + for _, f := range fields { + if !notehistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != notehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := nhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if nhuo.mutation.RefCleared() { + _spec.ClearField(notehistory.FieldRef, field.TypeString) + } + if nhuo.mutation.CreatedAtCleared() { + _spec.ClearField(notehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := nhuo.mutation.UpdatedAt(); ok { + _spec.SetField(notehistory.FieldUpdatedAt, field.TypeTime, value) + } + if nhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(notehistory.FieldUpdatedAt, field.TypeTime) + } + if nhuo.mutation.CreatedByCleared() { + _spec.ClearField(notehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := nhuo.mutation.UpdatedBy(); ok { + _spec.SetField(notehistory.FieldUpdatedBy, field.TypeString, value) + } + if nhuo.mutation.UpdatedByCleared() { + _spec.ClearField(notehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := nhuo.mutation.DeletedAt(); ok { + _spec.SetField(notehistory.FieldDeletedAt, field.TypeTime, value) + } + if nhuo.mutation.DeletedAtCleared() { + _spec.ClearField(notehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := nhuo.mutation.DeletedBy(); ok { + _spec.SetField(notehistory.FieldDeletedBy, field.TypeString, value) + } + if nhuo.mutation.DeletedByCleared() { + _spec.ClearField(notehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := nhuo.mutation.Tags(); ok { + _spec.SetField(notehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := nhuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, notehistory.FieldTags, value) + }) + } + if nhuo.mutation.TagsCleared() { + _spec.ClearField(notehistory.FieldTags, field.TypeJSON) + } + if value, ok := nhuo.mutation.OwnerID(); ok { + _spec.SetField(notehistory.FieldOwnerID, field.TypeString, value) + } + if nhuo.mutation.OwnerIDCleared() { + _spec.ClearField(notehistory.FieldOwnerID, field.TypeString) + } + if value, ok := nhuo.mutation.Text(); ok { + _spec.SetField(notehistory.FieldText, field.TypeString, value) + } + _spec.Node.Schema = nhuo.schemaConfig.NoteHistory + ctx = internal.NewSchemaConfigContext(ctx, nhuo.schemaConfig) + _node = &NoteHistory{config: nhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, nhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{notehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + nhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/oauthprovider.go b/internal/ent/generated/oauthprovider.go new file mode 100644 index 0000000..98284e9 --- /dev/null +++ b/internal/ent/generated/oauthprovider.go @@ -0,0 +1,330 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// OauthProvider is the model entity for the OauthProvider schema. +type OauthProvider struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the oauth provider's name + Name string `json:"name,omitempty"` + // the client id for the oauth provider + ClientID string `json:"client_id,omitempty"` + // the client secret + ClientSecret string `json:"client_secret,omitempty"` + // the redirect url + RedirectURL string `json:"redirect_url,omitempty"` + // the scopes + Scopes string `json:"scopes,omitempty"` + // the auth url of the provider + AuthURL string `json:"auth_url,omitempty"` + // the token url of the provider + TokenURL string `json:"token_url,omitempty"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle customtypes.Uint8 `json:"auth_style,omitempty"` + // the URL to request user information by token + InfoURL string `json:"info_url,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the OauthProviderQuery when eager-loading is set. + Edges OauthProviderEdges `json:"edges"` + selectValues sql.SelectValues +} + +// OauthProviderEdges holds the relations/edges for other nodes in the graph. +type OauthProviderEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,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 +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e OauthProviderEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OauthProvider) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case oauthprovider.FieldTags: + values[i] = new([]byte) + case oauthprovider.FieldAuthStyle: + values[i] = new(sql.NullInt64) + case oauthprovider.FieldID, oauthprovider.FieldCreatedBy, oauthprovider.FieldUpdatedBy, oauthprovider.FieldMappingID, oauthprovider.FieldDeletedBy, oauthprovider.FieldOwnerID, oauthprovider.FieldName, oauthprovider.FieldClientID, oauthprovider.FieldClientSecret, oauthprovider.FieldRedirectURL, oauthprovider.FieldScopes, oauthprovider.FieldAuthURL, oauthprovider.FieldTokenURL, oauthprovider.FieldInfoURL: + values[i] = new(sql.NullString) + case oauthprovider.FieldCreatedAt, oauthprovider.FieldUpdatedAt, oauthprovider.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OauthProvider fields. +func (op *OauthProvider) 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 oauthprovider.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + op.ID = value.String + } + case oauthprovider.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + op.CreatedAt = value.Time + } + case oauthprovider.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + op.UpdatedAt = value.Time + } + case oauthprovider.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + op.CreatedBy = value.String + } + case oauthprovider.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + op.UpdatedBy = value.String + } + case oauthprovider.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + op.MappingID = value.String + } + case oauthprovider.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &op.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case oauthprovider.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + op.DeletedAt = value.Time + } + case oauthprovider.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + op.DeletedBy = value.String + } + case oauthprovider.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + op.OwnerID = value.String + } + case oauthprovider.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + op.Name = value.String + } + case oauthprovider.FieldClientID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field client_id", values[i]) + } else if value.Valid { + op.ClientID = value.String + } + case oauthprovider.FieldClientSecret: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field client_secret", values[i]) + } else if value.Valid { + op.ClientSecret = value.String + } + case oauthprovider.FieldRedirectURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field redirect_url", values[i]) + } else if value.Valid { + op.RedirectURL = value.String + } + case oauthprovider.FieldScopes: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field scopes", values[i]) + } else if value.Valid { + op.Scopes = value.String + } + case oauthprovider.FieldAuthURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field auth_url", values[i]) + } else if value.Valid { + op.AuthURL = value.String + } + case oauthprovider.FieldTokenURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token_url", values[i]) + } else if value.Valid { + op.TokenURL = value.String + } + case oauthprovider.FieldAuthStyle: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field auth_style", values[i]) + } else if value.Valid { + op.AuthStyle = customtypes.Uint8(value.Int64) + } + case oauthprovider.FieldInfoURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field info_url", values[i]) + } else if value.Valid { + op.InfoURL = value.String + } + default: + op.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OauthProvider. +// This includes values selected through modifiers, order, etc. +func (op *OauthProvider) Value(name string) (ent.Value, error) { + return op.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the OauthProvider entity. +func (op *OauthProvider) QueryOwner() *OrganizationQuery { + return NewOauthProviderClient(op.config).QueryOwner(op) +} + +// Update returns a builder for updating this OauthProvider. +// Note that you need to call OauthProvider.Unwrap() before calling this method if this OauthProvider +// was returned from a transaction, and the transaction was committed or rolled back. +func (op *OauthProvider) Update() *OauthProviderUpdateOne { + return NewOauthProviderClient(op.config).UpdateOne(op) +} + +// Unwrap unwraps the OauthProvider 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 (op *OauthProvider) Unwrap() *OauthProvider { + _tx, ok := op.config.driver.(*txDriver) + if !ok { + panic("generated: OauthProvider is not a transactional entity") + } + op.config.driver = _tx.drv + return op +} + +// String implements the fmt.Stringer. +func (op *OauthProvider) String() string { + var builder strings.Builder + builder.WriteString("OauthProvider(") + builder.WriteString(fmt.Sprintf("id=%v, ", op.ID)) + builder.WriteString("created_at=") + builder.WriteString(op.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(op.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(op.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(op.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(op.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", op.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(op.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(op.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(op.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(op.Name) + builder.WriteString(", ") + builder.WriteString("client_id=") + builder.WriteString(op.ClientID) + builder.WriteString(", ") + builder.WriteString("client_secret=") + builder.WriteString(op.ClientSecret) + builder.WriteString(", ") + builder.WriteString("redirect_url=") + builder.WriteString(op.RedirectURL) + builder.WriteString(", ") + builder.WriteString("scopes=") + builder.WriteString(op.Scopes) + builder.WriteString(", ") + builder.WriteString("auth_url=") + builder.WriteString(op.AuthURL) + builder.WriteString(", ") + builder.WriteString("token_url=") + builder.WriteString(op.TokenURL) + builder.WriteString(", ") + builder.WriteString("auth_style=") + builder.WriteString(fmt.Sprintf("%v", op.AuthStyle)) + builder.WriteString(", ") + builder.WriteString("info_url=") + builder.WriteString(op.InfoURL) + builder.WriteByte(')') + return builder.String() +} + +// OauthProviders is a parsable slice of OauthProvider. +type OauthProviders []*OauthProvider diff --git a/internal/ent/generated/oauthprovider/oauthprovider.go b/internal/ent/generated/oauthprovider/oauthprovider.go new file mode 100644 index 0000000..4e38bd6 --- /dev/null +++ b/internal/ent/generated/oauthprovider/oauthprovider.go @@ -0,0 +1,230 @@ +// Code generated by ent, DO NOT EDIT. + +package oauthprovider + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the oauthprovider type in the database. + Label = "oauth_provider" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldClientID holds the string denoting the client_id field in the database. + FieldClientID = "client_id" + // FieldClientSecret holds the string denoting the client_secret field in the database. + FieldClientSecret = "client_secret" + // FieldRedirectURL holds the string denoting the redirect_url field in the database. + FieldRedirectURL = "redirect_url" + // FieldScopes holds the string denoting the scopes field in the database. + FieldScopes = "scopes" + // FieldAuthURL holds the string denoting the auth_url field in the database. + FieldAuthURL = "auth_url" + // FieldTokenURL holds the string denoting the token_url field in the database. + FieldTokenURL = "token_url" + // FieldAuthStyle holds the string denoting the auth_style field in the database. + FieldAuthStyle = "auth_style" + // FieldInfoURL holds the string denoting the info_url field in the database. + FieldInfoURL = "info_url" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // Table holds the table name of the oauthprovider in the database. + Table = "oauth_providers" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "oauth_providers" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" +) + +// Columns holds all SQL columns for oauthprovider fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldName, + FieldClientID, + FieldClientSecret, + FieldRedirectURL, + FieldScopes, + FieldAuthURL, + FieldTokenURL, + FieldAuthStyle, + FieldInfoURL, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the OauthProvider queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByClientID orders the results by the client_id field. +func ByClientID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClientID, opts...).ToFunc() +} + +// ByClientSecret orders the results by the client_secret field. +func ByClientSecret(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClientSecret, opts...).ToFunc() +} + +// ByRedirectURL orders the results by the redirect_url field. +func ByRedirectURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRedirectURL, opts...).ToFunc() +} + +// ByScopes orders the results by the scopes field. +func ByScopes(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldScopes, opts...).ToFunc() +} + +// ByAuthURL orders the results by the auth_url field. +func ByAuthURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthURL, opts...).ToFunc() +} + +// ByTokenURL orders the results by the token_url field. +func ByTokenURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTokenURL, opts...).ToFunc() +} + +// ByAuthStyle orders the results by the auth_style field. +func ByAuthStyle(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthStyle, opts...).ToFunc() +} + +// ByInfoURL orders the results by the info_url field. +func ByInfoURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldInfoURL, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} diff --git a/internal/ent/generated/oauthprovider/where.go b/internal/ent/generated/oauthprovider/where.go new file mode 100644 index 0000000..84c88ef --- /dev/null +++ b/internal/ent/generated/oauthprovider/where.go @@ -0,0 +1,1298 @@ +// Code generated by ent, DO NOT EDIT. + +package oauthprovider + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldName, v)) +} + +// ClientID applies equality check predicate on the "client_id" field. It's identical to ClientIDEQ. +func ClientID(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldClientID, v)) +} + +// ClientSecret applies equality check predicate on the "client_secret" field. It's identical to ClientSecretEQ. +func ClientSecret(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldClientSecret, v)) +} + +// RedirectURL applies equality check predicate on the "redirect_url" field. It's identical to RedirectURLEQ. +func RedirectURL(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldRedirectURL, v)) +} + +// Scopes applies equality check predicate on the "scopes" field. It's identical to ScopesEQ. +func Scopes(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldScopes, v)) +} + +// AuthURL applies equality check predicate on the "auth_url" field. It's identical to AuthURLEQ. +func AuthURL(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldAuthURL, v)) +} + +// TokenURL applies equality check predicate on the "token_url" field. It's identical to TokenURLEQ. +func TokenURL(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldTokenURL, v)) +} + +// AuthStyle applies equality check predicate on the "auth_style" field. It's identical to AuthStyleEQ. +func AuthStyle(v customtypes.Uint8) predicate.OauthProvider { + vc := uint8(v) + return predicate.OauthProvider(sql.FieldEQ(FieldAuthStyle, vc)) +} + +// InfoURL applies equality check predicate on the "info_url" field. It's identical to InfoURLEQ. +func InfoURL(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldInfoURL, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldName, v)) +} + +// ClientIDEQ applies the EQ predicate on the "client_id" field. +func ClientIDEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldClientID, v)) +} + +// ClientIDNEQ applies the NEQ predicate on the "client_id" field. +func ClientIDNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldClientID, v)) +} + +// ClientIDIn applies the In predicate on the "client_id" field. +func ClientIDIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldClientID, vs...)) +} + +// ClientIDNotIn applies the NotIn predicate on the "client_id" field. +func ClientIDNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldClientID, vs...)) +} + +// ClientIDGT applies the GT predicate on the "client_id" field. +func ClientIDGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldClientID, v)) +} + +// ClientIDGTE applies the GTE predicate on the "client_id" field. +func ClientIDGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldClientID, v)) +} + +// ClientIDLT applies the LT predicate on the "client_id" field. +func ClientIDLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldClientID, v)) +} + +// ClientIDLTE applies the LTE predicate on the "client_id" field. +func ClientIDLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldClientID, v)) +} + +// ClientIDContains applies the Contains predicate on the "client_id" field. +func ClientIDContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldClientID, v)) +} + +// ClientIDHasPrefix applies the HasPrefix predicate on the "client_id" field. +func ClientIDHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldClientID, v)) +} + +// ClientIDHasSuffix applies the HasSuffix predicate on the "client_id" field. +func ClientIDHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldClientID, v)) +} + +// ClientIDEqualFold applies the EqualFold predicate on the "client_id" field. +func ClientIDEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldClientID, v)) +} + +// ClientIDContainsFold applies the ContainsFold predicate on the "client_id" field. +func ClientIDContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldClientID, v)) +} + +// ClientSecretEQ applies the EQ predicate on the "client_secret" field. +func ClientSecretEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldClientSecret, v)) +} + +// ClientSecretNEQ applies the NEQ predicate on the "client_secret" field. +func ClientSecretNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldClientSecret, v)) +} + +// ClientSecretIn applies the In predicate on the "client_secret" field. +func ClientSecretIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldClientSecret, vs...)) +} + +// ClientSecretNotIn applies the NotIn predicate on the "client_secret" field. +func ClientSecretNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldClientSecret, vs...)) +} + +// ClientSecretGT applies the GT predicate on the "client_secret" field. +func ClientSecretGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldClientSecret, v)) +} + +// ClientSecretGTE applies the GTE predicate on the "client_secret" field. +func ClientSecretGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldClientSecret, v)) +} + +// ClientSecretLT applies the LT predicate on the "client_secret" field. +func ClientSecretLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldClientSecret, v)) +} + +// ClientSecretLTE applies the LTE predicate on the "client_secret" field. +func ClientSecretLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldClientSecret, v)) +} + +// ClientSecretContains applies the Contains predicate on the "client_secret" field. +func ClientSecretContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldClientSecret, v)) +} + +// ClientSecretHasPrefix applies the HasPrefix predicate on the "client_secret" field. +func ClientSecretHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldClientSecret, v)) +} + +// ClientSecretHasSuffix applies the HasSuffix predicate on the "client_secret" field. +func ClientSecretHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldClientSecret, v)) +} + +// ClientSecretEqualFold applies the EqualFold predicate on the "client_secret" field. +func ClientSecretEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldClientSecret, v)) +} + +// ClientSecretContainsFold applies the ContainsFold predicate on the "client_secret" field. +func ClientSecretContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldClientSecret, v)) +} + +// RedirectURLEQ applies the EQ predicate on the "redirect_url" field. +func RedirectURLEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldRedirectURL, v)) +} + +// RedirectURLNEQ applies the NEQ predicate on the "redirect_url" field. +func RedirectURLNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldRedirectURL, v)) +} + +// RedirectURLIn applies the In predicate on the "redirect_url" field. +func RedirectURLIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldRedirectURL, vs...)) +} + +// RedirectURLNotIn applies the NotIn predicate on the "redirect_url" field. +func RedirectURLNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldRedirectURL, vs...)) +} + +// RedirectURLGT applies the GT predicate on the "redirect_url" field. +func RedirectURLGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldRedirectURL, v)) +} + +// RedirectURLGTE applies the GTE predicate on the "redirect_url" field. +func RedirectURLGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldRedirectURL, v)) +} + +// RedirectURLLT applies the LT predicate on the "redirect_url" field. +func RedirectURLLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldRedirectURL, v)) +} + +// RedirectURLLTE applies the LTE predicate on the "redirect_url" field. +func RedirectURLLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldRedirectURL, v)) +} + +// RedirectURLContains applies the Contains predicate on the "redirect_url" field. +func RedirectURLContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldRedirectURL, v)) +} + +// RedirectURLHasPrefix applies the HasPrefix predicate on the "redirect_url" field. +func RedirectURLHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldRedirectURL, v)) +} + +// RedirectURLHasSuffix applies the HasSuffix predicate on the "redirect_url" field. +func RedirectURLHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldRedirectURL, v)) +} + +// RedirectURLEqualFold applies the EqualFold predicate on the "redirect_url" field. +func RedirectURLEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldRedirectURL, v)) +} + +// RedirectURLContainsFold applies the ContainsFold predicate on the "redirect_url" field. +func RedirectURLContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldRedirectURL, v)) +} + +// ScopesEQ applies the EQ predicate on the "scopes" field. +func ScopesEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldScopes, v)) +} + +// ScopesNEQ applies the NEQ predicate on the "scopes" field. +func ScopesNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldScopes, v)) +} + +// ScopesIn applies the In predicate on the "scopes" field. +func ScopesIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldScopes, vs...)) +} + +// ScopesNotIn applies the NotIn predicate on the "scopes" field. +func ScopesNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldScopes, vs...)) +} + +// ScopesGT applies the GT predicate on the "scopes" field. +func ScopesGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldScopes, v)) +} + +// ScopesGTE applies the GTE predicate on the "scopes" field. +func ScopesGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldScopes, v)) +} + +// ScopesLT applies the LT predicate on the "scopes" field. +func ScopesLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldScopes, v)) +} + +// ScopesLTE applies the LTE predicate on the "scopes" field. +func ScopesLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldScopes, v)) +} + +// ScopesContains applies the Contains predicate on the "scopes" field. +func ScopesContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldScopes, v)) +} + +// ScopesHasPrefix applies the HasPrefix predicate on the "scopes" field. +func ScopesHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldScopes, v)) +} + +// ScopesHasSuffix applies the HasSuffix predicate on the "scopes" field. +func ScopesHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldScopes, v)) +} + +// ScopesEqualFold applies the EqualFold predicate on the "scopes" field. +func ScopesEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldScopes, v)) +} + +// ScopesContainsFold applies the ContainsFold predicate on the "scopes" field. +func ScopesContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldScopes, v)) +} + +// AuthURLEQ applies the EQ predicate on the "auth_url" field. +func AuthURLEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldAuthURL, v)) +} + +// AuthURLNEQ applies the NEQ predicate on the "auth_url" field. +func AuthURLNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldAuthURL, v)) +} + +// AuthURLIn applies the In predicate on the "auth_url" field. +func AuthURLIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldAuthURL, vs...)) +} + +// AuthURLNotIn applies the NotIn predicate on the "auth_url" field. +func AuthURLNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldAuthURL, vs...)) +} + +// AuthURLGT applies the GT predicate on the "auth_url" field. +func AuthURLGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldAuthURL, v)) +} + +// AuthURLGTE applies the GTE predicate on the "auth_url" field. +func AuthURLGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldAuthURL, v)) +} + +// AuthURLLT applies the LT predicate on the "auth_url" field. +func AuthURLLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldAuthURL, v)) +} + +// AuthURLLTE applies the LTE predicate on the "auth_url" field. +func AuthURLLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldAuthURL, v)) +} + +// AuthURLContains applies the Contains predicate on the "auth_url" field. +func AuthURLContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldAuthURL, v)) +} + +// AuthURLHasPrefix applies the HasPrefix predicate on the "auth_url" field. +func AuthURLHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldAuthURL, v)) +} + +// AuthURLHasSuffix applies the HasSuffix predicate on the "auth_url" field. +func AuthURLHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldAuthURL, v)) +} + +// AuthURLEqualFold applies the EqualFold predicate on the "auth_url" field. +func AuthURLEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldAuthURL, v)) +} + +// AuthURLContainsFold applies the ContainsFold predicate on the "auth_url" field. +func AuthURLContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldAuthURL, v)) +} + +// TokenURLEQ applies the EQ predicate on the "token_url" field. +func TokenURLEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldTokenURL, v)) +} + +// TokenURLNEQ applies the NEQ predicate on the "token_url" field. +func TokenURLNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldTokenURL, v)) +} + +// TokenURLIn applies the In predicate on the "token_url" field. +func TokenURLIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldTokenURL, vs...)) +} + +// TokenURLNotIn applies the NotIn predicate on the "token_url" field. +func TokenURLNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldTokenURL, vs...)) +} + +// TokenURLGT applies the GT predicate on the "token_url" field. +func TokenURLGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldTokenURL, v)) +} + +// TokenURLGTE applies the GTE predicate on the "token_url" field. +func TokenURLGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldTokenURL, v)) +} + +// TokenURLLT applies the LT predicate on the "token_url" field. +func TokenURLLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldTokenURL, v)) +} + +// TokenURLLTE applies the LTE predicate on the "token_url" field. +func TokenURLLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldTokenURL, v)) +} + +// TokenURLContains applies the Contains predicate on the "token_url" field. +func TokenURLContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldTokenURL, v)) +} + +// TokenURLHasPrefix applies the HasPrefix predicate on the "token_url" field. +func TokenURLHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldTokenURL, v)) +} + +// TokenURLHasSuffix applies the HasSuffix predicate on the "token_url" field. +func TokenURLHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldTokenURL, v)) +} + +// TokenURLEqualFold applies the EqualFold predicate on the "token_url" field. +func TokenURLEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldTokenURL, v)) +} + +// TokenURLContainsFold applies the ContainsFold predicate on the "token_url" field. +func TokenURLContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldTokenURL, v)) +} + +// AuthStyleEQ applies the EQ predicate on the "auth_style" field. +func AuthStyleEQ(v customtypes.Uint8) predicate.OauthProvider { + vc := uint8(v) + return predicate.OauthProvider(sql.FieldEQ(FieldAuthStyle, vc)) +} + +// AuthStyleNEQ applies the NEQ predicate on the "auth_style" field. +func AuthStyleNEQ(v customtypes.Uint8) predicate.OauthProvider { + vc := uint8(v) + return predicate.OauthProvider(sql.FieldNEQ(FieldAuthStyle, vc)) +} + +// AuthStyleIn applies the In predicate on the "auth_style" field. +func AuthStyleIn(vs ...customtypes.Uint8) predicate.OauthProvider { + v := make([]any, len(vs)) + for i := range v { + v[i] = uint8(vs[i]) + } + return predicate.OauthProvider(sql.FieldIn(FieldAuthStyle, v...)) +} + +// AuthStyleNotIn applies the NotIn predicate on the "auth_style" field. +func AuthStyleNotIn(vs ...customtypes.Uint8) predicate.OauthProvider { + v := make([]any, len(vs)) + for i := range v { + v[i] = uint8(vs[i]) + } + return predicate.OauthProvider(sql.FieldNotIn(FieldAuthStyle, v...)) +} + +// AuthStyleGT applies the GT predicate on the "auth_style" field. +func AuthStyleGT(v customtypes.Uint8) predicate.OauthProvider { + vc := uint8(v) + return predicate.OauthProvider(sql.FieldGT(FieldAuthStyle, vc)) +} + +// AuthStyleGTE applies the GTE predicate on the "auth_style" field. +func AuthStyleGTE(v customtypes.Uint8) predicate.OauthProvider { + vc := uint8(v) + return predicate.OauthProvider(sql.FieldGTE(FieldAuthStyle, vc)) +} + +// AuthStyleLT applies the LT predicate on the "auth_style" field. +func AuthStyleLT(v customtypes.Uint8) predicate.OauthProvider { + vc := uint8(v) + return predicate.OauthProvider(sql.FieldLT(FieldAuthStyle, vc)) +} + +// AuthStyleLTE applies the LTE predicate on the "auth_style" field. +func AuthStyleLTE(v customtypes.Uint8) predicate.OauthProvider { + vc := uint8(v) + return predicate.OauthProvider(sql.FieldLTE(FieldAuthStyle, vc)) +} + +// InfoURLEQ applies the EQ predicate on the "info_url" field. +func InfoURLEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEQ(FieldInfoURL, v)) +} + +// InfoURLNEQ applies the NEQ predicate on the "info_url" field. +func InfoURLNEQ(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNEQ(FieldInfoURL, v)) +} + +// InfoURLIn applies the In predicate on the "info_url" field. +func InfoURLIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldIn(FieldInfoURL, vs...)) +} + +// InfoURLNotIn applies the NotIn predicate on the "info_url" field. +func InfoURLNotIn(vs ...string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldNotIn(FieldInfoURL, vs...)) +} + +// InfoURLGT applies the GT predicate on the "info_url" field. +func InfoURLGT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGT(FieldInfoURL, v)) +} + +// InfoURLGTE applies the GTE predicate on the "info_url" field. +func InfoURLGTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldGTE(FieldInfoURL, v)) +} + +// InfoURLLT applies the LT predicate on the "info_url" field. +func InfoURLLT(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLT(FieldInfoURL, v)) +} + +// InfoURLLTE applies the LTE predicate on the "info_url" field. +func InfoURLLTE(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldLTE(FieldInfoURL, v)) +} + +// InfoURLContains applies the Contains predicate on the "info_url" field. +func InfoURLContains(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContains(FieldInfoURL, v)) +} + +// InfoURLHasPrefix applies the HasPrefix predicate on the "info_url" field. +func InfoURLHasPrefix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasPrefix(FieldInfoURL, v)) +} + +// InfoURLHasSuffix applies the HasSuffix predicate on the "info_url" field. +func InfoURLHasSuffix(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldHasSuffix(FieldInfoURL, v)) +} + +// InfoURLEqualFold applies the EqualFold predicate on the "info_url" field. +func InfoURLEqualFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldEqualFold(FieldInfoURL, v)) +} + +// InfoURLContainsFold applies the ContainsFold predicate on the "info_url" field. +func InfoURLContainsFold(v string) predicate.OauthProvider { + return predicate.OauthProvider(sql.FieldContainsFold(FieldInfoURL, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.OauthProvider { + return predicate.OauthProvider(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OauthProvider + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.OauthProvider { + return predicate.OauthProvider(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OauthProvider + 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.OauthProvider) predicate.OauthProvider { + return predicate.OauthProvider(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OauthProvider) predicate.OauthProvider { + return predicate.OauthProvider(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OauthProvider) predicate.OauthProvider { + return predicate.OauthProvider(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/oauthprovider_create.go b/internal/ent/generated/oauthprovider_create.go new file mode 100644 index 0000000..8098e2c --- /dev/null +++ b/internal/ent/generated/oauthprovider_create.go @@ -0,0 +1,532 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// OauthProviderCreate is the builder for creating a OauthProvider entity. +type OauthProviderCreate struct { + config + mutation *OauthProviderMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (opc *OauthProviderCreate) SetCreatedAt(t time.Time) *OauthProviderCreate { + opc.mutation.SetCreatedAt(t) + return opc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableCreatedAt(t *time.Time) *OauthProviderCreate { + if t != nil { + opc.SetCreatedAt(*t) + } + return opc +} + +// SetUpdatedAt sets the "updated_at" field. +func (opc *OauthProviderCreate) SetUpdatedAt(t time.Time) *OauthProviderCreate { + opc.mutation.SetUpdatedAt(t) + return opc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableUpdatedAt(t *time.Time) *OauthProviderCreate { + if t != nil { + opc.SetUpdatedAt(*t) + } + return opc +} + +// SetCreatedBy sets the "created_by" field. +func (opc *OauthProviderCreate) SetCreatedBy(s string) *OauthProviderCreate { + opc.mutation.SetCreatedBy(s) + return opc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableCreatedBy(s *string) *OauthProviderCreate { + if s != nil { + opc.SetCreatedBy(*s) + } + return opc +} + +// SetUpdatedBy sets the "updated_by" field. +func (opc *OauthProviderCreate) SetUpdatedBy(s string) *OauthProviderCreate { + opc.mutation.SetUpdatedBy(s) + return opc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableUpdatedBy(s *string) *OauthProviderCreate { + if s != nil { + opc.SetUpdatedBy(*s) + } + return opc +} + +// SetMappingID sets the "mapping_id" field. +func (opc *OauthProviderCreate) SetMappingID(s string) *OauthProviderCreate { + opc.mutation.SetMappingID(s) + return opc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableMappingID(s *string) *OauthProviderCreate { + if s != nil { + opc.SetMappingID(*s) + } + return opc +} + +// SetTags sets the "tags" field. +func (opc *OauthProviderCreate) SetTags(s []string) *OauthProviderCreate { + opc.mutation.SetTags(s) + return opc +} + +// SetDeletedAt sets the "deleted_at" field. +func (opc *OauthProviderCreate) SetDeletedAt(t time.Time) *OauthProviderCreate { + opc.mutation.SetDeletedAt(t) + return opc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableDeletedAt(t *time.Time) *OauthProviderCreate { + if t != nil { + opc.SetDeletedAt(*t) + } + return opc +} + +// SetDeletedBy sets the "deleted_by" field. +func (opc *OauthProviderCreate) SetDeletedBy(s string) *OauthProviderCreate { + opc.mutation.SetDeletedBy(s) + return opc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableDeletedBy(s *string) *OauthProviderCreate { + if s != nil { + opc.SetDeletedBy(*s) + } + return opc +} + +// SetOwnerID sets the "owner_id" field. +func (opc *OauthProviderCreate) SetOwnerID(s string) *OauthProviderCreate { + opc.mutation.SetOwnerID(s) + return opc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableOwnerID(s *string) *OauthProviderCreate { + if s != nil { + opc.SetOwnerID(*s) + } + return opc +} + +// SetName sets the "name" field. +func (opc *OauthProviderCreate) SetName(s string) *OauthProviderCreate { + opc.mutation.SetName(s) + return opc +} + +// SetClientID sets the "client_id" field. +func (opc *OauthProviderCreate) SetClientID(s string) *OauthProviderCreate { + opc.mutation.SetClientID(s) + return opc +} + +// SetClientSecret sets the "client_secret" field. +func (opc *OauthProviderCreate) SetClientSecret(s string) *OauthProviderCreate { + opc.mutation.SetClientSecret(s) + return opc +} + +// SetRedirectURL sets the "redirect_url" field. +func (opc *OauthProviderCreate) SetRedirectURL(s string) *OauthProviderCreate { + opc.mutation.SetRedirectURL(s) + return opc +} + +// SetScopes sets the "scopes" field. +func (opc *OauthProviderCreate) SetScopes(s string) *OauthProviderCreate { + opc.mutation.SetScopes(s) + return opc +} + +// SetAuthURL sets the "auth_url" field. +func (opc *OauthProviderCreate) SetAuthURL(s string) *OauthProviderCreate { + opc.mutation.SetAuthURL(s) + return opc +} + +// SetTokenURL sets the "token_url" field. +func (opc *OauthProviderCreate) SetTokenURL(s string) *OauthProviderCreate { + opc.mutation.SetTokenURL(s) + return opc +} + +// SetAuthStyle sets the "auth_style" field. +func (opc *OauthProviderCreate) SetAuthStyle(c customtypes.Uint8) *OauthProviderCreate { + opc.mutation.SetAuthStyle(c) + return opc +} + +// SetInfoURL sets the "info_url" field. +func (opc *OauthProviderCreate) SetInfoURL(s string) *OauthProviderCreate { + opc.mutation.SetInfoURL(s) + return opc +} + +// SetID sets the "id" field. +func (opc *OauthProviderCreate) SetID(s string) *OauthProviderCreate { + opc.mutation.SetID(s) + return opc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (opc *OauthProviderCreate) SetNillableID(s *string) *OauthProviderCreate { + if s != nil { + opc.SetID(*s) + } + return opc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (opc *OauthProviderCreate) SetOwner(o *Organization) *OauthProviderCreate { + return opc.SetOwnerID(o.ID) +} + +// Mutation returns the OauthProviderMutation object of the builder. +func (opc *OauthProviderCreate) Mutation() *OauthProviderMutation { + return opc.mutation +} + +// Save creates the OauthProvider in the database. +func (opc *OauthProviderCreate) Save(ctx context.Context) (*OauthProvider, error) { + if err := opc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, opc.sqlSave, opc.mutation, opc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (opc *OauthProviderCreate) SaveX(ctx context.Context) *OauthProvider { + v, err := opc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (opc *OauthProviderCreate) Exec(ctx context.Context) error { + _, err := opc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (opc *OauthProviderCreate) ExecX(ctx context.Context) { + if err := opc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (opc *OauthProviderCreate) defaults() error { + if _, ok := opc.mutation.CreatedAt(); !ok { + if oauthprovider.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthprovider.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := oauthprovider.DefaultCreatedAt() + opc.mutation.SetCreatedAt(v) + } + if _, ok := opc.mutation.UpdatedAt(); !ok { + if oauthprovider.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthprovider.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := oauthprovider.DefaultUpdatedAt() + opc.mutation.SetUpdatedAt(v) + } + if _, ok := opc.mutation.MappingID(); !ok { + if oauthprovider.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized oauthprovider.DefaultMappingID (forgotten import generated/runtime?)") + } + v := oauthprovider.DefaultMappingID() + opc.mutation.SetMappingID(v) + } + if _, ok := opc.mutation.Tags(); !ok { + v := oauthprovider.DefaultTags + opc.mutation.SetTags(v) + } + if _, ok := opc.mutation.ID(); !ok { + if oauthprovider.DefaultID == nil { + return fmt.Errorf("generated: uninitialized oauthprovider.DefaultID (forgotten import generated/runtime?)") + } + v := oauthprovider.DefaultID() + opc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (opc *OauthProviderCreate) check() error { + if _, ok := opc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OauthProvider.mapping_id"`)} + } + if v, ok := opc.mutation.OwnerID(); ok { + if err := oauthprovider.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "OauthProvider.owner_id": %w`, err)} + } + } + if _, ok := opc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "OauthProvider.name"`)} + } + if _, ok := opc.mutation.ClientID(); !ok { + return &ValidationError{Name: "client_id", err: errors.New(`generated: missing required field "OauthProvider.client_id"`)} + } + if _, ok := opc.mutation.ClientSecret(); !ok { + return &ValidationError{Name: "client_secret", err: errors.New(`generated: missing required field "OauthProvider.client_secret"`)} + } + if _, ok := opc.mutation.RedirectURL(); !ok { + return &ValidationError{Name: "redirect_url", err: errors.New(`generated: missing required field "OauthProvider.redirect_url"`)} + } + if _, ok := opc.mutation.Scopes(); !ok { + return &ValidationError{Name: "scopes", err: errors.New(`generated: missing required field "OauthProvider.scopes"`)} + } + if _, ok := opc.mutation.AuthURL(); !ok { + return &ValidationError{Name: "auth_url", err: errors.New(`generated: missing required field "OauthProvider.auth_url"`)} + } + if _, ok := opc.mutation.TokenURL(); !ok { + return &ValidationError{Name: "token_url", err: errors.New(`generated: missing required field "OauthProvider.token_url"`)} + } + if _, ok := opc.mutation.AuthStyle(); !ok { + return &ValidationError{Name: "auth_style", err: errors.New(`generated: missing required field "OauthProvider.auth_style"`)} + } + if _, ok := opc.mutation.InfoURL(); !ok { + return &ValidationError{Name: "info_url", err: errors.New(`generated: missing required field "OauthProvider.info_url"`)} + } + return nil +} + +func (opc *OauthProviderCreate) sqlSave(ctx context.Context) (*OauthProvider, error) { + if err := opc.check(); err != nil { + return nil, err + } + _node, _spec := opc.createSpec() + if err := sqlgraph.CreateNode(ctx, opc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OauthProvider.ID type: %T", _spec.ID.Value) + } + } + opc.mutation.id = &_node.ID + opc.mutation.done = true + return _node, nil +} + +func (opc *OauthProviderCreate) createSpec() (*OauthProvider, *sqlgraph.CreateSpec) { + var ( + _node = &OauthProvider{config: opc.config} + _spec = sqlgraph.NewCreateSpec(oauthprovider.Table, sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString)) + ) + _spec.Schema = opc.schemaConfig.OauthProvider + if id, ok := opc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := opc.mutation.CreatedAt(); ok { + _spec.SetField(oauthprovider.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := opc.mutation.UpdatedAt(); ok { + _spec.SetField(oauthprovider.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := opc.mutation.CreatedBy(); ok { + _spec.SetField(oauthprovider.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := opc.mutation.UpdatedBy(); ok { + _spec.SetField(oauthprovider.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := opc.mutation.MappingID(); ok { + _spec.SetField(oauthprovider.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := opc.mutation.Tags(); ok { + _spec.SetField(oauthprovider.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := opc.mutation.DeletedAt(); ok { + _spec.SetField(oauthprovider.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := opc.mutation.DeletedBy(); ok { + _spec.SetField(oauthprovider.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := opc.mutation.Name(); ok { + _spec.SetField(oauthprovider.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := opc.mutation.ClientID(); ok { + _spec.SetField(oauthprovider.FieldClientID, field.TypeString, value) + _node.ClientID = value + } + if value, ok := opc.mutation.ClientSecret(); ok { + _spec.SetField(oauthprovider.FieldClientSecret, field.TypeString, value) + _node.ClientSecret = value + } + if value, ok := opc.mutation.RedirectURL(); ok { + _spec.SetField(oauthprovider.FieldRedirectURL, field.TypeString, value) + _node.RedirectURL = value + } + if value, ok := opc.mutation.Scopes(); ok { + _spec.SetField(oauthprovider.FieldScopes, field.TypeString, value) + _node.Scopes = value + } + if value, ok := opc.mutation.AuthURL(); ok { + _spec.SetField(oauthprovider.FieldAuthURL, field.TypeString, value) + _node.AuthURL = value + } + if value, ok := opc.mutation.TokenURL(); ok { + _spec.SetField(oauthprovider.FieldTokenURL, field.TypeString, value) + _node.TokenURL = value + } + if value, ok := opc.mutation.AuthStyle(); ok { + _spec.SetField(oauthprovider.FieldAuthStyle, field.TypeUint8, value) + _node.AuthStyle = value + } + if value, ok := opc.mutation.InfoURL(); ok { + _spec.SetField(oauthprovider.FieldInfoURL, field.TypeString, value) + _node.InfoURL = value + } + if nodes := opc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: oauthprovider.OwnerTable, + Columns: []string{oauthprovider.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = opc.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OauthProviderCreateBulk is the builder for creating many OauthProvider entities in bulk. +type OauthProviderCreateBulk struct { + config + err error + builders []*OauthProviderCreate +} + +// Save creates the OauthProvider entities in the database. +func (opcb *OauthProviderCreateBulk) Save(ctx context.Context) ([]*OauthProvider, error) { + if opcb.err != nil { + return nil, opcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(opcb.builders)) + nodes := make([]*OauthProvider, len(opcb.builders)) + mutators := make([]Mutator, len(opcb.builders)) + for i := range opcb.builders { + func(i int, root context.Context) { + builder := opcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OauthProviderMutation) + 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, opcb.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, opcb.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, opcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (opcb *OauthProviderCreateBulk) SaveX(ctx context.Context) []*OauthProvider { + v, err := opcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (opcb *OauthProviderCreateBulk) Exec(ctx context.Context) error { + _, err := opcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (opcb *OauthProviderCreateBulk) ExecX(ctx context.Context) { + if err := opcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/oauthprovider_delete.go b/internal/ent/generated/oauthprovider_delete.go new file mode 100644 index 0000000..0359812 --- /dev/null +++ b/internal/ent/generated/oauthprovider_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" +) + +// OauthProviderDelete is the builder for deleting a OauthProvider entity. +type OauthProviderDelete struct { + config + hooks []Hook + mutation *OauthProviderMutation +} + +// Where appends a list predicates to the OauthProviderDelete builder. +func (opd *OauthProviderDelete) Where(ps ...predicate.OauthProvider) *OauthProviderDelete { + opd.mutation.Where(ps...) + return opd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (opd *OauthProviderDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, opd.sqlExec, opd.mutation, opd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (opd *OauthProviderDelete) ExecX(ctx context.Context) int { + n, err := opd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (opd *OauthProviderDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(oauthprovider.Table, sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString)) + _spec.Node.Schema = opd.schemaConfig.OauthProvider + ctx = internal.NewSchemaConfigContext(ctx, opd.schemaConfig) + if ps := opd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, opd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + opd.mutation.done = true + return affected, err +} + +// OauthProviderDeleteOne is the builder for deleting a single OauthProvider entity. +type OauthProviderDeleteOne struct { + opd *OauthProviderDelete +} + +// Where appends a list predicates to the OauthProviderDelete builder. +func (opdo *OauthProviderDeleteOne) Where(ps ...predicate.OauthProvider) *OauthProviderDeleteOne { + opdo.opd.mutation.Where(ps...) + return opdo +} + +// Exec executes the deletion query. +func (opdo *OauthProviderDeleteOne) Exec(ctx context.Context) error { + n, err := opdo.opd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{oauthprovider.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (opdo *OauthProviderDeleteOne) ExecX(ctx context.Context) { + if err := opdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/oauthprovider_query.go b/internal/ent/generated/oauthprovider_query.go new file mode 100644 index 0000000..0b9d0a9 --- /dev/null +++ b/internal/ent/generated/oauthprovider_query.go @@ -0,0 +1,638 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OauthProviderQuery is the builder for querying OauthProvider entities. +type OauthProviderQuery struct { + config + ctx *QueryContext + order []oauthprovider.OrderOption + inters []Interceptor + predicates []predicate.OauthProvider + withOwner *OrganizationQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OauthProvider) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OauthProviderQuery builder. +func (opq *OauthProviderQuery) Where(ps ...predicate.OauthProvider) *OauthProviderQuery { + opq.predicates = append(opq.predicates, ps...) + return opq +} + +// Limit the number of records to be returned by this query. +func (opq *OauthProviderQuery) Limit(limit int) *OauthProviderQuery { + opq.ctx.Limit = &limit + return opq +} + +// Offset to start from. +func (opq *OauthProviderQuery) Offset(offset int) *OauthProviderQuery { + opq.ctx.Offset = &offset + return opq +} + +// 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 (opq *OauthProviderQuery) Unique(unique bool) *OauthProviderQuery { + opq.ctx.Unique = &unique + return opq +} + +// Order specifies how the records should be ordered. +func (opq *OauthProviderQuery) Order(o ...oauthprovider.OrderOption) *OauthProviderQuery { + opq.order = append(opq.order, o...) + return opq +} + +// QueryOwner chains the current query on the "owner" edge. +func (opq *OauthProviderQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: opq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := opq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := opq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(oauthprovider.Table, oauthprovider.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, oauthprovider.OwnerTable, oauthprovider.OwnerColumn), + ) + schemaConfig := opq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OauthProvider + fromU = sqlgraph.SetNeighbors(opq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first OauthProvider entity from the query. +// Returns a *NotFoundError when no OauthProvider was found. +func (opq *OauthProviderQuery) First(ctx context.Context) (*OauthProvider, error) { + nodes, err := opq.Limit(1).All(setContextOp(ctx, opq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{oauthprovider.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (opq *OauthProviderQuery) FirstX(ctx context.Context) *OauthProvider { + node, err := opq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OauthProvider ID from the query. +// Returns a *NotFoundError when no OauthProvider ID was found. +func (opq *OauthProviderQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = opq.Limit(1).IDs(setContextOp(ctx, opq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{oauthprovider.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (opq *OauthProviderQuery) FirstIDX(ctx context.Context) string { + id, err := opq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OauthProvider entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OauthProvider entity is found. +// Returns a *NotFoundError when no OauthProvider entities are found. +func (opq *OauthProviderQuery) Only(ctx context.Context) (*OauthProvider, error) { + nodes, err := opq.Limit(2).All(setContextOp(ctx, opq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{oauthprovider.Label} + default: + return nil, &NotSingularError{oauthprovider.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (opq *OauthProviderQuery) OnlyX(ctx context.Context) *OauthProvider { + node, err := opq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OauthProvider ID in the query. +// Returns a *NotSingularError when more than one OauthProvider ID is found. +// Returns a *NotFoundError when no entities are found. +func (opq *OauthProviderQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = opq.Limit(2).IDs(setContextOp(ctx, opq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{oauthprovider.Label} + default: + err = &NotSingularError{oauthprovider.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (opq *OauthProviderQuery) OnlyIDX(ctx context.Context) string { + id, err := opq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OauthProviders. +func (opq *OauthProviderQuery) All(ctx context.Context) ([]*OauthProvider, error) { + ctx = setContextOp(ctx, opq.ctx, ent.OpQueryAll) + if err := opq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OauthProvider, *OauthProviderQuery]() + return withInterceptors[[]*OauthProvider](ctx, opq, qr, opq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (opq *OauthProviderQuery) AllX(ctx context.Context) []*OauthProvider { + nodes, err := opq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OauthProvider IDs. +func (opq *OauthProviderQuery) IDs(ctx context.Context) (ids []string, err error) { + if opq.ctx.Unique == nil && opq.path != nil { + opq.Unique(true) + } + ctx = setContextOp(ctx, opq.ctx, ent.OpQueryIDs) + if err = opq.Select(oauthprovider.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (opq *OauthProviderQuery) IDsX(ctx context.Context) []string { + ids, err := opq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (opq *OauthProviderQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, opq.ctx, ent.OpQueryCount) + if err := opq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, opq, querierCount[*OauthProviderQuery](), opq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (opq *OauthProviderQuery) CountX(ctx context.Context) int { + count, err := opq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (opq *OauthProviderQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, opq.ctx, ent.OpQueryExist) + switch _, err := opq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (opq *OauthProviderQuery) ExistX(ctx context.Context) bool { + exist, err := opq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OauthProviderQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (opq *OauthProviderQuery) Clone() *OauthProviderQuery { + if opq == nil { + return nil + } + return &OauthProviderQuery{ + config: opq.config, + ctx: opq.ctx.Clone(), + order: append([]oauthprovider.OrderOption{}, opq.order...), + inters: append([]Interceptor{}, opq.inters...), + predicates: append([]predicate.OauthProvider{}, opq.predicates...), + withOwner: opq.withOwner.Clone(), + // clone intermediate query. + sql: opq.sql.Clone(), + path: opq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (opq *OauthProviderQuery) WithOwner(opts ...func(*OrganizationQuery)) *OauthProviderQuery { + query := (&OrganizationClient{config: opq.config}).Query() + for _, opt := range opts { + opt(query) + } + opq.withOwner = query + return opq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OauthProvider.Query(). +// GroupBy(oauthprovider.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (opq *OauthProviderQuery) GroupBy(field string, fields ...string) *OauthProviderGroupBy { + opq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OauthProviderGroupBy{build: opq} + grbuild.flds = &opq.ctx.Fields + grbuild.label = oauthprovider.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.OauthProvider.Query(). +// Select(oauthprovider.FieldCreatedAt). +// Scan(ctx, &v) +func (opq *OauthProviderQuery) Select(fields ...string) *OauthProviderSelect { + opq.ctx.Fields = append(opq.ctx.Fields, fields...) + sbuild := &OauthProviderSelect{OauthProviderQuery: opq} + sbuild.label = oauthprovider.Label + sbuild.flds, sbuild.scan = &opq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OauthProviderSelect configured with the given aggregations. +func (opq *OauthProviderQuery) Aggregate(fns ...AggregateFunc) *OauthProviderSelect { + return opq.Select().Aggregate(fns...) +} + +func (opq *OauthProviderQuery) prepareQuery(ctx context.Context) error { + for _, inter := range opq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, opq); err != nil { + return err + } + } + } + for _, f := range opq.ctx.Fields { + if !oauthprovider.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if opq.path != nil { + prev, err := opq.path(ctx) + if err != nil { + return err + } + opq.sql = prev + } + if oauthprovider.Policy == nil { + return errors.New("generated: uninitialized oauthprovider.Policy (forgotten import generated/runtime?)") + } + if err := oauthprovider.Policy.EvalQuery(ctx, opq); err != nil { + return err + } + return nil +} + +func (opq *OauthProviderQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OauthProvider, error) { + var ( + nodes = []*OauthProvider{} + _spec = opq.querySpec() + loadedTypes = [1]bool{ + opq.withOwner != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OauthProvider).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OauthProvider{config: opq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = opq.schemaConfig.OauthProvider + ctx = internal.NewSchemaConfigContext(ctx, opq.schemaConfig) + if len(opq.modifiers) > 0 { + _spec.Modifiers = opq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, opq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := opq.withOwner; query != nil { + if err := opq.loadOwner(ctx, query, nodes, nil, + func(n *OauthProvider, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + for i := range opq.loadTotal { + if err := opq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (opq *OauthProviderQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*OauthProvider, init func(*OauthProvider), assign func(*OauthProvider, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*OauthProvider) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (opq *OauthProviderQuery) sqlCount(ctx context.Context) (int, error) { + _spec := opq.querySpec() + _spec.Node.Schema = opq.schemaConfig.OauthProvider + ctx = internal.NewSchemaConfigContext(ctx, opq.schemaConfig) + if len(opq.modifiers) > 0 { + _spec.Modifiers = opq.modifiers + } + _spec.Node.Columns = opq.ctx.Fields + if len(opq.ctx.Fields) > 0 { + _spec.Unique = opq.ctx.Unique != nil && *opq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, opq.driver, _spec) +} + +func (opq *OauthProviderQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(oauthprovider.Table, oauthprovider.Columns, sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString)) + _spec.From = opq.sql + if unique := opq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if opq.path != nil { + _spec.Unique = true + } + if fields := opq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, oauthprovider.FieldID) + for i := range fields { + if fields[i] != oauthprovider.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if opq.withOwner != nil { + _spec.Node.AddColumnOnce(oauthprovider.FieldOwnerID) + } + } + if ps := opq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := opq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := opq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := opq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (opq *OauthProviderQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(opq.driver.Dialect()) + t1 := builder.Table(oauthprovider.Table) + columns := opq.ctx.Fields + if len(columns) == 0 { + columns = oauthprovider.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if opq.sql != nil { + selector = opq.sql + selector.Select(selector.Columns(columns...)...) + } + if opq.ctx.Unique != nil && *opq.ctx.Unique { + selector.Distinct() + } + t1.Schema(opq.schemaConfig.OauthProvider) + ctx = internal.NewSchemaConfigContext(ctx, opq.schemaConfig) + selector.WithContext(ctx) + for _, p := range opq.predicates { + p(selector) + } + for _, p := range opq.order { + p(selector) + } + if offset := opq.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 := opq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// OauthProviderGroupBy is the group-by builder for OauthProvider entities. +type OauthProviderGroupBy struct { + selector + build *OauthProviderQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (opgb *OauthProviderGroupBy) Aggregate(fns ...AggregateFunc) *OauthProviderGroupBy { + opgb.fns = append(opgb.fns, fns...) + return opgb +} + +// Scan applies the selector query and scans the result into the given value. +func (opgb *OauthProviderGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, opgb.build.ctx, ent.OpQueryGroupBy) + if err := opgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OauthProviderQuery, *OauthProviderGroupBy](ctx, opgb.build, opgb, opgb.build.inters, v) +} + +func (opgb *OauthProviderGroupBy) sqlScan(ctx context.Context, root *OauthProviderQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(opgb.fns)) + for _, fn := range opgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*opgb.flds)+len(opgb.fns)) + for _, f := range *opgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*opgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := opgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OauthProviderSelect is the builder for selecting fields of OauthProvider entities. +type OauthProviderSelect struct { + *OauthProviderQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ops *OauthProviderSelect) Aggregate(fns ...AggregateFunc) *OauthProviderSelect { + ops.fns = append(ops.fns, fns...) + return ops +} + +// Scan applies the selector query and scans the result into the given value. +func (ops *OauthProviderSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ops.ctx, ent.OpQuerySelect) + if err := ops.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OauthProviderQuery, *OauthProviderSelect](ctx, ops.OauthProviderQuery, ops, ops.inters, v) +} + +func (ops *OauthProviderSelect) sqlScan(ctx context.Context, root *OauthProviderQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ops.fns)) + for _, fn := range ops.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ops.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 := ops.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/oauthprovider_update.go b/internal/ent/generated/oauthprovider_update.go new file mode 100644 index 0000000..ae5f797 --- /dev/null +++ b/internal/ent/generated/oauthprovider_update.go @@ -0,0 +1,953 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OauthProviderUpdate is the builder for updating OauthProvider entities. +type OauthProviderUpdate struct { + config + hooks []Hook + mutation *OauthProviderMutation +} + +// Where appends a list predicates to the OauthProviderUpdate builder. +func (opu *OauthProviderUpdate) Where(ps ...predicate.OauthProvider) *OauthProviderUpdate { + opu.mutation.Where(ps...) + return opu +} + +// SetUpdatedAt sets the "updated_at" field. +func (opu *OauthProviderUpdate) SetUpdatedAt(t time.Time) *OauthProviderUpdate { + opu.mutation.SetUpdatedAt(t) + return opu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (opu *OauthProviderUpdate) ClearUpdatedAt() *OauthProviderUpdate { + opu.mutation.ClearUpdatedAt() + return opu +} + +// SetUpdatedBy sets the "updated_by" field. +func (opu *OauthProviderUpdate) SetUpdatedBy(s string) *OauthProviderUpdate { + opu.mutation.SetUpdatedBy(s) + return opu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableUpdatedBy(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetUpdatedBy(*s) + } + return opu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (opu *OauthProviderUpdate) ClearUpdatedBy() *OauthProviderUpdate { + opu.mutation.ClearUpdatedBy() + return opu +} + +// SetTags sets the "tags" field. +func (opu *OauthProviderUpdate) SetTags(s []string) *OauthProviderUpdate { + opu.mutation.SetTags(s) + return opu +} + +// AppendTags appends s to the "tags" field. +func (opu *OauthProviderUpdate) AppendTags(s []string) *OauthProviderUpdate { + opu.mutation.AppendTags(s) + return opu +} + +// ClearTags clears the value of the "tags" field. +func (opu *OauthProviderUpdate) ClearTags() *OauthProviderUpdate { + opu.mutation.ClearTags() + return opu +} + +// SetDeletedAt sets the "deleted_at" field. +func (opu *OauthProviderUpdate) SetDeletedAt(t time.Time) *OauthProviderUpdate { + opu.mutation.SetDeletedAt(t) + return opu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableDeletedAt(t *time.Time) *OauthProviderUpdate { + if t != nil { + opu.SetDeletedAt(*t) + } + return opu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (opu *OauthProviderUpdate) ClearDeletedAt() *OauthProviderUpdate { + opu.mutation.ClearDeletedAt() + return opu +} + +// SetDeletedBy sets the "deleted_by" field. +func (opu *OauthProviderUpdate) SetDeletedBy(s string) *OauthProviderUpdate { + opu.mutation.SetDeletedBy(s) + return opu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableDeletedBy(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetDeletedBy(*s) + } + return opu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (opu *OauthProviderUpdate) ClearDeletedBy() *OauthProviderUpdate { + opu.mutation.ClearDeletedBy() + return opu +} + +// SetOwnerID sets the "owner_id" field. +func (opu *OauthProviderUpdate) SetOwnerID(s string) *OauthProviderUpdate { + opu.mutation.SetOwnerID(s) + return opu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableOwnerID(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetOwnerID(*s) + } + return opu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (opu *OauthProviderUpdate) ClearOwnerID() *OauthProviderUpdate { + opu.mutation.ClearOwnerID() + return opu +} + +// SetName sets the "name" field. +func (opu *OauthProviderUpdate) SetName(s string) *OauthProviderUpdate { + opu.mutation.SetName(s) + return opu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableName(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetName(*s) + } + return opu +} + +// SetClientID sets the "client_id" field. +func (opu *OauthProviderUpdate) SetClientID(s string) *OauthProviderUpdate { + opu.mutation.SetClientID(s) + return opu +} + +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableClientID(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetClientID(*s) + } + return opu +} + +// SetClientSecret sets the "client_secret" field. +func (opu *OauthProviderUpdate) SetClientSecret(s string) *OauthProviderUpdate { + opu.mutation.SetClientSecret(s) + return opu +} + +// SetNillableClientSecret sets the "client_secret" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableClientSecret(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetClientSecret(*s) + } + return opu +} + +// SetRedirectURL sets the "redirect_url" field. +func (opu *OauthProviderUpdate) SetRedirectURL(s string) *OauthProviderUpdate { + opu.mutation.SetRedirectURL(s) + return opu +} + +// SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableRedirectURL(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetRedirectURL(*s) + } + return opu +} + +// SetScopes sets the "scopes" field. +func (opu *OauthProviderUpdate) SetScopes(s string) *OauthProviderUpdate { + opu.mutation.SetScopes(s) + return opu +} + +// SetNillableScopes sets the "scopes" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableScopes(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetScopes(*s) + } + return opu +} + +// SetAuthURL sets the "auth_url" field. +func (opu *OauthProviderUpdate) SetAuthURL(s string) *OauthProviderUpdate { + opu.mutation.SetAuthURL(s) + return opu +} + +// SetNillableAuthURL sets the "auth_url" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableAuthURL(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetAuthURL(*s) + } + return opu +} + +// SetTokenURL sets the "token_url" field. +func (opu *OauthProviderUpdate) SetTokenURL(s string) *OauthProviderUpdate { + opu.mutation.SetTokenURL(s) + return opu +} + +// SetNillableTokenURL sets the "token_url" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableTokenURL(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetTokenURL(*s) + } + return opu +} + +// SetAuthStyle sets the "auth_style" field. +func (opu *OauthProviderUpdate) SetAuthStyle(c customtypes.Uint8) *OauthProviderUpdate { + opu.mutation.ResetAuthStyle() + opu.mutation.SetAuthStyle(c) + return opu +} + +// SetNillableAuthStyle sets the "auth_style" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableAuthStyle(c *customtypes.Uint8) *OauthProviderUpdate { + if c != nil { + opu.SetAuthStyle(*c) + } + return opu +} + +// AddAuthStyle adds c to the "auth_style" field. +func (opu *OauthProviderUpdate) AddAuthStyle(c customtypes.Uint8) *OauthProviderUpdate { + opu.mutation.AddAuthStyle(c) + return opu +} + +// SetInfoURL sets the "info_url" field. +func (opu *OauthProviderUpdate) SetInfoURL(s string) *OauthProviderUpdate { + opu.mutation.SetInfoURL(s) + return opu +} + +// SetNillableInfoURL sets the "info_url" field if the given value is not nil. +func (opu *OauthProviderUpdate) SetNillableInfoURL(s *string) *OauthProviderUpdate { + if s != nil { + opu.SetInfoURL(*s) + } + return opu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (opu *OauthProviderUpdate) SetOwner(o *Organization) *OauthProviderUpdate { + return opu.SetOwnerID(o.ID) +} + +// Mutation returns the OauthProviderMutation object of the builder. +func (opu *OauthProviderUpdate) Mutation() *OauthProviderMutation { + return opu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (opu *OauthProviderUpdate) ClearOwner() *OauthProviderUpdate { + opu.mutation.ClearOwner() + return opu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (opu *OauthProviderUpdate) Save(ctx context.Context) (int, error) { + if err := opu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, opu.sqlSave, opu.mutation, opu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (opu *OauthProviderUpdate) SaveX(ctx context.Context) int { + affected, err := opu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (opu *OauthProviderUpdate) Exec(ctx context.Context) error { + _, err := opu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (opu *OauthProviderUpdate) ExecX(ctx context.Context) { + if err := opu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (opu *OauthProviderUpdate) defaults() error { + if _, ok := opu.mutation.UpdatedAt(); !ok && !opu.mutation.UpdatedAtCleared() { + if oauthprovider.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthprovider.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := oauthprovider.UpdateDefaultUpdatedAt() + opu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (opu *OauthProviderUpdate) check() error { + if v, ok := opu.mutation.OwnerID(); ok { + if err := oauthprovider.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "OauthProvider.owner_id": %w`, err)} + } + } + return nil +} + +func (opu *OauthProviderUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := opu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(oauthprovider.Table, oauthprovider.Columns, sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString)) + if ps := opu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if opu.mutation.CreatedAtCleared() { + _spec.ClearField(oauthprovider.FieldCreatedAt, field.TypeTime) + } + if value, ok := opu.mutation.UpdatedAt(); ok { + _spec.SetField(oauthprovider.FieldUpdatedAt, field.TypeTime, value) + } + if opu.mutation.UpdatedAtCleared() { + _spec.ClearField(oauthprovider.FieldUpdatedAt, field.TypeTime) + } + if opu.mutation.CreatedByCleared() { + _spec.ClearField(oauthprovider.FieldCreatedBy, field.TypeString) + } + if value, ok := opu.mutation.UpdatedBy(); ok { + _spec.SetField(oauthprovider.FieldUpdatedBy, field.TypeString, value) + } + if opu.mutation.UpdatedByCleared() { + _spec.ClearField(oauthprovider.FieldUpdatedBy, field.TypeString) + } + if value, ok := opu.mutation.Tags(); ok { + _spec.SetField(oauthprovider.FieldTags, field.TypeJSON, value) + } + if value, ok := opu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, oauthprovider.FieldTags, value) + }) + } + if opu.mutation.TagsCleared() { + _spec.ClearField(oauthprovider.FieldTags, field.TypeJSON) + } + if value, ok := opu.mutation.DeletedAt(); ok { + _spec.SetField(oauthprovider.FieldDeletedAt, field.TypeTime, value) + } + if opu.mutation.DeletedAtCleared() { + _spec.ClearField(oauthprovider.FieldDeletedAt, field.TypeTime) + } + if value, ok := opu.mutation.DeletedBy(); ok { + _spec.SetField(oauthprovider.FieldDeletedBy, field.TypeString, value) + } + if opu.mutation.DeletedByCleared() { + _spec.ClearField(oauthprovider.FieldDeletedBy, field.TypeString) + } + if value, ok := opu.mutation.Name(); ok { + _spec.SetField(oauthprovider.FieldName, field.TypeString, value) + } + if value, ok := opu.mutation.ClientID(); ok { + _spec.SetField(oauthprovider.FieldClientID, field.TypeString, value) + } + if value, ok := opu.mutation.ClientSecret(); ok { + _spec.SetField(oauthprovider.FieldClientSecret, field.TypeString, value) + } + if value, ok := opu.mutation.RedirectURL(); ok { + _spec.SetField(oauthprovider.FieldRedirectURL, field.TypeString, value) + } + if value, ok := opu.mutation.Scopes(); ok { + _spec.SetField(oauthprovider.FieldScopes, field.TypeString, value) + } + if value, ok := opu.mutation.AuthURL(); ok { + _spec.SetField(oauthprovider.FieldAuthURL, field.TypeString, value) + } + if value, ok := opu.mutation.TokenURL(); ok { + _spec.SetField(oauthprovider.FieldTokenURL, field.TypeString, value) + } + if value, ok := opu.mutation.AuthStyle(); ok { + _spec.SetField(oauthprovider.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := opu.mutation.AddedAuthStyle(); ok { + _spec.AddField(oauthprovider.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := opu.mutation.InfoURL(); ok { + _spec.SetField(oauthprovider.FieldInfoURL, field.TypeString, value) + } + if opu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: oauthprovider.OwnerTable, + Columns: []string{oauthprovider.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = opu.schemaConfig.OauthProvider + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := opu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: oauthprovider.OwnerTable, + Columns: []string{oauthprovider.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = opu.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = opu.schemaConfig.OauthProvider + ctx = internal.NewSchemaConfigContext(ctx, opu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, opu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{oauthprovider.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + opu.mutation.done = true + return n, nil +} + +// OauthProviderUpdateOne is the builder for updating a single OauthProvider entity. +type OauthProviderUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OauthProviderMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (opuo *OauthProviderUpdateOne) SetUpdatedAt(t time.Time) *OauthProviderUpdateOne { + opuo.mutation.SetUpdatedAt(t) + return opuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (opuo *OauthProviderUpdateOne) ClearUpdatedAt() *OauthProviderUpdateOne { + opuo.mutation.ClearUpdatedAt() + return opuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (opuo *OauthProviderUpdateOne) SetUpdatedBy(s string) *OauthProviderUpdateOne { + opuo.mutation.SetUpdatedBy(s) + return opuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableUpdatedBy(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetUpdatedBy(*s) + } + return opuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (opuo *OauthProviderUpdateOne) ClearUpdatedBy() *OauthProviderUpdateOne { + opuo.mutation.ClearUpdatedBy() + return opuo +} + +// SetTags sets the "tags" field. +func (opuo *OauthProviderUpdateOne) SetTags(s []string) *OauthProviderUpdateOne { + opuo.mutation.SetTags(s) + return opuo +} + +// AppendTags appends s to the "tags" field. +func (opuo *OauthProviderUpdateOne) AppendTags(s []string) *OauthProviderUpdateOne { + opuo.mutation.AppendTags(s) + return opuo +} + +// ClearTags clears the value of the "tags" field. +func (opuo *OauthProviderUpdateOne) ClearTags() *OauthProviderUpdateOne { + opuo.mutation.ClearTags() + return opuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (opuo *OauthProviderUpdateOne) SetDeletedAt(t time.Time) *OauthProviderUpdateOne { + opuo.mutation.SetDeletedAt(t) + return opuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableDeletedAt(t *time.Time) *OauthProviderUpdateOne { + if t != nil { + opuo.SetDeletedAt(*t) + } + return opuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (opuo *OauthProviderUpdateOne) ClearDeletedAt() *OauthProviderUpdateOne { + opuo.mutation.ClearDeletedAt() + return opuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (opuo *OauthProviderUpdateOne) SetDeletedBy(s string) *OauthProviderUpdateOne { + opuo.mutation.SetDeletedBy(s) + return opuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableDeletedBy(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetDeletedBy(*s) + } + return opuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (opuo *OauthProviderUpdateOne) ClearDeletedBy() *OauthProviderUpdateOne { + opuo.mutation.ClearDeletedBy() + return opuo +} + +// SetOwnerID sets the "owner_id" field. +func (opuo *OauthProviderUpdateOne) SetOwnerID(s string) *OauthProviderUpdateOne { + opuo.mutation.SetOwnerID(s) + return opuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableOwnerID(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetOwnerID(*s) + } + return opuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (opuo *OauthProviderUpdateOne) ClearOwnerID() *OauthProviderUpdateOne { + opuo.mutation.ClearOwnerID() + return opuo +} + +// SetName sets the "name" field. +func (opuo *OauthProviderUpdateOne) SetName(s string) *OauthProviderUpdateOne { + opuo.mutation.SetName(s) + return opuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableName(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetName(*s) + } + return opuo +} + +// SetClientID sets the "client_id" field. +func (opuo *OauthProviderUpdateOne) SetClientID(s string) *OauthProviderUpdateOne { + opuo.mutation.SetClientID(s) + return opuo +} + +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableClientID(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetClientID(*s) + } + return opuo +} + +// SetClientSecret sets the "client_secret" field. +func (opuo *OauthProviderUpdateOne) SetClientSecret(s string) *OauthProviderUpdateOne { + opuo.mutation.SetClientSecret(s) + return opuo +} + +// SetNillableClientSecret sets the "client_secret" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableClientSecret(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetClientSecret(*s) + } + return opuo +} + +// SetRedirectURL sets the "redirect_url" field. +func (opuo *OauthProviderUpdateOne) SetRedirectURL(s string) *OauthProviderUpdateOne { + opuo.mutation.SetRedirectURL(s) + return opuo +} + +// SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableRedirectURL(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetRedirectURL(*s) + } + return opuo +} + +// SetScopes sets the "scopes" field. +func (opuo *OauthProviderUpdateOne) SetScopes(s string) *OauthProviderUpdateOne { + opuo.mutation.SetScopes(s) + return opuo +} + +// SetNillableScopes sets the "scopes" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableScopes(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetScopes(*s) + } + return opuo +} + +// SetAuthURL sets the "auth_url" field. +func (opuo *OauthProviderUpdateOne) SetAuthURL(s string) *OauthProviderUpdateOne { + opuo.mutation.SetAuthURL(s) + return opuo +} + +// SetNillableAuthURL sets the "auth_url" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableAuthURL(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetAuthURL(*s) + } + return opuo +} + +// SetTokenURL sets the "token_url" field. +func (opuo *OauthProviderUpdateOne) SetTokenURL(s string) *OauthProviderUpdateOne { + opuo.mutation.SetTokenURL(s) + return opuo +} + +// SetNillableTokenURL sets the "token_url" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableTokenURL(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetTokenURL(*s) + } + return opuo +} + +// SetAuthStyle sets the "auth_style" field. +func (opuo *OauthProviderUpdateOne) SetAuthStyle(c customtypes.Uint8) *OauthProviderUpdateOne { + opuo.mutation.ResetAuthStyle() + opuo.mutation.SetAuthStyle(c) + return opuo +} + +// SetNillableAuthStyle sets the "auth_style" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableAuthStyle(c *customtypes.Uint8) *OauthProviderUpdateOne { + if c != nil { + opuo.SetAuthStyle(*c) + } + return opuo +} + +// AddAuthStyle adds c to the "auth_style" field. +func (opuo *OauthProviderUpdateOne) AddAuthStyle(c customtypes.Uint8) *OauthProviderUpdateOne { + opuo.mutation.AddAuthStyle(c) + return opuo +} + +// SetInfoURL sets the "info_url" field. +func (opuo *OauthProviderUpdateOne) SetInfoURL(s string) *OauthProviderUpdateOne { + opuo.mutation.SetInfoURL(s) + return opuo +} + +// SetNillableInfoURL sets the "info_url" field if the given value is not nil. +func (opuo *OauthProviderUpdateOne) SetNillableInfoURL(s *string) *OauthProviderUpdateOne { + if s != nil { + opuo.SetInfoURL(*s) + } + return opuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (opuo *OauthProviderUpdateOne) SetOwner(o *Organization) *OauthProviderUpdateOne { + return opuo.SetOwnerID(o.ID) +} + +// Mutation returns the OauthProviderMutation object of the builder. +func (opuo *OauthProviderUpdateOne) Mutation() *OauthProviderMutation { + return opuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (opuo *OauthProviderUpdateOne) ClearOwner() *OauthProviderUpdateOne { + opuo.mutation.ClearOwner() + return opuo +} + +// Where appends a list predicates to the OauthProviderUpdate builder. +func (opuo *OauthProviderUpdateOne) Where(ps ...predicate.OauthProvider) *OauthProviderUpdateOne { + opuo.mutation.Where(ps...) + return opuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (opuo *OauthProviderUpdateOne) Select(field string, fields ...string) *OauthProviderUpdateOne { + opuo.fields = append([]string{field}, fields...) + return opuo +} + +// Save executes the query and returns the updated OauthProvider entity. +func (opuo *OauthProviderUpdateOne) Save(ctx context.Context) (*OauthProvider, error) { + if err := opuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, opuo.sqlSave, opuo.mutation, opuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (opuo *OauthProviderUpdateOne) SaveX(ctx context.Context) *OauthProvider { + node, err := opuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (opuo *OauthProviderUpdateOne) Exec(ctx context.Context) error { + _, err := opuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (opuo *OauthProviderUpdateOne) ExecX(ctx context.Context) { + if err := opuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (opuo *OauthProviderUpdateOne) defaults() error { + if _, ok := opuo.mutation.UpdatedAt(); !ok && !opuo.mutation.UpdatedAtCleared() { + if oauthprovider.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthprovider.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := oauthprovider.UpdateDefaultUpdatedAt() + opuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (opuo *OauthProviderUpdateOne) check() error { + if v, ok := opuo.mutation.OwnerID(); ok { + if err := oauthprovider.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "OauthProvider.owner_id": %w`, err)} + } + } + return nil +} + +func (opuo *OauthProviderUpdateOne) sqlSave(ctx context.Context) (_node *OauthProvider, err error) { + if err := opuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(oauthprovider.Table, oauthprovider.Columns, sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString)) + id, ok := opuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OauthProvider.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := opuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, oauthprovider.FieldID) + for _, f := range fields { + if !oauthprovider.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != oauthprovider.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := opuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if opuo.mutation.CreatedAtCleared() { + _spec.ClearField(oauthprovider.FieldCreatedAt, field.TypeTime) + } + if value, ok := opuo.mutation.UpdatedAt(); ok { + _spec.SetField(oauthprovider.FieldUpdatedAt, field.TypeTime, value) + } + if opuo.mutation.UpdatedAtCleared() { + _spec.ClearField(oauthprovider.FieldUpdatedAt, field.TypeTime) + } + if opuo.mutation.CreatedByCleared() { + _spec.ClearField(oauthprovider.FieldCreatedBy, field.TypeString) + } + if value, ok := opuo.mutation.UpdatedBy(); ok { + _spec.SetField(oauthprovider.FieldUpdatedBy, field.TypeString, value) + } + if opuo.mutation.UpdatedByCleared() { + _spec.ClearField(oauthprovider.FieldUpdatedBy, field.TypeString) + } + if value, ok := opuo.mutation.Tags(); ok { + _spec.SetField(oauthprovider.FieldTags, field.TypeJSON, value) + } + if value, ok := opuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, oauthprovider.FieldTags, value) + }) + } + if opuo.mutation.TagsCleared() { + _spec.ClearField(oauthprovider.FieldTags, field.TypeJSON) + } + if value, ok := opuo.mutation.DeletedAt(); ok { + _spec.SetField(oauthprovider.FieldDeletedAt, field.TypeTime, value) + } + if opuo.mutation.DeletedAtCleared() { + _spec.ClearField(oauthprovider.FieldDeletedAt, field.TypeTime) + } + if value, ok := opuo.mutation.DeletedBy(); ok { + _spec.SetField(oauthprovider.FieldDeletedBy, field.TypeString, value) + } + if opuo.mutation.DeletedByCleared() { + _spec.ClearField(oauthprovider.FieldDeletedBy, field.TypeString) + } + if value, ok := opuo.mutation.Name(); ok { + _spec.SetField(oauthprovider.FieldName, field.TypeString, value) + } + if value, ok := opuo.mutation.ClientID(); ok { + _spec.SetField(oauthprovider.FieldClientID, field.TypeString, value) + } + if value, ok := opuo.mutation.ClientSecret(); ok { + _spec.SetField(oauthprovider.FieldClientSecret, field.TypeString, value) + } + if value, ok := opuo.mutation.RedirectURL(); ok { + _spec.SetField(oauthprovider.FieldRedirectURL, field.TypeString, value) + } + if value, ok := opuo.mutation.Scopes(); ok { + _spec.SetField(oauthprovider.FieldScopes, field.TypeString, value) + } + if value, ok := opuo.mutation.AuthURL(); ok { + _spec.SetField(oauthprovider.FieldAuthURL, field.TypeString, value) + } + if value, ok := opuo.mutation.TokenURL(); ok { + _spec.SetField(oauthprovider.FieldTokenURL, field.TypeString, value) + } + if value, ok := opuo.mutation.AuthStyle(); ok { + _spec.SetField(oauthprovider.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := opuo.mutation.AddedAuthStyle(); ok { + _spec.AddField(oauthprovider.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := opuo.mutation.InfoURL(); ok { + _spec.SetField(oauthprovider.FieldInfoURL, field.TypeString, value) + } + if opuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: oauthprovider.OwnerTable, + Columns: []string{oauthprovider.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = opuo.schemaConfig.OauthProvider + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := opuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: oauthprovider.OwnerTable, + Columns: []string{oauthprovider.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = opuo.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = opuo.schemaConfig.OauthProvider + ctx = internal.NewSchemaConfigContext(ctx, opuo.schemaConfig) + _node = &OauthProvider{config: opuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, opuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{oauthprovider.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + opuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/oauthproviderhistory.go b/internal/ent/generated/oauthproviderhistory.go new file mode 100644 index 0000000..fadb0a4 --- /dev/null +++ b/internal/ent/generated/oauthproviderhistory.go @@ -0,0 +1,335 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/entx/history" +) + +// OauthProviderHistory is the model entity for the OauthProviderHistory schema. +type OauthProviderHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the oauth provider's name + Name string `json:"name,omitempty"` + // the client id for the oauth provider + ClientID string `json:"client_id,omitempty"` + // the client secret + ClientSecret string `json:"client_secret,omitempty"` + // the redirect url + RedirectURL string `json:"redirect_url,omitempty"` + // the scopes + Scopes string `json:"scopes,omitempty"` + // the auth url of the provider + AuthURL string `json:"auth_url,omitempty"` + // the token url of the provider + TokenURL string `json:"token_url,omitempty"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle customtypes.Uint8 `json:"auth_style,omitempty"` + // the URL to request user information by token + InfoURL string `json:"info_url,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OauthProviderHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case oauthproviderhistory.FieldTags: + values[i] = new([]byte) + case oauthproviderhistory.FieldOperation: + values[i] = new(history.OpType) + case oauthproviderhistory.FieldAuthStyle: + values[i] = new(sql.NullInt64) + case oauthproviderhistory.FieldID, oauthproviderhistory.FieldRef, oauthproviderhistory.FieldCreatedBy, oauthproviderhistory.FieldUpdatedBy, oauthproviderhistory.FieldMappingID, oauthproviderhistory.FieldDeletedBy, oauthproviderhistory.FieldOwnerID, oauthproviderhistory.FieldName, oauthproviderhistory.FieldClientID, oauthproviderhistory.FieldClientSecret, oauthproviderhistory.FieldRedirectURL, oauthproviderhistory.FieldScopes, oauthproviderhistory.FieldAuthURL, oauthproviderhistory.FieldTokenURL, oauthproviderhistory.FieldInfoURL: + values[i] = new(sql.NullString) + case oauthproviderhistory.FieldHistoryTime, oauthproviderhistory.FieldCreatedAt, oauthproviderhistory.FieldUpdatedAt, oauthproviderhistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OauthProviderHistory fields. +func (oph *OauthProviderHistory) 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 oauthproviderhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + oph.ID = value.String + } + case oauthproviderhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + oph.HistoryTime = value.Time + } + case oauthproviderhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + oph.Ref = value.String + } + case oauthproviderhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + oph.Operation = *value + } + case oauthproviderhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + oph.CreatedAt = value.Time + } + case oauthproviderhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + oph.UpdatedAt = value.Time + } + case oauthproviderhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + oph.CreatedBy = value.String + } + case oauthproviderhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + oph.UpdatedBy = value.String + } + case oauthproviderhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + oph.MappingID = value.String + } + case oauthproviderhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &oph.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case oauthproviderhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + oph.DeletedAt = value.Time + } + case oauthproviderhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + oph.DeletedBy = value.String + } + case oauthproviderhistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + oph.OwnerID = value.String + } + case oauthproviderhistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + oph.Name = value.String + } + case oauthproviderhistory.FieldClientID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field client_id", values[i]) + } else if value.Valid { + oph.ClientID = value.String + } + case oauthproviderhistory.FieldClientSecret: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field client_secret", values[i]) + } else if value.Valid { + oph.ClientSecret = value.String + } + case oauthproviderhistory.FieldRedirectURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field redirect_url", values[i]) + } else if value.Valid { + oph.RedirectURL = value.String + } + case oauthproviderhistory.FieldScopes: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field scopes", values[i]) + } else if value.Valid { + oph.Scopes = value.String + } + case oauthproviderhistory.FieldAuthURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field auth_url", values[i]) + } else if value.Valid { + oph.AuthURL = value.String + } + case oauthproviderhistory.FieldTokenURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token_url", values[i]) + } else if value.Valid { + oph.TokenURL = value.String + } + case oauthproviderhistory.FieldAuthStyle: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field auth_style", values[i]) + } else if value.Valid { + oph.AuthStyle = customtypes.Uint8(value.Int64) + } + case oauthproviderhistory.FieldInfoURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field info_url", values[i]) + } else if value.Valid { + oph.InfoURL = value.String + } + default: + oph.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OauthProviderHistory. +// This includes values selected through modifiers, order, etc. +func (oph *OauthProviderHistory) Value(name string) (ent.Value, error) { + return oph.selectValues.Get(name) +} + +// Update returns a builder for updating this OauthProviderHistory. +// Note that you need to call OauthProviderHistory.Unwrap() before calling this method if this OauthProviderHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (oph *OauthProviderHistory) Update() *OauthProviderHistoryUpdateOne { + return NewOauthProviderHistoryClient(oph.config).UpdateOne(oph) +} + +// Unwrap unwraps the OauthProviderHistory 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 (oph *OauthProviderHistory) Unwrap() *OauthProviderHistory { + _tx, ok := oph.config.driver.(*txDriver) + if !ok { + panic("generated: OauthProviderHistory is not a transactional entity") + } + oph.config.driver = _tx.drv + return oph +} + +// String implements the fmt.Stringer. +func (oph *OauthProviderHistory) String() string { + var builder strings.Builder + builder.WriteString("OauthProviderHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", oph.ID)) + builder.WriteString("history_time=") + builder.WriteString(oph.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(oph.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", oph.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(oph.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(oph.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(oph.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(oph.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(oph.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", oph.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(oph.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(oph.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(oph.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(oph.Name) + builder.WriteString(", ") + builder.WriteString("client_id=") + builder.WriteString(oph.ClientID) + builder.WriteString(", ") + builder.WriteString("client_secret=") + builder.WriteString(oph.ClientSecret) + builder.WriteString(", ") + builder.WriteString("redirect_url=") + builder.WriteString(oph.RedirectURL) + builder.WriteString(", ") + builder.WriteString("scopes=") + builder.WriteString(oph.Scopes) + builder.WriteString(", ") + builder.WriteString("auth_url=") + builder.WriteString(oph.AuthURL) + builder.WriteString(", ") + builder.WriteString("token_url=") + builder.WriteString(oph.TokenURL) + builder.WriteString(", ") + builder.WriteString("auth_style=") + builder.WriteString(fmt.Sprintf("%v", oph.AuthStyle)) + builder.WriteString(", ") + builder.WriteString("info_url=") + builder.WriteString(oph.InfoURL) + builder.WriteByte(')') + return builder.String() +} + +// OauthProviderHistories is a parsable slice of OauthProviderHistory. +type OauthProviderHistories []*OauthProviderHistory diff --git a/internal/ent/generated/oauthproviderhistory/oauthproviderhistory.go b/internal/ent/generated/oauthproviderhistory/oauthproviderhistory.go new file mode 100644 index 0000000..a846729 --- /dev/null +++ b/internal/ent/generated/oauthproviderhistory/oauthproviderhistory.go @@ -0,0 +1,250 @@ +// Code generated by ent, DO NOT EDIT. + +package oauthproviderhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the oauthproviderhistory type in the database. + Label = "oauth_provider_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldClientID holds the string denoting the client_id field in the database. + FieldClientID = "client_id" + // FieldClientSecret holds the string denoting the client_secret field in the database. + FieldClientSecret = "client_secret" + // FieldRedirectURL holds the string denoting the redirect_url field in the database. + FieldRedirectURL = "redirect_url" + // FieldScopes holds the string denoting the scopes field in the database. + FieldScopes = "scopes" + // FieldAuthURL holds the string denoting the auth_url field in the database. + FieldAuthURL = "auth_url" + // FieldTokenURL holds the string denoting the token_url field in the database. + FieldTokenURL = "token_url" + // FieldAuthStyle holds the string denoting the auth_style field in the database. + FieldAuthStyle = "auth_style" + // FieldInfoURL holds the string denoting the info_url field in the database. + FieldInfoURL = "info_url" + // Table holds the table name of the oauthproviderhistory in the database. + Table = "oauth_provider_history" +) + +// Columns holds all SQL columns for oauthproviderhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldName, + FieldClientID, + FieldClientSecret, + FieldRedirectURL, + FieldScopes, + FieldAuthURL, + FieldTokenURL, + FieldAuthStyle, + FieldInfoURL, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("oauthproviderhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the OauthProviderHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByClientID orders the results by the client_id field. +func ByClientID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClientID, opts...).ToFunc() +} + +// ByClientSecret orders the results by the client_secret field. +func ByClientSecret(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClientSecret, opts...).ToFunc() +} + +// ByRedirectURL orders the results by the redirect_url field. +func ByRedirectURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRedirectURL, opts...).ToFunc() +} + +// ByScopes orders the results by the scopes field. +func ByScopes(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldScopes, opts...).ToFunc() +} + +// ByAuthURL orders the results by the auth_url field. +func ByAuthURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthURL, opts...).ToFunc() +} + +// ByTokenURL orders the results by the token_url field. +func ByTokenURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTokenURL, opts...).ToFunc() +} + +// ByAuthStyle orders the results by the auth_style field. +func ByAuthStyle(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthStyle, opts...).ToFunc() +} + +// ByInfoURL orders the results by the info_url field. +func ByInfoURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldInfoURL, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/oauthproviderhistory/where.go b/internal/ent/generated/oauthproviderhistory/where.go new file mode 100644 index 0000000..80f3e44 --- /dev/null +++ b/internal/ent/generated/oauthproviderhistory/where.go @@ -0,0 +1,1412 @@ +// Code generated by ent, DO NOT EDIT. + +package oauthproviderhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldName, v)) +} + +// ClientID applies equality check predicate on the "client_id" field. It's identical to ClientIDEQ. +func ClientID(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldClientID, v)) +} + +// ClientSecret applies equality check predicate on the "client_secret" field. It's identical to ClientSecretEQ. +func ClientSecret(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldClientSecret, v)) +} + +// RedirectURL applies equality check predicate on the "redirect_url" field. It's identical to RedirectURLEQ. +func RedirectURL(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldRedirectURL, v)) +} + +// Scopes applies equality check predicate on the "scopes" field. It's identical to ScopesEQ. +func Scopes(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldScopes, v)) +} + +// AuthURL applies equality check predicate on the "auth_url" field. It's identical to AuthURLEQ. +func AuthURL(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldAuthURL, v)) +} + +// TokenURL applies equality check predicate on the "token_url" field. It's identical to TokenURLEQ. +func TokenURL(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldTokenURL, v)) +} + +// AuthStyle applies equality check predicate on the "auth_style" field. It's identical to AuthStyleEQ. +func AuthStyle(v customtypes.Uint8) predicate.OauthProviderHistory { + vc := uint8(v) + return predicate.OauthProviderHistory(sql.FieldEQ(FieldAuthStyle, vc)) +} + +// InfoURL applies equality check predicate on the "info_url" field. It's identical to InfoURLEQ. +func InfoURL(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldInfoURL, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldName, v)) +} + +// ClientIDEQ applies the EQ predicate on the "client_id" field. +func ClientIDEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldClientID, v)) +} + +// ClientIDNEQ applies the NEQ predicate on the "client_id" field. +func ClientIDNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldClientID, v)) +} + +// ClientIDIn applies the In predicate on the "client_id" field. +func ClientIDIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldClientID, vs...)) +} + +// ClientIDNotIn applies the NotIn predicate on the "client_id" field. +func ClientIDNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldClientID, vs...)) +} + +// ClientIDGT applies the GT predicate on the "client_id" field. +func ClientIDGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldClientID, v)) +} + +// ClientIDGTE applies the GTE predicate on the "client_id" field. +func ClientIDGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldClientID, v)) +} + +// ClientIDLT applies the LT predicate on the "client_id" field. +func ClientIDLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldClientID, v)) +} + +// ClientIDLTE applies the LTE predicate on the "client_id" field. +func ClientIDLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldClientID, v)) +} + +// ClientIDContains applies the Contains predicate on the "client_id" field. +func ClientIDContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldClientID, v)) +} + +// ClientIDHasPrefix applies the HasPrefix predicate on the "client_id" field. +func ClientIDHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldClientID, v)) +} + +// ClientIDHasSuffix applies the HasSuffix predicate on the "client_id" field. +func ClientIDHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldClientID, v)) +} + +// ClientIDEqualFold applies the EqualFold predicate on the "client_id" field. +func ClientIDEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldClientID, v)) +} + +// ClientIDContainsFold applies the ContainsFold predicate on the "client_id" field. +func ClientIDContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldClientID, v)) +} + +// ClientSecretEQ applies the EQ predicate on the "client_secret" field. +func ClientSecretEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldClientSecret, v)) +} + +// ClientSecretNEQ applies the NEQ predicate on the "client_secret" field. +func ClientSecretNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldClientSecret, v)) +} + +// ClientSecretIn applies the In predicate on the "client_secret" field. +func ClientSecretIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldClientSecret, vs...)) +} + +// ClientSecretNotIn applies the NotIn predicate on the "client_secret" field. +func ClientSecretNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldClientSecret, vs...)) +} + +// ClientSecretGT applies the GT predicate on the "client_secret" field. +func ClientSecretGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldClientSecret, v)) +} + +// ClientSecretGTE applies the GTE predicate on the "client_secret" field. +func ClientSecretGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldClientSecret, v)) +} + +// ClientSecretLT applies the LT predicate on the "client_secret" field. +func ClientSecretLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldClientSecret, v)) +} + +// ClientSecretLTE applies the LTE predicate on the "client_secret" field. +func ClientSecretLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldClientSecret, v)) +} + +// ClientSecretContains applies the Contains predicate on the "client_secret" field. +func ClientSecretContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldClientSecret, v)) +} + +// ClientSecretHasPrefix applies the HasPrefix predicate on the "client_secret" field. +func ClientSecretHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldClientSecret, v)) +} + +// ClientSecretHasSuffix applies the HasSuffix predicate on the "client_secret" field. +func ClientSecretHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldClientSecret, v)) +} + +// ClientSecretEqualFold applies the EqualFold predicate on the "client_secret" field. +func ClientSecretEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldClientSecret, v)) +} + +// ClientSecretContainsFold applies the ContainsFold predicate on the "client_secret" field. +func ClientSecretContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldClientSecret, v)) +} + +// RedirectURLEQ applies the EQ predicate on the "redirect_url" field. +func RedirectURLEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldRedirectURL, v)) +} + +// RedirectURLNEQ applies the NEQ predicate on the "redirect_url" field. +func RedirectURLNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldRedirectURL, v)) +} + +// RedirectURLIn applies the In predicate on the "redirect_url" field. +func RedirectURLIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldRedirectURL, vs...)) +} + +// RedirectURLNotIn applies the NotIn predicate on the "redirect_url" field. +func RedirectURLNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldRedirectURL, vs...)) +} + +// RedirectURLGT applies the GT predicate on the "redirect_url" field. +func RedirectURLGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldRedirectURL, v)) +} + +// RedirectURLGTE applies the GTE predicate on the "redirect_url" field. +func RedirectURLGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldRedirectURL, v)) +} + +// RedirectURLLT applies the LT predicate on the "redirect_url" field. +func RedirectURLLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldRedirectURL, v)) +} + +// RedirectURLLTE applies the LTE predicate on the "redirect_url" field. +func RedirectURLLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldRedirectURL, v)) +} + +// RedirectURLContains applies the Contains predicate on the "redirect_url" field. +func RedirectURLContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldRedirectURL, v)) +} + +// RedirectURLHasPrefix applies the HasPrefix predicate on the "redirect_url" field. +func RedirectURLHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldRedirectURL, v)) +} + +// RedirectURLHasSuffix applies the HasSuffix predicate on the "redirect_url" field. +func RedirectURLHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldRedirectURL, v)) +} + +// RedirectURLEqualFold applies the EqualFold predicate on the "redirect_url" field. +func RedirectURLEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldRedirectURL, v)) +} + +// RedirectURLContainsFold applies the ContainsFold predicate on the "redirect_url" field. +func RedirectURLContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldRedirectURL, v)) +} + +// ScopesEQ applies the EQ predicate on the "scopes" field. +func ScopesEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldScopes, v)) +} + +// ScopesNEQ applies the NEQ predicate on the "scopes" field. +func ScopesNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldScopes, v)) +} + +// ScopesIn applies the In predicate on the "scopes" field. +func ScopesIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldScopes, vs...)) +} + +// ScopesNotIn applies the NotIn predicate on the "scopes" field. +func ScopesNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldScopes, vs...)) +} + +// ScopesGT applies the GT predicate on the "scopes" field. +func ScopesGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldScopes, v)) +} + +// ScopesGTE applies the GTE predicate on the "scopes" field. +func ScopesGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldScopes, v)) +} + +// ScopesLT applies the LT predicate on the "scopes" field. +func ScopesLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldScopes, v)) +} + +// ScopesLTE applies the LTE predicate on the "scopes" field. +func ScopesLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldScopes, v)) +} + +// ScopesContains applies the Contains predicate on the "scopes" field. +func ScopesContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldScopes, v)) +} + +// ScopesHasPrefix applies the HasPrefix predicate on the "scopes" field. +func ScopesHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldScopes, v)) +} + +// ScopesHasSuffix applies the HasSuffix predicate on the "scopes" field. +func ScopesHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldScopes, v)) +} + +// ScopesEqualFold applies the EqualFold predicate on the "scopes" field. +func ScopesEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldScopes, v)) +} + +// ScopesContainsFold applies the ContainsFold predicate on the "scopes" field. +func ScopesContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldScopes, v)) +} + +// AuthURLEQ applies the EQ predicate on the "auth_url" field. +func AuthURLEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldAuthURL, v)) +} + +// AuthURLNEQ applies the NEQ predicate on the "auth_url" field. +func AuthURLNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldAuthURL, v)) +} + +// AuthURLIn applies the In predicate on the "auth_url" field. +func AuthURLIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldAuthURL, vs...)) +} + +// AuthURLNotIn applies the NotIn predicate on the "auth_url" field. +func AuthURLNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldAuthURL, vs...)) +} + +// AuthURLGT applies the GT predicate on the "auth_url" field. +func AuthURLGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldAuthURL, v)) +} + +// AuthURLGTE applies the GTE predicate on the "auth_url" field. +func AuthURLGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldAuthURL, v)) +} + +// AuthURLLT applies the LT predicate on the "auth_url" field. +func AuthURLLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldAuthURL, v)) +} + +// AuthURLLTE applies the LTE predicate on the "auth_url" field. +func AuthURLLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldAuthURL, v)) +} + +// AuthURLContains applies the Contains predicate on the "auth_url" field. +func AuthURLContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldAuthURL, v)) +} + +// AuthURLHasPrefix applies the HasPrefix predicate on the "auth_url" field. +func AuthURLHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldAuthURL, v)) +} + +// AuthURLHasSuffix applies the HasSuffix predicate on the "auth_url" field. +func AuthURLHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldAuthURL, v)) +} + +// AuthURLEqualFold applies the EqualFold predicate on the "auth_url" field. +func AuthURLEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldAuthURL, v)) +} + +// AuthURLContainsFold applies the ContainsFold predicate on the "auth_url" field. +func AuthURLContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldAuthURL, v)) +} + +// TokenURLEQ applies the EQ predicate on the "token_url" field. +func TokenURLEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldTokenURL, v)) +} + +// TokenURLNEQ applies the NEQ predicate on the "token_url" field. +func TokenURLNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldTokenURL, v)) +} + +// TokenURLIn applies the In predicate on the "token_url" field. +func TokenURLIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldTokenURL, vs...)) +} + +// TokenURLNotIn applies the NotIn predicate on the "token_url" field. +func TokenURLNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldTokenURL, vs...)) +} + +// TokenURLGT applies the GT predicate on the "token_url" field. +func TokenURLGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldTokenURL, v)) +} + +// TokenURLGTE applies the GTE predicate on the "token_url" field. +func TokenURLGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldTokenURL, v)) +} + +// TokenURLLT applies the LT predicate on the "token_url" field. +func TokenURLLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldTokenURL, v)) +} + +// TokenURLLTE applies the LTE predicate on the "token_url" field. +func TokenURLLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldTokenURL, v)) +} + +// TokenURLContains applies the Contains predicate on the "token_url" field. +func TokenURLContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldTokenURL, v)) +} + +// TokenURLHasPrefix applies the HasPrefix predicate on the "token_url" field. +func TokenURLHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldTokenURL, v)) +} + +// TokenURLHasSuffix applies the HasSuffix predicate on the "token_url" field. +func TokenURLHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldTokenURL, v)) +} + +// TokenURLEqualFold applies the EqualFold predicate on the "token_url" field. +func TokenURLEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldTokenURL, v)) +} + +// TokenURLContainsFold applies the ContainsFold predicate on the "token_url" field. +func TokenURLContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldTokenURL, v)) +} + +// AuthStyleEQ applies the EQ predicate on the "auth_style" field. +func AuthStyleEQ(v customtypes.Uint8) predicate.OauthProviderHistory { + vc := uint8(v) + return predicate.OauthProviderHistory(sql.FieldEQ(FieldAuthStyle, vc)) +} + +// AuthStyleNEQ applies the NEQ predicate on the "auth_style" field. +func AuthStyleNEQ(v customtypes.Uint8) predicate.OauthProviderHistory { + vc := uint8(v) + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldAuthStyle, vc)) +} + +// AuthStyleIn applies the In predicate on the "auth_style" field. +func AuthStyleIn(vs ...customtypes.Uint8) predicate.OauthProviderHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = uint8(vs[i]) + } + return predicate.OauthProviderHistory(sql.FieldIn(FieldAuthStyle, v...)) +} + +// AuthStyleNotIn applies the NotIn predicate on the "auth_style" field. +func AuthStyleNotIn(vs ...customtypes.Uint8) predicate.OauthProviderHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = uint8(vs[i]) + } + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldAuthStyle, v...)) +} + +// AuthStyleGT applies the GT predicate on the "auth_style" field. +func AuthStyleGT(v customtypes.Uint8) predicate.OauthProviderHistory { + vc := uint8(v) + return predicate.OauthProviderHistory(sql.FieldGT(FieldAuthStyle, vc)) +} + +// AuthStyleGTE applies the GTE predicate on the "auth_style" field. +func AuthStyleGTE(v customtypes.Uint8) predicate.OauthProviderHistory { + vc := uint8(v) + return predicate.OauthProviderHistory(sql.FieldGTE(FieldAuthStyle, vc)) +} + +// AuthStyleLT applies the LT predicate on the "auth_style" field. +func AuthStyleLT(v customtypes.Uint8) predicate.OauthProviderHistory { + vc := uint8(v) + return predicate.OauthProviderHistory(sql.FieldLT(FieldAuthStyle, vc)) +} + +// AuthStyleLTE applies the LTE predicate on the "auth_style" field. +func AuthStyleLTE(v customtypes.Uint8) predicate.OauthProviderHistory { + vc := uint8(v) + return predicate.OauthProviderHistory(sql.FieldLTE(FieldAuthStyle, vc)) +} + +// InfoURLEQ applies the EQ predicate on the "info_url" field. +func InfoURLEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEQ(FieldInfoURL, v)) +} + +// InfoURLNEQ applies the NEQ predicate on the "info_url" field. +func InfoURLNEQ(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNEQ(FieldInfoURL, v)) +} + +// InfoURLIn applies the In predicate on the "info_url" field. +func InfoURLIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldIn(FieldInfoURL, vs...)) +} + +// InfoURLNotIn applies the NotIn predicate on the "info_url" field. +func InfoURLNotIn(vs ...string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldNotIn(FieldInfoURL, vs...)) +} + +// InfoURLGT applies the GT predicate on the "info_url" field. +func InfoURLGT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGT(FieldInfoURL, v)) +} + +// InfoURLGTE applies the GTE predicate on the "info_url" field. +func InfoURLGTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldGTE(FieldInfoURL, v)) +} + +// InfoURLLT applies the LT predicate on the "info_url" field. +func InfoURLLT(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLT(FieldInfoURL, v)) +} + +// InfoURLLTE applies the LTE predicate on the "info_url" field. +func InfoURLLTE(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldLTE(FieldInfoURL, v)) +} + +// InfoURLContains applies the Contains predicate on the "info_url" field. +func InfoURLContains(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContains(FieldInfoURL, v)) +} + +// InfoURLHasPrefix applies the HasPrefix predicate on the "info_url" field. +func InfoURLHasPrefix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasPrefix(FieldInfoURL, v)) +} + +// InfoURLHasSuffix applies the HasSuffix predicate on the "info_url" field. +func InfoURLHasSuffix(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldHasSuffix(FieldInfoURL, v)) +} + +// InfoURLEqualFold applies the EqualFold predicate on the "info_url" field. +func InfoURLEqualFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldEqualFold(FieldInfoURL, v)) +} + +// InfoURLContainsFold applies the ContainsFold predicate on the "info_url" field. +func InfoURLContainsFold(v string) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.FieldContainsFold(FieldInfoURL, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.OauthProviderHistory) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OauthProviderHistory) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OauthProviderHistory) predicate.OauthProviderHistory { + return predicate.OauthProviderHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/oauthproviderhistory_create.go b/internal/ent/generated/oauthproviderhistory_create.go new file mode 100644 index 0000000..4ee5da6 --- /dev/null +++ b/internal/ent/generated/oauthproviderhistory_create.go @@ -0,0 +1,572 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/entx/history" +) + +// OauthProviderHistoryCreate is the builder for creating a OauthProviderHistory entity. +type OauthProviderHistoryCreate struct { + config + mutation *OauthProviderHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ophc *OauthProviderHistoryCreate) SetHistoryTime(t time.Time) *OauthProviderHistoryCreate { + ophc.mutation.SetHistoryTime(t) + return ophc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableHistoryTime(t *time.Time) *OauthProviderHistoryCreate { + if t != nil { + ophc.SetHistoryTime(*t) + } + return ophc +} + +// SetRef sets the "ref" field. +func (ophc *OauthProviderHistoryCreate) SetRef(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetRef(s) + return ophc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableRef(s *string) *OauthProviderHistoryCreate { + if s != nil { + ophc.SetRef(*s) + } + return ophc +} + +// SetOperation sets the "operation" field. +func (ophc *OauthProviderHistoryCreate) SetOperation(ht history.OpType) *OauthProviderHistoryCreate { + ophc.mutation.SetOperation(ht) + return ophc +} + +// SetCreatedAt sets the "created_at" field. +func (ophc *OauthProviderHistoryCreate) SetCreatedAt(t time.Time) *OauthProviderHistoryCreate { + ophc.mutation.SetCreatedAt(t) + return ophc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableCreatedAt(t *time.Time) *OauthProviderHistoryCreate { + if t != nil { + ophc.SetCreatedAt(*t) + } + return ophc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ophc *OauthProviderHistoryCreate) SetUpdatedAt(t time.Time) *OauthProviderHistoryCreate { + ophc.mutation.SetUpdatedAt(t) + return ophc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableUpdatedAt(t *time.Time) *OauthProviderHistoryCreate { + if t != nil { + ophc.SetUpdatedAt(*t) + } + return ophc +} + +// SetCreatedBy sets the "created_by" field. +func (ophc *OauthProviderHistoryCreate) SetCreatedBy(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetCreatedBy(s) + return ophc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableCreatedBy(s *string) *OauthProviderHistoryCreate { + if s != nil { + ophc.SetCreatedBy(*s) + } + return ophc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ophc *OauthProviderHistoryCreate) SetUpdatedBy(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetUpdatedBy(s) + return ophc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableUpdatedBy(s *string) *OauthProviderHistoryCreate { + if s != nil { + ophc.SetUpdatedBy(*s) + } + return ophc +} + +// SetMappingID sets the "mapping_id" field. +func (ophc *OauthProviderHistoryCreate) SetMappingID(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetMappingID(s) + return ophc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableMappingID(s *string) *OauthProviderHistoryCreate { + if s != nil { + ophc.SetMappingID(*s) + } + return ophc +} + +// SetTags sets the "tags" field. +func (ophc *OauthProviderHistoryCreate) SetTags(s []string) *OauthProviderHistoryCreate { + ophc.mutation.SetTags(s) + return ophc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ophc *OauthProviderHistoryCreate) SetDeletedAt(t time.Time) *OauthProviderHistoryCreate { + ophc.mutation.SetDeletedAt(t) + return ophc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableDeletedAt(t *time.Time) *OauthProviderHistoryCreate { + if t != nil { + ophc.SetDeletedAt(*t) + } + return ophc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ophc *OauthProviderHistoryCreate) SetDeletedBy(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetDeletedBy(s) + return ophc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableDeletedBy(s *string) *OauthProviderHistoryCreate { + if s != nil { + ophc.SetDeletedBy(*s) + } + return ophc +} + +// SetOwnerID sets the "owner_id" field. +func (ophc *OauthProviderHistoryCreate) SetOwnerID(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetOwnerID(s) + return ophc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableOwnerID(s *string) *OauthProviderHistoryCreate { + if s != nil { + ophc.SetOwnerID(*s) + } + return ophc +} + +// SetName sets the "name" field. +func (ophc *OauthProviderHistoryCreate) SetName(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetName(s) + return ophc +} + +// SetClientID sets the "client_id" field. +func (ophc *OauthProviderHistoryCreate) SetClientID(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetClientID(s) + return ophc +} + +// SetClientSecret sets the "client_secret" field. +func (ophc *OauthProviderHistoryCreate) SetClientSecret(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetClientSecret(s) + return ophc +} + +// SetRedirectURL sets the "redirect_url" field. +func (ophc *OauthProviderHistoryCreate) SetRedirectURL(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetRedirectURL(s) + return ophc +} + +// SetScopes sets the "scopes" field. +func (ophc *OauthProviderHistoryCreate) SetScopes(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetScopes(s) + return ophc +} + +// SetAuthURL sets the "auth_url" field. +func (ophc *OauthProviderHistoryCreate) SetAuthURL(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetAuthURL(s) + return ophc +} + +// SetTokenURL sets the "token_url" field. +func (ophc *OauthProviderHistoryCreate) SetTokenURL(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetTokenURL(s) + return ophc +} + +// SetAuthStyle sets the "auth_style" field. +func (ophc *OauthProviderHistoryCreate) SetAuthStyle(c customtypes.Uint8) *OauthProviderHistoryCreate { + ophc.mutation.SetAuthStyle(c) + return ophc +} + +// SetInfoURL sets the "info_url" field. +func (ophc *OauthProviderHistoryCreate) SetInfoURL(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetInfoURL(s) + return ophc +} + +// SetID sets the "id" field. +func (ophc *OauthProviderHistoryCreate) SetID(s string) *OauthProviderHistoryCreate { + ophc.mutation.SetID(s) + return ophc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ophc *OauthProviderHistoryCreate) SetNillableID(s *string) *OauthProviderHistoryCreate { + if s != nil { + ophc.SetID(*s) + } + return ophc +} + +// Mutation returns the OauthProviderHistoryMutation object of the builder. +func (ophc *OauthProviderHistoryCreate) Mutation() *OauthProviderHistoryMutation { + return ophc.mutation +} + +// Save creates the OauthProviderHistory in the database. +func (ophc *OauthProviderHistoryCreate) Save(ctx context.Context) (*OauthProviderHistory, error) { + if err := ophc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ophc.sqlSave, ophc.mutation, ophc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ophc *OauthProviderHistoryCreate) SaveX(ctx context.Context) *OauthProviderHistory { + v, err := ophc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ophc *OauthProviderHistoryCreate) Exec(ctx context.Context) error { + _, err := ophc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ophc *OauthProviderHistoryCreate) ExecX(ctx context.Context) { + if err := ophc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ophc *OauthProviderHistoryCreate) defaults() error { + if _, ok := ophc.mutation.HistoryTime(); !ok { + if oauthproviderhistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized oauthproviderhistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := oauthproviderhistory.DefaultHistoryTime() + ophc.mutation.SetHistoryTime(v) + } + if _, ok := ophc.mutation.CreatedAt(); !ok { + if oauthproviderhistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthproviderhistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := oauthproviderhistory.DefaultCreatedAt() + ophc.mutation.SetCreatedAt(v) + } + if _, ok := ophc.mutation.UpdatedAt(); !ok { + if oauthproviderhistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthproviderhistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := oauthproviderhistory.DefaultUpdatedAt() + ophc.mutation.SetUpdatedAt(v) + } + if _, ok := ophc.mutation.MappingID(); !ok { + if oauthproviderhistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized oauthproviderhistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := oauthproviderhistory.DefaultMappingID() + ophc.mutation.SetMappingID(v) + } + if _, ok := ophc.mutation.Tags(); !ok { + v := oauthproviderhistory.DefaultTags + ophc.mutation.SetTags(v) + } + if _, ok := ophc.mutation.ID(); !ok { + if oauthproviderhistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized oauthproviderhistory.DefaultID (forgotten import generated/runtime?)") + } + v := oauthproviderhistory.DefaultID() + ophc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ophc *OauthProviderHistoryCreate) check() error { + if _, ok := ophc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "OauthProviderHistory.history_time"`)} + } + if _, ok := ophc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "OauthProviderHistory.operation"`)} + } + if v, ok := ophc.mutation.Operation(); ok { + if err := oauthproviderhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "OauthProviderHistory.operation": %w`, err)} + } + } + if _, ok := ophc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OauthProviderHistory.mapping_id"`)} + } + if _, ok := ophc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "OauthProviderHistory.name"`)} + } + if _, ok := ophc.mutation.ClientID(); !ok { + return &ValidationError{Name: "client_id", err: errors.New(`generated: missing required field "OauthProviderHistory.client_id"`)} + } + if _, ok := ophc.mutation.ClientSecret(); !ok { + return &ValidationError{Name: "client_secret", err: errors.New(`generated: missing required field "OauthProviderHistory.client_secret"`)} + } + if _, ok := ophc.mutation.RedirectURL(); !ok { + return &ValidationError{Name: "redirect_url", err: errors.New(`generated: missing required field "OauthProviderHistory.redirect_url"`)} + } + if _, ok := ophc.mutation.Scopes(); !ok { + return &ValidationError{Name: "scopes", err: errors.New(`generated: missing required field "OauthProviderHistory.scopes"`)} + } + if _, ok := ophc.mutation.AuthURL(); !ok { + return &ValidationError{Name: "auth_url", err: errors.New(`generated: missing required field "OauthProviderHistory.auth_url"`)} + } + if _, ok := ophc.mutation.TokenURL(); !ok { + return &ValidationError{Name: "token_url", err: errors.New(`generated: missing required field "OauthProviderHistory.token_url"`)} + } + if _, ok := ophc.mutation.AuthStyle(); !ok { + return &ValidationError{Name: "auth_style", err: errors.New(`generated: missing required field "OauthProviderHistory.auth_style"`)} + } + if _, ok := ophc.mutation.InfoURL(); !ok { + return &ValidationError{Name: "info_url", err: errors.New(`generated: missing required field "OauthProviderHistory.info_url"`)} + } + return nil +} + +func (ophc *OauthProviderHistoryCreate) sqlSave(ctx context.Context) (*OauthProviderHistory, error) { + if err := ophc.check(); err != nil { + return nil, err + } + _node, _spec := ophc.createSpec() + if err := sqlgraph.CreateNode(ctx, ophc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OauthProviderHistory.ID type: %T", _spec.ID.Value) + } + } + ophc.mutation.id = &_node.ID + ophc.mutation.done = true + return _node, nil +} + +func (ophc *OauthProviderHistoryCreate) createSpec() (*OauthProviderHistory, *sqlgraph.CreateSpec) { + var ( + _node = &OauthProviderHistory{config: ophc.config} + _spec = sqlgraph.NewCreateSpec(oauthproviderhistory.Table, sqlgraph.NewFieldSpec(oauthproviderhistory.FieldID, field.TypeString)) + ) + _spec.Schema = ophc.schemaConfig.OauthProviderHistory + if id, ok := ophc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ophc.mutation.HistoryTime(); ok { + _spec.SetField(oauthproviderhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ophc.mutation.Ref(); ok { + _spec.SetField(oauthproviderhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ophc.mutation.Operation(); ok { + _spec.SetField(oauthproviderhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ophc.mutation.CreatedAt(); ok { + _spec.SetField(oauthproviderhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ophc.mutation.UpdatedAt(); ok { + _spec.SetField(oauthproviderhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ophc.mutation.CreatedBy(); ok { + _spec.SetField(oauthproviderhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ophc.mutation.UpdatedBy(); ok { + _spec.SetField(oauthproviderhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ophc.mutation.MappingID(); ok { + _spec.SetField(oauthproviderhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ophc.mutation.Tags(); ok { + _spec.SetField(oauthproviderhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ophc.mutation.DeletedAt(); ok { + _spec.SetField(oauthproviderhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ophc.mutation.DeletedBy(); ok { + _spec.SetField(oauthproviderhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ophc.mutation.OwnerID(); ok { + _spec.SetField(oauthproviderhistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := ophc.mutation.Name(); ok { + _spec.SetField(oauthproviderhistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ophc.mutation.ClientID(); ok { + _spec.SetField(oauthproviderhistory.FieldClientID, field.TypeString, value) + _node.ClientID = value + } + if value, ok := ophc.mutation.ClientSecret(); ok { + _spec.SetField(oauthproviderhistory.FieldClientSecret, field.TypeString, value) + _node.ClientSecret = value + } + if value, ok := ophc.mutation.RedirectURL(); ok { + _spec.SetField(oauthproviderhistory.FieldRedirectURL, field.TypeString, value) + _node.RedirectURL = value + } + if value, ok := ophc.mutation.Scopes(); ok { + _spec.SetField(oauthproviderhistory.FieldScopes, field.TypeString, value) + _node.Scopes = value + } + if value, ok := ophc.mutation.AuthURL(); ok { + _spec.SetField(oauthproviderhistory.FieldAuthURL, field.TypeString, value) + _node.AuthURL = value + } + if value, ok := ophc.mutation.TokenURL(); ok { + _spec.SetField(oauthproviderhistory.FieldTokenURL, field.TypeString, value) + _node.TokenURL = value + } + if value, ok := ophc.mutation.AuthStyle(); ok { + _spec.SetField(oauthproviderhistory.FieldAuthStyle, field.TypeUint8, value) + _node.AuthStyle = value + } + if value, ok := ophc.mutation.InfoURL(); ok { + _spec.SetField(oauthproviderhistory.FieldInfoURL, field.TypeString, value) + _node.InfoURL = value + } + return _node, _spec +} + +// OauthProviderHistoryCreateBulk is the builder for creating many OauthProviderHistory entities in bulk. +type OauthProviderHistoryCreateBulk struct { + config + err error + builders []*OauthProviderHistoryCreate +} + +// Save creates the OauthProviderHistory entities in the database. +func (ophcb *OauthProviderHistoryCreateBulk) Save(ctx context.Context) ([]*OauthProviderHistory, error) { + if ophcb.err != nil { + return nil, ophcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ophcb.builders)) + nodes := make([]*OauthProviderHistory, len(ophcb.builders)) + mutators := make([]Mutator, len(ophcb.builders)) + for i := range ophcb.builders { + func(i int, root context.Context) { + builder := ophcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OauthProviderHistoryMutation) + 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, ophcb.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, ophcb.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, ophcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ophcb *OauthProviderHistoryCreateBulk) SaveX(ctx context.Context) []*OauthProviderHistory { + v, err := ophcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ophcb *OauthProviderHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ophcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ophcb *OauthProviderHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ophcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/oauthproviderhistory_delete.go b/internal/ent/generated/oauthproviderhistory_delete.go new file mode 100644 index 0000000..9ad5c3e --- /dev/null +++ b/internal/ent/generated/oauthproviderhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" +) + +// OauthProviderHistoryDelete is the builder for deleting a OauthProviderHistory entity. +type OauthProviderHistoryDelete struct { + config + hooks []Hook + mutation *OauthProviderHistoryMutation +} + +// Where appends a list predicates to the OauthProviderHistoryDelete builder. +func (ophd *OauthProviderHistoryDelete) Where(ps ...predicate.OauthProviderHistory) *OauthProviderHistoryDelete { + ophd.mutation.Where(ps...) + return ophd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ophd *OauthProviderHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ophd.sqlExec, ophd.mutation, ophd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ophd *OauthProviderHistoryDelete) ExecX(ctx context.Context) int { + n, err := ophd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ophd *OauthProviderHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(oauthproviderhistory.Table, sqlgraph.NewFieldSpec(oauthproviderhistory.FieldID, field.TypeString)) + _spec.Node.Schema = ophd.schemaConfig.OauthProviderHistory + ctx = internal.NewSchemaConfigContext(ctx, ophd.schemaConfig) + if ps := ophd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ophd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ophd.mutation.done = true + return affected, err +} + +// OauthProviderHistoryDeleteOne is the builder for deleting a single OauthProviderHistory entity. +type OauthProviderHistoryDeleteOne struct { + ophd *OauthProviderHistoryDelete +} + +// Where appends a list predicates to the OauthProviderHistoryDelete builder. +func (ophdo *OauthProviderHistoryDeleteOne) Where(ps ...predicate.OauthProviderHistory) *OauthProviderHistoryDeleteOne { + ophdo.ophd.mutation.Where(ps...) + return ophdo +} + +// Exec executes the deletion query. +func (ophdo *OauthProviderHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ophdo.ophd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{oauthproviderhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ophdo *OauthProviderHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ophdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/oauthproviderhistory_query.go b/internal/ent/generated/oauthproviderhistory_query.go new file mode 100644 index 0000000..6181b96 --- /dev/null +++ b/internal/ent/generated/oauthproviderhistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OauthProviderHistoryQuery is the builder for querying OauthProviderHistory entities. +type OauthProviderHistoryQuery struct { + config + ctx *QueryContext + order []oauthproviderhistory.OrderOption + inters []Interceptor + predicates []predicate.OauthProviderHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OauthProviderHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OauthProviderHistoryQuery builder. +func (ophq *OauthProviderHistoryQuery) Where(ps ...predicate.OauthProviderHistory) *OauthProviderHistoryQuery { + ophq.predicates = append(ophq.predicates, ps...) + return ophq +} + +// Limit the number of records to be returned by this query. +func (ophq *OauthProviderHistoryQuery) Limit(limit int) *OauthProviderHistoryQuery { + ophq.ctx.Limit = &limit + return ophq +} + +// Offset to start from. +func (ophq *OauthProviderHistoryQuery) Offset(offset int) *OauthProviderHistoryQuery { + ophq.ctx.Offset = &offset + return ophq +} + +// 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 (ophq *OauthProviderHistoryQuery) Unique(unique bool) *OauthProviderHistoryQuery { + ophq.ctx.Unique = &unique + return ophq +} + +// Order specifies how the records should be ordered. +func (ophq *OauthProviderHistoryQuery) Order(o ...oauthproviderhistory.OrderOption) *OauthProviderHistoryQuery { + ophq.order = append(ophq.order, o...) + return ophq +} + +// First returns the first OauthProviderHistory entity from the query. +// Returns a *NotFoundError when no OauthProviderHistory was found. +func (ophq *OauthProviderHistoryQuery) First(ctx context.Context) (*OauthProviderHistory, error) { + nodes, err := ophq.Limit(1).All(setContextOp(ctx, ophq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{oauthproviderhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) FirstX(ctx context.Context) *OauthProviderHistory { + node, err := ophq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OauthProviderHistory ID from the query. +// Returns a *NotFoundError when no OauthProviderHistory ID was found. +func (ophq *OauthProviderHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ophq.Limit(1).IDs(setContextOp(ctx, ophq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{oauthproviderhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ophq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OauthProviderHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OauthProviderHistory entity is found. +// Returns a *NotFoundError when no OauthProviderHistory entities are found. +func (ophq *OauthProviderHistoryQuery) Only(ctx context.Context) (*OauthProviderHistory, error) { + nodes, err := ophq.Limit(2).All(setContextOp(ctx, ophq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{oauthproviderhistory.Label} + default: + return nil, &NotSingularError{oauthproviderhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) OnlyX(ctx context.Context) *OauthProviderHistory { + node, err := ophq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OauthProviderHistory ID in the query. +// Returns a *NotSingularError when more than one OauthProviderHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ophq *OauthProviderHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ophq.Limit(2).IDs(setContextOp(ctx, ophq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{oauthproviderhistory.Label} + default: + err = &NotSingularError{oauthproviderhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ophq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OauthProviderHistories. +func (ophq *OauthProviderHistoryQuery) All(ctx context.Context) ([]*OauthProviderHistory, error) { + ctx = setContextOp(ctx, ophq.ctx, ent.OpQueryAll) + if err := ophq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OauthProviderHistory, *OauthProviderHistoryQuery]() + return withInterceptors[[]*OauthProviderHistory](ctx, ophq, qr, ophq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) AllX(ctx context.Context) []*OauthProviderHistory { + nodes, err := ophq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OauthProviderHistory IDs. +func (ophq *OauthProviderHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ophq.ctx.Unique == nil && ophq.path != nil { + ophq.Unique(true) + } + ctx = setContextOp(ctx, ophq.ctx, ent.OpQueryIDs) + if err = ophq.Select(oauthproviderhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ophq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ophq *OauthProviderHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ophq.ctx, ent.OpQueryCount) + if err := ophq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ophq, querierCount[*OauthProviderHistoryQuery](), ophq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) CountX(ctx context.Context) int { + count, err := ophq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ophq *OauthProviderHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ophq.ctx, ent.OpQueryExist) + switch _, err := ophq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ophq *OauthProviderHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ophq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OauthProviderHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ophq *OauthProviderHistoryQuery) Clone() *OauthProviderHistoryQuery { + if ophq == nil { + return nil + } + return &OauthProviderHistoryQuery{ + config: ophq.config, + ctx: ophq.ctx.Clone(), + order: append([]oauthproviderhistory.OrderOption{}, ophq.order...), + inters: append([]Interceptor{}, ophq.inters...), + predicates: append([]predicate.OauthProviderHistory{}, ophq.predicates...), + // clone intermediate query. + sql: ophq.sql.Clone(), + path: ophq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OauthProviderHistory.Query(). +// GroupBy(oauthproviderhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ophq *OauthProviderHistoryQuery) GroupBy(field string, fields ...string) *OauthProviderHistoryGroupBy { + ophq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OauthProviderHistoryGroupBy{build: ophq} + grbuild.flds = &ophq.ctx.Fields + grbuild.label = oauthproviderhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.OauthProviderHistory.Query(). +// Select(oauthproviderhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ophq *OauthProviderHistoryQuery) Select(fields ...string) *OauthProviderHistorySelect { + ophq.ctx.Fields = append(ophq.ctx.Fields, fields...) + sbuild := &OauthProviderHistorySelect{OauthProviderHistoryQuery: ophq} + sbuild.label = oauthproviderhistory.Label + sbuild.flds, sbuild.scan = &ophq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OauthProviderHistorySelect configured with the given aggregations. +func (ophq *OauthProviderHistoryQuery) Aggregate(fns ...AggregateFunc) *OauthProviderHistorySelect { + return ophq.Select().Aggregate(fns...) +} + +func (ophq *OauthProviderHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ophq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ophq); err != nil { + return err + } + } + } + for _, f := range ophq.ctx.Fields { + if !oauthproviderhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ophq.path != nil { + prev, err := ophq.path(ctx) + if err != nil { + return err + } + ophq.sql = prev + } + if oauthproviderhistory.Policy == nil { + return errors.New("generated: uninitialized oauthproviderhistory.Policy (forgotten import generated/runtime?)") + } + if err := oauthproviderhistory.Policy.EvalQuery(ctx, ophq); err != nil { + return err + } + return nil +} + +func (ophq *OauthProviderHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OauthProviderHistory, error) { + var ( + nodes = []*OauthProviderHistory{} + _spec = ophq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OauthProviderHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OauthProviderHistory{config: ophq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ophq.schemaConfig.OauthProviderHistory + ctx = internal.NewSchemaConfigContext(ctx, ophq.schemaConfig) + if len(ophq.modifiers) > 0 { + _spec.Modifiers = ophq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ophq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ophq.loadTotal { + if err := ophq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ophq *OauthProviderHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ophq.querySpec() + _spec.Node.Schema = ophq.schemaConfig.OauthProviderHistory + ctx = internal.NewSchemaConfigContext(ctx, ophq.schemaConfig) + if len(ophq.modifiers) > 0 { + _spec.Modifiers = ophq.modifiers + } + _spec.Node.Columns = ophq.ctx.Fields + if len(ophq.ctx.Fields) > 0 { + _spec.Unique = ophq.ctx.Unique != nil && *ophq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ophq.driver, _spec) +} + +func (ophq *OauthProviderHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(oauthproviderhistory.Table, oauthproviderhistory.Columns, sqlgraph.NewFieldSpec(oauthproviderhistory.FieldID, field.TypeString)) + _spec.From = ophq.sql + if unique := ophq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ophq.path != nil { + _spec.Unique = true + } + if fields := ophq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, oauthproviderhistory.FieldID) + for i := range fields { + if fields[i] != oauthproviderhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ophq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ophq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ophq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ophq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ophq *OauthProviderHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ophq.driver.Dialect()) + t1 := builder.Table(oauthproviderhistory.Table) + columns := ophq.ctx.Fields + if len(columns) == 0 { + columns = oauthproviderhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ophq.sql != nil { + selector = ophq.sql + selector.Select(selector.Columns(columns...)...) + } + if ophq.ctx.Unique != nil && *ophq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ophq.schemaConfig.OauthProviderHistory) + ctx = internal.NewSchemaConfigContext(ctx, ophq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ophq.predicates { + p(selector) + } + for _, p := range ophq.order { + p(selector) + } + if offset := ophq.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 := ophq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// OauthProviderHistoryGroupBy is the group-by builder for OauthProviderHistory entities. +type OauthProviderHistoryGroupBy struct { + selector + build *OauthProviderHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ophgb *OauthProviderHistoryGroupBy) Aggregate(fns ...AggregateFunc) *OauthProviderHistoryGroupBy { + ophgb.fns = append(ophgb.fns, fns...) + return ophgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ophgb *OauthProviderHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ophgb.build.ctx, ent.OpQueryGroupBy) + if err := ophgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OauthProviderHistoryQuery, *OauthProviderHistoryGroupBy](ctx, ophgb.build, ophgb, ophgb.build.inters, v) +} + +func (ophgb *OauthProviderHistoryGroupBy) sqlScan(ctx context.Context, root *OauthProviderHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ophgb.fns)) + for _, fn := range ophgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ophgb.flds)+len(ophgb.fns)) + for _, f := range *ophgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ophgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ophgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OauthProviderHistorySelect is the builder for selecting fields of OauthProviderHistory entities. +type OauthProviderHistorySelect struct { + *OauthProviderHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ophs *OauthProviderHistorySelect) Aggregate(fns ...AggregateFunc) *OauthProviderHistorySelect { + ophs.fns = append(ophs.fns, fns...) + return ophs +} + +// Scan applies the selector query and scans the result into the given value. +func (ophs *OauthProviderHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ophs.ctx, ent.OpQuerySelect) + if err := ophs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OauthProviderHistoryQuery, *OauthProviderHistorySelect](ctx, ophs.OauthProviderHistoryQuery, ophs, ophs.inters, v) +} + +func (ophs *OauthProviderHistorySelect) sqlScan(ctx context.Context, root *OauthProviderHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ophs.fns)) + for _, fn := range ophs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ophs.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 := ophs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/oauthproviderhistory_update.go b/internal/ent/generated/oauthproviderhistory_update.go new file mode 100644 index 0000000..508b14b --- /dev/null +++ b/internal/ent/generated/oauthproviderhistory_update.go @@ -0,0 +1,860 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OauthProviderHistoryUpdate is the builder for updating OauthProviderHistory entities. +type OauthProviderHistoryUpdate struct { + config + hooks []Hook + mutation *OauthProviderHistoryMutation +} + +// Where appends a list predicates to the OauthProviderHistoryUpdate builder. +func (ophu *OauthProviderHistoryUpdate) Where(ps ...predicate.OauthProviderHistory) *OauthProviderHistoryUpdate { + ophu.mutation.Where(ps...) + return ophu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ophu *OauthProviderHistoryUpdate) SetUpdatedAt(t time.Time) *OauthProviderHistoryUpdate { + ophu.mutation.SetUpdatedAt(t) + return ophu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ophu *OauthProviderHistoryUpdate) ClearUpdatedAt() *OauthProviderHistoryUpdate { + ophu.mutation.ClearUpdatedAt() + return ophu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ophu *OauthProviderHistoryUpdate) SetUpdatedBy(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetUpdatedBy(s) + return ophu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableUpdatedBy(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetUpdatedBy(*s) + } + return ophu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ophu *OauthProviderHistoryUpdate) ClearUpdatedBy() *OauthProviderHistoryUpdate { + ophu.mutation.ClearUpdatedBy() + return ophu +} + +// SetTags sets the "tags" field. +func (ophu *OauthProviderHistoryUpdate) SetTags(s []string) *OauthProviderHistoryUpdate { + ophu.mutation.SetTags(s) + return ophu +} + +// AppendTags appends s to the "tags" field. +func (ophu *OauthProviderHistoryUpdate) AppendTags(s []string) *OauthProviderHistoryUpdate { + ophu.mutation.AppendTags(s) + return ophu +} + +// ClearTags clears the value of the "tags" field. +func (ophu *OauthProviderHistoryUpdate) ClearTags() *OauthProviderHistoryUpdate { + ophu.mutation.ClearTags() + return ophu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ophu *OauthProviderHistoryUpdate) SetDeletedAt(t time.Time) *OauthProviderHistoryUpdate { + ophu.mutation.SetDeletedAt(t) + return ophu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableDeletedAt(t *time.Time) *OauthProviderHistoryUpdate { + if t != nil { + ophu.SetDeletedAt(*t) + } + return ophu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ophu *OauthProviderHistoryUpdate) ClearDeletedAt() *OauthProviderHistoryUpdate { + ophu.mutation.ClearDeletedAt() + return ophu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ophu *OauthProviderHistoryUpdate) SetDeletedBy(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetDeletedBy(s) + return ophu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableDeletedBy(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetDeletedBy(*s) + } + return ophu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ophu *OauthProviderHistoryUpdate) ClearDeletedBy() *OauthProviderHistoryUpdate { + ophu.mutation.ClearDeletedBy() + return ophu +} + +// SetOwnerID sets the "owner_id" field. +func (ophu *OauthProviderHistoryUpdate) SetOwnerID(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetOwnerID(s) + return ophu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableOwnerID(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetOwnerID(*s) + } + return ophu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ophu *OauthProviderHistoryUpdate) ClearOwnerID() *OauthProviderHistoryUpdate { + ophu.mutation.ClearOwnerID() + return ophu +} + +// SetName sets the "name" field. +func (ophu *OauthProviderHistoryUpdate) SetName(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetName(s) + return ophu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableName(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetName(*s) + } + return ophu +} + +// SetClientID sets the "client_id" field. +func (ophu *OauthProviderHistoryUpdate) SetClientID(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetClientID(s) + return ophu +} + +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableClientID(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetClientID(*s) + } + return ophu +} + +// SetClientSecret sets the "client_secret" field. +func (ophu *OauthProviderHistoryUpdate) SetClientSecret(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetClientSecret(s) + return ophu +} + +// SetNillableClientSecret sets the "client_secret" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableClientSecret(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetClientSecret(*s) + } + return ophu +} + +// SetRedirectURL sets the "redirect_url" field. +func (ophu *OauthProviderHistoryUpdate) SetRedirectURL(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetRedirectURL(s) + return ophu +} + +// SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableRedirectURL(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetRedirectURL(*s) + } + return ophu +} + +// SetScopes sets the "scopes" field. +func (ophu *OauthProviderHistoryUpdate) SetScopes(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetScopes(s) + return ophu +} + +// SetNillableScopes sets the "scopes" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableScopes(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetScopes(*s) + } + return ophu +} + +// SetAuthURL sets the "auth_url" field. +func (ophu *OauthProviderHistoryUpdate) SetAuthURL(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetAuthURL(s) + return ophu +} + +// SetNillableAuthURL sets the "auth_url" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableAuthURL(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetAuthURL(*s) + } + return ophu +} + +// SetTokenURL sets the "token_url" field. +func (ophu *OauthProviderHistoryUpdate) SetTokenURL(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetTokenURL(s) + return ophu +} + +// SetNillableTokenURL sets the "token_url" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableTokenURL(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetTokenURL(*s) + } + return ophu +} + +// SetAuthStyle sets the "auth_style" field. +func (ophu *OauthProviderHistoryUpdate) SetAuthStyle(c customtypes.Uint8) *OauthProviderHistoryUpdate { + ophu.mutation.ResetAuthStyle() + ophu.mutation.SetAuthStyle(c) + return ophu +} + +// SetNillableAuthStyle sets the "auth_style" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableAuthStyle(c *customtypes.Uint8) *OauthProviderHistoryUpdate { + if c != nil { + ophu.SetAuthStyle(*c) + } + return ophu +} + +// AddAuthStyle adds c to the "auth_style" field. +func (ophu *OauthProviderHistoryUpdate) AddAuthStyle(c customtypes.Uint8) *OauthProviderHistoryUpdate { + ophu.mutation.AddAuthStyle(c) + return ophu +} + +// SetInfoURL sets the "info_url" field. +func (ophu *OauthProviderHistoryUpdate) SetInfoURL(s string) *OauthProviderHistoryUpdate { + ophu.mutation.SetInfoURL(s) + return ophu +} + +// SetNillableInfoURL sets the "info_url" field if the given value is not nil. +func (ophu *OauthProviderHistoryUpdate) SetNillableInfoURL(s *string) *OauthProviderHistoryUpdate { + if s != nil { + ophu.SetInfoURL(*s) + } + return ophu +} + +// Mutation returns the OauthProviderHistoryMutation object of the builder. +func (ophu *OauthProviderHistoryUpdate) Mutation() *OauthProviderHistoryMutation { + return ophu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ophu *OauthProviderHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ophu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ophu.sqlSave, ophu.mutation, ophu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ophu *OauthProviderHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ophu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ophu *OauthProviderHistoryUpdate) Exec(ctx context.Context) error { + _, err := ophu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ophu *OauthProviderHistoryUpdate) ExecX(ctx context.Context) { + if err := ophu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ophu *OauthProviderHistoryUpdate) defaults() error { + if _, ok := ophu.mutation.UpdatedAt(); !ok && !ophu.mutation.UpdatedAtCleared() { + if oauthproviderhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthproviderhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := oauthproviderhistory.UpdateDefaultUpdatedAt() + ophu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ophu *OauthProviderHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(oauthproviderhistory.Table, oauthproviderhistory.Columns, sqlgraph.NewFieldSpec(oauthproviderhistory.FieldID, field.TypeString)) + if ps := ophu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ophu.mutation.RefCleared() { + _spec.ClearField(oauthproviderhistory.FieldRef, field.TypeString) + } + if ophu.mutation.CreatedAtCleared() { + _spec.ClearField(oauthproviderhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ophu.mutation.UpdatedAt(); ok { + _spec.SetField(oauthproviderhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ophu.mutation.UpdatedAtCleared() { + _spec.ClearField(oauthproviderhistory.FieldUpdatedAt, field.TypeTime) + } + if ophu.mutation.CreatedByCleared() { + _spec.ClearField(oauthproviderhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ophu.mutation.UpdatedBy(); ok { + _spec.SetField(oauthproviderhistory.FieldUpdatedBy, field.TypeString, value) + } + if ophu.mutation.UpdatedByCleared() { + _spec.ClearField(oauthproviderhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ophu.mutation.Tags(); ok { + _spec.SetField(oauthproviderhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ophu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, oauthproviderhistory.FieldTags, value) + }) + } + if ophu.mutation.TagsCleared() { + _spec.ClearField(oauthproviderhistory.FieldTags, field.TypeJSON) + } + if value, ok := ophu.mutation.DeletedAt(); ok { + _spec.SetField(oauthproviderhistory.FieldDeletedAt, field.TypeTime, value) + } + if ophu.mutation.DeletedAtCleared() { + _spec.ClearField(oauthproviderhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ophu.mutation.DeletedBy(); ok { + _spec.SetField(oauthproviderhistory.FieldDeletedBy, field.TypeString, value) + } + if ophu.mutation.DeletedByCleared() { + _spec.ClearField(oauthproviderhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ophu.mutation.OwnerID(); ok { + _spec.SetField(oauthproviderhistory.FieldOwnerID, field.TypeString, value) + } + if ophu.mutation.OwnerIDCleared() { + _spec.ClearField(oauthproviderhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ophu.mutation.Name(); ok { + _spec.SetField(oauthproviderhistory.FieldName, field.TypeString, value) + } + if value, ok := ophu.mutation.ClientID(); ok { + _spec.SetField(oauthproviderhistory.FieldClientID, field.TypeString, value) + } + if value, ok := ophu.mutation.ClientSecret(); ok { + _spec.SetField(oauthproviderhistory.FieldClientSecret, field.TypeString, value) + } + if value, ok := ophu.mutation.RedirectURL(); ok { + _spec.SetField(oauthproviderhistory.FieldRedirectURL, field.TypeString, value) + } + if value, ok := ophu.mutation.Scopes(); ok { + _spec.SetField(oauthproviderhistory.FieldScopes, field.TypeString, value) + } + if value, ok := ophu.mutation.AuthURL(); ok { + _spec.SetField(oauthproviderhistory.FieldAuthURL, field.TypeString, value) + } + if value, ok := ophu.mutation.TokenURL(); ok { + _spec.SetField(oauthproviderhistory.FieldTokenURL, field.TypeString, value) + } + if value, ok := ophu.mutation.AuthStyle(); ok { + _spec.SetField(oauthproviderhistory.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := ophu.mutation.AddedAuthStyle(); ok { + _spec.AddField(oauthproviderhistory.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := ophu.mutation.InfoURL(); ok { + _spec.SetField(oauthproviderhistory.FieldInfoURL, field.TypeString, value) + } + _spec.Node.Schema = ophu.schemaConfig.OauthProviderHistory + ctx = internal.NewSchemaConfigContext(ctx, ophu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ophu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{oauthproviderhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ophu.mutation.done = true + return n, nil +} + +// OauthProviderHistoryUpdateOne is the builder for updating a single OauthProviderHistory entity. +type OauthProviderHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OauthProviderHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetUpdatedAt(t time.Time) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetUpdatedAt(t) + return ophuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ophuo *OauthProviderHistoryUpdateOne) ClearUpdatedAt() *OauthProviderHistoryUpdateOne { + ophuo.mutation.ClearUpdatedAt() + return ophuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetUpdatedBy(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetUpdatedBy(s) + return ophuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableUpdatedBy(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetUpdatedBy(*s) + } + return ophuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ophuo *OauthProviderHistoryUpdateOne) ClearUpdatedBy() *OauthProviderHistoryUpdateOne { + ophuo.mutation.ClearUpdatedBy() + return ophuo +} + +// SetTags sets the "tags" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetTags(s []string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetTags(s) + return ophuo +} + +// AppendTags appends s to the "tags" field. +func (ophuo *OauthProviderHistoryUpdateOne) AppendTags(s []string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.AppendTags(s) + return ophuo +} + +// ClearTags clears the value of the "tags" field. +func (ophuo *OauthProviderHistoryUpdateOne) ClearTags() *OauthProviderHistoryUpdateOne { + ophuo.mutation.ClearTags() + return ophuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetDeletedAt(t time.Time) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetDeletedAt(t) + return ophuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *OauthProviderHistoryUpdateOne { + if t != nil { + ophuo.SetDeletedAt(*t) + } + return ophuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ophuo *OauthProviderHistoryUpdateOne) ClearDeletedAt() *OauthProviderHistoryUpdateOne { + ophuo.mutation.ClearDeletedAt() + return ophuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetDeletedBy(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetDeletedBy(s) + return ophuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableDeletedBy(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetDeletedBy(*s) + } + return ophuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ophuo *OauthProviderHistoryUpdateOne) ClearDeletedBy() *OauthProviderHistoryUpdateOne { + ophuo.mutation.ClearDeletedBy() + return ophuo +} + +// SetOwnerID sets the "owner_id" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetOwnerID(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetOwnerID(s) + return ophuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableOwnerID(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetOwnerID(*s) + } + return ophuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (ophuo *OauthProviderHistoryUpdateOne) ClearOwnerID() *OauthProviderHistoryUpdateOne { + ophuo.mutation.ClearOwnerID() + return ophuo +} + +// SetName sets the "name" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetName(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetName(s) + return ophuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableName(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetName(*s) + } + return ophuo +} + +// SetClientID sets the "client_id" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetClientID(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetClientID(s) + return ophuo +} + +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableClientID(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetClientID(*s) + } + return ophuo +} + +// SetClientSecret sets the "client_secret" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetClientSecret(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetClientSecret(s) + return ophuo +} + +// SetNillableClientSecret sets the "client_secret" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableClientSecret(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetClientSecret(*s) + } + return ophuo +} + +// SetRedirectURL sets the "redirect_url" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetRedirectURL(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetRedirectURL(s) + return ophuo +} + +// SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableRedirectURL(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetRedirectURL(*s) + } + return ophuo +} + +// SetScopes sets the "scopes" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetScopes(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetScopes(s) + return ophuo +} + +// SetNillableScopes sets the "scopes" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableScopes(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetScopes(*s) + } + return ophuo +} + +// SetAuthURL sets the "auth_url" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetAuthURL(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetAuthURL(s) + return ophuo +} + +// SetNillableAuthURL sets the "auth_url" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableAuthURL(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetAuthURL(*s) + } + return ophuo +} + +// SetTokenURL sets the "token_url" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetTokenURL(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetTokenURL(s) + return ophuo +} + +// SetNillableTokenURL sets the "token_url" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableTokenURL(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetTokenURL(*s) + } + return ophuo +} + +// SetAuthStyle sets the "auth_style" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetAuthStyle(c customtypes.Uint8) *OauthProviderHistoryUpdateOne { + ophuo.mutation.ResetAuthStyle() + ophuo.mutation.SetAuthStyle(c) + return ophuo +} + +// SetNillableAuthStyle sets the "auth_style" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableAuthStyle(c *customtypes.Uint8) *OauthProviderHistoryUpdateOne { + if c != nil { + ophuo.SetAuthStyle(*c) + } + return ophuo +} + +// AddAuthStyle adds c to the "auth_style" field. +func (ophuo *OauthProviderHistoryUpdateOne) AddAuthStyle(c customtypes.Uint8) *OauthProviderHistoryUpdateOne { + ophuo.mutation.AddAuthStyle(c) + return ophuo +} + +// SetInfoURL sets the "info_url" field. +func (ophuo *OauthProviderHistoryUpdateOne) SetInfoURL(s string) *OauthProviderHistoryUpdateOne { + ophuo.mutation.SetInfoURL(s) + return ophuo +} + +// SetNillableInfoURL sets the "info_url" field if the given value is not nil. +func (ophuo *OauthProviderHistoryUpdateOne) SetNillableInfoURL(s *string) *OauthProviderHistoryUpdateOne { + if s != nil { + ophuo.SetInfoURL(*s) + } + return ophuo +} + +// Mutation returns the OauthProviderHistoryMutation object of the builder. +func (ophuo *OauthProviderHistoryUpdateOne) Mutation() *OauthProviderHistoryMutation { + return ophuo.mutation +} + +// Where appends a list predicates to the OauthProviderHistoryUpdate builder. +func (ophuo *OauthProviderHistoryUpdateOne) Where(ps ...predicate.OauthProviderHistory) *OauthProviderHistoryUpdateOne { + ophuo.mutation.Where(ps...) + return ophuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ophuo *OauthProviderHistoryUpdateOne) Select(field string, fields ...string) *OauthProviderHistoryUpdateOne { + ophuo.fields = append([]string{field}, fields...) + return ophuo +} + +// Save executes the query and returns the updated OauthProviderHistory entity. +func (ophuo *OauthProviderHistoryUpdateOne) Save(ctx context.Context) (*OauthProviderHistory, error) { + if err := ophuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ophuo.sqlSave, ophuo.mutation, ophuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ophuo *OauthProviderHistoryUpdateOne) SaveX(ctx context.Context) *OauthProviderHistory { + node, err := ophuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ophuo *OauthProviderHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ophuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ophuo *OauthProviderHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ophuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ophuo *OauthProviderHistoryUpdateOne) defaults() error { + if _, ok := ophuo.mutation.UpdatedAt(); !ok && !ophuo.mutation.UpdatedAtCleared() { + if oauthproviderhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized oauthproviderhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := oauthproviderhistory.UpdateDefaultUpdatedAt() + ophuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ophuo *OauthProviderHistoryUpdateOne) sqlSave(ctx context.Context) (_node *OauthProviderHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(oauthproviderhistory.Table, oauthproviderhistory.Columns, sqlgraph.NewFieldSpec(oauthproviderhistory.FieldID, field.TypeString)) + id, ok := ophuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OauthProviderHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ophuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, oauthproviderhistory.FieldID) + for _, f := range fields { + if !oauthproviderhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != oauthproviderhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ophuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ophuo.mutation.RefCleared() { + _spec.ClearField(oauthproviderhistory.FieldRef, field.TypeString) + } + if ophuo.mutation.CreatedAtCleared() { + _spec.ClearField(oauthproviderhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ophuo.mutation.UpdatedAt(); ok { + _spec.SetField(oauthproviderhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ophuo.mutation.UpdatedAtCleared() { + _spec.ClearField(oauthproviderhistory.FieldUpdatedAt, field.TypeTime) + } + if ophuo.mutation.CreatedByCleared() { + _spec.ClearField(oauthproviderhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ophuo.mutation.UpdatedBy(); ok { + _spec.SetField(oauthproviderhistory.FieldUpdatedBy, field.TypeString, value) + } + if ophuo.mutation.UpdatedByCleared() { + _spec.ClearField(oauthproviderhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ophuo.mutation.Tags(); ok { + _spec.SetField(oauthproviderhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ophuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, oauthproviderhistory.FieldTags, value) + }) + } + if ophuo.mutation.TagsCleared() { + _spec.ClearField(oauthproviderhistory.FieldTags, field.TypeJSON) + } + if value, ok := ophuo.mutation.DeletedAt(); ok { + _spec.SetField(oauthproviderhistory.FieldDeletedAt, field.TypeTime, value) + } + if ophuo.mutation.DeletedAtCleared() { + _spec.ClearField(oauthproviderhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ophuo.mutation.DeletedBy(); ok { + _spec.SetField(oauthproviderhistory.FieldDeletedBy, field.TypeString, value) + } + if ophuo.mutation.DeletedByCleared() { + _spec.ClearField(oauthproviderhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ophuo.mutation.OwnerID(); ok { + _spec.SetField(oauthproviderhistory.FieldOwnerID, field.TypeString, value) + } + if ophuo.mutation.OwnerIDCleared() { + _spec.ClearField(oauthproviderhistory.FieldOwnerID, field.TypeString) + } + if value, ok := ophuo.mutation.Name(); ok { + _spec.SetField(oauthproviderhistory.FieldName, field.TypeString, value) + } + if value, ok := ophuo.mutation.ClientID(); ok { + _spec.SetField(oauthproviderhistory.FieldClientID, field.TypeString, value) + } + if value, ok := ophuo.mutation.ClientSecret(); ok { + _spec.SetField(oauthproviderhistory.FieldClientSecret, field.TypeString, value) + } + if value, ok := ophuo.mutation.RedirectURL(); ok { + _spec.SetField(oauthproviderhistory.FieldRedirectURL, field.TypeString, value) + } + if value, ok := ophuo.mutation.Scopes(); ok { + _spec.SetField(oauthproviderhistory.FieldScopes, field.TypeString, value) + } + if value, ok := ophuo.mutation.AuthURL(); ok { + _spec.SetField(oauthproviderhistory.FieldAuthURL, field.TypeString, value) + } + if value, ok := ophuo.mutation.TokenURL(); ok { + _spec.SetField(oauthproviderhistory.FieldTokenURL, field.TypeString, value) + } + if value, ok := ophuo.mutation.AuthStyle(); ok { + _spec.SetField(oauthproviderhistory.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := ophuo.mutation.AddedAuthStyle(); ok { + _spec.AddField(oauthproviderhistory.FieldAuthStyle, field.TypeUint8, value) + } + if value, ok := ophuo.mutation.InfoURL(); ok { + _spec.SetField(oauthproviderhistory.FieldInfoURL, field.TypeString, value) + } + _spec.Node.Schema = ophuo.schemaConfig.OauthProviderHistory + ctx = internal.NewSchemaConfigContext(ctx, ophuo.schemaConfig) + _node = &OauthProviderHistory{config: ophuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ophuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{oauthproviderhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ophuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/ohauthtootoken.go b/internal/ent/generated/ohauthtootoken.go new file mode 100644 index 0000000..2e4d852 --- /dev/null +++ b/internal/ent/generated/ohauthtootoken.go @@ -0,0 +1,355 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" +) + +// OhAuthTooToken is the model entity for the OhAuthTooToken schema. +type OhAuthTooToken struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // ClientID holds the value of the "client_id" field. + ClientID string `json:"client_id,omitempty"` + // Scopes holds the value of the "scopes" field. + Scopes []string `json:"scopes,omitempty"` + // Nonce holds the value of the "nonce" field. + Nonce string `json:"nonce,omitempty"` + // ClaimsUserID holds the value of the "claims_user_id" field. + ClaimsUserID string `json:"claims_user_id,omitempty"` + // ClaimsUsername holds the value of the "claims_username" field. + ClaimsUsername string `json:"claims_username,omitempty"` + // ClaimsEmail holds the value of the "claims_email" field. + ClaimsEmail string `json:"claims_email,omitempty"` + // ClaimsEmailVerified holds the value of the "claims_email_verified" field. + ClaimsEmailVerified bool `json:"claims_email_verified,omitempty"` + // ClaimsGroups holds the value of the "claims_groups" field. + ClaimsGroups []string `json:"claims_groups,omitempty"` + // ClaimsPreferredUsername holds the value of the "claims_preferred_username" field. + ClaimsPreferredUsername string `json:"claims_preferred_username,omitempty"` + // ConnectorID holds the value of the "connector_id" field. + ConnectorID string `json:"connector_id,omitempty"` + // ConnectorData holds the value of the "connector_data" field. + ConnectorData []string `json:"connector_data,omitempty"` + // LastUsed holds the value of the "last_used" field. + LastUsed time.Time `json:"last_used,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the OhAuthTooTokenQuery when eager-loading is set. + Edges OhAuthTooTokenEdges `json:"edges"` + selectValues sql.SelectValues +} + +// OhAuthTooTokenEdges holds the relations/edges for other nodes in the graph. +type OhAuthTooTokenEdges struct { + // Integration holds the value of the integration edge. + Integration []*Integration `json:"integration,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int + + namedIntegration map[string][]*Integration + namedEvents map[string][]*Event +} + +// IntegrationOrErr returns the Integration value or an error if the edge +// was not loaded in eager-loading. +func (e OhAuthTooTokenEdges) IntegrationOrErr() ([]*Integration, error) { + if e.loadedTypes[0] { + return e.Integration, nil + } + return nil, &NotLoadedError{edge: "integration"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e OhAuthTooTokenEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[1] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OhAuthTooToken) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case ohauthtootoken.FieldTags, ohauthtootoken.FieldScopes, ohauthtootoken.FieldClaimsGroups, ohauthtootoken.FieldConnectorData: + values[i] = new([]byte) + case ohauthtootoken.FieldClaimsEmailVerified: + values[i] = new(sql.NullBool) + case ohauthtootoken.FieldID, ohauthtootoken.FieldMappingID, ohauthtootoken.FieldClientID, ohauthtootoken.FieldNonce, ohauthtootoken.FieldClaimsUserID, ohauthtootoken.FieldClaimsUsername, ohauthtootoken.FieldClaimsEmail, ohauthtootoken.FieldClaimsPreferredUsername, ohauthtootoken.FieldConnectorID: + values[i] = new(sql.NullString) + case ohauthtootoken.FieldLastUsed: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OhAuthTooToken fields. +func (oatt *OhAuthTooToken) 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 ohauthtootoken.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + oatt.ID = value.String + } + case ohauthtootoken.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + oatt.MappingID = value.String + } + case ohauthtootoken.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &oatt.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case ohauthtootoken.FieldClientID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field client_id", values[i]) + } else if value.Valid { + oatt.ClientID = value.String + } + case ohauthtootoken.FieldScopes: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field scopes", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &oatt.Scopes); err != nil { + return fmt.Errorf("unmarshal field scopes: %w", err) + } + } + case ohauthtootoken.FieldNonce: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field nonce", values[i]) + } else if value.Valid { + oatt.Nonce = value.String + } + case ohauthtootoken.FieldClaimsUserID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field claims_user_id", values[i]) + } else if value.Valid { + oatt.ClaimsUserID = value.String + } + case ohauthtootoken.FieldClaimsUsername: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field claims_username", values[i]) + } else if value.Valid { + oatt.ClaimsUsername = value.String + } + case ohauthtootoken.FieldClaimsEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field claims_email", values[i]) + } else if value.Valid { + oatt.ClaimsEmail = value.String + } + case ohauthtootoken.FieldClaimsEmailVerified: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field claims_email_verified", values[i]) + } else if value.Valid { + oatt.ClaimsEmailVerified = value.Bool + } + case ohauthtootoken.FieldClaimsGroups: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field claims_groups", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &oatt.ClaimsGroups); err != nil { + return fmt.Errorf("unmarshal field claims_groups: %w", err) + } + } + case ohauthtootoken.FieldClaimsPreferredUsername: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field claims_preferred_username", values[i]) + } else if value.Valid { + oatt.ClaimsPreferredUsername = value.String + } + case ohauthtootoken.FieldConnectorID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field connector_id", values[i]) + } else if value.Valid { + oatt.ConnectorID = value.String + } + case ohauthtootoken.FieldConnectorData: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field connector_data", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &oatt.ConnectorData); err != nil { + return fmt.Errorf("unmarshal field connector_data: %w", err) + } + } + case ohauthtootoken.FieldLastUsed: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field last_used", values[i]) + } else if value.Valid { + oatt.LastUsed = value.Time + } + default: + oatt.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OhAuthTooToken. +// This includes values selected through modifiers, order, etc. +func (oatt *OhAuthTooToken) Value(name string) (ent.Value, error) { + return oatt.selectValues.Get(name) +} + +// QueryIntegration queries the "integration" edge of the OhAuthTooToken entity. +func (oatt *OhAuthTooToken) QueryIntegration() *IntegrationQuery { + return NewOhAuthTooTokenClient(oatt.config).QueryIntegration(oatt) +} + +// QueryEvents queries the "events" edge of the OhAuthTooToken entity. +func (oatt *OhAuthTooToken) QueryEvents() *EventQuery { + return NewOhAuthTooTokenClient(oatt.config).QueryEvents(oatt) +} + +// Update returns a builder for updating this OhAuthTooToken. +// Note that you need to call OhAuthTooToken.Unwrap() before calling this method if this OhAuthTooToken +// was returned from a transaction, and the transaction was committed or rolled back. +func (oatt *OhAuthTooToken) Update() *OhAuthTooTokenUpdateOne { + return NewOhAuthTooTokenClient(oatt.config).UpdateOne(oatt) +} + +// Unwrap unwraps the OhAuthTooToken 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 (oatt *OhAuthTooToken) Unwrap() *OhAuthTooToken { + _tx, ok := oatt.config.driver.(*txDriver) + if !ok { + panic("generated: OhAuthTooToken is not a transactional entity") + } + oatt.config.driver = _tx.drv + return oatt +} + +// String implements the fmt.Stringer. +func (oatt *OhAuthTooToken) String() string { + var builder strings.Builder + builder.WriteString("OhAuthTooToken(") + builder.WriteString(fmt.Sprintf("id=%v, ", oatt.ID)) + builder.WriteString("mapping_id=") + builder.WriteString(oatt.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", oatt.Tags)) + builder.WriteString(", ") + builder.WriteString("client_id=") + builder.WriteString(oatt.ClientID) + builder.WriteString(", ") + builder.WriteString("scopes=") + builder.WriteString(fmt.Sprintf("%v", oatt.Scopes)) + builder.WriteString(", ") + builder.WriteString("nonce=") + builder.WriteString(oatt.Nonce) + builder.WriteString(", ") + builder.WriteString("claims_user_id=") + builder.WriteString(oatt.ClaimsUserID) + builder.WriteString(", ") + builder.WriteString("claims_username=") + builder.WriteString(oatt.ClaimsUsername) + builder.WriteString(", ") + builder.WriteString("claims_email=") + builder.WriteString(oatt.ClaimsEmail) + builder.WriteString(", ") + builder.WriteString("claims_email_verified=") + builder.WriteString(fmt.Sprintf("%v", oatt.ClaimsEmailVerified)) + builder.WriteString(", ") + builder.WriteString("claims_groups=") + builder.WriteString(fmt.Sprintf("%v", oatt.ClaimsGroups)) + builder.WriteString(", ") + builder.WriteString("claims_preferred_username=") + builder.WriteString(oatt.ClaimsPreferredUsername) + builder.WriteString(", ") + builder.WriteString("connector_id=") + builder.WriteString(oatt.ConnectorID) + builder.WriteString(", ") + builder.WriteString("connector_data=") + builder.WriteString(fmt.Sprintf("%v", oatt.ConnectorData)) + builder.WriteString(", ") + builder.WriteString("last_used=") + builder.WriteString(oatt.LastUsed.Format(time.ANSIC)) + builder.WriteByte(')') + return builder.String() +} + +// NamedIntegration returns the Integration named value or an error if the edge was not +// loaded in eager-loading with this name. +func (oatt *OhAuthTooToken) NamedIntegration(name string) ([]*Integration, error) { + if oatt.Edges.namedIntegration == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := oatt.Edges.namedIntegration[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (oatt *OhAuthTooToken) appendNamedIntegration(name string, edges ...*Integration) { + if oatt.Edges.namedIntegration == nil { + oatt.Edges.namedIntegration = make(map[string][]*Integration) + } + if len(edges) == 0 { + oatt.Edges.namedIntegration[name] = []*Integration{} + } else { + oatt.Edges.namedIntegration[name] = append(oatt.Edges.namedIntegration[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (oatt *OhAuthTooToken) NamedEvents(name string) ([]*Event, error) { + if oatt.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := oatt.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (oatt *OhAuthTooToken) appendNamedEvents(name string, edges ...*Event) { + if oatt.Edges.namedEvents == nil { + oatt.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + oatt.Edges.namedEvents[name] = []*Event{} + } else { + oatt.Edges.namedEvents[name] = append(oatt.Edges.namedEvents[name], edges...) + } +} + +// OhAuthTooTokens is a parsable slice of OhAuthTooToken. +type OhAuthTooTokens []*OhAuthTooToken diff --git a/internal/ent/generated/ohauthtootoken/ohauthtootoken.go b/internal/ent/generated/ohauthtootoken/ohauthtootoken.go new file mode 100644 index 0000000..8bcaa5f --- /dev/null +++ b/internal/ent/generated/ohauthtootoken/ohauthtootoken.go @@ -0,0 +1,222 @@ +// Code generated by ent, DO NOT EDIT. + +package ohauthtootoken + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the ohauthtootoken type in the database. + Label = "oh_auth_too_token" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldClientID holds the string denoting the client_id field in the database. + FieldClientID = "client_id" + // FieldScopes holds the string denoting the scopes field in the database. + FieldScopes = "scopes" + // FieldNonce holds the string denoting the nonce field in the database. + FieldNonce = "nonce" + // FieldClaimsUserID holds the string denoting the claims_user_id field in the database. + FieldClaimsUserID = "claims_user_id" + // FieldClaimsUsername holds the string denoting the claims_username field in the database. + FieldClaimsUsername = "claims_username" + // FieldClaimsEmail holds the string denoting the claims_email field in the database. + FieldClaimsEmail = "claims_email" + // FieldClaimsEmailVerified holds the string denoting the claims_email_verified field in the database. + FieldClaimsEmailVerified = "claims_email_verified" + // FieldClaimsGroups holds the string denoting the claims_groups field in the database. + FieldClaimsGroups = "claims_groups" + // FieldClaimsPreferredUsername holds the string denoting the claims_preferred_username field in the database. + FieldClaimsPreferredUsername = "claims_preferred_username" + // FieldConnectorID holds the string denoting the connector_id field in the database. + FieldConnectorID = "connector_id" + // FieldConnectorData holds the string denoting the connector_data field in the database. + FieldConnectorData = "connector_data" + // FieldLastUsed holds the string denoting the last_used field in the database. + FieldLastUsed = "last_used" + // EdgeIntegration holds the string denoting the integration edge name in mutations. + EdgeIntegration = "integration" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the ohauthtootoken in the database. + Table = "oh_auth_too_tokens" + // IntegrationTable is the table that holds the integration relation/edge. The primary key declared below. + IntegrationTable = "integration_oauth2tokens" + // IntegrationInverseTable is the table name for the Integration entity. + // It exists in this package in order to avoid circular dependency with the "integration" package. + IntegrationInverseTable = "integrations" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "oh_auth_too_token_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for ohauthtootoken fields. +var Columns = []string{ + FieldID, + FieldMappingID, + FieldTags, + FieldClientID, + FieldScopes, + FieldNonce, + FieldClaimsUserID, + FieldClaimsUsername, + FieldClaimsEmail, + FieldClaimsEmailVerified, + FieldClaimsGroups, + FieldClaimsPreferredUsername, + FieldConnectorID, + FieldConnectorData, + FieldLastUsed, +} + +var ( + // IntegrationPrimaryKey and IntegrationColumn2 are the table columns denoting the + // primary key for the integration relation (M2M). + IntegrationPrimaryKey = []string{"integration_id", "oh_auth_too_token_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"oh_auth_too_token_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +var ( + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // ClientIDValidator is a validator for the "client_id" field. It is called by the builders before save. + ClientIDValidator func(string) error + // NonceValidator is a validator for the "nonce" field. It is called by the builders before save. + NonceValidator func(string) error + // ClaimsUserIDValidator is a validator for the "claims_user_id" field. It is called by the builders before save. + ClaimsUserIDValidator func(string) error + // ClaimsUsernameValidator is a validator for the "claims_username" field. It is called by the builders before save. + ClaimsUsernameValidator func(string) error + // ClaimsEmailValidator is a validator for the "claims_email" field. It is called by the builders before save. + ClaimsEmailValidator func(string) error + // ConnectorIDValidator is a validator for the "connector_id" field. It is called by the builders before save. + ConnectorIDValidator func(string) error + // DefaultLastUsed holds the default value on creation for the "last_used" field. + DefaultLastUsed func() time.Time + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the OhAuthTooToken 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() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByClientID orders the results by the client_id field. +func ByClientID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClientID, opts...).ToFunc() +} + +// ByNonce orders the results by the nonce field. +func ByNonce(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldNonce, opts...).ToFunc() +} + +// ByClaimsUserID orders the results by the claims_user_id field. +func ByClaimsUserID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClaimsUserID, opts...).ToFunc() +} + +// ByClaimsUsername orders the results by the claims_username field. +func ByClaimsUsername(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClaimsUsername, opts...).ToFunc() +} + +// ByClaimsEmail orders the results by the claims_email field. +func ByClaimsEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClaimsEmail, opts...).ToFunc() +} + +// ByClaimsEmailVerified orders the results by the claims_email_verified field. +func ByClaimsEmailVerified(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClaimsEmailVerified, opts...).ToFunc() +} + +// ByClaimsPreferredUsername orders the results by the claims_preferred_username field. +func ByClaimsPreferredUsername(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldClaimsPreferredUsername, opts...).ToFunc() +} + +// ByConnectorID orders the results by the connector_id field. +func ByConnectorID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldConnectorID, opts...).ToFunc() +} + +// ByLastUsed orders the results by the last_used field. +func ByLastUsed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastUsed, opts...).ToFunc() +} + +// ByIntegrationCount orders the results by integration count. +func ByIntegrationCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newIntegrationStep(), opts...) + } +} + +// ByIntegration orders the results by integration terms. +func ByIntegration(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newIntegrationStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newIntegrationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(IntegrationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationTable, IntegrationPrimaryKey...), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} diff --git a/internal/ent/generated/ohauthtootoken/where.go b/internal/ent/generated/ohauthtootoken/where.go new file mode 100644 index 0000000..1f815d6 --- /dev/null +++ b/internal/ent/generated/ohauthtootoken/where.go @@ -0,0 +1,801 @@ +// Code generated by ent, DO NOT EDIT. + +package ohauthtootoken + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldID, id)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldMappingID, v)) +} + +// ClientID applies equality check predicate on the "client_id" field. It's identical to ClientIDEQ. +func ClientID(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClientID, v)) +} + +// Nonce applies equality check predicate on the "nonce" field. It's identical to NonceEQ. +func Nonce(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldNonce, v)) +} + +// ClaimsUserID applies equality check predicate on the "claims_user_id" field. It's identical to ClaimsUserIDEQ. +func ClaimsUserID(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsUserID, v)) +} + +// ClaimsUsername applies equality check predicate on the "claims_username" field. It's identical to ClaimsUsernameEQ. +func ClaimsUsername(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsUsername, v)) +} + +// ClaimsEmail applies equality check predicate on the "claims_email" field. It's identical to ClaimsEmailEQ. +func ClaimsEmail(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsEmail, v)) +} + +// ClaimsEmailVerified applies equality check predicate on the "claims_email_verified" field. It's identical to ClaimsEmailVerifiedEQ. +func ClaimsEmailVerified(v bool) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsEmailVerified, v)) +} + +// ClaimsPreferredUsername applies equality check predicate on the "claims_preferred_username" field. It's identical to ClaimsPreferredUsernameEQ. +func ClaimsPreferredUsername(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsPreferredUsername, v)) +} + +// ConnectorID applies equality check predicate on the "connector_id" field. It's identical to ConnectorIDEQ. +func ConnectorID(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldConnectorID, v)) +} + +// LastUsed applies equality check predicate on the "last_used" field. It's identical to LastUsedEQ. +func LastUsed(v time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldLastUsed, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotNull(FieldTags)) +} + +// ClientIDEQ applies the EQ predicate on the "client_id" field. +func ClientIDEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClientID, v)) +} + +// ClientIDNEQ applies the NEQ predicate on the "client_id" field. +func ClientIDNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldClientID, v)) +} + +// ClientIDIn applies the In predicate on the "client_id" field. +func ClientIDIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldClientID, vs...)) +} + +// ClientIDNotIn applies the NotIn predicate on the "client_id" field. +func ClientIDNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldClientID, vs...)) +} + +// ClientIDGT applies the GT predicate on the "client_id" field. +func ClientIDGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldClientID, v)) +} + +// ClientIDGTE applies the GTE predicate on the "client_id" field. +func ClientIDGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldClientID, v)) +} + +// ClientIDLT applies the LT predicate on the "client_id" field. +func ClientIDLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldClientID, v)) +} + +// ClientIDLTE applies the LTE predicate on the "client_id" field. +func ClientIDLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldClientID, v)) +} + +// ClientIDContains applies the Contains predicate on the "client_id" field. +func ClientIDContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldClientID, v)) +} + +// ClientIDHasPrefix applies the HasPrefix predicate on the "client_id" field. +func ClientIDHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldClientID, v)) +} + +// ClientIDHasSuffix applies the HasSuffix predicate on the "client_id" field. +func ClientIDHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldClientID, v)) +} + +// ClientIDEqualFold applies the EqualFold predicate on the "client_id" field. +func ClientIDEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldClientID, v)) +} + +// ClientIDContainsFold applies the ContainsFold predicate on the "client_id" field. +func ClientIDContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldClientID, v)) +} + +// ScopesIsNil applies the IsNil predicate on the "scopes" field. +func ScopesIsNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIsNull(FieldScopes)) +} + +// ScopesNotNil applies the NotNil predicate on the "scopes" field. +func ScopesNotNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotNull(FieldScopes)) +} + +// NonceEQ applies the EQ predicate on the "nonce" field. +func NonceEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldNonce, v)) +} + +// NonceNEQ applies the NEQ predicate on the "nonce" field. +func NonceNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldNonce, v)) +} + +// NonceIn applies the In predicate on the "nonce" field. +func NonceIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldNonce, vs...)) +} + +// NonceNotIn applies the NotIn predicate on the "nonce" field. +func NonceNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldNonce, vs...)) +} + +// NonceGT applies the GT predicate on the "nonce" field. +func NonceGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldNonce, v)) +} + +// NonceGTE applies the GTE predicate on the "nonce" field. +func NonceGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldNonce, v)) +} + +// NonceLT applies the LT predicate on the "nonce" field. +func NonceLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldNonce, v)) +} + +// NonceLTE applies the LTE predicate on the "nonce" field. +func NonceLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldNonce, v)) +} + +// NonceContains applies the Contains predicate on the "nonce" field. +func NonceContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldNonce, v)) +} + +// NonceHasPrefix applies the HasPrefix predicate on the "nonce" field. +func NonceHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldNonce, v)) +} + +// NonceHasSuffix applies the HasSuffix predicate on the "nonce" field. +func NonceHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldNonce, v)) +} + +// NonceEqualFold applies the EqualFold predicate on the "nonce" field. +func NonceEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldNonce, v)) +} + +// NonceContainsFold applies the ContainsFold predicate on the "nonce" field. +func NonceContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldNonce, v)) +} + +// ClaimsUserIDEQ applies the EQ predicate on the "claims_user_id" field. +func ClaimsUserIDEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsUserID, v)) +} + +// ClaimsUserIDNEQ applies the NEQ predicate on the "claims_user_id" field. +func ClaimsUserIDNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldClaimsUserID, v)) +} + +// ClaimsUserIDIn applies the In predicate on the "claims_user_id" field. +func ClaimsUserIDIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldClaimsUserID, vs...)) +} + +// ClaimsUserIDNotIn applies the NotIn predicate on the "claims_user_id" field. +func ClaimsUserIDNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldClaimsUserID, vs...)) +} + +// ClaimsUserIDGT applies the GT predicate on the "claims_user_id" field. +func ClaimsUserIDGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldClaimsUserID, v)) +} + +// ClaimsUserIDGTE applies the GTE predicate on the "claims_user_id" field. +func ClaimsUserIDGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldClaimsUserID, v)) +} + +// ClaimsUserIDLT applies the LT predicate on the "claims_user_id" field. +func ClaimsUserIDLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldClaimsUserID, v)) +} + +// ClaimsUserIDLTE applies the LTE predicate on the "claims_user_id" field. +func ClaimsUserIDLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldClaimsUserID, v)) +} + +// ClaimsUserIDContains applies the Contains predicate on the "claims_user_id" field. +func ClaimsUserIDContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldClaimsUserID, v)) +} + +// ClaimsUserIDHasPrefix applies the HasPrefix predicate on the "claims_user_id" field. +func ClaimsUserIDHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldClaimsUserID, v)) +} + +// ClaimsUserIDHasSuffix applies the HasSuffix predicate on the "claims_user_id" field. +func ClaimsUserIDHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldClaimsUserID, v)) +} + +// ClaimsUserIDEqualFold applies the EqualFold predicate on the "claims_user_id" field. +func ClaimsUserIDEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldClaimsUserID, v)) +} + +// ClaimsUserIDContainsFold applies the ContainsFold predicate on the "claims_user_id" field. +func ClaimsUserIDContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldClaimsUserID, v)) +} + +// ClaimsUsernameEQ applies the EQ predicate on the "claims_username" field. +func ClaimsUsernameEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsUsername, v)) +} + +// ClaimsUsernameNEQ applies the NEQ predicate on the "claims_username" field. +func ClaimsUsernameNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldClaimsUsername, v)) +} + +// ClaimsUsernameIn applies the In predicate on the "claims_username" field. +func ClaimsUsernameIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldClaimsUsername, vs...)) +} + +// ClaimsUsernameNotIn applies the NotIn predicate on the "claims_username" field. +func ClaimsUsernameNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldClaimsUsername, vs...)) +} + +// ClaimsUsernameGT applies the GT predicate on the "claims_username" field. +func ClaimsUsernameGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldClaimsUsername, v)) +} + +// ClaimsUsernameGTE applies the GTE predicate on the "claims_username" field. +func ClaimsUsernameGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldClaimsUsername, v)) +} + +// ClaimsUsernameLT applies the LT predicate on the "claims_username" field. +func ClaimsUsernameLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldClaimsUsername, v)) +} + +// ClaimsUsernameLTE applies the LTE predicate on the "claims_username" field. +func ClaimsUsernameLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldClaimsUsername, v)) +} + +// ClaimsUsernameContains applies the Contains predicate on the "claims_username" field. +func ClaimsUsernameContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldClaimsUsername, v)) +} + +// ClaimsUsernameHasPrefix applies the HasPrefix predicate on the "claims_username" field. +func ClaimsUsernameHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldClaimsUsername, v)) +} + +// ClaimsUsernameHasSuffix applies the HasSuffix predicate on the "claims_username" field. +func ClaimsUsernameHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldClaimsUsername, v)) +} + +// ClaimsUsernameEqualFold applies the EqualFold predicate on the "claims_username" field. +func ClaimsUsernameEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldClaimsUsername, v)) +} + +// ClaimsUsernameContainsFold applies the ContainsFold predicate on the "claims_username" field. +func ClaimsUsernameContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldClaimsUsername, v)) +} + +// ClaimsEmailEQ applies the EQ predicate on the "claims_email" field. +func ClaimsEmailEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsEmail, v)) +} + +// ClaimsEmailNEQ applies the NEQ predicate on the "claims_email" field. +func ClaimsEmailNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldClaimsEmail, v)) +} + +// ClaimsEmailIn applies the In predicate on the "claims_email" field. +func ClaimsEmailIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldClaimsEmail, vs...)) +} + +// ClaimsEmailNotIn applies the NotIn predicate on the "claims_email" field. +func ClaimsEmailNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldClaimsEmail, vs...)) +} + +// ClaimsEmailGT applies the GT predicate on the "claims_email" field. +func ClaimsEmailGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldClaimsEmail, v)) +} + +// ClaimsEmailGTE applies the GTE predicate on the "claims_email" field. +func ClaimsEmailGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldClaimsEmail, v)) +} + +// ClaimsEmailLT applies the LT predicate on the "claims_email" field. +func ClaimsEmailLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldClaimsEmail, v)) +} + +// ClaimsEmailLTE applies the LTE predicate on the "claims_email" field. +func ClaimsEmailLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldClaimsEmail, v)) +} + +// ClaimsEmailContains applies the Contains predicate on the "claims_email" field. +func ClaimsEmailContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldClaimsEmail, v)) +} + +// ClaimsEmailHasPrefix applies the HasPrefix predicate on the "claims_email" field. +func ClaimsEmailHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldClaimsEmail, v)) +} + +// ClaimsEmailHasSuffix applies the HasSuffix predicate on the "claims_email" field. +func ClaimsEmailHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldClaimsEmail, v)) +} + +// ClaimsEmailEqualFold applies the EqualFold predicate on the "claims_email" field. +func ClaimsEmailEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldClaimsEmail, v)) +} + +// ClaimsEmailContainsFold applies the ContainsFold predicate on the "claims_email" field. +func ClaimsEmailContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldClaimsEmail, v)) +} + +// ClaimsEmailVerifiedEQ applies the EQ predicate on the "claims_email_verified" field. +func ClaimsEmailVerifiedEQ(v bool) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsEmailVerified, v)) +} + +// ClaimsEmailVerifiedNEQ applies the NEQ predicate on the "claims_email_verified" field. +func ClaimsEmailVerifiedNEQ(v bool) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldClaimsEmailVerified, v)) +} + +// ClaimsGroupsIsNil applies the IsNil predicate on the "claims_groups" field. +func ClaimsGroupsIsNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIsNull(FieldClaimsGroups)) +} + +// ClaimsGroupsNotNil applies the NotNil predicate on the "claims_groups" field. +func ClaimsGroupsNotNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotNull(FieldClaimsGroups)) +} + +// ClaimsPreferredUsernameEQ applies the EQ predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameNEQ applies the NEQ predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameIn applies the In predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldClaimsPreferredUsername, vs...)) +} + +// ClaimsPreferredUsernameNotIn applies the NotIn predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldClaimsPreferredUsername, vs...)) +} + +// ClaimsPreferredUsernameGT applies the GT predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameGTE applies the GTE predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameLT applies the LT predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameLTE applies the LTE predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameContains applies the Contains predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameHasPrefix applies the HasPrefix predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameHasSuffix applies the HasSuffix predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameEqualFold applies the EqualFold predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldClaimsPreferredUsername, v)) +} + +// ClaimsPreferredUsernameContainsFold applies the ContainsFold predicate on the "claims_preferred_username" field. +func ClaimsPreferredUsernameContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldClaimsPreferredUsername, v)) +} + +// ConnectorIDEQ applies the EQ predicate on the "connector_id" field. +func ConnectorIDEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldConnectorID, v)) +} + +// ConnectorIDNEQ applies the NEQ predicate on the "connector_id" field. +func ConnectorIDNEQ(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldConnectorID, v)) +} + +// ConnectorIDIn applies the In predicate on the "connector_id" field. +func ConnectorIDIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldConnectorID, vs...)) +} + +// ConnectorIDNotIn applies the NotIn predicate on the "connector_id" field. +func ConnectorIDNotIn(vs ...string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldConnectorID, vs...)) +} + +// ConnectorIDGT applies the GT predicate on the "connector_id" field. +func ConnectorIDGT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldConnectorID, v)) +} + +// ConnectorIDGTE applies the GTE predicate on the "connector_id" field. +func ConnectorIDGTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldConnectorID, v)) +} + +// ConnectorIDLT applies the LT predicate on the "connector_id" field. +func ConnectorIDLT(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldConnectorID, v)) +} + +// ConnectorIDLTE applies the LTE predicate on the "connector_id" field. +func ConnectorIDLTE(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldConnectorID, v)) +} + +// ConnectorIDContains applies the Contains predicate on the "connector_id" field. +func ConnectorIDContains(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContains(FieldConnectorID, v)) +} + +// ConnectorIDHasPrefix applies the HasPrefix predicate on the "connector_id" field. +func ConnectorIDHasPrefix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasPrefix(FieldConnectorID, v)) +} + +// ConnectorIDHasSuffix applies the HasSuffix predicate on the "connector_id" field. +func ConnectorIDHasSuffix(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldHasSuffix(FieldConnectorID, v)) +} + +// ConnectorIDEqualFold applies the EqualFold predicate on the "connector_id" field. +func ConnectorIDEqualFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEqualFold(FieldConnectorID, v)) +} + +// ConnectorIDContainsFold applies the ContainsFold predicate on the "connector_id" field. +func ConnectorIDContainsFold(v string) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldContainsFold(FieldConnectorID, v)) +} + +// ConnectorDataIsNil applies the IsNil predicate on the "connector_data" field. +func ConnectorDataIsNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIsNull(FieldConnectorData)) +} + +// ConnectorDataNotNil applies the NotNil predicate on the "connector_data" field. +func ConnectorDataNotNil() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotNull(FieldConnectorData)) +} + +// LastUsedEQ applies the EQ predicate on the "last_used" field. +func LastUsedEQ(v time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldEQ(FieldLastUsed, v)) +} + +// LastUsedNEQ applies the NEQ predicate on the "last_used" field. +func LastUsedNEQ(v time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNEQ(FieldLastUsed, v)) +} + +// LastUsedIn applies the In predicate on the "last_used" field. +func LastUsedIn(vs ...time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldIn(FieldLastUsed, vs...)) +} + +// LastUsedNotIn applies the NotIn predicate on the "last_used" field. +func LastUsedNotIn(vs ...time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldNotIn(FieldLastUsed, vs...)) +} + +// LastUsedGT applies the GT predicate on the "last_used" field. +func LastUsedGT(v time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGT(FieldLastUsed, v)) +} + +// LastUsedGTE applies the GTE predicate on the "last_used" field. +func LastUsedGTE(v time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldGTE(FieldLastUsed, v)) +} + +// LastUsedLT applies the LT predicate on the "last_used" field. +func LastUsedLT(v time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLT(FieldLastUsed, v)) +} + +// LastUsedLTE applies the LTE predicate on the "last_used" field. +func LastUsedLTE(v time.Time) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.FieldLTE(FieldLastUsed, v)) +} + +// HasIntegration applies the HasEdge predicate on the "integration" edge. +func HasIntegration() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationTable, IntegrationPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasIntegrationWith applies the HasEdge predicate on the "integration" edge with a given conditions (other predicates). +func HasIntegrationWith(preds ...predicate.Integration) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(func(s *sql.Selector) { + step := newIntegrationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + 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.OhAuthTooToken) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OhAuthTooToken) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OhAuthTooToken) predicate.OhAuthTooToken { + return predicate.OhAuthTooToken(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/ohauthtootoken_create.go b/internal/ent/generated/ohauthtootoken_create.go new file mode 100644 index 0000000..4cbd272 --- /dev/null +++ b/internal/ent/generated/ohauthtootoken_create.go @@ -0,0 +1,495 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" +) + +// OhAuthTooTokenCreate is the builder for creating a OhAuthTooToken entity. +type OhAuthTooTokenCreate struct { + config + mutation *OhAuthTooTokenMutation + hooks []Hook +} + +// SetMappingID sets the "mapping_id" field. +func (oattc *OhAuthTooTokenCreate) SetMappingID(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetMappingID(s) + return oattc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (oattc *OhAuthTooTokenCreate) SetNillableMappingID(s *string) *OhAuthTooTokenCreate { + if s != nil { + oattc.SetMappingID(*s) + } + return oattc +} + +// SetTags sets the "tags" field. +func (oattc *OhAuthTooTokenCreate) SetTags(s []string) *OhAuthTooTokenCreate { + oattc.mutation.SetTags(s) + return oattc +} + +// SetClientID sets the "client_id" field. +func (oattc *OhAuthTooTokenCreate) SetClientID(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetClientID(s) + return oattc +} + +// SetScopes sets the "scopes" field. +func (oattc *OhAuthTooTokenCreate) SetScopes(s []string) *OhAuthTooTokenCreate { + oattc.mutation.SetScopes(s) + return oattc +} + +// SetNonce sets the "nonce" field. +func (oattc *OhAuthTooTokenCreate) SetNonce(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetNonce(s) + return oattc +} + +// SetClaimsUserID sets the "claims_user_id" field. +func (oattc *OhAuthTooTokenCreate) SetClaimsUserID(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetClaimsUserID(s) + return oattc +} + +// SetClaimsUsername sets the "claims_username" field. +func (oattc *OhAuthTooTokenCreate) SetClaimsUsername(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetClaimsUsername(s) + return oattc +} + +// SetClaimsEmail sets the "claims_email" field. +func (oattc *OhAuthTooTokenCreate) SetClaimsEmail(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetClaimsEmail(s) + return oattc +} + +// SetClaimsEmailVerified sets the "claims_email_verified" field. +func (oattc *OhAuthTooTokenCreate) SetClaimsEmailVerified(b bool) *OhAuthTooTokenCreate { + oattc.mutation.SetClaimsEmailVerified(b) + return oattc +} + +// SetClaimsGroups sets the "claims_groups" field. +func (oattc *OhAuthTooTokenCreate) SetClaimsGroups(s []string) *OhAuthTooTokenCreate { + oattc.mutation.SetClaimsGroups(s) + return oattc +} + +// SetClaimsPreferredUsername sets the "claims_preferred_username" field. +func (oattc *OhAuthTooTokenCreate) SetClaimsPreferredUsername(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetClaimsPreferredUsername(s) + return oattc +} + +// SetConnectorID sets the "connector_id" field. +func (oattc *OhAuthTooTokenCreate) SetConnectorID(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetConnectorID(s) + return oattc +} + +// SetConnectorData sets the "connector_data" field. +func (oattc *OhAuthTooTokenCreate) SetConnectorData(s []string) *OhAuthTooTokenCreate { + oattc.mutation.SetConnectorData(s) + return oattc +} + +// SetLastUsed sets the "last_used" field. +func (oattc *OhAuthTooTokenCreate) SetLastUsed(t time.Time) *OhAuthTooTokenCreate { + oattc.mutation.SetLastUsed(t) + return oattc +} + +// SetNillableLastUsed sets the "last_used" field if the given value is not nil. +func (oattc *OhAuthTooTokenCreate) SetNillableLastUsed(t *time.Time) *OhAuthTooTokenCreate { + if t != nil { + oattc.SetLastUsed(*t) + } + return oattc +} + +// SetID sets the "id" field. +func (oattc *OhAuthTooTokenCreate) SetID(s string) *OhAuthTooTokenCreate { + oattc.mutation.SetID(s) + return oattc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (oattc *OhAuthTooTokenCreate) SetNillableID(s *string) *OhAuthTooTokenCreate { + if s != nil { + oattc.SetID(*s) + } + return oattc +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by IDs. +func (oattc *OhAuthTooTokenCreate) AddIntegrationIDs(ids ...string) *OhAuthTooTokenCreate { + oattc.mutation.AddIntegrationIDs(ids...) + return oattc +} + +// AddIntegration adds the "integration" edges to the Integration entity. +func (oattc *OhAuthTooTokenCreate) AddIntegration(i ...*Integration) *OhAuthTooTokenCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return oattc.AddIntegrationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (oattc *OhAuthTooTokenCreate) AddEventIDs(ids ...string) *OhAuthTooTokenCreate { + oattc.mutation.AddEventIDs(ids...) + return oattc +} + +// AddEvents adds the "events" edges to the Event entity. +func (oattc *OhAuthTooTokenCreate) AddEvents(e ...*Event) *OhAuthTooTokenCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oattc.AddEventIDs(ids...) +} + +// Mutation returns the OhAuthTooTokenMutation object of the builder. +func (oattc *OhAuthTooTokenCreate) Mutation() *OhAuthTooTokenMutation { + return oattc.mutation +} + +// Save creates the OhAuthTooToken in the database. +func (oattc *OhAuthTooTokenCreate) Save(ctx context.Context) (*OhAuthTooToken, error) { + oattc.defaults() + return withHooks(ctx, oattc.sqlSave, oattc.mutation, oattc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (oattc *OhAuthTooTokenCreate) SaveX(ctx context.Context) *OhAuthTooToken { + v, err := oattc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (oattc *OhAuthTooTokenCreate) Exec(ctx context.Context) error { + _, err := oattc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oattc *OhAuthTooTokenCreate) ExecX(ctx context.Context) { + if err := oattc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (oattc *OhAuthTooTokenCreate) defaults() { + if _, ok := oattc.mutation.MappingID(); !ok { + v := ohauthtootoken.DefaultMappingID() + oattc.mutation.SetMappingID(v) + } + if _, ok := oattc.mutation.Tags(); !ok { + v := ohauthtootoken.DefaultTags + oattc.mutation.SetTags(v) + } + if _, ok := oattc.mutation.LastUsed(); !ok { + v := ohauthtootoken.DefaultLastUsed() + oattc.mutation.SetLastUsed(v) + } + if _, ok := oattc.mutation.ID(); !ok { + v := ohauthtootoken.DefaultID() + oattc.mutation.SetID(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (oattc *OhAuthTooTokenCreate) check() error { + if _, ok := oattc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OhAuthTooToken.mapping_id"`)} + } + if _, ok := oattc.mutation.ClientID(); !ok { + return &ValidationError{Name: "client_id", err: errors.New(`generated: missing required field "OhAuthTooToken.client_id"`)} + } + if v, ok := oattc.mutation.ClientID(); ok { + if err := ohauthtootoken.ClientIDValidator(v); err != nil { + return &ValidationError{Name: "client_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.client_id": %w`, err)} + } + } + if _, ok := oattc.mutation.Nonce(); !ok { + return &ValidationError{Name: "nonce", err: errors.New(`generated: missing required field "OhAuthTooToken.nonce"`)} + } + if v, ok := oattc.mutation.Nonce(); ok { + if err := ohauthtootoken.NonceValidator(v); err != nil { + return &ValidationError{Name: "nonce", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.nonce": %w`, err)} + } + } + if _, ok := oattc.mutation.ClaimsUserID(); !ok { + return &ValidationError{Name: "claims_user_id", err: errors.New(`generated: missing required field "OhAuthTooToken.claims_user_id"`)} + } + if v, ok := oattc.mutation.ClaimsUserID(); ok { + if err := ohauthtootoken.ClaimsUserIDValidator(v); err != nil { + return &ValidationError{Name: "claims_user_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_user_id": %w`, err)} + } + } + if _, ok := oattc.mutation.ClaimsUsername(); !ok { + return &ValidationError{Name: "claims_username", err: errors.New(`generated: missing required field "OhAuthTooToken.claims_username"`)} + } + if v, ok := oattc.mutation.ClaimsUsername(); ok { + if err := ohauthtootoken.ClaimsUsernameValidator(v); err != nil { + return &ValidationError{Name: "claims_username", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_username": %w`, err)} + } + } + if _, ok := oattc.mutation.ClaimsEmail(); !ok { + return &ValidationError{Name: "claims_email", err: errors.New(`generated: missing required field "OhAuthTooToken.claims_email"`)} + } + if v, ok := oattc.mutation.ClaimsEmail(); ok { + if err := ohauthtootoken.ClaimsEmailValidator(v); err != nil { + return &ValidationError{Name: "claims_email", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_email": %w`, err)} + } + } + if _, ok := oattc.mutation.ClaimsEmailVerified(); !ok { + return &ValidationError{Name: "claims_email_verified", err: errors.New(`generated: missing required field "OhAuthTooToken.claims_email_verified"`)} + } + if _, ok := oattc.mutation.ClaimsPreferredUsername(); !ok { + return &ValidationError{Name: "claims_preferred_username", err: errors.New(`generated: missing required field "OhAuthTooToken.claims_preferred_username"`)} + } + if _, ok := oattc.mutation.ConnectorID(); !ok { + return &ValidationError{Name: "connector_id", err: errors.New(`generated: missing required field "OhAuthTooToken.connector_id"`)} + } + if v, ok := oattc.mutation.ConnectorID(); ok { + if err := ohauthtootoken.ConnectorIDValidator(v); err != nil { + return &ValidationError{Name: "connector_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.connector_id": %w`, err)} + } + } + if _, ok := oattc.mutation.LastUsed(); !ok { + return &ValidationError{Name: "last_used", err: errors.New(`generated: missing required field "OhAuthTooToken.last_used"`)} + } + return nil +} + +func (oattc *OhAuthTooTokenCreate) sqlSave(ctx context.Context) (*OhAuthTooToken, error) { + if err := oattc.check(); err != nil { + return nil, err + } + _node, _spec := oattc.createSpec() + if err := sqlgraph.CreateNode(ctx, oattc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OhAuthTooToken.ID type: %T", _spec.ID.Value) + } + } + oattc.mutation.id = &_node.ID + oattc.mutation.done = true + return _node, nil +} + +func (oattc *OhAuthTooTokenCreate) createSpec() (*OhAuthTooToken, *sqlgraph.CreateSpec) { + var ( + _node = &OhAuthTooToken{config: oattc.config} + _spec = sqlgraph.NewCreateSpec(ohauthtootoken.Table, sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString)) + ) + _spec.Schema = oattc.schemaConfig.OhAuthTooToken + if id, ok := oattc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := oattc.mutation.MappingID(); ok { + _spec.SetField(ohauthtootoken.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := oattc.mutation.Tags(); ok { + _spec.SetField(ohauthtootoken.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := oattc.mutation.ClientID(); ok { + _spec.SetField(ohauthtootoken.FieldClientID, field.TypeString, value) + _node.ClientID = value + } + if value, ok := oattc.mutation.Scopes(); ok { + _spec.SetField(ohauthtootoken.FieldScopes, field.TypeJSON, value) + _node.Scopes = value + } + if value, ok := oattc.mutation.Nonce(); ok { + _spec.SetField(ohauthtootoken.FieldNonce, field.TypeString, value) + _node.Nonce = value + } + if value, ok := oattc.mutation.ClaimsUserID(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsUserID, field.TypeString, value) + _node.ClaimsUserID = value + } + if value, ok := oattc.mutation.ClaimsUsername(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsUsername, field.TypeString, value) + _node.ClaimsUsername = value + } + if value, ok := oattc.mutation.ClaimsEmail(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsEmail, field.TypeString, value) + _node.ClaimsEmail = value + } + if value, ok := oattc.mutation.ClaimsEmailVerified(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsEmailVerified, field.TypeBool, value) + _node.ClaimsEmailVerified = value + } + if value, ok := oattc.mutation.ClaimsGroups(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsGroups, field.TypeJSON, value) + _node.ClaimsGroups = value + } + if value, ok := oattc.mutation.ClaimsPreferredUsername(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsPreferredUsername, field.TypeString, value) + _node.ClaimsPreferredUsername = value + } + if value, ok := oattc.mutation.ConnectorID(); ok { + _spec.SetField(ohauthtootoken.FieldConnectorID, field.TypeString, value) + _node.ConnectorID = value + } + if value, ok := oattc.mutation.ConnectorData(); ok { + _spec.SetField(ohauthtootoken.FieldConnectorData, field.TypeJSON, value) + _node.ConnectorData = value + } + if value, ok := oattc.mutation.LastUsed(); ok { + _spec.SetField(ohauthtootoken.FieldLastUsed, field.TypeTime, value) + _node.LastUsed = value + } + if nodes := oattc.mutation.IntegrationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oattc.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oattc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oattc.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OhAuthTooTokenCreateBulk is the builder for creating many OhAuthTooToken entities in bulk. +type OhAuthTooTokenCreateBulk struct { + config + err error + builders []*OhAuthTooTokenCreate +} + +// Save creates the OhAuthTooToken entities in the database. +func (oattcb *OhAuthTooTokenCreateBulk) Save(ctx context.Context) ([]*OhAuthTooToken, error) { + if oattcb.err != nil { + return nil, oattcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(oattcb.builders)) + nodes := make([]*OhAuthTooToken, len(oattcb.builders)) + mutators := make([]Mutator, len(oattcb.builders)) + for i := range oattcb.builders { + func(i int, root context.Context) { + builder := oattcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OhAuthTooTokenMutation) + 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, oattcb.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, oattcb.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, oattcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (oattcb *OhAuthTooTokenCreateBulk) SaveX(ctx context.Context) []*OhAuthTooToken { + v, err := oattcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (oattcb *OhAuthTooTokenCreateBulk) Exec(ctx context.Context) error { + _, err := oattcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oattcb *OhAuthTooTokenCreateBulk) ExecX(ctx context.Context) { + if err := oattcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/ohauthtootoken_delete.go b/internal/ent/generated/ohauthtootoken_delete.go new file mode 100644 index 0000000..c2f2a10 --- /dev/null +++ b/internal/ent/generated/ohauthtootoken_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" +) + +// OhAuthTooTokenDelete is the builder for deleting a OhAuthTooToken entity. +type OhAuthTooTokenDelete struct { + config + hooks []Hook + mutation *OhAuthTooTokenMutation +} + +// Where appends a list predicates to the OhAuthTooTokenDelete builder. +func (oattd *OhAuthTooTokenDelete) Where(ps ...predicate.OhAuthTooToken) *OhAuthTooTokenDelete { + oattd.mutation.Where(ps...) + return oattd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (oattd *OhAuthTooTokenDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, oattd.sqlExec, oattd.mutation, oattd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (oattd *OhAuthTooTokenDelete) ExecX(ctx context.Context) int { + n, err := oattd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (oattd *OhAuthTooTokenDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(ohauthtootoken.Table, sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString)) + _spec.Node.Schema = oattd.schemaConfig.OhAuthTooToken + ctx = internal.NewSchemaConfigContext(ctx, oattd.schemaConfig) + if ps := oattd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, oattd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + oattd.mutation.done = true + return affected, err +} + +// OhAuthTooTokenDeleteOne is the builder for deleting a single OhAuthTooToken entity. +type OhAuthTooTokenDeleteOne struct { + oattd *OhAuthTooTokenDelete +} + +// Where appends a list predicates to the OhAuthTooTokenDelete builder. +func (oattdo *OhAuthTooTokenDeleteOne) Where(ps ...predicate.OhAuthTooToken) *OhAuthTooTokenDeleteOne { + oattdo.oattd.mutation.Where(ps...) + return oattdo +} + +// Exec executes the deletion query. +func (oattdo *OhAuthTooTokenDeleteOne) Exec(ctx context.Context) error { + n, err := oattdo.oattd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{ohauthtootoken.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (oattdo *OhAuthTooTokenDeleteOne) ExecX(ctx context.Context) { + if err := oattdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/ohauthtootoken_query.go b/internal/ent/generated/ohauthtootoken_query.go new file mode 100644 index 0000000..a84f39a --- /dev/null +++ b/internal/ent/generated/ohauthtootoken_query.go @@ -0,0 +1,816 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OhAuthTooTokenQuery is the builder for querying OhAuthTooToken entities. +type OhAuthTooTokenQuery struct { + config + ctx *QueryContext + order []ohauthtootoken.OrderOption + inters []Interceptor + predicates []predicate.OhAuthTooToken + withIntegration *IntegrationQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OhAuthTooToken) error + withNamedIntegration map[string]*IntegrationQuery + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OhAuthTooTokenQuery builder. +func (oattq *OhAuthTooTokenQuery) Where(ps ...predicate.OhAuthTooToken) *OhAuthTooTokenQuery { + oattq.predicates = append(oattq.predicates, ps...) + return oattq +} + +// Limit the number of records to be returned by this query. +func (oattq *OhAuthTooTokenQuery) Limit(limit int) *OhAuthTooTokenQuery { + oattq.ctx.Limit = &limit + return oattq +} + +// Offset to start from. +func (oattq *OhAuthTooTokenQuery) Offset(offset int) *OhAuthTooTokenQuery { + oattq.ctx.Offset = &offset + return oattq +} + +// 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 (oattq *OhAuthTooTokenQuery) Unique(unique bool) *OhAuthTooTokenQuery { + oattq.ctx.Unique = &unique + return oattq +} + +// Order specifies how the records should be ordered. +func (oattq *OhAuthTooTokenQuery) Order(o ...ohauthtootoken.OrderOption) *OhAuthTooTokenQuery { + oattq.order = append(oattq.order, o...) + return oattq +} + +// QueryIntegration chains the current query on the "integration" edge. +func (oattq *OhAuthTooTokenQuery) QueryIntegration() *IntegrationQuery { + query := (&IntegrationClient{config: oattq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oattq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oattq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(ohauthtootoken.Table, ohauthtootoken.FieldID, selector), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, ohauthtootoken.IntegrationTable, ohauthtootoken.IntegrationPrimaryKey...), + ) + schemaConfig := oattq.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationOauth2tokens + fromU = sqlgraph.SetNeighbors(oattq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (oattq *OhAuthTooTokenQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: oattq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oattq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oattq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(ohauthtootoken.Table, ohauthtootoken.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, ohauthtootoken.EventsTable, ohauthtootoken.EventsPrimaryKey...), + ) + schemaConfig := oattq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OhAuthTooTokenEvents + fromU = sqlgraph.SetNeighbors(oattq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first OhAuthTooToken entity from the query. +// Returns a *NotFoundError when no OhAuthTooToken was found. +func (oattq *OhAuthTooTokenQuery) First(ctx context.Context) (*OhAuthTooToken, error) { + nodes, err := oattq.Limit(1).All(setContextOp(ctx, oattq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{ohauthtootoken.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) FirstX(ctx context.Context) *OhAuthTooToken { + node, err := oattq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OhAuthTooToken ID from the query. +// Returns a *NotFoundError when no OhAuthTooToken ID was found. +func (oattq *OhAuthTooTokenQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = oattq.Limit(1).IDs(setContextOp(ctx, oattq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{ohauthtootoken.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) FirstIDX(ctx context.Context) string { + id, err := oattq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OhAuthTooToken entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OhAuthTooToken entity is found. +// Returns a *NotFoundError when no OhAuthTooToken entities are found. +func (oattq *OhAuthTooTokenQuery) Only(ctx context.Context) (*OhAuthTooToken, error) { + nodes, err := oattq.Limit(2).All(setContextOp(ctx, oattq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{ohauthtootoken.Label} + default: + return nil, &NotSingularError{ohauthtootoken.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) OnlyX(ctx context.Context) *OhAuthTooToken { + node, err := oattq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OhAuthTooToken ID in the query. +// Returns a *NotSingularError when more than one OhAuthTooToken ID is found. +// Returns a *NotFoundError when no entities are found. +func (oattq *OhAuthTooTokenQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = oattq.Limit(2).IDs(setContextOp(ctx, oattq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{ohauthtootoken.Label} + default: + err = &NotSingularError{ohauthtootoken.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) OnlyIDX(ctx context.Context) string { + id, err := oattq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OhAuthTooTokens. +func (oattq *OhAuthTooTokenQuery) All(ctx context.Context) ([]*OhAuthTooToken, error) { + ctx = setContextOp(ctx, oattq.ctx, ent.OpQueryAll) + if err := oattq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OhAuthTooToken, *OhAuthTooTokenQuery]() + return withInterceptors[[]*OhAuthTooToken](ctx, oattq, qr, oattq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) AllX(ctx context.Context) []*OhAuthTooToken { + nodes, err := oattq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OhAuthTooToken IDs. +func (oattq *OhAuthTooTokenQuery) IDs(ctx context.Context) (ids []string, err error) { + if oattq.ctx.Unique == nil && oattq.path != nil { + oattq.Unique(true) + } + ctx = setContextOp(ctx, oattq.ctx, ent.OpQueryIDs) + if err = oattq.Select(ohauthtootoken.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) IDsX(ctx context.Context) []string { + ids, err := oattq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (oattq *OhAuthTooTokenQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, oattq.ctx, ent.OpQueryCount) + if err := oattq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, oattq, querierCount[*OhAuthTooTokenQuery](), oattq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) CountX(ctx context.Context) int { + count, err := oattq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (oattq *OhAuthTooTokenQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, oattq.ctx, ent.OpQueryExist) + switch _, err := oattq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (oattq *OhAuthTooTokenQuery) ExistX(ctx context.Context) bool { + exist, err := oattq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OhAuthTooTokenQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (oattq *OhAuthTooTokenQuery) Clone() *OhAuthTooTokenQuery { + if oattq == nil { + return nil + } + return &OhAuthTooTokenQuery{ + config: oattq.config, + ctx: oattq.ctx.Clone(), + order: append([]ohauthtootoken.OrderOption{}, oattq.order...), + inters: append([]Interceptor{}, oattq.inters...), + predicates: append([]predicate.OhAuthTooToken{}, oattq.predicates...), + withIntegration: oattq.withIntegration.Clone(), + withEvents: oattq.withEvents.Clone(), + // clone intermediate query. + sql: oattq.sql.Clone(), + path: oattq.path, + } +} + +// WithIntegration tells the query-builder to eager-load the nodes that are connected to +// the "integration" edge. The optional arguments are used to configure the query builder of the edge. +func (oattq *OhAuthTooTokenQuery) WithIntegration(opts ...func(*IntegrationQuery)) *OhAuthTooTokenQuery { + query := (&IntegrationClient{config: oattq.config}).Query() + for _, opt := range opts { + opt(query) + } + oattq.withIntegration = query + return oattq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (oattq *OhAuthTooTokenQuery) WithEvents(opts ...func(*EventQuery)) *OhAuthTooTokenQuery { + query := (&EventClient{config: oattq.config}).Query() + for _, opt := range opts { + opt(query) + } + oattq.withEvents = query + return oattq +} + +// 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 { +// MappingID string `json:"mapping_id,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OhAuthTooToken.Query(). +// GroupBy(ohauthtootoken.FieldMappingID). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (oattq *OhAuthTooTokenQuery) GroupBy(field string, fields ...string) *OhAuthTooTokenGroupBy { + oattq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OhAuthTooTokenGroupBy{build: oattq} + grbuild.flds = &oattq.ctx.Fields + grbuild.label = ohauthtootoken.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 { +// MappingID string `json:"mapping_id,omitempty"` +// } +// +// client.OhAuthTooToken.Query(). +// Select(ohauthtootoken.FieldMappingID). +// Scan(ctx, &v) +func (oattq *OhAuthTooTokenQuery) Select(fields ...string) *OhAuthTooTokenSelect { + oattq.ctx.Fields = append(oattq.ctx.Fields, fields...) + sbuild := &OhAuthTooTokenSelect{OhAuthTooTokenQuery: oattq} + sbuild.label = ohauthtootoken.Label + sbuild.flds, sbuild.scan = &oattq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OhAuthTooTokenSelect configured with the given aggregations. +func (oattq *OhAuthTooTokenQuery) Aggregate(fns ...AggregateFunc) *OhAuthTooTokenSelect { + return oattq.Select().Aggregate(fns...) +} + +func (oattq *OhAuthTooTokenQuery) prepareQuery(ctx context.Context) error { + for _, inter := range oattq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, oattq); err != nil { + return err + } + } + } + for _, f := range oattq.ctx.Fields { + if !ohauthtootoken.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if oattq.path != nil { + prev, err := oattq.path(ctx) + if err != nil { + return err + } + oattq.sql = prev + } + return nil +} + +func (oattq *OhAuthTooTokenQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OhAuthTooToken, error) { + var ( + nodes = []*OhAuthTooToken{} + _spec = oattq.querySpec() + loadedTypes = [2]bool{ + oattq.withIntegration != nil, + oattq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OhAuthTooToken).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OhAuthTooToken{config: oattq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = oattq.schemaConfig.OhAuthTooToken + ctx = internal.NewSchemaConfigContext(ctx, oattq.schemaConfig) + if len(oattq.modifiers) > 0 { + _spec.Modifiers = oattq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, oattq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := oattq.withIntegration; query != nil { + if err := oattq.loadIntegration(ctx, query, nodes, + func(n *OhAuthTooToken) { n.Edges.Integration = []*Integration{} }, + func(n *OhAuthTooToken, e *Integration) { n.Edges.Integration = append(n.Edges.Integration, e) }); err != nil { + return nil, err + } + } + if query := oattq.withEvents; query != nil { + if err := oattq.loadEvents(ctx, query, nodes, + func(n *OhAuthTooToken) { n.Edges.Events = []*Event{} }, + func(n *OhAuthTooToken, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range oattq.withNamedIntegration { + if err := oattq.loadIntegration(ctx, query, nodes, + func(n *OhAuthTooToken) { n.appendNamedIntegration(name) }, + func(n *OhAuthTooToken, e *Integration) { n.appendNamedIntegration(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oattq.withNamedEvents { + if err := oattq.loadEvents(ctx, query, nodes, + func(n *OhAuthTooToken) { n.appendNamedEvents(name) }, + func(n *OhAuthTooToken, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range oattq.loadTotal { + if err := oattq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (oattq *OhAuthTooTokenQuery) loadIntegration(ctx context.Context, query *IntegrationQuery, nodes []*OhAuthTooToken, init func(*OhAuthTooToken), assign func(*OhAuthTooToken, *Integration)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*OhAuthTooToken) + nids := make(map[string]map[*OhAuthTooToken]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(ohauthtootoken.IntegrationTable) + joinT.Schema(oattq.schemaConfig.IntegrationOauth2tokens) + s.Join(joinT).On(s.C(integration.FieldID), joinT.C(ohauthtootoken.IntegrationPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(ohauthtootoken.IntegrationPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(ohauthtootoken.IntegrationPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*OhAuthTooToken]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Integration](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "integration" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (oattq *OhAuthTooTokenQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*OhAuthTooToken, init func(*OhAuthTooToken), assign func(*OhAuthTooToken, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*OhAuthTooToken) + nids := make(map[string]map[*OhAuthTooToken]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(ohauthtootoken.EventsTable) + joinT.Schema(oattq.schemaConfig.OhAuthTooTokenEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(ohauthtootoken.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(ohauthtootoken.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(ohauthtootoken.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*OhAuthTooToken]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (oattq *OhAuthTooTokenQuery) sqlCount(ctx context.Context) (int, error) { + _spec := oattq.querySpec() + _spec.Node.Schema = oattq.schemaConfig.OhAuthTooToken + ctx = internal.NewSchemaConfigContext(ctx, oattq.schemaConfig) + if len(oattq.modifiers) > 0 { + _spec.Modifiers = oattq.modifiers + } + _spec.Node.Columns = oattq.ctx.Fields + if len(oattq.ctx.Fields) > 0 { + _spec.Unique = oattq.ctx.Unique != nil && *oattq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, oattq.driver, _spec) +} + +func (oattq *OhAuthTooTokenQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(ohauthtootoken.Table, ohauthtootoken.Columns, sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString)) + _spec.From = oattq.sql + if unique := oattq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if oattq.path != nil { + _spec.Unique = true + } + if fields := oattq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, ohauthtootoken.FieldID) + for i := range fields { + if fields[i] != ohauthtootoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := oattq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := oattq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := oattq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := oattq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (oattq *OhAuthTooTokenQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(oattq.driver.Dialect()) + t1 := builder.Table(ohauthtootoken.Table) + columns := oattq.ctx.Fields + if len(columns) == 0 { + columns = ohauthtootoken.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if oattq.sql != nil { + selector = oattq.sql + selector.Select(selector.Columns(columns...)...) + } + if oattq.ctx.Unique != nil && *oattq.ctx.Unique { + selector.Distinct() + } + t1.Schema(oattq.schemaConfig.OhAuthTooToken) + ctx = internal.NewSchemaConfigContext(ctx, oattq.schemaConfig) + selector.WithContext(ctx) + for _, p := range oattq.predicates { + p(selector) + } + for _, p := range oattq.order { + p(selector) + } + if offset := oattq.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 := oattq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedIntegration tells the query-builder to eager-load the nodes that are connected to the "integration" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oattq *OhAuthTooTokenQuery) WithNamedIntegration(name string, opts ...func(*IntegrationQuery)) *OhAuthTooTokenQuery { + query := (&IntegrationClient{config: oattq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oattq.withNamedIntegration == nil { + oattq.withNamedIntegration = make(map[string]*IntegrationQuery) + } + oattq.withNamedIntegration[name] = query + return oattq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oattq *OhAuthTooTokenQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *OhAuthTooTokenQuery { + query := (&EventClient{config: oattq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oattq.withNamedEvents == nil { + oattq.withNamedEvents = make(map[string]*EventQuery) + } + oattq.withNamedEvents[name] = query + return oattq +} + +// OhAuthTooTokenGroupBy is the group-by builder for OhAuthTooToken entities. +type OhAuthTooTokenGroupBy struct { + selector + build *OhAuthTooTokenQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (oattgb *OhAuthTooTokenGroupBy) Aggregate(fns ...AggregateFunc) *OhAuthTooTokenGroupBy { + oattgb.fns = append(oattgb.fns, fns...) + return oattgb +} + +// Scan applies the selector query and scans the result into the given value. +func (oattgb *OhAuthTooTokenGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, oattgb.build.ctx, ent.OpQueryGroupBy) + if err := oattgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OhAuthTooTokenQuery, *OhAuthTooTokenGroupBy](ctx, oattgb.build, oattgb, oattgb.build.inters, v) +} + +func (oattgb *OhAuthTooTokenGroupBy) sqlScan(ctx context.Context, root *OhAuthTooTokenQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(oattgb.fns)) + for _, fn := range oattgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*oattgb.flds)+len(oattgb.fns)) + for _, f := range *oattgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*oattgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := oattgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OhAuthTooTokenSelect is the builder for selecting fields of OhAuthTooToken entities. +type OhAuthTooTokenSelect struct { + *OhAuthTooTokenQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (oatts *OhAuthTooTokenSelect) Aggregate(fns ...AggregateFunc) *OhAuthTooTokenSelect { + oatts.fns = append(oatts.fns, fns...) + return oatts +} + +// Scan applies the selector query and scans the result into the given value. +func (oatts *OhAuthTooTokenSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, oatts.ctx, ent.OpQuerySelect) + if err := oatts.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OhAuthTooTokenQuery, *OhAuthTooTokenSelect](ctx, oatts.OhAuthTooTokenQuery, oatts, oatts.inters, v) +} + +func (oatts *OhAuthTooTokenSelect) sqlScan(ctx context.Context, root *OhAuthTooTokenQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(oatts.fns)) + for _, fn := range oatts.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*oatts.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 := oatts.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/ohauthtootoken_update.go b/internal/ent/generated/ohauthtootoken_update.go new file mode 100644 index 0000000..735ab6d --- /dev/null +++ b/internal/ent/generated/ohauthtootoken_update.go @@ -0,0 +1,1135 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OhAuthTooTokenUpdate is the builder for updating OhAuthTooToken entities. +type OhAuthTooTokenUpdate struct { + config + hooks []Hook + mutation *OhAuthTooTokenMutation +} + +// Where appends a list predicates to the OhAuthTooTokenUpdate builder. +func (oattu *OhAuthTooTokenUpdate) Where(ps ...predicate.OhAuthTooToken) *OhAuthTooTokenUpdate { + oattu.mutation.Where(ps...) + return oattu +} + +// SetTags sets the "tags" field. +func (oattu *OhAuthTooTokenUpdate) SetTags(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.SetTags(s) + return oattu +} + +// AppendTags appends s to the "tags" field. +func (oattu *OhAuthTooTokenUpdate) AppendTags(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.AppendTags(s) + return oattu +} + +// ClearTags clears the value of the "tags" field. +func (oattu *OhAuthTooTokenUpdate) ClearTags() *OhAuthTooTokenUpdate { + oattu.mutation.ClearTags() + return oattu +} + +// SetClientID sets the "client_id" field. +func (oattu *OhAuthTooTokenUpdate) SetClientID(s string) *OhAuthTooTokenUpdate { + oattu.mutation.SetClientID(s) + return oattu +} + +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableClientID(s *string) *OhAuthTooTokenUpdate { + if s != nil { + oattu.SetClientID(*s) + } + return oattu +} + +// SetScopes sets the "scopes" field. +func (oattu *OhAuthTooTokenUpdate) SetScopes(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.SetScopes(s) + return oattu +} + +// AppendScopes appends s to the "scopes" field. +func (oattu *OhAuthTooTokenUpdate) AppendScopes(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.AppendScopes(s) + return oattu +} + +// ClearScopes clears the value of the "scopes" field. +func (oattu *OhAuthTooTokenUpdate) ClearScopes() *OhAuthTooTokenUpdate { + oattu.mutation.ClearScopes() + return oattu +} + +// SetNonce sets the "nonce" field. +func (oattu *OhAuthTooTokenUpdate) SetNonce(s string) *OhAuthTooTokenUpdate { + oattu.mutation.SetNonce(s) + return oattu +} + +// SetNillableNonce sets the "nonce" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableNonce(s *string) *OhAuthTooTokenUpdate { + if s != nil { + oattu.SetNonce(*s) + } + return oattu +} + +// SetClaimsUserID sets the "claims_user_id" field. +func (oattu *OhAuthTooTokenUpdate) SetClaimsUserID(s string) *OhAuthTooTokenUpdate { + oattu.mutation.SetClaimsUserID(s) + return oattu +} + +// SetNillableClaimsUserID sets the "claims_user_id" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableClaimsUserID(s *string) *OhAuthTooTokenUpdate { + if s != nil { + oattu.SetClaimsUserID(*s) + } + return oattu +} + +// SetClaimsUsername sets the "claims_username" field. +func (oattu *OhAuthTooTokenUpdate) SetClaimsUsername(s string) *OhAuthTooTokenUpdate { + oattu.mutation.SetClaimsUsername(s) + return oattu +} + +// SetNillableClaimsUsername sets the "claims_username" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableClaimsUsername(s *string) *OhAuthTooTokenUpdate { + if s != nil { + oattu.SetClaimsUsername(*s) + } + return oattu +} + +// SetClaimsEmail sets the "claims_email" field. +func (oattu *OhAuthTooTokenUpdate) SetClaimsEmail(s string) *OhAuthTooTokenUpdate { + oattu.mutation.SetClaimsEmail(s) + return oattu +} + +// SetNillableClaimsEmail sets the "claims_email" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableClaimsEmail(s *string) *OhAuthTooTokenUpdate { + if s != nil { + oattu.SetClaimsEmail(*s) + } + return oattu +} + +// SetClaimsEmailVerified sets the "claims_email_verified" field. +func (oattu *OhAuthTooTokenUpdate) SetClaimsEmailVerified(b bool) *OhAuthTooTokenUpdate { + oattu.mutation.SetClaimsEmailVerified(b) + return oattu +} + +// SetNillableClaimsEmailVerified sets the "claims_email_verified" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableClaimsEmailVerified(b *bool) *OhAuthTooTokenUpdate { + if b != nil { + oattu.SetClaimsEmailVerified(*b) + } + return oattu +} + +// SetClaimsGroups sets the "claims_groups" field. +func (oattu *OhAuthTooTokenUpdate) SetClaimsGroups(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.SetClaimsGroups(s) + return oattu +} + +// AppendClaimsGroups appends s to the "claims_groups" field. +func (oattu *OhAuthTooTokenUpdate) AppendClaimsGroups(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.AppendClaimsGroups(s) + return oattu +} + +// ClearClaimsGroups clears the value of the "claims_groups" field. +func (oattu *OhAuthTooTokenUpdate) ClearClaimsGroups() *OhAuthTooTokenUpdate { + oattu.mutation.ClearClaimsGroups() + return oattu +} + +// SetClaimsPreferredUsername sets the "claims_preferred_username" field. +func (oattu *OhAuthTooTokenUpdate) SetClaimsPreferredUsername(s string) *OhAuthTooTokenUpdate { + oattu.mutation.SetClaimsPreferredUsername(s) + return oattu +} + +// SetNillableClaimsPreferredUsername sets the "claims_preferred_username" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableClaimsPreferredUsername(s *string) *OhAuthTooTokenUpdate { + if s != nil { + oattu.SetClaimsPreferredUsername(*s) + } + return oattu +} + +// SetConnectorID sets the "connector_id" field. +func (oattu *OhAuthTooTokenUpdate) SetConnectorID(s string) *OhAuthTooTokenUpdate { + oattu.mutation.SetConnectorID(s) + return oattu +} + +// SetNillableConnectorID sets the "connector_id" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableConnectorID(s *string) *OhAuthTooTokenUpdate { + if s != nil { + oattu.SetConnectorID(*s) + } + return oattu +} + +// SetConnectorData sets the "connector_data" field. +func (oattu *OhAuthTooTokenUpdate) SetConnectorData(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.SetConnectorData(s) + return oattu +} + +// AppendConnectorData appends s to the "connector_data" field. +func (oattu *OhAuthTooTokenUpdate) AppendConnectorData(s []string) *OhAuthTooTokenUpdate { + oattu.mutation.AppendConnectorData(s) + return oattu +} + +// ClearConnectorData clears the value of the "connector_data" field. +func (oattu *OhAuthTooTokenUpdate) ClearConnectorData() *OhAuthTooTokenUpdate { + oattu.mutation.ClearConnectorData() + return oattu +} + +// SetLastUsed sets the "last_used" field. +func (oattu *OhAuthTooTokenUpdate) SetLastUsed(t time.Time) *OhAuthTooTokenUpdate { + oattu.mutation.SetLastUsed(t) + return oattu +} + +// SetNillableLastUsed sets the "last_used" field if the given value is not nil. +func (oattu *OhAuthTooTokenUpdate) SetNillableLastUsed(t *time.Time) *OhAuthTooTokenUpdate { + if t != nil { + oattu.SetLastUsed(*t) + } + return oattu +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by IDs. +func (oattu *OhAuthTooTokenUpdate) AddIntegrationIDs(ids ...string) *OhAuthTooTokenUpdate { + oattu.mutation.AddIntegrationIDs(ids...) + return oattu +} + +// AddIntegration adds the "integration" edges to the Integration entity. +func (oattu *OhAuthTooTokenUpdate) AddIntegration(i ...*Integration) *OhAuthTooTokenUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return oattu.AddIntegrationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (oattu *OhAuthTooTokenUpdate) AddEventIDs(ids ...string) *OhAuthTooTokenUpdate { + oattu.mutation.AddEventIDs(ids...) + return oattu +} + +// AddEvents adds the "events" edges to the Event entity. +func (oattu *OhAuthTooTokenUpdate) AddEvents(e ...*Event) *OhAuthTooTokenUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oattu.AddEventIDs(ids...) +} + +// Mutation returns the OhAuthTooTokenMutation object of the builder. +func (oattu *OhAuthTooTokenUpdate) Mutation() *OhAuthTooTokenMutation { + return oattu.mutation +} + +// ClearIntegration clears all "integration" edges to the Integration entity. +func (oattu *OhAuthTooTokenUpdate) ClearIntegration() *OhAuthTooTokenUpdate { + oattu.mutation.ClearIntegration() + return oattu +} + +// RemoveIntegrationIDs removes the "integration" edge to Integration entities by IDs. +func (oattu *OhAuthTooTokenUpdate) RemoveIntegrationIDs(ids ...string) *OhAuthTooTokenUpdate { + oattu.mutation.RemoveIntegrationIDs(ids...) + return oattu +} + +// RemoveIntegration removes "integration" edges to Integration entities. +func (oattu *OhAuthTooTokenUpdate) RemoveIntegration(i ...*Integration) *OhAuthTooTokenUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return oattu.RemoveIntegrationIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (oattu *OhAuthTooTokenUpdate) ClearEvents() *OhAuthTooTokenUpdate { + oattu.mutation.ClearEvents() + return oattu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (oattu *OhAuthTooTokenUpdate) RemoveEventIDs(ids ...string) *OhAuthTooTokenUpdate { + oattu.mutation.RemoveEventIDs(ids...) + return oattu +} + +// RemoveEvents removes "events" edges to Event entities. +func (oattu *OhAuthTooTokenUpdate) RemoveEvents(e ...*Event) *OhAuthTooTokenUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oattu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (oattu *OhAuthTooTokenUpdate) Save(ctx context.Context) (int, error) { + return withHooks(ctx, oattu.sqlSave, oattu.mutation, oattu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (oattu *OhAuthTooTokenUpdate) SaveX(ctx context.Context) int { + affected, err := oattu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (oattu *OhAuthTooTokenUpdate) Exec(ctx context.Context) error { + _, err := oattu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oattu *OhAuthTooTokenUpdate) ExecX(ctx context.Context) { + if err := oattu.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (oattu *OhAuthTooTokenUpdate) check() error { + if v, ok := oattu.mutation.ClientID(); ok { + if err := ohauthtootoken.ClientIDValidator(v); err != nil { + return &ValidationError{Name: "client_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.client_id": %w`, err)} + } + } + if v, ok := oattu.mutation.Nonce(); ok { + if err := ohauthtootoken.NonceValidator(v); err != nil { + return &ValidationError{Name: "nonce", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.nonce": %w`, err)} + } + } + if v, ok := oattu.mutation.ClaimsUserID(); ok { + if err := ohauthtootoken.ClaimsUserIDValidator(v); err != nil { + return &ValidationError{Name: "claims_user_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_user_id": %w`, err)} + } + } + if v, ok := oattu.mutation.ClaimsUsername(); ok { + if err := ohauthtootoken.ClaimsUsernameValidator(v); err != nil { + return &ValidationError{Name: "claims_username", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_username": %w`, err)} + } + } + if v, ok := oattu.mutation.ClaimsEmail(); ok { + if err := ohauthtootoken.ClaimsEmailValidator(v); err != nil { + return &ValidationError{Name: "claims_email", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_email": %w`, err)} + } + } + if v, ok := oattu.mutation.ConnectorID(); ok { + if err := ohauthtootoken.ConnectorIDValidator(v); err != nil { + return &ValidationError{Name: "connector_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.connector_id": %w`, err)} + } + } + return nil +} + +func (oattu *OhAuthTooTokenUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := oattu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(ohauthtootoken.Table, ohauthtootoken.Columns, sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString)) + if ps := oattu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := oattu.mutation.Tags(); ok { + _spec.SetField(ohauthtootoken.FieldTags, field.TypeJSON, value) + } + if value, ok := oattu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldTags, value) + }) + } + if oattu.mutation.TagsCleared() { + _spec.ClearField(ohauthtootoken.FieldTags, field.TypeJSON) + } + if value, ok := oattu.mutation.ClientID(); ok { + _spec.SetField(ohauthtootoken.FieldClientID, field.TypeString, value) + } + if value, ok := oattu.mutation.Scopes(); ok { + _spec.SetField(ohauthtootoken.FieldScopes, field.TypeJSON, value) + } + if value, ok := oattu.mutation.AppendedScopes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldScopes, value) + }) + } + if oattu.mutation.ScopesCleared() { + _spec.ClearField(ohauthtootoken.FieldScopes, field.TypeJSON) + } + if value, ok := oattu.mutation.Nonce(); ok { + _spec.SetField(ohauthtootoken.FieldNonce, field.TypeString, value) + } + if value, ok := oattu.mutation.ClaimsUserID(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsUserID, field.TypeString, value) + } + if value, ok := oattu.mutation.ClaimsUsername(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsUsername, field.TypeString, value) + } + if value, ok := oattu.mutation.ClaimsEmail(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsEmail, field.TypeString, value) + } + if value, ok := oattu.mutation.ClaimsEmailVerified(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsEmailVerified, field.TypeBool, value) + } + if value, ok := oattu.mutation.ClaimsGroups(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsGroups, field.TypeJSON, value) + } + if value, ok := oattu.mutation.AppendedClaimsGroups(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldClaimsGroups, value) + }) + } + if oattu.mutation.ClaimsGroupsCleared() { + _spec.ClearField(ohauthtootoken.FieldClaimsGroups, field.TypeJSON) + } + if value, ok := oattu.mutation.ClaimsPreferredUsername(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsPreferredUsername, field.TypeString, value) + } + if value, ok := oattu.mutation.ConnectorID(); ok { + _spec.SetField(ohauthtootoken.FieldConnectorID, field.TypeString, value) + } + if value, ok := oattu.mutation.ConnectorData(); ok { + _spec.SetField(ohauthtootoken.FieldConnectorData, field.TypeJSON, value) + } + if value, ok := oattu.mutation.AppendedConnectorData(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldConnectorData, value) + }) + } + if oattu.mutation.ConnectorDataCleared() { + _spec.ClearField(ohauthtootoken.FieldConnectorData, field.TypeJSON) + } + if value, ok := oattu.mutation.LastUsed(); ok { + _spec.SetField(ohauthtootoken.FieldLastUsed, field.TypeTime, value) + } + if oattu.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oattu.schemaConfig.IntegrationOauth2tokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattu.mutation.RemovedIntegrationIDs(); len(nodes) > 0 && !oattu.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oattu.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattu.mutation.IntegrationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oattu.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if oattu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oattu.schemaConfig.OhAuthTooTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !oattu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oattu.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oattu.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = oattu.schemaConfig.OhAuthTooToken + ctx = internal.NewSchemaConfigContext(ctx, oattu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, oattu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{ohauthtootoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + oattu.mutation.done = true + return n, nil +} + +// OhAuthTooTokenUpdateOne is the builder for updating a single OhAuthTooToken entity. +type OhAuthTooTokenUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OhAuthTooTokenMutation +} + +// SetTags sets the "tags" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetTags(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetTags(s) + return oattuo +} + +// AppendTags appends s to the "tags" field. +func (oattuo *OhAuthTooTokenUpdateOne) AppendTags(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.AppendTags(s) + return oattuo +} + +// ClearTags clears the value of the "tags" field. +func (oattuo *OhAuthTooTokenUpdateOne) ClearTags() *OhAuthTooTokenUpdateOne { + oattuo.mutation.ClearTags() + return oattuo +} + +// SetClientID sets the "client_id" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetClientID(s string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetClientID(s) + return oattuo +} + +// SetNillableClientID sets the "client_id" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableClientID(s *string) *OhAuthTooTokenUpdateOne { + if s != nil { + oattuo.SetClientID(*s) + } + return oattuo +} + +// SetScopes sets the "scopes" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetScopes(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetScopes(s) + return oattuo +} + +// AppendScopes appends s to the "scopes" field. +func (oattuo *OhAuthTooTokenUpdateOne) AppendScopes(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.AppendScopes(s) + return oattuo +} + +// ClearScopes clears the value of the "scopes" field. +func (oattuo *OhAuthTooTokenUpdateOne) ClearScopes() *OhAuthTooTokenUpdateOne { + oattuo.mutation.ClearScopes() + return oattuo +} + +// SetNonce sets the "nonce" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetNonce(s string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetNonce(s) + return oattuo +} + +// SetNillableNonce sets the "nonce" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableNonce(s *string) *OhAuthTooTokenUpdateOne { + if s != nil { + oattuo.SetNonce(*s) + } + return oattuo +} + +// SetClaimsUserID sets the "claims_user_id" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetClaimsUserID(s string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetClaimsUserID(s) + return oattuo +} + +// SetNillableClaimsUserID sets the "claims_user_id" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableClaimsUserID(s *string) *OhAuthTooTokenUpdateOne { + if s != nil { + oattuo.SetClaimsUserID(*s) + } + return oattuo +} + +// SetClaimsUsername sets the "claims_username" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetClaimsUsername(s string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetClaimsUsername(s) + return oattuo +} + +// SetNillableClaimsUsername sets the "claims_username" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableClaimsUsername(s *string) *OhAuthTooTokenUpdateOne { + if s != nil { + oattuo.SetClaimsUsername(*s) + } + return oattuo +} + +// SetClaimsEmail sets the "claims_email" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetClaimsEmail(s string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetClaimsEmail(s) + return oattuo +} + +// SetNillableClaimsEmail sets the "claims_email" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableClaimsEmail(s *string) *OhAuthTooTokenUpdateOne { + if s != nil { + oattuo.SetClaimsEmail(*s) + } + return oattuo +} + +// SetClaimsEmailVerified sets the "claims_email_verified" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetClaimsEmailVerified(b bool) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetClaimsEmailVerified(b) + return oattuo +} + +// SetNillableClaimsEmailVerified sets the "claims_email_verified" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableClaimsEmailVerified(b *bool) *OhAuthTooTokenUpdateOne { + if b != nil { + oattuo.SetClaimsEmailVerified(*b) + } + return oattuo +} + +// SetClaimsGroups sets the "claims_groups" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetClaimsGroups(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetClaimsGroups(s) + return oattuo +} + +// AppendClaimsGroups appends s to the "claims_groups" field. +func (oattuo *OhAuthTooTokenUpdateOne) AppendClaimsGroups(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.AppendClaimsGroups(s) + return oattuo +} + +// ClearClaimsGroups clears the value of the "claims_groups" field. +func (oattuo *OhAuthTooTokenUpdateOne) ClearClaimsGroups() *OhAuthTooTokenUpdateOne { + oattuo.mutation.ClearClaimsGroups() + return oattuo +} + +// SetClaimsPreferredUsername sets the "claims_preferred_username" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetClaimsPreferredUsername(s string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetClaimsPreferredUsername(s) + return oattuo +} + +// SetNillableClaimsPreferredUsername sets the "claims_preferred_username" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableClaimsPreferredUsername(s *string) *OhAuthTooTokenUpdateOne { + if s != nil { + oattuo.SetClaimsPreferredUsername(*s) + } + return oattuo +} + +// SetConnectorID sets the "connector_id" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetConnectorID(s string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetConnectorID(s) + return oattuo +} + +// SetNillableConnectorID sets the "connector_id" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableConnectorID(s *string) *OhAuthTooTokenUpdateOne { + if s != nil { + oattuo.SetConnectorID(*s) + } + return oattuo +} + +// SetConnectorData sets the "connector_data" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetConnectorData(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetConnectorData(s) + return oattuo +} + +// AppendConnectorData appends s to the "connector_data" field. +func (oattuo *OhAuthTooTokenUpdateOne) AppendConnectorData(s []string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.AppendConnectorData(s) + return oattuo +} + +// ClearConnectorData clears the value of the "connector_data" field. +func (oattuo *OhAuthTooTokenUpdateOne) ClearConnectorData() *OhAuthTooTokenUpdateOne { + oattuo.mutation.ClearConnectorData() + return oattuo +} + +// SetLastUsed sets the "last_used" field. +func (oattuo *OhAuthTooTokenUpdateOne) SetLastUsed(t time.Time) *OhAuthTooTokenUpdateOne { + oattuo.mutation.SetLastUsed(t) + return oattuo +} + +// SetNillableLastUsed sets the "last_used" field if the given value is not nil. +func (oattuo *OhAuthTooTokenUpdateOne) SetNillableLastUsed(t *time.Time) *OhAuthTooTokenUpdateOne { + if t != nil { + oattuo.SetLastUsed(*t) + } + return oattuo +} + +// AddIntegrationIDs adds the "integration" edge to the Integration entity by IDs. +func (oattuo *OhAuthTooTokenUpdateOne) AddIntegrationIDs(ids ...string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.AddIntegrationIDs(ids...) + return oattuo +} + +// AddIntegration adds the "integration" edges to the Integration entity. +func (oattuo *OhAuthTooTokenUpdateOne) AddIntegration(i ...*Integration) *OhAuthTooTokenUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return oattuo.AddIntegrationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (oattuo *OhAuthTooTokenUpdateOne) AddEventIDs(ids ...string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.AddEventIDs(ids...) + return oattuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (oattuo *OhAuthTooTokenUpdateOne) AddEvents(e ...*Event) *OhAuthTooTokenUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oattuo.AddEventIDs(ids...) +} + +// Mutation returns the OhAuthTooTokenMutation object of the builder. +func (oattuo *OhAuthTooTokenUpdateOne) Mutation() *OhAuthTooTokenMutation { + return oattuo.mutation +} + +// ClearIntegration clears all "integration" edges to the Integration entity. +func (oattuo *OhAuthTooTokenUpdateOne) ClearIntegration() *OhAuthTooTokenUpdateOne { + oattuo.mutation.ClearIntegration() + return oattuo +} + +// RemoveIntegrationIDs removes the "integration" edge to Integration entities by IDs. +func (oattuo *OhAuthTooTokenUpdateOne) RemoveIntegrationIDs(ids ...string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.RemoveIntegrationIDs(ids...) + return oattuo +} + +// RemoveIntegration removes "integration" edges to Integration entities. +func (oattuo *OhAuthTooTokenUpdateOne) RemoveIntegration(i ...*Integration) *OhAuthTooTokenUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return oattuo.RemoveIntegrationIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (oattuo *OhAuthTooTokenUpdateOne) ClearEvents() *OhAuthTooTokenUpdateOne { + oattuo.mutation.ClearEvents() + return oattuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (oattuo *OhAuthTooTokenUpdateOne) RemoveEventIDs(ids ...string) *OhAuthTooTokenUpdateOne { + oattuo.mutation.RemoveEventIDs(ids...) + return oattuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (oattuo *OhAuthTooTokenUpdateOne) RemoveEvents(e ...*Event) *OhAuthTooTokenUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oattuo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the OhAuthTooTokenUpdate builder. +func (oattuo *OhAuthTooTokenUpdateOne) Where(ps ...predicate.OhAuthTooToken) *OhAuthTooTokenUpdateOne { + oattuo.mutation.Where(ps...) + return oattuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (oattuo *OhAuthTooTokenUpdateOne) Select(field string, fields ...string) *OhAuthTooTokenUpdateOne { + oattuo.fields = append([]string{field}, fields...) + return oattuo +} + +// Save executes the query and returns the updated OhAuthTooToken entity. +func (oattuo *OhAuthTooTokenUpdateOne) Save(ctx context.Context) (*OhAuthTooToken, error) { + return withHooks(ctx, oattuo.sqlSave, oattuo.mutation, oattuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (oattuo *OhAuthTooTokenUpdateOne) SaveX(ctx context.Context) *OhAuthTooToken { + node, err := oattuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (oattuo *OhAuthTooTokenUpdateOne) Exec(ctx context.Context) error { + _, err := oattuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oattuo *OhAuthTooTokenUpdateOne) ExecX(ctx context.Context) { + if err := oattuo.Exec(ctx); err != nil { + panic(err) + } +} + +// check runs all checks and user-defined validators on the builder. +func (oattuo *OhAuthTooTokenUpdateOne) check() error { + if v, ok := oattuo.mutation.ClientID(); ok { + if err := ohauthtootoken.ClientIDValidator(v); err != nil { + return &ValidationError{Name: "client_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.client_id": %w`, err)} + } + } + if v, ok := oattuo.mutation.Nonce(); ok { + if err := ohauthtootoken.NonceValidator(v); err != nil { + return &ValidationError{Name: "nonce", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.nonce": %w`, err)} + } + } + if v, ok := oattuo.mutation.ClaimsUserID(); ok { + if err := ohauthtootoken.ClaimsUserIDValidator(v); err != nil { + return &ValidationError{Name: "claims_user_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_user_id": %w`, err)} + } + } + if v, ok := oattuo.mutation.ClaimsUsername(); ok { + if err := ohauthtootoken.ClaimsUsernameValidator(v); err != nil { + return &ValidationError{Name: "claims_username", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_username": %w`, err)} + } + } + if v, ok := oattuo.mutation.ClaimsEmail(); ok { + if err := ohauthtootoken.ClaimsEmailValidator(v); err != nil { + return &ValidationError{Name: "claims_email", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.claims_email": %w`, err)} + } + } + if v, ok := oattuo.mutation.ConnectorID(); ok { + if err := ohauthtootoken.ConnectorIDValidator(v); err != nil { + return &ValidationError{Name: "connector_id", err: fmt.Errorf(`generated: validator failed for field "OhAuthTooToken.connector_id": %w`, err)} + } + } + return nil +} + +func (oattuo *OhAuthTooTokenUpdateOne) sqlSave(ctx context.Context) (_node *OhAuthTooToken, err error) { + if err := oattuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(ohauthtootoken.Table, ohauthtootoken.Columns, sqlgraph.NewFieldSpec(ohauthtootoken.FieldID, field.TypeString)) + id, ok := oattuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OhAuthTooToken.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := oattuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, ohauthtootoken.FieldID) + for _, f := range fields { + if !ohauthtootoken.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != ohauthtootoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := oattuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if value, ok := oattuo.mutation.Tags(); ok { + _spec.SetField(ohauthtootoken.FieldTags, field.TypeJSON, value) + } + if value, ok := oattuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldTags, value) + }) + } + if oattuo.mutation.TagsCleared() { + _spec.ClearField(ohauthtootoken.FieldTags, field.TypeJSON) + } + if value, ok := oattuo.mutation.ClientID(); ok { + _spec.SetField(ohauthtootoken.FieldClientID, field.TypeString, value) + } + if value, ok := oattuo.mutation.Scopes(); ok { + _spec.SetField(ohauthtootoken.FieldScopes, field.TypeJSON, value) + } + if value, ok := oattuo.mutation.AppendedScopes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldScopes, value) + }) + } + if oattuo.mutation.ScopesCleared() { + _spec.ClearField(ohauthtootoken.FieldScopes, field.TypeJSON) + } + if value, ok := oattuo.mutation.Nonce(); ok { + _spec.SetField(ohauthtootoken.FieldNonce, field.TypeString, value) + } + if value, ok := oattuo.mutation.ClaimsUserID(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsUserID, field.TypeString, value) + } + if value, ok := oattuo.mutation.ClaimsUsername(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsUsername, field.TypeString, value) + } + if value, ok := oattuo.mutation.ClaimsEmail(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsEmail, field.TypeString, value) + } + if value, ok := oattuo.mutation.ClaimsEmailVerified(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsEmailVerified, field.TypeBool, value) + } + if value, ok := oattuo.mutation.ClaimsGroups(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsGroups, field.TypeJSON, value) + } + if value, ok := oattuo.mutation.AppendedClaimsGroups(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldClaimsGroups, value) + }) + } + if oattuo.mutation.ClaimsGroupsCleared() { + _spec.ClearField(ohauthtootoken.FieldClaimsGroups, field.TypeJSON) + } + if value, ok := oattuo.mutation.ClaimsPreferredUsername(); ok { + _spec.SetField(ohauthtootoken.FieldClaimsPreferredUsername, field.TypeString, value) + } + if value, ok := oattuo.mutation.ConnectorID(); ok { + _spec.SetField(ohauthtootoken.FieldConnectorID, field.TypeString, value) + } + if value, ok := oattuo.mutation.ConnectorData(); ok { + _spec.SetField(ohauthtootoken.FieldConnectorData, field.TypeJSON, value) + } + if value, ok := oattuo.mutation.AppendedConnectorData(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, ohauthtootoken.FieldConnectorData, value) + }) + } + if oattuo.mutation.ConnectorDataCleared() { + _spec.ClearField(ohauthtootoken.FieldConnectorData, field.TypeJSON) + } + if value, ok := oattuo.mutation.LastUsed(); ok { + _spec.SetField(ohauthtootoken.FieldLastUsed, field.TypeTime, value) + } + if oattuo.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oattuo.schemaConfig.IntegrationOauth2tokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattuo.mutation.RemovedIntegrationIDs(); len(nodes) > 0 && !oattuo.mutation.IntegrationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oattuo.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattuo.mutation.IntegrationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: ohauthtootoken.IntegrationTable, + Columns: ohauthtootoken.IntegrationPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oattuo.schemaConfig.IntegrationOauth2tokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if oattuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oattuo.schemaConfig.OhAuthTooTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !oattuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oattuo.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := oattuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: ohauthtootoken.EventsTable, + Columns: ohauthtootoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oattuo.schemaConfig.OhAuthTooTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = oattuo.schemaConfig.OhAuthTooToken + ctx = internal.NewSchemaConfigContext(ctx, oattuo.schemaConfig) + _node = &OhAuthTooToken{config: oattuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, oattuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{ohauthtootoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + oattuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/organization.go b/internal/ent/generated/organization.go new file mode 100644 index 0000000..73b9698 --- /dev/null +++ b/internal/ent/generated/organization.go @@ -0,0 +1,1343 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" +) + +// Organization is the model entity for the Organization schema. +type Organization struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // the name of the organization + Name string `json:"name,omitempty"` + // The organization's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + // An optional description of the organization + Description string `json:"description,omitempty"` + // The ID of the parent organization for the organization. + ParentOrganizationID string `json:"parent_organization_id,omitempty"` + // orgs directly associated with a user + PersonalOrg bool `json:"personal_org,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatar_remote_url,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb bool `json:"dedicated_db,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the OrganizationQuery when eager-loading is set. + Edges OrganizationEdges `json:"edges"` + selectValues sql.SelectValues +} + +// OrganizationEdges holds the relations/edges for other nodes in the graph. +type OrganizationEdges struct { + // Parent holds the value of the parent edge. + Parent *Organization `json:"parent,omitempty"` + // Children holds the value of the children edge. + Children []*Organization `json:"children,omitempty"` + // Groups holds the value of the groups edge. + Groups []*Group `json:"groups,omitempty"` + // Templates holds the value of the templates edge. + Templates []*Template `json:"templates,omitempty"` + // Integrations holds the value of the integrations edge. + Integrations []*Integration `json:"integrations,omitempty"` + // Setting holds the value of the setting edge. + Setting *OrganizationSetting `json:"setting,omitempty"` + // Documentdata holds the value of the documentdata edge. + Documentdata []*DocumentData `json:"documentdata,omitempty"` + // Entitlements holds the value of the entitlements edge. + Entitlements []*Entitlement `json:"entitlements,omitempty"` + // OrganizationEntitlement holds the value of the organization_entitlement edge. + OrganizationEntitlement []*Entitlement `json:"organization_entitlement,omitempty"` + // PersonalAccessTokens holds the value of the personal_access_tokens edge. + PersonalAccessTokens []*PersonalAccessToken `json:"personal_access_tokens,omitempty"` + // APITokens holds the value of the api_tokens edge. + APITokens []*APIToken `json:"api_tokens,omitempty"` + // Oauthprovider holds the value of the oauthprovider edge. + Oauthprovider []*OauthProvider `json:"oauthprovider,omitempty"` + // Users holds the value of the users edge. + Users []*User `json:"users,omitempty"` + // Invites holds the value of the invites edge. + Invites []*Invite `json:"invites,omitempty"` + // Subscribers holds the value of the subscribers edge. + Subscribers []*Subscriber `json:"subscribers,omitempty"` + // Webhooks holds the value of the webhooks edge. + Webhooks []*Webhook `json:"webhooks,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // Secrets holds the value of the secrets edge. + Secrets []*Hush `json:"secrets,omitempty"` + // Features holds the value of the features edge. + Features []*Feature `json:"features,omitempty"` + // Files holds the value of the files edge. + Files []*File `json:"files,omitempty"` + // Entitlementplans holds the value of the entitlementplans edge. + Entitlementplans []*EntitlementPlan `json:"entitlementplans,omitempty"` + // Entitlementplanfeatures holds the value of the entitlementplanfeatures edge. + Entitlementplanfeatures []*EntitlementPlanFeature `json:"entitlementplanfeatures,omitempty"` + // Entities holds the value of the entities edge. + Entities []*Entity `json:"entities,omitempty"` + // Entitytypes holds the value of the entitytypes edge. + Entitytypes []*EntityType `json:"entitytypes,omitempty"` + // Contacts holds the value of the contacts edge. + Contacts []*Contact `json:"contacts,omitempty"` + // Notes holds the value of the notes edge. + Notes []*Note `json:"notes,omitempty"` + // Members holds the value of the members edge. + Members []*OrgMembership `json:"members,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [27]bool + // totalCount holds the count of the edges above. + totalCount [27]map[string]int + + namedChildren map[string][]*Organization + namedGroups map[string][]*Group + namedTemplates map[string][]*Template + namedIntegrations map[string][]*Integration + namedDocumentdata map[string][]*DocumentData + namedEntitlements map[string][]*Entitlement + namedOrganizationEntitlement map[string][]*Entitlement + namedPersonalAccessTokens map[string][]*PersonalAccessToken + namedAPITokens map[string][]*APIToken + namedOauthprovider map[string][]*OauthProvider + namedUsers map[string][]*User + namedInvites map[string][]*Invite + namedSubscribers map[string][]*Subscriber + namedWebhooks map[string][]*Webhook + namedEvents map[string][]*Event + namedSecrets map[string][]*Hush + namedFeatures map[string][]*Feature + namedFiles map[string][]*File + namedEntitlementplans map[string][]*EntitlementPlan + namedEntitlementplanfeatures map[string][]*EntitlementPlanFeature + namedEntities map[string][]*Entity + namedEntitytypes map[string][]*EntityType + namedContacts map[string][]*Contact + namedNotes map[string][]*Note + namedMembers map[string][]*OrgMembership +} + +// ParentOrErr returns the Parent value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e OrganizationEdges) ParentOrErr() (*Organization, error) { + if e.Parent != nil { + return e.Parent, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "parent"} +} + +// ChildrenOrErr returns the Children value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) ChildrenOrErr() ([]*Organization, error) { + if e.loadedTypes[1] { + return e.Children, nil + } + return nil, &NotLoadedError{edge: "children"} +} + +// GroupsOrErr returns the Groups value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) GroupsOrErr() ([]*Group, error) { + if e.loadedTypes[2] { + return e.Groups, nil + } + return nil, &NotLoadedError{edge: "groups"} +} + +// TemplatesOrErr returns the Templates value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) TemplatesOrErr() ([]*Template, error) { + if e.loadedTypes[3] { + return e.Templates, nil + } + return nil, &NotLoadedError{edge: "templates"} +} + +// IntegrationsOrErr returns the Integrations value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) IntegrationsOrErr() ([]*Integration, error) { + if e.loadedTypes[4] { + return e.Integrations, nil + } + return nil, &NotLoadedError{edge: "integrations"} +} + +// SettingOrErr returns the Setting value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e OrganizationEdges) SettingOrErr() (*OrganizationSetting, error) { + if e.Setting != nil { + return e.Setting, nil + } else if e.loadedTypes[5] { + return nil, &NotFoundError{label: organizationsetting.Label} + } + return nil, &NotLoadedError{edge: "setting"} +} + +// DocumentdataOrErr returns the Documentdata value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) DocumentdataOrErr() ([]*DocumentData, error) { + if e.loadedTypes[6] { + return e.Documentdata, nil + } + return nil, &NotLoadedError{edge: "documentdata"} +} + +// EntitlementsOrErr returns the Entitlements value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) EntitlementsOrErr() ([]*Entitlement, error) { + if e.loadedTypes[7] { + return e.Entitlements, nil + } + return nil, &NotLoadedError{edge: "entitlements"} +} + +// OrganizationEntitlementOrErr returns the OrganizationEntitlement value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) OrganizationEntitlementOrErr() ([]*Entitlement, error) { + if e.loadedTypes[8] { + return e.OrganizationEntitlement, nil + } + return nil, &NotLoadedError{edge: "organization_entitlement"} +} + +// PersonalAccessTokensOrErr returns the PersonalAccessTokens value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) PersonalAccessTokensOrErr() ([]*PersonalAccessToken, error) { + if e.loadedTypes[9] { + return e.PersonalAccessTokens, nil + } + return nil, &NotLoadedError{edge: "personal_access_tokens"} +} + +// APITokensOrErr returns the APITokens value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) APITokensOrErr() ([]*APIToken, error) { + if e.loadedTypes[10] { + return e.APITokens, nil + } + return nil, &NotLoadedError{edge: "api_tokens"} +} + +// OauthproviderOrErr returns the Oauthprovider value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) OauthproviderOrErr() ([]*OauthProvider, error) { + if e.loadedTypes[11] { + return e.Oauthprovider, nil + } + return nil, &NotLoadedError{edge: "oauthprovider"} +} + +// UsersOrErr returns the Users value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) UsersOrErr() ([]*User, error) { + if e.loadedTypes[12] { + return e.Users, nil + } + return nil, &NotLoadedError{edge: "users"} +} + +// InvitesOrErr returns the Invites value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) InvitesOrErr() ([]*Invite, error) { + if e.loadedTypes[13] { + return e.Invites, nil + } + return nil, &NotLoadedError{edge: "invites"} +} + +// SubscribersOrErr returns the Subscribers value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) SubscribersOrErr() ([]*Subscriber, error) { + if e.loadedTypes[14] { + return e.Subscribers, nil + } + return nil, &NotLoadedError{edge: "subscribers"} +} + +// WebhooksOrErr returns the Webhooks value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) WebhooksOrErr() ([]*Webhook, error) { + if e.loadedTypes[15] { + return e.Webhooks, nil + } + return nil, &NotLoadedError{edge: "webhooks"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[16] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// SecretsOrErr returns the Secrets value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) SecretsOrErr() ([]*Hush, error) { + if e.loadedTypes[17] { + return e.Secrets, nil + } + return nil, &NotLoadedError{edge: "secrets"} +} + +// FeaturesOrErr returns the Features value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) FeaturesOrErr() ([]*Feature, error) { + if e.loadedTypes[18] { + return e.Features, nil + } + return nil, &NotLoadedError{edge: "features"} +} + +// FilesOrErr returns the Files value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) FilesOrErr() ([]*File, error) { + if e.loadedTypes[19] { + return e.Files, nil + } + return nil, &NotLoadedError{edge: "files"} +} + +// EntitlementplansOrErr returns the Entitlementplans value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) EntitlementplansOrErr() ([]*EntitlementPlan, error) { + if e.loadedTypes[20] { + return e.Entitlementplans, nil + } + return nil, &NotLoadedError{edge: "entitlementplans"} +} + +// EntitlementplanfeaturesOrErr returns the Entitlementplanfeatures value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) EntitlementplanfeaturesOrErr() ([]*EntitlementPlanFeature, error) { + if e.loadedTypes[21] { + return e.Entitlementplanfeatures, nil + } + return nil, &NotLoadedError{edge: "entitlementplanfeatures"} +} + +// EntitiesOrErr returns the Entities value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) EntitiesOrErr() ([]*Entity, error) { + if e.loadedTypes[22] { + return e.Entities, nil + } + return nil, &NotLoadedError{edge: "entities"} +} + +// EntitytypesOrErr returns the Entitytypes value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) EntitytypesOrErr() ([]*EntityType, error) { + if e.loadedTypes[23] { + return e.Entitytypes, nil + } + return nil, &NotLoadedError{edge: "entitytypes"} +} + +// ContactsOrErr returns the Contacts value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) ContactsOrErr() ([]*Contact, error) { + if e.loadedTypes[24] { + return e.Contacts, nil + } + return nil, &NotLoadedError{edge: "contacts"} +} + +// NotesOrErr returns the Notes value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) NotesOrErr() ([]*Note, error) { + if e.loadedTypes[25] { + return e.Notes, nil + } + return nil, &NotLoadedError{edge: "notes"} +} + +// MembersOrErr returns the Members value or an error if the edge +// was not loaded in eager-loading. +func (e OrganizationEdges) MembersOrErr() ([]*OrgMembership, error) { + if e.loadedTypes[26] { + return e.Members, nil + } + return nil, &NotLoadedError{edge: "members"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Organization) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case organization.FieldTags: + values[i] = new([]byte) + case organization.FieldPersonalOrg, organization.FieldDedicatedDb: + values[i] = new(sql.NullBool) + case organization.FieldID, organization.FieldCreatedBy, organization.FieldUpdatedBy, organization.FieldMappingID, organization.FieldDeletedBy, organization.FieldName, organization.FieldDisplayName, organization.FieldDescription, organization.FieldParentOrganizationID, organization.FieldAvatarRemoteURL: + values[i] = new(sql.NullString) + case organization.FieldCreatedAt, organization.FieldUpdatedAt, organization.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Organization fields. +func (o *Organization) 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 organization.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + o.ID = value.String + } + case organization.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + o.CreatedAt = value.Time + } + case organization.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + o.UpdatedAt = value.Time + } + case organization.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + o.CreatedBy = value.String + } + case organization.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + o.UpdatedBy = value.String + } + case organization.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + o.MappingID = value.String + } + case organization.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &o.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case organization.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + o.DeletedAt = value.Time + } + case organization.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + o.DeletedBy = value.String + } + case organization.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + o.Name = value.String + } + case organization.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + o.DisplayName = value.String + } + case organization.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + o.Description = value.String + } + case organization.FieldParentOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field parent_organization_id", values[i]) + } else if value.Valid { + o.ParentOrganizationID = value.String + } + case organization.FieldPersonalOrg: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field personal_org", values[i]) + } else if value.Valid { + o.PersonalOrg = value.Bool + } + case organization.FieldAvatarRemoteURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field avatar_remote_url", values[i]) + } else if value.Valid { + o.AvatarRemoteURL = new(string) + *o.AvatarRemoteURL = value.String + } + case organization.FieldDedicatedDb: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field dedicated_db", values[i]) + } else if value.Valid { + o.DedicatedDb = value.Bool + } + default: + o.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Organization. +// This includes values selected through modifiers, order, etc. +func (o *Organization) Value(name string) (ent.Value, error) { + return o.selectValues.Get(name) +} + +// QueryParent queries the "parent" edge of the Organization entity. +func (o *Organization) QueryParent() *OrganizationQuery { + return NewOrganizationClient(o.config).QueryParent(o) +} + +// QueryChildren queries the "children" edge of the Organization entity. +func (o *Organization) QueryChildren() *OrganizationQuery { + return NewOrganizationClient(o.config).QueryChildren(o) +} + +// QueryGroups queries the "groups" edge of the Organization entity. +func (o *Organization) QueryGroups() *GroupQuery { + return NewOrganizationClient(o.config).QueryGroups(o) +} + +// QueryTemplates queries the "templates" edge of the Organization entity. +func (o *Organization) QueryTemplates() *TemplateQuery { + return NewOrganizationClient(o.config).QueryTemplates(o) +} + +// QueryIntegrations queries the "integrations" edge of the Organization entity. +func (o *Organization) QueryIntegrations() *IntegrationQuery { + return NewOrganizationClient(o.config).QueryIntegrations(o) +} + +// QuerySetting queries the "setting" edge of the Organization entity. +func (o *Organization) QuerySetting() *OrganizationSettingQuery { + return NewOrganizationClient(o.config).QuerySetting(o) +} + +// QueryDocumentdata queries the "documentdata" edge of the Organization entity. +func (o *Organization) QueryDocumentdata() *DocumentDataQuery { + return NewOrganizationClient(o.config).QueryDocumentdata(o) +} + +// QueryEntitlements queries the "entitlements" edge of the Organization entity. +func (o *Organization) QueryEntitlements() *EntitlementQuery { + return NewOrganizationClient(o.config).QueryEntitlements(o) +} + +// QueryOrganizationEntitlement queries the "organization_entitlement" edge of the Organization entity. +func (o *Organization) QueryOrganizationEntitlement() *EntitlementQuery { + return NewOrganizationClient(o.config).QueryOrganizationEntitlement(o) +} + +// QueryPersonalAccessTokens queries the "personal_access_tokens" edge of the Organization entity. +func (o *Organization) QueryPersonalAccessTokens() *PersonalAccessTokenQuery { + return NewOrganizationClient(o.config).QueryPersonalAccessTokens(o) +} + +// QueryAPITokens queries the "api_tokens" edge of the Organization entity. +func (o *Organization) QueryAPITokens() *APITokenQuery { + return NewOrganizationClient(o.config).QueryAPITokens(o) +} + +// QueryOauthprovider queries the "oauthprovider" edge of the Organization entity. +func (o *Organization) QueryOauthprovider() *OauthProviderQuery { + return NewOrganizationClient(o.config).QueryOauthprovider(o) +} + +// QueryUsers queries the "users" edge of the Organization entity. +func (o *Organization) QueryUsers() *UserQuery { + return NewOrganizationClient(o.config).QueryUsers(o) +} + +// QueryInvites queries the "invites" edge of the Organization entity. +func (o *Organization) QueryInvites() *InviteQuery { + return NewOrganizationClient(o.config).QueryInvites(o) +} + +// QuerySubscribers queries the "subscribers" edge of the Organization entity. +func (o *Organization) QuerySubscribers() *SubscriberQuery { + return NewOrganizationClient(o.config).QuerySubscribers(o) +} + +// QueryWebhooks queries the "webhooks" edge of the Organization entity. +func (o *Organization) QueryWebhooks() *WebhookQuery { + return NewOrganizationClient(o.config).QueryWebhooks(o) +} + +// QueryEvents queries the "events" edge of the Organization entity. +func (o *Organization) QueryEvents() *EventQuery { + return NewOrganizationClient(o.config).QueryEvents(o) +} + +// QuerySecrets queries the "secrets" edge of the Organization entity. +func (o *Organization) QuerySecrets() *HushQuery { + return NewOrganizationClient(o.config).QuerySecrets(o) +} + +// QueryFeatures queries the "features" edge of the Organization entity. +func (o *Organization) QueryFeatures() *FeatureQuery { + return NewOrganizationClient(o.config).QueryFeatures(o) +} + +// QueryFiles queries the "files" edge of the Organization entity. +func (o *Organization) QueryFiles() *FileQuery { + return NewOrganizationClient(o.config).QueryFiles(o) +} + +// QueryEntitlementplans queries the "entitlementplans" edge of the Organization entity. +func (o *Organization) QueryEntitlementplans() *EntitlementPlanQuery { + return NewOrganizationClient(o.config).QueryEntitlementplans(o) +} + +// QueryEntitlementplanfeatures queries the "entitlementplanfeatures" edge of the Organization entity. +func (o *Organization) QueryEntitlementplanfeatures() *EntitlementPlanFeatureQuery { + return NewOrganizationClient(o.config).QueryEntitlementplanfeatures(o) +} + +// QueryEntities queries the "entities" edge of the Organization entity. +func (o *Organization) QueryEntities() *EntityQuery { + return NewOrganizationClient(o.config).QueryEntities(o) +} + +// QueryEntitytypes queries the "entitytypes" edge of the Organization entity. +func (o *Organization) QueryEntitytypes() *EntityTypeQuery { + return NewOrganizationClient(o.config).QueryEntitytypes(o) +} + +// QueryContacts queries the "contacts" edge of the Organization entity. +func (o *Organization) QueryContacts() *ContactQuery { + return NewOrganizationClient(o.config).QueryContacts(o) +} + +// QueryNotes queries the "notes" edge of the Organization entity. +func (o *Organization) QueryNotes() *NoteQuery { + return NewOrganizationClient(o.config).QueryNotes(o) +} + +// QueryMembers queries the "members" edge of the Organization entity. +func (o *Organization) QueryMembers() *OrgMembershipQuery { + return NewOrganizationClient(o.config).QueryMembers(o) +} + +// Update returns a builder for updating this Organization. +// Note that you need to call Organization.Unwrap() before calling this method if this Organization +// was returned from a transaction, and the transaction was committed or rolled back. +func (o *Organization) Update() *OrganizationUpdateOne { + return NewOrganizationClient(o.config).UpdateOne(o) +} + +// Unwrap unwraps the Organization 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 (o *Organization) Unwrap() *Organization { + _tx, ok := o.config.driver.(*txDriver) + if !ok { + panic("generated: Organization is not a transactional entity") + } + o.config.driver = _tx.drv + return o +} + +// String implements the fmt.Stringer. +func (o *Organization) String() string { + var builder strings.Builder + builder.WriteString("Organization(") + builder.WriteString(fmt.Sprintf("id=%v, ", o.ID)) + builder.WriteString("created_at=") + builder.WriteString(o.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(o.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(o.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(o.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(o.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", o.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(o.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(o.DeletedBy) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(o.Name) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(o.DisplayName) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(o.Description) + builder.WriteString(", ") + builder.WriteString("parent_organization_id=") + builder.WriteString(o.ParentOrganizationID) + builder.WriteString(", ") + builder.WriteString("personal_org=") + builder.WriteString(fmt.Sprintf("%v", o.PersonalOrg)) + builder.WriteString(", ") + if v := o.AvatarRemoteURL; v != nil { + builder.WriteString("avatar_remote_url=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("dedicated_db=") + builder.WriteString(fmt.Sprintf("%v", o.DedicatedDb)) + builder.WriteByte(')') + return builder.String() +} + +// NamedChildren returns the Children named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedChildren(name string) ([]*Organization, error) { + if o.Edges.namedChildren == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedChildren[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedChildren(name string, edges ...*Organization) { + if o.Edges.namedChildren == nil { + o.Edges.namedChildren = make(map[string][]*Organization) + } + if len(edges) == 0 { + o.Edges.namedChildren[name] = []*Organization{} + } else { + o.Edges.namedChildren[name] = append(o.Edges.namedChildren[name], edges...) + } +} + +// NamedGroups returns the Groups named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedGroups(name string) ([]*Group, error) { + if o.Edges.namedGroups == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedGroups[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedGroups(name string, edges ...*Group) { + if o.Edges.namedGroups == nil { + o.Edges.namedGroups = make(map[string][]*Group) + } + if len(edges) == 0 { + o.Edges.namedGroups[name] = []*Group{} + } else { + o.Edges.namedGroups[name] = append(o.Edges.namedGroups[name], edges...) + } +} + +// NamedTemplates returns the Templates named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedTemplates(name string) ([]*Template, error) { + if o.Edges.namedTemplates == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedTemplates[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedTemplates(name string, edges ...*Template) { + if o.Edges.namedTemplates == nil { + o.Edges.namedTemplates = make(map[string][]*Template) + } + if len(edges) == 0 { + o.Edges.namedTemplates[name] = []*Template{} + } else { + o.Edges.namedTemplates[name] = append(o.Edges.namedTemplates[name], edges...) + } +} + +// NamedIntegrations returns the Integrations named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedIntegrations(name string) ([]*Integration, error) { + if o.Edges.namedIntegrations == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedIntegrations[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedIntegrations(name string, edges ...*Integration) { + if o.Edges.namedIntegrations == nil { + o.Edges.namedIntegrations = make(map[string][]*Integration) + } + if len(edges) == 0 { + o.Edges.namedIntegrations[name] = []*Integration{} + } else { + o.Edges.namedIntegrations[name] = append(o.Edges.namedIntegrations[name], edges...) + } +} + +// NamedDocumentdata returns the Documentdata named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedDocumentdata(name string) ([]*DocumentData, error) { + if o.Edges.namedDocumentdata == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedDocumentdata[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedDocumentdata(name string, edges ...*DocumentData) { + if o.Edges.namedDocumentdata == nil { + o.Edges.namedDocumentdata = make(map[string][]*DocumentData) + } + if len(edges) == 0 { + o.Edges.namedDocumentdata[name] = []*DocumentData{} + } else { + o.Edges.namedDocumentdata[name] = append(o.Edges.namedDocumentdata[name], edges...) + } +} + +// NamedEntitlements returns the Entitlements named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedEntitlements(name string) ([]*Entitlement, error) { + if o.Edges.namedEntitlements == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedEntitlements[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedEntitlements(name string, edges ...*Entitlement) { + if o.Edges.namedEntitlements == nil { + o.Edges.namedEntitlements = make(map[string][]*Entitlement) + } + if len(edges) == 0 { + o.Edges.namedEntitlements[name] = []*Entitlement{} + } else { + o.Edges.namedEntitlements[name] = append(o.Edges.namedEntitlements[name], edges...) + } +} + +// NamedOrganizationEntitlement returns the OrganizationEntitlement named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedOrganizationEntitlement(name string) ([]*Entitlement, error) { + if o.Edges.namedOrganizationEntitlement == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedOrganizationEntitlement[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedOrganizationEntitlement(name string, edges ...*Entitlement) { + if o.Edges.namedOrganizationEntitlement == nil { + o.Edges.namedOrganizationEntitlement = make(map[string][]*Entitlement) + } + if len(edges) == 0 { + o.Edges.namedOrganizationEntitlement[name] = []*Entitlement{} + } else { + o.Edges.namedOrganizationEntitlement[name] = append(o.Edges.namedOrganizationEntitlement[name], edges...) + } +} + +// NamedPersonalAccessTokens returns the PersonalAccessTokens named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedPersonalAccessTokens(name string) ([]*PersonalAccessToken, error) { + if o.Edges.namedPersonalAccessTokens == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedPersonalAccessTokens[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedPersonalAccessTokens(name string, edges ...*PersonalAccessToken) { + if o.Edges.namedPersonalAccessTokens == nil { + o.Edges.namedPersonalAccessTokens = make(map[string][]*PersonalAccessToken) + } + if len(edges) == 0 { + o.Edges.namedPersonalAccessTokens[name] = []*PersonalAccessToken{} + } else { + o.Edges.namedPersonalAccessTokens[name] = append(o.Edges.namedPersonalAccessTokens[name], edges...) + } +} + +// NamedAPITokens returns the APITokens named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedAPITokens(name string) ([]*APIToken, error) { + if o.Edges.namedAPITokens == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedAPITokens[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedAPITokens(name string, edges ...*APIToken) { + if o.Edges.namedAPITokens == nil { + o.Edges.namedAPITokens = make(map[string][]*APIToken) + } + if len(edges) == 0 { + o.Edges.namedAPITokens[name] = []*APIToken{} + } else { + o.Edges.namedAPITokens[name] = append(o.Edges.namedAPITokens[name], edges...) + } +} + +// NamedOauthprovider returns the Oauthprovider named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedOauthprovider(name string) ([]*OauthProvider, error) { + if o.Edges.namedOauthprovider == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedOauthprovider[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedOauthprovider(name string, edges ...*OauthProvider) { + if o.Edges.namedOauthprovider == nil { + o.Edges.namedOauthprovider = make(map[string][]*OauthProvider) + } + if len(edges) == 0 { + o.Edges.namedOauthprovider[name] = []*OauthProvider{} + } else { + o.Edges.namedOauthprovider[name] = append(o.Edges.namedOauthprovider[name], edges...) + } +} + +// NamedUsers returns the Users named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedUsers(name string) ([]*User, error) { + if o.Edges.namedUsers == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedUsers[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedUsers(name string, edges ...*User) { + if o.Edges.namedUsers == nil { + o.Edges.namedUsers = make(map[string][]*User) + } + if len(edges) == 0 { + o.Edges.namedUsers[name] = []*User{} + } else { + o.Edges.namedUsers[name] = append(o.Edges.namedUsers[name], edges...) + } +} + +// NamedInvites returns the Invites named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedInvites(name string) ([]*Invite, error) { + if o.Edges.namedInvites == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedInvites[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedInvites(name string, edges ...*Invite) { + if o.Edges.namedInvites == nil { + o.Edges.namedInvites = make(map[string][]*Invite) + } + if len(edges) == 0 { + o.Edges.namedInvites[name] = []*Invite{} + } else { + o.Edges.namedInvites[name] = append(o.Edges.namedInvites[name], edges...) + } +} + +// NamedSubscribers returns the Subscribers named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedSubscribers(name string) ([]*Subscriber, error) { + if o.Edges.namedSubscribers == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedSubscribers[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedSubscribers(name string, edges ...*Subscriber) { + if o.Edges.namedSubscribers == nil { + o.Edges.namedSubscribers = make(map[string][]*Subscriber) + } + if len(edges) == 0 { + o.Edges.namedSubscribers[name] = []*Subscriber{} + } else { + o.Edges.namedSubscribers[name] = append(o.Edges.namedSubscribers[name], edges...) + } +} + +// NamedWebhooks returns the Webhooks named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedWebhooks(name string) ([]*Webhook, error) { + if o.Edges.namedWebhooks == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedWebhooks[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedWebhooks(name string, edges ...*Webhook) { + if o.Edges.namedWebhooks == nil { + o.Edges.namedWebhooks = make(map[string][]*Webhook) + } + if len(edges) == 0 { + o.Edges.namedWebhooks[name] = []*Webhook{} + } else { + o.Edges.namedWebhooks[name] = append(o.Edges.namedWebhooks[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedEvents(name string) ([]*Event, error) { + if o.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedEvents(name string, edges ...*Event) { + if o.Edges.namedEvents == nil { + o.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + o.Edges.namedEvents[name] = []*Event{} + } else { + o.Edges.namedEvents[name] = append(o.Edges.namedEvents[name], edges...) + } +} + +// NamedSecrets returns the Secrets named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedSecrets(name string) ([]*Hush, error) { + if o.Edges.namedSecrets == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedSecrets[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedSecrets(name string, edges ...*Hush) { + if o.Edges.namedSecrets == nil { + o.Edges.namedSecrets = make(map[string][]*Hush) + } + if len(edges) == 0 { + o.Edges.namedSecrets[name] = []*Hush{} + } else { + o.Edges.namedSecrets[name] = append(o.Edges.namedSecrets[name], edges...) + } +} + +// NamedFeatures returns the Features named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedFeatures(name string) ([]*Feature, error) { + if o.Edges.namedFeatures == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedFeatures[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedFeatures(name string, edges ...*Feature) { + if o.Edges.namedFeatures == nil { + o.Edges.namedFeatures = make(map[string][]*Feature) + } + if len(edges) == 0 { + o.Edges.namedFeatures[name] = []*Feature{} + } else { + o.Edges.namedFeatures[name] = append(o.Edges.namedFeatures[name], edges...) + } +} + +// NamedFiles returns the Files named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedFiles(name string) ([]*File, error) { + if o.Edges.namedFiles == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedFiles[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedFiles(name string, edges ...*File) { + if o.Edges.namedFiles == nil { + o.Edges.namedFiles = make(map[string][]*File) + } + if len(edges) == 0 { + o.Edges.namedFiles[name] = []*File{} + } else { + o.Edges.namedFiles[name] = append(o.Edges.namedFiles[name], edges...) + } +} + +// NamedEntitlementplans returns the Entitlementplans named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedEntitlementplans(name string) ([]*EntitlementPlan, error) { + if o.Edges.namedEntitlementplans == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedEntitlementplans[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedEntitlementplans(name string, edges ...*EntitlementPlan) { + if o.Edges.namedEntitlementplans == nil { + o.Edges.namedEntitlementplans = make(map[string][]*EntitlementPlan) + } + if len(edges) == 0 { + o.Edges.namedEntitlementplans[name] = []*EntitlementPlan{} + } else { + o.Edges.namedEntitlementplans[name] = append(o.Edges.namedEntitlementplans[name], edges...) + } +} + +// NamedEntitlementplanfeatures returns the Entitlementplanfeatures named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedEntitlementplanfeatures(name string) ([]*EntitlementPlanFeature, error) { + if o.Edges.namedEntitlementplanfeatures == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedEntitlementplanfeatures[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedEntitlementplanfeatures(name string, edges ...*EntitlementPlanFeature) { + if o.Edges.namedEntitlementplanfeatures == nil { + o.Edges.namedEntitlementplanfeatures = make(map[string][]*EntitlementPlanFeature) + } + if len(edges) == 0 { + o.Edges.namedEntitlementplanfeatures[name] = []*EntitlementPlanFeature{} + } else { + o.Edges.namedEntitlementplanfeatures[name] = append(o.Edges.namedEntitlementplanfeatures[name], edges...) + } +} + +// NamedEntities returns the Entities named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedEntities(name string) ([]*Entity, error) { + if o.Edges.namedEntities == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedEntities[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedEntities(name string, edges ...*Entity) { + if o.Edges.namedEntities == nil { + o.Edges.namedEntities = make(map[string][]*Entity) + } + if len(edges) == 0 { + o.Edges.namedEntities[name] = []*Entity{} + } else { + o.Edges.namedEntities[name] = append(o.Edges.namedEntities[name], edges...) + } +} + +// NamedEntitytypes returns the Entitytypes named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedEntitytypes(name string) ([]*EntityType, error) { + if o.Edges.namedEntitytypes == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedEntitytypes[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedEntitytypes(name string, edges ...*EntityType) { + if o.Edges.namedEntitytypes == nil { + o.Edges.namedEntitytypes = make(map[string][]*EntityType) + } + if len(edges) == 0 { + o.Edges.namedEntitytypes[name] = []*EntityType{} + } else { + o.Edges.namedEntitytypes[name] = append(o.Edges.namedEntitytypes[name], edges...) + } +} + +// NamedContacts returns the Contacts named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedContacts(name string) ([]*Contact, error) { + if o.Edges.namedContacts == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedContacts[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedContacts(name string, edges ...*Contact) { + if o.Edges.namedContacts == nil { + o.Edges.namedContacts = make(map[string][]*Contact) + } + if len(edges) == 0 { + o.Edges.namedContacts[name] = []*Contact{} + } else { + o.Edges.namedContacts[name] = append(o.Edges.namedContacts[name], edges...) + } +} + +// NamedNotes returns the Notes named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedNotes(name string) ([]*Note, error) { + if o.Edges.namedNotes == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedNotes[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedNotes(name string, edges ...*Note) { + if o.Edges.namedNotes == nil { + o.Edges.namedNotes = make(map[string][]*Note) + } + if len(edges) == 0 { + o.Edges.namedNotes[name] = []*Note{} + } else { + o.Edges.namedNotes[name] = append(o.Edges.namedNotes[name], edges...) + } +} + +// NamedMembers returns the Members named value or an error if the edge was not +// loaded in eager-loading with this name. +func (o *Organization) NamedMembers(name string) ([]*OrgMembership, error) { + if o.Edges.namedMembers == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := o.Edges.namedMembers[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (o *Organization) appendNamedMembers(name string, edges ...*OrgMembership) { + if o.Edges.namedMembers == nil { + o.Edges.namedMembers = make(map[string][]*OrgMembership) + } + if len(edges) == 0 { + o.Edges.namedMembers[name] = []*OrgMembership{} + } else { + o.Edges.namedMembers[name] = append(o.Edges.namedMembers[name], edges...) + } +} + +// Organizations is a parsable slice of Organization. +type Organizations []*Organization diff --git a/internal/ent/generated/organization/organization.go b/internal/ent/generated/organization/organization.go new file mode 100644 index 0000000..7c99bf2 --- /dev/null +++ b/internal/ent/generated/organization/organization.go @@ -0,0 +1,991 @@ +// Code generated by ent, DO NOT EDIT. + +package organization + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the organization type in the database. + Label = "organization" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldParentOrganizationID holds the string denoting the parent_organization_id field in the database. + FieldParentOrganizationID = "parent_organization_id" + // FieldPersonalOrg holds the string denoting the personal_org field in the database. + FieldPersonalOrg = "personal_org" + // FieldAvatarRemoteURL holds the string denoting the avatar_remote_url field in the database. + FieldAvatarRemoteURL = "avatar_remote_url" + // FieldDedicatedDb holds the string denoting the dedicated_db field in the database. + FieldDedicatedDb = "dedicated_db" + // EdgeParent holds the string denoting the parent edge name in mutations. + EdgeParent = "parent" + // EdgeChildren holds the string denoting the children edge name in mutations. + EdgeChildren = "children" + // EdgeGroups holds the string denoting the groups edge name in mutations. + EdgeGroups = "groups" + // EdgeTemplates holds the string denoting the templates edge name in mutations. + EdgeTemplates = "templates" + // EdgeIntegrations holds the string denoting the integrations edge name in mutations. + EdgeIntegrations = "integrations" + // EdgeSetting holds the string denoting the setting edge name in mutations. + EdgeSetting = "setting" + // EdgeDocumentdata holds the string denoting the documentdata edge name in mutations. + EdgeDocumentdata = "documentdata" + // EdgeEntitlements holds the string denoting the entitlements edge name in mutations. + EdgeEntitlements = "entitlements" + // EdgeOrganizationEntitlement holds the string denoting the organization_entitlement edge name in mutations. + EdgeOrganizationEntitlement = "organization_entitlement" + // EdgePersonalAccessTokens holds the string denoting the personal_access_tokens edge name in mutations. + EdgePersonalAccessTokens = "personal_access_tokens" + // EdgeAPITokens holds the string denoting the api_tokens edge name in mutations. + EdgeAPITokens = "api_tokens" + // EdgeOauthprovider holds the string denoting the oauthprovider edge name in mutations. + EdgeOauthprovider = "oauthprovider" + // EdgeUsers holds the string denoting the users edge name in mutations. + EdgeUsers = "users" + // EdgeInvites holds the string denoting the invites edge name in mutations. + EdgeInvites = "invites" + // EdgeSubscribers holds the string denoting the subscribers edge name in mutations. + EdgeSubscribers = "subscribers" + // EdgeWebhooks holds the string denoting the webhooks edge name in mutations. + EdgeWebhooks = "webhooks" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // EdgeSecrets holds the string denoting the secrets edge name in mutations. + EdgeSecrets = "secrets" + // EdgeFeatures holds the string denoting the features edge name in mutations. + EdgeFeatures = "features" + // EdgeFiles holds the string denoting the files edge name in mutations. + EdgeFiles = "files" + // EdgeEntitlementplans holds the string denoting the entitlementplans edge name in mutations. + EdgeEntitlementplans = "entitlementplans" + // EdgeEntitlementplanfeatures holds the string denoting the entitlementplanfeatures edge name in mutations. + EdgeEntitlementplanfeatures = "entitlementplanfeatures" + // EdgeEntities holds the string denoting the entities edge name in mutations. + EdgeEntities = "entities" + // EdgeEntitytypes holds the string denoting the entitytypes edge name in mutations. + EdgeEntitytypes = "entitytypes" + // EdgeContacts holds the string denoting the contacts edge name in mutations. + EdgeContacts = "contacts" + // EdgeNotes holds the string denoting the notes edge name in mutations. + EdgeNotes = "notes" + // EdgeMembers holds the string denoting the members edge name in mutations. + EdgeMembers = "members" + // Table holds the table name of the organization in the database. + Table = "organizations" + // ParentTable is the table that holds the parent relation/edge. + ParentTable = "organizations" + // ParentColumn is the table column denoting the parent relation/edge. + ParentColumn = "parent_organization_id" + // ChildrenTable is the table that holds the children relation/edge. + ChildrenTable = "organizations" + // ChildrenColumn is the table column denoting the children relation/edge. + ChildrenColumn = "parent_organization_id" + // GroupsTable is the table that holds the groups relation/edge. + GroupsTable = "groups" + // GroupsInverseTable is the table name for the Group entity. + // It exists in this package in order to avoid circular dependency with the "group" package. + GroupsInverseTable = "groups" + // GroupsColumn is the table column denoting the groups relation/edge. + GroupsColumn = "owner_id" + // TemplatesTable is the table that holds the templates relation/edge. + TemplatesTable = "templates" + // TemplatesInverseTable is the table name for the Template entity. + // It exists in this package in order to avoid circular dependency with the "template" package. + TemplatesInverseTable = "templates" + // TemplatesColumn is the table column denoting the templates relation/edge. + TemplatesColumn = "owner_id" + // IntegrationsTable is the table that holds the integrations relation/edge. + IntegrationsTable = "integrations" + // IntegrationsInverseTable is the table name for the Integration entity. + // It exists in this package in order to avoid circular dependency with the "integration" package. + IntegrationsInverseTable = "integrations" + // IntegrationsColumn is the table column denoting the integrations relation/edge. + IntegrationsColumn = "owner_id" + // SettingTable is the table that holds the setting relation/edge. + SettingTable = "organization_settings" + // SettingInverseTable is the table name for the OrganizationSetting entity. + // It exists in this package in order to avoid circular dependency with the "organizationsetting" package. + SettingInverseTable = "organization_settings" + // SettingColumn is the table column denoting the setting relation/edge. + SettingColumn = "organization_id" + // DocumentdataTable is the table that holds the documentdata relation/edge. + DocumentdataTable = "document_data" + // DocumentdataInverseTable is the table name for the DocumentData entity. + // It exists in this package in order to avoid circular dependency with the "documentdata" package. + DocumentdataInverseTable = "document_data" + // DocumentdataColumn is the table column denoting the documentdata relation/edge. + DocumentdataColumn = "owner_id" + // EntitlementsTable is the table that holds the entitlements relation/edge. + EntitlementsTable = "entitlements" + // EntitlementsInverseTable is the table name for the Entitlement entity. + // It exists in this package in order to avoid circular dependency with the "entitlement" package. + EntitlementsInverseTable = "entitlements" + // EntitlementsColumn is the table column denoting the entitlements relation/edge. + EntitlementsColumn = "owner_id" + // OrganizationEntitlementTable is the table that holds the organization_entitlement relation/edge. + OrganizationEntitlementTable = "entitlements" + // OrganizationEntitlementInverseTable is the table name for the Entitlement entity. + // It exists in this package in order to avoid circular dependency with the "entitlement" package. + OrganizationEntitlementInverseTable = "entitlements" + // OrganizationEntitlementColumn is the table column denoting the organization_entitlement relation/edge. + OrganizationEntitlementColumn = "organization_id" + // PersonalAccessTokensTable is the table that holds the personal_access_tokens relation/edge. The primary key declared below. + PersonalAccessTokensTable = "organization_personal_access_tokens" + // PersonalAccessTokensInverseTable is the table name for the PersonalAccessToken entity. + // It exists in this package in order to avoid circular dependency with the "personalaccesstoken" package. + PersonalAccessTokensInverseTable = "personal_access_tokens" + // APITokensTable is the table that holds the api_tokens relation/edge. + APITokensTable = "api_tokens" + // APITokensInverseTable is the table name for the APIToken entity. + // It exists in this package in order to avoid circular dependency with the "apitoken" package. + APITokensInverseTable = "api_tokens" + // APITokensColumn is the table column denoting the api_tokens relation/edge. + APITokensColumn = "owner_id" + // OauthproviderTable is the table that holds the oauthprovider relation/edge. + OauthproviderTable = "oauth_providers" + // OauthproviderInverseTable is the table name for the OauthProvider entity. + // It exists in this package in order to avoid circular dependency with the "oauthprovider" package. + OauthproviderInverseTable = "oauth_providers" + // OauthproviderColumn is the table column denoting the oauthprovider relation/edge. + OauthproviderColumn = "owner_id" + // UsersTable is the table that holds the users relation/edge. The primary key declared below. + UsersTable = "org_memberships" + // UsersInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + UsersInverseTable = "users" + // InvitesTable is the table that holds the invites relation/edge. + InvitesTable = "invites" + // InvitesInverseTable is the table name for the Invite entity. + // It exists in this package in order to avoid circular dependency with the "invite" package. + InvitesInverseTable = "invites" + // InvitesColumn is the table column denoting the invites relation/edge. + InvitesColumn = "owner_id" + // SubscribersTable is the table that holds the subscribers relation/edge. + SubscribersTable = "subscribers" + // SubscribersInverseTable is the table name for the Subscriber entity. + // It exists in this package in order to avoid circular dependency with the "subscriber" package. + SubscribersInverseTable = "subscribers" + // SubscribersColumn is the table column denoting the subscribers relation/edge. + SubscribersColumn = "owner_id" + // WebhooksTable is the table that holds the webhooks relation/edge. + WebhooksTable = "webhooks" + // WebhooksInverseTable is the table name for the Webhook entity. + // It exists in this package in order to avoid circular dependency with the "webhook" package. + WebhooksInverseTable = "webhooks" + // WebhooksColumn is the table column denoting the webhooks relation/edge. + WebhooksColumn = "owner_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "organization_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" + // SecretsTable is the table that holds the secrets relation/edge. The primary key declared below. + SecretsTable = "organization_secrets" + // SecretsInverseTable is the table name for the Hush entity. + // It exists in this package in order to avoid circular dependency with the "hush" package. + SecretsInverseTable = "hushes" + // FeaturesTable is the table that holds the features relation/edge. + FeaturesTable = "features" + // FeaturesInverseTable is the table name for the Feature entity. + // It exists in this package in order to avoid circular dependency with the "feature" package. + FeaturesInverseTable = "features" + // FeaturesColumn is the table column denoting the features relation/edge. + FeaturesColumn = "owner_id" + // FilesTable is the table that holds the files relation/edge. The primary key declared below. + FilesTable = "organization_files" + // FilesInverseTable is the table name for the File entity. + // It exists in this package in order to avoid circular dependency with the "file" package. + FilesInverseTable = "files" + // EntitlementplansTable is the table that holds the entitlementplans relation/edge. + EntitlementplansTable = "entitlement_plans" + // EntitlementplansInverseTable is the table name for the EntitlementPlan entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplan" package. + EntitlementplansInverseTable = "entitlement_plans" + // EntitlementplansColumn is the table column denoting the entitlementplans relation/edge. + EntitlementplansColumn = "owner_id" + // EntitlementplanfeaturesTable is the table that holds the entitlementplanfeatures relation/edge. + EntitlementplanfeaturesTable = "entitlement_plan_features" + // EntitlementplanfeaturesInverseTable is the table name for the EntitlementPlanFeature entity. + // It exists in this package in order to avoid circular dependency with the "entitlementplanfeature" package. + EntitlementplanfeaturesInverseTable = "entitlement_plan_features" + // EntitlementplanfeaturesColumn is the table column denoting the entitlementplanfeatures relation/edge. + EntitlementplanfeaturesColumn = "owner_id" + // EntitiesTable is the table that holds the entities relation/edge. + EntitiesTable = "entities" + // EntitiesInverseTable is the table name for the Entity entity. + // It exists in this package in order to avoid circular dependency with the "entity" package. + EntitiesInverseTable = "entities" + // EntitiesColumn is the table column denoting the entities relation/edge. + EntitiesColumn = "owner_id" + // EntitytypesTable is the table that holds the entitytypes relation/edge. + EntitytypesTable = "entity_types" + // EntitytypesInverseTable is the table name for the EntityType entity. + // It exists in this package in order to avoid circular dependency with the "entitytype" package. + EntitytypesInverseTable = "entity_types" + // EntitytypesColumn is the table column denoting the entitytypes relation/edge. + EntitytypesColumn = "owner_id" + // ContactsTable is the table that holds the contacts relation/edge. + ContactsTable = "contacts" + // ContactsInverseTable is the table name for the Contact entity. + // It exists in this package in order to avoid circular dependency with the "contact" package. + ContactsInverseTable = "contacts" + // ContactsColumn is the table column denoting the contacts relation/edge. + ContactsColumn = "owner_id" + // NotesTable is the table that holds the notes relation/edge. + NotesTable = "notes" + // NotesInverseTable is the table name for the Note entity. + // It exists in this package in order to avoid circular dependency with the "note" package. + NotesInverseTable = "notes" + // NotesColumn is the table column denoting the notes relation/edge. + NotesColumn = "owner_id" + // MembersTable is the table that holds the members relation/edge. + MembersTable = "org_memberships" + // MembersInverseTable is the table name for the OrgMembership entity. + // It exists in this package in order to avoid circular dependency with the "orgmembership" package. + MembersInverseTable = "org_memberships" + // MembersColumn is the table column denoting the members relation/edge. + MembersColumn = "organization_id" +) + +// Columns holds all SQL columns for organization fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldName, + FieldDisplayName, + FieldDescription, + FieldParentOrganizationID, + FieldPersonalOrg, + FieldAvatarRemoteURL, + FieldDedicatedDb, +} + +var ( + // PersonalAccessTokensPrimaryKey and PersonalAccessTokensColumn2 are the table columns denoting the + // primary key for the personal_access_tokens relation (M2M). + PersonalAccessTokensPrimaryKey = []string{"organization_id", "personal_access_token_id"} + // UsersPrimaryKey and UsersColumn2 are the table columns denoting the + // primary key for the users relation (M2M). + UsersPrimaryKey = []string{"user_id", "organization_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"organization_id", "event_id"} + // SecretsPrimaryKey and SecretsColumn2 are the table columns denoting the + // primary key for the secrets relation (M2M). + SecretsPrimaryKey = []string{"organization_id", "hush_id"} + // FilesPrimaryKey and FilesColumn2 are the table columns denoting the + // primary key for the files relation (M2M). + FilesPrimaryKey = []string{"organization_id", "file_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultDisplayName holds the default value on creation for the "display_name" field. + DefaultDisplayName string + // DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + DisplayNameValidator func(string) error + // DefaultPersonalOrg holds the default value on creation for the "personal_org" field. + DefaultPersonalOrg bool + // AvatarRemoteURLValidator is a validator for the "avatar_remote_url" field. It is called by the builders before save. + AvatarRemoteURLValidator func(string) error + // DefaultDedicatedDb holds the default value on creation for the "dedicated_db" field. + DefaultDedicatedDb bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Organization queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByParentOrganizationID orders the results by the parent_organization_id field. +func ByParentOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldParentOrganizationID, opts...).ToFunc() +} + +// ByPersonalOrg orders the results by the personal_org field. +func ByPersonalOrg(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPersonalOrg, opts...).ToFunc() +} + +// ByAvatarRemoteURL orders the results by the avatar_remote_url field. +func ByAvatarRemoteURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarRemoteURL, opts...).ToFunc() +} + +// ByDedicatedDb orders the results by the dedicated_db field. +func ByDedicatedDb(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDedicatedDb, opts...).ToFunc() +} + +// ByParentField orders the results by parent field. +func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newParentStep(), sql.OrderByField(field, opts...)) + } +} + +// ByChildrenCount orders the results by children count. +func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newChildrenStep(), opts...) + } +} + +// ByChildren orders the results by children terms. +func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newChildrenStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByGroupsCount orders the results by groups count. +func ByGroupsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newGroupsStep(), opts...) + } +} + +// ByGroups orders the results by groups terms. +func ByGroups(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByTemplatesCount orders the results by templates count. +func ByTemplatesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newTemplatesStep(), opts...) + } +} + +// ByTemplates orders the results by templates terms. +func ByTemplates(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newTemplatesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByIntegrationsCount orders the results by integrations count. +func ByIntegrationsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newIntegrationsStep(), opts...) + } +} + +// ByIntegrations orders the results by integrations terms. +func ByIntegrations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newIntegrationsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// BySettingField orders the results by setting field. +func BySettingField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newSettingStep(), sql.OrderByField(field, opts...)) + } +} + +// ByDocumentdataCount orders the results by documentdata count. +func ByDocumentdataCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newDocumentdataStep(), opts...) + } +} + +// ByDocumentdata orders the results by documentdata terms. +func ByDocumentdata(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newDocumentdataStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitlementsCount orders the results by entitlements count. +func ByEntitlementsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitlementsStep(), opts...) + } +} + +// ByEntitlements orders the results by entitlements terms. +func ByEntitlements(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitlementsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOrganizationEntitlementCount orders the results by organization_entitlement count. +func ByOrganizationEntitlementCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrganizationEntitlementStep(), opts...) + } +} + +// ByOrganizationEntitlement orders the results by organization_entitlement terms. +func ByOrganizationEntitlement(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationEntitlementStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByPersonalAccessTokensCount orders the results by personal_access_tokens count. +func ByPersonalAccessTokensCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newPersonalAccessTokensStep(), opts...) + } +} + +// ByPersonalAccessTokens orders the results by personal_access_tokens terms. +func ByPersonalAccessTokens(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPersonalAccessTokensStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByAPITokensCount orders the results by api_tokens count. +func ByAPITokensCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newAPITokensStep(), opts...) + } +} + +// ByAPITokens orders the results by api_tokens terms. +func ByAPITokens(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newAPITokensStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOauthproviderCount orders the results by oauthprovider count. +func ByOauthproviderCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOauthproviderStep(), opts...) + } +} + +// ByOauthprovider orders the results by oauthprovider terms. +func ByOauthprovider(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOauthproviderStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByUsersCount orders the results by users count. +func ByUsersCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newUsersStep(), opts...) + } +} + +// ByUsers orders the results by users terms. +func ByUsers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newUsersStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByInvitesCount orders the results by invites count. +func ByInvitesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newInvitesStep(), opts...) + } +} + +// ByInvites orders the results by invites terms. +func ByInvites(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newInvitesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// BySubscribersCount orders the results by subscribers count. +func BySubscribersCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newSubscribersStep(), opts...) + } +} + +// BySubscribers orders the results by subscribers terms. +func BySubscribers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newSubscribersStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByWebhooksCount orders the results by webhooks count. +func ByWebhooksCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newWebhooksStep(), opts...) + } +} + +// ByWebhooks orders the results by webhooks terms. +func ByWebhooks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newWebhooksStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// BySecretsCount orders the results by secrets count. +func BySecretsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newSecretsStep(), opts...) + } +} + +// BySecrets orders the results by secrets terms. +func BySecrets(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newSecretsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFeaturesCount orders the results by features count. +func ByFeaturesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFeaturesStep(), opts...) + } +} + +// ByFeatures orders the results by features terms. +func ByFeatures(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFeaturesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFilesCount orders the results by files count. +func ByFilesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFilesStep(), opts...) + } +} + +// ByFiles orders the results by files terms. +func ByFiles(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFilesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitlementplansCount orders the results by entitlementplans count. +func ByEntitlementplansCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitlementplansStep(), opts...) + } +} + +// ByEntitlementplans orders the results by entitlementplans terms. +func ByEntitlementplans(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitlementplansStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitlementplanfeaturesCount orders the results by entitlementplanfeatures count. +func ByEntitlementplanfeaturesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitlementplanfeaturesStep(), opts...) + } +} + +// ByEntitlementplanfeatures orders the results by entitlementplanfeatures terms. +func ByEntitlementplanfeatures(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitlementplanfeaturesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitiesCount orders the results by entities count. +func ByEntitiesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitiesStep(), opts...) + } +} + +// ByEntities orders the results by entities terms. +func ByEntities(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitiesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEntitytypesCount orders the results by entitytypes count. +func ByEntitytypesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEntitytypesStep(), opts...) + } +} + +// ByEntitytypes orders the results by entitytypes terms. +func ByEntitytypes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEntitytypesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByContactsCount orders the results by contacts count. +func ByContactsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newContactsStep(), opts...) + } +} + +// ByContacts orders the results by contacts terms. +func ByContacts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newContactsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByNotesCount orders the results by notes count. +func ByNotesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newNotesStep(), opts...) + } +} + +// ByNotes orders the results by notes terms. +func ByNotes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newNotesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByMembersCount orders the results by members count. +func ByMembersCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newMembersStep(), opts...) + } +} + +// ByMembers orders the results by members terms. +func ByMembers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newMembersStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newParentStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) +} +func newChildrenStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) +} +func newGroupsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, GroupsTable, GroupsColumn), + ) +} +func newTemplatesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(TemplatesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, TemplatesTable, TemplatesColumn), + ) +} +func newIntegrationsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(IntegrationsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, IntegrationsTable, IntegrationsColumn), + ) +} +func newSettingStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(SettingInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, SettingTable, SettingColumn), + ) +} +func newDocumentdataStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(DocumentdataInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, DocumentdataTable, DocumentdataColumn), + ) +} +func newEntitlementsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitlementsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementsTable, EntitlementsColumn), + ) +} +func newOrganizationEntitlementStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationEntitlementInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, OrganizationEntitlementTable, OrganizationEntitlementColumn), + ) +} +func newPersonalAccessTokensStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PersonalAccessTokensInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, PersonalAccessTokensTable, PersonalAccessTokensPrimaryKey...), + ) +} +func newAPITokensStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(APITokensInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, APITokensTable, APITokensColumn), + ) +} +func newOauthproviderStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OauthproviderInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, OauthproviderTable, OauthproviderColumn), + ) +} +func newUsersStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(UsersInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, UsersTable, UsersPrimaryKey...), + ) +} +func newInvitesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(InvitesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, InvitesTable, InvitesColumn), + ) +} +func newSubscribersStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(SubscribersInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, SubscribersTable, SubscribersColumn), + ) +} +func newWebhooksStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(WebhooksInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, WebhooksTable, WebhooksColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} +func newSecretsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(SecretsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, SecretsTable, SecretsPrimaryKey...), + ) +} +func newFeaturesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FeaturesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, FeaturesTable, FeaturesColumn), + ) +} +func newFilesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FilesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, FilesTable, FilesPrimaryKey...), + ) +} +func newEntitlementplansStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitlementplansInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementplansTable, EntitlementplansColumn), + ) +} +func newEntitlementplanfeaturesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitlementplanfeaturesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementplanfeaturesTable, EntitlementplanfeaturesColumn), + ) +} +func newEntitiesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitiesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitiesTable, EntitiesColumn), + ) +} +func newEntitytypesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EntitytypesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitytypesTable, EntitytypesColumn), + ) +} +func newContactsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(ContactsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ContactsTable, ContactsColumn), + ) +} +func newNotesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(NotesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, NotesTable, NotesColumn), + ) +} +func newMembersStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(MembersInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, MembersTable, MembersColumn), + ) +} diff --git a/internal/ent/generated/organization/where.go b/internal/ent/generated/organization/where.go new file mode 100644 index 0000000..38608d4 --- /dev/null +++ b/internal/ent/generated/organization/where.go @@ -0,0 +1,1771 @@ +// Code generated by ent, DO NOT EDIT. + +package organization + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDeletedBy, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDisplayName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDescription, v)) +} + +// ParentOrganizationID applies equality check predicate on the "parent_organization_id" field. It's identical to ParentOrganizationIDEQ. +func ParentOrganizationID(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldParentOrganizationID, v)) +} + +// PersonalOrg applies equality check predicate on the "personal_org" field. It's identical to PersonalOrgEQ. +func PersonalOrg(v bool) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldPersonalOrg, v)) +} + +// AvatarRemoteURL applies equality check predicate on the "avatar_remote_url" field. It's identical to AvatarRemoteURLEQ. +func AvatarRemoteURL(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// DedicatedDb applies equality check predicate on the "dedicated_db" field. It's identical to DedicatedDbEQ. +func DedicatedDb(v bool) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDedicatedDb, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldDescription, v)) +} + +// ParentOrganizationIDEQ applies the EQ predicate on the "parent_organization_id" field. +func ParentOrganizationIDEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDNEQ applies the NEQ predicate on the "parent_organization_id" field. +func ParentOrganizationIDNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDIn applies the In predicate on the "parent_organization_id" field. +func ParentOrganizationIDIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldParentOrganizationID, vs...)) +} + +// ParentOrganizationIDNotIn applies the NotIn predicate on the "parent_organization_id" field. +func ParentOrganizationIDNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldParentOrganizationID, vs...)) +} + +// ParentOrganizationIDGT applies the GT predicate on the "parent_organization_id" field. +func ParentOrganizationIDGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDGTE applies the GTE predicate on the "parent_organization_id" field. +func ParentOrganizationIDGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDLT applies the LT predicate on the "parent_organization_id" field. +func ParentOrganizationIDLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDLTE applies the LTE predicate on the "parent_organization_id" field. +func ParentOrganizationIDLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDContains applies the Contains predicate on the "parent_organization_id" field. +func ParentOrganizationIDContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDHasPrefix applies the HasPrefix predicate on the "parent_organization_id" field. +func ParentOrganizationIDHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDHasSuffix applies the HasSuffix predicate on the "parent_organization_id" field. +func ParentOrganizationIDHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDIsNil applies the IsNil predicate on the "parent_organization_id" field. +func ParentOrganizationIDIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldParentOrganizationID)) +} + +// ParentOrganizationIDNotNil applies the NotNil predicate on the "parent_organization_id" field. +func ParentOrganizationIDNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldParentOrganizationID)) +} + +// ParentOrganizationIDEqualFold applies the EqualFold predicate on the "parent_organization_id" field. +func ParentOrganizationIDEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDContainsFold applies the ContainsFold predicate on the "parent_organization_id" field. +func ParentOrganizationIDContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldParentOrganizationID, v)) +} + +// PersonalOrgEQ applies the EQ predicate on the "personal_org" field. +func PersonalOrgEQ(v bool) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldPersonalOrg, v)) +} + +// PersonalOrgNEQ applies the NEQ predicate on the "personal_org" field. +func PersonalOrgNEQ(v bool) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldPersonalOrg, v)) +} + +// PersonalOrgIsNil applies the IsNil predicate on the "personal_org" field. +func PersonalOrgIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldPersonalOrg)) +} + +// PersonalOrgNotNil applies the NotNil predicate on the "personal_org" field. +func PersonalOrgNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldPersonalOrg)) +} + +// AvatarRemoteURLEQ applies the EQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLNEQ applies the NEQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNEQ(v string) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIn applies the In predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLNotIn applies the NotIn predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotIn(vs ...string) predicate.Organization { + return predicate.Organization(sql.FieldNotIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLGT applies the GT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGT(v string) predicate.Organization { + return predicate.Organization(sql.FieldGT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLGTE applies the GTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldGTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLT applies the LT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLT(v string) predicate.Organization { + return predicate.Organization(sql.FieldLT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLTE applies the LTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLTE(v string) predicate.Organization { + return predicate.Organization(sql.FieldLTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContains applies the Contains predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContains(v string) predicate.Organization { + return predicate.Organization(sql.FieldContains(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasPrefix applies the HasPrefix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasPrefix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasPrefix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasSuffix applies the HasSuffix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasSuffix(v string) predicate.Organization { + return predicate.Organization(sql.FieldHasSuffix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIsNil applies the IsNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIsNil() predicate.Organization { + return predicate.Organization(sql.FieldIsNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLNotNil applies the NotNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotNil() predicate.Organization { + return predicate.Organization(sql.FieldNotNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLEqualFold applies the EqualFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEqualFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldEqualFold(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContainsFold applies the ContainsFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContainsFold(v string) predicate.Organization { + return predicate.Organization(sql.FieldContainsFold(FieldAvatarRemoteURL, v)) +} + +// DedicatedDbEQ applies the EQ predicate on the "dedicated_db" field. +func DedicatedDbEQ(v bool) predicate.Organization { + return predicate.Organization(sql.FieldEQ(FieldDedicatedDb, v)) +} + +// DedicatedDbNEQ applies the NEQ predicate on the "dedicated_db" field. +func DedicatedDbNEQ(v bool) predicate.Organization { + return predicate.Organization(sql.FieldNEQ(FieldDedicatedDb, v)) +} + +// HasParent applies the HasEdge predicate on the "parent" edge. +func HasParent() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates). +func HasParentWith(preds ...predicate.Organization) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newParentStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasChildren applies the HasEdge predicate on the "children" edge. +func HasChildren() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates). +func HasChildrenWith(preds ...predicate.Organization) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newChildrenStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasGroups applies the HasEdge predicate on the "groups" edge. +func HasGroups() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, GroupsTable, GroupsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.Group + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). +func HasGroupsWith(preds ...predicate.Group) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newGroupsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.Group + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasTemplates applies the HasEdge predicate on the "templates" edge. +func HasTemplates() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, TemplatesTable, TemplatesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.Template + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasTemplatesWith applies the HasEdge predicate on the "templates" edge with a given conditions (other predicates). +func HasTemplatesWith(preds ...predicate.Template) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newTemplatesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.Template + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasIntegrations applies the HasEdge predicate on the "integrations" edge. +func HasIntegrations() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, IntegrationsTable, IntegrationsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasIntegrationsWith applies the HasEdge predicate on the "integrations" edge with a given conditions (other predicates). +func HasIntegrationsWith(preds ...predicate.Integration) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newIntegrationsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasSetting applies the HasEdge predicate on the "setting" edge. +func HasSetting() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, SettingTable, SettingColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrganizationSetting + step.Edge.Schema = schemaConfig.OrganizationSetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasSettingWith applies the HasEdge predicate on the "setting" edge with a given conditions (other predicates). +func HasSettingWith(preds ...predicate.OrganizationSetting) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newSettingStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrganizationSetting + step.Edge.Schema = schemaConfig.OrganizationSetting + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasDocumentdata applies the HasEdge predicate on the "documentdata" edge. +func HasDocumentdata() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, DocumentdataTable, DocumentdataColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasDocumentdataWith applies the HasEdge predicate on the "documentdata" edge with a given conditions (other predicates). +func HasDocumentdataWith(preds ...predicate.DocumentData) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newDocumentdataStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitlements applies the HasEdge predicate on the "entitlements" edge. +func HasEntitlements() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementsTable, EntitlementsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitlementsWith applies the HasEdge predicate on the "entitlements" edge with a given conditions (other predicates). +func HasEntitlementsWith(preds ...predicate.Entitlement) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newEntitlementsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrganizationEntitlement applies the HasEdge predicate on the "organization_entitlement" edge. +func HasOrganizationEntitlement() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, OrganizationEntitlementTable, OrganizationEntitlementColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationEntitlementWith applies the HasEdge predicate on the "organization_entitlement" edge with a given conditions (other predicates). +func HasOrganizationEntitlementWith(preds ...predicate.Entitlement) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newOrganizationEntitlementStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasPersonalAccessTokens applies the HasEdge predicate on the "personal_access_tokens" edge. +func HasPersonalAccessTokens() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, PersonalAccessTokensTable, PersonalAccessTokensPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPersonalAccessTokensWith applies the HasEdge predicate on the "personal_access_tokens" edge with a given conditions (other predicates). +func HasPersonalAccessTokensWith(preds ...predicate.PersonalAccessToken) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newPersonalAccessTokensStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasAPITokens applies the HasEdge predicate on the "api_tokens" edge. +func HasAPITokens() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, APITokensTable, APITokensColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.APIToken + step.Edge.Schema = schemaConfig.APIToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasAPITokensWith applies the HasEdge predicate on the "api_tokens" edge with a given conditions (other predicates). +func HasAPITokensWith(preds ...predicate.APIToken) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newAPITokensStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.APIToken + step.Edge.Schema = schemaConfig.APIToken + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOauthprovider applies the HasEdge predicate on the "oauthprovider" edge. +func HasOauthprovider() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, OauthproviderTable, OauthproviderColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OauthProvider + step.Edge.Schema = schemaConfig.OauthProvider + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOauthproviderWith applies the HasEdge predicate on the "oauthprovider" edge with a given conditions (other predicates). +func HasOauthproviderWith(preds ...predicate.OauthProvider) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newOauthproviderStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OauthProvider + step.Edge.Schema = schemaConfig.OauthProvider + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasUsers applies the HasEdge predicate on the "users" edge. +func HasUsers() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, UsersTable, UsersPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates). +func HasUsersWith(preds ...predicate.User) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newUsersStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasInvites applies the HasEdge predicate on the "invites" edge. +func HasInvites() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, InvitesTable, InvitesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.Invite + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasInvitesWith applies the HasEdge predicate on the "invites" edge with a given conditions (other predicates). +func HasInvitesWith(preds ...predicate.Invite) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newInvitesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.Invite + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasSubscribers applies the HasEdge predicate on the "subscribers" edge. +func HasSubscribers() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, SubscribersTable, SubscribersColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.Subscriber + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasSubscribersWith applies the HasEdge predicate on the "subscribers" edge with a given conditions (other predicates). +func HasSubscribersWith(preds ...predicate.Subscriber) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newSubscribersStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.Subscriber + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasWebhooks applies the HasEdge predicate on the "webhooks" edge. +func HasWebhooks() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, WebhooksTable, WebhooksColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.Webhook + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasWebhooksWith applies the HasEdge predicate on the "webhooks" edge with a given conditions (other predicates). +func HasWebhooksWith(preds ...predicate.Webhook) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newWebhooksStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.Webhook + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrganizationEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrganizationEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasSecrets applies the HasEdge predicate on the "secrets" edge. +func HasSecrets() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, SecretsTable, SecretsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.OrganizationSecrets + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasSecretsWith applies the HasEdge predicate on the "secrets" edge with a given conditions (other predicates). +func HasSecretsWith(preds ...predicate.Hush) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newSecretsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.OrganizationSecrets + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFeatures applies the HasEdge predicate on the "features" edge. +func HasFeatures() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, FeaturesTable, FeaturesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.Feature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFeaturesWith applies the HasEdge predicate on the "features" edge with a given conditions (other predicates). +func HasFeaturesWith(preds ...predicate.Feature) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newFeaturesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.Feature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFiles applies the HasEdge predicate on the "files" edge. +func HasFiles() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, FilesTable, FilesPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.OrganizationFiles + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). +func HasFilesWith(preds ...predicate.File) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newFilesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.OrganizationFiles + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitlementplans applies the HasEdge predicate on the "entitlementplans" edge. +func HasEntitlementplans() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementplansTable, EntitlementplansColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlan + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitlementplansWith applies the HasEdge predicate on the "entitlementplans" edge with a given conditions (other predicates). +func HasEntitlementplansWith(preds ...predicate.EntitlementPlan) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newEntitlementplansStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlan + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitlementplanfeatures applies the HasEdge predicate on the "entitlementplanfeatures" edge. +func HasEntitlementplanfeatures() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitlementplanfeaturesTable, EntitlementplanfeaturesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitlementplanfeaturesWith applies the HasEdge predicate on the "entitlementplanfeatures" edge with a given conditions (other predicates). +func HasEntitlementplanfeaturesWith(preds ...predicate.EntitlementPlanFeature) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newEntitlementplanfeaturesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntities applies the HasEdge predicate on the "entities" edge. +func HasEntities() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitiesTable, EntitiesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitiesWith applies the HasEdge predicate on the "entities" edge with a given conditions (other predicates). +func HasEntitiesWith(preds ...predicate.Entity) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newEntitiesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEntitytypes applies the HasEdge predicate on the "entitytypes" edge. +func HasEntitytypes() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EntitytypesTable, EntitytypesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.EntityType + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEntitytypesWith applies the HasEdge predicate on the "entitytypes" edge with a given conditions (other predicates). +func HasEntitytypesWith(preds ...predicate.EntityType) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newEntitytypesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.EntityType + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasContacts applies the HasEdge predicate on the "contacts" edge. +func HasContacts() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, ContactsTable, ContactsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.Contact + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasContactsWith applies the HasEdge predicate on the "contacts" edge with a given conditions (other predicates). +func HasContactsWith(preds ...predicate.Contact) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newContactsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.Contact + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasNotes applies the HasEdge predicate on the "notes" edge. +func HasNotes() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, NotesTable, NotesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasNotesWith applies the HasEdge predicate on the "notes" edge with a given conditions (other predicates). +func HasNotesWith(preds ...predicate.Note) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newNotesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasMembers applies the HasEdge predicate on the "members" edge. +func HasMembers() predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, MembersTable, MembersColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasMembersWith applies the HasEdge predicate on the "members" edge with a given conditions (other predicates). +func HasMembersWith(preds ...predicate.OrgMembership) predicate.Organization { + return predicate.Organization(func(s *sql.Selector) { + step := newMembersStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + 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.Organization) predicate.Organization { + return predicate.Organization(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Organization) predicate.Organization { + return predicate.Organization(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Organization) predicate.Organization { + return predicate.Organization(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/organization_create.go b/internal/ent/generated/organization_create.go new file mode 100644 index 0000000..9ca2909 --- /dev/null +++ b/internal/ent/generated/organization_create.go @@ -0,0 +1,1425 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webhook" +) + +// OrganizationCreate is the builder for creating a Organization entity. +type OrganizationCreate struct { + config + mutation *OrganizationMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (oc *OrganizationCreate) SetCreatedAt(t time.Time) *OrganizationCreate { + oc.mutation.SetCreatedAt(t) + return oc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableCreatedAt(t *time.Time) *OrganizationCreate { + if t != nil { + oc.SetCreatedAt(*t) + } + return oc +} + +// SetUpdatedAt sets the "updated_at" field. +func (oc *OrganizationCreate) SetUpdatedAt(t time.Time) *OrganizationCreate { + oc.mutation.SetUpdatedAt(t) + return oc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableUpdatedAt(t *time.Time) *OrganizationCreate { + if t != nil { + oc.SetUpdatedAt(*t) + } + return oc +} + +// SetCreatedBy sets the "created_by" field. +func (oc *OrganizationCreate) SetCreatedBy(s string) *OrganizationCreate { + oc.mutation.SetCreatedBy(s) + return oc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableCreatedBy(s *string) *OrganizationCreate { + if s != nil { + oc.SetCreatedBy(*s) + } + return oc +} + +// SetUpdatedBy sets the "updated_by" field. +func (oc *OrganizationCreate) SetUpdatedBy(s string) *OrganizationCreate { + oc.mutation.SetUpdatedBy(s) + return oc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableUpdatedBy(s *string) *OrganizationCreate { + if s != nil { + oc.SetUpdatedBy(*s) + } + return oc +} + +// SetMappingID sets the "mapping_id" field. +func (oc *OrganizationCreate) SetMappingID(s string) *OrganizationCreate { + oc.mutation.SetMappingID(s) + return oc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableMappingID(s *string) *OrganizationCreate { + if s != nil { + oc.SetMappingID(*s) + } + return oc +} + +// SetTags sets the "tags" field. +func (oc *OrganizationCreate) SetTags(s []string) *OrganizationCreate { + oc.mutation.SetTags(s) + return oc +} + +// SetDeletedAt sets the "deleted_at" field. +func (oc *OrganizationCreate) SetDeletedAt(t time.Time) *OrganizationCreate { + oc.mutation.SetDeletedAt(t) + return oc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableDeletedAt(t *time.Time) *OrganizationCreate { + if t != nil { + oc.SetDeletedAt(*t) + } + return oc +} + +// SetDeletedBy sets the "deleted_by" field. +func (oc *OrganizationCreate) SetDeletedBy(s string) *OrganizationCreate { + oc.mutation.SetDeletedBy(s) + return oc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableDeletedBy(s *string) *OrganizationCreate { + if s != nil { + oc.SetDeletedBy(*s) + } + return oc +} + +// SetName sets the "name" field. +func (oc *OrganizationCreate) SetName(s string) *OrganizationCreate { + oc.mutation.SetName(s) + return oc +} + +// SetDisplayName sets the "display_name" field. +func (oc *OrganizationCreate) SetDisplayName(s string) *OrganizationCreate { + oc.mutation.SetDisplayName(s) + return oc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableDisplayName(s *string) *OrganizationCreate { + if s != nil { + oc.SetDisplayName(*s) + } + return oc +} + +// SetDescription sets the "description" field. +func (oc *OrganizationCreate) SetDescription(s string) *OrganizationCreate { + oc.mutation.SetDescription(s) + return oc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableDescription(s *string) *OrganizationCreate { + if s != nil { + oc.SetDescription(*s) + } + return oc +} + +// SetParentOrganizationID sets the "parent_organization_id" field. +func (oc *OrganizationCreate) SetParentOrganizationID(s string) *OrganizationCreate { + oc.mutation.SetParentOrganizationID(s) + return oc +} + +// SetNillableParentOrganizationID sets the "parent_organization_id" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableParentOrganizationID(s *string) *OrganizationCreate { + if s != nil { + oc.SetParentOrganizationID(*s) + } + return oc +} + +// SetPersonalOrg sets the "personal_org" field. +func (oc *OrganizationCreate) SetPersonalOrg(b bool) *OrganizationCreate { + oc.mutation.SetPersonalOrg(b) + return oc +} + +// SetNillablePersonalOrg sets the "personal_org" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillablePersonalOrg(b *bool) *OrganizationCreate { + if b != nil { + oc.SetPersonalOrg(*b) + } + return oc +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (oc *OrganizationCreate) SetAvatarRemoteURL(s string) *OrganizationCreate { + oc.mutation.SetAvatarRemoteURL(s) + return oc +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableAvatarRemoteURL(s *string) *OrganizationCreate { + if s != nil { + oc.SetAvatarRemoteURL(*s) + } + return oc +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (oc *OrganizationCreate) SetDedicatedDb(b bool) *OrganizationCreate { + oc.mutation.SetDedicatedDb(b) + return oc +} + +// SetNillableDedicatedDb sets the "dedicated_db" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableDedicatedDb(b *bool) *OrganizationCreate { + if b != nil { + oc.SetDedicatedDb(*b) + } + return oc +} + +// SetID sets the "id" field. +func (oc *OrganizationCreate) SetID(s string) *OrganizationCreate { + oc.mutation.SetID(s) + return oc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (oc *OrganizationCreate) SetNillableID(s *string) *OrganizationCreate { + if s != nil { + oc.SetID(*s) + } + return oc +} + +// SetParentID sets the "parent" edge to the Organization entity by ID. +func (oc *OrganizationCreate) SetParentID(id string) *OrganizationCreate { + oc.mutation.SetParentID(id) + return oc +} + +// SetNillableParentID sets the "parent" edge to the Organization entity by ID if the given value is not nil. +func (oc *OrganizationCreate) SetNillableParentID(id *string) *OrganizationCreate { + if id != nil { + oc = oc.SetParentID(*id) + } + return oc +} + +// SetParent sets the "parent" edge to the Organization entity. +func (oc *OrganizationCreate) SetParent(o *Organization) *OrganizationCreate { + return oc.SetParentID(o.ID) +} + +// AddChildIDs adds the "children" edge to the Organization entity by IDs. +func (oc *OrganizationCreate) AddChildIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddChildIDs(ids...) + return oc +} + +// AddChildren adds the "children" edges to the Organization entity. +func (oc *OrganizationCreate) AddChildren(o ...*Organization) *OrganizationCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return oc.AddChildIDs(ids...) +} + +// AddGroupIDs adds the "groups" edge to the Group entity by IDs. +func (oc *OrganizationCreate) AddGroupIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddGroupIDs(ids...) + return oc +} + +// AddGroups adds the "groups" edges to the Group entity. +func (oc *OrganizationCreate) AddGroups(g ...*Group) *OrganizationCreate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return oc.AddGroupIDs(ids...) +} + +// AddTemplateIDs adds the "templates" edge to the Template entity by IDs. +func (oc *OrganizationCreate) AddTemplateIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddTemplateIDs(ids...) + return oc +} + +// AddTemplates adds the "templates" edges to the Template entity. +func (oc *OrganizationCreate) AddTemplates(t ...*Template) *OrganizationCreate { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return oc.AddTemplateIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (oc *OrganizationCreate) AddIntegrationIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddIntegrationIDs(ids...) + return oc +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (oc *OrganizationCreate) AddIntegrations(i ...*Integration) *OrganizationCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return oc.AddIntegrationIDs(ids...) +} + +// SetSettingID sets the "setting" edge to the OrganizationSetting entity by ID. +func (oc *OrganizationCreate) SetSettingID(id string) *OrganizationCreate { + oc.mutation.SetSettingID(id) + return oc +} + +// SetNillableSettingID sets the "setting" edge to the OrganizationSetting entity by ID if the given value is not nil. +func (oc *OrganizationCreate) SetNillableSettingID(id *string) *OrganizationCreate { + if id != nil { + oc = oc.SetSettingID(*id) + } + return oc +} + +// SetSetting sets the "setting" edge to the OrganizationSetting entity. +func (oc *OrganizationCreate) SetSetting(o *OrganizationSetting) *OrganizationCreate { + return oc.SetSettingID(o.ID) +} + +// AddDocumentdatumIDs adds the "documentdata" edge to the DocumentData entity by IDs. +func (oc *OrganizationCreate) AddDocumentdatumIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddDocumentdatumIDs(ids...) + return oc +} + +// AddDocumentdata adds the "documentdata" edges to the DocumentData entity. +func (oc *OrganizationCreate) AddDocumentdata(d ...*DocumentData) *OrganizationCreate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return oc.AddDocumentdatumIDs(ids...) +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by IDs. +func (oc *OrganizationCreate) AddEntitlementIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddEntitlementIDs(ids...) + return oc +} + +// AddEntitlements adds the "entitlements" edges to the Entitlement entity. +func (oc *OrganizationCreate) AddEntitlements(e ...*Entitlement) *OrganizationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oc.AddEntitlementIDs(ids...) +} + +// AddOrganizationEntitlementIDs adds the "organization_entitlement" edge to the Entitlement entity by IDs. +func (oc *OrganizationCreate) AddOrganizationEntitlementIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddOrganizationEntitlementIDs(ids...) + return oc +} + +// AddOrganizationEntitlement adds the "organization_entitlement" edges to the Entitlement entity. +func (oc *OrganizationCreate) AddOrganizationEntitlement(e ...*Entitlement) *OrganizationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oc.AddOrganizationEntitlementIDs(ids...) +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (oc *OrganizationCreate) AddPersonalAccessTokenIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddPersonalAccessTokenIDs(ids...) + return oc +} + +// AddPersonalAccessTokens adds the "personal_access_tokens" edges to the PersonalAccessToken entity. +func (oc *OrganizationCreate) AddPersonalAccessTokens(p ...*PersonalAccessToken) *OrganizationCreate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return oc.AddPersonalAccessTokenIDs(ids...) +} + +// AddAPITokenIDs adds the "api_tokens" edge to the APIToken entity by IDs. +func (oc *OrganizationCreate) AddAPITokenIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddAPITokenIDs(ids...) + return oc +} + +// AddAPITokens adds the "api_tokens" edges to the APIToken entity. +func (oc *OrganizationCreate) AddAPITokens(a ...*APIToken) *OrganizationCreate { + ids := make([]string, len(a)) + for i := range a { + ids[i] = a[i].ID + } + return oc.AddAPITokenIDs(ids...) +} + +// AddOauthproviderIDs adds the "oauthprovider" edge to the OauthProvider entity by IDs. +func (oc *OrganizationCreate) AddOauthproviderIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddOauthproviderIDs(ids...) + return oc +} + +// AddOauthprovider adds the "oauthprovider" edges to the OauthProvider entity. +func (oc *OrganizationCreate) AddOauthprovider(o ...*OauthProvider) *OrganizationCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return oc.AddOauthproviderIDs(ids...) +} + +// AddUserIDs adds the "users" edge to the User entity by IDs. +func (oc *OrganizationCreate) AddUserIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddUserIDs(ids...) + return oc +} + +// AddUsers adds the "users" edges to the User entity. +func (oc *OrganizationCreate) AddUsers(u ...*User) *OrganizationCreate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return oc.AddUserIDs(ids...) +} + +// AddInviteIDs adds the "invites" edge to the Invite entity by IDs. +func (oc *OrganizationCreate) AddInviteIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddInviteIDs(ids...) + return oc +} + +// AddInvites adds the "invites" edges to the Invite entity. +func (oc *OrganizationCreate) AddInvites(i ...*Invite) *OrganizationCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return oc.AddInviteIDs(ids...) +} + +// AddSubscriberIDs adds the "subscribers" edge to the Subscriber entity by IDs. +func (oc *OrganizationCreate) AddSubscriberIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddSubscriberIDs(ids...) + return oc +} + +// AddSubscribers adds the "subscribers" edges to the Subscriber entity. +func (oc *OrganizationCreate) AddSubscribers(s ...*Subscriber) *OrganizationCreate { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return oc.AddSubscriberIDs(ids...) +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by IDs. +func (oc *OrganizationCreate) AddWebhookIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddWebhookIDs(ids...) + return oc +} + +// AddWebhooks adds the "webhooks" edges to the Webhook entity. +func (oc *OrganizationCreate) AddWebhooks(w ...*Webhook) *OrganizationCreate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return oc.AddWebhookIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (oc *OrganizationCreate) AddEventIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddEventIDs(ids...) + return oc +} + +// AddEvents adds the "events" edges to the Event entity. +func (oc *OrganizationCreate) AddEvents(e ...*Event) *OrganizationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oc.AddEventIDs(ids...) +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by IDs. +func (oc *OrganizationCreate) AddSecretIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddSecretIDs(ids...) + return oc +} + +// AddSecrets adds the "secrets" edges to the Hush entity. +func (oc *OrganizationCreate) AddSecrets(h ...*Hush) *OrganizationCreate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return oc.AddSecretIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the Feature entity by IDs. +func (oc *OrganizationCreate) AddFeatureIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddFeatureIDs(ids...) + return oc +} + +// AddFeatures adds the "features" edges to the Feature entity. +func (oc *OrganizationCreate) AddFeatures(f ...*Feature) *OrganizationCreate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return oc.AddFeatureIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (oc *OrganizationCreate) AddFileIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddFileIDs(ids...) + return oc +} + +// AddFiles adds the "files" edges to the File entity. +func (oc *OrganizationCreate) AddFiles(f ...*File) *OrganizationCreate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return oc.AddFileIDs(ids...) +} + +// AddEntitlementplanIDs adds the "entitlementplans" edge to the EntitlementPlan entity by IDs. +func (oc *OrganizationCreate) AddEntitlementplanIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddEntitlementplanIDs(ids...) + return oc +} + +// AddEntitlementplans adds the "entitlementplans" edges to the EntitlementPlan entity. +func (oc *OrganizationCreate) AddEntitlementplans(e ...*EntitlementPlan) *OrganizationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oc.AddEntitlementplanIDs(ids...) +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity by IDs. +func (oc *OrganizationCreate) AddEntitlementplanfeatureIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddEntitlementplanfeatureIDs(ids...) + return oc +} + +// AddEntitlementplanfeatures adds the "entitlementplanfeatures" edges to the EntitlementPlanFeature entity. +func (oc *OrganizationCreate) AddEntitlementplanfeatures(e ...*EntitlementPlanFeature) *OrganizationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oc.AddEntitlementplanfeatureIDs(ids...) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (oc *OrganizationCreate) AddEntityIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddEntityIDs(ids...) + return oc +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (oc *OrganizationCreate) AddEntities(e ...*Entity) *OrganizationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oc.AddEntityIDs(ids...) +} + +// AddEntitytypeIDs adds the "entitytypes" edge to the EntityType entity by IDs. +func (oc *OrganizationCreate) AddEntitytypeIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddEntitytypeIDs(ids...) + return oc +} + +// AddEntitytypes adds the "entitytypes" edges to the EntityType entity. +func (oc *OrganizationCreate) AddEntitytypes(e ...*EntityType) *OrganizationCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return oc.AddEntitytypeIDs(ids...) +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by IDs. +func (oc *OrganizationCreate) AddContactIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddContactIDs(ids...) + return oc +} + +// AddContacts adds the "contacts" edges to the Contact entity. +func (oc *OrganizationCreate) AddContacts(c ...*Contact) *OrganizationCreate { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return oc.AddContactIDs(ids...) +} + +// AddNoteIDs adds the "notes" edge to the Note entity by IDs. +func (oc *OrganizationCreate) AddNoteIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddNoteIDs(ids...) + return oc +} + +// AddNotes adds the "notes" edges to the Note entity. +func (oc *OrganizationCreate) AddNotes(n ...*Note) *OrganizationCreate { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return oc.AddNoteIDs(ids...) +} + +// AddMemberIDs adds the "members" edge to the OrgMembership entity by IDs. +func (oc *OrganizationCreate) AddMemberIDs(ids ...string) *OrganizationCreate { + oc.mutation.AddMemberIDs(ids...) + return oc +} + +// AddMembers adds the "members" edges to the OrgMembership entity. +func (oc *OrganizationCreate) AddMembers(o ...*OrgMembership) *OrganizationCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return oc.AddMemberIDs(ids...) +} + +// Mutation returns the OrganizationMutation object of the builder. +func (oc *OrganizationCreate) Mutation() *OrganizationMutation { + return oc.mutation +} + +// Save creates the Organization in the database. +func (oc *OrganizationCreate) Save(ctx context.Context) (*Organization, error) { + if err := oc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, oc.sqlSave, oc.mutation, oc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (oc *OrganizationCreate) SaveX(ctx context.Context) *Organization { + v, err := oc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (oc *OrganizationCreate) Exec(ctx context.Context) error { + _, err := oc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oc *OrganizationCreate) ExecX(ctx context.Context) { + if err := oc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (oc *OrganizationCreate) defaults() error { + if _, ok := oc.mutation.CreatedAt(); !ok { + if organization.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized organization.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := organization.DefaultCreatedAt() + oc.mutation.SetCreatedAt(v) + } + if _, ok := oc.mutation.UpdatedAt(); !ok { + if organization.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organization.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organization.DefaultUpdatedAt() + oc.mutation.SetUpdatedAt(v) + } + if _, ok := oc.mutation.MappingID(); !ok { + if organization.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized organization.DefaultMappingID (forgotten import generated/runtime?)") + } + v := organization.DefaultMappingID() + oc.mutation.SetMappingID(v) + } + if _, ok := oc.mutation.Tags(); !ok { + v := organization.DefaultTags + oc.mutation.SetTags(v) + } + if _, ok := oc.mutation.DisplayName(); !ok { + v := organization.DefaultDisplayName + oc.mutation.SetDisplayName(v) + } + if _, ok := oc.mutation.PersonalOrg(); !ok { + v := organization.DefaultPersonalOrg + oc.mutation.SetPersonalOrg(v) + } + if _, ok := oc.mutation.DedicatedDb(); !ok { + v := organization.DefaultDedicatedDb + oc.mutation.SetDedicatedDb(v) + } + if _, ok := oc.mutation.ID(); !ok { + if organization.DefaultID == nil { + return fmt.Errorf("generated: uninitialized organization.DefaultID (forgotten import generated/runtime?)") + } + v := organization.DefaultID() + oc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (oc *OrganizationCreate) check() error { + if _, ok := oc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Organization.mapping_id"`)} + } + if _, ok := oc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "Organization.name"`)} + } + if v, ok := oc.mutation.Name(); ok { + if err := organization.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Organization.name": %w`, err)} + } + } + if _, ok := oc.mutation.DisplayName(); !ok { + return &ValidationError{Name: "display_name", err: errors.New(`generated: missing required field "Organization.display_name"`)} + } + if v, ok := oc.mutation.DisplayName(); ok { + if err := organization.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Organization.display_name": %w`, err)} + } + } + if v, ok := oc.mutation.AvatarRemoteURL(); ok { + if err := organization.AvatarRemoteURLValidator(v); err != nil { + return &ValidationError{Name: "avatar_remote_url", err: fmt.Errorf(`generated: validator failed for field "Organization.avatar_remote_url": %w`, err)} + } + } + if _, ok := oc.mutation.DedicatedDb(); !ok { + return &ValidationError{Name: "dedicated_db", err: errors.New(`generated: missing required field "Organization.dedicated_db"`)} + } + return nil +} + +func (oc *OrganizationCreate) sqlSave(ctx context.Context) (*Organization, error) { + if err := oc.check(); err != nil { + return nil, err + } + _node, _spec := oc.createSpec() + if err := sqlgraph.CreateNode(ctx, oc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Organization.ID type: %T", _spec.ID.Value) + } + } + oc.mutation.id = &_node.ID + oc.mutation.done = true + return _node, nil +} + +func (oc *OrganizationCreate) createSpec() (*Organization, *sqlgraph.CreateSpec) { + var ( + _node = &Organization{config: oc.config} + _spec = sqlgraph.NewCreateSpec(organization.Table, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString)) + ) + _spec.Schema = oc.schemaConfig.Organization + if id, ok := oc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := oc.mutation.CreatedAt(); ok { + _spec.SetField(organization.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := oc.mutation.UpdatedAt(); ok { + _spec.SetField(organization.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := oc.mutation.CreatedBy(); ok { + _spec.SetField(organization.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := oc.mutation.UpdatedBy(); ok { + _spec.SetField(organization.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := oc.mutation.MappingID(); ok { + _spec.SetField(organization.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := oc.mutation.Tags(); ok { + _spec.SetField(organization.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := oc.mutation.DeletedAt(); ok { + _spec.SetField(organization.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := oc.mutation.DeletedBy(); ok { + _spec.SetField(organization.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := oc.mutation.Name(); ok { + _spec.SetField(organization.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := oc.mutation.DisplayName(); ok { + _spec.SetField(organization.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := oc.mutation.Description(); ok { + _spec.SetField(organization.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := oc.mutation.PersonalOrg(); ok { + _spec.SetField(organization.FieldPersonalOrg, field.TypeBool, value) + _node.PersonalOrg = value + } + if value, ok := oc.mutation.AvatarRemoteURL(); ok { + _spec.SetField(organization.FieldAvatarRemoteURL, field.TypeString, value) + _node.AvatarRemoteURL = &value + } + if value, ok := oc.mutation.DedicatedDb(); ok { + _spec.SetField(organization.FieldDedicatedDb, field.TypeBool, value) + _node.DedicatedDb = value + } + if nodes := oc.mutation.ParentIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: organization.ParentTable, + Columns: []string{organization.ParentColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Organization + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.ParentOrganizationID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Organization + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.GroupsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.TemplatesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: organization.SettingTable, + Columns: []string{organization.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OrganizationSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.DocumentdataIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.EntitlementsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.OrganizationEntitlementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.PersonalAccessTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.APITokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.OauthproviderIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.UsersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: oc.config, mutation: newOrgMembershipMutation(oc.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.InvitesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.SubscribersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.WebhooksIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.SecretsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.EntitlementplansIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.EntitlementplanfeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.EntitytypesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.ContactsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.NotesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := oc.mutation.MembersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = oc.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OrganizationCreateBulk is the builder for creating many Organization entities in bulk. +type OrganizationCreateBulk struct { + config + err error + builders []*OrganizationCreate +} + +// Save creates the Organization entities in the database. +func (ocb *OrganizationCreateBulk) Save(ctx context.Context) ([]*Organization, error) { + if ocb.err != nil { + return nil, ocb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ocb.builders)) + nodes := make([]*Organization, len(ocb.builders)) + mutators := make([]Mutator, len(ocb.builders)) + for i := range ocb.builders { + func(i int, root context.Context) { + builder := ocb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OrganizationMutation) + 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, ocb.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, ocb.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, ocb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ocb *OrganizationCreateBulk) SaveX(ctx context.Context) []*Organization { + v, err := ocb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ocb *OrganizationCreateBulk) Exec(ctx context.Context) error { + _, err := ocb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ocb *OrganizationCreateBulk) ExecX(ctx context.Context) { + if err := ocb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organization_delete.go b/internal/ent/generated/organization_delete.go new file mode 100644 index 0000000..bf8efe1 --- /dev/null +++ b/internal/ent/generated/organization_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/organization" +) + +// OrganizationDelete is the builder for deleting a Organization entity. +type OrganizationDelete struct { + config + hooks []Hook + mutation *OrganizationMutation +} + +// Where appends a list predicates to the OrganizationDelete builder. +func (od *OrganizationDelete) Where(ps ...predicate.Organization) *OrganizationDelete { + od.mutation.Where(ps...) + return od +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (od *OrganizationDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, od.sqlExec, od.mutation, od.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (od *OrganizationDelete) ExecX(ctx context.Context) int { + n, err := od.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (od *OrganizationDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(organization.Table, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString)) + _spec.Node.Schema = od.schemaConfig.Organization + ctx = internal.NewSchemaConfigContext(ctx, od.schemaConfig) + if ps := od.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, od.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + od.mutation.done = true + return affected, err +} + +// OrganizationDeleteOne is the builder for deleting a single Organization entity. +type OrganizationDeleteOne struct { + od *OrganizationDelete +} + +// Where appends a list predicates to the OrganizationDelete builder. +func (odo *OrganizationDeleteOne) Where(ps ...predicate.Organization) *OrganizationDeleteOne { + odo.od.mutation.Where(ps...) + return odo +} + +// Exec executes the deletion query. +func (odo *OrganizationDeleteOne) Exec(ctx context.Context) error { + n, err := odo.od.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{organization.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (odo *OrganizationDeleteOne) ExecX(ctx context.Context) { + if err := odo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organization_query.go b/internal/ent/generated/organization_query.go new file mode 100644 index 0000000..8381f4b --- /dev/null +++ b/internal/ent/generated/organization_query.go @@ -0,0 +1,3355 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationQuery is the builder for querying Organization entities. +type OrganizationQuery struct { + config + ctx *QueryContext + order []organization.OrderOption + inters []Interceptor + predicates []predicate.Organization + withParent *OrganizationQuery + withChildren *OrganizationQuery + withGroups *GroupQuery + withTemplates *TemplateQuery + withIntegrations *IntegrationQuery + withSetting *OrganizationSettingQuery + withDocumentdata *DocumentDataQuery + withEntitlements *EntitlementQuery + withOrganizationEntitlement *EntitlementQuery + withPersonalAccessTokens *PersonalAccessTokenQuery + withAPITokens *APITokenQuery + withOauthprovider *OauthProviderQuery + withUsers *UserQuery + withInvites *InviteQuery + withSubscribers *SubscriberQuery + withWebhooks *WebhookQuery + withEvents *EventQuery + withSecrets *HushQuery + withFeatures *FeatureQuery + withFiles *FileQuery + withEntitlementplans *EntitlementPlanQuery + withEntitlementplanfeatures *EntitlementPlanFeatureQuery + withEntities *EntityQuery + withEntitytypes *EntityTypeQuery + withContacts *ContactQuery + withNotes *NoteQuery + withMembers *OrgMembershipQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Organization) error + withNamedChildren map[string]*OrganizationQuery + withNamedGroups map[string]*GroupQuery + withNamedTemplates map[string]*TemplateQuery + withNamedIntegrations map[string]*IntegrationQuery + withNamedDocumentdata map[string]*DocumentDataQuery + withNamedEntitlements map[string]*EntitlementQuery + withNamedOrganizationEntitlement map[string]*EntitlementQuery + withNamedPersonalAccessTokens map[string]*PersonalAccessTokenQuery + withNamedAPITokens map[string]*APITokenQuery + withNamedOauthprovider map[string]*OauthProviderQuery + withNamedUsers map[string]*UserQuery + withNamedInvites map[string]*InviteQuery + withNamedSubscribers map[string]*SubscriberQuery + withNamedWebhooks map[string]*WebhookQuery + withNamedEvents map[string]*EventQuery + withNamedSecrets map[string]*HushQuery + withNamedFeatures map[string]*FeatureQuery + withNamedFiles map[string]*FileQuery + withNamedEntitlementplans map[string]*EntitlementPlanQuery + withNamedEntitlementplanfeatures map[string]*EntitlementPlanFeatureQuery + withNamedEntities map[string]*EntityQuery + withNamedEntitytypes map[string]*EntityTypeQuery + withNamedContacts map[string]*ContactQuery + withNamedNotes map[string]*NoteQuery + withNamedMembers map[string]*OrgMembershipQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OrganizationQuery builder. +func (oq *OrganizationQuery) Where(ps ...predicate.Organization) *OrganizationQuery { + oq.predicates = append(oq.predicates, ps...) + return oq +} + +// Limit the number of records to be returned by this query. +func (oq *OrganizationQuery) Limit(limit int) *OrganizationQuery { + oq.ctx.Limit = &limit + return oq +} + +// Offset to start from. +func (oq *OrganizationQuery) Offset(offset int) *OrganizationQuery { + oq.ctx.Offset = &offset + return oq +} + +// 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 (oq *OrganizationQuery) Unique(unique bool) *OrganizationQuery { + oq.ctx.Unique = &unique + return oq +} + +// Order specifies how the records should be ordered. +func (oq *OrganizationQuery) Order(o ...organization.OrderOption) *OrganizationQuery { + oq.order = append(oq.order, o...) + return oq +} + +// QueryParent chains the current query on the "parent" edge. +func (oq *OrganizationQuery) QueryParent() *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, organization.ParentTable, organization.ParentColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryChildren chains the current query on the "children" edge. +func (oq *OrganizationQuery) QueryChildren() *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.ChildrenTable, organization.ChildrenColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Organization + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryGroups chains the current query on the "groups" edge. +func (oq *OrganizationQuery) QueryGroups() *GroupQuery { + query := (&GroupClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.GroupsTable, organization.GroupsColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.Group + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryTemplates chains the current query on the "templates" edge. +func (oq *OrganizationQuery) QueryTemplates() *TemplateQuery { + query := (&TemplateClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(template.Table, template.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.TemplatesTable, organization.TemplatesColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Template + step.Edge.Schema = schemaConfig.Template + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryIntegrations chains the current query on the "integrations" edge. +func (oq *OrganizationQuery) QueryIntegrations() *IntegrationQuery { + query := (&IntegrationClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.IntegrationsTable, organization.IntegrationsColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.Integration + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QuerySetting chains the current query on the "setting" edge. +func (oq *OrganizationQuery) QuerySetting() *OrganizationSettingQuery { + query := (&OrganizationSettingClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(organizationsetting.Table, organizationsetting.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, organization.SettingTable, organization.SettingColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.OrganizationSetting + step.Edge.Schema = schemaConfig.OrganizationSetting + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryDocumentdata chains the current query on the "documentdata" edge. +func (oq *OrganizationQuery) QueryDocumentdata() *DocumentDataQuery { + query := (&DocumentDataClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(documentdata.Table, documentdata.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.DocumentdataTable, organization.DocumentdataColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitlements chains the current query on the "entitlements" edge. +func (oq *OrganizationQuery) QueryEntitlements() *EntitlementQuery { + query := (&EntitlementClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitlementsTable, organization.EntitlementsColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrganizationEntitlement chains the current query on the "organization_entitlement" edge. +func (oq *OrganizationQuery) QueryOrganizationEntitlement() *EntitlementQuery { + query := (&EntitlementClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(entitlement.Table, entitlement.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.OrganizationEntitlementTable, organization.OrganizationEntitlementColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Entitlement + step.Edge.Schema = schemaConfig.Entitlement + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryPersonalAccessTokens chains the current query on the "personal_access_tokens" edge. +func (oq *OrganizationQuery) QueryPersonalAccessTokens() *PersonalAccessTokenQuery { + query := (&PersonalAccessTokenClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(personalaccesstoken.Table, personalaccesstoken.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.PersonalAccessTokensTable, organization.PersonalAccessTokensPrimaryKey...), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryAPITokens chains the current query on the "api_tokens" edge. +func (oq *OrganizationQuery) QueryAPITokens() *APITokenQuery { + query := (&APITokenClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(apitoken.Table, apitoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.APITokensTable, organization.APITokensColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.APIToken + step.Edge.Schema = schemaConfig.APIToken + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOauthprovider chains the current query on the "oauthprovider" edge. +func (oq *OrganizationQuery) QueryOauthprovider() *OauthProviderQuery { + query := (&OauthProviderClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(oauthprovider.Table, oauthprovider.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.OauthproviderTable, organization.OauthproviderColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.OauthProvider + step.Edge.Schema = schemaConfig.OauthProvider + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryUsers chains the current query on the "users" edge. +func (oq *OrganizationQuery) QueryUsers() *UserQuery { + query := (&UserClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, organization.UsersTable, organization.UsersPrimaryKey...), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryInvites chains the current query on the "invites" edge. +func (oq *OrganizationQuery) QueryInvites() *InviteQuery { + query := (&InviteClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(invite.Table, invite.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.InvitesTable, organization.InvitesColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Invite + step.Edge.Schema = schemaConfig.Invite + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QuerySubscribers chains the current query on the "subscribers" edge. +func (oq *OrganizationQuery) QuerySubscribers() *SubscriberQuery { + query := (&SubscriberClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(subscriber.Table, subscriber.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.SubscribersTable, organization.SubscribersColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Subscriber + step.Edge.Schema = schemaConfig.Subscriber + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryWebhooks chains the current query on the "webhooks" edge. +func (oq *OrganizationQuery) QueryWebhooks() *WebhookQuery { + query := (&WebhookClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(webhook.Table, webhook.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.WebhooksTable, organization.WebhooksColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Webhook + step.Edge.Schema = schemaConfig.Webhook + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (oq *OrganizationQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.EventsTable, organization.EventsPrimaryKey...), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrganizationEvents + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QuerySecrets chains the current query on the "secrets" edge. +func (oq *OrganizationQuery) QuerySecrets() *HushQuery { + query := (&HushClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(hush.Table, hush.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.SecretsTable, organization.SecretsPrimaryKey...), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Hush + step.Edge.Schema = schemaConfig.OrganizationSecrets + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFeatures chains the current query on the "features" edge. +func (oq *OrganizationQuery) QueryFeatures() *FeatureQuery { + query := (&FeatureClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(feature.Table, feature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.FeaturesTable, organization.FeaturesColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Feature + step.Edge.Schema = schemaConfig.Feature + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFiles chains the current query on the "files" edge. +func (oq *OrganizationQuery) QueryFiles() *FileQuery { + query := (&FileClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, organization.FilesTable, organization.FilesPrimaryKey...), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.OrganizationFiles + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitlementplans chains the current query on the "entitlementplans" edge. +func (oq *OrganizationQuery) QueryEntitlementplans() *EntitlementPlanQuery { + query := (&EntitlementPlanClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(entitlementplan.Table, entitlementplan.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitlementplansTable, organization.EntitlementplansColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlan + step.Edge.Schema = schemaConfig.EntitlementPlan + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitlementplanfeatures chains the current query on the "entitlementplanfeatures" edge. +func (oq *OrganizationQuery) QueryEntitlementplanfeatures() *EntitlementPlanFeatureQuery { + query := (&EntitlementPlanFeatureClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(entitlementplanfeature.Table, entitlementplanfeature.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitlementplanfeaturesTable, organization.EntitlementplanfeaturesColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.EntitlementPlanFeature + step.Edge.Schema = schemaConfig.EntitlementPlanFeature + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntities chains the current query on the "entities" edge. +func (oq *OrganizationQuery) QueryEntities() *EntityQuery { + query := (&EntityClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(entity.Table, entity.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitiesTable, organization.EntitiesColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Entity + step.Edge.Schema = schemaConfig.Entity + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEntitytypes chains the current query on the "entitytypes" edge. +func (oq *OrganizationQuery) QueryEntitytypes() *EntityTypeQuery { + query := (&EntityTypeClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(entitytype.Table, entitytype.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.EntitytypesTable, organization.EntitytypesColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.EntityType + step.Edge.Schema = schemaConfig.EntityType + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryContacts chains the current query on the "contacts" edge. +func (oq *OrganizationQuery) QueryContacts() *ContactQuery { + query := (&ContactClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(contact.Table, contact.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.ContactsTable, organization.ContactsColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Contact + step.Edge.Schema = schemaConfig.Contact + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryNotes chains the current query on the "notes" edge. +func (oq *OrganizationQuery) QueryNotes() *NoteQuery { + query := (&NoteClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(note.Table, note.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, organization.NotesTable, organization.NotesColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.Note + step.Edge.Schema = schemaConfig.Note + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryMembers chains the current query on the "members" edge. +func (oq *OrganizationQuery) QueryMembers() *OrgMembershipQuery { + query := (&OrgMembershipClient{config: oq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := oq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organization.Table, organization.FieldID, selector), + sqlgraph.To(orgmembership.Table, orgmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, organization.MembersTable, organization.MembersColumn), + ) + schemaConfig := oq.schemaConfig + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + fromU = sqlgraph.SetNeighbors(oq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Organization entity from the query. +// Returns a *NotFoundError when no Organization was found. +func (oq *OrganizationQuery) First(ctx context.Context) (*Organization, error) { + nodes, err := oq.Limit(1).All(setContextOp(ctx, oq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{organization.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (oq *OrganizationQuery) FirstX(ctx context.Context) *Organization { + node, err := oq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Organization ID from the query. +// Returns a *NotFoundError when no Organization ID was found. +func (oq *OrganizationQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = oq.Limit(1).IDs(setContextOp(ctx, oq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{organization.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (oq *OrganizationQuery) FirstIDX(ctx context.Context) string { + id, err := oq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Organization entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Organization entity is found. +// Returns a *NotFoundError when no Organization entities are found. +func (oq *OrganizationQuery) Only(ctx context.Context) (*Organization, error) { + nodes, err := oq.Limit(2).All(setContextOp(ctx, oq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{organization.Label} + default: + return nil, &NotSingularError{organization.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (oq *OrganizationQuery) OnlyX(ctx context.Context) *Organization { + node, err := oq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Organization ID in the query. +// Returns a *NotSingularError when more than one Organization ID is found. +// Returns a *NotFoundError when no entities are found. +func (oq *OrganizationQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = oq.Limit(2).IDs(setContextOp(ctx, oq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{organization.Label} + default: + err = &NotSingularError{organization.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (oq *OrganizationQuery) OnlyIDX(ctx context.Context) string { + id, err := oq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Organizations. +func (oq *OrganizationQuery) All(ctx context.Context) ([]*Organization, error) { + ctx = setContextOp(ctx, oq.ctx, ent.OpQueryAll) + if err := oq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Organization, *OrganizationQuery]() + return withInterceptors[[]*Organization](ctx, oq, qr, oq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (oq *OrganizationQuery) AllX(ctx context.Context) []*Organization { + nodes, err := oq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Organization IDs. +func (oq *OrganizationQuery) IDs(ctx context.Context) (ids []string, err error) { + if oq.ctx.Unique == nil && oq.path != nil { + oq.Unique(true) + } + ctx = setContextOp(ctx, oq.ctx, ent.OpQueryIDs) + if err = oq.Select(organization.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (oq *OrganizationQuery) IDsX(ctx context.Context) []string { + ids, err := oq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (oq *OrganizationQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, oq.ctx, ent.OpQueryCount) + if err := oq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, oq, querierCount[*OrganizationQuery](), oq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (oq *OrganizationQuery) CountX(ctx context.Context) int { + count, err := oq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (oq *OrganizationQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, oq.ctx, ent.OpQueryExist) + switch _, err := oq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (oq *OrganizationQuery) ExistX(ctx context.Context) bool { + exist, err := oq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OrganizationQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (oq *OrganizationQuery) Clone() *OrganizationQuery { + if oq == nil { + return nil + } + return &OrganizationQuery{ + config: oq.config, + ctx: oq.ctx.Clone(), + order: append([]organization.OrderOption{}, oq.order...), + inters: append([]Interceptor{}, oq.inters...), + predicates: append([]predicate.Organization{}, oq.predicates...), + withParent: oq.withParent.Clone(), + withChildren: oq.withChildren.Clone(), + withGroups: oq.withGroups.Clone(), + withTemplates: oq.withTemplates.Clone(), + withIntegrations: oq.withIntegrations.Clone(), + withSetting: oq.withSetting.Clone(), + withDocumentdata: oq.withDocumentdata.Clone(), + withEntitlements: oq.withEntitlements.Clone(), + withOrganizationEntitlement: oq.withOrganizationEntitlement.Clone(), + withPersonalAccessTokens: oq.withPersonalAccessTokens.Clone(), + withAPITokens: oq.withAPITokens.Clone(), + withOauthprovider: oq.withOauthprovider.Clone(), + withUsers: oq.withUsers.Clone(), + withInvites: oq.withInvites.Clone(), + withSubscribers: oq.withSubscribers.Clone(), + withWebhooks: oq.withWebhooks.Clone(), + withEvents: oq.withEvents.Clone(), + withSecrets: oq.withSecrets.Clone(), + withFeatures: oq.withFeatures.Clone(), + withFiles: oq.withFiles.Clone(), + withEntitlementplans: oq.withEntitlementplans.Clone(), + withEntitlementplanfeatures: oq.withEntitlementplanfeatures.Clone(), + withEntities: oq.withEntities.Clone(), + withEntitytypes: oq.withEntitytypes.Clone(), + withContacts: oq.withContacts.Clone(), + withNotes: oq.withNotes.Clone(), + withMembers: oq.withMembers.Clone(), + // clone intermediate query. + sql: oq.sql.Clone(), + path: oq.path, + } +} + +// WithParent tells the query-builder to eager-load the nodes that are connected to +// the "parent" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithParent(opts ...func(*OrganizationQuery)) *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withParent = query + return oq +} + +// WithChildren tells the query-builder to eager-load the nodes that are connected to +// the "children" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithChildren(opts ...func(*OrganizationQuery)) *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withChildren = query + return oq +} + +// WithGroups tells the query-builder to eager-load the nodes that are connected to +// the "groups" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithGroups(opts ...func(*GroupQuery)) *OrganizationQuery { + query := (&GroupClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withGroups = query + return oq +} + +// WithTemplates tells the query-builder to eager-load the nodes that are connected to +// the "templates" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithTemplates(opts ...func(*TemplateQuery)) *OrganizationQuery { + query := (&TemplateClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withTemplates = query + return oq +} + +// WithIntegrations tells the query-builder to eager-load the nodes that are connected to +// the "integrations" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithIntegrations(opts ...func(*IntegrationQuery)) *OrganizationQuery { + query := (&IntegrationClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withIntegrations = query + return oq +} + +// WithSetting tells the query-builder to eager-load the nodes that are connected to +// the "setting" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithSetting(opts ...func(*OrganizationSettingQuery)) *OrganizationQuery { + query := (&OrganizationSettingClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withSetting = query + return oq +} + +// WithDocumentdata tells the query-builder to eager-load the nodes that are connected to +// the "documentdata" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithDocumentdata(opts ...func(*DocumentDataQuery)) *OrganizationQuery { + query := (&DocumentDataClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withDocumentdata = query + return oq +} + +// WithEntitlements tells the query-builder to eager-load the nodes that are connected to +// the "entitlements" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithEntitlements(opts ...func(*EntitlementQuery)) *OrganizationQuery { + query := (&EntitlementClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withEntitlements = query + return oq +} + +// WithOrganizationEntitlement tells the query-builder to eager-load the nodes that are connected to +// the "organization_entitlement" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithOrganizationEntitlement(opts ...func(*EntitlementQuery)) *OrganizationQuery { + query := (&EntitlementClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withOrganizationEntitlement = query + return oq +} + +// WithPersonalAccessTokens tells the query-builder to eager-load the nodes that are connected to +// the "personal_access_tokens" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithPersonalAccessTokens(opts ...func(*PersonalAccessTokenQuery)) *OrganizationQuery { + query := (&PersonalAccessTokenClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withPersonalAccessTokens = query + return oq +} + +// WithAPITokens tells the query-builder to eager-load the nodes that are connected to +// the "api_tokens" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithAPITokens(opts ...func(*APITokenQuery)) *OrganizationQuery { + query := (&APITokenClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withAPITokens = query + return oq +} + +// WithOauthprovider tells the query-builder to eager-load the nodes that are connected to +// the "oauthprovider" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithOauthprovider(opts ...func(*OauthProviderQuery)) *OrganizationQuery { + query := (&OauthProviderClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withOauthprovider = query + return oq +} + +// WithUsers tells the query-builder to eager-load the nodes that are connected to +// the "users" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithUsers(opts ...func(*UserQuery)) *OrganizationQuery { + query := (&UserClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withUsers = query + return oq +} + +// WithInvites tells the query-builder to eager-load the nodes that are connected to +// the "invites" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithInvites(opts ...func(*InviteQuery)) *OrganizationQuery { + query := (&InviteClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withInvites = query + return oq +} + +// WithSubscribers tells the query-builder to eager-load the nodes that are connected to +// the "subscribers" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithSubscribers(opts ...func(*SubscriberQuery)) *OrganizationQuery { + query := (&SubscriberClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withSubscribers = query + return oq +} + +// WithWebhooks tells the query-builder to eager-load the nodes that are connected to +// the "webhooks" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithWebhooks(opts ...func(*WebhookQuery)) *OrganizationQuery { + query := (&WebhookClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withWebhooks = query + return oq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithEvents(opts ...func(*EventQuery)) *OrganizationQuery { + query := (&EventClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withEvents = query + return oq +} + +// WithSecrets tells the query-builder to eager-load the nodes that are connected to +// the "secrets" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithSecrets(opts ...func(*HushQuery)) *OrganizationQuery { + query := (&HushClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withSecrets = query + return oq +} + +// WithFeatures tells the query-builder to eager-load the nodes that are connected to +// the "features" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithFeatures(opts ...func(*FeatureQuery)) *OrganizationQuery { + query := (&FeatureClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withFeatures = query + return oq +} + +// WithFiles tells the query-builder to eager-load the nodes that are connected to +// the "files" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithFiles(opts ...func(*FileQuery)) *OrganizationQuery { + query := (&FileClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withFiles = query + return oq +} + +// WithEntitlementplans tells the query-builder to eager-load the nodes that are connected to +// the "entitlementplans" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithEntitlementplans(opts ...func(*EntitlementPlanQuery)) *OrganizationQuery { + query := (&EntitlementPlanClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withEntitlementplans = query + return oq +} + +// WithEntitlementplanfeatures tells the query-builder to eager-load the nodes that are connected to +// the "entitlementplanfeatures" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithEntitlementplanfeatures(opts ...func(*EntitlementPlanFeatureQuery)) *OrganizationQuery { + query := (&EntitlementPlanFeatureClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withEntitlementplanfeatures = query + return oq +} + +// WithEntities tells the query-builder to eager-load the nodes that are connected to +// the "entities" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithEntities(opts ...func(*EntityQuery)) *OrganizationQuery { + query := (&EntityClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withEntities = query + return oq +} + +// WithEntitytypes tells the query-builder to eager-load the nodes that are connected to +// the "entitytypes" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithEntitytypes(opts ...func(*EntityTypeQuery)) *OrganizationQuery { + query := (&EntityTypeClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withEntitytypes = query + return oq +} + +// WithContacts tells the query-builder to eager-load the nodes that are connected to +// the "contacts" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithContacts(opts ...func(*ContactQuery)) *OrganizationQuery { + query := (&ContactClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withContacts = query + return oq +} + +// WithNotes tells the query-builder to eager-load the nodes that are connected to +// the "notes" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNotes(opts ...func(*NoteQuery)) *OrganizationQuery { + query := (&NoteClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withNotes = query + return oq +} + +// WithMembers tells the query-builder to eager-load the nodes that are connected to +// the "members" edge. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithMembers(opts ...func(*OrgMembershipQuery)) *OrganizationQuery { + query := (&OrgMembershipClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + oq.withMembers = query + return oq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Organization.Query(). +// GroupBy(organization.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (oq *OrganizationQuery) GroupBy(field string, fields ...string) *OrganizationGroupBy { + oq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OrganizationGroupBy{build: oq} + grbuild.flds = &oq.ctx.Fields + grbuild.label = organization.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Organization.Query(). +// Select(organization.FieldCreatedAt). +// Scan(ctx, &v) +func (oq *OrganizationQuery) Select(fields ...string) *OrganizationSelect { + oq.ctx.Fields = append(oq.ctx.Fields, fields...) + sbuild := &OrganizationSelect{OrganizationQuery: oq} + sbuild.label = organization.Label + sbuild.flds, sbuild.scan = &oq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OrganizationSelect configured with the given aggregations. +func (oq *OrganizationQuery) Aggregate(fns ...AggregateFunc) *OrganizationSelect { + return oq.Select().Aggregate(fns...) +} + +func (oq *OrganizationQuery) prepareQuery(ctx context.Context) error { + for _, inter := range oq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, oq); err != nil { + return err + } + } + } + for _, f := range oq.ctx.Fields { + if !organization.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if oq.path != nil { + prev, err := oq.path(ctx) + if err != nil { + return err + } + oq.sql = prev + } + if organization.Policy == nil { + return errors.New("generated: uninitialized organization.Policy (forgotten import generated/runtime?)") + } + if err := organization.Policy.EvalQuery(ctx, oq); err != nil { + return err + } + return nil +} + +func (oq *OrganizationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Organization, error) { + var ( + nodes = []*Organization{} + _spec = oq.querySpec() + loadedTypes = [27]bool{ + oq.withParent != nil, + oq.withChildren != nil, + oq.withGroups != nil, + oq.withTemplates != nil, + oq.withIntegrations != nil, + oq.withSetting != nil, + oq.withDocumentdata != nil, + oq.withEntitlements != nil, + oq.withOrganizationEntitlement != nil, + oq.withPersonalAccessTokens != nil, + oq.withAPITokens != nil, + oq.withOauthprovider != nil, + oq.withUsers != nil, + oq.withInvites != nil, + oq.withSubscribers != nil, + oq.withWebhooks != nil, + oq.withEvents != nil, + oq.withSecrets != nil, + oq.withFeatures != nil, + oq.withFiles != nil, + oq.withEntitlementplans != nil, + oq.withEntitlementplanfeatures != nil, + oq.withEntities != nil, + oq.withEntitytypes != nil, + oq.withContacts != nil, + oq.withNotes != nil, + oq.withMembers != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Organization).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Organization{config: oq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = oq.schemaConfig.Organization + ctx = internal.NewSchemaConfigContext(ctx, oq.schemaConfig) + if len(oq.modifiers) > 0 { + _spec.Modifiers = oq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, oq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := oq.withParent; query != nil { + if err := oq.loadParent(ctx, query, nodes, nil, + func(n *Organization, e *Organization) { n.Edges.Parent = e }); err != nil { + return nil, err + } + } + if query := oq.withChildren; query != nil { + if err := oq.loadChildren(ctx, query, nodes, + func(n *Organization) { n.Edges.Children = []*Organization{} }, + func(n *Organization, e *Organization) { n.Edges.Children = append(n.Edges.Children, e) }); err != nil { + return nil, err + } + } + if query := oq.withGroups; query != nil { + if err := oq.loadGroups(ctx, query, nodes, + func(n *Organization) { n.Edges.Groups = []*Group{} }, + func(n *Organization, e *Group) { n.Edges.Groups = append(n.Edges.Groups, e) }); err != nil { + return nil, err + } + } + if query := oq.withTemplates; query != nil { + if err := oq.loadTemplates(ctx, query, nodes, + func(n *Organization) { n.Edges.Templates = []*Template{} }, + func(n *Organization, e *Template) { n.Edges.Templates = append(n.Edges.Templates, e) }); err != nil { + return nil, err + } + } + if query := oq.withIntegrations; query != nil { + if err := oq.loadIntegrations(ctx, query, nodes, + func(n *Organization) { n.Edges.Integrations = []*Integration{} }, + func(n *Organization, e *Integration) { n.Edges.Integrations = append(n.Edges.Integrations, e) }); err != nil { + return nil, err + } + } + if query := oq.withSetting; query != nil { + if err := oq.loadSetting(ctx, query, nodes, nil, + func(n *Organization, e *OrganizationSetting) { n.Edges.Setting = e }); err != nil { + return nil, err + } + } + if query := oq.withDocumentdata; query != nil { + if err := oq.loadDocumentdata(ctx, query, nodes, + func(n *Organization) { n.Edges.Documentdata = []*DocumentData{} }, + func(n *Organization, e *DocumentData) { n.Edges.Documentdata = append(n.Edges.Documentdata, e) }); err != nil { + return nil, err + } + } + if query := oq.withEntitlements; query != nil { + if err := oq.loadEntitlements(ctx, query, nodes, + func(n *Organization) { n.Edges.Entitlements = []*Entitlement{} }, + func(n *Organization, e *Entitlement) { n.Edges.Entitlements = append(n.Edges.Entitlements, e) }); err != nil { + return nil, err + } + } + if query := oq.withOrganizationEntitlement; query != nil { + if err := oq.loadOrganizationEntitlement(ctx, query, nodes, + func(n *Organization) { n.Edges.OrganizationEntitlement = []*Entitlement{} }, + func(n *Organization, e *Entitlement) { + n.Edges.OrganizationEntitlement = append(n.Edges.OrganizationEntitlement, e) + }); err != nil { + return nil, err + } + } + if query := oq.withPersonalAccessTokens; query != nil { + if err := oq.loadPersonalAccessTokens(ctx, query, nodes, + func(n *Organization) { n.Edges.PersonalAccessTokens = []*PersonalAccessToken{} }, + func(n *Organization, e *PersonalAccessToken) { + n.Edges.PersonalAccessTokens = append(n.Edges.PersonalAccessTokens, e) + }); err != nil { + return nil, err + } + } + if query := oq.withAPITokens; query != nil { + if err := oq.loadAPITokens(ctx, query, nodes, + func(n *Organization) { n.Edges.APITokens = []*APIToken{} }, + func(n *Organization, e *APIToken) { n.Edges.APITokens = append(n.Edges.APITokens, e) }); err != nil { + return nil, err + } + } + if query := oq.withOauthprovider; query != nil { + if err := oq.loadOauthprovider(ctx, query, nodes, + func(n *Organization) { n.Edges.Oauthprovider = []*OauthProvider{} }, + func(n *Organization, e *OauthProvider) { n.Edges.Oauthprovider = append(n.Edges.Oauthprovider, e) }); err != nil { + return nil, err + } + } + if query := oq.withUsers; query != nil { + if err := oq.loadUsers(ctx, query, nodes, + func(n *Organization) { n.Edges.Users = []*User{} }, + func(n *Organization, e *User) { n.Edges.Users = append(n.Edges.Users, e) }); err != nil { + return nil, err + } + } + if query := oq.withInvites; query != nil { + if err := oq.loadInvites(ctx, query, nodes, + func(n *Organization) { n.Edges.Invites = []*Invite{} }, + func(n *Organization, e *Invite) { n.Edges.Invites = append(n.Edges.Invites, e) }); err != nil { + return nil, err + } + } + if query := oq.withSubscribers; query != nil { + if err := oq.loadSubscribers(ctx, query, nodes, + func(n *Organization) { n.Edges.Subscribers = []*Subscriber{} }, + func(n *Organization, e *Subscriber) { n.Edges.Subscribers = append(n.Edges.Subscribers, e) }); err != nil { + return nil, err + } + } + if query := oq.withWebhooks; query != nil { + if err := oq.loadWebhooks(ctx, query, nodes, + func(n *Organization) { n.Edges.Webhooks = []*Webhook{} }, + func(n *Organization, e *Webhook) { n.Edges.Webhooks = append(n.Edges.Webhooks, e) }); err != nil { + return nil, err + } + } + if query := oq.withEvents; query != nil { + if err := oq.loadEvents(ctx, query, nodes, + func(n *Organization) { n.Edges.Events = []*Event{} }, + func(n *Organization, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + if query := oq.withSecrets; query != nil { + if err := oq.loadSecrets(ctx, query, nodes, + func(n *Organization) { n.Edges.Secrets = []*Hush{} }, + func(n *Organization, e *Hush) { n.Edges.Secrets = append(n.Edges.Secrets, e) }); err != nil { + return nil, err + } + } + if query := oq.withFeatures; query != nil { + if err := oq.loadFeatures(ctx, query, nodes, + func(n *Organization) { n.Edges.Features = []*Feature{} }, + func(n *Organization, e *Feature) { n.Edges.Features = append(n.Edges.Features, e) }); err != nil { + return nil, err + } + } + if query := oq.withFiles; query != nil { + if err := oq.loadFiles(ctx, query, nodes, + func(n *Organization) { n.Edges.Files = []*File{} }, + func(n *Organization, e *File) { n.Edges.Files = append(n.Edges.Files, e) }); err != nil { + return nil, err + } + } + if query := oq.withEntitlementplans; query != nil { + if err := oq.loadEntitlementplans(ctx, query, nodes, + func(n *Organization) { n.Edges.Entitlementplans = []*EntitlementPlan{} }, + func(n *Organization, e *EntitlementPlan) { + n.Edges.Entitlementplans = append(n.Edges.Entitlementplans, e) + }); err != nil { + return nil, err + } + } + if query := oq.withEntitlementplanfeatures; query != nil { + if err := oq.loadEntitlementplanfeatures(ctx, query, nodes, + func(n *Organization) { n.Edges.Entitlementplanfeatures = []*EntitlementPlanFeature{} }, + func(n *Organization, e *EntitlementPlanFeature) { + n.Edges.Entitlementplanfeatures = append(n.Edges.Entitlementplanfeatures, e) + }); err != nil { + return nil, err + } + } + if query := oq.withEntities; query != nil { + if err := oq.loadEntities(ctx, query, nodes, + func(n *Organization) { n.Edges.Entities = []*Entity{} }, + func(n *Organization, e *Entity) { n.Edges.Entities = append(n.Edges.Entities, e) }); err != nil { + return nil, err + } + } + if query := oq.withEntitytypes; query != nil { + if err := oq.loadEntitytypes(ctx, query, nodes, + func(n *Organization) { n.Edges.Entitytypes = []*EntityType{} }, + func(n *Organization, e *EntityType) { n.Edges.Entitytypes = append(n.Edges.Entitytypes, e) }); err != nil { + return nil, err + } + } + if query := oq.withContacts; query != nil { + if err := oq.loadContacts(ctx, query, nodes, + func(n *Organization) { n.Edges.Contacts = []*Contact{} }, + func(n *Organization, e *Contact) { n.Edges.Contacts = append(n.Edges.Contacts, e) }); err != nil { + return nil, err + } + } + if query := oq.withNotes; query != nil { + if err := oq.loadNotes(ctx, query, nodes, + func(n *Organization) { n.Edges.Notes = []*Note{} }, + func(n *Organization, e *Note) { n.Edges.Notes = append(n.Edges.Notes, e) }); err != nil { + return nil, err + } + } + if query := oq.withMembers; query != nil { + if err := oq.loadMembers(ctx, query, nodes, + func(n *Organization) { n.Edges.Members = []*OrgMembership{} }, + func(n *Organization, e *OrgMembership) { n.Edges.Members = append(n.Edges.Members, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedChildren { + if err := oq.loadChildren(ctx, query, nodes, + func(n *Organization) { n.appendNamedChildren(name) }, + func(n *Organization, e *Organization) { n.appendNamedChildren(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedGroups { + if err := oq.loadGroups(ctx, query, nodes, + func(n *Organization) { n.appendNamedGroups(name) }, + func(n *Organization, e *Group) { n.appendNamedGroups(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedTemplates { + if err := oq.loadTemplates(ctx, query, nodes, + func(n *Organization) { n.appendNamedTemplates(name) }, + func(n *Organization, e *Template) { n.appendNamedTemplates(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedIntegrations { + if err := oq.loadIntegrations(ctx, query, nodes, + func(n *Organization) { n.appendNamedIntegrations(name) }, + func(n *Organization, e *Integration) { n.appendNamedIntegrations(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedDocumentdata { + if err := oq.loadDocumentdata(ctx, query, nodes, + func(n *Organization) { n.appendNamedDocumentdata(name) }, + func(n *Organization, e *DocumentData) { n.appendNamedDocumentdata(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedEntitlements { + if err := oq.loadEntitlements(ctx, query, nodes, + func(n *Organization) { n.appendNamedEntitlements(name) }, + func(n *Organization, e *Entitlement) { n.appendNamedEntitlements(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedOrganizationEntitlement { + if err := oq.loadOrganizationEntitlement(ctx, query, nodes, + func(n *Organization) { n.appendNamedOrganizationEntitlement(name) }, + func(n *Organization, e *Entitlement) { n.appendNamedOrganizationEntitlement(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedPersonalAccessTokens { + if err := oq.loadPersonalAccessTokens(ctx, query, nodes, + func(n *Organization) { n.appendNamedPersonalAccessTokens(name) }, + func(n *Organization, e *PersonalAccessToken) { n.appendNamedPersonalAccessTokens(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedAPITokens { + if err := oq.loadAPITokens(ctx, query, nodes, + func(n *Organization) { n.appendNamedAPITokens(name) }, + func(n *Organization, e *APIToken) { n.appendNamedAPITokens(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedOauthprovider { + if err := oq.loadOauthprovider(ctx, query, nodes, + func(n *Organization) { n.appendNamedOauthprovider(name) }, + func(n *Organization, e *OauthProvider) { n.appendNamedOauthprovider(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedUsers { + if err := oq.loadUsers(ctx, query, nodes, + func(n *Organization) { n.appendNamedUsers(name) }, + func(n *Organization, e *User) { n.appendNamedUsers(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedInvites { + if err := oq.loadInvites(ctx, query, nodes, + func(n *Organization) { n.appendNamedInvites(name) }, + func(n *Organization, e *Invite) { n.appendNamedInvites(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedSubscribers { + if err := oq.loadSubscribers(ctx, query, nodes, + func(n *Organization) { n.appendNamedSubscribers(name) }, + func(n *Organization, e *Subscriber) { n.appendNamedSubscribers(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedWebhooks { + if err := oq.loadWebhooks(ctx, query, nodes, + func(n *Organization) { n.appendNamedWebhooks(name) }, + func(n *Organization, e *Webhook) { n.appendNamedWebhooks(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedEvents { + if err := oq.loadEvents(ctx, query, nodes, + func(n *Organization) { n.appendNamedEvents(name) }, + func(n *Organization, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedSecrets { + if err := oq.loadSecrets(ctx, query, nodes, + func(n *Organization) { n.appendNamedSecrets(name) }, + func(n *Organization, e *Hush) { n.appendNamedSecrets(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedFeatures { + if err := oq.loadFeatures(ctx, query, nodes, + func(n *Organization) { n.appendNamedFeatures(name) }, + func(n *Organization, e *Feature) { n.appendNamedFeatures(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedFiles { + if err := oq.loadFiles(ctx, query, nodes, + func(n *Organization) { n.appendNamedFiles(name) }, + func(n *Organization, e *File) { n.appendNamedFiles(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedEntitlementplans { + if err := oq.loadEntitlementplans(ctx, query, nodes, + func(n *Organization) { n.appendNamedEntitlementplans(name) }, + func(n *Organization, e *EntitlementPlan) { n.appendNamedEntitlementplans(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedEntitlementplanfeatures { + if err := oq.loadEntitlementplanfeatures(ctx, query, nodes, + func(n *Organization) { n.appendNamedEntitlementplanfeatures(name) }, + func(n *Organization, e *EntitlementPlanFeature) { n.appendNamedEntitlementplanfeatures(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedEntities { + if err := oq.loadEntities(ctx, query, nodes, + func(n *Organization) { n.appendNamedEntities(name) }, + func(n *Organization, e *Entity) { n.appendNamedEntities(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedEntitytypes { + if err := oq.loadEntitytypes(ctx, query, nodes, + func(n *Organization) { n.appendNamedEntitytypes(name) }, + func(n *Organization, e *EntityType) { n.appendNamedEntitytypes(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedContacts { + if err := oq.loadContacts(ctx, query, nodes, + func(n *Organization) { n.appendNamedContacts(name) }, + func(n *Organization, e *Contact) { n.appendNamedContacts(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedNotes { + if err := oq.loadNotes(ctx, query, nodes, + func(n *Organization) { n.appendNamedNotes(name) }, + func(n *Organization, e *Note) { n.appendNamedNotes(name, e) }); err != nil { + return nil, err + } + } + for name, query := range oq.withNamedMembers { + if err := oq.loadMembers(ctx, query, nodes, + func(n *Organization) { n.appendNamedMembers(name) }, + func(n *Organization, e *OrgMembership) { n.appendNamedMembers(name, e) }); err != nil { + return nil, err + } + } + for i := range oq.loadTotal { + if err := oq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (oq *OrganizationQuery) loadParent(ctx context.Context, query *OrganizationQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Organization) + for i := range nodes { + fk := nodes[i].ParentOrganizationID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "parent_organization_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (oq *OrganizationQuery) loadChildren(ctx context.Context, query *OrganizationQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Organization)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(organization.FieldParentOrganizationID) + } + query.Where(predicate.Organization(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.ChildrenColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.ParentOrganizationID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "parent_organization_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadGroups(ctx context.Context, query *GroupQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Group)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(group.FieldOwnerID) + } + query.Where(predicate.Group(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.GroupsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadTemplates(ctx context.Context, query *TemplateQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Template)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(template.FieldOwnerID) + } + query.Where(predicate.Template(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.TemplatesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadIntegrations(ctx context.Context, query *IntegrationQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Integration)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + query.withFKs = true + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(integration.FieldOwnerID) + } + query.Where(predicate.Integration(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.IntegrationsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadSetting(ctx context.Context, query *OrganizationSettingQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *OrganizationSetting)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(organizationsetting.FieldOrganizationID) + } + query.Where(predicate.OrganizationSetting(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.SettingColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OrganizationID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "organization_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadDocumentdata(ctx context.Context, query *DocumentDataQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *DocumentData)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(documentdata.FieldOwnerID) + } + query.Where(predicate.DocumentData(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.DocumentdataColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadEntitlements(ctx context.Context, query *EntitlementQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Entitlement)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitlement.FieldOwnerID) + } + query.Where(predicate.Entitlement(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.EntitlementsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadOrganizationEntitlement(ctx context.Context, query *EntitlementQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Entitlement)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitlement.FieldOrganizationID) + } + query.Where(predicate.Entitlement(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.OrganizationEntitlementColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OrganizationID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "organization_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadPersonalAccessTokens(ctx context.Context, query *PersonalAccessTokenQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *PersonalAccessToken)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Organization) + nids := make(map[string]map[*Organization]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(organization.PersonalAccessTokensTable) + joinT.Schema(oq.schemaConfig.OrganizationPersonalAccessTokens) + s.Join(joinT).On(s.C(personalaccesstoken.FieldID), joinT.C(organization.PersonalAccessTokensPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(organization.PersonalAccessTokensPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(organization.PersonalAccessTokensPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Organization]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*PersonalAccessToken](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "personal_access_tokens" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (oq *OrganizationQuery) loadAPITokens(ctx context.Context, query *APITokenQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *APIToken)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(apitoken.FieldOwnerID) + } + query.Where(predicate.APIToken(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.APITokensColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadOauthprovider(ctx context.Context, query *OauthProviderQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *OauthProvider)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(oauthprovider.FieldOwnerID) + } + query.Where(predicate.OauthProvider(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.OauthproviderColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadUsers(ctx context.Context, query *UserQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *User)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Organization) + nids := make(map[string]map[*Organization]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(organization.UsersTable) + joinT.Schema(oq.schemaConfig.OrgMembership) + s.Join(joinT).On(s.C(user.FieldID), joinT.C(organization.UsersPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(organization.UsersPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(organization.UsersPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Organization]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*User](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "users" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (oq *OrganizationQuery) loadInvites(ctx context.Context, query *InviteQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Invite)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(invite.FieldOwnerID) + } + query.Where(predicate.Invite(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.InvitesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadSubscribers(ctx context.Context, query *SubscriberQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Subscriber)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(subscriber.FieldOwnerID) + } + query.Where(predicate.Subscriber(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.SubscribersColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadWebhooks(ctx context.Context, query *WebhookQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Webhook)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(webhook.FieldOwnerID) + } + query.Where(predicate.Webhook(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.WebhooksColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Organization) + nids := make(map[string]map[*Organization]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(organization.EventsTable) + joinT.Schema(oq.schemaConfig.OrganizationEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(organization.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(organization.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(organization.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Organization]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (oq *OrganizationQuery) loadSecrets(ctx context.Context, query *HushQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Hush)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Organization) + nids := make(map[string]map[*Organization]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(organization.SecretsTable) + joinT.Schema(oq.schemaConfig.OrganizationSecrets) + s.Join(joinT).On(s.C(hush.FieldID), joinT.C(organization.SecretsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(organization.SecretsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(organization.SecretsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Organization]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Hush](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "secrets" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (oq *OrganizationQuery) loadFeatures(ctx context.Context, query *FeatureQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Feature)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(feature.FieldOwnerID) + } + query.Where(predicate.Feature(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.FeaturesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadFiles(ctx context.Context, query *FileQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *File)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Organization) + nids := make(map[string]map[*Organization]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(organization.FilesTable) + joinT.Schema(oq.schemaConfig.OrganizationFiles) + s.Join(joinT).On(s.C(file.FieldID), joinT.C(organization.FilesPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(organization.FilesPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(organization.FilesPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Organization]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*File](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "files" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (oq *OrganizationQuery) loadEntitlementplans(ctx context.Context, query *EntitlementPlanQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *EntitlementPlan)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitlementplan.FieldOwnerID) + } + query.Where(predicate.EntitlementPlan(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.EntitlementplansColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadEntitlementplanfeatures(ctx context.Context, query *EntitlementPlanFeatureQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *EntitlementPlanFeature)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitlementplanfeature.FieldOwnerID) + } + query.Where(predicate.EntitlementPlanFeature(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.EntitlementplanfeaturesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadEntities(ctx context.Context, query *EntityQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Entity)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + query.withFKs = true + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entity.FieldOwnerID) + } + query.Where(predicate.Entity(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.EntitiesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadEntitytypes(ctx context.Context, query *EntityTypeQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *EntityType)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(entitytype.FieldOwnerID) + } + query.Where(predicate.EntityType(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.EntitytypesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadContacts(ctx context.Context, query *ContactQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Contact)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(contact.FieldOwnerID) + } + query.Where(predicate.Contact(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.ContactsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadNotes(ctx context.Context, query *NoteQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *Note)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + query.withFKs = true + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(note.FieldOwnerID) + } + query.Where(predicate.Note(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.NotesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (oq *OrganizationQuery) loadMembers(ctx context.Context, query *OrgMembershipQuery, nodes []*Organization, init func(*Organization), assign func(*Organization, *OrgMembership)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Organization) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(orgmembership.FieldOrganizationID) + } + query.Where(predicate.OrgMembership(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(organization.MembersColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OrganizationID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "organization_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (oq *OrganizationQuery) sqlCount(ctx context.Context) (int, error) { + _spec := oq.querySpec() + _spec.Node.Schema = oq.schemaConfig.Organization + ctx = internal.NewSchemaConfigContext(ctx, oq.schemaConfig) + if len(oq.modifiers) > 0 { + _spec.Modifiers = oq.modifiers + } + _spec.Node.Columns = oq.ctx.Fields + if len(oq.ctx.Fields) > 0 { + _spec.Unique = oq.ctx.Unique != nil && *oq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, oq.driver, _spec) +} + +func (oq *OrganizationQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString)) + _spec.From = oq.sql + if unique := oq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if oq.path != nil { + _spec.Unique = true + } + if fields := oq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organization.FieldID) + for i := range fields { + if fields[i] != organization.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if oq.withParent != nil { + _spec.Node.AddColumnOnce(organization.FieldParentOrganizationID) + } + } + if ps := oq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := oq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := oq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := oq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (oq *OrganizationQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(oq.driver.Dialect()) + t1 := builder.Table(organization.Table) + columns := oq.ctx.Fields + if len(columns) == 0 { + columns = organization.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if oq.sql != nil { + selector = oq.sql + selector.Select(selector.Columns(columns...)...) + } + if oq.ctx.Unique != nil && *oq.ctx.Unique { + selector.Distinct() + } + t1.Schema(oq.schemaConfig.Organization) + ctx = internal.NewSchemaConfigContext(ctx, oq.schemaConfig) + selector.WithContext(ctx) + for _, p := range oq.predicates { + p(selector) + } + for _, p := range oq.order { + p(selector) + } + if offset := oq.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 := oq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedChildren tells the query-builder to eager-load the nodes that are connected to the "children" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedChildren(name string, opts ...func(*OrganizationQuery)) *OrganizationQuery { + query := (&OrganizationClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedChildren == nil { + oq.withNamedChildren = make(map[string]*OrganizationQuery) + } + oq.withNamedChildren[name] = query + return oq +} + +// WithNamedGroups tells the query-builder to eager-load the nodes that are connected to the "groups" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedGroups(name string, opts ...func(*GroupQuery)) *OrganizationQuery { + query := (&GroupClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedGroups == nil { + oq.withNamedGroups = make(map[string]*GroupQuery) + } + oq.withNamedGroups[name] = query + return oq +} + +// WithNamedTemplates tells the query-builder to eager-load the nodes that are connected to the "templates" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedTemplates(name string, opts ...func(*TemplateQuery)) *OrganizationQuery { + query := (&TemplateClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedTemplates == nil { + oq.withNamedTemplates = make(map[string]*TemplateQuery) + } + oq.withNamedTemplates[name] = query + return oq +} + +// WithNamedIntegrations tells the query-builder to eager-load the nodes that are connected to the "integrations" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedIntegrations(name string, opts ...func(*IntegrationQuery)) *OrganizationQuery { + query := (&IntegrationClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedIntegrations == nil { + oq.withNamedIntegrations = make(map[string]*IntegrationQuery) + } + oq.withNamedIntegrations[name] = query + return oq +} + +// WithNamedDocumentdata tells the query-builder to eager-load the nodes that are connected to the "documentdata" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedDocumentdata(name string, opts ...func(*DocumentDataQuery)) *OrganizationQuery { + query := (&DocumentDataClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedDocumentdata == nil { + oq.withNamedDocumentdata = make(map[string]*DocumentDataQuery) + } + oq.withNamedDocumentdata[name] = query + return oq +} + +// WithNamedEntitlements tells the query-builder to eager-load the nodes that are connected to the "entitlements" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedEntitlements(name string, opts ...func(*EntitlementQuery)) *OrganizationQuery { + query := (&EntitlementClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedEntitlements == nil { + oq.withNamedEntitlements = make(map[string]*EntitlementQuery) + } + oq.withNamedEntitlements[name] = query + return oq +} + +// WithNamedOrganizationEntitlement tells the query-builder to eager-load the nodes that are connected to the "organization_entitlement" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedOrganizationEntitlement(name string, opts ...func(*EntitlementQuery)) *OrganizationQuery { + query := (&EntitlementClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedOrganizationEntitlement == nil { + oq.withNamedOrganizationEntitlement = make(map[string]*EntitlementQuery) + } + oq.withNamedOrganizationEntitlement[name] = query + return oq +} + +// WithNamedPersonalAccessTokens tells the query-builder to eager-load the nodes that are connected to the "personal_access_tokens" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedPersonalAccessTokens(name string, opts ...func(*PersonalAccessTokenQuery)) *OrganizationQuery { + query := (&PersonalAccessTokenClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedPersonalAccessTokens == nil { + oq.withNamedPersonalAccessTokens = make(map[string]*PersonalAccessTokenQuery) + } + oq.withNamedPersonalAccessTokens[name] = query + return oq +} + +// WithNamedAPITokens tells the query-builder to eager-load the nodes that are connected to the "api_tokens" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedAPITokens(name string, opts ...func(*APITokenQuery)) *OrganizationQuery { + query := (&APITokenClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedAPITokens == nil { + oq.withNamedAPITokens = make(map[string]*APITokenQuery) + } + oq.withNamedAPITokens[name] = query + return oq +} + +// WithNamedOauthprovider tells the query-builder to eager-load the nodes that are connected to the "oauthprovider" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedOauthprovider(name string, opts ...func(*OauthProviderQuery)) *OrganizationQuery { + query := (&OauthProviderClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedOauthprovider == nil { + oq.withNamedOauthprovider = make(map[string]*OauthProviderQuery) + } + oq.withNamedOauthprovider[name] = query + return oq +} + +// WithNamedUsers tells the query-builder to eager-load the nodes that are connected to the "users" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedUsers(name string, opts ...func(*UserQuery)) *OrganizationQuery { + query := (&UserClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedUsers == nil { + oq.withNamedUsers = make(map[string]*UserQuery) + } + oq.withNamedUsers[name] = query + return oq +} + +// WithNamedInvites tells the query-builder to eager-load the nodes that are connected to the "invites" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedInvites(name string, opts ...func(*InviteQuery)) *OrganizationQuery { + query := (&InviteClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedInvites == nil { + oq.withNamedInvites = make(map[string]*InviteQuery) + } + oq.withNamedInvites[name] = query + return oq +} + +// WithNamedSubscribers tells the query-builder to eager-load the nodes that are connected to the "subscribers" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedSubscribers(name string, opts ...func(*SubscriberQuery)) *OrganizationQuery { + query := (&SubscriberClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedSubscribers == nil { + oq.withNamedSubscribers = make(map[string]*SubscriberQuery) + } + oq.withNamedSubscribers[name] = query + return oq +} + +// WithNamedWebhooks tells the query-builder to eager-load the nodes that are connected to the "webhooks" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedWebhooks(name string, opts ...func(*WebhookQuery)) *OrganizationQuery { + query := (&WebhookClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedWebhooks == nil { + oq.withNamedWebhooks = make(map[string]*WebhookQuery) + } + oq.withNamedWebhooks[name] = query + return oq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *OrganizationQuery { + query := (&EventClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedEvents == nil { + oq.withNamedEvents = make(map[string]*EventQuery) + } + oq.withNamedEvents[name] = query + return oq +} + +// WithNamedSecrets tells the query-builder to eager-load the nodes that are connected to the "secrets" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedSecrets(name string, opts ...func(*HushQuery)) *OrganizationQuery { + query := (&HushClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedSecrets == nil { + oq.withNamedSecrets = make(map[string]*HushQuery) + } + oq.withNamedSecrets[name] = query + return oq +} + +// WithNamedFeatures tells the query-builder to eager-load the nodes that are connected to the "features" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedFeatures(name string, opts ...func(*FeatureQuery)) *OrganizationQuery { + query := (&FeatureClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedFeatures == nil { + oq.withNamedFeatures = make(map[string]*FeatureQuery) + } + oq.withNamedFeatures[name] = query + return oq +} + +// WithNamedFiles tells the query-builder to eager-load the nodes that are connected to the "files" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedFiles(name string, opts ...func(*FileQuery)) *OrganizationQuery { + query := (&FileClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedFiles == nil { + oq.withNamedFiles = make(map[string]*FileQuery) + } + oq.withNamedFiles[name] = query + return oq +} + +// WithNamedEntitlementplans tells the query-builder to eager-load the nodes that are connected to the "entitlementplans" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedEntitlementplans(name string, opts ...func(*EntitlementPlanQuery)) *OrganizationQuery { + query := (&EntitlementPlanClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedEntitlementplans == nil { + oq.withNamedEntitlementplans = make(map[string]*EntitlementPlanQuery) + } + oq.withNamedEntitlementplans[name] = query + return oq +} + +// WithNamedEntitlementplanfeatures tells the query-builder to eager-load the nodes that are connected to the "entitlementplanfeatures" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedEntitlementplanfeatures(name string, opts ...func(*EntitlementPlanFeatureQuery)) *OrganizationQuery { + query := (&EntitlementPlanFeatureClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedEntitlementplanfeatures == nil { + oq.withNamedEntitlementplanfeatures = make(map[string]*EntitlementPlanFeatureQuery) + } + oq.withNamedEntitlementplanfeatures[name] = query + return oq +} + +// WithNamedEntities tells the query-builder to eager-load the nodes that are connected to the "entities" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedEntities(name string, opts ...func(*EntityQuery)) *OrganizationQuery { + query := (&EntityClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedEntities == nil { + oq.withNamedEntities = make(map[string]*EntityQuery) + } + oq.withNamedEntities[name] = query + return oq +} + +// WithNamedEntitytypes tells the query-builder to eager-load the nodes that are connected to the "entitytypes" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedEntitytypes(name string, opts ...func(*EntityTypeQuery)) *OrganizationQuery { + query := (&EntityTypeClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedEntitytypes == nil { + oq.withNamedEntitytypes = make(map[string]*EntityTypeQuery) + } + oq.withNamedEntitytypes[name] = query + return oq +} + +// WithNamedContacts tells the query-builder to eager-load the nodes that are connected to the "contacts" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedContacts(name string, opts ...func(*ContactQuery)) *OrganizationQuery { + query := (&ContactClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedContacts == nil { + oq.withNamedContacts = make(map[string]*ContactQuery) + } + oq.withNamedContacts[name] = query + return oq +} + +// WithNamedNotes tells the query-builder to eager-load the nodes that are connected to the "notes" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedNotes(name string, opts ...func(*NoteQuery)) *OrganizationQuery { + query := (&NoteClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedNotes == nil { + oq.withNamedNotes = make(map[string]*NoteQuery) + } + oq.withNamedNotes[name] = query + return oq +} + +// WithNamedMembers tells the query-builder to eager-load the nodes that are connected to the "members" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (oq *OrganizationQuery) WithNamedMembers(name string, opts ...func(*OrgMembershipQuery)) *OrganizationQuery { + query := (&OrgMembershipClient{config: oq.config}).Query() + for _, opt := range opts { + opt(query) + } + if oq.withNamedMembers == nil { + oq.withNamedMembers = make(map[string]*OrgMembershipQuery) + } + oq.withNamedMembers[name] = query + return oq +} + +// OrganizationGroupBy is the group-by builder for Organization entities. +type OrganizationGroupBy struct { + selector + build *OrganizationQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ogb *OrganizationGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationGroupBy { + ogb.fns = append(ogb.fns, fns...) + return ogb +} + +// Scan applies the selector query and scans the result into the given value. +func (ogb *OrganizationGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ogb.build.ctx, ent.OpQueryGroupBy) + if err := ogb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationQuery, *OrganizationGroupBy](ctx, ogb.build, ogb, ogb.build.inters, v) +} + +func (ogb *OrganizationGroupBy) sqlScan(ctx context.Context, root *OrganizationQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ogb.fns)) + for _, fn := range ogb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ogb.flds)+len(ogb.fns)) + for _, f := range *ogb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ogb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ogb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OrganizationSelect is the builder for selecting fields of Organization entities. +type OrganizationSelect struct { + *OrganizationQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (os *OrganizationSelect) Aggregate(fns ...AggregateFunc) *OrganizationSelect { + os.fns = append(os.fns, fns...) + return os +} + +// Scan applies the selector query and scans the result into the given value. +func (os *OrganizationSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, os.ctx, ent.OpQuerySelect) + if err := os.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationQuery, *OrganizationSelect](ctx, os.OrganizationQuery, os, os.inters, v) +} + +func (os *OrganizationSelect) sqlScan(ctx context.Context, root *OrganizationQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(os.fns)) + for _, fn := range os.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*os.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 := os.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/organization_update.go b/internal/ent/generated/organization_update.go new file mode 100644 index 0000000..6ae350d --- /dev/null +++ b/internal/ent/generated/organization_update.go @@ -0,0 +1,5111 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationUpdate is the builder for updating Organization entities. +type OrganizationUpdate struct { + config + hooks []Hook + mutation *OrganizationMutation +} + +// Where appends a list predicates to the OrganizationUpdate builder. +func (ou *OrganizationUpdate) Where(ps ...predicate.Organization) *OrganizationUpdate { + ou.mutation.Where(ps...) + return ou +} + +// SetUpdatedAt sets the "updated_at" field. +func (ou *OrganizationUpdate) SetUpdatedAt(t time.Time) *OrganizationUpdate { + ou.mutation.SetUpdatedAt(t) + return ou +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ou *OrganizationUpdate) ClearUpdatedAt() *OrganizationUpdate { + ou.mutation.ClearUpdatedAt() + return ou +} + +// SetUpdatedBy sets the "updated_by" field. +func (ou *OrganizationUpdate) SetUpdatedBy(s string) *OrganizationUpdate { + ou.mutation.SetUpdatedBy(s) + return ou +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableUpdatedBy(s *string) *OrganizationUpdate { + if s != nil { + ou.SetUpdatedBy(*s) + } + return ou +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ou *OrganizationUpdate) ClearUpdatedBy() *OrganizationUpdate { + ou.mutation.ClearUpdatedBy() + return ou +} + +// SetTags sets the "tags" field. +func (ou *OrganizationUpdate) SetTags(s []string) *OrganizationUpdate { + ou.mutation.SetTags(s) + return ou +} + +// AppendTags appends s to the "tags" field. +func (ou *OrganizationUpdate) AppendTags(s []string) *OrganizationUpdate { + ou.mutation.AppendTags(s) + return ou +} + +// ClearTags clears the value of the "tags" field. +func (ou *OrganizationUpdate) ClearTags() *OrganizationUpdate { + ou.mutation.ClearTags() + return ou +} + +// SetDeletedAt sets the "deleted_at" field. +func (ou *OrganizationUpdate) SetDeletedAt(t time.Time) *OrganizationUpdate { + ou.mutation.SetDeletedAt(t) + return ou +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableDeletedAt(t *time.Time) *OrganizationUpdate { + if t != nil { + ou.SetDeletedAt(*t) + } + return ou +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ou *OrganizationUpdate) ClearDeletedAt() *OrganizationUpdate { + ou.mutation.ClearDeletedAt() + return ou +} + +// SetDeletedBy sets the "deleted_by" field. +func (ou *OrganizationUpdate) SetDeletedBy(s string) *OrganizationUpdate { + ou.mutation.SetDeletedBy(s) + return ou +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableDeletedBy(s *string) *OrganizationUpdate { + if s != nil { + ou.SetDeletedBy(*s) + } + return ou +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ou *OrganizationUpdate) ClearDeletedBy() *OrganizationUpdate { + ou.mutation.ClearDeletedBy() + return ou +} + +// SetName sets the "name" field. +func (ou *OrganizationUpdate) SetName(s string) *OrganizationUpdate { + ou.mutation.SetName(s) + return ou +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableName(s *string) *OrganizationUpdate { + if s != nil { + ou.SetName(*s) + } + return ou +} + +// SetDisplayName sets the "display_name" field. +func (ou *OrganizationUpdate) SetDisplayName(s string) *OrganizationUpdate { + ou.mutation.SetDisplayName(s) + return ou +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableDisplayName(s *string) *OrganizationUpdate { + if s != nil { + ou.SetDisplayName(*s) + } + return ou +} + +// SetDescription sets the "description" field. +func (ou *OrganizationUpdate) SetDescription(s string) *OrganizationUpdate { + ou.mutation.SetDescription(s) + return ou +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableDescription(s *string) *OrganizationUpdate { + if s != nil { + ou.SetDescription(*s) + } + return ou +} + +// ClearDescription clears the value of the "description" field. +func (ou *OrganizationUpdate) ClearDescription() *OrganizationUpdate { + ou.mutation.ClearDescription() + return ou +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (ou *OrganizationUpdate) SetAvatarRemoteURL(s string) *OrganizationUpdate { + ou.mutation.SetAvatarRemoteURL(s) + return ou +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableAvatarRemoteURL(s *string) *OrganizationUpdate { + if s != nil { + ou.SetAvatarRemoteURL(*s) + } + return ou +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (ou *OrganizationUpdate) ClearAvatarRemoteURL() *OrganizationUpdate { + ou.mutation.ClearAvatarRemoteURL() + return ou +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (ou *OrganizationUpdate) SetDedicatedDb(b bool) *OrganizationUpdate { + ou.mutation.SetDedicatedDb(b) + return ou +} + +// SetNillableDedicatedDb sets the "dedicated_db" field if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableDedicatedDb(b *bool) *OrganizationUpdate { + if b != nil { + ou.SetDedicatedDb(*b) + } + return ou +} + +// AddChildIDs adds the "children" edge to the Organization entity by IDs. +func (ou *OrganizationUpdate) AddChildIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddChildIDs(ids...) + return ou +} + +// AddChildren adds the "children" edges to the Organization entity. +func (ou *OrganizationUpdate) AddChildren(o ...*Organization) *OrganizationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.AddChildIDs(ids...) +} + +// AddGroupIDs adds the "groups" edge to the Group entity by IDs. +func (ou *OrganizationUpdate) AddGroupIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddGroupIDs(ids...) + return ou +} + +// AddGroups adds the "groups" edges to the Group entity. +func (ou *OrganizationUpdate) AddGroups(g ...*Group) *OrganizationUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return ou.AddGroupIDs(ids...) +} + +// AddTemplateIDs adds the "templates" edge to the Template entity by IDs. +func (ou *OrganizationUpdate) AddTemplateIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddTemplateIDs(ids...) + return ou +} + +// AddTemplates adds the "templates" edges to the Template entity. +func (ou *OrganizationUpdate) AddTemplates(t ...*Template) *OrganizationUpdate { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return ou.AddTemplateIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (ou *OrganizationUpdate) AddIntegrationIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddIntegrationIDs(ids...) + return ou +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (ou *OrganizationUpdate) AddIntegrations(i ...*Integration) *OrganizationUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ou.AddIntegrationIDs(ids...) +} + +// SetSettingID sets the "setting" edge to the OrganizationSetting entity by ID. +func (ou *OrganizationUpdate) SetSettingID(id string) *OrganizationUpdate { + ou.mutation.SetSettingID(id) + return ou +} + +// SetNillableSettingID sets the "setting" edge to the OrganizationSetting entity by ID if the given value is not nil. +func (ou *OrganizationUpdate) SetNillableSettingID(id *string) *OrganizationUpdate { + if id != nil { + ou = ou.SetSettingID(*id) + } + return ou +} + +// SetSetting sets the "setting" edge to the OrganizationSetting entity. +func (ou *OrganizationUpdate) SetSetting(o *OrganizationSetting) *OrganizationUpdate { + return ou.SetSettingID(o.ID) +} + +// AddDocumentdatumIDs adds the "documentdata" edge to the DocumentData entity by IDs. +func (ou *OrganizationUpdate) AddDocumentdatumIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddDocumentdatumIDs(ids...) + return ou +} + +// AddDocumentdata adds the "documentdata" edges to the DocumentData entity. +func (ou *OrganizationUpdate) AddDocumentdata(d ...*DocumentData) *OrganizationUpdate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return ou.AddDocumentdatumIDs(ids...) +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by IDs. +func (ou *OrganizationUpdate) AddEntitlementIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddEntitlementIDs(ids...) + return ou +} + +// AddEntitlements adds the "entitlements" edges to the Entitlement entity. +func (ou *OrganizationUpdate) AddEntitlements(e ...*Entitlement) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.AddEntitlementIDs(ids...) +} + +// AddOrganizationEntitlementIDs adds the "organization_entitlement" edge to the Entitlement entity by IDs. +func (ou *OrganizationUpdate) AddOrganizationEntitlementIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddOrganizationEntitlementIDs(ids...) + return ou +} + +// AddOrganizationEntitlement adds the "organization_entitlement" edges to the Entitlement entity. +func (ou *OrganizationUpdate) AddOrganizationEntitlement(e ...*Entitlement) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.AddOrganizationEntitlementIDs(ids...) +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (ou *OrganizationUpdate) AddPersonalAccessTokenIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddPersonalAccessTokenIDs(ids...) + return ou +} + +// AddPersonalAccessTokens adds the "personal_access_tokens" edges to the PersonalAccessToken entity. +func (ou *OrganizationUpdate) AddPersonalAccessTokens(p ...*PersonalAccessToken) *OrganizationUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return ou.AddPersonalAccessTokenIDs(ids...) +} + +// AddAPITokenIDs adds the "api_tokens" edge to the APIToken entity by IDs. +func (ou *OrganizationUpdate) AddAPITokenIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddAPITokenIDs(ids...) + return ou +} + +// AddAPITokens adds the "api_tokens" edges to the APIToken entity. +func (ou *OrganizationUpdate) AddAPITokens(a ...*APIToken) *OrganizationUpdate { + ids := make([]string, len(a)) + for i := range a { + ids[i] = a[i].ID + } + return ou.AddAPITokenIDs(ids...) +} + +// AddOauthproviderIDs adds the "oauthprovider" edge to the OauthProvider entity by IDs. +func (ou *OrganizationUpdate) AddOauthproviderIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddOauthproviderIDs(ids...) + return ou +} + +// AddOauthprovider adds the "oauthprovider" edges to the OauthProvider entity. +func (ou *OrganizationUpdate) AddOauthprovider(o ...*OauthProvider) *OrganizationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.AddOauthproviderIDs(ids...) +} + +// AddUserIDs adds the "users" edge to the User entity by IDs. +func (ou *OrganizationUpdate) AddUserIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddUserIDs(ids...) + return ou +} + +// AddUsers adds the "users" edges to the User entity. +func (ou *OrganizationUpdate) AddUsers(u ...*User) *OrganizationUpdate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return ou.AddUserIDs(ids...) +} + +// AddInviteIDs adds the "invites" edge to the Invite entity by IDs. +func (ou *OrganizationUpdate) AddInviteIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddInviteIDs(ids...) + return ou +} + +// AddInvites adds the "invites" edges to the Invite entity. +func (ou *OrganizationUpdate) AddInvites(i ...*Invite) *OrganizationUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ou.AddInviteIDs(ids...) +} + +// AddSubscriberIDs adds the "subscribers" edge to the Subscriber entity by IDs. +func (ou *OrganizationUpdate) AddSubscriberIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddSubscriberIDs(ids...) + return ou +} + +// AddSubscribers adds the "subscribers" edges to the Subscriber entity. +func (ou *OrganizationUpdate) AddSubscribers(s ...*Subscriber) *OrganizationUpdate { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return ou.AddSubscriberIDs(ids...) +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by IDs. +func (ou *OrganizationUpdate) AddWebhookIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddWebhookIDs(ids...) + return ou +} + +// AddWebhooks adds the "webhooks" edges to the Webhook entity. +func (ou *OrganizationUpdate) AddWebhooks(w ...*Webhook) *OrganizationUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return ou.AddWebhookIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (ou *OrganizationUpdate) AddEventIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddEventIDs(ids...) + return ou +} + +// AddEvents adds the "events" edges to the Event entity. +func (ou *OrganizationUpdate) AddEvents(e ...*Event) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.AddEventIDs(ids...) +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by IDs. +func (ou *OrganizationUpdate) AddSecretIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddSecretIDs(ids...) + return ou +} + +// AddSecrets adds the "secrets" edges to the Hush entity. +func (ou *OrganizationUpdate) AddSecrets(h ...*Hush) *OrganizationUpdate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return ou.AddSecretIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the Feature entity by IDs. +func (ou *OrganizationUpdate) AddFeatureIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddFeatureIDs(ids...) + return ou +} + +// AddFeatures adds the "features" edges to the Feature entity. +func (ou *OrganizationUpdate) AddFeatures(f ...*Feature) *OrganizationUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ou.AddFeatureIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (ou *OrganizationUpdate) AddFileIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddFileIDs(ids...) + return ou +} + +// AddFiles adds the "files" edges to the File entity. +func (ou *OrganizationUpdate) AddFiles(f ...*File) *OrganizationUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ou.AddFileIDs(ids...) +} + +// AddEntitlementplanIDs adds the "entitlementplans" edge to the EntitlementPlan entity by IDs. +func (ou *OrganizationUpdate) AddEntitlementplanIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddEntitlementplanIDs(ids...) + return ou +} + +// AddEntitlementplans adds the "entitlementplans" edges to the EntitlementPlan entity. +func (ou *OrganizationUpdate) AddEntitlementplans(e ...*EntitlementPlan) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.AddEntitlementplanIDs(ids...) +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity by IDs. +func (ou *OrganizationUpdate) AddEntitlementplanfeatureIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddEntitlementplanfeatureIDs(ids...) + return ou +} + +// AddEntitlementplanfeatures adds the "entitlementplanfeatures" edges to the EntitlementPlanFeature entity. +func (ou *OrganizationUpdate) AddEntitlementplanfeatures(e ...*EntitlementPlanFeature) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.AddEntitlementplanfeatureIDs(ids...) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (ou *OrganizationUpdate) AddEntityIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddEntityIDs(ids...) + return ou +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (ou *OrganizationUpdate) AddEntities(e ...*Entity) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.AddEntityIDs(ids...) +} + +// AddEntitytypeIDs adds the "entitytypes" edge to the EntityType entity by IDs. +func (ou *OrganizationUpdate) AddEntitytypeIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddEntitytypeIDs(ids...) + return ou +} + +// AddEntitytypes adds the "entitytypes" edges to the EntityType entity. +func (ou *OrganizationUpdate) AddEntitytypes(e ...*EntityType) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.AddEntitytypeIDs(ids...) +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by IDs. +func (ou *OrganizationUpdate) AddContactIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddContactIDs(ids...) + return ou +} + +// AddContacts adds the "contacts" edges to the Contact entity. +func (ou *OrganizationUpdate) AddContacts(c ...*Contact) *OrganizationUpdate { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return ou.AddContactIDs(ids...) +} + +// AddNoteIDs adds the "notes" edge to the Note entity by IDs. +func (ou *OrganizationUpdate) AddNoteIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddNoteIDs(ids...) + return ou +} + +// AddNotes adds the "notes" edges to the Note entity. +func (ou *OrganizationUpdate) AddNotes(n ...*Note) *OrganizationUpdate { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return ou.AddNoteIDs(ids...) +} + +// AddMemberIDs adds the "members" edge to the OrgMembership entity by IDs. +func (ou *OrganizationUpdate) AddMemberIDs(ids ...string) *OrganizationUpdate { + ou.mutation.AddMemberIDs(ids...) + return ou +} + +// AddMembers adds the "members" edges to the OrgMembership entity. +func (ou *OrganizationUpdate) AddMembers(o ...*OrgMembership) *OrganizationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.AddMemberIDs(ids...) +} + +// Mutation returns the OrganizationMutation object of the builder. +func (ou *OrganizationUpdate) Mutation() *OrganizationMutation { + return ou.mutation +} + +// ClearChildren clears all "children" edges to the Organization entity. +func (ou *OrganizationUpdate) ClearChildren() *OrganizationUpdate { + ou.mutation.ClearChildren() + return ou +} + +// RemoveChildIDs removes the "children" edge to Organization entities by IDs. +func (ou *OrganizationUpdate) RemoveChildIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveChildIDs(ids...) + return ou +} + +// RemoveChildren removes "children" edges to Organization entities. +func (ou *OrganizationUpdate) RemoveChildren(o ...*Organization) *OrganizationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.RemoveChildIDs(ids...) +} + +// ClearGroups clears all "groups" edges to the Group entity. +func (ou *OrganizationUpdate) ClearGroups() *OrganizationUpdate { + ou.mutation.ClearGroups() + return ou +} + +// RemoveGroupIDs removes the "groups" edge to Group entities by IDs. +func (ou *OrganizationUpdate) RemoveGroupIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveGroupIDs(ids...) + return ou +} + +// RemoveGroups removes "groups" edges to Group entities. +func (ou *OrganizationUpdate) RemoveGroups(g ...*Group) *OrganizationUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return ou.RemoveGroupIDs(ids...) +} + +// ClearTemplates clears all "templates" edges to the Template entity. +func (ou *OrganizationUpdate) ClearTemplates() *OrganizationUpdate { + ou.mutation.ClearTemplates() + return ou +} + +// RemoveTemplateIDs removes the "templates" edge to Template entities by IDs. +func (ou *OrganizationUpdate) RemoveTemplateIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveTemplateIDs(ids...) + return ou +} + +// RemoveTemplates removes "templates" edges to Template entities. +func (ou *OrganizationUpdate) RemoveTemplates(t ...*Template) *OrganizationUpdate { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return ou.RemoveTemplateIDs(ids...) +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (ou *OrganizationUpdate) ClearIntegrations() *OrganizationUpdate { + ou.mutation.ClearIntegrations() + return ou +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (ou *OrganizationUpdate) RemoveIntegrationIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveIntegrationIDs(ids...) + return ou +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (ou *OrganizationUpdate) RemoveIntegrations(i ...*Integration) *OrganizationUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ou.RemoveIntegrationIDs(ids...) +} + +// ClearSetting clears the "setting" edge to the OrganizationSetting entity. +func (ou *OrganizationUpdate) ClearSetting() *OrganizationUpdate { + ou.mutation.ClearSetting() + return ou +} + +// ClearDocumentdata clears all "documentdata" edges to the DocumentData entity. +func (ou *OrganizationUpdate) ClearDocumentdata() *OrganizationUpdate { + ou.mutation.ClearDocumentdata() + return ou +} + +// RemoveDocumentdatumIDs removes the "documentdata" edge to DocumentData entities by IDs. +func (ou *OrganizationUpdate) RemoveDocumentdatumIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveDocumentdatumIDs(ids...) + return ou +} + +// RemoveDocumentdata removes "documentdata" edges to DocumentData entities. +func (ou *OrganizationUpdate) RemoveDocumentdata(d ...*DocumentData) *OrganizationUpdate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return ou.RemoveDocumentdatumIDs(ids...) +} + +// ClearEntitlements clears all "entitlements" edges to the Entitlement entity. +func (ou *OrganizationUpdate) ClearEntitlements() *OrganizationUpdate { + ou.mutation.ClearEntitlements() + return ou +} + +// RemoveEntitlementIDs removes the "entitlements" edge to Entitlement entities by IDs. +func (ou *OrganizationUpdate) RemoveEntitlementIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveEntitlementIDs(ids...) + return ou +} + +// RemoveEntitlements removes "entitlements" edges to Entitlement entities. +func (ou *OrganizationUpdate) RemoveEntitlements(e ...*Entitlement) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.RemoveEntitlementIDs(ids...) +} + +// ClearOrganizationEntitlement clears all "organization_entitlement" edges to the Entitlement entity. +func (ou *OrganizationUpdate) ClearOrganizationEntitlement() *OrganizationUpdate { + ou.mutation.ClearOrganizationEntitlement() + return ou +} + +// RemoveOrganizationEntitlementIDs removes the "organization_entitlement" edge to Entitlement entities by IDs. +func (ou *OrganizationUpdate) RemoveOrganizationEntitlementIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveOrganizationEntitlementIDs(ids...) + return ou +} + +// RemoveOrganizationEntitlement removes "organization_entitlement" edges to Entitlement entities. +func (ou *OrganizationUpdate) RemoveOrganizationEntitlement(e ...*Entitlement) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.RemoveOrganizationEntitlementIDs(ids...) +} + +// ClearPersonalAccessTokens clears all "personal_access_tokens" edges to the PersonalAccessToken entity. +func (ou *OrganizationUpdate) ClearPersonalAccessTokens() *OrganizationUpdate { + ou.mutation.ClearPersonalAccessTokens() + return ou +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_tokens" edge to PersonalAccessToken entities by IDs. +func (ou *OrganizationUpdate) RemovePersonalAccessTokenIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemovePersonalAccessTokenIDs(ids...) + return ou +} + +// RemovePersonalAccessTokens removes "personal_access_tokens" edges to PersonalAccessToken entities. +func (ou *OrganizationUpdate) RemovePersonalAccessTokens(p ...*PersonalAccessToken) *OrganizationUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return ou.RemovePersonalAccessTokenIDs(ids...) +} + +// ClearAPITokens clears all "api_tokens" edges to the APIToken entity. +func (ou *OrganizationUpdate) ClearAPITokens() *OrganizationUpdate { + ou.mutation.ClearAPITokens() + return ou +} + +// RemoveAPITokenIDs removes the "api_tokens" edge to APIToken entities by IDs. +func (ou *OrganizationUpdate) RemoveAPITokenIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveAPITokenIDs(ids...) + return ou +} + +// RemoveAPITokens removes "api_tokens" edges to APIToken entities. +func (ou *OrganizationUpdate) RemoveAPITokens(a ...*APIToken) *OrganizationUpdate { + ids := make([]string, len(a)) + for i := range a { + ids[i] = a[i].ID + } + return ou.RemoveAPITokenIDs(ids...) +} + +// ClearOauthprovider clears all "oauthprovider" edges to the OauthProvider entity. +func (ou *OrganizationUpdate) ClearOauthprovider() *OrganizationUpdate { + ou.mutation.ClearOauthprovider() + return ou +} + +// RemoveOauthproviderIDs removes the "oauthprovider" edge to OauthProvider entities by IDs. +func (ou *OrganizationUpdate) RemoveOauthproviderIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveOauthproviderIDs(ids...) + return ou +} + +// RemoveOauthprovider removes "oauthprovider" edges to OauthProvider entities. +func (ou *OrganizationUpdate) RemoveOauthprovider(o ...*OauthProvider) *OrganizationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.RemoveOauthproviderIDs(ids...) +} + +// ClearUsers clears all "users" edges to the User entity. +func (ou *OrganizationUpdate) ClearUsers() *OrganizationUpdate { + ou.mutation.ClearUsers() + return ou +} + +// RemoveUserIDs removes the "users" edge to User entities by IDs. +func (ou *OrganizationUpdate) RemoveUserIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveUserIDs(ids...) + return ou +} + +// RemoveUsers removes "users" edges to User entities. +func (ou *OrganizationUpdate) RemoveUsers(u ...*User) *OrganizationUpdate { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return ou.RemoveUserIDs(ids...) +} + +// ClearInvites clears all "invites" edges to the Invite entity. +func (ou *OrganizationUpdate) ClearInvites() *OrganizationUpdate { + ou.mutation.ClearInvites() + return ou +} + +// RemoveInviteIDs removes the "invites" edge to Invite entities by IDs. +func (ou *OrganizationUpdate) RemoveInviteIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveInviteIDs(ids...) + return ou +} + +// RemoveInvites removes "invites" edges to Invite entities. +func (ou *OrganizationUpdate) RemoveInvites(i ...*Invite) *OrganizationUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ou.RemoveInviteIDs(ids...) +} + +// ClearSubscribers clears all "subscribers" edges to the Subscriber entity. +func (ou *OrganizationUpdate) ClearSubscribers() *OrganizationUpdate { + ou.mutation.ClearSubscribers() + return ou +} + +// RemoveSubscriberIDs removes the "subscribers" edge to Subscriber entities by IDs. +func (ou *OrganizationUpdate) RemoveSubscriberIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveSubscriberIDs(ids...) + return ou +} + +// RemoveSubscribers removes "subscribers" edges to Subscriber entities. +func (ou *OrganizationUpdate) RemoveSubscribers(s ...*Subscriber) *OrganizationUpdate { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return ou.RemoveSubscriberIDs(ids...) +} + +// ClearWebhooks clears all "webhooks" edges to the Webhook entity. +func (ou *OrganizationUpdate) ClearWebhooks() *OrganizationUpdate { + ou.mutation.ClearWebhooks() + return ou +} + +// RemoveWebhookIDs removes the "webhooks" edge to Webhook entities by IDs. +func (ou *OrganizationUpdate) RemoveWebhookIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveWebhookIDs(ids...) + return ou +} + +// RemoveWebhooks removes "webhooks" edges to Webhook entities. +func (ou *OrganizationUpdate) RemoveWebhooks(w ...*Webhook) *OrganizationUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return ou.RemoveWebhookIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (ou *OrganizationUpdate) ClearEvents() *OrganizationUpdate { + ou.mutation.ClearEvents() + return ou +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (ou *OrganizationUpdate) RemoveEventIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveEventIDs(ids...) + return ou +} + +// RemoveEvents removes "events" edges to Event entities. +func (ou *OrganizationUpdate) RemoveEvents(e ...*Event) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.RemoveEventIDs(ids...) +} + +// ClearSecrets clears all "secrets" edges to the Hush entity. +func (ou *OrganizationUpdate) ClearSecrets() *OrganizationUpdate { + ou.mutation.ClearSecrets() + return ou +} + +// RemoveSecretIDs removes the "secrets" edge to Hush entities by IDs. +func (ou *OrganizationUpdate) RemoveSecretIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveSecretIDs(ids...) + return ou +} + +// RemoveSecrets removes "secrets" edges to Hush entities. +func (ou *OrganizationUpdate) RemoveSecrets(h ...*Hush) *OrganizationUpdate { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return ou.RemoveSecretIDs(ids...) +} + +// ClearFeatures clears all "features" edges to the Feature entity. +func (ou *OrganizationUpdate) ClearFeatures() *OrganizationUpdate { + ou.mutation.ClearFeatures() + return ou +} + +// RemoveFeatureIDs removes the "features" edge to Feature entities by IDs. +func (ou *OrganizationUpdate) RemoveFeatureIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveFeatureIDs(ids...) + return ou +} + +// RemoveFeatures removes "features" edges to Feature entities. +func (ou *OrganizationUpdate) RemoveFeatures(f ...*Feature) *OrganizationUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ou.RemoveFeatureIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (ou *OrganizationUpdate) ClearFiles() *OrganizationUpdate { + ou.mutation.ClearFiles() + return ou +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (ou *OrganizationUpdate) RemoveFileIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveFileIDs(ids...) + return ou +} + +// RemoveFiles removes "files" edges to File entities. +func (ou *OrganizationUpdate) RemoveFiles(f ...*File) *OrganizationUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ou.RemoveFileIDs(ids...) +} + +// ClearEntitlementplans clears all "entitlementplans" edges to the EntitlementPlan entity. +func (ou *OrganizationUpdate) ClearEntitlementplans() *OrganizationUpdate { + ou.mutation.ClearEntitlementplans() + return ou +} + +// RemoveEntitlementplanIDs removes the "entitlementplans" edge to EntitlementPlan entities by IDs. +func (ou *OrganizationUpdate) RemoveEntitlementplanIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveEntitlementplanIDs(ids...) + return ou +} + +// RemoveEntitlementplans removes "entitlementplans" edges to EntitlementPlan entities. +func (ou *OrganizationUpdate) RemoveEntitlementplans(e ...*EntitlementPlan) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.RemoveEntitlementplanIDs(ids...) +} + +// ClearEntitlementplanfeatures clears all "entitlementplanfeatures" edges to the EntitlementPlanFeature entity. +func (ou *OrganizationUpdate) ClearEntitlementplanfeatures() *OrganizationUpdate { + ou.mutation.ClearEntitlementplanfeatures() + return ou +} + +// RemoveEntitlementplanfeatureIDs removes the "entitlementplanfeatures" edge to EntitlementPlanFeature entities by IDs. +func (ou *OrganizationUpdate) RemoveEntitlementplanfeatureIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveEntitlementplanfeatureIDs(ids...) + return ou +} + +// RemoveEntitlementplanfeatures removes "entitlementplanfeatures" edges to EntitlementPlanFeature entities. +func (ou *OrganizationUpdate) RemoveEntitlementplanfeatures(e ...*EntitlementPlanFeature) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.RemoveEntitlementplanfeatureIDs(ids...) +} + +// ClearEntities clears all "entities" edges to the Entity entity. +func (ou *OrganizationUpdate) ClearEntities() *OrganizationUpdate { + ou.mutation.ClearEntities() + return ou +} + +// RemoveEntityIDs removes the "entities" edge to Entity entities by IDs. +func (ou *OrganizationUpdate) RemoveEntityIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveEntityIDs(ids...) + return ou +} + +// RemoveEntities removes "entities" edges to Entity entities. +func (ou *OrganizationUpdate) RemoveEntities(e ...*Entity) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.RemoveEntityIDs(ids...) +} + +// ClearEntitytypes clears all "entitytypes" edges to the EntityType entity. +func (ou *OrganizationUpdate) ClearEntitytypes() *OrganizationUpdate { + ou.mutation.ClearEntitytypes() + return ou +} + +// RemoveEntitytypeIDs removes the "entitytypes" edge to EntityType entities by IDs. +func (ou *OrganizationUpdate) RemoveEntitytypeIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveEntitytypeIDs(ids...) + return ou +} + +// RemoveEntitytypes removes "entitytypes" edges to EntityType entities. +func (ou *OrganizationUpdate) RemoveEntitytypes(e ...*EntityType) *OrganizationUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ou.RemoveEntitytypeIDs(ids...) +} + +// ClearContacts clears all "contacts" edges to the Contact entity. +func (ou *OrganizationUpdate) ClearContacts() *OrganizationUpdate { + ou.mutation.ClearContacts() + return ou +} + +// RemoveContactIDs removes the "contacts" edge to Contact entities by IDs. +func (ou *OrganizationUpdate) RemoveContactIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveContactIDs(ids...) + return ou +} + +// RemoveContacts removes "contacts" edges to Contact entities. +func (ou *OrganizationUpdate) RemoveContacts(c ...*Contact) *OrganizationUpdate { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return ou.RemoveContactIDs(ids...) +} + +// ClearNotes clears all "notes" edges to the Note entity. +func (ou *OrganizationUpdate) ClearNotes() *OrganizationUpdate { + ou.mutation.ClearNotes() + return ou +} + +// RemoveNoteIDs removes the "notes" edge to Note entities by IDs. +func (ou *OrganizationUpdate) RemoveNoteIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveNoteIDs(ids...) + return ou +} + +// RemoveNotes removes "notes" edges to Note entities. +func (ou *OrganizationUpdate) RemoveNotes(n ...*Note) *OrganizationUpdate { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return ou.RemoveNoteIDs(ids...) +} + +// ClearMembers clears all "members" edges to the OrgMembership entity. +func (ou *OrganizationUpdate) ClearMembers() *OrganizationUpdate { + ou.mutation.ClearMembers() + return ou +} + +// RemoveMemberIDs removes the "members" edge to OrgMembership entities by IDs. +func (ou *OrganizationUpdate) RemoveMemberIDs(ids ...string) *OrganizationUpdate { + ou.mutation.RemoveMemberIDs(ids...) + return ou +} + +// RemoveMembers removes "members" edges to OrgMembership entities. +func (ou *OrganizationUpdate) RemoveMembers(o ...*OrgMembership) *OrganizationUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ou.RemoveMemberIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ou *OrganizationUpdate) Save(ctx context.Context) (int, error) { + if err := ou.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ou.sqlSave, ou.mutation, ou.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ou *OrganizationUpdate) SaveX(ctx context.Context) int { + affected, err := ou.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ou *OrganizationUpdate) Exec(ctx context.Context) error { + _, err := ou.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ou *OrganizationUpdate) ExecX(ctx context.Context) { + if err := ou.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ou *OrganizationUpdate) defaults() error { + if _, ok := ou.mutation.UpdatedAt(); !ok && !ou.mutation.UpdatedAtCleared() { + if organization.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organization.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organization.UpdateDefaultUpdatedAt() + ou.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ou *OrganizationUpdate) check() error { + if v, ok := ou.mutation.Name(); ok { + if err := organization.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Organization.name": %w`, err)} + } + } + if v, ok := ou.mutation.DisplayName(); ok { + if err := organization.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Organization.display_name": %w`, err)} + } + } + if v, ok := ou.mutation.AvatarRemoteURL(); ok { + if err := organization.AvatarRemoteURLValidator(v); err != nil { + return &ValidationError{Name: "avatar_remote_url", err: fmt.Errorf(`generated: validator failed for field "Organization.avatar_remote_url": %w`, err)} + } + } + return nil +} + +func (ou *OrganizationUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := ou.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString)) + if ps := ou.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ou.mutation.CreatedAtCleared() { + _spec.ClearField(organization.FieldCreatedAt, field.TypeTime) + } + if value, ok := ou.mutation.UpdatedAt(); ok { + _spec.SetField(organization.FieldUpdatedAt, field.TypeTime, value) + } + if ou.mutation.UpdatedAtCleared() { + _spec.ClearField(organization.FieldUpdatedAt, field.TypeTime) + } + if ou.mutation.CreatedByCleared() { + _spec.ClearField(organization.FieldCreatedBy, field.TypeString) + } + if value, ok := ou.mutation.UpdatedBy(); ok { + _spec.SetField(organization.FieldUpdatedBy, field.TypeString, value) + } + if ou.mutation.UpdatedByCleared() { + _spec.ClearField(organization.FieldUpdatedBy, field.TypeString) + } + if value, ok := ou.mutation.Tags(); ok { + _spec.SetField(organization.FieldTags, field.TypeJSON, value) + } + if value, ok := ou.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organization.FieldTags, value) + }) + } + if ou.mutation.TagsCleared() { + _spec.ClearField(organization.FieldTags, field.TypeJSON) + } + if value, ok := ou.mutation.DeletedAt(); ok { + _spec.SetField(organization.FieldDeletedAt, field.TypeTime, value) + } + if ou.mutation.DeletedAtCleared() { + _spec.ClearField(organization.FieldDeletedAt, field.TypeTime) + } + if value, ok := ou.mutation.DeletedBy(); ok { + _spec.SetField(organization.FieldDeletedBy, field.TypeString, value) + } + if ou.mutation.DeletedByCleared() { + _spec.ClearField(organization.FieldDeletedBy, field.TypeString) + } + if value, ok := ou.mutation.Name(); ok { + _spec.SetField(organization.FieldName, field.TypeString, value) + } + if value, ok := ou.mutation.DisplayName(); ok { + _spec.SetField(organization.FieldDisplayName, field.TypeString, value) + } + if value, ok := ou.mutation.Description(); ok { + _spec.SetField(organization.FieldDescription, field.TypeString, value) + } + if ou.mutation.DescriptionCleared() { + _spec.ClearField(organization.FieldDescription, field.TypeString) + } + if ou.mutation.PersonalOrgCleared() { + _spec.ClearField(organization.FieldPersonalOrg, field.TypeBool) + } + if value, ok := ou.mutation.AvatarRemoteURL(); ok { + _spec.SetField(organization.FieldAvatarRemoteURL, field.TypeString, value) + } + if ou.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(organization.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := ou.mutation.DedicatedDb(); ok { + _spec.SetField(organization.FieldDedicatedDb, field.TypeBool, value) + } + if ou.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Organization + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !ou.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Organization + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Organization + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Group + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedGroupsIDs(); len(nodes) > 0 && !ou.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.GroupsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.TemplatesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Template + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedTemplatesIDs(); len(nodes) > 0 && !ou.mutation.TemplatesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.TemplatesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Integration + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !ou.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.SettingCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: organization.SettingTable, + Columns: []string{organization.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: organization.SettingTable, + Columns: []string{organization.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.DocumentdataCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedDocumentdataIDs(); len(nodes) > 0 && !ou.mutation.DocumentdataCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.DocumentdataIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedEntitlementsIDs(); len(nodes) > 0 && !ou.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.EntitlementsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.OrganizationEntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedOrganizationEntitlementIDs(); len(nodes) > 0 && !ou.mutation.OrganizationEntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.OrganizationEntitlementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationPersonalAccessTokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedPersonalAccessTokensIDs(); len(nodes) > 0 && !ou.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.PersonalAccessTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.APITokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.APIToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedAPITokensIDs(); len(nodes) > 0 && !ou.mutation.APITokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.APITokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.OauthproviderCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OauthProvider + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedOauthproviderIDs(); len(nodes) > 0 && !ou.mutation.OauthproviderCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.OauthproviderIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrgMembership + createE := &OrgMembershipCreate{config: ou.config, mutation: newOrgMembershipMutation(ou.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedUsersIDs(); len(nodes) > 0 && !ou.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: ou.config, mutation: newOrgMembershipMutation(ou.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.UsersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: ou.config, mutation: newOrgMembershipMutation(ou.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.InvitesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Invite + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedInvitesIDs(); len(nodes) > 0 && !ou.mutation.InvitesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.InvitesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.SubscribersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Subscriber + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedSubscribersIDs(); len(nodes) > 0 && !ou.mutation.SubscribersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.SubscribersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Webhook + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedWebhooksIDs(); len(nodes) > 0 && !ou.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.WebhooksIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedEventsIDs(); len(nodes) > 0 && !ou.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedSecretsIDs(); len(nodes) > 0 && !ou.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.SecretsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Feature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedFeaturesIDs(); len(nodes) > 0 && !ou.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedFilesIDs(); len(nodes) > 0 && !ou.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.EntitlementplansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntitlementPlan + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedEntitlementplansIDs(); len(nodes) > 0 && !ou.mutation.EntitlementplansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.EntitlementplansIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.EntitlementplanfeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedEntitlementplanfeaturesIDs(); len(nodes) > 0 && !ou.mutation.EntitlementplanfeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.EntitlementplanfeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedEntitiesIDs(); len(nodes) > 0 && !ou.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.EntitytypesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntityType + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedEntitytypesIDs(); len(nodes) > 0 && !ou.mutation.EntitytypesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.EntitytypesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Contact + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedContactsIDs(); len(nodes) > 0 && !ou.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.ContactsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedNotesIDs(); len(nodes) > 0 && !ou.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.NotesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ou.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrgMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.RemovedMembersIDs(); len(nodes) > 0 && !ou.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ou.mutation.MembersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ou.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = ou.schemaConfig.Organization + ctx = internal.NewSchemaConfigContext(ctx, ou.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ou.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organization.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ou.mutation.done = true + return n, nil +} + +// OrganizationUpdateOne is the builder for updating a single Organization entity. +type OrganizationUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OrganizationMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ouo *OrganizationUpdateOne) SetUpdatedAt(t time.Time) *OrganizationUpdateOne { + ouo.mutation.SetUpdatedAt(t) + return ouo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ouo *OrganizationUpdateOne) ClearUpdatedAt() *OrganizationUpdateOne { + ouo.mutation.ClearUpdatedAt() + return ouo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ouo *OrganizationUpdateOne) SetUpdatedBy(s string) *OrganizationUpdateOne { + ouo.mutation.SetUpdatedBy(s) + return ouo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableUpdatedBy(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetUpdatedBy(*s) + } + return ouo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ouo *OrganizationUpdateOne) ClearUpdatedBy() *OrganizationUpdateOne { + ouo.mutation.ClearUpdatedBy() + return ouo +} + +// SetTags sets the "tags" field. +func (ouo *OrganizationUpdateOne) SetTags(s []string) *OrganizationUpdateOne { + ouo.mutation.SetTags(s) + return ouo +} + +// AppendTags appends s to the "tags" field. +func (ouo *OrganizationUpdateOne) AppendTags(s []string) *OrganizationUpdateOne { + ouo.mutation.AppendTags(s) + return ouo +} + +// ClearTags clears the value of the "tags" field. +func (ouo *OrganizationUpdateOne) ClearTags() *OrganizationUpdateOne { + ouo.mutation.ClearTags() + return ouo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ouo *OrganizationUpdateOne) SetDeletedAt(t time.Time) *OrganizationUpdateOne { + ouo.mutation.SetDeletedAt(t) + return ouo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableDeletedAt(t *time.Time) *OrganizationUpdateOne { + if t != nil { + ouo.SetDeletedAt(*t) + } + return ouo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ouo *OrganizationUpdateOne) ClearDeletedAt() *OrganizationUpdateOne { + ouo.mutation.ClearDeletedAt() + return ouo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ouo *OrganizationUpdateOne) SetDeletedBy(s string) *OrganizationUpdateOne { + ouo.mutation.SetDeletedBy(s) + return ouo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableDeletedBy(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetDeletedBy(*s) + } + return ouo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ouo *OrganizationUpdateOne) ClearDeletedBy() *OrganizationUpdateOne { + ouo.mutation.ClearDeletedBy() + return ouo +} + +// SetName sets the "name" field. +func (ouo *OrganizationUpdateOne) SetName(s string) *OrganizationUpdateOne { + ouo.mutation.SetName(s) + return ouo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableName(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetName(*s) + } + return ouo +} + +// SetDisplayName sets the "display_name" field. +func (ouo *OrganizationUpdateOne) SetDisplayName(s string) *OrganizationUpdateOne { + ouo.mutation.SetDisplayName(s) + return ouo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableDisplayName(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetDisplayName(*s) + } + return ouo +} + +// SetDescription sets the "description" field. +func (ouo *OrganizationUpdateOne) SetDescription(s string) *OrganizationUpdateOne { + ouo.mutation.SetDescription(s) + return ouo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableDescription(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetDescription(*s) + } + return ouo +} + +// ClearDescription clears the value of the "description" field. +func (ouo *OrganizationUpdateOne) ClearDescription() *OrganizationUpdateOne { + ouo.mutation.ClearDescription() + return ouo +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (ouo *OrganizationUpdateOne) SetAvatarRemoteURL(s string) *OrganizationUpdateOne { + ouo.mutation.SetAvatarRemoteURL(s) + return ouo +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableAvatarRemoteURL(s *string) *OrganizationUpdateOne { + if s != nil { + ouo.SetAvatarRemoteURL(*s) + } + return ouo +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (ouo *OrganizationUpdateOne) ClearAvatarRemoteURL() *OrganizationUpdateOne { + ouo.mutation.ClearAvatarRemoteURL() + return ouo +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (ouo *OrganizationUpdateOne) SetDedicatedDb(b bool) *OrganizationUpdateOne { + ouo.mutation.SetDedicatedDb(b) + return ouo +} + +// SetNillableDedicatedDb sets the "dedicated_db" field if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableDedicatedDb(b *bool) *OrganizationUpdateOne { + if b != nil { + ouo.SetDedicatedDb(*b) + } + return ouo +} + +// AddChildIDs adds the "children" edge to the Organization entity by IDs. +func (ouo *OrganizationUpdateOne) AddChildIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddChildIDs(ids...) + return ouo +} + +// AddChildren adds the "children" edges to the Organization entity. +func (ouo *OrganizationUpdateOne) AddChildren(o ...*Organization) *OrganizationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.AddChildIDs(ids...) +} + +// AddGroupIDs adds the "groups" edge to the Group entity by IDs. +func (ouo *OrganizationUpdateOne) AddGroupIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddGroupIDs(ids...) + return ouo +} + +// AddGroups adds the "groups" edges to the Group entity. +func (ouo *OrganizationUpdateOne) AddGroups(g ...*Group) *OrganizationUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return ouo.AddGroupIDs(ids...) +} + +// AddTemplateIDs adds the "templates" edge to the Template entity by IDs. +func (ouo *OrganizationUpdateOne) AddTemplateIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddTemplateIDs(ids...) + return ouo +} + +// AddTemplates adds the "templates" edges to the Template entity. +func (ouo *OrganizationUpdateOne) AddTemplates(t ...*Template) *OrganizationUpdateOne { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return ouo.AddTemplateIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (ouo *OrganizationUpdateOne) AddIntegrationIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddIntegrationIDs(ids...) + return ouo +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (ouo *OrganizationUpdateOne) AddIntegrations(i ...*Integration) *OrganizationUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ouo.AddIntegrationIDs(ids...) +} + +// SetSettingID sets the "setting" edge to the OrganizationSetting entity by ID. +func (ouo *OrganizationUpdateOne) SetSettingID(id string) *OrganizationUpdateOne { + ouo.mutation.SetSettingID(id) + return ouo +} + +// SetNillableSettingID sets the "setting" edge to the OrganizationSetting entity by ID if the given value is not nil. +func (ouo *OrganizationUpdateOne) SetNillableSettingID(id *string) *OrganizationUpdateOne { + if id != nil { + ouo = ouo.SetSettingID(*id) + } + return ouo +} + +// SetSetting sets the "setting" edge to the OrganizationSetting entity. +func (ouo *OrganizationUpdateOne) SetSetting(o *OrganizationSetting) *OrganizationUpdateOne { + return ouo.SetSettingID(o.ID) +} + +// AddDocumentdatumIDs adds the "documentdata" edge to the DocumentData entity by IDs. +func (ouo *OrganizationUpdateOne) AddDocumentdatumIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddDocumentdatumIDs(ids...) + return ouo +} + +// AddDocumentdata adds the "documentdata" edges to the DocumentData entity. +func (ouo *OrganizationUpdateOne) AddDocumentdata(d ...*DocumentData) *OrganizationUpdateOne { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return ouo.AddDocumentdatumIDs(ids...) +} + +// AddEntitlementIDs adds the "entitlements" edge to the Entitlement entity by IDs. +func (ouo *OrganizationUpdateOne) AddEntitlementIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddEntitlementIDs(ids...) + return ouo +} + +// AddEntitlements adds the "entitlements" edges to the Entitlement entity. +func (ouo *OrganizationUpdateOne) AddEntitlements(e ...*Entitlement) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.AddEntitlementIDs(ids...) +} + +// AddOrganizationEntitlementIDs adds the "organization_entitlement" edge to the Entitlement entity by IDs. +func (ouo *OrganizationUpdateOne) AddOrganizationEntitlementIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddOrganizationEntitlementIDs(ids...) + return ouo +} + +// AddOrganizationEntitlement adds the "organization_entitlement" edges to the Entitlement entity. +func (ouo *OrganizationUpdateOne) AddOrganizationEntitlement(e ...*Entitlement) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.AddOrganizationEntitlementIDs(ids...) +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (ouo *OrganizationUpdateOne) AddPersonalAccessTokenIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddPersonalAccessTokenIDs(ids...) + return ouo +} + +// AddPersonalAccessTokens adds the "personal_access_tokens" edges to the PersonalAccessToken entity. +func (ouo *OrganizationUpdateOne) AddPersonalAccessTokens(p ...*PersonalAccessToken) *OrganizationUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return ouo.AddPersonalAccessTokenIDs(ids...) +} + +// AddAPITokenIDs adds the "api_tokens" edge to the APIToken entity by IDs. +func (ouo *OrganizationUpdateOne) AddAPITokenIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddAPITokenIDs(ids...) + return ouo +} + +// AddAPITokens adds the "api_tokens" edges to the APIToken entity. +func (ouo *OrganizationUpdateOne) AddAPITokens(a ...*APIToken) *OrganizationUpdateOne { + ids := make([]string, len(a)) + for i := range a { + ids[i] = a[i].ID + } + return ouo.AddAPITokenIDs(ids...) +} + +// AddOauthproviderIDs adds the "oauthprovider" edge to the OauthProvider entity by IDs. +func (ouo *OrganizationUpdateOne) AddOauthproviderIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddOauthproviderIDs(ids...) + return ouo +} + +// AddOauthprovider adds the "oauthprovider" edges to the OauthProvider entity. +func (ouo *OrganizationUpdateOne) AddOauthprovider(o ...*OauthProvider) *OrganizationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.AddOauthproviderIDs(ids...) +} + +// AddUserIDs adds the "users" edge to the User entity by IDs. +func (ouo *OrganizationUpdateOne) AddUserIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddUserIDs(ids...) + return ouo +} + +// AddUsers adds the "users" edges to the User entity. +func (ouo *OrganizationUpdateOne) AddUsers(u ...*User) *OrganizationUpdateOne { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return ouo.AddUserIDs(ids...) +} + +// AddInviteIDs adds the "invites" edge to the Invite entity by IDs. +func (ouo *OrganizationUpdateOne) AddInviteIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddInviteIDs(ids...) + return ouo +} + +// AddInvites adds the "invites" edges to the Invite entity. +func (ouo *OrganizationUpdateOne) AddInvites(i ...*Invite) *OrganizationUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ouo.AddInviteIDs(ids...) +} + +// AddSubscriberIDs adds the "subscribers" edge to the Subscriber entity by IDs. +func (ouo *OrganizationUpdateOne) AddSubscriberIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddSubscriberIDs(ids...) + return ouo +} + +// AddSubscribers adds the "subscribers" edges to the Subscriber entity. +func (ouo *OrganizationUpdateOne) AddSubscribers(s ...*Subscriber) *OrganizationUpdateOne { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return ouo.AddSubscriberIDs(ids...) +} + +// AddWebhookIDs adds the "webhooks" edge to the Webhook entity by IDs. +func (ouo *OrganizationUpdateOne) AddWebhookIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddWebhookIDs(ids...) + return ouo +} + +// AddWebhooks adds the "webhooks" edges to the Webhook entity. +func (ouo *OrganizationUpdateOne) AddWebhooks(w ...*Webhook) *OrganizationUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return ouo.AddWebhookIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (ouo *OrganizationUpdateOne) AddEventIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddEventIDs(ids...) + return ouo +} + +// AddEvents adds the "events" edges to the Event entity. +func (ouo *OrganizationUpdateOne) AddEvents(e ...*Event) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.AddEventIDs(ids...) +} + +// AddSecretIDs adds the "secrets" edge to the Hush entity by IDs. +func (ouo *OrganizationUpdateOne) AddSecretIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddSecretIDs(ids...) + return ouo +} + +// AddSecrets adds the "secrets" edges to the Hush entity. +func (ouo *OrganizationUpdateOne) AddSecrets(h ...*Hush) *OrganizationUpdateOne { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return ouo.AddSecretIDs(ids...) +} + +// AddFeatureIDs adds the "features" edge to the Feature entity by IDs. +func (ouo *OrganizationUpdateOne) AddFeatureIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddFeatureIDs(ids...) + return ouo +} + +// AddFeatures adds the "features" edges to the Feature entity. +func (ouo *OrganizationUpdateOne) AddFeatures(f ...*Feature) *OrganizationUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ouo.AddFeatureIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (ouo *OrganizationUpdateOne) AddFileIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddFileIDs(ids...) + return ouo +} + +// AddFiles adds the "files" edges to the File entity. +func (ouo *OrganizationUpdateOne) AddFiles(f ...*File) *OrganizationUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ouo.AddFileIDs(ids...) +} + +// AddEntitlementplanIDs adds the "entitlementplans" edge to the EntitlementPlan entity by IDs. +func (ouo *OrganizationUpdateOne) AddEntitlementplanIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddEntitlementplanIDs(ids...) + return ouo +} + +// AddEntitlementplans adds the "entitlementplans" edges to the EntitlementPlan entity. +func (ouo *OrganizationUpdateOne) AddEntitlementplans(e ...*EntitlementPlan) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.AddEntitlementplanIDs(ids...) +} + +// AddEntitlementplanfeatureIDs adds the "entitlementplanfeatures" edge to the EntitlementPlanFeature entity by IDs. +func (ouo *OrganizationUpdateOne) AddEntitlementplanfeatureIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddEntitlementplanfeatureIDs(ids...) + return ouo +} + +// AddEntitlementplanfeatures adds the "entitlementplanfeatures" edges to the EntitlementPlanFeature entity. +func (ouo *OrganizationUpdateOne) AddEntitlementplanfeatures(e ...*EntitlementPlanFeature) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.AddEntitlementplanfeatureIDs(ids...) +} + +// AddEntityIDs adds the "entities" edge to the Entity entity by IDs. +func (ouo *OrganizationUpdateOne) AddEntityIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddEntityIDs(ids...) + return ouo +} + +// AddEntities adds the "entities" edges to the Entity entity. +func (ouo *OrganizationUpdateOne) AddEntities(e ...*Entity) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.AddEntityIDs(ids...) +} + +// AddEntitytypeIDs adds the "entitytypes" edge to the EntityType entity by IDs. +func (ouo *OrganizationUpdateOne) AddEntitytypeIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddEntitytypeIDs(ids...) + return ouo +} + +// AddEntitytypes adds the "entitytypes" edges to the EntityType entity. +func (ouo *OrganizationUpdateOne) AddEntitytypes(e ...*EntityType) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.AddEntitytypeIDs(ids...) +} + +// AddContactIDs adds the "contacts" edge to the Contact entity by IDs. +func (ouo *OrganizationUpdateOne) AddContactIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddContactIDs(ids...) + return ouo +} + +// AddContacts adds the "contacts" edges to the Contact entity. +func (ouo *OrganizationUpdateOne) AddContacts(c ...*Contact) *OrganizationUpdateOne { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return ouo.AddContactIDs(ids...) +} + +// AddNoteIDs adds the "notes" edge to the Note entity by IDs. +func (ouo *OrganizationUpdateOne) AddNoteIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddNoteIDs(ids...) + return ouo +} + +// AddNotes adds the "notes" edges to the Note entity. +func (ouo *OrganizationUpdateOne) AddNotes(n ...*Note) *OrganizationUpdateOne { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return ouo.AddNoteIDs(ids...) +} + +// AddMemberIDs adds the "members" edge to the OrgMembership entity by IDs. +func (ouo *OrganizationUpdateOne) AddMemberIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.AddMemberIDs(ids...) + return ouo +} + +// AddMembers adds the "members" edges to the OrgMembership entity. +func (ouo *OrganizationUpdateOne) AddMembers(o ...*OrgMembership) *OrganizationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.AddMemberIDs(ids...) +} + +// Mutation returns the OrganizationMutation object of the builder. +func (ouo *OrganizationUpdateOne) Mutation() *OrganizationMutation { + return ouo.mutation +} + +// ClearChildren clears all "children" edges to the Organization entity. +func (ouo *OrganizationUpdateOne) ClearChildren() *OrganizationUpdateOne { + ouo.mutation.ClearChildren() + return ouo +} + +// RemoveChildIDs removes the "children" edge to Organization entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveChildIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveChildIDs(ids...) + return ouo +} + +// RemoveChildren removes "children" edges to Organization entities. +func (ouo *OrganizationUpdateOne) RemoveChildren(o ...*Organization) *OrganizationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.RemoveChildIDs(ids...) +} + +// ClearGroups clears all "groups" edges to the Group entity. +func (ouo *OrganizationUpdateOne) ClearGroups() *OrganizationUpdateOne { + ouo.mutation.ClearGroups() + return ouo +} + +// RemoveGroupIDs removes the "groups" edge to Group entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveGroupIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveGroupIDs(ids...) + return ouo +} + +// RemoveGroups removes "groups" edges to Group entities. +func (ouo *OrganizationUpdateOne) RemoveGroups(g ...*Group) *OrganizationUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return ouo.RemoveGroupIDs(ids...) +} + +// ClearTemplates clears all "templates" edges to the Template entity. +func (ouo *OrganizationUpdateOne) ClearTemplates() *OrganizationUpdateOne { + ouo.mutation.ClearTemplates() + return ouo +} + +// RemoveTemplateIDs removes the "templates" edge to Template entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveTemplateIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveTemplateIDs(ids...) + return ouo +} + +// RemoveTemplates removes "templates" edges to Template entities. +func (ouo *OrganizationUpdateOne) RemoveTemplates(t ...*Template) *OrganizationUpdateOne { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return ouo.RemoveTemplateIDs(ids...) +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (ouo *OrganizationUpdateOne) ClearIntegrations() *OrganizationUpdateOne { + ouo.mutation.ClearIntegrations() + return ouo +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveIntegrationIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveIntegrationIDs(ids...) + return ouo +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (ouo *OrganizationUpdateOne) RemoveIntegrations(i ...*Integration) *OrganizationUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ouo.RemoveIntegrationIDs(ids...) +} + +// ClearSetting clears the "setting" edge to the OrganizationSetting entity. +func (ouo *OrganizationUpdateOne) ClearSetting() *OrganizationUpdateOne { + ouo.mutation.ClearSetting() + return ouo +} + +// ClearDocumentdata clears all "documentdata" edges to the DocumentData entity. +func (ouo *OrganizationUpdateOne) ClearDocumentdata() *OrganizationUpdateOne { + ouo.mutation.ClearDocumentdata() + return ouo +} + +// RemoveDocumentdatumIDs removes the "documentdata" edge to DocumentData entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveDocumentdatumIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveDocumentdatumIDs(ids...) + return ouo +} + +// RemoveDocumentdata removes "documentdata" edges to DocumentData entities. +func (ouo *OrganizationUpdateOne) RemoveDocumentdata(d ...*DocumentData) *OrganizationUpdateOne { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return ouo.RemoveDocumentdatumIDs(ids...) +} + +// ClearEntitlements clears all "entitlements" edges to the Entitlement entity. +func (ouo *OrganizationUpdateOne) ClearEntitlements() *OrganizationUpdateOne { + ouo.mutation.ClearEntitlements() + return ouo +} + +// RemoveEntitlementIDs removes the "entitlements" edge to Entitlement entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveEntitlementIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveEntitlementIDs(ids...) + return ouo +} + +// RemoveEntitlements removes "entitlements" edges to Entitlement entities. +func (ouo *OrganizationUpdateOne) RemoveEntitlements(e ...*Entitlement) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.RemoveEntitlementIDs(ids...) +} + +// ClearOrganizationEntitlement clears all "organization_entitlement" edges to the Entitlement entity. +func (ouo *OrganizationUpdateOne) ClearOrganizationEntitlement() *OrganizationUpdateOne { + ouo.mutation.ClearOrganizationEntitlement() + return ouo +} + +// RemoveOrganizationEntitlementIDs removes the "organization_entitlement" edge to Entitlement entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveOrganizationEntitlementIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveOrganizationEntitlementIDs(ids...) + return ouo +} + +// RemoveOrganizationEntitlement removes "organization_entitlement" edges to Entitlement entities. +func (ouo *OrganizationUpdateOne) RemoveOrganizationEntitlement(e ...*Entitlement) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.RemoveOrganizationEntitlementIDs(ids...) +} + +// ClearPersonalAccessTokens clears all "personal_access_tokens" edges to the PersonalAccessToken entity. +func (ouo *OrganizationUpdateOne) ClearPersonalAccessTokens() *OrganizationUpdateOne { + ouo.mutation.ClearPersonalAccessTokens() + return ouo +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_tokens" edge to PersonalAccessToken entities by IDs. +func (ouo *OrganizationUpdateOne) RemovePersonalAccessTokenIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemovePersonalAccessTokenIDs(ids...) + return ouo +} + +// RemovePersonalAccessTokens removes "personal_access_tokens" edges to PersonalAccessToken entities. +func (ouo *OrganizationUpdateOne) RemovePersonalAccessTokens(p ...*PersonalAccessToken) *OrganizationUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return ouo.RemovePersonalAccessTokenIDs(ids...) +} + +// ClearAPITokens clears all "api_tokens" edges to the APIToken entity. +func (ouo *OrganizationUpdateOne) ClearAPITokens() *OrganizationUpdateOne { + ouo.mutation.ClearAPITokens() + return ouo +} + +// RemoveAPITokenIDs removes the "api_tokens" edge to APIToken entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveAPITokenIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveAPITokenIDs(ids...) + return ouo +} + +// RemoveAPITokens removes "api_tokens" edges to APIToken entities. +func (ouo *OrganizationUpdateOne) RemoveAPITokens(a ...*APIToken) *OrganizationUpdateOne { + ids := make([]string, len(a)) + for i := range a { + ids[i] = a[i].ID + } + return ouo.RemoveAPITokenIDs(ids...) +} + +// ClearOauthprovider clears all "oauthprovider" edges to the OauthProvider entity. +func (ouo *OrganizationUpdateOne) ClearOauthprovider() *OrganizationUpdateOne { + ouo.mutation.ClearOauthprovider() + return ouo +} + +// RemoveOauthproviderIDs removes the "oauthprovider" edge to OauthProvider entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveOauthproviderIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveOauthproviderIDs(ids...) + return ouo +} + +// RemoveOauthprovider removes "oauthprovider" edges to OauthProvider entities. +func (ouo *OrganizationUpdateOne) RemoveOauthprovider(o ...*OauthProvider) *OrganizationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.RemoveOauthproviderIDs(ids...) +} + +// ClearUsers clears all "users" edges to the User entity. +func (ouo *OrganizationUpdateOne) ClearUsers() *OrganizationUpdateOne { + ouo.mutation.ClearUsers() + return ouo +} + +// RemoveUserIDs removes the "users" edge to User entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveUserIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveUserIDs(ids...) + return ouo +} + +// RemoveUsers removes "users" edges to User entities. +func (ouo *OrganizationUpdateOne) RemoveUsers(u ...*User) *OrganizationUpdateOne { + ids := make([]string, len(u)) + for i := range u { + ids[i] = u[i].ID + } + return ouo.RemoveUserIDs(ids...) +} + +// ClearInvites clears all "invites" edges to the Invite entity. +func (ouo *OrganizationUpdateOne) ClearInvites() *OrganizationUpdateOne { + ouo.mutation.ClearInvites() + return ouo +} + +// RemoveInviteIDs removes the "invites" edge to Invite entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveInviteIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveInviteIDs(ids...) + return ouo +} + +// RemoveInvites removes "invites" edges to Invite entities. +func (ouo *OrganizationUpdateOne) RemoveInvites(i ...*Invite) *OrganizationUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return ouo.RemoveInviteIDs(ids...) +} + +// ClearSubscribers clears all "subscribers" edges to the Subscriber entity. +func (ouo *OrganizationUpdateOne) ClearSubscribers() *OrganizationUpdateOne { + ouo.mutation.ClearSubscribers() + return ouo +} + +// RemoveSubscriberIDs removes the "subscribers" edge to Subscriber entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveSubscriberIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveSubscriberIDs(ids...) + return ouo +} + +// RemoveSubscribers removes "subscribers" edges to Subscriber entities. +func (ouo *OrganizationUpdateOne) RemoveSubscribers(s ...*Subscriber) *OrganizationUpdateOne { + ids := make([]string, len(s)) + for i := range s { + ids[i] = s[i].ID + } + return ouo.RemoveSubscriberIDs(ids...) +} + +// ClearWebhooks clears all "webhooks" edges to the Webhook entity. +func (ouo *OrganizationUpdateOne) ClearWebhooks() *OrganizationUpdateOne { + ouo.mutation.ClearWebhooks() + return ouo +} + +// RemoveWebhookIDs removes the "webhooks" edge to Webhook entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveWebhookIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveWebhookIDs(ids...) + return ouo +} + +// RemoveWebhooks removes "webhooks" edges to Webhook entities. +func (ouo *OrganizationUpdateOne) RemoveWebhooks(w ...*Webhook) *OrganizationUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return ouo.RemoveWebhookIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (ouo *OrganizationUpdateOne) ClearEvents() *OrganizationUpdateOne { + ouo.mutation.ClearEvents() + return ouo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveEventIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveEventIDs(ids...) + return ouo +} + +// RemoveEvents removes "events" edges to Event entities. +func (ouo *OrganizationUpdateOne) RemoveEvents(e ...*Event) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.RemoveEventIDs(ids...) +} + +// ClearSecrets clears all "secrets" edges to the Hush entity. +func (ouo *OrganizationUpdateOne) ClearSecrets() *OrganizationUpdateOne { + ouo.mutation.ClearSecrets() + return ouo +} + +// RemoveSecretIDs removes the "secrets" edge to Hush entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveSecretIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveSecretIDs(ids...) + return ouo +} + +// RemoveSecrets removes "secrets" edges to Hush entities. +func (ouo *OrganizationUpdateOne) RemoveSecrets(h ...*Hush) *OrganizationUpdateOne { + ids := make([]string, len(h)) + for i := range h { + ids[i] = h[i].ID + } + return ouo.RemoveSecretIDs(ids...) +} + +// ClearFeatures clears all "features" edges to the Feature entity. +func (ouo *OrganizationUpdateOne) ClearFeatures() *OrganizationUpdateOne { + ouo.mutation.ClearFeatures() + return ouo +} + +// RemoveFeatureIDs removes the "features" edge to Feature entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveFeatureIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveFeatureIDs(ids...) + return ouo +} + +// RemoveFeatures removes "features" edges to Feature entities. +func (ouo *OrganizationUpdateOne) RemoveFeatures(f ...*Feature) *OrganizationUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ouo.RemoveFeatureIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (ouo *OrganizationUpdateOne) ClearFiles() *OrganizationUpdateOne { + ouo.mutation.ClearFiles() + return ouo +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveFileIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveFileIDs(ids...) + return ouo +} + +// RemoveFiles removes "files" edges to File entities. +func (ouo *OrganizationUpdateOne) RemoveFiles(f ...*File) *OrganizationUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return ouo.RemoveFileIDs(ids...) +} + +// ClearEntitlementplans clears all "entitlementplans" edges to the EntitlementPlan entity. +func (ouo *OrganizationUpdateOne) ClearEntitlementplans() *OrganizationUpdateOne { + ouo.mutation.ClearEntitlementplans() + return ouo +} + +// RemoveEntitlementplanIDs removes the "entitlementplans" edge to EntitlementPlan entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveEntitlementplanIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveEntitlementplanIDs(ids...) + return ouo +} + +// RemoveEntitlementplans removes "entitlementplans" edges to EntitlementPlan entities. +func (ouo *OrganizationUpdateOne) RemoveEntitlementplans(e ...*EntitlementPlan) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.RemoveEntitlementplanIDs(ids...) +} + +// ClearEntitlementplanfeatures clears all "entitlementplanfeatures" edges to the EntitlementPlanFeature entity. +func (ouo *OrganizationUpdateOne) ClearEntitlementplanfeatures() *OrganizationUpdateOne { + ouo.mutation.ClearEntitlementplanfeatures() + return ouo +} + +// RemoveEntitlementplanfeatureIDs removes the "entitlementplanfeatures" edge to EntitlementPlanFeature entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveEntitlementplanfeatureIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveEntitlementplanfeatureIDs(ids...) + return ouo +} + +// RemoveEntitlementplanfeatures removes "entitlementplanfeatures" edges to EntitlementPlanFeature entities. +func (ouo *OrganizationUpdateOne) RemoveEntitlementplanfeatures(e ...*EntitlementPlanFeature) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.RemoveEntitlementplanfeatureIDs(ids...) +} + +// ClearEntities clears all "entities" edges to the Entity entity. +func (ouo *OrganizationUpdateOne) ClearEntities() *OrganizationUpdateOne { + ouo.mutation.ClearEntities() + return ouo +} + +// RemoveEntityIDs removes the "entities" edge to Entity entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveEntityIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveEntityIDs(ids...) + return ouo +} + +// RemoveEntities removes "entities" edges to Entity entities. +func (ouo *OrganizationUpdateOne) RemoveEntities(e ...*Entity) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.RemoveEntityIDs(ids...) +} + +// ClearEntitytypes clears all "entitytypes" edges to the EntityType entity. +func (ouo *OrganizationUpdateOne) ClearEntitytypes() *OrganizationUpdateOne { + ouo.mutation.ClearEntitytypes() + return ouo +} + +// RemoveEntitytypeIDs removes the "entitytypes" edge to EntityType entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveEntitytypeIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveEntitytypeIDs(ids...) + return ouo +} + +// RemoveEntitytypes removes "entitytypes" edges to EntityType entities. +func (ouo *OrganizationUpdateOne) RemoveEntitytypes(e ...*EntityType) *OrganizationUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return ouo.RemoveEntitytypeIDs(ids...) +} + +// ClearContacts clears all "contacts" edges to the Contact entity. +func (ouo *OrganizationUpdateOne) ClearContacts() *OrganizationUpdateOne { + ouo.mutation.ClearContacts() + return ouo +} + +// RemoveContactIDs removes the "contacts" edge to Contact entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveContactIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveContactIDs(ids...) + return ouo +} + +// RemoveContacts removes "contacts" edges to Contact entities. +func (ouo *OrganizationUpdateOne) RemoveContacts(c ...*Contact) *OrganizationUpdateOne { + ids := make([]string, len(c)) + for i := range c { + ids[i] = c[i].ID + } + return ouo.RemoveContactIDs(ids...) +} + +// ClearNotes clears all "notes" edges to the Note entity. +func (ouo *OrganizationUpdateOne) ClearNotes() *OrganizationUpdateOne { + ouo.mutation.ClearNotes() + return ouo +} + +// RemoveNoteIDs removes the "notes" edge to Note entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveNoteIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveNoteIDs(ids...) + return ouo +} + +// RemoveNotes removes "notes" edges to Note entities. +func (ouo *OrganizationUpdateOne) RemoveNotes(n ...*Note) *OrganizationUpdateOne { + ids := make([]string, len(n)) + for i := range n { + ids[i] = n[i].ID + } + return ouo.RemoveNoteIDs(ids...) +} + +// ClearMembers clears all "members" edges to the OrgMembership entity. +func (ouo *OrganizationUpdateOne) ClearMembers() *OrganizationUpdateOne { + ouo.mutation.ClearMembers() + return ouo +} + +// RemoveMemberIDs removes the "members" edge to OrgMembership entities by IDs. +func (ouo *OrganizationUpdateOne) RemoveMemberIDs(ids ...string) *OrganizationUpdateOne { + ouo.mutation.RemoveMemberIDs(ids...) + return ouo +} + +// RemoveMembers removes "members" edges to OrgMembership entities. +func (ouo *OrganizationUpdateOne) RemoveMembers(o ...*OrgMembership) *OrganizationUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return ouo.RemoveMemberIDs(ids...) +} + +// Where appends a list predicates to the OrganizationUpdate builder. +func (ouo *OrganizationUpdateOne) Where(ps ...predicate.Organization) *OrganizationUpdateOne { + ouo.mutation.Where(ps...) + return ouo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ouo *OrganizationUpdateOne) Select(field string, fields ...string) *OrganizationUpdateOne { + ouo.fields = append([]string{field}, fields...) + return ouo +} + +// Save executes the query and returns the updated Organization entity. +func (ouo *OrganizationUpdateOne) Save(ctx context.Context) (*Organization, error) { + if err := ouo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ouo.sqlSave, ouo.mutation, ouo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ouo *OrganizationUpdateOne) SaveX(ctx context.Context) *Organization { + node, err := ouo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ouo *OrganizationUpdateOne) Exec(ctx context.Context) error { + _, err := ouo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ouo *OrganizationUpdateOne) ExecX(ctx context.Context) { + if err := ouo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ouo *OrganizationUpdateOne) defaults() error { + if _, ok := ouo.mutation.UpdatedAt(); !ok && !ouo.mutation.UpdatedAtCleared() { + if organization.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organization.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organization.UpdateDefaultUpdatedAt() + ouo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ouo *OrganizationUpdateOne) check() error { + if v, ok := ouo.mutation.Name(); ok { + if err := organization.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Organization.name": %w`, err)} + } + } + if v, ok := ouo.mutation.DisplayName(); ok { + if err := organization.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "Organization.display_name": %w`, err)} + } + } + if v, ok := ouo.mutation.AvatarRemoteURL(); ok { + if err := organization.AvatarRemoteURLValidator(v); err != nil { + return &ValidationError{Name: "avatar_remote_url", err: fmt.Errorf(`generated: validator failed for field "Organization.avatar_remote_url": %w`, err)} + } + } + return nil +} + +func (ouo *OrganizationUpdateOne) sqlSave(ctx context.Context) (_node *Organization, err error) { + if err := ouo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString)) + id, ok := ouo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Organization.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ouo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organization.FieldID) + for _, f := range fields { + if !organization.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != organization.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ouo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ouo.mutation.CreatedAtCleared() { + _spec.ClearField(organization.FieldCreatedAt, field.TypeTime) + } + if value, ok := ouo.mutation.UpdatedAt(); ok { + _spec.SetField(organization.FieldUpdatedAt, field.TypeTime, value) + } + if ouo.mutation.UpdatedAtCleared() { + _spec.ClearField(organization.FieldUpdatedAt, field.TypeTime) + } + if ouo.mutation.CreatedByCleared() { + _spec.ClearField(organization.FieldCreatedBy, field.TypeString) + } + if value, ok := ouo.mutation.UpdatedBy(); ok { + _spec.SetField(organization.FieldUpdatedBy, field.TypeString, value) + } + if ouo.mutation.UpdatedByCleared() { + _spec.ClearField(organization.FieldUpdatedBy, field.TypeString) + } + if value, ok := ouo.mutation.Tags(); ok { + _spec.SetField(organization.FieldTags, field.TypeJSON, value) + } + if value, ok := ouo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organization.FieldTags, value) + }) + } + if ouo.mutation.TagsCleared() { + _spec.ClearField(organization.FieldTags, field.TypeJSON) + } + if value, ok := ouo.mutation.DeletedAt(); ok { + _spec.SetField(organization.FieldDeletedAt, field.TypeTime, value) + } + if ouo.mutation.DeletedAtCleared() { + _spec.ClearField(organization.FieldDeletedAt, field.TypeTime) + } + if value, ok := ouo.mutation.DeletedBy(); ok { + _spec.SetField(organization.FieldDeletedBy, field.TypeString, value) + } + if ouo.mutation.DeletedByCleared() { + _spec.ClearField(organization.FieldDeletedBy, field.TypeString) + } + if value, ok := ouo.mutation.Name(); ok { + _spec.SetField(organization.FieldName, field.TypeString, value) + } + if value, ok := ouo.mutation.DisplayName(); ok { + _spec.SetField(organization.FieldDisplayName, field.TypeString, value) + } + if value, ok := ouo.mutation.Description(); ok { + _spec.SetField(organization.FieldDescription, field.TypeString, value) + } + if ouo.mutation.DescriptionCleared() { + _spec.ClearField(organization.FieldDescription, field.TypeString) + } + if ouo.mutation.PersonalOrgCleared() { + _spec.ClearField(organization.FieldPersonalOrg, field.TypeBool) + } + if value, ok := ouo.mutation.AvatarRemoteURL(); ok { + _spec.SetField(organization.FieldAvatarRemoteURL, field.TypeString, value) + } + if ouo.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(organization.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := ouo.mutation.DedicatedDb(); ok { + _spec.SetField(organization.FieldDedicatedDb, field.TypeBool, value) + } + if ouo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Organization + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedChildrenIDs(); len(nodes) > 0 && !ouo.mutation.ChildrenCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Organization + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.ChildrenIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ChildrenTable, + Columns: []string{organization.ChildrenColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Organization + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Group + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedGroupsIDs(); len(nodes) > 0 && !ouo.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.GroupsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.GroupsTable, + Columns: []string{organization.GroupsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Group + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.TemplatesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Template + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedTemplatesIDs(); len(nodes) > 0 && !ouo.mutation.TemplatesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.TemplatesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.TemplatesTable, + Columns: []string{organization.TemplatesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(template.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Integration + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !ouo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.IntegrationsTable, + Columns: []string{organization.IntegrationsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Integration + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.SettingCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: organization.SettingTable, + Columns: []string{organization.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: organization.SettingTable, + Columns: []string{organization.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.DocumentdataCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedDocumentdataIDs(); len(nodes) > 0 && !ouo.mutation.DocumentdataCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.DocumentdataIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.DocumentdataTable, + Columns: []string{organization.DocumentdataColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedEntitlementsIDs(); len(nodes) > 0 && !ouo.mutation.EntitlementsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.EntitlementsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementsTable, + Columns: []string{organization.EntitlementsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.OrganizationEntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entitlement + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedOrganizationEntitlementIDs(); len(nodes) > 0 && !ouo.mutation.OrganizationEntitlementCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.OrganizationEntitlementIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OrganizationEntitlementTable, + Columns: []string{organization.OrganizationEntitlementColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlement.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entitlement + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationPersonalAccessTokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedPersonalAccessTokensIDs(); len(nodes) > 0 && !ouo.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.PersonalAccessTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.PersonalAccessTokensTable, + Columns: organization.PersonalAccessTokensPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.APITokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.APIToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedAPITokensIDs(); len(nodes) > 0 && !ouo.mutation.APITokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.APITokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.APITokensTable, + Columns: []string{organization.APITokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(apitoken.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.APIToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.OauthproviderCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OauthProvider + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedOauthproviderIDs(); len(nodes) > 0 && !ouo.mutation.OauthproviderCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.OauthproviderIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.OauthproviderTable, + Columns: []string{organization.OauthproviderColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(oauthprovider.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OauthProvider + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrgMembership + createE := &OrgMembershipCreate{config: ouo.config, mutation: newOrgMembershipMutation(ouo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedUsersIDs(); len(nodes) > 0 && !ouo.mutation.UsersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: ouo.config, mutation: newOrgMembershipMutation(ouo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.UsersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: organization.UsersTable, + Columns: organization.UsersPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: ouo.config, mutation: newOrgMembershipMutation(ouo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.InvitesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Invite + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedInvitesIDs(); len(nodes) > 0 && !ouo.mutation.InvitesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.InvitesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.InvitesTable, + Columns: []string{organization.InvitesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(invite.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Invite + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.SubscribersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Subscriber + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedSubscribersIDs(); len(nodes) > 0 && !ouo.mutation.SubscribersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.SubscribersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.SubscribersTable, + Columns: []string{organization.SubscribersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Webhook + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedWebhooksIDs(); len(nodes) > 0 && !ouo.mutation.WebhooksCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.WebhooksIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.WebhooksTable, + Columns: []string{organization.WebhooksColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !ouo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.EventsTable, + Columns: organization.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationSecrets + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedSecretsIDs(); len(nodes) > 0 && !ouo.mutation.SecretsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.SecretsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.SecretsTable, + Columns: organization.SecretsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(hush.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationSecrets + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Feature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedFeaturesIDs(); len(nodes) > 0 && !ouo.mutation.FeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.FeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.FeaturesTable, + Columns: []string{organization.FeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(feature.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Feature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationFiles + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedFilesIDs(); len(nodes) > 0 && !ouo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: organization.FilesTable, + Columns: organization.FilesPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrganizationFiles + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.EntitlementplansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntitlementPlan + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedEntitlementplansIDs(); len(nodes) > 0 && !ouo.mutation.EntitlementplansCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.EntitlementplansIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplansTable, + Columns: []string{organization.EntitlementplansColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplan.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntitlementPlan + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.EntitlementplanfeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntitlementPlanFeature + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedEntitlementplanfeaturesIDs(); len(nodes) > 0 && !ouo.mutation.EntitlementplanfeaturesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.EntitlementplanfeaturesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitlementplanfeaturesTable, + Columns: []string{organization.EntitlementplanfeaturesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitlementplanfeature.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntitlementPlanFeature + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entity + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedEntitiesIDs(); len(nodes) > 0 && !ouo.mutation.EntitiesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.EntitiesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitiesTable, + Columns: []string{organization.EntitiesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entity.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Entity + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.EntitytypesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntityType + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedEntitytypesIDs(); len(nodes) > 0 && !ouo.mutation.EntitytypesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.EntitytypesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.EntitytypesTable, + Columns: []string{organization.EntitytypesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(entitytype.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.EntityType + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Contact + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedContactsIDs(); len(nodes) > 0 && !ouo.mutation.ContactsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.ContactsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.ContactsTable, + Columns: []string{organization.ContactsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(contact.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Contact + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Note + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedNotesIDs(); len(nodes) > 0 && !ouo.mutation.NotesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.NotesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: organization.NotesTable, + Columns: []string{organization.NotesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(note.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.Note + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if ouo.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrgMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.RemovedMembersIDs(); len(nodes) > 0 && !ouo.mutation.MembersCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := ouo.mutation.MembersIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: organization.MembersTable, + Columns: []string{organization.MembersColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = ouo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = ouo.schemaConfig.Organization + ctx = internal.NewSchemaConfigContext(ctx, ouo.schemaConfig) + _node = &Organization{config: ouo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ouo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organization.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ouo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/organizationhistory.go b/internal/ent/generated/organizationhistory.go new file mode 100644 index 0000000..79ab1b2 --- /dev/null +++ b/internal/ent/generated/organizationhistory.go @@ -0,0 +1,304 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/entx/history" +) + +// OrganizationHistory is the model entity for the OrganizationHistory schema. +type OrganizationHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // the name of the organization + Name string `json:"name,omitempty"` + // The organization's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + // An optional description of the organization + Description string `json:"description,omitempty"` + // The ID of the parent organization for the organization. + ParentOrganizationID string `json:"parent_organization_id,omitempty"` + // orgs directly associated with a user + PersonalOrg bool `json:"personal_org,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatar_remote_url,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb bool `json:"dedicated_db,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OrganizationHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case organizationhistory.FieldTags: + values[i] = new([]byte) + case organizationhistory.FieldOperation: + values[i] = new(history.OpType) + case organizationhistory.FieldPersonalOrg, organizationhistory.FieldDedicatedDb: + values[i] = new(sql.NullBool) + case organizationhistory.FieldID, organizationhistory.FieldRef, organizationhistory.FieldCreatedBy, organizationhistory.FieldUpdatedBy, organizationhistory.FieldMappingID, organizationhistory.FieldDeletedBy, organizationhistory.FieldName, organizationhistory.FieldDisplayName, organizationhistory.FieldDescription, organizationhistory.FieldParentOrganizationID, organizationhistory.FieldAvatarRemoteURL: + values[i] = new(sql.NullString) + case organizationhistory.FieldHistoryTime, organizationhistory.FieldCreatedAt, organizationhistory.FieldUpdatedAt, organizationhistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OrganizationHistory fields. +func (oh *OrganizationHistory) 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 organizationhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + oh.ID = value.String + } + case organizationhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + oh.HistoryTime = value.Time + } + case organizationhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + oh.Ref = value.String + } + case organizationhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + oh.Operation = *value + } + case organizationhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + oh.CreatedAt = value.Time + } + case organizationhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + oh.UpdatedAt = value.Time + } + case organizationhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + oh.CreatedBy = value.String + } + case organizationhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + oh.UpdatedBy = value.String + } + case organizationhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + oh.MappingID = value.String + } + case organizationhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &oh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case organizationhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + oh.DeletedAt = value.Time + } + case organizationhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + oh.DeletedBy = value.String + } + case organizationhistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + oh.Name = value.String + } + case organizationhistory.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + oh.DisplayName = value.String + } + case organizationhistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + oh.Description = value.String + } + case organizationhistory.FieldParentOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field parent_organization_id", values[i]) + } else if value.Valid { + oh.ParentOrganizationID = value.String + } + case organizationhistory.FieldPersonalOrg: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field personal_org", values[i]) + } else if value.Valid { + oh.PersonalOrg = value.Bool + } + case organizationhistory.FieldAvatarRemoteURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field avatar_remote_url", values[i]) + } else if value.Valid { + oh.AvatarRemoteURL = new(string) + *oh.AvatarRemoteURL = value.String + } + case organizationhistory.FieldDedicatedDb: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field dedicated_db", values[i]) + } else if value.Valid { + oh.DedicatedDb = value.Bool + } + default: + oh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OrganizationHistory. +// This includes values selected through modifiers, order, etc. +func (oh *OrganizationHistory) Value(name string) (ent.Value, error) { + return oh.selectValues.Get(name) +} + +// Update returns a builder for updating this OrganizationHistory. +// Note that you need to call OrganizationHistory.Unwrap() before calling this method if this OrganizationHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (oh *OrganizationHistory) Update() *OrganizationHistoryUpdateOne { + return NewOrganizationHistoryClient(oh.config).UpdateOne(oh) +} + +// Unwrap unwraps the OrganizationHistory 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 (oh *OrganizationHistory) Unwrap() *OrganizationHistory { + _tx, ok := oh.config.driver.(*txDriver) + if !ok { + panic("generated: OrganizationHistory is not a transactional entity") + } + oh.config.driver = _tx.drv + return oh +} + +// String implements the fmt.Stringer. +func (oh *OrganizationHistory) String() string { + var builder strings.Builder + builder.WriteString("OrganizationHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", oh.ID)) + builder.WriteString("history_time=") + builder.WriteString(oh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(oh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", oh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(oh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(oh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(oh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(oh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(oh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", oh.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(oh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(oh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(oh.Name) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(oh.DisplayName) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(oh.Description) + builder.WriteString(", ") + builder.WriteString("parent_organization_id=") + builder.WriteString(oh.ParentOrganizationID) + builder.WriteString(", ") + builder.WriteString("personal_org=") + builder.WriteString(fmt.Sprintf("%v", oh.PersonalOrg)) + builder.WriteString(", ") + if v := oh.AvatarRemoteURL; v != nil { + builder.WriteString("avatar_remote_url=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("dedicated_db=") + builder.WriteString(fmt.Sprintf("%v", oh.DedicatedDb)) + builder.WriteByte(')') + return builder.String() +} + +// OrganizationHistories is a parsable slice of OrganizationHistory. +type OrganizationHistories []*OrganizationHistory diff --git a/internal/ent/generated/organizationhistory/organizationhistory.go b/internal/ent/generated/organizationhistory/organizationhistory.go new file mode 100644 index 0000000..b31a46d --- /dev/null +++ b/internal/ent/generated/organizationhistory/organizationhistory.go @@ -0,0 +1,232 @@ +// Code generated by ent, DO NOT EDIT. + +package organizationhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the organizationhistory type in the database. + Label = "organization_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldParentOrganizationID holds the string denoting the parent_organization_id field in the database. + FieldParentOrganizationID = "parent_organization_id" + // FieldPersonalOrg holds the string denoting the personal_org field in the database. + FieldPersonalOrg = "personal_org" + // FieldAvatarRemoteURL holds the string denoting the avatar_remote_url field in the database. + FieldAvatarRemoteURL = "avatar_remote_url" + // FieldDedicatedDb holds the string denoting the dedicated_db field in the database. + FieldDedicatedDb = "dedicated_db" + // Table holds the table name of the organizationhistory in the database. + Table = "organization_history" +) + +// Columns holds all SQL columns for organizationhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldName, + FieldDisplayName, + FieldDescription, + FieldParentOrganizationID, + FieldPersonalOrg, + FieldAvatarRemoteURL, + FieldDedicatedDb, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultDisplayName holds the default value on creation for the "display_name" field. + DefaultDisplayName string + // DefaultPersonalOrg holds the default value on creation for the "personal_org" field. + DefaultPersonalOrg bool + // DefaultDedicatedDb holds the default value on creation for the "dedicated_db" field. + DefaultDedicatedDb bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("organizationhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the OrganizationHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByParentOrganizationID orders the results by the parent_organization_id field. +func ByParentOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldParentOrganizationID, opts...).ToFunc() +} + +// ByPersonalOrg orders the results by the personal_org field. +func ByPersonalOrg(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPersonalOrg, opts...).ToFunc() +} + +// ByAvatarRemoteURL orders the results by the avatar_remote_url field. +func ByAvatarRemoteURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarRemoteURL, opts...).ToFunc() +} + +// ByDedicatedDb orders the results by the dedicated_db field. +func ByDedicatedDb(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDedicatedDb, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/organizationhistory/where.go b/internal/ent/generated/organizationhistory/where.go new file mode 100644 index 0000000..414e2c0 --- /dev/null +++ b/internal/ent/generated/organizationhistory/where.go @@ -0,0 +1,1131 @@ +// Code generated by ent, DO NOT EDIT. + +package organizationhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDescription, v)) +} + +// ParentOrganizationID applies equality check predicate on the "parent_organization_id" field. It's identical to ParentOrganizationIDEQ. +func ParentOrganizationID(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldParentOrganizationID, v)) +} + +// PersonalOrg applies equality check predicate on the "personal_org" field. It's identical to PersonalOrgEQ. +func PersonalOrg(v bool) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldPersonalOrg, v)) +} + +// AvatarRemoteURL applies equality check predicate on the "avatar_remote_url" field. It's identical to AvatarRemoteURLEQ. +func AvatarRemoteURL(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// DedicatedDb applies equality check predicate on the "dedicated_db" field. It's identical to DedicatedDbEQ. +func DedicatedDb(v bool) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDedicatedDb, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// ParentOrganizationIDEQ applies the EQ predicate on the "parent_organization_id" field. +func ParentOrganizationIDEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDNEQ applies the NEQ predicate on the "parent_organization_id" field. +func ParentOrganizationIDNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDIn applies the In predicate on the "parent_organization_id" field. +func ParentOrganizationIDIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldParentOrganizationID, vs...)) +} + +// ParentOrganizationIDNotIn applies the NotIn predicate on the "parent_organization_id" field. +func ParentOrganizationIDNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldParentOrganizationID, vs...)) +} + +// ParentOrganizationIDGT applies the GT predicate on the "parent_organization_id" field. +func ParentOrganizationIDGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDGTE applies the GTE predicate on the "parent_organization_id" field. +func ParentOrganizationIDGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDLT applies the LT predicate on the "parent_organization_id" field. +func ParentOrganizationIDLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDLTE applies the LTE predicate on the "parent_organization_id" field. +func ParentOrganizationIDLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDContains applies the Contains predicate on the "parent_organization_id" field. +func ParentOrganizationIDContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDHasPrefix applies the HasPrefix predicate on the "parent_organization_id" field. +func ParentOrganizationIDHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDHasSuffix applies the HasSuffix predicate on the "parent_organization_id" field. +func ParentOrganizationIDHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDIsNil applies the IsNil predicate on the "parent_organization_id" field. +func ParentOrganizationIDIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldParentOrganizationID)) +} + +// ParentOrganizationIDNotNil applies the NotNil predicate on the "parent_organization_id" field. +func ParentOrganizationIDNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldParentOrganizationID)) +} + +// ParentOrganizationIDEqualFold applies the EqualFold predicate on the "parent_organization_id" field. +func ParentOrganizationIDEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldParentOrganizationID, v)) +} + +// ParentOrganizationIDContainsFold applies the ContainsFold predicate on the "parent_organization_id" field. +func ParentOrganizationIDContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldParentOrganizationID, v)) +} + +// PersonalOrgEQ applies the EQ predicate on the "personal_org" field. +func PersonalOrgEQ(v bool) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldPersonalOrg, v)) +} + +// PersonalOrgNEQ applies the NEQ predicate on the "personal_org" field. +func PersonalOrgNEQ(v bool) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldPersonalOrg, v)) +} + +// PersonalOrgIsNil applies the IsNil predicate on the "personal_org" field. +func PersonalOrgIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldPersonalOrg)) +} + +// PersonalOrgNotNil applies the NotNil predicate on the "personal_org" field. +func PersonalOrgNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldPersonalOrg)) +} + +// AvatarRemoteURLEQ applies the EQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLNEQ applies the NEQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNEQ(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIn applies the In predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLNotIn applies the NotIn predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotIn(vs ...string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLGT applies the GT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLGTE applies the GTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldGTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLT applies the LT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLT(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLTE applies the LTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLTE(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldLTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContains applies the Contains predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContains(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContains(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasPrefix applies the HasPrefix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasPrefix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasPrefix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasSuffix applies the HasSuffix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasSuffix(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldHasSuffix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIsNil applies the IsNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIsNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldIsNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLNotNil applies the NotNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotNil() predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNotNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLEqualFold applies the EqualFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEqualFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEqualFold(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContainsFold applies the ContainsFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContainsFold(v string) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldContainsFold(FieldAvatarRemoteURL, v)) +} + +// DedicatedDbEQ applies the EQ predicate on the "dedicated_db" field. +func DedicatedDbEQ(v bool) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldEQ(FieldDedicatedDb, v)) +} + +// DedicatedDbNEQ applies the NEQ predicate on the "dedicated_db" field. +func DedicatedDbNEQ(v bool) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.FieldNEQ(FieldDedicatedDb, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.OrganizationHistory) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OrganizationHistory) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OrganizationHistory) predicate.OrganizationHistory { + return predicate.OrganizationHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/organizationhistory_create.go b/internal/ent/generated/organizationhistory_create.go new file mode 100644 index 0000000..7314cc7 --- /dev/null +++ b/internal/ent/generated/organizationhistory_create.go @@ -0,0 +1,575 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/entx/history" +) + +// OrganizationHistoryCreate is the builder for creating a OrganizationHistory entity. +type OrganizationHistoryCreate struct { + config + mutation *OrganizationHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ohc *OrganizationHistoryCreate) SetHistoryTime(t time.Time) *OrganizationHistoryCreate { + ohc.mutation.SetHistoryTime(t) + return ohc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableHistoryTime(t *time.Time) *OrganizationHistoryCreate { + if t != nil { + ohc.SetHistoryTime(*t) + } + return ohc +} + +// SetRef sets the "ref" field. +func (ohc *OrganizationHistoryCreate) SetRef(s string) *OrganizationHistoryCreate { + ohc.mutation.SetRef(s) + return ohc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableRef(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetRef(*s) + } + return ohc +} + +// SetOperation sets the "operation" field. +func (ohc *OrganizationHistoryCreate) SetOperation(ht history.OpType) *OrganizationHistoryCreate { + ohc.mutation.SetOperation(ht) + return ohc +} + +// SetCreatedAt sets the "created_at" field. +func (ohc *OrganizationHistoryCreate) SetCreatedAt(t time.Time) *OrganizationHistoryCreate { + ohc.mutation.SetCreatedAt(t) + return ohc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableCreatedAt(t *time.Time) *OrganizationHistoryCreate { + if t != nil { + ohc.SetCreatedAt(*t) + } + return ohc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ohc *OrganizationHistoryCreate) SetUpdatedAt(t time.Time) *OrganizationHistoryCreate { + ohc.mutation.SetUpdatedAt(t) + return ohc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableUpdatedAt(t *time.Time) *OrganizationHistoryCreate { + if t != nil { + ohc.SetUpdatedAt(*t) + } + return ohc +} + +// SetCreatedBy sets the "created_by" field. +func (ohc *OrganizationHistoryCreate) SetCreatedBy(s string) *OrganizationHistoryCreate { + ohc.mutation.SetCreatedBy(s) + return ohc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableCreatedBy(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetCreatedBy(*s) + } + return ohc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ohc *OrganizationHistoryCreate) SetUpdatedBy(s string) *OrganizationHistoryCreate { + ohc.mutation.SetUpdatedBy(s) + return ohc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableUpdatedBy(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetUpdatedBy(*s) + } + return ohc +} + +// SetMappingID sets the "mapping_id" field. +func (ohc *OrganizationHistoryCreate) SetMappingID(s string) *OrganizationHistoryCreate { + ohc.mutation.SetMappingID(s) + return ohc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableMappingID(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetMappingID(*s) + } + return ohc +} + +// SetTags sets the "tags" field. +func (ohc *OrganizationHistoryCreate) SetTags(s []string) *OrganizationHistoryCreate { + ohc.mutation.SetTags(s) + return ohc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ohc *OrganizationHistoryCreate) SetDeletedAt(t time.Time) *OrganizationHistoryCreate { + ohc.mutation.SetDeletedAt(t) + return ohc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableDeletedAt(t *time.Time) *OrganizationHistoryCreate { + if t != nil { + ohc.SetDeletedAt(*t) + } + return ohc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ohc *OrganizationHistoryCreate) SetDeletedBy(s string) *OrganizationHistoryCreate { + ohc.mutation.SetDeletedBy(s) + return ohc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableDeletedBy(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetDeletedBy(*s) + } + return ohc +} + +// SetName sets the "name" field. +func (ohc *OrganizationHistoryCreate) SetName(s string) *OrganizationHistoryCreate { + ohc.mutation.SetName(s) + return ohc +} + +// SetDisplayName sets the "display_name" field. +func (ohc *OrganizationHistoryCreate) SetDisplayName(s string) *OrganizationHistoryCreate { + ohc.mutation.SetDisplayName(s) + return ohc +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableDisplayName(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetDisplayName(*s) + } + return ohc +} + +// SetDescription sets the "description" field. +func (ohc *OrganizationHistoryCreate) SetDescription(s string) *OrganizationHistoryCreate { + ohc.mutation.SetDescription(s) + return ohc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableDescription(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetDescription(*s) + } + return ohc +} + +// SetParentOrganizationID sets the "parent_organization_id" field. +func (ohc *OrganizationHistoryCreate) SetParentOrganizationID(s string) *OrganizationHistoryCreate { + ohc.mutation.SetParentOrganizationID(s) + return ohc +} + +// SetNillableParentOrganizationID sets the "parent_organization_id" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableParentOrganizationID(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetParentOrganizationID(*s) + } + return ohc +} + +// SetPersonalOrg sets the "personal_org" field. +func (ohc *OrganizationHistoryCreate) SetPersonalOrg(b bool) *OrganizationHistoryCreate { + ohc.mutation.SetPersonalOrg(b) + return ohc +} + +// SetNillablePersonalOrg sets the "personal_org" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillablePersonalOrg(b *bool) *OrganizationHistoryCreate { + if b != nil { + ohc.SetPersonalOrg(*b) + } + return ohc +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (ohc *OrganizationHistoryCreate) SetAvatarRemoteURL(s string) *OrganizationHistoryCreate { + ohc.mutation.SetAvatarRemoteURL(s) + return ohc +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableAvatarRemoteURL(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetAvatarRemoteURL(*s) + } + return ohc +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (ohc *OrganizationHistoryCreate) SetDedicatedDb(b bool) *OrganizationHistoryCreate { + ohc.mutation.SetDedicatedDb(b) + return ohc +} + +// SetNillableDedicatedDb sets the "dedicated_db" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableDedicatedDb(b *bool) *OrganizationHistoryCreate { + if b != nil { + ohc.SetDedicatedDb(*b) + } + return ohc +} + +// SetID sets the "id" field. +func (ohc *OrganizationHistoryCreate) SetID(s string) *OrganizationHistoryCreate { + ohc.mutation.SetID(s) + return ohc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ohc *OrganizationHistoryCreate) SetNillableID(s *string) *OrganizationHistoryCreate { + if s != nil { + ohc.SetID(*s) + } + return ohc +} + +// Mutation returns the OrganizationHistoryMutation object of the builder. +func (ohc *OrganizationHistoryCreate) Mutation() *OrganizationHistoryMutation { + return ohc.mutation +} + +// Save creates the OrganizationHistory in the database. +func (ohc *OrganizationHistoryCreate) Save(ctx context.Context) (*OrganizationHistory, error) { + if err := ohc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ohc.sqlSave, ohc.mutation, ohc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ohc *OrganizationHistoryCreate) SaveX(ctx context.Context) *OrganizationHistory { + v, err := ohc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ohc *OrganizationHistoryCreate) Exec(ctx context.Context) error { + _, err := ohc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ohc *OrganizationHistoryCreate) ExecX(ctx context.Context) { + if err := ohc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ohc *OrganizationHistoryCreate) defaults() error { + if _, ok := ohc.mutation.HistoryTime(); !ok { + if organizationhistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized organizationhistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := organizationhistory.DefaultHistoryTime() + ohc.mutation.SetHistoryTime(v) + } + if _, ok := ohc.mutation.CreatedAt(); !ok { + if organizationhistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationhistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := organizationhistory.DefaultCreatedAt() + ohc.mutation.SetCreatedAt(v) + } + if _, ok := ohc.mutation.UpdatedAt(); !ok { + if organizationhistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationhistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationhistory.DefaultUpdatedAt() + ohc.mutation.SetUpdatedAt(v) + } + if _, ok := ohc.mutation.MappingID(); !ok { + if organizationhistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized organizationhistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := organizationhistory.DefaultMappingID() + ohc.mutation.SetMappingID(v) + } + if _, ok := ohc.mutation.Tags(); !ok { + v := organizationhistory.DefaultTags + ohc.mutation.SetTags(v) + } + if _, ok := ohc.mutation.DisplayName(); !ok { + v := organizationhistory.DefaultDisplayName + ohc.mutation.SetDisplayName(v) + } + if _, ok := ohc.mutation.PersonalOrg(); !ok { + v := organizationhistory.DefaultPersonalOrg + ohc.mutation.SetPersonalOrg(v) + } + if _, ok := ohc.mutation.DedicatedDb(); !ok { + v := organizationhistory.DefaultDedicatedDb + ohc.mutation.SetDedicatedDb(v) + } + if _, ok := ohc.mutation.ID(); !ok { + if organizationhistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized organizationhistory.DefaultID (forgotten import generated/runtime?)") + } + v := organizationhistory.DefaultID() + ohc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (ohc *OrganizationHistoryCreate) check() error { + if _, ok := ohc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "OrganizationHistory.history_time"`)} + } + if _, ok := ohc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "OrganizationHistory.operation"`)} + } + if v, ok := ohc.mutation.Operation(); ok { + if err := organizationhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "OrganizationHistory.operation": %w`, err)} + } + } + if _, ok := ohc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OrganizationHistory.mapping_id"`)} + } + if _, ok := ohc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "OrganizationHistory.name"`)} + } + if _, ok := ohc.mutation.DisplayName(); !ok { + return &ValidationError{Name: "display_name", err: errors.New(`generated: missing required field "OrganizationHistory.display_name"`)} + } + if _, ok := ohc.mutation.DedicatedDb(); !ok { + return &ValidationError{Name: "dedicated_db", err: errors.New(`generated: missing required field "OrganizationHistory.dedicated_db"`)} + } + return nil +} + +func (ohc *OrganizationHistoryCreate) sqlSave(ctx context.Context) (*OrganizationHistory, error) { + if err := ohc.check(); err != nil { + return nil, err + } + _node, _spec := ohc.createSpec() + if err := sqlgraph.CreateNode(ctx, ohc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OrganizationHistory.ID type: %T", _spec.ID.Value) + } + } + ohc.mutation.id = &_node.ID + ohc.mutation.done = true + return _node, nil +} + +func (ohc *OrganizationHistoryCreate) createSpec() (*OrganizationHistory, *sqlgraph.CreateSpec) { + var ( + _node = &OrganizationHistory{config: ohc.config} + _spec = sqlgraph.NewCreateSpec(organizationhistory.Table, sqlgraph.NewFieldSpec(organizationhistory.FieldID, field.TypeString)) + ) + _spec.Schema = ohc.schemaConfig.OrganizationHistory + if id, ok := ohc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ohc.mutation.HistoryTime(); ok { + _spec.SetField(organizationhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ohc.mutation.Ref(); ok { + _spec.SetField(organizationhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ohc.mutation.Operation(); ok { + _spec.SetField(organizationhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ohc.mutation.CreatedAt(); ok { + _spec.SetField(organizationhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ohc.mutation.UpdatedAt(); ok { + _spec.SetField(organizationhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ohc.mutation.CreatedBy(); ok { + _spec.SetField(organizationhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ohc.mutation.UpdatedBy(); ok { + _spec.SetField(organizationhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ohc.mutation.MappingID(); ok { + _spec.SetField(organizationhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ohc.mutation.Tags(); ok { + _spec.SetField(organizationhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ohc.mutation.DeletedAt(); ok { + _spec.SetField(organizationhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ohc.mutation.DeletedBy(); ok { + _spec.SetField(organizationhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ohc.mutation.Name(); ok { + _spec.SetField(organizationhistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := ohc.mutation.DisplayName(); ok { + _spec.SetField(organizationhistory.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := ohc.mutation.Description(); ok { + _spec.SetField(organizationhistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := ohc.mutation.ParentOrganizationID(); ok { + _spec.SetField(organizationhistory.FieldParentOrganizationID, field.TypeString, value) + _node.ParentOrganizationID = value + } + if value, ok := ohc.mutation.PersonalOrg(); ok { + _spec.SetField(organizationhistory.FieldPersonalOrg, field.TypeBool, value) + _node.PersonalOrg = value + } + if value, ok := ohc.mutation.AvatarRemoteURL(); ok { + _spec.SetField(organizationhistory.FieldAvatarRemoteURL, field.TypeString, value) + _node.AvatarRemoteURL = &value + } + if value, ok := ohc.mutation.DedicatedDb(); ok { + _spec.SetField(organizationhistory.FieldDedicatedDb, field.TypeBool, value) + _node.DedicatedDb = value + } + return _node, _spec +} + +// OrganizationHistoryCreateBulk is the builder for creating many OrganizationHistory entities in bulk. +type OrganizationHistoryCreateBulk struct { + config + err error + builders []*OrganizationHistoryCreate +} + +// Save creates the OrganizationHistory entities in the database. +func (ohcb *OrganizationHistoryCreateBulk) Save(ctx context.Context) ([]*OrganizationHistory, error) { + if ohcb.err != nil { + return nil, ohcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ohcb.builders)) + nodes := make([]*OrganizationHistory, len(ohcb.builders)) + mutators := make([]Mutator, len(ohcb.builders)) + for i := range ohcb.builders { + func(i int, root context.Context) { + builder := ohcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OrganizationHistoryMutation) + 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, ohcb.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, ohcb.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, ohcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ohcb *OrganizationHistoryCreateBulk) SaveX(ctx context.Context) []*OrganizationHistory { + v, err := ohcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ohcb *OrganizationHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ohcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ohcb *OrganizationHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ohcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organizationhistory_delete.go b/internal/ent/generated/organizationhistory_delete.go new file mode 100644 index 0000000..3c04f27 --- /dev/null +++ b/internal/ent/generated/organizationhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" +) + +// OrganizationHistoryDelete is the builder for deleting a OrganizationHistory entity. +type OrganizationHistoryDelete struct { + config + hooks []Hook + mutation *OrganizationHistoryMutation +} + +// Where appends a list predicates to the OrganizationHistoryDelete builder. +func (ohd *OrganizationHistoryDelete) Where(ps ...predicate.OrganizationHistory) *OrganizationHistoryDelete { + ohd.mutation.Where(ps...) + return ohd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ohd *OrganizationHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ohd.sqlExec, ohd.mutation, ohd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ohd *OrganizationHistoryDelete) ExecX(ctx context.Context) int { + n, err := ohd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ohd *OrganizationHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(organizationhistory.Table, sqlgraph.NewFieldSpec(organizationhistory.FieldID, field.TypeString)) + _spec.Node.Schema = ohd.schemaConfig.OrganizationHistory + ctx = internal.NewSchemaConfigContext(ctx, ohd.schemaConfig) + if ps := ohd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ohd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ohd.mutation.done = true + return affected, err +} + +// OrganizationHistoryDeleteOne is the builder for deleting a single OrganizationHistory entity. +type OrganizationHistoryDeleteOne struct { + ohd *OrganizationHistoryDelete +} + +// Where appends a list predicates to the OrganizationHistoryDelete builder. +func (ohdo *OrganizationHistoryDeleteOne) Where(ps ...predicate.OrganizationHistory) *OrganizationHistoryDeleteOne { + ohdo.ohd.mutation.Where(ps...) + return ohdo +} + +// Exec executes the deletion query. +func (ohdo *OrganizationHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ohdo.ohd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{organizationhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ohdo *OrganizationHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ohdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organizationhistory_query.go b/internal/ent/generated/organizationhistory_query.go new file mode 100644 index 0000000..d142f65 --- /dev/null +++ b/internal/ent/generated/organizationhistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationHistoryQuery is the builder for querying OrganizationHistory entities. +type OrganizationHistoryQuery struct { + config + ctx *QueryContext + order []organizationhistory.OrderOption + inters []Interceptor + predicates []predicate.OrganizationHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OrganizationHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OrganizationHistoryQuery builder. +func (ohq *OrganizationHistoryQuery) Where(ps ...predicate.OrganizationHistory) *OrganizationHistoryQuery { + ohq.predicates = append(ohq.predicates, ps...) + return ohq +} + +// Limit the number of records to be returned by this query. +func (ohq *OrganizationHistoryQuery) Limit(limit int) *OrganizationHistoryQuery { + ohq.ctx.Limit = &limit + return ohq +} + +// Offset to start from. +func (ohq *OrganizationHistoryQuery) Offset(offset int) *OrganizationHistoryQuery { + ohq.ctx.Offset = &offset + return ohq +} + +// 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 (ohq *OrganizationHistoryQuery) Unique(unique bool) *OrganizationHistoryQuery { + ohq.ctx.Unique = &unique + return ohq +} + +// Order specifies how the records should be ordered. +func (ohq *OrganizationHistoryQuery) Order(o ...organizationhistory.OrderOption) *OrganizationHistoryQuery { + ohq.order = append(ohq.order, o...) + return ohq +} + +// First returns the first OrganizationHistory entity from the query. +// Returns a *NotFoundError when no OrganizationHistory was found. +func (ohq *OrganizationHistoryQuery) First(ctx context.Context) (*OrganizationHistory, error) { + nodes, err := ohq.Limit(1).All(setContextOp(ctx, ohq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{organizationhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) FirstX(ctx context.Context) *OrganizationHistory { + node, err := ohq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OrganizationHistory ID from the query. +// Returns a *NotFoundError when no OrganizationHistory ID was found. +func (ohq *OrganizationHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ohq.Limit(1).IDs(setContextOp(ctx, ohq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{organizationhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ohq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OrganizationHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OrganizationHistory entity is found. +// Returns a *NotFoundError when no OrganizationHistory entities are found. +func (ohq *OrganizationHistoryQuery) Only(ctx context.Context) (*OrganizationHistory, error) { + nodes, err := ohq.Limit(2).All(setContextOp(ctx, ohq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{organizationhistory.Label} + default: + return nil, &NotSingularError{organizationhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) OnlyX(ctx context.Context) *OrganizationHistory { + node, err := ohq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OrganizationHistory ID in the query. +// Returns a *NotSingularError when more than one OrganizationHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ohq *OrganizationHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ohq.Limit(2).IDs(setContextOp(ctx, ohq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{organizationhistory.Label} + default: + err = &NotSingularError{organizationhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ohq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OrganizationHistories. +func (ohq *OrganizationHistoryQuery) All(ctx context.Context) ([]*OrganizationHistory, error) { + ctx = setContextOp(ctx, ohq.ctx, ent.OpQueryAll) + if err := ohq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OrganizationHistory, *OrganizationHistoryQuery]() + return withInterceptors[[]*OrganizationHistory](ctx, ohq, qr, ohq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) AllX(ctx context.Context) []*OrganizationHistory { + nodes, err := ohq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OrganizationHistory IDs. +func (ohq *OrganizationHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ohq.ctx.Unique == nil && ohq.path != nil { + ohq.Unique(true) + } + ctx = setContextOp(ctx, ohq.ctx, ent.OpQueryIDs) + if err = ohq.Select(organizationhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ohq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ohq *OrganizationHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ohq.ctx, ent.OpQueryCount) + if err := ohq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ohq, querierCount[*OrganizationHistoryQuery](), ohq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) CountX(ctx context.Context) int { + count, err := ohq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ohq *OrganizationHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ohq.ctx, ent.OpQueryExist) + switch _, err := ohq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ohq *OrganizationHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ohq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OrganizationHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ohq *OrganizationHistoryQuery) Clone() *OrganizationHistoryQuery { + if ohq == nil { + return nil + } + return &OrganizationHistoryQuery{ + config: ohq.config, + ctx: ohq.ctx.Clone(), + order: append([]organizationhistory.OrderOption{}, ohq.order...), + inters: append([]Interceptor{}, ohq.inters...), + predicates: append([]predicate.OrganizationHistory{}, ohq.predicates...), + // clone intermediate query. + sql: ohq.sql.Clone(), + path: ohq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OrganizationHistory.Query(). +// GroupBy(organizationhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ohq *OrganizationHistoryQuery) GroupBy(field string, fields ...string) *OrganizationHistoryGroupBy { + ohq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OrganizationHistoryGroupBy{build: ohq} + grbuild.flds = &ohq.ctx.Fields + grbuild.label = organizationhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.OrganizationHistory.Query(). +// Select(organizationhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ohq *OrganizationHistoryQuery) Select(fields ...string) *OrganizationHistorySelect { + ohq.ctx.Fields = append(ohq.ctx.Fields, fields...) + sbuild := &OrganizationHistorySelect{OrganizationHistoryQuery: ohq} + sbuild.label = organizationhistory.Label + sbuild.flds, sbuild.scan = &ohq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OrganizationHistorySelect configured with the given aggregations. +func (ohq *OrganizationHistoryQuery) Aggregate(fns ...AggregateFunc) *OrganizationHistorySelect { + return ohq.Select().Aggregate(fns...) +} + +func (ohq *OrganizationHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ohq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ohq); err != nil { + return err + } + } + } + for _, f := range ohq.ctx.Fields { + if !organizationhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ohq.path != nil { + prev, err := ohq.path(ctx) + if err != nil { + return err + } + ohq.sql = prev + } + if organizationhistory.Policy == nil { + return errors.New("generated: uninitialized organizationhistory.Policy (forgotten import generated/runtime?)") + } + if err := organizationhistory.Policy.EvalQuery(ctx, ohq); err != nil { + return err + } + return nil +} + +func (ohq *OrganizationHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OrganizationHistory, error) { + var ( + nodes = []*OrganizationHistory{} + _spec = ohq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OrganizationHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OrganizationHistory{config: ohq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ohq.schemaConfig.OrganizationHistory + ctx = internal.NewSchemaConfigContext(ctx, ohq.schemaConfig) + if len(ohq.modifiers) > 0 { + _spec.Modifiers = ohq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ohq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ohq.loadTotal { + if err := ohq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ohq *OrganizationHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ohq.querySpec() + _spec.Node.Schema = ohq.schemaConfig.OrganizationHistory + ctx = internal.NewSchemaConfigContext(ctx, ohq.schemaConfig) + if len(ohq.modifiers) > 0 { + _spec.Modifiers = ohq.modifiers + } + _spec.Node.Columns = ohq.ctx.Fields + if len(ohq.ctx.Fields) > 0 { + _spec.Unique = ohq.ctx.Unique != nil && *ohq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ohq.driver, _spec) +} + +func (ohq *OrganizationHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(organizationhistory.Table, organizationhistory.Columns, sqlgraph.NewFieldSpec(organizationhistory.FieldID, field.TypeString)) + _spec.From = ohq.sql + if unique := ohq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ohq.path != nil { + _spec.Unique = true + } + if fields := ohq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organizationhistory.FieldID) + for i := range fields { + if fields[i] != organizationhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ohq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ohq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ohq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ohq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ohq *OrganizationHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ohq.driver.Dialect()) + t1 := builder.Table(organizationhistory.Table) + columns := ohq.ctx.Fields + if len(columns) == 0 { + columns = organizationhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ohq.sql != nil { + selector = ohq.sql + selector.Select(selector.Columns(columns...)...) + } + if ohq.ctx.Unique != nil && *ohq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ohq.schemaConfig.OrganizationHistory) + ctx = internal.NewSchemaConfigContext(ctx, ohq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ohq.predicates { + p(selector) + } + for _, p := range ohq.order { + p(selector) + } + if offset := ohq.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 := ohq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// OrganizationHistoryGroupBy is the group-by builder for OrganizationHistory entities. +type OrganizationHistoryGroupBy struct { + selector + build *OrganizationHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ohgb *OrganizationHistoryGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationHistoryGroupBy { + ohgb.fns = append(ohgb.fns, fns...) + return ohgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ohgb *OrganizationHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ohgb.build.ctx, ent.OpQueryGroupBy) + if err := ohgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationHistoryQuery, *OrganizationHistoryGroupBy](ctx, ohgb.build, ohgb, ohgb.build.inters, v) +} + +func (ohgb *OrganizationHistoryGroupBy) sqlScan(ctx context.Context, root *OrganizationHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ohgb.fns)) + for _, fn := range ohgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ohgb.flds)+len(ohgb.fns)) + for _, f := range *ohgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ohgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ohgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OrganizationHistorySelect is the builder for selecting fields of OrganizationHistory entities. +type OrganizationHistorySelect struct { + *OrganizationHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ohs *OrganizationHistorySelect) Aggregate(fns ...AggregateFunc) *OrganizationHistorySelect { + ohs.fns = append(ohs.fns, fns...) + return ohs +} + +// Scan applies the selector query and scans the result into the given value. +func (ohs *OrganizationHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ohs.ctx, ent.OpQuerySelect) + if err := ohs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationHistoryQuery, *OrganizationHistorySelect](ctx, ohs.OrganizationHistoryQuery, ohs, ohs.inters, v) +} + +func (ohs *OrganizationHistorySelect) sqlScan(ctx context.Context, root *OrganizationHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ohs.fns)) + for _, fn := range ohs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ohs.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 := ohs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/organizationhistory_update.go b/internal/ent/generated/organizationhistory_update.go new file mode 100644 index 0000000..751b465 --- /dev/null +++ b/internal/ent/generated/organizationhistory_update.go @@ -0,0 +1,699 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationHistoryUpdate is the builder for updating OrganizationHistory entities. +type OrganizationHistoryUpdate struct { + config + hooks []Hook + mutation *OrganizationHistoryMutation +} + +// Where appends a list predicates to the OrganizationHistoryUpdate builder. +func (ohu *OrganizationHistoryUpdate) Where(ps ...predicate.OrganizationHistory) *OrganizationHistoryUpdate { + ohu.mutation.Where(ps...) + return ohu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ohu *OrganizationHistoryUpdate) SetUpdatedAt(t time.Time) *OrganizationHistoryUpdate { + ohu.mutation.SetUpdatedAt(t) + return ohu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ohu *OrganizationHistoryUpdate) ClearUpdatedAt() *OrganizationHistoryUpdate { + ohu.mutation.ClearUpdatedAt() + return ohu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ohu *OrganizationHistoryUpdate) SetUpdatedBy(s string) *OrganizationHistoryUpdate { + ohu.mutation.SetUpdatedBy(s) + return ohu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableUpdatedBy(s *string) *OrganizationHistoryUpdate { + if s != nil { + ohu.SetUpdatedBy(*s) + } + return ohu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ohu *OrganizationHistoryUpdate) ClearUpdatedBy() *OrganizationHistoryUpdate { + ohu.mutation.ClearUpdatedBy() + return ohu +} + +// SetTags sets the "tags" field. +func (ohu *OrganizationHistoryUpdate) SetTags(s []string) *OrganizationHistoryUpdate { + ohu.mutation.SetTags(s) + return ohu +} + +// AppendTags appends s to the "tags" field. +func (ohu *OrganizationHistoryUpdate) AppendTags(s []string) *OrganizationHistoryUpdate { + ohu.mutation.AppendTags(s) + return ohu +} + +// ClearTags clears the value of the "tags" field. +func (ohu *OrganizationHistoryUpdate) ClearTags() *OrganizationHistoryUpdate { + ohu.mutation.ClearTags() + return ohu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ohu *OrganizationHistoryUpdate) SetDeletedAt(t time.Time) *OrganizationHistoryUpdate { + ohu.mutation.SetDeletedAt(t) + return ohu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableDeletedAt(t *time.Time) *OrganizationHistoryUpdate { + if t != nil { + ohu.SetDeletedAt(*t) + } + return ohu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ohu *OrganizationHistoryUpdate) ClearDeletedAt() *OrganizationHistoryUpdate { + ohu.mutation.ClearDeletedAt() + return ohu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ohu *OrganizationHistoryUpdate) SetDeletedBy(s string) *OrganizationHistoryUpdate { + ohu.mutation.SetDeletedBy(s) + return ohu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableDeletedBy(s *string) *OrganizationHistoryUpdate { + if s != nil { + ohu.SetDeletedBy(*s) + } + return ohu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ohu *OrganizationHistoryUpdate) ClearDeletedBy() *OrganizationHistoryUpdate { + ohu.mutation.ClearDeletedBy() + return ohu +} + +// SetName sets the "name" field. +func (ohu *OrganizationHistoryUpdate) SetName(s string) *OrganizationHistoryUpdate { + ohu.mutation.SetName(s) + return ohu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableName(s *string) *OrganizationHistoryUpdate { + if s != nil { + ohu.SetName(*s) + } + return ohu +} + +// SetDisplayName sets the "display_name" field. +func (ohu *OrganizationHistoryUpdate) SetDisplayName(s string) *OrganizationHistoryUpdate { + ohu.mutation.SetDisplayName(s) + return ohu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableDisplayName(s *string) *OrganizationHistoryUpdate { + if s != nil { + ohu.SetDisplayName(*s) + } + return ohu +} + +// SetDescription sets the "description" field. +func (ohu *OrganizationHistoryUpdate) SetDescription(s string) *OrganizationHistoryUpdate { + ohu.mutation.SetDescription(s) + return ohu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableDescription(s *string) *OrganizationHistoryUpdate { + if s != nil { + ohu.SetDescription(*s) + } + return ohu +} + +// ClearDescription clears the value of the "description" field. +func (ohu *OrganizationHistoryUpdate) ClearDescription() *OrganizationHistoryUpdate { + ohu.mutation.ClearDescription() + return ohu +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (ohu *OrganizationHistoryUpdate) SetAvatarRemoteURL(s string) *OrganizationHistoryUpdate { + ohu.mutation.SetAvatarRemoteURL(s) + return ohu +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableAvatarRemoteURL(s *string) *OrganizationHistoryUpdate { + if s != nil { + ohu.SetAvatarRemoteURL(*s) + } + return ohu +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (ohu *OrganizationHistoryUpdate) ClearAvatarRemoteURL() *OrganizationHistoryUpdate { + ohu.mutation.ClearAvatarRemoteURL() + return ohu +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (ohu *OrganizationHistoryUpdate) SetDedicatedDb(b bool) *OrganizationHistoryUpdate { + ohu.mutation.SetDedicatedDb(b) + return ohu +} + +// SetNillableDedicatedDb sets the "dedicated_db" field if the given value is not nil. +func (ohu *OrganizationHistoryUpdate) SetNillableDedicatedDb(b *bool) *OrganizationHistoryUpdate { + if b != nil { + ohu.SetDedicatedDb(*b) + } + return ohu +} + +// Mutation returns the OrganizationHistoryMutation object of the builder. +func (ohu *OrganizationHistoryUpdate) Mutation() *OrganizationHistoryMutation { + return ohu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ohu *OrganizationHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := ohu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, ohu.sqlSave, ohu.mutation, ohu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ohu *OrganizationHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ohu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ohu *OrganizationHistoryUpdate) Exec(ctx context.Context) error { + _, err := ohu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ohu *OrganizationHistoryUpdate) ExecX(ctx context.Context) { + if err := ohu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ohu *OrganizationHistoryUpdate) defaults() error { + if _, ok := ohu.mutation.UpdatedAt(); !ok && !ohu.mutation.UpdatedAtCleared() { + if organizationhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationhistory.UpdateDefaultUpdatedAt() + ohu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ohu *OrganizationHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(organizationhistory.Table, organizationhistory.Columns, sqlgraph.NewFieldSpec(organizationhistory.FieldID, field.TypeString)) + if ps := ohu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ohu.mutation.RefCleared() { + _spec.ClearField(organizationhistory.FieldRef, field.TypeString) + } + if ohu.mutation.CreatedAtCleared() { + _spec.ClearField(organizationhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ohu.mutation.UpdatedAt(); ok { + _spec.SetField(organizationhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ohu.mutation.UpdatedAtCleared() { + _spec.ClearField(organizationhistory.FieldUpdatedAt, field.TypeTime) + } + if ohu.mutation.CreatedByCleared() { + _spec.ClearField(organizationhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ohu.mutation.UpdatedBy(); ok { + _spec.SetField(organizationhistory.FieldUpdatedBy, field.TypeString, value) + } + if ohu.mutation.UpdatedByCleared() { + _spec.ClearField(organizationhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ohu.mutation.Tags(); ok { + _spec.SetField(organizationhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ohu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationhistory.FieldTags, value) + }) + } + if ohu.mutation.TagsCleared() { + _spec.ClearField(organizationhistory.FieldTags, field.TypeJSON) + } + if value, ok := ohu.mutation.DeletedAt(); ok { + _spec.SetField(organizationhistory.FieldDeletedAt, field.TypeTime, value) + } + if ohu.mutation.DeletedAtCleared() { + _spec.ClearField(organizationhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ohu.mutation.DeletedBy(); ok { + _spec.SetField(organizationhistory.FieldDeletedBy, field.TypeString, value) + } + if ohu.mutation.DeletedByCleared() { + _spec.ClearField(organizationhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ohu.mutation.Name(); ok { + _spec.SetField(organizationhistory.FieldName, field.TypeString, value) + } + if value, ok := ohu.mutation.DisplayName(); ok { + _spec.SetField(organizationhistory.FieldDisplayName, field.TypeString, value) + } + if value, ok := ohu.mutation.Description(); ok { + _spec.SetField(organizationhistory.FieldDescription, field.TypeString, value) + } + if ohu.mutation.DescriptionCleared() { + _spec.ClearField(organizationhistory.FieldDescription, field.TypeString) + } + if ohu.mutation.ParentOrganizationIDCleared() { + _spec.ClearField(organizationhistory.FieldParentOrganizationID, field.TypeString) + } + if ohu.mutation.PersonalOrgCleared() { + _spec.ClearField(organizationhistory.FieldPersonalOrg, field.TypeBool) + } + if value, ok := ohu.mutation.AvatarRemoteURL(); ok { + _spec.SetField(organizationhistory.FieldAvatarRemoteURL, field.TypeString, value) + } + if ohu.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(organizationhistory.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := ohu.mutation.DedicatedDb(); ok { + _spec.SetField(organizationhistory.FieldDedicatedDb, field.TypeBool, value) + } + _spec.Node.Schema = ohu.schemaConfig.OrganizationHistory + ctx = internal.NewSchemaConfigContext(ctx, ohu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ohu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organizationhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ohu.mutation.done = true + return n, nil +} + +// OrganizationHistoryUpdateOne is the builder for updating a single OrganizationHistory entity. +type OrganizationHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OrganizationHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ohuo *OrganizationHistoryUpdateOne) SetUpdatedAt(t time.Time) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetUpdatedAt(t) + return ohuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ohuo *OrganizationHistoryUpdateOne) ClearUpdatedAt() *OrganizationHistoryUpdateOne { + ohuo.mutation.ClearUpdatedAt() + return ohuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ohuo *OrganizationHistoryUpdateOne) SetUpdatedBy(s string) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetUpdatedBy(s) + return ohuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableUpdatedBy(s *string) *OrganizationHistoryUpdateOne { + if s != nil { + ohuo.SetUpdatedBy(*s) + } + return ohuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ohuo *OrganizationHistoryUpdateOne) ClearUpdatedBy() *OrganizationHistoryUpdateOne { + ohuo.mutation.ClearUpdatedBy() + return ohuo +} + +// SetTags sets the "tags" field. +func (ohuo *OrganizationHistoryUpdateOne) SetTags(s []string) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetTags(s) + return ohuo +} + +// AppendTags appends s to the "tags" field. +func (ohuo *OrganizationHistoryUpdateOne) AppendTags(s []string) *OrganizationHistoryUpdateOne { + ohuo.mutation.AppendTags(s) + return ohuo +} + +// ClearTags clears the value of the "tags" field. +func (ohuo *OrganizationHistoryUpdateOne) ClearTags() *OrganizationHistoryUpdateOne { + ohuo.mutation.ClearTags() + return ohuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ohuo *OrganizationHistoryUpdateOne) SetDeletedAt(t time.Time) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetDeletedAt(t) + return ohuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *OrganizationHistoryUpdateOne { + if t != nil { + ohuo.SetDeletedAt(*t) + } + return ohuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ohuo *OrganizationHistoryUpdateOne) ClearDeletedAt() *OrganizationHistoryUpdateOne { + ohuo.mutation.ClearDeletedAt() + return ohuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ohuo *OrganizationHistoryUpdateOne) SetDeletedBy(s string) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetDeletedBy(s) + return ohuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableDeletedBy(s *string) *OrganizationHistoryUpdateOne { + if s != nil { + ohuo.SetDeletedBy(*s) + } + return ohuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ohuo *OrganizationHistoryUpdateOne) ClearDeletedBy() *OrganizationHistoryUpdateOne { + ohuo.mutation.ClearDeletedBy() + return ohuo +} + +// SetName sets the "name" field. +func (ohuo *OrganizationHistoryUpdateOne) SetName(s string) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetName(s) + return ohuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableName(s *string) *OrganizationHistoryUpdateOne { + if s != nil { + ohuo.SetName(*s) + } + return ohuo +} + +// SetDisplayName sets the "display_name" field. +func (ohuo *OrganizationHistoryUpdateOne) SetDisplayName(s string) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetDisplayName(s) + return ohuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableDisplayName(s *string) *OrganizationHistoryUpdateOne { + if s != nil { + ohuo.SetDisplayName(*s) + } + return ohuo +} + +// SetDescription sets the "description" field. +func (ohuo *OrganizationHistoryUpdateOne) SetDescription(s string) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetDescription(s) + return ohuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableDescription(s *string) *OrganizationHistoryUpdateOne { + if s != nil { + ohuo.SetDescription(*s) + } + return ohuo +} + +// ClearDescription clears the value of the "description" field. +func (ohuo *OrganizationHistoryUpdateOne) ClearDescription() *OrganizationHistoryUpdateOne { + ohuo.mutation.ClearDescription() + return ohuo +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (ohuo *OrganizationHistoryUpdateOne) SetAvatarRemoteURL(s string) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetAvatarRemoteURL(s) + return ohuo +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableAvatarRemoteURL(s *string) *OrganizationHistoryUpdateOne { + if s != nil { + ohuo.SetAvatarRemoteURL(*s) + } + return ohuo +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (ohuo *OrganizationHistoryUpdateOne) ClearAvatarRemoteURL() *OrganizationHistoryUpdateOne { + ohuo.mutation.ClearAvatarRemoteURL() + return ohuo +} + +// SetDedicatedDb sets the "dedicated_db" field. +func (ohuo *OrganizationHistoryUpdateOne) SetDedicatedDb(b bool) *OrganizationHistoryUpdateOne { + ohuo.mutation.SetDedicatedDb(b) + return ohuo +} + +// SetNillableDedicatedDb sets the "dedicated_db" field if the given value is not nil. +func (ohuo *OrganizationHistoryUpdateOne) SetNillableDedicatedDb(b *bool) *OrganizationHistoryUpdateOne { + if b != nil { + ohuo.SetDedicatedDb(*b) + } + return ohuo +} + +// Mutation returns the OrganizationHistoryMutation object of the builder. +func (ohuo *OrganizationHistoryUpdateOne) Mutation() *OrganizationHistoryMutation { + return ohuo.mutation +} + +// Where appends a list predicates to the OrganizationHistoryUpdate builder. +func (ohuo *OrganizationHistoryUpdateOne) Where(ps ...predicate.OrganizationHistory) *OrganizationHistoryUpdateOne { + ohuo.mutation.Where(ps...) + return ohuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ohuo *OrganizationHistoryUpdateOne) Select(field string, fields ...string) *OrganizationHistoryUpdateOne { + ohuo.fields = append([]string{field}, fields...) + return ohuo +} + +// Save executes the query and returns the updated OrganizationHistory entity. +func (ohuo *OrganizationHistoryUpdateOne) Save(ctx context.Context) (*OrganizationHistory, error) { + if err := ohuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, ohuo.sqlSave, ohuo.mutation, ohuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ohuo *OrganizationHistoryUpdateOne) SaveX(ctx context.Context) *OrganizationHistory { + node, err := ohuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ohuo *OrganizationHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ohuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ohuo *OrganizationHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ohuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ohuo *OrganizationHistoryUpdateOne) defaults() error { + if _, ok := ohuo.mutation.UpdatedAt(); !ok && !ohuo.mutation.UpdatedAtCleared() { + if organizationhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationhistory.UpdateDefaultUpdatedAt() + ohuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (ohuo *OrganizationHistoryUpdateOne) sqlSave(ctx context.Context) (_node *OrganizationHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(organizationhistory.Table, organizationhistory.Columns, sqlgraph.NewFieldSpec(organizationhistory.FieldID, field.TypeString)) + id, ok := ohuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OrganizationHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ohuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organizationhistory.FieldID) + for _, f := range fields { + if !organizationhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != organizationhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ohuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ohuo.mutation.RefCleared() { + _spec.ClearField(organizationhistory.FieldRef, field.TypeString) + } + if ohuo.mutation.CreatedAtCleared() { + _spec.ClearField(organizationhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ohuo.mutation.UpdatedAt(); ok { + _spec.SetField(organizationhistory.FieldUpdatedAt, field.TypeTime, value) + } + if ohuo.mutation.UpdatedAtCleared() { + _spec.ClearField(organizationhistory.FieldUpdatedAt, field.TypeTime) + } + if ohuo.mutation.CreatedByCleared() { + _spec.ClearField(organizationhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ohuo.mutation.UpdatedBy(); ok { + _spec.SetField(organizationhistory.FieldUpdatedBy, field.TypeString, value) + } + if ohuo.mutation.UpdatedByCleared() { + _spec.ClearField(organizationhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ohuo.mutation.Tags(); ok { + _spec.SetField(organizationhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ohuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationhistory.FieldTags, value) + }) + } + if ohuo.mutation.TagsCleared() { + _spec.ClearField(organizationhistory.FieldTags, field.TypeJSON) + } + if value, ok := ohuo.mutation.DeletedAt(); ok { + _spec.SetField(organizationhistory.FieldDeletedAt, field.TypeTime, value) + } + if ohuo.mutation.DeletedAtCleared() { + _spec.ClearField(organizationhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ohuo.mutation.DeletedBy(); ok { + _spec.SetField(organizationhistory.FieldDeletedBy, field.TypeString, value) + } + if ohuo.mutation.DeletedByCleared() { + _spec.ClearField(organizationhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ohuo.mutation.Name(); ok { + _spec.SetField(organizationhistory.FieldName, field.TypeString, value) + } + if value, ok := ohuo.mutation.DisplayName(); ok { + _spec.SetField(organizationhistory.FieldDisplayName, field.TypeString, value) + } + if value, ok := ohuo.mutation.Description(); ok { + _spec.SetField(organizationhistory.FieldDescription, field.TypeString, value) + } + if ohuo.mutation.DescriptionCleared() { + _spec.ClearField(organizationhistory.FieldDescription, field.TypeString) + } + if ohuo.mutation.ParentOrganizationIDCleared() { + _spec.ClearField(organizationhistory.FieldParentOrganizationID, field.TypeString) + } + if ohuo.mutation.PersonalOrgCleared() { + _spec.ClearField(organizationhistory.FieldPersonalOrg, field.TypeBool) + } + if value, ok := ohuo.mutation.AvatarRemoteURL(); ok { + _spec.SetField(organizationhistory.FieldAvatarRemoteURL, field.TypeString, value) + } + if ohuo.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(organizationhistory.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := ohuo.mutation.DedicatedDb(); ok { + _spec.SetField(organizationhistory.FieldDedicatedDb, field.TypeBool, value) + } + _spec.Node.Schema = ohuo.schemaConfig.OrganizationHistory + ctx = internal.NewSchemaConfigContext(ctx, ohuo.schemaConfig) + _node = &OrganizationHistory{config: ohuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ohuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organizationhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ohuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/organizationsetting.go b/internal/ent/generated/organizationsetting.go new file mode 100644 index 0000000..92787b3 --- /dev/null +++ b/internal/ent/generated/organizationsetting.go @@ -0,0 +1,308 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/pkg/enums" +) + +// OrganizationSetting is the model entity for the OrganizationSetting schema. +type OrganizationSetting struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact string `json:"billing_contact,omitempty"` + // Email address of the person to contact for billing + BillingEmail string `json:"billing_email,omitempty"` + // Phone number to contact for billing + BillingPhone string `json:"billing_phone,omitempty"` + // Address to send billing information to + BillingAddress string `json:"billing_address,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier string `json:"tax_identifier,omitempty"` + // geographical location of the organization + GeoLocation enums.Region `json:"geo_location,omitempty"` + // the ID of the organization the settings belong to + OrganizationID string `json:"organization_id,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the OrganizationSettingQuery when eager-loading is set. + Edges OrganizationSettingEdges `json:"edges"` + selectValues sql.SelectValues +} + +// OrganizationSettingEdges holds the relations/edges for other nodes in the graph. +type OrganizationSettingEdges struct { + // Organization holds the value of the organization edge. + Organization *Organization `json:"organization,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 +} + +// OrganizationOrErr returns the Organization value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e OrganizationSettingEdges) OrganizationOrErr() (*Organization, error) { + if e.Organization != nil { + return e.Organization, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "organization"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OrganizationSetting) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case organizationsetting.FieldTags, organizationsetting.FieldDomains: + values[i] = new([]byte) + case organizationsetting.FieldID, organizationsetting.FieldCreatedBy, organizationsetting.FieldUpdatedBy, organizationsetting.FieldMappingID, organizationsetting.FieldDeletedBy, organizationsetting.FieldBillingContact, organizationsetting.FieldBillingEmail, organizationsetting.FieldBillingPhone, organizationsetting.FieldBillingAddress, organizationsetting.FieldTaxIdentifier, organizationsetting.FieldGeoLocation, organizationsetting.FieldOrganizationID: + values[i] = new(sql.NullString) + case organizationsetting.FieldCreatedAt, organizationsetting.FieldUpdatedAt, organizationsetting.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OrganizationSetting fields. +func (os *OrganizationSetting) 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 organizationsetting.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + os.ID = value.String + } + case organizationsetting.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + os.CreatedAt = value.Time + } + case organizationsetting.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + os.UpdatedAt = value.Time + } + case organizationsetting.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + os.CreatedBy = value.String + } + case organizationsetting.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + os.UpdatedBy = value.String + } + case organizationsetting.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + os.MappingID = value.String + } + case organizationsetting.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &os.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case organizationsetting.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + os.DeletedAt = value.Time + } + case organizationsetting.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + os.DeletedBy = value.String + } + case organizationsetting.FieldDomains: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field domains", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &os.Domains); err != nil { + return fmt.Errorf("unmarshal field domains: %w", err) + } + } + case organizationsetting.FieldBillingContact: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_contact", values[i]) + } else if value.Valid { + os.BillingContact = value.String + } + case organizationsetting.FieldBillingEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_email", values[i]) + } else if value.Valid { + os.BillingEmail = value.String + } + case organizationsetting.FieldBillingPhone: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_phone", values[i]) + } else if value.Valid { + os.BillingPhone = value.String + } + case organizationsetting.FieldBillingAddress: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_address", values[i]) + } else if value.Valid { + os.BillingAddress = value.String + } + case organizationsetting.FieldTaxIdentifier: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field tax_identifier", values[i]) + } else if value.Valid { + os.TaxIdentifier = value.String + } + case organizationsetting.FieldGeoLocation: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field geo_location", values[i]) + } else if value.Valid { + os.GeoLocation = enums.Region(value.String) + } + case organizationsetting.FieldOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field organization_id", values[i]) + } else if value.Valid { + os.OrganizationID = value.String + } + default: + os.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OrganizationSetting. +// This includes values selected through modifiers, order, etc. +func (os *OrganizationSetting) Value(name string) (ent.Value, error) { + return os.selectValues.Get(name) +} + +// QueryOrganization queries the "organization" edge of the OrganizationSetting entity. +func (os *OrganizationSetting) QueryOrganization() *OrganizationQuery { + return NewOrganizationSettingClient(os.config).QueryOrganization(os) +} + +// Update returns a builder for updating this OrganizationSetting. +// Note that you need to call OrganizationSetting.Unwrap() before calling this method if this OrganizationSetting +// was returned from a transaction, and the transaction was committed or rolled back. +func (os *OrganizationSetting) Update() *OrganizationSettingUpdateOne { + return NewOrganizationSettingClient(os.config).UpdateOne(os) +} + +// Unwrap unwraps the OrganizationSetting 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 (os *OrganizationSetting) Unwrap() *OrganizationSetting { + _tx, ok := os.config.driver.(*txDriver) + if !ok { + panic("generated: OrganizationSetting is not a transactional entity") + } + os.config.driver = _tx.drv + return os +} + +// String implements the fmt.Stringer. +func (os *OrganizationSetting) String() string { + var builder strings.Builder + builder.WriteString("OrganizationSetting(") + builder.WriteString(fmt.Sprintf("id=%v, ", os.ID)) + builder.WriteString("created_at=") + builder.WriteString(os.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(os.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(os.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(os.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(os.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", os.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(os.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(os.DeletedBy) + builder.WriteString(", ") + builder.WriteString("domains=") + builder.WriteString(fmt.Sprintf("%v", os.Domains)) + builder.WriteString(", ") + builder.WriteString("billing_contact=") + builder.WriteString(os.BillingContact) + builder.WriteString(", ") + builder.WriteString("billing_email=") + builder.WriteString(os.BillingEmail) + builder.WriteString(", ") + builder.WriteString("billing_phone=") + builder.WriteString(os.BillingPhone) + builder.WriteString(", ") + builder.WriteString("billing_address=") + builder.WriteString(os.BillingAddress) + builder.WriteString(", ") + builder.WriteString("tax_identifier=") + builder.WriteString(os.TaxIdentifier) + builder.WriteString(", ") + builder.WriteString("geo_location=") + builder.WriteString(fmt.Sprintf("%v", os.GeoLocation)) + builder.WriteString(", ") + builder.WriteString("organization_id=") + builder.WriteString(os.OrganizationID) + builder.WriteByte(')') + return builder.String() +} + +// OrganizationSettings is a parsable slice of OrganizationSetting. +type OrganizationSettings []*OrganizationSetting diff --git a/internal/ent/generated/organizationsetting/organizationsetting.go b/internal/ent/generated/organizationsetting/organizationsetting.go new file mode 100644 index 0000000..b2f5f13 --- /dev/null +++ b/internal/ent/generated/organizationsetting/organizationsetting.go @@ -0,0 +1,235 @@ +// Code generated by ent, DO NOT EDIT. + +package organizationsetting + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the organizationsetting type in the database. + Label = "organization_setting" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldDomains holds the string denoting the domains field in the database. + FieldDomains = "domains" + // FieldBillingContact holds the string denoting the billing_contact field in the database. + FieldBillingContact = "billing_contact" + // FieldBillingEmail holds the string denoting the billing_email field in the database. + FieldBillingEmail = "billing_email" + // FieldBillingPhone holds the string denoting the billing_phone field in the database. + FieldBillingPhone = "billing_phone" + // FieldBillingAddress holds the string denoting the billing_address field in the database. + FieldBillingAddress = "billing_address" + // FieldTaxIdentifier holds the string denoting the tax_identifier field in the database. + FieldTaxIdentifier = "tax_identifier" + // FieldGeoLocation holds the string denoting the geo_location field in the database. + FieldGeoLocation = "geo_location" + // FieldOrganizationID holds the string denoting the organization_id field in the database. + FieldOrganizationID = "organization_id" + // EdgeOrganization holds the string denoting the organization edge name in mutations. + EdgeOrganization = "organization" + // Table holds the table name of the organizationsetting in the database. + Table = "organization_settings" + // OrganizationTable is the table that holds the organization relation/edge. + OrganizationTable = "organization_settings" + // OrganizationInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationInverseTable = "organizations" + // OrganizationColumn is the table column denoting the organization relation/edge. + OrganizationColumn = "organization_id" +) + +// Columns holds all SQL columns for organizationsetting fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldDomains, + FieldBillingContact, + FieldBillingEmail, + FieldBillingPhone, + FieldBillingAddress, + FieldTaxIdentifier, + FieldGeoLocation, + FieldOrganizationID, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [3]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DomainsValidator is a validator for the "domains" field. It is called by the builders before save. + DomainsValidator func([]string) error + // BillingEmailValidator is a validator for the "billing_email" field. It is called by the builders before save. + BillingEmailValidator func(string) error + // BillingPhoneValidator is a validator for the "billing_phone" field. It is called by the builders before save. + BillingPhoneValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultGeoLocation enums.Region = "AMER" + +// GeoLocationValidator is a validator for the "geo_location" field enum values. It is called by the builders before save. +func GeoLocationValidator(gl enums.Region) error { + switch gl.String() { + case "AMER", "EMEA", "APAC": + return nil + default: + return fmt.Errorf("organizationsetting: invalid enum value for geo_location field: %q", gl) + } +} + +// OrderOption defines the ordering options for the OrganizationSetting queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByBillingContact orders the results by the billing_contact field. +func ByBillingContact(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingContact, opts...).ToFunc() +} + +// ByBillingEmail orders the results by the billing_email field. +func ByBillingEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingEmail, opts...).ToFunc() +} + +// ByBillingPhone orders the results by the billing_phone field. +func ByBillingPhone(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingPhone, opts...).ToFunc() +} + +// ByBillingAddress orders the results by the billing_address field. +func ByBillingAddress(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingAddress, opts...).ToFunc() +} + +// ByTaxIdentifier orders the results by the tax_identifier field. +func ByTaxIdentifier(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTaxIdentifier, opts...).ToFunc() +} + +// ByGeoLocation orders the results by the geo_location field. +func ByGeoLocation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGeoLocation, opts...).ToFunc() +} + +// ByOrganizationID orders the results by the organization_id field. +func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() +} + +// ByOrganizationField orders the results by organization field. +func ByOrganizationField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationStep(), sql.OrderByField(field, opts...)) + } +} +func newOrganizationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, OrganizationTable, OrganizationColumn), + ) +} + +var ( + // enums.Region must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Region)(nil) + // enums.Region must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Region)(nil) +) diff --git a/internal/ent/generated/organizationsetting/where.go b/internal/ent/generated/organizationsetting/where.go new file mode 100644 index 0000000..ae03af0 --- /dev/null +++ b/internal/ent/generated/organizationsetting/where.go @@ -0,0 +1,1128 @@ +// Code generated by ent, DO NOT EDIT. + +package organizationsetting + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// BillingContact applies equality check predicate on the "billing_contact" field. It's identical to BillingContactEQ. +func BillingContact(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingContact, v)) +} + +// BillingEmail applies equality check predicate on the "billing_email" field. It's identical to BillingEmailEQ. +func BillingEmail(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingEmail, v)) +} + +// BillingPhone applies equality check predicate on the "billing_phone" field. It's identical to BillingPhoneEQ. +func BillingPhone(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingPhone, v)) +} + +// BillingAddress applies equality check predicate on the "billing_address" field. It's identical to BillingAddressEQ. +func BillingAddress(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingAddress, v)) +} + +// TaxIdentifier applies equality check predicate on the "tax_identifier" field. It's identical to TaxIdentifierEQ. +func TaxIdentifier(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldTaxIdentifier, v)) +} + +// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ. +func OrganizationID(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldOrganizationID, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// DomainsIsNil applies the IsNil predicate on the "domains" field. +func DomainsIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldDomains)) +} + +// DomainsNotNil applies the NotNil predicate on the "domains" field. +func DomainsNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldDomains)) +} + +// BillingContactEQ applies the EQ predicate on the "billing_contact" field. +func BillingContactEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingContact, v)) +} + +// BillingContactNEQ applies the NEQ predicate on the "billing_contact" field. +func BillingContactNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldBillingContact, v)) +} + +// BillingContactIn applies the In predicate on the "billing_contact" field. +func BillingContactIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldBillingContact, vs...)) +} + +// BillingContactNotIn applies the NotIn predicate on the "billing_contact" field. +func BillingContactNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldBillingContact, vs...)) +} + +// BillingContactGT applies the GT predicate on the "billing_contact" field. +func BillingContactGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldBillingContact, v)) +} + +// BillingContactGTE applies the GTE predicate on the "billing_contact" field. +func BillingContactGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldBillingContact, v)) +} + +// BillingContactLT applies the LT predicate on the "billing_contact" field. +func BillingContactLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldBillingContact, v)) +} + +// BillingContactLTE applies the LTE predicate on the "billing_contact" field. +func BillingContactLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldBillingContact, v)) +} + +// BillingContactContains applies the Contains predicate on the "billing_contact" field. +func BillingContactContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldBillingContact, v)) +} + +// BillingContactHasPrefix applies the HasPrefix predicate on the "billing_contact" field. +func BillingContactHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldBillingContact, v)) +} + +// BillingContactHasSuffix applies the HasSuffix predicate on the "billing_contact" field. +func BillingContactHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldBillingContact, v)) +} + +// BillingContactIsNil applies the IsNil predicate on the "billing_contact" field. +func BillingContactIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldBillingContact)) +} + +// BillingContactNotNil applies the NotNil predicate on the "billing_contact" field. +func BillingContactNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldBillingContact)) +} + +// BillingContactEqualFold applies the EqualFold predicate on the "billing_contact" field. +func BillingContactEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldBillingContact, v)) +} + +// BillingContactContainsFold applies the ContainsFold predicate on the "billing_contact" field. +func BillingContactContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldBillingContact, v)) +} + +// BillingEmailEQ applies the EQ predicate on the "billing_email" field. +func BillingEmailEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingEmail, v)) +} + +// BillingEmailNEQ applies the NEQ predicate on the "billing_email" field. +func BillingEmailNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldBillingEmail, v)) +} + +// BillingEmailIn applies the In predicate on the "billing_email" field. +func BillingEmailIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldBillingEmail, vs...)) +} + +// BillingEmailNotIn applies the NotIn predicate on the "billing_email" field. +func BillingEmailNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldBillingEmail, vs...)) +} + +// BillingEmailGT applies the GT predicate on the "billing_email" field. +func BillingEmailGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldBillingEmail, v)) +} + +// BillingEmailGTE applies the GTE predicate on the "billing_email" field. +func BillingEmailGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldBillingEmail, v)) +} + +// BillingEmailLT applies the LT predicate on the "billing_email" field. +func BillingEmailLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldBillingEmail, v)) +} + +// BillingEmailLTE applies the LTE predicate on the "billing_email" field. +func BillingEmailLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldBillingEmail, v)) +} + +// BillingEmailContains applies the Contains predicate on the "billing_email" field. +func BillingEmailContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldBillingEmail, v)) +} + +// BillingEmailHasPrefix applies the HasPrefix predicate on the "billing_email" field. +func BillingEmailHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldBillingEmail, v)) +} + +// BillingEmailHasSuffix applies the HasSuffix predicate on the "billing_email" field. +func BillingEmailHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldBillingEmail, v)) +} + +// BillingEmailIsNil applies the IsNil predicate on the "billing_email" field. +func BillingEmailIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldBillingEmail)) +} + +// BillingEmailNotNil applies the NotNil predicate on the "billing_email" field. +func BillingEmailNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldBillingEmail)) +} + +// BillingEmailEqualFold applies the EqualFold predicate on the "billing_email" field. +func BillingEmailEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldBillingEmail, v)) +} + +// BillingEmailContainsFold applies the ContainsFold predicate on the "billing_email" field. +func BillingEmailContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldBillingEmail, v)) +} + +// BillingPhoneEQ applies the EQ predicate on the "billing_phone" field. +func BillingPhoneEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingPhone, v)) +} + +// BillingPhoneNEQ applies the NEQ predicate on the "billing_phone" field. +func BillingPhoneNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldBillingPhone, v)) +} + +// BillingPhoneIn applies the In predicate on the "billing_phone" field. +func BillingPhoneIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldBillingPhone, vs...)) +} + +// BillingPhoneNotIn applies the NotIn predicate on the "billing_phone" field. +func BillingPhoneNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldBillingPhone, vs...)) +} + +// BillingPhoneGT applies the GT predicate on the "billing_phone" field. +func BillingPhoneGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldBillingPhone, v)) +} + +// BillingPhoneGTE applies the GTE predicate on the "billing_phone" field. +func BillingPhoneGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldBillingPhone, v)) +} + +// BillingPhoneLT applies the LT predicate on the "billing_phone" field. +func BillingPhoneLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldBillingPhone, v)) +} + +// BillingPhoneLTE applies the LTE predicate on the "billing_phone" field. +func BillingPhoneLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldBillingPhone, v)) +} + +// BillingPhoneContains applies the Contains predicate on the "billing_phone" field. +func BillingPhoneContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldBillingPhone, v)) +} + +// BillingPhoneHasPrefix applies the HasPrefix predicate on the "billing_phone" field. +func BillingPhoneHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldBillingPhone, v)) +} + +// BillingPhoneHasSuffix applies the HasSuffix predicate on the "billing_phone" field. +func BillingPhoneHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldBillingPhone, v)) +} + +// BillingPhoneIsNil applies the IsNil predicate on the "billing_phone" field. +func BillingPhoneIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldBillingPhone)) +} + +// BillingPhoneNotNil applies the NotNil predicate on the "billing_phone" field. +func BillingPhoneNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldBillingPhone)) +} + +// BillingPhoneEqualFold applies the EqualFold predicate on the "billing_phone" field. +func BillingPhoneEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldBillingPhone, v)) +} + +// BillingPhoneContainsFold applies the ContainsFold predicate on the "billing_phone" field. +func BillingPhoneContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldBillingPhone, v)) +} + +// BillingAddressEQ applies the EQ predicate on the "billing_address" field. +func BillingAddressEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingAddress, v)) +} + +// BillingAddressNEQ applies the NEQ predicate on the "billing_address" field. +func BillingAddressNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldBillingAddress, v)) +} + +// BillingAddressIn applies the In predicate on the "billing_address" field. +func BillingAddressIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldBillingAddress, vs...)) +} + +// BillingAddressNotIn applies the NotIn predicate on the "billing_address" field. +func BillingAddressNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldBillingAddress, vs...)) +} + +// BillingAddressGT applies the GT predicate on the "billing_address" field. +func BillingAddressGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldBillingAddress, v)) +} + +// BillingAddressGTE applies the GTE predicate on the "billing_address" field. +func BillingAddressGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldBillingAddress, v)) +} + +// BillingAddressLT applies the LT predicate on the "billing_address" field. +func BillingAddressLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldBillingAddress, v)) +} + +// BillingAddressLTE applies the LTE predicate on the "billing_address" field. +func BillingAddressLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldBillingAddress, v)) +} + +// BillingAddressContains applies the Contains predicate on the "billing_address" field. +func BillingAddressContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldBillingAddress, v)) +} + +// BillingAddressHasPrefix applies the HasPrefix predicate on the "billing_address" field. +func BillingAddressHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldBillingAddress, v)) +} + +// BillingAddressHasSuffix applies the HasSuffix predicate on the "billing_address" field. +func BillingAddressHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldBillingAddress, v)) +} + +// BillingAddressIsNil applies the IsNil predicate on the "billing_address" field. +func BillingAddressIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldBillingAddress)) +} + +// BillingAddressNotNil applies the NotNil predicate on the "billing_address" field. +func BillingAddressNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldBillingAddress)) +} + +// BillingAddressEqualFold applies the EqualFold predicate on the "billing_address" field. +func BillingAddressEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldBillingAddress, v)) +} + +// BillingAddressContainsFold applies the ContainsFold predicate on the "billing_address" field. +func BillingAddressContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldBillingAddress, v)) +} + +// TaxIdentifierEQ applies the EQ predicate on the "tax_identifier" field. +func TaxIdentifierEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldTaxIdentifier, v)) +} + +// TaxIdentifierNEQ applies the NEQ predicate on the "tax_identifier" field. +func TaxIdentifierNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldTaxIdentifier, v)) +} + +// TaxIdentifierIn applies the In predicate on the "tax_identifier" field. +func TaxIdentifierIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldTaxIdentifier, vs...)) +} + +// TaxIdentifierNotIn applies the NotIn predicate on the "tax_identifier" field. +func TaxIdentifierNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldTaxIdentifier, vs...)) +} + +// TaxIdentifierGT applies the GT predicate on the "tax_identifier" field. +func TaxIdentifierGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldTaxIdentifier, v)) +} + +// TaxIdentifierGTE applies the GTE predicate on the "tax_identifier" field. +func TaxIdentifierGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldTaxIdentifier, v)) +} + +// TaxIdentifierLT applies the LT predicate on the "tax_identifier" field. +func TaxIdentifierLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldTaxIdentifier, v)) +} + +// TaxIdentifierLTE applies the LTE predicate on the "tax_identifier" field. +func TaxIdentifierLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldTaxIdentifier, v)) +} + +// TaxIdentifierContains applies the Contains predicate on the "tax_identifier" field. +func TaxIdentifierContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldTaxIdentifier, v)) +} + +// TaxIdentifierHasPrefix applies the HasPrefix predicate on the "tax_identifier" field. +func TaxIdentifierHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldTaxIdentifier, v)) +} + +// TaxIdentifierHasSuffix applies the HasSuffix predicate on the "tax_identifier" field. +func TaxIdentifierHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldTaxIdentifier, v)) +} + +// TaxIdentifierIsNil applies the IsNil predicate on the "tax_identifier" field. +func TaxIdentifierIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldTaxIdentifier)) +} + +// TaxIdentifierNotNil applies the NotNil predicate on the "tax_identifier" field. +func TaxIdentifierNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldTaxIdentifier)) +} + +// TaxIdentifierEqualFold applies the EqualFold predicate on the "tax_identifier" field. +func TaxIdentifierEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldTaxIdentifier, v)) +} + +// TaxIdentifierContainsFold applies the ContainsFold predicate on the "tax_identifier" field. +func TaxIdentifierContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldTaxIdentifier, v)) +} + +// GeoLocationEQ applies the EQ predicate on the "geo_location" field. +func GeoLocationEQ(v enums.Region) predicate.OrganizationSetting { + vc := v + return predicate.OrganizationSetting(sql.FieldEQ(FieldGeoLocation, vc)) +} + +// GeoLocationNEQ applies the NEQ predicate on the "geo_location" field. +func GeoLocationNEQ(v enums.Region) predicate.OrganizationSetting { + vc := v + return predicate.OrganizationSetting(sql.FieldNEQ(FieldGeoLocation, vc)) +} + +// GeoLocationIn applies the In predicate on the "geo_location" field. +func GeoLocationIn(vs ...enums.Region) predicate.OrganizationSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrganizationSetting(sql.FieldIn(FieldGeoLocation, v...)) +} + +// GeoLocationNotIn applies the NotIn predicate on the "geo_location" field. +func GeoLocationNotIn(vs ...enums.Region) predicate.OrganizationSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrganizationSetting(sql.FieldNotIn(FieldGeoLocation, v...)) +} + +// GeoLocationIsNil applies the IsNil predicate on the "geo_location" field. +func GeoLocationIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldGeoLocation)) +} + +// GeoLocationNotNil applies the NotNil predicate on the "geo_location" field. +func GeoLocationNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldGeoLocation)) +} + +// OrganizationIDEQ applies the EQ predicate on the "organization_id" field. +func OrganizationIDEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEQ(FieldOrganizationID, v)) +} + +// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field. +func OrganizationIDNEQ(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNEQ(FieldOrganizationID, v)) +} + +// OrganizationIDIn applies the In predicate on the "organization_id" field. +func OrganizationIDIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field. +func OrganizationIDNotIn(vs ...string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDGT applies the GT predicate on the "organization_id" field. +func OrganizationIDGT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGT(FieldOrganizationID, v)) +} + +// OrganizationIDGTE applies the GTE predicate on the "organization_id" field. +func OrganizationIDGTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldGTE(FieldOrganizationID, v)) +} + +// OrganizationIDLT applies the LT predicate on the "organization_id" field. +func OrganizationIDLT(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLT(FieldOrganizationID, v)) +} + +// OrganizationIDLTE applies the LTE predicate on the "organization_id" field. +func OrganizationIDLTE(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldLTE(FieldOrganizationID, v)) +} + +// OrganizationIDContains applies the Contains predicate on the "organization_id" field. +func OrganizationIDContains(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContains(FieldOrganizationID, v)) +} + +// OrganizationIDHasPrefix applies the HasPrefix predicate on the "organization_id" field. +func OrganizationIDHasPrefix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldOrganizationID, v)) +} + +// OrganizationIDHasSuffix applies the HasSuffix predicate on the "organization_id" field. +func OrganizationIDHasSuffix(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldOrganizationID, v)) +} + +// OrganizationIDIsNil applies the IsNil predicate on the "organization_id" field. +func OrganizationIDIsNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldIsNull(FieldOrganizationID)) +} + +// OrganizationIDNotNil applies the NotNil predicate on the "organization_id" field. +func OrganizationIDNotNil() predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldNotNull(FieldOrganizationID)) +} + +// OrganizationIDEqualFold applies the EqualFold predicate on the "organization_id" field. +func OrganizationIDEqualFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldEqualFold(FieldOrganizationID, v)) +} + +// OrganizationIDContainsFold applies the ContainsFold predicate on the "organization_id" field. +func OrganizationIDContainsFold(v string) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.FieldContainsFold(FieldOrganizationID, v)) +} + +// HasOrganization applies the HasEdge predicate on the "organization" edge. +func HasOrganization() predicate.OrganizationSetting { + return predicate.OrganizationSetting(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, OrganizationTable, OrganizationColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationWith applies the HasEdge predicate on the "organization" edge with a given conditions (other predicates). +func HasOrganizationWith(preds ...predicate.Organization) predicate.OrganizationSetting { + return predicate.OrganizationSetting(func(s *sql.Selector) { + step := newOrganizationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSetting + 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.OrganizationSetting) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OrganizationSetting) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OrganizationSetting) predicate.OrganizationSetting { + return predicate.OrganizationSetting(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/organizationsetting_create.go b/internal/ent/generated/organizationsetting_create.go new file mode 100644 index 0000000..75cc243 --- /dev/null +++ b/internal/ent/generated/organizationsetting_create.go @@ -0,0 +1,552 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/pkg/enums" +) + +// OrganizationSettingCreate is the builder for creating a OrganizationSetting entity. +type OrganizationSettingCreate struct { + config + mutation *OrganizationSettingMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (osc *OrganizationSettingCreate) SetCreatedAt(t time.Time) *OrganizationSettingCreate { + osc.mutation.SetCreatedAt(t) + return osc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableCreatedAt(t *time.Time) *OrganizationSettingCreate { + if t != nil { + osc.SetCreatedAt(*t) + } + return osc +} + +// SetUpdatedAt sets the "updated_at" field. +func (osc *OrganizationSettingCreate) SetUpdatedAt(t time.Time) *OrganizationSettingCreate { + osc.mutation.SetUpdatedAt(t) + return osc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableUpdatedAt(t *time.Time) *OrganizationSettingCreate { + if t != nil { + osc.SetUpdatedAt(*t) + } + return osc +} + +// SetCreatedBy sets the "created_by" field. +func (osc *OrganizationSettingCreate) SetCreatedBy(s string) *OrganizationSettingCreate { + osc.mutation.SetCreatedBy(s) + return osc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableCreatedBy(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetCreatedBy(*s) + } + return osc +} + +// SetUpdatedBy sets the "updated_by" field. +func (osc *OrganizationSettingCreate) SetUpdatedBy(s string) *OrganizationSettingCreate { + osc.mutation.SetUpdatedBy(s) + return osc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableUpdatedBy(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetUpdatedBy(*s) + } + return osc +} + +// SetMappingID sets the "mapping_id" field. +func (osc *OrganizationSettingCreate) SetMappingID(s string) *OrganizationSettingCreate { + osc.mutation.SetMappingID(s) + return osc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableMappingID(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetMappingID(*s) + } + return osc +} + +// SetTags sets the "tags" field. +func (osc *OrganizationSettingCreate) SetTags(s []string) *OrganizationSettingCreate { + osc.mutation.SetTags(s) + return osc +} + +// SetDeletedAt sets the "deleted_at" field. +func (osc *OrganizationSettingCreate) SetDeletedAt(t time.Time) *OrganizationSettingCreate { + osc.mutation.SetDeletedAt(t) + return osc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableDeletedAt(t *time.Time) *OrganizationSettingCreate { + if t != nil { + osc.SetDeletedAt(*t) + } + return osc +} + +// SetDeletedBy sets the "deleted_by" field. +func (osc *OrganizationSettingCreate) SetDeletedBy(s string) *OrganizationSettingCreate { + osc.mutation.SetDeletedBy(s) + return osc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableDeletedBy(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetDeletedBy(*s) + } + return osc +} + +// SetDomains sets the "domains" field. +func (osc *OrganizationSettingCreate) SetDomains(s []string) *OrganizationSettingCreate { + osc.mutation.SetDomains(s) + return osc +} + +// SetBillingContact sets the "billing_contact" field. +func (osc *OrganizationSettingCreate) SetBillingContact(s string) *OrganizationSettingCreate { + osc.mutation.SetBillingContact(s) + return osc +} + +// SetNillableBillingContact sets the "billing_contact" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableBillingContact(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetBillingContact(*s) + } + return osc +} + +// SetBillingEmail sets the "billing_email" field. +func (osc *OrganizationSettingCreate) SetBillingEmail(s string) *OrganizationSettingCreate { + osc.mutation.SetBillingEmail(s) + return osc +} + +// SetNillableBillingEmail sets the "billing_email" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableBillingEmail(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetBillingEmail(*s) + } + return osc +} + +// SetBillingPhone sets the "billing_phone" field. +func (osc *OrganizationSettingCreate) SetBillingPhone(s string) *OrganizationSettingCreate { + osc.mutation.SetBillingPhone(s) + return osc +} + +// SetNillableBillingPhone sets the "billing_phone" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableBillingPhone(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetBillingPhone(*s) + } + return osc +} + +// SetBillingAddress sets the "billing_address" field. +func (osc *OrganizationSettingCreate) SetBillingAddress(s string) *OrganizationSettingCreate { + osc.mutation.SetBillingAddress(s) + return osc +} + +// SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableBillingAddress(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetBillingAddress(*s) + } + return osc +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (osc *OrganizationSettingCreate) SetTaxIdentifier(s string) *OrganizationSettingCreate { + osc.mutation.SetTaxIdentifier(s) + return osc +} + +// SetNillableTaxIdentifier sets the "tax_identifier" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableTaxIdentifier(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetTaxIdentifier(*s) + } + return osc +} + +// SetGeoLocation sets the "geo_location" field. +func (osc *OrganizationSettingCreate) SetGeoLocation(e enums.Region) *OrganizationSettingCreate { + osc.mutation.SetGeoLocation(e) + return osc +} + +// SetNillableGeoLocation sets the "geo_location" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableGeoLocation(e *enums.Region) *OrganizationSettingCreate { + if e != nil { + osc.SetGeoLocation(*e) + } + return osc +} + +// SetOrganizationID sets the "organization_id" field. +func (osc *OrganizationSettingCreate) SetOrganizationID(s string) *OrganizationSettingCreate { + osc.mutation.SetOrganizationID(s) + return osc +} + +// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableOrganizationID(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetOrganizationID(*s) + } + return osc +} + +// SetID sets the "id" field. +func (osc *OrganizationSettingCreate) SetID(s string) *OrganizationSettingCreate { + osc.mutation.SetID(s) + return osc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (osc *OrganizationSettingCreate) SetNillableID(s *string) *OrganizationSettingCreate { + if s != nil { + osc.SetID(*s) + } + return osc +} + +// SetOrganization sets the "organization" edge to the Organization entity. +func (osc *OrganizationSettingCreate) SetOrganization(o *Organization) *OrganizationSettingCreate { + return osc.SetOrganizationID(o.ID) +} + +// Mutation returns the OrganizationSettingMutation object of the builder. +func (osc *OrganizationSettingCreate) Mutation() *OrganizationSettingMutation { + return osc.mutation +} + +// Save creates the OrganizationSetting in the database. +func (osc *OrganizationSettingCreate) Save(ctx context.Context) (*OrganizationSetting, error) { + if err := osc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, osc.sqlSave, osc.mutation, osc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (osc *OrganizationSettingCreate) SaveX(ctx context.Context) *OrganizationSetting { + v, err := osc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (osc *OrganizationSettingCreate) Exec(ctx context.Context) error { + _, err := osc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (osc *OrganizationSettingCreate) ExecX(ctx context.Context) { + if err := osc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (osc *OrganizationSettingCreate) defaults() error { + if _, ok := osc.mutation.CreatedAt(); !ok { + if organizationsetting.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsetting.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := organizationsetting.DefaultCreatedAt() + osc.mutation.SetCreatedAt(v) + } + if _, ok := osc.mutation.UpdatedAt(); !ok { + if organizationsetting.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsetting.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationsetting.DefaultUpdatedAt() + osc.mutation.SetUpdatedAt(v) + } + if _, ok := osc.mutation.MappingID(); !ok { + if organizationsetting.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized organizationsetting.DefaultMappingID (forgotten import generated/runtime?)") + } + v := organizationsetting.DefaultMappingID() + osc.mutation.SetMappingID(v) + } + if _, ok := osc.mutation.Tags(); !ok { + v := organizationsetting.DefaultTags + osc.mutation.SetTags(v) + } + if _, ok := osc.mutation.GeoLocation(); !ok { + v := organizationsetting.DefaultGeoLocation + osc.mutation.SetGeoLocation(v) + } + if _, ok := osc.mutation.ID(); !ok { + if organizationsetting.DefaultID == nil { + return fmt.Errorf("generated: uninitialized organizationsetting.DefaultID (forgotten import generated/runtime?)") + } + v := organizationsetting.DefaultID() + osc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (osc *OrganizationSettingCreate) check() error { + if _, ok := osc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OrganizationSetting.mapping_id"`)} + } + if v, ok := osc.mutation.Domains(); ok { + if err := organizationsetting.DomainsValidator(v); err != nil { + return &ValidationError{Name: "domains", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.domains": %w`, err)} + } + } + if v, ok := osc.mutation.BillingEmail(); ok { + if err := organizationsetting.BillingEmailValidator(v); err != nil { + return &ValidationError{Name: "billing_email", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.billing_email": %w`, err)} + } + } + if v, ok := osc.mutation.BillingPhone(); ok { + if err := organizationsetting.BillingPhoneValidator(v); err != nil { + return &ValidationError{Name: "billing_phone", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.billing_phone": %w`, err)} + } + } + if v, ok := osc.mutation.GeoLocation(); ok { + if err := organizationsetting.GeoLocationValidator(v); err != nil { + return &ValidationError{Name: "geo_location", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.geo_location": %w`, err)} + } + } + return nil +} + +func (osc *OrganizationSettingCreate) sqlSave(ctx context.Context) (*OrganizationSetting, error) { + if err := osc.check(); err != nil { + return nil, err + } + _node, _spec := osc.createSpec() + if err := sqlgraph.CreateNode(ctx, osc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OrganizationSetting.ID type: %T", _spec.ID.Value) + } + } + osc.mutation.id = &_node.ID + osc.mutation.done = true + return _node, nil +} + +func (osc *OrganizationSettingCreate) createSpec() (*OrganizationSetting, *sqlgraph.CreateSpec) { + var ( + _node = &OrganizationSetting{config: osc.config} + _spec = sqlgraph.NewCreateSpec(organizationsetting.Table, sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString)) + ) + _spec.Schema = osc.schemaConfig.OrganizationSetting + if id, ok := osc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := osc.mutation.CreatedAt(); ok { + _spec.SetField(organizationsetting.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := osc.mutation.UpdatedAt(); ok { + _spec.SetField(organizationsetting.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := osc.mutation.CreatedBy(); ok { + _spec.SetField(organizationsetting.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := osc.mutation.UpdatedBy(); ok { + _spec.SetField(organizationsetting.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := osc.mutation.MappingID(); ok { + _spec.SetField(organizationsetting.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := osc.mutation.Tags(); ok { + _spec.SetField(organizationsetting.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := osc.mutation.DeletedAt(); ok { + _spec.SetField(organizationsetting.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := osc.mutation.DeletedBy(); ok { + _spec.SetField(organizationsetting.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := osc.mutation.Domains(); ok { + _spec.SetField(organizationsetting.FieldDomains, field.TypeJSON, value) + _node.Domains = value + } + if value, ok := osc.mutation.BillingContact(); ok { + _spec.SetField(organizationsetting.FieldBillingContact, field.TypeString, value) + _node.BillingContact = value + } + if value, ok := osc.mutation.BillingEmail(); ok { + _spec.SetField(organizationsetting.FieldBillingEmail, field.TypeString, value) + _node.BillingEmail = value + } + if value, ok := osc.mutation.BillingPhone(); ok { + _spec.SetField(organizationsetting.FieldBillingPhone, field.TypeString, value) + _node.BillingPhone = value + } + if value, ok := osc.mutation.BillingAddress(); ok { + _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeString, value) + _node.BillingAddress = value + } + if value, ok := osc.mutation.TaxIdentifier(); ok { + _spec.SetField(organizationsetting.FieldTaxIdentifier, field.TypeString, value) + _node.TaxIdentifier = value + } + if value, ok := osc.mutation.GeoLocation(); ok { + _spec.SetField(organizationsetting.FieldGeoLocation, field.TypeEnum, value) + _node.GeoLocation = value + } + if nodes := osc.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: organizationsetting.OrganizationTable, + Columns: []string{organizationsetting.OrganizationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = osc.schemaConfig.OrganizationSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OrganizationID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OrganizationSettingCreateBulk is the builder for creating many OrganizationSetting entities in bulk. +type OrganizationSettingCreateBulk struct { + config + err error + builders []*OrganizationSettingCreate +} + +// Save creates the OrganizationSetting entities in the database. +func (oscb *OrganizationSettingCreateBulk) Save(ctx context.Context) ([]*OrganizationSetting, error) { + if oscb.err != nil { + return nil, oscb.err + } + specs := make([]*sqlgraph.CreateSpec, len(oscb.builders)) + nodes := make([]*OrganizationSetting, len(oscb.builders)) + mutators := make([]Mutator, len(oscb.builders)) + for i := range oscb.builders { + func(i int, root context.Context) { + builder := oscb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OrganizationSettingMutation) + 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, oscb.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, oscb.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, oscb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (oscb *OrganizationSettingCreateBulk) SaveX(ctx context.Context) []*OrganizationSetting { + v, err := oscb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (oscb *OrganizationSettingCreateBulk) Exec(ctx context.Context) error { + _, err := oscb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oscb *OrganizationSettingCreateBulk) ExecX(ctx context.Context) { + if err := oscb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organizationsetting_delete.go b/internal/ent/generated/organizationsetting_delete.go new file mode 100644 index 0000000..f4de5b5 --- /dev/null +++ b/internal/ent/generated/organizationsetting_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" +) + +// OrganizationSettingDelete is the builder for deleting a OrganizationSetting entity. +type OrganizationSettingDelete struct { + config + hooks []Hook + mutation *OrganizationSettingMutation +} + +// Where appends a list predicates to the OrganizationSettingDelete builder. +func (osd *OrganizationSettingDelete) Where(ps ...predicate.OrganizationSetting) *OrganizationSettingDelete { + osd.mutation.Where(ps...) + return osd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (osd *OrganizationSettingDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, osd.sqlExec, osd.mutation, osd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (osd *OrganizationSettingDelete) ExecX(ctx context.Context) int { + n, err := osd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (osd *OrganizationSettingDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(organizationsetting.Table, sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString)) + _spec.Node.Schema = osd.schemaConfig.OrganizationSetting + ctx = internal.NewSchemaConfigContext(ctx, osd.schemaConfig) + if ps := osd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, osd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + osd.mutation.done = true + return affected, err +} + +// OrganizationSettingDeleteOne is the builder for deleting a single OrganizationSetting entity. +type OrganizationSettingDeleteOne struct { + osd *OrganizationSettingDelete +} + +// Where appends a list predicates to the OrganizationSettingDelete builder. +func (osdo *OrganizationSettingDeleteOne) Where(ps ...predicate.OrganizationSetting) *OrganizationSettingDeleteOne { + osdo.osd.mutation.Where(ps...) + return osdo +} + +// Exec executes the deletion query. +func (osdo *OrganizationSettingDeleteOne) Exec(ctx context.Context) error { + n, err := osdo.osd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{organizationsetting.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (osdo *OrganizationSettingDeleteOne) ExecX(ctx context.Context) { + if err := osdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organizationsetting_query.go b/internal/ent/generated/organizationsetting_query.go new file mode 100644 index 0000000..a421bc8 --- /dev/null +++ b/internal/ent/generated/organizationsetting_query.go @@ -0,0 +1,638 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationSettingQuery is the builder for querying OrganizationSetting entities. +type OrganizationSettingQuery struct { + config + ctx *QueryContext + order []organizationsetting.OrderOption + inters []Interceptor + predicates []predicate.OrganizationSetting + withOrganization *OrganizationQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OrganizationSetting) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OrganizationSettingQuery builder. +func (osq *OrganizationSettingQuery) Where(ps ...predicate.OrganizationSetting) *OrganizationSettingQuery { + osq.predicates = append(osq.predicates, ps...) + return osq +} + +// Limit the number of records to be returned by this query. +func (osq *OrganizationSettingQuery) Limit(limit int) *OrganizationSettingQuery { + osq.ctx.Limit = &limit + return osq +} + +// Offset to start from. +func (osq *OrganizationSettingQuery) Offset(offset int) *OrganizationSettingQuery { + osq.ctx.Offset = &offset + return osq +} + +// 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 (osq *OrganizationSettingQuery) Unique(unique bool) *OrganizationSettingQuery { + osq.ctx.Unique = &unique + return osq +} + +// Order specifies how the records should be ordered. +func (osq *OrganizationSettingQuery) Order(o ...organizationsetting.OrderOption) *OrganizationSettingQuery { + osq.order = append(osq.order, o...) + return osq +} + +// QueryOrganization chains the current query on the "organization" edge. +func (osq *OrganizationSettingQuery) QueryOrganization() *OrganizationQuery { + query := (&OrganizationClient{config: osq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := osq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := osq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(organizationsetting.Table, organizationsetting.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, organizationsetting.OrganizationTable, organizationsetting.OrganizationColumn), + ) + schemaConfig := osq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationSetting + fromU = sqlgraph.SetNeighbors(osq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first OrganizationSetting entity from the query. +// Returns a *NotFoundError when no OrganizationSetting was found. +func (osq *OrganizationSettingQuery) First(ctx context.Context) (*OrganizationSetting, error) { + nodes, err := osq.Limit(1).All(setContextOp(ctx, osq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{organizationsetting.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (osq *OrganizationSettingQuery) FirstX(ctx context.Context) *OrganizationSetting { + node, err := osq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OrganizationSetting ID from the query. +// Returns a *NotFoundError when no OrganizationSetting ID was found. +func (osq *OrganizationSettingQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = osq.Limit(1).IDs(setContextOp(ctx, osq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{organizationsetting.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (osq *OrganizationSettingQuery) FirstIDX(ctx context.Context) string { + id, err := osq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OrganizationSetting entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OrganizationSetting entity is found. +// Returns a *NotFoundError when no OrganizationSetting entities are found. +func (osq *OrganizationSettingQuery) Only(ctx context.Context) (*OrganizationSetting, error) { + nodes, err := osq.Limit(2).All(setContextOp(ctx, osq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{organizationsetting.Label} + default: + return nil, &NotSingularError{organizationsetting.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (osq *OrganizationSettingQuery) OnlyX(ctx context.Context) *OrganizationSetting { + node, err := osq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OrganizationSetting ID in the query. +// Returns a *NotSingularError when more than one OrganizationSetting ID is found. +// Returns a *NotFoundError when no entities are found. +func (osq *OrganizationSettingQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = osq.Limit(2).IDs(setContextOp(ctx, osq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{organizationsetting.Label} + default: + err = &NotSingularError{organizationsetting.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (osq *OrganizationSettingQuery) OnlyIDX(ctx context.Context) string { + id, err := osq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OrganizationSettings. +func (osq *OrganizationSettingQuery) All(ctx context.Context) ([]*OrganizationSetting, error) { + ctx = setContextOp(ctx, osq.ctx, ent.OpQueryAll) + if err := osq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OrganizationSetting, *OrganizationSettingQuery]() + return withInterceptors[[]*OrganizationSetting](ctx, osq, qr, osq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (osq *OrganizationSettingQuery) AllX(ctx context.Context) []*OrganizationSetting { + nodes, err := osq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OrganizationSetting IDs. +func (osq *OrganizationSettingQuery) IDs(ctx context.Context) (ids []string, err error) { + if osq.ctx.Unique == nil && osq.path != nil { + osq.Unique(true) + } + ctx = setContextOp(ctx, osq.ctx, ent.OpQueryIDs) + if err = osq.Select(organizationsetting.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (osq *OrganizationSettingQuery) IDsX(ctx context.Context) []string { + ids, err := osq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (osq *OrganizationSettingQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, osq.ctx, ent.OpQueryCount) + if err := osq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, osq, querierCount[*OrganizationSettingQuery](), osq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (osq *OrganizationSettingQuery) CountX(ctx context.Context) int { + count, err := osq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (osq *OrganizationSettingQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, osq.ctx, ent.OpQueryExist) + switch _, err := osq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (osq *OrganizationSettingQuery) ExistX(ctx context.Context) bool { + exist, err := osq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OrganizationSettingQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (osq *OrganizationSettingQuery) Clone() *OrganizationSettingQuery { + if osq == nil { + return nil + } + return &OrganizationSettingQuery{ + config: osq.config, + ctx: osq.ctx.Clone(), + order: append([]organizationsetting.OrderOption{}, osq.order...), + inters: append([]Interceptor{}, osq.inters...), + predicates: append([]predicate.OrganizationSetting{}, osq.predicates...), + withOrganization: osq.withOrganization.Clone(), + // clone intermediate query. + sql: osq.sql.Clone(), + path: osq.path, + } +} + +// WithOrganization tells the query-builder to eager-load the nodes that are connected to +// the "organization" edge. The optional arguments are used to configure the query builder of the edge. +func (osq *OrganizationSettingQuery) WithOrganization(opts ...func(*OrganizationQuery)) *OrganizationSettingQuery { + query := (&OrganizationClient{config: osq.config}).Query() + for _, opt := range opts { + opt(query) + } + osq.withOrganization = query + return osq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OrganizationSetting.Query(). +// GroupBy(organizationsetting.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (osq *OrganizationSettingQuery) GroupBy(field string, fields ...string) *OrganizationSettingGroupBy { + osq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OrganizationSettingGroupBy{build: osq} + grbuild.flds = &osq.ctx.Fields + grbuild.label = organizationsetting.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.OrganizationSetting.Query(). +// Select(organizationsetting.FieldCreatedAt). +// Scan(ctx, &v) +func (osq *OrganizationSettingQuery) Select(fields ...string) *OrganizationSettingSelect { + osq.ctx.Fields = append(osq.ctx.Fields, fields...) + sbuild := &OrganizationSettingSelect{OrganizationSettingQuery: osq} + sbuild.label = organizationsetting.Label + sbuild.flds, sbuild.scan = &osq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OrganizationSettingSelect configured with the given aggregations. +func (osq *OrganizationSettingQuery) Aggregate(fns ...AggregateFunc) *OrganizationSettingSelect { + return osq.Select().Aggregate(fns...) +} + +func (osq *OrganizationSettingQuery) prepareQuery(ctx context.Context) error { + for _, inter := range osq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, osq); err != nil { + return err + } + } + } + for _, f := range osq.ctx.Fields { + if !organizationsetting.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if osq.path != nil { + prev, err := osq.path(ctx) + if err != nil { + return err + } + osq.sql = prev + } + if organizationsetting.Policy == nil { + return errors.New("generated: uninitialized organizationsetting.Policy (forgotten import generated/runtime?)") + } + if err := organizationsetting.Policy.EvalQuery(ctx, osq); err != nil { + return err + } + return nil +} + +func (osq *OrganizationSettingQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OrganizationSetting, error) { + var ( + nodes = []*OrganizationSetting{} + _spec = osq.querySpec() + loadedTypes = [1]bool{ + osq.withOrganization != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OrganizationSetting).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OrganizationSetting{config: osq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = osq.schemaConfig.OrganizationSetting + ctx = internal.NewSchemaConfigContext(ctx, osq.schemaConfig) + if len(osq.modifiers) > 0 { + _spec.Modifiers = osq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, osq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := osq.withOrganization; query != nil { + if err := osq.loadOrganization(ctx, query, nodes, nil, + func(n *OrganizationSetting, e *Organization) { n.Edges.Organization = e }); err != nil { + return nil, err + } + } + for i := range osq.loadTotal { + if err := osq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (osq *OrganizationSettingQuery) loadOrganization(ctx context.Context, query *OrganizationQuery, nodes []*OrganizationSetting, init func(*OrganizationSetting), assign func(*OrganizationSetting, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*OrganizationSetting) + for i := range nodes { + fk := nodes[i].OrganizationID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "organization_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (osq *OrganizationSettingQuery) sqlCount(ctx context.Context) (int, error) { + _spec := osq.querySpec() + _spec.Node.Schema = osq.schemaConfig.OrganizationSetting + ctx = internal.NewSchemaConfigContext(ctx, osq.schemaConfig) + if len(osq.modifiers) > 0 { + _spec.Modifiers = osq.modifiers + } + _spec.Node.Columns = osq.ctx.Fields + if len(osq.ctx.Fields) > 0 { + _spec.Unique = osq.ctx.Unique != nil && *osq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, osq.driver, _spec) +} + +func (osq *OrganizationSettingQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(organizationsetting.Table, organizationsetting.Columns, sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString)) + _spec.From = osq.sql + if unique := osq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if osq.path != nil { + _spec.Unique = true + } + if fields := osq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organizationsetting.FieldID) + for i := range fields { + if fields[i] != organizationsetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if osq.withOrganization != nil { + _spec.Node.AddColumnOnce(organizationsetting.FieldOrganizationID) + } + } + if ps := osq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := osq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := osq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := osq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (osq *OrganizationSettingQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(osq.driver.Dialect()) + t1 := builder.Table(organizationsetting.Table) + columns := osq.ctx.Fields + if len(columns) == 0 { + columns = organizationsetting.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if osq.sql != nil { + selector = osq.sql + selector.Select(selector.Columns(columns...)...) + } + if osq.ctx.Unique != nil && *osq.ctx.Unique { + selector.Distinct() + } + t1.Schema(osq.schemaConfig.OrganizationSetting) + ctx = internal.NewSchemaConfigContext(ctx, osq.schemaConfig) + selector.WithContext(ctx) + for _, p := range osq.predicates { + p(selector) + } + for _, p := range osq.order { + p(selector) + } + if offset := osq.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 := osq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// OrganizationSettingGroupBy is the group-by builder for OrganizationSetting entities. +type OrganizationSettingGroupBy struct { + selector + build *OrganizationSettingQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (osgb *OrganizationSettingGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationSettingGroupBy { + osgb.fns = append(osgb.fns, fns...) + return osgb +} + +// Scan applies the selector query and scans the result into the given value. +func (osgb *OrganizationSettingGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, osgb.build.ctx, ent.OpQueryGroupBy) + if err := osgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationSettingQuery, *OrganizationSettingGroupBy](ctx, osgb.build, osgb, osgb.build.inters, v) +} + +func (osgb *OrganizationSettingGroupBy) sqlScan(ctx context.Context, root *OrganizationSettingQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(osgb.fns)) + for _, fn := range osgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*osgb.flds)+len(osgb.fns)) + for _, f := range *osgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*osgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := osgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OrganizationSettingSelect is the builder for selecting fields of OrganizationSetting entities. +type OrganizationSettingSelect struct { + *OrganizationSettingQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (oss *OrganizationSettingSelect) Aggregate(fns ...AggregateFunc) *OrganizationSettingSelect { + oss.fns = append(oss.fns, fns...) + return oss +} + +// Scan applies the selector query and scans the result into the given value. +func (oss *OrganizationSettingSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, oss.ctx, ent.OpQuerySelect) + if err := oss.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationSettingQuery, *OrganizationSettingSelect](ctx, oss.OrganizationSettingQuery, oss, oss.inters, v) +} + +func (oss *OrganizationSettingSelect) sqlScan(ctx context.Context, root *OrganizationSettingQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(oss.fns)) + for _, fn := range oss.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*oss.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 := oss.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/organizationsetting_update.go b/internal/ent/generated/organizationsetting_update.go new file mode 100644 index 0000000..ce2afe9 --- /dev/null +++ b/internal/ent/generated/organizationsetting_update.go @@ -0,0 +1,1027 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationSettingUpdate is the builder for updating OrganizationSetting entities. +type OrganizationSettingUpdate struct { + config + hooks []Hook + mutation *OrganizationSettingMutation +} + +// Where appends a list predicates to the OrganizationSettingUpdate builder. +func (osu *OrganizationSettingUpdate) Where(ps ...predicate.OrganizationSetting) *OrganizationSettingUpdate { + osu.mutation.Where(ps...) + return osu +} + +// SetUpdatedAt sets the "updated_at" field. +func (osu *OrganizationSettingUpdate) SetUpdatedAt(t time.Time) *OrganizationSettingUpdate { + osu.mutation.SetUpdatedAt(t) + return osu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (osu *OrganizationSettingUpdate) ClearUpdatedAt() *OrganizationSettingUpdate { + osu.mutation.ClearUpdatedAt() + return osu +} + +// SetUpdatedBy sets the "updated_by" field. +func (osu *OrganizationSettingUpdate) SetUpdatedBy(s string) *OrganizationSettingUpdate { + osu.mutation.SetUpdatedBy(s) + return osu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableUpdatedBy(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetUpdatedBy(*s) + } + return osu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (osu *OrganizationSettingUpdate) ClearUpdatedBy() *OrganizationSettingUpdate { + osu.mutation.ClearUpdatedBy() + return osu +} + +// SetTags sets the "tags" field. +func (osu *OrganizationSettingUpdate) SetTags(s []string) *OrganizationSettingUpdate { + osu.mutation.SetTags(s) + return osu +} + +// AppendTags appends s to the "tags" field. +func (osu *OrganizationSettingUpdate) AppendTags(s []string) *OrganizationSettingUpdate { + osu.mutation.AppendTags(s) + return osu +} + +// ClearTags clears the value of the "tags" field. +func (osu *OrganizationSettingUpdate) ClearTags() *OrganizationSettingUpdate { + osu.mutation.ClearTags() + return osu +} + +// SetDeletedAt sets the "deleted_at" field. +func (osu *OrganizationSettingUpdate) SetDeletedAt(t time.Time) *OrganizationSettingUpdate { + osu.mutation.SetDeletedAt(t) + return osu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableDeletedAt(t *time.Time) *OrganizationSettingUpdate { + if t != nil { + osu.SetDeletedAt(*t) + } + return osu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (osu *OrganizationSettingUpdate) ClearDeletedAt() *OrganizationSettingUpdate { + osu.mutation.ClearDeletedAt() + return osu +} + +// SetDeletedBy sets the "deleted_by" field. +func (osu *OrganizationSettingUpdate) SetDeletedBy(s string) *OrganizationSettingUpdate { + osu.mutation.SetDeletedBy(s) + return osu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableDeletedBy(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetDeletedBy(*s) + } + return osu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (osu *OrganizationSettingUpdate) ClearDeletedBy() *OrganizationSettingUpdate { + osu.mutation.ClearDeletedBy() + return osu +} + +// SetDomains sets the "domains" field. +func (osu *OrganizationSettingUpdate) SetDomains(s []string) *OrganizationSettingUpdate { + osu.mutation.SetDomains(s) + return osu +} + +// AppendDomains appends s to the "domains" field. +func (osu *OrganizationSettingUpdate) AppendDomains(s []string) *OrganizationSettingUpdate { + osu.mutation.AppendDomains(s) + return osu +} + +// ClearDomains clears the value of the "domains" field. +func (osu *OrganizationSettingUpdate) ClearDomains() *OrganizationSettingUpdate { + osu.mutation.ClearDomains() + return osu +} + +// SetBillingContact sets the "billing_contact" field. +func (osu *OrganizationSettingUpdate) SetBillingContact(s string) *OrganizationSettingUpdate { + osu.mutation.SetBillingContact(s) + return osu +} + +// SetNillableBillingContact sets the "billing_contact" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableBillingContact(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetBillingContact(*s) + } + return osu +} + +// ClearBillingContact clears the value of the "billing_contact" field. +func (osu *OrganizationSettingUpdate) ClearBillingContact() *OrganizationSettingUpdate { + osu.mutation.ClearBillingContact() + return osu +} + +// SetBillingEmail sets the "billing_email" field. +func (osu *OrganizationSettingUpdate) SetBillingEmail(s string) *OrganizationSettingUpdate { + osu.mutation.SetBillingEmail(s) + return osu +} + +// SetNillableBillingEmail sets the "billing_email" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableBillingEmail(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetBillingEmail(*s) + } + return osu +} + +// ClearBillingEmail clears the value of the "billing_email" field. +func (osu *OrganizationSettingUpdate) ClearBillingEmail() *OrganizationSettingUpdate { + osu.mutation.ClearBillingEmail() + return osu +} + +// SetBillingPhone sets the "billing_phone" field. +func (osu *OrganizationSettingUpdate) SetBillingPhone(s string) *OrganizationSettingUpdate { + osu.mutation.SetBillingPhone(s) + return osu +} + +// SetNillableBillingPhone sets the "billing_phone" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableBillingPhone(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetBillingPhone(*s) + } + return osu +} + +// ClearBillingPhone clears the value of the "billing_phone" field. +func (osu *OrganizationSettingUpdate) ClearBillingPhone() *OrganizationSettingUpdate { + osu.mutation.ClearBillingPhone() + return osu +} + +// SetBillingAddress sets the "billing_address" field. +func (osu *OrganizationSettingUpdate) SetBillingAddress(s string) *OrganizationSettingUpdate { + osu.mutation.SetBillingAddress(s) + return osu +} + +// SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableBillingAddress(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetBillingAddress(*s) + } + return osu +} + +// ClearBillingAddress clears the value of the "billing_address" field. +func (osu *OrganizationSettingUpdate) ClearBillingAddress() *OrganizationSettingUpdate { + osu.mutation.ClearBillingAddress() + return osu +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (osu *OrganizationSettingUpdate) SetTaxIdentifier(s string) *OrganizationSettingUpdate { + osu.mutation.SetTaxIdentifier(s) + return osu +} + +// SetNillableTaxIdentifier sets the "tax_identifier" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableTaxIdentifier(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetTaxIdentifier(*s) + } + return osu +} + +// ClearTaxIdentifier clears the value of the "tax_identifier" field. +func (osu *OrganizationSettingUpdate) ClearTaxIdentifier() *OrganizationSettingUpdate { + osu.mutation.ClearTaxIdentifier() + return osu +} + +// SetGeoLocation sets the "geo_location" field. +func (osu *OrganizationSettingUpdate) SetGeoLocation(e enums.Region) *OrganizationSettingUpdate { + osu.mutation.SetGeoLocation(e) + return osu +} + +// SetNillableGeoLocation sets the "geo_location" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableGeoLocation(e *enums.Region) *OrganizationSettingUpdate { + if e != nil { + osu.SetGeoLocation(*e) + } + return osu +} + +// ClearGeoLocation clears the value of the "geo_location" field. +func (osu *OrganizationSettingUpdate) ClearGeoLocation() *OrganizationSettingUpdate { + osu.mutation.ClearGeoLocation() + return osu +} + +// SetOrganizationID sets the "organization_id" field. +func (osu *OrganizationSettingUpdate) SetOrganizationID(s string) *OrganizationSettingUpdate { + osu.mutation.SetOrganizationID(s) + return osu +} + +// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil. +func (osu *OrganizationSettingUpdate) SetNillableOrganizationID(s *string) *OrganizationSettingUpdate { + if s != nil { + osu.SetOrganizationID(*s) + } + return osu +} + +// ClearOrganizationID clears the value of the "organization_id" field. +func (osu *OrganizationSettingUpdate) ClearOrganizationID() *OrganizationSettingUpdate { + osu.mutation.ClearOrganizationID() + return osu +} + +// SetOrganization sets the "organization" edge to the Organization entity. +func (osu *OrganizationSettingUpdate) SetOrganization(o *Organization) *OrganizationSettingUpdate { + return osu.SetOrganizationID(o.ID) +} + +// Mutation returns the OrganizationSettingMutation object of the builder. +func (osu *OrganizationSettingUpdate) Mutation() *OrganizationSettingMutation { + return osu.mutation +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (osu *OrganizationSettingUpdate) ClearOrganization() *OrganizationSettingUpdate { + osu.mutation.ClearOrganization() + return osu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (osu *OrganizationSettingUpdate) Save(ctx context.Context) (int, error) { + if err := osu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, osu.sqlSave, osu.mutation, osu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (osu *OrganizationSettingUpdate) SaveX(ctx context.Context) int { + affected, err := osu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (osu *OrganizationSettingUpdate) Exec(ctx context.Context) error { + _, err := osu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (osu *OrganizationSettingUpdate) ExecX(ctx context.Context) { + if err := osu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (osu *OrganizationSettingUpdate) defaults() error { + if _, ok := osu.mutation.UpdatedAt(); !ok && !osu.mutation.UpdatedAtCleared() { + if organizationsetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationsetting.UpdateDefaultUpdatedAt() + osu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (osu *OrganizationSettingUpdate) check() error { + if v, ok := osu.mutation.Domains(); ok { + if err := organizationsetting.DomainsValidator(v); err != nil { + return &ValidationError{Name: "domains", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.domains": %w`, err)} + } + } + if v, ok := osu.mutation.BillingEmail(); ok { + if err := organizationsetting.BillingEmailValidator(v); err != nil { + return &ValidationError{Name: "billing_email", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.billing_email": %w`, err)} + } + } + if v, ok := osu.mutation.BillingPhone(); ok { + if err := organizationsetting.BillingPhoneValidator(v); err != nil { + return &ValidationError{Name: "billing_phone", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.billing_phone": %w`, err)} + } + } + if v, ok := osu.mutation.GeoLocation(); ok { + if err := organizationsetting.GeoLocationValidator(v); err != nil { + return &ValidationError{Name: "geo_location", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.geo_location": %w`, err)} + } + } + return nil +} + +func (osu *OrganizationSettingUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := osu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(organizationsetting.Table, organizationsetting.Columns, sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString)) + if ps := osu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if osu.mutation.CreatedAtCleared() { + _spec.ClearField(organizationsetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := osu.mutation.UpdatedAt(); ok { + _spec.SetField(organizationsetting.FieldUpdatedAt, field.TypeTime, value) + } + if osu.mutation.UpdatedAtCleared() { + _spec.ClearField(organizationsetting.FieldUpdatedAt, field.TypeTime) + } + if osu.mutation.CreatedByCleared() { + _spec.ClearField(organizationsetting.FieldCreatedBy, field.TypeString) + } + if value, ok := osu.mutation.UpdatedBy(); ok { + _spec.SetField(organizationsetting.FieldUpdatedBy, field.TypeString, value) + } + if osu.mutation.UpdatedByCleared() { + _spec.ClearField(organizationsetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := osu.mutation.Tags(); ok { + _spec.SetField(organizationsetting.FieldTags, field.TypeJSON, value) + } + if value, ok := osu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsetting.FieldTags, value) + }) + } + if osu.mutation.TagsCleared() { + _spec.ClearField(organizationsetting.FieldTags, field.TypeJSON) + } + if value, ok := osu.mutation.DeletedAt(); ok { + _spec.SetField(organizationsetting.FieldDeletedAt, field.TypeTime, value) + } + if osu.mutation.DeletedAtCleared() { + _spec.ClearField(organizationsetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := osu.mutation.DeletedBy(); ok { + _spec.SetField(organizationsetting.FieldDeletedBy, field.TypeString, value) + } + if osu.mutation.DeletedByCleared() { + _spec.ClearField(organizationsetting.FieldDeletedBy, field.TypeString) + } + if value, ok := osu.mutation.Domains(); ok { + _spec.SetField(organizationsetting.FieldDomains, field.TypeJSON, value) + } + if value, ok := osu.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsetting.FieldDomains, value) + }) + } + if osu.mutation.DomainsCleared() { + _spec.ClearField(organizationsetting.FieldDomains, field.TypeJSON) + } + if value, ok := osu.mutation.BillingContact(); ok { + _spec.SetField(organizationsetting.FieldBillingContact, field.TypeString, value) + } + if osu.mutation.BillingContactCleared() { + _spec.ClearField(organizationsetting.FieldBillingContact, field.TypeString) + } + if value, ok := osu.mutation.BillingEmail(); ok { + _spec.SetField(organizationsetting.FieldBillingEmail, field.TypeString, value) + } + if osu.mutation.BillingEmailCleared() { + _spec.ClearField(organizationsetting.FieldBillingEmail, field.TypeString) + } + if value, ok := osu.mutation.BillingPhone(); ok { + _spec.SetField(organizationsetting.FieldBillingPhone, field.TypeString, value) + } + if osu.mutation.BillingPhoneCleared() { + _spec.ClearField(organizationsetting.FieldBillingPhone, field.TypeString) + } + if value, ok := osu.mutation.BillingAddress(); ok { + _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeString, value) + } + if osu.mutation.BillingAddressCleared() { + _spec.ClearField(organizationsetting.FieldBillingAddress, field.TypeString) + } + if value, ok := osu.mutation.TaxIdentifier(); ok { + _spec.SetField(organizationsetting.FieldTaxIdentifier, field.TypeString, value) + } + if osu.mutation.TaxIdentifierCleared() { + _spec.ClearField(organizationsetting.FieldTaxIdentifier, field.TypeString) + } + if value, ok := osu.mutation.GeoLocation(); ok { + _spec.SetField(organizationsetting.FieldGeoLocation, field.TypeEnum, value) + } + if osu.mutation.GeoLocationCleared() { + _spec.ClearField(organizationsetting.FieldGeoLocation, field.TypeEnum) + } + if osu.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: organizationsetting.OrganizationTable, + Columns: []string{organizationsetting.OrganizationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = osu.schemaConfig.OrganizationSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := osu.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: organizationsetting.OrganizationTable, + Columns: []string{organizationsetting.OrganizationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = osu.schemaConfig.OrganizationSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = osu.schemaConfig.OrganizationSetting + ctx = internal.NewSchemaConfigContext(ctx, osu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, osu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organizationsetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + osu.mutation.done = true + return n, nil +} + +// OrganizationSettingUpdateOne is the builder for updating a single OrganizationSetting entity. +type OrganizationSettingUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OrganizationSettingMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (osuo *OrganizationSettingUpdateOne) SetUpdatedAt(t time.Time) *OrganizationSettingUpdateOne { + osuo.mutation.SetUpdatedAt(t) + return osuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (osuo *OrganizationSettingUpdateOne) ClearUpdatedAt() *OrganizationSettingUpdateOne { + osuo.mutation.ClearUpdatedAt() + return osuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (osuo *OrganizationSettingUpdateOne) SetUpdatedBy(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetUpdatedBy(s) + return osuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableUpdatedBy(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetUpdatedBy(*s) + } + return osuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (osuo *OrganizationSettingUpdateOne) ClearUpdatedBy() *OrganizationSettingUpdateOne { + osuo.mutation.ClearUpdatedBy() + return osuo +} + +// SetTags sets the "tags" field. +func (osuo *OrganizationSettingUpdateOne) SetTags(s []string) *OrganizationSettingUpdateOne { + osuo.mutation.SetTags(s) + return osuo +} + +// AppendTags appends s to the "tags" field. +func (osuo *OrganizationSettingUpdateOne) AppendTags(s []string) *OrganizationSettingUpdateOne { + osuo.mutation.AppendTags(s) + return osuo +} + +// ClearTags clears the value of the "tags" field. +func (osuo *OrganizationSettingUpdateOne) ClearTags() *OrganizationSettingUpdateOne { + osuo.mutation.ClearTags() + return osuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (osuo *OrganizationSettingUpdateOne) SetDeletedAt(t time.Time) *OrganizationSettingUpdateOne { + osuo.mutation.SetDeletedAt(t) + return osuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableDeletedAt(t *time.Time) *OrganizationSettingUpdateOne { + if t != nil { + osuo.SetDeletedAt(*t) + } + return osuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (osuo *OrganizationSettingUpdateOne) ClearDeletedAt() *OrganizationSettingUpdateOne { + osuo.mutation.ClearDeletedAt() + return osuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (osuo *OrganizationSettingUpdateOne) SetDeletedBy(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetDeletedBy(s) + return osuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableDeletedBy(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetDeletedBy(*s) + } + return osuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (osuo *OrganizationSettingUpdateOne) ClearDeletedBy() *OrganizationSettingUpdateOne { + osuo.mutation.ClearDeletedBy() + return osuo +} + +// SetDomains sets the "domains" field. +func (osuo *OrganizationSettingUpdateOne) SetDomains(s []string) *OrganizationSettingUpdateOne { + osuo.mutation.SetDomains(s) + return osuo +} + +// AppendDomains appends s to the "domains" field. +func (osuo *OrganizationSettingUpdateOne) AppendDomains(s []string) *OrganizationSettingUpdateOne { + osuo.mutation.AppendDomains(s) + return osuo +} + +// ClearDomains clears the value of the "domains" field. +func (osuo *OrganizationSettingUpdateOne) ClearDomains() *OrganizationSettingUpdateOne { + osuo.mutation.ClearDomains() + return osuo +} + +// SetBillingContact sets the "billing_contact" field. +func (osuo *OrganizationSettingUpdateOne) SetBillingContact(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetBillingContact(s) + return osuo +} + +// SetNillableBillingContact sets the "billing_contact" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableBillingContact(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetBillingContact(*s) + } + return osuo +} + +// ClearBillingContact clears the value of the "billing_contact" field. +func (osuo *OrganizationSettingUpdateOne) ClearBillingContact() *OrganizationSettingUpdateOne { + osuo.mutation.ClearBillingContact() + return osuo +} + +// SetBillingEmail sets the "billing_email" field. +func (osuo *OrganizationSettingUpdateOne) SetBillingEmail(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetBillingEmail(s) + return osuo +} + +// SetNillableBillingEmail sets the "billing_email" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableBillingEmail(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetBillingEmail(*s) + } + return osuo +} + +// ClearBillingEmail clears the value of the "billing_email" field. +func (osuo *OrganizationSettingUpdateOne) ClearBillingEmail() *OrganizationSettingUpdateOne { + osuo.mutation.ClearBillingEmail() + return osuo +} + +// SetBillingPhone sets the "billing_phone" field. +func (osuo *OrganizationSettingUpdateOne) SetBillingPhone(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetBillingPhone(s) + return osuo +} + +// SetNillableBillingPhone sets the "billing_phone" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableBillingPhone(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetBillingPhone(*s) + } + return osuo +} + +// ClearBillingPhone clears the value of the "billing_phone" field. +func (osuo *OrganizationSettingUpdateOne) ClearBillingPhone() *OrganizationSettingUpdateOne { + osuo.mutation.ClearBillingPhone() + return osuo +} + +// SetBillingAddress sets the "billing_address" field. +func (osuo *OrganizationSettingUpdateOne) SetBillingAddress(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetBillingAddress(s) + return osuo +} + +// SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableBillingAddress(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetBillingAddress(*s) + } + return osuo +} + +// ClearBillingAddress clears the value of the "billing_address" field. +func (osuo *OrganizationSettingUpdateOne) ClearBillingAddress() *OrganizationSettingUpdateOne { + osuo.mutation.ClearBillingAddress() + return osuo +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (osuo *OrganizationSettingUpdateOne) SetTaxIdentifier(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetTaxIdentifier(s) + return osuo +} + +// SetNillableTaxIdentifier sets the "tax_identifier" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableTaxIdentifier(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetTaxIdentifier(*s) + } + return osuo +} + +// ClearTaxIdentifier clears the value of the "tax_identifier" field. +func (osuo *OrganizationSettingUpdateOne) ClearTaxIdentifier() *OrganizationSettingUpdateOne { + osuo.mutation.ClearTaxIdentifier() + return osuo +} + +// SetGeoLocation sets the "geo_location" field. +func (osuo *OrganizationSettingUpdateOne) SetGeoLocation(e enums.Region) *OrganizationSettingUpdateOne { + osuo.mutation.SetGeoLocation(e) + return osuo +} + +// SetNillableGeoLocation sets the "geo_location" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableGeoLocation(e *enums.Region) *OrganizationSettingUpdateOne { + if e != nil { + osuo.SetGeoLocation(*e) + } + return osuo +} + +// ClearGeoLocation clears the value of the "geo_location" field. +func (osuo *OrganizationSettingUpdateOne) ClearGeoLocation() *OrganizationSettingUpdateOne { + osuo.mutation.ClearGeoLocation() + return osuo +} + +// SetOrganizationID sets the "organization_id" field. +func (osuo *OrganizationSettingUpdateOne) SetOrganizationID(s string) *OrganizationSettingUpdateOne { + osuo.mutation.SetOrganizationID(s) + return osuo +} + +// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil. +func (osuo *OrganizationSettingUpdateOne) SetNillableOrganizationID(s *string) *OrganizationSettingUpdateOne { + if s != nil { + osuo.SetOrganizationID(*s) + } + return osuo +} + +// ClearOrganizationID clears the value of the "organization_id" field. +func (osuo *OrganizationSettingUpdateOne) ClearOrganizationID() *OrganizationSettingUpdateOne { + osuo.mutation.ClearOrganizationID() + return osuo +} + +// SetOrganization sets the "organization" edge to the Organization entity. +func (osuo *OrganizationSettingUpdateOne) SetOrganization(o *Organization) *OrganizationSettingUpdateOne { + return osuo.SetOrganizationID(o.ID) +} + +// Mutation returns the OrganizationSettingMutation object of the builder. +func (osuo *OrganizationSettingUpdateOne) Mutation() *OrganizationSettingMutation { + return osuo.mutation +} + +// ClearOrganization clears the "organization" edge to the Organization entity. +func (osuo *OrganizationSettingUpdateOne) ClearOrganization() *OrganizationSettingUpdateOne { + osuo.mutation.ClearOrganization() + return osuo +} + +// Where appends a list predicates to the OrganizationSettingUpdate builder. +func (osuo *OrganizationSettingUpdateOne) Where(ps ...predicate.OrganizationSetting) *OrganizationSettingUpdateOne { + osuo.mutation.Where(ps...) + return osuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (osuo *OrganizationSettingUpdateOne) Select(field string, fields ...string) *OrganizationSettingUpdateOne { + osuo.fields = append([]string{field}, fields...) + return osuo +} + +// Save executes the query and returns the updated OrganizationSetting entity. +func (osuo *OrganizationSettingUpdateOne) Save(ctx context.Context) (*OrganizationSetting, error) { + if err := osuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, osuo.sqlSave, osuo.mutation, osuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (osuo *OrganizationSettingUpdateOne) SaveX(ctx context.Context) *OrganizationSetting { + node, err := osuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (osuo *OrganizationSettingUpdateOne) Exec(ctx context.Context) error { + _, err := osuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (osuo *OrganizationSettingUpdateOne) ExecX(ctx context.Context) { + if err := osuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (osuo *OrganizationSettingUpdateOne) defaults() error { + if _, ok := osuo.mutation.UpdatedAt(); !ok && !osuo.mutation.UpdatedAtCleared() { + if organizationsetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationsetting.UpdateDefaultUpdatedAt() + osuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (osuo *OrganizationSettingUpdateOne) check() error { + if v, ok := osuo.mutation.Domains(); ok { + if err := organizationsetting.DomainsValidator(v); err != nil { + return &ValidationError{Name: "domains", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.domains": %w`, err)} + } + } + if v, ok := osuo.mutation.BillingEmail(); ok { + if err := organizationsetting.BillingEmailValidator(v); err != nil { + return &ValidationError{Name: "billing_email", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.billing_email": %w`, err)} + } + } + if v, ok := osuo.mutation.BillingPhone(); ok { + if err := organizationsetting.BillingPhoneValidator(v); err != nil { + return &ValidationError{Name: "billing_phone", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.billing_phone": %w`, err)} + } + } + if v, ok := osuo.mutation.GeoLocation(); ok { + if err := organizationsetting.GeoLocationValidator(v); err != nil { + return &ValidationError{Name: "geo_location", err: fmt.Errorf(`generated: validator failed for field "OrganizationSetting.geo_location": %w`, err)} + } + } + return nil +} + +func (osuo *OrganizationSettingUpdateOne) sqlSave(ctx context.Context) (_node *OrganizationSetting, err error) { + if err := osuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(organizationsetting.Table, organizationsetting.Columns, sqlgraph.NewFieldSpec(organizationsetting.FieldID, field.TypeString)) + id, ok := osuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OrganizationSetting.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := osuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organizationsetting.FieldID) + for _, f := range fields { + if !organizationsetting.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != organizationsetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := osuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if osuo.mutation.CreatedAtCleared() { + _spec.ClearField(organizationsetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := osuo.mutation.UpdatedAt(); ok { + _spec.SetField(organizationsetting.FieldUpdatedAt, field.TypeTime, value) + } + if osuo.mutation.UpdatedAtCleared() { + _spec.ClearField(organizationsetting.FieldUpdatedAt, field.TypeTime) + } + if osuo.mutation.CreatedByCleared() { + _spec.ClearField(organizationsetting.FieldCreatedBy, field.TypeString) + } + if value, ok := osuo.mutation.UpdatedBy(); ok { + _spec.SetField(organizationsetting.FieldUpdatedBy, field.TypeString, value) + } + if osuo.mutation.UpdatedByCleared() { + _spec.ClearField(organizationsetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := osuo.mutation.Tags(); ok { + _spec.SetField(organizationsetting.FieldTags, field.TypeJSON, value) + } + if value, ok := osuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsetting.FieldTags, value) + }) + } + if osuo.mutation.TagsCleared() { + _spec.ClearField(organizationsetting.FieldTags, field.TypeJSON) + } + if value, ok := osuo.mutation.DeletedAt(); ok { + _spec.SetField(organizationsetting.FieldDeletedAt, field.TypeTime, value) + } + if osuo.mutation.DeletedAtCleared() { + _spec.ClearField(organizationsetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := osuo.mutation.DeletedBy(); ok { + _spec.SetField(organizationsetting.FieldDeletedBy, field.TypeString, value) + } + if osuo.mutation.DeletedByCleared() { + _spec.ClearField(organizationsetting.FieldDeletedBy, field.TypeString) + } + if value, ok := osuo.mutation.Domains(); ok { + _spec.SetField(organizationsetting.FieldDomains, field.TypeJSON, value) + } + if value, ok := osuo.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsetting.FieldDomains, value) + }) + } + if osuo.mutation.DomainsCleared() { + _spec.ClearField(organizationsetting.FieldDomains, field.TypeJSON) + } + if value, ok := osuo.mutation.BillingContact(); ok { + _spec.SetField(organizationsetting.FieldBillingContact, field.TypeString, value) + } + if osuo.mutation.BillingContactCleared() { + _spec.ClearField(organizationsetting.FieldBillingContact, field.TypeString) + } + if value, ok := osuo.mutation.BillingEmail(); ok { + _spec.SetField(organizationsetting.FieldBillingEmail, field.TypeString, value) + } + if osuo.mutation.BillingEmailCleared() { + _spec.ClearField(organizationsetting.FieldBillingEmail, field.TypeString) + } + if value, ok := osuo.mutation.BillingPhone(); ok { + _spec.SetField(organizationsetting.FieldBillingPhone, field.TypeString, value) + } + if osuo.mutation.BillingPhoneCleared() { + _spec.ClearField(organizationsetting.FieldBillingPhone, field.TypeString) + } + if value, ok := osuo.mutation.BillingAddress(); ok { + _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeString, value) + } + if osuo.mutation.BillingAddressCleared() { + _spec.ClearField(organizationsetting.FieldBillingAddress, field.TypeString) + } + if value, ok := osuo.mutation.TaxIdentifier(); ok { + _spec.SetField(organizationsetting.FieldTaxIdentifier, field.TypeString, value) + } + if osuo.mutation.TaxIdentifierCleared() { + _spec.ClearField(organizationsetting.FieldTaxIdentifier, field.TypeString) + } + if value, ok := osuo.mutation.GeoLocation(); ok { + _spec.SetField(organizationsetting.FieldGeoLocation, field.TypeEnum, value) + } + if osuo.mutation.GeoLocationCleared() { + _spec.ClearField(organizationsetting.FieldGeoLocation, field.TypeEnum) + } + if osuo.mutation.OrganizationCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: organizationsetting.OrganizationTable, + Columns: []string{organizationsetting.OrganizationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = osuo.schemaConfig.OrganizationSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := osuo.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: organizationsetting.OrganizationTable, + Columns: []string{organizationsetting.OrganizationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = osuo.schemaConfig.OrganizationSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = osuo.schemaConfig.OrganizationSetting + ctx = internal.NewSchemaConfigContext(ctx, osuo.schemaConfig) + _node = &OrganizationSetting{config: osuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, osuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organizationsetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + osuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/organizationsettinghistory.go b/internal/ent/generated/organizationsettinghistory.go new file mode 100644 index 0000000..900fbd7 --- /dev/null +++ b/internal/ent/generated/organizationsettinghistory.go @@ -0,0 +1,313 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// OrganizationSettingHistory is the model entity for the OrganizationSettingHistory schema. +type OrganizationSettingHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact string `json:"billing_contact,omitempty"` + // Email address of the person to contact for billing + BillingEmail string `json:"billing_email,omitempty"` + // Phone number to contact for billing + BillingPhone string `json:"billing_phone,omitempty"` + // Address to send billing information to + BillingAddress string `json:"billing_address,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier string `json:"tax_identifier,omitempty"` + // geographical location of the organization + GeoLocation enums.Region `json:"geo_location,omitempty"` + // the ID of the organization the settings belong to + OrganizationID string `json:"organization_id,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OrganizationSettingHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case organizationsettinghistory.FieldTags, organizationsettinghistory.FieldDomains: + values[i] = new([]byte) + case organizationsettinghistory.FieldOperation: + values[i] = new(history.OpType) + case organizationsettinghistory.FieldID, organizationsettinghistory.FieldRef, organizationsettinghistory.FieldCreatedBy, organizationsettinghistory.FieldUpdatedBy, organizationsettinghistory.FieldMappingID, organizationsettinghistory.FieldDeletedBy, organizationsettinghistory.FieldBillingContact, organizationsettinghistory.FieldBillingEmail, organizationsettinghistory.FieldBillingPhone, organizationsettinghistory.FieldBillingAddress, organizationsettinghistory.FieldTaxIdentifier, organizationsettinghistory.FieldGeoLocation, organizationsettinghistory.FieldOrganizationID: + values[i] = new(sql.NullString) + case organizationsettinghistory.FieldHistoryTime, organizationsettinghistory.FieldCreatedAt, organizationsettinghistory.FieldUpdatedAt, organizationsettinghistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OrganizationSettingHistory fields. +func (osh *OrganizationSettingHistory) 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 organizationsettinghistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + osh.ID = value.String + } + case organizationsettinghistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + osh.HistoryTime = value.Time + } + case organizationsettinghistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + osh.Ref = value.String + } + case organizationsettinghistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + osh.Operation = *value + } + case organizationsettinghistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + osh.CreatedAt = value.Time + } + case organizationsettinghistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + osh.UpdatedAt = value.Time + } + case organizationsettinghistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + osh.CreatedBy = value.String + } + case organizationsettinghistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + osh.UpdatedBy = value.String + } + case organizationsettinghistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + osh.MappingID = value.String + } + case organizationsettinghistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &osh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case organizationsettinghistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + osh.DeletedAt = value.Time + } + case organizationsettinghistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + osh.DeletedBy = value.String + } + case organizationsettinghistory.FieldDomains: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field domains", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &osh.Domains); err != nil { + return fmt.Errorf("unmarshal field domains: %w", err) + } + } + case organizationsettinghistory.FieldBillingContact: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_contact", values[i]) + } else if value.Valid { + osh.BillingContact = value.String + } + case organizationsettinghistory.FieldBillingEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_email", values[i]) + } else if value.Valid { + osh.BillingEmail = value.String + } + case organizationsettinghistory.FieldBillingPhone: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_phone", values[i]) + } else if value.Valid { + osh.BillingPhone = value.String + } + case organizationsettinghistory.FieldBillingAddress: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field billing_address", values[i]) + } else if value.Valid { + osh.BillingAddress = value.String + } + case organizationsettinghistory.FieldTaxIdentifier: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field tax_identifier", values[i]) + } else if value.Valid { + osh.TaxIdentifier = value.String + } + case organizationsettinghistory.FieldGeoLocation: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field geo_location", values[i]) + } else if value.Valid { + osh.GeoLocation = enums.Region(value.String) + } + case organizationsettinghistory.FieldOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field organization_id", values[i]) + } else if value.Valid { + osh.OrganizationID = value.String + } + default: + osh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OrganizationSettingHistory. +// This includes values selected through modifiers, order, etc. +func (osh *OrganizationSettingHistory) Value(name string) (ent.Value, error) { + return osh.selectValues.Get(name) +} + +// Update returns a builder for updating this OrganizationSettingHistory. +// Note that you need to call OrganizationSettingHistory.Unwrap() before calling this method if this OrganizationSettingHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (osh *OrganizationSettingHistory) Update() *OrganizationSettingHistoryUpdateOne { + return NewOrganizationSettingHistoryClient(osh.config).UpdateOne(osh) +} + +// Unwrap unwraps the OrganizationSettingHistory 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 (osh *OrganizationSettingHistory) Unwrap() *OrganizationSettingHistory { + _tx, ok := osh.config.driver.(*txDriver) + if !ok { + panic("generated: OrganizationSettingHistory is not a transactional entity") + } + osh.config.driver = _tx.drv + return osh +} + +// String implements the fmt.Stringer. +func (osh *OrganizationSettingHistory) String() string { + var builder strings.Builder + builder.WriteString("OrganizationSettingHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", osh.ID)) + builder.WriteString("history_time=") + builder.WriteString(osh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(osh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", osh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(osh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(osh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(osh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(osh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(osh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", osh.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(osh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(osh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("domains=") + builder.WriteString(fmt.Sprintf("%v", osh.Domains)) + builder.WriteString(", ") + builder.WriteString("billing_contact=") + builder.WriteString(osh.BillingContact) + builder.WriteString(", ") + builder.WriteString("billing_email=") + builder.WriteString(osh.BillingEmail) + builder.WriteString(", ") + builder.WriteString("billing_phone=") + builder.WriteString(osh.BillingPhone) + builder.WriteString(", ") + builder.WriteString("billing_address=") + builder.WriteString(osh.BillingAddress) + builder.WriteString(", ") + builder.WriteString("tax_identifier=") + builder.WriteString(osh.TaxIdentifier) + builder.WriteString(", ") + builder.WriteString("geo_location=") + builder.WriteString(fmt.Sprintf("%v", osh.GeoLocation)) + builder.WriteString(", ") + builder.WriteString("organization_id=") + builder.WriteString(osh.OrganizationID) + builder.WriteByte(')') + return builder.String() +} + +// OrganizationSettingHistories is a parsable slice of OrganizationSettingHistory. +type OrganizationSettingHistories []*OrganizationSettingHistory diff --git a/internal/ent/generated/organizationsettinghistory/organizationsettinghistory.go b/internal/ent/generated/organizationsettinghistory/organizationsettinghistory.go new file mode 100644 index 0000000..b11cf42 --- /dev/null +++ b/internal/ent/generated/organizationsettinghistory/organizationsettinghistory.go @@ -0,0 +1,249 @@ +// Code generated by ent, DO NOT EDIT. + +package organizationsettinghistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the organizationsettinghistory type in the database. + Label = "organization_setting_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldDomains holds the string denoting the domains field in the database. + FieldDomains = "domains" + // FieldBillingContact holds the string denoting the billing_contact field in the database. + FieldBillingContact = "billing_contact" + // FieldBillingEmail holds the string denoting the billing_email field in the database. + FieldBillingEmail = "billing_email" + // FieldBillingPhone holds the string denoting the billing_phone field in the database. + FieldBillingPhone = "billing_phone" + // FieldBillingAddress holds the string denoting the billing_address field in the database. + FieldBillingAddress = "billing_address" + // FieldTaxIdentifier holds the string denoting the tax_identifier field in the database. + FieldTaxIdentifier = "tax_identifier" + // FieldGeoLocation holds the string denoting the geo_location field in the database. + FieldGeoLocation = "geo_location" + // FieldOrganizationID holds the string denoting the organization_id field in the database. + FieldOrganizationID = "organization_id" + // Table holds the table name of the organizationsettinghistory in the database. + Table = "organization_setting_history" +) + +// Columns holds all SQL columns for organizationsettinghistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldDomains, + FieldBillingContact, + FieldBillingEmail, + FieldBillingPhone, + FieldBillingAddress, + FieldTaxIdentifier, + FieldGeoLocation, + FieldOrganizationID, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("organizationsettinghistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultGeoLocation enums.Region = "AMER" + +// GeoLocationValidator is a validator for the "geo_location" field enum values. It is called by the builders before save. +func GeoLocationValidator(gl enums.Region) error { + switch gl.String() { + case "AMER", "EMEA", "APAC": + return nil + default: + return fmt.Errorf("organizationsettinghistory: invalid enum value for geo_location field: %q", gl) + } +} + +// OrderOption defines the ordering options for the OrganizationSettingHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByBillingContact orders the results by the billing_contact field. +func ByBillingContact(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingContact, opts...).ToFunc() +} + +// ByBillingEmail orders the results by the billing_email field. +func ByBillingEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingEmail, opts...).ToFunc() +} + +// ByBillingPhone orders the results by the billing_phone field. +func ByBillingPhone(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingPhone, opts...).ToFunc() +} + +// ByBillingAddress orders the results by the billing_address field. +func ByBillingAddress(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBillingAddress, opts...).ToFunc() +} + +// ByTaxIdentifier orders the results by the tax_identifier field. +func ByTaxIdentifier(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTaxIdentifier, opts...).ToFunc() +} + +// ByGeoLocation orders the results by the geo_location field. +func ByGeoLocation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldGeoLocation, opts...).ToFunc() +} + +// ByOrganizationID orders the results by the organization_id field. +func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.Region must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Region)(nil) + // enums.Region must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Region)(nil) +) diff --git a/internal/ent/generated/organizationsettinghistory/where.go b/internal/ent/generated/organizationsettinghistory/where.go new file mode 100644 index 0000000..88db1cc --- /dev/null +++ b/internal/ent/generated/organizationsettinghistory/where.go @@ -0,0 +1,1242 @@ +// Code generated by ent, DO NOT EDIT. + +package organizationsettinghistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// BillingContact applies equality check predicate on the "billing_contact" field. It's identical to BillingContactEQ. +func BillingContact(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingContact, v)) +} + +// BillingEmail applies equality check predicate on the "billing_email" field. It's identical to BillingEmailEQ. +func BillingEmail(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingEmail, v)) +} + +// BillingPhone applies equality check predicate on the "billing_phone" field. It's identical to BillingPhoneEQ. +func BillingPhone(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingPhone, v)) +} + +// BillingAddress applies equality check predicate on the "billing_address" field. It's identical to BillingAddressEQ. +func BillingAddress(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingAddress, v)) +} + +// TaxIdentifier applies equality check predicate on the "tax_identifier" field. It's identical to TaxIdentifierEQ. +func TaxIdentifier(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldTaxIdentifier, v)) +} + +// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ. +func OrganizationID(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldOrganizationID, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// DomainsIsNil applies the IsNil predicate on the "domains" field. +func DomainsIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldDomains)) +} + +// DomainsNotNil applies the NotNil predicate on the "domains" field. +func DomainsNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldDomains)) +} + +// BillingContactEQ applies the EQ predicate on the "billing_contact" field. +func BillingContactEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingContact, v)) +} + +// BillingContactNEQ applies the NEQ predicate on the "billing_contact" field. +func BillingContactNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldBillingContact, v)) +} + +// BillingContactIn applies the In predicate on the "billing_contact" field. +func BillingContactIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldBillingContact, vs...)) +} + +// BillingContactNotIn applies the NotIn predicate on the "billing_contact" field. +func BillingContactNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldBillingContact, vs...)) +} + +// BillingContactGT applies the GT predicate on the "billing_contact" field. +func BillingContactGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldBillingContact, v)) +} + +// BillingContactGTE applies the GTE predicate on the "billing_contact" field. +func BillingContactGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldBillingContact, v)) +} + +// BillingContactLT applies the LT predicate on the "billing_contact" field. +func BillingContactLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldBillingContact, v)) +} + +// BillingContactLTE applies the LTE predicate on the "billing_contact" field. +func BillingContactLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldBillingContact, v)) +} + +// BillingContactContains applies the Contains predicate on the "billing_contact" field. +func BillingContactContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldBillingContact, v)) +} + +// BillingContactHasPrefix applies the HasPrefix predicate on the "billing_contact" field. +func BillingContactHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldBillingContact, v)) +} + +// BillingContactHasSuffix applies the HasSuffix predicate on the "billing_contact" field. +func BillingContactHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldBillingContact, v)) +} + +// BillingContactIsNil applies the IsNil predicate on the "billing_contact" field. +func BillingContactIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldBillingContact)) +} + +// BillingContactNotNil applies the NotNil predicate on the "billing_contact" field. +func BillingContactNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldBillingContact)) +} + +// BillingContactEqualFold applies the EqualFold predicate on the "billing_contact" field. +func BillingContactEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldBillingContact, v)) +} + +// BillingContactContainsFold applies the ContainsFold predicate on the "billing_contact" field. +func BillingContactContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldBillingContact, v)) +} + +// BillingEmailEQ applies the EQ predicate on the "billing_email" field. +func BillingEmailEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingEmail, v)) +} + +// BillingEmailNEQ applies the NEQ predicate on the "billing_email" field. +func BillingEmailNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldBillingEmail, v)) +} + +// BillingEmailIn applies the In predicate on the "billing_email" field. +func BillingEmailIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldBillingEmail, vs...)) +} + +// BillingEmailNotIn applies the NotIn predicate on the "billing_email" field. +func BillingEmailNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldBillingEmail, vs...)) +} + +// BillingEmailGT applies the GT predicate on the "billing_email" field. +func BillingEmailGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldBillingEmail, v)) +} + +// BillingEmailGTE applies the GTE predicate on the "billing_email" field. +func BillingEmailGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldBillingEmail, v)) +} + +// BillingEmailLT applies the LT predicate on the "billing_email" field. +func BillingEmailLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldBillingEmail, v)) +} + +// BillingEmailLTE applies the LTE predicate on the "billing_email" field. +func BillingEmailLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldBillingEmail, v)) +} + +// BillingEmailContains applies the Contains predicate on the "billing_email" field. +func BillingEmailContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldBillingEmail, v)) +} + +// BillingEmailHasPrefix applies the HasPrefix predicate on the "billing_email" field. +func BillingEmailHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldBillingEmail, v)) +} + +// BillingEmailHasSuffix applies the HasSuffix predicate on the "billing_email" field. +func BillingEmailHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldBillingEmail, v)) +} + +// BillingEmailIsNil applies the IsNil predicate on the "billing_email" field. +func BillingEmailIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldBillingEmail)) +} + +// BillingEmailNotNil applies the NotNil predicate on the "billing_email" field. +func BillingEmailNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldBillingEmail)) +} + +// BillingEmailEqualFold applies the EqualFold predicate on the "billing_email" field. +func BillingEmailEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldBillingEmail, v)) +} + +// BillingEmailContainsFold applies the ContainsFold predicate on the "billing_email" field. +func BillingEmailContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldBillingEmail, v)) +} + +// BillingPhoneEQ applies the EQ predicate on the "billing_phone" field. +func BillingPhoneEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingPhone, v)) +} + +// BillingPhoneNEQ applies the NEQ predicate on the "billing_phone" field. +func BillingPhoneNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldBillingPhone, v)) +} + +// BillingPhoneIn applies the In predicate on the "billing_phone" field. +func BillingPhoneIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldBillingPhone, vs...)) +} + +// BillingPhoneNotIn applies the NotIn predicate on the "billing_phone" field. +func BillingPhoneNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldBillingPhone, vs...)) +} + +// BillingPhoneGT applies the GT predicate on the "billing_phone" field. +func BillingPhoneGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldBillingPhone, v)) +} + +// BillingPhoneGTE applies the GTE predicate on the "billing_phone" field. +func BillingPhoneGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldBillingPhone, v)) +} + +// BillingPhoneLT applies the LT predicate on the "billing_phone" field. +func BillingPhoneLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldBillingPhone, v)) +} + +// BillingPhoneLTE applies the LTE predicate on the "billing_phone" field. +func BillingPhoneLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldBillingPhone, v)) +} + +// BillingPhoneContains applies the Contains predicate on the "billing_phone" field. +func BillingPhoneContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldBillingPhone, v)) +} + +// BillingPhoneHasPrefix applies the HasPrefix predicate on the "billing_phone" field. +func BillingPhoneHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldBillingPhone, v)) +} + +// BillingPhoneHasSuffix applies the HasSuffix predicate on the "billing_phone" field. +func BillingPhoneHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldBillingPhone, v)) +} + +// BillingPhoneIsNil applies the IsNil predicate on the "billing_phone" field. +func BillingPhoneIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldBillingPhone)) +} + +// BillingPhoneNotNil applies the NotNil predicate on the "billing_phone" field. +func BillingPhoneNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldBillingPhone)) +} + +// BillingPhoneEqualFold applies the EqualFold predicate on the "billing_phone" field. +func BillingPhoneEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldBillingPhone, v)) +} + +// BillingPhoneContainsFold applies the ContainsFold predicate on the "billing_phone" field. +func BillingPhoneContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldBillingPhone, v)) +} + +// BillingAddressEQ applies the EQ predicate on the "billing_address" field. +func BillingAddressEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingAddress, v)) +} + +// BillingAddressNEQ applies the NEQ predicate on the "billing_address" field. +func BillingAddressNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldBillingAddress, v)) +} + +// BillingAddressIn applies the In predicate on the "billing_address" field. +func BillingAddressIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldBillingAddress, vs...)) +} + +// BillingAddressNotIn applies the NotIn predicate on the "billing_address" field. +func BillingAddressNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldBillingAddress, vs...)) +} + +// BillingAddressGT applies the GT predicate on the "billing_address" field. +func BillingAddressGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldBillingAddress, v)) +} + +// BillingAddressGTE applies the GTE predicate on the "billing_address" field. +func BillingAddressGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldBillingAddress, v)) +} + +// BillingAddressLT applies the LT predicate on the "billing_address" field. +func BillingAddressLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldBillingAddress, v)) +} + +// BillingAddressLTE applies the LTE predicate on the "billing_address" field. +func BillingAddressLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldBillingAddress, v)) +} + +// BillingAddressContains applies the Contains predicate on the "billing_address" field. +func BillingAddressContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldBillingAddress, v)) +} + +// BillingAddressHasPrefix applies the HasPrefix predicate on the "billing_address" field. +func BillingAddressHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldBillingAddress, v)) +} + +// BillingAddressHasSuffix applies the HasSuffix predicate on the "billing_address" field. +func BillingAddressHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldBillingAddress, v)) +} + +// BillingAddressIsNil applies the IsNil predicate on the "billing_address" field. +func BillingAddressIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldBillingAddress)) +} + +// BillingAddressNotNil applies the NotNil predicate on the "billing_address" field. +func BillingAddressNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldBillingAddress)) +} + +// BillingAddressEqualFold applies the EqualFold predicate on the "billing_address" field. +func BillingAddressEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldBillingAddress, v)) +} + +// BillingAddressContainsFold applies the ContainsFold predicate on the "billing_address" field. +func BillingAddressContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldBillingAddress, v)) +} + +// TaxIdentifierEQ applies the EQ predicate on the "tax_identifier" field. +func TaxIdentifierEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldTaxIdentifier, v)) +} + +// TaxIdentifierNEQ applies the NEQ predicate on the "tax_identifier" field. +func TaxIdentifierNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldTaxIdentifier, v)) +} + +// TaxIdentifierIn applies the In predicate on the "tax_identifier" field. +func TaxIdentifierIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldTaxIdentifier, vs...)) +} + +// TaxIdentifierNotIn applies the NotIn predicate on the "tax_identifier" field. +func TaxIdentifierNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldTaxIdentifier, vs...)) +} + +// TaxIdentifierGT applies the GT predicate on the "tax_identifier" field. +func TaxIdentifierGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldTaxIdentifier, v)) +} + +// TaxIdentifierGTE applies the GTE predicate on the "tax_identifier" field. +func TaxIdentifierGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldTaxIdentifier, v)) +} + +// TaxIdentifierLT applies the LT predicate on the "tax_identifier" field. +func TaxIdentifierLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldTaxIdentifier, v)) +} + +// TaxIdentifierLTE applies the LTE predicate on the "tax_identifier" field. +func TaxIdentifierLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldTaxIdentifier, v)) +} + +// TaxIdentifierContains applies the Contains predicate on the "tax_identifier" field. +func TaxIdentifierContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldTaxIdentifier, v)) +} + +// TaxIdentifierHasPrefix applies the HasPrefix predicate on the "tax_identifier" field. +func TaxIdentifierHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldTaxIdentifier, v)) +} + +// TaxIdentifierHasSuffix applies the HasSuffix predicate on the "tax_identifier" field. +func TaxIdentifierHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldTaxIdentifier, v)) +} + +// TaxIdentifierIsNil applies the IsNil predicate on the "tax_identifier" field. +func TaxIdentifierIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldTaxIdentifier)) +} + +// TaxIdentifierNotNil applies the NotNil predicate on the "tax_identifier" field. +func TaxIdentifierNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldTaxIdentifier)) +} + +// TaxIdentifierEqualFold applies the EqualFold predicate on the "tax_identifier" field. +func TaxIdentifierEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldTaxIdentifier, v)) +} + +// TaxIdentifierContainsFold applies the ContainsFold predicate on the "tax_identifier" field. +func TaxIdentifierContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldTaxIdentifier, v)) +} + +// GeoLocationEQ applies the EQ predicate on the "geo_location" field. +func GeoLocationEQ(v enums.Region) predicate.OrganizationSettingHistory { + vc := v + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldGeoLocation, vc)) +} + +// GeoLocationNEQ applies the NEQ predicate on the "geo_location" field. +func GeoLocationNEQ(v enums.Region) predicate.OrganizationSettingHistory { + vc := v + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldGeoLocation, vc)) +} + +// GeoLocationIn applies the In predicate on the "geo_location" field. +func GeoLocationIn(vs ...enums.Region) predicate.OrganizationSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldGeoLocation, v...)) +} + +// GeoLocationNotIn applies the NotIn predicate on the "geo_location" field. +func GeoLocationNotIn(vs ...enums.Region) predicate.OrganizationSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldGeoLocation, v...)) +} + +// GeoLocationIsNil applies the IsNil predicate on the "geo_location" field. +func GeoLocationIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldGeoLocation)) +} + +// GeoLocationNotNil applies the NotNil predicate on the "geo_location" field. +func GeoLocationNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldGeoLocation)) +} + +// OrganizationIDEQ applies the EQ predicate on the "organization_id" field. +func OrganizationIDEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldOrganizationID, v)) +} + +// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field. +func OrganizationIDNEQ(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldOrganizationID, v)) +} + +// OrganizationIDIn applies the In predicate on the "organization_id" field. +func OrganizationIDIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field. +func OrganizationIDNotIn(vs ...string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDGT applies the GT predicate on the "organization_id" field. +func OrganizationIDGT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGT(FieldOrganizationID, v)) +} + +// OrganizationIDGTE applies the GTE predicate on the "organization_id" field. +func OrganizationIDGTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldOrganizationID, v)) +} + +// OrganizationIDLT applies the LT predicate on the "organization_id" field. +func OrganizationIDLT(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLT(FieldOrganizationID, v)) +} + +// OrganizationIDLTE applies the LTE predicate on the "organization_id" field. +func OrganizationIDLTE(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldOrganizationID, v)) +} + +// OrganizationIDContains applies the Contains predicate on the "organization_id" field. +func OrganizationIDContains(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContains(FieldOrganizationID, v)) +} + +// OrganizationIDHasPrefix applies the HasPrefix predicate on the "organization_id" field. +func OrganizationIDHasPrefix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldOrganizationID, v)) +} + +// OrganizationIDHasSuffix applies the HasSuffix predicate on the "organization_id" field. +func OrganizationIDHasSuffix(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldOrganizationID, v)) +} + +// OrganizationIDIsNil applies the IsNil predicate on the "organization_id" field. +func OrganizationIDIsNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldOrganizationID)) +} + +// OrganizationIDNotNil applies the NotNil predicate on the "organization_id" field. +func OrganizationIDNotNil() predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldOrganizationID)) +} + +// OrganizationIDEqualFold applies the EqualFold predicate on the "organization_id" field. +func OrganizationIDEqualFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldOrganizationID, v)) +} + +// OrganizationIDContainsFold applies the ContainsFold predicate on the "organization_id" field. +func OrganizationIDContainsFold(v string) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldOrganizationID, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.OrganizationSettingHistory) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OrganizationSettingHistory) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OrganizationSettingHistory) predicate.OrganizationSettingHistory { + return predicate.OrganizationSettingHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/organizationsettinghistory_create.go b/internal/ent/generated/organizationsettinghistory_create.go new file mode 100644 index 0000000..4cba98b --- /dev/null +++ b/internal/ent/generated/organizationsettinghistory_create.go @@ -0,0 +1,582 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// OrganizationSettingHistoryCreate is the builder for creating a OrganizationSettingHistory entity. +type OrganizationSettingHistoryCreate struct { + config + mutation *OrganizationSettingHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (oshc *OrganizationSettingHistoryCreate) SetHistoryTime(t time.Time) *OrganizationSettingHistoryCreate { + oshc.mutation.SetHistoryTime(t) + return oshc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableHistoryTime(t *time.Time) *OrganizationSettingHistoryCreate { + if t != nil { + oshc.SetHistoryTime(*t) + } + return oshc +} + +// SetRef sets the "ref" field. +func (oshc *OrganizationSettingHistoryCreate) SetRef(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetRef(s) + return oshc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableRef(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetRef(*s) + } + return oshc +} + +// SetOperation sets the "operation" field. +func (oshc *OrganizationSettingHistoryCreate) SetOperation(ht history.OpType) *OrganizationSettingHistoryCreate { + oshc.mutation.SetOperation(ht) + return oshc +} + +// SetCreatedAt sets the "created_at" field. +func (oshc *OrganizationSettingHistoryCreate) SetCreatedAt(t time.Time) *OrganizationSettingHistoryCreate { + oshc.mutation.SetCreatedAt(t) + return oshc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableCreatedAt(t *time.Time) *OrganizationSettingHistoryCreate { + if t != nil { + oshc.SetCreatedAt(*t) + } + return oshc +} + +// SetUpdatedAt sets the "updated_at" field. +func (oshc *OrganizationSettingHistoryCreate) SetUpdatedAt(t time.Time) *OrganizationSettingHistoryCreate { + oshc.mutation.SetUpdatedAt(t) + return oshc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableUpdatedAt(t *time.Time) *OrganizationSettingHistoryCreate { + if t != nil { + oshc.SetUpdatedAt(*t) + } + return oshc +} + +// SetCreatedBy sets the "created_by" field. +func (oshc *OrganizationSettingHistoryCreate) SetCreatedBy(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetCreatedBy(s) + return oshc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableCreatedBy(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetCreatedBy(*s) + } + return oshc +} + +// SetUpdatedBy sets the "updated_by" field. +func (oshc *OrganizationSettingHistoryCreate) SetUpdatedBy(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetUpdatedBy(s) + return oshc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableUpdatedBy(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetUpdatedBy(*s) + } + return oshc +} + +// SetMappingID sets the "mapping_id" field. +func (oshc *OrganizationSettingHistoryCreate) SetMappingID(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetMappingID(s) + return oshc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableMappingID(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetMappingID(*s) + } + return oshc +} + +// SetTags sets the "tags" field. +func (oshc *OrganizationSettingHistoryCreate) SetTags(s []string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetTags(s) + return oshc +} + +// SetDeletedAt sets the "deleted_at" field. +func (oshc *OrganizationSettingHistoryCreate) SetDeletedAt(t time.Time) *OrganizationSettingHistoryCreate { + oshc.mutation.SetDeletedAt(t) + return oshc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableDeletedAt(t *time.Time) *OrganizationSettingHistoryCreate { + if t != nil { + oshc.SetDeletedAt(*t) + } + return oshc +} + +// SetDeletedBy sets the "deleted_by" field. +func (oshc *OrganizationSettingHistoryCreate) SetDeletedBy(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetDeletedBy(s) + return oshc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableDeletedBy(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetDeletedBy(*s) + } + return oshc +} + +// SetDomains sets the "domains" field. +func (oshc *OrganizationSettingHistoryCreate) SetDomains(s []string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetDomains(s) + return oshc +} + +// SetBillingContact sets the "billing_contact" field. +func (oshc *OrganizationSettingHistoryCreate) SetBillingContact(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetBillingContact(s) + return oshc +} + +// SetNillableBillingContact sets the "billing_contact" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableBillingContact(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetBillingContact(*s) + } + return oshc +} + +// SetBillingEmail sets the "billing_email" field. +func (oshc *OrganizationSettingHistoryCreate) SetBillingEmail(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetBillingEmail(s) + return oshc +} + +// SetNillableBillingEmail sets the "billing_email" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableBillingEmail(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetBillingEmail(*s) + } + return oshc +} + +// SetBillingPhone sets the "billing_phone" field. +func (oshc *OrganizationSettingHistoryCreate) SetBillingPhone(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetBillingPhone(s) + return oshc +} + +// SetNillableBillingPhone sets the "billing_phone" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableBillingPhone(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetBillingPhone(*s) + } + return oshc +} + +// SetBillingAddress sets the "billing_address" field. +func (oshc *OrganizationSettingHistoryCreate) SetBillingAddress(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetBillingAddress(s) + return oshc +} + +// SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableBillingAddress(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetBillingAddress(*s) + } + return oshc +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (oshc *OrganizationSettingHistoryCreate) SetTaxIdentifier(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetTaxIdentifier(s) + return oshc +} + +// SetNillableTaxIdentifier sets the "tax_identifier" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableTaxIdentifier(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetTaxIdentifier(*s) + } + return oshc +} + +// SetGeoLocation sets the "geo_location" field. +func (oshc *OrganizationSettingHistoryCreate) SetGeoLocation(e enums.Region) *OrganizationSettingHistoryCreate { + oshc.mutation.SetGeoLocation(e) + return oshc +} + +// SetNillableGeoLocation sets the "geo_location" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableGeoLocation(e *enums.Region) *OrganizationSettingHistoryCreate { + if e != nil { + oshc.SetGeoLocation(*e) + } + return oshc +} + +// SetOrganizationID sets the "organization_id" field. +func (oshc *OrganizationSettingHistoryCreate) SetOrganizationID(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetOrganizationID(s) + return oshc +} + +// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableOrganizationID(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetOrganizationID(*s) + } + return oshc +} + +// SetID sets the "id" field. +func (oshc *OrganizationSettingHistoryCreate) SetID(s string) *OrganizationSettingHistoryCreate { + oshc.mutation.SetID(s) + return oshc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (oshc *OrganizationSettingHistoryCreate) SetNillableID(s *string) *OrganizationSettingHistoryCreate { + if s != nil { + oshc.SetID(*s) + } + return oshc +} + +// Mutation returns the OrganizationSettingHistoryMutation object of the builder. +func (oshc *OrganizationSettingHistoryCreate) Mutation() *OrganizationSettingHistoryMutation { + return oshc.mutation +} + +// Save creates the OrganizationSettingHistory in the database. +func (oshc *OrganizationSettingHistoryCreate) Save(ctx context.Context) (*OrganizationSettingHistory, error) { + if err := oshc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, oshc.sqlSave, oshc.mutation, oshc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (oshc *OrganizationSettingHistoryCreate) SaveX(ctx context.Context) *OrganizationSettingHistory { + v, err := oshc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (oshc *OrganizationSettingHistoryCreate) Exec(ctx context.Context) error { + _, err := oshc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oshc *OrganizationSettingHistoryCreate) ExecX(ctx context.Context) { + if err := oshc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (oshc *OrganizationSettingHistoryCreate) defaults() error { + if _, ok := oshc.mutation.HistoryTime(); !ok { + if organizationsettinghistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized organizationsettinghistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := organizationsettinghistory.DefaultHistoryTime() + oshc.mutation.SetHistoryTime(v) + } + if _, ok := oshc.mutation.CreatedAt(); !ok { + if organizationsettinghistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsettinghistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := organizationsettinghistory.DefaultCreatedAt() + oshc.mutation.SetCreatedAt(v) + } + if _, ok := oshc.mutation.UpdatedAt(); !ok { + if organizationsettinghistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsettinghistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationsettinghistory.DefaultUpdatedAt() + oshc.mutation.SetUpdatedAt(v) + } + if _, ok := oshc.mutation.MappingID(); !ok { + if organizationsettinghistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized organizationsettinghistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := organizationsettinghistory.DefaultMappingID() + oshc.mutation.SetMappingID(v) + } + if _, ok := oshc.mutation.Tags(); !ok { + v := organizationsettinghistory.DefaultTags + oshc.mutation.SetTags(v) + } + if _, ok := oshc.mutation.GeoLocation(); !ok { + v := organizationsettinghistory.DefaultGeoLocation + oshc.mutation.SetGeoLocation(v) + } + if _, ok := oshc.mutation.ID(); !ok { + if organizationsettinghistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized organizationsettinghistory.DefaultID (forgotten import generated/runtime?)") + } + v := organizationsettinghistory.DefaultID() + oshc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (oshc *OrganizationSettingHistoryCreate) check() error { + if _, ok := oshc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "OrganizationSettingHistory.history_time"`)} + } + if _, ok := oshc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "OrganizationSettingHistory.operation"`)} + } + if v, ok := oshc.mutation.Operation(); ok { + if err := organizationsettinghistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "OrganizationSettingHistory.operation": %w`, err)} + } + } + if _, ok := oshc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OrganizationSettingHistory.mapping_id"`)} + } + if v, ok := oshc.mutation.GeoLocation(); ok { + if err := organizationsettinghistory.GeoLocationValidator(v); err != nil { + return &ValidationError{Name: "geo_location", err: fmt.Errorf(`generated: validator failed for field "OrganizationSettingHistory.geo_location": %w`, err)} + } + } + return nil +} + +func (oshc *OrganizationSettingHistoryCreate) sqlSave(ctx context.Context) (*OrganizationSettingHistory, error) { + if err := oshc.check(); err != nil { + return nil, err + } + _node, _spec := oshc.createSpec() + if err := sqlgraph.CreateNode(ctx, oshc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OrganizationSettingHistory.ID type: %T", _spec.ID.Value) + } + } + oshc.mutation.id = &_node.ID + oshc.mutation.done = true + return _node, nil +} + +func (oshc *OrganizationSettingHistoryCreate) createSpec() (*OrganizationSettingHistory, *sqlgraph.CreateSpec) { + var ( + _node = &OrganizationSettingHistory{config: oshc.config} + _spec = sqlgraph.NewCreateSpec(organizationsettinghistory.Table, sqlgraph.NewFieldSpec(organizationsettinghistory.FieldID, field.TypeString)) + ) + _spec.Schema = oshc.schemaConfig.OrganizationSettingHistory + if id, ok := oshc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := oshc.mutation.HistoryTime(); ok { + _spec.SetField(organizationsettinghistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := oshc.mutation.Ref(); ok { + _spec.SetField(organizationsettinghistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := oshc.mutation.Operation(); ok { + _spec.SetField(organizationsettinghistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := oshc.mutation.CreatedAt(); ok { + _spec.SetField(organizationsettinghistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := oshc.mutation.UpdatedAt(); ok { + _spec.SetField(organizationsettinghistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := oshc.mutation.CreatedBy(); ok { + _spec.SetField(organizationsettinghistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := oshc.mutation.UpdatedBy(); ok { + _spec.SetField(organizationsettinghistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := oshc.mutation.MappingID(); ok { + _spec.SetField(organizationsettinghistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := oshc.mutation.Tags(); ok { + _spec.SetField(organizationsettinghistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := oshc.mutation.DeletedAt(); ok { + _spec.SetField(organizationsettinghistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := oshc.mutation.DeletedBy(); ok { + _spec.SetField(organizationsettinghistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := oshc.mutation.Domains(); ok { + _spec.SetField(organizationsettinghistory.FieldDomains, field.TypeJSON, value) + _node.Domains = value + } + if value, ok := oshc.mutation.BillingContact(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingContact, field.TypeString, value) + _node.BillingContact = value + } + if value, ok := oshc.mutation.BillingEmail(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingEmail, field.TypeString, value) + _node.BillingEmail = value + } + if value, ok := oshc.mutation.BillingPhone(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingPhone, field.TypeString, value) + _node.BillingPhone = value + } + if value, ok := oshc.mutation.BillingAddress(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeString, value) + _node.BillingAddress = value + } + if value, ok := oshc.mutation.TaxIdentifier(); ok { + _spec.SetField(organizationsettinghistory.FieldTaxIdentifier, field.TypeString, value) + _node.TaxIdentifier = value + } + if value, ok := oshc.mutation.GeoLocation(); ok { + _spec.SetField(organizationsettinghistory.FieldGeoLocation, field.TypeEnum, value) + _node.GeoLocation = value + } + if value, ok := oshc.mutation.OrganizationID(); ok { + _spec.SetField(organizationsettinghistory.FieldOrganizationID, field.TypeString, value) + _node.OrganizationID = value + } + return _node, _spec +} + +// OrganizationSettingHistoryCreateBulk is the builder for creating many OrganizationSettingHistory entities in bulk. +type OrganizationSettingHistoryCreateBulk struct { + config + err error + builders []*OrganizationSettingHistoryCreate +} + +// Save creates the OrganizationSettingHistory entities in the database. +func (oshcb *OrganizationSettingHistoryCreateBulk) Save(ctx context.Context) ([]*OrganizationSettingHistory, error) { + if oshcb.err != nil { + return nil, oshcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(oshcb.builders)) + nodes := make([]*OrganizationSettingHistory, len(oshcb.builders)) + mutators := make([]Mutator, len(oshcb.builders)) + for i := range oshcb.builders { + func(i int, root context.Context) { + builder := oshcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OrganizationSettingHistoryMutation) + 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, oshcb.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, oshcb.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, oshcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (oshcb *OrganizationSettingHistoryCreateBulk) SaveX(ctx context.Context) []*OrganizationSettingHistory { + v, err := oshcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (oshcb *OrganizationSettingHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := oshcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oshcb *OrganizationSettingHistoryCreateBulk) ExecX(ctx context.Context) { + if err := oshcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organizationsettinghistory_delete.go b/internal/ent/generated/organizationsettinghistory_delete.go new file mode 100644 index 0000000..aac2537 --- /dev/null +++ b/internal/ent/generated/organizationsettinghistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" +) + +// OrganizationSettingHistoryDelete is the builder for deleting a OrganizationSettingHistory entity. +type OrganizationSettingHistoryDelete struct { + config + hooks []Hook + mutation *OrganizationSettingHistoryMutation +} + +// Where appends a list predicates to the OrganizationSettingHistoryDelete builder. +func (oshd *OrganizationSettingHistoryDelete) Where(ps ...predicate.OrganizationSettingHistory) *OrganizationSettingHistoryDelete { + oshd.mutation.Where(ps...) + return oshd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (oshd *OrganizationSettingHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, oshd.sqlExec, oshd.mutation, oshd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (oshd *OrganizationSettingHistoryDelete) ExecX(ctx context.Context) int { + n, err := oshd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (oshd *OrganizationSettingHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(organizationsettinghistory.Table, sqlgraph.NewFieldSpec(organizationsettinghistory.FieldID, field.TypeString)) + _spec.Node.Schema = oshd.schemaConfig.OrganizationSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, oshd.schemaConfig) + if ps := oshd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, oshd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + oshd.mutation.done = true + return affected, err +} + +// OrganizationSettingHistoryDeleteOne is the builder for deleting a single OrganizationSettingHistory entity. +type OrganizationSettingHistoryDeleteOne struct { + oshd *OrganizationSettingHistoryDelete +} + +// Where appends a list predicates to the OrganizationSettingHistoryDelete builder. +func (oshdo *OrganizationSettingHistoryDeleteOne) Where(ps ...predicate.OrganizationSettingHistory) *OrganizationSettingHistoryDeleteOne { + oshdo.oshd.mutation.Where(ps...) + return oshdo +} + +// Exec executes the deletion query. +func (oshdo *OrganizationSettingHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := oshdo.oshd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{organizationsettinghistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (oshdo *OrganizationSettingHistoryDeleteOne) ExecX(ctx context.Context) { + if err := oshdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/organizationsettinghistory_query.go b/internal/ent/generated/organizationsettinghistory_query.go new file mode 100644 index 0000000..7572b04 --- /dev/null +++ b/internal/ent/generated/organizationsettinghistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationSettingHistoryQuery is the builder for querying OrganizationSettingHistory entities. +type OrganizationSettingHistoryQuery struct { + config + ctx *QueryContext + order []organizationsettinghistory.OrderOption + inters []Interceptor + predicates []predicate.OrganizationSettingHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OrganizationSettingHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OrganizationSettingHistoryQuery builder. +func (oshq *OrganizationSettingHistoryQuery) Where(ps ...predicate.OrganizationSettingHistory) *OrganizationSettingHistoryQuery { + oshq.predicates = append(oshq.predicates, ps...) + return oshq +} + +// Limit the number of records to be returned by this query. +func (oshq *OrganizationSettingHistoryQuery) Limit(limit int) *OrganizationSettingHistoryQuery { + oshq.ctx.Limit = &limit + return oshq +} + +// Offset to start from. +func (oshq *OrganizationSettingHistoryQuery) Offset(offset int) *OrganizationSettingHistoryQuery { + oshq.ctx.Offset = &offset + return oshq +} + +// 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 (oshq *OrganizationSettingHistoryQuery) Unique(unique bool) *OrganizationSettingHistoryQuery { + oshq.ctx.Unique = &unique + return oshq +} + +// Order specifies how the records should be ordered. +func (oshq *OrganizationSettingHistoryQuery) Order(o ...organizationsettinghistory.OrderOption) *OrganizationSettingHistoryQuery { + oshq.order = append(oshq.order, o...) + return oshq +} + +// First returns the first OrganizationSettingHistory entity from the query. +// Returns a *NotFoundError when no OrganizationSettingHistory was found. +func (oshq *OrganizationSettingHistoryQuery) First(ctx context.Context) (*OrganizationSettingHistory, error) { + nodes, err := oshq.Limit(1).All(setContextOp(ctx, oshq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{organizationsettinghistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) FirstX(ctx context.Context) *OrganizationSettingHistory { + node, err := oshq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OrganizationSettingHistory ID from the query. +// Returns a *NotFoundError when no OrganizationSettingHistory ID was found. +func (oshq *OrganizationSettingHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = oshq.Limit(1).IDs(setContextOp(ctx, oshq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{organizationsettinghistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := oshq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OrganizationSettingHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OrganizationSettingHistory entity is found. +// Returns a *NotFoundError when no OrganizationSettingHistory entities are found. +func (oshq *OrganizationSettingHistoryQuery) Only(ctx context.Context) (*OrganizationSettingHistory, error) { + nodes, err := oshq.Limit(2).All(setContextOp(ctx, oshq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{organizationsettinghistory.Label} + default: + return nil, &NotSingularError{organizationsettinghistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) OnlyX(ctx context.Context) *OrganizationSettingHistory { + node, err := oshq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OrganizationSettingHistory ID in the query. +// Returns a *NotSingularError when more than one OrganizationSettingHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (oshq *OrganizationSettingHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = oshq.Limit(2).IDs(setContextOp(ctx, oshq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{organizationsettinghistory.Label} + default: + err = &NotSingularError{organizationsettinghistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := oshq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OrganizationSettingHistories. +func (oshq *OrganizationSettingHistoryQuery) All(ctx context.Context) ([]*OrganizationSettingHistory, error) { + ctx = setContextOp(ctx, oshq.ctx, ent.OpQueryAll) + if err := oshq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OrganizationSettingHistory, *OrganizationSettingHistoryQuery]() + return withInterceptors[[]*OrganizationSettingHistory](ctx, oshq, qr, oshq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) AllX(ctx context.Context) []*OrganizationSettingHistory { + nodes, err := oshq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OrganizationSettingHistory IDs. +func (oshq *OrganizationSettingHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if oshq.ctx.Unique == nil && oshq.path != nil { + oshq.Unique(true) + } + ctx = setContextOp(ctx, oshq.ctx, ent.OpQueryIDs) + if err = oshq.Select(organizationsettinghistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := oshq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (oshq *OrganizationSettingHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, oshq.ctx, ent.OpQueryCount) + if err := oshq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, oshq, querierCount[*OrganizationSettingHistoryQuery](), oshq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) CountX(ctx context.Context) int { + count, err := oshq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (oshq *OrganizationSettingHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, oshq.ctx, ent.OpQueryExist) + switch _, err := oshq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (oshq *OrganizationSettingHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := oshq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OrganizationSettingHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (oshq *OrganizationSettingHistoryQuery) Clone() *OrganizationSettingHistoryQuery { + if oshq == nil { + return nil + } + return &OrganizationSettingHistoryQuery{ + config: oshq.config, + ctx: oshq.ctx.Clone(), + order: append([]organizationsettinghistory.OrderOption{}, oshq.order...), + inters: append([]Interceptor{}, oshq.inters...), + predicates: append([]predicate.OrganizationSettingHistory{}, oshq.predicates...), + // clone intermediate query. + sql: oshq.sql.Clone(), + path: oshq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OrganizationSettingHistory.Query(). +// GroupBy(organizationsettinghistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (oshq *OrganizationSettingHistoryQuery) GroupBy(field string, fields ...string) *OrganizationSettingHistoryGroupBy { + oshq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OrganizationSettingHistoryGroupBy{build: oshq} + grbuild.flds = &oshq.ctx.Fields + grbuild.label = organizationsettinghistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.OrganizationSettingHistory.Query(). +// Select(organizationsettinghistory.FieldHistoryTime). +// Scan(ctx, &v) +func (oshq *OrganizationSettingHistoryQuery) Select(fields ...string) *OrganizationSettingHistorySelect { + oshq.ctx.Fields = append(oshq.ctx.Fields, fields...) + sbuild := &OrganizationSettingHistorySelect{OrganizationSettingHistoryQuery: oshq} + sbuild.label = organizationsettinghistory.Label + sbuild.flds, sbuild.scan = &oshq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OrganizationSettingHistorySelect configured with the given aggregations. +func (oshq *OrganizationSettingHistoryQuery) Aggregate(fns ...AggregateFunc) *OrganizationSettingHistorySelect { + return oshq.Select().Aggregate(fns...) +} + +func (oshq *OrganizationSettingHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range oshq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, oshq); err != nil { + return err + } + } + } + for _, f := range oshq.ctx.Fields { + if !organizationsettinghistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if oshq.path != nil { + prev, err := oshq.path(ctx) + if err != nil { + return err + } + oshq.sql = prev + } + if organizationsettinghistory.Policy == nil { + return errors.New("generated: uninitialized organizationsettinghistory.Policy (forgotten import generated/runtime?)") + } + if err := organizationsettinghistory.Policy.EvalQuery(ctx, oshq); err != nil { + return err + } + return nil +} + +func (oshq *OrganizationSettingHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OrganizationSettingHistory, error) { + var ( + nodes = []*OrganizationSettingHistory{} + _spec = oshq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OrganizationSettingHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OrganizationSettingHistory{config: oshq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = oshq.schemaConfig.OrganizationSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, oshq.schemaConfig) + if len(oshq.modifiers) > 0 { + _spec.Modifiers = oshq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, oshq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range oshq.loadTotal { + if err := oshq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (oshq *OrganizationSettingHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := oshq.querySpec() + _spec.Node.Schema = oshq.schemaConfig.OrganizationSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, oshq.schemaConfig) + if len(oshq.modifiers) > 0 { + _spec.Modifiers = oshq.modifiers + } + _spec.Node.Columns = oshq.ctx.Fields + if len(oshq.ctx.Fields) > 0 { + _spec.Unique = oshq.ctx.Unique != nil && *oshq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, oshq.driver, _spec) +} + +func (oshq *OrganizationSettingHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(organizationsettinghistory.Table, organizationsettinghistory.Columns, sqlgraph.NewFieldSpec(organizationsettinghistory.FieldID, field.TypeString)) + _spec.From = oshq.sql + if unique := oshq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if oshq.path != nil { + _spec.Unique = true + } + if fields := oshq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organizationsettinghistory.FieldID) + for i := range fields { + if fields[i] != organizationsettinghistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := oshq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := oshq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := oshq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := oshq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (oshq *OrganizationSettingHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(oshq.driver.Dialect()) + t1 := builder.Table(organizationsettinghistory.Table) + columns := oshq.ctx.Fields + if len(columns) == 0 { + columns = organizationsettinghistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if oshq.sql != nil { + selector = oshq.sql + selector.Select(selector.Columns(columns...)...) + } + if oshq.ctx.Unique != nil && *oshq.ctx.Unique { + selector.Distinct() + } + t1.Schema(oshq.schemaConfig.OrganizationSettingHistory) + ctx = internal.NewSchemaConfigContext(ctx, oshq.schemaConfig) + selector.WithContext(ctx) + for _, p := range oshq.predicates { + p(selector) + } + for _, p := range oshq.order { + p(selector) + } + if offset := oshq.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 := oshq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// OrganizationSettingHistoryGroupBy is the group-by builder for OrganizationSettingHistory entities. +type OrganizationSettingHistoryGroupBy struct { + selector + build *OrganizationSettingHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (oshgb *OrganizationSettingHistoryGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationSettingHistoryGroupBy { + oshgb.fns = append(oshgb.fns, fns...) + return oshgb +} + +// Scan applies the selector query and scans the result into the given value. +func (oshgb *OrganizationSettingHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, oshgb.build.ctx, ent.OpQueryGroupBy) + if err := oshgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationSettingHistoryQuery, *OrganizationSettingHistoryGroupBy](ctx, oshgb.build, oshgb, oshgb.build.inters, v) +} + +func (oshgb *OrganizationSettingHistoryGroupBy) sqlScan(ctx context.Context, root *OrganizationSettingHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(oshgb.fns)) + for _, fn := range oshgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*oshgb.flds)+len(oshgb.fns)) + for _, f := range *oshgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*oshgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := oshgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OrganizationSettingHistorySelect is the builder for selecting fields of OrganizationSettingHistory entities. +type OrganizationSettingHistorySelect struct { + *OrganizationSettingHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (oshs *OrganizationSettingHistorySelect) Aggregate(fns ...AggregateFunc) *OrganizationSettingHistorySelect { + oshs.fns = append(oshs.fns, fns...) + return oshs +} + +// Scan applies the selector query and scans the result into the given value. +func (oshs *OrganizationSettingHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, oshs.ctx, ent.OpQuerySelect) + if err := oshs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrganizationSettingHistoryQuery, *OrganizationSettingHistorySelect](ctx, oshs.OrganizationSettingHistoryQuery, oshs, oshs.inters, v) +} + +func (oshs *OrganizationSettingHistorySelect) sqlScan(ctx context.Context, root *OrganizationSettingHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(oshs.fns)) + for _, fn := range oshs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*oshs.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 := oshs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/organizationsettinghistory_update.go b/internal/ent/generated/organizationsettinghistory_update.go new file mode 100644 index 0000000..2205caa --- /dev/null +++ b/internal/ent/generated/organizationsettinghistory_update.go @@ -0,0 +1,930 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrganizationSettingHistoryUpdate is the builder for updating OrganizationSettingHistory entities. +type OrganizationSettingHistoryUpdate struct { + config + hooks []Hook + mutation *OrganizationSettingHistoryMutation +} + +// Where appends a list predicates to the OrganizationSettingHistoryUpdate builder. +func (oshu *OrganizationSettingHistoryUpdate) Where(ps ...predicate.OrganizationSettingHistory) *OrganizationSettingHistoryUpdate { + oshu.mutation.Where(ps...) + return oshu +} + +// SetUpdatedAt sets the "updated_at" field. +func (oshu *OrganizationSettingHistoryUpdate) SetUpdatedAt(t time.Time) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetUpdatedAt(t) + return oshu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearUpdatedAt() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearUpdatedAt() + return oshu +} + +// SetUpdatedBy sets the "updated_by" field. +func (oshu *OrganizationSettingHistoryUpdate) SetUpdatedBy(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetUpdatedBy(s) + return oshu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableUpdatedBy(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetUpdatedBy(*s) + } + return oshu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearUpdatedBy() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearUpdatedBy() + return oshu +} + +// SetTags sets the "tags" field. +func (oshu *OrganizationSettingHistoryUpdate) SetTags(s []string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetTags(s) + return oshu +} + +// AppendTags appends s to the "tags" field. +func (oshu *OrganizationSettingHistoryUpdate) AppendTags(s []string) *OrganizationSettingHistoryUpdate { + oshu.mutation.AppendTags(s) + return oshu +} + +// ClearTags clears the value of the "tags" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearTags() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearTags() + return oshu +} + +// SetDeletedAt sets the "deleted_at" field. +func (oshu *OrganizationSettingHistoryUpdate) SetDeletedAt(t time.Time) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetDeletedAt(t) + return oshu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableDeletedAt(t *time.Time) *OrganizationSettingHistoryUpdate { + if t != nil { + oshu.SetDeletedAt(*t) + } + return oshu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearDeletedAt() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearDeletedAt() + return oshu +} + +// SetDeletedBy sets the "deleted_by" field. +func (oshu *OrganizationSettingHistoryUpdate) SetDeletedBy(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetDeletedBy(s) + return oshu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableDeletedBy(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetDeletedBy(*s) + } + return oshu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearDeletedBy() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearDeletedBy() + return oshu +} + +// SetDomains sets the "domains" field. +func (oshu *OrganizationSettingHistoryUpdate) SetDomains(s []string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetDomains(s) + return oshu +} + +// AppendDomains appends s to the "domains" field. +func (oshu *OrganizationSettingHistoryUpdate) AppendDomains(s []string) *OrganizationSettingHistoryUpdate { + oshu.mutation.AppendDomains(s) + return oshu +} + +// ClearDomains clears the value of the "domains" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearDomains() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearDomains() + return oshu +} + +// SetBillingContact sets the "billing_contact" field. +func (oshu *OrganizationSettingHistoryUpdate) SetBillingContact(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetBillingContact(s) + return oshu +} + +// SetNillableBillingContact sets the "billing_contact" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableBillingContact(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetBillingContact(*s) + } + return oshu +} + +// ClearBillingContact clears the value of the "billing_contact" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearBillingContact() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearBillingContact() + return oshu +} + +// SetBillingEmail sets the "billing_email" field. +func (oshu *OrganizationSettingHistoryUpdate) SetBillingEmail(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetBillingEmail(s) + return oshu +} + +// SetNillableBillingEmail sets the "billing_email" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableBillingEmail(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetBillingEmail(*s) + } + return oshu +} + +// ClearBillingEmail clears the value of the "billing_email" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearBillingEmail() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearBillingEmail() + return oshu +} + +// SetBillingPhone sets the "billing_phone" field. +func (oshu *OrganizationSettingHistoryUpdate) SetBillingPhone(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetBillingPhone(s) + return oshu +} + +// SetNillableBillingPhone sets the "billing_phone" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableBillingPhone(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetBillingPhone(*s) + } + return oshu +} + +// ClearBillingPhone clears the value of the "billing_phone" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearBillingPhone() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearBillingPhone() + return oshu +} + +// SetBillingAddress sets the "billing_address" field. +func (oshu *OrganizationSettingHistoryUpdate) SetBillingAddress(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetBillingAddress(s) + return oshu +} + +// SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableBillingAddress(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetBillingAddress(*s) + } + return oshu +} + +// ClearBillingAddress clears the value of the "billing_address" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearBillingAddress() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearBillingAddress() + return oshu +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (oshu *OrganizationSettingHistoryUpdate) SetTaxIdentifier(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetTaxIdentifier(s) + return oshu +} + +// SetNillableTaxIdentifier sets the "tax_identifier" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableTaxIdentifier(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetTaxIdentifier(*s) + } + return oshu +} + +// ClearTaxIdentifier clears the value of the "tax_identifier" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearTaxIdentifier() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearTaxIdentifier() + return oshu +} + +// SetGeoLocation sets the "geo_location" field. +func (oshu *OrganizationSettingHistoryUpdate) SetGeoLocation(e enums.Region) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetGeoLocation(e) + return oshu +} + +// SetNillableGeoLocation sets the "geo_location" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableGeoLocation(e *enums.Region) *OrganizationSettingHistoryUpdate { + if e != nil { + oshu.SetGeoLocation(*e) + } + return oshu +} + +// ClearGeoLocation clears the value of the "geo_location" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearGeoLocation() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearGeoLocation() + return oshu +} + +// SetOrganizationID sets the "organization_id" field. +func (oshu *OrganizationSettingHistoryUpdate) SetOrganizationID(s string) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetOrganizationID(s) + return oshu +} + +// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil. +func (oshu *OrganizationSettingHistoryUpdate) SetNillableOrganizationID(s *string) *OrganizationSettingHistoryUpdate { + if s != nil { + oshu.SetOrganizationID(*s) + } + return oshu +} + +// ClearOrganizationID clears the value of the "organization_id" field. +func (oshu *OrganizationSettingHistoryUpdate) ClearOrganizationID() *OrganizationSettingHistoryUpdate { + oshu.mutation.ClearOrganizationID() + return oshu +} + +// Mutation returns the OrganizationSettingHistoryMutation object of the builder. +func (oshu *OrganizationSettingHistoryUpdate) Mutation() *OrganizationSettingHistoryMutation { + return oshu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (oshu *OrganizationSettingHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := oshu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, oshu.sqlSave, oshu.mutation, oshu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (oshu *OrganizationSettingHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := oshu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (oshu *OrganizationSettingHistoryUpdate) Exec(ctx context.Context) error { + _, err := oshu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oshu *OrganizationSettingHistoryUpdate) ExecX(ctx context.Context) { + if err := oshu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (oshu *OrganizationSettingHistoryUpdate) defaults() error { + if _, ok := oshu.mutation.UpdatedAt(); !ok && !oshu.mutation.UpdatedAtCleared() { + if organizationsettinghistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsettinghistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationsettinghistory.UpdateDefaultUpdatedAt() + oshu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (oshu *OrganizationSettingHistoryUpdate) check() error { + if v, ok := oshu.mutation.GeoLocation(); ok { + if err := organizationsettinghistory.GeoLocationValidator(v); err != nil { + return &ValidationError{Name: "geo_location", err: fmt.Errorf(`generated: validator failed for field "OrganizationSettingHistory.geo_location": %w`, err)} + } + } + return nil +} + +func (oshu *OrganizationSettingHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := oshu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(organizationsettinghistory.Table, organizationsettinghistory.Columns, sqlgraph.NewFieldSpec(organizationsettinghistory.FieldID, field.TypeString)) + if ps := oshu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if oshu.mutation.RefCleared() { + _spec.ClearField(organizationsettinghistory.FieldRef, field.TypeString) + } + if oshu.mutation.CreatedAtCleared() { + _spec.ClearField(organizationsettinghistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := oshu.mutation.UpdatedAt(); ok { + _spec.SetField(organizationsettinghistory.FieldUpdatedAt, field.TypeTime, value) + } + if oshu.mutation.UpdatedAtCleared() { + _spec.ClearField(organizationsettinghistory.FieldUpdatedAt, field.TypeTime) + } + if oshu.mutation.CreatedByCleared() { + _spec.ClearField(organizationsettinghistory.FieldCreatedBy, field.TypeString) + } + if value, ok := oshu.mutation.UpdatedBy(); ok { + _spec.SetField(organizationsettinghistory.FieldUpdatedBy, field.TypeString, value) + } + if oshu.mutation.UpdatedByCleared() { + _spec.ClearField(organizationsettinghistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := oshu.mutation.Tags(); ok { + _spec.SetField(organizationsettinghistory.FieldTags, field.TypeJSON, value) + } + if value, ok := oshu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsettinghistory.FieldTags, value) + }) + } + if oshu.mutation.TagsCleared() { + _spec.ClearField(organizationsettinghistory.FieldTags, field.TypeJSON) + } + if value, ok := oshu.mutation.DeletedAt(); ok { + _spec.SetField(organizationsettinghistory.FieldDeletedAt, field.TypeTime, value) + } + if oshu.mutation.DeletedAtCleared() { + _spec.ClearField(organizationsettinghistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := oshu.mutation.DeletedBy(); ok { + _spec.SetField(organizationsettinghistory.FieldDeletedBy, field.TypeString, value) + } + if oshu.mutation.DeletedByCleared() { + _spec.ClearField(organizationsettinghistory.FieldDeletedBy, field.TypeString) + } + if value, ok := oshu.mutation.Domains(); ok { + _spec.SetField(organizationsettinghistory.FieldDomains, field.TypeJSON, value) + } + if value, ok := oshu.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsettinghistory.FieldDomains, value) + }) + } + if oshu.mutation.DomainsCleared() { + _spec.ClearField(organizationsettinghistory.FieldDomains, field.TypeJSON) + } + if value, ok := oshu.mutation.BillingContact(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingContact, field.TypeString, value) + } + if oshu.mutation.BillingContactCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingContact, field.TypeString) + } + if value, ok := oshu.mutation.BillingEmail(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingEmail, field.TypeString, value) + } + if oshu.mutation.BillingEmailCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingEmail, field.TypeString) + } + if value, ok := oshu.mutation.BillingPhone(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingPhone, field.TypeString, value) + } + if oshu.mutation.BillingPhoneCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingPhone, field.TypeString) + } + if value, ok := oshu.mutation.BillingAddress(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeString, value) + } + if oshu.mutation.BillingAddressCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingAddress, field.TypeString) + } + if value, ok := oshu.mutation.TaxIdentifier(); ok { + _spec.SetField(organizationsettinghistory.FieldTaxIdentifier, field.TypeString, value) + } + if oshu.mutation.TaxIdentifierCleared() { + _spec.ClearField(organizationsettinghistory.FieldTaxIdentifier, field.TypeString) + } + if value, ok := oshu.mutation.GeoLocation(); ok { + _spec.SetField(organizationsettinghistory.FieldGeoLocation, field.TypeEnum, value) + } + if oshu.mutation.GeoLocationCleared() { + _spec.ClearField(organizationsettinghistory.FieldGeoLocation, field.TypeEnum) + } + if value, ok := oshu.mutation.OrganizationID(); ok { + _spec.SetField(organizationsettinghistory.FieldOrganizationID, field.TypeString, value) + } + if oshu.mutation.OrganizationIDCleared() { + _spec.ClearField(organizationsettinghistory.FieldOrganizationID, field.TypeString) + } + _spec.Node.Schema = oshu.schemaConfig.OrganizationSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, oshu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, oshu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organizationsettinghistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + oshu.mutation.done = true + return n, nil +} + +// OrganizationSettingHistoryUpdateOne is the builder for updating a single OrganizationSettingHistory entity. +type OrganizationSettingHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OrganizationSettingHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetUpdatedAt(t time.Time) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetUpdatedAt(t) + return oshuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearUpdatedAt() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearUpdatedAt() + return oshuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetUpdatedBy(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetUpdatedBy(s) + return oshuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableUpdatedBy(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetUpdatedBy(*s) + } + return oshuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearUpdatedBy() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearUpdatedBy() + return oshuo +} + +// SetTags sets the "tags" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetTags(s []string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetTags(s) + return oshuo +} + +// AppendTags appends s to the "tags" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) AppendTags(s []string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.AppendTags(s) + return oshuo +} + +// ClearTags clears the value of the "tags" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearTags() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearTags() + return oshuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetDeletedAt(t time.Time) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetDeletedAt(t) + return oshuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *OrganizationSettingHistoryUpdateOne { + if t != nil { + oshuo.SetDeletedAt(*t) + } + return oshuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearDeletedAt() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearDeletedAt() + return oshuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetDeletedBy(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetDeletedBy(s) + return oshuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableDeletedBy(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetDeletedBy(*s) + } + return oshuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearDeletedBy() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearDeletedBy() + return oshuo +} + +// SetDomains sets the "domains" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetDomains(s []string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetDomains(s) + return oshuo +} + +// AppendDomains appends s to the "domains" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) AppendDomains(s []string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.AppendDomains(s) + return oshuo +} + +// ClearDomains clears the value of the "domains" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearDomains() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearDomains() + return oshuo +} + +// SetBillingContact sets the "billing_contact" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetBillingContact(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetBillingContact(s) + return oshuo +} + +// SetNillableBillingContact sets the "billing_contact" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableBillingContact(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetBillingContact(*s) + } + return oshuo +} + +// ClearBillingContact clears the value of the "billing_contact" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearBillingContact() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearBillingContact() + return oshuo +} + +// SetBillingEmail sets the "billing_email" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetBillingEmail(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetBillingEmail(s) + return oshuo +} + +// SetNillableBillingEmail sets the "billing_email" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableBillingEmail(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetBillingEmail(*s) + } + return oshuo +} + +// ClearBillingEmail clears the value of the "billing_email" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearBillingEmail() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearBillingEmail() + return oshuo +} + +// SetBillingPhone sets the "billing_phone" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetBillingPhone(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetBillingPhone(s) + return oshuo +} + +// SetNillableBillingPhone sets the "billing_phone" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableBillingPhone(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetBillingPhone(*s) + } + return oshuo +} + +// ClearBillingPhone clears the value of the "billing_phone" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearBillingPhone() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearBillingPhone() + return oshuo +} + +// SetBillingAddress sets the "billing_address" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetBillingAddress(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetBillingAddress(s) + return oshuo +} + +// SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableBillingAddress(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetBillingAddress(*s) + } + return oshuo +} + +// ClearBillingAddress clears the value of the "billing_address" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearBillingAddress() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearBillingAddress() + return oshuo +} + +// SetTaxIdentifier sets the "tax_identifier" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetTaxIdentifier(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetTaxIdentifier(s) + return oshuo +} + +// SetNillableTaxIdentifier sets the "tax_identifier" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableTaxIdentifier(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetTaxIdentifier(*s) + } + return oshuo +} + +// ClearTaxIdentifier clears the value of the "tax_identifier" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearTaxIdentifier() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearTaxIdentifier() + return oshuo +} + +// SetGeoLocation sets the "geo_location" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetGeoLocation(e enums.Region) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetGeoLocation(e) + return oshuo +} + +// SetNillableGeoLocation sets the "geo_location" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableGeoLocation(e *enums.Region) *OrganizationSettingHistoryUpdateOne { + if e != nil { + oshuo.SetGeoLocation(*e) + } + return oshuo +} + +// ClearGeoLocation clears the value of the "geo_location" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearGeoLocation() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearGeoLocation() + return oshuo +} + +// SetOrganizationID sets the "organization_id" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetOrganizationID(s string) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetOrganizationID(s) + return oshuo +} + +// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil. +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableOrganizationID(s *string) *OrganizationSettingHistoryUpdateOne { + if s != nil { + oshuo.SetOrganizationID(*s) + } + return oshuo +} + +// ClearOrganizationID clears the value of the "organization_id" field. +func (oshuo *OrganizationSettingHistoryUpdateOne) ClearOrganizationID() *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.ClearOrganizationID() + return oshuo +} + +// Mutation returns the OrganizationSettingHistoryMutation object of the builder. +func (oshuo *OrganizationSettingHistoryUpdateOne) Mutation() *OrganizationSettingHistoryMutation { + return oshuo.mutation +} + +// Where appends a list predicates to the OrganizationSettingHistoryUpdate builder. +func (oshuo *OrganizationSettingHistoryUpdateOne) Where(ps ...predicate.OrganizationSettingHistory) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.Where(ps...) + return oshuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (oshuo *OrganizationSettingHistoryUpdateOne) Select(field string, fields ...string) *OrganizationSettingHistoryUpdateOne { + oshuo.fields = append([]string{field}, fields...) + return oshuo +} + +// Save executes the query and returns the updated OrganizationSettingHistory entity. +func (oshuo *OrganizationSettingHistoryUpdateOne) Save(ctx context.Context) (*OrganizationSettingHistory, error) { + if err := oshuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, oshuo.sqlSave, oshuo.mutation, oshuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (oshuo *OrganizationSettingHistoryUpdateOne) SaveX(ctx context.Context) *OrganizationSettingHistory { + node, err := oshuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (oshuo *OrganizationSettingHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := oshuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (oshuo *OrganizationSettingHistoryUpdateOne) ExecX(ctx context.Context) { + if err := oshuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (oshuo *OrganizationSettingHistoryUpdateOne) defaults() error { + if _, ok := oshuo.mutation.UpdatedAt(); !ok && !oshuo.mutation.UpdatedAtCleared() { + if organizationsettinghistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized organizationsettinghistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := organizationsettinghistory.UpdateDefaultUpdatedAt() + oshuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (oshuo *OrganizationSettingHistoryUpdateOne) check() error { + if v, ok := oshuo.mutation.GeoLocation(); ok { + if err := organizationsettinghistory.GeoLocationValidator(v); err != nil { + return &ValidationError{Name: "geo_location", err: fmt.Errorf(`generated: validator failed for field "OrganizationSettingHistory.geo_location": %w`, err)} + } + } + return nil +} + +func (oshuo *OrganizationSettingHistoryUpdateOne) sqlSave(ctx context.Context) (_node *OrganizationSettingHistory, err error) { + if err := oshuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(organizationsettinghistory.Table, organizationsettinghistory.Columns, sqlgraph.NewFieldSpec(organizationsettinghistory.FieldID, field.TypeString)) + id, ok := oshuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OrganizationSettingHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := oshuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, organizationsettinghistory.FieldID) + for _, f := range fields { + if !organizationsettinghistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != organizationsettinghistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := oshuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if oshuo.mutation.RefCleared() { + _spec.ClearField(organizationsettinghistory.FieldRef, field.TypeString) + } + if oshuo.mutation.CreatedAtCleared() { + _spec.ClearField(organizationsettinghistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := oshuo.mutation.UpdatedAt(); ok { + _spec.SetField(organizationsettinghistory.FieldUpdatedAt, field.TypeTime, value) + } + if oshuo.mutation.UpdatedAtCleared() { + _spec.ClearField(organizationsettinghistory.FieldUpdatedAt, field.TypeTime) + } + if oshuo.mutation.CreatedByCleared() { + _spec.ClearField(organizationsettinghistory.FieldCreatedBy, field.TypeString) + } + if value, ok := oshuo.mutation.UpdatedBy(); ok { + _spec.SetField(organizationsettinghistory.FieldUpdatedBy, field.TypeString, value) + } + if oshuo.mutation.UpdatedByCleared() { + _spec.ClearField(organizationsettinghistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := oshuo.mutation.Tags(); ok { + _spec.SetField(organizationsettinghistory.FieldTags, field.TypeJSON, value) + } + if value, ok := oshuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsettinghistory.FieldTags, value) + }) + } + if oshuo.mutation.TagsCleared() { + _spec.ClearField(organizationsettinghistory.FieldTags, field.TypeJSON) + } + if value, ok := oshuo.mutation.DeletedAt(); ok { + _spec.SetField(organizationsettinghistory.FieldDeletedAt, field.TypeTime, value) + } + if oshuo.mutation.DeletedAtCleared() { + _spec.ClearField(organizationsettinghistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := oshuo.mutation.DeletedBy(); ok { + _spec.SetField(organizationsettinghistory.FieldDeletedBy, field.TypeString, value) + } + if oshuo.mutation.DeletedByCleared() { + _spec.ClearField(organizationsettinghistory.FieldDeletedBy, field.TypeString) + } + if value, ok := oshuo.mutation.Domains(); ok { + _spec.SetField(organizationsettinghistory.FieldDomains, field.TypeJSON, value) + } + if value, ok := oshuo.mutation.AppendedDomains(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, organizationsettinghistory.FieldDomains, value) + }) + } + if oshuo.mutation.DomainsCleared() { + _spec.ClearField(organizationsettinghistory.FieldDomains, field.TypeJSON) + } + if value, ok := oshuo.mutation.BillingContact(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingContact, field.TypeString, value) + } + if oshuo.mutation.BillingContactCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingContact, field.TypeString) + } + if value, ok := oshuo.mutation.BillingEmail(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingEmail, field.TypeString, value) + } + if oshuo.mutation.BillingEmailCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingEmail, field.TypeString) + } + if value, ok := oshuo.mutation.BillingPhone(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingPhone, field.TypeString, value) + } + if oshuo.mutation.BillingPhoneCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingPhone, field.TypeString) + } + if value, ok := oshuo.mutation.BillingAddress(); ok { + _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeString, value) + } + if oshuo.mutation.BillingAddressCleared() { + _spec.ClearField(organizationsettinghistory.FieldBillingAddress, field.TypeString) + } + if value, ok := oshuo.mutation.TaxIdentifier(); ok { + _spec.SetField(organizationsettinghistory.FieldTaxIdentifier, field.TypeString, value) + } + if oshuo.mutation.TaxIdentifierCleared() { + _spec.ClearField(organizationsettinghistory.FieldTaxIdentifier, field.TypeString) + } + if value, ok := oshuo.mutation.GeoLocation(); ok { + _spec.SetField(organizationsettinghistory.FieldGeoLocation, field.TypeEnum, value) + } + if oshuo.mutation.GeoLocationCleared() { + _spec.ClearField(organizationsettinghistory.FieldGeoLocation, field.TypeEnum) + } + if value, ok := oshuo.mutation.OrganizationID(); ok { + _spec.SetField(organizationsettinghistory.FieldOrganizationID, field.TypeString, value) + } + if oshuo.mutation.OrganizationIDCleared() { + _spec.ClearField(organizationsettinghistory.FieldOrganizationID, field.TypeString) + } + _spec.Node.Schema = oshuo.schemaConfig.OrganizationSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, oshuo.schemaConfig) + _node = &OrganizationSettingHistory{config: oshuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, oshuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{organizationsettinghistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + oshuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/orgmembership.go b/internal/ent/generated/orgmembership.go new file mode 100644 index 0000000..1e9d397 --- /dev/null +++ b/internal/ent/generated/orgmembership.go @@ -0,0 +1,296 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/pkg/enums" +) + +// OrgMembership is the model entity for the OrgMembership schema. +type OrgMembership struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // Role holds the value of the "role" field. + Role enums.Role `json:"role,omitempty"` + // OrganizationID holds the value of the "organization_id" field. + OrganizationID string `json:"organization_id,omitempty"` + // UserID holds the value of the "user_id" field. + UserID string `json:"user_id,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the OrgMembershipQuery when eager-loading is set. + Edges OrgMembershipEdges `json:"edges"` + selectValues sql.SelectValues +} + +// OrgMembershipEdges holds the relations/edges for other nodes in the graph. +type OrgMembershipEdges struct { + // Organization holds the value of the organization edge. + Organization *Organization `json:"organization,omitempty"` + // User holds the value of the user edge. + User *User `json:"user,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [3]bool + // totalCount holds the count of the edges above. + totalCount [3]map[string]int + + namedEvents map[string][]*Event +} + +// OrganizationOrErr returns the Organization value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e OrgMembershipEdges) OrganizationOrErr() (*Organization, error) { + if e.Organization != nil { + return e.Organization, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "organization"} +} + +// UserOrErr returns the User value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e OrgMembershipEdges) UserOrErr() (*User, error) { + if e.User != nil { + return e.User, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "user"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e OrgMembershipEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[2] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OrgMembership) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case orgmembership.FieldID, orgmembership.FieldCreatedBy, orgmembership.FieldUpdatedBy, orgmembership.FieldMappingID, orgmembership.FieldDeletedBy, orgmembership.FieldRole, orgmembership.FieldOrganizationID, orgmembership.FieldUserID: + values[i] = new(sql.NullString) + case orgmembership.FieldCreatedAt, orgmembership.FieldUpdatedAt, orgmembership.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OrgMembership fields. +func (om *OrgMembership) 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 orgmembership.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + om.ID = value.String + } + case orgmembership.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + om.CreatedAt = value.Time + } + case orgmembership.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + om.UpdatedAt = value.Time + } + case orgmembership.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + om.CreatedBy = value.String + } + case orgmembership.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + om.UpdatedBy = value.String + } + case orgmembership.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + om.MappingID = value.String + } + case orgmembership.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + om.DeletedAt = value.Time + } + case orgmembership.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + om.DeletedBy = value.String + } + case orgmembership.FieldRole: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field role", values[i]) + } else if value.Valid { + om.Role = enums.Role(value.String) + } + case orgmembership.FieldOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field organization_id", values[i]) + } else if value.Valid { + om.OrganizationID = value.String + } + case orgmembership.FieldUserID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_id", values[i]) + } else if value.Valid { + om.UserID = value.String + } + default: + om.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OrgMembership. +// This includes values selected through modifiers, order, etc. +func (om *OrgMembership) Value(name string) (ent.Value, error) { + return om.selectValues.Get(name) +} + +// QueryOrganization queries the "organization" edge of the OrgMembership entity. +func (om *OrgMembership) QueryOrganization() *OrganizationQuery { + return NewOrgMembershipClient(om.config).QueryOrganization(om) +} + +// QueryUser queries the "user" edge of the OrgMembership entity. +func (om *OrgMembership) QueryUser() *UserQuery { + return NewOrgMembershipClient(om.config).QueryUser(om) +} + +// QueryEvents queries the "events" edge of the OrgMembership entity. +func (om *OrgMembership) QueryEvents() *EventQuery { + return NewOrgMembershipClient(om.config).QueryEvents(om) +} + +// Update returns a builder for updating this OrgMembership. +// Note that you need to call OrgMembership.Unwrap() before calling this method if this OrgMembership +// was returned from a transaction, and the transaction was committed or rolled back. +func (om *OrgMembership) Update() *OrgMembershipUpdateOne { + return NewOrgMembershipClient(om.config).UpdateOne(om) +} + +// Unwrap unwraps the OrgMembership 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 (om *OrgMembership) Unwrap() *OrgMembership { + _tx, ok := om.config.driver.(*txDriver) + if !ok { + panic("generated: OrgMembership is not a transactional entity") + } + om.config.driver = _tx.drv + return om +} + +// String implements the fmt.Stringer. +func (om *OrgMembership) String() string { + var builder strings.Builder + builder.WriteString("OrgMembership(") + builder.WriteString(fmt.Sprintf("id=%v, ", om.ID)) + builder.WriteString("created_at=") + builder.WriteString(om.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(om.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(om.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(om.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(om.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(om.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(om.DeletedBy) + builder.WriteString(", ") + builder.WriteString("role=") + builder.WriteString(fmt.Sprintf("%v", om.Role)) + builder.WriteString(", ") + builder.WriteString("organization_id=") + builder.WriteString(om.OrganizationID) + builder.WriteString(", ") + builder.WriteString("user_id=") + builder.WriteString(om.UserID) + builder.WriteByte(')') + return builder.String() +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (om *OrgMembership) NamedEvents(name string) ([]*Event, error) { + if om.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := om.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (om *OrgMembership) appendNamedEvents(name string, edges ...*Event) { + if om.Edges.namedEvents == nil { + om.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + om.Edges.namedEvents[name] = []*Event{} + } else { + om.Edges.namedEvents[name] = append(om.Edges.namedEvents[name], edges...) + } +} + +// OrgMemberships is a parsable slice of OrgMembership. +type OrgMemberships []*OrgMembership diff --git a/internal/ent/generated/orgmembership/orgmembership.go b/internal/ent/generated/orgmembership/orgmembership.go new file mode 100644 index 0000000..6a39a9e --- /dev/null +++ b/internal/ent/generated/orgmembership/orgmembership.go @@ -0,0 +1,246 @@ +// Code generated by ent, DO NOT EDIT. + +package orgmembership + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the orgmembership type in the database. + Label = "org_membership" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldRole holds the string denoting the role field in the database. + FieldRole = "role" + // FieldOrganizationID holds the string denoting the organization_id field in the database. + FieldOrganizationID = "organization_id" + // FieldUserID holds the string denoting the user_id field in the database. + FieldUserID = "user_id" + // EdgeOrganization holds the string denoting the organization edge name in mutations. + EdgeOrganization = "organization" + // EdgeUser holds the string denoting the user edge name in mutations. + EdgeUser = "user" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the orgmembership in the database. + Table = "org_memberships" + // OrganizationTable is the table that holds the organization relation/edge. + OrganizationTable = "org_memberships" + // OrganizationInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationInverseTable = "organizations" + // OrganizationColumn is the table column denoting the organization relation/edge. + OrganizationColumn = "organization_id" + // UserTable is the table that holds the user relation/edge. + UserTable = "org_memberships" + // UserInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + UserInverseTable = "users" + // UserColumn is the table column denoting the user relation/edge. + UserColumn = "user_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "org_membership_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for orgmembership fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldRole, + FieldOrganizationID, + FieldUserID, +} + +var ( + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"org_membership_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [3]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultRole enums.Role = "MEMBER" + +// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save. +func RoleValidator(r enums.Role) error { + switch r.String() { + case "ADMIN", "MEMBER", "USER", "OWNER": + return nil + default: + return fmt.Errorf("orgmembership: invalid enum value for role field: %q", r) + } +} + +// OrderOption defines the ordering options for the OrgMembership queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByRole orders the results by the role field. +func ByRole(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRole, opts...).ToFunc() +} + +// ByOrganizationID orders the results by the organization_id field. +func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() +} + +// ByUserID orders the results by the user_id field. +func ByUserID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserID, opts...).ToFunc() +} + +// ByOrganizationField orders the results by organization field. +func ByOrganizationField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationStep(), sql.OrderByField(field, opts...)) + } +} + +// ByUserField orders the results by user field. +func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOrganizationStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, OrganizationTable, OrganizationColumn), + ) +} +func newUserStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(UserInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, UserTable, UserColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} + +var ( + // enums.Role must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Role)(nil) + // enums.Role must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Role)(nil) +) diff --git a/internal/ent/generated/orgmembership/where.go b/internal/ent/generated/orgmembership/where.go new file mode 100644 index 0000000..ed90a6d --- /dev/null +++ b/internal/ent/generated/orgmembership/where.go @@ -0,0 +1,816 @@ +// Code generated by ent, DO NOT EDIT. + +package orgmembership + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ. +func OrganizationID(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldOrganizationID, v)) +} + +// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. +func UserID(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldUserID, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v enums.Role) predicate.OrgMembership { + vc := v + return predicate.OrgMembership(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v enums.Role) predicate.OrgMembership { + vc := v + return predicate.OrgMembership(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...enums.Role) predicate.OrgMembership { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrgMembership(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...enums.Role) predicate.OrgMembership { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrgMembership(sql.FieldNotIn(FieldRole, v...)) +} + +// OrganizationIDEQ applies the EQ predicate on the "organization_id" field. +func OrganizationIDEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldOrganizationID, v)) +} + +// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field. +func OrganizationIDNEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldOrganizationID, v)) +} + +// OrganizationIDIn applies the In predicate on the "organization_id" field. +func OrganizationIDIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field. +func OrganizationIDNotIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDGT applies the GT predicate on the "organization_id" field. +func OrganizationIDGT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldOrganizationID, v)) +} + +// OrganizationIDGTE applies the GTE predicate on the "organization_id" field. +func OrganizationIDGTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldOrganizationID, v)) +} + +// OrganizationIDLT applies the LT predicate on the "organization_id" field. +func OrganizationIDLT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldOrganizationID, v)) +} + +// OrganizationIDLTE applies the LTE predicate on the "organization_id" field. +func OrganizationIDLTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldOrganizationID, v)) +} + +// OrganizationIDContains applies the Contains predicate on the "organization_id" field. +func OrganizationIDContains(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContains(FieldOrganizationID, v)) +} + +// OrganizationIDHasPrefix applies the HasPrefix predicate on the "organization_id" field. +func OrganizationIDHasPrefix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasPrefix(FieldOrganizationID, v)) +} + +// OrganizationIDHasSuffix applies the HasSuffix predicate on the "organization_id" field. +func OrganizationIDHasSuffix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasSuffix(FieldOrganizationID, v)) +} + +// OrganizationIDEqualFold applies the EqualFold predicate on the "organization_id" field. +func OrganizationIDEqualFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEqualFold(FieldOrganizationID, v)) +} + +// OrganizationIDContainsFold applies the ContainsFold predicate on the "organization_id" field. +func OrganizationIDContainsFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContainsFold(FieldOrganizationID, v)) +} + +// UserIDEQ applies the EQ predicate on the "user_id" field. +func UserIDEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEQ(FieldUserID, v)) +} + +// UserIDNEQ applies the NEQ predicate on the "user_id" field. +func UserIDNEQ(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNEQ(FieldUserID, v)) +} + +// UserIDIn applies the In predicate on the "user_id" field. +func UserIDIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldIn(FieldUserID, vs...)) +} + +// UserIDNotIn applies the NotIn predicate on the "user_id" field. +func UserIDNotIn(vs ...string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldNotIn(FieldUserID, vs...)) +} + +// UserIDGT applies the GT predicate on the "user_id" field. +func UserIDGT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGT(FieldUserID, v)) +} + +// UserIDGTE applies the GTE predicate on the "user_id" field. +func UserIDGTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldGTE(FieldUserID, v)) +} + +// UserIDLT applies the LT predicate on the "user_id" field. +func UserIDLT(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLT(FieldUserID, v)) +} + +// UserIDLTE applies the LTE predicate on the "user_id" field. +func UserIDLTE(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldLTE(FieldUserID, v)) +} + +// UserIDContains applies the Contains predicate on the "user_id" field. +func UserIDContains(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContains(FieldUserID, v)) +} + +// UserIDHasPrefix applies the HasPrefix predicate on the "user_id" field. +func UserIDHasPrefix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasPrefix(FieldUserID, v)) +} + +// UserIDHasSuffix applies the HasSuffix predicate on the "user_id" field. +func UserIDHasSuffix(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldHasSuffix(FieldUserID, v)) +} + +// UserIDEqualFold applies the EqualFold predicate on the "user_id" field. +func UserIDEqualFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldEqualFold(FieldUserID, v)) +} + +// UserIDContainsFold applies the ContainsFold predicate on the "user_id" field. +func UserIDContainsFold(v string) predicate.OrgMembership { + return predicate.OrgMembership(sql.FieldContainsFold(FieldUserID, v)) +} + +// HasOrganization applies the HasEdge predicate on the "organization" edge. +func HasOrganization() predicate.OrgMembership { + return predicate.OrgMembership(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, OrganizationTable, OrganizationColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationWith applies the HasEdge predicate on the "organization" edge with a given conditions (other predicates). +func HasOrganizationWith(preds ...predicate.Organization) predicate.OrgMembership { + return predicate.OrgMembership(func(s *sql.Selector) { + step := newOrganizationStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasUser applies the HasEdge predicate on the "user" edge. +func HasUser() predicate.OrgMembership { + return predicate.OrgMembership(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, UserTable, UserColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates). +func HasUserWith(preds ...predicate.User) predicate.OrgMembership { + return predicate.OrgMembership(func(s *sql.Selector) { + step := newUserStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.OrgMembership { + return predicate.OrgMembership(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrgMembershipEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.OrgMembership { + return predicate.OrgMembership(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrgMembershipEvents + 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.OrgMembership) predicate.OrgMembership { + return predicate.OrgMembership(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OrgMembership) predicate.OrgMembership { + return predicate.OrgMembership(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OrgMembership) predicate.OrgMembership { + return predicate.OrgMembership(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/orgmembership_create.go b/internal/ent/generated/orgmembership_create.go new file mode 100644 index 0000000..6e76f68 --- /dev/null +++ b/internal/ent/generated/orgmembership_create.go @@ -0,0 +1,493 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/pkg/enums" +) + +// OrgMembershipCreate is the builder for creating a OrgMembership entity. +type OrgMembershipCreate struct { + config + mutation *OrgMembershipMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (omc *OrgMembershipCreate) SetCreatedAt(t time.Time) *OrgMembershipCreate { + omc.mutation.SetCreatedAt(t) + return omc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableCreatedAt(t *time.Time) *OrgMembershipCreate { + if t != nil { + omc.SetCreatedAt(*t) + } + return omc +} + +// SetUpdatedAt sets the "updated_at" field. +func (omc *OrgMembershipCreate) SetUpdatedAt(t time.Time) *OrgMembershipCreate { + omc.mutation.SetUpdatedAt(t) + return omc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableUpdatedAt(t *time.Time) *OrgMembershipCreate { + if t != nil { + omc.SetUpdatedAt(*t) + } + return omc +} + +// SetCreatedBy sets the "created_by" field. +func (omc *OrgMembershipCreate) SetCreatedBy(s string) *OrgMembershipCreate { + omc.mutation.SetCreatedBy(s) + return omc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableCreatedBy(s *string) *OrgMembershipCreate { + if s != nil { + omc.SetCreatedBy(*s) + } + return omc +} + +// SetUpdatedBy sets the "updated_by" field. +func (omc *OrgMembershipCreate) SetUpdatedBy(s string) *OrgMembershipCreate { + omc.mutation.SetUpdatedBy(s) + return omc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableUpdatedBy(s *string) *OrgMembershipCreate { + if s != nil { + omc.SetUpdatedBy(*s) + } + return omc +} + +// SetMappingID sets the "mapping_id" field. +func (omc *OrgMembershipCreate) SetMappingID(s string) *OrgMembershipCreate { + omc.mutation.SetMappingID(s) + return omc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableMappingID(s *string) *OrgMembershipCreate { + if s != nil { + omc.SetMappingID(*s) + } + return omc +} + +// SetDeletedAt sets the "deleted_at" field. +func (omc *OrgMembershipCreate) SetDeletedAt(t time.Time) *OrgMembershipCreate { + omc.mutation.SetDeletedAt(t) + return omc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableDeletedAt(t *time.Time) *OrgMembershipCreate { + if t != nil { + omc.SetDeletedAt(*t) + } + return omc +} + +// SetDeletedBy sets the "deleted_by" field. +func (omc *OrgMembershipCreate) SetDeletedBy(s string) *OrgMembershipCreate { + omc.mutation.SetDeletedBy(s) + return omc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableDeletedBy(s *string) *OrgMembershipCreate { + if s != nil { + omc.SetDeletedBy(*s) + } + return omc +} + +// SetRole sets the "role" field. +func (omc *OrgMembershipCreate) SetRole(e enums.Role) *OrgMembershipCreate { + omc.mutation.SetRole(e) + return omc +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableRole(e *enums.Role) *OrgMembershipCreate { + if e != nil { + omc.SetRole(*e) + } + return omc +} + +// SetOrganizationID sets the "organization_id" field. +func (omc *OrgMembershipCreate) SetOrganizationID(s string) *OrgMembershipCreate { + omc.mutation.SetOrganizationID(s) + return omc +} + +// SetUserID sets the "user_id" field. +func (omc *OrgMembershipCreate) SetUserID(s string) *OrgMembershipCreate { + omc.mutation.SetUserID(s) + return omc +} + +// SetID sets the "id" field. +func (omc *OrgMembershipCreate) SetID(s string) *OrgMembershipCreate { + omc.mutation.SetID(s) + return omc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (omc *OrgMembershipCreate) SetNillableID(s *string) *OrgMembershipCreate { + if s != nil { + omc.SetID(*s) + } + return omc +} + +// SetOrganization sets the "organization" edge to the Organization entity. +func (omc *OrgMembershipCreate) SetOrganization(o *Organization) *OrgMembershipCreate { + return omc.SetOrganizationID(o.ID) +} + +// SetUser sets the "user" edge to the User entity. +func (omc *OrgMembershipCreate) SetUser(u *User) *OrgMembershipCreate { + return omc.SetUserID(u.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (omc *OrgMembershipCreate) AddEventIDs(ids ...string) *OrgMembershipCreate { + omc.mutation.AddEventIDs(ids...) + return omc +} + +// AddEvents adds the "events" edges to the Event entity. +func (omc *OrgMembershipCreate) AddEvents(e ...*Event) *OrgMembershipCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return omc.AddEventIDs(ids...) +} + +// Mutation returns the OrgMembershipMutation object of the builder. +func (omc *OrgMembershipCreate) Mutation() *OrgMembershipMutation { + return omc.mutation +} + +// Save creates the OrgMembership in the database. +func (omc *OrgMembershipCreate) Save(ctx context.Context) (*OrgMembership, error) { + if err := omc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, omc.sqlSave, omc.mutation, omc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (omc *OrgMembershipCreate) SaveX(ctx context.Context) *OrgMembership { + v, err := omc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (omc *OrgMembershipCreate) Exec(ctx context.Context) error { + _, err := omc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omc *OrgMembershipCreate) ExecX(ctx context.Context) { + if err := omc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (omc *OrgMembershipCreate) defaults() error { + if _, ok := omc.mutation.CreatedAt(); !ok { + if orgmembership.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembership.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := orgmembership.DefaultCreatedAt() + omc.mutation.SetCreatedAt(v) + } + if _, ok := omc.mutation.UpdatedAt(); !ok { + if orgmembership.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembership.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := orgmembership.DefaultUpdatedAt() + omc.mutation.SetUpdatedAt(v) + } + if _, ok := omc.mutation.MappingID(); !ok { + if orgmembership.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized orgmembership.DefaultMappingID (forgotten import generated/runtime?)") + } + v := orgmembership.DefaultMappingID() + omc.mutation.SetMappingID(v) + } + if _, ok := omc.mutation.Role(); !ok { + v := orgmembership.DefaultRole + omc.mutation.SetRole(v) + } + if _, ok := omc.mutation.ID(); !ok { + if orgmembership.DefaultID == nil { + return fmt.Errorf("generated: uninitialized orgmembership.DefaultID (forgotten import generated/runtime?)") + } + v := orgmembership.DefaultID() + omc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (omc *OrgMembershipCreate) check() error { + if _, ok := omc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OrgMembership.mapping_id"`)} + } + if _, ok := omc.mutation.Role(); !ok { + return &ValidationError{Name: "role", err: errors.New(`generated: missing required field "OrgMembership.role"`)} + } + if v, ok := omc.mutation.Role(); ok { + if err := orgmembership.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "OrgMembership.role": %w`, err)} + } + } + if _, ok := omc.mutation.OrganizationID(); !ok { + return &ValidationError{Name: "organization_id", err: errors.New(`generated: missing required field "OrgMembership.organization_id"`)} + } + if _, ok := omc.mutation.UserID(); !ok { + return &ValidationError{Name: "user_id", err: errors.New(`generated: missing required field "OrgMembership.user_id"`)} + } + if len(omc.mutation.OrganizationIDs()) == 0 { + return &ValidationError{Name: "organization", err: errors.New(`generated: missing required edge "OrgMembership.organization"`)} + } + if len(omc.mutation.UserIDs()) == 0 { + return &ValidationError{Name: "user", err: errors.New(`generated: missing required edge "OrgMembership.user"`)} + } + return nil +} + +func (omc *OrgMembershipCreate) sqlSave(ctx context.Context) (*OrgMembership, error) { + if err := omc.check(); err != nil { + return nil, err + } + _node, _spec := omc.createSpec() + if err := sqlgraph.CreateNode(ctx, omc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OrgMembership.ID type: %T", _spec.ID.Value) + } + } + omc.mutation.id = &_node.ID + omc.mutation.done = true + return _node, nil +} + +func (omc *OrgMembershipCreate) createSpec() (*OrgMembership, *sqlgraph.CreateSpec) { + var ( + _node = &OrgMembership{config: omc.config} + _spec = sqlgraph.NewCreateSpec(orgmembership.Table, sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString)) + ) + _spec.Schema = omc.schemaConfig.OrgMembership + if id, ok := omc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := omc.mutation.CreatedAt(); ok { + _spec.SetField(orgmembership.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := omc.mutation.UpdatedAt(); ok { + _spec.SetField(orgmembership.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := omc.mutation.CreatedBy(); ok { + _spec.SetField(orgmembership.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := omc.mutation.UpdatedBy(); ok { + _spec.SetField(orgmembership.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := omc.mutation.MappingID(); ok { + _spec.SetField(orgmembership.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := omc.mutation.DeletedAt(); ok { + _spec.SetField(orgmembership.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := omc.mutation.DeletedBy(); ok { + _spec.SetField(orgmembership.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := omc.mutation.Role(); ok { + _spec.SetField(orgmembership.FieldRole, field.TypeEnum, value) + _node.Role = value + } + if nodes := omc.mutation.OrganizationIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: orgmembership.OrganizationTable, + Columns: []string{orgmembership.OrganizationColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = omc.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OrganizationID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := omc.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: orgmembership.UserTable, + Columns: []string{orgmembership.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = omc.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.UserID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := omc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = omc.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// OrgMembershipCreateBulk is the builder for creating many OrgMembership entities in bulk. +type OrgMembershipCreateBulk struct { + config + err error + builders []*OrgMembershipCreate +} + +// Save creates the OrgMembership entities in the database. +func (omcb *OrgMembershipCreateBulk) Save(ctx context.Context) ([]*OrgMembership, error) { + if omcb.err != nil { + return nil, omcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(omcb.builders)) + nodes := make([]*OrgMembership, len(omcb.builders)) + mutators := make([]Mutator, len(omcb.builders)) + for i := range omcb.builders { + func(i int, root context.Context) { + builder := omcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OrgMembershipMutation) + 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, omcb.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, omcb.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, omcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (omcb *OrgMembershipCreateBulk) SaveX(ctx context.Context) []*OrgMembership { + v, err := omcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (omcb *OrgMembershipCreateBulk) Exec(ctx context.Context) error { + _, err := omcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omcb *OrgMembershipCreateBulk) ExecX(ctx context.Context) { + if err := omcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/orgmembership_delete.go b/internal/ent/generated/orgmembership_delete.go new file mode 100644 index 0000000..d4fd304 --- /dev/null +++ b/internal/ent/generated/orgmembership_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" +) + +// OrgMembershipDelete is the builder for deleting a OrgMembership entity. +type OrgMembershipDelete struct { + config + hooks []Hook + mutation *OrgMembershipMutation +} + +// Where appends a list predicates to the OrgMembershipDelete builder. +func (omd *OrgMembershipDelete) Where(ps ...predicate.OrgMembership) *OrgMembershipDelete { + omd.mutation.Where(ps...) + return omd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (omd *OrgMembershipDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, omd.sqlExec, omd.mutation, omd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (omd *OrgMembershipDelete) ExecX(ctx context.Context) int { + n, err := omd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (omd *OrgMembershipDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(orgmembership.Table, sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString)) + _spec.Node.Schema = omd.schemaConfig.OrgMembership + ctx = internal.NewSchemaConfigContext(ctx, omd.schemaConfig) + if ps := omd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, omd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + omd.mutation.done = true + return affected, err +} + +// OrgMembershipDeleteOne is the builder for deleting a single OrgMembership entity. +type OrgMembershipDeleteOne struct { + omd *OrgMembershipDelete +} + +// Where appends a list predicates to the OrgMembershipDelete builder. +func (omdo *OrgMembershipDeleteOne) Where(ps ...predicate.OrgMembership) *OrgMembershipDeleteOne { + omdo.omd.mutation.Where(ps...) + return omdo +} + +// Exec executes the deletion query. +func (omdo *OrgMembershipDeleteOne) Exec(ctx context.Context) error { + n, err := omdo.omd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{orgmembership.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (omdo *OrgMembershipDeleteOne) ExecX(ctx context.Context) { + if err := omdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/orgmembership_query.go b/internal/ent/generated/orgmembership_query.go new file mode 100644 index 0000000..7b68cfa --- /dev/null +++ b/internal/ent/generated/orgmembership_query.go @@ -0,0 +1,848 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrgMembershipQuery is the builder for querying OrgMembership entities. +type OrgMembershipQuery struct { + config + ctx *QueryContext + order []orgmembership.OrderOption + inters []Interceptor + predicates []predicate.OrgMembership + withOrganization *OrganizationQuery + withUser *UserQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OrgMembership) error + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OrgMembershipQuery builder. +func (omq *OrgMembershipQuery) Where(ps ...predicate.OrgMembership) *OrgMembershipQuery { + omq.predicates = append(omq.predicates, ps...) + return omq +} + +// Limit the number of records to be returned by this query. +func (omq *OrgMembershipQuery) Limit(limit int) *OrgMembershipQuery { + omq.ctx.Limit = &limit + return omq +} + +// Offset to start from. +func (omq *OrgMembershipQuery) Offset(offset int) *OrgMembershipQuery { + omq.ctx.Offset = &offset + return omq +} + +// 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 (omq *OrgMembershipQuery) Unique(unique bool) *OrgMembershipQuery { + omq.ctx.Unique = &unique + return omq +} + +// Order specifies how the records should be ordered. +func (omq *OrgMembershipQuery) Order(o ...orgmembership.OrderOption) *OrgMembershipQuery { + omq.order = append(omq.order, o...) + return omq +} + +// QueryOrganization chains the current query on the "organization" edge. +func (omq *OrgMembershipQuery) QueryOrganization() *OrganizationQuery { + query := (&OrganizationClient{config: omq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := omq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := omq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(orgmembership.Table, orgmembership.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, orgmembership.OrganizationTable, orgmembership.OrganizationColumn), + ) + schemaConfig := omq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + fromU = sqlgraph.SetNeighbors(omq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryUser chains the current query on the "user" edge. +func (omq *OrgMembershipQuery) QueryUser() *UserQuery { + query := (&UserClient{config: omq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := omq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := omq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(orgmembership.Table, orgmembership.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, orgmembership.UserTable, orgmembership.UserColumn), + ) + schemaConfig := omq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.OrgMembership + fromU = sqlgraph.SetNeighbors(omq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (omq *OrgMembershipQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: omq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := omq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := omq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(orgmembership.Table, orgmembership.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, orgmembership.EventsTable, orgmembership.EventsPrimaryKey...), + ) + schemaConfig := omq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.OrgMembershipEvents + fromU = sqlgraph.SetNeighbors(omq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first OrgMembership entity from the query. +// Returns a *NotFoundError when no OrgMembership was found. +func (omq *OrgMembershipQuery) First(ctx context.Context) (*OrgMembership, error) { + nodes, err := omq.Limit(1).All(setContextOp(ctx, omq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{orgmembership.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (omq *OrgMembershipQuery) FirstX(ctx context.Context) *OrgMembership { + node, err := omq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OrgMembership ID from the query. +// Returns a *NotFoundError when no OrgMembership ID was found. +func (omq *OrgMembershipQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = omq.Limit(1).IDs(setContextOp(ctx, omq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{orgmembership.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (omq *OrgMembershipQuery) FirstIDX(ctx context.Context) string { + id, err := omq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OrgMembership entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OrgMembership entity is found. +// Returns a *NotFoundError when no OrgMembership entities are found. +func (omq *OrgMembershipQuery) Only(ctx context.Context) (*OrgMembership, error) { + nodes, err := omq.Limit(2).All(setContextOp(ctx, omq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{orgmembership.Label} + default: + return nil, &NotSingularError{orgmembership.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (omq *OrgMembershipQuery) OnlyX(ctx context.Context) *OrgMembership { + node, err := omq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OrgMembership ID in the query. +// Returns a *NotSingularError when more than one OrgMembership ID is found. +// Returns a *NotFoundError when no entities are found. +func (omq *OrgMembershipQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = omq.Limit(2).IDs(setContextOp(ctx, omq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{orgmembership.Label} + default: + err = &NotSingularError{orgmembership.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (omq *OrgMembershipQuery) OnlyIDX(ctx context.Context) string { + id, err := omq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OrgMemberships. +func (omq *OrgMembershipQuery) All(ctx context.Context) ([]*OrgMembership, error) { + ctx = setContextOp(ctx, omq.ctx, ent.OpQueryAll) + if err := omq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OrgMembership, *OrgMembershipQuery]() + return withInterceptors[[]*OrgMembership](ctx, omq, qr, omq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (omq *OrgMembershipQuery) AllX(ctx context.Context) []*OrgMembership { + nodes, err := omq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OrgMembership IDs. +func (omq *OrgMembershipQuery) IDs(ctx context.Context) (ids []string, err error) { + if omq.ctx.Unique == nil && omq.path != nil { + omq.Unique(true) + } + ctx = setContextOp(ctx, omq.ctx, ent.OpQueryIDs) + if err = omq.Select(orgmembership.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (omq *OrgMembershipQuery) IDsX(ctx context.Context) []string { + ids, err := omq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (omq *OrgMembershipQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, omq.ctx, ent.OpQueryCount) + if err := omq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, omq, querierCount[*OrgMembershipQuery](), omq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (omq *OrgMembershipQuery) CountX(ctx context.Context) int { + count, err := omq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (omq *OrgMembershipQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, omq.ctx, ent.OpQueryExist) + switch _, err := omq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (omq *OrgMembershipQuery) ExistX(ctx context.Context) bool { + exist, err := omq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OrgMembershipQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (omq *OrgMembershipQuery) Clone() *OrgMembershipQuery { + if omq == nil { + return nil + } + return &OrgMembershipQuery{ + config: omq.config, + ctx: omq.ctx.Clone(), + order: append([]orgmembership.OrderOption{}, omq.order...), + inters: append([]Interceptor{}, omq.inters...), + predicates: append([]predicate.OrgMembership{}, omq.predicates...), + withOrganization: omq.withOrganization.Clone(), + withUser: omq.withUser.Clone(), + withEvents: omq.withEvents.Clone(), + // clone intermediate query. + sql: omq.sql.Clone(), + path: omq.path, + } +} + +// WithOrganization tells the query-builder to eager-load the nodes that are connected to +// the "organization" edge. The optional arguments are used to configure the query builder of the edge. +func (omq *OrgMembershipQuery) WithOrganization(opts ...func(*OrganizationQuery)) *OrgMembershipQuery { + query := (&OrganizationClient{config: omq.config}).Query() + for _, opt := range opts { + opt(query) + } + omq.withOrganization = query + return omq +} + +// WithUser tells the query-builder to eager-load the nodes that are connected to +// the "user" edge. The optional arguments are used to configure the query builder of the edge. +func (omq *OrgMembershipQuery) WithUser(opts ...func(*UserQuery)) *OrgMembershipQuery { + query := (&UserClient{config: omq.config}).Query() + for _, opt := range opts { + opt(query) + } + omq.withUser = query + return omq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (omq *OrgMembershipQuery) WithEvents(opts ...func(*EventQuery)) *OrgMembershipQuery { + query := (&EventClient{config: omq.config}).Query() + for _, opt := range opts { + opt(query) + } + omq.withEvents = query + return omq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OrgMembership.Query(). +// GroupBy(orgmembership.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (omq *OrgMembershipQuery) GroupBy(field string, fields ...string) *OrgMembershipGroupBy { + omq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OrgMembershipGroupBy{build: omq} + grbuild.flds = &omq.ctx.Fields + grbuild.label = orgmembership.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.OrgMembership.Query(). +// Select(orgmembership.FieldCreatedAt). +// Scan(ctx, &v) +func (omq *OrgMembershipQuery) Select(fields ...string) *OrgMembershipSelect { + omq.ctx.Fields = append(omq.ctx.Fields, fields...) + sbuild := &OrgMembershipSelect{OrgMembershipQuery: omq} + sbuild.label = orgmembership.Label + sbuild.flds, sbuild.scan = &omq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OrgMembershipSelect configured with the given aggregations. +func (omq *OrgMembershipQuery) Aggregate(fns ...AggregateFunc) *OrgMembershipSelect { + return omq.Select().Aggregate(fns...) +} + +func (omq *OrgMembershipQuery) prepareQuery(ctx context.Context) error { + for _, inter := range omq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, omq); err != nil { + return err + } + } + } + for _, f := range omq.ctx.Fields { + if !orgmembership.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if omq.path != nil { + prev, err := omq.path(ctx) + if err != nil { + return err + } + omq.sql = prev + } + if orgmembership.Policy == nil { + return errors.New("generated: uninitialized orgmembership.Policy (forgotten import generated/runtime?)") + } + if err := orgmembership.Policy.EvalQuery(ctx, omq); err != nil { + return err + } + return nil +} + +func (omq *OrgMembershipQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OrgMembership, error) { + var ( + nodes = []*OrgMembership{} + _spec = omq.querySpec() + loadedTypes = [3]bool{ + omq.withOrganization != nil, + omq.withUser != nil, + omq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OrgMembership).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OrgMembership{config: omq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = omq.schemaConfig.OrgMembership + ctx = internal.NewSchemaConfigContext(ctx, omq.schemaConfig) + if len(omq.modifiers) > 0 { + _spec.Modifiers = omq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, omq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := omq.withOrganization; query != nil { + if err := omq.loadOrganization(ctx, query, nodes, nil, + func(n *OrgMembership, e *Organization) { n.Edges.Organization = e }); err != nil { + return nil, err + } + } + if query := omq.withUser; query != nil { + if err := omq.loadUser(ctx, query, nodes, nil, + func(n *OrgMembership, e *User) { n.Edges.User = e }); err != nil { + return nil, err + } + } + if query := omq.withEvents; query != nil { + if err := omq.loadEvents(ctx, query, nodes, + func(n *OrgMembership) { n.Edges.Events = []*Event{} }, + func(n *OrgMembership, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range omq.withNamedEvents { + if err := omq.loadEvents(ctx, query, nodes, + func(n *OrgMembership) { n.appendNamedEvents(name) }, + func(n *OrgMembership, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range omq.loadTotal { + if err := omq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (omq *OrgMembershipQuery) loadOrganization(ctx context.Context, query *OrganizationQuery, nodes []*OrgMembership, init func(*OrgMembership), assign func(*OrgMembership, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*OrgMembership) + for i := range nodes { + fk := nodes[i].OrganizationID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "organization_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (omq *OrgMembershipQuery) loadUser(ctx context.Context, query *UserQuery, nodes []*OrgMembership, init func(*OrgMembership), assign func(*OrgMembership, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*OrgMembership) + for i := range nodes { + fk := nodes[i].UserID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "user_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (omq *OrgMembershipQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*OrgMembership, init func(*OrgMembership), assign func(*OrgMembership, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*OrgMembership) + nids := make(map[string]map[*OrgMembership]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(orgmembership.EventsTable) + joinT.Schema(omq.schemaConfig.OrgMembershipEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(orgmembership.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(orgmembership.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(orgmembership.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*OrgMembership]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (omq *OrgMembershipQuery) sqlCount(ctx context.Context) (int, error) { + _spec := omq.querySpec() + _spec.Node.Schema = omq.schemaConfig.OrgMembership + ctx = internal.NewSchemaConfigContext(ctx, omq.schemaConfig) + if len(omq.modifiers) > 0 { + _spec.Modifiers = omq.modifiers + } + _spec.Node.Columns = omq.ctx.Fields + if len(omq.ctx.Fields) > 0 { + _spec.Unique = omq.ctx.Unique != nil && *omq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, omq.driver, _spec) +} + +func (omq *OrgMembershipQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(orgmembership.Table, orgmembership.Columns, sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString)) + _spec.From = omq.sql + if unique := omq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if omq.path != nil { + _spec.Unique = true + } + if fields := omq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, orgmembership.FieldID) + for i := range fields { + if fields[i] != orgmembership.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if omq.withOrganization != nil { + _spec.Node.AddColumnOnce(orgmembership.FieldOrganizationID) + } + if omq.withUser != nil { + _spec.Node.AddColumnOnce(orgmembership.FieldUserID) + } + } + if ps := omq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := omq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := omq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := omq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (omq *OrgMembershipQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(omq.driver.Dialect()) + t1 := builder.Table(orgmembership.Table) + columns := omq.ctx.Fields + if len(columns) == 0 { + columns = orgmembership.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if omq.sql != nil { + selector = omq.sql + selector.Select(selector.Columns(columns...)...) + } + if omq.ctx.Unique != nil && *omq.ctx.Unique { + selector.Distinct() + } + t1.Schema(omq.schemaConfig.OrgMembership) + ctx = internal.NewSchemaConfigContext(ctx, omq.schemaConfig) + selector.WithContext(ctx) + for _, p := range omq.predicates { + p(selector) + } + for _, p := range omq.order { + p(selector) + } + if offset := omq.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 := omq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (omq *OrgMembershipQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *OrgMembershipQuery { + query := (&EventClient{config: omq.config}).Query() + for _, opt := range opts { + opt(query) + } + if omq.withNamedEvents == nil { + omq.withNamedEvents = make(map[string]*EventQuery) + } + omq.withNamedEvents[name] = query + return omq +} + +// OrgMembershipGroupBy is the group-by builder for OrgMembership entities. +type OrgMembershipGroupBy struct { + selector + build *OrgMembershipQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (omgb *OrgMembershipGroupBy) Aggregate(fns ...AggregateFunc) *OrgMembershipGroupBy { + omgb.fns = append(omgb.fns, fns...) + return omgb +} + +// Scan applies the selector query and scans the result into the given value. +func (omgb *OrgMembershipGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, omgb.build.ctx, ent.OpQueryGroupBy) + if err := omgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrgMembershipQuery, *OrgMembershipGroupBy](ctx, omgb.build, omgb, omgb.build.inters, v) +} + +func (omgb *OrgMembershipGroupBy) sqlScan(ctx context.Context, root *OrgMembershipQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(omgb.fns)) + for _, fn := range omgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*omgb.flds)+len(omgb.fns)) + for _, f := range *omgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*omgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := omgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OrgMembershipSelect is the builder for selecting fields of OrgMembership entities. +type OrgMembershipSelect struct { + *OrgMembershipQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (oms *OrgMembershipSelect) Aggregate(fns ...AggregateFunc) *OrgMembershipSelect { + oms.fns = append(oms.fns, fns...) + return oms +} + +// Scan applies the selector query and scans the result into the given value. +func (oms *OrgMembershipSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, oms.ctx, ent.OpQuerySelect) + if err := oms.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrgMembershipQuery, *OrgMembershipSelect](ctx, oms.OrgMembershipQuery, oms, oms.inters, v) +} + +func (oms *OrgMembershipSelect) sqlScan(ctx context.Context, root *OrgMembershipQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(oms.fns)) + for _, fn := range oms.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*oms.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 := oms.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/orgmembership_update.go b/internal/ent/generated/orgmembership_update.go new file mode 100644 index 0000000..07b91c2 --- /dev/null +++ b/internal/ent/generated/orgmembership_update.go @@ -0,0 +1,658 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrgMembershipUpdate is the builder for updating OrgMembership entities. +type OrgMembershipUpdate struct { + config + hooks []Hook + mutation *OrgMembershipMutation +} + +// Where appends a list predicates to the OrgMembershipUpdate builder. +func (omu *OrgMembershipUpdate) Where(ps ...predicate.OrgMembership) *OrgMembershipUpdate { + omu.mutation.Where(ps...) + return omu +} + +// SetUpdatedAt sets the "updated_at" field. +func (omu *OrgMembershipUpdate) SetUpdatedAt(t time.Time) *OrgMembershipUpdate { + omu.mutation.SetUpdatedAt(t) + return omu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (omu *OrgMembershipUpdate) ClearUpdatedAt() *OrgMembershipUpdate { + omu.mutation.ClearUpdatedAt() + return omu +} + +// SetUpdatedBy sets the "updated_by" field. +func (omu *OrgMembershipUpdate) SetUpdatedBy(s string) *OrgMembershipUpdate { + omu.mutation.SetUpdatedBy(s) + return omu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (omu *OrgMembershipUpdate) SetNillableUpdatedBy(s *string) *OrgMembershipUpdate { + if s != nil { + omu.SetUpdatedBy(*s) + } + return omu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (omu *OrgMembershipUpdate) ClearUpdatedBy() *OrgMembershipUpdate { + omu.mutation.ClearUpdatedBy() + return omu +} + +// SetDeletedAt sets the "deleted_at" field. +func (omu *OrgMembershipUpdate) SetDeletedAt(t time.Time) *OrgMembershipUpdate { + omu.mutation.SetDeletedAt(t) + return omu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (omu *OrgMembershipUpdate) SetNillableDeletedAt(t *time.Time) *OrgMembershipUpdate { + if t != nil { + omu.SetDeletedAt(*t) + } + return omu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (omu *OrgMembershipUpdate) ClearDeletedAt() *OrgMembershipUpdate { + omu.mutation.ClearDeletedAt() + return omu +} + +// SetDeletedBy sets the "deleted_by" field. +func (omu *OrgMembershipUpdate) SetDeletedBy(s string) *OrgMembershipUpdate { + omu.mutation.SetDeletedBy(s) + return omu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (omu *OrgMembershipUpdate) SetNillableDeletedBy(s *string) *OrgMembershipUpdate { + if s != nil { + omu.SetDeletedBy(*s) + } + return omu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (omu *OrgMembershipUpdate) ClearDeletedBy() *OrgMembershipUpdate { + omu.mutation.ClearDeletedBy() + return omu +} + +// SetRole sets the "role" field. +func (omu *OrgMembershipUpdate) SetRole(e enums.Role) *OrgMembershipUpdate { + omu.mutation.SetRole(e) + return omu +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (omu *OrgMembershipUpdate) SetNillableRole(e *enums.Role) *OrgMembershipUpdate { + if e != nil { + omu.SetRole(*e) + } + return omu +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (omu *OrgMembershipUpdate) AddEventIDs(ids ...string) *OrgMembershipUpdate { + omu.mutation.AddEventIDs(ids...) + return omu +} + +// AddEvents adds the "events" edges to the Event entity. +func (omu *OrgMembershipUpdate) AddEvents(e ...*Event) *OrgMembershipUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return omu.AddEventIDs(ids...) +} + +// Mutation returns the OrgMembershipMutation object of the builder. +func (omu *OrgMembershipUpdate) Mutation() *OrgMembershipMutation { + return omu.mutation +} + +// ClearEvents clears all "events" edges to the Event entity. +func (omu *OrgMembershipUpdate) ClearEvents() *OrgMembershipUpdate { + omu.mutation.ClearEvents() + return omu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (omu *OrgMembershipUpdate) RemoveEventIDs(ids ...string) *OrgMembershipUpdate { + omu.mutation.RemoveEventIDs(ids...) + return omu +} + +// RemoveEvents removes "events" edges to Event entities. +func (omu *OrgMembershipUpdate) RemoveEvents(e ...*Event) *OrgMembershipUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return omu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (omu *OrgMembershipUpdate) Save(ctx context.Context) (int, error) { + if err := omu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, omu.sqlSave, omu.mutation, omu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (omu *OrgMembershipUpdate) SaveX(ctx context.Context) int { + affected, err := omu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (omu *OrgMembershipUpdate) Exec(ctx context.Context) error { + _, err := omu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omu *OrgMembershipUpdate) ExecX(ctx context.Context) { + if err := omu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (omu *OrgMembershipUpdate) defaults() error { + if _, ok := omu.mutation.UpdatedAt(); !ok && !omu.mutation.UpdatedAtCleared() { + if orgmembership.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembership.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := orgmembership.UpdateDefaultUpdatedAt() + omu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (omu *OrgMembershipUpdate) check() error { + if v, ok := omu.mutation.Role(); ok { + if err := orgmembership.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "OrgMembership.role": %w`, err)} + } + } + if omu.mutation.OrganizationCleared() && len(omu.mutation.OrganizationIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "OrgMembership.organization"`) + } + if omu.mutation.UserCleared() && len(omu.mutation.UserIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "OrgMembership.user"`) + } + return nil +} + +func (omu *OrgMembershipUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := omu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(orgmembership.Table, orgmembership.Columns, sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString)) + if ps := omu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if omu.mutation.CreatedAtCleared() { + _spec.ClearField(orgmembership.FieldCreatedAt, field.TypeTime) + } + if value, ok := omu.mutation.UpdatedAt(); ok { + _spec.SetField(orgmembership.FieldUpdatedAt, field.TypeTime, value) + } + if omu.mutation.UpdatedAtCleared() { + _spec.ClearField(orgmembership.FieldUpdatedAt, field.TypeTime) + } + if omu.mutation.CreatedByCleared() { + _spec.ClearField(orgmembership.FieldCreatedBy, field.TypeString) + } + if value, ok := omu.mutation.UpdatedBy(); ok { + _spec.SetField(orgmembership.FieldUpdatedBy, field.TypeString, value) + } + if omu.mutation.UpdatedByCleared() { + _spec.ClearField(orgmembership.FieldUpdatedBy, field.TypeString) + } + if value, ok := omu.mutation.DeletedAt(); ok { + _spec.SetField(orgmembership.FieldDeletedAt, field.TypeTime, value) + } + if omu.mutation.DeletedAtCleared() { + _spec.ClearField(orgmembership.FieldDeletedAt, field.TypeTime) + } + if value, ok := omu.mutation.DeletedBy(); ok { + _spec.SetField(orgmembership.FieldDeletedBy, field.TypeString, value) + } + if omu.mutation.DeletedByCleared() { + _spec.ClearField(orgmembership.FieldDeletedBy, field.TypeString) + } + if value, ok := omu.mutation.Role(); ok { + _spec.SetField(orgmembership.FieldRole, field.TypeEnum, value) + } + if omu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = omu.schemaConfig.OrgMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := omu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !omu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = omu.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := omu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = omu.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = omu.schemaConfig.OrgMembership + ctx = internal.NewSchemaConfigContext(ctx, omu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, omu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{orgmembership.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + omu.mutation.done = true + return n, nil +} + +// OrgMembershipUpdateOne is the builder for updating a single OrgMembership entity. +type OrgMembershipUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OrgMembershipMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (omuo *OrgMembershipUpdateOne) SetUpdatedAt(t time.Time) *OrgMembershipUpdateOne { + omuo.mutation.SetUpdatedAt(t) + return omuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (omuo *OrgMembershipUpdateOne) ClearUpdatedAt() *OrgMembershipUpdateOne { + omuo.mutation.ClearUpdatedAt() + return omuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (omuo *OrgMembershipUpdateOne) SetUpdatedBy(s string) *OrgMembershipUpdateOne { + omuo.mutation.SetUpdatedBy(s) + return omuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (omuo *OrgMembershipUpdateOne) SetNillableUpdatedBy(s *string) *OrgMembershipUpdateOne { + if s != nil { + omuo.SetUpdatedBy(*s) + } + return omuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (omuo *OrgMembershipUpdateOne) ClearUpdatedBy() *OrgMembershipUpdateOne { + omuo.mutation.ClearUpdatedBy() + return omuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (omuo *OrgMembershipUpdateOne) SetDeletedAt(t time.Time) *OrgMembershipUpdateOne { + omuo.mutation.SetDeletedAt(t) + return omuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (omuo *OrgMembershipUpdateOne) SetNillableDeletedAt(t *time.Time) *OrgMembershipUpdateOne { + if t != nil { + omuo.SetDeletedAt(*t) + } + return omuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (omuo *OrgMembershipUpdateOne) ClearDeletedAt() *OrgMembershipUpdateOne { + omuo.mutation.ClearDeletedAt() + return omuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (omuo *OrgMembershipUpdateOne) SetDeletedBy(s string) *OrgMembershipUpdateOne { + omuo.mutation.SetDeletedBy(s) + return omuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (omuo *OrgMembershipUpdateOne) SetNillableDeletedBy(s *string) *OrgMembershipUpdateOne { + if s != nil { + omuo.SetDeletedBy(*s) + } + return omuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (omuo *OrgMembershipUpdateOne) ClearDeletedBy() *OrgMembershipUpdateOne { + omuo.mutation.ClearDeletedBy() + return omuo +} + +// SetRole sets the "role" field. +func (omuo *OrgMembershipUpdateOne) SetRole(e enums.Role) *OrgMembershipUpdateOne { + omuo.mutation.SetRole(e) + return omuo +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (omuo *OrgMembershipUpdateOne) SetNillableRole(e *enums.Role) *OrgMembershipUpdateOne { + if e != nil { + omuo.SetRole(*e) + } + return omuo +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (omuo *OrgMembershipUpdateOne) AddEventIDs(ids ...string) *OrgMembershipUpdateOne { + omuo.mutation.AddEventIDs(ids...) + return omuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (omuo *OrgMembershipUpdateOne) AddEvents(e ...*Event) *OrgMembershipUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return omuo.AddEventIDs(ids...) +} + +// Mutation returns the OrgMembershipMutation object of the builder. +func (omuo *OrgMembershipUpdateOne) Mutation() *OrgMembershipMutation { + return omuo.mutation +} + +// ClearEvents clears all "events" edges to the Event entity. +func (omuo *OrgMembershipUpdateOne) ClearEvents() *OrgMembershipUpdateOne { + omuo.mutation.ClearEvents() + return omuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (omuo *OrgMembershipUpdateOne) RemoveEventIDs(ids ...string) *OrgMembershipUpdateOne { + omuo.mutation.RemoveEventIDs(ids...) + return omuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (omuo *OrgMembershipUpdateOne) RemoveEvents(e ...*Event) *OrgMembershipUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return omuo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the OrgMembershipUpdate builder. +func (omuo *OrgMembershipUpdateOne) Where(ps ...predicate.OrgMembership) *OrgMembershipUpdateOne { + omuo.mutation.Where(ps...) + return omuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (omuo *OrgMembershipUpdateOne) Select(field string, fields ...string) *OrgMembershipUpdateOne { + omuo.fields = append([]string{field}, fields...) + return omuo +} + +// Save executes the query and returns the updated OrgMembership entity. +func (omuo *OrgMembershipUpdateOne) Save(ctx context.Context) (*OrgMembership, error) { + if err := omuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, omuo.sqlSave, omuo.mutation, omuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (omuo *OrgMembershipUpdateOne) SaveX(ctx context.Context) *OrgMembership { + node, err := omuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (omuo *OrgMembershipUpdateOne) Exec(ctx context.Context) error { + _, err := omuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omuo *OrgMembershipUpdateOne) ExecX(ctx context.Context) { + if err := omuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (omuo *OrgMembershipUpdateOne) defaults() error { + if _, ok := omuo.mutation.UpdatedAt(); !ok && !omuo.mutation.UpdatedAtCleared() { + if orgmembership.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembership.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := orgmembership.UpdateDefaultUpdatedAt() + omuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (omuo *OrgMembershipUpdateOne) check() error { + if v, ok := omuo.mutation.Role(); ok { + if err := orgmembership.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "OrgMembership.role": %w`, err)} + } + } + if omuo.mutation.OrganizationCleared() && len(omuo.mutation.OrganizationIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "OrgMembership.organization"`) + } + if omuo.mutation.UserCleared() && len(omuo.mutation.UserIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "OrgMembership.user"`) + } + return nil +} + +func (omuo *OrgMembershipUpdateOne) sqlSave(ctx context.Context) (_node *OrgMembership, err error) { + if err := omuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(orgmembership.Table, orgmembership.Columns, sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString)) + id, ok := omuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OrgMembership.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := omuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, orgmembership.FieldID) + for _, f := range fields { + if !orgmembership.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != orgmembership.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := omuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if omuo.mutation.CreatedAtCleared() { + _spec.ClearField(orgmembership.FieldCreatedAt, field.TypeTime) + } + if value, ok := omuo.mutation.UpdatedAt(); ok { + _spec.SetField(orgmembership.FieldUpdatedAt, field.TypeTime, value) + } + if omuo.mutation.UpdatedAtCleared() { + _spec.ClearField(orgmembership.FieldUpdatedAt, field.TypeTime) + } + if omuo.mutation.CreatedByCleared() { + _spec.ClearField(orgmembership.FieldCreatedBy, field.TypeString) + } + if value, ok := omuo.mutation.UpdatedBy(); ok { + _spec.SetField(orgmembership.FieldUpdatedBy, field.TypeString, value) + } + if omuo.mutation.UpdatedByCleared() { + _spec.ClearField(orgmembership.FieldUpdatedBy, field.TypeString) + } + if value, ok := omuo.mutation.DeletedAt(); ok { + _spec.SetField(orgmembership.FieldDeletedAt, field.TypeTime, value) + } + if omuo.mutation.DeletedAtCleared() { + _spec.ClearField(orgmembership.FieldDeletedAt, field.TypeTime) + } + if value, ok := omuo.mutation.DeletedBy(); ok { + _spec.SetField(orgmembership.FieldDeletedBy, field.TypeString, value) + } + if omuo.mutation.DeletedByCleared() { + _spec.ClearField(orgmembership.FieldDeletedBy, field.TypeString) + } + if value, ok := omuo.mutation.Role(); ok { + _spec.SetField(orgmembership.FieldRole, field.TypeEnum, value) + } + if omuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = omuo.schemaConfig.OrgMembershipEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := omuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !omuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = omuo.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := omuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: orgmembership.EventsTable, + Columns: orgmembership.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = omuo.schemaConfig.OrgMembershipEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = omuo.schemaConfig.OrgMembership + ctx = internal.NewSchemaConfigContext(ctx, omuo.schemaConfig) + _node = &OrgMembership{config: omuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, omuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{orgmembership.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + omuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/orgmembershiphistory.go b/internal/ent/generated/orgmembershiphistory.go new file mode 100644 index 0000000..d121abf --- /dev/null +++ b/internal/ent/generated/orgmembershiphistory.go @@ -0,0 +1,240 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// OrgMembershipHistory is the model entity for the OrgMembershipHistory schema. +type OrgMembershipHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // Role holds the value of the "role" field. + Role enums.Role `json:"role,omitempty"` + // OrganizationID holds the value of the "organization_id" field. + OrganizationID string `json:"organization_id,omitempty"` + // UserID holds the value of the "user_id" field. + UserID string `json:"user_id,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*OrgMembershipHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case orgmembershiphistory.FieldOperation: + values[i] = new(history.OpType) + case orgmembershiphistory.FieldID, orgmembershiphistory.FieldRef, orgmembershiphistory.FieldCreatedBy, orgmembershiphistory.FieldUpdatedBy, orgmembershiphistory.FieldMappingID, orgmembershiphistory.FieldDeletedBy, orgmembershiphistory.FieldRole, orgmembershiphistory.FieldOrganizationID, orgmembershiphistory.FieldUserID: + values[i] = new(sql.NullString) + case orgmembershiphistory.FieldHistoryTime, orgmembershiphistory.FieldCreatedAt, orgmembershiphistory.FieldUpdatedAt, orgmembershiphistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the OrgMembershipHistory fields. +func (omh *OrgMembershipHistory) 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 orgmembershiphistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + omh.ID = value.String + } + case orgmembershiphistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + omh.HistoryTime = value.Time + } + case orgmembershiphistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + omh.Ref = value.String + } + case orgmembershiphistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + omh.Operation = *value + } + case orgmembershiphistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + omh.CreatedAt = value.Time + } + case orgmembershiphistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + omh.UpdatedAt = value.Time + } + case orgmembershiphistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + omh.CreatedBy = value.String + } + case orgmembershiphistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + omh.UpdatedBy = value.String + } + case orgmembershiphistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + omh.MappingID = value.String + } + case orgmembershiphistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + omh.DeletedAt = value.Time + } + case orgmembershiphistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + omh.DeletedBy = value.String + } + case orgmembershiphistory.FieldRole: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field role", values[i]) + } else if value.Valid { + omh.Role = enums.Role(value.String) + } + case orgmembershiphistory.FieldOrganizationID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field organization_id", values[i]) + } else if value.Valid { + omh.OrganizationID = value.String + } + case orgmembershiphistory.FieldUserID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_id", values[i]) + } else if value.Valid { + omh.UserID = value.String + } + default: + omh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the OrgMembershipHistory. +// This includes values selected through modifiers, order, etc. +func (omh *OrgMembershipHistory) Value(name string) (ent.Value, error) { + return omh.selectValues.Get(name) +} + +// Update returns a builder for updating this OrgMembershipHistory. +// Note that you need to call OrgMembershipHistory.Unwrap() before calling this method if this OrgMembershipHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (omh *OrgMembershipHistory) Update() *OrgMembershipHistoryUpdateOne { + return NewOrgMembershipHistoryClient(omh.config).UpdateOne(omh) +} + +// Unwrap unwraps the OrgMembershipHistory 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 (omh *OrgMembershipHistory) Unwrap() *OrgMembershipHistory { + _tx, ok := omh.config.driver.(*txDriver) + if !ok { + panic("generated: OrgMembershipHistory is not a transactional entity") + } + omh.config.driver = _tx.drv + return omh +} + +// String implements the fmt.Stringer. +func (omh *OrgMembershipHistory) String() string { + var builder strings.Builder + builder.WriteString("OrgMembershipHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", omh.ID)) + builder.WriteString("history_time=") + builder.WriteString(omh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(omh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", omh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(omh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(omh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(omh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(omh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(omh.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(omh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(omh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("role=") + builder.WriteString(fmt.Sprintf("%v", omh.Role)) + builder.WriteString(", ") + builder.WriteString("organization_id=") + builder.WriteString(omh.OrganizationID) + builder.WriteString(", ") + builder.WriteString("user_id=") + builder.WriteString(omh.UserID) + builder.WriteByte(')') + return builder.String() +} + +// OrgMembershipHistories is a parsable slice of OrgMembershipHistory. +type OrgMembershipHistories []*OrgMembershipHistory diff --git a/internal/ent/generated/orgmembershiphistory/orgmembershiphistory.go b/internal/ent/generated/orgmembershiphistory/orgmembershiphistory.go new file mode 100644 index 0000000..eb70437 --- /dev/null +++ b/internal/ent/generated/orgmembershiphistory/orgmembershiphistory.go @@ -0,0 +1,209 @@ +// Code generated by ent, DO NOT EDIT. + +package orgmembershiphistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the orgmembershiphistory type in the database. + Label = "org_membership_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldRole holds the string denoting the role field in the database. + FieldRole = "role" + // FieldOrganizationID holds the string denoting the organization_id field in the database. + FieldOrganizationID = "organization_id" + // FieldUserID holds the string denoting the user_id field in the database. + FieldUserID = "user_id" + // Table holds the table name of the orgmembershiphistory in the database. + Table = "org_membership_history" +) + +// Columns holds all SQL columns for orgmembershiphistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldRole, + FieldOrganizationID, + FieldUserID, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("orgmembershiphistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultRole enums.Role = "MEMBER" + +// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save. +func RoleValidator(r enums.Role) error { + switch r.String() { + case "ADMIN", "MEMBER", "USER", "OWNER": + return nil + default: + return fmt.Errorf("orgmembershiphistory: invalid enum value for role field: %q", r) + } +} + +// OrderOption defines the ordering options for the OrgMembershipHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByRole orders the results by the role field. +func ByRole(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRole, opts...).ToFunc() +} + +// ByOrganizationID orders the results by the organization_id field. +func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() +} + +// ByUserID orders the results by the user_id field. +func ByUserID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserID, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.Role must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Role)(nil) + // enums.Role must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Role)(nil) +) diff --git a/internal/ent/generated/orgmembershiphistory/where.go b/internal/ent/generated/orgmembershiphistory/where.go new file mode 100644 index 0000000..4edce4a --- /dev/null +++ b/internal/ent/generated/orgmembershiphistory/where.go @@ -0,0 +1,872 @@ +// Code generated by ent, DO NOT EDIT. + +package orgmembershiphistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ. +func OrganizationID(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldOrganizationID, v)) +} + +// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. +func UserID(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldUserID, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v enums.Role) predicate.OrgMembershipHistory { + vc := v + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v enums.Role) predicate.OrgMembershipHistory { + vc := v + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...enums.Role) predicate.OrgMembershipHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrgMembershipHistory(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...enums.Role) predicate.OrgMembershipHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldRole, v...)) +} + +// OrganizationIDEQ applies the EQ predicate on the "organization_id" field. +func OrganizationIDEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldOrganizationID, v)) +} + +// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field. +func OrganizationIDNEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldOrganizationID, v)) +} + +// OrganizationIDIn applies the In predicate on the "organization_id" field. +func OrganizationIDIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field. +func OrganizationIDNotIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldOrganizationID, vs...)) +} + +// OrganizationIDGT applies the GT predicate on the "organization_id" field. +func OrganizationIDGT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldOrganizationID, v)) +} + +// OrganizationIDGTE applies the GTE predicate on the "organization_id" field. +func OrganizationIDGTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldOrganizationID, v)) +} + +// OrganizationIDLT applies the LT predicate on the "organization_id" field. +func OrganizationIDLT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldOrganizationID, v)) +} + +// OrganizationIDLTE applies the LTE predicate on the "organization_id" field. +func OrganizationIDLTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldOrganizationID, v)) +} + +// OrganizationIDContains applies the Contains predicate on the "organization_id" field. +func OrganizationIDContains(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContains(FieldOrganizationID, v)) +} + +// OrganizationIDHasPrefix applies the HasPrefix predicate on the "organization_id" field. +func OrganizationIDHasPrefix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasPrefix(FieldOrganizationID, v)) +} + +// OrganizationIDHasSuffix applies the HasSuffix predicate on the "organization_id" field. +func OrganizationIDHasSuffix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasSuffix(FieldOrganizationID, v)) +} + +// OrganizationIDEqualFold applies the EqualFold predicate on the "organization_id" field. +func OrganizationIDEqualFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldOrganizationID, v)) +} + +// OrganizationIDContainsFold applies the ContainsFold predicate on the "organization_id" field. +func OrganizationIDContainsFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldOrganizationID, v)) +} + +// UserIDEQ applies the EQ predicate on the "user_id" field. +func UserIDEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEQ(FieldUserID, v)) +} + +// UserIDNEQ applies the NEQ predicate on the "user_id" field. +func UserIDNEQ(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNEQ(FieldUserID, v)) +} + +// UserIDIn applies the In predicate on the "user_id" field. +func UserIDIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldIn(FieldUserID, vs...)) +} + +// UserIDNotIn applies the NotIn predicate on the "user_id" field. +func UserIDNotIn(vs ...string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldNotIn(FieldUserID, vs...)) +} + +// UserIDGT applies the GT predicate on the "user_id" field. +func UserIDGT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGT(FieldUserID, v)) +} + +// UserIDGTE applies the GTE predicate on the "user_id" field. +func UserIDGTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldGTE(FieldUserID, v)) +} + +// UserIDLT applies the LT predicate on the "user_id" field. +func UserIDLT(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLT(FieldUserID, v)) +} + +// UserIDLTE applies the LTE predicate on the "user_id" field. +func UserIDLTE(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldLTE(FieldUserID, v)) +} + +// UserIDContains applies the Contains predicate on the "user_id" field. +func UserIDContains(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContains(FieldUserID, v)) +} + +// UserIDHasPrefix applies the HasPrefix predicate on the "user_id" field. +func UserIDHasPrefix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasPrefix(FieldUserID, v)) +} + +// UserIDHasSuffix applies the HasSuffix predicate on the "user_id" field. +func UserIDHasSuffix(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldHasSuffix(FieldUserID, v)) +} + +// UserIDEqualFold applies the EqualFold predicate on the "user_id" field. +func UserIDEqualFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldEqualFold(FieldUserID, v)) +} + +// UserIDContainsFold applies the ContainsFold predicate on the "user_id" field. +func UserIDContainsFold(v string) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.FieldContainsFold(FieldUserID, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.OrgMembershipHistory) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.OrgMembershipHistory) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.OrgMembershipHistory) predicate.OrgMembershipHistory { + return predicate.OrgMembershipHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/orgmembershiphistory_create.go b/internal/ent/generated/orgmembershiphistory_create.go new file mode 100644 index 0000000..f3bf9c2 --- /dev/null +++ b/internal/ent/generated/orgmembershiphistory_create.go @@ -0,0 +1,479 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// OrgMembershipHistoryCreate is the builder for creating a OrgMembershipHistory entity. +type OrgMembershipHistoryCreate struct { + config + mutation *OrgMembershipHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (omhc *OrgMembershipHistoryCreate) SetHistoryTime(t time.Time) *OrgMembershipHistoryCreate { + omhc.mutation.SetHistoryTime(t) + return omhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableHistoryTime(t *time.Time) *OrgMembershipHistoryCreate { + if t != nil { + omhc.SetHistoryTime(*t) + } + return omhc +} + +// SetRef sets the "ref" field. +func (omhc *OrgMembershipHistoryCreate) SetRef(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetRef(s) + return omhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableRef(s *string) *OrgMembershipHistoryCreate { + if s != nil { + omhc.SetRef(*s) + } + return omhc +} + +// SetOperation sets the "operation" field. +func (omhc *OrgMembershipHistoryCreate) SetOperation(ht history.OpType) *OrgMembershipHistoryCreate { + omhc.mutation.SetOperation(ht) + return omhc +} + +// SetCreatedAt sets the "created_at" field. +func (omhc *OrgMembershipHistoryCreate) SetCreatedAt(t time.Time) *OrgMembershipHistoryCreate { + omhc.mutation.SetCreatedAt(t) + return omhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableCreatedAt(t *time.Time) *OrgMembershipHistoryCreate { + if t != nil { + omhc.SetCreatedAt(*t) + } + return omhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (omhc *OrgMembershipHistoryCreate) SetUpdatedAt(t time.Time) *OrgMembershipHistoryCreate { + omhc.mutation.SetUpdatedAt(t) + return omhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableUpdatedAt(t *time.Time) *OrgMembershipHistoryCreate { + if t != nil { + omhc.SetUpdatedAt(*t) + } + return omhc +} + +// SetCreatedBy sets the "created_by" field. +func (omhc *OrgMembershipHistoryCreate) SetCreatedBy(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetCreatedBy(s) + return omhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableCreatedBy(s *string) *OrgMembershipHistoryCreate { + if s != nil { + omhc.SetCreatedBy(*s) + } + return omhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (omhc *OrgMembershipHistoryCreate) SetUpdatedBy(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetUpdatedBy(s) + return omhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableUpdatedBy(s *string) *OrgMembershipHistoryCreate { + if s != nil { + omhc.SetUpdatedBy(*s) + } + return omhc +} + +// SetMappingID sets the "mapping_id" field. +func (omhc *OrgMembershipHistoryCreate) SetMappingID(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetMappingID(s) + return omhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableMappingID(s *string) *OrgMembershipHistoryCreate { + if s != nil { + omhc.SetMappingID(*s) + } + return omhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (omhc *OrgMembershipHistoryCreate) SetDeletedAt(t time.Time) *OrgMembershipHistoryCreate { + omhc.mutation.SetDeletedAt(t) + return omhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableDeletedAt(t *time.Time) *OrgMembershipHistoryCreate { + if t != nil { + omhc.SetDeletedAt(*t) + } + return omhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (omhc *OrgMembershipHistoryCreate) SetDeletedBy(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetDeletedBy(s) + return omhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableDeletedBy(s *string) *OrgMembershipHistoryCreate { + if s != nil { + omhc.SetDeletedBy(*s) + } + return omhc +} + +// SetRole sets the "role" field. +func (omhc *OrgMembershipHistoryCreate) SetRole(e enums.Role) *OrgMembershipHistoryCreate { + omhc.mutation.SetRole(e) + return omhc +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableRole(e *enums.Role) *OrgMembershipHistoryCreate { + if e != nil { + omhc.SetRole(*e) + } + return omhc +} + +// SetOrganizationID sets the "organization_id" field. +func (omhc *OrgMembershipHistoryCreate) SetOrganizationID(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetOrganizationID(s) + return omhc +} + +// SetUserID sets the "user_id" field. +func (omhc *OrgMembershipHistoryCreate) SetUserID(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetUserID(s) + return omhc +} + +// SetID sets the "id" field. +func (omhc *OrgMembershipHistoryCreate) SetID(s string) *OrgMembershipHistoryCreate { + omhc.mutation.SetID(s) + return omhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (omhc *OrgMembershipHistoryCreate) SetNillableID(s *string) *OrgMembershipHistoryCreate { + if s != nil { + omhc.SetID(*s) + } + return omhc +} + +// Mutation returns the OrgMembershipHistoryMutation object of the builder. +func (omhc *OrgMembershipHistoryCreate) Mutation() *OrgMembershipHistoryMutation { + return omhc.mutation +} + +// Save creates the OrgMembershipHistory in the database. +func (omhc *OrgMembershipHistoryCreate) Save(ctx context.Context) (*OrgMembershipHistory, error) { + if err := omhc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, omhc.sqlSave, omhc.mutation, omhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (omhc *OrgMembershipHistoryCreate) SaveX(ctx context.Context) *OrgMembershipHistory { + v, err := omhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (omhc *OrgMembershipHistoryCreate) Exec(ctx context.Context) error { + _, err := omhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omhc *OrgMembershipHistoryCreate) ExecX(ctx context.Context) { + if err := omhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (omhc *OrgMembershipHistoryCreate) defaults() error { + if _, ok := omhc.mutation.HistoryTime(); !ok { + if orgmembershiphistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized orgmembershiphistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := orgmembershiphistory.DefaultHistoryTime() + omhc.mutation.SetHistoryTime(v) + } + if _, ok := omhc.mutation.CreatedAt(); !ok { + if orgmembershiphistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembershiphistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := orgmembershiphistory.DefaultCreatedAt() + omhc.mutation.SetCreatedAt(v) + } + if _, ok := omhc.mutation.UpdatedAt(); !ok { + if orgmembershiphistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembershiphistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := orgmembershiphistory.DefaultUpdatedAt() + omhc.mutation.SetUpdatedAt(v) + } + if _, ok := omhc.mutation.MappingID(); !ok { + if orgmembershiphistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized orgmembershiphistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := orgmembershiphistory.DefaultMappingID() + omhc.mutation.SetMappingID(v) + } + if _, ok := omhc.mutation.Role(); !ok { + v := orgmembershiphistory.DefaultRole + omhc.mutation.SetRole(v) + } + if _, ok := omhc.mutation.ID(); !ok { + if orgmembershiphistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized orgmembershiphistory.DefaultID (forgotten import generated/runtime?)") + } + v := orgmembershiphistory.DefaultID() + omhc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (omhc *OrgMembershipHistoryCreate) check() error { + if _, ok := omhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "OrgMembershipHistory.history_time"`)} + } + if _, ok := omhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "OrgMembershipHistory.operation"`)} + } + if v, ok := omhc.mutation.Operation(); ok { + if err := orgmembershiphistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "OrgMembershipHistory.operation": %w`, err)} + } + } + if _, ok := omhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "OrgMembershipHistory.mapping_id"`)} + } + if _, ok := omhc.mutation.Role(); !ok { + return &ValidationError{Name: "role", err: errors.New(`generated: missing required field "OrgMembershipHistory.role"`)} + } + if v, ok := omhc.mutation.Role(); ok { + if err := orgmembershiphistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "OrgMembershipHistory.role": %w`, err)} + } + } + if _, ok := omhc.mutation.OrganizationID(); !ok { + return &ValidationError{Name: "organization_id", err: errors.New(`generated: missing required field "OrgMembershipHistory.organization_id"`)} + } + if _, ok := omhc.mutation.UserID(); !ok { + return &ValidationError{Name: "user_id", err: errors.New(`generated: missing required field "OrgMembershipHistory.user_id"`)} + } + return nil +} + +func (omhc *OrgMembershipHistoryCreate) sqlSave(ctx context.Context) (*OrgMembershipHistory, error) { + if err := omhc.check(); err != nil { + return nil, err + } + _node, _spec := omhc.createSpec() + if err := sqlgraph.CreateNode(ctx, omhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected OrgMembershipHistory.ID type: %T", _spec.ID.Value) + } + } + omhc.mutation.id = &_node.ID + omhc.mutation.done = true + return _node, nil +} + +func (omhc *OrgMembershipHistoryCreate) createSpec() (*OrgMembershipHistory, *sqlgraph.CreateSpec) { + var ( + _node = &OrgMembershipHistory{config: omhc.config} + _spec = sqlgraph.NewCreateSpec(orgmembershiphistory.Table, sqlgraph.NewFieldSpec(orgmembershiphistory.FieldID, field.TypeString)) + ) + _spec.Schema = omhc.schemaConfig.OrgMembershipHistory + if id, ok := omhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := omhc.mutation.HistoryTime(); ok { + _spec.SetField(orgmembershiphistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := omhc.mutation.Ref(); ok { + _spec.SetField(orgmembershiphistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := omhc.mutation.Operation(); ok { + _spec.SetField(orgmembershiphistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := omhc.mutation.CreatedAt(); ok { + _spec.SetField(orgmembershiphistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := omhc.mutation.UpdatedAt(); ok { + _spec.SetField(orgmembershiphistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := omhc.mutation.CreatedBy(); ok { + _spec.SetField(orgmembershiphistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := omhc.mutation.UpdatedBy(); ok { + _spec.SetField(orgmembershiphistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := omhc.mutation.MappingID(); ok { + _spec.SetField(orgmembershiphistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := omhc.mutation.DeletedAt(); ok { + _spec.SetField(orgmembershiphistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := omhc.mutation.DeletedBy(); ok { + _spec.SetField(orgmembershiphistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := omhc.mutation.Role(); ok { + _spec.SetField(orgmembershiphistory.FieldRole, field.TypeEnum, value) + _node.Role = value + } + if value, ok := omhc.mutation.OrganizationID(); ok { + _spec.SetField(orgmembershiphistory.FieldOrganizationID, field.TypeString, value) + _node.OrganizationID = value + } + if value, ok := omhc.mutation.UserID(); ok { + _spec.SetField(orgmembershiphistory.FieldUserID, field.TypeString, value) + _node.UserID = value + } + return _node, _spec +} + +// OrgMembershipHistoryCreateBulk is the builder for creating many OrgMembershipHistory entities in bulk. +type OrgMembershipHistoryCreateBulk struct { + config + err error + builders []*OrgMembershipHistoryCreate +} + +// Save creates the OrgMembershipHistory entities in the database. +func (omhcb *OrgMembershipHistoryCreateBulk) Save(ctx context.Context) ([]*OrgMembershipHistory, error) { + if omhcb.err != nil { + return nil, omhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(omhcb.builders)) + nodes := make([]*OrgMembershipHistory, len(omhcb.builders)) + mutators := make([]Mutator, len(omhcb.builders)) + for i := range omhcb.builders { + func(i int, root context.Context) { + builder := omhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*OrgMembershipHistoryMutation) + 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, omhcb.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, omhcb.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, omhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (omhcb *OrgMembershipHistoryCreateBulk) SaveX(ctx context.Context) []*OrgMembershipHistory { + v, err := omhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (omhcb *OrgMembershipHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := omhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omhcb *OrgMembershipHistoryCreateBulk) ExecX(ctx context.Context) { + if err := omhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/orgmembershiphistory_delete.go b/internal/ent/generated/orgmembershiphistory_delete.go new file mode 100644 index 0000000..a058c0a --- /dev/null +++ b/internal/ent/generated/orgmembershiphistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" +) + +// OrgMembershipHistoryDelete is the builder for deleting a OrgMembershipHistory entity. +type OrgMembershipHistoryDelete struct { + config + hooks []Hook + mutation *OrgMembershipHistoryMutation +} + +// Where appends a list predicates to the OrgMembershipHistoryDelete builder. +func (omhd *OrgMembershipHistoryDelete) Where(ps ...predicate.OrgMembershipHistory) *OrgMembershipHistoryDelete { + omhd.mutation.Where(ps...) + return omhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (omhd *OrgMembershipHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, omhd.sqlExec, omhd.mutation, omhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (omhd *OrgMembershipHistoryDelete) ExecX(ctx context.Context) int { + n, err := omhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (omhd *OrgMembershipHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(orgmembershiphistory.Table, sqlgraph.NewFieldSpec(orgmembershiphistory.FieldID, field.TypeString)) + _spec.Node.Schema = omhd.schemaConfig.OrgMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, omhd.schemaConfig) + if ps := omhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, omhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + omhd.mutation.done = true + return affected, err +} + +// OrgMembershipHistoryDeleteOne is the builder for deleting a single OrgMembershipHistory entity. +type OrgMembershipHistoryDeleteOne struct { + omhd *OrgMembershipHistoryDelete +} + +// Where appends a list predicates to the OrgMembershipHistoryDelete builder. +func (omhdo *OrgMembershipHistoryDeleteOne) Where(ps ...predicate.OrgMembershipHistory) *OrgMembershipHistoryDeleteOne { + omhdo.omhd.mutation.Where(ps...) + return omhdo +} + +// Exec executes the deletion query. +func (omhdo *OrgMembershipHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := omhdo.omhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{orgmembershiphistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (omhdo *OrgMembershipHistoryDeleteOne) ExecX(ctx context.Context) { + if err := omhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/orgmembershiphistory_query.go b/internal/ent/generated/orgmembershiphistory_query.go new file mode 100644 index 0000000..c3de652 --- /dev/null +++ b/internal/ent/generated/orgmembershiphistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrgMembershipHistoryQuery is the builder for querying OrgMembershipHistory entities. +type OrgMembershipHistoryQuery struct { + config + ctx *QueryContext + order []orgmembershiphistory.OrderOption + inters []Interceptor + predicates []predicate.OrgMembershipHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*OrgMembershipHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the OrgMembershipHistoryQuery builder. +func (omhq *OrgMembershipHistoryQuery) Where(ps ...predicate.OrgMembershipHistory) *OrgMembershipHistoryQuery { + omhq.predicates = append(omhq.predicates, ps...) + return omhq +} + +// Limit the number of records to be returned by this query. +func (omhq *OrgMembershipHistoryQuery) Limit(limit int) *OrgMembershipHistoryQuery { + omhq.ctx.Limit = &limit + return omhq +} + +// Offset to start from. +func (omhq *OrgMembershipHistoryQuery) Offset(offset int) *OrgMembershipHistoryQuery { + omhq.ctx.Offset = &offset + return omhq +} + +// 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 (omhq *OrgMembershipHistoryQuery) Unique(unique bool) *OrgMembershipHistoryQuery { + omhq.ctx.Unique = &unique + return omhq +} + +// Order specifies how the records should be ordered. +func (omhq *OrgMembershipHistoryQuery) Order(o ...orgmembershiphistory.OrderOption) *OrgMembershipHistoryQuery { + omhq.order = append(omhq.order, o...) + return omhq +} + +// First returns the first OrgMembershipHistory entity from the query. +// Returns a *NotFoundError when no OrgMembershipHistory was found. +func (omhq *OrgMembershipHistoryQuery) First(ctx context.Context) (*OrgMembershipHistory, error) { + nodes, err := omhq.Limit(1).All(setContextOp(ctx, omhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{orgmembershiphistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) FirstX(ctx context.Context) *OrgMembershipHistory { + node, err := omhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first OrgMembershipHistory ID from the query. +// Returns a *NotFoundError when no OrgMembershipHistory ID was found. +func (omhq *OrgMembershipHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = omhq.Limit(1).IDs(setContextOp(ctx, omhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{orgmembershiphistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := omhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single OrgMembershipHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one OrgMembershipHistory entity is found. +// Returns a *NotFoundError when no OrgMembershipHistory entities are found. +func (omhq *OrgMembershipHistoryQuery) Only(ctx context.Context) (*OrgMembershipHistory, error) { + nodes, err := omhq.Limit(2).All(setContextOp(ctx, omhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{orgmembershiphistory.Label} + default: + return nil, &NotSingularError{orgmembershiphistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) OnlyX(ctx context.Context) *OrgMembershipHistory { + node, err := omhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only OrgMembershipHistory ID in the query. +// Returns a *NotSingularError when more than one OrgMembershipHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (omhq *OrgMembershipHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = omhq.Limit(2).IDs(setContextOp(ctx, omhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{orgmembershiphistory.Label} + default: + err = &NotSingularError{orgmembershiphistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := omhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of OrgMembershipHistories. +func (omhq *OrgMembershipHistoryQuery) All(ctx context.Context) ([]*OrgMembershipHistory, error) { + ctx = setContextOp(ctx, omhq.ctx, ent.OpQueryAll) + if err := omhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*OrgMembershipHistory, *OrgMembershipHistoryQuery]() + return withInterceptors[[]*OrgMembershipHistory](ctx, omhq, qr, omhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) AllX(ctx context.Context) []*OrgMembershipHistory { + nodes, err := omhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of OrgMembershipHistory IDs. +func (omhq *OrgMembershipHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if omhq.ctx.Unique == nil && omhq.path != nil { + omhq.Unique(true) + } + ctx = setContextOp(ctx, omhq.ctx, ent.OpQueryIDs) + if err = omhq.Select(orgmembershiphistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := omhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (omhq *OrgMembershipHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, omhq.ctx, ent.OpQueryCount) + if err := omhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, omhq, querierCount[*OrgMembershipHistoryQuery](), omhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) CountX(ctx context.Context) int { + count, err := omhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (omhq *OrgMembershipHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, omhq.ctx, ent.OpQueryExist) + switch _, err := omhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (omhq *OrgMembershipHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := omhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the OrgMembershipHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (omhq *OrgMembershipHistoryQuery) Clone() *OrgMembershipHistoryQuery { + if omhq == nil { + return nil + } + return &OrgMembershipHistoryQuery{ + config: omhq.config, + ctx: omhq.ctx.Clone(), + order: append([]orgmembershiphistory.OrderOption{}, omhq.order...), + inters: append([]Interceptor{}, omhq.inters...), + predicates: append([]predicate.OrgMembershipHistory{}, omhq.predicates...), + // clone intermediate query. + sql: omhq.sql.Clone(), + path: omhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.OrgMembershipHistory.Query(). +// GroupBy(orgmembershiphistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (omhq *OrgMembershipHistoryQuery) GroupBy(field string, fields ...string) *OrgMembershipHistoryGroupBy { + omhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &OrgMembershipHistoryGroupBy{build: omhq} + grbuild.flds = &omhq.ctx.Fields + grbuild.label = orgmembershiphistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.OrgMembershipHistory.Query(). +// Select(orgmembershiphistory.FieldHistoryTime). +// Scan(ctx, &v) +func (omhq *OrgMembershipHistoryQuery) Select(fields ...string) *OrgMembershipHistorySelect { + omhq.ctx.Fields = append(omhq.ctx.Fields, fields...) + sbuild := &OrgMembershipHistorySelect{OrgMembershipHistoryQuery: omhq} + sbuild.label = orgmembershiphistory.Label + sbuild.flds, sbuild.scan = &omhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a OrgMembershipHistorySelect configured with the given aggregations. +func (omhq *OrgMembershipHistoryQuery) Aggregate(fns ...AggregateFunc) *OrgMembershipHistorySelect { + return omhq.Select().Aggregate(fns...) +} + +func (omhq *OrgMembershipHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range omhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, omhq); err != nil { + return err + } + } + } + for _, f := range omhq.ctx.Fields { + if !orgmembershiphistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if omhq.path != nil { + prev, err := omhq.path(ctx) + if err != nil { + return err + } + omhq.sql = prev + } + if orgmembershiphistory.Policy == nil { + return errors.New("generated: uninitialized orgmembershiphistory.Policy (forgotten import generated/runtime?)") + } + if err := orgmembershiphistory.Policy.EvalQuery(ctx, omhq); err != nil { + return err + } + return nil +} + +func (omhq *OrgMembershipHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*OrgMembershipHistory, error) { + var ( + nodes = []*OrgMembershipHistory{} + _spec = omhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*OrgMembershipHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &OrgMembershipHistory{config: omhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = omhq.schemaConfig.OrgMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, omhq.schemaConfig) + if len(omhq.modifiers) > 0 { + _spec.Modifiers = omhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, omhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range omhq.loadTotal { + if err := omhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (omhq *OrgMembershipHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := omhq.querySpec() + _spec.Node.Schema = omhq.schemaConfig.OrgMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, omhq.schemaConfig) + if len(omhq.modifiers) > 0 { + _spec.Modifiers = omhq.modifiers + } + _spec.Node.Columns = omhq.ctx.Fields + if len(omhq.ctx.Fields) > 0 { + _spec.Unique = omhq.ctx.Unique != nil && *omhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, omhq.driver, _spec) +} + +func (omhq *OrgMembershipHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(orgmembershiphistory.Table, orgmembershiphistory.Columns, sqlgraph.NewFieldSpec(orgmembershiphistory.FieldID, field.TypeString)) + _spec.From = omhq.sql + if unique := omhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if omhq.path != nil { + _spec.Unique = true + } + if fields := omhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, orgmembershiphistory.FieldID) + for i := range fields { + if fields[i] != orgmembershiphistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := omhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := omhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := omhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := omhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (omhq *OrgMembershipHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(omhq.driver.Dialect()) + t1 := builder.Table(orgmembershiphistory.Table) + columns := omhq.ctx.Fields + if len(columns) == 0 { + columns = orgmembershiphistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if omhq.sql != nil { + selector = omhq.sql + selector.Select(selector.Columns(columns...)...) + } + if omhq.ctx.Unique != nil && *omhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(omhq.schemaConfig.OrgMembershipHistory) + ctx = internal.NewSchemaConfigContext(ctx, omhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range omhq.predicates { + p(selector) + } + for _, p := range omhq.order { + p(selector) + } + if offset := omhq.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 := omhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// OrgMembershipHistoryGroupBy is the group-by builder for OrgMembershipHistory entities. +type OrgMembershipHistoryGroupBy struct { + selector + build *OrgMembershipHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (omhgb *OrgMembershipHistoryGroupBy) Aggregate(fns ...AggregateFunc) *OrgMembershipHistoryGroupBy { + omhgb.fns = append(omhgb.fns, fns...) + return omhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (omhgb *OrgMembershipHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, omhgb.build.ctx, ent.OpQueryGroupBy) + if err := omhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrgMembershipHistoryQuery, *OrgMembershipHistoryGroupBy](ctx, omhgb.build, omhgb, omhgb.build.inters, v) +} + +func (omhgb *OrgMembershipHistoryGroupBy) sqlScan(ctx context.Context, root *OrgMembershipHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(omhgb.fns)) + for _, fn := range omhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*omhgb.flds)+len(omhgb.fns)) + for _, f := range *omhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*omhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := omhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// OrgMembershipHistorySelect is the builder for selecting fields of OrgMembershipHistory entities. +type OrgMembershipHistorySelect struct { + *OrgMembershipHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (omhs *OrgMembershipHistorySelect) Aggregate(fns ...AggregateFunc) *OrgMembershipHistorySelect { + omhs.fns = append(omhs.fns, fns...) + return omhs +} + +// Scan applies the selector query and scans the result into the given value. +func (omhs *OrgMembershipHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, omhs.ctx, ent.OpQuerySelect) + if err := omhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*OrgMembershipHistoryQuery, *OrgMembershipHistorySelect](ctx, omhs.OrgMembershipHistoryQuery, omhs, omhs.inters, v) +} + +func (omhs *OrgMembershipHistorySelect) sqlScan(ctx context.Context, root *OrgMembershipHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(omhs.fns)) + for _, fn := range omhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*omhs.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 := omhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/orgmembershiphistory_update.go b/internal/ent/generated/orgmembershiphistory_update.go new file mode 100644 index 0000000..ebca180 --- /dev/null +++ b/internal/ent/generated/orgmembershiphistory_update.go @@ -0,0 +1,483 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// OrgMembershipHistoryUpdate is the builder for updating OrgMembershipHistory entities. +type OrgMembershipHistoryUpdate struct { + config + hooks []Hook + mutation *OrgMembershipHistoryMutation +} + +// Where appends a list predicates to the OrgMembershipHistoryUpdate builder. +func (omhu *OrgMembershipHistoryUpdate) Where(ps ...predicate.OrgMembershipHistory) *OrgMembershipHistoryUpdate { + omhu.mutation.Where(ps...) + return omhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (omhu *OrgMembershipHistoryUpdate) SetUpdatedAt(t time.Time) *OrgMembershipHistoryUpdate { + omhu.mutation.SetUpdatedAt(t) + return omhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (omhu *OrgMembershipHistoryUpdate) ClearUpdatedAt() *OrgMembershipHistoryUpdate { + omhu.mutation.ClearUpdatedAt() + return omhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (omhu *OrgMembershipHistoryUpdate) SetUpdatedBy(s string) *OrgMembershipHistoryUpdate { + omhu.mutation.SetUpdatedBy(s) + return omhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (omhu *OrgMembershipHistoryUpdate) SetNillableUpdatedBy(s *string) *OrgMembershipHistoryUpdate { + if s != nil { + omhu.SetUpdatedBy(*s) + } + return omhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (omhu *OrgMembershipHistoryUpdate) ClearUpdatedBy() *OrgMembershipHistoryUpdate { + omhu.mutation.ClearUpdatedBy() + return omhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (omhu *OrgMembershipHistoryUpdate) SetDeletedAt(t time.Time) *OrgMembershipHistoryUpdate { + omhu.mutation.SetDeletedAt(t) + return omhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (omhu *OrgMembershipHistoryUpdate) SetNillableDeletedAt(t *time.Time) *OrgMembershipHistoryUpdate { + if t != nil { + omhu.SetDeletedAt(*t) + } + return omhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (omhu *OrgMembershipHistoryUpdate) ClearDeletedAt() *OrgMembershipHistoryUpdate { + omhu.mutation.ClearDeletedAt() + return omhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (omhu *OrgMembershipHistoryUpdate) SetDeletedBy(s string) *OrgMembershipHistoryUpdate { + omhu.mutation.SetDeletedBy(s) + return omhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (omhu *OrgMembershipHistoryUpdate) SetNillableDeletedBy(s *string) *OrgMembershipHistoryUpdate { + if s != nil { + omhu.SetDeletedBy(*s) + } + return omhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (omhu *OrgMembershipHistoryUpdate) ClearDeletedBy() *OrgMembershipHistoryUpdate { + omhu.mutation.ClearDeletedBy() + return omhu +} + +// SetRole sets the "role" field. +func (omhu *OrgMembershipHistoryUpdate) SetRole(e enums.Role) *OrgMembershipHistoryUpdate { + omhu.mutation.SetRole(e) + return omhu +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (omhu *OrgMembershipHistoryUpdate) SetNillableRole(e *enums.Role) *OrgMembershipHistoryUpdate { + if e != nil { + omhu.SetRole(*e) + } + return omhu +} + +// Mutation returns the OrgMembershipHistoryMutation object of the builder. +func (omhu *OrgMembershipHistoryUpdate) Mutation() *OrgMembershipHistoryMutation { + return omhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (omhu *OrgMembershipHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := omhu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, omhu.sqlSave, omhu.mutation, omhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (omhu *OrgMembershipHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := omhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (omhu *OrgMembershipHistoryUpdate) Exec(ctx context.Context) error { + _, err := omhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omhu *OrgMembershipHistoryUpdate) ExecX(ctx context.Context) { + if err := omhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (omhu *OrgMembershipHistoryUpdate) defaults() error { + if _, ok := omhu.mutation.UpdatedAt(); !ok && !omhu.mutation.UpdatedAtCleared() { + if orgmembershiphistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembershiphistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := orgmembershiphistory.UpdateDefaultUpdatedAt() + omhu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (omhu *OrgMembershipHistoryUpdate) check() error { + if v, ok := omhu.mutation.Role(); ok { + if err := orgmembershiphistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "OrgMembershipHistory.role": %w`, err)} + } + } + return nil +} + +func (omhu *OrgMembershipHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := omhu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(orgmembershiphistory.Table, orgmembershiphistory.Columns, sqlgraph.NewFieldSpec(orgmembershiphistory.FieldID, field.TypeString)) + if ps := omhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if omhu.mutation.RefCleared() { + _spec.ClearField(orgmembershiphistory.FieldRef, field.TypeString) + } + if omhu.mutation.CreatedAtCleared() { + _spec.ClearField(orgmembershiphistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := omhu.mutation.UpdatedAt(); ok { + _spec.SetField(orgmembershiphistory.FieldUpdatedAt, field.TypeTime, value) + } + if omhu.mutation.UpdatedAtCleared() { + _spec.ClearField(orgmembershiphistory.FieldUpdatedAt, field.TypeTime) + } + if omhu.mutation.CreatedByCleared() { + _spec.ClearField(orgmembershiphistory.FieldCreatedBy, field.TypeString) + } + if value, ok := omhu.mutation.UpdatedBy(); ok { + _spec.SetField(orgmembershiphistory.FieldUpdatedBy, field.TypeString, value) + } + if omhu.mutation.UpdatedByCleared() { + _spec.ClearField(orgmembershiphistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := omhu.mutation.DeletedAt(); ok { + _spec.SetField(orgmembershiphistory.FieldDeletedAt, field.TypeTime, value) + } + if omhu.mutation.DeletedAtCleared() { + _spec.ClearField(orgmembershiphistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := omhu.mutation.DeletedBy(); ok { + _spec.SetField(orgmembershiphistory.FieldDeletedBy, field.TypeString, value) + } + if omhu.mutation.DeletedByCleared() { + _spec.ClearField(orgmembershiphistory.FieldDeletedBy, field.TypeString) + } + if value, ok := omhu.mutation.Role(); ok { + _spec.SetField(orgmembershiphistory.FieldRole, field.TypeEnum, value) + } + _spec.Node.Schema = omhu.schemaConfig.OrgMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, omhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, omhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{orgmembershiphistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + omhu.mutation.done = true + return n, nil +} + +// OrgMembershipHistoryUpdateOne is the builder for updating a single OrgMembershipHistory entity. +type OrgMembershipHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *OrgMembershipHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (omhuo *OrgMembershipHistoryUpdateOne) SetUpdatedAt(t time.Time) *OrgMembershipHistoryUpdateOne { + omhuo.mutation.SetUpdatedAt(t) + return omhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (omhuo *OrgMembershipHistoryUpdateOne) ClearUpdatedAt() *OrgMembershipHistoryUpdateOne { + omhuo.mutation.ClearUpdatedAt() + return omhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (omhuo *OrgMembershipHistoryUpdateOne) SetUpdatedBy(s string) *OrgMembershipHistoryUpdateOne { + omhuo.mutation.SetUpdatedBy(s) + return omhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (omhuo *OrgMembershipHistoryUpdateOne) SetNillableUpdatedBy(s *string) *OrgMembershipHistoryUpdateOne { + if s != nil { + omhuo.SetUpdatedBy(*s) + } + return omhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (omhuo *OrgMembershipHistoryUpdateOne) ClearUpdatedBy() *OrgMembershipHistoryUpdateOne { + omhuo.mutation.ClearUpdatedBy() + return omhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (omhuo *OrgMembershipHistoryUpdateOne) SetDeletedAt(t time.Time) *OrgMembershipHistoryUpdateOne { + omhuo.mutation.SetDeletedAt(t) + return omhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (omhuo *OrgMembershipHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *OrgMembershipHistoryUpdateOne { + if t != nil { + omhuo.SetDeletedAt(*t) + } + return omhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (omhuo *OrgMembershipHistoryUpdateOne) ClearDeletedAt() *OrgMembershipHistoryUpdateOne { + omhuo.mutation.ClearDeletedAt() + return omhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (omhuo *OrgMembershipHistoryUpdateOne) SetDeletedBy(s string) *OrgMembershipHistoryUpdateOne { + omhuo.mutation.SetDeletedBy(s) + return omhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (omhuo *OrgMembershipHistoryUpdateOne) SetNillableDeletedBy(s *string) *OrgMembershipHistoryUpdateOne { + if s != nil { + omhuo.SetDeletedBy(*s) + } + return omhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (omhuo *OrgMembershipHistoryUpdateOne) ClearDeletedBy() *OrgMembershipHistoryUpdateOne { + omhuo.mutation.ClearDeletedBy() + return omhuo +} + +// SetRole sets the "role" field. +func (omhuo *OrgMembershipHistoryUpdateOne) SetRole(e enums.Role) *OrgMembershipHistoryUpdateOne { + omhuo.mutation.SetRole(e) + return omhuo +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (omhuo *OrgMembershipHistoryUpdateOne) SetNillableRole(e *enums.Role) *OrgMembershipHistoryUpdateOne { + if e != nil { + omhuo.SetRole(*e) + } + return omhuo +} + +// Mutation returns the OrgMembershipHistoryMutation object of the builder. +func (omhuo *OrgMembershipHistoryUpdateOne) Mutation() *OrgMembershipHistoryMutation { + return omhuo.mutation +} + +// Where appends a list predicates to the OrgMembershipHistoryUpdate builder. +func (omhuo *OrgMembershipHistoryUpdateOne) Where(ps ...predicate.OrgMembershipHistory) *OrgMembershipHistoryUpdateOne { + omhuo.mutation.Where(ps...) + return omhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (omhuo *OrgMembershipHistoryUpdateOne) Select(field string, fields ...string) *OrgMembershipHistoryUpdateOne { + omhuo.fields = append([]string{field}, fields...) + return omhuo +} + +// Save executes the query and returns the updated OrgMembershipHistory entity. +func (omhuo *OrgMembershipHistoryUpdateOne) Save(ctx context.Context) (*OrgMembershipHistory, error) { + if err := omhuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, omhuo.sqlSave, omhuo.mutation, omhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (omhuo *OrgMembershipHistoryUpdateOne) SaveX(ctx context.Context) *OrgMembershipHistory { + node, err := omhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (omhuo *OrgMembershipHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := omhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (omhuo *OrgMembershipHistoryUpdateOne) ExecX(ctx context.Context) { + if err := omhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (omhuo *OrgMembershipHistoryUpdateOne) defaults() error { + if _, ok := omhuo.mutation.UpdatedAt(); !ok && !omhuo.mutation.UpdatedAtCleared() { + if orgmembershiphistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized orgmembershiphistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := orgmembershiphistory.UpdateDefaultUpdatedAt() + omhuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (omhuo *OrgMembershipHistoryUpdateOne) check() error { + if v, ok := omhuo.mutation.Role(); ok { + if err := orgmembershiphistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "OrgMembershipHistory.role": %w`, err)} + } + } + return nil +} + +func (omhuo *OrgMembershipHistoryUpdateOne) sqlSave(ctx context.Context) (_node *OrgMembershipHistory, err error) { + if err := omhuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(orgmembershiphistory.Table, orgmembershiphistory.Columns, sqlgraph.NewFieldSpec(orgmembershiphistory.FieldID, field.TypeString)) + id, ok := omhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "OrgMembershipHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := omhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, orgmembershiphistory.FieldID) + for _, f := range fields { + if !orgmembershiphistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != orgmembershiphistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := omhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if omhuo.mutation.RefCleared() { + _spec.ClearField(orgmembershiphistory.FieldRef, field.TypeString) + } + if omhuo.mutation.CreatedAtCleared() { + _spec.ClearField(orgmembershiphistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := omhuo.mutation.UpdatedAt(); ok { + _spec.SetField(orgmembershiphistory.FieldUpdatedAt, field.TypeTime, value) + } + if omhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(orgmembershiphistory.FieldUpdatedAt, field.TypeTime) + } + if omhuo.mutation.CreatedByCleared() { + _spec.ClearField(orgmembershiphistory.FieldCreatedBy, field.TypeString) + } + if value, ok := omhuo.mutation.UpdatedBy(); ok { + _spec.SetField(orgmembershiphistory.FieldUpdatedBy, field.TypeString, value) + } + if omhuo.mutation.UpdatedByCleared() { + _spec.ClearField(orgmembershiphistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := omhuo.mutation.DeletedAt(); ok { + _spec.SetField(orgmembershiphistory.FieldDeletedAt, field.TypeTime, value) + } + if omhuo.mutation.DeletedAtCleared() { + _spec.ClearField(orgmembershiphistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := omhuo.mutation.DeletedBy(); ok { + _spec.SetField(orgmembershiphistory.FieldDeletedBy, field.TypeString, value) + } + if omhuo.mutation.DeletedByCleared() { + _spec.ClearField(orgmembershiphistory.FieldDeletedBy, field.TypeString) + } + if value, ok := omhuo.mutation.Role(); ok { + _spec.SetField(orgmembershiphistory.FieldRole, field.TypeEnum, value) + } + _spec.Node.Schema = omhuo.schemaConfig.OrgMembershipHistory + ctx = internal.NewSchemaConfigContext(ctx, omhuo.schemaConfig) + _node = &OrgMembershipHistory{config: omhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, omhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{orgmembershiphistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + omhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/passwordresettoken.go b/internal/ent/generated/passwordresettoken.go new file mode 100644 index 0000000..c1ab563 --- /dev/null +++ b/internal/ent/generated/passwordresettoken.go @@ -0,0 +1,263 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// PasswordResetToken is the model entity for the PasswordResetToken schema. +type PasswordResetToken struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The user id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the reset token sent to the user via email which should only be provided to the /forgot-password endpoint + handler + Token string `json:"token,omitempty"` + // the ttl of the reset token which defaults to 15 minutes + TTL *time.Time `json:"ttl,omitempty"` + // the email used as input to generate the reset token; this is used to verify that the token when regenerated within the server matches the token emailed + Email string `json:"email,omitempty"` + // the comparison secret to verify the token's signature + Secret *[]byte `json:"secret,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the PasswordResetTokenQuery when eager-loading is set. + Edges PasswordResetTokenEdges `json:"edges"` + selectValues sql.SelectValues +} + +// PasswordResetTokenEdges holds the relations/edges for other nodes in the graph. +type PasswordResetTokenEdges struct { + // Owner holds the value of the owner edge. + Owner *User `json:"owner,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 +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e PasswordResetTokenEdges) OwnerOrErr() (*User, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*PasswordResetToken) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case passwordresettoken.FieldSecret: + values[i] = new([]byte) + case passwordresettoken.FieldID, passwordresettoken.FieldCreatedBy, passwordresettoken.FieldUpdatedBy, passwordresettoken.FieldMappingID, passwordresettoken.FieldDeletedBy, passwordresettoken.FieldOwnerID, passwordresettoken.FieldToken, passwordresettoken.FieldEmail: + values[i] = new(sql.NullString) + case passwordresettoken.FieldCreatedAt, passwordresettoken.FieldUpdatedAt, passwordresettoken.FieldDeletedAt, passwordresettoken.FieldTTL: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the PasswordResetToken fields. +func (prt *PasswordResetToken) 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 passwordresettoken.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + prt.ID = value.String + } + case passwordresettoken.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + prt.CreatedAt = value.Time + } + case passwordresettoken.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + prt.UpdatedAt = value.Time + } + case passwordresettoken.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + prt.CreatedBy = value.String + } + case passwordresettoken.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + prt.UpdatedBy = value.String + } + case passwordresettoken.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + prt.MappingID = value.String + } + case passwordresettoken.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + prt.DeletedAt = value.Time + } + case passwordresettoken.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + prt.DeletedBy = value.String + } + case passwordresettoken.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + prt.OwnerID = value.String + } + case passwordresettoken.FieldToken: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token", values[i]) + } else if value.Valid { + prt.Token = value.String + } + case passwordresettoken.FieldTTL: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field ttl", values[i]) + } else if value.Valid { + prt.TTL = new(time.Time) + *prt.TTL = value.Time + } + case passwordresettoken.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + prt.Email = value.String + } + case passwordresettoken.FieldSecret: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field secret", values[i]) + } else if value != nil { + prt.Secret = value + } + default: + prt.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the PasswordResetToken. +// This includes values selected through modifiers, order, etc. +func (prt *PasswordResetToken) Value(name string) (ent.Value, error) { + return prt.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the PasswordResetToken entity. +func (prt *PasswordResetToken) QueryOwner() *UserQuery { + return NewPasswordResetTokenClient(prt.config).QueryOwner(prt) +} + +// Update returns a builder for updating this PasswordResetToken. +// Note that you need to call PasswordResetToken.Unwrap() before calling this method if this PasswordResetToken +// was returned from a transaction, and the transaction was committed or rolled back. +func (prt *PasswordResetToken) Update() *PasswordResetTokenUpdateOne { + return NewPasswordResetTokenClient(prt.config).UpdateOne(prt) +} + +// Unwrap unwraps the PasswordResetToken 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 (prt *PasswordResetToken) Unwrap() *PasswordResetToken { + _tx, ok := prt.config.driver.(*txDriver) + if !ok { + panic("generated: PasswordResetToken is not a transactional entity") + } + prt.config.driver = _tx.drv + return prt +} + +// String implements the fmt.Stringer. +func (prt *PasswordResetToken) String() string { + var builder strings.Builder + builder.WriteString("PasswordResetToken(") + builder.WriteString(fmt.Sprintf("id=%v, ", prt.ID)) + builder.WriteString("created_at=") + builder.WriteString(prt.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(prt.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(prt.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(prt.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(prt.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(prt.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(prt.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(prt.OwnerID) + builder.WriteString(", ") + builder.WriteString("token=") + builder.WriteString(prt.Token) + builder.WriteString(", ") + if v := prt.TTL; v != nil { + builder.WriteString("ttl=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("email=") + builder.WriteString(prt.Email) + builder.WriteString(", ") + if v := prt.Secret; v != nil { + builder.WriteString("secret=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteByte(')') + return builder.String() +} + +// PasswordResetTokens is a parsable slice of PasswordResetToken. +type PasswordResetTokens []*PasswordResetToken diff --git a/internal/ent/generated/passwordresettoken/passwordresettoken.go b/internal/ent/generated/passwordresettoken/passwordresettoken.go new file mode 100644 index 0000000..d3bb9f9 --- /dev/null +++ b/internal/ent/generated/passwordresettoken/passwordresettoken.go @@ -0,0 +1,184 @@ +// Code generated by ent, DO NOT EDIT. + +package passwordresettoken + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the passwordresettoken type in the database. + Label = "password_reset_token" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldToken holds the string denoting the token field in the database. + FieldToken = "token" + // FieldTTL holds the string denoting the ttl field in the database. + FieldTTL = "ttl" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldSecret holds the string denoting the secret field in the database. + FieldSecret = "secret" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // Table holds the table name of the passwordresettoken in the database. + Table = "password_reset_tokens" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "password_reset_tokens" + // OwnerInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + OwnerInverseTable = "users" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" +) + +// Columns holds all SQL columns for passwordresettoken fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldToken, + FieldTTL, + FieldEmail, + FieldSecret, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // TokenValidator is a validator for the "token" field. It is called by the builders before save. + TokenValidator func(string) error + // EmailValidator is a validator for the "email" field. It is called by the builders before save. + EmailValidator func(string) error + // SecretValidator is a validator for the "secret" field. It is called by the builders before save. + SecretValidator func([]byte) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the PasswordResetToken queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByToken orders the results by the token field. +func ByToken(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldToken, opts...).ToFunc() +} + +// ByTTL orders the results by the ttl field. +func ByTTL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTTL, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} diff --git a/internal/ent/generated/passwordresettoken/where.go b/internal/ent/generated/passwordresettoken/where.go new file mode 100644 index 0000000..f443ff6 --- /dev/null +++ b/internal/ent/generated/passwordresettoken/where.go @@ -0,0 +1,887 @@ +// Code generated by ent, DO NOT EDIT. + +package passwordresettoken + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// Token applies equality check predicate on the "token" field. It's identical to TokenEQ. +func Token(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldToken, v)) +} + +// TTL applies equality check predicate on the "ttl" field. It's identical to TTLEQ. +func TTL(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldTTL, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldEmail, v)) +} + +// Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ. +func Secret(v []byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldSecret, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TokenEQ applies the EQ predicate on the "token" field. +func TokenEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldToken, v)) +} + +// TokenNEQ applies the NEQ predicate on the "token" field. +func TokenNEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldToken, v)) +} + +// TokenIn applies the In predicate on the "token" field. +func TokenIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldToken, vs...)) +} + +// TokenNotIn applies the NotIn predicate on the "token" field. +func TokenNotIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldToken, vs...)) +} + +// TokenGT applies the GT predicate on the "token" field. +func TokenGT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldToken, v)) +} + +// TokenGTE applies the GTE predicate on the "token" field. +func TokenGTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldToken, v)) +} + +// TokenLT applies the LT predicate on the "token" field. +func TokenLT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldToken, v)) +} + +// TokenLTE applies the LTE predicate on the "token" field. +func TokenLTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldToken, v)) +} + +// TokenContains applies the Contains predicate on the "token" field. +func TokenContains(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContains(FieldToken, v)) +} + +// TokenHasPrefix applies the HasPrefix predicate on the "token" field. +func TokenHasPrefix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasPrefix(FieldToken, v)) +} + +// TokenHasSuffix applies the HasSuffix predicate on the "token" field. +func TokenHasSuffix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasSuffix(FieldToken, v)) +} + +// TokenEqualFold applies the EqualFold predicate on the "token" field. +func TokenEqualFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldToken, v)) +} + +// TokenContainsFold applies the ContainsFold predicate on the "token" field. +func TokenContainsFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldToken, v)) +} + +// TTLEQ applies the EQ predicate on the "ttl" field. +func TTLEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldTTL, v)) +} + +// TTLNEQ applies the NEQ predicate on the "ttl" field. +func TTLNEQ(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldTTL, v)) +} + +// TTLIn applies the In predicate on the "ttl" field. +func TTLIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldTTL, vs...)) +} + +// TTLNotIn applies the NotIn predicate on the "ttl" field. +func TTLNotIn(vs ...time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldTTL, vs...)) +} + +// TTLGT applies the GT predicate on the "ttl" field. +func TTLGT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldTTL, v)) +} + +// TTLGTE applies the GTE predicate on the "ttl" field. +func TTLGTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldTTL, v)) +} + +// TTLLT applies the LT predicate on the "ttl" field. +func TTLLT(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldTTL, v)) +} + +// TTLLTE applies the LTE predicate on the "ttl" field. +func TTLLTE(v time.Time) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldTTL, v)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldContainsFold(FieldEmail, v)) +} + +// SecretEQ applies the EQ predicate on the "secret" field. +func SecretEQ(v []byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldEQ(FieldSecret, v)) +} + +// SecretNEQ applies the NEQ predicate on the "secret" field. +func SecretNEQ(v []byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNEQ(FieldSecret, v)) +} + +// SecretIn applies the In predicate on the "secret" field. +func SecretIn(vs ...[]byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldIn(FieldSecret, vs...)) +} + +// SecretNotIn applies the NotIn predicate on the "secret" field. +func SecretNotIn(vs ...[]byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldNotIn(FieldSecret, vs...)) +} + +// SecretGT applies the GT predicate on the "secret" field. +func SecretGT(v []byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGT(FieldSecret, v)) +} + +// SecretGTE applies the GTE predicate on the "secret" field. +func SecretGTE(v []byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldGTE(FieldSecret, v)) +} + +// SecretLT applies the LT predicate on the "secret" field. +func SecretLT(v []byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLT(FieldSecret, v)) +} + +// SecretLTE applies the LTE predicate on the "secret" field. +func SecretLTE(v []byte) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.FieldLTE(FieldSecret, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.PasswordResetToken { + return predicate.PasswordResetToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PasswordResetToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.User) predicate.PasswordResetToken { + return predicate.PasswordResetToken(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PasswordResetToken + 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.PasswordResetToken) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.PasswordResetToken) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.PasswordResetToken) predicate.PasswordResetToken { + return predicate.PasswordResetToken(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/passwordresettoken_create.go b/internal/ent/generated/passwordresettoken_create.go new file mode 100644 index 0000000..f5df26c --- /dev/null +++ b/internal/ent/generated/passwordresettoken_create.go @@ -0,0 +1,460 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// PasswordResetTokenCreate is the builder for creating a PasswordResetToken entity. +type PasswordResetTokenCreate struct { + config + mutation *PasswordResetTokenMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (prtc *PasswordResetTokenCreate) SetCreatedAt(t time.Time) *PasswordResetTokenCreate { + prtc.mutation.SetCreatedAt(t) + return prtc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableCreatedAt(t *time.Time) *PasswordResetTokenCreate { + if t != nil { + prtc.SetCreatedAt(*t) + } + return prtc +} + +// SetUpdatedAt sets the "updated_at" field. +func (prtc *PasswordResetTokenCreate) SetUpdatedAt(t time.Time) *PasswordResetTokenCreate { + prtc.mutation.SetUpdatedAt(t) + return prtc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableUpdatedAt(t *time.Time) *PasswordResetTokenCreate { + if t != nil { + prtc.SetUpdatedAt(*t) + } + return prtc +} + +// SetCreatedBy sets the "created_by" field. +func (prtc *PasswordResetTokenCreate) SetCreatedBy(s string) *PasswordResetTokenCreate { + prtc.mutation.SetCreatedBy(s) + return prtc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableCreatedBy(s *string) *PasswordResetTokenCreate { + if s != nil { + prtc.SetCreatedBy(*s) + } + return prtc +} + +// SetUpdatedBy sets the "updated_by" field. +func (prtc *PasswordResetTokenCreate) SetUpdatedBy(s string) *PasswordResetTokenCreate { + prtc.mutation.SetUpdatedBy(s) + return prtc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableUpdatedBy(s *string) *PasswordResetTokenCreate { + if s != nil { + prtc.SetUpdatedBy(*s) + } + return prtc +} + +// SetMappingID sets the "mapping_id" field. +func (prtc *PasswordResetTokenCreate) SetMappingID(s string) *PasswordResetTokenCreate { + prtc.mutation.SetMappingID(s) + return prtc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableMappingID(s *string) *PasswordResetTokenCreate { + if s != nil { + prtc.SetMappingID(*s) + } + return prtc +} + +// SetDeletedAt sets the "deleted_at" field. +func (prtc *PasswordResetTokenCreate) SetDeletedAt(t time.Time) *PasswordResetTokenCreate { + prtc.mutation.SetDeletedAt(t) + return prtc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableDeletedAt(t *time.Time) *PasswordResetTokenCreate { + if t != nil { + prtc.SetDeletedAt(*t) + } + return prtc +} + +// SetDeletedBy sets the "deleted_by" field. +func (prtc *PasswordResetTokenCreate) SetDeletedBy(s string) *PasswordResetTokenCreate { + prtc.mutation.SetDeletedBy(s) + return prtc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableDeletedBy(s *string) *PasswordResetTokenCreate { + if s != nil { + prtc.SetDeletedBy(*s) + } + return prtc +} + +// SetOwnerID sets the "owner_id" field. +func (prtc *PasswordResetTokenCreate) SetOwnerID(s string) *PasswordResetTokenCreate { + prtc.mutation.SetOwnerID(s) + return prtc +} + +// SetToken sets the "token" field. +func (prtc *PasswordResetTokenCreate) SetToken(s string) *PasswordResetTokenCreate { + prtc.mutation.SetToken(s) + return prtc +} + +// SetTTL sets the "ttl" field. +func (prtc *PasswordResetTokenCreate) SetTTL(t time.Time) *PasswordResetTokenCreate { + prtc.mutation.SetTTL(t) + return prtc +} + +// SetEmail sets the "email" field. +func (prtc *PasswordResetTokenCreate) SetEmail(s string) *PasswordResetTokenCreate { + prtc.mutation.SetEmail(s) + return prtc +} + +// SetSecret sets the "secret" field. +func (prtc *PasswordResetTokenCreate) SetSecret(b []byte) *PasswordResetTokenCreate { + prtc.mutation.SetSecret(b) + return prtc +} + +// SetID sets the "id" field. +func (prtc *PasswordResetTokenCreate) SetID(s string) *PasswordResetTokenCreate { + prtc.mutation.SetID(s) + return prtc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (prtc *PasswordResetTokenCreate) SetNillableID(s *string) *PasswordResetTokenCreate { + if s != nil { + prtc.SetID(*s) + } + return prtc +} + +// SetOwner sets the "owner" edge to the User entity. +func (prtc *PasswordResetTokenCreate) SetOwner(u *User) *PasswordResetTokenCreate { + return prtc.SetOwnerID(u.ID) +} + +// Mutation returns the PasswordResetTokenMutation object of the builder. +func (prtc *PasswordResetTokenCreate) Mutation() *PasswordResetTokenMutation { + return prtc.mutation +} + +// Save creates the PasswordResetToken in the database. +func (prtc *PasswordResetTokenCreate) Save(ctx context.Context) (*PasswordResetToken, error) { + if err := prtc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, prtc.sqlSave, prtc.mutation, prtc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (prtc *PasswordResetTokenCreate) SaveX(ctx context.Context) *PasswordResetToken { + v, err := prtc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (prtc *PasswordResetTokenCreate) Exec(ctx context.Context) error { + _, err := prtc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (prtc *PasswordResetTokenCreate) ExecX(ctx context.Context) { + if err := prtc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (prtc *PasswordResetTokenCreate) defaults() error { + if _, ok := prtc.mutation.CreatedAt(); !ok { + if passwordresettoken.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized passwordresettoken.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := passwordresettoken.DefaultCreatedAt() + prtc.mutation.SetCreatedAt(v) + } + if _, ok := prtc.mutation.UpdatedAt(); !ok { + if passwordresettoken.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized passwordresettoken.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := passwordresettoken.DefaultUpdatedAt() + prtc.mutation.SetUpdatedAt(v) + } + if _, ok := prtc.mutation.MappingID(); !ok { + if passwordresettoken.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized passwordresettoken.DefaultMappingID (forgotten import generated/runtime?)") + } + v := passwordresettoken.DefaultMappingID() + prtc.mutation.SetMappingID(v) + } + if _, ok := prtc.mutation.ID(); !ok { + if passwordresettoken.DefaultID == nil { + return fmt.Errorf("generated: uninitialized passwordresettoken.DefaultID (forgotten import generated/runtime?)") + } + v := passwordresettoken.DefaultID() + prtc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (prtc *PasswordResetTokenCreate) check() error { + if _, ok := prtc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "PasswordResetToken.mapping_id"`)} + } + if _, ok := prtc.mutation.OwnerID(); !ok { + return &ValidationError{Name: "owner_id", err: errors.New(`generated: missing required field "PasswordResetToken.owner_id"`)} + } + if _, ok := prtc.mutation.Token(); !ok { + return &ValidationError{Name: "token", err: errors.New(`generated: missing required field "PasswordResetToken.token"`)} + } + if v, ok := prtc.mutation.Token(); ok { + if err := passwordresettoken.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.token": %w`, err)} + } + } + if _, ok := prtc.mutation.TTL(); !ok { + return &ValidationError{Name: "ttl", err: errors.New(`generated: missing required field "PasswordResetToken.ttl"`)} + } + if _, ok := prtc.mutation.Email(); !ok { + return &ValidationError{Name: "email", err: errors.New(`generated: missing required field "PasswordResetToken.email"`)} + } + if v, ok := prtc.mutation.Email(); ok { + if err := passwordresettoken.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.email": %w`, err)} + } + } + if _, ok := prtc.mutation.Secret(); !ok { + return &ValidationError{Name: "secret", err: errors.New(`generated: missing required field "PasswordResetToken.secret"`)} + } + if v, ok := prtc.mutation.Secret(); ok { + if err := passwordresettoken.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.secret": %w`, err)} + } + } + if len(prtc.mutation.OwnerIDs()) == 0 { + return &ValidationError{Name: "owner", err: errors.New(`generated: missing required edge "PasswordResetToken.owner"`)} + } + return nil +} + +func (prtc *PasswordResetTokenCreate) sqlSave(ctx context.Context) (*PasswordResetToken, error) { + if err := prtc.check(); err != nil { + return nil, err + } + _node, _spec := prtc.createSpec() + if err := sqlgraph.CreateNode(ctx, prtc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected PasswordResetToken.ID type: %T", _spec.ID.Value) + } + } + prtc.mutation.id = &_node.ID + prtc.mutation.done = true + return _node, nil +} + +func (prtc *PasswordResetTokenCreate) createSpec() (*PasswordResetToken, *sqlgraph.CreateSpec) { + var ( + _node = &PasswordResetToken{config: prtc.config} + _spec = sqlgraph.NewCreateSpec(passwordresettoken.Table, sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString)) + ) + _spec.Schema = prtc.schemaConfig.PasswordResetToken + if id, ok := prtc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := prtc.mutation.CreatedAt(); ok { + _spec.SetField(passwordresettoken.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := prtc.mutation.UpdatedAt(); ok { + _spec.SetField(passwordresettoken.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := prtc.mutation.CreatedBy(); ok { + _spec.SetField(passwordresettoken.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := prtc.mutation.UpdatedBy(); ok { + _spec.SetField(passwordresettoken.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := prtc.mutation.MappingID(); ok { + _spec.SetField(passwordresettoken.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := prtc.mutation.DeletedAt(); ok { + _spec.SetField(passwordresettoken.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := prtc.mutation.DeletedBy(); ok { + _spec.SetField(passwordresettoken.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := prtc.mutation.Token(); ok { + _spec.SetField(passwordresettoken.FieldToken, field.TypeString, value) + _node.Token = value + } + if value, ok := prtc.mutation.TTL(); ok { + _spec.SetField(passwordresettoken.FieldTTL, field.TypeTime, value) + _node.TTL = &value + } + if value, ok := prtc.mutation.Email(); ok { + _spec.SetField(passwordresettoken.FieldEmail, field.TypeString, value) + _node.Email = value + } + if value, ok := prtc.mutation.Secret(); ok { + _spec.SetField(passwordresettoken.FieldSecret, field.TypeBytes, value) + _node.Secret = &value + } + if nodes := prtc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: passwordresettoken.OwnerTable, + Columns: []string{passwordresettoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = prtc.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// PasswordResetTokenCreateBulk is the builder for creating many PasswordResetToken entities in bulk. +type PasswordResetTokenCreateBulk struct { + config + err error + builders []*PasswordResetTokenCreate +} + +// Save creates the PasswordResetToken entities in the database. +func (prtcb *PasswordResetTokenCreateBulk) Save(ctx context.Context) ([]*PasswordResetToken, error) { + if prtcb.err != nil { + return nil, prtcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(prtcb.builders)) + nodes := make([]*PasswordResetToken, len(prtcb.builders)) + mutators := make([]Mutator, len(prtcb.builders)) + for i := range prtcb.builders { + func(i int, root context.Context) { + builder := prtcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*PasswordResetTokenMutation) + 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, prtcb.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, prtcb.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, prtcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (prtcb *PasswordResetTokenCreateBulk) SaveX(ctx context.Context) []*PasswordResetToken { + v, err := prtcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (prtcb *PasswordResetTokenCreateBulk) Exec(ctx context.Context) error { + _, err := prtcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (prtcb *PasswordResetTokenCreateBulk) ExecX(ctx context.Context) { + if err := prtcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/passwordresettoken_delete.go b/internal/ent/generated/passwordresettoken_delete.go new file mode 100644 index 0000000..5873b49 --- /dev/null +++ b/internal/ent/generated/passwordresettoken_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" +) + +// PasswordResetTokenDelete is the builder for deleting a PasswordResetToken entity. +type PasswordResetTokenDelete struct { + config + hooks []Hook + mutation *PasswordResetTokenMutation +} + +// Where appends a list predicates to the PasswordResetTokenDelete builder. +func (prtd *PasswordResetTokenDelete) Where(ps ...predicate.PasswordResetToken) *PasswordResetTokenDelete { + prtd.mutation.Where(ps...) + return prtd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (prtd *PasswordResetTokenDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, prtd.sqlExec, prtd.mutation, prtd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (prtd *PasswordResetTokenDelete) ExecX(ctx context.Context) int { + n, err := prtd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (prtd *PasswordResetTokenDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(passwordresettoken.Table, sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString)) + _spec.Node.Schema = prtd.schemaConfig.PasswordResetToken + ctx = internal.NewSchemaConfigContext(ctx, prtd.schemaConfig) + if ps := prtd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, prtd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + prtd.mutation.done = true + return affected, err +} + +// PasswordResetTokenDeleteOne is the builder for deleting a single PasswordResetToken entity. +type PasswordResetTokenDeleteOne struct { + prtd *PasswordResetTokenDelete +} + +// Where appends a list predicates to the PasswordResetTokenDelete builder. +func (prtdo *PasswordResetTokenDeleteOne) Where(ps ...predicate.PasswordResetToken) *PasswordResetTokenDeleteOne { + prtdo.prtd.mutation.Where(ps...) + return prtdo +} + +// Exec executes the deletion query. +func (prtdo *PasswordResetTokenDeleteOne) Exec(ctx context.Context) error { + n, err := prtdo.prtd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{passwordresettoken.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (prtdo *PasswordResetTokenDeleteOne) ExecX(ctx context.Context) { + if err := prtdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/passwordresettoken_query.go b/internal/ent/generated/passwordresettoken_query.go new file mode 100644 index 0000000..7622430 --- /dev/null +++ b/internal/ent/generated/passwordresettoken_query.go @@ -0,0 +1,638 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// PasswordResetTokenQuery is the builder for querying PasswordResetToken entities. +type PasswordResetTokenQuery struct { + config + ctx *QueryContext + order []passwordresettoken.OrderOption + inters []Interceptor + predicates []predicate.PasswordResetToken + withOwner *UserQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*PasswordResetToken) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the PasswordResetTokenQuery builder. +func (prtq *PasswordResetTokenQuery) Where(ps ...predicate.PasswordResetToken) *PasswordResetTokenQuery { + prtq.predicates = append(prtq.predicates, ps...) + return prtq +} + +// Limit the number of records to be returned by this query. +func (prtq *PasswordResetTokenQuery) Limit(limit int) *PasswordResetTokenQuery { + prtq.ctx.Limit = &limit + return prtq +} + +// Offset to start from. +func (prtq *PasswordResetTokenQuery) Offset(offset int) *PasswordResetTokenQuery { + prtq.ctx.Offset = &offset + return prtq +} + +// 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 (prtq *PasswordResetTokenQuery) Unique(unique bool) *PasswordResetTokenQuery { + prtq.ctx.Unique = &unique + return prtq +} + +// Order specifies how the records should be ordered. +func (prtq *PasswordResetTokenQuery) Order(o ...passwordresettoken.OrderOption) *PasswordResetTokenQuery { + prtq.order = append(prtq.order, o...) + return prtq +} + +// QueryOwner chains the current query on the "owner" edge. +func (prtq *PasswordResetTokenQuery) QueryOwner() *UserQuery { + query := (&UserClient{config: prtq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := prtq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := prtq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(passwordresettoken.Table, passwordresettoken.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, passwordresettoken.OwnerTable, passwordresettoken.OwnerColumn), + ) + schemaConfig := prtq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PasswordResetToken + fromU = sqlgraph.SetNeighbors(prtq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first PasswordResetToken entity from the query. +// Returns a *NotFoundError when no PasswordResetToken was found. +func (prtq *PasswordResetTokenQuery) First(ctx context.Context) (*PasswordResetToken, error) { + nodes, err := prtq.Limit(1).All(setContextOp(ctx, prtq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{passwordresettoken.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) FirstX(ctx context.Context) *PasswordResetToken { + node, err := prtq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first PasswordResetToken ID from the query. +// Returns a *NotFoundError when no PasswordResetToken ID was found. +func (prtq *PasswordResetTokenQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = prtq.Limit(1).IDs(setContextOp(ctx, prtq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{passwordresettoken.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) FirstIDX(ctx context.Context) string { + id, err := prtq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single PasswordResetToken entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one PasswordResetToken entity is found. +// Returns a *NotFoundError when no PasswordResetToken entities are found. +func (prtq *PasswordResetTokenQuery) Only(ctx context.Context) (*PasswordResetToken, error) { + nodes, err := prtq.Limit(2).All(setContextOp(ctx, prtq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{passwordresettoken.Label} + default: + return nil, &NotSingularError{passwordresettoken.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) OnlyX(ctx context.Context) *PasswordResetToken { + node, err := prtq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only PasswordResetToken ID in the query. +// Returns a *NotSingularError when more than one PasswordResetToken ID is found. +// Returns a *NotFoundError when no entities are found. +func (prtq *PasswordResetTokenQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = prtq.Limit(2).IDs(setContextOp(ctx, prtq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{passwordresettoken.Label} + default: + err = &NotSingularError{passwordresettoken.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) OnlyIDX(ctx context.Context) string { + id, err := prtq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of PasswordResetTokens. +func (prtq *PasswordResetTokenQuery) All(ctx context.Context) ([]*PasswordResetToken, error) { + ctx = setContextOp(ctx, prtq.ctx, ent.OpQueryAll) + if err := prtq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*PasswordResetToken, *PasswordResetTokenQuery]() + return withInterceptors[[]*PasswordResetToken](ctx, prtq, qr, prtq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) AllX(ctx context.Context) []*PasswordResetToken { + nodes, err := prtq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of PasswordResetToken IDs. +func (prtq *PasswordResetTokenQuery) IDs(ctx context.Context) (ids []string, err error) { + if prtq.ctx.Unique == nil && prtq.path != nil { + prtq.Unique(true) + } + ctx = setContextOp(ctx, prtq.ctx, ent.OpQueryIDs) + if err = prtq.Select(passwordresettoken.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) IDsX(ctx context.Context) []string { + ids, err := prtq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (prtq *PasswordResetTokenQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, prtq.ctx, ent.OpQueryCount) + if err := prtq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, prtq, querierCount[*PasswordResetTokenQuery](), prtq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) CountX(ctx context.Context) int { + count, err := prtq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (prtq *PasswordResetTokenQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, prtq.ctx, ent.OpQueryExist) + switch _, err := prtq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (prtq *PasswordResetTokenQuery) ExistX(ctx context.Context) bool { + exist, err := prtq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the PasswordResetTokenQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (prtq *PasswordResetTokenQuery) Clone() *PasswordResetTokenQuery { + if prtq == nil { + return nil + } + return &PasswordResetTokenQuery{ + config: prtq.config, + ctx: prtq.ctx.Clone(), + order: append([]passwordresettoken.OrderOption{}, prtq.order...), + inters: append([]Interceptor{}, prtq.inters...), + predicates: append([]predicate.PasswordResetToken{}, prtq.predicates...), + withOwner: prtq.withOwner.Clone(), + // clone intermediate query. + sql: prtq.sql.Clone(), + path: prtq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (prtq *PasswordResetTokenQuery) WithOwner(opts ...func(*UserQuery)) *PasswordResetTokenQuery { + query := (&UserClient{config: prtq.config}).Query() + for _, opt := range opts { + opt(query) + } + prtq.withOwner = query + return prtq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.PasswordResetToken.Query(). +// GroupBy(passwordresettoken.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (prtq *PasswordResetTokenQuery) GroupBy(field string, fields ...string) *PasswordResetTokenGroupBy { + prtq.ctx.Fields = append([]string{field}, fields...) + grbuild := &PasswordResetTokenGroupBy{build: prtq} + grbuild.flds = &prtq.ctx.Fields + grbuild.label = passwordresettoken.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.PasswordResetToken.Query(). +// Select(passwordresettoken.FieldCreatedAt). +// Scan(ctx, &v) +func (prtq *PasswordResetTokenQuery) Select(fields ...string) *PasswordResetTokenSelect { + prtq.ctx.Fields = append(prtq.ctx.Fields, fields...) + sbuild := &PasswordResetTokenSelect{PasswordResetTokenQuery: prtq} + sbuild.label = passwordresettoken.Label + sbuild.flds, sbuild.scan = &prtq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a PasswordResetTokenSelect configured with the given aggregations. +func (prtq *PasswordResetTokenQuery) Aggregate(fns ...AggregateFunc) *PasswordResetTokenSelect { + return prtq.Select().Aggregate(fns...) +} + +func (prtq *PasswordResetTokenQuery) prepareQuery(ctx context.Context) error { + for _, inter := range prtq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, prtq); err != nil { + return err + } + } + } + for _, f := range prtq.ctx.Fields { + if !passwordresettoken.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if prtq.path != nil { + prev, err := prtq.path(ctx) + if err != nil { + return err + } + prtq.sql = prev + } + if passwordresettoken.Policy == nil { + return errors.New("generated: uninitialized passwordresettoken.Policy (forgotten import generated/runtime?)") + } + if err := passwordresettoken.Policy.EvalQuery(ctx, prtq); err != nil { + return err + } + return nil +} + +func (prtq *PasswordResetTokenQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*PasswordResetToken, error) { + var ( + nodes = []*PasswordResetToken{} + _spec = prtq.querySpec() + loadedTypes = [1]bool{ + prtq.withOwner != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*PasswordResetToken).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &PasswordResetToken{config: prtq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = prtq.schemaConfig.PasswordResetToken + ctx = internal.NewSchemaConfigContext(ctx, prtq.schemaConfig) + if len(prtq.modifiers) > 0 { + _spec.Modifiers = prtq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, prtq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := prtq.withOwner; query != nil { + if err := prtq.loadOwner(ctx, query, nodes, nil, + func(n *PasswordResetToken, e *User) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + for i := range prtq.loadTotal { + if err := prtq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (prtq *PasswordResetTokenQuery) loadOwner(ctx context.Context, query *UserQuery, nodes []*PasswordResetToken, init func(*PasswordResetToken), assign func(*PasswordResetToken, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*PasswordResetToken) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (prtq *PasswordResetTokenQuery) sqlCount(ctx context.Context) (int, error) { + _spec := prtq.querySpec() + _spec.Node.Schema = prtq.schemaConfig.PasswordResetToken + ctx = internal.NewSchemaConfigContext(ctx, prtq.schemaConfig) + if len(prtq.modifiers) > 0 { + _spec.Modifiers = prtq.modifiers + } + _spec.Node.Columns = prtq.ctx.Fields + if len(prtq.ctx.Fields) > 0 { + _spec.Unique = prtq.ctx.Unique != nil && *prtq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, prtq.driver, _spec) +} + +func (prtq *PasswordResetTokenQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(passwordresettoken.Table, passwordresettoken.Columns, sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString)) + _spec.From = prtq.sql + if unique := prtq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if prtq.path != nil { + _spec.Unique = true + } + if fields := prtq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, passwordresettoken.FieldID) + for i := range fields { + if fields[i] != passwordresettoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if prtq.withOwner != nil { + _spec.Node.AddColumnOnce(passwordresettoken.FieldOwnerID) + } + } + if ps := prtq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := prtq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := prtq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := prtq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (prtq *PasswordResetTokenQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(prtq.driver.Dialect()) + t1 := builder.Table(passwordresettoken.Table) + columns := prtq.ctx.Fields + if len(columns) == 0 { + columns = passwordresettoken.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if prtq.sql != nil { + selector = prtq.sql + selector.Select(selector.Columns(columns...)...) + } + if prtq.ctx.Unique != nil && *prtq.ctx.Unique { + selector.Distinct() + } + t1.Schema(prtq.schemaConfig.PasswordResetToken) + ctx = internal.NewSchemaConfigContext(ctx, prtq.schemaConfig) + selector.WithContext(ctx) + for _, p := range prtq.predicates { + p(selector) + } + for _, p := range prtq.order { + p(selector) + } + if offset := prtq.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 := prtq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// PasswordResetTokenGroupBy is the group-by builder for PasswordResetToken entities. +type PasswordResetTokenGroupBy struct { + selector + build *PasswordResetTokenQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (prtgb *PasswordResetTokenGroupBy) Aggregate(fns ...AggregateFunc) *PasswordResetTokenGroupBy { + prtgb.fns = append(prtgb.fns, fns...) + return prtgb +} + +// Scan applies the selector query and scans the result into the given value. +func (prtgb *PasswordResetTokenGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, prtgb.build.ctx, ent.OpQueryGroupBy) + if err := prtgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*PasswordResetTokenQuery, *PasswordResetTokenGroupBy](ctx, prtgb.build, prtgb, prtgb.build.inters, v) +} + +func (prtgb *PasswordResetTokenGroupBy) sqlScan(ctx context.Context, root *PasswordResetTokenQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(prtgb.fns)) + for _, fn := range prtgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*prtgb.flds)+len(prtgb.fns)) + for _, f := range *prtgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*prtgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := prtgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// PasswordResetTokenSelect is the builder for selecting fields of PasswordResetToken entities. +type PasswordResetTokenSelect struct { + *PasswordResetTokenQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (prts *PasswordResetTokenSelect) Aggregate(fns ...AggregateFunc) *PasswordResetTokenSelect { + prts.fns = append(prts.fns, fns...) + return prts +} + +// Scan applies the selector query and scans the result into the given value. +func (prts *PasswordResetTokenSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, prts.ctx, ent.OpQuerySelect) + if err := prts.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*PasswordResetTokenQuery, *PasswordResetTokenSelect](ctx, prts.PasswordResetTokenQuery, prts, prts.inters, v) +} + +func (prts *PasswordResetTokenSelect) sqlScan(ctx context.Context, root *PasswordResetTokenQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(prts.fns)) + for _, fn := range prts.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*prts.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 := prts.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/passwordresettoken_update.go b/internal/ent/generated/passwordresettoken_update.go new file mode 100644 index 0000000..d6afcdf --- /dev/null +++ b/internal/ent/generated/passwordresettoken_update.go @@ -0,0 +1,701 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// PasswordResetTokenUpdate is the builder for updating PasswordResetToken entities. +type PasswordResetTokenUpdate struct { + config + hooks []Hook + mutation *PasswordResetTokenMutation +} + +// Where appends a list predicates to the PasswordResetTokenUpdate builder. +func (prtu *PasswordResetTokenUpdate) Where(ps ...predicate.PasswordResetToken) *PasswordResetTokenUpdate { + prtu.mutation.Where(ps...) + return prtu +} + +// SetUpdatedAt sets the "updated_at" field. +func (prtu *PasswordResetTokenUpdate) SetUpdatedAt(t time.Time) *PasswordResetTokenUpdate { + prtu.mutation.SetUpdatedAt(t) + return prtu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (prtu *PasswordResetTokenUpdate) ClearUpdatedAt() *PasswordResetTokenUpdate { + prtu.mutation.ClearUpdatedAt() + return prtu +} + +// SetUpdatedBy sets the "updated_by" field. +func (prtu *PasswordResetTokenUpdate) SetUpdatedBy(s string) *PasswordResetTokenUpdate { + prtu.mutation.SetUpdatedBy(s) + return prtu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (prtu *PasswordResetTokenUpdate) SetNillableUpdatedBy(s *string) *PasswordResetTokenUpdate { + if s != nil { + prtu.SetUpdatedBy(*s) + } + return prtu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (prtu *PasswordResetTokenUpdate) ClearUpdatedBy() *PasswordResetTokenUpdate { + prtu.mutation.ClearUpdatedBy() + return prtu +} + +// SetDeletedAt sets the "deleted_at" field. +func (prtu *PasswordResetTokenUpdate) SetDeletedAt(t time.Time) *PasswordResetTokenUpdate { + prtu.mutation.SetDeletedAt(t) + return prtu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (prtu *PasswordResetTokenUpdate) SetNillableDeletedAt(t *time.Time) *PasswordResetTokenUpdate { + if t != nil { + prtu.SetDeletedAt(*t) + } + return prtu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (prtu *PasswordResetTokenUpdate) ClearDeletedAt() *PasswordResetTokenUpdate { + prtu.mutation.ClearDeletedAt() + return prtu +} + +// SetDeletedBy sets the "deleted_by" field. +func (prtu *PasswordResetTokenUpdate) SetDeletedBy(s string) *PasswordResetTokenUpdate { + prtu.mutation.SetDeletedBy(s) + return prtu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (prtu *PasswordResetTokenUpdate) SetNillableDeletedBy(s *string) *PasswordResetTokenUpdate { + if s != nil { + prtu.SetDeletedBy(*s) + } + return prtu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (prtu *PasswordResetTokenUpdate) ClearDeletedBy() *PasswordResetTokenUpdate { + prtu.mutation.ClearDeletedBy() + return prtu +} + +// SetOwnerID sets the "owner_id" field. +func (prtu *PasswordResetTokenUpdate) SetOwnerID(s string) *PasswordResetTokenUpdate { + prtu.mutation.SetOwnerID(s) + return prtu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (prtu *PasswordResetTokenUpdate) SetNillableOwnerID(s *string) *PasswordResetTokenUpdate { + if s != nil { + prtu.SetOwnerID(*s) + } + return prtu +} + +// SetToken sets the "token" field. +func (prtu *PasswordResetTokenUpdate) SetToken(s string) *PasswordResetTokenUpdate { + prtu.mutation.SetToken(s) + return prtu +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (prtu *PasswordResetTokenUpdate) SetNillableToken(s *string) *PasswordResetTokenUpdate { + if s != nil { + prtu.SetToken(*s) + } + return prtu +} + +// SetTTL sets the "ttl" field. +func (prtu *PasswordResetTokenUpdate) SetTTL(t time.Time) *PasswordResetTokenUpdate { + prtu.mutation.SetTTL(t) + return prtu +} + +// SetNillableTTL sets the "ttl" field if the given value is not nil. +func (prtu *PasswordResetTokenUpdate) SetNillableTTL(t *time.Time) *PasswordResetTokenUpdate { + if t != nil { + prtu.SetTTL(*t) + } + return prtu +} + +// SetEmail sets the "email" field. +func (prtu *PasswordResetTokenUpdate) SetEmail(s string) *PasswordResetTokenUpdate { + prtu.mutation.SetEmail(s) + return prtu +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (prtu *PasswordResetTokenUpdate) SetNillableEmail(s *string) *PasswordResetTokenUpdate { + if s != nil { + prtu.SetEmail(*s) + } + return prtu +} + +// SetSecret sets the "secret" field. +func (prtu *PasswordResetTokenUpdate) SetSecret(b []byte) *PasswordResetTokenUpdate { + prtu.mutation.SetSecret(b) + return prtu +} + +// SetOwner sets the "owner" edge to the User entity. +func (prtu *PasswordResetTokenUpdate) SetOwner(u *User) *PasswordResetTokenUpdate { + return prtu.SetOwnerID(u.ID) +} + +// Mutation returns the PasswordResetTokenMutation object of the builder. +func (prtu *PasswordResetTokenUpdate) Mutation() *PasswordResetTokenMutation { + return prtu.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (prtu *PasswordResetTokenUpdate) ClearOwner() *PasswordResetTokenUpdate { + prtu.mutation.ClearOwner() + return prtu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (prtu *PasswordResetTokenUpdate) Save(ctx context.Context) (int, error) { + if err := prtu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, prtu.sqlSave, prtu.mutation, prtu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (prtu *PasswordResetTokenUpdate) SaveX(ctx context.Context) int { + affected, err := prtu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (prtu *PasswordResetTokenUpdate) Exec(ctx context.Context) error { + _, err := prtu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (prtu *PasswordResetTokenUpdate) ExecX(ctx context.Context) { + if err := prtu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (prtu *PasswordResetTokenUpdate) defaults() error { + if _, ok := prtu.mutation.UpdatedAt(); !ok && !prtu.mutation.UpdatedAtCleared() { + if passwordresettoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized passwordresettoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := passwordresettoken.UpdateDefaultUpdatedAt() + prtu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (prtu *PasswordResetTokenUpdate) check() error { + if v, ok := prtu.mutation.Token(); ok { + if err := passwordresettoken.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.token": %w`, err)} + } + } + if v, ok := prtu.mutation.Email(); ok { + if err := passwordresettoken.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.email": %w`, err)} + } + } + if v, ok := prtu.mutation.Secret(); ok { + if err := passwordresettoken.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.secret": %w`, err)} + } + } + if prtu.mutation.OwnerCleared() && len(prtu.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "PasswordResetToken.owner"`) + } + return nil +} + +func (prtu *PasswordResetTokenUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := prtu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(passwordresettoken.Table, passwordresettoken.Columns, sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString)) + if ps := prtu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if prtu.mutation.CreatedAtCleared() { + _spec.ClearField(passwordresettoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := prtu.mutation.UpdatedAt(); ok { + _spec.SetField(passwordresettoken.FieldUpdatedAt, field.TypeTime, value) + } + if prtu.mutation.UpdatedAtCleared() { + _spec.ClearField(passwordresettoken.FieldUpdatedAt, field.TypeTime) + } + if prtu.mutation.CreatedByCleared() { + _spec.ClearField(passwordresettoken.FieldCreatedBy, field.TypeString) + } + if value, ok := prtu.mutation.UpdatedBy(); ok { + _spec.SetField(passwordresettoken.FieldUpdatedBy, field.TypeString, value) + } + if prtu.mutation.UpdatedByCleared() { + _spec.ClearField(passwordresettoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := prtu.mutation.DeletedAt(); ok { + _spec.SetField(passwordresettoken.FieldDeletedAt, field.TypeTime, value) + } + if prtu.mutation.DeletedAtCleared() { + _spec.ClearField(passwordresettoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := prtu.mutation.DeletedBy(); ok { + _spec.SetField(passwordresettoken.FieldDeletedBy, field.TypeString, value) + } + if prtu.mutation.DeletedByCleared() { + _spec.ClearField(passwordresettoken.FieldDeletedBy, field.TypeString) + } + if value, ok := prtu.mutation.Token(); ok { + _spec.SetField(passwordresettoken.FieldToken, field.TypeString, value) + } + if value, ok := prtu.mutation.TTL(); ok { + _spec.SetField(passwordresettoken.FieldTTL, field.TypeTime, value) + } + if value, ok := prtu.mutation.Email(); ok { + _spec.SetField(passwordresettoken.FieldEmail, field.TypeString, value) + } + if value, ok := prtu.mutation.Secret(); ok { + _spec.SetField(passwordresettoken.FieldSecret, field.TypeBytes, value) + } + if prtu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: passwordresettoken.OwnerTable, + Columns: []string{passwordresettoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = prtu.schemaConfig.PasswordResetToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := prtu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: passwordresettoken.OwnerTable, + Columns: []string{passwordresettoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = prtu.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = prtu.schemaConfig.PasswordResetToken + ctx = internal.NewSchemaConfigContext(ctx, prtu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, prtu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{passwordresettoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + prtu.mutation.done = true + return n, nil +} + +// PasswordResetTokenUpdateOne is the builder for updating a single PasswordResetToken entity. +type PasswordResetTokenUpdateOne struct { + config + fields []string + hooks []Hook + mutation *PasswordResetTokenMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (prtuo *PasswordResetTokenUpdateOne) SetUpdatedAt(t time.Time) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetUpdatedAt(t) + return prtuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (prtuo *PasswordResetTokenUpdateOne) ClearUpdatedAt() *PasswordResetTokenUpdateOne { + prtuo.mutation.ClearUpdatedAt() + return prtuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (prtuo *PasswordResetTokenUpdateOne) SetUpdatedBy(s string) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetUpdatedBy(s) + return prtuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (prtuo *PasswordResetTokenUpdateOne) SetNillableUpdatedBy(s *string) *PasswordResetTokenUpdateOne { + if s != nil { + prtuo.SetUpdatedBy(*s) + } + return prtuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (prtuo *PasswordResetTokenUpdateOne) ClearUpdatedBy() *PasswordResetTokenUpdateOne { + prtuo.mutation.ClearUpdatedBy() + return prtuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (prtuo *PasswordResetTokenUpdateOne) SetDeletedAt(t time.Time) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetDeletedAt(t) + return prtuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (prtuo *PasswordResetTokenUpdateOne) SetNillableDeletedAt(t *time.Time) *PasswordResetTokenUpdateOne { + if t != nil { + prtuo.SetDeletedAt(*t) + } + return prtuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (prtuo *PasswordResetTokenUpdateOne) ClearDeletedAt() *PasswordResetTokenUpdateOne { + prtuo.mutation.ClearDeletedAt() + return prtuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (prtuo *PasswordResetTokenUpdateOne) SetDeletedBy(s string) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetDeletedBy(s) + return prtuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (prtuo *PasswordResetTokenUpdateOne) SetNillableDeletedBy(s *string) *PasswordResetTokenUpdateOne { + if s != nil { + prtuo.SetDeletedBy(*s) + } + return prtuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (prtuo *PasswordResetTokenUpdateOne) ClearDeletedBy() *PasswordResetTokenUpdateOne { + prtuo.mutation.ClearDeletedBy() + return prtuo +} + +// SetOwnerID sets the "owner_id" field. +func (prtuo *PasswordResetTokenUpdateOne) SetOwnerID(s string) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetOwnerID(s) + return prtuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (prtuo *PasswordResetTokenUpdateOne) SetNillableOwnerID(s *string) *PasswordResetTokenUpdateOne { + if s != nil { + prtuo.SetOwnerID(*s) + } + return prtuo +} + +// SetToken sets the "token" field. +func (prtuo *PasswordResetTokenUpdateOne) SetToken(s string) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetToken(s) + return prtuo +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (prtuo *PasswordResetTokenUpdateOne) SetNillableToken(s *string) *PasswordResetTokenUpdateOne { + if s != nil { + prtuo.SetToken(*s) + } + return prtuo +} + +// SetTTL sets the "ttl" field. +func (prtuo *PasswordResetTokenUpdateOne) SetTTL(t time.Time) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetTTL(t) + return prtuo +} + +// SetNillableTTL sets the "ttl" field if the given value is not nil. +func (prtuo *PasswordResetTokenUpdateOne) SetNillableTTL(t *time.Time) *PasswordResetTokenUpdateOne { + if t != nil { + prtuo.SetTTL(*t) + } + return prtuo +} + +// SetEmail sets the "email" field. +func (prtuo *PasswordResetTokenUpdateOne) SetEmail(s string) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetEmail(s) + return prtuo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (prtuo *PasswordResetTokenUpdateOne) SetNillableEmail(s *string) *PasswordResetTokenUpdateOne { + if s != nil { + prtuo.SetEmail(*s) + } + return prtuo +} + +// SetSecret sets the "secret" field. +func (prtuo *PasswordResetTokenUpdateOne) SetSecret(b []byte) *PasswordResetTokenUpdateOne { + prtuo.mutation.SetSecret(b) + return prtuo +} + +// SetOwner sets the "owner" edge to the User entity. +func (prtuo *PasswordResetTokenUpdateOne) SetOwner(u *User) *PasswordResetTokenUpdateOne { + return prtuo.SetOwnerID(u.ID) +} + +// Mutation returns the PasswordResetTokenMutation object of the builder. +func (prtuo *PasswordResetTokenUpdateOne) Mutation() *PasswordResetTokenMutation { + return prtuo.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (prtuo *PasswordResetTokenUpdateOne) ClearOwner() *PasswordResetTokenUpdateOne { + prtuo.mutation.ClearOwner() + return prtuo +} + +// Where appends a list predicates to the PasswordResetTokenUpdate builder. +func (prtuo *PasswordResetTokenUpdateOne) Where(ps ...predicate.PasswordResetToken) *PasswordResetTokenUpdateOne { + prtuo.mutation.Where(ps...) + return prtuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (prtuo *PasswordResetTokenUpdateOne) Select(field string, fields ...string) *PasswordResetTokenUpdateOne { + prtuo.fields = append([]string{field}, fields...) + return prtuo +} + +// Save executes the query and returns the updated PasswordResetToken entity. +func (prtuo *PasswordResetTokenUpdateOne) Save(ctx context.Context) (*PasswordResetToken, error) { + if err := prtuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, prtuo.sqlSave, prtuo.mutation, prtuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (prtuo *PasswordResetTokenUpdateOne) SaveX(ctx context.Context) *PasswordResetToken { + node, err := prtuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (prtuo *PasswordResetTokenUpdateOne) Exec(ctx context.Context) error { + _, err := prtuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (prtuo *PasswordResetTokenUpdateOne) ExecX(ctx context.Context) { + if err := prtuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (prtuo *PasswordResetTokenUpdateOne) defaults() error { + if _, ok := prtuo.mutation.UpdatedAt(); !ok && !prtuo.mutation.UpdatedAtCleared() { + if passwordresettoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized passwordresettoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := passwordresettoken.UpdateDefaultUpdatedAt() + prtuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (prtuo *PasswordResetTokenUpdateOne) check() error { + if v, ok := prtuo.mutation.Token(); ok { + if err := passwordresettoken.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.token": %w`, err)} + } + } + if v, ok := prtuo.mutation.Email(); ok { + if err := passwordresettoken.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.email": %w`, err)} + } + } + if v, ok := prtuo.mutation.Secret(); ok { + if err := passwordresettoken.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "PasswordResetToken.secret": %w`, err)} + } + } + if prtuo.mutation.OwnerCleared() && len(prtuo.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "PasswordResetToken.owner"`) + } + return nil +} + +func (prtuo *PasswordResetTokenUpdateOne) sqlSave(ctx context.Context) (_node *PasswordResetToken, err error) { + if err := prtuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(passwordresettoken.Table, passwordresettoken.Columns, sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString)) + id, ok := prtuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "PasswordResetToken.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := prtuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, passwordresettoken.FieldID) + for _, f := range fields { + if !passwordresettoken.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != passwordresettoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := prtuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if prtuo.mutation.CreatedAtCleared() { + _spec.ClearField(passwordresettoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := prtuo.mutation.UpdatedAt(); ok { + _spec.SetField(passwordresettoken.FieldUpdatedAt, field.TypeTime, value) + } + if prtuo.mutation.UpdatedAtCleared() { + _spec.ClearField(passwordresettoken.FieldUpdatedAt, field.TypeTime) + } + if prtuo.mutation.CreatedByCleared() { + _spec.ClearField(passwordresettoken.FieldCreatedBy, field.TypeString) + } + if value, ok := prtuo.mutation.UpdatedBy(); ok { + _spec.SetField(passwordresettoken.FieldUpdatedBy, field.TypeString, value) + } + if prtuo.mutation.UpdatedByCleared() { + _spec.ClearField(passwordresettoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := prtuo.mutation.DeletedAt(); ok { + _spec.SetField(passwordresettoken.FieldDeletedAt, field.TypeTime, value) + } + if prtuo.mutation.DeletedAtCleared() { + _spec.ClearField(passwordresettoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := prtuo.mutation.DeletedBy(); ok { + _spec.SetField(passwordresettoken.FieldDeletedBy, field.TypeString, value) + } + if prtuo.mutation.DeletedByCleared() { + _spec.ClearField(passwordresettoken.FieldDeletedBy, field.TypeString) + } + if value, ok := prtuo.mutation.Token(); ok { + _spec.SetField(passwordresettoken.FieldToken, field.TypeString, value) + } + if value, ok := prtuo.mutation.TTL(); ok { + _spec.SetField(passwordresettoken.FieldTTL, field.TypeTime, value) + } + if value, ok := prtuo.mutation.Email(); ok { + _spec.SetField(passwordresettoken.FieldEmail, field.TypeString, value) + } + if value, ok := prtuo.mutation.Secret(); ok { + _spec.SetField(passwordresettoken.FieldSecret, field.TypeBytes, value) + } + if prtuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: passwordresettoken.OwnerTable, + Columns: []string{passwordresettoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = prtuo.schemaConfig.PasswordResetToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := prtuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: passwordresettoken.OwnerTable, + Columns: []string{passwordresettoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = prtuo.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = prtuo.schemaConfig.PasswordResetToken + ctx = internal.NewSchemaConfigContext(ctx, prtuo.schemaConfig) + _node = &PasswordResetToken{config: prtuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, prtuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{passwordresettoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + prtuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/personalaccesstoken.go b/internal/ent/generated/personalaccesstoken.go new file mode 100644 index 0000000..29693fd --- /dev/null +++ b/internal/ent/generated/personalaccesstoken.go @@ -0,0 +1,388 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// PersonalAccessToken is the model entity for the PersonalAccessToken schema. +type PersonalAccessToken struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The user id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name associated with the token + Name string `json:"name,omitempty"` + // Token holds the value of the "token" field. + Token string `json:"token,omitempty"` + // when the token expires + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + // Scopes holds the value of the "scopes" field. + Scopes []string `json:"scopes,omitempty"` + // LastUsedAt holds the value of the "last_used_at" field. + LastUsedAt *time.Time `json:"last_used_at,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the PersonalAccessTokenQuery when eager-loading is set. + Edges PersonalAccessTokenEdges `json:"edges"` + selectValues sql.SelectValues +} + +// PersonalAccessTokenEdges holds the relations/edges for other nodes in the graph. +type PersonalAccessTokenEdges struct { + // Owner holds the value of the owner edge. + Owner *User `json:"owner,omitempty"` + // the organization(s) the token is associated with + Organizations []*Organization `json:"organizations,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [3]bool + // totalCount holds the count of the edges above. + totalCount [3]map[string]int + + namedOrganizations map[string][]*Organization + namedEvents map[string][]*Event +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e PersonalAccessTokenEdges) OwnerOrErr() (*User, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// OrganizationsOrErr returns the Organizations value or an error if the edge +// was not loaded in eager-loading. +func (e PersonalAccessTokenEdges) OrganizationsOrErr() ([]*Organization, error) { + if e.loadedTypes[1] { + return e.Organizations, nil + } + return nil, &NotLoadedError{edge: "organizations"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e PersonalAccessTokenEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[2] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*PersonalAccessToken) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case personalaccesstoken.FieldTags, personalaccesstoken.FieldScopes: + values[i] = new([]byte) + case personalaccesstoken.FieldID, personalaccesstoken.FieldCreatedBy, personalaccesstoken.FieldUpdatedBy, personalaccesstoken.FieldDeletedBy, personalaccesstoken.FieldMappingID, personalaccesstoken.FieldOwnerID, personalaccesstoken.FieldName, personalaccesstoken.FieldToken, personalaccesstoken.FieldDescription: + values[i] = new(sql.NullString) + case personalaccesstoken.FieldCreatedAt, personalaccesstoken.FieldUpdatedAt, personalaccesstoken.FieldDeletedAt, personalaccesstoken.FieldExpiresAt, personalaccesstoken.FieldLastUsedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the PersonalAccessToken fields. +func (pat *PersonalAccessToken) 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 personalaccesstoken.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + pat.ID = value.String + } + case personalaccesstoken.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + pat.CreatedAt = value.Time + } + case personalaccesstoken.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + pat.UpdatedAt = value.Time + } + case personalaccesstoken.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + pat.CreatedBy = value.String + } + case personalaccesstoken.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + pat.UpdatedBy = value.String + } + case personalaccesstoken.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + pat.DeletedAt = value.Time + } + case personalaccesstoken.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + pat.DeletedBy = value.String + } + case personalaccesstoken.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + pat.MappingID = value.String + } + case personalaccesstoken.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &pat.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case personalaccesstoken.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + pat.OwnerID = value.String + } + case personalaccesstoken.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + pat.Name = value.String + } + case personalaccesstoken.FieldToken: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token", values[i]) + } else if value.Valid { + pat.Token = value.String + } + case personalaccesstoken.FieldExpiresAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field expires_at", values[i]) + } else if value.Valid { + pat.ExpiresAt = new(time.Time) + *pat.ExpiresAt = value.Time + } + case personalaccesstoken.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + pat.Description = new(string) + *pat.Description = value.String + } + case personalaccesstoken.FieldScopes: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field scopes", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &pat.Scopes); err != nil { + return fmt.Errorf("unmarshal field scopes: %w", err) + } + } + case personalaccesstoken.FieldLastUsedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field last_used_at", values[i]) + } else if value.Valid { + pat.LastUsedAt = new(time.Time) + *pat.LastUsedAt = value.Time + } + default: + pat.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the PersonalAccessToken. +// This includes values selected through modifiers, order, etc. +func (pat *PersonalAccessToken) Value(name string) (ent.Value, error) { + return pat.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the PersonalAccessToken entity. +func (pat *PersonalAccessToken) QueryOwner() *UserQuery { + return NewPersonalAccessTokenClient(pat.config).QueryOwner(pat) +} + +// QueryOrganizations queries the "organizations" edge of the PersonalAccessToken entity. +func (pat *PersonalAccessToken) QueryOrganizations() *OrganizationQuery { + return NewPersonalAccessTokenClient(pat.config).QueryOrganizations(pat) +} + +// QueryEvents queries the "events" edge of the PersonalAccessToken entity. +func (pat *PersonalAccessToken) QueryEvents() *EventQuery { + return NewPersonalAccessTokenClient(pat.config).QueryEvents(pat) +} + +// Update returns a builder for updating this PersonalAccessToken. +// Note that you need to call PersonalAccessToken.Unwrap() before calling this method if this PersonalAccessToken +// was returned from a transaction, and the transaction was committed or rolled back. +func (pat *PersonalAccessToken) Update() *PersonalAccessTokenUpdateOne { + return NewPersonalAccessTokenClient(pat.config).UpdateOne(pat) +} + +// Unwrap unwraps the PersonalAccessToken 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 (pat *PersonalAccessToken) Unwrap() *PersonalAccessToken { + _tx, ok := pat.config.driver.(*txDriver) + if !ok { + panic("generated: PersonalAccessToken is not a transactional entity") + } + pat.config.driver = _tx.drv + return pat +} + +// String implements the fmt.Stringer. +func (pat *PersonalAccessToken) String() string { + var builder strings.Builder + builder.WriteString("PersonalAccessToken(") + builder.WriteString(fmt.Sprintf("id=%v, ", pat.ID)) + builder.WriteString("created_at=") + builder.WriteString(pat.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(pat.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(pat.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(pat.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(pat.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(pat.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(pat.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", pat.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(pat.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(pat.Name) + builder.WriteString(", ") + builder.WriteString("token=") + builder.WriteString(pat.Token) + builder.WriteString(", ") + if v := pat.ExpiresAt; v != nil { + builder.WriteString("expires_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := pat.Description; v != nil { + builder.WriteString("description=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("scopes=") + builder.WriteString(fmt.Sprintf("%v", pat.Scopes)) + builder.WriteString(", ") + if v := pat.LastUsedAt; v != nil { + builder.WriteString("last_used_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteByte(')') + return builder.String() +} + +// NamedOrganizations returns the Organizations named value or an error if the edge was not +// loaded in eager-loading with this name. +func (pat *PersonalAccessToken) NamedOrganizations(name string) ([]*Organization, error) { + if pat.Edges.namedOrganizations == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := pat.Edges.namedOrganizations[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (pat *PersonalAccessToken) appendNamedOrganizations(name string, edges ...*Organization) { + if pat.Edges.namedOrganizations == nil { + pat.Edges.namedOrganizations = make(map[string][]*Organization) + } + if len(edges) == 0 { + pat.Edges.namedOrganizations[name] = []*Organization{} + } else { + pat.Edges.namedOrganizations[name] = append(pat.Edges.namedOrganizations[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (pat *PersonalAccessToken) NamedEvents(name string) ([]*Event, error) { + if pat.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := pat.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (pat *PersonalAccessToken) appendNamedEvents(name string, edges ...*Event) { + if pat.Edges.namedEvents == nil { + pat.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + pat.Edges.namedEvents[name] = []*Event{} + } else { + pat.Edges.namedEvents[name] = append(pat.Edges.namedEvents[name], edges...) + } +} + +// PersonalAccessTokens is a parsable slice of PersonalAccessToken. +type PersonalAccessTokens []*PersonalAccessToken diff --git a/internal/ent/generated/personalaccesstoken/personalaccesstoken.go b/internal/ent/generated/personalaccesstoken/personalaccesstoken.go new file mode 100644 index 0000000..ad7295c --- /dev/null +++ b/internal/ent/generated/personalaccesstoken/personalaccesstoken.go @@ -0,0 +1,268 @@ +// Code generated by ent, DO NOT EDIT. + +package personalaccesstoken + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the personalaccesstoken type in the database. + Label = "personal_access_token" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldToken holds the string denoting the token field in the database. + FieldToken = "token" + // FieldExpiresAt holds the string denoting the expires_at field in the database. + FieldExpiresAt = "expires_at" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldScopes holds the string denoting the scopes field in the database. + FieldScopes = "scopes" + // FieldLastUsedAt holds the string denoting the last_used_at field in the database. + FieldLastUsedAt = "last_used_at" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeOrganizations holds the string denoting the organizations edge name in mutations. + EdgeOrganizations = "organizations" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the personalaccesstoken in the database. + Table = "personal_access_tokens" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "personal_access_tokens" + // OwnerInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + OwnerInverseTable = "users" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // OrganizationsTable is the table that holds the organizations relation/edge. The primary key declared below. + OrganizationsTable = "organization_personal_access_tokens" + // OrganizationsInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationsInverseTable = "organizations" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "personal_access_token_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for personalaccesstoken fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldToken, + FieldExpiresAt, + FieldDescription, + FieldScopes, + FieldLastUsedAt, +} + +var ( + // OrganizationsPrimaryKey and OrganizationsColumn2 are the table columns denoting the + // primary key for the organizations relation (M2M). + OrganizationsPrimaryKey = []string{"organization_id", "personal_access_token_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"personal_access_token_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [6]ent.Hook + Interceptors [3]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultToken holds the default value on creation for the "token" field. + DefaultToken func() string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the PersonalAccessToken queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByToken orders the results by the token field. +func ByToken(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldToken, opts...).ToFunc() +} + +// ByExpiresAt orders the results by the expires_at field. +func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpiresAt, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByLastUsedAt orders the results by the last_used_at field. +func ByLastUsedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastUsedAt, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByOrganizationsCount orders the results by organizations count. +func ByOrganizationsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrganizationsStep(), opts...) + } +} + +// ByOrganizations orders the results by organizations terms. +func ByOrganizations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newOrganizationsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationsTable, OrganizationsPrimaryKey...), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} diff --git a/internal/ent/generated/personalaccesstoken/where.go b/internal/ent/generated/personalaccesstoken/where.go new file mode 100644 index 0000000..9baa0e6 --- /dev/null +++ b/internal/ent/generated/personalaccesstoken/where.go @@ -0,0 +1,1065 @@ +// Code generated by ent, DO NOT EDIT. + +package personalaccesstoken + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldName, v)) +} + +// Token applies equality check predicate on the "token" field. It's identical to TokenEQ. +func Token(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldToken, v)) +} + +// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ. +func ExpiresAt(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldExpiresAt, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldDescription, v)) +} + +// LastUsedAt applies equality check predicate on the "last_used_at" field. It's identical to LastUsedAtEQ. +func LastUsedAt(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldLastUsedAt, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldName, v)) +} + +// TokenEQ applies the EQ predicate on the "token" field. +func TokenEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldToken, v)) +} + +// TokenNEQ applies the NEQ predicate on the "token" field. +func TokenNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldToken, v)) +} + +// TokenIn applies the In predicate on the "token" field. +func TokenIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldToken, vs...)) +} + +// TokenNotIn applies the NotIn predicate on the "token" field. +func TokenNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldToken, vs...)) +} + +// TokenGT applies the GT predicate on the "token" field. +func TokenGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldToken, v)) +} + +// TokenGTE applies the GTE predicate on the "token" field. +func TokenGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldToken, v)) +} + +// TokenLT applies the LT predicate on the "token" field. +func TokenLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldToken, v)) +} + +// TokenLTE applies the LTE predicate on the "token" field. +func TokenLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldToken, v)) +} + +// TokenContains applies the Contains predicate on the "token" field. +func TokenContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldToken, v)) +} + +// TokenHasPrefix applies the HasPrefix predicate on the "token" field. +func TokenHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldToken, v)) +} + +// TokenHasSuffix applies the HasSuffix predicate on the "token" field. +func TokenHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldToken, v)) +} + +// TokenEqualFold applies the EqualFold predicate on the "token" field. +func TokenEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldToken, v)) +} + +// TokenContainsFold applies the ContainsFold predicate on the "token" field. +func TokenContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldToken, v)) +} + +// ExpiresAtEQ applies the EQ predicate on the "expires_at" field. +func ExpiresAtEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldExpiresAt, v)) +} + +// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field. +func ExpiresAtNEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldExpiresAt, v)) +} + +// ExpiresAtIn applies the In predicate on the "expires_at" field. +func ExpiresAtIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field. +func ExpiresAtNotIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtGT applies the GT predicate on the "expires_at" field. +func ExpiresAtGT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldExpiresAt, v)) +} + +// ExpiresAtGTE applies the GTE predicate on the "expires_at" field. +func ExpiresAtGTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldExpiresAt, v)) +} + +// ExpiresAtLT applies the LT predicate on the "expires_at" field. +func ExpiresAtLT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldExpiresAt, v)) +} + +// ExpiresAtLTE applies the LTE predicate on the "expires_at" field. +func ExpiresAtLTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldExpiresAt, v)) +} + +// ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field. +func ExpiresAtIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldExpiresAt)) +} + +// ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field. +func ExpiresAtNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldExpiresAt)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldContainsFold(FieldDescription, v)) +} + +// ScopesIsNil applies the IsNil predicate on the "scopes" field. +func ScopesIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldScopes)) +} + +// ScopesNotNil applies the NotNil predicate on the "scopes" field. +func ScopesNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldScopes)) +} + +// LastUsedAtEQ applies the EQ predicate on the "last_used_at" field. +func LastUsedAtEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldEQ(FieldLastUsedAt, v)) +} + +// LastUsedAtNEQ applies the NEQ predicate on the "last_used_at" field. +func LastUsedAtNEQ(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNEQ(FieldLastUsedAt, v)) +} + +// LastUsedAtIn applies the In predicate on the "last_used_at" field. +func LastUsedAtIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIn(FieldLastUsedAt, vs...)) +} + +// LastUsedAtNotIn applies the NotIn predicate on the "last_used_at" field. +func LastUsedAtNotIn(vs ...time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotIn(FieldLastUsedAt, vs...)) +} + +// LastUsedAtGT applies the GT predicate on the "last_used_at" field. +func LastUsedAtGT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGT(FieldLastUsedAt, v)) +} + +// LastUsedAtGTE applies the GTE predicate on the "last_used_at" field. +func LastUsedAtGTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldGTE(FieldLastUsedAt, v)) +} + +// LastUsedAtLT applies the LT predicate on the "last_used_at" field. +func LastUsedAtLT(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLT(FieldLastUsedAt, v)) +} + +// LastUsedAtLTE applies the LTE predicate on the "last_used_at" field. +func LastUsedAtLTE(v time.Time) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldLTE(FieldLastUsedAt, v)) +} + +// LastUsedAtIsNil applies the IsNil predicate on the "last_used_at" field. +func LastUsedAtIsNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldIsNull(FieldLastUsedAt)) +} + +// LastUsedAtNotNil applies the NotNil predicate on the "last_used_at" field. +func LastUsedAtNotNil() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.FieldNotNull(FieldLastUsedAt)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PersonalAccessToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.User) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PersonalAccessToken + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrganizations applies the HasEdge predicate on the "organizations" edge. +func HasOrganizations() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, OrganizationsTable, OrganizationsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationsWith applies the HasEdge predicate on the "organizations" edge with a given conditions (other predicates). +func HasOrganizationsWith(preds ...predicate.Organization) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(func(s *sql.Selector) { + step := newOrganizationsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + 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.PersonalAccessToken) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.PersonalAccessToken) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.PersonalAccessToken) predicate.PersonalAccessToken { + return predicate.PersonalAccessToken(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/personalaccesstoken_create.go b/internal/ent/generated/personalaccesstoken_create.go new file mode 100644 index 0000000..8b018fe --- /dev/null +++ b/internal/ent/generated/personalaccesstoken_create.go @@ -0,0 +1,583 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// PersonalAccessTokenCreate is the builder for creating a PersonalAccessToken entity. +type PersonalAccessTokenCreate struct { + config + mutation *PersonalAccessTokenMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (patc *PersonalAccessTokenCreate) SetCreatedAt(t time.Time) *PersonalAccessTokenCreate { + patc.mutation.SetCreatedAt(t) + return patc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableCreatedAt(t *time.Time) *PersonalAccessTokenCreate { + if t != nil { + patc.SetCreatedAt(*t) + } + return patc +} + +// SetUpdatedAt sets the "updated_at" field. +func (patc *PersonalAccessTokenCreate) SetUpdatedAt(t time.Time) *PersonalAccessTokenCreate { + patc.mutation.SetUpdatedAt(t) + return patc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableUpdatedAt(t *time.Time) *PersonalAccessTokenCreate { + if t != nil { + patc.SetUpdatedAt(*t) + } + return patc +} + +// SetCreatedBy sets the "created_by" field. +func (patc *PersonalAccessTokenCreate) SetCreatedBy(s string) *PersonalAccessTokenCreate { + patc.mutation.SetCreatedBy(s) + return patc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableCreatedBy(s *string) *PersonalAccessTokenCreate { + if s != nil { + patc.SetCreatedBy(*s) + } + return patc +} + +// SetUpdatedBy sets the "updated_by" field. +func (patc *PersonalAccessTokenCreate) SetUpdatedBy(s string) *PersonalAccessTokenCreate { + patc.mutation.SetUpdatedBy(s) + return patc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableUpdatedBy(s *string) *PersonalAccessTokenCreate { + if s != nil { + patc.SetUpdatedBy(*s) + } + return patc +} + +// SetDeletedAt sets the "deleted_at" field. +func (patc *PersonalAccessTokenCreate) SetDeletedAt(t time.Time) *PersonalAccessTokenCreate { + patc.mutation.SetDeletedAt(t) + return patc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableDeletedAt(t *time.Time) *PersonalAccessTokenCreate { + if t != nil { + patc.SetDeletedAt(*t) + } + return patc +} + +// SetDeletedBy sets the "deleted_by" field. +func (patc *PersonalAccessTokenCreate) SetDeletedBy(s string) *PersonalAccessTokenCreate { + patc.mutation.SetDeletedBy(s) + return patc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableDeletedBy(s *string) *PersonalAccessTokenCreate { + if s != nil { + patc.SetDeletedBy(*s) + } + return patc +} + +// SetMappingID sets the "mapping_id" field. +func (patc *PersonalAccessTokenCreate) SetMappingID(s string) *PersonalAccessTokenCreate { + patc.mutation.SetMappingID(s) + return patc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableMappingID(s *string) *PersonalAccessTokenCreate { + if s != nil { + patc.SetMappingID(*s) + } + return patc +} + +// SetTags sets the "tags" field. +func (patc *PersonalAccessTokenCreate) SetTags(s []string) *PersonalAccessTokenCreate { + patc.mutation.SetTags(s) + return patc +} + +// SetOwnerID sets the "owner_id" field. +func (patc *PersonalAccessTokenCreate) SetOwnerID(s string) *PersonalAccessTokenCreate { + patc.mutation.SetOwnerID(s) + return patc +} + +// SetName sets the "name" field. +func (patc *PersonalAccessTokenCreate) SetName(s string) *PersonalAccessTokenCreate { + patc.mutation.SetName(s) + return patc +} + +// SetToken sets the "token" field. +func (patc *PersonalAccessTokenCreate) SetToken(s string) *PersonalAccessTokenCreate { + patc.mutation.SetToken(s) + return patc +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableToken(s *string) *PersonalAccessTokenCreate { + if s != nil { + patc.SetToken(*s) + } + return patc +} + +// SetExpiresAt sets the "expires_at" field. +func (patc *PersonalAccessTokenCreate) SetExpiresAt(t time.Time) *PersonalAccessTokenCreate { + patc.mutation.SetExpiresAt(t) + return patc +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableExpiresAt(t *time.Time) *PersonalAccessTokenCreate { + if t != nil { + patc.SetExpiresAt(*t) + } + return patc +} + +// SetDescription sets the "description" field. +func (patc *PersonalAccessTokenCreate) SetDescription(s string) *PersonalAccessTokenCreate { + patc.mutation.SetDescription(s) + return patc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableDescription(s *string) *PersonalAccessTokenCreate { + if s != nil { + patc.SetDescription(*s) + } + return patc +} + +// SetScopes sets the "scopes" field. +func (patc *PersonalAccessTokenCreate) SetScopes(s []string) *PersonalAccessTokenCreate { + patc.mutation.SetScopes(s) + return patc +} + +// SetLastUsedAt sets the "last_used_at" field. +func (patc *PersonalAccessTokenCreate) SetLastUsedAt(t time.Time) *PersonalAccessTokenCreate { + patc.mutation.SetLastUsedAt(t) + return patc +} + +// SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableLastUsedAt(t *time.Time) *PersonalAccessTokenCreate { + if t != nil { + patc.SetLastUsedAt(*t) + } + return patc +} + +// SetID sets the "id" field. +func (patc *PersonalAccessTokenCreate) SetID(s string) *PersonalAccessTokenCreate { + patc.mutation.SetID(s) + return patc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (patc *PersonalAccessTokenCreate) SetNillableID(s *string) *PersonalAccessTokenCreate { + if s != nil { + patc.SetID(*s) + } + return patc +} + +// SetOwner sets the "owner" edge to the User entity. +func (patc *PersonalAccessTokenCreate) SetOwner(u *User) *PersonalAccessTokenCreate { + return patc.SetOwnerID(u.ID) +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs. +func (patc *PersonalAccessTokenCreate) AddOrganizationIDs(ids ...string) *PersonalAccessTokenCreate { + patc.mutation.AddOrganizationIDs(ids...) + return patc +} + +// AddOrganizations adds the "organizations" edges to the Organization entity. +func (patc *PersonalAccessTokenCreate) AddOrganizations(o ...*Organization) *PersonalAccessTokenCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return patc.AddOrganizationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (patc *PersonalAccessTokenCreate) AddEventIDs(ids ...string) *PersonalAccessTokenCreate { + patc.mutation.AddEventIDs(ids...) + return patc +} + +// AddEvents adds the "events" edges to the Event entity. +func (patc *PersonalAccessTokenCreate) AddEvents(e ...*Event) *PersonalAccessTokenCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return patc.AddEventIDs(ids...) +} + +// Mutation returns the PersonalAccessTokenMutation object of the builder. +func (patc *PersonalAccessTokenCreate) Mutation() *PersonalAccessTokenMutation { + return patc.mutation +} + +// Save creates the PersonalAccessToken in the database. +func (patc *PersonalAccessTokenCreate) Save(ctx context.Context) (*PersonalAccessToken, error) { + if err := patc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, patc.sqlSave, patc.mutation, patc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (patc *PersonalAccessTokenCreate) SaveX(ctx context.Context) *PersonalAccessToken { + v, err := patc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (patc *PersonalAccessTokenCreate) Exec(ctx context.Context) error { + _, err := patc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (patc *PersonalAccessTokenCreate) ExecX(ctx context.Context) { + if err := patc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (patc *PersonalAccessTokenCreate) defaults() error { + if _, ok := patc.mutation.CreatedAt(); !ok { + if personalaccesstoken.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized personalaccesstoken.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := personalaccesstoken.DefaultCreatedAt() + patc.mutation.SetCreatedAt(v) + } + if _, ok := patc.mutation.UpdatedAt(); !ok { + if personalaccesstoken.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized personalaccesstoken.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := personalaccesstoken.DefaultUpdatedAt() + patc.mutation.SetUpdatedAt(v) + } + if _, ok := patc.mutation.MappingID(); !ok { + if personalaccesstoken.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized personalaccesstoken.DefaultMappingID (forgotten import generated/runtime?)") + } + v := personalaccesstoken.DefaultMappingID() + patc.mutation.SetMappingID(v) + } + if _, ok := patc.mutation.Tags(); !ok { + v := personalaccesstoken.DefaultTags + patc.mutation.SetTags(v) + } + if _, ok := patc.mutation.Token(); !ok { + if personalaccesstoken.DefaultToken == nil { + return fmt.Errorf("generated: uninitialized personalaccesstoken.DefaultToken (forgotten import generated/runtime?)") + } + v := personalaccesstoken.DefaultToken() + patc.mutation.SetToken(v) + } + if _, ok := patc.mutation.ID(); !ok { + if personalaccesstoken.DefaultID == nil { + return fmt.Errorf("generated: uninitialized personalaccesstoken.DefaultID (forgotten import generated/runtime?)") + } + v := personalaccesstoken.DefaultID() + patc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (patc *PersonalAccessTokenCreate) check() error { + if _, ok := patc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "PersonalAccessToken.mapping_id"`)} + } + if _, ok := patc.mutation.OwnerID(); !ok { + return &ValidationError{Name: "owner_id", err: errors.New(`generated: missing required field "PersonalAccessToken.owner_id"`)} + } + if _, ok := patc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "PersonalAccessToken.name"`)} + } + if v, ok := patc.mutation.Name(); ok { + if err := personalaccesstoken.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "PersonalAccessToken.name": %w`, err)} + } + } + if _, ok := patc.mutation.Token(); !ok { + return &ValidationError{Name: "token", err: errors.New(`generated: missing required field "PersonalAccessToken.token"`)} + } + if len(patc.mutation.OwnerIDs()) == 0 { + return &ValidationError{Name: "owner", err: errors.New(`generated: missing required edge "PersonalAccessToken.owner"`)} + } + return nil +} + +func (patc *PersonalAccessTokenCreate) sqlSave(ctx context.Context) (*PersonalAccessToken, error) { + if err := patc.check(); err != nil { + return nil, err + } + _node, _spec := patc.createSpec() + if err := sqlgraph.CreateNode(ctx, patc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected PersonalAccessToken.ID type: %T", _spec.ID.Value) + } + } + patc.mutation.id = &_node.ID + patc.mutation.done = true + return _node, nil +} + +func (patc *PersonalAccessTokenCreate) createSpec() (*PersonalAccessToken, *sqlgraph.CreateSpec) { + var ( + _node = &PersonalAccessToken{config: patc.config} + _spec = sqlgraph.NewCreateSpec(personalaccesstoken.Table, sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString)) + ) + _spec.Schema = patc.schemaConfig.PersonalAccessToken + if id, ok := patc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := patc.mutation.CreatedAt(); ok { + _spec.SetField(personalaccesstoken.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := patc.mutation.UpdatedAt(); ok { + _spec.SetField(personalaccesstoken.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := patc.mutation.CreatedBy(); ok { + _spec.SetField(personalaccesstoken.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := patc.mutation.UpdatedBy(); ok { + _spec.SetField(personalaccesstoken.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := patc.mutation.DeletedAt(); ok { + _spec.SetField(personalaccesstoken.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := patc.mutation.DeletedBy(); ok { + _spec.SetField(personalaccesstoken.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := patc.mutation.MappingID(); ok { + _spec.SetField(personalaccesstoken.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := patc.mutation.Tags(); ok { + _spec.SetField(personalaccesstoken.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := patc.mutation.Name(); ok { + _spec.SetField(personalaccesstoken.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := patc.mutation.Token(); ok { + _spec.SetField(personalaccesstoken.FieldToken, field.TypeString, value) + _node.Token = value + } + if value, ok := patc.mutation.ExpiresAt(); ok { + _spec.SetField(personalaccesstoken.FieldExpiresAt, field.TypeTime, value) + _node.ExpiresAt = &value + } + if value, ok := patc.mutation.Description(); ok { + _spec.SetField(personalaccesstoken.FieldDescription, field.TypeString, value) + _node.Description = &value + } + if value, ok := patc.mutation.Scopes(); ok { + _spec.SetField(personalaccesstoken.FieldScopes, field.TypeJSON, value) + _node.Scopes = value + } + if value, ok := patc.mutation.LastUsedAt(); ok { + _spec.SetField(personalaccesstoken.FieldLastUsedAt, field.TypeTime, value) + _node.LastUsedAt = &value + } + if nodes := patc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: personalaccesstoken.OwnerTable, + Columns: []string{personalaccesstoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = patc.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := patc.mutation.OrganizationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = patc.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := patc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = patc.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// PersonalAccessTokenCreateBulk is the builder for creating many PersonalAccessToken entities in bulk. +type PersonalAccessTokenCreateBulk struct { + config + err error + builders []*PersonalAccessTokenCreate +} + +// Save creates the PersonalAccessToken entities in the database. +func (patcb *PersonalAccessTokenCreateBulk) Save(ctx context.Context) ([]*PersonalAccessToken, error) { + if patcb.err != nil { + return nil, patcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(patcb.builders)) + nodes := make([]*PersonalAccessToken, len(patcb.builders)) + mutators := make([]Mutator, len(patcb.builders)) + for i := range patcb.builders { + func(i int, root context.Context) { + builder := patcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*PersonalAccessTokenMutation) + 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, patcb.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, patcb.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, patcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (patcb *PersonalAccessTokenCreateBulk) SaveX(ctx context.Context) []*PersonalAccessToken { + v, err := patcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (patcb *PersonalAccessTokenCreateBulk) Exec(ctx context.Context) error { + _, err := patcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (patcb *PersonalAccessTokenCreateBulk) ExecX(ctx context.Context) { + if err := patcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/personalaccesstoken_delete.go b/internal/ent/generated/personalaccesstoken_delete.go new file mode 100644 index 0000000..67aa96c --- /dev/null +++ b/internal/ent/generated/personalaccesstoken_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" +) + +// PersonalAccessTokenDelete is the builder for deleting a PersonalAccessToken entity. +type PersonalAccessTokenDelete struct { + config + hooks []Hook + mutation *PersonalAccessTokenMutation +} + +// Where appends a list predicates to the PersonalAccessTokenDelete builder. +func (patd *PersonalAccessTokenDelete) Where(ps ...predicate.PersonalAccessToken) *PersonalAccessTokenDelete { + patd.mutation.Where(ps...) + return patd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (patd *PersonalAccessTokenDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, patd.sqlExec, patd.mutation, patd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (patd *PersonalAccessTokenDelete) ExecX(ctx context.Context) int { + n, err := patd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (patd *PersonalAccessTokenDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(personalaccesstoken.Table, sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString)) + _spec.Node.Schema = patd.schemaConfig.PersonalAccessToken + ctx = internal.NewSchemaConfigContext(ctx, patd.schemaConfig) + if ps := patd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, patd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + patd.mutation.done = true + return affected, err +} + +// PersonalAccessTokenDeleteOne is the builder for deleting a single PersonalAccessToken entity. +type PersonalAccessTokenDeleteOne struct { + patd *PersonalAccessTokenDelete +} + +// Where appends a list predicates to the PersonalAccessTokenDelete builder. +func (patdo *PersonalAccessTokenDeleteOne) Where(ps ...predicate.PersonalAccessToken) *PersonalAccessTokenDeleteOne { + patdo.patd.mutation.Where(ps...) + return patdo +} + +// Exec executes the deletion query. +func (patdo *PersonalAccessTokenDeleteOne) Exec(ctx context.Context) error { + n, err := patdo.patd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{personalaccesstoken.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (patdo *PersonalAccessTokenDeleteOne) ExecX(ctx context.Context) { + if err := patdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/personalaccesstoken_query.go b/internal/ent/generated/personalaccesstoken_query.go new file mode 100644 index 0000000..4cddeb7 --- /dev/null +++ b/internal/ent/generated/personalaccesstoken_query.go @@ -0,0 +1,903 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// PersonalAccessTokenQuery is the builder for querying PersonalAccessToken entities. +type PersonalAccessTokenQuery struct { + config + ctx *QueryContext + order []personalaccesstoken.OrderOption + inters []Interceptor + predicates []predicate.PersonalAccessToken + withOwner *UserQuery + withOrganizations *OrganizationQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*PersonalAccessToken) error + withNamedOrganizations map[string]*OrganizationQuery + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the PersonalAccessTokenQuery builder. +func (patq *PersonalAccessTokenQuery) Where(ps ...predicate.PersonalAccessToken) *PersonalAccessTokenQuery { + patq.predicates = append(patq.predicates, ps...) + return patq +} + +// Limit the number of records to be returned by this query. +func (patq *PersonalAccessTokenQuery) Limit(limit int) *PersonalAccessTokenQuery { + patq.ctx.Limit = &limit + return patq +} + +// Offset to start from. +func (patq *PersonalAccessTokenQuery) Offset(offset int) *PersonalAccessTokenQuery { + patq.ctx.Offset = &offset + return patq +} + +// 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 (patq *PersonalAccessTokenQuery) Unique(unique bool) *PersonalAccessTokenQuery { + patq.ctx.Unique = &unique + return patq +} + +// Order specifies how the records should be ordered. +func (patq *PersonalAccessTokenQuery) Order(o ...personalaccesstoken.OrderOption) *PersonalAccessTokenQuery { + patq.order = append(patq.order, o...) + return patq +} + +// QueryOwner chains the current query on the "owner" edge. +func (patq *PersonalAccessTokenQuery) QueryOwner() *UserQuery { + query := (&UserClient{config: patq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := patq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := patq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(personalaccesstoken.Table, personalaccesstoken.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, personalaccesstoken.OwnerTable, personalaccesstoken.OwnerColumn), + ) + schemaConfig := patq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.PersonalAccessToken + fromU = sqlgraph.SetNeighbors(patq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrganizations chains the current query on the "organizations" edge. +func (patq *PersonalAccessTokenQuery) QueryOrganizations() *OrganizationQuery { + query := (&OrganizationClient{config: patq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := patq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := patq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(personalaccesstoken.Table, personalaccesstoken.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, personalaccesstoken.OrganizationsTable, personalaccesstoken.OrganizationsPrimaryKey...), + ) + schemaConfig := patq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrganizationPersonalAccessTokens + fromU = sqlgraph.SetNeighbors(patq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (patq *PersonalAccessTokenQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: patq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := patq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := patq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(personalaccesstoken.Table, personalaccesstoken.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, personalaccesstoken.EventsTable, personalaccesstoken.EventsPrimaryKey...), + ) + schemaConfig := patq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.PersonalAccessTokenEvents + fromU = sqlgraph.SetNeighbors(patq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first PersonalAccessToken entity from the query. +// Returns a *NotFoundError when no PersonalAccessToken was found. +func (patq *PersonalAccessTokenQuery) First(ctx context.Context) (*PersonalAccessToken, error) { + nodes, err := patq.Limit(1).All(setContextOp(ctx, patq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{personalaccesstoken.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) FirstX(ctx context.Context) *PersonalAccessToken { + node, err := patq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first PersonalAccessToken ID from the query. +// Returns a *NotFoundError when no PersonalAccessToken ID was found. +func (patq *PersonalAccessTokenQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = patq.Limit(1).IDs(setContextOp(ctx, patq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{personalaccesstoken.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) FirstIDX(ctx context.Context) string { + id, err := patq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single PersonalAccessToken entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one PersonalAccessToken entity is found. +// Returns a *NotFoundError when no PersonalAccessToken entities are found. +func (patq *PersonalAccessTokenQuery) Only(ctx context.Context) (*PersonalAccessToken, error) { + nodes, err := patq.Limit(2).All(setContextOp(ctx, patq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{personalaccesstoken.Label} + default: + return nil, &NotSingularError{personalaccesstoken.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) OnlyX(ctx context.Context) *PersonalAccessToken { + node, err := patq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only PersonalAccessToken ID in the query. +// Returns a *NotSingularError when more than one PersonalAccessToken ID is found. +// Returns a *NotFoundError when no entities are found. +func (patq *PersonalAccessTokenQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = patq.Limit(2).IDs(setContextOp(ctx, patq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{personalaccesstoken.Label} + default: + err = &NotSingularError{personalaccesstoken.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) OnlyIDX(ctx context.Context) string { + id, err := patq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of PersonalAccessTokens. +func (patq *PersonalAccessTokenQuery) All(ctx context.Context) ([]*PersonalAccessToken, error) { + ctx = setContextOp(ctx, patq.ctx, ent.OpQueryAll) + if err := patq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*PersonalAccessToken, *PersonalAccessTokenQuery]() + return withInterceptors[[]*PersonalAccessToken](ctx, patq, qr, patq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) AllX(ctx context.Context) []*PersonalAccessToken { + nodes, err := patq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of PersonalAccessToken IDs. +func (patq *PersonalAccessTokenQuery) IDs(ctx context.Context) (ids []string, err error) { + if patq.ctx.Unique == nil && patq.path != nil { + patq.Unique(true) + } + ctx = setContextOp(ctx, patq.ctx, ent.OpQueryIDs) + if err = patq.Select(personalaccesstoken.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) IDsX(ctx context.Context) []string { + ids, err := patq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (patq *PersonalAccessTokenQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, patq.ctx, ent.OpQueryCount) + if err := patq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, patq, querierCount[*PersonalAccessTokenQuery](), patq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) CountX(ctx context.Context) int { + count, err := patq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (patq *PersonalAccessTokenQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, patq.ctx, ent.OpQueryExist) + switch _, err := patq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (patq *PersonalAccessTokenQuery) ExistX(ctx context.Context) bool { + exist, err := patq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the PersonalAccessTokenQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (patq *PersonalAccessTokenQuery) Clone() *PersonalAccessTokenQuery { + if patq == nil { + return nil + } + return &PersonalAccessTokenQuery{ + config: patq.config, + ctx: patq.ctx.Clone(), + order: append([]personalaccesstoken.OrderOption{}, patq.order...), + inters: append([]Interceptor{}, patq.inters...), + predicates: append([]predicate.PersonalAccessToken{}, patq.predicates...), + withOwner: patq.withOwner.Clone(), + withOrganizations: patq.withOrganizations.Clone(), + withEvents: patq.withEvents.Clone(), + // clone intermediate query. + sql: patq.sql.Clone(), + path: patq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (patq *PersonalAccessTokenQuery) WithOwner(opts ...func(*UserQuery)) *PersonalAccessTokenQuery { + query := (&UserClient{config: patq.config}).Query() + for _, opt := range opts { + opt(query) + } + patq.withOwner = query + return patq +} + +// WithOrganizations tells the query-builder to eager-load the nodes that are connected to +// the "organizations" edge. The optional arguments are used to configure the query builder of the edge. +func (patq *PersonalAccessTokenQuery) WithOrganizations(opts ...func(*OrganizationQuery)) *PersonalAccessTokenQuery { + query := (&OrganizationClient{config: patq.config}).Query() + for _, opt := range opts { + opt(query) + } + patq.withOrganizations = query + return patq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (patq *PersonalAccessTokenQuery) WithEvents(opts ...func(*EventQuery)) *PersonalAccessTokenQuery { + query := (&EventClient{config: patq.config}).Query() + for _, opt := range opts { + opt(query) + } + patq.withEvents = query + return patq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.PersonalAccessToken.Query(). +// GroupBy(personalaccesstoken.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (patq *PersonalAccessTokenQuery) GroupBy(field string, fields ...string) *PersonalAccessTokenGroupBy { + patq.ctx.Fields = append([]string{field}, fields...) + grbuild := &PersonalAccessTokenGroupBy{build: patq} + grbuild.flds = &patq.ctx.Fields + grbuild.label = personalaccesstoken.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.PersonalAccessToken.Query(). +// Select(personalaccesstoken.FieldCreatedAt). +// Scan(ctx, &v) +func (patq *PersonalAccessTokenQuery) Select(fields ...string) *PersonalAccessTokenSelect { + patq.ctx.Fields = append(patq.ctx.Fields, fields...) + sbuild := &PersonalAccessTokenSelect{PersonalAccessTokenQuery: patq} + sbuild.label = personalaccesstoken.Label + sbuild.flds, sbuild.scan = &patq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a PersonalAccessTokenSelect configured with the given aggregations. +func (patq *PersonalAccessTokenQuery) Aggregate(fns ...AggregateFunc) *PersonalAccessTokenSelect { + return patq.Select().Aggregate(fns...) +} + +func (patq *PersonalAccessTokenQuery) prepareQuery(ctx context.Context) error { + for _, inter := range patq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, patq); err != nil { + return err + } + } + } + for _, f := range patq.ctx.Fields { + if !personalaccesstoken.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if patq.path != nil { + prev, err := patq.path(ctx) + if err != nil { + return err + } + patq.sql = prev + } + if personalaccesstoken.Policy == nil { + return errors.New("generated: uninitialized personalaccesstoken.Policy (forgotten import generated/runtime?)") + } + if err := personalaccesstoken.Policy.EvalQuery(ctx, patq); err != nil { + return err + } + return nil +} + +func (patq *PersonalAccessTokenQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*PersonalAccessToken, error) { + var ( + nodes = []*PersonalAccessToken{} + _spec = patq.querySpec() + loadedTypes = [3]bool{ + patq.withOwner != nil, + patq.withOrganizations != nil, + patq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*PersonalAccessToken).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &PersonalAccessToken{config: patq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = patq.schemaConfig.PersonalAccessToken + ctx = internal.NewSchemaConfigContext(ctx, patq.schemaConfig) + if len(patq.modifiers) > 0 { + _spec.Modifiers = patq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, patq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := patq.withOwner; query != nil { + if err := patq.loadOwner(ctx, query, nodes, nil, + func(n *PersonalAccessToken, e *User) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := patq.withOrganizations; query != nil { + if err := patq.loadOrganizations(ctx, query, nodes, + func(n *PersonalAccessToken) { n.Edges.Organizations = []*Organization{} }, + func(n *PersonalAccessToken, e *Organization) { + n.Edges.Organizations = append(n.Edges.Organizations, e) + }); err != nil { + return nil, err + } + } + if query := patq.withEvents; query != nil { + if err := patq.loadEvents(ctx, query, nodes, + func(n *PersonalAccessToken) { n.Edges.Events = []*Event{} }, + func(n *PersonalAccessToken, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range patq.withNamedOrganizations { + if err := patq.loadOrganizations(ctx, query, nodes, + func(n *PersonalAccessToken) { n.appendNamedOrganizations(name) }, + func(n *PersonalAccessToken, e *Organization) { n.appendNamedOrganizations(name, e) }); err != nil { + return nil, err + } + } + for name, query := range patq.withNamedEvents { + if err := patq.loadEvents(ctx, query, nodes, + func(n *PersonalAccessToken) { n.appendNamedEvents(name) }, + func(n *PersonalAccessToken, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range patq.loadTotal { + if err := patq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (patq *PersonalAccessTokenQuery) loadOwner(ctx context.Context, query *UserQuery, nodes []*PersonalAccessToken, init func(*PersonalAccessToken), assign func(*PersonalAccessToken, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*PersonalAccessToken) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (patq *PersonalAccessTokenQuery) loadOrganizations(ctx context.Context, query *OrganizationQuery, nodes []*PersonalAccessToken, init func(*PersonalAccessToken), assign func(*PersonalAccessToken, *Organization)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*PersonalAccessToken) + nids := make(map[string]map[*PersonalAccessToken]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(personalaccesstoken.OrganizationsTable) + joinT.Schema(patq.schemaConfig.OrganizationPersonalAccessTokens) + s.Join(joinT).On(s.C(organization.FieldID), joinT.C(personalaccesstoken.OrganizationsPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(personalaccesstoken.OrganizationsPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(personalaccesstoken.OrganizationsPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*PersonalAccessToken]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Organization](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "organizations" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (patq *PersonalAccessTokenQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*PersonalAccessToken, init func(*PersonalAccessToken), assign func(*PersonalAccessToken, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*PersonalAccessToken) + nids := make(map[string]map[*PersonalAccessToken]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(personalaccesstoken.EventsTable) + joinT.Schema(patq.schemaConfig.PersonalAccessTokenEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(personalaccesstoken.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(personalaccesstoken.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(personalaccesstoken.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*PersonalAccessToken]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (patq *PersonalAccessTokenQuery) sqlCount(ctx context.Context) (int, error) { + _spec := patq.querySpec() + _spec.Node.Schema = patq.schemaConfig.PersonalAccessToken + ctx = internal.NewSchemaConfigContext(ctx, patq.schemaConfig) + if len(patq.modifiers) > 0 { + _spec.Modifiers = patq.modifiers + } + _spec.Node.Columns = patq.ctx.Fields + if len(patq.ctx.Fields) > 0 { + _spec.Unique = patq.ctx.Unique != nil && *patq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, patq.driver, _spec) +} + +func (patq *PersonalAccessTokenQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(personalaccesstoken.Table, personalaccesstoken.Columns, sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString)) + _spec.From = patq.sql + if unique := patq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if patq.path != nil { + _spec.Unique = true + } + if fields := patq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, personalaccesstoken.FieldID) + for i := range fields { + if fields[i] != personalaccesstoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if patq.withOwner != nil { + _spec.Node.AddColumnOnce(personalaccesstoken.FieldOwnerID) + } + } + if ps := patq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := patq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := patq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := patq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (patq *PersonalAccessTokenQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(patq.driver.Dialect()) + t1 := builder.Table(personalaccesstoken.Table) + columns := patq.ctx.Fields + if len(columns) == 0 { + columns = personalaccesstoken.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if patq.sql != nil { + selector = patq.sql + selector.Select(selector.Columns(columns...)...) + } + if patq.ctx.Unique != nil && *patq.ctx.Unique { + selector.Distinct() + } + t1.Schema(patq.schemaConfig.PersonalAccessToken) + ctx = internal.NewSchemaConfigContext(ctx, patq.schemaConfig) + selector.WithContext(ctx) + for _, p := range patq.predicates { + p(selector) + } + for _, p := range patq.order { + p(selector) + } + if offset := patq.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 := patq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedOrganizations tells the query-builder to eager-load the nodes that are connected to the "organizations" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (patq *PersonalAccessTokenQuery) WithNamedOrganizations(name string, opts ...func(*OrganizationQuery)) *PersonalAccessTokenQuery { + query := (&OrganizationClient{config: patq.config}).Query() + for _, opt := range opts { + opt(query) + } + if patq.withNamedOrganizations == nil { + patq.withNamedOrganizations = make(map[string]*OrganizationQuery) + } + patq.withNamedOrganizations[name] = query + return patq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (patq *PersonalAccessTokenQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *PersonalAccessTokenQuery { + query := (&EventClient{config: patq.config}).Query() + for _, opt := range opts { + opt(query) + } + if patq.withNamedEvents == nil { + patq.withNamedEvents = make(map[string]*EventQuery) + } + patq.withNamedEvents[name] = query + return patq +} + +// PersonalAccessTokenGroupBy is the group-by builder for PersonalAccessToken entities. +type PersonalAccessTokenGroupBy struct { + selector + build *PersonalAccessTokenQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (patgb *PersonalAccessTokenGroupBy) Aggregate(fns ...AggregateFunc) *PersonalAccessTokenGroupBy { + patgb.fns = append(patgb.fns, fns...) + return patgb +} + +// Scan applies the selector query and scans the result into the given value. +func (patgb *PersonalAccessTokenGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, patgb.build.ctx, ent.OpQueryGroupBy) + if err := patgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*PersonalAccessTokenQuery, *PersonalAccessTokenGroupBy](ctx, patgb.build, patgb, patgb.build.inters, v) +} + +func (patgb *PersonalAccessTokenGroupBy) sqlScan(ctx context.Context, root *PersonalAccessTokenQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(patgb.fns)) + for _, fn := range patgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*patgb.flds)+len(patgb.fns)) + for _, f := range *patgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*patgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := patgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// PersonalAccessTokenSelect is the builder for selecting fields of PersonalAccessToken entities. +type PersonalAccessTokenSelect struct { + *PersonalAccessTokenQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (pats *PersonalAccessTokenSelect) Aggregate(fns ...AggregateFunc) *PersonalAccessTokenSelect { + pats.fns = append(pats.fns, fns...) + return pats +} + +// Scan applies the selector query and scans the result into the given value. +func (pats *PersonalAccessTokenSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, pats.ctx, ent.OpQuerySelect) + if err := pats.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*PersonalAccessTokenQuery, *PersonalAccessTokenSelect](ctx, pats.PersonalAccessTokenQuery, pats, pats.inters, v) +} + +func (pats *PersonalAccessTokenSelect) sqlScan(ctx context.Context, root *PersonalAccessTokenQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(pats.fns)) + for _, fn := range pats.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*pats.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 := pats.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/personalaccesstoken_update.go b/internal/ent/generated/personalaccesstoken_update.go new file mode 100644 index 0000000..eb1c741 --- /dev/null +++ b/internal/ent/generated/personalaccesstoken_update.go @@ -0,0 +1,1206 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// PersonalAccessTokenUpdate is the builder for updating PersonalAccessToken entities. +type PersonalAccessTokenUpdate struct { + config + hooks []Hook + mutation *PersonalAccessTokenMutation +} + +// Where appends a list predicates to the PersonalAccessTokenUpdate builder. +func (patu *PersonalAccessTokenUpdate) Where(ps ...predicate.PersonalAccessToken) *PersonalAccessTokenUpdate { + patu.mutation.Where(ps...) + return patu +} + +// SetUpdatedAt sets the "updated_at" field. +func (patu *PersonalAccessTokenUpdate) SetUpdatedAt(t time.Time) *PersonalAccessTokenUpdate { + patu.mutation.SetUpdatedAt(t) + return patu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (patu *PersonalAccessTokenUpdate) ClearUpdatedAt() *PersonalAccessTokenUpdate { + patu.mutation.ClearUpdatedAt() + return patu +} + +// SetUpdatedBy sets the "updated_by" field. +func (patu *PersonalAccessTokenUpdate) SetUpdatedBy(s string) *PersonalAccessTokenUpdate { + patu.mutation.SetUpdatedBy(s) + return patu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableUpdatedBy(s *string) *PersonalAccessTokenUpdate { + if s != nil { + patu.SetUpdatedBy(*s) + } + return patu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (patu *PersonalAccessTokenUpdate) ClearUpdatedBy() *PersonalAccessTokenUpdate { + patu.mutation.ClearUpdatedBy() + return patu +} + +// SetDeletedAt sets the "deleted_at" field. +func (patu *PersonalAccessTokenUpdate) SetDeletedAt(t time.Time) *PersonalAccessTokenUpdate { + patu.mutation.SetDeletedAt(t) + return patu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableDeletedAt(t *time.Time) *PersonalAccessTokenUpdate { + if t != nil { + patu.SetDeletedAt(*t) + } + return patu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (patu *PersonalAccessTokenUpdate) ClearDeletedAt() *PersonalAccessTokenUpdate { + patu.mutation.ClearDeletedAt() + return patu +} + +// SetDeletedBy sets the "deleted_by" field. +func (patu *PersonalAccessTokenUpdate) SetDeletedBy(s string) *PersonalAccessTokenUpdate { + patu.mutation.SetDeletedBy(s) + return patu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableDeletedBy(s *string) *PersonalAccessTokenUpdate { + if s != nil { + patu.SetDeletedBy(*s) + } + return patu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (patu *PersonalAccessTokenUpdate) ClearDeletedBy() *PersonalAccessTokenUpdate { + patu.mutation.ClearDeletedBy() + return patu +} + +// SetTags sets the "tags" field. +func (patu *PersonalAccessTokenUpdate) SetTags(s []string) *PersonalAccessTokenUpdate { + patu.mutation.SetTags(s) + return patu +} + +// AppendTags appends s to the "tags" field. +func (patu *PersonalAccessTokenUpdate) AppendTags(s []string) *PersonalAccessTokenUpdate { + patu.mutation.AppendTags(s) + return patu +} + +// ClearTags clears the value of the "tags" field. +func (patu *PersonalAccessTokenUpdate) ClearTags() *PersonalAccessTokenUpdate { + patu.mutation.ClearTags() + return patu +} + +// SetOwnerID sets the "owner_id" field. +func (patu *PersonalAccessTokenUpdate) SetOwnerID(s string) *PersonalAccessTokenUpdate { + patu.mutation.SetOwnerID(s) + return patu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableOwnerID(s *string) *PersonalAccessTokenUpdate { + if s != nil { + patu.SetOwnerID(*s) + } + return patu +} + +// SetName sets the "name" field. +func (patu *PersonalAccessTokenUpdate) SetName(s string) *PersonalAccessTokenUpdate { + patu.mutation.SetName(s) + return patu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableName(s *string) *PersonalAccessTokenUpdate { + if s != nil { + patu.SetName(*s) + } + return patu +} + +// SetExpiresAt sets the "expires_at" field. +func (patu *PersonalAccessTokenUpdate) SetExpiresAt(t time.Time) *PersonalAccessTokenUpdate { + patu.mutation.SetExpiresAt(t) + return patu +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableExpiresAt(t *time.Time) *PersonalAccessTokenUpdate { + if t != nil { + patu.SetExpiresAt(*t) + } + return patu +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (patu *PersonalAccessTokenUpdate) ClearExpiresAt() *PersonalAccessTokenUpdate { + patu.mutation.ClearExpiresAt() + return patu +} + +// SetDescription sets the "description" field. +func (patu *PersonalAccessTokenUpdate) SetDescription(s string) *PersonalAccessTokenUpdate { + patu.mutation.SetDescription(s) + return patu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableDescription(s *string) *PersonalAccessTokenUpdate { + if s != nil { + patu.SetDescription(*s) + } + return patu +} + +// ClearDescription clears the value of the "description" field. +func (patu *PersonalAccessTokenUpdate) ClearDescription() *PersonalAccessTokenUpdate { + patu.mutation.ClearDescription() + return patu +} + +// SetScopes sets the "scopes" field. +func (patu *PersonalAccessTokenUpdate) SetScopes(s []string) *PersonalAccessTokenUpdate { + patu.mutation.SetScopes(s) + return patu +} + +// AppendScopes appends s to the "scopes" field. +func (patu *PersonalAccessTokenUpdate) AppendScopes(s []string) *PersonalAccessTokenUpdate { + patu.mutation.AppendScopes(s) + return patu +} + +// ClearScopes clears the value of the "scopes" field. +func (patu *PersonalAccessTokenUpdate) ClearScopes() *PersonalAccessTokenUpdate { + patu.mutation.ClearScopes() + return patu +} + +// SetLastUsedAt sets the "last_used_at" field. +func (patu *PersonalAccessTokenUpdate) SetLastUsedAt(t time.Time) *PersonalAccessTokenUpdate { + patu.mutation.SetLastUsedAt(t) + return patu +} + +// SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil. +func (patu *PersonalAccessTokenUpdate) SetNillableLastUsedAt(t *time.Time) *PersonalAccessTokenUpdate { + if t != nil { + patu.SetLastUsedAt(*t) + } + return patu +} + +// ClearLastUsedAt clears the value of the "last_used_at" field. +func (patu *PersonalAccessTokenUpdate) ClearLastUsedAt() *PersonalAccessTokenUpdate { + patu.mutation.ClearLastUsedAt() + return patu +} + +// SetOwner sets the "owner" edge to the User entity. +func (patu *PersonalAccessTokenUpdate) SetOwner(u *User) *PersonalAccessTokenUpdate { + return patu.SetOwnerID(u.ID) +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs. +func (patu *PersonalAccessTokenUpdate) AddOrganizationIDs(ids ...string) *PersonalAccessTokenUpdate { + patu.mutation.AddOrganizationIDs(ids...) + return patu +} + +// AddOrganizations adds the "organizations" edges to the Organization entity. +func (patu *PersonalAccessTokenUpdate) AddOrganizations(o ...*Organization) *PersonalAccessTokenUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return patu.AddOrganizationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (patu *PersonalAccessTokenUpdate) AddEventIDs(ids ...string) *PersonalAccessTokenUpdate { + patu.mutation.AddEventIDs(ids...) + return patu +} + +// AddEvents adds the "events" edges to the Event entity. +func (patu *PersonalAccessTokenUpdate) AddEvents(e ...*Event) *PersonalAccessTokenUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return patu.AddEventIDs(ids...) +} + +// Mutation returns the PersonalAccessTokenMutation object of the builder. +func (patu *PersonalAccessTokenUpdate) Mutation() *PersonalAccessTokenMutation { + return patu.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (patu *PersonalAccessTokenUpdate) ClearOwner() *PersonalAccessTokenUpdate { + patu.mutation.ClearOwner() + return patu +} + +// ClearOrganizations clears all "organizations" edges to the Organization entity. +func (patu *PersonalAccessTokenUpdate) ClearOrganizations() *PersonalAccessTokenUpdate { + patu.mutation.ClearOrganizations() + return patu +} + +// RemoveOrganizationIDs removes the "organizations" edge to Organization entities by IDs. +func (patu *PersonalAccessTokenUpdate) RemoveOrganizationIDs(ids ...string) *PersonalAccessTokenUpdate { + patu.mutation.RemoveOrganizationIDs(ids...) + return patu +} + +// RemoveOrganizations removes "organizations" edges to Organization entities. +func (patu *PersonalAccessTokenUpdate) RemoveOrganizations(o ...*Organization) *PersonalAccessTokenUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return patu.RemoveOrganizationIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (patu *PersonalAccessTokenUpdate) ClearEvents() *PersonalAccessTokenUpdate { + patu.mutation.ClearEvents() + return patu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (patu *PersonalAccessTokenUpdate) RemoveEventIDs(ids ...string) *PersonalAccessTokenUpdate { + patu.mutation.RemoveEventIDs(ids...) + return patu +} + +// RemoveEvents removes "events" edges to Event entities. +func (patu *PersonalAccessTokenUpdate) RemoveEvents(e ...*Event) *PersonalAccessTokenUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return patu.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (patu *PersonalAccessTokenUpdate) Save(ctx context.Context) (int, error) { + if err := patu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, patu.sqlSave, patu.mutation, patu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (patu *PersonalAccessTokenUpdate) SaveX(ctx context.Context) int { + affected, err := patu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (patu *PersonalAccessTokenUpdate) Exec(ctx context.Context) error { + _, err := patu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (patu *PersonalAccessTokenUpdate) ExecX(ctx context.Context) { + if err := patu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (patu *PersonalAccessTokenUpdate) defaults() error { + if _, ok := patu.mutation.UpdatedAt(); !ok && !patu.mutation.UpdatedAtCleared() { + if personalaccesstoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized personalaccesstoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := personalaccesstoken.UpdateDefaultUpdatedAt() + patu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (patu *PersonalAccessTokenUpdate) check() error { + if v, ok := patu.mutation.Name(); ok { + if err := personalaccesstoken.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "PersonalAccessToken.name": %w`, err)} + } + } + if patu.mutation.OwnerCleared() && len(patu.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "PersonalAccessToken.owner"`) + } + return nil +} + +func (patu *PersonalAccessTokenUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := patu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(personalaccesstoken.Table, personalaccesstoken.Columns, sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString)) + if ps := patu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if patu.mutation.CreatedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := patu.mutation.UpdatedAt(); ok { + _spec.SetField(personalaccesstoken.FieldUpdatedAt, field.TypeTime, value) + } + if patu.mutation.UpdatedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldUpdatedAt, field.TypeTime) + } + if patu.mutation.CreatedByCleared() { + _spec.ClearField(personalaccesstoken.FieldCreatedBy, field.TypeString) + } + if value, ok := patu.mutation.UpdatedBy(); ok { + _spec.SetField(personalaccesstoken.FieldUpdatedBy, field.TypeString, value) + } + if patu.mutation.UpdatedByCleared() { + _spec.ClearField(personalaccesstoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := patu.mutation.DeletedAt(); ok { + _spec.SetField(personalaccesstoken.FieldDeletedAt, field.TypeTime, value) + } + if patu.mutation.DeletedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := patu.mutation.DeletedBy(); ok { + _spec.SetField(personalaccesstoken.FieldDeletedBy, field.TypeString, value) + } + if patu.mutation.DeletedByCleared() { + _spec.ClearField(personalaccesstoken.FieldDeletedBy, field.TypeString) + } + if value, ok := patu.mutation.Tags(); ok { + _spec.SetField(personalaccesstoken.FieldTags, field.TypeJSON, value) + } + if value, ok := patu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, personalaccesstoken.FieldTags, value) + }) + } + if patu.mutation.TagsCleared() { + _spec.ClearField(personalaccesstoken.FieldTags, field.TypeJSON) + } + if value, ok := patu.mutation.Name(); ok { + _spec.SetField(personalaccesstoken.FieldName, field.TypeString, value) + } + if value, ok := patu.mutation.ExpiresAt(); ok { + _spec.SetField(personalaccesstoken.FieldExpiresAt, field.TypeTime, value) + } + if patu.mutation.ExpiresAtCleared() { + _spec.ClearField(personalaccesstoken.FieldExpiresAt, field.TypeTime) + } + if value, ok := patu.mutation.Description(); ok { + _spec.SetField(personalaccesstoken.FieldDescription, field.TypeString, value) + } + if patu.mutation.DescriptionCleared() { + _spec.ClearField(personalaccesstoken.FieldDescription, field.TypeString) + } + if value, ok := patu.mutation.Scopes(); ok { + _spec.SetField(personalaccesstoken.FieldScopes, field.TypeJSON, value) + } + if value, ok := patu.mutation.AppendedScopes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, personalaccesstoken.FieldScopes, value) + }) + } + if patu.mutation.ScopesCleared() { + _spec.ClearField(personalaccesstoken.FieldScopes, field.TypeJSON) + } + if value, ok := patu.mutation.LastUsedAt(); ok { + _spec.SetField(personalaccesstoken.FieldLastUsedAt, field.TypeTime, value) + } + if patu.mutation.LastUsedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldLastUsedAt, field.TypeTime) + } + if patu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: personalaccesstoken.OwnerTable, + Columns: []string{personalaccesstoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.PersonalAccessToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: personalaccesstoken.OwnerTable, + Columns: []string{personalaccesstoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if patu.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.OrganizationPersonalAccessTokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patu.mutation.RemovedOrganizationsIDs(); len(nodes) > 0 && !patu.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patu.mutation.OrganizationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if patu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.PersonalAccessTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !patu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = patu.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = patu.schemaConfig.PersonalAccessToken + ctx = internal.NewSchemaConfigContext(ctx, patu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, patu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{personalaccesstoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + patu.mutation.done = true + return n, nil +} + +// PersonalAccessTokenUpdateOne is the builder for updating a single PersonalAccessToken entity. +type PersonalAccessTokenUpdateOne struct { + config + fields []string + hooks []Hook + mutation *PersonalAccessTokenMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (patuo *PersonalAccessTokenUpdateOne) SetUpdatedAt(t time.Time) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetUpdatedAt(t) + return patuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearUpdatedAt() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearUpdatedAt() + return patuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (patuo *PersonalAccessTokenUpdateOne) SetUpdatedBy(s string) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetUpdatedBy(s) + return patuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableUpdatedBy(s *string) *PersonalAccessTokenUpdateOne { + if s != nil { + patuo.SetUpdatedBy(*s) + } + return patuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearUpdatedBy() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearUpdatedBy() + return patuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (patuo *PersonalAccessTokenUpdateOne) SetDeletedAt(t time.Time) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetDeletedAt(t) + return patuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableDeletedAt(t *time.Time) *PersonalAccessTokenUpdateOne { + if t != nil { + patuo.SetDeletedAt(*t) + } + return patuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearDeletedAt() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearDeletedAt() + return patuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (patuo *PersonalAccessTokenUpdateOne) SetDeletedBy(s string) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetDeletedBy(s) + return patuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableDeletedBy(s *string) *PersonalAccessTokenUpdateOne { + if s != nil { + patuo.SetDeletedBy(*s) + } + return patuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearDeletedBy() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearDeletedBy() + return patuo +} + +// SetTags sets the "tags" field. +func (patuo *PersonalAccessTokenUpdateOne) SetTags(s []string) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetTags(s) + return patuo +} + +// AppendTags appends s to the "tags" field. +func (patuo *PersonalAccessTokenUpdateOne) AppendTags(s []string) *PersonalAccessTokenUpdateOne { + patuo.mutation.AppendTags(s) + return patuo +} + +// ClearTags clears the value of the "tags" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearTags() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearTags() + return patuo +} + +// SetOwnerID sets the "owner_id" field. +func (patuo *PersonalAccessTokenUpdateOne) SetOwnerID(s string) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetOwnerID(s) + return patuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableOwnerID(s *string) *PersonalAccessTokenUpdateOne { + if s != nil { + patuo.SetOwnerID(*s) + } + return patuo +} + +// SetName sets the "name" field. +func (patuo *PersonalAccessTokenUpdateOne) SetName(s string) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetName(s) + return patuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableName(s *string) *PersonalAccessTokenUpdateOne { + if s != nil { + patuo.SetName(*s) + } + return patuo +} + +// SetExpiresAt sets the "expires_at" field. +func (patuo *PersonalAccessTokenUpdateOne) SetExpiresAt(t time.Time) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetExpiresAt(t) + return patuo +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableExpiresAt(t *time.Time) *PersonalAccessTokenUpdateOne { + if t != nil { + patuo.SetExpiresAt(*t) + } + return patuo +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearExpiresAt() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearExpiresAt() + return patuo +} + +// SetDescription sets the "description" field. +func (patuo *PersonalAccessTokenUpdateOne) SetDescription(s string) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetDescription(s) + return patuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableDescription(s *string) *PersonalAccessTokenUpdateOne { + if s != nil { + patuo.SetDescription(*s) + } + return patuo +} + +// ClearDescription clears the value of the "description" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearDescription() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearDescription() + return patuo +} + +// SetScopes sets the "scopes" field. +func (patuo *PersonalAccessTokenUpdateOne) SetScopes(s []string) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetScopes(s) + return patuo +} + +// AppendScopes appends s to the "scopes" field. +func (patuo *PersonalAccessTokenUpdateOne) AppendScopes(s []string) *PersonalAccessTokenUpdateOne { + patuo.mutation.AppendScopes(s) + return patuo +} + +// ClearScopes clears the value of the "scopes" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearScopes() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearScopes() + return patuo +} + +// SetLastUsedAt sets the "last_used_at" field. +func (patuo *PersonalAccessTokenUpdateOne) SetLastUsedAt(t time.Time) *PersonalAccessTokenUpdateOne { + patuo.mutation.SetLastUsedAt(t) + return patuo +} + +// SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil. +func (patuo *PersonalAccessTokenUpdateOne) SetNillableLastUsedAt(t *time.Time) *PersonalAccessTokenUpdateOne { + if t != nil { + patuo.SetLastUsedAt(*t) + } + return patuo +} + +// ClearLastUsedAt clears the value of the "last_used_at" field. +func (patuo *PersonalAccessTokenUpdateOne) ClearLastUsedAt() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearLastUsedAt() + return patuo +} + +// SetOwner sets the "owner" edge to the User entity. +func (patuo *PersonalAccessTokenUpdateOne) SetOwner(u *User) *PersonalAccessTokenUpdateOne { + return patuo.SetOwnerID(u.ID) +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs. +func (patuo *PersonalAccessTokenUpdateOne) AddOrganizationIDs(ids ...string) *PersonalAccessTokenUpdateOne { + patuo.mutation.AddOrganizationIDs(ids...) + return patuo +} + +// AddOrganizations adds the "organizations" edges to the Organization entity. +func (patuo *PersonalAccessTokenUpdateOne) AddOrganizations(o ...*Organization) *PersonalAccessTokenUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return patuo.AddOrganizationIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (patuo *PersonalAccessTokenUpdateOne) AddEventIDs(ids ...string) *PersonalAccessTokenUpdateOne { + patuo.mutation.AddEventIDs(ids...) + return patuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (patuo *PersonalAccessTokenUpdateOne) AddEvents(e ...*Event) *PersonalAccessTokenUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return patuo.AddEventIDs(ids...) +} + +// Mutation returns the PersonalAccessTokenMutation object of the builder. +func (patuo *PersonalAccessTokenUpdateOne) Mutation() *PersonalAccessTokenMutation { + return patuo.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (patuo *PersonalAccessTokenUpdateOne) ClearOwner() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearOwner() + return patuo +} + +// ClearOrganizations clears all "organizations" edges to the Organization entity. +func (patuo *PersonalAccessTokenUpdateOne) ClearOrganizations() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearOrganizations() + return patuo +} + +// RemoveOrganizationIDs removes the "organizations" edge to Organization entities by IDs. +func (patuo *PersonalAccessTokenUpdateOne) RemoveOrganizationIDs(ids ...string) *PersonalAccessTokenUpdateOne { + patuo.mutation.RemoveOrganizationIDs(ids...) + return patuo +} + +// RemoveOrganizations removes "organizations" edges to Organization entities. +func (patuo *PersonalAccessTokenUpdateOne) RemoveOrganizations(o ...*Organization) *PersonalAccessTokenUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return patuo.RemoveOrganizationIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (patuo *PersonalAccessTokenUpdateOne) ClearEvents() *PersonalAccessTokenUpdateOne { + patuo.mutation.ClearEvents() + return patuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (patuo *PersonalAccessTokenUpdateOne) RemoveEventIDs(ids ...string) *PersonalAccessTokenUpdateOne { + patuo.mutation.RemoveEventIDs(ids...) + return patuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (patuo *PersonalAccessTokenUpdateOne) RemoveEvents(e ...*Event) *PersonalAccessTokenUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return patuo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the PersonalAccessTokenUpdate builder. +func (patuo *PersonalAccessTokenUpdateOne) Where(ps ...predicate.PersonalAccessToken) *PersonalAccessTokenUpdateOne { + patuo.mutation.Where(ps...) + return patuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (patuo *PersonalAccessTokenUpdateOne) Select(field string, fields ...string) *PersonalAccessTokenUpdateOne { + patuo.fields = append([]string{field}, fields...) + return patuo +} + +// Save executes the query and returns the updated PersonalAccessToken entity. +func (patuo *PersonalAccessTokenUpdateOne) Save(ctx context.Context) (*PersonalAccessToken, error) { + if err := patuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, patuo.sqlSave, patuo.mutation, patuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (patuo *PersonalAccessTokenUpdateOne) SaveX(ctx context.Context) *PersonalAccessToken { + node, err := patuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (patuo *PersonalAccessTokenUpdateOne) Exec(ctx context.Context) error { + _, err := patuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (patuo *PersonalAccessTokenUpdateOne) ExecX(ctx context.Context) { + if err := patuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (patuo *PersonalAccessTokenUpdateOne) defaults() error { + if _, ok := patuo.mutation.UpdatedAt(); !ok && !patuo.mutation.UpdatedAtCleared() { + if personalaccesstoken.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized personalaccesstoken.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := personalaccesstoken.UpdateDefaultUpdatedAt() + patuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (patuo *PersonalAccessTokenUpdateOne) check() error { + if v, ok := patuo.mutation.Name(); ok { + if err := personalaccesstoken.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "PersonalAccessToken.name": %w`, err)} + } + } + if patuo.mutation.OwnerCleared() && len(patuo.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "PersonalAccessToken.owner"`) + } + return nil +} + +func (patuo *PersonalAccessTokenUpdateOne) sqlSave(ctx context.Context) (_node *PersonalAccessToken, err error) { + if err := patuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(personalaccesstoken.Table, personalaccesstoken.Columns, sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString)) + id, ok := patuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "PersonalAccessToken.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := patuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, personalaccesstoken.FieldID) + for _, f := range fields { + if !personalaccesstoken.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != personalaccesstoken.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := patuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if patuo.mutation.CreatedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldCreatedAt, field.TypeTime) + } + if value, ok := patuo.mutation.UpdatedAt(); ok { + _spec.SetField(personalaccesstoken.FieldUpdatedAt, field.TypeTime, value) + } + if patuo.mutation.UpdatedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldUpdatedAt, field.TypeTime) + } + if patuo.mutation.CreatedByCleared() { + _spec.ClearField(personalaccesstoken.FieldCreatedBy, field.TypeString) + } + if value, ok := patuo.mutation.UpdatedBy(); ok { + _spec.SetField(personalaccesstoken.FieldUpdatedBy, field.TypeString, value) + } + if patuo.mutation.UpdatedByCleared() { + _spec.ClearField(personalaccesstoken.FieldUpdatedBy, field.TypeString) + } + if value, ok := patuo.mutation.DeletedAt(); ok { + _spec.SetField(personalaccesstoken.FieldDeletedAt, field.TypeTime, value) + } + if patuo.mutation.DeletedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldDeletedAt, field.TypeTime) + } + if value, ok := patuo.mutation.DeletedBy(); ok { + _spec.SetField(personalaccesstoken.FieldDeletedBy, field.TypeString, value) + } + if patuo.mutation.DeletedByCleared() { + _spec.ClearField(personalaccesstoken.FieldDeletedBy, field.TypeString) + } + if value, ok := patuo.mutation.Tags(); ok { + _spec.SetField(personalaccesstoken.FieldTags, field.TypeJSON, value) + } + if value, ok := patuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, personalaccesstoken.FieldTags, value) + }) + } + if patuo.mutation.TagsCleared() { + _spec.ClearField(personalaccesstoken.FieldTags, field.TypeJSON) + } + if value, ok := patuo.mutation.Name(); ok { + _spec.SetField(personalaccesstoken.FieldName, field.TypeString, value) + } + if value, ok := patuo.mutation.ExpiresAt(); ok { + _spec.SetField(personalaccesstoken.FieldExpiresAt, field.TypeTime, value) + } + if patuo.mutation.ExpiresAtCleared() { + _spec.ClearField(personalaccesstoken.FieldExpiresAt, field.TypeTime) + } + if value, ok := patuo.mutation.Description(); ok { + _spec.SetField(personalaccesstoken.FieldDescription, field.TypeString, value) + } + if patuo.mutation.DescriptionCleared() { + _spec.ClearField(personalaccesstoken.FieldDescription, field.TypeString) + } + if value, ok := patuo.mutation.Scopes(); ok { + _spec.SetField(personalaccesstoken.FieldScopes, field.TypeJSON, value) + } + if value, ok := patuo.mutation.AppendedScopes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, personalaccesstoken.FieldScopes, value) + }) + } + if patuo.mutation.ScopesCleared() { + _spec.ClearField(personalaccesstoken.FieldScopes, field.TypeJSON) + } + if value, ok := patuo.mutation.LastUsedAt(); ok { + _spec.SetField(personalaccesstoken.FieldLastUsedAt, field.TypeTime, value) + } + if patuo.mutation.LastUsedAtCleared() { + _spec.ClearField(personalaccesstoken.FieldLastUsedAt, field.TypeTime) + } + if patuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: personalaccesstoken.OwnerTable, + Columns: []string{personalaccesstoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.PersonalAccessToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: personalaccesstoken.OwnerTable, + Columns: []string{personalaccesstoken.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if patuo.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.OrganizationPersonalAccessTokens + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patuo.mutation.RemovedOrganizationsIDs(); len(nodes) > 0 && !patuo.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patuo.mutation.OrganizationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: personalaccesstoken.OrganizationsTable, + Columns: personalaccesstoken.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.OrganizationPersonalAccessTokens + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if patuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.PersonalAccessTokenEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !patuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := patuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: personalaccesstoken.EventsTable, + Columns: personalaccesstoken.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = patuo.schemaConfig.PersonalAccessTokenEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = patuo.schemaConfig.PersonalAccessToken + ctx = internal.NewSchemaConfigContext(ctx, patuo.schemaConfig) + _node = &PersonalAccessToken{config: patuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, patuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{personalaccesstoken.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + patuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/predicate/predicate.go b/internal/ent/generated/predicate/predicate.go new file mode 100644 index 0000000..40cc4ea --- /dev/null +++ b/internal/ent/generated/predicate/predicate.go @@ -0,0 +1,178 @@ +// Code generated by ent, DO NOT EDIT. + +package predicate + +import ( + "entgo.io/ent/dialect/sql" +) + +// APIToken is the predicate function for apitoken builders. +type APIToken func(*sql.Selector) + +// Contact is the predicate function for contact builders. +type Contact func(*sql.Selector) + +// ContactHistory is the predicate function for contacthistory builders. +type ContactHistory func(*sql.Selector) + +// DocumentData is the predicate function for documentdata builders. +type DocumentData func(*sql.Selector) + +// DocumentDataHistory is the predicate function for documentdatahistory builders. +type DocumentDataHistory func(*sql.Selector) + +// EmailVerificationToken is the predicate function for emailverificationtoken builders. +type EmailVerificationToken func(*sql.Selector) + +// Entitlement is the predicate function for entitlement builders. +type Entitlement func(*sql.Selector) + +// EntitlementHistory is the predicate function for entitlementhistory builders. +type EntitlementHistory func(*sql.Selector) + +// EntitlementPlan is the predicate function for entitlementplan builders. +type EntitlementPlan func(*sql.Selector) + +// EntitlementPlanFeature is the predicate function for entitlementplanfeature builders. +type EntitlementPlanFeature func(*sql.Selector) + +// EntitlementPlanFeatureHistory is the predicate function for entitlementplanfeaturehistory builders. +type EntitlementPlanFeatureHistory func(*sql.Selector) + +// EntitlementPlanHistory is the predicate function for entitlementplanhistory builders. +type EntitlementPlanHistory func(*sql.Selector) + +// Entity is the predicate function for entity builders. +type Entity func(*sql.Selector) + +// EntityHistory is the predicate function for entityhistory builders. +type EntityHistory func(*sql.Selector) + +// EntityType is the predicate function for entitytype builders. +type EntityType func(*sql.Selector) + +// EntityTypeHistory is the predicate function for entitytypehistory builders. +type EntityTypeHistory func(*sql.Selector) + +// Event is the predicate function for event builders. +type Event func(*sql.Selector) + +// EventHistory is the predicate function for eventhistory builders. +type EventHistory func(*sql.Selector) + +// Feature is the predicate function for feature builders. +type Feature func(*sql.Selector) + +// FeatureHistory is the predicate function for featurehistory builders. +type FeatureHistory func(*sql.Selector) + +// File is the predicate function for file builders. +type File func(*sql.Selector) + +// FileHistory is the predicate function for filehistory builders. +type FileHistory func(*sql.Selector) + +// Group is the predicate function for group builders. +type Group func(*sql.Selector) + +// GroupHistory is the predicate function for grouphistory builders. +type GroupHistory func(*sql.Selector) + +// GroupMembership is the predicate function for groupmembership builders. +type GroupMembership func(*sql.Selector) + +// GroupMembershipHistory is the predicate function for groupmembershiphistory builders. +type GroupMembershipHistory func(*sql.Selector) + +// GroupSetting is the predicate function for groupsetting builders. +type GroupSetting func(*sql.Selector) + +// GroupSettingHistory is the predicate function for groupsettinghistory builders. +type GroupSettingHistory func(*sql.Selector) + +// Hush is the predicate function for hush builders. +type Hush func(*sql.Selector) + +// HushHistory is the predicate function for hushhistory builders. +type HushHistory func(*sql.Selector) + +// Integration is the predicate function for integration builders. +type Integration func(*sql.Selector) + +// IntegrationHistory is the predicate function for integrationhistory builders. +type IntegrationHistory func(*sql.Selector) + +// Invite is the predicate function for invite builders. +type Invite func(*sql.Selector) + +// Note is the predicate function for note builders. +type Note func(*sql.Selector) + +// NoteHistory is the predicate function for notehistory builders. +type NoteHistory func(*sql.Selector) + +// OauthProvider is the predicate function for oauthprovider builders. +type OauthProvider func(*sql.Selector) + +// OauthProviderHistory is the predicate function for oauthproviderhistory builders. +type OauthProviderHistory func(*sql.Selector) + +// OhAuthTooToken is the predicate function for ohauthtootoken builders. +type OhAuthTooToken func(*sql.Selector) + +// OrgMembership is the predicate function for orgmembership builders. +type OrgMembership func(*sql.Selector) + +// OrgMembershipHistory is the predicate function for orgmembershiphistory builders. +type OrgMembershipHistory func(*sql.Selector) + +// Organization is the predicate function for organization builders. +type Organization func(*sql.Selector) + +// OrganizationHistory is the predicate function for organizationhistory builders. +type OrganizationHistory func(*sql.Selector) + +// OrganizationSetting is the predicate function for organizationsetting builders. +type OrganizationSetting func(*sql.Selector) + +// OrganizationSettingHistory is the predicate function for organizationsettinghistory builders. +type OrganizationSettingHistory func(*sql.Selector) + +// PasswordResetToken is the predicate function for passwordresettoken builders. +type PasswordResetToken func(*sql.Selector) + +// PersonalAccessToken is the predicate function for personalaccesstoken builders. +type PersonalAccessToken func(*sql.Selector) + +// Subscriber is the predicate function for subscriber builders. +type Subscriber func(*sql.Selector) + +// TFASetting is the predicate function for tfasetting builders. +type TFASetting func(*sql.Selector) + +// Template is the predicate function for template builders. +type Template func(*sql.Selector) + +// TemplateHistory is the predicate function for templatehistory builders. +type TemplateHistory func(*sql.Selector) + +// User is the predicate function for user builders. +type User func(*sql.Selector) + +// UserHistory is the predicate function for userhistory builders. +type UserHistory func(*sql.Selector) + +// UserSetting is the predicate function for usersetting builders. +type UserSetting func(*sql.Selector) + +// UserSettingHistory is the predicate function for usersettinghistory builders. +type UserSettingHistory func(*sql.Selector) + +// Webauthn is the predicate function for webauthn builders. +type Webauthn func(*sql.Selector) + +// Webhook is the predicate function for webhook builders. +type Webhook func(*sql.Selector) + +// WebhookHistory is the predicate function for webhookhistory builders. +type WebhookHistory func(*sql.Selector) diff --git a/internal/ent/generated/privacy/privacy.go b/internal/ent/generated/privacy/privacy.go new file mode 100644 index 0000000..3aa4dae --- /dev/null +++ b/internal/ent/generated/privacy/privacy.go @@ -0,0 +1,1755 @@ +// Code generated by ent, DO NOT EDIT. + +package privacy + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated" + + "entgo.io/ent/entql" + "entgo.io/ent/privacy" +) + +var ( + // Allow may be returned by rules to indicate that the policy + // evaluation should terminate with allow decision. + Allow = privacy.Allow + + // Deny may be returned by rules to indicate that the policy + // evaluation should terminate with deny decision. + Deny = privacy.Deny + + // Skip may be returned by rules to indicate that the policy + // evaluation should continue to the next rule. + Skip = privacy.Skip +) + +// Allowf returns a formatted wrapped Allow decision. +func Allowf(format string, a ...any) error { + return privacy.Allowf(format, a...) +} + +// Denyf returns a formatted wrapped Deny decision. +func Denyf(format string, a ...any) error { + return privacy.Denyf(format, a...) +} + +// Skipf returns a formatted wrapped Skip decision. +func Skipf(format string, a ...any) error { + return privacy.Skipf(format, a...) +} + +// DecisionContext creates a new context from the given parent context with +// a policy decision attach to it. +func DecisionContext(parent context.Context, decision error) context.Context { + return privacy.DecisionContext(parent, decision) +} + +// DecisionFromContext retrieves the policy decision from the context. +func DecisionFromContext(ctx context.Context) (error, bool) { + return privacy.DecisionFromContext(ctx) +} + +type ( + // Policy groups query and mutation policies. + Policy = privacy.Policy + + // QueryRule defines the interface deciding whether a + // query is allowed and optionally modify it. + QueryRule = privacy.QueryRule + // QueryPolicy combines multiple query rules into a single policy. + QueryPolicy = privacy.QueryPolicy + + // MutationRule defines the interface which decides whether a + // mutation is allowed and optionally modifies it. + MutationRule = privacy.MutationRule + // MutationPolicy combines multiple mutation rules into a single policy. + MutationPolicy = privacy.MutationPolicy + // MutationRuleFunc type is an adapter which allows the use of + // ordinary functions as mutation rules. + MutationRuleFunc = privacy.MutationRuleFunc + + // QueryMutationRule is an interface which groups query and mutation rules. + QueryMutationRule = privacy.QueryMutationRule +) + +// QueryRuleFunc type is an adapter to allow the use of +// ordinary functions as query rules. +type QueryRuleFunc func(context.Context, generated.Query) error + +// Eval returns f(ctx, q). +func (f QueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + return f(ctx, q) +} + +// AlwaysAllowRule returns a rule that returns an allow decision. +func AlwaysAllowRule() QueryMutationRule { + return privacy.AlwaysAllowRule() +} + +// AlwaysDenyRule returns a rule that returns a deny decision. +func AlwaysDenyRule() QueryMutationRule { + return privacy.AlwaysDenyRule() +} + +// ContextQueryMutationRule creates a query/mutation rule from a context eval func. +func ContextQueryMutationRule(eval func(context.Context) error) QueryMutationRule { + return privacy.ContextQueryMutationRule(eval) +} + +// OnMutationOperation evaluates the given rule only on a given mutation operation. +func OnMutationOperation(rule MutationRule, op generated.Op) MutationRule { + return privacy.OnMutationOperation(rule, op) +} + +// DenyMutationOperationRule returns a rule denying specified mutation operation. +func DenyMutationOperationRule(op generated.Op) MutationRule { + rule := MutationRuleFunc(func(_ context.Context, m generated.Mutation) error { + return Denyf("generated/privacy: operation %s is not allowed", m.Op()) + }) + return OnMutationOperation(rule, op) +} + +// The APITokenQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type APITokenQueryRuleFunc func(context.Context, *generated.APITokenQuery) error + +// EvalQuery return f(ctx, q). +func (f APITokenQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.APITokenQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.APITokenQuery", q) +} + +// The APITokenMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type APITokenMutationRuleFunc func(context.Context, *generated.APITokenMutation) error + +// EvalMutation calls f(ctx, m). +func (f APITokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.APITokenMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.APITokenMutation", m) +} + +// The ContactQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type ContactQueryRuleFunc func(context.Context, *generated.ContactQuery) error + +// EvalQuery return f(ctx, q). +func (f ContactQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.ContactQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.ContactQuery", q) +} + +// The ContactMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type ContactMutationRuleFunc func(context.Context, *generated.ContactMutation) error + +// EvalMutation calls f(ctx, m). +func (f ContactMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.ContactMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.ContactMutation", m) +} + +// The ContactHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type ContactHistoryQueryRuleFunc func(context.Context, *generated.ContactHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f ContactHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.ContactHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.ContactHistoryQuery", q) +} + +// The ContactHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type ContactHistoryMutationRuleFunc func(context.Context, *generated.ContactHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f ContactHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.ContactHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.ContactHistoryMutation", m) +} + +// The DocumentDataQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type DocumentDataQueryRuleFunc func(context.Context, *generated.DocumentDataQuery) error + +// EvalQuery return f(ctx, q). +func (f DocumentDataQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.DocumentDataQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.DocumentDataQuery", q) +} + +// The DocumentDataMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type DocumentDataMutationRuleFunc func(context.Context, *generated.DocumentDataMutation) error + +// EvalMutation calls f(ctx, m). +func (f DocumentDataMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.DocumentDataMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.DocumentDataMutation", m) +} + +// The DocumentDataHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type DocumentDataHistoryQueryRuleFunc func(context.Context, *generated.DocumentDataHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f DocumentDataHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.DocumentDataHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.DocumentDataHistoryQuery", q) +} + +// The DocumentDataHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type DocumentDataHistoryMutationRuleFunc func(context.Context, *generated.DocumentDataHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f DocumentDataHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.DocumentDataHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.DocumentDataHistoryMutation", m) +} + +// The EmailVerificationTokenQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EmailVerificationTokenQueryRuleFunc func(context.Context, *generated.EmailVerificationTokenQuery) error + +// EvalQuery return f(ctx, q). +func (f EmailVerificationTokenQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EmailVerificationTokenQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EmailVerificationTokenQuery", q) +} + +// The EmailVerificationTokenMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EmailVerificationTokenMutationRuleFunc func(context.Context, *generated.EmailVerificationTokenMutation) error + +// EvalMutation calls f(ctx, m). +func (f EmailVerificationTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EmailVerificationTokenMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EmailVerificationTokenMutation", m) +} + +// The EntitlementQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntitlementQueryRuleFunc func(context.Context, *generated.EntitlementQuery) error + +// EvalQuery return f(ctx, q). +func (f EntitlementQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntitlementQuery", q) +} + +// The EntitlementMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntitlementMutationRuleFunc func(context.Context, *generated.EntitlementMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntitlementMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntitlementMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntitlementMutation", m) +} + +// The EntitlementHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntitlementHistoryQueryRuleFunc func(context.Context, *generated.EntitlementHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f EntitlementHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntitlementHistoryQuery", q) +} + +// The EntitlementHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntitlementHistoryMutationRuleFunc func(context.Context, *generated.EntitlementHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntitlementHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntitlementHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntitlementHistoryMutation", m) +} + +// The EntitlementPlanQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntitlementPlanQueryRuleFunc func(context.Context, *generated.EntitlementPlanQuery) error + +// EvalQuery return f(ctx, q). +func (f EntitlementPlanQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntitlementPlanQuery", q) +} + +// The EntitlementPlanMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntitlementPlanMutationRuleFunc func(context.Context, *generated.EntitlementPlanMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntitlementPlanMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntitlementPlanMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntitlementPlanMutation", m) +} + +// The EntitlementPlanFeatureQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntitlementPlanFeatureQueryRuleFunc func(context.Context, *generated.EntitlementPlanFeatureQuery) error + +// EvalQuery return f(ctx, q). +func (f EntitlementPlanFeatureQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanFeatureQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntitlementPlanFeatureQuery", q) +} + +// The EntitlementPlanFeatureMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntitlementPlanFeatureMutationRuleFunc func(context.Context, *generated.EntitlementPlanFeatureMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntitlementPlanFeatureMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntitlementPlanFeatureMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntitlementPlanFeatureMutation", m) +} + +// The EntitlementPlanFeatureHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntitlementPlanFeatureHistoryQueryRuleFunc func(context.Context, *generated.EntitlementPlanFeatureHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f EntitlementPlanFeatureHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanFeatureHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntitlementPlanFeatureHistoryQuery", q) +} + +// The EntitlementPlanFeatureHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntitlementPlanFeatureHistoryMutationRuleFunc func(context.Context, *generated.EntitlementPlanFeatureHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntitlementPlanFeatureHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntitlementPlanFeatureHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntitlementPlanFeatureHistoryMutation", m) +} + +// The EntitlementPlanHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntitlementPlanHistoryQueryRuleFunc func(context.Context, *generated.EntitlementPlanHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f EntitlementPlanHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntitlementPlanHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntitlementPlanHistoryQuery", q) +} + +// The EntitlementPlanHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntitlementPlanHistoryMutationRuleFunc func(context.Context, *generated.EntitlementPlanHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntitlementPlanHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntitlementPlanHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntitlementPlanHistoryMutation", m) +} + +// The EntityQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntityQueryRuleFunc func(context.Context, *generated.EntityQuery) error + +// EvalQuery return f(ctx, q). +func (f EntityQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntityQuery", q) +} + +// The EntityMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntityMutationRuleFunc func(context.Context, *generated.EntityMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntityMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntityMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntityMutation", m) +} + +// The EntityHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntityHistoryQueryRuleFunc func(context.Context, *generated.EntityHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f EntityHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntityHistoryQuery", q) +} + +// The EntityHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntityHistoryMutationRuleFunc func(context.Context, *generated.EntityHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntityHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntityHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntityHistoryMutation", m) +} + +// The EntityTypeQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntityTypeQueryRuleFunc func(context.Context, *generated.EntityTypeQuery) error + +// EvalQuery return f(ctx, q). +func (f EntityTypeQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityTypeQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntityTypeQuery", q) +} + +// The EntityTypeMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntityTypeMutationRuleFunc func(context.Context, *generated.EntityTypeMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntityTypeMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntityTypeMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntityTypeMutation", m) +} + +// The EntityTypeHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EntityTypeHistoryQueryRuleFunc func(context.Context, *generated.EntityTypeHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f EntityTypeHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EntityTypeHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EntityTypeHistoryQuery", q) +} + +// The EntityTypeHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EntityTypeHistoryMutationRuleFunc func(context.Context, *generated.EntityTypeHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f EntityTypeHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EntityTypeHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EntityTypeHistoryMutation", m) +} + +// The EventQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EventQueryRuleFunc func(context.Context, *generated.EventQuery) error + +// EvalQuery return f(ctx, q). +func (f EventQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EventQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EventQuery", q) +} + +// The EventMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EventMutationRuleFunc func(context.Context, *generated.EventMutation) error + +// EvalMutation calls f(ctx, m). +func (f EventMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EventMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EventMutation", m) +} + +// The EventHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type EventHistoryQueryRuleFunc func(context.Context, *generated.EventHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f EventHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.EventHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.EventHistoryQuery", q) +} + +// The EventHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type EventHistoryMutationRuleFunc func(context.Context, *generated.EventHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f EventHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.EventHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.EventHistoryMutation", m) +} + +// The FeatureQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type FeatureQueryRuleFunc func(context.Context, *generated.FeatureQuery) error + +// EvalQuery return f(ctx, q). +func (f FeatureQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FeatureQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.FeatureQuery", q) +} + +// The FeatureMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type FeatureMutationRuleFunc func(context.Context, *generated.FeatureMutation) error + +// EvalMutation calls f(ctx, m). +func (f FeatureMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.FeatureMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.FeatureMutation", m) +} + +// The FeatureHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type FeatureHistoryQueryRuleFunc func(context.Context, *generated.FeatureHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f FeatureHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FeatureHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.FeatureHistoryQuery", q) +} + +// The FeatureHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type FeatureHistoryMutationRuleFunc func(context.Context, *generated.FeatureHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f FeatureHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.FeatureHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.FeatureHistoryMutation", m) +} + +// The FileQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type FileQueryRuleFunc func(context.Context, *generated.FileQuery) error + +// EvalQuery return f(ctx, q). +func (f FileQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FileQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.FileQuery", q) +} + +// The FileMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type FileMutationRuleFunc func(context.Context, *generated.FileMutation) error + +// EvalMutation calls f(ctx, m). +func (f FileMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.FileMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.FileMutation", m) +} + +// The FileHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type FileHistoryQueryRuleFunc func(context.Context, *generated.FileHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f FileHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.FileHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.FileHistoryQuery", q) +} + +// The FileHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type FileHistoryMutationRuleFunc func(context.Context, *generated.FileHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f FileHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.FileHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.FileHistoryMutation", m) +} + +// The GroupQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type GroupQueryRuleFunc func(context.Context, *generated.GroupQuery) error + +// EvalQuery return f(ctx, q). +func (f GroupQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.GroupQuery", q) +} + +// The GroupMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type GroupMutationRuleFunc func(context.Context, *generated.GroupMutation) error + +// EvalMutation calls f(ctx, m). +func (f GroupMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.GroupMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.GroupMutation", m) +} + +// The GroupHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type GroupHistoryQueryRuleFunc func(context.Context, *generated.GroupHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f GroupHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.GroupHistoryQuery", q) +} + +// The GroupHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type GroupHistoryMutationRuleFunc func(context.Context, *generated.GroupHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f GroupHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.GroupHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.GroupHistoryMutation", m) +} + +// The GroupMembershipQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type GroupMembershipQueryRuleFunc func(context.Context, *generated.GroupMembershipQuery) error + +// EvalQuery return f(ctx, q). +func (f GroupMembershipQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupMembershipQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.GroupMembershipQuery", q) +} + +// The GroupMembershipMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type GroupMembershipMutationRuleFunc func(context.Context, *generated.GroupMembershipMutation) error + +// EvalMutation calls f(ctx, m). +func (f GroupMembershipMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.GroupMembershipMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.GroupMembershipMutation", m) +} + +// The GroupMembershipHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type GroupMembershipHistoryQueryRuleFunc func(context.Context, *generated.GroupMembershipHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f GroupMembershipHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupMembershipHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.GroupMembershipHistoryQuery", q) +} + +// The GroupMembershipHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type GroupMembershipHistoryMutationRuleFunc func(context.Context, *generated.GroupMembershipHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f GroupMembershipHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.GroupMembershipHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.GroupMembershipHistoryMutation", m) +} + +// The GroupSettingQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type GroupSettingQueryRuleFunc func(context.Context, *generated.GroupSettingQuery) error + +// EvalQuery return f(ctx, q). +func (f GroupSettingQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupSettingQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.GroupSettingQuery", q) +} + +// The GroupSettingMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type GroupSettingMutationRuleFunc func(context.Context, *generated.GroupSettingMutation) error + +// EvalMutation calls f(ctx, m). +func (f GroupSettingMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.GroupSettingMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.GroupSettingMutation", m) +} + +// The GroupSettingHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type GroupSettingHistoryQueryRuleFunc func(context.Context, *generated.GroupSettingHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f GroupSettingHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.GroupSettingHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.GroupSettingHistoryQuery", q) +} + +// The GroupSettingHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type GroupSettingHistoryMutationRuleFunc func(context.Context, *generated.GroupSettingHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f GroupSettingHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.GroupSettingHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.GroupSettingHistoryMutation", m) +} + +// The HushQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type HushQueryRuleFunc func(context.Context, *generated.HushQuery) error + +// EvalQuery return f(ctx, q). +func (f HushQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.HushQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.HushQuery", q) +} + +// The HushMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type HushMutationRuleFunc func(context.Context, *generated.HushMutation) error + +// EvalMutation calls f(ctx, m). +func (f HushMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.HushMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.HushMutation", m) +} + +// The HushHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type HushHistoryQueryRuleFunc func(context.Context, *generated.HushHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f HushHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.HushHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.HushHistoryQuery", q) +} + +// The HushHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type HushHistoryMutationRuleFunc func(context.Context, *generated.HushHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f HushHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.HushHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.HushHistoryMutation", m) +} + +// The IntegrationQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type IntegrationQueryRuleFunc func(context.Context, *generated.IntegrationQuery) error + +// EvalQuery return f(ctx, q). +func (f IntegrationQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.IntegrationQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.IntegrationQuery", q) +} + +// The IntegrationMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type IntegrationMutationRuleFunc func(context.Context, *generated.IntegrationMutation) error + +// EvalMutation calls f(ctx, m). +func (f IntegrationMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.IntegrationMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.IntegrationMutation", m) +} + +// The IntegrationHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type IntegrationHistoryQueryRuleFunc func(context.Context, *generated.IntegrationHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f IntegrationHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.IntegrationHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.IntegrationHistoryQuery", q) +} + +// The IntegrationHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type IntegrationHistoryMutationRuleFunc func(context.Context, *generated.IntegrationHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f IntegrationHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.IntegrationHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.IntegrationHistoryMutation", m) +} + +// The InviteQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type InviteQueryRuleFunc func(context.Context, *generated.InviteQuery) error + +// EvalQuery return f(ctx, q). +func (f InviteQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.InviteQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.InviteQuery", q) +} + +// The InviteMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type InviteMutationRuleFunc func(context.Context, *generated.InviteMutation) error + +// EvalMutation calls f(ctx, m). +func (f InviteMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.InviteMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.InviteMutation", m) +} + +// The NoteQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type NoteQueryRuleFunc func(context.Context, *generated.NoteQuery) error + +// EvalQuery return f(ctx, q). +func (f NoteQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.NoteQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.NoteQuery", q) +} + +// The NoteMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type NoteMutationRuleFunc func(context.Context, *generated.NoteMutation) error + +// EvalMutation calls f(ctx, m). +func (f NoteMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.NoteMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.NoteMutation", m) +} + +// The NoteHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type NoteHistoryQueryRuleFunc func(context.Context, *generated.NoteHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f NoteHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.NoteHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.NoteHistoryQuery", q) +} + +// The NoteHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type NoteHistoryMutationRuleFunc func(context.Context, *generated.NoteHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f NoteHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.NoteHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.NoteHistoryMutation", m) +} + +// The OauthProviderQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OauthProviderQueryRuleFunc func(context.Context, *generated.OauthProviderQuery) error + +// EvalQuery return f(ctx, q). +func (f OauthProviderQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OauthProviderQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OauthProviderQuery", q) +} + +// The OauthProviderMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OauthProviderMutationRuleFunc func(context.Context, *generated.OauthProviderMutation) error + +// EvalMutation calls f(ctx, m). +func (f OauthProviderMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OauthProviderMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OauthProviderMutation", m) +} + +// The OauthProviderHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OauthProviderHistoryQueryRuleFunc func(context.Context, *generated.OauthProviderHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f OauthProviderHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OauthProviderHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OauthProviderHistoryQuery", q) +} + +// The OauthProviderHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OauthProviderHistoryMutationRuleFunc func(context.Context, *generated.OauthProviderHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f OauthProviderHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OauthProviderHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OauthProviderHistoryMutation", m) +} + +// The OhAuthTooTokenQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OhAuthTooTokenQueryRuleFunc func(context.Context, *generated.OhAuthTooTokenQuery) error + +// EvalQuery return f(ctx, q). +func (f OhAuthTooTokenQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OhAuthTooTokenQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OhAuthTooTokenQuery", q) +} + +// The OhAuthTooTokenMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OhAuthTooTokenMutationRuleFunc func(context.Context, *generated.OhAuthTooTokenMutation) error + +// EvalMutation calls f(ctx, m). +func (f OhAuthTooTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OhAuthTooTokenMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OhAuthTooTokenMutation", m) +} + +// The OrgMembershipQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OrgMembershipQueryRuleFunc func(context.Context, *generated.OrgMembershipQuery) error + +// EvalQuery return f(ctx, q). +func (f OrgMembershipQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrgMembershipQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OrgMembershipQuery", q) +} + +// The OrgMembershipMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OrgMembershipMutationRuleFunc func(context.Context, *generated.OrgMembershipMutation) error + +// EvalMutation calls f(ctx, m). +func (f OrgMembershipMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OrgMembershipMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OrgMembershipMutation", m) +} + +// The OrgMembershipHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OrgMembershipHistoryQueryRuleFunc func(context.Context, *generated.OrgMembershipHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f OrgMembershipHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrgMembershipHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OrgMembershipHistoryQuery", q) +} + +// The OrgMembershipHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OrgMembershipHistoryMutationRuleFunc func(context.Context, *generated.OrgMembershipHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f OrgMembershipHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OrgMembershipHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OrgMembershipHistoryMutation", m) +} + +// The OrganizationQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OrganizationQueryRuleFunc func(context.Context, *generated.OrganizationQuery) error + +// EvalQuery return f(ctx, q). +func (f OrganizationQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OrganizationQuery", q) +} + +// The OrganizationMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OrganizationMutationRuleFunc func(context.Context, *generated.OrganizationMutation) error + +// EvalMutation calls f(ctx, m). +func (f OrganizationMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OrganizationMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OrganizationMutation", m) +} + +// The OrganizationHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OrganizationHistoryQueryRuleFunc func(context.Context, *generated.OrganizationHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f OrganizationHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OrganizationHistoryQuery", q) +} + +// The OrganizationHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OrganizationHistoryMutationRuleFunc func(context.Context, *generated.OrganizationHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f OrganizationHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OrganizationHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OrganizationHistoryMutation", m) +} + +// The OrganizationSettingQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OrganizationSettingQueryRuleFunc func(context.Context, *generated.OrganizationSettingQuery) error + +// EvalQuery return f(ctx, q). +func (f OrganizationSettingQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationSettingQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OrganizationSettingQuery", q) +} + +// The OrganizationSettingMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OrganizationSettingMutationRuleFunc func(context.Context, *generated.OrganizationSettingMutation) error + +// EvalMutation calls f(ctx, m). +func (f OrganizationSettingMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OrganizationSettingMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OrganizationSettingMutation", m) +} + +// The OrganizationSettingHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type OrganizationSettingHistoryQueryRuleFunc func(context.Context, *generated.OrganizationSettingHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f OrganizationSettingHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.OrganizationSettingHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.OrganizationSettingHistoryQuery", q) +} + +// The OrganizationSettingHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type OrganizationSettingHistoryMutationRuleFunc func(context.Context, *generated.OrganizationSettingHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f OrganizationSettingHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.OrganizationSettingHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.OrganizationSettingHistoryMutation", m) +} + +// The PasswordResetTokenQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type PasswordResetTokenQueryRuleFunc func(context.Context, *generated.PasswordResetTokenQuery) error + +// EvalQuery return f(ctx, q). +func (f PasswordResetTokenQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.PasswordResetTokenQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.PasswordResetTokenQuery", q) +} + +// The PasswordResetTokenMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type PasswordResetTokenMutationRuleFunc func(context.Context, *generated.PasswordResetTokenMutation) error + +// EvalMutation calls f(ctx, m). +func (f PasswordResetTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.PasswordResetTokenMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.PasswordResetTokenMutation", m) +} + +// The PersonalAccessTokenQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type PersonalAccessTokenQueryRuleFunc func(context.Context, *generated.PersonalAccessTokenQuery) error + +// EvalQuery return f(ctx, q). +func (f PersonalAccessTokenQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.PersonalAccessTokenQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.PersonalAccessTokenQuery", q) +} + +// The PersonalAccessTokenMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type PersonalAccessTokenMutationRuleFunc func(context.Context, *generated.PersonalAccessTokenMutation) error + +// EvalMutation calls f(ctx, m). +func (f PersonalAccessTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.PersonalAccessTokenMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.PersonalAccessTokenMutation", m) +} + +// The SubscriberQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type SubscriberQueryRuleFunc func(context.Context, *generated.SubscriberQuery) error + +// EvalQuery return f(ctx, q). +func (f SubscriberQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.SubscriberQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.SubscriberQuery", q) +} + +// The SubscriberMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type SubscriberMutationRuleFunc func(context.Context, *generated.SubscriberMutation) error + +// EvalMutation calls f(ctx, m). +func (f SubscriberMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.SubscriberMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.SubscriberMutation", m) +} + +// The TFASettingQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type TFASettingQueryRuleFunc func(context.Context, *generated.TFASettingQuery) error + +// EvalQuery return f(ctx, q). +func (f TFASettingQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.TFASettingQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.TFASettingQuery", q) +} + +// The TFASettingMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type TFASettingMutationRuleFunc func(context.Context, *generated.TFASettingMutation) error + +// EvalMutation calls f(ctx, m). +func (f TFASettingMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.TFASettingMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.TFASettingMutation", m) +} + +// The TemplateQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type TemplateQueryRuleFunc func(context.Context, *generated.TemplateQuery) error + +// EvalQuery return f(ctx, q). +func (f TemplateQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.TemplateQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.TemplateQuery", q) +} + +// The TemplateMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type TemplateMutationRuleFunc func(context.Context, *generated.TemplateMutation) error + +// EvalMutation calls f(ctx, m). +func (f TemplateMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.TemplateMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.TemplateMutation", m) +} + +// The TemplateHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type TemplateHistoryQueryRuleFunc func(context.Context, *generated.TemplateHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f TemplateHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.TemplateHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.TemplateHistoryQuery", q) +} + +// The TemplateHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type TemplateHistoryMutationRuleFunc func(context.Context, *generated.TemplateHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f TemplateHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.TemplateHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.TemplateHistoryMutation", m) +} + +// The UserQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type UserQueryRuleFunc func(context.Context, *generated.UserQuery) error + +// EvalQuery return f(ctx, q). +func (f UserQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.UserQuery", q) +} + +// The UserMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type UserMutationRuleFunc func(context.Context, *generated.UserMutation) error + +// EvalMutation calls f(ctx, m). +func (f UserMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.UserMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.UserMutation", m) +} + +// The UserHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type UserHistoryQueryRuleFunc func(context.Context, *generated.UserHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f UserHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.UserHistoryQuery", q) +} + +// The UserHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type UserHistoryMutationRuleFunc func(context.Context, *generated.UserHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f UserHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.UserHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.UserHistoryMutation", m) +} + +// The UserSettingQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type UserSettingQueryRuleFunc func(context.Context, *generated.UserSettingQuery) error + +// EvalQuery return f(ctx, q). +func (f UserSettingQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserSettingQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.UserSettingQuery", q) +} + +// The UserSettingMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type UserSettingMutationRuleFunc func(context.Context, *generated.UserSettingMutation) error + +// EvalMutation calls f(ctx, m). +func (f UserSettingMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.UserSettingMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.UserSettingMutation", m) +} + +// The UserSettingHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type UserSettingHistoryQueryRuleFunc func(context.Context, *generated.UserSettingHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f UserSettingHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.UserSettingHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.UserSettingHistoryQuery", q) +} + +// The UserSettingHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type UserSettingHistoryMutationRuleFunc func(context.Context, *generated.UserSettingHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f UserSettingHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.UserSettingHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.UserSettingHistoryMutation", m) +} + +// The WebauthnQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type WebauthnQueryRuleFunc func(context.Context, *generated.WebauthnQuery) error + +// EvalQuery return f(ctx, q). +func (f WebauthnQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.WebauthnQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.WebauthnQuery", q) +} + +// The WebauthnMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type WebauthnMutationRuleFunc func(context.Context, *generated.WebauthnMutation) error + +// EvalMutation calls f(ctx, m). +func (f WebauthnMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.WebauthnMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.WebauthnMutation", m) +} + +// The WebhookQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type WebhookQueryRuleFunc func(context.Context, *generated.WebhookQuery) error + +// EvalQuery return f(ctx, q). +func (f WebhookQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.WebhookQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.WebhookQuery", q) +} + +// The WebhookMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type WebhookMutationRuleFunc func(context.Context, *generated.WebhookMutation) error + +// EvalMutation calls f(ctx, m). +func (f WebhookMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.WebhookMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.WebhookMutation", m) +} + +// The WebhookHistoryQueryRuleFunc type is an adapter to allow the use of ordinary +// functions as a query rule. +type WebhookHistoryQueryRuleFunc func(context.Context, *generated.WebhookHistoryQuery) error + +// EvalQuery return f(ctx, q). +func (f WebhookHistoryQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error { + if q, ok := q.(*generated.WebhookHistoryQuery); ok { + return f(ctx, q) + } + return Denyf("generated/privacy: unexpected query type %T, expect *generated.WebhookHistoryQuery", q) +} + +// The WebhookHistoryMutationRuleFunc type is an adapter to allow the use of ordinary +// functions as a mutation rule. +type WebhookHistoryMutationRuleFunc func(context.Context, *generated.WebhookHistoryMutation) error + +// EvalMutation calls f(ctx, m). +func (f WebhookHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + if m, ok := m.(*generated.WebhookHistoryMutation); ok { + return f(ctx, m) + } + return Denyf("generated/privacy: unexpected mutation type %T, expect *generated.WebhookHistoryMutation", m) +} + +type ( + // Filter is the interface that wraps the Where function + // for filtering nodes in queries and mutations. + Filter interface { + // Where applies a filter on the executed query/mutation. + Where(entql.P) + } + + // The FilterFunc type is an adapter that allows the use of ordinary + // functions as filters for query and mutation types. + FilterFunc func(context.Context, Filter) error +) + +// EvalQuery calls f(ctx, q) if the query implements the Filter interface, otherwise it is denied. +func (f FilterFunc) EvalQuery(ctx context.Context, q generated.Query) error { + fr, err := queryFilter(q) + if err != nil { + return err + } + return f(ctx, fr) +} + +// EvalMutation calls f(ctx, q) if the mutation implements the Filter interface, otherwise it is denied. +func (f FilterFunc) EvalMutation(ctx context.Context, m generated.Mutation) error { + fr, err := mutationFilter(m) + if err != nil { + return err + } + return f(ctx, fr) +} + +var _ QueryMutationRule = FilterFunc(nil) + +func queryFilter(q generated.Query) (Filter, error) { + switch q := q.(type) { + case *generated.APITokenQuery: + return q.Filter(), nil + case *generated.ContactQuery: + return q.Filter(), nil + case *generated.ContactHistoryQuery: + return q.Filter(), nil + case *generated.DocumentDataQuery: + return q.Filter(), nil + case *generated.DocumentDataHistoryQuery: + return q.Filter(), nil + case *generated.EmailVerificationTokenQuery: + return q.Filter(), nil + case *generated.EntitlementQuery: + return q.Filter(), nil + case *generated.EntitlementHistoryQuery: + return q.Filter(), nil + case *generated.EntitlementPlanQuery: + return q.Filter(), nil + case *generated.EntitlementPlanFeatureQuery: + return q.Filter(), nil + case *generated.EntitlementPlanFeatureHistoryQuery: + return q.Filter(), nil + case *generated.EntitlementPlanHistoryQuery: + return q.Filter(), nil + case *generated.EntityQuery: + return q.Filter(), nil + case *generated.EntityHistoryQuery: + return q.Filter(), nil + case *generated.EntityTypeQuery: + return q.Filter(), nil + case *generated.EntityTypeHistoryQuery: + return q.Filter(), nil + case *generated.EventQuery: + return q.Filter(), nil + case *generated.EventHistoryQuery: + return q.Filter(), nil + case *generated.FeatureQuery: + return q.Filter(), nil + case *generated.FeatureHistoryQuery: + return q.Filter(), nil + case *generated.FileQuery: + return q.Filter(), nil + case *generated.FileHistoryQuery: + return q.Filter(), nil + case *generated.GroupQuery: + return q.Filter(), nil + case *generated.GroupHistoryQuery: + return q.Filter(), nil + case *generated.GroupMembershipQuery: + return q.Filter(), nil + case *generated.GroupMembershipHistoryQuery: + return q.Filter(), nil + case *generated.GroupSettingQuery: + return q.Filter(), nil + case *generated.GroupSettingHistoryQuery: + return q.Filter(), nil + case *generated.HushQuery: + return q.Filter(), nil + case *generated.HushHistoryQuery: + return q.Filter(), nil + case *generated.IntegrationQuery: + return q.Filter(), nil + case *generated.IntegrationHistoryQuery: + return q.Filter(), nil + case *generated.InviteQuery: + return q.Filter(), nil + case *generated.NoteQuery: + return q.Filter(), nil + case *generated.NoteHistoryQuery: + return q.Filter(), nil + case *generated.OauthProviderQuery: + return q.Filter(), nil + case *generated.OauthProviderHistoryQuery: + return q.Filter(), nil + case *generated.OhAuthTooTokenQuery: + return q.Filter(), nil + case *generated.OrgMembershipQuery: + return q.Filter(), nil + case *generated.OrgMembershipHistoryQuery: + return q.Filter(), nil + case *generated.OrganizationQuery: + return q.Filter(), nil + case *generated.OrganizationHistoryQuery: + return q.Filter(), nil + case *generated.OrganizationSettingQuery: + return q.Filter(), nil + case *generated.OrganizationSettingHistoryQuery: + return q.Filter(), nil + case *generated.PasswordResetTokenQuery: + return q.Filter(), nil + case *generated.PersonalAccessTokenQuery: + return q.Filter(), nil + case *generated.SubscriberQuery: + return q.Filter(), nil + case *generated.TFASettingQuery: + return q.Filter(), nil + case *generated.TemplateQuery: + return q.Filter(), nil + case *generated.TemplateHistoryQuery: + return q.Filter(), nil + case *generated.UserQuery: + return q.Filter(), nil + case *generated.UserHistoryQuery: + return q.Filter(), nil + case *generated.UserSettingQuery: + return q.Filter(), nil + case *generated.UserSettingHistoryQuery: + return q.Filter(), nil + case *generated.WebauthnQuery: + return q.Filter(), nil + case *generated.WebhookQuery: + return q.Filter(), nil + case *generated.WebhookHistoryQuery: + return q.Filter(), nil + default: + return nil, Denyf("generated/privacy: unexpected query type %T for query filter", q) + } +} + +func mutationFilter(m generated.Mutation) (Filter, error) { + switch m := m.(type) { + case *generated.APITokenMutation: + return m.Filter(), nil + case *generated.ContactMutation: + return m.Filter(), nil + case *generated.ContactHistoryMutation: + return m.Filter(), nil + case *generated.DocumentDataMutation: + return m.Filter(), nil + case *generated.DocumentDataHistoryMutation: + return m.Filter(), nil + case *generated.EmailVerificationTokenMutation: + return m.Filter(), nil + case *generated.EntitlementMutation: + return m.Filter(), nil + case *generated.EntitlementHistoryMutation: + return m.Filter(), nil + case *generated.EntitlementPlanMutation: + return m.Filter(), nil + case *generated.EntitlementPlanFeatureMutation: + return m.Filter(), nil + case *generated.EntitlementPlanFeatureHistoryMutation: + return m.Filter(), nil + case *generated.EntitlementPlanHistoryMutation: + return m.Filter(), nil + case *generated.EntityMutation: + return m.Filter(), nil + case *generated.EntityHistoryMutation: + return m.Filter(), nil + case *generated.EntityTypeMutation: + return m.Filter(), nil + case *generated.EntityTypeHistoryMutation: + return m.Filter(), nil + case *generated.EventMutation: + return m.Filter(), nil + case *generated.EventHistoryMutation: + return m.Filter(), nil + case *generated.FeatureMutation: + return m.Filter(), nil + case *generated.FeatureHistoryMutation: + return m.Filter(), nil + case *generated.FileMutation: + return m.Filter(), nil + case *generated.FileHistoryMutation: + return m.Filter(), nil + case *generated.GroupMutation: + return m.Filter(), nil + case *generated.GroupHistoryMutation: + return m.Filter(), nil + case *generated.GroupMembershipMutation: + return m.Filter(), nil + case *generated.GroupMembershipHistoryMutation: + return m.Filter(), nil + case *generated.GroupSettingMutation: + return m.Filter(), nil + case *generated.GroupSettingHistoryMutation: + return m.Filter(), nil + case *generated.HushMutation: + return m.Filter(), nil + case *generated.HushHistoryMutation: + return m.Filter(), nil + case *generated.IntegrationMutation: + return m.Filter(), nil + case *generated.IntegrationHistoryMutation: + return m.Filter(), nil + case *generated.InviteMutation: + return m.Filter(), nil + case *generated.NoteMutation: + return m.Filter(), nil + case *generated.NoteHistoryMutation: + return m.Filter(), nil + case *generated.OauthProviderMutation: + return m.Filter(), nil + case *generated.OauthProviderHistoryMutation: + return m.Filter(), nil + case *generated.OhAuthTooTokenMutation: + return m.Filter(), nil + case *generated.OrgMembershipMutation: + return m.Filter(), nil + case *generated.OrgMembershipHistoryMutation: + return m.Filter(), nil + case *generated.OrganizationMutation: + return m.Filter(), nil + case *generated.OrganizationHistoryMutation: + return m.Filter(), nil + case *generated.OrganizationSettingMutation: + return m.Filter(), nil + case *generated.OrganizationSettingHistoryMutation: + return m.Filter(), nil + case *generated.PasswordResetTokenMutation: + return m.Filter(), nil + case *generated.PersonalAccessTokenMutation: + return m.Filter(), nil + case *generated.SubscriberMutation: + return m.Filter(), nil + case *generated.TFASettingMutation: + return m.Filter(), nil + case *generated.TemplateMutation: + return m.Filter(), nil + case *generated.TemplateHistoryMutation: + return m.Filter(), nil + case *generated.UserMutation: + return m.Filter(), nil + case *generated.UserHistoryMutation: + return m.Filter(), nil + case *generated.UserSettingMutation: + return m.Filter(), nil + case *generated.UserSettingHistoryMutation: + return m.Filter(), nil + case *generated.WebauthnMutation: + return m.Filter(), nil + case *generated.WebhookMutation: + return m.Filter(), nil + case *generated.WebhookHistoryMutation: + return m.Filter(), nil + default: + return nil, Denyf("generated/privacy: unexpected mutation type %T for mutation filter", m) + } +} diff --git a/internal/ent/generated/runtime.go b/internal/ent/generated/runtime.go new file mode 100644 index 0000000..9338e9b --- /dev/null +++ b/internal/ent/generated/runtime.go @@ -0,0 +1,5 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +// The schema-stitching logic is generated in github.com/theopenlane/core/internal/ent/generated/runtime/runtime.go diff --git a/internal/ent/generated/runtime/runtime.go b/internal/ent/generated/runtime/runtime.go new file mode 100644 index 0000000..1e64c6e --- /dev/null +++ b/internal/ent/generated/runtime/runtime.go @@ -0,0 +1,3268 @@ +// Code generated by ent, DO NOT EDIT. + +package runtime + +import ( + "context" + "time" + + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/contact" + "github.com/theopenlane/core/internal/ent/generated/contacthistory" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/documentdatahistory" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/entitlement" + "github.com/theopenlane/core/internal/ent/generated/entitlementhistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplan" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeature" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanfeaturehistory" + "github.com/theopenlane/core/internal/ent/generated/entitlementplanhistory" + "github.com/theopenlane/core/internal/ent/generated/entity" + "github.com/theopenlane/core/internal/ent/generated/entityhistory" + "github.com/theopenlane/core/internal/ent/generated/entitytype" + "github.com/theopenlane/core/internal/ent/generated/entitytypehistory" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/eventhistory" + "github.com/theopenlane/core/internal/ent/generated/feature" + "github.com/theopenlane/core/internal/ent/generated/featurehistory" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/filehistory" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/grouphistory" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/groupmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/groupsetting" + "github.com/theopenlane/core/internal/ent/generated/groupsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/hush" + "github.com/theopenlane/core/internal/ent/generated/hushhistory" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/integrationhistory" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/note" + "github.com/theopenlane/core/internal/ent/generated/notehistory" + "github.com/theopenlane/core/internal/ent/generated/oauthprovider" + "github.com/theopenlane/core/internal/ent/generated/oauthproviderhistory" + "github.com/theopenlane/core/internal/ent/generated/ohauthtootoken" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/organizationhistory" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/orgmembershiphistory" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/theopenlane/core/internal/ent/schema" + + "entgo.io/ent" + "entgo.io/ent/privacy" +) + +// The init function reads all schema descriptors with runtime code +// (default values, validators, hooks and policies) and stitches it +// to their package variables. +func init() { + apitokenMixin := schema.APIToken{}.Mixin() + apitoken.Policy = privacy.NewPolicies(schema.APIToken{}) + apitoken.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := apitoken.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + apitokenMixinHooks0 := apitokenMixin[0].Hooks() + apitokenMixinHooks1 := apitokenMixin[1].Hooks() + apitokenMixinHooks4 := apitokenMixin[4].Hooks() + apitokenHooks := schema.APIToken{}.Hooks() + + apitoken.Hooks[1] = apitokenMixinHooks0[0] + + apitoken.Hooks[2] = apitokenMixinHooks1[0] + + apitoken.Hooks[3] = apitokenMixinHooks4[0] + + apitoken.Hooks[4] = apitokenHooks[0] + + apitoken.Hooks[5] = apitokenHooks[1] + apitokenMixinInters1 := apitokenMixin[1].Interceptors() + apitokenMixinInters4 := apitokenMixin[4].Interceptors() + apitokenInters := schema.APIToken{}.Interceptors() + apitoken.Interceptors[0] = apitokenMixinInters1[0] + apitoken.Interceptors[1] = apitokenMixinInters4[0] + apitoken.Interceptors[2] = apitokenInters[0] + apitokenMixinFields0 := apitokenMixin[0].Fields() + _ = apitokenMixinFields0 + apitokenMixinFields2 := apitokenMixin[2].Fields() + _ = apitokenMixinFields2 + apitokenMixinFields3 := apitokenMixin[3].Fields() + _ = apitokenMixinFields3 + apitokenMixinFields4 := apitokenMixin[4].Fields() + _ = apitokenMixinFields4 + apitokenFields := schema.APIToken{}.Fields() + _ = apitokenFields + // apitokenDescCreatedAt is the schema descriptor for created_at field. + apitokenDescCreatedAt := apitokenMixinFields0[0].Descriptor() + // apitoken.DefaultCreatedAt holds the default value on creation for the created_at field. + apitoken.DefaultCreatedAt = apitokenDescCreatedAt.Default.(func() time.Time) + // apitokenDescUpdatedAt is the schema descriptor for updated_at field. + apitokenDescUpdatedAt := apitokenMixinFields0[1].Descriptor() + // apitoken.DefaultUpdatedAt holds the default value on creation for the updated_at field. + apitoken.DefaultUpdatedAt = apitokenDescUpdatedAt.Default.(func() time.Time) + // apitoken.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + apitoken.UpdateDefaultUpdatedAt = apitokenDescUpdatedAt.UpdateDefault.(func() time.Time) + // apitokenDescMappingID is the schema descriptor for mapping_id field. + apitokenDescMappingID := apitokenMixinFields2[1].Descriptor() + // apitoken.DefaultMappingID holds the default value on creation for the mapping_id field. + apitoken.DefaultMappingID = apitokenDescMappingID.Default.(func() string) + // apitokenDescTags is the schema descriptor for tags field. + apitokenDescTags := apitokenMixinFields3[0].Descriptor() + // apitoken.DefaultTags holds the default value on creation for the tags field. + apitoken.DefaultTags = apitokenDescTags.Default.([]string) + // apitokenDescOwnerID is the schema descriptor for owner_id field. + apitokenDescOwnerID := apitokenMixinFields4[0].Descriptor() + // apitoken.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + apitoken.OwnerIDValidator = apitokenDescOwnerID.Validators[0].(func(string) error) + // apitokenDescName is the schema descriptor for name field. + apitokenDescName := apitokenFields[0].Descriptor() + // apitoken.NameValidator is a validator for the "name" field. It is called by the builders before save. + apitoken.NameValidator = apitokenDescName.Validators[0].(func(string) error) + // apitokenDescToken is the schema descriptor for token field. + apitokenDescToken := apitokenFields[1].Descriptor() + // apitoken.DefaultToken holds the default value on creation for the token field. + apitoken.DefaultToken = apitokenDescToken.Default.(func() string) + // apitokenDescID is the schema descriptor for id field. + apitokenDescID := apitokenMixinFields2[0].Descriptor() + // apitoken.DefaultID holds the default value on creation for the id field. + apitoken.DefaultID = apitokenDescID.Default.(func() string) + contactMixin := schema.Contact{}.Mixin() + contact.Policy = privacy.NewPolicies(schema.Contact{}) + contact.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := contact.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + contactMixinHooks0 := contactMixin[0].Hooks() + contactMixinHooks2 := contactMixin[2].Hooks() + contactMixinHooks4 := contactMixin[4].Hooks() + + contact.Hooks[1] = contactMixinHooks0[0] + + contact.Hooks[2] = contactMixinHooks2[0] + + contact.Hooks[3] = contactMixinHooks4[0] + contactMixinInters2 := contactMixin[2].Interceptors() + contactMixinInters4 := contactMixin[4].Interceptors() + contact.Interceptors[0] = contactMixinInters2[0] + contact.Interceptors[1] = contactMixinInters4[0] + contactMixinFields0 := contactMixin[0].Fields() + _ = contactMixinFields0 + contactMixinFields1 := contactMixin[1].Fields() + _ = contactMixinFields1 + contactMixinFields3 := contactMixin[3].Fields() + _ = contactMixinFields3 + contactMixinFields4 := contactMixin[4].Fields() + _ = contactMixinFields4 + contactFields := schema.Contact{}.Fields() + _ = contactFields + // contactDescCreatedAt is the schema descriptor for created_at field. + contactDescCreatedAt := contactMixinFields0[0].Descriptor() + // contact.DefaultCreatedAt holds the default value on creation for the created_at field. + contact.DefaultCreatedAt = contactDescCreatedAt.Default.(func() time.Time) + // contactDescUpdatedAt is the schema descriptor for updated_at field. + contactDescUpdatedAt := contactMixinFields0[1].Descriptor() + // contact.DefaultUpdatedAt holds the default value on creation for the updated_at field. + contact.DefaultUpdatedAt = contactDescUpdatedAt.Default.(func() time.Time) + // contact.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + contact.UpdateDefaultUpdatedAt = contactDescUpdatedAt.UpdateDefault.(func() time.Time) + // contactDescMappingID is the schema descriptor for mapping_id field. + contactDescMappingID := contactMixinFields1[1].Descriptor() + // contact.DefaultMappingID holds the default value on creation for the mapping_id field. + contact.DefaultMappingID = contactDescMappingID.Default.(func() string) + // contactDescTags is the schema descriptor for tags field. + contactDescTags := contactMixinFields3[0].Descriptor() + // contact.DefaultTags holds the default value on creation for the tags field. + contact.DefaultTags = contactDescTags.Default.([]string) + // contactDescOwnerID is the schema descriptor for owner_id field. + contactDescOwnerID := contactMixinFields4[0].Descriptor() + // contact.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + contact.OwnerIDValidator = contactDescOwnerID.Validators[0].(func(string) error) + // contactDescFullName is the schema descriptor for full_name field. + contactDescFullName := contactFields[0].Descriptor() + // contact.FullNameValidator is a validator for the "full_name" field. It is called by the builders before save. + contact.FullNameValidator = func() func(string) error { + validators := contactDescFullName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(full_name string) error { + for _, fn := range fns { + if err := fn(full_name); err != nil { + return err + } + } + return nil + } + }() + // contactDescEmail is the schema descriptor for email field. + contactDescEmail := contactFields[3].Descriptor() + // contact.EmailValidator is a validator for the "email" field. It is called by the builders before save. + contact.EmailValidator = contactDescEmail.Validators[0].(func(string) error) + // contactDescPhoneNumber is the schema descriptor for phone_number field. + contactDescPhoneNumber := contactFields[4].Descriptor() + // contact.PhoneNumberValidator is a validator for the "phone_number" field. It is called by the builders before save. + contact.PhoneNumberValidator = contactDescPhoneNumber.Validators[0].(func(string) error) + // contactDescID is the schema descriptor for id field. + contactDescID := contactMixinFields1[0].Descriptor() + // contact.DefaultID holds the default value on creation for the id field. + contact.DefaultID = contactDescID.Default.(func() string) + contacthistory.Policy = privacy.NewPolicies(schema.ContactHistory{}) + contacthistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := contacthistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + contacthistoryInters := schema.ContactHistory{}.Interceptors() + contacthistory.Interceptors[0] = contacthistoryInters[0] + contacthistoryFields := schema.ContactHistory{}.Fields() + _ = contacthistoryFields + // contacthistoryDescHistoryTime is the schema descriptor for history_time field. + contacthistoryDescHistoryTime := contacthistoryFields[0].Descriptor() + // contacthistory.DefaultHistoryTime holds the default value on creation for the history_time field. + contacthistory.DefaultHistoryTime = contacthistoryDescHistoryTime.Default.(func() time.Time) + // contacthistoryDescCreatedAt is the schema descriptor for created_at field. + contacthistoryDescCreatedAt := contacthistoryFields[3].Descriptor() + // contacthistory.DefaultCreatedAt holds the default value on creation for the created_at field. + contacthistory.DefaultCreatedAt = contacthistoryDescCreatedAt.Default.(func() time.Time) + // contacthistoryDescUpdatedAt is the schema descriptor for updated_at field. + contacthistoryDescUpdatedAt := contacthistoryFields[4].Descriptor() + // contacthistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + contacthistory.DefaultUpdatedAt = contacthistoryDescUpdatedAt.Default.(func() time.Time) + // contacthistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + contacthistory.UpdateDefaultUpdatedAt = contacthistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // contacthistoryDescMappingID is the schema descriptor for mapping_id field. + contacthistoryDescMappingID := contacthistoryFields[8].Descriptor() + // contacthistory.DefaultMappingID holds the default value on creation for the mapping_id field. + contacthistory.DefaultMappingID = contacthistoryDescMappingID.Default.(func() string) + // contacthistoryDescTags is the schema descriptor for tags field. + contacthistoryDescTags := contacthistoryFields[11].Descriptor() + // contacthistory.DefaultTags holds the default value on creation for the tags field. + contacthistory.DefaultTags = contacthistoryDescTags.Default.([]string) + // contacthistoryDescID is the schema descriptor for id field. + contacthistoryDescID := contacthistoryFields[7].Descriptor() + // contacthistory.DefaultID holds the default value on creation for the id field. + contacthistory.DefaultID = contacthistoryDescID.Default.(func() string) + documentdataMixin := schema.DocumentData{}.Mixin() + documentdata.Policy = privacy.NewPolicies(schema.DocumentData{}) + documentdata.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := documentdata.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + documentdataMixinHooks0 := documentdataMixin[0].Hooks() + documentdataMixinHooks3 := documentdataMixin[3].Hooks() + documentdataMixinHooks4 := documentdataMixin[4].Hooks() + + documentdata.Hooks[1] = documentdataMixinHooks0[0] + + documentdata.Hooks[2] = documentdataMixinHooks3[0] + + documentdata.Hooks[3] = documentdataMixinHooks4[0] + documentdataMixinInters3 := documentdataMixin[3].Interceptors() + documentdataMixinInters4 := documentdataMixin[4].Interceptors() + documentdata.Interceptors[0] = documentdataMixinInters3[0] + documentdata.Interceptors[1] = documentdataMixinInters4[0] + documentdataMixinFields0 := documentdataMixin[0].Fields() + _ = documentdataMixinFields0 + documentdataMixinFields1 := documentdataMixin[1].Fields() + _ = documentdataMixinFields1 + documentdataMixinFields2 := documentdataMixin[2].Fields() + _ = documentdataMixinFields2 + documentdataMixinFields4 := documentdataMixin[4].Fields() + _ = documentdataMixinFields4 + documentdataFields := schema.DocumentData{}.Fields() + _ = documentdataFields + // documentdataDescCreatedAt is the schema descriptor for created_at field. + documentdataDescCreatedAt := documentdataMixinFields0[0].Descriptor() + // documentdata.DefaultCreatedAt holds the default value on creation for the created_at field. + documentdata.DefaultCreatedAt = documentdataDescCreatedAt.Default.(func() time.Time) + // documentdataDescUpdatedAt is the schema descriptor for updated_at field. + documentdataDescUpdatedAt := documentdataMixinFields0[1].Descriptor() + // documentdata.DefaultUpdatedAt holds the default value on creation for the updated_at field. + documentdata.DefaultUpdatedAt = documentdataDescUpdatedAt.Default.(func() time.Time) + // documentdata.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + documentdata.UpdateDefaultUpdatedAt = documentdataDescUpdatedAt.UpdateDefault.(func() time.Time) + // documentdataDescMappingID is the schema descriptor for mapping_id field. + documentdataDescMappingID := documentdataMixinFields1[1].Descriptor() + // documentdata.DefaultMappingID holds the default value on creation for the mapping_id field. + documentdata.DefaultMappingID = documentdataDescMappingID.Default.(func() string) + // documentdataDescTags is the schema descriptor for tags field. + documentdataDescTags := documentdataMixinFields2[0].Descriptor() + // documentdata.DefaultTags holds the default value on creation for the tags field. + documentdata.DefaultTags = documentdataDescTags.Default.([]string) + // documentdataDescOwnerID is the schema descriptor for owner_id field. + documentdataDescOwnerID := documentdataMixinFields4[0].Descriptor() + // documentdata.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + documentdata.OwnerIDValidator = documentdataDescOwnerID.Validators[0].(func(string) error) + // documentdataDescID is the schema descriptor for id field. + documentdataDescID := documentdataMixinFields1[0].Descriptor() + // documentdata.DefaultID holds the default value on creation for the id field. + documentdata.DefaultID = documentdataDescID.Default.(func() string) + documentdatahistory.Policy = privacy.NewPolicies(schema.DocumentDataHistory{}) + documentdatahistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := documentdatahistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + documentdatahistoryInters := schema.DocumentDataHistory{}.Interceptors() + documentdatahistory.Interceptors[0] = documentdatahistoryInters[0] + documentdatahistoryFields := schema.DocumentDataHistory{}.Fields() + _ = documentdatahistoryFields + // documentdatahistoryDescHistoryTime is the schema descriptor for history_time field. + documentdatahistoryDescHistoryTime := documentdatahistoryFields[0].Descriptor() + // documentdatahistory.DefaultHistoryTime holds the default value on creation for the history_time field. + documentdatahistory.DefaultHistoryTime = documentdatahistoryDescHistoryTime.Default.(func() time.Time) + // documentdatahistoryDescCreatedAt is the schema descriptor for created_at field. + documentdatahistoryDescCreatedAt := documentdatahistoryFields[3].Descriptor() + // documentdatahistory.DefaultCreatedAt holds the default value on creation for the created_at field. + documentdatahistory.DefaultCreatedAt = documentdatahistoryDescCreatedAt.Default.(func() time.Time) + // documentdatahistoryDescUpdatedAt is the schema descriptor for updated_at field. + documentdatahistoryDescUpdatedAt := documentdatahistoryFields[4].Descriptor() + // documentdatahistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + documentdatahistory.DefaultUpdatedAt = documentdatahistoryDescUpdatedAt.Default.(func() time.Time) + // documentdatahistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + documentdatahistory.UpdateDefaultUpdatedAt = documentdatahistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // documentdatahistoryDescMappingID is the schema descriptor for mapping_id field. + documentdatahistoryDescMappingID := documentdatahistoryFields[8].Descriptor() + // documentdatahistory.DefaultMappingID holds the default value on creation for the mapping_id field. + documentdatahistory.DefaultMappingID = documentdatahistoryDescMappingID.Default.(func() string) + // documentdatahistoryDescTags is the schema descriptor for tags field. + documentdatahistoryDescTags := documentdatahistoryFields[9].Descriptor() + // documentdatahistory.DefaultTags holds the default value on creation for the tags field. + documentdatahistory.DefaultTags = documentdatahistoryDescTags.Default.([]string) + // documentdatahistoryDescID is the schema descriptor for id field. + documentdatahistoryDescID := documentdatahistoryFields[7].Descriptor() + // documentdatahistory.DefaultID holds the default value on creation for the id field. + documentdatahistory.DefaultID = documentdatahistoryDescID.Default.(func() string) + emailverificationtokenMixin := schema.EmailVerificationToken{}.Mixin() + emailverificationtoken.Policy = privacy.NewPolicies(schema.EmailVerificationToken{}) + emailverificationtoken.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := emailverificationtoken.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + emailverificationtokenMixinHooks0 := emailverificationtokenMixin[0].Hooks() + emailverificationtokenMixinHooks2 := emailverificationtokenMixin[2].Hooks() + emailverificationtokenMixinHooks3 := emailverificationtokenMixin[3].Hooks() + emailverificationtokenHooks := schema.EmailVerificationToken{}.Hooks() + + emailverificationtoken.Hooks[1] = emailverificationtokenMixinHooks0[0] + + emailverificationtoken.Hooks[2] = emailverificationtokenMixinHooks2[0] + + emailverificationtoken.Hooks[3] = emailverificationtokenMixinHooks3[0] + + emailverificationtoken.Hooks[4] = emailverificationtokenHooks[0] + emailverificationtokenMixinInters2 := emailverificationtokenMixin[2].Interceptors() + emailverificationtokenMixinInters3 := emailverificationtokenMixin[3].Interceptors() + emailverificationtoken.Interceptors[0] = emailverificationtokenMixinInters2[0] + emailverificationtoken.Interceptors[1] = emailverificationtokenMixinInters3[0] + emailverificationtokenMixinFields0 := emailverificationtokenMixin[0].Fields() + _ = emailverificationtokenMixinFields0 + emailverificationtokenMixinFields1 := emailverificationtokenMixin[1].Fields() + _ = emailverificationtokenMixinFields1 + emailverificationtokenFields := schema.EmailVerificationToken{}.Fields() + _ = emailverificationtokenFields + // emailverificationtokenDescCreatedAt is the schema descriptor for created_at field. + emailverificationtokenDescCreatedAt := emailverificationtokenMixinFields0[0].Descriptor() + // emailverificationtoken.DefaultCreatedAt holds the default value on creation for the created_at field. + emailverificationtoken.DefaultCreatedAt = emailverificationtokenDescCreatedAt.Default.(func() time.Time) + // emailverificationtokenDescUpdatedAt is the schema descriptor for updated_at field. + emailverificationtokenDescUpdatedAt := emailverificationtokenMixinFields0[1].Descriptor() + // emailverificationtoken.DefaultUpdatedAt holds the default value on creation for the updated_at field. + emailverificationtoken.DefaultUpdatedAt = emailverificationtokenDescUpdatedAt.Default.(func() time.Time) + // emailverificationtoken.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + emailverificationtoken.UpdateDefaultUpdatedAt = emailverificationtokenDescUpdatedAt.UpdateDefault.(func() time.Time) + // emailverificationtokenDescMappingID is the schema descriptor for mapping_id field. + emailverificationtokenDescMappingID := emailverificationtokenMixinFields1[1].Descriptor() + // emailverificationtoken.DefaultMappingID holds the default value on creation for the mapping_id field. + emailverificationtoken.DefaultMappingID = emailverificationtokenDescMappingID.Default.(func() string) + // emailverificationtokenDescToken is the schema descriptor for token field. + emailverificationtokenDescToken := emailverificationtokenFields[0].Descriptor() + // emailverificationtoken.TokenValidator is a validator for the "token" field. It is called by the builders before save. + emailverificationtoken.TokenValidator = emailverificationtokenDescToken.Validators[0].(func(string) error) + // emailverificationtokenDescEmail is the schema descriptor for email field. + emailverificationtokenDescEmail := emailverificationtokenFields[2].Descriptor() + // emailverificationtoken.EmailValidator is a validator for the "email" field. It is called by the builders before save. + emailverificationtoken.EmailValidator = func() func(string) error { + validators := emailverificationtokenDescEmail.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(email string) error { + for _, fn := range fns { + if err := fn(email); err != nil { + return err + } + } + return nil + } + }() + // emailverificationtokenDescSecret is the schema descriptor for secret field. + emailverificationtokenDescSecret := emailverificationtokenFields[3].Descriptor() + // emailverificationtoken.SecretValidator is a validator for the "secret" field. It is called by the builders before save. + emailverificationtoken.SecretValidator = emailverificationtokenDescSecret.Validators[0].(func([]byte) error) + // emailverificationtokenDescID is the schema descriptor for id field. + emailverificationtokenDescID := emailverificationtokenMixinFields1[0].Descriptor() + // emailverificationtoken.DefaultID holds the default value on creation for the id field. + emailverificationtoken.DefaultID = emailverificationtokenDescID.Default.(func() string) + entitlementMixin := schema.Entitlement{}.Mixin() + entitlement.Policy = privacy.NewPolicies(schema.Entitlement{}) + entitlement.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitlement.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitlementMixinHooks0 := entitlementMixin[0].Hooks() + entitlementMixinHooks3 := entitlementMixin[3].Hooks() + entitlementMixinHooks4 := entitlementMixin[4].Hooks() + entitlementHooks := schema.Entitlement{}.Hooks() + + entitlement.Hooks[1] = entitlementMixinHooks0[0] + + entitlement.Hooks[2] = entitlementMixinHooks3[0] + + entitlement.Hooks[3] = entitlementMixinHooks4[0] + + entitlement.Hooks[4] = entitlementHooks[0] + entitlementMixinInters3 := entitlementMixin[3].Interceptors() + entitlementMixinInters4 := entitlementMixin[4].Interceptors() + entitlement.Interceptors[0] = entitlementMixinInters3[0] + entitlement.Interceptors[1] = entitlementMixinInters4[0] + entitlementMixinFields0 := entitlementMixin[0].Fields() + _ = entitlementMixinFields0 + entitlementMixinFields1 := entitlementMixin[1].Fields() + _ = entitlementMixinFields1 + entitlementMixinFields2 := entitlementMixin[2].Fields() + _ = entitlementMixinFields2 + entitlementMixinFields4 := entitlementMixin[4].Fields() + _ = entitlementMixinFields4 + entitlementFields := schema.Entitlement{}.Fields() + _ = entitlementFields + // entitlementDescCreatedAt is the schema descriptor for created_at field. + entitlementDescCreatedAt := entitlementMixinFields0[0].Descriptor() + // entitlement.DefaultCreatedAt holds the default value on creation for the created_at field. + entitlement.DefaultCreatedAt = entitlementDescCreatedAt.Default.(func() time.Time) + // entitlementDescUpdatedAt is the schema descriptor for updated_at field. + entitlementDescUpdatedAt := entitlementMixinFields0[1].Descriptor() + // entitlement.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitlement.DefaultUpdatedAt = entitlementDescUpdatedAt.Default.(func() time.Time) + // entitlement.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitlement.UpdateDefaultUpdatedAt = entitlementDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitlementDescMappingID is the schema descriptor for mapping_id field. + entitlementDescMappingID := entitlementMixinFields1[1].Descriptor() + // entitlement.DefaultMappingID holds the default value on creation for the mapping_id field. + entitlement.DefaultMappingID = entitlementDescMappingID.Default.(func() string) + // entitlementDescTags is the schema descriptor for tags field. + entitlementDescTags := entitlementMixinFields2[0].Descriptor() + // entitlement.DefaultTags holds the default value on creation for the tags field. + entitlement.DefaultTags = entitlementDescTags.Default.([]string) + // entitlementDescOwnerID is the schema descriptor for owner_id field. + entitlementDescOwnerID := entitlementMixinFields4[0].Descriptor() + // entitlement.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + entitlement.OwnerIDValidator = entitlementDescOwnerID.Validators[0].(func(string) error) + // entitlementDescPlanID is the schema descriptor for plan_id field. + entitlementDescPlanID := entitlementFields[0].Descriptor() + // entitlement.PlanIDValidator is a validator for the "plan_id" field. It is called by the builders before save. + entitlement.PlanIDValidator = entitlementDescPlanID.Validators[0].(func(string) error) + // entitlementDescOrganizationID is the schema descriptor for organization_id field. + entitlementDescOrganizationID := entitlementFields[1].Descriptor() + // entitlement.OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save. + entitlement.OrganizationIDValidator = entitlementDescOrganizationID.Validators[0].(func(string) error) + // entitlementDescExpires is the schema descriptor for expires field. + entitlementDescExpires := entitlementFields[4].Descriptor() + // entitlement.DefaultExpires holds the default value on creation for the expires field. + entitlement.DefaultExpires = entitlementDescExpires.Default.(bool) + // entitlementDescCancelled is the schema descriptor for cancelled field. + entitlementDescCancelled := entitlementFields[6].Descriptor() + // entitlement.DefaultCancelled holds the default value on creation for the cancelled field. + entitlement.DefaultCancelled = entitlementDescCancelled.Default.(bool) + // entitlementDescID is the schema descriptor for id field. + entitlementDescID := entitlementMixinFields1[0].Descriptor() + // entitlement.DefaultID holds the default value on creation for the id field. + entitlement.DefaultID = entitlementDescID.Default.(func() string) + entitlementhistory.Policy = privacy.NewPolicies(schema.EntitlementHistory{}) + entitlementhistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitlementhistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitlementhistoryInters := schema.EntitlementHistory{}.Interceptors() + entitlementhistory.Interceptors[0] = entitlementhistoryInters[0] + entitlementhistoryFields := schema.EntitlementHistory{}.Fields() + _ = entitlementhistoryFields + // entitlementhistoryDescHistoryTime is the schema descriptor for history_time field. + entitlementhistoryDescHistoryTime := entitlementhistoryFields[0].Descriptor() + // entitlementhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + entitlementhistory.DefaultHistoryTime = entitlementhistoryDescHistoryTime.Default.(func() time.Time) + // entitlementhistoryDescCreatedAt is the schema descriptor for created_at field. + entitlementhistoryDescCreatedAt := entitlementhistoryFields[3].Descriptor() + // entitlementhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + entitlementhistory.DefaultCreatedAt = entitlementhistoryDescCreatedAt.Default.(func() time.Time) + // entitlementhistoryDescUpdatedAt is the schema descriptor for updated_at field. + entitlementhistoryDescUpdatedAt := entitlementhistoryFields[4].Descriptor() + // entitlementhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitlementhistory.DefaultUpdatedAt = entitlementhistoryDescUpdatedAt.Default.(func() time.Time) + // entitlementhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitlementhistory.UpdateDefaultUpdatedAt = entitlementhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitlementhistoryDescMappingID is the schema descriptor for mapping_id field. + entitlementhistoryDescMappingID := entitlementhistoryFields[8].Descriptor() + // entitlementhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + entitlementhistory.DefaultMappingID = entitlementhistoryDescMappingID.Default.(func() string) + // entitlementhistoryDescTags is the schema descriptor for tags field. + entitlementhistoryDescTags := entitlementhistoryFields[9].Descriptor() + // entitlementhistory.DefaultTags holds the default value on creation for the tags field. + entitlementhistory.DefaultTags = entitlementhistoryDescTags.Default.([]string) + // entitlementhistoryDescExpires is the schema descriptor for expires field. + entitlementhistoryDescExpires := entitlementhistoryFields[17].Descriptor() + // entitlementhistory.DefaultExpires holds the default value on creation for the expires field. + entitlementhistory.DefaultExpires = entitlementhistoryDescExpires.Default.(bool) + // entitlementhistoryDescCancelled is the schema descriptor for cancelled field. + entitlementhistoryDescCancelled := entitlementhistoryFields[19].Descriptor() + // entitlementhistory.DefaultCancelled holds the default value on creation for the cancelled field. + entitlementhistory.DefaultCancelled = entitlementhistoryDescCancelled.Default.(bool) + // entitlementhistoryDescID is the schema descriptor for id field. + entitlementhistoryDescID := entitlementhistoryFields[7].Descriptor() + // entitlementhistory.DefaultID holds the default value on creation for the id field. + entitlementhistory.DefaultID = entitlementhistoryDescID.Default.(func() string) + entitlementplanMixin := schema.EntitlementPlan{}.Mixin() + entitlementplan.Policy = privacy.NewPolicies(schema.EntitlementPlan{}) + entitlementplan.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitlementplan.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitlementplanMixinHooks0 := entitlementplanMixin[0].Hooks() + entitlementplanMixinHooks2 := entitlementplanMixin[2].Hooks() + entitlementplanMixinHooks4 := entitlementplanMixin[4].Hooks() + entitlementplanHooks := schema.EntitlementPlan{}.Hooks() + + entitlementplan.Hooks[1] = entitlementplanMixinHooks0[0] + + entitlementplan.Hooks[2] = entitlementplanMixinHooks2[0] + + entitlementplan.Hooks[3] = entitlementplanMixinHooks4[0] + + entitlementplan.Hooks[4] = entitlementplanHooks[0] + entitlementplanMixinInters2 := entitlementplanMixin[2].Interceptors() + entitlementplanMixinInters4 := entitlementplanMixin[4].Interceptors() + entitlementplan.Interceptors[0] = entitlementplanMixinInters2[0] + entitlementplan.Interceptors[1] = entitlementplanMixinInters4[0] + entitlementplanMixinFields0 := entitlementplanMixin[0].Fields() + _ = entitlementplanMixinFields0 + entitlementplanMixinFields1 := entitlementplanMixin[1].Fields() + _ = entitlementplanMixinFields1 + entitlementplanMixinFields3 := entitlementplanMixin[3].Fields() + _ = entitlementplanMixinFields3 + entitlementplanMixinFields4 := entitlementplanMixin[4].Fields() + _ = entitlementplanMixinFields4 + entitlementplanFields := schema.EntitlementPlan{}.Fields() + _ = entitlementplanFields + // entitlementplanDescCreatedAt is the schema descriptor for created_at field. + entitlementplanDescCreatedAt := entitlementplanMixinFields0[0].Descriptor() + // entitlementplan.DefaultCreatedAt holds the default value on creation for the created_at field. + entitlementplan.DefaultCreatedAt = entitlementplanDescCreatedAt.Default.(func() time.Time) + // entitlementplanDescUpdatedAt is the schema descriptor for updated_at field. + entitlementplanDescUpdatedAt := entitlementplanMixinFields0[1].Descriptor() + // entitlementplan.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitlementplan.DefaultUpdatedAt = entitlementplanDescUpdatedAt.Default.(func() time.Time) + // entitlementplan.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitlementplan.UpdateDefaultUpdatedAt = entitlementplanDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitlementplanDescMappingID is the schema descriptor for mapping_id field. + entitlementplanDescMappingID := entitlementplanMixinFields1[1].Descriptor() + // entitlementplan.DefaultMappingID holds the default value on creation for the mapping_id field. + entitlementplan.DefaultMappingID = entitlementplanDescMappingID.Default.(func() string) + // entitlementplanDescTags is the schema descriptor for tags field. + entitlementplanDescTags := entitlementplanMixinFields3[0].Descriptor() + // entitlementplan.DefaultTags holds the default value on creation for the tags field. + entitlementplan.DefaultTags = entitlementplanDescTags.Default.([]string) + // entitlementplanDescOwnerID is the schema descriptor for owner_id field. + entitlementplanDescOwnerID := entitlementplanMixinFields4[0].Descriptor() + // entitlementplan.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + entitlementplan.OwnerIDValidator = entitlementplanDescOwnerID.Validators[0].(func(string) error) + // entitlementplanDescName is the schema descriptor for name field. + entitlementplanDescName := entitlementplanFields[1].Descriptor() + // entitlementplan.NameValidator is a validator for the "name" field. It is called by the builders before save. + entitlementplan.NameValidator = entitlementplanDescName.Validators[0].(func(string) error) + // entitlementplanDescVersion is the schema descriptor for version field. + entitlementplanDescVersion := entitlementplanFields[3].Descriptor() + // entitlementplan.VersionValidator is a validator for the "version" field. It is called by the builders before save. + entitlementplan.VersionValidator = entitlementplanDescVersion.Validators[0].(func(string) error) + // entitlementplanDescID is the schema descriptor for id field. + entitlementplanDescID := entitlementplanMixinFields1[0].Descriptor() + // entitlementplan.DefaultID holds the default value on creation for the id field. + entitlementplan.DefaultID = entitlementplanDescID.Default.(func() string) + entitlementplanfeatureMixin := schema.EntitlementPlanFeature{}.Mixin() + entitlementplanfeature.Policy = privacy.NewPolicies(schema.EntitlementPlanFeature{}) + entitlementplanfeature.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitlementplanfeature.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitlementplanfeatureMixinHooks0 := entitlementplanfeatureMixin[0].Hooks() + entitlementplanfeatureMixinHooks2 := entitlementplanfeatureMixin[2].Hooks() + entitlementplanfeatureMixinHooks4 := entitlementplanfeatureMixin[4].Hooks() + + entitlementplanfeature.Hooks[1] = entitlementplanfeatureMixinHooks0[0] + + entitlementplanfeature.Hooks[2] = entitlementplanfeatureMixinHooks2[0] + + entitlementplanfeature.Hooks[3] = entitlementplanfeatureMixinHooks4[0] + entitlementplanfeatureMixinInters2 := entitlementplanfeatureMixin[2].Interceptors() + entitlementplanfeatureMixinInters4 := entitlementplanfeatureMixin[4].Interceptors() + entitlementplanfeature.Interceptors[0] = entitlementplanfeatureMixinInters2[0] + entitlementplanfeature.Interceptors[1] = entitlementplanfeatureMixinInters4[0] + entitlementplanfeatureMixinFields0 := entitlementplanfeatureMixin[0].Fields() + _ = entitlementplanfeatureMixinFields0 + entitlementplanfeatureMixinFields1 := entitlementplanfeatureMixin[1].Fields() + _ = entitlementplanfeatureMixinFields1 + entitlementplanfeatureMixinFields3 := entitlementplanfeatureMixin[3].Fields() + _ = entitlementplanfeatureMixinFields3 + entitlementplanfeatureMixinFields4 := entitlementplanfeatureMixin[4].Fields() + _ = entitlementplanfeatureMixinFields4 + entitlementplanfeatureFields := schema.EntitlementPlanFeature{}.Fields() + _ = entitlementplanfeatureFields + // entitlementplanfeatureDescCreatedAt is the schema descriptor for created_at field. + entitlementplanfeatureDescCreatedAt := entitlementplanfeatureMixinFields0[0].Descriptor() + // entitlementplanfeature.DefaultCreatedAt holds the default value on creation for the created_at field. + entitlementplanfeature.DefaultCreatedAt = entitlementplanfeatureDescCreatedAt.Default.(func() time.Time) + // entitlementplanfeatureDescUpdatedAt is the schema descriptor for updated_at field. + entitlementplanfeatureDescUpdatedAt := entitlementplanfeatureMixinFields0[1].Descriptor() + // entitlementplanfeature.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitlementplanfeature.DefaultUpdatedAt = entitlementplanfeatureDescUpdatedAt.Default.(func() time.Time) + // entitlementplanfeature.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitlementplanfeature.UpdateDefaultUpdatedAt = entitlementplanfeatureDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitlementplanfeatureDescMappingID is the schema descriptor for mapping_id field. + entitlementplanfeatureDescMappingID := entitlementplanfeatureMixinFields1[1].Descriptor() + // entitlementplanfeature.DefaultMappingID holds the default value on creation for the mapping_id field. + entitlementplanfeature.DefaultMappingID = entitlementplanfeatureDescMappingID.Default.(func() string) + // entitlementplanfeatureDescTags is the schema descriptor for tags field. + entitlementplanfeatureDescTags := entitlementplanfeatureMixinFields3[0].Descriptor() + // entitlementplanfeature.DefaultTags holds the default value on creation for the tags field. + entitlementplanfeature.DefaultTags = entitlementplanfeatureDescTags.Default.([]string) + // entitlementplanfeatureDescOwnerID is the schema descriptor for owner_id field. + entitlementplanfeatureDescOwnerID := entitlementplanfeatureMixinFields4[0].Descriptor() + // entitlementplanfeature.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + entitlementplanfeature.OwnerIDValidator = entitlementplanfeatureDescOwnerID.Validators[0].(func(string) error) + // entitlementplanfeatureDescPlanID is the schema descriptor for plan_id field. + entitlementplanfeatureDescPlanID := entitlementplanfeatureFields[1].Descriptor() + // entitlementplanfeature.PlanIDValidator is a validator for the "plan_id" field. It is called by the builders before save. + entitlementplanfeature.PlanIDValidator = entitlementplanfeatureDescPlanID.Validators[0].(func(string) error) + // entitlementplanfeatureDescFeatureID is the schema descriptor for feature_id field. + entitlementplanfeatureDescFeatureID := entitlementplanfeatureFields[2].Descriptor() + // entitlementplanfeature.FeatureIDValidator is a validator for the "feature_id" field. It is called by the builders before save. + entitlementplanfeature.FeatureIDValidator = entitlementplanfeatureDescFeatureID.Validators[0].(func(string) error) + // entitlementplanfeatureDescID is the schema descriptor for id field. + entitlementplanfeatureDescID := entitlementplanfeatureMixinFields1[0].Descriptor() + // entitlementplanfeature.DefaultID holds the default value on creation for the id field. + entitlementplanfeature.DefaultID = entitlementplanfeatureDescID.Default.(func() string) + entitlementplanfeaturehistory.Policy = privacy.NewPolicies(schema.EntitlementPlanFeatureHistory{}) + entitlementplanfeaturehistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitlementplanfeaturehistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitlementplanfeaturehistoryInters := schema.EntitlementPlanFeatureHistory{}.Interceptors() + entitlementplanfeaturehistory.Interceptors[0] = entitlementplanfeaturehistoryInters[0] + entitlementplanfeaturehistoryFields := schema.EntitlementPlanFeatureHistory{}.Fields() + _ = entitlementplanfeaturehistoryFields + // entitlementplanfeaturehistoryDescHistoryTime is the schema descriptor for history_time field. + entitlementplanfeaturehistoryDescHistoryTime := entitlementplanfeaturehistoryFields[0].Descriptor() + // entitlementplanfeaturehistory.DefaultHistoryTime holds the default value on creation for the history_time field. + entitlementplanfeaturehistory.DefaultHistoryTime = entitlementplanfeaturehistoryDescHistoryTime.Default.(func() time.Time) + // entitlementplanfeaturehistoryDescCreatedAt is the schema descriptor for created_at field. + entitlementplanfeaturehistoryDescCreatedAt := entitlementplanfeaturehistoryFields[3].Descriptor() + // entitlementplanfeaturehistory.DefaultCreatedAt holds the default value on creation for the created_at field. + entitlementplanfeaturehistory.DefaultCreatedAt = entitlementplanfeaturehistoryDescCreatedAt.Default.(func() time.Time) + // entitlementplanfeaturehistoryDescUpdatedAt is the schema descriptor for updated_at field. + entitlementplanfeaturehistoryDescUpdatedAt := entitlementplanfeaturehistoryFields[4].Descriptor() + // entitlementplanfeaturehistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitlementplanfeaturehistory.DefaultUpdatedAt = entitlementplanfeaturehistoryDescUpdatedAt.Default.(func() time.Time) + // entitlementplanfeaturehistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitlementplanfeaturehistory.UpdateDefaultUpdatedAt = entitlementplanfeaturehistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitlementplanfeaturehistoryDescMappingID is the schema descriptor for mapping_id field. + entitlementplanfeaturehistoryDescMappingID := entitlementplanfeaturehistoryFields[8].Descriptor() + // entitlementplanfeaturehistory.DefaultMappingID holds the default value on creation for the mapping_id field. + entitlementplanfeaturehistory.DefaultMappingID = entitlementplanfeaturehistoryDescMappingID.Default.(func() string) + // entitlementplanfeaturehistoryDescTags is the schema descriptor for tags field. + entitlementplanfeaturehistoryDescTags := entitlementplanfeaturehistoryFields[11].Descriptor() + // entitlementplanfeaturehistory.DefaultTags holds the default value on creation for the tags field. + entitlementplanfeaturehistory.DefaultTags = entitlementplanfeaturehistoryDescTags.Default.([]string) + // entitlementplanfeaturehistoryDescID is the schema descriptor for id field. + entitlementplanfeaturehistoryDescID := entitlementplanfeaturehistoryFields[7].Descriptor() + // entitlementplanfeaturehistory.DefaultID holds the default value on creation for the id field. + entitlementplanfeaturehistory.DefaultID = entitlementplanfeaturehistoryDescID.Default.(func() string) + entitlementplanhistory.Policy = privacy.NewPolicies(schema.EntitlementPlanHistory{}) + entitlementplanhistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitlementplanhistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitlementplanhistoryInters := schema.EntitlementPlanHistory{}.Interceptors() + entitlementplanhistory.Interceptors[0] = entitlementplanhistoryInters[0] + entitlementplanhistoryFields := schema.EntitlementPlanHistory{}.Fields() + _ = entitlementplanhistoryFields + // entitlementplanhistoryDescHistoryTime is the schema descriptor for history_time field. + entitlementplanhistoryDescHistoryTime := entitlementplanhistoryFields[0].Descriptor() + // entitlementplanhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + entitlementplanhistory.DefaultHistoryTime = entitlementplanhistoryDescHistoryTime.Default.(func() time.Time) + // entitlementplanhistoryDescCreatedAt is the schema descriptor for created_at field. + entitlementplanhistoryDescCreatedAt := entitlementplanhistoryFields[3].Descriptor() + // entitlementplanhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + entitlementplanhistory.DefaultCreatedAt = entitlementplanhistoryDescCreatedAt.Default.(func() time.Time) + // entitlementplanhistoryDescUpdatedAt is the schema descriptor for updated_at field. + entitlementplanhistoryDescUpdatedAt := entitlementplanhistoryFields[4].Descriptor() + // entitlementplanhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitlementplanhistory.DefaultUpdatedAt = entitlementplanhistoryDescUpdatedAt.Default.(func() time.Time) + // entitlementplanhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitlementplanhistory.UpdateDefaultUpdatedAt = entitlementplanhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitlementplanhistoryDescMappingID is the schema descriptor for mapping_id field. + entitlementplanhistoryDescMappingID := entitlementplanhistoryFields[8].Descriptor() + // entitlementplanhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + entitlementplanhistory.DefaultMappingID = entitlementplanhistoryDescMappingID.Default.(func() string) + // entitlementplanhistoryDescTags is the schema descriptor for tags field. + entitlementplanhistoryDescTags := entitlementplanhistoryFields[11].Descriptor() + // entitlementplanhistory.DefaultTags holds the default value on creation for the tags field. + entitlementplanhistory.DefaultTags = entitlementplanhistoryDescTags.Default.([]string) + // entitlementplanhistoryDescID is the schema descriptor for id field. + entitlementplanhistoryDescID := entitlementplanhistoryFields[7].Descriptor() + // entitlementplanhistory.DefaultID holds the default value on creation for the id field. + entitlementplanhistory.DefaultID = entitlementplanhistoryDescID.Default.(func() string) + entityMixin := schema.Entity{}.Mixin() + entity.Policy = privacy.NewPolicies(schema.Entity{}) + entity.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entity.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entityMixinHooks0 := entityMixin[0].Hooks() + entityMixinHooks2 := entityMixin[2].Hooks() + entityMixinHooks4 := entityMixin[4].Hooks() + entityHooks := schema.Entity{}.Hooks() + + entity.Hooks[1] = entityMixinHooks0[0] + + entity.Hooks[2] = entityMixinHooks2[0] + + entity.Hooks[3] = entityMixinHooks4[0] + + entity.Hooks[4] = entityHooks[0] + entityMixinInters2 := entityMixin[2].Interceptors() + entityMixinInters4 := entityMixin[4].Interceptors() + entity.Interceptors[0] = entityMixinInters2[0] + entity.Interceptors[1] = entityMixinInters4[0] + entityMixinFields0 := entityMixin[0].Fields() + _ = entityMixinFields0 + entityMixinFields1 := entityMixin[1].Fields() + _ = entityMixinFields1 + entityMixinFields3 := entityMixin[3].Fields() + _ = entityMixinFields3 + entityMixinFields4 := entityMixin[4].Fields() + _ = entityMixinFields4 + entityFields := schema.Entity{}.Fields() + _ = entityFields + // entityDescCreatedAt is the schema descriptor for created_at field. + entityDescCreatedAt := entityMixinFields0[0].Descriptor() + // entity.DefaultCreatedAt holds the default value on creation for the created_at field. + entity.DefaultCreatedAt = entityDescCreatedAt.Default.(func() time.Time) + // entityDescUpdatedAt is the schema descriptor for updated_at field. + entityDescUpdatedAt := entityMixinFields0[1].Descriptor() + // entity.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entity.DefaultUpdatedAt = entityDescUpdatedAt.Default.(func() time.Time) + // entity.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entity.UpdateDefaultUpdatedAt = entityDescUpdatedAt.UpdateDefault.(func() time.Time) + // entityDescMappingID is the schema descriptor for mapping_id field. + entityDescMappingID := entityMixinFields1[1].Descriptor() + // entity.DefaultMappingID holds the default value on creation for the mapping_id field. + entity.DefaultMappingID = entityDescMappingID.Default.(func() string) + // entityDescTags is the schema descriptor for tags field. + entityDescTags := entityMixinFields3[0].Descriptor() + // entity.DefaultTags holds the default value on creation for the tags field. + entity.DefaultTags = entityDescTags.Default.([]string) + // entityDescOwnerID is the schema descriptor for owner_id field. + entityDescOwnerID := entityMixinFields4[0].Descriptor() + // entity.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + entity.OwnerIDValidator = entityDescOwnerID.Validators[0].(func(string) error) + // entityDescName is the schema descriptor for name field. + entityDescName := entityFields[0].Descriptor() + // entity.NameValidator is a validator for the "name" field. It is called by the builders before save. + entity.NameValidator = func() func(string) error { + validators := entityDescName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(name string) error { + for _, fn := range fns { + if err := fn(name); err != nil { + return err + } + } + return nil + } + }() + // entityDescDisplayName is the schema descriptor for display_name field. + entityDescDisplayName := entityFields[1].Descriptor() + // entity.DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + entity.DisplayNameValidator = func() func(string) error { + validators := entityDescDisplayName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(display_name string) error { + for _, fn := range fns { + if err := fn(display_name); err != nil { + return err + } + } + return nil + } + }() + // entityDescDomains is the schema descriptor for domains field. + entityDescDomains := entityFields[3].Descriptor() + // entity.DomainsValidator is a validator for the "domains" field. It is called by the builders before save. + entity.DomainsValidator = entityDescDomains.Validators[0].(func([]string) error) + // entityDescStatus is the schema descriptor for status field. + entityDescStatus := entityFields[5].Descriptor() + // entity.DefaultStatus holds the default value on creation for the status field. + entity.DefaultStatus = entityDescStatus.Default.(string) + // entityDescID is the schema descriptor for id field. + entityDescID := entityMixinFields1[0].Descriptor() + // entity.DefaultID holds the default value on creation for the id field. + entity.DefaultID = entityDescID.Default.(func() string) + entityhistory.Policy = privacy.NewPolicies(schema.EntityHistory{}) + entityhistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entityhistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entityhistoryInters := schema.EntityHistory{}.Interceptors() + entityhistory.Interceptors[0] = entityhistoryInters[0] + entityhistoryFields := schema.EntityHistory{}.Fields() + _ = entityhistoryFields + // entityhistoryDescHistoryTime is the schema descriptor for history_time field. + entityhistoryDescHistoryTime := entityhistoryFields[0].Descriptor() + // entityhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + entityhistory.DefaultHistoryTime = entityhistoryDescHistoryTime.Default.(func() time.Time) + // entityhistoryDescCreatedAt is the schema descriptor for created_at field. + entityhistoryDescCreatedAt := entityhistoryFields[3].Descriptor() + // entityhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + entityhistory.DefaultCreatedAt = entityhistoryDescCreatedAt.Default.(func() time.Time) + // entityhistoryDescUpdatedAt is the schema descriptor for updated_at field. + entityhistoryDescUpdatedAt := entityhistoryFields[4].Descriptor() + // entityhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entityhistory.DefaultUpdatedAt = entityhistoryDescUpdatedAt.Default.(func() time.Time) + // entityhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entityhistory.UpdateDefaultUpdatedAt = entityhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // entityhistoryDescMappingID is the schema descriptor for mapping_id field. + entityhistoryDescMappingID := entityhistoryFields[8].Descriptor() + // entityhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + entityhistory.DefaultMappingID = entityhistoryDescMappingID.Default.(func() string) + // entityhistoryDescTags is the schema descriptor for tags field. + entityhistoryDescTags := entityhistoryFields[11].Descriptor() + // entityhistory.DefaultTags holds the default value on creation for the tags field. + entityhistory.DefaultTags = entityhistoryDescTags.Default.([]string) + // entityhistoryDescStatus is the schema descriptor for status field. + entityhistoryDescStatus := entityhistoryFields[18].Descriptor() + // entityhistory.DefaultStatus holds the default value on creation for the status field. + entityhistory.DefaultStatus = entityhistoryDescStatus.Default.(string) + // entityhistoryDescID is the schema descriptor for id field. + entityhistoryDescID := entityhistoryFields[7].Descriptor() + // entityhistory.DefaultID holds the default value on creation for the id field. + entityhistory.DefaultID = entityhistoryDescID.Default.(func() string) + entitytypeMixin := schema.EntityType{}.Mixin() + entitytype.Policy = privacy.NewPolicies(schema.EntityType{}) + entitytype.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitytype.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitytypeMixinHooks0 := entitytypeMixin[0].Hooks() + entitytypeMixinHooks2 := entitytypeMixin[2].Hooks() + entitytypeMixinHooks4 := entitytypeMixin[4].Hooks() + + entitytype.Hooks[1] = entitytypeMixinHooks0[0] + + entitytype.Hooks[2] = entitytypeMixinHooks2[0] + + entitytype.Hooks[3] = entitytypeMixinHooks4[0] + entitytypeMixinInters2 := entitytypeMixin[2].Interceptors() + entitytypeMixinInters4 := entitytypeMixin[4].Interceptors() + entitytype.Interceptors[0] = entitytypeMixinInters2[0] + entitytype.Interceptors[1] = entitytypeMixinInters4[0] + entitytypeMixinFields0 := entitytypeMixin[0].Fields() + _ = entitytypeMixinFields0 + entitytypeMixinFields1 := entitytypeMixin[1].Fields() + _ = entitytypeMixinFields1 + entitytypeMixinFields3 := entitytypeMixin[3].Fields() + _ = entitytypeMixinFields3 + entitytypeMixinFields4 := entitytypeMixin[4].Fields() + _ = entitytypeMixinFields4 + entitytypeFields := schema.EntityType{}.Fields() + _ = entitytypeFields + // entitytypeDescCreatedAt is the schema descriptor for created_at field. + entitytypeDescCreatedAt := entitytypeMixinFields0[0].Descriptor() + // entitytype.DefaultCreatedAt holds the default value on creation for the created_at field. + entitytype.DefaultCreatedAt = entitytypeDescCreatedAt.Default.(func() time.Time) + // entitytypeDescUpdatedAt is the schema descriptor for updated_at field. + entitytypeDescUpdatedAt := entitytypeMixinFields0[1].Descriptor() + // entitytype.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitytype.DefaultUpdatedAt = entitytypeDescUpdatedAt.Default.(func() time.Time) + // entitytype.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitytype.UpdateDefaultUpdatedAt = entitytypeDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitytypeDescMappingID is the schema descriptor for mapping_id field. + entitytypeDescMappingID := entitytypeMixinFields1[1].Descriptor() + // entitytype.DefaultMappingID holds the default value on creation for the mapping_id field. + entitytype.DefaultMappingID = entitytypeDescMappingID.Default.(func() string) + // entitytypeDescTags is the schema descriptor for tags field. + entitytypeDescTags := entitytypeMixinFields3[0].Descriptor() + // entitytype.DefaultTags holds the default value on creation for the tags field. + entitytype.DefaultTags = entitytypeDescTags.Default.([]string) + // entitytypeDescOwnerID is the schema descriptor for owner_id field. + entitytypeDescOwnerID := entitytypeMixinFields4[0].Descriptor() + // entitytype.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + entitytype.OwnerIDValidator = entitytypeDescOwnerID.Validators[0].(func(string) error) + // entitytypeDescName is the schema descriptor for name field. + entitytypeDescName := entitytypeFields[0].Descriptor() + // entitytype.NameValidator is a validator for the "name" field. It is called by the builders before save. + entitytype.NameValidator = func() func(string) error { + validators := entitytypeDescName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(name string) error { + for _, fn := range fns { + if err := fn(name); err != nil { + return err + } + } + return nil + } + }() + // entitytypeDescID is the schema descriptor for id field. + entitytypeDescID := entitytypeMixinFields1[0].Descriptor() + // entitytype.DefaultID holds the default value on creation for the id field. + entitytype.DefaultID = entitytypeDescID.Default.(func() string) + entitytypehistory.Policy = privacy.NewPolicies(schema.EntityTypeHistory{}) + entitytypehistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := entitytypehistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + entitytypehistoryInters := schema.EntityTypeHistory{}.Interceptors() + entitytypehistory.Interceptors[0] = entitytypehistoryInters[0] + entitytypehistoryFields := schema.EntityTypeHistory{}.Fields() + _ = entitytypehistoryFields + // entitytypehistoryDescHistoryTime is the schema descriptor for history_time field. + entitytypehistoryDescHistoryTime := entitytypehistoryFields[0].Descriptor() + // entitytypehistory.DefaultHistoryTime holds the default value on creation for the history_time field. + entitytypehistory.DefaultHistoryTime = entitytypehistoryDescHistoryTime.Default.(func() time.Time) + // entitytypehistoryDescCreatedAt is the schema descriptor for created_at field. + entitytypehistoryDescCreatedAt := entitytypehistoryFields[3].Descriptor() + // entitytypehistory.DefaultCreatedAt holds the default value on creation for the created_at field. + entitytypehistory.DefaultCreatedAt = entitytypehistoryDescCreatedAt.Default.(func() time.Time) + // entitytypehistoryDescUpdatedAt is the schema descriptor for updated_at field. + entitytypehistoryDescUpdatedAt := entitytypehistoryFields[4].Descriptor() + // entitytypehistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + entitytypehistory.DefaultUpdatedAt = entitytypehistoryDescUpdatedAt.Default.(func() time.Time) + // entitytypehistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + entitytypehistory.UpdateDefaultUpdatedAt = entitytypehistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // entitytypehistoryDescMappingID is the schema descriptor for mapping_id field. + entitytypehistoryDescMappingID := entitytypehistoryFields[8].Descriptor() + // entitytypehistory.DefaultMappingID holds the default value on creation for the mapping_id field. + entitytypehistory.DefaultMappingID = entitytypehistoryDescMappingID.Default.(func() string) + // entitytypehistoryDescTags is the schema descriptor for tags field. + entitytypehistoryDescTags := entitytypehistoryFields[11].Descriptor() + // entitytypehistory.DefaultTags holds the default value on creation for the tags field. + entitytypehistory.DefaultTags = entitytypehistoryDescTags.Default.([]string) + // entitytypehistoryDescID is the schema descriptor for id field. + entitytypehistoryDescID := entitytypehistoryFields[7].Descriptor() + // entitytypehistory.DefaultID holds the default value on creation for the id field. + entitytypehistory.DefaultID = entitytypehistoryDescID.Default.(func() string) + eventMixin := schema.Event{}.Mixin() + eventMixinHooks0 := eventMixin[0].Hooks() + event.Hooks[0] = eventMixinHooks0[0] + eventMixinFields0 := eventMixin[0].Fields() + _ = eventMixinFields0 + eventMixinFields1 := eventMixin[1].Fields() + _ = eventMixinFields1 + eventMixinFields2 := eventMixin[2].Fields() + _ = eventMixinFields2 + eventFields := schema.Event{}.Fields() + _ = eventFields + // eventDescCreatedAt is the schema descriptor for created_at field. + eventDescCreatedAt := eventMixinFields0[0].Descriptor() + // event.DefaultCreatedAt holds the default value on creation for the created_at field. + event.DefaultCreatedAt = eventDescCreatedAt.Default.(func() time.Time) + // eventDescUpdatedAt is the schema descriptor for updated_at field. + eventDescUpdatedAt := eventMixinFields0[1].Descriptor() + // event.DefaultUpdatedAt holds the default value on creation for the updated_at field. + event.DefaultUpdatedAt = eventDescUpdatedAt.Default.(func() time.Time) + // event.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + event.UpdateDefaultUpdatedAt = eventDescUpdatedAt.UpdateDefault.(func() time.Time) + // eventDescMappingID is the schema descriptor for mapping_id field. + eventDescMappingID := eventMixinFields1[1].Descriptor() + // event.DefaultMappingID holds the default value on creation for the mapping_id field. + event.DefaultMappingID = eventDescMappingID.Default.(func() string) + // eventDescTags is the schema descriptor for tags field. + eventDescTags := eventMixinFields2[0].Descriptor() + // event.DefaultTags holds the default value on creation for the tags field. + event.DefaultTags = eventDescTags.Default.([]string) + // eventDescID is the schema descriptor for id field. + eventDescID := eventMixinFields1[0].Descriptor() + // event.DefaultID holds the default value on creation for the id field. + event.DefaultID = eventDescID.Default.(func() string) + eventhistoryFields := schema.EventHistory{}.Fields() + _ = eventhistoryFields + // eventhistoryDescHistoryTime is the schema descriptor for history_time field. + eventhistoryDescHistoryTime := eventhistoryFields[0].Descriptor() + // eventhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + eventhistory.DefaultHistoryTime = eventhistoryDescHistoryTime.Default.(func() time.Time) + // eventhistoryDescCreatedAt is the schema descriptor for created_at field. + eventhistoryDescCreatedAt := eventhistoryFields[3].Descriptor() + // eventhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + eventhistory.DefaultCreatedAt = eventhistoryDescCreatedAt.Default.(func() time.Time) + // eventhistoryDescUpdatedAt is the schema descriptor for updated_at field. + eventhistoryDescUpdatedAt := eventhistoryFields[4].Descriptor() + // eventhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + eventhistory.DefaultUpdatedAt = eventhistoryDescUpdatedAt.Default.(func() time.Time) + // eventhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + eventhistory.UpdateDefaultUpdatedAt = eventhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // eventhistoryDescMappingID is the schema descriptor for mapping_id field. + eventhistoryDescMappingID := eventhistoryFields[8].Descriptor() + // eventhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + eventhistory.DefaultMappingID = eventhistoryDescMappingID.Default.(func() string) + // eventhistoryDescTags is the schema descriptor for tags field. + eventhistoryDescTags := eventhistoryFields[9].Descriptor() + // eventhistory.DefaultTags holds the default value on creation for the tags field. + eventhistory.DefaultTags = eventhistoryDescTags.Default.([]string) + // eventhistoryDescID is the schema descriptor for id field. + eventhistoryDescID := eventhistoryFields[7].Descriptor() + // eventhistory.DefaultID holds the default value on creation for the id field. + eventhistory.DefaultID = eventhistoryDescID.Default.(func() string) + featureMixin := schema.Feature{}.Mixin() + feature.Policy = privacy.NewPolicies(schema.Feature{}) + feature.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := feature.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + featureMixinHooks0 := featureMixin[0].Hooks() + featureMixinHooks1 := featureMixin[1].Hooks() + featureMixinHooks4 := featureMixin[4].Hooks() + featureHooks := schema.Feature{}.Hooks() + + feature.Hooks[1] = featureMixinHooks0[0] + + feature.Hooks[2] = featureMixinHooks1[0] + + feature.Hooks[3] = featureMixinHooks4[0] + + feature.Hooks[4] = featureHooks[0] + featureMixinInters1 := featureMixin[1].Interceptors() + featureMixinInters4 := featureMixin[4].Interceptors() + feature.Interceptors[0] = featureMixinInters1[0] + feature.Interceptors[1] = featureMixinInters4[0] + featureMixinFields0 := featureMixin[0].Fields() + _ = featureMixinFields0 + featureMixinFields2 := featureMixin[2].Fields() + _ = featureMixinFields2 + featureMixinFields3 := featureMixin[3].Fields() + _ = featureMixinFields3 + featureMixinFields4 := featureMixin[4].Fields() + _ = featureMixinFields4 + featureFields := schema.Feature{}.Fields() + _ = featureFields + // featureDescCreatedAt is the schema descriptor for created_at field. + featureDescCreatedAt := featureMixinFields0[0].Descriptor() + // feature.DefaultCreatedAt holds the default value on creation for the created_at field. + feature.DefaultCreatedAt = featureDescCreatedAt.Default.(func() time.Time) + // featureDescUpdatedAt is the schema descriptor for updated_at field. + featureDescUpdatedAt := featureMixinFields0[1].Descriptor() + // feature.DefaultUpdatedAt holds the default value on creation for the updated_at field. + feature.DefaultUpdatedAt = featureDescUpdatedAt.Default.(func() time.Time) + // feature.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + feature.UpdateDefaultUpdatedAt = featureDescUpdatedAt.UpdateDefault.(func() time.Time) + // featureDescMappingID is the schema descriptor for mapping_id field. + featureDescMappingID := featureMixinFields2[1].Descriptor() + // feature.DefaultMappingID holds the default value on creation for the mapping_id field. + feature.DefaultMappingID = featureDescMappingID.Default.(func() string) + // featureDescTags is the schema descriptor for tags field. + featureDescTags := featureMixinFields3[0].Descriptor() + // feature.DefaultTags holds the default value on creation for the tags field. + feature.DefaultTags = featureDescTags.Default.([]string) + // featureDescOwnerID is the schema descriptor for owner_id field. + featureDescOwnerID := featureMixinFields4[0].Descriptor() + // feature.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + feature.OwnerIDValidator = featureDescOwnerID.Validators[0].(func(string) error) + // featureDescName is the schema descriptor for name field. + featureDescName := featureFields[0].Descriptor() + // feature.NameValidator is a validator for the "name" field. It is called by the builders before save. + feature.NameValidator = featureDescName.Validators[0].(func(string) error) + // featureDescEnabled is the schema descriptor for enabled field. + featureDescEnabled := featureFields[2].Descriptor() + // feature.DefaultEnabled holds the default value on creation for the enabled field. + feature.DefaultEnabled = featureDescEnabled.Default.(bool) + // featureDescID is the schema descriptor for id field. + featureDescID := featureMixinFields2[0].Descriptor() + // feature.DefaultID holds the default value on creation for the id field. + feature.DefaultID = featureDescID.Default.(func() string) + featurehistory.Policy = privacy.NewPolicies(schema.FeatureHistory{}) + featurehistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := featurehistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + featurehistoryInters := schema.FeatureHistory{}.Interceptors() + featurehistory.Interceptors[0] = featurehistoryInters[0] + featurehistoryFields := schema.FeatureHistory{}.Fields() + _ = featurehistoryFields + // featurehistoryDescHistoryTime is the schema descriptor for history_time field. + featurehistoryDescHistoryTime := featurehistoryFields[0].Descriptor() + // featurehistory.DefaultHistoryTime holds the default value on creation for the history_time field. + featurehistory.DefaultHistoryTime = featurehistoryDescHistoryTime.Default.(func() time.Time) + // featurehistoryDescCreatedAt is the schema descriptor for created_at field. + featurehistoryDescCreatedAt := featurehistoryFields[3].Descriptor() + // featurehistory.DefaultCreatedAt holds the default value on creation for the created_at field. + featurehistory.DefaultCreatedAt = featurehistoryDescCreatedAt.Default.(func() time.Time) + // featurehistoryDescUpdatedAt is the schema descriptor for updated_at field. + featurehistoryDescUpdatedAt := featurehistoryFields[4].Descriptor() + // featurehistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + featurehistory.DefaultUpdatedAt = featurehistoryDescUpdatedAt.Default.(func() time.Time) + // featurehistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + featurehistory.UpdateDefaultUpdatedAt = featurehistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // featurehistoryDescMappingID is the schema descriptor for mapping_id field. + featurehistoryDescMappingID := featurehistoryFields[10].Descriptor() + // featurehistory.DefaultMappingID holds the default value on creation for the mapping_id field. + featurehistory.DefaultMappingID = featurehistoryDescMappingID.Default.(func() string) + // featurehistoryDescTags is the schema descriptor for tags field. + featurehistoryDescTags := featurehistoryFields[11].Descriptor() + // featurehistory.DefaultTags holds the default value on creation for the tags field. + featurehistory.DefaultTags = featurehistoryDescTags.Default.([]string) + // featurehistoryDescEnabled is the schema descriptor for enabled field. + featurehistoryDescEnabled := featurehistoryFields[15].Descriptor() + // featurehistory.DefaultEnabled holds the default value on creation for the enabled field. + featurehistory.DefaultEnabled = featurehistoryDescEnabled.Default.(bool) + // featurehistoryDescID is the schema descriptor for id field. + featurehistoryDescID := featurehistoryFields[9].Descriptor() + // featurehistory.DefaultID holds the default value on creation for the id field. + featurehistory.DefaultID = featurehistoryDescID.Default.(func() string) + fileMixin := schema.File{}.Mixin() + fileMixinHooks0 := fileMixin[0].Hooks() + fileMixinHooks1 := fileMixin[1].Hooks() + file.Hooks[0] = fileMixinHooks0[0] + file.Hooks[1] = fileMixinHooks1[0] + fileMixinInters1 := fileMixin[1].Interceptors() + file.Interceptors[0] = fileMixinInters1[0] + fileMixinFields0 := fileMixin[0].Fields() + _ = fileMixinFields0 + fileMixinFields2 := fileMixin[2].Fields() + _ = fileMixinFields2 + fileMixinFields3 := fileMixin[3].Fields() + _ = fileMixinFields3 + fileFields := schema.File{}.Fields() + _ = fileFields + // fileDescCreatedAt is the schema descriptor for created_at field. + fileDescCreatedAt := fileMixinFields0[0].Descriptor() + // file.DefaultCreatedAt holds the default value on creation for the created_at field. + file.DefaultCreatedAt = fileDescCreatedAt.Default.(func() time.Time) + // fileDescUpdatedAt is the schema descriptor for updated_at field. + fileDescUpdatedAt := fileMixinFields0[1].Descriptor() + // file.DefaultUpdatedAt holds the default value on creation for the updated_at field. + file.DefaultUpdatedAt = fileDescUpdatedAt.Default.(func() time.Time) + // file.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + file.UpdateDefaultUpdatedAt = fileDescUpdatedAt.UpdateDefault.(func() time.Time) + // fileDescMappingID is the schema descriptor for mapping_id field. + fileDescMappingID := fileMixinFields2[1].Descriptor() + // file.DefaultMappingID holds the default value on creation for the mapping_id field. + file.DefaultMappingID = fileDescMappingID.Default.(func() string) + // fileDescTags is the schema descriptor for tags field. + fileDescTags := fileMixinFields3[0].Descriptor() + // file.DefaultTags holds the default value on creation for the tags field. + file.DefaultTags = fileDescTags.Default.([]string) + // fileDescFileSize is the schema descriptor for file_size field. + fileDescFileSize := fileFields[2].Descriptor() + // file.FileSizeValidator is a validator for the "file_size" field. It is called by the builders before save. + file.FileSizeValidator = fileDescFileSize.Validators[0].(func(int) error) + // fileDescID is the schema descriptor for id field. + fileDescID := fileMixinFields2[0].Descriptor() + // file.DefaultID holds the default value on creation for the id field. + file.DefaultID = fileDescID.Default.(func() string) + filehistoryFields := schema.FileHistory{}.Fields() + _ = filehistoryFields + // filehistoryDescHistoryTime is the schema descriptor for history_time field. + filehistoryDescHistoryTime := filehistoryFields[0].Descriptor() + // filehistory.DefaultHistoryTime holds the default value on creation for the history_time field. + filehistory.DefaultHistoryTime = filehistoryDescHistoryTime.Default.(func() time.Time) + // filehistoryDescCreatedAt is the schema descriptor for created_at field. + filehistoryDescCreatedAt := filehistoryFields[3].Descriptor() + // filehistory.DefaultCreatedAt holds the default value on creation for the created_at field. + filehistory.DefaultCreatedAt = filehistoryDescCreatedAt.Default.(func() time.Time) + // filehistoryDescUpdatedAt is the schema descriptor for updated_at field. + filehistoryDescUpdatedAt := filehistoryFields[4].Descriptor() + // filehistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + filehistory.DefaultUpdatedAt = filehistoryDescUpdatedAt.Default.(func() time.Time) + // filehistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + filehistory.UpdateDefaultUpdatedAt = filehistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // filehistoryDescMappingID is the schema descriptor for mapping_id field. + filehistoryDescMappingID := filehistoryFields[10].Descriptor() + // filehistory.DefaultMappingID holds the default value on creation for the mapping_id field. + filehistory.DefaultMappingID = filehistoryDescMappingID.Default.(func() string) + // filehistoryDescTags is the schema descriptor for tags field. + filehistoryDescTags := filehistoryFields[11].Descriptor() + // filehistory.DefaultTags holds the default value on creation for the tags field. + filehistory.DefaultTags = filehistoryDescTags.Default.([]string) + // filehistoryDescID is the schema descriptor for id field. + filehistoryDescID := filehistoryFields[9].Descriptor() + // filehistory.DefaultID holds the default value on creation for the id field. + filehistory.DefaultID = filehistoryDescID.Default.(func() string) + groupMixin := schema.Group{}.Mixin() + group.Policy = privacy.NewPolicies(schema.Group{}) + group.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := group.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + groupMixinHooks0 := groupMixin[0].Hooks() + groupMixinHooks1 := groupMixin[1].Hooks() + groupMixinHooks4 := groupMixin[4].Hooks() + groupHooks := schema.Group{}.Hooks() + + group.Hooks[1] = groupMixinHooks0[0] + + group.Hooks[2] = groupMixinHooks1[0] + + group.Hooks[3] = groupMixinHooks4[0] + + group.Hooks[4] = groupHooks[0] + + group.Hooks[5] = groupHooks[1] + groupMixinInters1 := groupMixin[1].Interceptors() + groupMixinInters4 := groupMixin[4].Interceptors() + groupInters := schema.Group{}.Interceptors() + group.Interceptors[0] = groupMixinInters1[0] + group.Interceptors[1] = groupMixinInters4[0] + group.Interceptors[2] = groupInters[0] + groupMixinFields0 := groupMixin[0].Fields() + _ = groupMixinFields0 + groupMixinFields2 := groupMixin[2].Fields() + _ = groupMixinFields2 + groupMixinFields3 := groupMixin[3].Fields() + _ = groupMixinFields3 + groupMixinFields4 := groupMixin[4].Fields() + _ = groupMixinFields4 + groupFields := schema.Group{}.Fields() + _ = groupFields + // groupDescCreatedAt is the schema descriptor for created_at field. + groupDescCreatedAt := groupMixinFields0[0].Descriptor() + // group.DefaultCreatedAt holds the default value on creation for the created_at field. + group.DefaultCreatedAt = groupDescCreatedAt.Default.(func() time.Time) + // groupDescUpdatedAt is the schema descriptor for updated_at field. + groupDescUpdatedAt := groupMixinFields0[1].Descriptor() + // group.DefaultUpdatedAt holds the default value on creation for the updated_at field. + group.DefaultUpdatedAt = groupDescUpdatedAt.Default.(func() time.Time) + // group.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + group.UpdateDefaultUpdatedAt = groupDescUpdatedAt.UpdateDefault.(func() time.Time) + // groupDescMappingID is the schema descriptor for mapping_id field. + groupDescMappingID := groupMixinFields2[1].Descriptor() + // group.DefaultMappingID holds the default value on creation for the mapping_id field. + group.DefaultMappingID = groupDescMappingID.Default.(func() string) + // groupDescTags is the schema descriptor for tags field. + groupDescTags := groupMixinFields3[0].Descriptor() + // group.DefaultTags holds the default value on creation for the tags field. + group.DefaultTags = groupDescTags.Default.([]string) + // groupDescOwnerID is the schema descriptor for owner_id field. + groupDescOwnerID := groupMixinFields4[0].Descriptor() + // group.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + group.OwnerIDValidator = groupDescOwnerID.Validators[0].(func(string) error) + // groupDescName is the schema descriptor for name field. + groupDescName := groupFields[0].Descriptor() + // group.NameValidator is a validator for the "name" field. It is called by the builders before save. + group.NameValidator = groupDescName.Validators[0].(func(string) error) + // groupDescDisplayName is the schema descriptor for display_name field. + groupDescDisplayName := groupFields[4].Descriptor() + // group.DefaultDisplayName holds the default value on creation for the display_name field. + group.DefaultDisplayName = groupDescDisplayName.Default.(string) + // group.DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + group.DisplayNameValidator = groupDescDisplayName.Validators[0].(func(string) error) + // groupDescID is the schema descriptor for id field. + groupDescID := groupMixinFields2[0].Descriptor() + // group.DefaultID holds the default value on creation for the id field. + group.DefaultID = groupDescID.Default.(func() string) + grouphistory.Policy = privacy.NewPolicies(schema.GroupHistory{}) + grouphistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := grouphistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + grouphistoryInters := schema.GroupHistory{}.Interceptors() + grouphistory.Interceptors[0] = grouphistoryInters[0] + grouphistoryFields := schema.GroupHistory{}.Fields() + _ = grouphistoryFields + // grouphistoryDescHistoryTime is the schema descriptor for history_time field. + grouphistoryDescHistoryTime := grouphistoryFields[0].Descriptor() + // grouphistory.DefaultHistoryTime holds the default value on creation for the history_time field. + grouphistory.DefaultHistoryTime = grouphistoryDescHistoryTime.Default.(func() time.Time) + // grouphistoryDescCreatedAt is the schema descriptor for created_at field. + grouphistoryDescCreatedAt := grouphistoryFields[3].Descriptor() + // grouphistory.DefaultCreatedAt holds the default value on creation for the created_at field. + grouphistory.DefaultCreatedAt = grouphistoryDescCreatedAt.Default.(func() time.Time) + // grouphistoryDescUpdatedAt is the schema descriptor for updated_at field. + grouphistoryDescUpdatedAt := grouphistoryFields[4].Descriptor() + // grouphistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + grouphistory.DefaultUpdatedAt = grouphistoryDescUpdatedAt.Default.(func() time.Time) + // grouphistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + grouphistory.UpdateDefaultUpdatedAt = grouphistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // grouphistoryDescMappingID is the schema descriptor for mapping_id field. + grouphistoryDescMappingID := grouphistoryFields[10].Descriptor() + // grouphistory.DefaultMappingID holds the default value on creation for the mapping_id field. + grouphistory.DefaultMappingID = grouphistoryDescMappingID.Default.(func() string) + // grouphistoryDescTags is the schema descriptor for tags field. + grouphistoryDescTags := grouphistoryFields[11].Descriptor() + // grouphistory.DefaultTags holds the default value on creation for the tags field. + grouphistory.DefaultTags = grouphistoryDescTags.Default.([]string) + // grouphistoryDescDisplayName is the schema descriptor for display_name field. + grouphistoryDescDisplayName := grouphistoryFields[17].Descriptor() + // grouphistory.DefaultDisplayName holds the default value on creation for the display_name field. + grouphistory.DefaultDisplayName = grouphistoryDescDisplayName.Default.(string) + // grouphistoryDescID is the schema descriptor for id field. + grouphistoryDescID := grouphistoryFields[9].Descriptor() + // grouphistory.DefaultID holds the default value on creation for the id field. + grouphistory.DefaultID = grouphistoryDescID.Default.(func() string) + groupmembershipMixin := schema.GroupMembership{}.Mixin() + groupmembership.Policy = privacy.NewPolicies(schema.GroupMembership{}) + groupmembership.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := groupmembership.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + groupmembershipMixinHooks0 := groupmembershipMixin[0].Hooks() + groupmembershipMixinHooks2 := groupmembershipMixin[2].Hooks() + groupmembershipHooks := schema.GroupMembership{}.Hooks() + + groupmembership.Hooks[1] = groupmembershipMixinHooks0[0] + + groupmembership.Hooks[2] = groupmembershipMixinHooks2[0] + + groupmembership.Hooks[3] = groupmembershipHooks[0] + groupmembershipMixinInters2 := groupmembershipMixin[2].Interceptors() + groupmembership.Interceptors[0] = groupmembershipMixinInters2[0] + groupmembershipMixinFields0 := groupmembershipMixin[0].Fields() + _ = groupmembershipMixinFields0 + groupmembershipMixinFields1 := groupmembershipMixin[1].Fields() + _ = groupmembershipMixinFields1 + groupmembershipFields := schema.GroupMembership{}.Fields() + _ = groupmembershipFields + // groupmembershipDescCreatedAt is the schema descriptor for created_at field. + groupmembershipDescCreatedAt := groupmembershipMixinFields0[0].Descriptor() + // groupmembership.DefaultCreatedAt holds the default value on creation for the created_at field. + groupmembership.DefaultCreatedAt = groupmembershipDescCreatedAt.Default.(func() time.Time) + // groupmembershipDescUpdatedAt is the schema descriptor for updated_at field. + groupmembershipDescUpdatedAt := groupmembershipMixinFields0[1].Descriptor() + // groupmembership.DefaultUpdatedAt holds the default value on creation for the updated_at field. + groupmembership.DefaultUpdatedAt = groupmembershipDescUpdatedAt.Default.(func() time.Time) + // groupmembership.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + groupmembership.UpdateDefaultUpdatedAt = groupmembershipDescUpdatedAt.UpdateDefault.(func() time.Time) + // groupmembershipDescMappingID is the schema descriptor for mapping_id field. + groupmembershipDescMappingID := groupmembershipMixinFields1[1].Descriptor() + // groupmembership.DefaultMappingID holds the default value on creation for the mapping_id field. + groupmembership.DefaultMappingID = groupmembershipDescMappingID.Default.(func() string) + // groupmembershipDescID is the schema descriptor for id field. + groupmembershipDescID := groupmembershipMixinFields1[0].Descriptor() + // groupmembership.DefaultID holds the default value on creation for the id field. + groupmembership.DefaultID = groupmembershipDescID.Default.(func() string) + groupmembershiphistory.Policy = privacy.NewPolicies(schema.GroupMembershipHistory{}) + groupmembershiphistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := groupmembershiphistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + groupmembershiphistoryInters := schema.GroupMembershipHistory{}.Interceptors() + groupmembershiphistory.Interceptors[0] = groupmembershiphistoryInters[0] + groupmembershiphistoryFields := schema.GroupMembershipHistory{}.Fields() + _ = groupmembershiphistoryFields + // groupmembershiphistoryDescHistoryTime is the schema descriptor for history_time field. + groupmembershiphistoryDescHistoryTime := groupmembershiphistoryFields[0].Descriptor() + // groupmembershiphistory.DefaultHistoryTime holds the default value on creation for the history_time field. + groupmembershiphistory.DefaultHistoryTime = groupmembershiphistoryDescHistoryTime.Default.(func() time.Time) + // groupmembershiphistoryDescCreatedAt is the schema descriptor for created_at field. + groupmembershiphistoryDescCreatedAt := groupmembershiphistoryFields[3].Descriptor() + // groupmembershiphistory.DefaultCreatedAt holds the default value on creation for the created_at field. + groupmembershiphistory.DefaultCreatedAt = groupmembershiphistoryDescCreatedAt.Default.(func() time.Time) + // groupmembershiphistoryDescUpdatedAt is the schema descriptor for updated_at field. + groupmembershiphistoryDescUpdatedAt := groupmembershiphistoryFields[4].Descriptor() + // groupmembershiphistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + groupmembershiphistory.DefaultUpdatedAt = groupmembershiphistoryDescUpdatedAt.Default.(func() time.Time) + // groupmembershiphistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + groupmembershiphistory.UpdateDefaultUpdatedAt = groupmembershiphistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // groupmembershiphistoryDescMappingID is the schema descriptor for mapping_id field. + groupmembershiphistoryDescMappingID := groupmembershiphistoryFields[8].Descriptor() + // groupmembershiphistory.DefaultMappingID holds the default value on creation for the mapping_id field. + groupmembershiphistory.DefaultMappingID = groupmembershiphistoryDescMappingID.Default.(func() string) + // groupmembershiphistoryDescID is the schema descriptor for id field. + groupmembershiphistoryDescID := groupmembershiphistoryFields[7].Descriptor() + // groupmembershiphistory.DefaultID holds the default value on creation for the id field. + groupmembershiphistory.DefaultID = groupmembershiphistoryDescID.Default.(func() string) + groupsettingMixin := schema.GroupSetting{}.Mixin() + groupsetting.Policy = privacy.NewPolicies(schema.GroupSetting{}) + groupsetting.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := groupsetting.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + groupsettingMixinHooks0 := groupsettingMixin[0].Hooks() + groupsettingMixinHooks3 := groupsettingMixin[3].Hooks() + + groupsetting.Hooks[1] = groupsettingMixinHooks0[0] + + groupsetting.Hooks[2] = groupsettingMixinHooks3[0] + groupsettingMixinInters3 := groupsettingMixin[3].Interceptors() + groupsetting.Interceptors[0] = groupsettingMixinInters3[0] + groupsettingMixinFields0 := groupsettingMixin[0].Fields() + _ = groupsettingMixinFields0 + groupsettingMixinFields1 := groupsettingMixin[1].Fields() + _ = groupsettingMixinFields1 + groupsettingMixinFields2 := groupsettingMixin[2].Fields() + _ = groupsettingMixinFields2 + groupsettingFields := schema.GroupSetting{}.Fields() + _ = groupsettingFields + // groupsettingDescCreatedAt is the schema descriptor for created_at field. + groupsettingDescCreatedAt := groupsettingMixinFields0[0].Descriptor() + // groupsetting.DefaultCreatedAt holds the default value on creation for the created_at field. + groupsetting.DefaultCreatedAt = groupsettingDescCreatedAt.Default.(func() time.Time) + // groupsettingDescUpdatedAt is the schema descriptor for updated_at field. + groupsettingDescUpdatedAt := groupsettingMixinFields0[1].Descriptor() + // groupsetting.DefaultUpdatedAt holds the default value on creation for the updated_at field. + groupsetting.DefaultUpdatedAt = groupsettingDescUpdatedAt.Default.(func() time.Time) + // groupsetting.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + groupsetting.UpdateDefaultUpdatedAt = groupsettingDescUpdatedAt.UpdateDefault.(func() time.Time) + // groupsettingDescMappingID is the schema descriptor for mapping_id field. + groupsettingDescMappingID := groupsettingMixinFields1[1].Descriptor() + // groupsetting.DefaultMappingID holds the default value on creation for the mapping_id field. + groupsetting.DefaultMappingID = groupsettingDescMappingID.Default.(func() string) + // groupsettingDescTags is the schema descriptor for tags field. + groupsettingDescTags := groupsettingMixinFields2[0].Descriptor() + // groupsetting.DefaultTags holds the default value on creation for the tags field. + groupsetting.DefaultTags = groupsettingDescTags.Default.([]string) + // groupsettingDescSyncToSlack is the schema descriptor for sync_to_slack field. + groupsettingDescSyncToSlack := groupsettingFields[2].Descriptor() + // groupsetting.DefaultSyncToSlack holds the default value on creation for the sync_to_slack field. + groupsetting.DefaultSyncToSlack = groupsettingDescSyncToSlack.Default.(bool) + // groupsettingDescSyncToGithub is the schema descriptor for sync_to_github field. + groupsettingDescSyncToGithub := groupsettingFields[3].Descriptor() + // groupsetting.DefaultSyncToGithub holds the default value on creation for the sync_to_github field. + groupsetting.DefaultSyncToGithub = groupsettingDescSyncToGithub.Default.(bool) + // groupsettingDescID is the schema descriptor for id field. + groupsettingDescID := groupsettingMixinFields1[0].Descriptor() + // groupsetting.DefaultID holds the default value on creation for the id field. + groupsetting.DefaultID = groupsettingDescID.Default.(func() string) + groupsettinghistory.Policy = privacy.NewPolicies(schema.GroupSettingHistory{}) + groupsettinghistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := groupsettinghistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + groupsettinghistoryInters := schema.GroupSettingHistory{}.Interceptors() + groupsettinghistory.Interceptors[0] = groupsettinghistoryInters[0] + groupsettinghistoryFields := schema.GroupSettingHistory{}.Fields() + _ = groupsettinghistoryFields + // groupsettinghistoryDescHistoryTime is the schema descriptor for history_time field. + groupsettinghistoryDescHistoryTime := groupsettinghistoryFields[0].Descriptor() + // groupsettinghistory.DefaultHistoryTime holds the default value on creation for the history_time field. + groupsettinghistory.DefaultHistoryTime = groupsettinghistoryDescHistoryTime.Default.(func() time.Time) + // groupsettinghistoryDescCreatedAt is the schema descriptor for created_at field. + groupsettinghistoryDescCreatedAt := groupsettinghistoryFields[3].Descriptor() + // groupsettinghistory.DefaultCreatedAt holds the default value on creation for the created_at field. + groupsettinghistory.DefaultCreatedAt = groupsettinghistoryDescCreatedAt.Default.(func() time.Time) + // groupsettinghistoryDescUpdatedAt is the schema descriptor for updated_at field. + groupsettinghistoryDescUpdatedAt := groupsettinghistoryFields[4].Descriptor() + // groupsettinghistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + groupsettinghistory.DefaultUpdatedAt = groupsettinghistoryDescUpdatedAt.Default.(func() time.Time) + // groupsettinghistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + groupsettinghistory.UpdateDefaultUpdatedAt = groupsettinghistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // groupsettinghistoryDescMappingID is the schema descriptor for mapping_id field. + groupsettinghistoryDescMappingID := groupsettinghistoryFields[8].Descriptor() + // groupsettinghistory.DefaultMappingID holds the default value on creation for the mapping_id field. + groupsettinghistory.DefaultMappingID = groupsettinghistoryDescMappingID.Default.(func() string) + // groupsettinghistoryDescTags is the schema descriptor for tags field. + groupsettinghistoryDescTags := groupsettinghistoryFields[9].Descriptor() + // groupsettinghistory.DefaultTags holds the default value on creation for the tags field. + groupsettinghistory.DefaultTags = groupsettinghistoryDescTags.Default.([]string) + // groupsettinghistoryDescSyncToSlack is the schema descriptor for sync_to_slack field. + groupsettinghistoryDescSyncToSlack := groupsettinghistoryFields[14].Descriptor() + // groupsettinghistory.DefaultSyncToSlack holds the default value on creation for the sync_to_slack field. + groupsettinghistory.DefaultSyncToSlack = groupsettinghistoryDescSyncToSlack.Default.(bool) + // groupsettinghistoryDescSyncToGithub is the schema descriptor for sync_to_github field. + groupsettinghistoryDescSyncToGithub := groupsettinghistoryFields[15].Descriptor() + // groupsettinghistory.DefaultSyncToGithub holds the default value on creation for the sync_to_github field. + groupsettinghistory.DefaultSyncToGithub = groupsettinghistoryDescSyncToGithub.Default.(bool) + // groupsettinghistoryDescID is the schema descriptor for id field. + groupsettinghistoryDescID := groupsettinghistoryFields[7].Descriptor() + // groupsettinghistory.DefaultID holds the default value on creation for the id field. + groupsettinghistory.DefaultID = groupsettinghistoryDescID.Default.(func() string) + hushMixin := schema.Hush{}.Mixin() + hushMixinHooks0 := hushMixin[0].Hooks() + hushMixinHooks2 := hushMixin[2].Hooks() + hushHooks := schema.Hush{}.Hooks() + hush.Hooks[0] = hushMixinHooks0[0] + hush.Hooks[1] = hushMixinHooks2[0] + hush.Hooks[2] = hushHooks[0] + hushMixinInters2 := hushMixin[2].Interceptors() + hushInters := schema.Hush{}.Interceptors() + hush.Interceptors[0] = hushMixinInters2[0] + hush.Interceptors[1] = hushInters[0] + hushMixinFields0 := hushMixin[0].Fields() + _ = hushMixinFields0 + hushMixinFields1 := hushMixin[1].Fields() + _ = hushMixinFields1 + hushFields := schema.Hush{}.Fields() + _ = hushFields + // hushDescCreatedAt is the schema descriptor for created_at field. + hushDescCreatedAt := hushMixinFields0[0].Descriptor() + // hush.DefaultCreatedAt holds the default value on creation for the created_at field. + hush.DefaultCreatedAt = hushDescCreatedAt.Default.(func() time.Time) + // hushDescUpdatedAt is the schema descriptor for updated_at field. + hushDescUpdatedAt := hushMixinFields0[1].Descriptor() + // hush.DefaultUpdatedAt holds the default value on creation for the updated_at field. + hush.DefaultUpdatedAt = hushDescUpdatedAt.Default.(func() time.Time) + // hush.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + hush.UpdateDefaultUpdatedAt = hushDescUpdatedAt.UpdateDefault.(func() time.Time) + // hushDescMappingID is the schema descriptor for mapping_id field. + hushDescMappingID := hushMixinFields1[1].Descriptor() + // hush.DefaultMappingID holds the default value on creation for the mapping_id field. + hush.DefaultMappingID = hushDescMappingID.Default.(func() string) + // hushDescName is the schema descriptor for name field. + hushDescName := hushFields[0].Descriptor() + // hush.NameValidator is a validator for the "name" field. It is called by the builders before save. + hush.NameValidator = hushDescName.Validators[0].(func(string) error) + // hushDescID is the schema descriptor for id field. + hushDescID := hushMixinFields1[0].Descriptor() + // hush.DefaultID holds the default value on creation for the id field. + hush.DefaultID = hushDescID.Default.(func() string) + hushhistoryFields := schema.HushHistory{}.Fields() + _ = hushhistoryFields + // hushhistoryDescHistoryTime is the schema descriptor for history_time field. + hushhistoryDescHistoryTime := hushhistoryFields[0].Descriptor() + // hushhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + hushhistory.DefaultHistoryTime = hushhistoryDescHistoryTime.Default.(func() time.Time) + // hushhistoryDescCreatedAt is the schema descriptor for created_at field. + hushhistoryDescCreatedAt := hushhistoryFields[3].Descriptor() + // hushhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + hushhistory.DefaultCreatedAt = hushhistoryDescCreatedAt.Default.(func() time.Time) + // hushhistoryDescUpdatedAt is the schema descriptor for updated_at field. + hushhistoryDescUpdatedAt := hushhistoryFields[4].Descriptor() + // hushhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + hushhistory.DefaultUpdatedAt = hushhistoryDescUpdatedAt.Default.(func() time.Time) + // hushhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + hushhistory.UpdateDefaultUpdatedAt = hushhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // hushhistoryDescMappingID is the schema descriptor for mapping_id field. + hushhistoryDescMappingID := hushhistoryFields[8].Descriptor() + // hushhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + hushhistory.DefaultMappingID = hushhistoryDescMappingID.Default.(func() string) + // hushhistoryDescID is the schema descriptor for id field. + hushhistoryDescID := hushhistoryFields[7].Descriptor() + // hushhistory.DefaultID holds the default value on creation for the id field. + hushhistory.DefaultID = hushhistoryDescID.Default.(func() string) + integrationMixin := schema.Integration{}.Mixin() + integration.Policy = privacy.NewPolicies(schema.Integration{}) + integration.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := integration.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + integrationMixinHooks0 := integrationMixin[0].Hooks() + integrationMixinHooks3 := integrationMixin[3].Hooks() + integrationMixinHooks4 := integrationMixin[4].Hooks() + + integration.Hooks[1] = integrationMixinHooks0[0] + + integration.Hooks[2] = integrationMixinHooks3[0] + + integration.Hooks[3] = integrationMixinHooks4[0] + integrationMixinInters3 := integrationMixin[3].Interceptors() + integrationMixinInters4 := integrationMixin[4].Interceptors() + integration.Interceptors[0] = integrationMixinInters3[0] + integration.Interceptors[1] = integrationMixinInters4[0] + integrationMixinFields0 := integrationMixin[0].Fields() + _ = integrationMixinFields0 + integrationMixinFields1 := integrationMixin[1].Fields() + _ = integrationMixinFields1 + integrationMixinFields2 := integrationMixin[2].Fields() + _ = integrationMixinFields2 + integrationMixinFields4 := integrationMixin[4].Fields() + _ = integrationMixinFields4 + integrationFields := schema.Integration{}.Fields() + _ = integrationFields + // integrationDescCreatedAt is the schema descriptor for created_at field. + integrationDescCreatedAt := integrationMixinFields0[0].Descriptor() + // integration.DefaultCreatedAt holds the default value on creation for the created_at field. + integration.DefaultCreatedAt = integrationDescCreatedAt.Default.(func() time.Time) + // integrationDescUpdatedAt is the schema descriptor for updated_at field. + integrationDescUpdatedAt := integrationMixinFields0[1].Descriptor() + // integration.DefaultUpdatedAt holds the default value on creation for the updated_at field. + integration.DefaultUpdatedAt = integrationDescUpdatedAt.Default.(func() time.Time) + // integration.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + integration.UpdateDefaultUpdatedAt = integrationDescUpdatedAt.UpdateDefault.(func() time.Time) + // integrationDescMappingID is the schema descriptor for mapping_id field. + integrationDescMappingID := integrationMixinFields1[1].Descriptor() + // integration.DefaultMappingID holds the default value on creation for the mapping_id field. + integration.DefaultMappingID = integrationDescMappingID.Default.(func() string) + // integrationDescTags is the schema descriptor for tags field. + integrationDescTags := integrationMixinFields2[0].Descriptor() + // integration.DefaultTags holds the default value on creation for the tags field. + integration.DefaultTags = integrationDescTags.Default.([]string) + // integrationDescOwnerID is the schema descriptor for owner_id field. + integrationDescOwnerID := integrationMixinFields4[0].Descriptor() + // integration.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + integration.OwnerIDValidator = integrationDescOwnerID.Validators[0].(func(string) error) + // integrationDescName is the schema descriptor for name field. + integrationDescName := integrationFields[0].Descriptor() + // integration.NameValidator is a validator for the "name" field. It is called by the builders before save. + integration.NameValidator = integrationDescName.Validators[0].(func(string) error) + // integrationDescID is the schema descriptor for id field. + integrationDescID := integrationMixinFields1[0].Descriptor() + // integration.DefaultID holds the default value on creation for the id field. + integration.DefaultID = integrationDescID.Default.(func() string) + integrationhistory.Policy = privacy.NewPolicies(schema.IntegrationHistory{}) + integrationhistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := integrationhistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + integrationhistoryInters := schema.IntegrationHistory{}.Interceptors() + integrationhistory.Interceptors[0] = integrationhistoryInters[0] + integrationhistoryFields := schema.IntegrationHistory{}.Fields() + _ = integrationhistoryFields + // integrationhistoryDescHistoryTime is the schema descriptor for history_time field. + integrationhistoryDescHistoryTime := integrationhistoryFields[0].Descriptor() + // integrationhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + integrationhistory.DefaultHistoryTime = integrationhistoryDescHistoryTime.Default.(func() time.Time) + // integrationhistoryDescCreatedAt is the schema descriptor for created_at field. + integrationhistoryDescCreatedAt := integrationhistoryFields[3].Descriptor() + // integrationhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + integrationhistory.DefaultCreatedAt = integrationhistoryDescCreatedAt.Default.(func() time.Time) + // integrationhistoryDescUpdatedAt is the schema descriptor for updated_at field. + integrationhistoryDescUpdatedAt := integrationhistoryFields[4].Descriptor() + // integrationhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + integrationhistory.DefaultUpdatedAt = integrationhistoryDescUpdatedAt.Default.(func() time.Time) + // integrationhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + integrationhistory.UpdateDefaultUpdatedAt = integrationhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // integrationhistoryDescMappingID is the schema descriptor for mapping_id field. + integrationhistoryDescMappingID := integrationhistoryFields[8].Descriptor() + // integrationhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + integrationhistory.DefaultMappingID = integrationhistoryDescMappingID.Default.(func() string) + // integrationhistoryDescTags is the schema descriptor for tags field. + integrationhistoryDescTags := integrationhistoryFields[9].Descriptor() + // integrationhistory.DefaultTags holds the default value on creation for the tags field. + integrationhistory.DefaultTags = integrationhistoryDescTags.Default.([]string) + // integrationhistoryDescID is the schema descriptor for id field. + integrationhistoryDescID := integrationhistoryFields[7].Descriptor() + // integrationhistory.DefaultID holds the default value on creation for the id field. + integrationhistory.DefaultID = integrationhistoryDescID.Default.(func() string) + inviteMixin := schema.Invite{}.Mixin() + invite.Policy = privacy.NewPolicies(schema.Invite{}) + invite.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := invite.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + inviteMixinHooks0 := inviteMixin[0].Hooks() + inviteMixinHooks2 := inviteMixin[2].Hooks() + inviteMixinHooks3 := inviteMixin[3].Hooks() + inviteHooks := schema.Invite{}.Hooks() + + invite.Hooks[1] = inviteMixinHooks0[0] + + invite.Hooks[2] = inviteMixinHooks2[0] + + invite.Hooks[3] = inviteMixinHooks3[0] + + invite.Hooks[4] = inviteHooks[0] + + invite.Hooks[5] = inviteHooks[1] + inviteMixinInters2 := inviteMixin[2].Interceptors() + inviteMixinInters3 := inviteMixin[3].Interceptors() + invite.Interceptors[0] = inviteMixinInters2[0] + invite.Interceptors[1] = inviteMixinInters3[0] + inviteMixinFields0 := inviteMixin[0].Fields() + _ = inviteMixinFields0 + inviteMixinFields1 := inviteMixin[1].Fields() + _ = inviteMixinFields1 + inviteMixinFields3 := inviteMixin[3].Fields() + _ = inviteMixinFields3 + inviteFields := schema.Invite{}.Fields() + _ = inviteFields + // inviteDescCreatedAt is the schema descriptor for created_at field. + inviteDescCreatedAt := inviteMixinFields0[0].Descriptor() + // invite.DefaultCreatedAt holds the default value on creation for the created_at field. + invite.DefaultCreatedAt = inviteDescCreatedAt.Default.(func() time.Time) + // inviteDescUpdatedAt is the schema descriptor for updated_at field. + inviteDescUpdatedAt := inviteMixinFields0[1].Descriptor() + // invite.DefaultUpdatedAt holds the default value on creation for the updated_at field. + invite.DefaultUpdatedAt = inviteDescUpdatedAt.Default.(func() time.Time) + // invite.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + invite.UpdateDefaultUpdatedAt = inviteDescUpdatedAt.UpdateDefault.(func() time.Time) + // inviteDescMappingID is the schema descriptor for mapping_id field. + inviteDescMappingID := inviteMixinFields1[1].Descriptor() + // invite.DefaultMappingID holds the default value on creation for the mapping_id field. + invite.DefaultMappingID = inviteDescMappingID.Default.(func() string) + // inviteDescOwnerID is the schema descriptor for owner_id field. + inviteDescOwnerID := inviteMixinFields3[0].Descriptor() + // invite.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + invite.OwnerIDValidator = inviteDescOwnerID.Validators[0].(func(string) error) + // inviteDescToken is the schema descriptor for token field. + inviteDescToken := inviteFields[0].Descriptor() + // invite.TokenValidator is a validator for the "token" field. It is called by the builders before save. + invite.TokenValidator = inviteDescToken.Validators[0].(func(string) error) + // inviteDescExpires is the schema descriptor for expires field. + inviteDescExpires := inviteFields[1].Descriptor() + // invite.DefaultExpires holds the default value on creation for the expires field. + invite.DefaultExpires = inviteDescExpires.Default.(func() time.Time) + // inviteDescRecipient is the schema descriptor for recipient field. + inviteDescRecipient := inviteFields[2].Descriptor() + // invite.RecipientValidator is a validator for the "recipient" field. It is called by the builders before save. + invite.RecipientValidator = func() func(string) error { + validators := inviteDescRecipient.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(recipient string) error { + for _, fn := range fns { + if err := fn(recipient); err != nil { + return err + } + } + return nil + } + }() + // inviteDescSendAttempts is the schema descriptor for send_attempts field. + inviteDescSendAttempts := inviteFields[5].Descriptor() + // invite.DefaultSendAttempts holds the default value on creation for the send_attempts field. + invite.DefaultSendAttempts = inviteDescSendAttempts.Default.(int) + // inviteDescRequestorID is the schema descriptor for requestor_id field. + inviteDescRequestorID := inviteFields[6].Descriptor() + // invite.RequestorIDValidator is a validator for the "requestor_id" field. It is called by the builders before save. + invite.RequestorIDValidator = inviteDescRequestorID.Validators[0].(func(string) error) + // inviteDescSecret is the schema descriptor for secret field. + inviteDescSecret := inviteFields[7].Descriptor() + // invite.SecretValidator is a validator for the "secret" field. It is called by the builders before save. + invite.SecretValidator = inviteDescSecret.Validators[0].(func([]byte) error) + // inviteDescID is the schema descriptor for id field. + inviteDescID := inviteMixinFields1[0].Descriptor() + // invite.DefaultID holds the default value on creation for the id field. + invite.DefaultID = inviteDescID.Default.(func() string) + noteMixin := schema.Note{}.Mixin() + note.Policy = privacy.NewPolicies(schema.Note{}) + note.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := note.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + noteMixinHooks0 := noteMixin[0].Hooks() + noteMixinHooks2 := noteMixin[2].Hooks() + noteMixinHooks4 := noteMixin[4].Hooks() + + note.Hooks[1] = noteMixinHooks0[0] + + note.Hooks[2] = noteMixinHooks2[0] + + note.Hooks[3] = noteMixinHooks4[0] + noteMixinInters2 := noteMixin[2].Interceptors() + noteMixinInters4 := noteMixin[4].Interceptors() + note.Interceptors[0] = noteMixinInters2[0] + note.Interceptors[1] = noteMixinInters4[0] + noteMixinFields0 := noteMixin[0].Fields() + _ = noteMixinFields0 + noteMixinFields1 := noteMixin[1].Fields() + _ = noteMixinFields1 + noteMixinFields3 := noteMixin[3].Fields() + _ = noteMixinFields3 + noteMixinFields4 := noteMixin[4].Fields() + _ = noteMixinFields4 + noteFields := schema.Note{}.Fields() + _ = noteFields + // noteDescCreatedAt is the schema descriptor for created_at field. + noteDescCreatedAt := noteMixinFields0[0].Descriptor() + // note.DefaultCreatedAt holds the default value on creation for the created_at field. + note.DefaultCreatedAt = noteDescCreatedAt.Default.(func() time.Time) + // noteDescUpdatedAt is the schema descriptor for updated_at field. + noteDescUpdatedAt := noteMixinFields0[1].Descriptor() + // note.DefaultUpdatedAt holds the default value on creation for the updated_at field. + note.DefaultUpdatedAt = noteDescUpdatedAt.Default.(func() time.Time) + // note.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + note.UpdateDefaultUpdatedAt = noteDescUpdatedAt.UpdateDefault.(func() time.Time) + // noteDescMappingID is the schema descriptor for mapping_id field. + noteDescMappingID := noteMixinFields1[1].Descriptor() + // note.DefaultMappingID holds the default value on creation for the mapping_id field. + note.DefaultMappingID = noteDescMappingID.Default.(func() string) + // noteDescTags is the schema descriptor for tags field. + noteDescTags := noteMixinFields3[0].Descriptor() + // note.DefaultTags holds the default value on creation for the tags field. + note.DefaultTags = noteDescTags.Default.([]string) + // noteDescOwnerID is the schema descriptor for owner_id field. + noteDescOwnerID := noteMixinFields4[0].Descriptor() + // note.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + note.OwnerIDValidator = noteDescOwnerID.Validators[0].(func(string) error) + // noteDescText is the schema descriptor for text field. + noteDescText := noteFields[0].Descriptor() + // note.TextValidator is a validator for the "text" field. It is called by the builders before save. + note.TextValidator = noteDescText.Validators[0].(func(string) error) + // noteDescID is the schema descriptor for id field. + noteDescID := noteMixinFields1[0].Descriptor() + // note.DefaultID holds the default value on creation for the id field. + note.DefaultID = noteDescID.Default.(func() string) + notehistory.Policy = privacy.NewPolicies(schema.NoteHistory{}) + notehistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := notehistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + notehistoryInters := schema.NoteHistory{}.Interceptors() + notehistory.Interceptors[0] = notehistoryInters[0] + notehistoryFields := schema.NoteHistory{}.Fields() + _ = notehistoryFields + // notehistoryDescHistoryTime is the schema descriptor for history_time field. + notehistoryDescHistoryTime := notehistoryFields[0].Descriptor() + // notehistory.DefaultHistoryTime holds the default value on creation for the history_time field. + notehistory.DefaultHistoryTime = notehistoryDescHistoryTime.Default.(func() time.Time) + // notehistoryDescCreatedAt is the schema descriptor for created_at field. + notehistoryDescCreatedAt := notehistoryFields[3].Descriptor() + // notehistory.DefaultCreatedAt holds the default value on creation for the created_at field. + notehistory.DefaultCreatedAt = notehistoryDescCreatedAt.Default.(func() time.Time) + // notehistoryDescUpdatedAt is the schema descriptor for updated_at field. + notehistoryDescUpdatedAt := notehistoryFields[4].Descriptor() + // notehistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + notehistory.DefaultUpdatedAt = notehistoryDescUpdatedAt.Default.(func() time.Time) + // notehistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + notehistory.UpdateDefaultUpdatedAt = notehistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // notehistoryDescMappingID is the schema descriptor for mapping_id field. + notehistoryDescMappingID := notehistoryFields[8].Descriptor() + // notehistory.DefaultMappingID holds the default value on creation for the mapping_id field. + notehistory.DefaultMappingID = notehistoryDescMappingID.Default.(func() string) + // notehistoryDescTags is the schema descriptor for tags field. + notehistoryDescTags := notehistoryFields[11].Descriptor() + // notehistory.DefaultTags holds the default value on creation for the tags field. + notehistory.DefaultTags = notehistoryDescTags.Default.([]string) + // notehistoryDescID is the schema descriptor for id field. + notehistoryDescID := notehistoryFields[7].Descriptor() + // notehistory.DefaultID holds the default value on creation for the id field. + notehistory.DefaultID = notehistoryDescID.Default.(func() string) + oauthproviderMixin := schema.OauthProvider{}.Mixin() + oauthprovider.Policy = privacy.NewPolicies(schema.OauthProvider{}) + oauthprovider.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := oauthprovider.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + oauthproviderMixinHooks0 := oauthproviderMixin[0].Hooks() + oauthproviderMixinHooks3 := oauthproviderMixin[3].Hooks() + oauthproviderMixinHooks4 := oauthproviderMixin[4].Hooks() + + oauthprovider.Hooks[1] = oauthproviderMixinHooks0[0] + + oauthprovider.Hooks[2] = oauthproviderMixinHooks3[0] + + oauthprovider.Hooks[3] = oauthproviderMixinHooks4[0] + oauthproviderMixinInters3 := oauthproviderMixin[3].Interceptors() + oauthproviderMixinInters4 := oauthproviderMixin[4].Interceptors() + oauthprovider.Interceptors[0] = oauthproviderMixinInters3[0] + oauthprovider.Interceptors[1] = oauthproviderMixinInters4[0] + oauthproviderMixinFields0 := oauthproviderMixin[0].Fields() + _ = oauthproviderMixinFields0 + oauthproviderMixinFields1 := oauthproviderMixin[1].Fields() + _ = oauthproviderMixinFields1 + oauthproviderMixinFields2 := oauthproviderMixin[2].Fields() + _ = oauthproviderMixinFields2 + oauthproviderMixinFields4 := oauthproviderMixin[4].Fields() + _ = oauthproviderMixinFields4 + oauthproviderFields := schema.OauthProvider{}.Fields() + _ = oauthproviderFields + // oauthproviderDescCreatedAt is the schema descriptor for created_at field. + oauthproviderDescCreatedAt := oauthproviderMixinFields0[0].Descriptor() + // oauthprovider.DefaultCreatedAt holds the default value on creation for the created_at field. + oauthprovider.DefaultCreatedAt = oauthproviderDescCreatedAt.Default.(func() time.Time) + // oauthproviderDescUpdatedAt is the schema descriptor for updated_at field. + oauthproviderDescUpdatedAt := oauthproviderMixinFields0[1].Descriptor() + // oauthprovider.DefaultUpdatedAt holds the default value on creation for the updated_at field. + oauthprovider.DefaultUpdatedAt = oauthproviderDescUpdatedAt.Default.(func() time.Time) + // oauthprovider.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + oauthprovider.UpdateDefaultUpdatedAt = oauthproviderDescUpdatedAt.UpdateDefault.(func() time.Time) + // oauthproviderDescMappingID is the schema descriptor for mapping_id field. + oauthproviderDescMappingID := oauthproviderMixinFields1[1].Descriptor() + // oauthprovider.DefaultMappingID holds the default value on creation for the mapping_id field. + oauthprovider.DefaultMappingID = oauthproviderDescMappingID.Default.(func() string) + // oauthproviderDescTags is the schema descriptor for tags field. + oauthproviderDescTags := oauthproviderMixinFields2[0].Descriptor() + // oauthprovider.DefaultTags holds the default value on creation for the tags field. + oauthprovider.DefaultTags = oauthproviderDescTags.Default.([]string) + // oauthproviderDescOwnerID is the schema descriptor for owner_id field. + oauthproviderDescOwnerID := oauthproviderMixinFields4[0].Descriptor() + // oauthprovider.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + oauthprovider.OwnerIDValidator = oauthproviderDescOwnerID.Validators[0].(func(string) error) + // oauthproviderDescID is the schema descriptor for id field. + oauthproviderDescID := oauthproviderMixinFields1[0].Descriptor() + // oauthprovider.DefaultID holds the default value on creation for the id field. + oauthprovider.DefaultID = oauthproviderDescID.Default.(func() string) + oauthproviderhistory.Policy = privacy.NewPolicies(schema.OauthProviderHistory{}) + oauthproviderhistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := oauthproviderhistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + oauthproviderhistoryInters := schema.OauthProviderHistory{}.Interceptors() + oauthproviderhistory.Interceptors[0] = oauthproviderhistoryInters[0] + oauthproviderhistoryFields := schema.OauthProviderHistory{}.Fields() + _ = oauthproviderhistoryFields + // oauthproviderhistoryDescHistoryTime is the schema descriptor for history_time field. + oauthproviderhistoryDescHistoryTime := oauthproviderhistoryFields[0].Descriptor() + // oauthproviderhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + oauthproviderhistory.DefaultHistoryTime = oauthproviderhistoryDescHistoryTime.Default.(func() time.Time) + // oauthproviderhistoryDescCreatedAt is the schema descriptor for created_at field. + oauthproviderhistoryDescCreatedAt := oauthproviderhistoryFields[3].Descriptor() + // oauthproviderhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + oauthproviderhistory.DefaultCreatedAt = oauthproviderhistoryDescCreatedAt.Default.(func() time.Time) + // oauthproviderhistoryDescUpdatedAt is the schema descriptor for updated_at field. + oauthproviderhistoryDescUpdatedAt := oauthproviderhistoryFields[4].Descriptor() + // oauthproviderhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + oauthproviderhistory.DefaultUpdatedAt = oauthproviderhistoryDescUpdatedAt.Default.(func() time.Time) + // oauthproviderhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + oauthproviderhistory.UpdateDefaultUpdatedAt = oauthproviderhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // oauthproviderhistoryDescMappingID is the schema descriptor for mapping_id field. + oauthproviderhistoryDescMappingID := oauthproviderhistoryFields[8].Descriptor() + // oauthproviderhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + oauthproviderhistory.DefaultMappingID = oauthproviderhistoryDescMappingID.Default.(func() string) + // oauthproviderhistoryDescTags is the schema descriptor for tags field. + oauthproviderhistoryDescTags := oauthproviderhistoryFields[9].Descriptor() + // oauthproviderhistory.DefaultTags holds the default value on creation for the tags field. + oauthproviderhistory.DefaultTags = oauthproviderhistoryDescTags.Default.([]string) + // oauthproviderhistoryDescID is the schema descriptor for id field. + oauthproviderhistoryDescID := oauthproviderhistoryFields[7].Descriptor() + // oauthproviderhistory.DefaultID holds the default value on creation for the id field. + oauthproviderhistory.DefaultID = oauthproviderhistoryDescID.Default.(func() string) + ohauthtootokenMixin := schema.OhAuthTooToken{}.Mixin() + ohauthtootokenMixinFields0 := ohauthtootokenMixin[0].Fields() + _ = ohauthtootokenMixinFields0 + ohauthtootokenMixinFields1 := ohauthtootokenMixin[1].Fields() + _ = ohauthtootokenMixinFields1 + ohauthtootokenFields := schema.OhAuthTooToken{}.Fields() + _ = ohauthtootokenFields + // ohauthtootokenDescMappingID is the schema descriptor for mapping_id field. + ohauthtootokenDescMappingID := ohauthtootokenMixinFields0[1].Descriptor() + // ohauthtootoken.DefaultMappingID holds the default value on creation for the mapping_id field. + ohauthtootoken.DefaultMappingID = ohauthtootokenDescMappingID.Default.(func() string) + // ohauthtootokenDescTags is the schema descriptor for tags field. + ohauthtootokenDescTags := ohauthtootokenMixinFields1[0].Descriptor() + // ohauthtootoken.DefaultTags holds the default value on creation for the tags field. + ohauthtootoken.DefaultTags = ohauthtootokenDescTags.Default.([]string) + // ohauthtootokenDescClientID is the schema descriptor for client_id field. + ohauthtootokenDescClientID := ohauthtootokenFields[0].Descriptor() + // ohauthtootoken.ClientIDValidator is a validator for the "client_id" field. It is called by the builders before save. + ohauthtootoken.ClientIDValidator = ohauthtootokenDescClientID.Validators[0].(func(string) error) + // ohauthtootokenDescNonce is the schema descriptor for nonce field. + ohauthtootokenDescNonce := ohauthtootokenFields[2].Descriptor() + // ohauthtootoken.NonceValidator is a validator for the "nonce" field. It is called by the builders before save. + ohauthtootoken.NonceValidator = ohauthtootokenDescNonce.Validators[0].(func(string) error) + // ohauthtootokenDescClaimsUserID is the schema descriptor for claims_user_id field. + ohauthtootokenDescClaimsUserID := ohauthtootokenFields[3].Descriptor() + // ohauthtootoken.ClaimsUserIDValidator is a validator for the "claims_user_id" field. It is called by the builders before save. + ohauthtootoken.ClaimsUserIDValidator = ohauthtootokenDescClaimsUserID.Validators[0].(func(string) error) + // ohauthtootokenDescClaimsUsername is the schema descriptor for claims_username field. + ohauthtootokenDescClaimsUsername := ohauthtootokenFields[4].Descriptor() + // ohauthtootoken.ClaimsUsernameValidator is a validator for the "claims_username" field. It is called by the builders before save. + ohauthtootoken.ClaimsUsernameValidator = ohauthtootokenDescClaimsUsername.Validators[0].(func(string) error) + // ohauthtootokenDescClaimsEmail is the schema descriptor for claims_email field. + ohauthtootokenDescClaimsEmail := ohauthtootokenFields[5].Descriptor() + // ohauthtootoken.ClaimsEmailValidator is a validator for the "claims_email" field. It is called by the builders before save. + ohauthtootoken.ClaimsEmailValidator = ohauthtootokenDescClaimsEmail.Validators[0].(func(string) error) + // ohauthtootokenDescConnectorID is the schema descriptor for connector_id field. + ohauthtootokenDescConnectorID := ohauthtootokenFields[9].Descriptor() + // ohauthtootoken.ConnectorIDValidator is a validator for the "connector_id" field. It is called by the builders before save. + ohauthtootoken.ConnectorIDValidator = ohauthtootokenDescConnectorID.Validators[0].(func(string) error) + // ohauthtootokenDescLastUsed is the schema descriptor for last_used field. + ohauthtootokenDescLastUsed := ohauthtootokenFields[11].Descriptor() + // ohauthtootoken.DefaultLastUsed holds the default value on creation for the last_used field. + ohauthtootoken.DefaultLastUsed = ohauthtootokenDescLastUsed.Default.(func() time.Time) + // ohauthtootokenDescID is the schema descriptor for id field. + ohauthtootokenDescID := ohauthtootokenMixinFields0[0].Descriptor() + // ohauthtootoken.DefaultID holds the default value on creation for the id field. + ohauthtootoken.DefaultID = ohauthtootokenDescID.Default.(func() string) + orgmembershipMixin := schema.OrgMembership{}.Mixin() + orgmembership.Policy = privacy.NewPolicies(schema.OrgMembership{}) + orgmembership.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := orgmembership.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + orgmembershipMixinHooks0 := orgmembershipMixin[0].Hooks() + orgmembershipMixinHooks2 := orgmembershipMixin[2].Hooks() + orgmembershipHooks := schema.OrgMembership{}.Hooks() + + orgmembership.Hooks[1] = orgmembershipMixinHooks0[0] + + orgmembership.Hooks[2] = orgmembershipMixinHooks2[0] + + orgmembership.Hooks[3] = orgmembershipHooks[0] + + orgmembership.Hooks[4] = orgmembershipHooks[1] + orgmembershipMixinInters2 := orgmembershipMixin[2].Interceptors() + orgmembershipInters := schema.OrgMembership{}.Interceptors() + orgmembership.Interceptors[0] = orgmembershipMixinInters2[0] + orgmembership.Interceptors[1] = orgmembershipInters[0] + orgmembership.Interceptors[2] = orgmembershipInters[1] + orgmembershipMixinFields0 := orgmembershipMixin[0].Fields() + _ = orgmembershipMixinFields0 + orgmembershipMixinFields1 := orgmembershipMixin[1].Fields() + _ = orgmembershipMixinFields1 + orgmembershipFields := schema.OrgMembership{}.Fields() + _ = orgmembershipFields + // orgmembershipDescCreatedAt is the schema descriptor for created_at field. + orgmembershipDescCreatedAt := orgmembershipMixinFields0[0].Descriptor() + // orgmembership.DefaultCreatedAt holds the default value on creation for the created_at field. + orgmembership.DefaultCreatedAt = orgmembershipDescCreatedAt.Default.(func() time.Time) + // orgmembershipDescUpdatedAt is the schema descriptor for updated_at field. + orgmembershipDescUpdatedAt := orgmembershipMixinFields0[1].Descriptor() + // orgmembership.DefaultUpdatedAt holds the default value on creation for the updated_at field. + orgmembership.DefaultUpdatedAt = orgmembershipDescUpdatedAt.Default.(func() time.Time) + // orgmembership.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + orgmembership.UpdateDefaultUpdatedAt = orgmembershipDescUpdatedAt.UpdateDefault.(func() time.Time) + // orgmembershipDescMappingID is the schema descriptor for mapping_id field. + orgmembershipDescMappingID := orgmembershipMixinFields1[1].Descriptor() + // orgmembership.DefaultMappingID holds the default value on creation for the mapping_id field. + orgmembership.DefaultMappingID = orgmembershipDescMappingID.Default.(func() string) + // orgmembershipDescID is the schema descriptor for id field. + orgmembershipDescID := orgmembershipMixinFields1[0].Descriptor() + // orgmembership.DefaultID holds the default value on creation for the id field. + orgmembership.DefaultID = orgmembershipDescID.Default.(func() string) + orgmembershiphistory.Policy = privacy.NewPolicies(schema.OrgMembershipHistory{}) + orgmembershiphistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := orgmembershiphistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + orgmembershiphistoryInters := schema.OrgMembershipHistory{}.Interceptors() + orgmembershiphistory.Interceptors[0] = orgmembershiphistoryInters[0] + orgmembershiphistoryFields := schema.OrgMembershipHistory{}.Fields() + _ = orgmembershiphistoryFields + // orgmembershiphistoryDescHistoryTime is the schema descriptor for history_time field. + orgmembershiphistoryDescHistoryTime := orgmembershiphistoryFields[0].Descriptor() + // orgmembershiphistory.DefaultHistoryTime holds the default value on creation for the history_time field. + orgmembershiphistory.DefaultHistoryTime = orgmembershiphistoryDescHistoryTime.Default.(func() time.Time) + // orgmembershiphistoryDescCreatedAt is the schema descriptor for created_at field. + orgmembershiphistoryDescCreatedAt := orgmembershiphistoryFields[3].Descriptor() + // orgmembershiphistory.DefaultCreatedAt holds the default value on creation for the created_at field. + orgmembershiphistory.DefaultCreatedAt = orgmembershiphistoryDescCreatedAt.Default.(func() time.Time) + // orgmembershiphistoryDescUpdatedAt is the schema descriptor for updated_at field. + orgmembershiphistoryDescUpdatedAt := orgmembershiphistoryFields[4].Descriptor() + // orgmembershiphistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + orgmembershiphistory.DefaultUpdatedAt = orgmembershiphistoryDescUpdatedAt.Default.(func() time.Time) + // orgmembershiphistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + orgmembershiphistory.UpdateDefaultUpdatedAt = orgmembershiphistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // orgmembershiphistoryDescMappingID is the schema descriptor for mapping_id field. + orgmembershiphistoryDescMappingID := orgmembershiphistoryFields[8].Descriptor() + // orgmembershiphistory.DefaultMappingID holds the default value on creation for the mapping_id field. + orgmembershiphistory.DefaultMappingID = orgmembershiphistoryDescMappingID.Default.(func() string) + // orgmembershiphistoryDescID is the schema descriptor for id field. + orgmembershiphistoryDescID := orgmembershiphistoryFields[7].Descriptor() + // orgmembershiphistory.DefaultID holds the default value on creation for the id field. + orgmembershiphistory.DefaultID = orgmembershiphistoryDescID.Default.(func() string) + organizationMixin := schema.Organization{}.Mixin() + organization.Policy = privacy.NewPolicies(schema.Organization{}) + organization.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := organization.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + organizationMixinHooks0 := organizationMixin[0].Hooks() + organizationMixinHooks3 := organizationMixin[3].Hooks() + organizationHooks := schema.Organization{}.Hooks() + + organization.Hooks[1] = organizationMixinHooks0[0] + + organization.Hooks[2] = organizationMixinHooks3[0] + + organization.Hooks[3] = organizationHooks[0] + + organization.Hooks[4] = organizationHooks[1] + organizationMixinInters3 := organizationMixin[3].Interceptors() + organizationInters := schema.Organization{}.Interceptors() + organization.Interceptors[0] = organizationMixinInters3[0] + organization.Interceptors[1] = organizationInters[0] + organizationMixinFields0 := organizationMixin[0].Fields() + _ = organizationMixinFields0 + organizationMixinFields1 := organizationMixin[1].Fields() + _ = organizationMixinFields1 + organizationMixinFields2 := organizationMixin[2].Fields() + _ = organizationMixinFields2 + organizationFields := schema.Organization{}.Fields() + _ = organizationFields + // organizationDescCreatedAt is the schema descriptor for created_at field. + organizationDescCreatedAt := organizationMixinFields0[0].Descriptor() + // organization.DefaultCreatedAt holds the default value on creation for the created_at field. + organization.DefaultCreatedAt = organizationDescCreatedAt.Default.(func() time.Time) + // organizationDescUpdatedAt is the schema descriptor for updated_at field. + organizationDescUpdatedAt := organizationMixinFields0[1].Descriptor() + // organization.DefaultUpdatedAt holds the default value on creation for the updated_at field. + organization.DefaultUpdatedAt = organizationDescUpdatedAt.Default.(func() time.Time) + // organization.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + organization.UpdateDefaultUpdatedAt = organizationDescUpdatedAt.UpdateDefault.(func() time.Time) + // organizationDescMappingID is the schema descriptor for mapping_id field. + organizationDescMappingID := organizationMixinFields1[1].Descriptor() + // organization.DefaultMappingID holds the default value on creation for the mapping_id field. + organization.DefaultMappingID = organizationDescMappingID.Default.(func() string) + // organizationDescTags is the schema descriptor for tags field. + organizationDescTags := organizationMixinFields2[0].Descriptor() + // organization.DefaultTags holds the default value on creation for the tags field. + organization.DefaultTags = organizationDescTags.Default.([]string) + // organizationDescName is the schema descriptor for name field. + organizationDescName := organizationFields[0].Descriptor() + // organization.NameValidator is a validator for the "name" field. It is called by the builders before save. + organization.NameValidator = func() func(string) error { + validators := organizationDescName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(name string) error { + for _, fn := range fns { + if err := fn(name); err != nil { + return err + } + } + return nil + } + }() + // organizationDescDisplayName is the schema descriptor for display_name field. + organizationDescDisplayName := organizationFields[1].Descriptor() + // organization.DefaultDisplayName holds the default value on creation for the display_name field. + organization.DefaultDisplayName = organizationDescDisplayName.Default.(string) + // organization.DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + organization.DisplayNameValidator = organizationDescDisplayName.Validators[0].(func(string) error) + // organizationDescPersonalOrg is the schema descriptor for personal_org field. + organizationDescPersonalOrg := organizationFields[4].Descriptor() + // organization.DefaultPersonalOrg holds the default value on creation for the personal_org field. + organization.DefaultPersonalOrg = organizationDescPersonalOrg.Default.(bool) + // organizationDescAvatarRemoteURL is the schema descriptor for avatar_remote_url field. + organizationDescAvatarRemoteURL := organizationFields[5].Descriptor() + // organization.AvatarRemoteURLValidator is a validator for the "avatar_remote_url" field. It is called by the builders before save. + organization.AvatarRemoteURLValidator = func() func(string) error { + validators := organizationDescAvatarRemoteURL.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(avatar_remote_url string) error { + for _, fn := range fns { + if err := fn(avatar_remote_url); err != nil { + return err + } + } + return nil + } + }() + // organizationDescDedicatedDb is the schema descriptor for dedicated_db field. + organizationDescDedicatedDb := organizationFields[6].Descriptor() + // organization.DefaultDedicatedDb holds the default value on creation for the dedicated_db field. + organization.DefaultDedicatedDb = organizationDescDedicatedDb.Default.(bool) + // organizationDescID is the schema descriptor for id field. + organizationDescID := organizationMixinFields1[0].Descriptor() + // organization.DefaultID holds the default value on creation for the id field. + organization.DefaultID = organizationDescID.Default.(func() string) + organizationhistory.Policy = privacy.NewPolicies(schema.OrganizationHistory{}) + organizationhistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := organizationhistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + organizationhistoryInters := schema.OrganizationHistory{}.Interceptors() + organizationhistory.Interceptors[0] = organizationhistoryInters[0] + organizationhistoryFields := schema.OrganizationHistory{}.Fields() + _ = organizationhistoryFields + // organizationhistoryDescHistoryTime is the schema descriptor for history_time field. + organizationhistoryDescHistoryTime := organizationhistoryFields[0].Descriptor() + // organizationhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + organizationhistory.DefaultHistoryTime = organizationhistoryDescHistoryTime.Default.(func() time.Time) + // organizationhistoryDescCreatedAt is the schema descriptor for created_at field. + organizationhistoryDescCreatedAt := organizationhistoryFields[3].Descriptor() + // organizationhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + organizationhistory.DefaultCreatedAt = organizationhistoryDescCreatedAt.Default.(func() time.Time) + // organizationhistoryDescUpdatedAt is the schema descriptor for updated_at field. + organizationhistoryDescUpdatedAt := organizationhistoryFields[4].Descriptor() + // organizationhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + organizationhistory.DefaultUpdatedAt = organizationhistoryDescUpdatedAt.Default.(func() time.Time) + // organizationhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + organizationhistory.UpdateDefaultUpdatedAt = organizationhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // organizationhistoryDescMappingID is the schema descriptor for mapping_id field. + organizationhistoryDescMappingID := organizationhistoryFields[8].Descriptor() + // organizationhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + organizationhistory.DefaultMappingID = organizationhistoryDescMappingID.Default.(func() string) + // organizationhistoryDescTags is the schema descriptor for tags field. + organizationhistoryDescTags := organizationhistoryFields[9].Descriptor() + // organizationhistory.DefaultTags holds the default value on creation for the tags field. + organizationhistory.DefaultTags = organizationhistoryDescTags.Default.([]string) + // organizationhistoryDescDisplayName is the schema descriptor for display_name field. + organizationhistoryDescDisplayName := organizationhistoryFields[13].Descriptor() + // organizationhistory.DefaultDisplayName holds the default value on creation for the display_name field. + organizationhistory.DefaultDisplayName = organizationhistoryDescDisplayName.Default.(string) + // organizationhistoryDescPersonalOrg is the schema descriptor for personal_org field. + organizationhistoryDescPersonalOrg := organizationhistoryFields[16].Descriptor() + // organizationhistory.DefaultPersonalOrg holds the default value on creation for the personal_org field. + organizationhistory.DefaultPersonalOrg = organizationhistoryDescPersonalOrg.Default.(bool) + // organizationhistoryDescDedicatedDb is the schema descriptor for dedicated_db field. + organizationhistoryDescDedicatedDb := organizationhistoryFields[18].Descriptor() + // organizationhistory.DefaultDedicatedDb holds the default value on creation for the dedicated_db field. + organizationhistory.DefaultDedicatedDb = organizationhistoryDescDedicatedDb.Default.(bool) + // organizationhistoryDescID is the schema descriptor for id field. + organizationhistoryDescID := organizationhistoryFields[7].Descriptor() + // organizationhistory.DefaultID holds the default value on creation for the id field. + organizationhistory.DefaultID = organizationhistoryDescID.Default.(func() string) + organizationsettingMixin := schema.OrganizationSetting{}.Mixin() + organizationsetting.Policy = privacy.NewPolicies(schema.OrganizationSetting{}) + organizationsetting.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := organizationsetting.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + organizationsettingMixinHooks0 := organizationsettingMixin[0].Hooks() + organizationsettingMixinHooks3 := organizationsettingMixin[3].Hooks() + + organizationsetting.Hooks[1] = organizationsettingMixinHooks0[0] + + organizationsetting.Hooks[2] = organizationsettingMixinHooks3[0] + organizationsettingMixinInters3 := organizationsettingMixin[3].Interceptors() + organizationsettingInters := schema.OrganizationSetting{}.Interceptors() + organizationsetting.Interceptors[0] = organizationsettingMixinInters3[0] + organizationsetting.Interceptors[1] = organizationsettingInters[0] + organizationsettingMixinFields0 := organizationsettingMixin[0].Fields() + _ = organizationsettingMixinFields0 + organizationsettingMixinFields1 := organizationsettingMixin[1].Fields() + _ = organizationsettingMixinFields1 + organizationsettingMixinFields2 := organizationsettingMixin[2].Fields() + _ = organizationsettingMixinFields2 + organizationsettingFields := schema.OrganizationSetting{}.Fields() + _ = organizationsettingFields + // organizationsettingDescCreatedAt is the schema descriptor for created_at field. + organizationsettingDescCreatedAt := organizationsettingMixinFields0[0].Descriptor() + // organizationsetting.DefaultCreatedAt holds the default value on creation for the created_at field. + organizationsetting.DefaultCreatedAt = organizationsettingDescCreatedAt.Default.(func() time.Time) + // organizationsettingDescUpdatedAt is the schema descriptor for updated_at field. + organizationsettingDescUpdatedAt := organizationsettingMixinFields0[1].Descriptor() + // organizationsetting.DefaultUpdatedAt holds the default value on creation for the updated_at field. + organizationsetting.DefaultUpdatedAt = organizationsettingDescUpdatedAt.Default.(func() time.Time) + // organizationsetting.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + organizationsetting.UpdateDefaultUpdatedAt = organizationsettingDescUpdatedAt.UpdateDefault.(func() time.Time) + // organizationsettingDescMappingID is the schema descriptor for mapping_id field. + organizationsettingDescMappingID := organizationsettingMixinFields1[1].Descriptor() + // organizationsetting.DefaultMappingID holds the default value on creation for the mapping_id field. + organizationsetting.DefaultMappingID = organizationsettingDescMappingID.Default.(func() string) + // organizationsettingDescTags is the schema descriptor for tags field. + organizationsettingDescTags := organizationsettingMixinFields2[0].Descriptor() + // organizationsetting.DefaultTags holds the default value on creation for the tags field. + organizationsetting.DefaultTags = organizationsettingDescTags.Default.([]string) + // organizationsettingDescDomains is the schema descriptor for domains field. + organizationsettingDescDomains := organizationsettingFields[0].Descriptor() + // organizationsetting.DomainsValidator is a validator for the "domains" field. It is called by the builders before save. + organizationsetting.DomainsValidator = organizationsettingDescDomains.Validators[0].(func([]string) error) + // organizationsettingDescBillingEmail is the schema descriptor for billing_email field. + organizationsettingDescBillingEmail := organizationsettingFields[2].Descriptor() + // organizationsetting.BillingEmailValidator is a validator for the "billing_email" field. It is called by the builders before save. + organizationsetting.BillingEmailValidator = organizationsettingDescBillingEmail.Validators[0].(func(string) error) + // organizationsettingDescBillingPhone is the schema descriptor for billing_phone field. + organizationsettingDescBillingPhone := organizationsettingFields[3].Descriptor() + // organizationsetting.BillingPhoneValidator is a validator for the "billing_phone" field. It is called by the builders before save. + organizationsetting.BillingPhoneValidator = organizationsettingDescBillingPhone.Validators[0].(func(string) error) + // organizationsettingDescID is the schema descriptor for id field. + organizationsettingDescID := organizationsettingMixinFields1[0].Descriptor() + // organizationsetting.DefaultID holds the default value on creation for the id field. + organizationsetting.DefaultID = organizationsettingDescID.Default.(func() string) + organizationsettinghistory.Policy = privacy.NewPolicies(schema.OrganizationSettingHistory{}) + organizationsettinghistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := organizationsettinghistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + organizationsettinghistoryInters := schema.OrganizationSettingHistory{}.Interceptors() + organizationsettinghistory.Interceptors[0] = organizationsettinghistoryInters[0] + organizationsettinghistoryFields := schema.OrganizationSettingHistory{}.Fields() + _ = organizationsettinghistoryFields + // organizationsettinghistoryDescHistoryTime is the schema descriptor for history_time field. + organizationsettinghistoryDescHistoryTime := organizationsettinghistoryFields[0].Descriptor() + // organizationsettinghistory.DefaultHistoryTime holds the default value on creation for the history_time field. + organizationsettinghistory.DefaultHistoryTime = organizationsettinghistoryDescHistoryTime.Default.(func() time.Time) + // organizationsettinghistoryDescCreatedAt is the schema descriptor for created_at field. + organizationsettinghistoryDescCreatedAt := organizationsettinghistoryFields[3].Descriptor() + // organizationsettinghistory.DefaultCreatedAt holds the default value on creation for the created_at field. + organizationsettinghistory.DefaultCreatedAt = organizationsettinghistoryDescCreatedAt.Default.(func() time.Time) + // organizationsettinghistoryDescUpdatedAt is the schema descriptor for updated_at field. + organizationsettinghistoryDescUpdatedAt := organizationsettinghistoryFields[4].Descriptor() + // organizationsettinghistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + organizationsettinghistory.DefaultUpdatedAt = organizationsettinghistoryDescUpdatedAt.Default.(func() time.Time) + // organizationsettinghistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + organizationsettinghistory.UpdateDefaultUpdatedAt = organizationsettinghistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // organizationsettinghistoryDescMappingID is the schema descriptor for mapping_id field. + organizationsettinghistoryDescMappingID := organizationsettinghistoryFields[8].Descriptor() + // organizationsettinghistory.DefaultMappingID holds the default value on creation for the mapping_id field. + organizationsettinghistory.DefaultMappingID = organizationsettinghistoryDescMappingID.Default.(func() string) + // organizationsettinghistoryDescTags is the schema descriptor for tags field. + organizationsettinghistoryDescTags := organizationsettinghistoryFields[9].Descriptor() + // organizationsettinghistory.DefaultTags holds the default value on creation for the tags field. + organizationsettinghistory.DefaultTags = organizationsettinghistoryDescTags.Default.([]string) + // organizationsettinghistoryDescID is the schema descriptor for id field. + organizationsettinghistoryDescID := organizationsettinghistoryFields[7].Descriptor() + // organizationsettinghistory.DefaultID holds the default value on creation for the id field. + organizationsettinghistory.DefaultID = organizationsettinghistoryDescID.Default.(func() string) + passwordresettokenMixin := schema.PasswordResetToken{}.Mixin() + passwordresettoken.Policy = privacy.NewPolicies(schema.PasswordResetToken{}) + passwordresettoken.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := passwordresettoken.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + passwordresettokenMixinHooks0 := passwordresettokenMixin[0].Hooks() + passwordresettokenMixinHooks2 := passwordresettokenMixin[2].Hooks() + passwordresettokenMixinHooks3 := passwordresettokenMixin[3].Hooks() + passwordresettokenHooks := schema.PasswordResetToken{}.Hooks() + + passwordresettoken.Hooks[1] = passwordresettokenMixinHooks0[0] + + passwordresettoken.Hooks[2] = passwordresettokenMixinHooks2[0] + + passwordresettoken.Hooks[3] = passwordresettokenMixinHooks3[0] + + passwordresettoken.Hooks[4] = passwordresettokenHooks[0] + passwordresettokenMixinInters2 := passwordresettokenMixin[2].Interceptors() + passwordresettokenMixinInters3 := passwordresettokenMixin[3].Interceptors() + passwordresettoken.Interceptors[0] = passwordresettokenMixinInters2[0] + passwordresettoken.Interceptors[1] = passwordresettokenMixinInters3[0] + passwordresettokenMixinFields0 := passwordresettokenMixin[0].Fields() + _ = passwordresettokenMixinFields0 + passwordresettokenMixinFields1 := passwordresettokenMixin[1].Fields() + _ = passwordresettokenMixinFields1 + passwordresettokenFields := schema.PasswordResetToken{}.Fields() + _ = passwordresettokenFields + // passwordresettokenDescCreatedAt is the schema descriptor for created_at field. + passwordresettokenDescCreatedAt := passwordresettokenMixinFields0[0].Descriptor() + // passwordresettoken.DefaultCreatedAt holds the default value on creation for the created_at field. + passwordresettoken.DefaultCreatedAt = passwordresettokenDescCreatedAt.Default.(func() time.Time) + // passwordresettokenDescUpdatedAt is the schema descriptor for updated_at field. + passwordresettokenDescUpdatedAt := passwordresettokenMixinFields0[1].Descriptor() + // passwordresettoken.DefaultUpdatedAt holds the default value on creation for the updated_at field. + passwordresettoken.DefaultUpdatedAt = passwordresettokenDescUpdatedAt.Default.(func() time.Time) + // passwordresettoken.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + passwordresettoken.UpdateDefaultUpdatedAt = passwordresettokenDescUpdatedAt.UpdateDefault.(func() time.Time) + // passwordresettokenDescMappingID is the schema descriptor for mapping_id field. + passwordresettokenDescMappingID := passwordresettokenMixinFields1[1].Descriptor() + // passwordresettoken.DefaultMappingID holds the default value on creation for the mapping_id field. + passwordresettoken.DefaultMappingID = passwordresettokenDescMappingID.Default.(func() string) + // passwordresettokenDescToken is the schema descriptor for token field. + passwordresettokenDescToken := passwordresettokenFields[0].Descriptor() + // passwordresettoken.TokenValidator is a validator for the "token" field. It is called by the builders before save. + passwordresettoken.TokenValidator = passwordresettokenDescToken.Validators[0].(func(string) error) + // passwordresettokenDescEmail is the schema descriptor for email field. + passwordresettokenDescEmail := passwordresettokenFields[2].Descriptor() + // passwordresettoken.EmailValidator is a validator for the "email" field. It is called by the builders before save. + passwordresettoken.EmailValidator = func() func(string) error { + validators := passwordresettokenDescEmail.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(email string) error { + for _, fn := range fns { + if err := fn(email); err != nil { + return err + } + } + return nil + } + }() + // passwordresettokenDescSecret is the schema descriptor for secret field. + passwordresettokenDescSecret := passwordresettokenFields[3].Descriptor() + // passwordresettoken.SecretValidator is a validator for the "secret" field. It is called by the builders before save. + passwordresettoken.SecretValidator = passwordresettokenDescSecret.Validators[0].(func([]byte) error) + // passwordresettokenDescID is the schema descriptor for id field. + passwordresettokenDescID := passwordresettokenMixinFields1[0].Descriptor() + // passwordresettoken.DefaultID holds the default value on creation for the id field. + passwordresettoken.DefaultID = passwordresettokenDescID.Default.(func() string) + personalaccesstokenMixin := schema.PersonalAccessToken{}.Mixin() + personalaccesstoken.Policy = privacy.NewPolicies(schema.PersonalAccessToken{}) + personalaccesstoken.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := personalaccesstoken.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + personalaccesstokenMixinHooks0 := personalaccesstokenMixin[0].Hooks() + personalaccesstokenMixinHooks1 := personalaccesstokenMixin[1].Hooks() + personalaccesstokenMixinHooks4 := personalaccesstokenMixin[4].Hooks() + personalaccesstokenHooks := schema.PersonalAccessToken{}.Hooks() + + personalaccesstoken.Hooks[1] = personalaccesstokenMixinHooks0[0] + + personalaccesstoken.Hooks[2] = personalaccesstokenMixinHooks1[0] + + personalaccesstoken.Hooks[3] = personalaccesstokenMixinHooks4[0] + + personalaccesstoken.Hooks[4] = personalaccesstokenHooks[0] + + personalaccesstoken.Hooks[5] = personalaccesstokenHooks[1] + personalaccesstokenMixinInters1 := personalaccesstokenMixin[1].Interceptors() + personalaccesstokenMixinInters4 := personalaccesstokenMixin[4].Interceptors() + personalaccesstokenInters := schema.PersonalAccessToken{}.Interceptors() + personalaccesstoken.Interceptors[0] = personalaccesstokenMixinInters1[0] + personalaccesstoken.Interceptors[1] = personalaccesstokenMixinInters4[0] + personalaccesstoken.Interceptors[2] = personalaccesstokenInters[0] + personalaccesstokenMixinFields0 := personalaccesstokenMixin[0].Fields() + _ = personalaccesstokenMixinFields0 + personalaccesstokenMixinFields2 := personalaccesstokenMixin[2].Fields() + _ = personalaccesstokenMixinFields2 + personalaccesstokenMixinFields3 := personalaccesstokenMixin[3].Fields() + _ = personalaccesstokenMixinFields3 + personalaccesstokenFields := schema.PersonalAccessToken{}.Fields() + _ = personalaccesstokenFields + // personalaccesstokenDescCreatedAt is the schema descriptor for created_at field. + personalaccesstokenDescCreatedAt := personalaccesstokenMixinFields0[0].Descriptor() + // personalaccesstoken.DefaultCreatedAt holds the default value on creation for the created_at field. + personalaccesstoken.DefaultCreatedAt = personalaccesstokenDescCreatedAt.Default.(func() time.Time) + // personalaccesstokenDescUpdatedAt is the schema descriptor for updated_at field. + personalaccesstokenDescUpdatedAt := personalaccesstokenMixinFields0[1].Descriptor() + // personalaccesstoken.DefaultUpdatedAt holds the default value on creation for the updated_at field. + personalaccesstoken.DefaultUpdatedAt = personalaccesstokenDescUpdatedAt.Default.(func() time.Time) + // personalaccesstoken.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + personalaccesstoken.UpdateDefaultUpdatedAt = personalaccesstokenDescUpdatedAt.UpdateDefault.(func() time.Time) + // personalaccesstokenDescMappingID is the schema descriptor for mapping_id field. + personalaccesstokenDescMappingID := personalaccesstokenMixinFields2[1].Descriptor() + // personalaccesstoken.DefaultMappingID holds the default value on creation for the mapping_id field. + personalaccesstoken.DefaultMappingID = personalaccesstokenDescMappingID.Default.(func() string) + // personalaccesstokenDescTags is the schema descriptor for tags field. + personalaccesstokenDescTags := personalaccesstokenMixinFields3[0].Descriptor() + // personalaccesstoken.DefaultTags holds the default value on creation for the tags field. + personalaccesstoken.DefaultTags = personalaccesstokenDescTags.Default.([]string) + // personalaccesstokenDescName is the schema descriptor for name field. + personalaccesstokenDescName := personalaccesstokenFields[0].Descriptor() + // personalaccesstoken.NameValidator is a validator for the "name" field. It is called by the builders before save. + personalaccesstoken.NameValidator = personalaccesstokenDescName.Validators[0].(func(string) error) + // personalaccesstokenDescToken is the schema descriptor for token field. + personalaccesstokenDescToken := personalaccesstokenFields[1].Descriptor() + // personalaccesstoken.DefaultToken holds the default value on creation for the token field. + personalaccesstoken.DefaultToken = personalaccesstokenDescToken.Default.(func() string) + // personalaccesstokenDescID is the schema descriptor for id field. + personalaccesstokenDescID := personalaccesstokenMixinFields2[0].Descriptor() + // personalaccesstoken.DefaultID holds the default value on creation for the id field. + personalaccesstoken.DefaultID = personalaccesstokenDescID.Default.(func() string) + subscriberMixin := schema.Subscriber{}.Mixin() + subscriber.Policy = privacy.NewPolicies(schema.Subscriber{}) + subscriber.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := subscriber.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + subscriberMixinHooks0 := subscriberMixin[0].Hooks() + subscriberMixinHooks3 := subscriberMixin[3].Hooks() + subscriberMixinHooks4 := subscriberMixin[4].Hooks() + subscriberHooks := schema.Subscriber{}.Hooks() + + subscriber.Hooks[1] = subscriberMixinHooks0[0] + + subscriber.Hooks[2] = subscriberMixinHooks3[0] + + subscriber.Hooks[3] = subscriberMixinHooks4[0] + + subscriber.Hooks[4] = subscriberHooks[0] + subscriberMixinInters3 := subscriberMixin[3].Interceptors() + subscriberMixinInters4 := subscriberMixin[4].Interceptors() + subscriber.Interceptors[0] = subscriberMixinInters3[0] + subscriber.Interceptors[1] = subscriberMixinInters4[0] + subscriberMixinFields0 := subscriberMixin[0].Fields() + _ = subscriberMixinFields0 + subscriberMixinFields1 := subscriberMixin[1].Fields() + _ = subscriberMixinFields1 + subscriberMixinFields2 := subscriberMixin[2].Fields() + _ = subscriberMixinFields2 + subscriberMixinFields4 := subscriberMixin[4].Fields() + _ = subscriberMixinFields4 + subscriberFields := schema.Subscriber{}.Fields() + _ = subscriberFields + // subscriberDescCreatedAt is the schema descriptor for created_at field. + subscriberDescCreatedAt := subscriberMixinFields0[0].Descriptor() + // subscriber.DefaultCreatedAt holds the default value on creation for the created_at field. + subscriber.DefaultCreatedAt = subscriberDescCreatedAt.Default.(func() time.Time) + // subscriberDescUpdatedAt is the schema descriptor for updated_at field. + subscriberDescUpdatedAt := subscriberMixinFields0[1].Descriptor() + // subscriber.DefaultUpdatedAt holds the default value on creation for the updated_at field. + subscriber.DefaultUpdatedAt = subscriberDescUpdatedAt.Default.(func() time.Time) + // subscriber.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + subscriber.UpdateDefaultUpdatedAt = subscriberDescUpdatedAt.UpdateDefault.(func() time.Time) + // subscriberDescMappingID is the schema descriptor for mapping_id field. + subscriberDescMappingID := subscriberMixinFields1[1].Descriptor() + // subscriber.DefaultMappingID holds the default value on creation for the mapping_id field. + subscriber.DefaultMappingID = subscriberDescMappingID.Default.(func() string) + // subscriberDescTags is the schema descriptor for tags field. + subscriberDescTags := subscriberMixinFields2[0].Descriptor() + // subscriber.DefaultTags holds the default value on creation for the tags field. + subscriber.DefaultTags = subscriberDescTags.Default.([]string) + // subscriberDescOwnerID is the schema descriptor for owner_id field. + subscriberDescOwnerID := subscriberMixinFields4[0].Descriptor() + // subscriber.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + subscriber.OwnerIDValidator = subscriberDescOwnerID.Validators[0].(func(string) error) + // subscriberDescEmail is the schema descriptor for email field. + subscriberDescEmail := subscriberFields[0].Descriptor() + // subscriber.EmailValidator is a validator for the "email" field. It is called by the builders before save. + subscriber.EmailValidator = subscriberDescEmail.Validators[0].(func(string) error) + // subscriberDescPhoneNumber is the schema descriptor for phone_number field. + subscriberDescPhoneNumber := subscriberFields[1].Descriptor() + // subscriber.PhoneNumberValidator is a validator for the "phone_number" field. It is called by the builders before save. + subscriber.PhoneNumberValidator = subscriberDescPhoneNumber.Validators[0].(func(string) error) + // subscriberDescVerifiedEmail is the schema descriptor for verified_email field. + subscriberDescVerifiedEmail := subscriberFields[2].Descriptor() + // subscriber.DefaultVerifiedEmail holds the default value on creation for the verified_email field. + subscriber.DefaultVerifiedEmail = subscriberDescVerifiedEmail.Default.(bool) + // subscriberDescVerifiedPhone is the schema descriptor for verified_phone field. + subscriberDescVerifiedPhone := subscriberFields[3].Descriptor() + // subscriber.DefaultVerifiedPhone holds the default value on creation for the verified_phone field. + subscriber.DefaultVerifiedPhone = subscriberDescVerifiedPhone.Default.(bool) + // subscriberDescActive is the schema descriptor for active field. + subscriberDescActive := subscriberFields[4].Descriptor() + // subscriber.DefaultActive holds the default value on creation for the active field. + subscriber.DefaultActive = subscriberDescActive.Default.(bool) + // subscriberDescToken is the schema descriptor for token field. + subscriberDescToken := subscriberFields[5].Descriptor() + // subscriber.TokenValidator is a validator for the "token" field. It is called by the builders before save. + subscriber.TokenValidator = subscriberDescToken.Validators[0].(func(string) error) + // subscriberDescSecret is the schema descriptor for secret field. + subscriberDescSecret := subscriberFields[7].Descriptor() + // subscriber.SecretValidator is a validator for the "secret" field. It is called by the builders before save. + subscriber.SecretValidator = subscriberDescSecret.Validators[0].(func([]byte) error) + // subscriberDescID is the schema descriptor for id field. + subscriberDescID := subscriberMixinFields1[0].Descriptor() + // subscriber.DefaultID holds the default value on creation for the id field. + subscriber.DefaultID = subscriberDescID.Default.(func() string) + tfasettingMixin := schema.TFASetting{}.Mixin() + tfasettingMixinHooks0 := tfasettingMixin[0].Hooks() + tfasettingMixinHooks2 := tfasettingMixin[2].Hooks() + tfasettingMixinHooks4 := tfasettingMixin[4].Hooks() + tfasettingHooks := schema.TFASetting{}.Hooks() + tfasetting.Hooks[0] = tfasettingMixinHooks0[0] + tfasetting.Hooks[1] = tfasettingMixinHooks2[0] + tfasetting.Hooks[2] = tfasettingMixinHooks4[0] + tfasetting.Hooks[3] = tfasettingHooks[0] + tfasettingMixinInters2 := tfasettingMixin[2].Interceptors() + tfasetting.Interceptors[0] = tfasettingMixinInters2[0] + tfasettingMixinFields0 := tfasettingMixin[0].Fields() + _ = tfasettingMixinFields0 + tfasettingMixinFields1 := tfasettingMixin[1].Fields() + _ = tfasettingMixinFields1 + tfasettingMixinFields3 := tfasettingMixin[3].Fields() + _ = tfasettingMixinFields3 + tfasettingFields := schema.TFASetting{}.Fields() + _ = tfasettingFields + // tfasettingDescCreatedAt is the schema descriptor for created_at field. + tfasettingDescCreatedAt := tfasettingMixinFields0[0].Descriptor() + // tfasetting.DefaultCreatedAt holds the default value on creation for the created_at field. + tfasetting.DefaultCreatedAt = tfasettingDescCreatedAt.Default.(func() time.Time) + // tfasettingDescUpdatedAt is the schema descriptor for updated_at field. + tfasettingDescUpdatedAt := tfasettingMixinFields0[1].Descriptor() + // tfasetting.DefaultUpdatedAt holds the default value on creation for the updated_at field. + tfasetting.DefaultUpdatedAt = tfasettingDescUpdatedAt.Default.(func() time.Time) + // tfasetting.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + tfasetting.UpdateDefaultUpdatedAt = tfasettingDescUpdatedAt.UpdateDefault.(func() time.Time) + // tfasettingDescMappingID is the schema descriptor for mapping_id field. + tfasettingDescMappingID := tfasettingMixinFields1[1].Descriptor() + // tfasetting.DefaultMappingID holds the default value on creation for the mapping_id field. + tfasetting.DefaultMappingID = tfasettingDescMappingID.Default.(func() string) + // tfasettingDescTags is the schema descriptor for tags field. + tfasettingDescTags := tfasettingMixinFields3[0].Descriptor() + // tfasetting.DefaultTags holds the default value on creation for the tags field. + tfasetting.DefaultTags = tfasettingDescTags.Default.([]string) + // tfasettingDescVerified is the schema descriptor for verified field. + tfasettingDescVerified := tfasettingFields[1].Descriptor() + // tfasetting.DefaultVerified holds the default value on creation for the verified field. + tfasetting.DefaultVerified = tfasettingDescVerified.Default.(bool) + // tfasettingDescPhoneOtpAllowed is the schema descriptor for phone_otp_allowed field. + tfasettingDescPhoneOtpAllowed := tfasettingFields[3].Descriptor() + // tfasetting.DefaultPhoneOtpAllowed holds the default value on creation for the phone_otp_allowed field. + tfasetting.DefaultPhoneOtpAllowed = tfasettingDescPhoneOtpAllowed.Default.(bool) + // tfasettingDescEmailOtpAllowed is the schema descriptor for email_otp_allowed field. + tfasettingDescEmailOtpAllowed := tfasettingFields[4].Descriptor() + // tfasetting.DefaultEmailOtpAllowed holds the default value on creation for the email_otp_allowed field. + tfasetting.DefaultEmailOtpAllowed = tfasettingDescEmailOtpAllowed.Default.(bool) + // tfasettingDescTotpAllowed is the schema descriptor for totp_allowed field. + tfasettingDescTotpAllowed := tfasettingFields[5].Descriptor() + // tfasetting.DefaultTotpAllowed holds the default value on creation for the totp_allowed field. + tfasetting.DefaultTotpAllowed = tfasettingDescTotpAllowed.Default.(bool) + // tfasettingDescID is the schema descriptor for id field. + tfasettingDescID := tfasettingMixinFields1[0].Descriptor() + // tfasetting.DefaultID holds the default value on creation for the id field. + tfasetting.DefaultID = tfasettingDescID.Default.(func() string) + templateMixin := schema.Template{}.Mixin() + template.Policy = privacy.NewPolicies(schema.Template{}) + template.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := template.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + templateMixinHooks0 := templateMixin[0].Hooks() + templateMixinHooks1 := templateMixin[1].Hooks() + templateMixinHooks4 := templateMixin[4].Hooks() + + template.Hooks[1] = templateMixinHooks0[0] + + template.Hooks[2] = templateMixinHooks1[0] + + template.Hooks[3] = templateMixinHooks4[0] + templateMixinInters1 := templateMixin[1].Interceptors() + templateMixinInters4 := templateMixin[4].Interceptors() + template.Interceptors[0] = templateMixinInters1[0] + template.Interceptors[1] = templateMixinInters4[0] + templateMixinFields0 := templateMixin[0].Fields() + _ = templateMixinFields0 + templateMixinFields2 := templateMixin[2].Fields() + _ = templateMixinFields2 + templateMixinFields3 := templateMixin[3].Fields() + _ = templateMixinFields3 + templateMixinFields4 := templateMixin[4].Fields() + _ = templateMixinFields4 + templateFields := schema.Template{}.Fields() + _ = templateFields + // templateDescCreatedAt is the schema descriptor for created_at field. + templateDescCreatedAt := templateMixinFields0[0].Descriptor() + // template.DefaultCreatedAt holds the default value on creation for the created_at field. + template.DefaultCreatedAt = templateDescCreatedAt.Default.(func() time.Time) + // templateDescUpdatedAt is the schema descriptor for updated_at field. + templateDescUpdatedAt := templateMixinFields0[1].Descriptor() + // template.DefaultUpdatedAt holds the default value on creation for the updated_at field. + template.DefaultUpdatedAt = templateDescUpdatedAt.Default.(func() time.Time) + // template.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + template.UpdateDefaultUpdatedAt = templateDescUpdatedAt.UpdateDefault.(func() time.Time) + // templateDescMappingID is the schema descriptor for mapping_id field. + templateDescMappingID := templateMixinFields2[1].Descriptor() + // template.DefaultMappingID holds the default value on creation for the mapping_id field. + template.DefaultMappingID = templateDescMappingID.Default.(func() string) + // templateDescTags is the schema descriptor for tags field. + templateDescTags := templateMixinFields3[0].Descriptor() + // template.DefaultTags holds the default value on creation for the tags field. + template.DefaultTags = templateDescTags.Default.([]string) + // templateDescOwnerID is the schema descriptor for owner_id field. + templateDescOwnerID := templateMixinFields4[0].Descriptor() + // template.OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + template.OwnerIDValidator = templateDescOwnerID.Validators[0].(func(string) error) + // templateDescName is the schema descriptor for name field. + templateDescName := templateFields[0].Descriptor() + // template.NameValidator is a validator for the "name" field. It is called by the builders before save. + template.NameValidator = templateDescName.Validators[0].(func(string) error) + // templateDescID is the schema descriptor for id field. + templateDescID := templateMixinFields2[0].Descriptor() + // template.DefaultID holds the default value on creation for the id field. + template.DefaultID = templateDescID.Default.(func() string) + templatehistory.Policy = privacy.NewPolicies(schema.TemplateHistory{}) + templatehistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := templatehistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + templatehistoryInters := schema.TemplateHistory{}.Interceptors() + templatehistory.Interceptors[0] = templatehistoryInters[0] + templatehistoryFields := schema.TemplateHistory{}.Fields() + _ = templatehistoryFields + // templatehistoryDescHistoryTime is the schema descriptor for history_time field. + templatehistoryDescHistoryTime := templatehistoryFields[0].Descriptor() + // templatehistory.DefaultHistoryTime holds the default value on creation for the history_time field. + templatehistory.DefaultHistoryTime = templatehistoryDescHistoryTime.Default.(func() time.Time) + // templatehistoryDescCreatedAt is the schema descriptor for created_at field. + templatehistoryDescCreatedAt := templatehistoryFields[3].Descriptor() + // templatehistory.DefaultCreatedAt holds the default value on creation for the created_at field. + templatehistory.DefaultCreatedAt = templatehistoryDescCreatedAt.Default.(func() time.Time) + // templatehistoryDescUpdatedAt is the schema descriptor for updated_at field. + templatehistoryDescUpdatedAt := templatehistoryFields[4].Descriptor() + // templatehistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + templatehistory.DefaultUpdatedAt = templatehistoryDescUpdatedAt.Default.(func() time.Time) + // templatehistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + templatehistory.UpdateDefaultUpdatedAt = templatehistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // templatehistoryDescMappingID is the schema descriptor for mapping_id field. + templatehistoryDescMappingID := templatehistoryFields[10].Descriptor() + // templatehistory.DefaultMappingID holds the default value on creation for the mapping_id field. + templatehistory.DefaultMappingID = templatehistoryDescMappingID.Default.(func() string) + // templatehistoryDescTags is the schema descriptor for tags field. + templatehistoryDescTags := templatehistoryFields[11].Descriptor() + // templatehistory.DefaultTags holds the default value on creation for the tags field. + templatehistory.DefaultTags = templatehistoryDescTags.Default.([]string) + // templatehistoryDescID is the schema descriptor for id field. + templatehistoryDescID := templatehistoryFields[9].Descriptor() + // templatehistory.DefaultID holds the default value on creation for the id field. + templatehistory.DefaultID = templatehistoryDescID.Default.(func() string) + userMixin := schema.User{}.Mixin() + user.Policy = privacy.NewPolicies(schema.User{}) + user.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := user.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + userMixinHooks0 := userMixin[0].Hooks() + userMixinHooks1 := userMixin[1].Hooks() + userHooks := schema.User{}.Hooks() + + user.Hooks[1] = userMixinHooks0[0] + + user.Hooks[2] = userMixinHooks1[0] + + user.Hooks[3] = userHooks[0] + + user.Hooks[4] = userHooks[1] + userMixinInters1 := userMixin[1].Interceptors() + userInters := schema.User{}.Interceptors() + user.Interceptors[0] = userMixinInters1[0] + user.Interceptors[1] = userInters[0] + userMixinFields0 := userMixin[0].Fields() + _ = userMixinFields0 + userMixinFields2 := userMixin[2].Fields() + _ = userMixinFields2 + userMixinFields3 := userMixin[3].Fields() + _ = userMixinFields3 + userFields := schema.User{}.Fields() + _ = userFields + // userDescCreatedAt is the schema descriptor for created_at field. + userDescCreatedAt := userMixinFields0[0].Descriptor() + // user.DefaultCreatedAt holds the default value on creation for the created_at field. + user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time) + // userDescUpdatedAt is the schema descriptor for updated_at field. + userDescUpdatedAt := userMixinFields0[1].Descriptor() + // user.DefaultUpdatedAt holds the default value on creation for the updated_at field. + user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time) + // user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time) + // userDescMappingID is the schema descriptor for mapping_id field. + userDescMappingID := userMixinFields2[1].Descriptor() + // user.DefaultMappingID holds the default value on creation for the mapping_id field. + user.DefaultMappingID = userDescMappingID.Default.(func() string) + // userDescTags is the schema descriptor for tags field. + userDescTags := userMixinFields3[0].Descriptor() + // user.DefaultTags holds the default value on creation for the tags field. + user.DefaultTags = userDescTags.Default.([]string) + // userDescEmail is the schema descriptor for email field. + userDescEmail := userFields[0].Descriptor() + // user.EmailValidator is a validator for the "email" field. It is called by the builders before save. + user.EmailValidator = userDescEmail.Validators[0].(func(string) error) + // userDescFirstName is the schema descriptor for first_name field. + userDescFirstName := userFields[1].Descriptor() + // user.FirstNameValidator is a validator for the "first_name" field. It is called by the builders before save. + user.FirstNameValidator = userDescFirstName.Validators[0].(func(string) error) + // userDescLastName is the schema descriptor for last_name field. + userDescLastName := userFields[2].Descriptor() + // user.LastNameValidator is a validator for the "last_name" field. It is called by the builders before save. + user.LastNameValidator = userDescLastName.Validators[0].(func(string) error) + // userDescDisplayName is the schema descriptor for display_name field. + userDescDisplayName := userFields[3].Descriptor() + // user.DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + user.DisplayNameValidator = func() func(string) error { + validators := userDescDisplayName.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + validators[2].(func(string) error), + } + return func(display_name string) error { + for _, fn := range fns { + if err := fn(display_name); err != nil { + return err + } + } + return nil + } + }() + // userDescAvatarRemoteURL is the schema descriptor for avatar_remote_url field. + userDescAvatarRemoteURL := userFields[4].Descriptor() + // user.AvatarRemoteURLValidator is a validator for the "avatar_remote_url" field. It is called by the builders before save. + user.AvatarRemoteURLValidator = func() func(string) error { + validators := userDescAvatarRemoteURL.Validators + fns := [...]func(string) error{ + validators[0].(func(string) error), + validators[1].(func(string) error), + } + return func(avatar_remote_url string) error { + for _, fn := range fns { + if err := fn(avatar_remote_url); err != nil { + return err + } + } + return nil + } + }() + // userDescAvatarLocalFile is the schema descriptor for avatar_local_file field. + userDescAvatarLocalFile := userFields[5].Descriptor() + // user.AvatarLocalFileValidator is a validator for the "avatar_local_file" field. It is called by the builders before save. + user.AvatarLocalFileValidator = userDescAvatarLocalFile.Validators[0].(func(string) error) + // userDescAvatarUpdatedAt is the schema descriptor for avatar_updated_at field. + userDescAvatarUpdatedAt := userFields[6].Descriptor() + // user.UpdateDefaultAvatarUpdatedAt holds the default value on update for the avatar_updated_at field. + user.UpdateDefaultAvatarUpdatedAt = userDescAvatarUpdatedAt.UpdateDefault.(func() time.Time) + // userDescLastSeen is the schema descriptor for last_seen field. + userDescLastSeen := userFields[7].Descriptor() + // user.UpdateDefaultLastSeen holds the default value on update for the last_seen field. + user.UpdateDefaultLastSeen = userDescLastSeen.UpdateDefault.(func() time.Time) + // userDescID is the schema descriptor for id field. + userDescID := userMixinFields2[0].Descriptor() + // user.DefaultID holds the default value on creation for the id field. + user.DefaultID = userDescID.Default.(func() string) + userhistoryInters := schema.UserHistory{}.Interceptors() + userhistory.Interceptors[0] = userhistoryInters[0] + userhistoryFields := schema.UserHistory{}.Fields() + _ = userhistoryFields + // userhistoryDescHistoryTime is the schema descriptor for history_time field. + userhistoryDescHistoryTime := userhistoryFields[0].Descriptor() + // userhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + userhistory.DefaultHistoryTime = userhistoryDescHistoryTime.Default.(func() time.Time) + // userhistoryDescCreatedAt is the schema descriptor for created_at field. + userhistoryDescCreatedAt := userhistoryFields[3].Descriptor() + // userhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + userhistory.DefaultCreatedAt = userhistoryDescCreatedAt.Default.(func() time.Time) + // userhistoryDescUpdatedAt is the schema descriptor for updated_at field. + userhistoryDescUpdatedAt := userhistoryFields[4].Descriptor() + // userhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + userhistory.DefaultUpdatedAt = userhistoryDescUpdatedAt.Default.(func() time.Time) + // userhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + userhistory.UpdateDefaultUpdatedAt = userhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // userhistoryDescMappingID is the schema descriptor for mapping_id field. + userhistoryDescMappingID := userhistoryFields[10].Descriptor() + // userhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + userhistory.DefaultMappingID = userhistoryDescMappingID.Default.(func() string) + // userhistoryDescTags is the schema descriptor for tags field. + userhistoryDescTags := userhistoryFields[11].Descriptor() + // userhistory.DefaultTags holds the default value on creation for the tags field. + userhistory.DefaultTags = userhistoryDescTags.Default.([]string) + // userhistoryDescAvatarUpdatedAt is the schema descriptor for avatar_updated_at field. + userhistoryDescAvatarUpdatedAt := userhistoryFields[18].Descriptor() + // userhistory.UpdateDefaultAvatarUpdatedAt holds the default value on update for the avatar_updated_at field. + userhistory.UpdateDefaultAvatarUpdatedAt = userhistoryDescAvatarUpdatedAt.UpdateDefault.(func() time.Time) + // userhistoryDescLastSeen is the schema descriptor for last_seen field. + userhistoryDescLastSeen := userhistoryFields[19].Descriptor() + // userhistory.UpdateDefaultLastSeen holds the default value on update for the last_seen field. + userhistory.UpdateDefaultLastSeen = userhistoryDescLastSeen.UpdateDefault.(func() time.Time) + // userhistoryDescID is the schema descriptor for id field. + userhistoryDescID := userhistoryFields[9].Descriptor() + // userhistory.DefaultID holds the default value on creation for the id field. + userhistory.DefaultID = userhistoryDescID.Default.(func() string) + usersettingMixin := schema.UserSetting{}.Mixin() + usersetting.Policy = privacy.NewPolicies(schema.UserSetting{}) + usersetting.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := usersetting.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + usersettingMixinHooks0 := usersettingMixin[0].Hooks() + usersettingMixinHooks3 := usersettingMixin[3].Hooks() + usersettingHooks := schema.UserSetting{}.Hooks() + + usersetting.Hooks[1] = usersettingMixinHooks0[0] + + usersetting.Hooks[2] = usersettingMixinHooks3[0] + + usersetting.Hooks[3] = usersettingHooks[0] + usersettingMixinInters3 := usersettingMixin[3].Interceptors() + usersettingInters := schema.UserSetting{}.Interceptors() + usersetting.Interceptors[0] = usersettingMixinInters3[0] + usersetting.Interceptors[1] = usersettingInters[0] + usersettingMixinFields0 := usersettingMixin[0].Fields() + _ = usersettingMixinFields0 + usersettingMixinFields1 := usersettingMixin[1].Fields() + _ = usersettingMixinFields1 + usersettingMixinFields2 := usersettingMixin[2].Fields() + _ = usersettingMixinFields2 + usersettingFields := schema.UserSetting{}.Fields() + _ = usersettingFields + // usersettingDescCreatedAt is the schema descriptor for created_at field. + usersettingDescCreatedAt := usersettingMixinFields0[0].Descriptor() + // usersetting.DefaultCreatedAt holds the default value on creation for the created_at field. + usersetting.DefaultCreatedAt = usersettingDescCreatedAt.Default.(func() time.Time) + // usersettingDescUpdatedAt is the schema descriptor for updated_at field. + usersettingDescUpdatedAt := usersettingMixinFields0[1].Descriptor() + // usersetting.DefaultUpdatedAt holds the default value on creation for the updated_at field. + usersetting.DefaultUpdatedAt = usersettingDescUpdatedAt.Default.(func() time.Time) + // usersetting.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + usersetting.UpdateDefaultUpdatedAt = usersettingDescUpdatedAt.UpdateDefault.(func() time.Time) + // usersettingDescMappingID is the schema descriptor for mapping_id field. + usersettingDescMappingID := usersettingMixinFields1[1].Descriptor() + // usersetting.DefaultMappingID holds the default value on creation for the mapping_id field. + usersetting.DefaultMappingID = usersettingDescMappingID.Default.(func() string) + // usersettingDescTags is the schema descriptor for tags field. + usersettingDescTags := usersettingMixinFields2[0].Descriptor() + // usersetting.DefaultTags holds the default value on creation for the tags field. + usersetting.DefaultTags = usersettingDescTags.Default.([]string) + // usersettingDescLocked is the schema descriptor for locked field. + usersettingDescLocked := usersettingFields[1].Descriptor() + // usersetting.DefaultLocked holds the default value on creation for the locked field. + usersetting.DefaultLocked = usersettingDescLocked.Default.(bool) + // usersettingDescEmailConfirmed is the schema descriptor for email_confirmed field. + usersettingDescEmailConfirmed := usersettingFields[5].Descriptor() + // usersetting.DefaultEmailConfirmed holds the default value on creation for the email_confirmed field. + usersetting.DefaultEmailConfirmed = usersettingDescEmailConfirmed.Default.(bool) + // usersettingDescIsWebauthnAllowed is the schema descriptor for is_webauthn_allowed field. + usersettingDescIsWebauthnAllowed := usersettingFields[6].Descriptor() + // usersetting.DefaultIsWebauthnAllowed holds the default value on creation for the is_webauthn_allowed field. + usersetting.DefaultIsWebauthnAllowed = usersettingDescIsWebauthnAllowed.Default.(bool) + // usersettingDescIsTfaEnabled is the schema descriptor for is_tfa_enabled field. + usersettingDescIsTfaEnabled := usersettingFields[7].Descriptor() + // usersetting.DefaultIsTfaEnabled holds the default value on creation for the is_tfa_enabled field. + usersetting.DefaultIsTfaEnabled = usersettingDescIsTfaEnabled.Default.(bool) + // usersettingDescID is the schema descriptor for id field. + usersettingDescID := usersettingMixinFields1[0].Descriptor() + // usersetting.DefaultID holds the default value on creation for the id field. + usersetting.DefaultID = usersettingDescID.Default.(func() string) + usersettinghistoryInters := schema.UserSettingHistory{}.Interceptors() + usersettinghistory.Interceptors[0] = usersettinghistoryInters[0] + usersettinghistoryFields := schema.UserSettingHistory{}.Fields() + _ = usersettinghistoryFields + // usersettinghistoryDescHistoryTime is the schema descriptor for history_time field. + usersettinghistoryDescHistoryTime := usersettinghistoryFields[0].Descriptor() + // usersettinghistory.DefaultHistoryTime holds the default value on creation for the history_time field. + usersettinghistory.DefaultHistoryTime = usersettinghistoryDescHistoryTime.Default.(func() time.Time) + // usersettinghistoryDescCreatedAt is the schema descriptor for created_at field. + usersettinghistoryDescCreatedAt := usersettinghistoryFields[3].Descriptor() + // usersettinghistory.DefaultCreatedAt holds the default value on creation for the created_at field. + usersettinghistory.DefaultCreatedAt = usersettinghistoryDescCreatedAt.Default.(func() time.Time) + // usersettinghistoryDescUpdatedAt is the schema descriptor for updated_at field. + usersettinghistoryDescUpdatedAt := usersettinghistoryFields[4].Descriptor() + // usersettinghistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + usersettinghistory.DefaultUpdatedAt = usersettinghistoryDescUpdatedAt.Default.(func() time.Time) + // usersettinghistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + usersettinghistory.UpdateDefaultUpdatedAt = usersettinghistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // usersettinghistoryDescMappingID is the schema descriptor for mapping_id field. + usersettinghistoryDescMappingID := usersettinghistoryFields[8].Descriptor() + // usersettinghistory.DefaultMappingID holds the default value on creation for the mapping_id field. + usersettinghistory.DefaultMappingID = usersettinghistoryDescMappingID.Default.(func() string) + // usersettinghistoryDescTags is the schema descriptor for tags field. + usersettinghistoryDescTags := usersettinghistoryFields[9].Descriptor() + // usersettinghistory.DefaultTags holds the default value on creation for the tags field. + usersettinghistory.DefaultTags = usersettinghistoryDescTags.Default.([]string) + // usersettinghistoryDescLocked is the schema descriptor for locked field. + usersettinghistoryDescLocked := usersettinghistoryFields[13].Descriptor() + // usersettinghistory.DefaultLocked holds the default value on creation for the locked field. + usersettinghistory.DefaultLocked = usersettinghistoryDescLocked.Default.(bool) + // usersettinghistoryDescEmailConfirmed is the schema descriptor for email_confirmed field. + usersettinghistoryDescEmailConfirmed := usersettinghistoryFields[17].Descriptor() + // usersettinghistory.DefaultEmailConfirmed holds the default value on creation for the email_confirmed field. + usersettinghistory.DefaultEmailConfirmed = usersettinghistoryDescEmailConfirmed.Default.(bool) + // usersettinghistoryDescIsWebauthnAllowed is the schema descriptor for is_webauthn_allowed field. + usersettinghistoryDescIsWebauthnAllowed := usersettinghistoryFields[18].Descriptor() + // usersettinghistory.DefaultIsWebauthnAllowed holds the default value on creation for the is_webauthn_allowed field. + usersettinghistory.DefaultIsWebauthnAllowed = usersettinghistoryDescIsWebauthnAllowed.Default.(bool) + // usersettinghistoryDescIsTfaEnabled is the schema descriptor for is_tfa_enabled field. + usersettinghistoryDescIsTfaEnabled := usersettinghistoryFields[19].Descriptor() + // usersettinghistory.DefaultIsTfaEnabled holds the default value on creation for the is_tfa_enabled field. + usersettinghistory.DefaultIsTfaEnabled = usersettinghistoryDescIsTfaEnabled.Default.(bool) + // usersettinghistoryDescID is the schema descriptor for id field. + usersettinghistoryDescID := usersettinghistoryFields[7].Descriptor() + // usersettinghistory.DefaultID holds the default value on creation for the id field. + usersettinghistory.DefaultID = usersettinghistoryDescID.Default.(func() string) + webauthnMixin := schema.Webauthn{}.Mixin() + webauthnMixinHooks0 := webauthnMixin[0].Hooks() + webauthnMixinHooks3 := webauthnMixin[3].Hooks() + webauthn.Hooks[0] = webauthnMixinHooks0[0] + webauthn.Hooks[1] = webauthnMixinHooks3[0] + webauthnMixinInters3 := webauthnMixin[3].Interceptors() + webauthn.Interceptors[0] = webauthnMixinInters3[0] + webauthnMixinFields0 := webauthnMixin[0].Fields() + _ = webauthnMixinFields0 + webauthnMixinFields1 := webauthnMixin[1].Fields() + _ = webauthnMixinFields1 + webauthnMixinFields2 := webauthnMixin[2].Fields() + _ = webauthnMixinFields2 + webauthnFields := schema.Webauthn{}.Fields() + _ = webauthnFields + // webauthnDescCreatedAt is the schema descriptor for created_at field. + webauthnDescCreatedAt := webauthnMixinFields0[0].Descriptor() + // webauthn.DefaultCreatedAt holds the default value on creation for the created_at field. + webauthn.DefaultCreatedAt = webauthnDescCreatedAt.Default.(func() time.Time) + // webauthnDescUpdatedAt is the schema descriptor for updated_at field. + webauthnDescUpdatedAt := webauthnMixinFields0[1].Descriptor() + // webauthn.DefaultUpdatedAt holds the default value on creation for the updated_at field. + webauthn.DefaultUpdatedAt = webauthnDescUpdatedAt.Default.(func() time.Time) + // webauthn.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + webauthn.UpdateDefaultUpdatedAt = webauthnDescUpdatedAt.UpdateDefault.(func() time.Time) + // webauthnDescMappingID is the schema descriptor for mapping_id field. + webauthnDescMappingID := webauthnMixinFields1[1].Descriptor() + // webauthn.DefaultMappingID holds the default value on creation for the mapping_id field. + webauthn.DefaultMappingID = webauthnDescMappingID.Default.(func() string) + // webauthnDescTags is the schema descriptor for tags field. + webauthnDescTags := webauthnMixinFields2[0].Descriptor() + // webauthn.DefaultTags holds the default value on creation for the tags field. + webauthn.DefaultTags = webauthnDescTags.Default.([]string) + // webauthnDescBackupEligible is the schema descriptor for backup_eligible field. + webauthnDescBackupEligible := webauthnFields[6].Descriptor() + // webauthn.DefaultBackupEligible holds the default value on creation for the backup_eligible field. + webauthn.DefaultBackupEligible = webauthnDescBackupEligible.Default.(bool) + // webauthnDescBackupState is the schema descriptor for backup_state field. + webauthnDescBackupState := webauthnFields[7].Descriptor() + // webauthn.DefaultBackupState holds the default value on creation for the backup_state field. + webauthn.DefaultBackupState = webauthnDescBackupState.Default.(bool) + // webauthnDescUserPresent is the schema descriptor for user_present field. + webauthnDescUserPresent := webauthnFields[8].Descriptor() + // webauthn.DefaultUserPresent holds the default value on creation for the user_present field. + webauthn.DefaultUserPresent = webauthnDescUserPresent.Default.(bool) + // webauthnDescUserVerified is the schema descriptor for user_verified field. + webauthnDescUserVerified := webauthnFields[9].Descriptor() + // webauthn.DefaultUserVerified holds the default value on creation for the user_verified field. + webauthn.DefaultUserVerified = webauthnDescUserVerified.Default.(bool) + // webauthnDescID is the schema descriptor for id field. + webauthnDescID := webauthnMixinFields1[0].Descriptor() + // webauthn.DefaultID holds the default value on creation for the id field. + webauthn.DefaultID = webauthnDescID.Default.(func() string) + webhookMixin := schema.Webhook{}.Mixin() + webhookMixinHooks0 := webhookMixin[0].Hooks() + webhookMixinHooks3 := webhookMixin[3].Hooks() + webhook.Hooks[0] = webhookMixinHooks0[0] + webhook.Hooks[1] = webhookMixinHooks3[0] + webhookMixinInters3 := webhookMixin[3].Interceptors() + webhook.Interceptors[0] = webhookMixinInters3[0] + webhookMixinFields0 := webhookMixin[0].Fields() + _ = webhookMixinFields0 + webhookMixinFields1 := webhookMixin[1].Fields() + _ = webhookMixinFields1 + webhookMixinFields2 := webhookMixin[2].Fields() + _ = webhookMixinFields2 + webhookFields := schema.Webhook{}.Fields() + _ = webhookFields + // webhookDescCreatedAt is the schema descriptor for created_at field. + webhookDescCreatedAt := webhookMixinFields0[0].Descriptor() + // webhook.DefaultCreatedAt holds the default value on creation for the created_at field. + webhook.DefaultCreatedAt = webhookDescCreatedAt.Default.(func() time.Time) + // webhookDescUpdatedAt is the schema descriptor for updated_at field. + webhookDescUpdatedAt := webhookMixinFields0[1].Descriptor() + // webhook.DefaultUpdatedAt holds the default value on creation for the updated_at field. + webhook.DefaultUpdatedAt = webhookDescUpdatedAt.Default.(func() time.Time) + // webhook.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + webhook.UpdateDefaultUpdatedAt = webhookDescUpdatedAt.UpdateDefault.(func() time.Time) + // webhookDescMappingID is the schema descriptor for mapping_id field. + webhookDescMappingID := webhookMixinFields1[1].Descriptor() + // webhook.DefaultMappingID holds the default value on creation for the mapping_id field. + webhook.DefaultMappingID = webhookDescMappingID.Default.(func() string) + // webhookDescTags is the schema descriptor for tags field. + webhookDescTags := webhookMixinFields2[0].Descriptor() + // webhook.DefaultTags holds the default value on creation for the tags field. + webhook.DefaultTags = webhookDescTags.Default.([]string) + // webhookDescName is the schema descriptor for name field. + webhookDescName := webhookFields[0].Descriptor() + // webhook.NameValidator is a validator for the "name" field. It is called by the builders before save. + webhook.NameValidator = webhookDescName.Validators[0].(func(string) error) + // webhookDescDestinationURL is the schema descriptor for destination_url field. + webhookDescDestinationURL := webhookFields[2].Descriptor() + // webhook.DestinationURLValidator is a validator for the "destination_url" field. It is called by the builders before save. + webhook.DestinationURLValidator = webhookDescDestinationURL.Validators[0].(func(string) error) + // webhookDescEnabled is the schema descriptor for enabled field. + webhookDescEnabled := webhookFields[3].Descriptor() + // webhook.DefaultEnabled holds the default value on creation for the enabled field. + webhook.DefaultEnabled = webhookDescEnabled.Default.(bool) + // webhookDescFailures is the schema descriptor for failures field. + webhookDescFailures := webhookFields[7].Descriptor() + // webhook.DefaultFailures holds the default value on creation for the failures field. + webhook.DefaultFailures = webhookDescFailures.Default.(int) + // webhookDescID is the schema descriptor for id field. + webhookDescID := webhookMixinFields1[0].Descriptor() + // webhook.DefaultID holds the default value on creation for the id field. + webhook.DefaultID = webhookDescID.Default.(func() string) + webhookhistory.Policy = privacy.NewPolicies(schema.WebhookHistory{}) + webhookhistory.Hooks[0] = func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if err := webhookhistory.Policy.EvalMutation(ctx, m); err != nil { + return nil, err + } + return next.Mutate(ctx, m) + }) + } + webhookhistoryInters := schema.WebhookHistory{}.Interceptors() + webhookhistory.Interceptors[0] = webhookhistoryInters[0] + webhookhistoryFields := schema.WebhookHistory{}.Fields() + _ = webhookhistoryFields + // webhookhistoryDescHistoryTime is the schema descriptor for history_time field. + webhookhistoryDescHistoryTime := webhookhistoryFields[0].Descriptor() + // webhookhistory.DefaultHistoryTime holds the default value on creation for the history_time field. + webhookhistory.DefaultHistoryTime = webhookhistoryDescHistoryTime.Default.(func() time.Time) + // webhookhistoryDescCreatedAt is the schema descriptor for created_at field. + webhookhistoryDescCreatedAt := webhookhistoryFields[3].Descriptor() + // webhookhistory.DefaultCreatedAt holds the default value on creation for the created_at field. + webhookhistory.DefaultCreatedAt = webhookhistoryDescCreatedAt.Default.(func() time.Time) + // webhookhistoryDescUpdatedAt is the schema descriptor for updated_at field. + webhookhistoryDescUpdatedAt := webhookhistoryFields[4].Descriptor() + // webhookhistory.DefaultUpdatedAt holds the default value on creation for the updated_at field. + webhookhistory.DefaultUpdatedAt = webhookhistoryDescUpdatedAt.Default.(func() time.Time) + // webhookhistory.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. + webhookhistory.UpdateDefaultUpdatedAt = webhookhistoryDescUpdatedAt.UpdateDefault.(func() time.Time) + // webhookhistoryDescMappingID is the schema descriptor for mapping_id field. + webhookhistoryDescMappingID := webhookhistoryFields[8].Descriptor() + // webhookhistory.DefaultMappingID holds the default value on creation for the mapping_id field. + webhookhistory.DefaultMappingID = webhookhistoryDescMappingID.Default.(func() string) + // webhookhistoryDescTags is the schema descriptor for tags field. + webhookhistoryDescTags := webhookhistoryFields[9].Descriptor() + // webhookhistory.DefaultTags holds the default value on creation for the tags field. + webhookhistory.DefaultTags = webhookhistoryDescTags.Default.([]string) + // webhookhistoryDescEnabled is the schema descriptor for enabled field. + webhookhistoryDescEnabled := webhookhistoryFields[16].Descriptor() + // webhookhistory.DefaultEnabled holds the default value on creation for the enabled field. + webhookhistory.DefaultEnabled = webhookhistoryDescEnabled.Default.(bool) + // webhookhistoryDescFailures is the schema descriptor for failures field. + webhookhistoryDescFailures := webhookhistoryFields[20].Descriptor() + // webhookhistory.DefaultFailures holds the default value on creation for the failures field. + webhookhistory.DefaultFailures = webhookhistoryDescFailures.Default.(int) + // webhookhistoryDescID is the schema descriptor for id field. + webhookhistoryDescID := webhookhistoryFields[7].Descriptor() + // webhookhistory.DefaultID holds the default value on creation for the id field. + webhookhistory.DefaultID = webhookhistoryDescID.Default.(func() string) +} + +const ( + Version = "v0.14.1" // Version of ent codegen. + Sum = "h1:fUERL506Pqr92EPHJqr8EYxbPioflJo6PudkrEA8a/s=" // Sum of ent codegen. +) diff --git a/internal/ent/generated/subscriber.go b/internal/ent/generated/subscriber.go new file mode 100644 index 0000000..1589c6b --- /dev/null +++ b/internal/ent/generated/subscriber.go @@ -0,0 +1,365 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/subscriber" +) + +// Subscriber is the model entity for the Subscriber schema. +type Subscriber struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // email address of the subscriber + Email string `json:"email,omitempty"` + // phone number of the subscriber + PhoneNumber string `json:"phone_number,omitempty"` + // indicates if the email address has been verified + VerifiedEmail bool `json:"verified_email,omitempty"` + // indicates if the phone number has been verified + VerifiedPhone bool `json:"verified_phone,omitempty"` + // indicates if the subscriber is active or not, active users will have at least one verified contact method + Active bool `json:"active,omitempty"` + // the verification token sent to the user via email which should only be provided to the /subscribe endpoint + handler + Token string `json:"token,omitempty"` + // the ttl of the verification token which defaults to 7 days + TTL *time.Time `json:"ttl,omitempty"` + // the comparison secret to verify the token's signature + Secret *[]byte `json:"secret,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the SubscriberQuery when eager-loading is set. + Edges SubscriberEdges `json:"edges"` + selectValues sql.SelectValues +} + +// SubscriberEdges holds the relations/edges for other nodes in the graph. +type SubscriberEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int + + namedEvents map[string][]*Event +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e SubscriberEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e SubscriberEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[1] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Subscriber) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case subscriber.FieldTags, subscriber.FieldSecret: + values[i] = new([]byte) + case subscriber.FieldVerifiedEmail, subscriber.FieldVerifiedPhone, subscriber.FieldActive: + values[i] = new(sql.NullBool) + case subscriber.FieldID, subscriber.FieldCreatedBy, subscriber.FieldUpdatedBy, subscriber.FieldMappingID, subscriber.FieldDeletedBy, subscriber.FieldOwnerID, subscriber.FieldEmail, subscriber.FieldPhoneNumber, subscriber.FieldToken: + values[i] = new(sql.NullString) + case subscriber.FieldCreatedAt, subscriber.FieldUpdatedAt, subscriber.FieldDeletedAt, subscriber.FieldTTL: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Subscriber fields. +func (s *Subscriber) 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 subscriber.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + s.ID = value.String + } + case subscriber.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + s.CreatedAt = value.Time + } + case subscriber.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + s.UpdatedAt = value.Time + } + case subscriber.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + s.CreatedBy = value.String + } + case subscriber.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + s.UpdatedBy = value.String + } + case subscriber.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + s.MappingID = value.String + } + case subscriber.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &s.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case subscriber.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + s.DeletedAt = value.Time + } + case subscriber.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + s.DeletedBy = value.String + } + case subscriber.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + s.OwnerID = value.String + } + case subscriber.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + s.Email = value.String + } + case subscriber.FieldPhoneNumber: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field phone_number", values[i]) + } else if value.Valid { + s.PhoneNumber = value.String + } + case subscriber.FieldVerifiedEmail: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field verified_email", values[i]) + } else if value.Valid { + s.VerifiedEmail = value.Bool + } + case subscriber.FieldVerifiedPhone: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field verified_phone", values[i]) + } else if value.Valid { + s.VerifiedPhone = value.Bool + } + case subscriber.FieldActive: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field active", values[i]) + } else if value.Valid { + s.Active = value.Bool + } + case subscriber.FieldToken: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field token", values[i]) + } else if value.Valid { + s.Token = value.String + } + case subscriber.FieldTTL: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field ttl", values[i]) + } else if value.Valid { + s.TTL = new(time.Time) + *s.TTL = value.Time + } + case subscriber.FieldSecret: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field secret", values[i]) + } else if value != nil { + s.Secret = value + } + default: + s.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Subscriber. +// This includes values selected through modifiers, order, etc. +func (s *Subscriber) Value(name string) (ent.Value, error) { + return s.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Subscriber entity. +func (s *Subscriber) QueryOwner() *OrganizationQuery { + return NewSubscriberClient(s.config).QueryOwner(s) +} + +// QueryEvents queries the "events" edge of the Subscriber entity. +func (s *Subscriber) QueryEvents() *EventQuery { + return NewSubscriberClient(s.config).QueryEvents(s) +} + +// Update returns a builder for updating this Subscriber. +// Note that you need to call Subscriber.Unwrap() before calling this method if this Subscriber +// was returned from a transaction, and the transaction was committed or rolled back. +func (s *Subscriber) Update() *SubscriberUpdateOne { + return NewSubscriberClient(s.config).UpdateOne(s) +} + +// Unwrap unwraps the Subscriber 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 (s *Subscriber) Unwrap() *Subscriber { + _tx, ok := s.config.driver.(*txDriver) + if !ok { + panic("generated: Subscriber is not a transactional entity") + } + s.config.driver = _tx.drv + return s +} + +// String implements the fmt.Stringer. +func (s *Subscriber) String() string { + var builder strings.Builder + builder.WriteString("Subscriber(") + builder.WriteString(fmt.Sprintf("id=%v, ", s.ID)) + builder.WriteString("created_at=") + builder.WriteString(s.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(s.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(s.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(s.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(s.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", s.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(s.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(s.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(s.OwnerID) + builder.WriteString(", ") + builder.WriteString("email=") + builder.WriteString(s.Email) + builder.WriteString(", ") + builder.WriteString("phone_number=") + builder.WriteString(s.PhoneNumber) + builder.WriteString(", ") + builder.WriteString("verified_email=") + builder.WriteString(fmt.Sprintf("%v", s.VerifiedEmail)) + builder.WriteString(", ") + builder.WriteString("verified_phone=") + builder.WriteString(fmt.Sprintf("%v", s.VerifiedPhone)) + builder.WriteString(", ") + builder.WriteString("active=") + builder.WriteString(fmt.Sprintf("%v", s.Active)) + builder.WriteString(", ") + builder.WriteString("token=") + builder.WriteString(s.Token) + builder.WriteString(", ") + if v := s.TTL; v != nil { + builder.WriteString("ttl=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := s.Secret; v != nil { + builder.WriteString("secret=") + builder.WriteString(fmt.Sprintf("%v", *v)) + } + builder.WriteByte(')') + return builder.String() +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (s *Subscriber) NamedEvents(name string) ([]*Event, error) { + if s.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := s.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (s *Subscriber) appendNamedEvents(name string, edges ...*Event) { + if s.Edges.namedEvents == nil { + s.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + s.Edges.namedEvents[name] = []*Event{} + } else { + s.Edges.namedEvents[name] = append(s.Edges.namedEvents[name], edges...) + } +} + +// Subscribers is a parsable slice of Subscriber. +type Subscribers []*Subscriber diff --git a/internal/ent/generated/subscriber/subscriber.go b/internal/ent/generated/subscriber/subscriber.go new file mode 100644 index 0000000..dfdf2c1 --- /dev/null +++ b/internal/ent/generated/subscriber/subscriber.go @@ -0,0 +1,265 @@ +// Code generated by ent, DO NOT EDIT. + +package subscriber + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the subscriber type in the database. + Label = "subscriber" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldPhoneNumber holds the string denoting the phone_number field in the database. + FieldPhoneNumber = "phone_number" + // FieldVerifiedEmail holds the string denoting the verified_email field in the database. + FieldVerifiedEmail = "verified_email" + // FieldVerifiedPhone holds the string denoting the verified_phone field in the database. + FieldVerifiedPhone = "verified_phone" + // FieldActive holds the string denoting the active field in the database. + FieldActive = "active" + // FieldToken holds the string denoting the token field in the database. + FieldToken = "token" + // FieldTTL holds the string denoting the ttl field in the database. + FieldTTL = "ttl" + // FieldSecret holds the string denoting the secret field in the database. + FieldSecret = "secret" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // Table holds the table name of the subscriber in the database. + Table = "subscribers" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "subscribers" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "subscriber_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" +) + +// Columns holds all SQL columns for subscriber fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldEmail, + FieldPhoneNumber, + FieldVerifiedEmail, + FieldVerifiedPhone, + FieldActive, + FieldToken, + FieldTTL, + FieldSecret, +} + +var ( + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"subscriber_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // EmailValidator is a validator for the "email" field. It is called by the builders before save. + EmailValidator func(string) error + // PhoneNumberValidator is a validator for the "phone_number" field. It is called by the builders before save. + PhoneNumberValidator func(string) error + // DefaultVerifiedEmail holds the default value on creation for the "verified_email" field. + DefaultVerifiedEmail bool + // DefaultVerifiedPhone holds the default value on creation for the "verified_phone" field. + DefaultVerifiedPhone bool + // DefaultActive holds the default value on creation for the "active" field. + DefaultActive bool + // TokenValidator is a validator for the "token" field. It is called by the builders before save. + TokenValidator func(string) error + // SecretValidator is a validator for the "secret" field. It is called by the builders before save. + SecretValidator func([]byte) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Subscriber queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByPhoneNumber orders the results by the phone_number field. +func ByPhoneNumber(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPhoneNumber, opts...).ToFunc() +} + +// ByVerifiedEmail orders the results by the verified_email field. +func ByVerifiedEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldVerifiedEmail, opts...).ToFunc() +} + +// ByVerifiedPhone orders the results by the verified_phone field. +func ByVerifiedPhone(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldVerifiedPhone, opts...).ToFunc() +} + +// ByActive orders the results by the active field. +func ByActive(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldActive, opts...).ToFunc() +} + +// ByToken orders the results by the token field. +func ByToken(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldToken, opts...).ToFunc() +} + +// ByTTL orders the results by the ttl field. +func ByTTL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTTL, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} diff --git a/internal/ent/generated/subscriber/where.go b/internal/ent/generated/subscriber/where.go new file mode 100644 index 0000000..252afd7 --- /dev/null +++ b/internal/ent/generated/subscriber/where.go @@ -0,0 +1,1061 @@ +// Code generated by ent, DO NOT EDIT. + +package subscriber + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldOwnerID, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldEmail, v)) +} + +// PhoneNumber applies equality check predicate on the "phone_number" field. It's identical to PhoneNumberEQ. +func PhoneNumber(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// VerifiedEmail applies equality check predicate on the "verified_email" field. It's identical to VerifiedEmailEQ. +func VerifiedEmail(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldVerifiedEmail, v)) +} + +// VerifiedPhone applies equality check predicate on the "verified_phone" field. It's identical to VerifiedPhoneEQ. +func VerifiedPhone(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldVerifiedPhone, v)) +} + +// Active applies equality check predicate on the "active" field. It's identical to ActiveEQ. +func Active(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldActive, v)) +} + +// Token applies equality check predicate on the "token" field. It's identical to TokenEQ. +func Token(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldToken, v)) +} + +// TTL applies equality check predicate on the "ttl" field. It's identical to TTLEQ. +func TTL(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldTTL, v)) +} + +// Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ. +func Secret(v []byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldSecret, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldEmail, v)) +} + +// PhoneNumberEQ applies the EQ predicate on the "phone_number" field. +func PhoneNumberEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberNEQ applies the NEQ predicate on the "phone_number" field. +func PhoneNumberNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberIn applies the In predicate on the "phone_number" field. +func PhoneNumberIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberNotIn applies the NotIn predicate on the "phone_number" field. +func PhoneNumberNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberGT applies the GT predicate on the "phone_number" field. +func PhoneNumberGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldPhoneNumber, v)) +} + +// PhoneNumberGTE applies the GTE predicate on the "phone_number" field. +func PhoneNumberGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldPhoneNumber, v)) +} + +// PhoneNumberLT applies the LT predicate on the "phone_number" field. +func PhoneNumberLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldPhoneNumber, v)) +} + +// PhoneNumberLTE applies the LTE predicate on the "phone_number" field. +func PhoneNumberLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldPhoneNumber, v)) +} + +// PhoneNumberContains applies the Contains predicate on the "phone_number" field. +func PhoneNumberContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldPhoneNumber, v)) +} + +// PhoneNumberHasPrefix applies the HasPrefix predicate on the "phone_number" field. +func PhoneNumberHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldPhoneNumber, v)) +} + +// PhoneNumberHasSuffix applies the HasSuffix predicate on the "phone_number" field. +func PhoneNumberHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldPhoneNumber, v)) +} + +// PhoneNumberIsNil applies the IsNil predicate on the "phone_number" field. +func PhoneNumberIsNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldIsNull(FieldPhoneNumber)) +} + +// PhoneNumberNotNil applies the NotNil predicate on the "phone_number" field. +func PhoneNumberNotNil() predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotNull(FieldPhoneNumber)) +} + +// PhoneNumberEqualFold applies the EqualFold predicate on the "phone_number" field. +func PhoneNumberEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldPhoneNumber, v)) +} + +// PhoneNumberContainsFold applies the ContainsFold predicate on the "phone_number" field. +func PhoneNumberContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldPhoneNumber, v)) +} + +// VerifiedEmailEQ applies the EQ predicate on the "verified_email" field. +func VerifiedEmailEQ(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldVerifiedEmail, v)) +} + +// VerifiedEmailNEQ applies the NEQ predicate on the "verified_email" field. +func VerifiedEmailNEQ(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldVerifiedEmail, v)) +} + +// VerifiedPhoneEQ applies the EQ predicate on the "verified_phone" field. +func VerifiedPhoneEQ(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldVerifiedPhone, v)) +} + +// VerifiedPhoneNEQ applies the NEQ predicate on the "verified_phone" field. +func VerifiedPhoneNEQ(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldVerifiedPhone, v)) +} + +// ActiveEQ applies the EQ predicate on the "active" field. +func ActiveEQ(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldActive, v)) +} + +// ActiveNEQ applies the NEQ predicate on the "active" field. +func ActiveNEQ(v bool) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldActive, v)) +} + +// TokenEQ applies the EQ predicate on the "token" field. +func TokenEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldToken, v)) +} + +// TokenNEQ applies the NEQ predicate on the "token" field. +func TokenNEQ(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldToken, v)) +} + +// TokenIn applies the In predicate on the "token" field. +func TokenIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldToken, vs...)) +} + +// TokenNotIn applies the NotIn predicate on the "token" field. +func TokenNotIn(vs ...string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldToken, vs...)) +} + +// TokenGT applies the GT predicate on the "token" field. +func TokenGT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldToken, v)) +} + +// TokenGTE applies the GTE predicate on the "token" field. +func TokenGTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldToken, v)) +} + +// TokenLT applies the LT predicate on the "token" field. +func TokenLT(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldToken, v)) +} + +// TokenLTE applies the LTE predicate on the "token" field. +func TokenLTE(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldToken, v)) +} + +// TokenContains applies the Contains predicate on the "token" field. +func TokenContains(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContains(FieldToken, v)) +} + +// TokenHasPrefix applies the HasPrefix predicate on the "token" field. +func TokenHasPrefix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasPrefix(FieldToken, v)) +} + +// TokenHasSuffix applies the HasSuffix predicate on the "token" field. +func TokenHasSuffix(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldHasSuffix(FieldToken, v)) +} + +// TokenEqualFold applies the EqualFold predicate on the "token" field. +func TokenEqualFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEqualFold(FieldToken, v)) +} + +// TokenContainsFold applies the ContainsFold predicate on the "token" field. +func TokenContainsFold(v string) predicate.Subscriber { + return predicate.Subscriber(sql.FieldContainsFold(FieldToken, v)) +} + +// TTLEQ applies the EQ predicate on the "ttl" field. +func TTLEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldTTL, v)) +} + +// TTLNEQ applies the NEQ predicate on the "ttl" field. +func TTLNEQ(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldTTL, v)) +} + +// TTLIn applies the In predicate on the "ttl" field. +func TTLIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldTTL, vs...)) +} + +// TTLNotIn applies the NotIn predicate on the "ttl" field. +func TTLNotIn(vs ...time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldTTL, vs...)) +} + +// TTLGT applies the GT predicate on the "ttl" field. +func TTLGT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldTTL, v)) +} + +// TTLGTE applies the GTE predicate on the "ttl" field. +func TTLGTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldTTL, v)) +} + +// TTLLT applies the LT predicate on the "ttl" field. +func TTLLT(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldTTL, v)) +} + +// TTLLTE applies the LTE predicate on the "ttl" field. +func TTLLTE(v time.Time) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldTTL, v)) +} + +// SecretEQ applies the EQ predicate on the "secret" field. +func SecretEQ(v []byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldEQ(FieldSecret, v)) +} + +// SecretNEQ applies the NEQ predicate on the "secret" field. +func SecretNEQ(v []byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNEQ(FieldSecret, v)) +} + +// SecretIn applies the In predicate on the "secret" field. +func SecretIn(vs ...[]byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldIn(FieldSecret, vs...)) +} + +// SecretNotIn applies the NotIn predicate on the "secret" field. +func SecretNotIn(vs ...[]byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldNotIn(FieldSecret, vs...)) +} + +// SecretGT applies the GT predicate on the "secret" field. +func SecretGT(v []byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGT(FieldSecret, v)) +} + +// SecretGTE applies the GTE predicate on the "secret" field. +func SecretGTE(v []byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldGTE(FieldSecret, v)) +} + +// SecretLT applies the LT predicate on the "secret" field. +func SecretLT(v []byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLT(FieldSecret, v)) +} + +// SecretLTE applies the LTE predicate on the "secret" field. +func SecretLTE(v []byte) predicate.Subscriber { + return predicate.Subscriber(sql.FieldLTE(FieldSecret, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Subscriber { + return predicate.Subscriber(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Subscriber + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Subscriber { + return predicate.Subscriber(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Subscriber + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Subscriber { + return predicate.Subscriber(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.SubscriberEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Subscriber { + return predicate.Subscriber(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.SubscriberEvents + 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.Subscriber) predicate.Subscriber { + return predicate.Subscriber(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Subscriber) predicate.Subscriber { + return predicate.Subscriber(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Subscriber) predicate.Subscriber { + return predicate.Subscriber(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/subscriber_create.go b/internal/ent/generated/subscriber_create.go new file mode 100644 index 0000000..94ece03 --- /dev/null +++ b/internal/ent/generated/subscriber_create.go @@ -0,0 +1,612 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/subscriber" +) + +// SubscriberCreate is the builder for creating a Subscriber entity. +type SubscriberCreate struct { + config + mutation *SubscriberMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (sc *SubscriberCreate) SetCreatedAt(t time.Time) *SubscriberCreate { + sc.mutation.SetCreatedAt(t) + return sc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableCreatedAt(t *time.Time) *SubscriberCreate { + if t != nil { + sc.SetCreatedAt(*t) + } + return sc +} + +// SetUpdatedAt sets the "updated_at" field. +func (sc *SubscriberCreate) SetUpdatedAt(t time.Time) *SubscriberCreate { + sc.mutation.SetUpdatedAt(t) + return sc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableUpdatedAt(t *time.Time) *SubscriberCreate { + if t != nil { + sc.SetUpdatedAt(*t) + } + return sc +} + +// SetCreatedBy sets the "created_by" field. +func (sc *SubscriberCreate) SetCreatedBy(s string) *SubscriberCreate { + sc.mutation.SetCreatedBy(s) + return sc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableCreatedBy(s *string) *SubscriberCreate { + if s != nil { + sc.SetCreatedBy(*s) + } + return sc +} + +// SetUpdatedBy sets the "updated_by" field. +func (sc *SubscriberCreate) SetUpdatedBy(s string) *SubscriberCreate { + sc.mutation.SetUpdatedBy(s) + return sc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableUpdatedBy(s *string) *SubscriberCreate { + if s != nil { + sc.SetUpdatedBy(*s) + } + return sc +} + +// SetMappingID sets the "mapping_id" field. +func (sc *SubscriberCreate) SetMappingID(s string) *SubscriberCreate { + sc.mutation.SetMappingID(s) + return sc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableMappingID(s *string) *SubscriberCreate { + if s != nil { + sc.SetMappingID(*s) + } + return sc +} + +// SetTags sets the "tags" field. +func (sc *SubscriberCreate) SetTags(s []string) *SubscriberCreate { + sc.mutation.SetTags(s) + return sc +} + +// SetDeletedAt sets the "deleted_at" field. +func (sc *SubscriberCreate) SetDeletedAt(t time.Time) *SubscriberCreate { + sc.mutation.SetDeletedAt(t) + return sc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableDeletedAt(t *time.Time) *SubscriberCreate { + if t != nil { + sc.SetDeletedAt(*t) + } + return sc +} + +// SetDeletedBy sets the "deleted_by" field. +func (sc *SubscriberCreate) SetDeletedBy(s string) *SubscriberCreate { + sc.mutation.SetDeletedBy(s) + return sc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableDeletedBy(s *string) *SubscriberCreate { + if s != nil { + sc.SetDeletedBy(*s) + } + return sc +} + +// SetOwnerID sets the "owner_id" field. +func (sc *SubscriberCreate) SetOwnerID(s string) *SubscriberCreate { + sc.mutation.SetOwnerID(s) + return sc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableOwnerID(s *string) *SubscriberCreate { + if s != nil { + sc.SetOwnerID(*s) + } + return sc +} + +// SetEmail sets the "email" field. +func (sc *SubscriberCreate) SetEmail(s string) *SubscriberCreate { + sc.mutation.SetEmail(s) + return sc +} + +// SetPhoneNumber sets the "phone_number" field. +func (sc *SubscriberCreate) SetPhoneNumber(s string) *SubscriberCreate { + sc.mutation.SetPhoneNumber(s) + return sc +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillablePhoneNumber(s *string) *SubscriberCreate { + if s != nil { + sc.SetPhoneNumber(*s) + } + return sc +} + +// SetVerifiedEmail sets the "verified_email" field. +func (sc *SubscriberCreate) SetVerifiedEmail(b bool) *SubscriberCreate { + sc.mutation.SetVerifiedEmail(b) + return sc +} + +// SetNillableVerifiedEmail sets the "verified_email" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableVerifiedEmail(b *bool) *SubscriberCreate { + if b != nil { + sc.SetVerifiedEmail(*b) + } + return sc +} + +// SetVerifiedPhone sets the "verified_phone" field. +func (sc *SubscriberCreate) SetVerifiedPhone(b bool) *SubscriberCreate { + sc.mutation.SetVerifiedPhone(b) + return sc +} + +// SetNillableVerifiedPhone sets the "verified_phone" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableVerifiedPhone(b *bool) *SubscriberCreate { + if b != nil { + sc.SetVerifiedPhone(*b) + } + return sc +} + +// SetActive sets the "active" field. +func (sc *SubscriberCreate) SetActive(b bool) *SubscriberCreate { + sc.mutation.SetActive(b) + return sc +} + +// SetNillableActive sets the "active" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableActive(b *bool) *SubscriberCreate { + if b != nil { + sc.SetActive(*b) + } + return sc +} + +// SetToken sets the "token" field. +func (sc *SubscriberCreate) SetToken(s string) *SubscriberCreate { + sc.mutation.SetToken(s) + return sc +} + +// SetTTL sets the "ttl" field. +func (sc *SubscriberCreate) SetTTL(t time.Time) *SubscriberCreate { + sc.mutation.SetTTL(t) + return sc +} + +// SetSecret sets the "secret" field. +func (sc *SubscriberCreate) SetSecret(b []byte) *SubscriberCreate { + sc.mutation.SetSecret(b) + return sc +} + +// SetID sets the "id" field. +func (sc *SubscriberCreate) SetID(s string) *SubscriberCreate { + sc.mutation.SetID(s) + return sc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (sc *SubscriberCreate) SetNillableID(s *string) *SubscriberCreate { + if s != nil { + sc.SetID(*s) + } + return sc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (sc *SubscriberCreate) SetOwner(o *Organization) *SubscriberCreate { + return sc.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (sc *SubscriberCreate) AddEventIDs(ids ...string) *SubscriberCreate { + sc.mutation.AddEventIDs(ids...) + return sc +} + +// AddEvents adds the "events" edges to the Event entity. +func (sc *SubscriberCreate) AddEvents(e ...*Event) *SubscriberCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return sc.AddEventIDs(ids...) +} + +// Mutation returns the SubscriberMutation object of the builder. +func (sc *SubscriberCreate) Mutation() *SubscriberMutation { + return sc.mutation +} + +// Save creates the Subscriber in the database. +func (sc *SubscriberCreate) Save(ctx context.Context) (*Subscriber, error) { + if err := sc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, sc.sqlSave, sc.mutation, sc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (sc *SubscriberCreate) SaveX(ctx context.Context) *Subscriber { + v, err := sc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (sc *SubscriberCreate) Exec(ctx context.Context) error { + _, err := sc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (sc *SubscriberCreate) ExecX(ctx context.Context) { + if err := sc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (sc *SubscriberCreate) defaults() error { + if _, ok := sc.mutation.CreatedAt(); !ok { + if subscriber.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized subscriber.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := subscriber.DefaultCreatedAt() + sc.mutation.SetCreatedAt(v) + } + if _, ok := sc.mutation.UpdatedAt(); !ok { + if subscriber.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized subscriber.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := subscriber.DefaultUpdatedAt() + sc.mutation.SetUpdatedAt(v) + } + if _, ok := sc.mutation.MappingID(); !ok { + if subscriber.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized subscriber.DefaultMappingID (forgotten import generated/runtime?)") + } + v := subscriber.DefaultMappingID() + sc.mutation.SetMappingID(v) + } + if _, ok := sc.mutation.Tags(); !ok { + v := subscriber.DefaultTags + sc.mutation.SetTags(v) + } + if _, ok := sc.mutation.VerifiedEmail(); !ok { + v := subscriber.DefaultVerifiedEmail + sc.mutation.SetVerifiedEmail(v) + } + if _, ok := sc.mutation.VerifiedPhone(); !ok { + v := subscriber.DefaultVerifiedPhone + sc.mutation.SetVerifiedPhone(v) + } + if _, ok := sc.mutation.Active(); !ok { + v := subscriber.DefaultActive + sc.mutation.SetActive(v) + } + if _, ok := sc.mutation.ID(); !ok { + if subscriber.DefaultID == nil { + return fmt.Errorf("generated: uninitialized subscriber.DefaultID (forgotten import generated/runtime?)") + } + v := subscriber.DefaultID() + sc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (sc *SubscriberCreate) check() error { + if _, ok := sc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Subscriber.mapping_id"`)} + } + if v, ok := sc.mutation.OwnerID(); ok { + if err := subscriber.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Subscriber.owner_id": %w`, err)} + } + } + if _, ok := sc.mutation.Email(); !ok { + return &ValidationError{Name: "email", err: errors.New(`generated: missing required field "Subscriber.email"`)} + } + if v, ok := sc.mutation.Email(); ok { + if err := subscriber.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "Subscriber.email": %w`, err)} + } + } + if v, ok := sc.mutation.PhoneNumber(); ok { + if err := subscriber.PhoneNumberValidator(v); err != nil { + return &ValidationError{Name: "phone_number", err: fmt.Errorf(`generated: validator failed for field "Subscriber.phone_number": %w`, err)} + } + } + if _, ok := sc.mutation.VerifiedEmail(); !ok { + return &ValidationError{Name: "verified_email", err: errors.New(`generated: missing required field "Subscriber.verified_email"`)} + } + if _, ok := sc.mutation.VerifiedPhone(); !ok { + return &ValidationError{Name: "verified_phone", err: errors.New(`generated: missing required field "Subscriber.verified_phone"`)} + } + if _, ok := sc.mutation.Active(); !ok { + return &ValidationError{Name: "active", err: errors.New(`generated: missing required field "Subscriber.active"`)} + } + if _, ok := sc.mutation.Token(); !ok { + return &ValidationError{Name: "token", err: errors.New(`generated: missing required field "Subscriber.token"`)} + } + if v, ok := sc.mutation.Token(); ok { + if err := subscriber.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "Subscriber.token": %w`, err)} + } + } + if _, ok := sc.mutation.TTL(); !ok { + return &ValidationError{Name: "ttl", err: errors.New(`generated: missing required field "Subscriber.ttl"`)} + } + if _, ok := sc.mutation.Secret(); !ok { + return &ValidationError{Name: "secret", err: errors.New(`generated: missing required field "Subscriber.secret"`)} + } + if v, ok := sc.mutation.Secret(); ok { + if err := subscriber.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "Subscriber.secret": %w`, err)} + } + } + return nil +} + +func (sc *SubscriberCreate) sqlSave(ctx context.Context) (*Subscriber, error) { + if err := sc.check(); err != nil { + return nil, err + } + _node, _spec := sc.createSpec() + if err := sqlgraph.CreateNode(ctx, sc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Subscriber.ID type: %T", _spec.ID.Value) + } + } + sc.mutation.id = &_node.ID + sc.mutation.done = true + return _node, nil +} + +func (sc *SubscriberCreate) createSpec() (*Subscriber, *sqlgraph.CreateSpec) { + var ( + _node = &Subscriber{config: sc.config} + _spec = sqlgraph.NewCreateSpec(subscriber.Table, sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString)) + ) + _spec.Schema = sc.schemaConfig.Subscriber + if id, ok := sc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := sc.mutation.CreatedAt(); ok { + _spec.SetField(subscriber.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := sc.mutation.UpdatedAt(); ok { + _spec.SetField(subscriber.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := sc.mutation.CreatedBy(); ok { + _spec.SetField(subscriber.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := sc.mutation.UpdatedBy(); ok { + _spec.SetField(subscriber.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := sc.mutation.MappingID(); ok { + _spec.SetField(subscriber.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := sc.mutation.Tags(); ok { + _spec.SetField(subscriber.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := sc.mutation.DeletedAt(); ok { + _spec.SetField(subscriber.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := sc.mutation.DeletedBy(); ok { + _spec.SetField(subscriber.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := sc.mutation.Email(); ok { + _spec.SetField(subscriber.FieldEmail, field.TypeString, value) + _node.Email = value + } + if value, ok := sc.mutation.PhoneNumber(); ok { + _spec.SetField(subscriber.FieldPhoneNumber, field.TypeString, value) + _node.PhoneNumber = value + } + if value, ok := sc.mutation.VerifiedEmail(); ok { + _spec.SetField(subscriber.FieldVerifiedEmail, field.TypeBool, value) + _node.VerifiedEmail = value + } + if value, ok := sc.mutation.VerifiedPhone(); ok { + _spec.SetField(subscriber.FieldVerifiedPhone, field.TypeBool, value) + _node.VerifiedPhone = value + } + if value, ok := sc.mutation.Active(); ok { + _spec.SetField(subscriber.FieldActive, field.TypeBool, value) + _node.Active = value + } + if value, ok := sc.mutation.Token(); ok { + _spec.SetField(subscriber.FieldToken, field.TypeString, value) + _node.Token = value + } + if value, ok := sc.mutation.TTL(); ok { + _spec.SetField(subscriber.FieldTTL, field.TypeTime, value) + _node.TTL = &value + } + if value, ok := sc.mutation.Secret(); ok { + _spec.SetField(subscriber.FieldSecret, field.TypeBytes, value) + _node.Secret = &value + } + if nodes := sc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: subscriber.OwnerTable, + Columns: []string{subscriber.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = sc.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := sc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = sc.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// SubscriberCreateBulk is the builder for creating many Subscriber entities in bulk. +type SubscriberCreateBulk struct { + config + err error + builders []*SubscriberCreate +} + +// Save creates the Subscriber entities in the database. +func (scb *SubscriberCreateBulk) Save(ctx context.Context) ([]*Subscriber, error) { + if scb.err != nil { + return nil, scb.err + } + specs := make([]*sqlgraph.CreateSpec, len(scb.builders)) + nodes := make([]*Subscriber, len(scb.builders)) + mutators := make([]Mutator, len(scb.builders)) + for i := range scb.builders { + func(i int, root context.Context) { + builder := scb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*SubscriberMutation) + 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, scb.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, scb.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, scb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (scb *SubscriberCreateBulk) SaveX(ctx context.Context) []*Subscriber { + v, err := scb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (scb *SubscriberCreateBulk) Exec(ctx context.Context) error { + _, err := scb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (scb *SubscriberCreateBulk) ExecX(ctx context.Context) { + if err := scb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/subscriber_delete.go b/internal/ent/generated/subscriber_delete.go new file mode 100644 index 0000000..789a43a --- /dev/null +++ b/internal/ent/generated/subscriber_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/subscriber" +) + +// SubscriberDelete is the builder for deleting a Subscriber entity. +type SubscriberDelete struct { + config + hooks []Hook + mutation *SubscriberMutation +} + +// Where appends a list predicates to the SubscriberDelete builder. +func (sd *SubscriberDelete) Where(ps ...predicate.Subscriber) *SubscriberDelete { + sd.mutation.Where(ps...) + return sd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (sd *SubscriberDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, sd.sqlExec, sd.mutation, sd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (sd *SubscriberDelete) ExecX(ctx context.Context) int { + n, err := sd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (sd *SubscriberDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(subscriber.Table, sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString)) + _spec.Node.Schema = sd.schemaConfig.Subscriber + ctx = internal.NewSchemaConfigContext(ctx, sd.schemaConfig) + if ps := sd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, sd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + sd.mutation.done = true + return affected, err +} + +// SubscriberDeleteOne is the builder for deleting a single Subscriber entity. +type SubscriberDeleteOne struct { + sd *SubscriberDelete +} + +// Where appends a list predicates to the SubscriberDelete builder. +func (sdo *SubscriberDeleteOne) Where(ps ...predicate.Subscriber) *SubscriberDeleteOne { + sdo.sd.mutation.Where(ps...) + return sdo +} + +// Exec executes the deletion query. +func (sdo *SubscriberDeleteOne) Exec(ctx context.Context) error { + n, err := sdo.sd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{subscriber.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (sdo *SubscriberDeleteOne) ExecX(ctx context.Context) { + if err := sdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/subscriber_query.go b/internal/ent/generated/subscriber_query.go new file mode 100644 index 0000000..6c153dc --- /dev/null +++ b/internal/ent/generated/subscriber_query.go @@ -0,0 +1,770 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// SubscriberQuery is the builder for querying Subscriber entities. +type SubscriberQuery struct { + config + ctx *QueryContext + order []subscriber.OrderOption + inters []Interceptor + predicates []predicate.Subscriber + withOwner *OrganizationQuery + withEvents *EventQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Subscriber) error + withNamedEvents map[string]*EventQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the SubscriberQuery builder. +func (sq *SubscriberQuery) Where(ps ...predicate.Subscriber) *SubscriberQuery { + sq.predicates = append(sq.predicates, ps...) + return sq +} + +// Limit the number of records to be returned by this query. +func (sq *SubscriberQuery) Limit(limit int) *SubscriberQuery { + sq.ctx.Limit = &limit + return sq +} + +// Offset to start from. +func (sq *SubscriberQuery) Offset(offset int) *SubscriberQuery { + sq.ctx.Offset = &offset + return sq +} + +// 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 (sq *SubscriberQuery) Unique(unique bool) *SubscriberQuery { + sq.ctx.Unique = &unique + return sq +} + +// Order specifies how the records should be ordered. +func (sq *SubscriberQuery) Order(o ...subscriber.OrderOption) *SubscriberQuery { + sq.order = append(sq.order, o...) + return sq +} + +// QueryOwner chains the current query on the "owner" edge. +func (sq *SubscriberQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: sq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := sq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := sq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(subscriber.Table, subscriber.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, subscriber.OwnerTable, subscriber.OwnerColumn), + ) + schemaConfig := sq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Subscriber + fromU = sqlgraph.SetNeighbors(sq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (sq *SubscriberQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: sq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := sq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := sq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(subscriber.Table, subscriber.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, subscriber.EventsTable, subscriber.EventsPrimaryKey...), + ) + schemaConfig := sq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.SubscriberEvents + fromU = sqlgraph.SetNeighbors(sq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Subscriber entity from the query. +// Returns a *NotFoundError when no Subscriber was found. +func (sq *SubscriberQuery) First(ctx context.Context) (*Subscriber, error) { + nodes, err := sq.Limit(1).All(setContextOp(ctx, sq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{subscriber.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (sq *SubscriberQuery) FirstX(ctx context.Context) *Subscriber { + node, err := sq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Subscriber ID from the query. +// Returns a *NotFoundError when no Subscriber ID was found. +func (sq *SubscriberQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = sq.Limit(1).IDs(setContextOp(ctx, sq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{subscriber.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (sq *SubscriberQuery) FirstIDX(ctx context.Context) string { + id, err := sq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Subscriber entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Subscriber entity is found. +// Returns a *NotFoundError when no Subscriber entities are found. +func (sq *SubscriberQuery) Only(ctx context.Context) (*Subscriber, error) { + nodes, err := sq.Limit(2).All(setContextOp(ctx, sq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{subscriber.Label} + default: + return nil, &NotSingularError{subscriber.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (sq *SubscriberQuery) OnlyX(ctx context.Context) *Subscriber { + node, err := sq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Subscriber ID in the query. +// Returns a *NotSingularError when more than one Subscriber ID is found. +// Returns a *NotFoundError when no entities are found. +func (sq *SubscriberQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = sq.Limit(2).IDs(setContextOp(ctx, sq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{subscriber.Label} + default: + err = &NotSingularError{subscriber.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (sq *SubscriberQuery) OnlyIDX(ctx context.Context) string { + id, err := sq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Subscribers. +func (sq *SubscriberQuery) All(ctx context.Context) ([]*Subscriber, error) { + ctx = setContextOp(ctx, sq.ctx, ent.OpQueryAll) + if err := sq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Subscriber, *SubscriberQuery]() + return withInterceptors[[]*Subscriber](ctx, sq, qr, sq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (sq *SubscriberQuery) AllX(ctx context.Context) []*Subscriber { + nodes, err := sq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Subscriber IDs. +func (sq *SubscriberQuery) IDs(ctx context.Context) (ids []string, err error) { + if sq.ctx.Unique == nil && sq.path != nil { + sq.Unique(true) + } + ctx = setContextOp(ctx, sq.ctx, ent.OpQueryIDs) + if err = sq.Select(subscriber.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (sq *SubscriberQuery) IDsX(ctx context.Context) []string { + ids, err := sq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (sq *SubscriberQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, sq.ctx, ent.OpQueryCount) + if err := sq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, sq, querierCount[*SubscriberQuery](), sq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (sq *SubscriberQuery) CountX(ctx context.Context) int { + count, err := sq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (sq *SubscriberQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, sq.ctx, ent.OpQueryExist) + switch _, err := sq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (sq *SubscriberQuery) ExistX(ctx context.Context) bool { + exist, err := sq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the SubscriberQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (sq *SubscriberQuery) Clone() *SubscriberQuery { + if sq == nil { + return nil + } + return &SubscriberQuery{ + config: sq.config, + ctx: sq.ctx.Clone(), + order: append([]subscriber.OrderOption{}, sq.order...), + inters: append([]Interceptor{}, sq.inters...), + predicates: append([]predicate.Subscriber{}, sq.predicates...), + withOwner: sq.withOwner.Clone(), + withEvents: sq.withEvents.Clone(), + // clone intermediate query. + sql: sq.sql.Clone(), + path: sq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (sq *SubscriberQuery) WithOwner(opts ...func(*OrganizationQuery)) *SubscriberQuery { + query := (&OrganizationClient{config: sq.config}).Query() + for _, opt := range opts { + opt(query) + } + sq.withOwner = query + return sq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (sq *SubscriberQuery) WithEvents(opts ...func(*EventQuery)) *SubscriberQuery { + query := (&EventClient{config: sq.config}).Query() + for _, opt := range opts { + opt(query) + } + sq.withEvents = query + return sq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Subscriber.Query(). +// GroupBy(subscriber.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (sq *SubscriberQuery) GroupBy(field string, fields ...string) *SubscriberGroupBy { + sq.ctx.Fields = append([]string{field}, fields...) + grbuild := &SubscriberGroupBy{build: sq} + grbuild.flds = &sq.ctx.Fields + grbuild.label = subscriber.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Subscriber.Query(). +// Select(subscriber.FieldCreatedAt). +// Scan(ctx, &v) +func (sq *SubscriberQuery) Select(fields ...string) *SubscriberSelect { + sq.ctx.Fields = append(sq.ctx.Fields, fields...) + sbuild := &SubscriberSelect{SubscriberQuery: sq} + sbuild.label = subscriber.Label + sbuild.flds, sbuild.scan = &sq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a SubscriberSelect configured with the given aggregations. +func (sq *SubscriberQuery) Aggregate(fns ...AggregateFunc) *SubscriberSelect { + return sq.Select().Aggregate(fns...) +} + +func (sq *SubscriberQuery) prepareQuery(ctx context.Context) error { + for _, inter := range sq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, sq); err != nil { + return err + } + } + } + for _, f := range sq.ctx.Fields { + if !subscriber.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if sq.path != nil { + prev, err := sq.path(ctx) + if err != nil { + return err + } + sq.sql = prev + } + if subscriber.Policy == nil { + return errors.New("generated: uninitialized subscriber.Policy (forgotten import generated/runtime?)") + } + if err := subscriber.Policy.EvalQuery(ctx, sq); err != nil { + return err + } + return nil +} + +func (sq *SubscriberQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Subscriber, error) { + var ( + nodes = []*Subscriber{} + _spec = sq.querySpec() + loadedTypes = [2]bool{ + sq.withOwner != nil, + sq.withEvents != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Subscriber).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Subscriber{config: sq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = sq.schemaConfig.Subscriber + ctx = internal.NewSchemaConfigContext(ctx, sq.schemaConfig) + if len(sq.modifiers) > 0 { + _spec.Modifiers = sq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, sq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := sq.withOwner; query != nil { + if err := sq.loadOwner(ctx, query, nodes, nil, + func(n *Subscriber, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := sq.withEvents; query != nil { + if err := sq.loadEvents(ctx, query, nodes, + func(n *Subscriber) { n.Edges.Events = []*Event{} }, + func(n *Subscriber, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + for name, query := range sq.withNamedEvents { + if err := sq.loadEvents(ctx, query, nodes, + func(n *Subscriber) { n.appendNamedEvents(name) }, + func(n *Subscriber, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for i := range sq.loadTotal { + if err := sq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (sq *SubscriberQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Subscriber, init func(*Subscriber), assign func(*Subscriber, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Subscriber) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (sq *SubscriberQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Subscriber, init func(*Subscriber), assign func(*Subscriber, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Subscriber) + nids := make(map[string]map[*Subscriber]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(subscriber.EventsTable) + joinT.Schema(sq.schemaConfig.SubscriberEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(subscriber.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(subscriber.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(subscriber.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Subscriber]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (sq *SubscriberQuery) sqlCount(ctx context.Context) (int, error) { + _spec := sq.querySpec() + _spec.Node.Schema = sq.schemaConfig.Subscriber + ctx = internal.NewSchemaConfigContext(ctx, sq.schemaConfig) + if len(sq.modifiers) > 0 { + _spec.Modifiers = sq.modifiers + } + _spec.Node.Columns = sq.ctx.Fields + if len(sq.ctx.Fields) > 0 { + _spec.Unique = sq.ctx.Unique != nil && *sq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, sq.driver, _spec) +} + +func (sq *SubscriberQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(subscriber.Table, subscriber.Columns, sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString)) + _spec.From = sq.sql + if unique := sq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if sq.path != nil { + _spec.Unique = true + } + if fields := sq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, subscriber.FieldID) + for i := range fields { + if fields[i] != subscriber.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if sq.withOwner != nil { + _spec.Node.AddColumnOnce(subscriber.FieldOwnerID) + } + } + if ps := sq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := sq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := sq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := sq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (sq *SubscriberQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(sq.driver.Dialect()) + t1 := builder.Table(subscriber.Table) + columns := sq.ctx.Fields + if len(columns) == 0 { + columns = subscriber.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if sq.sql != nil { + selector = sq.sql + selector.Select(selector.Columns(columns...)...) + } + if sq.ctx.Unique != nil && *sq.ctx.Unique { + selector.Distinct() + } + t1.Schema(sq.schemaConfig.Subscriber) + ctx = internal.NewSchemaConfigContext(ctx, sq.schemaConfig) + selector.WithContext(ctx) + for _, p := range sq.predicates { + p(selector) + } + for _, p := range sq.order { + p(selector) + } + if offset := sq.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 := sq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (sq *SubscriberQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *SubscriberQuery { + query := (&EventClient{config: sq.config}).Query() + for _, opt := range opts { + opt(query) + } + if sq.withNamedEvents == nil { + sq.withNamedEvents = make(map[string]*EventQuery) + } + sq.withNamedEvents[name] = query + return sq +} + +// SubscriberGroupBy is the group-by builder for Subscriber entities. +type SubscriberGroupBy struct { + selector + build *SubscriberQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (sgb *SubscriberGroupBy) Aggregate(fns ...AggregateFunc) *SubscriberGroupBy { + sgb.fns = append(sgb.fns, fns...) + return sgb +} + +// Scan applies the selector query and scans the result into the given value. +func (sgb *SubscriberGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, sgb.build.ctx, ent.OpQueryGroupBy) + if err := sgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*SubscriberQuery, *SubscriberGroupBy](ctx, sgb.build, sgb, sgb.build.inters, v) +} + +func (sgb *SubscriberGroupBy) sqlScan(ctx context.Context, root *SubscriberQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(sgb.fns)) + for _, fn := range sgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*sgb.flds)+len(sgb.fns)) + for _, f := range *sgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*sgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := sgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// SubscriberSelect is the builder for selecting fields of Subscriber entities. +type SubscriberSelect struct { + *SubscriberQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ss *SubscriberSelect) Aggregate(fns ...AggregateFunc) *SubscriberSelect { + ss.fns = append(ss.fns, fns...) + return ss +} + +// Scan applies the selector query and scans the result into the given value. +func (ss *SubscriberSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ss.ctx, ent.OpQuerySelect) + if err := ss.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*SubscriberQuery, *SubscriberSelect](ctx, ss.SubscriberQuery, ss, ss.inters, v) +} + +func (ss *SubscriberSelect) sqlScan(ctx context.Context, root *SubscriberQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ss.fns)) + for _, fn := range ss.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ss.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 := ss.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/subscriber_update.go b/internal/ent/generated/subscriber_update.go new file mode 100644 index 0000000..9454578 --- /dev/null +++ b/internal/ent/generated/subscriber_update.go @@ -0,0 +1,1109 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// SubscriberUpdate is the builder for updating Subscriber entities. +type SubscriberUpdate struct { + config + hooks []Hook + mutation *SubscriberMutation +} + +// Where appends a list predicates to the SubscriberUpdate builder. +func (su *SubscriberUpdate) Where(ps ...predicate.Subscriber) *SubscriberUpdate { + su.mutation.Where(ps...) + return su +} + +// SetUpdatedAt sets the "updated_at" field. +func (su *SubscriberUpdate) SetUpdatedAt(t time.Time) *SubscriberUpdate { + su.mutation.SetUpdatedAt(t) + return su +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (su *SubscriberUpdate) ClearUpdatedAt() *SubscriberUpdate { + su.mutation.ClearUpdatedAt() + return su +} + +// SetUpdatedBy sets the "updated_by" field. +func (su *SubscriberUpdate) SetUpdatedBy(s string) *SubscriberUpdate { + su.mutation.SetUpdatedBy(s) + return su +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableUpdatedBy(s *string) *SubscriberUpdate { + if s != nil { + su.SetUpdatedBy(*s) + } + return su +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (su *SubscriberUpdate) ClearUpdatedBy() *SubscriberUpdate { + su.mutation.ClearUpdatedBy() + return su +} + +// SetTags sets the "tags" field. +func (su *SubscriberUpdate) SetTags(s []string) *SubscriberUpdate { + su.mutation.SetTags(s) + return su +} + +// AppendTags appends s to the "tags" field. +func (su *SubscriberUpdate) AppendTags(s []string) *SubscriberUpdate { + su.mutation.AppendTags(s) + return su +} + +// ClearTags clears the value of the "tags" field. +func (su *SubscriberUpdate) ClearTags() *SubscriberUpdate { + su.mutation.ClearTags() + return su +} + +// SetDeletedAt sets the "deleted_at" field. +func (su *SubscriberUpdate) SetDeletedAt(t time.Time) *SubscriberUpdate { + su.mutation.SetDeletedAt(t) + return su +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableDeletedAt(t *time.Time) *SubscriberUpdate { + if t != nil { + su.SetDeletedAt(*t) + } + return su +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (su *SubscriberUpdate) ClearDeletedAt() *SubscriberUpdate { + su.mutation.ClearDeletedAt() + return su +} + +// SetDeletedBy sets the "deleted_by" field. +func (su *SubscriberUpdate) SetDeletedBy(s string) *SubscriberUpdate { + su.mutation.SetDeletedBy(s) + return su +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableDeletedBy(s *string) *SubscriberUpdate { + if s != nil { + su.SetDeletedBy(*s) + } + return su +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (su *SubscriberUpdate) ClearDeletedBy() *SubscriberUpdate { + su.mutation.ClearDeletedBy() + return su +} + +// SetOwnerID sets the "owner_id" field. +func (su *SubscriberUpdate) SetOwnerID(s string) *SubscriberUpdate { + su.mutation.SetOwnerID(s) + return su +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableOwnerID(s *string) *SubscriberUpdate { + if s != nil { + su.SetOwnerID(*s) + } + return su +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (su *SubscriberUpdate) ClearOwnerID() *SubscriberUpdate { + su.mutation.ClearOwnerID() + return su +} + +// SetEmail sets the "email" field. +func (su *SubscriberUpdate) SetEmail(s string) *SubscriberUpdate { + su.mutation.SetEmail(s) + return su +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableEmail(s *string) *SubscriberUpdate { + if s != nil { + su.SetEmail(*s) + } + return su +} + +// SetPhoneNumber sets the "phone_number" field. +func (su *SubscriberUpdate) SetPhoneNumber(s string) *SubscriberUpdate { + su.mutation.SetPhoneNumber(s) + return su +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillablePhoneNumber(s *string) *SubscriberUpdate { + if s != nil { + su.SetPhoneNumber(*s) + } + return su +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (su *SubscriberUpdate) ClearPhoneNumber() *SubscriberUpdate { + su.mutation.ClearPhoneNumber() + return su +} + +// SetVerifiedEmail sets the "verified_email" field. +func (su *SubscriberUpdate) SetVerifiedEmail(b bool) *SubscriberUpdate { + su.mutation.SetVerifiedEmail(b) + return su +} + +// SetNillableVerifiedEmail sets the "verified_email" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableVerifiedEmail(b *bool) *SubscriberUpdate { + if b != nil { + su.SetVerifiedEmail(*b) + } + return su +} + +// SetVerifiedPhone sets the "verified_phone" field. +func (su *SubscriberUpdate) SetVerifiedPhone(b bool) *SubscriberUpdate { + su.mutation.SetVerifiedPhone(b) + return su +} + +// SetNillableVerifiedPhone sets the "verified_phone" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableVerifiedPhone(b *bool) *SubscriberUpdate { + if b != nil { + su.SetVerifiedPhone(*b) + } + return su +} + +// SetActive sets the "active" field. +func (su *SubscriberUpdate) SetActive(b bool) *SubscriberUpdate { + su.mutation.SetActive(b) + return su +} + +// SetNillableActive sets the "active" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableActive(b *bool) *SubscriberUpdate { + if b != nil { + su.SetActive(*b) + } + return su +} + +// SetToken sets the "token" field. +func (su *SubscriberUpdate) SetToken(s string) *SubscriberUpdate { + su.mutation.SetToken(s) + return su +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableToken(s *string) *SubscriberUpdate { + if s != nil { + su.SetToken(*s) + } + return su +} + +// SetTTL sets the "ttl" field. +func (su *SubscriberUpdate) SetTTL(t time.Time) *SubscriberUpdate { + su.mutation.SetTTL(t) + return su +} + +// SetNillableTTL sets the "ttl" field if the given value is not nil. +func (su *SubscriberUpdate) SetNillableTTL(t *time.Time) *SubscriberUpdate { + if t != nil { + su.SetTTL(*t) + } + return su +} + +// SetSecret sets the "secret" field. +func (su *SubscriberUpdate) SetSecret(b []byte) *SubscriberUpdate { + su.mutation.SetSecret(b) + return su +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (su *SubscriberUpdate) SetOwner(o *Organization) *SubscriberUpdate { + return su.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (su *SubscriberUpdate) AddEventIDs(ids ...string) *SubscriberUpdate { + su.mutation.AddEventIDs(ids...) + return su +} + +// AddEvents adds the "events" edges to the Event entity. +func (su *SubscriberUpdate) AddEvents(e ...*Event) *SubscriberUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return su.AddEventIDs(ids...) +} + +// Mutation returns the SubscriberMutation object of the builder. +func (su *SubscriberUpdate) Mutation() *SubscriberMutation { + return su.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (su *SubscriberUpdate) ClearOwner() *SubscriberUpdate { + su.mutation.ClearOwner() + return su +} + +// ClearEvents clears all "events" edges to the Event entity. +func (su *SubscriberUpdate) ClearEvents() *SubscriberUpdate { + su.mutation.ClearEvents() + return su +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (su *SubscriberUpdate) RemoveEventIDs(ids ...string) *SubscriberUpdate { + su.mutation.RemoveEventIDs(ids...) + return su +} + +// RemoveEvents removes "events" edges to Event entities. +func (su *SubscriberUpdate) RemoveEvents(e ...*Event) *SubscriberUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return su.RemoveEventIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (su *SubscriberUpdate) Save(ctx context.Context) (int, error) { + if err := su.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, su.sqlSave, su.mutation, su.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (su *SubscriberUpdate) SaveX(ctx context.Context) int { + affected, err := su.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (su *SubscriberUpdate) Exec(ctx context.Context) error { + _, err := su.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (su *SubscriberUpdate) ExecX(ctx context.Context) { + if err := su.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (su *SubscriberUpdate) defaults() error { + if _, ok := su.mutation.UpdatedAt(); !ok && !su.mutation.UpdatedAtCleared() { + if subscriber.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized subscriber.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := subscriber.UpdateDefaultUpdatedAt() + su.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (su *SubscriberUpdate) check() error { + if v, ok := su.mutation.OwnerID(); ok { + if err := subscriber.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Subscriber.owner_id": %w`, err)} + } + } + if v, ok := su.mutation.Email(); ok { + if err := subscriber.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "Subscriber.email": %w`, err)} + } + } + if v, ok := su.mutation.PhoneNumber(); ok { + if err := subscriber.PhoneNumberValidator(v); err != nil { + return &ValidationError{Name: "phone_number", err: fmt.Errorf(`generated: validator failed for field "Subscriber.phone_number": %w`, err)} + } + } + if v, ok := su.mutation.Token(); ok { + if err := subscriber.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "Subscriber.token": %w`, err)} + } + } + if v, ok := su.mutation.Secret(); ok { + if err := subscriber.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "Subscriber.secret": %w`, err)} + } + } + return nil +} + +func (su *SubscriberUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := su.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(subscriber.Table, subscriber.Columns, sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString)) + if ps := su.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if su.mutation.CreatedAtCleared() { + _spec.ClearField(subscriber.FieldCreatedAt, field.TypeTime) + } + if value, ok := su.mutation.UpdatedAt(); ok { + _spec.SetField(subscriber.FieldUpdatedAt, field.TypeTime, value) + } + if su.mutation.UpdatedAtCleared() { + _spec.ClearField(subscriber.FieldUpdatedAt, field.TypeTime) + } + if su.mutation.CreatedByCleared() { + _spec.ClearField(subscriber.FieldCreatedBy, field.TypeString) + } + if value, ok := su.mutation.UpdatedBy(); ok { + _spec.SetField(subscriber.FieldUpdatedBy, field.TypeString, value) + } + if su.mutation.UpdatedByCleared() { + _spec.ClearField(subscriber.FieldUpdatedBy, field.TypeString) + } + if value, ok := su.mutation.Tags(); ok { + _spec.SetField(subscriber.FieldTags, field.TypeJSON, value) + } + if value, ok := su.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, subscriber.FieldTags, value) + }) + } + if su.mutation.TagsCleared() { + _spec.ClearField(subscriber.FieldTags, field.TypeJSON) + } + if value, ok := su.mutation.DeletedAt(); ok { + _spec.SetField(subscriber.FieldDeletedAt, field.TypeTime, value) + } + if su.mutation.DeletedAtCleared() { + _spec.ClearField(subscriber.FieldDeletedAt, field.TypeTime) + } + if value, ok := su.mutation.DeletedBy(); ok { + _spec.SetField(subscriber.FieldDeletedBy, field.TypeString, value) + } + if su.mutation.DeletedByCleared() { + _spec.ClearField(subscriber.FieldDeletedBy, field.TypeString) + } + if value, ok := su.mutation.Email(); ok { + _spec.SetField(subscriber.FieldEmail, field.TypeString, value) + } + if value, ok := su.mutation.PhoneNumber(); ok { + _spec.SetField(subscriber.FieldPhoneNumber, field.TypeString, value) + } + if su.mutation.PhoneNumberCleared() { + _spec.ClearField(subscriber.FieldPhoneNumber, field.TypeString) + } + if value, ok := su.mutation.VerifiedEmail(); ok { + _spec.SetField(subscriber.FieldVerifiedEmail, field.TypeBool, value) + } + if value, ok := su.mutation.VerifiedPhone(); ok { + _spec.SetField(subscriber.FieldVerifiedPhone, field.TypeBool, value) + } + if value, ok := su.mutation.Active(); ok { + _spec.SetField(subscriber.FieldActive, field.TypeBool, value) + } + if value, ok := su.mutation.Token(); ok { + _spec.SetField(subscriber.FieldToken, field.TypeString, value) + } + if value, ok := su.mutation.TTL(); ok { + _spec.SetField(subscriber.FieldTTL, field.TypeTime, value) + } + if value, ok := su.mutation.Secret(); ok { + _spec.SetField(subscriber.FieldSecret, field.TypeBytes, value) + } + if su.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: subscriber.OwnerTable, + Columns: []string{subscriber.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = su.schemaConfig.Subscriber + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := su.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: subscriber.OwnerTable, + Columns: []string{subscriber.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = su.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if su.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = su.schemaConfig.SubscriberEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := su.mutation.RemovedEventsIDs(); len(nodes) > 0 && !su.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = su.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := su.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = su.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = su.schemaConfig.Subscriber + ctx = internal.NewSchemaConfigContext(ctx, su.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, su.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{subscriber.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + su.mutation.done = true + return n, nil +} + +// SubscriberUpdateOne is the builder for updating a single Subscriber entity. +type SubscriberUpdateOne struct { + config + fields []string + hooks []Hook + mutation *SubscriberMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (suo *SubscriberUpdateOne) SetUpdatedAt(t time.Time) *SubscriberUpdateOne { + suo.mutation.SetUpdatedAt(t) + return suo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (suo *SubscriberUpdateOne) ClearUpdatedAt() *SubscriberUpdateOne { + suo.mutation.ClearUpdatedAt() + return suo +} + +// SetUpdatedBy sets the "updated_by" field. +func (suo *SubscriberUpdateOne) SetUpdatedBy(s string) *SubscriberUpdateOne { + suo.mutation.SetUpdatedBy(s) + return suo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableUpdatedBy(s *string) *SubscriberUpdateOne { + if s != nil { + suo.SetUpdatedBy(*s) + } + return suo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (suo *SubscriberUpdateOne) ClearUpdatedBy() *SubscriberUpdateOne { + suo.mutation.ClearUpdatedBy() + return suo +} + +// SetTags sets the "tags" field. +func (suo *SubscriberUpdateOne) SetTags(s []string) *SubscriberUpdateOne { + suo.mutation.SetTags(s) + return suo +} + +// AppendTags appends s to the "tags" field. +func (suo *SubscriberUpdateOne) AppendTags(s []string) *SubscriberUpdateOne { + suo.mutation.AppendTags(s) + return suo +} + +// ClearTags clears the value of the "tags" field. +func (suo *SubscriberUpdateOne) ClearTags() *SubscriberUpdateOne { + suo.mutation.ClearTags() + return suo +} + +// SetDeletedAt sets the "deleted_at" field. +func (suo *SubscriberUpdateOne) SetDeletedAt(t time.Time) *SubscriberUpdateOne { + suo.mutation.SetDeletedAt(t) + return suo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableDeletedAt(t *time.Time) *SubscriberUpdateOne { + if t != nil { + suo.SetDeletedAt(*t) + } + return suo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (suo *SubscriberUpdateOne) ClearDeletedAt() *SubscriberUpdateOne { + suo.mutation.ClearDeletedAt() + return suo +} + +// SetDeletedBy sets the "deleted_by" field. +func (suo *SubscriberUpdateOne) SetDeletedBy(s string) *SubscriberUpdateOne { + suo.mutation.SetDeletedBy(s) + return suo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableDeletedBy(s *string) *SubscriberUpdateOne { + if s != nil { + suo.SetDeletedBy(*s) + } + return suo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (suo *SubscriberUpdateOne) ClearDeletedBy() *SubscriberUpdateOne { + suo.mutation.ClearDeletedBy() + return suo +} + +// SetOwnerID sets the "owner_id" field. +func (suo *SubscriberUpdateOne) SetOwnerID(s string) *SubscriberUpdateOne { + suo.mutation.SetOwnerID(s) + return suo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableOwnerID(s *string) *SubscriberUpdateOne { + if s != nil { + suo.SetOwnerID(*s) + } + return suo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (suo *SubscriberUpdateOne) ClearOwnerID() *SubscriberUpdateOne { + suo.mutation.ClearOwnerID() + return suo +} + +// SetEmail sets the "email" field. +func (suo *SubscriberUpdateOne) SetEmail(s string) *SubscriberUpdateOne { + suo.mutation.SetEmail(s) + return suo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableEmail(s *string) *SubscriberUpdateOne { + if s != nil { + suo.SetEmail(*s) + } + return suo +} + +// SetPhoneNumber sets the "phone_number" field. +func (suo *SubscriberUpdateOne) SetPhoneNumber(s string) *SubscriberUpdateOne { + suo.mutation.SetPhoneNumber(s) + return suo +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillablePhoneNumber(s *string) *SubscriberUpdateOne { + if s != nil { + suo.SetPhoneNumber(*s) + } + return suo +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (suo *SubscriberUpdateOne) ClearPhoneNumber() *SubscriberUpdateOne { + suo.mutation.ClearPhoneNumber() + return suo +} + +// SetVerifiedEmail sets the "verified_email" field. +func (suo *SubscriberUpdateOne) SetVerifiedEmail(b bool) *SubscriberUpdateOne { + suo.mutation.SetVerifiedEmail(b) + return suo +} + +// SetNillableVerifiedEmail sets the "verified_email" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableVerifiedEmail(b *bool) *SubscriberUpdateOne { + if b != nil { + suo.SetVerifiedEmail(*b) + } + return suo +} + +// SetVerifiedPhone sets the "verified_phone" field. +func (suo *SubscriberUpdateOne) SetVerifiedPhone(b bool) *SubscriberUpdateOne { + suo.mutation.SetVerifiedPhone(b) + return suo +} + +// SetNillableVerifiedPhone sets the "verified_phone" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableVerifiedPhone(b *bool) *SubscriberUpdateOne { + if b != nil { + suo.SetVerifiedPhone(*b) + } + return suo +} + +// SetActive sets the "active" field. +func (suo *SubscriberUpdateOne) SetActive(b bool) *SubscriberUpdateOne { + suo.mutation.SetActive(b) + return suo +} + +// SetNillableActive sets the "active" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableActive(b *bool) *SubscriberUpdateOne { + if b != nil { + suo.SetActive(*b) + } + return suo +} + +// SetToken sets the "token" field. +func (suo *SubscriberUpdateOne) SetToken(s string) *SubscriberUpdateOne { + suo.mutation.SetToken(s) + return suo +} + +// SetNillableToken sets the "token" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableToken(s *string) *SubscriberUpdateOne { + if s != nil { + suo.SetToken(*s) + } + return suo +} + +// SetTTL sets the "ttl" field. +func (suo *SubscriberUpdateOne) SetTTL(t time.Time) *SubscriberUpdateOne { + suo.mutation.SetTTL(t) + return suo +} + +// SetNillableTTL sets the "ttl" field if the given value is not nil. +func (suo *SubscriberUpdateOne) SetNillableTTL(t *time.Time) *SubscriberUpdateOne { + if t != nil { + suo.SetTTL(*t) + } + return suo +} + +// SetSecret sets the "secret" field. +func (suo *SubscriberUpdateOne) SetSecret(b []byte) *SubscriberUpdateOne { + suo.mutation.SetSecret(b) + return suo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (suo *SubscriberUpdateOne) SetOwner(o *Organization) *SubscriberUpdateOne { + return suo.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (suo *SubscriberUpdateOne) AddEventIDs(ids ...string) *SubscriberUpdateOne { + suo.mutation.AddEventIDs(ids...) + return suo +} + +// AddEvents adds the "events" edges to the Event entity. +func (suo *SubscriberUpdateOne) AddEvents(e ...*Event) *SubscriberUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return suo.AddEventIDs(ids...) +} + +// Mutation returns the SubscriberMutation object of the builder. +func (suo *SubscriberUpdateOne) Mutation() *SubscriberMutation { + return suo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (suo *SubscriberUpdateOne) ClearOwner() *SubscriberUpdateOne { + suo.mutation.ClearOwner() + return suo +} + +// ClearEvents clears all "events" edges to the Event entity. +func (suo *SubscriberUpdateOne) ClearEvents() *SubscriberUpdateOne { + suo.mutation.ClearEvents() + return suo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (suo *SubscriberUpdateOne) RemoveEventIDs(ids ...string) *SubscriberUpdateOne { + suo.mutation.RemoveEventIDs(ids...) + return suo +} + +// RemoveEvents removes "events" edges to Event entities. +func (suo *SubscriberUpdateOne) RemoveEvents(e ...*Event) *SubscriberUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return suo.RemoveEventIDs(ids...) +} + +// Where appends a list predicates to the SubscriberUpdate builder. +func (suo *SubscriberUpdateOne) Where(ps ...predicate.Subscriber) *SubscriberUpdateOne { + suo.mutation.Where(ps...) + return suo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (suo *SubscriberUpdateOne) Select(field string, fields ...string) *SubscriberUpdateOne { + suo.fields = append([]string{field}, fields...) + return suo +} + +// Save executes the query and returns the updated Subscriber entity. +func (suo *SubscriberUpdateOne) Save(ctx context.Context) (*Subscriber, error) { + if err := suo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, suo.sqlSave, suo.mutation, suo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (suo *SubscriberUpdateOne) SaveX(ctx context.Context) *Subscriber { + node, err := suo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (suo *SubscriberUpdateOne) Exec(ctx context.Context) error { + _, err := suo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (suo *SubscriberUpdateOne) ExecX(ctx context.Context) { + if err := suo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (suo *SubscriberUpdateOne) defaults() error { + if _, ok := suo.mutation.UpdatedAt(); !ok && !suo.mutation.UpdatedAtCleared() { + if subscriber.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized subscriber.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := subscriber.UpdateDefaultUpdatedAt() + suo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (suo *SubscriberUpdateOne) check() error { + if v, ok := suo.mutation.OwnerID(); ok { + if err := subscriber.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Subscriber.owner_id": %w`, err)} + } + } + if v, ok := suo.mutation.Email(); ok { + if err := subscriber.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "Subscriber.email": %w`, err)} + } + } + if v, ok := suo.mutation.PhoneNumber(); ok { + if err := subscriber.PhoneNumberValidator(v); err != nil { + return &ValidationError{Name: "phone_number", err: fmt.Errorf(`generated: validator failed for field "Subscriber.phone_number": %w`, err)} + } + } + if v, ok := suo.mutation.Token(); ok { + if err := subscriber.TokenValidator(v); err != nil { + return &ValidationError{Name: "token", err: fmt.Errorf(`generated: validator failed for field "Subscriber.token": %w`, err)} + } + } + if v, ok := suo.mutation.Secret(); ok { + if err := subscriber.SecretValidator(v); err != nil { + return &ValidationError{Name: "secret", err: fmt.Errorf(`generated: validator failed for field "Subscriber.secret": %w`, err)} + } + } + return nil +} + +func (suo *SubscriberUpdateOne) sqlSave(ctx context.Context) (_node *Subscriber, err error) { + if err := suo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(subscriber.Table, subscriber.Columns, sqlgraph.NewFieldSpec(subscriber.FieldID, field.TypeString)) + id, ok := suo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Subscriber.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := suo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, subscriber.FieldID) + for _, f := range fields { + if !subscriber.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != subscriber.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := suo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if suo.mutation.CreatedAtCleared() { + _spec.ClearField(subscriber.FieldCreatedAt, field.TypeTime) + } + if value, ok := suo.mutation.UpdatedAt(); ok { + _spec.SetField(subscriber.FieldUpdatedAt, field.TypeTime, value) + } + if suo.mutation.UpdatedAtCleared() { + _spec.ClearField(subscriber.FieldUpdatedAt, field.TypeTime) + } + if suo.mutation.CreatedByCleared() { + _spec.ClearField(subscriber.FieldCreatedBy, field.TypeString) + } + if value, ok := suo.mutation.UpdatedBy(); ok { + _spec.SetField(subscriber.FieldUpdatedBy, field.TypeString, value) + } + if suo.mutation.UpdatedByCleared() { + _spec.ClearField(subscriber.FieldUpdatedBy, field.TypeString) + } + if value, ok := suo.mutation.Tags(); ok { + _spec.SetField(subscriber.FieldTags, field.TypeJSON, value) + } + if value, ok := suo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, subscriber.FieldTags, value) + }) + } + if suo.mutation.TagsCleared() { + _spec.ClearField(subscriber.FieldTags, field.TypeJSON) + } + if value, ok := suo.mutation.DeletedAt(); ok { + _spec.SetField(subscriber.FieldDeletedAt, field.TypeTime, value) + } + if suo.mutation.DeletedAtCleared() { + _spec.ClearField(subscriber.FieldDeletedAt, field.TypeTime) + } + if value, ok := suo.mutation.DeletedBy(); ok { + _spec.SetField(subscriber.FieldDeletedBy, field.TypeString, value) + } + if suo.mutation.DeletedByCleared() { + _spec.ClearField(subscriber.FieldDeletedBy, field.TypeString) + } + if value, ok := suo.mutation.Email(); ok { + _spec.SetField(subscriber.FieldEmail, field.TypeString, value) + } + if value, ok := suo.mutation.PhoneNumber(); ok { + _spec.SetField(subscriber.FieldPhoneNumber, field.TypeString, value) + } + if suo.mutation.PhoneNumberCleared() { + _spec.ClearField(subscriber.FieldPhoneNumber, field.TypeString) + } + if value, ok := suo.mutation.VerifiedEmail(); ok { + _spec.SetField(subscriber.FieldVerifiedEmail, field.TypeBool, value) + } + if value, ok := suo.mutation.VerifiedPhone(); ok { + _spec.SetField(subscriber.FieldVerifiedPhone, field.TypeBool, value) + } + if value, ok := suo.mutation.Active(); ok { + _spec.SetField(subscriber.FieldActive, field.TypeBool, value) + } + if value, ok := suo.mutation.Token(); ok { + _spec.SetField(subscriber.FieldToken, field.TypeString, value) + } + if value, ok := suo.mutation.TTL(); ok { + _spec.SetField(subscriber.FieldTTL, field.TypeTime, value) + } + if value, ok := suo.mutation.Secret(); ok { + _spec.SetField(subscriber.FieldSecret, field.TypeBytes, value) + } + if suo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: subscriber.OwnerTable, + Columns: []string{subscriber.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = suo.schemaConfig.Subscriber + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := suo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: subscriber.OwnerTable, + Columns: []string{subscriber.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = suo.schemaConfig.Subscriber + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if suo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = suo.schemaConfig.SubscriberEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := suo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !suo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = suo.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := suo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: subscriber.EventsTable, + Columns: subscriber.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = suo.schemaConfig.SubscriberEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = suo.schemaConfig.Subscriber + ctx = internal.NewSchemaConfigContext(ctx, suo.schemaConfig) + _node = &Subscriber{config: suo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, suo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{subscriber.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + suo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/template.go b/internal/ent/generated/template.go new file mode 100644 index 0000000..59378ac --- /dev/null +++ b/internal/ent/generated/template.go @@ -0,0 +1,331 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/pkg/enums" +) + +// Template is the model entity for the Template schema. +type Template struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the template + Name string `json:"name,omitempty"` + // the type of the template, either a provided template or an implementation (document) + TemplateType enums.DocumentType `json:"template_type,omitempty"` + // the description of the template + Description string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig customtypes.JSONObject `json:"jsonconfig,omitempty"` + // the uischema for the template to render in the UI + Uischema customtypes.JSONObject `json:"uischema,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the TemplateQuery when eager-loading is set. + Edges TemplateEdges `json:"edges"` + selectValues sql.SelectValues +} + +// TemplateEdges holds the relations/edges for other nodes in the graph. +type TemplateEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Documents holds the value of the documents edge. + Documents []*DocumentData `json:"documents,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int + + namedDocuments map[string][]*DocumentData +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e TemplateEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// DocumentsOrErr returns the Documents value or an error if the edge +// was not loaded in eager-loading. +func (e TemplateEdges) DocumentsOrErr() ([]*DocumentData, error) { + if e.loadedTypes[1] { + return e.Documents, nil + } + return nil, &NotLoadedError{edge: "documents"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Template) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case template.FieldTags, template.FieldJsonconfig, template.FieldUischema: + values[i] = new([]byte) + case template.FieldID, template.FieldCreatedBy, template.FieldUpdatedBy, template.FieldDeletedBy, template.FieldMappingID, template.FieldOwnerID, template.FieldName, template.FieldTemplateType, template.FieldDescription: + values[i] = new(sql.NullString) + case template.FieldCreatedAt, template.FieldUpdatedAt, template.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Template fields. +func (t *Template) 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 template.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + t.ID = value.String + } + case template.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + t.CreatedAt = value.Time + } + case template.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + t.UpdatedAt = value.Time + } + case template.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + t.CreatedBy = value.String + } + case template.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + t.UpdatedBy = value.String + } + case template.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + t.DeletedAt = value.Time + } + case template.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + t.DeletedBy = value.String + } + case template.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + t.MappingID = value.String + } + case template.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &t.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case template.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + t.OwnerID = value.String + } + case template.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + t.Name = value.String + } + case template.FieldTemplateType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field template_type", values[i]) + } else if value.Valid { + t.TemplateType = enums.DocumentType(value.String) + } + case template.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + t.Description = value.String + } + case template.FieldJsonconfig: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field jsonconfig", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &t.Jsonconfig); err != nil { + return fmt.Errorf("unmarshal field jsonconfig: %w", err) + } + } + case template.FieldUischema: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field uischema", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &t.Uischema); err != nil { + return fmt.Errorf("unmarshal field uischema: %w", err) + } + } + default: + t.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Template. +// This includes values selected through modifiers, order, etc. +func (t *Template) Value(name string) (ent.Value, error) { + return t.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Template entity. +func (t *Template) QueryOwner() *OrganizationQuery { + return NewTemplateClient(t.config).QueryOwner(t) +} + +// QueryDocuments queries the "documents" edge of the Template entity. +func (t *Template) QueryDocuments() *DocumentDataQuery { + return NewTemplateClient(t.config).QueryDocuments(t) +} + +// Update returns a builder for updating this Template. +// Note that you need to call Template.Unwrap() before calling this method if this Template +// was returned from a transaction, and the transaction was committed or rolled back. +func (t *Template) Update() *TemplateUpdateOne { + return NewTemplateClient(t.config).UpdateOne(t) +} + +// Unwrap unwraps the Template 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 (t *Template) Unwrap() *Template { + _tx, ok := t.config.driver.(*txDriver) + if !ok { + panic("generated: Template is not a transactional entity") + } + t.config.driver = _tx.drv + return t +} + +// String implements the fmt.Stringer. +func (t *Template) String() string { + var builder strings.Builder + builder.WriteString("Template(") + builder.WriteString(fmt.Sprintf("id=%v, ", t.ID)) + builder.WriteString("created_at=") + builder.WriteString(t.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(t.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(t.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(t.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(t.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(t.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(t.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", t.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(t.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(t.Name) + builder.WriteString(", ") + builder.WriteString("template_type=") + builder.WriteString(fmt.Sprintf("%v", t.TemplateType)) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(t.Description) + builder.WriteString(", ") + builder.WriteString("jsonconfig=") + builder.WriteString(fmt.Sprintf("%v", t.Jsonconfig)) + builder.WriteString(", ") + builder.WriteString("uischema=") + builder.WriteString(fmt.Sprintf("%v", t.Uischema)) + builder.WriteByte(')') + return builder.String() +} + +// NamedDocuments returns the Documents named value or an error if the edge was not +// loaded in eager-loading with this name. +func (t *Template) NamedDocuments(name string) ([]*DocumentData, error) { + if t.Edges.namedDocuments == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := t.Edges.namedDocuments[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (t *Template) appendNamedDocuments(name string, edges ...*DocumentData) { + if t.Edges.namedDocuments == nil { + t.Edges.namedDocuments = make(map[string][]*DocumentData) + } + if len(edges) == 0 { + t.Edges.namedDocuments[name] = []*DocumentData{} + } else { + t.Edges.namedDocuments[name] = append(t.Edges.namedDocuments[name], edges...) + } +} + +// Templates is a parsable slice of Template. +type Templates []*Template diff --git a/internal/ent/generated/template/template.go b/internal/ent/generated/template/template.go new file mode 100644 index 0000000..17f83c2 --- /dev/null +++ b/internal/ent/generated/template/template.go @@ -0,0 +1,242 @@ +// Code generated by ent, DO NOT EDIT. + +package template + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the template type in the database. + Label = "template" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldTemplateType holds the string denoting the template_type field in the database. + FieldTemplateType = "template_type" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldJsonconfig holds the string denoting the jsonconfig field in the database. + FieldJsonconfig = "jsonconfig" + // FieldUischema holds the string denoting the uischema field in the database. + FieldUischema = "uischema" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeDocuments holds the string denoting the documents edge name in mutations. + EdgeDocuments = "documents" + // Table holds the table name of the template in the database. + Table = "templates" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "templates" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // DocumentsTable is the table that holds the documents relation/edge. + DocumentsTable = "document_data" + // DocumentsInverseTable is the table name for the DocumentData entity. + // It exists in this package in order to avoid circular dependency with the "documentdata" package. + DocumentsInverseTable = "document_data" + // DocumentsColumn is the table column denoting the documents relation/edge. + DocumentsColumn = "template_id" +) + +// Columns holds all SQL columns for template fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldTemplateType, + FieldDescription, + FieldJsonconfig, + FieldUischema, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // OwnerIDValidator is a validator for the "owner_id" field. It is called by the builders before save. + OwnerIDValidator func(string) error + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultTemplateType enums.DocumentType = "DOCUMENT" + +// TemplateTypeValidator is a validator for the "template_type" field enum values. It is called by the builders before save. +func TemplateTypeValidator(tt enums.DocumentType) error { + switch tt.String() { + case "ROOTTEMPLATE", "DOCUMENT": + return nil + default: + return fmt.Errorf("template: invalid enum value for template_type field: %q", tt) + } +} + +// OrderOption defines the ordering options for the Template queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByTemplateType orders the results by the template_type field. +func ByTemplateType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTemplateType, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByDocumentsCount orders the results by documents count. +func ByDocumentsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newDocumentsStep(), opts...) + } +} + +// ByDocuments orders the results by documents terms. +func ByDocuments(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newDocumentsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newDocumentsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(DocumentsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, DocumentsTable, DocumentsColumn), + ) +} + +var ( + // enums.DocumentType must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.DocumentType)(nil) + // enums.DocumentType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.DocumentType)(nil) +) diff --git a/internal/ent/generated/template/where.go b/internal/ent/generated/template/where.go new file mode 100644 index 0000000..0be975c --- /dev/null +++ b/internal/ent/generated/template/where.go @@ -0,0 +1,897 @@ +// Code generated by ent, DO NOT EDIT. + +package template + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldDescription, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Template { + return predicate.Template(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Template { + return predicate.Template(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Template { + return predicate.Template(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Template { + return predicate.Template(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Template { + return predicate.Template(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Template { + return predicate.Template(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Template { + return predicate.Template(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Template { + return predicate.Template(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Template { + return predicate.Template(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Template { + return predicate.Template(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Template { + return predicate.Template(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Template { + return predicate.Template(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Template { + return predicate.Template(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Template { + return predicate.Template(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Template { + return predicate.Template(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Template { + return predicate.Template(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Template { + return predicate.Template(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Template { + return predicate.Template(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Template { + return predicate.Template(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Template { + return predicate.Template(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Template { + return predicate.Template(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Template { + return predicate.Template(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Template { + return predicate.Template(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Template { + return predicate.Template(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Template { + return predicate.Template(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Template { + return predicate.Template(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Template { + return predicate.Template(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldName, v)) +} + +// TemplateTypeEQ applies the EQ predicate on the "template_type" field. +func TemplateTypeEQ(v enums.DocumentType) predicate.Template { + vc := v + return predicate.Template(sql.FieldEQ(FieldTemplateType, vc)) +} + +// TemplateTypeNEQ applies the NEQ predicate on the "template_type" field. +func TemplateTypeNEQ(v enums.DocumentType) predicate.Template { + vc := v + return predicate.Template(sql.FieldNEQ(FieldTemplateType, vc)) +} + +// TemplateTypeIn applies the In predicate on the "template_type" field. +func TemplateTypeIn(vs ...enums.DocumentType) predicate.Template { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Template(sql.FieldIn(FieldTemplateType, v...)) +} + +// TemplateTypeNotIn applies the NotIn predicate on the "template_type" field. +func TemplateTypeNotIn(vs ...enums.DocumentType) predicate.Template { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.Template(sql.FieldNotIn(FieldTemplateType, v...)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Template { + return predicate.Template(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Template { + return predicate.Template(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Template { + return predicate.Template(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Template { + return predicate.Template(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Template { + return predicate.Template(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Template { + return predicate.Template(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Template { + return predicate.Template(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Template { + return predicate.Template(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Template { + return predicate.Template(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Template { + return predicate.Template(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Template { + return predicate.Template(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Template { + return predicate.Template(sql.FieldContainsFold(FieldDescription, v)) +} + +// UischemaIsNil applies the IsNil predicate on the "uischema" field. +func UischemaIsNil() predicate.Template { + return predicate.Template(sql.FieldIsNull(FieldUischema)) +} + +// UischemaNotNil applies the NotNil predicate on the "uischema" field. +func UischemaNotNil() predicate.Template { + return predicate.Template(sql.FieldNotNull(FieldUischema)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Template { + return predicate.Template(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Template + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Template { + return predicate.Template(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Template + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasDocuments applies the HasEdge predicate on the "documents" edge. +func HasDocuments() predicate.Template { + return predicate.Template(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, DocumentsTable, DocumentsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasDocumentsWith applies the HasEdge predicate on the "documents" edge with a given conditions (other predicates). +func HasDocumentsWith(preds ...predicate.DocumentData) predicate.Template { + return predicate.Template(func(s *sql.Selector) { + step := newDocumentsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + 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.Template) predicate.Template { + return predicate.Template(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Template) predicate.Template { + return predicate.Template(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Template) predicate.Template { + return predicate.Template(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/template_create.go b/internal/ent/generated/template_create.go new file mode 100644 index 0000000..2007593 --- /dev/null +++ b/internal/ent/generated/template_create.go @@ -0,0 +1,538 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/pkg/enums" +) + +// TemplateCreate is the builder for creating a Template entity. +type TemplateCreate struct { + config + mutation *TemplateMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (tc *TemplateCreate) SetCreatedAt(t time.Time) *TemplateCreate { + tc.mutation.SetCreatedAt(t) + return tc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableCreatedAt(t *time.Time) *TemplateCreate { + if t != nil { + tc.SetCreatedAt(*t) + } + return tc +} + +// SetUpdatedAt sets the "updated_at" field. +func (tc *TemplateCreate) SetUpdatedAt(t time.Time) *TemplateCreate { + tc.mutation.SetUpdatedAt(t) + return tc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableUpdatedAt(t *time.Time) *TemplateCreate { + if t != nil { + tc.SetUpdatedAt(*t) + } + return tc +} + +// SetCreatedBy sets the "created_by" field. +func (tc *TemplateCreate) SetCreatedBy(s string) *TemplateCreate { + tc.mutation.SetCreatedBy(s) + return tc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableCreatedBy(s *string) *TemplateCreate { + if s != nil { + tc.SetCreatedBy(*s) + } + return tc +} + +// SetUpdatedBy sets the "updated_by" field. +func (tc *TemplateCreate) SetUpdatedBy(s string) *TemplateCreate { + tc.mutation.SetUpdatedBy(s) + return tc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableUpdatedBy(s *string) *TemplateCreate { + if s != nil { + tc.SetUpdatedBy(*s) + } + return tc +} + +// SetDeletedAt sets the "deleted_at" field. +func (tc *TemplateCreate) SetDeletedAt(t time.Time) *TemplateCreate { + tc.mutation.SetDeletedAt(t) + return tc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableDeletedAt(t *time.Time) *TemplateCreate { + if t != nil { + tc.SetDeletedAt(*t) + } + return tc +} + +// SetDeletedBy sets the "deleted_by" field. +func (tc *TemplateCreate) SetDeletedBy(s string) *TemplateCreate { + tc.mutation.SetDeletedBy(s) + return tc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableDeletedBy(s *string) *TemplateCreate { + if s != nil { + tc.SetDeletedBy(*s) + } + return tc +} + +// SetMappingID sets the "mapping_id" field. +func (tc *TemplateCreate) SetMappingID(s string) *TemplateCreate { + tc.mutation.SetMappingID(s) + return tc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableMappingID(s *string) *TemplateCreate { + if s != nil { + tc.SetMappingID(*s) + } + return tc +} + +// SetTags sets the "tags" field. +func (tc *TemplateCreate) SetTags(s []string) *TemplateCreate { + tc.mutation.SetTags(s) + return tc +} + +// SetOwnerID sets the "owner_id" field. +func (tc *TemplateCreate) SetOwnerID(s string) *TemplateCreate { + tc.mutation.SetOwnerID(s) + return tc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableOwnerID(s *string) *TemplateCreate { + if s != nil { + tc.SetOwnerID(*s) + } + return tc +} + +// SetName sets the "name" field. +func (tc *TemplateCreate) SetName(s string) *TemplateCreate { + tc.mutation.SetName(s) + return tc +} + +// SetTemplateType sets the "template_type" field. +func (tc *TemplateCreate) SetTemplateType(et enums.DocumentType) *TemplateCreate { + tc.mutation.SetTemplateType(et) + return tc +} + +// SetNillableTemplateType sets the "template_type" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableTemplateType(et *enums.DocumentType) *TemplateCreate { + if et != nil { + tc.SetTemplateType(*et) + } + return tc +} + +// SetDescription sets the "description" field. +func (tc *TemplateCreate) SetDescription(s string) *TemplateCreate { + tc.mutation.SetDescription(s) + return tc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableDescription(s *string) *TemplateCreate { + if s != nil { + tc.SetDescription(*s) + } + return tc +} + +// SetJsonconfig sets the "jsonconfig" field. +func (tc *TemplateCreate) SetJsonconfig(co customtypes.JSONObject) *TemplateCreate { + tc.mutation.SetJsonconfig(co) + return tc +} + +// SetUischema sets the "uischema" field. +func (tc *TemplateCreate) SetUischema(co customtypes.JSONObject) *TemplateCreate { + tc.mutation.SetUischema(co) + return tc +} + +// SetID sets the "id" field. +func (tc *TemplateCreate) SetID(s string) *TemplateCreate { + tc.mutation.SetID(s) + return tc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (tc *TemplateCreate) SetNillableID(s *string) *TemplateCreate { + if s != nil { + tc.SetID(*s) + } + return tc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (tc *TemplateCreate) SetOwner(o *Organization) *TemplateCreate { + return tc.SetOwnerID(o.ID) +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by IDs. +func (tc *TemplateCreate) AddDocumentIDs(ids ...string) *TemplateCreate { + tc.mutation.AddDocumentIDs(ids...) + return tc +} + +// AddDocuments adds the "documents" edges to the DocumentData entity. +func (tc *TemplateCreate) AddDocuments(d ...*DocumentData) *TemplateCreate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return tc.AddDocumentIDs(ids...) +} + +// Mutation returns the TemplateMutation object of the builder. +func (tc *TemplateCreate) Mutation() *TemplateMutation { + return tc.mutation +} + +// Save creates the Template in the database. +func (tc *TemplateCreate) Save(ctx context.Context) (*Template, error) { + if err := tc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, tc.sqlSave, tc.mutation, tc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (tc *TemplateCreate) SaveX(ctx context.Context) *Template { + v, err := tc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (tc *TemplateCreate) Exec(ctx context.Context) error { + _, err := tc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tc *TemplateCreate) ExecX(ctx context.Context) { + if err := tc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (tc *TemplateCreate) defaults() error { + if _, ok := tc.mutation.CreatedAt(); !ok { + if template.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized template.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := template.DefaultCreatedAt() + tc.mutation.SetCreatedAt(v) + } + if _, ok := tc.mutation.UpdatedAt(); !ok { + if template.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized template.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := template.DefaultUpdatedAt() + tc.mutation.SetUpdatedAt(v) + } + if _, ok := tc.mutation.MappingID(); !ok { + if template.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized template.DefaultMappingID (forgotten import generated/runtime?)") + } + v := template.DefaultMappingID() + tc.mutation.SetMappingID(v) + } + if _, ok := tc.mutation.Tags(); !ok { + v := template.DefaultTags + tc.mutation.SetTags(v) + } + if _, ok := tc.mutation.TemplateType(); !ok { + v := template.DefaultTemplateType + tc.mutation.SetTemplateType(v) + } + if _, ok := tc.mutation.ID(); !ok { + if template.DefaultID == nil { + return fmt.Errorf("generated: uninitialized template.DefaultID (forgotten import generated/runtime?)") + } + v := template.DefaultID() + tc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (tc *TemplateCreate) check() error { + if _, ok := tc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Template.mapping_id"`)} + } + if v, ok := tc.mutation.OwnerID(); ok { + if err := template.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Template.owner_id": %w`, err)} + } + } + if _, ok := tc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "Template.name"`)} + } + if v, ok := tc.mutation.Name(); ok { + if err := template.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Template.name": %w`, err)} + } + } + if _, ok := tc.mutation.TemplateType(); !ok { + return &ValidationError{Name: "template_type", err: errors.New(`generated: missing required field "Template.template_type"`)} + } + if v, ok := tc.mutation.TemplateType(); ok { + if err := template.TemplateTypeValidator(v); err != nil { + return &ValidationError{Name: "template_type", err: fmt.Errorf(`generated: validator failed for field "Template.template_type": %w`, err)} + } + } + if _, ok := tc.mutation.Jsonconfig(); !ok { + return &ValidationError{Name: "jsonconfig", err: errors.New(`generated: missing required field "Template.jsonconfig"`)} + } + return nil +} + +func (tc *TemplateCreate) sqlSave(ctx context.Context) (*Template, error) { + if err := tc.check(); err != nil { + return nil, err + } + _node, _spec := tc.createSpec() + if err := sqlgraph.CreateNode(ctx, tc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Template.ID type: %T", _spec.ID.Value) + } + } + tc.mutation.id = &_node.ID + tc.mutation.done = true + return _node, nil +} + +func (tc *TemplateCreate) createSpec() (*Template, *sqlgraph.CreateSpec) { + var ( + _node = &Template{config: tc.config} + _spec = sqlgraph.NewCreateSpec(template.Table, sqlgraph.NewFieldSpec(template.FieldID, field.TypeString)) + ) + _spec.Schema = tc.schemaConfig.Template + if id, ok := tc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := tc.mutation.CreatedAt(); ok { + _spec.SetField(template.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := tc.mutation.UpdatedAt(); ok { + _spec.SetField(template.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := tc.mutation.CreatedBy(); ok { + _spec.SetField(template.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := tc.mutation.UpdatedBy(); ok { + _spec.SetField(template.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := tc.mutation.DeletedAt(); ok { + _spec.SetField(template.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := tc.mutation.DeletedBy(); ok { + _spec.SetField(template.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := tc.mutation.MappingID(); ok { + _spec.SetField(template.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := tc.mutation.Tags(); ok { + _spec.SetField(template.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := tc.mutation.Name(); ok { + _spec.SetField(template.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := tc.mutation.TemplateType(); ok { + _spec.SetField(template.FieldTemplateType, field.TypeEnum, value) + _node.TemplateType = value + } + if value, ok := tc.mutation.Description(); ok { + _spec.SetField(template.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := tc.mutation.Jsonconfig(); ok { + _spec.SetField(template.FieldJsonconfig, field.TypeJSON, value) + _node.Jsonconfig = value + } + if value, ok := tc.mutation.Uischema(); ok { + _spec.SetField(template.FieldUischema, field.TypeJSON, value) + _node.Uischema = value + } + if nodes := tc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: template.OwnerTable, + Columns: []string{template.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = tc.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := tc.mutation.DocumentsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = tc.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// TemplateCreateBulk is the builder for creating many Template entities in bulk. +type TemplateCreateBulk struct { + config + err error + builders []*TemplateCreate +} + +// Save creates the Template entities in the database. +func (tcb *TemplateCreateBulk) Save(ctx context.Context) ([]*Template, error) { + if tcb.err != nil { + return nil, tcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(tcb.builders)) + nodes := make([]*Template, len(tcb.builders)) + mutators := make([]Mutator, len(tcb.builders)) + for i := range tcb.builders { + func(i int, root context.Context) { + builder := tcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*TemplateMutation) + 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, tcb.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, tcb.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, tcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (tcb *TemplateCreateBulk) SaveX(ctx context.Context) []*Template { + v, err := tcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (tcb *TemplateCreateBulk) Exec(ctx context.Context) error { + _, err := tcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tcb *TemplateCreateBulk) ExecX(ctx context.Context) { + if err := tcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/template_delete.go b/internal/ent/generated/template_delete.go new file mode 100644 index 0000000..a74406f --- /dev/null +++ b/internal/ent/generated/template_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/template" +) + +// TemplateDelete is the builder for deleting a Template entity. +type TemplateDelete struct { + config + hooks []Hook + mutation *TemplateMutation +} + +// Where appends a list predicates to the TemplateDelete builder. +func (td *TemplateDelete) Where(ps ...predicate.Template) *TemplateDelete { + td.mutation.Where(ps...) + return td +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (td *TemplateDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, td.sqlExec, td.mutation, td.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (td *TemplateDelete) ExecX(ctx context.Context) int { + n, err := td.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (td *TemplateDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(template.Table, sqlgraph.NewFieldSpec(template.FieldID, field.TypeString)) + _spec.Node.Schema = td.schemaConfig.Template + ctx = internal.NewSchemaConfigContext(ctx, td.schemaConfig) + if ps := td.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, td.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + td.mutation.done = true + return affected, err +} + +// TemplateDeleteOne is the builder for deleting a single Template entity. +type TemplateDeleteOne struct { + td *TemplateDelete +} + +// Where appends a list predicates to the TemplateDelete builder. +func (tdo *TemplateDeleteOne) Where(ps ...predicate.Template) *TemplateDeleteOne { + tdo.td.mutation.Where(ps...) + return tdo +} + +// Exec executes the deletion query. +func (tdo *TemplateDeleteOne) Exec(ctx context.Context) error { + n, err := tdo.td.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{template.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (tdo *TemplateDeleteOne) ExecX(ctx context.Context) { + if err := tdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/template_query.go b/internal/ent/generated/template_query.go new file mode 100644 index 0000000..7c96f1f --- /dev/null +++ b/internal/ent/generated/template_query.go @@ -0,0 +1,738 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/template" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// TemplateQuery is the builder for querying Template entities. +type TemplateQuery struct { + config + ctx *QueryContext + order []template.OrderOption + inters []Interceptor + predicates []predicate.Template + withOwner *OrganizationQuery + withDocuments *DocumentDataQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Template) error + withNamedDocuments map[string]*DocumentDataQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the TemplateQuery builder. +func (tq *TemplateQuery) Where(ps ...predicate.Template) *TemplateQuery { + tq.predicates = append(tq.predicates, ps...) + return tq +} + +// Limit the number of records to be returned by this query. +func (tq *TemplateQuery) Limit(limit int) *TemplateQuery { + tq.ctx.Limit = &limit + return tq +} + +// Offset to start from. +func (tq *TemplateQuery) Offset(offset int) *TemplateQuery { + tq.ctx.Offset = &offset + return tq +} + +// 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 (tq *TemplateQuery) Unique(unique bool) *TemplateQuery { + tq.ctx.Unique = &unique + return tq +} + +// Order specifies how the records should be ordered. +func (tq *TemplateQuery) Order(o ...template.OrderOption) *TemplateQuery { + tq.order = append(tq.order, o...) + return tq +} + +// QueryOwner chains the current query on the "owner" edge. +func (tq *TemplateQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: tq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := tq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := tq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(template.Table, template.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, template.OwnerTable, template.OwnerColumn), + ) + schemaConfig := tq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Template + fromU = sqlgraph.SetNeighbors(tq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryDocuments chains the current query on the "documents" edge. +func (tq *TemplateQuery) QueryDocuments() *DocumentDataQuery { + query := (&DocumentDataClient{config: tq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := tq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := tq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(template.Table, template.FieldID, selector), + sqlgraph.To(documentdata.Table, documentdata.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, template.DocumentsTable, template.DocumentsColumn), + ) + schemaConfig := tq.schemaConfig + step.To.Schema = schemaConfig.DocumentData + step.Edge.Schema = schemaConfig.DocumentData + fromU = sqlgraph.SetNeighbors(tq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Template entity from the query. +// Returns a *NotFoundError when no Template was found. +func (tq *TemplateQuery) First(ctx context.Context) (*Template, error) { + nodes, err := tq.Limit(1).All(setContextOp(ctx, tq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{template.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (tq *TemplateQuery) FirstX(ctx context.Context) *Template { + node, err := tq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Template ID from the query. +// Returns a *NotFoundError when no Template ID was found. +func (tq *TemplateQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = tq.Limit(1).IDs(setContextOp(ctx, tq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{template.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (tq *TemplateQuery) FirstIDX(ctx context.Context) string { + id, err := tq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Template entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Template entity is found. +// Returns a *NotFoundError when no Template entities are found. +func (tq *TemplateQuery) Only(ctx context.Context) (*Template, error) { + nodes, err := tq.Limit(2).All(setContextOp(ctx, tq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{template.Label} + default: + return nil, &NotSingularError{template.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (tq *TemplateQuery) OnlyX(ctx context.Context) *Template { + node, err := tq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Template ID in the query. +// Returns a *NotSingularError when more than one Template ID is found. +// Returns a *NotFoundError when no entities are found. +func (tq *TemplateQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = tq.Limit(2).IDs(setContextOp(ctx, tq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{template.Label} + default: + err = &NotSingularError{template.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (tq *TemplateQuery) OnlyIDX(ctx context.Context) string { + id, err := tq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Templates. +func (tq *TemplateQuery) All(ctx context.Context) ([]*Template, error) { + ctx = setContextOp(ctx, tq.ctx, ent.OpQueryAll) + if err := tq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Template, *TemplateQuery]() + return withInterceptors[[]*Template](ctx, tq, qr, tq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (tq *TemplateQuery) AllX(ctx context.Context) []*Template { + nodes, err := tq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Template IDs. +func (tq *TemplateQuery) IDs(ctx context.Context) (ids []string, err error) { + if tq.ctx.Unique == nil && tq.path != nil { + tq.Unique(true) + } + ctx = setContextOp(ctx, tq.ctx, ent.OpQueryIDs) + if err = tq.Select(template.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (tq *TemplateQuery) IDsX(ctx context.Context) []string { + ids, err := tq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (tq *TemplateQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, tq.ctx, ent.OpQueryCount) + if err := tq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, tq, querierCount[*TemplateQuery](), tq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (tq *TemplateQuery) CountX(ctx context.Context) int { + count, err := tq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (tq *TemplateQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, tq.ctx, ent.OpQueryExist) + switch _, err := tq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (tq *TemplateQuery) ExistX(ctx context.Context) bool { + exist, err := tq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the TemplateQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (tq *TemplateQuery) Clone() *TemplateQuery { + if tq == nil { + return nil + } + return &TemplateQuery{ + config: tq.config, + ctx: tq.ctx.Clone(), + order: append([]template.OrderOption{}, tq.order...), + inters: append([]Interceptor{}, tq.inters...), + predicates: append([]predicate.Template{}, tq.predicates...), + withOwner: tq.withOwner.Clone(), + withDocuments: tq.withDocuments.Clone(), + // clone intermediate query. + sql: tq.sql.Clone(), + path: tq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (tq *TemplateQuery) WithOwner(opts ...func(*OrganizationQuery)) *TemplateQuery { + query := (&OrganizationClient{config: tq.config}).Query() + for _, opt := range opts { + opt(query) + } + tq.withOwner = query + return tq +} + +// WithDocuments tells the query-builder to eager-load the nodes that are connected to +// the "documents" edge. The optional arguments are used to configure the query builder of the edge. +func (tq *TemplateQuery) WithDocuments(opts ...func(*DocumentDataQuery)) *TemplateQuery { + query := (&DocumentDataClient{config: tq.config}).Query() + for _, opt := range opts { + opt(query) + } + tq.withDocuments = query + return tq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Template.Query(). +// GroupBy(template.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (tq *TemplateQuery) GroupBy(field string, fields ...string) *TemplateGroupBy { + tq.ctx.Fields = append([]string{field}, fields...) + grbuild := &TemplateGroupBy{build: tq} + grbuild.flds = &tq.ctx.Fields + grbuild.label = template.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Template.Query(). +// Select(template.FieldCreatedAt). +// Scan(ctx, &v) +func (tq *TemplateQuery) Select(fields ...string) *TemplateSelect { + tq.ctx.Fields = append(tq.ctx.Fields, fields...) + sbuild := &TemplateSelect{TemplateQuery: tq} + sbuild.label = template.Label + sbuild.flds, sbuild.scan = &tq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a TemplateSelect configured with the given aggregations. +func (tq *TemplateQuery) Aggregate(fns ...AggregateFunc) *TemplateSelect { + return tq.Select().Aggregate(fns...) +} + +func (tq *TemplateQuery) prepareQuery(ctx context.Context) error { + for _, inter := range tq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, tq); err != nil { + return err + } + } + } + for _, f := range tq.ctx.Fields { + if !template.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if tq.path != nil { + prev, err := tq.path(ctx) + if err != nil { + return err + } + tq.sql = prev + } + if template.Policy == nil { + return errors.New("generated: uninitialized template.Policy (forgotten import generated/runtime?)") + } + if err := template.Policy.EvalQuery(ctx, tq); err != nil { + return err + } + return nil +} + +func (tq *TemplateQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Template, error) { + var ( + nodes = []*Template{} + _spec = tq.querySpec() + loadedTypes = [2]bool{ + tq.withOwner != nil, + tq.withDocuments != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Template).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Template{config: tq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = tq.schemaConfig.Template + ctx = internal.NewSchemaConfigContext(ctx, tq.schemaConfig) + if len(tq.modifiers) > 0 { + _spec.Modifiers = tq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, tq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := tq.withOwner; query != nil { + if err := tq.loadOwner(ctx, query, nodes, nil, + func(n *Template, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := tq.withDocuments; query != nil { + if err := tq.loadDocuments(ctx, query, nodes, + func(n *Template) { n.Edges.Documents = []*DocumentData{} }, + func(n *Template, e *DocumentData) { n.Edges.Documents = append(n.Edges.Documents, e) }); err != nil { + return nil, err + } + } + for name, query := range tq.withNamedDocuments { + if err := tq.loadDocuments(ctx, query, nodes, + func(n *Template) { n.appendNamedDocuments(name) }, + func(n *Template, e *DocumentData) { n.appendNamedDocuments(name, e) }); err != nil { + return nil, err + } + } + for i := range tq.loadTotal { + if err := tq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (tq *TemplateQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Template, init func(*Template), assign func(*Template, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Template) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (tq *TemplateQuery) loadDocuments(ctx context.Context, query *DocumentDataQuery, nodes []*Template, init func(*Template), assign func(*Template, *DocumentData)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*Template) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(documentdata.FieldTemplateID) + } + query.Where(predicate.DocumentData(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(template.DocumentsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.TemplateID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "template_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (tq *TemplateQuery) sqlCount(ctx context.Context) (int, error) { + _spec := tq.querySpec() + _spec.Node.Schema = tq.schemaConfig.Template + ctx = internal.NewSchemaConfigContext(ctx, tq.schemaConfig) + if len(tq.modifiers) > 0 { + _spec.Modifiers = tq.modifiers + } + _spec.Node.Columns = tq.ctx.Fields + if len(tq.ctx.Fields) > 0 { + _spec.Unique = tq.ctx.Unique != nil && *tq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, tq.driver, _spec) +} + +func (tq *TemplateQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(template.Table, template.Columns, sqlgraph.NewFieldSpec(template.FieldID, field.TypeString)) + _spec.From = tq.sql + if unique := tq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if tq.path != nil { + _spec.Unique = true + } + if fields := tq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, template.FieldID) + for i := range fields { + if fields[i] != template.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if tq.withOwner != nil { + _spec.Node.AddColumnOnce(template.FieldOwnerID) + } + } + if ps := tq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := tq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := tq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := tq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (tq *TemplateQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(tq.driver.Dialect()) + t1 := builder.Table(template.Table) + columns := tq.ctx.Fields + if len(columns) == 0 { + columns = template.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if tq.sql != nil { + selector = tq.sql + selector.Select(selector.Columns(columns...)...) + } + if tq.ctx.Unique != nil && *tq.ctx.Unique { + selector.Distinct() + } + t1.Schema(tq.schemaConfig.Template) + ctx = internal.NewSchemaConfigContext(ctx, tq.schemaConfig) + selector.WithContext(ctx) + for _, p := range tq.predicates { + p(selector) + } + for _, p := range tq.order { + p(selector) + } + if offset := tq.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 := tq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedDocuments tells the query-builder to eager-load the nodes that are connected to the "documents" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (tq *TemplateQuery) WithNamedDocuments(name string, opts ...func(*DocumentDataQuery)) *TemplateQuery { + query := (&DocumentDataClient{config: tq.config}).Query() + for _, opt := range opts { + opt(query) + } + if tq.withNamedDocuments == nil { + tq.withNamedDocuments = make(map[string]*DocumentDataQuery) + } + tq.withNamedDocuments[name] = query + return tq +} + +// TemplateGroupBy is the group-by builder for Template entities. +type TemplateGroupBy struct { + selector + build *TemplateQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (tgb *TemplateGroupBy) Aggregate(fns ...AggregateFunc) *TemplateGroupBy { + tgb.fns = append(tgb.fns, fns...) + return tgb +} + +// Scan applies the selector query and scans the result into the given value. +func (tgb *TemplateGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, tgb.build.ctx, ent.OpQueryGroupBy) + if err := tgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*TemplateQuery, *TemplateGroupBy](ctx, tgb.build, tgb, tgb.build.inters, v) +} + +func (tgb *TemplateGroupBy) sqlScan(ctx context.Context, root *TemplateQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(tgb.fns)) + for _, fn := range tgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*tgb.flds)+len(tgb.fns)) + for _, f := range *tgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*tgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := tgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// TemplateSelect is the builder for selecting fields of Template entities. +type TemplateSelect struct { + *TemplateQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ts *TemplateSelect) Aggregate(fns ...AggregateFunc) *TemplateSelect { + ts.fns = append(ts.fns, fns...) + return ts +} + +// Scan applies the selector query and scans the result into the given value. +func (ts *TemplateSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ts.ctx, ent.OpQuerySelect) + if err := ts.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*TemplateQuery, *TemplateSelect](ctx, ts.TemplateQuery, ts, ts.inters, v) +} + +func (ts *TemplateSelect) sqlScan(ctx context.Context, root *TemplateQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ts.fns)) + for _, fn := range ts.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ts.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 := ts.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/template_update.go b/internal/ent/generated/template_update.go new file mode 100644 index 0000000..0d4a98f --- /dev/null +++ b/internal/ent/generated/template_update.go @@ -0,0 +1,991 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/documentdata" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/template" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// TemplateUpdate is the builder for updating Template entities. +type TemplateUpdate struct { + config + hooks []Hook + mutation *TemplateMutation +} + +// Where appends a list predicates to the TemplateUpdate builder. +func (tu *TemplateUpdate) Where(ps ...predicate.Template) *TemplateUpdate { + tu.mutation.Where(ps...) + return tu +} + +// SetUpdatedAt sets the "updated_at" field. +func (tu *TemplateUpdate) SetUpdatedAt(t time.Time) *TemplateUpdate { + tu.mutation.SetUpdatedAt(t) + return tu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (tu *TemplateUpdate) ClearUpdatedAt() *TemplateUpdate { + tu.mutation.ClearUpdatedAt() + return tu +} + +// SetUpdatedBy sets the "updated_by" field. +func (tu *TemplateUpdate) SetUpdatedBy(s string) *TemplateUpdate { + tu.mutation.SetUpdatedBy(s) + return tu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (tu *TemplateUpdate) SetNillableUpdatedBy(s *string) *TemplateUpdate { + if s != nil { + tu.SetUpdatedBy(*s) + } + return tu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (tu *TemplateUpdate) ClearUpdatedBy() *TemplateUpdate { + tu.mutation.ClearUpdatedBy() + return tu +} + +// SetDeletedAt sets the "deleted_at" field. +func (tu *TemplateUpdate) SetDeletedAt(t time.Time) *TemplateUpdate { + tu.mutation.SetDeletedAt(t) + return tu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (tu *TemplateUpdate) SetNillableDeletedAt(t *time.Time) *TemplateUpdate { + if t != nil { + tu.SetDeletedAt(*t) + } + return tu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (tu *TemplateUpdate) ClearDeletedAt() *TemplateUpdate { + tu.mutation.ClearDeletedAt() + return tu +} + +// SetDeletedBy sets the "deleted_by" field. +func (tu *TemplateUpdate) SetDeletedBy(s string) *TemplateUpdate { + tu.mutation.SetDeletedBy(s) + return tu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (tu *TemplateUpdate) SetNillableDeletedBy(s *string) *TemplateUpdate { + if s != nil { + tu.SetDeletedBy(*s) + } + return tu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (tu *TemplateUpdate) ClearDeletedBy() *TemplateUpdate { + tu.mutation.ClearDeletedBy() + return tu +} + +// SetTags sets the "tags" field. +func (tu *TemplateUpdate) SetTags(s []string) *TemplateUpdate { + tu.mutation.SetTags(s) + return tu +} + +// AppendTags appends s to the "tags" field. +func (tu *TemplateUpdate) AppendTags(s []string) *TemplateUpdate { + tu.mutation.AppendTags(s) + return tu +} + +// ClearTags clears the value of the "tags" field. +func (tu *TemplateUpdate) ClearTags() *TemplateUpdate { + tu.mutation.ClearTags() + return tu +} + +// SetOwnerID sets the "owner_id" field. +func (tu *TemplateUpdate) SetOwnerID(s string) *TemplateUpdate { + tu.mutation.SetOwnerID(s) + return tu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (tu *TemplateUpdate) SetNillableOwnerID(s *string) *TemplateUpdate { + if s != nil { + tu.SetOwnerID(*s) + } + return tu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (tu *TemplateUpdate) ClearOwnerID() *TemplateUpdate { + tu.mutation.ClearOwnerID() + return tu +} + +// SetName sets the "name" field. +func (tu *TemplateUpdate) SetName(s string) *TemplateUpdate { + tu.mutation.SetName(s) + return tu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (tu *TemplateUpdate) SetNillableName(s *string) *TemplateUpdate { + if s != nil { + tu.SetName(*s) + } + return tu +} + +// SetTemplateType sets the "template_type" field. +func (tu *TemplateUpdate) SetTemplateType(et enums.DocumentType) *TemplateUpdate { + tu.mutation.SetTemplateType(et) + return tu +} + +// SetNillableTemplateType sets the "template_type" field if the given value is not nil. +func (tu *TemplateUpdate) SetNillableTemplateType(et *enums.DocumentType) *TemplateUpdate { + if et != nil { + tu.SetTemplateType(*et) + } + return tu +} + +// SetDescription sets the "description" field. +func (tu *TemplateUpdate) SetDescription(s string) *TemplateUpdate { + tu.mutation.SetDescription(s) + return tu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (tu *TemplateUpdate) SetNillableDescription(s *string) *TemplateUpdate { + if s != nil { + tu.SetDescription(*s) + } + return tu +} + +// ClearDescription clears the value of the "description" field. +func (tu *TemplateUpdate) ClearDescription() *TemplateUpdate { + tu.mutation.ClearDescription() + return tu +} + +// SetJsonconfig sets the "jsonconfig" field. +func (tu *TemplateUpdate) SetJsonconfig(co customtypes.JSONObject) *TemplateUpdate { + tu.mutation.SetJsonconfig(co) + return tu +} + +// SetUischema sets the "uischema" field. +func (tu *TemplateUpdate) SetUischema(co customtypes.JSONObject) *TemplateUpdate { + tu.mutation.SetUischema(co) + return tu +} + +// ClearUischema clears the value of the "uischema" field. +func (tu *TemplateUpdate) ClearUischema() *TemplateUpdate { + tu.mutation.ClearUischema() + return tu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (tu *TemplateUpdate) SetOwner(o *Organization) *TemplateUpdate { + return tu.SetOwnerID(o.ID) +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by IDs. +func (tu *TemplateUpdate) AddDocumentIDs(ids ...string) *TemplateUpdate { + tu.mutation.AddDocumentIDs(ids...) + return tu +} + +// AddDocuments adds the "documents" edges to the DocumentData entity. +func (tu *TemplateUpdate) AddDocuments(d ...*DocumentData) *TemplateUpdate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return tu.AddDocumentIDs(ids...) +} + +// Mutation returns the TemplateMutation object of the builder. +func (tu *TemplateUpdate) Mutation() *TemplateMutation { + return tu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (tu *TemplateUpdate) ClearOwner() *TemplateUpdate { + tu.mutation.ClearOwner() + return tu +} + +// ClearDocuments clears all "documents" edges to the DocumentData entity. +func (tu *TemplateUpdate) ClearDocuments() *TemplateUpdate { + tu.mutation.ClearDocuments() + return tu +} + +// RemoveDocumentIDs removes the "documents" edge to DocumentData entities by IDs. +func (tu *TemplateUpdate) RemoveDocumentIDs(ids ...string) *TemplateUpdate { + tu.mutation.RemoveDocumentIDs(ids...) + return tu +} + +// RemoveDocuments removes "documents" edges to DocumentData entities. +func (tu *TemplateUpdate) RemoveDocuments(d ...*DocumentData) *TemplateUpdate { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return tu.RemoveDocumentIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (tu *TemplateUpdate) Save(ctx context.Context) (int, error) { + if err := tu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, tu.sqlSave, tu.mutation, tu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (tu *TemplateUpdate) SaveX(ctx context.Context) int { + affected, err := tu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (tu *TemplateUpdate) Exec(ctx context.Context) error { + _, err := tu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tu *TemplateUpdate) ExecX(ctx context.Context) { + if err := tu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (tu *TemplateUpdate) defaults() error { + if _, ok := tu.mutation.UpdatedAt(); !ok && !tu.mutation.UpdatedAtCleared() { + if template.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized template.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := template.UpdateDefaultUpdatedAt() + tu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (tu *TemplateUpdate) check() error { + if v, ok := tu.mutation.OwnerID(); ok { + if err := template.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Template.owner_id": %w`, err)} + } + } + if v, ok := tu.mutation.Name(); ok { + if err := template.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Template.name": %w`, err)} + } + } + if v, ok := tu.mutation.TemplateType(); ok { + if err := template.TemplateTypeValidator(v); err != nil { + return &ValidationError{Name: "template_type", err: fmt.Errorf(`generated: validator failed for field "Template.template_type": %w`, err)} + } + } + return nil +} + +func (tu *TemplateUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := tu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(template.Table, template.Columns, sqlgraph.NewFieldSpec(template.FieldID, field.TypeString)) + if ps := tu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if tu.mutation.CreatedAtCleared() { + _spec.ClearField(template.FieldCreatedAt, field.TypeTime) + } + if value, ok := tu.mutation.UpdatedAt(); ok { + _spec.SetField(template.FieldUpdatedAt, field.TypeTime, value) + } + if tu.mutation.UpdatedAtCleared() { + _spec.ClearField(template.FieldUpdatedAt, field.TypeTime) + } + if tu.mutation.CreatedByCleared() { + _spec.ClearField(template.FieldCreatedBy, field.TypeString) + } + if value, ok := tu.mutation.UpdatedBy(); ok { + _spec.SetField(template.FieldUpdatedBy, field.TypeString, value) + } + if tu.mutation.UpdatedByCleared() { + _spec.ClearField(template.FieldUpdatedBy, field.TypeString) + } + if value, ok := tu.mutation.DeletedAt(); ok { + _spec.SetField(template.FieldDeletedAt, field.TypeTime, value) + } + if tu.mutation.DeletedAtCleared() { + _spec.ClearField(template.FieldDeletedAt, field.TypeTime) + } + if value, ok := tu.mutation.DeletedBy(); ok { + _spec.SetField(template.FieldDeletedBy, field.TypeString, value) + } + if tu.mutation.DeletedByCleared() { + _spec.ClearField(template.FieldDeletedBy, field.TypeString) + } + if value, ok := tu.mutation.Tags(); ok { + _spec.SetField(template.FieldTags, field.TypeJSON, value) + } + if value, ok := tu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, template.FieldTags, value) + }) + } + if tu.mutation.TagsCleared() { + _spec.ClearField(template.FieldTags, field.TypeJSON) + } + if value, ok := tu.mutation.Name(); ok { + _spec.SetField(template.FieldName, field.TypeString, value) + } + if value, ok := tu.mutation.TemplateType(); ok { + _spec.SetField(template.FieldTemplateType, field.TypeEnum, value) + } + if value, ok := tu.mutation.Description(); ok { + _spec.SetField(template.FieldDescription, field.TypeString, value) + } + if tu.mutation.DescriptionCleared() { + _spec.ClearField(template.FieldDescription, field.TypeString) + } + if value, ok := tu.mutation.Jsonconfig(); ok { + _spec.SetField(template.FieldJsonconfig, field.TypeJSON, value) + } + if value, ok := tu.mutation.Uischema(); ok { + _spec.SetField(template.FieldUischema, field.TypeJSON, value) + } + if tu.mutation.UischemaCleared() { + _spec.ClearField(template.FieldUischema, field.TypeJSON) + } + if tu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: template.OwnerTable, + Columns: []string{template.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = tu.schemaConfig.Template + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: template.OwnerTable, + Columns: []string{template.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = tu.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if tu.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = tu.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tu.mutation.RemovedDocumentsIDs(); len(nodes) > 0 && !tu.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = tu.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tu.mutation.DocumentsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = tu.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = tu.schemaConfig.Template + ctx = internal.NewSchemaConfigContext(ctx, tu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, tu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{template.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + tu.mutation.done = true + return n, nil +} + +// TemplateUpdateOne is the builder for updating a single Template entity. +type TemplateUpdateOne struct { + config + fields []string + hooks []Hook + mutation *TemplateMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (tuo *TemplateUpdateOne) SetUpdatedAt(t time.Time) *TemplateUpdateOne { + tuo.mutation.SetUpdatedAt(t) + return tuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (tuo *TemplateUpdateOne) ClearUpdatedAt() *TemplateUpdateOne { + tuo.mutation.ClearUpdatedAt() + return tuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (tuo *TemplateUpdateOne) SetUpdatedBy(s string) *TemplateUpdateOne { + tuo.mutation.SetUpdatedBy(s) + return tuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (tuo *TemplateUpdateOne) SetNillableUpdatedBy(s *string) *TemplateUpdateOne { + if s != nil { + tuo.SetUpdatedBy(*s) + } + return tuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (tuo *TemplateUpdateOne) ClearUpdatedBy() *TemplateUpdateOne { + tuo.mutation.ClearUpdatedBy() + return tuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (tuo *TemplateUpdateOne) SetDeletedAt(t time.Time) *TemplateUpdateOne { + tuo.mutation.SetDeletedAt(t) + return tuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (tuo *TemplateUpdateOne) SetNillableDeletedAt(t *time.Time) *TemplateUpdateOne { + if t != nil { + tuo.SetDeletedAt(*t) + } + return tuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (tuo *TemplateUpdateOne) ClearDeletedAt() *TemplateUpdateOne { + tuo.mutation.ClearDeletedAt() + return tuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (tuo *TemplateUpdateOne) SetDeletedBy(s string) *TemplateUpdateOne { + tuo.mutation.SetDeletedBy(s) + return tuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (tuo *TemplateUpdateOne) SetNillableDeletedBy(s *string) *TemplateUpdateOne { + if s != nil { + tuo.SetDeletedBy(*s) + } + return tuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (tuo *TemplateUpdateOne) ClearDeletedBy() *TemplateUpdateOne { + tuo.mutation.ClearDeletedBy() + return tuo +} + +// SetTags sets the "tags" field. +func (tuo *TemplateUpdateOne) SetTags(s []string) *TemplateUpdateOne { + tuo.mutation.SetTags(s) + return tuo +} + +// AppendTags appends s to the "tags" field. +func (tuo *TemplateUpdateOne) AppendTags(s []string) *TemplateUpdateOne { + tuo.mutation.AppendTags(s) + return tuo +} + +// ClearTags clears the value of the "tags" field. +func (tuo *TemplateUpdateOne) ClearTags() *TemplateUpdateOne { + tuo.mutation.ClearTags() + return tuo +} + +// SetOwnerID sets the "owner_id" field. +func (tuo *TemplateUpdateOne) SetOwnerID(s string) *TemplateUpdateOne { + tuo.mutation.SetOwnerID(s) + return tuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (tuo *TemplateUpdateOne) SetNillableOwnerID(s *string) *TemplateUpdateOne { + if s != nil { + tuo.SetOwnerID(*s) + } + return tuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (tuo *TemplateUpdateOne) ClearOwnerID() *TemplateUpdateOne { + tuo.mutation.ClearOwnerID() + return tuo +} + +// SetName sets the "name" field. +func (tuo *TemplateUpdateOne) SetName(s string) *TemplateUpdateOne { + tuo.mutation.SetName(s) + return tuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (tuo *TemplateUpdateOne) SetNillableName(s *string) *TemplateUpdateOne { + if s != nil { + tuo.SetName(*s) + } + return tuo +} + +// SetTemplateType sets the "template_type" field. +func (tuo *TemplateUpdateOne) SetTemplateType(et enums.DocumentType) *TemplateUpdateOne { + tuo.mutation.SetTemplateType(et) + return tuo +} + +// SetNillableTemplateType sets the "template_type" field if the given value is not nil. +func (tuo *TemplateUpdateOne) SetNillableTemplateType(et *enums.DocumentType) *TemplateUpdateOne { + if et != nil { + tuo.SetTemplateType(*et) + } + return tuo +} + +// SetDescription sets the "description" field. +func (tuo *TemplateUpdateOne) SetDescription(s string) *TemplateUpdateOne { + tuo.mutation.SetDescription(s) + return tuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (tuo *TemplateUpdateOne) SetNillableDescription(s *string) *TemplateUpdateOne { + if s != nil { + tuo.SetDescription(*s) + } + return tuo +} + +// ClearDescription clears the value of the "description" field. +func (tuo *TemplateUpdateOne) ClearDescription() *TemplateUpdateOne { + tuo.mutation.ClearDescription() + return tuo +} + +// SetJsonconfig sets the "jsonconfig" field. +func (tuo *TemplateUpdateOne) SetJsonconfig(co customtypes.JSONObject) *TemplateUpdateOne { + tuo.mutation.SetJsonconfig(co) + return tuo +} + +// SetUischema sets the "uischema" field. +func (tuo *TemplateUpdateOne) SetUischema(co customtypes.JSONObject) *TemplateUpdateOne { + tuo.mutation.SetUischema(co) + return tuo +} + +// ClearUischema clears the value of the "uischema" field. +func (tuo *TemplateUpdateOne) ClearUischema() *TemplateUpdateOne { + tuo.mutation.ClearUischema() + return tuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (tuo *TemplateUpdateOne) SetOwner(o *Organization) *TemplateUpdateOne { + return tuo.SetOwnerID(o.ID) +} + +// AddDocumentIDs adds the "documents" edge to the DocumentData entity by IDs. +func (tuo *TemplateUpdateOne) AddDocumentIDs(ids ...string) *TemplateUpdateOne { + tuo.mutation.AddDocumentIDs(ids...) + return tuo +} + +// AddDocuments adds the "documents" edges to the DocumentData entity. +func (tuo *TemplateUpdateOne) AddDocuments(d ...*DocumentData) *TemplateUpdateOne { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return tuo.AddDocumentIDs(ids...) +} + +// Mutation returns the TemplateMutation object of the builder. +func (tuo *TemplateUpdateOne) Mutation() *TemplateMutation { + return tuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (tuo *TemplateUpdateOne) ClearOwner() *TemplateUpdateOne { + tuo.mutation.ClearOwner() + return tuo +} + +// ClearDocuments clears all "documents" edges to the DocumentData entity. +func (tuo *TemplateUpdateOne) ClearDocuments() *TemplateUpdateOne { + tuo.mutation.ClearDocuments() + return tuo +} + +// RemoveDocumentIDs removes the "documents" edge to DocumentData entities by IDs. +func (tuo *TemplateUpdateOne) RemoveDocumentIDs(ids ...string) *TemplateUpdateOne { + tuo.mutation.RemoveDocumentIDs(ids...) + return tuo +} + +// RemoveDocuments removes "documents" edges to DocumentData entities. +func (tuo *TemplateUpdateOne) RemoveDocuments(d ...*DocumentData) *TemplateUpdateOne { + ids := make([]string, len(d)) + for i := range d { + ids[i] = d[i].ID + } + return tuo.RemoveDocumentIDs(ids...) +} + +// Where appends a list predicates to the TemplateUpdate builder. +func (tuo *TemplateUpdateOne) Where(ps ...predicate.Template) *TemplateUpdateOne { + tuo.mutation.Where(ps...) + return tuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (tuo *TemplateUpdateOne) Select(field string, fields ...string) *TemplateUpdateOne { + tuo.fields = append([]string{field}, fields...) + return tuo +} + +// Save executes the query and returns the updated Template entity. +func (tuo *TemplateUpdateOne) Save(ctx context.Context) (*Template, error) { + if err := tuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, tuo.sqlSave, tuo.mutation, tuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (tuo *TemplateUpdateOne) SaveX(ctx context.Context) *Template { + node, err := tuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (tuo *TemplateUpdateOne) Exec(ctx context.Context) error { + _, err := tuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tuo *TemplateUpdateOne) ExecX(ctx context.Context) { + if err := tuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (tuo *TemplateUpdateOne) defaults() error { + if _, ok := tuo.mutation.UpdatedAt(); !ok && !tuo.mutation.UpdatedAtCleared() { + if template.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized template.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := template.UpdateDefaultUpdatedAt() + tuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (tuo *TemplateUpdateOne) check() error { + if v, ok := tuo.mutation.OwnerID(); ok { + if err := template.OwnerIDValidator(v); err != nil { + return &ValidationError{Name: "owner_id", err: fmt.Errorf(`generated: validator failed for field "Template.owner_id": %w`, err)} + } + } + if v, ok := tuo.mutation.Name(); ok { + if err := template.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Template.name": %w`, err)} + } + } + if v, ok := tuo.mutation.TemplateType(); ok { + if err := template.TemplateTypeValidator(v); err != nil { + return &ValidationError{Name: "template_type", err: fmt.Errorf(`generated: validator failed for field "Template.template_type": %w`, err)} + } + } + return nil +} + +func (tuo *TemplateUpdateOne) sqlSave(ctx context.Context) (_node *Template, err error) { + if err := tuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(template.Table, template.Columns, sqlgraph.NewFieldSpec(template.FieldID, field.TypeString)) + id, ok := tuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Template.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := tuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, template.FieldID) + for _, f := range fields { + if !template.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != template.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := tuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if tuo.mutation.CreatedAtCleared() { + _spec.ClearField(template.FieldCreatedAt, field.TypeTime) + } + if value, ok := tuo.mutation.UpdatedAt(); ok { + _spec.SetField(template.FieldUpdatedAt, field.TypeTime, value) + } + if tuo.mutation.UpdatedAtCleared() { + _spec.ClearField(template.FieldUpdatedAt, field.TypeTime) + } + if tuo.mutation.CreatedByCleared() { + _spec.ClearField(template.FieldCreatedBy, field.TypeString) + } + if value, ok := tuo.mutation.UpdatedBy(); ok { + _spec.SetField(template.FieldUpdatedBy, field.TypeString, value) + } + if tuo.mutation.UpdatedByCleared() { + _spec.ClearField(template.FieldUpdatedBy, field.TypeString) + } + if value, ok := tuo.mutation.DeletedAt(); ok { + _spec.SetField(template.FieldDeletedAt, field.TypeTime, value) + } + if tuo.mutation.DeletedAtCleared() { + _spec.ClearField(template.FieldDeletedAt, field.TypeTime) + } + if value, ok := tuo.mutation.DeletedBy(); ok { + _spec.SetField(template.FieldDeletedBy, field.TypeString, value) + } + if tuo.mutation.DeletedByCleared() { + _spec.ClearField(template.FieldDeletedBy, field.TypeString) + } + if value, ok := tuo.mutation.Tags(); ok { + _spec.SetField(template.FieldTags, field.TypeJSON, value) + } + if value, ok := tuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, template.FieldTags, value) + }) + } + if tuo.mutation.TagsCleared() { + _spec.ClearField(template.FieldTags, field.TypeJSON) + } + if value, ok := tuo.mutation.Name(); ok { + _spec.SetField(template.FieldName, field.TypeString, value) + } + if value, ok := tuo.mutation.TemplateType(); ok { + _spec.SetField(template.FieldTemplateType, field.TypeEnum, value) + } + if value, ok := tuo.mutation.Description(); ok { + _spec.SetField(template.FieldDescription, field.TypeString, value) + } + if tuo.mutation.DescriptionCleared() { + _spec.ClearField(template.FieldDescription, field.TypeString) + } + if value, ok := tuo.mutation.Jsonconfig(); ok { + _spec.SetField(template.FieldJsonconfig, field.TypeJSON, value) + } + if value, ok := tuo.mutation.Uischema(); ok { + _spec.SetField(template.FieldUischema, field.TypeJSON, value) + } + if tuo.mutation.UischemaCleared() { + _spec.ClearField(template.FieldUischema, field.TypeJSON) + } + if tuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: template.OwnerTable, + Columns: []string{template.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = tuo.schemaConfig.Template + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: template.OwnerTable, + Columns: []string{template.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = tuo.schemaConfig.Template + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if tuo.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = tuo.schemaConfig.DocumentData + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tuo.mutation.RemovedDocumentsIDs(); len(nodes) > 0 && !tuo.mutation.DocumentsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = tuo.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tuo.mutation.DocumentsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: template.DocumentsTable, + Columns: []string{template.DocumentsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(documentdata.FieldID, field.TypeString), + }, + } + edge.Schema = tuo.schemaConfig.DocumentData + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = tuo.schemaConfig.Template + ctx = internal.NewSchemaConfigContext(ctx, tuo.schemaConfig) + _node = &Template{config: tuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, tuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{template.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + tuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/templatehistory.go b/internal/ent/generated/templatehistory.go new file mode 100644 index 0000000..3032321 --- /dev/null +++ b/internal/ent/generated/templatehistory.go @@ -0,0 +1,294 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// TemplateHistory is the model entity for the TemplateHistory schema. +type TemplateHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the template + Name string `json:"name,omitempty"` + // the type of the template, either a provided template or an implementation (document) + TemplateType enums.DocumentType `json:"template_type,omitempty"` + // the description of the template + Description string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig customtypes.JSONObject `json:"jsonconfig,omitempty"` + // the uischema for the template to render in the UI + Uischema customtypes.JSONObject `json:"uischema,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*TemplateHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case templatehistory.FieldTags, templatehistory.FieldJsonconfig, templatehistory.FieldUischema: + values[i] = new([]byte) + case templatehistory.FieldOperation: + values[i] = new(history.OpType) + case templatehistory.FieldID, templatehistory.FieldRef, templatehistory.FieldCreatedBy, templatehistory.FieldUpdatedBy, templatehistory.FieldDeletedBy, templatehistory.FieldMappingID, templatehistory.FieldOwnerID, templatehistory.FieldName, templatehistory.FieldTemplateType, templatehistory.FieldDescription: + values[i] = new(sql.NullString) + case templatehistory.FieldHistoryTime, templatehistory.FieldCreatedAt, templatehistory.FieldUpdatedAt, templatehistory.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the TemplateHistory fields. +func (th *TemplateHistory) 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 templatehistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + th.ID = value.String + } + case templatehistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + th.HistoryTime = value.Time + } + case templatehistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + th.Ref = value.String + } + case templatehistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + th.Operation = *value + } + case templatehistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + th.CreatedAt = value.Time + } + case templatehistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + th.UpdatedAt = value.Time + } + case templatehistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + th.CreatedBy = value.String + } + case templatehistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + th.UpdatedBy = value.String + } + case templatehistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + th.DeletedAt = value.Time + } + case templatehistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + th.DeletedBy = value.String + } + case templatehistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + th.MappingID = value.String + } + case templatehistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &th.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case templatehistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + th.OwnerID = value.String + } + case templatehistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + th.Name = value.String + } + case templatehistory.FieldTemplateType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field template_type", values[i]) + } else if value.Valid { + th.TemplateType = enums.DocumentType(value.String) + } + case templatehistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + th.Description = value.String + } + case templatehistory.FieldJsonconfig: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field jsonconfig", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &th.Jsonconfig); err != nil { + return fmt.Errorf("unmarshal field jsonconfig: %w", err) + } + } + case templatehistory.FieldUischema: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field uischema", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &th.Uischema); err != nil { + return fmt.Errorf("unmarshal field uischema: %w", err) + } + } + default: + th.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the TemplateHistory. +// This includes values selected through modifiers, order, etc. +func (th *TemplateHistory) Value(name string) (ent.Value, error) { + return th.selectValues.Get(name) +} + +// Update returns a builder for updating this TemplateHistory. +// Note that you need to call TemplateHistory.Unwrap() before calling this method if this TemplateHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (th *TemplateHistory) Update() *TemplateHistoryUpdateOne { + return NewTemplateHistoryClient(th.config).UpdateOne(th) +} + +// Unwrap unwraps the TemplateHistory 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 (th *TemplateHistory) Unwrap() *TemplateHistory { + _tx, ok := th.config.driver.(*txDriver) + if !ok { + panic("generated: TemplateHistory is not a transactional entity") + } + th.config.driver = _tx.drv + return th +} + +// String implements the fmt.Stringer. +func (th *TemplateHistory) String() string { + var builder strings.Builder + builder.WriteString("TemplateHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", th.ID)) + builder.WriteString("history_time=") + builder.WriteString(th.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(th.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", th.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(th.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(th.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(th.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(th.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(th.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(th.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(th.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", th.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(th.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(th.Name) + builder.WriteString(", ") + builder.WriteString("template_type=") + builder.WriteString(fmt.Sprintf("%v", th.TemplateType)) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(th.Description) + builder.WriteString(", ") + builder.WriteString("jsonconfig=") + builder.WriteString(fmt.Sprintf("%v", th.Jsonconfig)) + builder.WriteString(", ") + builder.WriteString("uischema=") + builder.WriteString(fmt.Sprintf("%v", th.Uischema)) + builder.WriteByte(')') + return builder.String() +} + +// TemplateHistories is a parsable slice of TemplateHistory. +type TemplateHistories []*TemplateHistory diff --git a/internal/ent/generated/templatehistory/templatehistory.go b/internal/ent/generated/templatehistory/templatehistory.go new file mode 100644 index 0000000..78931f3 --- /dev/null +++ b/internal/ent/generated/templatehistory/templatehistory.go @@ -0,0 +1,228 @@ +// Code generated by ent, DO NOT EDIT. + +package templatehistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the templatehistory type in the database. + Label = "template_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldTemplateType holds the string denoting the template_type field in the database. + FieldTemplateType = "template_type" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldJsonconfig holds the string denoting the jsonconfig field in the database. + FieldJsonconfig = "jsonconfig" + // FieldUischema holds the string denoting the uischema field in the database. + FieldUischema = "uischema" + // Table holds the table name of the templatehistory in the database. + Table = "template_history" +) + +// Columns holds all SQL columns for templatehistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldName, + FieldTemplateType, + FieldDescription, + FieldJsonconfig, + FieldUischema, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("templatehistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultTemplateType enums.DocumentType = "DOCUMENT" + +// TemplateTypeValidator is a validator for the "template_type" field enum values. It is called by the builders before save. +func TemplateTypeValidator(tt enums.DocumentType) error { + switch tt.String() { + case "ROOTTEMPLATE", "DOCUMENT": + return nil + default: + return fmt.Errorf("templatehistory: invalid enum value for template_type field: %q", tt) + } +} + +// OrderOption defines the ordering options for the TemplateHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByTemplateType orders the results by the template_type field. +func ByTemplateType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTemplateType, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.DocumentType must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.DocumentType)(nil) + // enums.DocumentType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.DocumentType)(nil) +) diff --git a/internal/ent/generated/templatehistory/where.go b/internal/ent/generated/templatehistory/where.go new file mode 100644 index 0000000..72be654 --- /dev/null +++ b/internal/ent/generated/templatehistory/where.go @@ -0,0 +1,982 @@ +// Code generated by ent, DO NOT EDIT. + +package templatehistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldDescription, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldName, v)) +} + +// TemplateTypeEQ applies the EQ predicate on the "template_type" field. +func TemplateTypeEQ(v enums.DocumentType) predicate.TemplateHistory { + vc := v + return predicate.TemplateHistory(sql.FieldEQ(FieldTemplateType, vc)) +} + +// TemplateTypeNEQ applies the NEQ predicate on the "template_type" field. +func TemplateTypeNEQ(v enums.DocumentType) predicate.TemplateHistory { + vc := v + return predicate.TemplateHistory(sql.FieldNEQ(FieldTemplateType, vc)) +} + +// TemplateTypeIn applies the In predicate on the "template_type" field. +func TemplateTypeIn(vs ...enums.DocumentType) predicate.TemplateHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.TemplateHistory(sql.FieldIn(FieldTemplateType, v...)) +} + +// TemplateTypeNotIn applies the NotIn predicate on the "template_type" field. +func TemplateTypeNotIn(vs ...enums.DocumentType) predicate.TemplateHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.TemplateHistory(sql.FieldNotIn(FieldTemplateType, v...)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// UischemaIsNil applies the IsNil predicate on the "uischema" field. +func UischemaIsNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldIsNull(FieldUischema)) +} + +// UischemaNotNil applies the NotNil predicate on the "uischema" field. +func UischemaNotNil() predicate.TemplateHistory { + return predicate.TemplateHistory(sql.FieldNotNull(FieldUischema)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.TemplateHistory) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.TemplateHistory) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.TemplateHistory) predicate.TemplateHistory { + return predicate.TemplateHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/templatehistory_create.go b/internal/ent/generated/templatehistory_create.go new file mode 100644 index 0000000..d8d60b6 --- /dev/null +++ b/internal/ent/generated/templatehistory_create.go @@ -0,0 +1,540 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// TemplateHistoryCreate is the builder for creating a TemplateHistory entity. +type TemplateHistoryCreate struct { + config + mutation *TemplateHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (thc *TemplateHistoryCreate) SetHistoryTime(t time.Time) *TemplateHistoryCreate { + thc.mutation.SetHistoryTime(t) + return thc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableHistoryTime(t *time.Time) *TemplateHistoryCreate { + if t != nil { + thc.SetHistoryTime(*t) + } + return thc +} + +// SetRef sets the "ref" field. +func (thc *TemplateHistoryCreate) SetRef(s string) *TemplateHistoryCreate { + thc.mutation.SetRef(s) + return thc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableRef(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetRef(*s) + } + return thc +} + +// SetOperation sets the "operation" field. +func (thc *TemplateHistoryCreate) SetOperation(ht history.OpType) *TemplateHistoryCreate { + thc.mutation.SetOperation(ht) + return thc +} + +// SetCreatedAt sets the "created_at" field. +func (thc *TemplateHistoryCreate) SetCreatedAt(t time.Time) *TemplateHistoryCreate { + thc.mutation.SetCreatedAt(t) + return thc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableCreatedAt(t *time.Time) *TemplateHistoryCreate { + if t != nil { + thc.SetCreatedAt(*t) + } + return thc +} + +// SetUpdatedAt sets the "updated_at" field. +func (thc *TemplateHistoryCreate) SetUpdatedAt(t time.Time) *TemplateHistoryCreate { + thc.mutation.SetUpdatedAt(t) + return thc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableUpdatedAt(t *time.Time) *TemplateHistoryCreate { + if t != nil { + thc.SetUpdatedAt(*t) + } + return thc +} + +// SetCreatedBy sets the "created_by" field. +func (thc *TemplateHistoryCreate) SetCreatedBy(s string) *TemplateHistoryCreate { + thc.mutation.SetCreatedBy(s) + return thc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableCreatedBy(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetCreatedBy(*s) + } + return thc +} + +// SetUpdatedBy sets the "updated_by" field. +func (thc *TemplateHistoryCreate) SetUpdatedBy(s string) *TemplateHistoryCreate { + thc.mutation.SetUpdatedBy(s) + return thc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableUpdatedBy(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetUpdatedBy(*s) + } + return thc +} + +// SetDeletedAt sets the "deleted_at" field. +func (thc *TemplateHistoryCreate) SetDeletedAt(t time.Time) *TemplateHistoryCreate { + thc.mutation.SetDeletedAt(t) + return thc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableDeletedAt(t *time.Time) *TemplateHistoryCreate { + if t != nil { + thc.SetDeletedAt(*t) + } + return thc +} + +// SetDeletedBy sets the "deleted_by" field. +func (thc *TemplateHistoryCreate) SetDeletedBy(s string) *TemplateHistoryCreate { + thc.mutation.SetDeletedBy(s) + return thc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableDeletedBy(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetDeletedBy(*s) + } + return thc +} + +// SetMappingID sets the "mapping_id" field. +func (thc *TemplateHistoryCreate) SetMappingID(s string) *TemplateHistoryCreate { + thc.mutation.SetMappingID(s) + return thc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableMappingID(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetMappingID(*s) + } + return thc +} + +// SetTags sets the "tags" field. +func (thc *TemplateHistoryCreate) SetTags(s []string) *TemplateHistoryCreate { + thc.mutation.SetTags(s) + return thc +} + +// SetOwnerID sets the "owner_id" field. +func (thc *TemplateHistoryCreate) SetOwnerID(s string) *TemplateHistoryCreate { + thc.mutation.SetOwnerID(s) + return thc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableOwnerID(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetOwnerID(*s) + } + return thc +} + +// SetName sets the "name" field. +func (thc *TemplateHistoryCreate) SetName(s string) *TemplateHistoryCreate { + thc.mutation.SetName(s) + return thc +} + +// SetTemplateType sets the "template_type" field. +func (thc *TemplateHistoryCreate) SetTemplateType(et enums.DocumentType) *TemplateHistoryCreate { + thc.mutation.SetTemplateType(et) + return thc +} + +// SetNillableTemplateType sets the "template_type" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableTemplateType(et *enums.DocumentType) *TemplateHistoryCreate { + if et != nil { + thc.SetTemplateType(*et) + } + return thc +} + +// SetDescription sets the "description" field. +func (thc *TemplateHistoryCreate) SetDescription(s string) *TemplateHistoryCreate { + thc.mutation.SetDescription(s) + return thc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableDescription(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetDescription(*s) + } + return thc +} + +// SetJsonconfig sets the "jsonconfig" field. +func (thc *TemplateHistoryCreate) SetJsonconfig(co customtypes.JSONObject) *TemplateHistoryCreate { + thc.mutation.SetJsonconfig(co) + return thc +} + +// SetUischema sets the "uischema" field. +func (thc *TemplateHistoryCreate) SetUischema(co customtypes.JSONObject) *TemplateHistoryCreate { + thc.mutation.SetUischema(co) + return thc +} + +// SetID sets the "id" field. +func (thc *TemplateHistoryCreate) SetID(s string) *TemplateHistoryCreate { + thc.mutation.SetID(s) + return thc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (thc *TemplateHistoryCreate) SetNillableID(s *string) *TemplateHistoryCreate { + if s != nil { + thc.SetID(*s) + } + return thc +} + +// Mutation returns the TemplateHistoryMutation object of the builder. +func (thc *TemplateHistoryCreate) Mutation() *TemplateHistoryMutation { + return thc.mutation +} + +// Save creates the TemplateHistory in the database. +func (thc *TemplateHistoryCreate) Save(ctx context.Context) (*TemplateHistory, error) { + if err := thc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, thc.sqlSave, thc.mutation, thc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (thc *TemplateHistoryCreate) SaveX(ctx context.Context) *TemplateHistory { + v, err := thc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (thc *TemplateHistoryCreate) Exec(ctx context.Context) error { + _, err := thc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (thc *TemplateHistoryCreate) ExecX(ctx context.Context) { + if err := thc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (thc *TemplateHistoryCreate) defaults() error { + if _, ok := thc.mutation.HistoryTime(); !ok { + if templatehistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized templatehistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := templatehistory.DefaultHistoryTime() + thc.mutation.SetHistoryTime(v) + } + if _, ok := thc.mutation.CreatedAt(); !ok { + if templatehistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized templatehistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := templatehistory.DefaultCreatedAt() + thc.mutation.SetCreatedAt(v) + } + if _, ok := thc.mutation.UpdatedAt(); !ok { + if templatehistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized templatehistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := templatehistory.DefaultUpdatedAt() + thc.mutation.SetUpdatedAt(v) + } + if _, ok := thc.mutation.MappingID(); !ok { + if templatehistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized templatehistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := templatehistory.DefaultMappingID() + thc.mutation.SetMappingID(v) + } + if _, ok := thc.mutation.Tags(); !ok { + v := templatehistory.DefaultTags + thc.mutation.SetTags(v) + } + if _, ok := thc.mutation.TemplateType(); !ok { + v := templatehistory.DefaultTemplateType + thc.mutation.SetTemplateType(v) + } + if _, ok := thc.mutation.ID(); !ok { + if templatehistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized templatehistory.DefaultID (forgotten import generated/runtime?)") + } + v := templatehistory.DefaultID() + thc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (thc *TemplateHistoryCreate) check() error { + if _, ok := thc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "TemplateHistory.history_time"`)} + } + if _, ok := thc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "TemplateHistory.operation"`)} + } + if v, ok := thc.mutation.Operation(); ok { + if err := templatehistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "TemplateHistory.operation": %w`, err)} + } + } + if _, ok := thc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "TemplateHistory.mapping_id"`)} + } + if _, ok := thc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "TemplateHistory.name"`)} + } + if _, ok := thc.mutation.TemplateType(); !ok { + return &ValidationError{Name: "template_type", err: errors.New(`generated: missing required field "TemplateHistory.template_type"`)} + } + if v, ok := thc.mutation.TemplateType(); ok { + if err := templatehistory.TemplateTypeValidator(v); err != nil { + return &ValidationError{Name: "template_type", err: fmt.Errorf(`generated: validator failed for field "TemplateHistory.template_type": %w`, err)} + } + } + if _, ok := thc.mutation.Jsonconfig(); !ok { + return &ValidationError{Name: "jsonconfig", err: errors.New(`generated: missing required field "TemplateHistory.jsonconfig"`)} + } + return nil +} + +func (thc *TemplateHistoryCreate) sqlSave(ctx context.Context) (*TemplateHistory, error) { + if err := thc.check(); err != nil { + return nil, err + } + _node, _spec := thc.createSpec() + if err := sqlgraph.CreateNode(ctx, thc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected TemplateHistory.ID type: %T", _spec.ID.Value) + } + } + thc.mutation.id = &_node.ID + thc.mutation.done = true + return _node, nil +} + +func (thc *TemplateHistoryCreate) createSpec() (*TemplateHistory, *sqlgraph.CreateSpec) { + var ( + _node = &TemplateHistory{config: thc.config} + _spec = sqlgraph.NewCreateSpec(templatehistory.Table, sqlgraph.NewFieldSpec(templatehistory.FieldID, field.TypeString)) + ) + _spec.Schema = thc.schemaConfig.TemplateHistory + if id, ok := thc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := thc.mutation.HistoryTime(); ok { + _spec.SetField(templatehistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := thc.mutation.Ref(); ok { + _spec.SetField(templatehistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := thc.mutation.Operation(); ok { + _spec.SetField(templatehistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := thc.mutation.CreatedAt(); ok { + _spec.SetField(templatehistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := thc.mutation.UpdatedAt(); ok { + _spec.SetField(templatehistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := thc.mutation.CreatedBy(); ok { + _spec.SetField(templatehistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := thc.mutation.UpdatedBy(); ok { + _spec.SetField(templatehistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := thc.mutation.DeletedAt(); ok { + _spec.SetField(templatehistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := thc.mutation.DeletedBy(); ok { + _spec.SetField(templatehistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := thc.mutation.MappingID(); ok { + _spec.SetField(templatehistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := thc.mutation.Tags(); ok { + _spec.SetField(templatehistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := thc.mutation.OwnerID(); ok { + _spec.SetField(templatehistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := thc.mutation.Name(); ok { + _spec.SetField(templatehistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := thc.mutation.TemplateType(); ok { + _spec.SetField(templatehistory.FieldTemplateType, field.TypeEnum, value) + _node.TemplateType = value + } + if value, ok := thc.mutation.Description(); ok { + _spec.SetField(templatehistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := thc.mutation.Jsonconfig(); ok { + _spec.SetField(templatehistory.FieldJsonconfig, field.TypeJSON, value) + _node.Jsonconfig = value + } + if value, ok := thc.mutation.Uischema(); ok { + _spec.SetField(templatehistory.FieldUischema, field.TypeJSON, value) + _node.Uischema = value + } + return _node, _spec +} + +// TemplateHistoryCreateBulk is the builder for creating many TemplateHistory entities in bulk. +type TemplateHistoryCreateBulk struct { + config + err error + builders []*TemplateHistoryCreate +} + +// Save creates the TemplateHistory entities in the database. +func (thcb *TemplateHistoryCreateBulk) Save(ctx context.Context) ([]*TemplateHistory, error) { + if thcb.err != nil { + return nil, thcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(thcb.builders)) + nodes := make([]*TemplateHistory, len(thcb.builders)) + mutators := make([]Mutator, len(thcb.builders)) + for i := range thcb.builders { + func(i int, root context.Context) { + builder := thcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*TemplateHistoryMutation) + 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, thcb.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, thcb.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, thcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (thcb *TemplateHistoryCreateBulk) SaveX(ctx context.Context) []*TemplateHistory { + v, err := thcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (thcb *TemplateHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := thcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (thcb *TemplateHistoryCreateBulk) ExecX(ctx context.Context) { + if err := thcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/templatehistory_delete.go b/internal/ent/generated/templatehistory_delete.go new file mode 100644 index 0000000..508586c --- /dev/null +++ b/internal/ent/generated/templatehistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" +) + +// TemplateHistoryDelete is the builder for deleting a TemplateHistory entity. +type TemplateHistoryDelete struct { + config + hooks []Hook + mutation *TemplateHistoryMutation +} + +// Where appends a list predicates to the TemplateHistoryDelete builder. +func (thd *TemplateHistoryDelete) Where(ps ...predicate.TemplateHistory) *TemplateHistoryDelete { + thd.mutation.Where(ps...) + return thd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (thd *TemplateHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, thd.sqlExec, thd.mutation, thd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (thd *TemplateHistoryDelete) ExecX(ctx context.Context) int { + n, err := thd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (thd *TemplateHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(templatehistory.Table, sqlgraph.NewFieldSpec(templatehistory.FieldID, field.TypeString)) + _spec.Node.Schema = thd.schemaConfig.TemplateHistory + ctx = internal.NewSchemaConfigContext(ctx, thd.schemaConfig) + if ps := thd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, thd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + thd.mutation.done = true + return affected, err +} + +// TemplateHistoryDeleteOne is the builder for deleting a single TemplateHistory entity. +type TemplateHistoryDeleteOne struct { + thd *TemplateHistoryDelete +} + +// Where appends a list predicates to the TemplateHistoryDelete builder. +func (thdo *TemplateHistoryDeleteOne) Where(ps ...predicate.TemplateHistory) *TemplateHistoryDeleteOne { + thdo.thd.mutation.Where(ps...) + return thdo +} + +// Exec executes the deletion query. +func (thdo *TemplateHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := thdo.thd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{templatehistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (thdo *TemplateHistoryDeleteOne) ExecX(ctx context.Context) { + if err := thdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/templatehistory_query.go b/internal/ent/generated/templatehistory_query.go new file mode 100644 index 0000000..a09687e --- /dev/null +++ b/internal/ent/generated/templatehistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// TemplateHistoryQuery is the builder for querying TemplateHistory entities. +type TemplateHistoryQuery struct { + config + ctx *QueryContext + order []templatehistory.OrderOption + inters []Interceptor + predicates []predicate.TemplateHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*TemplateHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the TemplateHistoryQuery builder. +func (thq *TemplateHistoryQuery) Where(ps ...predicate.TemplateHistory) *TemplateHistoryQuery { + thq.predicates = append(thq.predicates, ps...) + return thq +} + +// Limit the number of records to be returned by this query. +func (thq *TemplateHistoryQuery) Limit(limit int) *TemplateHistoryQuery { + thq.ctx.Limit = &limit + return thq +} + +// Offset to start from. +func (thq *TemplateHistoryQuery) Offset(offset int) *TemplateHistoryQuery { + thq.ctx.Offset = &offset + return thq +} + +// 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 (thq *TemplateHistoryQuery) Unique(unique bool) *TemplateHistoryQuery { + thq.ctx.Unique = &unique + return thq +} + +// Order specifies how the records should be ordered. +func (thq *TemplateHistoryQuery) Order(o ...templatehistory.OrderOption) *TemplateHistoryQuery { + thq.order = append(thq.order, o...) + return thq +} + +// First returns the first TemplateHistory entity from the query. +// Returns a *NotFoundError when no TemplateHistory was found. +func (thq *TemplateHistoryQuery) First(ctx context.Context) (*TemplateHistory, error) { + nodes, err := thq.Limit(1).All(setContextOp(ctx, thq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{templatehistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (thq *TemplateHistoryQuery) FirstX(ctx context.Context) *TemplateHistory { + node, err := thq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first TemplateHistory ID from the query. +// Returns a *NotFoundError when no TemplateHistory ID was found. +func (thq *TemplateHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = thq.Limit(1).IDs(setContextOp(ctx, thq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{templatehistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (thq *TemplateHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := thq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single TemplateHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one TemplateHistory entity is found. +// Returns a *NotFoundError when no TemplateHistory entities are found. +func (thq *TemplateHistoryQuery) Only(ctx context.Context) (*TemplateHistory, error) { + nodes, err := thq.Limit(2).All(setContextOp(ctx, thq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{templatehistory.Label} + default: + return nil, &NotSingularError{templatehistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (thq *TemplateHistoryQuery) OnlyX(ctx context.Context) *TemplateHistory { + node, err := thq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only TemplateHistory ID in the query. +// Returns a *NotSingularError when more than one TemplateHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (thq *TemplateHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = thq.Limit(2).IDs(setContextOp(ctx, thq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{templatehistory.Label} + default: + err = &NotSingularError{templatehistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (thq *TemplateHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := thq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of TemplateHistories. +func (thq *TemplateHistoryQuery) All(ctx context.Context) ([]*TemplateHistory, error) { + ctx = setContextOp(ctx, thq.ctx, ent.OpQueryAll) + if err := thq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*TemplateHistory, *TemplateHistoryQuery]() + return withInterceptors[[]*TemplateHistory](ctx, thq, qr, thq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (thq *TemplateHistoryQuery) AllX(ctx context.Context) []*TemplateHistory { + nodes, err := thq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of TemplateHistory IDs. +func (thq *TemplateHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if thq.ctx.Unique == nil && thq.path != nil { + thq.Unique(true) + } + ctx = setContextOp(ctx, thq.ctx, ent.OpQueryIDs) + if err = thq.Select(templatehistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (thq *TemplateHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := thq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (thq *TemplateHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, thq.ctx, ent.OpQueryCount) + if err := thq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, thq, querierCount[*TemplateHistoryQuery](), thq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (thq *TemplateHistoryQuery) CountX(ctx context.Context) int { + count, err := thq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (thq *TemplateHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, thq.ctx, ent.OpQueryExist) + switch _, err := thq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (thq *TemplateHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := thq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the TemplateHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (thq *TemplateHistoryQuery) Clone() *TemplateHistoryQuery { + if thq == nil { + return nil + } + return &TemplateHistoryQuery{ + config: thq.config, + ctx: thq.ctx.Clone(), + order: append([]templatehistory.OrderOption{}, thq.order...), + inters: append([]Interceptor{}, thq.inters...), + predicates: append([]predicate.TemplateHistory{}, thq.predicates...), + // clone intermediate query. + sql: thq.sql.Clone(), + path: thq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.TemplateHistory.Query(). +// GroupBy(templatehistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (thq *TemplateHistoryQuery) GroupBy(field string, fields ...string) *TemplateHistoryGroupBy { + thq.ctx.Fields = append([]string{field}, fields...) + grbuild := &TemplateHistoryGroupBy{build: thq} + grbuild.flds = &thq.ctx.Fields + grbuild.label = templatehistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.TemplateHistory.Query(). +// Select(templatehistory.FieldHistoryTime). +// Scan(ctx, &v) +func (thq *TemplateHistoryQuery) Select(fields ...string) *TemplateHistorySelect { + thq.ctx.Fields = append(thq.ctx.Fields, fields...) + sbuild := &TemplateHistorySelect{TemplateHistoryQuery: thq} + sbuild.label = templatehistory.Label + sbuild.flds, sbuild.scan = &thq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a TemplateHistorySelect configured with the given aggregations. +func (thq *TemplateHistoryQuery) Aggregate(fns ...AggregateFunc) *TemplateHistorySelect { + return thq.Select().Aggregate(fns...) +} + +func (thq *TemplateHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range thq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, thq); err != nil { + return err + } + } + } + for _, f := range thq.ctx.Fields { + if !templatehistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if thq.path != nil { + prev, err := thq.path(ctx) + if err != nil { + return err + } + thq.sql = prev + } + if templatehistory.Policy == nil { + return errors.New("generated: uninitialized templatehistory.Policy (forgotten import generated/runtime?)") + } + if err := templatehistory.Policy.EvalQuery(ctx, thq); err != nil { + return err + } + return nil +} + +func (thq *TemplateHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*TemplateHistory, error) { + var ( + nodes = []*TemplateHistory{} + _spec = thq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*TemplateHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &TemplateHistory{config: thq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = thq.schemaConfig.TemplateHistory + ctx = internal.NewSchemaConfigContext(ctx, thq.schemaConfig) + if len(thq.modifiers) > 0 { + _spec.Modifiers = thq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, thq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range thq.loadTotal { + if err := thq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (thq *TemplateHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := thq.querySpec() + _spec.Node.Schema = thq.schemaConfig.TemplateHistory + ctx = internal.NewSchemaConfigContext(ctx, thq.schemaConfig) + if len(thq.modifiers) > 0 { + _spec.Modifiers = thq.modifiers + } + _spec.Node.Columns = thq.ctx.Fields + if len(thq.ctx.Fields) > 0 { + _spec.Unique = thq.ctx.Unique != nil && *thq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, thq.driver, _spec) +} + +func (thq *TemplateHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(templatehistory.Table, templatehistory.Columns, sqlgraph.NewFieldSpec(templatehistory.FieldID, field.TypeString)) + _spec.From = thq.sql + if unique := thq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if thq.path != nil { + _spec.Unique = true + } + if fields := thq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, templatehistory.FieldID) + for i := range fields { + if fields[i] != templatehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := thq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := thq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := thq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := thq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (thq *TemplateHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(thq.driver.Dialect()) + t1 := builder.Table(templatehistory.Table) + columns := thq.ctx.Fields + if len(columns) == 0 { + columns = templatehistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if thq.sql != nil { + selector = thq.sql + selector.Select(selector.Columns(columns...)...) + } + if thq.ctx.Unique != nil && *thq.ctx.Unique { + selector.Distinct() + } + t1.Schema(thq.schemaConfig.TemplateHistory) + ctx = internal.NewSchemaConfigContext(ctx, thq.schemaConfig) + selector.WithContext(ctx) + for _, p := range thq.predicates { + p(selector) + } + for _, p := range thq.order { + p(selector) + } + if offset := thq.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 := thq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// TemplateHistoryGroupBy is the group-by builder for TemplateHistory entities. +type TemplateHistoryGroupBy struct { + selector + build *TemplateHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (thgb *TemplateHistoryGroupBy) Aggregate(fns ...AggregateFunc) *TemplateHistoryGroupBy { + thgb.fns = append(thgb.fns, fns...) + return thgb +} + +// Scan applies the selector query and scans the result into the given value. +func (thgb *TemplateHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, thgb.build.ctx, ent.OpQueryGroupBy) + if err := thgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*TemplateHistoryQuery, *TemplateHistoryGroupBy](ctx, thgb.build, thgb, thgb.build.inters, v) +} + +func (thgb *TemplateHistoryGroupBy) sqlScan(ctx context.Context, root *TemplateHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(thgb.fns)) + for _, fn := range thgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*thgb.flds)+len(thgb.fns)) + for _, f := range *thgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*thgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := thgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// TemplateHistorySelect is the builder for selecting fields of TemplateHistory entities. +type TemplateHistorySelect struct { + *TemplateHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ths *TemplateHistorySelect) Aggregate(fns ...AggregateFunc) *TemplateHistorySelect { + ths.fns = append(ths.fns, fns...) + return ths +} + +// Scan applies the selector query and scans the result into the given value. +func (ths *TemplateHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ths.ctx, ent.OpQuerySelect) + if err := ths.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*TemplateHistoryQuery, *TemplateHistorySelect](ctx, ths.TemplateHistoryQuery, ths, ths.inters, v) +} + +func (ths *TemplateHistorySelect) sqlScan(ctx context.Context, root *TemplateHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ths.fns)) + for _, fn := range ths.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ths.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 := ths.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/templatehistory_update.go b/internal/ent/generated/templatehistory_update.go new file mode 100644 index 0000000..57e4b5f --- /dev/null +++ b/internal/ent/generated/templatehistory_update.go @@ -0,0 +1,735 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/templatehistory" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// TemplateHistoryUpdate is the builder for updating TemplateHistory entities. +type TemplateHistoryUpdate struct { + config + hooks []Hook + mutation *TemplateHistoryMutation +} + +// Where appends a list predicates to the TemplateHistoryUpdate builder. +func (thu *TemplateHistoryUpdate) Where(ps ...predicate.TemplateHistory) *TemplateHistoryUpdate { + thu.mutation.Where(ps...) + return thu +} + +// SetUpdatedAt sets the "updated_at" field. +func (thu *TemplateHistoryUpdate) SetUpdatedAt(t time.Time) *TemplateHistoryUpdate { + thu.mutation.SetUpdatedAt(t) + return thu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (thu *TemplateHistoryUpdate) ClearUpdatedAt() *TemplateHistoryUpdate { + thu.mutation.ClearUpdatedAt() + return thu +} + +// SetUpdatedBy sets the "updated_by" field. +func (thu *TemplateHistoryUpdate) SetUpdatedBy(s string) *TemplateHistoryUpdate { + thu.mutation.SetUpdatedBy(s) + return thu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (thu *TemplateHistoryUpdate) SetNillableUpdatedBy(s *string) *TemplateHistoryUpdate { + if s != nil { + thu.SetUpdatedBy(*s) + } + return thu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (thu *TemplateHistoryUpdate) ClearUpdatedBy() *TemplateHistoryUpdate { + thu.mutation.ClearUpdatedBy() + return thu +} + +// SetDeletedAt sets the "deleted_at" field. +func (thu *TemplateHistoryUpdate) SetDeletedAt(t time.Time) *TemplateHistoryUpdate { + thu.mutation.SetDeletedAt(t) + return thu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (thu *TemplateHistoryUpdate) SetNillableDeletedAt(t *time.Time) *TemplateHistoryUpdate { + if t != nil { + thu.SetDeletedAt(*t) + } + return thu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (thu *TemplateHistoryUpdate) ClearDeletedAt() *TemplateHistoryUpdate { + thu.mutation.ClearDeletedAt() + return thu +} + +// SetDeletedBy sets the "deleted_by" field. +func (thu *TemplateHistoryUpdate) SetDeletedBy(s string) *TemplateHistoryUpdate { + thu.mutation.SetDeletedBy(s) + return thu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (thu *TemplateHistoryUpdate) SetNillableDeletedBy(s *string) *TemplateHistoryUpdate { + if s != nil { + thu.SetDeletedBy(*s) + } + return thu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (thu *TemplateHistoryUpdate) ClearDeletedBy() *TemplateHistoryUpdate { + thu.mutation.ClearDeletedBy() + return thu +} + +// SetTags sets the "tags" field. +func (thu *TemplateHistoryUpdate) SetTags(s []string) *TemplateHistoryUpdate { + thu.mutation.SetTags(s) + return thu +} + +// AppendTags appends s to the "tags" field. +func (thu *TemplateHistoryUpdate) AppendTags(s []string) *TemplateHistoryUpdate { + thu.mutation.AppendTags(s) + return thu +} + +// ClearTags clears the value of the "tags" field. +func (thu *TemplateHistoryUpdate) ClearTags() *TemplateHistoryUpdate { + thu.mutation.ClearTags() + return thu +} + +// SetOwnerID sets the "owner_id" field. +func (thu *TemplateHistoryUpdate) SetOwnerID(s string) *TemplateHistoryUpdate { + thu.mutation.SetOwnerID(s) + return thu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (thu *TemplateHistoryUpdate) SetNillableOwnerID(s *string) *TemplateHistoryUpdate { + if s != nil { + thu.SetOwnerID(*s) + } + return thu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (thu *TemplateHistoryUpdate) ClearOwnerID() *TemplateHistoryUpdate { + thu.mutation.ClearOwnerID() + return thu +} + +// SetName sets the "name" field. +func (thu *TemplateHistoryUpdate) SetName(s string) *TemplateHistoryUpdate { + thu.mutation.SetName(s) + return thu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (thu *TemplateHistoryUpdate) SetNillableName(s *string) *TemplateHistoryUpdate { + if s != nil { + thu.SetName(*s) + } + return thu +} + +// SetTemplateType sets the "template_type" field. +func (thu *TemplateHistoryUpdate) SetTemplateType(et enums.DocumentType) *TemplateHistoryUpdate { + thu.mutation.SetTemplateType(et) + return thu +} + +// SetNillableTemplateType sets the "template_type" field if the given value is not nil. +func (thu *TemplateHistoryUpdate) SetNillableTemplateType(et *enums.DocumentType) *TemplateHistoryUpdate { + if et != nil { + thu.SetTemplateType(*et) + } + return thu +} + +// SetDescription sets the "description" field. +func (thu *TemplateHistoryUpdate) SetDescription(s string) *TemplateHistoryUpdate { + thu.mutation.SetDescription(s) + return thu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (thu *TemplateHistoryUpdate) SetNillableDescription(s *string) *TemplateHistoryUpdate { + if s != nil { + thu.SetDescription(*s) + } + return thu +} + +// ClearDescription clears the value of the "description" field. +func (thu *TemplateHistoryUpdate) ClearDescription() *TemplateHistoryUpdate { + thu.mutation.ClearDescription() + return thu +} + +// SetJsonconfig sets the "jsonconfig" field. +func (thu *TemplateHistoryUpdate) SetJsonconfig(co customtypes.JSONObject) *TemplateHistoryUpdate { + thu.mutation.SetJsonconfig(co) + return thu +} + +// SetUischema sets the "uischema" field. +func (thu *TemplateHistoryUpdate) SetUischema(co customtypes.JSONObject) *TemplateHistoryUpdate { + thu.mutation.SetUischema(co) + return thu +} + +// ClearUischema clears the value of the "uischema" field. +func (thu *TemplateHistoryUpdate) ClearUischema() *TemplateHistoryUpdate { + thu.mutation.ClearUischema() + return thu +} + +// Mutation returns the TemplateHistoryMutation object of the builder. +func (thu *TemplateHistoryUpdate) Mutation() *TemplateHistoryMutation { + return thu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (thu *TemplateHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := thu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, thu.sqlSave, thu.mutation, thu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (thu *TemplateHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := thu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (thu *TemplateHistoryUpdate) Exec(ctx context.Context) error { + _, err := thu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (thu *TemplateHistoryUpdate) ExecX(ctx context.Context) { + if err := thu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (thu *TemplateHistoryUpdate) defaults() error { + if _, ok := thu.mutation.UpdatedAt(); !ok && !thu.mutation.UpdatedAtCleared() { + if templatehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized templatehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := templatehistory.UpdateDefaultUpdatedAt() + thu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (thu *TemplateHistoryUpdate) check() error { + if v, ok := thu.mutation.TemplateType(); ok { + if err := templatehistory.TemplateTypeValidator(v); err != nil { + return &ValidationError{Name: "template_type", err: fmt.Errorf(`generated: validator failed for field "TemplateHistory.template_type": %w`, err)} + } + } + return nil +} + +func (thu *TemplateHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := thu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(templatehistory.Table, templatehistory.Columns, sqlgraph.NewFieldSpec(templatehistory.FieldID, field.TypeString)) + if ps := thu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if thu.mutation.RefCleared() { + _spec.ClearField(templatehistory.FieldRef, field.TypeString) + } + if thu.mutation.CreatedAtCleared() { + _spec.ClearField(templatehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := thu.mutation.UpdatedAt(); ok { + _spec.SetField(templatehistory.FieldUpdatedAt, field.TypeTime, value) + } + if thu.mutation.UpdatedAtCleared() { + _spec.ClearField(templatehistory.FieldUpdatedAt, field.TypeTime) + } + if thu.mutation.CreatedByCleared() { + _spec.ClearField(templatehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := thu.mutation.UpdatedBy(); ok { + _spec.SetField(templatehistory.FieldUpdatedBy, field.TypeString, value) + } + if thu.mutation.UpdatedByCleared() { + _spec.ClearField(templatehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := thu.mutation.DeletedAt(); ok { + _spec.SetField(templatehistory.FieldDeletedAt, field.TypeTime, value) + } + if thu.mutation.DeletedAtCleared() { + _spec.ClearField(templatehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := thu.mutation.DeletedBy(); ok { + _spec.SetField(templatehistory.FieldDeletedBy, field.TypeString, value) + } + if thu.mutation.DeletedByCleared() { + _spec.ClearField(templatehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := thu.mutation.Tags(); ok { + _spec.SetField(templatehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := thu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, templatehistory.FieldTags, value) + }) + } + if thu.mutation.TagsCleared() { + _spec.ClearField(templatehistory.FieldTags, field.TypeJSON) + } + if value, ok := thu.mutation.OwnerID(); ok { + _spec.SetField(templatehistory.FieldOwnerID, field.TypeString, value) + } + if thu.mutation.OwnerIDCleared() { + _spec.ClearField(templatehistory.FieldOwnerID, field.TypeString) + } + if value, ok := thu.mutation.Name(); ok { + _spec.SetField(templatehistory.FieldName, field.TypeString, value) + } + if value, ok := thu.mutation.TemplateType(); ok { + _spec.SetField(templatehistory.FieldTemplateType, field.TypeEnum, value) + } + if value, ok := thu.mutation.Description(); ok { + _spec.SetField(templatehistory.FieldDescription, field.TypeString, value) + } + if thu.mutation.DescriptionCleared() { + _spec.ClearField(templatehistory.FieldDescription, field.TypeString) + } + if value, ok := thu.mutation.Jsonconfig(); ok { + _spec.SetField(templatehistory.FieldJsonconfig, field.TypeJSON, value) + } + if value, ok := thu.mutation.Uischema(); ok { + _spec.SetField(templatehistory.FieldUischema, field.TypeJSON, value) + } + if thu.mutation.UischemaCleared() { + _spec.ClearField(templatehistory.FieldUischema, field.TypeJSON) + } + _spec.Node.Schema = thu.schemaConfig.TemplateHistory + ctx = internal.NewSchemaConfigContext(ctx, thu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, thu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{templatehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + thu.mutation.done = true + return n, nil +} + +// TemplateHistoryUpdateOne is the builder for updating a single TemplateHistory entity. +type TemplateHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *TemplateHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (thuo *TemplateHistoryUpdateOne) SetUpdatedAt(t time.Time) *TemplateHistoryUpdateOne { + thuo.mutation.SetUpdatedAt(t) + return thuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (thuo *TemplateHistoryUpdateOne) ClearUpdatedAt() *TemplateHistoryUpdateOne { + thuo.mutation.ClearUpdatedAt() + return thuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (thuo *TemplateHistoryUpdateOne) SetUpdatedBy(s string) *TemplateHistoryUpdateOne { + thuo.mutation.SetUpdatedBy(s) + return thuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (thuo *TemplateHistoryUpdateOne) SetNillableUpdatedBy(s *string) *TemplateHistoryUpdateOne { + if s != nil { + thuo.SetUpdatedBy(*s) + } + return thuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (thuo *TemplateHistoryUpdateOne) ClearUpdatedBy() *TemplateHistoryUpdateOne { + thuo.mutation.ClearUpdatedBy() + return thuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (thuo *TemplateHistoryUpdateOne) SetDeletedAt(t time.Time) *TemplateHistoryUpdateOne { + thuo.mutation.SetDeletedAt(t) + return thuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (thuo *TemplateHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *TemplateHistoryUpdateOne { + if t != nil { + thuo.SetDeletedAt(*t) + } + return thuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (thuo *TemplateHistoryUpdateOne) ClearDeletedAt() *TemplateHistoryUpdateOne { + thuo.mutation.ClearDeletedAt() + return thuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (thuo *TemplateHistoryUpdateOne) SetDeletedBy(s string) *TemplateHistoryUpdateOne { + thuo.mutation.SetDeletedBy(s) + return thuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (thuo *TemplateHistoryUpdateOne) SetNillableDeletedBy(s *string) *TemplateHistoryUpdateOne { + if s != nil { + thuo.SetDeletedBy(*s) + } + return thuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (thuo *TemplateHistoryUpdateOne) ClearDeletedBy() *TemplateHistoryUpdateOne { + thuo.mutation.ClearDeletedBy() + return thuo +} + +// SetTags sets the "tags" field. +func (thuo *TemplateHistoryUpdateOne) SetTags(s []string) *TemplateHistoryUpdateOne { + thuo.mutation.SetTags(s) + return thuo +} + +// AppendTags appends s to the "tags" field. +func (thuo *TemplateHistoryUpdateOne) AppendTags(s []string) *TemplateHistoryUpdateOne { + thuo.mutation.AppendTags(s) + return thuo +} + +// ClearTags clears the value of the "tags" field. +func (thuo *TemplateHistoryUpdateOne) ClearTags() *TemplateHistoryUpdateOne { + thuo.mutation.ClearTags() + return thuo +} + +// SetOwnerID sets the "owner_id" field. +func (thuo *TemplateHistoryUpdateOne) SetOwnerID(s string) *TemplateHistoryUpdateOne { + thuo.mutation.SetOwnerID(s) + return thuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (thuo *TemplateHistoryUpdateOne) SetNillableOwnerID(s *string) *TemplateHistoryUpdateOne { + if s != nil { + thuo.SetOwnerID(*s) + } + return thuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (thuo *TemplateHistoryUpdateOne) ClearOwnerID() *TemplateHistoryUpdateOne { + thuo.mutation.ClearOwnerID() + return thuo +} + +// SetName sets the "name" field. +func (thuo *TemplateHistoryUpdateOne) SetName(s string) *TemplateHistoryUpdateOne { + thuo.mutation.SetName(s) + return thuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (thuo *TemplateHistoryUpdateOne) SetNillableName(s *string) *TemplateHistoryUpdateOne { + if s != nil { + thuo.SetName(*s) + } + return thuo +} + +// SetTemplateType sets the "template_type" field. +func (thuo *TemplateHistoryUpdateOne) SetTemplateType(et enums.DocumentType) *TemplateHistoryUpdateOne { + thuo.mutation.SetTemplateType(et) + return thuo +} + +// SetNillableTemplateType sets the "template_type" field if the given value is not nil. +func (thuo *TemplateHistoryUpdateOne) SetNillableTemplateType(et *enums.DocumentType) *TemplateHistoryUpdateOne { + if et != nil { + thuo.SetTemplateType(*et) + } + return thuo +} + +// SetDescription sets the "description" field. +func (thuo *TemplateHistoryUpdateOne) SetDescription(s string) *TemplateHistoryUpdateOne { + thuo.mutation.SetDescription(s) + return thuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (thuo *TemplateHistoryUpdateOne) SetNillableDescription(s *string) *TemplateHistoryUpdateOne { + if s != nil { + thuo.SetDescription(*s) + } + return thuo +} + +// ClearDescription clears the value of the "description" field. +func (thuo *TemplateHistoryUpdateOne) ClearDescription() *TemplateHistoryUpdateOne { + thuo.mutation.ClearDescription() + return thuo +} + +// SetJsonconfig sets the "jsonconfig" field. +func (thuo *TemplateHistoryUpdateOne) SetJsonconfig(co customtypes.JSONObject) *TemplateHistoryUpdateOne { + thuo.mutation.SetJsonconfig(co) + return thuo +} + +// SetUischema sets the "uischema" field. +func (thuo *TemplateHistoryUpdateOne) SetUischema(co customtypes.JSONObject) *TemplateHistoryUpdateOne { + thuo.mutation.SetUischema(co) + return thuo +} + +// ClearUischema clears the value of the "uischema" field. +func (thuo *TemplateHistoryUpdateOne) ClearUischema() *TemplateHistoryUpdateOne { + thuo.mutation.ClearUischema() + return thuo +} + +// Mutation returns the TemplateHistoryMutation object of the builder. +func (thuo *TemplateHistoryUpdateOne) Mutation() *TemplateHistoryMutation { + return thuo.mutation +} + +// Where appends a list predicates to the TemplateHistoryUpdate builder. +func (thuo *TemplateHistoryUpdateOne) Where(ps ...predicate.TemplateHistory) *TemplateHistoryUpdateOne { + thuo.mutation.Where(ps...) + return thuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (thuo *TemplateHistoryUpdateOne) Select(field string, fields ...string) *TemplateHistoryUpdateOne { + thuo.fields = append([]string{field}, fields...) + return thuo +} + +// Save executes the query and returns the updated TemplateHistory entity. +func (thuo *TemplateHistoryUpdateOne) Save(ctx context.Context) (*TemplateHistory, error) { + if err := thuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, thuo.sqlSave, thuo.mutation, thuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (thuo *TemplateHistoryUpdateOne) SaveX(ctx context.Context) *TemplateHistory { + node, err := thuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (thuo *TemplateHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := thuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (thuo *TemplateHistoryUpdateOne) ExecX(ctx context.Context) { + if err := thuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (thuo *TemplateHistoryUpdateOne) defaults() error { + if _, ok := thuo.mutation.UpdatedAt(); !ok && !thuo.mutation.UpdatedAtCleared() { + if templatehistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized templatehistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := templatehistory.UpdateDefaultUpdatedAt() + thuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (thuo *TemplateHistoryUpdateOne) check() error { + if v, ok := thuo.mutation.TemplateType(); ok { + if err := templatehistory.TemplateTypeValidator(v); err != nil { + return &ValidationError{Name: "template_type", err: fmt.Errorf(`generated: validator failed for field "TemplateHistory.template_type": %w`, err)} + } + } + return nil +} + +func (thuo *TemplateHistoryUpdateOne) sqlSave(ctx context.Context) (_node *TemplateHistory, err error) { + if err := thuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(templatehistory.Table, templatehistory.Columns, sqlgraph.NewFieldSpec(templatehistory.FieldID, field.TypeString)) + id, ok := thuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "TemplateHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := thuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, templatehistory.FieldID) + for _, f := range fields { + if !templatehistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != templatehistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := thuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if thuo.mutation.RefCleared() { + _spec.ClearField(templatehistory.FieldRef, field.TypeString) + } + if thuo.mutation.CreatedAtCleared() { + _spec.ClearField(templatehistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := thuo.mutation.UpdatedAt(); ok { + _spec.SetField(templatehistory.FieldUpdatedAt, field.TypeTime, value) + } + if thuo.mutation.UpdatedAtCleared() { + _spec.ClearField(templatehistory.FieldUpdatedAt, field.TypeTime) + } + if thuo.mutation.CreatedByCleared() { + _spec.ClearField(templatehistory.FieldCreatedBy, field.TypeString) + } + if value, ok := thuo.mutation.UpdatedBy(); ok { + _spec.SetField(templatehistory.FieldUpdatedBy, field.TypeString, value) + } + if thuo.mutation.UpdatedByCleared() { + _spec.ClearField(templatehistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := thuo.mutation.DeletedAt(); ok { + _spec.SetField(templatehistory.FieldDeletedAt, field.TypeTime, value) + } + if thuo.mutation.DeletedAtCleared() { + _spec.ClearField(templatehistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := thuo.mutation.DeletedBy(); ok { + _spec.SetField(templatehistory.FieldDeletedBy, field.TypeString, value) + } + if thuo.mutation.DeletedByCleared() { + _spec.ClearField(templatehistory.FieldDeletedBy, field.TypeString) + } + if value, ok := thuo.mutation.Tags(); ok { + _spec.SetField(templatehistory.FieldTags, field.TypeJSON, value) + } + if value, ok := thuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, templatehistory.FieldTags, value) + }) + } + if thuo.mutation.TagsCleared() { + _spec.ClearField(templatehistory.FieldTags, field.TypeJSON) + } + if value, ok := thuo.mutation.OwnerID(); ok { + _spec.SetField(templatehistory.FieldOwnerID, field.TypeString, value) + } + if thuo.mutation.OwnerIDCleared() { + _spec.ClearField(templatehistory.FieldOwnerID, field.TypeString) + } + if value, ok := thuo.mutation.Name(); ok { + _spec.SetField(templatehistory.FieldName, field.TypeString, value) + } + if value, ok := thuo.mutation.TemplateType(); ok { + _spec.SetField(templatehistory.FieldTemplateType, field.TypeEnum, value) + } + if value, ok := thuo.mutation.Description(); ok { + _spec.SetField(templatehistory.FieldDescription, field.TypeString, value) + } + if thuo.mutation.DescriptionCleared() { + _spec.ClearField(templatehistory.FieldDescription, field.TypeString) + } + if value, ok := thuo.mutation.Jsonconfig(); ok { + _spec.SetField(templatehistory.FieldJsonconfig, field.TypeJSON, value) + } + if value, ok := thuo.mutation.Uischema(); ok { + _spec.SetField(templatehistory.FieldUischema, field.TypeJSON, value) + } + if thuo.mutation.UischemaCleared() { + _spec.ClearField(templatehistory.FieldUischema, field.TypeJSON) + } + _spec.Node.Schema = thuo.schemaConfig.TemplateHistory + ctx = internal.NewSchemaConfigContext(ctx, thuo.schemaConfig) + _node = &TemplateHistory{config: thuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, thuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{templatehistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + thuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/tfasetting.go b/internal/ent/generated/tfasetting.go new file mode 100644 index 0000000..5fcacc9 --- /dev/null +++ b/internal/ent/generated/tfasetting.go @@ -0,0 +1,301 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// TFASetting is the model entity for the TFASetting schema. +type TFASetting struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The user id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // TFA secret for the user + TfaSecret *string `json:"tfa_secret,omitempty"` + // specifies if the TFA device has been verified + Verified bool `json:"verified,omitempty"` + // recovery codes for 2fa + RecoveryCodes []string `json:"recovery_codes,omitempty"` + // specifies a user may complete authentication by verifying an OTP code delivered through SMS + PhoneOtpAllowed bool `json:"phone_otp_allowed,omitempty"` + // specifies a user may complete authentication by verifying an OTP code delivered through email + EmailOtpAllowed bool `json:"email_otp_allowed,omitempty"` + // specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + TotpAllowed bool `json:"totp_allowed,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the TFASettingQuery when eager-loading is set. + Edges TFASettingEdges `json:"edges"` + selectValues sql.SelectValues +} + +// TFASettingEdges holds the relations/edges for other nodes in the graph. +type TFASettingEdges struct { + // Owner holds the value of the owner edge. + Owner *User `json:"owner,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 +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e TFASettingEdges) OwnerOrErr() (*User, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*TFASetting) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case tfasetting.FieldTags, tfasetting.FieldRecoveryCodes: + values[i] = new([]byte) + case tfasetting.FieldVerified, tfasetting.FieldPhoneOtpAllowed, tfasetting.FieldEmailOtpAllowed, tfasetting.FieldTotpAllowed: + values[i] = new(sql.NullBool) + case tfasetting.FieldID, tfasetting.FieldCreatedBy, tfasetting.FieldUpdatedBy, tfasetting.FieldMappingID, tfasetting.FieldDeletedBy, tfasetting.FieldOwnerID, tfasetting.FieldTfaSecret: + values[i] = new(sql.NullString) + case tfasetting.FieldCreatedAt, tfasetting.FieldUpdatedAt, tfasetting.FieldDeletedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the TFASetting fields. +func (ts *TFASetting) 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 tfasetting.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + ts.ID = value.String + } + case tfasetting.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + ts.CreatedAt = value.Time + } + case tfasetting.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + ts.UpdatedAt = value.Time + } + case tfasetting.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + ts.CreatedBy = value.String + } + case tfasetting.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + ts.UpdatedBy = value.String + } + case tfasetting.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + ts.MappingID = value.String + } + case tfasetting.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + ts.DeletedAt = value.Time + } + case tfasetting.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + ts.DeletedBy = value.String + } + case tfasetting.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ts.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case tfasetting.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + ts.OwnerID = value.String + } + case tfasetting.FieldTfaSecret: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field tfa_secret", values[i]) + } else if value.Valid { + ts.TfaSecret = new(string) + *ts.TfaSecret = value.String + } + case tfasetting.FieldVerified: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field verified", values[i]) + } else if value.Valid { + ts.Verified = value.Bool + } + case tfasetting.FieldRecoveryCodes: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field recovery_codes", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ts.RecoveryCodes); err != nil { + return fmt.Errorf("unmarshal field recovery_codes: %w", err) + } + } + case tfasetting.FieldPhoneOtpAllowed: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field phone_otp_allowed", values[i]) + } else if value.Valid { + ts.PhoneOtpAllowed = value.Bool + } + case tfasetting.FieldEmailOtpAllowed: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field email_otp_allowed", values[i]) + } else if value.Valid { + ts.EmailOtpAllowed = value.Bool + } + case tfasetting.FieldTotpAllowed: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field totp_allowed", values[i]) + } else if value.Valid { + ts.TotpAllowed = value.Bool + } + default: + ts.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the TFASetting. +// This includes values selected through modifiers, order, etc. +func (ts *TFASetting) Value(name string) (ent.Value, error) { + return ts.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the TFASetting entity. +func (ts *TFASetting) QueryOwner() *UserQuery { + return NewTFASettingClient(ts.config).QueryOwner(ts) +} + +// Update returns a builder for updating this TFASetting. +// Note that you need to call TFASetting.Unwrap() before calling this method if this TFASetting +// was returned from a transaction, and the transaction was committed or rolled back. +func (ts *TFASetting) Update() *TFASettingUpdateOne { + return NewTFASettingClient(ts.config).UpdateOne(ts) +} + +// Unwrap unwraps the TFASetting 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 (ts *TFASetting) Unwrap() *TFASetting { + _tx, ok := ts.config.driver.(*txDriver) + if !ok { + panic("generated: TFASetting is not a transactional entity") + } + ts.config.driver = _tx.drv + return ts +} + +// String implements the fmt.Stringer. +func (ts *TFASetting) String() string { + var builder strings.Builder + builder.WriteString("TFASetting(") + builder.WriteString(fmt.Sprintf("id=%v, ", ts.ID)) + builder.WriteString("created_at=") + builder.WriteString(ts.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(ts.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(ts.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(ts.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(ts.MappingID) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(ts.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(ts.DeletedBy) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", ts.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(ts.OwnerID) + builder.WriteString(", ") + if v := ts.TfaSecret; v != nil { + builder.WriteString("tfa_secret=") + builder.WriteString(*v) + } + builder.WriteString(", ") + builder.WriteString("verified=") + builder.WriteString(fmt.Sprintf("%v", ts.Verified)) + builder.WriteString(", ") + builder.WriteString("recovery_codes=") + builder.WriteString(fmt.Sprintf("%v", ts.RecoveryCodes)) + builder.WriteString(", ") + builder.WriteString("phone_otp_allowed=") + builder.WriteString(fmt.Sprintf("%v", ts.PhoneOtpAllowed)) + builder.WriteString(", ") + builder.WriteString("email_otp_allowed=") + builder.WriteString(fmt.Sprintf("%v", ts.EmailOtpAllowed)) + builder.WriteString(", ") + builder.WriteString("totp_allowed=") + builder.WriteString(fmt.Sprintf("%v", ts.TotpAllowed)) + builder.WriteByte(')') + return builder.String() +} + +// TFASettings is a parsable slice of TFASetting. +type TFASettings []*TFASetting diff --git a/internal/ent/generated/tfasetting/tfasetting.go b/internal/ent/generated/tfasetting/tfasetting.go new file mode 100644 index 0000000..ddee1e0 --- /dev/null +++ b/internal/ent/generated/tfasetting/tfasetting.go @@ -0,0 +1,206 @@ +// Code generated by ent, DO NOT EDIT. + +package tfasetting + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the tfasetting type in the database. + Label = "tfa_setting" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldTfaSecret holds the string denoting the tfa_secret field in the database. + FieldTfaSecret = "tfa_secret" + // FieldVerified holds the string denoting the verified field in the database. + FieldVerified = "verified" + // FieldRecoveryCodes holds the string denoting the recovery_codes field in the database. + FieldRecoveryCodes = "recovery_codes" + // FieldPhoneOtpAllowed holds the string denoting the phone_otp_allowed field in the database. + FieldPhoneOtpAllowed = "phone_otp_allowed" + // FieldEmailOtpAllowed holds the string denoting the email_otp_allowed field in the database. + FieldEmailOtpAllowed = "email_otp_allowed" + // FieldTotpAllowed holds the string denoting the totp_allowed field in the database. + FieldTotpAllowed = "totp_allowed" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // Table holds the table name of the tfasetting in the database. + Table = "tfa_settings" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "tfa_settings" + // OwnerInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + OwnerInverseTable = "users" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" +) + +// Columns holds all SQL columns for tfasetting fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldDeletedAt, + FieldDeletedBy, + FieldTags, + FieldOwnerID, + FieldTfaSecret, + FieldVerified, + FieldRecoveryCodes, + FieldPhoneOtpAllowed, + FieldEmailOtpAllowed, + FieldTotpAllowed, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [1]ent.Interceptor + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultVerified holds the default value on creation for the "verified" field. + DefaultVerified bool + // DefaultPhoneOtpAllowed holds the default value on creation for the "phone_otp_allowed" field. + DefaultPhoneOtpAllowed bool + // DefaultEmailOtpAllowed holds the default value on creation for the "email_otp_allowed" field. + DefaultEmailOtpAllowed bool + // DefaultTotpAllowed holds the default value on creation for the "totp_allowed" field. + DefaultTotpAllowed bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the TFASetting queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByTfaSecret orders the results by the tfa_secret field. +func ByTfaSecret(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTfaSecret, opts...).ToFunc() +} + +// ByVerified orders the results by the verified field. +func ByVerified(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldVerified, opts...).ToFunc() +} + +// ByPhoneOtpAllowed orders the results by the phone_otp_allowed field. +func ByPhoneOtpAllowed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPhoneOtpAllowed, opts...).ToFunc() +} + +// ByEmailOtpAllowed orders the results by the email_otp_allowed field. +func ByEmailOtpAllowed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmailOtpAllowed, opts...).ToFunc() +} + +// ByTotpAllowed orders the results by the totp_allowed field. +func ByTotpAllowed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldTotpAllowed, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} diff --git a/internal/ent/generated/tfasetting/where.go b/internal/ent/generated/tfasetting/where.go new file mode 100644 index 0000000..9ba527e --- /dev/null +++ b/internal/ent/generated/tfasetting/where.go @@ -0,0 +1,857 @@ +// Code generated by ent, DO NOT EDIT. + +package tfasetting + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldOwnerID, v)) +} + +// TfaSecret applies equality check predicate on the "tfa_secret" field. It's identical to TfaSecretEQ. +func TfaSecret(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldTfaSecret, v)) +} + +// Verified applies equality check predicate on the "verified" field. It's identical to VerifiedEQ. +func Verified(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldVerified, v)) +} + +// PhoneOtpAllowed applies equality check predicate on the "phone_otp_allowed" field. It's identical to PhoneOtpAllowedEQ. +func PhoneOtpAllowed(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldPhoneOtpAllowed, v)) +} + +// EmailOtpAllowed applies equality check predicate on the "email_otp_allowed" field. It's identical to EmailOtpAllowedEQ. +func EmailOtpAllowed(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldEmailOtpAllowed, v)) +} + +// TotpAllowed applies equality check predicate on the "totp_allowed" field. It's identical to TotpAllowedEQ. +func TotpAllowed(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldTotpAllowed, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContainsFold(FieldMappingID, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// TfaSecretEQ applies the EQ predicate on the "tfa_secret" field. +func TfaSecretEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldTfaSecret, v)) +} + +// TfaSecretNEQ applies the NEQ predicate on the "tfa_secret" field. +func TfaSecretNEQ(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldTfaSecret, v)) +} + +// TfaSecretIn applies the In predicate on the "tfa_secret" field. +func TfaSecretIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldIn(FieldTfaSecret, vs...)) +} + +// TfaSecretNotIn applies the NotIn predicate on the "tfa_secret" field. +func TfaSecretNotIn(vs ...string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotIn(FieldTfaSecret, vs...)) +} + +// TfaSecretGT applies the GT predicate on the "tfa_secret" field. +func TfaSecretGT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGT(FieldTfaSecret, v)) +} + +// TfaSecretGTE applies the GTE predicate on the "tfa_secret" field. +func TfaSecretGTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldGTE(FieldTfaSecret, v)) +} + +// TfaSecretLT applies the LT predicate on the "tfa_secret" field. +func TfaSecretLT(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLT(FieldTfaSecret, v)) +} + +// TfaSecretLTE applies the LTE predicate on the "tfa_secret" field. +func TfaSecretLTE(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldLTE(FieldTfaSecret, v)) +} + +// TfaSecretContains applies the Contains predicate on the "tfa_secret" field. +func TfaSecretContains(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContains(FieldTfaSecret, v)) +} + +// TfaSecretHasPrefix applies the HasPrefix predicate on the "tfa_secret" field. +func TfaSecretHasPrefix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasPrefix(FieldTfaSecret, v)) +} + +// TfaSecretHasSuffix applies the HasSuffix predicate on the "tfa_secret" field. +func TfaSecretHasSuffix(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldHasSuffix(FieldTfaSecret, v)) +} + +// TfaSecretIsNil applies the IsNil predicate on the "tfa_secret" field. +func TfaSecretIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldTfaSecret)) +} + +// TfaSecretNotNil applies the NotNil predicate on the "tfa_secret" field. +func TfaSecretNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldTfaSecret)) +} + +// TfaSecretEqualFold applies the EqualFold predicate on the "tfa_secret" field. +func TfaSecretEqualFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEqualFold(FieldTfaSecret, v)) +} + +// TfaSecretContainsFold applies the ContainsFold predicate on the "tfa_secret" field. +func TfaSecretContainsFold(v string) predicate.TFASetting { + return predicate.TFASetting(sql.FieldContainsFold(FieldTfaSecret, v)) +} + +// VerifiedEQ applies the EQ predicate on the "verified" field. +func VerifiedEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldVerified, v)) +} + +// VerifiedNEQ applies the NEQ predicate on the "verified" field. +func VerifiedNEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldVerified, v)) +} + +// RecoveryCodesIsNil applies the IsNil predicate on the "recovery_codes" field. +func RecoveryCodesIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldRecoveryCodes)) +} + +// RecoveryCodesNotNil applies the NotNil predicate on the "recovery_codes" field. +func RecoveryCodesNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldRecoveryCodes)) +} + +// PhoneOtpAllowedEQ applies the EQ predicate on the "phone_otp_allowed" field. +func PhoneOtpAllowedEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldPhoneOtpAllowed, v)) +} + +// PhoneOtpAllowedNEQ applies the NEQ predicate on the "phone_otp_allowed" field. +func PhoneOtpAllowedNEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldPhoneOtpAllowed, v)) +} + +// PhoneOtpAllowedIsNil applies the IsNil predicate on the "phone_otp_allowed" field. +func PhoneOtpAllowedIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldPhoneOtpAllowed)) +} + +// PhoneOtpAllowedNotNil applies the NotNil predicate on the "phone_otp_allowed" field. +func PhoneOtpAllowedNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldPhoneOtpAllowed)) +} + +// EmailOtpAllowedEQ applies the EQ predicate on the "email_otp_allowed" field. +func EmailOtpAllowedEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldEmailOtpAllowed, v)) +} + +// EmailOtpAllowedNEQ applies the NEQ predicate on the "email_otp_allowed" field. +func EmailOtpAllowedNEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldEmailOtpAllowed, v)) +} + +// EmailOtpAllowedIsNil applies the IsNil predicate on the "email_otp_allowed" field. +func EmailOtpAllowedIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldEmailOtpAllowed)) +} + +// EmailOtpAllowedNotNil applies the NotNil predicate on the "email_otp_allowed" field. +func EmailOtpAllowedNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldEmailOtpAllowed)) +} + +// TotpAllowedEQ applies the EQ predicate on the "totp_allowed" field. +func TotpAllowedEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldEQ(FieldTotpAllowed, v)) +} + +// TotpAllowedNEQ applies the NEQ predicate on the "totp_allowed" field. +func TotpAllowedNEQ(v bool) predicate.TFASetting { + return predicate.TFASetting(sql.FieldNEQ(FieldTotpAllowed, v)) +} + +// TotpAllowedIsNil applies the IsNil predicate on the "totp_allowed" field. +func TotpAllowedIsNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldIsNull(FieldTotpAllowed)) +} + +// TotpAllowedNotNil applies the NotNil predicate on the "totp_allowed" field. +func TotpAllowedNotNil() predicate.TFASetting { + return predicate.TFASetting(sql.FieldNotNull(FieldTotpAllowed)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.TFASetting { + return predicate.TFASetting(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.TFASetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.User) predicate.TFASetting { + return predicate.TFASetting(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.TFASetting + 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.TFASetting) predicate.TFASetting { + return predicate.TFASetting(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.TFASetting) predicate.TFASetting { + return predicate.TFASetting(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.TFASetting) predicate.TFASetting { + return predicate.TFASetting(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/tfasetting_create.go b/internal/ent/generated/tfasetting_create.go new file mode 100644 index 0000000..0131147 --- /dev/null +++ b/internal/ent/generated/tfasetting_create.go @@ -0,0 +1,528 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// TFASettingCreate is the builder for creating a TFASetting entity. +type TFASettingCreate struct { + config + mutation *TFASettingMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (tsc *TFASettingCreate) SetCreatedAt(t time.Time) *TFASettingCreate { + tsc.mutation.SetCreatedAt(t) + return tsc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableCreatedAt(t *time.Time) *TFASettingCreate { + if t != nil { + tsc.SetCreatedAt(*t) + } + return tsc +} + +// SetUpdatedAt sets the "updated_at" field. +func (tsc *TFASettingCreate) SetUpdatedAt(t time.Time) *TFASettingCreate { + tsc.mutation.SetUpdatedAt(t) + return tsc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableUpdatedAt(t *time.Time) *TFASettingCreate { + if t != nil { + tsc.SetUpdatedAt(*t) + } + return tsc +} + +// SetCreatedBy sets the "created_by" field. +func (tsc *TFASettingCreate) SetCreatedBy(s string) *TFASettingCreate { + tsc.mutation.SetCreatedBy(s) + return tsc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableCreatedBy(s *string) *TFASettingCreate { + if s != nil { + tsc.SetCreatedBy(*s) + } + return tsc +} + +// SetUpdatedBy sets the "updated_by" field. +func (tsc *TFASettingCreate) SetUpdatedBy(s string) *TFASettingCreate { + tsc.mutation.SetUpdatedBy(s) + return tsc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableUpdatedBy(s *string) *TFASettingCreate { + if s != nil { + tsc.SetUpdatedBy(*s) + } + return tsc +} + +// SetMappingID sets the "mapping_id" field. +func (tsc *TFASettingCreate) SetMappingID(s string) *TFASettingCreate { + tsc.mutation.SetMappingID(s) + return tsc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableMappingID(s *string) *TFASettingCreate { + if s != nil { + tsc.SetMappingID(*s) + } + return tsc +} + +// SetDeletedAt sets the "deleted_at" field. +func (tsc *TFASettingCreate) SetDeletedAt(t time.Time) *TFASettingCreate { + tsc.mutation.SetDeletedAt(t) + return tsc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableDeletedAt(t *time.Time) *TFASettingCreate { + if t != nil { + tsc.SetDeletedAt(*t) + } + return tsc +} + +// SetDeletedBy sets the "deleted_by" field. +func (tsc *TFASettingCreate) SetDeletedBy(s string) *TFASettingCreate { + tsc.mutation.SetDeletedBy(s) + return tsc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableDeletedBy(s *string) *TFASettingCreate { + if s != nil { + tsc.SetDeletedBy(*s) + } + return tsc +} + +// SetTags sets the "tags" field. +func (tsc *TFASettingCreate) SetTags(s []string) *TFASettingCreate { + tsc.mutation.SetTags(s) + return tsc +} + +// SetOwnerID sets the "owner_id" field. +func (tsc *TFASettingCreate) SetOwnerID(s string) *TFASettingCreate { + tsc.mutation.SetOwnerID(s) + return tsc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableOwnerID(s *string) *TFASettingCreate { + if s != nil { + tsc.SetOwnerID(*s) + } + return tsc +} + +// SetTfaSecret sets the "tfa_secret" field. +func (tsc *TFASettingCreate) SetTfaSecret(s string) *TFASettingCreate { + tsc.mutation.SetTfaSecret(s) + return tsc +} + +// SetNillableTfaSecret sets the "tfa_secret" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableTfaSecret(s *string) *TFASettingCreate { + if s != nil { + tsc.SetTfaSecret(*s) + } + return tsc +} + +// SetVerified sets the "verified" field. +func (tsc *TFASettingCreate) SetVerified(b bool) *TFASettingCreate { + tsc.mutation.SetVerified(b) + return tsc +} + +// SetNillableVerified sets the "verified" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableVerified(b *bool) *TFASettingCreate { + if b != nil { + tsc.SetVerified(*b) + } + return tsc +} + +// SetRecoveryCodes sets the "recovery_codes" field. +func (tsc *TFASettingCreate) SetRecoveryCodes(s []string) *TFASettingCreate { + tsc.mutation.SetRecoveryCodes(s) + return tsc +} + +// SetPhoneOtpAllowed sets the "phone_otp_allowed" field. +func (tsc *TFASettingCreate) SetPhoneOtpAllowed(b bool) *TFASettingCreate { + tsc.mutation.SetPhoneOtpAllowed(b) + return tsc +} + +// SetNillablePhoneOtpAllowed sets the "phone_otp_allowed" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillablePhoneOtpAllowed(b *bool) *TFASettingCreate { + if b != nil { + tsc.SetPhoneOtpAllowed(*b) + } + return tsc +} + +// SetEmailOtpAllowed sets the "email_otp_allowed" field. +func (tsc *TFASettingCreate) SetEmailOtpAllowed(b bool) *TFASettingCreate { + tsc.mutation.SetEmailOtpAllowed(b) + return tsc +} + +// SetNillableEmailOtpAllowed sets the "email_otp_allowed" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableEmailOtpAllowed(b *bool) *TFASettingCreate { + if b != nil { + tsc.SetEmailOtpAllowed(*b) + } + return tsc +} + +// SetTotpAllowed sets the "totp_allowed" field. +func (tsc *TFASettingCreate) SetTotpAllowed(b bool) *TFASettingCreate { + tsc.mutation.SetTotpAllowed(b) + return tsc +} + +// SetNillableTotpAllowed sets the "totp_allowed" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableTotpAllowed(b *bool) *TFASettingCreate { + if b != nil { + tsc.SetTotpAllowed(*b) + } + return tsc +} + +// SetID sets the "id" field. +func (tsc *TFASettingCreate) SetID(s string) *TFASettingCreate { + tsc.mutation.SetID(s) + return tsc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (tsc *TFASettingCreate) SetNillableID(s *string) *TFASettingCreate { + if s != nil { + tsc.SetID(*s) + } + return tsc +} + +// SetOwner sets the "owner" edge to the User entity. +func (tsc *TFASettingCreate) SetOwner(u *User) *TFASettingCreate { + return tsc.SetOwnerID(u.ID) +} + +// Mutation returns the TFASettingMutation object of the builder. +func (tsc *TFASettingCreate) Mutation() *TFASettingMutation { + return tsc.mutation +} + +// Save creates the TFASetting in the database. +func (tsc *TFASettingCreate) Save(ctx context.Context) (*TFASetting, error) { + if err := tsc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, tsc.sqlSave, tsc.mutation, tsc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (tsc *TFASettingCreate) SaveX(ctx context.Context) *TFASetting { + v, err := tsc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (tsc *TFASettingCreate) Exec(ctx context.Context) error { + _, err := tsc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tsc *TFASettingCreate) ExecX(ctx context.Context) { + if err := tsc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (tsc *TFASettingCreate) defaults() error { + if _, ok := tsc.mutation.CreatedAt(); !ok { + if tfasetting.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized tfasetting.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := tfasetting.DefaultCreatedAt() + tsc.mutation.SetCreatedAt(v) + } + if _, ok := tsc.mutation.UpdatedAt(); !ok { + if tfasetting.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized tfasetting.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := tfasetting.DefaultUpdatedAt() + tsc.mutation.SetUpdatedAt(v) + } + if _, ok := tsc.mutation.MappingID(); !ok { + if tfasetting.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized tfasetting.DefaultMappingID (forgotten import generated/runtime?)") + } + v := tfasetting.DefaultMappingID() + tsc.mutation.SetMappingID(v) + } + if _, ok := tsc.mutation.Tags(); !ok { + v := tfasetting.DefaultTags + tsc.mutation.SetTags(v) + } + if _, ok := tsc.mutation.Verified(); !ok { + v := tfasetting.DefaultVerified + tsc.mutation.SetVerified(v) + } + if _, ok := tsc.mutation.PhoneOtpAllowed(); !ok { + v := tfasetting.DefaultPhoneOtpAllowed + tsc.mutation.SetPhoneOtpAllowed(v) + } + if _, ok := tsc.mutation.EmailOtpAllowed(); !ok { + v := tfasetting.DefaultEmailOtpAllowed + tsc.mutation.SetEmailOtpAllowed(v) + } + if _, ok := tsc.mutation.TotpAllowed(); !ok { + v := tfasetting.DefaultTotpAllowed + tsc.mutation.SetTotpAllowed(v) + } + if _, ok := tsc.mutation.ID(); !ok { + if tfasetting.DefaultID == nil { + return fmt.Errorf("generated: uninitialized tfasetting.DefaultID (forgotten import generated/runtime?)") + } + v := tfasetting.DefaultID() + tsc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (tsc *TFASettingCreate) check() error { + if _, ok := tsc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "TFASetting.mapping_id"`)} + } + if _, ok := tsc.mutation.Verified(); !ok { + return &ValidationError{Name: "verified", err: errors.New(`generated: missing required field "TFASetting.verified"`)} + } + return nil +} + +func (tsc *TFASettingCreate) sqlSave(ctx context.Context) (*TFASetting, error) { + if err := tsc.check(); err != nil { + return nil, err + } + _node, _spec := tsc.createSpec() + if err := sqlgraph.CreateNode(ctx, tsc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected TFASetting.ID type: %T", _spec.ID.Value) + } + } + tsc.mutation.id = &_node.ID + tsc.mutation.done = true + return _node, nil +} + +func (tsc *TFASettingCreate) createSpec() (*TFASetting, *sqlgraph.CreateSpec) { + var ( + _node = &TFASetting{config: tsc.config} + _spec = sqlgraph.NewCreateSpec(tfasetting.Table, sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString)) + ) + _spec.Schema = tsc.schemaConfig.TFASetting + if id, ok := tsc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := tsc.mutation.CreatedAt(); ok { + _spec.SetField(tfasetting.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := tsc.mutation.UpdatedAt(); ok { + _spec.SetField(tfasetting.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := tsc.mutation.CreatedBy(); ok { + _spec.SetField(tfasetting.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := tsc.mutation.UpdatedBy(); ok { + _spec.SetField(tfasetting.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := tsc.mutation.MappingID(); ok { + _spec.SetField(tfasetting.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := tsc.mutation.DeletedAt(); ok { + _spec.SetField(tfasetting.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := tsc.mutation.DeletedBy(); ok { + _spec.SetField(tfasetting.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := tsc.mutation.Tags(); ok { + _spec.SetField(tfasetting.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := tsc.mutation.TfaSecret(); ok { + _spec.SetField(tfasetting.FieldTfaSecret, field.TypeString, value) + _node.TfaSecret = &value + } + if value, ok := tsc.mutation.Verified(); ok { + _spec.SetField(tfasetting.FieldVerified, field.TypeBool, value) + _node.Verified = value + } + if value, ok := tsc.mutation.RecoveryCodes(); ok { + _spec.SetField(tfasetting.FieldRecoveryCodes, field.TypeJSON, value) + _node.RecoveryCodes = value + } + if value, ok := tsc.mutation.PhoneOtpAllowed(); ok { + _spec.SetField(tfasetting.FieldPhoneOtpAllowed, field.TypeBool, value) + _node.PhoneOtpAllowed = value + } + if value, ok := tsc.mutation.EmailOtpAllowed(); ok { + _spec.SetField(tfasetting.FieldEmailOtpAllowed, field.TypeBool, value) + _node.EmailOtpAllowed = value + } + if value, ok := tsc.mutation.TotpAllowed(); ok { + _spec.SetField(tfasetting.FieldTotpAllowed, field.TypeBool, value) + _node.TotpAllowed = value + } + if nodes := tsc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: tfasetting.OwnerTable, + Columns: []string{tfasetting.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = tsc.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// TFASettingCreateBulk is the builder for creating many TFASetting entities in bulk. +type TFASettingCreateBulk struct { + config + err error + builders []*TFASettingCreate +} + +// Save creates the TFASetting entities in the database. +func (tscb *TFASettingCreateBulk) Save(ctx context.Context) ([]*TFASetting, error) { + if tscb.err != nil { + return nil, tscb.err + } + specs := make([]*sqlgraph.CreateSpec, len(tscb.builders)) + nodes := make([]*TFASetting, len(tscb.builders)) + mutators := make([]Mutator, len(tscb.builders)) + for i := range tscb.builders { + func(i int, root context.Context) { + builder := tscb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*TFASettingMutation) + 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, tscb.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, tscb.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, tscb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (tscb *TFASettingCreateBulk) SaveX(ctx context.Context) []*TFASetting { + v, err := tscb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (tscb *TFASettingCreateBulk) Exec(ctx context.Context) error { + _, err := tscb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tscb *TFASettingCreateBulk) ExecX(ctx context.Context) { + if err := tscb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/tfasetting_delete.go b/internal/ent/generated/tfasetting_delete.go new file mode 100644 index 0000000..0767733 --- /dev/null +++ b/internal/ent/generated/tfasetting_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" +) + +// TFASettingDelete is the builder for deleting a TFASetting entity. +type TFASettingDelete struct { + config + hooks []Hook + mutation *TFASettingMutation +} + +// Where appends a list predicates to the TFASettingDelete builder. +func (tsd *TFASettingDelete) Where(ps ...predicate.TFASetting) *TFASettingDelete { + tsd.mutation.Where(ps...) + return tsd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (tsd *TFASettingDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, tsd.sqlExec, tsd.mutation, tsd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (tsd *TFASettingDelete) ExecX(ctx context.Context) int { + n, err := tsd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (tsd *TFASettingDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(tfasetting.Table, sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString)) + _spec.Node.Schema = tsd.schemaConfig.TFASetting + ctx = internal.NewSchemaConfigContext(ctx, tsd.schemaConfig) + if ps := tsd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, tsd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + tsd.mutation.done = true + return affected, err +} + +// TFASettingDeleteOne is the builder for deleting a single TFASetting entity. +type TFASettingDeleteOne struct { + tsd *TFASettingDelete +} + +// Where appends a list predicates to the TFASettingDelete builder. +func (tsdo *TFASettingDeleteOne) Where(ps ...predicate.TFASetting) *TFASettingDeleteOne { + tsdo.tsd.mutation.Where(ps...) + return tsdo +} + +// Exec executes the deletion query. +func (tsdo *TFASettingDeleteOne) Exec(ctx context.Context) error { + n, err := tsdo.tsd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{tfasetting.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (tsdo *TFASettingDeleteOne) ExecX(ctx context.Context) { + if err := tsdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/tfasetting_query.go b/internal/ent/generated/tfasetting_query.go new file mode 100644 index 0000000..c61206e --- /dev/null +++ b/internal/ent/generated/tfasetting_query.go @@ -0,0 +1,631 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// TFASettingQuery is the builder for querying TFASetting entities. +type TFASettingQuery struct { + config + ctx *QueryContext + order []tfasetting.OrderOption + inters []Interceptor + predicates []predicate.TFASetting + withOwner *UserQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*TFASetting) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the TFASettingQuery builder. +func (tsq *TFASettingQuery) Where(ps ...predicate.TFASetting) *TFASettingQuery { + tsq.predicates = append(tsq.predicates, ps...) + return tsq +} + +// Limit the number of records to be returned by this query. +func (tsq *TFASettingQuery) Limit(limit int) *TFASettingQuery { + tsq.ctx.Limit = &limit + return tsq +} + +// Offset to start from. +func (tsq *TFASettingQuery) Offset(offset int) *TFASettingQuery { + tsq.ctx.Offset = &offset + return tsq +} + +// 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 (tsq *TFASettingQuery) Unique(unique bool) *TFASettingQuery { + tsq.ctx.Unique = &unique + return tsq +} + +// Order specifies how the records should be ordered. +func (tsq *TFASettingQuery) Order(o ...tfasetting.OrderOption) *TFASettingQuery { + tsq.order = append(tsq.order, o...) + return tsq +} + +// QueryOwner chains the current query on the "owner" edge. +func (tsq *TFASettingQuery) QueryOwner() *UserQuery { + query := (&UserClient{config: tsq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := tsq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := tsq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(tfasetting.Table, tfasetting.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, tfasetting.OwnerTable, tfasetting.OwnerColumn), + ) + schemaConfig := tsq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.TFASetting + fromU = sqlgraph.SetNeighbors(tsq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first TFASetting entity from the query. +// Returns a *NotFoundError when no TFASetting was found. +func (tsq *TFASettingQuery) First(ctx context.Context) (*TFASetting, error) { + nodes, err := tsq.Limit(1).All(setContextOp(ctx, tsq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{tfasetting.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (tsq *TFASettingQuery) FirstX(ctx context.Context) *TFASetting { + node, err := tsq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first TFASetting ID from the query. +// Returns a *NotFoundError when no TFASetting ID was found. +func (tsq *TFASettingQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = tsq.Limit(1).IDs(setContextOp(ctx, tsq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{tfasetting.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (tsq *TFASettingQuery) FirstIDX(ctx context.Context) string { + id, err := tsq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single TFASetting entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one TFASetting entity is found. +// Returns a *NotFoundError when no TFASetting entities are found. +func (tsq *TFASettingQuery) Only(ctx context.Context) (*TFASetting, error) { + nodes, err := tsq.Limit(2).All(setContextOp(ctx, tsq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{tfasetting.Label} + default: + return nil, &NotSingularError{tfasetting.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (tsq *TFASettingQuery) OnlyX(ctx context.Context) *TFASetting { + node, err := tsq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only TFASetting ID in the query. +// Returns a *NotSingularError when more than one TFASetting ID is found. +// Returns a *NotFoundError when no entities are found. +func (tsq *TFASettingQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = tsq.Limit(2).IDs(setContextOp(ctx, tsq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{tfasetting.Label} + default: + err = &NotSingularError{tfasetting.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (tsq *TFASettingQuery) OnlyIDX(ctx context.Context) string { + id, err := tsq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of TFASettings. +func (tsq *TFASettingQuery) All(ctx context.Context) ([]*TFASetting, error) { + ctx = setContextOp(ctx, tsq.ctx, ent.OpQueryAll) + if err := tsq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*TFASetting, *TFASettingQuery]() + return withInterceptors[[]*TFASetting](ctx, tsq, qr, tsq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (tsq *TFASettingQuery) AllX(ctx context.Context) []*TFASetting { + nodes, err := tsq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of TFASetting IDs. +func (tsq *TFASettingQuery) IDs(ctx context.Context) (ids []string, err error) { + if tsq.ctx.Unique == nil && tsq.path != nil { + tsq.Unique(true) + } + ctx = setContextOp(ctx, tsq.ctx, ent.OpQueryIDs) + if err = tsq.Select(tfasetting.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (tsq *TFASettingQuery) IDsX(ctx context.Context) []string { + ids, err := tsq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (tsq *TFASettingQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, tsq.ctx, ent.OpQueryCount) + if err := tsq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, tsq, querierCount[*TFASettingQuery](), tsq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (tsq *TFASettingQuery) CountX(ctx context.Context) int { + count, err := tsq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (tsq *TFASettingQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, tsq.ctx, ent.OpQueryExist) + switch _, err := tsq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (tsq *TFASettingQuery) ExistX(ctx context.Context) bool { + exist, err := tsq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the TFASettingQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (tsq *TFASettingQuery) Clone() *TFASettingQuery { + if tsq == nil { + return nil + } + return &TFASettingQuery{ + config: tsq.config, + ctx: tsq.ctx.Clone(), + order: append([]tfasetting.OrderOption{}, tsq.order...), + inters: append([]Interceptor{}, tsq.inters...), + predicates: append([]predicate.TFASetting{}, tsq.predicates...), + withOwner: tsq.withOwner.Clone(), + // clone intermediate query. + sql: tsq.sql.Clone(), + path: tsq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (tsq *TFASettingQuery) WithOwner(opts ...func(*UserQuery)) *TFASettingQuery { + query := (&UserClient{config: tsq.config}).Query() + for _, opt := range opts { + opt(query) + } + tsq.withOwner = query + return tsq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.TFASetting.Query(). +// GroupBy(tfasetting.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (tsq *TFASettingQuery) GroupBy(field string, fields ...string) *TFASettingGroupBy { + tsq.ctx.Fields = append([]string{field}, fields...) + grbuild := &TFASettingGroupBy{build: tsq} + grbuild.flds = &tsq.ctx.Fields + grbuild.label = tfasetting.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.TFASetting.Query(). +// Select(tfasetting.FieldCreatedAt). +// Scan(ctx, &v) +func (tsq *TFASettingQuery) Select(fields ...string) *TFASettingSelect { + tsq.ctx.Fields = append(tsq.ctx.Fields, fields...) + sbuild := &TFASettingSelect{TFASettingQuery: tsq} + sbuild.label = tfasetting.Label + sbuild.flds, sbuild.scan = &tsq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a TFASettingSelect configured with the given aggregations. +func (tsq *TFASettingQuery) Aggregate(fns ...AggregateFunc) *TFASettingSelect { + return tsq.Select().Aggregate(fns...) +} + +func (tsq *TFASettingQuery) prepareQuery(ctx context.Context) error { + for _, inter := range tsq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, tsq); err != nil { + return err + } + } + } + for _, f := range tsq.ctx.Fields { + if !tfasetting.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if tsq.path != nil { + prev, err := tsq.path(ctx) + if err != nil { + return err + } + tsq.sql = prev + } + return nil +} + +func (tsq *TFASettingQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*TFASetting, error) { + var ( + nodes = []*TFASetting{} + _spec = tsq.querySpec() + loadedTypes = [1]bool{ + tsq.withOwner != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*TFASetting).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &TFASetting{config: tsq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = tsq.schemaConfig.TFASetting + ctx = internal.NewSchemaConfigContext(ctx, tsq.schemaConfig) + if len(tsq.modifiers) > 0 { + _spec.Modifiers = tsq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, tsq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := tsq.withOwner; query != nil { + if err := tsq.loadOwner(ctx, query, nodes, nil, + func(n *TFASetting, e *User) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + for i := range tsq.loadTotal { + if err := tsq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (tsq *TFASettingQuery) loadOwner(ctx context.Context, query *UserQuery, nodes []*TFASetting, init func(*TFASetting), assign func(*TFASetting, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*TFASetting) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (tsq *TFASettingQuery) sqlCount(ctx context.Context) (int, error) { + _spec := tsq.querySpec() + _spec.Node.Schema = tsq.schemaConfig.TFASetting + ctx = internal.NewSchemaConfigContext(ctx, tsq.schemaConfig) + if len(tsq.modifiers) > 0 { + _spec.Modifiers = tsq.modifiers + } + _spec.Node.Columns = tsq.ctx.Fields + if len(tsq.ctx.Fields) > 0 { + _spec.Unique = tsq.ctx.Unique != nil && *tsq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, tsq.driver, _spec) +} + +func (tsq *TFASettingQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(tfasetting.Table, tfasetting.Columns, sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString)) + _spec.From = tsq.sql + if unique := tsq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if tsq.path != nil { + _spec.Unique = true + } + if fields := tsq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, tfasetting.FieldID) + for i := range fields { + if fields[i] != tfasetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if tsq.withOwner != nil { + _spec.Node.AddColumnOnce(tfasetting.FieldOwnerID) + } + } + if ps := tsq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := tsq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := tsq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := tsq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (tsq *TFASettingQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(tsq.driver.Dialect()) + t1 := builder.Table(tfasetting.Table) + columns := tsq.ctx.Fields + if len(columns) == 0 { + columns = tfasetting.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if tsq.sql != nil { + selector = tsq.sql + selector.Select(selector.Columns(columns...)...) + } + if tsq.ctx.Unique != nil && *tsq.ctx.Unique { + selector.Distinct() + } + t1.Schema(tsq.schemaConfig.TFASetting) + ctx = internal.NewSchemaConfigContext(ctx, tsq.schemaConfig) + selector.WithContext(ctx) + for _, p := range tsq.predicates { + p(selector) + } + for _, p := range tsq.order { + p(selector) + } + if offset := tsq.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 := tsq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// TFASettingGroupBy is the group-by builder for TFASetting entities. +type TFASettingGroupBy struct { + selector + build *TFASettingQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (tsgb *TFASettingGroupBy) Aggregate(fns ...AggregateFunc) *TFASettingGroupBy { + tsgb.fns = append(tsgb.fns, fns...) + return tsgb +} + +// Scan applies the selector query and scans the result into the given value. +func (tsgb *TFASettingGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, tsgb.build.ctx, ent.OpQueryGroupBy) + if err := tsgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*TFASettingQuery, *TFASettingGroupBy](ctx, tsgb.build, tsgb, tsgb.build.inters, v) +} + +func (tsgb *TFASettingGroupBy) sqlScan(ctx context.Context, root *TFASettingQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(tsgb.fns)) + for _, fn := range tsgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*tsgb.flds)+len(tsgb.fns)) + for _, f := range *tsgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*tsgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := tsgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// TFASettingSelect is the builder for selecting fields of TFASetting entities. +type TFASettingSelect struct { + *TFASettingQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (tss *TFASettingSelect) Aggregate(fns ...AggregateFunc) *TFASettingSelect { + tss.fns = append(tss.fns, fns...) + return tss +} + +// Scan applies the selector query and scans the result into the given value. +func (tss *TFASettingSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, tss.ctx, ent.OpQuerySelect) + if err := tss.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*TFASettingQuery, *TFASettingSelect](ctx, tss.TFASettingQuery, tss, tss.inters, v) +} + +func (tss *TFASettingSelect) sqlScan(ctx context.Context, root *TFASettingQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(tss.fns)) + for _, fn := range tss.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*tss.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 := tss.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/tfasetting_update.go b/internal/ent/generated/tfasetting_update.go new file mode 100644 index 0000000..6e3c475 --- /dev/null +++ b/internal/ent/generated/tfasetting_update.go @@ -0,0 +1,900 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// TFASettingUpdate is the builder for updating TFASetting entities. +type TFASettingUpdate struct { + config + hooks []Hook + mutation *TFASettingMutation +} + +// Where appends a list predicates to the TFASettingUpdate builder. +func (tsu *TFASettingUpdate) Where(ps ...predicate.TFASetting) *TFASettingUpdate { + tsu.mutation.Where(ps...) + return tsu +} + +// SetUpdatedAt sets the "updated_at" field. +func (tsu *TFASettingUpdate) SetUpdatedAt(t time.Time) *TFASettingUpdate { + tsu.mutation.SetUpdatedAt(t) + return tsu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (tsu *TFASettingUpdate) ClearUpdatedAt() *TFASettingUpdate { + tsu.mutation.ClearUpdatedAt() + return tsu +} + +// SetUpdatedBy sets the "updated_by" field. +func (tsu *TFASettingUpdate) SetUpdatedBy(s string) *TFASettingUpdate { + tsu.mutation.SetUpdatedBy(s) + return tsu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableUpdatedBy(s *string) *TFASettingUpdate { + if s != nil { + tsu.SetUpdatedBy(*s) + } + return tsu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (tsu *TFASettingUpdate) ClearUpdatedBy() *TFASettingUpdate { + tsu.mutation.ClearUpdatedBy() + return tsu +} + +// SetDeletedAt sets the "deleted_at" field. +func (tsu *TFASettingUpdate) SetDeletedAt(t time.Time) *TFASettingUpdate { + tsu.mutation.SetDeletedAt(t) + return tsu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableDeletedAt(t *time.Time) *TFASettingUpdate { + if t != nil { + tsu.SetDeletedAt(*t) + } + return tsu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (tsu *TFASettingUpdate) ClearDeletedAt() *TFASettingUpdate { + tsu.mutation.ClearDeletedAt() + return tsu +} + +// SetDeletedBy sets the "deleted_by" field. +func (tsu *TFASettingUpdate) SetDeletedBy(s string) *TFASettingUpdate { + tsu.mutation.SetDeletedBy(s) + return tsu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableDeletedBy(s *string) *TFASettingUpdate { + if s != nil { + tsu.SetDeletedBy(*s) + } + return tsu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (tsu *TFASettingUpdate) ClearDeletedBy() *TFASettingUpdate { + tsu.mutation.ClearDeletedBy() + return tsu +} + +// SetTags sets the "tags" field. +func (tsu *TFASettingUpdate) SetTags(s []string) *TFASettingUpdate { + tsu.mutation.SetTags(s) + return tsu +} + +// AppendTags appends s to the "tags" field. +func (tsu *TFASettingUpdate) AppendTags(s []string) *TFASettingUpdate { + tsu.mutation.AppendTags(s) + return tsu +} + +// ClearTags clears the value of the "tags" field. +func (tsu *TFASettingUpdate) ClearTags() *TFASettingUpdate { + tsu.mutation.ClearTags() + return tsu +} + +// SetOwnerID sets the "owner_id" field. +func (tsu *TFASettingUpdate) SetOwnerID(s string) *TFASettingUpdate { + tsu.mutation.SetOwnerID(s) + return tsu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableOwnerID(s *string) *TFASettingUpdate { + if s != nil { + tsu.SetOwnerID(*s) + } + return tsu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (tsu *TFASettingUpdate) ClearOwnerID() *TFASettingUpdate { + tsu.mutation.ClearOwnerID() + return tsu +} + +// SetTfaSecret sets the "tfa_secret" field. +func (tsu *TFASettingUpdate) SetTfaSecret(s string) *TFASettingUpdate { + tsu.mutation.SetTfaSecret(s) + return tsu +} + +// SetNillableTfaSecret sets the "tfa_secret" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableTfaSecret(s *string) *TFASettingUpdate { + if s != nil { + tsu.SetTfaSecret(*s) + } + return tsu +} + +// ClearTfaSecret clears the value of the "tfa_secret" field. +func (tsu *TFASettingUpdate) ClearTfaSecret() *TFASettingUpdate { + tsu.mutation.ClearTfaSecret() + return tsu +} + +// SetVerified sets the "verified" field. +func (tsu *TFASettingUpdate) SetVerified(b bool) *TFASettingUpdate { + tsu.mutation.SetVerified(b) + return tsu +} + +// SetNillableVerified sets the "verified" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableVerified(b *bool) *TFASettingUpdate { + if b != nil { + tsu.SetVerified(*b) + } + return tsu +} + +// SetRecoveryCodes sets the "recovery_codes" field. +func (tsu *TFASettingUpdate) SetRecoveryCodes(s []string) *TFASettingUpdate { + tsu.mutation.SetRecoveryCodes(s) + return tsu +} + +// AppendRecoveryCodes appends s to the "recovery_codes" field. +func (tsu *TFASettingUpdate) AppendRecoveryCodes(s []string) *TFASettingUpdate { + tsu.mutation.AppendRecoveryCodes(s) + return tsu +} + +// ClearRecoveryCodes clears the value of the "recovery_codes" field. +func (tsu *TFASettingUpdate) ClearRecoveryCodes() *TFASettingUpdate { + tsu.mutation.ClearRecoveryCodes() + return tsu +} + +// SetPhoneOtpAllowed sets the "phone_otp_allowed" field. +func (tsu *TFASettingUpdate) SetPhoneOtpAllowed(b bool) *TFASettingUpdate { + tsu.mutation.SetPhoneOtpAllowed(b) + return tsu +} + +// SetNillablePhoneOtpAllowed sets the "phone_otp_allowed" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillablePhoneOtpAllowed(b *bool) *TFASettingUpdate { + if b != nil { + tsu.SetPhoneOtpAllowed(*b) + } + return tsu +} + +// ClearPhoneOtpAllowed clears the value of the "phone_otp_allowed" field. +func (tsu *TFASettingUpdate) ClearPhoneOtpAllowed() *TFASettingUpdate { + tsu.mutation.ClearPhoneOtpAllowed() + return tsu +} + +// SetEmailOtpAllowed sets the "email_otp_allowed" field. +func (tsu *TFASettingUpdate) SetEmailOtpAllowed(b bool) *TFASettingUpdate { + tsu.mutation.SetEmailOtpAllowed(b) + return tsu +} + +// SetNillableEmailOtpAllowed sets the "email_otp_allowed" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableEmailOtpAllowed(b *bool) *TFASettingUpdate { + if b != nil { + tsu.SetEmailOtpAllowed(*b) + } + return tsu +} + +// ClearEmailOtpAllowed clears the value of the "email_otp_allowed" field. +func (tsu *TFASettingUpdate) ClearEmailOtpAllowed() *TFASettingUpdate { + tsu.mutation.ClearEmailOtpAllowed() + return tsu +} + +// SetTotpAllowed sets the "totp_allowed" field. +func (tsu *TFASettingUpdate) SetTotpAllowed(b bool) *TFASettingUpdate { + tsu.mutation.SetTotpAllowed(b) + return tsu +} + +// SetNillableTotpAllowed sets the "totp_allowed" field if the given value is not nil. +func (tsu *TFASettingUpdate) SetNillableTotpAllowed(b *bool) *TFASettingUpdate { + if b != nil { + tsu.SetTotpAllowed(*b) + } + return tsu +} + +// ClearTotpAllowed clears the value of the "totp_allowed" field. +func (tsu *TFASettingUpdate) ClearTotpAllowed() *TFASettingUpdate { + tsu.mutation.ClearTotpAllowed() + return tsu +} + +// SetOwner sets the "owner" edge to the User entity. +func (tsu *TFASettingUpdate) SetOwner(u *User) *TFASettingUpdate { + return tsu.SetOwnerID(u.ID) +} + +// Mutation returns the TFASettingMutation object of the builder. +func (tsu *TFASettingUpdate) Mutation() *TFASettingMutation { + return tsu.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (tsu *TFASettingUpdate) ClearOwner() *TFASettingUpdate { + tsu.mutation.ClearOwner() + return tsu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (tsu *TFASettingUpdate) Save(ctx context.Context) (int, error) { + if err := tsu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, tsu.sqlSave, tsu.mutation, tsu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (tsu *TFASettingUpdate) SaveX(ctx context.Context) int { + affected, err := tsu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (tsu *TFASettingUpdate) Exec(ctx context.Context) error { + _, err := tsu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tsu *TFASettingUpdate) ExecX(ctx context.Context) { + if err := tsu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (tsu *TFASettingUpdate) defaults() error { + if _, ok := tsu.mutation.UpdatedAt(); !ok && !tsu.mutation.UpdatedAtCleared() { + if tfasetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized tfasetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := tfasetting.UpdateDefaultUpdatedAt() + tsu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (tsu *TFASettingUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(tfasetting.Table, tfasetting.Columns, sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString)) + if ps := tsu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if tsu.mutation.CreatedAtCleared() { + _spec.ClearField(tfasetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := tsu.mutation.UpdatedAt(); ok { + _spec.SetField(tfasetting.FieldUpdatedAt, field.TypeTime, value) + } + if tsu.mutation.UpdatedAtCleared() { + _spec.ClearField(tfasetting.FieldUpdatedAt, field.TypeTime) + } + if tsu.mutation.CreatedByCleared() { + _spec.ClearField(tfasetting.FieldCreatedBy, field.TypeString) + } + if value, ok := tsu.mutation.UpdatedBy(); ok { + _spec.SetField(tfasetting.FieldUpdatedBy, field.TypeString, value) + } + if tsu.mutation.UpdatedByCleared() { + _spec.ClearField(tfasetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := tsu.mutation.DeletedAt(); ok { + _spec.SetField(tfasetting.FieldDeletedAt, field.TypeTime, value) + } + if tsu.mutation.DeletedAtCleared() { + _spec.ClearField(tfasetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := tsu.mutation.DeletedBy(); ok { + _spec.SetField(tfasetting.FieldDeletedBy, field.TypeString, value) + } + if tsu.mutation.DeletedByCleared() { + _spec.ClearField(tfasetting.FieldDeletedBy, field.TypeString) + } + if value, ok := tsu.mutation.Tags(); ok { + _spec.SetField(tfasetting.FieldTags, field.TypeJSON, value) + } + if value, ok := tsu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, tfasetting.FieldTags, value) + }) + } + if tsu.mutation.TagsCleared() { + _spec.ClearField(tfasetting.FieldTags, field.TypeJSON) + } + if value, ok := tsu.mutation.TfaSecret(); ok { + _spec.SetField(tfasetting.FieldTfaSecret, field.TypeString, value) + } + if tsu.mutation.TfaSecretCleared() { + _spec.ClearField(tfasetting.FieldTfaSecret, field.TypeString) + } + if value, ok := tsu.mutation.Verified(); ok { + _spec.SetField(tfasetting.FieldVerified, field.TypeBool, value) + } + if value, ok := tsu.mutation.RecoveryCodes(); ok { + _spec.SetField(tfasetting.FieldRecoveryCodes, field.TypeJSON, value) + } + if value, ok := tsu.mutation.AppendedRecoveryCodes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, tfasetting.FieldRecoveryCodes, value) + }) + } + if tsu.mutation.RecoveryCodesCleared() { + _spec.ClearField(tfasetting.FieldRecoveryCodes, field.TypeJSON) + } + if value, ok := tsu.mutation.PhoneOtpAllowed(); ok { + _spec.SetField(tfasetting.FieldPhoneOtpAllowed, field.TypeBool, value) + } + if tsu.mutation.PhoneOtpAllowedCleared() { + _spec.ClearField(tfasetting.FieldPhoneOtpAllowed, field.TypeBool) + } + if value, ok := tsu.mutation.EmailOtpAllowed(); ok { + _spec.SetField(tfasetting.FieldEmailOtpAllowed, field.TypeBool, value) + } + if tsu.mutation.EmailOtpAllowedCleared() { + _spec.ClearField(tfasetting.FieldEmailOtpAllowed, field.TypeBool) + } + if value, ok := tsu.mutation.TotpAllowed(); ok { + _spec.SetField(tfasetting.FieldTotpAllowed, field.TypeBool, value) + } + if tsu.mutation.TotpAllowedCleared() { + _spec.ClearField(tfasetting.FieldTotpAllowed, field.TypeBool) + } + if tsu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: tfasetting.OwnerTable, + Columns: []string{tfasetting.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = tsu.schemaConfig.TFASetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tsu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: tfasetting.OwnerTable, + Columns: []string{tfasetting.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = tsu.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = tsu.schemaConfig.TFASetting + ctx = internal.NewSchemaConfigContext(ctx, tsu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, tsu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{tfasetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + tsu.mutation.done = true + return n, nil +} + +// TFASettingUpdateOne is the builder for updating a single TFASetting entity. +type TFASettingUpdateOne struct { + config + fields []string + hooks []Hook + mutation *TFASettingMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (tsuo *TFASettingUpdateOne) SetUpdatedAt(t time.Time) *TFASettingUpdateOne { + tsuo.mutation.SetUpdatedAt(t) + return tsuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (tsuo *TFASettingUpdateOne) ClearUpdatedAt() *TFASettingUpdateOne { + tsuo.mutation.ClearUpdatedAt() + return tsuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (tsuo *TFASettingUpdateOne) SetUpdatedBy(s string) *TFASettingUpdateOne { + tsuo.mutation.SetUpdatedBy(s) + return tsuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableUpdatedBy(s *string) *TFASettingUpdateOne { + if s != nil { + tsuo.SetUpdatedBy(*s) + } + return tsuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (tsuo *TFASettingUpdateOne) ClearUpdatedBy() *TFASettingUpdateOne { + tsuo.mutation.ClearUpdatedBy() + return tsuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (tsuo *TFASettingUpdateOne) SetDeletedAt(t time.Time) *TFASettingUpdateOne { + tsuo.mutation.SetDeletedAt(t) + return tsuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableDeletedAt(t *time.Time) *TFASettingUpdateOne { + if t != nil { + tsuo.SetDeletedAt(*t) + } + return tsuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (tsuo *TFASettingUpdateOne) ClearDeletedAt() *TFASettingUpdateOne { + tsuo.mutation.ClearDeletedAt() + return tsuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (tsuo *TFASettingUpdateOne) SetDeletedBy(s string) *TFASettingUpdateOne { + tsuo.mutation.SetDeletedBy(s) + return tsuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableDeletedBy(s *string) *TFASettingUpdateOne { + if s != nil { + tsuo.SetDeletedBy(*s) + } + return tsuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (tsuo *TFASettingUpdateOne) ClearDeletedBy() *TFASettingUpdateOne { + tsuo.mutation.ClearDeletedBy() + return tsuo +} + +// SetTags sets the "tags" field. +func (tsuo *TFASettingUpdateOne) SetTags(s []string) *TFASettingUpdateOne { + tsuo.mutation.SetTags(s) + return tsuo +} + +// AppendTags appends s to the "tags" field. +func (tsuo *TFASettingUpdateOne) AppendTags(s []string) *TFASettingUpdateOne { + tsuo.mutation.AppendTags(s) + return tsuo +} + +// ClearTags clears the value of the "tags" field. +func (tsuo *TFASettingUpdateOne) ClearTags() *TFASettingUpdateOne { + tsuo.mutation.ClearTags() + return tsuo +} + +// SetOwnerID sets the "owner_id" field. +func (tsuo *TFASettingUpdateOne) SetOwnerID(s string) *TFASettingUpdateOne { + tsuo.mutation.SetOwnerID(s) + return tsuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableOwnerID(s *string) *TFASettingUpdateOne { + if s != nil { + tsuo.SetOwnerID(*s) + } + return tsuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (tsuo *TFASettingUpdateOne) ClearOwnerID() *TFASettingUpdateOne { + tsuo.mutation.ClearOwnerID() + return tsuo +} + +// SetTfaSecret sets the "tfa_secret" field. +func (tsuo *TFASettingUpdateOne) SetTfaSecret(s string) *TFASettingUpdateOne { + tsuo.mutation.SetTfaSecret(s) + return tsuo +} + +// SetNillableTfaSecret sets the "tfa_secret" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableTfaSecret(s *string) *TFASettingUpdateOne { + if s != nil { + tsuo.SetTfaSecret(*s) + } + return tsuo +} + +// ClearTfaSecret clears the value of the "tfa_secret" field. +func (tsuo *TFASettingUpdateOne) ClearTfaSecret() *TFASettingUpdateOne { + tsuo.mutation.ClearTfaSecret() + return tsuo +} + +// SetVerified sets the "verified" field. +func (tsuo *TFASettingUpdateOne) SetVerified(b bool) *TFASettingUpdateOne { + tsuo.mutation.SetVerified(b) + return tsuo +} + +// SetNillableVerified sets the "verified" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableVerified(b *bool) *TFASettingUpdateOne { + if b != nil { + tsuo.SetVerified(*b) + } + return tsuo +} + +// SetRecoveryCodes sets the "recovery_codes" field. +func (tsuo *TFASettingUpdateOne) SetRecoveryCodes(s []string) *TFASettingUpdateOne { + tsuo.mutation.SetRecoveryCodes(s) + return tsuo +} + +// AppendRecoveryCodes appends s to the "recovery_codes" field. +func (tsuo *TFASettingUpdateOne) AppendRecoveryCodes(s []string) *TFASettingUpdateOne { + tsuo.mutation.AppendRecoveryCodes(s) + return tsuo +} + +// ClearRecoveryCodes clears the value of the "recovery_codes" field. +func (tsuo *TFASettingUpdateOne) ClearRecoveryCodes() *TFASettingUpdateOne { + tsuo.mutation.ClearRecoveryCodes() + return tsuo +} + +// SetPhoneOtpAllowed sets the "phone_otp_allowed" field. +func (tsuo *TFASettingUpdateOne) SetPhoneOtpAllowed(b bool) *TFASettingUpdateOne { + tsuo.mutation.SetPhoneOtpAllowed(b) + return tsuo +} + +// SetNillablePhoneOtpAllowed sets the "phone_otp_allowed" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillablePhoneOtpAllowed(b *bool) *TFASettingUpdateOne { + if b != nil { + tsuo.SetPhoneOtpAllowed(*b) + } + return tsuo +} + +// ClearPhoneOtpAllowed clears the value of the "phone_otp_allowed" field. +func (tsuo *TFASettingUpdateOne) ClearPhoneOtpAllowed() *TFASettingUpdateOne { + tsuo.mutation.ClearPhoneOtpAllowed() + return tsuo +} + +// SetEmailOtpAllowed sets the "email_otp_allowed" field. +func (tsuo *TFASettingUpdateOne) SetEmailOtpAllowed(b bool) *TFASettingUpdateOne { + tsuo.mutation.SetEmailOtpAllowed(b) + return tsuo +} + +// SetNillableEmailOtpAllowed sets the "email_otp_allowed" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableEmailOtpAllowed(b *bool) *TFASettingUpdateOne { + if b != nil { + tsuo.SetEmailOtpAllowed(*b) + } + return tsuo +} + +// ClearEmailOtpAllowed clears the value of the "email_otp_allowed" field. +func (tsuo *TFASettingUpdateOne) ClearEmailOtpAllowed() *TFASettingUpdateOne { + tsuo.mutation.ClearEmailOtpAllowed() + return tsuo +} + +// SetTotpAllowed sets the "totp_allowed" field. +func (tsuo *TFASettingUpdateOne) SetTotpAllowed(b bool) *TFASettingUpdateOne { + tsuo.mutation.SetTotpAllowed(b) + return tsuo +} + +// SetNillableTotpAllowed sets the "totp_allowed" field if the given value is not nil. +func (tsuo *TFASettingUpdateOne) SetNillableTotpAllowed(b *bool) *TFASettingUpdateOne { + if b != nil { + tsuo.SetTotpAllowed(*b) + } + return tsuo +} + +// ClearTotpAllowed clears the value of the "totp_allowed" field. +func (tsuo *TFASettingUpdateOne) ClearTotpAllowed() *TFASettingUpdateOne { + tsuo.mutation.ClearTotpAllowed() + return tsuo +} + +// SetOwner sets the "owner" edge to the User entity. +func (tsuo *TFASettingUpdateOne) SetOwner(u *User) *TFASettingUpdateOne { + return tsuo.SetOwnerID(u.ID) +} + +// Mutation returns the TFASettingMutation object of the builder. +func (tsuo *TFASettingUpdateOne) Mutation() *TFASettingMutation { + return tsuo.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (tsuo *TFASettingUpdateOne) ClearOwner() *TFASettingUpdateOne { + tsuo.mutation.ClearOwner() + return tsuo +} + +// Where appends a list predicates to the TFASettingUpdate builder. +func (tsuo *TFASettingUpdateOne) Where(ps ...predicate.TFASetting) *TFASettingUpdateOne { + tsuo.mutation.Where(ps...) + return tsuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (tsuo *TFASettingUpdateOne) Select(field string, fields ...string) *TFASettingUpdateOne { + tsuo.fields = append([]string{field}, fields...) + return tsuo +} + +// Save executes the query and returns the updated TFASetting entity. +func (tsuo *TFASettingUpdateOne) Save(ctx context.Context) (*TFASetting, error) { + if err := tsuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, tsuo.sqlSave, tsuo.mutation, tsuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (tsuo *TFASettingUpdateOne) SaveX(ctx context.Context) *TFASetting { + node, err := tsuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (tsuo *TFASettingUpdateOne) Exec(ctx context.Context) error { + _, err := tsuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (tsuo *TFASettingUpdateOne) ExecX(ctx context.Context) { + if err := tsuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (tsuo *TFASettingUpdateOne) defaults() error { + if _, ok := tsuo.mutation.UpdatedAt(); !ok && !tsuo.mutation.UpdatedAtCleared() { + if tfasetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized tfasetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := tfasetting.UpdateDefaultUpdatedAt() + tsuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (tsuo *TFASettingUpdateOne) sqlSave(ctx context.Context) (_node *TFASetting, err error) { + _spec := sqlgraph.NewUpdateSpec(tfasetting.Table, tfasetting.Columns, sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString)) + id, ok := tsuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "TFASetting.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := tsuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, tfasetting.FieldID) + for _, f := range fields { + if !tfasetting.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != tfasetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := tsuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if tsuo.mutation.CreatedAtCleared() { + _spec.ClearField(tfasetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := tsuo.mutation.UpdatedAt(); ok { + _spec.SetField(tfasetting.FieldUpdatedAt, field.TypeTime, value) + } + if tsuo.mutation.UpdatedAtCleared() { + _spec.ClearField(tfasetting.FieldUpdatedAt, field.TypeTime) + } + if tsuo.mutation.CreatedByCleared() { + _spec.ClearField(tfasetting.FieldCreatedBy, field.TypeString) + } + if value, ok := tsuo.mutation.UpdatedBy(); ok { + _spec.SetField(tfasetting.FieldUpdatedBy, field.TypeString, value) + } + if tsuo.mutation.UpdatedByCleared() { + _spec.ClearField(tfasetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := tsuo.mutation.DeletedAt(); ok { + _spec.SetField(tfasetting.FieldDeletedAt, field.TypeTime, value) + } + if tsuo.mutation.DeletedAtCleared() { + _spec.ClearField(tfasetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := tsuo.mutation.DeletedBy(); ok { + _spec.SetField(tfasetting.FieldDeletedBy, field.TypeString, value) + } + if tsuo.mutation.DeletedByCleared() { + _spec.ClearField(tfasetting.FieldDeletedBy, field.TypeString) + } + if value, ok := tsuo.mutation.Tags(); ok { + _spec.SetField(tfasetting.FieldTags, field.TypeJSON, value) + } + if value, ok := tsuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, tfasetting.FieldTags, value) + }) + } + if tsuo.mutation.TagsCleared() { + _spec.ClearField(tfasetting.FieldTags, field.TypeJSON) + } + if value, ok := tsuo.mutation.TfaSecret(); ok { + _spec.SetField(tfasetting.FieldTfaSecret, field.TypeString, value) + } + if tsuo.mutation.TfaSecretCleared() { + _spec.ClearField(tfasetting.FieldTfaSecret, field.TypeString) + } + if value, ok := tsuo.mutation.Verified(); ok { + _spec.SetField(tfasetting.FieldVerified, field.TypeBool, value) + } + if value, ok := tsuo.mutation.RecoveryCodes(); ok { + _spec.SetField(tfasetting.FieldRecoveryCodes, field.TypeJSON, value) + } + if value, ok := tsuo.mutation.AppendedRecoveryCodes(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, tfasetting.FieldRecoveryCodes, value) + }) + } + if tsuo.mutation.RecoveryCodesCleared() { + _spec.ClearField(tfasetting.FieldRecoveryCodes, field.TypeJSON) + } + if value, ok := tsuo.mutation.PhoneOtpAllowed(); ok { + _spec.SetField(tfasetting.FieldPhoneOtpAllowed, field.TypeBool, value) + } + if tsuo.mutation.PhoneOtpAllowedCleared() { + _spec.ClearField(tfasetting.FieldPhoneOtpAllowed, field.TypeBool) + } + if value, ok := tsuo.mutation.EmailOtpAllowed(); ok { + _spec.SetField(tfasetting.FieldEmailOtpAllowed, field.TypeBool, value) + } + if tsuo.mutation.EmailOtpAllowedCleared() { + _spec.ClearField(tfasetting.FieldEmailOtpAllowed, field.TypeBool) + } + if value, ok := tsuo.mutation.TotpAllowed(); ok { + _spec.SetField(tfasetting.FieldTotpAllowed, field.TypeBool, value) + } + if tsuo.mutation.TotpAllowedCleared() { + _spec.ClearField(tfasetting.FieldTotpAllowed, field.TypeBool) + } + if tsuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: tfasetting.OwnerTable, + Columns: []string{tfasetting.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = tsuo.schemaConfig.TFASetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := tsuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: tfasetting.OwnerTable, + Columns: []string{tfasetting.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = tsuo.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = tsuo.schemaConfig.TFASetting + ctx = internal.NewSchemaConfigContext(ctx, tsuo.schemaConfig) + _node = &TFASetting{config: tsuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, tsuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{tfasetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + tsuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/tx.go b/internal/ent/generated/tx.go new file mode 100644 index 0000000..e228e70 --- /dev/null +++ b/internal/ent/generated/tx.go @@ -0,0 +1,378 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "sync" + + "entgo.io/ent/dialect" +) + +// Tx is a transactional client that is created by calling Client.Tx(). +type Tx struct { + config + // APIToken is the client for interacting with the APIToken builders. + APIToken *APITokenClient + // Contact is the client for interacting with the Contact builders. + Contact *ContactClient + // ContactHistory is the client for interacting with the ContactHistory builders. + ContactHistory *ContactHistoryClient + // DocumentData is the client for interacting with the DocumentData builders. + DocumentData *DocumentDataClient + // DocumentDataHistory is the client for interacting with the DocumentDataHistory builders. + DocumentDataHistory *DocumentDataHistoryClient + // EmailVerificationToken is the client for interacting with the EmailVerificationToken builders. + EmailVerificationToken *EmailVerificationTokenClient + // Entitlement is the client for interacting with the Entitlement builders. + Entitlement *EntitlementClient + // EntitlementHistory is the client for interacting with the EntitlementHistory builders. + EntitlementHistory *EntitlementHistoryClient + // EntitlementPlan is the client for interacting with the EntitlementPlan builders. + EntitlementPlan *EntitlementPlanClient + // EntitlementPlanFeature is the client for interacting with the EntitlementPlanFeature builders. + EntitlementPlanFeature *EntitlementPlanFeatureClient + // EntitlementPlanFeatureHistory is the client for interacting with the EntitlementPlanFeatureHistory builders. + EntitlementPlanFeatureHistory *EntitlementPlanFeatureHistoryClient + // EntitlementPlanHistory is the client for interacting with the EntitlementPlanHistory builders. + EntitlementPlanHistory *EntitlementPlanHistoryClient + // Entity is the client for interacting with the Entity builders. + Entity *EntityClient + // EntityHistory is the client for interacting with the EntityHistory builders. + EntityHistory *EntityHistoryClient + // EntityType is the client for interacting with the EntityType builders. + EntityType *EntityTypeClient + // EntityTypeHistory is the client for interacting with the EntityTypeHistory builders. + EntityTypeHistory *EntityTypeHistoryClient + // Event is the client for interacting with the Event builders. + Event *EventClient + // EventHistory is the client for interacting with the EventHistory builders. + EventHistory *EventHistoryClient + // Feature is the client for interacting with the Feature builders. + Feature *FeatureClient + // FeatureHistory is the client for interacting with the FeatureHistory builders. + FeatureHistory *FeatureHistoryClient + // File is the client for interacting with the File builders. + File *FileClient + // FileHistory is the client for interacting with the FileHistory builders. + FileHistory *FileHistoryClient + // Group is the client for interacting with the Group builders. + Group *GroupClient + // GroupHistory is the client for interacting with the GroupHistory builders. + GroupHistory *GroupHistoryClient + // GroupMembership is the client for interacting with the GroupMembership builders. + GroupMembership *GroupMembershipClient + // GroupMembershipHistory is the client for interacting with the GroupMembershipHistory builders. + GroupMembershipHistory *GroupMembershipHistoryClient + // GroupSetting is the client for interacting with the GroupSetting builders. + GroupSetting *GroupSettingClient + // GroupSettingHistory is the client for interacting with the GroupSettingHistory builders. + GroupSettingHistory *GroupSettingHistoryClient + // Hush is the client for interacting with the Hush builders. + Hush *HushClient + // HushHistory is the client for interacting with the HushHistory builders. + HushHistory *HushHistoryClient + // Integration is the client for interacting with the Integration builders. + Integration *IntegrationClient + // IntegrationHistory is the client for interacting with the IntegrationHistory builders. + IntegrationHistory *IntegrationHistoryClient + // Invite is the client for interacting with the Invite builders. + Invite *InviteClient + // Note is the client for interacting with the Note builders. + Note *NoteClient + // NoteHistory is the client for interacting with the NoteHistory builders. + NoteHistory *NoteHistoryClient + // OauthProvider is the client for interacting with the OauthProvider builders. + OauthProvider *OauthProviderClient + // OauthProviderHistory is the client for interacting with the OauthProviderHistory builders. + OauthProviderHistory *OauthProviderHistoryClient + // OhAuthTooToken is the client for interacting with the OhAuthTooToken builders. + OhAuthTooToken *OhAuthTooTokenClient + // OrgMembership is the client for interacting with the OrgMembership builders. + OrgMembership *OrgMembershipClient + // OrgMembershipHistory is the client for interacting with the OrgMembershipHistory builders. + OrgMembershipHistory *OrgMembershipHistoryClient + // Organization is the client for interacting with the Organization builders. + Organization *OrganizationClient + // OrganizationHistory is the client for interacting with the OrganizationHistory builders. + OrganizationHistory *OrganizationHistoryClient + // OrganizationSetting is the client for interacting with the OrganizationSetting builders. + OrganizationSetting *OrganizationSettingClient + // OrganizationSettingHistory is the client for interacting with the OrganizationSettingHistory builders. + OrganizationSettingHistory *OrganizationSettingHistoryClient + // PasswordResetToken is the client for interacting with the PasswordResetToken builders. + PasswordResetToken *PasswordResetTokenClient + // PersonalAccessToken is the client for interacting with the PersonalAccessToken builders. + PersonalAccessToken *PersonalAccessTokenClient + // Subscriber is the client for interacting with the Subscriber builders. + Subscriber *SubscriberClient + // TFASetting is the client for interacting with the TFASetting builders. + TFASetting *TFASettingClient + // Template is the client for interacting with the Template builders. + Template *TemplateClient + // TemplateHistory is the client for interacting with the TemplateHistory builders. + TemplateHistory *TemplateHistoryClient + // User is the client for interacting with the User builders. + User *UserClient + // UserHistory is the client for interacting with the UserHistory builders. + UserHistory *UserHistoryClient + // UserSetting is the client for interacting with the UserSetting builders. + UserSetting *UserSettingClient + // UserSettingHistory is the client for interacting with the UserSettingHistory builders. + UserSettingHistory *UserSettingHistoryClient + // Webauthn is the client for interacting with the Webauthn builders. + Webauthn *WebauthnClient + // Webhook is the client for interacting with the Webhook builders. + Webhook *WebhookClient + // WebhookHistory is the client for interacting with the WebhookHistory builders. + WebhookHistory *WebhookHistoryClient + + // lazily loaded. + client *Client + clientOnce sync.Once + // ctx lives for the life of the transaction. It is + // the same context used by the underlying connection. + ctx context.Context +} + +type ( + // Committer is the interface that wraps the Commit method. + Committer interface { + Commit(context.Context, *Tx) error + } + + // The CommitFunc type is an adapter to allow the use of ordinary + // function as a Committer. If f is a function with the appropriate + // signature, CommitFunc(f) is a Committer that calls f. + CommitFunc func(context.Context, *Tx) error + + // CommitHook defines the "commit middleware". A function that gets a Committer + // and returns a Committer. For example: + // + // hook := func(next ent.Committer) ent.Committer { + // return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { + // // Do some stuff before. + // if err := next.Commit(ctx, tx); err != nil { + // return err + // } + // // Do some stuff after. + // return nil + // }) + // } + // + CommitHook func(Committer) Committer +) + +// Commit calls f(ctx, m). +func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error { + return f(ctx, tx) +} + +// Commit commits the transaction. +func (tx *Tx) Commit() error { + txDriver := tx.config.driver.(*txDriver) + var fn Committer = CommitFunc(func(context.Context, *Tx) error { + return txDriver.tx.Commit() + }) + txDriver.mu.Lock() + hooks := append([]CommitHook(nil), txDriver.onCommit...) + txDriver.mu.Unlock() + for i := len(hooks) - 1; i >= 0; i-- { + fn = hooks[i](fn) + } + return fn.Commit(tx.ctx, tx) +} + +// OnCommit adds a hook to call on commit. +func (tx *Tx) OnCommit(f CommitHook) { + txDriver := tx.config.driver.(*txDriver) + txDriver.mu.Lock() + txDriver.onCommit = append(txDriver.onCommit, f) + txDriver.mu.Unlock() +} + +type ( + // Rollbacker is the interface that wraps the Rollback method. + Rollbacker interface { + Rollback(context.Context, *Tx) error + } + + // The RollbackFunc type is an adapter to allow the use of ordinary + // function as a Rollbacker. If f is a function with the appropriate + // signature, RollbackFunc(f) is a Rollbacker that calls f. + RollbackFunc func(context.Context, *Tx) error + + // RollbackHook defines the "rollback middleware". A function that gets a Rollbacker + // and returns a Rollbacker. For example: + // + // hook := func(next ent.Rollbacker) ent.Rollbacker { + // return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { + // // Do some stuff before. + // if err := next.Rollback(ctx, tx); err != nil { + // return err + // } + // // Do some stuff after. + // return nil + // }) + // } + // + RollbackHook func(Rollbacker) Rollbacker +) + +// Rollback calls f(ctx, m). +func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error { + return f(ctx, tx) +} + +// Rollback rollbacks the transaction. +func (tx *Tx) Rollback() error { + txDriver := tx.config.driver.(*txDriver) + var fn Rollbacker = RollbackFunc(func(context.Context, *Tx) error { + return txDriver.tx.Rollback() + }) + txDriver.mu.Lock() + hooks := append([]RollbackHook(nil), txDriver.onRollback...) + txDriver.mu.Unlock() + for i := len(hooks) - 1; i >= 0; i-- { + fn = hooks[i](fn) + } + return fn.Rollback(tx.ctx, tx) +} + +// OnRollback adds a hook to call on rollback. +func (tx *Tx) OnRollback(f RollbackHook) { + txDriver := tx.config.driver.(*txDriver) + txDriver.mu.Lock() + txDriver.onRollback = append(txDriver.onRollback, f) + txDriver.mu.Unlock() +} + +// Client returns a Client that binds to current transaction. +func (tx *Tx) Client() *Client { + tx.clientOnce.Do(func() { + tx.client = &Client{config: tx.config} + tx.client.init() + }) + return tx.client +} + +func (tx *Tx) init() { + tx.APIToken = NewAPITokenClient(tx.config) + tx.Contact = NewContactClient(tx.config) + tx.ContactHistory = NewContactHistoryClient(tx.config) + tx.DocumentData = NewDocumentDataClient(tx.config) + tx.DocumentDataHistory = NewDocumentDataHistoryClient(tx.config) + tx.EmailVerificationToken = NewEmailVerificationTokenClient(tx.config) + tx.Entitlement = NewEntitlementClient(tx.config) + tx.EntitlementHistory = NewEntitlementHistoryClient(tx.config) + tx.EntitlementPlan = NewEntitlementPlanClient(tx.config) + tx.EntitlementPlanFeature = NewEntitlementPlanFeatureClient(tx.config) + tx.EntitlementPlanFeatureHistory = NewEntitlementPlanFeatureHistoryClient(tx.config) + tx.EntitlementPlanHistory = NewEntitlementPlanHistoryClient(tx.config) + tx.Entity = NewEntityClient(tx.config) + tx.EntityHistory = NewEntityHistoryClient(tx.config) + tx.EntityType = NewEntityTypeClient(tx.config) + tx.EntityTypeHistory = NewEntityTypeHistoryClient(tx.config) + tx.Event = NewEventClient(tx.config) + tx.EventHistory = NewEventHistoryClient(tx.config) + tx.Feature = NewFeatureClient(tx.config) + tx.FeatureHistory = NewFeatureHistoryClient(tx.config) + tx.File = NewFileClient(tx.config) + tx.FileHistory = NewFileHistoryClient(tx.config) + tx.Group = NewGroupClient(tx.config) + tx.GroupHistory = NewGroupHistoryClient(tx.config) + tx.GroupMembership = NewGroupMembershipClient(tx.config) + tx.GroupMembershipHistory = NewGroupMembershipHistoryClient(tx.config) + tx.GroupSetting = NewGroupSettingClient(tx.config) + tx.GroupSettingHistory = NewGroupSettingHistoryClient(tx.config) + tx.Hush = NewHushClient(tx.config) + tx.HushHistory = NewHushHistoryClient(tx.config) + tx.Integration = NewIntegrationClient(tx.config) + tx.IntegrationHistory = NewIntegrationHistoryClient(tx.config) + tx.Invite = NewInviteClient(tx.config) + tx.Note = NewNoteClient(tx.config) + tx.NoteHistory = NewNoteHistoryClient(tx.config) + tx.OauthProvider = NewOauthProviderClient(tx.config) + tx.OauthProviderHistory = NewOauthProviderHistoryClient(tx.config) + tx.OhAuthTooToken = NewOhAuthTooTokenClient(tx.config) + tx.OrgMembership = NewOrgMembershipClient(tx.config) + tx.OrgMembershipHistory = NewOrgMembershipHistoryClient(tx.config) + tx.Organization = NewOrganizationClient(tx.config) + tx.OrganizationHistory = NewOrganizationHistoryClient(tx.config) + tx.OrganizationSetting = NewOrganizationSettingClient(tx.config) + tx.OrganizationSettingHistory = NewOrganizationSettingHistoryClient(tx.config) + tx.PasswordResetToken = NewPasswordResetTokenClient(tx.config) + tx.PersonalAccessToken = NewPersonalAccessTokenClient(tx.config) + tx.Subscriber = NewSubscriberClient(tx.config) + tx.TFASetting = NewTFASettingClient(tx.config) + tx.Template = NewTemplateClient(tx.config) + tx.TemplateHistory = NewTemplateHistoryClient(tx.config) + tx.User = NewUserClient(tx.config) + tx.UserHistory = NewUserHistoryClient(tx.config) + tx.UserSetting = NewUserSettingClient(tx.config) + tx.UserSettingHistory = NewUserSettingHistoryClient(tx.config) + tx.Webauthn = NewWebauthnClient(tx.config) + tx.Webhook = NewWebhookClient(tx.config) + tx.WebhookHistory = NewWebhookHistoryClient(tx.config) +} + +// txDriver wraps the given dialect.Tx with a nop dialect.Driver implementation. +// The idea is to support transactions without adding any extra code to the builders. +// When a builder calls to driver.Tx(), it gets the same dialect.Tx instance. +// Commit and Rollback are nop for the internal builders and the user must call one +// of them in order to commit or rollback the transaction. +// +// If a closed transaction is embedded in one of the generated entities, and the entity +// applies a query, for example: APIToken.QueryXXX(), the query will be executed +// through the driver which created this transaction. +// +// Note that txDriver is not goroutine safe. +type txDriver struct { + // the driver we started the transaction from. + drv dialect.Driver + // tx is the underlying transaction. + tx dialect.Tx + // completion hooks. + mu sync.Mutex + onCommit []CommitHook + onRollback []RollbackHook +} + +// newTx creates a new transactional driver. +func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) { + tx, err := drv.Tx(ctx) + if err != nil { + return nil, err + } + return &txDriver{tx: tx, drv: drv}, nil +} + +// Tx returns the transaction wrapper (txDriver) to avoid Commit or Rollback calls +// from the internal builders. Should be called only by the internal builders. +func (tx *txDriver) Tx(context.Context) (dialect.Tx, error) { return tx, nil } + +// Dialect returns the dialect of the driver we started the transaction from. +func (tx *txDriver) Dialect() string { return tx.drv.Dialect() } + +// Close is a nop close. +func (*txDriver) Close() error { return nil } + +// Commit is a nop commit for the internal builders. +// User must call `Tx.Commit` in order to commit the transaction. +func (*txDriver) Commit() error { return nil } + +// Rollback is a nop rollback for the internal builders. +// User must call `Tx.Rollback` in order to rollback the transaction. +func (*txDriver) Rollback() error { return nil } + +// Exec calls tx.Exec. +func (tx *txDriver) Exec(ctx context.Context, query string, args, v any) error { + return tx.tx.Exec(ctx, query, args, v) +} + +// Query calls tx.Query. +func (tx *txDriver) Query(ctx context.Context, query string, args, v any) error { + return tx.tx.Query(ctx, query, args, v) +} + +var _ dialect.Driver = (*txDriver)(nil) diff --git a/internal/ent/generated/user.go b/internal/ent/generated/user.go new file mode 100644 index 0000000..49fdce7 --- /dev/null +++ b/internal/ent/generated/user.go @@ -0,0 +1,814 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/pkg/enums" +) + +// User is the model entity for the User schema. +type User struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // Email holds the value of the "email" field. + Email string `json:"email,omitempty"` + // FirstName holds the value of the "first_name" field. + FirstName string `json:"first_name,omitempty"` + // LastName holds the value of the "last_name" field. + LastName string `json:"last_name,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatar_remote_url,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatar_local_file,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatar_updated_at,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"last_seen,omitempty"` + // user password hash + Password *string `json:"-"` + // the Subject of the user JWT + Sub string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider enums.AuthProvider `json:"auth_provider,omitempty"` + // the user's role + Role enums.Role `json:"role,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the UserQuery when eager-loading is set. + Edges UserEdges `json:"edges"` + selectValues sql.SelectValues +} + +// UserEdges holds the relations/edges for other nodes in the graph. +type UserEdges struct { + // PersonalAccessTokens holds the value of the personal_access_tokens edge. + PersonalAccessTokens []*PersonalAccessToken `json:"personal_access_tokens,omitempty"` + // TfaSettings holds the value of the tfa_settings edge. + TfaSettings []*TFASetting `json:"tfa_settings,omitempty"` + // Setting holds the value of the setting edge. + Setting *UserSetting `json:"setting,omitempty"` + // EmailVerificationTokens holds the value of the email_verification_tokens edge. + EmailVerificationTokens []*EmailVerificationToken `json:"email_verification_tokens,omitempty"` + // PasswordResetTokens holds the value of the password_reset_tokens edge. + PasswordResetTokens []*PasswordResetToken `json:"password_reset_tokens,omitempty"` + // Groups holds the value of the groups edge. + Groups []*Group `json:"groups,omitempty"` + // Organizations holds the value of the organizations edge. + Organizations []*Organization `json:"organizations,omitempty"` + // Webauthn holds the value of the webauthn edge. + Webauthn []*Webauthn `json:"webauthn,omitempty"` + // Files holds the value of the files edge. + Files []*File `json:"files,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // GroupMemberships holds the value of the group_memberships edge. + GroupMemberships []*GroupMembership `json:"group_memberships,omitempty"` + // OrgMemberships holds the value of the org_memberships edge. + OrgMemberships []*OrgMembership `json:"org_memberships,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [12]bool + // totalCount holds the count of the edges above. + totalCount [9]map[string]int + + namedPersonalAccessTokens map[string][]*PersonalAccessToken + namedTfaSettings map[string][]*TFASetting + namedEmailVerificationTokens map[string][]*EmailVerificationToken + namedPasswordResetTokens map[string][]*PasswordResetToken + namedGroups map[string][]*Group + namedOrganizations map[string][]*Organization + namedWebauthn map[string][]*Webauthn + namedFiles map[string][]*File + namedEvents map[string][]*Event + namedGroupMemberships map[string][]*GroupMembership + namedOrgMemberships map[string][]*OrgMembership +} + +// PersonalAccessTokensOrErr returns the PersonalAccessTokens value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) PersonalAccessTokensOrErr() ([]*PersonalAccessToken, error) { + if e.loadedTypes[0] { + return e.PersonalAccessTokens, nil + } + return nil, &NotLoadedError{edge: "personal_access_tokens"} +} + +// TfaSettingsOrErr returns the TfaSettings value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) TfaSettingsOrErr() ([]*TFASetting, error) { + if e.loadedTypes[1] { + return e.TfaSettings, nil + } + return nil, &NotLoadedError{edge: "tfa_settings"} +} + +// SettingOrErr returns the Setting value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e UserEdges) SettingOrErr() (*UserSetting, error) { + if e.Setting != nil { + return e.Setting, nil + } else if e.loadedTypes[2] { + return nil, &NotFoundError{label: usersetting.Label} + } + return nil, &NotLoadedError{edge: "setting"} +} + +// EmailVerificationTokensOrErr returns the EmailVerificationTokens value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) EmailVerificationTokensOrErr() ([]*EmailVerificationToken, error) { + if e.loadedTypes[3] { + return e.EmailVerificationTokens, nil + } + return nil, &NotLoadedError{edge: "email_verification_tokens"} +} + +// PasswordResetTokensOrErr returns the PasswordResetTokens value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) PasswordResetTokensOrErr() ([]*PasswordResetToken, error) { + if e.loadedTypes[4] { + return e.PasswordResetTokens, nil + } + return nil, &NotLoadedError{edge: "password_reset_tokens"} +} + +// GroupsOrErr returns the Groups value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) GroupsOrErr() ([]*Group, error) { + if e.loadedTypes[5] { + return e.Groups, nil + } + return nil, &NotLoadedError{edge: "groups"} +} + +// OrganizationsOrErr returns the Organizations value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) OrganizationsOrErr() ([]*Organization, error) { + if e.loadedTypes[6] { + return e.Organizations, nil + } + return nil, &NotLoadedError{edge: "organizations"} +} + +// WebauthnOrErr returns the Webauthn value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) WebauthnOrErr() ([]*Webauthn, error) { + if e.loadedTypes[7] { + return e.Webauthn, nil + } + return nil, &NotLoadedError{edge: "webauthn"} +} + +// FilesOrErr returns the Files value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) FilesOrErr() ([]*File, error) { + if e.loadedTypes[8] { + return e.Files, nil + } + return nil, &NotLoadedError{edge: "files"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[9] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// GroupMembershipsOrErr returns the GroupMemberships value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) GroupMembershipsOrErr() ([]*GroupMembership, error) { + if e.loadedTypes[10] { + return e.GroupMemberships, nil + } + return nil, &NotLoadedError{edge: "group_memberships"} +} + +// OrgMembershipsOrErr returns the OrgMemberships value or an error if the edge +// was not loaded in eager-loading. +func (e UserEdges) OrgMembershipsOrErr() ([]*OrgMembership, error) { + if e.loadedTypes[11] { + return e.OrgMemberships, nil + } + return nil, &NotLoadedError{edge: "org_memberships"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*User) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case user.FieldTags: + values[i] = new([]byte) + case user.FieldID, user.FieldCreatedBy, user.FieldUpdatedBy, user.FieldDeletedBy, user.FieldMappingID, user.FieldEmail, user.FieldFirstName, user.FieldLastName, user.FieldDisplayName, user.FieldAvatarRemoteURL, user.FieldAvatarLocalFile, user.FieldPassword, user.FieldSub, user.FieldAuthProvider, user.FieldRole: + values[i] = new(sql.NullString) + case user.FieldCreatedAt, user.FieldUpdatedAt, user.FieldDeletedAt, user.FieldAvatarUpdatedAt, user.FieldLastSeen: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the User fields. +func (u *User) 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 user.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + u.ID = value.String + } + case user.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + u.CreatedAt = value.Time + } + case user.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + u.UpdatedAt = value.Time + } + case user.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + u.CreatedBy = value.String + } + case user.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + u.UpdatedBy = value.String + } + case user.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + u.DeletedAt = value.Time + } + case user.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + u.DeletedBy = value.String + } + case user.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + u.MappingID = value.String + } + case user.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &u.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case user.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + u.Email = value.String + } + case user.FieldFirstName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field first_name", values[i]) + } else if value.Valid { + u.FirstName = value.String + } + case user.FieldLastName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field last_name", values[i]) + } else if value.Valid { + u.LastName = value.String + } + case user.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + u.DisplayName = value.String + } + case user.FieldAvatarRemoteURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field avatar_remote_url", values[i]) + } else if value.Valid { + u.AvatarRemoteURL = new(string) + *u.AvatarRemoteURL = value.String + } + case user.FieldAvatarLocalFile: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field avatar_local_file", values[i]) + } else if value.Valid { + u.AvatarLocalFile = new(string) + *u.AvatarLocalFile = value.String + } + case user.FieldAvatarUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field avatar_updated_at", values[i]) + } else if value.Valid { + u.AvatarUpdatedAt = new(time.Time) + *u.AvatarUpdatedAt = value.Time + } + case user.FieldLastSeen: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field last_seen", values[i]) + } else if value.Valid { + u.LastSeen = new(time.Time) + *u.LastSeen = value.Time + } + case user.FieldPassword: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field password", values[i]) + } else if value.Valid { + u.Password = new(string) + *u.Password = value.String + } + case user.FieldSub: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field sub", values[i]) + } else if value.Valid { + u.Sub = value.String + } + case user.FieldAuthProvider: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field auth_provider", values[i]) + } else if value.Valid { + u.AuthProvider = enums.AuthProvider(value.String) + } + case user.FieldRole: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field role", values[i]) + } else if value.Valid { + u.Role = enums.Role(value.String) + } + default: + u.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the User. +// This includes values selected through modifiers, order, etc. +func (u *User) Value(name string) (ent.Value, error) { + return u.selectValues.Get(name) +} + +// QueryPersonalAccessTokens queries the "personal_access_tokens" edge of the User entity. +func (u *User) QueryPersonalAccessTokens() *PersonalAccessTokenQuery { + return NewUserClient(u.config).QueryPersonalAccessTokens(u) +} + +// QueryTfaSettings queries the "tfa_settings" edge of the User entity. +func (u *User) QueryTfaSettings() *TFASettingQuery { + return NewUserClient(u.config).QueryTfaSettings(u) +} + +// QuerySetting queries the "setting" edge of the User entity. +func (u *User) QuerySetting() *UserSettingQuery { + return NewUserClient(u.config).QuerySetting(u) +} + +// QueryEmailVerificationTokens queries the "email_verification_tokens" edge of the User entity. +func (u *User) QueryEmailVerificationTokens() *EmailVerificationTokenQuery { + return NewUserClient(u.config).QueryEmailVerificationTokens(u) +} + +// QueryPasswordResetTokens queries the "password_reset_tokens" edge of the User entity. +func (u *User) QueryPasswordResetTokens() *PasswordResetTokenQuery { + return NewUserClient(u.config).QueryPasswordResetTokens(u) +} + +// QueryGroups queries the "groups" edge of the User entity. +func (u *User) QueryGroups() *GroupQuery { + return NewUserClient(u.config).QueryGroups(u) +} + +// QueryOrganizations queries the "organizations" edge of the User entity. +func (u *User) QueryOrganizations() *OrganizationQuery { + return NewUserClient(u.config).QueryOrganizations(u) +} + +// QueryWebauthn queries the "webauthn" edge of the User entity. +func (u *User) QueryWebauthn() *WebauthnQuery { + return NewUserClient(u.config).QueryWebauthn(u) +} + +// QueryFiles queries the "files" edge of the User entity. +func (u *User) QueryFiles() *FileQuery { + return NewUserClient(u.config).QueryFiles(u) +} + +// QueryEvents queries the "events" edge of the User entity. +func (u *User) QueryEvents() *EventQuery { + return NewUserClient(u.config).QueryEvents(u) +} + +// QueryGroupMemberships queries the "group_memberships" edge of the User entity. +func (u *User) QueryGroupMemberships() *GroupMembershipQuery { + return NewUserClient(u.config).QueryGroupMemberships(u) +} + +// QueryOrgMemberships queries the "org_memberships" edge of the User entity. +func (u *User) QueryOrgMemberships() *OrgMembershipQuery { + return NewUserClient(u.config).QueryOrgMemberships(u) +} + +// Update returns a builder for updating this User. +// Note that you need to call User.Unwrap() before calling this method if this User +// was returned from a transaction, and the transaction was committed or rolled back. +func (u *User) Update() *UserUpdateOne { + return NewUserClient(u.config).UpdateOne(u) +} + +// Unwrap unwraps the User 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 (u *User) Unwrap() *User { + _tx, ok := u.config.driver.(*txDriver) + if !ok { + panic("generated: User is not a transactional entity") + } + u.config.driver = _tx.drv + return u +} + +// String implements the fmt.Stringer. +func (u *User) String() string { + var builder strings.Builder + builder.WriteString("User(") + builder.WriteString(fmt.Sprintf("id=%v, ", u.ID)) + builder.WriteString("created_at=") + builder.WriteString(u.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(u.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(u.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(u.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(u.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(u.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(u.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", u.Tags)) + builder.WriteString(", ") + builder.WriteString("email=") + builder.WriteString(u.Email) + builder.WriteString(", ") + builder.WriteString("first_name=") + builder.WriteString(u.FirstName) + builder.WriteString(", ") + builder.WriteString("last_name=") + builder.WriteString(u.LastName) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(u.DisplayName) + builder.WriteString(", ") + if v := u.AvatarRemoteURL; v != nil { + builder.WriteString("avatar_remote_url=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.AvatarLocalFile; v != nil { + builder.WriteString("avatar_local_file=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := u.AvatarUpdatedAt; v != nil { + builder.WriteString("avatar_updated_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := u.LastSeen; v != nil { + builder.WriteString("last_seen=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("password=") + builder.WriteString(", ") + builder.WriteString("sub=") + builder.WriteString(u.Sub) + builder.WriteString(", ") + builder.WriteString("auth_provider=") + builder.WriteString(fmt.Sprintf("%v", u.AuthProvider)) + builder.WriteString(", ") + builder.WriteString("role=") + builder.WriteString(fmt.Sprintf("%v", u.Role)) + builder.WriteByte(')') + return builder.String() +} + +// NamedPersonalAccessTokens returns the PersonalAccessTokens named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedPersonalAccessTokens(name string) ([]*PersonalAccessToken, error) { + if u.Edges.namedPersonalAccessTokens == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedPersonalAccessTokens[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedPersonalAccessTokens(name string, edges ...*PersonalAccessToken) { + if u.Edges.namedPersonalAccessTokens == nil { + u.Edges.namedPersonalAccessTokens = make(map[string][]*PersonalAccessToken) + } + if len(edges) == 0 { + u.Edges.namedPersonalAccessTokens[name] = []*PersonalAccessToken{} + } else { + u.Edges.namedPersonalAccessTokens[name] = append(u.Edges.namedPersonalAccessTokens[name], edges...) + } +} + +// NamedTfaSettings returns the TfaSettings named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedTfaSettings(name string) ([]*TFASetting, error) { + if u.Edges.namedTfaSettings == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedTfaSettings[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedTfaSettings(name string, edges ...*TFASetting) { + if u.Edges.namedTfaSettings == nil { + u.Edges.namedTfaSettings = make(map[string][]*TFASetting) + } + if len(edges) == 0 { + u.Edges.namedTfaSettings[name] = []*TFASetting{} + } else { + u.Edges.namedTfaSettings[name] = append(u.Edges.namedTfaSettings[name], edges...) + } +} + +// NamedEmailVerificationTokens returns the EmailVerificationTokens named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedEmailVerificationTokens(name string) ([]*EmailVerificationToken, error) { + if u.Edges.namedEmailVerificationTokens == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedEmailVerificationTokens[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedEmailVerificationTokens(name string, edges ...*EmailVerificationToken) { + if u.Edges.namedEmailVerificationTokens == nil { + u.Edges.namedEmailVerificationTokens = make(map[string][]*EmailVerificationToken) + } + if len(edges) == 0 { + u.Edges.namedEmailVerificationTokens[name] = []*EmailVerificationToken{} + } else { + u.Edges.namedEmailVerificationTokens[name] = append(u.Edges.namedEmailVerificationTokens[name], edges...) + } +} + +// NamedPasswordResetTokens returns the PasswordResetTokens named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedPasswordResetTokens(name string) ([]*PasswordResetToken, error) { + if u.Edges.namedPasswordResetTokens == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedPasswordResetTokens[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedPasswordResetTokens(name string, edges ...*PasswordResetToken) { + if u.Edges.namedPasswordResetTokens == nil { + u.Edges.namedPasswordResetTokens = make(map[string][]*PasswordResetToken) + } + if len(edges) == 0 { + u.Edges.namedPasswordResetTokens[name] = []*PasswordResetToken{} + } else { + u.Edges.namedPasswordResetTokens[name] = append(u.Edges.namedPasswordResetTokens[name], edges...) + } +} + +// NamedGroups returns the Groups named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedGroups(name string) ([]*Group, error) { + if u.Edges.namedGroups == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedGroups[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedGroups(name string, edges ...*Group) { + if u.Edges.namedGroups == nil { + u.Edges.namedGroups = make(map[string][]*Group) + } + if len(edges) == 0 { + u.Edges.namedGroups[name] = []*Group{} + } else { + u.Edges.namedGroups[name] = append(u.Edges.namedGroups[name], edges...) + } +} + +// NamedOrganizations returns the Organizations named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedOrganizations(name string) ([]*Organization, error) { + if u.Edges.namedOrganizations == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedOrganizations[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedOrganizations(name string, edges ...*Organization) { + if u.Edges.namedOrganizations == nil { + u.Edges.namedOrganizations = make(map[string][]*Organization) + } + if len(edges) == 0 { + u.Edges.namedOrganizations[name] = []*Organization{} + } else { + u.Edges.namedOrganizations[name] = append(u.Edges.namedOrganizations[name], edges...) + } +} + +// NamedWebauthn returns the Webauthn named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedWebauthn(name string) ([]*Webauthn, error) { + if u.Edges.namedWebauthn == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedWebauthn[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedWebauthn(name string, edges ...*Webauthn) { + if u.Edges.namedWebauthn == nil { + u.Edges.namedWebauthn = make(map[string][]*Webauthn) + } + if len(edges) == 0 { + u.Edges.namedWebauthn[name] = []*Webauthn{} + } else { + u.Edges.namedWebauthn[name] = append(u.Edges.namedWebauthn[name], edges...) + } +} + +// NamedFiles returns the Files named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedFiles(name string) ([]*File, error) { + if u.Edges.namedFiles == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedFiles[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedFiles(name string, edges ...*File) { + if u.Edges.namedFiles == nil { + u.Edges.namedFiles = make(map[string][]*File) + } + if len(edges) == 0 { + u.Edges.namedFiles[name] = []*File{} + } else { + u.Edges.namedFiles[name] = append(u.Edges.namedFiles[name], edges...) + } +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedEvents(name string) ([]*Event, error) { + if u.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedEvents(name string, edges ...*Event) { + if u.Edges.namedEvents == nil { + u.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + u.Edges.namedEvents[name] = []*Event{} + } else { + u.Edges.namedEvents[name] = append(u.Edges.namedEvents[name], edges...) + } +} + +// NamedGroupMemberships returns the GroupMemberships named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedGroupMemberships(name string) ([]*GroupMembership, error) { + if u.Edges.namedGroupMemberships == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedGroupMemberships[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedGroupMemberships(name string, edges ...*GroupMembership) { + if u.Edges.namedGroupMemberships == nil { + u.Edges.namedGroupMemberships = make(map[string][]*GroupMembership) + } + if len(edges) == 0 { + u.Edges.namedGroupMemberships[name] = []*GroupMembership{} + } else { + u.Edges.namedGroupMemberships[name] = append(u.Edges.namedGroupMemberships[name], edges...) + } +} + +// NamedOrgMemberships returns the OrgMemberships named value or an error if the edge was not +// loaded in eager-loading with this name. +func (u *User) NamedOrgMemberships(name string) ([]*OrgMembership, error) { + if u.Edges.namedOrgMemberships == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := u.Edges.namedOrgMemberships[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (u *User) appendNamedOrgMemberships(name string, edges ...*OrgMembership) { + if u.Edges.namedOrgMemberships == nil { + u.Edges.namedOrgMemberships = make(map[string][]*OrgMembership) + } + if len(edges) == 0 { + u.Edges.namedOrgMemberships[name] = []*OrgMembership{} + } else { + u.Edges.namedOrgMemberships[name] = append(u.Edges.namedOrgMemberships[name], edges...) + } +} + +// Users is a parsable slice of User. +type Users []*User diff --git a/internal/ent/generated/user/user.go b/internal/ent/generated/user/user.go new file mode 100644 index 0000000..d10ca54 --- /dev/null +++ b/internal/ent/generated/user/user.go @@ -0,0 +1,637 @@ +// Code generated by ent, DO NOT EDIT. + +package user + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the user type in the database. + Label = "user" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldFirstName holds the string denoting the first_name field in the database. + FieldFirstName = "first_name" + // FieldLastName holds the string denoting the last_name field in the database. + FieldLastName = "last_name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldAvatarRemoteURL holds the string denoting the avatar_remote_url field in the database. + FieldAvatarRemoteURL = "avatar_remote_url" + // FieldAvatarLocalFile holds the string denoting the avatar_local_file field in the database. + FieldAvatarLocalFile = "avatar_local_file" + // FieldAvatarUpdatedAt holds the string denoting the avatar_updated_at field in the database. + FieldAvatarUpdatedAt = "avatar_updated_at" + // FieldLastSeen holds the string denoting the last_seen field in the database. + FieldLastSeen = "last_seen" + // FieldPassword holds the string denoting the password field in the database. + FieldPassword = "password" + // FieldSub holds the string denoting the sub field in the database. + FieldSub = "sub" + // FieldAuthProvider holds the string denoting the auth_provider field in the database. + FieldAuthProvider = "auth_provider" + // FieldRole holds the string denoting the role field in the database. + FieldRole = "role" + // EdgePersonalAccessTokens holds the string denoting the personal_access_tokens edge name in mutations. + EdgePersonalAccessTokens = "personal_access_tokens" + // EdgeTfaSettings holds the string denoting the tfa_settings edge name in mutations. + EdgeTfaSettings = "tfa_settings" + // EdgeSetting holds the string denoting the setting edge name in mutations. + EdgeSetting = "setting" + // EdgeEmailVerificationTokens holds the string denoting the email_verification_tokens edge name in mutations. + EdgeEmailVerificationTokens = "email_verification_tokens" + // EdgePasswordResetTokens holds the string denoting the password_reset_tokens edge name in mutations. + EdgePasswordResetTokens = "password_reset_tokens" + // EdgeGroups holds the string denoting the groups edge name in mutations. + EdgeGroups = "groups" + // EdgeOrganizations holds the string denoting the organizations edge name in mutations. + EdgeOrganizations = "organizations" + // EdgeWebauthn holds the string denoting the webauthn edge name in mutations. + EdgeWebauthn = "webauthn" + // EdgeFiles holds the string denoting the files edge name in mutations. + EdgeFiles = "files" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // EdgeGroupMemberships holds the string denoting the group_memberships edge name in mutations. + EdgeGroupMemberships = "group_memberships" + // EdgeOrgMemberships holds the string denoting the org_memberships edge name in mutations. + EdgeOrgMemberships = "org_memberships" + // Table holds the table name of the user in the database. + Table = "users" + // PersonalAccessTokensTable is the table that holds the personal_access_tokens relation/edge. + PersonalAccessTokensTable = "personal_access_tokens" + // PersonalAccessTokensInverseTable is the table name for the PersonalAccessToken entity. + // It exists in this package in order to avoid circular dependency with the "personalaccesstoken" package. + PersonalAccessTokensInverseTable = "personal_access_tokens" + // PersonalAccessTokensColumn is the table column denoting the personal_access_tokens relation/edge. + PersonalAccessTokensColumn = "owner_id" + // TfaSettingsTable is the table that holds the tfa_settings relation/edge. + TfaSettingsTable = "tfa_settings" + // TfaSettingsInverseTable is the table name for the TFASetting entity. + // It exists in this package in order to avoid circular dependency with the "tfasetting" package. + TfaSettingsInverseTable = "tfa_settings" + // TfaSettingsColumn is the table column denoting the tfa_settings relation/edge. + TfaSettingsColumn = "owner_id" + // SettingTable is the table that holds the setting relation/edge. + SettingTable = "user_settings" + // SettingInverseTable is the table name for the UserSetting entity. + // It exists in this package in order to avoid circular dependency with the "usersetting" package. + SettingInverseTable = "user_settings" + // SettingColumn is the table column denoting the setting relation/edge. + SettingColumn = "user_id" + // EmailVerificationTokensTable is the table that holds the email_verification_tokens relation/edge. + EmailVerificationTokensTable = "email_verification_tokens" + // EmailVerificationTokensInverseTable is the table name for the EmailVerificationToken entity. + // It exists in this package in order to avoid circular dependency with the "emailverificationtoken" package. + EmailVerificationTokensInverseTable = "email_verification_tokens" + // EmailVerificationTokensColumn is the table column denoting the email_verification_tokens relation/edge. + EmailVerificationTokensColumn = "owner_id" + // PasswordResetTokensTable is the table that holds the password_reset_tokens relation/edge. + PasswordResetTokensTable = "password_reset_tokens" + // PasswordResetTokensInverseTable is the table name for the PasswordResetToken entity. + // It exists in this package in order to avoid circular dependency with the "passwordresettoken" package. + PasswordResetTokensInverseTable = "password_reset_tokens" + // PasswordResetTokensColumn is the table column denoting the password_reset_tokens relation/edge. + PasswordResetTokensColumn = "owner_id" + // GroupsTable is the table that holds the groups relation/edge. The primary key declared below. + GroupsTable = "group_memberships" + // GroupsInverseTable is the table name for the Group entity. + // It exists in this package in order to avoid circular dependency with the "group" package. + GroupsInverseTable = "groups" + // OrganizationsTable is the table that holds the organizations relation/edge. The primary key declared below. + OrganizationsTable = "org_memberships" + // OrganizationsInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OrganizationsInverseTable = "organizations" + // WebauthnTable is the table that holds the webauthn relation/edge. + WebauthnTable = "webauthns" + // WebauthnInverseTable is the table name for the Webauthn entity. + // It exists in this package in order to avoid circular dependency with the "webauthn" package. + WebauthnInverseTable = "webauthns" + // WebauthnColumn is the table column denoting the webauthn relation/edge. + WebauthnColumn = "owner_id" + // FilesTable is the table that holds the files relation/edge. + FilesTable = "files" + // FilesInverseTable is the table name for the File entity. + // It exists in this package in order to avoid circular dependency with the "file" package. + FilesInverseTable = "files" + // FilesColumn is the table column denoting the files relation/edge. + FilesColumn = "user_files" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "user_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" + // GroupMembershipsTable is the table that holds the group_memberships relation/edge. + GroupMembershipsTable = "group_memberships" + // GroupMembershipsInverseTable is the table name for the GroupMembership entity. + // It exists in this package in order to avoid circular dependency with the "groupmembership" package. + GroupMembershipsInverseTable = "group_memberships" + // GroupMembershipsColumn is the table column denoting the group_memberships relation/edge. + GroupMembershipsColumn = "user_id" + // OrgMembershipsTable is the table that holds the org_memberships relation/edge. + OrgMembershipsTable = "org_memberships" + // OrgMembershipsInverseTable is the table name for the OrgMembership entity. + // It exists in this package in order to avoid circular dependency with the "orgmembership" package. + OrgMembershipsInverseTable = "org_memberships" + // OrgMembershipsColumn is the table column denoting the org_memberships relation/edge. + OrgMembershipsColumn = "user_id" +) + +// Columns holds all SQL columns for user fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldEmail, + FieldFirstName, + FieldLastName, + FieldDisplayName, + FieldAvatarRemoteURL, + FieldAvatarLocalFile, + FieldAvatarUpdatedAt, + FieldLastSeen, + FieldPassword, + FieldSub, + FieldAuthProvider, + FieldRole, +} + +var ( + // GroupsPrimaryKey and GroupsColumn2 are the table columns denoting the + // primary key for the groups relation (M2M). + GroupsPrimaryKey = []string{"user_id", "group_id"} + // OrganizationsPrimaryKey and OrganizationsColumn2 are the table columns denoting the + // primary key for the organizations relation (M2M). + OrganizationsPrimaryKey = []string{"user_id", "organization_id"} + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"user_id", "event_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [5]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // EmailValidator is a validator for the "email" field. It is called by the builders before save. + EmailValidator func(string) error + // FirstNameValidator is a validator for the "first_name" field. It is called by the builders before save. + FirstNameValidator func(string) error + // LastNameValidator is a validator for the "last_name" field. It is called by the builders before save. + LastNameValidator func(string) error + // DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save. + DisplayNameValidator func(string) error + // AvatarRemoteURLValidator is a validator for the "avatar_remote_url" field. It is called by the builders before save. + AvatarRemoteURLValidator func(string) error + // AvatarLocalFileValidator is a validator for the "avatar_local_file" field. It is called by the builders before save. + AvatarLocalFileValidator func(string) error + // UpdateDefaultAvatarUpdatedAt holds the default value on update for the "avatar_updated_at" field. + UpdateDefaultAvatarUpdatedAt func() time.Time + // UpdateDefaultLastSeen holds the default value on update for the "last_seen" field. + UpdateDefaultLastSeen func() time.Time + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultAuthProvider enums.AuthProvider = "CREDENTIALS" + +// AuthProviderValidator is a validator for the "auth_provider" field enum values. It is called by the builders before save. +func AuthProviderValidator(ap enums.AuthProvider) error { + switch ap.String() { + case "CREDENTIALS", "GOOGLE", "GITHUB", "WEBAUTHN": + return nil + default: + return fmt.Errorf("user: invalid enum value for auth_provider field: %q", ap) + } +} + +const DefaultRole enums.Role = "USER" + +// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save. +func RoleValidator(r enums.Role) error { + switch r.String() { + case "ADMIN", "MEMBER", "USER": + return nil + default: + return fmt.Errorf("user: invalid enum value for role field: %q", r) + } +} + +// OrderOption defines the ordering options for the User queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByFirstName orders the results by the first_name field. +func ByFirstName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFirstName, opts...).ToFunc() +} + +// ByLastName orders the results by the last_name field. +func ByLastName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByAvatarRemoteURL orders the results by the avatar_remote_url field. +func ByAvatarRemoteURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarRemoteURL, opts...).ToFunc() +} + +// ByAvatarLocalFile orders the results by the avatar_local_file field. +func ByAvatarLocalFile(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarLocalFile, opts...).ToFunc() +} + +// ByAvatarUpdatedAt orders the results by the avatar_updated_at field. +func ByAvatarUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarUpdatedAt, opts...).ToFunc() +} + +// ByLastSeen orders the results by the last_seen field. +func ByLastSeen(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastSeen, opts...).ToFunc() +} + +// ByPassword orders the results by the password field. +func ByPassword(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPassword, opts...).ToFunc() +} + +// BySub orders the results by the sub field. +func BySub(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSub, opts...).ToFunc() +} + +// ByAuthProvider orders the results by the auth_provider field. +func ByAuthProvider(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthProvider, opts...).ToFunc() +} + +// ByRole orders the results by the role field. +func ByRole(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRole, opts...).ToFunc() +} + +// ByPersonalAccessTokensCount orders the results by personal_access_tokens count. +func ByPersonalAccessTokensCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newPersonalAccessTokensStep(), opts...) + } +} + +// ByPersonalAccessTokens orders the results by personal_access_tokens terms. +func ByPersonalAccessTokens(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPersonalAccessTokensStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByTfaSettingsCount orders the results by tfa_settings count. +func ByTfaSettingsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newTfaSettingsStep(), opts...) + } +} + +// ByTfaSettings orders the results by tfa_settings terms. +func ByTfaSettings(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newTfaSettingsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// BySettingField orders the results by setting field. +func BySettingField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newSettingStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEmailVerificationTokensCount orders the results by email_verification_tokens count. +func ByEmailVerificationTokensCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEmailVerificationTokensStep(), opts...) + } +} + +// ByEmailVerificationTokens orders the results by email_verification_tokens terms. +func ByEmailVerificationTokens(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEmailVerificationTokensStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByPasswordResetTokensCount orders the results by password_reset_tokens count. +func ByPasswordResetTokensCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newPasswordResetTokensStep(), opts...) + } +} + +// ByPasswordResetTokens orders the results by password_reset_tokens terms. +func ByPasswordResetTokens(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newPasswordResetTokensStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByGroupsCount orders the results by groups count. +func ByGroupsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newGroupsStep(), opts...) + } +} + +// ByGroups orders the results by groups terms. +func ByGroups(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOrganizationsCount orders the results by organizations count. +func ByOrganizationsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrganizationsStep(), opts...) + } +} + +// ByOrganizations orders the results by organizations terms. +func ByOrganizations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrganizationsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByWebauthnCount orders the results by webauthn count. +func ByWebauthnCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newWebauthnStep(), opts...) + } +} + +// ByWebauthn orders the results by webauthn terms. +func ByWebauthn(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newWebauthnStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByFilesCount orders the results by files count. +func ByFilesCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newFilesStep(), opts...) + } +} + +// ByFiles orders the results by files terms. +func ByFiles(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newFilesStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByGroupMembershipsCount orders the results by group_memberships count. +func ByGroupMembershipsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newGroupMembershipsStep(), opts...) + } +} + +// ByGroupMemberships orders the results by group_memberships terms. +func ByGroupMemberships(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newGroupMembershipsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByOrgMembershipsCount orders the results by org_memberships count. +func ByOrgMembershipsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newOrgMembershipsStep(), opts...) + } +} + +// ByOrgMemberships orders the results by org_memberships terms. +func ByOrgMemberships(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOrgMembershipsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newPersonalAccessTokensStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PersonalAccessTokensInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, PersonalAccessTokensTable, PersonalAccessTokensColumn), + ) +} +func newTfaSettingsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(TfaSettingsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, TfaSettingsTable, TfaSettingsColumn), + ) +} +func newSettingStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(SettingInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, SettingTable, SettingColumn), + ) +} +func newEmailVerificationTokensStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EmailVerificationTokensInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EmailVerificationTokensTable, EmailVerificationTokensColumn), + ) +} +func newPasswordResetTokensStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(PasswordResetTokensInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, PasswordResetTokensTable, PasswordResetTokensColumn), + ) +} +func newGroupsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, GroupsTable, GroupsPrimaryKey...), + ) +} +func newOrganizationsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrganizationsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, OrganizationsTable, OrganizationsPrimaryKey...), + ) +} +func newWebauthnStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(WebauthnInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, WebauthnTable, WebauthnColumn), + ) +} +func newFilesStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(FilesInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, FilesTable, FilesColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} +func newGroupMembershipsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(GroupMembershipsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, GroupMembershipsTable, GroupMembershipsColumn), + ) +} +func newOrgMembershipsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OrgMembershipsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, OrgMembershipsTable, OrgMembershipsColumn), + ) +} + +var ( + // enums.AuthProvider must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.AuthProvider)(nil) + // enums.AuthProvider must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.AuthProvider)(nil) +) + +var ( + // enums.Role must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Role)(nil) + // enums.Role must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Role)(nil) +) diff --git a/internal/ent/generated/user/where.go b/internal/ent/generated/user/where.go new file mode 100644 index 0000000..e706a01 --- /dev/null +++ b/internal/ent/generated/user/where.go @@ -0,0 +1,1717 @@ +// Code generated by ent, DO NOT EDIT. + +package user + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.User { + return predicate.User(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.User { + return predicate.User(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.User { + return predicate.User(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.User { + return predicate.User(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.User { + return predicate.User(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.User { + return predicate.User(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldMappingID, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldEmail, v)) +} + +// FirstName applies equality check predicate on the "first_name" field. It's identical to FirstNameEQ. +func FirstName(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldFirstName, v)) +} + +// LastName applies equality check predicate on the "last_name" field. It's identical to LastNameEQ. +func LastName(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldDisplayName, v)) +} + +// AvatarRemoteURL applies equality check predicate on the "avatar_remote_url" field. It's identical to AvatarRemoteURLEQ. +func AvatarRemoteURL(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarLocalFile applies equality check predicate on the "avatar_local_file" field. It's identical to AvatarLocalFileEQ. +func AvatarLocalFile(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatarLocalFile, v)) +} + +// AvatarUpdatedAt applies equality check predicate on the "avatar_updated_at" field. It's identical to AvatarUpdatedAtEQ. +func AvatarUpdatedAt(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatarUpdatedAt, v)) +} + +// LastSeen applies equality check predicate on the "last_seen" field. It's identical to LastSeenEQ. +func LastSeen(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastSeen, v)) +} + +// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. +func Password(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPassword, v)) +} + +// Sub applies equality check predicate on the "sub" field. It's identical to SubEQ. +func Sub(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldSub, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldTags)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldEmail, v)) +} + +// FirstNameEQ applies the EQ predicate on the "first_name" field. +func FirstNameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldFirstName, v)) +} + +// FirstNameNEQ applies the NEQ predicate on the "first_name" field. +func FirstNameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldFirstName, v)) +} + +// FirstNameIn applies the In predicate on the "first_name" field. +func FirstNameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldFirstName, vs...)) +} + +// FirstNameNotIn applies the NotIn predicate on the "first_name" field. +func FirstNameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldFirstName, vs...)) +} + +// FirstNameGT applies the GT predicate on the "first_name" field. +func FirstNameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldFirstName, v)) +} + +// FirstNameGTE applies the GTE predicate on the "first_name" field. +func FirstNameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldFirstName, v)) +} + +// FirstNameLT applies the LT predicate on the "first_name" field. +func FirstNameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldFirstName, v)) +} + +// FirstNameLTE applies the LTE predicate on the "first_name" field. +func FirstNameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldFirstName, v)) +} + +// FirstNameContains applies the Contains predicate on the "first_name" field. +func FirstNameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldFirstName, v)) +} + +// FirstNameHasPrefix applies the HasPrefix predicate on the "first_name" field. +func FirstNameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldFirstName, v)) +} + +// FirstNameHasSuffix applies the HasSuffix predicate on the "first_name" field. +func FirstNameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldFirstName, v)) +} + +// FirstNameIsNil applies the IsNil predicate on the "first_name" field. +func FirstNameIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldFirstName)) +} + +// FirstNameNotNil applies the NotNil predicate on the "first_name" field. +func FirstNameNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldFirstName)) +} + +// FirstNameEqualFold applies the EqualFold predicate on the "first_name" field. +func FirstNameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldFirstName, v)) +} + +// FirstNameContainsFold applies the ContainsFold predicate on the "first_name" field. +func FirstNameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldFirstName, v)) +} + +// LastNameEQ applies the EQ predicate on the "last_name" field. +func LastNameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastName, v)) +} + +// LastNameNEQ applies the NEQ predicate on the "last_name" field. +func LastNameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLastName, v)) +} + +// LastNameIn applies the In predicate on the "last_name" field. +func LastNameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldLastName, vs...)) +} + +// LastNameNotIn applies the NotIn predicate on the "last_name" field. +func LastNameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLastName, vs...)) +} + +// LastNameGT applies the GT predicate on the "last_name" field. +func LastNameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldLastName, v)) +} + +// LastNameGTE applies the GTE predicate on the "last_name" field. +func LastNameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldLastName, v)) +} + +// LastNameLT applies the LT predicate on the "last_name" field. +func LastNameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldLastName, v)) +} + +// LastNameLTE applies the LTE predicate on the "last_name" field. +func LastNameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldLastName, v)) +} + +// LastNameContains applies the Contains predicate on the "last_name" field. +func LastNameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldLastName, v)) +} + +// LastNameHasPrefix applies the HasPrefix predicate on the "last_name" field. +func LastNameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldLastName, v)) +} + +// LastNameHasSuffix applies the HasSuffix predicate on the "last_name" field. +func LastNameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldLastName, v)) +} + +// LastNameIsNil applies the IsNil predicate on the "last_name" field. +func LastNameIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLastName)) +} + +// LastNameNotNil applies the NotNil predicate on the "last_name" field. +func LastNameNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLastName)) +} + +// LastNameEqualFold applies the EqualFold predicate on the "last_name" field. +func LastNameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldLastName, v)) +} + +// LastNameContainsFold applies the ContainsFold predicate on the "last_name" field. +func LastNameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldLastName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// AvatarRemoteURLEQ applies the EQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLNEQ applies the NEQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIn applies the In predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLNotIn applies the NotIn predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLGT applies the GT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLGTE applies the GTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLT applies the LT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLTE applies the LTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContains applies the Contains predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasPrefix applies the HasPrefix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasSuffix applies the HasSuffix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIsNil applies the IsNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLNotNil applies the NotNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLEqualFold applies the EqualFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContainsFold applies the ContainsFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldAvatarRemoteURL, v)) +} + +// AvatarLocalFileEQ applies the EQ predicate on the "avatar_local_file" field. +func AvatarLocalFileEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileNEQ applies the NEQ predicate on the "avatar_local_file" field. +func AvatarLocalFileNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileIn applies the In predicate on the "avatar_local_file" field. +func AvatarLocalFileIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldAvatarLocalFile, vs...)) +} + +// AvatarLocalFileNotIn applies the NotIn predicate on the "avatar_local_file" field. +func AvatarLocalFileNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldAvatarLocalFile, vs...)) +} + +// AvatarLocalFileGT applies the GT predicate on the "avatar_local_file" field. +func AvatarLocalFileGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileGTE applies the GTE predicate on the "avatar_local_file" field. +func AvatarLocalFileGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileLT applies the LT predicate on the "avatar_local_file" field. +func AvatarLocalFileLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileLTE applies the LTE predicate on the "avatar_local_file" field. +func AvatarLocalFileLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileContains applies the Contains predicate on the "avatar_local_file" field. +func AvatarLocalFileContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileHasPrefix applies the HasPrefix predicate on the "avatar_local_file" field. +func AvatarLocalFileHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileHasSuffix applies the HasSuffix predicate on the "avatar_local_file" field. +func AvatarLocalFileHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileIsNil applies the IsNil predicate on the "avatar_local_file" field. +func AvatarLocalFileIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldAvatarLocalFile)) +} + +// AvatarLocalFileNotNil applies the NotNil predicate on the "avatar_local_file" field. +func AvatarLocalFileNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldAvatarLocalFile)) +} + +// AvatarLocalFileEqualFold applies the EqualFold predicate on the "avatar_local_file" field. +func AvatarLocalFileEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileContainsFold applies the ContainsFold predicate on the "avatar_local_file" field. +func AvatarLocalFileContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldAvatarLocalFile, v)) +} + +// AvatarUpdatedAtEQ applies the EQ predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtNEQ applies the NEQ predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtIn applies the In predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldAvatarUpdatedAt, vs...)) +} + +// AvatarUpdatedAtNotIn applies the NotIn predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldAvatarUpdatedAt, vs...)) +} + +// AvatarUpdatedAtGT applies the GT predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtGTE applies the GTE predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtLT applies the LT predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtLTE applies the LTE predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtIsNil applies the IsNil predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldAvatarUpdatedAt)) +} + +// AvatarUpdatedAtNotNil applies the NotNil predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldAvatarUpdatedAt)) +} + +// LastSeenEQ applies the EQ predicate on the "last_seen" field. +func LastSeenEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldEQ(FieldLastSeen, v)) +} + +// LastSeenNEQ applies the NEQ predicate on the "last_seen" field. +func LastSeenNEQ(v time.Time) predicate.User { + return predicate.User(sql.FieldNEQ(FieldLastSeen, v)) +} + +// LastSeenIn applies the In predicate on the "last_seen" field. +func LastSeenIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldIn(FieldLastSeen, vs...)) +} + +// LastSeenNotIn applies the NotIn predicate on the "last_seen" field. +func LastSeenNotIn(vs ...time.Time) predicate.User { + return predicate.User(sql.FieldNotIn(FieldLastSeen, vs...)) +} + +// LastSeenGT applies the GT predicate on the "last_seen" field. +func LastSeenGT(v time.Time) predicate.User { + return predicate.User(sql.FieldGT(FieldLastSeen, v)) +} + +// LastSeenGTE applies the GTE predicate on the "last_seen" field. +func LastSeenGTE(v time.Time) predicate.User { + return predicate.User(sql.FieldGTE(FieldLastSeen, v)) +} + +// LastSeenLT applies the LT predicate on the "last_seen" field. +func LastSeenLT(v time.Time) predicate.User { + return predicate.User(sql.FieldLT(FieldLastSeen, v)) +} + +// LastSeenLTE applies the LTE predicate on the "last_seen" field. +func LastSeenLTE(v time.Time) predicate.User { + return predicate.User(sql.FieldLTE(FieldLastSeen, v)) +} + +// LastSeenIsNil applies the IsNil predicate on the "last_seen" field. +func LastSeenIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldLastSeen)) +} + +// LastSeenNotNil applies the NotNil predicate on the "last_seen" field. +func LastSeenNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldLastSeen)) +} + +// PasswordEQ applies the EQ predicate on the "password" field. +func PasswordEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldPassword, v)) +} + +// PasswordNEQ applies the NEQ predicate on the "password" field. +func PasswordNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldPassword, v)) +} + +// PasswordIn applies the In predicate on the "password" field. +func PasswordIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldPassword, vs...)) +} + +// PasswordNotIn applies the NotIn predicate on the "password" field. +func PasswordNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldPassword, vs...)) +} + +// PasswordGT applies the GT predicate on the "password" field. +func PasswordGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldPassword, v)) +} + +// PasswordGTE applies the GTE predicate on the "password" field. +func PasswordGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldPassword, v)) +} + +// PasswordLT applies the LT predicate on the "password" field. +func PasswordLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldPassword, v)) +} + +// PasswordLTE applies the LTE predicate on the "password" field. +func PasswordLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldPassword, v)) +} + +// PasswordContains applies the Contains predicate on the "password" field. +func PasswordContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldPassword, v)) +} + +// PasswordHasPrefix applies the HasPrefix predicate on the "password" field. +func PasswordHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldPassword, v)) +} + +// PasswordHasSuffix applies the HasSuffix predicate on the "password" field. +func PasswordHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldPassword, v)) +} + +// PasswordIsNil applies the IsNil predicate on the "password" field. +func PasswordIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldPassword)) +} + +// PasswordNotNil applies the NotNil predicate on the "password" field. +func PasswordNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldPassword)) +} + +// PasswordEqualFold applies the EqualFold predicate on the "password" field. +func PasswordEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldPassword, v)) +} + +// PasswordContainsFold applies the ContainsFold predicate on the "password" field. +func PasswordContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldPassword, v)) +} + +// SubEQ applies the EQ predicate on the "sub" field. +func SubEQ(v string) predicate.User { + return predicate.User(sql.FieldEQ(FieldSub, v)) +} + +// SubNEQ applies the NEQ predicate on the "sub" field. +func SubNEQ(v string) predicate.User { + return predicate.User(sql.FieldNEQ(FieldSub, v)) +} + +// SubIn applies the In predicate on the "sub" field. +func SubIn(vs ...string) predicate.User { + return predicate.User(sql.FieldIn(FieldSub, vs...)) +} + +// SubNotIn applies the NotIn predicate on the "sub" field. +func SubNotIn(vs ...string) predicate.User { + return predicate.User(sql.FieldNotIn(FieldSub, vs...)) +} + +// SubGT applies the GT predicate on the "sub" field. +func SubGT(v string) predicate.User { + return predicate.User(sql.FieldGT(FieldSub, v)) +} + +// SubGTE applies the GTE predicate on the "sub" field. +func SubGTE(v string) predicate.User { + return predicate.User(sql.FieldGTE(FieldSub, v)) +} + +// SubLT applies the LT predicate on the "sub" field. +func SubLT(v string) predicate.User { + return predicate.User(sql.FieldLT(FieldSub, v)) +} + +// SubLTE applies the LTE predicate on the "sub" field. +func SubLTE(v string) predicate.User { + return predicate.User(sql.FieldLTE(FieldSub, v)) +} + +// SubContains applies the Contains predicate on the "sub" field. +func SubContains(v string) predicate.User { + return predicate.User(sql.FieldContains(FieldSub, v)) +} + +// SubHasPrefix applies the HasPrefix predicate on the "sub" field. +func SubHasPrefix(v string) predicate.User { + return predicate.User(sql.FieldHasPrefix(FieldSub, v)) +} + +// SubHasSuffix applies the HasSuffix predicate on the "sub" field. +func SubHasSuffix(v string) predicate.User { + return predicate.User(sql.FieldHasSuffix(FieldSub, v)) +} + +// SubIsNil applies the IsNil predicate on the "sub" field. +func SubIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldSub)) +} + +// SubNotNil applies the NotNil predicate on the "sub" field. +func SubNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldSub)) +} + +// SubEqualFold applies the EqualFold predicate on the "sub" field. +func SubEqualFold(v string) predicate.User { + return predicate.User(sql.FieldEqualFold(FieldSub, v)) +} + +// SubContainsFold applies the ContainsFold predicate on the "sub" field. +func SubContainsFold(v string) predicate.User { + return predicate.User(sql.FieldContainsFold(FieldSub, v)) +} + +// AuthProviderEQ applies the EQ predicate on the "auth_provider" field. +func AuthProviderEQ(v enums.AuthProvider) predicate.User { + vc := v + return predicate.User(sql.FieldEQ(FieldAuthProvider, vc)) +} + +// AuthProviderNEQ applies the NEQ predicate on the "auth_provider" field. +func AuthProviderNEQ(v enums.AuthProvider) predicate.User { + vc := v + return predicate.User(sql.FieldNEQ(FieldAuthProvider, vc)) +} + +// AuthProviderIn applies the In predicate on the "auth_provider" field. +func AuthProviderIn(vs ...enums.AuthProvider) predicate.User { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(sql.FieldIn(FieldAuthProvider, v...)) +} + +// AuthProviderNotIn applies the NotIn predicate on the "auth_provider" field. +func AuthProviderNotIn(vs ...enums.AuthProvider) predicate.User { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(sql.FieldNotIn(FieldAuthProvider, v...)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v enums.Role) predicate.User { + vc := v + return predicate.User(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v enums.Role) predicate.User { + vc := v + return predicate.User(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...enums.Role) predicate.User { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...enums.Role) predicate.User { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.User(sql.FieldNotIn(FieldRole, v...)) +} + +// RoleIsNil applies the IsNil predicate on the "role" field. +func RoleIsNil() predicate.User { + return predicate.User(sql.FieldIsNull(FieldRole)) +} + +// RoleNotNil applies the NotNil predicate on the "role" field. +func RoleNotNil() predicate.User { + return predicate.User(sql.FieldNotNull(FieldRole)) +} + +// HasPersonalAccessTokens applies the HasEdge predicate on the "personal_access_tokens" edge. +func HasPersonalAccessTokens() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, PersonalAccessTokensTable, PersonalAccessTokensColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPersonalAccessTokensWith applies the HasEdge predicate on the "personal_access_tokens" edge with a given conditions (other predicates). +func HasPersonalAccessTokensWith(preds ...predicate.PersonalAccessToken) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newPersonalAccessTokensStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessToken + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasTfaSettings applies the HasEdge predicate on the "tfa_settings" edge. +func HasTfaSettings() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, TfaSettingsTable, TfaSettingsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.TFASetting + step.Edge.Schema = schemaConfig.TFASetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasTfaSettingsWith applies the HasEdge predicate on the "tfa_settings" edge with a given conditions (other predicates). +func HasTfaSettingsWith(preds ...predicate.TFASetting) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newTfaSettingsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.TFASetting + step.Edge.Schema = schemaConfig.TFASetting + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasSetting applies the HasEdge predicate on the "setting" edge. +func HasSetting() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, SettingTable, SettingColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.UserSetting + step.Edge.Schema = schemaConfig.UserSetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasSettingWith applies the HasEdge predicate on the "setting" edge with a given conditions (other predicates). +func HasSettingWith(preds ...predicate.UserSetting) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newSettingStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.UserSetting + step.Edge.Schema = schemaConfig.UserSetting + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEmailVerificationTokens applies the HasEdge predicate on the "email_verification_tokens" edge. +func HasEmailVerificationTokens() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, EmailVerificationTokensTable, EmailVerificationTokensColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EmailVerificationToken + step.Edge.Schema = schemaConfig.EmailVerificationToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEmailVerificationTokensWith applies the HasEdge predicate on the "email_verification_tokens" edge with a given conditions (other predicates). +func HasEmailVerificationTokensWith(preds ...predicate.EmailVerificationToken) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newEmailVerificationTokensStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.EmailVerificationToken + step.Edge.Schema = schemaConfig.EmailVerificationToken + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasPasswordResetTokens applies the HasEdge predicate on the "password_reset_tokens" edge. +func HasPasswordResetTokens() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, PasswordResetTokensTable, PasswordResetTokensColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PasswordResetToken + step.Edge.Schema = schemaConfig.PasswordResetToken + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasPasswordResetTokensWith applies the HasEdge predicate on the "password_reset_tokens" edge with a given conditions (other predicates). +func HasPasswordResetTokensWith(preds ...predicate.PasswordResetToken) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newPasswordResetTokensStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.PasswordResetToken + step.Edge.Schema = schemaConfig.PasswordResetToken + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasGroups applies the HasEdge predicate on the "groups" edge. +func HasGroups() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, GroupsTable, GroupsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates). +func HasGroupsWith(preds ...predicate.Group) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newGroupsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrganizations applies the HasEdge predicate on the "organizations" edge. +func HasOrganizations() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, OrganizationsTable, OrganizationsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrganizationsWith applies the HasEdge predicate on the "organizations" edge with a given conditions (other predicates). +func HasOrganizationsWith(preds ...predicate.Organization) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newOrganizationsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasWebauthn applies the HasEdge predicate on the "webauthn" edge. +func HasWebauthn() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, WebauthnTable, WebauthnColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webauthn + step.Edge.Schema = schemaConfig.Webauthn + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasWebauthnWith applies the HasEdge predicate on the "webauthn" edge with a given conditions (other predicates). +func HasWebauthnWith(preds ...predicate.Webauthn) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newWebauthnStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Webauthn + step.Edge.Schema = schemaConfig.Webauthn + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasFiles applies the HasEdge predicate on the "files" edge. +func HasFiles() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, FilesTable, FilesColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.File + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasFilesWith applies the HasEdge predicate on the "files" edge with a given conditions (other predicates). +func HasFilesWith(preds ...predicate.File) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newFilesStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.File + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.UserEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.UserEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasGroupMemberships applies the HasEdge predicate on the "group_memberships" edge. +func HasGroupMemberships() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, GroupMembershipsTable, GroupMembershipsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasGroupMembershipsWith applies the HasEdge predicate on the "group_memberships" edge with a given conditions (other predicates). +func HasGroupMembershipsWith(preds ...predicate.GroupMembership) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newGroupMembershipsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasOrgMemberships applies the HasEdge predicate on the "org_memberships" edge. +func HasOrgMemberships() predicate.User { + return predicate.User(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, OrgMembershipsTable, OrgMembershipsColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOrgMembershipsWith applies the HasEdge predicate on the "org_memberships" edge with a given conditions (other predicates). +func HasOrgMembershipsWith(preds ...predicate.OrgMembership) predicate.User { + return predicate.User(func(s *sql.Selector) { + step := newOrgMembershipsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + 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.User) predicate.User { + return predicate.User(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.User) predicate.User { + return predicate.User(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.User) predicate.User { + return predicate.User(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/user_create.go b/internal/ent/generated/user_create.go new file mode 100644 index 0000000..32fb957 --- /dev/null +++ b/internal/ent/generated/user_create.go @@ -0,0 +1,1038 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/pkg/enums" +) + +// UserCreate is the builder for creating a User entity. +type UserCreate struct { + config + mutation *UserMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate { + uc.mutation.SetCreatedAt(t) + return uc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate { + if t != nil { + uc.SetCreatedAt(*t) + } + return uc +} + +// SetUpdatedAt sets the "updated_at" field. +func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate { + uc.mutation.SetUpdatedAt(t) + return uc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate { + if t != nil { + uc.SetUpdatedAt(*t) + } + return uc +} + +// SetCreatedBy sets the "created_by" field. +func (uc *UserCreate) SetCreatedBy(s string) *UserCreate { + uc.mutation.SetCreatedBy(s) + return uc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (uc *UserCreate) SetNillableCreatedBy(s *string) *UserCreate { + if s != nil { + uc.SetCreatedBy(*s) + } + return uc +} + +// SetUpdatedBy sets the "updated_by" field. +func (uc *UserCreate) SetUpdatedBy(s string) *UserCreate { + uc.mutation.SetUpdatedBy(s) + return uc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (uc *UserCreate) SetNillableUpdatedBy(s *string) *UserCreate { + if s != nil { + uc.SetUpdatedBy(*s) + } + return uc +} + +// SetDeletedAt sets the "deleted_at" field. +func (uc *UserCreate) SetDeletedAt(t time.Time) *UserCreate { + uc.mutation.SetDeletedAt(t) + return uc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (uc *UserCreate) SetNillableDeletedAt(t *time.Time) *UserCreate { + if t != nil { + uc.SetDeletedAt(*t) + } + return uc +} + +// SetDeletedBy sets the "deleted_by" field. +func (uc *UserCreate) SetDeletedBy(s string) *UserCreate { + uc.mutation.SetDeletedBy(s) + return uc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (uc *UserCreate) SetNillableDeletedBy(s *string) *UserCreate { + if s != nil { + uc.SetDeletedBy(*s) + } + return uc +} + +// SetMappingID sets the "mapping_id" field. +func (uc *UserCreate) SetMappingID(s string) *UserCreate { + uc.mutation.SetMappingID(s) + return uc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (uc *UserCreate) SetNillableMappingID(s *string) *UserCreate { + if s != nil { + uc.SetMappingID(*s) + } + return uc +} + +// SetTags sets the "tags" field. +func (uc *UserCreate) SetTags(s []string) *UserCreate { + uc.mutation.SetTags(s) + return uc +} + +// SetEmail sets the "email" field. +func (uc *UserCreate) SetEmail(s string) *UserCreate { + uc.mutation.SetEmail(s) + return uc +} + +// SetFirstName sets the "first_name" field. +func (uc *UserCreate) SetFirstName(s string) *UserCreate { + uc.mutation.SetFirstName(s) + return uc +} + +// SetNillableFirstName sets the "first_name" field if the given value is not nil. +func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate { + if s != nil { + uc.SetFirstName(*s) + } + return uc +} + +// SetLastName sets the "last_name" field. +func (uc *UserCreate) SetLastName(s string) *UserCreate { + uc.mutation.SetLastName(s) + return uc +} + +// SetNillableLastName sets the "last_name" field if the given value is not nil. +func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate { + if s != nil { + uc.SetLastName(*s) + } + return uc +} + +// SetDisplayName sets the "display_name" field. +func (uc *UserCreate) SetDisplayName(s string) *UserCreate { + uc.mutation.SetDisplayName(s) + return uc +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (uc *UserCreate) SetAvatarRemoteURL(s string) *UserCreate { + uc.mutation.SetAvatarRemoteURL(s) + return uc +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (uc *UserCreate) SetNillableAvatarRemoteURL(s *string) *UserCreate { + if s != nil { + uc.SetAvatarRemoteURL(*s) + } + return uc +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (uc *UserCreate) SetAvatarLocalFile(s string) *UserCreate { + uc.mutation.SetAvatarLocalFile(s) + return uc +} + +// SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil. +func (uc *UserCreate) SetNillableAvatarLocalFile(s *string) *UserCreate { + if s != nil { + uc.SetAvatarLocalFile(*s) + } + return uc +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (uc *UserCreate) SetAvatarUpdatedAt(t time.Time) *UserCreate { + uc.mutation.SetAvatarUpdatedAt(t) + return uc +} + +// SetNillableAvatarUpdatedAt sets the "avatar_updated_at" field if the given value is not nil. +func (uc *UserCreate) SetNillableAvatarUpdatedAt(t *time.Time) *UserCreate { + if t != nil { + uc.SetAvatarUpdatedAt(*t) + } + return uc +} + +// SetLastSeen sets the "last_seen" field. +func (uc *UserCreate) SetLastSeen(t time.Time) *UserCreate { + uc.mutation.SetLastSeen(t) + return uc +} + +// SetNillableLastSeen sets the "last_seen" field if the given value is not nil. +func (uc *UserCreate) SetNillableLastSeen(t *time.Time) *UserCreate { + if t != nil { + uc.SetLastSeen(*t) + } + return uc +} + +// SetPassword sets the "password" field. +func (uc *UserCreate) SetPassword(s string) *UserCreate { + uc.mutation.SetPassword(s) + return uc +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate { + if s != nil { + uc.SetPassword(*s) + } + return uc +} + +// SetSub sets the "sub" field. +func (uc *UserCreate) SetSub(s string) *UserCreate { + uc.mutation.SetSub(s) + return uc +} + +// SetNillableSub sets the "sub" field if the given value is not nil. +func (uc *UserCreate) SetNillableSub(s *string) *UserCreate { + if s != nil { + uc.SetSub(*s) + } + return uc +} + +// SetAuthProvider sets the "auth_provider" field. +func (uc *UserCreate) SetAuthProvider(ep enums.AuthProvider) *UserCreate { + uc.mutation.SetAuthProvider(ep) + return uc +} + +// SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil. +func (uc *UserCreate) SetNillableAuthProvider(ep *enums.AuthProvider) *UserCreate { + if ep != nil { + uc.SetAuthProvider(*ep) + } + return uc +} + +// SetRole sets the "role" field. +func (uc *UserCreate) SetRole(e enums.Role) *UserCreate { + uc.mutation.SetRole(e) + return uc +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (uc *UserCreate) SetNillableRole(e *enums.Role) *UserCreate { + if e != nil { + uc.SetRole(*e) + } + return uc +} + +// SetID sets the "id" field. +func (uc *UserCreate) SetID(s string) *UserCreate { + uc.mutation.SetID(s) + return uc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (uc *UserCreate) SetNillableID(s *string) *UserCreate { + if s != nil { + uc.SetID(*s) + } + return uc +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (uc *UserCreate) AddPersonalAccessTokenIDs(ids ...string) *UserCreate { + uc.mutation.AddPersonalAccessTokenIDs(ids...) + return uc +} + +// AddPersonalAccessTokens adds the "personal_access_tokens" edges to the PersonalAccessToken entity. +func (uc *UserCreate) AddPersonalAccessTokens(p ...*PersonalAccessToken) *UserCreate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uc.AddPersonalAccessTokenIDs(ids...) +} + +// AddTfaSettingIDs adds the "tfa_settings" edge to the TFASetting entity by IDs. +func (uc *UserCreate) AddTfaSettingIDs(ids ...string) *UserCreate { + uc.mutation.AddTfaSettingIDs(ids...) + return uc +} + +// AddTfaSettings adds the "tfa_settings" edges to the TFASetting entity. +func (uc *UserCreate) AddTfaSettings(t ...*TFASetting) *UserCreate { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return uc.AddTfaSettingIDs(ids...) +} + +// SetSettingID sets the "setting" edge to the UserSetting entity by ID. +func (uc *UserCreate) SetSettingID(id string) *UserCreate { + uc.mutation.SetSettingID(id) + return uc +} + +// SetSetting sets the "setting" edge to the UserSetting entity. +func (uc *UserCreate) SetSetting(u *UserSetting) *UserCreate { + return uc.SetSettingID(u.ID) +} + +// AddEmailVerificationTokenIDs adds the "email_verification_tokens" edge to the EmailVerificationToken entity by IDs. +func (uc *UserCreate) AddEmailVerificationTokenIDs(ids ...string) *UserCreate { + uc.mutation.AddEmailVerificationTokenIDs(ids...) + return uc +} + +// AddEmailVerificationTokens adds the "email_verification_tokens" edges to the EmailVerificationToken entity. +func (uc *UserCreate) AddEmailVerificationTokens(e ...*EmailVerificationToken) *UserCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uc.AddEmailVerificationTokenIDs(ids...) +} + +// AddPasswordResetTokenIDs adds the "password_reset_tokens" edge to the PasswordResetToken entity by IDs. +func (uc *UserCreate) AddPasswordResetTokenIDs(ids ...string) *UserCreate { + uc.mutation.AddPasswordResetTokenIDs(ids...) + return uc +} + +// AddPasswordResetTokens adds the "password_reset_tokens" edges to the PasswordResetToken entity. +func (uc *UserCreate) AddPasswordResetTokens(p ...*PasswordResetToken) *UserCreate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uc.AddPasswordResetTokenIDs(ids...) +} + +// AddGroupIDs adds the "groups" edge to the Group entity by IDs. +func (uc *UserCreate) AddGroupIDs(ids ...string) *UserCreate { + uc.mutation.AddGroupIDs(ids...) + return uc +} + +// AddGroups adds the "groups" edges to the Group entity. +func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uc.AddGroupIDs(ids...) +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs. +func (uc *UserCreate) AddOrganizationIDs(ids ...string) *UserCreate { + uc.mutation.AddOrganizationIDs(ids...) + return uc +} + +// AddOrganizations adds the "organizations" edges to the Organization entity. +func (uc *UserCreate) AddOrganizations(o ...*Organization) *UserCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uc.AddOrganizationIDs(ids...) +} + +// AddWebauthnIDs adds the "webauthn" edge to the Webauthn entity by IDs. +func (uc *UserCreate) AddWebauthnIDs(ids ...string) *UserCreate { + uc.mutation.AddWebauthnIDs(ids...) + return uc +} + +// AddWebauthn adds the "webauthn" edges to the Webauthn entity. +func (uc *UserCreate) AddWebauthn(w ...*Webauthn) *UserCreate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return uc.AddWebauthnIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (uc *UserCreate) AddFileIDs(ids ...string) *UserCreate { + uc.mutation.AddFileIDs(ids...) + return uc +} + +// AddFiles adds the "files" edges to the File entity. +func (uc *UserCreate) AddFiles(f ...*File) *UserCreate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return uc.AddFileIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (uc *UserCreate) AddEventIDs(ids ...string) *UserCreate { + uc.mutation.AddEventIDs(ids...) + return uc +} + +// AddEvents adds the "events" edges to the Event entity. +func (uc *UserCreate) AddEvents(e ...*Event) *UserCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uc.AddEventIDs(ids...) +} + +// AddGroupMembershipIDs adds the "group_memberships" edge to the GroupMembership entity by IDs. +func (uc *UserCreate) AddGroupMembershipIDs(ids ...string) *UserCreate { + uc.mutation.AddGroupMembershipIDs(ids...) + return uc +} + +// AddGroupMemberships adds the "group_memberships" edges to the GroupMembership entity. +func (uc *UserCreate) AddGroupMemberships(g ...*GroupMembership) *UserCreate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uc.AddGroupMembershipIDs(ids...) +} + +// AddOrgMembershipIDs adds the "org_memberships" edge to the OrgMembership entity by IDs. +func (uc *UserCreate) AddOrgMembershipIDs(ids ...string) *UserCreate { + uc.mutation.AddOrgMembershipIDs(ids...) + return uc +} + +// AddOrgMemberships adds the "org_memberships" edges to the OrgMembership entity. +func (uc *UserCreate) AddOrgMemberships(o ...*OrgMembership) *UserCreate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uc.AddOrgMembershipIDs(ids...) +} + +// Mutation returns the UserMutation object of the builder. +func (uc *UserCreate) Mutation() *UserMutation { + return uc.mutation +} + +// Save creates the User in the database. +func (uc *UserCreate) Save(ctx context.Context) (*User, error) { + if err := uc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, uc.sqlSave, uc.mutation, uc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (uc *UserCreate) SaveX(ctx context.Context) *User { + v, err := uc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (uc *UserCreate) Exec(ctx context.Context) error { + _, err := uc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uc *UserCreate) ExecX(ctx context.Context) { + if err := uc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uc *UserCreate) defaults() error { + if _, ok := uc.mutation.CreatedAt(); !ok { + if user.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized user.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := user.DefaultCreatedAt() + uc.mutation.SetCreatedAt(v) + } + if _, ok := uc.mutation.UpdatedAt(); !ok { + if user.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized user.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := user.DefaultUpdatedAt() + uc.mutation.SetUpdatedAt(v) + } + if _, ok := uc.mutation.MappingID(); !ok { + if user.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized user.DefaultMappingID (forgotten import generated/runtime?)") + } + v := user.DefaultMappingID() + uc.mutation.SetMappingID(v) + } + if _, ok := uc.mutation.Tags(); !ok { + v := user.DefaultTags + uc.mutation.SetTags(v) + } + if _, ok := uc.mutation.AuthProvider(); !ok { + v := user.DefaultAuthProvider + uc.mutation.SetAuthProvider(v) + } + if _, ok := uc.mutation.Role(); !ok { + v := user.DefaultRole + uc.mutation.SetRole(v) + } + if _, ok := uc.mutation.ID(); !ok { + if user.DefaultID == nil { + return fmt.Errorf("generated: uninitialized user.DefaultID (forgotten import generated/runtime?)") + } + v := user.DefaultID() + uc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (uc *UserCreate) check() error { + if _, ok := uc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "User.mapping_id"`)} + } + if _, ok := uc.mutation.Email(); !ok { + return &ValidationError{Name: "email", err: errors.New(`generated: missing required field "User.email"`)} + } + if v, ok := uc.mutation.Email(); ok { + if err := user.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "User.email": %w`, err)} + } + } + if v, ok := uc.mutation.FirstName(); ok { + if err := user.FirstNameValidator(v); err != nil { + return &ValidationError{Name: "first_name", err: fmt.Errorf(`generated: validator failed for field "User.first_name": %w`, err)} + } + } + if v, ok := uc.mutation.LastName(); ok { + if err := user.LastNameValidator(v); err != nil { + return &ValidationError{Name: "last_name", err: fmt.Errorf(`generated: validator failed for field "User.last_name": %w`, err)} + } + } + if _, ok := uc.mutation.DisplayName(); !ok { + return &ValidationError{Name: "display_name", err: errors.New(`generated: missing required field "User.display_name"`)} + } + if v, ok := uc.mutation.DisplayName(); ok { + if err := user.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "User.display_name": %w`, err)} + } + } + if v, ok := uc.mutation.AvatarRemoteURL(); ok { + if err := user.AvatarRemoteURLValidator(v); err != nil { + return &ValidationError{Name: "avatar_remote_url", err: fmt.Errorf(`generated: validator failed for field "User.avatar_remote_url": %w`, err)} + } + } + if v, ok := uc.mutation.AvatarLocalFile(); ok { + if err := user.AvatarLocalFileValidator(v); err != nil { + return &ValidationError{Name: "avatar_local_file", err: fmt.Errorf(`generated: validator failed for field "User.avatar_local_file": %w`, err)} + } + } + if _, ok := uc.mutation.AuthProvider(); !ok { + return &ValidationError{Name: "auth_provider", err: errors.New(`generated: missing required field "User.auth_provider"`)} + } + if v, ok := uc.mutation.AuthProvider(); ok { + if err := user.AuthProviderValidator(v); err != nil { + return &ValidationError{Name: "auth_provider", err: fmt.Errorf(`generated: validator failed for field "User.auth_provider": %w`, err)} + } + } + if v, ok := uc.mutation.Role(); ok { + if err := user.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "User.role": %w`, err)} + } + } + if len(uc.mutation.SettingIDs()) == 0 { + return &ValidationError{Name: "setting", err: errors.New(`generated: missing required edge "User.setting"`)} + } + return nil +} + +func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) { + if err := uc.check(); err != nil { + return nil, err + } + _node, _spec := uc.createSpec() + if err := sqlgraph.CreateNode(ctx, uc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected User.ID type: %T", _spec.ID.Value) + } + } + uc.mutation.id = &_node.ID + uc.mutation.done = true + return _node, nil +} + +func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) { + var ( + _node = &User{config: uc.config} + _spec = sqlgraph.NewCreateSpec(user.Table, sqlgraph.NewFieldSpec(user.FieldID, field.TypeString)) + ) + _spec.Schema = uc.schemaConfig.User + if id, ok := uc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := uc.mutation.CreatedAt(); ok { + _spec.SetField(user.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := uc.mutation.UpdatedAt(); ok { + _spec.SetField(user.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := uc.mutation.CreatedBy(); ok { + _spec.SetField(user.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := uc.mutation.UpdatedBy(); ok { + _spec.SetField(user.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := uc.mutation.DeletedAt(); ok { + _spec.SetField(user.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := uc.mutation.DeletedBy(); ok { + _spec.SetField(user.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := uc.mutation.MappingID(); ok { + _spec.SetField(user.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := uc.mutation.Tags(); ok { + _spec.SetField(user.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := uc.mutation.Email(); ok { + _spec.SetField(user.FieldEmail, field.TypeString, value) + _node.Email = value + } + if value, ok := uc.mutation.FirstName(); ok { + _spec.SetField(user.FieldFirstName, field.TypeString, value) + _node.FirstName = value + } + if value, ok := uc.mutation.LastName(); ok { + _spec.SetField(user.FieldLastName, field.TypeString, value) + _node.LastName = value + } + if value, ok := uc.mutation.DisplayName(); ok { + _spec.SetField(user.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := uc.mutation.AvatarRemoteURL(); ok { + _spec.SetField(user.FieldAvatarRemoteURL, field.TypeString, value) + _node.AvatarRemoteURL = &value + } + if value, ok := uc.mutation.AvatarLocalFile(); ok { + _spec.SetField(user.FieldAvatarLocalFile, field.TypeString, value) + _node.AvatarLocalFile = &value + } + if value, ok := uc.mutation.AvatarUpdatedAt(); ok { + _spec.SetField(user.FieldAvatarUpdatedAt, field.TypeTime, value) + _node.AvatarUpdatedAt = &value + } + if value, ok := uc.mutation.LastSeen(); ok { + _spec.SetField(user.FieldLastSeen, field.TypeTime, value) + _node.LastSeen = &value + } + if value, ok := uc.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + _node.Password = &value + } + if value, ok := uc.mutation.Sub(); ok { + _spec.SetField(user.FieldSub, field.TypeString, value) + _node.Sub = value + } + if value, ok := uc.mutation.AuthProvider(); ok { + _spec.SetField(user.FieldAuthProvider, field.TypeEnum, value) + _node.AuthProvider = value + } + if value, ok := uc.mutation.Role(); ok { + _spec.SetField(user.FieldRole, field.TypeEnum, value) + _node.Role = value + } + if nodes := uc.mutation.PersonalAccessTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.TfaSettingsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: user.SettingTable, + Columns: []string{user.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.EmailVerificationTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.PasswordResetTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.GroupsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: uc.config, mutation: newGroupMembershipMutation(uc.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.OrganizationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: uc.config, mutation: newOrgMembershipMutation(uc.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.WebauthnIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.GroupMembershipsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := uc.mutation.OrgMembershipsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uc.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// UserCreateBulk is the builder for creating many User entities in bulk. +type UserCreateBulk struct { + config + err error + builders []*UserCreate +} + +// Save creates the User entities in the database. +func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) { + if ucb.err != nil { + return nil, ucb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ucb.builders)) + nodes := make([]*User, len(ucb.builders)) + mutators := make([]Mutator, len(ucb.builders)) + for i := range ucb.builders { + func(i int, root context.Context) { + builder := ucb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*UserMutation) + 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, ucb.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, ucb.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, ucb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User { + v, err := ucb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ucb *UserCreateBulk) Exec(ctx context.Context) error { + _, err := ucb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ucb *UserCreateBulk) ExecX(ctx context.Context) { + if err := ucb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/user_delete.go b/internal/ent/generated/user_delete.go new file mode 100644 index 0000000..956f7db --- /dev/null +++ b/internal/ent/generated/user_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +// UserDelete is the builder for deleting a User entity. +type UserDelete struct { + config + hooks []Hook + mutation *UserMutation +} + +// Where appends a list predicates to the UserDelete builder. +func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete { + ud.mutation.Where(ps...) + return ud +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ud *UserDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ud.sqlExec, ud.mutation, ud.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ud *UserDelete) ExecX(ctx context.Context) int { + n, err := ud.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ud *UserDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(user.Table, sqlgraph.NewFieldSpec(user.FieldID, field.TypeString)) + _spec.Node.Schema = ud.schemaConfig.User + ctx = internal.NewSchemaConfigContext(ctx, ud.schemaConfig) + if ps := ud.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ud.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ud.mutation.done = true + return affected, err +} + +// UserDeleteOne is the builder for deleting a single User entity. +type UserDeleteOne struct { + ud *UserDelete +} + +// Where appends a list predicates to the UserDelete builder. +func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne { + udo.ud.mutation.Where(ps...) + return udo +} + +// Exec executes the deletion query. +func (udo *UserDeleteOne) Exec(ctx context.Context) error { + n, err := udo.ud.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{user.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (udo *UserDeleteOne) ExecX(ctx context.Context) { + if err := udo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/user_query.go b/internal/ent/generated/user_query.go new file mode 100644 index 0000000..31bdd4c --- /dev/null +++ b/internal/ent/generated/user_query.go @@ -0,0 +1,1827 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserQuery is the builder for querying User entities. +type UserQuery struct { + config + ctx *QueryContext + order []user.OrderOption + inters []Interceptor + predicates []predicate.User + withPersonalAccessTokens *PersonalAccessTokenQuery + withTfaSettings *TFASettingQuery + withSetting *UserSettingQuery + withEmailVerificationTokens *EmailVerificationTokenQuery + withPasswordResetTokens *PasswordResetTokenQuery + withGroups *GroupQuery + withOrganizations *OrganizationQuery + withWebauthn *WebauthnQuery + withFiles *FileQuery + withEvents *EventQuery + withGroupMemberships *GroupMembershipQuery + withOrgMemberships *OrgMembershipQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*User) error + withNamedPersonalAccessTokens map[string]*PersonalAccessTokenQuery + withNamedTfaSettings map[string]*TFASettingQuery + withNamedEmailVerificationTokens map[string]*EmailVerificationTokenQuery + withNamedPasswordResetTokens map[string]*PasswordResetTokenQuery + withNamedGroups map[string]*GroupQuery + withNamedOrganizations map[string]*OrganizationQuery + withNamedWebauthn map[string]*WebauthnQuery + withNamedFiles map[string]*FileQuery + withNamedEvents map[string]*EventQuery + withNamedGroupMemberships map[string]*GroupMembershipQuery + withNamedOrgMemberships map[string]*OrgMembershipQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the UserQuery builder. +func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery { + uq.predicates = append(uq.predicates, ps...) + return uq +} + +// Limit the number of records to be returned by this query. +func (uq *UserQuery) Limit(limit int) *UserQuery { + uq.ctx.Limit = &limit + return uq +} + +// Offset to start from. +func (uq *UserQuery) Offset(offset int) *UserQuery { + uq.ctx.Offset = &offset + return uq +} + +// 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 (uq *UserQuery) Unique(unique bool) *UserQuery { + uq.ctx.Unique = &unique + return uq +} + +// Order specifies how the records should be ordered. +func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery { + uq.order = append(uq.order, o...) + return uq +} + +// QueryPersonalAccessTokens chains the current query on the "personal_access_tokens" edge. +func (uq *UserQuery) QueryPersonalAccessTokens() *PersonalAccessTokenQuery { + query := (&PersonalAccessTokenClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(personalaccesstoken.Table, personalaccesstoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.PersonalAccessTokensTable, user.PersonalAccessTokensColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.PersonalAccessToken + step.Edge.Schema = schemaConfig.PersonalAccessToken + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryTfaSettings chains the current query on the "tfa_settings" edge. +func (uq *UserQuery) QueryTfaSettings() *TFASettingQuery { + query := (&TFASettingClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(tfasetting.Table, tfasetting.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.TfaSettingsTable, user.TfaSettingsColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.TFASetting + step.Edge.Schema = schemaConfig.TFASetting + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QuerySetting chains the current query on the "setting" edge. +func (uq *UserQuery) QuerySetting() *UserSettingQuery { + query := (&UserSettingClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(usersetting.Table, usersetting.FieldID), + sqlgraph.Edge(sqlgraph.O2O, false, user.SettingTable, user.SettingColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.UserSetting + step.Edge.Schema = schemaConfig.UserSetting + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEmailVerificationTokens chains the current query on the "email_verification_tokens" edge. +func (uq *UserQuery) QueryEmailVerificationTokens() *EmailVerificationTokenQuery { + query := (&EmailVerificationTokenClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(emailverificationtoken.Table, emailverificationtoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.EmailVerificationTokensTable, user.EmailVerificationTokensColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.EmailVerificationToken + step.Edge.Schema = schemaConfig.EmailVerificationToken + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryPasswordResetTokens chains the current query on the "password_reset_tokens" edge. +func (uq *UserQuery) QueryPasswordResetTokens() *PasswordResetTokenQuery { + query := (&PasswordResetTokenClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(passwordresettoken.Table, passwordresettoken.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.PasswordResetTokensTable, user.PasswordResetTokensColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.PasswordResetToken + step.Edge.Schema = schemaConfig.PasswordResetToken + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryGroups chains the current query on the "groups" edge. +func (uq *UserQuery) QueryGroups() *GroupQuery { + query := (&GroupClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(group.Table, group.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, user.GroupsTable, user.GroupsPrimaryKey...), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.Group + step.Edge.Schema = schemaConfig.GroupMembership + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrganizations chains the current query on the "organizations" edge. +func (uq *UserQuery) QueryOrganizations() *OrganizationQuery { + query := (&OrganizationClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, user.OrganizationsTable, user.OrganizationsPrimaryKey...), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.OrgMembership + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryWebauthn chains the current query on the "webauthn" edge. +func (uq *UserQuery) QueryWebauthn() *WebauthnQuery { + query := (&WebauthnClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(webauthn.Table, webauthn.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.WebauthnTable, user.WebauthnColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.Webauthn + step.Edge.Schema = schemaConfig.Webauthn + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryFiles chains the current query on the "files" edge. +func (uq *UserQuery) QueryFiles() *FileQuery { + query := (&FileClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(file.Table, file.FieldID), + sqlgraph.Edge(sqlgraph.O2M, false, user.FilesTable, user.FilesColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.File + step.Edge.Schema = schemaConfig.File + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (uq *UserQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, user.EventsTable, user.EventsPrimaryKey...), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.UserEvents + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryGroupMemberships chains the current query on the "group_memberships" edge. +func (uq *UserQuery) QueryGroupMemberships() *GroupMembershipQuery { + query := (&GroupMembershipClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(groupmembership.Table, groupmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, user.GroupMembershipsTable, user.GroupMembershipsColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.GroupMembership + step.Edge.Schema = schemaConfig.GroupMembership + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryOrgMemberships chains the current query on the "org_memberships" edge. +func (uq *UserQuery) QueryOrgMemberships() *OrgMembershipQuery { + query := (&OrgMembershipClient{config: uq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := uq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(user.Table, user.FieldID, selector), + sqlgraph.To(orgmembership.Table, orgmembership.FieldID), + sqlgraph.Edge(sqlgraph.O2M, true, user.OrgMembershipsTable, user.OrgMembershipsColumn), + ) + schemaConfig := uq.schemaConfig + step.To.Schema = schemaConfig.OrgMembership + step.Edge.Schema = schemaConfig.OrgMembership + fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first User entity from the query. +// Returns a *NotFoundError when no User was found. +func (uq *UserQuery) First(ctx context.Context) (*User, error) { + nodes, err := uq.Limit(1).All(setContextOp(ctx, uq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{user.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (uq *UserQuery) FirstX(ctx context.Context) *User { + node, err := uq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first User ID from the query. +// Returns a *NotFoundError when no User ID was found. +func (uq *UserQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = uq.Limit(1).IDs(setContextOp(ctx, uq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{user.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (uq *UserQuery) FirstIDX(ctx context.Context) string { + id, err := uq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single User entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one User entity is found. +// Returns a *NotFoundError when no User entities are found. +func (uq *UserQuery) Only(ctx context.Context) (*User, error) { + nodes, err := uq.Limit(2).All(setContextOp(ctx, uq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{user.Label} + default: + return nil, &NotSingularError{user.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (uq *UserQuery) OnlyX(ctx context.Context) *User { + node, err := uq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only User ID in the query. +// Returns a *NotSingularError when more than one User ID is found. +// Returns a *NotFoundError when no entities are found. +func (uq *UserQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = uq.Limit(2).IDs(setContextOp(ctx, uq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{user.Label} + default: + err = &NotSingularError{user.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (uq *UserQuery) OnlyIDX(ctx context.Context) string { + id, err := uq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Users. +func (uq *UserQuery) All(ctx context.Context) ([]*User, error) { + ctx = setContextOp(ctx, uq.ctx, ent.OpQueryAll) + if err := uq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*User, *UserQuery]() + return withInterceptors[[]*User](ctx, uq, qr, uq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (uq *UserQuery) AllX(ctx context.Context) []*User { + nodes, err := uq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of User IDs. +func (uq *UserQuery) IDs(ctx context.Context) (ids []string, err error) { + if uq.ctx.Unique == nil && uq.path != nil { + uq.Unique(true) + } + ctx = setContextOp(ctx, uq.ctx, ent.OpQueryIDs) + if err = uq.Select(user.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (uq *UserQuery) IDsX(ctx context.Context) []string { + ids, err := uq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (uq *UserQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, uq.ctx, ent.OpQueryCount) + if err := uq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, uq, querierCount[*UserQuery](), uq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (uq *UserQuery) CountX(ctx context.Context) int { + count, err := uq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (uq *UserQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, uq.ctx, ent.OpQueryExist) + switch _, err := uq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (uq *UserQuery) ExistX(ctx context.Context) bool { + exist, err := uq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (uq *UserQuery) Clone() *UserQuery { + if uq == nil { + return nil + } + return &UserQuery{ + config: uq.config, + ctx: uq.ctx.Clone(), + order: append([]user.OrderOption{}, uq.order...), + inters: append([]Interceptor{}, uq.inters...), + predicates: append([]predicate.User{}, uq.predicates...), + withPersonalAccessTokens: uq.withPersonalAccessTokens.Clone(), + withTfaSettings: uq.withTfaSettings.Clone(), + withSetting: uq.withSetting.Clone(), + withEmailVerificationTokens: uq.withEmailVerificationTokens.Clone(), + withPasswordResetTokens: uq.withPasswordResetTokens.Clone(), + withGroups: uq.withGroups.Clone(), + withOrganizations: uq.withOrganizations.Clone(), + withWebauthn: uq.withWebauthn.Clone(), + withFiles: uq.withFiles.Clone(), + withEvents: uq.withEvents.Clone(), + withGroupMemberships: uq.withGroupMemberships.Clone(), + withOrgMemberships: uq.withOrgMemberships.Clone(), + // clone intermediate query. + sql: uq.sql.Clone(), + path: uq.path, + } +} + +// WithPersonalAccessTokens tells the query-builder to eager-load the nodes that are connected to +// the "personal_access_tokens" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithPersonalAccessTokens(opts ...func(*PersonalAccessTokenQuery)) *UserQuery { + query := (&PersonalAccessTokenClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withPersonalAccessTokens = query + return uq +} + +// WithTfaSettings tells the query-builder to eager-load the nodes that are connected to +// the "tfa_settings" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithTfaSettings(opts ...func(*TFASettingQuery)) *UserQuery { + query := (&TFASettingClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withTfaSettings = query + return uq +} + +// WithSetting tells the query-builder to eager-load the nodes that are connected to +// the "setting" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithSetting(opts ...func(*UserSettingQuery)) *UserQuery { + query := (&UserSettingClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withSetting = query + return uq +} + +// WithEmailVerificationTokens tells the query-builder to eager-load the nodes that are connected to +// the "email_verification_tokens" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithEmailVerificationTokens(opts ...func(*EmailVerificationTokenQuery)) *UserQuery { + query := (&EmailVerificationTokenClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withEmailVerificationTokens = query + return uq +} + +// WithPasswordResetTokens tells the query-builder to eager-load the nodes that are connected to +// the "password_reset_tokens" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithPasswordResetTokens(opts ...func(*PasswordResetTokenQuery)) *UserQuery { + query := (&PasswordResetTokenClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withPasswordResetTokens = query + return uq +} + +// WithGroups tells the query-builder to eager-load the nodes that are connected to +// the "groups" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery { + query := (&GroupClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withGroups = query + return uq +} + +// WithOrganizations tells the query-builder to eager-load the nodes that are connected to +// the "organizations" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithOrganizations(opts ...func(*OrganizationQuery)) *UserQuery { + query := (&OrganizationClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withOrganizations = query + return uq +} + +// WithWebauthn tells the query-builder to eager-load the nodes that are connected to +// the "webauthn" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithWebauthn(opts ...func(*WebauthnQuery)) *UserQuery { + query := (&WebauthnClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withWebauthn = query + return uq +} + +// WithFiles tells the query-builder to eager-load the nodes that are connected to +// the "files" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithFiles(opts ...func(*FileQuery)) *UserQuery { + query := (&FileClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withFiles = query + return uq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithEvents(opts ...func(*EventQuery)) *UserQuery { + query := (&EventClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withEvents = query + return uq +} + +// WithGroupMemberships tells the query-builder to eager-load the nodes that are connected to +// the "group_memberships" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithGroupMemberships(opts ...func(*GroupMembershipQuery)) *UserQuery { + query := (&GroupMembershipClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withGroupMemberships = query + return uq +} + +// WithOrgMemberships tells the query-builder to eager-load the nodes that are connected to +// the "org_memberships" edge. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithOrgMemberships(opts ...func(*OrgMembershipQuery)) *UserQuery { + query := (&OrgMembershipClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + uq.withOrgMemberships = query + return uq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.User.Query(). +// GroupBy(user.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy { + uq.ctx.Fields = append([]string{field}, fields...) + grbuild := &UserGroupBy{build: uq} + grbuild.flds = &uq.ctx.Fields + grbuild.label = user.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.User.Query(). +// Select(user.FieldCreatedAt). +// Scan(ctx, &v) +func (uq *UserQuery) Select(fields ...string) *UserSelect { + uq.ctx.Fields = append(uq.ctx.Fields, fields...) + sbuild := &UserSelect{UserQuery: uq} + sbuild.label = user.Label + sbuild.flds, sbuild.scan = &uq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a UserSelect configured with the given aggregations. +func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect { + return uq.Select().Aggregate(fns...) +} + +func (uq *UserQuery) prepareQuery(ctx context.Context) error { + for _, inter := range uq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, uq); err != nil { + return err + } + } + } + for _, f := range uq.ctx.Fields { + if !user.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if uq.path != nil { + prev, err := uq.path(ctx) + if err != nil { + return err + } + uq.sql = prev + } + if user.Policy == nil { + return errors.New("generated: uninitialized user.Policy (forgotten import generated/runtime?)") + } + if err := user.Policy.EvalQuery(ctx, uq); err != nil { + return err + } + return nil +} + +func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, error) { + var ( + nodes = []*User{} + _spec = uq.querySpec() + loadedTypes = [12]bool{ + uq.withPersonalAccessTokens != nil, + uq.withTfaSettings != nil, + uq.withSetting != nil, + uq.withEmailVerificationTokens != nil, + uq.withPasswordResetTokens != nil, + uq.withGroups != nil, + uq.withOrganizations != nil, + uq.withWebauthn != nil, + uq.withFiles != nil, + uq.withEvents != nil, + uq.withGroupMemberships != nil, + uq.withOrgMemberships != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*User).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &User{config: uq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = uq.schemaConfig.User + ctx = internal.NewSchemaConfigContext(ctx, uq.schemaConfig) + if len(uq.modifiers) > 0 { + _spec.Modifiers = uq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, uq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := uq.withPersonalAccessTokens; query != nil { + if err := uq.loadPersonalAccessTokens(ctx, query, nodes, + func(n *User) { n.Edges.PersonalAccessTokens = []*PersonalAccessToken{} }, + func(n *User, e *PersonalAccessToken) { + n.Edges.PersonalAccessTokens = append(n.Edges.PersonalAccessTokens, e) + }); err != nil { + return nil, err + } + } + if query := uq.withTfaSettings; query != nil { + if err := uq.loadTfaSettings(ctx, query, nodes, + func(n *User) { n.Edges.TfaSettings = []*TFASetting{} }, + func(n *User, e *TFASetting) { n.Edges.TfaSettings = append(n.Edges.TfaSettings, e) }); err != nil { + return nil, err + } + } + if query := uq.withSetting; query != nil { + if err := uq.loadSetting(ctx, query, nodes, nil, + func(n *User, e *UserSetting) { n.Edges.Setting = e }); err != nil { + return nil, err + } + } + if query := uq.withEmailVerificationTokens; query != nil { + if err := uq.loadEmailVerificationTokens(ctx, query, nodes, + func(n *User) { n.Edges.EmailVerificationTokens = []*EmailVerificationToken{} }, + func(n *User, e *EmailVerificationToken) { + n.Edges.EmailVerificationTokens = append(n.Edges.EmailVerificationTokens, e) + }); err != nil { + return nil, err + } + } + if query := uq.withPasswordResetTokens; query != nil { + if err := uq.loadPasswordResetTokens(ctx, query, nodes, + func(n *User) { n.Edges.PasswordResetTokens = []*PasswordResetToken{} }, + func(n *User, e *PasswordResetToken) { + n.Edges.PasswordResetTokens = append(n.Edges.PasswordResetTokens, e) + }); err != nil { + return nil, err + } + } + if query := uq.withGroups; query != nil { + if err := uq.loadGroups(ctx, query, nodes, + func(n *User) { n.Edges.Groups = []*Group{} }, + func(n *User, e *Group) { n.Edges.Groups = append(n.Edges.Groups, e) }); err != nil { + return nil, err + } + } + if query := uq.withOrganizations; query != nil { + if err := uq.loadOrganizations(ctx, query, nodes, + func(n *User) { n.Edges.Organizations = []*Organization{} }, + func(n *User, e *Organization) { n.Edges.Organizations = append(n.Edges.Organizations, e) }); err != nil { + return nil, err + } + } + if query := uq.withWebauthn; query != nil { + if err := uq.loadWebauthn(ctx, query, nodes, + func(n *User) { n.Edges.Webauthn = []*Webauthn{} }, + func(n *User, e *Webauthn) { n.Edges.Webauthn = append(n.Edges.Webauthn, e) }); err != nil { + return nil, err + } + } + if query := uq.withFiles; query != nil { + if err := uq.loadFiles(ctx, query, nodes, + func(n *User) { n.Edges.Files = []*File{} }, + func(n *User, e *File) { n.Edges.Files = append(n.Edges.Files, e) }); err != nil { + return nil, err + } + } + if query := uq.withEvents; query != nil { + if err := uq.loadEvents(ctx, query, nodes, + func(n *User) { n.Edges.Events = []*Event{} }, + func(n *User, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + if query := uq.withGroupMemberships; query != nil { + if err := uq.loadGroupMemberships(ctx, query, nodes, + func(n *User) { n.Edges.GroupMemberships = []*GroupMembership{} }, + func(n *User, e *GroupMembership) { n.Edges.GroupMemberships = append(n.Edges.GroupMemberships, e) }); err != nil { + return nil, err + } + } + if query := uq.withOrgMemberships; query != nil { + if err := uq.loadOrgMemberships(ctx, query, nodes, + func(n *User) { n.Edges.OrgMemberships = []*OrgMembership{} }, + func(n *User, e *OrgMembership) { n.Edges.OrgMemberships = append(n.Edges.OrgMemberships, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedPersonalAccessTokens { + if err := uq.loadPersonalAccessTokens(ctx, query, nodes, + func(n *User) { n.appendNamedPersonalAccessTokens(name) }, + func(n *User, e *PersonalAccessToken) { n.appendNamedPersonalAccessTokens(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedTfaSettings { + if err := uq.loadTfaSettings(ctx, query, nodes, + func(n *User) { n.appendNamedTfaSettings(name) }, + func(n *User, e *TFASetting) { n.appendNamedTfaSettings(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedEmailVerificationTokens { + if err := uq.loadEmailVerificationTokens(ctx, query, nodes, + func(n *User) { n.appendNamedEmailVerificationTokens(name) }, + func(n *User, e *EmailVerificationToken) { n.appendNamedEmailVerificationTokens(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedPasswordResetTokens { + if err := uq.loadPasswordResetTokens(ctx, query, nodes, + func(n *User) { n.appendNamedPasswordResetTokens(name) }, + func(n *User, e *PasswordResetToken) { n.appendNamedPasswordResetTokens(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedGroups { + if err := uq.loadGroups(ctx, query, nodes, + func(n *User) { n.appendNamedGroups(name) }, + func(n *User, e *Group) { n.appendNamedGroups(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedOrganizations { + if err := uq.loadOrganizations(ctx, query, nodes, + func(n *User) { n.appendNamedOrganizations(name) }, + func(n *User, e *Organization) { n.appendNamedOrganizations(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedWebauthn { + if err := uq.loadWebauthn(ctx, query, nodes, + func(n *User) { n.appendNamedWebauthn(name) }, + func(n *User, e *Webauthn) { n.appendNamedWebauthn(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedFiles { + if err := uq.loadFiles(ctx, query, nodes, + func(n *User) { n.appendNamedFiles(name) }, + func(n *User, e *File) { n.appendNamedFiles(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedEvents { + if err := uq.loadEvents(ctx, query, nodes, + func(n *User) { n.appendNamedEvents(name) }, + func(n *User, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedGroupMemberships { + if err := uq.loadGroupMemberships(ctx, query, nodes, + func(n *User) { n.appendNamedGroupMemberships(name) }, + func(n *User, e *GroupMembership) { n.appendNamedGroupMemberships(name, e) }); err != nil { + return nil, err + } + } + for name, query := range uq.withNamedOrgMemberships { + if err := uq.loadOrgMemberships(ctx, query, nodes, + func(n *User) { n.appendNamedOrgMemberships(name) }, + func(n *User, e *OrgMembership) { n.appendNamedOrgMemberships(name, e) }); err != nil { + return nil, err + } + } + for i := range uq.loadTotal { + if err := uq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (uq *UserQuery) loadPersonalAccessTokens(ctx context.Context, query *PersonalAccessTokenQuery, nodes []*User, init func(*User), assign func(*User, *PersonalAccessToken)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(personalaccesstoken.FieldOwnerID) + } + query.Where(predicate.PersonalAccessToken(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.PersonalAccessTokensColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadTfaSettings(ctx context.Context, query *TFASettingQuery, nodes []*User, init func(*User), assign func(*User, *TFASetting)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(tfasetting.FieldOwnerID) + } + query.Where(predicate.TFASetting(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.TfaSettingsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadSetting(ctx context.Context, query *UserSettingQuery, nodes []*User, init func(*User), assign func(*User, *UserSetting)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + } + query.withFKs = true + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(usersetting.FieldUserID) + } + query.Where(predicate.UserSetting(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.SettingColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.UserID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "user_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadEmailVerificationTokens(ctx context.Context, query *EmailVerificationTokenQuery, nodes []*User, init func(*User), assign func(*User, *EmailVerificationToken)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(emailverificationtoken.FieldOwnerID) + } + query.Where(predicate.EmailVerificationToken(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.EmailVerificationTokensColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadPasswordResetTokens(ctx context.Context, query *PasswordResetTokenQuery, nodes []*User, init func(*User), assign func(*User, *PasswordResetToken)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(passwordresettoken.FieldOwnerID) + } + query.Where(predicate.PasswordResetToken(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.PasswordResetTokensColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadGroups(ctx context.Context, query *GroupQuery, nodes []*User, init func(*User), assign func(*User, *Group)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*User) + nids := make(map[string]map[*User]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(user.GroupsTable) + joinT.Schema(uq.schemaConfig.GroupMembership) + s.Join(joinT).On(s.C(group.FieldID), joinT.C(user.GroupsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(user.GroupsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(user.GroupsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*User]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Group](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "groups" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (uq *UserQuery) loadOrganizations(ctx context.Context, query *OrganizationQuery, nodes []*User, init func(*User), assign func(*User, *Organization)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*User) + nids := make(map[string]map[*User]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(user.OrganizationsTable) + joinT.Schema(uq.schemaConfig.OrgMembership) + s.Join(joinT).On(s.C(organization.FieldID), joinT.C(user.OrganizationsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(user.OrganizationsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(user.OrganizationsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*User]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Organization](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "organizations" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (uq *UserQuery) loadWebauthn(ctx context.Context, query *WebauthnQuery, nodes []*User, init func(*User), assign func(*User, *Webauthn)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(webauthn.FieldOwnerID) + } + query.Where(predicate.Webauthn(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.WebauthnColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.OwnerID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "owner_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadFiles(ctx context.Context, query *FileQuery, nodes []*User, init func(*User), assign func(*User, *File)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + query.withFKs = true + query.Where(predicate.File(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.FilesColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.user_files + if fk == nil { + return fmt.Errorf(`foreign-key "user_files" is nil for node %v`, n.ID) + } + node, ok := nodeids[*fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "user_files" returned %v for node %v`, *fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*User, init func(*User), assign func(*User, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*User) + nids := make(map[string]map[*User]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(user.EventsTable) + joinT.Schema(uq.schemaConfig.UserEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(user.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(user.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(user.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*User]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (uq *UserQuery) loadGroupMemberships(ctx context.Context, query *GroupMembershipQuery, nodes []*User, init func(*User), assign func(*User, *GroupMembership)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(groupmembership.FieldUserID) + } + query.Where(predicate.GroupMembership(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.GroupMembershipsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.UserID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "user_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} +func (uq *UserQuery) loadOrgMemberships(ctx context.Context, query *OrgMembershipQuery, nodes []*User, init func(*User), assign func(*User, *OrgMembership)) error { + fks := make([]driver.Value, 0, len(nodes)) + nodeids := make(map[string]*User) + for i := range nodes { + fks = append(fks, nodes[i].ID) + nodeids[nodes[i].ID] = nodes[i] + if init != nil { + init(nodes[i]) + } + } + if len(query.ctx.Fields) > 0 { + query.ctx.AppendFieldOnce(orgmembership.FieldUserID) + } + query.Where(predicate.OrgMembership(func(s *sql.Selector) { + s.Where(sql.InValues(s.C(user.OrgMembershipsColumn), fks...)) + })) + neighbors, err := query.All(ctx) + if err != nil { + return err + } + for _, n := range neighbors { + fk := n.UserID + node, ok := nodeids[fk] + if !ok { + return fmt.Errorf(`unexpected referenced foreign-key "user_id" returned %v for node %v`, fk, n.ID) + } + assign(node, n) + } + return nil +} + +func (uq *UserQuery) sqlCount(ctx context.Context) (int, error) { + _spec := uq.querySpec() + _spec.Node.Schema = uq.schemaConfig.User + ctx = internal.NewSchemaConfigContext(ctx, uq.schemaConfig) + if len(uq.modifiers) > 0 { + _spec.Modifiers = uq.modifiers + } + _spec.Node.Columns = uq.ctx.Fields + if len(uq.ctx.Fields) > 0 { + _spec.Unique = uq.ctx.Unique != nil && *uq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, uq.driver, _spec) +} + +func (uq *UserQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeString)) + _spec.From = uq.sql + if unique := uq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if uq.path != nil { + _spec.Unique = true + } + if fields := uq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, user.FieldID) + for i := range fields { + if fields[i] != user.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := uq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := uq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := uq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := uq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (uq *UserQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(uq.driver.Dialect()) + t1 := builder.Table(user.Table) + columns := uq.ctx.Fields + if len(columns) == 0 { + columns = user.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if uq.sql != nil { + selector = uq.sql + selector.Select(selector.Columns(columns...)...) + } + if uq.ctx.Unique != nil && *uq.ctx.Unique { + selector.Distinct() + } + t1.Schema(uq.schemaConfig.User) + ctx = internal.NewSchemaConfigContext(ctx, uq.schemaConfig) + selector.WithContext(ctx) + for _, p := range uq.predicates { + p(selector) + } + for _, p := range uq.order { + p(selector) + } + if offset := uq.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 := uq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedPersonalAccessTokens tells the query-builder to eager-load the nodes that are connected to the "personal_access_tokens" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedPersonalAccessTokens(name string, opts ...func(*PersonalAccessTokenQuery)) *UserQuery { + query := (&PersonalAccessTokenClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedPersonalAccessTokens == nil { + uq.withNamedPersonalAccessTokens = make(map[string]*PersonalAccessTokenQuery) + } + uq.withNamedPersonalAccessTokens[name] = query + return uq +} + +// WithNamedTfaSettings tells the query-builder to eager-load the nodes that are connected to the "tfa_settings" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedTfaSettings(name string, opts ...func(*TFASettingQuery)) *UserQuery { + query := (&TFASettingClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedTfaSettings == nil { + uq.withNamedTfaSettings = make(map[string]*TFASettingQuery) + } + uq.withNamedTfaSettings[name] = query + return uq +} + +// WithNamedEmailVerificationTokens tells the query-builder to eager-load the nodes that are connected to the "email_verification_tokens" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedEmailVerificationTokens(name string, opts ...func(*EmailVerificationTokenQuery)) *UserQuery { + query := (&EmailVerificationTokenClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedEmailVerificationTokens == nil { + uq.withNamedEmailVerificationTokens = make(map[string]*EmailVerificationTokenQuery) + } + uq.withNamedEmailVerificationTokens[name] = query + return uq +} + +// WithNamedPasswordResetTokens tells the query-builder to eager-load the nodes that are connected to the "password_reset_tokens" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedPasswordResetTokens(name string, opts ...func(*PasswordResetTokenQuery)) *UserQuery { + query := (&PasswordResetTokenClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedPasswordResetTokens == nil { + uq.withNamedPasswordResetTokens = make(map[string]*PasswordResetTokenQuery) + } + uq.withNamedPasswordResetTokens[name] = query + return uq +} + +// WithNamedGroups tells the query-builder to eager-load the nodes that are connected to the "groups" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedGroups(name string, opts ...func(*GroupQuery)) *UserQuery { + query := (&GroupClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedGroups == nil { + uq.withNamedGroups = make(map[string]*GroupQuery) + } + uq.withNamedGroups[name] = query + return uq +} + +// WithNamedOrganizations tells the query-builder to eager-load the nodes that are connected to the "organizations" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedOrganizations(name string, opts ...func(*OrganizationQuery)) *UserQuery { + query := (&OrganizationClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedOrganizations == nil { + uq.withNamedOrganizations = make(map[string]*OrganizationQuery) + } + uq.withNamedOrganizations[name] = query + return uq +} + +// WithNamedWebauthn tells the query-builder to eager-load the nodes that are connected to the "webauthn" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedWebauthn(name string, opts ...func(*WebauthnQuery)) *UserQuery { + query := (&WebauthnClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedWebauthn == nil { + uq.withNamedWebauthn = make(map[string]*WebauthnQuery) + } + uq.withNamedWebauthn[name] = query + return uq +} + +// WithNamedFiles tells the query-builder to eager-load the nodes that are connected to the "files" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedFiles(name string, opts ...func(*FileQuery)) *UserQuery { + query := (&FileClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedFiles == nil { + uq.withNamedFiles = make(map[string]*FileQuery) + } + uq.withNamedFiles[name] = query + return uq +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *UserQuery { + query := (&EventClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedEvents == nil { + uq.withNamedEvents = make(map[string]*EventQuery) + } + uq.withNamedEvents[name] = query + return uq +} + +// WithNamedGroupMemberships tells the query-builder to eager-load the nodes that are connected to the "group_memberships" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedGroupMemberships(name string, opts ...func(*GroupMembershipQuery)) *UserQuery { + query := (&GroupMembershipClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedGroupMemberships == nil { + uq.withNamedGroupMemberships = make(map[string]*GroupMembershipQuery) + } + uq.withNamedGroupMemberships[name] = query + return uq +} + +// WithNamedOrgMemberships tells the query-builder to eager-load the nodes that are connected to the "org_memberships" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (uq *UserQuery) WithNamedOrgMemberships(name string, opts ...func(*OrgMembershipQuery)) *UserQuery { + query := (&OrgMembershipClient{config: uq.config}).Query() + for _, opt := range opts { + opt(query) + } + if uq.withNamedOrgMemberships == nil { + uq.withNamedOrgMemberships = make(map[string]*OrgMembershipQuery) + } + uq.withNamedOrgMemberships[name] = query + return uq +} + +// UserGroupBy is the group-by builder for User entities. +type UserGroupBy struct { + selector + build *UserQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy { + ugb.fns = append(ugb.fns, fns...) + return ugb +} + +// Scan applies the selector query and scans the result into the given value. +func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ugb.build.ctx, ent.OpQueryGroupBy) + if err := ugb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserQuery, *UserGroupBy](ctx, ugb.build, ugb, ugb.build.inters, v) +} + +func (ugb *UserGroupBy) sqlScan(ctx context.Context, root *UserQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ugb.fns)) + for _, fn := range ugb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ugb.flds)+len(ugb.fns)) + for _, f := range *ugb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ugb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ugb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// UserSelect is the builder for selecting fields of User entities. +type UserSelect struct { + *UserQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect { + us.fns = append(us.fns, fns...) + return us +} + +// Scan applies the selector query and scans the result into the given value. +func (us *UserSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, us.ctx, ent.OpQuerySelect) + if err := us.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserQuery, *UserSelect](ctx, us.UserQuery, us, us.inters, v) +} + +func (us *UserSelect) sqlScan(ctx context.Context, root *UserQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(us.fns)) + for _, fn := range us.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*us.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 := us.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/user_update.go b/internal/ent/generated/user_update.go new file mode 100644 index 0000000..7422429 --- /dev/null +++ b/internal/ent/generated/user_update.go @@ -0,0 +1,3184 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/file" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/groupmembership" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserUpdate is the builder for updating User entities. +type UserUpdate struct { + config + hooks []Hook + mutation *UserMutation +} + +// Where appends a list predicates to the UserUpdate builder. +func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate { + uu.mutation.Where(ps...) + return uu +} + +// SetUpdatedAt sets the "updated_at" field. +func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate { + uu.mutation.SetUpdatedAt(t) + return uu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (uu *UserUpdate) ClearUpdatedAt() *UserUpdate { + uu.mutation.ClearUpdatedAt() + return uu +} + +// SetUpdatedBy sets the "updated_by" field. +func (uu *UserUpdate) SetUpdatedBy(s string) *UserUpdate { + uu.mutation.SetUpdatedBy(s) + return uu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (uu *UserUpdate) SetNillableUpdatedBy(s *string) *UserUpdate { + if s != nil { + uu.SetUpdatedBy(*s) + } + return uu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (uu *UserUpdate) ClearUpdatedBy() *UserUpdate { + uu.mutation.ClearUpdatedBy() + return uu +} + +// SetDeletedAt sets the "deleted_at" field. +func (uu *UserUpdate) SetDeletedAt(t time.Time) *UserUpdate { + uu.mutation.SetDeletedAt(t) + return uu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (uu *UserUpdate) SetNillableDeletedAt(t *time.Time) *UserUpdate { + if t != nil { + uu.SetDeletedAt(*t) + } + return uu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (uu *UserUpdate) ClearDeletedAt() *UserUpdate { + uu.mutation.ClearDeletedAt() + return uu +} + +// SetDeletedBy sets the "deleted_by" field. +func (uu *UserUpdate) SetDeletedBy(s string) *UserUpdate { + uu.mutation.SetDeletedBy(s) + return uu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (uu *UserUpdate) SetNillableDeletedBy(s *string) *UserUpdate { + if s != nil { + uu.SetDeletedBy(*s) + } + return uu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (uu *UserUpdate) ClearDeletedBy() *UserUpdate { + uu.mutation.ClearDeletedBy() + return uu +} + +// SetTags sets the "tags" field. +func (uu *UserUpdate) SetTags(s []string) *UserUpdate { + uu.mutation.SetTags(s) + return uu +} + +// AppendTags appends s to the "tags" field. +func (uu *UserUpdate) AppendTags(s []string) *UserUpdate { + uu.mutation.AppendTags(s) + return uu +} + +// ClearTags clears the value of the "tags" field. +func (uu *UserUpdate) ClearTags() *UserUpdate { + uu.mutation.ClearTags() + return uu +} + +// SetEmail sets the "email" field. +func (uu *UserUpdate) SetEmail(s string) *UserUpdate { + uu.mutation.SetEmail(s) + return uu +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate { + if s != nil { + uu.SetEmail(*s) + } + return uu +} + +// SetFirstName sets the "first_name" field. +func (uu *UserUpdate) SetFirstName(s string) *UserUpdate { + uu.mutation.SetFirstName(s) + return uu +} + +// SetNillableFirstName sets the "first_name" field if the given value is not nil. +func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate { + if s != nil { + uu.SetFirstName(*s) + } + return uu +} + +// ClearFirstName clears the value of the "first_name" field. +func (uu *UserUpdate) ClearFirstName() *UserUpdate { + uu.mutation.ClearFirstName() + return uu +} + +// SetLastName sets the "last_name" field. +func (uu *UserUpdate) SetLastName(s string) *UserUpdate { + uu.mutation.SetLastName(s) + return uu +} + +// SetNillableLastName sets the "last_name" field if the given value is not nil. +func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate { + if s != nil { + uu.SetLastName(*s) + } + return uu +} + +// ClearLastName clears the value of the "last_name" field. +func (uu *UserUpdate) ClearLastName() *UserUpdate { + uu.mutation.ClearLastName() + return uu +} + +// SetDisplayName sets the "display_name" field. +func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate { + uu.mutation.SetDisplayName(s) + return uu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (uu *UserUpdate) SetNillableDisplayName(s *string) *UserUpdate { + if s != nil { + uu.SetDisplayName(*s) + } + return uu +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (uu *UserUpdate) SetAvatarRemoteURL(s string) *UserUpdate { + uu.mutation.SetAvatarRemoteURL(s) + return uu +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (uu *UserUpdate) SetNillableAvatarRemoteURL(s *string) *UserUpdate { + if s != nil { + uu.SetAvatarRemoteURL(*s) + } + return uu +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (uu *UserUpdate) ClearAvatarRemoteURL() *UserUpdate { + uu.mutation.ClearAvatarRemoteURL() + return uu +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (uu *UserUpdate) SetAvatarLocalFile(s string) *UserUpdate { + uu.mutation.SetAvatarLocalFile(s) + return uu +} + +// SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil. +func (uu *UserUpdate) SetNillableAvatarLocalFile(s *string) *UserUpdate { + if s != nil { + uu.SetAvatarLocalFile(*s) + } + return uu +} + +// ClearAvatarLocalFile clears the value of the "avatar_local_file" field. +func (uu *UserUpdate) ClearAvatarLocalFile() *UserUpdate { + uu.mutation.ClearAvatarLocalFile() + return uu +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (uu *UserUpdate) SetAvatarUpdatedAt(t time.Time) *UserUpdate { + uu.mutation.SetAvatarUpdatedAt(t) + return uu +} + +// ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field. +func (uu *UserUpdate) ClearAvatarUpdatedAt() *UserUpdate { + uu.mutation.ClearAvatarUpdatedAt() + return uu +} + +// SetLastSeen sets the "last_seen" field. +func (uu *UserUpdate) SetLastSeen(t time.Time) *UserUpdate { + uu.mutation.SetLastSeen(t) + return uu +} + +// ClearLastSeen clears the value of the "last_seen" field. +func (uu *UserUpdate) ClearLastSeen() *UserUpdate { + uu.mutation.ClearLastSeen() + return uu +} + +// SetPassword sets the "password" field. +func (uu *UserUpdate) SetPassword(s string) *UserUpdate { + uu.mutation.SetPassword(s) + return uu +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate { + if s != nil { + uu.SetPassword(*s) + } + return uu +} + +// ClearPassword clears the value of the "password" field. +func (uu *UserUpdate) ClearPassword() *UserUpdate { + uu.mutation.ClearPassword() + return uu +} + +// SetSub sets the "sub" field. +func (uu *UserUpdate) SetSub(s string) *UserUpdate { + uu.mutation.SetSub(s) + return uu +} + +// SetNillableSub sets the "sub" field if the given value is not nil. +func (uu *UserUpdate) SetNillableSub(s *string) *UserUpdate { + if s != nil { + uu.SetSub(*s) + } + return uu +} + +// ClearSub clears the value of the "sub" field. +func (uu *UserUpdate) ClearSub() *UserUpdate { + uu.mutation.ClearSub() + return uu +} + +// SetAuthProvider sets the "auth_provider" field. +func (uu *UserUpdate) SetAuthProvider(ep enums.AuthProvider) *UserUpdate { + uu.mutation.SetAuthProvider(ep) + return uu +} + +// SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil. +func (uu *UserUpdate) SetNillableAuthProvider(ep *enums.AuthProvider) *UserUpdate { + if ep != nil { + uu.SetAuthProvider(*ep) + } + return uu +} + +// SetRole sets the "role" field. +func (uu *UserUpdate) SetRole(e enums.Role) *UserUpdate { + uu.mutation.SetRole(e) + return uu +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (uu *UserUpdate) SetNillableRole(e *enums.Role) *UserUpdate { + if e != nil { + uu.SetRole(*e) + } + return uu +} + +// ClearRole clears the value of the "role" field. +func (uu *UserUpdate) ClearRole() *UserUpdate { + uu.mutation.ClearRole() + return uu +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (uu *UserUpdate) AddPersonalAccessTokenIDs(ids ...string) *UserUpdate { + uu.mutation.AddPersonalAccessTokenIDs(ids...) + return uu +} + +// AddPersonalAccessTokens adds the "personal_access_tokens" edges to the PersonalAccessToken entity. +func (uu *UserUpdate) AddPersonalAccessTokens(p ...*PersonalAccessToken) *UserUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uu.AddPersonalAccessTokenIDs(ids...) +} + +// AddTfaSettingIDs adds the "tfa_settings" edge to the TFASetting entity by IDs. +func (uu *UserUpdate) AddTfaSettingIDs(ids ...string) *UserUpdate { + uu.mutation.AddTfaSettingIDs(ids...) + return uu +} + +// AddTfaSettings adds the "tfa_settings" edges to the TFASetting entity. +func (uu *UserUpdate) AddTfaSettings(t ...*TFASetting) *UserUpdate { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return uu.AddTfaSettingIDs(ids...) +} + +// SetSettingID sets the "setting" edge to the UserSetting entity by ID. +func (uu *UserUpdate) SetSettingID(id string) *UserUpdate { + uu.mutation.SetSettingID(id) + return uu +} + +// SetSetting sets the "setting" edge to the UserSetting entity. +func (uu *UserUpdate) SetSetting(u *UserSetting) *UserUpdate { + return uu.SetSettingID(u.ID) +} + +// AddEmailVerificationTokenIDs adds the "email_verification_tokens" edge to the EmailVerificationToken entity by IDs. +func (uu *UserUpdate) AddEmailVerificationTokenIDs(ids ...string) *UserUpdate { + uu.mutation.AddEmailVerificationTokenIDs(ids...) + return uu +} + +// AddEmailVerificationTokens adds the "email_verification_tokens" edges to the EmailVerificationToken entity. +func (uu *UserUpdate) AddEmailVerificationTokens(e ...*EmailVerificationToken) *UserUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uu.AddEmailVerificationTokenIDs(ids...) +} + +// AddPasswordResetTokenIDs adds the "password_reset_tokens" edge to the PasswordResetToken entity by IDs. +func (uu *UserUpdate) AddPasswordResetTokenIDs(ids ...string) *UserUpdate { + uu.mutation.AddPasswordResetTokenIDs(ids...) + return uu +} + +// AddPasswordResetTokens adds the "password_reset_tokens" edges to the PasswordResetToken entity. +func (uu *UserUpdate) AddPasswordResetTokens(p ...*PasswordResetToken) *UserUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uu.AddPasswordResetTokenIDs(ids...) +} + +// AddGroupIDs adds the "groups" edge to the Group entity by IDs. +func (uu *UserUpdate) AddGroupIDs(ids ...string) *UserUpdate { + uu.mutation.AddGroupIDs(ids...) + return uu +} + +// AddGroups adds the "groups" edges to the Group entity. +func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uu.AddGroupIDs(ids...) +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs. +func (uu *UserUpdate) AddOrganizationIDs(ids ...string) *UserUpdate { + uu.mutation.AddOrganizationIDs(ids...) + return uu +} + +// AddOrganizations adds the "organizations" edges to the Organization entity. +func (uu *UserUpdate) AddOrganizations(o ...*Organization) *UserUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uu.AddOrganizationIDs(ids...) +} + +// AddWebauthnIDs adds the "webauthn" edge to the Webauthn entity by IDs. +func (uu *UserUpdate) AddWebauthnIDs(ids ...string) *UserUpdate { + uu.mutation.AddWebauthnIDs(ids...) + return uu +} + +// AddWebauthn adds the "webauthn" edges to the Webauthn entity. +func (uu *UserUpdate) AddWebauthn(w ...*Webauthn) *UserUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return uu.AddWebauthnIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (uu *UserUpdate) AddFileIDs(ids ...string) *UserUpdate { + uu.mutation.AddFileIDs(ids...) + return uu +} + +// AddFiles adds the "files" edges to the File entity. +func (uu *UserUpdate) AddFiles(f ...*File) *UserUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return uu.AddFileIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (uu *UserUpdate) AddEventIDs(ids ...string) *UserUpdate { + uu.mutation.AddEventIDs(ids...) + return uu +} + +// AddEvents adds the "events" edges to the Event entity. +func (uu *UserUpdate) AddEvents(e ...*Event) *UserUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uu.AddEventIDs(ids...) +} + +// AddGroupMembershipIDs adds the "group_memberships" edge to the GroupMembership entity by IDs. +func (uu *UserUpdate) AddGroupMembershipIDs(ids ...string) *UserUpdate { + uu.mutation.AddGroupMembershipIDs(ids...) + return uu +} + +// AddGroupMemberships adds the "group_memberships" edges to the GroupMembership entity. +func (uu *UserUpdate) AddGroupMemberships(g ...*GroupMembership) *UserUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uu.AddGroupMembershipIDs(ids...) +} + +// AddOrgMembershipIDs adds the "org_memberships" edge to the OrgMembership entity by IDs. +func (uu *UserUpdate) AddOrgMembershipIDs(ids ...string) *UserUpdate { + uu.mutation.AddOrgMembershipIDs(ids...) + return uu +} + +// AddOrgMemberships adds the "org_memberships" edges to the OrgMembership entity. +func (uu *UserUpdate) AddOrgMemberships(o ...*OrgMembership) *UserUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uu.AddOrgMembershipIDs(ids...) +} + +// Mutation returns the UserMutation object of the builder. +func (uu *UserUpdate) Mutation() *UserMutation { + return uu.mutation +} + +// ClearPersonalAccessTokens clears all "personal_access_tokens" edges to the PersonalAccessToken entity. +func (uu *UserUpdate) ClearPersonalAccessTokens() *UserUpdate { + uu.mutation.ClearPersonalAccessTokens() + return uu +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_tokens" edge to PersonalAccessToken entities by IDs. +func (uu *UserUpdate) RemovePersonalAccessTokenIDs(ids ...string) *UserUpdate { + uu.mutation.RemovePersonalAccessTokenIDs(ids...) + return uu +} + +// RemovePersonalAccessTokens removes "personal_access_tokens" edges to PersonalAccessToken entities. +func (uu *UserUpdate) RemovePersonalAccessTokens(p ...*PersonalAccessToken) *UserUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uu.RemovePersonalAccessTokenIDs(ids...) +} + +// ClearTfaSettings clears all "tfa_settings" edges to the TFASetting entity. +func (uu *UserUpdate) ClearTfaSettings() *UserUpdate { + uu.mutation.ClearTfaSettings() + return uu +} + +// RemoveTfaSettingIDs removes the "tfa_settings" edge to TFASetting entities by IDs. +func (uu *UserUpdate) RemoveTfaSettingIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveTfaSettingIDs(ids...) + return uu +} + +// RemoveTfaSettings removes "tfa_settings" edges to TFASetting entities. +func (uu *UserUpdate) RemoveTfaSettings(t ...*TFASetting) *UserUpdate { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return uu.RemoveTfaSettingIDs(ids...) +} + +// ClearSetting clears the "setting" edge to the UserSetting entity. +func (uu *UserUpdate) ClearSetting() *UserUpdate { + uu.mutation.ClearSetting() + return uu +} + +// ClearEmailVerificationTokens clears all "email_verification_tokens" edges to the EmailVerificationToken entity. +func (uu *UserUpdate) ClearEmailVerificationTokens() *UserUpdate { + uu.mutation.ClearEmailVerificationTokens() + return uu +} + +// RemoveEmailVerificationTokenIDs removes the "email_verification_tokens" edge to EmailVerificationToken entities by IDs. +func (uu *UserUpdate) RemoveEmailVerificationTokenIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveEmailVerificationTokenIDs(ids...) + return uu +} + +// RemoveEmailVerificationTokens removes "email_verification_tokens" edges to EmailVerificationToken entities. +func (uu *UserUpdate) RemoveEmailVerificationTokens(e ...*EmailVerificationToken) *UserUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uu.RemoveEmailVerificationTokenIDs(ids...) +} + +// ClearPasswordResetTokens clears all "password_reset_tokens" edges to the PasswordResetToken entity. +func (uu *UserUpdate) ClearPasswordResetTokens() *UserUpdate { + uu.mutation.ClearPasswordResetTokens() + return uu +} + +// RemovePasswordResetTokenIDs removes the "password_reset_tokens" edge to PasswordResetToken entities by IDs. +func (uu *UserUpdate) RemovePasswordResetTokenIDs(ids ...string) *UserUpdate { + uu.mutation.RemovePasswordResetTokenIDs(ids...) + return uu +} + +// RemovePasswordResetTokens removes "password_reset_tokens" edges to PasswordResetToken entities. +func (uu *UserUpdate) RemovePasswordResetTokens(p ...*PasswordResetToken) *UserUpdate { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uu.RemovePasswordResetTokenIDs(ids...) +} + +// ClearGroups clears all "groups" edges to the Group entity. +func (uu *UserUpdate) ClearGroups() *UserUpdate { + uu.mutation.ClearGroups() + return uu +} + +// RemoveGroupIDs removes the "groups" edge to Group entities by IDs. +func (uu *UserUpdate) RemoveGroupIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveGroupIDs(ids...) + return uu +} + +// RemoveGroups removes "groups" edges to Group entities. +func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uu.RemoveGroupIDs(ids...) +} + +// ClearOrganizations clears all "organizations" edges to the Organization entity. +func (uu *UserUpdate) ClearOrganizations() *UserUpdate { + uu.mutation.ClearOrganizations() + return uu +} + +// RemoveOrganizationIDs removes the "organizations" edge to Organization entities by IDs. +func (uu *UserUpdate) RemoveOrganizationIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveOrganizationIDs(ids...) + return uu +} + +// RemoveOrganizations removes "organizations" edges to Organization entities. +func (uu *UserUpdate) RemoveOrganizations(o ...*Organization) *UserUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uu.RemoveOrganizationIDs(ids...) +} + +// ClearWebauthn clears all "webauthn" edges to the Webauthn entity. +func (uu *UserUpdate) ClearWebauthn() *UserUpdate { + uu.mutation.ClearWebauthn() + return uu +} + +// RemoveWebauthnIDs removes the "webauthn" edge to Webauthn entities by IDs. +func (uu *UserUpdate) RemoveWebauthnIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveWebauthnIDs(ids...) + return uu +} + +// RemoveWebauthn removes "webauthn" edges to Webauthn entities. +func (uu *UserUpdate) RemoveWebauthn(w ...*Webauthn) *UserUpdate { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return uu.RemoveWebauthnIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (uu *UserUpdate) ClearFiles() *UserUpdate { + uu.mutation.ClearFiles() + return uu +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (uu *UserUpdate) RemoveFileIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveFileIDs(ids...) + return uu +} + +// RemoveFiles removes "files" edges to File entities. +func (uu *UserUpdate) RemoveFiles(f ...*File) *UserUpdate { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return uu.RemoveFileIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (uu *UserUpdate) ClearEvents() *UserUpdate { + uu.mutation.ClearEvents() + return uu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (uu *UserUpdate) RemoveEventIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveEventIDs(ids...) + return uu +} + +// RemoveEvents removes "events" edges to Event entities. +func (uu *UserUpdate) RemoveEvents(e ...*Event) *UserUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uu.RemoveEventIDs(ids...) +} + +// ClearGroupMemberships clears all "group_memberships" edges to the GroupMembership entity. +func (uu *UserUpdate) ClearGroupMemberships() *UserUpdate { + uu.mutation.ClearGroupMemberships() + return uu +} + +// RemoveGroupMembershipIDs removes the "group_memberships" edge to GroupMembership entities by IDs. +func (uu *UserUpdate) RemoveGroupMembershipIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveGroupMembershipIDs(ids...) + return uu +} + +// RemoveGroupMemberships removes "group_memberships" edges to GroupMembership entities. +func (uu *UserUpdate) RemoveGroupMemberships(g ...*GroupMembership) *UserUpdate { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uu.RemoveGroupMembershipIDs(ids...) +} + +// ClearOrgMemberships clears all "org_memberships" edges to the OrgMembership entity. +func (uu *UserUpdate) ClearOrgMemberships() *UserUpdate { + uu.mutation.ClearOrgMemberships() + return uu +} + +// RemoveOrgMembershipIDs removes the "org_memberships" edge to OrgMembership entities by IDs. +func (uu *UserUpdate) RemoveOrgMembershipIDs(ids ...string) *UserUpdate { + uu.mutation.RemoveOrgMembershipIDs(ids...) + return uu +} + +// RemoveOrgMemberships removes "org_memberships" edges to OrgMembership entities. +func (uu *UserUpdate) RemoveOrgMemberships(o ...*OrgMembership) *UserUpdate { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uu.RemoveOrgMembershipIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (uu *UserUpdate) Save(ctx context.Context) (int, error) { + if err := uu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, uu.sqlSave, uu.mutation, uu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uu *UserUpdate) SaveX(ctx context.Context) int { + affected, err := uu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (uu *UserUpdate) Exec(ctx context.Context) error { + _, err := uu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uu *UserUpdate) ExecX(ctx context.Context) { + if err := uu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uu *UserUpdate) defaults() error { + if _, ok := uu.mutation.UpdatedAt(); !ok && !uu.mutation.UpdatedAtCleared() { + if user.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized user.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := user.UpdateDefaultUpdatedAt() + uu.mutation.SetUpdatedAt(v) + } + if _, ok := uu.mutation.AvatarUpdatedAt(); !ok && !uu.mutation.AvatarUpdatedAtCleared() { + if user.UpdateDefaultAvatarUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized user.UpdateDefaultAvatarUpdatedAt (forgotten import generated/runtime?)") + } + v := user.UpdateDefaultAvatarUpdatedAt() + uu.mutation.SetAvatarUpdatedAt(v) + } + if _, ok := uu.mutation.LastSeen(); !ok && !uu.mutation.LastSeenCleared() { + if user.UpdateDefaultLastSeen == nil { + return fmt.Errorf("generated: uninitialized user.UpdateDefaultLastSeen (forgotten import generated/runtime?)") + } + v := user.UpdateDefaultLastSeen() + uu.mutation.SetLastSeen(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (uu *UserUpdate) check() error { + if v, ok := uu.mutation.Email(); ok { + if err := user.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "User.email": %w`, err)} + } + } + if v, ok := uu.mutation.FirstName(); ok { + if err := user.FirstNameValidator(v); err != nil { + return &ValidationError{Name: "first_name", err: fmt.Errorf(`generated: validator failed for field "User.first_name": %w`, err)} + } + } + if v, ok := uu.mutation.LastName(); ok { + if err := user.LastNameValidator(v); err != nil { + return &ValidationError{Name: "last_name", err: fmt.Errorf(`generated: validator failed for field "User.last_name": %w`, err)} + } + } + if v, ok := uu.mutation.DisplayName(); ok { + if err := user.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "User.display_name": %w`, err)} + } + } + if v, ok := uu.mutation.AvatarRemoteURL(); ok { + if err := user.AvatarRemoteURLValidator(v); err != nil { + return &ValidationError{Name: "avatar_remote_url", err: fmt.Errorf(`generated: validator failed for field "User.avatar_remote_url": %w`, err)} + } + } + if v, ok := uu.mutation.AvatarLocalFile(); ok { + if err := user.AvatarLocalFileValidator(v); err != nil { + return &ValidationError{Name: "avatar_local_file", err: fmt.Errorf(`generated: validator failed for field "User.avatar_local_file": %w`, err)} + } + } + if v, ok := uu.mutation.AuthProvider(); ok { + if err := user.AuthProviderValidator(v); err != nil { + return &ValidationError{Name: "auth_provider", err: fmt.Errorf(`generated: validator failed for field "User.auth_provider": %w`, err)} + } + } + if v, ok := uu.mutation.Role(); ok { + if err := user.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "User.role": %w`, err)} + } + } + if uu.mutation.SettingCleared() && len(uu.mutation.SettingIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "User.setting"`) + } + return nil +} + +func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := uu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeString)) + if ps := uu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if uu.mutation.CreatedAtCleared() { + _spec.ClearField(user.FieldCreatedAt, field.TypeTime) + } + if value, ok := uu.mutation.UpdatedAt(); ok { + _spec.SetField(user.FieldUpdatedAt, field.TypeTime, value) + } + if uu.mutation.UpdatedAtCleared() { + _spec.ClearField(user.FieldUpdatedAt, field.TypeTime) + } + if uu.mutation.CreatedByCleared() { + _spec.ClearField(user.FieldCreatedBy, field.TypeString) + } + if value, ok := uu.mutation.UpdatedBy(); ok { + _spec.SetField(user.FieldUpdatedBy, field.TypeString, value) + } + if uu.mutation.UpdatedByCleared() { + _spec.ClearField(user.FieldUpdatedBy, field.TypeString) + } + if value, ok := uu.mutation.DeletedAt(); ok { + _spec.SetField(user.FieldDeletedAt, field.TypeTime, value) + } + if uu.mutation.DeletedAtCleared() { + _spec.ClearField(user.FieldDeletedAt, field.TypeTime) + } + if value, ok := uu.mutation.DeletedBy(); ok { + _spec.SetField(user.FieldDeletedBy, field.TypeString, value) + } + if uu.mutation.DeletedByCleared() { + _spec.ClearField(user.FieldDeletedBy, field.TypeString) + } + if value, ok := uu.mutation.Tags(); ok { + _spec.SetField(user.FieldTags, field.TypeJSON, value) + } + if value, ok := uu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, user.FieldTags, value) + }) + } + if uu.mutation.TagsCleared() { + _spec.ClearField(user.FieldTags, field.TypeJSON) + } + if value, ok := uu.mutation.Email(); ok { + _spec.SetField(user.FieldEmail, field.TypeString, value) + } + if value, ok := uu.mutation.FirstName(); ok { + _spec.SetField(user.FieldFirstName, field.TypeString, value) + } + if uu.mutation.FirstNameCleared() { + _spec.ClearField(user.FieldFirstName, field.TypeString) + } + if value, ok := uu.mutation.LastName(); ok { + _spec.SetField(user.FieldLastName, field.TypeString, value) + } + if uu.mutation.LastNameCleared() { + _spec.ClearField(user.FieldLastName, field.TypeString) + } + if value, ok := uu.mutation.DisplayName(); ok { + _spec.SetField(user.FieldDisplayName, field.TypeString, value) + } + if value, ok := uu.mutation.AvatarRemoteURL(); ok { + _spec.SetField(user.FieldAvatarRemoteURL, field.TypeString, value) + } + if uu.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(user.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := uu.mutation.AvatarLocalFile(); ok { + _spec.SetField(user.FieldAvatarLocalFile, field.TypeString, value) + } + if uu.mutation.AvatarLocalFileCleared() { + _spec.ClearField(user.FieldAvatarLocalFile, field.TypeString) + } + if value, ok := uu.mutation.AvatarUpdatedAt(); ok { + _spec.SetField(user.FieldAvatarUpdatedAt, field.TypeTime, value) + } + if uu.mutation.AvatarUpdatedAtCleared() { + _spec.ClearField(user.FieldAvatarUpdatedAt, field.TypeTime) + } + if value, ok := uu.mutation.LastSeen(); ok { + _spec.SetField(user.FieldLastSeen, field.TypeTime, value) + } + if uu.mutation.LastSeenCleared() { + _spec.ClearField(user.FieldLastSeen, field.TypeTime) + } + if value, ok := uu.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + } + if uu.mutation.PasswordCleared() { + _spec.ClearField(user.FieldPassword, field.TypeString) + } + if value, ok := uu.mutation.Sub(); ok { + _spec.SetField(user.FieldSub, field.TypeString, value) + } + if uu.mutation.SubCleared() { + _spec.ClearField(user.FieldSub, field.TypeString) + } + if value, ok := uu.mutation.AuthProvider(); ok { + _spec.SetField(user.FieldAuthProvider, field.TypeEnum, value) + } + if value, ok := uu.mutation.Role(); ok { + _spec.SetField(user.FieldRole, field.TypeEnum, value) + } + if uu.mutation.RoleCleared() { + _spec.ClearField(user.FieldRole, field.TypeEnum) + } + if uu.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.PersonalAccessToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedPersonalAccessTokensIDs(); len(nodes) > 0 && !uu.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.PersonalAccessTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.TfaSettingsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.TFASetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedTfaSettingsIDs(); len(nodes) > 0 && !uu.mutation.TfaSettingsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.TfaSettingsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.SettingCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: user.SettingTable, + Columns: []string{user.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.UserSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: user.SettingTable, + Columns: []string{user.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.EmailVerificationTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.EmailVerificationToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedEmailVerificationTokensIDs(); len(nodes) > 0 && !uu.mutation.EmailVerificationTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.EmailVerificationTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.PasswordResetTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.PasswordResetToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedPasswordResetTokensIDs(); len(nodes) > 0 && !uu.mutation.PasswordResetTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.PasswordResetTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.GroupMembership + createE := &GroupMembershipCreate{config: uu.config, mutation: newGroupMembershipMutation(uu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedGroupsIDs(); len(nodes) > 0 && !uu.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: uu.config, mutation: newGroupMembershipMutation(uu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.GroupsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: uu.config, mutation: newGroupMembershipMutation(uu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.OrgMembership + createE := &OrgMembershipCreate{config: uu.config, mutation: newOrgMembershipMutation(uu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedOrganizationsIDs(); len(nodes) > 0 && !uu.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: uu.config, mutation: newOrgMembershipMutation(uu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.OrganizationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: uu.config, mutation: newOrgMembershipMutation(uu.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.WebauthnCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.Webauthn + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedWebauthnIDs(); len(nodes) > 0 && !uu.mutation.WebauthnCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.WebauthnIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.File + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedFilesIDs(); len(nodes) > 0 && !uu.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.UserEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !uu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.GroupMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.GroupMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedGroupMembershipsIDs(); len(nodes) > 0 && !uu.mutation.GroupMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.GroupMembershipsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uu.mutation.OrgMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.OrgMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.RemovedOrgMembershipsIDs(); len(nodes) > 0 && !uu.mutation.OrgMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uu.mutation.OrgMembershipsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uu.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = uu.schemaConfig.User + ctx = internal.NewSchemaConfigContext(ctx, uu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, uu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{user.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + uu.mutation.done = true + return n, nil +} + +// UserUpdateOne is the builder for updating a single User entity. +type UserUpdateOne struct { + config + fields []string + hooks []Hook + mutation *UserMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne { + uuo.mutation.SetUpdatedAt(t) + return uuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (uuo *UserUpdateOne) ClearUpdatedAt() *UserUpdateOne { + uuo.mutation.ClearUpdatedAt() + return uuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (uuo *UserUpdateOne) SetUpdatedBy(s string) *UserUpdateOne { + uuo.mutation.SetUpdatedBy(s) + return uuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableUpdatedBy(s *string) *UserUpdateOne { + if s != nil { + uuo.SetUpdatedBy(*s) + } + return uuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (uuo *UserUpdateOne) ClearUpdatedBy() *UserUpdateOne { + uuo.mutation.ClearUpdatedBy() + return uuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (uuo *UserUpdateOne) SetDeletedAt(t time.Time) *UserUpdateOne { + uuo.mutation.SetDeletedAt(t) + return uuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableDeletedAt(t *time.Time) *UserUpdateOne { + if t != nil { + uuo.SetDeletedAt(*t) + } + return uuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (uuo *UserUpdateOne) ClearDeletedAt() *UserUpdateOne { + uuo.mutation.ClearDeletedAt() + return uuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (uuo *UserUpdateOne) SetDeletedBy(s string) *UserUpdateOne { + uuo.mutation.SetDeletedBy(s) + return uuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableDeletedBy(s *string) *UserUpdateOne { + if s != nil { + uuo.SetDeletedBy(*s) + } + return uuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (uuo *UserUpdateOne) ClearDeletedBy() *UserUpdateOne { + uuo.mutation.ClearDeletedBy() + return uuo +} + +// SetTags sets the "tags" field. +func (uuo *UserUpdateOne) SetTags(s []string) *UserUpdateOne { + uuo.mutation.SetTags(s) + return uuo +} + +// AppendTags appends s to the "tags" field. +func (uuo *UserUpdateOne) AppendTags(s []string) *UserUpdateOne { + uuo.mutation.AppendTags(s) + return uuo +} + +// ClearTags clears the value of the "tags" field. +func (uuo *UserUpdateOne) ClearTags() *UserUpdateOne { + uuo.mutation.ClearTags() + return uuo +} + +// SetEmail sets the "email" field. +func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne { + uuo.mutation.SetEmail(s) + return uuo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne { + if s != nil { + uuo.SetEmail(*s) + } + return uuo +} + +// SetFirstName sets the "first_name" field. +func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne { + uuo.mutation.SetFirstName(s) + return uuo +} + +// SetNillableFirstName sets the "first_name" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne { + if s != nil { + uuo.SetFirstName(*s) + } + return uuo +} + +// ClearFirstName clears the value of the "first_name" field. +func (uuo *UserUpdateOne) ClearFirstName() *UserUpdateOne { + uuo.mutation.ClearFirstName() + return uuo +} + +// SetLastName sets the "last_name" field. +func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne { + uuo.mutation.SetLastName(s) + return uuo +} + +// SetNillableLastName sets the "last_name" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne { + if s != nil { + uuo.SetLastName(*s) + } + return uuo +} + +// ClearLastName clears the value of the "last_name" field. +func (uuo *UserUpdateOne) ClearLastName() *UserUpdateOne { + uuo.mutation.ClearLastName() + return uuo +} + +// SetDisplayName sets the "display_name" field. +func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne { + uuo.mutation.SetDisplayName(s) + return uuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableDisplayName(s *string) *UserUpdateOne { + if s != nil { + uuo.SetDisplayName(*s) + } + return uuo +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (uuo *UserUpdateOne) SetAvatarRemoteURL(s string) *UserUpdateOne { + uuo.mutation.SetAvatarRemoteURL(s) + return uuo +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAvatarRemoteURL(s *string) *UserUpdateOne { + if s != nil { + uuo.SetAvatarRemoteURL(*s) + } + return uuo +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (uuo *UserUpdateOne) ClearAvatarRemoteURL() *UserUpdateOne { + uuo.mutation.ClearAvatarRemoteURL() + return uuo +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (uuo *UserUpdateOne) SetAvatarLocalFile(s string) *UserUpdateOne { + uuo.mutation.SetAvatarLocalFile(s) + return uuo +} + +// SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAvatarLocalFile(s *string) *UserUpdateOne { + if s != nil { + uuo.SetAvatarLocalFile(*s) + } + return uuo +} + +// ClearAvatarLocalFile clears the value of the "avatar_local_file" field. +func (uuo *UserUpdateOne) ClearAvatarLocalFile() *UserUpdateOne { + uuo.mutation.ClearAvatarLocalFile() + return uuo +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (uuo *UserUpdateOne) SetAvatarUpdatedAt(t time.Time) *UserUpdateOne { + uuo.mutation.SetAvatarUpdatedAt(t) + return uuo +} + +// ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field. +func (uuo *UserUpdateOne) ClearAvatarUpdatedAt() *UserUpdateOne { + uuo.mutation.ClearAvatarUpdatedAt() + return uuo +} + +// SetLastSeen sets the "last_seen" field. +func (uuo *UserUpdateOne) SetLastSeen(t time.Time) *UserUpdateOne { + uuo.mutation.SetLastSeen(t) + return uuo +} + +// ClearLastSeen clears the value of the "last_seen" field. +func (uuo *UserUpdateOne) ClearLastSeen() *UserUpdateOne { + uuo.mutation.ClearLastSeen() + return uuo +} + +// SetPassword sets the "password" field. +func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne { + uuo.mutation.SetPassword(s) + return uuo +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne { + if s != nil { + uuo.SetPassword(*s) + } + return uuo +} + +// ClearPassword clears the value of the "password" field. +func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne { + uuo.mutation.ClearPassword() + return uuo +} + +// SetSub sets the "sub" field. +func (uuo *UserUpdateOne) SetSub(s string) *UserUpdateOne { + uuo.mutation.SetSub(s) + return uuo +} + +// SetNillableSub sets the "sub" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableSub(s *string) *UserUpdateOne { + if s != nil { + uuo.SetSub(*s) + } + return uuo +} + +// ClearSub clears the value of the "sub" field. +func (uuo *UserUpdateOne) ClearSub() *UserUpdateOne { + uuo.mutation.ClearSub() + return uuo +} + +// SetAuthProvider sets the "auth_provider" field. +func (uuo *UserUpdateOne) SetAuthProvider(ep enums.AuthProvider) *UserUpdateOne { + uuo.mutation.SetAuthProvider(ep) + return uuo +} + +// SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableAuthProvider(ep *enums.AuthProvider) *UserUpdateOne { + if ep != nil { + uuo.SetAuthProvider(*ep) + } + return uuo +} + +// SetRole sets the "role" field. +func (uuo *UserUpdateOne) SetRole(e enums.Role) *UserUpdateOne { + uuo.mutation.SetRole(e) + return uuo +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (uuo *UserUpdateOne) SetNillableRole(e *enums.Role) *UserUpdateOne { + if e != nil { + uuo.SetRole(*e) + } + return uuo +} + +// ClearRole clears the value of the "role" field. +func (uuo *UserUpdateOne) ClearRole() *UserUpdateOne { + uuo.mutation.ClearRole() + return uuo +} + +// AddPersonalAccessTokenIDs adds the "personal_access_tokens" edge to the PersonalAccessToken entity by IDs. +func (uuo *UserUpdateOne) AddPersonalAccessTokenIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddPersonalAccessTokenIDs(ids...) + return uuo +} + +// AddPersonalAccessTokens adds the "personal_access_tokens" edges to the PersonalAccessToken entity. +func (uuo *UserUpdateOne) AddPersonalAccessTokens(p ...*PersonalAccessToken) *UserUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uuo.AddPersonalAccessTokenIDs(ids...) +} + +// AddTfaSettingIDs adds the "tfa_settings" edge to the TFASetting entity by IDs. +func (uuo *UserUpdateOne) AddTfaSettingIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddTfaSettingIDs(ids...) + return uuo +} + +// AddTfaSettings adds the "tfa_settings" edges to the TFASetting entity. +func (uuo *UserUpdateOne) AddTfaSettings(t ...*TFASetting) *UserUpdateOne { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return uuo.AddTfaSettingIDs(ids...) +} + +// SetSettingID sets the "setting" edge to the UserSetting entity by ID. +func (uuo *UserUpdateOne) SetSettingID(id string) *UserUpdateOne { + uuo.mutation.SetSettingID(id) + return uuo +} + +// SetSetting sets the "setting" edge to the UserSetting entity. +func (uuo *UserUpdateOne) SetSetting(u *UserSetting) *UserUpdateOne { + return uuo.SetSettingID(u.ID) +} + +// AddEmailVerificationTokenIDs adds the "email_verification_tokens" edge to the EmailVerificationToken entity by IDs. +func (uuo *UserUpdateOne) AddEmailVerificationTokenIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddEmailVerificationTokenIDs(ids...) + return uuo +} + +// AddEmailVerificationTokens adds the "email_verification_tokens" edges to the EmailVerificationToken entity. +func (uuo *UserUpdateOne) AddEmailVerificationTokens(e ...*EmailVerificationToken) *UserUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uuo.AddEmailVerificationTokenIDs(ids...) +} + +// AddPasswordResetTokenIDs adds the "password_reset_tokens" edge to the PasswordResetToken entity by IDs. +func (uuo *UserUpdateOne) AddPasswordResetTokenIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddPasswordResetTokenIDs(ids...) + return uuo +} + +// AddPasswordResetTokens adds the "password_reset_tokens" edges to the PasswordResetToken entity. +func (uuo *UserUpdateOne) AddPasswordResetTokens(p ...*PasswordResetToken) *UserUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uuo.AddPasswordResetTokenIDs(ids...) +} + +// AddGroupIDs adds the "groups" edge to the Group entity by IDs. +func (uuo *UserUpdateOne) AddGroupIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddGroupIDs(ids...) + return uuo +} + +// AddGroups adds the "groups" edges to the Group entity. +func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uuo.AddGroupIDs(ids...) +} + +// AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs. +func (uuo *UserUpdateOne) AddOrganizationIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddOrganizationIDs(ids...) + return uuo +} + +// AddOrganizations adds the "organizations" edges to the Organization entity. +func (uuo *UserUpdateOne) AddOrganizations(o ...*Organization) *UserUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uuo.AddOrganizationIDs(ids...) +} + +// AddWebauthnIDs adds the "webauthn" edge to the Webauthn entity by IDs. +func (uuo *UserUpdateOne) AddWebauthnIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddWebauthnIDs(ids...) + return uuo +} + +// AddWebauthn adds the "webauthn" edges to the Webauthn entity. +func (uuo *UserUpdateOne) AddWebauthn(w ...*Webauthn) *UserUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return uuo.AddWebauthnIDs(ids...) +} + +// AddFileIDs adds the "files" edge to the File entity by IDs. +func (uuo *UserUpdateOne) AddFileIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddFileIDs(ids...) + return uuo +} + +// AddFiles adds the "files" edges to the File entity. +func (uuo *UserUpdateOne) AddFiles(f ...*File) *UserUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return uuo.AddFileIDs(ids...) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (uuo *UserUpdateOne) AddEventIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddEventIDs(ids...) + return uuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (uuo *UserUpdateOne) AddEvents(e ...*Event) *UserUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uuo.AddEventIDs(ids...) +} + +// AddGroupMembershipIDs adds the "group_memberships" edge to the GroupMembership entity by IDs. +func (uuo *UserUpdateOne) AddGroupMembershipIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddGroupMembershipIDs(ids...) + return uuo +} + +// AddGroupMemberships adds the "group_memberships" edges to the GroupMembership entity. +func (uuo *UserUpdateOne) AddGroupMemberships(g ...*GroupMembership) *UserUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uuo.AddGroupMembershipIDs(ids...) +} + +// AddOrgMembershipIDs adds the "org_memberships" edge to the OrgMembership entity by IDs. +func (uuo *UserUpdateOne) AddOrgMembershipIDs(ids ...string) *UserUpdateOne { + uuo.mutation.AddOrgMembershipIDs(ids...) + return uuo +} + +// AddOrgMemberships adds the "org_memberships" edges to the OrgMembership entity. +func (uuo *UserUpdateOne) AddOrgMemberships(o ...*OrgMembership) *UserUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uuo.AddOrgMembershipIDs(ids...) +} + +// Mutation returns the UserMutation object of the builder. +func (uuo *UserUpdateOne) Mutation() *UserMutation { + return uuo.mutation +} + +// ClearPersonalAccessTokens clears all "personal_access_tokens" edges to the PersonalAccessToken entity. +func (uuo *UserUpdateOne) ClearPersonalAccessTokens() *UserUpdateOne { + uuo.mutation.ClearPersonalAccessTokens() + return uuo +} + +// RemovePersonalAccessTokenIDs removes the "personal_access_tokens" edge to PersonalAccessToken entities by IDs. +func (uuo *UserUpdateOne) RemovePersonalAccessTokenIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemovePersonalAccessTokenIDs(ids...) + return uuo +} + +// RemovePersonalAccessTokens removes "personal_access_tokens" edges to PersonalAccessToken entities. +func (uuo *UserUpdateOne) RemovePersonalAccessTokens(p ...*PersonalAccessToken) *UserUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uuo.RemovePersonalAccessTokenIDs(ids...) +} + +// ClearTfaSettings clears all "tfa_settings" edges to the TFASetting entity. +func (uuo *UserUpdateOne) ClearTfaSettings() *UserUpdateOne { + uuo.mutation.ClearTfaSettings() + return uuo +} + +// RemoveTfaSettingIDs removes the "tfa_settings" edge to TFASetting entities by IDs. +func (uuo *UserUpdateOne) RemoveTfaSettingIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveTfaSettingIDs(ids...) + return uuo +} + +// RemoveTfaSettings removes "tfa_settings" edges to TFASetting entities. +func (uuo *UserUpdateOne) RemoveTfaSettings(t ...*TFASetting) *UserUpdateOne { + ids := make([]string, len(t)) + for i := range t { + ids[i] = t[i].ID + } + return uuo.RemoveTfaSettingIDs(ids...) +} + +// ClearSetting clears the "setting" edge to the UserSetting entity. +func (uuo *UserUpdateOne) ClearSetting() *UserUpdateOne { + uuo.mutation.ClearSetting() + return uuo +} + +// ClearEmailVerificationTokens clears all "email_verification_tokens" edges to the EmailVerificationToken entity. +func (uuo *UserUpdateOne) ClearEmailVerificationTokens() *UserUpdateOne { + uuo.mutation.ClearEmailVerificationTokens() + return uuo +} + +// RemoveEmailVerificationTokenIDs removes the "email_verification_tokens" edge to EmailVerificationToken entities by IDs. +func (uuo *UserUpdateOne) RemoveEmailVerificationTokenIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveEmailVerificationTokenIDs(ids...) + return uuo +} + +// RemoveEmailVerificationTokens removes "email_verification_tokens" edges to EmailVerificationToken entities. +func (uuo *UserUpdateOne) RemoveEmailVerificationTokens(e ...*EmailVerificationToken) *UserUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uuo.RemoveEmailVerificationTokenIDs(ids...) +} + +// ClearPasswordResetTokens clears all "password_reset_tokens" edges to the PasswordResetToken entity. +func (uuo *UserUpdateOne) ClearPasswordResetTokens() *UserUpdateOne { + uuo.mutation.ClearPasswordResetTokens() + return uuo +} + +// RemovePasswordResetTokenIDs removes the "password_reset_tokens" edge to PasswordResetToken entities by IDs. +func (uuo *UserUpdateOne) RemovePasswordResetTokenIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemovePasswordResetTokenIDs(ids...) + return uuo +} + +// RemovePasswordResetTokens removes "password_reset_tokens" edges to PasswordResetToken entities. +func (uuo *UserUpdateOne) RemovePasswordResetTokens(p ...*PasswordResetToken) *UserUpdateOne { + ids := make([]string, len(p)) + for i := range p { + ids[i] = p[i].ID + } + return uuo.RemovePasswordResetTokenIDs(ids...) +} + +// ClearGroups clears all "groups" edges to the Group entity. +func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne { + uuo.mutation.ClearGroups() + return uuo +} + +// RemoveGroupIDs removes the "groups" edge to Group entities by IDs. +func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveGroupIDs(ids...) + return uuo +} + +// RemoveGroups removes "groups" edges to Group entities. +func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uuo.RemoveGroupIDs(ids...) +} + +// ClearOrganizations clears all "organizations" edges to the Organization entity. +func (uuo *UserUpdateOne) ClearOrganizations() *UserUpdateOne { + uuo.mutation.ClearOrganizations() + return uuo +} + +// RemoveOrganizationIDs removes the "organizations" edge to Organization entities by IDs. +func (uuo *UserUpdateOne) RemoveOrganizationIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveOrganizationIDs(ids...) + return uuo +} + +// RemoveOrganizations removes "organizations" edges to Organization entities. +func (uuo *UserUpdateOne) RemoveOrganizations(o ...*Organization) *UserUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uuo.RemoveOrganizationIDs(ids...) +} + +// ClearWebauthn clears all "webauthn" edges to the Webauthn entity. +func (uuo *UserUpdateOne) ClearWebauthn() *UserUpdateOne { + uuo.mutation.ClearWebauthn() + return uuo +} + +// RemoveWebauthnIDs removes the "webauthn" edge to Webauthn entities by IDs. +func (uuo *UserUpdateOne) RemoveWebauthnIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveWebauthnIDs(ids...) + return uuo +} + +// RemoveWebauthn removes "webauthn" edges to Webauthn entities. +func (uuo *UserUpdateOne) RemoveWebauthn(w ...*Webauthn) *UserUpdateOne { + ids := make([]string, len(w)) + for i := range w { + ids[i] = w[i].ID + } + return uuo.RemoveWebauthnIDs(ids...) +} + +// ClearFiles clears all "files" edges to the File entity. +func (uuo *UserUpdateOne) ClearFiles() *UserUpdateOne { + uuo.mutation.ClearFiles() + return uuo +} + +// RemoveFileIDs removes the "files" edge to File entities by IDs. +func (uuo *UserUpdateOne) RemoveFileIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveFileIDs(ids...) + return uuo +} + +// RemoveFiles removes "files" edges to File entities. +func (uuo *UserUpdateOne) RemoveFiles(f ...*File) *UserUpdateOne { + ids := make([]string, len(f)) + for i := range f { + ids[i] = f[i].ID + } + return uuo.RemoveFileIDs(ids...) +} + +// ClearEvents clears all "events" edges to the Event entity. +func (uuo *UserUpdateOne) ClearEvents() *UserUpdateOne { + uuo.mutation.ClearEvents() + return uuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (uuo *UserUpdateOne) RemoveEventIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveEventIDs(ids...) + return uuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (uuo *UserUpdateOne) RemoveEvents(e ...*Event) *UserUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return uuo.RemoveEventIDs(ids...) +} + +// ClearGroupMemberships clears all "group_memberships" edges to the GroupMembership entity. +func (uuo *UserUpdateOne) ClearGroupMemberships() *UserUpdateOne { + uuo.mutation.ClearGroupMemberships() + return uuo +} + +// RemoveGroupMembershipIDs removes the "group_memberships" edge to GroupMembership entities by IDs. +func (uuo *UserUpdateOne) RemoveGroupMembershipIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveGroupMembershipIDs(ids...) + return uuo +} + +// RemoveGroupMemberships removes "group_memberships" edges to GroupMembership entities. +func (uuo *UserUpdateOne) RemoveGroupMemberships(g ...*GroupMembership) *UserUpdateOne { + ids := make([]string, len(g)) + for i := range g { + ids[i] = g[i].ID + } + return uuo.RemoveGroupMembershipIDs(ids...) +} + +// ClearOrgMemberships clears all "org_memberships" edges to the OrgMembership entity. +func (uuo *UserUpdateOne) ClearOrgMemberships() *UserUpdateOne { + uuo.mutation.ClearOrgMemberships() + return uuo +} + +// RemoveOrgMembershipIDs removes the "org_memberships" edge to OrgMembership entities by IDs. +func (uuo *UserUpdateOne) RemoveOrgMembershipIDs(ids ...string) *UserUpdateOne { + uuo.mutation.RemoveOrgMembershipIDs(ids...) + return uuo +} + +// RemoveOrgMemberships removes "org_memberships" edges to OrgMembership entities. +func (uuo *UserUpdateOne) RemoveOrgMemberships(o ...*OrgMembership) *UserUpdateOne { + ids := make([]string, len(o)) + for i := range o { + ids[i] = o[i].ID + } + return uuo.RemoveOrgMembershipIDs(ids...) +} + +// Where appends a list predicates to the UserUpdate builder. +func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne { + uuo.mutation.Where(ps...) + return uuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne { + uuo.fields = append([]string{field}, fields...) + return uuo +} + +// Save executes the query and returns the updated User entity. +func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error) { + if err := uuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, uuo.sqlSave, uuo.mutation, uuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User { + node, err := uuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (uuo *UserUpdateOne) Exec(ctx context.Context) error { + _, err := uuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uuo *UserUpdateOne) ExecX(ctx context.Context) { + if err := uuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uuo *UserUpdateOne) defaults() error { + if _, ok := uuo.mutation.UpdatedAt(); !ok && !uuo.mutation.UpdatedAtCleared() { + if user.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized user.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := user.UpdateDefaultUpdatedAt() + uuo.mutation.SetUpdatedAt(v) + } + if _, ok := uuo.mutation.AvatarUpdatedAt(); !ok && !uuo.mutation.AvatarUpdatedAtCleared() { + if user.UpdateDefaultAvatarUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized user.UpdateDefaultAvatarUpdatedAt (forgotten import generated/runtime?)") + } + v := user.UpdateDefaultAvatarUpdatedAt() + uuo.mutation.SetAvatarUpdatedAt(v) + } + if _, ok := uuo.mutation.LastSeen(); !ok && !uuo.mutation.LastSeenCleared() { + if user.UpdateDefaultLastSeen == nil { + return fmt.Errorf("generated: uninitialized user.UpdateDefaultLastSeen (forgotten import generated/runtime?)") + } + v := user.UpdateDefaultLastSeen() + uuo.mutation.SetLastSeen(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (uuo *UserUpdateOne) check() error { + if v, ok := uuo.mutation.Email(); ok { + if err := user.EmailValidator(v); err != nil { + return &ValidationError{Name: "email", err: fmt.Errorf(`generated: validator failed for field "User.email": %w`, err)} + } + } + if v, ok := uuo.mutation.FirstName(); ok { + if err := user.FirstNameValidator(v); err != nil { + return &ValidationError{Name: "first_name", err: fmt.Errorf(`generated: validator failed for field "User.first_name": %w`, err)} + } + } + if v, ok := uuo.mutation.LastName(); ok { + if err := user.LastNameValidator(v); err != nil { + return &ValidationError{Name: "last_name", err: fmt.Errorf(`generated: validator failed for field "User.last_name": %w`, err)} + } + } + if v, ok := uuo.mutation.DisplayName(); ok { + if err := user.DisplayNameValidator(v); err != nil { + return &ValidationError{Name: "display_name", err: fmt.Errorf(`generated: validator failed for field "User.display_name": %w`, err)} + } + } + if v, ok := uuo.mutation.AvatarRemoteURL(); ok { + if err := user.AvatarRemoteURLValidator(v); err != nil { + return &ValidationError{Name: "avatar_remote_url", err: fmt.Errorf(`generated: validator failed for field "User.avatar_remote_url": %w`, err)} + } + } + if v, ok := uuo.mutation.AvatarLocalFile(); ok { + if err := user.AvatarLocalFileValidator(v); err != nil { + return &ValidationError{Name: "avatar_local_file", err: fmt.Errorf(`generated: validator failed for field "User.avatar_local_file": %w`, err)} + } + } + if v, ok := uuo.mutation.AuthProvider(); ok { + if err := user.AuthProviderValidator(v); err != nil { + return &ValidationError{Name: "auth_provider", err: fmt.Errorf(`generated: validator failed for field "User.auth_provider": %w`, err)} + } + } + if v, ok := uuo.mutation.Role(); ok { + if err := user.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "User.role": %w`, err)} + } + } + if uuo.mutation.SettingCleared() && len(uuo.mutation.SettingIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "User.setting"`) + } + return nil +} + +func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error) { + if err := uuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeString)) + id, ok := uuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "User.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := uuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, user.FieldID) + for _, f := range fields { + if !user.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != user.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := uuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if uuo.mutation.CreatedAtCleared() { + _spec.ClearField(user.FieldCreatedAt, field.TypeTime) + } + if value, ok := uuo.mutation.UpdatedAt(); ok { + _spec.SetField(user.FieldUpdatedAt, field.TypeTime, value) + } + if uuo.mutation.UpdatedAtCleared() { + _spec.ClearField(user.FieldUpdatedAt, field.TypeTime) + } + if uuo.mutation.CreatedByCleared() { + _spec.ClearField(user.FieldCreatedBy, field.TypeString) + } + if value, ok := uuo.mutation.UpdatedBy(); ok { + _spec.SetField(user.FieldUpdatedBy, field.TypeString, value) + } + if uuo.mutation.UpdatedByCleared() { + _spec.ClearField(user.FieldUpdatedBy, field.TypeString) + } + if value, ok := uuo.mutation.DeletedAt(); ok { + _spec.SetField(user.FieldDeletedAt, field.TypeTime, value) + } + if uuo.mutation.DeletedAtCleared() { + _spec.ClearField(user.FieldDeletedAt, field.TypeTime) + } + if value, ok := uuo.mutation.DeletedBy(); ok { + _spec.SetField(user.FieldDeletedBy, field.TypeString, value) + } + if uuo.mutation.DeletedByCleared() { + _spec.ClearField(user.FieldDeletedBy, field.TypeString) + } + if value, ok := uuo.mutation.Tags(); ok { + _spec.SetField(user.FieldTags, field.TypeJSON, value) + } + if value, ok := uuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, user.FieldTags, value) + }) + } + if uuo.mutation.TagsCleared() { + _spec.ClearField(user.FieldTags, field.TypeJSON) + } + if value, ok := uuo.mutation.Email(); ok { + _spec.SetField(user.FieldEmail, field.TypeString, value) + } + if value, ok := uuo.mutation.FirstName(); ok { + _spec.SetField(user.FieldFirstName, field.TypeString, value) + } + if uuo.mutation.FirstNameCleared() { + _spec.ClearField(user.FieldFirstName, field.TypeString) + } + if value, ok := uuo.mutation.LastName(); ok { + _spec.SetField(user.FieldLastName, field.TypeString, value) + } + if uuo.mutation.LastNameCleared() { + _spec.ClearField(user.FieldLastName, field.TypeString) + } + if value, ok := uuo.mutation.DisplayName(); ok { + _spec.SetField(user.FieldDisplayName, field.TypeString, value) + } + if value, ok := uuo.mutation.AvatarRemoteURL(); ok { + _spec.SetField(user.FieldAvatarRemoteURL, field.TypeString, value) + } + if uuo.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(user.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := uuo.mutation.AvatarLocalFile(); ok { + _spec.SetField(user.FieldAvatarLocalFile, field.TypeString, value) + } + if uuo.mutation.AvatarLocalFileCleared() { + _spec.ClearField(user.FieldAvatarLocalFile, field.TypeString) + } + if value, ok := uuo.mutation.AvatarUpdatedAt(); ok { + _spec.SetField(user.FieldAvatarUpdatedAt, field.TypeTime, value) + } + if uuo.mutation.AvatarUpdatedAtCleared() { + _spec.ClearField(user.FieldAvatarUpdatedAt, field.TypeTime) + } + if value, ok := uuo.mutation.LastSeen(); ok { + _spec.SetField(user.FieldLastSeen, field.TypeTime, value) + } + if uuo.mutation.LastSeenCleared() { + _spec.ClearField(user.FieldLastSeen, field.TypeTime) + } + if value, ok := uuo.mutation.Password(); ok { + _spec.SetField(user.FieldPassword, field.TypeString, value) + } + if uuo.mutation.PasswordCleared() { + _spec.ClearField(user.FieldPassword, field.TypeString) + } + if value, ok := uuo.mutation.Sub(); ok { + _spec.SetField(user.FieldSub, field.TypeString, value) + } + if uuo.mutation.SubCleared() { + _spec.ClearField(user.FieldSub, field.TypeString) + } + if value, ok := uuo.mutation.AuthProvider(); ok { + _spec.SetField(user.FieldAuthProvider, field.TypeEnum, value) + } + if value, ok := uuo.mutation.Role(); ok { + _spec.SetField(user.FieldRole, field.TypeEnum, value) + } + if uuo.mutation.RoleCleared() { + _spec.ClearField(user.FieldRole, field.TypeEnum) + } + if uuo.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.PersonalAccessToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedPersonalAccessTokensIDs(); len(nodes) > 0 && !uuo.mutation.PersonalAccessTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.PersonalAccessTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PersonalAccessTokensTable, + Columns: []string{user.PersonalAccessTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(personalaccesstoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.PersonalAccessToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.TfaSettingsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.TFASetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedTfaSettingsIDs(); len(nodes) > 0 && !uuo.mutation.TfaSettingsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.TfaSettingsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.TfaSettingsTable, + Columns: []string{user.TfaSettingsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(tfasetting.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.TFASetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.SettingCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: user.SettingTable, + Columns: []string{user.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.UserSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.SettingIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: false, + Table: user.SettingTable, + Columns: []string{user.SettingColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.EmailVerificationTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.EmailVerificationToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedEmailVerificationTokensIDs(); len(nodes) > 0 && !uuo.mutation.EmailVerificationTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.EmailVerificationTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.EmailVerificationTokensTable, + Columns: []string{user.EmailVerificationTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(emailverificationtoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.EmailVerificationToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.PasswordResetTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.PasswordResetToken + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedPasswordResetTokensIDs(); len(nodes) > 0 && !uuo.mutation.PasswordResetTokensCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.PasswordResetTokensIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.PasswordResetTokensTable, + Columns: []string{user.PasswordResetTokensColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(passwordresettoken.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.PasswordResetToken + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.GroupMembership + createE := &GroupMembershipCreate{config: uuo.config, mutation: newGroupMembershipMutation(uuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedGroupsIDs(); len(nodes) > 0 && !uuo.mutation.GroupsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: uuo.config, mutation: newGroupMembershipMutation(uuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.GroupsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.GroupsTable, + Columns: user.GroupsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(group.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &GroupMembershipCreate{config: uuo.config, mutation: newGroupMembershipMutation(uuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.OrgMembership + createE := &OrgMembershipCreate{config: uuo.config, mutation: newOrgMembershipMutation(uuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedOrganizationsIDs(); len(nodes) > 0 && !uuo.mutation.OrganizationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: uuo.config, mutation: newOrgMembershipMutation(uuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.OrganizationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.OrganizationsTable, + Columns: user.OrganizationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + createE := &OrgMembershipCreate{config: uuo.config, mutation: newOrgMembershipMutation(uuo.config, OpCreate)} + _ = createE.defaults() + _, specE := createE.createSpec() + edge.Target.Fields = specE.Fields + if specE.ID.Value != nil { + edge.Target.Fields = append(edge.Target.Fields, specE.ID) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.WebauthnCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.Webauthn + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedWebauthnIDs(); len(nodes) > 0 && !uuo.mutation.WebauthnCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.WebauthnIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.WebauthnTable, + Columns: []string{user.WebauthnColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.File + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedFilesIDs(); len(nodes) > 0 && !uuo.mutation.FilesCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.FilesIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: false, + Table: user.FilesTable, + Columns: []string{user.FilesColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(file.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.File + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.UserEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !uuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: user.EventsTable, + Columns: user.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.UserEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.GroupMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.GroupMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedGroupMembershipsIDs(); len(nodes) > 0 && !uuo.mutation.GroupMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.GroupMembershipsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.GroupMembershipsTable, + Columns: []string{user.GroupMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(groupmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.GroupMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if uuo.mutation.OrgMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.OrgMembership + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.RemovedOrgMembershipsIDs(); len(nodes) > 0 && !uuo.mutation.OrgMembershipsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := uuo.mutation.OrgMembershipsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2M, + Inverse: true, + Table: user.OrgMembershipsTable, + Columns: []string{user.OrgMembershipsColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(orgmembership.FieldID, field.TypeString), + }, + } + edge.Schema = uuo.schemaConfig.OrgMembership + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = uuo.schemaConfig.User + ctx = internal.NewSchemaConfigContext(ctx, uuo.schemaConfig) + _node = &User{config: uuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, uuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{user.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + uuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/userhistory.go b/internal/ent/generated/userhistory.go new file mode 100644 index 0000000..e94f608 --- /dev/null +++ b/internal/ent/generated/userhistory.go @@ -0,0 +1,367 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// UserHistory is the model entity for the UserHistory schema. +type UserHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // Email holds the value of the "email" field. + Email string `json:"email,omitempty"` + // FirstName holds the value of the "first_name" field. + FirstName string `json:"first_name,omitempty"` + // LastName holds the value of the "last_name" field. + LastName string `json:"last_name,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"display_name,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatar_remote_url,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatar_local_file,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatar_updated_at,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"last_seen,omitempty"` + // user password hash + Password *string `json:"-"` + // the Subject of the user JWT + Sub string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider enums.AuthProvider `json:"auth_provider,omitempty"` + // the user's role + Role enums.Role `json:"role,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*UserHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case userhistory.FieldTags: + values[i] = new([]byte) + case userhistory.FieldOperation: + values[i] = new(history.OpType) + case userhistory.FieldID, userhistory.FieldRef, userhistory.FieldCreatedBy, userhistory.FieldUpdatedBy, userhistory.FieldDeletedBy, userhistory.FieldMappingID, userhistory.FieldEmail, userhistory.FieldFirstName, userhistory.FieldLastName, userhistory.FieldDisplayName, userhistory.FieldAvatarRemoteURL, userhistory.FieldAvatarLocalFile, userhistory.FieldPassword, userhistory.FieldSub, userhistory.FieldAuthProvider, userhistory.FieldRole: + values[i] = new(sql.NullString) + case userhistory.FieldHistoryTime, userhistory.FieldCreatedAt, userhistory.FieldUpdatedAt, userhistory.FieldDeletedAt, userhistory.FieldAvatarUpdatedAt, userhistory.FieldLastSeen: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the UserHistory fields. +func (uh *UserHistory) 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 userhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + uh.ID = value.String + } + case userhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + uh.HistoryTime = value.Time + } + case userhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + uh.Ref = value.String + } + case userhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + uh.Operation = *value + } + case userhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + uh.CreatedAt = value.Time + } + case userhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + uh.UpdatedAt = value.Time + } + case userhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + uh.CreatedBy = value.String + } + case userhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + uh.UpdatedBy = value.String + } + case userhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + uh.DeletedAt = value.Time + } + case userhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + uh.DeletedBy = value.String + } + case userhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + uh.MappingID = value.String + } + case userhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &uh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case userhistory.FieldEmail: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field email", values[i]) + } else if value.Valid { + uh.Email = value.String + } + case userhistory.FieldFirstName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field first_name", values[i]) + } else if value.Valid { + uh.FirstName = value.String + } + case userhistory.FieldLastName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field last_name", values[i]) + } else if value.Valid { + uh.LastName = value.String + } + case userhistory.FieldDisplayName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field display_name", values[i]) + } else if value.Valid { + uh.DisplayName = value.String + } + case userhistory.FieldAvatarRemoteURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field avatar_remote_url", values[i]) + } else if value.Valid { + uh.AvatarRemoteURL = new(string) + *uh.AvatarRemoteURL = value.String + } + case userhistory.FieldAvatarLocalFile: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field avatar_local_file", values[i]) + } else if value.Valid { + uh.AvatarLocalFile = new(string) + *uh.AvatarLocalFile = value.String + } + case userhistory.FieldAvatarUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field avatar_updated_at", values[i]) + } else if value.Valid { + uh.AvatarUpdatedAt = new(time.Time) + *uh.AvatarUpdatedAt = value.Time + } + case userhistory.FieldLastSeen: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field last_seen", values[i]) + } else if value.Valid { + uh.LastSeen = new(time.Time) + *uh.LastSeen = value.Time + } + case userhistory.FieldPassword: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field password", values[i]) + } else if value.Valid { + uh.Password = new(string) + *uh.Password = value.String + } + case userhistory.FieldSub: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field sub", values[i]) + } else if value.Valid { + uh.Sub = value.String + } + case userhistory.FieldAuthProvider: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field auth_provider", values[i]) + } else if value.Valid { + uh.AuthProvider = enums.AuthProvider(value.String) + } + case userhistory.FieldRole: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field role", values[i]) + } else if value.Valid { + uh.Role = enums.Role(value.String) + } + default: + uh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the UserHistory. +// This includes values selected through modifiers, order, etc. +func (uh *UserHistory) Value(name string) (ent.Value, error) { + return uh.selectValues.Get(name) +} + +// Update returns a builder for updating this UserHistory. +// Note that you need to call UserHistory.Unwrap() before calling this method if this UserHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (uh *UserHistory) Update() *UserHistoryUpdateOne { + return NewUserHistoryClient(uh.config).UpdateOne(uh) +} + +// Unwrap unwraps the UserHistory 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 (uh *UserHistory) Unwrap() *UserHistory { + _tx, ok := uh.config.driver.(*txDriver) + if !ok { + panic("generated: UserHistory is not a transactional entity") + } + uh.config.driver = _tx.drv + return uh +} + +// String implements the fmt.Stringer. +func (uh *UserHistory) String() string { + var builder strings.Builder + builder.WriteString("UserHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", uh.ID)) + builder.WriteString("history_time=") + builder.WriteString(uh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(uh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", uh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(uh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(uh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(uh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(uh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(uh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(uh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(uh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", uh.Tags)) + builder.WriteString(", ") + builder.WriteString("email=") + builder.WriteString(uh.Email) + builder.WriteString(", ") + builder.WriteString("first_name=") + builder.WriteString(uh.FirstName) + builder.WriteString(", ") + builder.WriteString("last_name=") + builder.WriteString(uh.LastName) + builder.WriteString(", ") + builder.WriteString("display_name=") + builder.WriteString(uh.DisplayName) + builder.WriteString(", ") + if v := uh.AvatarRemoteURL; v != nil { + builder.WriteString("avatar_remote_url=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := uh.AvatarLocalFile; v != nil { + builder.WriteString("avatar_local_file=") + builder.WriteString(*v) + } + builder.WriteString(", ") + if v := uh.AvatarUpdatedAt; v != nil { + builder.WriteString("avatar_updated_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := uh.LastSeen; v != nil { + builder.WriteString("last_seen=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("password=") + builder.WriteString(", ") + builder.WriteString("sub=") + builder.WriteString(uh.Sub) + builder.WriteString(", ") + builder.WriteString("auth_provider=") + builder.WriteString(fmt.Sprintf("%v", uh.AuthProvider)) + builder.WriteString(", ") + builder.WriteString("role=") + builder.WriteString(fmt.Sprintf("%v", uh.Role)) + builder.WriteByte(')') + return builder.String() +} + +// UserHistories is a parsable slice of UserHistory. +type UserHistories []*UserHistory diff --git a/internal/ent/generated/userhistory/userhistory.go b/internal/ent/generated/userhistory/userhistory.go new file mode 100644 index 0000000..bd3ac6d --- /dev/null +++ b/internal/ent/generated/userhistory/userhistory.go @@ -0,0 +1,307 @@ +// Code generated by ent, DO NOT EDIT. + +package userhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the userhistory type in the database. + Label = "user_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldEmail holds the string denoting the email field in the database. + FieldEmail = "email" + // FieldFirstName holds the string denoting the first_name field in the database. + FieldFirstName = "first_name" + // FieldLastName holds the string denoting the last_name field in the database. + FieldLastName = "last_name" + // FieldDisplayName holds the string denoting the display_name field in the database. + FieldDisplayName = "display_name" + // FieldAvatarRemoteURL holds the string denoting the avatar_remote_url field in the database. + FieldAvatarRemoteURL = "avatar_remote_url" + // FieldAvatarLocalFile holds the string denoting the avatar_local_file field in the database. + FieldAvatarLocalFile = "avatar_local_file" + // FieldAvatarUpdatedAt holds the string denoting the avatar_updated_at field in the database. + FieldAvatarUpdatedAt = "avatar_updated_at" + // FieldLastSeen holds the string denoting the last_seen field in the database. + FieldLastSeen = "last_seen" + // FieldPassword holds the string denoting the password field in the database. + FieldPassword = "password" + // FieldSub holds the string denoting the sub field in the database. + FieldSub = "sub" + // FieldAuthProvider holds the string denoting the auth_provider field in the database. + FieldAuthProvider = "auth_provider" + // FieldRole holds the string denoting the role field in the database. + FieldRole = "role" + // Table holds the table name of the userhistory in the database. + Table = "user_history" +) + +// Columns holds all SQL columns for userhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldDeletedAt, + FieldDeletedBy, + FieldMappingID, + FieldTags, + FieldEmail, + FieldFirstName, + FieldLastName, + FieldDisplayName, + FieldAvatarRemoteURL, + FieldAvatarLocalFile, + FieldAvatarUpdatedAt, + FieldLastSeen, + FieldPassword, + FieldSub, + FieldAuthProvider, + FieldRole, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Interceptors [1]ent.Interceptor + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // UpdateDefaultAvatarUpdatedAt holds the default value on update for the "avatar_updated_at" field. + UpdateDefaultAvatarUpdatedAt func() time.Time + // UpdateDefaultLastSeen holds the default value on update for the "last_seen" field. + UpdateDefaultLastSeen func() time.Time + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("userhistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultAuthProvider enums.AuthProvider = "CREDENTIALS" + +// AuthProviderValidator is a validator for the "auth_provider" field enum values. It is called by the builders before save. +func AuthProviderValidator(ap enums.AuthProvider) error { + switch ap.String() { + case "CREDENTIALS", "GOOGLE", "GITHUB", "WEBAUTHN": + return nil + default: + return fmt.Errorf("userhistory: invalid enum value for auth_provider field: %q", ap) + } +} + +const DefaultRole enums.Role = "USER" + +// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save. +func RoleValidator(r enums.Role) error { + switch r.String() { + case "ADMIN", "MEMBER", "USER": + return nil + default: + return fmt.Errorf("userhistory: invalid enum value for role field: %q", r) + } +} + +// OrderOption defines the ordering options for the UserHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByEmail orders the results by the email field. +func ByEmail(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmail, opts...).ToFunc() +} + +// ByFirstName orders the results by the first_name field. +func ByFirstName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFirstName, opts...).ToFunc() +} + +// ByLastName orders the results by the last_name field. +func ByLastName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastName, opts...).ToFunc() +} + +// ByDisplayName orders the results by the display_name field. +func ByDisplayName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDisplayName, opts...).ToFunc() +} + +// ByAvatarRemoteURL orders the results by the avatar_remote_url field. +func ByAvatarRemoteURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarRemoteURL, opts...).ToFunc() +} + +// ByAvatarLocalFile orders the results by the avatar_local_file field. +func ByAvatarLocalFile(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarLocalFile, opts...).ToFunc() +} + +// ByAvatarUpdatedAt orders the results by the avatar_updated_at field. +func ByAvatarUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAvatarUpdatedAt, opts...).ToFunc() +} + +// ByLastSeen orders the results by the last_seen field. +func ByLastSeen(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastSeen, opts...).ToFunc() +} + +// ByPassword orders the results by the password field. +func ByPassword(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPassword, opts...).ToFunc() +} + +// BySub orders the results by the sub field. +func BySub(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSub, opts...).ToFunc() +} + +// ByAuthProvider orders the results by the auth_provider field. +func ByAuthProvider(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAuthProvider, opts...).ToFunc() +} + +// ByRole orders the results by the role field. +func ByRole(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRole, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.AuthProvider must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.AuthProvider)(nil) + // enums.AuthProvider must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.AuthProvider)(nil) +) + +var ( + // enums.Role must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.Role)(nil) + // enums.Role must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.Role)(nil) +) diff --git a/internal/ent/generated/userhistory/where.go b/internal/ent/generated/userhistory/where.go new file mode 100644 index 0000000..f62a0d7 --- /dev/null +++ b/internal/ent/generated/userhistory/where.go @@ -0,0 +1,1512 @@ +// Code generated by ent, DO NOT EDIT. + +package userhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// Email applies equality check predicate on the "email" field. It's identical to EmailEQ. +func Email(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldEmail, v)) +} + +// FirstName applies equality check predicate on the "first_name" field. It's identical to FirstNameEQ. +func FirstName(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldFirstName, v)) +} + +// LastName applies equality check predicate on the "last_name" field. It's identical to LastNameEQ. +func LastName(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldLastName, v)) +} + +// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ. +func DisplayName(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// AvatarRemoteURL applies equality check predicate on the "avatar_remote_url" field. It's identical to AvatarRemoteURLEQ. +func AvatarRemoteURL(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarLocalFile applies equality check predicate on the "avatar_local_file" field. It's identical to AvatarLocalFileEQ. +func AvatarLocalFile(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldAvatarLocalFile, v)) +} + +// AvatarUpdatedAt applies equality check predicate on the "avatar_updated_at" field. It's identical to AvatarUpdatedAtEQ. +func AvatarUpdatedAt(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldAvatarUpdatedAt, v)) +} + +// LastSeen applies equality check predicate on the "last_seen" field. It's identical to LastSeenEQ. +func LastSeen(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldLastSeen, v)) +} + +// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ. +func Password(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldPassword, v)) +} + +// Sub applies equality check predicate on the "sub" field. It's identical to SubEQ. +func Sub(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldSub, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldTags)) +} + +// EmailEQ applies the EQ predicate on the "email" field. +func EmailEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldEmail, v)) +} + +// EmailNEQ applies the NEQ predicate on the "email" field. +func EmailNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldEmail, v)) +} + +// EmailIn applies the In predicate on the "email" field. +func EmailIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldEmail, vs...)) +} + +// EmailNotIn applies the NotIn predicate on the "email" field. +func EmailNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldEmail, vs...)) +} + +// EmailGT applies the GT predicate on the "email" field. +func EmailGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldEmail, v)) +} + +// EmailGTE applies the GTE predicate on the "email" field. +func EmailGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldEmail, v)) +} + +// EmailLT applies the LT predicate on the "email" field. +func EmailLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldEmail, v)) +} + +// EmailLTE applies the LTE predicate on the "email" field. +func EmailLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldEmail, v)) +} + +// EmailContains applies the Contains predicate on the "email" field. +func EmailContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldEmail, v)) +} + +// EmailHasPrefix applies the HasPrefix predicate on the "email" field. +func EmailHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldEmail, v)) +} + +// EmailHasSuffix applies the HasSuffix predicate on the "email" field. +func EmailHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldEmail, v)) +} + +// EmailEqualFold applies the EqualFold predicate on the "email" field. +func EmailEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldEmail, v)) +} + +// EmailContainsFold applies the ContainsFold predicate on the "email" field. +func EmailContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldEmail, v)) +} + +// FirstNameEQ applies the EQ predicate on the "first_name" field. +func FirstNameEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldFirstName, v)) +} + +// FirstNameNEQ applies the NEQ predicate on the "first_name" field. +func FirstNameNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldFirstName, v)) +} + +// FirstNameIn applies the In predicate on the "first_name" field. +func FirstNameIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldFirstName, vs...)) +} + +// FirstNameNotIn applies the NotIn predicate on the "first_name" field. +func FirstNameNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldFirstName, vs...)) +} + +// FirstNameGT applies the GT predicate on the "first_name" field. +func FirstNameGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldFirstName, v)) +} + +// FirstNameGTE applies the GTE predicate on the "first_name" field. +func FirstNameGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldFirstName, v)) +} + +// FirstNameLT applies the LT predicate on the "first_name" field. +func FirstNameLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldFirstName, v)) +} + +// FirstNameLTE applies the LTE predicate on the "first_name" field. +func FirstNameLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldFirstName, v)) +} + +// FirstNameContains applies the Contains predicate on the "first_name" field. +func FirstNameContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldFirstName, v)) +} + +// FirstNameHasPrefix applies the HasPrefix predicate on the "first_name" field. +func FirstNameHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldFirstName, v)) +} + +// FirstNameHasSuffix applies the HasSuffix predicate on the "first_name" field. +func FirstNameHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldFirstName, v)) +} + +// FirstNameIsNil applies the IsNil predicate on the "first_name" field. +func FirstNameIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldFirstName)) +} + +// FirstNameNotNil applies the NotNil predicate on the "first_name" field. +func FirstNameNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldFirstName)) +} + +// FirstNameEqualFold applies the EqualFold predicate on the "first_name" field. +func FirstNameEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldFirstName, v)) +} + +// FirstNameContainsFold applies the ContainsFold predicate on the "first_name" field. +func FirstNameContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldFirstName, v)) +} + +// LastNameEQ applies the EQ predicate on the "last_name" field. +func LastNameEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldLastName, v)) +} + +// LastNameNEQ applies the NEQ predicate on the "last_name" field. +func LastNameNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldLastName, v)) +} + +// LastNameIn applies the In predicate on the "last_name" field. +func LastNameIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldLastName, vs...)) +} + +// LastNameNotIn applies the NotIn predicate on the "last_name" field. +func LastNameNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldLastName, vs...)) +} + +// LastNameGT applies the GT predicate on the "last_name" field. +func LastNameGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldLastName, v)) +} + +// LastNameGTE applies the GTE predicate on the "last_name" field. +func LastNameGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldLastName, v)) +} + +// LastNameLT applies the LT predicate on the "last_name" field. +func LastNameLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldLastName, v)) +} + +// LastNameLTE applies the LTE predicate on the "last_name" field. +func LastNameLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldLastName, v)) +} + +// LastNameContains applies the Contains predicate on the "last_name" field. +func LastNameContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldLastName, v)) +} + +// LastNameHasPrefix applies the HasPrefix predicate on the "last_name" field. +func LastNameHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldLastName, v)) +} + +// LastNameHasSuffix applies the HasSuffix predicate on the "last_name" field. +func LastNameHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldLastName, v)) +} + +// LastNameIsNil applies the IsNil predicate on the "last_name" field. +func LastNameIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldLastName)) +} + +// LastNameNotNil applies the NotNil predicate on the "last_name" field. +func LastNameNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldLastName)) +} + +// LastNameEqualFold applies the EqualFold predicate on the "last_name" field. +func LastNameEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldLastName, v)) +} + +// LastNameContainsFold applies the ContainsFold predicate on the "last_name" field. +func LastNameContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldLastName, v)) +} + +// DisplayNameEQ applies the EQ predicate on the "display_name" field. +func DisplayNameEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldDisplayName, v)) +} + +// DisplayNameNEQ applies the NEQ predicate on the "display_name" field. +func DisplayNameNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldDisplayName, v)) +} + +// DisplayNameIn applies the In predicate on the "display_name" field. +func DisplayNameIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldDisplayName, vs...)) +} + +// DisplayNameNotIn applies the NotIn predicate on the "display_name" field. +func DisplayNameNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldDisplayName, vs...)) +} + +// DisplayNameGT applies the GT predicate on the "display_name" field. +func DisplayNameGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldDisplayName, v)) +} + +// DisplayNameGTE applies the GTE predicate on the "display_name" field. +func DisplayNameGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldDisplayName, v)) +} + +// DisplayNameLT applies the LT predicate on the "display_name" field. +func DisplayNameLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldDisplayName, v)) +} + +// DisplayNameLTE applies the LTE predicate on the "display_name" field. +func DisplayNameLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldDisplayName, v)) +} + +// DisplayNameContains applies the Contains predicate on the "display_name" field. +func DisplayNameContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldDisplayName, v)) +} + +// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field. +func DisplayNameHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldDisplayName, v)) +} + +// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field. +func DisplayNameHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldDisplayName, v)) +} + +// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field. +func DisplayNameEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldDisplayName, v)) +} + +// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field. +func DisplayNameContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldDisplayName, v)) +} + +// AvatarRemoteURLEQ applies the EQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLNEQ applies the NEQ predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIn applies the In predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLNotIn applies the NotIn predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldAvatarRemoteURL, vs...)) +} + +// AvatarRemoteURLGT applies the GT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLGTE applies the GTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLT applies the LT predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLLTE applies the LTE predicate on the "avatar_remote_url" field. +func AvatarRemoteURLLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContains applies the Contains predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasPrefix applies the HasPrefix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLHasSuffix applies the HasSuffix predicate on the "avatar_remote_url" field. +func AvatarRemoteURLHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLIsNil applies the IsNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLNotNil applies the NotNil predicate on the "avatar_remote_url" field. +func AvatarRemoteURLNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldAvatarRemoteURL)) +} + +// AvatarRemoteURLEqualFold applies the EqualFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldAvatarRemoteURL, v)) +} + +// AvatarRemoteURLContainsFold applies the ContainsFold predicate on the "avatar_remote_url" field. +func AvatarRemoteURLContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldAvatarRemoteURL, v)) +} + +// AvatarLocalFileEQ applies the EQ predicate on the "avatar_local_file" field. +func AvatarLocalFileEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileNEQ applies the NEQ predicate on the "avatar_local_file" field. +func AvatarLocalFileNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileIn applies the In predicate on the "avatar_local_file" field. +func AvatarLocalFileIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldAvatarLocalFile, vs...)) +} + +// AvatarLocalFileNotIn applies the NotIn predicate on the "avatar_local_file" field. +func AvatarLocalFileNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldAvatarLocalFile, vs...)) +} + +// AvatarLocalFileGT applies the GT predicate on the "avatar_local_file" field. +func AvatarLocalFileGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileGTE applies the GTE predicate on the "avatar_local_file" field. +func AvatarLocalFileGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileLT applies the LT predicate on the "avatar_local_file" field. +func AvatarLocalFileLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileLTE applies the LTE predicate on the "avatar_local_file" field. +func AvatarLocalFileLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileContains applies the Contains predicate on the "avatar_local_file" field. +func AvatarLocalFileContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileHasPrefix applies the HasPrefix predicate on the "avatar_local_file" field. +func AvatarLocalFileHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileHasSuffix applies the HasSuffix predicate on the "avatar_local_file" field. +func AvatarLocalFileHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileIsNil applies the IsNil predicate on the "avatar_local_file" field. +func AvatarLocalFileIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldAvatarLocalFile)) +} + +// AvatarLocalFileNotNil applies the NotNil predicate on the "avatar_local_file" field. +func AvatarLocalFileNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldAvatarLocalFile)) +} + +// AvatarLocalFileEqualFold applies the EqualFold predicate on the "avatar_local_file" field. +func AvatarLocalFileEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldAvatarLocalFile, v)) +} + +// AvatarLocalFileContainsFold applies the ContainsFold predicate on the "avatar_local_file" field. +func AvatarLocalFileContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldAvatarLocalFile, v)) +} + +// AvatarUpdatedAtEQ applies the EQ predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtNEQ applies the NEQ predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtNEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtIn applies the In predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldAvatarUpdatedAt, vs...)) +} + +// AvatarUpdatedAtNotIn applies the NotIn predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtNotIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldAvatarUpdatedAt, vs...)) +} + +// AvatarUpdatedAtGT applies the GT predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtGT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtGTE applies the GTE predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtGTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtLT applies the LT predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtLT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtLTE applies the LTE predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtLTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldAvatarUpdatedAt, v)) +} + +// AvatarUpdatedAtIsNil applies the IsNil predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldAvatarUpdatedAt)) +} + +// AvatarUpdatedAtNotNil applies the NotNil predicate on the "avatar_updated_at" field. +func AvatarUpdatedAtNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldAvatarUpdatedAt)) +} + +// LastSeenEQ applies the EQ predicate on the "last_seen" field. +func LastSeenEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldLastSeen, v)) +} + +// LastSeenNEQ applies the NEQ predicate on the "last_seen" field. +func LastSeenNEQ(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldLastSeen, v)) +} + +// LastSeenIn applies the In predicate on the "last_seen" field. +func LastSeenIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldLastSeen, vs...)) +} + +// LastSeenNotIn applies the NotIn predicate on the "last_seen" field. +func LastSeenNotIn(vs ...time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldLastSeen, vs...)) +} + +// LastSeenGT applies the GT predicate on the "last_seen" field. +func LastSeenGT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldLastSeen, v)) +} + +// LastSeenGTE applies the GTE predicate on the "last_seen" field. +func LastSeenGTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldLastSeen, v)) +} + +// LastSeenLT applies the LT predicate on the "last_seen" field. +func LastSeenLT(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldLastSeen, v)) +} + +// LastSeenLTE applies the LTE predicate on the "last_seen" field. +func LastSeenLTE(v time.Time) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldLastSeen, v)) +} + +// LastSeenIsNil applies the IsNil predicate on the "last_seen" field. +func LastSeenIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldLastSeen)) +} + +// LastSeenNotNil applies the NotNil predicate on the "last_seen" field. +func LastSeenNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldLastSeen)) +} + +// PasswordEQ applies the EQ predicate on the "password" field. +func PasswordEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldPassword, v)) +} + +// PasswordNEQ applies the NEQ predicate on the "password" field. +func PasswordNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldPassword, v)) +} + +// PasswordIn applies the In predicate on the "password" field. +func PasswordIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldPassword, vs...)) +} + +// PasswordNotIn applies the NotIn predicate on the "password" field. +func PasswordNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldPassword, vs...)) +} + +// PasswordGT applies the GT predicate on the "password" field. +func PasswordGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldPassword, v)) +} + +// PasswordGTE applies the GTE predicate on the "password" field. +func PasswordGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldPassword, v)) +} + +// PasswordLT applies the LT predicate on the "password" field. +func PasswordLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldPassword, v)) +} + +// PasswordLTE applies the LTE predicate on the "password" field. +func PasswordLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldPassword, v)) +} + +// PasswordContains applies the Contains predicate on the "password" field. +func PasswordContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldPassword, v)) +} + +// PasswordHasPrefix applies the HasPrefix predicate on the "password" field. +func PasswordHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldPassword, v)) +} + +// PasswordHasSuffix applies the HasSuffix predicate on the "password" field. +func PasswordHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldPassword, v)) +} + +// PasswordIsNil applies the IsNil predicate on the "password" field. +func PasswordIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldPassword)) +} + +// PasswordNotNil applies the NotNil predicate on the "password" field. +func PasswordNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldPassword)) +} + +// PasswordEqualFold applies the EqualFold predicate on the "password" field. +func PasswordEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldPassword, v)) +} + +// PasswordContainsFold applies the ContainsFold predicate on the "password" field. +func PasswordContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldPassword, v)) +} + +// SubEQ applies the EQ predicate on the "sub" field. +func SubEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEQ(FieldSub, v)) +} + +// SubNEQ applies the NEQ predicate on the "sub" field. +func SubNEQ(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNEQ(FieldSub, v)) +} + +// SubIn applies the In predicate on the "sub" field. +func SubIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldIn(FieldSub, vs...)) +} + +// SubNotIn applies the NotIn predicate on the "sub" field. +func SubNotIn(vs ...string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotIn(FieldSub, vs...)) +} + +// SubGT applies the GT predicate on the "sub" field. +func SubGT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGT(FieldSub, v)) +} + +// SubGTE applies the GTE predicate on the "sub" field. +func SubGTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldGTE(FieldSub, v)) +} + +// SubLT applies the LT predicate on the "sub" field. +func SubLT(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLT(FieldSub, v)) +} + +// SubLTE applies the LTE predicate on the "sub" field. +func SubLTE(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldLTE(FieldSub, v)) +} + +// SubContains applies the Contains predicate on the "sub" field. +func SubContains(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContains(FieldSub, v)) +} + +// SubHasPrefix applies the HasPrefix predicate on the "sub" field. +func SubHasPrefix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasPrefix(FieldSub, v)) +} + +// SubHasSuffix applies the HasSuffix predicate on the "sub" field. +func SubHasSuffix(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldHasSuffix(FieldSub, v)) +} + +// SubIsNil applies the IsNil predicate on the "sub" field. +func SubIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldSub)) +} + +// SubNotNil applies the NotNil predicate on the "sub" field. +func SubNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldSub)) +} + +// SubEqualFold applies the EqualFold predicate on the "sub" field. +func SubEqualFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldEqualFold(FieldSub, v)) +} + +// SubContainsFold applies the ContainsFold predicate on the "sub" field. +func SubContainsFold(v string) predicate.UserHistory { + return predicate.UserHistory(sql.FieldContainsFold(FieldSub, v)) +} + +// AuthProviderEQ applies the EQ predicate on the "auth_provider" field. +func AuthProviderEQ(v enums.AuthProvider) predicate.UserHistory { + vc := v + return predicate.UserHistory(sql.FieldEQ(FieldAuthProvider, vc)) +} + +// AuthProviderNEQ applies the NEQ predicate on the "auth_provider" field. +func AuthProviderNEQ(v enums.AuthProvider) predicate.UserHistory { + vc := v + return predicate.UserHistory(sql.FieldNEQ(FieldAuthProvider, vc)) +} + +// AuthProviderIn applies the In predicate on the "auth_provider" field. +func AuthProviderIn(vs ...enums.AuthProvider) predicate.UserHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserHistory(sql.FieldIn(FieldAuthProvider, v...)) +} + +// AuthProviderNotIn applies the NotIn predicate on the "auth_provider" field. +func AuthProviderNotIn(vs ...enums.AuthProvider) predicate.UserHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserHistory(sql.FieldNotIn(FieldAuthProvider, v...)) +} + +// RoleEQ applies the EQ predicate on the "role" field. +func RoleEQ(v enums.Role) predicate.UserHistory { + vc := v + return predicate.UserHistory(sql.FieldEQ(FieldRole, vc)) +} + +// RoleNEQ applies the NEQ predicate on the "role" field. +func RoleNEQ(v enums.Role) predicate.UserHistory { + vc := v + return predicate.UserHistory(sql.FieldNEQ(FieldRole, vc)) +} + +// RoleIn applies the In predicate on the "role" field. +func RoleIn(vs ...enums.Role) predicate.UserHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserHistory(sql.FieldIn(FieldRole, v...)) +} + +// RoleNotIn applies the NotIn predicate on the "role" field. +func RoleNotIn(vs ...enums.Role) predicate.UserHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserHistory(sql.FieldNotIn(FieldRole, v...)) +} + +// RoleIsNil applies the IsNil predicate on the "role" field. +func RoleIsNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldIsNull(FieldRole)) +} + +// RoleNotNil applies the NotNil predicate on the "role" field. +func RoleNotNil() predicate.UserHistory { + return predicate.UserHistory(sql.FieldNotNull(FieldRole)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.UserHistory) predicate.UserHistory { + return predicate.UserHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.UserHistory) predicate.UserHistory { + return predicate.UserHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.UserHistory) predicate.UserHistory { + return predicate.UserHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/userhistory_create.go b/internal/ent/generated/userhistory_create.go new file mode 100644 index 0000000..7f3e870 --- /dev/null +++ b/internal/ent/generated/userhistory_create.go @@ -0,0 +1,646 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// UserHistoryCreate is the builder for creating a UserHistory entity. +type UserHistoryCreate struct { + config + mutation *UserHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (uhc *UserHistoryCreate) SetHistoryTime(t time.Time) *UserHistoryCreate { + uhc.mutation.SetHistoryTime(t) + return uhc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableHistoryTime(t *time.Time) *UserHistoryCreate { + if t != nil { + uhc.SetHistoryTime(*t) + } + return uhc +} + +// SetRef sets the "ref" field. +func (uhc *UserHistoryCreate) SetRef(s string) *UserHistoryCreate { + uhc.mutation.SetRef(s) + return uhc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableRef(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetRef(*s) + } + return uhc +} + +// SetOperation sets the "operation" field. +func (uhc *UserHistoryCreate) SetOperation(ht history.OpType) *UserHistoryCreate { + uhc.mutation.SetOperation(ht) + return uhc +} + +// SetCreatedAt sets the "created_at" field. +func (uhc *UserHistoryCreate) SetCreatedAt(t time.Time) *UserHistoryCreate { + uhc.mutation.SetCreatedAt(t) + return uhc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableCreatedAt(t *time.Time) *UserHistoryCreate { + if t != nil { + uhc.SetCreatedAt(*t) + } + return uhc +} + +// SetUpdatedAt sets the "updated_at" field. +func (uhc *UserHistoryCreate) SetUpdatedAt(t time.Time) *UserHistoryCreate { + uhc.mutation.SetUpdatedAt(t) + return uhc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableUpdatedAt(t *time.Time) *UserHistoryCreate { + if t != nil { + uhc.SetUpdatedAt(*t) + } + return uhc +} + +// SetCreatedBy sets the "created_by" field. +func (uhc *UserHistoryCreate) SetCreatedBy(s string) *UserHistoryCreate { + uhc.mutation.SetCreatedBy(s) + return uhc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableCreatedBy(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetCreatedBy(*s) + } + return uhc +} + +// SetUpdatedBy sets the "updated_by" field. +func (uhc *UserHistoryCreate) SetUpdatedBy(s string) *UserHistoryCreate { + uhc.mutation.SetUpdatedBy(s) + return uhc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableUpdatedBy(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetUpdatedBy(*s) + } + return uhc +} + +// SetDeletedAt sets the "deleted_at" field. +func (uhc *UserHistoryCreate) SetDeletedAt(t time.Time) *UserHistoryCreate { + uhc.mutation.SetDeletedAt(t) + return uhc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableDeletedAt(t *time.Time) *UserHistoryCreate { + if t != nil { + uhc.SetDeletedAt(*t) + } + return uhc +} + +// SetDeletedBy sets the "deleted_by" field. +func (uhc *UserHistoryCreate) SetDeletedBy(s string) *UserHistoryCreate { + uhc.mutation.SetDeletedBy(s) + return uhc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableDeletedBy(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetDeletedBy(*s) + } + return uhc +} + +// SetMappingID sets the "mapping_id" field. +func (uhc *UserHistoryCreate) SetMappingID(s string) *UserHistoryCreate { + uhc.mutation.SetMappingID(s) + return uhc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableMappingID(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetMappingID(*s) + } + return uhc +} + +// SetTags sets the "tags" field. +func (uhc *UserHistoryCreate) SetTags(s []string) *UserHistoryCreate { + uhc.mutation.SetTags(s) + return uhc +} + +// SetEmail sets the "email" field. +func (uhc *UserHistoryCreate) SetEmail(s string) *UserHistoryCreate { + uhc.mutation.SetEmail(s) + return uhc +} + +// SetFirstName sets the "first_name" field. +func (uhc *UserHistoryCreate) SetFirstName(s string) *UserHistoryCreate { + uhc.mutation.SetFirstName(s) + return uhc +} + +// SetNillableFirstName sets the "first_name" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableFirstName(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetFirstName(*s) + } + return uhc +} + +// SetLastName sets the "last_name" field. +func (uhc *UserHistoryCreate) SetLastName(s string) *UserHistoryCreate { + uhc.mutation.SetLastName(s) + return uhc +} + +// SetNillableLastName sets the "last_name" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableLastName(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetLastName(*s) + } + return uhc +} + +// SetDisplayName sets the "display_name" field. +func (uhc *UserHistoryCreate) SetDisplayName(s string) *UserHistoryCreate { + uhc.mutation.SetDisplayName(s) + return uhc +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (uhc *UserHistoryCreate) SetAvatarRemoteURL(s string) *UserHistoryCreate { + uhc.mutation.SetAvatarRemoteURL(s) + return uhc +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableAvatarRemoteURL(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetAvatarRemoteURL(*s) + } + return uhc +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (uhc *UserHistoryCreate) SetAvatarLocalFile(s string) *UserHistoryCreate { + uhc.mutation.SetAvatarLocalFile(s) + return uhc +} + +// SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableAvatarLocalFile(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetAvatarLocalFile(*s) + } + return uhc +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (uhc *UserHistoryCreate) SetAvatarUpdatedAt(t time.Time) *UserHistoryCreate { + uhc.mutation.SetAvatarUpdatedAt(t) + return uhc +} + +// SetNillableAvatarUpdatedAt sets the "avatar_updated_at" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableAvatarUpdatedAt(t *time.Time) *UserHistoryCreate { + if t != nil { + uhc.SetAvatarUpdatedAt(*t) + } + return uhc +} + +// SetLastSeen sets the "last_seen" field. +func (uhc *UserHistoryCreate) SetLastSeen(t time.Time) *UserHistoryCreate { + uhc.mutation.SetLastSeen(t) + return uhc +} + +// SetNillableLastSeen sets the "last_seen" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableLastSeen(t *time.Time) *UserHistoryCreate { + if t != nil { + uhc.SetLastSeen(*t) + } + return uhc +} + +// SetPassword sets the "password" field. +func (uhc *UserHistoryCreate) SetPassword(s string) *UserHistoryCreate { + uhc.mutation.SetPassword(s) + return uhc +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillablePassword(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetPassword(*s) + } + return uhc +} + +// SetSub sets the "sub" field. +func (uhc *UserHistoryCreate) SetSub(s string) *UserHistoryCreate { + uhc.mutation.SetSub(s) + return uhc +} + +// SetNillableSub sets the "sub" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableSub(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetSub(*s) + } + return uhc +} + +// SetAuthProvider sets the "auth_provider" field. +func (uhc *UserHistoryCreate) SetAuthProvider(ep enums.AuthProvider) *UserHistoryCreate { + uhc.mutation.SetAuthProvider(ep) + return uhc +} + +// SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableAuthProvider(ep *enums.AuthProvider) *UserHistoryCreate { + if ep != nil { + uhc.SetAuthProvider(*ep) + } + return uhc +} + +// SetRole sets the "role" field. +func (uhc *UserHistoryCreate) SetRole(e enums.Role) *UserHistoryCreate { + uhc.mutation.SetRole(e) + return uhc +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableRole(e *enums.Role) *UserHistoryCreate { + if e != nil { + uhc.SetRole(*e) + } + return uhc +} + +// SetID sets the "id" field. +func (uhc *UserHistoryCreate) SetID(s string) *UserHistoryCreate { + uhc.mutation.SetID(s) + return uhc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (uhc *UserHistoryCreate) SetNillableID(s *string) *UserHistoryCreate { + if s != nil { + uhc.SetID(*s) + } + return uhc +} + +// Mutation returns the UserHistoryMutation object of the builder. +func (uhc *UserHistoryCreate) Mutation() *UserHistoryMutation { + return uhc.mutation +} + +// Save creates the UserHistory in the database. +func (uhc *UserHistoryCreate) Save(ctx context.Context) (*UserHistory, error) { + uhc.defaults() + return withHooks(ctx, uhc.sqlSave, uhc.mutation, uhc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (uhc *UserHistoryCreate) SaveX(ctx context.Context) *UserHistory { + v, err := uhc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (uhc *UserHistoryCreate) Exec(ctx context.Context) error { + _, err := uhc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uhc *UserHistoryCreate) ExecX(ctx context.Context) { + if err := uhc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uhc *UserHistoryCreate) defaults() { + if _, ok := uhc.mutation.HistoryTime(); !ok { + v := userhistory.DefaultHistoryTime() + uhc.mutation.SetHistoryTime(v) + } + if _, ok := uhc.mutation.CreatedAt(); !ok { + v := userhistory.DefaultCreatedAt() + uhc.mutation.SetCreatedAt(v) + } + if _, ok := uhc.mutation.UpdatedAt(); !ok { + v := userhistory.DefaultUpdatedAt() + uhc.mutation.SetUpdatedAt(v) + } + if _, ok := uhc.mutation.MappingID(); !ok { + v := userhistory.DefaultMappingID() + uhc.mutation.SetMappingID(v) + } + if _, ok := uhc.mutation.Tags(); !ok { + v := userhistory.DefaultTags + uhc.mutation.SetTags(v) + } + if _, ok := uhc.mutation.AuthProvider(); !ok { + v := userhistory.DefaultAuthProvider + uhc.mutation.SetAuthProvider(v) + } + if _, ok := uhc.mutation.Role(); !ok { + v := userhistory.DefaultRole + uhc.mutation.SetRole(v) + } + if _, ok := uhc.mutation.ID(); !ok { + v := userhistory.DefaultID() + uhc.mutation.SetID(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uhc *UserHistoryCreate) check() error { + if _, ok := uhc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "UserHistory.history_time"`)} + } + if _, ok := uhc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "UserHistory.operation"`)} + } + if v, ok := uhc.mutation.Operation(); ok { + if err := userhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "UserHistory.operation": %w`, err)} + } + } + if _, ok := uhc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "UserHistory.mapping_id"`)} + } + if _, ok := uhc.mutation.Email(); !ok { + return &ValidationError{Name: "email", err: errors.New(`generated: missing required field "UserHistory.email"`)} + } + if _, ok := uhc.mutation.DisplayName(); !ok { + return &ValidationError{Name: "display_name", err: errors.New(`generated: missing required field "UserHistory.display_name"`)} + } + if _, ok := uhc.mutation.AuthProvider(); !ok { + return &ValidationError{Name: "auth_provider", err: errors.New(`generated: missing required field "UserHistory.auth_provider"`)} + } + if v, ok := uhc.mutation.AuthProvider(); ok { + if err := userhistory.AuthProviderValidator(v); err != nil { + return &ValidationError{Name: "auth_provider", err: fmt.Errorf(`generated: validator failed for field "UserHistory.auth_provider": %w`, err)} + } + } + if v, ok := uhc.mutation.Role(); ok { + if err := userhistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "UserHistory.role": %w`, err)} + } + } + return nil +} + +func (uhc *UserHistoryCreate) sqlSave(ctx context.Context) (*UserHistory, error) { + if err := uhc.check(); err != nil { + return nil, err + } + _node, _spec := uhc.createSpec() + if err := sqlgraph.CreateNode(ctx, uhc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected UserHistory.ID type: %T", _spec.ID.Value) + } + } + uhc.mutation.id = &_node.ID + uhc.mutation.done = true + return _node, nil +} + +func (uhc *UserHistoryCreate) createSpec() (*UserHistory, *sqlgraph.CreateSpec) { + var ( + _node = &UserHistory{config: uhc.config} + _spec = sqlgraph.NewCreateSpec(userhistory.Table, sqlgraph.NewFieldSpec(userhistory.FieldID, field.TypeString)) + ) + _spec.Schema = uhc.schemaConfig.UserHistory + if id, ok := uhc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := uhc.mutation.HistoryTime(); ok { + _spec.SetField(userhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := uhc.mutation.Ref(); ok { + _spec.SetField(userhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := uhc.mutation.Operation(); ok { + _spec.SetField(userhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := uhc.mutation.CreatedAt(); ok { + _spec.SetField(userhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := uhc.mutation.UpdatedAt(); ok { + _spec.SetField(userhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := uhc.mutation.CreatedBy(); ok { + _spec.SetField(userhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := uhc.mutation.UpdatedBy(); ok { + _spec.SetField(userhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := uhc.mutation.DeletedAt(); ok { + _spec.SetField(userhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := uhc.mutation.DeletedBy(); ok { + _spec.SetField(userhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := uhc.mutation.MappingID(); ok { + _spec.SetField(userhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := uhc.mutation.Tags(); ok { + _spec.SetField(userhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := uhc.mutation.Email(); ok { + _spec.SetField(userhistory.FieldEmail, field.TypeString, value) + _node.Email = value + } + if value, ok := uhc.mutation.FirstName(); ok { + _spec.SetField(userhistory.FieldFirstName, field.TypeString, value) + _node.FirstName = value + } + if value, ok := uhc.mutation.LastName(); ok { + _spec.SetField(userhistory.FieldLastName, field.TypeString, value) + _node.LastName = value + } + if value, ok := uhc.mutation.DisplayName(); ok { + _spec.SetField(userhistory.FieldDisplayName, field.TypeString, value) + _node.DisplayName = value + } + if value, ok := uhc.mutation.AvatarRemoteURL(); ok { + _spec.SetField(userhistory.FieldAvatarRemoteURL, field.TypeString, value) + _node.AvatarRemoteURL = &value + } + if value, ok := uhc.mutation.AvatarLocalFile(); ok { + _spec.SetField(userhistory.FieldAvatarLocalFile, field.TypeString, value) + _node.AvatarLocalFile = &value + } + if value, ok := uhc.mutation.AvatarUpdatedAt(); ok { + _spec.SetField(userhistory.FieldAvatarUpdatedAt, field.TypeTime, value) + _node.AvatarUpdatedAt = &value + } + if value, ok := uhc.mutation.LastSeen(); ok { + _spec.SetField(userhistory.FieldLastSeen, field.TypeTime, value) + _node.LastSeen = &value + } + if value, ok := uhc.mutation.Password(); ok { + _spec.SetField(userhistory.FieldPassword, field.TypeString, value) + _node.Password = &value + } + if value, ok := uhc.mutation.Sub(); ok { + _spec.SetField(userhistory.FieldSub, field.TypeString, value) + _node.Sub = value + } + if value, ok := uhc.mutation.AuthProvider(); ok { + _spec.SetField(userhistory.FieldAuthProvider, field.TypeEnum, value) + _node.AuthProvider = value + } + if value, ok := uhc.mutation.Role(); ok { + _spec.SetField(userhistory.FieldRole, field.TypeEnum, value) + _node.Role = value + } + return _node, _spec +} + +// UserHistoryCreateBulk is the builder for creating many UserHistory entities in bulk. +type UserHistoryCreateBulk struct { + config + err error + builders []*UserHistoryCreate +} + +// Save creates the UserHistory entities in the database. +func (uhcb *UserHistoryCreateBulk) Save(ctx context.Context) ([]*UserHistory, error) { + if uhcb.err != nil { + return nil, uhcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(uhcb.builders)) + nodes := make([]*UserHistory, len(uhcb.builders)) + mutators := make([]Mutator, len(uhcb.builders)) + for i := range uhcb.builders { + func(i int, root context.Context) { + builder := uhcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*UserHistoryMutation) + 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, uhcb.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, uhcb.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, uhcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (uhcb *UserHistoryCreateBulk) SaveX(ctx context.Context) []*UserHistory { + v, err := uhcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (uhcb *UserHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := uhcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uhcb *UserHistoryCreateBulk) ExecX(ctx context.Context) { + if err := uhcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/userhistory_delete.go b/internal/ent/generated/userhistory_delete.go new file mode 100644 index 0000000..8b13871 --- /dev/null +++ b/internal/ent/generated/userhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/userhistory" +) + +// UserHistoryDelete is the builder for deleting a UserHistory entity. +type UserHistoryDelete struct { + config + hooks []Hook + mutation *UserHistoryMutation +} + +// Where appends a list predicates to the UserHistoryDelete builder. +func (uhd *UserHistoryDelete) Where(ps ...predicate.UserHistory) *UserHistoryDelete { + uhd.mutation.Where(ps...) + return uhd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (uhd *UserHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, uhd.sqlExec, uhd.mutation, uhd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (uhd *UserHistoryDelete) ExecX(ctx context.Context) int { + n, err := uhd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (uhd *UserHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(userhistory.Table, sqlgraph.NewFieldSpec(userhistory.FieldID, field.TypeString)) + _spec.Node.Schema = uhd.schemaConfig.UserHistory + ctx = internal.NewSchemaConfigContext(ctx, uhd.schemaConfig) + if ps := uhd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, uhd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + uhd.mutation.done = true + return affected, err +} + +// UserHistoryDeleteOne is the builder for deleting a single UserHistory entity. +type UserHistoryDeleteOne struct { + uhd *UserHistoryDelete +} + +// Where appends a list predicates to the UserHistoryDelete builder. +func (uhdo *UserHistoryDeleteOne) Where(ps ...predicate.UserHistory) *UserHistoryDeleteOne { + uhdo.uhd.mutation.Where(ps...) + return uhdo +} + +// Exec executes the deletion query. +func (uhdo *UserHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := uhdo.uhd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{userhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (uhdo *UserHistoryDeleteOne) ExecX(ctx context.Context) { + if err := uhdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/userhistory_query.go b/internal/ent/generated/userhistory_query.go new file mode 100644 index 0000000..bb594e7 --- /dev/null +++ b/internal/ent/generated/userhistory_query.go @@ -0,0 +1,549 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserHistoryQuery is the builder for querying UserHistory entities. +type UserHistoryQuery struct { + config + ctx *QueryContext + order []userhistory.OrderOption + inters []Interceptor + predicates []predicate.UserHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*UserHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the UserHistoryQuery builder. +func (uhq *UserHistoryQuery) Where(ps ...predicate.UserHistory) *UserHistoryQuery { + uhq.predicates = append(uhq.predicates, ps...) + return uhq +} + +// Limit the number of records to be returned by this query. +func (uhq *UserHistoryQuery) Limit(limit int) *UserHistoryQuery { + uhq.ctx.Limit = &limit + return uhq +} + +// Offset to start from. +func (uhq *UserHistoryQuery) Offset(offset int) *UserHistoryQuery { + uhq.ctx.Offset = &offset + return uhq +} + +// 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 (uhq *UserHistoryQuery) Unique(unique bool) *UserHistoryQuery { + uhq.ctx.Unique = &unique + return uhq +} + +// Order specifies how the records should be ordered. +func (uhq *UserHistoryQuery) Order(o ...userhistory.OrderOption) *UserHistoryQuery { + uhq.order = append(uhq.order, o...) + return uhq +} + +// First returns the first UserHistory entity from the query. +// Returns a *NotFoundError when no UserHistory was found. +func (uhq *UserHistoryQuery) First(ctx context.Context) (*UserHistory, error) { + nodes, err := uhq.Limit(1).All(setContextOp(ctx, uhq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{userhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (uhq *UserHistoryQuery) FirstX(ctx context.Context) *UserHistory { + node, err := uhq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first UserHistory ID from the query. +// Returns a *NotFoundError when no UserHistory ID was found. +func (uhq *UserHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = uhq.Limit(1).IDs(setContextOp(ctx, uhq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{userhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (uhq *UserHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := uhq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single UserHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one UserHistory entity is found. +// Returns a *NotFoundError when no UserHistory entities are found. +func (uhq *UserHistoryQuery) Only(ctx context.Context) (*UserHistory, error) { + nodes, err := uhq.Limit(2).All(setContextOp(ctx, uhq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{userhistory.Label} + default: + return nil, &NotSingularError{userhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (uhq *UserHistoryQuery) OnlyX(ctx context.Context) *UserHistory { + node, err := uhq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only UserHistory ID in the query. +// Returns a *NotSingularError when more than one UserHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (uhq *UserHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = uhq.Limit(2).IDs(setContextOp(ctx, uhq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{userhistory.Label} + default: + err = &NotSingularError{userhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (uhq *UserHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := uhq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of UserHistories. +func (uhq *UserHistoryQuery) All(ctx context.Context) ([]*UserHistory, error) { + ctx = setContextOp(ctx, uhq.ctx, ent.OpQueryAll) + if err := uhq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*UserHistory, *UserHistoryQuery]() + return withInterceptors[[]*UserHistory](ctx, uhq, qr, uhq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (uhq *UserHistoryQuery) AllX(ctx context.Context) []*UserHistory { + nodes, err := uhq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of UserHistory IDs. +func (uhq *UserHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if uhq.ctx.Unique == nil && uhq.path != nil { + uhq.Unique(true) + } + ctx = setContextOp(ctx, uhq.ctx, ent.OpQueryIDs) + if err = uhq.Select(userhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (uhq *UserHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := uhq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (uhq *UserHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, uhq.ctx, ent.OpQueryCount) + if err := uhq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, uhq, querierCount[*UserHistoryQuery](), uhq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (uhq *UserHistoryQuery) CountX(ctx context.Context) int { + count, err := uhq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (uhq *UserHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, uhq.ctx, ent.OpQueryExist) + switch _, err := uhq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (uhq *UserHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := uhq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the UserHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (uhq *UserHistoryQuery) Clone() *UserHistoryQuery { + if uhq == nil { + return nil + } + return &UserHistoryQuery{ + config: uhq.config, + ctx: uhq.ctx.Clone(), + order: append([]userhistory.OrderOption{}, uhq.order...), + inters: append([]Interceptor{}, uhq.inters...), + predicates: append([]predicate.UserHistory{}, uhq.predicates...), + // clone intermediate query. + sql: uhq.sql.Clone(), + path: uhq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.UserHistory.Query(). +// GroupBy(userhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (uhq *UserHistoryQuery) GroupBy(field string, fields ...string) *UserHistoryGroupBy { + uhq.ctx.Fields = append([]string{field}, fields...) + grbuild := &UserHistoryGroupBy{build: uhq} + grbuild.flds = &uhq.ctx.Fields + grbuild.label = userhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.UserHistory.Query(). +// Select(userhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (uhq *UserHistoryQuery) Select(fields ...string) *UserHistorySelect { + uhq.ctx.Fields = append(uhq.ctx.Fields, fields...) + sbuild := &UserHistorySelect{UserHistoryQuery: uhq} + sbuild.label = userhistory.Label + sbuild.flds, sbuild.scan = &uhq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a UserHistorySelect configured with the given aggregations. +func (uhq *UserHistoryQuery) Aggregate(fns ...AggregateFunc) *UserHistorySelect { + return uhq.Select().Aggregate(fns...) +} + +func (uhq *UserHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range uhq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, uhq); err != nil { + return err + } + } + } + for _, f := range uhq.ctx.Fields { + if !userhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if uhq.path != nil { + prev, err := uhq.path(ctx) + if err != nil { + return err + } + uhq.sql = prev + } + return nil +} + +func (uhq *UserHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*UserHistory, error) { + var ( + nodes = []*UserHistory{} + _spec = uhq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*UserHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &UserHistory{config: uhq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = uhq.schemaConfig.UserHistory + ctx = internal.NewSchemaConfigContext(ctx, uhq.schemaConfig) + if len(uhq.modifiers) > 0 { + _spec.Modifiers = uhq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, uhq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range uhq.loadTotal { + if err := uhq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (uhq *UserHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := uhq.querySpec() + _spec.Node.Schema = uhq.schemaConfig.UserHistory + ctx = internal.NewSchemaConfigContext(ctx, uhq.schemaConfig) + if len(uhq.modifiers) > 0 { + _spec.Modifiers = uhq.modifiers + } + _spec.Node.Columns = uhq.ctx.Fields + if len(uhq.ctx.Fields) > 0 { + _spec.Unique = uhq.ctx.Unique != nil && *uhq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, uhq.driver, _spec) +} + +func (uhq *UserHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(userhistory.Table, userhistory.Columns, sqlgraph.NewFieldSpec(userhistory.FieldID, field.TypeString)) + _spec.From = uhq.sql + if unique := uhq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if uhq.path != nil { + _spec.Unique = true + } + if fields := uhq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, userhistory.FieldID) + for i := range fields { + if fields[i] != userhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := uhq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := uhq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := uhq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := uhq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (uhq *UserHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(uhq.driver.Dialect()) + t1 := builder.Table(userhistory.Table) + columns := uhq.ctx.Fields + if len(columns) == 0 { + columns = userhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if uhq.sql != nil { + selector = uhq.sql + selector.Select(selector.Columns(columns...)...) + } + if uhq.ctx.Unique != nil && *uhq.ctx.Unique { + selector.Distinct() + } + t1.Schema(uhq.schemaConfig.UserHistory) + ctx = internal.NewSchemaConfigContext(ctx, uhq.schemaConfig) + selector.WithContext(ctx) + for _, p := range uhq.predicates { + p(selector) + } + for _, p := range uhq.order { + p(selector) + } + if offset := uhq.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 := uhq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// UserHistoryGroupBy is the group-by builder for UserHistory entities. +type UserHistoryGroupBy struct { + selector + build *UserHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (uhgb *UserHistoryGroupBy) Aggregate(fns ...AggregateFunc) *UserHistoryGroupBy { + uhgb.fns = append(uhgb.fns, fns...) + return uhgb +} + +// Scan applies the selector query and scans the result into the given value. +func (uhgb *UserHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, uhgb.build.ctx, ent.OpQueryGroupBy) + if err := uhgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserHistoryQuery, *UserHistoryGroupBy](ctx, uhgb.build, uhgb, uhgb.build.inters, v) +} + +func (uhgb *UserHistoryGroupBy) sqlScan(ctx context.Context, root *UserHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(uhgb.fns)) + for _, fn := range uhgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*uhgb.flds)+len(uhgb.fns)) + for _, f := range *uhgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*uhgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := uhgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// UserHistorySelect is the builder for selecting fields of UserHistory entities. +type UserHistorySelect struct { + *UserHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (uhs *UserHistorySelect) Aggregate(fns ...AggregateFunc) *UserHistorySelect { + uhs.fns = append(uhs.fns, fns...) + return uhs +} + +// Scan applies the selector query and scans the result into the given value. +func (uhs *UserHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, uhs.ctx, ent.OpQuerySelect) + if err := uhs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserHistoryQuery, *UserHistorySelect](ctx, uhs.UserHistoryQuery, uhs, uhs.inters, v) +} + +func (uhs *UserHistorySelect) sqlScan(ctx context.Context, root *UserHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(uhs.fns)) + for _, fn := range uhs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*uhs.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 := uhs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/userhistory_update.go b/internal/ent/generated/userhistory_update.go new file mode 100644 index 0000000..603ea63 --- /dev/null +++ b/internal/ent/generated/userhistory_update.go @@ -0,0 +1,1060 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/userhistory" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserHistoryUpdate is the builder for updating UserHistory entities. +type UserHistoryUpdate struct { + config + hooks []Hook + mutation *UserHistoryMutation +} + +// Where appends a list predicates to the UserHistoryUpdate builder. +func (uhu *UserHistoryUpdate) Where(ps ...predicate.UserHistory) *UserHistoryUpdate { + uhu.mutation.Where(ps...) + return uhu +} + +// SetUpdatedAt sets the "updated_at" field. +func (uhu *UserHistoryUpdate) SetUpdatedAt(t time.Time) *UserHistoryUpdate { + uhu.mutation.SetUpdatedAt(t) + return uhu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (uhu *UserHistoryUpdate) ClearUpdatedAt() *UserHistoryUpdate { + uhu.mutation.ClearUpdatedAt() + return uhu +} + +// SetUpdatedBy sets the "updated_by" field. +func (uhu *UserHistoryUpdate) SetUpdatedBy(s string) *UserHistoryUpdate { + uhu.mutation.SetUpdatedBy(s) + return uhu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableUpdatedBy(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetUpdatedBy(*s) + } + return uhu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (uhu *UserHistoryUpdate) ClearUpdatedBy() *UserHistoryUpdate { + uhu.mutation.ClearUpdatedBy() + return uhu +} + +// SetDeletedAt sets the "deleted_at" field. +func (uhu *UserHistoryUpdate) SetDeletedAt(t time.Time) *UserHistoryUpdate { + uhu.mutation.SetDeletedAt(t) + return uhu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableDeletedAt(t *time.Time) *UserHistoryUpdate { + if t != nil { + uhu.SetDeletedAt(*t) + } + return uhu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (uhu *UserHistoryUpdate) ClearDeletedAt() *UserHistoryUpdate { + uhu.mutation.ClearDeletedAt() + return uhu +} + +// SetDeletedBy sets the "deleted_by" field. +func (uhu *UserHistoryUpdate) SetDeletedBy(s string) *UserHistoryUpdate { + uhu.mutation.SetDeletedBy(s) + return uhu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableDeletedBy(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetDeletedBy(*s) + } + return uhu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (uhu *UserHistoryUpdate) ClearDeletedBy() *UserHistoryUpdate { + uhu.mutation.ClearDeletedBy() + return uhu +} + +// SetTags sets the "tags" field. +func (uhu *UserHistoryUpdate) SetTags(s []string) *UserHistoryUpdate { + uhu.mutation.SetTags(s) + return uhu +} + +// AppendTags appends s to the "tags" field. +func (uhu *UserHistoryUpdate) AppendTags(s []string) *UserHistoryUpdate { + uhu.mutation.AppendTags(s) + return uhu +} + +// ClearTags clears the value of the "tags" field. +func (uhu *UserHistoryUpdate) ClearTags() *UserHistoryUpdate { + uhu.mutation.ClearTags() + return uhu +} + +// SetEmail sets the "email" field. +func (uhu *UserHistoryUpdate) SetEmail(s string) *UserHistoryUpdate { + uhu.mutation.SetEmail(s) + return uhu +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableEmail(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetEmail(*s) + } + return uhu +} + +// SetFirstName sets the "first_name" field. +func (uhu *UserHistoryUpdate) SetFirstName(s string) *UserHistoryUpdate { + uhu.mutation.SetFirstName(s) + return uhu +} + +// SetNillableFirstName sets the "first_name" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableFirstName(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetFirstName(*s) + } + return uhu +} + +// ClearFirstName clears the value of the "first_name" field. +func (uhu *UserHistoryUpdate) ClearFirstName() *UserHistoryUpdate { + uhu.mutation.ClearFirstName() + return uhu +} + +// SetLastName sets the "last_name" field. +func (uhu *UserHistoryUpdate) SetLastName(s string) *UserHistoryUpdate { + uhu.mutation.SetLastName(s) + return uhu +} + +// SetNillableLastName sets the "last_name" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableLastName(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetLastName(*s) + } + return uhu +} + +// ClearLastName clears the value of the "last_name" field. +func (uhu *UserHistoryUpdate) ClearLastName() *UserHistoryUpdate { + uhu.mutation.ClearLastName() + return uhu +} + +// SetDisplayName sets the "display_name" field. +func (uhu *UserHistoryUpdate) SetDisplayName(s string) *UserHistoryUpdate { + uhu.mutation.SetDisplayName(s) + return uhu +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableDisplayName(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetDisplayName(*s) + } + return uhu +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (uhu *UserHistoryUpdate) SetAvatarRemoteURL(s string) *UserHistoryUpdate { + uhu.mutation.SetAvatarRemoteURL(s) + return uhu +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableAvatarRemoteURL(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetAvatarRemoteURL(*s) + } + return uhu +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (uhu *UserHistoryUpdate) ClearAvatarRemoteURL() *UserHistoryUpdate { + uhu.mutation.ClearAvatarRemoteURL() + return uhu +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (uhu *UserHistoryUpdate) SetAvatarLocalFile(s string) *UserHistoryUpdate { + uhu.mutation.SetAvatarLocalFile(s) + return uhu +} + +// SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableAvatarLocalFile(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetAvatarLocalFile(*s) + } + return uhu +} + +// ClearAvatarLocalFile clears the value of the "avatar_local_file" field. +func (uhu *UserHistoryUpdate) ClearAvatarLocalFile() *UserHistoryUpdate { + uhu.mutation.ClearAvatarLocalFile() + return uhu +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (uhu *UserHistoryUpdate) SetAvatarUpdatedAt(t time.Time) *UserHistoryUpdate { + uhu.mutation.SetAvatarUpdatedAt(t) + return uhu +} + +// ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field. +func (uhu *UserHistoryUpdate) ClearAvatarUpdatedAt() *UserHistoryUpdate { + uhu.mutation.ClearAvatarUpdatedAt() + return uhu +} + +// SetLastSeen sets the "last_seen" field. +func (uhu *UserHistoryUpdate) SetLastSeen(t time.Time) *UserHistoryUpdate { + uhu.mutation.SetLastSeen(t) + return uhu +} + +// ClearLastSeen clears the value of the "last_seen" field. +func (uhu *UserHistoryUpdate) ClearLastSeen() *UserHistoryUpdate { + uhu.mutation.ClearLastSeen() + return uhu +} + +// SetPassword sets the "password" field. +func (uhu *UserHistoryUpdate) SetPassword(s string) *UserHistoryUpdate { + uhu.mutation.SetPassword(s) + return uhu +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillablePassword(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetPassword(*s) + } + return uhu +} + +// ClearPassword clears the value of the "password" field. +func (uhu *UserHistoryUpdate) ClearPassword() *UserHistoryUpdate { + uhu.mutation.ClearPassword() + return uhu +} + +// SetSub sets the "sub" field. +func (uhu *UserHistoryUpdate) SetSub(s string) *UserHistoryUpdate { + uhu.mutation.SetSub(s) + return uhu +} + +// SetNillableSub sets the "sub" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableSub(s *string) *UserHistoryUpdate { + if s != nil { + uhu.SetSub(*s) + } + return uhu +} + +// ClearSub clears the value of the "sub" field. +func (uhu *UserHistoryUpdate) ClearSub() *UserHistoryUpdate { + uhu.mutation.ClearSub() + return uhu +} + +// SetAuthProvider sets the "auth_provider" field. +func (uhu *UserHistoryUpdate) SetAuthProvider(ep enums.AuthProvider) *UserHistoryUpdate { + uhu.mutation.SetAuthProvider(ep) + return uhu +} + +// SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableAuthProvider(ep *enums.AuthProvider) *UserHistoryUpdate { + if ep != nil { + uhu.SetAuthProvider(*ep) + } + return uhu +} + +// SetRole sets the "role" field. +func (uhu *UserHistoryUpdate) SetRole(e enums.Role) *UserHistoryUpdate { + uhu.mutation.SetRole(e) + return uhu +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (uhu *UserHistoryUpdate) SetNillableRole(e *enums.Role) *UserHistoryUpdate { + if e != nil { + uhu.SetRole(*e) + } + return uhu +} + +// ClearRole clears the value of the "role" field. +func (uhu *UserHistoryUpdate) ClearRole() *UserHistoryUpdate { + uhu.mutation.ClearRole() + return uhu +} + +// Mutation returns the UserHistoryMutation object of the builder. +func (uhu *UserHistoryUpdate) Mutation() *UserHistoryMutation { + return uhu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (uhu *UserHistoryUpdate) Save(ctx context.Context) (int, error) { + uhu.defaults() + return withHooks(ctx, uhu.sqlSave, uhu.mutation, uhu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uhu *UserHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := uhu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (uhu *UserHistoryUpdate) Exec(ctx context.Context) error { + _, err := uhu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uhu *UserHistoryUpdate) ExecX(ctx context.Context) { + if err := uhu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uhu *UserHistoryUpdate) defaults() { + if _, ok := uhu.mutation.UpdatedAt(); !ok && !uhu.mutation.UpdatedAtCleared() { + v := userhistory.UpdateDefaultUpdatedAt() + uhu.mutation.SetUpdatedAt(v) + } + if _, ok := uhu.mutation.AvatarUpdatedAt(); !ok && !uhu.mutation.AvatarUpdatedAtCleared() { + v := userhistory.UpdateDefaultAvatarUpdatedAt() + uhu.mutation.SetAvatarUpdatedAt(v) + } + if _, ok := uhu.mutation.LastSeen(); !ok && !uhu.mutation.LastSeenCleared() { + v := userhistory.UpdateDefaultLastSeen() + uhu.mutation.SetLastSeen(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uhu *UserHistoryUpdate) check() error { + if v, ok := uhu.mutation.AuthProvider(); ok { + if err := userhistory.AuthProviderValidator(v); err != nil { + return &ValidationError{Name: "auth_provider", err: fmt.Errorf(`generated: validator failed for field "UserHistory.auth_provider": %w`, err)} + } + } + if v, ok := uhu.mutation.Role(); ok { + if err := userhistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "UserHistory.role": %w`, err)} + } + } + return nil +} + +func (uhu *UserHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := uhu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(userhistory.Table, userhistory.Columns, sqlgraph.NewFieldSpec(userhistory.FieldID, field.TypeString)) + if ps := uhu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if uhu.mutation.RefCleared() { + _spec.ClearField(userhistory.FieldRef, field.TypeString) + } + if uhu.mutation.CreatedAtCleared() { + _spec.ClearField(userhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := uhu.mutation.UpdatedAt(); ok { + _spec.SetField(userhistory.FieldUpdatedAt, field.TypeTime, value) + } + if uhu.mutation.UpdatedAtCleared() { + _spec.ClearField(userhistory.FieldUpdatedAt, field.TypeTime) + } + if uhu.mutation.CreatedByCleared() { + _spec.ClearField(userhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := uhu.mutation.UpdatedBy(); ok { + _spec.SetField(userhistory.FieldUpdatedBy, field.TypeString, value) + } + if uhu.mutation.UpdatedByCleared() { + _spec.ClearField(userhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := uhu.mutation.DeletedAt(); ok { + _spec.SetField(userhistory.FieldDeletedAt, field.TypeTime, value) + } + if uhu.mutation.DeletedAtCleared() { + _spec.ClearField(userhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := uhu.mutation.DeletedBy(); ok { + _spec.SetField(userhistory.FieldDeletedBy, field.TypeString, value) + } + if uhu.mutation.DeletedByCleared() { + _spec.ClearField(userhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := uhu.mutation.Tags(); ok { + _spec.SetField(userhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := uhu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, userhistory.FieldTags, value) + }) + } + if uhu.mutation.TagsCleared() { + _spec.ClearField(userhistory.FieldTags, field.TypeJSON) + } + if value, ok := uhu.mutation.Email(); ok { + _spec.SetField(userhistory.FieldEmail, field.TypeString, value) + } + if value, ok := uhu.mutation.FirstName(); ok { + _spec.SetField(userhistory.FieldFirstName, field.TypeString, value) + } + if uhu.mutation.FirstNameCleared() { + _spec.ClearField(userhistory.FieldFirstName, field.TypeString) + } + if value, ok := uhu.mutation.LastName(); ok { + _spec.SetField(userhistory.FieldLastName, field.TypeString, value) + } + if uhu.mutation.LastNameCleared() { + _spec.ClearField(userhistory.FieldLastName, field.TypeString) + } + if value, ok := uhu.mutation.DisplayName(); ok { + _spec.SetField(userhistory.FieldDisplayName, field.TypeString, value) + } + if value, ok := uhu.mutation.AvatarRemoteURL(); ok { + _spec.SetField(userhistory.FieldAvatarRemoteURL, field.TypeString, value) + } + if uhu.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(userhistory.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := uhu.mutation.AvatarLocalFile(); ok { + _spec.SetField(userhistory.FieldAvatarLocalFile, field.TypeString, value) + } + if uhu.mutation.AvatarLocalFileCleared() { + _spec.ClearField(userhistory.FieldAvatarLocalFile, field.TypeString) + } + if value, ok := uhu.mutation.AvatarUpdatedAt(); ok { + _spec.SetField(userhistory.FieldAvatarUpdatedAt, field.TypeTime, value) + } + if uhu.mutation.AvatarUpdatedAtCleared() { + _spec.ClearField(userhistory.FieldAvatarUpdatedAt, field.TypeTime) + } + if value, ok := uhu.mutation.LastSeen(); ok { + _spec.SetField(userhistory.FieldLastSeen, field.TypeTime, value) + } + if uhu.mutation.LastSeenCleared() { + _spec.ClearField(userhistory.FieldLastSeen, field.TypeTime) + } + if value, ok := uhu.mutation.Password(); ok { + _spec.SetField(userhistory.FieldPassword, field.TypeString, value) + } + if uhu.mutation.PasswordCleared() { + _spec.ClearField(userhistory.FieldPassword, field.TypeString) + } + if value, ok := uhu.mutation.Sub(); ok { + _spec.SetField(userhistory.FieldSub, field.TypeString, value) + } + if uhu.mutation.SubCleared() { + _spec.ClearField(userhistory.FieldSub, field.TypeString) + } + if value, ok := uhu.mutation.AuthProvider(); ok { + _spec.SetField(userhistory.FieldAuthProvider, field.TypeEnum, value) + } + if value, ok := uhu.mutation.Role(); ok { + _spec.SetField(userhistory.FieldRole, field.TypeEnum, value) + } + if uhu.mutation.RoleCleared() { + _spec.ClearField(userhistory.FieldRole, field.TypeEnum) + } + _spec.Node.Schema = uhu.schemaConfig.UserHistory + ctx = internal.NewSchemaConfigContext(ctx, uhu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, uhu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{userhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + uhu.mutation.done = true + return n, nil +} + +// UserHistoryUpdateOne is the builder for updating a single UserHistory entity. +type UserHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *UserHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (uhuo *UserHistoryUpdateOne) SetUpdatedAt(t time.Time) *UserHistoryUpdateOne { + uhuo.mutation.SetUpdatedAt(t) + return uhuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (uhuo *UserHistoryUpdateOne) ClearUpdatedAt() *UserHistoryUpdateOne { + uhuo.mutation.ClearUpdatedAt() + return uhuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (uhuo *UserHistoryUpdateOne) SetUpdatedBy(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetUpdatedBy(s) + return uhuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableUpdatedBy(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetUpdatedBy(*s) + } + return uhuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (uhuo *UserHistoryUpdateOne) ClearUpdatedBy() *UserHistoryUpdateOne { + uhuo.mutation.ClearUpdatedBy() + return uhuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (uhuo *UserHistoryUpdateOne) SetDeletedAt(t time.Time) *UserHistoryUpdateOne { + uhuo.mutation.SetDeletedAt(t) + return uhuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *UserHistoryUpdateOne { + if t != nil { + uhuo.SetDeletedAt(*t) + } + return uhuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (uhuo *UserHistoryUpdateOne) ClearDeletedAt() *UserHistoryUpdateOne { + uhuo.mutation.ClearDeletedAt() + return uhuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (uhuo *UserHistoryUpdateOne) SetDeletedBy(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetDeletedBy(s) + return uhuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableDeletedBy(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetDeletedBy(*s) + } + return uhuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (uhuo *UserHistoryUpdateOne) ClearDeletedBy() *UserHistoryUpdateOne { + uhuo.mutation.ClearDeletedBy() + return uhuo +} + +// SetTags sets the "tags" field. +func (uhuo *UserHistoryUpdateOne) SetTags(s []string) *UserHistoryUpdateOne { + uhuo.mutation.SetTags(s) + return uhuo +} + +// AppendTags appends s to the "tags" field. +func (uhuo *UserHistoryUpdateOne) AppendTags(s []string) *UserHistoryUpdateOne { + uhuo.mutation.AppendTags(s) + return uhuo +} + +// ClearTags clears the value of the "tags" field. +func (uhuo *UserHistoryUpdateOne) ClearTags() *UserHistoryUpdateOne { + uhuo.mutation.ClearTags() + return uhuo +} + +// SetEmail sets the "email" field. +func (uhuo *UserHistoryUpdateOne) SetEmail(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetEmail(s) + return uhuo +} + +// SetNillableEmail sets the "email" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableEmail(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetEmail(*s) + } + return uhuo +} + +// SetFirstName sets the "first_name" field. +func (uhuo *UserHistoryUpdateOne) SetFirstName(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetFirstName(s) + return uhuo +} + +// SetNillableFirstName sets the "first_name" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableFirstName(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetFirstName(*s) + } + return uhuo +} + +// ClearFirstName clears the value of the "first_name" field. +func (uhuo *UserHistoryUpdateOne) ClearFirstName() *UserHistoryUpdateOne { + uhuo.mutation.ClearFirstName() + return uhuo +} + +// SetLastName sets the "last_name" field. +func (uhuo *UserHistoryUpdateOne) SetLastName(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetLastName(s) + return uhuo +} + +// SetNillableLastName sets the "last_name" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableLastName(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetLastName(*s) + } + return uhuo +} + +// ClearLastName clears the value of the "last_name" field. +func (uhuo *UserHistoryUpdateOne) ClearLastName() *UserHistoryUpdateOne { + uhuo.mutation.ClearLastName() + return uhuo +} + +// SetDisplayName sets the "display_name" field. +func (uhuo *UserHistoryUpdateOne) SetDisplayName(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetDisplayName(s) + return uhuo +} + +// SetNillableDisplayName sets the "display_name" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableDisplayName(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetDisplayName(*s) + } + return uhuo +} + +// SetAvatarRemoteURL sets the "avatar_remote_url" field. +func (uhuo *UserHistoryUpdateOne) SetAvatarRemoteURL(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetAvatarRemoteURL(s) + return uhuo +} + +// SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableAvatarRemoteURL(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetAvatarRemoteURL(*s) + } + return uhuo +} + +// ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field. +func (uhuo *UserHistoryUpdateOne) ClearAvatarRemoteURL() *UserHistoryUpdateOne { + uhuo.mutation.ClearAvatarRemoteURL() + return uhuo +} + +// SetAvatarLocalFile sets the "avatar_local_file" field. +func (uhuo *UserHistoryUpdateOne) SetAvatarLocalFile(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetAvatarLocalFile(s) + return uhuo +} + +// SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableAvatarLocalFile(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetAvatarLocalFile(*s) + } + return uhuo +} + +// ClearAvatarLocalFile clears the value of the "avatar_local_file" field. +func (uhuo *UserHistoryUpdateOne) ClearAvatarLocalFile() *UserHistoryUpdateOne { + uhuo.mutation.ClearAvatarLocalFile() + return uhuo +} + +// SetAvatarUpdatedAt sets the "avatar_updated_at" field. +func (uhuo *UserHistoryUpdateOne) SetAvatarUpdatedAt(t time.Time) *UserHistoryUpdateOne { + uhuo.mutation.SetAvatarUpdatedAt(t) + return uhuo +} + +// ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field. +func (uhuo *UserHistoryUpdateOne) ClearAvatarUpdatedAt() *UserHistoryUpdateOne { + uhuo.mutation.ClearAvatarUpdatedAt() + return uhuo +} + +// SetLastSeen sets the "last_seen" field. +func (uhuo *UserHistoryUpdateOne) SetLastSeen(t time.Time) *UserHistoryUpdateOne { + uhuo.mutation.SetLastSeen(t) + return uhuo +} + +// ClearLastSeen clears the value of the "last_seen" field. +func (uhuo *UserHistoryUpdateOne) ClearLastSeen() *UserHistoryUpdateOne { + uhuo.mutation.ClearLastSeen() + return uhuo +} + +// SetPassword sets the "password" field. +func (uhuo *UserHistoryUpdateOne) SetPassword(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetPassword(s) + return uhuo +} + +// SetNillablePassword sets the "password" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillablePassword(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetPassword(*s) + } + return uhuo +} + +// ClearPassword clears the value of the "password" field. +func (uhuo *UserHistoryUpdateOne) ClearPassword() *UserHistoryUpdateOne { + uhuo.mutation.ClearPassword() + return uhuo +} + +// SetSub sets the "sub" field. +func (uhuo *UserHistoryUpdateOne) SetSub(s string) *UserHistoryUpdateOne { + uhuo.mutation.SetSub(s) + return uhuo +} + +// SetNillableSub sets the "sub" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableSub(s *string) *UserHistoryUpdateOne { + if s != nil { + uhuo.SetSub(*s) + } + return uhuo +} + +// ClearSub clears the value of the "sub" field. +func (uhuo *UserHistoryUpdateOne) ClearSub() *UserHistoryUpdateOne { + uhuo.mutation.ClearSub() + return uhuo +} + +// SetAuthProvider sets the "auth_provider" field. +func (uhuo *UserHistoryUpdateOne) SetAuthProvider(ep enums.AuthProvider) *UserHistoryUpdateOne { + uhuo.mutation.SetAuthProvider(ep) + return uhuo +} + +// SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableAuthProvider(ep *enums.AuthProvider) *UserHistoryUpdateOne { + if ep != nil { + uhuo.SetAuthProvider(*ep) + } + return uhuo +} + +// SetRole sets the "role" field. +func (uhuo *UserHistoryUpdateOne) SetRole(e enums.Role) *UserHistoryUpdateOne { + uhuo.mutation.SetRole(e) + return uhuo +} + +// SetNillableRole sets the "role" field if the given value is not nil. +func (uhuo *UserHistoryUpdateOne) SetNillableRole(e *enums.Role) *UserHistoryUpdateOne { + if e != nil { + uhuo.SetRole(*e) + } + return uhuo +} + +// ClearRole clears the value of the "role" field. +func (uhuo *UserHistoryUpdateOne) ClearRole() *UserHistoryUpdateOne { + uhuo.mutation.ClearRole() + return uhuo +} + +// Mutation returns the UserHistoryMutation object of the builder. +func (uhuo *UserHistoryUpdateOne) Mutation() *UserHistoryMutation { + return uhuo.mutation +} + +// Where appends a list predicates to the UserHistoryUpdate builder. +func (uhuo *UserHistoryUpdateOne) Where(ps ...predicate.UserHistory) *UserHistoryUpdateOne { + uhuo.mutation.Where(ps...) + return uhuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (uhuo *UserHistoryUpdateOne) Select(field string, fields ...string) *UserHistoryUpdateOne { + uhuo.fields = append([]string{field}, fields...) + return uhuo +} + +// Save executes the query and returns the updated UserHistory entity. +func (uhuo *UserHistoryUpdateOne) Save(ctx context.Context) (*UserHistory, error) { + uhuo.defaults() + return withHooks(ctx, uhuo.sqlSave, uhuo.mutation, uhuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (uhuo *UserHistoryUpdateOne) SaveX(ctx context.Context) *UserHistory { + node, err := uhuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (uhuo *UserHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := uhuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uhuo *UserHistoryUpdateOne) ExecX(ctx context.Context) { + if err := uhuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (uhuo *UserHistoryUpdateOne) defaults() { + if _, ok := uhuo.mutation.UpdatedAt(); !ok && !uhuo.mutation.UpdatedAtCleared() { + v := userhistory.UpdateDefaultUpdatedAt() + uhuo.mutation.SetUpdatedAt(v) + } + if _, ok := uhuo.mutation.AvatarUpdatedAt(); !ok && !uhuo.mutation.AvatarUpdatedAtCleared() { + v := userhistory.UpdateDefaultAvatarUpdatedAt() + uhuo.mutation.SetAvatarUpdatedAt(v) + } + if _, ok := uhuo.mutation.LastSeen(); !ok && !uhuo.mutation.LastSeenCleared() { + v := userhistory.UpdateDefaultLastSeen() + uhuo.mutation.SetLastSeen(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (uhuo *UserHistoryUpdateOne) check() error { + if v, ok := uhuo.mutation.AuthProvider(); ok { + if err := userhistory.AuthProviderValidator(v); err != nil { + return &ValidationError{Name: "auth_provider", err: fmt.Errorf(`generated: validator failed for field "UserHistory.auth_provider": %w`, err)} + } + } + if v, ok := uhuo.mutation.Role(); ok { + if err := userhistory.RoleValidator(v); err != nil { + return &ValidationError{Name: "role", err: fmt.Errorf(`generated: validator failed for field "UserHistory.role": %w`, err)} + } + } + return nil +} + +func (uhuo *UserHistoryUpdateOne) sqlSave(ctx context.Context) (_node *UserHistory, err error) { + if err := uhuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(userhistory.Table, userhistory.Columns, sqlgraph.NewFieldSpec(userhistory.FieldID, field.TypeString)) + id, ok := uhuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "UserHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := uhuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, userhistory.FieldID) + for _, f := range fields { + if !userhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != userhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := uhuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if uhuo.mutation.RefCleared() { + _spec.ClearField(userhistory.FieldRef, field.TypeString) + } + if uhuo.mutation.CreatedAtCleared() { + _spec.ClearField(userhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := uhuo.mutation.UpdatedAt(); ok { + _spec.SetField(userhistory.FieldUpdatedAt, field.TypeTime, value) + } + if uhuo.mutation.UpdatedAtCleared() { + _spec.ClearField(userhistory.FieldUpdatedAt, field.TypeTime) + } + if uhuo.mutation.CreatedByCleared() { + _spec.ClearField(userhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := uhuo.mutation.UpdatedBy(); ok { + _spec.SetField(userhistory.FieldUpdatedBy, field.TypeString, value) + } + if uhuo.mutation.UpdatedByCleared() { + _spec.ClearField(userhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := uhuo.mutation.DeletedAt(); ok { + _spec.SetField(userhistory.FieldDeletedAt, field.TypeTime, value) + } + if uhuo.mutation.DeletedAtCleared() { + _spec.ClearField(userhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := uhuo.mutation.DeletedBy(); ok { + _spec.SetField(userhistory.FieldDeletedBy, field.TypeString, value) + } + if uhuo.mutation.DeletedByCleared() { + _spec.ClearField(userhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := uhuo.mutation.Tags(); ok { + _spec.SetField(userhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := uhuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, userhistory.FieldTags, value) + }) + } + if uhuo.mutation.TagsCleared() { + _spec.ClearField(userhistory.FieldTags, field.TypeJSON) + } + if value, ok := uhuo.mutation.Email(); ok { + _spec.SetField(userhistory.FieldEmail, field.TypeString, value) + } + if value, ok := uhuo.mutation.FirstName(); ok { + _spec.SetField(userhistory.FieldFirstName, field.TypeString, value) + } + if uhuo.mutation.FirstNameCleared() { + _spec.ClearField(userhistory.FieldFirstName, field.TypeString) + } + if value, ok := uhuo.mutation.LastName(); ok { + _spec.SetField(userhistory.FieldLastName, field.TypeString, value) + } + if uhuo.mutation.LastNameCleared() { + _spec.ClearField(userhistory.FieldLastName, field.TypeString) + } + if value, ok := uhuo.mutation.DisplayName(); ok { + _spec.SetField(userhistory.FieldDisplayName, field.TypeString, value) + } + if value, ok := uhuo.mutation.AvatarRemoteURL(); ok { + _spec.SetField(userhistory.FieldAvatarRemoteURL, field.TypeString, value) + } + if uhuo.mutation.AvatarRemoteURLCleared() { + _spec.ClearField(userhistory.FieldAvatarRemoteURL, field.TypeString) + } + if value, ok := uhuo.mutation.AvatarLocalFile(); ok { + _spec.SetField(userhistory.FieldAvatarLocalFile, field.TypeString, value) + } + if uhuo.mutation.AvatarLocalFileCleared() { + _spec.ClearField(userhistory.FieldAvatarLocalFile, field.TypeString) + } + if value, ok := uhuo.mutation.AvatarUpdatedAt(); ok { + _spec.SetField(userhistory.FieldAvatarUpdatedAt, field.TypeTime, value) + } + if uhuo.mutation.AvatarUpdatedAtCleared() { + _spec.ClearField(userhistory.FieldAvatarUpdatedAt, field.TypeTime) + } + if value, ok := uhuo.mutation.LastSeen(); ok { + _spec.SetField(userhistory.FieldLastSeen, field.TypeTime, value) + } + if uhuo.mutation.LastSeenCleared() { + _spec.ClearField(userhistory.FieldLastSeen, field.TypeTime) + } + if value, ok := uhuo.mutation.Password(); ok { + _spec.SetField(userhistory.FieldPassword, field.TypeString, value) + } + if uhuo.mutation.PasswordCleared() { + _spec.ClearField(userhistory.FieldPassword, field.TypeString) + } + if value, ok := uhuo.mutation.Sub(); ok { + _spec.SetField(userhistory.FieldSub, field.TypeString, value) + } + if uhuo.mutation.SubCleared() { + _spec.ClearField(userhistory.FieldSub, field.TypeString) + } + if value, ok := uhuo.mutation.AuthProvider(); ok { + _spec.SetField(userhistory.FieldAuthProvider, field.TypeEnum, value) + } + if value, ok := uhuo.mutation.Role(); ok { + _spec.SetField(userhistory.FieldRole, field.TypeEnum, value) + } + if uhuo.mutation.RoleCleared() { + _spec.ClearField(userhistory.FieldRole, field.TypeEnum) + } + _spec.Node.Schema = uhuo.schemaConfig.UserHistory + ctx = internal.NewSchemaConfigContext(ctx, uhuo.schemaConfig) + _node = &UserHistory{config: uhuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, uhuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{userhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + uhuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/usersetting.go b/internal/ent/generated/usersetting.go new file mode 100644 index 0000000..b7ebc19 --- /dev/null +++ b/internal/ent/generated/usersetting.go @@ -0,0 +1,357 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/pkg/enums" +) + +// UserSetting is the model entity for the UserSetting schema. +type UserSetting struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // UserID holds the value of the "user_id" field. + UserID string `json:"user_id,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked bool `json:"locked,omitempty"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silenced_at,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspended_at,omitempty"` + // status of the user account + Status enums.UserStatus `json:"status,omitempty"` + // whether the user has confirmed their email address + EmailConfirmed bool `json:"email_confirmed,omitempty"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed bool `json:"is_webauthn_allowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled bool `json:"is_tfa_enabled,omitempty"` + // phone number associated with the account, used 2factor SMS authentication + PhoneNumber *string `json:"phone_number,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the UserSettingQuery when eager-loading is set. + Edges UserSettingEdges `json:"edges"` + user_setting_default_org *string + selectValues sql.SelectValues +} + +// UserSettingEdges holds the relations/edges for other nodes in the graph. +type UserSettingEdges struct { + // User holds the value of the user edge. + User *User `json:"user,omitempty"` + // organization to load on user login + DefaultOrg *Organization `json:"default_org,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [2]bool + // totalCount holds the count of the edges above. + totalCount [2]map[string]int +} + +// UserOrErr returns the User value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e UserSettingEdges) UserOrErr() (*User, error) { + if e.User != nil { + return e.User, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "user"} +} + +// DefaultOrgOrErr returns the DefaultOrg value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e UserSettingEdges) DefaultOrgOrErr() (*Organization, error) { + if e.DefaultOrg != nil { + return e.DefaultOrg, nil + } else if e.loadedTypes[1] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "default_org"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*UserSetting) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case usersetting.FieldTags: + values[i] = new([]byte) + case usersetting.FieldLocked, usersetting.FieldEmailConfirmed, usersetting.FieldIsWebauthnAllowed, usersetting.FieldIsTfaEnabled: + values[i] = new(sql.NullBool) + case usersetting.FieldID, usersetting.FieldCreatedBy, usersetting.FieldUpdatedBy, usersetting.FieldMappingID, usersetting.FieldDeletedBy, usersetting.FieldUserID, usersetting.FieldStatus, usersetting.FieldPhoneNumber: + values[i] = new(sql.NullString) + case usersetting.FieldCreatedAt, usersetting.FieldUpdatedAt, usersetting.FieldDeletedAt, usersetting.FieldSilencedAt, usersetting.FieldSuspendedAt: + values[i] = new(sql.NullTime) + case usersetting.ForeignKeys[0]: // user_setting_default_org + values[i] = new(sql.NullString) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the UserSetting fields. +func (us *UserSetting) 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 usersetting.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + us.ID = value.String + } + case usersetting.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + us.CreatedAt = value.Time + } + case usersetting.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + us.UpdatedAt = value.Time + } + case usersetting.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + us.CreatedBy = value.String + } + case usersetting.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + us.UpdatedBy = value.String + } + case usersetting.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + us.MappingID = value.String + } + case usersetting.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &us.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case usersetting.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + us.DeletedAt = value.Time + } + case usersetting.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + us.DeletedBy = value.String + } + case usersetting.FieldUserID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_id", values[i]) + } else if value.Valid { + us.UserID = value.String + } + case usersetting.FieldLocked: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field locked", values[i]) + } else if value.Valid { + us.Locked = value.Bool + } + case usersetting.FieldSilencedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field silenced_at", values[i]) + } else if value.Valid { + us.SilencedAt = new(time.Time) + *us.SilencedAt = value.Time + } + case usersetting.FieldSuspendedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field suspended_at", values[i]) + } else if value.Valid { + us.SuspendedAt = new(time.Time) + *us.SuspendedAt = value.Time + } + case usersetting.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + us.Status = enums.UserStatus(value.String) + } + case usersetting.FieldEmailConfirmed: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field email_confirmed", values[i]) + } else if value.Valid { + us.EmailConfirmed = value.Bool + } + case usersetting.FieldIsWebauthnAllowed: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field is_webauthn_allowed", values[i]) + } else if value.Valid { + us.IsWebauthnAllowed = value.Bool + } + case usersetting.FieldIsTfaEnabled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field is_tfa_enabled", values[i]) + } else if value.Valid { + us.IsTfaEnabled = value.Bool + } + case usersetting.FieldPhoneNumber: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field phone_number", values[i]) + } else if value.Valid { + us.PhoneNumber = new(string) + *us.PhoneNumber = value.String + } + case usersetting.ForeignKeys[0]: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_setting_default_org", values[i]) + } else if value.Valid { + us.user_setting_default_org = new(string) + *us.user_setting_default_org = value.String + } + default: + us.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the UserSetting. +// This includes values selected through modifiers, order, etc. +func (us *UserSetting) Value(name string) (ent.Value, error) { + return us.selectValues.Get(name) +} + +// QueryUser queries the "user" edge of the UserSetting entity. +func (us *UserSetting) QueryUser() *UserQuery { + return NewUserSettingClient(us.config).QueryUser(us) +} + +// QueryDefaultOrg queries the "default_org" edge of the UserSetting entity. +func (us *UserSetting) QueryDefaultOrg() *OrganizationQuery { + return NewUserSettingClient(us.config).QueryDefaultOrg(us) +} + +// Update returns a builder for updating this UserSetting. +// Note that you need to call UserSetting.Unwrap() before calling this method if this UserSetting +// was returned from a transaction, and the transaction was committed or rolled back. +func (us *UserSetting) Update() *UserSettingUpdateOne { + return NewUserSettingClient(us.config).UpdateOne(us) +} + +// Unwrap unwraps the UserSetting 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 (us *UserSetting) Unwrap() *UserSetting { + _tx, ok := us.config.driver.(*txDriver) + if !ok { + panic("generated: UserSetting is not a transactional entity") + } + us.config.driver = _tx.drv + return us +} + +// String implements the fmt.Stringer. +func (us *UserSetting) String() string { + var builder strings.Builder + builder.WriteString("UserSetting(") + builder.WriteString(fmt.Sprintf("id=%v, ", us.ID)) + builder.WriteString("created_at=") + builder.WriteString(us.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(us.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(us.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(us.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(us.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", us.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(us.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(us.DeletedBy) + builder.WriteString(", ") + builder.WriteString("user_id=") + builder.WriteString(us.UserID) + builder.WriteString(", ") + builder.WriteString("locked=") + builder.WriteString(fmt.Sprintf("%v", us.Locked)) + builder.WriteString(", ") + if v := us.SilencedAt; v != nil { + builder.WriteString("silenced_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := us.SuspendedAt; v != nil { + builder.WriteString("suspended_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", us.Status)) + builder.WriteString(", ") + builder.WriteString("email_confirmed=") + builder.WriteString(fmt.Sprintf("%v", us.EmailConfirmed)) + builder.WriteString(", ") + builder.WriteString("is_webauthn_allowed=") + builder.WriteString(fmt.Sprintf("%v", us.IsWebauthnAllowed)) + builder.WriteString(", ") + builder.WriteString("is_tfa_enabled=") + builder.WriteString(fmt.Sprintf("%v", us.IsTfaEnabled)) + builder.WriteString(", ") + if v := us.PhoneNumber; v != nil { + builder.WriteString("phone_number=") + builder.WriteString(*v) + } + builder.WriteByte(')') + return builder.String() +} + +// UserSettings is a parsable slice of UserSetting. +type UserSettings []*UserSetting diff --git a/internal/ent/generated/usersetting/usersetting.go b/internal/ent/generated/usersetting/usersetting.go new file mode 100644 index 0000000..7c06a54 --- /dev/null +++ b/internal/ent/generated/usersetting/usersetting.go @@ -0,0 +1,284 @@ +// Code generated by ent, DO NOT EDIT. + +package usersetting + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + // Label holds the string label denoting the usersetting type in the database. + Label = "user_setting" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldUserID holds the string denoting the user_id field in the database. + FieldUserID = "user_id" + // FieldLocked holds the string denoting the locked field in the database. + FieldLocked = "locked" + // FieldSilencedAt holds the string denoting the silenced_at field in the database. + FieldSilencedAt = "silenced_at" + // FieldSuspendedAt holds the string denoting the suspended_at field in the database. + FieldSuspendedAt = "suspended_at" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldEmailConfirmed holds the string denoting the email_confirmed field in the database. + FieldEmailConfirmed = "email_confirmed" + // FieldIsWebauthnAllowed holds the string denoting the is_webauthn_allowed field in the database. + FieldIsWebauthnAllowed = "is_webauthn_allowed" + // FieldIsTfaEnabled holds the string denoting the is_tfa_enabled field in the database. + FieldIsTfaEnabled = "is_tfa_enabled" + // FieldPhoneNumber holds the string denoting the phone_number field in the database. + FieldPhoneNumber = "phone_number" + // EdgeUser holds the string denoting the user edge name in mutations. + EdgeUser = "user" + // EdgeDefaultOrg holds the string denoting the default_org edge name in mutations. + EdgeDefaultOrg = "default_org" + // Table holds the table name of the usersetting in the database. + Table = "user_settings" + // UserTable is the table that holds the user relation/edge. + UserTable = "user_settings" + // UserInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + UserInverseTable = "users" + // UserColumn is the table column denoting the user relation/edge. + UserColumn = "user_id" + // DefaultOrgTable is the table that holds the default_org relation/edge. + DefaultOrgTable = "user_settings" + // DefaultOrgInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + DefaultOrgInverseTable = "organizations" + // DefaultOrgColumn is the table column denoting the default_org relation/edge. + DefaultOrgColumn = "user_setting_default_org" +) + +// Columns holds all SQL columns for usersetting fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldUserID, + FieldLocked, + FieldSilencedAt, + FieldSuspendedAt, + FieldStatus, + FieldEmailConfirmed, + FieldIsWebauthnAllowed, + FieldIsTfaEnabled, + FieldPhoneNumber, +} + +// ForeignKeys holds the SQL foreign-keys that are owned by the "user_settings" +// table and are not defined as standalone fields in the schema. +var ForeignKeys = []string{ + "user_setting_default_org", +} + +// 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 +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [4]ent.Hook + Interceptors [2]ent.Interceptor + Policy ent.Policy + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultLocked holds the default value on creation for the "locked" field. + DefaultLocked bool + // DefaultEmailConfirmed holds the default value on creation for the "email_confirmed" field. + DefaultEmailConfirmed bool + // DefaultIsWebauthnAllowed holds the default value on creation for the "is_webauthn_allowed" field. + DefaultIsWebauthnAllowed bool + // DefaultIsTfaEnabled holds the default value on creation for the "is_tfa_enabled" field. + DefaultIsTfaEnabled bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +const DefaultStatus enums.UserStatus = "ACTIVE" + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s enums.UserStatus) error { + switch s.String() { + case "ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING": + return nil + default: + return fmt.Errorf("usersetting: invalid enum value for status field: %q", s) + } +} + +// OrderOption defines the ordering options for the UserSetting queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByUserID orders the results by the user_id field. +func ByUserID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserID, opts...).ToFunc() +} + +// ByLocked orders the results by the locked field. +func ByLocked(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLocked, opts...).ToFunc() +} + +// BySilencedAt orders the results by the silenced_at field. +func BySilencedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSilencedAt, opts...).ToFunc() +} + +// BySuspendedAt orders the results by the suspended_at field. +func BySuspendedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSuspendedAt, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByEmailConfirmed orders the results by the email_confirmed field. +func ByEmailConfirmed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmailConfirmed, opts...).ToFunc() +} + +// ByIsWebauthnAllowed orders the results by the is_webauthn_allowed field. +func ByIsWebauthnAllowed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldIsWebauthnAllowed, opts...).ToFunc() +} + +// ByIsTfaEnabled orders the results by the is_tfa_enabled field. +func ByIsTfaEnabled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldIsTfaEnabled, opts...).ToFunc() +} + +// ByPhoneNumber orders the results by the phone_number field. +func ByPhoneNumber(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPhoneNumber, opts...).ToFunc() +} + +// ByUserField orders the results by user field. +func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...)) + } +} + +// ByDefaultOrgField orders the results by default_org field. +func ByDefaultOrgField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newDefaultOrgStep(), sql.OrderByField(field, opts...)) + } +} +func newUserStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(UserInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, UserTable, UserColumn), + ) +} +func newDefaultOrgStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(DefaultOrgInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, DefaultOrgTable, DefaultOrgColumn), + ) +} + +var ( + // enums.UserStatus must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.UserStatus)(nil) + // enums.UserStatus must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.UserStatus)(nil) +) diff --git a/internal/ent/generated/usersetting/where.go b/internal/ent/generated/usersetting/where.go new file mode 100644 index 0000000..e4148c6 --- /dev/null +++ b/internal/ent/generated/usersetting/where.go @@ -0,0 +1,1007 @@ +// Code generated by ent, DO NOT EDIT. + +package usersetting + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. +func UserID(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldUserID, v)) +} + +// Locked applies equality check predicate on the "locked" field. It's identical to LockedEQ. +func Locked(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldLocked, v)) +} + +// SilencedAt applies equality check predicate on the "silenced_at" field. It's identical to SilencedAtEQ. +func SilencedAt(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldSilencedAt, v)) +} + +// SuspendedAt applies equality check predicate on the "suspended_at" field. It's identical to SuspendedAtEQ. +func SuspendedAt(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldSuspendedAt, v)) +} + +// EmailConfirmed applies equality check predicate on the "email_confirmed" field. It's identical to EmailConfirmedEQ. +func EmailConfirmed(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldEmailConfirmed, v)) +} + +// IsWebauthnAllowed applies equality check predicate on the "is_webauthn_allowed" field. It's identical to IsWebauthnAllowedEQ. +func IsWebauthnAllowed(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldIsWebauthnAllowed, v)) +} + +// IsTfaEnabled applies equality check predicate on the "is_tfa_enabled" field. It's identical to IsTfaEnabledEQ. +func IsTfaEnabled(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldIsTfaEnabled, v)) +} + +// PhoneNumber applies equality check predicate on the "phone_number" field. It's identical to PhoneNumberEQ. +func PhoneNumber(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// UserIDEQ applies the EQ predicate on the "user_id" field. +func UserIDEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldUserID, v)) +} + +// UserIDNEQ applies the NEQ predicate on the "user_id" field. +func UserIDNEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldUserID, v)) +} + +// UserIDIn applies the In predicate on the "user_id" field. +func UserIDIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldUserID, vs...)) +} + +// UserIDNotIn applies the NotIn predicate on the "user_id" field. +func UserIDNotIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldUserID, vs...)) +} + +// UserIDGT applies the GT predicate on the "user_id" field. +func UserIDGT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldUserID, v)) +} + +// UserIDGTE applies the GTE predicate on the "user_id" field. +func UserIDGTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldUserID, v)) +} + +// UserIDLT applies the LT predicate on the "user_id" field. +func UserIDLT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldUserID, v)) +} + +// UserIDLTE applies the LTE predicate on the "user_id" field. +func UserIDLTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldUserID, v)) +} + +// UserIDContains applies the Contains predicate on the "user_id" field. +func UserIDContains(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContains(FieldUserID, v)) +} + +// UserIDHasPrefix applies the HasPrefix predicate on the "user_id" field. +func UserIDHasPrefix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasPrefix(FieldUserID, v)) +} + +// UserIDHasSuffix applies the HasSuffix predicate on the "user_id" field. +func UserIDHasSuffix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasSuffix(FieldUserID, v)) +} + +// UserIDIsNil applies the IsNil predicate on the "user_id" field. +func UserIDIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldUserID)) +} + +// UserIDNotNil applies the NotNil predicate on the "user_id" field. +func UserIDNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldUserID)) +} + +// UserIDEqualFold applies the EqualFold predicate on the "user_id" field. +func UserIDEqualFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEqualFold(FieldUserID, v)) +} + +// UserIDContainsFold applies the ContainsFold predicate on the "user_id" field. +func UserIDContainsFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContainsFold(FieldUserID, v)) +} + +// LockedEQ applies the EQ predicate on the "locked" field. +func LockedEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldLocked, v)) +} + +// LockedNEQ applies the NEQ predicate on the "locked" field. +func LockedNEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldLocked, v)) +} + +// SilencedAtEQ applies the EQ predicate on the "silenced_at" field. +func SilencedAtEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldSilencedAt, v)) +} + +// SilencedAtNEQ applies the NEQ predicate on the "silenced_at" field. +func SilencedAtNEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldSilencedAt, v)) +} + +// SilencedAtIn applies the In predicate on the "silenced_at" field. +func SilencedAtIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldSilencedAt, vs...)) +} + +// SilencedAtNotIn applies the NotIn predicate on the "silenced_at" field. +func SilencedAtNotIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldSilencedAt, vs...)) +} + +// SilencedAtGT applies the GT predicate on the "silenced_at" field. +func SilencedAtGT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldSilencedAt, v)) +} + +// SilencedAtGTE applies the GTE predicate on the "silenced_at" field. +func SilencedAtGTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldSilencedAt, v)) +} + +// SilencedAtLT applies the LT predicate on the "silenced_at" field. +func SilencedAtLT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldSilencedAt, v)) +} + +// SilencedAtLTE applies the LTE predicate on the "silenced_at" field. +func SilencedAtLTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldSilencedAt, v)) +} + +// SilencedAtIsNil applies the IsNil predicate on the "silenced_at" field. +func SilencedAtIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldSilencedAt)) +} + +// SilencedAtNotNil applies the NotNil predicate on the "silenced_at" field. +func SilencedAtNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldSilencedAt)) +} + +// SuspendedAtEQ applies the EQ predicate on the "suspended_at" field. +func SuspendedAtEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldSuspendedAt, v)) +} + +// SuspendedAtNEQ applies the NEQ predicate on the "suspended_at" field. +func SuspendedAtNEQ(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldSuspendedAt, v)) +} + +// SuspendedAtIn applies the In predicate on the "suspended_at" field. +func SuspendedAtIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldSuspendedAt, vs...)) +} + +// SuspendedAtNotIn applies the NotIn predicate on the "suspended_at" field. +func SuspendedAtNotIn(vs ...time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldSuspendedAt, vs...)) +} + +// SuspendedAtGT applies the GT predicate on the "suspended_at" field. +func SuspendedAtGT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldSuspendedAt, v)) +} + +// SuspendedAtGTE applies the GTE predicate on the "suspended_at" field. +func SuspendedAtGTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldSuspendedAt, v)) +} + +// SuspendedAtLT applies the LT predicate on the "suspended_at" field. +func SuspendedAtLT(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldSuspendedAt, v)) +} + +// SuspendedAtLTE applies the LTE predicate on the "suspended_at" field. +func SuspendedAtLTE(v time.Time) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldSuspendedAt, v)) +} + +// SuspendedAtIsNil applies the IsNil predicate on the "suspended_at" field. +func SuspendedAtIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldSuspendedAt)) +} + +// SuspendedAtNotNil applies the NotNil predicate on the "suspended_at" field. +func SuspendedAtNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldSuspendedAt)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v enums.UserStatus) predicate.UserSetting { + vc := v + return predicate.UserSetting(sql.FieldEQ(FieldStatus, vc)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v enums.UserStatus) predicate.UserSetting { + vc := v + return predicate.UserSetting(sql.FieldNEQ(FieldStatus, vc)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...enums.UserStatus) predicate.UserSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserSetting(sql.FieldIn(FieldStatus, v...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...enums.UserStatus) predicate.UserSetting { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserSetting(sql.FieldNotIn(FieldStatus, v...)) +} + +// EmailConfirmedEQ applies the EQ predicate on the "email_confirmed" field. +func EmailConfirmedEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldEmailConfirmed, v)) +} + +// EmailConfirmedNEQ applies the NEQ predicate on the "email_confirmed" field. +func EmailConfirmedNEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldEmailConfirmed, v)) +} + +// IsWebauthnAllowedEQ applies the EQ predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldIsWebauthnAllowed, v)) +} + +// IsWebauthnAllowedNEQ applies the NEQ predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedNEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldIsWebauthnAllowed, v)) +} + +// IsWebauthnAllowedIsNil applies the IsNil predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldIsWebauthnAllowed)) +} + +// IsWebauthnAllowedNotNil applies the NotNil predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldIsWebauthnAllowed)) +} + +// IsTfaEnabledEQ applies the EQ predicate on the "is_tfa_enabled" field. +func IsTfaEnabledEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldIsTfaEnabled, v)) +} + +// IsTfaEnabledNEQ applies the NEQ predicate on the "is_tfa_enabled" field. +func IsTfaEnabledNEQ(v bool) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldIsTfaEnabled, v)) +} + +// IsTfaEnabledIsNil applies the IsNil predicate on the "is_tfa_enabled" field. +func IsTfaEnabledIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldIsTfaEnabled)) +} + +// IsTfaEnabledNotNil applies the NotNil predicate on the "is_tfa_enabled" field. +func IsTfaEnabledNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldIsTfaEnabled)) +} + +// PhoneNumberEQ applies the EQ predicate on the "phone_number" field. +func PhoneNumberEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberNEQ applies the NEQ predicate on the "phone_number" field. +func PhoneNumberNEQ(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberIn applies the In predicate on the "phone_number" field. +func PhoneNumberIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberNotIn applies the NotIn predicate on the "phone_number" field. +func PhoneNumberNotIn(vs ...string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberGT applies the GT predicate on the "phone_number" field. +func PhoneNumberGT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGT(FieldPhoneNumber, v)) +} + +// PhoneNumberGTE applies the GTE predicate on the "phone_number" field. +func PhoneNumberGTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldGTE(FieldPhoneNumber, v)) +} + +// PhoneNumberLT applies the LT predicate on the "phone_number" field. +func PhoneNumberLT(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLT(FieldPhoneNumber, v)) +} + +// PhoneNumberLTE applies the LTE predicate on the "phone_number" field. +func PhoneNumberLTE(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldLTE(FieldPhoneNumber, v)) +} + +// PhoneNumberContains applies the Contains predicate on the "phone_number" field. +func PhoneNumberContains(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContains(FieldPhoneNumber, v)) +} + +// PhoneNumberHasPrefix applies the HasPrefix predicate on the "phone_number" field. +func PhoneNumberHasPrefix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasPrefix(FieldPhoneNumber, v)) +} + +// PhoneNumberHasSuffix applies the HasSuffix predicate on the "phone_number" field. +func PhoneNumberHasSuffix(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldHasSuffix(FieldPhoneNumber, v)) +} + +// PhoneNumberIsNil applies the IsNil predicate on the "phone_number" field. +func PhoneNumberIsNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldIsNull(FieldPhoneNumber)) +} + +// PhoneNumberNotNil applies the NotNil predicate on the "phone_number" field. +func PhoneNumberNotNil() predicate.UserSetting { + return predicate.UserSetting(sql.FieldNotNull(FieldPhoneNumber)) +} + +// PhoneNumberEqualFold applies the EqualFold predicate on the "phone_number" field. +func PhoneNumberEqualFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldEqualFold(FieldPhoneNumber, v)) +} + +// PhoneNumberContainsFold applies the ContainsFold predicate on the "phone_number" field. +func PhoneNumberContainsFold(v string) predicate.UserSetting { + return predicate.UserSetting(sql.FieldContainsFold(FieldPhoneNumber, v)) +} + +// HasUser applies the HasEdge predicate on the "user" edge. +func HasUser() predicate.UserSetting { + return predicate.UserSetting(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, UserTable, UserColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserSetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates). +func HasUserWith(preds ...predicate.User) predicate.UserSetting { + return predicate.UserSetting(func(s *sql.Selector) { + step := newUserStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserSetting + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasDefaultOrg applies the HasEdge predicate on the "default_org" edge. +func HasDefaultOrg() predicate.UserSetting { + return predicate.UserSetting(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, DefaultOrgTable, DefaultOrgColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.UserSetting + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasDefaultOrgWith applies the HasEdge predicate on the "default_org" edge with a given conditions (other predicates). +func HasDefaultOrgWith(preds ...predicate.Organization) predicate.UserSetting { + return predicate.UserSetting(func(s *sql.Selector) { + step := newDefaultOrgStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.UserSetting + 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.UserSetting) predicate.UserSetting { + return predicate.UserSetting(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.UserSetting) predicate.UserSetting { + return predicate.UserSetting(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.UserSetting) predicate.UserSetting { + return predicate.UserSetting(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/usersetting_create.go b/internal/ent/generated/usersetting_create.go new file mode 100644 index 0000000..e2fe2f0 --- /dev/null +++ b/internal/ent/generated/usersetting_create.go @@ -0,0 +1,626 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/pkg/enums" +) + +// UserSettingCreate is the builder for creating a UserSetting entity. +type UserSettingCreate struct { + config + mutation *UserSettingMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (usc *UserSettingCreate) SetCreatedAt(t time.Time) *UserSettingCreate { + usc.mutation.SetCreatedAt(t) + return usc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableCreatedAt(t *time.Time) *UserSettingCreate { + if t != nil { + usc.SetCreatedAt(*t) + } + return usc +} + +// SetUpdatedAt sets the "updated_at" field. +func (usc *UserSettingCreate) SetUpdatedAt(t time.Time) *UserSettingCreate { + usc.mutation.SetUpdatedAt(t) + return usc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableUpdatedAt(t *time.Time) *UserSettingCreate { + if t != nil { + usc.SetUpdatedAt(*t) + } + return usc +} + +// SetCreatedBy sets the "created_by" field. +func (usc *UserSettingCreate) SetCreatedBy(s string) *UserSettingCreate { + usc.mutation.SetCreatedBy(s) + return usc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableCreatedBy(s *string) *UserSettingCreate { + if s != nil { + usc.SetCreatedBy(*s) + } + return usc +} + +// SetUpdatedBy sets the "updated_by" field. +func (usc *UserSettingCreate) SetUpdatedBy(s string) *UserSettingCreate { + usc.mutation.SetUpdatedBy(s) + return usc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableUpdatedBy(s *string) *UserSettingCreate { + if s != nil { + usc.SetUpdatedBy(*s) + } + return usc +} + +// SetMappingID sets the "mapping_id" field. +func (usc *UserSettingCreate) SetMappingID(s string) *UserSettingCreate { + usc.mutation.SetMappingID(s) + return usc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableMappingID(s *string) *UserSettingCreate { + if s != nil { + usc.SetMappingID(*s) + } + return usc +} + +// SetTags sets the "tags" field. +func (usc *UserSettingCreate) SetTags(s []string) *UserSettingCreate { + usc.mutation.SetTags(s) + return usc +} + +// SetDeletedAt sets the "deleted_at" field. +func (usc *UserSettingCreate) SetDeletedAt(t time.Time) *UserSettingCreate { + usc.mutation.SetDeletedAt(t) + return usc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableDeletedAt(t *time.Time) *UserSettingCreate { + if t != nil { + usc.SetDeletedAt(*t) + } + return usc +} + +// SetDeletedBy sets the "deleted_by" field. +func (usc *UserSettingCreate) SetDeletedBy(s string) *UserSettingCreate { + usc.mutation.SetDeletedBy(s) + return usc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableDeletedBy(s *string) *UserSettingCreate { + if s != nil { + usc.SetDeletedBy(*s) + } + return usc +} + +// SetUserID sets the "user_id" field. +func (usc *UserSettingCreate) SetUserID(s string) *UserSettingCreate { + usc.mutation.SetUserID(s) + return usc +} + +// SetNillableUserID sets the "user_id" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableUserID(s *string) *UserSettingCreate { + if s != nil { + usc.SetUserID(*s) + } + return usc +} + +// SetLocked sets the "locked" field. +func (usc *UserSettingCreate) SetLocked(b bool) *UserSettingCreate { + usc.mutation.SetLocked(b) + return usc +} + +// SetNillableLocked sets the "locked" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableLocked(b *bool) *UserSettingCreate { + if b != nil { + usc.SetLocked(*b) + } + return usc +} + +// SetSilencedAt sets the "silenced_at" field. +func (usc *UserSettingCreate) SetSilencedAt(t time.Time) *UserSettingCreate { + usc.mutation.SetSilencedAt(t) + return usc +} + +// SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableSilencedAt(t *time.Time) *UserSettingCreate { + if t != nil { + usc.SetSilencedAt(*t) + } + return usc +} + +// SetSuspendedAt sets the "suspended_at" field. +func (usc *UserSettingCreate) SetSuspendedAt(t time.Time) *UserSettingCreate { + usc.mutation.SetSuspendedAt(t) + return usc +} + +// SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableSuspendedAt(t *time.Time) *UserSettingCreate { + if t != nil { + usc.SetSuspendedAt(*t) + } + return usc +} + +// SetStatus sets the "status" field. +func (usc *UserSettingCreate) SetStatus(es enums.UserStatus) *UserSettingCreate { + usc.mutation.SetStatus(es) + return usc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableStatus(es *enums.UserStatus) *UserSettingCreate { + if es != nil { + usc.SetStatus(*es) + } + return usc +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (usc *UserSettingCreate) SetEmailConfirmed(b bool) *UserSettingCreate { + usc.mutation.SetEmailConfirmed(b) + return usc +} + +// SetNillableEmailConfirmed sets the "email_confirmed" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableEmailConfirmed(b *bool) *UserSettingCreate { + if b != nil { + usc.SetEmailConfirmed(*b) + } + return usc +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (usc *UserSettingCreate) SetIsWebauthnAllowed(b bool) *UserSettingCreate { + usc.mutation.SetIsWebauthnAllowed(b) + return usc +} + +// SetNillableIsWebauthnAllowed sets the "is_webauthn_allowed" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableIsWebauthnAllowed(b *bool) *UserSettingCreate { + if b != nil { + usc.SetIsWebauthnAllowed(*b) + } + return usc +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (usc *UserSettingCreate) SetIsTfaEnabled(b bool) *UserSettingCreate { + usc.mutation.SetIsTfaEnabled(b) + return usc +} + +// SetNillableIsTfaEnabled sets the "is_tfa_enabled" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableIsTfaEnabled(b *bool) *UserSettingCreate { + if b != nil { + usc.SetIsTfaEnabled(*b) + } + return usc +} + +// SetPhoneNumber sets the "phone_number" field. +func (usc *UserSettingCreate) SetPhoneNumber(s string) *UserSettingCreate { + usc.mutation.SetPhoneNumber(s) + return usc +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillablePhoneNumber(s *string) *UserSettingCreate { + if s != nil { + usc.SetPhoneNumber(*s) + } + return usc +} + +// SetID sets the "id" field. +func (usc *UserSettingCreate) SetID(s string) *UserSettingCreate { + usc.mutation.SetID(s) + return usc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (usc *UserSettingCreate) SetNillableID(s *string) *UserSettingCreate { + if s != nil { + usc.SetID(*s) + } + return usc +} + +// SetUser sets the "user" edge to the User entity. +func (usc *UserSettingCreate) SetUser(u *User) *UserSettingCreate { + return usc.SetUserID(u.ID) +} + +// SetDefaultOrgID sets the "default_org" edge to the Organization entity by ID. +func (usc *UserSettingCreate) SetDefaultOrgID(id string) *UserSettingCreate { + usc.mutation.SetDefaultOrgID(id) + return usc +} + +// SetNillableDefaultOrgID sets the "default_org" edge to the Organization entity by ID if the given value is not nil. +func (usc *UserSettingCreate) SetNillableDefaultOrgID(id *string) *UserSettingCreate { + if id != nil { + usc = usc.SetDefaultOrgID(*id) + } + return usc +} + +// SetDefaultOrg sets the "default_org" edge to the Organization entity. +func (usc *UserSettingCreate) SetDefaultOrg(o *Organization) *UserSettingCreate { + return usc.SetDefaultOrgID(o.ID) +} + +// Mutation returns the UserSettingMutation object of the builder. +func (usc *UserSettingCreate) Mutation() *UserSettingMutation { + return usc.mutation +} + +// Save creates the UserSetting in the database. +func (usc *UserSettingCreate) Save(ctx context.Context) (*UserSetting, error) { + if err := usc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, usc.sqlSave, usc.mutation, usc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (usc *UserSettingCreate) SaveX(ctx context.Context) *UserSetting { + v, err := usc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (usc *UserSettingCreate) Exec(ctx context.Context) error { + _, err := usc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (usc *UserSettingCreate) ExecX(ctx context.Context) { + if err := usc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (usc *UserSettingCreate) defaults() error { + if _, ok := usc.mutation.CreatedAt(); !ok { + if usersetting.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized usersetting.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := usersetting.DefaultCreatedAt() + usc.mutation.SetCreatedAt(v) + } + if _, ok := usc.mutation.UpdatedAt(); !ok { + if usersetting.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized usersetting.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := usersetting.DefaultUpdatedAt() + usc.mutation.SetUpdatedAt(v) + } + if _, ok := usc.mutation.MappingID(); !ok { + if usersetting.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized usersetting.DefaultMappingID (forgotten import generated/runtime?)") + } + v := usersetting.DefaultMappingID() + usc.mutation.SetMappingID(v) + } + if _, ok := usc.mutation.Tags(); !ok { + v := usersetting.DefaultTags + usc.mutation.SetTags(v) + } + if _, ok := usc.mutation.Locked(); !ok { + v := usersetting.DefaultLocked + usc.mutation.SetLocked(v) + } + if _, ok := usc.mutation.Status(); !ok { + v := usersetting.DefaultStatus + usc.mutation.SetStatus(v) + } + if _, ok := usc.mutation.EmailConfirmed(); !ok { + v := usersetting.DefaultEmailConfirmed + usc.mutation.SetEmailConfirmed(v) + } + if _, ok := usc.mutation.IsWebauthnAllowed(); !ok { + v := usersetting.DefaultIsWebauthnAllowed + usc.mutation.SetIsWebauthnAllowed(v) + } + if _, ok := usc.mutation.IsTfaEnabled(); !ok { + v := usersetting.DefaultIsTfaEnabled + usc.mutation.SetIsTfaEnabled(v) + } + if _, ok := usc.mutation.ID(); !ok { + if usersetting.DefaultID == nil { + return fmt.Errorf("generated: uninitialized usersetting.DefaultID (forgotten import generated/runtime?)") + } + v := usersetting.DefaultID() + usc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (usc *UserSettingCreate) check() error { + if _, ok := usc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "UserSetting.mapping_id"`)} + } + if _, ok := usc.mutation.Locked(); !ok { + return &ValidationError{Name: "locked", err: errors.New(`generated: missing required field "UserSetting.locked"`)} + } + if _, ok := usc.mutation.Status(); !ok { + return &ValidationError{Name: "status", err: errors.New(`generated: missing required field "UserSetting.status"`)} + } + if v, ok := usc.mutation.Status(); ok { + if err := usersetting.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "UserSetting.status": %w`, err)} + } + } + if _, ok := usc.mutation.EmailConfirmed(); !ok { + return &ValidationError{Name: "email_confirmed", err: errors.New(`generated: missing required field "UserSetting.email_confirmed"`)} + } + return nil +} + +func (usc *UserSettingCreate) sqlSave(ctx context.Context) (*UserSetting, error) { + if err := usc.check(); err != nil { + return nil, err + } + _node, _spec := usc.createSpec() + if err := sqlgraph.CreateNode(ctx, usc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected UserSetting.ID type: %T", _spec.ID.Value) + } + } + usc.mutation.id = &_node.ID + usc.mutation.done = true + return _node, nil +} + +func (usc *UserSettingCreate) createSpec() (*UserSetting, *sqlgraph.CreateSpec) { + var ( + _node = &UserSetting{config: usc.config} + _spec = sqlgraph.NewCreateSpec(usersetting.Table, sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString)) + ) + _spec.Schema = usc.schemaConfig.UserSetting + if id, ok := usc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := usc.mutation.CreatedAt(); ok { + _spec.SetField(usersetting.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := usc.mutation.UpdatedAt(); ok { + _spec.SetField(usersetting.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := usc.mutation.CreatedBy(); ok { + _spec.SetField(usersetting.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := usc.mutation.UpdatedBy(); ok { + _spec.SetField(usersetting.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := usc.mutation.MappingID(); ok { + _spec.SetField(usersetting.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := usc.mutation.Tags(); ok { + _spec.SetField(usersetting.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := usc.mutation.DeletedAt(); ok { + _spec.SetField(usersetting.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := usc.mutation.DeletedBy(); ok { + _spec.SetField(usersetting.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := usc.mutation.Locked(); ok { + _spec.SetField(usersetting.FieldLocked, field.TypeBool, value) + _node.Locked = value + } + if value, ok := usc.mutation.SilencedAt(); ok { + _spec.SetField(usersetting.FieldSilencedAt, field.TypeTime, value) + _node.SilencedAt = &value + } + if value, ok := usc.mutation.SuspendedAt(); ok { + _spec.SetField(usersetting.FieldSuspendedAt, field.TypeTime, value) + _node.SuspendedAt = &value + } + if value, ok := usc.mutation.Status(); ok { + _spec.SetField(usersetting.FieldStatus, field.TypeEnum, value) + _node.Status = value + } + if value, ok := usc.mutation.EmailConfirmed(); ok { + _spec.SetField(usersetting.FieldEmailConfirmed, field.TypeBool, value) + _node.EmailConfirmed = value + } + if value, ok := usc.mutation.IsWebauthnAllowed(); ok { + _spec.SetField(usersetting.FieldIsWebauthnAllowed, field.TypeBool, value) + _node.IsWebauthnAllowed = value + } + if value, ok := usc.mutation.IsTfaEnabled(); ok { + _spec.SetField(usersetting.FieldIsTfaEnabled, field.TypeBool, value) + _node.IsTfaEnabled = value + } + if value, ok := usc.mutation.PhoneNumber(); ok { + _spec.SetField(usersetting.FieldPhoneNumber, field.TypeString, value) + _node.PhoneNumber = &value + } + if nodes := usc.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: usersetting.UserTable, + Columns: []string{usersetting.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = usc.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.UserID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := usc.mutation.DefaultOrgIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: usersetting.DefaultOrgTable, + Columns: []string{usersetting.DefaultOrgColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = usc.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.user_setting_default_org = &nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// UserSettingCreateBulk is the builder for creating many UserSetting entities in bulk. +type UserSettingCreateBulk struct { + config + err error + builders []*UserSettingCreate +} + +// Save creates the UserSetting entities in the database. +func (uscb *UserSettingCreateBulk) Save(ctx context.Context) ([]*UserSetting, error) { + if uscb.err != nil { + return nil, uscb.err + } + specs := make([]*sqlgraph.CreateSpec, len(uscb.builders)) + nodes := make([]*UserSetting, len(uscb.builders)) + mutators := make([]Mutator, len(uscb.builders)) + for i := range uscb.builders { + func(i int, root context.Context) { + builder := uscb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*UserSettingMutation) + 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, uscb.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, uscb.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, uscb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (uscb *UserSettingCreateBulk) SaveX(ctx context.Context) []*UserSetting { + v, err := uscb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (uscb *UserSettingCreateBulk) Exec(ctx context.Context) error { + _, err := uscb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (uscb *UserSettingCreateBulk) ExecX(ctx context.Context) { + if err := uscb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/usersetting_delete.go b/internal/ent/generated/usersetting_delete.go new file mode 100644 index 0000000..a65a110 --- /dev/null +++ b/internal/ent/generated/usersetting_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/usersetting" +) + +// UserSettingDelete is the builder for deleting a UserSetting entity. +type UserSettingDelete struct { + config + hooks []Hook + mutation *UserSettingMutation +} + +// Where appends a list predicates to the UserSettingDelete builder. +func (usd *UserSettingDelete) Where(ps ...predicate.UserSetting) *UserSettingDelete { + usd.mutation.Where(ps...) + return usd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (usd *UserSettingDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, usd.sqlExec, usd.mutation, usd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (usd *UserSettingDelete) ExecX(ctx context.Context) int { + n, err := usd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (usd *UserSettingDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(usersetting.Table, sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString)) + _spec.Node.Schema = usd.schemaConfig.UserSetting + ctx = internal.NewSchemaConfigContext(ctx, usd.schemaConfig) + if ps := usd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, usd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + usd.mutation.done = true + return affected, err +} + +// UserSettingDeleteOne is the builder for deleting a single UserSetting entity. +type UserSettingDeleteOne struct { + usd *UserSettingDelete +} + +// Where appends a list predicates to the UserSettingDelete builder. +func (usdo *UserSettingDeleteOne) Where(ps ...predicate.UserSetting) *UserSettingDeleteOne { + usdo.usd.mutation.Where(ps...) + return usdo +} + +// Exec executes the deletion query. +func (usdo *UserSettingDeleteOne) Exec(ctx context.Context) error { + n, err := usdo.usd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{usersetting.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (usdo *UserSettingDeleteOne) ExecX(ctx context.Context) { + if err := usdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/usersetting_query.go b/internal/ent/generated/usersetting_query.go new file mode 100644 index 0000000..3232e0b --- /dev/null +++ b/internal/ent/generated/usersetting_query.go @@ -0,0 +1,724 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserSettingQuery is the builder for querying UserSetting entities. +type UserSettingQuery struct { + config + ctx *QueryContext + order []usersetting.OrderOption + inters []Interceptor + predicates []predicate.UserSetting + withUser *UserQuery + withDefaultOrg *OrganizationQuery + withFKs bool + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*UserSetting) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the UserSettingQuery builder. +func (usq *UserSettingQuery) Where(ps ...predicate.UserSetting) *UserSettingQuery { + usq.predicates = append(usq.predicates, ps...) + return usq +} + +// Limit the number of records to be returned by this query. +func (usq *UserSettingQuery) Limit(limit int) *UserSettingQuery { + usq.ctx.Limit = &limit + return usq +} + +// Offset to start from. +func (usq *UserSettingQuery) Offset(offset int) *UserSettingQuery { + usq.ctx.Offset = &offset + return usq +} + +// 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 (usq *UserSettingQuery) Unique(unique bool) *UserSettingQuery { + usq.ctx.Unique = &unique + return usq +} + +// Order specifies how the records should be ordered. +func (usq *UserSettingQuery) Order(o ...usersetting.OrderOption) *UserSettingQuery { + usq.order = append(usq.order, o...) + return usq +} + +// QueryUser chains the current query on the "user" edge. +func (usq *UserSettingQuery) QueryUser() *UserQuery { + query := (&UserClient{config: usq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := usq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := usq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(usersetting.Table, usersetting.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.O2O, true, usersetting.UserTable, usersetting.UserColumn), + ) + schemaConfig := usq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.UserSetting + fromU = sqlgraph.SetNeighbors(usq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryDefaultOrg chains the current query on the "default_org" edge. +func (usq *UserSettingQuery) QueryDefaultOrg() *OrganizationQuery { + query := (&OrganizationClient{config: usq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := usq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := usq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(usersetting.Table, usersetting.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, false, usersetting.DefaultOrgTable, usersetting.DefaultOrgColumn), + ) + schemaConfig := usq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.UserSetting + fromU = sqlgraph.SetNeighbors(usq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first UserSetting entity from the query. +// Returns a *NotFoundError when no UserSetting was found. +func (usq *UserSettingQuery) First(ctx context.Context) (*UserSetting, error) { + nodes, err := usq.Limit(1).All(setContextOp(ctx, usq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{usersetting.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (usq *UserSettingQuery) FirstX(ctx context.Context) *UserSetting { + node, err := usq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first UserSetting ID from the query. +// Returns a *NotFoundError when no UserSetting ID was found. +func (usq *UserSettingQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = usq.Limit(1).IDs(setContextOp(ctx, usq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{usersetting.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (usq *UserSettingQuery) FirstIDX(ctx context.Context) string { + id, err := usq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single UserSetting entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one UserSetting entity is found. +// Returns a *NotFoundError when no UserSetting entities are found. +func (usq *UserSettingQuery) Only(ctx context.Context) (*UserSetting, error) { + nodes, err := usq.Limit(2).All(setContextOp(ctx, usq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{usersetting.Label} + default: + return nil, &NotSingularError{usersetting.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (usq *UserSettingQuery) OnlyX(ctx context.Context) *UserSetting { + node, err := usq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only UserSetting ID in the query. +// Returns a *NotSingularError when more than one UserSetting ID is found. +// Returns a *NotFoundError when no entities are found. +func (usq *UserSettingQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = usq.Limit(2).IDs(setContextOp(ctx, usq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{usersetting.Label} + default: + err = &NotSingularError{usersetting.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (usq *UserSettingQuery) OnlyIDX(ctx context.Context) string { + id, err := usq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of UserSettings. +func (usq *UserSettingQuery) All(ctx context.Context) ([]*UserSetting, error) { + ctx = setContextOp(ctx, usq.ctx, ent.OpQueryAll) + if err := usq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*UserSetting, *UserSettingQuery]() + return withInterceptors[[]*UserSetting](ctx, usq, qr, usq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (usq *UserSettingQuery) AllX(ctx context.Context) []*UserSetting { + nodes, err := usq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of UserSetting IDs. +func (usq *UserSettingQuery) IDs(ctx context.Context) (ids []string, err error) { + if usq.ctx.Unique == nil && usq.path != nil { + usq.Unique(true) + } + ctx = setContextOp(ctx, usq.ctx, ent.OpQueryIDs) + if err = usq.Select(usersetting.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (usq *UserSettingQuery) IDsX(ctx context.Context) []string { + ids, err := usq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (usq *UserSettingQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, usq.ctx, ent.OpQueryCount) + if err := usq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, usq, querierCount[*UserSettingQuery](), usq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (usq *UserSettingQuery) CountX(ctx context.Context) int { + count, err := usq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (usq *UserSettingQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, usq.ctx, ent.OpQueryExist) + switch _, err := usq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (usq *UserSettingQuery) ExistX(ctx context.Context) bool { + exist, err := usq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the UserSettingQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (usq *UserSettingQuery) Clone() *UserSettingQuery { + if usq == nil { + return nil + } + return &UserSettingQuery{ + config: usq.config, + ctx: usq.ctx.Clone(), + order: append([]usersetting.OrderOption{}, usq.order...), + inters: append([]Interceptor{}, usq.inters...), + predicates: append([]predicate.UserSetting{}, usq.predicates...), + withUser: usq.withUser.Clone(), + withDefaultOrg: usq.withDefaultOrg.Clone(), + // clone intermediate query. + sql: usq.sql.Clone(), + path: usq.path, + } +} + +// WithUser tells the query-builder to eager-load the nodes that are connected to +// the "user" edge. The optional arguments are used to configure the query builder of the edge. +func (usq *UserSettingQuery) WithUser(opts ...func(*UserQuery)) *UserSettingQuery { + query := (&UserClient{config: usq.config}).Query() + for _, opt := range opts { + opt(query) + } + usq.withUser = query + return usq +} + +// WithDefaultOrg tells the query-builder to eager-load the nodes that are connected to +// the "default_org" edge. The optional arguments are used to configure the query builder of the edge. +func (usq *UserSettingQuery) WithDefaultOrg(opts ...func(*OrganizationQuery)) *UserSettingQuery { + query := (&OrganizationClient{config: usq.config}).Query() + for _, opt := range opts { + opt(query) + } + usq.withDefaultOrg = query + return usq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.UserSetting.Query(). +// GroupBy(usersetting.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (usq *UserSettingQuery) GroupBy(field string, fields ...string) *UserSettingGroupBy { + usq.ctx.Fields = append([]string{field}, fields...) + grbuild := &UserSettingGroupBy{build: usq} + grbuild.flds = &usq.ctx.Fields + grbuild.label = usersetting.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.UserSetting.Query(). +// Select(usersetting.FieldCreatedAt). +// Scan(ctx, &v) +func (usq *UserSettingQuery) Select(fields ...string) *UserSettingSelect { + usq.ctx.Fields = append(usq.ctx.Fields, fields...) + sbuild := &UserSettingSelect{UserSettingQuery: usq} + sbuild.label = usersetting.Label + sbuild.flds, sbuild.scan = &usq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a UserSettingSelect configured with the given aggregations. +func (usq *UserSettingQuery) Aggregate(fns ...AggregateFunc) *UserSettingSelect { + return usq.Select().Aggregate(fns...) +} + +func (usq *UserSettingQuery) prepareQuery(ctx context.Context) error { + for _, inter := range usq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, usq); err != nil { + return err + } + } + } + for _, f := range usq.ctx.Fields { + if !usersetting.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if usq.path != nil { + prev, err := usq.path(ctx) + if err != nil { + return err + } + usq.sql = prev + } + if usersetting.Policy == nil { + return errors.New("generated: uninitialized usersetting.Policy (forgotten import generated/runtime?)") + } + if err := usersetting.Policy.EvalQuery(ctx, usq); err != nil { + return err + } + return nil +} + +func (usq *UserSettingQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*UserSetting, error) { + var ( + nodes = []*UserSetting{} + withFKs = usq.withFKs + _spec = usq.querySpec() + loadedTypes = [2]bool{ + usq.withUser != nil, + usq.withDefaultOrg != nil, + } + ) + if usq.withDefaultOrg != nil { + withFKs = true + } + if withFKs { + _spec.Node.Columns = append(_spec.Node.Columns, usersetting.ForeignKeys...) + } + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*UserSetting).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &UserSetting{config: usq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = usq.schemaConfig.UserSetting + ctx = internal.NewSchemaConfigContext(ctx, usq.schemaConfig) + if len(usq.modifiers) > 0 { + _spec.Modifiers = usq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, usq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := usq.withUser; query != nil { + if err := usq.loadUser(ctx, query, nodes, nil, + func(n *UserSetting, e *User) { n.Edges.User = e }); err != nil { + return nil, err + } + } + if query := usq.withDefaultOrg; query != nil { + if err := usq.loadDefaultOrg(ctx, query, nodes, nil, + func(n *UserSetting, e *Organization) { n.Edges.DefaultOrg = e }); err != nil { + return nil, err + } + } + for i := range usq.loadTotal { + if err := usq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (usq *UserSettingQuery) loadUser(ctx context.Context, query *UserQuery, nodes []*UserSetting, init func(*UserSetting), assign func(*UserSetting, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*UserSetting) + for i := range nodes { + fk := nodes[i].UserID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "user_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (usq *UserSettingQuery) loadDefaultOrg(ctx context.Context, query *OrganizationQuery, nodes []*UserSetting, init func(*UserSetting), assign func(*UserSetting, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*UserSetting) + for i := range nodes { + if nodes[i].user_setting_default_org == nil { + continue + } + fk := *nodes[i].user_setting_default_org + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "user_setting_default_org" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (usq *UserSettingQuery) sqlCount(ctx context.Context) (int, error) { + _spec := usq.querySpec() + _spec.Node.Schema = usq.schemaConfig.UserSetting + ctx = internal.NewSchemaConfigContext(ctx, usq.schemaConfig) + if len(usq.modifiers) > 0 { + _spec.Modifiers = usq.modifiers + } + _spec.Node.Columns = usq.ctx.Fields + if len(usq.ctx.Fields) > 0 { + _spec.Unique = usq.ctx.Unique != nil && *usq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, usq.driver, _spec) +} + +func (usq *UserSettingQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(usersetting.Table, usersetting.Columns, sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString)) + _spec.From = usq.sql + if unique := usq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if usq.path != nil { + _spec.Unique = true + } + if fields := usq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, usersetting.FieldID) + for i := range fields { + if fields[i] != usersetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if usq.withUser != nil { + _spec.Node.AddColumnOnce(usersetting.FieldUserID) + } + } + if ps := usq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := usq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := usq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := usq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (usq *UserSettingQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(usq.driver.Dialect()) + t1 := builder.Table(usersetting.Table) + columns := usq.ctx.Fields + if len(columns) == 0 { + columns = usersetting.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if usq.sql != nil { + selector = usq.sql + selector.Select(selector.Columns(columns...)...) + } + if usq.ctx.Unique != nil && *usq.ctx.Unique { + selector.Distinct() + } + t1.Schema(usq.schemaConfig.UserSetting) + ctx = internal.NewSchemaConfigContext(ctx, usq.schemaConfig) + selector.WithContext(ctx) + for _, p := range usq.predicates { + p(selector) + } + for _, p := range usq.order { + p(selector) + } + if offset := usq.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 := usq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// UserSettingGroupBy is the group-by builder for UserSetting entities. +type UserSettingGroupBy struct { + selector + build *UserSettingQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (usgb *UserSettingGroupBy) Aggregate(fns ...AggregateFunc) *UserSettingGroupBy { + usgb.fns = append(usgb.fns, fns...) + return usgb +} + +// Scan applies the selector query and scans the result into the given value. +func (usgb *UserSettingGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, usgb.build.ctx, ent.OpQueryGroupBy) + if err := usgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserSettingQuery, *UserSettingGroupBy](ctx, usgb.build, usgb, usgb.build.inters, v) +} + +func (usgb *UserSettingGroupBy) sqlScan(ctx context.Context, root *UserSettingQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(usgb.fns)) + for _, fn := range usgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*usgb.flds)+len(usgb.fns)) + for _, f := range *usgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*usgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := usgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// UserSettingSelect is the builder for selecting fields of UserSetting entities. +type UserSettingSelect struct { + *UserSettingQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (uss *UserSettingSelect) Aggregate(fns ...AggregateFunc) *UserSettingSelect { + uss.fns = append(uss.fns, fns...) + return uss +} + +// Scan applies the selector query and scans the result into the given value. +func (uss *UserSettingSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, uss.ctx, ent.OpQuerySelect) + if err := uss.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserSettingQuery, *UserSettingSelect](ctx, uss.UserSettingQuery, uss, uss.inters, v) +} + +func (uss *UserSettingSelect) sqlScan(ctx context.Context, root *UserSettingQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(uss.fns)) + for _, fn := range uss.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*uss.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 := uss.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/usersetting_update.go b/internal/ent/generated/usersetting_update.go new file mode 100644 index 0000000..15fe609 --- /dev/null +++ b/internal/ent/generated/usersetting_update.go @@ -0,0 +1,1102 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserSettingUpdate is the builder for updating UserSetting entities. +type UserSettingUpdate struct { + config + hooks []Hook + mutation *UserSettingMutation +} + +// Where appends a list predicates to the UserSettingUpdate builder. +func (usu *UserSettingUpdate) Where(ps ...predicate.UserSetting) *UserSettingUpdate { + usu.mutation.Where(ps...) + return usu +} + +// SetUpdatedAt sets the "updated_at" field. +func (usu *UserSettingUpdate) SetUpdatedAt(t time.Time) *UserSettingUpdate { + usu.mutation.SetUpdatedAt(t) + return usu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (usu *UserSettingUpdate) ClearUpdatedAt() *UserSettingUpdate { + usu.mutation.ClearUpdatedAt() + return usu +} + +// SetUpdatedBy sets the "updated_by" field. +func (usu *UserSettingUpdate) SetUpdatedBy(s string) *UserSettingUpdate { + usu.mutation.SetUpdatedBy(s) + return usu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableUpdatedBy(s *string) *UserSettingUpdate { + if s != nil { + usu.SetUpdatedBy(*s) + } + return usu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (usu *UserSettingUpdate) ClearUpdatedBy() *UserSettingUpdate { + usu.mutation.ClearUpdatedBy() + return usu +} + +// SetTags sets the "tags" field. +func (usu *UserSettingUpdate) SetTags(s []string) *UserSettingUpdate { + usu.mutation.SetTags(s) + return usu +} + +// AppendTags appends s to the "tags" field. +func (usu *UserSettingUpdate) AppendTags(s []string) *UserSettingUpdate { + usu.mutation.AppendTags(s) + return usu +} + +// ClearTags clears the value of the "tags" field. +func (usu *UserSettingUpdate) ClearTags() *UserSettingUpdate { + usu.mutation.ClearTags() + return usu +} + +// SetDeletedAt sets the "deleted_at" field. +func (usu *UserSettingUpdate) SetDeletedAt(t time.Time) *UserSettingUpdate { + usu.mutation.SetDeletedAt(t) + return usu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableDeletedAt(t *time.Time) *UserSettingUpdate { + if t != nil { + usu.SetDeletedAt(*t) + } + return usu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (usu *UserSettingUpdate) ClearDeletedAt() *UserSettingUpdate { + usu.mutation.ClearDeletedAt() + return usu +} + +// SetDeletedBy sets the "deleted_by" field. +func (usu *UserSettingUpdate) SetDeletedBy(s string) *UserSettingUpdate { + usu.mutation.SetDeletedBy(s) + return usu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableDeletedBy(s *string) *UserSettingUpdate { + if s != nil { + usu.SetDeletedBy(*s) + } + return usu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (usu *UserSettingUpdate) ClearDeletedBy() *UserSettingUpdate { + usu.mutation.ClearDeletedBy() + return usu +} + +// SetUserID sets the "user_id" field. +func (usu *UserSettingUpdate) SetUserID(s string) *UserSettingUpdate { + usu.mutation.SetUserID(s) + return usu +} + +// SetNillableUserID sets the "user_id" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableUserID(s *string) *UserSettingUpdate { + if s != nil { + usu.SetUserID(*s) + } + return usu +} + +// ClearUserID clears the value of the "user_id" field. +func (usu *UserSettingUpdate) ClearUserID() *UserSettingUpdate { + usu.mutation.ClearUserID() + return usu +} + +// SetLocked sets the "locked" field. +func (usu *UserSettingUpdate) SetLocked(b bool) *UserSettingUpdate { + usu.mutation.SetLocked(b) + return usu +} + +// SetNillableLocked sets the "locked" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableLocked(b *bool) *UserSettingUpdate { + if b != nil { + usu.SetLocked(*b) + } + return usu +} + +// SetSilencedAt sets the "silenced_at" field. +func (usu *UserSettingUpdate) SetSilencedAt(t time.Time) *UserSettingUpdate { + usu.mutation.SetSilencedAt(t) + return usu +} + +// SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableSilencedAt(t *time.Time) *UserSettingUpdate { + if t != nil { + usu.SetSilencedAt(*t) + } + return usu +} + +// ClearSilencedAt clears the value of the "silenced_at" field. +func (usu *UserSettingUpdate) ClearSilencedAt() *UserSettingUpdate { + usu.mutation.ClearSilencedAt() + return usu +} + +// SetSuspendedAt sets the "suspended_at" field. +func (usu *UserSettingUpdate) SetSuspendedAt(t time.Time) *UserSettingUpdate { + usu.mutation.SetSuspendedAt(t) + return usu +} + +// SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableSuspendedAt(t *time.Time) *UserSettingUpdate { + if t != nil { + usu.SetSuspendedAt(*t) + } + return usu +} + +// ClearSuspendedAt clears the value of the "suspended_at" field. +func (usu *UserSettingUpdate) ClearSuspendedAt() *UserSettingUpdate { + usu.mutation.ClearSuspendedAt() + return usu +} + +// SetStatus sets the "status" field. +func (usu *UserSettingUpdate) SetStatus(es enums.UserStatus) *UserSettingUpdate { + usu.mutation.SetStatus(es) + return usu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableStatus(es *enums.UserStatus) *UserSettingUpdate { + if es != nil { + usu.SetStatus(*es) + } + return usu +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (usu *UserSettingUpdate) SetEmailConfirmed(b bool) *UserSettingUpdate { + usu.mutation.SetEmailConfirmed(b) + return usu +} + +// SetNillableEmailConfirmed sets the "email_confirmed" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableEmailConfirmed(b *bool) *UserSettingUpdate { + if b != nil { + usu.SetEmailConfirmed(*b) + } + return usu +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (usu *UserSettingUpdate) SetIsWebauthnAllowed(b bool) *UserSettingUpdate { + usu.mutation.SetIsWebauthnAllowed(b) + return usu +} + +// SetNillableIsWebauthnAllowed sets the "is_webauthn_allowed" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableIsWebauthnAllowed(b *bool) *UserSettingUpdate { + if b != nil { + usu.SetIsWebauthnAllowed(*b) + } + return usu +} + +// ClearIsWebauthnAllowed clears the value of the "is_webauthn_allowed" field. +func (usu *UserSettingUpdate) ClearIsWebauthnAllowed() *UserSettingUpdate { + usu.mutation.ClearIsWebauthnAllowed() + return usu +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (usu *UserSettingUpdate) SetIsTfaEnabled(b bool) *UserSettingUpdate { + usu.mutation.SetIsTfaEnabled(b) + return usu +} + +// SetNillableIsTfaEnabled sets the "is_tfa_enabled" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableIsTfaEnabled(b *bool) *UserSettingUpdate { + if b != nil { + usu.SetIsTfaEnabled(*b) + } + return usu +} + +// ClearIsTfaEnabled clears the value of the "is_tfa_enabled" field. +func (usu *UserSettingUpdate) ClearIsTfaEnabled() *UserSettingUpdate { + usu.mutation.ClearIsTfaEnabled() + return usu +} + +// SetPhoneNumber sets the "phone_number" field. +func (usu *UserSettingUpdate) SetPhoneNumber(s string) *UserSettingUpdate { + usu.mutation.SetPhoneNumber(s) + return usu +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (usu *UserSettingUpdate) SetNillablePhoneNumber(s *string) *UserSettingUpdate { + if s != nil { + usu.SetPhoneNumber(*s) + } + return usu +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (usu *UserSettingUpdate) ClearPhoneNumber() *UserSettingUpdate { + usu.mutation.ClearPhoneNumber() + return usu +} + +// SetUser sets the "user" edge to the User entity. +func (usu *UserSettingUpdate) SetUser(u *User) *UserSettingUpdate { + return usu.SetUserID(u.ID) +} + +// SetDefaultOrgID sets the "default_org" edge to the Organization entity by ID. +func (usu *UserSettingUpdate) SetDefaultOrgID(id string) *UserSettingUpdate { + usu.mutation.SetDefaultOrgID(id) + return usu +} + +// SetNillableDefaultOrgID sets the "default_org" edge to the Organization entity by ID if the given value is not nil. +func (usu *UserSettingUpdate) SetNillableDefaultOrgID(id *string) *UserSettingUpdate { + if id != nil { + usu = usu.SetDefaultOrgID(*id) + } + return usu +} + +// SetDefaultOrg sets the "default_org" edge to the Organization entity. +func (usu *UserSettingUpdate) SetDefaultOrg(o *Organization) *UserSettingUpdate { + return usu.SetDefaultOrgID(o.ID) +} + +// Mutation returns the UserSettingMutation object of the builder. +func (usu *UserSettingUpdate) Mutation() *UserSettingMutation { + return usu.mutation +} + +// ClearUser clears the "user" edge to the User entity. +func (usu *UserSettingUpdate) ClearUser() *UserSettingUpdate { + usu.mutation.ClearUser() + return usu +} + +// ClearDefaultOrg clears the "default_org" edge to the Organization entity. +func (usu *UserSettingUpdate) ClearDefaultOrg() *UserSettingUpdate { + usu.mutation.ClearDefaultOrg() + return usu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (usu *UserSettingUpdate) Save(ctx context.Context) (int, error) { + if err := usu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, usu.sqlSave, usu.mutation, usu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (usu *UserSettingUpdate) SaveX(ctx context.Context) int { + affected, err := usu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (usu *UserSettingUpdate) Exec(ctx context.Context) error { + _, err := usu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (usu *UserSettingUpdate) ExecX(ctx context.Context) { + if err := usu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (usu *UserSettingUpdate) defaults() error { + if _, ok := usu.mutation.UpdatedAt(); !ok && !usu.mutation.UpdatedAtCleared() { + if usersetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized usersetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := usersetting.UpdateDefaultUpdatedAt() + usu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (usu *UserSettingUpdate) check() error { + if v, ok := usu.mutation.Status(); ok { + if err := usersetting.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "UserSetting.status": %w`, err)} + } + } + return nil +} + +func (usu *UserSettingUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := usu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(usersetting.Table, usersetting.Columns, sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString)) + if ps := usu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if usu.mutation.CreatedAtCleared() { + _spec.ClearField(usersetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := usu.mutation.UpdatedAt(); ok { + _spec.SetField(usersetting.FieldUpdatedAt, field.TypeTime, value) + } + if usu.mutation.UpdatedAtCleared() { + _spec.ClearField(usersetting.FieldUpdatedAt, field.TypeTime) + } + if usu.mutation.CreatedByCleared() { + _spec.ClearField(usersetting.FieldCreatedBy, field.TypeString) + } + if value, ok := usu.mutation.UpdatedBy(); ok { + _spec.SetField(usersetting.FieldUpdatedBy, field.TypeString, value) + } + if usu.mutation.UpdatedByCleared() { + _spec.ClearField(usersetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := usu.mutation.Tags(); ok { + _spec.SetField(usersetting.FieldTags, field.TypeJSON, value) + } + if value, ok := usu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, usersetting.FieldTags, value) + }) + } + if usu.mutation.TagsCleared() { + _spec.ClearField(usersetting.FieldTags, field.TypeJSON) + } + if value, ok := usu.mutation.DeletedAt(); ok { + _spec.SetField(usersetting.FieldDeletedAt, field.TypeTime, value) + } + if usu.mutation.DeletedAtCleared() { + _spec.ClearField(usersetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := usu.mutation.DeletedBy(); ok { + _spec.SetField(usersetting.FieldDeletedBy, field.TypeString, value) + } + if usu.mutation.DeletedByCleared() { + _spec.ClearField(usersetting.FieldDeletedBy, field.TypeString) + } + if value, ok := usu.mutation.Locked(); ok { + _spec.SetField(usersetting.FieldLocked, field.TypeBool, value) + } + if value, ok := usu.mutation.SilencedAt(); ok { + _spec.SetField(usersetting.FieldSilencedAt, field.TypeTime, value) + } + if usu.mutation.SilencedAtCleared() { + _spec.ClearField(usersetting.FieldSilencedAt, field.TypeTime) + } + if value, ok := usu.mutation.SuspendedAt(); ok { + _spec.SetField(usersetting.FieldSuspendedAt, field.TypeTime, value) + } + if usu.mutation.SuspendedAtCleared() { + _spec.ClearField(usersetting.FieldSuspendedAt, field.TypeTime) + } + if value, ok := usu.mutation.Status(); ok { + _spec.SetField(usersetting.FieldStatus, field.TypeEnum, value) + } + if value, ok := usu.mutation.EmailConfirmed(); ok { + _spec.SetField(usersetting.FieldEmailConfirmed, field.TypeBool, value) + } + if value, ok := usu.mutation.IsWebauthnAllowed(); ok { + _spec.SetField(usersetting.FieldIsWebauthnAllowed, field.TypeBool, value) + } + if usu.mutation.IsWebauthnAllowedCleared() { + _spec.ClearField(usersetting.FieldIsWebauthnAllowed, field.TypeBool) + } + if value, ok := usu.mutation.IsTfaEnabled(); ok { + _spec.SetField(usersetting.FieldIsTfaEnabled, field.TypeBool, value) + } + if usu.mutation.IsTfaEnabledCleared() { + _spec.ClearField(usersetting.FieldIsTfaEnabled, field.TypeBool) + } + if value, ok := usu.mutation.PhoneNumber(); ok { + _spec.SetField(usersetting.FieldPhoneNumber, field.TypeString, value) + } + if usu.mutation.PhoneNumberCleared() { + _spec.ClearField(usersetting.FieldPhoneNumber, field.TypeString) + } + if usu.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: usersetting.UserTable, + Columns: []string{usersetting.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = usu.schemaConfig.UserSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := usu.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: usersetting.UserTable, + Columns: []string{usersetting.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = usu.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if usu.mutation.DefaultOrgCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: usersetting.DefaultOrgTable, + Columns: []string{usersetting.DefaultOrgColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = usu.schemaConfig.UserSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := usu.mutation.DefaultOrgIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: usersetting.DefaultOrgTable, + Columns: []string{usersetting.DefaultOrgColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = usu.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = usu.schemaConfig.UserSetting + ctx = internal.NewSchemaConfigContext(ctx, usu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, usu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{usersetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + usu.mutation.done = true + return n, nil +} + +// UserSettingUpdateOne is the builder for updating a single UserSetting entity. +type UserSettingUpdateOne struct { + config + fields []string + hooks []Hook + mutation *UserSettingMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (usuo *UserSettingUpdateOne) SetUpdatedAt(t time.Time) *UserSettingUpdateOne { + usuo.mutation.SetUpdatedAt(t) + return usuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (usuo *UserSettingUpdateOne) ClearUpdatedAt() *UserSettingUpdateOne { + usuo.mutation.ClearUpdatedAt() + return usuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (usuo *UserSettingUpdateOne) SetUpdatedBy(s string) *UserSettingUpdateOne { + usuo.mutation.SetUpdatedBy(s) + return usuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableUpdatedBy(s *string) *UserSettingUpdateOne { + if s != nil { + usuo.SetUpdatedBy(*s) + } + return usuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (usuo *UserSettingUpdateOne) ClearUpdatedBy() *UserSettingUpdateOne { + usuo.mutation.ClearUpdatedBy() + return usuo +} + +// SetTags sets the "tags" field. +func (usuo *UserSettingUpdateOne) SetTags(s []string) *UserSettingUpdateOne { + usuo.mutation.SetTags(s) + return usuo +} + +// AppendTags appends s to the "tags" field. +func (usuo *UserSettingUpdateOne) AppendTags(s []string) *UserSettingUpdateOne { + usuo.mutation.AppendTags(s) + return usuo +} + +// ClearTags clears the value of the "tags" field. +func (usuo *UserSettingUpdateOne) ClearTags() *UserSettingUpdateOne { + usuo.mutation.ClearTags() + return usuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (usuo *UserSettingUpdateOne) SetDeletedAt(t time.Time) *UserSettingUpdateOne { + usuo.mutation.SetDeletedAt(t) + return usuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableDeletedAt(t *time.Time) *UserSettingUpdateOne { + if t != nil { + usuo.SetDeletedAt(*t) + } + return usuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (usuo *UserSettingUpdateOne) ClearDeletedAt() *UserSettingUpdateOne { + usuo.mutation.ClearDeletedAt() + return usuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (usuo *UserSettingUpdateOne) SetDeletedBy(s string) *UserSettingUpdateOne { + usuo.mutation.SetDeletedBy(s) + return usuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableDeletedBy(s *string) *UserSettingUpdateOne { + if s != nil { + usuo.SetDeletedBy(*s) + } + return usuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (usuo *UserSettingUpdateOne) ClearDeletedBy() *UserSettingUpdateOne { + usuo.mutation.ClearDeletedBy() + return usuo +} + +// SetUserID sets the "user_id" field. +func (usuo *UserSettingUpdateOne) SetUserID(s string) *UserSettingUpdateOne { + usuo.mutation.SetUserID(s) + return usuo +} + +// SetNillableUserID sets the "user_id" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableUserID(s *string) *UserSettingUpdateOne { + if s != nil { + usuo.SetUserID(*s) + } + return usuo +} + +// ClearUserID clears the value of the "user_id" field. +func (usuo *UserSettingUpdateOne) ClearUserID() *UserSettingUpdateOne { + usuo.mutation.ClearUserID() + return usuo +} + +// SetLocked sets the "locked" field. +func (usuo *UserSettingUpdateOne) SetLocked(b bool) *UserSettingUpdateOne { + usuo.mutation.SetLocked(b) + return usuo +} + +// SetNillableLocked sets the "locked" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableLocked(b *bool) *UserSettingUpdateOne { + if b != nil { + usuo.SetLocked(*b) + } + return usuo +} + +// SetSilencedAt sets the "silenced_at" field. +func (usuo *UserSettingUpdateOne) SetSilencedAt(t time.Time) *UserSettingUpdateOne { + usuo.mutation.SetSilencedAt(t) + return usuo +} + +// SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableSilencedAt(t *time.Time) *UserSettingUpdateOne { + if t != nil { + usuo.SetSilencedAt(*t) + } + return usuo +} + +// ClearSilencedAt clears the value of the "silenced_at" field. +func (usuo *UserSettingUpdateOne) ClearSilencedAt() *UserSettingUpdateOne { + usuo.mutation.ClearSilencedAt() + return usuo +} + +// SetSuspendedAt sets the "suspended_at" field. +func (usuo *UserSettingUpdateOne) SetSuspendedAt(t time.Time) *UserSettingUpdateOne { + usuo.mutation.SetSuspendedAt(t) + return usuo +} + +// SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableSuspendedAt(t *time.Time) *UserSettingUpdateOne { + if t != nil { + usuo.SetSuspendedAt(*t) + } + return usuo +} + +// ClearSuspendedAt clears the value of the "suspended_at" field. +func (usuo *UserSettingUpdateOne) ClearSuspendedAt() *UserSettingUpdateOne { + usuo.mutation.ClearSuspendedAt() + return usuo +} + +// SetStatus sets the "status" field. +func (usuo *UserSettingUpdateOne) SetStatus(es enums.UserStatus) *UserSettingUpdateOne { + usuo.mutation.SetStatus(es) + return usuo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableStatus(es *enums.UserStatus) *UserSettingUpdateOne { + if es != nil { + usuo.SetStatus(*es) + } + return usuo +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (usuo *UserSettingUpdateOne) SetEmailConfirmed(b bool) *UserSettingUpdateOne { + usuo.mutation.SetEmailConfirmed(b) + return usuo +} + +// SetNillableEmailConfirmed sets the "email_confirmed" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableEmailConfirmed(b *bool) *UserSettingUpdateOne { + if b != nil { + usuo.SetEmailConfirmed(*b) + } + return usuo +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (usuo *UserSettingUpdateOne) SetIsWebauthnAllowed(b bool) *UserSettingUpdateOne { + usuo.mutation.SetIsWebauthnAllowed(b) + return usuo +} + +// SetNillableIsWebauthnAllowed sets the "is_webauthn_allowed" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableIsWebauthnAllowed(b *bool) *UserSettingUpdateOne { + if b != nil { + usuo.SetIsWebauthnAllowed(*b) + } + return usuo +} + +// ClearIsWebauthnAllowed clears the value of the "is_webauthn_allowed" field. +func (usuo *UserSettingUpdateOne) ClearIsWebauthnAllowed() *UserSettingUpdateOne { + usuo.mutation.ClearIsWebauthnAllowed() + return usuo +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (usuo *UserSettingUpdateOne) SetIsTfaEnabled(b bool) *UserSettingUpdateOne { + usuo.mutation.SetIsTfaEnabled(b) + return usuo +} + +// SetNillableIsTfaEnabled sets the "is_tfa_enabled" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableIsTfaEnabled(b *bool) *UserSettingUpdateOne { + if b != nil { + usuo.SetIsTfaEnabled(*b) + } + return usuo +} + +// ClearIsTfaEnabled clears the value of the "is_tfa_enabled" field. +func (usuo *UserSettingUpdateOne) ClearIsTfaEnabled() *UserSettingUpdateOne { + usuo.mutation.ClearIsTfaEnabled() + return usuo +} + +// SetPhoneNumber sets the "phone_number" field. +func (usuo *UserSettingUpdateOne) SetPhoneNumber(s string) *UserSettingUpdateOne { + usuo.mutation.SetPhoneNumber(s) + return usuo +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillablePhoneNumber(s *string) *UserSettingUpdateOne { + if s != nil { + usuo.SetPhoneNumber(*s) + } + return usuo +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (usuo *UserSettingUpdateOne) ClearPhoneNumber() *UserSettingUpdateOne { + usuo.mutation.ClearPhoneNumber() + return usuo +} + +// SetUser sets the "user" edge to the User entity. +func (usuo *UserSettingUpdateOne) SetUser(u *User) *UserSettingUpdateOne { + return usuo.SetUserID(u.ID) +} + +// SetDefaultOrgID sets the "default_org" edge to the Organization entity by ID. +func (usuo *UserSettingUpdateOne) SetDefaultOrgID(id string) *UserSettingUpdateOne { + usuo.mutation.SetDefaultOrgID(id) + return usuo +} + +// SetNillableDefaultOrgID sets the "default_org" edge to the Organization entity by ID if the given value is not nil. +func (usuo *UserSettingUpdateOne) SetNillableDefaultOrgID(id *string) *UserSettingUpdateOne { + if id != nil { + usuo = usuo.SetDefaultOrgID(*id) + } + return usuo +} + +// SetDefaultOrg sets the "default_org" edge to the Organization entity. +func (usuo *UserSettingUpdateOne) SetDefaultOrg(o *Organization) *UserSettingUpdateOne { + return usuo.SetDefaultOrgID(o.ID) +} + +// Mutation returns the UserSettingMutation object of the builder. +func (usuo *UserSettingUpdateOne) Mutation() *UserSettingMutation { + return usuo.mutation +} + +// ClearUser clears the "user" edge to the User entity. +func (usuo *UserSettingUpdateOne) ClearUser() *UserSettingUpdateOne { + usuo.mutation.ClearUser() + return usuo +} + +// ClearDefaultOrg clears the "default_org" edge to the Organization entity. +func (usuo *UserSettingUpdateOne) ClearDefaultOrg() *UserSettingUpdateOne { + usuo.mutation.ClearDefaultOrg() + return usuo +} + +// Where appends a list predicates to the UserSettingUpdate builder. +func (usuo *UserSettingUpdateOne) Where(ps ...predicate.UserSetting) *UserSettingUpdateOne { + usuo.mutation.Where(ps...) + return usuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (usuo *UserSettingUpdateOne) Select(field string, fields ...string) *UserSettingUpdateOne { + usuo.fields = append([]string{field}, fields...) + return usuo +} + +// Save executes the query and returns the updated UserSetting entity. +func (usuo *UserSettingUpdateOne) Save(ctx context.Context) (*UserSetting, error) { + if err := usuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, usuo.sqlSave, usuo.mutation, usuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (usuo *UserSettingUpdateOne) SaveX(ctx context.Context) *UserSetting { + node, err := usuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (usuo *UserSettingUpdateOne) Exec(ctx context.Context) error { + _, err := usuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (usuo *UserSettingUpdateOne) ExecX(ctx context.Context) { + if err := usuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (usuo *UserSettingUpdateOne) defaults() error { + if _, ok := usuo.mutation.UpdatedAt(); !ok && !usuo.mutation.UpdatedAtCleared() { + if usersetting.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized usersetting.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := usersetting.UpdateDefaultUpdatedAt() + usuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (usuo *UserSettingUpdateOne) check() error { + if v, ok := usuo.mutation.Status(); ok { + if err := usersetting.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "UserSetting.status": %w`, err)} + } + } + return nil +} + +func (usuo *UserSettingUpdateOne) sqlSave(ctx context.Context) (_node *UserSetting, err error) { + if err := usuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(usersetting.Table, usersetting.Columns, sqlgraph.NewFieldSpec(usersetting.FieldID, field.TypeString)) + id, ok := usuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "UserSetting.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := usuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, usersetting.FieldID) + for _, f := range fields { + if !usersetting.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != usersetting.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := usuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if usuo.mutation.CreatedAtCleared() { + _spec.ClearField(usersetting.FieldCreatedAt, field.TypeTime) + } + if value, ok := usuo.mutation.UpdatedAt(); ok { + _spec.SetField(usersetting.FieldUpdatedAt, field.TypeTime, value) + } + if usuo.mutation.UpdatedAtCleared() { + _spec.ClearField(usersetting.FieldUpdatedAt, field.TypeTime) + } + if usuo.mutation.CreatedByCleared() { + _spec.ClearField(usersetting.FieldCreatedBy, field.TypeString) + } + if value, ok := usuo.mutation.UpdatedBy(); ok { + _spec.SetField(usersetting.FieldUpdatedBy, field.TypeString, value) + } + if usuo.mutation.UpdatedByCleared() { + _spec.ClearField(usersetting.FieldUpdatedBy, field.TypeString) + } + if value, ok := usuo.mutation.Tags(); ok { + _spec.SetField(usersetting.FieldTags, field.TypeJSON, value) + } + if value, ok := usuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, usersetting.FieldTags, value) + }) + } + if usuo.mutation.TagsCleared() { + _spec.ClearField(usersetting.FieldTags, field.TypeJSON) + } + if value, ok := usuo.mutation.DeletedAt(); ok { + _spec.SetField(usersetting.FieldDeletedAt, field.TypeTime, value) + } + if usuo.mutation.DeletedAtCleared() { + _spec.ClearField(usersetting.FieldDeletedAt, field.TypeTime) + } + if value, ok := usuo.mutation.DeletedBy(); ok { + _spec.SetField(usersetting.FieldDeletedBy, field.TypeString, value) + } + if usuo.mutation.DeletedByCleared() { + _spec.ClearField(usersetting.FieldDeletedBy, field.TypeString) + } + if value, ok := usuo.mutation.Locked(); ok { + _spec.SetField(usersetting.FieldLocked, field.TypeBool, value) + } + if value, ok := usuo.mutation.SilencedAt(); ok { + _spec.SetField(usersetting.FieldSilencedAt, field.TypeTime, value) + } + if usuo.mutation.SilencedAtCleared() { + _spec.ClearField(usersetting.FieldSilencedAt, field.TypeTime) + } + if value, ok := usuo.mutation.SuspendedAt(); ok { + _spec.SetField(usersetting.FieldSuspendedAt, field.TypeTime, value) + } + if usuo.mutation.SuspendedAtCleared() { + _spec.ClearField(usersetting.FieldSuspendedAt, field.TypeTime) + } + if value, ok := usuo.mutation.Status(); ok { + _spec.SetField(usersetting.FieldStatus, field.TypeEnum, value) + } + if value, ok := usuo.mutation.EmailConfirmed(); ok { + _spec.SetField(usersetting.FieldEmailConfirmed, field.TypeBool, value) + } + if value, ok := usuo.mutation.IsWebauthnAllowed(); ok { + _spec.SetField(usersetting.FieldIsWebauthnAllowed, field.TypeBool, value) + } + if usuo.mutation.IsWebauthnAllowedCleared() { + _spec.ClearField(usersetting.FieldIsWebauthnAllowed, field.TypeBool) + } + if value, ok := usuo.mutation.IsTfaEnabled(); ok { + _spec.SetField(usersetting.FieldIsTfaEnabled, field.TypeBool, value) + } + if usuo.mutation.IsTfaEnabledCleared() { + _spec.ClearField(usersetting.FieldIsTfaEnabled, field.TypeBool) + } + if value, ok := usuo.mutation.PhoneNumber(); ok { + _spec.SetField(usersetting.FieldPhoneNumber, field.TypeString, value) + } + if usuo.mutation.PhoneNumberCleared() { + _spec.ClearField(usersetting.FieldPhoneNumber, field.TypeString) + } + if usuo.mutation.UserCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: usersetting.UserTable, + Columns: []string{usersetting.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = usuo.schemaConfig.UserSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := usuo.mutation.UserIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.O2O, + Inverse: true, + Table: usersetting.UserTable, + Columns: []string{usersetting.UserColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = usuo.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if usuo.mutation.DefaultOrgCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: usersetting.DefaultOrgTable, + Columns: []string{usersetting.DefaultOrgColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = usuo.schemaConfig.UserSetting + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := usuo.mutation.DefaultOrgIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: false, + Table: usersetting.DefaultOrgTable, + Columns: []string{usersetting.DefaultOrgColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = usuo.schemaConfig.UserSetting + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = usuo.schemaConfig.UserSetting + ctx = internal.NewSchemaConfigContext(ctx, usuo.schemaConfig) + _node = &UserSetting{config: usuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, usuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{usersetting.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + usuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/usersettinghistory.go b/internal/ent/generated/usersettinghistory.go new file mode 100644 index 0000000..30b1548 --- /dev/null +++ b/internal/ent/generated/usersettinghistory.go @@ -0,0 +1,333 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// UserSettingHistory is the model entity for the UserSettingHistory schema. +type UserSettingHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // UserID holds the value of the "user_id" field. + UserID string `json:"user_id,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked bool `json:"locked,omitempty"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silenced_at,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspended_at,omitempty"` + // status of the user account + Status enums.UserStatus `json:"status,omitempty"` + // whether the user has confirmed their email address + EmailConfirmed bool `json:"email_confirmed,omitempty"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed bool `json:"is_webauthn_allowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled bool `json:"is_tfa_enabled,omitempty"` + // phone number associated with the account, used 2factor SMS authentication + PhoneNumber *string `json:"phone_number,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*UserSettingHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case usersettinghistory.FieldTags: + values[i] = new([]byte) + case usersettinghistory.FieldOperation: + values[i] = new(history.OpType) + case usersettinghistory.FieldLocked, usersettinghistory.FieldEmailConfirmed, usersettinghistory.FieldIsWebauthnAllowed, usersettinghistory.FieldIsTfaEnabled: + values[i] = new(sql.NullBool) + case usersettinghistory.FieldID, usersettinghistory.FieldRef, usersettinghistory.FieldCreatedBy, usersettinghistory.FieldUpdatedBy, usersettinghistory.FieldMappingID, usersettinghistory.FieldDeletedBy, usersettinghistory.FieldUserID, usersettinghistory.FieldStatus, usersettinghistory.FieldPhoneNumber: + values[i] = new(sql.NullString) + case usersettinghistory.FieldHistoryTime, usersettinghistory.FieldCreatedAt, usersettinghistory.FieldUpdatedAt, usersettinghistory.FieldDeletedAt, usersettinghistory.FieldSilencedAt, usersettinghistory.FieldSuspendedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the UserSettingHistory fields. +func (ush *UserSettingHistory) 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 usersettinghistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + ush.ID = value.String + } + case usersettinghistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + ush.HistoryTime = value.Time + } + case usersettinghistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + ush.Ref = value.String + } + case usersettinghistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + ush.Operation = *value + } + case usersettinghistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + ush.CreatedAt = value.Time + } + case usersettinghistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + ush.UpdatedAt = value.Time + } + case usersettinghistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + ush.CreatedBy = value.String + } + case usersettinghistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + ush.UpdatedBy = value.String + } + case usersettinghistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + ush.MappingID = value.String + } + case usersettinghistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &ush.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case usersettinghistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + ush.DeletedAt = value.Time + } + case usersettinghistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + ush.DeletedBy = value.String + } + case usersettinghistory.FieldUserID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field user_id", values[i]) + } else if value.Valid { + ush.UserID = value.String + } + case usersettinghistory.FieldLocked: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field locked", values[i]) + } else if value.Valid { + ush.Locked = value.Bool + } + case usersettinghistory.FieldSilencedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field silenced_at", values[i]) + } else if value.Valid { + ush.SilencedAt = new(time.Time) + *ush.SilencedAt = value.Time + } + case usersettinghistory.FieldSuspendedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field suspended_at", values[i]) + } else if value.Valid { + ush.SuspendedAt = new(time.Time) + *ush.SuspendedAt = value.Time + } + case usersettinghistory.FieldStatus: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field status", values[i]) + } else if value.Valid { + ush.Status = enums.UserStatus(value.String) + } + case usersettinghistory.FieldEmailConfirmed: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field email_confirmed", values[i]) + } else if value.Valid { + ush.EmailConfirmed = value.Bool + } + case usersettinghistory.FieldIsWebauthnAllowed: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field is_webauthn_allowed", values[i]) + } else if value.Valid { + ush.IsWebauthnAllowed = value.Bool + } + case usersettinghistory.FieldIsTfaEnabled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field is_tfa_enabled", values[i]) + } else if value.Valid { + ush.IsTfaEnabled = value.Bool + } + case usersettinghistory.FieldPhoneNumber: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field phone_number", values[i]) + } else if value.Valid { + ush.PhoneNumber = new(string) + *ush.PhoneNumber = value.String + } + default: + ush.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the UserSettingHistory. +// This includes values selected through modifiers, order, etc. +func (ush *UserSettingHistory) Value(name string) (ent.Value, error) { + return ush.selectValues.Get(name) +} + +// Update returns a builder for updating this UserSettingHistory. +// Note that you need to call UserSettingHistory.Unwrap() before calling this method if this UserSettingHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (ush *UserSettingHistory) Update() *UserSettingHistoryUpdateOne { + return NewUserSettingHistoryClient(ush.config).UpdateOne(ush) +} + +// Unwrap unwraps the UserSettingHistory 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 (ush *UserSettingHistory) Unwrap() *UserSettingHistory { + _tx, ok := ush.config.driver.(*txDriver) + if !ok { + panic("generated: UserSettingHistory is not a transactional entity") + } + ush.config.driver = _tx.drv + return ush +} + +// String implements the fmt.Stringer. +func (ush *UserSettingHistory) String() string { + var builder strings.Builder + builder.WriteString("UserSettingHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", ush.ID)) + builder.WriteString("history_time=") + builder.WriteString(ush.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(ush.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", ush.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(ush.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(ush.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(ush.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(ush.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(ush.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", ush.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(ush.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(ush.DeletedBy) + builder.WriteString(", ") + builder.WriteString("user_id=") + builder.WriteString(ush.UserID) + builder.WriteString(", ") + builder.WriteString("locked=") + builder.WriteString(fmt.Sprintf("%v", ush.Locked)) + builder.WriteString(", ") + if v := ush.SilencedAt; v != nil { + builder.WriteString("silenced_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + if v := ush.SuspendedAt; v != nil { + builder.WriteString("suspended_at=") + builder.WriteString(v.Format(time.ANSIC)) + } + builder.WriteString(", ") + builder.WriteString("status=") + builder.WriteString(fmt.Sprintf("%v", ush.Status)) + builder.WriteString(", ") + builder.WriteString("email_confirmed=") + builder.WriteString(fmt.Sprintf("%v", ush.EmailConfirmed)) + builder.WriteString(", ") + builder.WriteString("is_webauthn_allowed=") + builder.WriteString(fmt.Sprintf("%v", ush.IsWebauthnAllowed)) + builder.WriteString(", ") + builder.WriteString("is_tfa_enabled=") + builder.WriteString(fmt.Sprintf("%v", ush.IsTfaEnabled)) + builder.WriteString(", ") + if v := ush.PhoneNumber; v != nil { + builder.WriteString("phone_number=") + builder.WriteString(*v) + } + builder.WriteByte(')') + return builder.String() +} + +// UserSettingHistories is a parsable slice of UserSettingHistory. +type UserSettingHistories []*UserSettingHistory diff --git a/internal/ent/generated/usersettinghistory/usersettinghistory.go b/internal/ent/generated/usersettinghistory/usersettinghistory.go new file mode 100644 index 0000000..b2c342b --- /dev/null +++ b/internal/ent/generated/usersettinghistory/usersettinghistory.go @@ -0,0 +1,268 @@ +// Code generated by ent, DO NOT EDIT. + +package usersettinghistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the usersettinghistory type in the database. + Label = "user_setting_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldUserID holds the string denoting the user_id field in the database. + FieldUserID = "user_id" + // FieldLocked holds the string denoting the locked field in the database. + FieldLocked = "locked" + // FieldSilencedAt holds the string denoting the silenced_at field in the database. + FieldSilencedAt = "silenced_at" + // FieldSuspendedAt holds the string denoting the suspended_at field in the database. + FieldSuspendedAt = "suspended_at" + // FieldStatus holds the string denoting the status field in the database. + FieldStatus = "status" + // FieldEmailConfirmed holds the string denoting the email_confirmed field in the database. + FieldEmailConfirmed = "email_confirmed" + // FieldIsWebauthnAllowed holds the string denoting the is_webauthn_allowed field in the database. + FieldIsWebauthnAllowed = "is_webauthn_allowed" + // FieldIsTfaEnabled holds the string denoting the is_tfa_enabled field in the database. + FieldIsTfaEnabled = "is_tfa_enabled" + // FieldPhoneNumber holds the string denoting the phone_number field in the database. + FieldPhoneNumber = "phone_number" + // Table holds the table name of the usersettinghistory in the database. + Table = "user_setting_history" +) + +// Columns holds all SQL columns for usersettinghistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldUserID, + FieldLocked, + FieldSilencedAt, + FieldSuspendedAt, + FieldStatus, + FieldEmailConfirmed, + FieldIsWebauthnAllowed, + FieldIsTfaEnabled, + FieldPhoneNumber, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Interceptors [1]ent.Interceptor + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultLocked holds the default value on creation for the "locked" field. + DefaultLocked bool + // DefaultEmailConfirmed holds the default value on creation for the "email_confirmed" field. + DefaultEmailConfirmed bool + // DefaultIsWebauthnAllowed holds the default value on creation for the "is_webauthn_allowed" field. + DefaultIsWebauthnAllowed bool + // DefaultIsTfaEnabled holds the default value on creation for the "is_tfa_enabled" field. + DefaultIsTfaEnabled bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("usersettinghistory: invalid enum value for operation field: %q", o) + } +} + +const DefaultStatus enums.UserStatus = "ACTIVE" + +// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save. +func StatusValidator(s enums.UserStatus) error { + switch s.String() { + case "ACTIVE", "INACTIVE", "DEACTIVATED", "SUSPENDED", "ONBOARDING": + return nil + default: + return fmt.Errorf("usersettinghistory: invalid enum value for status field: %q", s) + } +} + +// OrderOption defines the ordering options for the UserSettingHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByUserID orders the results by the user_id field. +func ByUserID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserID, opts...).ToFunc() +} + +// ByLocked orders the results by the locked field. +func ByLocked(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLocked, opts...).ToFunc() +} + +// BySilencedAt orders the results by the silenced_at field. +func BySilencedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSilencedAt, opts...).ToFunc() +} + +// BySuspendedAt orders the results by the suspended_at field. +func BySuspendedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSuspendedAt, opts...).ToFunc() +} + +// ByStatus orders the results by the status field. +func ByStatus(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStatus, opts...).ToFunc() +} + +// ByEmailConfirmed orders the results by the email_confirmed field. +func ByEmailConfirmed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEmailConfirmed, opts...).ToFunc() +} + +// ByIsWebauthnAllowed orders the results by the is_webauthn_allowed field. +func ByIsWebauthnAllowed(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldIsWebauthnAllowed, opts...).ToFunc() +} + +// ByIsTfaEnabled orders the results by the is_tfa_enabled field. +func ByIsTfaEnabled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldIsTfaEnabled, opts...).ToFunc() +} + +// ByPhoneNumber orders the results by the phone_number field. +func ByPhoneNumber(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldPhoneNumber, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) + +var ( + // enums.UserStatus must implement graphql.Marshaler. + _ graphql.Marshaler = (*enums.UserStatus)(nil) + // enums.UserStatus must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*enums.UserStatus)(nil) +) diff --git a/internal/ent/generated/usersettinghistory/where.go b/internal/ent/generated/usersettinghistory/where.go new file mode 100644 index 0000000..ce1e20e --- /dev/null +++ b/internal/ent/generated/usersettinghistory/where.go @@ -0,0 +1,1092 @@ +// Code generated by ent, DO NOT EDIT. + +package usersettinghistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ. +func UserID(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldUserID, v)) +} + +// Locked applies equality check predicate on the "locked" field. It's identical to LockedEQ. +func Locked(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldLocked, v)) +} + +// SilencedAt applies equality check predicate on the "silenced_at" field. It's identical to SilencedAtEQ. +func SilencedAt(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldSilencedAt, v)) +} + +// SuspendedAt applies equality check predicate on the "suspended_at" field. It's identical to SuspendedAtEQ. +func SuspendedAt(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldSuspendedAt, v)) +} + +// EmailConfirmed applies equality check predicate on the "email_confirmed" field. It's identical to EmailConfirmedEQ. +func EmailConfirmed(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldEmailConfirmed, v)) +} + +// IsWebauthnAllowed applies equality check predicate on the "is_webauthn_allowed" field. It's identical to IsWebauthnAllowedEQ. +func IsWebauthnAllowed(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldIsWebauthnAllowed, v)) +} + +// IsTfaEnabled applies equality check predicate on the "is_tfa_enabled" field. It's identical to IsTfaEnabledEQ. +func IsTfaEnabled(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldIsTfaEnabled, v)) +} + +// PhoneNumber applies equality check predicate on the "phone_number" field. It's identical to PhoneNumberEQ. +func PhoneNumber(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// UserIDEQ applies the EQ predicate on the "user_id" field. +func UserIDEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldUserID, v)) +} + +// UserIDNEQ applies the NEQ predicate on the "user_id" field. +func UserIDNEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldUserID, v)) +} + +// UserIDIn applies the In predicate on the "user_id" field. +func UserIDIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldUserID, vs...)) +} + +// UserIDNotIn applies the NotIn predicate on the "user_id" field. +func UserIDNotIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldUserID, vs...)) +} + +// UserIDGT applies the GT predicate on the "user_id" field. +func UserIDGT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldUserID, v)) +} + +// UserIDGTE applies the GTE predicate on the "user_id" field. +func UserIDGTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldUserID, v)) +} + +// UserIDLT applies the LT predicate on the "user_id" field. +func UserIDLT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldUserID, v)) +} + +// UserIDLTE applies the LTE predicate on the "user_id" field. +func UserIDLTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldUserID, v)) +} + +// UserIDContains applies the Contains predicate on the "user_id" field. +func UserIDContains(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContains(FieldUserID, v)) +} + +// UserIDHasPrefix applies the HasPrefix predicate on the "user_id" field. +func UserIDHasPrefix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasPrefix(FieldUserID, v)) +} + +// UserIDHasSuffix applies the HasSuffix predicate on the "user_id" field. +func UserIDHasSuffix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasSuffix(FieldUserID, v)) +} + +// UserIDIsNil applies the IsNil predicate on the "user_id" field. +func UserIDIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldUserID)) +} + +// UserIDNotNil applies the NotNil predicate on the "user_id" field. +func UserIDNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldUserID)) +} + +// UserIDEqualFold applies the EqualFold predicate on the "user_id" field. +func UserIDEqualFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldUserID, v)) +} + +// UserIDContainsFold applies the ContainsFold predicate on the "user_id" field. +func UserIDContainsFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldUserID, v)) +} + +// LockedEQ applies the EQ predicate on the "locked" field. +func LockedEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldLocked, v)) +} + +// LockedNEQ applies the NEQ predicate on the "locked" field. +func LockedNEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldLocked, v)) +} + +// SilencedAtEQ applies the EQ predicate on the "silenced_at" field. +func SilencedAtEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldSilencedAt, v)) +} + +// SilencedAtNEQ applies the NEQ predicate on the "silenced_at" field. +func SilencedAtNEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldSilencedAt, v)) +} + +// SilencedAtIn applies the In predicate on the "silenced_at" field. +func SilencedAtIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldSilencedAt, vs...)) +} + +// SilencedAtNotIn applies the NotIn predicate on the "silenced_at" field. +func SilencedAtNotIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldSilencedAt, vs...)) +} + +// SilencedAtGT applies the GT predicate on the "silenced_at" field. +func SilencedAtGT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldSilencedAt, v)) +} + +// SilencedAtGTE applies the GTE predicate on the "silenced_at" field. +func SilencedAtGTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldSilencedAt, v)) +} + +// SilencedAtLT applies the LT predicate on the "silenced_at" field. +func SilencedAtLT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldSilencedAt, v)) +} + +// SilencedAtLTE applies the LTE predicate on the "silenced_at" field. +func SilencedAtLTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldSilencedAt, v)) +} + +// SilencedAtIsNil applies the IsNil predicate on the "silenced_at" field. +func SilencedAtIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldSilencedAt)) +} + +// SilencedAtNotNil applies the NotNil predicate on the "silenced_at" field. +func SilencedAtNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldSilencedAt)) +} + +// SuspendedAtEQ applies the EQ predicate on the "suspended_at" field. +func SuspendedAtEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldSuspendedAt, v)) +} + +// SuspendedAtNEQ applies the NEQ predicate on the "suspended_at" field. +func SuspendedAtNEQ(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldSuspendedAt, v)) +} + +// SuspendedAtIn applies the In predicate on the "suspended_at" field. +func SuspendedAtIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldSuspendedAt, vs...)) +} + +// SuspendedAtNotIn applies the NotIn predicate on the "suspended_at" field. +func SuspendedAtNotIn(vs ...time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldSuspendedAt, vs...)) +} + +// SuspendedAtGT applies the GT predicate on the "suspended_at" field. +func SuspendedAtGT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldSuspendedAt, v)) +} + +// SuspendedAtGTE applies the GTE predicate on the "suspended_at" field. +func SuspendedAtGTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldSuspendedAt, v)) +} + +// SuspendedAtLT applies the LT predicate on the "suspended_at" field. +func SuspendedAtLT(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldSuspendedAt, v)) +} + +// SuspendedAtLTE applies the LTE predicate on the "suspended_at" field. +func SuspendedAtLTE(v time.Time) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldSuspendedAt, v)) +} + +// SuspendedAtIsNil applies the IsNil predicate on the "suspended_at" field. +func SuspendedAtIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldSuspendedAt)) +} + +// SuspendedAtNotNil applies the NotNil predicate on the "suspended_at" field. +func SuspendedAtNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldSuspendedAt)) +} + +// StatusEQ applies the EQ predicate on the "status" field. +func StatusEQ(v enums.UserStatus) predicate.UserSettingHistory { + vc := v + return predicate.UserSettingHistory(sql.FieldEQ(FieldStatus, vc)) +} + +// StatusNEQ applies the NEQ predicate on the "status" field. +func StatusNEQ(v enums.UserStatus) predicate.UserSettingHistory { + vc := v + return predicate.UserSettingHistory(sql.FieldNEQ(FieldStatus, vc)) +} + +// StatusIn applies the In predicate on the "status" field. +func StatusIn(vs ...enums.UserStatus) predicate.UserSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserSettingHistory(sql.FieldIn(FieldStatus, v...)) +} + +// StatusNotIn applies the NotIn predicate on the "status" field. +func StatusNotIn(vs ...enums.UserStatus) predicate.UserSettingHistory { + v := make([]any, len(vs)) + for i := range v { + v[i] = vs[i] + } + return predicate.UserSettingHistory(sql.FieldNotIn(FieldStatus, v...)) +} + +// EmailConfirmedEQ applies the EQ predicate on the "email_confirmed" field. +func EmailConfirmedEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldEmailConfirmed, v)) +} + +// EmailConfirmedNEQ applies the NEQ predicate on the "email_confirmed" field. +func EmailConfirmedNEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldEmailConfirmed, v)) +} + +// IsWebauthnAllowedEQ applies the EQ predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldIsWebauthnAllowed, v)) +} + +// IsWebauthnAllowedNEQ applies the NEQ predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedNEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldIsWebauthnAllowed, v)) +} + +// IsWebauthnAllowedIsNil applies the IsNil predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldIsWebauthnAllowed)) +} + +// IsWebauthnAllowedNotNil applies the NotNil predicate on the "is_webauthn_allowed" field. +func IsWebauthnAllowedNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldIsWebauthnAllowed)) +} + +// IsTfaEnabledEQ applies the EQ predicate on the "is_tfa_enabled" field. +func IsTfaEnabledEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldIsTfaEnabled, v)) +} + +// IsTfaEnabledNEQ applies the NEQ predicate on the "is_tfa_enabled" field. +func IsTfaEnabledNEQ(v bool) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldIsTfaEnabled, v)) +} + +// IsTfaEnabledIsNil applies the IsNil predicate on the "is_tfa_enabled" field. +func IsTfaEnabledIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldIsTfaEnabled)) +} + +// IsTfaEnabledNotNil applies the NotNil predicate on the "is_tfa_enabled" field. +func IsTfaEnabledNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldIsTfaEnabled)) +} + +// PhoneNumberEQ applies the EQ predicate on the "phone_number" field. +func PhoneNumberEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberNEQ applies the NEQ predicate on the "phone_number" field. +func PhoneNumberNEQ(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNEQ(FieldPhoneNumber, v)) +} + +// PhoneNumberIn applies the In predicate on the "phone_number" field. +func PhoneNumberIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberNotIn applies the NotIn predicate on the "phone_number" field. +func PhoneNumberNotIn(vs ...string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotIn(FieldPhoneNumber, vs...)) +} + +// PhoneNumberGT applies the GT predicate on the "phone_number" field. +func PhoneNumberGT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGT(FieldPhoneNumber, v)) +} + +// PhoneNumberGTE applies the GTE predicate on the "phone_number" field. +func PhoneNumberGTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldGTE(FieldPhoneNumber, v)) +} + +// PhoneNumberLT applies the LT predicate on the "phone_number" field. +func PhoneNumberLT(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLT(FieldPhoneNumber, v)) +} + +// PhoneNumberLTE applies the LTE predicate on the "phone_number" field. +func PhoneNumberLTE(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldLTE(FieldPhoneNumber, v)) +} + +// PhoneNumberContains applies the Contains predicate on the "phone_number" field. +func PhoneNumberContains(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContains(FieldPhoneNumber, v)) +} + +// PhoneNumberHasPrefix applies the HasPrefix predicate on the "phone_number" field. +func PhoneNumberHasPrefix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasPrefix(FieldPhoneNumber, v)) +} + +// PhoneNumberHasSuffix applies the HasSuffix predicate on the "phone_number" field. +func PhoneNumberHasSuffix(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldHasSuffix(FieldPhoneNumber, v)) +} + +// PhoneNumberIsNil applies the IsNil predicate on the "phone_number" field. +func PhoneNumberIsNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldIsNull(FieldPhoneNumber)) +} + +// PhoneNumberNotNil applies the NotNil predicate on the "phone_number" field. +func PhoneNumberNotNil() predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldNotNull(FieldPhoneNumber)) +} + +// PhoneNumberEqualFold applies the EqualFold predicate on the "phone_number" field. +func PhoneNumberEqualFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldEqualFold(FieldPhoneNumber, v)) +} + +// PhoneNumberContainsFold applies the ContainsFold predicate on the "phone_number" field. +func PhoneNumberContainsFold(v string) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.FieldContainsFold(FieldPhoneNumber, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.UserSettingHistory) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.UserSettingHistory) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.UserSettingHistory) predicate.UserSettingHistory { + return predicate.UserSettingHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/usersettinghistory_create.go b/internal/ent/generated/usersettinghistory_create.go new file mode 100644 index 0000000..20e58b8 --- /dev/null +++ b/internal/ent/generated/usersettinghistory_create.go @@ -0,0 +1,615 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +// UserSettingHistoryCreate is the builder for creating a UserSettingHistory entity. +type UserSettingHistoryCreate struct { + config + mutation *UserSettingHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (ushc *UserSettingHistoryCreate) SetHistoryTime(t time.Time) *UserSettingHistoryCreate { + ushc.mutation.SetHistoryTime(t) + return ushc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableHistoryTime(t *time.Time) *UserSettingHistoryCreate { + if t != nil { + ushc.SetHistoryTime(*t) + } + return ushc +} + +// SetRef sets the "ref" field. +func (ushc *UserSettingHistoryCreate) SetRef(s string) *UserSettingHistoryCreate { + ushc.mutation.SetRef(s) + return ushc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableRef(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetRef(*s) + } + return ushc +} + +// SetOperation sets the "operation" field. +func (ushc *UserSettingHistoryCreate) SetOperation(ht history.OpType) *UserSettingHistoryCreate { + ushc.mutation.SetOperation(ht) + return ushc +} + +// SetCreatedAt sets the "created_at" field. +func (ushc *UserSettingHistoryCreate) SetCreatedAt(t time.Time) *UserSettingHistoryCreate { + ushc.mutation.SetCreatedAt(t) + return ushc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableCreatedAt(t *time.Time) *UserSettingHistoryCreate { + if t != nil { + ushc.SetCreatedAt(*t) + } + return ushc +} + +// SetUpdatedAt sets the "updated_at" field. +func (ushc *UserSettingHistoryCreate) SetUpdatedAt(t time.Time) *UserSettingHistoryCreate { + ushc.mutation.SetUpdatedAt(t) + return ushc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableUpdatedAt(t *time.Time) *UserSettingHistoryCreate { + if t != nil { + ushc.SetUpdatedAt(*t) + } + return ushc +} + +// SetCreatedBy sets the "created_by" field. +func (ushc *UserSettingHistoryCreate) SetCreatedBy(s string) *UserSettingHistoryCreate { + ushc.mutation.SetCreatedBy(s) + return ushc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableCreatedBy(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetCreatedBy(*s) + } + return ushc +} + +// SetUpdatedBy sets the "updated_by" field. +func (ushc *UserSettingHistoryCreate) SetUpdatedBy(s string) *UserSettingHistoryCreate { + ushc.mutation.SetUpdatedBy(s) + return ushc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableUpdatedBy(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetUpdatedBy(*s) + } + return ushc +} + +// SetMappingID sets the "mapping_id" field. +func (ushc *UserSettingHistoryCreate) SetMappingID(s string) *UserSettingHistoryCreate { + ushc.mutation.SetMappingID(s) + return ushc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableMappingID(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetMappingID(*s) + } + return ushc +} + +// SetTags sets the "tags" field. +func (ushc *UserSettingHistoryCreate) SetTags(s []string) *UserSettingHistoryCreate { + ushc.mutation.SetTags(s) + return ushc +} + +// SetDeletedAt sets the "deleted_at" field. +func (ushc *UserSettingHistoryCreate) SetDeletedAt(t time.Time) *UserSettingHistoryCreate { + ushc.mutation.SetDeletedAt(t) + return ushc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableDeletedAt(t *time.Time) *UserSettingHistoryCreate { + if t != nil { + ushc.SetDeletedAt(*t) + } + return ushc +} + +// SetDeletedBy sets the "deleted_by" field. +func (ushc *UserSettingHistoryCreate) SetDeletedBy(s string) *UserSettingHistoryCreate { + ushc.mutation.SetDeletedBy(s) + return ushc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableDeletedBy(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetDeletedBy(*s) + } + return ushc +} + +// SetUserID sets the "user_id" field. +func (ushc *UserSettingHistoryCreate) SetUserID(s string) *UserSettingHistoryCreate { + ushc.mutation.SetUserID(s) + return ushc +} + +// SetNillableUserID sets the "user_id" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableUserID(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetUserID(*s) + } + return ushc +} + +// SetLocked sets the "locked" field. +func (ushc *UserSettingHistoryCreate) SetLocked(b bool) *UserSettingHistoryCreate { + ushc.mutation.SetLocked(b) + return ushc +} + +// SetNillableLocked sets the "locked" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableLocked(b *bool) *UserSettingHistoryCreate { + if b != nil { + ushc.SetLocked(*b) + } + return ushc +} + +// SetSilencedAt sets the "silenced_at" field. +func (ushc *UserSettingHistoryCreate) SetSilencedAt(t time.Time) *UserSettingHistoryCreate { + ushc.mutation.SetSilencedAt(t) + return ushc +} + +// SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableSilencedAt(t *time.Time) *UserSettingHistoryCreate { + if t != nil { + ushc.SetSilencedAt(*t) + } + return ushc +} + +// SetSuspendedAt sets the "suspended_at" field. +func (ushc *UserSettingHistoryCreate) SetSuspendedAt(t time.Time) *UserSettingHistoryCreate { + ushc.mutation.SetSuspendedAt(t) + return ushc +} + +// SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableSuspendedAt(t *time.Time) *UserSettingHistoryCreate { + if t != nil { + ushc.SetSuspendedAt(*t) + } + return ushc +} + +// SetStatus sets the "status" field. +func (ushc *UserSettingHistoryCreate) SetStatus(es enums.UserStatus) *UserSettingHistoryCreate { + ushc.mutation.SetStatus(es) + return ushc +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableStatus(es *enums.UserStatus) *UserSettingHistoryCreate { + if es != nil { + ushc.SetStatus(*es) + } + return ushc +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (ushc *UserSettingHistoryCreate) SetEmailConfirmed(b bool) *UserSettingHistoryCreate { + ushc.mutation.SetEmailConfirmed(b) + return ushc +} + +// SetNillableEmailConfirmed sets the "email_confirmed" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableEmailConfirmed(b *bool) *UserSettingHistoryCreate { + if b != nil { + ushc.SetEmailConfirmed(*b) + } + return ushc +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (ushc *UserSettingHistoryCreate) SetIsWebauthnAllowed(b bool) *UserSettingHistoryCreate { + ushc.mutation.SetIsWebauthnAllowed(b) + return ushc +} + +// SetNillableIsWebauthnAllowed sets the "is_webauthn_allowed" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableIsWebauthnAllowed(b *bool) *UserSettingHistoryCreate { + if b != nil { + ushc.SetIsWebauthnAllowed(*b) + } + return ushc +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (ushc *UserSettingHistoryCreate) SetIsTfaEnabled(b bool) *UserSettingHistoryCreate { + ushc.mutation.SetIsTfaEnabled(b) + return ushc +} + +// SetNillableIsTfaEnabled sets the "is_tfa_enabled" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableIsTfaEnabled(b *bool) *UserSettingHistoryCreate { + if b != nil { + ushc.SetIsTfaEnabled(*b) + } + return ushc +} + +// SetPhoneNumber sets the "phone_number" field. +func (ushc *UserSettingHistoryCreate) SetPhoneNumber(s string) *UserSettingHistoryCreate { + ushc.mutation.SetPhoneNumber(s) + return ushc +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillablePhoneNumber(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetPhoneNumber(*s) + } + return ushc +} + +// SetID sets the "id" field. +func (ushc *UserSettingHistoryCreate) SetID(s string) *UserSettingHistoryCreate { + ushc.mutation.SetID(s) + return ushc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (ushc *UserSettingHistoryCreate) SetNillableID(s *string) *UserSettingHistoryCreate { + if s != nil { + ushc.SetID(*s) + } + return ushc +} + +// Mutation returns the UserSettingHistoryMutation object of the builder. +func (ushc *UserSettingHistoryCreate) Mutation() *UserSettingHistoryMutation { + return ushc.mutation +} + +// Save creates the UserSettingHistory in the database. +func (ushc *UserSettingHistoryCreate) Save(ctx context.Context) (*UserSettingHistory, error) { + ushc.defaults() + return withHooks(ctx, ushc.sqlSave, ushc.mutation, ushc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (ushc *UserSettingHistoryCreate) SaveX(ctx context.Context) *UserSettingHistory { + v, err := ushc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ushc *UserSettingHistoryCreate) Exec(ctx context.Context) error { + _, err := ushc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ushc *UserSettingHistoryCreate) ExecX(ctx context.Context) { + if err := ushc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ushc *UserSettingHistoryCreate) defaults() { + if _, ok := ushc.mutation.HistoryTime(); !ok { + v := usersettinghistory.DefaultHistoryTime() + ushc.mutation.SetHistoryTime(v) + } + if _, ok := ushc.mutation.CreatedAt(); !ok { + v := usersettinghistory.DefaultCreatedAt() + ushc.mutation.SetCreatedAt(v) + } + if _, ok := ushc.mutation.UpdatedAt(); !ok { + v := usersettinghistory.DefaultUpdatedAt() + ushc.mutation.SetUpdatedAt(v) + } + if _, ok := ushc.mutation.MappingID(); !ok { + v := usersettinghistory.DefaultMappingID() + ushc.mutation.SetMappingID(v) + } + if _, ok := ushc.mutation.Tags(); !ok { + v := usersettinghistory.DefaultTags + ushc.mutation.SetTags(v) + } + if _, ok := ushc.mutation.Locked(); !ok { + v := usersettinghistory.DefaultLocked + ushc.mutation.SetLocked(v) + } + if _, ok := ushc.mutation.Status(); !ok { + v := usersettinghistory.DefaultStatus + ushc.mutation.SetStatus(v) + } + if _, ok := ushc.mutation.EmailConfirmed(); !ok { + v := usersettinghistory.DefaultEmailConfirmed + ushc.mutation.SetEmailConfirmed(v) + } + if _, ok := ushc.mutation.IsWebauthnAllowed(); !ok { + v := usersettinghistory.DefaultIsWebauthnAllowed + ushc.mutation.SetIsWebauthnAllowed(v) + } + if _, ok := ushc.mutation.IsTfaEnabled(); !ok { + v := usersettinghistory.DefaultIsTfaEnabled + ushc.mutation.SetIsTfaEnabled(v) + } + if _, ok := ushc.mutation.ID(); !ok { + v := usersettinghistory.DefaultID() + ushc.mutation.SetID(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ushc *UserSettingHistoryCreate) check() error { + if _, ok := ushc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "UserSettingHistory.history_time"`)} + } + if _, ok := ushc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "UserSettingHistory.operation"`)} + } + if v, ok := ushc.mutation.Operation(); ok { + if err := usersettinghistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "UserSettingHistory.operation": %w`, err)} + } + } + if _, ok := ushc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "UserSettingHistory.mapping_id"`)} + } + if _, ok := ushc.mutation.Locked(); !ok { + return &ValidationError{Name: "locked", err: errors.New(`generated: missing required field "UserSettingHistory.locked"`)} + } + if _, ok := ushc.mutation.Status(); !ok { + return &ValidationError{Name: "status", err: errors.New(`generated: missing required field "UserSettingHistory.status"`)} + } + if v, ok := ushc.mutation.Status(); ok { + if err := usersettinghistory.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "UserSettingHistory.status": %w`, err)} + } + } + if _, ok := ushc.mutation.EmailConfirmed(); !ok { + return &ValidationError{Name: "email_confirmed", err: errors.New(`generated: missing required field "UserSettingHistory.email_confirmed"`)} + } + return nil +} + +func (ushc *UserSettingHistoryCreate) sqlSave(ctx context.Context) (*UserSettingHistory, error) { + if err := ushc.check(); err != nil { + return nil, err + } + _node, _spec := ushc.createSpec() + if err := sqlgraph.CreateNode(ctx, ushc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected UserSettingHistory.ID type: %T", _spec.ID.Value) + } + } + ushc.mutation.id = &_node.ID + ushc.mutation.done = true + return _node, nil +} + +func (ushc *UserSettingHistoryCreate) createSpec() (*UserSettingHistory, *sqlgraph.CreateSpec) { + var ( + _node = &UserSettingHistory{config: ushc.config} + _spec = sqlgraph.NewCreateSpec(usersettinghistory.Table, sqlgraph.NewFieldSpec(usersettinghistory.FieldID, field.TypeString)) + ) + _spec.Schema = ushc.schemaConfig.UserSettingHistory + if id, ok := ushc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := ushc.mutation.HistoryTime(); ok { + _spec.SetField(usersettinghistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := ushc.mutation.Ref(); ok { + _spec.SetField(usersettinghistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := ushc.mutation.Operation(); ok { + _spec.SetField(usersettinghistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := ushc.mutation.CreatedAt(); ok { + _spec.SetField(usersettinghistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := ushc.mutation.UpdatedAt(); ok { + _spec.SetField(usersettinghistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := ushc.mutation.CreatedBy(); ok { + _spec.SetField(usersettinghistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := ushc.mutation.UpdatedBy(); ok { + _spec.SetField(usersettinghistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := ushc.mutation.MappingID(); ok { + _spec.SetField(usersettinghistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := ushc.mutation.Tags(); ok { + _spec.SetField(usersettinghistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := ushc.mutation.DeletedAt(); ok { + _spec.SetField(usersettinghistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := ushc.mutation.DeletedBy(); ok { + _spec.SetField(usersettinghistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := ushc.mutation.UserID(); ok { + _spec.SetField(usersettinghistory.FieldUserID, field.TypeString, value) + _node.UserID = value + } + if value, ok := ushc.mutation.Locked(); ok { + _spec.SetField(usersettinghistory.FieldLocked, field.TypeBool, value) + _node.Locked = value + } + if value, ok := ushc.mutation.SilencedAt(); ok { + _spec.SetField(usersettinghistory.FieldSilencedAt, field.TypeTime, value) + _node.SilencedAt = &value + } + if value, ok := ushc.mutation.SuspendedAt(); ok { + _spec.SetField(usersettinghistory.FieldSuspendedAt, field.TypeTime, value) + _node.SuspendedAt = &value + } + if value, ok := ushc.mutation.Status(); ok { + _spec.SetField(usersettinghistory.FieldStatus, field.TypeEnum, value) + _node.Status = value + } + if value, ok := ushc.mutation.EmailConfirmed(); ok { + _spec.SetField(usersettinghistory.FieldEmailConfirmed, field.TypeBool, value) + _node.EmailConfirmed = value + } + if value, ok := ushc.mutation.IsWebauthnAllowed(); ok { + _spec.SetField(usersettinghistory.FieldIsWebauthnAllowed, field.TypeBool, value) + _node.IsWebauthnAllowed = value + } + if value, ok := ushc.mutation.IsTfaEnabled(); ok { + _spec.SetField(usersettinghistory.FieldIsTfaEnabled, field.TypeBool, value) + _node.IsTfaEnabled = value + } + if value, ok := ushc.mutation.PhoneNumber(); ok { + _spec.SetField(usersettinghistory.FieldPhoneNumber, field.TypeString, value) + _node.PhoneNumber = &value + } + return _node, _spec +} + +// UserSettingHistoryCreateBulk is the builder for creating many UserSettingHistory entities in bulk. +type UserSettingHistoryCreateBulk struct { + config + err error + builders []*UserSettingHistoryCreate +} + +// Save creates the UserSettingHistory entities in the database. +func (ushcb *UserSettingHistoryCreateBulk) Save(ctx context.Context) ([]*UserSettingHistory, error) { + if ushcb.err != nil { + return nil, ushcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(ushcb.builders)) + nodes := make([]*UserSettingHistory, len(ushcb.builders)) + mutators := make([]Mutator, len(ushcb.builders)) + for i := range ushcb.builders { + func(i int, root context.Context) { + builder := ushcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*UserSettingHistoryMutation) + 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, ushcb.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, ushcb.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, ushcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (ushcb *UserSettingHistoryCreateBulk) SaveX(ctx context.Context) []*UserSettingHistory { + v, err := ushcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (ushcb *UserSettingHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := ushcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ushcb *UserSettingHistoryCreateBulk) ExecX(ctx context.Context) { + if err := ushcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/usersettinghistory_delete.go b/internal/ent/generated/usersettinghistory_delete.go new file mode 100644 index 0000000..c56acd2 --- /dev/null +++ b/internal/ent/generated/usersettinghistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" +) + +// UserSettingHistoryDelete is the builder for deleting a UserSettingHistory entity. +type UserSettingHistoryDelete struct { + config + hooks []Hook + mutation *UserSettingHistoryMutation +} + +// Where appends a list predicates to the UserSettingHistoryDelete builder. +func (ushd *UserSettingHistoryDelete) Where(ps ...predicate.UserSettingHistory) *UserSettingHistoryDelete { + ushd.mutation.Where(ps...) + return ushd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (ushd *UserSettingHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, ushd.sqlExec, ushd.mutation, ushd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (ushd *UserSettingHistoryDelete) ExecX(ctx context.Context) int { + n, err := ushd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (ushd *UserSettingHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(usersettinghistory.Table, sqlgraph.NewFieldSpec(usersettinghistory.FieldID, field.TypeString)) + _spec.Node.Schema = ushd.schemaConfig.UserSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, ushd.schemaConfig) + if ps := ushd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, ushd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + ushd.mutation.done = true + return affected, err +} + +// UserSettingHistoryDeleteOne is the builder for deleting a single UserSettingHistory entity. +type UserSettingHistoryDeleteOne struct { + ushd *UserSettingHistoryDelete +} + +// Where appends a list predicates to the UserSettingHistoryDelete builder. +func (ushdo *UserSettingHistoryDeleteOne) Where(ps ...predicate.UserSettingHistory) *UserSettingHistoryDeleteOne { + ushdo.ushd.mutation.Where(ps...) + return ushdo +} + +// Exec executes the deletion query. +func (ushdo *UserSettingHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := ushdo.ushd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{usersettinghistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (ushdo *UserSettingHistoryDeleteOne) ExecX(ctx context.Context) { + if err := ushdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/usersettinghistory_query.go b/internal/ent/generated/usersettinghistory_query.go new file mode 100644 index 0000000..b388589 --- /dev/null +++ b/internal/ent/generated/usersettinghistory_query.go @@ -0,0 +1,549 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserSettingHistoryQuery is the builder for querying UserSettingHistory entities. +type UserSettingHistoryQuery struct { + config + ctx *QueryContext + order []usersettinghistory.OrderOption + inters []Interceptor + predicates []predicate.UserSettingHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*UserSettingHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the UserSettingHistoryQuery builder. +func (ushq *UserSettingHistoryQuery) Where(ps ...predicate.UserSettingHistory) *UserSettingHistoryQuery { + ushq.predicates = append(ushq.predicates, ps...) + return ushq +} + +// Limit the number of records to be returned by this query. +func (ushq *UserSettingHistoryQuery) Limit(limit int) *UserSettingHistoryQuery { + ushq.ctx.Limit = &limit + return ushq +} + +// Offset to start from. +func (ushq *UserSettingHistoryQuery) Offset(offset int) *UserSettingHistoryQuery { + ushq.ctx.Offset = &offset + return ushq +} + +// 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 (ushq *UserSettingHistoryQuery) Unique(unique bool) *UserSettingHistoryQuery { + ushq.ctx.Unique = &unique + return ushq +} + +// Order specifies how the records should be ordered. +func (ushq *UserSettingHistoryQuery) Order(o ...usersettinghistory.OrderOption) *UserSettingHistoryQuery { + ushq.order = append(ushq.order, o...) + return ushq +} + +// First returns the first UserSettingHistory entity from the query. +// Returns a *NotFoundError when no UserSettingHistory was found. +func (ushq *UserSettingHistoryQuery) First(ctx context.Context) (*UserSettingHistory, error) { + nodes, err := ushq.Limit(1).All(setContextOp(ctx, ushq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{usersettinghistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) FirstX(ctx context.Context) *UserSettingHistory { + node, err := ushq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first UserSettingHistory ID from the query. +// Returns a *NotFoundError when no UserSettingHistory ID was found. +func (ushq *UserSettingHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ushq.Limit(1).IDs(setContextOp(ctx, ushq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{usersettinghistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := ushq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single UserSettingHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one UserSettingHistory entity is found. +// Returns a *NotFoundError when no UserSettingHistory entities are found. +func (ushq *UserSettingHistoryQuery) Only(ctx context.Context) (*UserSettingHistory, error) { + nodes, err := ushq.Limit(2).All(setContextOp(ctx, ushq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{usersettinghistory.Label} + default: + return nil, &NotSingularError{usersettinghistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) OnlyX(ctx context.Context) *UserSettingHistory { + node, err := ushq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only UserSettingHistory ID in the query. +// Returns a *NotSingularError when more than one UserSettingHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (ushq *UserSettingHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = ushq.Limit(2).IDs(setContextOp(ctx, ushq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{usersettinghistory.Label} + default: + err = &NotSingularError{usersettinghistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := ushq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of UserSettingHistories. +func (ushq *UserSettingHistoryQuery) All(ctx context.Context) ([]*UserSettingHistory, error) { + ctx = setContextOp(ctx, ushq.ctx, ent.OpQueryAll) + if err := ushq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*UserSettingHistory, *UserSettingHistoryQuery]() + return withInterceptors[[]*UserSettingHistory](ctx, ushq, qr, ushq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) AllX(ctx context.Context) []*UserSettingHistory { + nodes, err := ushq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of UserSettingHistory IDs. +func (ushq *UserSettingHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if ushq.ctx.Unique == nil && ushq.path != nil { + ushq.Unique(true) + } + ctx = setContextOp(ctx, ushq.ctx, ent.OpQueryIDs) + if err = ushq.Select(usersettinghistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := ushq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (ushq *UserSettingHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, ushq.ctx, ent.OpQueryCount) + if err := ushq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, ushq, querierCount[*UserSettingHistoryQuery](), ushq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) CountX(ctx context.Context) int { + count, err := ushq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (ushq *UserSettingHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, ushq.ctx, ent.OpQueryExist) + switch _, err := ushq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (ushq *UserSettingHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := ushq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the UserSettingHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (ushq *UserSettingHistoryQuery) Clone() *UserSettingHistoryQuery { + if ushq == nil { + return nil + } + return &UserSettingHistoryQuery{ + config: ushq.config, + ctx: ushq.ctx.Clone(), + order: append([]usersettinghistory.OrderOption{}, ushq.order...), + inters: append([]Interceptor{}, ushq.inters...), + predicates: append([]predicate.UserSettingHistory{}, ushq.predicates...), + // clone intermediate query. + sql: ushq.sql.Clone(), + path: ushq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.UserSettingHistory.Query(). +// GroupBy(usersettinghistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (ushq *UserSettingHistoryQuery) GroupBy(field string, fields ...string) *UserSettingHistoryGroupBy { + ushq.ctx.Fields = append([]string{field}, fields...) + grbuild := &UserSettingHistoryGroupBy{build: ushq} + grbuild.flds = &ushq.ctx.Fields + grbuild.label = usersettinghistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.UserSettingHistory.Query(). +// Select(usersettinghistory.FieldHistoryTime). +// Scan(ctx, &v) +func (ushq *UserSettingHistoryQuery) Select(fields ...string) *UserSettingHistorySelect { + ushq.ctx.Fields = append(ushq.ctx.Fields, fields...) + sbuild := &UserSettingHistorySelect{UserSettingHistoryQuery: ushq} + sbuild.label = usersettinghistory.Label + sbuild.flds, sbuild.scan = &ushq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a UserSettingHistorySelect configured with the given aggregations. +func (ushq *UserSettingHistoryQuery) Aggregate(fns ...AggregateFunc) *UserSettingHistorySelect { + return ushq.Select().Aggregate(fns...) +} + +func (ushq *UserSettingHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range ushq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, ushq); err != nil { + return err + } + } + } + for _, f := range ushq.ctx.Fields { + if !usersettinghistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if ushq.path != nil { + prev, err := ushq.path(ctx) + if err != nil { + return err + } + ushq.sql = prev + } + return nil +} + +func (ushq *UserSettingHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*UserSettingHistory, error) { + var ( + nodes = []*UserSettingHistory{} + _spec = ushq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*UserSettingHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &UserSettingHistory{config: ushq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = ushq.schemaConfig.UserSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, ushq.schemaConfig) + if len(ushq.modifiers) > 0 { + _spec.Modifiers = ushq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, ushq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range ushq.loadTotal { + if err := ushq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (ushq *UserSettingHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := ushq.querySpec() + _spec.Node.Schema = ushq.schemaConfig.UserSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, ushq.schemaConfig) + if len(ushq.modifiers) > 0 { + _spec.Modifiers = ushq.modifiers + } + _spec.Node.Columns = ushq.ctx.Fields + if len(ushq.ctx.Fields) > 0 { + _spec.Unique = ushq.ctx.Unique != nil && *ushq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, ushq.driver, _spec) +} + +func (ushq *UserSettingHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(usersettinghistory.Table, usersettinghistory.Columns, sqlgraph.NewFieldSpec(usersettinghistory.FieldID, field.TypeString)) + _spec.From = ushq.sql + if unique := ushq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if ushq.path != nil { + _spec.Unique = true + } + if fields := ushq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, usersettinghistory.FieldID) + for i := range fields { + if fields[i] != usersettinghistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := ushq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := ushq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := ushq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := ushq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (ushq *UserSettingHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(ushq.driver.Dialect()) + t1 := builder.Table(usersettinghistory.Table) + columns := ushq.ctx.Fields + if len(columns) == 0 { + columns = usersettinghistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if ushq.sql != nil { + selector = ushq.sql + selector.Select(selector.Columns(columns...)...) + } + if ushq.ctx.Unique != nil && *ushq.ctx.Unique { + selector.Distinct() + } + t1.Schema(ushq.schemaConfig.UserSettingHistory) + ctx = internal.NewSchemaConfigContext(ctx, ushq.schemaConfig) + selector.WithContext(ctx) + for _, p := range ushq.predicates { + p(selector) + } + for _, p := range ushq.order { + p(selector) + } + if offset := ushq.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 := ushq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// UserSettingHistoryGroupBy is the group-by builder for UserSettingHistory entities. +type UserSettingHistoryGroupBy struct { + selector + build *UserSettingHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (ushgb *UserSettingHistoryGroupBy) Aggregate(fns ...AggregateFunc) *UserSettingHistoryGroupBy { + ushgb.fns = append(ushgb.fns, fns...) + return ushgb +} + +// Scan applies the selector query and scans the result into the given value. +func (ushgb *UserSettingHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ushgb.build.ctx, ent.OpQueryGroupBy) + if err := ushgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserSettingHistoryQuery, *UserSettingHistoryGroupBy](ctx, ushgb.build, ushgb, ushgb.build.inters, v) +} + +func (ushgb *UserSettingHistoryGroupBy) sqlScan(ctx context.Context, root *UserSettingHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(ushgb.fns)) + for _, fn := range ushgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*ushgb.flds)+len(ushgb.fns)) + for _, f := range *ushgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*ushgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := ushgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// UserSettingHistorySelect is the builder for selecting fields of UserSettingHistory entities. +type UserSettingHistorySelect struct { + *UserSettingHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ushs *UserSettingHistorySelect) Aggregate(fns ...AggregateFunc) *UserSettingHistorySelect { + ushs.fns = append(ushs.fns, fns...) + return ushs +} + +// Scan applies the selector query and scans the result into the given value. +func (ushs *UserSettingHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ushs.ctx, ent.OpQuerySelect) + if err := ushs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*UserSettingHistoryQuery, *UserSettingHistorySelect](ctx, ushs.UserSettingHistoryQuery, ushs, ushs.inters, v) +} + +func (ushs *UserSettingHistorySelect) sqlScan(ctx context.Context, root *UserSettingHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ushs.fns)) + for _, fn := range ushs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ushs.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 := ushs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/usersettinghistory_update.go b/internal/ent/generated/usersettinghistory_update.go new file mode 100644 index 0000000..ae8b900 --- /dev/null +++ b/internal/ent/generated/usersettinghistory_update.go @@ -0,0 +1,910 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" + "github.com/theopenlane/core/pkg/enums" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// UserSettingHistoryUpdate is the builder for updating UserSettingHistory entities. +type UserSettingHistoryUpdate struct { + config + hooks []Hook + mutation *UserSettingHistoryMutation +} + +// Where appends a list predicates to the UserSettingHistoryUpdate builder. +func (ushu *UserSettingHistoryUpdate) Where(ps ...predicate.UserSettingHistory) *UserSettingHistoryUpdate { + ushu.mutation.Where(ps...) + return ushu +} + +// SetUpdatedAt sets the "updated_at" field. +func (ushu *UserSettingHistoryUpdate) SetUpdatedAt(t time.Time) *UserSettingHistoryUpdate { + ushu.mutation.SetUpdatedAt(t) + return ushu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ushu *UserSettingHistoryUpdate) ClearUpdatedAt() *UserSettingHistoryUpdate { + ushu.mutation.ClearUpdatedAt() + return ushu +} + +// SetUpdatedBy sets the "updated_by" field. +func (ushu *UserSettingHistoryUpdate) SetUpdatedBy(s string) *UserSettingHistoryUpdate { + ushu.mutation.SetUpdatedBy(s) + return ushu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableUpdatedBy(s *string) *UserSettingHistoryUpdate { + if s != nil { + ushu.SetUpdatedBy(*s) + } + return ushu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ushu *UserSettingHistoryUpdate) ClearUpdatedBy() *UserSettingHistoryUpdate { + ushu.mutation.ClearUpdatedBy() + return ushu +} + +// SetTags sets the "tags" field. +func (ushu *UserSettingHistoryUpdate) SetTags(s []string) *UserSettingHistoryUpdate { + ushu.mutation.SetTags(s) + return ushu +} + +// AppendTags appends s to the "tags" field. +func (ushu *UserSettingHistoryUpdate) AppendTags(s []string) *UserSettingHistoryUpdate { + ushu.mutation.AppendTags(s) + return ushu +} + +// ClearTags clears the value of the "tags" field. +func (ushu *UserSettingHistoryUpdate) ClearTags() *UserSettingHistoryUpdate { + ushu.mutation.ClearTags() + return ushu +} + +// SetDeletedAt sets the "deleted_at" field. +func (ushu *UserSettingHistoryUpdate) SetDeletedAt(t time.Time) *UserSettingHistoryUpdate { + ushu.mutation.SetDeletedAt(t) + return ushu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableDeletedAt(t *time.Time) *UserSettingHistoryUpdate { + if t != nil { + ushu.SetDeletedAt(*t) + } + return ushu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ushu *UserSettingHistoryUpdate) ClearDeletedAt() *UserSettingHistoryUpdate { + ushu.mutation.ClearDeletedAt() + return ushu +} + +// SetDeletedBy sets the "deleted_by" field. +func (ushu *UserSettingHistoryUpdate) SetDeletedBy(s string) *UserSettingHistoryUpdate { + ushu.mutation.SetDeletedBy(s) + return ushu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableDeletedBy(s *string) *UserSettingHistoryUpdate { + if s != nil { + ushu.SetDeletedBy(*s) + } + return ushu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ushu *UserSettingHistoryUpdate) ClearDeletedBy() *UserSettingHistoryUpdate { + ushu.mutation.ClearDeletedBy() + return ushu +} + +// SetUserID sets the "user_id" field. +func (ushu *UserSettingHistoryUpdate) SetUserID(s string) *UserSettingHistoryUpdate { + ushu.mutation.SetUserID(s) + return ushu +} + +// SetNillableUserID sets the "user_id" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableUserID(s *string) *UserSettingHistoryUpdate { + if s != nil { + ushu.SetUserID(*s) + } + return ushu +} + +// ClearUserID clears the value of the "user_id" field. +func (ushu *UserSettingHistoryUpdate) ClearUserID() *UserSettingHistoryUpdate { + ushu.mutation.ClearUserID() + return ushu +} + +// SetLocked sets the "locked" field. +func (ushu *UserSettingHistoryUpdate) SetLocked(b bool) *UserSettingHistoryUpdate { + ushu.mutation.SetLocked(b) + return ushu +} + +// SetNillableLocked sets the "locked" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableLocked(b *bool) *UserSettingHistoryUpdate { + if b != nil { + ushu.SetLocked(*b) + } + return ushu +} + +// SetSilencedAt sets the "silenced_at" field. +func (ushu *UserSettingHistoryUpdate) SetSilencedAt(t time.Time) *UserSettingHistoryUpdate { + ushu.mutation.SetSilencedAt(t) + return ushu +} + +// SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableSilencedAt(t *time.Time) *UserSettingHistoryUpdate { + if t != nil { + ushu.SetSilencedAt(*t) + } + return ushu +} + +// ClearSilencedAt clears the value of the "silenced_at" field. +func (ushu *UserSettingHistoryUpdate) ClearSilencedAt() *UserSettingHistoryUpdate { + ushu.mutation.ClearSilencedAt() + return ushu +} + +// SetSuspendedAt sets the "suspended_at" field. +func (ushu *UserSettingHistoryUpdate) SetSuspendedAt(t time.Time) *UserSettingHistoryUpdate { + ushu.mutation.SetSuspendedAt(t) + return ushu +} + +// SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableSuspendedAt(t *time.Time) *UserSettingHistoryUpdate { + if t != nil { + ushu.SetSuspendedAt(*t) + } + return ushu +} + +// ClearSuspendedAt clears the value of the "suspended_at" field. +func (ushu *UserSettingHistoryUpdate) ClearSuspendedAt() *UserSettingHistoryUpdate { + ushu.mutation.ClearSuspendedAt() + return ushu +} + +// SetStatus sets the "status" field. +func (ushu *UserSettingHistoryUpdate) SetStatus(es enums.UserStatus) *UserSettingHistoryUpdate { + ushu.mutation.SetStatus(es) + return ushu +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableStatus(es *enums.UserStatus) *UserSettingHistoryUpdate { + if es != nil { + ushu.SetStatus(*es) + } + return ushu +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (ushu *UserSettingHistoryUpdate) SetEmailConfirmed(b bool) *UserSettingHistoryUpdate { + ushu.mutation.SetEmailConfirmed(b) + return ushu +} + +// SetNillableEmailConfirmed sets the "email_confirmed" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableEmailConfirmed(b *bool) *UserSettingHistoryUpdate { + if b != nil { + ushu.SetEmailConfirmed(*b) + } + return ushu +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (ushu *UserSettingHistoryUpdate) SetIsWebauthnAllowed(b bool) *UserSettingHistoryUpdate { + ushu.mutation.SetIsWebauthnAllowed(b) + return ushu +} + +// SetNillableIsWebauthnAllowed sets the "is_webauthn_allowed" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableIsWebauthnAllowed(b *bool) *UserSettingHistoryUpdate { + if b != nil { + ushu.SetIsWebauthnAllowed(*b) + } + return ushu +} + +// ClearIsWebauthnAllowed clears the value of the "is_webauthn_allowed" field. +func (ushu *UserSettingHistoryUpdate) ClearIsWebauthnAllowed() *UserSettingHistoryUpdate { + ushu.mutation.ClearIsWebauthnAllowed() + return ushu +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (ushu *UserSettingHistoryUpdate) SetIsTfaEnabled(b bool) *UserSettingHistoryUpdate { + ushu.mutation.SetIsTfaEnabled(b) + return ushu +} + +// SetNillableIsTfaEnabled sets the "is_tfa_enabled" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillableIsTfaEnabled(b *bool) *UserSettingHistoryUpdate { + if b != nil { + ushu.SetIsTfaEnabled(*b) + } + return ushu +} + +// ClearIsTfaEnabled clears the value of the "is_tfa_enabled" field. +func (ushu *UserSettingHistoryUpdate) ClearIsTfaEnabled() *UserSettingHistoryUpdate { + ushu.mutation.ClearIsTfaEnabled() + return ushu +} + +// SetPhoneNumber sets the "phone_number" field. +func (ushu *UserSettingHistoryUpdate) SetPhoneNumber(s string) *UserSettingHistoryUpdate { + ushu.mutation.SetPhoneNumber(s) + return ushu +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (ushu *UserSettingHistoryUpdate) SetNillablePhoneNumber(s *string) *UserSettingHistoryUpdate { + if s != nil { + ushu.SetPhoneNumber(*s) + } + return ushu +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (ushu *UserSettingHistoryUpdate) ClearPhoneNumber() *UserSettingHistoryUpdate { + ushu.mutation.ClearPhoneNumber() + return ushu +} + +// Mutation returns the UserSettingHistoryMutation object of the builder. +func (ushu *UserSettingHistoryUpdate) Mutation() *UserSettingHistoryMutation { + return ushu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (ushu *UserSettingHistoryUpdate) Save(ctx context.Context) (int, error) { + ushu.defaults() + return withHooks(ctx, ushu.sqlSave, ushu.mutation, ushu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ushu *UserSettingHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := ushu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (ushu *UserSettingHistoryUpdate) Exec(ctx context.Context) error { + _, err := ushu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ushu *UserSettingHistoryUpdate) ExecX(ctx context.Context) { + if err := ushu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ushu *UserSettingHistoryUpdate) defaults() { + if _, ok := ushu.mutation.UpdatedAt(); !ok && !ushu.mutation.UpdatedAtCleared() { + v := usersettinghistory.UpdateDefaultUpdatedAt() + ushu.mutation.SetUpdatedAt(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ushu *UserSettingHistoryUpdate) check() error { + if v, ok := ushu.mutation.Status(); ok { + if err := usersettinghistory.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "UserSettingHistory.status": %w`, err)} + } + } + return nil +} + +func (ushu *UserSettingHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := ushu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(usersettinghistory.Table, usersettinghistory.Columns, sqlgraph.NewFieldSpec(usersettinghistory.FieldID, field.TypeString)) + if ps := ushu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ushu.mutation.RefCleared() { + _spec.ClearField(usersettinghistory.FieldRef, field.TypeString) + } + if ushu.mutation.CreatedAtCleared() { + _spec.ClearField(usersettinghistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ushu.mutation.UpdatedAt(); ok { + _spec.SetField(usersettinghistory.FieldUpdatedAt, field.TypeTime, value) + } + if ushu.mutation.UpdatedAtCleared() { + _spec.ClearField(usersettinghistory.FieldUpdatedAt, field.TypeTime) + } + if ushu.mutation.CreatedByCleared() { + _spec.ClearField(usersettinghistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ushu.mutation.UpdatedBy(); ok { + _spec.SetField(usersettinghistory.FieldUpdatedBy, field.TypeString, value) + } + if ushu.mutation.UpdatedByCleared() { + _spec.ClearField(usersettinghistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ushu.mutation.Tags(); ok { + _spec.SetField(usersettinghistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ushu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, usersettinghistory.FieldTags, value) + }) + } + if ushu.mutation.TagsCleared() { + _spec.ClearField(usersettinghistory.FieldTags, field.TypeJSON) + } + if value, ok := ushu.mutation.DeletedAt(); ok { + _spec.SetField(usersettinghistory.FieldDeletedAt, field.TypeTime, value) + } + if ushu.mutation.DeletedAtCleared() { + _spec.ClearField(usersettinghistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ushu.mutation.DeletedBy(); ok { + _spec.SetField(usersettinghistory.FieldDeletedBy, field.TypeString, value) + } + if ushu.mutation.DeletedByCleared() { + _spec.ClearField(usersettinghistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ushu.mutation.UserID(); ok { + _spec.SetField(usersettinghistory.FieldUserID, field.TypeString, value) + } + if ushu.mutation.UserIDCleared() { + _spec.ClearField(usersettinghistory.FieldUserID, field.TypeString) + } + if value, ok := ushu.mutation.Locked(); ok { + _spec.SetField(usersettinghistory.FieldLocked, field.TypeBool, value) + } + if value, ok := ushu.mutation.SilencedAt(); ok { + _spec.SetField(usersettinghistory.FieldSilencedAt, field.TypeTime, value) + } + if ushu.mutation.SilencedAtCleared() { + _spec.ClearField(usersettinghistory.FieldSilencedAt, field.TypeTime) + } + if value, ok := ushu.mutation.SuspendedAt(); ok { + _spec.SetField(usersettinghistory.FieldSuspendedAt, field.TypeTime, value) + } + if ushu.mutation.SuspendedAtCleared() { + _spec.ClearField(usersettinghistory.FieldSuspendedAt, field.TypeTime) + } + if value, ok := ushu.mutation.Status(); ok { + _spec.SetField(usersettinghistory.FieldStatus, field.TypeEnum, value) + } + if value, ok := ushu.mutation.EmailConfirmed(); ok { + _spec.SetField(usersettinghistory.FieldEmailConfirmed, field.TypeBool, value) + } + if value, ok := ushu.mutation.IsWebauthnAllowed(); ok { + _spec.SetField(usersettinghistory.FieldIsWebauthnAllowed, field.TypeBool, value) + } + if ushu.mutation.IsWebauthnAllowedCleared() { + _spec.ClearField(usersettinghistory.FieldIsWebauthnAllowed, field.TypeBool) + } + if value, ok := ushu.mutation.IsTfaEnabled(); ok { + _spec.SetField(usersettinghistory.FieldIsTfaEnabled, field.TypeBool, value) + } + if ushu.mutation.IsTfaEnabledCleared() { + _spec.ClearField(usersettinghistory.FieldIsTfaEnabled, field.TypeBool) + } + if value, ok := ushu.mutation.PhoneNumber(); ok { + _spec.SetField(usersettinghistory.FieldPhoneNumber, field.TypeString, value) + } + if ushu.mutation.PhoneNumberCleared() { + _spec.ClearField(usersettinghistory.FieldPhoneNumber, field.TypeString) + } + _spec.Node.Schema = ushu.schemaConfig.UserSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, ushu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, ushu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{usersettinghistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + ushu.mutation.done = true + return n, nil +} + +// UserSettingHistoryUpdateOne is the builder for updating a single UserSettingHistory entity. +type UserSettingHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *UserSettingHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (ushuo *UserSettingHistoryUpdateOne) SetUpdatedAt(t time.Time) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetUpdatedAt(t) + return ushuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearUpdatedAt() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearUpdatedAt() + return ushuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (ushuo *UserSettingHistoryUpdateOne) SetUpdatedBy(s string) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetUpdatedBy(s) + return ushuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableUpdatedBy(s *string) *UserSettingHistoryUpdateOne { + if s != nil { + ushuo.SetUpdatedBy(*s) + } + return ushuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearUpdatedBy() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearUpdatedBy() + return ushuo +} + +// SetTags sets the "tags" field. +func (ushuo *UserSettingHistoryUpdateOne) SetTags(s []string) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetTags(s) + return ushuo +} + +// AppendTags appends s to the "tags" field. +func (ushuo *UserSettingHistoryUpdateOne) AppendTags(s []string) *UserSettingHistoryUpdateOne { + ushuo.mutation.AppendTags(s) + return ushuo +} + +// ClearTags clears the value of the "tags" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearTags() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearTags() + return ushuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (ushuo *UserSettingHistoryUpdateOne) SetDeletedAt(t time.Time) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetDeletedAt(t) + return ushuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *UserSettingHistoryUpdateOne { + if t != nil { + ushuo.SetDeletedAt(*t) + } + return ushuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearDeletedAt() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearDeletedAt() + return ushuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (ushuo *UserSettingHistoryUpdateOne) SetDeletedBy(s string) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetDeletedBy(s) + return ushuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableDeletedBy(s *string) *UserSettingHistoryUpdateOne { + if s != nil { + ushuo.SetDeletedBy(*s) + } + return ushuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearDeletedBy() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearDeletedBy() + return ushuo +} + +// SetUserID sets the "user_id" field. +func (ushuo *UserSettingHistoryUpdateOne) SetUserID(s string) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetUserID(s) + return ushuo +} + +// SetNillableUserID sets the "user_id" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableUserID(s *string) *UserSettingHistoryUpdateOne { + if s != nil { + ushuo.SetUserID(*s) + } + return ushuo +} + +// ClearUserID clears the value of the "user_id" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearUserID() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearUserID() + return ushuo +} + +// SetLocked sets the "locked" field. +func (ushuo *UserSettingHistoryUpdateOne) SetLocked(b bool) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetLocked(b) + return ushuo +} + +// SetNillableLocked sets the "locked" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableLocked(b *bool) *UserSettingHistoryUpdateOne { + if b != nil { + ushuo.SetLocked(*b) + } + return ushuo +} + +// SetSilencedAt sets the "silenced_at" field. +func (ushuo *UserSettingHistoryUpdateOne) SetSilencedAt(t time.Time) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetSilencedAt(t) + return ushuo +} + +// SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableSilencedAt(t *time.Time) *UserSettingHistoryUpdateOne { + if t != nil { + ushuo.SetSilencedAt(*t) + } + return ushuo +} + +// ClearSilencedAt clears the value of the "silenced_at" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearSilencedAt() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearSilencedAt() + return ushuo +} + +// SetSuspendedAt sets the "suspended_at" field. +func (ushuo *UserSettingHistoryUpdateOne) SetSuspendedAt(t time.Time) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetSuspendedAt(t) + return ushuo +} + +// SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableSuspendedAt(t *time.Time) *UserSettingHistoryUpdateOne { + if t != nil { + ushuo.SetSuspendedAt(*t) + } + return ushuo +} + +// ClearSuspendedAt clears the value of the "suspended_at" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearSuspendedAt() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearSuspendedAt() + return ushuo +} + +// SetStatus sets the "status" field. +func (ushuo *UserSettingHistoryUpdateOne) SetStatus(es enums.UserStatus) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetStatus(es) + return ushuo +} + +// SetNillableStatus sets the "status" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableStatus(es *enums.UserStatus) *UserSettingHistoryUpdateOne { + if es != nil { + ushuo.SetStatus(*es) + } + return ushuo +} + +// SetEmailConfirmed sets the "email_confirmed" field. +func (ushuo *UserSettingHistoryUpdateOne) SetEmailConfirmed(b bool) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetEmailConfirmed(b) + return ushuo +} + +// SetNillableEmailConfirmed sets the "email_confirmed" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableEmailConfirmed(b *bool) *UserSettingHistoryUpdateOne { + if b != nil { + ushuo.SetEmailConfirmed(*b) + } + return ushuo +} + +// SetIsWebauthnAllowed sets the "is_webauthn_allowed" field. +func (ushuo *UserSettingHistoryUpdateOne) SetIsWebauthnAllowed(b bool) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetIsWebauthnAllowed(b) + return ushuo +} + +// SetNillableIsWebauthnAllowed sets the "is_webauthn_allowed" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableIsWebauthnAllowed(b *bool) *UserSettingHistoryUpdateOne { + if b != nil { + ushuo.SetIsWebauthnAllowed(*b) + } + return ushuo +} + +// ClearIsWebauthnAllowed clears the value of the "is_webauthn_allowed" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearIsWebauthnAllowed() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearIsWebauthnAllowed() + return ushuo +} + +// SetIsTfaEnabled sets the "is_tfa_enabled" field. +func (ushuo *UserSettingHistoryUpdateOne) SetIsTfaEnabled(b bool) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetIsTfaEnabled(b) + return ushuo +} + +// SetNillableIsTfaEnabled sets the "is_tfa_enabled" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillableIsTfaEnabled(b *bool) *UserSettingHistoryUpdateOne { + if b != nil { + ushuo.SetIsTfaEnabled(*b) + } + return ushuo +} + +// ClearIsTfaEnabled clears the value of the "is_tfa_enabled" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearIsTfaEnabled() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearIsTfaEnabled() + return ushuo +} + +// SetPhoneNumber sets the "phone_number" field. +func (ushuo *UserSettingHistoryUpdateOne) SetPhoneNumber(s string) *UserSettingHistoryUpdateOne { + ushuo.mutation.SetPhoneNumber(s) + return ushuo +} + +// SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil. +func (ushuo *UserSettingHistoryUpdateOne) SetNillablePhoneNumber(s *string) *UserSettingHistoryUpdateOne { + if s != nil { + ushuo.SetPhoneNumber(*s) + } + return ushuo +} + +// ClearPhoneNumber clears the value of the "phone_number" field. +func (ushuo *UserSettingHistoryUpdateOne) ClearPhoneNumber() *UserSettingHistoryUpdateOne { + ushuo.mutation.ClearPhoneNumber() + return ushuo +} + +// Mutation returns the UserSettingHistoryMutation object of the builder. +func (ushuo *UserSettingHistoryUpdateOne) Mutation() *UserSettingHistoryMutation { + return ushuo.mutation +} + +// Where appends a list predicates to the UserSettingHistoryUpdate builder. +func (ushuo *UserSettingHistoryUpdateOne) Where(ps ...predicate.UserSettingHistory) *UserSettingHistoryUpdateOne { + ushuo.mutation.Where(ps...) + return ushuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (ushuo *UserSettingHistoryUpdateOne) Select(field string, fields ...string) *UserSettingHistoryUpdateOne { + ushuo.fields = append([]string{field}, fields...) + return ushuo +} + +// Save executes the query and returns the updated UserSettingHistory entity. +func (ushuo *UserSettingHistoryUpdateOne) Save(ctx context.Context) (*UserSettingHistory, error) { + ushuo.defaults() + return withHooks(ctx, ushuo.sqlSave, ushuo.mutation, ushuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (ushuo *UserSettingHistoryUpdateOne) SaveX(ctx context.Context) *UserSettingHistory { + node, err := ushuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (ushuo *UserSettingHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := ushuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (ushuo *UserSettingHistoryUpdateOne) ExecX(ctx context.Context) { + if err := ushuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (ushuo *UserSettingHistoryUpdateOne) defaults() { + if _, ok := ushuo.mutation.UpdatedAt(); !ok && !ushuo.mutation.UpdatedAtCleared() { + v := usersettinghistory.UpdateDefaultUpdatedAt() + ushuo.mutation.SetUpdatedAt(v) + } +} + +// check runs all checks and user-defined validators on the builder. +func (ushuo *UserSettingHistoryUpdateOne) check() error { + if v, ok := ushuo.mutation.Status(); ok { + if err := usersettinghistory.StatusValidator(v); err != nil { + return &ValidationError{Name: "status", err: fmt.Errorf(`generated: validator failed for field "UserSettingHistory.status": %w`, err)} + } + } + return nil +} + +func (ushuo *UserSettingHistoryUpdateOne) sqlSave(ctx context.Context) (_node *UserSettingHistory, err error) { + if err := ushuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(usersettinghistory.Table, usersettinghistory.Columns, sqlgraph.NewFieldSpec(usersettinghistory.FieldID, field.TypeString)) + id, ok := ushuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "UserSettingHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := ushuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, usersettinghistory.FieldID) + for _, f := range fields { + if !usersettinghistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != usersettinghistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := ushuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if ushuo.mutation.RefCleared() { + _spec.ClearField(usersettinghistory.FieldRef, field.TypeString) + } + if ushuo.mutation.CreatedAtCleared() { + _spec.ClearField(usersettinghistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := ushuo.mutation.UpdatedAt(); ok { + _spec.SetField(usersettinghistory.FieldUpdatedAt, field.TypeTime, value) + } + if ushuo.mutation.UpdatedAtCleared() { + _spec.ClearField(usersettinghistory.FieldUpdatedAt, field.TypeTime) + } + if ushuo.mutation.CreatedByCleared() { + _spec.ClearField(usersettinghistory.FieldCreatedBy, field.TypeString) + } + if value, ok := ushuo.mutation.UpdatedBy(); ok { + _spec.SetField(usersettinghistory.FieldUpdatedBy, field.TypeString, value) + } + if ushuo.mutation.UpdatedByCleared() { + _spec.ClearField(usersettinghistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := ushuo.mutation.Tags(); ok { + _spec.SetField(usersettinghistory.FieldTags, field.TypeJSON, value) + } + if value, ok := ushuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, usersettinghistory.FieldTags, value) + }) + } + if ushuo.mutation.TagsCleared() { + _spec.ClearField(usersettinghistory.FieldTags, field.TypeJSON) + } + if value, ok := ushuo.mutation.DeletedAt(); ok { + _spec.SetField(usersettinghistory.FieldDeletedAt, field.TypeTime, value) + } + if ushuo.mutation.DeletedAtCleared() { + _spec.ClearField(usersettinghistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := ushuo.mutation.DeletedBy(); ok { + _spec.SetField(usersettinghistory.FieldDeletedBy, field.TypeString, value) + } + if ushuo.mutation.DeletedByCleared() { + _spec.ClearField(usersettinghistory.FieldDeletedBy, field.TypeString) + } + if value, ok := ushuo.mutation.UserID(); ok { + _spec.SetField(usersettinghistory.FieldUserID, field.TypeString, value) + } + if ushuo.mutation.UserIDCleared() { + _spec.ClearField(usersettinghistory.FieldUserID, field.TypeString) + } + if value, ok := ushuo.mutation.Locked(); ok { + _spec.SetField(usersettinghistory.FieldLocked, field.TypeBool, value) + } + if value, ok := ushuo.mutation.SilencedAt(); ok { + _spec.SetField(usersettinghistory.FieldSilencedAt, field.TypeTime, value) + } + if ushuo.mutation.SilencedAtCleared() { + _spec.ClearField(usersettinghistory.FieldSilencedAt, field.TypeTime) + } + if value, ok := ushuo.mutation.SuspendedAt(); ok { + _spec.SetField(usersettinghistory.FieldSuspendedAt, field.TypeTime, value) + } + if ushuo.mutation.SuspendedAtCleared() { + _spec.ClearField(usersettinghistory.FieldSuspendedAt, field.TypeTime) + } + if value, ok := ushuo.mutation.Status(); ok { + _spec.SetField(usersettinghistory.FieldStatus, field.TypeEnum, value) + } + if value, ok := ushuo.mutation.EmailConfirmed(); ok { + _spec.SetField(usersettinghistory.FieldEmailConfirmed, field.TypeBool, value) + } + if value, ok := ushuo.mutation.IsWebauthnAllowed(); ok { + _spec.SetField(usersettinghistory.FieldIsWebauthnAllowed, field.TypeBool, value) + } + if ushuo.mutation.IsWebauthnAllowedCleared() { + _spec.ClearField(usersettinghistory.FieldIsWebauthnAllowed, field.TypeBool) + } + if value, ok := ushuo.mutation.IsTfaEnabled(); ok { + _spec.SetField(usersettinghistory.FieldIsTfaEnabled, field.TypeBool, value) + } + if ushuo.mutation.IsTfaEnabledCleared() { + _spec.ClearField(usersettinghistory.FieldIsTfaEnabled, field.TypeBool) + } + if value, ok := ushuo.mutation.PhoneNumber(); ok { + _spec.SetField(usersettinghistory.FieldPhoneNumber, field.TypeString, value) + } + if ushuo.mutation.PhoneNumberCleared() { + _spec.ClearField(usersettinghistory.FieldPhoneNumber, field.TypeString) + } + _spec.Node.Schema = ushuo.schemaConfig.UserSettingHistory + ctx = internal.NewSchemaConfigContext(ctx, ushuo.schemaConfig) + _node = &UserSettingHistory{config: ushuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, ushuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{usersettinghistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + ushuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/webauthn.go b/internal/ent/generated/webauthn.go new file mode 100644 index 0000000..efbe3cb --- /dev/null +++ b/internal/ent/generated/webauthn.go @@ -0,0 +1,322 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webauthn" +) + +// Webauthn is the model entity for the Webauthn schema. +type Webauthn struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The user id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // A probabilistically-unique byte sequence identifying a public key credential source and its authentication assertions + CredentialID []byte `json:"credential_id,omitempty"` + // The public key portion of a Relying Party-specific credential key pair, generated by an authenticator and returned to a Relying Party at registration time + PublicKey []byte `json:"public_key,omitempty"` + // The attestation format used (if any) by the authenticator when creating the credential + AttestationType string `json:"attestation_type,omitempty"` + // The AAGUID of the authenticator; AAGUID is defined as an array containing the globally unique identifier of the authenticator model being sought + Aaguid []byte `json:"aaguid,omitempty"` + // SignCount -Upon a new login operation, the Relying Party compares the stored signature counter value with the new signCount value returned in the assertions authenticator data. If this new signCount value is less than or equal to the stored value, a cloned authenticator may exist, or the authenticator may be malfunctioning + SignCount int32 `json:"sign_count,omitempty"` + // transport + Transports []string `json:"transports,omitempty"` + // Flag backup eligible indicates the credential is able to be backed up and/or sync'd between devices. This should NEVER change + BackupEligible bool `json:"backup_eligible,omitempty"` + // Flag backup state indicates the credential has been backed up and/or sync'd + BackupState bool `json:"backup_state,omitempty"` + // Flag user present indicates the users presence + UserPresent bool `json:"user_present,omitempty"` + // Flag user verified indicates the user performed verification + UserVerified bool `json:"user_verified,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the WebauthnQuery when eager-loading is set. + Edges WebauthnEdges `json:"edges"` + selectValues sql.SelectValues +} + +// WebauthnEdges holds the relations/edges for other nodes in the graph. +type WebauthnEdges struct { + // Owner holds the value of the owner edge. + Owner *User `json:"owner,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 +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e WebauthnEdges) OwnerOrErr() (*User, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: user.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Webauthn) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case webauthn.FieldTags, webauthn.FieldCredentialID, webauthn.FieldPublicKey, webauthn.FieldAaguid, webauthn.FieldTransports: + values[i] = new([]byte) + case webauthn.FieldBackupEligible, webauthn.FieldBackupState, webauthn.FieldUserPresent, webauthn.FieldUserVerified: + values[i] = new(sql.NullBool) + case webauthn.FieldSignCount: + values[i] = new(sql.NullInt64) + case webauthn.FieldID, webauthn.FieldCreatedBy, webauthn.FieldUpdatedBy, webauthn.FieldMappingID, webauthn.FieldOwnerID, webauthn.FieldAttestationType: + values[i] = new(sql.NullString) + case webauthn.FieldCreatedAt, webauthn.FieldUpdatedAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Webauthn fields. +func (w *Webauthn) 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 webauthn.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + w.ID = value.String + } + case webauthn.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + w.CreatedAt = value.Time + } + case webauthn.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + w.UpdatedAt = value.Time + } + case webauthn.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + w.CreatedBy = value.String + } + case webauthn.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + w.UpdatedBy = value.String + } + case webauthn.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + w.MappingID = value.String + } + case webauthn.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &w.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case webauthn.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + w.OwnerID = value.String + } + case webauthn.FieldCredentialID: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field credential_id", values[i]) + } else if value != nil { + w.CredentialID = *value + } + case webauthn.FieldPublicKey: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field public_key", values[i]) + } else if value != nil { + w.PublicKey = *value + } + case webauthn.FieldAttestationType: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field attestation_type", values[i]) + } else if value.Valid { + w.AttestationType = value.String + } + case webauthn.FieldAaguid: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field aaguid", values[i]) + } else if value != nil { + w.Aaguid = *value + } + case webauthn.FieldSignCount: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field sign_count", values[i]) + } else if value.Valid { + w.SignCount = int32(value.Int64) + } + case webauthn.FieldTransports: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field transports", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &w.Transports); err != nil { + return fmt.Errorf("unmarshal field transports: %w", err) + } + } + case webauthn.FieldBackupEligible: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field backup_eligible", values[i]) + } else if value.Valid { + w.BackupEligible = value.Bool + } + case webauthn.FieldBackupState: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field backup_state", values[i]) + } else if value.Valid { + w.BackupState = value.Bool + } + case webauthn.FieldUserPresent: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field user_present", values[i]) + } else if value.Valid { + w.UserPresent = value.Bool + } + case webauthn.FieldUserVerified: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field user_verified", values[i]) + } else if value.Valid { + w.UserVerified = value.Bool + } + default: + w.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Webauthn. +// This includes values selected through modifiers, order, etc. +func (w *Webauthn) Value(name string) (ent.Value, error) { + return w.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Webauthn entity. +func (w *Webauthn) QueryOwner() *UserQuery { + return NewWebauthnClient(w.config).QueryOwner(w) +} + +// Update returns a builder for updating this Webauthn. +// Note that you need to call Webauthn.Unwrap() before calling this method if this Webauthn +// was returned from a transaction, and the transaction was committed or rolled back. +func (w *Webauthn) Update() *WebauthnUpdateOne { + return NewWebauthnClient(w.config).UpdateOne(w) +} + +// Unwrap unwraps the Webauthn 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 (w *Webauthn) Unwrap() *Webauthn { + _tx, ok := w.config.driver.(*txDriver) + if !ok { + panic("generated: Webauthn is not a transactional entity") + } + w.config.driver = _tx.drv + return w +} + +// String implements the fmt.Stringer. +func (w *Webauthn) String() string { + var builder strings.Builder + builder.WriteString("Webauthn(") + builder.WriteString(fmt.Sprintf("id=%v, ", w.ID)) + builder.WriteString("created_at=") + builder.WriteString(w.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(w.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(w.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(w.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(w.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", w.Tags)) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(w.OwnerID) + builder.WriteString(", ") + builder.WriteString("credential_id=") + builder.WriteString(fmt.Sprintf("%v", w.CredentialID)) + builder.WriteString(", ") + builder.WriteString("public_key=") + builder.WriteString(fmt.Sprintf("%v", w.PublicKey)) + builder.WriteString(", ") + builder.WriteString("attestation_type=") + builder.WriteString(w.AttestationType) + builder.WriteString(", ") + builder.WriteString("aaguid=") + builder.WriteString(fmt.Sprintf("%v", w.Aaguid)) + builder.WriteString(", ") + builder.WriteString("sign_count=") + builder.WriteString(fmt.Sprintf("%v", w.SignCount)) + builder.WriteString(", ") + builder.WriteString("transports=") + builder.WriteString(fmt.Sprintf("%v", w.Transports)) + builder.WriteString(", ") + builder.WriteString("backup_eligible=") + builder.WriteString(fmt.Sprintf("%v", w.BackupEligible)) + builder.WriteString(", ") + builder.WriteString("backup_state=") + builder.WriteString(fmt.Sprintf("%v", w.BackupState)) + builder.WriteString(", ") + builder.WriteString("user_present=") + builder.WriteString(fmt.Sprintf("%v", w.UserPresent)) + builder.WriteString(", ") + builder.WriteString("user_verified=") + builder.WriteString(fmt.Sprintf("%v", w.UserVerified)) + builder.WriteByte(')') + return builder.String() +} + +// Webauthns is a parsable slice of Webauthn. +type Webauthns []*Webauthn diff --git a/internal/ent/generated/webauthn/webauthn.go b/internal/ent/generated/webauthn/webauthn.go new file mode 100644 index 0000000..d210747 --- /dev/null +++ b/internal/ent/generated/webauthn/webauthn.go @@ -0,0 +1,207 @@ +// Code generated by ent, DO NOT EDIT. + +package webauthn + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the webauthn type in the database. + Label = "webauthn" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldCredentialID holds the string denoting the credential_id field in the database. + FieldCredentialID = "credential_id" + // FieldPublicKey holds the string denoting the public_key field in the database. + FieldPublicKey = "public_key" + // FieldAttestationType holds the string denoting the attestation_type field in the database. + FieldAttestationType = "attestation_type" + // FieldAaguid holds the string denoting the aaguid field in the database. + FieldAaguid = "aaguid" + // FieldSignCount holds the string denoting the sign_count field in the database. + FieldSignCount = "sign_count" + // FieldTransports holds the string denoting the transports field in the database. + FieldTransports = "transports" + // FieldBackupEligible holds the string denoting the backup_eligible field in the database. + FieldBackupEligible = "backup_eligible" + // FieldBackupState holds the string denoting the backup_state field in the database. + FieldBackupState = "backup_state" + // FieldUserPresent holds the string denoting the user_present field in the database. + FieldUserPresent = "user_present" + // FieldUserVerified holds the string denoting the user_verified field in the database. + FieldUserVerified = "user_verified" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // Table holds the table name of the webauthn in the database. + Table = "webauthns" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "webauthns" + // OwnerInverseTable is the table name for the User entity. + // It exists in this package in order to avoid circular dependency with the "user" package. + OwnerInverseTable = "users" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" +) + +// Columns holds all SQL columns for webauthn fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldOwnerID, + FieldCredentialID, + FieldPublicKey, + FieldAttestationType, + FieldAaguid, + FieldSignCount, + FieldTransports, + FieldBackupEligible, + FieldBackupState, + FieldUserPresent, + FieldUserVerified, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [2]ent.Hook + Interceptors [1]ent.Interceptor + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultBackupEligible holds the default value on creation for the "backup_eligible" field. + DefaultBackupEligible bool + // DefaultBackupState holds the default value on creation for the "backup_state" field. + DefaultBackupState bool + // DefaultUserPresent holds the default value on creation for the "user_present" field. + DefaultUserPresent bool + // DefaultUserVerified holds the default value on creation for the "user_verified" field. + DefaultUserVerified bool + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Webauthn queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByAttestationType orders the results by the attestation_type field. +func ByAttestationType(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldAttestationType, opts...).ToFunc() +} + +// BySignCount orders the results by the sign_count field. +func BySignCount(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldSignCount, opts...).ToFunc() +} + +// ByBackupEligible orders the results by the backup_eligible field. +func ByBackupEligible(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBackupEligible, opts...).ToFunc() +} + +// ByBackupState orders the results by the backup_state field. +func ByBackupState(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldBackupState, opts...).ToFunc() +} + +// ByUserPresent orders the results by the user_present field. +func ByUserPresent(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserPresent, opts...).ToFunc() +} + +// ByUserVerified orders the results by the user_verified field. +func ByUserVerified(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUserVerified, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} diff --git a/internal/ent/generated/webauthn/where.go b/internal/ent/generated/webauthn/where.go new file mode 100644 index 0000000..49cf8f6 --- /dev/null +++ b/internal/ent/generated/webauthn/where.go @@ -0,0 +1,872 @@ +// Code generated by ent, DO NOT EDIT. + +package webauthn + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldMappingID, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldOwnerID, v)) +} + +// CredentialID applies equality check predicate on the "credential_id" field. It's identical to CredentialIDEQ. +func CredentialID(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldCredentialID, v)) +} + +// PublicKey applies equality check predicate on the "public_key" field. It's identical to PublicKeyEQ. +func PublicKey(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldPublicKey, v)) +} + +// AttestationType applies equality check predicate on the "attestation_type" field. It's identical to AttestationTypeEQ. +func AttestationType(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldAttestationType, v)) +} + +// Aaguid applies equality check predicate on the "aaguid" field. It's identical to AaguidEQ. +func Aaguid(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldAaguid, v)) +} + +// SignCount applies equality check predicate on the "sign_count" field. It's identical to SignCountEQ. +func SignCount(v int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldSignCount, v)) +} + +// BackupEligible applies equality check predicate on the "backup_eligible" field. It's identical to BackupEligibleEQ. +func BackupEligible(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldBackupEligible, v)) +} + +// BackupState applies equality check predicate on the "backup_state" field. It's identical to BackupStateEQ. +func BackupState(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldBackupState, v)) +} + +// UserPresent applies equality check predicate on the "user_present" field. It's identical to UserPresentEQ. +func UserPresent(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUserPresent, v)) +} + +// UserVerified applies equality check predicate on the "user_verified" field. It's identical to UserVerifiedEQ. +func UserVerified(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUserVerified, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldTags)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// CredentialIDEQ applies the EQ predicate on the "credential_id" field. +func CredentialIDEQ(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldCredentialID, v)) +} + +// CredentialIDNEQ applies the NEQ predicate on the "credential_id" field. +func CredentialIDNEQ(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldCredentialID, v)) +} + +// CredentialIDIn applies the In predicate on the "credential_id" field. +func CredentialIDIn(vs ...[]byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldCredentialID, vs...)) +} + +// CredentialIDNotIn applies the NotIn predicate on the "credential_id" field. +func CredentialIDNotIn(vs ...[]byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldCredentialID, vs...)) +} + +// CredentialIDGT applies the GT predicate on the "credential_id" field. +func CredentialIDGT(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldCredentialID, v)) +} + +// CredentialIDGTE applies the GTE predicate on the "credential_id" field. +func CredentialIDGTE(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldCredentialID, v)) +} + +// CredentialIDLT applies the LT predicate on the "credential_id" field. +func CredentialIDLT(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldCredentialID, v)) +} + +// CredentialIDLTE applies the LTE predicate on the "credential_id" field. +func CredentialIDLTE(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldCredentialID, v)) +} + +// CredentialIDIsNil applies the IsNil predicate on the "credential_id" field. +func CredentialIDIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldCredentialID)) +} + +// CredentialIDNotNil applies the NotNil predicate on the "credential_id" field. +func CredentialIDNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldCredentialID)) +} + +// PublicKeyEQ applies the EQ predicate on the "public_key" field. +func PublicKeyEQ(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldPublicKey, v)) +} + +// PublicKeyNEQ applies the NEQ predicate on the "public_key" field. +func PublicKeyNEQ(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldPublicKey, v)) +} + +// PublicKeyIn applies the In predicate on the "public_key" field. +func PublicKeyIn(vs ...[]byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldPublicKey, vs...)) +} + +// PublicKeyNotIn applies the NotIn predicate on the "public_key" field. +func PublicKeyNotIn(vs ...[]byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldPublicKey, vs...)) +} + +// PublicKeyGT applies the GT predicate on the "public_key" field. +func PublicKeyGT(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldPublicKey, v)) +} + +// PublicKeyGTE applies the GTE predicate on the "public_key" field. +func PublicKeyGTE(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldPublicKey, v)) +} + +// PublicKeyLT applies the LT predicate on the "public_key" field. +func PublicKeyLT(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldPublicKey, v)) +} + +// PublicKeyLTE applies the LTE predicate on the "public_key" field. +func PublicKeyLTE(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldPublicKey, v)) +} + +// PublicKeyIsNil applies the IsNil predicate on the "public_key" field. +func PublicKeyIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldPublicKey)) +} + +// PublicKeyNotNil applies the NotNil predicate on the "public_key" field. +func PublicKeyNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldPublicKey)) +} + +// AttestationTypeEQ applies the EQ predicate on the "attestation_type" field. +func AttestationTypeEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldAttestationType, v)) +} + +// AttestationTypeNEQ applies the NEQ predicate on the "attestation_type" field. +func AttestationTypeNEQ(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldAttestationType, v)) +} + +// AttestationTypeIn applies the In predicate on the "attestation_type" field. +func AttestationTypeIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldAttestationType, vs...)) +} + +// AttestationTypeNotIn applies the NotIn predicate on the "attestation_type" field. +func AttestationTypeNotIn(vs ...string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldAttestationType, vs...)) +} + +// AttestationTypeGT applies the GT predicate on the "attestation_type" field. +func AttestationTypeGT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldAttestationType, v)) +} + +// AttestationTypeGTE applies the GTE predicate on the "attestation_type" field. +func AttestationTypeGTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldAttestationType, v)) +} + +// AttestationTypeLT applies the LT predicate on the "attestation_type" field. +func AttestationTypeLT(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldAttestationType, v)) +} + +// AttestationTypeLTE applies the LTE predicate on the "attestation_type" field. +func AttestationTypeLTE(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldAttestationType, v)) +} + +// AttestationTypeContains applies the Contains predicate on the "attestation_type" field. +func AttestationTypeContains(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContains(FieldAttestationType, v)) +} + +// AttestationTypeHasPrefix applies the HasPrefix predicate on the "attestation_type" field. +func AttestationTypeHasPrefix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasPrefix(FieldAttestationType, v)) +} + +// AttestationTypeHasSuffix applies the HasSuffix predicate on the "attestation_type" field. +func AttestationTypeHasSuffix(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldHasSuffix(FieldAttestationType, v)) +} + +// AttestationTypeIsNil applies the IsNil predicate on the "attestation_type" field. +func AttestationTypeIsNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldIsNull(FieldAttestationType)) +} + +// AttestationTypeNotNil applies the NotNil predicate on the "attestation_type" field. +func AttestationTypeNotNil() predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotNull(FieldAttestationType)) +} + +// AttestationTypeEqualFold applies the EqualFold predicate on the "attestation_type" field. +func AttestationTypeEqualFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEqualFold(FieldAttestationType, v)) +} + +// AttestationTypeContainsFold applies the ContainsFold predicate on the "attestation_type" field. +func AttestationTypeContainsFold(v string) predicate.Webauthn { + return predicate.Webauthn(sql.FieldContainsFold(FieldAttestationType, v)) +} + +// AaguidEQ applies the EQ predicate on the "aaguid" field. +func AaguidEQ(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldAaguid, v)) +} + +// AaguidNEQ applies the NEQ predicate on the "aaguid" field. +func AaguidNEQ(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldAaguid, v)) +} + +// AaguidIn applies the In predicate on the "aaguid" field. +func AaguidIn(vs ...[]byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldAaguid, vs...)) +} + +// AaguidNotIn applies the NotIn predicate on the "aaguid" field. +func AaguidNotIn(vs ...[]byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldAaguid, vs...)) +} + +// AaguidGT applies the GT predicate on the "aaguid" field. +func AaguidGT(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldAaguid, v)) +} + +// AaguidGTE applies the GTE predicate on the "aaguid" field. +func AaguidGTE(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldAaguid, v)) +} + +// AaguidLT applies the LT predicate on the "aaguid" field. +func AaguidLT(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldAaguid, v)) +} + +// AaguidLTE applies the LTE predicate on the "aaguid" field. +func AaguidLTE(v []byte) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldAaguid, v)) +} + +// SignCountEQ applies the EQ predicate on the "sign_count" field. +func SignCountEQ(v int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldSignCount, v)) +} + +// SignCountNEQ applies the NEQ predicate on the "sign_count" field. +func SignCountNEQ(v int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldSignCount, v)) +} + +// SignCountIn applies the In predicate on the "sign_count" field. +func SignCountIn(vs ...int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldIn(FieldSignCount, vs...)) +} + +// SignCountNotIn applies the NotIn predicate on the "sign_count" field. +func SignCountNotIn(vs ...int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNotIn(FieldSignCount, vs...)) +} + +// SignCountGT applies the GT predicate on the "sign_count" field. +func SignCountGT(v int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGT(FieldSignCount, v)) +} + +// SignCountGTE applies the GTE predicate on the "sign_count" field. +func SignCountGTE(v int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldGTE(FieldSignCount, v)) +} + +// SignCountLT applies the LT predicate on the "sign_count" field. +func SignCountLT(v int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLT(FieldSignCount, v)) +} + +// SignCountLTE applies the LTE predicate on the "sign_count" field. +func SignCountLTE(v int32) predicate.Webauthn { + return predicate.Webauthn(sql.FieldLTE(FieldSignCount, v)) +} + +// BackupEligibleEQ applies the EQ predicate on the "backup_eligible" field. +func BackupEligibleEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldBackupEligible, v)) +} + +// BackupEligibleNEQ applies the NEQ predicate on the "backup_eligible" field. +func BackupEligibleNEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldBackupEligible, v)) +} + +// BackupStateEQ applies the EQ predicate on the "backup_state" field. +func BackupStateEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldBackupState, v)) +} + +// BackupStateNEQ applies the NEQ predicate on the "backup_state" field. +func BackupStateNEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldBackupState, v)) +} + +// UserPresentEQ applies the EQ predicate on the "user_present" field. +func UserPresentEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUserPresent, v)) +} + +// UserPresentNEQ applies the NEQ predicate on the "user_present" field. +func UserPresentNEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldUserPresent, v)) +} + +// UserVerifiedEQ applies the EQ predicate on the "user_verified" field. +func UserVerifiedEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldEQ(FieldUserVerified, v)) +} + +// UserVerifiedNEQ applies the NEQ predicate on the "user_verified" field. +func UserVerifiedNEQ(v bool) predicate.Webauthn { + return predicate.Webauthn(sql.FieldNEQ(FieldUserVerified, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Webauthn { + return predicate.Webauthn(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.Webauthn + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.User) predicate.Webauthn { + return predicate.Webauthn(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.Webauthn + 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.Webauthn) predicate.Webauthn { + return predicate.Webauthn(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Webauthn) predicate.Webauthn { + return predicate.Webauthn(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Webauthn) predicate.Webauthn { + return predicate.Webauthn(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/webauthn_create.go b/internal/ent/generated/webauthn_create.go new file mode 100644 index 0000000..1616731 --- /dev/null +++ b/internal/ent/generated/webauthn_create.go @@ -0,0 +1,548 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webauthn" +) + +// WebauthnCreate is the builder for creating a Webauthn entity. +type WebauthnCreate struct { + config + mutation *WebauthnMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (wc *WebauthnCreate) SetCreatedAt(t time.Time) *WebauthnCreate { + wc.mutation.SetCreatedAt(t) + return wc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableCreatedAt(t *time.Time) *WebauthnCreate { + if t != nil { + wc.SetCreatedAt(*t) + } + return wc +} + +// SetUpdatedAt sets the "updated_at" field. +func (wc *WebauthnCreate) SetUpdatedAt(t time.Time) *WebauthnCreate { + wc.mutation.SetUpdatedAt(t) + return wc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableUpdatedAt(t *time.Time) *WebauthnCreate { + if t != nil { + wc.SetUpdatedAt(*t) + } + return wc +} + +// SetCreatedBy sets the "created_by" field. +func (wc *WebauthnCreate) SetCreatedBy(s string) *WebauthnCreate { + wc.mutation.SetCreatedBy(s) + return wc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableCreatedBy(s *string) *WebauthnCreate { + if s != nil { + wc.SetCreatedBy(*s) + } + return wc +} + +// SetUpdatedBy sets the "updated_by" field. +func (wc *WebauthnCreate) SetUpdatedBy(s string) *WebauthnCreate { + wc.mutation.SetUpdatedBy(s) + return wc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableUpdatedBy(s *string) *WebauthnCreate { + if s != nil { + wc.SetUpdatedBy(*s) + } + return wc +} + +// SetMappingID sets the "mapping_id" field. +func (wc *WebauthnCreate) SetMappingID(s string) *WebauthnCreate { + wc.mutation.SetMappingID(s) + return wc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableMappingID(s *string) *WebauthnCreate { + if s != nil { + wc.SetMappingID(*s) + } + return wc +} + +// SetTags sets the "tags" field. +func (wc *WebauthnCreate) SetTags(s []string) *WebauthnCreate { + wc.mutation.SetTags(s) + return wc +} + +// SetOwnerID sets the "owner_id" field. +func (wc *WebauthnCreate) SetOwnerID(s string) *WebauthnCreate { + wc.mutation.SetOwnerID(s) + return wc +} + +// SetCredentialID sets the "credential_id" field. +func (wc *WebauthnCreate) SetCredentialID(b []byte) *WebauthnCreate { + wc.mutation.SetCredentialID(b) + return wc +} + +// SetPublicKey sets the "public_key" field. +func (wc *WebauthnCreate) SetPublicKey(b []byte) *WebauthnCreate { + wc.mutation.SetPublicKey(b) + return wc +} + +// SetAttestationType sets the "attestation_type" field. +func (wc *WebauthnCreate) SetAttestationType(s string) *WebauthnCreate { + wc.mutation.SetAttestationType(s) + return wc +} + +// SetNillableAttestationType sets the "attestation_type" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableAttestationType(s *string) *WebauthnCreate { + if s != nil { + wc.SetAttestationType(*s) + } + return wc +} + +// SetAaguid sets the "aaguid" field. +func (wc *WebauthnCreate) SetAaguid(b []byte) *WebauthnCreate { + wc.mutation.SetAaguid(b) + return wc +} + +// SetSignCount sets the "sign_count" field. +func (wc *WebauthnCreate) SetSignCount(i int32) *WebauthnCreate { + wc.mutation.SetSignCount(i) + return wc +} + +// SetTransports sets the "transports" field. +func (wc *WebauthnCreate) SetTransports(s []string) *WebauthnCreate { + wc.mutation.SetTransports(s) + return wc +} + +// SetBackupEligible sets the "backup_eligible" field. +func (wc *WebauthnCreate) SetBackupEligible(b bool) *WebauthnCreate { + wc.mutation.SetBackupEligible(b) + return wc +} + +// SetNillableBackupEligible sets the "backup_eligible" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableBackupEligible(b *bool) *WebauthnCreate { + if b != nil { + wc.SetBackupEligible(*b) + } + return wc +} + +// SetBackupState sets the "backup_state" field. +func (wc *WebauthnCreate) SetBackupState(b bool) *WebauthnCreate { + wc.mutation.SetBackupState(b) + return wc +} + +// SetNillableBackupState sets the "backup_state" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableBackupState(b *bool) *WebauthnCreate { + if b != nil { + wc.SetBackupState(*b) + } + return wc +} + +// SetUserPresent sets the "user_present" field. +func (wc *WebauthnCreate) SetUserPresent(b bool) *WebauthnCreate { + wc.mutation.SetUserPresent(b) + return wc +} + +// SetNillableUserPresent sets the "user_present" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableUserPresent(b *bool) *WebauthnCreate { + if b != nil { + wc.SetUserPresent(*b) + } + return wc +} + +// SetUserVerified sets the "user_verified" field. +func (wc *WebauthnCreate) SetUserVerified(b bool) *WebauthnCreate { + wc.mutation.SetUserVerified(b) + return wc +} + +// SetNillableUserVerified sets the "user_verified" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableUserVerified(b *bool) *WebauthnCreate { + if b != nil { + wc.SetUserVerified(*b) + } + return wc +} + +// SetID sets the "id" field. +func (wc *WebauthnCreate) SetID(s string) *WebauthnCreate { + wc.mutation.SetID(s) + return wc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (wc *WebauthnCreate) SetNillableID(s *string) *WebauthnCreate { + if s != nil { + wc.SetID(*s) + } + return wc +} + +// SetOwner sets the "owner" edge to the User entity. +func (wc *WebauthnCreate) SetOwner(u *User) *WebauthnCreate { + return wc.SetOwnerID(u.ID) +} + +// Mutation returns the WebauthnMutation object of the builder. +func (wc *WebauthnCreate) Mutation() *WebauthnMutation { + return wc.mutation +} + +// Save creates the Webauthn in the database. +func (wc *WebauthnCreate) Save(ctx context.Context) (*Webauthn, error) { + if err := wc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, wc.sqlSave, wc.mutation, wc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (wc *WebauthnCreate) SaveX(ctx context.Context) *Webauthn { + v, err := wc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (wc *WebauthnCreate) Exec(ctx context.Context) error { + _, err := wc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wc *WebauthnCreate) ExecX(ctx context.Context) { + if err := wc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (wc *WebauthnCreate) defaults() error { + if _, ok := wc.mutation.CreatedAt(); !ok { + if webauthn.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized webauthn.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := webauthn.DefaultCreatedAt() + wc.mutation.SetCreatedAt(v) + } + if _, ok := wc.mutation.UpdatedAt(); !ok { + if webauthn.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webauthn.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webauthn.DefaultUpdatedAt() + wc.mutation.SetUpdatedAt(v) + } + if _, ok := wc.mutation.MappingID(); !ok { + if webauthn.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized webauthn.DefaultMappingID (forgotten import generated/runtime?)") + } + v := webauthn.DefaultMappingID() + wc.mutation.SetMappingID(v) + } + if _, ok := wc.mutation.Tags(); !ok { + v := webauthn.DefaultTags + wc.mutation.SetTags(v) + } + if _, ok := wc.mutation.BackupEligible(); !ok { + v := webauthn.DefaultBackupEligible + wc.mutation.SetBackupEligible(v) + } + if _, ok := wc.mutation.BackupState(); !ok { + v := webauthn.DefaultBackupState + wc.mutation.SetBackupState(v) + } + if _, ok := wc.mutation.UserPresent(); !ok { + v := webauthn.DefaultUserPresent + wc.mutation.SetUserPresent(v) + } + if _, ok := wc.mutation.UserVerified(); !ok { + v := webauthn.DefaultUserVerified + wc.mutation.SetUserVerified(v) + } + if _, ok := wc.mutation.ID(); !ok { + if webauthn.DefaultID == nil { + return fmt.Errorf("generated: uninitialized webauthn.DefaultID (forgotten import generated/runtime?)") + } + v := webauthn.DefaultID() + wc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (wc *WebauthnCreate) check() error { + if _, ok := wc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Webauthn.mapping_id"`)} + } + if _, ok := wc.mutation.OwnerID(); !ok { + return &ValidationError{Name: "owner_id", err: errors.New(`generated: missing required field "Webauthn.owner_id"`)} + } + if _, ok := wc.mutation.Aaguid(); !ok { + return &ValidationError{Name: "aaguid", err: errors.New(`generated: missing required field "Webauthn.aaguid"`)} + } + if _, ok := wc.mutation.SignCount(); !ok { + return &ValidationError{Name: "sign_count", err: errors.New(`generated: missing required field "Webauthn.sign_count"`)} + } + if _, ok := wc.mutation.Transports(); !ok { + return &ValidationError{Name: "transports", err: errors.New(`generated: missing required field "Webauthn.transports"`)} + } + if _, ok := wc.mutation.BackupEligible(); !ok { + return &ValidationError{Name: "backup_eligible", err: errors.New(`generated: missing required field "Webauthn.backup_eligible"`)} + } + if _, ok := wc.mutation.BackupState(); !ok { + return &ValidationError{Name: "backup_state", err: errors.New(`generated: missing required field "Webauthn.backup_state"`)} + } + if _, ok := wc.mutation.UserPresent(); !ok { + return &ValidationError{Name: "user_present", err: errors.New(`generated: missing required field "Webauthn.user_present"`)} + } + if _, ok := wc.mutation.UserVerified(); !ok { + return &ValidationError{Name: "user_verified", err: errors.New(`generated: missing required field "Webauthn.user_verified"`)} + } + if len(wc.mutation.OwnerIDs()) == 0 { + return &ValidationError{Name: "owner", err: errors.New(`generated: missing required edge "Webauthn.owner"`)} + } + return nil +} + +func (wc *WebauthnCreate) sqlSave(ctx context.Context) (*Webauthn, error) { + if err := wc.check(); err != nil { + return nil, err + } + _node, _spec := wc.createSpec() + if err := sqlgraph.CreateNode(ctx, wc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Webauthn.ID type: %T", _spec.ID.Value) + } + } + wc.mutation.id = &_node.ID + wc.mutation.done = true + return _node, nil +} + +func (wc *WebauthnCreate) createSpec() (*Webauthn, *sqlgraph.CreateSpec) { + var ( + _node = &Webauthn{config: wc.config} + _spec = sqlgraph.NewCreateSpec(webauthn.Table, sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString)) + ) + _spec.Schema = wc.schemaConfig.Webauthn + if id, ok := wc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := wc.mutation.CreatedAt(); ok { + _spec.SetField(webauthn.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := wc.mutation.UpdatedAt(); ok { + _spec.SetField(webauthn.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := wc.mutation.CreatedBy(); ok { + _spec.SetField(webauthn.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := wc.mutation.UpdatedBy(); ok { + _spec.SetField(webauthn.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := wc.mutation.MappingID(); ok { + _spec.SetField(webauthn.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := wc.mutation.Tags(); ok { + _spec.SetField(webauthn.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := wc.mutation.CredentialID(); ok { + _spec.SetField(webauthn.FieldCredentialID, field.TypeBytes, value) + _node.CredentialID = value + } + if value, ok := wc.mutation.PublicKey(); ok { + _spec.SetField(webauthn.FieldPublicKey, field.TypeBytes, value) + _node.PublicKey = value + } + if value, ok := wc.mutation.AttestationType(); ok { + _spec.SetField(webauthn.FieldAttestationType, field.TypeString, value) + _node.AttestationType = value + } + if value, ok := wc.mutation.Aaguid(); ok { + _spec.SetField(webauthn.FieldAaguid, field.TypeBytes, value) + _node.Aaguid = value + } + if value, ok := wc.mutation.SignCount(); ok { + _spec.SetField(webauthn.FieldSignCount, field.TypeInt32, value) + _node.SignCount = value + } + if value, ok := wc.mutation.Transports(); ok { + _spec.SetField(webauthn.FieldTransports, field.TypeJSON, value) + _node.Transports = value + } + if value, ok := wc.mutation.BackupEligible(); ok { + _spec.SetField(webauthn.FieldBackupEligible, field.TypeBool, value) + _node.BackupEligible = value + } + if value, ok := wc.mutation.BackupState(); ok { + _spec.SetField(webauthn.FieldBackupState, field.TypeBool, value) + _node.BackupState = value + } + if value, ok := wc.mutation.UserPresent(); ok { + _spec.SetField(webauthn.FieldUserPresent, field.TypeBool, value) + _node.UserPresent = value + } + if value, ok := wc.mutation.UserVerified(); ok { + _spec.SetField(webauthn.FieldUserVerified, field.TypeBool, value) + _node.UserVerified = value + } + if nodes := wc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webauthn.OwnerTable, + Columns: []string{webauthn.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = wc.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// WebauthnCreateBulk is the builder for creating many Webauthn entities in bulk. +type WebauthnCreateBulk struct { + config + err error + builders []*WebauthnCreate +} + +// Save creates the Webauthn entities in the database. +func (wcb *WebauthnCreateBulk) Save(ctx context.Context) ([]*Webauthn, error) { + if wcb.err != nil { + return nil, wcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(wcb.builders)) + nodes := make([]*Webauthn, len(wcb.builders)) + mutators := make([]Mutator, len(wcb.builders)) + for i := range wcb.builders { + func(i int, root context.Context) { + builder := wcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*WebauthnMutation) + 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, wcb.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, wcb.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, wcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (wcb *WebauthnCreateBulk) SaveX(ctx context.Context) []*Webauthn { + v, err := wcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (wcb *WebauthnCreateBulk) Exec(ctx context.Context) error { + _, err := wcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wcb *WebauthnCreateBulk) ExecX(ctx context.Context) { + if err := wcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/webauthn_delete.go b/internal/ent/generated/webauthn_delete.go new file mode 100644 index 0000000..a5ea715 --- /dev/null +++ b/internal/ent/generated/webauthn_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/webauthn" +) + +// WebauthnDelete is the builder for deleting a Webauthn entity. +type WebauthnDelete struct { + config + hooks []Hook + mutation *WebauthnMutation +} + +// Where appends a list predicates to the WebauthnDelete builder. +func (wd *WebauthnDelete) Where(ps ...predicate.Webauthn) *WebauthnDelete { + wd.mutation.Where(ps...) + return wd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (wd *WebauthnDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, wd.sqlExec, wd.mutation, wd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (wd *WebauthnDelete) ExecX(ctx context.Context) int { + n, err := wd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (wd *WebauthnDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(webauthn.Table, sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString)) + _spec.Node.Schema = wd.schemaConfig.Webauthn + ctx = internal.NewSchemaConfigContext(ctx, wd.schemaConfig) + if ps := wd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, wd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + wd.mutation.done = true + return affected, err +} + +// WebauthnDeleteOne is the builder for deleting a single Webauthn entity. +type WebauthnDeleteOne struct { + wd *WebauthnDelete +} + +// Where appends a list predicates to the WebauthnDelete builder. +func (wdo *WebauthnDeleteOne) Where(ps ...predicate.Webauthn) *WebauthnDeleteOne { + wdo.wd.mutation.Where(ps...) + return wdo +} + +// Exec executes the deletion query. +func (wdo *WebauthnDeleteOne) Exec(ctx context.Context) error { + n, err := wdo.wd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{webauthn.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (wdo *WebauthnDeleteOne) ExecX(ctx context.Context) { + if err := wdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/webauthn_query.go b/internal/ent/generated/webauthn_query.go new file mode 100644 index 0000000..79231a8 --- /dev/null +++ b/internal/ent/generated/webauthn_query.go @@ -0,0 +1,631 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// WebauthnQuery is the builder for querying Webauthn entities. +type WebauthnQuery struct { + config + ctx *QueryContext + order []webauthn.OrderOption + inters []Interceptor + predicates []predicate.Webauthn + withOwner *UserQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Webauthn) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the WebauthnQuery builder. +func (wq *WebauthnQuery) Where(ps ...predicate.Webauthn) *WebauthnQuery { + wq.predicates = append(wq.predicates, ps...) + return wq +} + +// Limit the number of records to be returned by this query. +func (wq *WebauthnQuery) Limit(limit int) *WebauthnQuery { + wq.ctx.Limit = &limit + return wq +} + +// Offset to start from. +func (wq *WebauthnQuery) Offset(offset int) *WebauthnQuery { + wq.ctx.Offset = &offset + return wq +} + +// 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 (wq *WebauthnQuery) Unique(unique bool) *WebauthnQuery { + wq.ctx.Unique = &unique + return wq +} + +// Order specifies how the records should be ordered. +func (wq *WebauthnQuery) Order(o ...webauthn.OrderOption) *WebauthnQuery { + wq.order = append(wq.order, o...) + return wq +} + +// QueryOwner chains the current query on the "owner" edge. +func (wq *WebauthnQuery) QueryOwner() *UserQuery { + query := (&UserClient{config: wq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := wq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := wq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(webauthn.Table, webauthn.FieldID, selector), + sqlgraph.To(user.Table, user.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, webauthn.OwnerTable, webauthn.OwnerColumn), + ) + schemaConfig := wq.schemaConfig + step.To.Schema = schemaConfig.User + step.Edge.Schema = schemaConfig.Webauthn + fromU = sqlgraph.SetNeighbors(wq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Webauthn entity from the query. +// Returns a *NotFoundError when no Webauthn was found. +func (wq *WebauthnQuery) First(ctx context.Context) (*Webauthn, error) { + nodes, err := wq.Limit(1).All(setContextOp(ctx, wq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{webauthn.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (wq *WebauthnQuery) FirstX(ctx context.Context) *Webauthn { + node, err := wq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Webauthn ID from the query. +// Returns a *NotFoundError when no Webauthn ID was found. +func (wq *WebauthnQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = wq.Limit(1).IDs(setContextOp(ctx, wq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{webauthn.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (wq *WebauthnQuery) FirstIDX(ctx context.Context) string { + id, err := wq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Webauthn entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Webauthn entity is found. +// Returns a *NotFoundError when no Webauthn entities are found. +func (wq *WebauthnQuery) Only(ctx context.Context) (*Webauthn, error) { + nodes, err := wq.Limit(2).All(setContextOp(ctx, wq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{webauthn.Label} + default: + return nil, &NotSingularError{webauthn.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (wq *WebauthnQuery) OnlyX(ctx context.Context) *Webauthn { + node, err := wq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Webauthn ID in the query. +// Returns a *NotSingularError when more than one Webauthn ID is found. +// Returns a *NotFoundError when no entities are found. +func (wq *WebauthnQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = wq.Limit(2).IDs(setContextOp(ctx, wq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{webauthn.Label} + default: + err = &NotSingularError{webauthn.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (wq *WebauthnQuery) OnlyIDX(ctx context.Context) string { + id, err := wq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Webauthns. +func (wq *WebauthnQuery) All(ctx context.Context) ([]*Webauthn, error) { + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryAll) + if err := wq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Webauthn, *WebauthnQuery]() + return withInterceptors[[]*Webauthn](ctx, wq, qr, wq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (wq *WebauthnQuery) AllX(ctx context.Context) []*Webauthn { + nodes, err := wq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Webauthn IDs. +func (wq *WebauthnQuery) IDs(ctx context.Context) (ids []string, err error) { + if wq.ctx.Unique == nil && wq.path != nil { + wq.Unique(true) + } + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryIDs) + if err = wq.Select(webauthn.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (wq *WebauthnQuery) IDsX(ctx context.Context) []string { + ids, err := wq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (wq *WebauthnQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryCount) + if err := wq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, wq, querierCount[*WebauthnQuery](), wq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (wq *WebauthnQuery) CountX(ctx context.Context) int { + count, err := wq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (wq *WebauthnQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryExist) + switch _, err := wq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (wq *WebauthnQuery) ExistX(ctx context.Context) bool { + exist, err := wq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the WebauthnQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (wq *WebauthnQuery) Clone() *WebauthnQuery { + if wq == nil { + return nil + } + return &WebauthnQuery{ + config: wq.config, + ctx: wq.ctx.Clone(), + order: append([]webauthn.OrderOption{}, wq.order...), + inters: append([]Interceptor{}, wq.inters...), + predicates: append([]predicate.Webauthn{}, wq.predicates...), + withOwner: wq.withOwner.Clone(), + // clone intermediate query. + sql: wq.sql.Clone(), + path: wq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (wq *WebauthnQuery) WithOwner(opts ...func(*UserQuery)) *WebauthnQuery { + query := (&UserClient{config: wq.config}).Query() + for _, opt := range opts { + opt(query) + } + wq.withOwner = query + return wq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Webauthn.Query(). +// GroupBy(webauthn.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (wq *WebauthnQuery) GroupBy(field string, fields ...string) *WebauthnGroupBy { + wq.ctx.Fields = append([]string{field}, fields...) + grbuild := &WebauthnGroupBy{build: wq} + grbuild.flds = &wq.ctx.Fields + grbuild.label = webauthn.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Webauthn.Query(). +// Select(webauthn.FieldCreatedAt). +// Scan(ctx, &v) +func (wq *WebauthnQuery) Select(fields ...string) *WebauthnSelect { + wq.ctx.Fields = append(wq.ctx.Fields, fields...) + sbuild := &WebauthnSelect{WebauthnQuery: wq} + sbuild.label = webauthn.Label + sbuild.flds, sbuild.scan = &wq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a WebauthnSelect configured with the given aggregations. +func (wq *WebauthnQuery) Aggregate(fns ...AggregateFunc) *WebauthnSelect { + return wq.Select().Aggregate(fns...) +} + +func (wq *WebauthnQuery) prepareQuery(ctx context.Context) error { + for _, inter := range wq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, wq); err != nil { + return err + } + } + } + for _, f := range wq.ctx.Fields { + if !webauthn.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if wq.path != nil { + prev, err := wq.path(ctx) + if err != nil { + return err + } + wq.sql = prev + } + return nil +} + +func (wq *WebauthnQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Webauthn, error) { + var ( + nodes = []*Webauthn{} + _spec = wq.querySpec() + loadedTypes = [1]bool{ + wq.withOwner != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Webauthn).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Webauthn{config: wq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = wq.schemaConfig.Webauthn + ctx = internal.NewSchemaConfigContext(ctx, wq.schemaConfig) + if len(wq.modifiers) > 0 { + _spec.Modifiers = wq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, wq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := wq.withOwner; query != nil { + if err := wq.loadOwner(ctx, query, nodes, nil, + func(n *Webauthn, e *User) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + for i := range wq.loadTotal { + if err := wq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (wq *WebauthnQuery) loadOwner(ctx context.Context, query *UserQuery, nodes []*Webauthn, init func(*Webauthn), assign func(*Webauthn, *User)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Webauthn) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(user.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} + +func (wq *WebauthnQuery) sqlCount(ctx context.Context) (int, error) { + _spec := wq.querySpec() + _spec.Node.Schema = wq.schemaConfig.Webauthn + ctx = internal.NewSchemaConfigContext(ctx, wq.schemaConfig) + if len(wq.modifiers) > 0 { + _spec.Modifiers = wq.modifiers + } + _spec.Node.Columns = wq.ctx.Fields + if len(wq.ctx.Fields) > 0 { + _spec.Unique = wq.ctx.Unique != nil && *wq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, wq.driver, _spec) +} + +func (wq *WebauthnQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(webauthn.Table, webauthn.Columns, sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString)) + _spec.From = wq.sql + if unique := wq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if wq.path != nil { + _spec.Unique = true + } + if fields := wq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, webauthn.FieldID) + for i := range fields { + if fields[i] != webauthn.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if wq.withOwner != nil { + _spec.Node.AddColumnOnce(webauthn.FieldOwnerID) + } + } + if ps := wq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := wq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := wq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := wq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (wq *WebauthnQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(wq.driver.Dialect()) + t1 := builder.Table(webauthn.Table) + columns := wq.ctx.Fields + if len(columns) == 0 { + columns = webauthn.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if wq.sql != nil { + selector = wq.sql + selector.Select(selector.Columns(columns...)...) + } + if wq.ctx.Unique != nil && *wq.ctx.Unique { + selector.Distinct() + } + t1.Schema(wq.schemaConfig.Webauthn) + ctx = internal.NewSchemaConfigContext(ctx, wq.schemaConfig) + selector.WithContext(ctx) + for _, p := range wq.predicates { + p(selector) + } + for _, p := range wq.order { + p(selector) + } + if offset := wq.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 := wq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WebauthnGroupBy is the group-by builder for Webauthn entities. +type WebauthnGroupBy struct { + selector + build *WebauthnQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (wgb *WebauthnGroupBy) Aggregate(fns ...AggregateFunc) *WebauthnGroupBy { + wgb.fns = append(wgb.fns, fns...) + return wgb +} + +// Scan applies the selector query and scans the result into the given value. +func (wgb *WebauthnGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, wgb.build.ctx, ent.OpQueryGroupBy) + if err := wgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*WebauthnQuery, *WebauthnGroupBy](ctx, wgb.build, wgb, wgb.build.inters, v) +} + +func (wgb *WebauthnGroupBy) sqlScan(ctx context.Context, root *WebauthnQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(wgb.fns)) + for _, fn := range wgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*wgb.flds)+len(wgb.fns)) + for _, f := range *wgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*wgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := wgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// WebauthnSelect is the builder for selecting fields of Webauthn entities. +type WebauthnSelect struct { + *WebauthnQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ws *WebauthnSelect) Aggregate(fns ...AggregateFunc) *WebauthnSelect { + ws.fns = append(ws.fns, fns...) + return ws +} + +// Scan applies the selector query and scans the result into the given value. +func (ws *WebauthnSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ws.ctx, ent.OpQuerySelect) + if err := ws.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*WebauthnQuery, *WebauthnSelect](ctx, ws.WebauthnQuery, ws, ws.inters, v) +} + +func (ws *WebauthnSelect) sqlScan(ctx context.Context, root *WebauthnQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ws.fns)) + for _, fn := range ws.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ws.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 := ws.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/webauthn_update.go b/internal/ent/generated/webauthn_update.go new file mode 100644 index 0000000..8fc97f7 --- /dev/null +++ b/internal/ent/generated/webauthn_update.go @@ -0,0 +1,826 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// WebauthnUpdate is the builder for updating Webauthn entities. +type WebauthnUpdate struct { + config + hooks []Hook + mutation *WebauthnMutation +} + +// Where appends a list predicates to the WebauthnUpdate builder. +func (wu *WebauthnUpdate) Where(ps ...predicate.Webauthn) *WebauthnUpdate { + wu.mutation.Where(ps...) + return wu +} + +// SetUpdatedAt sets the "updated_at" field. +func (wu *WebauthnUpdate) SetUpdatedAt(t time.Time) *WebauthnUpdate { + wu.mutation.SetUpdatedAt(t) + return wu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (wu *WebauthnUpdate) ClearUpdatedAt() *WebauthnUpdate { + wu.mutation.ClearUpdatedAt() + return wu +} + +// SetUpdatedBy sets the "updated_by" field. +func (wu *WebauthnUpdate) SetUpdatedBy(s string) *WebauthnUpdate { + wu.mutation.SetUpdatedBy(s) + return wu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (wu *WebauthnUpdate) SetNillableUpdatedBy(s *string) *WebauthnUpdate { + if s != nil { + wu.SetUpdatedBy(*s) + } + return wu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (wu *WebauthnUpdate) ClearUpdatedBy() *WebauthnUpdate { + wu.mutation.ClearUpdatedBy() + return wu +} + +// SetTags sets the "tags" field. +func (wu *WebauthnUpdate) SetTags(s []string) *WebauthnUpdate { + wu.mutation.SetTags(s) + return wu +} + +// AppendTags appends s to the "tags" field. +func (wu *WebauthnUpdate) AppendTags(s []string) *WebauthnUpdate { + wu.mutation.AppendTags(s) + return wu +} + +// ClearTags clears the value of the "tags" field. +func (wu *WebauthnUpdate) ClearTags() *WebauthnUpdate { + wu.mutation.ClearTags() + return wu +} + +// SetOwnerID sets the "owner_id" field. +func (wu *WebauthnUpdate) SetOwnerID(s string) *WebauthnUpdate { + wu.mutation.SetOwnerID(s) + return wu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (wu *WebauthnUpdate) SetNillableOwnerID(s *string) *WebauthnUpdate { + if s != nil { + wu.SetOwnerID(*s) + } + return wu +} + +// SetCredentialID sets the "credential_id" field. +func (wu *WebauthnUpdate) SetCredentialID(b []byte) *WebauthnUpdate { + wu.mutation.SetCredentialID(b) + return wu +} + +// ClearCredentialID clears the value of the "credential_id" field. +func (wu *WebauthnUpdate) ClearCredentialID() *WebauthnUpdate { + wu.mutation.ClearCredentialID() + return wu +} + +// SetPublicKey sets the "public_key" field. +func (wu *WebauthnUpdate) SetPublicKey(b []byte) *WebauthnUpdate { + wu.mutation.SetPublicKey(b) + return wu +} + +// ClearPublicKey clears the value of the "public_key" field. +func (wu *WebauthnUpdate) ClearPublicKey() *WebauthnUpdate { + wu.mutation.ClearPublicKey() + return wu +} + +// SetAttestationType sets the "attestation_type" field. +func (wu *WebauthnUpdate) SetAttestationType(s string) *WebauthnUpdate { + wu.mutation.SetAttestationType(s) + return wu +} + +// SetNillableAttestationType sets the "attestation_type" field if the given value is not nil. +func (wu *WebauthnUpdate) SetNillableAttestationType(s *string) *WebauthnUpdate { + if s != nil { + wu.SetAttestationType(*s) + } + return wu +} + +// ClearAttestationType clears the value of the "attestation_type" field. +func (wu *WebauthnUpdate) ClearAttestationType() *WebauthnUpdate { + wu.mutation.ClearAttestationType() + return wu +} + +// SetSignCount sets the "sign_count" field. +func (wu *WebauthnUpdate) SetSignCount(i int32) *WebauthnUpdate { + wu.mutation.ResetSignCount() + wu.mutation.SetSignCount(i) + return wu +} + +// SetNillableSignCount sets the "sign_count" field if the given value is not nil. +func (wu *WebauthnUpdate) SetNillableSignCount(i *int32) *WebauthnUpdate { + if i != nil { + wu.SetSignCount(*i) + } + return wu +} + +// AddSignCount adds i to the "sign_count" field. +func (wu *WebauthnUpdate) AddSignCount(i int32) *WebauthnUpdate { + wu.mutation.AddSignCount(i) + return wu +} + +// SetTransports sets the "transports" field. +func (wu *WebauthnUpdate) SetTransports(s []string) *WebauthnUpdate { + wu.mutation.SetTransports(s) + return wu +} + +// AppendTransports appends s to the "transports" field. +func (wu *WebauthnUpdate) AppendTransports(s []string) *WebauthnUpdate { + wu.mutation.AppendTransports(s) + return wu +} + +// SetBackupState sets the "backup_state" field. +func (wu *WebauthnUpdate) SetBackupState(b bool) *WebauthnUpdate { + wu.mutation.SetBackupState(b) + return wu +} + +// SetNillableBackupState sets the "backup_state" field if the given value is not nil. +func (wu *WebauthnUpdate) SetNillableBackupState(b *bool) *WebauthnUpdate { + if b != nil { + wu.SetBackupState(*b) + } + return wu +} + +// SetUserPresent sets the "user_present" field. +func (wu *WebauthnUpdate) SetUserPresent(b bool) *WebauthnUpdate { + wu.mutation.SetUserPresent(b) + return wu +} + +// SetNillableUserPresent sets the "user_present" field if the given value is not nil. +func (wu *WebauthnUpdate) SetNillableUserPresent(b *bool) *WebauthnUpdate { + if b != nil { + wu.SetUserPresent(*b) + } + return wu +} + +// SetUserVerified sets the "user_verified" field. +func (wu *WebauthnUpdate) SetUserVerified(b bool) *WebauthnUpdate { + wu.mutation.SetUserVerified(b) + return wu +} + +// SetNillableUserVerified sets the "user_verified" field if the given value is not nil. +func (wu *WebauthnUpdate) SetNillableUserVerified(b *bool) *WebauthnUpdate { + if b != nil { + wu.SetUserVerified(*b) + } + return wu +} + +// SetOwner sets the "owner" edge to the User entity. +func (wu *WebauthnUpdate) SetOwner(u *User) *WebauthnUpdate { + return wu.SetOwnerID(u.ID) +} + +// Mutation returns the WebauthnMutation object of the builder. +func (wu *WebauthnUpdate) Mutation() *WebauthnMutation { + return wu.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (wu *WebauthnUpdate) ClearOwner() *WebauthnUpdate { + wu.mutation.ClearOwner() + return wu +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (wu *WebauthnUpdate) Save(ctx context.Context) (int, error) { + if err := wu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, wu.sqlSave, wu.mutation, wu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (wu *WebauthnUpdate) SaveX(ctx context.Context) int { + affected, err := wu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (wu *WebauthnUpdate) Exec(ctx context.Context) error { + _, err := wu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wu *WebauthnUpdate) ExecX(ctx context.Context) { + if err := wu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (wu *WebauthnUpdate) defaults() error { + if _, ok := wu.mutation.UpdatedAt(); !ok && !wu.mutation.UpdatedAtCleared() { + if webauthn.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webauthn.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webauthn.UpdateDefaultUpdatedAt() + wu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (wu *WebauthnUpdate) check() error { + if wu.mutation.OwnerCleared() && len(wu.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Webauthn.owner"`) + } + return nil +} + +func (wu *WebauthnUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := wu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(webauthn.Table, webauthn.Columns, sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString)) + if ps := wu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if wu.mutation.CreatedAtCleared() { + _spec.ClearField(webauthn.FieldCreatedAt, field.TypeTime) + } + if value, ok := wu.mutation.UpdatedAt(); ok { + _spec.SetField(webauthn.FieldUpdatedAt, field.TypeTime, value) + } + if wu.mutation.UpdatedAtCleared() { + _spec.ClearField(webauthn.FieldUpdatedAt, field.TypeTime) + } + if wu.mutation.CreatedByCleared() { + _spec.ClearField(webauthn.FieldCreatedBy, field.TypeString) + } + if value, ok := wu.mutation.UpdatedBy(); ok { + _spec.SetField(webauthn.FieldUpdatedBy, field.TypeString, value) + } + if wu.mutation.UpdatedByCleared() { + _spec.ClearField(webauthn.FieldUpdatedBy, field.TypeString) + } + if value, ok := wu.mutation.Tags(); ok { + _spec.SetField(webauthn.FieldTags, field.TypeJSON, value) + } + if value, ok := wu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webauthn.FieldTags, value) + }) + } + if wu.mutation.TagsCleared() { + _spec.ClearField(webauthn.FieldTags, field.TypeJSON) + } + if value, ok := wu.mutation.CredentialID(); ok { + _spec.SetField(webauthn.FieldCredentialID, field.TypeBytes, value) + } + if wu.mutation.CredentialIDCleared() { + _spec.ClearField(webauthn.FieldCredentialID, field.TypeBytes) + } + if value, ok := wu.mutation.PublicKey(); ok { + _spec.SetField(webauthn.FieldPublicKey, field.TypeBytes, value) + } + if wu.mutation.PublicKeyCleared() { + _spec.ClearField(webauthn.FieldPublicKey, field.TypeBytes) + } + if value, ok := wu.mutation.AttestationType(); ok { + _spec.SetField(webauthn.FieldAttestationType, field.TypeString, value) + } + if wu.mutation.AttestationTypeCleared() { + _spec.ClearField(webauthn.FieldAttestationType, field.TypeString) + } + if value, ok := wu.mutation.SignCount(); ok { + _spec.SetField(webauthn.FieldSignCount, field.TypeInt32, value) + } + if value, ok := wu.mutation.AddedSignCount(); ok { + _spec.AddField(webauthn.FieldSignCount, field.TypeInt32, value) + } + if value, ok := wu.mutation.Transports(); ok { + _spec.SetField(webauthn.FieldTransports, field.TypeJSON, value) + } + if value, ok := wu.mutation.AppendedTransports(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webauthn.FieldTransports, value) + }) + } + if value, ok := wu.mutation.BackupState(); ok { + _spec.SetField(webauthn.FieldBackupState, field.TypeBool, value) + } + if value, ok := wu.mutation.UserPresent(); ok { + _spec.SetField(webauthn.FieldUserPresent, field.TypeBool, value) + } + if value, ok := wu.mutation.UserVerified(); ok { + _spec.SetField(webauthn.FieldUserVerified, field.TypeBool, value) + } + if wu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webauthn.OwnerTable, + Columns: []string{webauthn.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.Webauthn + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webauthn.OwnerTable, + Columns: []string{webauthn.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = wu.schemaConfig.Webauthn + ctx = internal.NewSchemaConfigContext(ctx, wu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, wu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{webauthn.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + wu.mutation.done = true + return n, nil +} + +// WebauthnUpdateOne is the builder for updating a single Webauthn entity. +type WebauthnUpdateOne struct { + config + fields []string + hooks []Hook + mutation *WebauthnMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (wuo *WebauthnUpdateOne) SetUpdatedAt(t time.Time) *WebauthnUpdateOne { + wuo.mutation.SetUpdatedAt(t) + return wuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (wuo *WebauthnUpdateOne) ClearUpdatedAt() *WebauthnUpdateOne { + wuo.mutation.ClearUpdatedAt() + return wuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (wuo *WebauthnUpdateOne) SetUpdatedBy(s string) *WebauthnUpdateOne { + wuo.mutation.SetUpdatedBy(s) + return wuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (wuo *WebauthnUpdateOne) SetNillableUpdatedBy(s *string) *WebauthnUpdateOne { + if s != nil { + wuo.SetUpdatedBy(*s) + } + return wuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (wuo *WebauthnUpdateOne) ClearUpdatedBy() *WebauthnUpdateOne { + wuo.mutation.ClearUpdatedBy() + return wuo +} + +// SetTags sets the "tags" field. +func (wuo *WebauthnUpdateOne) SetTags(s []string) *WebauthnUpdateOne { + wuo.mutation.SetTags(s) + return wuo +} + +// AppendTags appends s to the "tags" field. +func (wuo *WebauthnUpdateOne) AppendTags(s []string) *WebauthnUpdateOne { + wuo.mutation.AppendTags(s) + return wuo +} + +// ClearTags clears the value of the "tags" field. +func (wuo *WebauthnUpdateOne) ClearTags() *WebauthnUpdateOne { + wuo.mutation.ClearTags() + return wuo +} + +// SetOwnerID sets the "owner_id" field. +func (wuo *WebauthnUpdateOne) SetOwnerID(s string) *WebauthnUpdateOne { + wuo.mutation.SetOwnerID(s) + return wuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (wuo *WebauthnUpdateOne) SetNillableOwnerID(s *string) *WebauthnUpdateOne { + if s != nil { + wuo.SetOwnerID(*s) + } + return wuo +} + +// SetCredentialID sets the "credential_id" field. +func (wuo *WebauthnUpdateOne) SetCredentialID(b []byte) *WebauthnUpdateOne { + wuo.mutation.SetCredentialID(b) + return wuo +} + +// ClearCredentialID clears the value of the "credential_id" field. +func (wuo *WebauthnUpdateOne) ClearCredentialID() *WebauthnUpdateOne { + wuo.mutation.ClearCredentialID() + return wuo +} + +// SetPublicKey sets the "public_key" field. +func (wuo *WebauthnUpdateOne) SetPublicKey(b []byte) *WebauthnUpdateOne { + wuo.mutation.SetPublicKey(b) + return wuo +} + +// ClearPublicKey clears the value of the "public_key" field. +func (wuo *WebauthnUpdateOne) ClearPublicKey() *WebauthnUpdateOne { + wuo.mutation.ClearPublicKey() + return wuo +} + +// SetAttestationType sets the "attestation_type" field. +func (wuo *WebauthnUpdateOne) SetAttestationType(s string) *WebauthnUpdateOne { + wuo.mutation.SetAttestationType(s) + return wuo +} + +// SetNillableAttestationType sets the "attestation_type" field if the given value is not nil. +func (wuo *WebauthnUpdateOne) SetNillableAttestationType(s *string) *WebauthnUpdateOne { + if s != nil { + wuo.SetAttestationType(*s) + } + return wuo +} + +// ClearAttestationType clears the value of the "attestation_type" field. +func (wuo *WebauthnUpdateOne) ClearAttestationType() *WebauthnUpdateOne { + wuo.mutation.ClearAttestationType() + return wuo +} + +// SetSignCount sets the "sign_count" field. +func (wuo *WebauthnUpdateOne) SetSignCount(i int32) *WebauthnUpdateOne { + wuo.mutation.ResetSignCount() + wuo.mutation.SetSignCount(i) + return wuo +} + +// SetNillableSignCount sets the "sign_count" field if the given value is not nil. +func (wuo *WebauthnUpdateOne) SetNillableSignCount(i *int32) *WebauthnUpdateOne { + if i != nil { + wuo.SetSignCount(*i) + } + return wuo +} + +// AddSignCount adds i to the "sign_count" field. +func (wuo *WebauthnUpdateOne) AddSignCount(i int32) *WebauthnUpdateOne { + wuo.mutation.AddSignCount(i) + return wuo +} + +// SetTransports sets the "transports" field. +func (wuo *WebauthnUpdateOne) SetTransports(s []string) *WebauthnUpdateOne { + wuo.mutation.SetTransports(s) + return wuo +} + +// AppendTransports appends s to the "transports" field. +func (wuo *WebauthnUpdateOne) AppendTransports(s []string) *WebauthnUpdateOne { + wuo.mutation.AppendTransports(s) + return wuo +} + +// SetBackupState sets the "backup_state" field. +func (wuo *WebauthnUpdateOne) SetBackupState(b bool) *WebauthnUpdateOne { + wuo.mutation.SetBackupState(b) + return wuo +} + +// SetNillableBackupState sets the "backup_state" field if the given value is not nil. +func (wuo *WebauthnUpdateOne) SetNillableBackupState(b *bool) *WebauthnUpdateOne { + if b != nil { + wuo.SetBackupState(*b) + } + return wuo +} + +// SetUserPresent sets the "user_present" field. +func (wuo *WebauthnUpdateOne) SetUserPresent(b bool) *WebauthnUpdateOne { + wuo.mutation.SetUserPresent(b) + return wuo +} + +// SetNillableUserPresent sets the "user_present" field if the given value is not nil. +func (wuo *WebauthnUpdateOne) SetNillableUserPresent(b *bool) *WebauthnUpdateOne { + if b != nil { + wuo.SetUserPresent(*b) + } + return wuo +} + +// SetUserVerified sets the "user_verified" field. +func (wuo *WebauthnUpdateOne) SetUserVerified(b bool) *WebauthnUpdateOne { + wuo.mutation.SetUserVerified(b) + return wuo +} + +// SetNillableUserVerified sets the "user_verified" field if the given value is not nil. +func (wuo *WebauthnUpdateOne) SetNillableUserVerified(b *bool) *WebauthnUpdateOne { + if b != nil { + wuo.SetUserVerified(*b) + } + return wuo +} + +// SetOwner sets the "owner" edge to the User entity. +func (wuo *WebauthnUpdateOne) SetOwner(u *User) *WebauthnUpdateOne { + return wuo.SetOwnerID(u.ID) +} + +// Mutation returns the WebauthnMutation object of the builder. +func (wuo *WebauthnUpdateOne) Mutation() *WebauthnMutation { + return wuo.mutation +} + +// ClearOwner clears the "owner" edge to the User entity. +func (wuo *WebauthnUpdateOne) ClearOwner() *WebauthnUpdateOne { + wuo.mutation.ClearOwner() + return wuo +} + +// Where appends a list predicates to the WebauthnUpdate builder. +func (wuo *WebauthnUpdateOne) Where(ps ...predicate.Webauthn) *WebauthnUpdateOne { + wuo.mutation.Where(ps...) + return wuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (wuo *WebauthnUpdateOne) Select(field string, fields ...string) *WebauthnUpdateOne { + wuo.fields = append([]string{field}, fields...) + return wuo +} + +// Save executes the query and returns the updated Webauthn entity. +func (wuo *WebauthnUpdateOne) Save(ctx context.Context) (*Webauthn, error) { + if err := wuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, wuo.sqlSave, wuo.mutation, wuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (wuo *WebauthnUpdateOne) SaveX(ctx context.Context) *Webauthn { + node, err := wuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (wuo *WebauthnUpdateOne) Exec(ctx context.Context) error { + _, err := wuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wuo *WebauthnUpdateOne) ExecX(ctx context.Context) { + if err := wuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (wuo *WebauthnUpdateOne) defaults() error { + if _, ok := wuo.mutation.UpdatedAt(); !ok && !wuo.mutation.UpdatedAtCleared() { + if webauthn.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webauthn.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webauthn.UpdateDefaultUpdatedAt() + wuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (wuo *WebauthnUpdateOne) check() error { + if wuo.mutation.OwnerCleared() && len(wuo.mutation.OwnerIDs()) > 0 { + return errors.New(`generated: clearing a required unique edge "Webauthn.owner"`) + } + return nil +} + +func (wuo *WebauthnUpdateOne) sqlSave(ctx context.Context) (_node *Webauthn, err error) { + if err := wuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(webauthn.Table, webauthn.Columns, sqlgraph.NewFieldSpec(webauthn.FieldID, field.TypeString)) + id, ok := wuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Webauthn.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := wuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, webauthn.FieldID) + for _, f := range fields { + if !webauthn.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != webauthn.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := wuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if wuo.mutation.CreatedAtCleared() { + _spec.ClearField(webauthn.FieldCreatedAt, field.TypeTime) + } + if value, ok := wuo.mutation.UpdatedAt(); ok { + _spec.SetField(webauthn.FieldUpdatedAt, field.TypeTime, value) + } + if wuo.mutation.UpdatedAtCleared() { + _spec.ClearField(webauthn.FieldUpdatedAt, field.TypeTime) + } + if wuo.mutation.CreatedByCleared() { + _spec.ClearField(webauthn.FieldCreatedBy, field.TypeString) + } + if value, ok := wuo.mutation.UpdatedBy(); ok { + _spec.SetField(webauthn.FieldUpdatedBy, field.TypeString, value) + } + if wuo.mutation.UpdatedByCleared() { + _spec.ClearField(webauthn.FieldUpdatedBy, field.TypeString) + } + if value, ok := wuo.mutation.Tags(); ok { + _spec.SetField(webauthn.FieldTags, field.TypeJSON, value) + } + if value, ok := wuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webauthn.FieldTags, value) + }) + } + if wuo.mutation.TagsCleared() { + _spec.ClearField(webauthn.FieldTags, field.TypeJSON) + } + if value, ok := wuo.mutation.CredentialID(); ok { + _spec.SetField(webauthn.FieldCredentialID, field.TypeBytes, value) + } + if wuo.mutation.CredentialIDCleared() { + _spec.ClearField(webauthn.FieldCredentialID, field.TypeBytes) + } + if value, ok := wuo.mutation.PublicKey(); ok { + _spec.SetField(webauthn.FieldPublicKey, field.TypeBytes, value) + } + if wuo.mutation.PublicKeyCleared() { + _spec.ClearField(webauthn.FieldPublicKey, field.TypeBytes) + } + if value, ok := wuo.mutation.AttestationType(); ok { + _spec.SetField(webauthn.FieldAttestationType, field.TypeString, value) + } + if wuo.mutation.AttestationTypeCleared() { + _spec.ClearField(webauthn.FieldAttestationType, field.TypeString) + } + if value, ok := wuo.mutation.SignCount(); ok { + _spec.SetField(webauthn.FieldSignCount, field.TypeInt32, value) + } + if value, ok := wuo.mutation.AddedSignCount(); ok { + _spec.AddField(webauthn.FieldSignCount, field.TypeInt32, value) + } + if value, ok := wuo.mutation.Transports(); ok { + _spec.SetField(webauthn.FieldTransports, field.TypeJSON, value) + } + if value, ok := wuo.mutation.AppendedTransports(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webauthn.FieldTransports, value) + }) + } + if value, ok := wuo.mutation.BackupState(); ok { + _spec.SetField(webauthn.FieldBackupState, field.TypeBool, value) + } + if value, ok := wuo.mutation.UserPresent(); ok { + _spec.SetField(webauthn.FieldUserPresent, field.TypeBool, value) + } + if value, ok := wuo.mutation.UserVerified(); ok { + _spec.SetField(webauthn.FieldUserVerified, field.TypeBool, value) + } + if wuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webauthn.OwnerTable, + Columns: []string{webauthn.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.Webauthn + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webauthn.OwnerTable, + Columns: []string{webauthn.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.Webauthn + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = wuo.schemaConfig.Webauthn + ctx = internal.NewSchemaConfigContext(ctx, wuo.schemaConfig) + _node = &Webauthn{config: wuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, wuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{webauthn.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + wuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/webhook.go b/internal/ent/generated/webhook.go new file mode 100644 index 0000000..c3159de --- /dev/null +++ b/internal/ent/generated/webhook.go @@ -0,0 +1,425 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/webhook" +) + +// Webhook is the model entity for the Webhook schema. +type Webhook struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the webhook + Name string `json:"name,omitempty"` + // a description of the webhook + Description string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destination_url,omitempty"` + // indicates if the webhook is active and enabled + Enabled bool `json:"enabled,omitempty"` + // the call back string + Callback string `json:"callback,omitempty"` + // the ttl of the webhook delivery + ExpiresAt time.Time `json:"expires_at,omitempty"` + // the comparison secret to verify the token's signature + Secret []byte `json:"secret,omitempty"` + // the number of failures + Failures int `json:"failures,omitempty"` + // the last error message + LastError string `json:"last_error,omitempty"` + // the last response + LastResponse string `json:"last_response,omitempty"` + // Edges holds the relations/edges for other nodes in the graph. + // The values are being populated by the WebhookQuery when eager-loading is set. + Edges WebhookEdges `json:"edges"` + selectValues sql.SelectValues +} + +// WebhookEdges holds the relations/edges for other nodes in the graph. +type WebhookEdges struct { + // Owner holds the value of the owner edge. + Owner *Organization `json:"owner,omitempty"` + // Events holds the value of the events edge. + Events []*Event `json:"events,omitempty"` + // Integrations holds the value of the integrations edge. + Integrations []*Integration `json:"integrations,omitempty"` + // loadedTypes holds the information for reporting if a + // type was loaded (or requested) in eager-loading or not. + loadedTypes [3]bool + // totalCount holds the count of the edges above. + totalCount [3]map[string]int + + namedEvents map[string][]*Event + namedIntegrations map[string][]*Integration +} + +// OwnerOrErr returns the Owner value or an error if the edge +// was not loaded in eager-loading, or loaded but was not found. +func (e WebhookEdges) OwnerOrErr() (*Organization, error) { + if e.Owner != nil { + return e.Owner, nil + } else if e.loadedTypes[0] { + return nil, &NotFoundError{label: organization.Label} + } + return nil, &NotLoadedError{edge: "owner"} +} + +// EventsOrErr returns the Events value or an error if the edge +// was not loaded in eager-loading. +func (e WebhookEdges) EventsOrErr() ([]*Event, error) { + if e.loadedTypes[1] { + return e.Events, nil + } + return nil, &NotLoadedError{edge: "events"} +} + +// IntegrationsOrErr returns the Integrations value or an error if the edge +// was not loaded in eager-loading. +func (e WebhookEdges) IntegrationsOrErr() ([]*Integration, error) { + if e.loadedTypes[2] { + return e.Integrations, nil + } + return nil, &NotLoadedError{edge: "integrations"} +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*Webhook) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case webhook.FieldTags, webhook.FieldSecret: + values[i] = new([]byte) + case webhook.FieldEnabled: + values[i] = new(sql.NullBool) + case webhook.FieldFailures: + values[i] = new(sql.NullInt64) + case webhook.FieldID, webhook.FieldCreatedBy, webhook.FieldUpdatedBy, webhook.FieldMappingID, webhook.FieldDeletedBy, webhook.FieldOwnerID, webhook.FieldName, webhook.FieldDescription, webhook.FieldDestinationURL, webhook.FieldCallback, webhook.FieldLastError, webhook.FieldLastResponse: + values[i] = new(sql.NullString) + case webhook.FieldCreatedAt, webhook.FieldUpdatedAt, webhook.FieldDeletedAt, webhook.FieldExpiresAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the Webhook fields. +func (w *Webhook) 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 webhook.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + w.ID = value.String + } + case webhook.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + w.CreatedAt = value.Time + } + case webhook.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + w.UpdatedAt = value.Time + } + case webhook.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + w.CreatedBy = value.String + } + case webhook.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + w.UpdatedBy = value.String + } + case webhook.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + w.MappingID = value.String + } + case webhook.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &w.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case webhook.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + w.DeletedAt = value.Time + } + case webhook.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + w.DeletedBy = value.String + } + case webhook.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + w.OwnerID = value.String + } + case webhook.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + w.Name = value.String + } + case webhook.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + w.Description = value.String + } + case webhook.FieldDestinationURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field destination_url", values[i]) + } else if value.Valid { + w.DestinationURL = value.String + } + case webhook.FieldEnabled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field enabled", values[i]) + } else if value.Valid { + w.Enabled = value.Bool + } + case webhook.FieldCallback: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field callback", values[i]) + } else if value.Valid { + w.Callback = value.String + } + case webhook.FieldExpiresAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field expires_at", values[i]) + } else if value.Valid { + w.ExpiresAt = value.Time + } + case webhook.FieldSecret: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field secret", values[i]) + } else if value != nil { + w.Secret = *value + } + case webhook.FieldFailures: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field failures", values[i]) + } else if value.Valid { + w.Failures = int(value.Int64) + } + case webhook.FieldLastError: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field last_error", values[i]) + } else if value.Valid { + w.LastError = value.String + } + case webhook.FieldLastResponse: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field last_response", values[i]) + } else if value.Valid { + w.LastResponse = value.String + } + default: + w.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the Webhook. +// This includes values selected through modifiers, order, etc. +func (w *Webhook) Value(name string) (ent.Value, error) { + return w.selectValues.Get(name) +} + +// QueryOwner queries the "owner" edge of the Webhook entity. +func (w *Webhook) QueryOwner() *OrganizationQuery { + return NewWebhookClient(w.config).QueryOwner(w) +} + +// QueryEvents queries the "events" edge of the Webhook entity. +func (w *Webhook) QueryEvents() *EventQuery { + return NewWebhookClient(w.config).QueryEvents(w) +} + +// QueryIntegrations queries the "integrations" edge of the Webhook entity. +func (w *Webhook) QueryIntegrations() *IntegrationQuery { + return NewWebhookClient(w.config).QueryIntegrations(w) +} + +// Update returns a builder for updating this Webhook. +// Note that you need to call Webhook.Unwrap() before calling this method if this Webhook +// was returned from a transaction, and the transaction was committed or rolled back. +func (w *Webhook) Update() *WebhookUpdateOne { + return NewWebhookClient(w.config).UpdateOne(w) +} + +// Unwrap unwraps the Webhook 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 (w *Webhook) Unwrap() *Webhook { + _tx, ok := w.config.driver.(*txDriver) + if !ok { + panic("generated: Webhook is not a transactional entity") + } + w.config.driver = _tx.drv + return w +} + +// String implements the fmt.Stringer. +func (w *Webhook) String() string { + var builder strings.Builder + builder.WriteString("Webhook(") + builder.WriteString(fmt.Sprintf("id=%v, ", w.ID)) + builder.WriteString("created_at=") + builder.WriteString(w.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(w.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(w.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(w.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(w.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", w.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(w.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(w.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(w.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(w.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(w.Description) + builder.WriteString(", ") + builder.WriteString("destination_url=") + builder.WriteString(w.DestinationURL) + builder.WriteString(", ") + builder.WriteString("enabled=") + builder.WriteString(fmt.Sprintf("%v", w.Enabled)) + builder.WriteString(", ") + builder.WriteString("callback=") + builder.WriteString(w.Callback) + builder.WriteString(", ") + builder.WriteString("expires_at=") + builder.WriteString(w.ExpiresAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("secret=") + builder.WriteString(fmt.Sprintf("%v", w.Secret)) + builder.WriteString(", ") + builder.WriteString("failures=") + builder.WriteString(fmt.Sprintf("%v", w.Failures)) + builder.WriteString(", ") + builder.WriteString("last_error=") + builder.WriteString(w.LastError) + builder.WriteString(", ") + builder.WriteString("last_response=") + builder.WriteString(w.LastResponse) + builder.WriteByte(')') + return builder.String() +} + +// NamedEvents returns the Events named value or an error if the edge was not +// loaded in eager-loading with this name. +func (w *Webhook) NamedEvents(name string) ([]*Event, error) { + if w.Edges.namedEvents == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := w.Edges.namedEvents[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (w *Webhook) appendNamedEvents(name string, edges ...*Event) { + if w.Edges.namedEvents == nil { + w.Edges.namedEvents = make(map[string][]*Event) + } + if len(edges) == 0 { + w.Edges.namedEvents[name] = []*Event{} + } else { + w.Edges.namedEvents[name] = append(w.Edges.namedEvents[name], edges...) + } +} + +// NamedIntegrations returns the Integrations named value or an error if the edge was not +// loaded in eager-loading with this name. +func (w *Webhook) NamedIntegrations(name string) ([]*Integration, error) { + if w.Edges.namedIntegrations == nil { + return nil, &NotLoadedError{edge: name} + } + nodes, ok := w.Edges.namedIntegrations[name] + if !ok { + return nil, &NotLoadedError{edge: name} + } + return nodes, nil +} + +func (w *Webhook) appendNamedIntegrations(name string, edges ...*Integration) { + if w.Edges.namedIntegrations == nil { + w.Edges.namedIntegrations = make(map[string][]*Integration) + } + if len(edges) == 0 { + w.Edges.namedIntegrations[name] = []*Integration{} + } else { + w.Edges.namedIntegrations[name] = append(w.Edges.namedIntegrations[name], edges...) + } +} + +// Webhooks is a parsable slice of Webhook. +type Webhooks []*Webhook diff --git a/internal/ent/generated/webhook/webhook.go b/internal/ent/generated/webhook/webhook.go new file mode 100644 index 0000000..0b435b5 --- /dev/null +++ b/internal/ent/generated/webhook/webhook.go @@ -0,0 +1,303 @@ +// Code generated by ent, DO NOT EDIT. + +package webhook + +import ( + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" +) + +const ( + // Label holds the string label denoting the webhook type in the database. + Label = "webhook" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldDestinationURL holds the string denoting the destination_url field in the database. + FieldDestinationURL = "destination_url" + // FieldEnabled holds the string denoting the enabled field in the database. + FieldEnabled = "enabled" + // FieldCallback holds the string denoting the callback field in the database. + FieldCallback = "callback" + // FieldExpiresAt holds the string denoting the expires_at field in the database. + FieldExpiresAt = "expires_at" + // FieldSecret holds the string denoting the secret field in the database. + FieldSecret = "secret" + // FieldFailures holds the string denoting the failures field in the database. + FieldFailures = "failures" + // FieldLastError holds the string denoting the last_error field in the database. + FieldLastError = "last_error" + // FieldLastResponse holds the string denoting the last_response field in the database. + FieldLastResponse = "last_response" + // EdgeOwner holds the string denoting the owner edge name in mutations. + EdgeOwner = "owner" + // EdgeEvents holds the string denoting the events edge name in mutations. + EdgeEvents = "events" + // EdgeIntegrations holds the string denoting the integrations edge name in mutations. + EdgeIntegrations = "integrations" + // Table holds the table name of the webhook in the database. + Table = "webhooks" + // OwnerTable is the table that holds the owner relation/edge. + OwnerTable = "webhooks" + // OwnerInverseTable is the table name for the Organization entity. + // It exists in this package in order to avoid circular dependency with the "organization" package. + OwnerInverseTable = "organizations" + // OwnerColumn is the table column denoting the owner relation/edge. + OwnerColumn = "owner_id" + // EventsTable is the table that holds the events relation/edge. The primary key declared below. + EventsTable = "webhook_events" + // EventsInverseTable is the table name for the Event entity. + // It exists in this package in order to avoid circular dependency with the "event" package. + EventsInverseTable = "events" + // IntegrationsTable is the table that holds the integrations relation/edge. The primary key declared below. + IntegrationsTable = "integration_webhooks" + // IntegrationsInverseTable is the table name for the Integration entity. + // It exists in this package in order to avoid circular dependency with the "integration" package. + IntegrationsInverseTable = "integrations" +) + +// Columns holds all SQL columns for webhook fields. +var Columns = []string{ + FieldID, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldName, + FieldDescription, + FieldDestinationURL, + FieldEnabled, + FieldCallback, + FieldExpiresAt, + FieldSecret, + FieldFailures, + FieldLastError, + FieldLastResponse, +} + +var ( + // EventsPrimaryKey and EventsColumn2 are the table columns denoting the + // primary key for the events relation (M2M). + EventsPrimaryKey = []string{"webhook_id", "event_id"} + // IntegrationsPrimaryKey and IntegrationsColumn2 are the table columns denoting the + // primary key for the integrations relation (M2M). + IntegrationsPrimaryKey = []string{"integration_id", "webhook_id"} +) + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [2]ent.Hook + Interceptors [1]ent.Interceptor + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // NameValidator is a validator for the "name" field. It is called by the builders before save. + NameValidator func(string) error + // DestinationURLValidator is a validator for the "destination_url" field. It is called by the builders before save. + DestinationURLValidator func(string) error + // DefaultEnabled holds the default value on creation for the "enabled" field. + DefaultEnabled bool + // DefaultFailures holds the default value on creation for the "failures" field. + DefaultFailures int + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OrderOption defines the ordering options for the Webhook queries. +type OrderOption func(*sql.Selector) + +// ByID orders the results by the id field. +func ByID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldID, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByDestinationURL orders the results by the destination_url field. +func ByDestinationURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDestinationURL, opts...).ToFunc() +} + +// ByEnabled orders the results by the enabled field. +func ByEnabled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEnabled, opts...).ToFunc() +} + +// ByCallback orders the results by the callback field. +func ByCallback(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCallback, opts...).ToFunc() +} + +// ByExpiresAt orders the results by the expires_at field. +func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpiresAt, opts...).ToFunc() +} + +// ByFailures orders the results by the failures field. +func ByFailures(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFailures, opts...).ToFunc() +} + +// ByLastError orders the results by the last_error field. +func ByLastError(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastError, opts...).ToFunc() +} + +// ByLastResponse orders the results by the last_response field. +func ByLastResponse(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastResponse, opts...).ToFunc() +} + +// ByOwnerField orders the results by owner field. +func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...)) + } +} + +// ByEventsCount orders the results by events count. +func ByEventsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newEventsStep(), opts...) + } +} + +// ByEvents orders the results by events terms. +func ByEvents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newEventsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} + +// ByIntegrationsCount orders the results by integrations count. +func ByIntegrationsCount(opts ...sql.OrderTermOption) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborsCount(s, newIntegrationsStep(), opts...) + } +} + +// ByIntegrations orders the results by integrations terms. +func ByIntegrations(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { + return func(s *sql.Selector) { + sqlgraph.OrderByNeighborTerms(s, newIntegrationsStep(), append([]sql.OrderTerm{term}, terms...)...) + } +} +func newOwnerStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(OwnerInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) +} +func newEventsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(EventsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) +} +func newIntegrationsStep() *sqlgraph.Step { + return sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.To(IntegrationsInverseTable, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationsTable, IntegrationsPrimaryKey...), + ) +} diff --git a/internal/ent/generated/webhook/where.go b/internal/ent/generated/webhook/where.go new file mode 100644 index 0000000..3a721a1 --- /dev/null +++ b/internal/ent/generated/webhook/where.go @@ -0,0 +1,1375 @@ +// Code generated by ent, DO NOT EDIT. + +package webhook + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldID, id)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDescription, v)) +} + +// DestinationURL applies equality check predicate on the "destination_url" field. It's identical to DestinationURLEQ. +func DestinationURL(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDestinationURL, v)) +} + +// Enabled applies equality check predicate on the "enabled" field. It's identical to EnabledEQ. +func Enabled(v bool) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldEnabled, v)) +} + +// Callback applies equality check predicate on the "callback" field. It's identical to CallbackEQ. +func Callback(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldCallback, v)) +} + +// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ. +func ExpiresAt(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldExpiresAt, v)) +} + +// Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ. +func Secret(v []byte) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldSecret, v)) +} + +// Failures applies equality check predicate on the "failures" field. It's identical to FailuresEQ. +func Failures(v int) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldFailures, v)) +} + +// LastError applies equality check predicate on the "last_error" field. It's identical to LastErrorEQ. +func LastError(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldLastError, v)) +} + +// LastResponse applies equality check predicate on the "last_response" field. It's identical to LastResponseEQ. +func LastResponse(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldLastResponse, v)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldDescription, v)) +} + +// DestinationURLEQ applies the EQ predicate on the "destination_url" field. +func DestinationURLEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldDestinationURL, v)) +} + +// DestinationURLNEQ applies the NEQ predicate on the "destination_url" field. +func DestinationURLNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldDestinationURL, v)) +} + +// DestinationURLIn applies the In predicate on the "destination_url" field. +func DestinationURLIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldDestinationURL, vs...)) +} + +// DestinationURLNotIn applies the NotIn predicate on the "destination_url" field. +func DestinationURLNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldDestinationURL, vs...)) +} + +// DestinationURLGT applies the GT predicate on the "destination_url" field. +func DestinationURLGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldDestinationURL, v)) +} + +// DestinationURLGTE applies the GTE predicate on the "destination_url" field. +func DestinationURLGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldDestinationURL, v)) +} + +// DestinationURLLT applies the LT predicate on the "destination_url" field. +func DestinationURLLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldDestinationURL, v)) +} + +// DestinationURLLTE applies the LTE predicate on the "destination_url" field. +func DestinationURLLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldDestinationURL, v)) +} + +// DestinationURLContains applies the Contains predicate on the "destination_url" field. +func DestinationURLContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldDestinationURL, v)) +} + +// DestinationURLHasPrefix applies the HasPrefix predicate on the "destination_url" field. +func DestinationURLHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldDestinationURL, v)) +} + +// DestinationURLHasSuffix applies the HasSuffix predicate on the "destination_url" field. +func DestinationURLHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldDestinationURL, v)) +} + +// DestinationURLEqualFold applies the EqualFold predicate on the "destination_url" field. +func DestinationURLEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldDestinationURL, v)) +} + +// DestinationURLContainsFold applies the ContainsFold predicate on the "destination_url" field. +func DestinationURLContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldDestinationURL, v)) +} + +// EnabledEQ applies the EQ predicate on the "enabled" field. +func EnabledEQ(v bool) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldEnabled, v)) +} + +// EnabledNEQ applies the NEQ predicate on the "enabled" field. +func EnabledNEQ(v bool) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldEnabled, v)) +} + +// CallbackEQ applies the EQ predicate on the "callback" field. +func CallbackEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldCallback, v)) +} + +// CallbackNEQ applies the NEQ predicate on the "callback" field. +func CallbackNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldCallback, v)) +} + +// CallbackIn applies the In predicate on the "callback" field. +func CallbackIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldCallback, vs...)) +} + +// CallbackNotIn applies the NotIn predicate on the "callback" field. +func CallbackNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldCallback, vs...)) +} + +// CallbackGT applies the GT predicate on the "callback" field. +func CallbackGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldCallback, v)) +} + +// CallbackGTE applies the GTE predicate on the "callback" field. +func CallbackGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldCallback, v)) +} + +// CallbackLT applies the LT predicate on the "callback" field. +func CallbackLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldCallback, v)) +} + +// CallbackLTE applies the LTE predicate on the "callback" field. +func CallbackLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldCallback, v)) +} + +// CallbackContains applies the Contains predicate on the "callback" field. +func CallbackContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldCallback, v)) +} + +// CallbackHasPrefix applies the HasPrefix predicate on the "callback" field. +func CallbackHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldCallback, v)) +} + +// CallbackHasSuffix applies the HasSuffix predicate on the "callback" field. +func CallbackHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldCallback, v)) +} + +// CallbackIsNil applies the IsNil predicate on the "callback" field. +func CallbackIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldCallback)) +} + +// CallbackNotNil applies the NotNil predicate on the "callback" field. +func CallbackNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldCallback)) +} + +// CallbackEqualFold applies the EqualFold predicate on the "callback" field. +func CallbackEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldCallback, v)) +} + +// CallbackContainsFold applies the ContainsFold predicate on the "callback" field. +func CallbackContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldCallback, v)) +} + +// ExpiresAtEQ applies the EQ predicate on the "expires_at" field. +func ExpiresAtEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldExpiresAt, v)) +} + +// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field. +func ExpiresAtNEQ(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldExpiresAt, v)) +} + +// ExpiresAtIn applies the In predicate on the "expires_at" field. +func ExpiresAtIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field. +func ExpiresAtNotIn(vs ...time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtGT applies the GT predicate on the "expires_at" field. +func ExpiresAtGT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldExpiresAt, v)) +} + +// ExpiresAtGTE applies the GTE predicate on the "expires_at" field. +func ExpiresAtGTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldExpiresAt, v)) +} + +// ExpiresAtLT applies the LT predicate on the "expires_at" field. +func ExpiresAtLT(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldExpiresAt, v)) +} + +// ExpiresAtLTE applies the LTE predicate on the "expires_at" field. +func ExpiresAtLTE(v time.Time) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldExpiresAt, v)) +} + +// ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field. +func ExpiresAtIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldExpiresAt)) +} + +// ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field. +func ExpiresAtNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldExpiresAt)) +} + +// SecretEQ applies the EQ predicate on the "secret" field. +func SecretEQ(v []byte) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldSecret, v)) +} + +// SecretNEQ applies the NEQ predicate on the "secret" field. +func SecretNEQ(v []byte) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldSecret, v)) +} + +// SecretIn applies the In predicate on the "secret" field. +func SecretIn(vs ...[]byte) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldSecret, vs...)) +} + +// SecretNotIn applies the NotIn predicate on the "secret" field. +func SecretNotIn(vs ...[]byte) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldSecret, vs...)) +} + +// SecretGT applies the GT predicate on the "secret" field. +func SecretGT(v []byte) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldSecret, v)) +} + +// SecretGTE applies the GTE predicate on the "secret" field. +func SecretGTE(v []byte) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldSecret, v)) +} + +// SecretLT applies the LT predicate on the "secret" field. +func SecretLT(v []byte) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldSecret, v)) +} + +// SecretLTE applies the LTE predicate on the "secret" field. +func SecretLTE(v []byte) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldSecret, v)) +} + +// SecretIsNil applies the IsNil predicate on the "secret" field. +func SecretIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldSecret)) +} + +// SecretNotNil applies the NotNil predicate on the "secret" field. +func SecretNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldSecret)) +} + +// FailuresEQ applies the EQ predicate on the "failures" field. +func FailuresEQ(v int) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldFailures, v)) +} + +// FailuresNEQ applies the NEQ predicate on the "failures" field. +func FailuresNEQ(v int) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldFailures, v)) +} + +// FailuresIn applies the In predicate on the "failures" field. +func FailuresIn(vs ...int) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldFailures, vs...)) +} + +// FailuresNotIn applies the NotIn predicate on the "failures" field. +func FailuresNotIn(vs ...int) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldFailures, vs...)) +} + +// FailuresGT applies the GT predicate on the "failures" field. +func FailuresGT(v int) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldFailures, v)) +} + +// FailuresGTE applies the GTE predicate on the "failures" field. +func FailuresGTE(v int) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldFailures, v)) +} + +// FailuresLT applies the LT predicate on the "failures" field. +func FailuresLT(v int) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldFailures, v)) +} + +// FailuresLTE applies the LTE predicate on the "failures" field. +func FailuresLTE(v int) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldFailures, v)) +} + +// FailuresIsNil applies the IsNil predicate on the "failures" field. +func FailuresIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldFailures)) +} + +// FailuresNotNil applies the NotNil predicate on the "failures" field. +func FailuresNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldFailures)) +} + +// LastErrorEQ applies the EQ predicate on the "last_error" field. +func LastErrorEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldLastError, v)) +} + +// LastErrorNEQ applies the NEQ predicate on the "last_error" field. +func LastErrorNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldLastError, v)) +} + +// LastErrorIn applies the In predicate on the "last_error" field. +func LastErrorIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldLastError, vs...)) +} + +// LastErrorNotIn applies the NotIn predicate on the "last_error" field. +func LastErrorNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldLastError, vs...)) +} + +// LastErrorGT applies the GT predicate on the "last_error" field. +func LastErrorGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldLastError, v)) +} + +// LastErrorGTE applies the GTE predicate on the "last_error" field. +func LastErrorGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldLastError, v)) +} + +// LastErrorLT applies the LT predicate on the "last_error" field. +func LastErrorLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldLastError, v)) +} + +// LastErrorLTE applies the LTE predicate on the "last_error" field. +func LastErrorLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldLastError, v)) +} + +// LastErrorContains applies the Contains predicate on the "last_error" field. +func LastErrorContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldLastError, v)) +} + +// LastErrorHasPrefix applies the HasPrefix predicate on the "last_error" field. +func LastErrorHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldLastError, v)) +} + +// LastErrorHasSuffix applies the HasSuffix predicate on the "last_error" field. +func LastErrorHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldLastError, v)) +} + +// LastErrorIsNil applies the IsNil predicate on the "last_error" field. +func LastErrorIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldLastError)) +} + +// LastErrorNotNil applies the NotNil predicate on the "last_error" field. +func LastErrorNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldLastError)) +} + +// LastErrorEqualFold applies the EqualFold predicate on the "last_error" field. +func LastErrorEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldLastError, v)) +} + +// LastErrorContainsFold applies the ContainsFold predicate on the "last_error" field. +func LastErrorContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldLastError, v)) +} + +// LastResponseEQ applies the EQ predicate on the "last_response" field. +func LastResponseEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEQ(FieldLastResponse, v)) +} + +// LastResponseNEQ applies the NEQ predicate on the "last_response" field. +func LastResponseNEQ(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldNEQ(FieldLastResponse, v)) +} + +// LastResponseIn applies the In predicate on the "last_response" field. +func LastResponseIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldIn(FieldLastResponse, vs...)) +} + +// LastResponseNotIn applies the NotIn predicate on the "last_response" field. +func LastResponseNotIn(vs ...string) predicate.Webhook { + return predicate.Webhook(sql.FieldNotIn(FieldLastResponse, vs...)) +} + +// LastResponseGT applies the GT predicate on the "last_response" field. +func LastResponseGT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGT(FieldLastResponse, v)) +} + +// LastResponseGTE applies the GTE predicate on the "last_response" field. +func LastResponseGTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldGTE(FieldLastResponse, v)) +} + +// LastResponseLT applies the LT predicate on the "last_response" field. +func LastResponseLT(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLT(FieldLastResponse, v)) +} + +// LastResponseLTE applies the LTE predicate on the "last_response" field. +func LastResponseLTE(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldLTE(FieldLastResponse, v)) +} + +// LastResponseContains applies the Contains predicate on the "last_response" field. +func LastResponseContains(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContains(FieldLastResponse, v)) +} + +// LastResponseHasPrefix applies the HasPrefix predicate on the "last_response" field. +func LastResponseHasPrefix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasPrefix(FieldLastResponse, v)) +} + +// LastResponseHasSuffix applies the HasSuffix predicate on the "last_response" field. +func LastResponseHasSuffix(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldHasSuffix(FieldLastResponse, v)) +} + +// LastResponseIsNil applies the IsNil predicate on the "last_response" field. +func LastResponseIsNil() predicate.Webhook { + return predicate.Webhook(sql.FieldIsNull(FieldLastResponse)) +} + +// LastResponseNotNil applies the NotNil predicate on the "last_response" field. +func LastResponseNotNil() predicate.Webhook { + return predicate.Webhook(sql.FieldNotNull(FieldLastResponse)) +} + +// LastResponseEqualFold applies the EqualFold predicate on the "last_response" field. +func LastResponseEqualFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldEqualFold(FieldLastResponse, v)) +} + +// LastResponseContainsFold applies the ContainsFold predicate on the "last_response" field. +func LastResponseContainsFold(v string) predicate.Webhook { + return predicate.Webhook(sql.FieldContainsFold(FieldLastResponse, v)) +} + +// HasOwner applies the HasEdge predicate on the "owner" edge. +func HasOwner() predicate.Webhook { + return predicate.Webhook(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Webhook + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). +func HasOwnerWith(preds ...predicate.Organization) predicate.Webhook { + return predicate.Webhook(func(s *sql.Selector) { + step := newOwnerStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Webhook + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasEvents applies the HasEdge predicate on the "events" edge. +func HasEvents() predicate.Webhook { + return predicate.Webhook(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, EventsTable, EventsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.WebhookEvents + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasEventsWith applies the HasEdge predicate on the "events" edge with a given conditions (other predicates). +func HasEventsWith(preds ...predicate.Event) predicate.Webhook { + return predicate.Webhook(func(s *sql.Selector) { + step := newEventsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.WebhookEvents + sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { + for _, p := range preds { + p(s) + } + }) + }) +} + +// HasIntegrations applies the HasEdge predicate on the "integrations" edge. +func HasIntegrations() predicate.Webhook { + return predicate.Webhook(func(s *sql.Selector) { + step := sqlgraph.NewStep( + sqlgraph.From(Table, FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, IntegrationsTable, IntegrationsPrimaryKey...), + ) + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationWebhooks + sqlgraph.HasNeighbors(s, step) + }) +} + +// HasIntegrationsWith applies the HasEdge predicate on the "integrations" edge with a given conditions (other predicates). +func HasIntegrationsWith(preds ...predicate.Integration) predicate.Webhook { + return predicate.Webhook(func(s *sql.Selector) { + step := newIntegrationsStep() + schemaConfig := internal.SchemaConfigFromContext(s.Context()) + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationWebhooks + 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.Webhook) predicate.Webhook { + return predicate.Webhook(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.Webhook) predicate.Webhook { + return predicate.Webhook(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.Webhook) predicate.Webhook { + return predicate.Webhook(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/webhook_create.go b/internal/ent/generated/webhook_create.go new file mode 100644 index 0000000..dd9152a --- /dev/null +++ b/internal/ent/generated/webhook_create.go @@ -0,0 +1,658 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/webhook" +) + +// WebhookCreate is the builder for creating a Webhook entity. +type WebhookCreate struct { + config + mutation *WebhookMutation + hooks []Hook +} + +// SetCreatedAt sets the "created_at" field. +func (wc *WebhookCreate) SetCreatedAt(t time.Time) *WebhookCreate { + wc.mutation.SetCreatedAt(t) + return wc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableCreatedAt(t *time.Time) *WebhookCreate { + if t != nil { + wc.SetCreatedAt(*t) + } + return wc +} + +// SetUpdatedAt sets the "updated_at" field. +func (wc *WebhookCreate) SetUpdatedAt(t time.Time) *WebhookCreate { + wc.mutation.SetUpdatedAt(t) + return wc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableUpdatedAt(t *time.Time) *WebhookCreate { + if t != nil { + wc.SetUpdatedAt(*t) + } + return wc +} + +// SetCreatedBy sets the "created_by" field. +func (wc *WebhookCreate) SetCreatedBy(s string) *WebhookCreate { + wc.mutation.SetCreatedBy(s) + return wc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableCreatedBy(s *string) *WebhookCreate { + if s != nil { + wc.SetCreatedBy(*s) + } + return wc +} + +// SetUpdatedBy sets the "updated_by" field. +func (wc *WebhookCreate) SetUpdatedBy(s string) *WebhookCreate { + wc.mutation.SetUpdatedBy(s) + return wc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableUpdatedBy(s *string) *WebhookCreate { + if s != nil { + wc.SetUpdatedBy(*s) + } + return wc +} + +// SetMappingID sets the "mapping_id" field. +func (wc *WebhookCreate) SetMappingID(s string) *WebhookCreate { + wc.mutation.SetMappingID(s) + return wc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableMappingID(s *string) *WebhookCreate { + if s != nil { + wc.SetMappingID(*s) + } + return wc +} + +// SetTags sets the "tags" field. +func (wc *WebhookCreate) SetTags(s []string) *WebhookCreate { + wc.mutation.SetTags(s) + return wc +} + +// SetDeletedAt sets the "deleted_at" field. +func (wc *WebhookCreate) SetDeletedAt(t time.Time) *WebhookCreate { + wc.mutation.SetDeletedAt(t) + return wc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableDeletedAt(t *time.Time) *WebhookCreate { + if t != nil { + wc.SetDeletedAt(*t) + } + return wc +} + +// SetDeletedBy sets the "deleted_by" field. +func (wc *WebhookCreate) SetDeletedBy(s string) *WebhookCreate { + wc.mutation.SetDeletedBy(s) + return wc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableDeletedBy(s *string) *WebhookCreate { + if s != nil { + wc.SetDeletedBy(*s) + } + return wc +} + +// SetOwnerID sets the "owner_id" field. +func (wc *WebhookCreate) SetOwnerID(s string) *WebhookCreate { + wc.mutation.SetOwnerID(s) + return wc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableOwnerID(s *string) *WebhookCreate { + if s != nil { + wc.SetOwnerID(*s) + } + return wc +} + +// SetName sets the "name" field. +func (wc *WebhookCreate) SetName(s string) *WebhookCreate { + wc.mutation.SetName(s) + return wc +} + +// SetDescription sets the "description" field. +func (wc *WebhookCreate) SetDescription(s string) *WebhookCreate { + wc.mutation.SetDescription(s) + return wc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableDescription(s *string) *WebhookCreate { + if s != nil { + wc.SetDescription(*s) + } + return wc +} + +// SetDestinationURL sets the "destination_url" field. +func (wc *WebhookCreate) SetDestinationURL(s string) *WebhookCreate { + wc.mutation.SetDestinationURL(s) + return wc +} + +// SetEnabled sets the "enabled" field. +func (wc *WebhookCreate) SetEnabled(b bool) *WebhookCreate { + wc.mutation.SetEnabled(b) + return wc +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableEnabled(b *bool) *WebhookCreate { + if b != nil { + wc.SetEnabled(*b) + } + return wc +} + +// SetCallback sets the "callback" field. +func (wc *WebhookCreate) SetCallback(s string) *WebhookCreate { + wc.mutation.SetCallback(s) + return wc +} + +// SetNillableCallback sets the "callback" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableCallback(s *string) *WebhookCreate { + if s != nil { + wc.SetCallback(*s) + } + return wc +} + +// SetExpiresAt sets the "expires_at" field. +func (wc *WebhookCreate) SetExpiresAt(t time.Time) *WebhookCreate { + wc.mutation.SetExpiresAt(t) + return wc +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableExpiresAt(t *time.Time) *WebhookCreate { + if t != nil { + wc.SetExpiresAt(*t) + } + return wc +} + +// SetSecret sets the "secret" field. +func (wc *WebhookCreate) SetSecret(b []byte) *WebhookCreate { + wc.mutation.SetSecret(b) + return wc +} + +// SetFailures sets the "failures" field. +func (wc *WebhookCreate) SetFailures(i int) *WebhookCreate { + wc.mutation.SetFailures(i) + return wc +} + +// SetNillableFailures sets the "failures" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableFailures(i *int) *WebhookCreate { + if i != nil { + wc.SetFailures(*i) + } + return wc +} + +// SetLastError sets the "last_error" field. +func (wc *WebhookCreate) SetLastError(s string) *WebhookCreate { + wc.mutation.SetLastError(s) + return wc +} + +// SetNillableLastError sets the "last_error" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableLastError(s *string) *WebhookCreate { + if s != nil { + wc.SetLastError(*s) + } + return wc +} + +// SetLastResponse sets the "last_response" field. +func (wc *WebhookCreate) SetLastResponse(s string) *WebhookCreate { + wc.mutation.SetLastResponse(s) + return wc +} + +// SetNillableLastResponse sets the "last_response" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableLastResponse(s *string) *WebhookCreate { + if s != nil { + wc.SetLastResponse(*s) + } + return wc +} + +// SetID sets the "id" field. +func (wc *WebhookCreate) SetID(s string) *WebhookCreate { + wc.mutation.SetID(s) + return wc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (wc *WebhookCreate) SetNillableID(s *string) *WebhookCreate { + if s != nil { + wc.SetID(*s) + } + return wc +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (wc *WebhookCreate) SetOwner(o *Organization) *WebhookCreate { + return wc.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (wc *WebhookCreate) AddEventIDs(ids ...string) *WebhookCreate { + wc.mutation.AddEventIDs(ids...) + return wc +} + +// AddEvents adds the "events" edges to the Event entity. +func (wc *WebhookCreate) AddEvents(e ...*Event) *WebhookCreate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return wc.AddEventIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (wc *WebhookCreate) AddIntegrationIDs(ids ...string) *WebhookCreate { + wc.mutation.AddIntegrationIDs(ids...) + return wc +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (wc *WebhookCreate) AddIntegrations(i ...*Integration) *WebhookCreate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return wc.AddIntegrationIDs(ids...) +} + +// Mutation returns the WebhookMutation object of the builder. +func (wc *WebhookCreate) Mutation() *WebhookMutation { + return wc.mutation +} + +// Save creates the Webhook in the database. +func (wc *WebhookCreate) Save(ctx context.Context) (*Webhook, error) { + if err := wc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, wc.sqlSave, wc.mutation, wc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (wc *WebhookCreate) SaveX(ctx context.Context) *Webhook { + v, err := wc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (wc *WebhookCreate) Exec(ctx context.Context) error { + _, err := wc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wc *WebhookCreate) ExecX(ctx context.Context) { + if err := wc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (wc *WebhookCreate) defaults() error { + if _, ok := wc.mutation.CreatedAt(); !ok { + if webhook.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized webhook.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := webhook.DefaultCreatedAt() + wc.mutation.SetCreatedAt(v) + } + if _, ok := wc.mutation.UpdatedAt(); !ok { + if webhook.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webhook.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webhook.DefaultUpdatedAt() + wc.mutation.SetUpdatedAt(v) + } + if _, ok := wc.mutation.MappingID(); !ok { + if webhook.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized webhook.DefaultMappingID (forgotten import generated/runtime?)") + } + v := webhook.DefaultMappingID() + wc.mutation.SetMappingID(v) + } + if _, ok := wc.mutation.Tags(); !ok { + v := webhook.DefaultTags + wc.mutation.SetTags(v) + } + if _, ok := wc.mutation.Enabled(); !ok { + v := webhook.DefaultEnabled + wc.mutation.SetEnabled(v) + } + if _, ok := wc.mutation.Failures(); !ok { + v := webhook.DefaultFailures + wc.mutation.SetFailures(v) + } + if _, ok := wc.mutation.ID(); !ok { + if webhook.DefaultID == nil { + return fmt.Errorf("generated: uninitialized webhook.DefaultID (forgotten import generated/runtime?)") + } + v := webhook.DefaultID() + wc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (wc *WebhookCreate) check() error { + if _, ok := wc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "Webhook.mapping_id"`)} + } + if _, ok := wc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "Webhook.name"`)} + } + if v, ok := wc.mutation.Name(); ok { + if err := webhook.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Webhook.name": %w`, err)} + } + } + if _, ok := wc.mutation.DestinationURL(); !ok { + return &ValidationError{Name: "destination_url", err: errors.New(`generated: missing required field "Webhook.destination_url"`)} + } + if v, ok := wc.mutation.DestinationURL(); ok { + if err := webhook.DestinationURLValidator(v); err != nil { + return &ValidationError{Name: "destination_url", err: fmt.Errorf(`generated: validator failed for field "Webhook.destination_url": %w`, err)} + } + } + if _, ok := wc.mutation.Enabled(); !ok { + return &ValidationError{Name: "enabled", err: errors.New(`generated: missing required field "Webhook.enabled"`)} + } + return nil +} + +func (wc *WebhookCreate) sqlSave(ctx context.Context) (*Webhook, error) { + if err := wc.check(); err != nil { + return nil, err + } + _node, _spec := wc.createSpec() + if err := sqlgraph.CreateNode(ctx, wc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected Webhook.ID type: %T", _spec.ID.Value) + } + } + wc.mutation.id = &_node.ID + wc.mutation.done = true + return _node, nil +} + +func (wc *WebhookCreate) createSpec() (*Webhook, *sqlgraph.CreateSpec) { + var ( + _node = &Webhook{config: wc.config} + _spec = sqlgraph.NewCreateSpec(webhook.Table, sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString)) + ) + _spec.Schema = wc.schemaConfig.Webhook + if id, ok := wc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := wc.mutation.CreatedAt(); ok { + _spec.SetField(webhook.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := wc.mutation.UpdatedAt(); ok { + _spec.SetField(webhook.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := wc.mutation.CreatedBy(); ok { + _spec.SetField(webhook.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := wc.mutation.UpdatedBy(); ok { + _spec.SetField(webhook.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := wc.mutation.MappingID(); ok { + _spec.SetField(webhook.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := wc.mutation.Tags(); ok { + _spec.SetField(webhook.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := wc.mutation.DeletedAt(); ok { + _spec.SetField(webhook.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := wc.mutation.DeletedBy(); ok { + _spec.SetField(webhook.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := wc.mutation.Name(); ok { + _spec.SetField(webhook.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := wc.mutation.Description(); ok { + _spec.SetField(webhook.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := wc.mutation.DestinationURL(); ok { + _spec.SetField(webhook.FieldDestinationURL, field.TypeString, value) + _node.DestinationURL = value + } + if value, ok := wc.mutation.Enabled(); ok { + _spec.SetField(webhook.FieldEnabled, field.TypeBool, value) + _node.Enabled = value + } + if value, ok := wc.mutation.Callback(); ok { + _spec.SetField(webhook.FieldCallback, field.TypeString, value) + _node.Callback = value + } + if value, ok := wc.mutation.ExpiresAt(); ok { + _spec.SetField(webhook.FieldExpiresAt, field.TypeTime, value) + _node.ExpiresAt = value + } + if value, ok := wc.mutation.Secret(); ok { + _spec.SetField(webhook.FieldSecret, field.TypeBytes, value) + _node.Secret = value + } + if value, ok := wc.mutation.Failures(); ok { + _spec.SetField(webhook.FieldFailures, field.TypeInt, value) + _node.Failures = value + } + if value, ok := wc.mutation.LastError(); ok { + _spec.SetField(webhook.FieldLastError, field.TypeString, value) + _node.LastError = value + } + if value, ok := wc.mutation.LastResponse(); ok { + _spec.SetField(webhook.FieldLastResponse, field.TypeString, value) + _node.LastResponse = value + } + if nodes := wc.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webhook.OwnerTable, + Columns: []string{webhook.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = wc.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _node.OwnerID = nodes[0] + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := wc.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = wc.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + if nodes := wc.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = wc.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges = append(_spec.Edges, edge) + } + return _node, _spec +} + +// WebhookCreateBulk is the builder for creating many Webhook entities in bulk. +type WebhookCreateBulk struct { + config + err error + builders []*WebhookCreate +} + +// Save creates the Webhook entities in the database. +func (wcb *WebhookCreateBulk) Save(ctx context.Context) ([]*Webhook, error) { + if wcb.err != nil { + return nil, wcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(wcb.builders)) + nodes := make([]*Webhook, len(wcb.builders)) + mutators := make([]Mutator, len(wcb.builders)) + for i := range wcb.builders { + func(i int, root context.Context) { + builder := wcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*WebhookMutation) + 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, wcb.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, wcb.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, wcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (wcb *WebhookCreateBulk) SaveX(ctx context.Context) []*Webhook { + v, err := wcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (wcb *WebhookCreateBulk) Exec(ctx context.Context) error { + _, err := wcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wcb *WebhookCreateBulk) ExecX(ctx context.Context) { + if err := wcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/webhook_delete.go b/internal/ent/generated/webhook_delete.go new file mode 100644 index 0000000..650be70 --- /dev/null +++ b/internal/ent/generated/webhook_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/webhook" +) + +// WebhookDelete is the builder for deleting a Webhook entity. +type WebhookDelete struct { + config + hooks []Hook + mutation *WebhookMutation +} + +// Where appends a list predicates to the WebhookDelete builder. +func (wd *WebhookDelete) Where(ps ...predicate.Webhook) *WebhookDelete { + wd.mutation.Where(ps...) + return wd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (wd *WebhookDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, wd.sqlExec, wd.mutation, wd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (wd *WebhookDelete) ExecX(ctx context.Context) int { + n, err := wd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (wd *WebhookDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(webhook.Table, sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString)) + _spec.Node.Schema = wd.schemaConfig.Webhook + ctx = internal.NewSchemaConfigContext(ctx, wd.schemaConfig) + if ps := wd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, wd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + wd.mutation.done = true + return affected, err +} + +// WebhookDeleteOne is the builder for deleting a single Webhook entity. +type WebhookDeleteOne struct { + wd *WebhookDelete +} + +// Where appends a list predicates to the WebhookDelete builder. +func (wdo *WebhookDeleteOne) Where(ps ...predicate.Webhook) *WebhookDeleteOne { + wdo.wd.mutation.Where(ps...) + return wdo +} + +// Exec executes the deletion query. +func (wdo *WebhookDeleteOne) Exec(ctx context.Context) error { + n, err := wdo.wd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{webhook.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (wdo *WebhookDeleteOne) ExecX(ctx context.Context) { + if err := wdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/webhook_query.go b/internal/ent/generated/webhook_query.go new file mode 100644 index 0000000..0fe9911 --- /dev/null +++ b/internal/ent/generated/webhook_query.go @@ -0,0 +1,894 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "database/sql/driver" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// WebhookQuery is the builder for querying Webhook entities. +type WebhookQuery struct { + config + ctx *QueryContext + order []webhook.OrderOption + inters []Interceptor + predicates []predicate.Webhook + withOwner *OrganizationQuery + withEvents *EventQuery + withIntegrations *IntegrationQuery + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*Webhook) error + withNamedEvents map[string]*EventQuery + withNamedIntegrations map[string]*IntegrationQuery + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the WebhookQuery builder. +func (wq *WebhookQuery) Where(ps ...predicate.Webhook) *WebhookQuery { + wq.predicates = append(wq.predicates, ps...) + return wq +} + +// Limit the number of records to be returned by this query. +func (wq *WebhookQuery) Limit(limit int) *WebhookQuery { + wq.ctx.Limit = &limit + return wq +} + +// Offset to start from. +func (wq *WebhookQuery) Offset(offset int) *WebhookQuery { + wq.ctx.Offset = &offset + return wq +} + +// 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 (wq *WebhookQuery) Unique(unique bool) *WebhookQuery { + wq.ctx.Unique = &unique + return wq +} + +// Order specifies how the records should be ordered. +func (wq *WebhookQuery) Order(o ...webhook.OrderOption) *WebhookQuery { + wq.order = append(wq.order, o...) + return wq +} + +// QueryOwner chains the current query on the "owner" edge. +func (wq *WebhookQuery) QueryOwner() *OrganizationQuery { + query := (&OrganizationClient{config: wq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := wq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := wq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(webhook.Table, webhook.FieldID, selector), + sqlgraph.To(organization.Table, organization.FieldID), + sqlgraph.Edge(sqlgraph.M2O, true, webhook.OwnerTable, webhook.OwnerColumn), + ) + schemaConfig := wq.schemaConfig + step.To.Schema = schemaConfig.Organization + step.Edge.Schema = schemaConfig.Webhook + fromU = sqlgraph.SetNeighbors(wq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryEvents chains the current query on the "events" edge. +func (wq *WebhookQuery) QueryEvents() *EventQuery { + query := (&EventClient{config: wq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := wq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := wq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(webhook.Table, webhook.FieldID, selector), + sqlgraph.To(event.Table, event.FieldID), + sqlgraph.Edge(sqlgraph.M2M, false, webhook.EventsTable, webhook.EventsPrimaryKey...), + ) + schemaConfig := wq.schemaConfig + step.To.Schema = schemaConfig.Event + step.Edge.Schema = schemaConfig.WebhookEvents + fromU = sqlgraph.SetNeighbors(wq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// QueryIntegrations chains the current query on the "integrations" edge. +func (wq *WebhookQuery) QueryIntegrations() *IntegrationQuery { + query := (&IntegrationClient{config: wq.config}).Query() + query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { + if err := wq.prepareQuery(ctx); err != nil { + return nil, err + } + selector := wq.sqlQuery(ctx) + if err := selector.Err(); err != nil { + return nil, err + } + step := sqlgraph.NewStep( + sqlgraph.From(webhook.Table, webhook.FieldID, selector), + sqlgraph.To(integration.Table, integration.FieldID), + sqlgraph.Edge(sqlgraph.M2M, true, webhook.IntegrationsTable, webhook.IntegrationsPrimaryKey...), + ) + schemaConfig := wq.schemaConfig + step.To.Schema = schemaConfig.Integration + step.Edge.Schema = schemaConfig.IntegrationWebhooks + fromU = sqlgraph.SetNeighbors(wq.driver.Dialect(), step) + return fromU, nil + } + return query +} + +// First returns the first Webhook entity from the query. +// Returns a *NotFoundError when no Webhook was found. +func (wq *WebhookQuery) First(ctx context.Context) (*Webhook, error) { + nodes, err := wq.Limit(1).All(setContextOp(ctx, wq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{webhook.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (wq *WebhookQuery) FirstX(ctx context.Context) *Webhook { + node, err := wq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first Webhook ID from the query. +// Returns a *NotFoundError when no Webhook ID was found. +func (wq *WebhookQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = wq.Limit(1).IDs(setContextOp(ctx, wq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{webhook.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (wq *WebhookQuery) FirstIDX(ctx context.Context) string { + id, err := wq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single Webhook entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one Webhook entity is found. +// Returns a *NotFoundError when no Webhook entities are found. +func (wq *WebhookQuery) Only(ctx context.Context) (*Webhook, error) { + nodes, err := wq.Limit(2).All(setContextOp(ctx, wq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{webhook.Label} + default: + return nil, &NotSingularError{webhook.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (wq *WebhookQuery) OnlyX(ctx context.Context) *Webhook { + node, err := wq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only Webhook ID in the query. +// Returns a *NotSingularError when more than one Webhook ID is found. +// Returns a *NotFoundError when no entities are found. +func (wq *WebhookQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = wq.Limit(2).IDs(setContextOp(ctx, wq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{webhook.Label} + default: + err = &NotSingularError{webhook.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (wq *WebhookQuery) OnlyIDX(ctx context.Context) string { + id, err := wq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of Webhooks. +func (wq *WebhookQuery) All(ctx context.Context) ([]*Webhook, error) { + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryAll) + if err := wq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*Webhook, *WebhookQuery]() + return withInterceptors[[]*Webhook](ctx, wq, qr, wq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (wq *WebhookQuery) AllX(ctx context.Context) []*Webhook { + nodes, err := wq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of Webhook IDs. +func (wq *WebhookQuery) IDs(ctx context.Context) (ids []string, err error) { + if wq.ctx.Unique == nil && wq.path != nil { + wq.Unique(true) + } + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryIDs) + if err = wq.Select(webhook.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (wq *WebhookQuery) IDsX(ctx context.Context) []string { + ids, err := wq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (wq *WebhookQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryCount) + if err := wq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, wq, querierCount[*WebhookQuery](), wq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (wq *WebhookQuery) CountX(ctx context.Context) int { + count, err := wq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (wq *WebhookQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, wq.ctx, ent.OpQueryExist) + switch _, err := wq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (wq *WebhookQuery) ExistX(ctx context.Context) bool { + exist, err := wq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the WebhookQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (wq *WebhookQuery) Clone() *WebhookQuery { + if wq == nil { + return nil + } + return &WebhookQuery{ + config: wq.config, + ctx: wq.ctx.Clone(), + order: append([]webhook.OrderOption{}, wq.order...), + inters: append([]Interceptor{}, wq.inters...), + predicates: append([]predicate.Webhook{}, wq.predicates...), + withOwner: wq.withOwner.Clone(), + withEvents: wq.withEvents.Clone(), + withIntegrations: wq.withIntegrations.Clone(), + // clone intermediate query. + sql: wq.sql.Clone(), + path: wq.path, + } +} + +// WithOwner tells the query-builder to eager-load the nodes that are connected to +// the "owner" edge. The optional arguments are used to configure the query builder of the edge. +func (wq *WebhookQuery) WithOwner(opts ...func(*OrganizationQuery)) *WebhookQuery { + query := (&OrganizationClient{config: wq.config}).Query() + for _, opt := range opts { + opt(query) + } + wq.withOwner = query + return wq +} + +// WithEvents tells the query-builder to eager-load the nodes that are connected to +// the "events" edge. The optional arguments are used to configure the query builder of the edge. +func (wq *WebhookQuery) WithEvents(opts ...func(*EventQuery)) *WebhookQuery { + query := (&EventClient{config: wq.config}).Query() + for _, opt := range opts { + opt(query) + } + wq.withEvents = query + return wq +} + +// WithIntegrations tells the query-builder to eager-load the nodes that are connected to +// the "integrations" edge. The optional arguments are used to configure the query builder of the edge. +func (wq *WebhookQuery) WithIntegrations(opts ...func(*IntegrationQuery)) *WebhookQuery { + query := (&IntegrationClient{config: wq.config}).Query() + for _, opt := range opts { + opt(query) + } + wq.withIntegrations = query + return wq +} + +// GroupBy is used to group vertices by one or more fields/columns. +// It is often used with aggregate functions, like: count, max, mean, min, sum. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.Webhook.Query(). +// GroupBy(webhook.FieldCreatedAt). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (wq *WebhookQuery) GroupBy(field string, fields ...string) *WebhookGroupBy { + wq.ctx.Fields = append([]string{field}, fields...) + grbuild := &WebhookGroupBy{build: wq} + grbuild.flds = &wq.ctx.Fields + grbuild.label = webhook.Label + grbuild.scan = grbuild.Scan + return grbuild +} + +// Select allows the selection one or more fields/columns for the given query, +// instead of selecting all fields in the entity. +// +// Example: +// +// var v []struct { +// CreatedAt time.Time `json:"created_at,omitempty"` +// } +// +// client.Webhook.Query(). +// Select(webhook.FieldCreatedAt). +// Scan(ctx, &v) +func (wq *WebhookQuery) Select(fields ...string) *WebhookSelect { + wq.ctx.Fields = append(wq.ctx.Fields, fields...) + sbuild := &WebhookSelect{WebhookQuery: wq} + sbuild.label = webhook.Label + sbuild.flds, sbuild.scan = &wq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a WebhookSelect configured with the given aggregations. +func (wq *WebhookQuery) Aggregate(fns ...AggregateFunc) *WebhookSelect { + return wq.Select().Aggregate(fns...) +} + +func (wq *WebhookQuery) prepareQuery(ctx context.Context) error { + for _, inter := range wq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, wq); err != nil { + return err + } + } + } + for _, f := range wq.ctx.Fields { + if !webhook.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if wq.path != nil { + prev, err := wq.path(ctx) + if err != nil { + return err + } + wq.sql = prev + } + return nil +} + +func (wq *WebhookQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Webhook, error) { + var ( + nodes = []*Webhook{} + _spec = wq.querySpec() + loadedTypes = [3]bool{ + wq.withOwner != nil, + wq.withEvents != nil, + wq.withIntegrations != nil, + } + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*Webhook).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &Webhook{config: wq.config} + nodes = append(nodes, node) + node.Edges.loadedTypes = loadedTypes + return node.assignValues(columns, values) + } + _spec.Node.Schema = wq.schemaConfig.Webhook + ctx = internal.NewSchemaConfigContext(ctx, wq.schemaConfig) + if len(wq.modifiers) > 0 { + _spec.Modifiers = wq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, wq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + if query := wq.withOwner; query != nil { + if err := wq.loadOwner(ctx, query, nodes, nil, + func(n *Webhook, e *Organization) { n.Edges.Owner = e }); err != nil { + return nil, err + } + } + if query := wq.withEvents; query != nil { + if err := wq.loadEvents(ctx, query, nodes, + func(n *Webhook) { n.Edges.Events = []*Event{} }, + func(n *Webhook, e *Event) { n.Edges.Events = append(n.Edges.Events, e) }); err != nil { + return nil, err + } + } + if query := wq.withIntegrations; query != nil { + if err := wq.loadIntegrations(ctx, query, nodes, + func(n *Webhook) { n.Edges.Integrations = []*Integration{} }, + func(n *Webhook, e *Integration) { n.Edges.Integrations = append(n.Edges.Integrations, e) }); err != nil { + return nil, err + } + } + for name, query := range wq.withNamedEvents { + if err := wq.loadEvents(ctx, query, nodes, + func(n *Webhook) { n.appendNamedEvents(name) }, + func(n *Webhook, e *Event) { n.appendNamedEvents(name, e) }); err != nil { + return nil, err + } + } + for name, query := range wq.withNamedIntegrations { + if err := wq.loadIntegrations(ctx, query, nodes, + func(n *Webhook) { n.appendNamedIntegrations(name) }, + func(n *Webhook, e *Integration) { n.appendNamedIntegrations(name, e) }); err != nil { + return nil, err + } + } + for i := range wq.loadTotal { + if err := wq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (wq *WebhookQuery) loadOwner(ctx context.Context, query *OrganizationQuery, nodes []*Webhook, init func(*Webhook), assign func(*Webhook, *Organization)) error { + ids := make([]string, 0, len(nodes)) + nodeids := make(map[string][]*Webhook) + for i := range nodes { + fk := nodes[i].OwnerID + if _, ok := nodeids[fk]; !ok { + ids = append(ids, fk) + } + nodeids[fk] = append(nodeids[fk], nodes[i]) + } + if len(ids) == 0 { + return nil + } + query.Where(organization.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 "owner_id" returned %v`, n.ID) + } + for i := range nodes { + assign(nodes[i], n) + } + } + return nil +} +func (wq *WebhookQuery) loadEvents(ctx context.Context, query *EventQuery, nodes []*Webhook, init func(*Webhook), assign func(*Webhook, *Event)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Webhook) + nids := make(map[string]map[*Webhook]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(webhook.EventsTable) + joinT.Schema(wq.schemaConfig.WebhookEvents) + s.Join(joinT).On(s.C(event.FieldID), joinT.C(webhook.EventsPrimaryKey[1])) + s.Where(sql.InValues(joinT.C(webhook.EventsPrimaryKey[0]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(webhook.EventsPrimaryKey[0])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Webhook]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Event](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "events" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} +func (wq *WebhookQuery) loadIntegrations(ctx context.Context, query *IntegrationQuery, nodes []*Webhook, init func(*Webhook), assign func(*Webhook, *Integration)) error { + edgeIDs := make([]driver.Value, len(nodes)) + byID := make(map[string]*Webhook) + nids := make(map[string]map[*Webhook]struct{}) + for i, node := range nodes { + edgeIDs[i] = node.ID + byID[node.ID] = node + if init != nil { + init(node) + } + } + query.Where(func(s *sql.Selector) { + joinT := sql.Table(webhook.IntegrationsTable) + joinT.Schema(wq.schemaConfig.IntegrationWebhooks) + s.Join(joinT).On(s.C(integration.FieldID), joinT.C(webhook.IntegrationsPrimaryKey[0])) + s.Where(sql.InValues(joinT.C(webhook.IntegrationsPrimaryKey[1]), edgeIDs...)) + columns := s.SelectedColumns() + s.Select(joinT.C(webhook.IntegrationsPrimaryKey[1])) + s.AppendSelect(columns...) + s.SetDistinct(false) + }) + if err := query.prepareQuery(ctx); err != nil { + return err + } + qr := QuerierFunc(func(ctx context.Context, q Query) (Value, error) { + return query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) { + assign := spec.Assign + values := spec.ScanValues + spec.ScanValues = func(columns []string) ([]any, error) { + values, err := values(columns[1:]) + if err != nil { + return nil, err + } + return append([]any{new(sql.NullString)}, values...), nil + } + spec.Assign = func(columns []string, values []any) error { + outValue := values[0].(*sql.NullString).String + inValue := values[1].(*sql.NullString).String + if nids[inValue] == nil { + nids[inValue] = map[*Webhook]struct{}{byID[outValue]: {}} + return assign(columns[1:], values[1:]) + } + nids[inValue][byID[outValue]] = struct{}{} + return nil + } + }) + }) + neighbors, err := withInterceptors[[]*Integration](ctx, query, qr, query.inters) + if err != nil { + return err + } + for _, n := range neighbors { + nodes, ok := nids[n.ID] + if !ok { + return fmt.Errorf(`unexpected "integrations" node returned %v`, n.ID) + } + for kn := range nodes { + assign(kn, n) + } + } + return nil +} + +func (wq *WebhookQuery) sqlCount(ctx context.Context) (int, error) { + _spec := wq.querySpec() + _spec.Node.Schema = wq.schemaConfig.Webhook + ctx = internal.NewSchemaConfigContext(ctx, wq.schemaConfig) + if len(wq.modifiers) > 0 { + _spec.Modifiers = wq.modifiers + } + _spec.Node.Columns = wq.ctx.Fields + if len(wq.ctx.Fields) > 0 { + _spec.Unique = wq.ctx.Unique != nil && *wq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, wq.driver, _spec) +} + +func (wq *WebhookQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(webhook.Table, webhook.Columns, sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString)) + _spec.From = wq.sql + if unique := wq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if wq.path != nil { + _spec.Unique = true + } + if fields := wq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, webhook.FieldID) + for i := range fields { + if fields[i] != webhook.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + if wq.withOwner != nil { + _spec.Node.AddColumnOnce(webhook.FieldOwnerID) + } + } + if ps := wq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := wq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := wq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := wq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (wq *WebhookQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(wq.driver.Dialect()) + t1 := builder.Table(webhook.Table) + columns := wq.ctx.Fields + if len(columns) == 0 { + columns = webhook.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if wq.sql != nil { + selector = wq.sql + selector.Select(selector.Columns(columns...)...) + } + if wq.ctx.Unique != nil && *wq.ctx.Unique { + selector.Distinct() + } + t1.Schema(wq.schemaConfig.Webhook) + ctx = internal.NewSchemaConfigContext(ctx, wq.schemaConfig) + selector.WithContext(ctx) + for _, p := range wq.predicates { + p(selector) + } + for _, p := range wq.order { + p(selector) + } + if offset := wq.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 := wq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WithNamedEvents tells the query-builder to eager-load the nodes that are connected to the "events" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (wq *WebhookQuery) WithNamedEvents(name string, opts ...func(*EventQuery)) *WebhookQuery { + query := (&EventClient{config: wq.config}).Query() + for _, opt := range opts { + opt(query) + } + if wq.withNamedEvents == nil { + wq.withNamedEvents = make(map[string]*EventQuery) + } + wq.withNamedEvents[name] = query + return wq +} + +// WithNamedIntegrations tells the query-builder to eager-load the nodes that are connected to the "integrations" +// edge with the given name. The optional arguments are used to configure the query builder of the edge. +func (wq *WebhookQuery) WithNamedIntegrations(name string, opts ...func(*IntegrationQuery)) *WebhookQuery { + query := (&IntegrationClient{config: wq.config}).Query() + for _, opt := range opts { + opt(query) + } + if wq.withNamedIntegrations == nil { + wq.withNamedIntegrations = make(map[string]*IntegrationQuery) + } + wq.withNamedIntegrations[name] = query + return wq +} + +// WebhookGroupBy is the group-by builder for Webhook entities. +type WebhookGroupBy struct { + selector + build *WebhookQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (wgb *WebhookGroupBy) Aggregate(fns ...AggregateFunc) *WebhookGroupBy { + wgb.fns = append(wgb.fns, fns...) + return wgb +} + +// Scan applies the selector query and scans the result into the given value. +func (wgb *WebhookGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, wgb.build.ctx, ent.OpQueryGroupBy) + if err := wgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*WebhookQuery, *WebhookGroupBy](ctx, wgb.build, wgb, wgb.build.inters, v) +} + +func (wgb *WebhookGroupBy) sqlScan(ctx context.Context, root *WebhookQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(wgb.fns)) + for _, fn := range wgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*wgb.flds)+len(wgb.fns)) + for _, f := range *wgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*wgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := wgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// WebhookSelect is the builder for selecting fields of Webhook entities. +type WebhookSelect struct { + *WebhookQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (ws *WebhookSelect) Aggregate(fns ...AggregateFunc) *WebhookSelect { + ws.fns = append(ws.fns, fns...) + return ws +} + +// Scan applies the selector query and scans the result into the given value. +func (ws *WebhookSelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, ws.ctx, ent.OpQuerySelect) + if err := ws.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*WebhookQuery, *WebhookSelect](ctx, ws.WebhookQuery, ws, ws.inters, v) +} + +func (ws *WebhookSelect) sqlScan(ctx context.Context, root *WebhookQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(ws.fns)) + for _, fn := range ws.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*ws.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 := ws.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/webhook_update.go b/internal/ent/generated/webhook_update.go new file mode 100644 index 0000000..d881d3f --- /dev/null +++ b/internal/ent/generated/webhook_update.go @@ -0,0 +1,1444 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/event" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/webhook" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// WebhookUpdate is the builder for updating Webhook entities. +type WebhookUpdate struct { + config + hooks []Hook + mutation *WebhookMutation +} + +// Where appends a list predicates to the WebhookUpdate builder. +func (wu *WebhookUpdate) Where(ps ...predicate.Webhook) *WebhookUpdate { + wu.mutation.Where(ps...) + return wu +} + +// SetUpdatedAt sets the "updated_at" field. +func (wu *WebhookUpdate) SetUpdatedAt(t time.Time) *WebhookUpdate { + wu.mutation.SetUpdatedAt(t) + return wu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (wu *WebhookUpdate) ClearUpdatedAt() *WebhookUpdate { + wu.mutation.ClearUpdatedAt() + return wu +} + +// SetUpdatedBy sets the "updated_by" field. +func (wu *WebhookUpdate) SetUpdatedBy(s string) *WebhookUpdate { + wu.mutation.SetUpdatedBy(s) + return wu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableUpdatedBy(s *string) *WebhookUpdate { + if s != nil { + wu.SetUpdatedBy(*s) + } + return wu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (wu *WebhookUpdate) ClearUpdatedBy() *WebhookUpdate { + wu.mutation.ClearUpdatedBy() + return wu +} + +// SetTags sets the "tags" field. +func (wu *WebhookUpdate) SetTags(s []string) *WebhookUpdate { + wu.mutation.SetTags(s) + return wu +} + +// AppendTags appends s to the "tags" field. +func (wu *WebhookUpdate) AppendTags(s []string) *WebhookUpdate { + wu.mutation.AppendTags(s) + return wu +} + +// ClearTags clears the value of the "tags" field. +func (wu *WebhookUpdate) ClearTags() *WebhookUpdate { + wu.mutation.ClearTags() + return wu +} + +// SetDeletedAt sets the "deleted_at" field. +func (wu *WebhookUpdate) SetDeletedAt(t time.Time) *WebhookUpdate { + wu.mutation.SetDeletedAt(t) + return wu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableDeletedAt(t *time.Time) *WebhookUpdate { + if t != nil { + wu.SetDeletedAt(*t) + } + return wu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (wu *WebhookUpdate) ClearDeletedAt() *WebhookUpdate { + wu.mutation.ClearDeletedAt() + return wu +} + +// SetDeletedBy sets the "deleted_by" field. +func (wu *WebhookUpdate) SetDeletedBy(s string) *WebhookUpdate { + wu.mutation.SetDeletedBy(s) + return wu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableDeletedBy(s *string) *WebhookUpdate { + if s != nil { + wu.SetDeletedBy(*s) + } + return wu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (wu *WebhookUpdate) ClearDeletedBy() *WebhookUpdate { + wu.mutation.ClearDeletedBy() + return wu +} + +// SetOwnerID sets the "owner_id" field. +func (wu *WebhookUpdate) SetOwnerID(s string) *WebhookUpdate { + wu.mutation.SetOwnerID(s) + return wu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableOwnerID(s *string) *WebhookUpdate { + if s != nil { + wu.SetOwnerID(*s) + } + return wu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (wu *WebhookUpdate) ClearOwnerID() *WebhookUpdate { + wu.mutation.ClearOwnerID() + return wu +} + +// SetName sets the "name" field. +func (wu *WebhookUpdate) SetName(s string) *WebhookUpdate { + wu.mutation.SetName(s) + return wu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableName(s *string) *WebhookUpdate { + if s != nil { + wu.SetName(*s) + } + return wu +} + +// SetDescription sets the "description" field. +func (wu *WebhookUpdate) SetDescription(s string) *WebhookUpdate { + wu.mutation.SetDescription(s) + return wu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableDescription(s *string) *WebhookUpdate { + if s != nil { + wu.SetDescription(*s) + } + return wu +} + +// ClearDescription clears the value of the "description" field. +func (wu *WebhookUpdate) ClearDescription() *WebhookUpdate { + wu.mutation.ClearDescription() + return wu +} + +// SetDestinationURL sets the "destination_url" field. +func (wu *WebhookUpdate) SetDestinationURL(s string) *WebhookUpdate { + wu.mutation.SetDestinationURL(s) + return wu +} + +// SetNillableDestinationURL sets the "destination_url" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableDestinationURL(s *string) *WebhookUpdate { + if s != nil { + wu.SetDestinationURL(*s) + } + return wu +} + +// SetEnabled sets the "enabled" field. +func (wu *WebhookUpdate) SetEnabled(b bool) *WebhookUpdate { + wu.mutation.SetEnabled(b) + return wu +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableEnabled(b *bool) *WebhookUpdate { + if b != nil { + wu.SetEnabled(*b) + } + return wu +} + +// SetCallback sets the "callback" field. +func (wu *WebhookUpdate) SetCallback(s string) *WebhookUpdate { + wu.mutation.SetCallback(s) + return wu +} + +// SetNillableCallback sets the "callback" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableCallback(s *string) *WebhookUpdate { + if s != nil { + wu.SetCallback(*s) + } + return wu +} + +// ClearCallback clears the value of the "callback" field. +func (wu *WebhookUpdate) ClearCallback() *WebhookUpdate { + wu.mutation.ClearCallback() + return wu +} + +// SetExpiresAt sets the "expires_at" field. +func (wu *WebhookUpdate) SetExpiresAt(t time.Time) *WebhookUpdate { + wu.mutation.SetExpiresAt(t) + return wu +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableExpiresAt(t *time.Time) *WebhookUpdate { + if t != nil { + wu.SetExpiresAt(*t) + } + return wu +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (wu *WebhookUpdate) ClearExpiresAt() *WebhookUpdate { + wu.mutation.ClearExpiresAt() + return wu +} + +// SetSecret sets the "secret" field. +func (wu *WebhookUpdate) SetSecret(b []byte) *WebhookUpdate { + wu.mutation.SetSecret(b) + return wu +} + +// ClearSecret clears the value of the "secret" field. +func (wu *WebhookUpdate) ClearSecret() *WebhookUpdate { + wu.mutation.ClearSecret() + return wu +} + +// SetFailures sets the "failures" field. +func (wu *WebhookUpdate) SetFailures(i int) *WebhookUpdate { + wu.mutation.ResetFailures() + wu.mutation.SetFailures(i) + return wu +} + +// SetNillableFailures sets the "failures" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableFailures(i *int) *WebhookUpdate { + if i != nil { + wu.SetFailures(*i) + } + return wu +} + +// AddFailures adds i to the "failures" field. +func (wu *WebhookUpdate) AddFailures(i int) *WebhookUpdate { + wu.mutation.AddFailures(i) + return wu +} + +// ClearFailures clears the value of the "failures" field. +func (wu *WebhookUpdate) ClearFailures() *WebhookUpdate { + wu.mutation.ClearFailures() + return wu +} + +// SetLastError sets the "last_error" field. +func (wu *WebhookUpdate) SetLastError(s string) *WebhookUpdate { + wu.mutation.SetLastError(s) + return wu +} + +// SetNillableLastError sets the "last_error" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableLastError(s *string) *WebhookUpdate { + if s != nil { + wu.SetLastError(*s) + } + return wu +} + +// ClearLastError clears the value of the "last_error" field. +func (wu *WebhookUpdate) ClearLastError() *WebhookUpdate { + wu.mutation.ClearLastError() + return wu +} + +// SetLastResponse sets the "last_response" field. +func (wu *WebhookUpdate) SetLastResponse(s string) *WebhookUpdate { + wu.mutation.SetLastResponse(s) + return wu +} + +// SetNillableLastResponse sets the "last_response" field if the given value is not nil. +func (wu *WebhookUpdate) SetNillableLastResponse(s *string) *WebhookUpdate { + if s != nil { + wu.SetLastResponse(*s) + } + return wu +} + +// ClearLastResponse clears the value of the "last_response" field. +func (wu *WebhookUpdate) ClearLastResponse() *WebhookUpdate { + wu.mutation.ClearLastResponse() + return wu +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (wu *WebhookUpdate) SetOwner(o *Organization) *WebhookUpdate { + return wu.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (wu *WebhookUpdate) AddEventIDs(ids ...string) *WebhookUpdate { + wu.mutation.AddEventIDs(ids...) + return wu +} + +// AddEvents adds the "events" edges to the Event entity. +func (wu *WebhookUpdate) AddEvents(e ...*Event) *WebhookUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return wu.AddEventIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (wu *WebhookUpdate) AddIntegrationIDs(ids ...string) *WebhookUpdate { + wu.mutation.AddIntegrationIDs(ids...) + return wu +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (wu *WebhookUpdate) AddIntegrations(i ...*Integration) *WebhookUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return wu.AddIntegrationIDs(ids...) +} + +// Mutation returns the WebhookMutation object of the builder. +func (wu *WebhookUpdate) Mutation() *WebhookMutation { + return wu.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (wu *WebhookUpdate) ClearOwner() *WebhookUpdate { + wu.mutation.ClearOwner() + return wu +} + +// ClearEvents clears all "events" edges to the Event entity. +func (wu *WebhookUpdate) ClearEvents() *WebhookUpdate { + wu.mutation.ClearEvents() + return wu +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (wu *WebhookUpdate) RemoveEventIDs(ids ...string) *WebhookUpdate { + wu.mutation.RemoveEventIDs(ids...) + return wu +} + +// RemoveEvents removes "events" edges to Event entities. +func (wu *WebhookUpdate) RemoveEvents(e ...*Event) *WebhookUpdate { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return wu.RemoveEventIDs(ids...) +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (wu *WebhookUpdate) ClearIntegrations() *WebhookUpdate { + wu.mutation.ClearIntegrations() + return wu +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (wu *WebhookUpdate) RemoveIntegrationIDs(ids ...string) *WebhookUpdate { + wu.mutation.RemoveIntegrationIDs(ids...) + return wu +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (wu *WebhookUpdate) RemoveIntegrations(i ...*Integration) *WebhookUpdate { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return wu.RemoveIntegrationIDs(ids...) +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (wu *WebhookUpdate) Save(ctx context.Context) (int, error) { + if err := wu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, wu.sqlSave, wu.mutation, wu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (wu *WebhookUpdate) SaveX(ctx context.Context) int { + affected, err := wu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (wu *WebhookUpdate) Exec(ctx context.Context) error { + _, err := wu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wu *WebhookUpdate) ExecX(ctx context.Context) { + if err := wu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (wu *WebhookUpdate) defaults() error { + if _, ok := wu.mutation.UpdatedAt(); !ok && !wu.mutation.UpdatedAtCleared() { + if webhook.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webhook.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webhook.UpdateDefaultUpdatedAt() + wu.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (wu *WebhookUpdate) check() error { + if v, ok := wu.mutation.Name(); ok { + if err := webhook.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Webhook.name": %w`, err)} + } + } + if v, ok := wu.mutation.DestinationURL(); ok { + if err := webhook.DestinationURLValidator(v); err != nil { + return &ValidationError{Name: "destination_url", err: fmt.Errorf(`generated: validator failed for field "Webhook.destination_url": %w`, err)} + } + } + return nil +} + +func (wu *WebhookUpdate) sqlSave(ctx context.Context) (n int, err error) { + if err := wu.check(); err != nil { + return n, err + } + _spec := sqlgraph.NewUpdateSpec(webhook.Table, webhook.Columns, sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString)) + if ps := wu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if wu.mutation.CreatedAtCleared() { + _spec.ClearField(webhook.FieldCreatedAt, field.TypeTime) + } + if value, ok := wu.mutation.UpdatedAt(); ok { + _spec.SetField(webhook.FieldUpdatedAt, field.TypeTime, value) + } + if wu.mutation.UpdatedAtCleared() { + _spec.ClearField(webhook.FieldUpdatedAt, field.TypeTime) + } + if wu.mutation.CreatedByCleared() { + _spec.ClearField(webhook.FieldCreatedBy, field.TypeString) + } + if value, ok := wu.mutation.UpdatedBy(); ok { + _spec.SetField(webhook.FieldUpdatedBy, field.TypeString, value) + } + if wu.mutation.UpdatedByCleared() { + _spec.ClearField(webhook.FieldUpdatedBy, field.TypeString) + } + if value, ok := wu.mutation.Tags(); ok { + _spec.SetField(webhook.FieldTags, field.TypeJSON, value) + } + if value, ok := wu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webhook.FieldTags, value) + }) + } + if wu.mutation.TagsCleared() { + _spec.ClearField(webhook.FieldTags, field.TypeJSON) + } + if value, ok := wu.mutation.DeletedAt(); ok { + _spec.SetField(webhook.FieldDeletedAt, field.TypeTime, value) + } + if wu.mutation.DeletedAtCleared() { + _spec.ClearField(webhook.FieldDeletedAt, field.TypeTime) + } + if value, ok := wu.mutation.DeletedBy(); ok { + _spec.SetField(webhook.FieldDeletedBy, field.TypeString, value) + } + if wu.mutation.DeletedByCleared() { + _spec.ClearField(webhook.FieldDeletedBy, field.TypeString) + } + if value, ok := wu.mutation.Name(); ok { + _spec.SetField(webhook.FieldName, field.TypeString, value) + } + if value, ok := wu.mutation.Description(); ok { + _spec.SetField(webhook.FieldDescription, field.TypeString, value) + } + if wu.mutation.DescriptionCleared() { + _spec.ClearField(webhook.FieldDescription, field.TypeString) + } + if value, ok := wu.mutation.DestinationURL(); ok { + _spec.SetField(webhook.FieldDestinationURL, field.TypeString, value) + } + if value, ok := wu.mutation.Enabled(); ok { + _spec.SetField(webhook.FieldEnabled, field.TypeBool, value) + } + if value, ok := wu.mutation.Callback(); ok { + _spec.SetField(webhook.FieldCallback, field.TypeString, value) + } + if wu.mutation.CallbackCleared() { + _spec.ClearField(webhook.FieldCallback, field.TypeString) + } + if value, ok := wu.mutation.ExpiresAt(); ok { + _spec.SetField(webhook.FieldExpiresAt, field.TypeTime, value) + } + if wu.mutation.ExpiresAtCleared() { + _spec.ClearField(webhook.FieldExpiresAt, field.TypeTime) + } + if value, ok := wu.mutation.Secret(); ok { + _spec.SetField(webhook.FieldSecret, field.TypeBytes, value) + } + if wu.mutation.SecretCleared() { + _spec.ClearField(webhook.FieldSecret, field.TypeBytes) + } + if value, ok := wu.mutation.Failures(); ok { + _spec.SetField(webhook.FieldFailures, field.TypeInt, value) + } + if value, ok := wu.mutation.AddedFailures(); ok { + _spec.AddField(webhook.FieldFailures, field.TypeInt, value) + } + if wu.mutation.FailuresCleared() { + _spec.ClearField(webhook.FieldFailures, field.TypeInt) + } + if value, ok := wu.mutation.LastError(); ok { + _spec.SetField(webhook.FieldLastError, field.TypeString, value) + } + if wu.mutation.LastErrorCleared() { + _spec.ClearField(webhook.FieldLastError, field.TypeString) + } + if value, ok := wu.mutation.LastResponse(); ok { + _spec.SetField(webhook.FieldLastResponse, field.TypeString, value) + } + if wu.mutation.LastResponseCleared() { + _spec.ClearField(webhook.FieldLastResponse, field.TypeString) + } + if wu.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webhook.OwnerTable, + Columns: []string{webhook.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.Webhook + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wu.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webhook.OwnerTable, + Columns: []string{webhook.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if wu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.WebhookEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wu.mutation.RemovedEventsIDs(); len(nodes) > 0 && !wu.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wu.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if wu.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.IntegrationWebhooks + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wu.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !wu.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wu.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = wu.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = wu.schemaConfig.Webhook + ctx = internal.NewSchemaConfigContext(ctx, wu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, wu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{webhook.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + wu.mutation.done = true + return n, nil +} + +// WebhookUpdateOne is the builder for updating a single Webhook entity. +type WebhookUpdateOne struct { + config + fields []string + hooks []Hook + mutation *WebhookMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (wuo *WebhookUpdateOne) SetUpdatedAt(t time.Time) *WebhookUpdateOne { + wuo.mutation.SetUpdatedAt(t) + return wuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (wuo *WebhookUpdateOne) ClearUpdatedAt() *WebhookUpdateOne { + wuo.mutation.ClearUpdatedAt() + return wuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (wuo *WebhookUpdateOne) SetUpdatedBy(s string) *WebhookUpdateOne { + wuo.mutation.SetUpdatedBy(s) + return wuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableUpdatedBy(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetUpdatedBy(*s) + } + return wuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (wuo *WebhookUpdateOne) ClearUpdatedBy() *WebhookUpdateOne { + wuo.mutation.ClearUpdatedBy() + return wuo +} + +// SetTags sets the "tags" field. +func (wuo *WebhookUpdateOne) SetTags(s []string) *WebhookUpdateOne { + wuo.mutation.SetTags(s) + return wuo +} + +// AppendTags appends s to the "tags" field. +func (wuo *WebhookUpdateOne) AppendTags(s []string) *WebhookUpdateOne { + wuo.mutation.AppendTags(s) + return wuo +} + +// ClearTags clears the value of the "tags" field. +func (wuo *WebhookUpdateOne) ClearTags() *WebhookUpdateOne { + wuo.mutation.ClearTags() + return wuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (wuo *WebhookUpdateOne) SetDeletedAt(t time.Time) *WebhookUpdateOne { + wuo.mutation.SetDeletedAt(t) + return wuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableDeletedAt(t *time.Time) *WebhookUpdateOne { + if t != nil { + wuo.SetDeletedAt(*t) + } + return wuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (wuo *WebhookUpdateOne) ClearDeletedAt() *WebhookUpdateOne { + wuo.mutation.ClearDeletedAt() + return wuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (wuo *WebhookUpdateOne) SetDeletedBy(s string) *WebhookUpdateOne { + wuo.mutation.SetDeletedBy(s) + return wuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableDeletedBy(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetDeletedBy(*s) + } + return wuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (wuo *WebhookUpdateOne) ClearDeletedBy() *WebhookUpdateOne { + wuo.mutation.ClearDeletedBy() + return wuo +} + +// SetOwnerID sets the "owner_id" field. +func (wuo *WebhookUpdateOne) SetOwnerID(s string) *WebhookUpdateOne { + wuo.mutation.SetOwnerID(s) + return wuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableOwnerID(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetOwnerID(*s) + } + return wuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (wuo *WebhookUpdateOne) ClearOwnerID() *WebhookUpdateOne { + wuo.mutation.ClearOwnerID() + return wuo +} + +// SetName sets the "name" field. +func (wuo *WebhookUpdateOne) SetName(s string) *WebhookUpdateOne { + wuo.mutation.SetName(s) + return wuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableName(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetName(*s) + } + return wuo +} + +// SetDescription sets the "description" field. +func (wuo *WebhookUpdateOne) SetDescription(s string) *WebhookUpdateOne { + wuo.mutation.SetDescription(s) + return wuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableDescription(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetDescription(*s) + } + return wuo +} + +// ClearDescription clears the value of the "description" field. +func (wuo *WebhookUpdateOne) ClearDescription() *WebhookUpdateOne { + wuo.mutation.ClearDescription() + return wuo +} + +// SetDestinationURL sets the "destination_url" field. +func (wuo *WebhookUpdateOne) SetDestinationURL(s string) *WebhookUpdateOne { + wuo.mutation.SetDestinationURL(s) + return wuo +} + +// SetNillableDestinationURL sets the "destination_url" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableDestinationURL(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetDestinationURL(*s) + } + return wuo +} + +// SetEnabled sets the "enabled" field. +func (wuo *WebhookUpdateOne) SetEnabled(b bool) *WebhookUpdateOne { + wuo.mutation.SetEnabled(b) + return wuo +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableEnabled(b *bool) *WebhookUpdateOne { + if b != nil { + wuo.SetEnabled(*b) + } + return wuo +} + +// SetCallback sets the "callback" field. +func (wuo *WebhookUpdateOne) SetCallback(s string) *WebhookUpdateOne { + wuo.mutation.SetCallback(s) + return wuo +} + +// SetNillableCallback sets the "callback" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableCallback(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetCallback(*s) + } + return wuo +} + +// ClearCallback clears the value of the "callback" field. +func (wuo *WebhookUpdateOne) ClearCallback() *WebhookUpdateOne { + wuo.mutation.ClearCallback() + return wuo +} + +// SetExpiresAt sets the "expires_at" field. +func (wuo *WebhookUpdateOne) SetExpiresAt(t time.Time) *WebhookUpdateOne { + wuo.mutation.SetExpiresAt(t) + return wuo +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableExpiresAt(t *time.Time) *WebhookUpdateOne { + if t != nil { + wuo.SetExpiresAt(*t) + } + return wuo +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (wuo *WebhookUpdateOne) ClearExpiresAt() *WebhookUpdateOne { + wuo.mutation.ClearExpiresAt() + return wuo +} + +// SetSecret sets the "secret" field. +func (wuo *WebhookUpdateOne) SetSecret(b []byte) *WebhookUpdateOne { + wuo.mutation.SetSecret(b) + return wuo +} + +// ClearSecret clears the value of the "secret" field. +func (wuo *WebhookUpdateOne) ClearSecret() *WebhookUpdateOne { + wuo.mutation.ClearSecret() + return wuo +} + +// SetFailures sets the "failures" field. +func (wuo *WebhookUpdateOne) SetFailures(i int) *WebhookUpdateOne { + wuo.mutation.ResetFailures() + wuo.mutation.SetFailures(i) + return wuo +} + +// SetNillableFailures sets the "failures" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableFailures(i *int) *WebhookUpdateOne { + if i != nil { + wuo.SetFailures(*i) + } + return wuo +} + +// AddFailures adds i to the "failures" field. +func (wuo *WebhookUpdateOne) AddFailures(i int) *WebhookUpdateOne { + wuo.mutation.AddFailures(i) + return wuo +} + +// ClearFailures clears the value of the "failures" field. +func (wuo *WebhookUpdateOne) ClearFailures() *WebhookUpdateOne { + wuo.mutation.ClearFailures() + return wuo +} + +// SetLastError sets the "last_error" field. +func (wuo *WebhookUpdateOne) SetLastError(s string) *WebhookUpdateOne { + wuo.mutation.SetLastError(s) + return wuo +} + +// SetNillableLastError sets the "last_error" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableLastError(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetLastError(*s) + } + return wuo +} + +// ClearLastError clears the value of the "last_error" field. +func (wuo *WebhookUpdateOne) ClearLastError() *WebhookUpdateOne { + wuo.mutation.ClearLastError() + return wuo +} + +// SetLastResponse sets the "last_response" field. +func (wuo *WebhookUpdateOne) SetLastResponse(s string) *WebhookUpdateOne { + wuo.mutation.SetLastResponse(s) + return wuo +} + +// SetNillableLastResponse sets the "last_response" field if the given value is not nil. +func (wuo *WebhookUpdateOne) SetNillableLastResponse(s *string) *WebhookUpdateOne { + if s != nil { + wuo.SetLastResponse(*s) + } + return wuo +} + +// ClearLastResponse clears the value of the "last_response" field. +func (wuo *WebhookUpdateOne) ClearLastResponse() *WebhookUpdateOne { + wuo.mutation.ClearLastResponse() + return wuo +} + +// SetOwner sets the "owner" edge to the Organization entity. +func (wuo *WebhookUpdateOne) SetOwner(o *Organization) *WebhookUpdateOne { + return wuo.SetOwnerID(o.ID) +} + +// AddEventIDs adds the "events" edge to the Event entity by IDs. +func (wuo *WebhookUpdateOne) AddEventIDs(ids ...string) *WebhookUpdateOne { + wuo.mutation.AddEventIDs(ids...) + return wuo +} + +// AddEvents adds the "events" edges to the Event entity. +func (wuo *WebhookUpdateOne) AddEvents(e ...*Event) *WebhookUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return wuo.AddEventIDs(ids...) +} + +// AddIntegrationIDs adds the "integrations" edge to the Integration entity by IDs. +func (wuo *WebhookUpdateOne) AddIntegrationIDs(ids ...string) *WebhookUpdateOne { + wuo.mutation.AddIntegrationIDs(ids...) + return wuo +} + +// AddIntegrations adds the "integrations" edges to the Integration entity. +func (wuo *WebhookUpdateOne) AddIntegrations(i ...*Integration) *WebhookUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return wuo.AddIntegrationIDs(ids...) +} + +// Mutation returns the WebhookMutation object of the builder. +func (wuo *WebhookUpdateOne) Mutation() *WebhookMutation { + return wuo.mutation +} + +// ClearOwner clears the "owner" edge to the Organization entity. +func (wuo *WebhookUpdateOne) ClearOwner() *WebhookUpdateOne { + wuo.mutation.ClearOwner() + return wuo +} + +// ClearEvents clears all "events" edges to the Event entity. +func (wuo *WebhookUpdateOne) ClearEvents() *WebhookUpdateOne { + wuo.mutation.ClearEvents() + return wuo +} + +// RemoveEventIDs removes the "events" edge to Event entities by IDs. +func (wuo *WebhookUpdateOne) RemoveEventIDs(ids ...string) *WebhookUpdateOne { + wuo.mutation.RemoveEventIDs(ids...) + return wuo +} + +// RemoveEvents removes "events" edges to Event entities. +func (wuo *WebhookUpdateOne) RemoveEvents(e ...*Event) *WebhookUpdateOne { + ids := make([]string, len(e)) + for i := range e { + ids[i] = e[i].ID + } + return wuo.RemoveEventIDs(ids...) +} + +// ClearIntegrations clears all "integrations" edges to the Integration entity. +func (wuo *WebhookUpdateOne) ClearIntegrations() *WebhookUpdateOne { + wuo.mutation.ClearIntegrations() + return wuo +} + +// RemoveIntegrationIDs removes the "integrations" edge to Integration entities by IDs. +func (wuo *WebhookUpdateOne) RemoveIntegrationIDs(ids ...string) *WebhookUpdateOne { + wuo.mutation.RemoveIntegrationIDs(ids...) + return wuo +} + +// RemoveIntegrations removes "integrations" edges to Integration entities. +func (wuo *WebhookUpdateOne) RemoveIntegrations(i ...*Integration) *WebhookUpdateOne { + ids := make([]string, len(i)) + for j := range i { + ids[j] = i[j].ID + } + return wuo.RemoveIntegrationIDs(ids...) +} + +// Where appends a list predicates to the WebhookUpdate builder. +func (wuo *WebhookUpdateOne) Where(ps ...predicate.Webhook) *WebhookUpdateOne { + wuo.mutation.Where(ps...) + return wuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (wuo *WebhookUpdateOne) Select(field string, fields ...string) *WebhookUpdateOne { + wuo.fields = append([]string{field}, fields...) + return wuo +} + +// Save executes the query and returns the updated Webhook entity. +func (wuo *WebhookUpdateOne) Save(ctx context.Context) (*Webhook, error) { + if err := wuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, wuo.sqlSave, wuo.mutation, wuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (wuo *WebhookUpdateOne) SaveX(ctx context.Context) *Webhook { + node, err := wuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (wuo *WebhookUpdateOne) Exec(ctx context.Context) error { + _, err := wuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (wuo *WebhookUpdateOne) ExecX(ctx context.Context) { + if err := wuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (wuo *WebhookUpdateOne) defaults() error { + if _, ok := wuo.mutation.UpdatedAt(); !ok && !wuo.mutation.UpdatedAtCleared() { + if webhook.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webhook.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webhook.UpdateDefaultUpdatedAt() + wuo.mutation.SetUpdatedAt(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (wuo *WebhookUpdateOne) check() error { + if v, ok := wuo.mutation.Name(); ok { + if err := webhook.NameValidator(v); err != nil { + return &ValidationError{Name: "name", err: fmt.Errorf(`generated: validator failed for field "Webhook.name": %w`, err)} + } + } + if v, ok := wuo.mutation.DestinationURL(); ok { + if err := webhook.DestinationURLValidator(v); err != nil { + return &ValidationError{Name: "destination_url", err: fmt.Errorf(`generated: validator failed for field "Webhook.destination_url": %w`, err)} + } + } + return nil +} + +func (wuo *WebhookUpdateOne) sqlSave(ctx context.Context) (_node *Webhook, err error) { + if err := wuo.check(); err != nil { + return _node, err + } + _spec := sqlgraph.NewUpdateSpec(webhook.Table, webhook.Columns, sqlgraph.NewFieldSpec(webhook.FieldID, field.TypeString)) + id, ok := wuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "Webhook.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := wuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, webhook.FieldID) + for _, f := range fields { + if !webhook.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != webhook.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := wuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if wuo.mutation.CreatedAtCleared() { + _spec.ClearField(webhook.FieldCreatedAt, field.TypeTime) + } + if value, ok := wuo.mutation.UpdatedAt(); ok { + _spec.SetField(webhook.FieldUpdatedAt, field.TypeTime, value) + } + if wuo.mutation.UpdatedAtCleared() { + _spec.ClearField(webhook.FieldUpdatedAt, field.TypeTime) + } + if wuo.mutation.CreatedByCleared() { + _spec.ClearField(webhook.FieldCreatedBy, field.TypeString) + } + if value, ok := wuo.mutation.UpdatedBy(); ok { + _spec.SetField(webhook.FieldUpdatedBy, field.TypeString, value) + } + if wuo.mutation.UpdatedByCleared() { + _spec.ClearField(webhook.FieldUpdatedBy, field.TypeString) + } + if value, ok := wuo.mutation.Tags(); ok { + _spec.SetField(webhook.FieldTags, field.TypeJSON, value) + } + if value, ok := wuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webhook.FieldTags, value) + }) + } + if wuo.mutation.TagsCleared() { + _spec.ClearField(webhook.FieldTags, field.TypeJSON) + } + if value, ok := wuo.mutation.DeletedAt(); ok { + _spec.SetField(webhook.FieldDeletedAt, field.TypeTime, value) + } + if wuo.mutation.DeletedAtCleared() { + _spec.ClearField(webhook.FieldDeletedAt, field.TypeTime) + } + if value, ok := wuo.mutation.DeletedBy(); ok { + _spec.SetField(webhook.FieldDeletedBy, field.TypeString, value) + } + if wuo.mutation.DeletedByCleared() { + _spec.ClearField(webhook.FieldDeletedBy, field.TypeString) + } + if value, ok := wuo.mutation.Name(); ok { + _spec.SetField(webhook.FieldName, field.TypeString, value) + } + if value, ok := wuo.mutation.Description(); ok { + _spec.SetField(webhook.FieldDescription, field.TypeString, value) + } + if wuo.mutation.DescriptionCleared() { + _spec.ClearField(webhook.FieldDescription, field.TypeString) + } + if value, ok := wuo.mutation.DestinationURL(); ok { + _spec.SetField(webhook.FieldDestinationURL, field.TypeString, value) + } + if value, ok := wuo.mutation.Enabled(); ok { + _spec.SetField(webhook.FieldEnabled, field.TypeBool, value) + } + if value, ok := wuo.mutation.Callback(); ok { + _spec.SetField(webhook.FieldCallback, field.TypeString, value) + } + if wuo.mutation.CallbackCleared() { + _spec.ClearField(webhook.FieldCallback, field.TypeString) + } + if value, ok := wuo.mutation.ExpiresAt(); ok { + _spec.SetField(webhook.FieldExpiresAt, field.TypeTime, value) + } + if wuo.mutation.ExpiresAtCleared() { + _spec.ClearField(webhook.FieldExpiresAt, field.TypeTime) + } + if value, ok := wuo.mutation.Secret(); ok { + _spec.SetField(webhook.FieldSecret, field.TypeBytes, value) + } + if wuo.mutation.SecretCleared() { + _spec.ClearField(webhook.FieldSecret, field.TypeBytes) + } + if value, ok := wuo.mutation.Failures(); ok { + _spec.SetField(webhook.FieldFailures, field.TypeInt, value) + } + if value, ok := wuo.mutation.AddedFailures(); ok { + _spec.AddField(webhook.FieldFailures, field.TypeInt, value) + } + if wuo.mutation.FailuresCleared() { + _spec.ClearField(webhook.FieldFailures, field.TypeInt) + } + if value, ok := wuo.mutation.LastError(); ok { + _spec.SetField(webhook.FieldLastError, field.TypeString, value) + } + if wuo.mutation.LastErrorCleared() { + _spec.ClearField(webhook.FieldLastError, field.TypeString) + } + if value, ok := wuo.mutation.LastResponse(); ok { + _spec.SetField(webhook.FieldLastResponse, field.TypeString, value) + } + if wuo.mutation.LastResponseCleared() { + _spec.ClearField(webhook.FieldLastResponse, field.TypeString) + } + if wuo.mutation.OwnerCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webhook.OwnerTable, + Columns: []string{webhook.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.Webhook + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wuo.mutation.OwnerIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2O, + Inverse: true, + Table: webhook.OwnerTable, + Columns: []string{webhook.OwnerColumn}, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(organization.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.Webhook + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if wuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.WebhookEvents + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wuo.mutation.RemovedEventsIDs(); len(nodes) > 0 && !wuo.mutation.EventsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wuo.mutation.EventsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: false, + Table: webhook.EventsTable, + Columns: webhook.EventsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(event.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.WebhookEvents + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + if wuo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.IntegrationWebhooks + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wuo.mutation.RemovedIntegrationsIDs(); len(nodes) > 0 && !wuo.mutation.IntegrationsCleared() { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Clear = append(_spec.Edges.Clear, edge) + } + if nodes := wuo.mutation.IntegrationsIDs(); len(nodes) > 0 { + edge := &sqlgraph.EdgeSpec{ + Rel: sqlgraph.M2M, + Inverse: true, + Table: webhook.IntegrationsTable, + Columns: webhook.IntegrationsPrimaryKey, + Bidi: false, + Target: &sqlgraph.EdgeTarget{ + IDSpec: sqlgraph.NewFieldSpec(integration.FieldID, field.TypeString), + }, + } + edge.Schema = wuo.schemaConfig.IntegrationWebhooks + for _, k := range nodes { + edge.Target.Nodes = append(edge.Target.Nodes, k) + } + _spec.Edges.Add = append(_spec.Edges.Add, edge) + } + _spec.Node.Schema = wuo.schemaConfig.Webhook + ctx = internal.NewSchemaConfigContext(ctx, wuo.schemaConfig) + _node = &Webhook{config: wuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, wuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{webhook.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + wuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/generated/webhookhistory.go b/internal/ent/generated/webhookhistory.go new file mode 100644 index 0000000..c50e67e --- /dev/null +++ b/internal/ent/generated/webhookhistory.go @@ -0,0 +1,347 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "encoding/json" + "fmt" + "strings" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/theopenlane/entx/history" +) + +// WebhookHistory is the model entity for the WebhookHistory schema. +type WebhookHistory struct { + config `json:"-"` + // ID of the ent. + ID string `json:"id,omitempty"` + // HistoryTime holds the value of the "history_time" field. + HistoryTime time.Time `json:"history_time,omitempty"` + // Ref holds the value of the "ref" field. + Ref string `json:"ref,omitempty"` + // Operation holds the value of the "operation" field. + Operation history.OpType `json:"operation,omitempty"` + // CreatedAt holds the value of the "created_at" field. + CreatedAt time.Time `json:"created_at,omitempty"` + // UpdatedAt holds the value of the "updated_at" field. + UpdatedAt time.Time `json:"updated_at,omitempty"` + // CreatedBy holds the value of the "created_by" field. + CreatedBy string `json:"created_by,omitempty"` + // UpdatedBy holds the value of the "updated_by" field. + UpdatedBy string `json:"updated_by,omitempty"` + // MappingID holds the value of the "mapping_id" field. + MappingID string `json:"mapping_id,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // DeletedAt holds the value of the "deleted_at" field. + DeletedAt time.Time `json:"deleted_at,omitempty"` + // DeletedBy holds the value of the "deleted_by" field. + DeletedBy string `json:"deleted_by,omitempty"` + // The organization id that owns the object + OwnerID string `json:"owner_id,omitempty"` + // the name of the webhook + Name string `json:"name,omitempty"` + // a description of the webhook + Description string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destination_url,omitempty"` + // indicates if the webhook is active and enabled + Enabled bool `json:"enabled,omitempty"` + // the call back string + Callback string `json:"callback,omitempty"` + // the ttl of the webhook delivery + ExpiresAt time.Time `json:"expires_at,omitempty"` + // the comparison secret to verify the token's signature + Secret []byte `json:"secret,omitempty"` + // the number of failures + Failures int `json:"failures,omitempty"` + // the last error message + LastError string `json:"last_error,omitempty"` + // the last response + LastResponse string `json:"last_response,omitempty"` + selectValues sql.SelectValues +} + +// scanValues returns the types for scanning values from sql.Rows. +func (*WebhookHistory) scanValues(columns []string) ([]any, error) { + values := make([]any, len(columns)) + for i := range columns { + switch columns[i] { + case webhookhistory.FieldTags, webhookhistory.FieldSecret: + values[i] = new([]byte) + case webhookhistory.FieldOperation: + values[i] = new(history.OpType) + case webhookhistory.FieldEnabled: + values[i] = new(sql.NullBool) + case webhookhistory.FieldFailures: + values[i] = new(sql.NullInt64) + case webhookhistory.FieldID, webhookhistory.FieldRef, webhookhistory.FieldCreatedBy, webhookhistory.FieldUpdatedBy, webhookhistory.FieldMappingID, webhookhistory.FieldDeletedBy, webhookhistory.FieldOwnerID, webhookhistory.FieldName, webhookhistory.FieldDescription, webhookhistory.FieldDestinationURL, webhookhistory.FieldCallback, webhookhistory.FieldLastError, webhookhistory.FieldLastResponse: + values[i] = new(sql.NullString) + case webhookhistory.FieldHistoryTime, webhookhistory.FieldCreatedAt, webhookhistory.FieldUpdatedAt, webhookhistory.FieldDeletedAt, webhookhistory.FieldExpiresAt: + values[i] = new(sql.NullTime) + default: + values[i] = new(sql.UnknownType) + } + } + return values, nil +} + +// assignValues assigns the values that were returned from sql.Rows (after scanning) +// to the WebhookHistory fields. +func (wh *WebhookHistory) 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 webhookhistory.FieldID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field id", values[i]) + } else if value.Valid { + wh.ID = value.String + } + case webhookhistory.FieldHistoryTime: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field history_time", values[i]) + } else if value.Valid { + wh.HistoryTime = value.Time + } + case webhookhistory.FieldRef: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field ref", values[i]) + } else if value.Valid { + wh.Ref = value.String + } + case webhookhistory.FieldOperation: + if value, ok := values[i].(*history.OpType); !ok { + return fmt.Errorf("unexpected type %T for field operation", values[i]) + } else if value != nil { + wh.Operation = *value + } + case webhookhistory.FieldCreatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field created_at", values[i]) + } else if value.Valid { + wh.CreatedAt = value.Time + } + case webhookhistory.FieldUpdatedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field updated_at", values[i]) + } else if value.Valid { + wh.UpdatedAt = value.Time + } + case webhookhistory.FieldCreatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field created_by", values[i]) + } else if value.Valid { + wh.CreatedBy = value.String + } + case webhookhistory.FieldUpdatedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field updated_by", values[i]) + } else if value.Valid { + wh.UpdatedBy = value.String + } + case webhookhistory.FieldMappingID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field mapping_id", values[i]) + } else if value.Valid { + wh.MappingID = value.String + } + case webhookhistory.FieldTags: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field tags", values[i]) + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &wh.Tags); err != nil { + return fmt.Errorf("unmarshal field tags: %w", err) + } + } + case webhookhistory.FieldDeletedAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field deleted_at", values[i]) + } else if value.Valid { + wh.DeletedAt = value.Time + } + case webhookhistory.FieldDeletedBy: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field deleted_by", values[i]) + } else if value.Valid { + wh.DeletedBy = value.String + } + case webhookhistory.FieldOwnerID: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field owner_id", values[i]) + } else if value.Valid { + wh.OwnerID = value.String + } + case webhookhistory.FieldName: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field name", values[i]) + } else if value.Valid { + wh.Name = value.String + } + case webhookhistory.FieldDescription: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field description", values[i]) + } else if value.Valid { + wh.Description = value.String + } + case webhookhistory.FieldDestinationURL: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field destination_url", values[i]) + } else if value.Valid { + wh.DestinationURL = value.String + } + case webhookhistory.FieldEnabled: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field enabled", values[i]) + } else if value.Valid { + wh.Enabled = value.Bool + } + case webhookhistory.FieldCallback: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field callback", values[i]) + } else if value.Valid { + wh.Callback = value.String + } + case webhookhistory.FieldExpiresAt: + if value, ok := values[i].(*sql.NullTime); !ok { + return fmt.Errorf("unexpected type %T for field expires_at", values[i]) + } else if value.Valid { + wh.ExpiresAt = value.Time + } + case webhookhistory.FieldSecret: + if value, ok := values[i].(*[]byte); !ok { + return fmt.Errorf("unexpected type %T for field secret", values[i]) + } else if value != nil { + wh.Secret = *value + } + case webhookhistory.FieldFailures: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field failures", values[i]) + } else if value.Valid { + wh.Failures = int(value.Int64) + } + case webhookhistory.FieldLastError: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field last_error", values[i]) + } else if value.Valid { + wh.LastError = value.String + } + case webhookhistory.FieldLastResponse: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field last_response", values[i]) + } else if value.Valid { + wh.LastResponse = value.String + } + default: + wh.selectValues.Set(columns[i], values[i]) + } + } + return nil +} + +// Value returns the ent.Value that was dynamically selected and assigned to the WebhookHistory. +// This includes values selected through modifiers, order, etc. +func (wh *WebhookHistory) Value(name string) (ent.Value, error) { + return wh.selectValues.Get(name) +} + +// Update returns a builder for updating this WebhookHistory. +// Note that you need to call WebhookHistory.Unwrap() before calling this method if this WebhookHistory +// was returned from a transaction, and the transaction was committed or rolled back. +func (wh *WebhookHistory) Update() *WebhookHistoryUpdateOne { + return NewWebhookHistoryClient(wh.config).UpdateOne(wh) +} + +// Unwrap unwraps the WebhookHistory 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 (wh *WebhookHistory) Unwrap() *WebhookHistory { + _tx, ok := wh.config.driver.(*txDriver) + if !ok { + panic("generated: WebhookHistory is not a transactional entity") + } + wh.config.driver = _tx.drv + return wh +} + +// String implements the fmt.Stringer. +func (wh *WebhookHistory) String() string { + var builder strings.Builder + builder.WriteString("WebhookHistory(") + builder.WriteString(fmt.Sprintf("id=%v, ", wh.ID)) + builder.WriteString("history_time=") + builder.WriteString(wh.HistoryTime.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("ref=") + builder.WriteString(wh.Ref) + builder.WriteString(", ") + builder.WriteString("operation=") + builder.WriteString(fmt.Sprintf("%v", wh.Operation)) + builder.WriteString(", ") + builder.WriteString("created_at=") + builder.WriteString(wh.CreatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("updated_at=") + builder.WriteString(wh.UpdatedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("created_by=") + builder.WriteString(wh.CreatedBy) + builder.WriteString(", ") + builder.WriteString("updated_by=") + builder.WriteString(wh.UpdatedBy) + builder.WriteString(", ") + builder.WriteString("mapping_id=") + builder.WriteString(wh.MappingID) + builder.WriteString(", ") + builder.WriteString("tags=") + builder.WriteString(fmt.Sprintf("%v", wh.Tags)) + builder.WriteString(", ") + builder.WriteString("deleted_at=") + builder.WriteString(wh.DeletedAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("deleted_by=") + builder.WriteString(wh.DeletedBy) + builder.WriteString(", ") + builder.WriteString("owner_id=") + builder.WriteString(wh.OwnerID) + builder.WriteString(", ") + builder.WriteString("name=") + builder.WriteString(wh.Name) + builder.WriteString(", ") + builder.WriteString("description=") + builder.WriteString(wh.Description) + builder.WriteString(", ") + builder.WriteString("destination_url=") + builder.WriteString(wh.DestinationURL) + builder.WriteString(", ") + builder.WriteString("enabled=") + builder.WriteString(fmt.Sprintf("%v", wh.Enabled)) + builder.WriteString(", ") + builder.WriteString("callback=") + builder.WriteString(wh.Callback) + builder.WriteString(", ") + builder.WriteString("expires_at=") + builder.WriteString(wh.ExpiresAt.Format(time.ANSIC)) + builder.WriteString(", ") + builder.WriteString("secret=") + builder.WriteString(fmt.Sprintf("%v", wh.Secret)) + builder.WriteString(", ") + builder.WriteString("failures=") + builder.WriteString(fmt.Sprintf("%v", wh.Failures)) + builder.WriteString(", ") + builder.WriteString("last_error=") + builder.WriteString(wh.LastError) + builder.WriteString(", ") + builder.WriteString("last_response=") + builder.WriteString(wh.LastResponse) + builder.WriteByte(')') + return builder.String() +} + +// WebhookHistories is a parsable slice of WebhookHistory. +type WebhookHistories []*WebhookHistory diff --git a/internal/ent/generated/webhookhistory/webhookhistory.go b/internal/ent/generated/webhookhistory/webhookhistory.go new file mode 100644 index 0000000..9f0252d --- /dev/null +++ b/internal/ent/generated/webhookhistory/webhookhistory.go @@ -0,0 +1,257 @@ +// Code generated by ent, DO NOT EDIT. + +package webhookhistory + +import ( + "fmt" + "time" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/entx/history" +) + +const ( + // Label holds the string label denoting the webhookhistory type in the database. + Label = "webhook_history" + // FieldID holds the string denoting the id field in the database. + FieldID = "id" + // FieldHistoryTime holds the string denoting the history_time field in the database. + FieldHistoryTime = "history_time" + // FieldRef holds the string denoting the ref field in the database. + FieldRef = "ref" + // FieldOperation holds the string denoting the operation field in the database. + FieldOperation = "operation" + // FieldCreatedAt holds the string denoting the created_at field in the database. + FieldCreatedAt = "created_at" + // FieldUpdatedAt holds the string denoting the updated_at field in the database. + FieldUpdatedAt = "updated_at" + // FieldCreatedBy holds the string denoting the created_by field in the database. + FieldCreatedBy = "created_by" + // FieldUpdatedBy holds the string denoting the updated_by field in the database. + FieldUpdatedBy = "updated_by" + // FieldMappingID holds the string denoting the mapping_id field in the database. + FieldMappingID = "mapping_id" + // FieldTags holds the string denoting the tags field in the database. + FieldTags = "tags" + // FieldDeletedAt holds the string denoting the deleted_at field in the database. + FieldDeletedAt = "deleted_at" + // FieldDeletedBy holds the string denoting the deleted_by field in the database. + FieldDeletedBy = "deleted_by" + // FieldOwnerID holds the string denoting the owner_id field in the database. + FieldOwnerID = "owner_id" + // FieldName holds the string denoting the name field in the database. + FieldName = "name" + // FieldDescription holds the string denoting the description field in the database. + FieldDescription = "description" + // FieldDestinationURL holds the string denoting the destination_url field in the database. + FieldDestinationURL = "destination_url" + // FieldEnabled holds the string denoting the enabled field in the database. + FieldEnabled = "enabled" + // FieldCallback holds the string denoting the callback field in the database. + FieldCallback = "callback" + // FieldExpiresAt holds the string denoting the expires_at field in the database. + FieldExpiresAt = "expires_at" + // FieldSecret holds the string denoting the secret field in the database. + FieldSecret = "secret" + // FieldFailures holds the string denoting the failures field in the database. + FieldFailures = "failures" + // FieldLastError holds the string denoting the last_error field in the database. + FieldLastError = "last_error" + // FieldLastResponse holds the string denoting the last_response field in the database. + FieldLastResponse = "last_response" + // Table holds the table name of the webhookhistory in the database. + Table = "webhook_history" +) + +// Columns holds all SQL columns for webhookhistory fields. +var Columns = []string{ + FieldID, + FieldHistoryTime, + FieldRef, + FieldOperation, + FieldCreatedAt, + FieldUpdatedAt, + FieldCreatedBy, + FieldUpdatedBy, + FieldMappingID, + FieldTags, + FieldDeletedAt, + FieldDeletedBy, + FieldOwnerID, + FieldName, + FieldDescription, + FieldDestinationURL, + FieldEnabled, + FieldCallback, + FieldExpiresAt, + FieldSecret, + FieldFailures, + FieldLastError, + FieldLastResponse, +} + +// ValidColumn reports if the column name is valid (part of the table columns). +func ValidColumn(column string) bool { + for i := range Columns { + if column == Columns[i] { + return true + } + } + return false +} + +// Note that the variables below are initialized by the runtime +// package on the initialization of the application. Therefore, +// it should be imported in the main as follows: +// +// import _ "github.com/theopenlane/core/internal/ent/generated/runtime" +var ( + Hooks [1]ent.Hook + Interceptors [1]ent.Interceptor + Policy ent.Policy + // DefaultHistoryTime holds the default value on creation for the "history_time" field. + DefaultHistoryTime func() time.Time + // DefaultCreatedAt holds the default value on creation for the "created_at" field. + DefaultCreatedAt func() time.Time + // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. + DefaultUpdatedAt func() time.Time + // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. + UpdateDefaultUpdatedAt func() time.Time + // DefaultMappingID holds the default value on creation for the "mapping_id" field. + DefaultMappingID func() string + // DefaultTags holds the default value on creation for the "tags" field. + DefaultTags []string + // DefaultEnabled holds the default value on creation for the "enabled" field. + DefaultEnabled bool + // DefaultFailures holds the default value on creation for the "failures" field. + DefaultFailures int + // DefaultID holds the default value on creation for the "id" field. + DefaultID func() string +) + +// OperationValidator is a validator for the "operation" field enum values. It is called by the builders before save. +func OperationValidator(o history.OpType) error { + switch o.String() { + case "INSERT", "UPDATE", "DELETE": + return nil + default: + return fmt.Errorf("webhookhistory: invalid enum value for operation field: %q", o) + } +} + +// OrderOption defines the ordering options for the WebhookHistory 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() +} + +// ByHistoryTime orders the results by the history_time field. +func ByHistoryTime(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldHistoryTime, opts...).ToFunc() +} + +// ByRef orders the results by the ref field. +func ByRef(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldRef, opts...).ToFunc() +} + +// ByOperation orders the results by the operation field. +func ByOperation(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOperation, opts...).ToFunc() +} + +// ByCreatedAt orders the results by the created_at field. +func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() +} + +// ByUpdatedAt orders the results by the updated_at field. +func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc() +} + +// ByCreatedBy orders the results by the created_by field. +func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCreatedBy, opts...).ToFunc() +} + +// ByUpdatedBy orders the results by the updated_by field. +func ByUpdatedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldUpdatedBy, opts...).ToFunc() +} + +// ByMappingID orders the results by the mapping_id field. +func ByMappingID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldMappingID, opts...).ToFunc() +} + +// ByDeletedAt orders the results by the deleted_at field. +func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() +} + +// ByDeletedBy orders the results by the deleted_by field. +func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() +} + +// ByOwnerID orders the results by the owner_id field. +func ByOwnerID(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldOwnerID, opts...).ToFunc() +} + +// ByName orders the results by the name field. +func ByName(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldName, opts...).ToFunc() +} + +// ByDescription orders the results by the description field. +func ByDescription(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDescription, opts...).ToFunc() +} + +// ByDestinationURL orders the results by the destination_url field. +func ByDestinationURL(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldDestinationURL, opts...).ToFunc() +} + +// ByEnabled orders the results by the enabled field. +func ByEnabled(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldEnabled, opts...).ToFunc() +} + +// ByCallback orders the results by the callback field. +func ByCallback(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldCallback, opts...).ToFunc() +} + +// ByExpiresAt orders the results by the expires_at field. +func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldExpiresAt, opts...).ToFunc() +} + +// ByFailures orders the results by the failures field. +func ByFailures(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldFailures, opts...).ToFunc() +} + +// ByLastError orders the results by the last_error field. +func ByLastError(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastError, opts...).ToFunc() +} + +// ByLastResponse orders the results by the last_response field. +func ByLastResponse(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldLastResponse, opts...).ToFunc() +} + +var ( + // history.OpType must implement graphql.Marshaler. + _ graphql.Marshaler = (*history.OpType)(nil) + // history.OpType must implement graphql.Unmarshaler. + _ graphql.Unmarshaler = (*history.OpType)(nil) +) diff --git a/internal/ent/generated/webhookhistory/where.go b/internal/ent/generated/webhookhistory/where.go new file mode 100644 index 0000000..f715da8 --- /dev/null +++ b/internal/ent/generated/webhookhistory/where.go @@ -0,0 +1,1431 @@ +// Code generated by ent, DO NOT EDIT. + +package webhookhistory + +import ( + "time" + + "entgo.io/ent/dialect/sql" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/entx/history" +) + +// ID filters vertices based on their ID field. +func ID(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldID, id)) +} + +// IDEQ applies the EQ predicate on the ID field. +func IDEQ(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldID, id)) +} + +// IDNEQ applies the NEQ predicate on the ID field. +func IDNEQ(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldID, id)) +} + +// IDIn applies the In predicate on the ID field. +func IDIn(ids ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldID, ids...)) +} + +// IDNotIn applies the NotIn predicate on the ID field. +func IDNotIn(ids ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldID, ids...)) +} + +// IDGT applies the GT predicate on the ID field. +func IDGT(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldID, id)) +} + +// IDGTE applies the GTE predicate on the ID field. +func IDGTE(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldID, id)) +} + +// IDLT applies the LT predicate on the ID field. +func IDLT(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldID, id)) +} + +// IDLTE applies the LTE predicate on the ID field. +func IDLTE(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldID, id)) +} + +// IDEqualFold applies the EqualFold predicate on the ID field. +func IDEqualFold(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldID, id)) +} + +// IDContainsFold applies the ContainsFold predicate on the ID field. +func IDContainsFold(id string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldID, id)) +} + +// HistoryTime applies equality check predicate on the "history_time" field. It's identical to HistoryTimeEQ. +func HistoryTime(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// Ref applies equality check predicate on the "ref" field. It's identical to RefEQ. +func Ref(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldRef, v)) +} + +// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. +func CreatedAt(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. +func UpdatedAt(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// CreatedBy applies equality check predicate on the "created_by" field. It's identical to CreatedByEQ. +func CreatedBy(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// UpdatedBy applies equality check predicate on the "updated_by" field. It's identical to UpdatedByEQ. +func UpdatedBy(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// MappingID applies equality check predicate on the "mapping_id" field. It's identical to MappingIDEQ. +func MappingID(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ. +func DeletedAt(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedBy applies equality check predicate on the "deleted_by" field. It's identical to DeletedByEQ. +func DeletedBy(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// OwnerID applies equality check predicate on the "owner_id" field. It's identical to OwnerIDEQ. +func OwnerID(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// Name applies equality check predicate on the "name" field. It's identical to NameEQ. +func Name(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldName, v)) +} + +// Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ. +func Description(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DestinationURL applies equality check predicate on the "destination_url" field. It's identical to DestinationURLEQ. +func DestinationURL(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDestinationURL, v)) +} + +// Enabled applies equality check predicate on the "enabled" field. It's identical to EnabledEQ. +func Enabled(v bool) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldEnabled, v)) +} + +// Callback applies equality check predicate on the "callback" field. It's identical to CallbackEQ. +func Callback(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldCallback, v)) +} + +// ExpiresAt applies equality check predicate on the "expires_at" field. It's identical to ExpiresAtEQ. +func ExpiresAt(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldExpiresAt, v)) +} + +// Secret applies equality check predicate on the "secret" field. It's identical to SecretEQ. +func Secret(v []byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldSecret, v)) +} + +// Failures applies equality check predicate on the "failures" field. It's identical to FailuresEQ. +func Failures(v int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldFailures, v)) +} + +// LastError applies equality check predicate on the "last_error" field. It's identical to LastErrorEQ. +func LastError(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldLastError, v)) +} + +// LastResponse applies equality check predicate on the "last_response" field. It's identical to LastResponseEQ. +func LastResponse(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldLastResponse, v)) +} + +// HistoryTimeEQ applies the EQ predicate on the "history_time" field. +func HistoryTimeEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldHistoryTime, v)) +} + +// HistoryTimeNEQ applies the NEQ predicate on the "history_time" field. +func HistoryTimeNEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldHistoryTime, v)) +} + +// HistoryTimeIn applies the In predicate on the "history_time" field. +func HistoryTimeIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeNotIn applies the NotIn predicate on the "history_time" field. +func HistoryTimeNotIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldHistoryTime, vs...)) +} + +// HistoryTimeGT applies the GT predicate on the "history_time" field. +func HistoryTimeGT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldHistoryTime, v)) +} + +// HistoryTimeGTE applies the GTE predicate on the "history_time" field. +func HistoryTimeGTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldHistoryTime, v)) +} + +// HistoryTimeLT applies the LT predicate on the "history_time" field. +func HistoryTimeLT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldHistoryTime, v)) +} + +// HistoryTimeLTE applies the LTE predicate on the "history_time" field. +func HistoryTimeLTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldHistoryTime, v)) +} + +// RefEQ applies the EQ predicate on the "ref" field. +func RefEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldRef, v)) +} + +// RefNEQ applies the NEQ predicate on the "ref" field. +func RefNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldRef, v)) +} + +// RefIn applies the In predicate on the "ref" field. +func RefIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldRef, vs...)) +} + +// RefNotIn applies the NotIn predicate on the "ref" field. +func RefNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldRef, vs...)) +} + +// RefGT applies the GT predicate on the "ref" field. +func RefGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldRef, v)) +} + +// RefGTE applies the GTE predicate on the "ref" field. +func RefGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldRef, v)) +} + +// RefLT applies the LT predicate on the "ref" field. +func RefLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldRef, v)) +} + +// RefLTE applies the LTE predicate on the "ref" field. +func RefLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldRef, v)) +} + +// RefContains applies the Contains predicate on the "ref" field. +func RefContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldRef, v)) +} + +// RefHasPrefix applies the HasPrefix predicate on the "ref" field. +func RefHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldRef, v)) +} + +// RefHasSuffix applies the HasSuffix predicate on the "ref" field. +func RefHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldRef, v)) +} + +// RefIsNil applies the IsNil predicate on the "ref" field. +func RefIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldRef)) +} + +// RefNotNil applies the NotNil predicate on the "ref" field. +func RefNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldRef)) +} + +// RefEqualFold applies the EqualFold predicate on the "ref" field. +func RefEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldRef, v)) +} + +// RefContainsFold applies the ContainsFold predicate on the "ref" field. +func RefContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldRef, v)) +} + +// OperationEQ applies the EQ predicate on the "operation" field. +func OperationEQ(v history.OpType) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldOperation, v)) +} + +// OperationNEQ applies the NEQ predicate on the "operation" field. +func OperationNEQ(v history.OpType) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldOperation, v)) +} + +// OperationIn applies the In predicate on the "operation" field. +func OperationIn(vs ...history.OpType) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldOperation, vs...)) +} + +// OperationNotIn applies the NotIn predicate on the "operation" field. +func OperationNotIn(vs ...history.OpType) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldOperation, vs...)) +} + +// CreatedAtEQ applies the EQ predicate on the "created_at" field. +func CreatedAtEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldCreatedAt, v)) +} + +// CreatedAtNEQ applies the NEQ predicate on the "created_at" field. +func CreatedAtNEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldCreatedAt, v)) +} + +// CreatedAtIn applies the In predicate on the "created_at" field. +func CreatedAtIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldCreatedAt, vs...)) +} + +// CreatedAtNotIn applies the NotIn predicate on the "created_at" field. +func CreatedAtNotIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldCreatedAt, vs...)) +} + +// CreatedAtGT applies the GT predicate on the "created_at" field. +func CreatedAtGT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldCreatedAt, v)) +} + +// CreatedAtGTE applies the GTE predicate on the "created_at" field. +func CreatedAtGTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldCreatedAt, v)) +} + +// CreatedAtLT applies the LT predicate on the "created_at" field. +func CreatedAtLT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldCreatedAt, v)) +} + +// CreatedAtLTE applies the LTE predicate on the "created_at" field. +func CreatedAtLTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldCreatedAt, v)) +} + +// CreatedAtIsNil applies the IsNil predicate on the "created_at" field. +func CreatedAtIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldCreatedAt)) +} + +// CreatedAtNotNil applies the NotNil predicate on the "created_at" field. +func CreatedAtNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldCreatedAt)) +} + +// UpdatedAtEQ applies the EQ predicate on the "updated_at" field. +func UpdatedAtEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. +func UpdatedAtNEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldUpdatedAt, v)) +} + +// UpdatedAtIn applies the In predicate on the "updated_at" field. +func UpdatedAtIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. +func UpdatedAtNotIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldUpdatedAt, vs...)) +} + +// UpdatedAtGT applies the GT predicate on the "updated_at" field. +func UpdatedAtGT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldUpdatedAt, v)) +} + +// UpdatedAtGTE applies the GTE predicate on the "updated_at" field. +func UpdatedAtGTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldUpdatedAt, v)) +} + +// UpdatedAtLT applies the LT predicate on the "updated_at" field. +func UpdatedAtLT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldUpdatedAt, v)) +} + +// UpdatedAtLTE applies the LTE predicate on the "updated_at" field. +func UpdatedAtLTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldUpdatedAt, v)) +} + +// UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field. +func UpdatedAtIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldUpdatedAt)) +} + +// UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field. +func UpdatedAtNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldUpdatedAt)) +} + +// CreatedByEQ applies the EQ predicate on the "created_by" field. +func CreatedByEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldCreatedBy, v)) +} + +// CreatedByNEQ applies the NEQ predicate on the "created_by" field. +func CreatedByNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldCreatedBy, v)) +} + +// CreatedByIn applies the In predicate on the "created_by" field. +func CreatedByIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldCreatedBy, vs...)) +} + +// CreatedByNotIn applies the NotIn predicate on the "created_by" field. +func CreatedByNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldCreatedBy, vs...)) +} + +// CreatedByGT applies the GT predicate on the "created_by" field. +func CreatedByGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldCreatedBy, v)) +} + +// CreatedByGTE applies the GTE predicate on the "created_by" field. +func CreatedByGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldCreatedBy, v)) +} + +// CreatedByLT applies the LT predicate on the "created_by" field. +func CreatedByLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldCreatedBy, v)) +} + +// CreatedByLTE applies the LTE predicate on the "created_by" field. +func CreatedByLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldCreatedBy, v)) +} + +// CreatedByContains applies the Contains predicate on the "created_by" field. +func CreatedByContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldCreatedBy, v)) +} + +// CreatedByHasPrefix applies the HasPrefix predicate on the "created_by" field. +func CreatedByHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldCreatedBy, v)) +} + +// CreatedByHasSuffix applies the HasSuffix predicate on the "created_by" field. +func CreatedByHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldCreatedBy, v)) +} + +// CreatedByIsNil applies the IsNil predicate on the "created_by" field. +func CreatedByIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldCreatedBy)) +} + +// CreatedByNotNil applies the NotNil predicate on the "created_by" field. +func CreatedByNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldCreatedBy)) +} + +// CreatedByEqualFold applies the EqualFold predicate on the "created_by" field. +func CreatedByEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldCreatedBy, v)) +} + +// CreatedByContainsFold applies the ContainsFold predicate on the "created_by" field. +func CreatedByContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldCreatedBy, v)) +} + +// UpdatedByEQ applies the EQ predicate on the "updated_by" field. +func UpdatedByEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldUpdatedBy, v)) +} + +// UpdatedByNEQ applies the NEQ predicate on the "updated_by" field. +func UpdatedByNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldUpdatedBy, v)) +} + +// UpdatedByIn applies the In predicate on the "updated_by" field. +func UpdatedByIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByNotIn applies the NotIn predicate on the "updated_by" field. +func UpdatedByNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldUpdatedBy, vs...)) +} + +// UpdatedByGT applies the GT predicate on the "updated_by" field. +func UpdatedByGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldUpdatedBy, v)) +} + +// UpdatedByGTE applies the GTE predicate on the "updated_by" field. +func UpdatedByGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldUpdatedBy, v)) +} + +// UpdatedByLT applies the LT predicate on the "updated_by" field. +func UpdatedByLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldUpdatedBy, v)) +} + +// UpdatedByLTE applies the LTE predicate on the "updated_by" field. +func UpdatedByLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldUpdatedBy, v)) +} + +// UpdatedByContains applies the Contains predicate on the "updated_by" field. +func UpdatedByContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldUpdatedBy, v)) +} + +// UpdatedByHasPrefix applies the HasPrefix predicate on the "updated_by" field. +func UpdatedByHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldUpdatedBy, v)) +} + +// UpdatedByHasSuffix applies the HasSuffix predicate on the "updated_by" field. +func UpdatedByHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldUpdatedBy, v)) +} + +// UpdatedByIsNil applies the IsNil predicate on the "updated_by" field. +func UpdatedByIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldUpdatedBy)) +} + +// UpdatedByNotNil applies the NotNil predicate on the "updated_by" field. +func UpdatedByNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldUpdatedBy)) +} + +// UpdatedByEqualFold applies the EqualFold predicate on the "updated_by" field. +func UpdatedByEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldUpdatedBy, v)) +} + +// UpdatedByContainsFold applies the ContainsFold predicate on the "updated_by" field. +func UpdatedByContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldUpdatedBy, v)) +} + +// MappingIDEQ applies the EQ predicate on the "mapping_id" field. +func MappingIDEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldMappingID, v)) +} + +// MappingIDNEQ applies the NEQ predicate on the "mapping_id" field. +func MappingIDNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldMappingID, v)) +} + +// MappingIDIn applies the In predicate on the "mapping_id" field. +func MappingIDIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldMappingID, vs...)) +} + +// MappingIDNotIn applies the NotIn predicate on the "mapping_id" field. +func MappingIDNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldMappingID, vs...)) +} + +// MappingIDGT applies the GT predicate on the "mapping_id" field. +func MappingIDGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldMappingID, v)) +} + +// MappingIDGTE applies the GTE predicate on the "mapping_id" field. +func MappingIDGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldMappingID, v)) +} + +// MappingIDLT applies the LT predicate on the "mapping_id" field. +func MappingIDLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldMappingID, v)) +} + +// MappingIDLTE applies the LTE predicate on the "mapping_id" field. +func MappingIDLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldMappingID, v)) +} + +// MappingIDContains applies the Contains predicate on the "mapping_id" field. +func MappingIDContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldMappingID, v)) +} + +// MappingIDHasPrefix applies the HasPrefix predicate on the "mapping_id" field. +func MappingIDHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldMappingID, v)) +} + +// MappingIDHasSuffix applies the HasSuffix predicate on the "mapping_id" field. +func MappingIDHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldMappingID, v)) +} + +// MappingIDEqualFold applies the EqualFold predicate on the "mapping_id" field. +func MappingIDEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldMappingID, v)) +} + +// MappingIDContainsFold applies the ContainsFold predicate on the "mapping_id" field. +func MappingIDContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldMappingID, v)) +} + +// TagsIsNil applies the IsNil predicate on the "tags" field. +func TagsIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldTags)) +} + +// TagsNotNil applies the NotNil predicate on the "tags" field. +func TagsNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldTags)) +} + +// DeletedAtEQ applies the EQ predicate on the "deleted_at" field. +func DeletedAtEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDeletedAt, v)) +} + +// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field. +func DeletedAtNEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldDeletedAt, v)) +} + +// DeletedAtIn applies the In predicate on the "deleted_at" field. +func DeletedAtIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldDeletedAt, vs...)) +} + +// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field. +func DeletedAtNotIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldDeletedAt, vs...)) +} + +// DeletedAtGT applies the GT predicate on the "deleted_at" field. +func DeletedAtGT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldDeletedAt, v)) +} + +// DeletedAtGTE applies the GTE predicate on the "deleted_at" field. +func DeletedAtGTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldDeletedAt, v)) +} + +// DeletedAtLT applies the LT predicate on the "deleted_at" field. +func DeletedAtLT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldDeletedAt, v)) +} + +// DeletedAtLTE applies the LTE predicate on the "deleted_at" field. +func DeletedAtLTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldDeletedAt, v)) +} + +// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field. +func DeletedAtIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldDeletedAt)) +} + +// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field. +func DeletedAtNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldDeletedAt)) +} + +// DeletedByEQ applies the EQ predicate on the "deleted_by" field. +func DeletedByEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDeletedBy, v)) +} + +// DeletedByNEQ applies the NEQ predicate on the "deleted_by" field. +func DeletedByNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldDeletedBy, v)) +} + +// DeletedByIn applies the In predicate on the "deleted_by" field. +func DeletedByIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldDeletedBy, vs...)) +} + +// DeletedByNotIn applies the NotIn predicate on the "deleted_by" field. +func DeletedByNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldDeletedBy, vs...)) +} + +// DeletedByGT applies the GT predicate on the "deleted_by" field. +func DeletedByGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldDeletedBy, v)) +} + +// DeletedByGTE applies the GTE predicate on the "deleted_by" field. +func DeletedByGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldDeletedBy, v)) +} + +// DeletedByLT applies the LT predicate on the "deleted_by" field. +func DeletedByLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldDeletedBy, v)) +} + +// DeletedByLTE applies the LTE predicate on the "deleted_by" field. +func DeletedByLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldDeletedBy, v)) +} + +// DeletedByContains applies the Contains predicate on the "deleted_by" field. +func DeletedByContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldDeletedBy, v)) +} + +// DeletedByHasPrefix applies the HasPrefix predicate on the "deleted_by" field. +func DeletedByHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldDeletedBy, v)) +} + +// DeletedByHasSuffix applies the HasSuffix predicate on the "deleted_by" field. +func DeletedByHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldDeletedBy, v)) +} + +// DeletedByIsNil applies the IsNil predicate on the "deleted_by" field. +func DeletedByIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldDeletedBy)) +} + +// DeletedByNotNil applies the NotNil predicate on the "deleted_by" field. +func DeletedByNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldDeletedBy)) +} + +// DeletedByEqualFold applies the EqualFold predicate on the "deleted_by" field. +func DeletedByEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldDeletedBy, v)) +} + +// DeletedByContainsFold applies the ContainsFold predicate on the "deleted_by" field. +func DeletedByContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldDeletedBy, v)) +} + +// OwnerIDEQ applies the EQ predicate on the "owner_id" field. +func OwnerIDEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldOwnerID, v)) +} + +// OwnerIDNEQ applies the NEQ predicate on the "owner_id" field. +func OwnerIDNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldOwnerID, v)) +} + +// OwnerIDIn applies the In predicate on the "owner_id" field. +func OwnerIDIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldOwnerID, vs...)) +} + +// OwnerIDNotIn applies the NotIn predicate on the "owner_id" field. +func OwnerIDNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldOwnerID, vs...)) +} + +// OwnerIDGT applies the GT predicate on the "owner_id" field. +func OwnerIDGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldOwnerID, v)) +} + +// OwnerIDGTE applies the GTE predicate on the "owner_id" field. +func OwnerIDGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldOwnerID, v)) +} + +// OwnerIDLT applies the LT predicate on the "owner_id" field. +func OwnerIDLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldOwnerID, v)) +} + +// OwnerIDLTE applies the LTE predicate on the "owner_id" field. +func OwnerIDLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldOwnerID, v)) +} + +// OwnerIDContains applies the Contains predicate on the "owner_id" field. +func OwnerIDContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldOwnerID, v)) +} + +// OwnerIDHasPrefix applies the HasPrefix predicate on the "owner_id" field. +func OwnerIDHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldOwnerID, v)) +} + +// OwnerIDHasSuffix applies the HasSuffix predicate on the "owner_id" field. +func OwnerIDHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldOwnerID, v)) +} + +// OwnerIDIsNil applies the IsNil predicate on the "owner_id" field. +func OwnerIDIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldOwnerID)) +} + +// OwnerIDNotNil applies the NotNil predicate on the "owner_id" field. +func OwnerIDNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldOwnerID)) +} + +// OwnerIDEqualFold applies the EqualFold predicate on the "owner_id" field. +func OwnerIDEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldOwnerID, v)) +} + +// OwnerIDContainsFold applies the ContainsFold predicate on the "owner_id" field. +func OwnerIDContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldOwnerID, v)) +} + +// NameEQ applies the EQ predicate on the "name" field. +func NameEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldName, v)) +} + +// NameNEQ applies the NEQ predicate on the "name" field. +func NameNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldName, v)) +} + +// NameIn applies the In predicate on the "name" field. +func NameIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldName, vs...)) +} + +// NameNotIn applies the NotIn predicate on the "name" field. +func NameNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldName, vs...)) +} + +// NameGT applies the GT predicate on the "name" field. +func NameGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldName, v)) +} + +// NameGTE applies the GTE predicate on the "name" field. +func NameGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldName, v)) +} + +// NameLT applies the LT predicate on the "name" field. +func NameLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldName, v)) +} + +// NameLTE applies the LTE predicate on the "name" field. +func NameLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldName, v)) +} + +// NameContains applies the Contains predicate on the "name" field. +func NameContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldName, v)) +} + +// NameHasPrefix applies the HasPrefix predicate on the "name" field. +func NameHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldName, v)) +} + +// NameHasSuffix applies the HasSuffix predicate on the "name" field. +func NameHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldName, v)) +} + +// NameEqualFold applies the EqualFold predicate on the "name" field. +func NameEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldName, v)) +} + +// NameContainsFold applies the ContainsFold predicate on the "name" field. +func NameContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldName, v)) +} + +// DescriptionEQ applies the EQ predicate on the "description" field. +func DescriptionEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDescription, v)) +} + +// DescriptionNEQ applies the NEQ predicate on the "description" field. +func DescriptionNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldDescription, v)) +} + +// DescriptionIn applies the In predicate on the "description" field. +func DescriptionIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldDescription, vs...)) +} + +// DescriptionNotIn applies the NotIn predicate on the "description" field. +func DescriptionNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldDescription, vs...)) +} + +// DescriptionGT applies the GT predicate on the "description" field. +func DescriptionGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldDescription, v)) +} + +// DescriptionGTE applies the GTE predicate on the "description" field. +func DescriptionGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldDescription, v)) +} + +// DescriptionLT applies the LT predicate on the "description" field. +func DescriptionLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldDescription, v)) +} + +// DescriptionLTE applies the LTE predicate on the "description" field. +func DescriptionLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldDescription, v)) +} + +// DescriptionContains applies the Contains predicate on the "description" field. +func DescriptionContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldDescription, v)) +} + +// DescriptionHasPrefix applies the HasPrefix predicate on the "description" field. +func DescriptionHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldDescription, v)) +} + +// DescriptionHasSuffix applies the HasSuffix predicate on the "description" field. +func DescriptionHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldDescription, v)) +} + +// DescriptionIsNil applies the IsNil predicate on the "description" field. +func DescriptionIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldDescription)) +} + +// DescriptionNotNil applies the NotNil predicate on the "description" field. +func DescriptionNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldDescription)) +} + +// DescriptionEqualFold applies the EqualFold predicate on the "description" field. +func DescriptionEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldDescription, v)) +} + +// DescriptionContainsFold applies the ContainsFold predicate on the "description" field. +func DescriptionContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldDescription, v)) +} + +// DestinationURLEQ applies the EQ predicate on the "destination_url" field. +func DestinationURLEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldDestinationURL, v)) +} + +// DestinationURLNEQ applies the NEQ predicate on the "destination_url" field. +func DestinationURLNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldDestinationURL, v)) +} + +// DestinationURLIn applies the In predicate on the "destination_url" field. +func DestinationURLIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldDestinationURL, vs...)) +} + +// DestinationURLNotIn applies the NotIn predicate on the "destination_url" field. +func DestinationURLNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldDestinationURL, vs...)) +} + +// DestinationURLGT applies the GT predicate on the "destination_url" field. +func DestinationURLGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldDestinationURL, v)) +} + +// DestinationURLGTE applies the GTE predicate on the "destination_url" field. +func DestinationURLGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldDestinationURL, v)) +} + +// DestinationURLLT applies the LT predicate on the "destination_url" field. +func DestinationURLLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldDestinationURL, v)) +} + +// DestinationURLLTE applies the LTE predicate on the "destination_url" field. +func DestinationURLLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldDestinationURL, v)) +} + +// DestinationURLContains applies the Contains predicate on the "destination_url" field. +func DestinationURLContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldDestinationURL, v)) +} + +// DestinationURLHasPrefix applies the HasPrefix predicate on the "destination_url" field. +func DestinationURLHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldDestinationURL, v)) +} + +// DestinationURLHasSuffix applies the HasSuffix predicate on the "destination_url" field. +func DestinationURLHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldDestinationURL, v)) +} + +// DestinationURLEqualFold applies the EqualFold predicate on the "destination_url" field. +func DestinationURLEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldDestinationURL, v)) +} + +// DestinationURLContainsFold applies the ContainsFold predicate on the "destination_url" field. +func DestinationURLContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldDestinationURL, v)) +} + +// EnabledEQ applies the EQ predicate on the "enabled" field. +func EnabledEQ(v bool) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldEnabled, v)) +} + +// EnabledNEQ applies the NEQ predicate on the "enabled" field. +func EnabledNEQ(v bool) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldEnabled, v)) +} + +// CallbackEQ applies the EQ predicate on the "callback" field. +func CallbackEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldCallback, v)) +} + +// CallbackNEQ applies the NEQ predicate on the "callback" field. +func CallbackNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldCallback, v)) +} + +// CallbackIn applies the In predicate on the "callback" field. +func CallbackIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldCallback, vs...)) +} + +// CallbackNotIn applies the NotIn predicate on the "callback" field. +func CallbackNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldCallback, vs...)) +} + +// CallbackGT applies the GT predicate on the "callback" field. +func CallbackGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldCallback, v)) +} + +// CallbackGTE applies the GTE predicate on the "callback" field. +func CallbackGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldCallback, v)) +} + +// CallbackLT applies the LT predicate on the "callback" field. +func CallbackLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldCallback, v)) +} + +// CallbackLTE applies the LTE predicate on the "callback" field. +func CallbackLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldCallback, v)) +} + +// CallbackContains applies the Contains predicate on the "callback" field. +func CallbackContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldCallback, v)) +} + +// CallbackHasPrefix applies the HasPrefix predicate on the "callback" field. +func CallbackHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldCallback, v)) +} + +// CallbackHasSuffix applies the HasSuffix predicate on the "callback" field. +func CallbackHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldCallback, v)) +} + +// CallbackIsNil applies the IsNil predicate on the "callback" field. +func CallbackIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldCallback)) +} + +// CallbackNotNil applies the NotNil predicate on the "callback" field. +func CallbackNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldCallback)) +} + +// CallbackEqualFold applies the EqualFold predicate on the "callback" field. +func CallbackEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldCallback, v)) +} + +// CallbackContainsFold applies the ContainsFold predicate on the "callback" field. +func CallbackContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldCallback, v)) +} + +// ExpiresAtEQ applies the EQ predicate on the "expires_at" field. +func ExpiresAtEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldExpiresAt, v)) +} + +// ExpiresAtNEQ applies the NEQ predicate on the "expires_at" field. +func ExpiresAtNEQ(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldExpiresAt, v)) +} + +// ExpiresAtIn applies the In predicate on the "expires_at" field. +func ExpiresAtIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtNotIn applies the NotIn predicate on the "expires_at" field. +func ExpiresAtNotIn(vs ...time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldExpiresAt, vs...)) +} + +// ExpiresAtGT applies the GT predicate on the "expires_at" field. +func ExpiresAtGT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldExpiresAt, v)) +} + +// ExpiresAtGTE applies the GTE predicate on the "expires_at" field. +func ExpiresAtGTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldExpiresAt, v)) +} + +// ExpiresAtLT applies the LT predicate on the "expires_at" field. +func ExpiresAtLT(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldExpiresAt, v)) +} + +// ExpiresAtLTE applies the LTE predicate on the "expires_at" field. +func ExpiresAtLTE(v time.Time) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldExpiresAt, v)) +} + +// ExpiresAtIsNil applies the IsNil predicate on the "expires_at" field. +func ExpiresAtIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldExpiresAt)) +} + +// ExpiresAtNotNil applies the NotNil predicate on the "expires_at" field. +func ExpiresAtNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldExpiresAt)) +} + +// SecretEQ applies the EQ predicate on the "secret" field. +func SecretEQ(v []byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldSecret, v)) +} + +// SecretNEQ applies the NEQ predicate on the "secret" field. +func SecretNEQ(v []byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldSecret, v)) +} + +// SecretIn applies the In predicate on the "secret" field. +func SecretIn(vs ...[]byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldSecret, vs...)) +} + +// SecretNotIn applies the NotIn predicate on the "secret" field. +func SecretNotIn(vs ...[]byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldSecret, vs...)) +} + +// SecretGT applies the GT predicate on the "secret" field. +func SecretGT(v []byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldSecret, v)) +} + +// SecretGTE applies the GTE predicate on the "secret" field. +func SecretGTE(v []byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldSecret, v)) +} + +// SecretLT applies the LT predicate on the "secret" field. +func SecretLT(v []byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldSecret, v)) +} + +// SecretLTE applies the LTE predicate on the "secret" field. +func SecretLTE(v []byte) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldSecret, v)) +} + +// SecretIsNil applies the IsNil predicate on the "secret" field. +func SecretIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldSecret)) +} + +// SecretNotNil applies the NotNil predicate on the "secret" field. +func SecretNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldSecret)) +} + +// FailuresEQ applies the EQ predicate on the "failures" field. +func FailuresEQ(v int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldFailures, v)) +} + +// FailuresNEQ applies the NEQ predicate on the "failures" field. +func FailuresNEQ(v int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldFailures, v)) +} + +// FailuresIn applies the In predicate on the "failures" field. +func FailuresIn(vs ...int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldFailures, vs...)) +} + +// FailuresNotIn applies the NotIn predicate on the "failures" field. +func FailuresNotIn(vs ...int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldFailures, vs...)) +} + +// FailuresGT applies the GT predicate on the "failures" field. +func FailuresGT(v int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldFailures, v)) +} + +// FailuresGTE applies the GTE predicate on the "failures" field. +func FailuresGTE(v int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldFailures, v)) +} + +// FailuresLT applies the LT predicate on the "failures" field. +func FailuresLT(v int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldFailures, v)) +} + +// FailuresLTE applies the LTE predicate on the "failures" field. +func FailuresLTE(v int) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldFailures, v)) +} + +// FailuresIsNil applies the IsNil predicate on the "failures" field. +func FailuresIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldFailures)) +} + +// FailuresNotNil applies the NotNil predicate on the "failures" field. +func FailuresNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldFailures)) +} + +// LastErrorEQ applies the EQ predicate on the "last_error" field. +func LastErrorEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldLastError, v)) +} + +// LastErrorNEQ applies the NEQ predicate on the "last_error" field. +func LastErrorNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldLastError, v)) +} + +// LastErrorIn applies the In predicate on the "last_error" field. +func LastErrorIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldLastError, vs...)) +} + +// LastErrorNotIn applies the NotIn predicate on the "last_error" field. +func LastErrorNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldLastError, vs...)) +} + +// LastErrorGT applies the GT predicate on the "last_error" field. +func LastErrorGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldLastError, v)) +} + +// LastErrorGTE applies the GTE predicate on the "last_error" field. +func LastErrorGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldLastError, v)) +} + +// LastErrorLT applies the LT predicate on the "last_error" field. +func LastErrorLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldLastError, v)) +} + +// LastErrorLTE applies the LTE predicate on the "last_error" field. +func LastErrorLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldLastError, v)) +} + +// LastErrorContains applies the Contains predicate on the "last_error" field. +func LastErrorContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldLastError, v)) +} + +// LastErrorHasPrefix applies the HasPrefix predicate on the "last_error" field. +func LastErrorHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldLastError, v)) +} + +// LastErrorHasSuffix applies the HasSuffix predicate on the "last_error" field. +func LastErrorHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldLastError, v)) +} + +// LastErrorIsNil applies the IsNil predicate on the "last_error" field. +func LastErrorIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldLastError)) +} + +// LastErrorNotNil applies the NotNil predicate on the "last_error" field. +func LastErrorNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldLastError)) +} + +// LastErrorEqualFold applies the EqualFold predicate on the "last_error" field. +func LastErrorEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldLastError, v)) +} + +// LastErrorContainsFold applies the ContainsFold predicate on the "last_error" field. +func LastErrorContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldLastError, v)) +} + +// LastResponseEQ applies the EQ predicate on the "last_response" field. +func LastResponseEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEQ(FieldLastResponse, v)) +} + +// LastResponseNEQ applies the NEQ predicate on the "last_response" field. +func LastResponseNEQ(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNEQ(FieldLastResponse, v)) +} + +// LastResponseIn applies the In predicate on the "last_response" field. +func LastResponseIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIn(FieldLastResponse, vs...)) +} + +// LastResponseNotIn applies the NotIn predicate on the "last_response" field. +func LastResponseNotIn(vs ...string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotIn(FieldLastResponse, vs...)) +} + +// LastResponseGT applies the GT predicate on the "last_response" field. +func LastResponseGT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGT(FieldLastResponse, v)) +} + +// LastResponseGTE applies the GTE predicate on the "last_response" field. +func LastResponseGTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldGTE(FieldLastResponse, v)) +} + +// LastResponseLT applies the LT predicate on the "last_response" field. +func LastResponseLT(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLT(FieldLastResponse, v)) +} + +// LastResponseLTE applies the LTE predicate on the "last_response" field. +func LastResponseLTE(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldLTE(FieldLastResponse, v)) +} + +// LastResponseContains applies the Contains predicate on the "last_response" field. +func LastResponseContains(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContains(FieldLastResponse, v)) +} + +// LastResponseHasPrefix applies the HasPrefix predicate on the "last_response" field. +func LastResponseHasPrefix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasPrefix(FieldLastResponse, v)) +} + +// LastResponseHasSuffix applies the HasSuffix predicate on the "last_response" field. +func LastResponseHasSuffix(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldHasSuffix(FieldLastResponse, v)) +} + +// LastResponseIsNil applies the IsNil predicate on the "last_response" field. +func LastResponseIsNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldIsNull(FieldLastResponse)) +} + +// LastResponseNotNil applies the NotNil predicate on the "last_response" field. +func LastResponseNotNil() predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldNotNull(FieldLastResponse)) +} + +// LastResponseEqualFold applies the EqualFold predicate on the "last_response" field. +func LastResponseEqualFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldEqualFold(FieldLastResponse, v)) +} + +// LastResponseContainsFold applies the ContainsFold predicate on the "last_response" field. +func LastResponseContainsFold(v string) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.FieldContainsFold(FieldLastResponse, v)) +} + +// And groups predicates with the AND operator between them. +func And(predicates ...predicate.WebhookHistory) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.AndPredicates(predicates...)) +} + +// Or groups predicates with the OR operator between them. +func Or(predicates ...predicate.WebhookHistory) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.OrPredicates(predicates...)) +} + +// Not applies the not operator on the given predicate. +func Not(p predicate.WebhookHistory) predicate.WebhookHistory { + return predicate.WebhookHistory(sql.NotPredicates(p)) +} diff --git a/internal/ent/generated/webhookhistory_create.go b/internal/ent/generated/webhookhistory_create.go new file mode 100644 index 0000000..dfa2f3c --- /dev/null +++ b/internal/ent/generated/webhookhistory_create.go @@ -0,0 +1,627 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + "github.com/theopenlane/entx/history" +) + +// WebhookHistoryCreate is the builder for creating a WebhookHistory entity. +type WebhookHistoryCreate struct { + config + mutation *WebhookHistoryMutation + hooks []Hook +} + +// SetHistoryTime sets the "history_time" field. +func (whc *WebhookHistoryCreate) SetHistoryTime(t time.Time) *WebhookHistoryCreate { + whc.mutation.SetHistoryTime(t) + return whc +} + +// SetNillableHistoryTime sets the "history_time" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableHistoryTime(t *time.Time) *WebhookHistoryCreate { + if t != nil { + whc.SetHistoryTime(*t) + } + return whc +} + +// SetRef sets the "ref" field. +func (whc *WebhookHistoryCreate) SetRef(s string) *WebhookHistoryCreate { + whc.mutation.SetRef(s) + return whc +} + +// SetNillableRef sets the "ref" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableRef(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetRef(*s) + } + return whc +} + +// SetOperation sets the "operation" field. +func (whc *WebhookHistoryCreate) SetOperation(ht history.OpType) *WebhookHistoryCreate { + whc.mutation.SetOperation(ht) + return whc +} + +// SetCreatedAt sets the "created_at" field. +func (whc *WebhookHistoryCreate) SetCreatedAt(t time.Time) *WebhookHistoryCreate { + whc.mutation.SetCreatedAt(t) + return whc +} + +// SetNillableCreatedAt sets the "created_at" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableCreatedAt(t *time.Time) *WebhookHistoryCreate { + if t != nil { + whc.SetCreatedAt(*t) + } + return whc +} + +// SetUpdatedAt sets the "updated_at" field. +func (whc *WebhookHistoryCreate) SetUpdatedAt(t time.Time) *WebhookHistoryCreate { + whc.mutation.SetUpdatedAt(t) + return whc +} + +// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableUpdatedAt(t *time.Time) *WebhookHistoryCreate { + if t != nil { + whc.SetUpdatedAt(*t) + } + return whc +} + +// SetCreatedBy sets the "created_by" field. +func (whc *WebhookHistoryCreate) SetCreatedBy(s string) *WebhookHistoryCreate { + whc.mutation.SetCreatedBy(s) + return whc +} + +// SetNillableCreatedBy sets the "created_by" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableCreatedBy(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetCreatedBy(*s) + } + return whc +} + +// SetUpdatedBy sets the "updated_by" field. +func (whc *WebhookHistoryCreate) SetUpdatedBy(s string) *WebhookHistoryCreate { + whc.mutation.SetUpdatedBy(s) + return whc +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableUpdatedBy(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetUpdatedBy(*s) + } + return whc +} + +// SetMappingID sets the "mapping_id" field. +func (whc *WebhookHistoryCreate) SetMappingID(s string) *WebhookHistoryCreate { + whc.mutation.SetMappingID(s) + return whc +} + +// SetNillableMappingID sets the "mapping_id" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableMappingID(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetMappingID(*s) + } + return whc +} + +// SetTags sets the "tags" field. +func (whc *WebhookHistoryCreate) SetTags(s []string) *WebhookHistoryCreate { + whc.mutation.SetTags(s) + return whc +} + +// SetDeletedAt sets the "deleted_at" field. +func (whc *WebhookHistoryCreate) SetDeletedAt(t time.Time) *WebhookHistoryCreate { + whc.mutation.SetDeletedAt(t) + return whc +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableDeletedAt(t *time.Time) *WebhookHistoryCreate { + if t != nil { + whc.SetDeletedAt(*t) + } + return whc +} + +// SetDeletedBy sets the "deleted_by" field. +func (whc *WebhookHistoryCreate) SetDeletedBy(s string) *WebhookHistoryCreate { + whc.mutation.SetDeletedBy(s) + return whc +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableDeletedBy(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetDeletedBy(*s) + } + return whc +} + +// SetOwnerID sets the "owner_id" field. +func (whc *WebhookHistoryCreate) SetOwnerID(s string) *WebhookHistoryCreate { + whc.mutation.SetOwnerID(s) + return whc +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableOwnerID(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetOwnerID(*s) + } + return whc +} + +// SetName sets the "name" field. +func (whc *WebhookHistoryCreate) SetName(s string) *WebhookHistoryCreate { + whc.mutation.SetName(s) + return whc +} + +// SetDescription sets the "description" field. +func (whc *WebhookHistoryCreate) SetDescription(s string) *WebhookHistoryCreate { + whc.mutation.SetDescription(s) + return whc +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableDescription(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetDescription(*s) + } + return whc +} + +// SetDestinationURL sets the "destination_url" field. +func (whc *WebhookHistoryCreate) SetDestinationURL(s string) *WebhookHistoryCreate { + whc.mutation.SetDestinationURL(s) + return whc +} + +// SetEnabled sets the "enabled" field. +func (whc *WebhookHistoryCreate) SetEnabled(b bool) *WebhookHistoryCreate { + whc.mutation.SetEnabled(b) + return whc +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableEnabled(b *bool) *WebhookHistoryCreate { + if b != nil { + whc.SetEnabled(*b) + } + return whc +} + +// SetCallback sets the "callback" field. +func (whc *WebhookHistoryCreate) SetCallback(s string) *WebhookHistoryCreate { + whc.mutation.SetCallback(s) + return whc +} + +// SetNillableCallback sets the "callback" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableCallback(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetCallback(*s) + } + return whc +} + +// SetExpiresAt sets the "expires_at" field. +func (whc *WebhookHistoryCreate) SetExpiresAt(t time.Time) *WebhookHistoryCreate { + whc.mutation.SetExpiresAt(t) + return whc +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableExpiresAt(t *time.Time) *WebhookHistoryCreate { + if t != nil { + whc.SetExpiresAt(*t) + } + return whc +} + +// SetSecret sets the "secret" field. +func (whc *WebhookHistoryCreate) SetSecret(b []byte) *WebhookHistoryCreate { + whc.mutation.SetSecret(b) + return whc +} + +// SetFailures sets the "failures" field. +func (whc *WebhookHistoryCreate) SetFailures(i int) *WebhookHistoryCreate { + whc.mutation.SetFailures(i) + return whc +} + +// SetNillableFailures sets the "failures" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableFailures(i *int) *WebhookHistoryCreate { + if i != nil { + whc.SetFailures(*i) + } + return whc +} + +// SetLastError sets the "last_error" field. +func (whc *WebhookHistoryCreate) SetLastError(s string) *WebhookHistoryCreate { + whc.mutation.SetLastError(s) + return whc +} + +// SetNillableLastError sets the "last_error" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableLastError(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetLastError(*s) + } + return whc +} + +// SetLastResponse sets the "last_response" field. +func (whc *WebhookHistoryCreate) SetLastResponse(s string) *WebhookHistoryCreate { + whc.mutation.SetLastResponse(s) + return whc +} + +// SetNillableLastResponse sets the "last_response" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableLastResponse(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetLastResponse(*s) + } + return whc +} + +// SetID sets the "id" field. +func (whc *WebhookHistoryCreate) SetID(s string) *WebhookHistoryCreate { + whc.mutation.SetID(s) + return whc +} + +// SetNillableID sets the "id" field if the given value is not nil. +func (whc *WebhookHistoryCreate) SetNillableID(s *string) *WebhookHistoryCreate { + if s != nil { + whc.SetID(*s) + } + return whc +} + +// Mutation returns the WebhookHistoryMutation object of the builder. +func (whc *WebhookHistoryCreate) Mutation() *WebhookHistoryMutation { + return whc.mutation +} + +// Save creates the WebhookHistory in the database. +func (whc *WebhookHistoryCreate) Save(ctx context.Context) (*WebhookHistory, error) { + if err := whc.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, whc.sqlSave, whc.mutation, whc.hooks) +} + +// SaveX calls Save and panics if Save returns an error. +func (whc *WebhookHistoryCreate) SaveX(ctx context.Context) *WebhookHistory { + v, err := whc.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (whc *WebhookHistoryCreate) Exec(ctx context.Context) error { + _, err := whc.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (whc *WebhookHistoryCreate) ExecX(ctx context.Context) { + if err := whc.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (whc *WebhookHistoryCreate) defaults() error { + if _, ok := whc.mutation.HistoryTime(); !ok { + if webhookhistory.DefaultHistoryTime == nil { + return fmt.Errorf("generated: uninitialized webhookhistory.DefaultHistoryTime (forgotten import generated/runtime?)") + } + v := webhookhistory.DefaultHistoryTime() + whc.mutation.SetHistoryTime(v) + } + if _, ok := whc.mutation.CreatedAt(); !ok { + if webhookhistory.DefaultCreatedAt == nil { + return fmt.Errorf("generated: uninitialized webhookhistory.DefaultCreatedAt (forgotten import generated/runtime?)") + } + v := webhookhistory.DefaultCreatedAt() + whc.mutation.SetCreatedAt(v) + } + if _, ok := whc.mutation.UpdatedAt(); !ok { + if webhookhistory.DefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webhookhistory.DefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webhookhistory.DefaultUpdatedAt() + whc.mutation.SetUpdatedAt(v) + } + if _, ok := whc.mutation.MappingID(); !ok { + if webhookhistory.DefaultMappingID == nil { + return fmt.Errorf("generated: uninitialized webhookhistory.DefaultMappingID (forgotten import generated/runtime?)") + } + v := webhookhistory.DefaultMappingID() + whc.mutation.SetMappingID(v) + } + if _, ok := whc.mutation.Tags(); !ok { + v := webhookhistory.DefaultTags + whc.mutation.SetTags(v) + } + if _, ok := whc.mutation.Enabled(); !ok { + v := webhookhistory.DefaultEnabled + whc.mutation.SetEnabled(v) + } + if _, ok := whc.mutation.Failures(); !ok { + v := webhookhistory.DefaultFailures + whc.mutation.SetFailures(v) + } + if _, ok := whc.mutation.ID(); !ok { + if webhookhistory.DefaultID == nil { + return fmt.Errorf("generated: uninitialized webhookhistory.DefaultID (forgotten import generated/runtime?)") + } + v := webhookhistory.DefaultID() + whc.mutation.SetID(v) + } + return nil +} + +// check runs all checks and user-defined validators on the builder. +func (whc *WebhookHistoryCreate) check() error { + if _, ok := whc.mutation.HistoryTime(); !ok { + return &ValidationError{Name: "history_time", err: errors.New(`generated: missing required field "WebhookHistory.history_time"`)} + } + if _, ok := whc.mutation.Operation(); !ok { + return &ValidationError{Name: "operation", err: errors.New(`generated: missing required field "WebhookHistory.operation"`)} + } + if v, ok := whc.mutation.Operation(); ok { + if err := webhookhistory.OperationValidator(v); err != nil { + return &ValidationError{Name: "operation", err: fmt.Errorf(`generated: validator failed for field "WebhookHistory.operation": %w`, err)} + } + } + if _, ok := whc.mutation.MappingID(); !ok { + return &ValidationError{Name: "mapping_id", err: errors.New(`generated: missing required field "WebhookHistory.mapping_id"`)} + } + if _, ok := whc.mutation.Name(); !ok { + return &ValidationError{Name: "name", err: errors.New(`generated: missing required field "WebhookHistory.name"`)} + } + if _, ok := whc.mutation.DestinationURL(); !ok { + return &ValidationError{Name: "destination_url", err: errors.New(`generated: missing required field "WebhookHistory.destination_url"`)} + } + if _, ok := whc.mutation.Enabled(); !ok { + return &ValidationError{Name: "enabled", err: errors.New(`generated: missing required field "WebhookHistory.enabled"`)} + } + return nil +} + +func (whc *WebhookHistoryCreate) sqlSave(ctx context.Context) (*WebhookHistory, error) { + if err := whc.check(); err != nil { + return nil, err + } + _node, _spec := whc.createSpec() + if err := sqlgraph.CreateNode(ctx, whc.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.(string); ok { + _node.ID = id + } else { + return nil, fmt.Errorf("unexpected WebhookHistory.ID type: %T", _spec.ID.Value) + } + } + whc.mutation.id = &_node.ID + whc.mutation.done = true + return _node, nil +} + +func (whc *WebhookHistoryCreate) createSpec() (*WebhookHistory, *sqlgraph.CreateSpec) { + var ( + _node = &WebhookHistory{config: whc.config} + _spec = sqlgraph.NewCreateSpec(webhookhistory.Table, sqlgraph.NewFieldSpec(webhookhistory.FieldID, field.TypeString)) + ) + _spec.Schema = whc.schemaConfig.WebhookHistory + if id, ok := whc.mutation.ID(); ok { + _node.ID = id + _spec.ID.Value = id + } + if value, ok := whc.mutation.HistoryTime(); ok { + _spec.SetField(webhookhistory.FieldHistoryTime, field.TypeTime, value) + _node.HistoryTime = value + } + if value, ok := whc.mutation.Ref(); ok { + _spec.SetField(webhookhistory.FieldRef, field.TypeString, value) + _node.Ref = value + } + if value, ok := whc.mutation.Operation(); ok { + _spec.SetField(webhookhistory.FieldOperation, field.TypeEnum, value) + _node.Operation = value + } + if value, ok := whc.mutation.CreatedAt(); ok { + _spec.SetField(webhookhistory.FieldCreatedAt, field.TypeTime, value) + _node.CreatedAt = value + } + if value, ok := whc.mutation.UpdatedAt(); ok { + _spec.SetField(webhookhistory.FieldUpdatedAt, field.TypeTime, value) + _node.UpdatedAt = value + } + if value, ok := whc.mutation.CreatedBy(); ok { + _spec.SetField(webhookhistory.FieldCreatedBy, field.TypeString, value) + _node.CreatedBy = value + } + if value, ok := whc.mutation.UpdatedBy(); ok { + _spec.SetField(webhookhistory.FieldUpdatedBy, field.TypeString, value) + _node.UpdatedBy = value + } + if value, ok := whc.mutation.MappingID(); ok { + _spec.SetField(webhookhistory.FieldMappingID, field.TypeString, value) + _node.MappingID = value + } + if value, ok := whc.mutation.Tags(); ok { + _spec.SetField(webhookhistory.FieldTags, field.TypeJSON, value) + _node.Tags = value + } + if value, ok := whc.mutation.DeletedAt(); ok { + _spec.SetField(webhookhistory.FieldDeletedAt, field.TypeTime, value) + _node.DeletedAt = value + } + if value, ok := whc.mutation.DeletedBy(); ok { + _spec.SetField(webhookhistory.FieldDeletedBy, field.TypeString, value) + _node.DeletedBy = value + } + if value, ok := whc.mutation.OwnerID(); ok { + _spec.SetField(webhookhistory.FieldOwnerID, field.TypeString, value) + _node.OwnerID = value + } + if value, ok := whc.mutation.Name(); ok { + _spec.SetField(webhookhistory.FieldName, field.TypeString, value) + _node.Name = value + } + if value, ok := whc.mutation.Description(); ok { + _spec.SetField(webhookhistory.FieldDescription, field.TypeString, value) + _node.Description = value + } + if value, ok := whc.mutation.DestinationURL(); ok { + _spec.SetField(webhookhistory.FieldDestinationURL, field.TypeString, value) + _node.DestinationURL = value + } + if value, ok := whc.mutation.Enabled(); ok { + _spec.SetField(webhookhistory.FieldEnabled, field.TypeBool, value) + _node.Enabled = value + } + if value, ok := whc.mutation.Callback(); ok { + _spec.SetField(webhookhistory.FieldCallback, field.TypeString, value) + _node.Callback = value + } + if value, ok := whc.mutation.ExpiresAt(); ok { + _spec.SetField(webhookhistory.FieldExpiresAt, field.TypeTime, value) + _node.ExpiresAt = value + } + if value, ok := whc.mutation.Secret(); ok { + _spec.SetField(webhookhistory.FieldSecret, field.TypeBytes, value) + _node.Secret = value + } + if value, ok := whc.mutation.Failures(); ok { + _spec.SetField(webhookhistory.FieldFailures, field.TypeInt, value) + _node.Failures = value + } + if value, ok := whc.mutation.LastError(); ok { + _spec.SetField(webhookhistory.FieldLastError, field.TypeString, value) + _node.LastError = value + } + if value, ok := whc.mutation.LastResponse(); ok { + _spec.SetField(webhookhistory.FieldLastResponse, field.TypeString, value) + _node.LastResponse = value + } + return _node, _spec +} + +// WebhookHistoryCreateBulk is the builder for creating many WebhookHistory entities in bulk. +type WebhookHistoryCreateBulk struct { + config + err error + builders []*WebhookHistoryCreate +} + +// Save creates the WebhookHistory entities in the database. +func (whcb *WebhookHistoryCreateBulk) Save(ctx context.Context) ([]*WebhookHistory, error) { + if whcb.err != nil { + return nil, whcb.err + } + specs := make([]*sqlgraph.CreateSpec, len(whcb.builders)) + nodes := make([]*WebhookHistory, len(whcb.builders)) + mutators := make([]Mutator, len(whcb.builders)) + for i := range whcb.builders { + func(i int, root context.Context) { + builder := whcb.builders[i] + builder.defaults() + var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { + mutation, ok := m.(*WebhookHistoryMutation) + 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, whcb.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, whcb.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, whcb.builders[0].mutation); err != nil { + return nil, err + } + } + return nodes, nil +} + +// SaveX is like Save, but panics if an error occurs. +func (whcb *WebhookHistoryCreateBulk) SaveX(ctx context.Context) []*WebhookHistory { + v, err := whcb.Save(ctx) + if err != nil { + panic(err) + } + return v +} + +// Exec executes the query. +func (whcb *WebhookHistoryCreateBulk) Exec(ctx context.Context) error { + _, err := whcb.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (whcb *WebhookHistoryCreateBulk) ExecX(ctx context.Context) { + if err := whcb.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/webhookhistory_delete.go b/internal/ent/generated/webhookhistory_delete.go new file mode 100644 index 0000000..fb8c856 --- /dev/null +++ b/internal/ent/generated/webhookhistory_delete.go @@ -0,0 +1,92 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + + "github.com/theopenlane/core/internal/ent/generated/internal" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" +) + +// WebhookHistoryDelete is the builder for deleting a WebhookHistory entity. +type WebhookHistoryDelete struct { + config + hooks []Hook + mutation *WebhookHistoryMutation +} + +// Where appends a list predicates to the WebhookHistoryDelete builder. +func (whd *WebhookHistoryDelete) Where(ps ...predicate.WebhookHistory) *WebhookHistoryDelete { + whd.mutation.Where(ps...) + return whd +} + +// Exec executes the deletion query and returns how many vertices were deleted. +func (whd *WebhookHistoryDelete) Exec(ctx context.Context) (int, error) { + return withHooks(ctx, whd.sqlExec, whd.mutation, whd.hooks) +} + +// ExecX is like Exec, but panics if an error occurs. +func (whd *WebhookHistoryDelete) ExecX(ctx context.Context) int { + n, err := whd.Exec(ctx) + if err != nil { + panic(err) + } + return n +} + +func (whd *WebhookHistoryDelete) sqlExec(ctx context.Context) (int, error) { + _spec := sqlgraph.NewDeleteSpec(webhookhistory.Table, sqlgraph.NewFieldSpec(webhookhistory.FieldID, field.TypeString)) + _spec.Node.Schema = whd.schemaConfig.WebhookHistory + ctx = internal.NewSchemaConfigContext(ctx, whd.schemaConfig) + if ps := whd.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + affected, err := sqlgraph.DeleteNodes(ctx, whd.driver, _spec) + if err != nil && sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + whd.mutation.done = true + return affected, err +} + +// WebhookHistoryDeleteOne is the builder for deleting a single WebhookHistory entity. +type WebhookHistoryDeleteOne struct { + whd *WebhookHistoryDelete +} + +// Where appends a list predicates to the WebhookHistoryDelete builder. +func (whdo *WebhookHistoryDeleteOne) Where(ps ...predicate.WebhookHistory) *WebhookHistoryDeleteOne { + whdo.whd.mutation.Where(ps...) + return whdo +} + +// Exec executes the deletion query. +func (whdo *WebhookHistoryDeleteOne) Exec(ctx context.Context) error { + n, err := whdo.whd.Exec(ctx) + switch { + case err != nil: + return err + case n == 0: + return &NotFoundError{webhookhistory.Label} + default: + return nil + } +} + +// ExecX is like Exec, but panics if an error occurs. +func (whdo *WebhookHistoryDeleteOne) ExecX(ctx context.Context) { + if err := whdo.Exec(ctx); err != nil { + panic(err) + } +} diff --git a/internal/ent/generated/webhookhistory_query.go b/internal/ent/generated/webhookhistory_query.go new file mode 100644 index 0000000..7d640d3 --- /dev/null +++ b/internal/ent/generated/webhookhistory_query.go @@ -0,0 +1,556 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "math" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// WebhookHistoryQuery is the builder for querying WebhookHistory entities. +type WebhookHistoryQuery struct { + config + ctx *QueryContext + order []webhookhistory.OrderOption + inters []Interceptor + predicates []predicate.WebhookHistory + modifiers []func(*sql.Selector) + loadTotal []func(context.Context, []*WebhookHistory) error + // intermediate query (i.e. traversal path). + sql *sql.Selector + path func(context.Context) (*sql.Selector, error) +} + +// Where adds a new predicate for the WebhookHistoryQuery builder. +func (whq *WebhookHistoryQuery) Where(ps ...predicate.WebhookHistory) *WebhookHistoryQuery { + whq.predicates = append(whq.predicates, ps...) + return whq +} + +// Limit the number of records to be returned by this query. +func (whq *WebhookHistoryQuery) Limit(limit int) *WebhookHistoryQuery { + whq.ctx.Limit = &limit + return whq +} + +// Offset to start from. +func (whq *WebhookHistoryQuery) Offset(offset int) *WebhookHistoryQuery { + whq.ctx.Offset = &offset + return whq +} + +// 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 (whq *WebhookHistoryQuery) Unique(unique bool) *WebhookHistoryQuery { + whq.ctx.Unique = &unique + return whq +} + +// Order specifies how the records should be ordered. +func (whq *WebhookHistoryQuery) Order(o ...webhookhistory.OrderOption) *WebhookHistoryQuery { + whq.order = append(whq.order, o...) + return whq +} + +// First returns the first WebhookHistory entity from the query. +// Returns a *NotFoundError when no WebhookHistory was found. +func (whq *WebhookHistoryQuery) First(ctx context.Context) (*WebhookHistory, error) { + nodes, err := whq.Limit(1).All(setContextOp(ctx, whq.ctx, ent.OpQueryFirst)) + if err != nil { + return nil, err + } + if len(nodes) == 0 { + return nil, &NotFoundError{webhookhistory.Label} + } + return nodes[0], nil +} + +// FirstX is like First, but panics if an error occurs. +func (whq *WebhookHistoryQuery) FirstX(ctx context.Context) *WebhookHistory { + node, err := whq.First(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return node +} + +// FirstID returns the first WebhookHistory ID from the query. +// Returns a *NotFoundError when no WebhookHistory ID was found. +func (whq *WebhookHistoryQuery) FirstID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = whq.Limit(1).IDs(setContextOp(ctx, whq.ctx, ent.OpQueryFirstID)); err != nil { + return + } + if len(ids) == 0 { + err = &NotFoundError{webhookhistory.Label} + return + } + return ids[0], nil +} + +// FirstIDX is like FirstID, but panics if an error occurs. +func (whq *WebhookHistoryQuery) FirstIDX(ctx context.Context) string { + id, err := whq.FirstID(ctx) + if err != nil && !IsNotFound(err) { + panic(err) + } + return id +} + +// Only returns a single WebhookHistory entity found by the query, ensuring it only returns one. +// Returns a *NotSingularError when more than one WebhookHistory entity is found. +// Returns a *NotFoundError when no WebhookHistory entities are found. +func (whq *WebhookHistoryQuery) Only(ctx context.Context) (*WebhookHistory, error) { + nodes, err := whq.Limit(2).All(setContextOp(ctx, whq.ctx, ent.OpQueryOnly)) + if err != nil { + return nil, err + } + switch len(nodes) { + case 1: + return nodes[0], nil + case 0: + return nil, &NotFoundError{webhookhistory.Label} + default: + return nil, &NotSingularError{webhookhistory.Label} + } +} + +// OnlyX is like Only, but panics if an error occurs. +func (whq *WebhookHistoryQuery) OnlyX(ctx context.Context) *WebhookHistory { + node, err := whq.Only(ctx) + if err != nil { + panic(err) + } + return node +} + +// OnlyID is like Only, but returns the only WebhookHistory ID in the query. +// Returns a *NotSingularError when more than one WebhookHistory ID is found. +// Returns a *NotFoundError when no entities are found. +func (whq *WebhookHistoryQuery) OnlyID(ctx context.Context) (id string, err error) { + var ids []string + if ids, err = whq.Limit(2).IDs(setContextOp(ctx, whq.ctx, ent.OpQueryOnlyID)); err != nil { + return + } + switch len(ids) { + case 1: + id = ids[0] + case 0: + err = &NotFoundError{webhookhistory.Label} + default: + err = &NotSingularError{webhookhistory.Label} + } + return +} + +// OnlyIDX is like OnlyID, but panics if an error occurs. +func (whq *WebhookHistoryQuery) OnlyIDX(ctx context.Context) string { + id, err := whq.OnlyID(ctx) + if err != nil { + panic(err) + } + return id +} + +// All executes the query and returns a list of WebhookHistories. +func (whq *WebhookHistoryQuery) All(ctx context.Context) ([]*WebhookHistory, error) { + ctx = setContextOp(ctx, whq.ctx, ent.OpQueryAll) + if err := whq.prepareQuery(ctx); err != nil { + return nil, err + } + qr := querierAll[[]*WebhookHistory, *WebhookHistoryQuery]() + return withInterceptors[[]*WebhookHistory](ctx, whq, qr, whq.inters) +} + +// AllX is like All, but panics if an error occurs. +func (whq *WebhookHistoryQuery) AllX(ctx context.Context) []*WebhookHistory { + nodes, err := whq.All(ctx) + if err != nil { + panic(err) + } + return nodes +} + +// IDs executes the query and returns a list of WebhookHistory IDs. +func (whq *WebhookHistoryQuery) IDs(ctx context.Context) (ids []string, err error) { + if whq.ctx.Unique == nil && whq.path != nil { + whq.Unique(true) + } + ctx = setContextOp(ctx, whq.ctx, ent.OpQueryIDs) + if err = whq.Select(webhookhistory.FieldID).Scan(ctx, &ids); err != nil { + return nil, err + } + return ids, nil +} + +// IDsX is like IDs, but panics if an error occurs. +func (whq *WebhookHistoryQuery) IDsX(ctx context.Context) []string { + ids, err := whq.IDs(ctx) + if err != nil { + panic(err) + } + return ids +} + +// Count returns the count of the given query. +func (whq *WebhookHistoryQuery) Count(ctx context.Context) (int, error) { + ctx = setContextOp(ctx, whq.ctx, ent.OpQueryCount) + if err := whq.prepareQuery(ctx); err != nil { + return 0, err + } + return withInterceptors[int](ctx, whq, querierCount[*WebhookHistoryQuery](), whq.inters) +} + +// CountX is like Count, but panics if an error occurs. +func (whq *WebhookHistoryQuery) CountX(ctx context.Context) int { + count, err := whq.Count(ctx) + if err != nil { + panic(err) + } + return count +} + +// Exist returns true if the query has elements in the graph. +func (whq *WebhookHistoryQuery) Exist(ctx context.Context) (bool, error) { + ctx = setContextOp(ctx, whq.ctx, ent.OpQueryExist) + switch _, err := whq.FirstID(ctx); { + case IsNotFound(err): + return false, nil + case err != nil: + return false, fmt.Errorf("generated: check existence: %w", err) + default: + return true, nil + } +} + +// ExistX is like Exist, but panics if an error occurs. +func (whq *WebhookHistoryQuery) ExistX(ctx context.Context) bool { + exist, err := whq.Exist(ctx) + if err != nil { + panic(err) + } + return exist +} + +// Clone returns a duplicate of the WebhookHistoryQuery builder, including all associated steps. It can be +// used to prepare common query builders and use them differently after the clone is made. +func (whq *WebhookHistoryQuery) Clone() *WebhookHistoryQuery { + if whq == nil { + return nil + } + return &WebhookHistoryQuery{ + config: whq.config, + ctx: whq.ctx.Clone(), + order: append([]webhookhistory.OrderOption{}, whq.order...), + inters: append([]Interceptor{}, whq.inters...), + predicates: append([]predicate.WebhookHistory{}, whq.predicates...), + // clone intermediate query. + sql: whq.sql.Clone(), + path: whq.path, + } +} + +// 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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// Count int `json:"count,omitempty"` +// } +// +// client.WebhookHistory.Query(). +// GroupBy(webhookhistory.FieldHistoryTime). +// Aggregate(generated.Count()). +// Scan(ctx, &v) +func (whq *WebhookHistoryQuery) GroupBy(field string, fields ...string) *WebhookHistoryGroupBy { + whq.ctx.Fields = append([]string{field}, fields...) + grbuild := &WebhookHistoryGroupBy{build: whq} + grbuild.flds = &whq.ctx.Fields + grbuild.label = webhookhistory.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 { +// HistoryTime time.Time `json:"history_time,omitempty"` +// } +// +// client.WebhookHistory.Query(). +// Select(webhookhistory.FieldHistoryTime). +// Scan(ctx, &v) +func (whq *WebhookHistoryQuery) Select(fields ...string) *WebhookHistorySelect { + whq.ctx.Fields = append(whq.ctx.Fields, fields...) + sbuild := &WebhookHistorySelect{WebhookHistoryQuery: whq} + sbuild.label = webhookhistory.Label + sbuild.flds, sbuild.scan = &whq.ctx.Fields, sbuild.Scan + return sbuild +} + +// Aggregate returns a WebhookHistorySelect configured with the given aggregations. +func (whq *WebhookHistoryQuery) Aggregate(fns ...AggregateFunc) *WebhookHistorySelect { + return whq.Select().Aggregate(fns...) +} + +func (whq *WebhookHistoryQuery) prepareQuery(ctx context.Context) error { + for _, inter := range whq.inters { + if inter == nil { + return fmt.Errorf("generated: uninitialized interceptor (forgotten import generated/runtime?)") + } + if trv, ok := inter.(Traverser); ok { + if err := trv.Traverse(ctx, whq); err != nil { + return err + } + } + } + for _, f := range whq.ctx.Fields { + if !webhookhistory.ValidColumn(f) { + return &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + } + if whq.path != nil { + prev, err := whq.path(ctx) + if err != nil { + return err + } + whq.sql = prev + } + if webhookhistory.Policy == nil { + return errors.New("generated: uninitialized webhookhistory.Policy (forgotten import generated/runtime?)") + } + if err := webhookhistory.Policy.EvalQuery(ctx, whq); err != nil { + return err + } + return nil +} + +func (whq *WebhookHistoryQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*WebhookHistory, error) { + var ( + nodes = []*WebhookHistory{} + _spec = whq.querySpec() + ) + _spec.ScanValues = func(columns []string) ([]any, error) { + return (*WebhookHistory).scanValues(nil, columns) + } + _spec.Assign = func(columns []string, values []any) error { + node := &WebhookHistory{config: whq.config} + nodes = append(nodes, node) + return node.assignValues(columns, values) + } + _spec.Node.Schema = whq.schemaConfig.WebhookHistory + ctx = internal.NewSchemaConfigContext(ctx, whq.schemaConfig) + if len(whq.modifiers) > 0 { + _spec.Modifiers = whq.modifiers + } + for i := range hooks { + hooks[i](ctx, _spec) + } + if err := sqlgraph.QueryNodes(ctx, whq.driver, _spec); err != nil { + return nil, err + } + if len(nodes) == 0 { + return nodes, nil + } + for i := range whq.loadTotal { + if err := whq.loadTotal[i](ctx, nodes); err != nil { + return nil, err + } + } + return nodes, nil +} + +func (whq *WebhookHistoryQuery) sqlCount(ctx context.Context) (int, error) { + _spec := whq.querySpec() + _spec.Node.Schema = whq.schemaConfig.WebhookHistory + ctx = internal.NewSchemaConfigContext(ctx, whq.schemaConfig) + if len(whq.modifiers) > 0 { + _spec.Modifiers = whq.modifiers + } + _spec.Node.Columns = whq.ctx.Fields + if len(whq.ctx.Fields) > 0 { + _spec.Unique = whq.ctx.Unique != nil && *whq.ctx.Unique + } + return sqlgraph.CountNodes(ctx, whq.driver, _spec) +} + +func (whq *WebhookHistoryQuery) querySpec() *sqlgraph.QuerySpec { + _spec := sqlgraph.NewQuerySpec(webhookhistory.Table, webhookhistory.Columns, sqlgraph.NewFieldSpec(webhookhistory.FieldID, field.TypeString)) + _spec.From = whq.sql + if unique := whq.ctx.Unique; unique != nil { + _spec.Unique = *unique + } else if whq.path != nil { + _spec.Unique = true + } + if fields := whq.ctx.Fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, webhookhistory.FieldID) + for i := range fields { + if fields[i] != webhookhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, fields[i]) + } + } + } + if ps := whq.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if limit := whq.ctx.Limit; limit != nil { + _spec.Limit = *limit + } + if offset := whq.ctx.Offset; offset != nil { + _spec.Offset = *offset + } + if ps := whq.order; len(ps) > 0 { + _spec.Order = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + return _spec +} + +func (whq *WebhookHistoryQuery) sqlQuery(ctx context.Context) *sql.Selector { + builder := sql.Dialect(whq.driver.Dialect()) + t1 := builder.Table(webhookhistory.Table) + columns := whq.ctx.Fields + if len(columns) == 0 { + columns = webhookhistory.Columns + } + selector := builder.Select(t1.Columns(columns...)...).From(t1) + if whq.sql != nil { + selector = whq.sql + selector.Select(selector.Columns(columns...)...) + } + if whq.ctx.Unique != nil && *whq.ctx.Unique { + selector.Distinct() + } + t1.Schema(whq.schemaConfig.WebhookHistory) + ctx = internal.NewSchemaConfigContext(ctx, whq.schemaConfig) + selector.WithContext(ctx) + for _, p := range whq.predicates { + p(selector) + } + for _, p := range whq.order { + p(selector) + } + if offset := whq.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 := whq.ctx.Limit; limit != nil { + selector.Limit(*limit) + } + return selector +} + +// WebhookHistoryGroupBy is the group-by builder for WebhookHistory entities. +type WebhookHistoryGroupBy struct { + selector + build *WebhookHistoryQuery +} + +// Aggregate adds the given aggregation functions to the group-by query. +func (whgb *WebhookHistoryGroupBy) Aggregate(fns ...AggregateFunc) *WebhookHistoryGroupBy { + whgb.fns = append(whgb.fns, fns...) + return whgb +} + +// Scan applies the selector query and scans the result into the given value. +func (whgb *WebhookHistoryGroupBy) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, whgb.build.ctx, ent.OpQueryGroupBy) + if err := whgb.build.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*WebhookHistoryQuery, *WebhookHistoryGroupBy](ctx, whgb.build, whgb, whgb.build.inters, v) +} + +func (whgb *WebhookHistoryGroupBy) sqlScan(ctx context.Context, root *WebhookHistoryQuery, v any) error { + selector := root.sqlQuery(ctx).Select() + aggregation := make([]string, 0, len(whgb.fns)) + for _, fn := range whgb.fns { + aggregation = append(aggregation, fn(selector)) + } + if len(selector.SelectedColumns()) == 0 { + columns := make([]string, 0, len(*whgb.flds)+len(whgb.fns)) + for _, f := range *whgb.flds { + columns = append(columns, selector.C(f)) + } + columns = append(columns, aggregation...) + selector.Select(columns...) + } + selector.GroupBy(selector.Columns(*whgb.flds...)...) + if err := selector.Err(); err != nil { + return err + } + rows := &sql.Rows{} + query, args := selector.Query() + if err := whgb.build.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} + +// WebhookHistorySelect is the builder for selecting fields of WebhookHistory entities. +type WebhookHistorySelect struct { + *WebhookHistoryQuery + selector +} + +// Aggregate adds the given aggregation functions to the selector query. +func (whs *WebhookHistorySelect) Aggregate(fns ...AggregateFunc) *WebhookHistorySelect { + whs.fns = append(whs.fns, fns...) + return whs +} + +// Scan applies the selector query and scans the result into the given value. +func (whs *WebhookHistorySelect) Scan(ctx context.Context, v any) error { + ctx = setContextOp(ctx, whs.ctx, ent.OpQuerySelect) + if err := whs.prepareQuery(ctx); err != nil { + return err + } + return scanWithInterceptors[*WebhookHistoryQuery, *WebhookHistorySelect](ctx, whs.WebhookHistoryQuery, whs, whs.inters, v) +} + +func (whs *WebhookHistorySelect) sqlScan(ctx context.Context, root *WebhookHistoryQuery, v any) error { + selector := root.sqlQuery(ctx) + aggregation := make([]string, 0, len(whs.fns)) + for _, fn := range whs.fns { + aggregation = append(aggregation, fn(selector)) + } + switch n := len(*whs.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 := whs.driver.Query(ctx, query, args, rows); err != nil { + return err + } + defer rows.Close() + return sql.ScanSlice(rows, v) +} diff --git a/internal/ent/generated/webhookhistory_update.go b/internal/ent/generated/webhookhistory_update.go new file mode 100644 index 0000000..6ba309d --- /dev/null +++ b/internal/ent/generated/webhookhistory_update.go @@ -0,0 +1,1003 @@ +// Code generated by ent, DO NOT EDIT. + +package generated + +import ( + "context" + "errors" + "fmt" + "time" + + "entgo.io/ent/dialect/sql" + "entgo.io/ent/dialect/sql/sqlgraph" + "entgo.io/ent/dialect/sql/sqljson" + "entgo.io/ent/schema/field" + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/webhookhistory" + + "github.com/theopenlane/core/internal/ent/generated/internal" +) + +// WebhookHistoryUpdate is the builder for updating WebhookHistory entities. +type WebhookHistoryUpdate struct { + config + hooks []Hook + mutation *WebhookHistoryMutation +} + +// Where appends a list predicates to the WebhookHistoryUpdate builder. +func (whu *WebhookHistoryUpdate) Where(ps ...predicate.WebhookHistory) *WebhookHistoryUpdate { + whu.mutation.Where(ps...) + return whu +} + +// SetUpdatedAt sets the "updated_at" field. +func (whu *WebhookHistoryUpdate) SetUpdatedAt(t time.Time) *WebhookHistoryUpdate { + whu.mutation.SetUpdatedAt(t) + return whu +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (whu *WebhookHistoryUpdate) ClearUpdatedAt() *WebhookHistoryUpdate { + whu.mutation.ClearUpdatedAt() + return whu +} + +// SetUpdatedBy sets the "updated_by" field. +func (whu *WebhookHistoryUpdate) SetUpdatedBy(s string) *WebhookHistoryUpdate { + whu.mutation.SetUpdatedBy(s) + return whu +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableUpdatedBy(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetUpdatedBy(*s) + } + return whu +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (whu *WebhookHistoryUpdate) ClearUpdatedBy() *WebhookHistoryUpdate { + whu.mutation.ClearUpdatedBy() + return whu +} + +// SetTags sets the "tags" field. +func (whu *WebhookHistoryUpdate) SetTags(s []string) *WebhookHistoryUpdate { + whu.mutation.SetTags(s) + return whu +} + +// AppendTags appends s to the "tags" field. +func (whu *WebhookHistoryUpdate) AppendTags(s []string) *WebhookHistoryUpdate { + whu.mutation.AppendTags(s) + return whu +} + +// ClearTags clears the value of the "tags" field. +func (whu *WebhookHistoryUpdate) ClearTags() *WebhookHistoryUpdate { + whu.mutation.ClearTags() + return whu +} + +// SetDeletedAt sets the "deleted_at" field. +func (whu *WebhookHistoryUpdate) SetDeletedAt(t time.Time) *WebhookHistoryUpdate { + whu.mutation.SetDeletedAt(t) + return whu +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableDeletedAt(t *time.Time) *WebhookHistoryUpdate { + if t != nil { + whu.SetDeletedAt(*t) + } + return whu +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (whu *WebhookHistoryUpdate) ClearDeletedAt() *WebhookHistoryUpdate { + whu.mutation.ClearDeletedAt() + return whu +} + +// SetDeletedBy sets the "deleted_by" field. +func (whu *WebhookHistoryUpdate) SetDeletedBy(s string) *WebhookHistoryUpdate { + whu.mutation.SetDeletedBy(s) + return whu +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableDeletedBy(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetDeletedBy(*s) + } + return whu +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (whu *WebhookHistoryUpdate) ClearDeletedBy() *WebhookHistoryUpdate { + whu.mutation.ClearDeletedBy() + return whu +} + +// SetOwnerID sets the "owner_id" field. +func (whu *WebhookHistoryUpdate) SetOwnerID(s string) *WebhookHistoryUpdate { + whu.mutation.SetOwnerID(s) + return whu +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableOwnerID(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetOwnerID(*s) + } + return whu +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (whu *WebhookHistoryUpdate) ClearOwnerID() *WebhookHistoryUpdate { + whu.mutation.ClearOwnerID() + return whu +} + +// SetName sets the "name" field. +func (whu *WebhookHistoryUpdate) SetName(s string) *WebhookHistoryUpdate { + whu.mutation.SetName(s) + return whu +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableName(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetName(*s) + } + return whu +} + +// SetDescription sets the "description" field. +func (whu *WebhookHistoryUpdate) SetDescription(s string) *WebhookHistoryUpdate { + whu.mutation.SetDescription(s) + return whu +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableDescription(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetDescription(*s) + } + return whu +} + +// ClearDescription clears the value of the "description" field. +func (whu *WebhookHistoryUpdate) ClearDescription() *WebhookHistoryUpdate { + whu.mutation.ClearDescription() + return whu +} + +// SetDestinationURL sets the "destination_url" field. +func (whu *WebhookHistoryUpdate) SetDestinationURL(s string) *WebhookHistoryUpdate { + whu.mutation.SetDestinationURL(s) + return whu +} + +// SetNillableDestinationURL sets the "destination_url" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableDestinationURL(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetDestinationURL(*s) + } + return whu +} + +// SetEnabled sets the "enabled" field. +func (whu *WebhookHistoryUpdate) SetEnabled(b bool) *WebhookHistoryUpdate { + whu.mutation.SetEnabled(b) + return whu +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableEnabled(b *bool) *WebhookHistoryUpdate { + if b != nil { + whu.SetEnabled(*b) + } + return whu +} + +// SetCallback sets the "callback" field. +func (whu *WebhookHistoryUpdate) SetCallback(s string) *WebhookHistoryUpdate { + whu.mutation.SetCallback(s) + return whu +} + +// SetNillableCallback sets the "callback" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableCallback(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetCallback(*s) + } + return whu +} + +// ClearCallback clears the value of the "callback" field. +func (whu *WebhookHistoryUpdate) ClearCallback() *WebhookHistoryUpdate { + whu.mutation.ClearCallback() + return whu +} + +// SetExpiresAt sets the "expires_at" field. +func (whu *WebhookHistoryUpdate) SetExpiresAt(t time.Time) *WebhookHistoryUpdate { + whu.mutation.SetExpiresAt(t) + return whu +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableExpiresAt(t *time.Time) *WebhookHistoryUpdate { + if t != nil { + whu.SetExpiresAt(*t) + } + return whu +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (whu *WebhookHistoryUpdate) ClearExpiresAt() *WebhookHistoryUpdate { + whu.mutation.ClearExpiresAt() + return whu +} + +// SetSecret sets the "secret" field. +func (whu *WebhookHistoryUpdate) SetSecret(b []byte) *WebhookHistoryUpdate { + whu.mutation.SetSecret(b) + return whu +} + +// ClearSecret clears the value of the "secret" field. +func (whu *WebhookHistoryUpdate) ClearSecret() *WebhookHistoryUpdate { + whu.mutation.ClearSecret() + return whu +} + +// SetFailures sets the "failures" field. +func (whu *WebhookHistoryUpdate) SetFailures(i int) *WebhookHistoryUpdate { + whu.mutation.ResetFailures() + whu.mutation.SetFailures(i) + return whu +} + +// SetNillableFailures sets the "failures" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableFailures(i *int) *WebhookHistoryUpdate { + if i != nil { + whu.SetFailures(*i) + } + return whu +} + +// AddFailures adds i to the "failures" field. +func (whu *WebhookHistoryUpdate) AddFailures(i int) *WebhookHistoryUpdate { + whu.mutation.AddFailures(i) + return whu +} + +// ClearFailures clears the value of the "failures" field. +func (whu *WebhookHistoryUpdate) ClearFailures() *WebhookHistoryUpdate { + whu.mutation.ClearFailures() + return whu +} + +// SetLastError sets the "last_error" field. +func (whu *WebhookHistoryUpdate) SetLastError(s string) *WebhookHistoryUpdate { + whu.mutation.SetLastError(s) + return whu +} + +// SetNillableLastError sets the "last_error" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableLastError(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetLastError(*s) + } + return whu +} + +// ClearLastError clears the value of the "last_error" field. +func (whu *WebhookHistoryUpdate) ClearLastError() *WebhookHistoryUpdate { + whu.mutation.ClearLastError() + return whu +} + +// SetLastResponse sets the "last_response" field. +func (whu *WebhookHistoryUpdate) SetLastResponse(s string) *WebhookHistoryUpdate { + whu.mutation.SetLastResponse(s) + return whu +} + +// SetNillableLastResponse sets the "last_response" field if the given value is not nil. +func (whu *WebhookHistoryUpdate) SetNillableLastResponse(s *string) *WebhookHistoryUpdate { + if s != nil { + whu.SetLastResponse(*s) + } + return whu +} + +// ClearLastResponse clears the value of the "last_response" field. +func (whu *WebhookHistoryUpdate) ClearLastResponse() *WebhookHistoryUpdate { + whu.mutation.ClearLastResponse() + return whu +} + +// Mutation returns the WebhookHistoryMutation object of the builder. +func (whu *WebhookHistoryUpdate) Mutation() *WebhookHistoryMutation { + return whu.mutation +} + +// Save executes the query and returns the number of nodes affected by the update operation. +func (whu *WebhookHistoryUpdate) Save(ctx context.Context) (int, error) { + if err := whu.defaults(); err != nil { + return 0, err + } + return withHooks(ctx, whu.sqlSave, whu.mutation, whu.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (whu *WebhookHistoryUpdate) SaveX(ctx context.Context) int { + affected, err := whu.Save(ctx) + if err != nil { + panic(err) + } + return affected +} + +// Exec executes the query. +func (whu *WebhookHistoryUpdate) Exec(ctx context.Context) error { + _, err := whu.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (whu *WebhookHistoryUpdate) ExecX(ctx context.Context) { + if err := whu.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (whu *WebhookHistoryUpdate) defaults() error { + if _, ok := whu.mutation.UpdatedAt(); !ok && !whu.mutation.UpdatedAtCleared() { + if webhookhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webhookhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webhookhistory.UpdateDefaultUpdatedAt() + whu.mutation.SetUpdatedAt(v) + } + return nil +} + +func (whu *WebhookHistoryUpdate) sqlSave(ctx context.Context) (n int, err error) { + _spec := sqlgraph.NewUpdateSpec(webhookhistory.Table, webhookhistory.Columns, sqlgraph.NewFieldSpec(webhookhistory.FieldID, field.TypeString)) + if ps := whu.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if whu.mutation.RefCleared() { + _spec.ClearField(webhookhistory.FieldRef, field.TypeString) + } + if whu.mutation.CreatedAtCleared() { + _spec.ClearField(webhookhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := whu.mutation.UpdatedAt(); ok { + _spec.SetField(webhookhistory.FieldUpdatedAt, field.TypeTime, value) + } + if whu.mutation.UpdatedAtCleared() { + _spec.ClearField(webhookhistory.FieldUpdatedAt, field.TypeTime) + } + if whu.mutation.CreatedByCleared() { + _spec.ClearField(webhookhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := whu.mutation.UpdatedBy(); ok { + _spec.SetField(webhookhistory.FieldUpdatedBy, field.TypeString, value) + } + if whu.mutation.UpdatedByCleared() { + _spec.ClearField(webhookhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := whu.mutation.Tags(); ok { + _spec.SetField(webhookhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := whu.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webhookhistory.FieldTags, value) + }) + } + if whu.mutation.TagsCleared() { + _spec.ClearField(webhookhistory.FieldTags, field.TypeJSON) + } + if value, ok := whu.mutation.DeletedAt(); ok { + _spec.SetField(webhookhistory.FieldDeletedAt, field.TypeTime, value) + } + if whu.mutation.DeletedAtCleared() { + _spec.ClearField(webhookhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := whu.mutation.DeletedBy(); ok { + _spec.SetField(webhookhistory.FieldDeletedBy, field.TypeString, value) + } + if whu.mutation.DeletedByCleared() { + _spec.ClearField(webhookhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := whu.mutation.OwnerID(); ok { + _spec.SetField(webhookhistory.FieldOwnerID, field.TypeString, value) + } + if whu.mutation.OwnerIDCleared() { + _spec.ClearField(webhookhistory.FieldOwnerID, field.TypeString) + } + if value, ok := whu.mutation.Name(); ok { + _spec.SetField(webhookhistory.FieldName, field.TypeString, value) + } + if value, ok := whu.mutation.Description(); ok { + _spec.SetField(webhookhistory.FieldDescription, field.TypeString, value) + } + if whu.mutation.DescriptionCleared() { + _spec.ClearField(webhookhistory.FieldDescription, field.TypeString) + } + if value, ok := whu.mutation.DestinationURL(); ok { + _spec.SetField(webhookhistory.FieldDestinationURL, field.TypeString, value) + } + if value, ok := whu.mutation.Enabled(); ok { + _spec.SetField(webhookhistory.FieldEnabled, field.TypeBool, value) + } + if value, ok := whu.mutation.Callback(); ok { + _spec.SetField(webhookhistory.FieldCallback, field.TypeString, value) + } + if whu.mutation.CallbackCleared() { + _spec.ClearField(webhookhistory.FieldCallback, field.TypeString) + } + if value, ok := whu.mutation.ExpiresAt(); ok { + _spec.SetField(webhookhistory.FieldExpiresAt, field.TypeTime, value) + } + if whu.mutation.ExpiresAtCleared() { + _spec.ClearField(webhookhistory.FieldExpiresAt, field.TypeTime) + } + if value, ok := whu.mutation.Secret(); ok { + _spec.SetField(webhookhistory.FieldSecret, field.TypeBytes, value) + } + if whu.mutation.SecretCleared() { + _spec.ClearField(webhookhistory.FieldSecret, field.TypeBytes) + } + if value, ok := whu.mutation.Failures(); ok { + _spec.SetField(webhookhistory.FieldFailures, field.TypeInt, value) + } + if value, ok := whu.mutation.AddedFailures(); ok { + _spec.AddField(webhookhistory.FieldFailures, field.TypeInt, value) + } + if whu.mutation.FailuresCleared() { + _spec.ClearField(webhookhistory.FieldFailures, field.TypeInt) + } + if value, ok := whu.mutation.LastError(); ok { + _spec.SetField(webhookhistory.FieldLastError, field.TypeString, value) + } + if whu.mutation.LastErrorCleared() { + _spec.ClearField(webhookhistory.FieldLastError, field.TypeString) + } + if value, ok := whu.mutation.LastResponse(); ok { + _spec.SetField(webhookhistory.FieldLastResponse, field.TypeString, value) + } + if whu.mutation.LastResponseCleared() { + _spec.ClearField(webhookhistory.FieldLastResponse, field.TypeString) + } + _spec.Node.Schema = whu.schemaConfig.WebhookHistory + ctx = internal.NewSchemaConfigContext(ctx, whu.schemaConfig) + if n, err = sqlgraph.UpdateNodes(ctx, whu.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{webhookhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return 0, err + } + whu.mutation.done = true + return n, nil +} + +// WebhookHistoryUpdateOne is the builder for updating a single WebhookHistory entity. +type WebhookHistoryUpdateOne struct { + config + fields []string + hooks []Hook + mutation *WebhookHistoryMutation +} + +// SetUpdatedAt sets the "updated_at" field. +func (whuo *WebhookHistoryUpdateOne) SetUpdatedAt(t time.Time) *WebhookHistoryUpdateOne { + whuo.mutation.SetUpdatedAt(t) + return whuo +} + +// ClearUpdatedAt clears the value of the "updated_at" field. +func (whuo *WebhookHistoryUpdateOne) ClearUpdatedAt() *WebhookHistoryUpdateOne { + whuo.mutation.ClearUpdatedAt() + return whuo +} + +// SetUpdatedBy sets the "updated_by" field. +func (whuo *WebhookHistoryUpdateOne) SetUpdatedBy(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetUpdatedBy(s) + return whuo +} + +// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableUpdatedBy(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetUpdatedBy(*s) + } + return whuo +} + +// ClearUpdatedBy clears the value of the "updated_by" field. +func (whuo *WebhookHistoryUpdateOne) ClearUpdatedBy() *WebhookHistoryUpdateOne { + whuo.mutation.ClearUpdatedBy() + return whuo +} + +// SetTags sets the "tags" field. +func (whuo *WebhookHistoryUpdateOne) SetTags(s []string) *WebhookHistoryUpdateOne { + whuo.mutation.SetTags(s) + return whuo +} + +// AppendTags appends s to the "tags" field. +func (whuo *WebhookHistoryUpdateOne) AppendTags(s []string) *WebhookHistoryUpdateOne { + whuo.mutation.AppendTags(s) + return whuo +} + +// ClearTags clears the value of the "tags" field. +func (whuo *WebhookHistoryUpdateOne) ClearTags() *WebhookHistoryUpdateOne { + whuo.mutation.ClearTags() + return whuo +} + +// SetDeletedAt sets the "deleted_at" field. +func (whuo *WebhookHistoryUpdateOne) SetDeletedAt(t time.Time) *WebhookHistoryUpdateOne { + whuo.mutation.SetDeletedAt(t) + return whuo +} + +// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableDeletedAt(t *time.Time) *WebhookHistoryUpdateOne { + if t != nil { + whuo.SetDeletedAt(*t) + } + return whuo +} + +// ClearDeletedAt clears the value of the "deleted_at" field. +func (whuo *WebhookHistoryUpdateOne) ClearDeletedAt() *WebhookHistoryUpdateOne { + whuo.mutation.ClearDeletedAt() + return whuo +} + +// SetDeletedBy sets the "deleted_by" field. +func (whuo *WebhookHistoryUpdateOne) SetDeletedBy(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetDeletedBy(s) + return whuo +} + +// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableDeletedBy(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetDeletedBy(*s) + } + return whuo +} + +// ClearDeletedBy clears the value of the "deleted_by" field. +func (whuo *WebhookHistoryUpdateOne) ClearDeletedBy() *WebhookHistoryUpdateOne { + whuo.mutation.ClearDeletedBy() + return whuo +} + +// SetOwnerID sets the "owner_id" field. +func (whuo *WebhookHistoryUpdateOne) SetOwnerID(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetOwnerID(s) + return whuo +} + +// SetNillableOwnerID sets the "owner_id" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableOwnerID(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetOwnerID(*s) + } + return whuo +} + +// ClearOwnerID clears the value of the "owner_id" field. +func (whuo *WebhookHistoryUpdateOne) ClearOwnerID() *WebhookHistoryUpdateOne { + whuo.mutation.ClearOwnerID() + return whuo +} + +// SetName sets the "name" field. +func (whuo *WebhookHistoryUpdateOne) SetName(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetName(s) + return whuo +} + +// SetNillableName sets the "name" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableName(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetName(*s) + } + return whuo +} + +// SetDescription sets the "description" field. +func (whuo *WebhookHistoryUpdateOne) SetDescription(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetDescription(s) + return whuo +} + +// SetNillableDescription sets the "description" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableDescription(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetDescription(*s) + } + return whuo +} + +// ClearDescription clears the value of the "description" field. +func (whuo *WebhookHistoryUpdateOne) ClearDescription() *WebhookHistoryUpdateOne { + whuo.mutation.ClearDescription() + return whuo +} + +// SetDestinationURL sets the "destination_url" field. +func (whuo *WebhookHistoryUpdateOne) SetDestinationURL(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetDestinationURL(s) + return whuo +} + +// SetNillableDestinationURL sets the "destination_url" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableDestinationURL(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetDestinationURL(*s) + } + return whuo +} + +// SetEnabled sets the "enabled" field. +func (whuo *WebhookHistoryUpdateOne) SetEnabled(b bool) *WebhookHistoryUpdateOne { + whuo.mutation.SetEnabled(b) + return whuo +} + +// SetNillableEnabled sets the "enabled" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableEnabled(b *bool) *WebhookHistoryUpdateOne { + if b != nil { + whuo.SetEnabled(*b) + } + return whuo +} + +// SetCallback sets the "callback" field. +func (whuo *WebhookHistoryUpdateOne) SetCallback(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetCallback(s) + return whuo +} + +// SetNillableCallback sets the "callback" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableCallback(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetCallback(*s) + } + return whuo +} + +// ClearCallback clears the value of the "callback" field. +func (whuo *WebhookHistoryUpdateOne) ClearCallback() *WebhookHistoryUpdateOne { + whuo.mutation.ClearCallback() + return whuo +} + +// SetExpiresAt sets the "expires_at" field. +func (whuo *WebhookHistoryUpdateOne) SetExpiresAt(t time.Time) *WebhookHistoryUpdateOne { + whuo.mutation.SetExpiresAt(t) + return whuo +} + +// SetNillableExpiresAt sets the "expires_at" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableExpiresAt(t *time.Time) *WebhookHistoryUpdateOne { + if t != nil { + whuo.SetExpiresAt(*t) + } + return whuo +} + +// ClearExpiresAt clears the value of the "expires_at" field. +func (whuo *WebhookHistoryUpdateOne) ClearExpiresAt() *WebhookHistoryUpdateOne { + whuo.mutation.ClearExpiresAt() + return whuo +} + +// SetSecret sets the "secret" field. +func (whuo *WebhookHistoryUpdateOne) SetSecret(b []byte) *WebhookHistoryUpdateOne { + whuo.mutation.SetSecret(b) + return whuo +} + +// ClearSecret clears the value of the "secret" field. +func (whuo *WebhookHistoryUpdateOne) ClearSecret() *WebhookHistoryUpdateOne { + whuo.mutation.ClearSecret() + return whuo +} + +// SetFailures sets the "failures" field. +func (whuo *WebhookHistoryUpdateOne) SetFailures(i int) *WebhookHistoryUpdateOne { + whuo.mutation.ResetFailures() + whuo.mutation.SetFailures(i) + return whuo +} + +// SetNillableFailures sets the "failures" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableFailures(i *int) *WebhookHistoryUpdateOne { + if i != nil { + whuo.SetFailures(*i) + } + return whuo +} + +// AddFailures adds i to the "failures" field. +func (whuo *WebhookHistoryUpdateOne) AddFailures(i int) *WebhookHistoryUpdateOne { + whuo.mutation.AddFailures(i) + return whuo +} + +// ClearFailures clears the value of the "failures" field. +func (whuo *WebhookHistoryUpdateOne) ClearFailures() *WebhookHistoryUpdateOne { + whuo.mutation.ClearFailures() + return whuo +} + +// SetLastError sets the "last_error" field. +func (whuo *WebhookHistoryUpdateOne) SetLastError(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetLastError(s) + return whuo +} + +// SetNillableLastError sets the "last_error" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableLastError(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetLastError(*s) + } + return whuo +} + +// ClearLastError clears the value of the "last_error" field. +func (whuo *WebhookHistoryUpdateOne) ClearLastError() *WebhookHistoryUpdateOne { + whuo.mutation.ClearLastError() + return whuo +} + +// SetLastResponse sets the "last_response" field. +func (whuo *WebhookHistoryUpdateOne) SetLastResponse(s string) *WebhookHistoryUpdateOne { + whuo.mutation.SetLastResponse(s) + return whuo +} + +// SetNillableLastResponse sets the "last_response" field if the given value is not nil. +func (whuo *WebhookHistoryUpdateOne) SetNillableLastResponse(s *string) *WebhookHistoryUpdateOne { + if s != nil { + whuo.SetLastResponse(*s) + } + return whuo +} + +// ClearLastResponse clears the value of the "last_response" field. +func (whuo *WebhookHistoryUpdateOne) ClearLastResponse() *WebhookHistoryUpdateOne { + whuo.mutation.ClearLastResponse() + return whuo +} + +// Mutation returns the WebhookHistoryMutation object of the builder. +func (whuo *WebhookHistoryUpdateOne) Mutation() *WebhookHistoryMutation { + return whuo.mutation +} + +// Where appends a list predicates to the WebhookHistoryUpdate builder. +func (whuo *WebhookHistoryUpdateOne) Where(ps ...predicate.WebhookHistory) *WebhookHistoryUpdateOne { + whuo.mutation.Where(ps...) + return whuo +} + +// Select allows selecting one or more fields (columns) of the returned entity. +// The default is selecting all fields defined in the entity schema. +func (whuo *WebhookHistoryUpdateOne) Select(field string, fields ...string) *WebhookHistoryUpdateOne { + whuo.fields = append([]string{field}, fields...) + return whuo +} + +// Save executes the query and returns the updated WebhookHistory entity. +func (whuo *WebhookHistoryUpdateOne) Save(ctx context.Context) (*WebhookHistory, error) { + if err := whuo.defaults(); err != nil { + return nil, err + } + return withHooks(ctx, whuo.sqlSave, whuo.mutation, whuo.hooks) +} + +// SaveX is like Save, but panics if an error occurs. +func (whuo *WebhookHistoryUpdateOne) SaveX(ctx context.Context) *WebhookHistory { + node, err := whuo.Save(ctx) + if err != nil { + panic(err) + } + return node +} + +// Exec executes the query on the entity. +func (whuo *WebhookHistoryUpdateOne) Exec(ctx context.Context) error { + _, err := whuo.Save(ctx) + return err +} + +// ExecX is like Exec, but panics if an error occurs. +func (whuo *WebhookHistoryUpdateOne) ExecX(ctx context.Context) { + if err := whuo.Exec(ctx); err != nil { + panic(err) + } +} + +// defaults sets the default values of the builder before save. +func (whuo *WebhookHistoryUpdateOne) defaults() error { + if _, ok := whuo.mutation.UpdatedAt(); !ok && !whuo.mutation.UpdatedAtCleared() { + if webhookhistory.UpdateDefaultUpdatedAt == nil { + return fmt.Errorf("generated: uninitialized webhookhistory.UpdateDefaultUpdatedAt (forgotten import generated/runtime?)") + } + v := webhookhistory.UpdateDefaultUpdatedAt() + whuo.mutation.SetUpdatedAt(v) + } + return nil +} + +func (whuo *WebhookHistoryUpdateOne) sqlSave(ctx context.Context) (_node *WebhookHistory, err error) { + _spec := sqlgraph.NewUpdateSpec(webhookhistory.Table, webhookhistory.Columns, sqlgraph.NewFieldSpec(webhookhistory.FieldID, field.TypeString)) + id, ok := whuo.mutation.ID() + if !ok { + return nil, &ValidationError{Name: "id", err: errors.New(`generated: missing "WebhookHistory.id" for update`)} + } + _spec.Node.ID.Value = id + if fields := whuo.fields; len(fields) > 0 { + _spec.Node.Columns = make([]string, 0, len(fields)) + _spec.Node.Columns = append(_spec.Node.Columns, webhookhistory.FieldID) + for _, f := range fields { + if !webhookhistory.ValidColumn(f) { + return nil, &ValidationError{Name: f, err: fmt.Errorf("generated: invalid field %q for query", f)} + } + if f != webhookhistory.FieldID { + _spec.Node.Columns = append(_spec.Node.Columns, f) + } + } + } + if ps := whuo.mutation.predicates; len(ps) > 0 { + _spec.Predicate = func(selector *sql.Selector) { + for i := range ps { + ps[i](selector) + } + } + } + if whuo.mutation.RefCleared() { + _spec.ClearField(webhookhistory.FieldRef, field.TypeString) + } + if whuo.mutation.CreatedAtCleared() { + _spec.ClearField(webhookhistory.FieldCreatedAt, field.TypeTime) + } + if value, ok := whuo.mutation.UpdatedAt(); ok { + _spec.SetField(webhookhistory.FieldUpdatedAt, field.TypeTime, value) + } + if whuo.mutation.UpdatedAtCleared() { + _spec.ClearField(webhookhistory.FieldUpdatedAt, field.TypeTime) + } + if whuo.mutation.CreatedByCleared() { + _spec.ClearField(webhookhistory.FieldCreatedBy, field.TypeString) + } + if value, ok := whuo.mutation.UpdatedBy(); ok { + _spec.SetField(webhookhistory.FieldUpdatedBy, field.TypeString, value) + } + if whuo.mutation.UpdatedByCleared() { + _spec.ClearField(webhookhistory.FieldUpdatedBy, field.TypeString) + } + if value, ok := whuo.mutation.Tags(); ok { + _spec.SetField(webhookhistory.FieldTags, field.TypeJSON, value) + } + if value, ok := whuo.mutation.AppendedTags(); ok { + _spec.AddModifier(func(u *sql.UpdateBuilder) { + sqljson.Append(u, webhookhistory.FieldTags, value) + }) + } + if whuo.mutation.TagsCleared() { + _spec.ClearField(webhookhistory.FieldTags, field.TypeJSON) + } + if value, ok := whuo.mutation.DeletedAt(); ok { + _spec.SetField(webhookhistory.FieldDeletedAt, field.TypeTime, value) + } + if whuo.mutation.DeletedAtCleared() { + _spec.ClearField(webhookhistory.FieldDeletedAt, field.TypeTime) + } + if value, ok := whuo.mutation.DeletedBy(); ok { + _spec.SetField(webhookhistory.FieldDeletedBy, field.TypeString, value) + } + if whuo.mutation.DeletedByCleared() { + _spec.ClearField(webhookhistory.FieldDeletedBy, field.TypeString) + } + if value, ok := whuo.mutation.OwnerID(); ok { + _spec.SetField(webhookhistory.FieldOwnerID, field.TypeString, value) + } + if whuo.mutation.OwnerIDCleared() { + _spec.ClearField(webhookhistory.FieldOwnerID, field.TypeString) + } + if value, ok := whuo.mutation.Name(); ok { + _spec.SetField(webhookhistory.FieldName, field.TypeString, value) + } + if value, ok := whuo.mutation.Description(); ok { + _spec.SetField(webhookhistory.FieldDescription, field.TypeString, value) + } + if whuo.mutation.DescriptionCleared() { + _spec.ClearField(webhookhistory.FieldDescription, field.TypeString) + } + if value, ok := whuo.mutation.DestinationURL(); ok { + _spec.SetField(webhookhistory.FieldDestinationURL, field.TypeString, value) + } + if value, ok := whuo.mutation.Enabled(); ok { + _spec.SetField(webhookhistory.FieldEnabled, field.TypeBool, value) + } + if value, ok := whuo.mutation.Callback(); ok { + _spec.SetField(webhookhistory.FieldCallback, field.TypeString, value) + } + if whuo.mutation.CallbackCleared() { + _spec.ClearField(webhookhistory.FieldCallback, field.TypeString) + } + if value, ok := whuo.mutation.ExpiresAt(); ok { + _spec.SetField(webhookhistory.FieldExpiresAt, field.TypeTime, value) + } + if whuo.mutation.ExpiresAtCleared() { + _spec.ClearField(webhookhistory.FieldExpiresAt, field.TypeTime) + } + if value, ok := whuo.mutation.Secret(); ok { + _spec.SetField(webhookhistory.FieldSecret, field.TypeBytes, value) + } + if whuo.mutation.SecretCleared() { + _spec.ClearField(webhookhistory.FieldSecret, field.TypeBytes) + } + if value, ok := whuo.mutation.Failures(); ok { + _spec.SetField(webhookhistory.FieldFailures, field.TypeInt, value) + } + if value, ok := whuo.mutation.AddedFailures(); ok { + _spec.AddField(webhookhistory.FieldFailures, field.TypeInt, value) + } + if whuo.mutation.FailuresCleared() { + _spec.ClearField(webhookhistory.FieldFailures, field.TypeInt) + } + if value, ok := whuo.mutation.LastError(); ok { + _spec.SetField(webhookhistory.FieldLastError, field.TypeString, value) + } + if whuo.mutation.LastErrorCleared() { + _spec.ClearField(webhookhistory.FieldLastError, field.TypeString) + } + if value, ok := whuo.mutation.LastResponse(); ok { + _spec.SetField(webhookhistory.FieldLastResponse, field.TypeString, value) + } + if whuo.mutation.LastResponseCleared() { + _spec.ClearField(webhookhistory.FieldLastResponse, field.TypeString) + } + _spec.Node.Schema = whuo.schemaConfig.WebhookHistory + ctx = internal.NewSchemaConfigContext(ctx, whuo.schemaConfig) + _node = &WebhookHistory{config: whuo.config} + _spec.Assign = _node.assignValues + _spec.ScanValues = _node.scanValues + if err = sqlgraph.UpdateNode(ctx, whuo.driver, _spec); err != nil { + if _, ok := err.(*sqlgraph.NotFoundError); ok { + err = &NotFoundError{webhookhistory.Label} + } else if sqlgraph.IsConstraintError(err) { + err = &ConstraintError{msg: err.Error(), wrap: err} + } + return nil, err + } + whuo.mutation.done = true + return _node, nil +} diff --git a/internal/ent/hooks/apitoken.go b/internal/ent/hooks/apitoken.go new file mode 100644 index 0000000..6cf3420 --- /dev/null +++ b/internal/ent/hooks/apitoken.go @@ -0,0 +1,154 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/iam/fgax" + + sliceutil "github.com/theopenlane/utils/slice" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/pkg/auth" +) + +// HookCreateAPIToken runs on api token mutations and sets the owner id +func HookCreateAPIToken() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.APITokenFunc(func(ctx context.Context, mutation *generated.APITokenMutation) (generated.Value, error) { + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err != nil { + return nil, err + } + + // set organization on the token + mutation.SetOwnerID(orgID) + + retVal, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + token, ok := retVal.(*generated.APIToken) + if !ok { + return retVal, err + } + + // create the relationship tuples in fga for the token + tuples, err := createScopeTuples(token.Scopes, orgID, token.ID) + if err != nil { + return retVal, err + } + + // create the relationship tuples if we have any + if len(tuples) > 0 { + if _, err := mutation.Authz.WriteTupleKeys(ctx, tuples, nil); err != nil { + mutation.Logger.Errorw("failed to create relationship tuple", "error", err) + + return nil, err + } + } + + return retVal, err + }) + }, ent.OpCreate) +} + +// HookUpdateAPIToken runs on api token update and redacts the token +func HookUpdateAPIToken() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.APITokenFunc(func(ctx context.Context, mutation *generated.APITokenMutation) (generated.Value, error) { + retVal, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + // redact the token + at, ok := retVal.(*generated.APIToken) + if !ok { + return retVal, nil + } + + at.Token = redacted + + // create the relationship tuples in fga for the token + newScopes, err := getNewScopes(ctx, mutation) + if err != nil { + return at, err + } + + tuples, err := createScopeTuples(newScopes, at.OwnerID, at.ID) + if err != nil { + return retVal, err + } + + // create the relationship tuples if we have any + if len(tuples) > 0 { + if _, err := mutation.Authz.WriteTupleKeys(ctx, tuples, nil); err != nil { + mutation.Logger.Errorw("failed to create relationship tuple", "error", err) + + return nil, err + } + } + + return at, nil + }) + }, ent.OpUpdate|ent.OpUpdateOne) +} + +// createScopeTuples creates the relationship tuples for the token +func createScopeTuples(scopes []string, orgID, tokenID string) (tuples []fgax.TupleKey, err error) { + // create the relationship tuples in fga for the token + // TODO (sfunk): this shouldn't be a static list + for _, scope := range scopes { + var relation string + + switch scope { + case "read": + relation = "can_view" + case "write": + relation = "can_edit" + case "delete": + relation = "can_delete" + } + + req := fgax.TupleRequest{ + SubjectID: tokenID, + SubjectType: "service", + ObjectID: orgID, + ObjectType: "organization", + Relation: relation, + } + + tuples = append(tuples, fgax.GetTupleKey(req)) + } + + return +} + +// getNewScopes returns the new scopes that were added to the token during an update +// NOTE: there is an AppendedScopes on the mutation, but this is not populated +// so calculating the new scopes for now +func getNewScopes(ctx context.Context, mutation *generated.APITokenMutation) ([]string, error) { + scopes, ok := mutation.Scopes() + if !ok { + return nil, nil + } + + oldScopes, err := mutation.OldScopes(ctx) + if err != nil { + return nil, err + } + + var newScopes []string + + for _, scope := range scopes { + if !sliceutil.Contains(oldScopes, scope) { + newScopes = append(newScopes, scope) + } + } + + return newScopes, nil +} diff --git a/internal/ent/hooks/doc.go b/internal/ent/hooks/doc.go new file mode 100644 index 0000000..3ff6db7 --- /dev/null +++ b/internal/ent/hooks/doc.go @@ -0,0 +1,2 @@ +// Package hooks is middleware to alter the graphql mutation +package hooks diff --git a/internal/ent/hooks/emailverificationtoken.go b/internal/ent/hooks/emailverificationtoken.go new file mode 100644 index 0000000..70820a6 --- /dev/null +++ b/internal/ent/hooks/emailverificationtoken.go @@ -0,0 +1,25 @@ +package hooks + +import ( + "context" + "time" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" +) + +// HookEmailVerificationToken runs on email verification mutations and sets expires +func HookEmailVerificationToken() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.EmailVerificationTokenFunc(func(ctx context.Context, mutation *generated.EmailVerificationTokenMutation) (generated.Value, error) { + expires, _ := mutation.TTL() + if expires.IsZero() { + mutation.SetTTL(time.Now().UTC().Add(time.Hour * 24 * 7)) //nolint:mnd + } + + return next.Mutate(ctx, mutation) + }) + }, ent.OpCreate) +} diff --git a/internal/ent/hooks/entitlement.go b/internal/ent/hooks/entitlement.go new file mode 100644 index 0000000..383eb28 --- /dev/null +++ b/internal/ent/hooks/entitlement.go @@ -0,0 +1,29 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" +) + +func HookEntitlement() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.EntitlementFunc(func(ctx context.Context, mutation *generated.EntitlementMutation) (generated.Value, error) { + // set the expires flag if the expires_at field is set + expiresAt, ok := mutation.ExpiresAt() + if ok && !expiresAt.IsZero() { + mutation.SetExpires(true) + } + + retVal, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + return retVal, err + }) + }, ent.OpCreate|ent.OpUpdate|ent.OpUpdateOne) +} diff --git a/internal/ent/hooks/entitlementplan.go b/internal/ent/hooks/entitlementplan.go new file mode 100644 index 0000000..567afa5 --- /dev/null +++ b/internal/ent/hooks/entitlementplan.go @@ -0,0 +1,34 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" +) + +func HookEntitlementPlan() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.EntitlementPlanFunc(func(ctx context.Context, mutation *generated.EntitlementPlanMutation) (generated.Value, error) { + // set the display name if it is not set + if mutation.Op() == ent.OpCreate { + displayName, _ := mutation.DisplayName() + if displayName == "" { + name, ok := mutation.Name() + if ok { + mutation.SetDisplayName(name) + } + } + } + + retVal, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + return retVal, err + }) + }, ent.OpCreate|ent.OpUpdate|ent.OpUpdateOne) +} diff --git a/internal/ent/hooks/entity.go b/internal/ent/hooks/entity.go new file mode 100644 index 0000000..f738827 --- /dev/null +++ b/internal/ent/hooks/entity.go @@ -0,0 +1,42 @@ +package hooks + +import ( + "context" + "fmt" + + "entgo.io/ent" + + "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" +) + +// HookEntityCreate runs on entity mutations to set default values that are not provided +func HookEntityCreate() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.EntityFunc(func(ctx context.Context, mutation *generated.EntityMutation) (generated.Value, error) { + // require either a display name or a name + displayName, _ := mutation.DisplayName() + name, _ := mutation.Name() + + // exit early if we have no name + if displayName == "" && name == "" { + return nil, ErrMissingRequiredName + } + + // set display name based on name if it isn't set + if displayName == "" { + mutation.SetDisplayName(name) + } + + // set unique name based on display name if it isn't set + if name == "" { + uniqueName := fmt.Sprintf("%s-%s", displayName, ulids.New().String()) + mutation.SetName(uniqueName) + } + + return next.Mutate(ctx, mutation) + }) + }, ent.OpCreate) +} diff --git a/internal/ent/hooks/errors.go b/internal/ent/hooks/errors.go new file mode 100644 index 0000000..4d8b644 --- /dev/null +++ b/internal/ent/hooks/errors.go @@ -0,0 +1,70 @@ +package hooks + +import ( + "errors" + "strings" +) + +var ( + // ErrInternalServerError is returned when an internal error occurs. + ErrInternalServerError = errors.New("internal server error") + + // ErrInvalidInput is returned when the input is invalid. + ErrInvalidInput = errors.New("invalid input") + + // ErrPersonalOrgsNoChildren is returned when personal org attempts to add a child org + ErrPersonalOrgsNoChildren = errors.New("personal organizations are not allowed to have child organizations") + + // ErrPersonalOrgsNoMembers is returned when personal org attempts to add members + ErrPersonalOrgsNoMembers = errors.New("personal organizations are not allowed to have members other than the owner") + + // ErrPersonalOrgsNoUser is returned when personal org has no user associated, so no permissions can be added + ErrPersonalOrgsNoUser = errors.New("personal organizations missing user association") + + // ErrUserNotInOrg is returned when a user is not a member of an organization when trying to add them to a group + ErrUserNotInOrg = errors.New("user not in organization") + + // ErrUnsupportedFGARole is returned when a role is assigned that is not supported in our fine grained authorization system + ErrUnsupportedFGARole = errors.New("unsupported role") + + // ErrMissingRole is returned when an update request is made that contains no role + ErrMissingRole = errors.New("missing role in update") + + // ErrUserAlreadyOrgMember is returned when an user attempts to be invited to an org they are already a member of + ErrUserAlreadyOrgMember = errors.New("user already member of organization") + + // ErrUserAlreadySubscriber is returned when an user attempts to subscribe to an organization but is already a subscriber + ErrUserAlreadySubscriber = errors.New("user already a subscriber") + + // ErrEmailRequired is returned when an email is required but not provided + ErrEmailRequired = errors.New("email is required but not provided") + + // ErrMaxAttempts is returned when a user has reached the max attempts to resend an invitation to an org + ErrMaxAttempts = errors.New("too many attempts to resend org invitation") + + // ErrMissingRecipientEmail is returned when an email is required but not provided + ErrMissingRecipientEmail = errors.New("recipient email is required but not provided") + + // ErrMissingRequiredName is returned when a name is required but not provided + ErrMissingRequiredName = errors.New("name or display name is required but not provided") +) + +// IsUniqueConstraintError reports if the error resulted from a DB uniqueness constraint violation. +// e.g. duplicate value in unique index. +func IsUniqueConstraintError(err error) bool { + if err == nil { + return false + } + + for _, s := range []string{ + "Error 1062", // MySQL + "violates unique constraint", // Postgres + "UNIQUE constraint failed", // SQLite + } { + if strings.Contains(err.Error(), s) { + return true + } + } + + return false +} diff --git a/internal/ent/hooks/feature.go b/internal/ent/hooks/feature.go new file mode 100644 index 0000000..9c6c84e --- /dev/null +++ b/internal/ent/hooks/feature.go @@ -0,0 +1,34 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" +) + +func HookFeature() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.FeatureFunc(func(ctx context.Context, mutation *generated.FeatureMutation) (generated.Value, error) { + // set the display name if it is not set + if mutation.Op() == ent.OpCreate { + displayName, _ := mutation.DisplayName() + if displayName == "" { + name, ok := mutation.Name() + if ok { + mutation.SetDisplayName(name) + } + } + } + + retVal, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + return retVal, err + }) + }, ent.OpCreate|ent.OpUpdate|ent.OpUpdateOne) +} diff --git a/internal/ent/hooks/group.go b/internal/ent/hooks/group.go new file mode 100644 index 0000000..6e06a0c --- /dev/null +++ b/internal/ent/hooks/group.go @@ -0,0 +1,181 @@ +package hooks + +import ( + "context" + "fmt" + "strings" + + "entgo.io/ent" + "github.com/theopenlane/entx" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/utils/gravatar" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" +) + +// HookGroup runs on group mutations to set default values that are not provided +func HookGroup() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.GroupFunc(func(ctx context.Context, mutation *generated.GroupMutation) (generated.Value, error) { + if name, ok := mutation.Name(); ok { + displayName, _ := mutation.DisplayName() + + if displayName == "" { + mutation.SetDisplayName(name) + } + } + + if mutation.Op().Is(ent.OpCreate) { + // if this is empty generate a default group setting schema + settingID, _ := mutation.SettingID() + if settingID == "" { + // sets up default group settings using schema defaults + groupSettingID, err := defaultGroupSettings(ctx, mutation) + if err != nil { + return nil, err + } + + // add the group setting ID to the input + mutation.SetSettingID(groupSettingID) + } + } + + if name, ok := mutation.Name(); ok { + url := gravatar.New(name, nil) + mutation.SetGravatarLogoURL(url) + } + + return next.Mutate(ctx, mutation) + }) + }, ent.OpCreate|ent.OpUpdateOne) +} + +// HookGroupAuthz runs on group mutations to setup or remove relationship tuples +func HookGroupAuthz() ent.Hook { + return func(next ent.Mutator) ent.Mutator { + return hook.GroupFunc(func(ctx context.Context, m *generated.GroupMutation) (ent.Value, error) { + // do the mutation, and then create/delete the relationship + retValue, err := next.Mutate(ctx, m) + if err != nil { + // if we error, do not attempt to create the relationships + return retValue, err + } + + if m.Op().Is(ent.OpCreate) { + // create the group member admin and relationship tuple for parent org + err = groupCreateHook(ctx, m) + } else if m.Op().Is(ent.OpDelete|ent.OpDeleteOne) || entx.CheckIsSoftDelete(ctx) { + // delete all relationship tuples on delete, or soft delete (Update Op) + err = groupDeleteHook(ctx, m) + } + + return retValue, err + }) + } +} + +func groupCreateHook(ctx context.Context, m *generated.GroupMutation) error { + objID, exists := m.ID() + if exists { + // create the admin group member if not using an API token (which is not associated with a user) + if !auth.IsAPITokenAuthentication(ctx) { + if err := createGroupMemberOwner(ctx, objID, m); err != nil { + return err + } + } + } + + objType := strings.ToLower(m.Type()) + object := fmt.Sprintf("%s:%s", objType, objID) + org, orgExists := m.OwnerID() + + if exists && orgExists { + m.Logger.Debugw("creating parent relationship tuples", "relation", fgax.ParentRelation, "org", org, "object", object) + + req := fgax.TupleRequest{ + SubjectID: org, + SubjectType: "organization", + ObjectID: objID, + ObjectType: objType, + } + + orgTuple, err := getTupleKeyFromRole(req, fgax.ParentRelation) + if err != nil { + return err + } + + if _, err := m.Authz.WriteTupleKeys(ctx, []fgax.TupleKey{orgTuple}, nil); err != nil { + m.Logger.Errorw("failed to create relationship tuple", "error", err) + + return ErrInternalServerError + } + } + + return nil +} + +func createGroupMemberOwner(ctx context.Context, gID string, m *generated.GroupMutation) error { + // get userID from context + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + m.Logger.Errorw("unable to get user id from echo context, unable to add user to group") + + return err + } + + // Add user as admin of group + input := generated.CreateGroupMembershipInput{ + UserID: userID, + GroupID: gID, + Role: &enums.RoleAdmin, + } + + if _, err := m.Client().GroupMembership.Create().SetInput(input).Save(ctx); err != nil { + m.Logger.Errorw("error creating group membership for admin", "error", err) + + return err + } + + return nil +} + +func groupDeleteHook(ctx context.Context, m *generated.GroupMutation) error { + // Add relationship tuples if authz is enabled + objID, ok := m.ID() + if !ok { + // TODO (sfunk): ensure tuples get cascade deleted + // continue for now + return nil + } + + objType := strings.ToLower(m.Type()) + object := fmt.Sprintf("%s:%s", objType, objID) + + m.Logger.Debugw("deleting relationship tuples", "object", object) + + if err := m.Authz.DeleteAllObjectRelations(ctx, object); err != nil { + m.Logger.Errorw("failed to delete relationship tuples", "error", err) + + return ErrInternalServerError + } + + m.Logger.Debugw("deleted relationship tuples", "object", object) + + return nil +} + +// defaultGroupSettings creates the default group settings for a new group +func defaultGroupSettings(ctx context.Context, group *generated.GroupMutation) (string, error) { + input := generated.CreateGroupSettingInput{} + + groupSetting, err := group.Client().GroupSetting.Create().SetInput(input).Save(ctx) + if err != nil { + return "", err + } + + return groupSetting.ID, nil +} diff --git a/internal/ent/hooks/groupmembers.go b/internal/ent/hooks/groupmembers.go new file mode 100644 index 0000000..5ee2231 --- /dev/null +++ b/internal/ent/hooks/groupmembers.go @@ -0,0 +1,60 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + ph "github.com/posthog/posthog-go" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" +) + +func HookGroupMembers() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.GroupMembershipFunc(func(ctx context.Context, mutation *generated.GroupMembershipMutation) (generated.Value, error) { + // check role, if its not set the default is member + userID, ok := mutation.UserID() + if !ok { + return next.Mutate(ctx, mutation) + } + + groupID, ok := mutation.GroupID() + if !ok { + return next.Mutate(ctx, mutation) + } + + group, err := mutation.Client().Group.Get(ctx, groupID) + if err != nil { + // group not found, let the default validation handle it + return next.Mutate(ctx, mutation) + } + + // ensure user is a member of the organization + exists, err := mutation.Client().OrgMembership.Query(). + Where(orgmembership.UserID(userID)). + Where(orgmembership.OrganizationID(group.OwnerID)). + Exist(ctx) + if err != nil { + return nil, err + } + + if !exists { + return nil, ErrUserNotInOrg + } + + role, _ := mutation.Role() + + props := ph.NewProperties(). + Set("group_id", groupID). + Set("user_id", userID). + Set("role", role) + + mutation.Analytics.Event("group_membership", props) + + return next.Mutate(ctx, mutation) + }) + }, ent.OpCreate) +} diff --git a/internal/ent/hooks/helpers.go b/internal/ent/hooks/helpers.go new file mode 100644 index 0000000..4e08395 --- /dev/null +++ b/internal/ent/hooks/helpers.go @@ -0,0 +1,14 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + "github.com/theopenlane/entx" +) + +// isDeleteOp checks if the mutation is a deletion operation. +// which includes soft delete, delete, and delete one. +func isDeleteOp(ctx context.Context, mutation ent.Mutation) bool { + return entx.CheckIsSoftDelete(ctx) || mutation.Op().Is(ent.OpDelete) || mutation.Op().Is(ent.OpDeleteOne) +} diff --git a/internal/ent/hooks/hush.go b/internal/ent/hooks/hush.go new file mode 100644 index 0000000..2daf75e --- /dev/null +++ b/internal/ent/hooks/hush.go @@ -0,0 +1,63 @@ +package hooks + +import ( + "context" + "encoding/hex" + "fmt" + + "entgo.io/ent" + "gocloud.dev/secrets" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" +) + +// HookHush runs on invite create mutations +func HookHush() ent.Hook { + return hook.If( + func(next ent.Mutator) ent.Mutator { + return hook.HushFunc(func(ctx context.Context, m *generated.HushMutation) (generated.Value, error) { + v, ok := m.SecretValue() + if !ok || v == "" { + return nil, fmt.Errorf("unexpected 'secret_name' value") // nolint:err113 + } + + c, err := m.Secrets.Encrypt(ctx, []byte(v)) + if err != nil { + return nil, err + } + + m.SetName(hex.EncodeToString(c)) + u, err := next.Mutate(ctx, m) + + if err != nil { + return nil, err + } + + if u, ok := u.(*generated.Hush); ok { + err = Decrypt(ctx, m.Secrets, u) + } + + return u, err + }) + }, + hook.HasFields("secret_value"), + ) +} + +// Decrypt decrypts the secret value +func Decrypt(ctx context.Context, k *secrets.Keeper, u *generated.Hush) error { + b, err := hex.DecodeString(u.SecretValue) + if err != nil { + return err + } + + plain, err := k.Decrypt(ctx, b) + if err != nil { + return err + } + + u.Name = string(plain) + + return nil +} diff --git a/internal/ent/hooks/invite.go b/internal/ent/hooks/invite.go new file mode 100644 index 0000000..83dd8f5 --- /dev/null +++ b/internal/ent/hooks/invite.go @@ -0,0 +1,415 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + ph "github.com/posthog/posthog-go" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/sendgrid" + "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/tokens" +) + +// HookInvite runs on invite create mutations +func HookInvite() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.InviteFunc(func(ctx context.Context, m *generated.InviteMutation) (generated.Value, error) { + m, err := setRequestor(ctx, m) + if err != nil { + m.Logger.Errorw("unable to determine requestor") + + return nil, err + } + + // check that the invite isn't to a personal organization + if err := personalOrgNoInvite(ctx, m); err != nil { + m.Logger.Infow("unable to add user to specified organization", "error", err) + + return nil, err + } + + // generate token based on recipient + target org ID + m, err = setRecipientAndToken(m) + if err != nil { + m.Logger.Errorw("error creating verification token", "error", err) + + return nil, err + } + + // check if the invite already exists + existingInvite, err := getInvite(ctx, m) + + // attempt to do the mutation for a new user invite + var retValue ent.Value + + // if the invite exists, update the token and resend + if existingInvite != nil && err == nil { + m.Logger.Infow("invitation for user already exists") + + // update invite instead + retValue, err = updateInvite(ctx, m) + if err != nil { + m.Logger.Errorw("unable to update invitation", "error", err) + + return retValue, err + } + } else { + // create new invite + retValue, err = next.Mutate(ctx, m) + if err != nil { + return retValue, err + } + } + + // non-blocking queued email + if err := createInviteToSend(ctx, m); err != nil { + m.Logger.Errorw("error sending email to user", "error", err) + } + + orgID, _ := m.OwnerID() + org, _ := m.Client().Organization.Get(ctx, orgID) + reqID, _ := m.RequestorID() + requestor, _ := m.Client().User.Get(ctx, reqID) + email, _ := m.Recipient() + role, _ := m.Role() + + props := ph.NewProperties(). + Set("organization_id", orgID). + Set("organization_name", org.Name). + Set("requestor_id", reqID). + Set("recipient_email", email). + Set("recipient_role", role) + + // if we have the requestor, add their name and email to the properties + if requestor != nil { + props.Set("requestor_name", requestor.FirstName). + Set("requestor_email", requestor.Email) + } + + m.Analytics.Event("organization_invite_created", props) + + return retValue, err + }) + }, ent.OpCreate) +} + +// HookInviteAccepted adds the user to the organization when the status is accepted +func HookInviteAccepted() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.InviteFunc(func(ctx context.Context, m *generated.InviteMutation) (generated.Value, error) { + status, ok := m.Status() + if !ok || status != enums.InvitationAccepted { + // nothing to do here + return next.Mutate(ctx, m) + } + + ownerID, ownerOK := m.OwnerID() + role, roleOK := m.Role() + recipient, recipientOK := m.Recipient() + + // if we are missing any, get them from the db + // this should happen on an update mutation + if !ownerOK || !roleOK || !recipientOK { + id, _ := m.ID() + + invite, err := m.Client().Invite.Get(ctx, id) + if err != nil { + m.Logger.Errorw("unable to get existing invite", "error", err) + + return nil, err + } + + ownerID = invite.OwnerID + role = invite.Role + recipient = invite.Recipient + } + + // user must be authenticated to accept an invite, get their id from the context + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + m.Logger.Errorw("unable to get user to add to organization", "error", err) + + return nil, err + } + + input := generated.CreateOrgMembershipInput{ + UserID: userID, + OrganizationID: ownerID, + Role: &role, + } + + // add user to the inviting org + if _, err := m.Client().OrgMembership.Create().SetInput(input).Save(ctx); err != nil { + m.Logger.Errorw("unable to add user to organization", "error", err) + + return nil, err + } + + // finish the mutation + retValue, err := next.Mutate(ctx, m) + if err != nil { + return nil, err + } + + // fetch org details to pass the name in the email + org, err := m.Client().Organization.Query().Clone().Where(organization.ID(ownerID)).Only(ctx) + if err != nil { + m.Logger.Errorw("unable to get organization", "error", err) + + return retValue, err + } + + invite := &emails.Invite{ + OrgName: org.Name, + Recipient: recipient, + Role: string(role), + } + + props := ph.NewProperties(). + Set("organization_id", org.ID). + Set("organization_name", org.Name). + Set("acceptor_email", recipient). + Set("acceptor_id", userID) + + m.Analytics.Event("organization_invite_accepted", props) + + // send an email to recipient notifying them they've been added to an organization + if err := m.Marionette.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return sendOrgAccepted(ctx, m, invite) + }), marionette.WithErrorf("could not send invitation email to user %s", recipient), + ); err != nil { + m.Logger.Errorw("unable to queue email for sending") + + return retValue, err + } + + // delete the invite that has been accepted + if err := deleteInvite(ctx, m); err != nil { + return retValue, err + } + + return retValue, err + }) + }, ent.OpCreate|ent.OpUpdate|ent.OpUpdateOne) +} + +// personalOrgNoInvite checks if the mutation is for a personal org and denies if true or +// if the user does not have access to that organization +func personalOrgNoInvite(ctx context.Context, m *generated.InviteMutation) error { + orgID, ok := m.OwnerID() + if ok { + org, err := m.Client().Organization.Get(ctx, orgID) + if err != nil { + return err + } + + if org.PersonalOrg { + return ErrPersonalOrgsNoChildren + } + } + + return nil +} + +// setRecipientAndToken function is responsible for generating a invite token based on the +// recipient's email and the target organization ID +func setRecipientAndToken(m *generated.InviteMutation) (*generated.InviteMutation, error) { + email, ok := m.Recipient() + if !ok || email == "" { + return nil, ErrMissingRecipientEmail + } + + owner, _ := m.OwnerID() + + oid, err := ulids.Parse(owner) + if err != nil { + return nil, err + } + + verify, err := tokens.NewOrgInvitationToken(email, oid) + if err != nil { + return nil, err + } + + token, secret, err := verify.Sign() + if err != nil { + return nil, err + } + + // set values on mutation + m.SetToken(token) + m.SetExpires(verify.ExpiresAt) + m.SetSecret(secret) + + return m, nil +} + +// setRequestor sets the requestor on the mutation +func setRequestor(ctx context.Context, m *generated.InviteMutation) (*generated.InviteMutation, error) { + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + m.Logger.Errorw("unable to get requestor", "error", err) + + return m, err + } + + m.SetRequestorID(userID) + + return m, nil +} + +// createInviteToSend sets the necessary data to send invite email + token +func createInviteToSend(ctx context.Context, m *generated.InviteMutation) error { + // these are all required fields on create so should be found + orgID, _ := m.OwnerID() + reqID, _ := m.RequestorID() + token, _ := m.Token() + email, _ := m.Recipient() + role, _ := m.Role() + + org, err := m.Client().Organization.Get(ctx, orgID) + if err != nil { + return err + } + + requestor, err := m.Client().User.Get(ctx, reqID) + if err != nil { + return err + } + + invite := &emails.Invite{ + OrgName: org.Name, + Token: token, + Requestor: requestor.FirstName, + Recipient: email, + Role: string(role), + } + + if err := m.Marionette.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return sendOrgInvitationEmail(ctx, m, invite) + }), marionette.WithErrorf("could not send invitation email to user %s", email), + ); err != nil { + m.Logger.Errorw("unable to queue email for sending") + + return err + } + + return nil +} + +// sendOrgInvitationEmail composes the email metadata and sends via email manager +func sendOrgInvitationEmail(ctx context.Context, m *generated.InviteMutation, i *emails.Invite) (err error) { + data := emails.InviteData{ + InviterName: i.Requestor, + OrgName: i.OrgName, + EmailData: emails.EmailData{ + Sender: m.Emails.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: i.Recipient, + }, + }, + } + + if data.InviteURL, err = m.Emails.InviteURL(i.Token); err != nil { + return err + } + + msg, err := emails.InviteEmail(data) + if err != nil { + return err + } + + return m.Emails.Send(msg) +} + +// sendOrgAccepted composes the email metadata to notify the user they've been joined to the org +func sendOrgAccepted(ctx context.Context, m *generated.InviteMutation, i *emails.Invite) (err error) { + data := emails.InviteData{ + InviterName: i.Requestor, + OrgName: i.OrgName, + EmailData: emails.EmailData{ + Sender: m.Emails.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: i.Recipient, + }, + }, + } + + msg, err := emails.InviteAccepted(data) + if err != nil { + return err + } + + return m.Emails.Send(msg) +} + +var maxAttempts = 5 + +// updateInvite if the invite already exists, set a new token, secret, expiration, and increment the attempts +// error at max attempts to resend +func updateInvite(ctx context.Context, m *generated.InviteMutation) (*generated.Invite, error) { + // get the existing invite by recipient and owner + rec, _ := m.Recipient() + ownerID, _ := m.OwnerID() + + invite, err := m.Client().Invite.Query().Where(invite.Recipient(rec)).Where(invite.OwnerID(ownerID)).Only(ctx) + if err != nil { + return nil, err + } + + // create update mutation + if invite.SendAttempts >= maxAttempts { + return nil, ErrMaxAttempts + } + + // increment attempts + invite.SendAttempts++ + + m.SetSendAttempts(invite.SendAttempts) + + // these were already set when the invite was attempted to be added + // we do not need to create these again + secret, _ := m.Secret() + token, _ := m.Token() + expiresAt, _ := m.Expires() + + // update the invite + return m.Client().Invite. + UpdateOneID(invite.ID). + SetSendAttempts(invite.SendAttempts). + SetToken(token). + SetExpires(expiresAt). + SetSecret(secret). + Save(ctx) +} + +// deleteInvite deletes an invite from the database +func deleteInvite(ctx context.Context, m *generated.InviteMutation) error { + id, _ := m.ID() + + if err := m.Client().Invite.DeleteOneID(id).Exec(ctx); err != nil { + m.Logger.Errorw("unable to delete invite", "error", err) + + return err + } + + return nil +} + +func getInvite(ctx context.Context, m *generated.InviteMutation) (*generated.Invite, error) { + rec, _ := m.Recipient() + ownerID, _ := m.OwnerID() + + return m.Client().Invite.Query().Where(invite.Recipient(rec)).Where(invite.OwnerID(ownerID)).Only(ctx) +} diff --git a/internal/ent/hooks/invite_test.go b/internal/ent/hooks/invite_test.go new file mode 100644 index 0000000..e95d606 --- /dev/null +++ b/internal/ent/hooks/invite_test.go @@ -0,0 +1,68 @@ +package hooks + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" +) + +func TestSetRequestor(t *testing.T) { + // setup valid user + userID := ulids.New().String() + userCtx, err := auth.NewTestEchoContextWithValidUser(userID) + require.NoError(t, err) + + // create parent context + ctx := context.WithValue(userCtx.Request().Context(), echocontext.EchoContextKey, userCtx) + + tests := []struct { + name string + ctx context.Context + want string + wantErr bool + }{ + { + name: "happy path, user found in context", + ctx: ctx, + want: userID, + wantErr: false, + }, + { + name: "no user in context", + ctx: context.Background(), + want: "", + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + invMut := &generated.InviteMutation{} + invMut.Logger = *zap.NewNop().Sugar() + + got, err := setRequestor(tt.ctx, invMut) + + requestor, ok := got.RequestorID() + + if tt.wantErr { + require.Error(t, err) + assert.False(t, ok) + + return + } + + require.NoError(t, err) + require.True(t, ok) + + assert.Equal(t, userID, requestor) + }) + } +} diff --git a/internal/ent/hooks/organization.go b/internal/ent/hooks/organization.go new file mode 100644 index 0000000..26464af --- /dev/null +++ b/internal/ent/hooks/organization.go @@ -0,0 +1,502 @@ +package hooks + +import ( + "context" + "fmt" + + "entgo.io/ent" + + dbx "github.com/theopenlane/dbx/pkg/dbxclient" + dbxenums "github.com/theopenlane/dbx/pkg/enums" + "github.com/theopenlane/entx" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/utils/gravatar" + "github.com/theopenlane/utils/marionette" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" +) + +// HookOrganization runs on org mutations to set default values that are not provided +func HookOrganization() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.OrganizationFunc(func(ctx context.Context, mutation *generated.OrganizationMutation) (generated.Value, error) { + // if this is a soft delete, skip this hook + if entx.CheckIsSoftDelete(ctx) { + return next.Mutate(ctx, mutation) + } + + if mutation.Op().Is(ent.OpCreate) { + // generate a default org setting schema if not provided + if err := createOrgSettings(ctx, mutation); err != nil { + return nil, err + } + + // check if this is a child org, error if parent org is a personal org + if err := personalOrgNoChildren(ctx, mutation); err != nil { + return nil, err + } + } + + // set default display name and avatar if not provided + setDefaultsOnMutations(mutation) + + v, err := next.Mutate(ctx, mutation) + if err != nil { + return v, err + } + + if mutation.Op().Is(ent.OpCreate) { + orgCreated, ok := v.(*generated.Organization) + if !ok { + return nil, err + } + + // create the admin organization member if not using an API token (which is not associated with a user) + // otherwise add the API token for admin access to the newly created organization + if err := createOrgMemberOwner(ctx, orgCreated.ID, mutation); err != nil { + return v, err + } + + // create the database, if the org has a dedicated db and dbx is available + if orgCreated.DedicatedDb && mutation.DBx != nil { + settings, err := orgCreated.Setting(ctx) + if err != nil { + mutation.Logger.Errorw("unable to get organization settings") + + return nil, err + } + + if err := mutation.Marionette.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return createDatabase(ctx, orgCreated.ID, settings.GeoLocation.String(), mutation) + }), marionette.WithErrorf("could not send create the database for %s", orgCreated.Name), + ); err != nil { + mutation.Logger.Errorw("unable to queue database creation") + + return v, err + } + } + + // update the session to drop the user into the new organization + // if the org is not a personal org, as personal orgs are created during registration + // and sessions are already set + if !orgCreated.PersonalOrg { + as := newAuthSession(mutation.SessionConfig, mutation.TokenManager) + + if err := updateUserAuthSession(ctx, as, orgCreated.ID); err != nil { + return v, err + } + + if err := postCreation(ctx, orgCreated, mutation); err != nil { + return v, err + } + } + } + + return v, err + }) + }, ent.OpCreate|ent.OpUpdateOne) +} + +// HookOrganizationDelete runs on org delete mutations to ensure the org can be deleted +func HookOrganizationDelete() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.OrganizationFunc(func(ctx context.Context, mutation *generated.OrganizationMutation) (generated.Value, error) { + // by pass checks on invite or pre-allowed request + // this includes things like the edge-cleanup on user deletion + if _, allow := privacy.DecisionFromContext(ctx); allow { + return next.Mutate(ctx, mutation) + } + + // ensure it's a soft delete or a hard delete, otherwise skip this hook + if !isDeleteOp(ctx, mutation) { + return next.Mutate(ctx, mutation) + } + + // validate the organization can be deleted + if err := validateDeletion(ctx, mutation); err != nil { + return nil, err + } + + v, err := next.Mutate(ctx, mutation) + if err != nil { + return v, err + } + + newOrgID, err := updateUserDefaultOrgOnDelete(ctx, mutation) + // if we got an error, return it + // if we didn't get a new org id, keep going and don't + // update the session cookie + if err != nil || newOrgID == "" { + return v, err + } + + // if the deleted org was the current org, update the session cookie + as := newAuthSession(mutation.SessionConfig, mutation.TokenManager) + + if err := updateUserAuthSession(ctx, as, newOrgID); err != nil { + return v, err + } + + return v, nil + }) + }, ent.OpDeleteOne|ent.OpDelete|ent.OpUpdate|ent.OpUpdateOne) +} + +// setDefaultsOnMutations sets default values on mutations that are not provided +func setDefaultsOnMutations(mutation *generated.OrganizationMutation) { + if name, ok := mutation.Name(); ok { + if displayName, ok := mutation.DisplayName(); ok { + if displayName == "" { + mutation.SetDisplayName(name) + } + } + + url := gravatar.New(name, nil) + mutation.SetAvatarRemoteURL(url) + } +} + +// createOrgSettings creates the default organization settings for a new org +func createOrgSettings(ctx context.Context, mutation *generated.OrganizationMutation) error { + // if this is empty generate a default org setting schema + if _, exists := mutation.SettingID(); !exists { + // sets up default org settings using schema defaults + orgSettingID, err := defaultOrganizationSettings(ctx, mutation) + if err != nil { + mutation.Logger.Errorw("error creating default organization settings", "error", err) + + return err + } + + // add the org setting ID to the input + mutation.SetSettingID(orgSettingID) + } + + return nil +} + +// createEntityTypes creates the default entity types for a new org +func createEntityTypes(ctx context.Context, orgID string, mutation *generated.OrganizationMutation) error { + if len(mutation.EntConfig.EntityTypes) == 0 { + return nil + } + + builders := make([]*generated.EntityTypeCreate, 0, len(mutation.EntConfig.EntityTypes)) + for _, entityType := range mutation.EntConfig.EntityTypes { + builders = append(builders, mutation.Client().EntityType.Create(). + SetName(entityType). + SetOwnerID(orgID), + ) + } + + if err := mutation.Client().EntityType.CreateBulk(builders...).Exec(ctx); err != nil { + mutation.Logger.Errorw("error creating entity types", "error", err) + + return err + } + + return nil +} + +// postCreation runs after an organization is created to perform additional setup +func postCreation(ctx context.Context, orgCreated *generated.Organization, mutation *generated.OrganizationMutation) error { + // capture the original org id, ignore error as this will not be set in all cases + originalOrg, _ := auth.GetOrganizationIDFromContext(ctx) // nolint: errcheck + + // set the new org id in the auth context to process the rest of the post creation steps + if err := auth.SetOrganizationIDInAuthContext(ctx, orgCreated.ID); err != nil { + return err + } + + // create default entity types, if configured + if err := createEntityTypes(ctx, orgCreated.ID, mutation); err != nil { + return err + } + + // reset the original org id in the auth context if it was previously set + if originalOrg != "" { + if err := auth.SetOrganizationIDInAuthContext(ctx, originalOrg); err != nil { + return err + } + } + + return nil +} + +// validateDeletion ensures the organization can be deleted +func validateDeletion(ctx context.Context, mutation *generated.OrganizationMutation) error { + deletedID, ok := mutation.ID() + if !ok { + return nil + } + + // do not allow deletion of personal orgs, these are deleted when the user is deleted + deletedOrg, err := mutation.Client().Organization.Get(ctx, deletedID) + if err != nil { + return err + } + + if deletedOrg.PersonalOrg { + mutation.Logger.Debugw("attempt to delete personal org detected") + + return fmt.Errorf("%w: %s", ErrInvalidInput, "cannot delete personal organizations") + } + + return nil +} + +// updateUserDefaultOrgOnDelete updates the user's default org if the org being deleted is the user's default org +func updateUserDefaultOrgOnDelete(ctx context.Context, mutation *generated.OrganizationMutation) (string, error) { + currentUserID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return "", err + } + + // check if this organization is the user's default org + deletedOrgID, ok := mutation.ID() + if !ok { + return "", nil + } + + return checkAndUpdateDefaultOrg(ctx, currentUserID, deletedOrgID, mutation.Client()) +} + +// checkAndUpdateDefaultOrg checks if the old organization is the user's default org and updates it if needed +// this is used when an organization is deleted, as well as when a user is removed from an organization +func checkAndUpdateDefaultOrg(ctx context.Context, userID string, oldOrgID string, client *generated.Client) (string, error) { + // check if this is the user's default org + userSetting, err := client. + UserSetting. + Query(). + Where( + usersetting.UserIDEQ(userID), + ). + WithDefaultOrg(). + Only(ctx) + if err != nil { + return "", err + } + + // if the user's default org was deleted this will now be nil + if userSetting.Edges.DefaultOrg == nil || userSetting.Edges.DefaultOrg.ID == oldOrgID { + // set the user's default org another org + // get the first org that was not the org being deleted + newDefaultOrgID, err := client. + Organization. + Query(). + FirstID(ctx) + if err != nil { + return "", err + } + + if _, err = client.UserSetting. + UpdateOneID(userSetting.ID). + SetDefaultOrgID(newDefaultOrgID). + Save(ctx); err != nil { + return "", err + } + + return newDefaultOrgID, nil + } + + return userSetting.Edges.DefaultOrg.ID, nil +} + +// createDatabase creates a new database for the organization +func createDatabase(ctx context.Context, orgID, geo string, mutation *generated.OrganizationMutation) error { + // set default geo if not provided + if geo == "" { + geo = enums.Amer.String() + } + + input := dbx.CreateDatabaseInput{ + OrganizationID: orgID, + Geo: &geo, + Provider: &dbxenums.Turso, + } + + mutation.Logger.Infow("creating database", "org", input.OrganizationID, "geo", input.Geo, "provider", input.Provider) + + if _, err := mutation.DBx.CreateDatabase(ctx, input); err != nil { + mutation.Logger.Errorw("error creating database", "error", err) + + return err + } + + // create the database + return nil +} + +// defaultOrganizationSettings creates the default organizations settings for a new org +func defaultOrganizationSettings(ctx context.Context, mutation *generated.OrganizationMutation) (string, error) { + input := generated.CreateOrganizationSettingInput{} + + organizationSetting, err := mutation.Client().OrganizationSetting.Create().SetInput(input).Save(ctx) + if err != nil { + return "", err + } + + return organizationSetting.ID, nil +} + +// personalOrgNoChildren checks if the mutation is for a child org, and if so returns an error +// if the parent org is a personal org +func personalOrgNoChildren(ctx context.Context, mutation *generated.OrganizationMutation) error { + // check if this is a child org, error if parent org is a personal org + parentOrgID, ok := mutation.ParentID() + if ok { + // check if parent org is a personal org + parentOrg, err := mutation.Client().Organization.Get(ctx, parentOrgID) + if err != nil { + return err + } + + if parentOrg.PersonalOrg { + return ErrPersonalOrgsNoChildren + } + } + + return nil +} + +// createParentOrgTuple creates a parent org tuple if the newly created org has a parent +func createParentOrgTuple(ctx context.Context, m *generated.OrganizationMutation, parentOrgID, childOrgID string) error { + req := fgax.TupleRequest{ + SubjectID: parentOrgID, + SubjectType: "organization", + ObjectID: childOrgID, + ObjectType: "organization", + Relation: fgax.ParentRelation, + } + + tuple := fgax.GetTupleKey(req) + + if _, err := m.Authz.WriteTupleKeys(ctx, []fgax.TupleKey{ + tuple, + }, nil); err != nil { + m.Logger.Errorw("failed to create relationship tuple", "error", err) + + return err + } + + return nil +} + +// createOrgMemberOwner creates the owner of the organization +func createOrgMemberOwner(ctx context.Context, oID string, m *generated.OrganizationMutation) error { + // This is handled by the user create hook for personal orgs + personalOrg, _ := m.PersonalOrg() + if personalOrg { + return nil + } + + // If this is a child org, create a parent org tuple instead of owner + parentOrgID, ok := m.ParentID() + if ok && parentOrgID != "" { + return createParentOrgTuple(ctx, m, parentOrgID, oID) + } + + // if this was created with an API token, do not create an owner but add the service tuple to fga + if auth.IsAPITokenAuthentication(ctx) { + return createServiceTuple(ctx, oID, m) + } + + // get userID from context + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + m.Logger.Errorw("unable to get user id from echo context, unable to add user to organization") + + return err + } + + // Add User as owner of organization + owner := enums.RoleOwner + input := generated.CreateOrgMembershipInput{ + UserID: userID, + OrganizationID: oID, + Role: &owner, + } + + if _, err := m.Client().OrgMembership.Create().SetInput(input).Save(ctx); err != nil { + m.Logger.Errorw("error creating org membership for owner", "error", err) + + return err + } + + // set the user's default org to the new org + return updateDefaultOrgIfPersonal(ctx, userID, oID, m.Client()) +} + +// createServiceTuple creates a service tuple for the organization and api key so the organization can be accessed +func createServiceTuple(ctx context.Context, oID string, m *generated.OrganizationMutation) error { + // get userID from context + subjectID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + m.Logger.Errorw("unable to get user id from echo context, unable to add user to organization") + + return err + } + + // allow the api token to edit the newly created organization, no other users will have access + // so this is the minimum required access + role := fgax.CanEdit + + // get tuple key + req := fgax.TupleRequest{ + SubjectID: subjectID, + SubjectType: "service", + ObjectID: oID, + ObjectType: "organization", + Relation: role, + } + + tuple := fgax.GetTupleKey(req) + + if _, err := m.Authz.WriteTupleKeys(ctx, []fgax.TupleKey{tuple}, nil); err != nil { + m.Logger.Errorw("failed to create relationship tuple", "error", err) + + return err + } + + m.Logger.Debugw("created relationship tuples", "relation", role, "object", tuple.Object) + + return nil +} + +// updateDefaultOrgIfPersonal updates the user's default org if the user has no default org or +// the default org is their personal org +// the client must be passed in, rather than using the client in the context because +// this function is sometimes called from a REST handler where the client is not available in the context +func updateDefaultOrgIfPersonal(ctx context.Context, userID, orgID string, client *generated.Client) error { + // check if the user has a default org + userSetting, err := client. + UserSetting. + Query(). + Where( + usersetting.UserIDEQ(userID), + ). + WithDefaultOrg(). + Only(ctx) + if err != nil { + return err + } + + // if the user has no default org, or the default org is the personal org, set the new org as the default org + if userSetting.Edges.DefaultOrg == nil || userSetting.Edges.DefaultOrg.ID == "" || + userSetting.Edges.DefaultOrg.PersonalOrg { + if _, err = client.UserSetting. + UpdateOneID(userSetting.ID). + SetDefaultOrgID(orgID). + Save(ctx); err != nil { + return err + } + } + + return nil +} diff --git a/internal/ent/hooks/orgmembers.go b/internal/ent/hooks/orgmembers.go new file mode 100644 index 0000000..e61129f --- /dev/null +++ b/internal/ent/hooks/orgmembers.go @@ -0,0 +1,152 @@ +package hooks + +import ( + "context" + "fmt" + + "entgo.io/ent" + "github.com/99designs/gqlgen/graphql" + ph "github.com/posthog/posthog-go" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" +) + +func HookOrgMembers() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.OrgMembershipFunc(func(ctx context.Context, mutation *generated.OrgMembershipMutation) (generated.Value, error) { + // check role, if its not set the default is member + role, _ := mutation.Role() + if role == enums.RoleOwner { + return next.Mutate(ctx, mutation) + } + + orgID, exists := mutation.OrganizationID() + if !exists || orgID == "" { + var err error + // get the organization based on authorized context if its not set + orgID, err = auth.GetOrganizationIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get organization id from context: %w", err) + } + + // set organization id in mutation + mutation.SetOrganizationID(orgID) + } + + // get the organization + org, err := mutation.Client().Organization.Get(ctx, orgID) + if err != nil { + mutation.Logger.Errorw("error getting organization", "error", err) + + return nil, err + } + + // do not allow members to be added to personal orgs + if org.PersonalOrg { + return nil, ErrPersonalOrgsNoMembers + } + + retValue, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + // check to see if the default org needs to be updated for the user + if err := updateOrgMemberDefaultOrgOnCreate(ctx, mutation, orgID); err != nil { + return retValue, err + } + + if userID, ok := mutation.UserID(); ok { + role, _ := mutation.Role() + + // allow the user to be pulled directly with a GET User, which is not allowed by default + // the traverser will not allow this, so we need to create a new context + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + + user, err := mutation.Client().User.Get(allowCtx, userID) + if err != nil { + mutation.Logger.Errorw("error getting user", "error", err) + + return nil, err + } + + orgName, err := auth.GetOrganizationNameFromContext(ctx) + if err != nil { + mutation.Logger.Errorw("error getting org name from context", "error", err) + + return nil, err + } + + props := ph.NewProperties(). + Set("organization_name", orgName). + Set("user_name", user.FirstName+user.LastName). + Set("join_role", role.String()) + + mutation.Analytics.Event("org_membership", props) + } + + return retValue, err + }) + }, ent.OpCreate) +} + +// HookOrgMembersDelete is a hook that runs during the delete operation of an org membership +func HookOrgMembersDelete() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.OrgMembershipFunc(func(ctx context.Context, mutation *generated.OrgMembershipMutation) (generated.Value, error) { + // we only want to do this on direct deleteOrgMembership operations + // deleteOrganization will be handled by the organization hook + rootFieldCtx := graphql.GetRootFieldContext(ctx) + if rootFieldCtx == nil || rootFieldCtx.Object != "deleteOrgMembership" { + return next.Mutate(ctx, mutation) + } + + // get the existing org membership + id, ok := mutation.ID() + if !ok { + return nil, fmt.Errorf("%w: %s", ErrInvalidInput, "id is required") + } + + // get the org membership + orgMembership, err := mutation.Client().OrgMembership.Get(ctx, id) + if err != nil { + return nil, err + } + + // execute the delete operation + retValue, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + // check to see if the default org needs to be updated for the user + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + if _, err = checkAndUpdateDefaultOrg(allowCtx, orgMembership.UserID, orgMembership.OrganizationID, mutation.Client()); err != nil { + return nil, err + } + + return retValue, err + }) + }, ent.OpDeleteOne|ent.OpDelete|ent.OpUpdate|ent.OpUpdateOne) // handle soft deletes as well as hard deletes +} + +// updateOrgMemberDefaultOrgOnCreate updates the user's default org if the user has no default org or +// the default org is their personal org +func updateOrgMemberDefaultOrgOnCreate(ctx context.Context, mutation *generated.OrgMembershipMutation, orgID string) error { + // get the user id from the mutation, this is a required field + userID, ok := mutation.UserID() + if !ok { + // this should never happen because the mutation should have already failed + return fmt.Errorf("%w: %s", ErrInvalidInput, "user id is required") + } + + // allow the request, which is for a user other than the authenticated user + // to update the default org + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + + return updateDefaultOrgIfPersonal(allowCtx, userID, orgID, mutation.Client()) +} diff --git a/internal/ent/hooks/passwordresettoken.go b/internal/ent/hooks/passwordresettoken.go new file mode 100644 index 0000000..06d1b79 --- /dev/null +++ b/internal/ent/hooks/passwordresettoken.go @@ -0,0 +1,25 @@ +package hooks + +import ( + "context" + "time" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" +) + +// HookPasswordResetToken runs on reset token mutations and sets expires +func HookPasswordResetToken() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.PasswordResetTokenFunc(func(ctx context.Context, mutation *generated.PasswordResetTokenMutation) (generated.Value, error) { + expires, _ := mutation.TTL() + if expires.IsZero() { + mutation.SetTTL(time.Now().UTC().Add(time.Minute * 15).Truncate(time.Microsecond)) //nolint:mnd + } + + return next.Mutate(ctx, mutation) + }) + }, ent.OpCreate) +} diff --git a/internal/ent/hooks/personalaccesstoken.go b/internal/ent/hooks/personalaccesstoken.go new file mode 100644 index 0000000..6f42881 --- /dev/null +++ b/internal/ent/hooks/personalaccesstoken.go @@ -0,0 +1,60 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/pkg/auth" +) + +const ( + redacted = "*****************************" +) + +// HookCreatePersonalAccessToken runs on access token mutations and sets the owner id +func HookCreatePersonalAccessToken() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.PersonalAccessTokenFunc(func(ctx context.Context, mutation *generated.PersonalAccessTokenMutation) (generated.Value, error) { + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return nil, err + } + + // set user on the token + mutation.SetOwnerID(userID) + + return next.Mutate(ctx, mutation) + }) + }, ent.OpCreate) +} + +// HookUpdatePersonalAccessToken runs on access token update and redacts the token +func HookUpdatePersonalAccessToken() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.PersonalAccessTokenFunc(func(ctx context.Context, mutation *generated.PersonalAccessTokenMutation) (generated.Value, error) { + // do not allow user to be changed + _, ok := mutation.OwnerID() + if ok { + mutation.ClearOwner() + } + + retVal, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + // redact the token + pat, ok := retVal.(*generated.PersonalAccessToken) + if !ok { + return retVal, nil + } + + pat.Token = redacted + + return pat, nil + }) + }, ent.OpUpdate|ent.OpUpdateOne) +} diff --git a/internal/ent/hooks/sessions.go b/internal/ent/hooks/sessions.go new file mode 100644 index 0000000..915b430 --- /dev/null +++ b/internal/ent/hooks/sessions.go @@ -0,0 +1,57 @@ +package hooks + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/httpserve/authmanager" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" +) + +// newAuthSession creates a new auth session struct +func newAuthSession(sc *sessions.SessionConfig, tm *tokens.TokenManager) authmanager.Config { + as := authmanager.Config{} + + as.SetSessionConfig(sc) + as.SetTokenManager(tm) + + return as +} + +// updateUserAuthSession updates the user session with the new org ID +// and sets updated auth cookies +func updateUserAuthSession(ctx context.Context, as authmanager.Config, newOrgID string) error { + au, err := auth.GetAuthenticatedUserContext(ctx) + if err != nil { + return err + } + + user, err := generated.FromContext(ctx).User.Get(ctx, au.SubjectID) + if err != nil { + return err + } + + ec, err := echocontext.EchoContextFromContext(ctx) + if err != nil { + return err + } + + // generate a new auth session with the new org ID + // this will also set the session cookie + out, err := as.GenerateUserAuthSessionWithOrg(ec, user, newOrgID) + if err != nil { + return err + } + + // set the auth cookies + auth.SetAuthCookies(ec.Response().Writer, out.AccessToken, out.RefreshToken, *as.GetSessionConfig().CookieConfig) + + // update the context with the new tokens and session + auth.SetAccessTokenContext(ec, out.AccessToken) + auth.SetRefreshTokenContext(ec, out.RefreshToken) + + return err +} diff --git a/internal/ent/hooks/subscriber.go b/internal/ent/hooks/subscriber.go new file mode 100644 index 0000000..dafdd1e --- /dev/null +++ b/internal/ent/hooks/subscriber.go @@ -0,0 +1,116 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/sendgrid" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/pkg/tokens" +) + +// HookSubscriber runs on subscriber create mutations +func HookSubscriber() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.SubscriberFunc(func(ctx context.Context, m *generated.SubscriberMutation) (generated.Value, error) { + email, ok := m.Email() + if !ok || email == "" { + return nil, ErrEmailRequired + } + + if err := createVerificationToken(m, email); err != nil { + return nil, err + } + + retValue, err := next.Mutate(ctx, m) + if err != nil { + return nil, err + } + + if err := queueSubscriberEmail(ctx, m); err != nil { + return nil, err + } + + return retValue, err + }) + }, ent.OpCreate) +} + +// queueSubscriberEmail queues the email to be sent to the subscriber +func queueSubscriberEmail(ctx context.Context, m *generated.SubscriberMutation) error { + // Get the details from the mutation, these will never be empty because they are set in the hook + orgID, _ := m.OwnerID() + tok, _ := m.Token() + email, _ := m.Email() + + // Get the organization name + org, err := m.Client().Organization.Get(ctx, orgID) + if err != nil { + return err + } + + // send emails via Marionette as to not create blocking operations in the server + if err := m.Marionette.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return sendSubscriberEmail(m, org.Name, tok) + }), marionette.WithRetries(3), //nolint:mnd + marionette.WithErrorf("could not send subscriber verification email to user %s", email), + ); err != nil { + return err + } + + return nil +} + +// sendSubscriberEmail sends an email to confirm a user's subscription +func sendSubscriberEmail(m *generated.SubscriberMutation, orgName, token string) error { + e, _ := m.Email() + + data := emails.SubscriberEmailData{ + OrgName: orgName, + EmailData: emails.EmailData{ + Sender: m.Emails.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: e, + }, + }, + } + + var err error + if data.VerifySubscriberURL, err = m.Emails.SubscriberVerifyURL(token); err != nil { + return err + } + + msg, err := emails.SubscribeEmail(data) + if err != nil { + return err + } + + // Send the email + return m.Emails.Send(msg) +} + +// createVerificationToken creates a new email verification token for the user +func createVerificationToken(m *generated.SubscriberMutation, email string) error { + // Create a unique token from the user's email address + verify, err := tokens.NewVerificationToken(email) + if err != nil { + return err + } + + // Sign the token to ensure that we can verify it later + token, secret, err := verify.Sign() + if err != nil { + return err + } + + m.SetToken(token) + m.SetTTL(verify.ExpiresAt) + m.SetSecret(secret) + + return nil +} diff --git a/internal/ent/hooks/tfasettings.go b/internal/ent/hooks/tfasettings.go new file mode 100644 index 0000000..8c553f5 --- /dev/null +++ b/internal/ent/hooks/tfasettings.go @@ -0,0 +1,105 @@ +package hooks + +import ( + "context" + "database/sql" + + "entgo.io/ent" + "github.com/99designs/gqlgen/graphql" + + "github.com/theopenlane/utils/totp" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/pkg/auth" +) + +func HookEnableTFA() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.TFASettingFunc(func(ctx context.Context, mutation *generated.TFASettingMutation) (generated.Value, error) { + // once verified, create recovery codes + verified, ok := mutation.Verified() + + // if recovery codes are cleared, generate new ones + gtx := graphql.GetOperationContext(ctx) + regenBackupCodes, _ := gtx.Variables["input"].(map[string]interface{})["regenBackupCodes"].(bool) + + if (ok && verified) || regenBackupCodes { + u, err := constructTOTPUser(ctx, mutation) + if err != nil { + return nil, err + } + + u.TFASecret, err = mutation.TOTP.TOTPManager.TOTPSecret(u) + if err != nil { + return nil, err + } + + codes := mutation.TOTP.TOTPManager.GenerateRecoveryCodes() + mutation.SetRecoveryCodes(codes) + + if verified { + // update user settings + _, err := mutation.Client().UserSetting.Update(). + Where(usersetting.UserID(u.ID)). + SetIsTfaEnabled(true). // set tfa enabled to true + Save(ctx) + if err != nil { + return nil, err + } + } + } + + return next.Mutate(ctx, mutation) + }) + }, ent.OpUpdate|ent.OpUpdateOne) +} + +// constructTOTPUser constructs a TOTP user object from the mutation +func constructTOTPUser(ctx context.Context, mutation *generated.TFASettingMutation) (*totp.User, error) { + userID, ok := mutation.OwnerID() + if !ok { + var err error + + userID, err = auth.GetUserIDFromContext(ctx) + if err != nil { + return nil, err + } + } + + u := &totp.User{ + ID: userID, + } + + // get the user object + user, err := mutation.Client().User.Get(ctx, userID) + if err != nil { + return nil, err + } + + // get the full setting object + setting, err := user.Setting(ctx) + if err != nil { + return nil, err + } + + // set the TFA settings + u.IsEmailOTPAllowed, _ = mutation.EmailOtpAllowed() + u.IsPhoneOTPAllowed, _ = mutation.PhoneOtpAllowed() + u.IsTOTPAllowed, _ = mutation.TotpAllowed() + + // setup account name fields + u.Email = sql.NullString{ + String: user.Email, + } + + phoneNumber := setting.PhoneNumber + if phoneNumber != nil { + u.Phone = sql.NullString{ + String: *setting.PhoneNumber, + } + } + + return u, nil +} diff --git a/internal/ent/hooks/tuples.go b/internal/ent/hooks/tuples.go new file mode 100644 index 0000000..db61ecd --- /dev/null +++ b/internal/ent/hooks/tuples.go @@ -0,0 +1,32 @@ +package hooks + +import ( + "strings" + + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/pkg/enums" +) + +// getTupleKeyFromRole creates a Tuple key with the provided subject, object, and role +func getTupleKeyFromRole(req fgax.TupleRequest, role enums.Role) (fgax.TupleKey, error) { + fgaRelation, err := roleToRelation(role) + if err != nil { + return fgax.NewTupleKey(), err + } + + req.Relation = fgaRelation + + return fgax.GetTupleKey(req), nil +} + +func roleToRelation(r enums.Role) (string, error) { + switch r { + case enums.RoleOwner, enums.RoleAdmin, enums.RoleMember: + return strings.ToLower(r.String()), nil + case fgax.ParentRelation: + return r.String(), nil + default: + return "", ErrUnsupportedFGARole + } +} diff --git a/internal/ent/hooks/tuples_test.go b/internal/ent/hooks/tuples_test.go new file mode 100644 index 0000000..161a260 --- /dev/null +++ b/internal/ent/hooks/tuples_test.go @@ -0,0 +1,129 @@ +package hooks + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/pkg/enums" +) + +func TestGetTupleKeyFromRole(t *testing.T) { + testCases := []struct { + name string + subID string + subType string + objID string + objType string + role enums.Role + expectedRes fgax.TupleKey + expectedErr error + }{ + { + name: "happy path", + subID: "01HM7RYYECMKN3FJWSAZVVQE4A", + subType: "organization", + objID: "01HM7RVM7G2AVBQBTJA2TWCHHG", + objType: "group", + role: fgax.ParentRelation, + expectedRes: fgax.TupleKey{ + Subject: fgax.Entity{ + Kind: "organization", + Identifier: "01HM7RYYECMKN3FJWSAZVVQE4A", + }, + Relation: "parent", + Object: fgax.Entity{ + Kind: "group", + Identifier: "01HM7RVM7G2AVBQBTJA2TWCHHG", + }, + }, + }, + { + name: "invalid role", + subID: "01HM7RYYECMKN3FJWSAZVVQE4A", + subType: "organization", + objID: "01HM7RVM7G2AVBQBTJA2TWCHHG", + objType: "group", + role: "baller", + expectedRes: fgax.TupleKey{}, + expectedErr: ErrUnsupportedFGARole, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + req := fgax.TupleRequest{ + SubjectID: tc.subID, + SubjectType: tc.subType, + ObjectID: tc.objID, + ObjectType: tc.objType, + } + + res, err := getTupleKeyFromRole(req, tc.role) + + if tc.expectedErr != nil { + assert.Error(t, err) + assert.ErrorIs(t, err, tc.expectedErr) + + return + } + + require.NoError(t, err) + assert.Equal(t, tc.expectedRes, res) + }) + } +} + +func TestRoleToRelation(t *testing.T) { + testCases := []struct { + name string + roleInput enums.Role + expectedRes string + expectedErr error + }{ + { + name: "happy path, owner", + roleInput: enums.RoleOwner, + expectedRes: "owner", + }, + { + name: "happy path, admin", + roleInput: enums.RoleAdmin, + expectedRes: "admin", + }, + { + name: "happy path, member", + roleInput: enums.RoleMember, + expectedRes: "member", + }, + { + name: "happy path, parent", + roleInput: fgax.ParentRelation, + expectedRes: "parent", + }, + { + name: "invalid role", + roleInput: "baller", + expectedRes: "", + expectedErr: ErrUnsupportedFGARole, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + res, err := roleToRelation(tc.roleInput) + + if tc.expectedErr != nil { + assert.Error(t, err) + assert.ErrorIs(t, err, tc.expectedErr) + + return + } + + require.NoError(t, err) + assert.Equal(t, tc.expectedRes, res) + }) + } +} diff --git a/internal/ent/hooks/user.go b/internal/ent/hooks/user.go new file mode 100644 index 0000000..266ef7a --- /dev/null +++ b/internal/ent/hooks/user.go @@ -0,0 +1,237 @@ +package hooks + +import ( + "context" + "fmt" + "strings" + + "entgo.io/ent" + petname "github.com/dustinkirkland/golang-petname" + "github.com/theopenlane/entx" + "golang.org/x/text/cases" + "golang.org/x/text/language" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/passwd" +) + +const ( + personalOrgPrefix = "Personal Organization" +) + +// HookUser runs on user mutations validate and hash the password and set default values that are not provided +func HookUser() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.UserFunc(func(ctx context.Context, mutation *generated.UserMutation) (generated.Value, error) { + if password, ok := mutation.Password(); ok { + // validate password before its encrypted + if passwd.Strength(password) < passwd.Moderate { + return nil, auth.ErrPasswordTooWeak + } + + hash, err := passwd.CreateDerivedKey(password) + if err != nil { + return nil, err + } + + mutation.SetPassword(hash) + } + + if email, ok := mutation.Email(); ok { + // use the email without the domain as the display name, if not provided on creation + if mutation.Op().Is(ent.OpCreate) { + displayName, _ := mutation.DisplayName() + if displayName == "" { + displayName := strings.Split(email, "@")[0] + + mutation.SetDisplayName(displayName) + } + } + } + + // user settings are required, if this is empty generate a default setting schema + if mutation.Op().Is(ent.OpCreate) { + settingID, _ := mutation.SettingID() + if settingID == "" { + // sets up default user settings using schema defaults + userSettingID, err := defaultUserSettings(ctx, mutation) + if err != nil { + return nil, err + } + + // add the user setting ID to the input + mutation.SetSettingID(userSettingID) + } + } + + v, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + userCreated, ok := v.(*generated.User) + if !ok { + return nil, err + } + + if mutation.Op().Is(ent.OpCreate) { + userCreated.Sub = userCreated.ID + + // set the subject to the user id + if _, err := mutation.Client().User. + UpdateOneID(userCreated.ID). + SetSub(userCreated.Sub). + Save(ctx); err != nil { + return nil, err + } + + // when a user is created, we create a personal user org + setting, err := createPersonalOrg(ctx, mutation.Client(), userCreated) + if err != nil { + return nil, err + } + + userCreated.Edges.Setting = setting + } + + return userCreated, err + }) + }, ent.OpCreate|ent.OpUpdateOne) +} + +// HookDeleteUser runs on user deletions to clean up personal organizations +func HookDeleteUser() ent.Hook { + return func(next ent.Mutator) ent.Mutator { + return hook.UserFunc(func(ctx context.Context, mutation *generated.UserMutation) (generated.Value, error) { + if mutation.Op().Is(ent.OpDelete|ent.OpDeleteOne) || entx.CheckIsSoftDelete(ctx) { + userID, _ := mutation.ID() + // get the personal org id + user, err := mutation.Client().User.Get(ctx, userID) + if err != nil { + return nil, err + } + + personalOrgIDs, err := mutation.Client().User.QueryOrganizations(user).Where(organization.PersonalOrg(true)).IDs(ctx) + if err != nil { + return nil, err + } + + // run the mutation first + v, err := next.Mutate(ctx, mutation) + if err != nil { + return nil, err + } + + // cleanup personal org(s) + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + if _, err := mutation.Client(). + Organization. + Delete(). + Where(organization.IDIn(personalOrgIDs...)). + Exec(allowCtx); err != nil { + return nil, err + } + + return v, err + } + + return next.Mutate(ctx, mutation) + }) + } +} + +// getPersonalOrgInput generates the input for a new personal organization +// personal orgs are assigned to all new users when registering +func getPersonalOrgInput(user *generated.User) generated.CreateOrganizationInput { + // caser is used to capitalize the first letter of words + caser := cases.Title(language.AmericanEnglish) + + // generate random name for personal orgs + name := caser.String(petname.Generate(2, " ")) //nolint:mnd + displayName := name + personalOrg := true + desc := fmt.Sprintf("%s - %s %s", personalOrgPrefix, caser.String(user.FirstName), caser.String(user.LastName)) + + return generated.CreateOrganizationInput{ + Name: name, + DisplayName: &displayName, + Description: &desc, + PersonalOrg: &personalOrg, + } +} + +// createPersonalOrg creates an org for a user with a unique random name +func createPersonalOrg(ctx context.Context, dbClient *generated.Client, user *generated.User) (*generated.UserSetting, error) { + // this prevents a privacy check that would be required for regular orgs, but not a personal org + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + orgInput := getPersonalOrgInput(user) + + org, err := dbClient.Organization.Create().SetInput(orgInput).Save(ctx) + if err != nil { + // retry on unique constraint + if generated.IsConstraintError(err) { + return createPersonalOrg(ctx, dbClient, user) + } + + user.Logger.Errorw("unable to create personal org", "error", err.Error()) + + return nil, err + } + + // Create Role as owner for user in the personal org + input := generated.CreateOrgMembershipInput{ + OrganizationID: org.ID, + UserID: user.ID, + Role: &enums.RoleOwner, + } + + if _, err := dbClient.OrgMembership.Create(). + SetInput(input). + Save(ctx); err != nil { + user.Logger.Errorw("unable to add user as owner to organization", "error", err.Error()) + + return nil, err + } + + // set default org + return setDefaultOrg(ctx, dbClient, user, org) +} + +func setDefaultOrg(ctx context.Context, dbClient *generated.Client, user *generated.User, org *generated.Organization) (*generated.UserSetting, error) { + setting, err := user.Setting(ctx) + if err != nil { + user.Logger.Errorw("unable to get user settings", "error", err) + + return nil, err + } + + setting, err = dbClient.UserSetting.UpdateOneID(setting.ID).SetDefaultOrg(org).Save(ctx) + if err != nil { + user.Logger.Errorw("unable to set default org", "error", err) + + return nil, err + } + + // set the default org on the settings to eager load for the response + setting.Edges.DefaultOrg = org + + return setting, nil +} + +// defaultUserSettings creates the default user settings for a new user +func defaultUserSettings(ctx context.Context, user *generated.UserMutation) (string, error) { + input := generated.CreateUserSettingInput{} + + userSetting, err := user.Client().UserSetting.Create().SetInput(input).Save(ctx) + if err != nil { + return "", err + } + + return userSetting.ID, nil +} diff --git a/internal/ent/hooks/usersettings.go b/internal/ent/hooks/usersettings.go new file mode 100644 index 0000000..9034e1c --- /dev/null +++ b/internal/ent/hooks/usersettings.go @@ -0,0 +1,89 @@ +package hooks + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/iam/fgax" + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" +) + +// HookUserSetting runs on user settings mutations and validates input on update +func HookUserSetting() ent.Hook { + return hook.On(func(next ent.Mutator) ent.Mutator { + return hook.UserSettingFunc(func(ctx context.Context, mutation *generated.UserSettingMutation) (generated.Value, error) { + org, ok := mutation.DefaultOrgID() + if ok && !allowDefaultOrgUpdate(ctx, mutation, org) { + return nil, rout.InvalidField(rout.ErrOrganizationNotFound) + } + + // delete tfa setting if tfa is disabled + tfaEnabled, ok := mutation.IsTfaEnabled() + if ok && !tfaEnabled { + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return nil, err + } + + _, err = mutation.Client().TFASetting.Delete().Where(tfasetting.OwnerID(userID)).Exec(ctx) + if err != nil { + return nil, err + } + } + + return next.Mutate(ctx, mutation) + }) + }, ent.OpUpdate|ent.OpUpdateOne) +} + +// allowDefaultOrgUpdate checks if the user has access to the organization being updated as their default org +func allowDefaultOrgUpdate(ctx context.Context, mutation *generated.UserSettingMutation, orgID string) bool { + // allow if explicitly allowed + if _, allow := privacy.DecisionFromContext(ctx); allow { + return true + } + + // allow for org invite tokens + if rule.ContextHasPrivacyTokenOfType(ctx, &token.OrgInviteToken{}) { + return true + } + + // ensure user has access to the organization + // the ID is always set on update + userSettingID, _ := mutation.ID() + + owner, err := mutation.Client(). + User. + Query(). + Where( + user.HasSettingWith(usersetting.ID(userSettingID)), + ). + Only(ctx) + if err != nil { + return false + } + + req := fgax.AccessCheck{ + SubjectID: owner.ID, + SubjectType: auth.UserSubjectType, + ObjectID: orgID, + } + + allow, err := mutation.Authz.CheckOrgReadAccess(ctx, req) + if err != nil { + return false + } + + return allow +} diff --git a/internal/ent/interceptors/apitoken.go b/internal/ent/interceptors/apitoken.go new file mode 100644 index 0000000..2affa4e --- /dev/null +++ b/internal/ent/interceptors/apitoken.go @@ -0,0 +1,34 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" +) + +// InterceptorAPIToken is middleware to change the api token query +func InterceptorAPIToken() ent.Interceptor { + return ent.InterceptFunc(func(next ent.Querier) ent.Querier { + return intercept.APITokenFunc(func(ctx context.Context, q *generated.APITokenQuery) (generated.Value, error) { + v, err := next.Query(ctx, q) + if err != nil { + return nil, err + } + + apiTokens, ok := v.([]*generated.APIToken) + if !ok { + return v, err + } + + // redact the token on get + for _, t := range apiTokens { + t.Token = redacted + } + + return apiTokens, nil + }) + }) +} diff --git a/internal/ent/interceptors/auditlogs.go b/internal/ent/interceptors/auditlogs.go new file mode 100644 index 0000000..4aea2b8 --- /dev/null +++ b/internal/ent/interceptors/auditlogs.go @@ -0,0 +1,91 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + + "github.com/theopenlane/iam/fgax" + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/pkg/auth" +) + +// HistoryAccess is a traversal interceptor that checks if the user has the required role for the organization +func HistoryAccess(relation string, orgOwned, userOwed bool) ent.Interceptor { + return intercept.TraverseFunc(func(ctx context.Context, q intercept.Query) error { + au, err := auth.GetAuthenticatedUserContext(ctx) + if err != nil { + return err + } + + // check if the user has the audit log role for the organization + req := fgax.AccessCheck{ + Relation: relation, + SubjectID: au.SubjectID, + SubjectType: auth.GetAuthzSubjectType(ctx), + ObjectType: "organization", + } + + var allowedOrgs []string + + for _, orgID := range au.OrganizationIDs { + req.ObjectID = orgID + + allowed, err := generated.FromContext(ctx).Authz.CheckAccess(ctx, req) + if err != nil { + return err + } + + if allowed { + allowedOrgs = append(allowedOrgs, orgID) + } + } + + if len(allowedOrgs) == 0 { + return rout.ErrPermissionDenied + } + + return addFilter(ctx, q, orgOwned, userOwed, allowedOrgs) + }) +} + +// addFilter adds a filter to the query based on the authenticated user's organization +func addFilter(ctx context.Context, q intercept.Query, orgOwned, userOwed bool, allowedOrgs []string) error { + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + switch { + case q.Type() == "OrganizationHistory": + q.WhereP( + sql.FieldIn("ref", allowedOrgs...), + ) + case q.Type() == "OrganizationSettingHistory" || q.Type() == "OrgMembershipHistory": + q.WhereP( + sql.FieldIn("organization_id", allowedOrgs...), + ) + case orgOwned: + q.WhereP( + sql.FieldIn("owner_id", allowedOrgs...), + ) + case q.Type() == "UserHistory": + q.WhereP( + sql.FieldIn("ref", userID), + ) + case q.Type() == "UserSettingHistory": + q.WhereP( + sql.FieldIn("user_id", userID), + ) + case userOwed: + q.WhereP( + sql.FieldIn("owner_id", userID), + ) + } + + return nil +} diff --git a/internal/ent/interceptors/constants.go b/internal/ent/interceptors/constants.go new file mode 100644 index 0000000..3c583b8 --- /dev/null +++ b/internal/ent/interceptors/constants.go @@ -0,0 +1,8 @@ +package interceptors + +var ( + // ExistOperation is the operation type for Exist queries + ExistOperation = "Exist" + // IDsOperation is the operation type for IDs queries + IDsOperation = "IDs" +) diff --git a/internal/ent/interceptors/doc.go b/internal/ent/interceptors/doc.go new file mode 100644 index 0000000..fdd37ec --- /dev/null +++ b/internal/ent/interceptors/doc.go @@ -0,0 +1,2 @@ +// Package interceptors is middleware to alter the graphql query +package interceptors diff --git a/internal/ent/interceptors/errors.go b/internal/ent/interceptors/errors.go new file mode 100644 index 0000000..09cebe8 --- /dev/null +++ b/internal/ent/interceptors/errors.go @@ -0,0 +1,16 @@ +package interceptors + +import ( + "errors" +) + +var ( + // ErrInternalServerError is returned when an internal error occurs. + ErrInternalServerError = errors.New("internal server error") + + // ErrUnableToRetrieveUserID is returned when the user cannot be retrieved from the context + ErrUnableToRetrieveUserID = errors.New("unable to retrieve user from context") + + // ErrRetrievingObjects is returned when an error occurs while retrieving objects + ErrRetrievingObjects = errors.New("error retrieving objects") +) diff --git a/internal/ent/interceptors/group.go b/internal/ent/interceptors/group.go new file mode 100644 index 0000000..ce3bbc3 --- /dev/null +++ b/internal/ent/interceptors/group.go @@ -0,0 +1,105 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/pkg/auth" +) + +// InterceptorGroup is middleware to change the Group query +func InterceptorGroup() ent.Interceptor { + return ent.InterceptFunc(func(next ent.Querier) ent.Querier { + return intercept.GroupFunc(func(ctx context.Context, q *generated.GroupQuery) (generated.Value, error) { + // run the query + v, err := next.Query(ctx, q) + if err != nil { + return nil, err + } + + return filterGroupsByAccess(ctx, q, v) + }) + }) +} + +// filterGroupsByAccess checks fga, using ListObjects, and ensure user has view access to a group before it is returned +func filterGroupsByAccess(ctx context.Context, q *generated.GroupQuery, v ent.Value) ([]*generated.Group, error) { + q.Logger.Debugw("intercepting list group query") + + // return early if no groups + if v == nil { + return nil, nil + } + + qc := ent.QueryFromContext(ctx) + + var groups []*generated.Group + + // check if query is for an exists query, which returns a slice of group ids + // instead of the group objects + switch qc.Op { + case ExistOperation, IDsOperation: + groupIDs, ok := v.([]string) + if !ok { + q.Logger.Errorw("unexpected type for group query") + + return nil, ErrInternalServerError + } + + for _, g := range groupIDs { + groups = append(groups, &generated.Group{ID: g}) + } + default: + var ok bool + + groups, ok = v.([]*generated.Group) + if !ok { + q.Logger.Errorw("unexpected type for group query") + + return nil, ErrInternalServerError + } + } + + // get userID for tuple checks + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + q.Logger.Errorw("unable to get user id from echo context") + return nil, err + } + + // See all groups user has view access + req := fgax.ListRequest{ + SubjectID: userID, + SubjectType: auth.GetAuthzSubjectType(ctx), + ObjectType: "group", + } + + groupList, err := q.Authz.ListObjectsRequest(ctx, req) + if err != nil { + return nil, err + } + + userGroups := groupList.GetObjects() + + var accessibleGroups []*generated.Group + + for _, g := range groups { + entityType := "group" + + if !fgax.ListContains(entityType, userGroups, g.ID) { + q.Logger.Infow("access denied to group", "relation", fgax.CanView, "group_id", g.ID, "type", entityType) + + continue + } + + // add group to accessible group + accessibleGroups = append(accessibleGroups, g) + } + + // return updated groups + return accessibleGroups, nil +} diff --git a/internal/ent/interceptors/hush.go b/internal/ent/interceptors/hush.go new file mode 100644 index 0000000..ee2d819 --- /dev/null +++ b/internal/ent/interceptors/hush.go @@ -0,0 +1,37 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/hooks" +) + +// InterceptorHush keeps it secret, keeps it safe +func InterceptorHush() ent.Interceptor { + return ent.InterceptFunc(func(next ent.Querier) ent.Querier { + return intercept.HushFunc(func(ctx context.Context, q *generated.HushQuery) (generated.Value, error) { + v, err := next.Query(ctx, q) + if err != nil { + return nil, err + } + + hush, ok := v.([]*generated.Hush) + // Skip all query types besides node queries (e.g., Count, Scan, GroupBy). + if !ok { + return v, nil + } + + for _, u := range hush { + if err := hooks.Decrypt(ctx, q.Secrets, u); err != nil { + return nil, err + } + } + + return hush, nil + }) + }) +} diff --git a/internal/ent/interceptors/mixin_intercetpor.go b/internal/ent/interceptors/mixin_intercetpor.go new file mode 100644 index 0000000..c37ad31 --- /dev/null +++ b/internal/ent/interceptors/mixin_intercetpor.go @@ -0,0 +1,20 @@ +package interceptors + +type ( + // SkipMode is a bit flag for the Skip annotation. + SkipMode int +) + +const ( + // SkipOnlyQuery skips the interceptor on `Only` queries. + SkipOnlyQuery SkipMode = 1 << iota + // SkipAllQuery skips the interceptor on `All` queries. + SkipAllQuery + // SkipExistsQuery skips the interceptor on `Exists` queries. + SkipExistsQuery + + // SkipAll is default mode to skip all. + SkipAll = SkipOnlyQuery | + SkipAllQuery | + SkipExistsQuery +) diff --git a/internal/ent/interceptors/organization.go b/internal/ent/interceptors/organization.go new file mode 100644 index 0000000..b7d9676 --- /dev/null +++ b/internal/ent/interceptors/organization.go @@ -0,0 +1,213 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" +) + +// InterceptorOrganization is middleware to change the Organization query +func InterceptorOrganization() ent.Interceptor { + return intercept.TraverseOrganization(func(ctx context.Context, q *generated.OrganizationQuery) error { + // by pass checks on invite or pre-allowed request + if _, allow := privacy.DecisionFromContext(ctx); allow { + return nil + } + + if rule.ContextHasPrivacyTokenOfType(ctx, &token.OrgInviteToken{}) || + rule.ContextHasPrivacyTokenOfType(ctx, &token.SignUpToken{}) { + return nil + } + + // if this is an API token, only allow the query if it is for the organization + if auth.IsAPITokenAuthentication(ctx) { + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err != nil { + return err + } + + q.Where(organization.IDEQ(orgID)) + + return nil + } + + if q.EntConfig.Flags.UseListObjectService { + return filterAllActorOrgIDsFromFGA(ctx, q) + } + + return filterAllActorOrgIDsFromDB(ctx, q) + }) +} + +// filterAllActorOrgIDsFromFGA returns all the organization IDs that the user is a member of, either directly or indirectly via a parent organization +// using the FGA ListObjects service +func filterAllActorOrgIDsFromFGA(ctx context.Context, q *generated.OrganizationQuery) error { + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + req := fgax.ListRequest{ + SubjectID: userID, + ObjectType: "organization", + } + + listObjectsResp, err := q.Authz.ListObjectsRequest(ctx, req) + if err != nil { + return err + } + + orgIDs := make([]string, 0, len(listObjectsResp.Objects)) + + for _, obj := range listObjectsResp.Objects { + entity, err := fgax.ParseEntity(obj) + if err != nil { + return err + } + + orgIDs = append(orgIDs, entity.Identifier) + } + + q.Where(organization.IDIn(orgIDs...)) + + return nil +} + +// filterAllActorOrgIDsFromDB returns all the organization IDs that the user is a member of, either directly or indirectly via a parent organization +// by querying the database directly and recursively getting all the child organizations +func filterAllActorOrgIDsFromDB(ctx context.Context, q *generated.OrganizationQuery) error { + // allow the request, otherwise we would be in an infinite loop, as this function is called by the interceptor + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + directOrgIDs, err := generated.FromContext(allowCtx).Organization. + Query(). + Where(organization.HasMembersWith(orgmembership.HasUserWith(user.ID(userID)))). + Select(organization.FieldID). + Strings(allowCtx) + if err != nil { + return err + } + + orgIDs, err := getAllRelatedChildOrgs(allowCtx, directOrgIDs) + if err != nil { + return err + } + + q.Where(organization.IDIn(orgIDs...)) + + return nil +} + +// getAllRelatedChildOrgs returns all the combined directly related orgs in addition to any child organizations of the parent organizations +func getAllRelatedChildOrgs(ctx context.Context, directOrgIDs []string) ([]string, error) { + allOrgsIDs := directOrgIDs + + for _, id := range directOrgIDs { + co, err := getChildOrgIDs(ctx, id) + if err != nil { + return nil, err + } + + allOrgsIDs = append(allOrgsIDs, co...) + } + + return allOrgsIDs, nil +} + +// getChildOrgIDs returns all the child organizations of the parent organization +func getChildOrgIDs(ctx context.Context, parentOrgID string) ([]string, error) { + // allow the request, otherwise we would be in an infinite loop, as this function is called by the interceptor + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + + // given an organization id, get all the children of that organization + childOrgs, err := generated.FromContext(ctx).Organization. + Query(). + Where( + organization.HasParentWith(organization.ID(parentOrgID)), + ). + Select(organization.FieldID). + Strings(allowCtx) + if err != nil { + return nil, err + } + + allOrgsIDs := childOrgs + + for _, orgID := range childOrgs { + // recursively get all the children of the children + coIDs, err := getChildOrgIDs(ctx, orgID) + if err != nil { + return nil, err + } + + allOrgsIDs = append(allOrgsIDs, coIDs...) + } + + return allOrgsIDs, nil +} + +// getAllParentOrgIDs returns all the parent organization IDs of the child organizations +func getAllParentOrgIDs(ctx context.Context, childOrgIDs []string) ([]string, error) { + allOrgsIDs := childOrgIDs + + for _, id := range childOrgIDs { + co, err := getParentOrgIDs(ctx, id) + if err != nil { + return nil, err + } + + allOrgsIDs = append(allOrgsIDs, co...) + } + + return allOrgsIDs, nil +} + +// getParentOrgIDs returns all the parent organizations of the child organization +// this should only be used to get the org members for the current org +// and does not imply the current user is a member or has access to the parent orgs +func getParentOrgIDs(ctx context.Context, childOrgID string) ([]string, error) { + // allow the request, otherwise we would be in an infinite loop, as this function is called by the interceptor + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + + parentOrgs, err := generated.FromContext(ctx).Organization. + Query(). + Where( + organization.HasChildrenWith(organization.ID(childOrgID)), + ). + Select(organization.FieldID). + Strings(allowCtx) + if err != nil { + return nil, err + } + + allOrgsIDs := parentOrgs + + for _, orgID := range parentOrgs { + // recursively get all the children of the children + coIDs, err := getParentOrgIDs(ctx, orgID) + if err != nil { + return nil, err + } + + allOrgsIDs = append(allOrgsIDs, coIDs...) + } + + return allOrgsIDs, nil +} diff --git a/internal/ent/interceptors/organizationsetting.go b/internal/ent/interceptors/organizationsetting.go new file mode 100644 index 0000000..88b93c3 --- /dev/null +++ b/internal/ent/interceptors/organizationsetting.go @@ -0,0 +1,33 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/generated/organizationsetting" + "github.com/theopenlane/core/pkg/auth" +) + +// InterceptorOrganizationSetting is middleware to change the org setting query +func InterceptorOrganizationSetting() ent.Interceptor { + return intercept.TraverseFunc(func(ctx context.Context, q intercept.Query) error { + // Organization list queries should not be filtered by organization id + // Same with OrganizationSetting queries with the Only operation + ctxQuery := ent.QueryFromContext(ctx) + if ctxQuery.Type == "Organization" || ctxQuery.Op == "Only" { + return nil + } + + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err != nil { + return err + } + + // sets the organization id on the query for the current organization + q.WhereP(organizationsetting.OrganizationID(orgID)) + + return nil + }) +} diff --git a/internal/ent/interceptors/orgmembers.go b/internal/ent/interceptors/orgmembers.go new file mode 100644 index 0000000..82a4211 --- /dev/null +++ b/internal/ent/interceptors/orgmembers.go @@ -0,0 +1,117 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + + "github.com/99designs/gqlgen/graphql" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" +) + +// TraverseOrgMembers is middleware to change the Org Members query +func TraverseOrgMembers() ent.Interceptor { + return intercept.TraverseFunc(func(ctx context.Context, q intercept.Query) error { + // bypass filter if the request is internal and already set to allowed + if _, allow := privacy.DecisionFromContext(ctx); allow { + return nil + } + + // Organization list queries should not be filtered by organization id + ctxQuery := ent.QueryFromContext(ctx) + if ctxQuery.Type == "Organization" { + return nil + } + + orgIDs, err := auth.GetOrganizationIDsFromContext(ctx) + if err != nil { + return err + } + + // get all parent orgs to ensure we get all OrgMembers in the org tree + allOrgsIDs, err := getAllParentOrgIDs(ctx, orgIDs) + if err != nil { + return err + } + + // sets the organization id on the query for the current organization + q.WhereP(orgmembership.OrganizationIDIn(allOrgsIDs...)) + + return nil + }) +} + +// InterceptorOrgMember is middleware to change the OrgMember query result +func InterceptorOrgMember() ent.Interceptor { + return ent.InterceptFunc(func(next ent.Querier) ent.Querier { + return intercept.OrgMembershipFunc(func(ctx context.Context, q *generated.OrgMembershipQuery) (generated.Value, error) { + // run the query + v, err := next.Query(ctx, q) + if err != nil { + return nil, err + } + + // deduplicate the org members if the query is for org members + members, ok := v.([]*generated.OrgMembership) + if !ok { + return v, err + } + + return dedupeOrgMembers(ctx, members) + }) + }) +} + +// dedupeOrgMembers removes duplicate org members from the list +func dedupeOrgMembers(ctx context.Context, members []*generated.OrgMembership) ([]*generated.OrgMembership, error) { + authorizedOrg, err := getQueriedOrg(ctx) + if err != nil { + return nil, err + } + + seen := map[string]*generated.OrgMembership{} + deduped := []*generated.OrgMembership{} + + for _, om := range members { + if _, ok := seen[om.UserID]; ok { + // prefer the direct membership over the indirect one + if om.OrganizationID == authorizedOrg { + seen[om.UserID] = om + } + } else { + deduped = append(deduped, om) + seen[om.UserID] = om + } + } + + return deduped, nil +} + +// getQueriedOrg gets the organization id from the context or the graphql context +func getQueriedOrg(ctx context.Context) (string, error) { + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err == nil { + return orgID, nil + } + + // when the organization id is not in the context, try to get it from the graphql context + // for the Organization query + gtx := graphql.GetFieldContext(ctx) + if gtx != nil { + if gtx.Object == "Organization" { + if gtx.Parent != nil && gtx.Parent.Args != nil { + orgID, ok := gtx.Parent.Args["id"] + if ok { + return orgID.(string), nil + } + } + } + } + + return "", ErrRetrievingObjects +} diff --git a/internal/ent/interceptors/personalaccesstoken.go b/internal/ent/interceptors/personalaccesstoken.go new file mode 100644 index 0000000..3119d31 --- /dev/null +++ b/internal/ent/interceptors/personalaccesstoken.go @@ -0,0 +1,38 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" +) + +const ( + redacted = "*****************************" +) + +// InterceptorPat is middleware to change the PAT query +func InterceptorPat() ent.Interceptor { + return ent.InterceptFunc(func(next ent.Querier) ent.Querier { + return intercept.PersonalAccessTokenFunc(func(ctx context.Context, q *generated.PersonalAccessTokenQuery) (generated.Value, error) { + v, err := next.Query(ctx, q) + if err != nil { + return nil, err + } + + pats, ok := v.([]*generated.PersonalAccessToken) + if !ok { + return v, err + } + + // redact the token on get + for _, pat := range pats { + pat.Token = redacted + } + + return pats, nil + }) + }) +} diff --git a/internal/ent/interceptors/query.go b/internal/ent/interceptors/query.go new file mode 100644 index 0000000..10f1208 --- /dev/null +++ b/internal/ent/interceptors/query.go @@ -0,0 +1,30 @@ +package interceptors + +import ( + "context" + "time" + + "entgo.io/ent" + "go.uber.org/zap" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" +) + +func QueryLogger(l *zap.SugaredLogger) ent.InterceptFunc { + return func(next ent.Querier) ent.Querier { + return ent.QuerierFunc(func(ctx context.Context, query generated.Query) (ent.Value, error) { + q, err := intercept.NewQuery(query) + if err != nil { + return nil, err + } + + start := time.Now() + defer func() { + l.Infow("query duration", "duration", time.Since(start), "schema", q.Type()) + }() + + return next.Query(ctx, query) + }) + } +} diff --git a/internal/ent/interceptors/user.go b/internal/ent/interceptors/user.go new file mode 100644 index 0000000..89a4c94 --- /dev/null +++ b/internal/ent/interceptors/user.go @@ -0,0 +1,159 @@ +package interceptors + +import ( + "context" + "slices" + + "entgo.io/ent" + + "github.com/99designs/gqlgen/graphql" + + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/pkg/auth" +) + +// TraverseUser returns an ent interceptor for user that filters users based on the context of the query +func TraverseUser() ent.Interceptor { + return intercept.TraverseUser(func(ctx context.Context, q *generated.UserQuery) error { + // bypass filter if the request is allowed, this happens when a user is + // being created, via invite or other method by another authenticated user + // or in tests + if _, allow := privacy.DecisionFromContext(ctx); allow { + return nil + } + + // allow users to be created without filtering + rootFieldCtx := graphql.GetRootFieldContext(ctx) + if rootFieldCtx != nil && rootFieldCtx.Object == "createUser" { + return nil + } + + switch filterType(ctx) { + // if we are looking at a user in the context of an organization or group + // filter for just those users + case "org": + if q.EntConfig.Flags.UseListUserService { + q.Logger.Debug("using FGA to filter users") + return filterUsingFGA(ctx, q) + } + + q.Logger.Debug("using the db to filter users") + + return filterUsingDB(ctx, q) + case "user": + // if we are looking at self + userID, err := auth.GetUserIDFromContext(ctx) + if err == nil { + q.Where(user.ID(userID)) + + return nil + } + default: + // if we want to get all users, don't apply any filters + return nil + } + + return nil + }) +} + +// filterType returns the type of filter to apply to the query +func filterType(ctx context.Context) string { + rootFieldCtx := graphql.GetRootFieldContext(ctx) + + // the extended resolvers allow members to be adding on creation or update of a group + // so we need to filter for the org + if rootFieldCtx != nil { + allowedCtx := []string{ + "createGroup", + "updateGroup", + "createGroupMembership", + "updateGroupMembership", + "organization", + } + + if slices.Contains(allowedCtx, rootFieldCtx.Object) { + return "org" + } + } + + qCtx := ent.QueryFromContext(ctx) + if qCtx == nil { + return "" + } + + switch qCtx.Type { + case "OrgMembership", "GroupMembership", "Group": + return "org" + case "Organization": + return "" // no filter because this is filtered at the org level + default: + return "user" + } +} + +// filterUsingFGA filters the user query using the FGA service to get the users with access to the org +func filterUsingFGA(ctx context.Context, q *generated.UserQuery) error { + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err != nil { + return err + } + + req := fgax.ListRequest{ + ObjectID: orgID, + ObjectType: "organization", + } + + listUserResp, err := q.Authz.ListUserRequest(ctx, req) + if err != nil { + return err + } + + userIDs := []string{} + + for _, user := range listUserResp.Users { + userIDs = append(userIDs, user.Object.Id) + } + + q.Where(user.IDIn(userIDs...)) + + return nil +} + +// filterUsingDB filters the user query using the database to get the the users that are members of the org +func filterUsingDB(ctx context.Context, q *generated.UserQuery) error { + orgIDs, err := auth.GetOrganizationIDsFromContext(ctx) + if err != nil { + return err + } + + // get child orgs in addition to the orgs the user is a direct member of + childOrgs, err := getAllRelatedChildOrgs(ctx, orgIDs) + if err != nil { + return err + } + + // get the parent orgs of the orgs the user is a member of to ensure all + // users in the org tree are returned + allOrgsIDs, err := getAllParentOrgIDs(ctx, orgIDs) + if err != nil { + return err + } + + allOrgsIDs = append(allOrgsIDs, childOrgs...) + + q.Where(user.HasOrgMembershipsWith( + orgmembership.HasOrganizationWith( + organization.IDIn(allOrgsIDs...), + ), + )) + + return nil +} diff --git a/internal/ent/interceptors/user_test.go b/internal/ent/interceptors/user_test.go new file mode 100644 index 0000000..51c437e --- /dev/null +++ b/internal/ent/interceptors/user_test.go @@ -0,0 +1,118 @@ +package interceptors + +import ( + "context" + "testing" + + "entgo.io/ent" + "github.com/99designs/gqlgen/graphql" + "github.com/stretchr/testify/assert" +) + +func TestFilterType(t *testing.T) { + tests := []struct { + name string + ctx context.Context + want string + }{ + { + name: "updateGroup", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "updateGroup", + }), &ent.QueryContext{ + Type: "", + }, + ), + want: "org", + }, + { + name: "createGroup", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "createGroup", + }), &ent.QueryContext{ + Type: "", + }, + ), + want: "org", + }, + { + name: "OrgMembership", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "", + }), &ent.QueryContext{ + Type: "OrgMembership", + }, + ), + want: "org", + }, + { + name: "OrgMembership", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "", + }), &ent.QueryContext{ + Type: "GroupMembership", + }, + ), + want: "org", + }, + { + name: "Group", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "", + }), &ent.QueryContext{ + Type: "Group", + }, + ), + want: "org", + }, + { + name: "Organization", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "", + }), &ent.QueryContext{ + Type: "Organization", + }, + ), + want: "", + }, + { + name: "User", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "", + }), &ent.QueryContext{ + Type: "User", + }, + ), + want: "user", + }, + { + name: "UserSetting", + ctx: ent.NewQueryContext(graphql.WithRootFieldContext(context.Background(), &graphql.RootFieldContext{ + Object: "", + }), &ent.QueryContext{ + Type: "UserSetting", + }, + ), + want: "user", + }, + { + name: "nil graphql context", + ctx: ent.NewQueryContext(context.Background(), &ent.QueryContext{ + Type: "UserSetting", + }), + want: "user", + }, + { + name: "nil ent context", // shouldn't happen but just in case + ctx: context.Background(), + want: "", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ft := filterType(tt.ctx) + + assert.Equal(t, tt.want, ft) + }) + } +} diff --git a/internal/ent/interceptors/usersetting.go b/internal/ent/interceptors/usersetting.go new file mode 100644 index 0000000..067014f --- /dev/null +++ b/internal/ent/interceptors/usersetting.go @@ -0,0 +1,60 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/pkg/auth" +) + +func InterceptorUserSetting() ent.Interceptor { + return intercept.TraverseUserSetting(func(ctx context.Context, q *generated.UserSettingQuery) error { + // bypass filter if the request is allowed, this happens when a user is + // being created, via invite or other method by another authenticated user + // or in tests + if _, allow := privacy.DecisionFromContext(ctx); allow { + return nil + } + + qCtx := ent.QueryFromContext(ctx) + if qCtx == nil { + return nil + } + + switch qCtx.Type { + // if we are looking at a user in the context of an organization or group + // filter for just those users + case "OrgMembership", "GroupMembership": + orgIDs, err := auth.GetOrganizationIDsFromContext(ctx) + if err == nil { + q.Where(usersetting.HasUserWith( + user.HasOrgMembershipsWith( + orgmembership.HasOrganizationWith( + organization.IDIn(orgIDs...), + ), + )), + ) + + return nil + } + default: + // if we are looking at self + userID, err := auth.GetUserIDFromContext(ctx) + if err == nil { + q.Where(usersetting.UserID(userID)) + + return nil + } + } + + return nil + }) +} diff --git a/internal/ent/mixin/doc.go b/internal/ent/mixin/doc.go new file mode 100644 index 0000000..d9a2257 --- /dev/null +++ b/internal/ent/mixin/doc.go @@ -0,0 +1,2 @@ +// Package mixin contains the mixin package +package mixin diff --git a/internal/ent/mixin/errors.go b/internal/ent/mixin/errors.go new file mode 100644 index 0000000..b149fab --- /dev/null +++ b/internal/ent/mixin/errors.go @@ -0,0 +1,23 @@ +package mixin + +import ( + "fmt" + + "entgo.io/ent" +) + +// UnexpectedMutationTypeError is returned when an unexpected mutation type is parsed +type UnexpectedMutationTypeError struct { + MutationType ent.Mutation +} + +// Error returns the UnexpectedAuditError in string format +func (e *UnexpectedMutationTypeError) Error() string { + return fmt.Sprintf("unexpected mutation type: %T", e.MutationType) +} + +func newUnexpectedMutationTypeError(arg ent.Mutation) *UnexpectedMutationTypeError { + return &UnexpectedMutationTypeError{ + MutationType: arg, + } +} diff --git a/internal/ent/mixin/softdelete_mixin.go b/internal/ent/mixin/softdelete_mixin.go new file mode 100644 index 0000000..43be19c --- /dev/null +++ b/internal/ent/mixin/softdelete_mixin.go @@ -0,0 +1,112 @@ +package mixin + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/contrib/entoas" + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/mixin" + "github.com/theopenlane/entx" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/hook" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/pkg/auth" +) + +// SoftDeleteMixin implements the soft delete pattern for schemas. +type SoftDeleteMixin struct { + mixin.Schema +} + +// Fields of the SoftDeleteMixin. +func (SoftDeleteMixin) Fields() []ent.Field { + return []ent.Field{ + field.Time("deleted_at"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), + entoas.Annotation{ReadOnly: true}, + ), + field.String("deleted_by"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), + entoas.Annotation{ReadOnly: true}, + ), + } +} + +// Interceptors of the SoftDeleteMixin. +func (d SoftDeleteMixin) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + intercept.TraverseFunc(func(ctx context.Context, q intercept.Query) error { + // Skip soft-delete, means include soft-deleted entities. + if skip, _ := ctx.Value(entx.SoftDeleteSkipKey{}).(bool); skip { + return nil + } + d.P(q) + return nil + }), + } +} + +// SoftDeleteHook will soft delete records, by changing the delete mutation to an update and setting +// the deleted_at and deleted_by fields, unless the softDeleteSkipKey is set +func (d SoftDeleteMixin) SoftDeleteHook(next ent.Mutator) ent.Mutator { + type SoftDelete interface { + SetOp(ent.Op) + Client() *generated.Client + SetDeletedAt(time.Time) + SetDeletedBy(string) + WhereP(...func(*sql.Selector)) + } + + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + if skip, _ := ctx.Value(entx.SoftDeleteSkipKey{}).(bool); skip { + return next.Mutate(ctx, m) + } + + actor, err := auth.GetUserIDFromContext(ctx) + if err != nil { + actor = "unknown" + } + + sd, ok := m.(SoftDelete) + if !ok { + return nil, newUnexpectedMutationTypeError(m) + } + + d.P(sd) + sd.SetOp(ent.OpUpdate) + + // set that the transaction is a soft-delete + ctx = entx.IsSoftDelete(ctx) + + sd.SetDeletedAt(time.Now()) + sd.SetDeletedBy(actor) + + return sd.Client().Mutate(ctx, m) + }) +} + +// Hooks of the SoftDeleteMixin. +func (d SoftDeleteMixin) Hooks() []ent.Hook { + return []ent.Hook{ + hook.On( + d.SoftDeleteHook, + ent.OpDeleteOne|ent.OpDelete, + ), + } +} + +// P adds a storage-level predicate to the queries and mutations. +func (d SoftDeleteMixin) P(w interface{ WhereP(...func(*sql.Selector)) }) { + w.WhereP( + sql.FieldIsNull(d.Fields()[0].Descriptor().Name), + ) +} diff --git a/internal/ent/mixin/user_owned_policy_mixin.go b/internal/ent/mixin/user_owned_policy_mixin.go new file mode 100644 index 0000000..e8b9a3e --- /dev/null +++ b/internal/ent/mixin/user_owned_policy_mixin.go @@ -0,0 +1,52 @@ +package mixin + +import ( + "entgo.io/ent" + "entgo.io/ent/schema/mixin" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/utils" +) + +type ( + UserOwnedMutationPolicyMixin struct { + mixin.Schema + AllowAdminMutation bool + } + + UserOwnedQueryPolicyMixin struct { + mixin.Schema + } +) + +// Policy sets the policy for updating owned fields by the user +func (mixin UserOwnedMutationPolicyMixin) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.OnMutationOperation( + utils.NewMutationPolicyWithoutNil(privacy.MutationPolicy{ + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysDenyRule(), + }), + ent.OpCreate, + ), + privacy.OnMutationOperation( + utils.NewMutationPolicyWithoutNil(privacy.MutationPolicy{ + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysDenyRule(), + }), + ent.OpUpdateOne|ent.OpUpdate|ent.OpDeleteOne|ent.OpDelete, + ), + }, + } +} + +// Policy sets the policy for querying owned fields by the user +func (mixin UserOwnedQueryPolicyMixin) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.AlwaysAllowRule(), + }, + } +} diff --git a/internal/ent/privacy/rule/allow_if_self.go b/internal/ent/privacy/rule/allow_if_self.go new file mode 100644 index 0000000..8d5228e --- /dev/null +++ b/internal/ent/privacy/rule/allow_if_self.go @@ -0,0 +1,50 @@ +package rule + +import ( + "context" + + "entgo.io/ent/entql" + "github.com/theopenlane/entx" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" +) + +// AllowIfSelf determines whether a query or mutation operation should be allowed based on whether the requested data is for the viewer +func AllowIfSelf() privacy.QueryMutationRule { + return privacy.FilterFunc(func(ctx context.Context, f privacy.Filter) error { + // IDFilter is used for the user table + type IDFilter interface { + WhereID(entql.StringP) + } + + // UserIDFilter is used for the user_setting table + type UserIDFilter interface { + WhereUserID(entql.StringP) + } + + // if the user setting is being deleted, allow it + // there are no resolvers, this will always be deleted as part + // of a cascade delete + if _, ok := f.(UserIDFilter); ok && entx.CheckIsSoftDelete(ctx) { + return privacy.Allow + } + + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return privacy.Skipf("anonymous viewer") + } + + switch actualFilter := f.(type) { + case UserIDFilter: + actualFilter.WhereUserID(entql.StringEQ(userID)) + case IDFilter: + actualFilter.WhereID(entql.StringEQ(userID)) + default: + return privacy.Denyf("unexpected filter type %T", f) + } + + return privacy.Allow + }, + ) +} diff --git a/internal/ent/privacy/rule/allow_if_token_valid.go b/internal/ent/privacy/rule/allow_if_token_valid.go new file mode 100644 index 0000000..93caf6b --- /dev/null +++ b/internal/ent/privacy/rule/allow_if_token_valid.go @@ -0,0 +1,61 @@ +package rule + +import ( + "context" + "reflect" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/privacy/token" +) + +// AllowIfContextHasPrivacyTokenOfType allows a mutation +// to proceed if a privacy token of a specific type is found in the +// context. It checks if the actual type of the token in the context +// matches the expected type, and if so, it returns `privacy.Allow`. +// If the types do not match, it returns `privacy.Skipf` with a message +// indicating that no token was found in the context with the expected type +func AllowIfContextHasPrivacyTokenOfType(emptyToken token.PrivacyToken) privacy.QueryMutationRule { + return privacy.ContextQueryMutationRule(func(ctx context.Context) error { + if ContextHasPrivacyTokenOfType(ctx, emptyToken) { + return privacy.Allowf("found token in context with type %T", emptyToken) + } + + return privacy.Skipf("no token found from context with type %T", emptyToken) + }) +} + +// ContextHasPrivacyTokenOfType checks the context for the token type and returns true if they match +func ContextHasPrivacyTokenOfType(ctx context.Context, emptyToken token.PrivacyToken) bool { + if emptyToken == nil { + return false + } + + actualTokenType := reflect.TypeOf(ctx.Value(emptyToken.GetContextKey())) + expectedTokenType := reflect.TypeOf(emptyToken) + + return actualTokenType == expectedTokenType +} + +// AllowAfterApplyingPrivacyTokenFilter allows the mutation to proceed +// if a privacy token of a specific type is found in the context. It +// also applies a privacy filter to the token before allowing the +// mutation to proceed +func AllowAfterApplyingPrivacyTokenFilter( + emptyToken token.PrivacyToken, + applyFilter func(t token.PrivacyToken, filter privacy.Filter), +) privacy.QueryMutationRule { + return privacy.FilterFunc( + func(ctx context.Context, filter privacy.Filter) error { + actualToken := ctx.Value(emptyToken.GetContextKey()) + actualTokenType := reflect.TypeOf(actualToken) + expectedTokenType := reflect.TypeOf(emptyToken) + + if actualTokenType == expectedTokenType { + applyFilter(actualToken.(token.PrivacyToken), filter) + + return privacy.Allowf("applied privacy token filter") + } + + return privacy.Skipf("no token found from context with type %T", emptyToken) + }) +} diff --git a/internal/ent/privacy/rule/allow_mutation_after_owner_filter.go b/internal/ent/privacy/rule/allow_mutation_after_owner_filter.go new file mode 100644 index 0000000..f95b193 --- /dev/null +++ b/internal/ent/privacy/rule/allow_mutation_after_owner_filter.go @@ -0,0 +1,35 @@ +package rule + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated/predicate" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/pkg/auth" +) + +// AllowMutationAfterApplyingOwnerFilter defines a privacy rule for mutations in the context of an owner filter +func AllowMutationAfterApplyingOwnerFilter() privacy.MutationRule { + type OwnerFilter interface { + WhereHasOwnerWith(predicates ...predicate.User) + } + + return privacy.FilterFunc( + func(ctx context.Context, f privacy.Filter) error { + ownerFilter, ok := f.(OwnerFilter) + if !ok { + return privacy.Deny + } + + viewerID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return privacy.Skip + } + + ownerFilter.WhereHasOwnerWith(user.ID(viewerID)) + + return privacy.Allowf("applied owner filter") + }, + ) +} diff --git a/internal/ent/privacy/rule/allow_mutation_valid_signup_token.go b/internal/ent/privacy/rule/allow_mutation_valid_signup_token.go new file mode 100644 index 0000000..c206c9b --- /dev/null +++ b/internal/ent/privacy/rule/allow_mutation_valid_signup_token.go @@ -0,0 +1,36 @@ +package rule + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/privacy/token" +) + +type MutationEmailGetter func(generated.Mutation) (string, error) + +// AllowMutationIfContextHasValidEmailSignUpToken is used to determine whether a +// mutation should be allowed or skipped based on the presence and validity of an +// email signup token in the context +func AllowMutationIfContextHasValidEmailSignUpToken(getEmail MutationEmailGetter) privacy.MutationRule { + return privacy.MutationRuleFunc( + func(ctx context.Context, mutation generated.Mutation) error { + emailSignupToken := token.EmailSignUpTokenFromContext(ctx) + if emailSignupToken == nil { + return privacy.Skipf("email signup token not found in context") + } + + email, err := getEmail(mutation) + if err != nil { + return privacy.Skipf("unable to obtain email from mutation") + } + + if email != emailSignupToken.GetEmail() { + return privacy.Skipf("email sign up token does not match mutation result") + } + + return privacy.Allow + }, + ) +} diff --git a/internal/ent/privacy/rule/doc.go b/internal/ent/privacy/rule/doc.go new file mode 100644 index 0000000..612329d --- /dev/null +++ b/internal/ent/privacy/rule/doc.go @@ -0,0 +1,2 @@ +// Package rule contains policy rules +package rule diff --git a/internal/ent/privacy/rule/group.go b/internal/ent/privacy/rule/group.go new file mode 100644 index 0000000..d4689e7 --- /dev/null +++ b/internal/ent/privacy/rule/group.go @@ -0,0 +1,63 @@ +package rule + +import ( + "context" + + "entgo.io/ent" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" +) + +// CanCreateGroupsInOrg is a rule that returns allow decision if user has edit access in the organization +func CanCreateGroupsInOrg() privacy.GroupMutationRuleFunc { + return privacy.GroupMutationRuleFunc(func(ctx context.Context, m *generated.GroupMutation) error { + oID, ok := m.OwnerID() + if !ok || oID == "" { + // get organization from the auth context + var err error + + oID, err = auth.GetOrganizationIDFromContext(ctx) + if err != nil || oID == "" { + return privacy.Skipf("no owner set on request, cannot check access") + } + } + + m.Logger.Debugw("checking mutation access") + + relation := fgax.CanEdit + if m.Op().Is(ent.OpDelete | ent.OpDeleteOne) { + relation = fgax.CanDelete + } + + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + m.Logger.Infow("checking relationship tuples", "relation", relation, "organization_id", oID) + + ac := fgax.AccessCheck{ + SubjectID: userID, + SubjectType: auth.GetAuthzSubjectType(ctx), + ObjectID: oID, + Relation: relation, + } + + access, err := m.Authz.CheckOrgAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", relation, "organization_id", oID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny + }) +} diff --git a/internal/ent/privacy/rule/invite.go b/internal/ent/privacy/rule/invite.go new file mode 100644 index 0000000..c4b3c38 --- /dev/null +++ b/internal/ent/privacy/rule/invite.go @@ -0,0 +1,102 @@ +package rule + +import ( + "context" + "strings" + + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" +) + +const ( + inviteMemberRelation = "can_invite_members" + inviteAdminRelation = "can_invite_admins" +) + +// CanInviteUsers is a rule that returns allow decision if user has access to invite members or admins to the organization +func CanInviteUsers() privacy.InviteMutationRuleFunc { + return privacy.InviteMutationRuleFunc(func(ctx context.Context, m *generated.InviteMutation) error { + oID, err := getInviteOwnerID(ctx, m) + if err != nil || oID == "" { + return privacy.Skipf("no owner set on request, cannot check access") + } + + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + relation, err := getRelationToCheck(ctx, m) + if err != nil { + m.Logger.Errorw("unable to determine relation to check", "error", err) + + return err + } + + m.Logger.Debugw("checking relationship tuples", "relation", relation, "organization_id", oID, "user_id", userID) + + ac := fgax.AccessCheck{ + SubjectID: userID, + SubjectType: auth.GetAuthzSubjectType(ctx), + ObjectID: oID, + Relation: relation, + } + + access, err := m.Authz.CheckOrgAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", relation, "organization_id", oID) + + return privacy.Allow + } + + // proceed to next rule + return nil + }) +} + +// getInviteOwnerID returns the owner id from the mutation or the context +func getInviteOwnerID(ctx context.Context, m *generated.InviteMutation) (string, error) { + oID, ok := m.OwnerID() + if ok && oID != "" { + return oID, nil + } + + return auth.GetOrganizationIDFromContext(ctx) +} + +// getRelationToCheck returns the relation to check based on the role on the mutation +func getRelationToCheck(ctx context.Context, m *generated.InviteMutation) (string, error) { + role, ok := m.Role() + if !ok { + // if it is not a create operation, we need to to check the existing invite for the role + if m.Op() != generated.OpCreate { + id, ok := m.ID() + if !ok { + return "", privacy.Skipf("unable to determine invite, cannot check access") + } + + // get the role from the existing invite + invite, err := generated.FromContext(ctx).Invite.Get(ctx, id) + if err != nil { + return "", err + } + + role = invite.Role + } + } + + // allow member to invite members + if strings.EqualFold(role.String(), fgax.MemberRelation) { + return inviteMemberRelation, nil + } + + // default to admin + return inviteAdminRelation, nil +} diff --git a/internal/ent/privacy/rule/organization.go b/internal/ent/privacy/rule/organization.go new file mode 100644 index 0000000..9de895a --- /dev/null +++ b/internal/ent/privacy/rule/organization.go @@ -0,0 +1,87 @@ +package rule + +import ( + "context" + + "entgo.io/ent" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" +) + +// HasOrgMutationAccess is a rule that returns allow decision if user has edit or delete access +func HasOrgMutationAccess() privacy.OrganizationMutationRuleFunc { + return privacy.OrganizationMutationRuleFunc(func(ctx context.Context, m *generated.OrganizationMutation) error { + m.Logger.Debugw("checking mutation access") + + relation := fgax.CanEdit + if m.Op().Is(ent.OpDelete | ent.OpDeleteOne) { + relation = fgax.CanDelete + } + + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return err + } + + ac := fgax.AccessCheck{ + SubjectID: userID, + SubjectType: auth.GetAuthzSubjectType(ctx), + Relation: relation, + } + + // No permissions checks on creation of org except if this is not a root org + if m.Op().Is(ent.OpCreate) { + parentOrgID, ok := m.ParentID() + + if ok { + // check the parent organization + ac.ObjectID = parentOrgID + + access, err := m.Authz.CheckOrgAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if !access { + m.Logger.Debugw("access denied to parent org", "relation", relation, "organization_id", parentOrgID) + + return privacy.Deny + } + } + + return privacy.Skip + } + + // check the organization from the mutation + oID, _ := m.ID() + + // if it's not set return an error + if oID == "" { + m.Logger.Debugw("missing expected organization id") + + return privacy.Denyf("missing organization ID information in context") + } + + m.Logger.Infow("checking relationship tuples", "relation", relation, "organization_id", oID) + + // check access to the organization + ac.ObjectID = oID + + access, err := m.Authz.CheckOrgAccess(ctx, ac) + if err != nil { + return privacy.Skipf("unable to check access, %s", err.Error()) + } + + if access { + m.Logger.Debugw("access allowed", "relation", relation, "organization_id", oID) + + return privacy.Allow + } + + // deny if it was a mutation is not allowed + return privacy.Deny + }) +} diff --git a/internal/ent/privacy/token/doc.go b/internal/ent/privacy/token/doc.go new file mode 100644 index 0000000..c3c8eb0 --- /dev/null +++ b/internal/ent/privacy/token/doc.go @@ -0,0 +1,2 @@ +// Package token provides policy wrappers / getters for queries and mutations during password reset, sign-up +package token diff --git a/internal/ent/privacy/token/email_signup_token.go b/internal/ent/privacy/token/email_signup_token.go new file mode 100644 index 0000000..aae0205 --- /dev/null +++ b/internal/ent/privacy/token/email_signup_token.go @@ -0,0 +1,59 @@ +package token + +import ( + "context" +) + +// PrivacyToken interface +type PrivacyToken interface { + GetContextKey() interface{} +} + +// SignUpToken that implements the PrivacyToken interface +type SignUpToken struct { + PrivacyToken + email string +} + +type signUpTokenKey struct{} + +// NewSignUpTokenWithEmail creates a new PrivacyToken of type SignUpToken with +// email set +func NewSignUpTokenWithEmail(email string) SignUpToken { + return SignUpToken{ + email: email, + } +} + +// GetEmail from sign-up token +func (token *SignUpToken) GetEmail() string { + return token.email +} + +// SetEmail on the sign-up token +func (token *SignUpToken) SetEmail(email string) { + token.email = email +} + +// GetContextKey from SignUpToken +func (SignUpToken) GetContextKey() interface{} { + return signUpTokenKey{} +} + +// NewContextWithSignUpToken creates a new context with a sign-up token. It takes a +// parent context and a sign-up token as parameters and returns a new context with +// the sign-up token added +func NewContextWithSignUpToken(parent context.Context, email string) context.Context { + return context.WithValue(parent, signUpTokenKey{}, &SignUpToken{ + email: email, + }) +} + +// EmailSignUpTokenFromContext retrieves the value associated with the +// signUpTokenKey key from the context. +// It then type asserts the value to an EmailSignUpToken and returns it. If the +// value is not of type EmailSignUpToken, it returns nil +func EmailSignUpTokenFromContext(ctx context.Context) *SignUpToken { + token, _ := ctx.Value(signUpTokenKey{}).(*SignUpToken) + return token +} diff --git a/internal/ent/privacy/token/errors.go b/internal/ent/privacy/token/errors.go new file mode 100644 index 0000000..065212a --- /dev/null +++ b/internal/ent/privacy/token/errors.go @@ -0,0 +1,10 @@ +package token + +import ( + "errors" +) + +var ( + ErrIncorrectEmail = errors.New("privacy token has incorrect email") + ErrInvalidTokenType = errors.New("invalid token type") +) diff --git a/internal/ent/privacy/token/oauth_token.go b/internal/ent/privacy/token/oauth_token.go new file mode 100644 index 0000000..11df76a --- /dev/null +++ b/internal/ent/privacy/token/oauth_token.go @@ -0,0 +1,54 @@ +package token + +import ( + "context" +) + +// OauthTooToken that implements the PrivacyToken interface +type OauthTooToken struct { + PrivacyToken + email string +} + +type oauthTooTokenKey struct{} + +// NewOauthTooWithEmail creates a new PrivacyToken of type OauthTooToken with +// email set +func NewOauthTooWithEmail(email string) OauthTooToken { + return OauthTooToken{ + email: email, + } +} + +// GetEmail from oauth2 token +func (token *OauthTooToken) GetEmail() string { + return token.email +} + +// SetEmail on the oauth2 token +func (token *OauthTooToken) SetEmail(email string) { + token.email = email +} + +// GetContextKey from OauthTooToken +func (OauthTooToken) GetContextKey() interface{} { + return oauthTooTokenKey{} +} + +// NewContextWithOauthTooToken creates a new context with a oauth2 token. It takes a +// parent context and a oauth2 token as parameters and returns a new context with +// the oauth2 token added +func NewContextWithOauthTooToken(parent context.Context, email string) context.Context { + return context.WithValue(parent, oauthTooTokenKey{}, &OauthTooToken{ + email: email, + }) +} + +// OauthTooTokenFromContext retrieves the value associated with the +// oauthTooTokenKey key from the context. +// It then type asserts the value to an OauthTooToken and returns it. If the +// value is not of type OauthTooToken, it returns nil +func OauthTooTokenFromContext(ctx context.Context) *OauthTooToken { + token, _ := ctx.Value(oauthTooTokenKey{}).(*OauthTooToken) + return token +} diff --git a/internal/ent/privacy/token/org_invite_token.go b/internal/ent/privacy/token/org_invite_token.go new file mode 100644 index 0000000..11a8247 --- /dev/null +++ b/internal/ent/privacy/token/org_invite_token.go @@ -0,0 +1,47 @@ +package token + +import "context" + +// OrgInviteToken that implements the PrivacyToken interface +type OrgInviteToken struct { + PrivacyToken + token string +} + +type orgInviteTokenKey struct{} + +// GetContextKey from OrgInviteToken +func (OrgInviteToken) GetContextKey() interface{} { + return orgInviteTokenKey{} +} + +// NewOrgInviteTokenWithToken creates a new PrivacyToken of type OrgInviteToken with +// token set +func NewOrgInviteTokenWithToken(token string) OrgInviteToken { + return OrgInviteToken{ + token: token, + } +} + +// GetToken from invite token +func (token *OrgInviteToken) GetToken() string { + return token.token +} + +// SetToken on the invite token +func (token *OrgInviteToken) SetToken(t string) { + token.token = t +} + +// NewContextWithOrgInviteToken returns a new context with the reset token inside +func NewContextWithOrgInviteToken(parent context.Context, orgInviteToken string) context.Context { + return context.WithValue(parent, orgInviteTokenKey{}, &OrgInviteToken{ + token: orgInviteToken, + }) +} + +// OrgInviteTokenFromContext parses a context for a reset token and returns the token +func OrgInviteTokenFromContext(ctx context.Context) *OrgInviteToken { + token, _ := ctx.Value(orgInviteTokenKey{}).(*OrgInviteToken) + return token +} diff --git a/internal/ent/privacy/token/reset_token.go b/internal/ent/privacy/token/reset_token.go new file mode 100644 index 0000000..2a48403 --- /dev/null +++ b/internal/ent/privacy/token/reset_token.go @@ -0,0 +1,47 @@ +package token + +import "context" + +// ResetToken that implements the PrivacyToken interface +type ResetToken struct { + PrivacyToken + token string +} + +type resetTokenKey struct{} + +// GetContextKey from ResetToken +func (ResetToken) GetContextKey() interface{} { + return resetTokenKey{} +} + +// NewResetTokenWithToken creates a new PrivacyToken of type ResetToken with +// token set +func NewResetTokenWithToken(token string) ResetToken { + return ResetToken{ + token: token, + } +} + +// GetToken from reset token +func (token *ResetToken) GetToken() string { + return token.token +} + +// SetToken on the reset token +func (token *ResetToken) SetToken(t string) { + token.token = t +} + +// NewContextWithResetToken returns a new context with the reset token inside +func NewContextWithResetToken(parent context.Context, resetToken string) context.Context { + return context.WithValue(parent, resetTokenKey{}, &ResetToken{ + token: resetToken, + }) +} + +// ResetTokenFromContext parses a context for a reset token and returns the token +func ResetTokenFromContext(ctx context.Context) *ResetToken { + token, _ := ctx.Value(resetTokenKey{}).(*ResetToken) + return token +} diff --git a/internal/ent/privacy/token/verify_token.go b/internal/ent/privacy/token/verify_token.go new file mode 100644 index 0000000..c425a13 --- /dev/null +++ b/internal/ent/privacy/token/verify_token.go @@ -0,0 +1,47 @@ +package token + +import "context" + +// VerifyToken that implements the PrivacyToken interface +type VerifyToken struct { + PrivacyToken + token string +} + +type verifyTokenKey struct{} + +// GetContextKey from VerifyToken +func (VerifyToken) GetContextKey() interface{} { + return verifyTokenKey{} +} + +// NewVerifyTokenWithToken creates a new PrivacyToken of type SignUpToken with +// email set +func NewVerifyTokenWithToken(token string) VerifyToken { + return VerifyToken{ + token: token, + } +} + +// GetToken from verify token +func (token *VerifyToken) GetToken() string { + return token.token +} + +// SetToken on the verify token +func (token *VerifyToken) SetToken(t string) { + token.token = t +} + +// NewContextWithVerifyToken returns a new context with the verify token inside +func NewContextWithVerifyToken(parent context.Context, verifyToken string) context.Context { + return context.WithValue(parent, verifyTokenKey{}, &VerifyToken{ + token: verifyToken, + }) +} + +// VerifyTokenFromContext parses a context for a verify token and returns the token +func VerifyTokenFromContext(ctx context.Context) *VerifyToken { + token, _ := ctx.Value(verifyTokenKey{}).(*VerifyToken) + return token +} diff --git a/internal/ent/privacy/utils/doc.go b/internal/ent/privacy/utils/doc.go new file mode 100644 index 0000000..9a999be --- /dev/null +++ b/internal/ent/privacy/utils/doc.go @@ -0,0 +1,2 @@ +// Package utils is a helper for working with ent policies +package utils diff --git a/internal/ent/privacy/utils/utils.go b/internal/ent/privacy/utils/utils.go new file mode 100644 index 0000000..114460c --- /dev/null +++ b/internal/ent/privacy/utils/utils.go @@ -0,0 +1,19 @@ +package utils + +import ( + "github.com/theopenlane/core/internal/ent/generated/privacy" +) + +// NewMutationPolicyWithoutNil is creating a new slice of `privacy.MutationPolicy` by +// removing any `nil` values from the input `source` slice. It iterates over each item in the source slice and appends it to the new slice only if it is not `nil` - the new slice is then returned +func NewMutationPolicyWithoutNil(source privacy.MutationPolicy) privacy.MutationPolicy { + newSlice := make(privacy.MutationPolicy, 0, len(source)) + + for _, item := range source { + if item != nil { + newSlice = append(newSlice, item) + } + } + + return newSlice +} diff --git a/internal/ent/schema/apitoken.go b/internal/ent/schema/apitoken.go new file mode 100644 index 0000000..df677f0 --- /dev/null +++ b/internal/ent/schema/apitoken.go @@ -0,0 +1,146 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/pkg/keygen" +) + +// APIToken holds the schema definition for the APIToken entity. +type APIToken struct { + ent.Schema +} + +// Fields of the APIToken +func (APIToken) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name associated with the token"). + NotEmpty(), + field.String("token"). + Unique(). + Immutable(). + Annotations( + entgql.Skip(^entgql.SkipType), + ). + DefaultFunc(func() string { + token := keygen.PrefixedSecret("tola") // api token prefix + return token + }), + field.Time("expires_at"). + Comment("when the token expires"). + Annotations( + entgql.Skip(entgql.SkipMutationUpdateInput), + ). + Optional(). + Nillable(), + field.String("description"). + Comment("a description of the token's purpose"). + Optional(). + Nillable(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.JSON("scopes", []string{}). + Optional(), + field.Time("last_used_at"). + Optional(). + Nillable(), + } +} + +// Edges of the APIToken +func (APIToken) Edges() []ent.Edge { + return []ent.Edge{} +} + +// Indexes of the APIToken +func (APIToken) Indexes() []ent.Index { + return []ent.Index{ + // non-unique index. + index.Fields("token"), + } +} + +// Mixin of the APIToken +func (APIToken) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + mixin.SoftDeleteMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "api_tokens", + // skip the interceptor for Only queries when the token is being checked + // and we do not yet know the organization + SkipInterceptor: interceptors.SkipOnlyQuery, + }, + } +} + +// Annotations of the APIToken +func (APIToken) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + history.Annotations{ + Exclude: true, + }, + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Hooks of the APIToken +func (APIToken) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookCreateAPIToken(), + hooks.HookUpdateAPIToken(), + } +} + +// Interceptors of the APIToken +func (APIToken) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorAPIToken(), + } +} + +// Policy of the APIToken +func (APIToken) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.APITokenMutationRuleFunc(func(ctx context.Context, am *generated.APITokenMutation) error { + return am.CheckAccessForEdit(ctx) + }), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.APITokenQueryRuleFunc(func(ctx context.Context, q *generated.APITokenQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/contact.go b/internal/ent/schema/contact.go new file mode 100644 index 0000000..98f6a36 --- /dev/null +++ b/internal/ent/schema/contact.go @@ -0,0 +1,139 @@ +package schema + +import ( + "context" + "net/mail" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/validator" + "github.com/theopenlane/core/pkg/enums" +) + +// Contact holds the schema definition for the Contact entity +type Contact struct { + ent.Schema +} + +// Fields of the Contact +func (Contact) Fields() []ent.Field { + return []ent.Field{ + field.String("full_name"). + Comment("the full name of the contact"). + MaxLen(nameMaxLen). + NotEmpty(), + field.String("title"). + Comment("the title of the contact"). + Optional(), + field.String("company"). + Comment("the company of the contact"). + Optional(), + field.String("email"). + Comment("the email of the contact"). + Optional(). + Validate(func(email string) error { + _, err := mail.ParseAddress(email) + return err + }), + field.String("phone_number"). + Comment("the phone number of the contact"). + Validate(func(s string) error { + valid := validator.ValidatePhoneNumber(s) + if !valid { + return rout.InvalidField("phone_number") + } + + return nil + }). + Optional(), + field.String("address"). + Comment("the address of the contact"). + Optional(), + field.Enum("status"). + Comment("status of the contact"). + GoType(enums.UserStatus("")). + Default(string(enums.UserStatusActive)), + } +} + +// Mixin of the Contact +func (Contact) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "contacts", + }, + } +} + +// Edges of the Contact +func (Contact) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("entities", Entity.Type). + Ref("contacts"), + } +} + +// Indexes of the Contact +func (Contact) Indexes() []ent.Index { + return []ent.Index{} +} + +// Annotations of the Contact +func (Contact) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Hooks of the Contact +func (Contact) Hooks() []ent.Hook { + return []ent.Hook{} +} + +// Interceptors of the Contact +func (Contact) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} + +// Policy of the Contact +func (Contact) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.ContactMutationRuleFunc(func(ctx context.Context, m *generated.ContactMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.ContactQueryRuleFunc(func(ctx context.Context, q *generated.ContactQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/contact_history.go b/internal/ent/schema/contact_history.go new file mode 100644 index 0000000..fbcd773 --- /dev/null +++ b/internal/ent/schema/contact_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// ContactHistory holds the schema definition for the ContactHistory entity. +type ContactHistory struct { + ent.Schema +} + +// Annotations of the ContactHistory. +func (ContactHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "contact_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the ContactHistory. +func (ContactHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Contact{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Contact{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the ContactHistory +func (ContactHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the ContactHistory +func (ContactHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the ContactHistory +func (ContactHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.ContactHistoryQueryRuleFunc(func(ctx context.Context, q *generated.ContactHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/doc.go b/internal/ent/schema/doc.go new file mode 100644 index 0000000..81f4469 --- /dev/null +++ b/internal/ent/schema/doc.go @@ -0,0 +1,2 @@ +// Package schema contains the ent schema +package schema diff --git a/internal/ent/schema/documentdata.go b/internal/ent/schema/documentdata.go new file mode 100644 index 0000000..9c1e856 --- /dev/null +++ b/internal/ent/schema/documentdata.go @@ -0,0 +1,98 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// DocumentData holds the schema definition for the DocumentData entity +type DocumentData struct { + ent.Schema +} + +// Fields of the DocumentData +func (DocumentData) Fields() []ent.Field { + return []ent.Field{ + field.String("template_id"). + Comment("the template id of the document"), + field.JSON("data", customtypes.JSONObject{}). + Comment("the json data of the document"). + Annotations( + entgql.Type("JSON"), + ), + } +} + +// Mixin of the DocumentData +func (DocumentData) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + OrgOwnerMixin{ + Ref: "documentdata", + }, + } +} + +// Edges of the DocumentData +func (DocumentData) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("template", Template.Type). + Ref("documents"). + Unique(). + Required(). + Field("template_id"), + edge.From("entity", Entity.Type). + Ref("documents"), + } +} + +// Annotations of the DocumentData +func (DocumentData) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Policy of the DocumentData +func (DocumentData) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.DocumentDataMutationRuleFunc(func(ctx context.Context, m *generated.DocumentDataMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.DocumentDataQueryRuleFunc(func(ctx context.Context, q *generated.DocumentDataQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/documentdata_history.go b/internal/ent/schema/documentdata_history.go new file mode 100644 index 0000000..f07813a --- /dev/null +++ b/internal/ent/schema/documentdata_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// DocumentDataHistory holds the schema definition for the DocumentDataHistory entity. +type DocumentDataHistory struct { + ent.Schema +} + +// Annotations of the DocumentDataHistory. +func (DocumentDataHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "document_data_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the DocumentDataHistory. +func (DocumentDataHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := DocumentData{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := DocumentData{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the DocumentDataHistory +func (DocumentDataHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the DocumentDataHistory +func (DocumentDataHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the DocumentDataHistory +func (DocumentDataHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.DocumentDataHistoryQueryRuleFunc(func(ctx context.Context, q *generated.DocumentDataHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/emailverificationtoken.go b/internal/ent/schema/emailverificationtoken.go new file mode 100644 index 0000000..94cc890 --- /dev/null +++ b/internal/ent/schema/emailverificationtoken.go @@ -0,0 +1,138 @@ +package schema + +import ( + "net/mail" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/entql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + "github.com/theopenlane/entx" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" +) + +// EmailVerificationToken holds the schema definition for the EmailVerificationToken entity +type EmailVerificationToken struct { + ent.Schema +} + +// Fields of the EmailVerificationToken +func (EmailVerificationToken) Fields() []ent.Field { + return []ent.Field{ + field.String("token"). + Comment("the verification token sent to the user via email which should only be provided to the /verify endpoint + handler"). + Unique(). + NotEmpty(), + field.Time("ttl"). + Comment("the ttl of the verification token which defaults to 7 days"). + Nillable(), + field.String("email"). + Comment("the email used as input to generate the verification token; this is used to verify that the token when regenerated within the server matches the token emailed"). + Validate(func(email string) error { + _, err := mail.ParseAddress(email) + return err + }). + NotEmpty(), + field.Bytes("secret"). + Comment("the comparison secret to verify the token's signature"). + NotEmpty(). + Nillable(), + } +} + +// Edges of the EmailVerificationToken +func (EmailVerificationToken) Edges() []ent.Edge { + return []ent.Edge{} +} + +// Mixin of the EmailVerificationToken +func (EmailVerificationToken) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + UserOwnedMixin{ + Ref: "email_verification_tokens", + SkipOASGeneration: true, + SkipInterceptor: interceptors.SkipAll, + SkipTokenType: []token.PrivacyToken{ + &token.VerifyToken{}, + }, + }, + } +} + +// Indexes of the EmailVerificationToken +func (EmailVerificationToken) Indexes() []ent.Index { + return []ent.Index{ + // EmailVerificationTokens should be unique, but ignore deleted EmailVerificationTokens + index.Fields("token"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the EmailVerificationToken +func (EmailVerificationToken) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.Skip(entgql.SkipAll), + entx.SchemaGenSkip(true), + entx.QueryGenSkip(true), + history.Annotations{ + Exclude: true, + }, + } +} + +// Hooks of the EmailVerificationToken +func (EmailVerificationToken) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookEmailVerificationToken(), + } +} + +// Policy of the EmailVerificationToken +func (EmailVerificationToken) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + rule.AllowAfterApplyingPrivacyTokenFilter( + &token.VerifyToken{}, + func(t token.PrivacyToken, filter privacy.Filter) { + actualToken := t.(*token.VerifyToken) + tokenFilter := filter.(*generated.EmailVerificationTokenFilter) + tokenFilter.WhereToken(entql.StringEQ(actualToken.GetToken())) + }, + ), + privacy.AlwaysAllowRule(), + }, + Mutation: privacy.MutationPolicy{ + privacy.OnMutationOperation( + privacy.MutationPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.SignUpToken{}), + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysDenyRule(), + }, + ent.OpCreate, + ), + privacy.OnMutationOperation( + privacy.MutationPolicy{ + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysDenyRule(), + }, + ent.OpUpdateOne|ent.OpUpdate|ent.OpDeleteOne|ent.OpDelete, + ), + }, + } +} diff --git a/internal/ent/schema/entitlement.go b/internal/ent/schema/entitlement.go new file mode 100644 index 0000000..b592bc9 --- /dev/null +++ b/internal/ent/schema/entitlement.go @@ -0,0 +1,148 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// Entitlement holds the schema definition for the Entitlement entity. +type Entitlement struct { + ent.Schema +} + +// Fields of the Entitlement. +func (Entitlement) Fields() []ent.Field { + return []ent.Field{ + field.String("plan_id"). + Comment("the plan to which the entitlement belongs"). + NotEmpty(). + Immutable(), + field.String("organization_id"). + Comment("the organization to which the entitlement belongs"). + NotEmpty(). + Immutable(), + field.String("external_customer_id"). + Comment("used to store references to external systems, e.g. Stripe"). + Optional(), + field.String("external_subscription_id"). + Comment("used to store references to external systems, e.g. Stripe"). + Optional(), + field.Bool("expires"). + Comment("whether or not the customers entitlement expires - expires_at will show the time"). + Annotations( + entgql.Skip( + // skip these fields in the mutation + // it will automatically be set based on the value of expires_at + entgql.SkipMutationCreateInput, + entgql.SkipMutationUpdateInput, + ), + ). + Default(false), + field.Time("expires_at"). + Comment("the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month"). + Optional(). + Nillable(), + field.Bool("cancelled"). + Comment("whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at"). + Default(false), + } +} + +// Indexes of the Entitlement +func (Entitlement) Indexes() []ent.Index { + return []ent.Index{ + // organizations should only have one active entitlement + index.Fields("organization_id", "owner_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL and cancelled = false")), + } +} + +// Edges of the Entitlement +func (Entitlement) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("plan", EntitlementPlan.Type). + Field("plan_id"). + Unique(). + Required(). + Immutable(). + Ref("entitlements"), + // Organization that is assigned the entitlement + edge.From("organization", Organization.Type). + Ref("organization_entitlement"). + Field("organization_id"). + Required(). + Immutable(). + Unique(), + edge.To("events", Event.Type), + } +} + +// Annotations of the Entitlement +func (Entitlement) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Mixin of the Entitlement +func (Entitlement) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + OrgOwnerMixin{ + Ref: "entitlements", + }, + } +} + +// Hooks of the Entitlement +func (Entitlement) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookEntitlement(), + } +} + +// Policy of the Entitlement +func (Entitlement) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.EntitlementMutationRuleFunc(func(ctx context.Context, m *generated.EntitlementMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.EntitlementQueryRuleFunc(func(ctx context.Context, q *generated.EntitlementQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entitlement_history.go b/internal/ent/schema/entitlement_history.go new file mode 100644 index 0000000..e951872 --- /dev/null +++ b/internal/ent/schema/entitlement_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// EntitlementHistory holds the schema definition for the EntitlementHistory entity. +type EntitlementHistory struct { + ent.Schema +} + +// Annotations of the EntitlementHistory. +func (EntitlementHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "entitlement_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the EntitlementHistory. +func (EntitlementHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Entitlement{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Entitlement{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the EntitlementHistory +func (EntitlementHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the EntitlementHistory +func (EntitlementHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the EntitlementHistory +func (EntitlementHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.EntitlementHistoryQueryRuleFunc(func(ctx context.Context, q *generated.EntitlementHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entitlementplan.go b/internal/ent/schema/entitlementplan.go new file mode 100644 index 0000000..29b7a6a --- /dev/null +++ b/internal/ent/schema/entitlementplan.go @@ -0,0 +1,129 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// EntitlementPlan holds the schema definition for the EntitlementPlan entity +type EntitlementPlan struct { + ent.Schema +} + +// Fields of the EntitlementPlan +func (EntitlementPlan) Fields() []ent.Field { + return []ent.Field{ + field.String("display_name"). + Comment("the displayed 'friendly' name of the plan"). + Optional(), + field.String("name"). + Comment("the unique name of the plan"). + Immutable(). + NotEmpty(), + field.String("description"). + Comment("a description of the plan"). + Optional(), + field.String("version"). + Comment("the version of the plan"). + NotEmpty(). + Immutable(), + field.JSON("metadata", map[string]interface{}{}). + Comment("metadata for the plan"). + Optional(), + } +} + +// Mixin of the EntitlementPlan +func (EntitlementPlan) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "entitlementplans", + }, + } +} + +// Indexes of the EntitlementPlan +func (EntitlementPlan) Indexes() []ent.Index { + return []ent.Index{ + // names should be unique, but ignore deleted names + index.Fields("name", "version", "owner_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Edges of the EntitlementPlan +func (EntitlementPlan) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("entitlements", Entitlement.Type), + edge.From("base_features", Feature.Type). + Ref("plans"). + Through("features", EntitlementPlanFeature.Type), + edge.To("events", Event.Type), + } +} + +// Annotations of the EntitlementPlan +func (EntitlementPlan) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Hooks of the EntitlementPlan +func (EntitlementPlan) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookEntitlementPlan(), + } +} + +// Interceptors of the EntitlementPlan +func (EntitlementPlan) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} + +// Policy of the EntitlementPlan +func (EntitlementPlan) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.EntitlementPlanMutationRuleFunc(func(ctx context.Context, m *generated.EntitlementPlanMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.EntitlementPlanQueryRuleFunc(func(ctx context.Context, q *generated.EntitlementPlanQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entitlementplan_history.go b/internal/ent/schema/entitlementplan_history.go new file mode 100644 index 0000000..f23ba39 --- /dev/null +++ b/internal/ent/schema/entitlementplan_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// EntitlementPlanHistory holds the schema definition for the EntitlementPlanHistory entity. +type EntitlementPlanHistory struct { + ent.Schema +} + +// Annotations of the EntitlementPlanHistory. +func (EntitlementPlanHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "entitlement_plan_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the EntitlementPlanHistory. +func (EntitlementPlanHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := EntitlementPlan{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := EntitlementPlan{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the EntitlementPlanHistory +func (EntitlementPlanHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the EntitlementPlanHistory +func (EntitlementPlanHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the EntitlementPlanHistory +func (EntitlementPlanHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.EntitlementPlanHistoryQueryRuleFunc(func(ctx context.Context, q *generated.EntitlementPlanHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entitlementplanfeature.go b/internal/ent/schema/entitlementplanfeature.go new file mode 100644 index 0000000..2dc55a1 --- /dev/null +++ b/internal/ent/schema/entitlementplanfeature.go @@ -0,0 +1,119 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// EntitlementPlanFeature holds the schema definition for the EntitlementPlanFeature entity +type EntitlementPlanFeature struct { + ent.Schema +} + +// Fields of the EntitlementPlanFeature +func (EntitlementPlanFeature) Fields() []ent.Field { + return []ent.Field{ + field.JSON("metadata", map[string]interface{}{}). + Comment("metadata for the entitlement plan feature such as usage limits"). + Optional(), + field.String("plan_id").Immutable().NotEmpty(), + field.String("feature_id").Immutable().NotEmpty(), + } +} + +// Mixin of the EntitlementPlanFeature +func (EntitlementPlanFeature) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "entitlementplanfeatures", + }, + } +} + +// Edges of the EntitlementPlanFeature +func (EntitlementPlanFeature) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("plan", EntitlementPlan.Type). + Field("plan_id"). + Required(). + Unique(). + Immutable(), + edge.To("feature", Feature.Type). + Field("feature_id"). + Required(). + Unique(). + Immutable(), + edge.To("events", Event.Type), + } +} + +// Indexes of the EntitlementPlanFeature +func (EntitlementPlanFeature) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("feature_id", "plan_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the EntitlementPlanFeature +func (EntitlementPlanFeature) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Hooks of the EntitlementPlanFeature +func (EntitlementPlanFeature) Hooks() []ent.Hook { + return []ent.Hook{} +} + +// Interceptors of the EntitlementPlanFeature +func (EntitlementPlanFeature) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} + +// Policy of the EntitlementPlan +func (EntitlementPlanFeature) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.EntitlementPlanFeatureMutationRuleFunc(func(ctx context.Context, m *generated.EntitlementPlanFeatureMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.EntitlementPlanFeatureQueryRuleFunc(func(ctx context.Context, q *generated.EntitlementPlanFeatureQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entitlementplanfeature_history.go b/internal/ent/schema/entitlementplanfeature_history.go new file mode 100644 index 0000000..f2b9401 --- /dev/null +++ b/internal/ent/schema/entitlementplanfeature_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// EntitlementPlanFeatureHistory holds the schema definition for the EntitlementPlanFeatureHistory entity. +type EntitlementPlanFeatureHistory struct { + ent.Schema +} + +// Annotations of the EntitlementPlanFeatureHistory. +func (EntitlementPlanFeatureHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "entitlement_plan_feature_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the EntitlementPlanFeatureHistory. +func (EntitlementPlanFeatureHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := EntitlementPlanFeature{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := EntitlementPlanFeature{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the EntitlementPlanFeatureHistory +func (EntitlementPlanFeatureHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the EntitlementPlanFeatureHistory +func (EntitlementPlanFeatureHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the EntitlementPlanFeatureHistory +func (EntitlementPlanFeatureHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.EntitlementPlanFeatureHistoryQueryRuleFunc(func(ctx context.Context, q *generated.EntitlementPlanFeatureHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entity.go b/internal/ent/schema/entity.go new file mode 100644 index 0000000..c9ac956 --- /dev/null +++ b/internal/ent/schema/entity.go @@ -0,0 +1,148 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/validator" +) + +// Entity holds the schema definition for the Entity entity +type Entity struct { + ent.Schema +} + +// Fields of the Entity +func (Entity) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name of the entity"). + MaxLen(orgNameMaxLen). + Optional(). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + ), + field.String("display_name"). + Comment("The entity's displayed 'friendly' name"). + MaxLen(nameMaxLen). + Optional(). + NotEmpty(). + Annotations( + entgql.OrderField("display_name"), + ), + field.String("description"). + Comment("An optional description of the entity"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.Strings("domains"). + Comment("domains associated with the entity"). + Validate(validator.ValidateDomains()). + Optional(), + field.String("entity_type_id"). + Comment("The type of the entity"). + Optional(), + field.String("status"). + Comment("status of the entity"). + Default("active"). + Optional(), + } +} + +// Mixin of the Entity +func (Entity) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "entities", + }, + } +} + +// Edges of the Entity +func (Entity) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("contacts", Contact.Type), + edge.To("documents", DocumentData.Type), + edge.To("notes", Note.Type), + edge.To("files", File.Type), + edge.To("entity_type", EntityType.Type). + Field("entity_type_id"). + Unique(), + } +} + +// Indexes of the Entity +func (Entity) Indexes() []ent.Index { + return []ent.Index{ + // names should be unique, but ignore deleted names + index.Fields("name", "owner_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the Entity +func (Entity) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), entgql.MutationUpdate()), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Hooks of the Entity +func (Entity) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookEntityCreate(), + } +} + +// Interceptors of the Entity +func (Entity) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} + +// Policy of the Entity +func (Entity) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.EntityMutationRuleFunc(func(ctx context.Context, m *generated.EntityMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.EntityQueryRuleFunc(func(ctx context.Context, q *generated.EntityQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entity_history.go b/internal/ent/schema/entity_history.go new file mode 100644 index 0000000..6d07ede --- /dev/null +++ b/internal/ent/schema/entity_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// EntityHistory holds the schema definition for the EntityHistory entity. +type EntityHistory struct { + ent.Schema +} + +// Annotations of the EntityHistory. +func (EntityHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "entity_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the EntityHistory. +func (EntityHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Entity{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Entity{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the EntityHistory +func (EntityHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the EntityHistory +func (EntityHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the EntityHistory +func (EntityHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.EntityHistoryQueryRuleFunc(func(ctx context.Context, q *generated.EntityHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entitytype.go b/internal/ent/schema/entitytype.go new file mode 100644 index 0000000..881e3b9 --- /dev/null +++ b/internal/ent/schema/entitytype.go @@ -0,0 +1,116 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" +) + +const ( + maxEntityNameLen = 64 +) + +// EntityType holds the schema definition for the EntityType entity +type EntityType struct { + ent.Schema +} + +// Fields of the EntityType +func (EntityType) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name of the entity"). + MaxLen(maxEntityNameLen). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + ), + } +} + +// Mixin of the EntityType +func (EntityType) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "entitytypes", + }, + } +} + +// Edges of the EntityType +func (EntityType) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("entities", Entity.Type), + } +} + +// Indexes of the EntityType +func (EntityType) Indexes() []ent.Index { + return []ent.Index{ + // names should be unique by owner, but ignore deleted names + index.Fields("name", "owner_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the EntityType +func (EntityType) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Hooks of the EntityType +func (EntityType) Hooks() []ent.Hook { + return []ent.Hook{} +} + +// Interceptors of the EntityType +func (EntityType) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} + +// Policy of the EntityType +func (EntityType) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.EntityTypeMutationRuleFunc(func(ctx context.Context, m *generated.EntityTypeMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.EntityTypeQueryRuleFunc(func(ctx context.Context, q *generated.EntityTypeQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/entitytype_history.go b/internal/ent/schema/entitytype_history.go new file mode 100644 index 0000000..ff5527f --- /dev/null +++ b/internal/ent/schema/entitytype_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// EntityTypeHistory holds the schema definition for the EntityTypeHistory entity. +type EntityTypeHistory struct { + ent.Schema +} + +// Annotations of the EntityTypeHistory. +func (EntityTypeHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "entity_type_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the EntityTypeHistory. +func (EntityTypeHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := EntityType{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := EntityType{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the EntityTypeHistory +func (EntityTypeHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the EntityTypeHistory +func (EntityTypeHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the EntityTypeHistory +func (EntityTypeHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.EntityTypeHistoryQueryRuleFunc(func(ctx context.Context, q *generated.EntityTypeHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/errors.go b/internal/ent/schema/errors.go new file mode 100644 index 0000000..4714ab5 --- /dev/null +++ b/internal/ent/schema/errors.go @@ -0,0 +1,16 @@ +package schema + +import ( + "errors" +) + +var ( + // ErrInvalidTokenSize is returned when session token size is invalid + ErrInvalidTokenSize = errors.New("invalid token size") + + // ErrContainsSpaces is returned when field contains spaces + ErrContainsSpaces = errors.New("field should not contain spaces") + + // ErrUnexpectedMutationType is returned when an unexpected mutation type is encountered + ErrUnexpectedMutationType = errors.New("unexpected mutation type") +) diff --git a/internal/ent/schema/event.go b/internal/ent/schema/event.go new file mode 100644 index 0000000..06992bb --- /dev/null +++ b/internal/ent/schema/event.go @@ -0,0 +1,66 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + emixin "github.com/theopenlane/entx/mixin" +) + +type Event struct { + ent.Schema +} + +// Fields of the TicketEvent. +func (Event) Fields() []ent.Field { + return []ent.Field{ + field.String("event_id"). + Optional(), + field.String("correlation_id"). + Optional(), + field.String("event_type"), + field.JSON("metadata", map[string]interface{}{}).Optional(), + } +} + +// Edges of the Event +func (Event) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("user", User.Type).Ref("events"), + edge.From("group", Group.Type).Ref("events"), + edge.From("integration", Integration.Type).Ref("events"), + edge.From("organization", Organization.Type).Ref("events"), + edge.From("invite", Invite.Type).Ref("events"), + edge.From("feature", Feature.Type).Ref("events"), + edge.From("entitlementplan", EntitlementPlan.Type).Ref("events"), + edge.From("entitlementplanfeature", EntitlementPlanFeature.Type).Ref("events"), + edge.From("personal_access_token", PersonalAccessToken.Type).Ref("events"), + edge.From("oauth2token", OhAuthTooToken.Type).Ref("events"), + edge.From("hush", Hush.Type).Ref("events"), + edge.From("orgmembership", OrgMembership.Type).Ref("events"), + edge.From("groupmembership", GroupMembership.Type).Ref("events"), + edge.From("entitlement", Entitlement.Type).Ref("events"), + edge.From("webhook", Webhook.Type).Ref("events"), + edge.From("subscriber", Subscriber.Type).Ref("events"), + } +} + +// Annotations of the Event +func (Event) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + } +} + +// Mixin of the Event +func (Event) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + } +} diff --git a/internal/ent/schema/event_history.go b/internal/ent/schema/event_history.go new file mode 100644 index 0000000..6a4205d --- /dev/null +++ b/internal/ent/schema/event_history.go @@ -0,0 +1,90 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" +) + +// EventHistory holds the schema definition for the EventHistory entity. +type EventHistory struct { + ent.Schema +} + +// Annotations of the EventHistory. +func (EventHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "event_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + } +} + +// Fields of the EventHistory. +func (EventHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Event{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Event{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the EventHistory +func (EventHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} diff --git a/internal/ent/schema/feature.go b/internal/ent/schema/feature.go new file mode 100644 index 0000000..babb344 --- /dev/null +++ b/internal/ent/schema/feature.go @@ -0,0 +1,125 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// Feature defines the feature schema +type Feature struct { + ent.Schema +} + +// Fields returns feature fields +func (Feature) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the unique name of the feature"). + NotEmpty(). + Immutable(), + field.String("display_name"). + Comment("the displayed 'friendly' name of the feature"). + Optional(), + field.Bool("enabled"). + Comment("enabled features are available for use"). + Default(false), + field.String("description"). + Comment("a description of the feature"). + Nillable(). + Optional(), + field.JSON("metadata", map[string]interface{}{}). + Comment("metadata for the feature"). + Optional(), + } +} + +// Edges returns feature edges +func (Feature) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("plans", EntitlementPlan.Type). + Through("features", EntitlementPlanFeature.Type), + edge.To("events", Event.Type), + } +} + +// Mixin of the Feature +func (Feature) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + mixin.SoftDeleteMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "features", + }, + } +} + +func (Feature) Indexes() []ent.Index { + return []ent.Index{ + // names should be unique, but ignore deleted names + index.Fields("name", "owner_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the Feature +func (Feature) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Hooks of the Feature +func (Feature) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookFeature(), + } +} + +// Interceptors of the Feature +func (Feature) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} + +// Policy of the Feature +func (Feature) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.FeatureMutationRuleFunc(func(ctx context.Context, m *generated.FeatureMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.FeatureQueryRuleFunc(func(ctx context.Context, q *generated.FeatureQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/feature_history.go b/internal/ent/schema/feature_history.go new file mode 100644 index 0000000..0ab482f --- /dev/null +++ b/internal/ent/schema/feature_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// FeatureHistory holds the schema definition for the FeatureHistory entity. +type FeatureHistory struct { + ent.Schema +} + +// Annotations of the FeatureHistory. +func (FeatureHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "feature_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the FeatureHistory. +func (FeatureHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Feature{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Feature{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the FeatureHistory +func (FeatureHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the FeatureHistory +func (FeatureHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the FeatureHistory +func (FeatureHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.FeatureHistoryQueryRuleFunc(func(ctx context.Context, q *generated.FeatureHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/file.go b/internal/ent/schema/file.go new file mode 100644 index 0000000..e9d4d6f --- /dev/null +++ b/internal/ent/schema/file.go @@ -0,0 +1,68 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/mixin" +) + +// File defines the file schema. +type File struct { + ent.Schema +} + +// Fields returns file fields. +func (File) Fields() []ent.Field { + return []ent.Field{ + field.String("file_name"), + field.String("file_extension"), + field.Int("file_size"). + NonNegative(). + Optional(), + field.String("content_type"), + field.String("store_key"), + field.String("category"). + Optional(), + field.String("annotation"). + Optional(), + } +} + +// Edges of the File +func (File) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("user", User.Type). + Ref("files"). + Unique(), + edge.From("organization", Organization.Type). + Ref("files"), + edge.From("entity", Entity.Type). + Ref("files"), + edge.From("group", Group.Type). + Ref("files"), + } +} + +// Mixin of the File +func (File) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + mixin.SoftDeleteMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + } +} + +// Annotations of the File +func (File) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + } +} diff --git a/internal/ent/schema/file_history.go b/internal/ent/schema/file_history.go new file mode 100644 index 0000000..12809b8 --- /dev/null +++ b/internal/ent/schema/file_history.go @@ -0,0 +1,90 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" +) + +// FileHistory holds the schema definition for the FileHistory entity. +type FileHistory struct { + ent.Schema +} + +// Annotations of the FileHistory. +func (FileHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "file_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + } +} + +// Fields of the FileHistory. +func (FileHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := File{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := File{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the FileHistory +func (FileHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} diff --git a/internal/ent/schema/group.go b/internal/ent/schema/group.go new file mode 100644 index 0000000..b9f684e --- /dev/null +++ b/internal/ent/schema/group.go @@ -0,0 +1,176 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" +) + +// Group holds the schema definition for the Group entity +type Group struct { + ent.Schema +} + +// Mixin of the Group +func (Group) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + mixin.SoftDeleteMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "groups", + }, + } +} + +// Fields of the Group +func (Group) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name of the group - must be unique within the organization"). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + ), + field.String("description"). + Comment("the groups description"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("gravatar_logo_url"). + Comment("the URL to an auto generated gravatar image for the group"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("logo_url"). + Comment("the URL to an image uploaded by the customer for the groups avatar image"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("display_name"). + Comment("The group's displayed 'friendly' name"). + MaxLen(nameMaxLen). + Default(""). + Annotations( + entgql.OrderField("display_name"), + ), + } +} + +// Edges of the Group +func (Group) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("setting", GroupSetting.Type). + Required(). + Unique(). + Annotations( + entx.CascadeAnnotationField("Group"), + ), + edge.From("users", User.Type). + Ref("groups"). + Through("members", GroupMembership.Type), + edge.To("events", Event.Type), + edge.To("integrations", Integration.Type), + edge.To("files", File.Type), + } +} + +// Indexes of the Group +func (Group) Indexes() []ent.Index { + return []ent.Index{ + // We have an organization with many groups, and we want to set the group name to be unique under each organization + index.Fields("name"). + Edges("owner"). + Unique(). + Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the Group +func (Group) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + // Delete groups members when groups are deleted + entx.CascadeThroughAnnotationField( + []entx.ThroughCleanup{ + { + Field: "Group", + Through: "GroupMembership", + }, + }, + ), + entfga.Annotations{ + ObjectType: "group", + IncludeHooks: false, + }, + } +} + +// Policy of the group +func (Group) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.OnMutationOperation( + rule.CanCreateGroupsInOrg(), + ent.OpCreate, + ), + privacy.OnMutationOperation( + privacy.GroupMutationRuleFunc(func(ctx context.Context, m *generated.GroupMutation) error { + return m.CheckAccessForEdit(ctx) + }), + ent.OpUpdate|ent.OpUpdateOne, + ), + privacy.OnMutationOperation( + privacy.GroupMutationRuleFunc(func(ctx context.Context, m *generated.GroupMutation) error { + return m.CheckAccessForDelete(ctx) + }), + ent.OpDelete|ent.OpDeleteOne, + ), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.GroupQueryRuleFunc(func(ctx context.Context, q *generated.GroupQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} + +// Interceptors of the Group +func (Group) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorGroup(), + } +} + +// Hooks of the Group +func (Group) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookGroupAuthz(), + hooks.HookGroup(), + } +} diff --git a/internal/ent/schema/group_history.go b/internal/ent/schema/group_history.go new file mode 100644 index 0000000..d8e13cc --- /dev/null +++ b/internal/ent/schema/group_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// GroupHistory holds the schema definition for the GroupHistory entity. +type GroupHistory struct { + ent.Schema +} + +// Annotations of the GroupHistory. +func (GroupHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "group_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "group", + IDField: "Ref", + IncludeHooks: false, + }, + } +} + +// Fields of the GroupHistory. +func (GroupHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Group{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Group{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the GroupHistory +func (GroupHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the GroupHistory +func (GroupHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the GroupHistory +func (GroupHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.GroupHistoryQueryRuleFunc(func(ctx context.Context, q *generated.GroupHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/groupmembership.go b/internal/ent/schema/groupmembership.go new file mode 100644 index 0000000..d65de4c --- /dev/null +++ b/internal/ent/schema/groupmembership.go @@ -0,0 +1,111 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/pkg/enums" +) + +// GroupMembership holds the schema definition for the GroupMembership entity +type GroupMembership struct { + ent.Schema +} + +// Fields of the GroupMembership +func (GroupMembership) Fields() []ent.Field { + return []ent.Field{ + field.Enum("role"). + GoType(enums.Role("")). + Default(string(enums.RoleMember)), + field.String("group_id").Immutable(), + field.String("user_id").Immutable(), + } +} + +// Edges of the GroupMembership +func (GroupMembership) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("group", Group.Type). + Field("group_id"). + Required(). + Unique(). + Immutable(), + edge.To("user", User.Type). + Field("user_id"). + Required(). + Unique(). + Immutable(), + edge.To("events", Event.Type), + } +} + +// Annotations of the GroupMembership +func (GroupMembership) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "group", + IncludeHooks: true, + IDField: "GroupID", + }, + } +} + +// Indexes of the GroupMembership +func (GroupMembership) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("user_id", "group_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Mixin of the GroupMembership +func (GroupMembership) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + } +} + +// Hooks of the GroupMembership +func (GroupMembership) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookGroupMembers(), + } +} + +// Policy of the GroupMembership +func (GroupMembership) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.GroupMembershipMutationRuleFunc(func(ctx context.Context, m *generated.GroupMembershipMutation) error { + return m.CheckAccessForEdit(ctx) + }), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.GroupMembershipQueryRuleFunc(func(ctx context.Context, q *generated.GroupMembershipQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/groupmembership_history.go b/internal/ent/schema/groupmembership_history.go new file mode 100644 index 0000000..af086f7 --- /dev/null +++ b/internal/ent/schema/groupmembership_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// GroupMembershipHistory holds the schema definition for the GroupMembershipHistory entity. +type GroupMembershipHistory struct { + ent.Schema +} + +// Annotations of the GroupMembershipHistory. +func (GroupMembershipHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "group_membership_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "group", + IDField: "GroupID", + IncludeHooks: false, + }, + } +} + +// Fields of the GroupMembershipHistory. +func (GroupMembershipHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := GroupMembership{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := GroupMembership{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the GroupMembershipHistory +func (GroupMembershipHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the GroupMembershipHistory +func (GroupMembershipHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", false, false), + } +} + +// Policy of the GroupMembershipHistory +func (GroupMembershipHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.GroupMembershipHistoryQueryRuleFunc(func(ctx context.Context, q *generated.GroupMembershipHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/groupsetting.go b/internal/ent/schema/groupsetting.go new file mode 100644 index 0000000..6afdab8 --- /dev/null +++ b/internal/ent/schema/groupsetting.go @@ -0,0 +1,99 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/pkg/enums" +) + +// GroupSetting holds the schema definition for the GroupSetting entity +type GroupSetting struct { + ent.Schema +} + +// Fields of the GroupSetting. +func (GroupSetting) Fields() []ent.Field { + return []ent.Field{ + field.Enum("visibility"). + Comment("whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization"). + GoType(enums.Visibility("")). + Default(string(enums.VisibilityPublic)), + field.Enum("join_policy"). + Comment("the policy governing ability to freely join a group, whether it requires an invitation, application, or either"). + GoType(enums.JoinPolicy("")). + Default(string(enums.JoinPolicyInviteOrApplication)), + field.Bool("sync_to_slack"). + Comment("whether to sync group members to slack groups"). + Optional(). + Default(false), + field.Bool("sync_to_github"). + Comment("whether to sync group members to github groups"). + Optional(). + Default(false), + field.String("group_id"). + Comment("the group id associated with the settings"). + Optional(), + } +} + +// Edges of the GroupSetting +func (GroupSetting) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("group", Group.Type).Ref("setting").Field("group_id").Unique(), + } +} + +// Annotations of the GroupSetting +func (GroupSetting) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "group", + IncludeHooks: false, + IDField: "GroupID", + NillableIDField: true, + }, + } +} + +// Mixin of the GroupSetting +func (GroupSetting) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + } +} + +// Policy defines the privacy policy of the GroupSetting +func (GroupSetting) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.GroupSettingMutationRuleFunc(func(ctx context.Context, m *generated.GroupSettingMutation) error { + return m.CheckAccessForEdit(ctx) + }), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.GroupSettingQueryRuleFunc(func(ctx context.Context, q *generated.GroupSettingQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/groupsetting_history.go b/internal/ent/schema/groupsetting_history.go new file mode 100644 index 0000000..5b84e6c --- /dev/null +++ b/internal/ent/schema/groupsetting_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// GroupSettingHistory holds the schema definition for the GroupSettingHistory entity. +type GroupSettingHistory struct { + ent.Schema +} + +// Annotations of the GroupSettingHistory. +func (GroupSettingHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "group_setting_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "group", + IDField: "GroupID", + IncludeHooks: false, + }, + } +} + +// Fields of the GroupSettingHistory. +func (GroupSettingHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := GroupSetting{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := GroupSetting{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the GroupSettingHistory +func (GroupSettingHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the GroupSettingHistory +func (GroupSettingHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", false, false), + } +} + +// Policy of the GroupSettingHistory +func (GroupSettingHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.GroupSettingHistoryQueryRuleFunc(func(ctx context.Context, q *generated.GroupSettingHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/hush.go b/internal/ent/schema/hush.go new file mode 100644 index 0000000..3f18d54 --- /dev/null +++ b/internal/ent/schema/hush.go @@ -0,0 +1,100 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// Hush maps configured integrations (github, slack, etc.) to organizations +type Hush struct { + ent.Schema +} + +// Fields of the Hush +func (Hush) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the logical name of the corresponding hush secret or it's general grouping"). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + ), + field.String("description"). + Comment("a description of the hush value or purpose, such as github PAT"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("kind"). + Comment("the kind of secret, such as sshkey, certificate, api token, etc."). + Optional(). + Annotations( + entgql.OrderField("kind"), + ), + field.String("secret_name"). + Comment("the generic name of a secret associated with the organization"). + Immutable(). + Optional(), + field.String("secret_value"). + Comment("the secret value"). + Sensitive(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ). + Optional(). + Immutable(), + } +} + +// Edges of the Hush +func (Hush) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("integrations", Integration.Type). + Comment("the integration associated with the secret"). + Ref("secrets"), + edge.From("organization", Organization.Type). + Ref("secrets"), + edge.To("events", Event.Type), + } +} + +// Annotations of the Hushhh +func (Hush) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + } +} + +// Mixin of the Hush shhhh +func (Hush) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + } +} + +// Hooks of the Hush +func (Hush) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookHush(), + } +} + +// Interceptors of the Hush +func (Hush) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorHush(), + } +} diff --git a/internal/ent/schema/hush_history.go b/internal/ent/schema/hush_history.go new file mode 100644 index 0000000..432006f --- /dev/null +++ b/internal/ent/schema/hush_history.go @@ -0,0 +1,90 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" +) + +// HushHistory holds the schema definition for the HushHistory entity. +type HushHistory struct { + ent.Schema +} + +// Annotations of the HushHistory. +func (HushHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "hush_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + } +} + +// Fields of the HushHistory. +func (HushHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Hush{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Hush{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the HushHistory +func (HushHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} diff --git a/internal/ent/schema/integration.go b/internal/ent/schema/integration.go new file mode 100644 index 0000000..67610ba --- /dev/null +++ b/internal/ent/schema/integration.go @@ -0,0 +1,106 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// Integration maps configured integrations (github, slack, etc.) to organizations +type Integration struct { + ent.Schema +} + +// Fields of the Integration +func (Integration) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name of the integration - must be unique within the organization"). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + ), + field.String("description"). + Comment("a description of the integration"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("kind"). + Optional(). + Annotations( + entgql.OrderField("kind"), + ), + } +} + +// Edges of the Integration +func (Integration) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("secrets", Hush.Type). + Comment("the secrets associated with the integration"), + edge.To("oauth2tokens", OhAuthTooToken.Type). + Comment("the oauth2 tokens associated with the integration"), + edge.To("events", Event.Type), + edge.To("webhooks", Webhook.Type), + } +} + +// Annotations of the Integration +func (Integration) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Mixin of the Integration +func (Integration) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + OrgOwnerMixin{ + Ref: "integrations", + }, + } +} + +// Policy of the Integration +func (Integration) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.IntegrationMutationRuleFunc(func(ctx context.Context, m *generated.IntegrationMutation) error { + return m.CheckAccessForDelete(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.IntegrationQueryRuleFunc(func(ctx context.Context, q *generated.IntegrationQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/integration_history.go b/internal/ent/schema/integration_history.go new file mode 100644 index 0000000..0ad0cba --- /dev/null +++ b/internal/ent/schema/integration_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// IntegrationHistory holds the schema definition for the IntegrationHistory entity. +type IntegrationHistory struct { + ent.Schema +} + +// Annotations of the IntegrationHistory. +func (IntegrationHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "integration_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the IntegrationHistory. +func (IntegrationHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Integration{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Integration{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the IntegrationHistory +func (IntegrationHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the IntegrationHistory +func (IntegrationHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the IntegrationHistory +func (IntegrationHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.IntegrationHistoryQueryRuleFunc(func(ctx context.Context, q *generated.IntegrationHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/invite.go b/internal/ent/schema/invite.go new file mode 100644 index 0000000..8bb6782 --- /dev/null +++ b/internal/ent/schema/invite.go @@ -0,0 +1,164 @@ +package schema + +import ( + "context" + "net/mail" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + defaultInviteExpiresDays = 14 +) + +// Invite holds the schema definition for the Invite entity +type Invite struct { + ent.Schema +} + +// Fields of the Invite +func (Invite) Fields() []ent.Field { + return []ent.Field{ + field.String("token"). + Comment("the invitation token sent to the user via email which should only be provided to the /verify endpoint + handler"). + Unique(). + Sensitive(). + Annotations( + entgql.Skip(), + ). + NotEmpty(), + field.Time("expires"). + Comment("the expiration date of the invitation token which defaults to 14 days in the future from creation"). + Default(func() time.Time { + return time.Now().AddDate(0, 0, defaultInviteExpiresDays) + }). + Optional(), + field.String("recipient"). + Comment("the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization"). + Validate(func(email string) error { + _, err := mail.ParseAddress(email) + return err + }). + Immutable(). + NotEmpty(), + field.Enum("status"). + Comment("the status of the invitation"). + GoType(enums.InviteStatus("")). + Default(string(enums.InvitationSent)), + field.Enum("role"). + GoType(enums.Role("")). + Default(string(enums.RoleMember)), + field.Int("send_attempts"). + Comment("the number of attempts made to perform email send of the invitation, maximum of 5"). + Default(0), + field.String("requestor_id"). + Comment("the user who initiated the invitation"). + Immutable(). + Optional(). + NotEmpty(), + field.Bytes("secret"). + Comment("the comparison secret to verify the token's signature"). + NotEmpty(). + Nillable(). + Annotations(entgql.Skip()). + Sensitive(), + } +} + +// Mixin of the Invite +func (Invite) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + OrgOwnerMixin{ + Ref: "invites", + SkipTokenType: []token.PrivacyToken{ + &token.OrgInviteToken{}, + }, + }, + } +} + +// Indexes of the Invite +func (Invite) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("recipient", "owner_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Edges of the Invite +func (Invite) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("events", Event.Type), + } +} + +// Annotations of the Invite +func (Invite) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + history.Annotations{ + Exclude: true, + }, + } +} + +// Hooks of the Invite +func (Invite) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookInvite(), + hooks.HookInviteAccepted(), + } +} + +// Policy of the Invite +func (Invite) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.OrgInviteToken{}), + rule.CanInviteUsers(), + privacy.InviteMutationRuleFunc(func(ctx context.Context, m *generated.InviteMutation) error { + return m.CheckAccessForEdit(ctx) + }), + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.OrgInviteToken{}), + privacy.InviteQueryRuleFunc(func(ctx context.Context, q *generated.InviteQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/note.go b/internal/ent/schema/note.go new file mode 100644 index 0000000..aff61c7 --- /dev/null +++ b/internal/ent/schema/note.go @@ -0,0 +1,108 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + "github.com/theopenlane/entx" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// Note holds the schema definition for the Note entity +type Note struct { + ent.Schema +} + +// Fields of the Note +func (Note) Fields() []ent.Field { + return []ent.Field{ + field.String("text"). + Comment("the text of the note"). + NotEmpty(), + } +} + +// Mixin of the Note +func (Note) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "notes", + }, + } +} + +// Edges of the Note +func (Note) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("entity", Entity.Type). + Unique(). + Ref("notes"), + } +} + +// Indexes of the Note +func (Note) Indexes() []ent.Index { + return []ent.Index{} +} + +// Annotations of the Note +func (Note) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), entgql.MutationUpdate()), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + // skip generating the schema for this type, this schema is used through extended types + entx.SchemaGenSkip(true), + entx.QueryGenSkip(true), + } +} + +// Hooks of the Note +func (Note) Hooks() []ent.Hook { + return []ent.Hook{} +} + +// Interceptors of the Note +func (Note) Interceptors() []ent.Interceptor { + return []ent.Interceptor{} +} + +// Policy of the Note +func (Note) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.NoteMutationRuleFunc(func(ctx context.Context, m *generated.NoteMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.NoteQueryRuleFunc(func(ctx context.Context, q *generated.NoteQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/note_history.go b/internal/ent/schema/note_history.go new file mode 100644 index 0000000..e7fe4ed --- /dev/null +++ b/internal/ent/schema/note_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// NoteHistory holds the schema definition for the NoteHistory entity. +type NoteHistory struct { + ent.Schema +} + +// Annotations of the NoteHistory. +func (NoteHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "note_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the NoteHistory. +func (NoteHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Note{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Note{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the NoteHistory +func (NoteHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the NoteHistory +func (NoteHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the NoteHistory +func (NoteHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.NoteHistoryQueryRuleFunc(func(ctx context.Context, q *generated.NoteHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/oauthprovider.go b/internal/ent/schema/oauthprovider.go new file mode 100644 index 0000000..f168413 --- /dev/null +++ b/internal/ent/schema/oauthprovider.go @@ -0,0 +1,106 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + + "github.com/theopenlane/entx" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// OauthProvider holds the schema definition for the OauthProvider entity +type OauthProvider struct { + ent.Schema +} + +// Fields of the OauthProvider +func (OauthProvider) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the oauth provider's name"), + field.String("client_id"). + Comment("the client id for the oauth provider"), + field.String("client_secret"). + Comment("the client secret"), + field.String("redirect_url"). + Comment("the redirect url"), + field.String("scopes"). + Comment("the scopes"), + field.String("auth_url"). + Comment("the auth url of the provider"), + field.String("token_url"). + Comment("the token url of the provider"), + field.Uint8("auth_style"). + GoType(customtypes.Uint8(0)). + Annotations( + entgql.Type("Uint"), + ). + Comment("the auth style, 0: auto detect 1: third party log in 2: log in with username and password"), + field.String("info_url"). + Comment("the URL to request user information by token"), + } +} + +// Edges of the OauthProvider +func (OauthProvider) Edges() []ent.Edge { + return []ent.Edge{} +} + +// Annotations of the OauthProvider +func (OauthProvider) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entx.QueryGenSkip(true), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Mixin of the OauthProvider +func (OauthProvider) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + OrgOwnerMixin{ + Ref: "oauthprovider", + }, + } +} + +// Policy of the OauthProvider +func (OauthProvider) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.OauthProviderMutationRuleFunc(func(ctx context.Context, m *generated.OauthProviderMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.OauthProviderQueryRuleFunc(func(ctx context.Context, q *generated.OauthProviderQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/oauthprovider_history.go b/internal/ent/schema/oauthprovider_history.go new file mode 100644 index 0000000..1f4bc89 --- /dev/null +++ b/internal/ent/schema/oauthprovider_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// OauthProviderHistory holds the schema definition for the OauthProviderHistory entity. +type OauthProviderHistory struct { + ent.Schema +} + +// Annotations of the OauthProviderHistory. +func (OauthProviderHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "oauth_provider_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the OauthProviderHistory. +func (OauthProviderHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := OauthProvider{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := OauthProvider{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the OauthProviderHistory +func (OauthProviderHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the OauthProviderHistory +func (OauthProviderHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the OauthProviderHistory +func (OauthProviderHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.OauthProviderHistoryQueryRuleFunc(func(ctx context.Context, q *generated.OauthProviderHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/ohauthtootoken.go b/internal/ent/schema/ohauthtootoken.go new file mode 100644 index 0000000..ff6de08 --- /dev/null +++ b/internal/ent/schema/ohauthtootoken.go @@ -0,0 +1,76 @@ +package schema + +import ( + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" +) + +// OhAuthTooToken holds the schema definition for the OhAuthTooToken entity +type OhAuthTooToken struct { + ent.Schema +} + +// Fields of the OhAuthTooToken +func (OhAuthTooToken) Fields() []ent.Field { + return []ent.Field{ + field.Text("client_id"). + NotEmpty(), + field.JSON("scopes", []string{}). + Optional(), + field.Text("nonce"). + NotEmpty(), + field.Text("claims_user_id"). + NotEmpty(), + field.Text("claims_username"). + NotEmpty(), + field.Text("claims_email"). + NotEmpty(), + field.Bool("claims_email_verified"), + field.JSON("claims_groups", []string{}). + Optional(), + field.Text("claims_preferred_username"), + field.Text("connector_id"). + NotEmpty(), + field.JSON("connector_data", []string{}). + Optional(), + field.Time("last_used"). + Default(time.Now), + } +} + +// Edges of the OhAuthTooToken +func (OhAuthTooToken) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("integration", Integration.Type). + Ref("oauth2tokens"), + edge.To("events", Event.Type), + } +} + +// Mixin of the OhAuthTooToken +func (OhAuthTooToken) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.IDMixin{}, + emixin.TagMixin{}, + } +} + +// Annotations of the OhAuthTooToken +func (OhAuthTooToken) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + history.Annotations{ + Exclude: true, + }, + } +} diff --git a/internal/ent/schema/org_owned_mixin.go b/internal/ent/schema/org_owned_mixin.go new file mode 100644 index 0000000..1f0a608 --- /dev/null +++ b/internal/ent/schema/org_owned_mixin.go @@ -0,0 +1,196 @@ +package schema + +import ( + "context" + "errors" + "fmt" + + "entgo.io/ent" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/mixin" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" +) + +const ( + ownerFieldName = "owner_id" +) + +// OrgOwnerMixin is a mixin for organization owned entities +// that adds an owner field to the schema and automatically +// sets the owner id on mutations and filters by owner on queries. +// In some cases, the owner ID may not be wanted on a query or hook (e.g. before the user is authenticated) +// In these cases, the SkipTokenType field can be used to skip the traverser or hook if the token type is found in the context +// or the SkipInterceptor field can be used to skip the interceptor for that schema for all queries, or specific types +type OrgOwnerMixin struct { + mixin.Schema + // Ref table for the id + Ref string + // Required makes the owner id field required as input + Required bool + // AllowEmpty allows the owner id field to be empty + AllowEmpty bool + // SkipOASGeneration skips open api spec generation for the field + SkipOASGeneration bool + // SkipInterceptor skips the interceptor for that schema for all queries, or specific types, + // this is useful for tokens, etc + SkipInterceptor interceptors.SkipMode + // SkipTokenType skips the traverser or hook if the token type is found in the context + SkipTokenType []token.PrivacyToken +} + +// Fields of the OrgOwnerMixin +func (orgOwned OrgOwnerMixin) Fields() []ent.Field { + ownerIDField := field. + String(ownerFieldName). + Comment("The organization id that owns the object") + + if !orgOwned.Required { + ownerIDField.Optional() + + // if explicitly set to allow empty values, otherwise ensure it is not empty + if !orgOwned.AllowEmpty { + ownerIDField.NotEmpty() + } + } + + return []ent.Field{ + ownerIDField, + } +} + +// Edges of the OrgOwnerMixin +func (orgOwned OrgOwnerMixin) Edges() []ent.Edge { + if orgOwned.Ref == "" { + panic(errors.New("ref must be non-empty string")) // nolint: goerr113 + } + + ownerEdge := edge. + From("owner", Organization.Type). + Field(ownerFieldName). + Ref(orgOwned.Ref). + Unique() + + if orgOwned.Required { + ownerEdge.Required() + } + + return []ent.Edge{ + ownerEdge, + } +} + +// Hooks of the OrgOwnerMixin +func (orgOwned OrgOwnerMixin) Hooks() []ent.Hook { + if orgOwned.AllowEmpty { + // do not add hooks if the field is optional + return []ent.Hook{} + } + + return []ent.Hook{ + func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + // skip the hook if the context has the token type + // this is useful for tokens, where the user is not yet authenticated to + // a particular organization yet and auth policy allows this + for _, tokenType := range orgOwned.SkipTokenType { + if rule.ContextHasPrivacyTokenOfType(ctx, tokenType) { + return next.Mutate(ctx, m) + } + } + + // set owner on create mutation + if m.Op() == ent.OpCreate { + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get organization id from context: %w", err) + } + + // set owner on mutation + if err := m.SetField(ownerFieldName, orgID); err != nil { + return nil, err + } + } else { + orgIDs, err := auth.GetOrganizationIDsFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get organization id from context: %w", err) + } + + // filter by owner on update and delete mutations + mx, ok := m.(interface { + SetOp(ent.Op) + Client() *generated.Client + WhereP(...func(*sql.Selector)) + }) + if !ok { + return nil, ErrUnexpectedMutationType + } + + orgOwned.P(mx, orgIDs) + } + + return next.Mutate(ctx, m) + }) + }, + } +} + +// Interceptors of the OrgOwnerMixin +func (orgOwned OrgOwnerMixin) Interceptors() []ent.Interceptor { + if orgOwned.AllowEmpty { + // do not add interceptors if the field is optional + return []ent.Interceptor{} + } + + return []ent.Interceptor{ + intercept.TraverseFunc(func(ctx context.Context, q intercept.Query) error { + // skip the interceptor if the context has the token type + // this is useful for tokens, where the user is not yet authenticated to + // a particular organization yet + for _, tokenType := range orgOwned.SkipTokenType { + if rule.ContextHasPrivacyTokenOfType(ctx, tokenType) { + return nil + } + } + + // check query context skips + ctxQuery := ent.QueryFromContext(ctx) + + switch orgOwned.SkipInterceptor { + case interceptors.SkipAll: + return nil + case interceptors.SkipOnlyQuery: + { + if ctxQuery.Op == "Only" { + return nil + } + } + } + + // add owner id(s) to the query + orgIDs, err := auth.GetOrganizationIDsFromContext(ctx) + if err != nil { + return err + } + + // sets the owner id on the query for the current organization + orgOwned.P(q, orgIDs) + + return nil + }), + } +} + +// P adds a storage-level predicate to the queries and mutations. +func (orgOwned OrgOwnerMixin) P(w interface{ WhereP(...func(*sql.Selector)) }, orgIDs []string) { + w.WhereP( + sql.FieldIn(ownerFieldName, orgIDs...), + ) +} diff --git a/internal/ent/schema/organization.go b/internal/ent/schema/organization.go new file mode 100644 index 0000000..cca1d2c --- /dev/null +++ b/internal/ent/schema/organization.go @@ -0,0 +1,240 @@ +package schema + +import ( + "context" + "net/url" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + "github.com/theopenlane/entx" + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" +) + +const ( + orgNameMaxLen = 160 +) + +// Organization holds the schema definition for the Organization entity - organizations are the top level tenancy construct in the system +type Organization struct { + ent.Schema +} + +// Fields of the Organization +func (Organization) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name of the organization"). + MaxLen(orgNameMaxLen). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("display_name"). + Comment("The organization's displayed 'friendly' name"). + MaxLen(nameMaxLen). + Default(""). + Annotations( + entgql.OrderField("display_name"), + ), + field.String("description"). + Comment("An optional description of the organization"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("parent_organization_id").Optional().Immutable(). + Comment("The ID of the parent organization for the organization."). + Annotations( + entgql.Type("ID"), + entgql.Skip(entgql.SkipMutationUpdateInput, entgql.SkipType), + ), + field.Bool("personal_org"). + Comment("orgs directly associated with a user"). + Optional(). + Default(false). + Immutable(), + field.String("avatar_remote_url"). + Comment("URL of the user's remote avatar"). + MaxLen(urlMaxLen). + Validate(func(s string) error { + _, err := url.Parse(s) + return err + }). + Optional(). + Nillable(), + field.Bool("dedicated_db"). + Comment("Whether the organization has a dedicated database"). + Default(false). // default to shared db + // TODO: https://github.com/theopenlane/core/issues/734 + // update this once feature functionality is enabled + // Annotations( + // entgql.Skip(), + // ), + Annotations( + entgql.Skip(entgql.SkipWhereInput, entgql.SkipMutationUpdateInput, entgql.SkipOrderField), + ), + } +} + +// Edges of the Organization +func (Organization) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("children", Organization.Type). + Annotations( + entgql.RelayConnection(), + entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), + ). + From("parent"). + Field("parent_organization_id"). + Immutable(). + Unique(). + Annotations( + entx.CascadeAnnotationField("Child"), + ), + edge.To("groups", Group.Type). + Annotations( + entx.CascadeAnnotationField("Owner"), + ), + edge.To("templates", Template.Type). + Annotations( + entx.CascadeAnnotationField("Owner"), + ), + edge.To("integrations", Integration.Type). + Annotations( + entx.CascadeAnnotationField("Owner"), + ), + edge.To("setting", OrganizationSetting.Type). + Unique(). + Annotations( + entx.CascadeAnnotationField("Organization"), + ), + edge.To("documentdata", DocumentData.Type). + Annotations( + entx.CascadeAnnotationField("Owner"), + ), + // organization that owns the entitlement + edge.To("entitlements", Entitlement.Type). + Annotations( + entx.CascadeAnnotationField("Owner"), + ), + // Organization that is assigned the entitlement + edge.To("organization_entitlement", Entitlement.Type), + edge.To("personal_access_tokens", PersonalAccessToken.Type), + edge.To("api_tokens", APIToken.Type), + edge.To("oauthprovider", OauthProvider.Type), + edge.From("users", User.Type). + Ref("organizations"). + Through("members", OrgMembership.Type), + edge.To("invites", Invite.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("subscribers", Subscriber.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("webhooks", Webhook.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("events", Event.Type), + edge.To("secrets", Hush.Type), + edge.To("features", Feature.Type), + edge.To("files", File.Type), + edge.To("entitlementplans", EntitlementPlan.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("entitlementplanfeatures", EntitlementPlanFeature.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("entities", Entity.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("entitytypes", EntityType.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("contacts", Contact.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("notes", Note.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + } +} + +func (Organization) Indexes() []ent.Index { + return []ent.Index{ + // names should be unique, but ignore deleted names + index.Fields("name"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the Organization +func (Organization) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + // Delete org members when orgs are deleted + entx.CascadeThroughAnnotationField( + []entx.ThroughCleanup{ + { + Field: "Organization", + Through: "OrgMembership", + }, + }, + ), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + }, + } +} + +// Mixin of the Organization +func (Organization) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + } +} + +// Policy defines the privacy policy of the Organization. +func (Organization) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + rule.HasOrgMutationAccess(), // Requires edit for Update, and delete for Delete mutations + privacy.AlwaysAllowRule(), // Allow all other users (e.g. a user with a JWT should be able to create a new org) + }, + Query: privacy.QueryPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.OrgInviteToken{}), // Allow invite tokens to query the org ID they are invited to + rule.AllowIfContextHasPrivacyTokenOfType(&token.SignUpToken{}), // Allow sign-up tokens to query the org ID they are subscribing to + privacy.OrganizationQueryRuleFunc(func(ctx context.Context, q *generated.OrganizationQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), // Deny all other users + }, + } +} + +// Interceptors of the Organization +func (Organization) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorOrganization(), + } +} + +// Hooks of the Organization +func (Organization) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookOrganization(), + hooks.HookOrganizationDelete(), + } +} diff --git a/internal/ent/schema/organization_history.go b/internal/ent/schema/organization_history.go new file mode 100644 index 0000000..322b645 --- /dev/null +++ b/internal/ent/schema/organization_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// OrganizationHistory holds the schema definition for the OrganizationHistory entity. +type OrganizationHistory struct { + ent.Schema +} + +// Annotations of the OrganizationHistory. +func (OrganizationHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "organization_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "Ref", + IncludeHooks: false, + }, + } +} + +// Fields of the OrganizationHistory. +func (OrganizationHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Organization{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Organization{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the OrganizationHistory +func (OrganizationHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the OrganizationHistory +func (OrganizationHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", false, false), + } +} + +// Policy of the OrganizationHistory +func (OrganizationHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.OrganizationHistoryQueryRuleFunc(func(ctx context.Context, q *generated.OrganizationHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/organizationsetting.go b/internal/ent/schema/organizationsetting.go new file mode 100644 index 0000000..34325aa --- /dev/null +++ b/internal/ent/schema/organizationsetting.go @@ -0,0 +1,127 @@ +package schema + +import ( + "context" + "net/mail" + "regexp" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/validator" + "github.com/theopenlane/core/pkg/enums" +) + +// OrganizationSetting holds the schema definition for the OrganizationSetting entity +type OrganizationSetting struct { + ent.Schema +} + +// Fields of the OrganizationSetting +func (OrganizationSetting) Fields() []ent.Field { + return []ent.Field{ + field.Strings("domains"). + Comment("domains associated with the organization"). + Validate(validator.ValidateDomains()). + Optional(), + field.String("billing_contact"). + Comment("Name of the person to contact for billing"). + Optional(), + field.String("billing_email"). + Comment("Email address of the person to contact for billing"). + Validate(func(email string) error { + _, err := mail.ParseAddress(email) + return err + }). + Optional(), + field.String("billing_phone"). + Comment("Phone number to contact for billing"). + Validate(func(phone string) error { + regex := `^\+[1-9]{1}[0-9]{3,14}$` + _, err := regexp.MatchString(regex, phone) + return err + }). + Optional(), + field.String("billing_address"). + Comment("Address to send billing information to"). + Optional(), + field.String("tax_identifier"). + Comment("Usually government-issued tax ID or business ID such as ABN in Australia"). + Optional(), + field.Enum("geo_location"). + GoType(enums.Region("")). + Comment("geographical location of the organization"). + Default(enums.Amer.String()). + Optional(), + field.String("organization_id"). + Comment("the ID of the organization the settings belong to"). + Optional(), + } +} + +// Edges of the OrganizationSetting +func (OrganizationSetting) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("organization", Organization.Type).Ref("setting").Field("organization_id").Unique(), + } +} + +// Annotations of the OrganizationSetting +func (OrganizationSetting) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + IDField: "OrganizationID", + NillableIDField: true, + }, + } +} + +// Interceptors of the OrganizationSetting +func (OrganizationSetting) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorOrganizationSetting(), + } +} + +// Mixin of the OrganizationSetting +func (OrganizationSetting) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + } +} + +// Policy defines the privacy policy of the OrganizationSetting +func (OrganizationSetting) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.OrganizationSettingMutationRuleFunc(func(ctx context.Context, m *generated.OrganizationSettingMutation) error { + return m.CheckAccessForEdit(ctx) + }), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.OrganizationSettingQueryRuleFunc(func(ctx context.Context, q *generated.OrganizationSettingQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/organizationsetting_history.go b/internal/ent/schema/organizationsetting_history.go new file mode 100644 index 0000000..f560d07 --- /dev/null +++ b/internal/ent/schema/organizationsetting_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// OrganizationSettingHistory holds the schema definition for the OrganizationSettingHistory entity. +type OrganizationSettingHistory struct { + ent.Schema +} + +// Annotations of the OrganizationSettingHistory. +func (OrganizationSettingHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "organization_setting_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OrganizationID", + IncludeHooks: false, + }, + } +} + +// Fields of the OrganizationSettingHistory. +func (OrganizationSettingHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := OrganizationSetting{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := OrganizationSetting{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the OrganizationSettingHistory +func (OrganizationSettingHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the OrganizationSettingHistory +func (OrganizationSettingHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", false, false), + } +} + +// Policy of the OrganizationSettingHistory +func (OrganizationSettingHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.OrganizationSettingHistoryQueryRuleFunc(func(ctx context.Context, q *generated.OrganizationSettingHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/orgmembership.go b/internal/ent/schema/orgmembership.go new file mode 100644 index 0000000..4dbbdf4 --- /dev/null +++ b/internal/ent/schema/orgmembership.go @@ -0,0 +1,124 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/enums" +) + +// OrgMembership holds the schema definition for the OrgMembership entity +type OrgMembership struct { + ent.Schema +} + +// Fields of the OrgMembership +func (OrgMembership) Fields() []ent.Field { + return []ent.Field{ + field.Enum("role"). + GoType(enums.Role("")). + Values(string(enums.RoleOwner)). // adds owner to the allowed values + Default(string(enums.RoleMember)), + field.String("organization_id").Immutable(), + field.String("user_id").Immutable(), + } +} + +// Edges of the OrgMembership +func (OrgMembership) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("organization", Organization.Type). + Field("organization_id"). + Required(). + Unique(). + Immutable(), + edge.To("user", User.Type). + Field("user_id"). + Required(). + Unique(). + Immutable(), + edge.To("events", Event.Type), + } +} + +// Annotations of the OrgMembership +func (OrgMembership) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: true, + IDField: "OrganizationID", + }, + } +} + +func (OrgMembership) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("user_id", "organization_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Mixin of the OrgMembership +func (OrgMembership) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + } +} + +// Hooks of the OrgMembership +func (OrgMembership) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookOrgMembers(), + hooks.HookOrgMembersDelete(), + } +} + +// Interceptors of the OrgMembership +func (OrgMembership) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorOrgMember(), + interceptors.TraverseOrgMembers(), + } +} + +// Policy of the OrgMembership +func (OrgMembership) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.OrgInviteToken{}), + privacy.OrgMembershipMutationRuleFunc(func(ctx context.Context, m *generated.OrgMembershipMutation) error { + return m.CheckAccessForEdit(ctx) + }), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.OrgMembershipQueryRuleFunc(func(ctx context.Context, q *generated.OrgMembershipQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/orgmembership_history.go b/internal/ent/schema/orgmembership_history.go new file mode 100644 index 0000000..e462b3d --- /dev/null +++ b/internal/ent/schema/orgmembership_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// OrgMembershipHistory holds the schema definition for the OrgMembershipHistory entity. +type OrgMembershipHistory struct { + ent.Schema +} + +// Annotations of the OrgMembershipHistory. +func (OrgMembershipHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "org_membership_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OrganizationID", + IncludeHooks: false, + }, + } +} + +// Fields of the OrgMembershipHistory. +func (OrgMembershipHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := OrgMembership{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := OrgMembership{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the OrgMembershipHistory +func (OrgMembershipHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the OrgMembershipHistory +func (OrgMembershipHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", false, false), + } +} + +// Policy of the OrgMembershipHistory +func (OrgMembershipHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.OrgMembershipHistoryQueryRuleFunc(func(ctx context.Context, q *generated.OrgMembershipHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/passwordresettoken.go b/internal/ent/schema/passwordresettoken.go new file mode 100644 index 0000000..79d57e1 --- /dev/null +++ b/internal/ent/schema/passwordresettoken.go @@ -0,0 +1,135 @@ +package schema + +import ( + "net/mail" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/entql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" +) + +// PasswordResetToken holds the schema definition for the PasswordResetToken entity +type PasswordResetToken struct { + ent.Schema +} + +// Fields of the PasswordResetToken +func (PasswordResetToken) Fields() []ent.Field { + return []ent.Field{ + field.String("token"). + Comment("the reset token sent to the user via email which should only be provided to the /forgot-password endpoint + handler"). + Unique(). + NotEmpty(), + field.Time("ttl"). + Comment("the ttl of the reset token which defaults to 15 minutes"). + Nillable(), + field.String("email"). + Comment("the email used as input to generate the reset token; this is used to verify that the token when regenerated within the server matches the token emailed"). + Validate(func(email string) error { + _, err := mail.ParseAddress(email) + return err + }). + NotEmpty(), + field.Bytes("secret"). + Comment("the comparison secret to verify the token's signature"). + NotEmpty(). + Nillable(), + } +} + +// Edges of the PasswordResetToken +func (PasswordResetToken) Edges() []ent.Edge { + return []ent.Edge{} +} + +// Mixin of the PasswordResetToken +func (PasswordResetToken) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + UserOwnedMixin{ + Ref: "password_reset_tokens", + SkipOASGeneration: true, + SkipInterceptor: interceptors.SkipAll, + }, + } +} + +// Indexes of the PasswordResetToken +func (PasswordResetToken) Indexes() []ent.Index { + return []ent.Index{ + // PasswordResetTokens should be unique, but ignore deleted PasswordResetTokens + index.Fields("token"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the PasswordResetToken +func (PasswordResetToken) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.Skip(entgql.SkipAll), + entx.SchemaGenSkip(true), + entx.QueryGenSkip(true), + history.Annotations{ + Exclude: true, + }, + } +} + +// Hooks of the PasswordResetToken +func (PasswordResetToken) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookPasswordResetToken(), + } +} + +// Policy of the PasswordResetToken +func (PasswordResetToken) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + rule.AllowAfterApplyingPrivacyTokenFilter( + &token.ResetToken{}, + func(t token.PrivacyToken, filter privacy.Filter) { + actualToken := t.(*token.ResetToken) + tokenFilter := filter.(*generated.PasswordResetTokenFilter) + tokenFilter.WhereToken(entql.StringEQ(actualToken.GetToken())) + }, + ), + privacy.AlwaysAllowRule(), + }, + Mutation: privacy.MutationPolicy{ + privacy.OnMutationOperation( + privacy.MutationPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.ResetToken{}), + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysDenyRule(), + }, + ent.OpCreate, + ), + privacy.OnMutationOperation( + privacy.MutationPolicy{ + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysDenyRule(), + }, + ent.OpUpdateOne|ent.OpUpdate|ent.OpDeleteOne|ent.OpDelete, + ), + }, + } +} diff --git a/internal/ent/schema/personalaccesstoken.go b/internal/ent/schema/personalaccesstoken.go new file mode 100644 index 0000000..1f9a77e --- /dev/null +++ b/internal/ent/schema/personalaccesstoken.go @@ -0,0 +1,138 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/pkg/keygen" +) + +// PersonalAccessToken holds the schema definition for the PersonalAccessToken entity. +type PersonalAccessToken struct { + ent.Schema +} + +// Fields of the PersonalAccessToken +func (PersonalAccessToken) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name associated with the token"). + NotEmpty(), + field.String("token"). + Unique(). + Immutable(). + Annotations( + entgql.Skip(^entgql.SkipType), + ). + DefaultFunc(func() string { + token := keygen.PrefixedSecret("tolp") // token prefix + return token + }), + field.Time("expires_at"). + Comment("when the token expires"). + Annotations( + entgql.Skip(entgql.SkipMutationUpdateInput), + ). + Optional(). + Nillable(), + field.String("description"). + Comment("a description of the token's purpose"). + Optional(). + Nillable(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.JSON("scopes", []string{}). + Optional(), + field.Time("last_used_at"). + Optional(). + Nillable(), + } +} + +// Edges of the PersonalAccessToken +func (PersonalAccessToken) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("organizations", Organization.Type). + Ref("personal_access_tokens"). + Comment("the organization(s) the token is associated with"), + edge.To("events", Event.Type), + } +} + +// Indexes of the PersonalAccessToken +func (PersonalAccessToken) Indexes() []ent.Index { + return []ent.Index{ + // non-unique index. + index.Fields("token"), + } +} + +// Mixin of the PersonalAccessToken +func (PersonalAccessToken) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + mixin.SoftDeleteMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + UserOwnedMixin{ + Ref: "personal_access_tokens", + AllowUpdate: false, + // skip the interceptor for Only queries when the token is being checked + // and we do not yet know the organization + SkipInterceptor: interceptors.SkipOnlyQuery, + }, + } +} + +// Annotations of the PersonalAccessToken +func (PersonalAccessToken) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + history.Annotations{ + Exclude: true, + }, + } +} + +// Hooks of the PersonalAccessToken +func (PersonalAccessToken) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookCreatePersonalAccessToken(), + hooks.HookUpdatePersonalAccessToken(), + } +} + +// Interceptors of the PersonalAccessToken +func (PersonalAccessToken) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorPat(), + } +} + +// Policy of the PersonalAccessToken +func (PersonalAccessToken) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + rule.AllowMutationAfterApplyingOwnerFilter(), + privacy.AlwaysAllowRule(), + }, + Query: privacy.QueryPolicy{ + privacy.AlwaysAllowRule(), + }, + } +} diff --git a/internal/ent/schema/subscriber.go b/internal/ent/schema/subscriber.go new file mode 100644 index 0000000..fe0915d --- /dev/null +++ b/internal/ent/schema/subscriber.go @@ -0,0 +1,159 @@ +package schema + +import ( + "context" + "net/mail" + "regexp" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" +) + +// Subscriber holds the schema definition for the Subscriber entity +type Subscriber struct { + ent.Schema +} + +// Fields of the Subscriber +func (Subscriber) Fields() []ent.Field { + return []ent.Field{ + field.String("email"). + Comment("email address of the subscriber"). + Validate(func(email string) error { + _, err := mail.ParseAddress(email) + return err + }), + field.String("phone_number"). + Comment("phone number of the subscriber"). + Optional(). + Validate(func(phone string) error { + regex := `^\+[1-9]{1}[0-9]{3,14}$` + _, err := regexp.MatchString(regex, phone) + return err + }), + field.Bool("verified_email"). + Comment("indicates if the email address has been verified"). + Default(false). + Annotations(entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput)), + field.Bool("verified_phone"). + Comment("indicates if the phone number has been verified"). + Default(false). + Annotations(entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput)), + field.Bool("active"). + Comment("indicates if the subscriber is active or not, active users will have at least one verified contact method"). + Default(false). + Annotations(entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput)), + field.String("token"). + Comment("the verification token sent to the user via email which should only be provided to the /subscribe endpoint + handler"). + Unique(). + Annotations(entgql.Skip()). + NotEmpty(), + field.Time("ttl"). + Comment("the ttl of the verification token which defaults to 7 days"). + Annotations(entgql.Skip()). + Nillable(), + field.Bytes("secret"). + Comment("the comparison secret to verify the token's signature"). + NotEmpty(). + Annotations(entgql.Skip()). + Nillable(), + } +} + +// Mixin of the Subscriber +func (Subscriber) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + OrgOwnerMixin{ + Ref: "subscribers", + SkipTokenType: []token.PrivacyToken{ + &token.VerifyToken{}, + &token.SignUpToken{}, + }, + }, + } +} + +// Edges of the Subscriber +func (Subscriber) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("events", Event.Type), + } +} + +func (Subscriber) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookSubscriber(), + } +} + +// Indexes of the Subscriber +func (Subscriber) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("email", "owner_id"). + Unique(). + Annotations( + entsql.IndexWhere("deleted_at is NULL"), + ), + } +} + +// Annotations of the Subscriber +func (Subscriber) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + OrgOwnedField: true, + NillableIDField: true, + IDField: "OwnerID", + }, + history.Annotations{ + Exclude: true, + }, + } +} + +// Policy of the Subscriber +func (Subscriber) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.SignUpToken{}), + rule.AllowIfContextHasPrivacyTokenOfType(&token.VerifyToken{}), + privacy.SubscriberMutationRuleFunc(func(ctx context.Context, m *generated.SubscriberMutation) error { + return m.CheckAccessForEdit(ctx) + }), + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.SignUpToken{}), + rule.AllowIfContextHasPrivacyTokenOfType(&token.VerifyToken{}), + privacy.SubscriberQueryRuleFunc(func(ctx context.Context, q *generated.SubscriberQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/template.go b/internal/ent/schema/template.go new file mode 100644 index 0000000..3d673e0 --- /dev/null +++ b/internal/ent/schema/template.go @@ -0,0 +1,124 @@ +package schema + +import ( + "context" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + "github.com/theopenlane/entx" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/pkg/enums" +) + +// Template holds the schema definition for the Template entity +type Template struct { + ent.Schema +} + +// Mixin of the Template +func (Template) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + mixin.SoftDeleteMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + OrgOwnerMixin{ + Ref: "templates", + }, + } +} + +// Fields of the Template +func (Template) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name of the template"). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + ), + field.Enum("template_type"). + Comment("the type of the template, either a provided template or an implementation (document)"). + GoType(enums.DocumentType("")). + Default(string(enums.Document)), + field.String("description"). + Comment("the description of the template"). + Optional(), + field.JSON("jsonconfig", customtypes.JSONObject{}). + Comment("the jsonschema object of the template"). + Annotations( + entgql.Type("JSON"), + ), + field.JSON("uischema", customtypes.JSONObject{}). + Comment("the uischema for the template to render in the UI"). + Annotations( + entgql.Type("JSON"), + ). + Optional(), + } +} + +// Edges of the Template +func (Template) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("documents", DocumentData.Type). + Annotations( + entx.CascadeAnnotationField("Template"), + ), + } +} + +// Indexes of the Template +func (Template) Indexes() []ent.Index { + return []ent.Index{ + // names should be unique, but ignore deleted names + index.Fields("name", "owner_id", "template_type"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Annotations of the Template +func (Template) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.RelayConnection(), + entgql.QueryField(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + NillableIDField: true, + OrgOwnedField: true, + IDField: "OwnerID", + }, + } +} + +// Policy of the Template +func (Template) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.TemplateMutationRuleFunc(func(ctx context.Context, m *generated.TemplateMutation) error { + return m.CheckAccessForEdit(ctx) + }), + + privacy.AlwaysDenyRule(), + }, + Query: privacy.QueryPolicy{ + privacy.TemplateQueryRuleFunc(func(ctx context.Context, q *generated.TemplateQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/template_history.go b/internal/ent/schema/template_history.go new file mode 100644 index 0000000..55344d5 --- /dev/null +++ b/internal/ent/schema/template_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// TemplateHistory holds the schema definition for the TemplateHistory entity. +type TemplateHistory struct { + ent.Schema +} + +// Annotations of the TemplateHistory. +func (TemplateHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "template_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the TemplateHistory. +func (TemplateHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Template{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Template{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the TemplateHistory +func (TemplateHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the TemplateHistory +func (TemplateHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the TemplateHistory +func (TemplateHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.TemplateHistoryQueryRuleFunc(func(ctx context.Context, q *generated.TemplateHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/schema/tfasetting.go b/internal/ent/schema/tfasetting.go new file mode 100644 index 0000000..0f7c544 --- /dev/null +++ b/internal/ent/schema/tfasetting.go @@ -0,0 +1,99 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/mixin" +) + +// TFASetting holds the schema definition for the TFASetting entity +type TFASetting struct { + ent.Schema +} + +// Fields of the TFASetting +func (TFASetting) Fields() []ent.Field { + return []ent.Field{ + field.String("tfa_secret"). + Comment("TFA secret for the user"). + Annotations( + entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), + ). + Optional(). + Nillable(), + field.Bool("verified"). + Comment("specifies if the TFA device has been verified"). + Annotations( + entgql.Skip(entgql.SkipMutationCreateInput), + ). + Default(false), + field.Strings("recovery_codes"). + Comment("recovery codes for 2fa"). + Annotations( + entgql.Skip(entgql.SkipMutationCreateInput, entgql.SkipMutationUpdateInput), + ). + Optional(), + field.Bool("phone_otp_allowed"). + Comment("specifies a user may complete authentication by verifying an OTP code delivered through SMS"). + Optional(). + Annotations( + // skip until feature is implemented + entgql.Skip(entgql.SkipAll), + ). + Default(false), + field.Bool("email_otp_allowed"). + Comment("specifies a user may complete authentication by verifying an OTP code delivered through email"). + Optional(). + Annotations( + // skip until feature is implemented + entgql.Skip(entgql.SkipAll), + ). + Default(false), + field.Bool("totp_allowed"). + Comment("specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app"). + Optional(). + Default(false), + } +} + +// Mixin of the TFASetting +func (TFASetting) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + mixin.SoftDeleteMixin{}, + emixin.TagMixin{}, + UserOwnedMixin{ + Ref: "tfa_settings", + Optional: true, + AllowUpdate: false, + SoftDeleteIndex: true, + }, + } +} + +// Hooks of the TFASetting +func (TFASetting) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookEnableTFA(), // sets 2fa on user settings and stores recovery codes + } +} + +// Annotations of the TFASetting +func (TFASetting) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + history.Annotations{ + Exclude: true, + }, + } +} diff --git a/internal/ent/schema/user.go b/internal/ent/schema/user.go new file mode 100644 index 0000000..a7ba4b1 --- /dev/null +++ b/internal/ent/schema/user.go @@ -0,0 +1,237 @@ +package schema + +import ( + "net/mail" + "net/url" + "strings" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx" + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/enums" +) + +const ( + urlMaxLen = 255 + nameMaxLen = 64 +) + +// User holds the schema definition for the User entity. +type User struct { + ent.Schema +} + +// Mixin of the User +func (User) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + mixin.SoftDeleteMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + } +} + +// Fields of the User. +func (User) Fields() []ent.Field { + return []ent.Field{ + // NOTE: the created_at and updated_at fields are automatically created by the AuditMixin, you do not need to re-declare / add them in these fields + field.String("email"). + Validate(func(email string) error { + _, err := mail.ParseAddress(email) + return err + }), + field.String("first_name"). + Optional(). + MaxLen(nameMaxLen). + Annotations( + entgql.OrderField("first_name"), + ), + field.String("last_name"). + Optional(). + MaxLen(nameMaxLen). + Annotations( + entgql.OrderField("last_name"), + ), + field.String("display_name"). + Comment("The user's displayed 'friendly' name"). + MaxLen(nameMaxLen). + NotEmpty(). + Annotations( + entgql.OrderField("display_name"), + ). + Validate( + func(s string) error { + if strings.Contains(s, " ") { + return ErrContainsSpaces + } + return nil + }, + ), + field.String("avatar_remote_url"). + Comment("URL of the user's remote avatar"). + MaxLen(urlMaxLen). + Validate(func(s string) error { + _, err := url.Parse(s) + return err + }). + Optional(). + Nillable(), + field.String("avatar_local_file"). + Comment("The user's local avatar file"). + MaxLen(urlMaxLen). + Optional(). + Nillable(), + field.Time("avatar_updated_at"). + Comment("The time the user's (local) avatar was last updated"). + UpdateDefault(time.Now). + Optional(). + Nillable(), + field.Time("last_seen"). + Comment("the time the user was last seen"). + UpdateDefault(time.Now). + Optional(). + Nillable(), + field.String("password"). + Comment("user password hash"). + Nillable(). + Sensitive(). + Optional(), + field.String("sub"). + Comment("the Subject of the user JWT"). + Unique(). + Optional(), + field.Enum("auth_provider"). + Comment("auth provider used to register the account"). + GoType(enums.AuthProvider("")). + Default(string(enums.AuthProviderCredentials)), + field.Enum("role"). + Comment("the user's role"). + GoType(enums.Role("")). + Default(string(enums.RoleUser)). + Optional(), + } +} + +// Indexes of the User +func (User) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("id"). + Unique(), // enforce globally unique ids + index.Fields("email", "auth_provider"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Edges of the User +func (User) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("personal_access_tokens", PersonalAccessToken.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("tfa_settings", TFASetting.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("setting", UserSetting.Type). + Required(). + Unique(). + Annotations( + entx.CascadeAnnotationField("User"), + ), + edge.To("email_verification_tokens", EmailVerificationToken.Type). + Annotations( + entx.CascadeAnnotationField("Owner"), + ), + edge.To("password_reset_tokens", PasswordResetToken.Type). + Annotations( + entx.CascadeAnnotationField("Owner"), + ), + edge.To("groups", Group.Type). + Through("group_memberships", GroupMembership.Type), + edge.To("organizations", Organization.Type). + Through("org_memberships", OrgMembership.Type), + edge.To("webauthn", Webauthn.Type). + Annotations(entx.CascadeAnnotationField("Owner")), + edge.To("files", File.Type), + edge.To("events", Event.Type), + } +} + +// Annotations of the User +func (User) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + // Delete users from groups and orgs when the user is deleted + entx.CascadeThroughAnnotationField( + []entx.ThroughCleanup{ + { + Field: "User", + Through: "OrgMembership", + }, + { + Field: "User", + Through: "GroupMembership", + }, + }, + ), + } +} + +// Policy of the User +func (User) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.OnMutationOperation( + privacy.MutationPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.SignUpToken{}), + rule.AllowIfContextHasPrivacyTokenOfType(&token.OrgInviteToken{}), + rule.AllowIfContextHasPrivacyTokenOfType(&token.OauthTooToken{}), + rule.AllowIfSelf(), + privacy.AlwaysDenyRule(), + }, + // the user hook has update operations on user create so we need to allow email token sign up for update + // operations as well + ent.OpCreate|ent.OpUpdateOne, + ), + privacy.OnMutationOperation( + privacy.MutationPolicy{ + rule.AllowIfSelf(), + privacy.AlwaysDenyRule(), + }, + ent.OpUpdateOne|ent.OpUpdate|ent.OpDeleteOne|ent.OpDelete, + ), + }, + Query: privacy.QueryPolicy{ + // Privacy will be always allow, but interceptors will filter the queries + privacy.AlwaysAllowRule(), + }, + } +} + +func (User) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookUser(), + hooks.HookDeleteUser(), + } +} + +// Interceptors of the User. +func (d User) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.TraverseUser(), + } +} diff --git a/internal/ent/schema/user_history.go b/internal/ent/schema/user_history.go new file mode 100644 index 0000000..239c5d4 --- /dev/null +++ b/internal/ent/schema/user_history.go @@ -0,0 +1,98 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" +) + +// UserHistory holds the schema definition for the UserHistory entity. +type UserHistory struct { + ent.Schema +} + +// Annotations of the UserHistory. +func (UserHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "user_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + } +} + +// Fields of the UserHistory. +func (UserHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := User{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := User{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the UserHistory +func (UserHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the UserHistory +func (UserHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", false, false), + } +} diff --git a/internal/ent/schema/user_owned_mixin.go b/internal/ent/schema/user_owned_mixin.go new file mode 100644 index 0000000..7d6ba8b --- /dev/null +++ b/internal/ent/schema/user_owned_mixin.go @@ -0,0 +1,192 @@ +package schema + +import ( + "context" + "errors" + "fmt" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/dialect/sql" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + "entgo.io/ent/schema/mixin" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" +) + +type UserOwnedMixin struct { + mixin.Schema + // Ref table for the id + Ref string + // Optional makes the owner id field not required + Optional bool + // AllowUpdate allows the owner id field to be updated + AllowUpdate bool + // SkipOASGeneration skips open api spec generation for the field + SkipOASGeneration bool + // SoftDeleteIndex creates a unique index on the owner id field where deleted_at is null + SoftDeleteIndex bool + // AllowWhere includes the owner_id field in gql generated fields + AllowWhere bool + // SkipInterceptor skips the interceptor for that schema for all queries, or specific types, + // this is useful for tokens, etc + SkipInterceptor interceptors.SkipMode + // SkipTokenType skips the traverser or hook if the token type is found in the context + SkipTokenType []token.PrivacyToken +} + +// Fields of the UserOwnedMixin +func (userOwned UserOwnedMixin) Fields() []ent.Field { + ownerIDField := field.String("owner_id"). + Annotations( + entgql.Skip(), + ). + Comment("The user id that owns the object") + + if userOwned.Optional { + ownerIDField.Optional() + } + + return []ent.Field{ + ownerIDField, + } +} + +// Edges of the UserOwnedMixin +func (userOwned UserOwnedMixin) Edges() []ent.Edge { + if userOwned.Ref == "" { + panic(errors.New("ref must be non-empty string")) // nolint: goerr113 + } + + ownerEdge := edge. + From("owner", User.Type). + Field("owner_id"). + Ref(userOwned.Ref). + Unique() + + if !userOwned.Optional { + ownerEdge.Required() + } + + if !userOwned.AllowUpdate { + ownerEdge.Annotations( + entgql.Skip(entgql.SkipMutationUpdateInput), + ) + } + + return []ent.Edge{ + ownerEdge, + } +} + +// Indexes of the UserOwnedMixin +func (userOwned UserOwnedMixin) Indexes() []ent.Index { + if !userOwned.SoftDeleteIndex { + return []ent.Index{} + } + + return []ent.Index{ + index.Fields("owner_id"). + Unique().Annotations(entsql.IndexWhere("deleted_at is NULL")), + } +} + +// Hooks of the UserOwnedMixin +func (userOwned UserOwnedMixin) Hooks() []ent.Hook { + return []ent.Hook{ + func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + // skip hook if strictly set to allow + if _, allow := privacy.DecisionFromContext(ctx); allow { + return next.Mutate(ctx, m) + } + + // skip the hook if the context has the token type + // this is useful for tokens, where the user is not yet (e.g. email verification tokens) + for _, tokenType := range userOwned.SkipTokenType { + if rule.ContextHasPrivacyTokenOfType(ctx, tokenType) { + return next.Mutate(ctx, m) + } + } + + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get user id from context: %w", err) + } + + // set owner on create mutation + if m.Op() == ent.OpCreate { + // set owner on mutation + if err := m.SetField(ownerFieldName, userID); err != nil { + return nil, err + } + } else { + // filter by owner on update and delete mutations + mx, ok := m.(interface { + SetOp(ent.Op) + Client() *generated.Client + WhereP(...func(*sql.Selector)) + }) + if !ok { + return nil, ErrUnexpectedMutationType + } + + userOwned.P(mx, userID) + } + + return next.Mutate(ctx, m) + }) + }, + } +} + +func (userOwned UserOwnedMixin) Interceptors() []ent.Interceptor { + if userOwned.Optional { + // do not add interceptors if the field is optional + return []ent.Interceptor{} + } else { + return []ent.Interceptor{ + intercept.TraverseFunc(func(ctx context.Context, q intercept.Query) error { + // Skip the interceptor for all queries if BypassInterceptor flag is set + // This is needed for schemas that are never authorized users such as email verification tokens + if userOwned.SkipInterceptor == interceptors.SkipAll { + return nil + } + + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + ctxQuery := ent.QueryFromContext(ctx) + + // Skip the interceptor if the query is for a single entity + // and the BypassInterceptor flag is set for Only queries + if userOwned.SkipInterceptor == interceptors.SkipOnlyQuery && ctxQuery.Op == "Only" { + return nil + } + + return err + } + + // sets the owner id on the query for the current organization + userOwned.P(q, userID) + + return nil + }), + } + } +} + +// P adds a storage-level predicate to the queries and mutations. +func (userOwned UserOwnedMixin) P(w interface{ WhereP(...func(*sql.Selector)) }, userID string) { + w.WhereP( + sql.FieldEQ(ownerFieldName, userID), + ) +} diff --git a/internal/ent/schema/usersetting.go b/internal/ent/schema/usersetting.go new file mode 100644 index 0000000..8fd7159 --- /dev/null +++ b/internal/ent/schema/usersetting.go @@ -0,0 +1,127 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + + emixin "github.com/theopenlane/entx/mixin" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/internal/ent/mixin" + "github.com/theopenlane/core/internal/ent/privacy/rule" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/enums" +) + +// UserSetting holds the schema definition for the User entity. +type UserSetting struct { + ent.Schema +} + +// Mixin of the UserSetting +func (UserSetting) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + } +} + +// Fields of the UserSetting +func (UserSetting) Fields() []ent.Field { + return []ent.Field{ + field.String("user_id").Optional(), + field.Bool("locked"). + Comment("user account is locked if unconfirmed or explicitly locked"). + Default(false), + field.Time("silenced_at"). + Comment("The time notifications regarding the user were silenced"). + Optional(). + Nillable(), + field.Time("suspended_at"). + Comment("The time the user was suspended"). + Optional(). + Nillable(), + field.Enum("status"). + Comment("status of the user account"). + GoType(enums.UserStatus("")). + Default(string(enums.UserStatusActive)), + field.Bool("email_confirmed").Default(false). + Comment("whether the user has confirmed their email address"), + field.Bool("is_webauthn_allowed"). + Comment("specifies a user may complete authentication by verifying a WebAuthn capable device"). + Optional(). + Default(false), + field.Bool("is_tfa_enabled"). + Comment("whether the user has two factor authentication enabled"). + Optional(). + Default(false), + field.String("phone_number"). + Comment("phone number associated with the account, used 2factor SMS authentication"). + Optional(). + Annotations( + // skip until SMS 2fa feature is implemented + entgql.Skip(entgql.SkipAll), + ). + Nillable(), + } +} + +// Edges of the UserSetting +func (UserSetting) Edges() []ent.Edge { + return []ent.Edge{ + edge.From("user", User.Type).Ref("setting").Unique().Field("user_id"), + edge.To("default_org", Organization.Type). + Unique(). + Comment("organization to load on user login"), + } +} + +// Annotations of the UserSetting +func (UserSetting) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + } +} + +// Hooks of the UserSetting. +func (UserSetting) Hooks() []ent.Hook { + return []ent.Hook{ + hooks.HookUserSetting(), + } +} + +// Interceptors of the UserSetting. +func (d UserSetting) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.InterceptorUserSetting(), + } +} + +func (UserSetting) Policy() ent.Policy { + return privacy.Policy{ + Mutation: privacy.MutationPolicy{ + privacy.OnMutationOperation( + privacy.MutationPolicy{ + rule.AllowIfContextHasPrivacyTokenOfType(&token.VerifyToken{}), + rule.AllowIfSelf(), + privacy.AlwaysDenyRule(), + }, + // only resolvers exist for update operations + ent.OpUpdateOne|ent.OpUpdate, + ), + }, + Query: privacy.QueryPolicy{ + // Privacy will be always allow, but interceptors will filter the queries + privacy.AlwaysAllowRule(), + }, + } +} diff --git a/internal/ent/schema/usersetting_history.go b/internal/ent/schema/usersetting_history.go new file mode 100644 index 0000000..03617d0 --- /dev/null +++ b/internal/ent/schema/usersetting_history.go @@ -0,0 +1,98 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" +) + +// UserSettingHistory holds the schema definition for the UserSettingHistory entity. +type UserSettingHistory struct { + ent.Schema +} + +// Annotations of the UserSettingHistory. +func (UserSettingHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "user_setting_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + } +} + +// Fields of the UserSettingHistory. +func (UserSettingHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := UserSetting{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := UserSetting{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the UserSettingHistory +func (UserSettingHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the UserSettingHistory +func (UserSettingHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", false, false), + } +} diff --git a/internal/ent/schema/webauthn.go b/internal/ent/schema/webauthn.go new file mode 100644 index 0000000..1eb6d00 --- /dev/null +++ b/internal/ent/schema/webauthn.go @@ -0,0 +1,84 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" +) + +// Webauthn holds the schema definition for the Webauthn entity +type Webauthn struct { + ent.Schema +} + +// Fields of the Webauthn +func (Webauthn) Fields() []ent.Field { + return []ent.Field{ + field.Bytes("credential_id"). + Comment("A probabilistically-unique byte sequence identifying a public key credential source and its authentication assertions"). + Unique(). + Optional(), + field.Bytes("public_key"). + Comment("The public key portion of a Relying Party-specific credential key pair, generated by an authenticator and returned to a Relying Party at registration time"). + Optional(), + field.String("attestation_type"). + Comment("The attestation format used (if any) by the authenticator when creating the credential"). + Optional(), + field.Bytes("aaguid"). + Comment("The AAGUID of the authenticator; AAGUID is defined as an array containing the globally unique identifier of the authenticator model being sought"). + Unique(). + Immutable(), + field.Int32("sign_count"). + Comment("SignCount -Upon a new login operation, the Relying Party compares the stored signature counter value with the new signCount value returned in the assertions authenticator data. If this new signCount value is less than or equal to the stored value, a cloned authenticator may exist, or the authenticator may be malfunctioning"), + field.Strings("transports"). + Comment("transport"), + field.Bool("backup_eligible"). + Comment("Flag backup eligible indicates the credential is able to be backed up and/or sync'd between devices. This should NEVER change"). + Default(false). + Immutable(), + field.Bool("backup_state"). + Comment("Flag backup state indicates the credential has been backed up and/or sync'd"). + Default(false), + field.Bool("user_present"). + Comment("Flag user present indicates the users presence"). + Default(false), + field.Bool("user_verified"). + Comment("Flag user verified indicates the user performed verification"). + Default(false), + } +} + +// Edges of the Webauthn +func (Webauthn) Edges() []ent.Edge { + return []ent.Edge{} +} + +// Mixin of the Webauthn +func (Webauthn) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + UserOwnedMixin{ + Ref: "webauthn", + SkipOASGeneration: true, + }, + } +} + +// Annotations of the Webauthn +func (Webauthn) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.Skip(entgql.SkipAll), + entx.SchemaGenSkip(true), + entx.QueryGenSkip(true), + history.Annotations{ + Exclude: true, + }, + } +} diff --git a/internal/ent/schema/webhook.go b/internal/ent/schema/webhook.go new file mode 100644 index 0000000..7ff4259 --- /dev/null +++ b/internal/ent/schema/webhook.go @@ -0,0 +1,123 @@ +package schema + +import ( + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/edge" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/entx/history" + emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/iam/entfga" + + "github.com/theopenlane/core/internal/ent/mixin" +) + +// Webhook holds the schema definition for the Webhook entity +type Webhook struct { + ent.Schema +} + +// Fields of the Webhook +func (Webhook) Fields() []ent.Field { + return []ent.Field{ + field.String("name"). + Comment("the name of the webhook"). + NotEmpty(). + Annotations( + entgql.OrderField("name"), + ), + field.String("description"). + Comment("a description of the webhook"). + Optional(). + Annotations( + entgql.Skip(entgql.SkipWhereInput), + ), + field.String("destination_url"). + Comment("the url to send the webhook to"). + NotEmpty(). + Annotations( + entgql.OrderField("url"), + ), + field.Bool("enabled"). + Comment("indicates if the webhook is active and enabled"). + Default(true), + field.String("callback"). + Comment("the call back string"). + Unique(). + Annotations(entgql.Skip()). + Optional(), + field.Time("expires_at"). + Comment("the ttl of the webhook delivery"). + Annotations(entgql.Skip()). + Optional(), + field.Bytes("secret"). + Comment("the comparison secret to verify the token's signature"). + Annotations(entgql.Skip()). + Optional(), + field.Int("failures"). + Comment("the number of failures"). + Optional(). + Default(0), + field.String("last_error"). + Comment("the last error message"). + Optional(), + field.String("last_response"). + Comment("the last response"). + Optional(), + } +} + +// Mixin of the Webhook +func (Webhook) Mixin() []ent.Mixin { + return []ent.Mixin{ + emixin.AuditMixin{}, + emixin.IDMixin{}, + emixin.TagMixin{}, + mixin.SoftDeleteMixin{}, + OrgOwnerMixin{ + Ref: "webhooks", + AllowEmpty: true, + }, + } +} + +// Edges of the Webhook +func (Webhook) Edges() []ent.Edge { + return []ent.Edge{ + edge.To("events", Event.Type), + edge.From("integrations", Integration.Type).Ref("webhooks"), + } +} + +// Indexes of the Webhook +func (Webhook) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("name", "owner_id"). + Unique(). + Annotations( + entsql.IndexWhere("deleted_at is NULL"), + ), + } +} + +// Annotations of the Webhook +func (Webhook) Annotations() []schema.Annotation { + return []schema.Annotation{ + entgql.QueryField(), + entgql.RelayConnection(), + entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + entfga.Annotations{ + ObjectType: "organization", + IncludeHooks: false, + IDField: "OwnerID", + NillableIDField: true, + }, + history.Annotations{ + Exclude: false, + }, + } +} diff --git a/internal/ent/schema/webhook_history.go b/internal/ent/schema/webhook_history.go new file mode 100644 index 0000000..484dc4a --- /dev/null +++ b/internal/ent/schema/webhook_history.go @@ -0,0 +1,119 @@ +// Code generated by entx.history, DO NOT EDIT. +package schema + +import ( + "context" + "time" + + "entgo.io/contrib/entgql" + "entgo.io/ent" + "entgo.io/ent/dialect/entsql" + "entgo.io/ent/schema" + "entgo.io/ent/schema/field" + "entgo.io/ent/schema/index" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/entx" + "github.com/theopenlane/entx/history" + "github.com/theopenlane/iam/entfga" +) + +// WebhookHistory holds the schema definition for the WebhookHistory entity. +type WebhookHistory struct { + ent.Schema +} + +// Annotations of the WebhookHistory. +func (WebhookHistory) Annotations() []schema.Annotation { + return []schema.Annotation{ + entx.SchemaGenSkip(true), + entsql.Annotation{ + Table: "webhook_history", + }, + history.Annotations{ + IsHistory: true, + Exclude: true, + }, + entgql.QueryField(), + entgql.RelayConnection(), + entfga.Annotations{ + ObjectType: "organization", + IDField: "OwnerID", + IncludeHooks: false, + }, + } +} + +// Fields of the WebhookHistory. +func (WebhookHistory) Fields() []ent.Field { + historyFields := []ent.Field{ + field.Time("history_time"). + Default(time.Now). + Immutable(), + field.String("ref"). + Immutable(). + Optional(), + field.Enum("operation"). + GoType(history.OpType("")). + Immutable(), + } + + // get the fields from the mixins + // we only want to include mixin fields, not edges + // so this prevents FKs back to the main tables + mixins := Webhook{}.Mixin() + for _, mixin := range mixins { + for _, field := range mixin.Fields() { + // make sure the mixed in fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the mixed in field to the history fields + historyFields = append(historyFields, field) + } + } + + original := Webhook{} + for _, field := range original.Fields() { + // make sure the fields do not have unique constraints + field.Descriptor().Unique = false + + // make sure the mixed in fields do not have validators + field.Descriptor().Validators = nil + + // append the field to the history fields + historyFields = append(historyFields, field) + } + + return historyFields +} + +// Indexes of the WebhookHistory +func (WebhookHistory) Indexes() []ent.Index { + return []ent.Index{ + index.Fields("history_time"), + } +} + +// Interceptors of the WebhookHistory +func (WebhookHistory) Interceptors() []ent.Interceptor { + return []ent.Interceptor{ + interceptors.HistoryAccess("audit_log_viewer", true, false), + } +} + +// Policy of the WebhookHistory +func (WebhookHistory) Policy() ent.Policy { + return privacy.Policy{ + Query: privacy.QueryPolicy{ + privacy.WebhookHistoryQueryRuleFunc(func(ctx context.Context, q *generated.WebhookHistoryQuery) error { + return q.CheckAccess(ctx) + }), + privacy.AlwaysDenyRule(), + }, + } +} diff --git a/internal/ent/templates/.gitkeep b/internal/ent/templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/internal/ent/templates/edge_cleanup.tmpl b/internal/ent/templates/edge_cleanup.tmpl new file mode 100644 index 0000000..2cb9cce --- /dev/null +++ b/internal/ent/templates/edge_cleanup.tmpl @@ -0,0 +1,56 @@ +{{/* The line below tells Intellij/GoLand to enable the autocompletion based on the *gen.Graph type. */}} +{{/* gotype: entgo.io/ent/entc/gen.Graph */}} + +{{ define "edge_cleanup" }} + +{{/* Add the base header for the generated file */}} +{{ $pkg := base $.Config.Package }} +{{ template "header" $ }} + + {{/* For each schema */}} + {{- range $node := $.Nodes }} + {{/* create an EdgeCleanup function accepting an ID */}} + func {{ $node.Name }}EdgeCleanup(ctx context.Context, id string) error { + // If a user has access to delete the object, they have access to delete all edges + ctx = privacy.DecisionContext(ctx, privacy.Allowf("cleanup {{ $node.Name | lower }} edge")) + + {{/* For each edge */}} + {{- range $edge := $node.Edges }} + {{/* if the edge has our custom annotation applied */}} + {{- if $annotation := $edge.Annotations.ENT_CASCADE }} + {{/* use the client to delete records where the edge schema has a field (provided by the annotation) containing the ID provided by the func */}} + {{/* special case for child fields */}} + {{- if eq $annotation.Field "Child" }} + if exists, err := FromContext(ctx).{{ $edge.Type.Name }}.Query().Where({{ $edge.Type.Name | lower }}.HasParentWith({{ $edge.Type.Name | lower }}.ID(id))).Exist(ctx); err == nil && exists { + if organizationCount, err := FromContext(ctx).{{ $edge.Type.Name }}.Delete().Where({{ $edge.Type.Name | lower }}.HasParentWith({{ $edge.Type.Name | lower }}.ID(id))).Exec(ctx); err != nil { + FromContext(ctx).Logger.Debugw("deleting child {{ $edge.Type.Name | lower }}", "count", {{ $edge.Type.Name | lower }}Count, "err", err) + return err + } + } + {{- else }} + if exists, err := FromContext(ctx).{{ $edge.Type.Name }}.Query().Where(({{ $edge.Type.Name | lower }}.Has{{ $annotation.Field }}With({{ $node.Name | lower }}.ID(id)))).Exist(ctx); err == nil && exists { + if {{ $edge.Type.Name | lower }}Count, err := FromContext(ctx).{{ $edge.Type.Name }}.Delete().Where({{ $edge.Type.Name | lower }}.Has{{ $annotation.Field }}With({{ $node.Name | lower }}.ID(id))).Exec(ctx); err != nil { + FromContext(ctx).Logger.Debugw("deleting {{ $edge.Type.Name | lower }}", "count", {{ $edge.Type.Name | lower }}Count, "err", err) + return err + } + } + {{ end }} + {{ end }} + {{- end }} + {{- if $annotation := $node.Annotations.ENT_CASCADE_THROUGH }} + {{- range $schema := $annotation.Schemas }} + {{- $field := $schema.Through }} + {{/* use the client to delete records where the edge has a field and a through schema (provided by the annotation) containing the ID provided by the func */}} + if exists, err := FromContext(ctx).{{ $field }}.Query().Where(({{ $field | lower }}.Has{{ $schema.Field }}With({{ $node.Name | lower }}.ID(id)))).Exist(ctx); err == nil && exists { + if {{ $field | lower }}Count, err := FromContext(ctx).{{ $field }}.Delete().Where({{ $field | lower }}.Has{{ $schema.Field }}With({{ $node.Name | lower }}.ID(id))).Exec(ctx); err != nil { + FromContext(ctx).Logger.Debugw("deleting {{ $field | lower }}", "count", {{ $field | lower }}Count, "err", err) + return err + } + } + {{ end }} + {{ end }} + return nil + } + {{ end }} +{{ end }} + diff --git a/internal/ent/validator/contact.go b/internal/ent/validator/contact.go new file mode 100644 index 0000000..cc3e32d --- /dev/null +++ b/internal/ent/validator/contact.go @@ -0,0 +1,28 @@ +package validator + +import ( + "github.com/nyaruka/phonenumbers" +) + +// ValidatePhoneNumber validates a phone number using the phone numbers library +// this is light validation as it just need to be valid in _any_ region to be considered valid +func ValidatePhoneNumber(phoneNumber string) bool { + if phoneNumber == "" { + return true + } + + // get all the valid regions supported by the library + validRegions := phonenumbers.GetSupportedRegions() + + for r := range validRegions { + num, err := phonenumbers.Parse(phoneNumber, r) + if err == nil { + // attempt to validate the number in the region + if phonenumbers.IsValidNumber(num) { + return true + } + } + } + + return false +} diff --git a/internal/ent/validator/contact_test.go b/internal/ent/validator/contact_test.go new file mode 100644 index 0000000..519034b --- /dev/null +++ b/internal/ent/validator/contact_test.go @@ -0,0 +1,45 @@ +package validator_test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/theopenlane/core/internal/ent/validator" +) + +func TestValidatePhoneNumber(t *testing.T) { + // Valid phone numbers + validNumbers := []string{ + "+44 123 456 7890", + "+1 (303) 456-7890", + "+1-717-456-7890", + "123-456-7890", + "123.456.7890", + "(123) 456-7890", + } + + for _, number := range validNumbers { + t.Run(fmt.Sprintf("valid phone number: %s", number), func(t *testing.T) { + valid := validator.ValidatePhoneNumber(number) + assert.True(t, valid) + }) + } + + // Invalid phone numbers + invalidNumbers := []string{ + "123", // invalid number + "abc", // invalid string + "+", // invalid string + "+15558675309", // not a valid US number + "555-867+5309", // invalid format + } + + for _, number := range invalidNumbers { + t.Run(fmt.Sprintf("invalid phone number: %s", number), func(t *testing.T) { + valid := validator.ValidatePhoneNumber(number) + assert.False(t, valid) + }) + } +} diff --git a/internal/ent/validator/domain.go b/internal/ent/validator/domain.go new file mode 100644 index 0000000..6be3c93 --- /dev/null +++ b/internal/ent/validator/domain.go @@ -0,0 +1,59 @@ +package validator + +import ( + "net/url" + "regexp" + "slices" + + "github.com/theopenlane/utils/rout" +) + +var ( + validSchemes = []string{"http", "https"} + urlMaxLen = 255 + domainRegexp = regexp.MustCompile(`^(?i)[a-z0-9-]+(\.[a-z0-9-]+)+\.?$`) +) + +// ValidateDomains validates a list of domains and returns an error if any of them are invalid +func ValidateDomains() func(domains []string) error { + return func(domains []string) error { + for _, domain := range domains { + // ensure the domain is not too long + if len(domain) > urlMaxLen || len(domain) == 0 { + return rout.InvalidField("domains") + } + + // parse the domain + u, err := url.Parse(domain) + if err != nil { + return rout.InvalidField("domains") + } + + // if the scheme is empty, add http:// to the domain and try again + if u.Scheme == "" { + u, err = url.Parse("http://" + domain) + if err != nil { + return rout.InvalidField("domains") + } + } + + // ensure the host is not empty + if u.Host == "" { + return rout.InvalidField("domains") + } + + // only allow http and https schemes + if u.Scheme != "" && !slices.Contains(validSchemes, u.Scheme) { + return rout.InvalidField("domains") + } + + // ensure the host is a valid domain + valid := domainRegexp.MatchString(u.Host) + if !valid { + return rout.InvalidField("domains") + } + } + + return nil + } +} diff --git a/internal/ent/validator/domain_test.go b/internal/ent/validator/domain_test.go new file mode 100644 index 0000000..d3c8b0c --- /dev/null +++ b/internal/ent/validator/domain_test.go @@ -0,0 +1,46 @@ +package validator_test + +import ( + "fmt" + "testing" + + "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/assert" + + "github.com/theopenlane/core/internal/ent/validator" +) + +func TestValidateDomains(t *testing.T) { + validDomains := []string{ + "example.com", + "sub.example.com", + "sub.sub.example.com", + "https://example.com", + "http://example.com", + "http://example.com/hello", + } + + for _, d := range validDomains { + t.Run(fmt.Sprintf("valid domain: %s", d), func(t *testing.T) { + funcCheck := validator.ValidateDomains() + err := funcCheck([]string{d}) + assert.Empty(t, err) + }) + } + + longDomain := gofakeit.LetterN(256) + ".com" + + invalidDomains := []string{ + "example", + "example.", + longDomain, + } + + for _, d := range invalidDomains { + t.Run(fmt.Sprintf("invalid domain: %s", d), func(t *testing.T) { + funcCheck := validator.ValidateDomains() + err := funcCheck([]string{d}) + assert.NotEmpty(t, err) + }) + } +} diff --git a/internal/entdb/client.go b/internal/entdb/client.go new file mode 100644 index 0000000..c610363 --- /dev/null +++ b/internal/entdb/client.go @@ -0,0 +1,285 @@ +package entdb + +import ( + "context" + "database/sql" + "fmt" + "os" + "strconv" + "time" + + "ariga.io/entcache" + "entgo.io/ent/dialect" + entsql "entgo.io/ent/dialect/sql" + "github.com/pressly/goose/v3" + "github.com/theopenlane/entx" + + "go.uber.org/zap" + + migratedb "github.com/theopenlane/core/db" + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/interceptors" + "github.com/theopenlane/core/pkg/testutils" +) + +const ( + // defaultDBTestImage is the default docker image to use for testing + defaultDBTestImage = "docker://postgres:16-alpine" +) + +type client struct { + // config is the entdb configuration + config *entx.Config + // pc is the primary ent client + pc *ent.Client + // sc is the secondary ent client + sc *ent.Client + // logger holds the zap logger + logger *zap.SugaredLogger +} + +// NewMultiDriverDBClient returns a ent client with a primary and secondary, if configured, write database +func NewMultiDriverDBClient(ctx context.Context, c entx.Config, l *zap.SugaredLogger, opts []ent.Option) (*ent.Client, *entx.EntClientConfig, error) { + client := &client{ + config: &c, + logger: l, + } + + dbOpts := []entx.DBOption{ + entx.WithLogger(l), + } + + if c.MultiWrite { + dbOpts = append(dbOpts, entx.WithSecondaryDB()) + } + + entConfig, err := entx.NewDBConfig(c, dbOpts...) + if err != nil { + return nil, nil, err + } + + // Decorates the sql.Driver with entcache.Driver on the primaryDB + drvPrimary := entcache.NewDriver( + entConfig.GetPrimaryDB(), + entcache.TTL(c.CacheTTL), // set the TTL on the cache + entcache.ContextLevel(), + ) + + client.pc = client.createEntDBClient(entConfig.GetPrimaryDB()) + + if c.RunMigrations { + if err := client.runMigrations(ctx); err != nil { + client.logger.Errorf("failed running migrations", zap.Error(err)) + + return nil, nil, err + } + } + + var cOpts []ent.Option + + if c.MultiWrite { + // Decorates the sql.Driver with entcache.Driver on the primaryDB + drvSecondary := entcache.NewDriver( + entConfig.GetSecondaryDB(), + entcache.TTL(c.CacheTTL), // set the TTL on the cache + entcache.ContextLevel(), + ) + + client.sc = client.createEntDBClient(entConfig.GetSecondaryDB()) + + if c.RunMigrations { + if err := client.runMigrations(ctx); err != nil { + client.logger.Errorf("failed running migrations", zap.Error(err)) + + return nil, nil, err + } + } + + // Create Multiwrite driver + cOpts = []ent.Option{ent.Driver(&entx.MultiWriteDriver{Wp: drvPrimary, Ws: drvSecondary})} + } else { + cOpts = []ent.Option{ent.Driver(drvPrimary)} + } + + cOpts = append(cOpts, opts...) + + if c.Debug { + cOpts = append(cOpts, + ent.Log(client.logger.Named("ent").Debugln), + ent.Debug(), + ent.Driver(drvPrimary), + ) + } + + ec := ent.NewClient(cOpts...) + + // add authz hooks + ec.WithAuthz() + + if c.EnableHistory { + // add history hooks + ec.WithHistory() + } + + ec.Intercept(interceptors.QueryLogger(client.logger)) + + return ec, entConfig, nil +} + +// runMigrations runs the migrations based on the configured migration provider on startup +func (c *client) runMigrations(ctx context.Context) error { + switch c.config.MigrationProvider { + case "goose": + return c.runGooseMigrations() + default: // atlas + return c.runAtlasMigrations(ctx) + } +} + +// runGooseMigrations runs the goose migrations +func (c *client) runGooseMigrations() error { + driver, err := entx.CheckEntDialect(c.config.DriverName) + if err != nil { + return err + } + + drv, err := sql.Open(c.config.DriverName, c.config.PrimaryDBSource) + if err != nil { + return err + } + defer drv.Close() + + migrations := migratedb.GooseMigrationsPG + if driver == dialect.SQLite { + migrations = migratedb.GooseMigrationsSQLite + + if _, err := drv.Exec("PRAGMA foreign_keys = off;", nil); err != nil { + drv.Close() + + return fmt.Errorf("failed to disable foreign keys: %w", err) + } + } + + goose.SetBaseFS(migrations) + + if err := goose.SetDialect(driver); err != nil { + return err + } + + migrationsDir := "migrations-goose-postgres" + if driver == dialect.SQLite { + migrationsDir = "migrations-goose-sqlite" + } + + if err := goose.Up(drv, migrationsDir); err != nil { + return err + } + + if driver == dialect.SQLite { + if _, err := drv.Exec("PRAGMA foreign_keys = on;", nil); err != nil { + drv.Close() + + return fmt.Errorf("failed to enable foreign keys: %w", err) + } + } + + return nil +} + +// runAtlasMigrations runs the atlas auto-migrations +// this do not use the generated versioned migrations files from ent +func (c *client) runAtlasMigrations(ctx context.Context) error { + // Run the automatic migration tool to create all schema resources. + // entcache.Driver will skip the caching layer when running the schema migration + if err := c.pc.Schema.Create(entcache.Skip(ctx)); err != nil { + c.logger.Errorf("failed creating schema resources", zap.Error(err)) + + return err + } + + return nil +} + +// createEntDBClient creates a new ent client with configured options +func (c *client) createEntDBClient(db *entsql.Driver) *ent.Client { + cOpts := []ent.Option{ent.Driver(db)} + + if c.config.Debug { + cOpts = append(cOpts, + ent.Log(c.logger.Named("ent").Debugln), + ent.Debug(), + ) + } + + return ent.NewClient(cOpts...) +} + +// NewTestFixture creates a test container for testing purposes +func NewTestFixture() *testutils.TestFixture { + // Grab the DB environment variable or use the default + testDBURI := os.Getenv("TEST_DB_URL") + testDBContainerExpiry := os.Getenv("TEST_DB_CONTAINER_EXPIRY") + + // If the DB URI is not set, use the default docker image + if testDBURI == "" { + testDBURI = defaultDBTestImage + } + + if testDBContainerExpiry == "" { + testDBContainerExpiry = "5" // default expiry of 5 minutes + } + + expiry, err := strconv.Atoi(testDBContainerExpiry) + if err != nil { + panic(fmt.Sprintf("failed to convert TEST_DB_CONTAINER_EXPIRY to int: %v", err)) + } + + return testutils.GetTestURI(testDBURI, expiry) +} + +// NewTestClient creates a entdb client that can be used for TEST purposes ONLY +func NewTestClient(ctx context.Context, ctr *testutils.TestFixture, entOpts []ent.Option) (*ent.Client, error) { + // setup logger + logger := zap.NewNop().Sugar() + + dbconf := entx.Config{ + Debug: true, + DriverName: ctr.Dialect, + PrimaryDBSource: ctr.URI, + EnableHistory: true, // enable history so the code path is checked during unit tests + CacheTTL: 0 * time.Second, // do not cache results in tests + } + + entOpts = append(entOpts, ent.Logger(*logger)) + + var db *ent.Client + + // Retry the connection to the database to ensure it is up and running + var err error + + // If a test container is used, retry the connection to the database to ensure it is up and running + if ctr.Pool != nil { + err = ctr.Pool.Retry(func() error { + fmt.Println("connecting to database...") + + db, _, err = NewMultiDriverDBClient(ctx, dbconf, logger, entOpts) + if err != nil { + fmt.Printf("retrying connection to database: %v", err) + } + + return err + }) + } else { + db, _, err = NewMultiDriverDBClient(ctx, dbconf, logger, entOpts) + } + + if err != nil { + return nil, err + } + + if err := db.Schema.Create(ctx); err != nil { + return nil, err + } + + return db, nil +} diff --git a/internal/entdb/doc.go b/internal/entdb/doc.go new file mode 100644 index 0000000..f1eb0f1 --- /dev/null +++ b/internal/entdb/doc.go @@ -0,0 +1,2 @@ +// Package entdb extends the ent db library and satisfies matt's needs for consistency +package entdb diff --git a/internal/graphapi/analytics.go b/internal/graphapi/analytics.go new file mode 100644 index 0000000..a0c8e33 --- /dev/null +++ b/internal/graphapi/analytics.go @@ -0,0 +1,220 @@ +package graphapi + +import ( + "context" + "encoding/json" + "fmt" + "strings" + + ph "github.com/posthog/posthog-go" + "github.com/theopenlane/utils/slack" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/integration" + "github.com/theopenlane/core/internal/ent/generated/webhook" + "github.com/theopenlane/core/pkg/events/soiree" +) + +// CreateEvent creates an event for the mutation with the properties +func CreateEvent(ctx context.Context, c *ent.Client, m ent.Mutation, v ent.Value) { + pool := soiree.NewPondPool(100, 1000) + e := soiree.NewEventPool(soiree.WithPool(pool)) + + out, err := parseValue(v) + if err != nil { + return + } + + obj := strings.ToLower(m.Type()) + action := getOp(m) + + // debug log the event + c.Logger.Debugw("tracking event", "object", obj, "action", action) + + event := fmt.Sprintf("%s.%sd", obj, action) + e.EnsureTopic(event) + + id, ok := out["id"] + if !ok { + // keep going + return + } + + i, ok := id.(string) + if !ok { + // keep going + return + } + + // Set properties for the event + // all events will have the id + props := ph.NewProperties(). + Set(fmt.Sprintf("%s_id", obj), i) + + payload := map[string]string{"key": "value"} + sEvent := soiree.NewBaseEvent(event, payload) + + // set the name if it exists + name, ok := out["name"] + if ok { + props.Set(fmt.Sprintf("%s_name", obj), name) + payload["name"] = name.(string) + } + + // set the first name if it exists + fName, ok := out["first_name"] + if ok { + props.Set("first_name", fName) + payload["first_name"] = fName.(string) + } + + // set the last name if it exists + lName, ok := out["last_name"] + if ok { + props.Set("last_name", lName) + payload["last_name"] = lName.(string) + } + + // set the email if it exists + email, ok := out["email"] + if ok { + props.Set("email", email) + payload["email"] = email.(string) + } + + authprovider, ok := out["auth_provider"] + if ok { + props.Set("auth_provider", authprovider) + payload["auth_provider"] = authprovider.(string) + } + + userCreatedListener := userCreatedListener(ctx, c, sEvent) + orgCreatedListener := orgCreatedListener(ctx, c, sEvent) + + _, err = e.On("user.created", userCreatedListener) + if err != nil { + return + } + + _, err = e.On("organization.created", orgCreatedListener) + if err != nil { + return + } + + e.Emit(event, payload) + + c.Analytics.Event(event, props) + + // debug log the event + c.Logger.Debugw("event tracked", "event", event, "props", props) +} + +// trackedEvent returns true if the mutation should be a tracked event +// for now, lets just track high level create and delete events +// TODO: make these configurable by integration +func TrackedEvent(m ent.Mutation) bool { + switch m.Type() { + case "User", "Organization", "Group", "Subscriber": + switch getOp(m) { + case ActionCreate, ActionDelete: + return true + } + return false + } + + return false +} + +// getOp returns the string action for the mutation +func getOp(m ent.Mutation) string { + switch m.Op() { + case ent.OpCreate: + return ActionCreate + case ent.OpUpdate, ent.OpUpdateOne: + return ActionUpdate + case ent.OpDelete, ent.OpDeleteOne: + return ActionDelete + default: + return "" + } +} + +// parseValue returns a map of the ent.Value +func parseValue(v ent.Value) (map[string]interface{}, error) { + out, err := json.Marshal(v) + if err != nil { + return nil, err + } + + var valMap map[string]interface{} + + if err := json.Unmarshal(out, &valMap); err != nil { + return nil, err + } + + return valMap, nil +} + +// userCreatedListener is a listener for the user created event +func userCreatedListener(ctx context.Context, c *ent.Client, sEvent *soiree.BaseEvent) func(evt soiree.Event) error { + return func(evt soiree.Event) error { + integrationWithWebhook, err := c.Integration.Query().WithWebhooks().Where( + integration.KindEQ("slack")).QueryWebhooks().Where( + webhook.EnabledEQ(true)).All(ctx) + if err != nil { + return err + } + + for _, w := range integrationWithWebhook { + retrieve := sEvent.Payload().(map[string]string) + + payload := slack.Payload{ + Text: fmt.Sprintf("A user with the following details has been created:\nName: %s\nFirst Name: %s\nLast Name: %s\nEmail: %s\nAuth Provider: %s", + retrieve["name"], + retrieve["first_name"], + retrieve["last_name"], + retrieve["email"], + retrieve["auth_provider"]), + } + + slackMessage := slack.New(w.DestinationURL) + if err := slackMessage.Post(context.Background(), &payload); err != nil { + return err + } + + } + return nil + } +} + +// orgCreatedListener is a listener for the organization created event +func orgCreatedListener(ctx context.Context, c *ent.Client, sEvent *soiree.BaseEvent) func(evt soiree.Event) error { + return func(evt soiree.Event) error { + integrationWithWebhook, err := c.Integration.Query().WithWebhooks().Where( + integration.KindEQ("slack")).QueryWebhooks().Where( + webhook.EnabledEQ(true)).All(ctx) + if err != nil { + return err + } + + for _, w := range integrationWithWebhook { + retrieve := sEvent.Payload().(map[string]string) + + payload := slack.Payload{ + Text: fmt.Sprintf("A user with the following details has been created:\nName: %s\nFirst Name: %s\nLast Name: %s\nEmail: %s\nAuth Provider: %s", + retrieve["name"], + retrieve["first_name"], + retrieve["last_name"], + retrieve["email"], + retrieve["auth_provider"]), + } + + slackMessage := slack.New(w.DestinationURL) + if err := slackMessage.Post(context.Background(), &payload); err != nil { + return err + } + + } + return nil + } +} diff --git a/internal/graphapi/analytics_test.go b/internal/graphapi/analytics_test.go new file mode 100644 index 0000000..4de34b4 --- /dev/null +++ b/internal/graphapi/analytics_test.go @@ -0,0 +1,114 @@ +package graphapi_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/graphapi" +) + +func (suite *GraphTestSuite) TestTrackedEvent() { + t := suite.T() + + testCases := []struct { + mutation ent.Mutation + expected bool + }{ + { + mutation: suite.client.db.User.Create().Mutation(), + expected: true, + }, + { + mutation: suite.client.db.Organization.Create().Mutation(), + expected: true, + }, + { + mutation: suite.client.db.User.Update().Mutation(), + expected: false, + }, + { + mutation: suite.client.db.EmailVerificationToken.Create().Mutation(), + expected: false, + }, + } + + for _, tc := range testCases { + actual := graphapi.TrackedEvent(tc.mutation) + + assert.Equal(t, tc.expected, actual) + } +} + +func (suite *GraphTestSuite) TestCreateEvent() { + t := suite.T() + + reqCtx, err := userContext() + require.NoError(t, err) + + testCases := []struct { + name string + mutation ent.Mutation + v ent.Value + expectedEvent string + expectedProps map[string]interface{} + }{ + { + name: "user create event", + mutation: suite.client.db.User.Create().Mutation(), + v: ent.User{ + ID: "123", + FirstName: "Jack", + LastName: "Pearson", + Email: "jpearson@us.com", + }, + expectedEvent: "user.created", + expectedProps: map[string]interface{}{ + "email": "jpearson@us.com", + "first_name": "Jack", + "last_name": "Pearson", + "user_id": "123", + }, + }, + { + name: "org create event", + mutation: suite.client.db.Organization.Create().Mutation(), + v: ent.Organization{ + ID: "123", + Name: "Meow", + }, + expectedEvent: "organization.created", + expectedProps: map[string]interface{}{ + "organization_name": "Meow", + "organization_id": "123", + }, + }, + { + name: "missing id, no logs", + mutation: suite.client.db.User.Update().Mutation(), + v: ent.User{ + FirstName: "Jack", + LastName: "Pearson", + Email: "jpearson@us.com", + }, + expectedEvent: "", + expectedProps: map[string]interface{}{}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + out := suite.captureOutput(func() { + graphapi.CreateEvent(reqCtx, suite.client.db, tc.mutation, tc.v) + }) + + assert.Contains(t, out, tc.expectedEvent) + for k, v := range tc.expectedProps { + assert.Contains(t, out, k) + assert.Contains(t, out, v) + } + }) + } +} diff --git a/internal/graphapi/apitoken.resolvers.go b/internal/graphapi/apitoken.resolvers.go new file mode 100644 index 0000000..3fa0b57 --- /dev/null +++ b/internal/graphapi/apitoken.resolvers.go @@ -0,0 +1,134 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + "errors" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/utils/rout" +) + +// CreateAPIToken is the resolver for the createAPIToken field. +func (r *mutationResolver) CreateAPIToken(ctx context.Context, input generated.CreateAPITokenInput) (*APITokenCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + apiToken, err := withTransactionalMutation(ctx).APIToken.Create().SetInput(input).Save(ctx) + if err != nil { + r.logger.Errorw("failed to create api token", "error", err) + + return nil, err + } + + return &APITokenCreatePayload{APIToken: apiToken}, err +} + +// CreateBulkAPIToken is the resolver for the createBulkAPIToken field. +func (r *mutationResolver) CreateBulkAPIToken(ctx context.Context, input []*generated.CreateAPITokenInput) (*APITokenBulkCreatePayload, error) { + return r.bulkCreateAPIToken(ctx, input) +} + +// CreateBulkCSVAPIToken is the resolver for the createBulkCSVAPIToken field. +func (r *mutationResolver) CreateBulkCSVAPIToken(ctx context.Context, input graphql.Upload) (*APITokenBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateAPITokenInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateAPIToken(ctx, data) +} + +// UpdateAPIToken is the resolver for the updateAPIToken field. +func (r *mutationResolver) UpdateAPIToken(ctx context.Context, id string, input generated.UpdateAPITokenInput) (*APITokenUpdatePayload, error) { + apiToken, err := withTransactionalMutation(ctx).APIToken.Get(ctx, id) + if err != nil { + if generated.IsNotFound(err) { + return nil, err + } + + if errors.Is(err, privacy.Deny) { + return nil, ErrPermissionDenied + } + + r.logger.Errorw("failed to get api token", "error", err) + return nil, ErrInternalServerError + } + + if err := setOrganizationInAuthContext(ctx, &apiToken.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + apiToken, err = apiToken.Update().SetInput(input).Save(ctx) + if err != nil { + if generated.IsValidationError(err) { + return nil, err + } + + if generated.IsConstraintError(err) { + return nil, err + } + + r.logger.Errorw("failed to update api token", "error", err) + + return nil, ErrInternalServerError + } + + return &APITokenUpdatePayload{APIToken: apiToken}, err +} + +// DeleteAPIToken is the resolver for the deleteAPIToken field. +func (r *mutationResolver) DeleteAPIToken(ctx context.Context, id string) (*APITokenDeletePayload, error) { + if err := withTransactionalMutation(ctx).APIToken.DeleteOneID(id).Exec(ctx); err != nil { + if generated.IsNotFound(err) { + return nil, err + } + + if errors.Is(err, privacy.Deny) { + return nil, ErrPermissionDenied + } + + r.logger.Errorw("failed to delete api token", "error", err) + return nil, err + } + + if err := generated.APITokenEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &APITokenDeletePayload{DeletedID: id}, nil +} + +// APIToken is the resolver for the apiToken field. +func (r *queryResolver) APIToken(ctx context.Context, id string) (*generated.APIToken, error) { + apiToken, err := withTransactionalMutation(ctx).APIToken.Get(ctx, id) + if err != nil { + if generated.IsNotFound(err) { + return nil, err + } + + r.logger.Errorw("failed to get api token", "error", err) + + return nil, ErrInternalServerError + } + + return apiToken, nil +} + +// Mutation returns MutationResolver implementation. +func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} } + +type mutationResolver struct{ *Resolver } diff --git a/internal/graphapi/apitoken_test.go b/internal/graphapi/apitoken_test.go new file mode 100644 index 0000000..cc8822a --- /dev/null +++ b/internal/graphapi/apitoken_test.go @@ -0,0 +1,408 @@ +package graphapi_test + +import ( + "context" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/openlaneclient" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/pkg/testutils" +) + +func (suite *GraphTestSuite) TestQueryApiToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + apiToken := (&APITokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + errorMsg string + }{ + { + name: "happy path", + queryID: apiToken.ID, + }, + { + name: "not found", + queryID: "notfound", + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := suite.client.api.GetAPITokenByID(reqCtx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.APIToken) + assert.Equal(t, redacted, resp.APIToken.Token) + assert.Equal(t, testOrgID, resp.APIToken.Owner.ID) + }) + } +} + +func (suite *GraphTestSuite) TestQueryAPITokens() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + (&APITokenBuilder{client: suite.client}).MustNew(reqCtx, t) + (&APITokenBuilder{client: suite.client, Scopes: []string{"read", "write"}}).MustNew(reqCtx, t) + + testCases := []struct { + name string + errorMsg string + }{ + { + name: "happy path, all api tokens", + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := suite.client.api.GetAllAPITokens(reqCtx) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + // this is three because we create two tokens in the test + // and there is one created in the suite setup + assert.Len(t, resp.APITokens.Edges, 3) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateAPIToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + tokenDescription := gofakeit.Sentence(5) + expiration30Days := time.Now().Add(time.Hour * 24 * 30) + + testCases := []struct { + name string + input openlaneclient.CreateAPITokenInput + errorMsg string + }{ + { + name: "happy path", + input: openlaneclient.CreateAPITokenInput{ + Name: "forthethingz", + Description: &tokenDescription, + Scopes: []string{"read", "write"}, + }, + }, + { + name: "happy path, set expire", + input: openlaneclient.CreateAPITokenInput{ + Name: "forthethingz", + Description: &tokenDescription, + ExpiresAt: &expiration30Days, + }, + }, + { + name: "happy path, set org", + input: openlaneclient.CreateAPITokenInput{ + Name: "forthethingz", + Description: &tokenDescription, + ExpiresAt: &expiration30Days, + }, + }, + { + name: "happy path, name only", + input: openlaneclient.CreateAPITokenInput{ + Name: "forthethingz", + }, + }, + { + name: "empty name", + input: openlaneclient.CreateAPITokenInput{ + Description: &tokenDescription, + }, + errorMsg: "value is less than the required length", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, true) + + if tc.errorMsg == "" && len(tc.input.Scopes) > 0 { + // mock a call write relationship tuples + mock_fga.WriteOnce(t, suite.client.fga) + } + + resp, err := suite.client.api.CreateAPIToken(reqCtx, tc.input) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreateAPIToken.APIToken) + + assert.Equal(t, tc.input.Name, resp.CreateAPIToken.APIToken.Name) + assert.Equal(t, tc.input.Description, resp.CreateAPIToken.APIToken.Description) + assert.Equal(t, tc.input.Scopes, resp.CreateAPIToken.APIToken.Scopes) + + // check expiration if set + if tc.input.ExpiresAt == nil { + assert.Empty(t, resp.CreateAPIToken.APIToken.ExpiresAt) + } else { + assert.True(t, tc.input.ExpiresAt.Equal(*resp.CreateAPIToken.APIToken.ExpiresAt)) + } + + // ensure the owner is the org set in the request + assert.Equal(t, testOrgID, resp.CreateAPIToken.APIToken.Owner.ID) + + // token should not be redacted on create + assert.NotEqual(t, redacted, resp.CreateAPIToken.APIToken.Token) + + // ensure the token is prefixed + assert.Contains(t, resp.CreateAPIToken.APIToken.Token, "dtma_") + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateAPIToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + token := (&APITokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + tokenDescription := gofakeit.Sentence(5) + tokenName := gofakeit.Word() + + testCases := []struct { + name string + tokenID string + input openlaneclient.UpdateAPITokenInput + errorMsg string + }{ + { + name: "happy path, update name ", + tokenID: token.ID, + input: openlaneclient.UpdateAPITokenInput{ + Name: &tokenName, + }, + }, + { + name: "happy path, update description", + tokenID: token.ID, + input: openlaneclient.UpdateAPITokenInput{ + Description: &tokenDescription, + }, + }, + { + name: "happy path, add scope", + tokenID: token.ID, + input: openlaneclient.UpdateAPITokenInput{ + Scopes: []string{"write"}, + }, + }, + { + name: "invalid token id", + tokenID: "notvalidtoken", + input: openlaneclient.UpdateAPITokenInput{ + Description: &tokenDescription, + }, + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + if len(tc.input.Scopes) > 0 { + mock_fga.WriteAny(t, suite.client.fga) + } + + resp, err := suite.client.api.UpdateAPIToken(reqCtx, tc.tokenID, tc.input) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateAPIToken.APIToken) + + if tc.input.Name != nil { + assert.Equal(t, resp.UpdateAPIToken.APIToken.Name, *tc.input.Name) + } + + if tc.input.Description != nil { + assert.Equal(t, resp.UpdateAPIToken.APIToken.Description, tc.input.Description) + } + + // Ensure its added + if tc.input.Scopes != nil { + assert.Len(t, resp.UpdateAPIToken.APIToken.Scopes, 1) + } + + assert.Equal(t, testOrgID, resp.UpdateAPIToken.APIToken.Owner.ID) + + // token should be redacted on update + assert.Equal(t, redacted, resp.UpdateAPIToken.APIToken.Token) + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteAPIToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // create user to make tokens + user := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + user2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + orgID := user.Edges.Setting.Edges.DefaultOrg.ID + orgID2 := user2.Edges.Setting.Edges.DefaultOrg.ID + + reqCtx, err = auth.NewTestContextWithOrgID(user.ID, orgID) + require.NoError(t, err) + + token := (&APITokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx2, err := auth.NewTestContextWithOrgID(user2.ID, orgID2) + require.NoError(t, err) + + token2 := (&APITokenBuilder{client: suite.client}).MustNew(reqCtx2, t) + + testCases := []struct { + name string + tokenID string + errorMsg string + allowed bool + }{ + { + name: "happy path, delete token", + tokenID: token.ID, + allowed: true, + }, + { + name: "delete someone else's token, no go", + tokenID: token2.ID, + errorMsg: "not authorized", + allowed: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := suite.client.api.DeleteAPIToken(reqCtx, tc.tokenID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, tc.tokenID, resp.DeleteAPIToken.DeletedID) + }) + } +} + +func (suite *GraphTestSuite) TestLastUsedAPIToken() { + t := suite.T() + + defer mock_fga.ClearMocks(suite.client.fga) + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // create new API token + token := (&APITokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + mock_fga.CheckAny(t, suite.client.fga, true) + + // check that the last used is empty + res, err := suite.client.api.GetAPITokenByID(reqCtx, token.ID) + require.NoError(t, err) + assert.Empty(t, res.APIToken.LastUsedAt) + + // setup graph client using the API token + authHeader := openlaneclient.Authorization{ + BearerToken: token.Token, + } + + graphClient, err := testutils.TestClientWithAuth(t, suite.client.db, openlaneclient.WithCredentials(authHeader)) + require.NoError(t, err) + + // get the token to make sure the last used is updated using the token + out, err := graphClient.GetAPITokenByID(context.Background(), token.ID) + require.NoError(t, err) + assert.NotEmpty(t, out.APIToken.LastUsedAt) +} diff --git a/internal/graphapi/audit.resolvers.go b/internal/graphapi/audit.resolvers.go new file mode 100644 index 0000000..148ff91 --- /dev/null +++ b/internal/graphapi/audit.resolvers.go @@ -0,0 +1,110 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + "strings" + "time" + + "entgo.io/contrib/entgql" +) + +// AuditLogs is the resolver for the auditLogs field. +func (r *queryResolver) AuditLogs(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *AuditLogWhereInput) (*AuditLogConnection, error) { + var ( + auditLogs [][]string + err error + ) + + if where.Table != nil { + auditLogs, err = withTransactionalMutation(ctx).AuditWithFilter(ctx, *where.Table) + if err != nil { + return nil, err + } + } else { + auditLogs, err = withTransactionalMutation(ctx).Audit(ctx) + if err != nil { + return nil, err + } + } + + count := len(auditLogs) - 1 + + logs := &AuditLogConnection{ + Edges: []*AuditLogEdge{}, + TotalCount: count, + } + + for i, auditLog := range auditLogs { + // skip the header + if i == 0 { + continue + } + + // Response format: + // Table RefId HistoryTime Operation Changes UpdatedBy + // [0] [1] [2] [3] [4] [5] + tableName := strings.TrimSuffix(auditLog[0], "History") + objectID := auditLog[1] + + // Thu Jul 18 17:30:19 2024 + ts, err := time.Parse("Mon Jan 02 15:04:05 2006", auditLog[2]) + if err != nil { + return nil, err + } + + op := auditLog[3] + changes := strings.Split(auditLog[4], "\n") + updatedBy := auditLog[5] + + // filter the response back + if where != nil { + // filter by operation + if where.Operation != nil && !strings.EqualFold(*where.Operation, op) { + continue + } + + // filter by updated by + if where.UpdatedBy != nil && *where.UpdatedBy != updatedBy { + continue + } + + // filter by object ID + if where.RefID != nil && *where.RefID != objectID { + continue + } + + // filter by time + if where.After != nil { + after := *where.After + if !after.Before(ts) { + continue + } + } + + if where.Before != nil { + if !where.Before.After(ts) { + continue + } + } + } + + edge := AuditLogEdge{ + Node: &AuditLog{ + Table: &tableName, + ID: objectID, + Time: &ts, + Operation: &op, + Changes: changes, + UpdatedBy: &updatedBy, + }, + } + + logs.Edges = append(logs.Edges, &edge) + } + + return logs, nil +} diff --git a/internal/graphapi/bulk.go b/internal/graphapi/bulk.go new file mode 100644 index 0000000..f1850a4 --- /dev/null +++ b/internal/graphapi/bulk.go @@ -0,0 +1,522 @@ +package graphapi + +// THIS CODE IS REGENERATED BY github.com/theopenlane/core/pkg/gqlplugin. DO NOT EDIT. + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated" +) + +// bulkCreateAPIToken uses the CreateBulk function to create multiple APIToken entities +func (r *mutationResolver) bulkCreateAPIToken(ctx context.Context, input []*generated.CreateAPITokenInput) (*APITokenBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.APITokenCreate, len(input)) + for i, data := range input { + builders[i] = c.APIToken.Create().SetInput(*data) + } + + res, err := c.APIToken.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "apitoken"}, r.logger) + } + + // return response + return &APITokenBulkCreatePayload{ + APITokens: res, + }, nil +} + +// bulkCreateContact uses the CreateBulk function to create multiple Contact entities +func (r *mutationResolver) bulkCreateContact(ctx context.Context, input []*generated.CreateContactInput) (*ContactBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.ContactCreate, len(input)) + for i, data := range input { + builders[i] = c.Contact.Create().SetInput(*data) + } + + res, err := c.Contact.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "contact"}, r.logger) + } + + // return response + return &ContactBulkCreatePayload{ + Contacts: res, + }, nil +} + +// bulkCreateDocumentData uses the CreateBulk function to create multiple DocumentData entities +func (r *mutationResolver) bulkCreateDocumentData(ctx context.Context, input []*generated.CreateDocumentDataInput) (*DocumentDataBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.DocumentDataCreate, len(input)) + for i, data := range input { + builders[i] = c.DocumentData.Create().SetInput(*data) + } + + res, err := c.DocumentData.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "documentdata"}, r.logger) + } + + // return response + return &DocumentDataBulkCreatePayload{ + DocumentData: res, + }, nil +} + +// bulkCreateEntitlement uses the CreateBulk function to create multiple Entitlement entities +func (r *mutationResolver) bulkCreateEntitlement(ctx context.Context, input []*generated.CreateEntitlementInput) (*EntitlementBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.EntitlementCreate, len(input)) + for i, data := range input { + builders[i] = c.Entitlement.Create().SetInput(*data) + } + + res, err := c.Entitlement.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitlement"}, r.logger) + } + + // return response + return &EntitlementBulkCreatePayload{ + Entitlements: res, + }, nil +} + +// bulkCreateEntitlementPlan uses the CreateBulk function to create multiple EntitlementPlan entities +func (r *mutationResolver) bulkCreateEntitlementPlan(ctx context.Context, input []*generated.CreateEntitlementPlanInput) (*EntitlementPlanBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.EntitlementPlanCreate, len(input)) + for i, data := range input { + builders[i] = c.EntitlementPlan.Create().SetInput(*data) + } + + res, err := c.EntitlementPlan.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitlementplan"}, r.logger) + } + + // return response + return &EntitlementPlanBulkCreatePayload{ + EntitlementPlans: res, + }, nil +} + +// bulkCreateEntitlementPlanFeature uses the CreateBulk function to create multiple EntitlementPlanFeature entities +func (r *mutationResolver) bulkCreateEntitlementPlanFeature(ctx context.Context, input []*generated.CreateEntitlementPlanFeatureInput) (*EntitlementPlanFeatureBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.EntitlementPlanFeatureCreate, len(input)) + for i, data := range input { + builders[i] = c.EntitlementPlanFeature.Create().SetInput(*data) + } + + res, err := c.EntitlementPlanFeature.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitlementplanfeature"}, r.logger) + } + + // return response + return &EntitlementPlanFeatureBulkCreatePayload{ + EntitlementPlanFeatures: res, + }, nil +} + +// bulkCreateEntity uses the CreateBulk function to create multiple Entity entities +func (r *mutationResolver) bulkCreateEntity(ctx context.Context, input []*generated.CreateEntityInput) (*EntityBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.EntityCreate, len(input)) + for i, data := range input { + builders[i] = c.Entity.Create().SetInput(*data) + } + + res, err := c.Entity.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entity"}, r.logger) + } + + // return response + return &EntityBulkCreatePayload{ + Entities: res, + }, nil +} + +// bulkCreateEntityType uses the CreateBulk function to create multiple EntityType entities +func (r *mutationResolver) bulkCreateEntityType(ctx context.Context, input []*generated.CreateEntityTypeInput) (*EntityTypeBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.EntityTypeCreate, len(input)) + for i, data := range input { + builders[i] = c.EntityType.Create().SetInput(*data) + } + + res, err := c.EntityType.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitytype"}, r.logger) + } + + // return response + return &EntityTypeBulkCreatePayload{ + EntityTypes: res, + }, nil +} + +// bulkCreateEvent uses the CreateBulk function to create multiple Event entities +func (r *mutationResolver) bulkCreateEvent(ctx context.Context, input []*generated.CreateEventInput) (*EventBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.EventCreate, len(input)) + for i, data := range input { + builders[i] = c.Event.Create().SetInput(*data) + } + + res, err := c.Event.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "event"}, r.logger) + } + + // return response + return &EventBulkCreatePayload{ + Events: res, + }, nil +} + +// bulkCreateFeature uses the CreateBulk function to create multiple Feature entities +func (r *mutationResolver) bulkCreateFeature(ctx context.Context, input []*generated.CreateFeatureInput) (*FeatureBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.FeatureCreate, len(input)) + for i, data := range input { + builders[i] = c.Feature.Create().SetInput(*data) + } + + res, err := c.Feature.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "feature"}, r.logger) + } + + // return response + return &FeatureBulkCreatePayload{ + Features: res, + }, nil +} + +// bulkCreateFile uses the CreateBulk function to create multiple File entities +func (r *mutationResolver) bulkCreateFile(ctx context.Context, input []*generated.CreateFileInput) (*FileBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.FileCreate, len(input)) + for i, data := range input { + builders[i] = c.File.Create().SetInput(*data) + } + + res, err := c.File.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "file"}, r.logger) + } + + // return response + return &FileBulkCreatePayload{ + Files: res, + }, nil +} + +// bulkCreateGroup uses the CreateBulk function to create multiple Group entities +func (r *mutationResolver) bulkCreateGroup(ctx context.Context, input []*generated.CreateGroupInput) (*GroupBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.GroupCreate, len(input)) + for i, data := range input { + builders[i] = c.Group.Create().SetInput(*data) + } + + res, err := c.Group.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "group"}, r.logger) + } + + // return response + return &GroupBulkCreatePayload{ + Groups: res, + }, nil +} + +// bulkCreateGroupMembership uses the CreateBulk function to create multiple GroupMembership entities +func (r *mutationResolver) bulkCreateGroupMembership(ctx context.Context, input []*generated.CreateGroupMembershipInput) (*GroupMembershipBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.GroupMembershipCreate, len(input)) + for i, data := range input { + builders[i] = c.GroupMembership.Create().SetInput(*data) + } + + res, err := c.GroupMembership.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "groupmembership"}, r.logger) + } + + // return response + return &GroupMembershipBulkCreatePayload{ + GroupMemberships: res, + }, nil +} + +// bulkCreateGroupSetting uses the CreateBulk function to create multiple GroupSetting entities +func (r *mutationResolver) bulkCreateGroupSetting(ctx context.Context, input []*generated.CreateGroupSettingInput) (*GroupSettingBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.GroupSettingCreate, len(input)) + for i, data := range input { + builders[i] = c.GroupSetting.Create().SetInput(*data) + } + + res, err := c.GroupSetting.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "groupsetting"}, r.logger) + } + + // return response + return &GroupSettingBulkCreatePayload{ + GroupSettings: res, + }, nil +} + +// bulkCreateHush uses the CreateBulk function to create multiple Hush entities +func (r *mutationResolver) bulkCreateHush(ctx context.Context, input []*generated.CreateHushInput) (*HushBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.HushCreate, len(input)) + for i, data := range input { + builders[i] = c.Hush.Create().SetInput(*data) + } + + res, err := c.Hush.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "hush"}, r.logger) + } + + // return response + return &HushBulkCreatePayload{ + Hushes: res, + }, nil +} + +// bulkCreateIntegration uses the CreateBulk function to create multiple Integration entities +func (r *mutationResolver) bulkCreateIntegration(ctx context.Context, input []*generated.CreateIntegrationInput) (*IntegrationBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.IntegrationCreate, len(input)) + for i, data := range input { + builders[i] = c.Integration.Create().SetInput(*data) + } + + res, err := c.Integration.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "integration"}, r.logger) + } + + // return response + return &IntegrationBulkCreatePayload{ + Integrations: res, + }, nil +} + +// bulkCreateInvite uses the CreateBulk function to create multiple Invite entities +func (r *mutationResolver) bulkCreateInvite(ctx context.Context, input []*generated.CreateInviteInput) (*InviteBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.InviteCreate, len(input)) + for i, data := range input { + builders[i] = c.Invite.Create().SetInput(*data) + } + + res, err := c.Invite.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "invite"}, r.logger) + } + + // return response + return &InviteBulkCreatePayload{ + Invites: res, + }, nil +} + +// bulkCreateOauthProvider uses the CreateBulk function to create multiple OauthProvider entities +func (r *mutationResolver) bulkCreateOauthProvider(ctx context.Context, input []*generated.CreateOauthProviderInput) (*OauthProviderBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.OauthProviderCreate, len(input)) + for i, data := range input { + builders[i] = c.OauthProvider.Create().SetInput(*data) + } + + res, err := c.OauthProvider.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "oauthprovider"}, r.logger) + } + + // return response + return &OauthProviderBulkCreatePayload{ + OauthProviders: res, + }, nil +} + +// bulkCreateOhAuthTooToken uses the CreateBulk function to create multiple OhAuthTooToken entities +func (r *mutationResolver) bulkCreateOhAuthTooToken(ctx context.Context, input []*generated.CreateOhAuthTooTokenInput) (*OhAuthTooTokenBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.OhAuthTooTokenCreate, len(input)) + for i, data := range input { + builders[i] = c.OhAuthTooToken.Create().SetInput(*data) + } + + res, err := c.OhAuthTooToken.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "ohauthtootoken"}, r.logger) + } + + // return response + return &OhAuthTooTokenBulkCreatePayload{ + OhAuthTooTokens: res, + }, nil +} + +// bulkCreateOrganization uses the CreateBulk function to create multiple Organization entities +func (r *mutationResolver) bulkCreateOrganization(ctx context.Context, input []*generated.CreateOrganizationInput) (*OrganizationBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.OrganizationCreate, len(input)) + for i, data := range input { + builders[i] = c.Organization.Create().SetInput(*data) + } + + res, err := c.Organization.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "organization"}, r.logger) + } + + // return response + return &OrganizationBulkCreatePayload{ + Organizations: res, + }, nil +} + +// bulkCreateOrganizationSetting uses the CreateBulk function to create multiple OrganizationSetting entities +func (r *mutationResolver) bulkCreateOrganizationSetting(ctx context.Context, input []*generated.CreateOrganizationSettingInput) (*OrganizationSettingBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.OrganizationSettingCreate, len(input)) + for i, data := range input { + builders[i] = c.OrganizationSetting.Create().SetInput(*data) + } + + res, err := c.OrganizationSetting.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "organizationsetting"}, r.logger) + } + + // return response + return &OrganizationSettingBulkCreatePayload{ + OrganizationSettings: res, + }, nil +} + +// bulkCreateOrgMembership uses the CreateBulk function to create multiple OrgMembership entities +func (r *mutationResolver) bulkCreateOrgMembership(ctx context.Context, input []*generated.CreateOrgMembershipInput) (*OrgMembershipBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.OrgMembershipCreate, len(input)) + for i, data := range input { + builders[i] = c.OrgMembership.Create().SetInput(*data) + } + + res, err := c.OrgMembership.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "orgmembership"}, r.logger) + } + + // return response + return &OrgMembershipBulkCreatePayload{ + OrgMemberships: res, + }, nil +} + +// bulkCreatePersonalAccessToken uses the CreateBulk function to create multiple PersonalAccessToken entities +func (r *mutationResolver) bulkCreatePersonalAccessToken(ctx context.Context, input []*generated.CreatePersonalAccessTokenInput) (*PersonalAccessTokenBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.PersonalAccessTokenCreate, len(input)) + for i, data := range input { + builders[i] = c.PersonalAccessToken.Create().SetInput(*data) + } + + res, err := c.PersonalAccessToken.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "personalaccesstoken"}, r.logger) + } + + // return response + return &PersonalAccessTokenBulkCreatePayload{ + PersonalAccessTokens: res, + }, nil +} + +// bulkCreateSubscriber uses the CreateBulk function to create multiple Subscriber entities +func (r *mutationResolver) bulkCreateSubscriber(ctx context.Context, input []*generated.CreateSubscriberInput) (*SubscriberBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.SubscriberCreate, len(input)) + for i, data := range input { + builders[i] = c.Subscriber.Create().SetInput(*data) + } + + res, err := c.Subscriber.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "subscriber"}, r.logger) + } + + // return response + return &SubscriberBulkCreatePayload{ + Subscribers: res, + }, nil +} + +// bulkCreateTemplate uses the CreateBulk function to create multiple Template entities +func (r *mutationResolver) bulkCreateTemplate(ctx context.Context, input []*generated.CreateTemplateInput) (*TemplateBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.TemplateCreate, len(input)) + for i, data := range input { + builders[i] = c.Template.Create().SetInput(*data) + } + + res, err := c.Template.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "template"}, r.logger) + } + + // return response + return &TemplateBulkCreatePayload{ + Templates: res, + }, nil +} + +// bulkCreateUserSetting uses the CreateBulk function to create multiple UserSetting entities +func (r *mutationResolver) bulkCreateUserSetting(ctx context.Context, input []*generated.CreateUserSettingInput) (*UserSettingBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.UserSettingCreate, len(input)) + for i, data := range input { + builders[i] = c.UserSetting.Create().SetInput(*data) + } + + res, err := c.UserSetting.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "usersetting"}, r.logger) + } + + // return response + return &UserSettingBulkCreatePayload{ + UserSettings: res, + }, nil +} + +// bulkCreateWebhook uses the CreateBulk function to create multiple Webhook entities +func (r *mutationResolver) bulkCreateWebhook(ctx context.Context, input []*generated.CreateWebhookInput) (*WebhookBulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.WebhookCreate, len(input)) + for i, data := range input { + builders[i] = c.Webhook.Create().SetInput(*data) + } + + res, err := c.Webhook.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "webhook"}, r.logger) + } + + // return response + return &WebhookBulkCreatePayload{ + Webhooks: res, + }, nil +} diff --git a/internal/graphapi/contact.resolvers.go b/internal/graphapi/contact.resolvers.go new file mode 100644 index 0000000..1520764 --- /dev/null +++ b/internal/graphapi/contact.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateContact is the resolver for the createContact field. +func (r *mutationResolver) CreateContact(ctx context.Context, input generated.CreateContactInput) (*ContactCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Contact.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "contact"}, r.logger) + } + + return &ContactCreatePayload{ + Contact: res, + }, nil +} + +// CreateBulkContact is the resolver for the createBulkContact field. +func (r *mutationResolver) CreateBulkContact(ctx context.Context, input []*generated.CreateContactInput) (*ContactBulkCreatePayload, error) { + return r.bulkCreateContact(ctx, input) +} + +// CreateBulkCSVContact is the resolver for the createBulkCSVContact field. +func (r *mutationResolver) CreateBulkCSVContact(ctx context.Context, input graphql.Upload) (*ContactBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateContactInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateContact(ctx, data) +} + +// UpdateContact is the resolver for the updateContact field. +func (r *mutationResolver) UpdateContact(ctx context.Context, id string, input generated.UpdateContactInput) (*ContactUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Contact.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "contact"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "contact"}, r.logger) + } + + return &ContactUpdatePayload{ + Contact: res, + }, nil +} + +// DeleteContact is the resolver for the deleteContact field. +func (r *mutationResolver) DeleteContact(ctx context.Context, id string) (*ContactDeletePayload, error) { + if err := withTransactionalMutation(ctx).Contact.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "contact"}, r.logger) + } + + if err := generated.ContactEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &ContactDeletePayload{ + DeletedID: id, + }, nil +} + +// Contact is the resolver for the contact field. +func (r *queryResolver) Contact(ctx context.Context, id string) (*generated.Contact, error) { + res, err := withTransactionalMutation(ctx).Contact.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "contact"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/contact_test.go b/internal/graphapi/contact_test.go new file mode 100644 index 0000000..a08aadd --- /dev/null +++ b/internal/graphapi/contact_test.go @@ -0,0 +1,559 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/brianvoe/gofakeit/v7" + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + "github.com/theopenlane/utils/rout" + "github.com/theopenlane/utils/ulids" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *GraphTestSuite) TestQueryContact() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + contact := (&ContactBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + allowed bool + client *openlaneclient.OpenLaneClient + ctx context.Context + expected *ent.Contact + errorMsg string + }{ + { + name: "happy path contact", + allowed: true, + queryID: contact.ID, + client: suite.client.api, + ctx: reqCtx, + expected: contact, + }, + { + name: "no access", + allowed: false, + queryID: contact.ID, + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not authorized", + }, + { + name: "happy path contact, with api token", + allowed: true, + queryID: contact.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + expected: contact, + }, + { + name: "no access, using api token", + allowed: false, + queryID: contact.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + errorMsg: "not authorized", + }, + { + name: "happy path contact, with pat", + allowed: true, + queryID: contact.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + expected: contact, + }, + { + name: "no access, using pat", + allowed: false, + queryID: contact.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + errorMsg: "not authorized", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.GetContactByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Contact) + }) + } + + // delete created org and contact + (&ContactCleanup{client: suite.client, ID: contact.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestQueryContacts() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&ContactBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&ContactBuilder{client: suite.client}).MustNew(reqCtx, t) + + otherUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + otherCtx, err := userContextWithID(otherUser.ID) + require.NoError(t, err) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedResults int + }{ + { + name: "happy path", + client: suite.client.api, + ctx: reqCtx, + expectedResults: 2, + }, + { + name: "happy path, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "happy path, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "another user, no contacts should be returned", + client: suite.client.api, + ctx: otherCtx, + expectedResults: 0, + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetAllContacts(tc.ctx) + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.Contacts.Edges, tc.expectedResults) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateContact() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + testCases := []struct { + name string + request openlaneclient.CreateContactInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, minimal input", + request: openlaneclient.CreateContactInput{ + FullName: "Aemond Targaryen", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, using api token", + request: openlaneclient.CreateContactInput{ + FullName: "Rhaenys Targaryen", + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, using pat", + request: openlaneclient.CreateContactInput{ + FullName: "Aegon Targaryen", + OwnerID: &testOrgID, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, all input", + request: openlaneclient.CreateContactInput{ + FullName: "Aemond Targaryen", + Email: lo.ToPtr("atargarygen@dragon.com"), + PhoneNumber: lo.ToPtr(gofakeit.Phone()), + Title: lo.ToPtr("Prince of the Targaryen Dynasty"), + Company: lo.ToPtr("Targaryen Dynasty"), + Status: &enums.UserStatusOnboarding, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "do not create if not allowed", + request: openlaneclient.CreateContactInput{ + FullName: "Halaena Targaryen", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: create on contact", + }, + { + name: "missing required field, name", + request: openlaneclient.CreateContactInput{ + Email: lo.ToPtr("atargarygen@dragon.com"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.CreateContact(tc.ctx, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.request.FullName, resp.CreateContact.Contact.FullName) + + if tc.request.Email == nil { + assert.Empty(t, resp.CreateContact.Contact.Email) + } else { + assert.Equal(t, *tc.request.Email, *resp.CreateContact.Contact.Email) + } + + if tc.request.PhoneNumber == nil { + assert.Empty(t, resp.CreateContact.Contact.PhoneNumber) + } else { + assert.Equal(t, *tc.request.PhoneNumber, *resp.CreateContact.Contact.PhoneNumber) + } + + if tc.request.Address == nil { + assert.Empty(t, resp.CreateContact.Contact.Address) + } else { + assert.Equal(t, *tc.request.Address, *resp.CreateContact.Contact.Address) + } + + if tc.request.Title == nil { + assert.Empty(t, resp.CreateContact.Contact.Title) + } else { + assert.Equal(t, *tc.request.Title, *resp.CreateContact.Contact.Title) + } + + if tc.request.Company == nil { + assert.Empty(t, resp.CreateContact.Contact.Company) + } else { + assert.Equal(t, *tc.request.Company, *resp.CreateContact.Contact.Company) + } + + // status should default to active + if tc.request.Status == nil { + assert.Equal(t, enums.UserStatusActive, resp.CreateContact.Contact.Status) + } else { + assert.Equal(t, *tc.request.Status, resp.CreateContact.Contact.Status) + } + + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateContact() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + contact := (&ContactBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + request openlaneclient.UpdateContactInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, update name", + request: openlaneclient.UpdateContactInput{ + FullName: lo.ToPtr("Alicent Hightower"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "update phone number, using api token", + request: openlaneclient.UpdateContactInput{ + PhoneNumber: lo.ToPtr(gofakeit.Phone()), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "update status, using personal access token", + request: openlaneclient.UpdateContactInput{ + Status: &enums.UserStatusInactive, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "update email", + request: openlaneclient.UpdateContactInput{ + Email: lo.ToPtr("a.hightower@dragon.net"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "update phone number, invalid", + request: openlaneclient.UpdateContactInput{ + PhoneNumber: lo.ToPtr("not a phone number"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: rout.InvalidField("phone_number").Error(), + }, + { + name: "update email, invalid", + request: openlaneclient.UpdateContactInput{ + Email: lo.ToPtr("a.hightower"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "validator failed for field", + }, + { + name: "update title", + request: openlaneclient.UpdateContactInput{ + Title: lo.ToPtr("Queen of the Seven Kingdoms"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "update company", + request: openlaneclient.UpdateContactInput{ + Company: lo.ToPtr("House Targaryen"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "not allowed to update", + request: openlaneclient.UpdateContactInput{ + Company: lo.ToPtr("House Hightower"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: update on contact", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.UpdateContact(tc.ctx, contact.ID, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + if tc.request.PhoneNumber != nil { + assert.Equal(t, *tc.request.PhoneNumber, *resp.UpdateContact.Contact.PhoneNumber) + } + + if tc.request.Email != nil { + assert.Equal(t, *tc.request.Email, *resp.UpdateContact.Contact.Email) + } + + if tc.request.FullName != nil { + assert.Equal(t, *tc.request.FullName, resp.UpdateContact.Contact.FullName) + } + + if tc.request.Title != nil { + assert.Equal(t, *tc.request.Title, *resp.UpdateContact.Contact.Title) + } + + if tc.request.Company != nil { + assert.Equal(t, *tc.request.Company, *resp.UpdateContact.Contact.Company) + } + + if tc.request.Status != nil { + assert.Equal(t, *tc.request.Status, resp.UpdateContact.Contact.Status) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteContact() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + contact1 := (&ContactBuilder{client: suite.client}).MustNew(reqCtx, t) + contact2 := (&ContactBuilder{client: suite.client}).MustNew(reqCtx, t) + contact3 := (&ContactBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: contact1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on contact", + }, + { + name: "happy path, delete contact", + idToDelete: contact1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "contact already deleted, not found", + idToDelete: contact1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "contact not found", + }, + { + name: "happy path, delete contact using api token", + idToDelete: contact2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete contact using pat", + idToDelete: contact3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown contact, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "contact not found", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization if contact exists + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := suite.client.api.DeleteContact(reqCtx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.idToDelete, resp.DeleteContact.DeletedID) + }) + } +} diff --git a/internal/graphapi/doc.go b/internal/graphapi/doc.go new file mode 100644 index 0000000..b6631da --- /dev/null +++ b/internal/graphapi/doc.go @@ -0,0 +1,2 @@ +// Package graphapi is the graph api package +package graphapi diff --git a/internal/graphapi/documentdata.resolvers.go b/internal/graphapi/documentdata.resolvers.go new file mode 100644 index 0000000..bf89819 --- /dev/null +++ b/internal/graphapi/documentdata.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateDocumentData is the resolver for the createDocumentData field. +func (r *mutationResolver) CreateDocumentData(ctx context.Context, input generated.CreateDocumentDataInput) (*DocumentDataCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).DocumentData.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "documentdata"}, r.logger) + } + + return &DocumentDataCreatePayload{ + DocumentData: res, + }, nil +} + +// CreateBulkDocumentData is the resolver for the createBulkDocumentData field. +func (r *mutationResolver) CreateBulkDocumentData(ctx context.Context, input []*generated.CreateDocumentDataInput) (*DocumentDataBulkCreatePayload, error) { + return r.bulkCreateDocumentData(ctx, input) +} + +// CreateBulkCSVDocumentData is the resolver for the createBulkCSVDocumentData field. +func (r *mutationResolver) CreateBulkCSVDocumentData(ctx context.Context, input graphql.Upload) (*DocumentDataBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateDocumentDataInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateDocumentData(ctx, data) +} + +// UpdateDocumentData is the resolver for the updateDocumentData field. +func (r *mutationResolver) UpdateDocumentData(ctx context.Context, id string, input generated.UpdateDocumentDataInput) (*DocumentDataUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).DocumentData.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "documentdata"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "documentdata"}, r.logger) + } + + return &DocumentDataUpdatePayload{ + DocumentData: res, + }, nil +} + +// DeleteDocumentData is the resolver for the deleteDocumentData field. +func (r *mutationResolver) DeleteDocumentData(ctx context.Context, id string) (*DocumentDataDeletePayload, error) { + if err := withTransactionalMutation(ctx).DocumentData.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "documentdata"}, r.logger) + } + + if err := generated.DocumentDataEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &DocumentDataDeletePayload{ + DeletedID: id, + }, nil +} + +// DocumentData is the resolver for the documentData field. +func (r *queryResolver) DocumentData(ctx context.Context, id string) (*generated.DocumentData, error) { + res, err := withTransactionalMutation(ctx).DocumentData.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "documentdata"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/ent.resolvers.go b/internal/graphapi/ent.resolvers.go new file mode 100644 index 0000000..cdc5da9 --- /dev/null +++ b/internal/graphapi/ent.resolvers.go @@ -0,0 +1,423 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "entgo.io/contrib/entgql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// Node is the resolver for the node field. +func (r *queryResolver) Node(ctx context.Context, id string) (generated.Noder, error) { + return withTransactionalMutation(ctx).Noder(ctx, id) +} + +// Nodes is the resolver for the nodes field. +func (r *queryResolver) Nodes(ctx context.Context, ids []string) ([]generated.Noder, error) { + return withTransactionalMutation(ctx).Noders(ctx, ids) +} + +// APITokens is the resolver for the apiTokens field. +func (r *queryResolver) APITokens(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.APITokenWhereInput) (*generated.APITokenConnection, error) { + return withTransactionalMutation(ctx).APIToken.Query().Paginate(ctx, after, first, before, last, generated.WithAPITokenFilter(where.Filter)) +} + +// Contacts is the resolver for the contacts field. +func (r *queryResolver) Contacts(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.ContactWhereInput) (*generated.ContactConnection, error) { + return withTransactionalMutation(ctx).Contact.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithContactFilter(where.Filter)) +} + +// ContactHistories is the resolver for the contactHistories field. +func (r *queryResolver) ContactHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.ContactHistoryWhereInput) (*generated.ContactHistoryConnection, error) { + return withTransactionalMutation(ctx).ContactHistory.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithContactHistoryFilter(where.Filter)) +} + +// DocumentDataSlice is the resolver for the documentDataSlice field. +func (r *queryResolver) DocumentDataSlice(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.DocumentDataWhereInput) (*generated.DocumentDataConnection, error) { + return withTransactionalMutation(ctx).DocumentData.Query().Paginate(ctx, after, first, before, last, generated.WithDocumentDataFilter(where.Filter)) +} + +// DocumentDataHistories is the resolver for the documentDataHistories field. +func (r *queryResolver) DocumentDataHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.DocumentDataHistoryWhereInput) (*generated.DocumentDataHistoryConnection, error) { + return withTransactionalMutation(ctx).DocumentDataHistory.Query().Paginate(ctx, after, first, before, last, generated.WithDocumentDataHistoryFilter(where.Filter)) +} + +// Entitlements is the resolver for the entitlements field. +func (r *queryResolver) Entitlements(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementWhereInput) (*generated.EntitlementConnection, error) { + return withTransactionalMutation(ctx).Entitlement.Query().Paginate(ctx, after, first, before, last, generated.WithEntitlementFilter(where.Filter)) +} + +// EntitlementHistories is the resolver for the entitlementHistories field. +func (r *queryResolver) EntitlementHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementHistoryWhereInput) (*generated.EntitlementHistoryConnection, error) { + return withTransactionalMutation(ctx).EntitlementHistory.Query().Paginate(ctx, after, first, before, last, generated.WithEntitlementHistoryFilter(where.Filter)) +} + +// EntitlementPlans is the resolver for the entitlementPlans field. +func (r *queryResolver) EntitlementPlans(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanWhereInput) (*generated.EntitlementPlanConnection, error) { + return withTransactionalMutation(ctx).EntitlementPlan.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntitlementPlanFilter(where.Filter)) +} + +// EntitlementPlanFeatures is the resolver for the entitlementPlanFeatures field. +func (r *queryResolver) EntitlementPlanFeatures(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanFeatureWhereInput) (*generated.EntitlementPlanFeatureConnection, error) { + return withTransactionalMutation(ctx).EntitlementPlanFeature.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntitlementPlanFeatureFilter(where.Filter)) +} + +// EntitlementPlanFeatureHistories is the resolver for the entitlementPlanFeatureHistories field. +func (r *queryResolver) EntitlementPlanFeatureHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanFeatureHistoryWhereInput) (*generated.EntitlementPlanFeatureHistoryConnection, error) { + return withTransactionalMutation(ctx).EntitlementPlanFeatureHistory.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntitlementPlanFeatureHistoryFilter(where.Filter)) +} + +// EntitlementPlanHistories is the resolver for the entitlementPlanHistories field. +func (r *queryResolver) EntitlementPlanHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanHistoryWhereInput) (*generated.EntitlementPlanHistoryConnection, error) { + return withTransactionalMutation(ctx).EntitlementPlanHistory.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntitlementPlanHistoryFilter(where.Filter)) +} + +// Entities is the resolver for the entities field. +func (r *queryResolver) Entities(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityOrder, where *generated.EntityWhereInput) (*generated.EntityConnection, error) { + return withTransactionalMutation(ctx).Entity.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntityOrder(orderBy), + generated.WithEntityFilter(where.Filter)) +} + +// EntityHistories is the resolver for the entityHistories field. +func (r *queryResolver) EntityHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityHistoryOrder, where *generated.EntityHistoryWhereInput) (*generated.EntityHistoryConnection, error) { + return withTransactionalMutation(ctx).EntityHistory.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntityHistoryOrder(orderBy), + generated.WithEntityHistoryFilter(where.Filter)) +} + +// EntityTypes is the resolver for the entityTypes field. +func (r *queryResolver) EntityTypes(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityTypeOrder, where *generated.EntityTypeWhereInput) (*generated.EntityTypeConnection, error) { + return withTransactionalMutation(ctx).EntityType.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntityTypeOrder(orderBy), + generated.WithEntityTypeFilter(where.Filter)) +} + +// EntityTypeHistories is the resolver for the entityTypeHistories field. +func (r *queryResolver) EntityTypeHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityTypeHistoryOrder, where *generated.EntityTypeHistoryWhereInput) (*generated.EntityTypeHistoryConnection, error) { + return withTransactionalMutation(ctx).EntityTypeHistory.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithEntityTypeHistoryOrder(orderBy), + generated.WithEntityTypeHistoryFilter(where.Filter)) +} + +// Events is the resolver for the events field. +func (r *queryResolver) Events(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EventWhereInput) (*generated.EventConnection, error) { + return withTransactionalMutation(ctx).Event.Query().Paginate(ctx, after, first, before, last, generated.WithEventFilter(where.Filter)) +} + +// EventHistories is the resolver for the eventHistories field. +func (r *queryResolver) EventHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EventHistoryWhereInput) (*generated.EventHistoryConnection, error) { + return withTransactionalMutation(ctx).EventHistory.Query().Paginate(ctx, after, first, before, last, generated.WithEventHistoryFilter(where.Filter)) +} + +// Features is the resolver for the features field. +func (r *queryResolver) Features(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FeatureWhereInput) (*generated.FeatureConnection, error) { + return withTransactionalMutation(ctx).Feature.Query().Paginate(ctx, after, first, before, last, generated.WithFeatureFilter(where.Filter)) +} + +// FeatureHistories is the resolver for the featureHistories field. +func (r *queryResolver) FeatureHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FeatureHistoryWhereInput) (*generated.FeatureHistoryConnection, error) { + return withTransactionalMutation(ctx).FeatureHistory.Query().Paginate(ctx, after, first, before, last, generated.WithFeatureHistoryFilter(where.Filter)) +} + +// Files is the resolver for the files field. +func (r *queryResolver) Files(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FileWhereInput) (*generated.FileConnection, error) { + return withTransactionalMutation(ctx).File.Query().Paginate(ctx, after, first, before, last, generated.WithFileFilter(where.Filter)) +} + +// FileHistories is the resolver for the fileHistories field. +func (r *queryResolver) FileHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FileHistoryWhereInput) (*generated.FileHistoryConnection, error) { + return withTransactionalMutation(ctx).FileHistory.Query().Paginate(ctx, after, first, before, last, generated.WithFileHistoryFilter(where.Filter)) +} + +// Groups is the resolver for the groups field. +func (r *queryResolver) Groups(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.GroupOrder, where *generated.GroupWhereInput) (*generated.GroupConnection, error) { + return withTransactionalMutation(ctx).Group.Query().Paginate(ctx, after, first, before, last, generated.WithGroupOrder(orderBy), generated.WithGroupFilter(where.Filter)) +} + +// GroupHistories is the resolver for the groupHistories field. +func (r *queryResolver) GroupHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.GroupHistoryOrder, where *generated.GroupHistoryWhereInput) (*generated.GroupHistoryConnection, error) { + return withTransactionalMutation(ctx).GroupHistory.Query().Paginate(ctx, after, first, before, last, generated.WithGroupHistoryOrder(orderBy), generated.WithGroupHistoryFilter(where.Filter)) +} + +// GroupMemberships is the resolver for the groupMemberships field. +func (r *queryResolver) GroupMemberships(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupMembershipWhereInput) (*generated.GroupMembershipConnection, error) { + return withTransactionalMutation(ctx).GroupMembership.Query().Paginate(ctx, after, first, before, last, generated.WithGroupMembershipFilter(where.Filter)) +} + +// GroupMembershipHistories is the resolver for the groupMembershipHistories field. +func (r *queryResolver) GroupMembershipHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupMembershipHistoryWhereInput) (*generated.GroupMembershipHistoryConnection, error) { + return withTransactionalMutation(ctx).GroupMembershipHistory.Query().Paginate(ctx, after, first, before, last, generated.WithGroupMembershipHistoryFilter(where.Filter)) +} + +// GroupSettings is the resolver for the groupSettings field. +func (r *queryResolver) GroupSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupSettingWhereInput) (*generated.GroupSettingConnection, error) { + return withTransactionalMutation(ctx).GroupSetting.Query().Paginate(ctx, after, first, before, last, generated.WithGroupSettingFilter(where.Filter)) +} + +// GroupSettingHistories is the resolver for the groupSettingHistories field. +func (r *queryResolver) GroupSettingHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupSettingHistoryWhereInput) (*generated.GroupSettingHistoryConnection, error) { + return withTransactionalMutation(ctx).GroupSettingHistory.Query().Paginate(ctx, after, first, before, last, generated.WithGroupSettingHistoryFilter(where.Filter)) +} + +// Hushes is the resolver for the hushes field. +func (r *queryResolver) Hushes(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.HushOrder, where *generated.HushWhereInput) (*generated.HushConnection, error) { + return withTransactionalMutation(ctx).Hush.Query().Paginate(ctx, after, first, before, last, generated.WithHushOrder(orderBy), generated.WithHushFilter(where.Filter)) +} + +// HushHistories is the resolver for the hushHistories field. +func (r *queryResolver) HushHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.HushHistoryOrder, where *generated.HushHistoryWhereInput) (*generated.HushHistoryConnection, error) { + return withTransactionalMutation(ctx).HushHistory.Query().Paginate(ctx, after, first, before, last, generated.WithHushHistoryOrder(orderBy), generated.WithHushHistoryFilter(where.Filter)) +} + +// Integrations is the resolver for the integrations field. +func (r *queryResolver) Integrations(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.IntegrationOrder, where *generated.IntegrationWhereInput) (*generated.IntegrationConnection, error) { + return withTransactionalMutation(ctx).Integration.Query().Paginate(ctx, after, first, before, last, generated.WithIntegrationOrder(orderBy), generated.WithIntegrationFilter(where.Filter)) +} + +// IntegrationHistories is the resolver for the integrationHistories field. +func (r *queryResolver) IntegrationHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.IntegrationHistoryOrder, where *generated.IntegrationHistoryWhereInput) (*generated.IntegrationHistoryConnection, error) { + return withTransactionalMutation(ctx).IntegrationHistory.Query().Paginate(ctx, after, first, before, last, generated.WithIntegrationHistoryOrder(orderBy), generated.WithIntegrationHistoryFilter(where.Filter)) +} + +// Invites is the resolver for the invites field. +func (r *queryResolver) Invites(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.InviteWhereInput) (*generated.InviteConnection, error) { + return r.client.Invite.Query().Paginate(ctx, after, first, before, last, generated.WithInviteFilter(where.Filter)) +} + +// Notes is the resolver for the notes field. +func (r *queryResolver) Notes(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.NoteWhereInput) (*generated.NoteConnection, error) { + return withTransactionalMutation(ctx).Note.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithNoteFilter(where.Filter)) +} + +// NoteHistories is the resolver for the noteHistories field. +func (r *queryResolver) NoteHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.NoteHistoryWhereInput) (*generated.NoteHistoryConnection, error) { + return withTransactionalMutation(ctx).NoteHistory.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithNoteHistoryFilter(where.Filter)) +} + +// OauthProviders is the resolver for the oauthProviders field. +func (r *queryResolver) OauthProviders(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OauthProviderWhereInput) (*generated.OauthProviderConnection, error) { + return withTransactionalMutation(ctx).OauthProvider.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithOauthProviderFilter(where.Filter)) +} + +// OauthProviderHistories is the resolver for the oauthProviderHistories field. +func (r *queryResolver) OauthProviderHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OauthProviderHistoryWhereInput) (*generated.OauthProviderHistoryConnection, error) { + return withTransactionalMutation(ctx).OauthProviderHistory.Query().Paginate( + ctx, + after, + first, + before, + last, + generated.WithOauthProviderHistoryFilter(where.Filter)) +} + +// OhAuthTooTokens is the resolver for the ohAuthTooTokens field. +func (r *queryResolver) OhAuthTooTokens(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OhAuthTooTokenWhereInput) (*generated.OhAuthTooTokenConnection, error) { + return withTransactionalMutation(ctx).OhAuthTooToken.Query().Paginate(ctx, after, first, before, last, generated.WithOhAuthTooTokenFilter(where.Filter)) +} + +// OrgMemberships is the resolver for the orgMemberships field. +func (r *queryResolver) OrgMemberships(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrgMembershipWhereInput) (*generated.OrgMembershipConnection, error) { + return withTransactionalMutation(ctx).OrgMembership.Query().Paginate(ctx, after, first, before, last, generated.WithOrgMembershipFilter(where.Filter)) +} + +// OrgMembershipHistories is the resolver for the orgMembershipHistories field. +func (r *queryResolver) OrgMembershipHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrgMembershipHistoryWhereInput) (*generated.OrgMembershipHistoryConnection, error) { + return withTransactionalMutation(ctx).OrgMembershipHistory.Query().Paginate(ctx, after, first, before, last, generated.WithOrgMembershipHistoryFilter(where.Filter)) +} + +// Organizations is the resolver for the organizations field. +func (r *queryResolver) Organizations(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.OrganizationOrder, where *generated.OrganizationWhereInput) (*generated.OrganizationConnection, error) { + return withTransactionalMutation(ctx).Organization.Query().Paginate(ctx, after, first, before, last, generated.WithOrganizationOrder(orderBy), generated.WithOrganizationFilter(where.Filter)) +} + +// OrganizationHistories is the resolver for the organizationHistories field. +func (r *queryResolver) OrganizationHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.OrganizationHistoryOrder, where *generated.OrganizationHistoryWhereInput) (*generated.OrganizationHistoryConnection, error) { + return withTransactionalMutation(ctx).OrganizationHistory.Query().Paginate(ctx, after, first, before, last, generated.WithOrganizationHistoryOrder(orderBy), generated.WithOrganizationHistoryFilter(where.Filter)) +} + +// OrganizationSettings is the resolver for the organizationSettings field. +func (r *queryResolver) OrganizationSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrganizationSettingWhereInput) (*generated.OrganizationSettingConnection, error) { + return withTransactionalMutation(ctx).OrganizationSetting.Query().Paginate(ctx, after, first, before, last, generated.WithOrganizationSettingFilter(where.Filter)) +} + +// OrganizationSettingHistories is the resolver for the organizationSettingHistories field. +func (r *queryResolver) OrganizationSettingHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrganizationSettingHistoryWhereInput) (*generated.OrganizationSettingHistoryConnection, error) { + return withTransactionalMutation(ctx).OrganizationSettingHistory.Query().Paginate(ctx, after, first, before, last, generated.WithOrganizationSettingHistoryFilter(where.Filter)) +} + +// PersonalAccessTokens is the resolver for the personalAccessTokens field. +func (r *queryResolver) PersonalAccessTokens(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.PersonalAccessTokenWhereInput) (*generated.PersonalAccessTokenConnection, error) { + return withTransactionalMutation(ctx).PersonalAccessToken.Query().Paginate(ctx, after, first, before, last, generated.WithPersonalAccessTokenFilter(where.Filter)) +} + +// Subscribers is the resolver for the subscribers field. +func (r *queryResolver) Subscribers(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.SubscriberWhereInput) (*generated.SubscriberConnection, error) { + return withTransactionalMutation(ctx).Subscriber.Query().Paginate(ctx, after, first, before, last, generated.WithSubscriberFilter(where.Filter)) +} + +// TfaSettings is the resolver for the tfaSettings field. +func (r *queryResolver) TfaSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.TFASettingWhereInput) (*generated.TFASettingConnection, error) { + return withTransactionalMutation(ctx).TFASetting.Query().Paginate(ctx, after, first, before, last, generated.WithTFASettingFilter(where.Filter)) +} + +// Templates is the resolver for the templates field. +func (r *queryResolver) Templates(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.TemplateOrder, where *generated.TemplateWhereInput) (*generated.TemplateConnection, error) { + return withTransactionalMutation(ctx).Template.Query().Paginate(ctx, after, first, before, last, generated.WithTemplateOrder(orderBy), generated.WithTemplateFilter(where.Filter)) +} + +// TemplateHistories is the resolver for the templateHistories field. +func (r *queryResolver) TemplateHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.TemplateHistoryOrder, where *generated.TemplateHistoryWhereInput) (*generated.TemplateHistoryConnection, error) { + return withTransactionalMutation(ctx).TemplateHistory.Query().Paginate(ctx, after, first, before, last, generated.WithTemplateHistoryOrder(orderBy), generated.WithTemplateHistoryFilter(where.Filter)) +} + +// Users is the resolver for the users field. +func (r *queryResolver) Users(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.UserOrder, where *generated.UserWhereInput) (*generated.UserConnection, error) { + return withTransactionalMutation(ctx).User.Query().Paginate(ctx, after, first, before, last, generated.WithUserOrder(orderBy), generated.WithUserFilter(where.Filter)) +} + +// UserHistories is the resolver for the userHistories field. +func (r *queryResolver) UserHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.UserHistoryOrder, where *generated.UserHistoryWhereInput) (*generated.UserHistoryConnection, error) { + return withTransactionalMutation(ctx).UserHistory.Query().Paginate(ctx, after, first, before, last, generated.WithUserHistoryOrder(orderBy), generated.WithUserHistoryFilter(where.Filter)) +} + +// UserSettings is the resolver for the userSettings field. +func (r *queryResolver) UserSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.UserSettingWhereInput) (*generated.UserSettingConnection, error) { + return withTransactionalMutation(ctx).UserSetting.Query().Paginate(ctx, after, first, before, last, generated.WithUserSettingFilter(where.Filter)) +} + +// UserSettingHistories is the resolver for the userSettingHistories field. +func (r *queryResolver) UserSettingHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.UserSettingHistoryWhereInput) (*generated.UserSettingHistoryConnection, error) { + return withTransactionalMutation(ctx).UserSettingHistory.Query().Paginate(ctx, after, first, before, last, generated.WithUserSettingHistoryFilter(where.Filter)) +} + +// Webhooks is the resolver for the webhooks field. +func (r *queryResolver) Webhooks(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.WebhookOrder, where *generated.WebhookWhereInput) (*generated.WebhookConnection, error) { + return withTransactionalMutation(ctx).Webhook.Query().Paginate(ctx, after, first, before, last, generated.WithWebhookOrder(orderBy), generated.WithWebhookFilter(where.Filter)) +} + +// WebhookHistories is the resolver for the webhookHistories field. +func (r *queryResolver) WebhookHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.WebhookHistoryOrder, where *generated.WebhookHistoryWhereInput) (*generated.WebhookHistoryConnection, error) { + return withTransactionalMutation(ctx).WebhookHistory.Query().Paginate(ctx, after, first, before, last, generated.WithWebhookHistoryOrder(orderBy), generated.WithWebhookHistoryFilter(where.Filter)) +} + +// Query returns QueryResolver implementation. +func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } + +// CreateEntityInput returns CreateEntityInputResolver implementation. +func (r *Resolver) CreateEntityInput() CreateEntityInputResolver { + return &createEntityInputResolver{r} +} + +// CreateGroupInput returns CreateGroupInputResolver implementation. +func (r *Resolver) CreateGroupInput() CreateGroupInputResolver { return &createGroupInputResolver{r} } + +// CreateOrganizationInput returns CreateOrganizationInputResolver implementation. +func (r *Resolver) CreateOrganizationInput() CreateOrganizationInputResolver { + return &createOrganizationInputResolver{r} +} + +// UpdateEntityInput returns UpdateEntityInputResolver implementation. +func (r *Resolver) UpdateEntityInput() UpdateEntityInputResolver { + return &updateEntityInputResolver{r} +} + +// UpdateGroupInput returns UpdateGroupInputResolver implementation. +func (r *Resolver) UpdateGroupInput() UpdateGroupInputResolver { return &updateGroupInputResolver{r} } + +// UpdateOrganizationInput returns UpdateOrganizationInputResolver implementation. +func (r *Resolver) UpdateOrganizationInput() UpdateOrganizationInputResolver { + return &updateOrganizationInputResolver{r} +} + +// UpdateTFASettingInput returns UpdateTFASettingInputResolver implementation. +func (r *Resolver) UpdateTFASettingInput() UpdateTFASettingInputResolver { + return &updateTFASettingInputResolver{r} +} + +type queryResolver struct{ *Resolver } +type createEntityInputResolver struct{ *Resolver } +type createGroupInputResolver struct{ *Resolver } +type createOrganizationInputResolver struct{ *Resolver } +type updateEntityInputResolver struct{ *Resolver } +type updateGroupInputResolver struct{ *Resolver } +type updateOrganizationInputResolver struct{ *Resolver } +type updateTFASettingInputResolver struct{ *Resolver } diff --git a/internal/graphapi/entitlement.resolvers.go b/internal/graphapi/entitlement.resolvers.go new file mode 100644 index 0000000..bdbfefc --- /dev/null +++ b/internal/graphapi/entitlement.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateEntitlement is the resolver for the createEntitlement field. +func (r *mutationResolver) CreateEntitlement(ctx context.Context, input generated.CreateEntitlementInput) (*EntitlementCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Entitlement.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitlement"}, r.logger) + } + + return &EntitlementCreatePayload{ + Entitlement: res, + }, nil +} + +// CreateBulkEntitlement is the resolver for the createBulkEntitlement field. +func (r *mutationResolver) CreateBulkEntitlement(ctx context.Context, input []*generated.CreateEntitlementInput) (*EntitlementBulkCreatePayload, error) { + return r.bulkCreateEntitlement(ctx, input) +} + +// CreateBulkCSVEntitlement is the resolver for the createBulkCSVEntitlement field. +func (r *mutationResolver) CreateBulkCSVEntitlement(ctx context.Context, input graphql.Upload) (*EntitlementBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateEntitlementInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateEntitlement(ctx, data) +} + +// UpdateEntitlement is the resolver for the updateEntitlement field. +func (r *mutationResolver) UpdateEntitlement(ctx context.Context, id string, input generated.UpdateEntitlementInput) (*EntitlementUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Entitlement.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitlement"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitlement"}, r.logger) + } + + return &EntitlementUpdatePayload{ + Entitlement: res, + }, nil +} + +// DeleteEntitlement is the resolver for the deleteEntitlement field. +func (r *mutationResolver) DeleteEntitlement(ctx context.Context, id string) (*EntitlementDeletePayload, error) { + if err := withTransactionalMutation(ctx).Entitlement.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "entitlement"}, r.logger) + } + + if err := generated.EntitlementEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &EntitlementDeletePayload{ + DeletedID: id, + }, nil +} + +// Entitlement is the resolver for the entitlement field. +func (r *queryResolver) Entitlement(ctx context.Context, id string) (*generated.Entitlement, error) { + res, err := withTransactionalMutation(ctx).Entitlement.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "entitlement"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/entitlement_test.go b/internal/graphapi/entitlement_test.go new file mode 100644 index 0000000..3d61e07 --- /dev/null +++ b/internal/graphapi/entitlement_test.go @@ -0,0 +1,487 @@ +package graphapi_test + +import ( + "context" + "testing" + "time" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/core/pkg/openlaneclient" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryEntitlement() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entitlement := (&EntitlementBuilder{client: suite.client, OrganizationID: testOrgID}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + errorMsg string + }{ + { + name: "happy path", + queryID: entitlement.ID, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path, using api token", + queryID: entitlement.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + }, + { + name: "happy path, using personal access token", + queryID: entitlement.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "not found", + queryID: "notfound", + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.GetEntitlementByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.queryID, resp.Entitlement.ID) + + require.NotEmpty(t, resp.Entitlement.GetPlan()) + assert.NotEmpty(t, resp.Entitlement.Plan.ID) + + require.NotEmpty(t, resp.Entitlement.GetOrganization()) + assert.NotEmpty(t, resp.Entitlement.Organization.ID) + }) + } +} + +func (suite *GraphTestSuite) TestQueryEntitlements() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&EntitlementBuilder{client: suite.client, OrganizationID: testOrgID}).MustNew(reqCtx, t) + + otherUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + otherCtx, err := userContextWithID(otherUser.ID) + require.NoError(t, err) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedResults int + }{ + { + name: "happy path", + client: suite.client.api, + ctx: reqCtx, + expectedResults: 1, + }, + { + name: "happy path, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + expectedResults: 1, + }, + { + name: "happy path, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + expectedResults: 1, + }, + { + name: "another user, no entitlements should be returned", + client: suite.client.api, + ctx: otherCtx, + expectedResults: 0, + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetAllEntitlements(tc.ctx) + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.Entitlements.Edges, tc.expectedResults) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateEntitlement() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // setup for entitlement creation + org1 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + org2 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + plan := (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + + expiresAt := time.Now().Add(time.Hour * 24 * 365) // 1 year from now + + testCases := []struct { + name string + request openlaneclient.CreateEntitlementInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, minimal input", + request: openlaneclient.CreateEntitlementInput{ + PlanID: plan.ID, + OrganizationID: org1.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, all input", + request: openlaneclient.CreateEntitlementInput{ + PlanID: plan.ID, + OrganizationID: org2.ID, + ExternalCustomerID: lo.ToPtr("customer-123"), + ExternalSubscriptionID: lo.ToPtr("sub-123"), + Cancelled: lo.ToPtr(false), + ExpiresAt: &expiresAt, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "organization already has active entitlement", + request: openlaneclient.CreateEntitlementInput{ + PlanID: plan.ID, + OrganizationID: org1.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "entitlement already exists", + }, + { + name: "do not create if not allowed", + request: openlaneclient.CreateEntitlementInput{ + PlanID: plan.ID, + OrganizationID: org1.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: create on entitlement", + }, + { + name: "missing required field, organization", + request: openlaneclient.CreateEntitlementInput{ + PlanID: plan.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + { + name: "missing required field, plan", + request: openlaneclient.CreateEntitlementInput{ + OrganizationID: org1.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.CreateEntitlement(tc.ctx, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + require.NotEmpty(t, resp.CreateEntitlement.Entitlement.GetPlan()) + assert.Equal(t, tc.request.PlanID, resp.CreateEntitlement.Entitlement.Plan.ID) + + if tc.request.ExpiresAt != nil { + assert.WithinDuration(t, *tc.request.ExpiresAt, *resp.CreateEntitlement.Entitlement.ExpiresAt, time.Second) + assert.True(t, resp.CreateEntitlement.Entitlement.Expires) + } else { + assert.False(t, resp.CreateEntitlement.Entitlement.Expires) + } + + if tc.request.ExternalCustomerID != nil { + assert.Equal(t, *tc.request.ExternalCustomerID, *resp.CreateEntitlement.Entitlement.ExternalCustomerID) + } + + if tc.request.ExternalSubscriptionID != nil { + assert.Equal(t, *tc.request.ExternalSubscriptionID, *resp.CreateEntitlement.Entitlement.ExternalSubscriptionID) + } + + if tc.request.Cancelled != nil { + assert.Equal(t, *tc.request.Cancelled, resp.CreateEntitlement.Entitlement.Cancelled) + } else { + assert.False(t, resp.CreateEntitlement.Entitlement.Cancelled) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateEntitlement() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entitlement := (&EntitlementBuilder{client: suite.client}).MustNew(reqCtx, t) + + expiresAt := time.Now().Add(time.Hour * 24 * 30) // 30 days from now + + testCases := []struct { + name string + request openlaneclient.UpdateEntitlementInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, update external customer id", + request: openlaneclient.UpdateEntitlementInput{ + ExternalCustomerID: lo.ToPtr("customer-123"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, update external customer id using api token", + request: openlaneclient.UpdateEntitlementInput{ + ExternalSubscriptionID: lo.ToPtr("sub-123"), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, expire entitlement using pat", + request: openlaneclient.UpdateEntitlementInput{ + ExpiresAt: &expiresAt, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "cancel entitlement", + request: openlaneclient.UpdateEntitlementInput{ + Cancelled: lo.ToPtr(true), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "not allowed to update", + request: openlaneclient.UpdateEntitlementInput{ + Cancelled: lo.ToPtr(false), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: update on entitlement", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.UpdateEntitlement(tc.ctx, entitlement.ID, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + if tc.request.Cancelled != nil { + assert.Equal(t, *tc.request.Cancelled, resp.UpdateEntitlement.Entitlement.GetCancelled()) + } + + if tc.request.ExternalCustomerID != nil { + assert.Equal(t, *tc.request.ExternalCustomerID, *resp.UpdateEntitlement.Entitlement.GetExternalCustomerID()) + } + + if tc.request.ExternalSubscriptionID != nil { + assert.Equal(t, *tc.request.ExternalSubscriptionID, *resp.UpdateEntitlement.Entitlement.GetExternalSubscriptionID()) + } + + if tc.request.ExpiresAt != nil { + assert.WithinDuration(t, *tc.request.ExpiresAt, *resp.UpdateEntitlement.Entitlement.GetExpiresAt(), time.Second) + assert.True(t, resp.UpdateEntitlement.Entitlement.GetExpires()) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteEntitlement() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entitlement1 := (&EntitlementBuilder{client: suite.client}).MustNew(reqCtx, t) + entitlement2 := (&EntitlementBuilder{client: suite.client}).MustNew(reqCtx, t) + entitlement3 := (&EntitlementBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: entitlement1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on entitlement", + }, + { + name: "happy path, delete entitlement", + idToDelete: entitlement1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "entitlement already deleted, not found", + idToDelete: entitlement1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entitlement not found", + }, + { + name: "happy path, delete entitlement using api token", + idToDelete: entitlement2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete entitlement using pat", + idToDelete: entitlement3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown entitlement, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entitlement not found", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization if entitlement exists + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.DeleteEntitlement(tc.ctx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.idToDelete, resp.DeleteEntitlement.DeletedID) + }) + } +} diff --git a/internal/graphapi/entitlementplan.resolvers.go b/internal/graphapi/entitlementplan.resolvers.go new file mode 100644 index 0000000..e4ea494 --- /dev/null +++ b/internal/graphapi/entitlementplan.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateEntitlementPlan is the resolver for the createEntitlementPlan field. +func (r *mutationResolver) CreateEntitlementPlan(ctx context.Context, input generated.CreateEntitlementPlanInput) (*EntitlementPlanCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).EntitlementPlan.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitlementplan"}, r.logger) + } + + return &EntitlementPlanCreatePayload{ + EntitlementPlan: res, + }, nil +} + +// CreateBulkEntitlementPlan is the resolver for the createBulkEntitlementPlan field. +func (r *mutationResolver) CreateBulkEntitlementPlan(ctx context.Context, input []*generated.CreateEntitlementPlanInput) (*EntitlementPlanBulkCreatePayload, error) { + return r.bulkCreateEntitlementPlan(ctx, input) +} + +// CreateBulkCSVEntitlementPlan is the resolver for the createBulkCSVEntitlementPlan field. +func (r *mutationResolver) CreateBulkCSVEntitlementPlan(ctx context.Context, input graphql.Upload) (*EntitlementPlanBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateEntitlementPlanInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateEntitlementPlan(ctx, data) +} + +// UpdateEntitlementPlan is the resolver for the updateEntitlementPlan field. +func (r *mutationResolver) UpdateEntitlementPlan(ctx context.Context, id string, input generated.UpdateEntitlementPlanInput) (*EntitlementPlanUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).EntitlementPlan.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitlementplan"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitlementplan"}, r.logger) + } + + return &EntitlementPlanUpdatePayload{ + EntitlementPlan: res, + }, nil +} + +// DeleteEntitlementPlan is the resolver for the deleteEntitlementPlan field. +func (r *mutationResolver) DeleteEntitlementPlan(ctx context.Context, id string) (*EntitlementPlanDeletePayload, error) { + if err := withTransactionalMutation(ctx).EntitlementPlan.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "entitlementplan"}, r.logger) + } + + if err := generated.EntitlementPlanEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &EntitlementPlanDeletePayload{ + DeletedID: id, + }, nil +} + +// EntitlementPlan is the resolver for the entitlementPlan field. +func (r *queryResolver) EntitlementPlan(ctx context.Context, id string) (*generated.EntitlementPlan, error) { + res, err := withTransactionalMutation(ctx).EntitlementPlan.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "entitlementplan"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/entitlementplan_test.go b/internal/graphapi/entitlementplan_test.go new file mode 100644 index 0000000..e4774ff --- /dev/null +++ b/internal/graphapi/entitlementplan_test.go @@ -0,0 +1,447 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/core/pkg/openlaneclient" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryEntitlementPlan() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + plan := (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + errorMsg string + }{ + { + name: "happy path", + queryID: plan.ID, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path, using api token", + queryID: plan.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + }, + { + name: "happy path, using personal access token", + queryID: plan.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "not found", + queryID: "notfound", + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.GetEntitlementPlanByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.queryID, resp.EntitlementPlan.ID) + assert.NotEmpty(t, resp.EntitlementPlan.Name) + assert.NotEmpty(t, resp.EntitlementPlan.Version) + assert.NotEmpty(t, resp.EntitlementPlan.Description) + assert.NotEmpty(t, resp.EntitlementPlan.DisplayName) + }) + } +} + +func (suite *GraphTestSuite) TestQueryEntitlementPlans() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + + otherUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + otherCtx, err := userContextWithID(otherUser.ID) + require.NoError(t, err) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedResults int + }{ + { + name: "happy path", + client: suite.client.api, + ctx: reqCtx, + expectedResults: 2, + }, + { + name: "happy path, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "happy path, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "another user, no plans should be returned", + client: suite.client.api, + ctx: otherCtx, + expectedResults: 0, + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetAllEntitlementPlans(tc.ctx) + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.EntitlementPlans.Edges, tc.expectedResults) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateEntitlementPlan() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + testCases := []struct { + name string + request openlaneclient.CreateEntitlementPlanInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, minimal input", + request: openlaneclient.CreateEntitlementPlanInput{ + Name: "test-plan", + Version: "v1", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, using api token", + request: openlaneclient.CreateEntitlementPlanInput{ + Name: "test-plan-with-api-token", + Version: "v1", + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, using personal access token", + request: openlaneclient.CreateEntitlementPlanInput{ + OwnerID: &testPersonalOrgID, + Name: "test-plan-with-pat", + Version: "v1", + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, all input", + request: openlaneclient.CreateEntitlementPlanInput{ + Name: "mitb", + Version: "v1", + DisplayName: lo.ToPtr("Matt is the Best"), + Description: lo.ToPtr("Matt is the best plan, hands down!"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "do not create if not allowed", + request: openlaneclient.CreateEntitlementPlanInput{ + Name: "test-plan", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: create on entitlementplan", + }, + { + name: "missing required field, version", + request: openlaneclient.CreateEntitlementPlanInput{ + Name: "Matt is the Best", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.CreateEntitlementPlan(tc.ctx, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.request.Name, resp.CreateEntitlementPlan.EntitlementPlan.Name) + assert.Equal(t, tc.request.Version, resp.CreateEntitlementPlan.EntitlementPlan.Version) + + if tc.request.Description == nil { + assert.Empty(t, resp.CreateEntitlementPlan.EntitlementPlan.Description) + } else { + assert.Equal(t, *tc.request.Description, *resp.CreateEntitlementPlan.EntitlementPlan.Description) + } + + // Display Name is set to the Name if not provided + if tc.request.DisplayName == nil { + assert.Equal(t, tc.request.Name, *resp.CreateEntitlementPlan.EntitlementPlan.DisplayName) + } else { + assert.Equal(t, *tc.request.DisplayName, *resp.CreateEntitlementPlan.EntitlementPlan.DisplayName) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateEntitlementPlan() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + plan := (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + request openlaneclient.UpdateEntitlementPlanInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, update display name", + request: openlaneclient.UpdateEntitlementPlanInput{ + DisplayName: lo.ToPtr("test-plan"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "update description, using api token", + request: openlaneclient.UpdateEntitlementPlanInput{ + Description: lo.ToPtr("To infinity and beyond!"), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "update description again, using personal access token", + request: openlaneclient.UpdateEntitlementPlanInput{ + Description: lo.ToPtr("To infinity and beyond, and beyond!"), + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "not allowed to update", + request: openlaneclient.UpdateEntitlementPlanInput{ + Description: lo.ToPtr("Howdy, partner!"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: update on entitlementplan", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.UpdateEntitlementPlan(tc.ctx, plan.ID, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + if tc.request.Description != nil { + assert.Equal(t, *tc.request.Description, *resp.UpdateEntitlementPlan.EntitlementPlan.Description) + } + + if tc.request.DisplayName != nil { + assert.Equal(t, *tc.request.DisplayName, *resp.UpdateEntitlementPlan.EntitlementPlan.DisplayName) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteEntitlementPlan() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + plan1 := (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + plan2 := (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + plan3 := (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: plan1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on entitlementplan", + }, + { + name: "happy path, delete plan", + idToDelete: plan1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "plan already deleted, not found", + idToDelete: plan1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "plan not found", + }, + { + name: "happy path, delete plan using api token", + idToDelete: plan2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete plan using personal access token", + idToDelete: plan3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown plan, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "plan not found", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization if plan exists + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.DeleteEntitlementPlan(tc.ctx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.idToDelete, resp.DeleteEntitlementPlan.DeletedID) + }) + } +} diff --git a/internal/graphapi/entitlementplanfeature.resolvers.go b/internal/graphapi/entitlementplanfeature.resolvers.go new file mode 100644 index 0000000..753bd5b --- /dev/null +++ b/internal/graphapi/entitlementplanfeature.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateEntitlementPlanFeature is the resolver for the createEntitlementPlanFeature field. +func (r *mutationResolver) CreateEntitlementPlanFeature(ctx context.Context, input generated.CreateEntitlementPlanFeatureInput) (*EntitlementPlanFeatureCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).EntitlementPlanFeature.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitlementplanfeature"}, r.logger) + } + + return &EntitlementPlanFeatureCreatePayload{ + EntitlementPlanFeature: res, + }, nil +} + +// CreateBulkEntitlementPlanFeature is the resolver for the createBulkEntitlementPlanFeature field. +func (r *mutationResolver) CreateBulkEntitlementPlanFeature(ctx context.Context, input []*generated.CreateEntitlementPlanFeatureInput) (*EntitlementPlanFeatureBulkCreatePayload, error) { + return r.bulkCreateEntitlementPlanFeature(ctx, input) +} + +// CreateBulkCSVEntitlementPlanFeature is the resolver for the createBulkCSVEntitlementPlanFeature field. +func (r *mutationResolver) CreateBulkCSVEntitlementPlanFeature(ctx context.Context, input graphql.Upload) (*EntitlementPlanFeatureBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateEntitlementPlanFeatureInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateEntitlementPlanFeature(ctx, data) +} + +// UpdateEntitlementPlanFeature is the resolver for the updateEntitlementPlanFeature field. +func (r *mutationResolver) UpdateEntitlementPlanFeature(ctx context.Context, id string, input generated.UpdateEntitlementPlanFeatureInput) (*EntitlementPlanFeatureUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).EntitlementPlanFeature.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitlementplanfeature"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitlementplanfeature"}, r.logger) + } + + return &EntitlementPlanFeatureUpdatePayload{ + EntitlementPlanFeature: res, + }, nil +} + +// DeleteEntitlementPlanFeature is the resolver for the deleteEntitlementPlanFeature field. +func (r *mutationResolver) DeleteEntitlementPlanFeature(ctx context.Context, id string) (*EntitlementPlanFeatureDeletePayload, error) { + if err := withTransactionalMutation(ctx).EntitlementPlanFeature.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "entitlementplanfeature"}, r.logger) + } + + if err := generated.EntitlementPlanFeatureEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &EntitlementPlanFeatureDeletePayload{ + DeletedID: id, + }, nil +} + +// EntitlementPlanFeature is the resolver for the entitlementPlanFeature field. +func (r *queryResolver) EntitlementPlanFeature(ctx context.Context, id string) (*generated.EntitlementPlanFeature, error) { + res, err := withTransactionalMutation(ctx).EntitlementPlanFeature.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "entitlementplanfeature"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/entitlementplanfeature_test.go b/internal/graphapi/entitlementplanfeature_test.go new file mode 100644 index 0000000..1e30161 --- /dev/null +++ b/internal/graphapi/entitlementplanfeature_test.go @@ -0,0 +1,470 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/core/pkg/openlaneclient" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryEntitlementPlanFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + planFeature := (&EntitlementPlanFeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + errorMsg string + }{ + { + name: "happy path", + queryID: planFeature.ID, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path, with api token", + queryID: planFeature.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + }, + { + name: "happy path, with pat", + queryID: planFeature.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "not found", + queryID: "notfound", + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.GetEntitlementPlanFeatureByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.queryID, resp.EntitlementPlanFeature.ID) + require.NotEmpty(t, resp.EntitlementPlanFeature.GetFeature()) + assert.Equal(t, planFeature.FeatureID, resp.EntitlementPlanFeature.Feature.ID) + require.NotEmpty(t, resp.EntitlementPlanFeature.GetPlan()) + assert.Equal(t, planFeature.PlanID, resp.EntitlementPlanFeature.Plan.ID) + require.NotEmpty(t, resp.EntitlementPlanFeature.GetMetadata()) + }) + } +} + +func (suite *GraphTestSuite) TestQueryEntitlementPlanFeatures() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&EntitlementPlanFeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&EntitlementPlanFeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + otherUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + otherCtx, err := userContextWithID(otherUser.ID) + require.NoError(t, err) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedResults int + }{ + { + name: "happy path", + client: suite.client.api, + ctx: reqCtx, + expectedResults: 2, + }, + { + name: "happy path, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "happy path, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "another user, no planFeatures should be returned", + client: suite.client.api, + ctx: otherCtx, + expectedResults: 0, + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetAllEntitlementPlanFeatures(tc.ctx) + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.EntitlementPlanFeatures.Edges, tc.expectedResults) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateEntitlementPlanFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // setup for creation of planFeature + plan := (&EntitlementPlanBuilder{client: suite.client}).MustNew(reqCtx, t) + feature1 := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + feature2 := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + feature3 := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + request openlaneclient.CreateEntitlementPlanFeatureInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, minimal input", + request: openlaneclient.CreateEntitlementPlanFeatureInput{ + PlanID: plan.ID, + FeatureID: feature1.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, all input using api token", + request: openlaneclient.CreateEntitlementPlanFeatureInput{ + PlanID: plan.ID, + FeatureID: feature2.ID, + Metadata: map[string]interface{}{ + "limit_type": "days", + "limit": "30", + }, + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, all input using personal access token", + request: openlaneclient.CreateEntitlementPlanFeatureInput{ + OwnerID: &testPersonalOrgID, + PlanID: plan.ID, + FeatureID: feature3.ID, + Metadata: map[string]interface{}{ + "limit_type": "days", + "limit": "30", + }, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "already exists", + request: openlaneclient.CreateEntitlementPlanFeatureInput{ + PlanID: plan.ID, + FeatureID: feature2.ID, + Metadata: map[string]interface{}{ + "limit_type": "days", + "limit": "30", + }, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "entitlementplanfeature already exists", + }, + { + name: "do not create if not allowed", + request: openlaneclient.CreateEntitlementPlanFeatureInput{ + PlanID: plan.ID, + FeatureID: feature3.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: create on entitlementplanfeature", + }, + { + name: "missing required field, feature", + request: openlaneclient.CreateEntitlementPlanFeatureInput{ + PlanID: plan.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + { + name: "missing required field, plan", + request: openlaneclient.CreateEntitlementPlanFeatureInput{ + FeatureID: feature1.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.CreateEntitlementPlanFeature(tc.ctx, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.request.PlanID, resp.CreateEntitlementPlanFeature.EntitlementPlanFeature.Plan.GetID()) + assert.Equal(t, tc.request.FeatureID, resp.CreateEntitlementPlanFeature.EntitlementPlanFeature.Feature.GetID()) + + if tc.request.Metadata != nil { + assert.Equal(t, tc.request.Metadata, resp.CreateEntitlementPlanFeature.EntitlementPlanFeature.Metadata) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateEntitlementPlanFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + planFeature := (&EntitlementPlanFeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + request openlaneclient.UpdateEntitlementPlanFeatureInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, update metadata", + request: openlaneclient.UpdateEntitlementPlanFeatureInput{ + Metadata: map[string]interface{}{ + "limit_type": "days", + "limit": "15", + }, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, update metadata using api token", + request: openlaneclient.UpdateEntitlementPlanFeatureInput{ + Metadata: map[string]interface{}{ + "limit_type": "days", + "limit": "16", + }, + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, update metadata using personal access token", + request: openlaneclient.UpdateEntitlementPlanFeatureInput{ + Metadata: map[string]interface{}{ + "limit_type": "days", + "limit": "77", + }, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "not allowed to update", + request: openlaneclient.UpdateEntitlementPlanFeatureInput{ + Metadata: map[string]interface{}{ + "limit_type": "days", + "limit": "65", + }}, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: update on entitlementplanfeature", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.UpdateEntitlementPlanFeature(tc.ctx, planFeature.ID, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.request.Metadata, resp.UpdateEntitlementPlanFeature.EntitlementPlanFeature.GetMetadata()) + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteEntitlementPlanFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + planFeature1 := (&EntitlementPlanFeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + planFeature2 := (&EntitlementPlanFeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + planFeature3 := (&EntitlementPlanFeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: planFeature1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on entitlementplanfeature", + }, + { + name: "happy path, delete plan feature", + idToDelete: planFeature1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "plan feature already deleted, not found", + idToDelete: planFeature1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entitlement_plan_feature not found", + }, + { + name: "happy path, delete plan feature using api token", + idToDelete: planFeature2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete plan feature using personal access token", + idToDelete: planFeature3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown plan feature, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entitlement_plan_feature not found", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization if planFeature exists + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.DeleteEntitlementPlanFeature(tc.ctx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.idToDelete, resp.DeleteEntitlementPlanFeature.DeletedID) + }) + } +} diff --git a/internal/graphapi/entity.resolvers.go b/internal/graphapi/entity.resolvers.go new file mode 100644 index 0000000..1e48ed6 --- /dev/null +++ b/internal/graphapi/entity.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateEntity is the resolver for the createEntity field. +func (r *mutationResolver) CreateEntity(ctx context.Context, input generated.CreateEntityInput) (*EntityCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Entity.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entity"}, r.logger) + } + + return &EntityCreatePayload{ + Entity: res, + }, nil +} + +// CreateBulkEntity is the resolver for the createBulkEntity field. +func (r *mutationResolver) CreateBulkEntity(ctx context.Context, input []*generated.CreateEntityInput) (*EntityBulkCreatePayload, error) { + return r.bulkCreateEntity(ctx, input) +} + +// CreateBulkCSVEntity is the resolver for the createBulkCSVEntity field. +func (r *mutationResolver) CreateBulkCSVEntity(ctx context.Context, input graphql.Upload) (*EntityBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateEntityInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateEntity(ctx, data) +} + +// UpdateEntity is the resolver for the updateEntity field. +func (r *mutationResolver) UpdateEntity(ctx context.Context, id string, input generated.UpdateEntityInput) (*EntityUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Entity.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entity"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags).AppendDomains(input.AppendDomains) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entity"}, r.logger) + } + + return &EntityUpdatePayload{ + Entity: res, + }, nil +} + +// DeleteEntity is the resolver for the deleteEntity field. +func (r *mutationResolver) DeleteEntity(ctx context.Context, id string) (*EntityDeletePayload, error) { + if err := withTransactionalMutation(ctx).Entity.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "entity"}, r.logger) + } + + if err := generated.EntityEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &EntityDeletePayload{ + DeletedID: id, + }, nil +} + +// Entity is the resolver for the entity field. +func (r *queryResolver) Entity(ctx context.Context, id string) (*generated.Entity, error) { + res, err := withTransactionalMutation(ctx).Entity.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "entity"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/entity_test.go b/internal/graphapi/entity_test.go new file mode 100644 index 0000000..798b653 --- /dev/null +++ b/internal/graphapi/entity_test.go @@ -0,0 +1,536 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryEntity() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entity := (&EntityBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expected *ent.Entity + errorMsg string + }{ + { + name: "happy path entity", + allowed: true, + queryID: entity.ID, + client: suite.client.api, + ctx: reqCtx, + expected: entity, + }, + { + name: "happy path entity, using api token", + allowed: true, + queryID: entity.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + expected: entity, + }, + { + name: "happy path entity, using personal access token", + allowed: true, + queryID: entity.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + expected: entity, + }, + { + name: "no access", + allowed: false, + queryID: entity.ID, + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not authorized", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.GetEntityByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Entity) + }) + } + + // delete created org and entity + (&EntityCleanup{client: suite.client, ID: entity.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestQueryEntities() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&EntityBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&EntityBuilder{client: suite.client}).MustNew(reqCtx, t) + + otherUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + otherCtx, err := userContextWithID(otherUser.ID) + require.NoError(t, err) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedResults int + }{ + { + name: "happy path", + client: suite.client.api, + ctx: reqCtx, + expectedResults: 2, + }, + { + name: "happy path, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "happy path, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "another user, no entities should be returned", + client: suite.client.api, + ctx: otherCtx, + expectedResults: 0, + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetAllEntities(tc.ctx) + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.Entities.Edges, tc.expectedResults) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateEntity() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + testCases := []struct { + name string + request openlaneclient.CreateEntityInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, minimal input", + request: openlaneclient.CreateEntityInput{ + Name: lo.ToPtr("fraser fir"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, all input", + request: openlaneclient.CreateEntityInput{ + Name: lo.ToPtr("mitb"), + DisplayName: lo.ToPtr("fraser fir"), + Description: lo.ToPtr("the pine trees of appalachia"), + Domains: []string{"https://appalachiatrees.com"}, + Status: lo.ToPtr("Onboarding"), + Note: &openlaneclient.CreateNoteInput{ + Text: "matt is the best", + OwnerID: &testOrgID, + }, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, using api token", + request: openlaneclient.CreateEntityInput{ + Name: lo.ToPtr("douglas fir"), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, using pat", + request: openlaneclient.CreateEntityInput{ + Name: lo.ToPtr("blue spruce"), + OwnerID: &testOrgID, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "do not create if not allowed", + request: openlaneclient.CreateEntityInput{ + Name: lo.ToPtr("test-entity"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: create on entity", + }, + { + name: "missing name, but display name provided", + request: openlaneclient.CreateEntityInput{ + DisplayName: lo.ToPtr("fraser firs"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "name already exists", + request: openlaneclient.CreateEntityInput{ + Name: lo.ToPtr("blue spruce"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "entity already exists", + }, + { + name: "invalid domain(s)", + request: openlaneclient.CreateEntityInput{ + Name: lo.ToPtr("stone pines"), + Domains: []string{"appalachiatrees"}, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "invalid or unparsable field: domains", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.CreateEntity(tc.ctx, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + // Name is set to the Display Name if not provided + if tc.request.Name == nil { + assert.Contains(t, *resp.CreateEntity.Entity.Name, *tc.request.DisplayName) + } else { + assert.Equal(t, *tc.request.Name, *resp.CreateEntity.Entity.Name) + } + + // Display Name is set to the Name if not provided + if tc.request.DisplayName == nil { + assert.Equal(t, *tc.request.Name, *resp.CreateEntity.Entity.DisplayName) + } else { + assert.Equal(t, *tc.request.DisplayName, *resp.CreateEntity.Entity.DisplayName) + } + + if tc.request.Description == nil { + assert.Empty(t, resp.CreateEntity.Entity.Description) + } else { + assert.Equal(t, *tc.request.Description, *resp.CreateEntity.Entity.Description) + } + + if tc.request.Domains != nil { + assert.Equal(t, tc.request.Domains, resp.CreateEntity.Entity.Domains) + } + + if tc.request.Status != nil { + assert.Equal(t, tc.request.Status, resp.CreateEntity.Entity.Status) + } else { + // default status is active + assert.Equal(t, "active", *resp.CreateEntity.Entity.Status) + } + + if tc.request.Note != nil { + require.Len(t, resp.CreateEntity.Entity.Notes, 1) + assert.Equal(t, tc.request.Note.Text, resp.CreateEntity.Entity.Notes[0].Text) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateEntity() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entity := (&EntityBuilder{client: suite.client}).MustNew(reqCtx, t) + numNotes := 0 + numDomains := 0 + + testCases := []struct { + name string + request openlaneclient.UpdateEntityInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, update display name", + request: openlaneclient.UpdateEntityInput{ + DisplayName: lo.ToPtr("blue spruce"), + Note: &openlaneclient.CreateNoteInput{ + Text: "the pine tree with blue-green colored needles", + }, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "update description using api token", + request: openlaneclient.UpdateEntityInput{ + Description: lo.ToPtr("the pine tree with blue-green colored needles"), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "update notes, domains using personal access token", + request: openlaneclient.UpdateEntityInput{ + Note: &openlaneclient.CreateNoteInput{ + Text: "the pine tree with blue-green colored needles", + }, + Domains: []string{"https://appalachiatrees.com"}, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "update status and domain", + request: openlaneclient.UpdateEntityInput{ + Status: lo.ToPtr("Onboarding"), + AppendDomains: []string{"example.com"}, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "not allowed to update", + request: openlaneclient.UpdateEntityInput{ + Description: lo.ToPtr("pine trees of the west"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: update on entity", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.UpdateEntity(tc.ctx, entity.ID, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + if tc.request.Description != nil { + assert.Equal(t, *tc.request.Description, *resp.UpdateEntity.Entity.Description) + } + + if tc.request.DisplayName != nil { + assert.Equal(t, *tc.request.DisplayName, *resp.UpdateEntity.Entity.DisplayName) + } + + if tc.request.Status != nil { + assert.Equal(t, *tc.request.Status, *resp.UpdateEntity.Entity.Status) + } + + if tc.request.Domains != nil { + numDomains++ + assert.Contains(t, resp.UpdateEntity.Entity.Domains, tc.request.Domains[0]) + assert.Len(t, resp.UpdateEntity.Entity.Domains, numDomains) + } + + if tc.request.AppendDomains != nil { + numDomains++ + assert.Contains(t, resp.UpdateEntity.Entity.Domains, tc.request.AppendDomains[0]) + assert.Len(t, resp.UpdateEntity.Entity.Domains, numDomains) + } + + if tc.request.Note != nil { + numNotes++ + require.Len(t, resp.UpdateEntity.Entity.Notes, numNotes) + assert.Equal(t, tc.request.Note.Text, resp.UpdateEntity.Entity.Notes[0].Text) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteEntity() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entity1 := (&EntityBuilder{client: suite.client}).MustNew(reqCtx, t) + entity2 := (&EntityBuilder{client: suite.client}).MustNew(reqCtx, t) + entity3 := (&EntityBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: entity1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on entity", + }, + { + name: "happy path, delete entity", + idToDelete: entity1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "entity already deleted, not found", + idToDelete: entity1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entity not found", + }, + { + name: "happy path, delete entity using api token", + idToDelete: entity2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete entity using personal access token", + idToDelete: entity3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown entity, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entity not found", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization if entity exists + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.DeleteEntity(tc.ctx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.idToDelete, resp.DeleteEntity.DeletedID) + }) + } +} diff --git a/internal/graphapi/entityextended.resolvers.go b/internal/graphapi/entityextended.resolvers.go new file mode 100644 index 0000000..8fb52de --- /dev/null +++ b/internal/graphapi/entityextended.resolvers.go @@ -0,0 +1,67 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/utils/rout" +) + +// Note is the resolver for the Note field. +func (r *createEntityInputResolver) Note(ctx context.Context, obj *generated.CreateEntityInput, data *generated.CreateNoteInput) error { + c := withTransactionalMutation(ctx) + + note, err := c.Note.Create().SetInput(*data).Save(ctx) + if err != nil { + return err + } + + obj.NoteIDs = []string{note.ID} + + return nil +} + +// Note is the resolver for the Note field. +func (r *updateEntityInputResolver) Note(ctx context.Context, obj *generated.UpdateEntityInput, data *generated.CreateNoteInput) error { + // get the organization id from the context and if not found, get it from the entity + // this should only happen when a personal access token is used to authenticate + ownerID, err := auth.GetOrganizationIDFromContext(ctx) + if err != nil || ownerID == "" { + // get the entity id from the context + gtx := graphql.GetOperationContext(ctx) + id, ok := gtx.Variables["updateEntityId"] + if !ok { + return rout.NewMissingRequiredFieldError("entity id") + } + + // get the entity in order to set the organization in the auth context + res, err := withTransactionalMutation(ctx).Entity.Get(ctx, id.(string)) + if err != nil { + return parseRequestError(err, action{action: ActionUpdate, object: "entity"}, r.logger) + } + + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return ErrPermissionDenied + } + } + + c := withTransactionalMutation(ctx) + + note, err := c.Note.Create().SetInput(*data).Save(ctx) + if err != nil { + return err + } + + obj.AddNoteIDs = []string{note.ID} + + return nil +} diff --git a/internal/graphapi/entitytype.resolvers.go b/internal/graphapi/entitytype.resolvers.go new file mode 100644 index 0000000..5c25000 --- /dev/null +++ b/internal/graphapi/entitytype.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateEntityType is the resolver for the createEntityType field. +func (r *mutationResolver) CreateEntityType(ctx context.Context, input generated.CreateEntityTypeInput) (*EntityTypeCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).EntityType.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "entitytype"}, r.logger) + } + + return &EntityTypeCreatePayload{ + EntityType: res, + }, nil +} + +// CreateBulkEntityType is the resolver for the createBulkEntityType field. +func (r *mutationResolver) CreateBulkEntityType(ctx context.Context, input []*generated.CreateEntityTypeInput) (*EntityTypeBulkCreatePayload, error) { + return r.bulkCreateEntityType(ctx, input) +} + +// CreateBulkCSVEntityType is the resolver for the createBulkCSVEntityType field. +func (r *mutationResolver) CreateBulkCSVEntityType(ctx context.Context, input graphql.Upload) (*EntityTypeBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateEntityTypeInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateEntityType(ctx, data) +} + +// UpdateEntityType is the resolver for the updateEntityType field. +func (r *mutationResolver) UpdateEntityType(ctx context.Context, id string, input generated.UpdateEntityTypeInput) (*EntityTypeUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).EntityType.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitytype"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "entitytype"}, r.logger) + } + + return &EntityTypeUpdatePayload{ + EntityType: res, + }, nil +} + +// DeleteEntityType is the resolver for the deleteEntityType field. +func (r *mutationResolver) DeleteEntityType(ctx context.Context, id string) (*EntityTypeDeletePayload, error) { + if err := withTransactionalMutation(ctx).EntityType.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "entitytype"}, r.logger) + } + + if err := generated.EntityTypeEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &EntityTypeDeletePayload{ + DeletedID: id, + }, nil +} + +// EntityType is the resolver for the entityType field. +func (r *queryResolver) EntityType(ctx context.Context, id string) (*generated.EntityType, error) { + res, err := withTransactionalMutation(ctx).EntityType.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "entitytype"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/entitytype_test.go b/internal/graphapi/entitytype_test.go new file mode 100644 index 0000000..f44cf46 --- /dev/null +++ b/internal/graphapi/entitytype_test.go @@ -0,0 +1,416 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryEntityType() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entityType := (&EntityTypeBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expected *ent.EntityType + errorMsg string + }{ + { + name: "happy path entity type", + client: suite.client.api, + ctx: reqCtx, + allowed: true, + queryID: entityType.ID, + expected: entityType, + }, + { + name: "happy path entity type, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + queryID: entityType.ID, + expected: entityType, + }, + { + name: "happy path entity type, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + queryID: entityType.ID, + expected: entityType, + }, + { + name: "no access", + client: suite.client.api, + ctx: reqCtx, + allowed: false, + queryID: entityType.ID, + errorMsg: "not authorized", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.GetEntityTypeByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.EntityType) + }) + } + + // delete created org and entityType + (&EntityTypeCleanup{client: suite.client, ID: entityType.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestQueryEntityTypes() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&EntityTypeBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&EntityTypeBuilder{client: suite.client}).MustNew(reqCtx, t) + + otherUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + otherCtx, err := userContextWithID(otherUser.ID) + require.NoError(t, err) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedResults int + }{ + { + name: "happy path", + client: suite.client.api, + ctx: reqCtx, + expectedResults: 3, // 1 is created in the setup + }, + { + name: "happy path, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + expectedResults: 3, // 1 is created in the setup + }, + { + name: "happy path, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + expectedResults: 3, // 1 is created in the setup + }, + { + name: "another user, no entities should be returned", + client: suite.client.api, + ctx: otherCtx, + expectedResults: 0, + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetAllEntityTypes(tc.ctx) + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.EntityTypes.Edges, tc.expectedResults) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateEntityType() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + testCases := []struct { + name string + request openlaneclient.CreateEntityTypeInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, all input", + request: openlaneclient.CreateEntityTypeInput{ + Name: "cats", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, all input, using api token", + request: openlaneclient.CreateEntityTypeInput{ + Name: "horses", + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, all input, using pat", + request: openlaneclient.CreateEntityTypeInput{ + OwnerID: &testOrgID, + Name: "bunnies", + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "do not create if not allowed", + request: openlaneclient.CreateEntityTypeInput{ + Name: "dogs", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: create on entitytype", + }, + { + name: "missing required field, name", + request: openlaneclient.CreateEntityTypeInput{}, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.CreateEntityType(tc.ctx, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.request.Name, resp.CreateEntityType.EntityType.Name) + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateEntityType() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entityType := (&EntityTypeBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + request openlaneclient.UpdateEntityTypeInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, update name", + request: openlaneclient.UpdateEntityTypeInput{ + Name: lo.ToPtr("maine coons"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, update name using api token", + request: openlaneclient.UpdateEntityTypeInput{ + Name: lo.ToPtr("sphynx"), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, update name using personal access token", + request: openlaneclient.UpdateEntityTypeInput{ + Name: lo.ToPtr("persian"), + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "not allowed to update", + request: openlaneclient.UpdateEntityTypeInput{ + Name: lo.ToPtr("dogs"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: update on entitytype", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.UpdateEntityType(tc.ctx, entityType.ID, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, *tc.request.Name, resp.UpdateEntityType.EntityType.Name) + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteEntityType() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + entityType1 := (&EntityTypeBuilder{client: suite.client}).MustNew(reqCtx, t) + entityType2 := (&EntityTypeBuilder{client: suite.client}).MustNew(reqCtx, t) + entityType3 := (&EntityTypeBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: entityType1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on entitytype", + }, + { + name: "happy path, delete entity type", + idToDelete: entityType1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "entityType already deleted, not found", + idToDelete: entityType1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entity_type not found", + }, + { + name: "happy path, delete entity type using api token", + idToDelete: entityType2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete entity type using pat", + idToDelete: entityType3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown entitytype, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "entity_type not found", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization if entityType exists + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.DeleteEntityType(tc.ctx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.idToDelete, resp.DeleteEntityType.DeletedID) + }) + } +} diff --git a/internal/graphapi/errors.go b/internal/graphapi/errors.go new file mode 100644 index 0000000..4087471 --- /dev/null +++ b/internal/graphapi/errors.go @@ -0,0 +1,137 @@ +package graphapi + +import ( + "errors" + "fmt" + "strings" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/utils/rout" + "go.uber.org/zap" +) + +var ( + // ErrInternalServerError is returned when an internal error occurs. + ErrInternalServerError = errors.New("internal server error") + + // ErrPermissionDenied is returned when the user is not authorized to perform the requested query or mutation + ErrPermissionDenied = errors.New("you are not authorized to perform this action") + + // ErrCascadeDelete is returned when an error occurs while performing cascade deletes on associated objects + ErrCascadeDelete = errors.New("error deleting associated objects") + + // ErrSubscriberNotFound is returned when a subscriber is not found + ErrSubscriberNotFound = errors.New("subscriber not found") + + // ErrSearchFailed is returned when the search operation fails + ErrSearchFailed = errors.New("search failed, please try again") +) + +// PermissionDeniedError is returned when user is not authorized to perform the requested query or mutation +type PermissionDeniedError struct { + Action string + ObjectType string +} + +// Error returns the PermissionDeniedError in string format +func (e *PermissionDeniedError) Error() string { + return fmt.Sprintf("you are not authorized to perform this action: %s on %s", e.Action, e.ObjectType) +} + +// newPermissionDeniedError returns a PermissionDeniedError +func newPermissionDeniedError(a string, o string) *PermissionDeniedError { + return &PermissionDeniedError{ + Action: a, + ObjectType: o, + } +} + +func newCascadeDeleteError(err error) error { + return fmt.Errorf("%w: %v", ErrCascadeDelete, err) +} + +// AlreadyExistsError is returned when an object already exists +type AlreadyExistsError struct { + ObjectType string +} + +// Error returns the AlreadyExistsError in string format +func (e *AlreadyExistsError) Error() string { + return fmt.Sprintf("%s already exists", e.ObjectType) +} + +// newAlreadyExistsError returns a AlreadyExistsError +func newAlreadyExistsError(o string) *AlreadyExistsError { + return &AlreadyExistsError{ + ObjectType: o, + } +} + +type action struct { + object string + action string +} + +// ForeignKeyError is returned when an object does not exist in the related table +type ForeignKeyError struct { + Action string + ObjectType string +} + +// Error returns the ForeignKeyError in string format +func (e *ForeignKeyError) Error() string { + return fmt.Sprintf("constraint failed, unable to complete the action '%s' because the record '%s' does not exist. please try again", e.Action, e.ObjectType) +} + +// newForeignKeyError returns a ForeignKeyError +func newForeignKeyError(action, objecttype string) *ForeignKeyError { + return &ForeignKeyError{ + Action: action, + ObjectType: objecttype, + } +} + +// parseRequestError logs and parses the error and returns the appropriate error type for the client +// TODO: cleanup return error messages +func parseRequestError(err error, a action, logger *zap.SugaredLogger) error { + // log the error for debugging + logger.Errorw("error processing request", "action", a.action, "object", a.object, "error", err) + + switch { + case generated.IsValidationError(err): + validationError := err.(*generated.ValidationError) + + logger.Debugw("validation error", "field", validationError.Name, "error", validationError.Error()) + + return validationError + case generated.IsConstraintError(err): + constraintError := err.(*generated.ConstraintError) + + logger.Debugw("constraint error", "error", constraintError.Error()) + + // Check for unique (or UNIQUE in sqlite) constraint error + if strings.Contains(strings.ToLower(constraintError.Error()), "unique") { + return newAlreadyExistsError(a.object) + } + + // Check for foreign key constraint error + if rout.IsForeignKeyConstraintError(constraintError) { + return newForeignKeyError(a.action, a.object) + } + + return constraintError + case generated.IsNotFound(err): + logger.Debugw("not found", "error", err.Error()) + + return err + case errors.Is(err, privacy.Deny): + logger.Debugw("permission denied", "error", err.Error()) + + return newPermissionDeniedError(a.action, a.object) + default: + logger.Errorw("unexpected error", "error", err.Error()) + + return err + } +} diff --git a/internal/graphapi/event.resolvers.go b/internal/graphapi/event.resolvers.go new file mode 100644 index 0000000..d9ddab0 --- /dev/null +++ b/internal/graphapi/event.resolvers.go @@ -0,0 +1,142 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + "errors" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" +) + +// CreateEvent is the resolver for the createEvent field +func (r *mutationResolver) CreateEvent(ctx context.Context, input generated.CreateEventInput) (*EventCreatePayload, error) { + t, err := withTransactionalMutation(ctx).Event.Create().SetInput(input).Save(ctx) + if err != nil { + if generated.IsValidationError(err) { + validationError := err.(*generated.ValidationError) + + r.logger.Debugw("validation error", "field", validationError.Name, "error", validationError.Error()) + + return nil, validationError + } + + if generated.IsConstraintError(err) { + constraintError := err.(*generated.ConstraintError) + + r.logger.Debugw("constraint error", "error", constraintError.Error()) + + return nil, constraintError + } + + if errors.Is(err, privacy.Deny) { + return nil, newPermissionDeniedError(ActionCreate, "event") + } + + r.logger.Errorw("failed to create event", "error", err) + + return nil, err + } + + return &EventCreatePayload{Event: t}, nil +} + +// CreateBulkEvent is the resolver for the createBulkEvent field. +func (r *mutationResolver) CreateBulkEvent(ctx context.Context, input []*generated.CreateEventInput) (*EventBulkCreatePayload, error) { + return r.bulkCreateEvent(ctx, input) +} + +// CreateBulkCSVEvent is the resolver for the createBulkCSVEvent field. +func (r *mutationResolver) CreateBulkCSVEvent(ctx context.Context, input graphql.Upload) (*EventBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateEventInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateEvent(ctx, data) +} + +// UpdateEvent is the resolver for the updateEvent field +func (r *mutationResolver) UpdateEvent(ctx context.Context, id string, input generated.UpdateEventInput) (*EventUpdatePayload, error) { + event, err := withTransactionalMutation(ctx).Event.Get(ctx, id) + if err != nil { + if generated.IsNotFound(err) { + return nil, err + } + + if errors.Is(err, privacy.Deny) { + r.logger.Errorw("failed to get event on update", "error", err) + + return nil, newPermissionDeniedError(ActionGet, "event") + } + + r.logger.Errorw("failed to get event", "error", err) + return nil, ErrInternalServerError + } + + event, err = event.Update().SetInput(input).Save(ctx) + if err != nil { + if generated.IsValidationError(err) { + return nil, err + } + + if errors.Is(err, privacy.Deny) { + r.logger.Errorw("failed to update event", "error", err) + + return nil, newPermissionDeniedError(ActionUpdate, "event") + } + + r.logger.Errorw("failed to update event", "error", err) + return nil, ErrInternalServerError + } + + return &EventUpdatePayload{Event: event}, nil +} + +// DeleteEvent is the resolver for the deleteEvent field +func (r *mutationResolver) DeleteEvent(ctx context.Context, id string) (*EventDeletePayload, error) { + if err := withTransactionalMutation(ctx).Event.DeleteOneID(id).Exec(ctx); err != nil { + if generated.IsNotFound(err) { + return nil, err + } + + if errors.Is(err, privacy.Deny) { + return nil, newPermissionDeniedError(ActionDelete, "event") + } + + r.logger.Errorw("failed to delete event", "error", err) + return nil, err + } + + if err := generated.EventEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &EventDeletePayload{DeletedID: id}, nil +} + +// Event is the resolver for the event field +func (r *queryResolver) Event(ctx context.Context, id string) (*generated.Event, error) { + event, err := withTransactionalMutation(ctx).Event.Get(ctx, id) + if err != nil { + r.logger.Errorw("failed to get event", "error", err) + + if generated.IsNotFound(err) { + return nil, err + } + + if errors.Is(err, privacy.Deny) { + return nil, newPermissionDeniedError(ActionGet, "event") + } + + return nil, ErrInternalServerError + } + + return event, nil +} diff --git a/internal/graphapi/extensions.go b/internal/graphapi/extensions.go new file mode 100644 index 0000000..b20ad55 --- /dev/null +++ b/internal/graphapi/extensions.go @@ -0,0 +1,139 @@ +package graphapi + +import ( + "context" + "time" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/handler" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/sessions" + echo "github.com/theopenlane/echox" +) + +const ( + // AuthExtensionKey is the key used to store the auth data in the extensions map + AuthExtensionKey = "auth" + // ServerLatencyExtensionKey is the key used to store the server latency in the extensions map + ServerLatencyExtensionKey = "server_latency" + // TraceExtensionKey is the key used to store the trace id in the extensions map + TraceExtensionKey = "trace_id" +) + +// Auth contains the authentication data to be added to the extensions map +type Auth struct { + // AuthenticationType is the type of authentication used, e.g. JWT, API key, etc. + AuthenticationType auth.AuthenticationType `json:"authentication_type,omitempty"` + // AuthorizedOrganization is the organization ID of the authenticated user + AuthorizedOrganization string `json:"authorized_organization,omitempty"` + // AccessToken is the access token used for authentication, if the user did an action (e.g. created a new organization) + // that updated the access token, this will be the new access token + AccessToken string `json:"access_token,omitempty"` + // RefreshToken is the refresh token used for authentication, if the user did an action (e.g. created a new organization) + // that updated the refresh token, this will be the new refresh token + RefreshToken string `json:"refresh_token,omitempty"` + // SessionID is the session token used for authentication + SessionID string `json:"session_id,omitempty"` +} + +// AddAllExtensions adds all the extensions to the server including auth, latency and trace +func AddAllExtensions(h *handler.Server) { + // add the auth extension + authExtension(h) + // add the latency extension + latencyExtension(h) + // add the trace extension + traceExtension(h) +} + +// authExtension adds the auth data to the extensions map in the response +func authExtension(h *handler.Server) { + h.AroundResponses(func(ctx context.Context, next graphql.ResponseHandler) *graphql.Response { + resp := next(ctx) + + resp = initExtensionResponse(resp) + + resp.Extensions[AuthExtensionKey] = getAuthData(ctx) + + return resp + }) +} + +// latencyExtension adds the server latency to the extensions map in the response +func latencyExtension(h *handler.Server) { + h.AroundResponses(func(ctx context.Context, next graphql.ResponseHandler) *graphql.Response { + start := time.Now() + resp := next(ctx) + latency := time.Since(start).String() + + resp = initExtensionResponse(resp) + + resp.Extensions[ServerLatencyExtensionKey] = latency + + return resp + }) +} + +// traceExtension adds the trace id to the extensions map in the response +func traceExtension(h *handler.Server) { + h.AroundResponses(func(ctx context.Context, next graphql.ResponseHandler) *graphql.Response { + resp := next(ctx) + + traceID := getRequestID(ctx) + + resp = initExtensionResponse(resp) + + resp.Extensions[TraceExtensionKey] = traceID + + return resp + }) +} + +// initExtensionResponse initializes the extensions map in the response to avoid nil pointer panics +func initExtensionResponse(resp *graphql.Response) *graphql.Response { + if resp.Extensions == nil { + resp.Extensions = make(map[string]interface{}) + } + + return resp +} + +// getRequestID retrieves the trace request id from the context +// if the echo context is not available an empty string is returned +func getRequestID(ctx context.Context) string { + c, err := echocontext.EchoContextFromContext(ctx) + if err != nil { + return "" + } + + requestID := c.Request().Header.Get(echo.HeaderXRequestID) // request-id generated by reverse-proxy + if requestID == "" { + // missed request-id from proxy, got generated one by middleware.RequestID() + requestID = c.Response().Header().Get(echo.HeaderXRequestID) + } + + return requestID +} + +// getAuthData retrieves the auth data from the context if available +// all errors are ignored because the auth data is optional +func getAuthData(ctx context.Context) Auth { + ac, _ := auth.GetAuthenticatedUserContext(ctx) + if ac == nil { + // return early to prevent nil pointer panics + return Auth{} + } + + at, _ := auth.GetAccessTokenContext(ctx) + rt, _ := auth.GetRefreshTokenContext(ctx) + session, _ := sessions.SessionToken(ctx) + + return Auth{ + AuthenticationType: ac.AuthenticationType, + AuthorizedOrganization: ac.OrganizationID, + AccessToken: at, + RefreshToken: rt, + SessionID: session, + } +} diff --git a/internal/graphapi/feature.resolvers.go b/internal/graphapi/feature.resolvers.go new file mode 100644 index 0000000..5d6a8eb --- /dev/null +++ b/internal/graphapi/feature.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateFeature is the resolver for the createFeature field. +func (r *mutationResolver) CreateFeature(ctx context.Context, input generated.CreateFeatureInput) (*FeatureCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Feature.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "feature"}, r.logger) + } + + return &FeatureCreatePayload{ + Feature: res, + }, nil +} + +// CreateBulkFeature is the resolver for the createBulkFeature field. +func (r *mutationResolver) CreateBulkFeature(ctx context.Context, input []*generated.CreateFeatureInput) (*FeatureBulkCreatePayload, error) { + return r.bulkCreateFeature(ctx, input) +} + +// CreateBulkCSVFeature is the resolver for the createBulkCSVFeature field. +func (r *mutationResolver) CreateBulkCSVFeature(ctx context.Context, input graphql.Upload) (*FeatureBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateFeatureInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateFeature(ctx, data) +} + +// UpdateFeature is the resolver for the updateFeature field. +func (r *mutationResolver) UpdateFeature(ctx context.Context, id string, input generated.UpdateFeatureInput) (*FeatureUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Feature.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "feature"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "feature"}, r.logger) + } + + return &FeatureUpdatePayload{ + Feature: res, + }, nil +} + +// DeleteFeature is the resolver for the deleteFeature field. +func (r *mutationResolver) DeleteFeature(ctx context.Context, id string) (*FeatureDeletePayload, error) { + if err := withTransactionalMutation(ctx).Feature.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "feature"}, r.logger) + } + + if err := generated.FeatureEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &FeatureDeletePayload{ + DeletedID: id, + }, nil +} + +// Feature is the resolver for the feature field. +func (r *queryResolver) Feature(ctx context.Context, id string) (*generated.Feature, error) { + res, err := withTransactionalMutation(ctx).Feature.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "feature"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/feature_test.go b/internal/graphapi/feature_test.go new file mode 100644 index 0000000..a949693 --- /dev/null +++ b/internal/graphapi/feature_test.go @@ -0,0 +1,453 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/core/pkg/openlaneclient" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + feature := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + errorMsg string + }{ + { + name: "happy path", + queryID: feature.ID, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path using api token", + queryID: feature.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + }, + { + name: "happy path using personal access token", + queryID: feature.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "not found", + queryID: "notfound", + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.GetFeatureByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.queryID, resp.Feature.ID) + assert.NotEmpty(t, resp.Feature.Name) + assert.NotEmpty(t, resp.Feature.Description) + assert.NotEmpty(t, resp.Feature.DisplayName) + }) + } +} + +func (suite *GraphTestSuite) TestQueryFeatures() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + otherUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + otherCtx, err := userContextWithID(otherUser.ID) + require.NoError(t, err) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedResults int + }{ + { + name: "happy path", + client: suite.client.api, + ctx: reqCtx, + expectedResults: 2, + }, + { + name: "happy path, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "happy path, using pat", + client: suite.client.apiWithPAT, + ctx: context.Background(), + expectedResults: 2, + }, + { + name: "another user, no features should be returned", + client: suite.client.api, + ctx: otherCtx, + expectedResults: 0, + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetAllFeatures(tc.ctx) + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.Features.Edges, tc.expectedResults) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + testCases := []struct { + name string + request openlaneclient.CreateFeatureInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, minimal input", + request: openlaneclient.CreateFeatureInput{ + Name: "test-feature", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "happy path, using api token", + request: openlaneclient.CreateFeatureInput{ + OwnerID: &testOrgID, + Name: "meows", + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, using pat", + request: openlaneclient.CreateFeatureInput{ + OwnerID: &testOrgID, + Name: "woofs", + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "happy path, all input", + request: openlaneclient.CreateFeatureInput{ + Name: "mitb", + DisplayName: lo.ToPtr("Matt is the Best"), + Enabled: lo.ToPtr(true), + Description: lo.ToPtr("Matt is the best feature, hands down!"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "do not create if not allowed", + request: openlaneclient.CreateFeatureInput{ + Name: "test-feature", + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: create on feature", + }, + { + name: "missing required field", + request: openlaneclient.CreateFeatureInput{ + DisplayName: lo.ToPtr("Matt is the Best"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedErr: "value is less than the required length", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.CreateFeature(tc.ctx, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Equal(t, tc.request.Name, resp.CreateFeature.Feature.Name) + + if tc.request.Enabled == nil { + assert.False(t, resp.CreateFeature.Feature.Enabled) + } else { + assert.Equal(t, *tc.request.Enabled, resp.CreateFeature.Feature.Enabled) + } + + if tc.request.Description == nil { + assert.Nil(t, resp.CreateFeature.Feature.Description) + } else { + assert.Equal(t, *tc.request.Description, *resp.CreateFeature.Feature.Description) + } + + // Display Name is set to the Name if not provided + if tc.request.DisplayName == nil { + assert.Equal(t, tc.request.Name, *resp.CreateFeature.Feature.DisplayName) + } else { + assert.Equal(t, *tc.request.DisplayName, *resp.CreateFeature.Feature.DisplayName) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + feature := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + request openlaneclient.UpdateFeatureInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedErr string + }{ + { + name: "happy path, update display name", + request: openlaneclient.UpdateFeatureInput{ + DisplayName: lo.ToPtr("test-feature"), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + }, + { + name: "enable feature using api token", + request: openlaneclient.UpdateFeatureInput{ + Enabled: lo.ToPtr(true), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + }, + { + name: "update description using pat", + request: openlaneclient.UpdateFeatureInput{ + Description: lo.ToPtr("To infinity and beyond!"), + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + }, + { + name: "not allowed to update", + request: openlaneclient.UpdateFeatureInput{ + Enabled: lo.ToPtr(false), + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedErr: "you are not authorized to perform this action: update on feature", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + resp, err := tc.client.UpdateFeature(tc.ctx, feature.ID, tc.request) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + if tc.request.Description != nil { + assert.Equal(t, *tc.request.Description, *resp.UpdateFeature.Feature.Description) + } + + if tc.request.DisplayName != nil { + assert.Equal(t, *tc.request.DisplayName, *resp.UpdateFeature.Feature.DisplayName) + } + + if tc.request.Enabled != nil { + assert.Equal(t, *tc.request.Enabled, resp.UpdateFeature.Feature.Enabled) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteFeature() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + feature1 := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + feature2 := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + feature3 := (&FeatureBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: feature1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on feature", + }, + { + name: "happy path, delete feature", + idToDelete: feature1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "feature already deleted, not found", + idToDelete: feature1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "feature not found", + }, + { + name: "happy path, delete feature using api token", + idToDelete: feature2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete feature using pat", + idToDelete: feature3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown feature, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "feature not found", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check for edit permissions on the organization if feature exists + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.DeleteFeature(tc.ctx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + assert.Equal(t, tc.idToDelete, resp.DeleteFeature.DeletedID) + }) + } +} diff --git a/internal/graphapi/file.resolvers.go b/internal/graphapi/file.resolvers.go new file mode 100644 index 0000000..e42cfe9 --- /dev/null +++ b/internal/graphapi/file.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateFile is the resolver for the createFile field. +func (r *mutationResolver) CreateFile(ctx context.Context, input generated.CreateFileInput) (*FileCreatePayload, error) { + res, err := withTransactionalMutation(ctx).File.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "file"}, r.logger) + } + + return &FileCreatePayload{ + File: res, + }, nil +} + +// CreateBulkFile is the resolver for the createBulkFile field. +func (r *mutationResolver) CreateBulkFile(ctx context.Context, input []*generated.CreateFileInput) (*FileBulkCreatePayload, error) { + return r.bulkCreateFile(ctx, input) +} + +// CreateBulkCSVFile is the resolver for the createBulkCSVFile field. +func (r *mutationResolver) CreateBulkCSVFile(ctx context.Context, input graphql.Upload) (*FileBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateFileInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateFile(ctx, data) +} + +// UpdateFile is the resolver for the updateFile field. +func (r *mutationResolver) UpdateFile(ctx context.Context, id string, input generated.UpdateFileInput) (*FileUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).File.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "file"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "file"}, r.logger) + } + + return &FileUpdatePayload{ + File: res, + }, nil +} + +// DeleteFile is the resolver for the deleteFile field. +func (r *mutationResolver) DeleteFile(ctx context.Context, id string) (*FileDeletePayload, error) { + if err := withTransactionalMutation(ctx).File.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "file"}, r.logger) + } + + if err := generated.FileEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &FileDeletePayload{ + DeletedID: id, + }, nil +} + +// File is the resolver for the file field. +func (r *queryResolver) File(ctx context.Context, id string) (*generated.File, error) { + res, err := withTransactionalMutation(ctx).File.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "file"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/gen_models.go b/internal/graphapi/gen_models.go new file mode 100644 index 0000000..5c8aaf3 --- /dev/null +++ b/internal/graphapi/gen_models.go @@ -0,0 +1,759 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package graphapi + +import ( + "time" + + "entgo.io/contrib/entgql" + "github.com/theopenlane/core/internal/ent/generated" +) + +type GlobalSearchResult interface { + IsGlobalSearchResult() +} + +// Return response for createBulkAPIToken mutation +type APITokenBulkCreatePayload struct { + // Created apiTokens + APITokens []*generated.APIToken `json:"apiTokens,omitempty"` +} + +// Return response for createAPIToken mutation +type APITokenCreatePayload struct { + // Created apiToken + APIToken *generated.APIToken `json:"apiToken"` +} + +// Return response for deleteAPIToken mutation +type APITokenDeletePayload struct { + // Deleted apiToken ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateAPIToken mutation +type APITokenUpdatePayload struct { + // Updated apiToken + APIToken *generated.APIToken `json:"apiToken"` +} + +type AuditLog struct { + Table *string `json:"table,omitempty"` + Time *time.Time `json:"time,omitempty"` + ID string `json:"id"` + Operation *string `json:"operation,omitempty"` + Changes []string `json:"changes,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` +} + +func (AuditLog) IsNode() {} + +// A connection to a list of items. +type AuditLogConnection struct { + // A list of edges. + Edges []*AuditLogEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *entgql.PageInfo[string] `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int `json:"totalCount"` +} + +// An edge in a connection. +type AuditLogEdge struct { + // The item at the end of the edge. + Node *AuditLog `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor entgql.Cursor[string] `json:"cursor"` +} + +type AuditLogWhereInput struct { + RefID *string `json:"refID,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + Operation *string `json:"operation,omitempty"` + Table *string `json:"table,omitempty"` + Before *time.Time `json:"before,omitempty"` + After *time.Time `json:"after,omitempty"` +} + +// Return response for createBulkContact mutation +type ContactBulkCreatePayload struct { + // Created contacts + Contacts []*generated.Contact `json:"contacts,omitempty"` +} + +// Return response for createContact mutation +type ContactCreatePayload struct { + // Created contact + Contact *generated.Contact `json:"contact"` +} + +// Return response for deleteContact mutation +type ContactDeletePayload struct { + // Deleted contact ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateContact mutation +type ContactUpdatePayload struct { + // Updated contact + Contact *generated.Contact `json:"contact"` +} + +// Return response for createBulkDocumentData mutation +type DocumentDataBulkCreatePayload struct { + // Created documentData + DocumentData []*generated.DocumentData `json:"documentData,omitempty"` +} + +// Return response for createDocumentData mutation +type DocumentDataCreatePayload struct { + // Created documentData + DocumentData *generated.DocumentData `json:"documentData"` +} + +// Return response for deleteDocumentData mutation +type DocumentDataDeletePayload struct { + // Deleted documentData ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateDocumentData mutation +type DocumentDataUpdatePayload struct { + // Updated documentData + DocumentData *generated.DocumentData `json:"documentData"` +} + +// Return response for createBulkEntitlement mutation +type EntitlementBulkCreatePayload struct { + // Created entitlements + Entitlements []*generated.Entitlement `json:"entitlements,omitempty"` +} + +// Return response for createEntitlement mutation +type EntitlementCreatePayload struct { + // Created entitlement + Entitlement *generated.Entitlement `json:"entitlement"` +} + +// Return response for deleteEntitlement mutation +type EntitlementDeletePayload struct { + // Deleted entitlement ID + DeletedID string `json:"deletedID"` +} + +// Return response for createBulkEntitlementPlan mutation +type EntitlementPlanBulkCreatePayload struct { + // Created entitlementPlans + EntitlementPlans []*generated.EntitlementPlan `json:"entitlementPlans,omitempty"` +} + +// Return response for createEntitlementPlan mutation +type EntitlementPlanCreatePayload struct { + // Created entitlementPlan + EntitlementPlan *generated.EntitlementPlan `json:"entitlementPlan"` +} + +// Return response for deleteEntitlementPlan mutation +type EntitlementPlanDeletePayload struct { + // Deleted entitlementPlan ID + DeletedID string `json:"deletedID"` +} + +// Return response for createBulkEntitlementPlanFeature mutation +type EntitlementPlanFeatureBulkCreatePayload struct { + // Created entitlementPlanFeatures + EntitlementPlanFeatures []*generated.EntitlementPlanFeature `json:"entitlementPlanFeatures,omitempty"` +} + +// Return response for createEntitlementPlanFeature mutation +type EntitlementPlanFeatureCreatePayload struct { + // Created entitlementPlanFeature + EntitlementPlanFeature *generated.EntitlementPlanFeature `json:"entitlementPlanFeature"` +} + +// Return response for deleteEntitlementPlanFeature mutation +type EntitlementPlanFeatureDeletePayload struct { + // Deleted entitlementPlanFeature ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateEntitlementPlanFeature mutation +type EntitlementPlanFeatureUpdatePayload struct { + // Updated entitlementPlanFeature + EntitlementPlanFeature *generated.EntitlementPlanFeature `json:"entitlementPlanFeature"` +} + +// Return response for updateEntitlementPlan mutation +type EntitlementPlanUpdatePayload struct { + // Updated entitlementPlan + EntitlementPlan *generated.EntitlementPlan `json:"entitlementPlan"` +} + +// Return response for updateEntitlement mutation +type EntitlementUpdatePayload struct { + // Updated entitlement + Entitlement *generated.Entitlement `json:"entitlement"` +} + +// Return response for createBulkEntity mutation +type EntityBulkCreatePayload struct { + // Created entities + Entities []*generated.Entity `json:"entities,omitempty"` +} + +// Return response for createEntity mutation +type EntityCreatePayload struct { + // Created entity + Entity *generated.Entity `json:"entity"` +} + +// Return response for deleteEntity mutation +type EntityDeletePayload struct { + // Deleted entity ID + DeletedID string `json:"deletedID"` +} + +// Return response for createBulkEntityType mutation +type EntityTypeBulkCreatePayload struct { + // Created entityTypes + EntityTypes []*generated.EntityType `json:"entityTypes,omitempty"` +} + +// Return response for createEntityType mutation +type EntityTypeCreatePayload struct { + // Created entityType + EntityType *generated.EntityType `json:"entityType"` +} + +// Return response for deleteEntityType mutation +type EntityTypeDeletePayload struct { + // Deleted entityType ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateEntityType mutation +type EntityTypeUpdatePayload struct { + // Updated entityType + EntityType *generated.EntityType `json:"entityType"` +} + +// Return response for updateEntity mutation +type EntityUpdatePayload struct { + // Updated entity + Entity *generated.Entity `json:"entity"` +} + +// Return response for createBulkEvent mutation +type EventBulkCreatePayload struct { + // Created events + Events []*generated.Event `json:"events,omitempty"` +} + +// Return response for createEvent mutation +type EventCreatePayload struct { + // Created event + Event *generated.Event `json:"event"` +} + +// Return response for deleteEvent mutation +type EventDeletePayload struct { + // Deleted event ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateEvent mutation +type EventUpdatePayload struct { + // Updated event + Event *generated.Event `json:"event"` +} + +// Return response for createBulkFeature mutation +type FeatureBulkCreatePayload struct { + // Created features + Features []*generated.Feature `json:"features,omitempty"` +} + +// Return response for createFeature mutation +type FeatureCreatePayload struct { + // Created feature + Feature *generated.Feature `json:"feature"` +} + +// Return response for deleteFeature mutation +type FeatureDeletePayload struct { + // Deleted feature ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateFeature mutation +type FeatureUpdatePayload struct { + // Updated feature + Feature *generated.Feature `json:"feature"` +} + +// Return response for createBulkFile mutation +type FileBulkCreatePayload struct { + // Created files + Files []*generated.File `json:"files,omitempty"` +} + +// Return response for createFile mutation +type FileCreatePayload struct { + // Created file + File *generated.File `json:"file"` +} + +// Return response for deleteFile mutation +type FileDeletePayload struct { + // Deleted file ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateFile mutation +type FileUpdatePayload struct { + // Updated file + File *generated.File `json:"file"` +} + +type GlobalSearchResultConnection struct { + Page *entgql.PageInfo[string] `json:"page"` + Nodes []GlobalSearchResult `json:"nodes"` +} + +// Return response for createBulkGroup mutation +type GroupBulkCreatePayload struct { + // Created groups + Groups []*generated.Group `json:"groups,omitempty"` +} + +// Return response for createGroup mutation +type GroupCreatePayload struct { + // Created group + Group *generated.Group `json:"group"` +} + +// Return response for deleteGroup mutation +type GroupDeletePayload struct { + // Deleted group ID + DeletedID string `json:"deletedID"` +} + +// Return response for createBulkGroupMembership mutation +type GroupMembershipBulkCreatePayload struct { + // Created groupMemberships + GroupMemberships []*generated.GroupMembership `json:"groupMemberships,omitempty"` +} + +// Return response for createGroupMembership mutation +type GroupMembershipCreatePayload struct { + // Created groupMembership + GroupMembership *generated.GroupMembership `json:"groupMembership"` +} + +// Return response for deleteGroupMembership mutation +type GroupMembershipDeletePayload struct { + // Deleted groupMembership ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateGroupMembership mutation +type GroupMembershipUpdatePayload struct { + // Updated groupMembership + GroupMembership *generated.GroupMembership `json:"groupMembership"` +} + +type GroupSearchResult struct { + Groups []*generated.Group `json:"groups,omitempty"` +} + +func (GroupSearchResult) IsGlobalSearchResult() {} + +// Return response for createBulkGroupSetting mutation +type GroupSettingBulkCreatePayload struct { + // Created groupSettings + GroupSettings []*generated.GroupSetting `json:"groupSettings,omitempty"` +} + +// Return response for createGroupSetting mutation +type GroupSettingCreatePayload struct { + // Created groupSetting + GroupSetting *generated.GroupSetting `json:"groupSetting"` +} + +// Return response for deleteGroupSetting mutation +type GroupSettingDeletePayload struct { + // Deleted groupSetting ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateGroupSetting mutation +type GroupSettingUpdatePayload struct { + // Updated groupSetting + GroupSetting *generated.GroupSetting `json:"groupSetting"` +} + +// Return response for updateGroup mutation +type GroupUpdatePayload struct { + // Updated group + Group *generated.Group `json:"group"` +} + +// Return response for createBulkHush mutation +type HushBulkCreatePayload struct { + // Created hushs + Hushes []*generated.Hush `json:"hushes,omitempty"` +} + +// Return response for createHush mutation +type HushCreatePayload struct { + // Created hush + Hush *generated.Hush `json:"hush"` +} + +// Return response for deleteHush mutation +type HushDeletePayload struct { + // Deleted hush ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateHush mutation +type HushUpdatePayload struct { + // Updated hush + Hush *generated.Hush `json:"hush"` +} + +// Return response for createBulkIntegration mutation +type IntegrationBulkCreatePayload struct { + // Created integrations + Integrations []*generated.Integration `json:"integrations,omitempty"` +} + +// Return response for createIntegration mutation +type IntegrationCreatePayload struct { + // Created integration + Integration *generated.Integration `json:"integration"` +} + +// Return response for deleteIntegration mutation +type IntegrationDeletePayload struct { + // Deleted integration ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateIntegration mutation +type IntegrationUpdatePayload struct { + // Updated integration + Integration *generated.Integration `json:"integration"` +} + +// Return response for createBulkInvite mutation +type InviteBulkCreatePayload struct { + // Created invites + Invites []*generated.Invite `json:"invites,omitempty"` +} + +// Return response for createInvite mutation +type InviteCreatePayload struct { + // Created invite + Invite *generated.Invite `json:"invite"` +} + +// Return response for deleteInvite mutation +type InviteDeletePayload struct { + // Deleted invite ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateInvite mutation +type InviteUpdatePayload struct { + // Updated invite + Invite *generated.Invite `json:"invite"` +} + +// Return response for createBulkOauthProvider mutation +type OauthProviderBulkCreatePayload struct { + // Created oauthProviders + OauthProviders []*generated.OauthProvider `json:"oauthProviders,omitempty"` +} + +// Return response for createOauthProvider mutation +type OauthProviderCreatePayload struct { + // Created oauthProvider + OauthProvider *generated.OauthProvider `json:"oauthProvider"` +} + +// Return response for deleteOauthProvider mutation +type OauthProviderDeletePayload struct { + // Deleted oauthProvider ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateOauthProvider mutation +type OauthProviderUpdatePayload struct { + // Updated oauthProvider + OauthProvider *generated.OauthProvider `json:"oauthProvider"` +} + +// Return response for createBulkOhAuthTooToken mutation +type OhAuthTooTokenBulkCreatePayload struct { + // Created ohAuthTooTokens + OhAuthTooTokens []*generated.OhAuthTooToken `json:"ohAuthTooTokens,omitempty"` +} + +// Return response for createOhAuthTooToken mutation +type OhAuthTooTokenCreatePayload struct { + // Created ohAuthTooToken + OhAuthTooToken *generated.OhAuthTooToken `json:"ohAuthTooToken"` +} + +// Return response for deleteOhAuthTooToken mutation +type OhAuthTooTokenDeletePayload struct { + // Deleted ohAuthTooToken ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateOhAuthTooToken mutation +type OhAuthTooTokenUpdatePayload struct { + // Updated ohAuthTooToken + OhAuthTooToken *generated.OhAuthTooToken `json:"ohAuthTooToken"` +} + +// Return response for createBulkOrgMembership mutation +type OrgMembershipBulkCreatePayload struct { + // Created orgMemberships + OrgMemberships []*generated.OrgMembership `json:"orgMemberships,omitempty"` +} + +// Return response for createOrgMembership mutation +type OrgMembershipCreatePayload struct { + // Created orgMembership + OrgMembership *generated.OrgMembership `json:"orgMembership"` +} + +// Return response for deleteOrgMembership mutation +type OrgMembershipDeletePayload struct { + // Deleted orgMembership ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateOrgMembership mutation +type OrgMembershipUpdatePayload struct { + // Updated orgMembership + OrgMembership *generated.OrgMembership `json:"orgMembership"` +} + +// Return response for createBulkOrganization mutation +type OrganizationBulkCreatePayload struct { + // Created organizations + Organizations []*generated.Organization `json:"organizations,omitempty"` +} + +// Return response for createOrganization mutation +type OrganizationCreatePayload struct { + // Created organization + Organization *generated.Organization `json:"organization"` +} + +// Return response for deleteOrganization mutation +type OrganizationDeletePayload struct { + // Deleted organization ID + DeletedID string `json:"deletedID"` +} + +type OrganizationSearchResult struct { + Organizations []*generated.Organization `json:"organizations,omitempty"` +} + +func (OrganizationSearchResult) IsGlobalSearchResult() {} + +// Return response for createBulkOrganizationSetting mutation +type OrganizationSettingBulkCreatePayload struct { + // Created organizationSettings + OrganizationSettings []*generated.OrganizationSetting `json:"organizationSettings,omitempty"` +} + +// Return response for createOrganizationSetting mutation +type OrganizationSettingCreatePayload struct { + // Created organizationSetting + OrganizationSetting *generated.OrganizationSetting `json:"organizationSetting"` +} + +// Return response for deleteOrganizationSetting mutation +type OrganizationSettingDeletePayload struct { + // Deleted organizationSetting ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateOrganizationSetting mutation +type OrganizationSettingUpdatePayload struct { + // Updated organizationSetting + OrganizationSetting *generated.OrganizationSetting `json:"organizationSetting"` +} + +// Return response for updateOrganization mutation +type OrganizationUpdatePayload struct { + // Updated organization + Organization *generated.Organization `json:"organization"` +} + +// Return response for createBulkPersonalAccessToken mutation +type PersonalAccessTokenBulkCreatePayload struct { + // Created personalAccessTokens + PersonalAccessTokens []*generated.PersonalAccessToken `json:"personalAccessTokens,omitempty"` +} + +// Return response for createPersonalAccessToken mutation +type PersonalAccessTokenCreatePayload struct { + // Created personalAccessToken + PersonalAccessToken *generated.PersonalAccessToken `json:"personalAccessToken"` +} + +// Return response for deletePersonalAccessToken mutation +type PersonalAccessTokenDeletePayload struct { + // Deleted personalAccessToken ID + DeletedID string `json:"deletedID"` +} + +// Return response for updatePersonalAccessToken mutation +type PersonalAccessTokenUpdatePayload struct { + // Updated personalAccessToken + PersonalAccessToken *generated.PersonalAccessToken `json:"personalAccessToken"` +} + +// Return response for createBulkSubscriber mutation +type SubscriberBulkCreatePayload struct { + // Created subscribers + Subscribers []*generated.Subscriber `json:"subscribers,omitempty"` +} + +// Return response for createSubscriber mutation +type SubscriberCreatePayload struct { + // Created subscriber + Subscriber *generated.Subscriber `json:"subscriber"` +} + +// Return response for deleteSubscriber mutation +type SubscriberDeletePayload struct { + // Deleted subscriber email + Email string `json:"email"` +} + +type SubscriberSearchResult struct { + Subscribers []*generated.Subscriber `json:"subscribers,omitempty"` +} + +func (SubscriberSearchResult) IsGlobalSearchResult() {} + +// Return response for updateSubscriber mutation +type SubscriberUpdatePayload struct { + // Updated subscriber + Subscriber *generated.Subscriber `json:"subscriber"` +} + +// Return response for createTFASetting mutation +type TFASettingCreatePayload struct { + // Created tfaSetting + TfaSetting *generated.TFASetting `json:"tfaSetting"` +} + +// Return response for updateTFASetting mutation +type TFASettingUpdatePayload struct { + // Updated tfaSetting + TfaSetting *generated.TFASetting `json:"tfaSetting"` +} + +// Return response for createBulkTemplate mutation +type TemplateBulkCreatePayload struct { + // Created templates + Templates []*generated.Template `json:"templates,omitempty"` +} + +// Return response for createTemplate mutation +type TemplateCreatePayload struct { + // Created template + Template *generated.Template `json:"template"` +} + +// Return response for deleteTemplate mutation +type TemplateDeletePayload struct { + // Deleted template ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateTemplate mutation +type TemplateUpdatePayload struct { + // Updated template + Template *generated.Template `json:"template"` +} + +// Return response for createBulkUser mutation +type UserBulkCreatePayload struct { + // Created users + Users []*generated.User `json:"users,omitempty"` +} + +// Return response for createUser mutation +type UserCreatePayload struct { + // Created user + User *generated.User `json:"user"` +} + +// Return response for deleteUser mutation +type UserDeletePayload struct { + // Deleted user ID + DeletedID string `json:"deletedID"` +} + +type UserSearchResult struct { + Users []*generated.User `json:"users,omitempty"` +} + +func (UserSearchResult) IsGlobalSearchResult() {} + +// Return response for createBulkUserSetting mutation +type UserSettingBulkCreatePayload struct { + // Created userSettings + UserSettings []*generated.UserSetting `json:"userSettings,omitempty"` +} + +// Return response for createUserSetting mutation +type UserSettingCreatePayload struct { + // Created userSetting + UserSetting *generated.UserSetting `json:"userSetting"` +} + +// Return response for updateUserSetting mutation +type UserSettingUpdatePayload struct { + // Updated userSetting + UserSetting *generated.UserSetting `json:"userSetting"` +} + +// Return response for updateUser mutation +type UserUpdatePayload struct { + // Updated user + User *generated.User `json:"user"` +} + +// Return response for createBulkWebhook mutation +type WebhookBulkCreatePayload struct { + // Created webhooks + Webhooks []*generated.Webhook `json:"webhooks,omitempty"` +} + +// Return response for createWebhook mutation +type WebhookCreatePayload struct { + // Created webhook + Webhook *generated.Webhook `json:"webhook"` +} + +// Return response for deleteWebhook mutation +type WebhookDeletePayload struct { + // Deleted webhook ID + DeletedID string `json:"deletedID"` +} + +// Return response for updateWebhook mutation +type WebhookUpdatePayload struct { + // Updated webhook + Webhook *generated.Webhook `json:"webhook"` +} diff --git a/internal/graphapi/gen_server.go b/internal/graphapi/gen_server.go new file mode 100644 index 0000000..93c9e17 --- /dev/null +++ b/internal/graphapi/gen_server.go @@ -0,0 +1,236673 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package graphapi + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + "time" + + "entgo.io/contrib/entgql" + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/theopenlane/core/internal/ent/customtypes" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Mutation() MutationResolver + Query() QueryResolver + CreateEntityInput() CreateEntityInputResolver + CreateGroupInput() CreateGroupInputResolver + CreateOrganizationInput() CreateOrganizationInputResolver + UpdateEntityInput() UpdateEntityInputResolver + UpdateGroupInput() UpdateGroupInputResolver + UpdateOrganizationInput() UpdateOrganizationInputResolver + UpdateTFASettingInput() UpdateTFASettingInputResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + APIToken struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + ExpiresAt func(childComplexity int) int + ID func(childComplexity int) int + LastUsedAt func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Scopes func(childComplexity int) int + Tags func(childComplexity int) int + Token func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + APITokenBulkCreatePayload struct { + APITokens func(childComplexity int) int + } + + APITokenConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + APITokenCreatePayload struct { + APIToken func(childComplexity int) int + } + + APITokenDeletePayload struct { + DeletedID func(childComplexity int) int + } + + APITokenEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + APITokenUpdatePayload struct { + APIToken func(childComplexity int) int + } + + AuditLog struct { + Changes func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + Table func(childComplexity int) int + Time func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + AuditLogConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + AuditLogEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + Contact struct { + Address func(childComplexity int) int + Company func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Email func(childComplexity int) int + Entities func(childComplexity int) int + FullName func(childComplexity int) int + ID func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + PhoneNumber func(childComplexity int) int + Status func(childComplexity int) int + Tags func(childComplexity int) int + Title func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + ContactBulkCreatePayload struct { + Contacts func(childComplexity int) int + } + + ContactConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + ContactCreatePayload struct { + Contact func(childComplexity int) int + } + + ContactDeletePayload struct { + DeletedID func(childComplexity int) int + } + + ContactEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ContactHistory struct { + Address func(childComplexity int) int + Company func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Email func(childComplexity int) int + FullName func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + PhoneNumber func(childComplexity int) int + Ref func(childComplexity int) int + Status func(childComplexity int) int + Tags func(childComplexity int) int + Title func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + ContactHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + ContactHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + ContactUpdatePayload struct { + Contact func(childComplexity int) int + } + + DocumentData struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + Data func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Entity func(childComplexity int) int + ID func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Tags func(childComplexity int) int + Template func(childComplexity int) int + TemplateID func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + DocumentDataBulkCreatePayload struct { + DocumentData func(childComplexity int) int + } + + DocumentDataConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + DocumentDataCreatePayload struct { + DocumentData func(childComplexity int) int + } + + DocumentDataDeletePayload struct { + DeletedID func(childComplexity int) int + } + + DocumentDataEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + DocumentDataHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + Data func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + TemplateID func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + DocumentDataHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + DocumentDataHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + DocumentDataUpdatePayload struct { + DocumentData func(childComplexity int) int + } + + Entitlement struct { + Cancelled func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Events func(childComplexity int) int + Expires func(childComplexity int) int + ExpiresAt func(childComplexity int) int + ExternalCustomerID func(childComplexity int) int + ExternalSubscriptionID func(childComplexity int) int + ID func(childComplexity int) int + Organization func(childComplexity int) int + OrganizationID func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Plan func(childComplexity int) int + PlanID func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntitlementBulkCreatePayload struct { + Entitlements func(childComplexity int) int + } + + EntitlementConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntitlementCreatePayload struct { + Entitlement func(childComplexity int) int + } + + EntitlementDeletePayload struct { + DeletedID func(childComplexity int) int + } + + EntitlementEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntitlementHistory struct { + Cancelled func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Expires func(childComplexity int) int + ExpiresAt func(childComplexity int) int + ExternalCustomerID func(childComplexity int) int + ExternalSubscriptionID func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + OrganizationID func(childComplexity int) int + OwnerID func(childComplexity int) int + PlanID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntitlementHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntitlementHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntitlementPlan struct { + BaseFeatures func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Entitlements func(childComplexity int) int + Events func(childComplexity int) int + Features func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Version func(childComplexity int) int + } + + EntitlementPlanBulkCreatePayload struct { + EntitlementPlans func(childComplexity int) int + } + + EntitlementPlanConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntitlementPlanCreatePayload struct { + EntitlementPlan func(childComplexity int) int + } + + EntitlementPlanDeletePayload struct { + DeletedID func(childComplexity int) int + } + + EntitlementPlanEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntitlementPlanFeature struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Events func(childComplexity int) int + Feature func(childComplexity int) int + FeatureID func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Plan func(childComplexity int) int + PlanID func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntitlementPlanFeatureBulkCreatePayload struct { + EntitlementPlanFeatures func(childComplexity int) int + } + + EntitlementPlanFeatureConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntitlementPlanFeatureCreatePayload struct { + EntitlementPlanFeature func(childComplexity int) int + } + + EntitlementPlanFeatureDeletePayload struct { + DeletedID func(childComplexity int) int + } + + EntitlementPlanFeatureEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntitlementPlanFeatureHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + FeatureID func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + PlanID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntitlementPlanFeatureHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntitlementPlanFeatureHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntitlementPlanFeatureUpdatePayload struct { + EntitlementPlanFeature func(childComplexity int) int + } + + EntitlementPlanHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Version func(childComplexity int) int + } + + EntitlementPlanHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntitlementPlanHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntitlementPlanUpdatePayload struct { + EntitlementPlan func(childComplexity int) int + } + + EntitlementUpdatePayload struct { + Entitlement func(childComplexity int) int + } + + Entity struct { + Contacts func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Documents func(childComplexity int) int + Domains func(childComplexity int) int + EntityType func(childComplexity int) int + EntityTypeID func(childComplexity int) int + Files func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Status func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntityBulkCreatePayload struct { + Entities func(childComplexity int) int + } + + EntityConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntityCreatePayload struct { + Entity func(childComplexity int) int + } + + EntityDeletePayload struct { + DeletedID func(childComplexity int) int + } + + EntityEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntityHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Domains func(childComplexity int) int + EntityTypeID func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Status func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntityHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntityHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntityType struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Entities func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntityTypeBulkCreatePayload struct { + EntityTypes func(childComplexity int) int + } + + EntityTypeConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntityTypeCreatePayload struct { + EntityType func(childComplexity int) int + } + + EntityTypeDeletePayload struct { + DeletedID func(childComplexity int) int + } + + EntityTypeEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntityTypeHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EntityTypeHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EntityTypeHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EntityTypeUpdatePayload struct { + EntityType func(childComplexity int) int + } + + EntityUpdatePayload struct { + Entity func(childComplexity int) int + } + + Event struct { + CorrelationID func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + Entitlement func(childComplexity int) int + Entitlementplan func(childComplexity int) int + Entitlementplanfeature func(childComplexity int) int + EventID func(childComplexity int) int + EventType func(childComplexity int) int + Feature func(childComplexity int) int + Group func(childComplexity int) int + Groupmembership func(childComplexity int) int + Hush func(childComplexity int) int + ID func(childComplexity int) int + Integration func(childComplexity int) int + Invite func(childComplexity int) int + Metadata func(childComplexity int) int + Oauth2token func(childComplexity int) int + Organization func(childComplexity int) int + Orgmembership func(childComplexity int) int + PersonalAccessToken func(childComplexity int) int + Subscriber func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + User func(childComplexity int) int + Webhook func(childComplexity int) int + } + + EventBulkCreatePayload struct { + Events func(childComplexity int) int + } + + EventConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EventCreatePayload struct { + Event func(childComplexity int) int + } + + EventDeletePayload struct { + DeletedID func(childComplexity int) int + } + + EventEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EventHistory struct { + CorrelationID func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + EventID func(childComplexity int) int + EventType func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + Operation func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + EventHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + EventHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + EventUpdatePayload struct { + Event func(childComplexity int) int + } + + Feature struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Enabled func(childComplexity int) int + Events func(childComplexity int) int + Features func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Plans func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + FeatureBulkCreatePayload struct { + Features func(childComplexity int) int + } + + FeatureConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + FeatureCreatePayload struct { + Feature func(childComplexity int) int + } + + FeatureDeletePayload struct { + DeletedID func(childComplexity int) int + } + + FeatureEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + FeatureHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Enabled func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + FeatureHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + FeatureHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + FeatureUpdatePayload struct { + Feature func(childComplexity int) int + } + + File struct { + Annotation func(childComplexity int) int + Category func(childComplexity int) int + ContentType func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Entity func(childComplexity int) int + FileExtension func(childComplexity int) int + FileName func(childComplexity int) int + FileSize func(childComplexity int) int + Group func(childComplexity int) int + ID func(childComplexity int) int + Organization func(childComplexity int) int + StoreKey func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + User func(childComplexity int) int + } + + FileBulkCreatePayload struct { + Files func(childComplexity int) int + } + + FileConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + FileCreatePayload struct { + File func(childComplexity int) int + } + + FileDeletePayload struct { + DeletedID func(childComplexity int) int + } + + FileEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + FileHistory struct { + Annotation func(childComplexity int) int + Category func(childComplexity int) int + ContentType func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + FileExtension func(childComplexity int) int + FileName func(childComplexity int) int + FileSize func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + Ref func(childComplexity int) int + StoreKey func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + FileHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + FileHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + FileUpdatePayload struct { + File func(childComplexity int) int + } + + GlobalSearchResultConnection struct { + Nodes func(childComplexity int) int + Page func(childComplexity int) int + } + + Group struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Events func(childComplexity int) int + Files func(childComplexity int) int + GravatarLogoURL func(childComplexity int) int + ID func(childComplexity int) int + Integrations func(childComplexity int) int + LogoURL func(childComplexity int) int + Members func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Setting func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Users func(childComplexity int) int + } + + GroupBulkCreatePayload struct { + Groups func(childComplexity int) int + } + + GroupConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GroupCreatePayload struct { + Group func(childComplexity int) int + } + + GroupDeletePayload struct { + DeletedID func(childComplexity int) int + } + + GroupEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + GroupHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + GravatarLogoURL func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + LogoURL func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + GroupHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GroupHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + GroupMembership struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Events func(childComplexity int) int + Group func(childComplexity int) int + GroupID func(childComplexity int) int + ID func(childComplexity int) int + Role func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + User func(childComplexity int) int + UserID func(childComplexity int) int + } + + GroupMembershipBulkCreatePayload struct { + GroupMemberships func(childComplexity int) int + } + + GroupMembershipConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GroupMembershipCreatePayload struct { + GroupMembership func(childComplexity int) int + } + + GroupMembershipDeletePayload struct { + DeletedID func(childComplexity int) int + } + + GroupMembershipEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + GroupMembershipHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + GroupID func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + Ref func(childComplexity int) int + Role func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + UserID func(childComplexity int) int + } + + GroupMembershipHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GroupMembershipHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + GroupMembershipUpdatePayload struct { + GroupMembership func(childComplexity int) int + } + + GroupSearchResult struct { + Groups func(childComplexity int) int + } + + GroupSetting struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Group func(childComplexity int) int + GroupID func(childComplexity int) int + ID func(childComplexity int) int + JoinPolicy func(childComplexity int) int + SyncToGithub func(childComplexity int) int + SyncToSlack func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Visibility func(childComplexity int) int + } + + GroupSettingBulkCreatePayload struct { + GroupSettings func(childComplexity int) int + } + + GroupSettingConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GroupSettingCreatePayload struct { + GroupSetting func(childComplexity int) int + } + + GroupSettingDeletePayload struct { + DeletedID func(childComplexity int) int + } + + GroupSettingEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + GroupSettingHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + GroupID func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + JoinPolicy func(childComplexity int) int + Operation func(childComplexity int) int + Ref func(childComplexity int) int + SyncToGithub func(childComplexity int) int + SyncToSlack func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Visibility func(childComplexity int) int + } + + GroupSettingHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + GroupSettingHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + GroupSettingUpdatePayload struct { + GroupSetting func(childComplexity int) int + } + + GroupUpdatePayload struct { + Group func(childComplexity int) int + } + + Hush struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + Events func(childComplexity int) int + ID func(childComplexity int) int + Integrations func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Organization func(childComplexity int) int + SecretName func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + HushBulkCreatePayload struct { + Hushes func(childComplexity int) int + } + + HushConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + HushCreatePayload struct { + Hush func(childComplexity int) int + } + + HushDeletePayload struct { + DeletedID func(childComplexity int) int + } + + HushEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + HushHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + Ref func(childComplexity int) int + SecretName func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + HushHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + HushHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + HushUpdatePayload struct { + Hush func(childComplexity int) int + } + + Integration struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + Events func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Oauth2tokens func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Secrets func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Webhooks func(childComplexity int) int + } + + IntegrationBulkCreatePayload struct { + Integrations func(childComplexity int) int + } + + IntegrationConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + IntegrationCreatePayload struct { + Integration func(childComplexity int) int + } + + IntegrationDeletePayload struct { + DeletedID func(childComplexity int) int + } + + IntegrationEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + IntegrationHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + IntegrationHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + IntegrationHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + IntegrationUpdatePayload struct { + Integration func(childComplexity int) int + } + + Invite struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Events func(childComplexity int) int + Expires func(childComplexity int) int + ID func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Recipient func(childComplexity int) int + RequestorID func(childComplexity int) int + Role func(childComplexity int) int + SendAttempts func(childComplexity int) int + Status func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + InviteBulkCreatePayload struct { + Invites func(childComplexity int) int + } + + InviteConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + InviteCreatePayload struct { + Invite func(childComplexity int) int + } + + InviteDeletePayload struct { + DeletedID func(childComplexity int) int + } + + InviteEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + InviteUpdatePayload struct { + Invite func(childComplexity int) int + } + + Mutation struct { + CreateAPIToken func(childComplexity int, input generated.CreateAPITokenInput) int + CreateBulkAPIToken func(childComplexity int, input []*generated.CreateAPITokenInput) int + CreateBulkCSVAPIToken func(childComplexity int, input graphql.Upload) int + CreateBulkCSVContact func(childComplexity int, input graphql.Upload) int + CreateBulkCSVDocumentData func(childComplexity int, input graphql.Upload) int + CreateBulkCSVEntitlement func(childComplexity int, input graphql.Upload) int + CreateBulkCSVEntitlementPlan func(childComplexity int, input graphql.Upload) int + CreateBulkCSVEntitlementPlanFeature func(childComplexity int, input graphql.Upload) int + CreateBulkCSVEntity func(childComplexity int, input graphql.Upload) int + CreateBulkCSVEntityType func(childComplexity int, input graphql.Upload) int + CreateBulkCSVEvent func(childComplexity int, input graphql.Upload) int + CreateBulkCSVFeature func(childComplexity int, input graphql.Upload) int + CreateBulkCSVFile func(childComplexity int, input graphql.Upload) int + CreateBulkCSVGroup func(childComplexity int, input graphql.Upload) int + CreateBulkCSVGroupMembership func(childComplexity int, input graphql.Upload) int + CreateBulkCSVGroupSetting func(childComplexity int, input graphql.Upload) int + CreateBulkCSVHush func(childComplexity int, input graphql.Upload) int + CreateBulkCSVIntegration func(childComplexity int, input graphql.Upload) int + CreateBulkCSVInvite func(childComplexity int, input graphql.Upload) int + CreateBulkCSVOauthProvider func(childComplexity int, input graphql.Upload) int + CreateBulkCSVOhAuthTooToken func(childComplexity int, input graphql.Upload) int + CreateBulkCSVOrgMembership func(childComplexity int, input graphql.Upload) int + CreateBulkCSVOrganization func(childComplexity int, input graphql.Upload) int + CreateBulkCSVOrganizationSetting func(childComplexity int, input graphql.Upload) int + CreateBulkCSVPersonalAccessToken func(childComplexity int, input graphql.Upload) int + CreateBulkCSVSubscriber func(childComplexity int, input graphql.Upload) int + CreateBulkCSVTemplate func(childComplexity int, input graphql.Upload) int + CreateBulkCSVUserSetting func(childComplexity int, input graphql.Upload) int + CreateBulkCSVWebhook func(childComplexity int, input graphql.Upload) int + CreateBulkContact func(childComplexity int, input []*generated.CreateContactInput) int + CreateBulkDocumentData func(childComplexity int, input []*generated.CreateDocumentDataInput) int + CreateBulkEntitlement func(childComplexity int, input []*generated.CreateEntitlementInput) int + CreateBulkEntitlementPlan func(childComplexity int, input []*generated.CreateEntitlementPlanInput) int + CreateBulkEntitlementPlanFeature func(childComplexity int, input []*generated.CreateEntitlementPlanFeatureInput) int + CreateBulkEntity func(childComplexity int, input []*generated.CreateEntityInput) int + CreateBulkEntityType func(childComplexity int, input []*generated.CreateEntityTypeInput) int + CreateBulkEvent func(childComplexity int, input []*generated.CreateEventInput) int + CreateBulkFeature func(childComplexity int, input []*generated.CreateFeatureInput) int + CreateBulkFile func(childComplexity int, input []*generated.CreateFileInput) int + CreateBulkGroup func(childComplexity int, input []*generated.CreateGroupInput) int + CreateBulkGroupMembership func(childComplexity int, input []*generated.CreateGroupMembershipInput) int + CreateBulkGroupSetting func(childComplexity int, input []*generated.CreateGroupSettingInput) int + CreateBulkHush func(childComplexity int, input []*generated.CreateHushInput) int + CreateBulkIntegration func(childComplexity int, input []*generated.CreateIntegrationInput) int + CreateBulkInvite func(childComplexity int, input []*generated.CreateInviteInput) int + CreateBulkOauthProvider func(childComplexity int, input []*generated.CreateOauthProviderInput) int + CreateBulkOhAuthTooToken func(childComplexity int, input []*generated.CreateOhAuthTooTokenInput) int + CreateBulkOrgMembership func(childComplexity int, input []*generated.CreateOrgMembershipInput) int + CreateBulkOrganization func(childComplexity int, input []*generated.CreateOrganizationInput) int + CreateBulkOrganizationSetting func(childComplexity int, input []*generated.CreateOrganizationSettingInput) int + CreateBulkPersonalAccessToken func(childComplexity int, input []*generated.CreatePersonalAccessTokenInput) int + CreateBulkSubscriber func(childComplexity int, input []*generated.CreateSubscriberInput) int + CreateBulkTemplate func(childComplexity int, input []*generated.CreateTemplateInput) int + CreateBulkUserSetting func(childComplexity int, input []*generated.CreateUserSettingInput) int + CreateBulkWebhook func(childComplexity int, input []*generated.CreateWebhookInput) int + CreateContact func(childComplexity int, input generated.CreateContactInput) int + CreateDocumentData func(childComplexity int, input generated.CreateDocumentDataInput) int + CreateEntitlement func(childComplexity int, input generated.CreateEntitlementInput) int + CreateEntitlementPlan func(childComplexity int, input generated.CreateEntitlementPlanInput) int + CreateEntitlementPlanFeature func(childComplexity int, input generated.CreateEntitlementPlanFeatureInput) int + CreateEntity func(childComplexity int, input generated.CreateEntityInput) int + CreateEntityType func(childComplexity int, input generated.CreateEntityTypeInput) int + CreateEvent func(childComplexity int, input generated.CreateEventInput) int + CreateFeature func(childComplexity int, input generated.CreateFeatureInput) int + CreateFile func(childComplexity int, input generated.CreateFileInput) int + CreateGroup func(childComplexity int, input generated.CreateGroupInput) int + CreateGroupMembership func(childComplexity int, input generated.CreateGroupMembershipInput) int + CreateGroupSetting func(childComplexity int, input generated.CreateGroupSettingInput) int + CreateHush func(childComplexity int, input generated.CreateHushInput) int + CreateIntegration func(childComplexity int, input generated.CreateIntegrationInput) int + CreateInvite func(childComplexity int, input generated.CreateInviteInput) int + CreateOauthProvider func(childComplexity int, input generated.CreateOauthProviderInput) int + CreateOhAuthTooToken func(childComplexity int, input generated.CreateOhAuthTooTokenInput) int + CreateOrgMembership func(childComplexity int, input generated.CreateOrgMembershipInput) int + CreateOrganization func(childComplexity int, input generated.CreateOrganizationInput) int + CreateOrganizationSetting func(childComplexity int, input generated.CreateOrganizationSettingInput) int + CreatePersonalAccessToken func(childComplexity int, input generated.CreatePersonalAccessTokenInput) int + CreateSubscriber func(childComplexity int, input generated.CreateSubscriberInput) int + CreateTFASetting func(childComplexity int, input generated.CreateTFASettingInput) int + CreateTemplate func(childComplexity int, input generated.CreateTemplateInput) int + CreateUser func(childComplexity int, input generated.CreateUserInput) int + CreateUserSetting func(childComplexity int, input generated.CreateUserSettingInput) int + CreateWebhook func(childComplexity int, input generated.CreateWebhookInput) int + DeleteAPIToken func(childComplexity int, id string) int + DeleteContact func(childComplexity int, id string) int + DeleteDocumentData func(childComplexity int, id string) int + DeleteEntitlement func(childComplexity int, id string) int + DeleteEntitlementPlan func(childComplexity int, id string) int + DeleteEntitlementPlanFeature func(childComplexity int, id string) int + DeleteEntity func(childComplexity int, id string) int + DeleteEntityType func(childComplexity int, id string) int + DeleteEvent func(childComplexity int, id string) int + DeleteFeature func(childComplexity int, id string) int + DeleteFile func(childComplexity int, id string) int + DeleteGroup func(childComplexity int, id string) int + DeleteGroupMembership func(childComplexity int, id string) int + DeleteGroupSetting func(childComplexity int, id string) int + DeleteHush func(childComplexity int, id string) int + DeleteIntegration func(childComplexity int, id string) int + DeleteInvite func(childComplexity int, id string) int + DeleteOauthProvider func(childComplexity int, id string) int + DeleteOhAuthTooToken func(childComplexity int, id string) int + DeleteOrgMembership func(childComplexity int, id string) int + DeleteOrganization func(childComplexity int, id string) int + DeleteOrganizationSetting func(childComplexity int, id string) int + DeletePersonalAccessToken func(childComplexity int, id string) int + DeleteSubscriber func(childComplexity int, email string, ownerID *string) int + DeleteTemplate func(childComplexity int, id string) int + DeleteUser func(childComplexity int, id string) int + DeleteWebhook func(childComplexity int, id string) int + UpdateAPIToken func(childComplexity int, id string, input generated.UpdateAPITokenInput) int + UpdateContact func(childComplexity int, id string, input generated.UpdateContactInput) int + UpdateDocumentData func(childComplexity int, id string, input generated.UpdateDocumentDataInput) int + UpdateEntitlement func(childComplexity int, id string, input generated.UpdateEntitlementInput) int + UpdateEntitlementPlan func(childComplexity int, id string, input generated.UpdateEntitlementPlanInput) int + UpdateEntitlementPlanFeature func(childComplexity int, id string, input generated.UpdateEntitlementPlanFeatureInput) int + UpdateEntity func(childComplexity int, id string, input generated.UpdateEntityInput) int + UpdateEntityType func(childComplexity int, id string, input generated.UpdateEntityTypeInput) int + UpdateEvent func(childComplexity int, id string, input generated.UpdateEventInput) int + UpdateFeature func(childComplexity int, id string, input generated.UpdateFeatureInput) int + UpdateFile func(childComplexity int, id string, input generated.UpdateFileInput) int + UpdateGroup func(childComplexity int, id string, input generated.UpdateGroupInput) int + UpdateGroupMembership func(childComplexity int, id string, input generated.UpdateGroupMembershipInput) int + UpdateGroupSetting func(childComplexity int, id string, input generated.UpdateGroupSettingInput) int + UpdateHush func(childComplexity int, id string, input generated.UpdateHushInput) int + UpdateIntegration func(childComplexity int, id string, input generated.UpdateIntegrationInput) int + UpdateInvite func(childComplexity int, id string, input generated.UpdateInviteInput) int + UpdateOauthProvider func(childComplexity int, id string, input generated.UpdateOauthProviderInput) int + UpdateOhAuthTooToken func(childComplexity int, id string, input generated.UpdateOhAuthTooTokenInput) int + UpdateOrgMembership func(childComplexity int, id string, input generated.UpdateOrgMembershipInput) int + UpdateOrganization func(childComplexity int, id string, input generated.UpdateOrganizationInput) int + UpdateOrganizationSetting func(childComplexity int, id string, input generated.UpdateOrganizationSettingInput) int + UpdatePersonalAccessToken func(childComplexity int, id string, input generated.UpdatePersonalAccessTokenInput) int + UpdateSubscriber func(childComplexity int, email string, input generated.UpdateSubscriberInput) int + UpdateTFASetting func(childComplexity int, input generated.UpdateTFASettingInput) int + UpdateTemplate func(childComplexity int, id string, input generated.UpdateTemplateInput) int + UpdateUser func(childComplexity int, id string, input generated.UpdateUserInput) int + UpdateUserSetting func(childComplexity int, id string, input generated.UpdateUserSettingInput) int + UpdateWebhook func(childComplexity int, id string, input generated.UpdateWebhookInput) int + } + + Note struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Entity func(childComplexity int) int + ID func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Tags func(childComplexity int) int + Text func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + NoteConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + NoteEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + NoteHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + Text func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + NoteHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + NoteHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OauthProvider struct { + AuthStyle func(childComplexity int) int + AuthURL func(childComplexity int) int + ClientID func(childComplexity int) int + ClientSecret func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + ID func(childComplexity int) int + InfoURL func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + RedirectURL func(childComplexity int) int + Scopes func(childComplexity int) int + Tags func(childComplexity int) int + TokenURL func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + OauthProviderBulkCreatePayload struct { + OauthProviders func(childComplexity int) int + } + + OauthProviderConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OauthProviderCreatePayload struct { + OauthProvider func(childComplexity int) int + } + + OauthProviderDeletePayload struct { + DeletedID func(childComplexity int) int + } + + OauthProviderEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OauthProviderHistory struct { + AuthStyle func(childComplexity int) int + AuthURL func(childComplexity int) int + ClientID func(childComplexity int) int + ClientSecret func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + InfoURL func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + RedirectURL func(childComplexity int) int + Ref func(childComplexity int) int + Scopes func(childComplexity int) int + Tags func(childComplexity int) int + TokenURL func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + OauthProviderHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OauthProviderHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OauthProviderUpdatePayload struct { + OauthProvider func(childComplexity int) int + } + + OhAuthTooToken struct { + ClaimsEmail func(childComplexity int) int + ClaimsEmailVerified func(childComplexity int) int + ClaimsGroups func(childComplexity int) int + ClaimsPreferredUsername func(childComplexity int) int + ClaimsUserID func(childComplexity int) int + ClaimsUsername func(childComplexity int) int + ClientID func(childComplexity int) int + ConnectorData func(childComplexity int) int + ConnectorID func(childComplexity int) int + Events func(childComplexity int) int + ID func(childComplexity int) int + Integration func(childComplexity int) int + LastUsed func(childComplexity int) int + Nonce func(childComplexity int) int + Scopes func(childComplexity int) int + Tags func(childComplexity int) int + } + + OhAuthTooTokenBulkCreatePayload struct { + OhAuthTooTokens func(childComplexity int) int + } + + OhAuthTooTokenConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OhAuthTooTokenCreatePayload struct { + OhAuthTooToken func(childComplexity int) int + } + + OhAuthTooTokenDeletePayload struct { + DeletedID func(childComplexity int) int + } + + OhAuthTooTokenEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OhAuthTooTokenUpdatePayload struct { + OhAuthTooToken func(childComplexity int) int + } + + OrgMembership struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Events func(childComplexity int) int + ID func(childComplexity int) int + Organization func(childComplexity int) int + OrganizationID func(childComplexity int) int + Role func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + User func(childComplexity int) int + UserID func(childComplexity int) int + } + + OrgMembershipBulkCreatePayload struct { + OrgMemberships func(childComplexity int) int + } + + OrgMembershipConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OrgMembershipCreatePayload struct { + OrgMembership func(childComplexity int) int + } + + OrgMembershipDeletePayload struct { + DeletedID func(childComplexity int) int + } + + OrgMembershipEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OrgMembershipHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + OrganizationID func(childComplexity int) int + Ref func(childComplexity int) int + Role func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + UserID func(childComplexity int) int + } + + OrgMembershipHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OrgMembershipHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OrgMembershipUpdatePayload struct { + OrgMembership func(childComplexity int) int + } + + Organization struct { + APITokens func(childComplexity int) int + AvatarRemoteURL func(childComplexity int) int + Children func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.OrganizationOrder, where *generated.OrganizationWhereInput) int + Contacts func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DedicatedDb func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + Documentdata func(childComplexity int) int + Entities func(childComplexity int) int + Entitlementplanfeatures func(childComplexity int) int + Entitlementplans func(childComplexity int) int + Entitlements func(childComplexity int) int + Entitytypes func(childComplexity int) int + Events func(childComplexity int) int + Features func(childComplexity int) int + Files func(childComplexity int) int + Groups func(childComplexity int) int + ID func(childComplexity int) int + Integrations func(childComplexity int) int + Invites func(childComplexity int) int + Members func(childComplexity int) int + Name func(childComplexity int) int + Notes func(childComplexity int) int + Oauthprovider func(childComplexity int) int + OrganizationEntitlement func(childComplexity int) int + Parent func(childComplexity int) int + PersonalAccessTokens func(childComplexity int) int + PersonalOrg func(childComplexity int) int + Secrets func(childComplexity int) int + Setting func(childComplexity int) int + Subscribers func(childComplexity int) int + Tags func(childComplexity int) int + Templates func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Users func(childComplexity int) int + Webhooks func(childComplexity int) int + } + + OrganizationBulkCreatePayload struct { + Organizations func(childComplexity int) int + } + + OrganizationConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OrganizationCreatePayload struct { + Organization func(childComplexity int) int + } + + OrganizationDeletePayload struct { + DeletedID func(childComplexity int) int + } + + OrganizationEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OrganizationHistory struct { + AvatarRemoteURL func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DedicatedDb func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DisplayName func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + PersonalOrg func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + OrganizationHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OrganizationHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OrganizationSearchResult struct { + Organizations func(childComplexity int) int + } + + OrganizationSetting struct { + BillingAddress func(childComplexity int) int + BillingContact func(childComplexity int) int + BillingEmail func(childComplexity int) int + BillingPhone func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Domains func(childComplexity int) int + GeoLocation func(childComplexity int) int + ID func(childComplexity int) int + Organization func(childComplexity int) int + OrganizationID func(childComplexity int) int + Tags func(childComplexity int) int + TaxIdentifier func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + OrganizationSettingBulkCreatePayload struct { + OrganizationSettings func(childComplexity int) int + } + + OrganizationSettingConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OrganizationSettingCreatePayload struct { + OrganizationSetting func(childComplexity int) int + } + + OrganizationSettingDeletePayload struct { + DeletedID func(childComplexity int) int + } + + OrganizationSettingEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OrganizationSettingHistory struct { + BillingAddress func(childComplexity int) int + BillingContact func(childComplexity int) int + BillingEmail func(childComplexity int) int + BillingPhone func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Domains func(childComplexity int) int + GeoLocation func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Operation func(childComplexity int) int + OrganizationID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + TaxIdentifier func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + OrganizationSettingHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + OrganizationSettingHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + OrganizationSettingUpdatePayload struct { + OrganizationSetting func(childComplexity int) int + } + + OrganizationUpdatePayload struct { + Organization func(childComplexity int) int + } + + PageInfo struct { + EndCursor func(childComplexity int) int + HasNextPage func(childComplexity int) int + HasPreviousPage func(childComplexity int) int + StartCursor func(childComplexity int) int + } + + PersonalAccessToken struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + Events func(childComplexity int) int + ExpiresAt func(childComplexity int) int + ID func(childComplexity int) int + LastUsedAt func(childComplexity int) int + Name func(childComplexity int) int + Organizations func(childComplexity int) int + Owner func(childComplexity int) int + Scopes func(childComplexity int) int + Tags func(childComplexity int) int + Token func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + PersonalAccessTokenBulkCreatePayload struct { + PersonalAccessTokens func(childComplexity int) int + } + + PersonalAccessTokenConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + PersonalAccessTokenCreatePayload struct { + PersonalAccessToken func(childComplexity int) int + } + + PersonalAccessTokenDeletePayload struct { + DeletedID func(childComplexity int) int + } + + PersonalAccessTokenEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + PersonalAccessTokenUpdatePayload struct { + PersonalAccessToken func(childComplexity int) int + } + + Query struct { + APIToken func(childComplexity int, id string) int + APITokens func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.APITokenWhereInput) int + AuditLogs func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *AuditLogWhereInput) int + Contact func(childComplexity int, id string) int + ContactHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.ContactHistoryWhereInput) int + Contacts func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.ContactWhereInput) int + DocumentData func(childComplexity int, id string) int + DocumentDataHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.DocumentDataHistoryWhereInput) int + DocumentDataSlice func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.DocumentDataWhereInput) int + Entities func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityOrder, where *generated.EntityWhereInput) int + Entitlement func(childComplexity int, id string) int + EntitlementHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementHistoryWhereInput) int + EntitlementPlan func(childComplexity int, id string) int + EntitlementPlanFeature func(childComplexity int, id string) int + EntitlementPlanFeatureHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanFeatureHistoryWhereInput) int + EntitlementPlanFeatures func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanFeatureWhereInput) int + EntitlementPlanHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanHistoryWhereInput) int + EntitlementPlans func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanWhereInput) int + Entitlements func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementWhereInput) int + Entity func(childComplexity int, id string) int + EntityHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityHistoryOrder, where *generated.EntityHistoryWhereInput) int + EntityType func(childComplexity int, id string) int + EntityTypeHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityTypeHistoryOrder, where *generated.EntityTypeHistoryWhereInput) int + EntityTypes func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityTypeOrder, where *generated.EntityTypeWhereInput) int + Event func(childComplexity int, id string) int + EventHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EventHistoryWhereInput) int + Events func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EventWhereInput) int + Feature func(childComplexity int, id string) int + FeatureHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FeatureHistoryWhereInput) int + Features func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FeatureWhereInput) int + File func(childComplexity int, id string) int + FileHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FileHistoryWhereInput) int + Files func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FileWhereInput) int + Group func(childComplexity int, id string) int + GroupHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.GroupHistoryOrder, where *generated.GroupHistoryWhereInput) int + GroupMembership func(childComplexity int, id string) int + GroupMembershipHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupMembershipHistoryWhereInput) int + GroupMemberships func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupMembershipWhereInput) int + GroupSetting func(childComplexity int, id string) int + GroupSettingHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupSettingHistoryWhereInput) int + GroupSettings func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupSettingWhereInput) int + Groups func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.GroupOrder, where *generated.GroupWhereInput) int + Hush func(childComplexity int, id string) int + HushHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.HushHistoryOrder, where *generated.HushHistoryWhereInput) int + Hushes func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.HushOrder, where *generated.HushWhereInput) int + Integration func(childComplexity int, id string) int + IntegrationHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.IntegrationHistoryOrder, where *generated.IntegrationHistoryWhereInput) int + Integrations func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.IntegrationOrder, where *generated.IntegrationWhereInput) int + Invite func(childComplexity int, id string) int + Invites func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.InviteWhereInput) int + Node func(childComplexity int, id string) int + Nodes func(childComplexity int, ids []string) int + NoteHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.NoteHistoryWhereInput) int + Notes func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.NoteWhereInput) int + OauthProvider func(childComplexity int, id string) int + OauthProviderHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OauthProviderHistoryWhereInput) int + OauthProviders func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OauthProviderWhereInput) int + OhAuthTooToken func(childComplexity int, id string) int + OhAuthTooTokens func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OhAuthTooTokenWhereInput) int + OrgMembership func(childComplexity int, id string) int + OrgMembershipHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrgMembershipHistoryWhereInput) int + OrgMemberships func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrgMembershipWhereInput) int + Organization func(childComplexity int, id string) int + OrganizationHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.OrganizationHistoryOrder, where *generated.OrganizationHistoryWhereInput) int + OrganizationSetting func(childComplexity int, id string) int + OrganizationSettingHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrganizationSettingHistoryWhereInput) int + OrganizationSettings func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrganizationSettingWhereInput) int + Organizations func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.OrganizationOrder, where *generated.OrganizationWhereInput) int + PersonalAccessToken func(childComplexity int, id string) int + PersonalAccessTokens func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.PersonalAccessTokenWhereInput) int + Search func(childComplexity int, query string) int + Subscriber func(childComplexity int, email string) int + Subscribers func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.SubscriberWhereInput) int + Template func(childComplexity int, id string) int + TemplateHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.TemplateHistoryOrder, where *generated.TemplateHistoryWhereInput) int + Templates func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.TemplateOrder, where *generated.TemplateWhereInput) int + TfaSetting func(childComplexity int, id *string) int + TfaSettings func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.TFASettingWhereInput) int + User func(childComplexity int, id string) int + UserHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.UserHistoryOrder, where *generated.UserHistoryWhereInput) int + UserSetting func(childComplexity int, id string) int + UserSettingHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.UserSettingHistoryWhereInput) int + UserSettings func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.UserSettingWhereInput) int + Users func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.UserOrder, where *generated.UserWhereInput) int + Webhook func(childComplexity int, id string) int + WebhookHistories func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.WebhookHistoryOrder, where *generated.WebhookHistoryWhereInput) int + Webhooks func(childComplexity int, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.WebhookOrder, where *generated.WebhookWhereInput) int + } + + Subscriber struct { + Active func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Email func(childComplexity int) int + Events func(childComplexity int) int + ID func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + PhoneNumber func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + VerifiedEmail func(childComplexity int) int + VerifiedPhone func(childComplexity int) int + } + + SubscriberBulkCreatePayload struct { + Subscribers func(childComplexity int) int + } + + SubscriberConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + SubscriberCreatePayload struct { + Subscriber func(childComplexity int) int + } + + SubscriberDeletePayload struct { + Email func(childComplexity int) int + } + + SubscriberEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + SubscriberSearchResult struct { + Subscribers func(childComplexity int) int + } + + SubscriberUpdatePayload struct { + Subscriber func(childComplexity int) int + } + + TFASetting struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + ID func(childComplexity int) int + Owner func(childComplexity int) int + RecoveryCodes func(childComplexity int) int + Tags func(childComplexity int) int + TfaSecret func(childComplexity int) int + TotpAllowed func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + Verified func(childComplexity int) int + } + + TFASettingConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + TFASettingCreatePayload struct { + TfaSetting func(childComplexity int) int + } + + TFASettingEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + TFASettingUpdatePayload struct { + TfaSetting func(childComplexity int) int + } + + Template struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + Documents func(childComplexity int) int + ID func(childComplexity int) int + Jsonconfig func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Tags func(childComplexity int) int + TemplateType func(childComplexity int) int + Uischema func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + TemplateBulkCreatePayload struct { + Templates func(childComplexity int) int + } + + TemplateConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + TemplateCreatePayload struct { + Template func(childComplexity int) int + } + + TemplateDeletePayload struct { + DeletedID func(childComplexity int) int + } + + TemplateEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + TemplateHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + Jsonconfig func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + TemplateType func(childComplexity int) int + Uischema func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + TemplateHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + TemplateHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + TemplateUpdatePayload struct { + Template func(childComplexity int) int + } + + User struct { + AuthProvider func(childComplexity int) int + AvatarLocalFile func(childComplexity int) int + AvatarRemoteURL func(childComplexity int) int + AvatarUpdatedAt func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + DisplayName func(childComplexity int) int + Email func(childComplexity int) int + Events func(childComplexity int) int + Files func(childComplexity int) int + FirstName func(childComplexity int) int + GroupMemberships func(childComplexity int) int + Groups func(childComplexity int) int + ID func(childComplexity int) int + LastName func(childComplexity int) int + LastSeen func(childComplexity int) int + OrgMemberships func(childComplexity int) int + Organizations func(childComplexity int) int + PersonalAccessTokens func(childComplexity int) int + Role func(childComplexity int) int + Setting func(childComplexity int) int + Sub func(childComplexity int) int + Tags func(childComplexity int) int + TfaSettings func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + UserBulkCreatePayload struct { + Users func(childComplexity int) int + } + + UserConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + UserCreatePayload struct { + User func(childComplexity int) int + } + + UserDeletePayload struct { + DeletedID func(childComplexity int) int + } + + UserEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + UserHistory struct { + AuthProvider func(childComplexity int) int + AvatarLocalFile func(childComplexity int) int + AvatarRemoteURL func(childComplexity int) int + AvatarUpdatedAt func(childComplexity int) int + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + DisplayName func(childComplexity int) int + Email func(childComplexity int) int + FirstName func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + LastName func(childComplexity int) int + LastSeen func(childComplexity int) int + Operation func(childComplexity int) int + Ref func(childComplexity int) int + Role func(childComplexity int) int + Sub func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + UserHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + UserHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + UserSearchResult struct { + Users func(childComplexity int) int + } + + UserSetting struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DefaultOrg func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + EmailConfirmed func(childComplexity int) int + ID func(childComplexity int) int + IsTfaEnabled func(childComplexity int) int + IsWebauthnAllowed func(childComplexity int) int + Locked func(childComplexity int) int + SilencedAt func(childComplexity int) int + Status func(childComplexity int) int + SuspendedAt func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + User func(childComplexity int) int + UserID func(childComplexity int) int + } + + UserSettingBulkCreatePayload struct { + UserSettings func(childComplexity int) int + } + + UserSettingConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + UserSettingCreatePayload struct { + UserSetting func(childComplexity int) int + } + + UserSettingEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + UserSettingHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + EmailConfirmed func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + IsTfaEnabled func(childComplexity int) int + IsWebauthnAllowed func(childComplexity int) int + Locked func(childComplexity int) int + Operation func(childComplexity int) int + Ref func(childComplexity int) int + SilencedAt func(childComplexity int) int + Status func(childComplexity int) int + SuspendedAt func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + UserID func(childComplexity int) int + } + + UserSettingHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + UserSettingHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + UserSettingUpdatePayload struct { + UserSetting func(childComplexity int) int + } + + UserUpdatePayload struct { + User func(childComplexity int) int + } + + Webhook struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DestinationURL func(childComplexity int) int + Enabled func(childComplexity int) int + Events func(childComplexity int) int + Failures func(childComplexity int) int + ID func(childComplexity int) int + Integrations func(childComplexity int) int + LastError func(childComplexity int) int + LastResponse func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + OwnerID func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + WebhookBulkCreatePayload struct { + Webhooks func(childComplexity int) int + } + + WebhookConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + WebhookCreatePayload struct { + Webhook func(childComplexity int) int + } + + WebhookDeletePayload struct { + DeletedID func(childComplexity int) int + } + + WebhookEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + WebhookHistory struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + DeletedBy func(childComplexity int) int + Description func(childComplexity int) int + DestinationURL func(childComplexity int) int + Enabled func(childComplexity int) int + Failures func(childComplexity int) int + HistoryTime func(childComplexity int) int + ID func(childComplexity int) int + LastError func(childComplexity int) int + LastResponse func(childComplexity int) int + Name func(childComplexity int) int + Operation func(childComplexity int) int + OwnerID func(childComplexity int) int + Ref func(childComplexity int) int + Tags func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + + WebhookHistoryConnection struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + WebhookHistoryEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + WebhookUpdatePayload struct { + Webhook func(childComplexity int) int + } +} + +type MutationResolver interface { + CreateAPIToken(ctx context.Context, input generated.CreateAPITokenInput) (*APITokenCreatePayload, error) + CreateBulkAPIToken(ctx context.Context, input []*generated.CreateAPITokenInput) (*APITokenBulkCreatePayload, error) + CreateBulkCSVAPIToken(ctx context.Context, input graphql.Upload) (*APITokenBulkCreatePayload, error) + UpdateAPIToken(ctx context.Context, id string, input generated.UpdateAPITokenInput) (*APITokenUpdatePayload, error) + DeleteAPIToken(ctx context.Context, id string) (*APITokenDeletePayload, error) + CreateContact(ctx context.Context, input generated.CreateContactInput) (*ContactCreatePayload, error) + CreateBulkContact(ctx context.Context, input []*generated.CreateContactInput) (*ContactBulkCreatePayload, error) + CreateBulkCSVContact(ctx context.Context, input graphql.Upload) (*ContactBulkCreatePayload, error) + UpdateContact(ctx context.Context, id string, input generated.UpdateContactInput) (*ContactUpdatePayload, error) + DeleteContact(ctx context.Context, id string) (*ContactDeletePayload, error) + CreateDocumentData(ctx context.Context, input generated.CreateDocumentDataInput) (*DocumentDataCreatePayload, error) + CreateBulkDocumentData(ctx context.Context, input []*generated.CreateDocumentDataInput) (*DocumentDataBulkCreatePayload, error) + CreateBulkCSVDocumentData(ctx context.Context, input graphql.Upload) (*DocumentDataBulkCreatePayload, error) + UpdateDocumentData(ctx context.Context, id string, input generated.UpdateDocumentDataInput) (*DocumentDataUpdatePayload, error) + DeleteDocumentData(ctx context.Context, id string) (*DocumentDataDeletePayload, error) + CreateEntitlement(ctx context.Context, input generated.CreateEntitlementInput) (*EntitlementCreatePayload, error) + CreateBulkEntitlement(ctx context.Context, input []*generated.CreateEntitlementInput) (*EntitlementBulkCreatePayload, error) + CreateBulkCSVEntitlement(ctx context.Context, input graphql.Upload) (*EntitlementBulkCreatePayload, error) + UpdateEntitlement(ctx context.Context, id string, input generated.UpdateEntitlementInput) (*EntitlementUpdatePayload, error) + DeleteEntitlement(ctx context.Context, id string) (*EntitlementDeletePayload, error) + CreateEntitlementPlan(ctx context.Context, input generated.CreateEntitlementPlanInput) (*EntitlementPlanCreatePayload, error) + CreateBulkEntitlementPlan(ctx context.Context, input []*generated.CreateEntitlementPlanInput) (*EntitlementPlanBulkCreatePayload, error) + CreateBulkCSVEntitlementPlan(ctx context.Context, input graphql.Upload) (*EntitlementPlanBulkCreatePayload, error) + UpdateEntitlementPlan(ctx context.Context, id string, input generated.UpdateEntitlementPlanInput) (*EntitlementPlanUpdatePayload, error) + DeleteEntitlementPlan(ctx context.Context, id string) (*EntitlementPlanDeletePayload, error) + CreateEntitlementPlanFeature(ctx context.Context, input generated.CreateEntitlementPlanFeatureInput) (*EntitlementPlanFeatureCreatePayload, error) + CreateBulkEntitlementPlanFeature(ctx context.Context, input []*generated.CreateEntitlementPlanFeatureInput) (*EntitlementPlanFeatureBulkCreatePayload, error) + CreateBulkCSVEntitlementPlanFeature(ctx context.Context, input graphql.Upload) (*EntitlementPlanFeatureBulkCreatePayload, error) + UpdateEntitlementPlanFeature(ctx context.Context, id string, input generated.UpdateEntitlementPlanFeatureInput) (*EntitlementPlanFeatureUpdatePayload, error) + DeleteEntitlementPlanFeature(ctx context.Context, id string) (*EntitlementPlanFeatureDeletePayload, error) + CreateEntity(ctx context.Context, input generated.CreateEntityInput) (*EntityCreatePayload, error) + CreateBulkEntity(ctx context.Context, input []*generated.CreateEntityInput) (*EntityBulkCreatePayload, error) + CreateBulkCSVEntity(ctx context.Context, input graphql.Upload) (*EntityBulkCreatePayload, error) + UpdateEntity(ctx context.Context, id string, input generated.UpdateEntityInput) (*EntityUpdatePayload, error) + DeleteEntity(ctx context.Context, id string) (*EntityDeletePayload, error) + CreateEntityType(ctx context.Context, input generated.CreateEntityTypeInput) (*EntityTypeCreatePayload, error) + CreateBulkEntityType(ctx context.Context, input []*generated.CreateEntityTypeInput) (*EntityTypeBulkCreatePayload, error) + CreateBulkCSVEntityType(ctx context.Context, input graphql.Upload) (*EntityTypeBulkCreatePayload, error) + UpdateEntityType(ctx context.Context, id string, input generated.UpdateEntityTypeInput) (*EntityTypeUpdatePayload, error) + DeleteEntityType(ctx context.Context, id string) (*EntityTypeDeletePayload, error) + CreateEvent(ctx context.Context, input generated.CreateEventInput) (*EventCreatePayload, error) + CreateBulkEvent(ctx context.Context, input []*generated.CreateEventInput) (*EventBulkCreatePayload, error) + CreateBulkCSVEvent(ctx context.Context, input graphql.Upload) (*EventBulkCreatePayload, error) + UpdateEvent(ctx context.Context, id string, input generated.UpdateEventInput) (*EventUpdatePayload, error) + DeleteEvent(ctx context.Context, id string) (*EventDeletePayload, error) + CreateFeature(ctx context.Context, input generated.CreateFeatureInput) (*FeatureCreatePayload, error) + CreateBulkFeature(ctx context.Context, input []*generated.CreateFeatureInput) (*FeatureBulkCreatePayload, error) + CreateBulkCSVFeature(ctx context.Context, input graphql.Upload) (*FeatureBulkCreatePayload, error) + UpdateFeature(ctx context.Context, id string, input generated.UpdateFeatureInput) (*FeatureUpdatePayload, error) + DeleteFeature(ctx context.Context, id string) (*FeatureDeletePayload, error) + CreateFile(ctx context.Context, input generated.CreateFileInput) (*FileCreatePayload, error) + CreateBulkFile(ctx context.Context, input []*generated.CreateFileInput) (*FileBulkCreatePayload, error) + CreateBulkCSVFile(ctx context.Context, input graphql.Upload) (*FileBulkCreatePayload, error) + UpdateFile(ctx context.Context, id string, input generated.UpdateFileInput) (*FileUpdatePayload, error) + DeleteFile(ctx context.Context, id string) (*FileDeletePayload, error) + CreateGroup(ctx context.Context, input generated.CreateGroupInput) (*GroupCreatePayload, error) + CreateBulkGroup(ctx context.Context, input []*generated.CreateGroupInput) (*GroupBulkCreatePayload, error) + CreateBulkCSVGroup(ctx context.Context, input graphql.Upload) (*GroupBulkCreatePayload, error) + UpdateGroup(ctx context.Context, id string, input generated.UpdateGroupInput) (*GroupUpdatePayload, error) + DeleteGroup(ctx context.Context, id string) (*GroupDeletePayload, error) + CreateGroupMembership(ctx context.Context, input generated.CreateGroupMembershipInput) (*GroupMembershipCreatePayload, error) + CreateBulkGroupMembership(ctx context.Context, input []*generated.CreateGroupMembershipInput) (*GroupMembershipBulkCreatePayload, error) + CreateBulkCSVGroupMembership(ctx context.Context, input graphql.Upload) (*GroupMembershipBulkCreatePayload, error) + UpdateGroupMembership(ctx context.Context, id string, input generated.UpdateGroupMembershipInput) (*GroupMembershipUpdatePayload, error) + DeleteGroupMembership(ctx context.Context, id string) (*GroupMembershipDeletePayload, error) + CreateGroupSetting(ctx context.Context, input generated.CreateGroupSettingInput) (*GroupSettingCreatePayload, error) + CreateBulkGroupSetting(ctx context.Context, input []*generated.CreateGroupSettingInput) (*GroupSettingBulkCreatePayload, error) + CreateBulkCSVGroupSetting(ctx context.Context, input graphql.Upload) (*GroupSettingBulkCreatePayload, error) + UpdateGroupSetting(ctx context.Context, id string, input generated.UpdateGroupSettingInput) (*GroupSettingUpdatePayload, error) + DeleteGroupSetting(ctx context.Context, id string) (*GroupSettingDeletePayload, error) + CreateHush(ctx context.Context, input generated.CreateHushInput) (*HushCreatePayload, error) + CreateBulkHush(ctx context.Context, input []*generated.CreateHushInput) (*HushBulkCreatePayload, error) + CreateBulkCSVHush(ctx context.Context, input graphql.Upload) (*HushBulkCreatePayload, error) + UpdateHush(ctx context.Context, id string, input generated.UpdateHushInput) (*HushUpdatePayload, error) + DeleteHush(ctx context.Context, id string) (*HushDeletePayload, error) + CreateIntegration(ctx context.Context, input generated.CreateIntegrationInput) (*IntegrationCreatePayload, error) + CreateBulkIntegration(ctx context.Context, input []*generated.CreateIntegrationInput) (*IntegrationBulkCreatePayload, error) + CreateBulkCSVIntegration(ctx context.Context, input graphql.Upload) (*IntegrationBulkCreatePayload, error) + UpdateIntegration(ctx context.Context, id string, input generated.UpdateIntegrationInput) (*IntegrationUpdatePayload, error) + DeleteIntegration(ctx context.Context, id string) (*IntegrationDeletePayload, error) + CreateInvite(ctx context.Context, input generated.CreateInviteInput) (*InviteCreatePayload, error) + CreateBulkInvite(ctx context.Context, input []*generated.CreateInviteInput) (*InviteBulkCreatePayload, error) + CreateBulkCSVInvite(ctx context.Context, input graphql.Upload) (*InviteBulkCreatePayload, error) + UpdateInvite(ctx context.Context, id string, input generated.UpdateInviteInput) (*InviteUpdatePayload, error) + DeleteInvite(ctx context.Context, id string) (*InviteDeletePayload, error) + CreateOauthProvider(ctx context.Context, input generated.CreateOauthProviderInput) (*OauthProviderCreatePayload, error) + CreateBulkOauthProvider(ctx context.Context, input []*generated.CreateOauthProviderInput) (*OauthProviderBulkCreatePayload, error) + CreateBulkCSVOauthProvider(ctx context.Context, input graphql.Upload) (*OauthProviderBulkCreatePayload, error) + UpdateOauthProvider(ctx context.Context, id string, input generated.UpdateOauthProviderInput) (*OauthProviderUpdatePayload, error) + DeleteOauthProvider(ctx context.Context, id string) (*OauthProviderDeletePayload, error) + CreateOhAuthTooToken(ctx context.Context, input generated.CreateOhAuthTooTokenInput) (*OhAuthTooTokenCreatePayload, error) + CreateBulkOhAuthTooToken(ctx context.Context, input []*generated.CreateOhAuthTooTokenInput) (*OhAuthTooTokenBulkCreatePayload, error) + CreateBulkCSVOhAuthTooToken(ctx context.Context, input graphql.Upload) (*OhAuthTooTokenBulkCreatePayload, error) + UpdateOhAuthTooToken(ctx context.Context, id string, input generated.UpdateOhAuthTooTokenInput) (*OhAuthTooTokenUpdatePayload, error) + DeleteOhAuthTooToken(ctx context.Context, id string) (*OhAuthTooTokenDeletePayload, error) + CreateOrganization(ctx context.Context, input generated.CreateOrganizationInput) (*OrganizationCreatePayload, error) + CreateBulkOrganization(ctx context.Context, input []*generated.CreateOrganizationInput) (*OrganizationBulkCreatePayload, error) + CreateBulkCSVOrganization(ctx context.Context, input graphql.Upload) (*OrganizationBulkCreatePayload, error) + UpdateOrganization(ctx context.Context, id string, input generated.UpdateOrganizationInput) (*OrganizationUpdatePayload, error) + DeleteOrganization(ctx context.Context, id string) (*OrganizationDeletePayload, error) + CreateOrganizationSetting(ctx context.Context, input generated.CreateOrganizationSettingInput) (*OrganizationSettingCreatePayload, error) + CreateBulkOrganizationSetting(ctx context.Context, input []*generated.CreateOrganizationSettingInput) (*OrganizationSettingBulkCreatePayload, error) + CreateBulkCSVOrganizationSetting(ctx context.Context, input graphql.Upload) (*OrganizationSettingBulkCreatePayload, error) + UpdateOrganizationSetting(ctx context.Context, id string, input generated.UpdateOrganizationSettingInput) (*OrganizationSettingUpdatePayload, error) + DeleteOrganizationSetting(ctx context.Context, id string) (*OrganizationSettingDeletePayload, error) + CreateOrgMembership(ctx context.Context, input generated.CreateOrgMembershipInput) (*OrgMembershipCreatePayload, error) + CreateBulkOrgMembership(ctx context.Context, input []*generated.CreateOrgMembershipInput) (*OrgMembershipBulkCreatePayload, error) + CreateBulkCSVOrgMembership(ctx context.Context, input graphql.Upload) (*OrgMembershipBulkCreatePayload, error) + UpdateOrgMembership(ctx context.Context, id string, input generated.UpdateOrgMembershipInput) (*OrgMembershipUpdatePayload, error) + DeleteOrgMembership(ctx context.Context, id string) (*OrgMembershipDeletePayload, error) + CreatePersonalAccessToken(ctx context.Context, input generated.CreatePersonalAccessTokenInput) (*PersonalAccessTokenCreatePayload, error) + CreateBulkPersonalAccessToken(ctx context.Context, input []*generated.CreatePersonalAccessTokenInput) (*PersonalAccessTokenBulkCreatePayload, error) + CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload) (*PersonalAccessTokenBulkCreatePayload, error) + UpdatePersonalAccessToken(ctx context.Context, id string, input generated.UpdatePersonalAccessTokenInput) (*PersonalAccessTokenUpdatePayload, error) + DeletePersonalAccessToken(ctx context.Context, id string) (*PersonalAccessTokenDeletePayload, error) + CreateSubscriber(ctx context.Context, input generated.CreateSubscriberInput) (*SubscriberCreatePayload, error) + CreateBulkSubscriber(ctx context.Context, input []*generated.CreateSubscriberInput) (*SubscriberBulkCreatePayload, error) + CreateBulkCSVSubscriber(ctx context.Context, input graphql.Upload) (*SubscriberBulkCreatePayload, error) + UpdateSubscriber(ctx context.Context, email string, input generated.UpdateSubscriberInput) (*SubscriberUpdatePayload, error) + DeleteSubscriber(ctx context.Context, email string, ownerID *string) (*SubscriberDeletePayload, error) + CreateTemplate(ctx context.Context, input generated.CreateTemplateInput) (*TemplateCreatePayload, error) + CreateBulkTemplate(ctx context.Context, input []*generated.CreateTemplateInput) (*TemplateBulkCreatePayload, error) + CreateBulkCSVTemplate(ctx context.Context, input graphql.Upload) (*TemplateBulkCreatePayload, error) + UpdateTemplate(ctx context.Context, id string, input generated.UpdateTemplateInput) (*TemplateUpdatePayload, error) + DeleteTemplate(ctx context.Context, id string) (*TemplateDeletePayload, error) + CreateTFASetting(ctx context.Context, input generated.CreateTFASettingInput) (*TFASettingCreatePayload, error) + UpdateTFASetting(ctx context.Context, input generated.UpdateTFASettingInput) (*TFASettingUpdatePayload, error) + CreateUser(ctx context.Context, input generated.CreateUserInput) (*UserCreatePayload, error) + UpdateUser(ctx context.Context, id string, input generated.UpdateUserInput) (*UserUpdatePayload, error) + DeleteUser(ctx context.Context, id string) (*UserDeletePayload, error) + CreateUserSetting(ctx context.Context, input generated.CreateUserSettingInput) (*UserSettingCreatePayload, error) + CreateBulkUserSetting(ctx context.Context, input []*generated.CreateUserSettingInput) (*UserSettingBulkCreatePayload, error) + CreateBulkCSVUserSetting(ctx context.Context, input graphql.Upload) (*UserSettingBulkCreatePayload, error) + UpdateUserSetting(ctx context.Context, id string, input generated.UpdateUserSettingInput) (*UserSettingUpdatePayload, error) + CreateWebhook(ctx context.Context, input generated.CreateWebhookInput) (*WebhookCreatePayload, error) + CreateBulkWebhook(ctx context.Context, input []*generated.CreateWebhookInput) (*WebhookBulkCreatePayload, error) + CreateBulkCSVWebhook(ctx context.Context, input graphql.Upload) (*WebhookBulkCreatePayload, error) + UpdateWebhook(ctx context.Context, id string, input generated.UpdateWebhookInput) (*WebhookUpdatePayload, error) + DeleteWebhook(ctx context.Context, id string) (*WebhookDeletePayload, error) +} +type QueryResolver interface { + Node(ctx context.Context, id string) (generated.Noder, error) + Nodes(ctx context.Context, ids []string) ([]generated.Noder, error) + APITokens(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.APITokenWhereInput) (*generated.APITokenConnection, error) + Contacts(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.ContactWhereInput) (*generated.ContactConnection, error) + ContactHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.ContactHistoryWhereInput) (*generated.ContactHistoryConnection, error) + DocumentDataSlice(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.DocumentDataWhereInput) (*generated.DocumentDataConnection, error) + DocumentDataHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.DocumentDataHistoryWhereInput) (*generated.DocumentDataHistoryConnection, error) + Entitlements(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementWhereInput) (*generated.EntitlementConnection, error) + EntitlementHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementHistoryWhereInput) (*generated.EntitlementHistoryConnection, error) + EntitlementPlans(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanWhereInput) (*generated.EntitlementPlanConnection, error) + EntitlementPlanFeatures(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanFeatureWhereInput) (*generated.EntitlementPlanFeatureConnection, error) + EntitlementPlanFeatureHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanFeatureHistoryWhereInput) (*generated.EntitlementPlanFeatureHistoryConnection, error) + EntitlementPlanHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EntitlementPlanHistoryWhereInput) (*generated.EntitlementPlanHistoryConnection, error) + Entities(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityOrder, where *generated.EntityWhereInput) (*generated.EntityConnection, error) + EntityHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityHistoryOrder, where *generated.EntityHistoryWhereInput) (*generated.EntityHistoryConnection, error) + EntityTypes(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityTypeOrder, where *generated.EntityTypeWhereInput) (*generated.EntityTypeConnection, error) + EntityTypeHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.EntityTypeHistoryOrder, where *generated.EntityTypeHistoryWhereInput) (*generated.EntityTypeHistoryConnection, error) + Events(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EventWhereInput) (*generated.EventConnection, error) + EventHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.EventHistoryWhereInput) (*generated.EventHistoryConnection, error) + Features(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FeatureWhereInput) (*generated.FeatureConnection, error) + FeatureHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FeatureHistoryWhereInput) (*generated.FeatureHistoryConnection, error) + Files(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FileWhereInput) (*generated.FileConnection, error) + FileHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.FileHistoryWhereInput) (*generated.FileHistoryConnection, error) + Groups(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.GroupOrder, where *generated.GroupWhereInput) (*generated.GroupConnection, error) + GroupHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.GroupHistoryOrder, where *generated.GroupHistoryWhereInput) (*generated.GroupHistoryConnection, error) + GroupMemberships(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupMembershipWhereInput) (*generated.GroupMembershipConnection, error) + GroupMembershipHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupMembershipHistoryWhereInput) (*generated.GroupMembershipHistoryConnection, error) + GroupSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupSettingWhereInput) (*generated.GroupSettingConnection, error) + GroupSettingHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.GroupSettingHistoryWhereInput) (*generated.GroupSettingHistoryConnection, error) + Hushes(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.HushOrder, where *generated.HushWhereInput) (*generated.HushConnection, error) + HushHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.HushHistoryOrder, where *generated.HushHistoryWhereInput) (*generated.HushHistoryConnection, error) + Integrations(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.IntegrationOrder, where *generated.IntegrationWhereInput) (*generated.IntegrationConnection, error) + IntegrationHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.IntegrationHistoryOrder, where *generated.IntegrationHistoryWhereInput) (*generated.IntegrationHistoryConnection, error) + Invites(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.InviteWhereInput) (*generated.InviteConnection, error) + Notes(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.NoteWhereInput) (*generated.NoteConnection, error) + NoteHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.NoteHistoryWhereInput) (*generated.NoteHistoryConnection, error) + OauthProviders(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OauthProviderWhereInput) (*generated.OauthProviderConnection, error) + OauthProviderHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OauthProviderHistoryWhereInput) (*generated.OauthProviderHistoryConnection, error) + OhAuthTooTokens(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OhAuthTooTokenWhereInput) (*generated.OhAuthTooTokenConnection, error) + OrgMemberships(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrgMembershipWhereInput) (*generated.OrgMembershipConnection, error) + OrgMembershipHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrgMembershipHistoryWhereInput) (*generated.OrgMembershipHistoryConnection, error) + Organizations(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.OrganizationOrder, where *generated.OrganizationWhereInput) (*generated.OrganizationConnection, error) + OrganizationHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.OrganizationHistoryOrder, where *generated.OrganizationHistoryWhereInput) (*generated.OrganizationHistoryConnection, error) + OrganizationSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrganizationSettingWhereInput) (*generated.OrganizationSettingConnection, error) + OrganizationSettingHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.OrganizationSettingHistoryWhereInput) (*generated.OrganizationSettingHistoryConnection, error) + PersonalAccessTokens(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.PersonalAccessTokenWhereInput) (*generated.PersonalAccessTokenConnection, error) + Subscribers(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.SubscriberWhereInput) (*generated.SubscriberConnection, error) + TfaSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.TFASettingWhereInput) (*generated.TFASettingConnection, error) + Templates(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.TemplateOrder, where *generated.TemplateWhereInput) (*generated.TemplateConnection, error) + TemplateHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.TemplateHistoryOrder, where *generated.TemplateHistoryWhereInput) (*generated.TemplateHistoryConnection, error) + Users(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.UserOrder, where *generated.UserWhereInput) (*generated.UserConnection, error) + UserHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.UserHistoryOrder, where *generated.UserHistoryWhereInput) (*generated.UserHistoryConnection, error) + UserSettings(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.UserSettingWhereInput) (*generated.UserSettingConnection, error) + UserSettingHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *generated.UserSettingHistoryWhereInput) (*generated.UserSettingHistoryConnection, error) + Webhooks(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.WebhookOrder, where *generated.WebhookWhereInput) (*generated.WebhookConnection, error) + WebhookHistories(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, orderBy *generated.WebhookHistoryOrder, where *generated.WebhookHistoryWhereInput) (*generated.WebhookHistoryConnection, error) + APIToken(ctx context.Context, id string) (*generated.APIToken, error) + AuditLogs(ctx context.Context, after *entgql.Cursor[string], first *int, before *entgql.Cursor[string], last *int, where *AuditLogWhereInput) (*AuditLogConnection, error) + Contact(ctx context.Context, id string) (*generated.Contact, error) + DocumentData(ctx context.Context, id string) (*generated.DocumentData, error) + Entitlement(ctx context.Context, id string) (*generated.Entitlement, error) + EntitlementPlan(ctx context.Context, id string) (*generated.EntitlementPlan, error) + EntitlementPlanFeature(ctx context.Context, id string) (*generated.EntitlementPlanFeature, error) + Entity(ctx context.Context, id string) (*generated.Entity, error) + EntityType(ctx context.Context, id string) (*generated.EntityType, error) + Event(ctx context.Context, id string) (*generated.Event, error) + Feature(ctx context.Context, id string) (*generated.Feature, error) + File(ctx context.Context, id string) (*generated.File, error) + Group(ctx context.Context, id string) (*generated.Group, error) + GroupMembership(ctx context.Context, id string) (*generated.GroupMembership, error) + GroupSetting(ctx context.Context, id string) (*generated.GroupSetting, error) + Hush(ctx context.Context, id string) (*generated.Hush, error) + Integration(ctx context.Context, id string) (*generated.Integration, error) + Invite(ctx context.Context, id string) (*generated.Invite, error) + OauthProvider(ctx context.Context, id string) (*generated.OauthProvider, error) + OhAuthTooToken(ctx context.Context, id string) (*generated.OhAuthTooToken, error) + Organization(ctx context.Context, id string) (*generated.Organization, error) + OrganizationSetting(ctx context.Context, id string) (*generated.OrganizationSetting, error) + OrgMembership(ctx context.Context, id string) (*generated.OrgMembership, error) + PersonalAccessToken(ctx context.Context, id string) (*generated.PersonalAccessToken, error) + Search(ctx context.Context, query string) (*GlobalSearchResultConnection, error) + Subscriber(ctx context.Context, email string) (*generated.Subscriber, error) + Template(ctx context.Context, id string) (*generated.Template, error) + TfaSetting(ctx context.Context, id *string) (*generated.TFASetting, error) + User(ctx context.Context, id string) (*generated.User, error) + UserSetting(ctx context.Context, id string) (*generated.UserSetting, error) + Webhook(ctx context.Context, id string) (*generated.Webhook, error) +} + +type CreateEntityInputResolver interface { + Note(ctx context.Context, obj *generated.CreateEntityInput, data *generated.CreateNoteInput) error +} +type CreateGroupInputResolver interface { + CreateGroupSettings(ctx context.Context, obj *generated.CreateGroupInput, data *generated.CreateGroupSettingInput) error +} +type CreateOrganizationInputResolver interface { + CreateOrgSettings(ctx context.Context, obj *generated.CreateOrganizationInput, data *generated.CreateOrganizationSettingInput) error +} +type UpdateEntityInputResolver interface { + Note(ctx context.Context, obj *generated.UpdateEntityInput, data *generated.CreateNoteInput) error +} +type UpdateGroupInputResolver interface { + AddGroupMembers(ctx context.Context, obj *generated.UpdateGroupInput, data []*generated.CreateGroupMembershipInput) error + UpdateGroupSettings(ctx context.Context, obj *generated.UpdateGroupInput, data *generated.UpdateGroupSettingInput) error +} +type UpdateOrganizationInputResolver interface { + AddOrgMembers(ctx context.Context, obj *generated.UpdateOrganizationInput, data []*generated.CreateOrgMembershipInput) error + UpdateOrgSettings(ctx context.Context, obj *generated.UpdateOrganizationInput, data *generated.UpdateOrganizationSettingInput) error +} +type UpdateTFASettingInputResolver interface { + RegenBackupCodes(ctx context.Context, obj *generated.UpdateTFASettingInput, data *bool) error +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "APIToken.createdAt": + if e.complexity.APIToken.CreatedAt == nil { + break + } + + return e.complexity.APIToken.CreatedAt(childComplexity), true + + case "APIToken.createdBy": + if e.complexity.APIToken.CreatedBy == nil { + break + } + + return e.complexity.APIToken.CreatedBy(childComplexity), true + + case "APIToken.deletedAt": + if e.complexity.APIToken.DeletedAt == nil { + break + } + + return e.complexity.APIToken.DeletedAt(childComplexity), true + + case "APIToken.deletedBy": + if e.complexity.APIToken.DeletedBy == nil { + break + } + + return e.complexity.APIToken.DeletedBy(childComplexity), true + + case "APIToken.description": + if e.complexity.APIToken.Description == nil { + break + } + + return e.complexity.APIToken.Description(childComplexity), true + + case "APIToken.expiresAt": + if e.complexity.APIToken.ExpiresAt == nil { + break + } + + return e.complexity.APIToken.ExpiresAt(childComplexity), true + + case "APIToken.id": + if e.complexity.APIToken.ID == nil { + break + } + + return e.complexity.APIToken.ID(childComplexity), true + + case "APIToken.lastUsedAt": + if e.complexity.APIToken.LastUsedAt == nil { + break + } + + return e.complexity.APIToken.LastUsedAt(childComplexity), true + + case "APIToken.name": + if e.complexity.APIToken.Name == nil { + break + } + + return e.complexity.APIToken.Name(childComplexity), true + + case "APIToken.owner": + if e.complexity.APIToken.Owner == nil { + break + } + + return e.complexity.APIToken.Owner(childComplexity), true + + case "APIToken.ownerID": + if e.complexity.APIToken.OwnerID == nil { + break + } + + return e.complexity.APIToken.OwnerID(childComplexity), true + + case "APIToken.scopes": + if e.complexity.APIToken.Scopes == nil { + break + } + + return e.complexity.APIToken.Scopes(childComplexity), true + + case "APIToken.tags": + if e.complexity.APIToken.Tags == nil { + break + } + + return e.complexity.APIToken.Tags(childComplexity), true + + case "APIToken.token": + if e.complexity.APIToken.Token == nil { + break + } + + return e.complexity.APIToken.Token(childComplexity), true + + case "APIToken.updatedAt": + if e.complexity.APIToken.UpdatedAt == nil { + break + } + + return e.complexity.APIToken.UpdatedAt(childComplexity), true + + case "APIToken.updatedBy": + if e.complexity.APIToken.UpdatedBy == nil { + break + } + + return e.complexity.APIToken.UpdatedBy(childComplexity), true + + case "APITokenBulkCreatePayload.apiTokens": + if e.complexity.APITokenBulkCreatePayload.APITokens == nil { + break + } + + return e.complexity.APITokenBulkCreatePayload.APITokens(childComplexity), true + + case "APITokenConnection.edges": + if e.complexity.APITokenConnection.Edges == nil { + break + } + + return e.complexity.APITokenConnection.Edges(childComplexity), true + + case "APITokenConnection.pageInfo": + if e.complexity.APITokenConnection.PageInfo == nil { + break + } + + return e.complexity.APITokenConnection.PageInfo(childComplexity), true + + case "APITokenConnection.totalCount": + if e.complexity.APITokenConnection.TotalCount == nil { + break + } + + return e.complexity.APITokenConnection.TotalCount(childComplexity), true + + case "APITokenCreatePayload.apiToken": + if e.complexity.APITokenCreatePayload.APIToken == nil { + break + } + + return e.complexity.APITokenCreatePayload.APIToken(childComplexity), true + + case "APITokenDeletePayload.deletedID": + if e.complexity.APITokenDeletePayload.DeletedID == nil { + break + } + + return e.complexity.APITokenDeletePayload.DeletedID(childComplexity), true + + case "APITokenEdge.cursor": + if e.complexity.APITokenEdge.Cursor == nil { + break + } + + return e.complexity.APITokenEdge.Cursor(childComplexity), true + + case "APITokenEdge.node": + if e.complexity.APITokenEdge.Node == nil { + break + } + + return e.complexity.APITokenEdge.Node(childComplexity), true + + case "APITokenUpdatePayload.apiToken": + if e.complexity.APITokenUpdatePayload.APIToken == nil { + break + } + + return e.complexity.APITokenUpdatePayload.APIToken(childComplexity), true + + case "AuditLog.changes": + if e.complexity.AuditLog.Changes == nil { + break + } + + return e.complexity.AuditLog.Changes(childComplexity), true + + case "AuditLog.id": + if e.complexity.AuditLog.ID == nil { + break + } + + return e.complexity.AuditLog.ID(childComplexity), true + + case "AuditLog.operation": + if e.complexity.AuditLog.Operation == nil { + break + } + + return e.complexity.AuditLog.Operation(childComplexity), true + + case "AuditLog.table": + if e.complexity.AuditLog.Table == nil { + break + } + + return e.complexity.AuditLog.Table(childComplexity), true + + case "AuditLog.time": + if e.complexity.AuditLog.Time == nil { + break + } + + return e.complexity.AuditLog.Time(childComplexity), true + + case "AuditLog.updatedBy": + if e.complexity.AuditLog.UpdatedBy == nil { + break + } + + return e.complexity.AuditLog.UpdatedBy(childComplexity), true + + case "AuditLogConnection.edges": + if e.complexity.AuditLogConnection.Edges == nil { + break + } + + return e.complexity.AuditLogConnection.Edges(childComplexity), true + + case "AuditLogConnection.pageInfo": + if e.complexity.AuditLogConnection.PageInfo == nil { + break + } + + return e.complexity.AuditLogConnection.PageInfo(childComplexity), true + + case "AuditLogConnection.totalCount": + if e.complexity.AuditLogConnection.TotalCount == nil { + break + } + + return e.complexity.AuditLogConnection.TotalCount(childComplexity), true + + case "AuditLogEdge.cursor": + if e.complexity.AuditLogEdge.Cursor == nil { + break + } + + return e.complexity.AuditLogEdge.Cursor(childComplexity), true + + case "AuditLogEdge.node": + if e.complexity.AuditLogEdge.Node == nil { + break + } + + return e.complexity.AuditLogEdge.Node(childComplexity), true + + case "Contact.address": + if e.complexity.Contact.Address == nil { + break + } + + return e.complexity.Contact.Address(childComplexity), true + + case "Contact.company": + if e.complexity.Contact.Company == nil { + break + } + + return e.complexity.Contact.Company(childComplexity), true + + case "Contact.createdAt": + if e.complexity.Contact.CreatedAt == nil { + break + } + + return e.complexity.Contact.CreatedAt(childComplexity), true + + case "Contact.createdBy": + if e.complexity.Contact.CreatedBy == nil { + break + } + + return e.complexity.Contact.CreatedBy(childComplexity), true + + case "Contact.deletedAt": + if e.complexity.Contact.DeletedAt == nil { + break + } + + return e.complexity.Contact.DeletedAt(childComplexity), true + + case "Contact.deletedBy": + if e.complexity.Contact.DeletedBy == nil { + break + } + + return e.complexity.Contact.DeletedBy(childComplexity), true + + case "Contact.email": + if e.complexity.Contact.Email == nil { + break + } + + return e.complexity.Contact.Email(childComplexity), true + + case "Contact.entities": + if e.complexity.Contact.Entities == nil { + break + } + + return e.complexity.Contact.Entities(childComplexity), true + + case "Contact.fullName": + if e.complexity.Contact.FullName == nil { + break + } + + return e.complexity.Contact.FullName(childComplexity), true + + case "Contact.id": + if e.complexity.Contact.ID == nil { + break + } + + return e.complexity.Contact.ID(childComplexity), true + + case "Contact.owner": + if e.complexity.Contact.Owner == nil { + break + } + + return e.complexity.Contact.Owner(childComplexity), true + + case "Contact.ownerID": + if e.complexity.Contact.OwnerID == nil { + break + } + + return e.complexity.Contact.OwnerID(childComplexity), true + + case "Contact.phoneNumber": + if e.complexity.Contact.PhoneNumber == nil { + break + } + + return e.complexity.Contact.PhoneNumber(childComplexity), true + + case "Contact.status": + if e.complexity.Contact.Status == nil { + break + } + + return e.complexity.Contact.Status(childComplexity), true + + case "Contact.tags": + if e.complexity.Contact.Tags == nil { + break + } + + return e.complexity.Contact.Tags(childComplexity), true + + case "Contact.title": + if e.complexity.Contact.Title == nil { + break + } + + return e.complexity.Contact.Title(childComplexity), true + + case "Contact.updatedAt": + if e.complexity.Contact.UpdatedAt == nil { + break + } + + return e.complexity.Contact.UpdatedAt(childComplexity), true + + case "Contact.updatedBy": + if e.complexity.Contact.UpdatedBy == nil { + break + } + + return e.complexity.Contact.UpdatedBy(childComplexity), true + + case "ContactBulkCreatePayload.contacts": + if e.complexity.ContactBulkCreatePayload.Contacts == nil { + break + } + + return e.complexity.ContactBulkCreatePayload.Contacts(childComplexity), true + + case "ContactConnection.edges": + if e.complexity.ContactConnection.Edges == nil { + break + } + + return e.complexity.ContactConnection.Edges(childComplexity), true + + case "ContactConnection.pageInfo": + if e.complexity.ContactConnection.PageInfo == nil { + break + } + + return e.complexity.ContactConnection.PageInfo(childComplexity), true + + case "ContactConnection.totalCount": + if e.complexity.ContactConnection.TotalCount == nil { + break + } + + return e.complexity.ContactConnection.TotalCount(childComplexity), true + + case "ContactCreatePayload.contact": + if e.complexity.ContactCreatePayload.Contact == nil { + break + } + + return e.complexity.ContactCreatePayload.Contact(childComplexity), true + + case "ContactDeletePayload.deletedID": + if e.complexity.ContactDeletePayload.DeletedID == nil { + break + } + + return e.complexity.ContactDeletePayload.DeletedID(childComplexity), true + + case "ContactEdge.cursor": + if e.complexity.ContactEdge.Cursor == nil { + break + } + + return e.complexity.ContactEdge.Cursor(childComplexity), true + + case "ContactEdge.node": + if e.complexity.ContactEdge.Node == nil { + break + } + + return e.complexity.ContactEdge.Node(childComplexity), true + + case "ContactHistory.address": + if e.complexity.ContactHistory.Address == nil { + break + } + + return e.complexity.ContactHistory.Address(childComplexity), true + + case "ContactHistory.company": + if e.complexity.ContactHistory.Company == nil { + break + } + + return e.complexity.ContactHistory.Company(childComplexity), true + + case "ContactHistory.createdAt": + if e.complexity.ContactHistory.CreatedAt == nil { + break + } + + return e.complexity.ContactHistory.CreatedAt(childComplexity), true + + case "ContactHistory.createdBy": + if e.complexity.ContactHistory.CreatedBy == nil { + break + } + + return e.complexity.ContactHistory.CreatedBy(childComplexity), true + + case "ContactHistory.deletedAt": + if e.complexity.ContactHistory.DeletedAt == nil { + break + } + + return e.complexity.ContactHistory.DeletedAt(childComplexity), true + + case "ContactHistory.deletedBy": + if e.complexity.ContactHistory.DeletedBy == nil { + break + } + + return e.complexity.ContactHistory.DeletedBy(childComplexity), true + + case "ContactHistory.email": + if e.complexity.ContactHistory.Email == nil { + break + } + + return e.complexity.ContactHistory.Email(childComplexity), true + + case "ContactHistory.fullName": + if e.complexity.ContactHistory.FullName == nil { + break + } + + return e.complexity.ContactHistory.FullName(childComplexity), true + + case "ContactHistory.historyTime": + if e.complexity.ContactHistory.HistoryTime == nil { + break + } + + return e.complexity.ContactHistory.HistoryTime(childComplexity), true + + case "ContactHistory.id": + if e.complexity.ContactHistory.ID == nil { + break + } + + return e.complexity.ContactHistory.ID(childComplexity), true + + case "ContactHistory.operation": + if e.complexity.ContactHistory.Operation == nil { + break + } + + return e.complexity.ContactHistory.Operation(childComplexity), true + + case "ContactHistory.ownerID": + if e.complexity.ContactHistory.OwnerID == nil { + break + } + + return e.complexity.ContactHistory.OwnerID(childComplexity), true + + case "ContactHistory.phoneNumber": + if e.complexity.ContactHistory.PhoneNumber == nil { + break + } + + return e.complexity.ContactHistory.PhoneNumber(childComplexity), true + + case "ContactHistory.ref": + if e.complexity.ContactHistory.Ref == nil { + break + } + + return e.complexity.ContactHistory.Ref(childComplexity), true + + case "ContactHistory.status": + if e.complexity.ContactHistory.Status == nil { + break + } + + return e.complexity.ContactHistory.Status(childComplexity), true + + case "ContactHistory.tags": + if e.complexity.ContactHistory.Tags == nil { + break + } + + return e.complexity.ContactHistory.Tags(childComplexity), true + + case "ContactHistory.title": + if e.complexity.ContactHistory.Title == nil { + break + } + + return e.complexity.ContactHistory.Title(childComplexity), true + + case "ContactHistory.updatedAt": + if e.complexity.ContactHistory.UpdatedAt == nil { + break + } + + return e.complexity.ContactHistory.UpdatedAt(childComplexity), true + + case "ContactHistory.updatedBy": + if e.complexity.ContactHistory.UpdatedBy == nil { + break + } + + return e.complexity.ContactHistory.UpdatedBy(childComplexity), true + + case "ContactHistoryConnection.edges": + if e.complexity.ContactHistoryConnection.Edges == nil { + break + } + + return e.complexity.ContactHistoryConnection.Edges(childComplexity), true + + case "ContactHistoryConnection.pageInfo": + if e.complexity.ContactHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.ContactHistoryConnection.PageInfo(childComplexity), true + + case "ContactHistoryConnection.totalCount": + if e.complexity.ContactHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.ContactHistoryConnection.TotalCount(childComplexity), true + + case "ContactHistoryEdge.cursor": + if e.complexity.ContactHistoryEdge.Cursor == nil { + break + } + + return e.complexity.ContactHistoryEdge.Cursor(childComplexity), true + + case "ContactHistoryEdge.node": + if e.complexity.ContactHistoryEdge.Node == nil { + break + } + + return e.complexity.ContactHistoryEdge.Node(childComplexity), true + + case "ContactUpdatePayload.contact": + if e.complexity.ContactUpdatePayload.Contact == nil { + break + } + + return e.complexity.ContactUpdatePayload.Contact(childComplexity), true + + case "DocumentData.createdAt": + if e.complexity.DocumentData.CreatedAt == nil { + break + } + + return e.complexity.DocumentData.CreatedAt(childComplexity), true + + case "DocumentData.createdBy": + if e.complexity.DocumentData.CreatedBy == nil { + break + } + + return e.complexity.DocumentData.CreatedBy(childComplexity), true + + case "DocumentData.data": + if e.complexity.DocumentData.Data == nil { + break + } + + return e.complexity.DocumentData.Data(childComplexity), true + + case "DocumentData.deletedAt": + if e.complexity.DocumentData.DeletedAt == nil { + break + } + + return e.complexity.DocumentData.DeletedAt(childComplexity), true + + case "DocumentData.deletedBy": + if e.complexity.DocumentData.DeletedBy == nil { + break + } + + return e.complexity.DocumentData.DeletedBy(childComplexity), true + + case "DocumentData.entity": + if e.complexity.DocumentData.Entity == nil { + break + } + + return e.complexity.DocumentData.Entity(childComplexity), true + + case "DocumentData.id": + if e.complexity.DocumentData.ID == nil { + break + } + + return e.complexity.DocumentData.ID(childComplexity), true + + case "DocumentData.owner": + if e.complexity.DocumentData.Owner == nil { + break + } + + return e.complexity.DocumentData.Owner(childComplexity), true + + case "DocumentData.ownerID": + if e.complexity.DocumentData.OwnerID == nil { + break + } + + return e.complexity.DocumentData.OwnerID(childComplexity), true + + case "DocumentData.tags": + if e.complexity.DocumentData.Tags == nil { + break + } + + return e.complexity.DocumentData.Tags(childComplexity), true + + case "DocumentData.template": + if e.complexity.DocumentData.Template == nil { + break + } + + return e.complexity.DocumentData.Template(childComplexity), true + + case "DocumentData.templateID": + if e.complexity.DocumentData.TemplateID == nil { + break + } + + return e.complexity.DocumentData.TemplateID(childComplexity), true + + case "DocumentData.updatedAt": + if e.complexity.DocumentData.UpdatedAt == nil { + break + } + + return e.complexity.DocumentData.UpdatedAt(childComplexity), true + + case "DocumentData.updatedBy": + if e.complexity.DocumentData.UpdatedBy == nil { + break + } + + return e.complexity.DocumentData.UpdatedBy(childComplexity), true + + case "DocumentDataBulkCreatePayload.documentData": + if e.complexity.DocumentDataBulkCreatePayload.DocumentData == nil { + break + } + + return e.complexity.DocumentDataBulkCreatePayload.DocumentData(childComplexity), true + + case "DocumentDataConnection.edges": + if e.complexity.DocumentDataConnection.Edges == nil { + break + } + + return e.complexity.DocumentDataConnection.Edges(childComplexity), true + + case "DocumentDataConnection.pageInfo": + if e.complexity.DocumentDataConnection.PageInfo == nil { + break + } + + return e.complexity.DocumentDataConnection.PageInfo(childComplexity), true + + case "DocumentDataConnection.totalCount": + if e.complexity.DocumentDataConnection.TotalCount == nil { + break + } + + return e.complexity.DocumentDataConnection.TotalCount(childComplexity), true + + case "DocumentDataCreatePayload.documentData": + if e.complexity.DocumentDataCreatePayload.DocumentData == nil { + break + } + + return e.complexity.DocumentDataCreatePayload.DocumentData(childComplexity), true + + case "DocumentDataDeletePayload.deletedID": + if e.complexity.DocumentDataDeletePayload.DeletedID == nil { + break + } + + return e.complexity.DocumentDataDeletePayload.DeletedID(childComplexity), true + + case "DocumentDataEdge.cursor": + if e.complexity.DocumentDataEdge.Cursor == nil { + break + } + + return e.complexity.DocumentDataEdge.Cursor(childComplexity), true + + case "DocumentDataEdge.node": + if e.complexity.DocumentDataEdge.Node == nil { + break + } + + return e.complexity.DocumentDataEdge.Node(childComplexity), true + + case "DocumentDataHistory.createdAt": + if e.complexity.DocumentDataHistory.CreatedAt == nil { + break + } + + return e.complexity.DocumentDataHistory.CreatedAt(childComplexity), true + + case "DocumentDataHistory.createdBy": + if e.complexity.DocumentDataHistory.CreatedBy == nil { + break + } + + return e.complexity.DocumentDataHistory.CreatedBy(childComplexity), true + + case "DocumentDataHistory.data": + if e.complexity.DocumentDataHistory.Data == nil { + break + } + + return e.complexity.DocumentDataHistory.Data(childComplexity), true + + case "DocumentDataHistory.deletedAt": + if e.complexity.DocumentDataHistory.DeletedAt == nil { + break + } + + return e.complexity.DocumentDataHistory.DeletedAt(childComplexity), true + + case "DocumentDataHistory.deletedBy": + if e.complexity.DocumentDataHistory.DeletedBy == nil { + break + } + + return e.complexity.DocumentDataHistory.DeletedBy(childComplexity), true + + case "DocumentDataHistory.historyTime": + if e.complexity.DocumentDataHistory.HistoryTime == nil { + break + } + + return e.complexity.DocumentDataHistory.HistoryTime(childComplexity), true + + case "DocumentDataHistory.id": + if e.complexity.DocumentDataHistory.ID == nil { + break + } + + return e.complexity.DocumentDataHistory.ID(childComplexity), true + + case "DocumentDataHistory.operation": + if e.complexity.DocumentDataHistory.Operation == nil { + break + } + + return e.complexity.DocumentDataHistory.Operation(childComplexity), true + + case "DocumentDataHistory.ownerID": + if e.complexity.DocumentDataHistory.OwnerID == nil { + break + } + + return e.complexity.DocumentDataHistory.OwnerID(childComplexity), true + + case "DocumentDataHistory.ref": + if e.complexity.DocumentDataHistory.Ref == nil { + break + } + + return e.complexity.DocumentDataHistory.Ref(childComplexity), true + + case "DocumentDataHistory.tags": + if e.complexity.DocumentDataHistory.Tags == nil { + break + } + + return e.complexity.DocumentDataHistory.Tags(childComplexity), true + + case "DocumentDataHistory.templateID": + if e.complexity.DocumentDataHistory.TemplateID == nil { + break + } + + return e.complexity.DocumentDataHistory.TemplateID(childComplexity), true + + case "DocumentDataHistory.updatedAt": + if e.complexity.DocumentDataHistory.UpdatedAt == nil { + break + } + + return e.complexity.DocumentDataHistory.UpdatedAt(childComplexity), true + + case "DocumentDataHistory.updatedBy": + if e.complexity.DocumentDataHistory.UpdatedBy == nil { + break + } + + return e.complexity.DocumentDataHistory.UpdatedBy(childComplexity), true + + case "DocumentDataHistoryConnection.edges": + if e.complexity.DocumentDataHistoryConnection.Edges == nil { + break + } + + return e.complexity.DocumentDataHistoryConnection.Edges(childComplexity), true + + case "DocumentDataHistoryConnection.pageInfo": + if e.complexity.DocumentDataHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.DocumentDataHistoryConnection.PageInfo(childComplexity), true + + case "DocumentDataHistoryConnection.totalCount": + if e.complexity.DocumentDataHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.DocumentDataHistoryConnection.TotalCount(childComplexity), true + + case "DocumentDataHistoryEdge.cursor": + if e.complexity.DocumentDataHistoryEdge.Cursor == nil { + break + } + + return e.complexity.DocumentDataHistoryEdge.Cursor(childComplexity), true + + case "DocumentDataHistoryEdge.node": + if e.complexity.DocumentDataHistoryEdge.Node == nil { + break + } + + return e.complexity.DocumentDataHistoryEdge.Node(childComplexity), true + + case "DocumentDataUpdatePayload.documentData": + if e.complexity.DocumentDataUpdatePayload.DocumentData == nil { + break + } + + return e.complexity.DocumentDataUpdatePayload.DocumentData(childComplexity), true + + case "Entitlement.cancelled": + if e.complexity.Entitlement.Cancelled == nil { + break + } + + return e.complexity.Entitlement.Cancelled(childComplexity), true + + case "Entitlement.createdAt": + if e.complexity.Entitlement.CreatedAt == nil { + break + } + + return e.complexity.Entitlement.CreatedAt(childComplexity), true + + case "Entitlement.createdBy": + if e.complexity.Entitlement.CreatedBy == nil { + break + } + + return e.complexity.Entitlement.CreatedBy(childComplexity), true + + case "Entitlement.deletedAt": + if e.complexity.Entitlement.DeletedAt == nil { + break + } + + return e.complexity.Entitlement.DeletedAt(childComplexity), true + + case "Entitlement.deletedBy": + if e.complexity.Entitlement.DeletedBy == nil { + break + } + + return e.complexity.Entitlement.DeletedBy(childComplexity), true + + case "Entitlement.events": + if e.complexity.Entitlement.Events == nil { + break + } + + return e.complexity.Entitlement.Events(childComplexity), true + + case "Entitlement.expires": + if e.complexity.Entitlement.Expires == nil { + break + } + + return e.complexity.Entitlement.Expires(childComplexity), true + + case "Entitlement.expiresAt": + if e.complexity.Entitlement.ExpiresAt == nil { + break + } + + return e.complexity.Entitlement.ExpiresAt(childComplexity), true + + case "Entitlement.externalCustomerID": + if e.complexity.Entitlement.ExternalCustomerID == nil { + break + } + + return e.complexity.Entitlement.ExternalCustomerID(childComplexity), true + + case "Entitlement.externalSubscriptionID": + if e.complexity.Entitlement.ExternalSubscriptionID == nil { + break + } + + return e.complexity.Entitlement.ExternalSubscriptionID(childComplexity), true + + case "Entitlement.id": + if e.complexity.Entitlement.ID == nil { + break + } + + return e.complexity.Entitlement.ID(childComplexity), true + + case "Entitlement.organization": + if e.complexity.Entitlement.Organization == nil { + break + } + + return e.complexity.Entitlement.Organization(childComplexity), true + + case "Entitlement.organizationID": + if e.complexity.Entitlement.OrganizationID == nil { + break + } + + return e.complexity.Entitlement.OrganizationID(childComplexity), true + + case "Entitlement.owner": + if e.complexity.Entitlement.Owner == nil { + break + } + + return e.complexity.Entitlement.Owner(childComplexity), true + + case "Entitlement.ownerID": + if e.complexity.Entitlement.OwnerID == nil { + break + } + + return e.complexity.Entitlement.OwnerID(childComplexity), true + + case "Entitlement.plan": + if e.complexity.Entitlement.Plan == nil { + break + } + + return e.complexity.Entitlement.Plan(childComplexity), true + + case "Entitlement.planID": + if e.complexity.Entitlement.PlanID == nil { + break + } + + return e.complexity.Entitlement.PlanID(childComplexity), true + + case "Entitlement.tags": + if e.complexity.Entitlement.Tags == nil { + break + } + + return e.complexity.Entitlement.Tags(childComplexity), true + + case "Entitlement.updatedAt": + if e.complexity.Entitlement.UpdatedAt == nil { + break + } + + return e.complexity.Entitlement.UpdatedAt(childComplexity), true + + case "Entitlement.updatedBy": + if e.complexity.Entitlement.UpdatedBy == nil { + break + } + + return e.complexity.Entitlement.UpdatedBy(childComplexity), true + + case "EntitlementBulkCreatePayload.entitlements": + if e.complexity.EntitlementBulkCreatePayload.Entitlements == nil { + break + } + + return e.complexity.EntitlementBulkCreatePayload.Entitlements(childComplexity), true + + case "EntitlementConnection.edges": + if e.complexity.EntitlementConnection.Edges == nil { + break + } + + return e.complexity.EntitlementConnection.Edges(childComplexity), true + + case "EntitlementConnection.pageInfo": + if e.complexity.EntitlementConnection.PageInfo == nil { + break + } + + return e.complexity.EntitlementConnection.PageInfo(childComplexity), true + + case "EntitlementConnection.totalCount": + if e.complexity.EntitlementConnection.TotalCount == nil { + break + } + + return e.complexity.EntitlementConnection.TotalCount(childComplexity), true + + case "EntitlementCreatePayload.entitlement": + if e.complexity.EntitlementCreatePayload.Entitlement == nil { + break + } + + return e.complexity.EntitlementCreatePayload.Entitlement(childComplexity), true + + case "EntitlementDeletePayload.deletedID": + if e.complexity.EntitlementDeletePayload.DeletedID == nil { + break + } + + return e.complexity.EntitlementDeletePayload.DeletedID(childComplexity), true + + case "EntitlementEdge.cursor": + if e.complexity.EntitlementEdge.Cursor == nil { + break + } + + return e.complexity.EntitlementEdge.Cursor(childComplexity), true + + case "EntitlementEdge.node": + if e.complexity.EntitlementEdge.Node == nil { + break + } + + return e.complexity.EntitlementEdge.Node(childComplexity), true + + case "EntitlementHistory.cancelled": + if e.complexity.EntitlementHistory.Cancelled == nil { + break + } + + return e.complexity.EntitlementHistory.Cancelled(childComplexity), true + + case "EntitlementHistory.createdAt": + if e.complexity.EntitlementHistory.CreatedAt == nil { + break + } + + return e.complexity.EntitlementHistory.CreatedAt(childComplexity), true + + case "EntitlementHistory.createdBy": + if e.complexity.EntitlementHistory.CreatedBy == nil { + break + } + + return e.complexity.EntitlementHistory.CreatedBy(childComplexity), true + + case "EntitlementHistory.deletedAt": + if e.complexity.EntitlementHistory.DeletedAt == nil { + break + } + + return e.complexity.EntitlementHistory.DeletedAt(childComplexity), true + + case "EntitlementHistory.deletedBy": + if e.complexity.EntitlementHistory.DeletedBy == nil { + break + } + + return e.complexity.EntitlementHistory.DeletedBy(childComplexity), true + + case "EntitlementHistory.expires": + if e.complexity.EntitlementHistory.Expires == nil { + break + } + + return e.complexity.EntitlementHistory.Expires(childComplexity), true + + case "EntitlementHistory.expiresAt": + if e.complexity.EntitlementHistory.ExpiresAt == nil { + break + } + + return e.complexity.EntitlementHistory.ExpiresAt(childComplexity), true + + case "EntitlementHistory.externalCustomerID": + if e.complexity.EntitlementHistory.ExternalCustomerID == nil { + break + } + + return e.complexity.EntitlementHistory.ExternalCustomerID(childComplexity), true + + case "EntitlementHistory.externalSubscriptionID": + if e.complexity.EntitlementHistory.ExternalSubscriptionID == nil { + break + } + + return e.complexity.EntitlementHistory.ExternalSubscriptionID(childComplexity), true + + case "EntitlementHistory.historyTime": + if e.complexity.EntitlementHistory.HistoryTime == nil { + break + } + + return e.complexity.EntitlementHistory.HistoryTime(childComplexity), true + + case "EntitlementHistory.id": + if e.complexity.EntitlementHistory.ID == nil { + break + } + + return e.complexity.EntitlementHistory.ID(childComplexity), true + + case "EntitlementHistory.operation": + if e.complexity.EntitlementHistory.Operation == nil { + break + } + + return e.complexity.EntitlementHistory.Operation(childComplexity), true + + case "EntitlementHistory.organizationID": + if e.complexity.EntitlementHistory.OrganizationID == nil { + break + } + + return e.complexity.EntitlementHistory.OrganizationID(childComplexity), true + + case "EntitlementHistory.ownerID": + if e.complexity.EntitlementHistory.OwnerID == nil { + break + } + + return e.complexity.EntitlementHistory.OwnerID(childComplexity), true + + case "EntitlementHistory.planID": + if e.complexity.EntitlementHistory.PlanID == nil { + break + } + + return e.complexity.EntitlementHistory.PlanID(childComplexity), true + + case "EntitlementHistory.ref": + if e.complexity.EntitlementHistory.Ref == nil { + break + } + + return e.complexity.EntitlementHistory.Ref(childComplexity), true + + case "EntitlementHistory.tags": + if e.complexity.EntitlementHistory.Tags == nil { + break + } + + return e.complexity.EntitlementHistory.Tags(childComplexity), true + + case "EntitlementHistory.updatedAt": + if e.complexity.EntitlementHistory.UpdatedAt == nil { + break + } + + return e.complexity.EntitlementHistory.UpdatedAt(childComplexity), true + + case "EntitlementHistory.updatedBy": + if e.complexity.EntitlementHistory.UpdatedBy == nil { + break + } + + return e.complexity.EntitlementHistory.UpdatedBy(childComplexity), true + + case "EntitlementHistoryConnection.edges": + if e.complexity.EntitlementHistoryConnection.Edges == nil { + break + } + + return e.complexity.EntitlementHistoryConnection.Edges(childComplexity), true + + case "EntitlementHistoryConnection.pageInfo": + if e.complexity.EntitlementHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.EntitlementHistoryConnection.PageInfo(childComplexity), true + + case "EntitlementHistoryConnection.totalCount": + if e.complexity.EntitlementHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.EntitlementHistoryConnection.TotalCount(childComplexity), true + + case "EntitlementHistoryEdge.cursor": + if e.complexity.EntitlementHistoryEdge.Cursor == nil { + break + } + + return e.complexity.EntitlementHistoryEdge.Cursor(childComplexity), true + + case "EntitlementHistoryEdge.node": + if e.complexity.EntitlementHistoryEdge.Node == nil { + break + } + + return e.complexity.EntitlementHistoryEdge.Node(childComplexity), true + + case "EntitlementPlan.baseFeatures": + if e.complexity.EntitlementPlan.BaseFeatures == nil { + break + } + + return e.complexity.EntitlementPlan.BaseFeatures(childComplexity), true + + case "EntitlementPlan.createdAt": + if e.complexity.EntitlementPlan.CreatedAt == nil { + break + } + + return e.complexity.EntitlementPlan.CreatedAt(childComplexity), true + + case "EntitlementPlan.createdBy": + if e.complexity.EntitlementPlan.CreatedBy == nil { + break + } + + return e.complexity.EntitlementPlan.CreatedBy(childComplexity), true + + case "EntitlementPlan.deletedAt": + if e.complexity.EntitlementPlan.DeletedAt == nil { + break + } + + return e.complexity.EntitlementPlan.DeletedAt(childComplexity), true + + case "EntitlementPlan.deletedBy": + if e.complexity.EntitlementPlan.DeletedBy == nil { + break + } + + return e.complexity.EntitlementPlan.DeletedBy(childComplexity), true + + case "EntitlementPlan.description": + if e.complexity.EntitlementPlan.Description == nil { + break + } + + return e.complexity.EntitlementPlan.Description(childComplexity), true + + case "EntitlementPlan.displayName": + if e.complexity.EntitlementPlan.DisplayName == nil { + break + } + + return e.complexity.EntitlementPlan.DisplayName(childComplexity), true + + case "EntitlementPlan.entitlements": + if e.complexity.EntitlementPlan.Entitlements == nil { + break + } + + return e.complexity.EntitlementPlan.Entitlements(childComplexity), true + + case "EntitlementPlan.events": + if e.complexity.EntitlementPlan.Events == nil { + break + } + + return e.complexity.EntitlementPlan.Events(childComplexity), true + + case "EntitlementPlan.features": + if e.complexity.EntitlementPlan.Features == nil { + break + } + + return e.complexity.EntitlementPlan.Features(childComplexity), true + + case "EntitlementPlan.id": + if e.complexity.EntitlementPlan.ID == nil { + break + } + + return e.complexity.EntitlementPlan.ID(childComplexity), true + + case "EntitlementPlan.metadata": + if e.complexity.EntitlementPlan.Metadata == nil { + break + } + + return e.complexity.EntitlementPlan.Metadata(childComplexity), true + + case "EntitlementPlan.name": + if e.complexity.EntitlementPlan.Name == nil { + break + } + + return e.complexity.EntitlementPlan.Name(childComplexity), true + + case "EntitlementPlan.owner": + if e.complexity.EntitlementPlan.Owner == nil { + break + } + + return e.complexity.EntitlementPlan.Owner(childComplexity), true + + case "EntitlementPlan.ownerID": + if e.complexity.EntitlementPlan.OwnerID == nil { + break + } + + return e.complexity.EntitlementPlan.OwnerID(childComplexity), true + + case "EntitlementPlan.tags": + if e.complexity.EntitlementPlan.Tags == nil { + break + } + + return e.complexity.EntitlementPlan.Tags(childComplexity), true + + case "EntitlementPlan.updatedAt": + if e.complexity.EntitlementPlan.UpdatedAt == nil { + break + } + + return e.complexity.EntitlementPlan.UpdatedAt(childComplexity), true + + case "EntitlementPlan.updatedBy": + if e.complexity.EntitlementPlan.UpdatedBy == nil { + break + } + + return e.complexity.EntitlementPlan.UpdatedBy(childComplexity), true + + case "EntitlementPlan.version": + if e.complexity.EntitlementPlan.Version == nil { + break + } + + return e.complexity.EntitlementPlan.Version(childComplexity), true + + case "EntitlementPlanBulkCreatePayload.entitlementPlans": + if e.complexity.EntitlementPlanBulkCreatePayload.EntitlementPlans == nil { + break + } + + return e.complexity.EntitlementPlanBulkCreatePayload.EntitlementPlans(childComplexity), true + + case "EntitlementPlanConnection.edges": + if e.complexity.EntitlementPlanConnection.Edges == nil { + break + } + + return e.complexity.EntitlementPlanConnection.Edges(childComplexity), true + + case "EntitlementPlanConnection.pageInfo": + if e.complexity.EntitlementPlanConnection.PageInfo == nil { + break + } + + return e.complexity.EntitlementPlanConnection.PageInfo(childComplexity), true + + case "EntitlementPlanConnection.totalCount": + if e.complexity.EntitlementPlanConnection.TotalCount == nil { + break + } + + return e.complexity.EntitlementPlanConnection.TotalCount(childComplexity), true + + case "EntitlementPlanCreatePayload.entitlementPlan": + if e.complexity.EntitlementPlanCreatePayload.EntitlementPlan == nil { + break + } + + return e.complexity.EntitlementPlanCreatePayload.EntitlementPlan(childComplexity), true + + case "EntitlementPlanDeletePayload.deletedID": + if e.complexity.EntitlementPlanDeletePayload.DeletedID == nil { + break + } + + return e.complexity.EntitlementPlanDeletePayload.DeletedID(childComplexity), true + + case "EntitlementPlanEdge.cursor": + if e.complexity.EntitlementPlanEdge.Cursor == nil { + break + } + + return e.complexity.EntitlementPlanEdge.Cursor(childComplexity), true + + case "EntitlementPlanEdge.node": + if e.complexity.EntitlementPlanEdge.Node == nil { + break + } + + return e.complexity.EntitlementPlanEdge.Node(childComplexity), true + + case "EntitlementPlanFeature.createdAt": + if e.complexity.EntitlementPlanFeature.CreatedAt == nil { + break + } + + return e.complexity.EntitlementPlanFeature.CreatedAt(childComplexity), true + + case "EntitlementPlanFeature.createdBy": + if e.complexity.EntitlementPlanFeature.CreatedBy == nil { + break + } + + return e.complexity.EntitlementPlanFeature.CreatedBy(childComplexity), true + + case "EntitlementPlanFeature.deletedAt": + if e.complexity.EntitlementPlanFeature.DeletedAt == nil { + break + } + + return e.complexity.EntitlementPlanFeature.DeletedAt(childComplexity), true + + case "EntitlementPlanFeature.deletedBy": + if e.complexity.EntitlementPlanFeature.DeletedBy == nil { + break + } + + return e.complexity.EntitlementPlanFeature.DeletedBy(childComplexity), true + + case "EntitlementPlanFeature.events": + if e.complexity.EntitlementPlanFeature.Events == nil { + break + } + + return e.complexity.EntitlementPlanFeature.Events(childComplexity), true + + case "EntitlementPlanFeature.feature": + if e.complexity.EntitlementPlanFeature.Feature == nil { + break + } + + return e.complexity.EntitlementPlanFeature.Feature(childComplexity), true + + case "EntitlementPlanFeature.featureID": + if e.complexity.EntitlementPlanFeature.FeatureID == nil { + break + } + + return e.complexity.EntitlementPlanFeature.FeatureID(childComplexity), true + + case "EntitlementPlanFeature.id": + if e.complexity.EntitlementPlanFeature.ID == nil { + break + } + + return e.complexity.EntitlementPlanFeature.ID(childComplexity), true + + case "EntitlementPlanFeature.metadata": + if e.complexity.EntitlementPlanFeature.Metadata == nil { + break + } + + return e.complexity.EntitlementPlanFeature.Metadata(childComplexity), true + + case "EntitlementPlanFeature.owner": + if e.complexity.EntitlementPlanFeature.Owner == nil { + break + } + + return e.complexity.EntitlementPlanFeature.Owner(childComplexity), true + + case "EntitlementPlanFeature.ownerID": + if e.complexity.EntitlementPlanFeature.OwnerID == nil { + break + } + + return e.complexity.EntitlementPlanFeature.OwnerID(childComplexity), true + + case "EntitlementPlanFeature.plan": + if e.complexity.EntitlementPlanFeature.Plan == nil { + break + } + + return e.complexity.EntitlementPlanFeature.Plan(childComplexity), true + + case "EntitlementPlanFeature.planID": + if e.complexity.EntitlementPlanFeature.PlanID == nil { + break + } + + return e.complexity.EntitlementPlanFeature.PlanID(childComplexity), true + + case "EntitlementPlanFeature.tags": + if e.complexity.EntitlementPlanFeature.Tags == nil { + break + } + + return e.complexity.EntitlementPlanFeature.Tags(childComplexity), true + + case "EntitlementPlanFeature.updatedAt": + if e.complexity.EntitlementPlanFeature.UpdatedAt == nil { + break + } + + return e.complexity.EntitlementPlanFeature.UpdatedAt(childComplexity), true + + case "EntitlementPlanFeature.updatedBy": + if e.complexity.EntitlementPlanFeature.UpdatedBy == nil { + break + } + + return e.complexity.EntitlementPlanFeature.UpdatedBy(childComplexity), true + + case "EntitlementPlanFeatureBulkCreatePayload.entitlementPlanFeatures": + if e.complexity.EntitlementPlanFeatureBulkCreatePayload.EntitlementPlanFeatures == nil { + break + } + + return e.complexity.EntitlementPlanFeatureBulkCreatePayload.EntitlementPlanFeatures(childComplexity), true + + case "EntitlementPlanFeatureConnection.edges": + if e.complexity.EntitlementPlanFeatureConnection.Edges == nil { + break + } + + return e.complexity.EntitlementPlanFeatureConnection.Edges(childComplexity), true + + case "EntitlementPlanFeatureConnection.pageInfo": + if e.complexity.EntitlementPlanFeatureConnection.PageInfo == nil { + break + } + + return e.complexity.EntitlementPlanFeatureConnection.PageInfo(childComplexity), true + + case "EntitlementPlanFeatureConnection.totalCount": + if e.complexity.EntitlementPlanFeatureConnection.TotalCount == nil { + break + } + + return e.complexity.EntitlementPlanFeatureConnection.TotalCount(childComplexity), true + + case "EntitlementPlanFeatureCreatePayload.entitlementPlanFeature": + if e.complexity.EntitlementPlanFeatureCreatePayload.EntitlementPlanFeature == nil { + break + } + + return e.complexity.EntitlementPlanFeatureCreatePayload.EntitlementPlanFeature(childComplexity), true + + case "EntitlementPlanFeatureDeletePayload.deletedID": + if e.complexity.EntitlementPlanFeatureDeletePayload.DeletedID == nil { + break + } + + return e.complexity.EntitlementPlanFeatureDeletePayload.DeletedID(childComplexity), true + + case "EntitlementPlanFeatureEdge.cursor": + if e.complexity.EntitlementPlanFeatureEdge.Cursor == nil { + break + } + + return e.complexity.EntitlementPlanFeatureEdge.Cursor(childComplexity), true + + case "EntitlementPlanFeatureEdge.node": + if e.complexity.EntitlementPlanFeatureEdge.Node == nil { + break + } + + return e.complexity.EntitlementPlanFeatureEdge.Node(childComplexity), true + + case "EntitlementPlanFeatureHistory.createdAt": + if e.complexity.EntitlementPlanFeatureHistory.CreatedAt == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.CreatedAt(childComplexity), true + + case "EntitlementPlanFeatureHistory.createdBy": + if e.complexity.EntitlementPlanFeatureHistory.CreatedBy == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.CreatedBy(childComplexity), true + + case "EntitlementPlanFeatureHistory.deletedAt": + if e.complexity.EntitlementPlanFeatureHistory.DeletedAt == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.DeletedAt(childComplexity), true + + case "EntitlementPlanFeatureHistory.deletedBy": + if e.complexity.EntitlementPlanFeatureHistory.DeletedBy == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.DeletedBy(childComplexity), true + + case "EntitlementPlanFeatureHistory.featureID": + if e.complexity.EntitlementPlanFeatureHistory.FeatureID == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.FeatureID(childComplexity), true + + case "EntitlementPlanFeatureHistory.historyTime": + if e.complexity.EntitlementPlanFeatureHistory.HistoryTime == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.HistoryTime(childComplexity), true + + case "EntitlementPlanFeatureHistory.id": + if e.complexity.EntitlementPlanFeatureHistory.ID == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.ID(childComplexity), true + + case "EntitlementPlanFeatureHistory.metadata": + if e.complexity.EntitlementPlanFeatureHistory.Metadata == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.Metadata(childComplexity), true + + case "EntitlementPlanFeatureHistory.operation": + if e.complexity.EntitlementPlanFeatureHistory.Operation == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.Operation(childComplexity), true + + case "EntitlementPlanFeatureHistory.ownerID": + if e.complexity.EntitlementPlanFeatureHistory.OwnerID == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.OwnerID(childComplexity), true + + case "EntitlementPlanFeatureHistory.planID": + if e.complexity.EntitlementPlanFeatureHistory.PlanID == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.PlanID(childComplexity), true + + case "EntitlementPlanFeatureHistory.ref": + if e.complexity.EntitlementPlanFeatureHistory.Ref == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.Ref(childComplexity), true + + case "EntitlementPlanFeatureHistory.tags": + if e.complexity.EntitlementPlanFeatureHistory.Tags == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.Tags(childComplexity), true + + case "EntitlementPlanFeatureHistory.updatedAt": + if e.complexity.EntitlementPlanFeatureHistory.UpdatedAt == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.UpdatedAt(childComplexity), true + + case "EntitlementPlanFeatureHistory.updatedBy": + if e.complexity.EntitlementPlanFeatureHistory.UpdatedBy == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistory.UpdatedBy(childComplexity), true + + case "EntitlementPlanFeatureHistoryConnection.edges": + if e.complexity.EntitlementPlanFeatureHistoryConnection.Edges == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistoryConnection.Edges(childComplexity), true + + case "EntitlementPlanFeatureHistoryConnection.pageInfo": + if e.complexity.EntitlementPlanFeatureHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistoryConnection.PageInfo(childComplexity), true + + case "EntitlementPlanFeatureHistoryConnection.totalCount": + if e.complexity.EntitlementPlanFeatureHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistoryConnection.TotalCount(childComplexity), true + + case "EntitlementPlanFeatureHistoryEdge.cursor": + if e.complexity.EntitlementPlanFeatureHistoryEdge.Cursor == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistoryEdge.Cursor(childComplexity), true + + case "EntitlementPlanFeatureHistoryEdge.node": + if e.complexity.EntitlementPlanFeatureHistoryEdge.Node == nil { + break + } + + return e.complexity.EntitlementPlanFeatureHistoryEdge.Node(childComplexity), true + + case "EntitlementPlanFeatureUpdatePayload.entitlementPlanFeature": + if e.complexity.EntitlementPlanFeatureUpdatePayload.EntitlementPlanFeature == nil { + break + } + + return e.complexity.EntitlementPlanFeatureUpdatePayload.EntitlementPlanFeature(childComplexity), true + + case "EntitlementPlanHistory.createdAt": + if e.complexity.EntitlementPlanHistory.CreatedAt == nil { + break + } + + return e.complexity.EntitlementPlanHistory.CreatedAt(childComplexity), true + + case "EntitlementPlanHistory.createdBy": + if e.complexity.EntitlementPlanHistory.CreatedBy == nil { + break + } + + return e.complexity.EntitlementPlanHistory.CreatedBy(childComplexity), true + + case "EntitlementPlanHistory.deletedAt": + if e.complexity.EntitlementPlanHistory.DeletedAt == nil { + break + } + + return e.complexity.EntitlementPlanHistory.DeletedAt(childComplexity), true + + case "EntitlementPlanHistory.deletedBy": + if e.complexity.EntitlementPlanHistory.DeletedBy == nil { + break + } + + return e.complexity.EntitlementPlanHistory.DeletedBy(childComplexity), true + + case "EntitlementPlanHistory.description": + if e.complexity.EntitlementPlanHistory.Description == nil { + break + } + + return e.complexity.EntitlementPlanHistory.Description(childComplexity), true + + case "EntitlementPlanHistory.displayName": + if e.complexity.EntitlementPlanHistory.DisplayName == nil { + break + } + + return e.complexity.EntitlementPlanHistory.DisplayName(childComplexity), true + + case "EntitlementPlanHistory.historyTime": + if e.complexity.EntitlementPlanHistory.HistoryTime == nil { + break + } + + return e.complexity.EntitlementPlanHistory.HistoryTime(childComplexity), true + + case "EntitlementPlanHistory.id": + if e.complexity.EntitlementPlanHistory.ID == nil { + break + } + + return e.complexity.EntitlementPlanHistory.ID(childComplexity), true + + case "EntitlementPlanHistory.metadata": + if e.complexity.EntitlementPlanHistory.Metadata == nil { + break + } + + return e.complexity.EntitlementPlanHistory.Metadata(childComplexity), true + + case "EntitlementPlanHistory.name": + if e.complexity.EntitlementPlanHistory.Name == nil { + break + } + + return e.complexity.EntitlementPlanHistory.Name(childComplexity), true + + case "EntitlementPlanHistory.operation": + if e.complexity.EntitlementPlanHistory.Operation == nil { + break + } + + return e.complexity.EntitlementPlanHistory.Operation(childComplexity), true + + case "EntitlementPlanHistory.ownerID": + if e.complexity.EntitlementPlanHistory.OwnerID == nil { + break + } + + return e.complexity.EntitlementPlanHistory.OwnerID(childComplexity), true + + case "EntitlementPlanHistory.ref": + if e.complexity.EntitlementPlanHistory.Ref == nil { + break + } + + return e.complexity.EntitlementPlanHistory.Ref(childComplexity), true + + case "EntitlementPlanHistory.tags": + if e.complexity.EntitlementPlanHistory.Tags == nil { + break + } + + return e.complexity.EntitlementPlanHistory.Tags(childComplexity), true + + case "EntitlementPlanHistory.updatedAt": + if e.complexity.EntitlementPlanHistory.UpdatedAt == nil { + break + } + + return e.complexity.EntitlementPlanHistory.UpdatedAt(childComplexity), true + + case "EntitlementPlanHistory.updatedBy": + if e.complexity.EntitlementPlanHistory.UpdatedBy == nil { + break + } + + return e.complexity.EntitlementPlanHistory.UpdatedBy(childComplexity), true + + case "EntitlementPlanHistory.version": + if e.complexity.EntitlementPlanHistory.Version == nil { + break + } + + return e.complexity.EntitlementPlanHistory.Version(childComplexity), true + + case "EntitlementPlanHistoryConnection.edges": + if e.complexity.EntitlementPlanHistoryConnection.Edges == nil { + break + } + + return e.complexity.EntitlementPlanHistoryConnection.Edges(childComplexity), true + + case "EntitlementPlanHistoryConnection.pageInfo": + if e.complexity.EntitlementPlanHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.EntitlementPlanHistoryConnection.PageInfo(childComplexity), true + + case "EntitlementPlanHistoryConnection.totalCount": + if e.complexity.EntitlementPlanHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.EntitlementPlanHistoryConnection.TotalCount(childComplexity), true + + case "EntitlementPlanHistoryEdge.cursor": + if e.complexity.EntitlementPlanHistoryEdge.Cursor == nil { + break + } + + return e.complexity.EntitlementPlanHistoryEdge.Cursor(childComplexity), true + + case "EntitlementPlanHistoryEdge.node": + if e.complexity.EntitlementPlanHistoryEdge.Node == nil { + break + } + + return e.complexity.EntitlementPlanHistoryEdge.Node(childComplexity), true + + case "EntitlementPlanUpdatePayload.entitlementPlan": + if e.complexity.EntitlementPlanUpdatePayload.EntitlementPlan == nil { + break + } + + return e.complexity.EntitlementPlanUpdatePayload.EntitlementPlan(childComplexity), true + + case "EntitlementUpdatePayload.entitlement": + if e.complexity.EntitlementUpdatePayload.Entitlement == nil { + break + } + + return e.complexity.EntitlementUpdatePayload.Entitlement(childComplexity), true + + case "Entity.contacts": + if e.complexity.Entity.Contacts == nil { + break + } + + return e.complexity.Entity.Contacts(childComplexity), true + + case "Entity.createdAt": + if e.complexity.Entity.CreatedAt == nil { + break + } + + return e.complexity.Entity.CreatedAt(childComplexity), true + + case "Entity.createdBy": + if e.complexity.Entity.CreatedBy == nil { + break + } + + return e.complexity.Entity.CreatedBy(childComplexity), true + + case "Entity.deletedAt": + if e.complexity.Entity.DeletedAt == nil { + break + } + + return e.complexity.Entity.DeletedAt(childComplexity), true + + case "Entity.deletedBy": + if e.complexity.Entity.DeletedBy == nil { + break + } + + return e.complexity.Entity.DeletedBy(childComplexity), true + + case "Entity.description": + if e.complexity.Entity.Description == nil { + break + } + + return e.complexity.Entity.Description(childComplexity), true + + case "Entity.displayName": + if e.complexity.Entity.DisplayName == nil { + break + } + + return e.complexity.Entity.DisplayName(childComplexity), true + + case "Entity.documents": + if e.complexity.Entity.Documents == nil { + break + } + + return e.complexity.Entity.Documents(childComplexity), true + + case "Entity.domains": + if e.complexity.Entity.Domains == nil { + break + } + + return e.complexity.Entity.Domains(childComplexity), true + + case "Entity.entityType": + if e.complexity.Entity.EntityType == nil { + break + } + + return e.complexity.Entity.EntityType(childComplexity), true + + case "Entity.entityTypeID": + if e.complexity.Entity.EntityTypeID == nil { + break + } + + return e.complexity.Entity.EntityTypeID(childComplexity), true + + case "Entity.files": + if e.complexity.Entity.Files == nil { + break + } + + return e.complexity.Entity.Files(childComplexity), true + + case "Entity.id": + if e.complexity.Entity.ID == nil { + break + } + + return e.complexity.Entity.ID(childComplexity), true + + case "Entity.name": + if e.complexity.Entity.Name == nil { + break + } + + return e.complexity.Entity.Name(childComplexity), true + + case "Entity.notes": + if e.complexity.Entity.Notes == nil { + break + } + + return e.complexity.Entity.Notes(childComplexity), true + + case "Entity.owner": + if e.complexity.Entity.Owner == nil { + break + } + + return e.complexity.Entity.Owner(childComplexity), true + + case "Entity.ownerID": + if e.complexity.Entity.OwnerID == nil { + break + } + + return e.complexity.Entity.OwnerID(childComplexity), true + + case "Entity.status": + if e.complexity.Entity.Status == nil { + break + } + + return e.complexity.Entity.Status(childComplexity), true + + case "Entity.tags": + if e.complexity.Entity.Tags == nil { + break + } + + return e.complexity.Entity.Tags(childComplexity), true + + case "Entity.updatedAt": + if e.complexity.Entity.UpdatedAt == nil { + break + } + + return e.complexity.Entity.UpdatedAt(childComplexity), true + + case "Entity.updatedBy": + if e.complexity.Entity.UpdatedBy == nil { + break + } + + return e.complexity.Entity.UpdatedBy(childComplexity), true + + case "EntityBulkCreatePayload.entities": + if e.complexity.EntityBulkCreatePayload.Entities == nil { + break + } + + return e.complexity.EntityBulkCreatePayload.Entities(childComplexity), true + + case "EntityConnection.edges": + if e.complexity.EntityConnection.Edges == nil { + break + } + + return e.complexity.EntityConnection.Edges(childComplexity), true + + case "EntityConnection.pageInfo": + if e.complexity.EntityConnection.PageInfo == nil { + break + } + + return e.complexity.EntityConnection.PageInfo(childComplexity), true + + case "EntityConnection.totalCount": + if e.complexity.EntityConnection.TotalCount == nil { + break + } + + return e.complexity.EntityConnection.TotalCount(childComplexity), true + + case "EntityCreatePayload.entity": + if e.complexity.EntityCreatePayload.Entity == nil { + break + } + + return e.complexity.EntityCreatePayload.Entity(childComplexity), true + + case "EntityDeletePayload.deletedID": + if e.complexity.EntityDeletePayload.DeletedID == nil { + break + } + + return e.complexity.EntityDeletePayload.DeletedID(childComplexity), true + + case "EntityEdge.cursor": + if e.complexity.EntityEdge.Cursor == nil { + break + } + + return e.complexity.EntityEdge.Cursor(childComplexity), true + + case "EntityEdge.node": + if e.complexity.EntityEdge.Node == nil { + break + } + + return e.complexity.EntityEdge.Node(childComplexity), true + + case "EntityHistory.createdAt": + if e.complexity.EntityHistory.CreatedAt == nil { + break + } + + return e.complexity.EntityHistory.CreatedAt(childComplexity), true + + case "EntityHistory.createdBy": + if e.complexity.EntityHistory.CreatedBy == nil { + break + } + + return e.complexity.EntityHistory.CreatedBy(childComplexity), true + + case "EntityHistory.deletedAt": + if e.complexity.EntityHistory.DeletedAt == nil { + break + } + + return e.complexity.EntityHistory.DeletedAt(childComplexity), true + + case "EntityHistory.deletedBy": + if e.complexity.EntityHistory.DeletedBy == nil { + break + } + + return e.complexity.EntityHistory.DeletedBy(childComplexity), true + + case "EntityHistory.description": + if e.complexity.EntityHistory.Description == nil { + break + } + + return e.complexity.EntityHistory.Description(childComplexity), true + + case "EntityHistory.displayName": + if e.complexity.EntityHistory.DisplayName == nil { + break + } + + return e.complexity.EntityHistory.DisplayName(childComplexity), true + + case "EntityHistory.domains": + if e.complexity.EntityHistory.Domains == nil { + break + } + + return e.complexity.EntityHistory.Domains(childComplexity), true + + case "EntityHistory.entityTypeID": + if e.complexity.EntityHistory.EntityTypeID == nil { + break + } + + return e.complexity.EntityHistory.EntityTypeID(childComplexity), true + + case "EntityHistory.historyTime": + if e.complexity.EntityHistory.HistoryTime == nil { + break + } + + return e.complexity.EntityHistory.HistoryTime(childComplexity), true + + case "EntityHistory.id": + if e.complexity.EntityHistory.ID == nil { + break + } + + return e.complexity.EntityHistory.ID(childComplexity), true + + case "EntityHistory.name": + if e.complexity.EntityHistory.Name == nil { + break + } + + return e.complexity.EntityHistory.Name(childComplexity), true + + case "EntityHistory.operation": + if e.complexity.EntityHistory.Operation == nil { + break + } + + return e.complexity.EntityHistory.Operation(childComplexity), true + + case "EntityHistory.ownerID": + if e.complexity.EntityHistory.OwnerID == nil { + break + } + + return e.complexity.EntityHistory.OwnerID(childComplexity), true + + case "EntityHistory.ref": + if e.complexity.EntityHistory.Ref == nil { + break + } + + return e.complexity.EntityHistory.Ref(childComplexity), true + + case "EntityHistory.status": + if e.complexity.EntityHistory.Status == nil { + break + } + + return e.complexity.EntityHistory.Status(childComplexity), true + + case "EntityHistory.tags": + if e.complexity.EntityHistory.Tags == nil { + break + } + + return e.complexity.EntityHistory.Tags(childComplexity), true + + case "EntityHistory.updatedAt": + if e.complexity.EntityHistory.UpdatedAt == nil { + break + } + + return e.complexity.EntityHistory.UpdatedAt(childComplexity), true + + case "EntityHistory.updatedBy": + if e.complexity.EntityHistory.UpdatedBy == nil { + break + } + + return e.complexity.EntityHistory.UpdatedBy(childComplexity), true + + case "EntityHistoryConnection.edges": + if e.complexity.EntityHistoryConnection.Edges == nil { + break + } + + return e.complexity.EntityHistoryConnection.Edges(childComplexity), true + + case "EntityHistoryConnection.pageInfo": + if e.complexity.EntityHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.EntityHistoryConnection.PageInfo(childComplexity), true + + case "EntityHistoryConnection.totalCount": + if e.complexity.EntityHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.EntityHistoryConnection.TotalCount(childComplexity), true + + case "EntityHistoryEdge.cursor": + if e.complexity.EntityHistoryEdge.Cursor == nil { + break + } + + return e.complexity.EntityHistoryEdge.Cursor(childComplexity), true + + case "EntityHistoryEdge.node": + if e.complexity.EntityHistoryEdge.Node == nil { + break + } + + return e.complexity.EntityHistoryEdge.Node(childComplexity), true + + case "EntityType.createdAt": + if e.complexity.EntityType.CreatedAt == nil { + break + } + + return e.complexity.EntityType.CreatedAt(childComplexity), true + + case "EntityType.createdBy": + if e.complexity.EntityType.CreatedBy == nil { + break + } + + return e.complexity.EntityType.CreatedBy(childComplexity), true + + case "EntityType.deletedAt": + if e.complexity.EntityType.DeletedAt == nil { + break + } + + return e.complexity.EntityType.DeletedAt(childComplexity), true + + case "EntityType.deletedBy": + if e.complexity.EntityType.DeletedBy == nil { + break + } + + return e.complexity.EntityType.DeletedBy(childComplexity), true + + case "EntityType.entities": + if e.complexity.EntityType.Entities == nil { + break + } + + return e.complexity.EntityType.Entities(childComplexity), true + + case "EntityType.id": + if e.complexity.EntityType.ID == nil { + break + } + + return e.complexity.EntityType.ID(childComplexity), true + + case "EntityType.name": + if e.complexity.EntityType.Name == nil { + break + } + + return e.complexity.EntityType.Name(childComplexity), true + + case "EntityType.owner": + if e.complexity.EntityType.Owner == nil { + break + } + + return e.complexity.EntityType.Owner(childComplexity), true + + case "EntityType.ownerID": + if e.complexity.EntityType.OwnerID == nil { + break + } + + return e.complexity.EntityType.OwnerID(childComplexity), true + + case "EntityType.tags": + if e.complexity.EntityType.Tags == nil { + break + } + + return e.complexity.EntityType.Tags(childComplexity), true + + case "EntityType.updatedAt": + if e.complexity.EntityType.UpdatedAt == nil { + break + } + + return e.complexity.EntityType.UpdatedAt(childComplexity), true + + case "EntityType.updatedBy": + if e.complexity.EntityType.UpdatedBy == nil { + break + } + + return e.complexity.EntityType.UpdatedBy(childComplexity), true + + case "EntityTypeBulkCreatePayload.entityTypes": + if e.complexity.EntityTypeBulkCreatePayload.EntityTypes == nil { + break + } + + return e.complexity.EntityTypeBulkCreatePayload.EntityTypes(childComplexity), true + + case "EntityTypeConnection.edges": + if e.complexity.EntityTypeConnection.Edges == nil { + break + } + + return e.complexity.EntityTypeConnection.Edges(childComplexity), true + + case "EntityTypeConnection.pageInfo": + if e.complexity.EntityTypeConnection.PageInfo == nil { + break + } + + return e.complexity.EntityTypeConnection.PageInfo(childComplexity), true + + case "EntityTypeConnection.totalCount": + if e.complexity.EntityTypeConnection.TotalCount == nil { + break + } + + return e.complexity.EntityTypeConnection.TotalCount(childComplexity), true + + case "EntityTypeCreatePayload.entityType": + if e.complexity.EntityTypeCreatePayload.EntityType == nil { + break + } + + return e.complexity.EntityTypeCreatePayload.EntityType(childComplexity), true + + case "EntityTypeDeletePayload.deletedID": + if e.complexity.EntityTypeDeletePayload.DeletedID == nil { + break + } + + return e.complexity.EntityTypeDeletePayload.DeletedID(childComplexity), true + + case "EntityTypeEdge.cursor": + if e.complexity.EntityTypeEdge.Cursor == nil { + break + } + + return e.complexity.EntityTypeEdge.Cursor(childComplexity), true + + case "EntityTypeEdge.node": + if e.complexity.EntityTypeEdge.Node == nil { + break + } + + return e.complexity.EntityTypeEdge.Node(childComplexity), true + + case "EntityTypeHistory.createdAt": + if e.complexity.EntityTypeHistory.CreatedAt == nil { + break + } + + return e.complexity.EntityTypeHistory.CreatedAt(childComplexity), true + + case "EntityTypeHistory.createdBy": + if e.complexity.EntityTypeHistory.CreatedBy == nil { + break + } + + return e.complexity.EntityTypeHistory.CreatedBy(childComplexity), true + + case "EntityTypeHistory.deletedAt": + if e.complexity.EntityTypeHistory.DeletedAt == nil { + break + } + + return e.complexity.EntityTypeHistory.DeletedAt(childComplexity), true + + case "EntityTypeHistory.deletedBy": + if e.complexity.EntityTypeHistory.DeletedBy == nil { + break + } + + return e.complexity.EntityTypeHistory.DeletedBy(childComplexity), true + + case "EntityTypeHistory.historyTime": + if e.complexity.EntityTypeHistory.HistoryTime == nil { + break + } + + return e.complexity.EntityTypeHistory.HistoryTime(childComplexity), true + + case "EntityTypeHistory.id": + if e.complexity.EntityTypeHistory.ID == nil { + break + } + + return e.complexity.EntityTypeHistory.ID(childComplexity), true + + case "EntityTypeHistory.name": + if e.complexity.EntityTypeHistory.Name == nil { + break + } + + return e.complexity.EntityTypeHistory.Name(childComplexity), true + + case "EntityTypeHistory.operation": + if e.complexity.EntityTypeHistory.Operation == nil { + break + } + + return e.complexity.EntityTypeHistory.Operation(childComplexity), true + + case "EntityTypeHistory.ownerID": + if e.complexity.EntityTypeHistory.OwnerID == nil { + break + } + + return e.complexity.EntityTypeHistory.OwnerID(childComplexity), true + + case "EntityTypeHistory.ref": + if e.complexity.EntityTypeHistory.Ref == nil { + break + } + + return e.complexity.EntityTypeHistory.Ref(childComplexity), true + + case "EntityTypeHistory.tags": + if e.complexity.EntityTypeHistory.Tags == nil { + break + } + + return e.complexity.EntityTypeHistory.Tags(childComplexity), true + + case "EntityTypeHistory.updatedAt": + if e.complexity.EntityTypeHistory.UpdatedAt == nil { + break + } + + return e.complexity.EntityTypeHistory.UpdatedAt(childComplexity), true + + case "EntityTypeHistory.updatedBy": + if e.complexity.EntityTypeHistory.UpdatedBy == nil { + break + } + + return e.complexity.EntityTypeHistory.UpdatedBy(childComplexity), true + + case "EntityTypeHistoryConnection.edges": + if e.complexity.EntityTypeHistoryConnection.Edges == nil { + break + } + + return e.complexity.EntityTypeHistoryConnection.Edges(childComplexity), true + + case "EntityTypeHistoryConnection.pageInfo": + if e.complexity.EntityTypeHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.EntityTypeHistoryConnection.PageInfo(childComplexity), true + + case "EntityTypeHistoryConnection.totalCount": + if e.complexity.EntityTypeHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.EntityTypeHistoryConnection.TotalCount(childComplexity), true + + case "EntityTypeHistoryEdge.cursor": + if e.complexity.EntityTypeHistoryEdge.Cursor == nil { + break + } + + return e.complexity.EntityTypeHistoryEdge.Cursor(childComplexity), true + + case "EntityTypeHistoryEdge.node": + if e.complexity.EntityTypeHistoryEdge.Node == nil { + break + } + + return e.complexity.EntityTypeHistoryEdge.Node(childComplexity), true + + case "EntityTypeUpdatePayload.entityType": + if e.complexity.EntityTypeUpdatePayload.EntityType == nil { + break + } + + return e.complexity.EntityTypeUpdatePayload.EntityType(childComplexity), true + + case "EntityUpdatePayload.entity": + if e.complexity.EntityUpdatePayload.Entity == nil { + break + } + + return e.complexity.EntityUpdatePayload.Entity(childComplexity), true + + case "Event.correlationID": + if e.complexity.Event.CorrelationID == nil { + break + } + + return e.complexity.Event.CorrelationID(childComplexity), true + + case "Event.createdAt": + if e.complexity.Event.CreatedAt == nil { + break + } + + return e.complexity.Event.CreatedAt(childComplexity), true + + case "Event.createdBy": + if e.complexity.Event.CreatedBy == nil { + break + } + + return e.complexity.Event.CreatedBy(childComplexity), true + + case "Event.entitlement": + if e.complexity.Event.Entitlement == nil { + break + } + + return e.complexity.Event.Entitlement(childComplexity), true + + case "Event.entitlementplan": + if e.complexity.Event.Entitlementplan == nil { + break + } + + return e.complexity.Event.Entitlementplan(childComplexity), true + + case "Event.entitlementplanfeature": + if e.complexity.Event.Entitlementplanfeature == nil { + break + } + + return e.complexity.Event.Entitlementplanfeature(childComplexity), true + + case "Event.eventID": + if e.complexity.Event.EventID == nil { + break + } + + return e.complexity.Event.EventID(childComplexity), true + + case "Event.eventType": + if e.complexity.Event.EventType == nil { + break + } + + return e.complexity.Event.EventType(childComplexity), true + + case "Event.feature": + if e.complexity.Event.Feature == nil { + break + } + + return e.complexity.Event.Feature(childComplexity), true + + case "Event.group": + if e.complexity.Event.Group == nil { + break + } + + return e.complexity.Event.Group(childComplexity), true + + case "Event.groupmembership": + if e.complexity.Event.Groupmembership == nil { + break + } + + return e.complexity.Event.Groupmembership(childComplexity), true + + case "Event.hush": + if e.complexity.Event.Hush == nil { + break + } + + return e.complexity.Event.Hush(childComplexity), true + + case "Event.id": + if e.complexity.Event.ID == nil { + break + } + + return e.complexity.Event.ID(childComplexity), true + + case "Event.integration": + if e.complexity.Event.Integration == nil { + break + } + + return e.complexity.Event.Integration(childComplexity), true + + case "Event.invite": + if e.complexity.Event.Invite == nil { + break + } + + return e.complexity.Event.Invite(childComplexity), true + + case "Event.metadata": + if e.complexity.Event.Metadata == nil { + break + } + + return e.complexity.Event.Metadata(childComplexity), true + + case "Event.oauth2token": + if e.complexity.Event.Oauth2token == nil { + break + } + + return e.complexity.Event.Oauth2token(childComplexity), true + + case "Event.organization": + if e.complexity.Event.Organization == nil { + break + } + + return e.complexity.Event.Organization(childComplexity), true + + case "Event.orgmembership": + if e.complexity.Event.Orgmembership == nil { + break + } + + return e.complexity.Event.Orgmembership(childComplexity), true + + case "Event.personalAccessToken": + if e.complexity.Event.PersonalAccessToken == nil { + break + } + + return e.complexity.Event.PersonalAccessToken(childComplexity), true + + case "Event.subscriber": + if e.complexity.Event.Subscriber == nil { + break + } + + return e.complexity.Event.Subscriber(childComplexity), true + + case "Event.tags": + if e.complexity.Event.Tags == nil { + break + } + + return e.complexity.Event.Tags(childComplexity), true + + case "Event.updatedAt": + if e.complexity.Event.UpdatedAt == nil { + break + } + + return e.complexity.Event.UpdatedAt(childComplexity), true + + case "Event.updatedBy": + if e.complexity.Event.UpdatedBy == nil { + break + } + + return e.complexity.Event.UpdatedBy(childComplexity), true + + case "Event.user": + if e.complexity.Event.User == nil { + break + } + + return e.complexity.Event.User(childComplexity), true + + case "Event.webhook": + if e.complexity.Event.Webhook == nil { + break + } + + return e.complexity.Event.Webhook(childComplexity), true + + case "EventBulkCreatePayload.events": + if e.complexity.EventBulkCreatePayload.Events == nil { + break + } + + return e.complexity.EventBulkCreatePayload.Events(childComplexity), true + + case "EventConnection.edges": + if e.complexity.EventConnection.Edges == nil { + break + } + + return e.complexity.EventConnection.Edges(childComplexity), true + + case "EventConnection.pageInfo": + if e.complexity.EventConnection.PageInfo == nil { + break + } + + return e.complexity.EventConnection.PageInfo(childComplexity), true + + case "EventConnection.totalCount": + if e.complexity.EventConnection.TotalCount == nil { + break + } + + return e.complexity.EventConnection.TotalCount(childComplexity), true + + case "EventCreatePayload.event": + if e.complexity.EventCreatePayload.Event == nil { + break + } + + return e.complexity.EventCreatePayload.Event(childComplexity), true + + case "EventDeletePayload.deletedID": + if e.complexity.EventDeletePayload.DeletedID == nil { + break + } + + return e.complexity.EventDeletePayload.DeletedID(childComplexity), true + + case "EventEdge.cursor": + if e.complexity.EventEdge.Cursor == nil { + break + } + + return e.complexity.EventEdge.Cursor(childComplexity), true + + case "EventEdge.node": + if e.complexity.EventEdge.Node == nil { + break + } + + return e.complexity.EventEdge.Node(childComplexity), true + + case "EventHistory.correlationID": + if e.complexity.EventHistory.CorrelationID == nil { + break + } + + return e.complexity.EventHistory.CorrelationID(childComplexity), true + + case "EventHistory.createdAt": + if e.complexity.EventHistory.CreatedAt == nil { + break + } + + return e.complexity.EventHistory.CreatedAt(childComplexity), true + + case "EventHistory.createdBy": + if e.complexity.EventHistory.CreatedBy == nil { + break + } + + return e.complexity.EventHistory.CreatedBy(childComplexity), true + + case "EventHistory.eventID": + if e.complexity.EventHistory.EventID == nil { + break + } + + return e.complexity.EventHistory.EventID(childComplexity), true + + case "EventHistory.eventType": + if e.complexity.EventHistory.EventType == nil { + break + } + + return e.complexity.EventHistory.EventType(childComplexity), true + + case "EventHistory.historyTime": + if e.complexity.EventHistory.HistoryTime == nil { + break + } + + return e.complexity.EventHistory.HistoryTime(childComplexity), true + + case "EventHistory.id": + if e.complexity.EventHistory.ID == nil { + break + } + + return e.complexity.EventHistory.ID(childComplexity), true + + case "EventHistory.metadata": + if e.complexity.EventHistory.Metadata == nil { + break + } + + return e.complexity.EventHistory.Metadata(childComplexity), true + + case "EventHistory.operation": + if e.complexity.EventHistory.Operation == nil { + break + } + + return e.complexity.EventHistory.Operation(childComplexity), true + + case "EventHistory.ref": + if e.complexity.EventHistory.Ref == nil { + break + } + + return e.complexity.EventHistory.Ref(childComplexity), true + + case "EventHistory.tags": + if e.complexity.EventHistory.Tags == nil { + break + } + + return e.complexity.EventHistory.Tags(childComplexity), true + + case "EventHistory.updatedAt": + if e.complexity.EventHistory.UpdatedAt == nil { + break + } + + return e.complexity.EventHistory.UpdatedAt(childComplexity), true + + case "EventHistory.updatedBy": + if e.complexity.EventHistory.UpdatedBy == nil { + break + } + + return e.complexity.EventHistory.UpdatedBy(childComplexity), true + + case "EventHistoryConnection.edges": + if e.complexity.EventHistoryConnection.Edges == nil { + break + } + + return e.complexity.EventHistoryConnection.Edges(childComplexity), true + + case "EventHistoryConnection.pageInfo": + if e.complexity.EventHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.EventHistoryConnection.PageInfo(childComplexity), true + + case "EventHistoryConnection.totalCount": + if e.complexity.EventHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.EventHistoryConnection.TotalCount(childComplexity), true + + case "EventHistoryEdge.cursor": + if e.complexity.EventHistoryEdge.Cursor == nil { + break + } + + return e.complexity.EventHistoryEdge.Cursor(childComplexity), true + + case "EventHistoryEdge.node": + if e.complexity.EventHistoryEdge.Node == nil { + break + } + + return e.complexity.EventHistoryEdge.Node(childComplexity), true + + case "EventUpdatePayload.event": + if e.complexity.EventUpdatePayload.Event == nil { + break + } + + return e.complexity.EventUpdatePayload.Event(childComplexity), true + + case "Feature.createdAt": + if e.complexity.Feature.CreatedAt == nil { + break + } + + return e.complexity.Feature.CreatedAt(childComplexity), true + + case "Feature.createdBy": + if e.complexity.Feature.CreatedBy == nil { + break + } + + return e.complexity.Feature.CreatedBy(childComplexity), true + + case "Feature.deletedAt": + if e.complexity.Feature.DeletedAt == nil { + break + } + + return e.complexity.Feature.DeletedAt(childComplexity), true + + case "Feature.deletedBy": + if e.complexity.Feature.DeletedBy == nil { + break + } + + return e.complexity.Feature.DeletedBy(childComplexity), true + + case "Feature.description": + if e.complexity.Feature.Description == nil { + break + } + + return e.complexity.Feature.Description(childComplexity), true + + case "Feature.displayName": + if e.complexity.Feature.DisplayName == nil { + break + } + + return e.complexity.Feature.DisplayName(childComplexity), true + + case "Feature.enabled": + if e.complexity.Feature.Enabled == nil { + break + } + + return e.complexity.Feature.Enabled(childComplexity), true + + case "Feature.events": + if e.complexity.Feature.Events == nil { + break + } + + return e.complexity.Feature.Events(childComplexity), true + + case "Feature.features": + if e.complexity.Feature.Features == nil { + break + } + + return e.complexity.Feature.Features(childComplexity), true + + case "Feature.id": + if e.complexity.Feature.ID == nil { + break + } + + return e.complexity.Feature.ID(childComplexity), true + + case "Feature.metadata": + if e.complexity.Feature.Metadata == nil { + break + } + + return e.complexity.Feature.Metadata(childComplexity), true + + case "Feature.name": + if e.complexity.Feature.Name == nil { + break + } + + return e.complexity.Feature.Name(childComplexity), true + + case "Feature.owner": + if e.complexity.Feature.Owner == nil { + break + } + + return e.complexity.Feature.Owner(childComplexity), true + + case "Feature.ownerID": + if e.complexity.Feature.OwnerID == nil { + break + } + + return e.complexity.Feature.OwnerID(childComplexity), true + + case "Feature.plans": + if e.complexity.Feature.Plans == nil { + break + } + + return e.complexity.Feature.Plans(childComplexity), true + + case "Feature.tags": + if e.complexity.Feature.Tags == nil { + break + } + + return e.complexity.Feature.Tags(childComplexity), true + + case "Feature.updatedAt": + if e.complexity.Feature.UpdatedAt == nil { + break + } + + return e.complexity.Feature.UpdatedAt(childComplexity), true + + case "Feature.updatedBy": + if e.complexity.Feature.UpdatedBy == nil { + break + } + + return e.complexity.Feature.UpdatedBy(childComplexity), true + + case "FeatureBulkCreatePayload.features": + if e.complexity.FeatureBulkCreatePayload.Features == nil { + break + } + + return e.complexity.FeatureBulkCreatePayload.Features(childComplexity), true + + case "FeatureConnection.edges": + if e.complexity.FeatureConnection.Edges == nil { + break + } + + return e.complexity.FeatureConnection.Edges(childComplexity), true + + case "FeatureConnection.pageInfo": + if e.complexity.FeatureConnection.PageInfo == nil { + break + } + + return e.complexity.FeatureConnection.PageInfo(childComplexity), true + + case "FeatureConnection.totalCount": + if e.complexity.FeatureConnection.TotalCount == nil { + break + } + + return e.complexity.FeatureConnection.TotalCount(childComplexity), true + + case "FeatureCreatePayload.feature": + if e.complexity.FeatureCreatePayload.Feature == nil { + break + } + + return e.complexity.FeatureCreatePayload.Feature(childComplexity), true + + case "FeatureDeletePayload.deletedID": + if e.complexity.FeatureDeletePayload.DeletedID == nil { + break + } + + return e.complexity.FeatureDeletePayload.DeletedID(childComplexity), true + + case "FeatureEdge.cursor": + if e.complexity.FeatureEdge.Cursor == nil { + break + } + + return e.complexity.FeatureEdge.Cursor(childComplexity), true + + case "FeatureEdge.node": + if e.complexity.FeatureEdge.Node == nil { + break + } + + return e.complexity.FeatureEdge.Node(childComplexity), true + + case "FeatureHistory.createdAt": + if e.complexity.FeatureHistory.CreatedAt == nil { + break + } + + return e.complexity.FeatureHistory.CreatedAt(childComplexity), true + + case "FeatureHistory.createdBy": + if e.complexity.FeatureHistory.CreatedBy == nil { + break + } + + return e.complexity.FeatureHistory.CreatedBy(childComplexity), true + + case "FeatureHistory.deletedAt": + if e.complexity.FeatureHistory.DeletedAt == nil { + break + } + + return e.complexity.FeatureHistory.DeletedAt(childComplexity), true + + case "FeatureHistory.deletedBy": + if e.complexity.FeatureHistory.DeletedBy == nil { + break + } + + return e.complexity.FeatureHistory.DeletedBy(childComplexity), true + + case "FeatureHistory.description": + if e.complexity.FeatureHistory.Description == nil { + break + } + + return e.complexity.FeatureHistory.Description(childComplexity), true + + case "FeatureHistory.displayName": + if e.complexity.FeatureHistory.DisplayName == nil { + break + } + + return e.complexity.FeatureHistory.DisplayName(childComplexity), true + + case "FeatureHistory.enabled": + if e.complexity.FeatureHistory.Enabled == nil { + break + } + + return e.complexity.FeatureHistory.Enabled(childComplexity), true + + case "FeatureHistory.historyTime": + if e.complexity.FeatureHistory.HistoryTime == nil { + break + } + + return e.complexity.FeatureHistory.HistoryTime(childComplexity), true + + case "FeatureHistory.id": + if e.complexity.FeatureHistory.ID == nil { + break + } + + return e.complexity.FeatureHistory.ID(childComplexity), true + + case "FeatureHistory.metadata": + if e.complexity.FeatureHistory.Metadata == nil { + break + } + + return e.complexity.FeatureHistory.Metadata(childComplexity), true + + case "FeatureHistory.name": + if e.complexity.FeatureHistory.Name == nil { + break + } + + return e.complexity.FeatureHistory.Name(childComplexity), true + + case "FeatureHistory.operation": + if e.complexity.FeatureHistory.Operation == nil { + break + } + + return e.complexity.FeatureHistory.Operation(childComplexity), true + + case "FeatureHistory.ownerID": + if e.complexity.FeatureHistory.OwnerID == nil { + break + } + + return e.complexity.FeatureHistory.OwnerID(childComplexity), true + + case "FeatureHistory.ref": + if e.complexity.FeatureHistory.Ref == nil { + break + } + + return e.complexity.FeatureHistory.Ref(childComplexity), true + + case "FeatureHistory.tags": + if e.complexity.FeatureHistory.Tags == nil { + break + } + + return e.complexity.FeatureHistory.Tags(childComplexity), true + + case "FeatureHistory.updatedAt": + if e.complexity.FeatureHistory.UpdatedAt == nil { + break + } + + return e.complexity.FeatureHistory.UpdatedAt(childComplexity), true + + case "FeatureHistory.updatedBy": + if e.complexity.FeatureHistory.UpdatedBy == nil { + break + } + + return e.complexity.FeatureHistory.UpdatedBy(childComplexity), true + + case "FeatureHistoryConnection.edges": + if e.complexity.FeatureHistoryConnection.Edges == nil { + break + } + + return e.complexity.FeatureHistoryConnection.Edges(childComplexity), true + + case "FeatureHistoryConnection.pageInfo": + if e.complexity.FeatureHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.FeatureHistoryConnection.PageInfo(childComplexity), true + + case "FeatureHistoryConnection.totalCount": + if e.complexity.FeatureHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.FeatureHistoryConnection.TotalCount(childComplexity), true + + case "FeatureHistoryEdge.cursor": + if e.complexity.FeatureHistoryEdge.Cursor == nil { + break + } + + return e.complexity.FeatureHistoryEdge.Cursor(childComplexity), true + + case "FeatureHistoryEdge.node": + if e.complexity.FeatureHistoryEdge.Node == nil { + break + } + + return e.complexity.FeatureHistoryEdge.Node(childComplexity), true + + case "FeatureUpdatePayload.feature": + if e.complexity.FeatureUpdatePayload.Feature == nil { + break + } + + return e.complexity.FeatureUpdatePayload.Feature(childComplexity), true + + case "File.annotation": + if e.complexity.File.Annotation == nil { + break + } + + return e.complexity.File.Annotation(childComplexity), true + + case "File.category": + if e.complexity.File.Category == nil { + break + } + + return e.complexity.File.Category(childComplexity), true + + case "File.contentType": + if e.complexity.File.ContentType == nil { + break + } + + return e.complexity.File.ContentType(childComplexity), true + + case "File.createdAt": + if e.complexity.File.CreatedAt == nil { + break + } + + return e.complexity.File.CreatedAt(childComplexity), true + + case "File.createdBy": + if e.complexity.File.CreatedBy == nil { + break + } + + return e.complexity.File.CreatedBy(childComplexity), true + + case "File.deletedAt": + if e.complexity.File.DeletedAt == nil { + break + } + + return e.complexity.File.DeletedAt(childComplexity), true + + case "File.deletedBy": + if e.complexity.File.DeletedBy == nil { + break + } + + return e.complexity.File.DeletedBy(childComplexity), true + + case "File.entity": + if e.complexity.File.Entity == nil { + break + } + + return e.complexity.File.Entity(childComplexity), true + + case "File.fileExtension": + if e.complexity.File.FileExtension == nil { + break + } + + return e.complexity.File.FileExtension(childComplexity), true + + case "File.fileName": + if e.complexity.File.FileName == nil { + break + } + + return e.complexity.File.FileName(childComplexity), true + + case "File.fileSize": + if e.complexity.File.FileSize == nil { + break + } + + return e.complexity.File.FileSize(childComplexity), true + + case "File.group": + if e.complexity.File.Group == nil { + break + } + + return e.complexity.File.Group(childComplexity), true + + case "File.id": + if e.complexity.File.ID == nil { + break + } + + return e.complexity.File.ID(childComplexity), true + + case "File.organization": + if e.complexity.File.Organization == nil { + break + } + + return e.complexity.File.Organization(childComplexity), true + + case "File.storeKey": + if e.complexity.File.StoreKey == nil { + break + } + + return e.complexity.File.StoreKey(childComplexity), true + + case "File.tags": + if e.complexity.File.Tags == nil { + break + } + + return e.complexity.File.Tags(childComplexity), true + + case "File.updatedAt": + if e.complexity.File.UpdatedAt == nil { + break + } + + return e.complexity.File.UpdatedAt(childComplexity), true + + case "File.updatedBy": + if e.complexity.File.UpdatedBy == nil { + break + } + + return e.complexity.File.UpdatedBy(childComplexity), true + + case "File.user": + if e.complexity.File.User == nil { + break + } + + return e.complexity.File.User(childComplexity), true + + case "FileBulkCreatePayload.files": + if e.complexity.FileBulkCreatePayload.Files == nil { + break + } + + return e.complexity.FileBulkCreatePayload.Files(childComplexity), true + + case "FileConnection.edges": + if e.complexity.FileConnection.Edges == nil { + break + } + + return e.complexity.FileConnection.Edges(childComplexity), true + + case "FileConnection.pageInfo": + if e.complexity.FileConnection.PageInfo == nil { + break + } + + return e.complexity.FileConnection.PageInfo(childComplexity), true + + case "FileConnection.totalCount": + if e.complexity.FileConnection.TotalCount == nil { + break + } + + return e.complexity.FileConnection.TotalCount(childComplexity), true + + case "FileCreatePayload.file": + if e.complexity.FileCreatePayload.File == nil { + break + } + + return e.complexity.FileCreatePayload.File(childComplexity), true + + case "FileDeletePayload.deletedID": + if e.complexity.FileDeletePayload.DeletedID == nil { + break + } + + return e.complexity.FileDeletePayload.DeletedID(childComplexity), true + + case "FileEdge.cursor": + if e.complexity.FileEdge.Cursor == nil { + break + } + + return e.complexity.FileEdge.Cursor(childComplexity), true + + case "FileEdge.node": + if e.complexity.FileEdge.Node == nil { + break + } + + return e.complexity.FileEdge.Node(childComplexity), true + + case "FileHistory.annotation": + if e.complexity.FileHistory.Annotation == nil { + break + } + + return e.complexity.FileHistory.Annotation(childComplexity), true + + case "FileHistory.category": + if e.complexity.FileHistory.Category == nil { + break + } + + return e.complexity.FileHistory.Category(childComplexity), true + + case "FileHistory.contentType": + if e.complexity.FileHistory.ContentType == nil { + break + } + + return e.complexity.FileHistory.ContentType(childComplexity), true + + case "FileHistory.createdAt": + if e.complexity.FileHistory.CreatedAt == nil { + break + } + + return e.complexity.FileHistory.CreatedAt(childComplexity), true + + case "FileHistory.createdBy": + if e.complexity.FileHistory.CreatedBy == nil { + break + } + + return e.complexity.FileHistory.CreatedBy(childComplexity), true + + case "FileHistory.deletedAt": + if e.complexity.FileHistory.DeletedAt == nil { + break + } + + return e.complexity.FileHistory.DeletedAt(childComplexity), true + + case "FileHistory.deletedBy": + if e.complexity.FileHistory.DeletedBy == nil { + break + } + + return e.complexity.FileHistory.DeletedBy(childComplexity), true + + case "FileHistory.fileExtension": + if e.complexity.FileHistory.FileExtension == nil { + break + } + + return e.complexity.FileHistory.FileExtension(childComplexity), true + + case "FileHistory.fileName": + if e.complexity.FileHistory.FileName == nil { + break + } + + return e.complexity.FileHistory.FileName(childComplexity), true + + case "FileHistory.fileSize": + if e.complexity.FileHistory.FileSize == nil { + break + } + + return e.complexity.FileHistory.FileSize(childComplexity), true + + case "FileHistory.historyTime": + if e.complexity.FileHistory.HistoryTime == nil { + break + } + + return e.complexity.FileHistory.HistoryTime(childComplexity), true + + case "FileHistory.id": + if e.complexity.FileHistory.ID == nil { + break + } + + return e.complexity.FileHistory.ID(childComplexity), true + + case "FileHistory.operation": + if e.complexity.FileHistory.Operation == nil { + break + } + + return e.complexity.FileHistory.Operation(childComplexity), true + + case "FileHistory.ref": + if e.complexity.FileHistory.Ref == nil { + break + } + + return e.complexity.FileHistory.Ref(childComplexity), true + + case "FileHistory.storeKey": + if e.complexity.FileHistory.StoreKey == nil { + break + } + + return e.complexity.FileHistory.StoreKey(childComplexity), true + + case "FileHistory.tags": + if e.complexity.FileHistory.Tags == nil { + break + } + + return e.complexity.FileHistory.Tags(childComplexity), true + + case "FileHistory.updatedAt": + if e.complexity.FileHistory.UpdatedAt == nil { + break + } + + return e.complexity.FileHistory.UpdatedAt(childComplexity), true + + case "FileHistory.updatedBy": + if e.complexity.FileHistory.UpdatedBy == nil { + break + } + + return e.complexity.FileHistory.UpdatedBy(childComplexity), true + + case "FileHistoryConnection.edges": + if e.complexity.FileHistoryConnection.Edges == nil { + break + } + + return e.complexity.FileHistoryConnection.Edges(childComplexity), true + + case "FileHistoryConnection.pageInfo": + if e.complexity.FileHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.FileHistoryConnection.PageInfo(childComplexity), true + + case "FileHistoryConnection.totalCount": + if e.complexity.FileHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.FileHistoryConnection.TotalCount(childComplexity), true + + case "FileHistoryEdge.cursor": + if e.complexity.FileHistoryEdge.Cursor == nil { + break + } + + return e.complexity.FileHistoryEdge.Cursor(childComplexity), true + + case "FileHistoryEdge.node": + if e.complexity.FileHistoryEdge.Node == nil { + break + } + + return e.complexity.FileHistoryEdge.Node(childComplexity), true + + case "FileUpdatePayload.file": + if e.complexity.FileUpdatePayload.File == nil { + break + } + + return e.complexity.FileUpdatePayload.File(childComplexity), true + + case "GlobalSearchResultConnection.nodes": + if e.complexity.GlobalSearchResultConnection.Nodes == nil { + break + } + + return e.complexity.GlobalSearchResultConnection.Nodes(childComplexity), true + + case "GlobalSearchResultConnection.page": + if e.complexity.GlobalSearchResultConnection.Page == nil { + break + } + + return e.complexity.GlobalSearchResultConnection.Page(childComplexity), true + + case "Group.createdAt": + if e.complexity.Group.CreatedAt == nil { + break + } + + return e.complexity.Group.CreatedAt(childComplexity), true + + case "Group.createdBy": + if e.complexity.Group.CreatedBy == nil { + break + } + + return e.complexity.Group.CreatedBy(childComplexity), true + + case "Group.deletedAt": + if e.complexity.Group.DeletedAt == nil { + break + } + + return e.complexity.Group.DeletedAt(childComplexity), true + + case "Group.deletedBy": + if e.complexity.Group.DeletedBy == nil { + break + } + + return e.complexity.Group.DeletedBy(childComplexity), true + + case "Group.description": + if e.complexity.Group.Description == nil { + break + } + + return e.complexity.Group.Description(childComplexity), true + + case "Group.displayName": + if e.complexity.Group.DisplayName == nil { + break + } + + return e.complexity.Group.DisplayName(childComplexity), true + + case "Group.events": + if e.complexity.Group.Events == nil { + break + } + + return e.complexity.Group.Events(childComplexity), true + + case "Group.files": + if e.complexity.Group.Files == nil { + break + } + + return e.complexity.Group.Files(childComplexity), true + + case "Group.gravatarLogoURL": + if e.complexity.Group.GravatarLogoURL == nil { + break + } + + return e.complexity.Group.GravatarLogoURL(childComplexity), true + + case "Group.id": + if e.complexity.Group.ID == nil { + break + } + + return e.complexity.Group.ID(childComplexity), true + + case "Group.integrations": + if e.complexity.Group.Integrations == nil { + break + } + + return e.complexity.Group.Integrations(childComplexity), true + + case "Group.logoURL": + if e.complexity.Group.LogoURL == nil { + break + } + + return e.complexity.Group.LogoURL(childComplexity), true + + case "Group.members": + if e.complexity.Group.Members == nil { + break + } + + return e.complexity.Group.Members(childComplexity), true + + case "Group.name": + if e.complexity.Group.Name == nil { + break + } + + return e.complexity.Group.Name(childComplexity), true + + case "Group.owner": + if e.complexity.Group.Owner == nil { + break + } + + return e.complexity.Group.Owner(childComplexity), true + + case "Group.ownerID": + if e.complexity.Group.OwnerID == nil { + break + } + + return e.complexity.Group.OwnerID(childComplexity), true + + case "Group.setting": + if e.complexity.Group.Setting == nil { + break + } + + return e.complexity.Group.Setting(childComplexity), true + + case "Group.tags": + if e.complexity.Group.Tags == nil { + break + } + + return e.complexity.Group.Tags(childComplexity), true + + case "Group.updatedAt": + if e.complexity.Group.UpdatedAt == nil { + break + } + + return e.complexity.Group.UpdatedAt(childComplexity), true + + case "Group.updatedBy": + if e.complexity.Group.UpdatedBy == nil { + break + } + + return e.complexity.Group.UpdatedBy(childComplexity), true + + case "Group.users": + if e.complexity.Group.Users == nil { + break + } + + return e.complexity.Group.Users(childComplexity), true + + case "GroupBulkCreatePayload.groups": + if e.complexity.GroupBulkCreatePayload.Groups == nil { + break + } + + return e.complexity.GroupBulkCreatePayload.Groups(childComplexity), true + + case "GroupConnection.edges": + if e.complexity.GroupConnection.Edges == nil { + break + } + + return e.complexity.GroupConnection.Edges(childComplexity), true + + case "GroupConnection.pageInfo": + if e.complexity.GroupConnection.PageInfo == nil { + break + } + + return e.complexity.GroupConnection.PageInfo(childComplexity), true + + case "GroupConnection.totalCount": + if e.complexity.GroupConnection.TotalCount == nil { + break + } + + return e.complexity.GroupConnection.TotalCount(childComplexity), true + + case "GroupCreatePayload.group": + if e.complexity.GroupCreatePayload.Group == nil { + break + } + + return e.complexity.GroupCreatePayload.Group(childComplexity), true + + case "GroupDeletePayload.deletedID": + if e.complexity.GroupDeletePayload.DeletedID == nil { + break + } + + return e.complexity.GroupDeletePayload.DeletedID(childComplexity), true + + case "GroupEdge.cursor": + if e.complexity.GroupEdge.Cursor == nil { + break + } + + return e.complexity.GroupEdge.Cursor(childComplexity), true + + case "GroupEdge.node": + if e.complexity.GroupEdge.Node == nil { + break + } + + return e.complexity.GroupEdge.Node(childComplexity), true + + case "GroupHistory.createdAt": + if e.complexity.GroupHistory.CreatedAt == nil { + break + } + + return e.complexity.GroupHistory.CreatedAt(childComplexity), true + + case "GroupHistory.createdBy": + if e.complexity.GroupHistory.CreatedBy == nil { + break + } + + return e.complexity.GroupHistory.CreatedBy(childComplexity), true + + case "GroupHistory.deletedAt": + if e.complexity.GroupHistory.DeletedAt == nil { + break + } + + return e.complexity.GroupHistory.DeletedAt(childComplexity), true + + case "GroupHistory.deletedBy": + if e.complexity.GroupHistory.DeletedBy == nil { + break + } + + return e.complexity.GroupHistory.DeletedBy(childComplexity), true + + case "GroupHistory.description": + if e.complexity.GroupHistory.Description == nil { + break + } + + return e.complexity.GroupHistory.Description(childComplexity), true + + case "GroupHistory.displayName": + if e.complexity.GroupHistory.DisplayName == nil { + break + } + + return e.complexity.GroupHistory.DisplayName(childComplexity), true + + case "GroupHistory.gravatarLogoURL": + if e.complexity.GroupHistory.GravatarLogoURL == nil { + break + } + + return e.complexity.GroupHistory.GravatarLogoURL(childComplexity), true + + case "GroupHistory.historyTime": + if e.complexity.GroupHistory.HistoryTime == nil { + break + } + + return e.complexity.GroupHistory.HistoryTime(childComplexity), true + + case "GroupHistory.id": + if e.complexity.GroupHistory.ID == nil { + break + } + + return e.complexity.GroupHistory.ID(childComplexity), true + + case "GroupHistory.logoURL": + if e.complexity.GroupHistory.LogoURL == nil { + break + } + + return e.complexity.GroupHistory.LogoURL(childComplexity), true + + case "GroupHistory.name": + if e.complexity.GroupHistory.Name == nil { + break + } + + return e.complexity.GroupHistory.Name(childComplexity), true + + case "GroupHistory.operation": + if e.complexity.GroupHistory.Operation == nil { + break + } + + return e.complexity.GroupHistory.Operation(childComplexity), true + + case "GroupHistory.ownerID": + if e.complexity.GroupHistory.OwnerID == nil { + break + } + + return e.complexity.GroupHistory.OwnerID(childComplexity), true + + case "GroupHistory.ref": + if e.complexity.GroupHistory.Ref == nil { + break + } + + return e.complexity.GroupHistory.Ref(childComplexity), true + + case "GroupHistory.tags": + if e.complexity.GroupHistory.Tags == nil { + break + } + + return e.complexity.GroupHistory.Tags(childComplexity), true + + case "GroupHistory.updatedAt": + if e.complexity.GroupHistory.UpdatedAt == nil { + break + } + + return e.complexity.GroupHistory.UpdatedAt(childComplexity), true + + case "GroupHistory.updatedBy": + if e.complexity.GroupHistory.UpdatedBy == nil { + break + } + + return e.complexity.GroupHistory.UpdatedBy(childComplexity), true + + case "GroupHistoryConnection.edges": + if e.complexity.GroupHistoryConnection.Edges == nil { + break + } + + return e.complexity.GroupHistoryConnection.Edges(childComplexity), true + + case "GroupHistoryConnection.pageInfo": + if e.complexity.GroupHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.GroupHistoryConnection.PageInfo(childComplexity), true + + case "GroupHistoryConnection.totalCount": + if e.complexity.GroupHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.GroupHistoryConnection.TotalCount(childComplexity), true + + case "GroupHistoryEdge.cursor": + if e.complexity.GroupHistoryEdge.Cursor == nil { + break + } + + return e.complexity.GroupHistoryEdge.Cursor(childComplexity), true + + case "GroupHistoryEdge.node": + if e.complexity.GroupHistoryEdge.Node == nil { + break + } + + return e.complexity.GroupHistoryEdge.Node(childComplexity), true + + case "GroupMembership.createdAt": + if e.complexity.GroupMembership.CreatedAt == nil { + break + } + + return e.complexity.GroupMembership.CreatedAt(childComplexity), true + + case "GroupMembership.createdBy": + if e.complexity.GroupMembership.CreatedBy == nil { + break + } + + return e.complexity.GroupMembership.CreatedBy(childComplexity), true + + case "GroupMembership.deletedAt": + if e.complexity.GroupMembership.DeletedAt == nil { + break + } + + return e.complexity.GroupMembership.DeletedAt(childComplexity), true + + case "GroupMembership.deletedBy": + if e.complexity.GroupMembership.DeletedBy == nil { + break + } + + return e.complexity.GroupMembership.DeletedBy(childComplexity), true + + case "GroupMembership.events": + if e.complexity.GroupMembership.Events == nil { + break + } + + return e.complexity.GroupMembership.Events(childComplexity), true + + case "GroupMembership.group": + if e.complexity.GroupMembership.Group == nil { + break + } + + return e.complexity.GroupMembership.Group(childComplexity), true + + case "GroupMembership.groupID": + if e.complexity.GroupMembership.GroupID == nil { + break + } + + return e.complexity.GroupMembership.GroupID(childComplexity), true + + case "GroupMembership.id": + if e.complexity.GroupMembership.ID == nil { + break + } + + return e.complexity.GroupMembership.ID(childComplexity), true + + case "GroupMembership.role": + if e.complexity.GroupMembership.Role == nil { + break + } + + return e.complexity.GroupMembership.Role(childComplexity), true + + case "GroupMembership.updatedAt": + if e.complexity.GroupMembership.UpdatedAt == nil { + break + } + + return e.complexity.GroupMembership.UpdatedAt(childComplexity), true + + case "GroupMembership.updatedBy": + if e.complexity.GroupMembership.UpdatedBy == nil { + break + } + + return e.complexity.GroupMembership.UpdatedBy(childComplexity), true + + case "GroupMembership.user": + if e.complexity.GroupMembership.User == nil { + break + } + + return e.complexity.GroupMembership.User(childComplexity), true + + case "GroupMembership.userID": + if e.complexity.GroupMembership.UserID == nil { + break + } + + return e.complexity.GroupMembership.UserID(childComplexity), true + + case "GroupMembershipBulkCreatePayload.groupMemberships": + if e.complexity.GroupMembershipBulkCreatePayload.GroupMemberships == nil { + break + } + + return e.complexity.GroupMembershipBulkCreatePayload.GroupMemberships(childComplexity), true + + case "GroupMembershipConnection.edges": + if e.complexity.GroupMembershipConnection.Edges == nil { + break + } + + return e.complexity.GroupMembershipConnection.Edges(childComplexity), true + + case "GroupMembershipConnection.pageInfo": + if e.complexity.GroupMembershipConnection.PageInfo == nil { + break + } + + return e.complexity.GroupMembershipConnection.PageInfo(childComplexity), true + + case "GroupMembershipConnection.totalCount": + if e.complexity.GroupMembershipConnection.TotalCount == nil { + break + } + + return e.complexity.GroupMembershipConnection.TotalCount(childComplexity), true + + case "GroupMembershipCreatePayload.groupMembership": + if e.complexity.GroupMembershipCreatePayload.GroupMembership == nil { + break + } + + return e.complexity.GroupMembershipCreatePayload.GroupMembership(childComplexity), true + + case "GroupMembershipDeletePayload.deletedID": + if e.complexity.GroupMembershipDeletePayload.DeletedID == nil { + break + } + + return e.complexity.GroupMembershipDeletePayload.DeletedID(childComplexity), true + + case "GroupMembershipEdge.cursor": + if e.complexity.GroupMembershipEdge.Cursor == nil { + break + } + + return e.complexity.GroupMembershipEdge.Cursor(childComplexity), true + + case "GroupMembershipEdge.node": + if e.complexity.GroupMembershipEdge.Node == nil { + break + } + + return e.complexity.GroupMembershipEdge.Node(childComplexity), true + + case "GroupMembershipHistory.createdAt": + if e.complexity.GroupMembershipHistory.CreatedAt == nil { + break + } + + return e.complexity.GroupMembershipHistory.CreatedAt(childComplexity), true + + case "GroupMembershipHistory.createdBy": + if e.complexity.GroupMembershipHistory.CreatedBy == nil { + break + } + + return e.complexity.GroupMembershipHistory.CreatedBy(childComplexity), true + + case "GroupMembershipHistory.deletedAt": + if e.complexity.GroupMembershipHistory.DeletedAt == nil { + break + } + + return e.complexity.GroupMembershipHistory.DeletedAt(childComplexity), true + + case "GroupMembershipHistory.deletedBy": + if e.complexity.GroupMembershipHistory.DeletedBy == nil { + break + } + + return e.complexity.GroupMembershipHistory.DeletedBy(childComplexity), true + + case "GroupMembershipHistory.groupID": + if e.complexity.GroupMembershipHistory.GroupID == nil { + break + } + + return e.complexity.GroupMembershipHistory.GroupID(childComplexity), true + + case "GroupMembershipHistory.historyTime": + if e.complexity.GroupMembershipHistory.HistoryTime == nil { + break + } + + return e.complexity.GroupMembershipHistory.HistoryTime(childComplexity), true + + case "GroupMembershipHistory.id": + if e.complexity.GroupMembershipHistory.ID == nil { + break + } + + return e.complexity.GroupMembershipHistory.ID(childComplexity), true + + case "GroupMembershipHistory.operation": + if e.complexity.GroupMembershipHistory.Operation == nil { + break + } + + return e.complexity.GroupMembershipHistory.Operation(childComplexity), true + + case "GroupMembershipHistory.ref": + if e.complexity.GroupMembershipHistory.Ref == nil { + break + } + + return e.complexity.GroupMembershipHistory.Ref(childComplexity), true + + case "GroupMembershipHistory.role": + if e.complexity.GroupMembershipHistory.Role == nil { + break + } + + return e.complexity.GroupMembershipHistory.Role(childComplexity), true + + case "GroupMembershipHistory.updatedAt": + if e.complexity.GroupMembershipHistory.UpdatedAt == nil { + break + } + + return e.complexity.GroupMembershipHistory.UpdatedAt(childComplexity), true + + case "GroupMembershipHistory.updatedBy": + if e.complexity.GroupMembershipHistory.UpdatedBy == nil { + break + } + + return e.complexity.GroupMembershipHistory.UpdatedBy(childComplexity), true + + case "GroupMembershipHistory.userID": + if e.complexity.GroupMembershipHistory.UserID == nil { + break + } + + return e.complexity.GroupMembershipHistory.UserID(childComplexity), true + + case "GroupMembershipHistoryConnection.edges": + if e.complexity.GroupMembershipHistoryConnection.Edges == nil { + break + } + + return e.complexity.GroupMembershipHistoryConnection.Edges(childComplexity), true + + case "GroupMembershipHistoryConnection.pageInfo": + if e.complexity.GroupMembershipHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.GroupMembershipHistoryConnection.PageInfo(childComplexity), true + + case "GroupMembershipHistoryConnection.totalCount": + if e.complexity.GroupMembershipHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.GroupMembershipHistoryConnection.TotalCount(childComplexity), true + + case "GroupMembershipHistoryEdge.cursor": + if e.complexity.GroupMembershipHistoryEdge.Cursor == nil { + break + } + + return e.complexity.GroupMembershipHistoryEdge.Cursor(childComplexity), true + + case "GroupMembershipHistoryEdge.node": + if e.complexity.GroupMembershipHistoryEdge.Node == nil { + break + } + + return e.complexity.GroupMembershipHistoryEdge.Node(childComplexity), true + + case "GroupMembershipUpdatePayload.groupMembership": + if e.complexity.GroupMembershipUpdatePayload.GroupMembership == nil { + break + } + + return e.complexity.GroupMembershipUpdatePayload.GroupMembership(childComplexity), true + + case "GroupSearchResult.groups": + if e.complexity.GroupSearchResult.Groups == nil { + break + } + + return e.complexity.GroupSearchResult.Groups(childComplexity), true + + case "GroupSetting.createdAt": + if e.complexity.GroupSetting.CreatedAt == nil { + break + } + + return e.complexity.GroupSetting.CreatedAt(childComplexity), true + + case "GroupSetting.createdBy": + if e.complexity.GroupSetting.CreatedBy == nil { + break + } + + return e.complexity.GroupSetting.CreatedBy(childComplexity), true + + case "GroupSetting.deletedAt": + if e.complexity.GroupSetting.DeletedAt == nil { + break + } + + return e.complexity.GroupSetting.DeletedAt(childComplexity), true + + case "GroupSetting.deletedBy": + if e.complexity.GroupSetting.DeletedBy == nil { + break + } + + return e.complexity.GroupSetting.DeletedBy(childComplexity), true + + case "GroupSetting.group": + if e.complexity.GroupSetting.Group == nil { + break + } + + return e.complexity.GroupSetting.Group(childComplexity), true + + case "GroupSetting.groupID": + if e.complexity.GroupSetting.GroupID == nil { + break + } + + return e.complexity.GroupSetting.GroupID(childComplexity), true + + case "GroupSetting.id": + if e.complexity.GroupSetting.ID == nil { + break + } + + return e.complexity.GroupSetting.ID(childComplexity), true + + case "GroupSetting.joinPolicy": + if e.complexity.GroupSetting.JoinPolicy == nil { + break + } + + return e.complexity.GroupSetting.JoinPolicy(childComplexity), true + + case "GroupSetting.syncToGithub": + if e.complexity.GroupSetting.SyncToGithub == nil { + break + } + + return e.complexity.GroupSetting.SyncToGithub(childComplexity), true + + case "GroupSetting.syncToSlack": + if e.complexity.GroupSetting.SyncToSlack == nil { + break + } + + return e.complexity.GroupSetting.SyncToSlack(childComplexity), true + + case "GroupSetting.tags": + if e.complexity.GroupSetting.Tags == nil { + break + } + + return e.complexity.GroupSetting.Tags(childComplexity), true + + case "GroupSetting.updatedAt": + if e.complexity.GroupSetting.UpdatedAt == nil { + break + } + + return e.complexity.GroupSetting.UpdatedAt(childComplexity), true + + case "GroupSetting.updatedBy": + if e.complexity.GroupSetting.UpdatedBy == nil { + break + } + + return e.complexity.GroupSetting.UpdatedBy(childComplexity), true + + case "GroupSetting.visibility": + if e.complexity.GroupSetting.Visibility == nil { + break + } + + return e.complexity.GroupSetting.Visibility(childComplexity), true + + case "GroupSettingBulkCreatePayload.groupSettings": + if e.complexity.GroupSettingBulkCreatePayload.GroupSettings == nil { + break + } + + return e.complexity.GroupSettingBulkCreatePayload.GroupSettings(childComplexity), true + + case "GroupSettingConnection.edges": + if e.complexity.GroupSettingConnection.Edges == nil { + break + } + + return e.complexity.GroupSettingConnection.Edges(childComplexity), true + + case "GroupSettingConnection.pageInfo": + if e.complexity.GroupSettingConnection.PageInfo == nil { + break + } + + return e.complexity.GroupSettingConnection.PageInfo(childComplexity), true + + case "GroupSettingConnection.totalCount": + if e.complexity.GroupSettingConnection.TotalCount == nil { + break + } + + return e.complexity.GroupSettingConnection.TotalCount(childComplexity), true + + case "GroupSettingCreatePayload.groupSetting": + if e.complexity.GroupSettingCreatePayload.GroupSetting == nil { + break + } + + return e.complexity.GroupSettingCreatePayload.GroupSetting(childComplexity), true + + case "GroupSettingDeletePayload.deletedID": + if e.complexity.GroupSettingDeletePayload.DeletedID == nil { + break + } + + return e.complexity.GroupSettingDeletePayload.DeletedID(childComplexity), true + + case "GroupSettingEdge.cursor": + if e.complexity.GroupSettingEdge.Cursor == nil { + break + } + + return e.complexity.GroupSettingEdge.Cursor(childComplexity), true + + case "GroupSettingEdge.node": + if e.complexity.GroupSettingEdge.Node == nil { + break + } + + return e.complexity.GroupSettingEdge.Node(childComplexity), true + + case "GroupSettingHistory.createdAt": + if e.complexity.GroupSettingHistory.CreatedAt == nil { + break + } + + return e.complexity.GroupSettingHistory.CreatedAt(childComplexity), true + + case "GroupSettingHistory.createdBy": + if e.complexity.GroupSettingHistory.CreatedBy == nil { + break + } + + return e.complexity.GroupSettingHistory.CreatedBy(childComplexity), true + + case "GroupSettingHistory.deletedAt": + if e.complexity.GroupSettingHistory.DeletedAt == nil { + break + } + + return e.complexity.GroupSettingHistory.DeletedAt(childComplexity), true + + case "GroupSettingHistory.deletedBy": + if e.complexity.GroupSettingHistory.DeletedBy == nil { + break + } + + return e.complexity.GroupSettingHistory.DeletedBy(childComplexity), true + + case "GroupSettingHistory.groupID": + if e.complexity.GroupSettingHistory.GroupID == nil { + break + } + + return e.complexity.GroupSettingHistory.GroupID(childComplexity), true + + case "GroupSettingHistory.historyTime": + if e.complexity.GroupSettingHistory.HistoryTime == nil { + break + } + + return e.complexity.GroupSettingHistory.HistoryTime(childComplexity), true + + case "GroupSettingHistory.id": + if e.complexity.GroupSettingHistory.ID == nil { + break + } + + return e.complexity.GroupSettingHistory.ID(childComplexity), true + + case "GroupSettingHistory.joinPolicy": + if e.complexity.GroupSettingHistory.JoinPolicy == nil { + break + } + + return e.complexity.GroupSettingHistory.JoinPolicy(childComplexity), true + + case "GroupSettingHistory.operation": + if e.complexity.GroupSettingHistory.Operation == nil { + break + } + + return e.complexity.GroupSettingHistory.Operation(childComplexity), true + + case "GroupSettingHistory.ref": + if e.complexity.GroupSettingHistory.Ref == nil { + break + } + + return e.complexity.GroupSettingHistory.Ref(childComplexity), true + + case "GroupSettingHistory.syncToGithub": + if e.complexity.GroupSettingHistory.SyncToGithub == nil { + break + } + + return e.complexity.GroupSettingHistory.SyncToGithub(childComplexity), true + + case "GroupSettingHistory.syncToSlack": + if e.complexity.GroupSettingHistory.SyncToSlack == nil { + break + } + + return e.complexity.GroupSettingHistory.SyncToSlack(childComplexity), true + + case "GroupSettingHistory.tags": + if e.complexity.GroupSettingHistory.Tags == nil { + break + } + + return e.complexity.GroupSettingHistory.Tags(childComplexity), true + + case "GroupSettingHistory.updatedAt": + if e.complexity.GroupSettingHistory.UpdatedAt == nil { + break + } + + return e.complexity.GroupSettingHistory.UpdatedAt(childComplexity), true + + case "GroupSettingHistory.updatedBy": + if e.complexity.GroupSettingHistory.UpdatedBy == nil { + break + } + + return e.complexity.GroupSettingHistory.UpdatedBy(childComplexity), true + + case "GroupSettingHistory.visibility": + if e.complexity.GroupSettingHistory.Visibility == nil { + break + } + + return e.complexity.GroupSettingHistory.Visibility(childComplexity), true + + case "GroupSettingHistoryConnection.edges": + if e.complexity.GroupSettingHistoryConnection.Edges == nil { + break + } + + return e.complexity.GroupSettingHistoryConnection.Edges(childComplexity), true + + case "GroupSettingHistoryConnection.pageInfo": + if e.complexity.GroupSettingHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.GroupSettingHistoryConnection.PageInfo(childComplexity), true + + case "GroupSettingHistoryConnection.totalCount": + if e.complexity.GroupSettingHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.GroupSettingHistoryConnection.TotalCount(childComplexity), true + + case "GroupSettingHistoryEdge.cursor": + if e.complexity.GroupSettingHistoryEdge.Cursor == nil { + break + } + + return e.complexity.GroupSettingHistoryEdge.Cursor(childComplexity), true + + case "GroupSettingHistoryEdge.node": + if e.complexity.GroupSettingHistoryEdge.Node == nil { + break + } + + return e.complexity.GroupSettingHistoryEdge.Node(childComplexity), true + + case "GroupSettingUpdatePayload.groupSetting": + if e.complexity.GroupSettingUpdatePayload.GroupSetting == nil { + break + } + + return e.complexity.GroupSettingUpdatePayload.GroupSetting(childComplexity), true + + case "GroupUpdatePayload.group": + if e.complexity.GroupUpdatePayload.Group == nil { + break + } + + return e.complexity.GroupUpdatePayload.Group(childComplexity), true + + case "Hush.createdAt": + if e.complexity.Hush.CreatedAt == nil { + break + } + + return e.complexity.Hush.CreatedAt(childComplexity), true + + case "Hush.createdBy": + if e.complexity.Hush.CreatedBy == nil { + break + } + + return e.complexity.Hush.CreatedBy(childComplexity), true + + case "Hush.deletedAt": + if e.complexity.Hush.DeletedAt == nil { + break + } + + return e.complexity.Hush.DeletedAt(childComplexity), true + + case "Hush.deletedBy": + if e.complexity.Hush.DeletedBy == nil { + break + } + + return e.complexity.Hush.DeletedBy(childComplexity), true + + case "Hush.description": + if e.complexity.Hush.Description == nil { + break + } + + return e.complexity.Hush.Description(childComplexity), true + + case "Hush.events": + if e.complexity.Hush.Events == nil { + break + } + + return e.complexity.Hush.Events(childComplexity), true + + case "Hush.id": + if e.complexity.Hush.ID == nil { + break + } + + return e.complexity.Hush.ID(childComplexity), true + + case "Hush.integrations": + if e.complexity.Hush.Integrations == nil { + break + } + + return e.complexity.Hush.Integrations(childComplexity), true + + case "Hush.kind": + if e.complexity.Hush.Kind == nil { + break + } + + return e.complexity.Hush.Kind(childComplexity), true + + case "Hush.name": + if e.complexity.Hush.Name == nil { + break + } + + return e.complexity.Hush.Name(childComplexity), true + + case "Hush.organization": + if e.complexity.Hush.Organization == nil { + break + } + + return e.complexity.Hush.Organization(childComplexity), true + + case "Hush.secretName": + if e.complexity.Hush.SecretName == nil { + break + } + + return e.complexity.Hush.SecretName(childComplexity), true + + case "Hush.updatedAt": + if e.complexity.Hush.UpdatedAt == nil { + break + } + + return e.complexity.Hush.UpdatedAt(childComplexity), true + + case "Hush.updatedBy": + if e.complexity.Hush.UpdatedBy == nil { + break + } + + return e.complexity.Hush.UpdatedBy(childComplexity), true + + case "HushBulkCreatePayload.hushes": + if e.complexity.HushBulkCreatePayload.Hushes == nil { + break + } + + return e.complexity.HushBulkCreatePayload.Hushes(childComplexity), true + + case "HushConnection.edges": + if e.complexity.HushConnection.Edges == nil { + break + } + + return e.complexity.HushConnection.Edges(childComplexity), true + + case "HushConnection.pageInfo": + if e.complexity.HushConnection.PageInfo == nil { + break + } + + return e.complexity.HushConnection.PageInfo(childComplexity), true + + case "HushConnection.totalCount": + if e.complexity.HushConnection.TotalCount == nil { + break + } + + return e.complexity.HushConnection.TotalCount(childComplexity), true + + case "HushCreatePayload.hush": + if e.complexity.HushCreatePayload.Hush == nil { + break + } + + return e.complexity.HushCreatePayload.Hush(childComplexity), true + + case "HushDeletePayload.deletedID": + if e.complexity.HushDeletePayload.DeletedID == nil { + break + } + + return e.complexity.HushDeletePayload.DeletedID(childComplexity), true + + case "HushEdge.cursor": + if e.complexity.HushEdge.Cursor == nil { + break + } + + return e.complexity.HushEdge.Cursor(childComplexity), true + + case "HushEdge.node": + if e.complexity.HushEdge.Node == nil { + break + } + + return e.complexity.HushEdge.Node(childComplexity), true + + case "HushHistory.createdAt": + if e.complexity.HushHistory.CreatedAt == nil { + break + } + + return e.complexity.HushHistory.CreatedAt(childComplexity), true + + case "HushHistory.createdBy": + if e.complexity.HushHistory.CreatedBy == nil { + break + } + + return e.complexity.HushHistory.CreatedBy(childComplexity), true + + case "HushHistory.deletedAt": + if e.complexity.HushHistory.DeletedAt == nil { + break + } + + return e.complexity.HushHistory.DeletedAt(childComplexity), true + + case "HushHistory.deletedBy": + if e.complexity.HushHistory.DeletedBy == nil { + break + } + + return e.complexity.HushHistory.DeletedBy(childComplexity), true + + case "HushHistory.description": + if e.complexity.HushHistory.Description == nil { + break + } + + return e.complexity.HushHistory.Description(childComplexity), true + + case "HushHistory.historyTime": + if e.complexity.HushHistory.HistoryTime == nil { + break + } + + return e.complexity.HushHistory.HistoryTime(childComplexity), true + + case "HushHistory.id": + if e.complexity.HushHistory.ID == nil { + break + } + + return e.complexity.HushHistory.ID(childComplexity), true + + case "HushHistory.kind": + if e.complexity.HushHistory.Kind == nil { + break + } + + return e.complexity.HushHistory.Kind(childComplexity), true + + case "HushHistory.name": + if e.complexity.HushHistory.Name == nil { + break + } + + return e.complexity.HushHistory.Name(childComplexity), true + + case "HushHistory.operation": + if e.complexity.HushHistory.Operation == nil { + break + } + + return e.complexity.HushHistory.Operation(childComplexity), true + + case "HushHistory.ref": + if e.complexity.HushHistory.Ref == nil { + break + } + + return e.complexity.HushHistory.Ref(childComplexity), true + + case "HushHistory.secretName": + if e.complexity.HushHistory.SecretName == nil { + break + } + + return e.complexity.HushHistory.SecretName(childComplexity), true + + case "HushHistory.updatedAt": + if e.complexity.HushHistory.UpdatedAt == nil { + break + } + + return e.complexity.HushHistory.UpdatedAt(childComplexity), true + + case "HushHistory.updatedBy": + if e.complexity.HushHistory.UpdatedBy == nil { + break + } + + return e.complexity.HushHistory.UpdatedBy(childComplexity), true + + case "HushHistoryConnection.edges": + if e.complexity.HushHistoryConnection.Edges == nil { + break + } + + return e.complexity.HushHistoryConnection.Edges(childComplexity), true + + case "HushHistoryConnection.pageInfo": + if e.complexity.HushHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.HushHistoryConnection.PageInfo(childComplexity), true + + case "HushHistoryConnection.totalCount": + if e.complexity.HushHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.HushHistoryConnection.TotalCount(childComplexity), true + + case "HushHistoryEdge.cursor": + if e.complexity.HushHistoryEdge.Cursor == nil { + break + } + + return e.complexity.HushHistoryEdge.Cursor(childComplexity), true + + case "HushHistoryEdge.node": + if e.complexity.HushHistoryEdge.Node == nil { + break + } + + return e.complexity.HushHistoryEdge.Node(childComplexity), true + + case "HushUpdatePayload.hush": + if e.complexity.HushUpdatePayload.Hush == nil { + break + } + + return e.complexity.HushUpdatePayload.Hush(childComplexity), true + + case "Integration.createdAt": + if e.complexity.Integration.CreatedAt == nil { + break + } + + return e.complexity.Integration.CreatedAt(childComplexity), true + + case "Integration.createdBy": + if e.complexity.Integration.CreatedBy == nil { + break + } + + return e.complexity.Integration.CreatedBy(childComplexity), true + + case "Integration.deletedAt": + if e.complexity.Integration.DeletedAt == nil { + break + } + + return e.complexity.Integration.DeletedAt(childComplexity), true + + case "Integration.deletedBy": + if e.complexity.Integration.DeletedBy == nil { + break + } + + return e.complexity.Integration.DeletedBy(childComplexity), true + + case "Integration.description": + if e.complexity.Integration.Description == nil { + break + } + + return e.complexity.Integration.Description(childComplexity), true + + case "Integration.events": + if e.complexity.Integration.Events == nil { + break + } + + return e.complexity.Integration.Events(childComplexity), true + + case "Integration.id": + if e.complexity.Integration.ID == nil { + break + } + + return e.complexity.Integration.ID(childComplexity), true + + case "Integration.kind": + if e.complexity.Integration.Kind == nil { + break + } + + return e.complexity.Integration.Kind(childComplexity), true + + case "Integration.name": + if e.complexity.Integration.Name == nil { + break + } + + return e.complexity.Integration.Name(childComplexity), true + + case "Integration.oauth2tokens": + if e.complexity.Integration.Oauth2tokens == nil { + break + } + + return e.complexity.Integration.Oauth2tokens(childComplexity), true + + case "Integration.owner": + if e.complexity.Integration.Owner == nil { + break + } + + return e.complexity.Integration.Owner(childComplexity), true + + case "Integration.ownerID": + if e.complexity.Integration.OwnerID == nil { + break + } + + return e.complexity.Integration.OwnerID(childComplexity), true + + case "Integration.secrets": + if e.complexity.Integration.Secrets == nil { + break + } + + return e.complexity.Integration.Secrets(childComplexity), true + + case "Integration.tags": + if e.complexity.Integration.Tags == nil { + break + } + + return e.complexity.Integration.Tags(childComplexity), true + + case "Integration.updatedAt": + if e.complexity.Integration.UpdatedAt == nil { + break + } + + return e.complexity.Integration.UpdatedAt(childComplexity), true + + case "Integration.updatedBy": + if e.complexity.Integration.UpdatedBy == nil { + break + } + + return e.complexity.Integration.UpdatedBy(childComplexity), true + + case "Integration.webhooks": + if e.complexity.Integration.Webhooks == nil { + break + } + + return e.complexity.Integration.Webhooks(childComplexity), true + + case "IntegrationBulkCreatePayload.integrations": + if e.complexity.IntegrationBulkCreatePayload.Integrations == nil { + break + } + + return e.complexity.IntegrationBulkCreatePayload.Integrations(childComplexity), true + + case "IntegrationConnection.edges": + if e.complexity.IntegrationConnection.Edges == nil { + break + } + + return e.complexity.IntegrationConnection.Edges(childComplexity), true + + case "IntegrationConnection.pageInfo": + if e.complexity.IntegrationConnection.PageInfo == nil { + break + } + + return e.complexity.IntegrationConnection.PageInfo(childComplexity), true + + case "IntegrationConnection.totalCount": + if e.complexity.IntegrationConnection.TotalCount == nil { + break + } + + return e.complexity.IntegrationConnection.TotalCount(childComplexity), true + + case "IntegrationCreatePayload.integration": + if e.complexity.IntegrationCreatePayload.Integration == nil { + break + } + + return e.complexity.IntegrationCreatePayload.Integration(childComplexity), true + + case "IntegrationDeletePayload.deletedID": + if e.complexity.IntegrationDeletePayload.DeletedID == nil { + break + } + + return e.complexity.IntegrationDeletePayload.DeletedID(childComplexity), true + + case "IntegrationEdge.cursor": + if e.complexity.IntegrationEdge.Cursor == nil { + break + } + + return e.complexity.IntegrationEdge.Cursor(childComplexity), true + + case "IntegrationEdge.node": + if e.complexity.IntegrationEdge.Node == nil { + break + } + + return e.complexity.IntegrationEdge.Node(childComplexity), true + + case "IntegrationHistory.createdAt": + if e.complexity.IntegrationHistory.CreatedAt == nil { + break + } + + return e.complexity.IntegrationHistory.CreatedAt(childComplexity), true + + case "IntegrationHistory.createdBy": + if e.complexity.IntegrationHistory.CreatedBy == nil { + break + } + + return e.complexity.IntegrationHistory.CreatedBy(childComplexity), true + + case "IntegrationHistory.deletedAt": + if e.complexity.IntegrationHistory.DeletedAt == nil { + break + } + + return e.complexity.IntegrationHistory.DeletedAt(childComplexity), true + + case "IntegrationHistory.deletedBy": + if e.complexity.IntegrationHistory.DeletedBy == nil { + break + } + + return e.complexity.IntegrationHistory.DeletedBy(childComplexity), true + + case "IntegrationHistory.description": + if e.complexity.IntegrationHistory.Description == nil { + break + } + + return e.complexity.IntegrationHistory.Description(childComplexity), true + + case "IntegrationHistory.historyTime": + if e.complexity.IntegrationHistory.HistoryTime == nil { + break + } + + return e.complexity.IntegrationHistory.HistoryTime(childComplexity), true + + case "IntegrationHistory.id": + if e.complexity.IntegrationHistory.ID == nil { + break + } + + return e.complexity.IntegrationHistory.ID(childComplexity), true + + case "IntegrationHistory.kind": + if e.complexity.IntegrationHistory.Kind == nil { + break + } + + return e.complexity.IntegrationHistory.Kind(childComplexity), true + + case "IntegrationHistory.name": + if e.complexity.IntegrationHistory.Name == nil { + break + } + + return e.complexity.IntegrationHistory.Name(childComplexity), true + + case "IntegrationHistory.operation": + if e.complexity.IntegrationHistory.Operation == nil { + break + } + + return e.complexity.IntegrationHistory.Operation(childComplexity), true + + case "IntegrationHistory.ownerID": + if e.complexity.IntegrationHistory.OwnerID == nil { + break + } + + return e.complexity.IntegrationHistory.OwnerID(childComplexity), true + + case "IntegrationHistory.ref": + if e.complexity.IntegrationHistory.Ref == nil { + break + } + + return e.complexity.IntegrationHistory.Ref(childComplexity), true + + case "IntegrationHistory.tags": + if e.complexity.IntegrationHistory.Tags == nil { + break + } + + return e.complexity.IntegrationHistory.Tags(childComplexity), true + + case "IntegrationHistory.updatedAt": + if e.complexity.IntegrationHistory.UpdatedAt == nil { + break + } + + return e.complexity.IntegrationHistory.UpdatedAt(childComplexity), true + + case "IntegrationHistory.updatedBy": + if e.complexity.IntegrationHistory.UpdatedBy == nil { + break + } + + return e.complexity.IntegrationHistory.UpdatedBy(childComplexity), true + + case "IntegrationHistoryConnection.edges": + if e.complexity.IntegrationHistoryConnection.Edges == nil { + break + } + + return e.complexity.IntegrationHistoryConnection.Edges(childComplexity), true + + case "IntegrationHistoryConnection.pageInfo": + if e.complexity.IntegrationHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.IntegrationHistoryConnection.PageInfo(childComplexity), true + + case "IntegrationHistoryConnection.totalCount": + if e.complexity.IntegrationHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.IntegrationHistoryConnection.TotalCount(childComplexity), true + + case "IntegrationHistoryEdge.cursor": + if e.complexity.IntegrationHistoryEdge.Cursor == nil { + break + } + + return e.complexity.IntegrationHistoryEdge.Cursor(childComplexity), true + + case "IntegrationHistoryEdge.node": + if e.complexity.IntegrationHistoryEdge.Node == nil { + break + } + + return e.complexity.IntegrationHistoryEdge.Node(childComplexity), true + + case "IntegrationUpdatePayload.integration": + if e.complexity.IntegrationUpdatePayload.Integration == nil { + break + } + + return e.complexity.IntegrationUpdatePayload.Integration(childComplexity), true + + case "Invite.createdAt": + if e.complexity.Invite.CreatedAt == nil { + break + } + + return e.complexity.Invite.CreatedAt(childComplexity), true + + case "Invite.createdBy": + if e.complexity.Invite.CreatedBy == nil { + break + } + + return e.complexity.Invite.CreatedBy(childComplexity), true + + case "Invite.deletedAt": + if e.complexity.Invite.DeletedAt == nil { + break + } + + return e.complexity.Invite.DeletedAt(childComplexity), true + + case "Invite.deletedBy": + if e.complexity.Invite.DeletedBy == nil { + break + } + + return e.complexity.Invite.DeletedBy(childComplexity), true + + case "Invite.events": + if e.complexity.Invite.Events == nil { + break + } + + return e.complexity.Invite.Events(childComplexity), true + + case "Invite.expires": + if e.complexity.Invite.Expires == nil { + break + } + + return e.complexity.Invite.Expires(childComplexity), true + + case "Invite.id": + if e.complexity.Invite.ID == nil { + break + } + + return e.complexity.Invite.ID(childComplexity), true + + case "Invite.owner": + if e.complexity.Invite.Owner == nil { + break + } + + return e.complexity.Invite.Owner(childComplexity), true + + case "Invite.ownerID": + if e.complexity.Invite.OwnerID == nil { + break + } + + return e.complexity.Invite.OwnerID(childComplexity), true + + case "Invite.recipient": + if e.complexity.Invite.Recipient == nil { + break + } + + return e.complexity.Invite.Recipient(childComplexity), true + + case "Invite.requestorID": + if e.complexity.Invite.RequestorID == nil { + break + } + + return e.complexity.Invite.RequestorID(childComplexity), true + + case "Invite.role": + if e.complexity.Invite.Role == nil { + break + } + + return e.complexity.Invite.Role(childComplexity), true + + case "Invite.sendAttempts": + if e.complexity.Invite.SendAttempts == nil { + break + } + + return e.complexity.Invite.SendAttempts(childComplexity), true + + case "Invite.status": + if e.complexity.Invite.Status == nil { + break + } + + return e.complexity.Invite.Status(childComplexity), true + + case "Invite.updatedAt": + if e.complexity.Invite.UpdatedAt == nil { + break + } + + return e.complexity.Invite.UpdatedAt(childComplexity), true + + case "Invite.updatedBy": + if e.complexity.Invite.UpdatedBy == nil { + break + } + + return e.complexity.Invite.UpdatedBy(childComplexity), true + + case "InviteBulkCreatePayload.invites": + if e.complexity.InviteBulkCreatePayload.Invites == nil { + break + } + + return e.complexity.InviteBulkCreatePayload.Invites(childComplexity), true + + case "InviteConnection.edges": + if e.complexity.InviteConnection.Edges == nil { + break + } + + return e.complexity.InviteConnection.Edges(childComplexity), true + + case "InviteConnection.pageInfo": + if e.complexity.InviteConnection.PageInfo == nil { + break + } + + return e.complexity.InviteConnection.PageInfo(childComplexity), true + + case "InviteConnection.totalCount": + if e.complexity.InviteConnection.TotalCount == nil { + break + } + + return e.complexity.InviteConnection.TotalCount(childComplexity), true + + case "InviteCreatePayload.invite": + if e.complexity.InviteCreatePayload.Invite == nil { + break + } + + return e.complexity.InviteCreatePayload.Invite(childComplexity), true + + case "InviteDeletePayload.deletedID": + if e.complexity.InviteDeletePayload.DeletedID == nil { + break + } + + return e.complexity.InviteDeletePayload.DeletedID(childComplexity), true + + case "InviteEdge.cursor": + if e.complexity.InviteEdge.Cursor == nil { + break + } + + return e.complexity.InviteEdge.Cursor(childComplexity), true + + case "InviteEdge.node": + if e.complexity.InviteEdge.Node == nil { + break + } + + return e.complexity.InviteEdge.Node(childComplexity), true + + case "InviteUpdatePayload.invite": + if e.complexity.InviteUpdatePayload.Invite == nil { + break + } + + return e.complexity.InviteUpdatePayload.Invite(childComplexity), true + + case "Mutation.createAPIToken": + if e.complexity.Mutation.CreateAPIToken == nil { + break + } + + args, err := ec.field_Mutation_createAPIToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateAPIToken(childComplexity, args["input"].(generated.CreateAPITokenInput)), true + + case "Mutation.createBulkAPIToken": + if e.complexity.Mutation.CreateBulkAPIToken == nil { + break + } + + args, err := ec.field_Mutation_createBulkAPIToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkAPIToken(childComplexity, args["input"].([]*generated.CreateAPITokenInput)), true + + case "Mutation.createBulkCSVAPIToken": + if e.complexity.Mutation.CreateBulkCSVAPIToken == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVAPIToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVAPIToken(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVContact": + if e.complexity.Mutation.CreateBulkCSVContact == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVContact_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVContact(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVDocumentData": + if e.complexity.Mutation.CreateBulkCSVDocumentData == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVDocumentData_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVDocumentData(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVEntitlement": + if e.complexity.Mutation.CreateBulkCSVEntitlement == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVEntitlement_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVEntitlement(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVEntitlementPlan": + if e.complexity.Mutation.CreateBulkCSVEntitlementPlan == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVEntitlementPlan_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVEntitlementPlan(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVEntitlementPlanFeature": + if e.complexity.Mutation.CreateBulkCSVEntitlementPlanFeature == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVEntitlementPlanFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVEntitlementPlanFeature(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVEntity": + if e.complexity.Mutation.CreateBulkCSVEntity == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVEntity_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVEntity(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVEntityType": + if e.complexity.Mutation.CreateBulkCSVEntityType == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVEntityType_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVEntityType(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVEvent": + if e.complexity.Mutation.CreateBulkCSVEvent == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVEvent_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVEvent(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVFeature": + if e.complexity.Mutation.CreateBulkCSVFeature == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVFeature(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVFile": + if e.complexity.Mutation.CreateBulkCSVFile == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVFile_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVFile(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVGroup": + if e.complexity.Mutation.CreateBulkCSVGroup == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVGroup_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVGroup(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVGroupMembership": + if e.complexity.Mutation.CreateBulkCSVGroupMembership == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVGroupMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVGroupMembership(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVGroupSetting": + if e.complexity.Mutation.CreateBulkCSVGroupSetting == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVGroupSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVGroupSetting(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVHush": + if e.complexity.Mutation.CreateBulkCSVHush == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVHush_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVHush(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVIntegration": + if e.complexity.Mutation.CreateBulkCSVIntegration == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVIntegration_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVIntegration(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVInvite": + if e.complexity.Mutation.CreateBulkCSVInvite == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVInvite_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVInvite(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVOauthProvider": + if e.complexity.Mutation.CreateBulkCSVOauthProvider == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVOauthProvider_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVOauthProvider(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVOhAuthTooToken": + if e.complexity.Mutation.CreateBulkCSVOhAuthTooToken == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVOhAuthTooToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVOhAuthTooToken(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVOrgMembership": + if e.complexity.Mutation.CreateBulkCSVOrgMembership == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVOrgMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVOrgMembership(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVOrganization": + if e.complexity.Mutation.CreateBulkCSVOrganization == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVOrganization_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVOrganization(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVOrganizationSetting": + if e.complexity.Mutation.CreateBulkCSVOrganizationSetting == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVOrganizationSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVOrganizationSetting(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVPersonalAccessToken": + if e.complexity.Mutation.CreateBulkCSVPersonalAccessToken == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVPersonalAccessToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVPersonalAccessToken(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVSubscriber": + if e.complexity.Mutation.CreateBulkCSVSubscriber == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVSubscriber_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVSubscriber(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVTemplate": + if e.complexity.Mutation.CreateBulkCSVTemplate == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVTemplate_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVTemplate(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVUserSetting": + if e.complexity.Mutation.CreateBulkCSVUserSetting == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVUserSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVUserSetting(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkCSVWebhook": + if e.complexity.Mutation.CreateBulkCSVWebhook == nil { + break + } + + args, err := ec.field_Mutation_createBulkCSVWebhook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkCSVWebhook(childComplexity, args["input"].(graphql.Upload)), true + + case "Mutation.createBulkContact": + if e.complexity.Mutation.CreateBulkContact == nil { + break + } + + args, err := ec.field_Mutation_createBulkContact_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkContact(childComplexity, args["input"].([]*generated.CreateContactInput)), true + + case "Mutation.createBulkDocumentData": + if e.complexity.Mutation.CreateBulkDocumentData == nil { + break + } + + args, err := ec.field_Mutation_createBulkDocumentData_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkDocumentData(childComplexity, args["input"].([]*generated.CreateDocumentDataInput)), true + + case "Mutation.createBulkEntitlement": + if e.complexity.Mutation.CreateBulkEntitlement == nil { + break + } + + args, err := ec.field_Mutation_createBulkEntitlement_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkEntitlement(childComplexity, args["input"].([]*generated.CreateEntitlementInput)), true + + case "Mutation.createBulkEntitlementPlan": + if e.complexity.Mutation.CreateBulkEntitlementPlan == nil { + break + } + + args, err := ec.field_Mutation_createBulkEntitlementPlan_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkEntitlementPlan(childComplexity, args["input"].([]*generated.CreateEntitlementPlanInput)), true + + case "Mutation.createBulkEntitlementPlanFeature": + if e.complexity.Mutation.CreateBulkEntitlementPlanFeature == nil { + break + } + + args, err := ec.field_Mutation_createBulkEntitlementPlanFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkEntitlementPlanFeature(childComplexity, args["input"].([]*generated.CreateEntitlementPlanFeatureInput)), true + + case "Mutation.createBulkEntity": + if e.complexity.Mutation.CreateBulkEntity == nil { + break + } + + args, err := ec.field_Mutation_createBulkEntity_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkEntity(childComplexity, args["input"].([]*generated.CreateEntityInput)), true + + case "Mutation.createBulkEntityType": + if e.complexity.Mutation.CreateBulkEntityType == nil { + break + } + + args, err := ec.field_Mutation_createBulkEntityType_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkEntityType(childComplexity, args["input"].([]*generated.CreateEntityTypeInput)), true + + case "Mutation.createBulkEvent": + if e.complexity.Mutation.CreateBulkEvent == nil { + break + } + + args, err := ec.field_Mutation_createBulkEvent_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkEvent(childComplexity, args["input"].([]*generated.CreateEventInput)), true + + case "Mutation.createBulkFeature": + if e.complexity.Mutation.CreateBulkFeature == nil { + break + } + + args, err := ec.field_Mutation_createBulkFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkFeature(childComplexity, args["input"].([]*generated.CreateFeatureInput)), true + + case "Mutation.createBulkFile": + if e.complexity.Mutation.CreateBulkFile == nil { + break + } + + args, err := ec.field_Mutation_createBulkFile_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkFile(childComplexity, args["input"].([]*generated.CreateFileInput)), true + + case "Mutation.createBulkGroup": + if e.complexity.Mutation.CreateBulkGroup == nil { + break + } + + args, err := ec.field_Mutation_createBulkGroup_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkGroup(childComplexity, args["input"].([]*generated.CreateGroupInput)), true + + case "Mutation.createBulkGroupMembership": + if e.complexity.Mutation.CreateBulkGroupMembership == nil { + break + } + + args, err := ec.field_Mutation_createBulkGroupMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkGroupMembership(childComplexity, args["input"].([]*generated.CreateGroupMembershipInput)), true + + case "Mutation.createBulkGroupSetting": + if e.complexity.Mutation.CreateBulkGroupSetting == nil { + break + } + + args, err := ec.field_Mutation_createBulkGroupSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkGroupSetting(childComplexity, args["input"].([]*generated.CreateGroupSettingInput)), true + + case "Mutation.createBulkHush": + if e.complexity.Mutation.CreateBulkHush == nil { + break + } + + args, err := ec.field_Mutation_createBulkHush_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkHush(childComplexity, args["input"].([]*generated.CreateHushInput)), true + + case "Mutation.createBulkIntegration": + if e.complexity.Mutation.CreateBulkIntegration == nil { + break + } + + args, err := ec.field_Mutation_createBulkIntegration_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkIntegration(childComplexity, args["input"].([]*generated.CreateIntegrationInput)), true + + case "Mutation.createBulkInvite": + if e.complexity.Mutation.CreateBulkInvite == nil { + break + } + + args, err := ec.field_Mutation_createBulkInvite_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkInvite(childComplexity, args["input"].([]*generated.CreateInviteInput)), true + + case "Mutation.createBulkOauthProvider": + if e.complexity.Mutation.CreateBulkOauthProvider == nil { + break + } + + args, err := ec.field_Mutation_createBulkOauthProvider_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkOauthProvider(childComplexity, args["input"].([]*generated.CreateOauthProviderInput)), true + + case "Mutation.createBulkOhAuthTooToken": + if e.complexity.Mutation.CreateBulkOhAuthTooToken == nil { + break + } + + args, err := ec.field_Mutation_createBulkOhAuthTooToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkOhAuthTooToken(childComplexity, args["input"].([]*generated.CreateOhAuthTooTokenInput)), true + + case "Mutation.createBulkOrgMembership": + if e.complexity.Mutation.CreateBulkOrgMembership == nil { + break + } + + args, err := ec.field_Mutation_createBulkOrgMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkOrgMembership(childComplexity, args["input"].([]*generated.CreateOrgMembershipInput)), true + + case "Mutation.createBulkOrganization": + if e.complexity.Mutation.CreateBulkOrganization == nil { + break + } + + args, err := ec.field_Mutation_createBulkOrganization_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkOrganization(childComplexity, args["input"].([]*generated.CreateOrganizationInput)), true + + case "Mutation.createBulkOrganizationSetting": + if e.complexity.Mutation.CreateBulkOrganizationSetting == nil { + break + } + + args, err := ec.field_Mutation_createBulkOrganizationSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkOrganizationSetting(childComplexity, args["input"].([]*generated.CreateOrganizationSettingInput)), true + + case "Mutation.createBulkPersonalAccessToken": + if e.complexity.Mutation.CreateBulkPersonalAccessToken == nil { + break + } + + args, err := ec.field_Mutation_createBulkPersonalAccessToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkPersonalAccessToken(childComplexity, args["input"].([]*generated.CreatePersonalAccessTokenInput)), true + + case "Mutation.createBulkSubscriber": + if e.complexity.Mutation.CreateBulkSubscriber == nil { + break + } + + args, err := ec.field_Mutation_createBulkSubscriber_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkSubscriber(childComplexity, args["input"].([]*generated.CreateSubscriberInput)), true + + case "Mutation.createBulkTemplate": + if e.complexity.Mutation.CreateBulkTemplate == nil { + break + } + + args, err := ec.field_Mutation_createBulkTemplate_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkTemplate(childComplexity, args["input"].([]*generated.CreateTemplateInput)), true + + case "Mutation.createBulkUserSetting": + if e.complexity.Mutation.CreateBulkUserSetting == nil { + break + } + + args, err := ec.field_Mutation_createBulkUserSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkUserSetting(childComplexity, args["input"].([]*generated.CreateUserSettingInput)), true + + case "Mutation.createBulkWebhook": + if e.complexity.Mutation.CreateBulkWebhook == nil { + break + } + + args, err := ec.field_Mutation_createBulkWebhook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateBulkWebhook(childComplexity, args["input"].([]*generated.CreateWebhookInput)), true + + case "Mutation.createContact": + if e.complexity.Mutation.CreateContact == nil { + break + } + + args, err := ec.field_Mutation_createContact_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateContact(childComplexity, args["input"].(generated.CreateContactInput)), true + + case "Mutation.createDocumentData": + if e.complexity.Mutation.CreateDocumentData == nil { + break + } + + args, err := ec.field_Mutation_createDocumentData_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateDocumentData(childComplexity, args["input"].(generated.CreateDocumentDataInput)), true + + case "Mutation.createEntitlement": + if e.complexity.Mutation.CreateEntitlement == nil { + break + } + + args, err := ec.field_Mutation_createEntitlement_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateEntitlement(childComplexity, args["input"].(generated.CreateEntitlementInput)), true + + case "Mutation.createEntitlementPlan": + if e.complexity.Mutation.CreateEntitlementPlan == nil { + break + } + + args, err := ec.field_Mutation_createEntitlementPlan_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateEntitlementPlan(childComplexity, args["input"].(generated.CreateEntitlementPlanInput)), true + + case "Mutation.createEntitlementPlanFeature": + if e.complexity.Mutation.CreateEntitlementPlanFeature == nil { + break + } + + args, err := ec.field_Mutation_createEntitlementPlanFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateEntitlementPlanFeature(childComplexity, args["input"].(generated.CreateEntitlementPlanFeatureInput)), true + + case "Mutation.createEntity": + if e.complexity.Mutation.CreateEntity == nil { + break + } + + args, err := ec.field_Mutation_createEntity_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateEntity(childComplexity, args["input"].(generated.CreateEntityInput)), true + + case "Mutation.createEntityType": + if e.complexity.Mutation.CreateEntityType == nil { + break + } + + args, err := ec.field_Mutation_createEntityType_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateEntityType(childComplexity, args["input"].(generated.CreateEntityTypeInput)), true + + case "Mutation.createEvent": + if e.complexity.Mutation.CreateEvent == nil { + break + } + + args, err := ec.field_Mutation_createEvent_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateEvent(childComplexity, args["input"].(generated.CreateEventInput)), true + + case "Mutation.createFeature": + if e.complexity.Mutation.CreateFeature == nil { + break + } + + args, err := ec.field_Mutation_createFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateFeature(childComplexity, args["input"].(generated.CreateFeatureInput)), true + + case "Mutation.createFile": + if e.complexity.Mutation.CreateFile == nil { + break + } + + args, err := ec.field_Mutation_createFile_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateFile(childComplexity, args["input"].(generated.CreateFileInput)), true + + case "Mutation.createGroup": + if e.complexity.Mutation.CreateGroup == nil { + break + } + + args, err := ec.field_Mutation_createGroup_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateGroup(childComplexity, args["input"].(generated.CreateGroupInput)), true + + case "Mutation.createGroupMembership": + if e.complexity.Mutation.CreateGroupMembership == nil { + break + } + + args, err := ec.field_Mutation_createGroupMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateGroupMembership(childComplexity, args["input"].(generated.CreateGroupMembershipInput)), true + + case "Mutation.createGroupSetting": + if e.complexity.Mutation.CreateGroupSetting == nil { + break + } + + args, err := ec.field_Mutation_createGroupSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateGroupSetting(childComplexity, args["input"].(generated.CreateGroupSettingInput)), true + + case "Mutation.createHush": + if e.complexity.Mutation.CreateHush == nil { + break + } + + args, err := ec.field_Mutation_createHush_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateHush(childComplexity, args["input"].(generated.CreateHushInput)), true + + case "Mutation.createIntegration": + if e.complexity.Mutation.CreateIntegration == nil { + break + } + + args, err := ec.field_Mutation_createIntegration_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateIntegration(childComplexity, args["input"].(generated.CreateIntegrationInput)), true + + case "Mutation.createInvite": + if e.complexity.Mutation.CreateInvite == nil { + break + } + + args, err := ec.field_Mutation_createInvite_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateInvite(childComplexity, args["input"].(generated.CreateInviteInput)), true + + case "Mutation.createOauthProvider": + if e.complexity.Mutation.CreateOauthProvider == nil { + break + } + + args, err := ec.field_Mutation_createOauthProvider_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateOauthProvider(childComplexity, args["input"].(generated.CreateOauthProviderInput)), true + + case "Mutation.createOhAuthTooToken": + if e.complexity.Mutation.CreateOhAuthTooToken == nil { + break + } + + args, err := ec.field_Mutation_createOhAuthTooToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateOhAuthTooToken(childComplexity, args["input"].(generated.CreateOhAuthTooTokenInput)), true + + case "Mutation.createOrgMembership": + if e.complexity.Mutation.CreateOrgMembership == nil { + break + } + + args, err := ec.field_Mutation_createOrgMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateOrgMembership(childComplexity, args["input"].(generated.CreateOrgMembershipInput)), true + + case "Mutation.createOrganization": + if e.complexity.Mutation.CreateOrganization == nil { + break + } + + args, err := ec.field_Mutation_createOrganization_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateOrganization(childComplexity, args["input"].(generated.CreateOrganizationInput)), true + + case "Mutation.createOrganizationSetting": + if e.complexity.Mutation.CreateOrganizationSetting == nil { + break + } + + args, err := ec.field_Mutation_createOrganizationSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateOrganizationSetting(childComplexity, args["input"].(generated.CreateOrganizationSettingInput)), true + + case "Mutation.createPersonalAccessToken": + if e.complexity.Mutation.CreatePersonalAccessToken == nil { + break + } + + args, err := ec.field_Mutation_createPersonalAccessToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreatePersonalAccessToken(childComplexity, args["input"].(generated.CreatePersonalAccessTokenInput)), true + + case "Mutation.createSubscriber": + if e.complexity.Mutation.CreateSubscriber == nil { + break + } + + args, err := ec.field_Mutation_createSubscriber_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateSubscriber(childComplexity, args["input"].(generated.CreateSubscriberInput)), true + + case "Mutation.createTFASetting": + if e.complexity.Mutation.CreateTFASetting == nil { + break + } + + args, err := ec.field_Mutation_createTFASetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateTFASetting(childComplexity, args["input"].(generated.CreateTFASettingInput)), true + + case "Mutation.createTemplate": + if e.complexity.Mutation.CreateTemplate == nil { + break + } + + args, err := ec.field_Mutation_createTemplate_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateTemplate(childComplexity, args["input"].(generated.CreateTemplateInput)), true + + case "Mutation.createUser": + if e.complexity.Mutation.CreateUser == nil { + break + } + + args, err := ec.field_Mutation_createUser_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateUser(childComplexity, args["input"].(generated.CreateUserInput)), true + + case "Mutation.createUserSetting": + if e.complexity.Mutation.CreateUserSetting == nil { + break + } + + args, err := ec.field_Mutation_createUserSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateUserSetting(childComplexity, args["input"].(generated.CreateUserSettingInput)), true + + case "Mutation.createWebhook": + if e.complexity.Mutation.CreateWebhook == nil { + break + } + + args, err := ec.field_Mutation_createWebhook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateWebhook(childComplexity, args["input"].(generated.CreateWebhookInput)), true + + case "Mutation.deleteAPIToken": + if e.complexity.Mutation.DeleteAPIToken == nil { + break + } + + args, err := ec.field_Mutation_deleteAPIToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteAPIToken(childComplexity, args["id"].(string)), true + + case "Mutation.deleteContact": + if e.complexity.Mutation.DeleteContact == nil { + break + } + + args, err := ec.field_Mutation_deleteContact_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteContact(childComplexity, args["id"].(string)), true + + case "Mutation.deleteDocumentData": + if e.complexity.Mutation.DeleteDocumentData == nil { + break + } + + args, err := ec.field_Mutation_deleteDocumentData_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteDocumentData(childComplexity, args["id"].(string)), true + + case "Mutation.deleteEntitlement": + if e.complexity.Mutation.DeleteEntitlement == nil { + break + } + + args, err := ec.field_Mutation_deleteEntitlement_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteEntitlement(childComplexity, args["id"].(string)), true + + case "Mutation.deleteEntitlementPlan": + if e.complexity.Mutation.DeleteEntitlementPlan == nil { + break + } + + args, err := ec.field_Mutation_deleteEntitlementPlan_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteEntitlementPlan(childComplexity, args["id"].(string)), true + + case "Mutation.deleteEntitlementPlanFeature": + if e.complexity.Mutation.DeleteEntitlementPlanFeature == nil { + break + } + + args, err := ec.field_Mutation_deleteEntitlementPlanFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteEntitlementPlanFeature(childComplexity, args["id"].(string)), true + + case "Mutation.deleteEntity": + if e.complexity.Mutation.DeleteEntity == nil { + break + } + + args, err := ec.field_Mutation_deleteEntity_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteEntity(childComplexity, args["id"].(string)), true + + case "Mutation.deleteEntityType": + if e.complexity.Mutation.DeleteEntityType == nil { + break + } + + args, err := ec.field_Mutation_deleteEntityType_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteEntityType(childComplexity, args["id"].(string)), true + + case "Mutation.deleteEvent": + if e.complexity.Mutation.DeleteEvent == nil { + break + } + + args, err := ec.field_Mutation_deleteEvent_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteEvent(childComplexity, args["id"].(string)), true + + case "Mutation.deleteFeature": + if e.complexity.Mutation.DeleteFeature == nil { + break + } + + args, err := ec.field_Mutation_deleteFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteFeature(childComplexity, args["id"].(string)), true + + case "Mutation.deleteFile": + if e.complexity.Mutation.DeleteFile == nil { + break + } + + args, err := ec.field_Mutation_deleteFile_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteFile(childComplexity, args["id"].(string)), true + + case "Mutation.deleteGroup": + if e.complexity.Mutation.DeleteGroup == nil { + break + } + + args, err := ec.field_Mutation_deleteGroup_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteGroup(childComplexity, args["id"].(string)), true + + case "Mutation.deleteGroupMembership": + if e.complexity.Mutation.DeleteGroupMembership == nil { + break + } + + args, err := ec.field_Mutation_deleteGroupMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteGroupMembership(childComplexity, args["id"].(string)), true + + case "Mutation.deleteGroupSetting": + if e.complexity.Mutation.DeleteGroupSetting == nil { + break + } + + args, err := ec.field_Mutation_deleteGroupSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteGroupSetting(childComplexity, args["id"].(string)), true + + case "Mutation.deleteHush": + if e.complexity.Mutation.DeleteHush == nil { + break + } + + args, err := ec.field_Mutation_deleteHush_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteHush(childComplexity, args["id"].(string)), true + + case "Mutation.deleteIntegration": + if e.complexity.Mutation.DeleteIntegration == nil { + break + } + + args, err := ec.field_Mutation_deleteIntegration_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteIntegration(childComplexity, args["id"].(string)), true + + case "Mutation.deleteInvite": + if e.complexity.Mutation.DeleteInvite == nil { + break + } + + args, err := ec.field_Mutation_deleteInvite_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteInvite(childComplexity, args["id"].(string)), true + + case "Mutation.deleteOauthProvider": + if e.complexity.Mutation.DeleteOauthProvider == nil { + break + } + + args, err := ec.field_Mutation_deleteOauthProvider_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteOauthProvider(childComplexity, args["id"].(string)), true + + case "Mutation.deleteOhAuthTooToken": + if e.complexity.Mutation.DeleteOhAuthTooToken == nil { + break + } + + args, err := ec.field_Mutation_deleteOhAuthTooToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteOhAuthTooToken(childComplexity, args["id"].(string)), true + + case "Mutation.deleteOrgMembership": + if e.complexity.Mutation.DeleteOrgMembership == nil { + break + } + + args, err := ec.field_Mutation_deleteOrgMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteOrgMembership(childComplexity, args["id"].(string)), true + + case "Mutation.deleteOrganization": + if e.complexity.Mutation.DeleteOrganization == nil { + break + } + + args, err := ec.field_Mutation_deleteOrganization_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteOrganization(childComplexity, args["id"].(string)), true + + case "Mutation.deleteOrganizationSetting": + if e.complexity.Mutation.DeleteOrganizationSetting == nil { + break + } + + args, err := ec.field_Mutation_deleteOrganizationSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteOrganizationSetting(childComplexity, args["id"].(string)), true + + case "Mutation.deletePersonalAccessToken": + if e.complexity.Mutation.DeletePersonalAccessToken == nil { + break + } + + args, err := ec.field_Mutation_deletePersonalAccessToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeletePersonalAccessToken(childComplexity, args["id"].(string)), true + + case "Mutation.deleteSubscriber": + if e.complexity.Mutation.DeleteSubscriber == nil { + break + } + + args, err := ec.field_Mutation_deleteSubscriber_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteSubscriber(childComplexity, args["email"].(string), args["ownerID"].(*string)), true + + case "Mutation.deleteTemplate": + if e.complexity.Mutation.DeleteTemplate == nil { + break + } + + args, err := ec.field_Mutation_deleteTemplate_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteTemplate(childComplexity, args["id"].(string)), true + + case "Mutation.deleteUser": + if e.complexity.Mutation.DeleteUser == nil { + break + } + + args, err := ec.field_Mutation_deleteUser_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteUser(childComplexity, args["id"].(string)), true + + case "Mutation.deleteWebhook": + if e.complexity.Mutation.DeleteWebhook == nil { + break + } + + args, err := ec.field_Mutation_deleteWebhook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteWebhook(childComplexity, args["id"].(string)), true + + case "Mutation.updateAPIToken": + if e.complexity.Mutation.UpdateAPIToken == nil { + break + } + + args, err := ec.field_Mutation_updateAPIToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateAPIToken(childComplexity, args["id"].(string), args["input"].(generated.UpdateAPITokenInput)), true + + case "Mutation.updateContact": + if e.complexity.Mutation.UpdateContact == nil { + break + } + + args, err := ec.field_Mutation_updateContact_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateContact(childComplexity, args["id"].(string), args["input"].(generated.UpdateContactInput)), true + + case "Mutation.updateDocumentData": + if e.complexity.Mutation.UpdateDocumentData == nil { + break + } + + args, err := ec.field_Mutation_updateDocumentData_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateDocumentData(childComplexity, args["id"].(string), args["input"].(generated.UpdateDocumentDataInput)), true + + case "Mutation.updateEntitlement": + if e.complexity.Mutation.UpdateEntitlement == nil { + break + } + + args, err := ec.field_Mutation_updateEntitlement_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateEntitlement(childComplexity, args["id"].(string), args["input"].(generated.UpdateEntitlementInput)), true + + case "Mutation.updateEntitlementPlan": + if e.complexity.Mutation.UpdateEntitlementPlan == nil { + break + } + + args, err := ec.field_Mutation_updateEntitlementPlan_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateEntitlementPlan(childComplexity, args["id"].(string), args["input"].(generated.UpdateEntitlementPlanInput)), true + + case "Mutation.updateEntitlementPlanFeature": + if e.complexity.Mutation.UpdateEntitlementPlanFeature == nil { + break + } + + args, err := ec.field_Mutation_updateEntitlementPlanFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateEntitlementPlanFeature(childComplexity, args["id"].(string), args["input"].(generated.UpdateEntitlementPlanFeatureInput)), true + + case "Mutation.updateEntity": + if e.complexity.Mutation.UpdateEntity == nil { + break + } + + args, err := ec.field_Mutation_updateEntity_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateEntity(childComplexity, args["id"].(string), args["input"].(generated.UpdateEntityInput)), true + + case "Mutation.updateEntityType": + if e.complexity.Mutation.UpdateEntityType == nil { + break + } + + args, err := ec.field_Mutation_updateEntityType_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateEntityType(childComplexity, args["id"].(string), args["input"].(generated.UpdateEntityTypeInput)), true + + case "Mutation.updateEvent": + if e.complexity.Mutation.UpdateEvent == nil { + break + } + + args, err := ec.field_Mutation_updateEvent_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateEvent(childComplexity, args["id"].(string), args["input"].(generated.UpdateEventInput)), true + + case "Mutation.updateFeature": + if e.complexity.Mutation.UpdateFeature == nil { + break + } + + args, err := ec.field_Mutation_updateFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateFeature(childComplexity, args["id"].(string), args["input"].(generated.UpdateFeatureInput)), true + + case "Mutation.updateFile": + if e.complexity.Mutation.UpdateFile == nil { + break + } + + args, err := ec.field_Mutation_updateFile_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateFile(childComplexity, args["id"].(string), args["input"].(generated.UpdateFileInput)), true + + case "Mutation.updateGroup": + if e.complexity.Mutation.UpdateGroup == nil { + break + } + + args, err := ec.field_Mutation_updateGroup_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateGroup(childComplexity, args["id"].(string), args["input"].(generated.UpdateGroupInput)), true + + case "Mutation.updateGroupMembership": + if e.complexity.Mutation.UpdateGroupMembership == nil { + break + } + + args, err := ec.field_Mutation_updateGroupMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateGroupMembership(childComplexity, args["id"].(string), args["input"].(generated.UpdateGroupMembershipInput)), true + + case "Mutation.updateGroupSetting": + if e.complexity.Mutation.UpdateGroupSetting == nil { + break + } + + args, err := ec.field_Mutation_updateGroupSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateGroupSetting(childComplexity, args["id"].(string), args["input"].(generated.UpdateGroupSettingInput)), true + + case "Mutation.updateHush": + if e.complexity.Mutation.UpdateHush == nil { + break + } + + args, err := ec.field_Mutation_updateHush_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateHush(childComplexity, args["id"].(string), args["input"].(generated.UpdateHushInput)), true + + case "Mutation.updateIntegration": + if e.complexity.Mutation.UpdateIntegration == nil { + break + } + + args, err := ec.field_Mutation_updateIntegration_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateIntegration(childComplexity, args["id"].(string), args["input"].(generated.UpdateIntegrationInput)), true + + case "Mutation.updateInvite": + if e.complexity.Mutation.UpdateInvite == nil { + break + } + + args, err := ec.field_Mutation_updateInvite_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateInvite(childComplexity, args["id"].(string), args["input"].(generated.UpdateInviteInput)), true + + case "Mutation.updateOauthProvider": + if e.complexity.Mutation.UpdateOauthProvider == nil { + break + } + + args, err := ec.field_Mutation_updateOauthProvider_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateOauthProvider(childComplexity, args["id"].(string), args["input"].(generated.UpdateOauthProviderInput)), true + + case "Mutation.updateOhAuthTooToken": + if e.complexity.Mutation.UpdateOhAuthTooToken == nil { + break + } + + args, err := ec.field_Mutation_updateOhAuthTooToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateOhAuthTooToken(childComplexity, args["id"].(string), args["input"].(generated.UpdateOhAuthTooTokenInput)), true + + case "Mutation.updateOrgMembership": + if e.complexity.Mutation.UpdateOrgMembership == nil { + break + } + + args, err := ec.field_Mutation_updateOrgMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateOrgMembership(childComplexity, args["id"].(string), args["input"].(generated.UpdateOrgMembershipInput)), true + + case "Mutation.updateOrganization": + if e.complexity.Mutation.UpdateOrganization == nil { + break + } + + args, err := ec.field_Mutation_updateOrganization_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateOrganization(childComplexity, args["id"].(string), args["input"].(generated.UpdateOrganizationInput)), true + + case "Mutation.updateOrganizationSetting": + if e.complexity.Mutation.UpdateOrganizationSetting == nil { + break + } + + args, err := ec.field_Mutation_updateOrganizationSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateOrganizationSetting(childComplexity, args["id"].(string), args["input"].(generated.UpdateOrganizationSettingInput)), true + + case "Mutation.updatePersonalAccessToken": + if e.complexity.Mutation.UpdatePersonalAccessToken == nil { + break + } + + args, err := ec.field_Mutation_updatePersonalAccessToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdatePersonalAccessToken(childComplexity, args["id"].(string), args["input"].(generated.UpdatePersonalAccessTokenInput)), true + + case "Mutation.updateSubscriber": + if e.complexity.Mutation.UpdateSubscriber == nil { + break + } + + args, err := ec.field_Mutation_updateSubscriber_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateSubscriber(childComplexity, args["email"].(string), args["input"].(generated.UpdateSubscriberInput)), true + + case "Mutation.updateTFASetting": + if e.complexity.Mutation.UpdateTFASetting == nil { + break + } + + args, err := ec.field_Mutation_updateTFASetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateTFASetting(childComplexity, args["input"].(generated.UpdateTFASettingInput)), true + + case "Mutation.updateTemplate": + if e.complexity.Mutation.UpdateTemplate == nil { + break + } + + args, err := ec.field_Mutation_updateTemplate_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateTemplate(childComplexity, args["id"].(string), args["input"].(generated.UpdateTemplateInput)), true + + case "Mutation.updateUser": + if e.complexity.Mutation.UpdateUser == nil { + break + } + + args, err := ec.field_Mutation_updateUser_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateUser(childComplexity, args["id"].(string), args["input"].(generated.UpdateUserInput)), true + + case "Mutation.updateUserSetting": + if e.complexity.Mutation.UpdateUserSetting == nil { + break + } + + args, err := ec.field_Mutation_updateUserSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateUserSetting(childComplexity, args["id"].(string), args["input"].(generated.UpdateUserSettingInput)), true + + case "Mutation.updateWebhook": + if e.complexity.Mutation.UpdateWebhook == nil { + break + } + + args, err := ec.field_Mutation_updateWebhook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateWebhook(childComplexity, args["id"].(string), args["input"].(generated.UpdateWebhookInput)), true + + case "Note.createdAt": + if e.complexity.Note.CreatedAt == nil { + break + } + + return e.complexity.Note.CreatedAt(childComplexity), true + + case "Note.createdBy": + if e.complexity.Note.CreatedBy == nil { + break + } + + return e.complexity.Note.CreatedBy(childComplexity), true + + case "Note.deletedAt": + if e.complexity.Note.DeletedAt == nil { + break + } + + return e.complexity.Note.DeletedAt(childComplexity), true + + case "Note.deletedBy": + if e.complexity.Note.DeletedBy == nil { + break + } + + return e.complexity.Note.DeletedBy(childComplexity), true + + case "Note.entity": + if e.complexity.Note.Entity == nil { + break + } + + return e.complexity.Note.Entity(childComplexity), true + + case "Note.id": + if e.complexity.Note.ID == nil { + break + } + + return e.complexity.Note.ID(childComplexity), true + + case "Note.owner": + if e.complexity.Note.Owner == nil { + break + } + + return e.complexity.Note.Owner(childComplexity), true + + case "Note.ownerID": + if e.complexity.Note.OwnerID == nil { + break + } + + return e.complexity.Note.OwnerID(childComplexity), true + + case "Note.tags": + if e.complexity.Note.Tags == nil { + break + } + + return e.complexity.Note.Tags(childComplexity), true + + case "Note.text": + if e.complexity.Note.Text == nil { + break + } + + return e.complexity.Note.Text(childComplexity), true + + case "Note.updatedAt": + if e.complexity.Note.UpdatedAt == nil { + break + } + + return e.complexity.Note.UpdatedAt(childComplexity), true + + case "Note.updatedBy": + if e.complexity.Note.UpdatedBy == nil { + break + } + + return e.complexity.Note.UpdatedBy(childComplexity), true + + case "NoteConnection.edges": + if e.complexity.NoteConnection.Edges == nil { + break + } + + return e.complexity.NoteConnection.Edges(childComplexity), true + + case "NoteConnection.pageInfo": + if e.complexity.NoteConnection.PageInfo == nil { + break + } + + return e.complexity.NoteConnection.PageInfo(childComplexity), true + + case "NoteConnection.totalCount": + if e.complexity.NoteConnection.TotalCount == nil { + break + } + + return e.complexity.NoteConnection.TotalCount(childComplexity), true + + case "NoteEdge.cursor": + if e.complexity.NoteEdge.Cursor == nil { + break + } + + return e.complexity.NoteEdge.Cursor(childComplexity), true + + case "NoteEdge.node": + if e.complexity.NoteEdge.Node == nil { + break + } + + return e.complexity.NoteEdge.Node(childComplexity), true + + case "NoteHistory.createdAt": + if e.complexity.NoteHistory.CreatedAt == nil { + break + } + + return e.complexity.NoteHistory.CreatedAt(childComplexity), true + + case "NoteHistory.createdBy": + if e.complexity.NoteHistory.CreatedBy == nil { + break + } + + return e.complexity.NoteHistory.CreatedBy(childComplexity), true + + case "NoteHistory.deletedAt": + if e.complexity.NoteHistory.DeletedAt == nil { + break + } + + return e.complexity.NoteHistory.DeletedAt(childComplexity), true + + case "NoteHistory.deletedBy": + if e.complexity.NoteHistory.DeletedBy == nil { + break + } + + return e.complexity.NoteHistory.DeletedBy(childComplexity), true + + case "NoteHistory.historyTime": + if e.complexity.NoteHistory.HistoryTime == nil { + break + } + + return e.complexity.NoteHistory.HistoryTime(childComplexity), true + + case "NoteHistory.id": + if e.complexity.NoteHistory.ID == nil { + break + } + + return e.complexity.NoteHistory.ID(childComplexity), true + + case "NoteHistory.operation": + if e.complexity.NoteHistory.Operation == nil { + break + } + + return e.complexity.NoteHistory.Operation(childComplexity), true + + case "NoteHistory.ownerID": + if e.complexity.NoteHistory.OwnerID == nil { + break + } + + return e.complexity.NoteHistory.OwnerID(childComplexity), true + + case "NoteHistory.ref": + if e.complexity.NoteHistory.Ref == nil { + break + } + + return e.complexity.NoteHistory.Ref(childComplexity), true + + case "NoteHistory.tags": + if e.complexity.NoteHistory.Tags == nil { + break + } + + return e.complexity.NoteHistory.Tags(childComplexity), true + + case "NoteHistory.text": + if e.complexity.NoteHistory.Text == nil { + break + } + + return e.complexity.NoteHistory.Text(childComplexity), true + + case "NoteHistory.updatedAt": + if e.complexity.NoteHistory.UpdatedAt == nil { + break + } + + return e.complexity.NoteHistory.UpdatedAt(childComplexity), true + + case "NoteHistory.updatedBy": + if e.complexity.NoteHistory.UpdatedBy == nil { + break + } + + return e.complexity.NoteHistory.UpdatedBy(childComplexity), true + + case "NoteHistoryConnection.edges": + if e.complexity.NoteHistoryConnection.Edges == nil { + break + } + + return e.complexity.NoteHistoryConnection.Edges(childComplexity), true + + case "NoteHistoryConnection.pageInfo": + if e.complexity.NoteHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.NoteHistoryConnection.PageInfo(childComplexity), true + + case "NoteHistoryConnection.totalCount": + if e.complexity.NoteHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.NoteHistoryConnection.TotalCount(childComplexity), true + + case "NoteHistoryEdge.cursor": + if e.complexity.NoteHistoryEdge.Cursor == nil { + break + } + + return e.complexity.NoteHistoryEdge.Cursor(childComplexity), true + + case "NoteHistoryEdge.node": + if e.complexity.NoteHistoryEdge.Node == nil { + break + } + + return e.complexity.NoteHistoryEdge.Node(childComplexity), true + + case "OauthProvider.authStyle": + if e.complexity.OauthProvider.AuthStyle == nil { + break + } + + return e.complexity.OauthProvider.AuthStyle(childComplexity), true + + case "OauthProvider.authURL": + if e.complexity.OauthProvider.AuthURL == nil { + break + } + + return e.complexity.OauthProvider.AuthURL(childComplexity), true + + case "OauthProvider.clientID": + if e.complexity.OauthProvider.ClientID == nil { + break + } + + return e.complexity.OauthProvider.ClientID(childComplexity), true + + case "OauthProvider.clientSecret": + if e.complexity.OauthProvider.ClientSecret == nil { + break + } + + return e.complexity.OauthProvider.ClientSecret(childComplexity), true + + case "OauthProvider.createdAt": + if e.complexity.OauthProvider.CreatedAt == nil { + break + } + + return e.complexity.OauthProvider.CreatedAt(childComplexity), true + + case "OauthProvider.createdBy": + if e.complexity.OauthProvider.CreatedBy == nil { + break + } + + return e.complexity.OauthProvider.CreatedBy(childComplexity), true + + case "OauthProvider.deletedAt": + if e.complexity.OauthProvider.DeletedAt == nil { + break + } + + return e.complexity.OauthProvider.DeletedAt(childComplexity), true + + case "OauthProvider.deletedBy": + if e.complexity.OauthProvider.DeletedBy == nil { + break + } + + return e.complexity.OauthProvider.DeletedBy(childComplexity), true + + case "OauthProvider.id": + if e.complexity.OauthProvider.ID == nil { + break + } + + return e.complexity.OauthProvider.ID(childComplexity), true + + case "OauthProvider.infoURL": + if e.complexity.OauthProvider.InfoURL == nil { + break + } + + return e.complexity.OauthProvider.InfoURL(childComplexity), true + + case "OauthProvider.name": + if e.complexity.OauthProvider.Name == nil { + break + } + + return e.complexity.OauthProvider.Name(childComplexity), true + + case "OauthProvider.owner": + if e.complexity.OauthProvider.Owner == nil { + break + } + + return e.complexity.OauthProvider.Owner(childComplexity), true + + case "OauthProvider.ownerID": + if e.complexity.OauthProvider.OwnerID == nil { + break + } + + return e.complexity.OauthProvider.OwnerID(childComplexity), true + + case "OauthProvider.redirectURL": + if e.complexity.OauthProvider.RedirectURL == nil { + break + } + + return e.complexity.OauthProvider.RedirectURL(childComplexity), true + + case "OauthProvider.scopes": + if e.complexity.OauthProvider.Scopes == nil { + break + } + + return e.complexity.OauthProvider.Scopes(childComplexity), true + + case "OauthProvider.tags": + if e.complexity.OauthProvider.Tags == nil { + break + } + + return e.complexity.OauthProvider.Tags(childComplexity), true + + case "OauthProvider.tokenURL": + if e.complexity.OauthProvider.TokenURL == nil { + break + } + + return e.complexity.OauthProvider.TokenURL(childComplexity), true + + case "OauthProvider.updatedAt": + if e.complexity.OauthProvider.UpdatedAt == nil { + break + } + + return e.complexity.OauthProvider.UpdatedAt(childComplexity), true + + case "OauthProvider.updatedBy": + if e.complexity.OauthProvider.UpdatedBy == nil { + break + } + + return e.complexity.OauthProvider.UpdatedBy(childComplexity), true + + case "OauthProviderBulkCreatePayload.oauthProviders": + if e.complexity.OauthProviderBulkCreatePayload.OauthProviders == nil { + break + } + + return e.complexity.OauthProviderBulkCreatePayload.OauthProviders(childComplexity), true + + case "OauthProviderConnection.edges": + if e.complexity.OauthProviderConnection.Edges == nil { + break + } + + return e.complexity.OauthProviderConnection.Edges(childComplexity), true + + case "OauthProviderConnection.pageInfo": + if e.complexity.OauthProviderConnection.PageInfo == nil { + break + } + + return e.complexity.OauthProviderConnection.PageInfo(childComplexity), true + + case "OauthProviderConnection.totalCount": + if e.complexity.OauthProviderConnection.TotalCount == nil { + break + } + + return e.complexity.OauthProviderConnection.TotalCount(childComplexity), true + + case "OauthProviderCreatePayload.oauthProvider": + if e.complexity.OauthProviderCreatePayload.OauthProvider == nil { + break + } + + return e.complexity.OauthProviderCreatePayload.OauthProvider(childComplexity), true + + case "OauthProviderDeletePayload.deletedID": + if e.complexity.OauthProviderDeletePayload.DeletedID == nil { + break + } + + return e.complexity.OauthProviderDeletePayload.DeletedID(childComplexity), true + + case "OauthProviderEdge.cursor": + if e.complexity.OauthProviderEdge.Cursor == nil { + break + } + + return e.complexity.OauthProviderEdge.Cursor(childComplexity), true + + case "OauthProviderEdge.node": + if e.complexity.OauthProviderEdge.Node == nil { + break + } + + return e.complexity.OauthProviderEdge.Node(childComplexity), true + + case "OauthProviderHistory.authStyle": + if e.complexity.OauthProviderHistory.AuthStyle == nil { + break + } + + return e.complexity.OauthProviderHistory.AuthStyle(childComplexity), true + + case "OauthProviderHistory.authURL": + if e.complexity.OauthProviderHistory.AuthURL == nil { + break + } + + return e.complexity.OauthProviderHistory.AuthURL(childComplexity), true + + case "OauthProviderHistory.clientID": + if e.complexity.OauthProviderHistory.ClientID == nil { + break + } + + return e.complexity.OauthProviderHistory.ClientID(childComplexity), true + + case "OauthProviderHistory.clientSecret": + if e.complexity.OauthProviderHistory.ClientSecret == nil { + break + } + + return e.complexity.OauthProviderHistory.ClientSecret(childComplexity), true + + case "OauthProviderHistory.createdAt": + if e.complexity.OauthProviderHistory.CreatedAt == nil { + break + } + + return e.complexity.OauthProviderHistory.CreatedAt(childComplexity), true + + case "OauthProviderHistory.createdBy": + if e.complexity.OauthProviderHistory.CreatedBy == nil { + break + } + + return e.complexity.OauthProviderHistory.CreatedBy(childComplexity), true + + case "OauthProviderHistory.deletedAt": + if e.complexity.OauthProviderHistory.DeletedAt == nil { + break + } + + return e.complexity.OauthProviderHistory.DeletedAt(childComplexity), true + + case "OauthProviderHistory.deletedBy": + if e.complexity.OauthProviderHistory.DeletedBy == nil { + break + } + + return e.complexity.OauthProviderHistory.DeletedBy(childComplexity), true + + case "OauthProviderHistory.historyTime": + if e.complexity.OauthProviderHistory.HistoryTime == nil { + break + } + + return e.complexity.OauthProviderHistory.HistoryTime(childComplexity), true + + case "OauthProviderHistory.id": + if e.complexity.OauthProviderHistory.ID == nil { + break + } + + return e.complexity.OauthProviderHistory.ID(childComplexity), true + + case "OauthProviderHistory.infoURL": + if e.complexity.OauthProviderHistory.InfoURL == nil { + break + } + + return e.complexity.OauthProviderHistory.InfoURL(childComplexity), true + + case "OauthProviderHistory.name": + if e.complexity.OauthProviderHistory.Name == nil { + break + } + + return e.complexity.OauthProviderHistory.Name(childComplexity), true + + case "OauthProviderHistory.operation": + if e.complexity.OauthProviderHistory.Operation == nil { + break + } + + return e.complexity.OauthProviderHistory.Operation(childComplexity), true + + case "OauthProviderHistory.ownerID": + if e.complexity.OauthProviderHistory.OwnerID == nil { + break + } + + return e.complexity.OauthProviderHistory.OwnerID(childComplexity), true + + case "OauthProviderHistory.redirectURL": + if e.complexity.OauthProviderHistory.RedirectURL == nil { + break + } + + return e.complexity.OauthProviderHistory.RedirectURL(childComplexity), true + + case "OauthProviderHistory.ref": + if e.complexity.OauthProviderHistory.Ref == nil { + break + } + + return e.complexity.OauthProviderHistory.Ref(childComplexity), true + + case "OauthProviderHistory.scopes": + if e.complexity.OauthProviderHistory.Scopes == nil { + break + } + + return e.complexity.OauthProviderHistory.Scopes(childComplexity), true + + case "OauthProviderHistory.tags": + if e.complexity.OauthProviderHistory.Tags == nil { + break + } + + return e.complexity.OauthProviderHistory.Tags(childComplexity), true + + case "OauthProviderHistory.tokenURL": + if e.complexity.OauthProviderHistory.TokenURL == nil { + break + } + + return e.complexity.OauthProviderHistory.TokenURL(childComplexity), true + + case "OauthProviderHistory.updatedAt": + if e.complexity.OauthProviderHistory.UpdatedAt == nil { + break + } + + return e.complexity.OauthProviderHistory.UpdatedAt(childComplexity), true + + case "OauthProviderHistory.updatedBy": + if e.complexity.OauthProviderHistory.UpdatedBy == nil { + break + } + + return e.complexity.OauthProviderHistory.UpdatedBy(childComplexity), true + + case "OauthProviderHistoryConnection.edges": + if e.complexity.OauthProviderHistoryConnection.Edges == nil { + break + } + + return e.complexity.OauthProviderHistoryConnection.Edges(childComplexity), true + + case "OauthProviderHistoryConnection.pageInfo": + if e.complexity.OauthProviderHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.OauthProviderHistoryConnection.PageInfo(childComplexity), true + + case "OauthProviderHistoryConnection.totalCount": + if e.complexity.OauthProviderHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.OauthProviderHistoryConnection.TotalCount(childComplexity), true + + case "OauthProviderHistoryEdge.cursor": + if e.complexity.OauthProviderHistoryEdge.Cursor == nil { + break + } + + return e.complexity.OauthProviderHistoryEdge.Cursor(childComplexity), true + + case "OauthProviderHistoryEdge.node": + if e.complexity.OauthProviderHistoryEdge.Node == nil { + break + } + + return e.complexity.OauthProviderHistoryEdge.Node(childComplexity), true + + case "OauthProviderUpdatePayload.oauthProvider": + if e.complexity.OauthProviderUpdatePayload.OauthProvider == nil { + break + } + + return e.complexity.OauthProviderUpdatePayload.OauthProvider(childComplexity), true + + case "OhAuthTooToken.claimsEmail": + if e.complexity.OhAuthTooToken.ClaimsEmail == nil { + break + } + + return e.complexity.OhAuthTooToken.ClaimsEmail(childComplexity), true + + case "OhAuthTooToken.claimsEmailVerified": + if e.complexity.OhAuthTooToken.ClaimsEmailVerified == nil { + break + } + + return e.complexity.OhAuthTooToken.ClaimsEmailVerified(childComplexity), true + + case "OhAuthTooToken.claimsGroups": + if e.complexity.OhAuthTooToken.ClaimsGroups == nil { + break + } + + return e.complexity.OhAuthTooToken.ClaimsGroups(childComplexity), true + + case "OhAuthTooToken.claimsPreferredUsername": + if e.complexity.OhAuthTooToken.ClaimsPreferredUsername == nil { + break + } + + return e.complexity.OhAuthTooToken.ClaimsPreferredUsername(childComplexity), true + + case "OhAuthTooToken.claimsUserID": + if e.complexity.OhAuthTooToken.ClaimsUserID == nil { + break + } + + return e.complexity.OhAuthTooToken.ClaimsUserID(childComplexity), true + + case "OhAuthTooToken.claimsUsername": + if e.complexity.OhAuthTooToken.ClaimsUsername == nil { + break + } + + return e.complexity.OhAuthTooToken.ClaimsUsername(childComplexity), true + + case "OhAuthTooToken.clientID": + if e.complexity.OhAuthTooToken.ClientID == nil { + break + } + + return e.complexity.OhAuthTooToken.ClientID(childComplexity), true + + case "OhAuthTooToken.connectorData": + if e.complexity.OhAuthTooToken.ConnectorData == nil { + break + } + + return e.complexity.OhAuthTooToken.ConnectorData(childComplexity), true + + case "OhAuthTooToken.connectorID": + if e.complexity.OhAuthTooToken.ConnectorID == nil { + break + } + + return e.complexity.OhAuthTooToken.ConnectorID(childComplexity), true + + case "OhAuthTooToken.events": + if e.complexity.OhAuthTooToken.Events == nil { + break + } + + return e.complexity.OhAuthTooToken.Events(childComplexity), true + + case "OhAuthTooToken.id": + if e.complexity.OhAuthTooToken.ID == nil { + break + } + + return e.complexity.OhAuthTooToken.ID(childComplexity), true + + case "OhAuthTooToken.integration": + if e.complexity.OhAuthTooToken.Integration == nil { + break + } + + return e.complexity.OhAuthTooToken.Integration(childComplexity), true + + case "OhAuthTooToken.lastUsed": + if e.complexity.OhAuthTooToken.LastUsed == nil { + break + } + + return e.complexity.OhAuthTooToken.LastUsed(childComplexity), true + + case "OhAuthTooToken.nonce": + if e.complexity.OhAuthTooToken.Nonce == nil { + break + } + + return e.complexity.OhAuthTooToken.Nonce(childComplexity), true + + case "OhAuthTooToken.scopes": + if e.complexity.OhAuthTooToken.Scopes == nil { + break + } + + return e.complexity.OhAuthTooToken.Scopes(childComplexity), true + + case "OhAuthTooToken.tags": + if e.complexity.OhAuthTooToken.Tags == nil { + break + } + + return e.complexity.OhAuthTooToken.Tags(childComplexity), true + + case "OhAuthTooTokenBulkCreatePayload.ohAuthTooTokens": + if e.complexity.OhAuthTooTokenBulkCreatePayload.OhAuthTooTokens == nil { + break + } + + return e.complexity.OhAuthTooTokenBulkCreatePayload.OhAuthTooTokens(childComplexity), true + + case "OhAuthTooTokenConnection.edges": + if e.complexity.OhAuthTooTokenConnection.Edges == nil { + break + } + + return e.complexity.OhAuthTooTokenConnection.Edges(childComplexity), true + + case "OhAuthTooTokenConnection.pageInfo": + if e.complexity.OhAuthTooTokenConnection.PageInfo == nil { + break + } + + return e.complexity.OhAuthTooTokenConnection.PageInfo(childComplexity), true + + case "OhAuthTooTokenConnection.totalCount": + if e.complexity.OhAuthTooTokenConnection.TotalCount == nil { + break + } + + return e.complexity.OhAuthTooTokenConnection.TotalCount(childComplexity), true + + case "OhAuthTooTokenCreatePayload.ohAuthTooToken": + if e.complexity.OhAuthTooTokenCreatePayload.OhAuthTooToken == nil { + break + } + + return e.complexity.OhAuthTooTokenCreatePayload.OhAuthTooToken(childComplexity), true + + case "OhAuthTooTokenDeletePayload.deletedID": + if e.complexity.OhAuthTooTokenDeletePayload.DeletedID == nil { + break + } + + return e.complexity.OhAuthTooTokenDeletePayload.DeletedID(childComplexity), true + + case "OhAuthTooTokenEdge.cursor": + if e.complexity.OhAuthTooTokenEdge.Cursor == nil { + break + } + + return e.complexity.OhAuthTooTokenEdge.Cursor(childComplexity), true + + case "OhAuthTooTokenEdge.node": + if e.complexity.OhAuthTooTokenEdge.Node == nil { + break + } + + return e.complexity.OhAuthTooTokenEdge.Node(childComplexity), true + + case "OhAuthTooTokenUpdatePayload.ohAuthTooToken": + if e.complexity.OhAuthTooTokenUpdatePayload.OhAuthTooToken == nil { + break + } + + return e.complexity.OhAuthTooTokenUpdatePayload.OhAuthTooToken(childComplexity), true + + case "OrgMembership.createdAt": + if e.complexity.OrgMembership.CreatedAt == nil { + break + } + + return e.complexity.OrgMembership.CreatedAt(childComplexity), true + + case "OrgMembership.createdBy": + if e.complexity.OrgMembership.CreatedBy == nil { + break + } + + return e.complexity.OrgMembership.CreatedBy(childComplexity), true + + case "OrgMembership.deletedAt": + if e.complexity.OrgMembership.DeletedAt == nil { + break + } + + return e.complexity.OrgMembership.DeletedAt(childComplexity), true + + case "OrgMembership.deletedBy": + if e.complexity.OrgMembership.DeletedBy == nil { + break + } + + return e.complexity.OrgMembership.DeletedBy(childComplexity), true + + case "OrgMembership.events": + if e.complexity.OrgMembership.Events == nil { + break + } + + return e.complexity.OrgMembership.Events(childComplexity), true + + case "OrgMembership.id": + if e.complexity.OrgMembership.ID == nil { + break + } + + return e.complexity.OrgMembership.ID(childComplexity), true + + case "OrgMembership.organization": + if e.complexity.OrgMembership.Organization == nil { + break + } + + return e.complexity.OrgMembership.Organization(childComplexity), true + + case "OrgMembership.organizationID": + if e.complexity.OrgMembership.OrganizationID == nil { + break + } + + return e.complexity.OrgMembership.OrganizationID(childComplexity), true + + case "OrgMembership.role": + if e.complexity.OrgMembership.Role == nil { + break + } + + return e.complexity.OrgMembership.Role(childComplexity), true + + case "OrgMembership.updatedAt": + if e.complexity.OrgMembership.UpdatedAt == nil { + break + } + + return e.complexity.OrgMembership.UpdatedAt(childComplexity), true + + case "OrgMembership.updatedBy": + if e.complexity.OrgMembership.UpdatedBy == nil { + break + } + + return e.complexity.OrgMembership.UpdatedBy(childComplexity), true + + case "OrgMembership.user": + if e.complexity.OrgMembership.User == nil { + break + } + + return e.complexity.OrgMembership.User(childComplexity), true + + case "OrgMembership.userID": + if e.complexity.OrgMembership.UserID == nil { + break + } + + return e.complexity.OrgMembership.UserID(childComplexity), true + + case "OrgMembershipBulkCreatePayload.orgMemberships": + if e.complexity.OrgMembershipBulkCreatePayload.OrgMemberships == nil { + break + } + + return e.complexity.OrgMembershipBulkCreatePayload.OrgMemberships(childComplexity), true + + case "OrgMembershipConnection.edges": + if e.complexity.OrgMembershipConnection.Edges == nil { + break + } + + return e.complexity.OrgMembershipConnection.Edges(childComplexity), true + + case "OrgMembershipConnection.pageInfo": + if e.complexity.OrgMembershipConnection.PageInfo == nil { + break + } + + return e.complexity.OrgMembershipConnection.PageInfo(childComplexity), true + + case "OrgMembershipConnection.totalCount": + if e.complexity.OrgMembershipConnection.TotalCount == nil { + break + } + + return e.complexity.OrgMembershipConnection.TotalCount(childComplexity), true + + case "OrgMembershipCreatePayload.orgMembership": + if e.complexity.OrgMembershipCreatePayload.OrgMembership == nil { + break + } + + return e.complexity.OrgMembershipCreatePayload.OrgMembership(childComplexity), true + + case "OrgMembershipDeletePayload.deletedID": + if e.complexity.OrgMembershipDeletePayload.DeletedID == nil { + break + } + + return e.complexity.OrgMembershipDeletePayload.DeletedID(childComplexity), true + + case "OrgMembershipEdge.cursor": + if e.complexity.OrgMembershipEdge.Cursor == nil { + break + } + + return e.complexity.OrgMembershipEdge.Cursor(childComplexity), true + + case "OrgMembershipEdge.node": + if e.complexity.OrgMembershipEdge.Node == nil { + break + } + + return e.complexity.OrgMembershipEdge.Node(childComplexity), true + + case "OrgMembershipHistory.createdAt": + if e.complexity.OrgMembershipHistory.CreatedAt == nil { + break + } + + return e.complexity.OrgMembershipHistory.CreatedAt(childComplexity), true + + case "OrgMembershipHistory.createdBy": + if e.complexity.OrgMembershipHistory.CreatedBy == nil { + break + } + + return e.complexity.OrgMembershipHistory.CreatedBy(childComplexity), true + + case "OrgMembershipHistory.deletedAt": + if e.complexity.OrgMembershipHistory.DeletedAt == nil { + break + } + + return e.complexity.OrgMembershipHistory.DeletedAt(childComplexity), true + + case "OrgMembershipHistory.deletedBy": + if e.complexity.OrgMembershipHistory.DeletedBy == nil { + break + } + + return e.complexity.OrgMembershipHistory.DeletedBy(childComplexity), true + + case "OrgMembershipHistory.historyTime": + if e.complexity.OrgMembershipHistory.HistoryTime == nil { + break + } + + return e.complexity.OrgMembershipHistory.HistoryTime(childComplexity), true + + case "OrgMembershipHistory.id": + if e.complexity.OrgMembershipHistory.ID == nil { + break + } + + return e.complexity.OrgMembershipHistory.ID(childComplexity), true + + case "OrgMembershipHistory.operation": + if e.complexity.OrgMembershipHistory.Operation == nil { + break + } + + return e.complexity.OrgMembershipHistory.Operation(childComplexity), true + + case "OrgMembershipHistory.organizationID": + if e.complexity.OrgMembershipHistory.OrganizationID == nil { + break + } + + return e.complexity.OrgMembershipHistory.OrganizationID(childComplexity), true + + case "OrgMembershipHistory.ref": + if e.complexity.OrgMembershipHistory.Ref == nil { + break + } + + return e.complexity.OrgMembershipHistory.Ref(childComplexity), true + + case "OrgMembershipHistory.role": + if e.complexity.OrgMembershipHistory.Role == nil { + break + } + + return e.complexity.OrgMembershipHistory.Role(childComplexity), true + + case "OrgMembershipHistory.updatedAt": + if e.complexity.OrgMembershipHistory.UpdatedAt == nil { + break + } + + return e.complexity.OrgMembershipHistory.UpdatedAt(childComplexity), true + + case "OrgMembershipHistory.updatedBy": + if e.complexity.OrgMembershipHistory.UpdatedBy == nil { + break + } + + return e.complexity.OrgMembershipHistory.UpdatedBy(childComplexity), true + + case "OrgMembershipHistory.userID": + if e.complexity.OrgMembershipHistory.UserID == nil { + break + } + + return e.complexity.OrgMembershipHistory.UserID(childComplexity), true + + case "OrgMembershipHistoryConnection.edges": + if e.complexity.OrgMembershipHistoryConnection.Edges == nil { + break + } + + return e.complexity.OrgMembershipHistoryConnection.Edges(childComplexity), true + + case "OrgMembershipHistoryConnection.pageInfo": + if e.complexity.OrgMembershipHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.OrgMembershipHistoryConnection.PageInfo(childComplexity), true + + case "OrgMembershipHistoryConnection.totalCount": + if e.complexity.OrgMembershipHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.OrgMembershipHistoryConnection.TotalCount(childComplexity), true + + case "OrgMembershipHistoryEdge.cursor": + if e.complexity.OrgMembershipHistoryEdge.Cursor == nil { + break + } + + return e.complexity.OrgMembershipHistoryEdge.Cursor(childComplexity), true + + case "OrgMembershipHistoryEdge.node": + if e.complexity.OrgMembershipHistoryEdge.Node == nil { + break + } + + return e.complexity.OrgMembershipHistoryEdge.Node(childComplexity), true + + case "OrgMembershipUpdatePayload.orgMembership": + if e.complexity.OrgMembershipUpdatePayload.OrgMembership == nil { + break + } + + return e.complexity.OrgMembershipUpdatePayload.OrgMembership(childComplexity), true + + case "Organization.apiTokens": + if e.complexity.Organization.APITokens == nil { + break + } + + return e.complexity.Organization.APITokens(childComplexity), true + + case "Organization.avatarRemoteURL": + if e.complexity.Organization.AvatarRemoteURL == nil { + break + } + + return e.complexity.Organization.AvatarRemoteURL(childComplexity), true + + case "Organization.children": + if e.complexity.Organization.Children == nil { + break + } + + args, err := ec.field_Organization_children_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Organization.Children(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.OrganizationOrder), args["where"].(*generated.OrganizationWhereInput)), true + + case "Organization.contacts": + if e.complexity.Organization.Contacts == nil { + break + } + + return e.complexity.Organization.Contacts(childComplexity), true + + case "Organization.createdAt": + if e.complexity.Organization.CreatedAt == nil { + break + } + + return e.complexity.Organization.CreatedAt(childComplexity), true + + case "Organization.createdBy": + if e.complexity.Organization.CreatedBy == nil { + break + } + + return e.complexity.Organization.CreatedBy(childComplexity), true + + case "Organization.dedicatedDb": + if e.complexity.Organization.DedicatedDb == nil { + break + } + + return e.complexity.Organization.DedicatedDb(childComplexity), true + + case "Organization.deletedAt": + if e.complexity.Organization.DeletedAt == nil { + break + } + + return e.complexity.Organization.DeletedAt(childComplexity), true + + case "Organization.deletedBy": + if e.complexity.Organization.DeletedBy == nil { + break + } + + return e.complexity.Organization.DeletedBy(childComplexity), true + + case "Organization.description": + if e.complexity.Organization.Description == nil { + break + } + + return e.complexity.Organization.Description(childComplexity), true + + case "Organization.displayName": + if e.complexity.Organization.DisplayName == nil { + break + } + + return e.complexity.Organization.DisplayName(childComplexity), true + + case "Organization.documentdata": + if e.complexity.Organization.Documentdata == nil { + break + } + + return e.complexity.Organization.Documentdata(childComplexity), true + + case "Organization.entities": + if e.complexity.Organization.Entities == nil { + break + } + + return e.complexity.Organization.Entities(childComplexity), true + + case "Organization.entitlementplanfeatures": + if e.complexity.Organization.Entitlementplanfeatures == nil { + break + } + + return e.complexity.Organization.Entitlementplanfeatures(childComplexity), true + + case "Organization.entitlementplans": + if e.complexity.Organization.Entitlementplans == nil { + break + } + + return e.complexity.Organization.Entitlementplans(childComplexity), true + + case "Organization.entitlements": + if e.complexity.Organization.Entitlements == nil { + break + } + + return e.complexity.Organization.Entitlements(childComplexity), true + + case "Organization.entitytypes": + if e.complexity.Organization.Entitytypes == nil { + break + } + + return e.complexity.Organization.Entitytypes(childComplexity), true + + case "Organization.events": + if e.complexity.Organization.Events == nil { + break + } + + return e.complexity.Organization.Events(childComplexity), true + + case "Organization.features": + if e.complexity.Organization.Features == nil { + break + } + + return e.complexity.Organization.Features(childComplexity), true + + case "Organization.files": + if e.complexity.Organization.Files == nil { + break + } + + return e.complexity.Organization.Files(childComplexity), true + + case "Organization.groups": + if e.complexity.Organization.Groups == nil { + break + } + + return e.complexity.Organization.Groups(childComplexity), true + + case "Organization.id": + if e.complexity.Organization.ID == nil { + break + } + + return e.complexity.Organization.ID(childComplexity), true + + case "Organization.integrations": + if e.complexity.Organization.Integrations == nil { + break + } + + return e.complexity.Organization.Integrations(childComplexity), true + + case "Organization.invites": + if e.complexity.Organization.Invites == nil { + break + } + + return e.complexity.Organization.Invites(childComplexity), true + + case "Organization.members": + if e.complexity.Organization.Members == nil { + break + } + + return e.complexity.Organization.Members(childComplexity), true + + case "Organization.name": + if e.complexity.Organization.Name == nil { + break + } + + return e.complexity.Organization.Name(childComplexity), true + + case "Organization.notes": + if e.complexity.Organization.Notes == nil { + break + } + + return e.complexity.Organization.Notes(childComplexity), true + + case "Organization.oauthprovider": + if e.complexity.Organization.Oauthprovider == nil { + break + } + + return e.complexity.Organization.Oauthprovider(childComplexity), true + + case "Organization.organizationEntitlement": + if e.complexity.Organization.OrganizationEntitlement == nil { + break + } + + return e.complexity.Organization.OrganizationEntitlement(childComplexity), true + + case "Organization.parent": + if e.complexity.Organization.Parent == nil { + break + } + + return e.complexity.Organization.Parent(childComplexity), true + + case "Organization.personalAccessTokens": + if e.complexity.Organization.PersonalAccessTokens == nil { + break + } + + return e.complexity.Organization.PersonalAccessTokens(childComplexity), true + + case "Organization.personalOrg": + if e.complexity.Organization.PersonalOrg == nil { + break + } + + return e.complexity.Organization.PersonalOrg(childComplexity), true + + case "Organization.secrets": + if e.complexity.Organization.Secrets == nil { + break + } + + return e.complexity.Organization.Secrets(childComplexity), true + + case "Organization.setting": + if e.complexity.Organization.Setting == nil { + break + } + + return e.complexity.Organization.Setting(childComplexity), true + + case "Organization.subscribers": + if e.complexity.Organization.Subscribers == nil { + break + } + + return e.complexity.Organization.Subscribers(childComplexity), true + + case "Organization.tags": + if e.complexity.Organization.Tags == nil { + break + } + + return e.complexity.Organization.Tags(childComplexity), true + + case "Organization.templates": + if e.complexity.Organization.Templates == nil { + break + } + + return e.complexity.Organization.Templates(childComplexity), true + + case "Organization.updatedAt": + if e.complexity.Organization.UpdatedAt == nil { + break + } + + return e.complexity.Organization.UpdatedAt(childComplexity), true + + case "Organization.updatedBy": + if e.complexity.Organization.UpdatedBy == nil { + break + } + + return e.complexity.Organization.UpdatedBy(childComplexity), true + + case "Organization.users": + if e.complexity.Organization.Users == nil { + break + } + + return e.complexity.Organization.Users(childComplexity), true + + case "Organization.webhooks": + if e.complexity.Organization.Webhooks == nil { + break + } + + return e.complexity.Organization.Webhooks(childComplexity), true + + case "OrganizationBulkCreatePayload.organizations": + if e.complexity.OrganizationBulkCreatePayload.Organizations == nil { + break + } + + return e.complexity.OrganizationBulkCreatePayload.Organizations(childComplexity), true + + case "OrganizationConnection.edges": + if e.complexity.OrganizationConnection.Edges == nil { + break + } + + return e.complexity.OrganizationConnection.Edges(childComplexity), true + + case "OrganizationConnection.pageInfo": + if e.complexity.OrganizationConnection.PageInfo == nil { + break + } + + return e.complexity.OrganizationConnection.PageInfo(childComplexity), true + + case "OrganizationConnection.totalCount": + if e.complexity.OrganizationConnection.TotalCount == nil { + break + } + + return e.complexity.OrganizationConnection.TotalCount(childComplexity), true + + case "OrganizationCreatePayload.organization": + if e.complexity.OrganizationCreatePayload.Organization == nil { + break + } + + return e.complexity.OrganizationCreatePayload.Organization(childComplexity), true + + case "OrganizationDeletePayload.deletedID": + if e.complexity.OrganizationDeletePayload.DeletedID == nil { + break + } + + return e.complexity.OrganizationDeletePayload.DeletedID(childComplexity), true + + case "OrganizationEdge.cursor": + if e.complexity.OrganizationEdge.Cursor == nil { + break + } + + return e.complexity.OrganizationEdge.Cursor(childComplexity), true + + case "OrganizationEdge.node": + if e.complexity.OrganizationEdge.Node == nil { + break + } + + return e.complexity.OrganizationEdge.Node(childComplexity), true + + case "OrganizationHistory.avatarRemoteURL": + if e.complexity.OrganizationHistory.AvatarRemoteURL == nil { + break + } + + return e.complexity.OrganizationHistory.AvatarRemoteURL(childComplexity), true + + case "OrganizationHistory.createdAt": + if e.complexity.OrganizationHistory.CreatedAt == nil { + break + } + + return e.complexity.OrganizationHistory.CreatedAt(childComplexity), true + + case "OrganizationHistory.createdBy": + if e.complexity.OrganizationHistory.CreatedBy == nil { + break + } + + return e.complexity.OrganizationHistory.CreatedBy(childComplexity), true + + case "OrganizationHistory.dedicatedDb": + if e.complexity.OrganizationHistory.DedicatedDb == nil { + break + } + + return e.complexity.OrganizationHistory.DedicatedDb(childComplexity), true + + case "OrganizationHistory.deletedAt": + if e.complexity.OrganizationHistory.DeletedAt == nil { + break + } + + return e.complexity.OrganizationHistory.DeletedAt(childComplexity), true + + case "OrganizationHistory.deletedBy": + if e.complexity.OrganizationHistory.DeletedBy == nil { + break + } + + return e.complexity.OrganizationHistory.DeletedBy(childComplexity), true + + case "OrganizationHistory.description": + if e.complexity.OrganizationHistory.Description == nil { + break + } + + return e.complexity.OrganizationHistory.Description(childComplexity), true + + case "OrganizationHistory.displayName": + if e.complexity.OrganizationHistory.DisplayName == nil { + break + } + + return e.complexity.OrganizationHistory.DisplayName(childComplexity), true + + case "OrganizationHistory.historyTime": + if e.complexity.OrganizationHistory.HistoryTime == nil { + break + } + + return e.complexity.OrganizationHistory.HistoryTime(childComplexity), true + + case "OrganizationHistory.id": + if e.complexity.OrganizationHistory.ID == nil { + break + } + + return e.complexity.OrganizationHistory.ID(childComplexity), true + + case "OrganizationHistory.name": + if e.complexity.OrganizationHistory.Name == nil { + break + } + + return e.complexity.OrganizationHistory.Name(childComplexity), true + + case "OrganizationHistory.operation": + if e.complexity.OrganizationHistory.Operation == nil { + break + } + + return e.complexity.OrganizationHistory.Operation(childComplexity), true + + case "OrganizationHistory.personalOrg": + if e.complexity.OrganizationHistory.PersonalOrg == nil { + break + } + + return e.complexity.OrganizationHistory.PersonalOrg(childComplexity), true + + case "OrganizationHistory.ref": + if e.complexity.OrganizationHistory.Ref == nil { + break + } + + return e.complexity.OrganizationHistory.Ref(childComplexity), true + + case "OrganizationHistory.tags": + if e.complexity.OrganizationHistory.Tags == nil { + break + } + + return e.complexity.OrganizationHistory.Tags(childComplexity), true + + case "OrganizationHistory.updatedAt": + if e.complexity.OrganizationHistory.UpdatedAt == nil { + break + } + + return e.complexity.OrganizationHistory.UpdatedAt(childComplexity), true + + case "OrganizationHistory.updatedBy": + if e.complexity.OrganizationHistory.UpdatedBy == nil { + break + } + + return e.complexity.OrganizationHistory.UpdatedBy(childComplexity), true + + case "OrganizationHistoryConnection.edges": + if e.complexity.OrganizationHistoryConnection.Edges == nil { + break + } + + return e.complexity.OrganizationHistoryConnection.Edges(childComplexity), true + + case "OrganizationHistoryConnection.pageInfo": + if e.complexity.OrganizationHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.OrganizationHistoryConnection.PageInfo(childComplexity), true + + case "OrganizationHistoryConnection.totalCount": + if e.complexity.OrganizationHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.OrganizationHistoryConnection.TotalCount(childComplexity), true + + case "OrganizationHistoryEdge.cursor": + if e.complexity.OrganizationHistoryEdge.Cursor == nil { + break + } + + return e.complexity.OrganizationHistoryEdge.Cursor(childComplexity), true + + case "OrganizationHistoryEdge.node": + if e.complexity.OrganizationHistoryEdge.Node == nil { + break + } + + return e.complexity.OrganizationHistoryEdge.Node(childComplexity), true + + case "OrganizationSearchResult.organizations": + if e.complexity.OrganizationSearchResult.Organizations == nil { + break + } + + return e.complexity.OrganizationSearchResult.Organizations(childComplexity), true + + case "OrganizationSetting.billingAddress": + if e.complexity.OrganizationSetting.BillingAddress == nil { + break + } + + return e.complexity.OrganizationSetting.BillingAddress(childComplexity), true + + case "OrganizationSetting.billingContact": + if e.complexity.OrganizationSetting.BillingContact == nil { + break + } + + return e.complexity.OrganizationSetting.BillingContact(childComplexity), true + + case "OrganizationSetting.billingEmail": + if e.complexity.OrganizationSetting.BillingEmail == nil { + break + } + + return e.complexity.OrganizationSetting.BillingEmail(childComplexity), true + + case "OrganizationSetting.billingPhone": + if e.complexity.OrganizationSetting.BillingPhone == nil { + break + } + + return e.complexity.OrganizationSetting.BillingPhone(childComplexity), true + + case "OrganizationSetting.createdAt": + if e.complexity.OrganizationSetting.CreatedAt == nil { + break + } + + return e.complexity.OrganizationSetting.CreatedAt(childComplexity), true + + case "OrganizationSetting.createdBy": + if e.complexity.OrganizationSetting.CreatedBy == nil { + break + } + + return e.complexity.OrganizationSetting.CreatedBy(childComplexity), true + + case "OrganizationSetting.deletedAt": + if e.complexity.OrganizationSetting.DeletedAt == nil { + break + } + + return e.complexity.OrganizationSetting.DeletedAt(childComplexity), true + + case "OrganizationSetting.deletedBy": + if e.complexity.OrganizationSetting.DeletedBy == nil { + break + } + + return e.complexity.OrganizationSetting.DeletedBy(childComplexity), true + + case "OrganizationSetting.domains": + if e.complexity.OrganizationSetting.Domains == nil { + break + } + + return e.complexity.OrganizationSetting.Domains(childComplexity), true + + case "OrganizationSetting.geoLocation": + if e.complexity.OrganizationSetting.GeoLocation == nil { + break + } + + return e.complexity.OrganizationSetting.GeoLocation(childComplexity), true + + case "OrganizationSetting.id": + if e.complexity.OrganizationSetting.ID == nil { + break + } + + return e.complexity.OrganizationSetting.ID(childComplexity), true + + case "OrganizationSetting.organization": + if e.complexity.OrganizationSetting.Organization == nil { + break + } + + return e.complexity.OrganizationSetting.Organization(childComplexity), true + + case "OrganizationSetting.organizationID": + if e.complexity.OrganizationSetting.OrganizationID == nil { + break + } + + return e.complexity.OrganizationSetting.OrganizationID(childComplexity), true + + case "OrganizationSetting.tags": + if e.complexity.OrganizationSetting.Tags == nil { + break + } + + return e.complexity.OrganizationSetting.Tags(childComplexity), true + + case "OrganizationSetting.taxIdentifier": + if e.complexity.OrganizationSetting.TaxIdentifier == nil { + break + } + + return e.complexity.OrganizationSetting.TaxIdentifier(childComplexity), true + + case "OrganizationSetting.updatedAt": + if e.complexity.OrganizationSetting.UpdatedAt == nil { + break + } + + return e.complexity.OrganizationSetting.UpdatedAt(childComplexity), true + + case "OrganizationSetting.updatedBy": + if e.complexity.OrganizationSetting.UpdatedBy == nil { + break + } + + return e.complexity.OrganizationSetting.UpdatedBy(childComplexity), true + + case "OrganizationSettingBulkCreatePayload.organizationSettings": + if e.complexity.OrganizationSettingBulkCreatePayload.OrganizationSettings == nil { + break + } + + return e.complexity.OrganizationSettingBulkCreatePayload.OrganizationSettings(childComplexity), true + + case "OrganizationSettingConnection.edges": + if e.complexity.OrganizationSettingConnection.Edges == nil { + break + } + + return e.complexity.OrganizationSettingConnection.Edges(childComplexity), true + + case "OrganizationSettingConnection.pageInfo": + if e.complexity.OrganizationSettingConnection.PageInfo == nil { + break + } + + return e.complexity.OrganizationSettingConnection.PageInfo(childComplexity), true + + case "OrganizationSettingConnection.totalCount": + if e.complexity.OrganizationSettingConnection.TotalCount == nil { + break + } + + return e.complexity.OrganizationSettingConnection.TotalCount(childComplexity), true + + case "OrganizationSettingCreatePayload.organizationSetting": + if e.complexity.OrganizationSettingCreatePayload.OrganizationSetting == nil { + break + } + + return e.complexity.OrganizationSettingCreatePayload.OrganizationSetting(childComplexity), true + + case "OrganizationSettingDeletePayload.deletedID": + if e.complexity.OrganizationSettingDeletePayload.DeletedID == nil { + break + } + + return e.complexity.OrganizationSettingDeletePayload.DeletedID(childComplexity), true + + case "OrganizationSettingEdge.cursor": + if e.complexity.OrganizationSettingEdge.Cursor == nil { + break + } + + return e.complexity.OrganizationSettingEdge.Cursor(childComplexity), true + + case "OrganizationSettingEdge.node": + if e.complexity.OrganizationSettingEdge.Node == nil { + break + } + + return e.complexity.OrganizationSettingEdge.Node(childComplexity), true + + case "OrganizationSettingHistory.billingAddress": + if e.complexity.OrganizationSettingHistory.BillingAddress == nil { + break + } + + return e.complexity.OrganizationSettingHistory.BillingAddress(childComplexity), true + + case "OrganizationSettingHistory.billingContact": + if e.complexity.OrganizationSettingHistory.BillingContact == nil { + break + } + + return e.complexity.OrganizationSettingHistory.BillingContact(childComplexity), true + + case "OrganizationSettingHistory.billingEmail": + if e.complexity.OrganizationSettingHistory.BillingEmail == nil { + break + } + + return e.complexity.OrganizationSettingHistory.BillingEmail(childComplexity), true + + case "OrganizationSettingHistory.billingPhone": + if e.complexity.OrganizationSettingHistory.BillingPhone == nil { + break + } + + return e.complexity.OrganizationSettingHistory.BillingPhone(childComplexity), true + + case "OrganizationSettingHistory.createdAt": + if e.complexity.OrganizationSettingHistory.CreatedAt == nil { + break + } + + return e.complexity.OrganizationSettingHistory.CreatedAt(childComplexity), true + + case "OrganizationSettingHistory.createdBy": + if e.complexity.OrganizationSettingHistory.CreatedBy == nil { + break + } + + return e.complexity.OrganizationSettingHistory.CreatedBy(childComplexity), true + + case "OrganizationSettingHistory.deletedAt": + if e.complexity.OrganizationSettingHistory.DeletedAt == nil { + break + } + + return e.complexity.OrganizationSettingHistory.DeletedAt(childComplexity), true + + case "OrganizationSettingHistory.deletedBy": + if e.complexity.OrganizationSettingHistory.DeletedBy == nil { + break + } + + return e.complexity.OrganizationSettingHistory.DeletedBy(childComplexity), true + + case "OrganizationSettingHistory.domains": + if e.complexity.OrganizationSettingHistory.Domains == nil { + break + } + + return e.complexity.OrganizationSettingHistory.Domains(childComplexity), true + + case "OrganizationSettingHistory.geoLocation": + if e.complexity.OrganizationSettingHistory.GeoLocation == nil { + break + } + + return e.complexity.OrganizationSettingHistory.GeoLocation(childComplexity), true + + case "OrganizationSettingHistory.historyTime": + if e.complexity.OrganizationSettingHistory.HistoryTime == nil { + break + } + + return e.complexity.OrganizationSettingHistory.HistoryTime(childComplexity), true + + case "OrganizationSettingHistory.id": + if e.complexity.OrganizationSettingHistory.ID == nil { + break + } + + return e.complexity.OrganizationSettingHistory.ID(childComplexity), true + + case "OrganizationSettingHistory.operation": + if e.complexity.OrganizationSettingHistory.Operation == nil { + break + } + + return e.complexity.OrganizationSettingHistory.Operation(childComplexity), true + + case "OrganizationSettingHistory.organizationID": + if e.complexity.OrganizationSettingHistory.OrganizationID == nil { + break + } + + return e.complexity.OrganizationSettingHistory.OrganizationID(childComplexity), true + + case "OrganizationSettingHistory.ref": + if e.complexity.OrganizationSettingHistory.Ref == nil { + break + } + + return e.complexity.OrganizationSettingHistory.Ref(childComplexity), true + + case "OrganizationSettingHistory.tags": + if e.complexity.OrganizationSettingHistory.Tags == nil { + break + } + + return e.complexity.OrganizationSettingHistory.Tags(childComplexity), true + + case "OrganizationSettingHistory.taxIdentifier": + if e.complexity.OrganizationSettingHistory.TaxIdentifier == nil { + break + } + + return e.complexity.OrganizationSettingHistory.TaxIdentifier(childComplexity), true + + case "OrganizationSettingHistory.updatedAt": + if e.complexity.OrganizationSettingHistory.UpdatedAt == nil { + break + } + + return e.complexity.OrganizationSettingHistory.UpdatedAt(childComplexity), true + + case "OrganizationSettingHistory.updatedBy": + if e.complexity.OrganizationSettingHistory.UpdatedBy == nil { + break + } + + return e.complexity.OrganizationSettingHistory.UpdatedBy(childComplexity), true + + case "OrganizationSettingHistoryConnection.edges": + if e.complexity.OrganizationSettingHistoryConnection.Edges == nil { + break + } + + return e.complexity.OrganizationSettingHistoryConnection.Edges(childComplexity), true + + case "OrganizationSettingHistoryConnection.pageInfo": + if e.complexity.OrganizationSettingHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.OrganizationSettingHistoryConnection.PageInfo(childComplexity), true + + case "OrganizationSettingHistoryConnection.totalCount": + if e.complexity.OrganizationSettingHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.OrganizationSettingHistoryConnection.TotalCount(childComplexity), true + + case "OrganizationSettingHistoryEdge.cursor": + if e.complexity.OrganizationSettingHistoryEdge.Cursor == nil { + break + } + + return e.complexity.OrganizationSettingHistoryEdge.Cursor(childComplexity), true + + case "OrganizationSettingHistoryEdge.node": + if e.complexity.OrganizationSettingHistoryEdge.Node == nil { + break + } + + return e.complexity.OrganizationSettingHistoryEdge.Node(childComplexity), true + + case "OrganizationSettingUpdatePayload.organizationSetting": + if e.complexity.OrganizationSettingUpdatePayload.OrganizationSetting == nil { + break + } + + return e.complexity.OrganizationSettingUpdatePayload.OrganizationSetting(childComplexity), true + + case "OrganizationUpdatePayload.organization": + if e.complexity.OrganizationUpdatePayload.Organization == nil { + break + } + + return e.complexity.OrganizationUpdatePayload.Organization(childComplexity), true + + case "PageInfo.endCursor": + if e.complexity.PageInfo.EndCursor == nil { + break + } + + return e.complexity.PageInfo.EndCursor(childComplexity), true + + case "PageInfo.hasNextPage": + if e.complexity.PageInfo.HasNextPage == nil { + break + } + + return e.complexity.PageInfo.HasNextPage(childComplexity), true + + case "PageInfo.hasPreviousPage": + if e.complexity.PageInfo.HasPreviousPage == nil { + break + } + + return e.complexity.PageInfo.HasPreviousPage(childComplexity), true + + case "PageInfo.startCursor": + if e.complexity.PageInfo.StartCursor == nil { + break + } + + return e.complexity.PageInfo.StartCursor(childComplexity), true + + case "PersonalAccessToken.createdAt": + if e.complexity.PersonalAccessToken.CreatedAt == nil { + break + } + + return e.complexity.PersonalAccessToken.CreatedAt(childComplexity), true + + case "PersonalAccessToken.createdBy": + if e.complexity.PersonalAccessToken.CreatedBy == nil { + break + } + + return e.complexity.PersonalAccessToken.CreatedBy(childComplexity), true + + case "PersonalAccessToken.deletedAt": + if e.complexity.PersonalAccessToken.DeletedAt == nil { + break + } + + return e.complexity.PersonalAccessToken.DeletedAt(childComplexity), true + + case "PersonalAccessToken.deletedBy": + if e.complexity.PersonalAccessToken.DeletedBy == nil { + break + } + + return e.complexity.PersonalAccessToken.DeletedBy(childComplexity), true + + case "PersonalAccessToken.description": + if e.complexity.PersonalAccessToken.Description == nil { + break + } + + return e.complexity.PersonalAccessToken.Description(childComplexity), true + + case "PersonalAccessToken.events": + if e.complexity.PersonalAccessToken.Events == nil { + break + } + + return e.complexity.PersonalAccessToken.Events(childComplexity), true + + case "PersonalAccessToken.expiresAt": + if e.complexity.PersonalAccessToken.ExpiresAt == nil { + break + } + + return e.complexity.PersonalAccessToken.ExpiresAt(childComplexity), true + + case "PersonalAccessToken.id": + if e.complexity.PersonalAccessToken.ID == nil { + break + } + + return e.complexity.PersonalAccessToken.ID(childComplexity), true + + case "PersonalAccessToken.lastUsedAt": + if e.complexity.PersonalAccessToken.LastUsedAt == nil { + break + } + + return e.complexity.PersonalAccessToken.LastUsedAt(childComplexity), true + + case "PersonalAccessToken.name": + if e.complexity.PersonalAccessToken.Name == nil { + break + } + + return e.complexity.PersonalAccessToken.Name(childComplexity), true + + case "PersonalAccessToken.organizations": + if e.complexity.PersonalAccessToken.Organizations == nil { + break + } + + return e.complexity.PersonalAccessToken.Organizations(childComplexity), true + + case "PersonalAccessToken.owner": + if e.complexity.PersonalAccessToken.Owner == nil { + break + } + + return e.complexity.PersonalAccessToken.Owner(childComplexity), true + + case "PersonalAccessToken.scopes": + if e.complexity.PersonalAccessToken.Scopes == nil { + break + } + + return e.complexity.PersonalAccessToken.Scopes(childComplexity), true + + case "PersonalAccessToken.tags": + if e.complexity.PersonalAccessToken.Tags == nil { + break + } + + return e.complexity.PersonalAccessToken.Tags(childComplexity), true + + case "PersonalAccessToken.token": + if e.complexity.PersonalAccessToken.Token == nil { + break + } + + return e.complexity.PersonalAccessToken.Token(childComplexity), true + + case "PersonalAccessToken.updatedAt": + if e.complexity.PersonalAccessToken.UpdatedAt == nil { + break + } + + return e.complexity.PersonalAccessToken.UpdatedAt(childComplexity), true + + case "PersonalAccessToken.updatedBy": + if e.complexity.PersonalAccessToken.UpdatedBy == nil { + break + } + + return e.complexity.PersonalAccessToken.UpdatedBy(childComplexity), true + + case "PersonalAccessTokenBulkCreatePayload.personalAccessTokens": + if e.complexity.PersonalAccessTokenBulkCreatePayload.PersonalAccessTokens == nil { + break + } + + return e.complexity.PersonalAccessTokenBulkCreatePayload.PersonalAccessTokens(childComplexity), true + + case "PersonalAccessTokenConnection.edges": + if e.complexity.PersonalAccessTokenConnection.Edges == nil { + break + } + + return e.complexity.PersonalAccessTokenConnection.Edges(childComplexity), true + + case "PersonalAccessTokenConnection.pageInfo": + if e.complexity.PersonalAccessTokenConnection.PageInfo == nil { + break + } + + return e.complexity.PersonalAccessTokenConnection.PageInfo(childComplexity), true + + case "PersonalAccessTokenConnection.totalCount": + if e.complexity.PersonalAccessTokenConnection.TotalCount == nil { + break + } + + return e.complexity.PersonalAccessTokenConnection.TotalCount(childComplexity), true + + case "PersonalAccessTokenCreatePayload.personalAccessToken": + if e.complexity.PersonalAccessTokenCreatePayload.PersonalAccessToken == nil { + break + } + + return e.complexity.PersonalAccessTokenCreatePayload.PersonalAccessToken(childComplexity), true + + case "PersonalAccessTokenDeletePayload.deletedID": + if e.complexity.PersonalAccessTokenDeletePayload.DeletedID == nil { + break + } + + return e.complexity.PersonalAccessTokenDeletePayload.DeletedID(childComplexity), true + + case "PersonalAccessTokenEdge.cursor": + if e.complexity.PersonalAccessTokenEdge.Cursor == nil { + break + } + + return e.complexity.PersonalAccessTokenEdge.Cursor(childComplexity), true + + case "PersonalAccessTokenEdge.node": + if e.complexity.PersonalAccessTokenEdge.Node == nil { + break + } + + return e.complexity.PersonalAccessTokenEdge.Node(childComplexity), true + + case "PersonalAccessTokenUpdatePayload.personalAccessToken": + if e.complexity.PersonalAccessTokenUpdatePayload.PersonalAccessToken == nil { + break + } + + return e.complexity.PersonalAccessTokenUpdatePayload.PersonalAccessToken(childComplexity), true + + case "Query.apiToken": + if e.complexity.Query.APIToken == nil { + break + } + + args, err := ec.field_Query_apiToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.APIToken(childComplexity, args["id"].(string)), true + + case "Query.apiTokens": + if e.complexity.Query.APITokens == nil { + break + } + + args, err := ec.field_Query_apiTokens_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.APITokens(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.APITokenWhereInput)), true + + case "Query.auditLogs": + if e.complexity.Query.AuditLogs == nil { + break + } + + args, err := ec.field_Query_auditLogs_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.AuditLogs(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*AuditLogWhereInput)), true + + case "Query.contact": + if e.complexity.Query.Contact == nil { + break + } + + args, err := ec.field_Query_contact_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Contact(childComplexity, args["id"].(string)), true + + case "Query.contactHistories": + if e.complexity.Query.ContactHistories == nil { + break + } + + args, err := ec.field_Query_contactHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ContactHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.ContactHistoryWhereInput)), true + + case "Query.contacts": + if e.complexity.Query.Contacts == nil { + break + } + + args, err := ec.field_Query_contacts_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Contacts(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.ContactWhereInput)), true + + case "Query.documentData": + if e.complexity.Query.DocumentData == nil { + break + } + + args, err := ec.field_Query_documentData_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.DocumentData(childComplexity, args["id"].(string)), true + + case "Query.documentDataHistories": + if e.complexity.Query.DocumentDataHistories == nil { + break + } + + args, err := ec.field_Query_documentDataHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.DocumentDataHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.DocumentDataHistoryWhereInput)), true + + case "Query.documentDataSlice": + if e.complexity.Query.DocumentDataSlice == nil { + break + } + + args, err := ec.field_Query_documentDataSlice_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.DocumentDataSlice(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.DocumentDataWhereInput)), true + + case "Query.entities": + if e.complexity.Query.Entities == nil { + break + } + + args, err := ec.field_Query_entities_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Entities(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.EntityOrder), args["where"].(*generated.EntityWhereInput)), true + + case "Query.entitlement": + if e.complexity.Query.Entitlement == nil { + break + } + + args, err := ec.field_Query_entitlement_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Entitlement(childComplexity, args["id"].(string)), true + + case "Query.entitlementHistories": + if e.complexity.Query.EntitlementHistories == nil { + break + } + + args, err := ec.field_Query_entitlementHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntitlementHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EntitlementHistoryWhereInput)), true + + case "Query.entitlementPlan": + if e.complexity.Query.EntitlementPlan == nil { + break + } + + args, err := ec.field_Query_entitlementPlan_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntitlementPlan(childComplexity, args["id"].(string)), true + + case "Query.entitlementPlanFeature": + if e.complexity.Query.EntitlementPlanFeature == nil { + break + } + + args, err := ec.field_Query_entitlementPlanFeature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntitlementPlanFeature(childComplexity, args["id"].(string)), true + + case "Query.entitlementPlanFeatureHistories": + if e.complexity.Query.EntitlementPlanFeatureHistories == nil { + break + } + + args, err := ec.field_Query_entitlementPlanFeatureHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntitlementPlanFeatureHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EntitlementPlanFeatureHistoryWhereInput)), true + + case "Query.entitlementPlanFeatures": + if e.complexity.Query.EntitlementPlanFeatures == nil { + break + } + + args, err := ec.field_Query_entitlementPlanFeatures_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntitlementPlanFeatures(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EntitlementPlanFeatureWhereInput)), true + + case "Query.entitlementPlanHistories": + if e.complexity.Query.EntitlementPlanHistories == nil { + break + } + + args, err := ec.field_Query_entitlementPlanHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntitlementPlanHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EntitlementPlanHistoryWhereInput)), true + + case "Query.entitlementPlans": + if e.complexity.Query.EntitlementPlans == nil { + break + } + + args, err := ec.field_Query_entitlementPlans_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntitlementPlans(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EntitlementPlanWhereInput)), true + + case "Query.entitlements": + if e.complexity.Query.Entitlements == nil { + break + } + + args, err := ec.field_Query_entitlements_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Entitlements(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EntitlementWhereInput)), true + + case "Query.entity": + if e.complexity.Query.Entity == nil { + break + } + + args, err := ec.field_Query_entity_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Entity(childComplexity, args["id"].(string)), true + + case "Query.entityHistories": + if e.complexity.Query.EntityHistories == nil { + break + } + + args, err := ec.field_Query_entityHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntityHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.EntityHistoryOrder), args["where"].(*generated.EntityHistoryWhereInput)), true + + case "Query.entityType": + if e.complexity.Query.EntityType == nil { + break + } + + args, err := ec.field_Query_entityType_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntityType(childComplexity, args["id"].(string)), true + + case "Query.entityTypeHistories": + if e.complexity.Query.EntityTypeHistories == nil { + break + } + + args, err := ec.field_Query_entityTypeHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntityTypeHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.EntityTypeHistoryOrder), args["where"].(*generated.EntityTypeHistoryWhereInput)), true + + case "Query.entityTypes": + if e.complexity.Query.EntityTypes == nil { + break + } + + args, err := ec.field_Query_entityTypes_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EntityTypes(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.EntityTypeOrder), args["where"].(*generated.EntityTypeWhereInput)), true + + case "Query.event": + if e.complexity.Query.Event == nil { + break + } + + args, err := ec.field_Query_event_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Event(childComplexity, args["id"].(string)), true + + case "Query.eventHistories": + if e.complexity.Query.EventHistories == nil { + break + } + + args, err := ec.field_Query_eventHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.EventHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EventHistoryWhereInput)), true + + case "Query.events": + if e.complexity.Query.Events == nil { + break + } + + args, err := ec.field_Query_events_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Events(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.EventWhereInput)), true + + case "Query.feature": + if e.complexity.Query.Feature == nil { + break + } + + args, err := ec.field_Query_feature_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Feature(childComplexity, args["id"].(string)), true + + case "Query.featureHistories": + if e.complexity.Query.FeatureHistories == nil { + break + } + + args, err := ec.field_Query_featureHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.FeatureHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.FeatureHistoryWhereInput)), true + + case "Query.features": + if e.complexity.Query.Features == nil { + break + } + + args, err := ec.field_Query_features_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Features(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.FeatureWhereInput)), true + + case "Query.file": + if e.complexity.Query.File == nil { + break + } + + args, err := ec.field_Query_file_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.File(childComplexity, args["id"].(string)), true + + case "Query.fileHistories": + if e.complexity.Query.FileHistories == nil { + break + } + + args, err := ec.field_Query_fileHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.FileHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.FileHistoryWhereInput)), true + + case "Query.files": + if e.complexity.Query.Files == nil { + break + } + + args, err := ec.field_Query_files_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Files(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.FileWhereInput)), true + + case "Query.group": + if e.complexity.Query.Group == nil { + break + } + + args, err := ec.field_Query_group_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Group(childComplexity, args["id"].(string)), true + + case "Query.groupHistories": + if e.complexity.Query.GroupHistories == nil { + break + } + + args, err := ec.field_Query_groupHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GroupHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.GroupHistoryOrder), args["where"].(*generated.GroupHistoryWhereInput)), true + + case "Query.groupMembership": + if e.complexity.Query.GroupMembership == nil { + break + } + + args, err := ec.field_Query_groupMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GroupMembership(childComplexity, args["id"].(string)), true + + case "Query.groupMembershipHistories": + if e.complexity.Query.GroupMembershipHistories == nil { + break + } + + args, err := ec.field_Query_groupMembershipHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GroupMembershipHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.GroupMembershipHistoryWhereInput)), true + + case "Query.groupMemberships": + if e.complexity.Query.GroupMemberships == nil { + break + } + + args, err := ec.field_Query_groupMemberships_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GroupMemberships(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.GroupMembershipWhereInput)), true + + case "Query.groupSetting": + if e.complexity.Query.GroupSetting == nil { + break + } + + args, err := ec.field_Query_groupSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GroupSetting(childComplexity, args["id"].(string)), true + + case "Query.groupSettingHistories": + if e.complexity.Query.GroupSettingHistories == nil { + break + } + + args, err := ec.field_Query_groupSettingHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GroupSettingHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.GroupSettingHistoryWhereInput)), true + + case "Query.groupSettings": + if e.complexity.Query.GroupSettings == nil { + break + } + + args, err := ec.field_Query_groupSettings_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GroupSettings(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.GroupSettingWhereInput)), true + + case "Query.groups": + if e.complexity.Query.Groups == nil { + break + } + + args, err := ec.field_Query_groups_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Groups(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.GroupOrder), args["where"].(*generated.GroupWhereInput)), true + + case "Query.hush": + if e.complexity.Query.Hush == nil { + break + } + + args, err := ec.field_Query_hush_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Hush(childComplexity, args["id"].(string)), true + + case "Query.hushHistories": + if e.complexity.Query.HushHistories == nil { + break + } + + args, err := ec.field_Query_hushHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.HushHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.HushHistoryOrder), args["where"].(*generated.HushHistoryWhereInput)), true + + case "Query.hushes": + if e.complexity.Query.Hushes == nil { + break + } + + args, err := ec.field_Query_hushes_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Hushes(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.HushOrder), args["where"].(*generated.HushWhereInput)), true + + case "Query.integration": + if e.complexity.Query.Integration == nil { + break + } + + args, err := ec.field_Query_integration_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Integration(childComplexity, args["id"].(string)), true + + case "Query.integrationHistories": + if e.complexity.Query.IntegrationHistories == nil { + break + } + + args, err := ec.field_Query_integrationHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.IntegrationHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.IntegrationHistoryOrder), args["where"].(*generated.IntegrationHistoryWhereInput)), true + + case "Query.integrations": + if e.complexity.Query.Integrations == nil { + break + } + + args, err := ec.field_Query_integrations_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Integrations(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.IntegrationOrder), args["where"].(*generated.IntegrationWhereInput)), true + + case "Query.invite": + if e.complexity.Query.Invite == nil { + break + } + + args, err := ec.field_Query_invite_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Invite(childComplexity, args["id"].(string)), true + + case "Query.invites": + if e.complexity.Query.Invites == nil { + break + } + + args, err := ec.field_Query_invites_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Invites(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.InviteWhereInput)), true + + case "Query.node": + if e.complexity.Query.Node == nil { + break + } + + args, err := ec.field_Query_node_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Node(childComplexity, args["id"].(string)), true + + case "Query.nodes": + if e.complexity.Query.Nodes == nil { + break + } + + args, err := ec.field_Query_nodes_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Nodes(childComplexity, args["ids"].([]string)), true + + case "Query.noteHistories": + if e.complexity.Query.NoteHistories == nil { + break + } + + args, err := ec.field_Query_noteHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.NoteHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.NoteHistoryWhereInput)), true + + case "Query.notes": + if e.complexity.Query.Notes == nil { + break + } + + args, err := ec.field_Query_notes_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Notes(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.NoteWhereInput)), true + + case "Query.oauthProvider": + if e.complexity.Query.OauthProvider == nil { + break + } + + args, err := ec.field_Query_oauthProvider_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OauthProvider(childComplexity, args["id"].(string)), true + + case "Query.oauthProviderHistories": + if e.complexity.Query.OauthProviderHistories == nil { + break + } + + args, err := ec.field_Query_oauthProviderHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OauthProviderHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.OauthProviderHistoryWhereInput)), true + + case "Query.oauthProviders": + if e.complexity.Query.OauthProviders == nil { + break + } + + args, err := ec.field_Query_oauthProviders_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OauthProviders(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.OauthProviderWhereInput)), true + + case "Query.ohAuthTooToken": + if e.complexity.Query.OhAuthTooToken == nil { + break + } + + args, err := ec.field_Query_ohAuthTooToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OhAuthTooToken(childComplexity, args["id"].(string)), true + + case "Query.ohAuthTooTokens": + if e.complexity.Query.OhAuthTooTokens == nil { + break + } + + args, err := ec.field_Query_ohAuthTooTokens_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OhAuthTooTokens(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.OhAuthTooTokenWhereInput)), true + + case "Query.orgMembership": + if e.complexity.Query.OrgMembership == nil { + break + } + + args, err := ec.field_Query_orgMembership_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OrgMembership(childComplexity, args["id"].(string)), true + + case "Query.orgMembershipHistories": + if e.complexity.Query.OrgMembershipHistories == nil { + break + } + + args, err := ec.field_Query_orgMembershipHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OrgMembershipHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.OrgMembershipHistoryWhereInput)), true + + case "Query.orgMemberships": + if e.complexity.Query.OrgMemberships == nil { + break + } + + args, err := ec.field_Query_orgMemberships_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OrgMemberships(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.OrgMembershipWhereInput)), true + + case "Query.organization": + if e.complexity.Query.Organization == nil { + break + } + + args, err := ec.field_Query_organization_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Organization(childComplexity, args["id"].(string)), true + + case "Query.organizationHistories": + if e.complexity.Query.OrganizationHistories == nil { + break + } + + args, err := ec.field_Query_organizationHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OrganizationHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.OrganizationHistoryOrder), args["where"].(*generated.OrganizationHistoryWhereInput)), true + + case "Query.organizationSetting": + if e.complexity.Query.OrganizationSetting == nil { + break + } + + args, err := ec.field_Query_organizationSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OrganizationSetting(childComplexity, args["id"].(string)), true + + case "Query.organizationSettingHistories": + if e.complexity.Query.OrganizationSettingHistories == nil { + break + } + + args, err := ec.field_Query_organizationSettingHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OrganizationSettingHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.OrganizationSettingHistoryWhereInput)), true + + case "Query.organizationSettings": + if e.complexity.Query.OrganizationSettings == nil { + break + } + + args, err := ec.field_Query_organizationSettings_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.OrganizationSettings(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.OrganizationSettingWhereInput)), true + + case "Query.organizations": + if e.complexity.Query.Organizations == nil { + break + } + + args, err := ec.field_Query_organizations_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Organizations(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.OrganizationOrder), args["where"].(*generated.OrganizationWhereInput)), true + + case "Query.personalAccessToken": + if e.complexity.Query.PersonalAccessToken == nil { + break + } + + args, err := ec.field_Query_personalAccessToken_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.PersonalAccessToken(childComplexity, args["id"].(string)), true + + case "Query.personalAccessTokens": + if e.complexity.Query.PersonalAccessTokens == nil { + break + } + + args, err := ec.field_Query_personalAccessTokens_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.PersonalAccessTokens(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.PersonalAccessTokenWhereInput)), true + + case "Query.search": + if e.complexity.Query.Search == nil { + break + } + + args, err := ec.field_Query_search_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Search(childComplexity, args["query"].(string)), true + + case "Query.subscriber": + if e.complexity.Query.Subscriber == nil { + break + } + + args, err := ec.field_Query_subscriber_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Subscriber(childComplexity, args["email"].(string)), true + + case "Query.subscribers": + if e.complexity.Query.Subscribers == nil { + break + } + + args, err := ec.field_Query_subscribers_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Subscribers(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.SubscriberWhereInput)), true + + case "Query.template": + if e.complexity.Query.Template == nil { + break + } + + args, err := ec.field_Query_template_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Template(childComplexity, args["id"].(string)), true + + case "Query.templateHistories": + if e.complexity.Query.TemplateHistories == nil { + break + } + + args, err := ec.field_Query_templateHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.TemplateHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.TemplateHistoryOrder), args["where"].(*generated.TemplateHistoryWhereInput)), true + + case "Query.templates": + if e.complexity.Query.Templates == nil { + break + } + + args, err := ec.field_Query_templates_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Templates(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.TemplateOrder), args["where"].(*generated.TemplateWhereInput)), true + + case "Query.tfaSetting": + if e.complexity.Query.TfaSetting == nil { + break + } + + args, err := ec.field_Query_tfaSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.TfaSetting(childComplexity, args["id"].(*string)), true + + case "Query.tfaSettings": + if e.complexity.Query.TfaSettings == nil { + break + } + + args, err := ec.field_Query_tfaSettings_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.TfaSettings(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.TFASettingWhereInput)), true + + case "Query.user": + if e.complexity.Query.User == nil { + break + } + + args, err := ec.field_Query_user_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.User(childComplexity, args["id"].(string)), true + + case "Query.userHistories": + if e.complexity.Query.UserHistories == nil { + break + } + + args, err := ec.field_Query_userHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.UserHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.UserHistoryOrder), args["where"].(*generated.UserHistoryWhereInput)), true + + case "Query.userSetting": + if e.complexity.Query.UserSetting == nil { + break + } + + args, err := ec.field_Query_userSetting_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.UserSetting(childComplexity, args["id"].(string)), true + + case "Query.userSettingHistories": + if e.complexity.Query.UserSettingHistories == nil { + break + } + + args, err := ec.field_Query_userSettingHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.UserSettingHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.UserSettingHistoryWhereInput)), true + + case "Query.userSettings": + if e.complexity.Query.UserSettings == nil { + break + } + + args, err := ec.field_Query_userSettings_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.UserSettings(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["where"].(*generated.UserSettingWhereInput)), true + + case "Query.users": + if e.complexity.Query.Users == nil { + break + } + + args, err := ec.field_Query_users_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Users(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.UserOrder), args["where"].(*generated.UserWhereInput)), true + + case "Query.webhook": + if e.complexity.Query.Webhook == nil { + break + } + + args, err := ec.field_Query_webhook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Webhook(childComplexity, args["id"].(string)), true + + case "Query.webhookHistories": + if e.complexity.Query.WebhookHistories == nil { + break + } + + args, err := ec.field_Query_webhookHistories_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.WebhookHistories(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.WebhookHistoryOrder), args["where"].(*generated.WebhookHistoryWhereInput)), true + + case "Query.webhooks": + if e.complexity.Query.Webhooks == nil { + break + } + + args, err := ec.field_Query_webhooks_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Webhooks(childComplexity, args["after"].(*entgql.Cursor[string]), args["first"].(*int), args["before"].(*entgql.Cursor[string]), args["last"].(*int), args["orderBy"].(*generated.WebhookOrder), args["where"].(*generated.WebhookWhereInput)), true + + case "Subscriber.active": + if e.complexity.Subscriber.Active == nil { + break + } + + return e.complexity.Subscriber.Active(childComplexity), true + + case "Subscriber.createdAt": + if e.complexity.Subscriber.CreatedAt == nil { + break + } + + return e.complexity.Subscriber.CreatedAt(childComplexity), true + + case "Subscriber.createdBy": + if e.complexity.Subscriber.CreatedBy == nil { + break + } + + return e.complexity.Subscriber.CreatedBy(childComplexity), true + + case "Subscriber.deletedAt": + if e.complexity.Subscriber.DeletedAt == nil { + break + } + + return e.complexity.Subscriber.DeletedAt(childComplexity), true + + case "Subscriber.deletedBy": + if e.complexity.Subscriber.DeletedBy == nil { + break + } + + return e.complexity.Subscriber.DeletedBy(childComplexity), true + + case "Subscriber.email": + if e.complexity.Subscriber.Email == nil { + break + } + + return e.complexity.Subscriber.Email(childComplexity), true + + case "Subscriber.events": + if e.complexity.Subscriber.Events == nil { + break + } + + return e.complexity.Subscriber.Events(childComplexity), true + + case "Subscriber.id": + if e.complexity.Subscriber.ID == nil { + break + } + + return e.complexity.Subscriber.ID(childComplexity), true + + case "Subscriber.owner": + if e.complexity.Subscriber.Owner == nil { + break + } + + return e.complexity.Subscriber.Owner(childComplexity), true + + case "Subscriber.ownerID": + if e.complexity.Subscriber.OwnerID == nil { + break + } + + return e.complexity.Subscriber.OwnerID(childComplexity), true + + case "Subscriber.phoneNumber": + if e.complexity.Subscriber.PhoneNumber == nil { + break + } + + return e.complexity.Subscriber.PhoneNumber(childComplexity), true + + case "Subscriber.tags": + if e.complexity.Subscriber.Tags == nil { + break + } + + return e.complexity.Subscriber.Tags(childComplexity), true + + case "Subscriber.updatedAt": + if e.complexity.Subscriber.UpdatedAt == nil { + break + } + + return e.complexity.Subscriber.UpdatedAt(childComplexity), true + + case "Subscriber.updatedBy": + if e.complexity.Subscriber.UpdatedBy == nil { + break + } + + return e.complexity.Subscriber.UpdatedBy(childComplexity), true + + case "Subscriber.verifiedEmail": + if e.complexity.Subscriber.VerifiedEmail == nil { + break + } + + return e.complexity.Subscriber.VerifiedEmail(childComplexity), true + + case "Subscriber.verifiedPhone": + if e.complexity.Subscriber.VerifiedPhone == nil { + break + } + + return e.complexity.Subscriber.VerifiedPhone(childComplexity), true + + case "SubscriberBulkCreatePayload.subscribers": + if e.complexity.SubscriberBulkCreatePayload.Subscribers == nil { + break + } + + return e.complexity.SubscriberBulkCreatePayload.Subscribers(childComplexity), true + + case "SubscriberConnection.edges": + if e.complexity.SubscriberConnection.Edges == nil { + break + } + + return e.complexity.SubscriberConnection.Edges(childComplexity), true + + case "SubscriberConnection.pageInfo": + if e.complexity.SubscriberConnection.PageInfo == nil { + break + } + + return e.complexity.SubscriberConnection.PageInfo(childComplexity), true + + case "SubscriberConnection.totalCount": + if e.complexity.SubscriberConnection.TotalCount == nil { + break + } + + return e.complexity.SubscriberConnection.TotalCount(childComplexity), true + + case "SubscriberCreatePayload.subscriber": + if e.complexity.SubscriberCreatePayload.Subscriber == nil { + break + } + + return e.complexity.SubscriberCreatePayload.Subscriber(childComplexity), true + + case "SubscriberDeletePayload.email": + if e.complexity.SubscriberDeletePayload.Email == nil { + break + } + + return e.complexity.SubscriberDeletePayload.Email(childComplexity), true + + case "SubscriberEdge.cursor": + if e.complexity.SubscriberEdge.Cursor == nil { + break + } + + return e.complexity.SubscriberEdge.Cursor(childComplexity), true + + case "SubscriberEdge.node": + if e.complexity.SubscriberEdge.Node == nil { + break + } + + return e.complexity.SubscriberEdge.Node(childComplexity), true + + case "SubscriberSearchResult.subscribers": + if e.complexity.SubscriberSearchResult.Subscribers == nil { + break + } + + return e.complexity.SubscriberSearchResult.Subscribers(childComplexity), true + + case "SubscriberUpdatePayload.subscriber": + if e.complexity.SubscriberUpdatePayload.Subscriber == nil { + break + } + + return e.complexity.SubscriberUpdatePayload.Subscriber(childComplexity), true + + case "TFASetting.createdAt": + if e.complexity.TFASetting.CreatedAt == nil { + break + } + + return e.complexity.TFASetting.CreatedAt(childComplexity), true + + case "TFASetting.createdBy": + if e.complexity.TFASetting.CreatedBy == nil { + break + } + + return e.complexity.TFASetting.CreatedBy(childComplexity), true + + case "TFASetting.deletedAt": + if e.complexity.TFASetting.DeletedAt == nil { + break + } + + return e.complexity.TFASetting.DeletedAt(childComplexity), true + + case "TFASetting.deletedBy": + if e.complexity.TFASetting.DeletedBy == nil { + break + } + + return e.complexity.TFASetting.DeletedBy(childComplexity), true + + case "TFASetting.id": + if e.complexity.TFASetting.ID == nil { + break + } + + return e.complexity.TFASetting.ID(childComplexity), true + + case "TFASetting.owner": + if e.complexity.TFASetting.Owner == nil { + break + } + + return e.complexity.TFASetting.Owner(childComplexity), true + + case "TFASetting.recoveryCodes": + if e.complexity.TFASetting.RecoveryCodes == nil { + break + } + + return e.complexity.TFASetting.RecoveryCodes(childComplexity), true + + case "TFASetting.tags": + if e.complexity.TFASetting.Tags == nil { + break + } + + return e.complexity.TFASetting.Tags(childComplexity), true + + case "TFASetting.tfaSecret": + if e.complexity.TFASetting.TfaSecret == nil { + break + } + + return e.complexity.TFASetting.TfaSecret(childComplexity), true + + case "TFASetting.totpAllowed": + if e.complexity.TFASetting.TotpAllowed == nil { + break + } + + return e.complexity.TFASetting.TotpAllowed(childComplexity), true + + case "TFASetting.updatedAt": + if e.complexity.TFASetting.UpdatedAt == nil { + break + } + + return e.complexity.TFASetting.UpdatedAt(childComplexity), true + + case "TFASetting.updatedBy": + if e.complexity.TFASetting.UpdatedBy == nil { + break + } + + return e.complexity.TFASetting.UpdatedBy(childComplexity), true + + case "TFASetting.verified": + if e.complexity.TFASetting.Verified == nil { + break + } + + return e.complexity.TFASetting.Verified(childComplexity), true + + case "TFASettingConnection.edges": + if e.complexity.TFASettingConnection.Edges == nil { + break + } + + return e.complexity.TFASettingConnection.Edges(childComplexity), true + + case "TFASettingConnection.pageInfo": + if e.complexity.TFASettingConnection.PageInfo == nil { + break + } + + return e.complexity.TFASettingConnection.PageInfo(childComplexity), true + + case "TFASettingConnection.totalCount": + if e.complexity.TFASettingConnection.TotalCount == nil { + break + } + + return e.complexity.TFASettingConnection.TotalCount(childComplexity), true + + case "TFASettingCreatePayload.tfaSetting": + if e.complexity.TFASettingCreatePayload.TfaSetting == nil { + break + } + + return e.complexity.TFASettingCreatePayload.TfaSetting(childComplexity), true + + case "TFASettingEdge.cursor": + if e.complexity.TFASettingEdge.Cursor == nil { + break + } + + return e.complexity.TFASettingEdge.Cursor(childComplexity), true + + case "TFASettingEdge.node": + if e.complexity.TFASettingEdge.Node == nil { + break + } + + return e.complexity.TFASettingEdge.Node(childComplexity), true + + case "TFASettingUpdatePayload.tfaSetting": + if e.complexity.TFASettingUpdatePayload.TfaSetting == nil { + break + } + + return e.complexity.TFASettingUpdatePayload.TfaSetting(childComplexity), true + + case "Template.createdAt": + if e.complexity.Template.CreatedAt == nil { + break + } + + return e.complexity.Template.CreatedAt(childComplexity), true + + case "Template.createdBy": + if e.complexity.Template.CreatedBy == nil { + break + } + + return e.complexity.Template.CreatedBy(childComplexity), true + + case "Template.deletedAt": + if e.complexity.Template.DeletedAt == nil { + break + } + + return e.complexity.Template.DeletedAt(childComplexity), true + + case "Template.deletedBy": + if e.complexity.Template.DeletedBy == nil { + break + } + + return e.complexity.Template.DeletedBy(childComplexity), true + + case "Template.description": + if e.complexity.Template.Description == nil { + break + } + + return e.complexity.Template.Description(childComplexity), true + + case "Template.documents": + if e.complexity.Template.Documents == nil { + break + } + + return e.complexity.Template.Documents(childComplexity), true + + case "Template.id": + if e.complexity.Template.ID == nil { + break + } + + return e.complexity.Template.ID(childComplexity), true + + case "Template.jsonconfig": + if e.complexity.Template.Jsonconfig == nil { + break + } + + return e.complexity.Template.Jsonconfig(childComplexity), true + + case "Template.name": + if e.complexity.Template.Name == nil { + break + } + + return e.complexity.Template.Name(childComplexity), true + + case "Template.owner": + if e.complexity.Template.Owner == nil { + break + } + + return e.complexity.Template.Owner(childComplexity), true + + case "Template.ownerID": + if e.complexity.Template.OwnerID == nil { + break + } + + return e.complexity.Template.OwnerID(childComplexity), true + + case "Template.tags": + if e.complexity.Template.Tags == nil { + break + } + + return e.complexity.Template.Tags(childComplexity), true + + case "Template.templateType": + if e.complexity.Template.TemplateType == nil { + break + } + + return e.complexity.Template.TemplateType(childComplexity), true + + case "Template.uischema": + if e.complexity.Template.Uischema == nil { + break + } + + return e.complexity.Template.Uischema(childComplexity), true + + case "Template.updatedAt": + if e.complexity.Template.UpdatedAt == nil { + break + } + + return e.complexity.Template.UpdatedAt(childComplexity), true + + case "Template.updatedBy": + if e.complexity.Template.UpdatedBy == nil { + break + } + + return e.complexity.Template.UpdatedBy(childComplexity), true + + case "TemplateBulkCreatePayload.templates": + if e.complexity.TemplateBulkCreatePayload.Templates == nil { + break + } + + return e.complexity.TemplateBulkCreatePayload.Templates(childComplexity), true + + case "TemplateConnection.edges": + if e.complexity.TemplateConnection.Edges == nil { + break + } + + return e.complexity.TemplateConnection.Edges(childComplexity), true + + case "TemplateConnection.pageInfo": + if e.complexity.TemplateConnection.PageInfo == nil { + break + } + + return e.complexity.TemplateConnection.PageInfo(childComplexity), true + + case "TemplateConnection.totalCount": + if e.complexity.TemplateConnection.TotalCount == nil { + break + } + + return e.complexity.TemplateConnection.TotalCount(childComplexity), true + + case "TemplateCreatePayload.template": + if e.complexity.TemplateCreatePayload.Template == nil { + break + } + + return e.complexity.TemplateCreatePayload.Template(childComplexity), true + + case "TemplateDeletePayload.deletedID": + if e.complexity.TemplateDeletePayload.DeletedID == nil { + break + } + + return e.complexity.TemplateDeletePayload.DeletedID(childComplexity), true + + case "TemplateEdge.cursor": + if e.complexity.TemplateEdge.Cursor == nil { + break + } + + return e.complexity.TemplateEdge.Cursor(childComplexity), true + + case "TemplateEdge.node": + if e.complexity.TemplateEdge.Node == nil { + break + } + + return e.complexity.TemplateEdge.Node(childComplexity), true + + case "TemplateHistory.createdAt": + if e.complexity.TemplateHistory.CreatedAt == nil { + break + } + + return e.complexity.TemplateHistory.CreatedAt(childComplexity), true + + case "TemplateHistory.createdBy": + if e.complexity.TemplateHistory.CreatedBy == nil { + break + } + + return e.complexity.TemplateHistory.CreatedBy(childComplexity), true + + case "TemplateHistory.deletedAt": + if e.complexity.TemplateHistory.DeletedAt == nil { + break + } + + return e.complexity.TemplateHistory.DeletedAt(childComplexity), true + + case "TemplateHistory.deletedBy": + if e.complexity.TemplateHistory.DeletedBy == nil { + break + } + + return e.complexity.TemplateHistory.DeletedBy(childComplexity), true + + case "TemplateHistory.description": + if e.complexity.TemplateHistory.Description == nil { + break + } + + return e.complexity.TemplateHistory.Description(childComplexity), true + + case "TemplateHistory.historyTime": + if e.complexity.TemplateHistory.HistoryTime == nil { + break + } + + return e.complexity.TemplateHistory.HistoryTime(childComplexity), true + + case "TemplateHistory.id": + if e.complexity.TemplateHistory.ID == nil { + break + } + + return e.complexity.TemplateHistory.ID(childComplexity), true + + case "TemplateHistory.jsonconfig": + if e.complexity.TemplateHistory.Jsonconfig == nil { + break + } + + return e.complexity.TemplateHistory.Jsonconfig(childComplexity), true + + case "TemplateHistory.name": + if e.complexity.TemplateHistory.Name == nil { + break + } + + return e.complexity.TemplateHistory.Name(childComplexity), true + + case "TemplateHistory.operation": + if e.complexity.TemplateHistory.Operation == nil { + break + } + + return e.complexity.TemplateHistory.Operation(childComplexity), true + + case "TemplateHistory.ownerID": + if e.complexity.TemplateHistory.OwnerID == nil { + break + } + + return e.complexity.TemplateHistory.OwnerID(childComplexity), true + + case "TemplateHistory.ref": + if e.complexity.TemplateHistory.Ref == nil { + break + } + + return e.complexity.TemplateHistory.Ref(childComplexity), true + + case "TemplateHistory.tags": + if e.complexity.TemplateHistory.Tags == nil { + break + } + + return e.complexity.TemplateHistory.Tags(childComplexity), true + + case "TemplateHistory.templateType": + if e.complexity.TemplateHistory.TemplateType == nil { + break + } + + return e.complexity.TemplateHistory.TemplateType(childComplexity), true + + case "TemplateHistory.uischema": + if e.complexity.TemplateHistory.Uischema == nil { + break + } + + return e.complexity.TemplateHistory.Uischema(childComplexity), true + + case "TemplateHistory.updatedAt": + if e.complexity.TemplateHistory.UpdatedAt == nil { + break + } + + return e.complexity.TemplateHistory.UpdatedAt(childComplexity), true + + case "TemplateHistory.updatedBy": + if e.complexity.TemplateHistory.UpdatedBy == nil { + break + } + + return e.complexity.TemplateHistory.UpdatedBy(childComplexity), true + + case "TemplateHistoryConnection.edges": + if e.complexity.TemplateHistoryConnection.Edges == nil { + break + } + + return e.complexity.TemplateHistoryConnection.Edges(childComplexity), true + + case "TemplateHistoryConnection.pageInfo": + if e.complexity.TemplateHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.TemplateHistoryConnection.PageInfo(childComplexity), true + + case "TemplateHistoryConnection.totalCount": + if e.complexity.TemplateHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.TemplateHistoryConnection.TotalCount(childComplexity), true + + case "TemplateHistoryEdge.cursor": + if e.complexity.TemplateHistoryEdge.Cursor == nil { + break + } + + return e.complexity.TemplateHistoryEdge.Cursor(childComplexity), true + + case "TemplateHistoryEdge.node": + if e.complexity.TemplateHistoryEdge.Node == nil { + break + } + + return e.complexity.TemplateHistoryEdge.Node(childComplexity), true + + case "TemplateUpdatePayload.template": + if e.complexity.TemplateUpdatePayload.Template == nil { + break + } + + return e.complexity.TemplateUpdatePayload.Template(childComplexity), true + + case "User.authProvider": + if e.complexity.User.AuthProvider == nil { + break + } + + return e.complexity.User.AuthProvider(childComplexity), true + + case "User.avatarLocalFile": + if e.complexity.User.AvatarLocalFile == nil { + break + } + + return e.complexity.User.AvatarLocalFile(childComplexity), true + + case "User.avatarRemoteURL": + if e.complexity.User.AvatarRemoteURL == nil { + break + } + + return e.complexity.User.AvatarRemoteURL(childComplexity), true + + case "User.avatarUpdatedAt": + if e.complexity.User.AvatarUpdatedAt == nil { + break + } + + return e.complexity.User.AvatarUpdatedAt(childComplexity), true + + case "User.createdAt": + if e.complexity.User.CreatedAt == nil { + break + } + + return e.complexity.User.CreatedAt(childComplexity), true + + case "User.createdBy": + if e.complexity.User.CreatedBy == nil { + break + } + + return e.complexity.User.CreatedBy(childComplexity), true + + case "User.deletedAt": + if e.complexity.User.DeletedAt == nil { + break + } + + return e.complexity.User.DeletedAt(childComplexity), true + + case "User.deletedBy": + if e.complexity.User.DeletedBy == nil { + break + } + + return e.complexity.User.DeletedBy(childComplexity), true + + case "User.displayName": + if e.complexity.User.DisplayName == nil { + break + } + + return e.complexity.User.DisplayName(childComplexity), true + + case "User.email": + if e.complexity.User.Email == nil { + break + } + + return e.complexity.User.Email(childComplexity), true + + case "User.events": + if e.complexity.User.Events == nil { + break + } + + return e.complexity.User.Events(childComplexity), true + + case "User.files": + if e.complexity.User.Files == nil { + break + } + + return e.complexity.User.Files(childComplexity), true + + case "User.firstName": + if e.complexity.User.FirstName == nil { + break + } + + return e.complexity.User.FirstName(childComplexity), true + + case "User.groupMemberships": + if e.complexity.User.GroupMemberships == nil { + break + } + + return e.complexity.User.GroupMemberships(childComplexity), true + + case "User.groups": + if e.complexity.User.Groups == nil { + break + } + + return e.complexity.User.Groups(childComplexity), true + + case "User.id": + if e.complexity.User.ID == nil { + break + } + + return e.complexity.User.ID(childComplexity), true + + case "User.lastName": + if e.complexity.User.LastName == nil { + break + } + + return e.complexity.User.LastName(childComplexity), true + + case "User.lastSeen": + if e.complexity.User.LastSeen == nil { + break + } + + return e.complexity.User.LastSeen(childComplexity), true + + case "User.orgMemberships": + if e.complexity.User.OrgMemberships == nil { + break + } + + return e.complexity.User.OrgMemberships(childComplexity), true + + case "User.organizations": + if e.complexity.User.Organizations == nil { + break + } + + return e.complexity.User.Organizations(childComplexity), true + + case "User.personalAccessTokens": + if e.complexity.User.PersonalAccessTokens == nil { + break + } + + return e.complexity.User.PersonalAccessTokens(childComplexity), true + + case "User.role": + if e.complexity.User.Role == nil { + break + } + + return e.complexity.User.Role(childComplexity), true + + case "User.setting": + if e.complexity.User.Setting == nil { + break + } + + return e.complexity.User.Setting(childComplexity), true + + case "User.sub": + if e.complexity.User.Sub == nil { + break + } + + return e.complexity.User.Sub(childComplexity), true + + case "User.tags": + if e.complexity.User.Tags == nil { + break + } + + return e.complexity.User.Tags(childComplexity), true + + case "User.tfaSettings": + if e.complexity.User.TfaSettings == nil { + break + } + + return e.complexity.User.TfaSettings(childComplexity), true + + case "User.updatedAt": + if e.complexity.User.UpdatedAt == nil { + break + } + + return e.complexity.User.UpdatedAt(childComplexity), true + + case "User.updatedBy": + if e.complexity.User.UpdatedBy == nil { + break + } + + return e.complexity.User.UpdatedBy(childComplexity), true + + case "UserBulkCreatePayload.users": + if e.complexity.UserBulkCreatePayload.Users == nil { + break + } + + return e.complexity.UserBulkCreatePayload.Users(childComplexity), true + + case "UserConnection.edges": + if e.complexity.UserConnection.Edges == nil { + break + } + + return e.complexity.UserConnection.Edges(childComplexity), true + + case "UserConnection.pageInfo": + if e.complexity.UserConnection.PageInfo == nil { + break + } + + return e.complexity.UserConnection.PageInfo(childComplexity), true + + case "UserConnection.totalCount": + if e.complexity.UserConnection.TotalCount == nil { + break + } + + return e.complexity.UserConnection.TotalCount(childComplexity), true + + case "UserCreatePayload.user": + if e.complexity.UserCreatePayload.User == nil { + break + } + + return e.complexity.UserCreatePayload.User(childComplexity), true + + case "UserDeletePayload.deletedID": + if e.complexity.UserDeletePayload.DeletedID == nil { + break + } + + return e.complexity.UserDeletePayload.DeletedID(childComplexity), true + + case "UserEdge.cursor": + if e.complexity.UserEdge.Cursor == nil { + break + } + + return e.complexity.UserEdge.Cursor(childComplexity), true + + case "UserEdge.node": + if e.complexity.UserEdge.Node == nil { + break + } + + return e.complexity.UserEdge.Node(childComplexity), true + + case "UserHistory.authProvider": + if e.complexity.UserHistory.AuthProvider == nil { + break + } + + return e.complexity.UserHistory.AuthProvider(childComplexity), true + + case "UserHistory.avatarLocalFile": + if e.complexity.UserHistory.AvatarLocalFile == nil { + break + } + + return e.complexity.UserHistory.AvatarLocalFile(childComplexity), true + + case "UserHistory.avatarRemoteURL": + if e.complexity.UserHistory.AvatarRemoteURL == nil { + break + } + + return e.complexity.UserHistory.AvatarRemoteURL(childComplexity), true + + case "UserHistory.avatarUpdatedAt": + if e.complexity.UserHistory.AvatarUpdatedAt == nil { + break + } + + return e.complexity.UserHistory.AvatarUpdatedAt(childComplexity), true + + case "UserHistory.createdAt": + if e.complexity.UserHistory.CreatedAt == nil { + break + } + + return e.complexity.UserHistory.CreatedAt(childComplexity), true + + case "UserHistory.createdBy": + if e.complexity.UserHistory.CreatedBy == nil { + break + } + + return e.complexity.UserHistory.CreatedBy(childComplexity), true + + case "UserHistory.deletedAt": + if e.complexity.UserHistory.DeletedAt == nil { + break + } + + return e.complexity.UserHistory.DeletedAt(childComplexity), true + + case "UserHistory.deletedBy": + if e.complexity.UserHistory.DeletedBy == nil { + break + } + + return e.complexity.UserHistory.DeletedBy(childComplexity), true + + case "UserHistory.displayName": + if e.complexity.UserHistory.DisplayName == nil { + break + } + + return e.complexity.UserHistory.DisplayName(childComplexity), true + + case "UserHistory.email": + if e.complexity.UserHistory.Email == nil { + break + } + + return e.complexity.UserHistory.Email(childComplexity), true + + case "UserHistory.firstName": + if e.complexity.UserHistory.FirstName == nil { + break + } + + return e.complexity.UserHistory.FirstName(childComplexity), true + + case "UserHistory.historyTime": + if e.complexity.UserHistory.HistoryTime == nil { + break + } + + return e.complexity.UserHistory.HistoryTime(childComplexity), true + + case "UserHistory.id": + if e.complexity.UserHistory.ID == nil { + break + } + + return e.complexity.UserHistory.ID(childComplexity), true + + case "UserHistory.lastName": + if e.complexity.UserHistory.LastName == nil { + break + } + + return e.complexity.UserHistory.LastName(childComplexity), true + + case "UserHistory.lastSeen": + if e.complexity.UserHistory.LastSeen == nil { + break + } + + return e.complexity.UserHistory.LastSeen(childComplexity), true + + case "UserHistory.operation": + if e.complexity.UserHistory.Operation == nil { + break + } + + return e.complexity.UserHistory.Operation(childComplexity), true + + case "UserHistory.ref": + if e.complexity.UserHistory.Ref == nil { + break + } + + return e.complexity.UserHistory.Ref(childComplexity), true + + case "UserHistory.role": + if e.complexity.UserHistory.Role == nil { + break + } + + return e.complexity.UserHistory.Role(childComplexity), true + + case "UserHistory.sub": + if e.complexity.UserHistory.Sub == nil { + break + } + + return e.complexity.UserHistory.Sub(childComplexity), true + + case "UserHistory.tags": + if e.complexity.UserHistory.Tags == nil { + break + } + + return e.complexity.UserHistory.Tags(childComplexity), true + + case "UserHistory.updatedAt": + if e.complexity.UserHistory.UpdatedAt == nil { + break + } + + return e.complexity.UserHistory.UpdatedAt(childComplexity), true + + case "UserHistory.updatedBy": + if e.complexity.UserHistory.UpdatedBy == nil { + break + } + + return e.complexity.UserHistory.UpdatedBy(childComplexity), true + + case "UserHistoryConnection.edges": + if e.complexity.UserHistoryConnection.Edges == nil { + break + } + + return e.complexity.UserHistoryConnection.Edges(childComplexity), true + + case "UserHistoryConnection.pageInfo": + if e.complexity.UserHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.UserHistoryConnection.PageInfo(childComplexity), true + + case "UserHistoryConnection.totalCount": + if e.complexity.UserHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.UserHistoryConnection.TotalCount(childComplexity), true + + case "UserHistoryEdge.cursor": + if e.complexity.UserHistoryEdge.Cursor == nil { + break + } + + return e.complexity.UserHistoryEdge.Cursor(childComplexity), true + + case "UserHistoryEdge.node": + if e.complexity.UserHistoryEdge.Node == nil { + break + } + + return e.complexity.UserHistoryEdge.Node(childComplexity), true + + case "UserSearchResult.users": + if e.complexity.UserSearchResult.Users == nil { + break + } + + return e.complexity.UserSearchResult.Users(childComplexity), true + + case "UserSetting.createdAt": + if e.complexity.UserSetting.CreatedAt == nil { + break + } + + return e.complexity.UserSetting.CreatedAt(childComplexity), true + + case "UserSetting.createdBy": + if e.complexity.UserSetting.CreatedBy == nil { + break + } + + return e.complexity.UserSetting.CreatedBy(childComplexity), true + + case "UserSetting.defaultOrg": + if e.complexity.UserSetting.DefaultOrg == nil { + break + } + + return e.complexity.UserSetting.DefaultOrg(childComplexity), true + + case "UserSetting.deletedAt": + if e.complexity.UserSetting.DeletedAt == nil { + break + } + + return e.complexity.UserSetting.DeletedAt(childComplexity), true + + case "UserSetting.deletedBy": + if e.complexity.UserSetting.DeletedBy == nil { + break + } + + return e.complexity.UserSetting.DeletedBy(childComplexity), true + + case "UserSetting.emailConfirmed": + if e.complexity.UserSetting.EmailConfirmed == nil { + break + } + + return e.complexity.UserSetting.EmailConfirmed(childComplexity), true + + case "UserSetting.id": + if e.complexity.UserSetting.ID == nil { + break + } + + return e.complexity.UserSetting.ID(childComplexity), true + + case "UserSetting.isTfaEnabled": + if e.complexity.UserSetting.IsTfaEnabled == nil { + break + } + + return e.complexity.UserSetting.IsTfaEnabled(childComplexity), true + + case "UserSetting.isWebauthnAllowed": + if e.complexity.UserSetting.IsWebauthnAllowed == nil { + break + } + + return e.complexity.UserSetting.IsWebauthnAllowed(childComplexity), true + + case "UserSetting.locked": + if e.complexity.UserSetting.Locked == nil { + break + } + + return e.complexity.UserSetting.Locked(childComplexity), true + + case "UserSetting.silencedAt": + if e.complexity.UserSetting.SilencedAt == nil { + break + } + + return e.complexity.UserSetting.SilencedAt(childComplexity), true + + case "UserSetting.status": + if e.complexity.UserSetting.Status == nil { + break + } + + return e.complexity.UserSetting.Status(childComplexity), true + + case "UserSetting.suspendedAt": + if e.complexity.UserSetting.SuspendedAt == nil { + break + } + + return e.complexity.UserSetting.SuspendedAt(childComplexity), true + + case "UserSetting.tags": + if e.complexity.UserSetting.Tags == nil { + break + } + + return e.complexity.UserSetting.Tags(childComplexity), true + + case "UserSetting.updatedAt": + if e.complexity.UserSetting.UpdatedAt == nil { + break + } + + return e.complexity.UserSetting.UpdatedAt(childComplexity), true + + case "UserSetting.updatedBy": + if e.complexity.UserSetting.UpdatedBy == nil { + break + } + + return e.complexity.UserSetting.UpdatedBy(childComplexity), true + + case "UserSetting.user": + if e.complexity.UserSetting.User == nil { + break + } + + return e.complexity.UserSetting.User(childComplexity), true + + case "UserSetting.userID": + if e.complexity.UserSetting.UserID == nil { + break + } + + return e.complexity.UserSetting.UserID(childComplexity), true + + case "UserSettingBulkCreatePayload.userSettings": + if e.complexity.UserSettingBulkCreatePayload.UserSettings == nil { + break + } + + return e.complexity.UserSettingBulkCreatePayload.UserSettings(childComplexity), true + + case "UserSettingConnection.edges": + if e.complexity.UserSettingConnection.Edges == nil { + break + } + + return e.complexity.UserSettingConnection.Edges(childComplexity), true + + case "UserSettingConnection.pageInfo": + if e.complexity.UserSettingConnection.PageInfo == nil { + break + } + + return e.complexity.UserSettingConnection.PageInfo(childComplexity), true + + case "UserSettingConnection.totalCount": + if e.complexity.UserSettingConnection.TotalCount == nil { + break + } + + return e.complexity.UserSettingConnection.TotalCount(childComplexity), true + + case "UserSettingCreatePayload.userSetting": + if e.complexity.UserSettingCreatePayload.UserSetting == nil { + break + } + + return e.complexity.UserSettingCreatePayload.UserSetting(childComplexity), true + + case "UserSettingEdge.cursor": + if e.complexity.UserSettingEdge.Cursor == nil { + break + } + + return e.complexity.UserSettingEdge.Cursor(childComplexity), true + + case "UserSettingEdge.node": + if e.complexity.UserSettingEdge.Node == nil { + break + } + + return e.complexity.UserSettingEdge.Node(childComplexity), true + + case "UserSettingHistory.createdAt": + if e.complexity.UserSettingHistory.CreatedAt == nil { + break + } + + return e.complexity.UserSettingHistory.CreatedAt(childComplexity), true + + case "UserSettingHistory.createdBy": + if e.complexity.UserSettingHistory.CreatedBy == nil { + break + } + + return e.complexity.UserSettingHistory.CreatedBy(childComplexity), true + + case "UserSettingHistory.deletedAt": + if e.complexity.UserSettingHistory.DeletedAt == nil { + break + } + + return e.complexity.UserSettingHistory.DeletedAt(childComplexity), true + + case "UserSettingHistory.deletedBy": + if e.complexity.UserSettingHistory.DeletedBy == nil { + break + } + + return e.complexity.UserSettingHistory.DeletedBy(childComplexity), true + + case "UserSettingHistory.emailConfirmed": + if e.complexity.UserSettingHistory.EmailConfirmed == nil { + break + } + + return e.complexity.UserSettingHistory.EmailConfirmed(childComplexity), true + + case "UserSettingHistory.historyTime": + if e.complexity.UserSettingHistory.HistoryTime == nil { + break + } + + return e.complexity.UserSettingHistory.HistoryTime(childComplexity), true + + case "UserSettingHistory.id": + if e.complexity.UserSettingHistory.ID == nil { + break + } + + return e.complexity.UserSettingHistory.ID(childComplexity), true + + case "UserSettingHistory.isTfaEnabled": + if e.complexity.UserSettingHistory.IsTfaEnabled == nil { + break + } + + return e.complexity.UserSettingHistory.IsTfaEnabled(childComplexity), true + + case "UserSettingHistory.isWebauthnAllowed": + if e.complexity.UserSettingHistory.IsWebauthnAllowed == nil { + break + } + + return e.complexity.UserSettingHistory.IsWebauthnAllowed(childComplexity), true + + case "UserSettingHistory.locked": + if e.complexity.UserSettingHistory.Locked == nil { + break + } + + return e.complexity.UserSettingHistory.Locked(childComplexity), true + + case "UserSettingHistory.operation": + if e.complexity.UserSettingHistory.Operation == nil { + break + } + + return e.complexity.UserSettingHistory.Operation(childComplexity), true + + case "UserSettingHistory.ref": + if e.complexity.UserSettingHistory.Ref == nil { + break + } + + return e.complexity.UserSettingHistory.Ref(childComplexity), true + + case "UserSettingHistory.silencedAt": + if e.complexity.UserSettingHistory.SilencedAt == nil { + break + } + + return e.complexity.UserSettingHistory.SilencedAt(childComplexity), true + + case "UserSettingHistory.status": + if e.complexity.UserSettingHistory.Status == nil { + break + } + + return e.complexity.UserSettingHistory.Status(childComplexity), true + + case "UserSettingHistory.suspendedAt": + if e.complexity.UserSettingHistory.SuspendedAt == nil { + break + } + + return e.complexity.UserSettingHistory.SuspendedAt(childComplexity), true + + case "UserSettingHistory.tags": + if e.complexity.UserSettingHistory.Tags == nil { + break + } + + return e.complexity.UserSettingHistory.Tags(childComplexity), true + + case "UserSettingHistory.updatedAt": + if e.complexity.UserSettingHistory.UpdatedAt == nil { + break + } + + return e.complexity.UserSettingHistory.UpdatedAt(childComplexity), true + + case "UserSettingHistory.updatedBy": + if e.complexity.UserSettingHistory.UpdatedBy == nil { + break + } + + return e.complexity.UserSettingHistory.UpdatedBy(childComplexity), true + + case "UserSettingHistory.userID": + if e.complexity.UserSettingHistory.UserID == nil { + break + } + + return e.complexity.UserSettingHistory.UserID(childComplexity), true + + case "UserSettingHistoryConnection.edges": + if e.complexity.UserSettingHistoryConnection.Edges == nil { + break + } + + return e.complexity.UserSettingHistoryConnection.Edges(childComplexity), true + + case "UserSettingHistoryConnection.pageInfo": + if e.complexity.UserSettingHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.UserSettingHistoryConnection.PageInfo(childComplexity), true + + case "UserSettingHistoryConnection.totalCount": + if e.complexity.UserSettingHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.UserSettingHistoryConnection.TotalCount(childComplexity), true + + case "UserSettingHistoryEdge.cursor": + if e.complexity.UserSettingHistoryEdge.Cursor == nil { + break + } + + return e.complexity.UserSettingHistoryEdge.Cursor(childComplexity), true + + case "UserSettingHistoryEdge.node": + if e.complexity.UserSettingHistoryEdge.Node == nil { + break + } + + return e.complexity.UserSettingHistoryEdge.Node(childComplexity), true + + case "UserSettingUpdatePayload.userSetting": + if e.complexity.UserSettingUpdatePayload.UserSetting == nil { + break + } + + return e.complexity.UserSettingUpdatePayload.UserSetting(childComplexity), true + + case "UserUpdatePayload.user": + if e.complexity.UserUpdatePayload.User == nil { + break + } + + return e.complexity.UserUpdatePayload.User(childComplexity), true + + case "Webhook.createdAt": + if e.complexity.Webhook.CreatedAt == nil { + break + } + + return e.complexity.Webhook.CreatedAt(childComplexity), true + + case "Webhook.createdBy": + if e.complexity.Webhook.CreatedBy == nil { + break + } + + return e.complexity.Webhook.CreatedBy(childComplexity), true + + case "Webhook.deletedAt": + if e.complexity.Webhook.DeletedAt == nil { + break + } + + return e.complexity.Webhook.DeletedAt(childComplexity), true + + case "Webhook.deletedBy": + if e.complexity.Webhook.DeletedBy == nil { + break + } + + return e.complexity.Webhook.DeletedBy(childComplexity), true + + case "Webhook.description": + if e.complexity.Webhook.Description == nil { + break + } + + return e.complexity.Webhook.Description(childComplexity), true + + case "Webhook.destinationURL": + if e.complexity.Webhook.DestinationURL == nil { + break + } + + return e.complexity.Webhook.DestinationURL(childComplexity), true + + case "Webhook.enabled": + if e.complexity.Webhook.Enabled == nil { + break + } + + return e.complexity.Webhook.Enabled(childComplexity), true + + case "Webhook.events": + if e.complexity.Webhook.Events == nil { + break + } + + return e.complexity.Webhook.Events(childComplexity), true + + case "Webhook.failures": + if e.complexity.Webhook.Failures == nil { + break + } + + return e.complexity.Webhook.Failures(childComplexity), true + + case "Webhook.id": + if e.complexity.Webhook.ID == nil { + break + } + + return e.complexity.Webhook.ID(childComplexity), true + + case "Webhook.integrations": + if e.complexity.Webhook.Integrations == nil { + break + } + + return e.complexity.Webhook.Integrations(childComplexity), true + + case "Webhook.lastError": + if e.complexity.Webhook.LastError == nil { + break + } + + return e.complexity.Webhook.LastError(childComplexity), true + + case "Webhook.lastResponse": + if e.complexity.Webhook.LastResponse == nil { + break + } + + return e.complexity.Webhook.LastResponse(childComplexity), true + + case "Webhook.name": + if e.complexity.Webhook.Name == nil { + break + } + + return e.complexity.Webhook.Name(childComplexity), true + + case "Webhook.owner": + if e.complexity.Webhook.Owner == nil { + break + } + + return e.complexity.Webhook.Owner(childComplexity), true + + case "Webhook.ownerID": + if e.complexity.Webhook.OwnerID == nil { + break + } + + return e.complexity.Webhook.OwnerID(childComplexity), true + + case "Webhook.tags": + if e.complexity.Webhook.Tags == nil { + break + } + + return e.complexity.Webhook.Tags(childComplexity), true + + case "Webhook.updatedAt": + if e.complexity.Webhook.UpdatedAt == nil { + break + } + + return e.complexity.Webhook.UpdatedAt(childComplexity), true + + case "Webhook.updatedBy": + if e.complexity.Webhook.UpdatedBy == nil { + break + } + + return e.complexity.Webhook.UpdatedBy(childComplexity), true + + case "WebhookBulkCreatePayload.webhooks": + if e.complexity.WebhookBulkCreatePayload.Webhooks == nil { + break + } + + return e.complexity.WebhookBulkCreatePayload.Webhooks(childComplexity), true + + case "WebhookConnection.edges": + if e.complexity.WebhookConnection.Edges == nil { + break + } + + return e.complexity.WebhookConnection.Edges(childComplexity), true + + case "WebhookConnection.pageInfo": + if e.complexity.WebhookConnection.PageInfo == nil { + break + } + + return e.complexity.WebhookConnection.PageInfo(childComplexity), true + + case "WebhookConnection.totalCount": + if e.complexity.WebhookConnection.TotalCount == nil { + break + } + + return e.complexity.WebhookConnection.TotalCount(childComplexity), true + + case "WebhookCreatePayload.webhook": + if e.complexity.WebhookCreatePayload.Webhook == nil { + break + } + + return e.complexity.WebhookCreatePayload.Webhook(childComplexity), true + + case "WebhookDeletePayload.deletedID": + if e.complexity.WebhookDeletePayload.DeletedID == nil { + break + } + + return e.complexity.WebhookDeletePayload.DeletedID(childComplexity), true + + case "WebhookEdge.cursor": + if e.complexity.WebhookEdge.Cursor == nil { + break + } + + return e.complexity.WebhookEdge.Cursor(childComplexity), true + + case "WebhookEdge.node": + if e.complexity.WebhookEdge.Node == nil { + break + } + + return e.complexity.WebhookEdge.Node(childComplexity), true + + case "WebhookHistory.createdAt": + if e.complexity.WebhookHistory.CreatedAt == nil { + break + } + + return e.complexity.WebhookHistory.CreatedAt(childComplexity), true + + case "WebhookHistory.createdBy": + if e.complexity.WebhookHistory.CreatedBy == nil { + break + } + + return e.complexity.WebhookHistory.CreatedBy(childComplexity), true + + case "WebhookHistory.deletedAt": + if e.complexity.WebhookHistory.DeletedAt == nil { + break + } + + return e.complexity.WebhookHistory.DeletedAt(childComplexity), true + + case "WebhookHistory.deletedBy": + if e.complexity.WebhookHistory.DeletedBy == nil { + break + } + + return e.complexity.WebhookHistory.DeletedBy(childComplexity), true + + case "WebhookHistory.description": + if e.complexity.WebhookHistory.Description == nil { + break + } + + return e.complexity.WebhookHistory.Description(childComplexity), true + + case "WebhookHistory.destinationURL": + if e.complexity.WebhookHistory.DestinationURL == nil { + break + } + + return e.complexity.WebhookHistory.DestinationURL(childComplexity), true + + case "WebhookHistory.enabled": + if e.complexity.WebhookHistory.Enabled == nil { + break + } + + return e.complexity.WebhookHistory.Enabled(childComplexity), true + + case "WebhookHistory.failures": + if e.complexity.WebhookHistory.Failures == nil { + break + } + + return e.complexity.WebhookHistory.Failures(childComplexity), true + + case "WebhookHistory.historyTime": + if e.complexity.WebhookHistory.HistoryTime == nil { + break + } + + return e.complexity.WebhookHistory.HistoryTime(childComplexity), true + + case "WebhookHistory.id": + if e.complexity.WebhookHistory.ID == nil { + break + } + + return e.complexity.WebhookHistory.ID(childComplexity), true + + case "WebhookHistory.lastError": + if e.complexity.WebhookHistory.LastError == nil { + break + } + + return e.complexity.WebhookHistory.LastError(childComplexity), true + + case "WebhookHistory.lastResponse": + if e.complexity.WebhookHistory.LastResponse == nil { + break + } + + return e.complexity.WebhookHistory.LastResponse(childComplexity), true + + case "WebhookHistory.name": + if e.complexity.WebhookHistory.Name == nil { + break + } + + return e.complexity.WebhookHistory.Name(childComplexity), true + + case "WebhookHistory.operation": + if e.complexity.WebhookHistory.Operation == nil { + break + } + + return e.complexity.WebhookHistory.Operation(childComplexity), true + + case "WebhookHistory.ownerID": + if e.complexity.WebhookHistory.OwnerID == nil { + break + } + + return e.complexity.WebhookHistory.OwnerID(childComplexity), true + + case "WebhookHistory.ref": + if e.complexity.WebhookHistory.Ref == nil { + break + } + + return e.complexity.WebhookHistory.Ref(childComplexity), true + + case "WebhookHistory.tags": + if e.complexity.WebhookHistory.Tags == nil { + break + } + + return e.complexity.WebhookHistory.Tags(childComplexity), true + + case "WebhookHistory.updatedAt": + if e.complexity.WebhookHistory.UpdatedAt == nil { + break + } + + return e.complexity.WebhookHistory.UpdatedAt(childComplexity), true + + case "WebhookHistory.updatedBy": + if e.complexity.WebhookHistory.UpdatedBy == nil { + break + } + + return e.complexity.WebhookHistory.UpdatedBy(childComplexity), true + + case "WebhookHistoryConnection.edges": + if e.complexity.WebhookHistoryConnection.Edges == nil { + break + } + + return e.complexity.WebhookHistoryConnection.Edges(childComplexity), true + + case "WebhookHistoryConnection.pageInfo": + if e.complexity.WebhookHistoryConnection.PageInfo == nil { + break + } + + return e.complexity.WebhookHistoryConnection.PageInfo(childComplexity), true + + case "WebhookHistoryConnection.totalCount": + if e.complexity.WebhookHistoryConnection.TotalCount == nil { + break + } + + return e.complexity.WebhookHistoryConnection.TotalCount(childComplexity), true + + case "WebhookHistoryEdge.cursor": + if e.complexity.WebhookHistoryEdge.Cursor == nil { + break + } + + return e.complexity.WebhookHistoryEdge.Cursor(childComplexity), true + + case "WebhookHistoryEdge.node": + if e.complexity.WebhookHistoryEdge.Node == nil { + break + } + + return e.complexity.WebhookHistoryEdge.Node(childComplexity), true + + case "WebhookUpdatePayload.webhook": + if e.complexity.WebhookUpdatePayload.Webhook == nil { + break + } + + return e.complexity.WebhookUpdatePayload.Webhook(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputAPITokenWhereInput, + ec.unmarshalInputAuditLogWhereInput, + ec.unmarshalInputContactHistoryWhereInput, + ec.unmarshalInputContactWhereInput, + ec.unmarshalInputCreateAPITokenInput, + ec.unmarshalInputCreateContactInput, + ec.unmarshalInputCreateDocumentDataInput, + ec.unmarshalInputCreateEntitlementInput, + ec.unmarshalInputCreateEntitlementPlanFeatureInput, + ec.unmarshalInputCreateEntitlementPlanInput, + ec.unmarshalInputCreateEntityInput, + ec.unmarshalInputCreateEntityTypeInput, + ec.unmarshalInputCreateEventInput, + ec.unmarshalInputCreateFeatureInput, + ec.unmarshalInputCreateFileInput, + ec.unmarshalInputCreateGroupInput, + ec.unmarshalInputCreateGroupMembershipInput, + ec.unmarshalInputCreateGroupSettingInput, + ec.unmarshalInputCreateHushInput, + ec.unmarshalInputCreateIntegrationInput, + ec.unmarshalInputCreateInviteInput, + ec.unmarshalInputCreateNoteInput, + ec.unmarshalInputCreateOauthProviderInput, + ec.unmarshalInputCreateOhAuthTooTokenInput, + ec.unmarshalInputCreateOrgMembershipInput, + ec.unmarshalInputCreateOrganizationInput, + ec.unmarshalInputCreateOrganizationSettingInput, + ec.unmarshalInputCreatePersonalAccessTokenInput, + ec.unmarshalInputCreateSubscriberInput, + ec.unmarshalInputCreateTFASettingInput, + ec.unmarshalInputCreateTemplateInput, + ec.unmarshalInputCreateUserInput, + ec.unmarshalInputCreateUserSettingInput, + ec.unmarshalInputCreateWebhookInput, + ec.unmarshalInputDocumentDataHistoryWhereInput, + ec.unmarshalInputDocumentDataWhereInput, + ec.unmarshalInputEntitlementHistoryWhereInput, + ec.unmarshalInputEntitlementPlanFeatureHistoryWhereInput, + ec.unmarshalInputEntitlementPlanFeatureWhereInput, + ec.unmarshalInputEntitlementPlanHistoryWhereInput, + ec.unmarshalInputEntitlementPlanWhereInput, + ec.unmarshalInputEntitlementWhereInput, + ec.unmarshalInputEntityHistoryOrder, + ec.unmarshalInputEntityHistoryWhereInput, + ec.unmarshalInputEntityOrder, + ec.unmarshalInputEntityTypeHistoryOrder, + ec.unmarshalInputEntityTypeHistoryWhereInput, + ec.unmarshalInputEntityTypeOrder, + ec.unmarshalInputEntityTypeWhereInput, + ec.unmarshalInputEntityWhereInput, + ec.unmarshalInputEventHistoryWhereInput, + ec.unmarshalInputEventWhereInput, + ec.unmarshalInputFeatureHistoryWhereInput, + ec.unmarshalInputFeatureWhereInput, + ec.unmarshalInputFileHistoryWhereInput, + ec.unmarshalInputFileWhereInput, + ec.unmarshalInputGroupHistoryOrder, + ec.unmarshalInputGroupHistoryWhereInput, + ec.unmarshalInputGroupMembershipHistoryWhereInput, + ec.unmarshalInputGroupMembershipWhereInput, + ec.unmarshalInputGroupOrder, + ec.unmarshalInputGroupSettingHistoryWhereInput, + ec.unmarshalInputGroupSettingWhereInput, + ec.unmarshalInputGroupWhereInput, + ec.unmarshalInputHushHistoryOrder, + ec.unmarshalInputHushHistoryWhereInput, + ec.unmarshalInputHushOrder, + ec.unmarshalInputHushWhereInput, + ec.unmarshalInputIntegrationHistoryOrder, + ec.unmarshalInputIntegrationHistoryWhereInput, + ec.unmarshalInputIntegrationOrder, + ec.unmarshalInputIntegrationWhereInput, + ec.unmarshalInputInviteWhereInput, + ec.unmarshalInputNoteHistoryWhereInput, + ec.unmarshalInputNoteWhereInput, + ec.unmarshalInputOauthProviderHistoryWhereInput, + ec.unmarshalInputOauthProviderWhereInput, + ec.unmarshalInputOhAuthTooTokenWhereInput, + ec.unmarshalInputOrgMembershipHistoryWhereInput, + ec.unmarshalInputOrgMembershipWhereInput, + ec.unmarshalInputOrganizationHistoryOrder, + ec.unmarshalInputOrganizationHistoryWhereInput, + ec.unmarshalInputOrganizationOrder, + ec.unmarshalInputOrganizationSettingHistoryWhereInput, + ec.unmarshalInputOrganizationSettingWhereInput, + ec.unmarshalInputOrganizationWhereInput, + ec.unmarshalInputPersonalAccessTokenWhereInput, + ec.unmarshalInputSubscriberWhereInput, + ec.unmarshalInputTFASettingWhereInput, + ec.unmarshalInputTemplateHistoryOrder, + ec.unmarshalInputTemplateHistoryWhereInput, + ec.unmarshalInputTemplateOrder, + ec.unmarshalInputTemplateWhereInput, + ec.unmarshalInputUpdateAPITokenInput, + ec.unmarshalInputUpdateContactInput, + ec.unmarshalInputUpdateDocumentDataInput, + ec.unmarshalInputUpdateEntitlementInput, + ec.unmarshalInputUpdateEntitlementPlanFeatureInput, + ec.unmarshalInputUpdateEntitlementPlanInput, + ec.unmarshalInputUpdateEntityInput, + ec.unmarshalInputUpdateEntityTypeInput, + ec.unmarshalInputUpdateEventInput, + ec.unmarshalInputUpdateFeatureInput, + ec.unmarshalInputUpdateFileInput, + ec.unmarshalInputUpdateGroupInput, + ec.unmarshalInputUpdateGroupMembershipInput, + ec.unmarshalInputUpdateGroupSettingInput, + ec.unmarshalInputUpdateHushInput, + ec.unmarshalInputUpdateIntegrationInput, + ec.unmarshalInputUpdateInviteInput, + ec.unmarshalInputUpdateNoteInput, + ec.unmarshalInputUpdateOauthProviderInput, + ec.unmarshalInputUpdateOhAuthTooTokenInput, + ec.unmarshalInputUpdateOrgMembershipInput, + ec.unmarshalInputUpdateOrganizationInput, + ec.unmarshalInputUpdateOrganizationSettingInput, + ec.unmarshalInputUpdatePersonalAccessTokenInput, + ec.unmarshalInputUpdateSubscriberInput, + ec.unmarshalInputUpdateTFASettingInput, + ec.unmarshalInputUpdateTemplateInput, + ec.unmarshalInputUpdateUserInput, + ec.unmarshalInputUpdateUserSettingInput, + ec.unmarshalInputUpdateWebhookInput, + ec.unmarshalInputUserHistoryOrder, + ec.unmarshalInputUserHistoryWhereInput, + ec.unmarshalInputUserOrder, + ec.unmarshalInputUserSettingHistoryWhereInput, + ec.unmarshalInputUserSettingWhereInput, + ec.unmarshalInputUserWhereInput, + ec.unmarshalInputWebhookHistoryOrder, + ec.unmarshalInputWebhookHistoryWhereInput, + ec.unmarshalInputWebhookOrder, + ec.unmarshalInputWebhookWhereInput, + ) + first := true + + switch rc.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, rc.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + case ast.Mutation: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Mutation(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "../../schema/apitoken.graphql", Input: `extend type Query { + """ + Look up apiToken by ID + """ + apiToken( + """ + ID of the apiToken + """ + id: ID! + ): APIToken! +} + +extend type Mutation{ + """ + Create a new apiToken + """ + createAPIToken( + """ + values of the apiToken + """ + input: CreateAPITokenInput! + ): APITokenCreatePayload! + """ + Create multiple new apiTokens + """ + createBulkAPIToken( + """ + values of the apiToken + """ + input: [CreateAPITokenInput!] + ): APITokenBulkCreatePayload! + """ + Create multiple new apiTokens via file upload + """ + createBulkCSVAPIToken( + """ + csv file containing values of the apiToken + """ + input: Upload! + ): APITokenBulkCreatePayload! + """ + Update an existing apiToken + """ + updateAPIToken( + """ + ID of the apiToken + """ + id: ID! + """ + New values for the apiToken + """ + input: UpdateAPITokenInput! + ): APITokenUpdatePayload! + """ + Delete an existing apiToken + """ + deleteAPIToken( + """ + ID of the apiToken + """ + id: ID! + ): APITokenDeletePayload! +} + +""" +Return response for createAPIToken mutation +""" +type APITokenCreatePayload { + """ + Created apiToken + """ + apiToken: APIToken! +} + +""" +Return response for updateAPIToken mutation +""" +type APITokenUpdatePayload { + """ + Updated apiToken + """ + apiToken: APIToken! +} + +""" +Return response for deleteAPIToken mutation +""" +type APITokenDeletePayload { + """ + Deleted apiToken ID + """ + deletedID: ID! +} + +""" +Return response for createBulkAPIToken mutation +""" +type APITokenBulkCreatePayload { + """ + Created apiTokens + """ + apiTokens: [APIToken!] +}`, BuiltIn: false}, + {Name: "../../schema/audit.graphql", Input: `extend type Query { + auditLogs( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for AuditLogs returned from the connection. + """ + where: AuditLogWhereInput + ): AuditLogConnection! +} + +""" +A connection to a list of items. +""" +type AuditLogConnection { + """ + A list of edges. + """ + edges: [AuditLogEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type AuditLogEdge { + """ + The item at the end of the edge. + """ + node: AuditLog + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} + +type AuditLog implements Node { + table: String + time: Time + id: ID! + operation: String + changes: [String!] + updatedBy: ID +} + +extend input AuditLogWhereInput { + refID: ID + updatedBy: ID + operation: String + table: ID + before: Time + after: Time +}`, BuiltIn: false}, + {Name: "../../schema/contact.graphql", Input: `extend type Query { + """ + Look up contact by ID + """ + contact( + """ + ID of the contact + """ + id: ID! + ): Contact! +} + +extend type Mutation{ + """ + Create a new contact + """ + createContact( + """ + values of the contact + """ + input: CreateContactInput! + ): ContactCreatePayload! + """ + Create multiple new contacts + """ + createBulkContact( + """ + values of the contact + """ + input: [CreateContactInput!] + ): ContactBulkCreatePayload! + """ + Create multiple new contacts via file upload + """ + createBulkCSVContact( + """ + csv file containing values of the contact + """ + input: Upload! + ): ContactBulkCreatePayload! + """ + Update an existing contact + """ + updateContact( + """ + ID of the contact + """ + id: ID! + """ + New values for the contact + """ + input: UpdateContactInput! + ): ContactUpdatePayload! + """ + Delete an existing contact + """ + deleteContact( + """ + ID of the contact + """ + id: ID! + ): ContactDeletePayload! +} + +""" +Return response for createContact mutation +""" +type ContactCreatePayload { + """ + Created contact + """ + contact: Contact! +} + +""" +Return response for updateContact mutation +""" +type ContactUpdatePayload { + """ + Updated contact + """ + contact: Contact! +} + +""" +Return response for deleteContact mutation +""" +type ContactDeletePayload { + """ + Deleted contact ID + """ + deletedID: ID! +} + +""" +Return response for createBulkContact mutation +""" +type ContactBulkCreatePayload { + """ + Created contacts + """ + contacts: [Contact!] +}`, BuiltIn: false}, + {Name: "../../schema/documentdata.graphql", Input: `extend type Query { + """ + Look up documentData by ID + """ + documentData( + """ + ID of the documentData + """ + id: ID! + ): DocumentData! +} + +extend type Mutation{ + """ + Create a new documentData + """ + createDocumentData( + """ + values of the documentData + """ + input: CreateDocumentDataInput! + ): DocumentDataCreatePayload! + """ + Create multiple new documentData + """ + createBulkDocumentData( + """ + values of the documentData + """ + input: [CreateDocumentDataInput!] + ): DocumentDataBulkCreatePayload! + """ + Create multiple new documentData via file upload + """ + createBulkCSVDocumentData( + """ + csv file containing values of the documentData + """ + input: Upload! + ): DocumentDataBulkCreatePayload! + """ + Update an existing documentData + """ + updateDocumentData( + """ + ID of the documentData + """ + id: ID! + """ + New values for the documentData + """ + input: UpdateDocumentDataInput! + ): DocumentDataUpdatePayload! + """ + Delete an existing documentData + """ + deleteDocumentData( + """ + ID of the documentData + """ + id: ID! + ): DocumentDataDeletePayload! +} + +""" +Return response for createDocumentData mutation +""" +type DocumentDataCreatePayload { + """ + Created documentData + """ + documentData: DocumentData! +} + +""" +Return response for updateDocumentData mutation +""" +type DocumentDataUpdatePayload { + """ + Updated documentData + """ + documentData: DocumentData! +} + +""" +Return response for deleteDocumentData mutation +""" +type DocumentDataDeletePayload { + """ + Deleted documentData ID + """ + deletedID: ID! +} + +""" +Return response for createBulkDocumentData mutation +""" +type DocumentDataBulkCreatePayload { + """ + Created documentData + """ + documentData: [DocumentData!] +}`, BuiltIn: false}, + {Name: "../../schema/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION +type APIToken implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name associated with the token + """ + name: String! + token: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + owner: Organization +} +""" +A connection to a list of items. +""" +type APITokenConnection { + """ + A list of edges. + """ + edges: [APITokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type APITokenEdge { + """ + The item at the end of the edge. + """ + node: APIToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +APITokenWhereInput is used for filtering APIToken objects. +Input was generated by ent. +""" +input APITokenWhereInput { + not: APITokenWhereInput + and: [APITokenWhereInput!] + or: [APITokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + last_used_at field predicates + """ + lastUsedAt: Time + lastUsedAtNEQ: Time + lastUsedAtIn: [Time!] + lastUsedAtNotIn: [Time!] + lastUsedAtGT: Time + lastUsedAtGTE: Time + lastUsedAtLT: Time + lastUsedAtLTE: Time + lastUsedAtIsNil: Boolean + lastUsedAtNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] +} +type Contact implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactUserStatus! + owner: Organization + entities: [Entity!] +} +""" +A connection to a list of items. +""" +type ContactConnection { + """ + A list of edges. + """ + edges: [ContactEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type ContactEdge { + """ + The item at the end of the edge. + """ + node: Contact + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type ContactHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: ContactHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactHistoryUserStatus! +} +""" +A connection to a list of items. +""" +type ContactHistoryConnection { + """ + A list of edges. + """ + edges: [ContactHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type ContactHistoryEdge { + """ + The item at the end of the edge. + """ + node: ContactHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +ContactHistoryOpType is enum for the field operation +""" +enum ContactHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +ContactHistoryUserStatus is enum for the field status +""" +enum ContactHistoryUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +ContactHistoryWhereInput is used for filtering ContactHistory objects. +Input was generated by ent. +""" +input ContactHistoryWhereInput { + not: ContactHistoryWhereInput + and: [ContactHistoryWhereInput!] + or: [ContactHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: ContactHistoryOpType + operationNEQ: ContactHistoryOpType + operationIn: [ContactHistoryOpType!] + operationNotIn: [ContactHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + full_name field predicates + """ + fullName: String + fullNameNEQ: String + fullNameIn: [String!] + fullNameNotIn: [String!] + fullNameGT: String + fullNameGTE: String + fullNameLT: String + fullNameLTE: String + fullNameContains: String + fullNameHasPrefix: String + fullNameHasSuffix: String + fullNameEqualFold: String + fullNameContainsFold: String + """ + title field predicates + """ + title: String + titleNEQ: String + titleIn: [String!] + titleNotIn: [String!] + titleGT: String + titleGTE: String + titleLT: String + titleLTE: String + titleContains: String + titleHasPrefix: String + titleHasSuffix: String + titleIsNil: Boolean + titleNotNil: Boolean + titleEqualFold: String + titleContainsFold: String + """ + company field predicates + """ + company: String + companyNEQ: String + companyIn: [String!] + companyNotIn: [String!] + companyGT: String + companyGTE: String + companyLT: String + companyLTE: String + companyContains: String + companyHasPrefix: String + companyHasSuffix: String + companyIsNil: Boolean + companyNotNil: Boolean + companyEqualFold: String + companyContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailIsNil: Boolean + emailNotNil: Boolean + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + address field predicates + """ + address: String + addressNEQ: String + addressIn: [String!] + addressNotIn: [String!] + addressGT: String + addressGTE: String + addressLT: String + addressLTE: String + addressContains: String + addressHasPrefix: String + addressHasSuffix: String + addressIsNil: Boolean + addressNotNil: Boolean + addressEqualFold: String + addressContainsFold: String + """ + status field predicates + """ + status: ContactHistoryUserStatus + statusNEQ: ContactHistoryUserStatus + statusIn: [ContactHistoryUserStatus!] + statusNotIn: [ContactHistoryUserStatus!] +} +""" +ContactUserStatus is enum for the field status +""" +enum ContactUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +ContactWhereInput is used for filtering Contact objects. +Input was generated by ent. +""" +input ContactWhereInput { + not: ContactWhereInput + and: [ContactWhereInput!] + or: [ContactWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + full_name field predicates + """ + fullName: String + fullNameNEQ: String + fullNameIn: [String!] + fullNameNotIn: [String!] + fullNameGT: String + fullNameGTE: String + fullNameLT: String + fullNameLTE: String + fullNameContains: String + fullNameHasPrefix: String + fullNameHasSuffix: String + fullNameEqualFold: String + fullNameContainsFold: String + """ + title field predicates + """ + title: String + titleNEQ: String + titleIn: [String!] + titleNotIn: [String!] + titleGT: String + titleGTE: String + titleLT: String + titleLTE: String + titleContains: String + titleHasPrefix: String + titleHasSuffix: String + titleIsNil: Boolean + titleNotNil: Boolean + titleEqualFold: String + titleContainsFold: String + """ + company field predicates + """ + company: String + companyNEQ: String + companyIn: [String!] + companyNotIn: [String!] + companyGT: String + companyGTE: String + companyLT: String + companyLTE: String + companyContains: String + companyHasPrefix: String + companyHasSuffix: String + companyIsNil: Boolean + companyNotNil: Boolean + companyEqualFold: String + companyContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailIsNil: Boolean + emailNotNil: Boolean + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + address field predicates + """ + address: String + addressNEQ: String + addressIn: [String!] + addressNotIn: [String!] + addressGT: String + addressGTE: String + addressLT: String + addressLTE: String + addressContains: String + addressHasPrefix: String + addressHasSuffix: String + addressIsNil: Boolean + addressNotNil: Boolean + addressEqualFold: String + addressContainsFold: String + """ + status field predicates + """ + status: ContactUserStatus + statusNEQ: ContactUserStatus + statusIn: [ContactUserStatus!] + statusNotIn: [ContactUserStatus!] + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] +} +""" +CreateAPITokenInput is used for create APIToken object. +Input was generated by ent. +""" +input CreateAPITokenInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + ownerID: ID +} +""" +CreateContactInput is used for create Contact object. +Input was generated by ent. +""" +input CreateContactInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactUserStatus + ownerID: ID + entityIDs: [ID!] +} +""" +CreateDocumentDataInput is used for create DocumentData object. +Input was generated by ent. +""" +input CreateDocumentDataInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the json data of the document + """ + data: JSON! + ownerID: ID + templateID: ID! + entityIDs: [ID!] +} +""" +CreateEntitlementInput is used for create Entitlement object. +Input was generated by ent. +""" +input CreateEntitlementInput { + """ + tags associated with the object + """ + tags: [String!] + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean + ownerID: ID + planID: ID! + organizationID: ID! + eventIDs: [ID!] +} +""" +CreateEntitlementPlanFeatureInput is used for create EntitlementPlanFeature object. +Input was generated by ent. +""" +input CreateEntitlementPlanFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + ownerID: ID + planID: ID! + featureID: ID! + eventIDs: [ID!] +} +""" +CreateEntitlementPlanInput is used for create EntitlementPlan object. +Input was generated by ent. +""" +input CreateEntitlementPlanInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map + ownerID: ID + entitlementIDs: [ID!] + baseFeatureIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateEntityInput is used for create Entity object. +Input was generated by ent. +""" +input CreateEntityInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + status of the entity + """ + status: String + ownerID: ID + contactIDs: [ID!] + documentIDs: [ID!] + noteIDs: [ID!] + fileIDs: [ID!] + entityTypeID: ID +} +""" +CreateEntityTypeInput is used for create EntityType object. +Input was generated by ent. +""" +input CreateEntityTypeInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the entity + """ + name: String! + ownerID: ID + entityIDs: [ID!] +} +""" +CreateEventInput is used for create Event object. +Input was generated by ent. +""" +input CreateEventInput { + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map + userIDs: [ID!] + groupIDs: [ID!] + integrationIDs: [ID!] + organizationIDs: [ID!] + inviteIDs: [ID!] + featureIDs: [ID!] + entitlementplanIDs: [ID!] + personalAccessTokenIDs: [ID!] + oauth2tokenIDs: [ID!] + hushIDs: [ID!] + entitlementIDs: [ID!] + webhookIDs: [ID!] + subscriberIDs: [ID!] +} +""" +CreateFeatureInput is used for create Feature object. +Input was generated by ent. +""" +input CreateFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map + ownerID: ID + planIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateFileInput is used for create File object. +Input was generated by ent. +""" +input CreateFileInput { + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String + userID: ID + organizationIDs: [ID!] + entityIDs: [ID!] + groupIDs: [ID!] +} +""" +CreateGroupInput is used for create Group object. +Input was generated by ent. +""" +input CreateGroupInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String + ownerID: ID + settingID: ID! + userIDs: [ID!] + eventIDs: [ID!] + integrationIDs: [ID!] + fileIDs: [ID!] +} +""" +CreateGroupMembershipInput is used for create GroupMembership object. +Input was generated by ent. +""" +input CreateGroupMembershipInput { + role: GroupMembershipRole + groupID: ID! + userID: ID! + eventIDs: [ID!] +} +""" +CreateGroupSettingInput is used for create GroupSetting object. +Input was generated by ent. +""" +input CreateGroupSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + groupID: ID +} +""" +CreateHushInput is used for create Hush object. +Input was generated by ent. +""" +input CreateHushInput { + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String + """ + the secret value + """ + secretValue: String + integrationIDs: [ID!] + organizationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateIntegrationInput is used for create Integration object. +Input was generated by ent. +""" +input CreateIntegrationInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String + ownerID: ID + secretIDs: [ID!] + oauth2tokenIDs: [ID!] + eventIDs: [ID!] + webhookIDs: [ID!] +} +""" +CreateInviteInput is used for create Invite object. +Input was generated by ent. +""" +input CreateInviteInput { + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + """ + the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + """ + recipient: String! + """ + the status of the invitation + """ + status: InviteInviteStatus + role: InviteRole + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int + """ + the user who initiated the invitation + """ + requestorID: String + ownerID: ID + eventIDs: [ID!] +} +""" +CreateNoteInput is used for create Note object. +Input was generated by ent. +""" +input CreateNoteInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the text of the note + """ + text: String! + ownerID: ID + entityID: ID +} +""" +CreateOauthProviderInput is used for create OauthProvider object. +Input was generated by ent. +""" +input CreateOauthProviderInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! + ownerID: ID +} +""" +CreateOhAuthTooTokenInput is used for create OhAuthTooToken object. +Input was generated by ent. +""" +input CreateOhAuthTooTokenInput { + """ + tags associated with the object + """ + tags: [String!] + clientID: String! + scopes: [String!] + nonce: String! + claimsUserID: String! + claimsUsername: String! + claimsEmail: String! + claimsEmailVerified: Boolean! + claimsGroups: [String!] + claimsPreferredUsername: String! + connectorID: String! + connectorData: [String!] + lastUsed: Time + integrationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateOrgMembershipInput is used for create OrgMembership object. +Input was generated by ent. +""" +input CreateOrgMembershipInput { + role: OrgMembershipRole + organizationID: ID! + userID: ID! + eventIDs: [ID!] +} +""" +CreateOrganizationInput is used for create Organization object. +Input was generated by ent. +""" +input CreateOrganizationInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean + parentID: ID + groupIDs: [ID!] + templateIDs: [ID!] + integrationIDs: [ID!] + settingID: ID + documentdatumIDs: [ID!] + entitlementIDs: [ID!] + organizationEntitlementIDs: [ID!] + personalAccessTokenIDs: [ID!] + apiTokenIDs: [ID!] + oauthproviderIDs: [ID!] + userIDs: [ID!] + inviteIDs: [ID!] + subscriberIDs: [ID!] + webhookIDs: [ID!] + eventIDs: [ID!] + secretIDs: [ID!] + featureIDs: [ID!] + fileIDs: [ID!] + entitlementplanIDs: [ID!] + entityIDs: [ID!] + entitytypeIDs: [ID!] + contactIDs: [ID!] + noteIDs: [ID!] +} +""" +CreateOrganizationSettingInput is used for create OrganizationSetting object. +Input was generated by ent. +""" +input CreateOrganizationSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + organizationID: ID +} +""" +CreatePersonalAccessTokenInput is used for create PersonalAccessToken object. +Input was generated by ent. +""" +input CreatePersonalAccessTokenInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + ownerID: ID! + organizationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateSubscriberInput is used for create Subscriber object. +Input was generated by ent. +""" +input CreateSubscriberInput { + """ + tags associated with the object + """ + tags: [String!] + """ + email address of the subscriber + """ + email: String! + """ + phone number of the subscriber + """ + phoneNumber: String + ownerID: ID + eventIDs: [ID!] +} +""" +CreateTFASettingInput is used for create TFASetting object. +Input was generated by ent. +""" +input CreateTFASettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + ownerID: ID +} +""" +CreateTemplateInput is used for create Template object. +Input was generated by ent. +""" +input CreateTemplateInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON + ownerID: ID + documentIDs: [ID!] +} +""" +CreateUserInput is used for create User object. +Input was generated by ent. +""" +input CreateUserInput { + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + user password hash + """ + password: String + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider + """ + the user's role + """ + role: UserRole + personalAccessTokenIDs: [ID!] + tfaSettingIDs: [ID!] + settingID: ID! + emailVerificationTokenIDs: [ID!] + passwordResetTokenIDs: [ID!] + groupIDs: [ID!] + organizationIDs: [ID!] + webauthnIDs: [ID!] + fileIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateUserSettingInput is used for create UserSetting object. +Input was generated by ent. +""" +input CreateUserSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingUserStatus + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + userID: ID + defaultOrgID: ID +} +""" +CreateWebhookInput is used for create Webhook object. +Input was generated by ent. +""" +input CreateWebhookInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String + ownerID: ID + eventIDs: [ID!] + integrationIDs: [ID!] +} +""" +Define a Relay Cursor type: +https://relay.dev/graphql/connections.htm#sec-Cursor +""" +scalar Cursor +type DocumentData implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the template id of the document + """ + templateID: ID! + """ + the json data of the document + """ + data: JSON! + owner: Organization + template: Template! + entity: [Entity!] +} +""" +A connection to a list of items. +""" +type DocumentDataConnection { + """ + A list of edges. + """ + edges: [DocumentDataEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type DocumentDataEdge { + """ + The item at the end of the edge. + """ + node: DocumentData + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type DocumentDataHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: DocumentDataHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the template id of the document + """ + templateID: String! + """ + the json data of the document + """ + data: JSON! +} +""" +A connection to a list of items. +""" +type DocumentDataHistoryConnection { + """ + A list of edges. + """ + edges: [DocumentDataHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type DocumentDataHistoryEdge { + """ + The item at the end of the edge. + """ + node: DocumentDataHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +DocumentDataHistoryOpType is enum for the field operation +""" +enum DocumentDataHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +DocumentDataHistoryWhereInput is used for filtering DocumentDataHistory objects. +Input was generated by ent. +""" +input DocumentDataHistoryWhereInput { + not: DocumentDataHistoryWhereInput + and: [DocumentDataHistoryWhereInput!] + or: [DocumentDataHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: DocumentDataHistoryOpType + operationNEQ: DocumentDataHistoryOpType + operationIn: [DocumentDataHistoryOpType!] + operationNotIn: [DocumentDataHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + template_id field predicates + """ + templateID: String + templateIDNEQ: String + templateIDIn: [String!] + templateIDNotIn: [String!] + templateIDGT: String + templateIDGTE: String + templateIDLT: String + templateIDLTE: String + templateIDContains: String + templateIDHasPrefix: String + templateIDHasSuffix: String + templateIDEqualFold: String + templateIDContainsFold: String +} +""" +DocumentDataWhereInput is used for filtering DocumentData objects. +Input was generated by ent. +""" +input DocumentDataWhereInput { + not: DocumentDataWhereInput + and: [DocumentDataWhereInput!] + or: [DocumentDataWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + template_id field predicates + """ + templateID: ID + templateIDNEQ: ID + templateIDIn: [ID!] + templateIDNotIn: [ID!] + templateIDGT: ID + templateIDGTE: ID + templateIDLT: ID + templateIDLTE: ID + templateIDContains: ID + templateIDHasPrefix: ID + templateIDHasSuffix: ID + templateIDEqualFold: ID + templateIDContainsFold: ID + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + template edge predicates + """ + hasTemplate: Boolean + hasTemplateWith: [TemplateWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] +} +type Entitlement implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the plan to which the entitlement belongs + """ + planID: ID! + """ + the organization to which the entitlement belongs + """ + organizationID: ID! + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + whether or not the customers entitlement expires - expires_at will show the time + """ + expires: Boolean! + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean! + owner: Organization + plan: EntitlementPlan! + organization: Organization! + events: [Event!] +} +""" +A connection to a list of items. +""" +type EntitlementConnection { + """ + A list of edges. + """ + edges: [EntitlementEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementEdge { + """ + The item at the end of the edge. + """ + node: Entitlement + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the plan to which the entitlement belongs + """ + planID: String! + """ + the organization to which the entitlement belongs + """ + organizationID: String! + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + whether or not the customers entitlement expires - expires_at will show the time + """ + expires: Boolean! + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean! +} +""" +A connection to a list of items. +""" +type EntitlementHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementHistoryOpType is enum for the field operation +""" +enum EntitlementHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementHistoryWhereInput is used for filtering EntitlementHistory objects. +Input was generated by ent. +""" +input EntitlementHistoryWhereInput { + not: EntitlementHistoryWhereInput + and: [EntitlementHistoryWhereInput!] + or: [EntitlementHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementHistoryOpType + operationNEQ: EntitlementHistoryOpType + operationIn: [EntitlementHistoryOpType!] + operationNotIn: [EntitlementHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + plan_id field predicates + """ + planID: String + planIDNEQ: String + planIDIn: [String!] + planIDNotIn: [String!] + planIDGT: String + planIDGTE: String + planIDLT: String + planIDLTE: String + planIDContains: String + planIDHasPrefix: String + planIDHasSuffix: String + planIDEqualFold: String + planIDContainsFold: String + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDEqualFold: String + organizationIDContainsFold: String + """ + external_customer_id field predicates + """ + externalCustomerID: String + externalCustomerIDNEQ: String + externalCustomerIDIn: [String!] + externalCustomerIDNotIn: [String!] + externalCustomerIDGT: String + externalCustomerIDGTE: String + externalCustomerIDLT: String + externalCustomerIDLTE: String + externalCustomerIDContains: String + externalCustomerIDHasPrefix: String + externalCustomerIDHasSuffix: String + externalCustomerIDIsNil: Boolean + externalCustomerIDNotNil: Boolean + externalCustomerIDEqualFold: String + externalCustomerIDContainsFold: String + """ + external_subscription_id field predicates + """ + externalSubscriptionID: String + externalSubscriptionIDNEQ: String + externalSubscriptionIDIn: [String!] + externalSubscriptionIDNotIn: [String!] + externalSubscriptionIDGT: String + externalSubscriptionIDGTE: String + externalSubscriptionIDLT: String + externalSubscriptionIDLTE: String + externalSubscriptionIDContains: String + externalSubscriptionIDHasPrefix: String + externalSubscriptionIDHasSuffix: String + externalSubscriptionIDIsNil: Boolean + externalSubscriptionIDNotNil: Boolean + externalSubscriptionIDEqualFold: String + externalSubscriptionIDContainsFold: String + """ + expires field predicates + """ + expires: Boolean + expiresNEQ: Boolean + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + cancelled field predicates + """ + cancelled: Boolean + cancelledNEQ: Boolean +} +type EntitlementPlan implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map + owner: Organization + entitlements: [Entitlement!] + baseFeatures: [Feature!] + events: [Event!] + features: [EntitlementPlanFeature!] +} +""" +A connection to a list of items. +""" +type EntitlementPlanConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlan + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementPlanFeature implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + planID: ID! + featureID: ID! + owner: Organization + plan: EntitlementPlan! + feature: Feature! + events: [Event!] +} +""" +A connection to a list of items. +""" +type EntitlementPlanFeatureConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanFeatureEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanFeatureEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanFeature + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementPlanFeatureHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementPlanFeatureHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + planID: String! + featureID: String! +} +""" +A connection to a list of items. +""" +type EntitlementPlanFeatureHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanFeatureHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanFeatureHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanFeatureHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementPlanFeatureHistoryOpType is enum for the field operation +""" +enum EntitlementPlanFeatureHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementPlanFeatureHistoryWhereInput is used for filtering EntitlementPlanFeatureHistory objects. +Input was generated by ent. +""" +input EntitlementPlanFeatureHistoryWhereInput { + not: EntitlementPlanFeatureHistoryWhereInput + and: [EntitlementPlanFeatureHistoryWhereInput!] + or: [EntitlementPlanFeatureHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementPlanFeatureHistoryOpType + operationNEQ: EntitlementPlanFeatureHistoryOpType + operationIn: [EntitlementPlanFeatureHistoryOpType!] + operationNotIn: [EntitlementPlanFeatureHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + plan_id field predicates + """ + planID: String + planIDNEQ: String + planIDIn: [String!] + planIDNotIn: [String!] + planIDGT: String + planIDGTE: String + planIDLT: String + planIDLTE: String + planIDContains: String + planIDHasPrefix: String + planIDHasSuffix: String + planIDEqualFold: String + planIDContainsFold: String + """ + feature_id field predicates + """ + featureID: String + featureIDNEQ: String + featureIDIn: [String!] + featureIDNotIn: [String!] + featureIDGT: String + featureIDGTE: String + featureIDLT: String + featureIDLTE: String + featureIDContains: String + featureIDHasPrefix: String + featureIDHasSuffix: String + featureIDEqualFold: String + featureIDContainsFold: String +} +""" +EntitlementPlanFeatureWhereInput is used for filtering EntitlementPlanFeature objects. +Input was generated by ent. +""" +input EntitlementPlanFeatureWhereInput { + not: EntitlementPlanFeatureWhereInput + and: [EntitlementPlanFeatureWhereInput!] + or: [EntitlementPlanFeatureWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String +} +type EntitlementPlanHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementPlanHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map +} +""" +A connection to a list of items. +""" +type EntitlementPlanHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementPlanHistoryOpType is enum for the field operation +""" +enum EntitlementPlanHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementPlanHistoryWhereInput is used for filtering EntitlementPlanHistory objects. +Input was generated by ent. +""" +input EntitlementPlanHistoryWhereInput { + not: EntitlementPlanHistoryWhereInput + and: [EntitlementPlanHistoryWhereInput!] + or: [EntitlementPlanHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementPlanHistoryOpType + operationNEQ: EntitlementPlanHistoryOpType + operationIn: [EntitlementPlanHistoryOpType!] + operationNotIn: [EntitlementPlanHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + version field predicates + """ + version: String + versionNEQ: String + versionIn: [String!] + versionNotIn: [String!] + versionGT: String + versionGTE: String + versionLT: String + versionLTE: String + versionContains: String + versionHasPrefix: String + versionHasSuffix: String + versionEqualFold: String + versionContainsFold: String +} +""" +EntitlementPlanWhereInput is used for filtering EntitlementPlan objects. +Input was generated by ent. +""" +input EntitlementPlanWhereInput { + not: EntitlementPlanWhereInput + and: [EntitlementPlanWhereInput!] + or: [EntitlementPlanWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + version field predicates + """ + version: String + versionNEQ: String + versionIn: [String!] + versionNotIn: [String!] + versionGT: String + versionGTE: String + versionLT: String + versionLTE: String + versionContains: String + versionHasPrefix: String + versionHasSuffix: String + versionEqualFold: String + versionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entitlements edge predicates + """ + hasEntitlements: Boolean + hasEntitlementsWith: [EntitlementWhereInput!] + """ + base_features edge predicates + """ + hasBaseFeatures: Boolean + hasBaseFeaturesWith: [FeatureWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [EntitlementPlanFeatureWhereInput!] +} +""" +EntitlementWhereInput is used for filtering Entitlement objects. +Input was generated by ent. +""" +input EntitlementWhereInput { + not: EntitlementWhereInput + and: [EntitlementWhereInput!] + or: [EntitlementWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + plan_id field predicates + """ + planID: ID + planIDNEQ: ID + planIDIn: [ID!] + planIDNotIn: [ID!] + planIDGT: ID + planIDGTE: ID + planIDLT: ID + planIDLTE: ID + planIDContains: ID + planIDHasPrefix: ID + planIDHasSuffix: ID + planIDEqualFold: ID + planIDContainsFold: ID + """ + organization_id field predicates + """ + organizationID: ID + organizationIDNEQ: ID + organizationIDIn: [ID!] + organizationIDNotIn: [ID!] + organizationIDGT: ID + organizationIDGTE: ID + organizationIDLT: ID + organizationIDLTE: ID + organizationIDContains: ID + organizationIDHasPrefix: ID + organizationIDHasSuffix: ID + organizationIDEqualFold: ID + organizationIDContainsFold: ID + """ + external_customer_id field predicates + """ + externalCustomerID: String + externalCustomerIDNEQ: String + externalCustomerIDIn: [String!] + externalCustomerIDNotIn: [String!] + externalCustomerIDGT: String + externalCustomerIDGTE: String + externalCustomerIDLT: String + externalCustomerIDLTE: String + externalCustomerIDContains: String + externalCustomerIDHasPrefix: String + externalCustomerIDHasSuffix: String + externalCustomerIDIsNil: Boolean + externalCustomerIDNotNil: Boolean + externalCustomerIDEqualFold: String + externalCustomerIDContainsFold: String + """ + external_subscription_id field predicates + """ + externalSubscriptionID: String + externalSubscriptionIDNEQ: String + externalSubscriptionIDIn: [String!] + externalSubscriptionIDNotIn: [String!] + externalSubscriptionIDGT: String + externalSubscriptionIDGTE: String + externalSubscriptionIDLT: String + externalSubscriptionIDLTE: String + externalSubscriptionIDContains: String + externalSubscriptionIDHasPrefix: String + externalSubscriptionIDHasSuffix: String + externalSubscriptionIDIsNil: Boolean + externalSubscriptionIDNotNil: Boolean + externalSubscriptionIDEqualFold: String + externalSubscriptionIDContainsFold: String + """ + expires field predicates + """ + expires: Boolean + expiresNEQ: Boolean + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + cancelled field predicates + """ + cancelled: Boolean + cancelledNEQ: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + plan edge predicates + """ + hasPlan: Boolean + hasPlanWith: [EntitlementPlanWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Entity implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + The type of the entity + """ + entityTypeID: ID + """ + status of the entity + """ + status: String + owner: Organization + contacts: [Contact!] + documents: [DocumentData!] + notes: [Note!] + files: [File!] + entityType: EntityType +} +""" +A connection to a list of items. +""" +type EntityConnection { + """ + A list of edges. + """ + edges: [EntityEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityEdge { + """ + The item at the end of the edge. + """ + node: Entity + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntityHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntityHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + The type of the entity + """ + entityTypeID: String + """ + status of the entity + """ + status: String +} +""" +A connection to a list of items. +""" +type EntityHistoryConnection { + """ + A list of edges. + """ + edges: [EntityHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntityHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntityHistoryOpType is enum for the field operation +""" +enum EntityHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for EntityHistory connections +""" +input EntityHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityHistories. + """ + field: EntityHistoryOrderField! +} +""" +Properties by which EntityHistory connections can be ordered. +""" +enum EntityHistoryOrderField { + name + display_name +} +""" +EntityHistoryWhereInput is used for filtering EntityHistory objects. +Input was generated by ent. +""" +input EntityHistoryWhereInput { + not: EntityHistoryWhereInput + and: [EntityHistoryWhereInput!] + or: [EntityHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntityHistoryOpType + operationNEQ: EntityHistoryOpType + operationIn: [EntityHistoryOpType!] + operationNotIn: [EntityHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameIsNil: Boolean + nameNotNil: Boolean + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + entity_type_id field predicates + """ + entityTypeID: String + entityTypeIDNEQ: String + entityTypeIDIn: [String!] + entityTypeIDNotIn: [String!] + entityTypeIDGT: String + entityTypeIDGTE: String + entityTypeIDLT: String + entityTypeIDLTE: String + entityTypeIDContains: String + entityTypeIDHasPrefix: String + entityTypeIDHasSuffix: String + entityTypeIDIsNil: Boolean + entityTypeIDNotNil: Boolean + entityTypeIDEqualFold: String + entityTypeIDContainsFold: String + """ + status field predicates + """ + status: String + statusNEQ: String + statusIn: [String!] + statusNotIn: [String!] + statusGT: String + statusGTE: String + statusLT: String + statusLTE: String + statusContains: String + statusHasPrefix: String + statusHasSuffix: String + statusIsNil: Boolean + statusNotNil: Boolean + statusEqualFold: String + statusContainsFold: String +} +""" +Ordering options for Entity connections +""" +input EntityOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Entities. + """ + field: EntityOrderField! +} +""" +Properties by which Entity connections can be ordered. +""" +enum EntityOrderField { + name + display_name +} +type EntityType implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the entity + """ + name: String! + owner: Organization + entities: [Entity!] +} +""" +A connection to a list of items. +""" +type EntityTypeConnection { + """ + A list of edges. + """ + edges: [EntityTypeEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityTypeEdge { + """ + The item at the end of the edge. + """ + node: EntityType + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntityTypeHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntityTypeHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the entity + """ + name: String! +} +""" +A connection to a list of items. +""" +type EntityTypeHistoryConnection { + """ + A list of edges. + """ + edges: [EntityTypeHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityTypeHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntityTypeHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntityTypeHistoryOpType is enum for the field operation +""" +enum EntityTypeHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for EntityTypeHistory connections +""" +input EntityTypeHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityTypeHistories. + """ + field: EntityTypeHistoryOrderField! +} +""" +Properties by which EntityTypeHistory connections can be ordered. +""" +enum EntityTypeHistoryOrderField { + name +} +""" +EntityTypeHistoryWhereInput is used for filtering EntityTypeHistory objects. +Input was generated by ent. +""" +input EntityTypeHistoryWhereInput { + not: EntityTypeHistoryWhereInput + and: [EntityTypeHistoryWhereInput!] + or: [EntityTypeHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntityTypeHistoryOpType + operationNEQ: EntityTypeHistoryOpType + operationIn: [EntityTypeHistoryOpType!] + operationNotIn: [EntityTypeHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String +} +""" +Ordering options for EntityType connections +""" +input EntityTypeOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityTypes. + """ + field: EntityTypeOrderField! +} +""" +Properties by which EntityType connections can be ordered. +""" +enum EntityTypeOrderField { + name +} +""" +EntityTypeWhereInput is used for filtering EntityType objects. +Input was generated by ent. +""" +input EntityTypeWhereInput { + not: EntityTypeWhereInput + and: [EntityTypeWhereInput!] + or: [EntityTypeWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] +} +""" +EntityWhereInput is used for filtering Entity objects. +Input was generated by ent. +""" +input EntityWhereInput { + not: EntityWhereInput + and: [EntityWhereInput!] + or: [EntityWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameIsNil: Boolean + nameNotNil: Boolean + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + entity_type_id field predicates + """ + entityTypeID: ID + entityTypeIDNEQ: ID + entityTypeIDIn: [ID!] + entityTypeIDNotIn: [ID!] + entityTypeIDGT: ID + entityTypeIDGTE: ID + entityTypeIDLT: ID + entityTypeIDLTE: ID + entityTypeIDContains: ID + entityTypeIDHasPrefix: ID + entityTypeIDHasSuffix: ID + entityTypeIDIsNil: Boolean + entityTypeIDNotNil: Boolean + entityTypeIDEqualFold: ID + entityTypeIDContainsFold: ID + """ + status field predicates + """ + status: String + statusNEQ: String + statusIn: [String!] + statusNotIn: [String!] + statusGT: String + statusGTE: String + statusLT: String + statusLTE: String + statusContains: String + statusHasPrefix: String + statusHasSuffix: String + statusIsNil: Boolean + statusNotNil: Boolean + statusEqualFold: String + statusContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + contacts edge predicates + """ + hasContacts: Boolean + hasContactsWith: [ContactWhereInput!] + """ + documents edge predicates + """ + hasDocuments: Boolean + hasDocumentsWith: [DocumentDataWhereInput!] + """ + notes edge predicates + """ + hasNotes: Boolean + hasNotesWith: [NoteWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + entity_type edge predicates + """ + hasEntityType: Boolean + hasEntityTypeWith: [EntityTypeWhereInput!] +} +type Event implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map + user: [User!] + group: [Group!] + integration: [Integration!] + organization: [Organization!] + invite: [Invite!] + feature: [Feature!] + entitlementplan: [EntitlementPlan!] + entitlementplanfeature: [EntitlementPlanFeature!] + personalAccessToken: [PersonalAccessToken!] + oauth2token: [OhAuthTooToken!] + hush: [Hush!] + orgmembership: [OrgMembership!] + groupmembership: [GroupMembership!] + entitlement: [Entitlement!] + webhook: [Webhook!] + subscriber: [Subscriber!] +} +""" +A connection to a list of items. +""" +type EventConnection { + """ + A list of edges. + """ + edges: [EventEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EventEdge { + """ + The item at the end of the edge. + """ + node: Event + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EventHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EventHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map +} +""" +A connection to a list of items. +""" +type EventHistoryConnection { + """ + A list of edges. + """ + edges: [EventHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EventHistoryEdge { + """ + The item at the end of the edge. + """ + node: EventHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EventHistoryOpType is enum for the field operation +""" +enum EventHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EventHistoryWhereInput is used for filtering EventHistory objects. +Input was generated by ent. +""" +input EventHistoryWhereInput { + not: EventHistoryWhereInput + and: [EventHistoryWhereInput!] + or: [EventHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EventHistoryOpType + operationNEQ: EventHistoryOpType + operationIn: [EventHistoryOpType!] + operationNotIn: [EventHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + event_id field predicates + """ + eventID: String + eventIDNEQ: String + eventIDIn: [String!] + eventIDNotIn: [String!] + eventIDGT: String + eventIDGTE: String + eventIDLT: String + eventIDLTE: String + eventIDContains: String + eventIDHasPrefix: String + eventIDHasSuffix: String + eventIDIsNil: Boolean + eventIDNotNil: Boolean + eventIDEqualFold: String + eventIDContainsFold: String + """ + correlation_id field predicates + """ + correlationID: String + correlationIDNEQ: String + correlationIDIn: [String!] + correlationIDNotIn: [String!] + correlationIDGT: String + correlationIDGTE: String + correlationIDLT: String + correlationIDLTE: String + correlationIDContains: String + correlationIDHasPrefix: String + correlationIDHasSuffix: String + correlationIDIsNil: Boolean + correlationIDNotNil: Boolean + correlationIDEqualFold: String + correlationIDContainsFold: String + """ + event_type field predicates + """ + eventType: String + eventTypeNEQ: String + eventTypeIn: [String!] + eventTypeNotIn: [String!] + eventTypeGT: String + eventTypeGTE: String + eventTypeLT: String + eventTypeLTE: String + eventTypeContains: String + eventTypeHasPrefix: String + eventTypeHasSuffix: String + eventTypeEqualFold: String + eventTypeContainsFold: String +} +""" +EventWhereInput is used for filtering Event objects. +Input was generated by ent. +""" +input EventWhereInput { + not: EventWhereInput + and: [EventWhereInput!] + or: [EventWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + event_id field predicates + """ + eventID: String + eventIDNEQ: String + eventIDIn: [String!] + eventIDNotIn: [String!] + eventIDGT: String + eventIDGTE: String + eventIDLT: String + eventIDLTE: String + eventIDContains: String + eventIDHasPrefix: String + eventIDHasSuffix: String + eventIDIsNil: Boolean + eventIDNotNil: Boolean + eventIDEqualFold: String + eventIDContainsFold: String + """ + correlation_id field predicates + """ + correlationID: String + correlationIDNEQ: String + correlationIDIn: [String!] + correlationIDNotIn: [String!] + correlationIDGT: String + correlationIDGTE: String + correlationIDLT: String + correlationIDLTE: String + correlationIDContains: String + correlationIDHasPrefix: String + correlationIDHasSuffix: String + correlationIDIsNil: Boolean + correlationIDNotNil: Boolean + correlationIDEqualFold: String + correlationIDContainsFold: String + """ + event_type field predicates + """ + eventType: String + eventTypeNEQ: String + eventTypeIn: [String!] + eventTypeNotIn: [String!] + eventTypeGT: String + eventTypeGTE: String + eventTypeLT: String + eventTypeLTE: String + eventTypeContains: String + eventTypeHasPrefix: String + eventTypeHasSuffix: String + eventTypeEqualFold: String + eventTypeContainsFold: String + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] + """ + integration edge predicates + """ + hasIntegration: Boolean + hasIntegrationWith: [IntegrationWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + invite edge predicates + """ + hasInvite: Boolean + hasInviteWith: [InviteWhereInput!] + """ + feature edge predicates + """ + hasFeature: Boolean + hasFeatureWith: [FeatureWhereInput!] + """ + entitlementplan edge predicates + """ + hasEntitlementplan: Boolean + hasEntitlementplanWith: [EntitlementPlanWhereInput!] + """ + entitlementplanfeature edge predicates + """ + hasEntitlementplanfeature: Boolean + hasEntitlementplanfeatureWith: [EntitlementPlanFeatureWhereInput!] + """ + personal_access_token edge predicates + """ + hasPersonalAccessToken: Boolean + hasPersonalAccessTokenWith: [PersonalAccessTokenWhereInput!] + """ + oauth2token edge predicates + """ + hasOauth2token: Boolean + hasOauth2tokenWith: [OhAuthTooTokenWhereInput!] + """ + hush edge predicates + """ + hasHush: Boolean + hasHushWith: [HushWhereInput!] + """ + orgmembership edge predicates + """ + hasOrgmembership: Boolean + hasOrgmembershipWith: [OrgMembershipWhereInput!] + """ + groupmembership edge predicates + """ + hasGroupmembership: Boolean + hasGroupmembershipWith: [GroupMembershipWhereInput!] + """ + entitlement edge predicates + """ + hasEntitlement: Boolean + hasEntitlementWith: [EntitlementWhereInput!] + """ + webhook edge predicates + """ + hasWebhook: Boolean + hasWebhookWith: [WebhookWhereInput!] + """ + subscriber edge predicates + """ + hasSubscriber: Boolean + hasSubscriberWith: [SubscriberWhereInput!] +} +type Feature implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean! + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map + owner: Organization + plans: [EntitlementPlan!] + events: [Event!] + features: [EntitlementPlanFeature!] +} +""" +A connection to a list of items. +""" +type FeatureConnection { + """ + A list of edges. + """ + edges: [FeatureEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FeatureEdge { + """ + The item at the end of the edge. + """ + node: Feature + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type FeatureHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: FeatureHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean! + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map +} +""" +A connection to a list of items. +""" +type FeatureHistoryConnection { + """ + A list of edges. + """ + edges: [FeatureHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FeatureHistoryEdge { + """ + The item at the end of the edge. + """ + node: FeatureHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +FeatureHistoryOpType is enum for the field operation +""" +enum FeatureHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +FeatureHistoryWhereInput is used for filtering FeatureHistory objects. +Input was generated by ent. +""" +input FeatureHistoryWhereInput { + not: FeatureHistoryWhereInput + and: [FeatureHistoryWhereInput!] + or: [FeatureHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: FeatureHistoryOpType + operationNEQ: FeatureHistoryOpType + operationIn: [FeatureHistoryOpType!] + operationNotIn: [FeatureHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String +} +""" +FeatureWhereInput is used for filtering Feature objects. +Input was generated by ent. +""" +input FeatureWhereInput { + not: FeatureWhereInput + and: [FeatureWhereInput!] + or: [FeatureWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + plans edge predicates + """ + hasPlans: Boolean + hasPlansWith: [EntitlementPlanWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [EntitlementPlanFeatureWhereInput!] +} +type File implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String + user: User + organization: [Organization!] + entity: [Entity!] + group: [Group!] +} +""" +A connection to a list of items. +""" +type FileConnection { + """ + A list of edges. + """ + edges: [FileEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FileEdge { + """ + The item at the end of the edge. + """ + node: File + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type FileHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: FileHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String +} +""" +A connection to a list of items. +""" +type FileHistoryConnection { + """ + A list of edges. + """ + edges: [FileHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FileHistoryEdge { + """ + The item at the end of the edge. + """ + node: FileHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +FileHistoryOpType is enum for the field operation +""" +enum FileHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +FileHistoryWhereInput is used for filtering FileHistory objects. +Input was generated by ent. +""" +input FileHistoryWhereInput { + not: FileHistoryWhereInput + and: [FileHistoryWhereInput!] + or: [FileHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: FileHistoryOpType + operationNEQ: FileHistoryOpType + operationIn: [FileHistoryOpType!] + operationNotIn: [FileHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + file_name field predicates + """ + fileName: String + fileNameNEQ: String + fileNameIn: [String!] + fileNameNotIn: [String!] + fileNameGT: String + fileNameGTE: String + fileNameLT: String + fileNameLTE: String + fileNameContains: String + fileNameHasPrefix: String + fileNameHasSuffix: String + fileNameEqualFold: String + fileNameContainsFold: String + """ + file_extension field predicates + """ + fileExtension: String + fileExtensionNEQ: String + fileExtensionIn: [String!] + fileExtensionNotIn: [String!] + fileExtensionGT: String + fileExtensionGTE: String + fileExtensionLT: String + fileExtensionLTE: String + fileExtensionContains: String + fileExtensionHasPrefix: String + fileExtensionHasSuffix: String + fileExtensionEqualFold: String + fileExtensionContainsFold: String + """ + file_size field predicates + """ + fileSize: Int + fileSizeNEQ: Int + fileSizeIn: [Int!] + fileSizeNotIn: [Int!] + fileSizeGT: Int + fileSizeGTE: Int + fileSizeLT: Int + fileSizeLTE: Int + fileSizeIsNil: Boolean + fileSizeNotNil: Boolean + """ + content_type field predicates + """ + contentType: String + contentTypeNEQ: String + contentTypeIn: [String!] + contentTypeNotIn: [String!] + contentTypeGT: String + contentTypeGTE: String + contentTypeLT: String + contentTypeLTE: String + contentTypeContains: String + contentTypeHasPrefix: String + contentTypeHasSuffix: String + contentTypeEqualFold: String + contentTypeContainsFold: String + """ + store_key field predicates + """ + storeKey: String + storeKeyNEQ: String + storeKeyIn: [String!] + storeKeyNotIn: [String!] + storeKeyGT: String + storeKeyGTE: String + storeKeyLT: String + storeKeyLTE: String + storeKeyContains: String + storeKeyHasPrefix: String + storeKeyHasSuffix: String + storeKeyEqualFold: String + storeKeyContainsFold: String + """ + category field predicates + """ + category: String + categoryNEQ: String + categoryIn: [String!] + categoryNotIn: [String!] + categoryGT: String + categoryGTE: String + categoryLT: String + categoryLTE: String + categoryContains: String + categoryHasPrefix: String + categoryHasSuffix: String + categoryIsNil: Boolean + categoryNotNil: Boolean + categoryEqualFold: String + categoryContainsFold: String + """ + annotation field predicates + """ + annotation: String + annotationNEQ: String + annotationIn: [String!] + annotationNotIn: [String!] + annotationGT: String + annotationGTE: String + annotationLT: String + annotationLTE: String + annotationContains: String + annotationHasPrefix: String + annotationHasSuffix: String + annotationIsNil: Boolean + annotationNotNil: Boolean + annotationEqualFold: String + annotationContainsFold: String +} +""" +FileWhereInput is used for filtering File objects. +Input was generated by ent. +""" +input FileWhereInput { + not: FileWhereInput + and: [FileWhereInput!] + or: [FileWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + file_name field predicates + """ + fileName: String + fileNameNEQ: String + fileNameIn: [String!] + fileNameNotIn: [String!] + fileNameGT: String + fileNameGTE: String + fileNameLT: String + fileNameLTE: String + fileNameContains: String + fileNameHasPrefix: String + fileNameHasSuffix: String + fileNameEqualFold: String + fileNameContainsFold: String + """ + file_extension field predicates + """ + fileExtension: String + fileExtensionNEQ: String + fileExtensionIn: [String!] + fileExtensionNotIn: [String!] + fileExtensionGT: String + fileExtensionGTE: String + fileExtensionLT: String + fileExtensionLTE: String + fileExtensionContains: String + fileExtensionHasPrefix: String + fileExtensionHasSuffix: String + fileExtensionEqualFold: String + fileExtensionContainsFold: String + """ + file_size field predicates + """ + fileSize: Int + fileSizeNEQ: Int + fileSizeIn: [Int!] + fileSizeNotIn: [Int!] + fileSizeGT: Int + fileSizeGTE: Int + fileSizeLT: Int + fileSizeLTE: Int + fileSizeIsNil: Boolean + fileSizeNotNil: Boolean + """ + content_type field predicates + """ + contentType: String + contentTypeNEQ: String + contentTypeIn: [String!] + contentTypeNotIn: [String!] + contentTypeGT: String + contentTypeGTE: String + contentTypeLT: String + contentTypeLTE: String + contentTypeContains: String + contentTypeHasPrefix: String + contentTypeHasSuffix: String + contentTypeEqualFold: String + contentTypeContainsFold: String + """ + store_key field predicates + """ + storeKey: String + storeKeyNEQ: String + storeKeyIn: [String!] + storeKeyNotIn: [String!] + storeKeyGT: String + storeKeyGTE: String + storeKeyLT: String + storeKeyLTE: String + storeKeyContains: String + storeKeyHasPrefix: String + storeKeyHasSuffix: String + storeKeyEqualFold: String + storeKeyContainsFold: String + """ + category field predicates + """ + category: String + categoryNEQ: String + categoryIn: [String!] + categoryNotIn: [String!] + categoryGT: String + categoryGTE: String + categoryLT: String + categoryLTE: String + categoryContains: String + categoryHasPrefix: String + categoryHasSuffix: String + categoryIsNil: Boolean + categoryNotNil: Boolean + categoryEqualFold: String + categoryContainsFold: String + """ + annotation field predicates + """ + annotation: String + annotationNEQ: String + annotationIn: [String!] + annotationNotIn: [String!] + annotationGT: String + annotationGTE: String + annotationLT: String + annotationLTE: String + annotationContains: String + annotationHasPrefix: String + annotationHasSuffix: String + annotationIsNil: Boolean + annotationNotNil: Boolean + annotationEqualFold: String + annotationContainsFold: String + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] +} +type Group implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String! + owner: Organization + setting: GroupSetting! + users: [User!] + events: [Event!] + integrations: [Integration!] + files: [File!] + members: [GroupMembership!] +} +""" +A connection to a list of items. +""" +type GroupConnection { + """ + A list of edges. + """ + edges: [GroupEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupEdge { + """ + The item at the end of the edge. + """ + node: Group + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String! +} +""" +A connection to a list of items. +""" +type GroupHistoryConnection { + """ + A list of edges. + """ + edges: [GroupHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupHistoryOpType is enum for the field operation +""" +enum GroupHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for GroupHistory connections +""" +input GroupHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order GroupHistories. + """ + field: GroupHistoryOrderField! +} +""" +Properties by which GroupHistory connections can be ordered. +""" +enum GroupHistoryOrderField { + name + display_name +} +""" +GroupHistoryWhereInput is used for filtering GroupHistory objects. +Input was generated by ent. +""" +input GroupHistoryWhereInput { + not: GroupHistoryWhereInput + and: [GroupHistoryWhereInput!] + or: [GroupHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupHistoryOpType + operationNEQ: GroupHistoryOpType + operationIn: [GroupHistoryOpType!] + operationNotIn: [GroupHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String +} +type GroupMembership implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: GroupMembershipRole! + groupID: ID! + userID: ID! + group: Group! + user: User! + events: [Event!] +} +""" +A connection to a list of items. +""" +type GroupMembershipConnection { + """ + A list of edges. + """ + edges: [GroupMembershipEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupMembershipEdge { + """ + The item at the end of the edge. + """ + node: GroupMembership + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupMembershipHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupMembershipHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: GroupMembershipHistoryRole! + groupID: String! + userID: String! +} +""" +A connection to a list of items. +""" +type GroupMembershipHistoryConnection { + """ + A list of edges. + """ + edges: [GroupMembershipHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupMembershipHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupMembershipHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupMembershipHistoryOpType is enum for the field operation +""" +enum GroupMembershipHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +GroupMembershipHistoryRole is enum for the field role +""" +enum GroupMembershipHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +GroupMembershipHistoryWhereInput is used for filtering GroupMembershipHistory objects. +Input was generated by ent. +""" +input GroupMembershipHistoryWhereInput { + not: GroupMembershipHistoryWhereInput + and: [GroupMembershipHistoryWhereInput!] + or: [GroupMembershipHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupMembershipHistoryOpType + operationNEQ: GroupMembershipHistoryOpType + operationIn: [GroupMembershipHistoryOpType!] + operationNotIn: [GroupMembershipHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: GroupMembershipHistoryRole + roleNEQ: GroupMembershipHistoryRole + roleIn: [GroupMembershipHistoryRole!] + roleNotIn: [GroupMembershipHistoryRole!] + """ + group_id field predicates + """ + groupID: String + groupIDNEQ: String + groupIDIn: [String!] + groupIDNotIn: [String!] + groupIDGT: String + groupIDGTE: String + groupIDLT: String + groupIDLTE: String + groupIDContains: String + groupIDHasPrefix: String + groupIDHasSuffix: String + groupIDEqualFold: String + groupIDContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDEqualFold: String + userIDContainsFold: String +} +""" +GroupMembershipRole is enum for the field role +""" +enum GroupMembershipRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +GroupMembershipWhereInput is used for filtering GroupMembership objects. +Input was generated by ent. +""" +input GroupMembershipWhereInput { + not: GroupMembershipWhereInput + and: [GroupMembershipWhereInput!] + or: [GroupMembershipWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: GroupMembershipRole + roleNEQ: GroupMembershipRole + roleIn: [GroupMembershipRole!] + roleNotIn: [GroupMembershipRole!] +} +""" +Ordering options for Group connections +""" +input GroupOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Groups. + """ + field: GroupOrderField! +} +""" +Properties by which Group connections can be ordered. +""" +enum GroupOrderField { + name + display_name +} +type GroupSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility! + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy! + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + """ + the group id associated with the settings + """ + groupID: ID + group: Group +} +""" +A connection to a list of items. +""" +type GroupSettingConnection { + """ + A list of edges. + """ + edges: [GroupSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupSettingEdge { + """ + The item at the end of the edge. + """ + node: GroupSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingHistoryVisibility! + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingHistoryJoinPolicy! + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + """ + the group id associated with the settings + """ + groupID: String +} +""" +A connection to a list of items. +""" +type GroupSettingHistoryConnection { + """ + A list of edges. + """ + edges: [GroupSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupSettingHistoryJoinPolicy is enum for the field join_policy +""" +enum GroupSettingHistoryJoinPolicy @goModel(model: "github.com/theopenlane/core/pkg/enums.JoinPolicy") { + OPEN + INVITE_ONLY + APPLICATION_ONLY + INVITE_OR_APPLICATION +} +""" +GroupSettingHistoryOpType is enum for the field operation +""" +enum GroupSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +GroupSettingHistoryVisibility is enum for the field visibility +""" +enum GroupSettingHistoryVisibility @goModel(model: "github.com/theopenlane/core/pkg/enums.Visibility") { + PUBLIC + PRIVATE +} +""" +GroupSettingHistoryWhereInput is used for filtering GroupSettingHistory objects. +Input was generated by ent. +""" +input GroupSettingHistoryWhereInput { + not: GroupSettingHistoryWhereInput + and: [GroupSettingHistoryWhereInput!] + or: [GroupSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupSettingHistoryOpType + operationNEQ: GroupSettingHistoryOpType + operationIn: [GroupSettingHistoryOpType!] + operationNotIn: [GroupSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + visibility field predicates + """ + visibility: GroupSettingHistoryVisibility + visibilityNEQ: GroupSettingHistoryVisibility + visibilityIn: [GroupSettingHistoryVisibility!] + visibilityNotIn: [GroupSettingHistoryVisibility!] + """ + join_policy field predicates + """ + joinPolicy: GroupSettingHistoryJoinPolicy + joinPolicyNEQ: GroupSettingHistoryJoinPolicy + joinPolicyIn: [GroupSettingHistoryJoinPolicy!] + joinPolicyNotIn: [GroupSettingHistoryJoinPolicy!] + """ + sync_to_slack field predicates + """ + syncToSlack: Boolean + syncToSlackNEQ: Boolean + syncToSlackIsNil: Boolean + syncToSlackNotNil: Boolean + """ + sync_to_github field predicates + """ + syncToGithub: Boolean + syncToGithubNEQ: Boolean + syncToGithubIsNil: Boolean + syncToGithubNotNil: Boolean + """ + group_id field predicates + """ + groupID: String + groupIDNEQ: String + groupIDIn: [String!] + groupIDNotIn: [String!] + groupIDGT: String + groupIDGTE: String + groupIDLT: String + groupIDLTE: String + groupIDContains: String + groupIDHasPrefix: String + groupIDHasSuffix: String + groupIDIsNil: Boolean + groupIDNotNil: Boolean + groupIDEqualFold: String + groupIDContainsFold: String +} +""" +GroupSettingJoinPolicy is enum for the field join_policy +""" +enum GroupSettingJoinPolicy @goModel(model: "github.com/theopenlane/core/pkg/enums.JoinPolicy") { + OPEN + INVITE_ONLY + APPLICATION_ONLY + INVITE_OR_APPLICATION +} +""" +GroupSettingVisibility is enum for the field visibility +""" +enum GroupSettingVisibility @goModel(model: "github.com/theopenlane/core/pkg/enums.Visibility") { + PUBLIC + PRIVATE +} +""" +GroupSettingWhereInput is used for filtering GroupSetting objects. +Input was generated by ent. +""" +input GroupSettingWhereInput { + not: GroupSettingWhereInput + and: [GroupSettingWhereInput!] + or: [GroupSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + visibility field predicates + """ + visibility: GroupSettingVisibility + visibilityNEQ: GroupSettingVisibility + visibilityIn: [GroupSettingVisibility!] + visibilityNotIn: [GroupSettingVisibility!] + """ + join_policy field predicates + """ + joinPolicy: GroupSettingJoinPolicy + joinPolicyNEQ: GroupSettingJoinPolicy + joinPolicyIn: [GroupSettingJoinPolicy!] + joinPolicyNotIn: [GroupSettingJoinPolicy!] + """ + sync_to_slack field predicates + """ + syncToSlack: Boolean + syncToSlackNEQ: Boolean + syncToSlackIsNil: Boolean + syncToSlackNotNil: Boolean + """ + sync_to_github field predicates + """ + syncToGithub: Boolean + syncToGithubNEQ: Boolean + syncToGithubIsNil: Boolean + syncToGithubNotNil: Boolean + """ + group_id field predicates + """ + groupID: ID + groupIDNEQ: ID + groupIDIn: [ID!] + groupIDNotIn: [ID!] + groupIDGT: ID + groupIDGTE: ID + groupIDLT: ID + groupIDLTE: ID + groupIDContains: ID + groupIDHasPrefix: ID + groupIDHasSuffix: ID + groupIDIsNil: Boolean + groupIDNotNil: Boolean + groupIDEqualFold: ID + groupIDContainsFold: ID + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] +} +""" +GroupWhereInput is used for filtering Group objects. +Input was generated by ent. +""" +input GroupWhereInput { + not: GroupWhereInput + and: [GroupWhereInput!] + or: [GroupWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [GroupSettingWhereInput!] + """ + users edge predicates + """ + hasUsers: Boolean + hasUsersWith: [UserWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + members edge predicates + """ + hasMembers: Boolean + hasMembersWith: [GroupMembershipWhereInput!] +} +type Hush implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String + """ + the integration associated with the secret + """ + integrations: [Integration!] + organization: [Organization!] + events: [Event!] +} +""" +A connection to a list of items. +""" +type HushConnection { + """ + A list of edges. + """ + edges: [HushEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type HushEdge { + """ + The item at the end of the edge. + """ + node: Hush + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type HushHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: HushHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String +} +""" +A connection to a list of items. +""" +type HushHistoryConnection { + """ + A list of edges. + """ + edges: [HushHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type HushHistoryEdge { + """ + The item at the end of the edge. + """ + node: HushHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +HushHistoryOpType is enum for the field operation +""" +enum HushHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for HushHistory connections +""" +input HushHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order HushHistories. + """ + field: HushHistoryOrderField! +} +""" +Properties by which HushHistory connections can be ordered. +""" +enum HushHistoryOrderField { + name + kind +} +""" +HushHistoryWhereInput is used for filtering HushHistory objects. +Input was generated by ent. +""" +input HushHistoryWhereInput { + not: HushHistoryWhereInput + and: [HushHistoryWhereInput!] + or: [HushHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: HushHistoryOpType + operationNEQ: HushHistoryOpType + operationIn: [HushHistoryOpType!] + operationNotIn: [HushHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + secret_name field predicates + """ + secretName: String + secretNameNEQ: String + secretNameIn: [String!] + secretNameNotIn: [String!] + secretNameGT: String + secretNameGTE: String + secretNameLT: String + secretNameLTE: String + secretNameContains: String + secretNameHasPrefix: String + secretNameHasSuffix: String + secretNameIsNil: Boolean + secretNameNotNil: Boolean + secretNameEqualFold: String + secretNameContainsFold: String +} +""" +Ordering options for Hush connections +""" +input HushOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Hushes. + """ + field: HushOrderField! +} +""" +Properties by which Hush connections can be ordered. +""" +enum HushOrderField { + name + kind +} +""" +HushWhereInput is used for filtering Hush objects. +Input was generated by ent. +""" +input HushWhereInput { + not: HushWhereInput + and: [HushWhereInput!] + or: [HushWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + secret_name field predicates + """ + secretName: String + secretNameNEQ: String + secretNameIn: [String!] + secretNameNotIn: [String!] + secretNameGT: String + secretNameGTE: String + secretNameLT: String + secretNameLTE: String + secretNameContains: String + secretNameHasPrefix: String + secretNameHasSuffix: String + secretNameIsNil: Boolean + secretNameNotNil: Boolean + secretNameEqualFold: String + secretNameContainsFold: String + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Integration implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String + owner: Organization + """ + the secrets associated with the integration + """ + secrets: [Hush!] + """ + the oauth2 tokens associated with the integration + """ + oauth2tokens: [OhAuthTooToken!] + events: [Event!] + webhooks: [Webhook!] +} +""" +A connection to a list of items. +""" +type IntegrationConnection { + """ + A list of edges. + """ + edges: [IntegrationEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type IntegrationEdge { + """ + The item at the end of the edge. + """ + node: Integration + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type IntegrationHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: IntegrationHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String +} +""" +A connection to a list of items. +""" +type IntegrationHistoryConnection { + """ + A list of edges. + """ + edges: [IntegrationHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type IntegrationHistoryEdge { + """ + The item at the end of the edge. + """ + node: IntegrationHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +IntegrationHistoryOpType is enum for the field operation +""" +enum IntegrationHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for IntegrationHistory connections +""" +input IntegrationHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order IntegrationHistories. + """ + field: IntegrationHistoryOrderField! +} +""" +Properties by which IntegrationHistory connections can be ordered. +""" +enum IntegrationHistoryOrderField { + name + kind +} +""" +IntegrationHistoryWhereInput is used for filtering IntegrationHistory objects. +Input was generated by ent. +""" +input IntegrationHistoryWhereInput { + not: IntegrationHistoryWhereInput + and: [IntegrationHistoryWhereInput!] + or: [IntegrationHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: IntegrationHistoryOpType + operationNEQ: IntegrationHistoryOpType + operationIn: [IntegrationHistoryOpType!] + operationNotIn: [IntegrationHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String +} +""" +Ordering options for Integration connections +""" +input IntegrationOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Integrations. + """ + field: IntegrationOrderField! +} +""" +Properties by which Integration connections can be ordered. +""" +enum IntegrationOrderField { + name + kind +} +""" +IntegrationWhereInput is used for filtering Integration objects. +Input was generated by ent. +""" +input IntegrationWhereInput { + not: IntegrationWhereInput + and: [IntegrationWhereInput!] + or: [IntegrationWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + secrets edge predicates + """ + hasSecrets: Boolean + hasSecretsWith: [HushWhereInput!] + """ + oauth2tokens edge predicates + """ + hasOauth2tokens: Boolean + hasOauth2tokensWith: [OhAuthTooTokenWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + webhooks edge predicates + """ + hasWebhooks: Boolean + hasWebhooksWith: [WebhookWhereInput!] +} +type Invite implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + """ + the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + """ + recipient: String! + """ + the status of the invitation + """ + status: InviteInviteStatus! + role: InviteRole! + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int! + """ + the user who initiated the invitation + """ + requestorID: String + owner: Organization + events: [Event!] +} +""" +A connection to a list of items. +""" +type InviteConnection { + """ + A list of edges. + """ + edges: [InviteEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type InviteEdge { + """ + The item at the end of the edge. + """ + node: Invite + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +InviteInviteStatus is enum for the field status +""" +enum InviteInviteStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.InviteStatus") { + INVITATION_SENT + APPROVAL_REQUIRED + INVITATION_ACCEPTED + INVITATION_EXPIRED +} +""" +InviteRole is enum for the field role +""" +enum InviteRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +InviteWhereInput is used for filtering Invite objects. +Input was generated by ent. +""" +input InviteWhereInput { + not: InviteWhereInput + and: [InviteWhereInput!] + or: [InviteWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + expires field predicates + """ + expires: Time + expiresNEQ: Time + expiresIn: [Time!] + expiresNotIn: [Time!] + expiresGT: Time + expiresGTE: Time + expiresLT: Time + expiresLTE: Time + expiresIsNil: Boolean + expiresNotNil: Boolean + """ + recipient field predicates + """ + recipient: String + recipientNEQ: String + recipientIn: [String!] + recipientNotIn: [String!] + recipientGT: String + recipientGTE: String + recipientLT: String + recipientLTE: String + recipientContains: String + recipientHasPrefix: String + recipientHasSuffix: String + recipientEqualFold: String + recipientContainsFold: String + """ + status field predicates + """ + status: InviteInviteStatus + statusNEQ: InviteInviteStatus + statusIn: [InviteInviteStatus!] + statusNotIn: [InviteInviteStatus!] + """ + role field predicates + """ + role: InviteRole + roleNEQ: InviteRole + roleIn: [InviteRole!] + roleNotIn: [InviteRole!] + """ + send_attempts field predicates + """ + sendAttempts: Int + sendAttemptsNEQ: Int + sendAttemptsIn: [Int!] + sendAttemptsNotIn: [Int!] + sendAttemptsGT: Int + sendAttemptsGTE: Int + sendAttemptsLT: Int + sendAttemptsLTE: Int + """ + requestor_id field predicates + """ + requestorID: String + requestorIDNEQ: String + requestorIDIn: [String!] + requestorIDNotIn: [String!] + requestorIDGT: String + requestorIDGTE: String + requestorIDLT: String + requestorIDLTE: String + requestorIDContains: String + requestorIDHasPrefix: String + requestorIDHasSuffix: String + requestorIDIsNil: Boolean + requestorIDNotNil: Boolean + requestorIDEqualFold: String + requestorIDContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +""" +A valid JSON string. +""" +scalar JSON +""" +The builtin Map type +""" +scalar Map +""" +An object with an ID. +Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm) +""" +interface Node @goModel(model: "github.com/theopenlane/core/internal/ent/generated.Noder") { + """ + The id of the object. + """ + id: ID! +} +type Note implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the text of the note + """ + text: String! + owner: Organization + entity: Entity +} +""" +A connection to a list of items. +""" +type NoteConnection { + """ + A list of edges. + """ + edges: [NoteEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type NoteEdge { + """ + The item at the end of the edge. + """ + node: Note + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type NoteHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: NoteHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the text of the note + """ + text: String! +} +""" +A connection to a list of items. +""" +type NoteHistoryConnection { + """ + A list of edges. + """ + edges: [NoteHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type NoteHistoryEdge { + """ + The item at the end of the edge. + """ + node: NoteHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +NoteHistoryOpType is enum for the field operation +""" +enum NoteHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +NoteHistoryWhereInput is used for filtering NoteHistory objects. +Input was generated by ent. +""" +input NoteHistoryWhereInput { + not: NoteHistoryWhereInput + and: [NoteHistoryWhereInput!] + or: [NoteHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: NoteHistoryOpType + operationNEQ: NoteHistoryOpType + operationIn: [NoteHistoryOpType!] + operationNotIn: [NoteHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + text field predicates + """ + text: String + textNEQ: String + textIn: [String!] + textNotIn: [String!] + textGT: String + textGTE: String + textLT: String + textLTE: String + textContains: String + textHasPrefix: String + textHasSuffix: String + textEqualFold: String + textContainsFold: String +} +""" +NoteWhereInput is used for filtering Note objects. +Input was generated by ent. +""" +input NoteWhereInput { + not: NoteWhereInput + and: [NoteWhereInput!] + or: [NoteWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + text field predicates + """ + text: String + textNEQ: String + textIn: [String!] + textNotIn: [String!] + textGT: String + textGTE: String + textLT: String + textLTE: String + textContains: String + textHasPrefix: String + textHasSuffix: String + textEqualFold: String + textContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] +} +type OauthProvider implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! + owner: Organization +} +""" +A connection to a list of items. +""" +type OauthProviderConnection { + """ + A list of edges. + """ + edges: [OauthProviderEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OauthProviderEdge { + """ + The item at the end of the edge. + """ + node: OauthProvider + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OauthProviderHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OauthProviderHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! +} +""" +A connection to a list of items. +""" +type OauthProviderHistoryConnection { + """ + A list of edges. + """ + edges: [OauthProviderHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OauthProviderHistoryEdge { + """ + The item at the end of the edge. + """ + node: OauthProviderHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OauthProviderHistoryOpType is enum for the field operation +""" +enum OauthProviderHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OauthProviderHistoryWhereInput is used for filtering OauthProviderHistory objects. +Input was generated by ent. +""" +input OauthProviderHistoryWhereInput { + not: OauthProviderHistoryWhereInput + and: [OauthProviderHistoryWhereInput!] + or: [OauthProviderHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OauthProviderHistoryOpType + operationNEQ: OauthProviderHistoryOpType + operationIn: [OauthProviderHistoryOpType!] + operationNotIn: [OauthProviderHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + client_secret field predicates + """ + clientSecret: String + clientSecretNEQ: String + clientSecretIn: [String!] + clientSecretNotIn: [String!] + clientSecretGT: String + clientSecretGTE: String + clientSecretLT: String + clientSecretLTE: String + clientSecretContains: String + clientSecretHasPrefix: String + clientSecretHasSuffix: String + clientSecretEqualFold: String + clientSecretContainsFold: String + """ + redirect_url field predicates + """ + redirectURL: String + redirectURLNEQ: String + redirectURLIn: [String!] + redirectURLNotIn: [String!] + redirectURLGT: String + redirectURLGTE: String + redirectURLLT: String + redirectURLLTE: String + redirectURLContains: String + redirectURLHasPrefix: String + redirectURLHasSuffix: String + redirectURLEqualFold: String + redirectURLContainsFold: String + """ + scopes field predicates + """ + scopes: String + scopesNEQ: String + scopesIn: [String!] + scopesNotIn: [String!] + scopesGT: String + scopesGTE: String + scopesLT: String + scopesLTE: String + scopesContains: String + scopesHasPrefix: String + scopesHasSuffix: String + scopesEqualFold: String + scopesContainsFold: String + """ + auth_url field predicates + """ + authURL: String + authURLNEQ: String + authURLIn: [String!] + authURLNotIn: [String!] + authURLGT: String + authURLGTE: String + authURLLT: String + authURLLTE: String + authURLContains: String + authURLHasPrefix: String + authURLHasSuffix: String + authURLEqualFold: String + authURLContainsFold: String + """ + token_url field predicates + """ + tokenURL: String + tokenURLNEQ: String + tokenURLIn: [String!] + tokenURLNotIn: [String!] + tokenURLGT: String + tokenURLGTE: String + tokenURLLT: String + tokenURLLTE: String + tokenURLContains: String + tokenURLHasPrefix: String + tokenURLHasSuffix: String + tokenURLEqualFold: String + tokenURLContainsFold: String + """ + auth_style field predicates + """ + authStyle: Uint + authStyleNEQ: Uint + authStyleIn: [Uint!] + authStyleNotIn: [Uint!] + authStyleGT: Uint + authStyleGTE: Uint + authStyleLT: Uint + authStyleLTE: Uint + """ + info_url field predicates + """ + infoURL: String + infoURLNEQ: String + infoURLIn: [String!] + infoURLNotIn: [String!] + infoURLGT: String + infoURLGTE: String + infoURLLT: String + infoURLLTE: String + infoURLContains: String + infoURLHasPrefix: String + infoURLHasSuffix: String + infoURLEqualFold: String + infoURLContainsFold: String +} +""" +OauthProviderWhereInput is used for filtering OauthProvider objects. +Input was generated by ent. +""" +input OauthProviderWhereInput { + not: OauthProviderWhereInput + and: [OauthProviderWhereInput!] + or: [OauthProviderWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + client_secret field predicates + """ + clientSecret: String + clientSecretNEQ: String + clientSecretIn: [String!] + clientSecretNotIn: [String!] + clientSecretGT: String + clientSecretGTE: String + clientSecretLT: String + clientSecretLTE: String + clientSecretContains: String + clientSecretHasPrefix: String + clientSecretHasSuffix: String + clientSecretEqualFold: String + clientSecretContainsFold: String + """ + redirect_url field predicates + """ + redirectURL: String + redirectURLNEQ: String + redirectURLIn: [String!] + redirectURLNotIn: [String!] + redirectURLGT: String + redirectURLGTE: String + redirectURLLT: String + redirectURLLTE: String + redirectURLContains: String + redirectURLHasPrefix: String + redirectURLHasSuffix: String + redirectURLEqualFold: String + redirectURLContainsFold: String + """ + scopes field predicates + """ + scopes: String + scopesNEQ: String + scopesIn: [String!] + scopesNotIn: [String!] + scopesGT: String + scopesGTE: String + scopesLT: String + scopesLTE: String + scopesContains: String + scopesHasPrefix: String + scopesHasSuffix: String + scopesEqualFold: String + scopesContainsFold: String + """ + auth_url field predicates + """ + authURL: String + authURLNEQ: String + authURLIn: [String!] + authURLNotIn: [String!] + authURLGT: String + authURLGTE: String + authURLLT: String + authURLLTE: String + authURLContains: String + authURLHasPrefix: String + authURLHasSuffix: String + authURLEqualFold: String + authURLContainsFold: String + """ + token_url field predicates + """ + tokenURL: String + tokenURLNEQ: String + tokenURLIn: [String!] + tokenURLNotIn: [String!] + tokenURLGT: String + tokenURLGTE: String + tokenURLLT: String + tokenURLLTE: String + tokenURLContains: String + tokenURLHasPrefix: String + tokenURLHasSuffix: String + tokenURLEqualFold: String + tokenURLContainsFold: String + """ + auth_style field predicates + """ + authStyle: Uint + authStyleNEQ: Uint + authStyleIn: [Uint!] + authStyleNotIn: [Uint!] + authStyleGT: Uint + authStyleGTE: Uint + authStyleLT: Uint + authStyleLTE: Uint + """ + info_url field predicates + """ + infoURL: String + infoURLNEQ: String + infoURLIn: [String!] + infoURLNotIn: [String!] + infoURLGT: String + infoURLGTE: String + infoURLLT: String + infoURLLTE: String + infoURLContains: String + infoURLHasPrefix: String + infoURLHasSuffix: String + infoURLEqualFold: String + infoURLContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] +} +type OhAuthTooToken implements Node { + id: ID! + """ + tags associated with the object + """ + tags: [String!] + clientID: String! + scopes: [String!] + nonce: String! + claimsUserID: String! + claimsUsername: String! + claimsEmail: String! + claimsEmailVerified: Boolean! + claimsGroups: [String!] + claimsPreferredUsername: String! + connectorID: String! + connectorData: [String!] + lastUsed: Time! + integration: [Integration!] + events: [Event!] +} +""" +A connection to a list of items. +""" +type OhAuthTooTokenConnection { + """ + A list of edges. + """ + edges: [OhAuthTooTokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OhAuthTooTokenEdge { + """ + The item at the end of the edge. + """ + node: OhAuthTooToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OhAuthTooTokenWhereInput is used for filtering OhAuthTooToken objects. +Input was generated by ent. +""" +input OhAuthTooTokenWhereInput { + not: OhAuthTooTokenWhereInput + and: [OhAuthTooTokenWhereInput!] + or: [OhAuthTooTokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + nonce field predicates + """ + nonce: String + nonceNEQ: String + nonceIn: [String!] + nonceNotIn: [String!] + nonceGT: String + nonceGTE: String + nonceLT: String + nonceLTE: String + nonceContains: String + nonceHasPrefix: String + nonceHasSuffix: String + nonceEqualFold: String + nonceContainsFold: String + """ + claims_user_id field predicates + """ + claimsUserID: String + claimsUserIDNEQ: String + claimsUserIDIn: [String!] + claimsUserIDNotIn: [String!] + claimsUserIDGT: String + claimsUserIDGTE: String + claimsUserIDLT: String + claimsUserIDLTE: String + claimsUserIDContains: String + claimsUserIDHasPrefix: String + claimsUserIDHasSuffix: String + claimsUserIDEqualFold: String + claimsUserIDContainsFold: String + """ + claims_username field predicates + """ + claimsUsername: String + claimsUsernameNEQ: String + claimsUsernameIn: [String!] + claimsUsernameNotIn: [String!] + claimsUsernameGT: String + claimsUsernameGTE: String + claimsUsernameLT: String + claimsUsernameLTE: String + claimsUsernameContains: String + claimsUsernameHasPrefix: String + claimsUsernameHasSuffix: String + claimsUsernameEqualFold: String + claimsUsernameContainsFold: String + """ + claims_email field predicates + """ + claimsEmail: String + claimsEmailNEQ: String + claimsEmailIn: [String!] + claimsEmailNotIn: [String!] + claimsEmailGT: String + claimsEmailGTE: String + claimsEmailLT: String + claimsEmailLTE: String + claimsEmailContains: String + claimsEmailHasPrefix: String + claimsEmailHasSuffix: String + claimsEmailEqualFold: String + claimsEmailContainsFold: String + """ + claims_email_verified field predicates + """ + claimsEmailVerified: Boolean + claimsEmailVerifiedNEQ: Boolean + """ + claims_preferred_username field predicates + """ + claimsPreferredUsername: String + claimsPreferredUsernameNEQ: String + claimsPreferredUsernameIn: [String!] + claimsPreferredUsernameNotIn: [String!] + claimsPreferredUsernameGT: String + claimsPreferredUsernameGTE: String + claimsPreferredUsernameLT: String + claimsPreferredUsernameLTE: String + claimsPreferredUsernameContains: String + claimsPreferredUsernameHasPrefix: String + claimsPreferredUsernameHasSuffix: String + claimsPreferredUsernameEqualFold: String + claimsPreferredUsernameContainsFold: String + """ + connector_id field predicates + """ + connectorID: String + connectorIDNEQ: String + connectorIDIn: [String!] + connectorIDNotIn: [String!] + connectorIDGT: String + connectorIDGTE: String + connectorIDLT: String + connectorIDLTE: String + connectorIDContains: String + connectorIDHasPrefix: String + connectorIDHasSuffix: String + connectorIDEqualFold: String + connectorIDContainsFold: String + """ + last_used field predicates + """ + lastUsed: Time + lastUsedNEQ: Time + lastUsedIn: [Time!] + lastUsedNotIn: [Time!] + lastUsedGT: Time + lastUsedGTE: Time + lastUsedLT: Time + lastUsedLTE: Time + """ + integration edge predicates + """ + hasIntegration: Boolean + hasIntegrationWith: [IntegrationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +""" +Possible directions in which to order a list of items when provided an ` + "`" + `orderBy` + "`" + ` argument. +""" +enum OrderDirection { + """ + Specifies an ascending order for a given ` + "`" + `orderBy` + "`" + ` argument. + """ + ASC + """ + Specifies a descending order for a given ` + "`" + `orderBy` + "`" + ` argument. + """ + DESC +} +type OrgMembership implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: OrgMembershipRole! + organizationID: ID! + userID: ID! + organization: Organization! + user: User! + events: [Event!] +} +""" +A connection to a list of items. +""" +type OrgMembershipConnection { + """ + A list of edges. + """ + edges: [OrgMembershipEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrgMembershipEdge { + """ + The item at the end of the edge. + """ + node: OrgMembership + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrgMembershipHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrgMembershipHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: OrgMembershipHistoryRole! + organizationID: String! + userID: String! +} +""" +A connection to a list of items. +""" +type OrgMembershipHistoryConnection { + """ + A list of edges. + """ + edges: [OrgMembershipHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrgMembershipHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrgMembershipHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrgMembershipHistoryOpType is enum for the field operation +""" +enum OrgMembershipHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OrgMembershipHistoryRole is enum for the field role +""" +enum OrgMembershipHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER + OWNER +} +""" +OrgMembershipHistoryWhereInput is used for filtering OrgMembershipHistory objects. +Input was generated by ent. +""" +input OrgMembershipHistoryWhereInput { + not: OrgMembershipHistoryWhereInput + and: [OrgMembershipHistoryWhereInput!] + or: [OrgMembershipHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrgMembershipHistoryOpType + operationNEQ: OrgMembershipHistoryOpType + operationIn: [OrgMembershipHistoryOpType!] + operationNotIn: [OrgMembershipHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: OrgMembershipHistoryRole + roleNEQ: OrgMembershipHistoryRole + roleIn: [OrgMembershipHistoryRole!] + roleNotIn: [OrgMembershipHistoryRole!] + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDEqualFold: String + organizationIDContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDEqualFold: String + userIDContainsFold: String +} +""" +OrgMembershipRole is enum for the field role +""" +enum OrgMembershipRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER + OWNER +} +""" +OrgMembershipWhereInput is used for filtering OrgMembership objects. +Input was generated by ent. +""" +input OrgMembershipWhereInput { + not: OrgMembershipWhereInput + and: [OrgMembershipWhereInput!] + or: [OrgMembershipWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: OrgMembershipRole + roleNEQ: OrgMembershipRole + roleIn: [OrgMembershipRole!] + roleNotIn: [OrgMembershipRole!] +} +type Organization implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String! + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean! + parent: Organization + children( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Organizations returned from the connection. + """ + orderBy: OrganizationOrder + + """ + Filtering options for Organizations returned from the connection. + """ + where: OrganizationWhereInput + ): OrganizationConnection! + groups: [Group!] + templates: [Template!] + integrations: [Integration!] + setting: OrganizationSetting + documentdata: [DocumentData!] + entitlements: [Entitlement!] + organizationEntitlement: [Entitlement!] + personalAccessTokens: [PersonalAccessToken!] + apiTokens: [APIToken!] + oauthprovider: [OauthProvider!] + users: [User!] + invites: [Invite!] + subscribers: [Subscriber!] + webhooks: [Webhook!] + events: [Event!] + secrets: [Hush!] + features: [Feature!] + files: [File!] + entitlementplans: [EntitlementPlan!] + entitlementplanfeatures: [EntitlementPlanFeature!] + entities: [Entity!] + entitytypes: [EntityType!] + contacts: [Contact!] + notes: [Note!] + members: [OrgMembership!] +} +""" +A connection to a list of items. +""" +type OrganizationConnection { + """ + A list of edges. + """ + edges: [OrganizationEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationEdge { + """ + The item at the end of the edge. + """ + node: Organization + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrganizationHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrganizationHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String! + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean! +} +""" +A connection to a list of items. +""" +type OrganizationHistoryConnection { + """ + A list of edges. + """ + edges: [OrganizationHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrganizationHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrganizationHistoryOpType is enum for the field operation +""" +enum OrganizationHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for OrganizationHistory connections +""" +input OrganizationHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order OrganizationHistories. + """ + field: OrganizationHistoryOrderField! +} +""" +Properties by which OrganizationHistory connections can be ordered. +""" +enum OrganizationHistoryOrderField { + name + display_name +} +""" +OrganizationHistoryWhereInput is used for filtering OrganizationHistory objects. +Input was generated by ent. +""" +input OrganizationHistoryWhereInput { + not: OrganizationHistoryWhereInput + and: [OrganizationHistoryWhereInput!] + or: [OrganizationHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrganizationHistoryOpType + operationNEQ: OrganizationHistoryOpType + operationIn: [OrganizationHistoryOpType!] + operationNotIn: [OrganizationHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + parent_organization_id field predicates + """ + parentOrganizationID: ID + parentOrganizationIDNEQ: ID + parentOrganizationIDIn: [ID!] + parentOrganizationIDNotIn: [ID!] + parentOrganizationIDGT: ID + parentOrganizationIDGTE: ID + parentOrganizationIDLT: ID + parentOrganizationIDLTE: ID + parentOrganizationIDContains: ID + parentOrganizationIDHasPrefix: ID + parentOrganizationIDHasSuffix: ID + parentOrganizationIDIsNil: Boolean + parentOrganizationIDNotNil: Boolean + parentOrganizationIDEqualFold: ID + parentOrganizationIDContainsFold: ID + """ + personal_org field predicates + """ + personalOrg: Boolean + personalOrgNEQ: Boolean + personalOrgIsNil: Boolean + personalOrgNotNil: Boolean + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String +} +""" +Ordering options for Organization connections +""" +input OrganizationOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Organizations. + """ + field: OrganizationOrderField! +} +""" +Properties by which Organization connections can be ordered. +""" +enum OrganizationOrderField { + name + display_name +} +type OrganizationSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + """ + the ID of the organization the settings belong to + """ + organizationID: ID + organization: Organization +} +""" +A connection to a list of items. +""" +type OrganizationSettingConnection { + """ + A list of edges. + """ + edges: [OrganizationSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationSettingEdge { + """ + The item at the end of the edge. + """ + node: OrganizationSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrganizationSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrganizationSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingHistoryRegion + """ + the ID of the organization the settings belong to + """ + organizationID: String +} +""" +A connection to a list of items. +""" +type OrganizationSettingHistoryConnection { + """ + A list of edges. + """ + edges: [OrganizationSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrganizationSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrganizationSettingHistoryOpType is enum for the field operation +""" +enum OrganizationSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OrganizationSettingHistoryRegion is enum for the field geo_location +""" +enum OrganizationSettingHistoryRegion @goModel(model: "github.com/theopenlane/core/pkg/enums.Region") { + AMER + EMEA + APAC +} +""" +OrganizationSettingHistoryWhereInput is used for filtering OrganizationSettingHistory objects. +Input was generated by ent. +""" +input OrganizationSettingHistoryWhereInput { + not: OrganizationSettingHistoryWhereInput + and: [OrganizationSettingHistoryWhereInput!] + or: [OrganizationSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrganizationSettingHistoryOpType + operationNEQ: OrganizationSettingHistoryOpType + operationIn: [OrganizationSettingHistoryOpType!] + operationNotIn: [OrganizationSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + billing_contact field predicates + """ + billingContact: String + billingContactNEQ: String + billingContactIn: [String!] + billingContactNotIn: [String!] + billingContactGT: String + billingContactGTE: String + billingContactLT: String + billingContactLTE: String + billingContactContains: String + billingContactHasPrefix: String + billingContactHasSuffix: String + billingContactIsNil: Boolean + billingContactNotNil: Boolean + billingContactEqualFold: String + billingContactContainsFold: String + """ + billing_email field predicates + """ + billingEmail: String + billingEmailNEQ: String + billingEmailIn: [String!] + billingEmailNotIn: [String!] + billingEmailGT: String + billingEmailGTE: String + billingEmailLT: String + billingEmailLTE: String + billingEmailContains: String + billingEmailHasPrefix: String + billingEmailHasSuffix: String + billingEmailIsNil: Boolean + billingEmailNotNil: Boolean + billingEmailEqualFold: String + billingEmailContainsFold: String + """ + billing_phone field predicates + """ + billingPhone: String + billingPhoneNEQ: String + billingPhoneIn: [String!] + billingPhoneNotIn: [String!] + billingPhoneGT: String + billingPhoneGTE: String + billingPhoneLT: String + billingPhoneLTE: String + billingPhoneContains: String + billingPhoneHasPrefix: String + billingPhoneHasSuffix: String + billingPhoneIsNil: Boolean + billingPhoneNotNil: Boolean + billingPhoneEqualFold: String + billingPhoneContainsFold: String + """ + billing_address field predicates + """ + billingAddress: String + billingAddressNEQ: String + billingAddressIn: [String!] + billingAddressNotIn: [String!] + billingAddressGT: String + billingAddressGTE: String + billingAddressLT: String + billingAddressLTE: String + billingAddressContains: String + billingAddressHasPrefix: String + billingAddressHasSuffix: String + billingAddressIsNil: Boolean + billingAddressNotNil: Boolean + billingAddressEqualFold: String + billingAddressContainsFold: String + """ + tax_identifier field predicates + """ + taxIdentifier: String + taxIdentifierNEQ: String + taxIdentifierIn: [String!] + taxIdentifierNotIn: [String!] + taxIdentifierGT: String + taxIdentifierGTE: String + taxIdentifierLT: String + taxIdentifierLTE: String + taxIdentifierContains: String + taxIdentifierHasPrefix: String + taxIdentifierHasSuffix: String + taxIdentifierIsNil: Boolean + taxIdentifierNotNil: Boolean + taxIdentifierEqualFold: String + taxIdentifierContainsFold: String + """ + geo_location field predicates + """ + geoLocation: OrganizationSettingHistoryRegion + geoLocationNEQ: OrganizationSettingHistoryRegion + geoLocationIn: [OrganizationSettingHistoryRegion!] + geoLocationNotIn: [OrganizationSettingHistoryRegion!] + geoLocationIsNil: Boolean + geoLocationNotNil: Boolean + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDIsNil: Boolean + organizationIDNotNil: Boolean + organizationIDEqualFold: String + organizationIDContainsFold: String +} +""" +OrganizationSettingRegion is enum for the field geo_location +""" +enum OrganizationSettingRegion @goModel(model: "github.com/theopenlane/core/pkg/enums.Region") { + AMER + EMEA + APAC +} +""" +OrganizationSettingWhereInput is used for filtering OrganizationSetting objects. +Input was generated by ent. +""" +input OrganizationSettingWhereInput { + not: OrganizationSettingWhereInput + and: [OrganizationSettingWhereInput!] + or: [OrganizationSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + billing_contact field predicates + """ + billingContact: String + billingContactNEQ: String + billingContactIn: [String!] + billingContactNotIn: [String!] + billingContactGT: String + billingContactGTE: String + billingContactLT: String + billingContactLTE: String + billingContactContains: String + billingContactHasPrefix: String + billingContactHasSuffix: String + billingContactIsNil: Boolean + billingContactNotNil: Boolean + billingContactEqualFold: String + billingContactContainsFold: String + """ + billing_email field predicates + """ + billingEmail: String + billingEmailNEQ: String + billingEmailIn: [String!] + billingEmailNotIn: [String!] + billingEmailGT: String + billingEmailGTE: String + billingEmailLT: String + billingEmailLTE: String + billingEmailContains: String + billingEmailHasPrefix: String + billingEmailHasSuffix: String + billingEmailIsNil: Boolean + billingEmailNotNil: Boolean + billingEmailEqualFold: String + billingEmailContainsFold: String + """ + billing_phone field predicates + """ + billingPhone: String + billingPhoneNEQ: String + billingPhoneIn: [String!] + billingPhoneNotIn: [String!] + billingPhoneGT: String + billingPhoneGTE: String + billingPhoneLT: String + billingPhoneLTE: String + billingPhoneContains: String + billingPhoneHasPrefix: String + billingPhoneHasSuffix: String + billingPhoneIsNil: Boolean + billingPhoneNotNil: Boolean + billingPhoneEqualFold: String + billingPhoneContainsFold: String + """ + billing_address field predicates + """ + billingAddress: String + billingAddressNEQ: String + billingAddressIn: [String!] + billingAddressNotIn: [String!] + billingAddressGT: String + billingAddressGTE: String + billingAddressLT: String + billingAddressLTE: String + billingAddressContains: String + billingAddressHasPrefix: String + billingAddressHasSuffix: String + billingAddressIsNil: Boolean + billingAddressNotNil: Boolean + billingAddressEqualFold: String + billingAddressContainsFold: String + """ + tax_identifier field predicates + """ + taxIdentifier: String + taxIdentifierNEQ: String + taxIdentifierIn: [String!] + taxIdentifierNotIn: [String!] + taxIdentifierGT: String + taxIdentifierGTE: String + taxIdentifierLT: String + taxIdentifierLTE: String + taxIdentifierContains: String + taxIdentifierHasPrefix: String + taxIdentifierHasSuffix: String + taxIdentifierIsNil: Boolean + taxIdentifierNotNil: Boolean + taxIdentifierEqualFold: String + taxIdentifierContainsFold: String + """ + geo_location field predicates + """ + geoLocation: OrganizationSettingRegion + geoLocationNEQ: OrganizationSettingRegion + geoLocationIn: [OrganizationSettingRegion!] + geoLocationNotIn: [OrganizationSettingRegion!] + geoLocationIsNil: Boolean + geoLocationNotNil: Boolean + """ + organization_id field predicates + """ + organizationID: ID + organizationIDNEQ: ID + organizationIDIn: [ID!] + organizationIDNotIn: [ID!] + organizationIDGT: ID + organizationIDGTE: ID + organizationIDLT: ID + organizationIDLTE: ID + organizationIDContains: ID + organizationIDHasPrefix: ID + organizationIDHasSuffix: ID + organizationIDIsNil: Boolean + organizationIDNotNil: Boolean + organizationIDEqualFold: ID + organizationIDContainsFold: ID + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] +} +""" +OrganizationWhereInput is used for filtering Organization objects. +Input was generated by ent. +""" +input OrganizationWhereInput { + not: OrganizationWhereInput + and: [OrganizationWhereInput!] + or: [OrganizationWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + parent_organization_id field predicates + """ + parentOrganizationID: ID + parentOrganizationIDNEQ: ID + parentOrganizationIDIn: [ID!] + parentOrganizationIDNotIn: [ID!] + parentOrganizationIDGT: ID + parentOrganizationIDGTE: ID + parentOrganizationIDLT: ID + parentOrganizationIDLTE: ID + parentOrganizationIDContains: ID + parentOrganizationIDHasPrefix: ID + parentOrganizationIDHasSuffix: ID + parentOrganizationIDIsNil: Boolean + parentOrganizationIDNotNil: Boolean + parentOrganizationIDEqualFold: ID + parentOrganizationIDContainsFold: ID + """ + personal_org field predicates + """ + personalOrg: Boolean + personalOrgNEQ: Boolean + personalOrgIsNil: Boolean + personalOrgNotNil: Boolean + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + parent edge predicates + """ + hasParent: Boolean + hasParentWith: [OrganizationWhereInput!] + """ + children edge predicates + """ + hasChildren: Boolean + hasChildrenWith: [OrganizationWhereInput!] + """ + groups edge predicates + """ + hasGroups: Boolean + hasGroupsWith: [GroupWhereInput!] + """ + templates edge predicates + """ + hasTemplates: Boolean + hasTemplatesWith: [TemplateWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [OrganizationSettingWhereInput!] + """ + documentdata edge predicates + """ + hasDocumentdata: Boolean + hasDocumentdataWith: [DocumentDataWhereInput!] + """ + entitlements edge predicates + """ + hasEntitlements: Boolean + hasEntitlementsWith: [EntitlementWhereInput!] + """ + organization_entitlement edge predicates + """ + hasOrganizationEntitlement: Boolean + hasOrganizationEntitlementWith: [EntitlementWhereInput!] + """ + personal_access_tokens edge predicates + """ + hasPersonalAccessTokens: Boolean + hasPersonalAccessTokensWith: [PersonalAccessTokenWhereInput!] + """ + api_tokens edge predicates + """ + hasAPITokens: Boolean + hasAPITokensWith: [APITokenWhereInput!] + """ + oauthprovider edge predicates + """ + hasOauthprovider: Boolean + hasOauthproviderWith: [OauthProviderWhereInput!] + """ + users edge predicates + """ + hasUsers: Boolean + hasUsersWith: [UserWhereInput!] + """ + invites edge predicates + """ + hasInvites: Boolean + hasInvitesWith: [InviteWhereInput!] + """ + subscribers edge predicates + """ + hasSubscribers: Boolean + hasSubscribersWith: [SubscriberWhereInput!] + """ + webhooks edge predicates + """ + hasWebhooks: Boolean + hasWebhooksWith: [WebhookWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + secrets edge predicates + """ + hasSecrets: Boolean + hasSecretsWith: [HushWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [FeatureWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + entitlementplans edge predicates + """ + hasEntitlementplans: Boolean + hasEntitlementplansWith: [EntitlementPlanWhereInput!] + """ + entitlementplanfeatures edge predicates + """ + hasEntitlementplanfeatures: Boolean + hasEntitlementplanfeaturesWith: [EntitlementPlanFeatureWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] + """ + entitytypes edge predicates + """ + hasEntitytypes: Boolean + hasEntitytypesWith: [EntityTypeWhereInput!] + """ + contacts edge predicates + """ + hasContacts: Boolean + hasContactsWith: [ContactWhereInput!] + """ + notes edge predicates + """ + hasNotes: Boolean + hasNotesWith: [NoteWhereInput!] + """ + members edge predicates + """ + hasMembers: Boolean + hasMembersWith: [OrgMembershipWhereInput!] +} +""" +Information about pagination in a connection. +https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + """ + When paginating backwards, the cursor to continue. + """ + startCursor: Cursor + """ + When paginating forwards, the cursor to continue. + """ + endCursor: Cursor +} +type PersonalAccessToken implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + token: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + owner: User! + """ + the organization(s) the token is associated with + """ + organizations: [Organization!] + events: [Event!] +} +""" +A connection to a list of items. +""" +type PersonalAccessTokenConnection { + """ + A list of edges. + """ + edges: [PersonalAccessTokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type PersonalAccessTokenEdge { + """ + The item at the end of the edge. + """ + node: PersonalAccessToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +PersonalAccessTokenWhereInput is used for filtering PersonalAccessToken objects. +Input was generated by ent. +""" +input PersonalAccessTokenWhereInput { + not: PersonalAccessTokenWhereInput + and: [PersonalAccessTokenWhereInput!] + or: [PersonalAccessTokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + last_used_at field predicates + """ + lastUsedAt: Time + lastUsedAtNEQ: Time + lastUsedAtIn: [Time!] + lastUsedAtNotIn: [Time!] + lastUsedAtGT: Time + lastUsedAtGTE: Time + lastUsedAtLT: Time + lastUsedAtLTE: Time + lastUsedAtIsNil: Boolean + lastUsedAtNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [UserWhereInput!] + """ + organizations edge predicates + """ + hasOrganizations: Boolean + hasOrganizationsWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Query { + """ + Fetches an object given its ID. + """ + node( + """ + ID of the object. + """ + id: ID! + ): Node + """ + Lookup nodes by a list of IDs. + """ + nodes( + """ + The list of node IDs. + """ + ids: [ID!]! + ): [Node]! + apiTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for APITokens returned from the connection. + """ + where: APITokenWhereInput + ): APITokenConnection! + contacts( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Contacts returned from the connection. + """ + where: ContactWhereInput + ): ContactConnection! + contactHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for ContactHistories returned from the connection. + """ + where: ContactHistoryWhereInput + ): ContactHistoryConnection! + documentDataSlice( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for DocumentDataSlice returned from the connection. + """ + where: DocumentDataWhereInput + ): DocumentDataConnection! + documentDataHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for DocumentDataHistories returned from the connection. + """ + where: DocumentDataHistoryWhereInput + ): DocumentDataHistoryConnection! + entitlements( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Entitlements returned from the connection. + """ + where: EntitlementWhereInput + ): EntitlementConnection! + entitlementHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementHistories returned from the connection. + """ + where: EntitlementHistoryWhereInput + ): EntitlementHistoryConnection! + entitlementPlans( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlans returned from the connection. + """ + where: EntitlementPlanWhereInput + ): EntitlementPlanConnection! + entitlementPlanFeatures( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanFeatures returned from the connection. + """ + where: EntitlementPlanFeatureWhereInput + ): EntitlementPlanFeatureConnection! + entitlementPlanFeatureHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanFeatureHistories returned from the connection. + """ + where: EntitlementPlanFeatureHistoryWhereInput + ): EntitlementPlanFeatureHistoryConnection! + entitlementPlanHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanHistories returned from the connection. + """ + where: EntitlementPlanHistoryWhereInput + ): EntitlementPlanHistoryConnection! + entities( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Entities returned from the connection. + """ + orderBy: EntityOrder + + """ + Filtering options for Entities returned from the connection. + """ + where: EntityWhereInput + ): EntityConnection! + entityHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityHistories returned from the connection. + """ + orderBy: EntityHistoryOrder + + """ + Filtering options for EntityHistories returned from the connection. + """ + where: EntityHistoryWhereInput + ): EntityHistoryConnection! + entityTypes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityTypes returned from the connection. + """ + orderBy: EntityTypeOrder + + """ + Filtering options for EntityTypes returned from the connection. + """ + where: EntityTypeWhereInput + ): EntityTypeConnection! + entityTypeHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityTypeHistories returned from the connection. + """ + orderBy: EntityTypeHistoryOrder + + """ + Filtering options for EntityTypeHistories returned from the connection. + """ + where: EntityTypeHistoryWhereInput + ): EntityTypeHistoryConnection! + events( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Events returned from the connection. + """ + where: EventWhereInput + ): EventConnection! + eventHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EventHistories returned from the connection. + """ + where: EventHistoryWhereInput + ): EventHistoryConnection! + features( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Features returned from the connection. + """ + where: FeatureWhereInput + ): FeatureConnection! + featureHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for FeatureHistories returned from the connection. + """ + where: FeatureHistoryWhereInput + ): FeatureHistoryConnection! + files( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Files returned from the connection. + """ + where: FileWhereInput + ): FileConnection! + fileHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for FileHistories returned from the connection. + """ + where: FileHistoryWhereInput + ): FileHistoryConnection! + groups( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Groups returned from the connection. + """ + orderBy: GroupOrder + + """ + Filtering options for Groups returned from the connection. + """ + where: GroupWhereInput + ): GroupConnection! + groupHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for GroupHistories returned from the connection. + """ + orderBy: GroupHistoryOrder + + """ + Filtering options for GroupHistories returned from the connection. + """ + where: GroupHistoryWhereInput + ): GroupHistoryConnection! + groupMemberships( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupMemberships returned from the connection. + """ + where: GroupMembershipWhereInput + ): GroupMembershipConnection! + groupMembershipHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupMembershipHistories returned from the connection. + """ + where: GroupMembershipHistoryWhereInput + ): GroupMembershipHistoryConnection! + groupSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupSettings returned from the connection. + """ + where: GroupSettingWhereInput + ): GroupSettingConnection! + groupSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupSettingHistories returned from the connection. + """ + where: GroupSettingHistoryWhereInput + ): GroupSettingHistoryConnection! + hushes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Hushes returned from the connection. + """ + orderBy: HushOrder + + """ + Filtering options for Hushes returned from the connection. + """ + where: HushWhereInput + ): HushConnection! + hushHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for HushHistories returned from the connection. + """ + orderBy: HushHistoryOrder + + """ + Filtering options for HushHistories returned from the connection. + """ + where: HushHistoryWhereInput + ): HushHistoryConnection! + integrations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Integrations returned from the connection. + """ + orderBy: IntegrationOrder + + """ + Filtering options for Integrations returned from the connection. + """ + where: IntegrationWhereInput + ): IntegrationConnection! + integrationHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for IntegrationHistories returned from the connection. + """ + orderBy: IntegrationHistoryOrder + + """ + Filtering options for IntegrationHistories returned from the connection. + """ + where: IntegrationHistoryWhereInput + ): IntegrationHistoryConnection! + invites( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Invites returned from the connection. + """ + where: InviteWhereInput + ): InviteConnection! + notes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Notes returned from the connection. + """ + where: NoteWhereInput + ): NoteConnection! + noteHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for NoteHistories returned from the connection. + """ + where: NoteHistoryWhereInput + ): NoteHistoryConnection! + oauthProviders( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OauthProviders returned from the connection. + """ + where: OauthProviderWhereInput + ): OauthProviderConnection! + oauthProviderHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OauthProviderHistories returned from the connection. + """ + where: OauthProviderHistoryWhereInput + ): OauthProviderHistoryConnection! + ohAuthTooTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OhAuthTooTokens returned from the connection. + """ + where: OhAuthTooTokenWhereInput + ): OhAuthTooTokenConnection! + orgMemberships( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrgMemberships returned from the connection. + """ + where: OrgMembershipWhereInput + ): OrgMembershipConnection! + orgMembershipHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrgMembershipHistories returned from the connection. + """ + where: OrgMembershipHistoryWhereInput + ): OrgMembershipHistoryConnection! + organizations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Organizations returned from the connection. + """ + orderBy: OrganizationOrder + + """ + Filtering options for Organizations returned from the connection. + """ + where: OrganizationWhereInput + ): OrganizationConnection! + organizationHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for OrganizationHistories returned from the connection. + """ + orderBy: OrganizationHistoryOrder + + """ + Filtering options for OrganizationHistories returned from the connection. + """ + where: OrganizationHistoryWhereInput + ): OrganizationHistoryConnection! + organizationSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrganizationSettings returned from the connection. + """ + where: OrganizationSettingWhereInput + ): OrganizationSettingConnection! + organizationSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrganizationSettingHistories returned from the connection. + """ + where: OrganizationSettingHistoryWhereInput + ): OrganizationSettingHistoryConnection! + personalAccessTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for PersonalAccessTokens returned from the connection. + """ + where: PersonalAccessTokenWhereInput + ): PersonalAccessTokenConnection! + subscribers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Subscribers returned from the connection. + """ + where: SubscriberWhereInput + ): SubscriberConnection! + tfaSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for TFASettings returned from the connection. + """ + where: TFASettingWhereInput + ): TFASettingConnection! + templates( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Templates returned from the connection. + """ + orderBy: TemplateOrder + + """ + Filtering options for Templates returned from the connection. + """ + where: TemplateWhereInput + ): TemplateConnection! + templateHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for TemplateHistories returned from the connection. + """ + orderBy: TemplateHistoryOrder + + """ + Filtering options for TemplateHistories returned from the connection. + """ + where: TemplateHistoryWhereInput + ): TemplateHistoryConnection! + users( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Users returned from the connection. + """ + orderBy: UserOrder + + """ + Filtering options for Users returned from the connection. + """ + where: UserWhereInput + ): UserConnection! + userHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for UserHistories returned from the connection. + """ + orderBy: UserHistoryOrder + + """ + Filtering options for UserHistories returned from the connection. + """ + where: UserHistoryWhereInput + ): UserHistoryConnection! + userSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for UserSettings returned from the connection. + """ + where: UserSettingWhereInput + ): UserSettingConnection! + userSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for UserSettingHistories returned from the connection. + """ + where: UserSettingHistoryWhereInput + ): UserSettingHistoryConnection! + webhooks( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Webhooks returned from the connection. + """ + orderBy: WebhookOrder + + """ + Filtering options for Webhooks returned from the connection. + """ + where: WebhookWhereInput + ): WebhookConnection! + webhookHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for WebhookHistories returned from the connection. + """ + orderBy: WebhookHistoryOrder + + """ + Filtering options for WebhookHistories returned from the connection. + """ + where: WebhookHistoryWhereInput + ): WebhookHistoryConnection! +} +type Subscriber implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + email address of the subscriber + """ + email: String! + """ + phone number of the subscriber + """ + phoneNumber: String + """ + indicates if the email address has been verified + """ + verifiedEmail: Boolean! + """ + indicates if the phone number has been verified + """ + verifiedPhone: Boolean! + """ + indicates if the subscriber is active or not, active users will have at least one verified contact method + """ + active: Boolean! + owner: Organization + events: [Event!] +} +""" +A connection to a list of items. +""" +type SubscriberConnection { + """ + A list of edges. + """ + edges: [SubscriberEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type SubscriberEdge { + """ + The item at the end of the edge. + """ + node: Subscriber + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +SubscriberWhereInput is used for filtering Subscriber objects. +Input was generated by ent. +""" +input SubscriberWhereInput { + not: SubscriberWhereInput + and: [SubscriberWhereInput!] + or: [SubscriberWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + verified_email field predicates + """ + verifiedEmail: Boolean + verifiedEmailNEQ: Boolean + """ + verified_phone field predicates + """ + verifiedPhone: Boolean + verifiedPhoneNEQ: Boolean + """ + active field predicates + """ + active: Boolean + activeNEQ: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type TFASetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + TFA secret for the user + """ + tfaSecret: String + """ + specifies if the TFA device has been verified + """ + verified: Boolean! + """ + recovery codes for 2fa + """ + recoveryCodes: [String!] + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + owner: User +} +""" +A connection to a list of items. +""" +type TFASettingConnection { + """ + A list of edges. + """ + edges: [TFASettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type TFASettingEdge { + """ + The item at the end of the edge. + """ + node: TFASetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +TFASettingWhereInput is used for filtering TFASetting objects. +Input was generated by ent. +""" +input TFASettingWhereInput { + not: TFASettingWhereInput + and: [TFASettingWhereInput!] + or: [TFASettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + tfa_secret field predicates + """ + tfaSecret: String + tfaSecretNEQ: String + tfaSecretIn: [String!] + tfaSecretNotIn: [String!] + tfaSecretGT: String + tfaSecretGTE: String + tfaSecretLT: String + tfaSecretLTE: String + tfaSecretContains: String + tfaSecretHasPrefix: String + tfaSecretHasSuffix: String + tfaSecretIsNil: Boolean + tfaSecretNotNil: Boolean + tfaSecretEqualFold: String + tfaSecretContainsFold: String + """ + verified field predicates + """ + verified: Boolean + verifiedNEQ: Boolean + """ + totp_allowed field predicates + """ + totpAllowed: Boolean + totpAllowedNEQ: Boolean + totpAllowedIsNil: Boolean + totpAllowedNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [UserWhereInput!] +} +type Template implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType! + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON + owner: Organization + documents: [DocumentData!] +} +""" +A connection to a list of items. +""" +type TemplateConnection { + """ + A list of edges. + """ + edges: [TemplateEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +TemplateDocumentType is enum for the field template_type +""" +enum TemplateDocumentType @goModel(model: "github.com/theopenlane/core/pkg/enums.DocumentType") { + ROOTTEMPLATE + DOCUMENT +} +""" +An edge in a connection. +""" +type TemplateEdge { + """ + The item at the end of the edge. + """ + node: Template + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type TemplateHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: TemplateHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateHistoryDocumentType! + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON +} +""" +A connection to a list of items. +""" +type TemplateHistoryConnection { + """ + A list of edges. + """ + edges: [TemplateHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +TemplateHistoryDocumentType is enum for the field template_type +""" +enum TemplateHistoryDocumentType @goModel(model: "github.com/theopenlane/core/pkg/enums.DocumentType") { + ROOTTEMPLATE + DOCUMENT +} +""" +An edge in a connection. +""" +type TemplateHistoryEdge { + """ + The item at the end of the edge. + """ + node: TemplateHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +TemplateHistoryOpType is enum for the field operation +""" +enum TemplateHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for TemplateHistory connections +""" +input TemplateHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order TemplateHistories. + """ + field: TemplateHistoryOrderField! +} +""" +Properties by which TemplateHistory connections can be ordered. +""" +enum TemplateHistoryOrderField { + name +} +""" +TemplateHistoryWhereInput is used for filtering TemplateHistory objects. +Input was generated by ent. +""" +input TemplateHistoryWhereInput { + not: TemplateHistoryWhereInput + and: [TemplateHistoryWhereInput!] + or: [TemplateHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: TemplateHistoryOpType + operationNEQ: TemplateHistoryOpType + operationIn: [TemplateHistoryOpType!] + operationNotIn: [TemplateHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + template_type field predicates + """ + templateType: TemplateHistoryDocumentType + templateTypeNEQ: TemplateHistoryDocumentType + templateTypeIn: [TemplateHistoryDocumentType!] + templateTypeNotIn: [TemplateHistoryDocumentType!] + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String +} +""" +Ordering options for Template connections +""" +input TemplateOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Templates. + """ + field: TemplateOrderField! +} +""" +Properties by which Template connections can be ordered. +""" +enum TemplateOrderField { + name +} +""" +TemplateWhereInput is used for filtering Template objects. +Input was generated by ent. +""" +input TemplateWhereInput { + not: TemplateWhereInput + and: [TemplateWhereInput!] + or: [TemplateWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + template_type field predicates + """ + templateType: TemplateDocumentType + templateTypeNEQ: TemplateDocumentType + templateTypeIn: [TemplateDocumentType!] + templateTypeNotIn: [TemplateDocumentType!] + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + documents edge predicates + """ + hasDocuments: Boolean + hasDocumentsWith: [DocumentDataWhereInput!] +} +""" +The builtin Time type +""" +scalar Time +""" +The builtin Uint type +""" +scalar Uint +""" +UpdateAPITokenInput is used for update APIToken object. +Input was generated by ent. +""" +input UpdateAPITokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name associated with the token + """ + name: String + """ + a description of the token's purpose + """ + description: String + clearDescription: Boolean + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + lastUsedAt: Time + clearLastUsedAt: Boolean + ownerID: ID + clearOwner: Boolean +} +""" +UpdateContactInput is used for update Contact object. +Input was generated by ent. +""" +input UpdateContactInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the full name of the contact + """ + fullName: String + """ + the title of the contact + """ + title: String + clearTitle: Boolean + """ + the company of the contact + """ + company: String + clearCompany: Boolean + """ + the email of the contact + """ + email: String + clearEmail: Boolean + """ + the phone number of the contact + """ + phoneNumber: String + clearPhoneNumber: Boolean + """ + the address of the contact + """ + address: String + clearAddress: Boolean + """ + status of the contact + """ + status: ContactUserStatus + ownerID: ID + clearOwner: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean +} +""" +UpdateDocumentDataInput is used for update DocumentData object. +Input was generated by ent. +""" +input UpdateDocumentDataInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the json data of the document + """ + data: JSON + ownerID: ID + clearOwner: Boolean + templateID: ID + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntity: Boolean +} +""" +UpdateEntitlementInput is used for update Entitlement object. +Input was generated by ent. +""" +input UpdateEntitlementInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + clearExternalCustomerID: Boolean + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + clearExternalSubscriptionID: Boolean + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + clearExpiresAt: Boolean + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntitlementPlanFeatureInput is used for update EntitlementPlanFeature object. +Input was generated by ent. +""" +input UpdateEntitlementPlanFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntitlementPlanInput is used for update EntitlementPlan object. +Input was generated by ent. +""" +input UpdateEntitlementPlanInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the displayed 'friendly' name of the plan + """ + displayName: String + clearDisplayName: Boolean + """ + a description of the plan + """ + description: String + clearDescription: Boolean + """ + metadata for the plan + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlements: Boolean + addBaseFeatureIDs: [ID!] + removeBaseFeatureIDs: [ID!] + clearBaseFeatures: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntityInput is used for update Entity object. +Input was generated by ent. +""" +input UpdateEntityInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the entity + """ + name: String + clearName: Boolean + """ + The entity's displayed 'friendly' name + """ + displayName: String + clearDisplayName: Boolean + """ + An optional description of the entity + """ + description: String + clearDescription: Boolean + """ + domains associated with the entity + """ + domains: [String!] + appendDomains: [String!] + clearDomains: Boolean + """ + status of the entity + """ + status: String + clearStatus: Boolean + ownerID: ID + clearOwner: Boolean + addContactIDs: [ID!] + removeContactIDs: [ID!] + clearContacts: Boolean + addDocumentIDs: [ID!] + removeDocumentIDs: [ID!] + clearDocuments: Boolean + addNoteIDs: [ID!] + removeNoteIDs: [ID!] + clearNotes: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + entityTypeID: ID + clearEntityType: Boolean +} +""" +UpdateEntityTypeInput is used for update EntityType object. +Input was generated by ent. +""" +input UpdateEntityTypeInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the entity + """ + name: String + ownerID: ID + clearOwner: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean +} +""" +UpdateEventInput is used for update Event object. +Input was generated by ent. +""" +input UpdateEventInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + eventID: String + clearEventID: Boolean + correlationID: String + clearCorrelationID: Boolean + eventType: String + metadata: Map + clearMetadata: Boolean + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUser: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroup: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegration: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addInviteIDs: [ID!] + removeInviteIDs: [ID!] + clearInvite: Boolean + addFeatureIDs: [ID!] + removeFeatureIDs: [ID!] + clearFeature: Boolean + addEntitlementplanIDs: [ID!] + removeEntitlementplanIDs: [ID!] + clearEntitlementplan: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessToken: Boolean + addOauth2tokenIDs: [ID!] + removeOauth2tokenIDs: [ID!] + clearOauth2token: Boolean + addHushIDs: [ID!] + removeHushIDs: [ID!] + clearHush: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlement: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhook: Boolean + addSubscriberIDs: [ID!] + removeSubscriberIDs: [ID!] + clearSubscriber: Boolean +} +""" +UpdateFeatureInput is used for update Feature object. +Input was generated by ent. +""" +input UpdateFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the displayed 'friendly' name of the feature + """ + displayName: String + clearDisplayName: Boolean + """ + enabled features are available for use + """ + enabled: Boolean + """ + a description of the feature + """ + description: String + clearDescription: Boolean + """ + metadata for the feature + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addPlanIDs: [ID!] + removePlanIDs: [ID!] + clearPlans: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateFileInput is used for update File object. +Input was generated by ent. +""" +input UpdateFileInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + fileName: String + fileExtension: String + fileSize: Int + clearFileSize: Boolean + contentType: String + storeKey: String + category: String + clearCategory: Boolean + annotation: String + clearAnnotation: Boolean + userID: ID + clearUser: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntity: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroup: Boolean +} +""" +UpdateGroupInput is used for update Group object. +Input was generated by ent. +""" +input UpdateGroupInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the group - must be unique within the organization + """ + name: String + """ + the groups description + """ + description: String + clearDescription: Boolean + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + clearGravatarLogoURL: Boolean + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + clearLogoURL: Boolean + """ + The group's displayed 'friendly' name + """ + displayName: String + ownerID: ID + clearOwner: Boolean + settingID: ID + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUsers: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean +} +""" +UpdateGroupMembershipInput is used for update GroupMembership object. +Input was generated by ent. +""" +input UpdateGroupMembershipInput { + role: GroupMembershipRole + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateGroupSettingInput is used for update GroupSetting object. +Input was generated by ent. +""" +input UpdateGroupSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + clearSyncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + clearSyncToGithub: Boolean + groupID: ID + clearGroup: Boolean +} +""" +UpdateHushInput is used for update Hush object. +Input was generated by ent. +""" +input UpdateHushInput { + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + clearDescription: Boolean + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + clearKind: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateIntegrationInput is used for update Integration object. +Input was generated by ent. +""" +input UpdateIntegrationInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the integration - must be unique within the organization + """ + name: String + """ + a description of the integration + """ + description: String + clearDescription: Boolean + kind: String + clearKind: Boolean + ownerID: ID + clearOwner: Boolean + addSecretIDs: [ID!] + removeSecretIDs: [ID!] + clearSecrets: Boolean + addOauth2tokenIDs: [ID!] + removeOauth2tokenIDs: [ID!] + clearOauth2tokens: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhooks: Boolean +} +""" +UpdateInviteInput is used for update Invite object. +Input was generated by ent. +""" +input UpdateInviteInput { + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + clearExpires: Boolean + """ + the status of the invitation + """ + status: InviteInviteStatus + role: InviteRole + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateNoteInput is used for update Note object. +Input was generated by ent. +""" +input UpdateNoteInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the text of the note + """ + text: String + ownerID: ID + clearOwner: Boolean + entityID: ID + clearEntity: Boolean +} +""" +UpdateOauthProviderInput is used for update OauthProvider object. +Input was generated by ent. +""" +input UpdateOauthProviderInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the oauth provider's name + """ + name: String + """ + the client id for the oauth provider + """ + clientID: String + """ + the client secret + """ + clientSecret: String + """ + the redirect url + """ + redirectURL: String + """ + the scopes + """ + scopes: String + """ + the auth url of the provider + """ + authURL: String + """ + the token url of the provider + """ + tokenURL: String + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint + """ + the URL to request user information by token + """ + infoURL: String + ownerID: ID + clearOwner: Boolean +} +""" +UpdateOhAuthTooTokenInput is used for update OhAuthTooToken object. +Input was generated by ent. +""" +input UpdateOhAuthTooTokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + clientID: String + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + nonce: String + claimsUserID: String + claimsUsername: String + claimsEmail: String + claimsEmailVerified: Boolean + claimsGroups: [String!] + appendClaimsGroups: [String!] + clearClaimsGroups: Boolean + claimsPreferredUsername: String + connectorID: String + connectorData: [String!] + appendConnectorData: [String!] + clearConnectorData: Boolean + lastUsed: Time + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegration: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateOrgMembershipInput is used for update OrgMembership object. +Input was generated by ent. +""" +input UpdateOrgMembershipInput { + role: OrgMembershipRole + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateOrganizationInput is used for update Organization object. +Input was generated by ent. +""" +input UpdateOrganizationInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the organization + """ + name: String + """ + The organization's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the organization + """ + description: String + clearDescription: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + clearAvatarRemoteURL: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroups: Boolean + addTemplateIDs: [ID!] + removeTemplateIDs: [ID!] + clearTemplates: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + settingID: ID + clearSetting: Boolean + addDocumentdatumIDs: [ID!] + removeDocumentdatumIDs: [ID!] + clearDocumentdata: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlements: Boolean + addOrganizationEntitlementIDs: [ID!] + removeOrganizationEntitlementIDs: [ID!] + clearOrganizationEntitlement: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessTokens: Boolean + addAPITokenIDs: [ID!] + removeAPITokenIDs: [ID!] + clearAPITokens: Boolean + addOauthproviderIDs: [ID!] + removeOauthproviderIDs: [ID!] + clearOauthprovider: Boolean + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUsers: Boolean + addInviteIDs: [ID!] + removeInviteIDs: [ID!] + clearInvites: Boolean + addSubscriberIDs: [ID!] + removeSubscriberIDs: [ID!] + clearSubscribers: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhooks: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addSecretIDs: [ID!] + removeSecretIDs: [ID!] + clearSecrets: Boolean + addFeatureIDs: [ID!] + removeFeatureIDs: [ID!] + clearFeatures: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + addEntitlementplanIDs: [ID!] + removeEntitlementplanIDs: [ID!] + clearEntitlementplans: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean + addEntitytypeIDs: [ID!] + removeEntitytypeIDs: [ID!] + clearEntitytypes: Boolean + addContactIDs: [ID!] + removeContactIDs: [ID!] + clearContacts: Boolean + addNoteIDs: [ID!] + removeNoteIDs: [ID!] + clearNotes: Boolean +} +""" +UpdateOrganizationSettingInput is used for update OrganizationSetting object. +Input was generated by ent. +""" +input UpdateOrganizationSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + domains associated with the organization + """ + domains: [String!] + appendDomains: [String!] + clearDomains: Boolean + """ + Name of the person to contact for billing + """ + billingContact: String + clearBillingContact: Boolean + """ + Email address of the person to contact for billing + """ + billingEmail: String + clearBillingEmail: Boolean + """ + Phone number to contact for billing + """ + billingPhone: String + clearBillingPhone: Boolean + """ + Address to send billing information to + """ + billingAddress: String + clearBillingAddress: Boolean + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + clearTaxIdentifier: Boolean + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + clearGeoLocation: Boolean + organizationID: ID + clearOrganization: Boolean +} +""" +UpdatePersonalAccessTokenInput is used for update PersonalAccessToken object. +Input was generated by ent. +""" +input UpdatePersonalAccessTokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name associated with the token + """ + name: String + """ + a description of the token's purpose + """ + description: String + clearDescription: Boolean + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + lastUsedAt: Time + clearLastUsedAt: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganizations: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateSubscriberInput is used for update Subscriber object. +Input was generated by ent. +""" +input UpdateSubscriberInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + email address of the subscriber + """ + email: String + """ + phone number of the subscriber + """ + phoneNumber: String + clearPhoneNumber: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateTFASettingInput is used for update TFASetting object. +Input was generated by ent. +""" +input UpdateTFASettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + specifies if the TFA device has been verified + """ + verified: Boolean + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + clearTotpAllowed: Boolean +} +""" +UpdateTemplateInput is used for update Template object. +Input was generated by ent. +""" +input UpdateTemplateInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the template + """ + name: String + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType + """ + the description of the template + """ + description: String + clearDescription: Boolean + """ + the jsonschema object of the template + """ + jsonconfig: JSON + """ + the uischema for the template to render in the UI + """ + uischema: JSON + clearUischema: Boolean + ownerID: ID + clearOwner: Boolean + addDocumentIDs: [ID!] + removeDocumentIDs: [ID!] + clearDocuments: Boolean +} +""" +UpdateUserInput is used for update User object. +Input was generated by ent. +""" +input UpdateUserInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + email: String + firstName: String + clearFirstName: Boolean + lastName: String + clearLastName: Boolean + """ + The user's displayed 'friendly' name + """ + displayName: String + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + clearAvatarRemoteURL: Boolean + """ + The user's local avatar file + """ + avatarLocalFile: String + clearAvatarLocalFile: Boolean + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + clearAvatarUpdatedAt: Boolean + """ + the time the user was last seen + """ + lastSeen: Time + clearLastSeen: Boolean + """ + user password hash + """ + password: String + clearPassword: Boolean + """ + the Subject of the user JWT + """ + sub: String + clearSub: Boolean + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider + """ + the user's role + """ + role: UserRole + clearRole: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessTokens: Boolean + addTfaSettingIDs: [ID!] + removeTfaSettingIDs: [ID!] + clearTfaSettings: Boolean + settingID: ID + addEmailVerificationTokenIDs: [ID!] + removeEmailVerificationTokenIDs: [ID!] + clearEmailVerificationTokens: Boolean + addPasswordResetTokenIDs: [ID!] + removePasswordResetTokenIDs: [ID!] + clearPasswordResetTokens: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroups: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganizations: Boolean + addWebauthnIDs: [ID!] + removeWebauthnIDs: [ID!] + clearWebauthn: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateUserSettingInput is used for update UserSetting object. +Input was generated by ent. +""" +input UpdateUserSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + clearSilencedAt: Boolean + """ + The time the user was suspended + """ + suspendedAt: Time + clearSuspendedAt: Boolean + """ + status of the user account + """ + status: UserSettingUserStatus + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + clearIsWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + clearIsTfaEnabled: Boolean + userID: ID + clearUser: Boolean + defaultOrgID: ID + clearDefaultOrg: Boolean +} +""" +UpdateWebhookInput is used for update Webhook object. +Input was generated by ent. +""" +input UpdateWebhookInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the webhook + """ + name: String + """ + a description of the webhook + """ + description: String + clearDescription: Boolean + """ + the url to send the webhook to + """ + destinationURL: String + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean + """ + the number of failures + """ + failures: Int + clearFailures: Boolean + """ + the last error message + """ + lastError: String + clearLastError: Boolean + """ + the last response + """ + lastResponse: String + clearLastResponse: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean +} +type User implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider! + """ + the user's role + """ + role: UserRole + personalAccessTokens: [PersonalAccessToken!] + tfaSettings: [TFASetting!] + setting: UserSetting! + groups: [Group!] + organizations: [Organization!] + files: [File!] + events: [Event!] + groupMemberships: [GroupMembership!] + orgMemberships: [OrgMembership!] +} +""" +UserAuthProvider is enum for the field auth_provider +""" +enum UserAuthProvider @goModel(model: "github.com/theopenlane/core/pkg/enums.AuthProvider") { + CREDENTIALS + GOOGLE + GITHUB + WEBAUTHN +} +""" +A connection to a list of items. +""" +type UserConnection { + """ + A list of edges. + """ + edges: [UserEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserEdge { + """ + The item at the end of the edge. + """ + node: User + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type UserHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: UserHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserHistoryAuthProvider! + """ + the user's role + """ + role: UserHistoryRole +} +""" +UserHistoryAuthProvider is enum for the field auth_provider +""" +enum UserHistoryAuthProvider @goModel(model: "github.com/theopenlane/core/pkg/enums.AuthProvider") { + CREDENTIALS + GOOGLE + GITHUB + WEBAUTHN +} +""" +A connection to a list of items. +""" +type UserHistoryConnection { + """ + A list of edges. + """ + edges: [UserHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserHistoryEdge { + """ + The item at the end of the edge. + """ + node: UserHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +UserHistoryOpType is enum for the field operation +""" +enum UserHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for UserHistory connections +""" +input UserHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order UserHistories. + """ + field: UserHistoryOrderField! +} +""" +Properties by which UserHistory connections can be ordered. +""" +enum UserHistoryOrderField { + first_name + last_name + display_name +} +""" +UserHistoryRole is enum for the field role +""" +enum UserHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +UserHistoryWhereInput is used for filtering UserHistory objects. +Input was generated by ent. +""" +input UserHistoryWhereInput { + not: UserHistoryWhereInput + and: [UserHistoryWhereInput!] + or: [UserHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: UserHistoryOpType + operationNEQ: UserHistoryOpType + operationIn: [UserHistoryOpType!] + operationNotIn: [UserHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + first_name field predicates + """ + firstName: String + firstNameNEQ: String + firstNameIn: [String!] + firstNameNotIn: [String!] + firstNameGT: String + firstNameGTE: String + firstNameLT: String + firstNameLTE: String + firstNameContains: String + firstNameHasPrefix: String + firstNameHasSuffix: String + firstNameIsNil: Boolean + firstNameNotNil: Boolean + firstNameEqualFold: String + firstNameContainsFold: String + """ + last_name field predicates + """ + lastName: String + lastNameNEQ: String + lastNameIn: [String!] + lastNameNotIn: [String!] + lastNameGT: String + lastNameGTE: String + lastNameLT: String + lastNameLTE: String + lastNameContains: String + lastNameHasPrefix: String + lastNameHasSuffix: String + lastNameIsNil: Boolean + lastNameNotNil: Boolean + lastNameEqualFold: String + lastNameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + avatar_local_file field predicates + """ + avatarLocalFile: String + avatarLocalFileNEQ: String + avatarLocalFileIn: [String!] + avatarLocalFileNotIn: [String!] + avatarLocalFileGT: String + avatarLocalFileGTE: String + avatarLocalFileLT: String + avatarLocalFileLTE: String + avatarLocalFileContains: String + avatarLocalFileHasPrefix: String + avatarLocalFileHasSuffix: String + avatarLocalFileIsNil: Boolean + avatarLocalFileNotNil: Boolean + avatarLocalFileEqualFold: String + avatarLocalFileContainsFold: String + """ + avatar_updated_at field predicates + """ + avatarUpdatedAt: Time + avatarUpdatedAtNEQ: Time + avatarUpdatedAtIn: [Time!] + avatarUpdatedAtNotIn: [Time!] + avatarUpdatedAtGT: Time + avatarUpdatedAtGTE: Time + avatarUpdatedAtLT: Time + avatarUpdatedAtLTE: Time + avatarUpdatedAtIsNil: Boolean + avatarUpdatedAtNotNil: Boolean + """ + last_seen field predicates + """ + lastSeen: Time + lastSeenNEQ: Time + lastSeenIn: [Time!] + lastSeenNotIn: [Time!] + lastSeenGT: Time + lastSeenGTE: Time + lastSeenLT: Time + lastSeenLTE: Time + lastSeenIsNil: Boolean + lastSeenNotNil: Boolean + """ + sub field predicates + """ + sub: String + subNEQ: String + subIn: [String!] + subNotIn: [String!] + subGT: String + subGTE: String + subLT: String + subLTE: String + subContains: String + subHasPrefix: String + subHasSuffix: String + subIsNil: Boolean + subNotNil: Boolean + subEqualFold: String + subContainsFold: String + """ + auth_provider field predicates + """ + authProvider: UserHistoryAuthProvider + authProviderNEQ: UserHistoryAuthProvider + authProviderIn: [UserHistoryAuthProvider!] + authProviderNotIn: [UserHistoryAuthProvider!] + """ + role field predicates + """ + role: UserHistoryRole + roleNEQ: UserHistoryRole + roleIn: [UserHistoryRole!] + roleNotIn: [UserHistoryRole!] + roleIsNil: Boolean + roleNotNil: Boolean +} +""" +Ordering options for User connections +""" +input UserOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Users. + """ + field: UserOrderField! +} +""" +Properties by which User connections can be ordered. +""" +enum UserOrderField { + first_name + last_name + display_name +} +""" +UserRole is enum for the field role +""" +enum UserRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +type UserSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + userID: ID + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean! + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingUserStatus! + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean! + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + user: User + """ + organization to load on user login + """ + defaultOrg: Organization +} +""" +A connection to a list of items. +""" +type UserSettingConnection { + """ + A list of edges. + """ + edges: [UserSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserSettingEdge { + """ + The item at the end of the edge. + """ + node: UserSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type UserSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: UserSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + userID: String + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean! + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingHistoryUserStatus! + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean! + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean +} +""" +A connection to a list of items. +""" +type UserSettingHistoryConnection { + """ + A list of edges. + """ + edges: [UserSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: UserSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +UserSettingHistoryOpType is enum for the field operation +""" +enum UserSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +UserSettingHistoryUserStatus is enum for the field status +""" +enum UserSettingHistoryUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +UserSettingHistoryWhereInput is used for filtering UserSettingHistory objects. +Input was generated by ent. +""" +input UserSettingHistoryWhereInput { + not: UserSettingHistoryWhereInput + and: [UserSettingHistoryWhereInput!] + or: [UserSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: UserSettingHistoryOpType + operationNEQ: UserSettingHistoryOpType + operationIn: [UserSettingHistoryOpType!] + operationNotIn: [UserSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDIsNil: Boolean + userIDNotNil: Boolean + userIDEqualFold: String + userIDContainsFold: String + """ + locked field predicates + """ + locked: Boolean + lockedNEQ: Boolean + """ + silenced_at field predicates + """ + silencedAt: Time + silencedAtNEQ: Time + silencedAtIn: [Time!] + silencedAtNotIn: [Time!] + silencedAtGT: Time + silencedAtGTE: Time + silencedAtLT: Time + silencedAtLTE: Time + silencedAtIsNil: Boolean + silencedAtNotNil: Boolean + """ + suspended_at field predicates + """ + suspendedAt: Time + suspendedAtNEQ: Time + suspendedAtIn: [Time!] + suspendedAtNotIn: [Time!] + suspendedAtGT: Time + suspendedAtGTE: Time + suspendedAtLT: Time + suspendedAtLTE: Time + suspendedAtIsNil: Boolean + suspendedAtNotNil: Boolean + """ + status field predicates + """ + status: UserSettingHistoryUserStatus + statusNEQ: UserSettingHistoryUserStatus + statusIn: [UserSettingHistoryUserStatus!] + statusNotIn: [UserSettingHistoryUserStatus!] + """ + email_confirmed field predicates + """ + emailConfirmed: Boolean + emailConfirmedNEQ: Boolean + """ + is_webauthn_allowed field predicates + """ + isWebauthnAllowed: Boolean + isWebauthnAllowedNEQ: Boolean + isWebauthnAllowedIsNil: Boolean + isWebauthnAllowedNotNil: Boolean + """ + is_tfa_enabled field predicates + """ + isTfaEnabled: Boolean + isTfaEnabledNEQ: Boolean + isTfaEnabledIsNil: Boolean + isTfaEnabledNotNil: Boolean +} +""" +UserSettingUserStatus is enum for the field status +""" +enum UserSettingUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +UserSettingWhereInput is used for filtering UserSetting objects. +Input was generated by ent. +""" +input UserSettingWhereInput { + not: UserSettingWhereInput + and: [UserSettingWhereInput!] + or: [UserSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + user_id field predicates + """ + userID: ID + userIDNEQ: ID + userIDIn: [ID!] + userIDNotIn: [ID!] + userIDGT: ID + userIDGTE: ID + userIDLT: ID + userIDLTE: ID + userIDContains: ID + userIDHasPrefix: ID + userIDHasSuffix: ID + userIDIsNil: Boolean + userIDNotNil: Boolean + userIDEqualFold: ID + userIDContainsFold: ID + """ + locked field predicates + """ + locked: Boolean + lockedNEQ: Boolean + """ + silenced_at field predicates + """ + silencedAt: Time + silencedAtNEQ: Time + silencedAtIn: [Time!] + silencedAtNotIn: [Time!] + silencedAtGT: Time + silencedAtGTE: Time + silencedAtLT: Time + silencedAtLTE: Time + silencedAtIsNil: Boolean + silencedAtNotNil: Boolean + """ + suspended_at field predicates + """ + suspendedAt: Time + suspendedAtNEQ: Time + suspendedAtIn: [Time!] + suspendedAtNotIn: [Time!] + suspendedAtGT: Time + suspendedAtGTE: Time + suspendedAtLT: Time + suspendedAtLTE: Time + suspendedAtIsNil: Boolean + suspendedAtNotNil: Boolean + """ + status field predicates + """ + status: UserSettingUserStatus + statusNEQ: UserSettingUserStatus + statusIn: [UserSettingUserStatus!] + statusNotIn: [UserSettingUserStatus!] + """ + email_confirmed field predicates + """ + emailConfirmed: Boolean + emailConfirmedNEQ: Boolean + """ + is_webauthn_allowed field predicates + """ + isWebauthnAllowed: Boolean + isWebauthnAllowedNEQ: Boolean + isWebauthnAllowedIsNil: Boolean + isWebauthnAllowedNotNil: Boolean + """ + is_tfa_enabled field predicates + """ + isTfaEnabled: Boolean + isTfaEnabledNEQ: Boolean + isTfaEnabledIsNil: Boolean + isTfaEnabledNotNil: Boolean + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + default_org edge predicates + """ + hasDefaultOrg: Boolean + hasDefaultOrgWith: [OrganizationWhereInput!] +} +""" +UserWhereInput is used for filtering User objects. +Input was generated by ent. +""" +input UserWhereInput { + not: UserWhereInput + and: [UserWhereInput!] + or: [UserWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + first_name field predicates + """ + firstName: String + firstNameNEQ: String + firstNameIn: [String!] + firstNameNotIn: [String!] + firstNameGT: String + firstNameGTE: String + firstNameLT: String + firstNameLTE: String + firstNameContains: String + firstNameHasPrefix: String + firstNameHasSuffix: String + firstNameIsNil: Boolean + firstNameNotNil: Boolean + firstNameEqualFold: String + firstNameContainsFold: String + """ + last_name field predicates + """ + lastName: String + lastNameNEQ: String + lastNameIn: [String!] + lastNameNotIn: [String!] + lastNameGT: String + lastNameGTE: String + lastNameLT: String + lastNameLTE: String + lastNameContains: String + lastNameHasPrefix: String + lastNameHasSuffix: String + lastNameIsNil: Boolean + lastNameNotNil: Boolean + lastNameEqualFold: String + lastNameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + avatar_local_file field predicates + """ + avatarLocalFile: String + avatarLocalFileNEQ: String + avatarLocalFileIn: [String!] + avatarLocalFileNotIn: [String!] + avatarLocalFileGT: String + avatarLocalFileGTE: String + avatarLocalFileLT: String + avatarLocalFileLTE: String + avatarLocalFileContains: String + avatarLocalFileHasPrefix: String + avatarLocalFileHasSuffix: String + avatarLocalFileIsNil: Boolean + avatarLocalFileNotNil: Boolean + avatarLocalFileEqualFold: String + avatarLocalFileContainsFold: String + """ + avatar_updated_at field predicates + """ + avatarUpdatedAt: Time + avatarUpdatedAtNEQ: Time + avatarUpdatedAtIn: [Time!] + avatarUpdatedAtNotIn: [Time!] + avatarUpdatedAtGT: Time + avatarUpdatedAtGTE: Time + avatarUpdatedAtLT: Time + avatarUpdatedAtLTE: Time + avatarUpdatedAtIsNil: Boolean + avatarUpdatedAtNotNil: Boolean + """ + last_seen field predicates + """ + lastSeen: Time + lastSeenNEQ: Time + lastSeenIn: [Time!] + lastSeenNotIn: [Time!] + lastSeenGT: Time + lastSeenGTE: Time + lastSeenLT: Time + lastSeenLTE: Time + lastSeenIsNil: Boolean + lastSeenNotNil: Boolean + """ + sub field predicates + """ + sub: String + subNEQ: String + subIn: [String!] + subNotIn: [String!] + subGT: String + subGTE: String + subLT: String + subLTE: String + subContains: String + subHasPrefix: String + subHasSuffix: String + subIsNil: Boolean + subNotNil: Boolean + subEqualFold: String + subContainsFold: String + """ + auth_provider field predicates + """ + authProvider: UserAuthProvider + authProviderNEQ: UserAuthProvider + authProviderIn: [UserAuthProvider!] + authProviderNotIn: [UserAuthProvider!] + """ + role field predicates + """ + role: UserRole + roleNEQ: UserRole + roleIn: [UserRole!] + roleNotIn: [UserRole!] + roleIsNil: Boolean + roleNotNil: Boolean + """ + personal_access_tokens edge predicates + """ + hasPersonalAccessTokens: Boolean + hasPersonalAccessTokensWith: [PersonalAccessTokenWhereInput!] + """ + tfa_settings edge predicates + """ + hasTfaSettings: Boolean + hasTfaSettingsWith: [TFASettingWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [UserSettingWhereInput!] + """ + groups edge predicates + """ + hasGroups: Boolean + hasGroupsWith: [GroupWhereInput!] + """ + organizations edge predicates + """ + hasOrganizations: Boolean + hasOrganizationsWith: [OrganizationWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + group_memberships edge predicates + """ + hasGroupMemberships: Boolean + hasGroupMembershipsWith: [GroupMembershipWhereInput!] + """ + org_memberships edge predicates + """ + hasOrgMemberships: Boolean + hasOrgMembershipsWith: [OrgMembershipWhereInput!] +} +type Webhook implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean! + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String + owner: Organization + events: [Event!] + integrations: [Integration!] +} +""" +A connection to a list of items. +""" +type WebhookConnection { + """ + A list of edges. + """ + edges: [WebhookEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type WebhookEdge { + """ + The item at the end of the edge. + """ + node: Webhook + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type WebhookHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: WebhookHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean! + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String +} +""" +A connection to a list of items. +""" +type WebhookHistoryConnection { + """ + A list of edges. + """ + edges: [WebhookHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type WebhookHistoryEdge { + """ + The item at the end of the edge. + """ + node: WebhookHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +WebhookHistoryOpType is enum for the field operation +""" +enum WebhookHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for WebhookHistory connections +""" +input WebhookHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order WebhookHistories. + """ + field: WebhookHistoryOrderField! +} +""" +Properties by which WebhookHistory connections can be ordered. +""" +enum WebhookHistoryOrderField { + name + url +} +""" +WebhookHistoryWhereInput is used for filtering WebhookHistory objects. +Input was generated by ent. +""" +input WebhookHistoryWhereInput { + not: WebhookHistoryWhereInput + and: [WebhookHistoryWhereInput!] + or: [WebhookHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: WebhookHistoryOpType + operationNEQ: WebhookHistoryOpType + operationIn: [WebhookHistoryOpType!] + operationNotIn: [WebhookHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + destination_url field predicates + """ + destinationURL: String + destinationURLNEQ: String + destinationURLIn: [String!] + destinationURLNotIn: [String!] + destinationURLGT: String + destinationURLGTE: String + destinationURLLT: String + destinationURLLTE: String + destinationURLContains: String + destinationURLHasPrefix: String + destinationURLHasSuffix: String + destinationURLEqualFold: String + destinationURLContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + failures field predicates + """ + failures: Int + failuresNEQ: Int + failuresIn: [Int!] + failuresNotIn: [Int!] + failuresGT: Int + failuresGTE: Int + failuresLT: Int + failuresLTE: Int + failuresIsNil: Boolean + failuresNotNil: Boolean + """ + last_error field predicates + """ + lastError: String + lastErrorNEQ: String + lastErrorIn: [String!] + lastErrorNotIn: [String!] + lastErrorGT: String + lastErrorGTE: String + lastErrorLT: String + lastErrorLTE: String + lastErrorContains: String + lastErrorHasPrefix: String + lastErrorHasSuffix: String + lastErrorIsNil: Boolean + lastErrorNotNil: Boolean + lastErrorEqualFold: String + lastErrorContainsFold: String + """ + last_response field predicates + """ + lastResponse: String + lastResponseNEQ: String + lastResponseIn: [String!] + lastResponseNotIn: [String!] + lastResponseGT: String + lastResponseGTE: String + lastResponseLT: String + lastResponseLTE: String + lastResponseContains: String + lastResponseHasPrefix: String + lastResponseHasSuffix: String + lastResponseIsNil: Boolean + lastResponseNotNil: Boolean + lastResponseEqualFold: String + lastResponseContainsFold: String +} +""" +Ordering options for Webhook connections +""" +input WebhookOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Webhooks. + """ + field: WebhookOrderField! +} +""" +Properties by which Webhook connections can be ordered. +""" +enum WebhookOrderField { + name + url +} +""" +WebhookWhereInput is used for filtering Webhook objects. +Input was generated by ent. +""" +input WebhookWhereInput { + not: WebhookWhereInput + and: [WebhookWhereInput!] + or: [WebhookWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + destination_url field predicates + """ + destinationURL: String + destinationURLNEQ: String + destinationURLIn: [String!] + destinationURLNotIn: [String!] + destinationURLGT: String + destinationURLGTE: String + destinationURLLT: String + destinationURLLTE: String + destinationURLContains: String + destinationURLHasPrefix: String + destinationURLHasSuffix: String + destinationURLEqualFold: String + destinationURLContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + failures field predicates + """ + failures: Int + failuresNEQ: Int + failuresIn: [Int!] + failuresNotIn: [Int!] + failuresGT: Int + failuresGTE: Int + failuresLT: Int + failuresLTE: Int + failuresIsNil: Boolean + failuresNotNil: Boolean + """ + last_error field predicates + """ + lastError: String + lastErrorNEQ: String + lastErrorIn: [String!] + lastErrorNotIn: [String!] + lastErrorGT: String + lastErrorGTE: String + lastErrorLT: String + lastErrorLTE: String + lastErrorContains: String + lastErrorHasPrefix: String + lastErrorHasSuffix: String + lastErrorIsNil: Boolean + lastErrorNotNil: Boolean + lastErrorEqualFold: String + lastErrorContainsFold: String + """ + last_response field predicates + """ + lastResponse: String + lastResponseNEQ: String + lastResponseIn: [String!] + lastResponseNotIn: [String!] + lastResponseGT: String + lastResponseGTE: String + lastResponseLT: String + lastResponseLTE: String + lastResponseContains: String + lastResponseHasPrefix: String + lastResponseHasSuffix: String + lastResponseIsNil: Boolean + lastResponseNotNil: Boolean + lastResponseEqualFold: String + lastResponseContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] +} +`, BuiltIn: false}, + {Name: "../../schema/entitlement.graphql", Input: `extend type Query { + """ + Look up entitlement by ID + """ + entitlement( + """ + ID of the entitlement + """ + id: ID! + ): Entitlement! +} + +extend type Mutation{ + """ + Create a new entitlement + """ + createEntitlement( + """ + values of the entitlement + """ + input: CreateEntitlementInput! + ): EntitlementCreatePayload! + """ + Create multiple new entitlements + """ + createBulkEntitlement( + """ + values of the entitlement + """ + input: [CreateEntitlementInput!] + ): EntitlementBulkCreatePayload! + """ + Create multiple new entitlements via file upload + """ + createBulkCSVEntitlement( + """ + csv file containing values of the entitlement + """ + input: Upload! + ): EntitlementBulkCreatePayload! + """ + Update an existing entitlement + """ + updateEntitlement( + """ + ID of the entitlement + """ + id: ID! + """ + New values for the entitlement + """ + input: UpdateEntitlementInput! + ): EntitlementUpdatePayload! + """ + Delete an existing entitlement + """ + deleteEntitlement( + """ + ID of the entitlement + """ + id: ID! + ): EntitlementDeletePayload! +} + +""" +Return response for createEntitlement mutation +""" +type EntitlementCreatePayload { + """ + Created entitlement + """ + entitlement: Entitlement! +} + +""" +Return response for updateEntitlement mutation +""" +type EntitlementUpdatePayload { + """ + Updated entitlement + """ + entitlement: Entitlement! +} + +""" +Return response for deleteEntitlement mutation +""" +type EntitlementDeletePayload { + """ + Deleted entitlement ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntitlement mutation +""" +type EntitlementBulkCreatePayload { + """ + Created entitlements + """ + entitlements: [Entitlement!] +}`, BuiltIn: false}, + {Name: "../../schema/entitlementplan.graphql", Input: `extend type Query { + """ + Look up entitlementPlan by ID + """ + entitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + ): EntitlementPlan! +} + +extend type Mutation{ + """ + Create a new entitlementPlan + """ + createEntitlementPlan( + """ + values of the entitlementPlan + """ + input: CreateEntitlementPlanInput! + ): EntitlementPlanCreatePayload! + """ + Create multiple new entitlementPlans + """ + createBulkEntitlementPlan( + """ + values of the entitlementPlan + """ + input: [CreateEntitlementPlanInput!] + ): EntitlementPlanBulkCreatePayload! + """ + Create multiple new entitlementPlans via file upload + """ + createBulkCSVEntitlementPlan( + """ + csv file containing values of the entitlementPlan + """ + input: Upload! + ): EntitlementPlanBulkCreatePayload! + """ + Update an existing entitlementPlan + """ + updateEntitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + """ + New values for the entitlementPlan + """ + input: UpdateEntitlementPlanInput! + ): EntitlementPlanUpdatePayload! + """ + Delete an existing entitlementPlan + """ + deleteEntitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + ): EntitlementPlanDeletePayload! +} + +""" +Return response for createEntitlementPlan mutation +""" +type EntitlementPlanCreatePayload { + """ + Created entitlementPlan + """ + entitlementPlan: EntitlementPlan! +} + +""" +Return response for updateEntitlementPlan mutation +""" +type EntitlementPlanUpdatePayload { + """ + Updated entitlementPlan + """ + entitlementPlan: EntitlementPlan! +} + +""" +Return response for deleteEntitlementPlan mutation +""" +type EntitlementPlanDeletePayload { + """ + Deleted entitlementPlan ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntitlementPlan mutation +""" +type EntitlementPlanBulkCreatePayload { + """ + Created entitlementPlans + """ + entitlementPlans: [EntitlementPlan!] +}`, BuiltIn: false}, + {Name: "../../schema/entitlementplanfeature.graphql", Input: `extend type Query { + """ + Look up entitlementPlanFeature by ID + """ + entitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + ): EntitlementPlanFeature! +} + +extend type Mutation{ + """ + Create a new entitlementPlanFeature + """ + createEntitlementPlanFeature( + """ + values of the entitlementPlanFeature + """ + input: CreateEntitlementPlanFeatureInput! + ): EntitlementPlanFeatureCreatePayload! + """ + Create multiple new entitlementPlanFeatures + """ + createBulkEntitlementPlanFeature( + """ + values of the entitlementPlanFeature + """ + input: [CreateEntitlementPlanFeatureInput!] + ): EntitlementPlanFeatureBulkCreatePayload! + """ + Create multiple new entitlementPlanFeatures via file upload + """ + createBulkCSVEntitlementPlanFeature( + """ + csv file containing values of the entitlementPlanFeature + """ + input: Upload! + ): EntitlementPlanFeatureBulkCreatePayload! + """ + Update an existing entitlementPlanFeature + """ + updateEntitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + """ + New values for the entitlementPlanFeature + """ + input: UpdateEntitlementPlanFeatureInput! + ): EntitlementPlanFeatureUpdatePayload! + """ + Delete an existing entitlementPlanFeature + """ + deleteEntitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + ): EntitlementPlanFeatureDeletePayload! +} + +""" +Return response for createEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureCreatePayload { + """ + Created entitlementPlanFeature + """ + entitlementPlanFeature: EntitlementPlanFeature! +} + +""" +Return response for updateEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureUpdatePayload { + """ + Updated entitlementPlanFeature + """ + entitlementPlanFeature: EntitlementPlanFeature! +} + +""" +Return response for deleteEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureDeletePayload { + """ + Deleted entitlementPlanFeature ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureBulkCreatePayload { + """ + Created entitlementPlanFeatures + """ + entitlementPlanFeatures: [EntitlementPlanFeature!] +}`, BuiltIn: false}, + {Name: "../../schema/entity.graphql", Input: `extend type Query { + """ + Look up entity by ID + """ + entity( + """ + ID of the entity + """ + id: ID! + ): Entity! +} + +extend type Mutation{ + """ + Create a new entity + """ + createEntity( + """ + values of the entity + """ + input: CreateEntityInput! + ): EntityCreatePayload! + """ + Create multiple new entities + """ + createBulkEntity( + """ + values of the entity + """ + input: [CreateEntityInput!] + ): EntityBulkCreatePayload! + """ + Create multiple new entities via file upload + """ + createBulkCSVEntity( + """ + csv file containing values of the entity + """ + input: Upload! + ): EntityBulkCreatePayload! + """ + Update an existing entity + """ + updateEntity( + """ + ID of the entity + """ + id: ID! + """ + New values for the entity + """ + input: UpdateEntityInput! + ): EntityUpdatePayload! + """ + Delete an existing entity + """ + deleteEntity( + """ + ID of the entity + """ + id: ID! + ): EntityDeletePayload! +} + +""" +Return response for createEntity mutation +""" +type EntityCreatePayload { + """ + Created entity + """ + entity: Entity! +} + +""" +Return response for updateEntity mutation +""" +type EntityUpdatePayload { + """ + Updated entity + """ + entity: Entity! +} + +""" +Return response for deleteEntity mutation +""" +type EntityDeletePayload { + """ + Deleted entity ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntity mutation +""" +type EntityBulkCreatePayload { + """ + Created entities + """ + entities: [Entity!] +}`, BuiltIn: false}, + {Name: "../../schema/entityextended.graphql", Input: `extend input CreateEntityInput { + note: CreateNoteInput +} + +extend input UpdateEntityInput { + note: CreateNoteInput +} +`, BuiltIn: false}, + {Name: "../../schema/entitytype.graphql", Input: `extend type Query { + """ + Look up entityType by ID + """ + entityType( + """ + ID of the entityType + """ + id: ID! + ): EntityType! +} + +extend type Mutation{ + """ + Create a new entityType + """ + createEntityType( + """ + values of the entityType + """ + input: CreateEntityTypeInput! + ): EntityTypeCreatePayload! + """ + Create multiple new entityTypes + """ + createBulkEntityType( + """ + values of the entityType + """ + input: [CreateEntityTypeInput!] + ): EntityTypeBulkCreatePayload! + """ + Create multiple new entityTypes via file upload + """ + createBulkCSVEntityType( + """ + csv file containing values of the entityType + """ + input: Upload! + ): EntityTypeBulkCreatePayload! + """ + Update an existing entityType + """ + updateEntityType( + """ + ID of the entityType + """ + id: ID! + """ + New values for the entityType + """ + input: UpdateEntityTypeInput! + ): EntityTypeUpdatePayload! + """ + Delete an existing entityType + """ + deleteEntityType( + """ + ID of the entityType + """ + id: ID! + ): EntityTypeDeletePayload! +} + +""" +Return response for createEntityType mutation +""" +type EntityTypeCreatePayload { + """ + Created entityType + """ + entityType: EntityType! +} + +""" +Return response for updateEntityType mutation +""" +type EntityTypeUpdatePayload { + """ + Updated entityType + """ + entityType: EntityType! +} + +""" +Return response for deleteEntityType mutation +""" +type EntityTypeDeletePayload { + """ + Deleted entityType ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntityType mutation +""" +type EntityTypeBulkCreatePayload { + """ + Created entityTypes + """ + entityTypes: [EntityType!] +}`, BuiltIn: false}, + {Name: "../../schema/event.graphql", Input: `extend type Query { + """ + Look up event by ID + """ + event( + """ + ID of the event + """ + id: ID! + ): Event! +} + +extend type Mutation{ + """ + Create a new event + """ + createEvent( + """ + values of the event + """ + input: CreateEventInput! + ): EventCreatePayload! + """ + Create multiple new events + """ + createBulkEvent( + """ + values of the event + """ + input: [CreateEventInput!] + ): EventBulkCreatePayload! + """ + Create multiple new events via file upload + """ + createBulkCSVEvent( + """ + csv file containing values of the event + """ + input: Upload! + ): EventBulkCreatePayload! + """ + Update an existing event + """ + updateEvent( + """ + ID of the event + """ + id: ID! + """ + New values for the event + """ + input: UpdateEventInput! + ): EventUpdatePayload! + """ + Delete an existing event + """ + deleteEvent( + """ + ID of the event + """ + id: ID! + ): EventDeletePayload! +} + +""" +Return response for createEvent mutation +""" +type EventCreatePayload { + """ + Created event + """ + event: Event! +} + +""" +Return response for updateEvent mutation +""" +type EventUpdatePayload { + """ + Updated event + """ + event: Event! +} + +""" +Return response for deleteEvent mutation +""" +type EventDeletePayload { + """ + Deleted event ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEvent mutation +""" +type EventBulkCreatePayload { + """ + Created events + """ + events: [Event!] +}`, BuiltIn: false}, + {Name: "../../schema/feature.graphql", Input: `extend type Query { + """ + Look up feature by ID + """ + feature( + """ + ID of the feature + """ + id: ID! + ): Feature! +} + +extend type Mutation{ + """ + Create a new feature + """ + createFeature( + """ + values of the feature + """ + input: CreateFeatureInput! + ): FeatureCreatePayload! + """ + Create multiple new features + """ + createBulkFeature( + """ + values of the feature + """ + input: [CreateFeatureInput!] + ): FeatureBulkCreatePayload! + """ + Create multiple new features via file upload + """ + createBulkCSVFeature( + """ + csv file containing values of the feature + """ + input: Upload! + ): FeatureBulkCreatePayload! + """ + Update an existing feature + """ + updateFeature( + """ + ID of the feature + """ + id: ID! + """ + New values for the feature + """ + input: UpdateFeatureInput! + ): FeatureUpdatePayload! + """ + Delete an existing feature + """ + deleteFeature( + """ + ID of the feature + """ + id: ID! + ): FeatureDeletePayload! +} + +""" +Return response for createFeature mutation +""" +type FeatureCreatePayload { + """ + Created feature + """ + feature: Feature! +} + +""" +Return response for updateFeature mutation +""" +type FeatureUpdatePayload { + """ + Updated feature + """ + feature: Feature! +} + +""" +Return response for deleteFeature mutation +""" +type FeatureDeletePayload { + """ + Deleted feature ID + """ + deletedID: ID! +} + +""" +Return response for createBulkFeature mutation +""" +type FeatureBulkCreatePayload { + """ + Created features + """ + features: [Feature!] +}`, BuiltIn: false}, + {Name: "../../schema/file.graphql", Input: `extend type Query { + """ + Look up file by ID + """ + file( + """ + ID of the file + """ + id: ID! + ): File! +} + +extend type Mutation{ + """ + Create a new file + """ + createFile( + """ + values of the file + """ + input: CreateFileInput! + ): FileCreatePayload! + """ + Create multiple new files + """ + createBulkFile( + """ + values of the file + """ + input: [CreateFileInput!] + ): FileBulkCreatePayload! + """ + Create multiple new files via file upload + """ + createBulkCSVFile( + """ + csv file containing values of the file + """ + input: Upload! + ): FileBulkCreatePayload! + """ + Update an existing file + """ + updateFile( + """ + ID of the file + """ + id: ID! + """ + New values for the file + """ + input: UpdateFileInput! + ): FileUpdatePayload! + """ + Delete an existing file + """ + deleteFile( + """ + ID of the file + """ + id: ID! + ): FileDeletePayload! +} + +""" +Return response for createFile mutation +""" +type FileCreatePayload { + """ + Created file + """ + file: File! +} + +""" +Return response for updateFile mutation +""" +type FileUpdatePayload { + """ + Updated file + """ + file: File! +} + +""" +Return response for deleteFile mutation +""" +type FileDeletePayload { + """ + Deleted file ID + """ + deletedID: ID! +} + +""" +Return response for createBulkFile mutation +""" +type FileBulkCreatePayload { + """ + Created files + """ + files: [File!] +}`, BuiltIn: false}, + {Name: "../../schema/group.graphql", Input: `extend type Query { + """ + Look up group by ID + """ + group( + """ + ID of the group + """ + id: ID! + ): Group! +} + +extend type Mutation{ + """ + Create a new group + """ + createGroup( + """ + values of the group + """ + input: CreateGroupInput! + ): GroupCreatePayload! + """ + Create multiple new groups + """ + createBulkGroup( + """ + values of the group + """ + input: [CreateGroupInput!] + ): GroupBulkCreatePayload! + """ + Create multiple new groups via file upload + """ + createBulkCSVGroup( + """ + csv file containing values of the group + """ + input: Upload! + ): GroupBulkCreatePayload! + """ + Update an existing group + """ + updateGroup( + """ + ID of the group + """ + id: ID! + """ + New values for the group + """ + input: UpdateGroupInput! + ): GroupUpdatePayload! + """ + Delete an existing group + """ + deleteGroup( + """ + ID of the group + """ + id: ID! + ): GroupDeletePayload! +} + +""" +Return response for createGroup mutation +""" +type GroupCreatePayload { + """ + Created group + """ + group: Group! +} + +""" +Return response for updateGroup mutation +""" +type GroupUpdatePayload { + """ + Updated group + """ + group: Group! +} + +""" +Return response for deleteGroup mutation +""" +type GroupDeletePayload { + """ + Deleted group ID + """ + deletedID: ID! +} + +""" +Return response for createBulkGroup mutation +""" +type GroupBulkCreatePayload { + """ + Created groups + """ + groups: [Group!] +}`, BuiltIn: false}, + {Name: "../../schema/groupextended.graphql", Input: `extend input CreateGroupInput { + createGroupSettings: CreateGroupSettingInput +} + +extend input UpdateGroupInput { + addGroupMembers: [CreateGroupMembershipInput!] + updateGroupSettings: UpdateGroupSettingInput +} + +extend input GroupMembershipWhereInput { + groupID: String + userID: String +}`, BuiltIn: false}, + {Name: "../../schema/groupmembership.graphql", Input: `extend type Query { + """ + Look up groupMembership by ID + """ + groupMembership( + """ + ID of the groupMembership + """ + id: ID! + ): GroupMembership! +} + +extend type Mutation{ + """ + Create a new groupMembership + """ + createGroupMembership( + """ + values of the groupMembership + """ + input: CreateGroupMembershipInput! + ): GroupMembershipCreatePayload! + """ + Create multiple new groupMemberships + """ + createBulkGroupMembership( + """ + values of the groupMembership + """ + input: [CreateGroupMembershipInput!] + ): GroupMembershipBulkCreatePayload! + """ + Create multiple new groupMemberships via file upload + """ + createBulkCSVGroupMembership( + """ + csv file containing values of the groupMembership + """ + input: Upload! + ): GroupMembershipBulkCreatePayload! + """ + Update an existing groupMembership + """ + updateGroupMembership( + """ + ID of the groupMembership + """ + id: ID! + """ + New values for the groupMembership + """ + input: UpdateGroupMembershipInput! + ): GroupMembershipUpdatePayload! + """ + Delete an existing groupMembership + """ + deleteGroupMembership( + """ + ID of the groupMembership + """ + id: ID! + ): GroupMembershipDeletePayload! +} + +""" +Return response for createGroupMembership mutation +""" +type GroupMembershipCreatePayload { + """ + Created groupMembership + """ + groupMembership: GroupMembership! +} + +""" +Return response for updateGroupMembership mutation +""" +type GroupMembershipUpdatePayload { + """ + Updated groupMembership + """ + groupMembership: GroupMembership! +} + +""" +Return response for deleteGroupMembership mutation +""" +type GroupMembershipDeletePayload { + """ + Deleted groupMembership ID + """ + deletedID: ID! +} + +""" +Return response for createBulkGroupMembership mutation +""" +type GroupMembershipBulkCreatePayload { + """ + Created groupMemberships + """ + groupMemberships: [GroupMembership!] +}`, BuiltIn: false}, + {Name: "../../schema/groupsetting.graphql", Input: `extend type Query { + """ + Look up groupSetting by ID + """ + groupSetting( + """ + ID of the groupSetting + """ + id: ID! + ): GroupSetting! +} + +extend type Mutation{ + """ + Create a new groupSetting + """ + createGroupSetting( + """ + values of the groupSetting + """ + input: CreateGroupSettingInput! + ): GroupSettingCreatePayload! + """ + Create multiple new groupSettings + """ + createBulkGroupSetting( + """ + values of the groupSetting + """ + input: [CreateGroupSettingInput!] + ): GroupSettingBulkCreatePayload! + """ + Create multiple new groupSettings via file upload + """ + createBulkCSVGroupSetting( + """ + csv file containing values of the groupSetting + """ + input: Upload! + ): GroupSettingBulkCreatePayload! + """ + Update an existing groupSetting + """ + updateGroupSetting( + """ + ID of the groupSetting + """ + id: ID! + """ + New values for the groupSetting + """ + input: UpdateGroupSettingInput! + ): GroupSettingUpdatePayload! + """ + Delete an existing groupSetting + """ + deleteGroupSetting( + """ + ID of the groupSetting + """ + id: ID! + ): GroupSettingDeletePayload! +} + +""" +Return response for createGroupSetting mutation +""" +type GroupSettingCreatePayload { + """ + Created groupSetting + """ + groupSetting: GroupSetting! +} + +""" +Return response for updateGroupSetting mutation +""" +type GroupSettingUpdatePayload { + """ + Updated groupSetting + """ + groupSetting: GroupSetting! +} + +""" +Return response for deleteGroupSetting mutation +""" +type GroupSettingDeletePayload { + """ + Deleted groupSetting ID + """ + deletedID: ID! +} + +""" +Return response for createBulkGroupSetting mutation +""" +type GroupSettingBulkCreatePayload { + """ + Created groupSettings + """ + groupSettings: [GroupSetting!] +}`, BuiltIn: false}, + {Name: "../../schema/hush.graphql", Input: `extend type Query { + """ + Look up hush by ID + """ + hush( + """ + ID of the hush + """ + id: ID! + ): Hush! +} + +extend type Mutation{ + """ + Create a new hush + """ + createHush( + """ + values of the hush + """ + input: CreateHushInput! + ): HushCreatePayload! + """ + Create multiple new hushs + """ + createBulkHush( + """ + values of the hush + """ + input: [CreateHushInput!] + ): HushBulkCreatePayload! + """ + Create multiple new hushs via file upload + """ + createBulkCSVHush( + """ + csv file containing values of the hush + """ + input: Upload! + ): HushBulkCreatePayload! + """ + Update an existing hush + """ + updateHush( + """ + ID of the hush + """ + id: ID! + """ + New values for the hush + """ + input: UpdateHushInput! + ): HushUpdatePayload! + """ + Delete an existing hush + """ + deleteHush( + """ + ID of the hush + """ + id: ID! + ): HushDeletePayload! +} + +""" +Return response for createHush mutation +""" +type HushCreatePayload { + """ + Created hush + """ + hush: Hush! +} + +""" +Return response for updateHush mutation +""" +type HushUpdatePayload { + """ + Updated hush + """ + hush: Hush! +} + +""" +Return response for deleteHush mutation +""" +type HushDeletePayload { + """ + Deleted hush ID + """ + deletedID: ID! +} + +""" +Return response for createBulkHush mutation +""" +type HushBulkCreatePayload { + """ + Created hushs + """ + hushes: [Hush!] +}`, BuiltIn: false}, + {Name: "../../schema/integration.graphql", Input: `extend type Query { + """ + Look up integration by ID + """ + integration( + """ + ID of the integration + """ + id: ID! + ): Integration! +} + +extend type Mutation{ + """ + Create a new integration + """ + createIntegration( + """ + values of the integration + """ + input: CreateIntegrationInput! + ): IntegrationCreatePayload! + """ + Create multiple new integrations + """ + createBulkIntegration( + """ + values of the integration + """ + input: [CreateIntegrationInput!] + ): IntegrationBulkCreatePayload! + """ + Create multiple new integrations via file upload + """ + createBulkCSVIntegration( + """ + csv file containing values of the integration + """ + input: Upload! + ): IntegrationBulkCreatePayload! + """ + Update an existing integration + """ + updateIntegration( + """ + ID of the integration + """ + id: ID! + """ + New values for the integration + """ + input: UpdateIntegrationInput! + ): IntegrationUpdatePayload! + """ + Delete an existing integration + """ + deleteIntegration( + """ + ID of the integration + """ + id: ID! + ): IntegrationDeletePayload! +} + +""" +Return response for createIntegration mutation +""" +type IntegrationCreatePayload { + """ + Created integration + """ + integration: Integration! +} + +""" +Return response for updateIntegration mutation +""" +type IntegrationUpdatePayload { + """ + Updated integration + """ + integration: Integration! +} + +""" +Return response for deleteIntegration mutation +""" +type IntegrationDeletePayload { + """ + Deleted integration ID + """ + deletedID: ID! +} + +""" +Return response for createBulkIntegration mutation +""" +type IntegrationBulkCreatePayload { + """ + Created integrations + """ + integrations: [Integration!] +}`, BuiltIn: false}, + {Name: "../../schema/invite.graphql", Input: `extend type Query { + """ + Look up invite by ID + """ + invite( + """ + ID of the invite + """ + id: ID! + ): Invite! +} + +extend type Mutation{ + """ + Create a new invite + """ + createInvite( + """ + values of the invite + """ + input: CreateInviteInput! + ): InviteCreatePayload! + """ + Create multiple new invites + """ + createBulkInvite( + """ + values of the invite + """ + input: [CreateInviteInput!] + ): InviteBulkCreatePayload! + """ + Create multiple new invites via file upload + """ + createBulkCSVInvite( + """ + csv file containing values of the invite + """ + input: Upload! + ): InviteBulkCreatePayload! + """ + Update an existing invite + """ + updateInvite( + """ + ID of the invite + """ + id: ID! + """ + New values for the invite + """ + input: UpdateInviteInput! + ): InviteUpdatePayload! + """ + Delete an existing invite + """ + deleteInvite( + """ + ID of the invite + """ + id: ID! + ): InviteDeletePayload! +} + +""" +Return response for createInvite mutation +""" +type InviteCreatePayload { + """ + Created invite + """ + invite: Invite! +} + +""" +Return response for updateInvite mutation +""" +type InviteUpdatePayload { + """ + Updated invite + """ + invite: Invite! +} + +""" +Return response for deleteInvite mutation +""" +type InviteDeletePayload { + """ + Deleted invite ID + """ + deletedID: ID! +} + +""" +Return response for createBulkInvite mutation +""" +type InviteBulkCreatePayload { + """ + Created invites + """ + invites: [Invite!] +}`, BuiltIn: false}, + {Name: "../../schema/oauthprovider.graphql", Input: `extend type Query { + """ + Look up oauthProvider by ID + """ + oauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + ): OauthProvider! +} + +extend type Mutation{ + """ + Create a new oauthProvider + """ + createOauthProvider( + """ + values of the oauthProvider + """ + input: CreateOauthProviderInput! + ): OauthProviderCreatePayload! + """ + Create multiple new oauthProviders + """ + createBulkOauthProvider( + """ + values of the oauthProvider + """ + input: [CreateOauthProviderInput!] + ): OauthProviderBulkCreatePayload! + """ + Create multiple new oauthProviders via file upload + """ + createBulkCSVOauthProvider( + """ + csv file containing values of the oauthProvider + """ + input: Upload! + ): OauthProviderBulkCreatePayload! + """ + Update an existing oauthProvider + """ + updateOauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + """ + New values for the oauthProvider + """ + input: UpdateOauthProviderInput! + ): OauthProviderUpdatePayload! + """ + Delete an existing oauthProvider + """ + deleteOauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + ): OauthProviderDeletePayload! +} + +""" +Return response for createOauthProvider mutation +""" +type OauthProviderCreatePayload { + """ + Created oauthProvider + """ + oauthProvider: OauthProvider! +} + +""" +Return response for updateOauthProvider mutation +""" +type OauthProviderUpdatePayload { + """ + Updated oauthProvider + """ + oauthProvider: OauthProvider! +} + +""" +Return response for deleteOauthProvider mutation +""" +type OauthProviderDeletePayload { + """ + Deleted oauthProvider ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOauthProvider mutation +""" +type OauthProviderBulkCreatePayload { + """ + Created oauthProviders + """ + oauthProviders: [OauthProvider!] +}`, BuiltIn: false}, + {Name: "../../schema/ohauthtootoken.graphql", Input: `extend type Query { + """ + Look up ohAuthTooToken by ID + """ + ohAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + ): OhAuthTooToken! +} + +extend type Mutation{ + """ + Create a new ohAuthTooToken + """ + createOhAuthTooToken( + """ + values of the ohAuthTooToken + """ + input: CreateOhAuthTooTokenInput! + ): OhAuthTooTokenCreatePayload! + """ + Create multiple new ohAuthTooTokens + """ + createBulkOhAuthTooToken( + """ + values of the ohAuthTooToken + """ + input: [CreateOhAuthTooTokenInput!] + ): OhAuthTooTokenBulkCreatePayload! + """ + Create multiple new ohAuthTooTokens via file upload + """ + createBulkCSVOhAuthTooToken( + """ + csv file containing values of the ohAuthTooToken + """ + input: Upload! + ): OhAuthTooTokenBulkCreatePayload! + """ + Update an existing ohAuthTooToken + """ + updateOhAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + """ + New values for the ohAuthTooToken + """ + input: UpdateOhAuthTooTokenInput! + ): OhAuthTooTokenUpdatePayload! + """ + Delete an existing ohAuthTooToken + """ + deleteOhAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + ): OhAuthTooTokenDeletePayload! +} + +""" +Return response for createOhAuthTooToken mutation +""" +type OhAuthTooTokenCreatePayload { + """ + Created ohAuthTooToken + """ + ohAuthTooToken: OhAuthTooToken! +} + +""" +Return response for updateOhAuthTooToken mutation +""" +type OhAuthTooTokenUpdatePayload { + """ + Updated ohAuthTooToken + """ + ohAuthTooToken: OhAuthTooToken! +} + +""" +Return response for deleteOhAuthTooToken mutation +""" +type OhAuthTooTokenDeletePayload { + """ + Deleted ohAuthTooToken ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOhAuthTooToken mutation +""" +type OhAuthTooTokenBulkCreatePayload { + """ + Created ohAuthTooTokens + """ + ohAuthTooTokens: [OhAuthTooToken!] +}`, BuiltIn: false}, + {Name: "../../schema/organization.graphql", Input: `extend type Query { + """ + Look up organization by ID + """ + organization( + """ + ID of the organization + """ + id: ID! + ): Organization! +} + +extend type Mutation{ + """ + Create a new organization + """ + createOrganization( + """ + values of the organization + """ + input: CreateOrganizationInput! + ): OrganizationCreatePayload! + """ + Create multiple new organizations + """ + createBulkOrganization( + """ + values of the organization + """ + input: [CreateOrganizationInput!] + ): OrganizationBulkCreatePayload! + """ + Create multiple new organizations via file upload + """ + createBulkCSVOrganization( + """ + csv file containing values of the organization + """ + input: Upload! + ): OrganizationBulkCreatePayload! + """ + Update an existing organization + """ + updateOrganization( + """ + ID of the organization + """ + id: ID! + """ + New values for the organization + """ + input: UpdateOrganizationInput! + ): OrganizationUpdatePayload! + """ + Delete an existing organization + """ + deleteOrganization( + """ + ID of the organization + """ + id: ID! + ): OrganizationDeletePayload! +} + +""" +Return response for createOrganization mutation +""" +type OrganizationCreatePayload { + """ + Created organization + """ + organization: Organization! +} + +""" +Return response for updateOrganization mutation +""" +type OrganizationUpdatePayload { + """ + Updated organization + """ + organization: Organization! +} + +""" +Return response for deleteOrganization mutation +""" +type OrganizationDeletePayload { + """ + Deleted organization ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOrganization mutation +""" +type OrganizationBulkCreatePayload { + """ + Created organizations + """ + organizations: [Organization!] +}`, BuiltIn: false}, + {Name: "../../schema/organizationsetting.graphql", Input: `extend type Query { + """ + Look up organizationSetting by ID + """ + organizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + ): OrganizationSetting! +} + +extend type Mutation{ + """ + Create a new organizationSetting + """ + createOrganizationSetting( + """ + values of the organizationSetting + """ + input: CreateOrganizationSettingInput! + ): OrganizationSettingCreatePayload! + """ + Create multiple new organizationSettings + """ + createBulkOrganizationSetting( + """ + values of the organizationSetting + """ + input: [CreateOrganizationSettingInput!] + ): OrganizationSettingBulkCreatePayload! + """ + Create multiple new organizationSettings via file upload + """ + createBulkCSVOrganizationSetting( + """ + csv file containing values of the organizationSetting + """ + input: Upload! + ): OrganizationSettingBulkCreatePayload! + """ + Update an existing organizationSetting + """ + updateOrganizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + """ + New values for the organizationSetting + """ + input: UpdateOrganizationSettingInput! + ): OrganizationSettingUpdatePayload! + """ + Delete an existing organizationSetting + """ + deleteOrganizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + ): OrganizationSettingDeletePayload! +} + +""" +Return response for createOrganizationSetting mutation +""" +type OrganizationSettingCreatePayload { + """ + Created organizationSetting + """ + organizationSetting: OrganizationSetting! +} + +""" +Return response for updateOrganizationSetting mutation +""" +type OrganizationSettingUpdatePayload { + """ + Updated organizationSetting + """ + organizationSetting: OrganizationSetting! +} + +""" +Return response for deleteOrganizationSetting mutation +""" +type OrganizationSettingDeletePayload { + """ + Deleted organizationSetting ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOrganizationSetting mutation +""" +type OrganizationSettingBulkCreatePayload { + """ + Created organizationSettings + """ + organizationSettings: [OrganizationSetting!] +}`, BuiltIn: false}, + {Name: "../../schema/orgextended.graphql", Input: `extend input CreateOrganizationInput { + createOrgSettings: CreateOrganizationSettingInput +} + +extend input UpdateOrganizationInput { + addOrgMembers: [CreateOrgMembershipInput!] + updateOrgSettings: UpdateOrganizationSettingInput +} + +extend input OrgMembershipWhereInput { + organizationID: String + userID: String +}`, BuiltIn: false}, + {Name: "../../schema/orgmembership.graphql", Input: `extend type Query { + """ + Look up orgMembership by ID + """ + orgMembership( + """ + ID of the orgMembership + """ + id: ID! + ): OrgMembership! +} + +extend type Mutation{ + """ + Create a new orgMembership + """ + createOrgMembership( + """ + values of the orgMembership + """ + input: CreateOrgMembershipInput! + ): OrgMembershipCreatePayload! + """ + Create multiple new orgMemberships + """ + createBulkOrgMembership( + """ + values of the orgMembership + """ + input: [CreateOrgMembershipInput!] + ): OrgMembershipBulkCreatePayload! + """ + Create multiple new orgMemberships via file upload + """ + createBulkCSVOrgMembership( + """ + csv file containing values of the orgMembership + """ + input: Upload! + ): OrgMembershipBulkCreatePayload! + """ + Update an existing orgMembership + """ + updateOrgMembership( + """ + ID of the orgMembership + """ + id: ID! + """ + New values for the orgMembership + """ + input: UpdateOrgMembershipInput! + ): OrgMembershipUpdatePayload! + """ + Delete an existing orgMembership + """ + deleteOrgMembership( + """ + ID of the orgMembership + """ + id: ID! + ): OrgMembershipDeletePayload! +} + +""" +Return response for createOrgMembership mutation +""" +type OrgMembershipCreatePayload { + """ + Created orgMembership + """ + orgMembership: OrgMembership! +} + +""" +Return response for updateOrgMembership mutation +""" +type OrgMembershipUpdatePayload { + """ + Updated orgMembership + """ + orgMembership: OrgMembership! +} + +""" +Return response for deleteOrgMembership mutation +""" +type OrgMembershipDeletePayload { + """ + Deleted orgMembership ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOrgMembership mutation +""" +type OrgMembershipBulkCreatePayload { + """ + Created orgMemberships + """ + orgMemberships: [OrgMembership!] +}`, BuiltIn: false}, + {Name: "../../schema/personalaccesstoken.graphql", Input: `extend type Query { + """ + Look up personalAccessToken by ID + """ + personalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + ): PersonalAccessToken! +} + +extend type Mutation{ + """ + Create a new personalAccessToken + """ + createPersonalAccessToken( + """ + values of the personalAccessToken + """ + input: CreatePersonalAccessTokenInput! + ): PersonalAccessTokenCreatePayload! + """ + Create multiple new personalAccessTokens + """ + createBulkPersonalAccessToken( + """ + values of the personalAccessToken + """ + input: [CreatePersonalAccessTokenInput!] + ): PersonalAccessTokenBulkCreatePayload! + """ + Create multiple new personalAccessTokens via file upload + """ + createBulkCSVPersonalAccessToken( + """ + csv file containing values of the personalAccessToken + """ + input: Upload! + ): PersonalAccessTokenBulkCreatePayload! + """ + Update an existing personalAccessToken + """ + updatePersonalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + """ + New values for the personalAccessToken + """ + input: UpdatePersonalAccessTokenInput! + ): PersonalAccessTokenUpdatePayload! + """ + Delete an existing personalAccessToken + """ + deletePersonalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + ): PersonalAccessTokenDeletePayload! +} + +""" +Return response for createPersonalAccessToken mutation +""" +type PersonalAccessTokenCreatePayload { + """ + Created personalAccessToken + """ + personalAccessToken: PersonalAccessToken! +} + +""" +Return response for updatePersonalAccessToken mutation +""" +type PersonalAccessTokenUpdatePayload { + """ + Updated personalAccessToken + """ + personalAccessToken: PersonalAccessToken! +} + +""" +Return response for deletePersonalAccessToken mutation +""" +type PersonalAccessTokenDeletePayload { + """ + Deleted personalAccessToken ID + """ + deletedID: ID! +} + +""" +Return response for createBulkPersonalAccessToken mutation +""" +type PersonalAccessTokenBulkCreatePayload { + """ + Created personalAccessTokens + """ + personalAccessTokens: [PersonalAccessToken!] +}`, BuiltIn: false}, + {Name: "../../schema/scalars.graphql", Input: `scalar Upload`, BuiltIn: false}, + {Name: "../../schema/search.graphql", Input: `union GlobalSearchResult = + | OrganizationSearchResult + | GroupSearchResult + | UserSearchResult + | SubscriberSearchResult + + + +type OrganizationSearchResult { + organizations: [Organization!] +} + +type GroupSearchResult { + groups: [Group!] +} + +type UserSearchResult { + users: [User!] +} + +type SubscriberSearchResult { + subscribers: [Subscriber!] +} + +type GlobalSearchResultConnection { + page: PageInfo! + + nodes: [GlobalSearchResult!]! +} + + +extend type Query{ + """ + Search across organizations, groups, and users + """ + search( + """ + Search query + """ + query: String! + ): GlobalSearchResultConnection +} +`, BuiltIn: false}, + {Name: "../../schema/subscriber.graphql", Input: `extend type Query { + """ + Look up subscriber by Email + """ + subscriber( + """ + Email of the subscriber + """ + email: String! + ): Subscriber! +} + +extend type Mutation{ + """ + Create a new subscriber + """ + createSubscriber( + """ + values of the subscriber + """ + input: CreateSubscriberInput! + ): SubscriberCreatePayload! + """ + Create new subscribers + """ + createBulkSubscriber( + """ + values of the subscriber + """ + input: [CreateSubscriberInput!] + ): SubscriberBulkCreatePayload! + """ + Create new subscribers via CSV file + """ + createBulkCSVSubscriber( + """ + values of the subscriber + """ + input: Upload! + ): SubscriberBulkCreatePayload! + """ + Update an existing subscriber + """ + updateSubscriber( + """ + Email of the subscriber + """ + email: String! + """ + New values for the subscriber + """ + input: UpdateSubscriberInput! + ): SubscriberUpdatePayload! + """ + Delete an existing subscriber by Email + """ + deleteSubscriber( + """ + Email of the subscriber + """ + email: String! + """ + OwnerID of the subscriber + """ + ownerID: ID + ): SubscriberDeletePayload! +} + +""" +Return response for createSubscriber mutation +""" +type SubscriberCreatePayload { + """ + Created subscriber + """ + subscriber: Subscriber! +} + +""" +Return response for updateSubscriber mutation +""" +type SubscriberUpdatePayload { + """ + Updated subscriber + """ + subscriber: Subscriber! +} + +""" +Return response for deleteSubscriber mutation +""" +type SubscriberDeletePayload { + """ + Deleted subscriber email + """ + email: String! +} + +""" +Return response for createBulkSubscriber mutation +""" +type SubscriberBulkCreatePayload { + """ + Created subscribers + """ + subscribers: [Subscriber!] +} + +`, BuiltIn: false}, + {Name: "../../schema/template.graphql", Input: `extend type Query { + """ + Look up template by ID + """ + template( + """ + ID of the template + """ + id: ID! + ): Template! +} + +extend type Mutation{ + """ + Create a new template + """ + createTemplate( + """ + values of the template + """ + input: CreateTemplateInput! + ): TemplateCreatePayload! + """ + Create multiple new templates + """ + createBulkTemplate( + """ + values of the template + """ + input: [CreateTemplateInput!] + ): TemplateBulkCreatePayload! + """ + Create multiple new templates via file upload + """ + createBulkCSVTemplate( + """ + csv file containing values of the template + """ + input: Upload! + ): TemplateBulkCreatePayload! + """ + Update an existing template + """ + updateTemplate( + """ + ID of the template + """ + id: ID! + """ + New values for the template + """ + input: UpdateTemplateInput! + ): TemplateUpdatePayload! + """ + Delete an existing template + """ + deleteTemplate( + """ + ID of the template + """ + id: ID! + ): TemplateDeletePayload! +} + +""" +Return response for createTemplate mutation +""" +type TemplateCreatePayload { + """ + Created template + """ + template: Template! +} + +""" +Return response for updateTemplate mutation +""" +type TemplateUpdatePayload { + """ + Updated template + """ + template: Template! +} + +""" +Return response for deleteTemplate mutation +""" +type TemplateDeletePayload { + """ + Deleted template ID + """ + deletedID: ID! +} + +""" +Return response for createBulkTemplate mutation +""" +type TemplateBulkCreatePayload { + """ + Created templates + """ + templates: [Template!] +}`, BuiltIn: false}, + {Name: "../../schema/tfasetting.graphql", Input: `extend type Query { + """ + Look up tfaSetting for the current user + """ + tfaSetting( + """ + ID of the tfaSetting + """ + id: ID + ): TFASetting! +} + +extend type Mutation{ + """ + Create a new tfaSetting + """ + createTFASetting( + """ + values of the tfaSetting + """ + input: CreateTFASettingInput! + ): TFASettingCreatePayload! + """ + Update an existing tfaSetting + """ + updateTFASetting( + """ + New values for the tfaSetting + """ + input: UpdateTFASettingInput! + ): TFASettingUpdatePayload! +} + +""" +Return response for createTFASetting mutation +""" +type TFASettingCreatePayload { + """ + Created tfaSetting + """ + tfaSetting: TFASetting! +} + +""" +Return response for updateTFASetting mutation +""" +type TFASettingUpdatePayload { + """ + Updated tfaSetting + """ + tfaSetting: TFASetting! +} + +extend input UpdateTFASettingInput { + """ + Whether to regenerate backup codes + """ + regenBackupCodes: Boolean +}`, BuiltIn: false}, + {Name: "../../schema/user.graphql", Input: `extend type Query { + """ + Look up user by ID + """ + user( + """ + ID of the user + """ + id: ID! + ): User! +} + +extend type Mutation{ + """ + Create a new user + """ + createUser( + """ + values of the user + """ + input: CreateUserInput! + ): UserCreatePayload! + """ + Update an existing user + """ + updateUser( + """ + ID of the user + """ + id: ID! + """ + New values for the user + """ + input: UpdateUserInput! + ): UserUpdatePayload! + """ + Delete an existing user + """ + deleteUser( + """ + ID of the user + """ + id: ID! + ): UserDeletePayload! +} + +""" +Return response for createUser mutation +""" +type UserCreatePayload { + """ + Created user + """ + user: User! +} + +""" +Return response for updateUser mutation +""" +type UserUpdatePayload { + """ + Updated user + """ + user: User! +} + +""" +Return response for deleteUser mutation +""" +type UserDeletePayload { + """ + Deleted user ID + """ + deletedID: ID! +} + +""" +Return response for createBulkUser mutation +""" +type UserBulkCreatePayload { + """ + Created users + """ + users: [User!] +}`, BuiltIn: false}, + {Name: "../../schema/usersetting.graphql", Input: `extend type Query { + """ + Look up userSetting by ID + """ + userSetting( + """ + ID of the userSetting + """ + id: ID! + ): UserSetting! +} + +extend type Mutation{ + """ + Create a new userSetting + """ + createUserSetting( + """ + values of the userSetting + """ + input: CreateUserSettingInput! + ): UserSettingCreatePayload! + """ + Create multiple new userSettings + """ + createBulkUserSetting( + """ + values of the userSetting + """ + input: [CreateUserSettingInput!] + ): UserSettingBulkCreatePayload! + """ + Create multiple new userSettings via file upload + """ + createBulkCSVUserSetting( + """ + csv file containing values of the userSetting + """ + input: Upload! + ): UserSettingBulkCreatePayload! + """ + Update an existing userSetting + """ + updateUserSetting( + """ + ID of the userSetting + """ + id: ID! + """ + New values for the userSetting + """ + input: UpdateUserSettingInput! + ): UserSettingUpdatePayload! +} + +""" +Return response for createUserSetting mutation +""" +type UserSettingCreatePayload { + """ + Created userSetting + """ + userSetting: UserSetting! +} + +""" +Return response for updateUserSetting mutation +""" +type UserSettingUpdatePayload { + """ + Updated userSetting + """ + userSetting: UserSetting! +} + +""" +Return response for createBulkUserSetting mutation +""" +type UserSettingBulkCreatePayload { + """ + Created userSettings + """ + userSettings: [UserSetting!] +}`, BuiltIn: false}, + {Name: "../../schema/webhook.graphql", Input: `extend type Query { + """ + Look up webhook by ID + """ + webhook( + """ + ID of the webhook + """ + id: ID! + ): Webhook! +} + +extend type Mutation{ + """ + Create a new webhook + """ + createWebhook( + """ + values of the webhook + """ + input: CreateWebhookInput! + ): WebhookCreatePayload! + """ + Create multiple new webhooks + """ + createBulkWebhook( + """ + values of the webhook + """ + input: [CreateWebhookInput!] + ): WebhookBulkCreatePayload! + """ + Create multiple new webhooks via file upload + """ + createBulkCSVWebhook( + """ + csv file containing values of the webhook + """ + input: Upload! + ): WebhookBulkCreatePayload! + """ + Update an existing webhook + """ + updateWebhook( + """ + ID of the webhook + """ + id: ID! + """ + New values for the webhook + """ + input: UpdateWebhookInput! + ): WebhookUpdatePayload! + """ + Delete an existing webhook + """ + deleteWebhook( + """ + ID of the webhook + """ + id: ID! + ): WebhookDeletePayload! +} + +""" +Return response for createWebhook mutation +""" +type WebhookCreatePayload { + """ + Created webhook + """ + webhook: Webhook! +} + +""" +Return response for updateWebhook mutation +""" +type WebhookUpdatePayload { + """ + Updated webhook + """ + webhook: Webhook! +} + +""" +Return response for deleteWebhook mutation +""" +type WebhookDeletePayload { + """ + Deleted webhook ID + """ + deletedID: ID! +} + +""" +Return response for createBulkWebhook mutation +""" +type WebhookBulkCreatePayload { + """ + Created webhooks + """ + webhooks: [Webhook!] +}`, BuiltIn: false}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Mutation_createAPIToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateAPITokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateAPITokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateAPITokenInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkAPIToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateAPITokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateAPITokenInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateAPITokenInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVAPIToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVContact_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVDocumentData_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVEntitlementPlanFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVEntitlementPlan_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVEntitlement_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVEntityType_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVEntity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVEvent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVFile_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVGroupMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVGroupSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVHush_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVIntegration_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVInvite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVOauthProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVOhAuthTooToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVOrgMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVOrganizationSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVOrganization_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVPersonalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVSubscriber_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVTemplate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVUserSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkCSVWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 graphql.Upload + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkContact_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateContactInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateContactInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateContactInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkDocumentData_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateDocumentDataInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateDocumentDataInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateDocumentDataInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkEntitlementPlanFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateEntitlementPlanFeatureInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateEntitlementPlanFeatureInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanFeatureInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkEntitlementPlan_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateEntitlementPlanInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateEntitlementPlanInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkEntitlement_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateEntitlementInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateEntitlementInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkEntityType_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateEntityTypeInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateEntityTypeInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityTypeInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkEntity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateEntityInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateEntityInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkEvent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateEventInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateEventInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEventInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateFeatureInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateFeatureInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFeatureInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkFile_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateFileInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateFileInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFileInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkGroupMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateGroupMembershipInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateGroupMembershipInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupMembershipInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkGroupSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateGroupSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateGroupSettingInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateGroupInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateGroupInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkHush_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateHushInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateHushInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateHushInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkIntegration_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateIntegrationInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateIntegrationInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateIntegrationInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkInvite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateInviteInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateInviteInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateInviteInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkOauthProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateOauthProviderInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateOauthProviderInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOauthProviderInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkOhAuthTooToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateOhAuthTooTokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateOhAuthTooTokenInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOhAuthTooTokenInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkOrgMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateOrgMembershipInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateOrgMembershipInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgMembershipInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkOrganizationSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateOrganizationSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateOrganizationSettingInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkOrganization_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateOrganizationInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateOrganizationInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkPersonalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreatePersonalAccessTokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreatePersonalAccessTokenInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreatePersonalAccessTokenInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkSubscriber_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateSubscriberInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateSubscriberInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateSubscriberInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkTemplate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateTemplateInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateTemplateInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTemplateInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkUserSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateUserSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateUserSettingInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserSettingInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createBulkWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []*generated.CreateWebhookInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOCreateWebhookInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateWebhookInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createContact_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateContactInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateContactInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateContactInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createDocumentData_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateDocumentDataInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateDocumentDataInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateDocumentDataInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createEntitlementPlanFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateEntitlementPlanFeatureInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateEntitlementPlanFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanFeatureInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createEntitlementPlan_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateEntitlementPlanInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateEntitlementPlanInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createEntitlement_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateEntitlementInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateEntitlementInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createEntityType_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateEntityTypeInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateEntityTypeInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityTypeInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createEntity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateEntityInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateEntityInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createEvent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateEventInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateEventInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEventInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateFeatureInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFeatureInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createFile_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateFileInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateFileInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFileInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createGroupMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateGroupMembershipInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateGroupMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupMembershipInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createGroupSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateGroupSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateGroupSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateGroupInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateGroupInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createHush_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateHushInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateHushInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateHushInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createIntegration_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateIntegrationInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateIntegrationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateIntegrationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createInvite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateInviteInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateInviteInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateInviteInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createOauthProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateOauthProviderInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateOauthProviderInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOauthProviderInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createOhAuthTooToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateOhAuthTooTokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateOhAuthTooTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOhAuthTooTokenInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createOrgMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateOrgMembershipInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateOrgMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgMembershipInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createOrganizationSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateOrganizationSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateOrganizationSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createOrganization_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateOrganizationInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateOrganizationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createPersonalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreatePersonalAccessTokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreatePersonalAccessTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreatePersonalAccessTokenInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createSubscriber_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateSubscriberInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateSubscriberInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateSubscriberInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createTFASetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateTFASettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateTFASettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTFASettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createTemplate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateTemplateInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateTemplateInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTemplateInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createUserSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateUserSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateUserSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserSettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateUserInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateUserInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.CreateWebhookInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNCreateWebhookInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateWebhookInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteAPIToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteContact_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteDocumentData_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteEntitlementPlanFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteEntitlementPlan_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteEntitlement_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteEntityType_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteEntity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteEvent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteFile_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteGroupMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteGroupSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteHush_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteIntegration_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteInvite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteOauthProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteOhAuthTooToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteOrgMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteOrganizationSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteOrganization_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deletePersonalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteSubscriber_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["email"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["email"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["ownerID"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ownerID"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteTemplate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateAPIToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateAPITokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateAPITokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateAPITokenInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateContact_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateContactInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateContactInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateContactInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateDocumentData_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateDocumentDataInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateDocumentDataInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateDocumentDataInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateEntitlementPlanFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateEntitlementPlanFeatureInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateEntitlementPlanFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntitlementPlanFeatureInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateEntitlementPlan_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateEntitlementPlanInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateEntitlementPlanInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntitlementPlanInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateEntitlement_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateEntitlementInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateEntitlementInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntitlementInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateEntityType_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateEntityTypeInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateEntityTypeInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntityTypeInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateEntity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateEntityInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateEntityInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntityInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateEvent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateEventInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateEventInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEventInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateFeatureInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateFeatureInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateFile_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateFileInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateFileInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateFileInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateGroupMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateGroupMembershipInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateGroupMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupMembershipInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateGroupSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateGroupSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateGroupSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupSettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateGroupInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateGroupInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateHush_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateHushInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateHushInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateHushInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateIntegration_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateIntegrationInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateIntegrationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateIntegrationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateInvite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateInviteInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateInviteInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateInviteInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateOauthProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateOauthProviderInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateOauthProviderInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOauthProviderInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateOhAuthTooToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateOhAuthTooTokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateOhAuthTooTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOhAuthTooTokenInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateOrgMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateOrgMembershipInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateOrgMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrgMembershipInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateOrganizationSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateOrganizationSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateOrganizationSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrganizationSettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateOrganization_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateOrganizationInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateOrganizationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrganizationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updatePersonalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdatePersonalAccessTokenInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdatePersonalAccessTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdatePersonalAccessTokenInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateSubscriber_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["email"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["email"] = arg0 + var arg1 generated.UpdateSubscriberInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateSubscriberInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateSubscriberInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateTFASetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 generated.UpdateTFASettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNUpdateTFASettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateTFASettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateTemplate_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateTemplateInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateTemplateInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateTemplateInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateUserSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateUserSettingInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateUserSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateUserSettingInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateUserInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateUserInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateUserInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateWebhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 generated.UpdateWebhookInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg1, err = ec.unmarshalNUpdateWebhookInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateWebhookInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Organization_children_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OrganizationOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOOrganizationOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.OrganizationWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOOrganizationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_apiToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_apiTokens_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.APITokenWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOAPITokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_auditLogs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *AuditLogWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOAuditLogWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_contactHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.ContactHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOContactHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_contact_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_contacts_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.ContactWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOContactWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_documentDataHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.DocumentDataHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalODocumentDataHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_documentDataSlice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.DocumentDataWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalODocumentDataWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_documentData_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_entities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntityOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOEntityOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.EntityWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOEntityWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_entitlementHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntitlementHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEntitlementHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_entitlementPlanFeatureHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntitlementPlanFeatureHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEntitlementPlanFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_entitlementPlanFeature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_entitlementPlanFeatures_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntitlementPlanFeatureWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEntitlementPlanFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_entitlementPlanHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntitlementPlanHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEntitlementPlanHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_entitlementPlan_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_entitlementPlans_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntitlementPlanWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEntitlementPlanWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_entitlement_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_entitlements_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntitlementWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEntitlementWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_entityHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntityHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOEntityHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.EntityHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOEntityHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_entityTypeHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntityTypeHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOEntityTypeHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.EntityTypeHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOEntityTypeHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_entityType_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_entityTypes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EntityTypeOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOEntityTypeOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.EntityTypeWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOEntityTypeWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_entity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_eventHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EventHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEventHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_event_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_events_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.EventWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOEventWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_featureHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.FeatureHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_feature_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_features_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.FeatureWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_fileHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.FileHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOFileHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_file_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_files_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.FileWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOFileWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_groupHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.GroupHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOGroupHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.GroupHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOGroupHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_groupMembershipHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.GroupMembershipHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOGroupMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_groupMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_groupMemberships_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.GroupMembershipWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOGroupMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_groupSettingHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.GroupSettingHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOGroupSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_groupSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_groupSettings_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.GroupSettingWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOGroupSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_group_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_groups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.GroupOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOGroupOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.GroupWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOGroupWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_hushHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.HushHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOHushHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.HushHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOHushHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_hush_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_hushes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.HushOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOHushOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.HushWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOHushWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_integrationHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.IntegrationHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOIntegrationHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.IntegrationHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOIntegrationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_integration_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_integrations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.IntegrationOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOIntegrationOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.IntegrationWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOIntegrationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_invite_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_invites_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.InviteWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOInviteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_node_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_nodes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []string + if tmp, ok := rawArgs["ids"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids")) + arg0, err = ec.unmarshalNID2ᚕstringᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ids"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_noteHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.NoteHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalONoteHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_notes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.NoteWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalONoteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_oauthProviderHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OauthProviderHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOOauthProviderHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_oauthProvider_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_oauthProviders_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OauthProviderWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOOauthProviderWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_ohAuthTooToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_ohAuthTooTokens_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OhAuthTooTokenWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOOhAuthTooTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_orgMembershipHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OrgMembershipHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOOrgMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_orgMembership_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_orgMemberships_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OrgMembershipWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOOrgMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_organizationHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OrganizationHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOOrganizationHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.OrganizationHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOOrganizationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_organizationSettingHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OrganizationSettingHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOOrganizationSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_organizationSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_organizationSettings_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OrganizationSettingWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOOrganizationSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_organization_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_organizations_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.OrganizationOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOOrganizationOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.OrganizationWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOOrganizationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_personalAccessToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_personalAccessTokens_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.PersonalAccessTokenWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOPersonalAccessTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["query"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("query")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["query"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_subscriber_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["email"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["email"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_subscribers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.SubscriberWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOSubscriberWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_templateHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.TemplateHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOTemplateHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.TemplateHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOTemplateHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_template_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_templates_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.TemplateOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOTemplateOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.TemplateWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOTemplateWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_tfaSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_tfaSettings_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.TFASettingWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOTFASettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_userHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.UserHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOUserHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.UserHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOUserHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_userSettingHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.UserSettingHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOUserSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_userSetting_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_userSettings_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.UserSettingWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg4, err = ec.unmarshalOUserSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg4 + return args, nil +} + +func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_users_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.UserOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOUserOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.UserWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOUserWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_webhookHistories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.WebhookHistoryOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOWebhookHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.WebhookHistoryWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOWebhookHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field_Query_webhook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_webhooks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *entgql.Cursor[string] + if tmp, ok := rawArgs["after"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + arg0, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["after"] = arg0 + var arg1 *int + if tmp, ok := rawArgs["first"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["first"] = arg1 + var arg2 *entgql.Cursor[string] + if tmp, ok := rawArgs["before"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + arg2, err = ec.unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, tmp) + if err != nil { + return nil, err + } + } + args["before"] = arg2 + var arg3 *int + if tmp, ok := rawArgs["last"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last")) + arg3, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + if err != nil { + return nil, err + } + } + args["last"] = arg3 + var arg4 *generated.WebhookOrder + if tmp, ok := rawArgs["orderBy"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("orderBy")) + arg4, err = ec.unmarshalOWebhookOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookOrder(ctx, tmp) + if err != nil { + return nil, err + } + } + args["orderBy"] = arg4 + var arg5 *generated.WebhookWhereInput + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg5, err = ec.unmarshalOWebhookWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg5 + return args, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _APIToken_id(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APIToken_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APIToken_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APIToken_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APIToken_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_tags(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_tags(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.Tags, 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_APIToken_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APIToken_name(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_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 { + 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_APIToken_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_token(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_token(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.Token, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_expiresAt(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_expiresAt(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.ExpiresAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_expiresAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APIToken_description(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_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_APIToken_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_scopes(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_scopes(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.Scopes, 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_APIToken_scopes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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) _APIToken_lastUsedAt(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_lastUsedAt(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.LastUsedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_lastUsedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APIToken_owner(ctx context.Context, field graphql.CollectedField, obj *generated.APIToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APIToken_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APIToken_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APIToken", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _APITokenBulkCreatePayload_apiTokens(ctx context.Context, field graphql.CollectedField, obj *APITokenBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenBulkCreatePayload_apiTokens(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.APITokens, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.APIToken) + fc.Result = res + return ec.marshalOAPIToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenBulkCreatePayload_apiTokens(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenBulkCreatePayload", + 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_APIToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_APIToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_APIToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_APIToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_APIToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_APIToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_APIToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_APIToken_tags(ctx, field) + case "ownerID": + return ec.fieldContext_APIToken_ownerID(ctx, field) + case "name": + return ec.fieldContext_APIToken_name(ctx, field) + case "token": + return ec.fieldContext_APIToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_APIToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_APIToken_description(ctx, field) + case "scopes": + return ec.fieldContext_APIToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_APIToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_APIToken_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APIToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _APITokenConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.APITokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.APITokenEdge) + fc.Result = res + return ec.marshalOAPITokenEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_APITokenEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_APITokenEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APITokenEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _APITokenConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.APITokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _APITokenConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.APITokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenConnection", + 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 fc, nil +} + +func (ec *executionContext) _APITokenCreatePayload_apiToken(ctx context.Context, field graphql.CollectedField, obj *APITokenCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenCreatePayload_apiToken(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.APIToken, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.APIToken) + fc.Result = res + return ec.marshalNAPIToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenCreatePayload_apiToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenCreatePayload", + 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_APIToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_APIToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_APIToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_APIToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_APIToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_APIToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_APIToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_APIToken_tags(ctx, field) + case "ownerID": + return ec.fieldContext_APIToken_ownerID(ctx, field) + case "name": + return ec.fieldContext_APIToken_name(ctx, field) + case "token": + return ec.fieldContext_APIToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_APIToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_APIToken_description(ctx, field) + case "scopes": + return ec.fieldContext_APIToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_APIToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_APIToken_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APIToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _APITokenDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *APITokenDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _APITokenEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.APITokenEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.APIToken) + fc.Result = res + return ec.marshalOAPIToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenEdge", + 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_APIToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_APIToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_APIToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_APIToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_APIToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_APIToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_APIToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_APIToken_tags(ctx, field) + case "ownerID": + return ec.fieldContext_APIToken_ownerID(ctx, field) + case "name": + return ec.fieldContext_APIToken_name(ctx, field) + case "token": + return ec.fieldContext_APIToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_APIToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_APIToken_description(ctx, field) + case "scopes": + return ec.fieldContext_APIToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_APIToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_APIToken_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APIToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _APITokenEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.APITokenEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenEdge", + 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 fc, nil +} + +func (ec *executionContext) _APITokenUpdatePayload_apiToken(ctx context.Context, field graphql.CollectedField, obj *APITokenUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_APITokenUpdatePayload_apiToken(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.APIToken, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.APIToken) + fc.Result = res + return ec.marshalNAPIToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_APITokenUpdatePayload_apiToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "APITokenUpdatePayload", + 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_APIToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_APIToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_APIToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_APIToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_APIToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_APIToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_APIToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_APIToken_tags(ctx, field) + case "ownerID": + return ec.fieldContext_APIToken_ownerID(ctx, field) + case "name": + return ec.fieldContext_APIToken_name(ctx, field) + case "token": + return ec.fieldContext_APIToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_APIToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_APIToken_description(ctx, field) + case "scopes": + return ec.fieldContext_APIToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_APIToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_APIToken_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APIToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuditLog_table(ctx context.Context, field graphql.CollectedField, obj *AuditLog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLog_table(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.Table, 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_AuditLog_table(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLog", + 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) _AuditLog_time(ctx context.Context, field graphql.CollectedField, obj *AuditLog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLog_time(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.Time, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLog_time(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuditLog_id(ctx context.Context, field graphql.CollectedField, obj *AuditLog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLog_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLog_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuditLog_operation(ctx context.Context, field graphql.CollectedField, obj *AuditLog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLog_operation(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.Operation, 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_AuditLog_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLog", + 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) _AuditLog_changes(ctx context.Context, field graphql.CollectedField, obj *AuditLog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLog_changes(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.Changes, 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_AuditLog_changes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLog", + 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) _AuditLog_updatedBy(ctx context.Context, field graphql.CollectedField, obj *AuditLog) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLog_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOID2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLog_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLog", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuditLogConnection_edges(ctx context.Context, field graphql.CollectedField, obj *AuditLogConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLogConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*AuditLogEdge) + fc.Result = res + return ec.marshalOAuditLogEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLogConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLogConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_AuditLogEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_AuditLogEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AuditLogEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuditLogConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *AuditLogConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLogConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLogConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLogConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuditLogConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *AuditLogConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLogConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLogConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLogConnection", + 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 fc, nil +} + +func (ec *executionContext) _AuditLogEdge_node(ctx context.Context, field graphql.CollectedField, obj *AuditLogEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLogEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*AuditLog) + fc.Result = res + return ec.marshalOAuditLog2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLog(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLogEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLogEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "table": + return ec.fieldContext_AuditLog_table(ctx, field) + case "time": + return ec.fieldContext_AuditLog_time(ctx, field) + case "id": + return ec.fieldContext_AuditLog_id(ctx, field) + case "operation": + return ec.fieldContext_AuditLog_operation(ctx, field) + case "changes": + return ec.fieldContext_AuditLog_changes(ctx, field) + case "updatedBy": + return ec.fieldContext_AuditLog_updatedBy(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AuditLog", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuditLogEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *AuditLogEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuditLogEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuditLogEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuditLogEdge", + 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 fc, nil +} + +func (ec *executionContext) _Contact_id(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Contact_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Contact_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Contact_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Contact_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_tags(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.Tags, 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_Contact_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Contact_fullName(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_fullName(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.FullName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_fullName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_title(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_title(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.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_company(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_company(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.Company, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_company(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_email(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_email(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.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_phoneNumber(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_phoneNumber(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.PhoneNumber, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_phoneNumber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_address(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_address(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.Address, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_address(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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) _Contact_status(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_status(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.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.(enums.UserStatus) + fc.Result = res + return ec.marshalNContactUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ContactUserStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Contact_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Contact_entities(ctx context.Context, field graphql.CollectedField, obj *generated.Contact) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Contact_entities(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.Entities(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Contact_entities(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Contact", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactBulkCreatePayload_contacts(ctx context.Context, field graphql.CollectedField, obj *ContactBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactBulkCreatePayload_contacts(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.Contacts, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Contact) + fc.Result = res + return ec.marshalOContact2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactBulkCreatePayload_contacts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactBulkCreatePayload", + 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_Contact_id(ctx, field) + case "createdAt": + return ec.fieldContext_Contact_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Contact_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Contact_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Contact_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Contact_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Contact_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Contact_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Contact_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_Contact_fullName(ctx, field) + case "title": + return ec.fieldContext_Contact_title(ctx, field) + case "company": + return ec.fieldContext_Contact_company(ctx, field) + case "email": + return ec.fieldContext_Contact_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Contact_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_Contact_address(ctx, field) + case "status": + return ec.fieldContext_Contact_status(ctx, field) + case "owner": + return ec.fieldContext_Contact_owner(ctx, field) + case "entities": + return ec.fieldContext_Contact_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Contact", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.ContactConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.ContactEdge) + fc.Result = res + return ec.marshalOContactEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_ContactEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_ContactEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.ContactConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.ContactConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactConnection", + 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 fc, nil +} + +func (ec *executionContext) _ContactCreatePayload_contact(ctx context.Context, field graphql.CollectedField, obj *ContactCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactCreatePayload_contact(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.Contact, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Contact) + fc.Result = res + return ec.marshalNContact2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactCreatePayload_contact(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactCreatePayload", + 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_Contact_id(ctx, field) + case "createdAt": + return ec.fieldContext_Contact_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Contact_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Contact_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Contact_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Contact_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Contact_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Contact_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Contact_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_Contact_fullName(ctx, field) + case "title": + return ec.fieldContext_Contact_title(ctx, field) + case "company": + return ec.fieldContext_Contact_company(ctx, field) + case "email": + return ec.fieldContext_Contact_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Contact_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_Contact_address(ctx, field) + case "status": + return ec.fieldContext_Contact_status(ctx, field) + case "owner": + return ec.fieldContext_Contact_owner(ctx, field) + case "entities": + return ec.fieldContext_Contact_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Contact", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *ContactDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.ContactEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Contact) + fc.Result = res + return ec.marshalOContact2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactEdge", + 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_Contact_id(ctx, field) + case "createdAt": + return ec.fieldContext_Contact_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Contact_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Contact_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Contact_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Contact_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Contact_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Contact_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Contact_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_Contact_fullName(ctx, field) + case "title": + return ec.fieldContext_Contact_title(ctx, field) + case "company": + return ec.fieldContext_Contact_company(ctx, field) + case "email": + return ec.fieldContext_Contact_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Contact_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_Contact_address(ctx, field) + case "status": + return ec.fieldContext_Contact_status(ctx, field) + case "owner": + return ec.fieldContext_Contact_owner(ctx, field) + case "entities": + return ec.fieldContext_Contact_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Contact", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.ContactEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactEdge", + 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 fc, nil +} + +func (ec *executionContext) _ContactHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNContactHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ContactHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_tags(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.Tags, 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_ContactHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_fullName(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_fullName(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.FullName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_fullName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_title(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_title(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.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_company(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_company(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.Company, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_company(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_email(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_email(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.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_phoneNumber(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_phoneNumber(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.PhoneNumber, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_phoneNumber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_address(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_address(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.Address, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_address(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + 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) _ContactHistory_status(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistory_status(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.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.(enums.UserStatus) + fc.Result = res + return ec.marshalNContactHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistory_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ContactHistoryUserStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.ContactHistoryEdge) + fc.Result = res + return ec.marshalOContactHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_ContactHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_ContactHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _ContactHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.ContactHistory) + fc.Result = res + return ec.marshalOContactHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistoryEdge", + 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_ContactHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_ContactHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_ContactHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_ContactHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_ContactHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_ContactHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_ContactHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_ContactHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_ContactHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_ContactHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_ContactHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_ContactHistory_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_ContactHistory_fullName(ctx, field) + case "title": + return ec.fieldContext_ContactHistory_title(ctx, field) + case "company": + return ec.fieldContext_ContactHistory_company(ctx, field) + case "email": + return ec.fieldContext_ContactHistory_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_ContactHistory_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_ContactHistory_address(ctx, field) + case "status": + return ec.fieldContext_ContactHistory_status(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ContactHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.ContactHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _ContactUpdatePayload_contact(ctx context.Context, field graphql.CollectedField, obj *ContactUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ContactUpdatePayload_contact(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.Contact, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Contact) + fc.Result = res + return ec.marshalNContact2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ContactUpdatePayload_contact(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ContactUpdatePayload", + 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_Contact_id(ctx, field) + case "createdAt": + return ec.fieldContext_Contact_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Contact_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Contact_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Contact_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Contact_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Contact_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Contact_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Contact_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_Contact_fullName(ctx, field) + case "title": + return ec.fieldContext_Contact_title(ctx, field) + case "company": + return ec.fieldContext_Contact_company(ctx, field) + case "email": + return ec.fieldContext_Contact_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Contact_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_Contact_address(ctx, field) + case "status": + return ec.fieldContext_Contact_status(ctx, field) + case "owner": + return ec.fieldContext_Contact_owner(ctx, field) + case "entities": + return ec.fieldContext_Contact_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Contact", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_id(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + 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) _DocumentData_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + 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) _DocumentData_tags(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_tags(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.Tags, 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_DocumentData_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + 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) _DocumentData_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + 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) _DocumentData_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_templateID(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_templateID(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.TemplateID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_templateID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_data(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_data(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.Data, 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.(customtypes.JSONObject) + fc.Result = res + return ec.marshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type JSON does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_owner(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_template(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_template(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.Template(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.(*generated.Template) + fc.Result = res + return ec.marshalNTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_template(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + 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_Template_id(ctx, field) + case "createdAt": + return ec.fieldContext_Template_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Template_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Template_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Template_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Template_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Template_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Template_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Template_ownerID(ctx, field) + case "name": + return ec.fieldContext_Template_name(ctx, field) + case "templateType": + return ec.fieldContext_Template_templateType(ctx, field) + case "description": + return ec.fieldContext_Template_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_Template_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_Template_uischema(ctx, field) + case "owner": + return ec.fieldContext_Template_owner(ctx, field) + case "documents": + return ec.fieldContext_Template_documents(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Template", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentData_entity(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentData) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentData_entity(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.Entity(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentData_entity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentData", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataBulkCreatePayload_documentData(ctx context.Context, field graphql.CollectedField, obj *DocumentDataBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataBulkCreatePayload_documentData(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.DocumentData, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.DocumentData) + fc.Result = res + return ec.marshalODocumentData2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataBulkCreatePayload_documentData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataBulkCreatePayload", + 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_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.DocumentDataEdge) + fc.Result = res + return ec.marshalODocumentDataEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_DocumentDataEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_DocumentDataEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataConnection", + 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 fc, nil +} + +func (ec *executionContext) _DocumentDataCreatePayload_documentData(ctx context.Context, field graphql.CollectedField, obj *DocumentDataCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataCreatePayload_documentData(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.DocumentData, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.DocumentData) + fc.Result = res + return ec.marshalNDocumentData2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataCreatePayload_documentData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataCreatePayload", + 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_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *DocumentDataDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.DocumentData) + fc.Result = res + return ec.marshalODocumentData2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataEdge", + 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_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataEdge", + 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 fc, nil +} + +func (ec *executionContext) _DocumentDataHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + 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) _DocumentDataHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNDocumentDataHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type DocumentDataHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + 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) _DocumentDataHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + 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) _DocumentDataHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_tags(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.Tags, 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_DocumentDataHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + 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) _DocumentDataHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + 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) _DocumentDataHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + 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) _DocumentDataHistory_templateID(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_templateID(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.TemplateID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_templateID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + 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) _DocumentDataHistory_data(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistory_data(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.Data, 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.(customtypes.JSONObject) + fc.Result = res + return ec.marshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistory_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type JSON does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.DocumentDataHistoryEdge) + fc.Result = res + return ec.marshalODocumentDataHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_DocumentDataHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_DocumentDataHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _DocumentDataHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.DocumentDataHistory) + fc.Result = res + return ec.marshalODocumentDataHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistoryEdge", + 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_DocumentDataHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_DocumentDataHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_DocumentDataHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_DocumentDataHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentDataHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentDataHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentDataHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentDataHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentDataHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentDataHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentDataHistory_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentDataHistory_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentDataHistory_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentDataHistory_data(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DocumentDataHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.DocumentDataHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _DocumentDataUpdatePayload_documentData(ctx context.Context, field graphql.CollectedField, obj *DocumentDataUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DocumentDataUpdatePayload_documentData(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.DocumentData, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.DocumentData) + fc.Result = res + return ec.marshalNDocumentData2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DocumentDataUpdatePayload_documentData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DocumentDataUpdatePayload", + 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_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_id(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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) _Entitlement_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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) _Entitlement_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_tags(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.Tags, 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_Entitlement_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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) _Entitlement_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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) _Entitlement_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_planID(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_planID(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.PlanID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_planID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_organizationID(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_organizationID(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.OrganizationID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_organizationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_externalCustomerID(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_externalCustomerID(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.ExternalCustomerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_externalCustomerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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) _Entitlement_externalSubscriptionID(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_externalSubscriptionID(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.ExternalSubscriptionID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_externalSubscriptionID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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) _Entitlement_expires(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_expires(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.Expires, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_expires(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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 fc, nil +} + +func (ec *executionContext) _Entitlement_expiresAt(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_expiresAt(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.ExpiresAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_expiresAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_cancelled(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_cancelled(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.Cancelled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_cancelled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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 fc, nil +} + +func (ec *executionContext) _Entitlement_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_plan(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_plan(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.Plan(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.(*generated.EntitlementPlan) + fc.Result = res + return ec.marshalNEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_plan(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_organization(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_organization(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.Organization(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.(*generated.Organization) + fc.Result = res + return ec.marshalNOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entitlement_events(ctx context.Context, field graphql.CollectedField, obj *generated.Entitlement) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entitlement_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entitlement_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entitlement", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementBulkCreatePayload_entitlements(ctx context.Context, field graphql.CollectedField, obj *EntitlementBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementBulkCreatePayload_entitlements(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.Entitlements, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entitlement) + fc.Result = res + return ec.marshalOEntitlement2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementBulkCreatePayload_entitlements(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementBulkCreatePayload", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementEdge) + fc.Result = res + return ec.marshalOEntitlementEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntitlementEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntitlementEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementCreatePayload_entitlement(ctx context.Context, field graphql.CollectedField, obj *EntitlementCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementCreatePayload_entitlement(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.Entitlement, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Entitlement) + fc.Result = res + return ec.marshalNEntitlement2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementCreatePayload_entitlement(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementCreatePayload", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *EntitlementDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Entitlement) + fc.Result = res + return ec.marshalOEntitlement2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementEdge", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNEntitlementHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type EntitlementHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_tags(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.Tags, 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_EntitlementHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_planID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_planID(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.PlanID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_planID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_organizationID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_organizationID(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.OrganizationID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_organizationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_externalCustomerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_externalCustomerID(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.ExternalCustomerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_externalCustomerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_externalSubscriptionID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_externalSubscriptionID(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.ExternalSubscriptionID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_externalSubscriptionID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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) _EntitlementHistory_expires(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_expires(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.Expires, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_expires(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementHistory_expiresAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_expiresAt(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.ExpiresAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_expiresAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistory_cancelled(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistory_cancelled(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.Cancelled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistory_cancelled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistory", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementHistoryEdge) + fc.Result = res + return ec.marshalOEntitlementHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntitlementHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntitlementHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntitlementHistory) + fc.Result = res + return ec.marshalOEntitlementHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistoryEdge", + 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_EntitlementHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_EntitlementHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_EntitlementHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_EntitlementHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementHistory_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementHistory_ownerID(ctx, field) + case "planID": + return ec.fieldContext_EntitlementHistory_planID(ctx, field) + case "organizationID": + return ec.fieldContext_EntitlementHistory_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_EntitlementHistory_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_EntitlementHistory_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_EntitlementHistory_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_EntitlementHistory_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_EntitlementHistory_cancelled(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlan_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_tags(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.Tags, 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_EntitlementPlan_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_name(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_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 { + 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_EntitlementPlan_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_description(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_version(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_version(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.Version, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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) _EntitlementPlan_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_owner(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_entitlements(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_entitlements(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.Entitlements(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entitlement) + fc.Result = res + return ec.marshalOEntitlement2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_entitlements(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_baseFeatures(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_baseFeatures(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.BaseFeatures(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Feature) + fc.Result = res + return ec.marshalOFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_baseFeatures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_events(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlan_features(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlan_features(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.Features(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalOEntitlementPlanFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlan_features(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlan", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanBulkCreatePayload_entitlementPlans(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanBulkCreatePayload_entitlementPlans(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.EntitlementPlans, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlan) + fc.Result = res + return ec.marshalOEntitlementPlan2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanBulkCreatePayload_entitlementPlans(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanBulkCreatePayload", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanEdge) + fc.Result = res + return ec.marshalOEntitlementPlanEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntitlementPlanEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntitlementPlanEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanCreatePayload_entitlementPlan(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanCreatePayload_entitlementPlan(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.EntitlementPlan, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlan) + fc.Result = res + return ec.marshalNEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanCreatePayload_entitlementPlan(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanCreatePayload", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlan) + fc.Result = res + return ec.marshalOEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanEdge", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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) _EntitlementPlanFeature_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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) _EntitlementPlanFeature_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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) _EntitlementPlanFeature_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_tags(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.Tags, 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_EntitlementPlanFeature_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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) _EntitlementPlanFeature_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_planID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_planID(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.PlanID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_planID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_featureID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_featureID(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.FeatureID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_featureID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_owner(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_plan(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_plan(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.Plan(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.(*generated.EntitlementPlan) + fc.Result = res + return ec.marshalNEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_plan(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_feature(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_feature(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.Feature(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.(*generated.Feature) + fc.Result = res + return ec.marshalNFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_feature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeature_events(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeature_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeature_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeature", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureBulkCreatePayload_entitlementPlanFeatures(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanFeatureBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureBulkCreatePayload_entitlementPlanFeatures(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.EntitlementPlanFeatures, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalOEntitlementPlanFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureBulkCreatePayload_entitlementPlanFeatures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureBulkCreatePayload", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanFeatureEdge) + fc.Result = res + return ec.marshalOEntitlementPlanFeatureEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntitlementPlanFeatureEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntitlementPlanFeatureEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureCreatePayload_entitlementPlanFeature(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanFeatureCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureCreatePayload_entitlementPlanFeature(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.EntitlementPlanFeature, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalNEntitlementPlanFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureCreatePayload_entitlementPlanFeature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureCreatePayload", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanFeatureDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalOEntitlementPlanFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureEdge", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type EntitlementPlanFeatureHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_tags(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.Tags, 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_EntitlementPlanFeatureHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistory_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistory_planID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_planID(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.PlanID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_planID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistory_featureID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistory_featureID(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.FeatureID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistory_featureID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistory", + 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) _EntitlementPlanFeatureHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanFeatureHistoryEdge) + fc.Result = res + return ec.marshalOEntitlementPlanFeatureHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntitlementPlanFeatureHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntitlementPlanFeatureHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanFeatureHistory) + fc.Result = res + return ec.marshalOEntitlementPlanFeatureHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistoryEdge", + 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_EntitlementPlanFeatureHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_EntitlementPlanFeatureHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_EntitlementPlanFeatureHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_EntitlementPlanFeatureHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeatureHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeatureHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeatureHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeatureHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeatureHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeatureHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeatureHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeatureHistory_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeatureHistory_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeatureHistory_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeatureHistory_featureID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanFeatureHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanFeatureUpdatePayload_entitlementPlanFeature(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanFeatureUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanFeatureUpdatePayload_entitlementPlanFeature(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.EntitlementPlanFeature, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalNEntitlementPlanFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanFeatureUpdatePayload_entitlementPlanFeature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanFeatureUpdatePayload", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNEntitlementPlanHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type EntitlementPlanHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_tags(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.Tags, 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_EntitlementPlanHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_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 { + 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_EntitlementPlanHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_version(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_version(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.Version, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + 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) _EntitlementPlanHistory_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistory_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistory_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanHistoryEdge) + fc.Result = res + return ec.marshalOEntitlementPlanHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntitlementPlanHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntitlementPlanHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanHistory) + fc.Result = res + return ec.marshalOEntitlementPlanHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistoryEdge", + 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_EntitlementPlanHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_EntitlementPlanHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_EntitlementPlanHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_EntitlementPlanHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanHistory_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlanHistory_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlanHistory_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlanHistory_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlanHistory_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanHistory_metadata(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementPlanHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntitlementPlanHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntitlementPlanUpdatePayload_entitlementPlan(ctx context.Context, field graphql.CollectedField, obj *EntitlementPlanUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementPlanUpdatePayload_entitlementPlan(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.EntitlementPlan, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlan) + fc.Result = res + return ec.marshalNEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementPlanUpdatePayload_entitlementPlan(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementPlanUpdatePayload", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntitlementUpdatePayload_entitlement(ctx context.Context, field graphql.CollectedField, obj *EntitlementUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntitlementUpdatePayload_entitlement(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.Entitlement, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Entitlement) + fc.Result = res + return ec.marshalNEntitlement2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntitlementUpdatePayload_entitlement(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntitlementUpdatePayload", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_id(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_tags(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.Tags, 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_Entity_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_name(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_description(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_domains(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_domains(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.Domains, 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_Entity_domains(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_entityTypeID(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_entityTypeID(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.EntityTypeID, 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.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_entityTypeID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_status(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_status(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.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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) _Entity_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_contacts(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_contacts(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.Contacts(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Contact) + fc.Result = res + return ec.marshalOContact2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_contacts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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_Contact_id(ctx, field) + case "createdAt": + return ec.fieldContext_Contact_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Contact_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Contact_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Contact_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Contact_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Contact_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Contact_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Contact_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_Contact_fullName(ctx, field) + case "title": + return ec.fieldContext_Contact_title(ctx, field) + case "company": + return ec.fieldContext_Contact_company(ctx, field) + case "email": + return ec.fieldContext_Contact_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Contact_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_Contact_address(ctx, field) + case "status": + return ec.fieldContext_Contact_status(ctx, field) + case "owner": + return ec.fieldContext_Contact_owner(ctx, field) + case "entities": + return ec.fieldContext_Contact_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Contact", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_documents(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_documents(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.Documents(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.DocumentData) + fc.Result = res + return ec.marshalODocumentData2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_documents(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_notes(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_notes(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.Notes(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Note) + fc.Result = res + return ec.marshalONote2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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_Note_id(ctx, field) + case "createdAt": + return ec.fieldContext_Note_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Note_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Note_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Note_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Note_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Note_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Note_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Note_ownerID(ctx, field) + case "text": + return ec.fieldContext_Note_text(ctx, field) + case "owner": + return ec.fieldContext_Note_owner(ctx, field) + case "entity": + return ec.fieldContext_Note_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Note", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_files(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_files(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.Files(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.File) + fc.Result = res + return ec.marshalOFile2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Entity_entityType(ctx context.Context, field graphql.CollectedField, obj *generated.Entity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Entity_entityType(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.EntityType(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntityType) + fc.Result = res + return ec.marshalOEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Entity_entityType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Entity", + 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_EntityType_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntityType_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityType_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityType_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityType_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityType_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityType_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityType_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityType_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityType_name(ctx, field) + case "owner": + return ec.fieldContext_EntityType_owner(ctx, field) + case "entities": + return ec.fieldContext_EntityType_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityType", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityBulkCreatePayload_entities(ctx context.Context, field graphql.CollectedField, obj *EntityBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityBulkCreatePayload_entities(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.Entities, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityBulkCreatePayload_entities(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityBulkCreatePayload", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntityConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntityEdge) + fc.Result = res + return ec.marshalOEntityEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntityEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntityEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntityConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntityConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntityCreatePayload_entity(ctx context.Context, field graphql.CollectedField, obj *EntityCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityCreatePayload_entity(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.Entity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Entity) + fc.Result = res + return ec.marshalNEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityCreatePayload_entity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityCreatePayload", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *EntityDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntityEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityEdge", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntityEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntityHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNEntityHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type EntityHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_tags(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.Tags, 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_EntityHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_domains(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_domains(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.Domains, 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_EntityHistory_domains(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_entityTypeID(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_entityTypeID(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.EntityTypeID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_entityTypeID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistory_status(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistory_status(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.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistory_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistory", + 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) _EntityHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntityHistoryEdge) + fc.Result = res + return ec.marshalOEntityHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntityHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntityHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntityHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntityHistory) + fc.Result = res + return ec.marshalOEntityHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistoryEdge", + 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_EntityHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_EntityHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_EntityHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_EntityHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_EntityHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityHistory_name(ctx, field) + case "displayName": + return ec.fieldContext_EntityHistory_displayName(ctx, field) + case "description": + return ec.fieldContext_EntityHistory_description(ctx, field) + case "domains": + return ec.fieldContext_EntityHistory_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_EntityHistory_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_EntityHistory_status(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntityHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntityType_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityType_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityType_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityType_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + 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) _EntityType_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + 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) _EntityType_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityType_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + 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) _EntityType_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_tags(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.Tags, 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_EntityType_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + 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) _EntityType_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityType_name(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_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 { + 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_EntityType_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + 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) _EntityType_owner(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityType_entities(ctx context.Context, field graphql.CollectedField, obj *generated.EntityType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityType_entities(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.Entities(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityType_entities(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityType", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeBulkCreatePayload_entityTypes(ctx context.Context, field graphql.CollectedField, obj *EntityTypeBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeBulkCreatePayload_entityTypes(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.EntityTypes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntityType) + fc.Result = res + return ec.marshalOEntityType2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeBulkCreatePayload_entityTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeBulkCreatePayload", + 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_EntityType_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntityType_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityType_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityType_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityType_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityType_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityType_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityType_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityType_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityType_name(ctx, field) + case "owner": + return ec.fieldContext_EntityType_owner(ctx, field) + case "entities": + return ec.fieldContext_EntityType_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityType", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntityTypeEdge) + fc.Result = res + return ec.marshalOEntityTypeEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntityTypeEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntityTypeEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntityTypeCreatePayload_entityType(ctx context.Context, field graphql.CollectedField, obj *EntityTypeCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeCreatePayload_entityType(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.EntityType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntityType) + fc.Result = res + return ec.marshalNEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeCreatePayload_entityType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeCreatePayload", + 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_EntityType_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntityType_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityType_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityType_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityType_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityType_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityType_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityType_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityType_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityType_name(ctx, field) + case "owner": + return ec.fieldContext_EntityType_owner(ctx, field) + case "entities": + return ec.fieldContext_EntityType_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityType", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *EntityTypeDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntityType) + fc.Result = res + return ec.marshalOEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeEdge", + 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_EntityType_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntityType_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityType_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityType_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityType_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityType_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityType_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityType_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityType_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityType_name(ctx, field) + case "owner": + return ec.fieldContext_EntityType_owner(ctx, field) + case "entities": + return ec.fieldContext_EntityType_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityType", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntityTypeHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + 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) _EntityTypeHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNEntityTypeHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type EntityTypeHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + 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) _EntityTypeHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + 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) _EntityTypeHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + 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) _EntityTypeHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_tags(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.Tags, 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_EntityTypeHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + 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) _EntityTypeHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + 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) _EntityTypeHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistory_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 { + 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_EntityTypeHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistory", + 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) _EntityTypeHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntityTypeHistoryEdge) + fc.Result = res + return ec.marshalOEntityTypeHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EntityTypeHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EntityTypeHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _EntityTypeHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EntityTypeHistory) + fc.Result = res + return ec.marshalOEntityTypeHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistoryEdge", + 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_EntityTypeHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_EntityTypeHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_EntityTypeHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_EntityTypeHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_EntityTypeHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityTypeHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityTypeHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityTypeHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityTypeHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityTypeHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityTypeHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityTypeHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityTypeHistory_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityTypeHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EntityTypeHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _EntityTypeUpdatePayload_entityType(ctx context.Context, field graphql.CollectedField, obj *EntityTypeUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityTypeUpdatePayload_entityType(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.EntityType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntityType) + fc.Result = res + return ec.marshalNEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityTypeUpdatePayload_entityType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityTypeUpdatePayload", + 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_EntityType_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntityType_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityType_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityType_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityType_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityType_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityType_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityType_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityType_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityType_name(ctx, field) + case "owner": + return ec.fieldContext_EntityType_owner(ctx, field) + case "entities": + return ec.fieldContext_EntityType_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityType", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EntityUpdatePayload_entity(ctx context.Context, field graphql.CollectedField, obj *EntityUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EntityUpdatePayload_entity(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.Entity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Entity) + fc.Result = res + return ec.marshalNEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EntityUpdatePayload_entity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EntityUpdatePayload", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_id(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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) _Event_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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) _Event_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_tags(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.Tags, 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_Event_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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) _Event_eventID(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_eventID(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.EventID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_eventID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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) _Event_correlationID(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_correlationID(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.CorrelationID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_correlationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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) _Event_eventType(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_eventType(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.EventType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_eventType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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) _Event_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_user(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_user(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.User(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.User) + fc.Result = res + return ec.marshalOUser2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_group(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_group(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.Group(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_group(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_integration(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_integration(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.Integration(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_integration(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_organization(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_organization(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.Organization(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_invite(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_invite(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.Invite(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Invite) + fc.Result = res + return ec.marshalOInvite2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_invite(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Invite_id(ctx, field) + case "createdAt": + return ec.fieldContext_Invite_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Invite_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Invite_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Invite_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Invite_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Invite_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Invite_ownerID(ctx, field) + case "expires": + return ec.fieldContext_Invite_expires(ctx, field) + case "recipient": + return ec.fieldContext_Invite_recipient(ctx, field) + case "status": + return ec.fieldContext_Invite_status(ctx, field) + case "role": + return ec.fieldContext_Invite_role(ctx, field) + case "sendAttempts": + return ec.fieldContext_Invite_sendAttempts(ctx, field) + case "requestorID": + return ec.fieldContext_Invite_requestorID(ctx, field) + case "owner": + return ec.fieldContext_Invite_owner(ctx, field) + case "events": + return ec.fieldContext_Invite_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invite", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_feature(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_feature(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.Feature(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Feature) + fc.Result = res + return ec.marshalOFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_feature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_entitlementplan(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_entitlementplan(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.Entitlementplan(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlan) + fc.Result = res + return ec.marshalOEntitlementPlan2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_entitlementplan(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_entitlementplanfeature(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_entitlementplanfeature(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.Entitlementplanfeature(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalOEntitlementPlanFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_entitlementplanfeature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_personalAccessToken(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_personalAccessToken(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.PersonalAccessToken(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalOPersonalAccessToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_personalAccessToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_oauth2token(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_oauth2token(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.Oauth2token(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OhAuthTooToken) + fc.Result = res + return ec.marshalOOhAuthTooToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_oauth2token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_OhAuthTooToken_id(ctx, field) + case "tags": + return ec.fieldContext_OhAuthTooToken_tags(ctx, field) + case "clientID": + return ec.fieldContext_OhAuthTooToken_clientID(ctx, field) + case "scopes": + return ec.fieldContext_OhAuthTooToken_scopes(ctx, field) + case "nonce": + return ec.fieldContext_OhAuthTooToken_nonce(ctx, field) + case "claimsUserID": + return ec.fieldContext_OhAuthTooToken_claimsUserID(ctx, field) + case "claimsUsername": + return ec.fieldContext_OhAuthTooToken_claimsUsername(ctx, field) + case "claimsEmail": + return ec.fieldContext_OhAuthTooToken_claimsEmail(ctx, field) + case "claimsEmailVerified": + return ec.fieldContext_OhAuthTooToken_claimsEmailVerified(ctx, field) + case "claimsGroups": + return ec.fieldContext_OhAuthTooToken_claimsGroups(ctx, field) + case "claimsPreferredUsername": + return ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(ctx, field) + case "connectorID": + return ec.fieldContext_OhAuthTooToken_connectorID(ctx, field) + case "connectorData": + return ec.fieldContext_OhAuthTooToken_connectorData(ctx, field) + case "lastUsed": + return ec.fieldContext_OhAuthTooToken_lastUsed(ctx, field) + case "integration": + return ec.fieldContext_OhAuthTooToken_integration(ctx, field) + case "events": + return ec.fieldContext_OhAuthTooToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_hush(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_hush(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.Hush(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Hush) + fc.Result = res + return ec.marshalOHush2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_hush(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_orgmembership(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_orgmembership(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.Orgmembership(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrgMembership) + fc.Result = res + return ec.marshalOOrgMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_orgmembership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_groupmembership(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_groupmembership(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.Groupmembership(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupMembership) + fc.Result = res + return ec.marshalOGroupMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_groupmembership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_entitlement(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_entitlement(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.Entitlement(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entitlement) + fc.Result = res + return ec.marshalOEntitlement2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_entitlement(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_webhook(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_webhook(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.Webhook(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Webhook) + fc.Result = res + return ec.marshalOWebhook2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_webhook(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Event_subscriber(ctx context.Context, field graphql.CollectedField, obj *generated.Event) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Event_subscriber(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.Subscriber(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Subscriber) + fc.Result = res + return ec.marshalOSubscriber2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Event_subscriber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Event", + 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_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventBulkCreatePayload_events(ctx context.Context, field graphql.CollectedField, obj *EventBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventBulkCreatePayload_events(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.Events, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventBulkCreatePayload_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventBulkCreatePayload", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EventConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EventEdge) + fc.Result = res + return ec.marshalOEventEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EventEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EventEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EventConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EventConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventConnection", + 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 fc, nil +} + +func (ec *executionContext) _EventCreatePayload_event(ctx context.Context, field graphql.CollectedField, obj *EventCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventCreatePayload_event(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.Event, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Event) + fc.Result = res + return ec.marshalNEvent2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventCreatePayload_event(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventCreatePayload", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *EventDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EventEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EventEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventEdge", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EventEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventEdge", + 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 fc, nil +} + +func (ec *executionContext) _EventHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + 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) _EventHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNEventHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type EventHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + 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) _EventHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + 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) _EventHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_tags(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.Tags, 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_EventHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + 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) _EventHistory_eventID(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_eventID(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.EventID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_eventID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + 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) _EventHistory_correlationID(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_correlationID(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.CorrelationID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_correlationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + 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) _EventHistory_eventType(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_eventType(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.EventType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_eventType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + 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) _EventHistory_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistory_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistory_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EventHistoryEdge) + fc.Result = res + return ec.marshalOEventHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_EventHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_EventHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _EventHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.EventHistory) + fc.Result = res + return ec.marshalOEventHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistoryEdge", + 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_EventHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_EventHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_EventHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_EventHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_EventHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EventHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EventHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EventHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_EventHistory_tags(ctx, field) + case "eventID": + return ec.fieldContext_EventHistory_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_EventHistory_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_EventHistory_eventType(ctx, field) + case "metadata": + return ec.fieldContext_EventHistory_metadata(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _EventHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.EventHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _EventUpdatePayload_event(ctx context.Context, field graphql.CollectedField, obj *EventUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EventUpdatePayload_event(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.Event, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Event) + fc.Result = res + return ec.marshalNEvent2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_EventUpdatePayload_event(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "EventUpdatePayload", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_id(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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) _Feature_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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) _Feature_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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) _Feature_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_tags(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.Tags, 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_Feature_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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) _Feature_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_name(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_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 { + 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_Feature_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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) _Feature_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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) _Feature_enabled(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_enabled(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.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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 fc, nil +} + +func (ec *executionContext) _Feature_description(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_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_Feature_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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) _Feature_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_plans(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_plans(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.Plans(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlan) + fc.Result = res + return ec.marshalOEntitlementPlan2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_plans(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_events(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Feature_features(ctx context.Context, field graphql.CollectedField, obj *generated.Feature) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Feature_features(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.Features(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalOEntitlementPlanFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Feature_features(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Feature", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureBulkCreatePayload_features(ctx context.Context, field graphql.CollectedField, obj *FeatureBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureBulkCreatePayload_features(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.Features, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Feature) + fc.Result = res + return ec.marshalOFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureBulkCreatePayload_features(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureBulkCreatePayload", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.FeatureEdge) + fc.Result = res + return ec.marshalOFeatureEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_FeatureEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FeatureEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureConnection", + 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 fc, nil +} + +func (ec *executionContext) _FeatureCreatePayload_feature(ctx context.Context, field graphql.CollectedField, obj *FeatureCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureCreatePayload_feature(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.Feature, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Feature) + fc.Result = res + return ec.marshalNFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureCreatePayload_feature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureCreatePayload", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *FeatureDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Feature) + fc.Result = res + return ec.marshalOFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureEdge", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureEdge", + 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 fc, nil +} + +func (ec *executionContext) _FeatureHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type FeatureHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_tags(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.Tags, 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_FeatureHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_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 { + 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_FeatureHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_enabled(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_enabled(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.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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 fc, nil +} + +func (ec *executionContext) _FeatureHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_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_FeatureHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + 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) _FeatureHistory_metadata(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistory_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistory_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Map does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.FeatureHistoryEdge) + fc.Result = res + return ec.marshalOFeatureHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_FeatureHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FeatureHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _FeatureHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.FeatureHistory) + fc.Result = res + return ec.marshalOFeatureHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistoryEdge", + 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_FeatureHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_FeatureHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_FeatureHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_FeatureHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_FeatureHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_FeatureHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_FeatureHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_FeatureHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_FeatureHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_FeatureHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_FeatureHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_FeatureHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_FeatureHistory_name(ctx, field) + case "displayName": + return ec.fieldContext_FeatureHistory_displayName(ctx, field) + case "enabled": + return ec.fieldContext_FeatureHistory_enabled(ctx, field) + case "description": + return ec.fieldContext_FeatureHistory_description(ctx, field) + case "metadata": + return ec.fieldContext_FeatureHistory_metadata(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FeatureHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.FeatureHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _FeatureUpdatePayload_feature(ctx context.Context, field graphql.CollectedField, obj *FeatureUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FeatureUpdatePayload_feature(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.Feature, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Feature) + fc.Result = res + return ec.marshalNFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FeatureUpdatePayload_feature(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FeatureUpdatePayload", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _File_id(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _File_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _File_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _File_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _File_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_tags(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_tags(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.Tags, 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_File_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_fileName(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_fileName(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.FileName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_fileName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_fileExtension(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_fileExtension(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.FileExtension, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_fileExtension(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_fileSize(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_fileSize(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.FileSize, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_fileSize(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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 fc, nil +} + +func (ec *executionContext) _File_contentType(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_contentType(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.ContentType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_contentType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_storeKey(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_storeKey(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.StoreKey, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_storeKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_category(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_category(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.Category, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_annotation(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_annotation(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.Annotation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_annotation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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) _File_user(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_user(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.User(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.User) + fc.Result = res + return ec.marshalOUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _File_organization(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_organization(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.Organization(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _File_entity(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_entity(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.Entity(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_entity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _File_group(ctx context.Context, field graphql.CollectedField, obj *generated.File) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_File_group(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.Group(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_File_group(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "File", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileBulkCreatePayload_files(ctx context.Context, field graphql.CollectedField, obj *FileBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileBulkCreatePayload_files(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.Files, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.File) + fc.Result = res + return ec.marshalOFile2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileBulkCreatePayload_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileBulkCreatePayload", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.FileConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.FileEdge) + fc.Result = res + return ec.marshalOFileEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_FileEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FileEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.FileConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.FileConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileConnection", + 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 fc, nil +} + +func (ec *executionContext) _FileCreatePayload_file(ctx context.Context, field graphql.CollectedField, obj *FileCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileCreatePayload_file(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.File, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.File) + fc.Result = res + return ec.marshalNFile2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileCreatePayload_file(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileCreatePayload", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *FileDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FileEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.FileEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.File) + fc.Result = res + return ec.marshalOFile2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileEdge", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.FileEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileEdge", + 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 fc, nil +} + +func (ec *executionContext) _FileHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNFileHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type FileHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_tags(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.Tags, 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_FileHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_fileName(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_fileName(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.FileName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_fileName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_fileExtension(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_fileExtension(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.FileExtension, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_fileExtension(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_fileSize(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_fileSize(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.FileSize, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_fileSize(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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 fc, nil +} + +func (ec *executionContext) _FileHistory_contentType(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_contentType(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.ContentType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_contentType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_storeKey(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_storeKey(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.StoreKey, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_storeKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_category(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_category(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.Category, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_category(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistory_annotation(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistory_annotation(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.Annotation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistory_annotation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistory", + 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) _FileHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.FileHistoryEdge) + fc.Result = res + return ec.marshalOFileHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_FileHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_FileHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _FileHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.FileHistory) + fc.Result = res + return ec.marshalOFileHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistoryEdge", + 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_FileHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_FileHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_FileHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_FileHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_FileHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_FileHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_FileHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_FileHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_FileHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_FileHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_FileHistory_tags(ctx, field) + case "fileName": + return ec.fieldContext_FileHistory_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_FileHistory_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_FileHistory_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_FileHistory_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_FileHistory_storeKey(ctx, field) + case "category": + return ec.fieldContext_FileHistory_category(ctx, field) + case "annotation": + return ec.fieldContext_FileHistory_annotation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _FileHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.FileHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _FileUpdatePayload_file(ctx context.Context, field graphql.CollectedField, obj *FileUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FileUpdatePayload_file(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.File, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.File) + fc.Result = res + return ec.marshalNFile2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FileUpdatePayload_file(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FileUpdatePayload", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GlobalSearchResultConnection_page(ctx context.Context, field graphql.CollectedField, obj *GlobalSearchResultConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GlobalSearchResultConnection_page(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.Page, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GlobalSearchResultConnection_page(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GlobalSearchResultConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GlobalSearchResultConnection_nodes(ctx context.Context, field graphql.CollectedField, obj *GlobalSearchResultConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GlobalSearchResultConnection_nodes(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.Nodes, 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.([]GlobalSearchResult) + fc.Result = res + return ec.marshalNGlobalSearchResult2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGlobalSearchResultᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GlobalSearchResultConnection_nodes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GlobalSearchResultConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GlobalSearchResult does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_id(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_tags(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.Tags, 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_Group_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_name(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_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 { + 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_Group_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_description(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_gravatarLogoURL(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_gravatarLogoURL(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.GravatarLogoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_gravatarLogoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_logoURL(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_logoURL(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.LogoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_logoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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) _Group_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_setting(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_setting(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.Setting(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.(*generated.GroupSetting) + fc.Result = res + return ec.marshalNGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_setting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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_GroupSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupSetting_deletedBy(ctx, field) + case "visibility": + return ec.fieldContext_GroupSetting_visibility(ctx, field) + case "joinPolicy": + return ec.fieldContext_GroupSetting_joinPolicy(ctx, field) + case "syncToSlack": + return ec.fieldContext_GroupSetting_syncToSlack(ctx, field) + case "syncToGithub": + return ec.fieldContext_GroupSetting_syncToGithub(ctx, field) + case "groupID": + return ec.fieldContext_GroupSetting_groupID(ctx, field) + case "group": + return ec.fieldContext_GroupSetting_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_users(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_users(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.Users(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.User) + fc.Result = res + return ec.marshalOUser2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_users(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_events(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_integrations(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_integrations(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.Integrations(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_integrations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_files(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_files(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.Files(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.File) + fc.Result = res + return ec.marshalOFile2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Group_members(ctx context.Context, field graphql.CollectedField, obj *generated.Group) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Group_members(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.Members(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupMembership) + fc.Result = res + return ec.marshalOGroupMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Group_members(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Group", + 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_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupBulkCreatePayload_groups(ctx context.Context, field graphql.CollectedField, obj *GroupBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupBulkCreatePayload_groups(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.Groups, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupBulkCreatePayload_groups(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupBulkCreatePayload", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupEdge) + fc.Result = res + return ec.marshalOGroupEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_GroupEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.GroupConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupConnection", + 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 fc, nil +} + +func (ec *executionContext) _GroupCreatePayload_group(ctx context.Context, field graphql.CollectedField, obj *GroupCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupCreatePayload_group(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.Group, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Group) + fc.Result = res + return ec.marshalNGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupCreatePayload_group(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupCreatePayload", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *GroupDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupEdge", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.GroupEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupEdge", + 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 fc, nil +} + +func (ec *executionContext) _GroupHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNGroupHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_tags(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.Tags, 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_GroupHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_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 { + 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_GroupHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_gravatarLogoURL(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_gravatarLogoURL(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.GravatarLogoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_gravatarLogoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_logoURL(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_logoURL(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.LogoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_logoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistory_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistory_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistory_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistory", + 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) _GroupHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupHistoryEdge) + fc.Result = res + return ec.marshalOGroupHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_GroupHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _GroupHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.GroupHistory) + fc.Result = res + return ec.marshalOGroupHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistoryEdge", + 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_GroupHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_GroupHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_GroupHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_GroupHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_GroupHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_GroupHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_GroupHistory_name(ctx, field) + case "description": + return ec.fieldContext_GroupHistory_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_GroupHistory_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_GroupHistory_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_GroupHistory_displayName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.GroupHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _GroupMembership_id(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + 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) _GroupMembership_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + 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) _GroupMembership_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + 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) _GroupMembership_role(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_role(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.Role, 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.(enums.Role) + fc.Result = res + return ec.marshalNGroupMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupMembershipRole does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_groupID(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_groupID(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.GroupID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_groupID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_userID(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_userID(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.UserID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_group(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_group(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.Group(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.(*generated.Group) + fc.Result = res + return ec.marshalNGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_group(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_user(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_user(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.User(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.(*generated.User) + fc.Result = res + return ec.marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembership_events(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembership_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembership_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembership", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipBulkCreatePayload_groupMemberships(ctx context.Context, field graphql.CollectedField, obj *GroupMembershipBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipBulkCreatePayload_groupMemberships(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.GroupMemberships, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupMembership) + fc.Result = res + return ec.marshalOGroupMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipBulkCreatePayload_groupMemberships(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipBulkCreatePayload", + 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_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupMembershipEdge) + fc.Result = res + return ec.marshalOGroupMembershipEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_GroupMembershipEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupMembershipEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipConnection", + 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 fc, nil +} + +func (ec *executionContext) _GroupMembershipCreatePayload_groupMembership(ctx context.Context, field graphql.CollectedField, obj *GroupMembershipCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipCreatePayload_groupMembership(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.GroupMembership, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupMembership) + fc.Result = res + return ec.marshalNGroupMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipCreatePayload_groupMembership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipCreatePayload", + 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_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *GroupMembershipDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.GroupMembership) + fc.Result = res + return ec.marshalOGroupMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipEdge", + 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_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipEdge", + 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 fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + 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) _GroupMembershipHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNGroupMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupMembershipHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + 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) _GroupMembershipHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + 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) _GroupMembershipHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + 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) _GroupMembershipHistory_role(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_role(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.Role, 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.(enums.Role) + fc.Result = res + return ec.marshalNGroupMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupMembershipHistoryRole does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistory_groupID(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_groupID(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.GroupID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_groupID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + 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) _GroupMembershipHistory_userID(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistory_userID(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.UserID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistory_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistory", + 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) _GroupMembershipHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupMembershipHistoryEdge) + fc.Result = res + return ec.marshalOGroupMembershipHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_GroupMembershipHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupMembershipHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _GroupMembershipHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.GroupMembershipHistory) + fc.Result = res + return ec.marshalOGroupMembershipHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistoryEdge", + 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_GroupMembershipHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_GroupMembershipHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_GroupMembershipHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_GroupMembershipHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembershipHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembershipHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembershipHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembershipHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembershipHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembershipHistory_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembershipHistory_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembershipHistory_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembershipHistory_userID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupMembershipHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.GroupMembershipHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _GroupMembershipUpdatePayload_groupMembership(ctx context.Context, field graphql.CollectedField, obj *GroupMembershipUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupMembershipUpdatePayload_groupMembership(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.GroupMembership, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupMembership) + fc.Result = res + return ec.marshalNGroupMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupMembershipUpdatePayload_groupMembership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupMembershipUpdatePayload", + 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_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSearchResult_groups(ctx context.Context, field graphql.CollectedField, obj *GroupSearchResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSearchResult_groups(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.Groups, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSearchResult_groups(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSearchResult", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_id(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + 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) _GroupSetting_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + 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) _GroupSetting_tags(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_tags(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.Tags, 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_GroupSetting_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + 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) _GroupSetting_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + 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) _GroupSetting_visibility(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_visibility(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.Visibility, 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.(enums.Visibility) + fc.Result = res + return ec.marshalNGroupSettingVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_visibility(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupSettingVisibility does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_joinPolicy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_joinPolicy(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.JoinPolicy, 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.(enums.JoinPolicy) + fc.Result = res + return ec.marshalNGroupSettingJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_joinPolicy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupSettingJoinPolicy does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_syncToSlack(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_syncToSlack(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.SyncToSlack, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_syncToSlack(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + 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 fc, nil +} + +func (ec *executionContext) _GroupSetting_syncToGithub(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_syncToGithub(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.SyncToGithub, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_syncToGithub(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + 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 fc, nil +} + +func (ec *executionContext) _GroupSetting_groupID(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_groupID(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.GroupID, 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.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_groupID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSetting_group(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSetting_group(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.Group(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSetting_group(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSetting", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingBulkCreatePayload_groupSettings(ctx context.Context, field graphql.CollectedField, obj *GroupSettingBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingBulkCreatePayload_groupSettings(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.GroupSettings, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupSetting) + fc.Result = res + return ec.marshalOGroupSetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingBulkCreatePayload_groupSettings(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingBulkCreatePayload", + 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_GroupSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupSetting_deletedBy(ctx, field) + case "visibility": + return ec.fieldContext_GroupSetting_visibility(ctx, field) + case "joinPolicy": + return ec.fieldContext_GroupSetting_joinPolicy(ctx, field) + case "syncToSlack": + return ec.fieldContext_GroupSetting_syncToSlack(ctx, field) + case "syncToGithub": + return ec.fieldContext_GroupSetting_syncToGithub(ctx, field) + case "groupID": + return ec.fieldContext_GroupSetting_groupID(ctx, field) + case "group": + return ec.fieldContext_GroupSetting_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupSettingEdge) + fc.Result = res + return ec.marshalOGroupSettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_GroupSettingEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupSettingEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingConnection", + 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 fc, nil +} + +func (ec *executionContext) _GroupSettingCreatePayload_groupSetting(ctx context.Context, field graphql.CollectedField, obj *GroupSettingCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingCreatePayload_groupSetting(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.GroupSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupSetting) + fc.Result = res + return ec.marshalNGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingCreatePayload_groupSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingCreatePayload", + 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_GroupSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupSetting_deletedBy(ctx, field) + case "visibility": + return ec.fieldContext_GroupSetting_visibility(ctx, field) + case "joinPolicy": + return ec.fieldContext_GroupSetting_joinPolicy(ctx, field) + case "syncToSlack": + return ec.fieldContext_GroupSetting_syncToSlack(ctx, field) + case "syncToGithub": + return ec.fieldContext_GroupSetting_syncToGithub(ctx, field) + case "groupID": + return ec.fieldContext_GroupSetting_groupID(ctx, field) + case "group": + return ec.fieldContext_GroupSetting_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *GroupSettingDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.GroupSetting) + fc.Result = res + return ec.marshalOGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingEdge", + 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_GroupSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupSetting_deletedBy(ctx, field) + case "visibility": + return ec.fieldContext_GroupSetting_visibility(ctx, field) + case "joinPolicy": + return ec.fieldContext_GroupSetting_joinPolicy(ctx, field) + case "syncToSlack": + return ec.fieldContext_GroupSetting_syncToSlack(ctx, field) + case "syncToGithub": + return ec.fieldContext_GroupSetting_syncToGithub(ctx, field) + case "groupID": + return ec.fieldContext_GroupSetting_groupID(ctx, field) + case "group": + return ec.fieldContext_GroupSetting_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingEdge", + 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 fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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) _GroupSettingHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNGroupSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupSettingHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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) _GroupSettingHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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) _GroupSettingHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_tags(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.Tags, 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_GroupSettingHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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) _GroupSettingHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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) _GroupSettingHistory_visibility(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_visibility(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.Visibility, 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.(enums.Visibility) + fc.Result = res + return ec.marshalNGroupSettingHistoryVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_visibility(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupSettingHistoryVisibility does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_joinPolicy(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_joinPolicy(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.JoinPolicy, 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.(enums.JoinPolicy) + fc.Result = res + return ec.marshalNGroupSettingHistoryJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_joinPolicy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type GroupSettingHistoryJoinPolicy does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_syncToSlack(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_syncToSlack(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.SyncToSlack, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_syncToSlack(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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 fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_syncToGithub(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_syncToGithub(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.SyncToGithub, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_syncToGithub(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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 fc, nil +} + +func (ec *executionContext) _GroupSettingHistory_groupID(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistory_groupID(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.GroupID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistory_groupID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistory", + 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) _GroupSettingHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupSettingHistoryEdge) + fc.Result = res + return ec.marshalOGroupSettingHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_GroupSettingHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_GroupSettingHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _GroupSettingHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.GroupSettingHistory) + fc.Result = res + return ec.marshalOGroupSettingHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistoryEdge", + 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_GroupSettingHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_GroupSettingHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_GroupSettingHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_GroupSettingHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_GroupSettingHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupSettingHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupSettingHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupSettingHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupSettingHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupSettingHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupSettingHistory_deletedBy(ctx, field) + case "visibility": + return ec.fieldContext_GroupSettingHistory_visibility(ctx, field) + case "joinPolicy": + return ec.fieldContext_GroupSettingHistory_joinPolicy(ctx, field) + case "syncToSlack": + return ec.fieldContext_GroupSettingHistory_syncToSlack(ctx, field) + case "syncToGithub": + return ec.fieldContext_GroupSettingHistory_syncToGithub(ctx, field) + case "groupID": + return ec.fieldContext_GroupSettingHistory_groupID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupSettingHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.GroupSettingHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _GroupSettingUpdatePayload_groupSetting(ctx context.Context, field graphql.CollectedField, obj *GroupSettingUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupSettingUpdatePayload_groupSetting(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.GroupSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupSetting) + fc.Result = res + return ec.marshalNGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupSettingUpdatePayload_groupSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupSettingUpdatePayload", + 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_GroupSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupSetting_deletedBy(ctx, field) + case "visibility": + return ec.fieldContext_GroupSetting_visibility(ctx, field) + case "joinPolicy": + return ec.fieldContext_GroupSetting_joinPolicy(ctx, field) + case "syncToSlack": + return ec.fieldContext_GroupSetting_syncToSlack(ctx, field) + case "syncToGithub": + return ec.fieldContext_GroupSetting_syncToGithub(ctx, field) + case "groupID": + return ec.fieldContext_GroupSetting_groupID(ctx, field) + case "group": + return ec.fieldContext_GroupSetting_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GroupUpdatePayload_group(ctx context.Context, field graphql.CollectedField, obj *GroupUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GroupUpdatePayload_group(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.Group, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Group) + fc.Result = res + return ec.marshalNGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GroupUpdatePayload_group(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GroupUpdatePayload", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Hush_id(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Hush_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Hush_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Hush_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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) _Hush_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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) _Hush_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Hush_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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) _Hush_name(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_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 { + 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_Hush_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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) _Hush_description(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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) _Hush_kind(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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) _Hush_secretName(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_secretName(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.SecretName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_secretName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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) _Hush_integrations(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_integrations(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.Integrations(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_integrations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Hush_organization(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_organization(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.Organization(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Hush_events(ctx context.Context, field graphql.CollectedField, obj *generated.Hush) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Hush_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Hush_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Hush", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushBulkCreatePayload_hushes(ctx context.Context, field graphql.CollectedField, obj *HushBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushBulkCreatePayload_hushes(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.Hushes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Hush) + fc.Result = res + return ec.marshalOHush2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushBulkCreatePayload_hushes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushBulkCreatePayload", + 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_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.HushConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.HushEdge) + fc.Result = res + return ec.marshalOHushEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_HushEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_HushEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.HushConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.HushConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushConnection", + 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 fc, nil +} + +func (ec *executionContext) _HushCreatePayload_hush(ctx context.Context, field graphql.CollectedField, obj *HushCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushCreatePayload_hush(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.Hush, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Hush) + fc.Result = res + return ec.marshalNHush2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushCreatePayload_hush(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushCreatePayload", + 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_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *HushDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HushEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.HushEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Hush) + fc.Result = res + return ec.marshalOHush2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushEdge", + 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_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.HushEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushEdge", + 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 fc, nil +} + +func (ec *executionContext) _HushHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNHushHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type HushHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_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 { + 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_HushHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistory_kind(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistory_secretName(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistory_secretName(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.SecretName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistory_secretName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistory", + 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) _HushHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.HushHistoryEdge) + fc.Result = res + return ec.marshalOHushHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_HushHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_HushHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _HushHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.HushHistory) + fc.Result = res + return ec.marshalOHushHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistoryEdge", + 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_HushHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_HushHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_HushHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_HushHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_HushHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_HushHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_HushHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_HushHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_HushHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_HushHistory_deletedBy(ctx, field) + case "name": + return ec.fieldContext_HushHistory_name(ctx, field) + case "description": + return ec.fieldContext_HushHistory_description(ctx, field) + case "kind": + return ec.fieldContext_HushHistory_kind(ctx, field) + case "secretName": + return ec.fieldContext_HushHistory_secretName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _HushHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.HushHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _HushUpdatePayload_hush(ctx context.Context, field graphql.CollectedField, obj *HushUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_HushUpdatePayload_hush(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.Hush, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Hush) + fc.Result = res + return ec.marshalNHush2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_HushUpdatePayload_hush(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "HushUpdatePayload", + 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_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_id(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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) _Integration_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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) _Integration_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_tags(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.Tags, 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_Integration_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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) _Integration_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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) _Integration_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_name(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_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 { + 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_Integration_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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) _Integration_description(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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) _Integration_kind(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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) _Integration_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_secrets(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_secrets(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.Secrets(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Hush) + fc.Result = res + return ec.marshalOHush2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_secrets(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_oauth2tokens(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_oauth2tokens(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.Oauth2tokens(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OhAuthTooToken) + fc.Result = res + return ec.marshalOOhAuthTooToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_oauth2tokens(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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_OhAuthTooToken_id(ctx, field) + case "tags": + return ec.fieldContext_OhAuthTooToken_tags(ctx, field) + case "clientID": + return ec.fieldContext_OhAuthTooToken_clientID(ctx, field) + case "scopes": + return ec.fieldContext_OhAuthTooToken_scopes(ctx, field) + case "nonce": + return ec.fieldContext_OhAuthTooToken_nonce(ctx, field) + case "claimsUserID": + return ec.fieldContext_OhAuthTooToken_claimsUserID(ctx, field) + case "claimsUsername": + return ec.fieldContext_OhAuthTooToken_claimsUsername(ctx, field) + case "claimsEmail": + return ec.fieldContext_OhAuthTooToken_claimsEmail(ctx, field) + case "claimsEmailVerified": + return ec.fieldContext_OhAuthTooToken_claimsEmailVerified(ctx, field) + case "claimsGroups": + return ec.fieldContext_OhAuthTooToken_claimsGroups(ctx, field) + case "claimsPreferredUsername": + return ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(ctx, field) + case "connectorID": + return ec.fieldContext_OhAuthTooToken_connectorID(ctx, field) + case "connectorData": + return ec.fieldContext_OhAuthTooToken_connectorData(ctx, field) + case "lastUsed": + return ec.fieldContext_OhAuthTooToken_lastUsed(ctx, field) + case "integration": + return ec.fieldContext_OhAuthTooToken_integration(ctx, field) + case "events": + return ec.fieldContext_OhAuthTooToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_events(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Integration_webhooks(ctx context.Context, field graphql.CollectedField, obj *generated.Integration) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Integration_webhooks(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.Webhooks(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Webhook) + fc.Result = res + return ec.marshalOWebhook2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Integration_webhooks(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Integration", + 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_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationBulkCreatePayload_integrations(ctx context.Context, field graphql.CollectedField, obj *IntegrationBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationBulkCreatePayload_integrations(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.Integrations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationBulkCreatePayload_integrations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationBulkCreatePayload", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.IntegrationEdge) + fc.Result = res + return ec.marshalOIntegrationEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_IntegrationEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_IntegrationEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationConnection", + 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 fc, nil +} + +func (ec *executionContext) _IntegrationCreatePayload_integration(ctx context.Context, field graphql.CollectedField, obj *IntegrationCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationCreatePayload_integration(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.Integration, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Integration) + fc.Result = res + return ec.marshalNIntegration2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationCreatePayload_integration(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationCreatePayload", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *IntegrationDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationEdge", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationEdge", + 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 fc, nil +} + +func (ec *executionContext) _IntegrationHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNIntegrationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type IntegrationHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_tags(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.Tags, 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_IntegrationHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_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 { + 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_IntegrationHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistory_kind(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistory_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistory_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistory", + 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) _IntegrationHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.IntegrationHistoryEdge) + fc.Result = res + return ec.marshalOIntegrationHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_IntegrationHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_IntegrationHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _IntegrationHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.IntegrationHistory) + fc.Result = res + return ec.marshalOIntegrationHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistoryEdge", + 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_IntegrationHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_IntegrationHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_IntegrationHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_IntegrationHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_IntegrationHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_IntegrationHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_IntegrationHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_IntegrationHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_IntegrationHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_IntegrationHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_IntegrationHistory_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_IntegrationHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_IntegrationHistory_name(ctx, field) + case "description": + return ec.fieldContext_IntegrationHistory_description(ctx, field) + case "kind": + return ec.fieldContext_IntegrationHistory_kind(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IntegrationHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.IntegrationHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _IntegrationUpdatePayload_integration(ctx context.Context, field graphql.CollectedField, obj *IntegrationUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntegrationUpdatePayload_integration(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.Integration, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Integration) + fc.Result = res + return ec.marshalNIntegration2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntegrationUpdatePayload_integration(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntegrationUpdatePayload", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_id(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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) _Invite_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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) _Invite_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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) _Invite_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_expires(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_expires(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.Expires, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_expires(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_recipient(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_recipient(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.Recipient, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_recipient(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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) _Invite_status(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_status(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.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.(enums.InviteStatus) + fc.Result = res + return ec.marshalNInviteInviteStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type InviteInviteStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_role(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_role(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.Role, 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.(enums.Role) + fc.Result = res + return ec.marshalNInviteRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type InviteRole does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_sendAttempts(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_sendAttempts(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.SendAttempts, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_sendAttempts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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 fc, nil +} + +func (ec *executionContext) _Invite_requestorID(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_requestorID(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.RequestorID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_requestorID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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) _Invite_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Invite_events(ctx context.Context, field graphql.CollectedField, obj *generated.Invite) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invite_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Invite_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Invite", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InviteBulkCreatePayload_invites(ctx context.Context, field graphql.CollectedField, obj *InviteBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteBulkCreatePayload_invites(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.Invites, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Invite) + fc.Result = res + return ec.marshalOInvite2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteBulkCreatePayload_invites(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteBulkCreatePayload", + 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_Invite_id(ctx, field) + case "createdAt": + return ec.fieldContext_Invite_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Invite_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Invite_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Invite_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Invite_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Invite_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Invite_ownerID(ctx, field) + case "expires": + return ec.fieldContext_Invite_expires(ctx, field) + case "recipient": + return ec.fieldContext_Invite_recipient(ctx, field) + case "status": + return ec.fieldContext_Invite_status(ctx, field) + case "role": + return ec.fieldContext_Invite_role(ctx, field) + case "sendAttempts": + return ec.fieldContext_Invite_sendAttempts(ctx, field) + case "requestorID": + return ec.fieldContext_Invite_requestorID(ctx, field) + case "owner": + return ec.fieldContext_Invite_owner(ctx, field) + case "events": + return ec.fieldContext_Invite_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invite", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InviteConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.InviteConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.InviteEdge) + fc.Result = res + return ec.marshalOInviteEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_InviteEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_InviteEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InviteEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InviteConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.InviteConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InviteConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.InviteConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteConnection", + 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 fc, nil +} + +func (ec *executionContext) _InviteCreatePayload_invite(ctx context.Context, field graphql.CollectedField, obj *InviteCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteCreatePayload_invite(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.Invite, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Invite) + fc.Result = res + return ec.marshalNInvite2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteCreatePayload_invite(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteCreatePayload", + 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_Invite_id(ctx, field) + case "createdAt": + return ec.fieldContext_Invite_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Invite_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Invite_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Invite_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Invite_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Invite_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Invite_ownerID(ctx, field) + case "expires": + return ec.fieldContext_Invite_expires(ctx, field) + case "recipient": + return ec.fieldContext_Invite_recipient(ctx, field) + case "status": + return ec.fieldContext_Invite_status(ctx, field) + case "role": + return ec.fieldContext_Invite_role(ctx, field) + case "sendAttempts": + return ec.fieldContext_Invite_sendAttempts(ctx, field) + case "requestorID": + return ec.fieldContext_Invite_requestorID(ctx, field) + case "owner": + return ec.fieldContext_Invite_owner(ctx, field) + case "events": + return ec.fieldContext_Invite_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invite", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InviteDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *InviteDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InviteEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.InviteEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Invite) + fc.Result = res + return ec.marshalOInvite2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteEdge", + 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_Invite_id(ctx, field) + case "createdAt": + return ec.fieldContext_Invite_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Invite_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Invite_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Invite_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Invite_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Invite_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Invite_ownerID(ctx, field) + case "expires": + return ec.fieldContext_Invite_expires(ctx, field) + case "recipient": + return ec.fieldContext_Invite_recipient(ctx, field) + case "status": + return ec.fieldContext_Invite_status(ctx, field) + case "role": + return ec.fieldContext_Invite_role(ctx, field) + case "sendAttempts": + return ec.fieldContext_Invite_sendAttempts(ctx, field) + case "requestorID": + return ec.fieldContext_Invite_requestorID(ctx, field) + case "owner": + return ec.fieldContext_Invite_owner(ctx, field) + case "events": + return ec.fieldContext_Invite_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invite", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InviteEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.InviteEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteEdge", + 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 fc, nil +} + +func (ec *executionContext) _InviteUpdatePayload_invite(ctx context.Context, field graphql.CollectedField, obj *InviteUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InviteUpdatePayload_invite(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.Invite, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Invite) + fc.Result = res + return ec.marshalNInvite2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InviteUpdatePayload_invite(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InviteUpdatePayload", + 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_Invite_id(ctx, field) + case "createdAt": + return ec.fieldContext_Invite_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Invite_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Invite_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Invite_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Invite_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Invite_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Invite_ownerID(ctx, field) + case "expires": + return ec.fieldContext_Invite_expires(ctx, field) + case "recipient": + return ec.fieldContext_Invite_recipient(ctx, field) + case "status": + return ec.fieldContext_Invite_status(ctx, field) + case "role": + return ec.fieldContext_Invite_role(ctx, field) + case "sendAttempts": + return ec.fieldContext_Invite_sendAttempts(ctx, field) + case "requestorID": + return ec.fieldContext_Invite_requestorID(ctx, field) + case "owner": + return ec.fieldContext_Invite_owner(ctx, field) + case "events": + return ec.fieldContext_Invite_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invite", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createAPIToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createAPIToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateAPIToken(rctx, fc.Args["input"].(generated.CreateAPITokenInput)) + }) + 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.(*APITokenCreatePayload) + fc.Result = res + return ec.marshalNAPITokenCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createAPIToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiToken": + return ec.fieldContext_APITokenCreatePayload_apiToken(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APITokenCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createAPIToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkAPIToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkAPIToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkAPIToken(rctx, fc.Args["input"].([]*generated.CreateAPITokenInput)) + }) + 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.(*APITokenBulkCreatePayload) + fc.Result = res + return ec.marshalNAPITokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkAPIToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiTokens": + return ec.fieldContext_APITokenBulkCreatePayload_apiTokens(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APITokenBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkAPIToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVAPIToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVAPIToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVAPIToken(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*APITokenBulkCreatePayload) + fc.Result = res + return ec.marshalNAPITokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVAPIToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiTokens": + return ec.fieldContext_APITokenBulkCreatePayload_apiTokens(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APITokenBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVAPIToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateAPIToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateAPIToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateAPIToken(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateAPITokenInput)) + }) + 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.(*APITokenUpdatePayload) + fc.Result = res + return ec.marshalNAPITokenUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateAPIToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "apiToken": + return ec.fieldContext_APITokenUpdatePayload_apiToken(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APITokenUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateAPIToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteAPIToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteAPIToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteAPIToken(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*APITokenDeletePayload) + fc.Result = res + return ec.marshalNAPITokenDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteAPIToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_APITokenDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APITokenDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteAPIToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createContact(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createContact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateContact(rctx, fc.Args["input"].(generated.CreateContactInput)) + }) + 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.(*ContactCreatePayload) + fc.Result = res + return ec.marshalNContactCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createContact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "contact": + return ec.fieldContext_ContactCreatePayload_contact(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createContact_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkContact(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkContact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkContact(rctx, fc.Args["input"].([]*generated.CreateContactInput)) + }) + 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.(*ContactBulkCreatePayload) + fc.Result = res + return ec.marshalNContactBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkContact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "contacts": + return ec.fieldContext_ContactBulkCreatePayload_contacts(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkContact_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVContact(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVContact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVContact(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*ContactBulkCreatePayload) + fc.Result = res + return ec.marshalNContactBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVContact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "contacts": + return ec.fieldContext_ContactBulkCreatePayload_contacts(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVContact_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateContact(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateContact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateContact(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateContactInput)) + }) + 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.(*ContactUpdatePayload) + fc.Result = res + return ec.marshalNContactUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateContact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "contact": + return ec.fieldContext_ContactUpdatePayload_contact(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateContact_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteContact(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteContact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteContact(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*ContactDeletePayload) + fc.Result = res + return ec.marshalNContactDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteContact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_ContactDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteContact_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createDocumentData(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createDocumentData(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateDocumentData(rctx, fc.Args["input"].(generated.CreateDocumentDataInput)) + }) + 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.(*DocumentDataCreatePayload) + fc.Result = res + return ec.marshalNDocumentDataCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createDocumentData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "documentData": + return ec.fieldContext_DocumentDataCreatePayload_documentData(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createDocumentData_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkDocumentData(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkDocumentData(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkDocumentData(rctx, fc.Args["input"].([]*generated.CreateDocumentDataInput)) + }) + 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.(*DocumentDataBulkCreatePayload) + fc.Result = res + return ec.marshalNDocumentDataBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkDocumentData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "documentData": + return ec.fieldContext_DocumentDataBulkCreatePayload_documentData(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkDocumentData_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVDocumentData(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVDocumentData(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVDocumentData(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*DocumentDataBulkCreatePayload) + fc.Result = res + return ec.marshalNDocumentDataBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVDocumentData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "documentData": + return ec.fieldContext_DocumentDataBulkCreatePayload_documentData(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVDocumentData_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateDocumentData(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateDocumentData(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateDocumentData(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateDocumentDataInput)) + }) + 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.(*DocumentDataUpdatePayload) + fc.Result = res + return ec.marshalNDocumentDataUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateDocumentData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "documentData": + return ec.fieldContext_DocumentDataUpdatePayload_documentData(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateDocumentData_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteDocumentData(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteDocumentData(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteDocumentData(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*DocumentDataDeletePayload) + fc.Result = res + return ec.marshalNDocumentDataDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteDocumentData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_DocumentDataDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteDocumentData_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createEntitlement(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createEntitlement(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateEntitlement(rctx, fc.Args["input"].(generated.CreateEntitlementInput)) + }) + 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.(*EntitlementCreatePayload) + fc.Result = res + return ec.marshalNEntitlementCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createEntitlement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlement": + return ec.fieldContext_EntitlementCreatePayload_entitlement(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createEntitlement_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkEntitlement(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkEntitlement(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkEntitlement(rctx, fc.Args["input"].([]*generated.CreateEntitlementInput)) + }) + 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.(*EntitlementBulkCreatePayload) + fc.Result = res + return ec.marshalNEntitlementBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkEntitlement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlements": + return ec.fieldContext_EntitlementBulkCreatePayload_entitlements(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkEntitlement_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVEntitlement(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVEntitlement(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVEntitlement(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*EntitlementBulkCreatePayload) + fc.Result = res + return ec.marshalNEntitlementBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVEntitlement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlements": + return ec.fieldContext_EntitlementBulkCreatePayload_entitlements(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVEntitlement_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateEntitlement(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateEntitlement(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateEntitlement(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateEntitlementInput)) + }) + 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.(*EntitlementUpdatePayload) + fc.Result = res + return ec.marshalNEntitlementUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateEntitlement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlement": + return ec.fieldContext_EntitlementUpdatePayload_entitlement(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateEntitlement_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteEntitlement(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteEntitlement(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteEntitlement(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*EntitlementDeletePayload) + fc.Result = res + return ec.marshalNEntitlementDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteEntitlement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_EntitlementDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteEntitlement_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createEntitlementPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createEntitlementPlan(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateEntitlementPlan(rctx, fc.Args["input"].(generated.CreateEntitlementPlanInput)) + }) + 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.(*EntitlementPlanCreatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createEntitlementPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlan": + return ec.fieldContext_EntitlementPlanCreatePayload_entitlementPlan(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createEntitlementPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkEntitlementPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkEntitlementPlan(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkEntitlementPlan(rctx, fc.Args["input"].([]*generated.CreateEntitlementPlanInput)) + }) + 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.(*EntitlementPlanBulkCreatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkEntitlementPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlans": + return ec.fieldContext_EntitlementPlanBulkCreatePayload_entitlementPlans(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkEntitlementPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVEntitlementPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVEntitlementPlan(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVEntitlementPlan(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*EntitlementPlanBulkCreatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVEntitlementPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlans": + return ec.fieldContext_EntitlementPlanBulkCreatePayload_entitlementPlans(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVEntitlementPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateEntitlementPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateEntitlementPlan(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateEntitlementPlan(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateEntitlementPlanInput)) + }) + 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.(*EntitlementPlanUpdatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateEntitlementPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlan": + return ec.fieldContext_EntitlementPlanUpdatePayload_entitlementPlan(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateEntitlementPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteEntitlementPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteEntitlementPlan(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteEntitlementPlan(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*EntitlementPlanDeletePayload) + fc.Result = res + return ec.marshalNEntitlementPlanDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteEntitlementPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_EntitlementPlanDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteEntitlementPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createEntitlementPlanFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateEntitlementPlanFeature(rctx, fc.Args["input"].(generated.CreateEntitlementPlanFeatureInput)) + }) + 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.(*EntitlementPlanFeatureCreatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlanFeature": + return ec.fieldContext_EntitlementPlanFeatureCreatePayload_entitlementPlanFeature(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createEntitlementPlanFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkEntitlementPlanFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkEntitlementPlanFeature(rctx, fc.Args["input"].([]*generated.CreateEntitlementPlanFeatureInput)) + }) + 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.(*EntitlementPlanFeatureBulkCreatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlanFeatures": + return ec.fieldContext_EntitlementPlanFeatureBulkCreatePayload_entitlementPlanFeatures(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkEntitlementPlanFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVEntitlementPlanFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVEntitlementPlanFeature(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*EntitlementPlanFeatureBulkCreatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlanFeatures": + return ec.fieldContext_EntitlementPlanFeatureBulkCreatePayload_entitlementPlanFeatures(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVEntitlementPlanFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateEntitlementPlanFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateEntitlementPlanFeature(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateEntitlementPlanFeatureInput)) + }) + 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.(*EntitlementPlanFeatureUpdatePayload) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entitlementPlanFeature": + return ec.fieldContext_EntitlementPlanFeatureUpdatePayload_entitlementPlanFeature(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateEntitlementPlanFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteEntitlementPlanFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteEntitlementPlanFeature(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*EntitlementPlanFeatureDeletePayload) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteEntitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_EntitlementPlanFeatureDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteEntitlementPlanFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createEntity(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createEntity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateEntity(rctx, fc.Args["input"].(generated.CreateEntityInput)) + }) + 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.(*EntityCreatePayload) + fc.Result = res + return ec.marshalNEntityCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createEntity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entity": + return ec.fieldContext_EntityCreatePayload_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createEntity_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkEntity(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkEntity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkEntity(rctx, fc.Args["input"].([]*generated.CreateEntityInput)) + }) + 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.(*EntityBulkCreatePayload) + fc.Result = res + return ec.marshalNEntityBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkEntity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entities": + return ec.fieldContext_EntityBulkCreatePayload_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkEntity_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVEntity(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVEntity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVEntity(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*EntityBulkCreatePayload) + fc.Result = res + return ec.marshalNEntityBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVEntity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entities": + return ec.fieldContext_EntityBulkCreatePayload_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVEntity_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateEntity(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateEntity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateEntity(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateEntityInput)) + }) + 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.(*EntityUpdatePayload) + fc.Result = res + return ec.marshalNEntityUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateEntity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entity": + return ec.fieldContext_EntityUpdatePayload_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateEntity_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteEntity(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteEntity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteEntity(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*EntityDeletePayload) + fc.Result = res + return ec.marshalNEntityDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteEntity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_EntityDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteEntity_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createEntityType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createEntityType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateEntityType(rctx, fc.Args["input"].(generated.CreateEntityTypeInput)) + }) + 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.(*EntityTypeCreatePayload) + fc.Result = res + return ec.marshalNEntityTypeCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createEntityType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entityType": + return ec.fieldContext_EntityTypeCreatePayload_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createEntityType_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkEntityType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkEntityType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkEntityType(rctx, fc.Args["input"].([]*generated.CreateEntityTypeInput)) + }) + 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.(*EntityTypeBulkCreatePayload) + fc.Result = res + return ec.marshalNEntityTypeBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkEntityType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entityTypes": + return ec.fieldContext_EntityTypeBulkCreatePayload_entityTypes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkEntityType_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVEntityType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVEntityType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVEntityType(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*EntityTypeBulkCreatePayload) + fc.Result = res + return ec.marshalNEntityTypeBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVEntityType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entityTypes": + return ec.fieldContext_EntityTypeBulkCreatePayload_entityTypes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVEntityType_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateEntityType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateEntityType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateEntityType(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateEntityTypeInput)) + }) + 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.(*EntityTypeUpdatePayload) + fc.Result = res + return ec.marshalNEntityTypeUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateEntityType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "entityType": + return ec.fieldContext_EntityTypeUpdatePayload_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateEntityType_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteEntityType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteEntityType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteEntityType(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*EntityTypeDeletePayload) + fc.Result = res + return ec.marshalNEntityTypeDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteEntityType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_EntityTypeDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteEntityType_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createEvent(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createEvent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateEvent(rctx, fc.Args["input"].(generated.CreateEventInput)) + }) + 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.(*EventCreatePayload) + fc.Result = res + return ec.marshalNEventCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createEvent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "event": + return ec.fieldContext_EventCreatePayload_event(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createEvent_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkEvent(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkEvent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkEvent(rctx, fc.Args["input"].([]*generated.CreateEventInput)) + }) + 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.(*EventBulkCreatePayload) + fc.Result = res + return ec.marshalNEventBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkEvent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "events": + return ec.fieldContext_EventBulkCreatePayload_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkEvent_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVEvent(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVEvent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVEvent(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*EventBulkCreatePayload) + fc.Result = res + return ec.marshalNEventBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVEvent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "events": + return ec.fieldContext_EventBulkCreatePayload_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVEvent_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateEvent(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateEvent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateEvent(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateEventInput)) + }) + 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.(*EventUpdatePayload) + fc.Result = res + return ec.marshalNEventUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateEvent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "event": + return ec.fieldContext_EventUpdatePayload_event(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateEvent_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteEvent(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteEvent(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteEvent(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*EventDeletePayload) + fc.Result = res + return ec.marshalNEventDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteEvent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_EventDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteEvent_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateFeature(rctx, fc.Args["input"].(generated.CreateFeatureInput)) + }) + 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.(*FeatureCreatePayload) + fc.Result = res + return ec.marshalNFeatureCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "feature": + return ec.fieldContext_FeatureCreatePayload_feature(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkFeature(rctx, fc.Args["input"].([]*generated.CreateFeatureInput)) + }) + 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.(*FeatureBulkCreatePayload) + fc.Result = res + return ec.marshalNFeatureBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "features": + return ec.fieldContext_FeatureBulkCreatePayload_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVFeature(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*FeatureBulkCreatePayload) + fc.Result = res + return ec.marshalNFeatureBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "features": + return ec.fieldContext_FeatureBulkCreatePayload_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateFeature(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateFeatureInput)) + }) + 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.(*FeatureUpdatePayload) + fc.Result = res + return ec.marshalNFeatureUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "feature": + return ec.fieldContext_FeatureUpdatePayload_feature(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteFeature(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*FeatureDeletePayload) + fc.Result = res + return ec.marshalNFeatureDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_FeatureDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createFile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createFile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateFile(rctx, fc.Args["input"].(generated.CreateFileInput)) + }) + 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.(*FileCreatePayload) + fc.Result = res + return ec.marshalNFileCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createFile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "file": + return ec.fieldContext_FileCreatePayload_file(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createFile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkFile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkFile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkFile(rctx, fc.Args["input"].([]*generated.CreateFileInput)) + }) + 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.(*FileBulkCreatePayload) + fc.Result = res + return ec.marshalNFileBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkFile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "files": + return ec.fieldContext_FileBulkCreatePayload_files(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkFile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVFile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVFile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVFile(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*FileBulkCreatePayload) + fc.Result = res + return ec.marshalNFileBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVFile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "files": + return ec.fieldContext_FileBulkCreatePayload_files(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVFile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateFile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateFile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateFile(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateFileInput)) + }) + 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.(*FileUpdatePayload) + fc.Result = res + return ec.marshalNFileUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateFile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "file": + return ec.fieldContext_FileUpdatePayload_file(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateFile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteFile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteFile(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteFile(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*FileDeletePayload) + fc.Result = res + return ec.marshalNFileDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteFile(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_FileDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteFile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createGroup(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateGroup(rctx, fc.Args["input"].(generated.CreateGroupInput)) + }) + 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.(*GroupCreatePayload) + fc.Result = res + return ec.marshalNGroupCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "group": + return ec.fieldContext_GroupCreatePayload_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkGroup(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkGroup(rctx, fc.Args["input"].([]*generated.CreateGroupInput)) + }) + 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.(*GroupBulkCreatePayload) + fc.Result = res + return ec.marshalNGroupBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groups": + return ec.fieldContext_GroupBulkCreatePayload_groups(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVGroup(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVGroup(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*GroupBulkCreatePayload) + fc.Result = res + return ec.marshalNGroupBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groups": + return ec.fieldContext_GroupBulkCreatePayload_groups(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateGroup(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateGroup(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateGroupInput)) + }) + 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.(*GroupUpdatePayload) + fc.Result = res + return ec.marshalNGroupUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "group": + return ec.fieldContext_GroupUpdatePayload_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteGroup(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteGroup(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*GroupDeletePayload) + fc.Result = res + return ec.marshalNGroupDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_GroupDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createGroupMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createGroupMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateGroupMembership(rctx, fc.Args["input"].(generated.CreateGroupMembershipInput)) + }) + 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.(*GroupMembershipCreatePayload) + fc.Result = res + return ec.marshalNGroupMembershipCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createGroupMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupMembership": + return ec.fieldContext_GroupMembershipCreatePayload_groupMembership(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createGroupMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkGroupMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkGroupMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkGroupMembership(rctx, fc.Args["input"].([]*generated.CreateGroupMembershipInput)) + }) + 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.(*GroupMembershipBulkCreatePayload) + fc.Result = res + return ec.marshalNGroupMembershipBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkGroupMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupMemberships": + return ec.fieldContext_GroupMembershipBulkCreatePayload_groupMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkGroupMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVGroupMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVGroupMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVGroupMembership(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*GroupMembershipBulkCreatePayload) + fc.Result = res + return ec.marshalNGroupMembershipBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVGroupMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupMemberships": + return ec.fieldContext_GroupMembershipBulkCreatePayload_groupMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVGroupMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateGroupMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateGroupMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateGroupMembership(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateGroupMembershipInput)) + }) + 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.(*GroupMembershipUpdatePayload) + fc.Result = res + return ec.marshalNGroupMembershipUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateGroupMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupMembership": + return ec.fieldContext_GroupMembershipUpdatePayload_groupMembership(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateGroupMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteGroupMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteGroupMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteGroupMembership(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*GroupMembershipDeletePayload) + fc.Result = res + return ec.marshalNGroupMembershipDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteGroupMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_GroupMembershipDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteGroupMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createGroupSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createGroupSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateGroupSetting(rctx, fc.Args["input"].(generated.CreateGroupSettingInput)) + }) + 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.(*GroupSettingCreatePayload) + fc.Result = res + return ec.marshalNGroupSettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createGroupSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupSetting": + return ec.fieldContext_GroupSettingCreatePayload_groupSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createGroupSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkGroupSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkGroupSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkGroupSetting(rctx, fc.Args["input"].([]*generated.CreateGroupSettingInput)) + }) + 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.(*GroupSettingBulkCreatePayload) + fc.Result = res + return ec.marshalNGroupSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkGroupSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupSettings": + return ec.fieldContext_GroupSettingBulkCreatePayload_groupSettings(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkGroupSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVGroupSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVGroupSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVGroupSetting(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*GroupSettingBulkCreatePayload) + fc.Result = res + return ec.marshalNGroupSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVGroupSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupSettings": + return ec.fieldContext_GroupSettingBulkCreatePayload_groupSettings(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVGroupSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateGroupSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateGroupSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateGroupSetting(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateGroupSettingInput)) + }) + 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.(*GroupSettingUpdatePayload) + fc.Result = res + return ec.marshalNGroupSettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateGroupSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "groupSetting": + return ec.fieldContext_GroupSettingUpdatePayload_groupSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateGroupSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteGroupSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteGroupSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteGroupSetting(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*GroupSettingDeletePayload) + fc.Result = res + return ec.marshalNGroupSettingDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteGroupSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_GroupSettingDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteGroupSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createHush(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createHush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateHush(rctx, fc.Args["input"].(generated.CreateHushInput)) + }) + 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.(*HushCreatePayload) + fc.Result = res + return ec.marshalNHushCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createHush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hush": + return ec.fieldContext_HushCreatePayload_hush(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createHush_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkHush(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkHush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkHush(rctx, fc.Args["input"].([]*generated.CreateHushInput)) + }) + 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.(*HushBulkCreatePayload) + fc.Result = res + return ec.marshalNHushBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkHush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hushes": + return ec.fieldContext_HushBulkCreatePayload_hushes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkHush_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVHush(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVHush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVHush(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*HushBulkCreatePayload) + fc.Result = res + return ec.marshalNHushBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVHush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hushes": + return ec.fieldContext_HushBulkCreatePayload_hushes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVHush_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateHush(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateHush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateHush(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateHushInput)) + }) + 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.(*HushUpdatePayload) + fc.Result = res + return ec.marshalNHushUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateHush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hush": + return ec.fieldContext_HushUpdatePayload_hush(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateHush_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteHush(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteHush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteHush(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*HushDeletePayload) + fc.Result = res + return ec.marshalNHushDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteHush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_HushDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteHush_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createIntegration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createIntegration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateIntegration(rctx, fc.Args["input"].(generated.CreateIntegrationInput)) + }) + 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.(*IntegrationCreatePayload) + fc.Result = res + return ec.marshalNIntegrationCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createIntegration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "integration": + return ec.fieldContext_IntegrationCreatePayload_integration(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createIntegration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkIntegration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkIntegration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkIntegration(rctx, fc.Args["input"].([]*generated.CreateIntegrationInput)) + }) + 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.(*IntegrationBulkCreatePayload) + fc.Result = res + return ec.marshalNIntegrationBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkIntegration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "integrations": + return ec.fieldContext_IntegrationBulkCreatePayload_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkIntegration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVIntegration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVIntegration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVIntegration(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*IntegrationBulkCreatePayload) + fc.Result = res + return ec.marshalNIntegrationBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVIntegration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "integrations": + return ec.fieldContext_IntegrationBulkCreatePayload_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVIntegration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateIntegration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateIntegration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateIntegration(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateIntegrationInput)) + }) + 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.(*IntegrationUpdatePayload) + fc.Result = res + return ec.marshalNIntegrationUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateIntegration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "integration": + return ec.fieldContext_IntegrationUpdatePayload_integration(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateIntegration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteIntegration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteIntegration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteIntegration(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*IntegrationDeletePayload) + fc.Result = res + return ec.marshalNIntegrationDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteIntegration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_IntegrationDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteIntegration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createInvite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createInvite(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateInvite(rctx, fc.Args["input"].(generated.CreateInviteInput)) + }) + 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.(*InviteCreatePayload) + fc.Result = res + return ec.marshalNInviteCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createInvite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "invite": + return ec.fieldContext_InviteCreatePayload_invite(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InviteCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createInvite_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkInvite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkInvite(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkInvite(rctx, fc.Args["input"].([]*generated.CreateInviteInput)) + }) + 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.(*InviteBulkCreatePayload) + fc.Result = res + return ec.marshalNInviteBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkInvite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "invites": + return ec.fieldContext_InviteBulkCreatePayload_invites(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InviteBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkInvite_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVInvite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVInvite(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVInvite(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*InviteBulkCreatePayload) + fc.Result = res + return ec.marshalNInviteBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVInvite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "invites": + return ec.fieldContext_InviteBulkCreatePayload_invites(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InviteBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVInvite_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateInvite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateInvite(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateInvite(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateInviteInput)) + }) + 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.(*InviteUpdatePayload) + fc.Result = res + return ec.marshalNInviteUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateInvite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "invite": + return ec.fieldContext_InviteUpdatePayload_invite(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InviteUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateInvite_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteInvite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteInvite(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteInvite(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*InviteDeletePayload) + fc.Result = res + return ec.marshalNInviteDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteInvite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_InviteDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InviteDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteInvite_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createOauthProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createOauthProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateOauthProvider(rctx, fc.Args["input"].(generated.CreateOauthProviderInput)) + }) + 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.(*OauthProviderCreatePayload) + fc.Result = res + return ec.marshalNOauthProviderCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createOauthProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "oauthProvider": + return ec.fieldContext_OauthProviderCreatePayload_oauthProvider(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createOauthProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkOauthProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkOauthProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkOauthProvider(rctx, fc.Args["input"].([]*generated.CreateOauthProviderInput)) + }) + 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.(*OauthProviderBulkCreatePayload) + fc.Result = res + return ec.marshalNOauthProviderBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkOauthProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "oauthProviders": + return ec.fieldContext_OauthProviderBulkCreatePayload_oauthProviders(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkOauthProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVOauthProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVOauthProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVOauthProvider(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*OauthProviderBulkCreatePayload) + fc.Result = res + return ec.marshalNOauthProviderBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVOauthProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "oauthProviders": + return ec.fieldContext_OauthProviderBulkCreatePayload_oauthProviders(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVOauthProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateOauthProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateOauthProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateOauthProvider(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateOauthProviderInput)) + }) + 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.(*OauthProviderUpdatePayload) + fc.Result = res + return ec.marshalNOauthProviderUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateOauthProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "oauthProvider": + return ec.fieldContext_OauthProviderUpdatePayload_oauthProvider(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateOauthProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteOauthProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteOauthProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteOauthProvider(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*OauthProviderDeletePayload) + fc.Result = res + return ec.marshalNOauthProviderDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteOauthProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_OauthProviderDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteOauthProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createOhAuthTooToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateOhAuthTooToken(rctx, fc.Args["input"].(generated.CreateOhAuthTooTokenInput)) + }) + 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.(*OhAuthTooTokenCreatePayload) + fc.Result = res + return ec.marshalNOhAuthTooTokenCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ohAuthTooToken": + return ec.fieldContext_OhAuthTooTokenCreatePayload_ohAuthTooToken(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooTokenCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createOhAuthTooToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkOhAuthTooToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkOhAuthTooToken(rctx, fc.Args["input"].([]*generated.CreateOhAuthTooTokenInput)) + }) + 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.(*OhAuthTooTokenBulkCreatePayload) + fc.Result = res + return ec.marshalNOhAuthTooTokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ohAuthTooTokens": + return ec.fieldContext_OhAuthTooTokenBulkCreatePayload_ohAuthTooTokens(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooTokenBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkOhAuthTooToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVOhAuthTooToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVOhAuthTooToken(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*OhAuthTooTokenBulkCreatePayload) + fc.Result = res + return ec.marshalNOhAuthTooTokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ohAuthTooTokens": + return ec.fieldContext_OhAuthTooTokenBulkCreatePayload_ohAuthTooTokens(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooTokenBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVOhAuthTooToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateOhAuthTooToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateOhAuthTooToken(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateOhAuthTooTokenInput)) + }) + 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.(*OhAuthTooTokenUpdatePayload) + fc.Result = res + return ec.marshalNOhAuthTooTokenUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ohAuthTooToken": + return ec.fieldContext_OhAuthTooTokenUpdatePayload_ohAuthTooToken(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooTokenUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateOhAuthTooToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteOhAuthTooToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteOhAuthTooToken(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*OhAuthTooTokenDeletePayload) + fc.Result = res + return ec.marshalNOhAuthTooTokenDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteOhAuthTooToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_OhAuthTooTokenDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooTokenDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteOhAuthTooToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createOrganization(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createOrganization(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateOrganization(rctx, fc.Args["input"].(generated.CreateOrganizationInput)) + }) + 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.(*OrganizationCreatePayload) + fc.Result = res + return ec.marshalNOrganizationCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createOrganization(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organization": + return ec.fieldContext_OrganizationCreatePayload_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkOrganization(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkOrganization(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkOrganization(rctx, fc.Args["input"].([]*generated.CreateOrganizationInput)) + }) + 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.(*OrganizationBulkCreatePayload) + fc.Result = res + return ec.marshalNOrganizationBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkOrganization(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organizations": + return ec.fieldContext_OrganizationBulkCreatePayload_organizations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVOrganization(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVOrganization(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVOrganization(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*OrganizationBulkCreatePayload) + fc.Result = res + return ec.marshalNOrganizationBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVOrganization(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organizations": + return ec.fieldContext_OrganizationBulkCreatePayload_organizations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateOrganization(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateOrganization(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateOrganization(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateOrganizationInput)) + }) + 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.(*OrganizationUpdatePayload) + fc.Result = res + return ec.marshalNOrganizationUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateOrganization(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organization": + return ec.fieldContext_OrganizationUpdatePayload_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteOrganization(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteOrganization(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteOrganization(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*OrganizationDeletePayload) + fc.Result = res + return ec.marshalNOrganizationDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteOrganization(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_OrganizationDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteOrganization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createOrganizationSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createOrganizationSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateOrganizationSetting(rctx, fc.Args["input"].(generated.CreateOrganizationSettingInput)) + }) + 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.(*OrganizationSettingCreatePayload) + fc.Result = res + return ec.marshalNOrganizationSettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createOrganizationSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organizationSetting": + return ec.fieldContext_OrganizationSettingCreatePayload_organizationSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createOrganizationSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkOrganizationSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkOrganizationSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkOrganizationSetting(rctx, fc.Args["input"].([]*generated.CreateOrganizationSettingInput)) + }) + 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.(*OrganizationSettingBulkCreatePayload) + fc.Result = res + return ec.marshalNOrganizationSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkOrganizationSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organizationSettings": + return ec.fieldContext_OrganizationSettingBulkCreatePayload_organizationSettings(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkOrganizationSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVOrganizationSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVOrganizationSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVOrganizationSetting(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*OrganizationSettingBulkCreatePayload) + fc.Result = res + return ec.marshalNOrganizationSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVOrganizationSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organizationSettings": + return ec.fieldContext_OrganizationSettingBulkCreatePayload_organizationSettings(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVOrganizationSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateOrganizationSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateOrganizationSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateOrganizationSetting(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateOrganizationSettingInput)) + }) + 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.(*OrganizationSettingUpdatePayload) + fc.Result = res + return ec.marshalNOrganizationSettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateOrganizationSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "organizationSetting": + return ec.fieldContext_OrganizationSettingUpdatePayload_organizationSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateOrganizationSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteOrganizationSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteOrganizationSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteOrganizationSetting(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*OrganizationSettingDeletePayload) + fc.Result = res + return ec.marshalNOrganizationSettingDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteOrganizationSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_OrganizationSettingDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteOrganizationSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createOrgMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createOrgMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateOrgMembership(rctx, fc.Args["input"].(generated.CreateOrgMembershipInput)) + }) + 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.(*OrgMembershipCreatePayload) + fc.Result = res + return ec.marshalNOrgMembershipCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createOrgMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "orgMembership": + return ec.fieldContext_OrgMembershipCreatePayload_orgMembership(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createOrgMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkOrgMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkOrgMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkOrgMembership(rctx, fc.Args["input"].([]*generated.CreateOrgMembershipInput)) + }) + 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.(*OrgMembershipBulkCreatePayload) + fc.Result = res + return ec.marshalNOrgMembershipBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkOrgMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "orgMemberships": + return ec.fieldContext_OrgMembershipBulkCreatePayload_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkOrgMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVOrgMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVOrgMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVOrgMembership(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*OrgMembershipBulkCreatePayload) + fc.Result = res + return ec.marshalNOrgMembershipBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVOrgMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "orgMemberships": + return ec.fieldContext_OrgMembershipBulkCreatePayload_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVOrgMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateOrgMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateOrgMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateOrgMembership(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateOrgMembershipInput)) + }) + 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.(*OrgMembershipUpdatePayload) + fc.Result = res + return ec.marshalNOrgMembershipUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateOrgMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "orgMembership": + return ec.fieldContext_OrgMembershipUpdatePayload_orgMembership(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateOrgMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteOrgMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteOrgMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteOrgMembership(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*OrgMembershipDeletePayload) + fc.Result = res + return ec.marshalNOrgMembershipDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteOrgMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_OrgMembershipDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteOrgMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createPersonalAccessToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createPersonalAccessToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreatePersonalAccessToken(rctx, fc.Args["input"].(generated.CreatePersonalAccessTokenInput)) + }) + 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.(*PersonalAccessTokenCreatePayload) + fc.Result = res + return ec.marshalNPersonalAccessTokenCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createPersonalAccessToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "personalAccessToken": + return ec.fieldContext_PersonalAccessTokenCreatePayload_personalAccessToken(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessTokenCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createPersonalAccessToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkPersonalAccessToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkPersonalAccessToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkPersonalAccessToken(rctx, fc.Args["input"].([]*generated.CreatePersonalAccessTokenInput)) + }) + 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.(*PersonalAccessTokenBulkCreatePayload) + fc.Result = res + return ec.marshalNPersonalAccessTokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkPersonalAccessToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "personalAccessTokens": + return ec.fieldContext_PersonalAccessTokenBulkCreatePayload_personalAccessTokens(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessTokenBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkPersonalAccessToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVPersonalAccessToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVPersonalAccessToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVPersonalAccessToken(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*PersonalAccessTokenBulkCreatePayload) + fc.Result = res + return ec.marshalNPersonalAccessTokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVPersonalAccessToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "personalAccessTokens": + return ec.fieldContext_PersonalAccessTokenBulkCreatePayload_personalAccessTokens(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessTokenBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVPersonalAccessToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updatePersonalAccessToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updatePersonalAccessToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdatePersonalAccessToken(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdatePersonalAccessTokenInput)) + }) + 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.(*PersonalAccessTokenUpdatePayload) + fc.Result = res + return ec.marshalNPersonalAccessTokenUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updatePersonalAccessToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "personalAccessToken": + return ec.fieldContext_PersonalAccessTokenUpdatePayload_personalAccessToken(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessTokenUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updatePersonalAccessToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deletePersonalAccessToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deletePersonalAccessToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeletePersonalAccessToken(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*PersonalAccessTokenDeletePayload) + fc.Result = res + return ec.marshalNPersonalAccessTokenDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deletePersonalAccessToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_PersonalAccessTokenDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessTokenDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deletePersonalAccessToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createSubscriber(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createSubscriber(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateSubscriber(rctx, fc.Args["input"].(generated.CreateSubscriberInput)) + }) + 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.(*SubscriberCreatePayload) + fc.Result = res + return ec.marshalNSubscriberCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createSubscriber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "subscriber": + return ec.fieldContext_SubscriberCreatePayload_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubscriberCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createSubscriber_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkSubscriber(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkSubscriber(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkSubscriber(rctx, fc.Args["input"].([]*generated.CreateSubscriberInput)) + }) + 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.(*SubscriberBulkCreatePayload) + fc.Result = res + return ec.marshalNSubscriberBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkSubscriber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "subscribers": + return ec.fieldContext_SubscriberBulkCreatePayload_subscribers(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubscriberBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkSubscriber_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVSubscriber(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVSubscriber(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVSubscriber(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*SubscriberBulkCreatePayload) + fc.Result = res + return ec.marshalNSubscriberBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVSubscriber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "subscribers": + return ec.fieldContext_SubscriberBulkCreatePayload_subscribers(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubscriberBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVSubscriber_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateSubscriber(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateSubscriber(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateSubscriber(rctx, fc.Args["email"].(string), fc.Args["input"].(generated.UpdateSubscriberInput)) + }) + 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.(*SubscriberUpdatePayload) + fc.Result = res + return ec.marshalNSubscriberUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateSubscriber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "subscriber": + return ec.fieldContext_SubscriberUpdatePayload_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubscriberUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateSubscriber_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteSubscriber(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteSubscriber(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteSubscriber(rctx, fc.Args["email"].(string), fc.Args["ownerID"].(*string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*SubscriberDeletePayload) + fc.Result = res + return ec.marshalNSubscriberDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteSubscriber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "email": + return ec.fieldContext_SubscriberDeletePayload_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubscriberDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteSubscriber_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createTemplate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateTemplate(rctx, fc.Args["input"].(generated.CreateTemplateInput)) + }) + 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.(*TemplateCreatePayload) + fc.Result = res + return ec.marshalNTemplateCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "template": + return ec.fieldContext_TemplateCreatePayload_template(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createTemplate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkTemplate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkTemplate(rctx, fc.Args["input"].([]*generated.CreateTemplateInput)) + }) + 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.(*TemplateBulkCreatePayload) + fc.Result = res + return ec.marshalNTemplateBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "templates": + return ec.fieldContext_TemplateBulkCreatePayload_templates(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkTemplate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVTemplate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVTemplate(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*TemplateBulkCreatePayload) + fc.Result = res + return ec.marshalNTemplateBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "templates": + return ec.fieldContext_TemplateBulkCreatePayload_templates(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVTemplate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateTemplate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTemplate(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateTemplateInput)) + }) + 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.(*TemplateUpdatePayload) + fc.Result = res + return ec.marshalNTemplateUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "template": + return ec.fieldContext_TemplateUpdatePayload_template(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateTemplate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteTemplate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteTemplate(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteTemplate(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*TemplateDeletePayload) + fc.Result = res + return ec.marshalNTemplateDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_TemplateDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteTemplate_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createTFASetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createTFASetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateTFASetting(rctx, fc.Args["input"].(generated.CreateTFASettingInput)) + }) + 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.(*TFASettingCreatePayload) + fc.Result = res + return ec.marshalNTFASettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTFASettingCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createTFASetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "tfaSetting": + return ec.fieldContext_TFASettingCreatePayload_tfaSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASettingCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createTFASetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateTFASetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateTFASetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTFASetting(rctx, fc.Args["input"].(generated.UpdateTFASettingInput)) + }) + 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.(*TFASettingUpdatePayload) + fc.Result = res + return ec.marshalNTFASettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTFASettingUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateTFASetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "tfaSetting": + return ec.fieldContext_TFASettingUpdatePayload_tfaSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASettingUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateTFASetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createUser(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateUser(rctx, fc.Args["input"].(generated.CreateUserInput)) + }) + 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.(*UserCreatePayload) + fc.Result = res + return ec.marshalNUserCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "user": + return ec.fieldContext_UserCreatePayload_user(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateUser(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateUser(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateUserInput)) + }) + 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.(*UserUpdatePayload) + fc.Result = res + return ec.marshalNUserUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "user": + return ec.fieldContext_UserUpdatePayload_user(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteUser(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteUser(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*UserDeletePayload) + fc.Result = res + return ec.marshalNUserDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_UserDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createUserSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createUserSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateUserSetting(rctx, fc.Args["input"].(generated.CreateUserSettingInput)) + }) + 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.(*UserSettingCreatePayload) + fc.Result = res + return ec.marshalNUserSettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createUserSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userSetting": + return ec.fieldContext_UserSettingCreatePayload_userSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createUserSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkUserSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkUserSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkUserSetting(rctx, fc.Args["input"].([]*generated.CreateUserSettingInput)) + }) + 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.(*UserSettingBulkCreatePayload) + fc.Result = res + return ec.marshalNUserSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkUserSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userSettings": + return ec.fieldContext_UserSettingBulkCreatePayload_userSettings(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkUserSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVUserSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVUserSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVUserSetting(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*UserSettingBulkCreatePayload) + fc.Result = res + return ec.marshalNUserSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVUserSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userSettings": + return ec.fieldContext_UserSettingBulkCreatePayload_userSettings(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVUserSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateUserSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateUserSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateUserSetting(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateUserSettingInput)) + }) + 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.(*UserSettingUpdatePayload) + fc.Result = res + return ec.marshalNUserSettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateUserSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "userSetting": + return ec.fieldContext_UserSettingUpdatePayload_userSetting(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateUserSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createWebhook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createWebhook(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateWebhook(rctx, fc.Args["input"].(generated.CreateWebhookInput)) + }) + 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.(*WebhookCreatePayload) + fc.Result = res + return ec.marshalNWebhookCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createWebhook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "webhook": + return ec.fieldContext_WebhookCreatePayload_webhook(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createWebhook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkWebhook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkWebhook(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkWebhook(rctx, fc.Args["input"].([]*generated.CreateWebhookInput)) + }) + 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.(*WebhookBulkCreatePayload) + fc.Result = res + return ec.marshalNWebhookBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkWebhook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "webhooks": + return ec.fieldContext_WebhookBulkCreatePayload_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkWebhook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createBulkCSVWebhook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBulkCSVWebhook(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateBulkCSVWebhook(rctx, fc.Args["input"].(graphql.Upload)) + }) + 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.(*WebhookBulkCreatePayload) + fc.Result = res + return ec.marshalNWebhookBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookBulkCreatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBulkCSVWebhook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "webhooks": + return ec.fieldContext_WebhookBulkCreatePayload_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookBulkCreatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createBulkCSVWebhook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateWebhook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateWebhook(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateWebhook(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateWebhookInput)) + }) + 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.(*WebhookUpdatePayload) + fc.Result = res + return ec.marshalNWebhookUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookUpdatePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateWebhook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "webhook": + return ec.fieldContext_WebhookUpdatePayload_webhook(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookUpdatePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateWebhook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteWebhook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteWebhook(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteWebhook(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*WebhookDeletePayload) + fc.Result = res + return ec.marshalNWebhookDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookDeletePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteWebhook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "deletedID": + return ec.fieldContext_WebhookDeletePayload_deletedID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookDeletePayload", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteWebhook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Note_id(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Note_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Note_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Note_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + 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) _Note_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + 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) _Note_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Note_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + 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) _Note_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_tags(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.Tags, 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_Note_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + 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) _Note_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Note_text(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_text(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.Text, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + 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) _Note_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Note_entity(ctx context.Context, field graphql.CollectedField, obj *generated.Note) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Note_entity(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.Entity(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Note_entity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Note", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.NoteConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.NoteEdge) + fc.Result = res + return ec.marshalONoteEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_NoteEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_NoteEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NoteEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.NoteConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.NoteConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteConnection", + 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 fc, nil +} + +func (ec *executionContext) _NoteEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.NoteEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Note) + fc.Result = res + return ec.marshalONote2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNote(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteEdge", + 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_Note_id(ctx, field) + case "createdAt": + return ec.fieldContext_Note_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Note_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Note_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Note_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Note_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Note_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Note_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Note_ownerID(ctx, field) + case "text": + return ec.fieldContext_Note_text(ctx, field) + case "owner": + return ec.fieldContext_Note_owner(ctx, field) + case "entity": + return ec.fieldContext_Note_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Note", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.NoteEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteEdge", + 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 fc, nil +} + +func (ec *executionContext) _NoteHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + 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) _NoteHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNNoteHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type NoteHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + 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) _NoteHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + 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) _NoteHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + 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) _NoteHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_tags(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.Tags, 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_NoteHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + 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) _NoteHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + 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) _NoteHistory_text(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistory_text(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.Text, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistory_text(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistory", + 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) _NoteHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.NoteHistoryEdge) + fc.Result = res + return ec.marshalONoteHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_NoteHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_NoteHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NoteHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _NoteHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.NoteHistory) + fc.Result = res + return ec.marshalONoteHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistoryEdge", + 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_NoteHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_NoteHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_NoteHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_NoteHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_NoteHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_NoteHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_NoteHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_NoteHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_NoteHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_NoteHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_NoteHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_NoteHistory_ownerID(ctx, field) + case "text": + return ec.fieldContext_NoteHistory_text(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NoteHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NoteHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.NoteHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NoteHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NoteHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NoteHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _OauthProvider_id(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProvider_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProvider_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProvider_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_tags(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_tags(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.Tags, 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_OauthProvider_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProvider_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProvider_name(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_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 { + 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_OauthProvider_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_clientID(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_clientID(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.ClientID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_clientID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_clientSecret(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_clientSecret(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.ClientSecret, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_clientSecret(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_redirectURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_redirectURL(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.RedirectURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_redirectURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_scopes(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_scopes(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.Scopes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_scopes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_authURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_authURL(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.AuthURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_authURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_tokenURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_tokenURL(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.TokenURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_tokenURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_authStyle(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_authStyle(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.AuthStyle, 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.(customtypes.Uint8) + fc.Result = res + return ec.marshalNUint2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_authStyle(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Uint does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProvider_infoURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_infoURL(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.InfoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_infoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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) _OauthProvider_owner(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProvider) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProvider_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProvider_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProvider", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderBulkCreatePayload_oauthProviders(ctx context.Context, field graphql.CollectedField, obj *OauthProviderBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderBulkCreatePayload_oauthProviders(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.OauthProviders, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OauthProvider) + fc.Result = res + return ec.marshalOOauthProvider2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderBulkCreatePayload_oauthProviders(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderBulkCreatePayload", + 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_OauthProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_OauthProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OauthProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OauthProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OauthProvider_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OauthProvider_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OauthProvider_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OauthProvider_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_OauthProvider_ownerID(ctx, field) + case "name": + return ec.fieldContext_OauthProvider_name(ctx, field) + case "clientID": + return ec.fieldContext_OauthProvider_clientID(ctx, field) + case "clientSecret": + return ec.fieldContext_OauthProvider_clientSecret(ctx, field) + case "redirectURL": + return ec.fieldContext_OauthProvider_redirectURL(ctx, field) + case "scopes": + return ec.fieldContext_OauthProvider_scopes(ctx, field) + case "authURL": + return ec.fieldContext_OauthProvider_authURL(ctx, field) + case "tokenURL": + return ec.fieldContext_OauthProvider_tokenURL(ctx, field) + case "authStyle": + return ec.fieldContext_OauthProvider_authStyle(ctx, field) + case "infoURL": + return ec.fieldContext_OauthProvider_infoURL(ctx, field) + case "owner": + return ec.fieldContext_OauthProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProvider", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OauthProviderEdge) + fc.Result = res + return ec.marshalOOauthProviderEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OauthProviderEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OauthProviderEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderConnection", + 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 fc, nil +} + +func (ec *executionContext) _OauthProviderCreatePayload_oauthProvider(ctx context.Context, field graphql.CollectedField, obj *OauthProviderCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderCreatePayload_oauthProvider(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.OauthProvider, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OauthProvider) + fc.Result = res + return ec.marshalNOauthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderCreatePayload_oauthProvider(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderCreatePayload", + 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_OauthProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_OauthProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OauthProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OauthProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OauthProvider_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OauthProvider_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OauthProvider_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OauthProvider_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_OauthProvider_ownerID(ctx, field) + case "name": + return ec.fieldContext_OauthProvider_name(ctx, field) + case "clientID": + return ec.fieldContext_OauthProvider_clientID(ctx, field) + case "clientSecret": + return ec.fieldContext_OauthProvider_clientSecret(ctx, field) + case "redirectURL": + return ec.fieldContext_OauthProvider_redirectURL(ctx, field) + case "scopes": + return ec.fieldContext_OauthProvider_scopes(ctx, field) + case "authURL": + return ec.fieldContext_OauthProvider_authURL(ctx, field) + case "tokenURL": + return ec.fieldContext_OauthProvider_tokenURL(ctx, field) + case "authStyle": + return ec.fieldContext_OauthProvider_authStyle(ctx, field) + case "infoURL": + return ec.fieldContext_OauthProvider_infoURL(ctx, field) + case "owner": + return ec.fieldContext_OauthProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProvider", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *OauthProviderDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OauthProvider) + fc.Result = res + return ec.marshalOOauthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderEdge", + 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_OauthProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_OauthProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OauthProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OauthProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OauthProvider_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OauthProvider_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OauthProvider_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OauthProvider_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_OauthProvider_ownerID(ctx, field) + case "name": + return ec.fieldContext_OauthProvider_name(ctx, field) + case "clientID": + return ec.fieldContext_OauthProvider_clientID(ctx, field) + case "clientSecret": + return ec.fieldContext_OauthProvider_clientSecret(ctx, field) + case "redirectURL": + return ec.fieldContext_OauthProvider_redirectURL(ctx, field) + case "scopes": + return ec.fieldContext_OauthProvider_scopes(ctx, field) + case "authURL": + return ec.fieldContext_OauthProvider_authURL(ctx, field) + case "tokenURL": + return ec.fieldContext_OauthProvider_tokenURL(ctx, field) + case "authStyle": + return ec.fieldContext_OauthProvider_authStyle(ctx, field) + case "infoURL": + return ec.fieldContext_OauthProvider_infoURL(ctx, field) + case "owner": + return ec.fieldContext_OauthProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProvider", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderEdge", + 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 fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNOauthProviderHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OauthProviderHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_tags(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.Tags, 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_OauthProviderHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_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 { + 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_OauthProviderHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_clientID(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_clientID(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.ClientID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_clientID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_clientSecret(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_clientSecret(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.ClientSecret, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_clientSecret(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_redirectURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_redirectURL(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.RedirectURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_redirectURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_scopes(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_scopes(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.Scopes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_scopes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_authURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_authURL(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.AuthURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_authURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_tokenURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_tokenURL(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.TokenURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_tokenURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistory_authStyle(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_authStyle(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.AuthStyle, 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.(customtypes.Uint8) + fc.Result = res + return ec.marshalNUint2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_authStyle(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Uint does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistory_infoURL(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistory_infoURL(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.InfoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistory_infoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistory", + 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) _OauthProviderHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OauthProviderHistoryEdge) + fc.Result = res + return ec.marshalOOauthProviderHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OauthProviderHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OauthProviderHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _OauthProviderHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OauthProviderHistory) + fc.Result = res + return ec.marshalOOauthProviderHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistoryEdge", + 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_OauthProviderHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_OauthProviderHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_OauthProviderHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_OauthProviderHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_OauthProviderHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OauthProviderHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OauthProviderHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OauthProviderHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OauthProviderHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OauthProviderHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OauthProviderHistory_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_OauthProviderHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_OauthProviderHistory_name(ctx, field) + case "clientID": + return ec.fieldContext_OauthProviderHistory_clientID(ctx, field) + case "clientSecret": + return ec.fieldContext_OauthProviderHistory_clientSecret(ctx, field) + case "redirectURL": + return ec.fieldContext_OauthProviderHistory_redirectURL(ctx, field) + case "scopes": + return ec.fieldContext_OauthProviderHistory_scopes(ctx, field) + case "authURL": + return ec.fieldContext_OauthProviderHistory_authURL(ctx, field) + case "tokenURL": + return ec.fieldContext_OauthProviderHistory_tokenURL(ctx, field) + case "authStyle": + return ec.fieldContext_OauthProviderHistory_authStyle(ctx, field) + case "infoURL": + return ec.fieldContext_OauthProviderHistory_infoURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OauthProviderHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OauthProviderHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _OauthProviderUpdatePayload_oauthProvider(ctx context.Context, field graphql.CollectedField, obj *OauthProviderUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OauthProviderUpdatePayload_oauthProvider(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.OauthProvider, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OauthProvider) + fc.Result = res + return ec.marshalNOauthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OauthProviderUpdatePayload_oauthProvider(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OauthProviderUpdatePayload", + 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_OauthProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_OauthProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OauthProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OauthProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OauthProvider_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OauthProvider_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OauthProvider_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OauthProvider_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_OauthProvider_ownerID(ctx, field) + case "name": + return ec.fieldContext_OauthProvider_name(ctx, field) + case "clientID": + return ec.fieldContext_OauthProvider_clientID(ctx, field) + case "clientSecret": + return ec.fieldContext_OauthProvider_clientSecret(ctx, field) + case "redirectURL": + return ec.fieldContext_OauthProvider_redirectURL(ctx, field) + case "scopes": + return ec.fieldContext_OauthProvider_scopes(ctx, field) + case "authURL": + return ec.fieldContext_OauthProvider_authURL(ctx, field) + case "tokenURL": + return ec.fieldContext_OauthProvider_tokenURL(ctx, field) + case "authStyle": + return ec.fieldContext_OauthProvider_authStyle(ctx, field) + case "infoURL": + return ec.fieldContext_OauthProvider_infoURL(ctx, field) + case "owner": + return ec.fieldContext_OauthProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProvider", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooToken_id(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooToken_tags(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_tags(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.Tags, 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_OhAuthTooToken_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_clientID(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_clientID(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.ClientID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_clientID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_scopes(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_scopes(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.Scopes, 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_OhAuthTooToken_scopes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_nonce(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_nonce(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.Nonce, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_nonce(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_claimsUserID(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_claimsUserID(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.ClaimsUserID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_claimsUserID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_claimsUsername(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_claimsUsername(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.ClaimsUsername, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_claimsUsername(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_claimsEmail(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_claimsEmail(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.ClaimsEmail, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_claimsEmail(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_claimsEmailVerified(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_claimsEmailVerified(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.ClaimsEmailVerified, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_claimsEmailVerified(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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 fc, nil +} + +func (ec *executionContext) _OhAuthTooToken_claimsGroups(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_claimsGroups(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.ClaimsGroups, 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_OhAuthTooToken_claimsGroups(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_claimsPreferredUsername(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(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.ClaimsPreferredUsername, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_claimsPreferredUsername(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_connectorID(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_connectorID(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.ConnectorID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_connectorID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_connectorData(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_connectorData(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.ConnectorData, 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_OhAuthTooToken_connectorData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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) _OhAuthTooToken_lastUsed(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_lastUsed(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.LastUsed, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_lastUsed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooToken_integration(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_integration(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.Integration(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_integration(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooToken_events(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooToken_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooToken_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooToken", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenBulkCreatePayload_ohAuthTooTokens(ctx context.Context, field graphql.CollectedField, obj *OhAuthTooTokenBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenBulkCreatePayload_ohAuthTooTokens(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.OhAuthTooTokens, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OhAuthTooToken) + fc.Result = res + return ec.marshalOOhAuthTooToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenBulkCreatePayload_ohAuthTooTokens(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenBulkCreatePayload", + 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_OhAuthTooToken_id(ctx, field) + case "tags": + return ec.fieldContext_OhAuthTooToken_tags(ctx, field) + case "clientID": + return ec.fieldContext_OhAuthTooToken_clientID(ctx, field) + case "scopes": + return ec.fieldContext_OhAuthTooToken_scopes(ctx, field) + case "nonce": + return ec.fieldContext_OhAuthTooToken_nonce(ctx, field) + case "claimsUserID": + return ec.fieldContext_OhAuthTooToken_claimsUserID(ctx, field) + case "claimsUsername": + return ec.fieldContext_OhAuthTooToken_claimsUsername(ctx, field) + case "claimsEmail": + return ec.fieldContext_OhAuthTooToken_claimsEmail(ctx, field) + case "claimsEmailVerified": + return ec.fieldContext_OhAuthTooToken_claimsEmailVerified(ctx, field) + case "claimsGroups": + return ec.fieldContext_OhAuthTooToken_claimsGroups(ctx, field) + case "claimsPreferredUsername": + return ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(ctx, field) + case "connectorID": + return ec.fieldContext_OhAuthTooToken_connectorID(ctx, field) + case "connectorData": + return ec.fieldContext_OhAuthTooToken_connectorData(ctx, field) + case "lastUsed": + return ec.fieldContext_OhAuthTooToken_lastUsed(ctx, field) + case "integration": + return ec.fieldContext_OhAuthTooToken_integration(ctx, field) + case "events": + return ec.fieldContext_OhAuthTooToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooTokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OhAuthTooTokenEdge) + fc.Result = res + return ec.marshalOOhAuthTooTokenEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OhAuthTooTokenEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OhAuthTooTokenEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooTokenEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooTokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooTokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenConnection", + 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 fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenCreatePayload_ohAuthTooToken(ctx context.Context, field graphql.CollectedField, obj *OhAuthTooTokenCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenCreatePayload_ohAuthTooToken(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.OhAuthTooToken, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OhAuthTooToken) + fc.Result = res + return ec.marshalNOhAuthTooToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenCreatePayload_ohAuthTooToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenCreatePayload", + 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_OhAuthTooToken_id(ctx, field) + case "tags": + return ec.fieldContext_OhAuthTooToken_tags(ctx, field) + case "clientID": + return ec.fieldContext_OhAuthTooToken_clientID(ctx, field) + case "scopes": + return ec.fieldContext_OhAuthTooToken_scopes(ctx, field) + case "nonce": + return ec.fieldContext_OhAuthTooToken_nonce(ctx, field) + case "claimsUserID": + return ec.fieldContext_OhAuthTooToken_claimsUserID(ctx, field) + case "claimsUsername": + return ec.fieldContext_OhAuthTooToken_claimsUsername(ctx, field) + case "claimsEmail": + return ec.fieldContext_OhAuthTooToken_claimsEmail(ctx, field) + case "claimsEmailVerified": + return ec.fieldContext_OhAuthTooToken_claimsEmailVerified(ctx, field) + case "claimsGroups": + return ec.fieldContext_OhAuthTooToken_claimsGroups(ctx, field) + case "claimsPreferredUsername": + return ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(ctx, field) + case "connectorID": + return ec.fieldContext_OhAuthTooToken_connectorID(ctx, field) + case "connectorData": + return ec.fieldContext_OhAuthTooToken_connectorData(ctx, field) + case "lastUsed": + return ec.fieldContext_OhAuthTooToken_lastUsed(ctx, field) + case "integration": + return ec.fieldContext_OhAuthTooToken_integration(ctx, field) + case "events": + return ec.fieldContext_OhAuthTooToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *OhAuthTooTokenDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooTokenEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OhAuthTooToken) + fc.Result = res + return ec.marshalOOhAuthTooToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenEdge", + 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_OhAuthTooToken_id(ctx, field) + case "tags": + return ec.fieldContext_OhAuthTooToken_tags(ctx, field) + case "clientID": + return ec.fieldContext_OhAuthTooToken_clientID(ctx, field) + case "scopes": + return ec.fieldContext_OhAuthTooToken_scopes(ctx, field) + case "nonce": + return ec.fieldContext_OhAuthTooToken_nonce(ctx, field) + case "claimsUserID": + return ec.fieldContext_OhAuthTooToken_claimsUserID(ctx, field) + case "claimsUsername": + return ec.fieldContext_OhAuthTooToken_claimsUsername(ctx, field) + case "claimsEmail": + return ec.fieldContext_OhAuthTooToken_claimsEmail(ctx, field) + case "claimsEmailVerified": + return ec.fieldContext_OhAuthTooToken_claimsEmailVerified(ctx, field) + case "claimsGroups": + return ec.fieldContext_OhAuthTooToken_claimsGroups(ctx, field) + case "claimsPreferredUsername": + return ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(ctx, field) + case "connectorID": + return ec.fieldContext_OhAuthTooToken_connectorID(ctx, field) + case "connectorData": + return ec.fieldContext_OhAuthTooToken_connectorData(ctx, field) + case "lastUsed": + return ec.fieldContext_OhAuthTooToken_lastUsed(ctx, field) + case "integration": + return ec.fieldContext_OhAuthTooToken_integration(ctx, field) + case "events": + return ec.fieldContext_OhAuthTooToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OhAuthTooTokenEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenEdge", + 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 fc, nil +} + +func (ec *executionContext) _OhAuthTooTokenUpdatePayload_ohAuthTooToken(ctx context.Context, field graphql.CollectedField, obj *OhAuthTooTokenUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OhAuthTooTokenUpdatePayload_ohAuthTooToken(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.OhAuthTooToken, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OhAuthTooToken) + fc.Result = res + return ec.marshalNOhAuthTooToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OhAuthTooTokenUpdatePayload_ohAuthTooToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OhAuthTooTokenUpdatePayload", + 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_OhAuthTooToken_id(ctx, field) + case "tags": + return ec.fieldContext_OhAuthTooToken_tags(ctx, field) + case "clientID": + return ec.fieldContext_OhAuthTooToken_clientID(ctx, field) + case "scopes": + return ec.fieldContext_OhAuthTooToken_scopes(ctx, field) + case "nonce": + return ec.fieldContext_OhAuthTooToken_nonce(ctx, field) + case "claimsUserID": + return ec.fieldContext_OhAuthTooToken_claimsUserID(ctx, field) + case "claimsUsername": + return ec.fieldContext_OhAuthTooToken_claimsUsername(ctx, field) + case "claimsEmail": + return ec.fieldContext_OhAuthTooToken_claimsEmail(ctx, field) + case "claimsEmailVerified": + return ec.fieldContext_OhAuthTooToken_claimsEmailVerified(ctx, field) + case "claimsGroups": + return ec.fieldContext_OhAuthTooToken_claimsGroups(ctx, field) + case "claimsPreferredUsername": + return ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(ctx, field) + case "connectorID": + return ec.fieldContext_OhAuthTooToken_connectorID(ctx, field) + case "connectorData": + return ec.fieldContext_OhAuthTooToken_connectorData(ctx, field) + case "lastUsed": + return ec.fieldContext_OhAuthTooToken_lastUsed(ctx, field) + case "integration": + return ec.fieldContext_OhAuthTooToken_integration(ctx, field) + case "events": + return ec.fieldContext_OhAuthTooToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_id(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + 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) _OrgMembership_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + 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) _OrgMembership_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + 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) _OrgMembership_role(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_role(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.Role, 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.(enums.Role) + fc.Result = res + return ec.marshalNOrgMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OrgMembershipRole does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_organizationID(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_organizationID(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.OrganizationID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_organizationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_userID(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_userID(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.UserID, 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.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_organization(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_organization(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.Organization(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.(*generated.Organization) + fc.Result = res + return ec.marshalNOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_user(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_user(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.User(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.(*generated.User) + fc.Result = res + return ec.marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembership_events(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembership) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembership_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembership_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembership", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipBulkCreatePayload_orgMemberships(ctx context.Context, field graphql.CollectedField, obj *OrgMembershipBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipBulkCreatePayload_orgMemberships(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.OrgMemberships, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrgMembership) + fc.Result = res + return ec.marshalOOrgMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipBulkCreatePayload_orgMemberships(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipBulkCreatePayload", + 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_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrgMembershipEdge) + fc.Result = res + return ec.marshalOOrgMembershipEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OrgMembershipEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OrgMembershipEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipConnection", + 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 fc, nil +} + +func (ec *executionContext) _OrgMembershipCreatePayload_orgMembership(ctx context.Context, field graphql.CollectedField, obj *OrgMembershipCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipCreatePayload_orgMembership(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.OrgMembership, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrgMembership) + fc.Result = res + return ec.marshalNOrgMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipCreatePayload_orgMembership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipCreatePayload", + 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_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *OrgMembershipDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OrgMembership) + fc.Result = res + return ec.marshalOOrgMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipEdge", + 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_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipEdge", + 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 fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + 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) _OrgMembershipHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNOrgMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OrgMembershipHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + 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) _OrgMembershipHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + 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) _OrgMembershipHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + 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) _OrgMembershipHistory_role(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_role(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.Role, 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.(enums.Role) + fc.Result = res + return ec.marshalNOrgMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OrgMembershipHistoryRole does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistory_organizationID(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_organizationID(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.OrganizationID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_organizationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + 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) _OrgMembershipHistory_userID(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistory_userID(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.UserID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistory_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistory", + 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) _OrgMembershipHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrgMembershipHistoryEdge) + fc.Result = res + return ec.marshalOOrgMembershipHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OrgMembershipHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OrgMembershipHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _OrgMembershipHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OrgMembershipHistory) + fc.Result = res + return ec.marshalOOrgMembershipHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistoryEdge", + 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_OrgMembershipHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_OrgMembershipHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_OrgMembershipHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_OrgMembershipHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembershipHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembershipHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembershipHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembershipHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembershipHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembershipHistory_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembershipHistory_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembershipHistory_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembershipHistory_userID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrgMembershipHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OrgMembershipHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _OrgMembershipUpdatePayload_orgMembership(ctx context.Context, field graphql.CollectedField, obj *OrgMembershipUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgMembershipUpdatePayload_orgMembership(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.OrgMembership, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrgMembership) + fc.Result = res + return ec.marshalNOrgMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgMembershipUpdatePayload_orgMembership(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgMembershipUpdatePayload", + 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_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_tags(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.Tags, 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_Organization_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_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 { + 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_Organization_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_description(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_personalOrg(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_personalOrg(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.PersonalOrg, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_personalOrg(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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 fc, nil +} + +func (ec *executionContext) _Organization_avatarRemoteURL(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_avatarRemoteURL(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.AvatarRemoteURL, 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_Organization_avatarRemoteURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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) _Organization_dedicatedDb(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_dedicatedDb(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.DedicatedDb, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_dedicatedDb(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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 fc, nil +} + +func (ec *executionContext) _Organization_parent(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_parent(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.Parent(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_parent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_children(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_children(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.Children(ctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.OrganizationOrder), fc.Args["where"].(*generated.OrganizationWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationConnection) + fc.Result = res + return ec.marshalNOrganizationConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_children(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OrganizationConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OrganizationConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OrganizationConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationConnection", 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_Organization_children_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Organization_groups(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_groups(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.Groups(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_groups(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_templates(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_templates(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.Templates(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Template) + fc.Result = res + return ec.marshalOTemplate2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_templates(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Template_id(ctx, field) + case "createdAt": + return ec.fieldContext_Template_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Template_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Template_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Template_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Template_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Template_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Template_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Template_ownerID(ctx, field) + case "name": + return ec.fieldContext_Template_name(ctx, field) + case "templateType": + return ec.fieldContext_Template_templateType(ctx, field) + case "description": + return ec.fieldContext_Template_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_Template_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_Template_uischema(ctx, field) + case "owner": + return ec.fieldContext_Template_owner(ctx, field) + case "documents": + return ec.fieldContext_Template_documents(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Template", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_integrations(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_integrations(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.Integrations(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_integrations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_setting(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_setting(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.Setting(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OrganizationSetting) + fc.Result = res + return ec.marshalOOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_setting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_OrganizationSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationSetting_deletedBy(ctx, field) + case "domains": + return ec.fieldContext_OrganizationSetting_domains(ctx, field) + case "billingContact": + return ec.fieldContext_OrganizationSetting_billingContact(ctx, field) + case "billingEmail": + return ec.fieldContext_OrganizationSetting_billingEmail(ctx, field) + case "billingPhone": + return ec.fieldContext_OrganizationSetting_billingPhone(ctx, field) + case "billingAddress": + return ec.fieldContext_OrganizationSetting_billingAddress(ctx, field) + case "taxIdentifier": + return ec.fieldContext_OrganizationSetting_taxIdentifier(ctx, field) + case "geoLocation": + return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) + case "organizationID": + return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) + case "organization": + return ec.fieldContext_OrganizationSetting_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_documentdata(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_documentdata(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.Documentdata(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.DocumentData) + fc.Result = res + return ec.marshalODocumentData2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_documentdata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_entitlements(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_entitlements(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.Entitlements(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entitlement) + fc.Result = res + return ec.marshalOEntitlement2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_entitlements(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_organizationEntitlement(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_organizationEntitlement(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.OrganizationEntitlement(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entitlement) + fc.Result = res + return ec.marshalOEntitlement2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_organizationEntitlement(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_personalAccessTokens(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_personalAccessTokens(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.PersonalAccessTokens(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalOPersonalAccessToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_personalAccessTokens(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_apiTokens(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_apiTokens(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.APITokens(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.APIToken) + fc.Result = res + return ec.marshalOAPIToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_apiTokens(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_APIToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_APIToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_APIToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_APIToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_APIToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_APIToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_APIToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_APIToken_tags(ctx, field) + case "ownerID": + return ec.fieldContext_APIToken_ownerID(ctx, field) + case "name": + return ec.fieldContext_APIToken_name(ctx, field) + case "token": + return ec.fieldContext_APIToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_APIToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_APIToken_description(ctx, field) + case "scopes": + return ec.fieldContext_APIToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_APIToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_APIToken_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APIToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_oauthprovider(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_oauthprovider(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.Oauthprovider(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OauthProvider) + fc.Result = res + return ec.marshalOOauthProvider2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_oauthprovider(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_OauthProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_OauthProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OauthProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OauthProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OauthProvider_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OauthProvider_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OauthProvider_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OauthProvider_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_OauthProvider_ownerID(ctx, field) + case "name": + return ec.fieldContext_OauthProvider_name(ctx, field) + case "clientID": + return ec.fieldContext_OauthProvider_clientID(ctx, field) + case "clientSecret": + return ec.fieldContext_OauthProvider_clientSecret(ctx, field) + case "redirectURL": + return ec.fieldContext_OauthProvider_redirectURL(ctx, field) + case "scopes": + return ec.fieldContext_OauthProvider_scopes(ctx, field) + case "authURL": + return ec.fieldContext_OauthProvider_authURL(ctx, field) + case "tokenURL": + return ec.fieldContext_OauthProvider_tokenURL(ctx, field) + case "authStyle": + return ec.fieldContext_OauthProvider_authStyle(ctx, field) + case "infoURL": + return ec.fieldContext_OauthProvider_infoURL(ctx, field) + case "owner": + return ec.fieldContext_OauthProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProvider", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_users(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_users(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.Users(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.User) + fc.Result = res + return ec.marshalOUser2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_users(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_invites(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_invites(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.Invites(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Invite) + fc.Result = res + return ec.marshalOInvite2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_invites(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Invite_id(ctx, field) + case "createdAt": + return ec.fieldContext_Invite_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Invite_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Invite_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Invite_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Invite_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Invite_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Invite_ownerID(ctx, field) + case "expires": + return ec.fieldContext_Invite_expires(ctx, field) + case "recipient": + return ec.fieldContext_Invite_recipient(ctx, field) + case "status": + return ec.fieldContext_Invite_status(ctx, field) + case "role": + return ec.fieldContext_Invite_role(ctx, field) + case "sendAttempts": + return ec.fieldContext_Invite_sendAttempts(ctx, field) + case "requestorID": + return ec.fieldContext_Invite_requestorID(ctx, field) + case "owner": + return ec.fieldContext_Invite_owner(ctx, field) + case "events": + return ec.fieldContext_Invite_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invite", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_subscribers(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_subscribers(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.Subscribers(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Subscriber) + fc.Result = res + return ec.marshalOSubscriber2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_subscribers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_webhooks(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_webhooks(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.Webhooks(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Webhook) + fc.Result = res + return ec.marshalOWebhook2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_webhooks(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_events(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_secrets(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_secrets(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.Secrets(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Hush) + fc.Result = res + return ec.marshalOHush2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_secrets(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_features(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_features(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.Features(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Feature) + fc.Result = res + return ec.marshalOFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_features(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_files(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_files(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.Files(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.File) + fc.Result = res + return ec.marshalOFile2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_entitlementplans(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_entitlementplans(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.Entitlementplans(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlan) + fc.Result = res + return ec.marshalOEntitlementPlan2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_entitlementplans(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_entitlementplanfeatures(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_entitlementplanfeatures(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.Entitlementplanfeatures(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalOEntitlementPlanFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_entitlementplanfeatures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_entities(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_entities(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.Entities(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Entity) + fc.Result = res + return ec.marshalOEntity2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_entities(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_entitytypes(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_entitytypes(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.Entitytypes(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.EntityType) + fc.Result = res + return ec.marshalOEntityType2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_entitytypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_EntityType_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntityType_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityType_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityType_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityType_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityType_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityType_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityType_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityType_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityType_name(ctx, field) + case "owner": + return ec.fieldContext_EntityType_owner(ctx, field) + case "entities": + return ec.fieldContext_EntityType_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityType", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_contacts(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_contacts(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.Contacts(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Contact) + fc.Result = res + return ec.marshalOContact2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_contacts(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Contact_id(ctx, field) + case "createdAt": + return ec.fieldContext_Contact_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Contact_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Contact_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Contact_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Contact_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Contact_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Contact_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Contact_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_Contact_fullName(ctx, field) + case "title": + return ec.fieldContext_Contact_title(ctx, field) + case "company": + return ec.fieldContext_Contact_company(ctx, field) + case "email": + return ec.fieldContext_Contact_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Contact_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_Contact_address(ctx, field) + case "status": + return ec.fieldContext_Contact_status(ctx, field) + case "owner": + return ec.fieldContext_Contact_owner(ctx, field) + case "entities": + return ec.fieldContext_Contact_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Contact", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_notes(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_notes(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.Notes(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Note) + fc.Result = res + return ec.marshalONote2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_notes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_Note_id(ctx, field) + case "createdAt": + return ec.fieldContext_Note_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Note_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Note_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Note_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Note_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Note_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Note_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Note_ownerID(ctx, field) + case "text": + return ec.fieldContext_Note_text(ctx, field) + case "owner": + return ec.fieldContext_Note_owner(ctx, field) + case "entity": + return ec.fieldContext_Note_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Note", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Organization_members(ctx context.Context, field graphql.CollectedField, obj *generated.Organization) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Organization_members(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.Members(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrgMembership) + fc.Result = res + return ec.marshalOOrgMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Organization_members(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Organization", + 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_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationBulkCreatePayload_organizations(ctx context.Context, field graphql.CollectedField, obj *OrganizationBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationBulkCreatePayload_organizations(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.Organizations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationBulkCreatePayload_organizations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationBulkCreatePayload", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrganizationEdge) + fc.Result = res + return ec.marshalOOrganizationEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OrganizationEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OrganizationEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationConnection", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationCreatePayload_organization(ctx context.Context, field graphql.CollectedField, obj *OrganizationCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationCreatePayload_organization(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.Organization, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalNOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationCreatePayload_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationCreatePayload", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *OrganizationDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationEdge", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationEdge", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNOrganizationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OrganizationHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_tags(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.Tags, 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_OrganizationHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_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 { + 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_OrganizationHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_personalOrg(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_personalOrg(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.PersonalOrg, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_personalOrg(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationHistory_avatarRemoteURL(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_avatarRemoteURL(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.AvatarRemoteURL, 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_OrganizationHistory_avatarRemoteURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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) _OrganizationHistory_dedicatedDb(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistory_dedicatedDb(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.DedicatedDb, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistory_dedicatedDb(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistory", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrganizationHistoryEdge) + fc.Result = res + return ec.marshalOOrganizationHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OrganizationHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OrganizationHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OrganizationHistory) + fc.Result = res + return ec.marshalOOrganizationHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistoryEdge", + 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_OrganizationHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_OrganizationHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_OrganizationHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_OrganizationHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationHistory_deletedBy(ctx, field) + case "name": + return ec.fieldContext_OrganizationHistory_name(ctx, field) + case "displayName": + return ec.fieldContext_OrganizationHistory_displayName(ctx, field) + case "description": + return ec.fieldContext_OrganizationHistory_description(ctx, field) + case "personalOrg": + return ec.fieldContext_OrganizationHistory_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_OrganizationHistory_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_OrganizationHistory_dedicatedDb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationSearchResult_organizations(ctx context.Context, field graphql.CollectedField, obj *OrganizationSearchResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSearchResult_organizations(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.Organizations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSearchResult_organizations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSearchResult", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSetting_id(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSetting_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSetting_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSetting_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_tags(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_tags(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.Tags, 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_OrganizationSetting_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSetting_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_domains(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_domains(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.Domains, 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_OrganizationSetting_domains(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_billingContact(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_billingContact(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.BillingContact, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_billingContact(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_billingEmail(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_billingEmail(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.BillingEmail, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_billingEmail(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_billingPhone(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_billingPhone(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.BillingPhone, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_billingPhone(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_billingAddress(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_billingAddress(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.BillingAddress, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_billingAddress(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_taxIdentifier(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_taxIdentifier(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.TaxIdentifier, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_taxIdentifier(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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) _OrganizationSetting_geoLocation(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_geoLocation(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.GeoLocation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(enums.Region) + fc.Result = res + return ec.marshalOOrganizationSettingRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_geoLocation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OrganizationSettingRegion does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSetting_organizationID(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_organizationID(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.OrganizationID, 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.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_organizationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSetting_organization(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSetting_organization(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.Organization(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSetting_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSetting", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingBulkCreatePayload_organizationSettings(ctx context.Context, field graphql.CollectedField, obj *OrganizationSettingBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingBulkCreatePayload_organizationSettings(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.OrganizationSettings, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrganizationSetting) + fc.Result = res + return ec.marshalOOrganizationSetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingBulkCreatePayload_organizationSettings(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingBulkCreatePayload", + 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_OrganizationSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationSetting_deletedBy(ctx, field) + case "domains": + return ec.fieldContext_OrganizationSetting_domains(ctx, field) + case "billingContact": + return ec.fieldContext_OrganizationSetting_billingContact(ctx, field) + case "billingEmail": + return ec.fieldContext_OrganizationSetting_billingEmail(ctx, field) + case "billingPhone": + return ec.fieldContext_OrganizationSetting_billingPhone(ctx, field) + case "billingAddress": + return ec.fieldContext_OrganizationSetting_billingAddress(ctx, field) + case "taxIdentifier": + return ec.fieldContext_OrganizationSetting_taxIdentifier(ctx, field) + case "geoLocation": + return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) + case "organizationID": + return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) + case "organization": + return ec.fieldContext_OrganizationSetting_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrganizationSettingEdge) + fc.Result = res + return ec.marshalOOrganizationSettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OrganizationSettingEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OrganizationSettingEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingConnection", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationSettingCreatePayload_organizationSetting(ctx context.Context, field graphql.CollectedField, obj *OrganizationSettingCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingCreatePayload_organizationSetting(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.OrganizationSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationSetting) + fc.Result = res + return ec.marshalNOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingCreatePayload_organizationSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingCreatePayload", + 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_OrganizationSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationSetting_deletedBy(ctx, field) + case "domains": + return ec.fieldContext_OrganizationSetting_domains(ctx, field) + case "billingContact": + return ec.fieldContext_OrganizationSetting_billingContact(ctx, field) + case "billingEmail": + return ec.fieldContext_OrganizationSetting_billingEmail(ctx, field) + case "billingPhone": + return ec.fieldContext_OrganizationSetting_billingPhone(ctx, field) + case "billingAddress": + return ec.fieldContext_OrganizationSetting_billingAddress(ctx, field) + case "taxIdentifier": + return ec.fieldContext_OrganizationSetting_taxIdentifier(ctx, field) + case "geoLocation": + return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) + case "organizationID": + return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) + case "organization": + return ec.fieldContext_OrganizationSetting_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *OrganizationSettingDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OrganizationSetting) + fc.Result = res + return ec.marshalOOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingEdge", + 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_OrganizationSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationSetting_deletedBy(ctx, field) + case "domains": + return ec.fieldContext_OrganizationSetting_domains(ctx, field) + case "billingContact": + return ec.fieldContext_OrganizationSetting_billingContact(ctx, field) + case "billingEmail": + return ec.fieldContext_OrganizationSetting_billingEmail(ctx, field) + case "billingPhone": + return ec.fieldContext_OrganizationSetting_billingPhone(ctx, field) + case "billingAddress": + return ec.fieldContext_OrganizationSetting_billingAddress(ctx, field) + case "taxIdentifier": + return ec.fieldContext_OrganizationSetting_taxIdentifier(ctx, field) + case "geoLocation": + return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) + case "organizationID": + return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) + case "organization": + return ec.fieldContext_OrganizationSetting_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingEdge", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNOrganizationSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OrganizationSettingHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_tags(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.Tags, 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_OrganizationSettingHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_domains(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_domains(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.Domains, 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_OrganizationSettingHistory_domains(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_billingContact(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_billingContact(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.BillingContact, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_billingContact(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_billingEmail(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_billingEmail(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.BillingEmail, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_billingEmail(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_billingPhone(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_billingPhone(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.BillingPhone, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_billingPhone(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_billingAddress(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_billingAddress(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.BillingAddress, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_billingAddress(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_taxIdentifier(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_taxIdentifier(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.TaxIdentifier, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_taxIdentifier(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistory_geoLocation(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_geoLocation(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.GeoLocation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(enums.Region) + fc.Result = res + return ec.marshalOOrganizationSettingHistoryRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_geoLocation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type OrganizationSettingHistoryRegion does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistory_organizationID(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistory_organizationID(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.OrganizationID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistory_organizationID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistory", + 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) _OrganizationSettingHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrganizationSettingHistoryEdge) + fc.Result = res + return ec.marshalOOrganizationSettingHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_OrganizationSettingHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_OrganizationSettingHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.OrganizationSettingHistory) + fc.Result = res + return ec.marshalOOrganizationSettingHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistoryEdge", + 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_OrganizationSettingHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_OrganizationSettingHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_OrganizationSettingHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_OrganizationSettingHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationSettingHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationSettingHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationSettingHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationSettingHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationSettingHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationSettingHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationSettingHistory_deletedBy(ctx, field) + case "domains": + return ec.fieldContext_OrganizationSettingHistory_domains(ctx, field) + case "billingContact": + return ec.fieldContext_OrganizationSettingHistory_billingContact(ctx, field) + case "billingEmail": + return ec.fieldContext_OrganizationSettingHistory_billingEmail(ctx, field) + case "billingPhone": + return ec.fieldContext_OrganizationSettingHistory_billingPhone(ctx, field) + case "billingAddress": + return ec.fieldContext_OrganizationSettingHistory_billingAddress(ctx, field) + case "taxIdentifier": + return ec.fieldContext_OrganizationSettingHistory_taxIdentifier(ctx, field) + case "geoLocation": + return ec.fieldContext_OrganizationSettingHistory_geoLocation(ctx, field) + case "organizationID": + return ec.fieldContext_OrganizationSettingHistory_organizationID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationSettingHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _OrganizationSettingUpdatePayload_organizationSetting(ctx context.Context, field graphql.CollectedField, obj *OrganizationSettingUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationSettingUpdatePayload_organizationSetting(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.OrganizationSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationSetting) + fc.Result = res + return ec.marshalNOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationSettingUpdatePayload_organizationSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationSettingUpdatePayload", + 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_OrganizationSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationSetting_deletedBy(ctx, field) + case "domains": + return ec.fieldContext_OrganizationSetting_domains(ctx, field) + case "billingContact": + return ec.fieldContext_OrganizationSetting_billingContact(ctx, field) + case "billingEmail": + return ec.fieldContext_OrganizationSetting_billingEmail(ctx, field) + case "billingPhone": + return ec.fieldContext_OrganizationSetting_billingPhone(ctx, field) + case "billingAddress": + return ec.fieldContext_OrganizationSetting_billingAddress(ctx, field) + case "taxIdentifier": + return ec.fieldContext_OrganizationSetting_taxIdentifier(ctx, field) + case "geoLocation": + return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) + case "organizationID": + return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) + case "organization": + return ec.fieldContext_OrganizationSetting_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _OrganizationUpdatePayload_organization(ctx context.Context, field graphql.CollectedField, obj *OrganizationUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrganizationUpdatePayload_organization(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.Organization, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalNOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrganizationUpdatePayload_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrganizationUpdatePayload", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(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.HasNextPage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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 Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(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.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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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 Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(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.StartCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entgql.Cursor[string]) + fc.Result = res + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_startCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Cursor does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *entgql.PageInfo[string]) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(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.EndCursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entgql.Cursor[string]) + fc.Result = res + return ec.marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PageInfo_endCursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PageInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Cursor does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_id(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_tags(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_tags(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.Tags, 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_PersonalAccessToken_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_name(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_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 { + 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_PersonalAccessToken_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_token(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_token(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.Token, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_expiresAt(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_expiresAt(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.ExpiresAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_expiresAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_description(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_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_PersonalAccessToken_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_scopes(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_scopes(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.Scopes, 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_PersonalAccessToken_scopes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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) _PersonalAccessToken_lastUsedAt(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_lastUsedAt(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.LastUsedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_lastUsedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_owner(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_owner(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.Owner(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.(*generated.User) + fc.Result = res + return ec.marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_organizations(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_organizations(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.Organizations(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_organizations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessToken_events(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessToken) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessToken_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessToken_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessToken", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenBulkCreatePayload_personalAccessTokens(ctx context.Context, field graphql.CollectedField, obj *PersonalAccessTokenBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenBulkCreatePayload_personalAccessTokens(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.PersonalAccessTokens, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalOPersonalAccessToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenBulkCreatePayload_personalAccessTokens(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenBulkCreatePayload", + 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_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessTokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.PersonalAccessTokenEdge) + fc.Result = res + return ec.marshalOPersonalAccessTokenEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_PersonalAccessTokenEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_PersonalAccessTokenEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessTokenEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessTokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessTokenConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenConnection", + 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 fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenCreatePayload_personalAccessToken(ctx context.Context, field graphql.CollectedField, obj *PersonalAccessTokenCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenCreatePayload_personalAccessToken(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.PersonalAccessToken, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalNPersonalAccessToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenCreatePayload_personalAccessToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenCreatePayload", + 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_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *PersonalAccessTokenDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessTokenEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalOPersonalAccessToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenEdge", + 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_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.PersonalAccessTokenEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenEdge", + 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 fc, nil +} + +func (ec *executionContext) _PersonalAccessTokenUpdatePayload_personalAccessToken(ctx context.Context, field graphql.CollectedField, obj *PersonalAccessTokenUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PersonalAccessTokenUpdatePayload_personalAccessToken(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.PersonalAccessToken, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalNPersonalAccessToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PersonalAccessTokenUpdatePayload_personalAccessToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PersonalAccessTokenUpdatePayload", + 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_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", field.Name) + }, + } + 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) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Node(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(generated.Noder) + fc.Result = res + return ec.marshalONode2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoder(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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) _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 + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Nodes(rctx, fc.Args["ids"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]generated.Noder) + fc.Result = res + return ec.marshalNNode2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoder(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_nodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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) _Query_apiTokens(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_apiTokens(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().APITokens(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.APITokenWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.APITokenConnection) + fc.Result = res + return ec.marshalNAPITokenConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_apiTokens(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_APITokenConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_APITokenConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_APITokenConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APITokenConnection", 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_apiTokens_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_contacts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_contacts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Contacts(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.ContactWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.ContactConnection) + fc.Result = res + return ec.marshalNContactConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_contacts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ContactConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ContactConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ContactConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactConnection", 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_contacts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_contactHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_contactHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ContactHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.ContactHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.ContactHistoryConnection) + fc.Result = res + return ec.marshalNContactHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_contactHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_ContactHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ContactHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ContactHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ContactHistoryConnection", 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_contactHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_documentDataSlice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_documentDataSlice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().DocumentDataSlice(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.DocumentDataWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.DocumentDataConnection) + fc.Result = res + return ec.marshalNDocumentDataConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_documentDataSlice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_DocumentDataConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_DocumentDataConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_DocumentDataConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataConnection", 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_documentDataSlice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_documentDataHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_documentDataHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().DocumentDataHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.DocumentDataHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.DocumentDataHistoryConnection) + fc.Result = res + return ec.marshalNDocumentDataHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_documentDataHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_DocumentDataHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_DocumentDataHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_DocumentDataHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentDataHistoryConnection", 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_documentDataHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlements(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlements(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Entitlements(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EntitlementWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementConnection) + fc.Result = res + return ec.marshalNEntitlementConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlements(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntitlementConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntitlementConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntitlementConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementConnection", 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_entitlements_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlementHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlementHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntitlementHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EntitlementHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementHistoryConnection) + fc.Result = res + return ec.marshalNEntitlementHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlementHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntitlementHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntitlementHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntitlementHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementHistoryConnection", 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_entitlementHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlementPlans(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlementPlans(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntitlementPlans(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EntitlementPlanWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanConnection) + fc.Result = res + return ec.marshalNEntitlementPlanConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlementPlans(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntitlementPlanConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntitlementPlanConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntitlementPlanConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanConnection", 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_entitlementPlans_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlementPlanFeatures(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlementPlanFeatures(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntitlementPlanFeatures(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EntitlementPlanFeatureWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanFeatureConnection) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlementPlanFeatures(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntitlementPlanFeatureConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntitlementPlanFeatureConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntitlementPlanFeatureConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureConnection", 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_entitlementPlanFeatures_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlementPlanFeatureHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlementPlanFeatureHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntitlementPlanFeatureHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EntitlementPlanFeatureHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanFeatureHistoryConnection) + fc.Result = res + return ec.marshalNEntitlementPlanFeatureHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlementPlanFeatureHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntitlementPlanFeatureHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntitlementPlanFeatureHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntitlementPlanFeatureHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeatureHistoryConnection", 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_entitlementPlanFeatureHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlementPlanHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlementPlanHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntitlementPlanHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EntitlementPlanHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanHistoryConnection) + fc.Result = res + return ec.marshalNEntitlementPlanHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlementPlanHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntitlementPlanHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntitlementPlanHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntitlementPlanHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanHistoryConnection", 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_entitlementPlanHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Entities(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.EntityOrder), fc.Args["where"].(*generated.EntityWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntityConnection) + fc.Result = res + return ec.marshalNEntityConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntityConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntityConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntityConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityConnection", 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_entities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entityHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entityHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntityHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.EntityHistoryOrder), fc.Args["where"].(*generated.EntityHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntityHistoryConnection) + fc.Result = res + return ec.marshalNEntityHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entityHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntityHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntityHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntityHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityHistoryConnection", 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_entityHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entityTypes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entityTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntityTypes(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.EntityTypeOrder), fc.Args["where"].(*generated.EntityTypeWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntityTypeConnection) + fc.Result = res + return ec.marshalNEntityTypeConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entityTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntityTypeConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntityTypeConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntityTypeConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeConnection", 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_entityTypes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entityTypeHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entityTypeHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntityTypeHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.EntityTypeHistoryOrder), fc.Args["where"].(*generated.EntityTypeHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntityTypeHistoryConnection) + fc.Result = res + return ec.marshalNEntityTypeHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entityTypeHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EntityTypeHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EntityTypeHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EntityTypeHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityTypeHistoryConnection", 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_entityTypeHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_events(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_events(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Events(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EventWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EventConnection) + fc.Result = res + return ec.marshalNEventConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_events(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EventConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EventConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EventConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventConnection", 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_events_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_eventHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_eventHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EventHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.EventHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EventHistoryConnection) + fc.Result = res + return ec.marshalNEventHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_eventHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_EventHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EventHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EventHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EventHistoryConnection", 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_eventHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_features(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_features(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Features(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.FeatureWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.FeatureConnection) + fc.Result = res + return ec.marshalNFeatureConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_features(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_FeatureConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FeatureConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FeatureConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureConnection", 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_features_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_featureHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_featureHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().FeatureHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.FeatureHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.FeatureHistoryConnection) + fc.Result = res + return ec.marshalNFeatureHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_featureHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_FeatureHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FeatureHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FeatureHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FeatureHistoryConnection", 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_featureHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_files(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_files(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Files(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.FileWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.FileConnection) + fc.Result = res + return ec.marshalNFileConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_files(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_FileConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FileConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FileConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileConnection", 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_files_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_fileHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_fileHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().FileHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.FileHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.FileHistoryConnection) + fc.Result = res + return ec.marshalNFileHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_fileHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_FileHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_FileHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_FileHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FileHistoryConnection", 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_fileHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groups(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Groups(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.GroupOrder), fc.Args["where"].(*generated.GroupWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupConnection) + fc.Result = res + return ec.marshalNGroupConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_GroupConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupConnection", 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_groups_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groupHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groupHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GroupHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.GroupHistoryOrder), fc.Args["where"].(*generated.GroupHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupHistoryConnection) + fc.Result = res + return ec.marshalNGroupHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groupHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_GroupHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupHistoryConnection", 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_groupHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groupMemberships(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groupMemberships(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GroupMemberships(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.GroupMembershipWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupMembershipConnection) + fc.Result = res + return ec.marshalNGroupMembershipConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groupMemberships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_GroupMembershipConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupMembershipConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupMembershipConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipConnection", 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_groupMemberships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groupMembershipHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groupMembershipHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GroupMembershipHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.GroupMembershipHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupMembershipHistoryConnection) + fc.Result = res + return ec.marshalNGroupMembershipHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groupMembershipHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_GroupMembershipHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupMembershipHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupMembershipHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembershipHistoryConnection", 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_groupMembershipHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groupSettings(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groupSettings(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GroupSettings(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.GroupSettingWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupSettingConnection) + fc.Result = res + return ec.marshalNGroupSettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groupSettings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_GroupSettingConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupSettingConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupSettingConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingConnection", 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_groupSettings_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groupSettingHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groupSettingHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GroupSettingHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.GroupSettingHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupSettingHistoryConnection) + fc.Result = res + return ec.marshalNGroupSettingHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groupSettingHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_GroupSettingHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_GroupSettingHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_GroupSettingHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSettingHistoryConnection", 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_groupSettingHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_hushes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_hushes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Hushes(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.HushOrder), fc.Args["where"].(*generated.HushWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.HushConnection) + fc.Result = res + return ec.marshalNHushConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_hushes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_HushConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_HushConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_HushConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushConnection", 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_hushes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_hushHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_hushHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().HushHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.HushHistoryOrder), fc.Args["where"].(*generated.HushHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.HushHistoryConnection) + fc.Result = res + return ec.marshalNHushHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_hushHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_HushHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_HushHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_HushHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type HushHistoryConnection", 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_hushHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_integrations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_integrations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Integrations(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.IntegrationOrder), fc.Args["where"].(*generated.IntegrationWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.IntegrationConnection) + fc.Result = res + return ec.marshalNIntegrationConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_integrations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_IntegrationConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_IntegrationConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_IntegrationConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationConnection", 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_integrations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_integrationHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_integrationHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().IntegrationHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.IntegrationHistoryOrder), fc.Args["where"].(*generated.IntegrationHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.IntegrationHistoryConnection) + fc.Result = res + return ec.marshalNIntegrationHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_integrationHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_IntegrationHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_IntegrationHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_IntegrationHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IntegrationHistoryConnection", 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_integrationHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_invites(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_invites(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Invites(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.InviteWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.InviteConnection) + fc.Result = res + return ec.marshalNInviteConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_invites(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_InviteConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_InviteConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_InviteConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InviteConnection", 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_invites_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_notes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_notes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Notes(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.NoteWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.NoteConnection) + fc.Result = res + return ec.marshalNNoteConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_notes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_NoteConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_NoteConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_NoteConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NoteConnection", 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_notes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_noteHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_noteHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().NoteHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.NoteHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.NoteHistoryConnection) + fc.Result = res + return ec.marshalNNoteHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_noteHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_NoteHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_NoteHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_NoteHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NoteHistoryConnection", 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_noteHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_oauthProviders(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oauthProviders(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OauthProviders(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.OauthProviderWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OauthProviderConnection) + fc.Result = res + return ec.marshalNOauthProviderConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_oauthProviders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OauthProviderConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OauthProviderConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OauthProviderConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderConnection", 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_oauthProviders_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_oauthProviderHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oauthProviderHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OauthProviderHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.OauthProviderHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OauthProviderHistoryConnection) + fc.Result = res + return ec.marshalNOauthProviderHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_oauthProviderHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OauthProviderHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OauthProviderHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OauthProviderHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProviderHistoryConnection", 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_oauthProviderHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_ohAuthTooTokens(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ohAuthTooTokens(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OhAuthTooTokens(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.OhAuthTooTokenWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OhAuthTooTokenConnection) + fc.Result = res + return ec.marshalNOhAuthTooTokenConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_ohAuthTooTokens(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OhAuthTooTokenConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OhAuthTooTokenConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OhAuthTooTokenConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooTokenConnection", 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_ohAuthTooTokens_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_orgMemberships(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_orgMemberships(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OrgMemberships(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.OrgMembershipWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrgMembershipConnection) + fc.Result = res + return ec.marshalNOrgMembershipConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_orgMemberships(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OrgMembershipConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OrgMembershipConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OrgMembershipConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipConnection", 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_orgMemberships_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_orgMembershipHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_orgMembershipHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OrgMembershipHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.OrgMembershipHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrgMembershipHistoryConnection) + fc.Result = res + return ec.marshalNOrgMembershipHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_orgMembershipHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OrgMembershipHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OrgMembershipHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OrgMembershipHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembershipHistoryConnection", 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_orgMembershipHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_organizations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_organizations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Organizations(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.OrganizationOrder), fc.Args["where"].(*generated.OrganizationWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationConnection) + fc.Result = res + return ec.marshalNOrganizationConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_organizations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OrganizationConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OrganizationConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OrganizationConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationConnection", 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_organizations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_organizationHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_organizationHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OrganizationHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.OrganizationHistoryOrder), fc.Args["where"].(*generated.OrganizationHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationHistoryConnection) + fc.Result = res + return ec.marshalNOrganizationHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_organizationHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OrganizationHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OrganizationHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OrganizationHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationHistoryConnection", 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_organizationHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_organizationSettings(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_organizationSettings(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OrganizationSettings(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.OrganizationSettingWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationSettingConnection) + fc.Result = res + return ec.marshalNOrganizationSettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_organizationSettings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OrganizationSettingConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OrganizationSettingConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OrganizationSettingConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingConnection", 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_organizationSettings_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_organizationSettingHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_organizationSettingHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OrganizationSettingHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.OrganizationSettingHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationSettingHistoryConnection) + fc.Result = res + return ec.marshalNOrganizationSettingHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_organizationSettingHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_OrganizationSettingHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_OrganizationSettingHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_OrganizationSettingHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingHistoryConnection", 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_organizationSettingHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_personalAccessTokens(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_personalAccessTokens(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().PersonalAccessTokens(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.PersonalAccessTokenWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.PersonalAccessTokenConnection) + fc.Result = res + return ec.marshalNPersonalAccessTokenConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_personalAccessTokens(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_PersonalAccessTokenConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_PersonalAccessTokenConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_PersonalAccessTokenConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessTokenConnection", 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_personalAccessTokens_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_subscribers(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_subscribers(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Subscribers(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.SubscriberWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.SubscriberConnection) + fc.Result = res + return ec.marshalNSubscriberConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_subscribers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_SubscriberConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_SubscriberConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_SubscriberConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubscriberConnection", 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_subscribers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_tfaSettings(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_tfaSettings(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().TfaSettings(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.TFASettingWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.TFASettingConnection) + fc.Result = res + return ec.marshalNTFASettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_tfaSettings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_TFASettingConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TFASettingConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TFASettingConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASettingConnection", 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_tfaSettings_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_templates(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_templates(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Templates(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.TemplateOrder), fc.Args["where"].(*generated.TemplateWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.TemplateConnection) + fc.Result = res + return ec.marshalNTemplateConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_templates(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_TemplateConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TemplateConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TemplateConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateConnection", 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_templates_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_templateHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_templateHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().TemplateHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.TemplateHistoryOrder), fc.Args["where"].(*generated.TemplateHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.TemplateHistoryConnection) + fc.Result = res + return ec.marshalNTemplateHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_templateHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_TemplateHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_TemplateHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_TemplateHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateHistoryConnection", 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_templateHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_users(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Users(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.UserOrder), fc.Args["where"].(*generated.UserWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.UserConnection) + fc.Result = res + return ec.marshalNUserConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_users(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_UserConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserConnection", 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_users_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_userHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_userHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().UserHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.UserHistoryOrder), fc.Args["where"].(*generated.UserHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.UserHistoryConnection) + fc.Result = res + return ec.marshalNUserHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_userHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_UserHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserHistoryConnection", 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_userHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_userSettings(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_userSettings(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().UserSettings(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.UserSettingWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.UserSettingConnection) + fc.Result = res + return ec.marshalNUserSettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_userSettings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_UserSettingConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserSettingConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserSettingConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingConnection", 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_userSettings_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_userSettingHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_userSettingHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().UserSettingHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*generated.UserSettingHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.UserSettingHistoryConnection) + fc.Result = res + return ec.marshalNUserSettingHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_userSettingHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_UserSettingHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_UserSettingHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_UserSettingHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingHistoryConnection", 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_userSettingHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_webhooks(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_webhooks(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Webhooks(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.WebhookOrder), fc.Args["where"].(*generated.WebhookWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.WebhookConnection) + fc.Result = res + return ec.marshalNWebhookConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_webhooks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_WebhookConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_WebhookConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_WebhookConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookConnection", 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_webhooks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_webhookHistories(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_webhookHistories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().WebhookHistories(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["orderBy"].(*generated.WebhookHistoryOrder), fc.Args["where"].(*generated.WebhookHistoryWhereInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.WebhookHistoryConnection) + fc.Result = res + return ec.marshalNWebhookHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_webhookHistories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_WebhookHistoryConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_WebhookHistoryConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_WebhookHistoryConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookHistoryConnection", 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_webhookHistories_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_apiToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_apiToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().APIToken(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.APIToken) + fc.Result = res + return ec.marshalNAPIToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_apiToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_APIToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_APIToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_APIToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_APIToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_APIToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_APIToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_APIToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_APIToken_tags(ctx, field) + case "ownerID": + return ec.fieldContext_APIToken_ownerID(ctx, field) + case "name": + return ec.fieldContext_APIToken_name(ctx, field) + case "token": + return ec.fieldContext_APIToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_APIToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_APIToken_description(ctx, field) + case "scopes": + return ec.fieldContext_APIToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_APIToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_APIToken_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type APIToken", 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_apiToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_auditLogs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_auditLogs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().AuditLogs(rctx, fc.Args["after"].(*entgql.Cursor[string]), fc.Args["first"].(*int), fc.Args["before"].(*entgql.Cursor[string]), fc.Args["last"].(*int), fc.Args["where"].(*AuditLogWhereInput)) + }) + 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.(*AuditLogConnection) + fc.Result = res + return ec.marshalNAuditLogConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_auditLogs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "edges": + return ec.fieldContext_AuditLogConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_AuditLogConnection_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_AuditLogConnection_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AuditLogConnection", 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_auditLogs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_contact(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_contact(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Contact(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Contact) + fc.Result = res + return ec.marshalNContact2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_contact(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Contact_id(ctx, field) + case "createdAt": + return ec.fieldContext_Contact_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Contact_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Contact_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Contact_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Contact_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Contact_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Contact_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Contact_ownerID(ctx, field) + case "fullName": + return ec.fieldContext_Contact_fullName(ctx, field) + case "title": + return ec.fieldContext_Contact_title(ctx, field) + case "company": + return ec.fieldContext_Contact_company(ctx, field) + case "email": + return ec.fieldContext_Contact_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Contact_phoneNumber(ctx, field) + case "address": + return ec.fieldContext_Contact_address(ctx, field) + case "status": + return ec.fieldContext_Contact_status(ctx, field) + case "owner": + return ec.fieldContext_Contact_owner(ctx, field) + case "entities": + return ec.fieldContext_Contact_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Contact", 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_contact_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_documentData(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_documentData(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().DocumentData(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.DocumentData) + fc.Result = res + return ec.marshalNDocumentData2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_documentData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", 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_documentData_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlement(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlement(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Entitlement(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Entitlement) + fc.Result = res + return ec.marshalNEntitlement2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Entitlement_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entitlement_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entitlement_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entitlement_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entitlement_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Entitlement_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Entitlement_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entitlement_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Entitlement_ownerID(ctx, field) + case "planID": + return ec.fieldContext_Entitlement_planID(ctx, field) + case "organizationID": + return ec.fieldContext_Entitlement_organizationID(ctx, field) + case "externalCustomerID": + return ec.fieldContext_Entitlement_externalCustomerID(ctx, field) + case "externalSubscriptionID": + return ec.fieldContext_Entitlement_externalSubscriptionID(ctx, field) + case "expires": + return ec.fieldContext_Entitlement_expires(ctx, field) + case "expiresAt": + return ec.fieldContext_Entitlement_expiresAt(ctx, field) + case "cancelled": + return ec.fieldContext_Entitlement_cancelled(ctx, field) + case "owner": + return ec.fieldContext_Entitlement_owner(ctx, field) + case "plan": + return ec.fieldContext_Entitlement_plan(ctx, field) + case "organization": + return ec.fieldContext_Entitlement_organization(ctx, field) + case "events": + return ec.fieldContext_Entitlement_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entitlement", 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_entitlement_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlementPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlementPlan(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntitlementPlan(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlan) + fc.Result = res + return ec.marshalNEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlementPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_EntitlementPlan_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlan_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlan_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlan_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlan_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlan_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlan_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlan_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlan_ownerID(ctx, field) + case "displayName": + return ec.fieldContext_EntitlementPlan_displayName(ctx, field) + case "name": + return ec.fieldContext_EntitlementPlan_name(ctx, field) + case "description": + return ec.fieldContext_EntitlementPlan_description(ctx, field) + case "version": + return ec.fieldContext_EntitlementPlan_version(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlan_metadata(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlan_owner(ctx, field) + case "entitlements": + return ec.fieldContext_EntitlementPlan_entitlements(ctx, field) + case "baseFeatures": + return ec.fieldContext_EntitlementPlan_baseFeatures(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlan_events(ctx, field) + case "features": + return ec.fieldContext_EntitlementPlan_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlan", 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_entitlementPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entitlementPlanFeature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntitlementPlanFeature(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntitlementPlanFeature) + fc.Result = res + return ec.marshalNEntitlementPlanFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entitlementPlanFeature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_EntitlementPlanFeature_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntitlementPlanFeature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntitlementPlanFeature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntitlementPlanFeature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntitlementPlanFeature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntitlementPlanFeature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntitlementPlanFeature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntitlementPlanFeature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntitlementPlanFeature_ownerID(ctx, field) + case "metadata": + return ec.fieldContext_EntitlementPlanFeature_metadata(ctx, field) + case "planID": + return ec.fieldContext_EntitlementPlanFeature_planID(ctx, field) + case "featureID": + return ec.fieldContext_EntitlementPlanFeature_featureID(ctx, field) + case "owner": + return ec.fieldContext_EntitlementPlanFeature_owner(ctx, field) + case "plan": + return ec.fieldContext_EntitlementPlanFeature_plan(ctx, field) + case "feature": + return ec.fieldContext_EntitlementPlanFeature_feature(ctx, field) + case "events": + return ec.fieldContext_EntitlementPlanFeature_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntitlementPlanFeature", 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_entitlementPlanFeature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entity(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Entity(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Entity) + fc.Result = res + return ec.marshalNEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Entity_id(ctx, field) + case "createdAt": + return ec.fieldContext_Entity_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Entity_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Entity_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Entity_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Entity_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Entity_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Entity_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Entity_ownerID(ctx, field) + case "name": + return ec.fieldContext_Entity_name(ctx, field) + case "displayName": + return ec.fieldContext_Entity_displayName(ctx, field) + case "description": + return ec.fieldContext_Entity_description(ctx, field) + case "domains": + return ec.fieldContext_Entity_domains(ctx, field) + case "entityTypeID": + return ec.fieldContext_Entity_entityTypeID(ctx, field) + case "status": + return ec.fieldContext_Entity_status(ctx, field) + case "owner": + return ec.fieldContext_Entity_owner(ctx, field) + case "contacts": + return ec.fieldContext_Entity_contacts(ctx, field) + case "documents": + return ec.fieldContext_Entity_documents(ctx, field) + case "notes": + return ec.fieldContext_Entity_notes(ctx, field) + case "files": + return ec.fieldContext_Entity_files(ctx, field) + case "entityType": + return ec.fieldContext_Entity_entityType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Entity", 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_entity_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_entityType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_entityType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().EntityType(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.EntityType) + fc.Result = res + return ec.marshalNEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_entityType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_EntityType_id(ctx, field) + case "createdAt": + return ec.fieldContext_EntityType_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_EntityType_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_EntityType_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_EntityType_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_EntityType_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_EntityType_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_EntityType_tags(ctx, field) + case "ownerID": + return ec.fieldContext_EntityType_ownerID(ctx, field) + case "name": + return ec.fieldContext_EntityType_name(ctx, field) + case "owner": + return ec.fieldContext_EntityType_owner(ctx, field) + case "entities": + return ec.fieldContext_EntityType_entities(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EntityType", 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_entityType_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_event(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_event(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Event(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Event) + fc.Result = res + return ec.marshalNEvent2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_event(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", 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_event_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_feature(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_feature(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Feature(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Feature) + fc.Result = res + return ec.marshalNFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_feature(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Feature_id(ctx, field) + case "createdAt": + return ec.fieldContext_Feature_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Feature_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Feature_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Feature_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Feature_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Feature_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Feature_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Feature_ownerID(ctx, field) + case "name": + return ec.fieldContext_Feature_name(ctx, field) + case "displayName": + return ec.fieldContext_Feature_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Feature_enabled(ctx, field) + case "description": + return ec.fieldContext_Feature_description(ctx, field) + case "metadata": + return ec.fieldContext_Feature_metadata(ctx, field) + case "owner": + return ec.fieldContext_Feature_owner(ctx, field) + case "plans": + return ec.fieldContext_Feature_plans(ctx, field) + case "events": + return ec.fieldContext_Feature_events(ctx, field) + case "features": + return ec.fieldContext_Feature_features(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Feature", 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_feature_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_file(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_file(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().File(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.File) + fc.Result = res + return ec.marshalNFile2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_file(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", 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_file_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_group(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_group(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Group(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Group) + fc.Result = res + return ec.marshalNGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", 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_group_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groupMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groupMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GroupMembership(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupMembership) + fc.Result = res + return ec.marshalNGroupMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groupMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", 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_groupMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_groupSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_groupSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GroupSetting(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.GroupSetting) + fc.Result = res + return ec.marshalNGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_groupSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_GroupSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_GroupSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupSetting_deletedBy(ctx, field) + case "visibility": + return ec.fieldContext_GroupSetting_visibility(ctx, field) + case "joinPolicy": + return ec.fieldContext_GroupSetting_joinPolicy(ctx, field) + case "syncToSlack": + return ec.fieldContext_GroupSetting_syncToSlack(ctx, field) + case "syncToGithub": + return ec.fieldContext_GroupSetting_syncToGithub(ctx, field) + case "groupID": + return ec.fieldContext_GroupSetting_groupID(ctx, field) + case "group": + return ec.fieldContext_GroupSetting_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupSetting", 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_groupSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_hush(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_hush(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Hush(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Hush) + fc.Result = res + return ec.marshalNHush2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_hush(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Hush_id(ctx, field) + case "createdAt": + return ec.fieldContext_Hush_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Hush_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Hush_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Hush_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Hush_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Hush_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Hush_name(ctx, field) + case "description": + return ec.fieldContext_Hush_description(ctx, field) + case "kind": + return ec.fieldContext_Hush_kind(ctx, field) + case "secretName": + return ec.fieldContext_Hush_secretName(ctx, field) + case "integrations": + return ec.fieldContext_Hush_integrations(ctx, field) + case "organization": + return ec.fieldContext_Hush_organization(ctx, field) + case "events": + return ec.fieldContext_Hush_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Hush", 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_hush_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_integration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_integration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Integration(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Integration) + fc.Result = res + return ec.marshalNIntegration2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_integration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", 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_integration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_invite(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_invite(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Invite(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Invite) + fc.Result = res + return ec.marshalNInvite2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_invite(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Invite_id(ctx, field) + case "createdAt": + return ec.fieldContext_Invite_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Invite_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Invite_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Invite_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Invite_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Invite_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Invite_ownerID(ctx, field) + case "expires": + return ec.fieldContext_Invite_expires(ctx, field) + case "recipient": + return ec.fieldContext_Invite_recipient(ctx, field) + case "status": + return ec.fieldContext_Invite_status(ctx, field) + case "role": + return ec.fieldContext_Invite_role(ctx, field) + case "sendAttempts": + return ec.fieldContext_Invite_sendAttempts(ctx, field) + case "requestorID": + return ec.fieldContext_Invite_requestorID(ctx, field) + case "owner": + return ec.fieldContext_Invite_owner(ctx, field) + case "events": + return ec.fieldContext_Invite_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invite", 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_invite_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_oauthProvider(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_oauthProvider(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OauthProvider(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OauthProvider) + fc.Result = res + return ec.marshalNOauthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_oauthProvider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_OauthProvider_id(ctx, field) + case "createdAt": + return ec.fieldContext_OauthProvider_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OauthProvider_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OauthProvider_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OauthProvider_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OauthProvider_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OauthProvider_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OauthProvider_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_OauthProvider_ownerID(ctx, field) + case "name": + return ec.fieldContext_OauthProvider_name(ctx, field) + case "clientID": + return ec.fieldContext_OauthProvider_clientID(ctx, field) + case "clientSecret": + return ec.fieldContext_OauthProvider_clientSecret(ctx, field) + case "redirectURL": + return ec.fieldContext_OauthProvider_redirectURL(ctx, field) + case "scopes": + return ec.fieldContext_OauthProvider_scopes(ctx, field) + case "authURL": + return ec.fieldContext_OauthProvider_authURL(ctx, field) + case "tokenURL": + return ec.fieldContext_OauthProvider_tokenURL(ctx, field) + case "authStyle": + return ec.fieldContext_OauthProvider_authStyle(ctx, field) + case "infoURL": + return ec.fieldContext_OauthProvider_infoURL(ctx, field) + case "owner": + return ec.fieldContext_OauthProvider_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OauthProvider", 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_oauthProvider_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_ohAuthTooToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ohAuthTooToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OhAuthTooToken(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OhAuthTooToken) + fc.Result = res + return ec.marshalNOhAuthTooToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_ohAuthTooToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_OhAuthTooToken_id(ctx, field) + case "tags": + return ec.fieldContext_OhAuthTooToken_tags(ctx, field) + case "clientID": + return ec.fieldContext_OhAuthTooToken_clientID(ctx, field) + case "scopes": + return ec.fieldContext_OhAuthTooToken_scopes(ctx, field) + case "nonce": + return ec.fieldContext_OhAuthTooToken_nonce(ctx, field) + case "claimsUserID": + return ec.fieldContext_OhAuthTooToken_claimsUserID(ctx, field) + case "claimsUsername": + return ec.fieldContext_OhAuthTooToken_claimsUsername(ctx, field) + case "claimsEmail": + return ec.fieldContext_OhAuthTooToken_claimsEmail(ctx, field) + case "claimsEmailVerified": + return ec.fieldContext_OhAuthTooToken_claimsEmailVerified(ctx, field) + case "claimsGroups": + return ec.fieldContext_OhAuthTooToken_claimsGroups(ctx, field) + case "claimsPreferredUsername": + return ec.fieldContext_OhAuthTooToken_claimsPreferredUsername(ctx, field) + case "connectorID": + return ec.fieldContext_OhAuthTooToken_connectorID(ctx, field) + case "connectorData": + return ec.fieldContext_OhAuthTooToken_connectorData(ctx, field) + case "lastUsed": + return ec.fieldContext_OhAuthTooToken_lastUsed(ctx, field) + case "integration": + return ec.fieldContext_OhAuthTooToken_integration(ctx, field) + case "events": + return ec.fieldContext_OhAuthTooToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OhAuthTooToken", 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_ohAuthTooToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_organization(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_organization(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Organization(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalNOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_organization(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", 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_organization_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_organizationSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_organizationSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OrganizationSetting(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrganizationSetting) + fc.Result = res + return ec.marshalNOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_organizationSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_OrganizationSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrganizationSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrganizationSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrganizationSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrganizationSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_OrganizationSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_OrganizationSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrganizationSetting_deletedBy(ctx, field) + case "domains": + return ec.fieldContext_OrganizationSetting_domains(ctx, field) + case "billingContact": + return ec.fieldContext_OrganizationSetting_billingContact(ctx, field) + case "billingEmail": + return ec.fieldContext_OrganizationSetting_billingEmail(ctx, field) + case "billingPhone": + return ec.fieldContext_OrganizationSetting_billingPhone(ctx, field) + case "billingAddress": + return ec.fieldContext_OrganizationSetting_billingAddress(ctx, field) + case "taxIdentifier": + return ec.fieldContext_OrganizationSetting_taxIdentifier(ctx, field) + case "geoLocation": + return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) + case "organizationID": + return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) + case "organization": + return ec.fieldContext_OrganizationSetting_organization(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrganizationSetting", 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_organizationSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_orgMembership(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_orgMembership(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().OrgMembership(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.OrgMembership) + fc.Result = res + return ec.marshalNOrgMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_orgMembership(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", 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_orgMembership_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_personalAccessToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_personalAccessToken(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().PersonalAccessToken(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalNPersonalAccessToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_personalAccessToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", 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_personalAccessToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_search(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Search(rctx, fc.Args["query"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*GlobalSearchResultConnection) + fc.Result = res + return ec.marshalOGlobalSearchResultConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGlobalSearchResultConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_search(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "page": + return ec.fieldContext_GlobalSearchResultConnection_page(ctx, field) + case "nodes": + return ec.fieldContext_GlobalSearchResultConnection_nodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GlobalSearchResultConnection", 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_search_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_subscriber(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_subscriber(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Subscriber(rctx, fc.Args["email"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Subscriber) + fc.Result = res + return ec.marshalNSubscriber2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_subscriber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", 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_subscriber_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_template(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_template(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Template(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Template) + fc.Result = res + return ec.marshalNTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_template(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Template_id(ctx, field) + case "createdAt": + return ec.fieldContext_Template_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Template_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Template_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Template_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Template_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Template_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Template_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Template_ownerID(ctx, field) + case "name": + return ec.fieldContext_Template_name(ctx, field) + case "templateType": + return ec.fieldContext_Template_templateType(ctx, field) + case "description": + return ec.fieldContext_Template_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_Template_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_Template_uischema(ctx, field) + case "owner": + return ec.fieldContext_Template_owner(ctx, field) + case "documents": + return ec.fieldContext_Template_documents(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Template", 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_template_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_tfaSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_tfaSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().TfaSetting(rctx, fc.Args["id"].(*string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.TFASetting) + fc.Result = res + return ec.marshalNTFASetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_tfaSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_TFASetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_TFASetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_TFASetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_TFASetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_TFASetting_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_TFASetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_TFASetting_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_TFASetting_tags(ctx, field) + case "tfaSecret": + return ec.fieldContext_TFASetting_tfaSecret(ctx, field) + case "verified": + return ec.fieldContext_TFASetting_verified(ctx, field) + case "recoveryCodes": + return ec.fieldContext_TFASetting_recoveryCodes(ctx, field) + case "totpAllowed": + return ec.fieldContext_TFASetting_totpAllowed(ctx, field) + case "owner": + return ec.fieldContext_TFASetting_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASetting", 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_tfaSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_user(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().User(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.User) + fc.Result = res + return ec.marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", 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_user_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_userSetting(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_userSetting(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().UserSetting(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.UserSetting) + fc.Result = res + return ec.marshalNUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_userSetting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_UserSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_UserSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_UserSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_UserSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserSetting_deletedBy(ctx, field) + case "userID": + return ec.fieldContext_UserSetting_userID(ctx, field) + case "locked": + return ec.fieldContext_UserSetting_locked(ctx, field) + case "silencedAt": + return ec.fieldContext_UserSetting_silencedAt(ctx, field) + case "suspendedAt": + return ec.fieldContext_UserSetting_suspendedAt(ctx, field) + case "status": + return ec.fieldContext_UserSetting_status(ctx, field) + case "emailConfirmed": + return ec.fieldContext_UserSetting_emailConfirmed(ctx, field) + case "isWebauthnAllowed": + return ec.fieldContext_UserSetting_isWebauthnAllowed(ctx, field) + case "isTfaEnabled": + return ec.fieldContext_UserSetting_isTfaEnabled(ctx, field) + case "user": + return ec.fieldContext_UserSetting_user(ctx, field) + case "defaultOrg": + return ec.fieldContext_UserSetting_defaultOrg(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSetting", 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_userSetting_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_webhook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_webhook(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Webhook(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Webhook) + fc.Result = res + return ec.marshalNWebhook2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_webhook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", 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_webhook_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) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + 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_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + 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) + }, + } + 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) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + 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 fc, nil +} + +func (ec *executionContext) _Subscriber_id(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscriber_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscriber_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscriber_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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) _Subscriber_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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) _Subscriber_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_tags(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.Tags, 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_Subscriber_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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) _Subscriber_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscriber_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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) _Subscriber_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscriber_email(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_email(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.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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) _Subscriber_phoneNumber(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_phoneNumber(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.PhoneNumber, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_phoneNumber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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) _Subscriber_verifiedEmail(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_verifiedEmail(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.VerifiedEmail, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_verifiedEmail(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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 fc, nil +} + +func (ec *executionContext) _Subscriber_verifiedPhone(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_verifiedPhone(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.VerifiedPhone, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_verifiedPhone(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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 fc, nil +} + +func (ec *executionContext) _Subscriber_active(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_active(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.Active, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_active(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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 fc, nil +} + +func (ec *executionContext) _Subscriber_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Subscriber_events(ctx context.Context, field graphql.CollectedField, obj *generated.Subscriber) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Subscriber_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Subscriber_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscriber", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SubscriberBulkCreatePayload_subscribers(ctx context.Context, field graphql.CollectedField, obj *SubscriberBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberBulkCreatePayload_subscribers(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.Subscribers, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Subscriber) + fc.Result = res + return ec.marshalOSubscriber2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberBulkCreatePayload_subscribers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberBulkCreatePayload", + 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_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SubscriberConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.SubscriberConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.SubscriberEdge) + fc.Result = res + return ec.marshalOSubscriberEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_SubscriberEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_SubscriberEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SubscriberEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SubscriberConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.SubscriberConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SubscriberConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.SubscriberConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberConnection", + 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 fc, nil +} + +func (ec *executionContext) _SubscriberCreatePayload_subscriber(ctx context.Context, field graphql.CollectedField, obj *SubscriberCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberCreatePayload_subscriber(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.Subscriber, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Subscriber) + fc.Result = res + return ec.marshalNSubscriber2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberCreatePayload_subscriber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberCreatePayload", + 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_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SubscriberDeletePayload_email(ctx context.Context, field graphql.CollectedField, obj *SubscriberDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberDeletePayload_email(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.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberDeletePayload_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberDeletePayload", + 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) _SubscriberEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.SubscriberEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Subscriber) + fc.Result = res + return ec.marshalOSubscriber2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberEdge", + 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_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SubscriberEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.SubscriberEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberEdge", + 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 fc, nil +} + +func (ec *executionContext) _SubscriberSearchResult_subscribers(ctx context.Context, field graphql.CollectedField, obj *SubscriberSearchResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberSearchResult_subscribers(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.Subscribers, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Subscriber) + fc.Result = res + return ec.marshalOSubscriber2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberSearchResult_subscribers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberSearchResult", + 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_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SubscriberUpdatePayload_subscriber(ctx context.Context, field graphql.CollectedField, obj *SubscriberUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SubscriberUpdatePayload_subscriber(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.Subscriber, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Subscriber) + fc.Result = res + return ec.marshalNSubscriber2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SubscriberUpdatePayload_subscriber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SubscriberUpdatePayload", + 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_Subscriber_id(ctx, field) + case "createdAt": + return ec.fieldContext_Subscriber_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Subscriber_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Subscriber_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Subscriber_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Subscriber_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Subscriber_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Subscriber_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Subscriber_ownerID(ctx, field) + case "email": + return ec.fieldContext_Subscriber_email(ctx, field) + case "phoneNumber": + return ec.fieldContext_Subscriber_phoneNumber(ctx, field) + case "verifiedEmail": + return ec.fieldContext_Subscriber_verifiedEmail(ctx, field) + case "verifiedPhone": + return ec.fieldContext_Subscriber_verifiedPhone(ctx, field) + case "active": + return ec.fieldContext_Subscriber_active(ctx, field) + case "owner": + return ec.fieldContext_Subscriber_owner(ctx, field) + case "events": + return ec.fieldContext_Subscriber_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Subscriber", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASetting_id(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASetting_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASetting_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASetting_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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) _TFASetting_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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) _TFASetting_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASetting_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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) _TFASetting_tags(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_tags(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.Tags, 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_TFASetting_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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) _TFASetting_tfaSecret(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_tfaSecret(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.TfaSecret, 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_TFASetting_tfaSecret(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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) _TFASetting_verified(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_verified(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.Verified, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_verified(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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 fc, nil +} + +func (ec *executionContext) _TFASetting_recoveryCodes(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_recoveryCodes(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.RecoveryCodes, 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_TFASetting_recoveryCodes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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) _TFASetting_totpAllowed(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_totpAllowed(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.TotpAllowed, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_totpAllowed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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 fc, nil +} + +func (ec *executionContext) _TFASetting_owner(ctx context.Context, field graphql.CollectedField, obj *generated.TFASetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASetting_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.User) + fc.Result = res + return ec.marshalOUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASetting_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASetting", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASettingConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.TFASettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASettingConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.TFASettingEdge) + fc.Result = res + return ec.marshalOTFASettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASettingConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_TFASettingEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_TFASettingEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASettingEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASettingConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.TFASettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASettingConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASettingConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASettingConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.TFASettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASettingConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASettingConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASettingConnection", + 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 fc, nil +} + +func (ec *executionContext) _TFASettingCreatePayload_tfaSetting(ctx context.Context, field graphql.CollectedField, obj *TFASettingCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASettingCreatePayload_tfaSetting(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.TfaSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.TFASetting) + fc.Result = res + return ec.marshalNTFASetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASettingCreatePayload_tfaSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASettingCreatePayload", + 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_TFASetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_TFASetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_TFASetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_TFASetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_TFASetting_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_TFASetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_TFASetting_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_TFASetting_tags(ctx, field) + case "tfaSecret": + return ec.fieldContext_TFASetting_tfaSecret(ctx, field) + case "verified": + return ec.fieldContext_TFASetting_verified(ctx, field) + case "recoveryCodes": + return ec.fieldContext_TFASetting_recoveryCodes(ctx, field) + case "totpAllowed": + return ec.fieldContext_TFASetting_totpAllowed(ctx, field) + case "owner": + return ec.fieldContext_TFASetting_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASettingEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.TFASettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASettingEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.TFASetting) + fc.Result = res + return ec.marshalOTFASetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASettingEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASettingEdge", + 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_TFASetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_TFASetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_TFASetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_TFASetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_TFASetting_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_TFASetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_TFASetting_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_TFASetting_tags(ctx, field) + case "tfaSecret": + return ec.fieldContext_TFASetting_tfaSecret(ctx, field) + case "verified": + return ec.fieldContext_TFASetting_verified(ctx, field) + case "recoveryCodes": + return ec.fieldContext_TFASetting_recoveryCodes(ctx, field) + case "totpAllowed": + return ec.fieldContext_TFASetting_totpAllowed(ctx, field) + case "owner": + return ec.fieldContext_TFASetting_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TFASettingEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.TFASettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASettingEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASettingEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASettingEdge", + 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 fc, nil +} + +func (ec *executionContext) _TFASettingUpdatePayload_tfaSetting(ctx context.Context, field graphql.CollectedField, obj *TFASettingUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TFASettingUpdatePayload_tfaSetting(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.TfaSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.TFASetting) + fc.Result = res + return ec.marshalNTFASetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TFASettingUpdatePayload_tfaSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TFASettingUpdatePayload", + 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_TFASetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_TFASetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_TFASetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_TFASetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_TFASetting_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_TFASetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_TFASetting_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_TFASetting_tags(ctx, field) + case "tfaSecret": + return ec.fieldContext_TFASetting_tfaSecret(ctx, field) + case "verified": + return ec.fieldContext_TFASetting_verified(ctx, field) + case "recoveryCodes": + return ec.fieldContext_TFASetting_recoveryCodes(ctx, field) + case "totpAllowed": + return ec.fieldContext_TFASetting_totpAllowed(ctx, field) + case "owner": + return ec.fieldContext_TFASetting_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_id(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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) _Template_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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) _Template_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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) _Template_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_tags(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.Tags, 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_Template_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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) _Template_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_name(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_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 { + 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_Template_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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) _Template_templateType(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_templateType(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.TemplateType, 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.(enums.DocumentType) + fc.Result = res + return ec.marshalNTemplateDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_templateType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type TemplateDocumentType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_description(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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) _Template_jsonconfig(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_jsonconfig(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.Jsonconfig, 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.(customtypes.JSONObject) + fc.Result = res + return ec.marshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_jsonconfig(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type JSON does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_uischema(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_uischema(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.Uischema, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(customtypes.JSONObject) + fc.Result = res + return ec.marshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_uischema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type JSON does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Template_documents(ctx context.Context, field graphql.CollectedField, obj *generated.Template) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Template_documents(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.Documents(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.DocumentData) + fc.Result = res + return ec.marshalODocumentData2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Template_documents(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Template", + 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_DocumentData_id(ctx, field) + case "createdAt": + return ec.fieldContext_DocumentData_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_DocumentData_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_DocumentData_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_DocumentData_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_DocumentData_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_DocumentData_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_DocumentData_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_DocumentData_ownerID(ctx, field) + case "templateID": + return ec.fieldContext_DocumentData_templateID(ctx, field) + case "data": + return ec.fieldContext_DocumentData_data(ctx, field) + case "owner": + return ec.fieldContext_DocumentData_owner(ctx, field) + case "template": + return ec.fieldContext_DocumentData_template(ctx, field) + case "entity": + return ec.fieldContext_DocumentData_entity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DocumentData", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateBulkCreatePayload_templates(ctx context.Context, field graphql.CollectedField, obj *TemplateBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateBulkCreatePayload_templates(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.Templates, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Template) + fc.Result = res + return ec.marshalOTemplate2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateBulkCreatePayload_templates(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateBulkCreatePayload", + 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_Template_id(ctx, field) + case "createdAt": + return ec.fieldContext_Template_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Template_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Template_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Template_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Template_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Template_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Template_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Template_ownerID(ctx, field) + case "name": + return ec.fieldContext_Template_name(ctx, field) + case "templateType": + return ec.fieldContext_Template_templateType(ctx, field) + case "description": + return ec.fieldContext_Template_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_Template_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_Template_uischema(ctx, field) + case "owner": + return ec.fieldContext_Template_owner(ctx, field) + case "documents": + return ec.fieldContext_Template_documents(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Template", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.TemplateEdge) + fc.Result = res + return ec.marshalOTemplateEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_TemplateEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_TemplateEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateConnection", + 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 fc, nil +} + +func (ec *executionContext) _TemplateCreatePayload_template(ctx context.Context, field graphql.CollectedField, obj *TemplateCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateCreatePayload_template(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.Template, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Template) + fc.Result = res + return ec.marshalNTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateCreatePayload_template(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateCreatePayload", + 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_Template_id(ctx, field) + case "createdAt": + return ec.fieldContext_Template_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Template_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Template_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Template_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Template_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Template_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Template_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Template_ownerID(ctx, field) + case "name": + return ec.fieldContext_Template_name(ctx, field) + case "templateType": + return ec.fieldContext_Template_templateType(ctx, field) + case "description": + return ec.fieldContext_Template_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_Template_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_Template_uischema(ctx, field) + case "owner": + return ec.fieldContext_Template_owner(ctx, field) + case "documents": + return ec.fieldContext_Template_documents(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Template", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *TemplateDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Template) + fc.Result = res + return ec.marshalOTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateEdge", + 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_Template_id(ctx, field) + case "createdAt": + return ec.fieldContext_Template_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Template_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Template_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Template_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Template_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Template_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Template_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Template_ownerID(ctx, field) + case "name": + return ec.fieldContext_Template_name(ctx, field) + case "templateType": + return ec.fieldContext_Template_templateType(ctx, field) + case "description": + return ec.fieldContext_Template_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_Template_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_Template_uischema(ctx, field) + case "owner": + return ec.fieldContext_Template_owner(ctx, field) + case "documents": + return ec.fieldContext_Template_documents(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Template", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateEdge", + 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 fc, nil +} + +func (ec *executionContext) _TemplateHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNTemplateHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type TemplateHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_tags(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.Tags, 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_TemplateHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_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 { + 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_TemplateHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_templateType(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_templateType(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.TemplateType, 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.(enums.DocumentType) + fc.Result = res + return ec.marshalNTemplateHistoryDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_templateType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type TemplateHistoryDocumentType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + 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) _TemplateHistory_jsonconfig(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_jsonconfig(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.Jsonconfig, 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.(customtypes.JSONObject) + fc.Result = res + return ec.marshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_jsonconfig(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type JSON does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistory_uischema(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistory_uischema(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.Uischema, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(customtypes.JSONObject) + fc.Result = res + return ec.marshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistory_uischema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type JSON does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.TemplateHistoryEdge) + fc.Result = res + return ec.marshalOTemplateHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_TemplateHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_TemplateHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _TemplateHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.TemplateHistory) + fc.Result = res + return ec.marshalOTemplateHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistoryEdge", + 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_TemplateHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_TemplateHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_TemplateHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_TemplateHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_TemplateHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_TemplateHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_TemplateHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_TemplateHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_TemplateHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_TemplateHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_TemplateHistory_tags(ctx, field) + case "ownerID": + return ec.fieldContext_TemplateHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_TemplateHistory_name(ctx, field) + case "templateType": + return ec.fieldContext_TemplateHistory_templateType(ctx, field) + case "description": + return ec.fieldContext_TemplateHistory_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_TemplateHistory_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_TemplateHistory_uischema(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TemplateHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TemplateHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.TemplateHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _TemplateUpdatePayload_template(ctx context.Context, field graphql.CollectedField, obj *TemplateUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TemplateUpdatePayload_template(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.Template, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Template) + fc.Result = res + return ec.marshalNTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TemplateUpdatePayload_template(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TemplateUpdatePayload", + 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_Template_id(ctx, field) + case "createdAt": + return ec.fieldContext_Template_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Template_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Template_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Template_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Template_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Template_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Template_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Template_ownerID(ctx, field) + case "name": + return ec.fieldContext_Template_name(ctx, field) + case "templateType": + return ec.fieldContext_Template_templateType(ctx, field) + case "description": + return ec.fieldContext_Template_description(ctx, field) + case "jsonconfig": + return ec.fieldContext_Template_jsonconfig(ctx, field) + case "uischema": + return ec.fieldContext_Template_uischema(ctx, field) + case "owner": + return ec.fieldContext_Template_owner(ctx, field) + case "documents": + return ec.fieldContext_Template_documents(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Template", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_tags(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_tags(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.Tags, 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_User_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_email(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_email(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.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_firstName(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_firstName(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.FirstName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_firstName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_lastName(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_lastName(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.LastName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_lastName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_avatarRemoteURL(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_avatarRemoteURL(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.AvatarRemoteURL, 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_User_avatarRemoteURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_avatarLocalFile(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_avatarLocalFile(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.AvatarLocalFile, 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_User_avatarLocalFile(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_avatarUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_avatarUpdatedAt(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.AvatarUpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_avatarUpdatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_lastSeen(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_lastSeen(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.LastSeen, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_lastSeen(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_sub(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_sub(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.Sub, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_sub(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_authProvider(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_authProvider(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.AuthProvider, 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.(enums.AuthProvider) + fc.Result = res + return ec.marshalNUserAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_authProvider(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserAuthProvider does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_role(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_role(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.Role, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(enums.Role) + fc.Result = res + return ec.marshalOUserRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserRole does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_personalAccessTokens(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_personalAccessTokens(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.PersonalAccessTokens(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.PersonalAccessToken) + fc.Result = res + return ec.marshalOPersonalAccessToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_personalAccessTokens(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_PersonalAccessToken_id(ctx, field) + case "createdAt": + return ec.fieldContext_PersonalAccessToken_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_PersonalAccessToken_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_PersonalAccessToken_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_PersonalAccessToken_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_PersonalAccessToken_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_PersonalAccessToken_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_PersonalAccessToken_tags(ctx, field) + case "name": + return ec.fieldContext_PersonalAccessToken_name(ctx, field) + case "token": + return ec.fieldContext_PersonalAccessToken_token(ctx, field) + case "expiresAt": + return ec.fieldContext_PersonalAccessToken_expiresAt(ctx, field) + case "description": + return ec.fieldContext_PersonalAccessToken_description(ctx, field) + case "scopes": + return ec.fieldContext_PersonalAccessToken_scopes(ctx, field) + case "lastUsedAt": + return ec.fieldContext_PersonalAccessToken_lastUsedAt(ctx, field) + case "owner": + return ec.fieldContext_PersonalAccessToken_owner(ctx, field) + case "organizations": + return ec.fieldContext_PersonalAccessToken_organizations(ctx, field) + case "events": + return ec.fieldContext_PersonalAccessToken_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PersonalAccessToken", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_tfaSettings(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_tfaSettings(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.TfaSettings(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.TFASetting) + fc.Result = res + return ec.marshalOTFASetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_tfaSettings(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_TFASetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_TFASetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_TFASetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_TFASetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_TFASetting_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_TFASetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_TFASetting_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_TFASetting_tags(ctx, field) + case "tfaSecret": + return ec.fieldContext_TFASetting_tfaSecret(ctx, field) + case "verified": + return ec.fieldContext_TFASetting_verified(ctx, field) + case "recoveryCodes": + return ec.fieldContext_TFASetting_recoveryCodes(ctx, field) + case "totpAllowed": + return ec.fieldContext_TFASetting_totpAllowed(ctx, field) + case "owner": + return ec.fieldContext_TFASetting_owner(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TFASetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_setting(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_setting(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.Setting(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.(*generated.UserSetting) + fc.Result = res + return ec.marshalNUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_setting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_UserSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_UserSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_UserSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_UserSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserSetting_deletedBy(ctx, field) + case "userID": + return ec.fieldContext_UserSetting_userID(ctx, field) + case "locked": + return ec.fieldContext_UserSetting_locked(ctx, field) + case "silencedAt": + return ec.fieldContext_UserSetting_silencedAt(ctx, field) + case "suspendedAt": + return ec.fieldContext_UserSetting_suspendedAt(ctx, field) + case "status": + return ec.fieldContext_UserSetting_status(ctx, field) + case "emailConfirmed": + return ec.fieldContext_UserSetting_emailConfirmed(ctx, field) + case "isWebauthnAllowed": + return ec.fieldContext_UserSetting_isWebauthnAllowed(ctx, field) + case "isTfaEnabled": + return ec.fieldContext_UserSetting_isTfaEnabled(ctx, field) + case "user": + return ec.fieldContext_UserSetting_user(ctx, field) + case "defaultOrg": + return ec.fieldContext_UserSetting_defaultOrg(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_groups(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_groups(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.Groups(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Group) + fc.Result = res + return ec.marshalOGroup2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_groups(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_Group_id(ctx, field) + case "createdAt": + return ec.fieldContext_Group_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Group_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Group_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Group_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_Group_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Group_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_Group_tags(ctx, field) + case "ownerID": + return ec.fieldContext_Group_ownerID(ctx, field) + case "name": + return ec.fieldContext_Group_name(ctx, field) + case "description": + return ec.fieldContext_Group_description(ctx, field) + case "gravatarLogoURL": + return ec.fieldContext_Group_gravatarLogoURL(ctx, field) + case "logoURL": + return ec.fieldContext_Group_logoURL(ctx, field) + case "displayName": + return ec.fieldContext_Group_displayName(ctx, field) + case "owner": + return ec.fieldContext_Group_owner(ctx, field) + case "setting": + return ec.fieldContext_Group_setting(ctx, field) + case "users": + return ec.fieldContext_Group_users(ctx, field) + case "events": + return ec.fieldContext_Group_events(ctx, field) + case "integrations": + return ec.fieldContext_Group_integrations(ctx, field) + case "files": + return ec.fieldContext_Group_files(ctx, field) + case "members": + return ec.fieldContext_Group_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_organizations(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_organizations(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.Organizations(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_organizations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_files(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_files(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.Files(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.File) + fc.Result = res + return ec.marshalOFile2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_File_id(ctx, field) + case "createdAt": + return ec.fieldContext_File_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_File_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_File_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_File_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_File_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_File_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_File_tags(ctx, field) + case "fileName": + return ec.fieldContext_File_fileName(ctx, field) + case "fileExtension": + return ec.fieldContext_File_fileExtension(ctx, field) + case "fileSize": + return ec.fieldContext_File_fileSize(ctx, field) + case "contentType": + return ec.fieldContext_File_contentType(ctx, field) + case "storeKey": + return ec.fieldContext_File_storeKey(ctx, field) + case "category": + return ec.fieldContext_File_category(ctx, field) + case "annotation": + return ec.fieldContext_File_annotation(ctx, field) + case "user": + return ec.fieldContext_File_user(ctx, field) + case "organization": + return ec.fieldContext_File_organization(ctx, field) + case "entity": + return ec.fieldContext_File_entity(ctx, field) + case "group": + return ec.fieldContext_File_group(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type File", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_events(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_groupMemberships(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_groupMemberships(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.GroupMemberships(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.GroupMembership) + fc.Result = res + return ec.marshalOGroupMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_groupMemberships(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_GroupMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_GroupMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_GroupMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_GroupMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_GroupMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_GroupMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_GroupMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_GroupMembership_role(ctx, field) + case "groupID": + return ec.fieldContext_GroupMembership_groupID(ctx, field) + case "userID": + return ec.fieldContext_GroupMembership_userID(ctx, field) + case "group": + return ec.fieldContext_GroupMembership_group(ctx, field) + case "user": + return ec.fieldContext_GroupMembership_user(ctx, field) + case "events": + return ec.fieldContext_GroupMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GroupMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _User_orgMemberships(ctx context.Context, field graphql.CollectedField, obj *generated.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_orgMemberships(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.OrgMemberships(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.OrgMembership) + fc.Result = res + return ec.marshalOOrgMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_orgMemberships(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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_OrgMembership_id(ctx, field) + case "createdAt": + return ec.fieldContext_OrgMembership_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_OrgMembership_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_OrgMembership_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_OrgMembership_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_OrgMembership_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_OrgMembership_deletedBy(ctx, field) + case "role": + return ec.fieldContext_OrgMembership_role(ctx, field) + case "organizationID": + return ec.fieldContext_OrgMembership_organizationID(ctx, field) + case "userID": + return ec.fieldContext_OrgMembership_userID(ctx, field) + case "organization": + return ec.fieldContext_OrgMembership_organization(ctx, field) + case "user": + return ec.fieldContext_OrgMembership_user(ctx, field) + case "events": + return ec.fieldContext_OrgMembership_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OrgMembership", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserBulkCreatePayload_users(ctx context.Context, field graphql.CollectedField, obj *UserBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBulkCreatePayload_users(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.Users, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.User) + fc.Result = res + return ec.marshalOUser2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBulkCreatePayload_users(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBulkCreatePayload", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.UserEdge) + fc.Result = res + return ec.marshalOUserEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_UserEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.UserConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserConnection", + 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 fc, nil +} + +func (ec *executionContext) _UserCreatePayload_user(ctx context.Context, field graphql.CollectedField, obj *UserCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserCreatePayload_user(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.User, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.User) + fc.Result = res + return ec.marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserCreatePayload_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserCreatePayload", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *UserDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.User) + fc.Result = res + return ec.marshalOUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserEdge", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.UserEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserEdge", + 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 fc, nil +} + +func (ec *executionContext) _UserHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNUserHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_tags(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.Tags, 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_UserHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_email(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_email(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.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_firstName(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_firstName(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.FirstName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_firstName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_lastName(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_lastName(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.LastName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_lastName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_displayName(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_displayName(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.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_avatarRemoteURL(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_avatarRemoteURL(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.AvatarRemoteURL, 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_UserHistory_avatarRemoteURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_avatarLocalFile(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_avatarLocalFile(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.AvatarLocalFile, 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_UserHistory_avatarLocalFile(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_avatarUpdatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_avatarUpdatedAt(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.AvatarUpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_avatarUpdatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_lastSeen(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_lastSeen(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.LastSeen, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_lastSeen(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_sub(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_sub(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.Sub, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_sub(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + 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) _UserHistory_authProvider(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_authProvider(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.AuthProvider, 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.(enums.AuthProvider) + fc.Result = res + return ec.marshalNUserHistoryAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_authProvider(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserHistoryAuthProvider does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistory_role(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistory_role(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.Role, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(enums.Role) + fc.Result = res + return ec.marshalOUserHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistory_role(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserHistoryRole does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.UserHistoryEdge) + fc.Result = res + return ec.marshalOUserHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_UserHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _UserHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.UserHistory) + fc.Result = res + return ec.marshalOUserHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistoryEdge", + 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_UserHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_UserHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_UserHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_UserHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_UserHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserHistory_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_UserHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserHistory_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_UserHistory_tags(ctx, field) + case "email": + return ec.fieldContext_UserHistory_email(ctx, field) + case "firstName": + return ec.fieldContext_UserHistory_firstName(ctx, field) + case "lastName": + return ec.fieldContext_UserHistory_lastName(ctx, field) + case "displayName": + return ec.fieldContext_UserHistory_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_UserHistory_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_UserHistory_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_UserHistory_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_UserHistory_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_UserHistory_sub(ctx, field) + case "authProvider": + return ec.fieldContext_UserHistory_authProvider(ctx, field) + case "role": + return ec.fieldContext_UserHistory_role(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.UserHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _UserSearchResult_users(ctx context.Context, field graphql.CollectedField, obj *UserSearchResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSearchResult_users(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.Users, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.User) + fc.Result = res + return ec.marshalOUser2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSearchResult_users(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSearchResult", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_id(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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) _UserSetting_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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) _UserSetting_tags(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_tags(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.Tags, 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_UserSetting_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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) _UserSetting_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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) _UserSetting_userID(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_userID(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.UserID, 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.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_locked(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_locked(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.Locked, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_locked(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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 fc, nil +} + +func (ec *executionContext) _UserSetting_silencedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_silencedAt(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.SilencedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_silencedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_suspendedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_suspendedAt(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.SuspendedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_suspendedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_status(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_status(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.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.(enums.UserStatus) + fc.Result = res + return ec.marshalNUserSettingUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserSettingUserStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_emailConfirmed(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_emailConfirmed(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.EmailConfirmed, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_emailConfirmed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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 fc, nil +} + +func (ec *executionContext) _UserSetting_isWebauthnAllowed(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_isWebauthnAllowed(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.IsWebauthnAllowed, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_isWebauthnAllowed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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 fc, nil +} + +func (ec *executionContext) _UserSetting_isTfaEnabled(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_isTfaEnabled(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.IsTfaEnabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_isTfaEnabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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 fc, nil +} + +func (ec *executionContext) _UserSetting_user(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_user(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.User(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.User) + fc.Result = res + return ec.marshalOUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSetting_defaultOrg(ctx context.Context, field graphql.CollectedField, obj *generated.UserSetting) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSetting_defaultOrg(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.DefaultOrg(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSetting_defaultOrg(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSetting", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingBulkCreatePayload_userSettings(ctx context.Context, field graphql.CollectedField, obj *UserSettingBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingBulkCreatePayload_userSettings(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.UserSettings, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.UserSetting) + fc.Result = res + return ec.marshalOUserSetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingBulkCreatePayload_userSettings(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingBulkCreatePayload", + 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_UserSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_UserSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_UserSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_UserSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserSetting_deletedBy(ctx, field) + case "userID": + return ec.fieldContext_UserSetting_userID(ctx, field) + case "locked": + return ec.fieldContext_UserSetting_locked(ctx, field) + case "silencedAt": + return ec.fieldContext_UserSetting_silencedAt(ctx, field) + case "suspendedAt": + return ec.fieldContext_UserSetting_suspendedAt(ctx, field) + case "status": + return ec.fieldContext_UserSetting_status(ctx, field) + case "emailConfirmed": + return ec.fieldContext_UserSetting_emailConfirmed(ctx, field) + case "isWebauthnAllowed": + return ec.fieldContext_UserSetting_isWebauthnAllowed(ctx, field) + case "isTfaEnabled": + return ec.fieldContext_UserSetting_isTfaEnabled(ctx, field) + case "user": + return ec.fieldContext_UserSetting_user(ctx, field) + case "defaultOrg": + return ec.fieldContext_UserSetting_defaultOrg(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.UserSettingEdge) + fc.Result = res + return ec.marshalOUserSettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_UserSettingEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserSettingEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingConnection", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingCreatePayload_userSetting(ctx context.Context, field graphql.CollectedField, obj *UserSettingCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingCreatePayload_userSetting(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.UserSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.UserSetting) + fc.Result = res + return ec.marshalNUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingCreatePayload_userSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingCreatePayload", + 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_UserSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_UserSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_UserSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_UserSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserSetting_deletedBy(ctx, field) + case "userID": + return ec.fieldContext_UserSetting_userID(ctx, field) + case "locked": + return ec.fieldContext_UserSetting_locked(ctx, field) + case "silencedAt": + return ec.fieldContext_UserSetting_silencedAt(ctx, field) + case "suspendedAt": + return ec.fieldContext_UserSetting_suspendedAt(ctx, field) + case "status": + return ec.fieldContext_UserSetting_status(ctx, field) + case "emailConfirmed": + return ec.fieldContext_UserSetting_emailConfirmed(ctx, field) + case "isWebauthnAllowed": + return ec.fieldContext_UserSetting_isWebauthnAllowed(ctx, field) + case "isTfaEnabled": + return ec.fieldContext_UserSetting_isTfaEnabled(ctx, field) + case "user": + return ec.fieldContext_UserSetting_user(ctx, field) + case "defaultOrg": + return ec.fieldContext_UserSetting_defaultOrg(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.UserSetting) + fc.Result = res + return ec.marshalOUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingEdge", + 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_UserSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_UserSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_UserSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_UserSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserSetting_deletedBy(ctx, field) + case "userID": + return ec.fieldContext_UserSetting_userID(ctx, field) + case "locked": + return ec.fieldContext_UserSetting_locked(ctx, field) + case "silencedAt": + return ec.fieldContext_UserSetting_silencedAt(ctx, field) + case "suspendedAt": + return ec.fieldContext_UserSetting_suspendedAt(ctx, field) + case "status": + return ec.fieldContext_UserSetting_status(ctx, field) + case "emailConfirmed": + return ec.fieldContext_UserSetting_emailConfirmed(ctx, field) + case "isWebauthnAllowed": + return ec.fieldContext_UserSetting_isWebauthnAllowed(ctx, field) + case "isTfaEnabled": + return ec.fieldContext_UserSetting_isTfaEnabled(ctx, field) + case "user": + return ec.fieldContext_UserSetting_user(ctx, field) + case "defaultOrg": + return ec.fieldContext_UserSetting_defaultOrg(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingEdge", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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) _UserSettingHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNUserSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserSettingHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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) _UserSettingHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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) _UserSettingHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_tags(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.Tags, 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_UserSettingHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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) _UserSettingHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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) _UserSettingHistory_userID(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_userID(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.UserID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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) _UserSettingHistory_locked(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_locked(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.Locked, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_locked(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingHistory_silencedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_silencedAt(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.SilencedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_silencedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_suspendedAt(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_suspendedAt(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.SuspendedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_suspendedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_status(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_status(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.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.(enums.UserStatus) + fc.Result = res + return ec.marshalNUserSettingHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserSettingHistoryUserStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistory_emailConfirmed(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_emailConfirmed(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.EmailConfirmed, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_emailConfirmed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingHistory_isWebauthnAllowed(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_isWebauthnAllowed(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.IsWebauthnAllowed, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_isWebauthnAllowed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingHistory_isTfaEnabled(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistory_isTfaEnabled(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.IsTfaEnabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistory_isTfaEnabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistory", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.UserSettingHistoryEdge) + fc.Result = res + return ec.marshalOUserSettingHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_UserSettingHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_UserSettingHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.UserSettingHistory) + fc.Result = res + return ec.marshalOUserSettingHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistoryEdge", + 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_UserSettingHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_UserSettingHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_UserSettingHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_UserSettingHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_UserSettingHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserSettingHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserSettingHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserSettingHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_UserSettingHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_UserSettingHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserSettingHistory_deletedBy(ctx, field) + case "userID": + return ec.fieldContext_UserSettingHistory_userID(ctx, field) + case "locked": + return ec.fieldContext_UserSettingHistory_locked(ctx, field) + case "silencedAt": + return ec.fieldContext_UserSettingHistory_silencedAt(ctx, field) + case "suspendedAt": + return ec.fieldContext_UserSettingHistory_suspendedAt(ctx, field) + case "status": + return ec.fieldContext_UserSettingHistory_status(ctx, field) + case "emailConfirmed": + return ec.fieldContext_UserSettingHistory_emailConfirmed(ctx, field) + case "isWebauthnAllowed": + return ec.fieldContext_UserSettingHistory_isWebauthnAllowed(ctx, field) + case "isTfaEnabled": + return ec.fieldContext_UserSettingHistory_isTfaEnabled(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSettingHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserSettingHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.UserSettingHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _UserSettingUpdatePayload_userSetting(ctx context.Context, field graphql.CollectedField, obj *UserSettingUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserSettingUpdatePayload_userSetting(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.UserSetting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.UserSetting) + fc.Result = res + return ec.marshalNUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserSettingUpdatePayload_userSetting(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserSettingUpdatePayload", + 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_UserSetting_id(ctx, field) + case "createdAt": + return ec.fieldContext_UserSetting_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_UserSetting_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_UserSetting_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_UserSetting_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_UserSetting_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_UserSetting_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_UserSetting_deletedBy(ctx, field) + case "userID": + return ec.fieldContext_UserSetting_userID(ctx, field) + case "locked": + return ec.fieldContext_UserSetting_locked(ctx, field) + case "silencedAt": + return ec.fieldContext_UserSetting_silencedAt(ctx, field) + case "suspendedAt": + return ec.fieldContext_UserSetting_suspendedAt(ctx, field) + case "status": + return ec.fieldContext_UserSetting_status(ctx, field) + case "emailConfirmed": + return ec.fieldContext_UserSetting_emailConfirmed(ctx, field) + case "isWebauthnAllowed": + return ec.fieldContext_UserSetting_isWebauthnAllowed(ctx, field) + case "isTfaEnabled": + return ec.fieldContext_UserSetting_isTfaEnabled(ctx, field) + case "user": + return ec.fieldContext_UserSetting_user(ctx, field) + case "defaultOrg": + return ec.fieldContext_UserSetting_defaultOrg(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserSetting", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _UserUpdatePayload_user(ctx context.Context, field graphql.CollectedField, obj *UserUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserUpdatePayload_user(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.User, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.User) + fc.Result = res + return ec.marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserUpdatePayload_user(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserUpdatePayload", + 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_User_id(ctx, field) + case "createdAt": + return ec.fieldContext_User_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_User_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_User_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_User_updatedBy(ctx, field) + case "deletedAt": + return ec.fieldContext_User_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_User_deletedBy(ctx, field) + case "tags": + return ec.fieldContext_User_tags(ctx, field) + case "email": + return ec.fieldContext_User_email(ctx, field) + case "firstName": + return ec.fieldContext_User_firstName(ctx, field) + case "lastName": + return ec.fieldContext_User_lastName(ctx, field) + case "displayName": + return ec.fieldContext_User_displayName(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_User_avatarRemoteURL(ctx, field) + case "avatarLocalFile": + return ec.fieldContext_User_avatarLocalFile(ctx, field) + case "avatarUpdatedAt": + return ec.fieldContext_User_avatarUpdatedAt(ctx, field) + case "lastSeen": + return ec.fieldContext_User_lastSeen(ctx, field) + case "sub": + return ec.fieldContext_User_sub(ctx, field) + case "authProvider": + return ec.fieldContext_User_authProvider(ctx, field) + case "role": + return ec.fieldContext_User_role(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_User_personalAccessTokens(ctx, field) + case "tfaSettings": + return ec.fieldContext_User_tfaSettings(ctx, field) + case "setting": + return ec.fieldContext_User_setting(ctx, field) + case "groups": + return ec.fieldContext_User_groups(ctx, field) + case "organizations": + return ec.fieldContext_User_organizations(ctx, field) + case "files": + return ec.fieldContext_User_files(ctx, field) + case "events": + return ec.fieldContext_User_events(ctx, field) + case "groupMemberships": + return ec.fieldContext_User_groupMemberships(ctx, field) + case "orgMemberships": + return ec.fieldContext_User_orgMemberships(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_id(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_tags(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_tags(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.Tags, 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_Webhook_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_name(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_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 { + 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_Webhook_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_description(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_destinationURL(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_destinationURL(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.DestinationURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_destinationURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_enabled(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_enabled(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.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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 fc, nil +} + +func (ec *executionContext) _Webhook_failures(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_failures(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.Failures, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_failures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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 fc, nil +} + +func (ec *executionContext) _Webhook_lastError(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_lastError(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.LastError, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_lastError(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_lastResponse(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_lastResponse(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.LastResponse, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_lastResponse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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) _Webhook_owner(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_owner(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.Owner(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Organization) + fc.Result = res + return ec.marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_owner(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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_Organization_id(ctx, field) + case "createdAt": + return ec.fieldContext_Organization_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Organization_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Organization_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Organization_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Organization_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Organization_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Organization_deletedBy(ctx, field) + case "name": + return ec.fieldContext_Organization_name(ctx, field) + case "displayName": + return ec.fieldContext_Organization_displayName(ctx, field) + case "description": + return ec.fieldContext_Organization_description(ctx, field) + case "personalOrg": + return ec.fieldContext_Organization_personalOrg(ctx, field) + case "avatarRemoteURL": + return ec.fieldContext_Organization_avatarRemoteURL(ctx, field) + case "dedicatedDb": + return ec.fieldContext_Organization_dedicatedDb(ctx, field) + case "parent": + return ec.fieldContext_Organization_parent(ctx, field) + case "children": + return ec.fieldContext_Organization_children(ctx, field) + case "groups": + return ec.fieldContext_Organization_groups(ctx, field) + case "templates": + return ec.fieldContext_Organization_templates(ctx, field) + case "integrations": + return ec.fieldContext_Organization_integrations(ctx, field) + case "setting": + return ec.fieldContext_Organization_setting(ctx, field) + case "documentdata": + return ec.fieldContext_Organization_documentdata(ctx, field) + case "entitlements": + return ec.fieldContext_Organization_entitlements(ctx, field) + case "organizationEntitlement": + return ec.fieldContext_Organization_organizationEntitlement(ctx, field) + case "personalAccessTokens": + return ec.fieldContext_Organization_personalAccessTokens(ctx, field) + case "apiTokens": + return ec.fieldContext_Organization_apiTokens(ctx, field) + case "oauthprovider": + return ec.fieldContext_Organization_oauthprovider(ctx, field) + case "users": + return ec.fieldContext_Organization_users(ctx, field) + case "invites": + return ec.fieldContext_Organization_invites(ctx, field) + case "subscribers": + return ec.fieldContext_Organization_subscribers(ctx, field) + case "webhooks": + return ec.fieldContext_Organization_webhooks(ctx, field) + case "events": + return ec.fieldContext_Organization_events(ctx, field) + case "secrets": + return ec.fieldContext_Organization_secrets(ctx, field) + case "features": + return ec.fieldContext_Organization_features(ctx, field) + case "files": + return ec.fieldContext_Organization_files(ctx, field) + case "entitlementplans": + return ec.fieldContext_Organization_entitlementplans(ctx, field) + case "entitlementplanfeatures": + return ec.fieldContext_Organization_entitlementplanfeatures(ctx, field) + case "entities": + return ec.fieldContext_Organization_entities(ctx, field) + case "entitytypes": + return ec.fieldContext_Organization_entitytypes(ctx, field) + case "contacts": + return ec.fieldContext_Organization_contacts(ctx, field) + case "notes": + return ec.fieldContext_Organization_notes(ctx, field) + case "members": + return ec.fieldContext_Organization_members(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_events(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_events(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.Events(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Event) + fc.Result = res + return ec.marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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_Event_id(ctx, field) + case "createdAt": + return ec.fieldContext_Event_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Event_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Event_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Event_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Event_tags(ctx, field) + case "eventID": + return ec.fieldContext_Event_eventID(ctx, field) + case "correlationID": + return ec.fieldContext_Event_correlationID(ctx, field) + case "eventType": + return ec.fieldContext_Event_eventType(ctx, field) + case "metadata": + return ec.fieldContext_Event_metadata(ctx, field) + case "user": + return ec.fieldContext_Event_user(ctx, field) + case "group": + return ec.fieldContext_Event_group(ctx, field) + case "integration": + return ec.fieldContext_Event_integration(ctx, field) + case "organization": + return ec.fieldContext_Event_organization(ctx, field) + case "invite": + return ec.fieldContext_Event_invite(ctx, field) + case "feature": + return ec.fieldContext_Event_feature(ctx, field) + case "entitlementplan": + return ec.fieldContext_Event_entitlementplan(ctx, field) + case "entitlementplanfeature": + return ec.fieldContext_Event_entitlementplanfeature(ctx, field) + case "personalAccessToken": + return ec.fieldContext_Event_personalAccessToken(ctx, field) + case "oauth2token": + return ec.fieldContext_Event_oauth2token(ctx, field) + case "hush": + return ec.fieldContext_Event_hush(ctx, field) + case "orgmembership": + return ec.fieldContext_Event_orgmembership(ctx, field) + case "groupmembership": + return ec.fieldContext_Event_groupmembership(ctx, field) + case "entitlement": + return ec.fieldContext_Event_entitlement(ctx, field) + case "webhook": + return ec.fieldContext_Event_webhook(ctx, field) + case "subscriber": + return ec.fieldContext_Event_subscriber(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Event", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Webhook_integrations(ctx context.Context, field graphql.CollectedField, obj *generated.Webhook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Webhook_integrations(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.Integrations(ctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Integration) + fc.Result = res + return ec.marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Webhook_integrations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Webhook", + 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_Integration_id(ctx, field) + case "createdAt": + return ec.fieldContext_Integration_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Integration_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Integration_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Integration_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Integration_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Integration_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Integration_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Integration_ownerID(ctx, field) + case "name": + return ec.fieldContext_Integration_name(ctx, field) + case "description": + return ec.fieldContext_Integration_description(ctx, field) + case "kind": + return ec.fieldContext_Integration_kind(ctx, field) + case "owner": + return ec.fieldContext_Integration_owner(ctx, field) + case "secrets": + return ec.fieldContext_Integration_secrets(ctx, field) + case "oauth2tokens": + return ec.fieldContext_Integration_oauth2tokens(ctx, field) + case "events": + return ec.fieldContext_Integration_events(ctx, field) + case "webhooks": + return ec.fieldContext_Integration_webhooks(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Integration", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookBulkCreatePayload_webhooks(ctx context.Context, field graphql.CollectedField, obj *WebhookBulkCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookBulkCreatePayload_webhooks(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.Webhooks, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.Webhook) + fc.Result = res + return ec.marshalOWebhook2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookBulkCreatePayload_webhooks(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookBulkCreatePayload", + 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_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.WebhookEdge) + fc.Result = res + return ec.marshalOWebhookEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_WebhookEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_WebhookEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookConnection", + 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 fc, nil +} + +func (ec *executionContext) _WebhookCreatePayload_webhook(ctx context.Context, field graphql.CollectedField, obj *WebhookCreatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookCreatePayload_webhook(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.Webhook, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Webhook) + fc.Result = res + return ec.marshalNWebhook2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookCreatePayload_webhook(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookCreatePayload", + 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_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *WebhookDeletePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookDeletePayload_deletedID(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.DeletedID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookDeletePayload", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.Webhook) + fc.Result = res + return ec.marshalOWebhook2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookEdge", + 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_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookEdge", + 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 fc, nil +} + +func (ec *executionContext) _WebhookHistory_id(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistory_historyTime(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_historyTime(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.HistoryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_historyTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistory_ref(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_ref(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.Ref, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_ref(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_operation(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_operation(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.Operation, 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.(history.OpType) + fc.Result = res + return ec.marshalNWebhookHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type WebhookHistoryOpType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistory_createdAt(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_createdAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistory_updatedAt(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_updatedAt(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.UpdatedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistory_createdBy(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_updatedBy(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_updatedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_tags(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_tags(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.Tags, 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_WebhookHistory_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_deletedAt(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_deletedAt(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.DeletedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_deletedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistory_deletedBy(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_deletedBy(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.DeletedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_deletedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_ownerID(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_ownerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_ownerID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_name(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_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 { + 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_WebhookHistory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_description(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_destinationURL(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_destinationURL(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.DestinationURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_destinationURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_enabled(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_enabled(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.Enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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 fc, nil +} + +func (ec *executionContext) _WebhookHistory_failures(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_failures(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.Failures, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_failures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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 fc, nil +} + +func (ec *executionContext) _WebhookHistory_lastError(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_lastError(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.LastError, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_lastError(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistory_lastResponse(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistory_lastResponse(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.LastResponse, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistory_lastResponse(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistory", + 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) _WebhookHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistoryConnection_edges(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*generated.WebhookHistoryEdge) + fc.Result = res + return ec.marshalOWebhookHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistoryConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_WebhookHistoryEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_WebhookHistoryEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookHistoryEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistoryConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistoryConnection_pageInfo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.PageInfo[string]) + fc.Result = res + return ec.marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistoryConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistoryConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistoryConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistoryConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistoryConnection_totalCount(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.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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistoryConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistoryConnection", + 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 fc, nil +} + +func (ec *executionContext) _WebhookHistoryEdge_node(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistoryEdge_node(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.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*generated.WebhookHistory) + fc.Result = res + return ec.marshalOWebhookHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistoryEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistoryEdge", + 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_WebhookHistory_id(ctx, field) + case "historyTime": + return ec.fieldContext_WebhookHistory_historyTime(ctx, field) + case "ref": + return ec.fieldContext_WebhookHistory_ref(ctx, field) + case "operation": + return ec.fieldContext_WebhookHistory_operation(ctx, field) + case "createdAt": + return ec.fieldContext_WebhookHistory_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_WebhookHistory_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_WebhookHistory_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_WebhookHistory_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_WebhookHistory_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_WebhookHistory_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_WebhookHistory_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_WebhookHistory_ownerID(ctx, field) + case "name": + return ec.fieldContext_WebhookHistory_name(ctx, field) + case "description": + return ec.fieldContext_WebhookHistory_description(ctx, field) + case "destinationURL": + return ec.fieldContext_WebhookHistory_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_WebhookHistory_enabled(ctx, field) + case "failures": + return ec.fieldContext_WebhookHistory_failures(ctx, field) + case "lastError": + return ec.fieldContext_WebhookHistory_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_WebhookHistory_lastResponse(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type WebhookHistory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _WebhookHistoryEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *generated.WebhookHistoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookHistoryEdge_cursor(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.Cursor, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(entgql.Cursor[string]) + fc.Result = res + return ec.marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookHistoryEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookHistoryEdge", + 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 fc, nil +} + +func (ec *executionContext) _WebhookUpdatePayload_webhook(ctx context.Context, field graphql.CollectedField, obj *WebhookUpdatePayload) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_WebhookUpdatePayload_webhook(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.Webhook, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*generated.Webhook) + fc.Result = res + return ec.marshalNWebhook2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_WebhookUpdatePayload_webhook(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "WebhookUpdatePayload", + 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_Webhook_id(ctx, field) + case "createdAt": + return ec.fieldContext_Webhook_createdAt(ctx, field) + case "updatedAt": + return ec.fieldContext_Webhook_updatedAt(ctx, field) + case "createdBy": + return ec.fieldContext_Webhook_createdBy(ctx, field) + case "updatedBy": + return ec.fieldContext_Webhook_updatedBy(ctx, field) + case "tags": + return ec.fieldContext_Webhook_tags(ctx, field) + case "deletedAt": + return ec.fieldContext_Webhook_deletedAt(ctx, field) + case "deletedBy": + return ec.fieldContext_Webhook_deletedBy(ctx, field) + case "ownerID": + return ec.fieldContext_Webhook_ownerID(ctx, field) + case "name": + return ec.fieldContext_Webhook_name(ctx, field) + case "description": + return ec.fieldContext_Webhook_description(ctx, field) + case "destinationURL": + return ec.fieldContext_Webhook_destinationURL(ctx, field) + case "enabled": + return ec.fieldContext_Webhook_enabled(ctx, field) + case "failures": + return ec.fieldContext_Webhook_failures(ctx, field) + case "lastError": + return ec.fieldContext_Webhook_lastError(ctx, field) + case "lastResponse": + return ec.fieldContext_Webhook_lastResponse(ctx, field) + case "owner": + return ec.fieldContext_Webhook_owner(ctx, field) + case "events": + return ec.fieldContext_Webhook_events(ctx, field) + case "integrations": + return ec.fieldContext_Webhook_integrations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Webhook", 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 { + 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 { + 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___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String 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) + 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___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + 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) ___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 + } + 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.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) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + 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) + 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.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.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + 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) ___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 + } + 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.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + 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) + 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 { + 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___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + 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) ___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 + } + 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___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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 String 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) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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 Boolean 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) + 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.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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 String does not have child fields") + }, + } + 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) + 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 { + 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___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + 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) + 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___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___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 + } + 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.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.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "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) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ 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) ___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 + } + 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___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_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 + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ 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) { + 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) ___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 + } + 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.DefaultValue, 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___InputValue_defaultValue(_ 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) ___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) 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 +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ 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) unmarshalInputAPITokenWhereInput(ctx context.Context, obj interface{}) (generated.APITokenWhereInput, error) { + var it generated.APITokenWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "expiresAt", "expiresAtNEQ", "expiresAtIn", "expiresAtNotIn", "expiresAtGT", "expiresAtGTE", "expiresAtLT", "expiresAtLTE", "expiresAtIsNil", "expiresAtNotNil", "lastUsedAt", "lastUsedAtNEQ", "lastUsedAtIn", "lastUsedAtNotIn", "lastUsedAtGT", "lastUsedAtGTE", "lastUsedAtLT", "lastUsedAtLTE", "lastUsedAtIsNil", "lastUsedAtNotNil", "hasOwner", "hasOwnerWith"} + 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.unmarshalOAPITokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOAPITokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOAPITokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "expiresAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNEQ = data + case "expiresAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIn = data + case "expiresAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotIn = data + case "expiresAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGT = data + case "expiresAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGTE = data + case "expiresAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLT = data + case "expiresAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLTE = data + case "expiresAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIsNil = data + case "expiresAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotNil = data + case "lastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAt = data + case "lastUsedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtNEQ = data + case "lastUsedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtIn = data + case "lastUsedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtNotIn = data + case "lastUsedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtGT = data + case "lastUsedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtGTE = data + case "lastUsedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtLT = data + case "lastUsedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtLTE = data + case "lastUsedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtIsNil = data + case "lastUsedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtNotNil = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputAuditLogWhereInput(ctx context.Context, obj interface{}) (AuditLogWhereInput, error) { + var it AuditLogWhereInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"refID", "updatedBy", "operation", "table", "before", "after"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "refID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefID = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "table": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("table")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Table = data + case "before": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Before = data + case "after": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.After = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputContactHistoryWhereInput(ctx context.Context, obj interface{}) (generated.ContactHistoryWhereInput, error) { + var it generated.ContactHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "fullName", "fullNameNEQ", "fullNameIn", "fullNameNotIn", "fullNameGT", "fullNameGTE", "fullNameLT", "fullNameLTE", "fullNameContains", "fullNameHasPrefix", "fullNameHasSuffix", "fullNameEqualFold", "fullNameContainsFold", "title", "titleNEQ", "titleIn", "titleNotIn", "titleGT", "titleGTE", "titleLT", "titleLTE", "titleContains", "titleHasPrefix", "titleHasSuffix", "titleIsNil", "titleNotNil", "titleEqualFold", "titleContainsFold", "company", "companyNEQ", "companyIn", "companyNotIn", "companyGT", "companyGTE", "companyLT", "companyLTE", "companyContains", "companyHasPrefix", "companyHasSuffix", "companyIsNil", "companyNotNil", "companyEqualFold", "companyContainsFold", "email", "emailNEQ", "emailIn", "emailNotIn", "emailGT", "emailGTE", "emailLT", "emailLTE", "emailContains", "emailHasPrefix", "emailHasSuffix", "emailIsNil", "emailNotNil", "emailEqualFold", "emailContainsFold", "phoneNumber", "phoneNumberNEQ", "phoneNumberIn", "phoneNumberNotIn", "phoneNumberGT", "phoneNumberGTE", "phoneNumberLT", "phoneNumberLTE", "phoneNumberContains", "phoneNumberHasPrefix", "phoneNumberHasSuffix", "phoneNumberIsNil", "phoneNumberNotNil", "phoneNumberEqualFold", "phoneNumberContainsFold", "address", "addressNEQ", "addressIn", "addressNotIn", "addressGT", "addressGTE", "addressLT", "addressLTE", "addressContains", "addressHasPrefix", "addressHasSuffix", "addressIsNil", "addressNotNil", "addressEqualFold", "addressContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn"} + 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.unmarshalOContactHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOContactHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOContactHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOContactHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOContactHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOContactHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOContactHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "fullName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullName = data + case "fullNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameNEQ = data + case "fullNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FullNameIn = data + case "fullNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FullNameNotIn = data + case "fullNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameGT = data + case "fullNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameGTE = data + case "fullNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameLT = data + case "fullNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameLTE = data + case "fullNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameContains = data + case "fullNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameHasPrefix = data + case "fullNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameHasSuffix = data + case "fullNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameEqualFold = data + case "fullNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameContainsFold = data + case "title": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Title = data + case "titleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleNEQ = data + case "titleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TitleIn = data + case "titleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TitleNotIn = data + case "titleGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleGT = data + case "titleGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleGTE = data + case "titleLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleLT = data + case "titleLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleLTE = data + case "titleContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleContains = data + case "titleHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleHasPrefix = data + case "titleHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleHasSuffix = data + case "titleIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TitleIsNil = data + case "titleNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TitleNotNil = data + case "titleEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleEqualFold = data + case "titleContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleContainsFold = data + case "company": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("company")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Company = data + case "companyNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyNEQ = data + case "companyIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CompanyIn = data + case "companyNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CompanyNotIn = data + case "companyGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyGT = data + case "companyGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyGTE = data + case "companyLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyLT = data + case "companyLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyLTE = data + case "companyContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyContains = data + case "companyHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyHasPrefix = data + case "companyHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyHasSuffix = data + case "companyIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CompanyIsNil = data + case "companyNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CompanyNotNil = data + case "companyEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyEqualFold = data + case "companyContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyContainsFold = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "emailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailNEQ = data + case "emailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailIn = data + case "emailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailNotIn = data + case "emailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGT = data + case "emailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGTE = data + case "emailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLT = data + case "emailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLTE = data + case "emailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContains = data + case "emailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasPrefix = data + case "emailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasSuffix = data + case "emailIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EmailIsNil = data + case "emailNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EmailNotNil = data + case "emailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailEqualFold = data + case "emailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContainsFold = data + case "phoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumber")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumber = data + case "phoneNumberNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNEQ = data + case "phoneNumberIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberIn = data + case "phoneNumberNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNotIn = data + case "phoneNumberGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberGT = data + case "phoneNumberGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberGTE = data + case "phoneNumberLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberLT = data + case "phoneNumberLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberLTE = data + case "phoneNumberContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberContains = data + case "phoneNumberHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberHasPrefix = data + case "phoneNumberHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberHasSuffix = data + case "phoneNumberIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberIsNil = data + case "phoneNumberNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNotNil = data + case "phoneNumberEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberEqualFold = data + case "phoneNumberContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberContainsFold = data + case "address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Address = data + case "addressNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressNEQ = data + case "addressIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddressIn = data + case "addressNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddressNotIn = data + case "addressGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressGT = data + case "addressGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressGTE = data + case "addressLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressLT = data + case "addressLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressLTE = data + case "addressContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressContains = data + case "addressHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressHasPrefix = data + case "addressHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressHasSuffix = data + case "addressIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AddressIsNil = data + case "addressNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AddressNotNil = data + case "addressEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressEqualFold = data + case "addressContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOContactHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOContactHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOContactHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOContactHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusNotIn = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputContactWhereInput(ctx context.Context, obj interface{}) (generated.ContactWhereInput, error) { + var it generated.ContactWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "fullName", "fullNameNEQ", "fullNameIn", "fullNameNotIn", "fullNameGT", "fullNameGTE", "fullNameLT", "fullNameLTE", "fullNameContains", "fullNameHasPrefix", "fullNameHasSuffix", "fullNameEqualFold", "fullNameContainsFold", "title", "titleNEQ", "titleIn", "titleNotIn", "titleGT", "titleGTE", "titleLT", "titleLTE", "titleContains", "titleHasPrefix", "titleHasSuffix", "titleIsNil", "titleNotNil", "titleEqualFold", "titleContainsFold", "company", "companyNEQ", "companyIn", "companyNotIn", "companyGT", "companyGTE", "companyLT", "companyLTE", "companyContains", "companyHasPrefix", "companyHasSuffix", "companyIsNil", "companyNotNil", "companyEqualFold", "companyContainsFold", "email", "emailNEQ", "emailIn", "emailNotIn", "emailGT", "emailGTE", "emailLT", "emailLTE", "emailContains", "emailHasPrefix", "emailHasSuffix", "emailIsNil", "emailNotNil", "emailEqualFold", "emailContainsFold", "phoneNumber", "phoneNumberNEQ", "phoneNumberIn", "phoneNumberNotIn", "phoneNumberGT", "phoneNumberGTE", "phoneNumberLT", "phoneNumberLTE", "phoneNumberContains", "phoneNumberHasPrefix", "phoneNumberHasSuffix", "phoneNumberIsNil", "phoneNumberNotNil", "phoneNumberEqualFold", "phoneNumberContainsFold", "address", "addressNEQ", "addressIn", "addressNotIn", "addressGT", "addressGTE", "addressLT", "addressLTE", "addressContains", "addressHasPrefix", "addressHasSuffix", "addressIsNil", "addressNotNil", "addressEqualFold", "addressContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "hasOwner", "hasOwnerWith", "hasEntities", "hasEntitiesWith"} + 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.unmarshalOContactWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOContactWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOContactWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "fullName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullName = data + case "fullNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameNEQ = data + case "fullNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FullNameIn = data + case "fullNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FullNameNotIn = data + case "fullNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameGT = data + case "fullNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameGTE = data + case "fullNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameLT = data + case "fullNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameLTE = data + case "fullNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameContains = data + case "fullNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameHasPrefix = data + case "fullNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameHasSuffix = data + case "fullNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameEqualFold = data + case "fullNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullNameContainsFold = data + case "title": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Title = data + case "titleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleNEQ = data + case "titleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TitleIn = data + case "titleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TitleNotIn = data + case "titleGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleGT = data + case "titleGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleGTE = data + case "titleLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleLT = data + case "titleLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleLTE = data + case "titleContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleContains = data + case "titleHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleHasPrefix = data + case "titleHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleHasSuffix = data + case "titleIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TitleIsNil = data + case "titleNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TitleNotNil = data + case "titleEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleEqualFold = data + case "titleContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titleContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TitleContainsFold = data + case "company": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("company")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Company = data + case "companyNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyNEQ = data + case "companyIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CompanyIn = data + case "companyNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CompanyNotIn = data + case "companyGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyGT = data + case "companyGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyGTE = data + case "companyLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyLT = data + case "companyLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyLTE = data + case "companyContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyContains = data + case "companyHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyHasPrefix = data + case "companyHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyHasSuffix = data + case "companyIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CompanyIsNil = data + case "companyNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CompanyNotNil = data + case "companyEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyEqualFold = data + case "companyContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("companyContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CompanyContainsFold = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "emailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailNEQ = data + case "emailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailIn = data + case "emailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailNotIn = data + case "emailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGT = data + case "emailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGTE = data + case "emailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLT = data + case "emailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLTE = data + case "emailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContains = data + case "emailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasPrefix = data + case "emailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasSuffix = data + case "emailIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EmailIsNil = data + case "emailNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EmailNotNil = data + case "emailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailEqualFold = data + case "emailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContainsFold = data + case "phoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumber")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumber = data + case "phoneNumberNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNEQ = data + case "phoneNumberIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberIn = data + case "phoneNumberNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNotIn = data + case "phoneNumberGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberGT = data + case "phoneNumberGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberGTE = data + case "phoneNumberLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberLT = data + case "phoneNumberLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberLTE = data + case "phoneNumberContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberContains = data + case "phoneNumberHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberHasPrefix = data + case "phoneNumberHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberHasSuffix = data + case "phoneNumberIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberIsNil = data + case "phoneNumberNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNotNil = data + case "phoneNumberEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberEqualFold = data + case "phoneNumberContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberContainsFold = data + case "address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Address = data + case "addressNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressNEQ = data + case "addressIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddressIn = data + case "addressNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddressNotIn = data + case "addressGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressGT = data + case "addressGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressGTE = data + case "addressLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressLT = data + case "addressLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressLTE = data + case "addressContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressContains = data + case "addressHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressHasPrefix = data + case "addressHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressHasSuffix = data + case "addressIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AddressIsNil = data + case "addressNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AddressNotNil = data + case "addressEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressEqualFold = data + case "addressContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addressContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AddressContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOContactUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOContactUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOContactUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOContactUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusNotIn = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasEntities": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntities")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntities = data + case "hasEntitiesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitiesWith")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitiesWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateAPITokenInput(ctx context.Context, obj interface{}) (generated.CreateAPITokenInput, error) { + var it generated.CreateAPITokenInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "expiresAt", "description", "scopes", "lastUsedAt", "ownerID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "lastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAt = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateContactInput(ctx context.Context, obj interface{}) (generated.CreateContactInput, error) { + var it generated.CreateContactInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "fullName", "title", "company", "email", "phoneNumber", "address", "status", "ownerID", "entityIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "fullName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullName")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.FullName = data + case "title": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Title = data + case "company": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("company")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Company = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "phoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumber")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumber = data + case "address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Address = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOContactUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "entityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateDocumentDataInput(ctx context.Context, obj interface{}) (generated.CreateDocumentDataInput, error) { + var it generated.CreateDocumentDataInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "data", "ownerID", "templateID", "entityIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "data": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) + data, err := ec.unmarshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, v) + if err != nil { + return it, err + } + it.Data = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "templateID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.TemplateID = data + case "entityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateEntitlementInput(ctx context.Context, obj interface{}) (generated.CreateEntitlementInput, error) { + var it generated.CreateEntitlementInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "externalCustomerID", "externalSubscriptionID", "expiresAt", "cancelled", "ownerID", "planID", "organizationID", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "externalCustomerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerID = data + case "externalSubscriptionID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionID = data + case "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "cancelled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cancelled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Cancelled = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "planID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.PlanID = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateEntitlementPlanFeatureInput(ctx context.Context, obj interface{}) (generated.CreateEntitlementPlanFeatureInput, error) { + var it generated.CreateEntitlementPlanFeatureInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "metadata", "ownerID", "planID", "featureID", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "planID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.PlanID = data + case "featureID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.FeatureID = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateEntitlementPlanInput(ctx context.Context, obj interface{}) (generated.CreateEntitlementPlanInput, error) { + var it generated.CreateEntitlementPlanInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "displayName", "name", "description", "version", "metadata", "ownerID", "entitlementIDs", "baseFeatureIDs", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "version": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("version")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Version = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "entitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntitlementIDs = data + case "baseFeatureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("baseFeatureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BaseFeatureIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateEntityInput(ctx context.Context, obj interface{}) (generated.CreateEntityInput, error) { + var it generated.CreateEntityInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "displayName", "description", "domains", "status", "ownerID", "contactIDs", "documentIDs", "noteIDs", "fileIDs", "entityTypeID", "note"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "domains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domains")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Domains = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "contactIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contactIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ContactIDs = data + case "documentIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("documentIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DocumentIDs = data + case "noteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("noteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.NoteIDs = data + case "fileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileIDs = data + case "entityTypeID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeID = data + case "note": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("note")) + data, err := ec.unmarshalOCreateNoteInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateNoteInput(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateEntityInput().Note(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateEntityTypeInput(ctx context.Context, obj interface{}) (generated.CreateEntityTypeInput, error) { + var it generated.CreateEntityTypeInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "ownerID", "entityIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "entityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateEventInput(ctx context.Context, obj interface{}) (generated.CreateEventInput, error) { + var it generated.CreateEventInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "eventID", "correlationID", "eventType", "metadata", "userIDs", "groupIDs", "integrationIDs", "organizationIDs", "inviteIDs", "featureIDs", "entitlementplanIDs", "personalAccessTokenIDs", "oauth2tokenIDs", "hushIDs", "entitlementIDs", "webhookIDs", "subscriberIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "eventID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventID = data + case "correlationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationID = data + case "eventType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventType")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.EventType = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "userIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDs = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + case "integrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("integrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IntegrationIDs = data + case "organizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDs = data + case "inviteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inviteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.InviteIDs = data + case "featureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDs = data + case "entitlementplanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entitlementplanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntitlementplanIDs = data + case "personalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PersonalAccessTokenIDs = data + case "oauth2tokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("oauth2tokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Oauth2tokenIDs = data + case "hushIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hushIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.HushIDs = data + case "entitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntitlementIDs = data + case "webhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("webhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.WebhookIDs = data + case "subscriberIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subscriberIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SubscriberIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateFeatureInput(ctx context.Context, obj interface{}) (generated.CreateFeatureInput, error) { + var it generated.CreateFeatureInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "displayName", "enabled", "description", "metadata", "ownerID", "planIDs", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "planIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PlanIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateFileInput(ctx context.Context, obj interface{}) (generated.CreateFileInput, error) { + var it generated.CreateFileInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "fileName", "fileExtension", "fileSize", "contentType", "storeKey", "category", "annotation", "userID", "organizationIDs", "entityIDs", "groupIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "fileName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileName")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.FileName = data + case "fileExtension": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtension")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.FileExtension = data + case "fileSize": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSize")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSize = data + case "contentType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentType")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ContentType = data + case "storeKey": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKey")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.StoreKey = data + case "category": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Category = data + case "annotation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotation")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Annotation = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "organizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDs = data + case "entityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityIDs = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateGroupInput(ctx context.Context, obj interface{}) (generated.CreateGroupInput, error) { + var it generated.CreateGroupInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "description", "gravatarLogoURL", "logoURL", "displayName", "ownerID", "settingID", "userIDs", "eventIDs", "integrationIDs", "fileIDs", "createGroupSettings"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "gravatarLogoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gravatarLogoURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GravatarLogoURL = data + case "logoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logoURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LogoURL = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "settingID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("settingID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.SettingID = data + case "userIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + case "integrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("integrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IntegrationIDs = data + case "fileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileIDs = data + case "createGroupSettings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createGroupSettings")) + data, err := ec.unmarshalOCreateGroupSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInput(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateGroupInput().CreateGroupSettings(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateGroupMembershipInput(ctx context.Context, obj interface{}) (generated.CreateGroupMembershipInput, error) { + var it generated.CreateGroupMembershipInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"role", "groupID", "userID", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOGroupMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "groupID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.GroupID = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateGroupSettingInput(ctx context.Context, obj interface{}) (generated.CreateGroupSettingInput, error) { + var it generated.CreateGroupSettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "visibility", "joinPolicy", "syncToSlack", "syncToGithub", "groupID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "visibility": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibility")) + data, err := ec.unmarshalOGroupSettingVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, v) + if err != nil { + return it, err + } + it.Visibility = data + case "joinPolicy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicy")) + data, err := ec.unmarshalOGroupSettingJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicy = data + case "syncToSlack": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlack")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlack = data + case "syncToGithub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithub")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithub = data + case "groupID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateHushInput(ctx context.Context, obj interface{}) (generated.CreateHushInput, error) { + var it generated.CreateHushInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "description", "kind", "secretName", "secretValue", "integrationIDs", "organizationIDs", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "secretName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretName = data + case "secretValue": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretValue")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretValue = data + case "integrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("integrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IntegrationIDs = data + case "organizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateIntegrationInput(ctx context.Context, obj interface{}) (generated.CreateIntegrationInput, error) { + var it generated.CreateIntegrationInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "description", "kind", "ownerID", "secretIDs", "oauth2tokenIDs", "eventIDs", "webhookIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "secretIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SecretIDs = data + case "oauth2tokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("oauth2tokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Oauth2tokenIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + case "webhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("webhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.WebhookIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateInviteInput(ctx context.Context, obj interface{}) (generated.CreateInviteInput, error) { + var it generated.CreateInviteInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"expires", "recipient", "status", "role", "sendAttempts", "requestorID", "ownerID", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "expires": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Expires = data + case "recipient": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipient")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Recipient = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOInviteInviteStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOInviteRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "sendAttempts": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttempts")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttempts = data + case "requestorID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorID = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateNoteInput(ctx context.Context, obj interface{}) (generated.CreateNoteInput, error) { + var it generated.CreateNoteInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "text", "ownerID", "entityID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "entityID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateOauthProviderInput(ctx context.Context, obj interface{}) (generated.CreateOauthProviderInput, error) { + var it generated.CreateOauthProviderInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "clientID", "clientSecret", "redirectURL", "scopes", "authURL", "tokenURL", "authStyle", "infoURL", "ownerID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "clientID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientID")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClientID = data + case "clientSecret": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecret")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClientSecret = data + case "redirectURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURL")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.RedirectURL = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "authURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURL")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.AuthURL = data + case "tokenURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURL")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.TokenURL = data + case "authStyle": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyle")) + data, err := ec.unmarshalNUint2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyle = data + case "infoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURL")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.InfoURL = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateOhAuthTooTokenInput(ctx context.Context, obj interface{}) (generated.CreateOhAuthTooTokenInput, error) { + var it generated.CreateOhAuthTooTokenInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "clientID", "scopes", "nonce", "claimsUserID", "claimsUsername", "claimsEmail", "claimsEmailVerified", "claimsGroups", "claimsPreferredUsername", "connectorID", "connectorData", "lastUsed", "integrationIDs", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "clientID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientID")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClientID = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "nonce": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonce")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Nonce = data + case "claimsUserID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserID")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserID = data + case "claimsUsername": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsername")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsername = data + case "claimsEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmail")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmail = data + case "claimsEmailVerified": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailVerified")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailVerified = data + case "claimsGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsGroups")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsGroups = data + case "claimsPreferredUsername": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsername")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsername = data + case "connectorID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorID")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ConnectorID = data + case "connectorData": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorData")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ConnectorData = data + case "lastUsed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsed")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsed = data + case "integrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("integrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IntegrationIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateOrgMembershipInput(ctx context.Context, obj interface{}) (generated.CreateOrgMembershipInput, error) { + var it generated.CreateOrgMembershipInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"role", "organizationID", "userID", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOOrgMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateOrganizationInput(ctx context.Context, obj interface{}) (generated.CreateOrganizationInput, error) { + var it generated.CreateOrganizationInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "displayName", "description", "personalOrg", "avatarRemoteURL", "dedicatedDb", "parentID", "groupIDs", "templateIDs", "integrationIDs", "settingID", "documentdatumIDs", "entitlementIDs", "organizationEntitlementIDs", "personalAccessTokenIDs", "apiTokenIDs", "oauthproviderIDs", "userIDs", "inviteIDs", "subscriberIDs", "webhookIDs", "eventIDs", "secretIDs", "featureIDs", "fileIDs", "entitlementplanIDs", "entityIDs", "entitytypeIDs", "contactIDs", "noteIDs", "createOrgSettings"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "personalOrg": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrg")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrg = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "dedicatedDb": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dedicatedDb")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.DedicatedDb = data + case "parentID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentID = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + case "templateIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDs = data + case "integrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("integrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IntegrationIDs = data + case "settingID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("settingID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SettingID = data + case "documentdatumIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("documentdatumIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DocumentdatumIDs = data + case "entitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntitlementIDs = data + case "organizationEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationEntitlementIDs = data + case "personalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PersonalAccessTokenIDs = data + case "apiTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.APITokenIDs = data + case "oauthproviderIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("oauthproviderIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OauthproviderIDs = data + case "userIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDs = data + case "inviteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("inviteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.InviteIDs = data + case "subscriberIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subscriberIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SubscriberIDs = data + case "webhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("webhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.WebhookIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + case "secretIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SecretIDs = data + case "featureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDs = data + case "fileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileIDs = data + case "entitlementplanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entitlementplanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntitlementplanIDs = data + case "entityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityIDs = data + case "entitytypeIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entitytypeIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntitytypeIDs = data + case "contactIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contactIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ContactIDs = data + case "noteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("noteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.NoteIDs = data + case "createOrgSettings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createOrgSettings")) + data, err := ec.unmarshalOCreateOrganizationSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInput(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.CreateOrganizationInput().CreateOrgSettings(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateOrganizationSettingInput(ctx context.Context, obj interface{}) (generated.CreateOrganizationSettingInput, error) { + var it generated.CreateOrganizationSettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "domains", "billingContact", "billingEmail", "billingPhone", "billingAddress", "taxIdentifier", "geoLocation", "organizationID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "domains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domains")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Domains = data + case "billingContact": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContact")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContact = data + case "billingEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmail")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmail = data + case "billingPhone": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhone")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhone = data + case "billingAddress": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddress = data + case "taxIdentifier": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifier")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifier = data + case "geoLocation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocation")) + data, err := ec.unmarshalOOrganizationSettingRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, v) + if err != nil { + return it, err + } + it.GeoLocation = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreatePersonalAccessTokenInput(ctx context.Context, obj interface{}) (generated.CreatePersonalAccessTokenInput, error) { + var it generated.CreatePersonalAccessTokenInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "expiresAt", "description", "scopes", "lastUsedAt", "ownerID", "organizationIDs", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "lastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAt = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "organizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateSubscriberInput(ctx context.Context, obj interface{}) (generated.CreateSubscriberInput, error) { + var it generated.CreateSubscriberInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "email", "phoneNumber", "ownerID", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "phoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumber")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumber = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateTFASettingInput(ctx context.Context, obj interface{}) (generated.CreateTFASettingInput, error) { + var it generated.CreateTFASettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "totpAllowed", "ownerID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "totpAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("totpAllowed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.TotpAllowed = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateTemplateInput(ctx context.Context, obj interface{}) (generated.CreateTemplateInput, error) { + var it generated.CreateTemplateInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "templateType", "description", "jsonconfig", "uischema", "ownerID", "documentIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "templateType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateType")) + data, err := ec.unmarshalOTemplateDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, v) + if err != nil { + return it, err + } + it.TemplateType = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "jsonconfig": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("jsonconfig")) + data, err := ec.unmarshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, v) + if err != nil { + return it, err + } + it.Jsonconfig = data + case "uischema": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uischema")) + data, err := ec.unmarshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, v) + if err != nil { + return it, err + } + it.Uischema = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "documentIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("documentIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DocumentIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, obj interface{}) (generated.CreateUserInput, error) { + var it generated.CreateUserInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "email", "firstName", "lastName", "displayName", "avatarRemoteURL", "avatarLocalFile", "avatarUpdatedAt", "lastSeen", "password", "sub", "authProvider", "role", "personalAccessTokenIDs", "tfaSettingIDs", "settingID", "emailVerificationTokenIDs", "passwordResetTokenIDs", "groupIDs", "organizationIDs", "webauthnIDs", "fileIDs", "eventIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "firstName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstName = data + case "lastName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastName = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "avatarLocalFile": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFile")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFile = data + case "avatarUpdatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAt = data + case "lastSeen": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeen")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeen = data + case "password": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Password = data + case "sub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sub")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Sub = data + case "authProvider": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProvider")) + data, err := ec.unmarshalOUserAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, v) + if err != nil { + return it, err + } + it.AuthProvider = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOUserRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "personalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PersonalAccessTokenIDs = data + case "tfaSettingIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSettingIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TfaSettingIDs = data + case "settingID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("settingID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.SettingID = data + case "emailVerificationTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailVerificationTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailVerificationTokenIDs = data + case "passwordResetTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("passwordResetTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PasswordResetTokenIDs = data + case "groupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDs = data + case "organizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDs = data + case "webauthnIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("webauthnIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.WebauthnIDs = data + case "fileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileIDs = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateUserSettingInput(ctx context.Context, obj interface{}) (generated.CreateUserSettingInput, error) { + var it generated.CreateUserSettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "locked", "silencedAt", "suspendedAt", "status", "emailConfirmed", "isWebauthnAllowed", "isTfaEnabled", "userID", "defaultOrgID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "locked": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("locked")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Locked = data + case "silencedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAt = data + case "suspendedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAt = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOUserSettingUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "emailConfirmed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailConfirmed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EmailConfirmed = data + case "isWebauthnAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowed = data + case "isTfaEnabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabled = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "defaultOrgID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defaultOrgID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DefaultOrgID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateWebhookInput(ctx context.Context, obj interface{}) (generated.CreateWebhookInput, error) { + var it generated.CreateWebhookInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "name", "description", "destinationURL", "enabled", "failures", "lastError", "lastResponse", "ownerID", "eventIDs", "integrationIDs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "destinationURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURL")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.DestinationURL = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "failures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failures")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Failures = data + case "lastError": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastError")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastError = data + case "lastResponse": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponse")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponse = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "eventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDs = data + case "integrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("integrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.IntegrationIDs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputDocumentDataHistoryWhereInput(ctx context.Context, obj interface{}) (generated.DocumentDataHistoryWhereInput, error) { + var it generated.DocumentDataHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "templateID", "templateIDNEQ", "templateIDIn", "templateIDNotIn", "templateIDGT", "templateIDGTE", "templateIDLT", "templateIDLTE", "templateIDContains", "templateIDHasPrefix", "templateIDHasSuffix", "templateIDEqualFold", "templateIDContainsFold"} + 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.unmarshalODocumentDataHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalODocumentDataHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalODocumentDataHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalODocumentDataHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalODocumentDataHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalODocumentDataHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalODocumentDataHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "templateID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateID = data + case "templateIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDNEQ = data + case "templateIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDIn = data + case "templateIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDNotIn = data + case "templateIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDGT = data + case "templateIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDGTE = data + case "templateIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDLT = data + case "templateIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDLTE = data + case "templateIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDContains = data + case "templateIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDHasPrefix = data + case "templateIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDHasSuffix = data + case "templateIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDEqualFold = data + case "templateIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputDocumentDataWhereInput(ctx context.Context, obj interface{}) (generated.DocumentDataWhereInput, error) { + var it generated.DocumentDataWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "templateID", "templateIDNEQ", "templateIDIn", "templateIDNotIn", "templateIDGT", "templateIDGTE", "templateIDLT", "templateIDLTE", "templateIDContains", "templateIDHasPrefix", "templateIDHasSuffix", "templateIDEqualFold", "templateIDContainsFold", "hasOwner", "hasOwnerWith", "hasTemplate", "hasTemplateWith", "hasEntity", "hasEntityWith"} + 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.unmarshalODocumentDataWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalODocumentDataWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalODocumentDataWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "templateID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateID = data + case "templateIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDNEQ = data + case "templateIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDIn = data + case "templateIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDNotIn = data + case "templateIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDGT = data + case "templateIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDGTE = data + case "templateIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDLT = data + case "templateIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDLTE = data + case "templateIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDContains = data + case "templateIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDHasPrefix = data + case "templateIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDHasSuffix = data + case "templateIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDEqualFold = data + case "templateIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateIDContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasTemplate": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTemplate")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasTemplate = data + case "hasTemplateWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTemplateWith")) + data, err := ec.unmarshalOTemplateWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasTemplateWith = data + case "hasEntity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntity")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntity = data + case "hasEntityWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntityWith")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntityWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntitlementHistoryWhereInput(ctx context.Context, obj interface{}) (generated.EntitlementHistoryWhereInput, error) { + var it generated.EntitlementHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "planID", "planIDNEQ", "planIDIn", "planIDNotIn", "planIDGT", "planIDGTE", "planIDLT", "planIDLTE", "planIDContains", "planIDHasPrefix", "planIDHasSuffix", "planIDEqualFold", "planIDContainsFold", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDEqualFold", "organizationIDContainsFold", "externalCustomerID", "externalCustomerIDNEQ", "externalCustomerIDIn", "externalCustomerIDNotIn", "externalCustomerIDGT", "externalCustomerIDGTE", "externalCustomerIDLT", "externalCustomerIDLTE", "externalCustomerIDContains", "externalCustomerIDHasPrefix", "externalCustomerIDHasSuffix", "externalCustomerIDIsNil", "externalCustomerIDNotNil", "externalCustomerIDEqualFold", "externalCustomerIDContainsFold", "externalSubscriptionID", "externalSubscriptionIDNEQ", "externalSubscriptionIDIn", "externalSubscriptionIDNotIn", "externalSubscriptionIDGT", "externalSubscriptionIDGTE", "externalSubscriptionIDLT", "externalSubscriptionIDLTE", "externalSubscriptionIDContains", "externalSubscriptionIDHasPrefix", "externalSubscriptionIDHasSuffix", "externalSubscriptionIDIsNil", "externalSubscriptionIDNotNil", "externalSubscriptionIDEqualFold", "externalSubscriptionIDContainsFold", "expires", "expiresNEQ", "expiresAt", "expiresAtNEQ", "expiresAtIn", "expiresAtNotIn", "expiresAtGT", "expiresAtGTE", "expiresAtLT", "expiresAtLTE", "expiresAtIsNil", "expiresAtNotNil", "cancelled", "cancelledNEQ"} + 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.unmarshalOEntitlementHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntitlementHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntitlementHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOEntitlementHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOEntitlementHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOEntitlementHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOEntitlementHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "planID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanID = data + case "planIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDNEQ = data + case "planIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PlanIDIn = data + case "planIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PlanIDNotIn = data + case "planIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDGT = data + case "planIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDGTE = data + case "planIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDLT = data + case "planIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDLTE = data + case "planIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDContains = data + case "planIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDHasPrefix = data + case "planIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDHasSuffix = data + case "planIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDEqualFold = data + case "planIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDContainsFold = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "organizationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNEQ = data + case "organizationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDIn = data + case "organizationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNotIn = data + case "organizationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGT = data + case "organizationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGTE = data + case "organizationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLT = data + case "organizationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLTE = data + case "organizationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContains = data + case "organizationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasPrefix = data + case "organizationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasSuffix = data + case "organizationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDEqualFold = data + case "organizationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContainsFold = data + case "externalCustomerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerID = data + case "externalCustomerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDNEQ = data + case "externalCustomerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDIn = data + case "externalCustomerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDNotIn = data + case "externalCustomerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDGT = data + case "externalCustomerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDGTE = data + case "externalCustomerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDLT = data + case "externalCustomerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDLTE = data + case "externalCustomerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDContains = data + case "externalCustomerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDHasPrefix = data + case "externalCustomerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDHasSuffix = data + case "externalCustomerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDIsNil = data + case "externalCustomerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDNotNil = data + case "externalCustomerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDEqualFold = data + case "externalCustomerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDContainsFold = data + case "externalSubscriptionID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionID = data + case "externalSubscriptionIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDNEQ = data + case "externalSubscriptionIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDIn = data + case "externalSubscriptionIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDNotIn = data + case "externalSubscriptionIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDGT = data + case "externalSubscriptionIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDGTE = data + case "externalSubscriptionIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDLT = data + case "externalSubscriptionIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDLTE = data + case "externalSubscriptionIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDContains = data + case "externalSubscriptionIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDHasPrefix = data + case "externalSubscriptionIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDHasSuffix = data + case "externalSubscriptionIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDIsNil = data + case "externalSubscriptionIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDNotNil = data + case "externalSubscriptionIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDEqualFold = data + case "externalSubscriptionIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDContainsFold = data + case "expires": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Expires = data + case "expiresNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresNEQ = data + case "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "expiresAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNEQ = data + case "expiresAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIn = data + case "expiresAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotIn = data + case "expiresAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGT = data + case "expiresAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGTE = data + case "expiresAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLT = data + case "expiresAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLTE = data + case "expiresAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIsNil = data + case "expiresAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotNil = data + case "cancelled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cancelled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Cancelled = data + case "cancelledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cancelledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.CancelledNEQ = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntitlementPlanFeatureHistoryWhereInput(ctx context.Context, obj interface{}) (generated.EntitlementPlanFeatureHistoryWhereInput, error) { + var it generated.EntitlementPlanFeatureHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "planID", "planIDNEQ", "planIDIn", "planIDNotIn", "planIDGT", "planIDGTE", "planIDLT", "planIDLTE", "planIDContains", "planIDHasPrefix", "planIDHasSuffix", "planIDEqualFold", "planIDContainsFold", "featureID", "featureIDNEQ", "featureIDIn", "featureIDNotIn", "featureIDGT", "featureIDGTE", "featureIDLT", "featureIDLTE", "featureIDContains", "featureIDHasPrefix", "featureIDHasSuffix", "featureIDEqualFold", "featureIDContainsFold"} + 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.unmarshalOEntitlementPlanFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntitlementPlanFeatureHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntitlementPlanFeatureHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOEntitlementPlanFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOEntitlementPlanFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOEntitlementPlanFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOEntitlementPlanFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "planID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanID = data + case "planIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDNEQ = data + case "planIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PlanIDIn = data + case "planIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PlanIDNotIn = data + case "planIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDGT = data + case "planIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDGTE = data + case "planIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDLT = data + case "planIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDLTE = data + case "planIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDContains = data + case "planIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDHasPrefix = data + case "planIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDHasSuffix = data + case "planIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDEqualFold = data + case "planIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDContainsFold = data + case "featureID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureID = data + case "featureIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDNEQ = data + case "featureIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDIn = data + case "featureIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDNotIn = data + case "featureIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDGT = data + case "featureIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDGTE = data + case "featureIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDLT = data + case "featureIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDLTE = data + case "featureIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDContains = data + case "featureIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDHasPrefix = data + case "featureIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDHasSuffix = data + case "featureIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDEqualFold = data + case "featureIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("featureIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FeatureIDContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntitlementPlanFeatureWhereInput(ctx context.Context, obj interface{}) (generated.EntitlementPlanFeatureWhereInput, error) { + var it generated.EntitlementPlanFeatureWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold"} + 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.unmarshalOEntitlementPlanFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntitlementPlanFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntitlementPlanFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntitlementPlanHistoryWhereInput(ctx context.Context, obj interface{}) (generated.EntitlementPlanHistoryWhereInput, error) { + var it generated.EntitlementPlanHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameIsNil", "displayNameNotNil", "displayNameEqualFold", "displayNameContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "description", "descriptionNEQ", "descriptionIn", "descriptionNotIn", "descriptionGT", "descriptionGTE", "descriptionLT", "descriptionLTE", "descriptionContains", "descriptionHasPrefix", "descriptionHasSuffix", "descriptionIsNil", "descriptionNotNil", "descriptionEqualFold", "descriptionContainsFold", "version", "versionNEQ", "versionIn", "versionNotIn", "versionGT", "versionGTE", "versionLT", "versionLTE", "versionContains", "versionHasPrefix", "versionHasSuffix", "versionEqualFold", "versionContainsFold"} + 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.unmarshalOEntitlementPlanHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntitlementPlanHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntitlementPlanHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOEntitlementPlanHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOEntitlementPlanHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOEntitlementPlanHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOEntitlementPlanHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIsNil = data + case "displayNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotNil = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "descriptionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNEQ = data + case "descriptionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIn = data + case "descriptionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotIn = data + case "descriptionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGT = data + case "descriptionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGTE = data + case "descriptionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLT = data + case "descriptionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLTE = data + case "descriptionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContains = data + case "descriptionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasPrefix = data + case "descriptionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasSuffix = data + case "descriptionIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIsNil = data + case "descriptionNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotNil = data + case "descriptionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionEqualFold = data + case "descriptionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContainsFold = data + case "version": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("version")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Version = data + case "versionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionNEQ = data + case "versionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.VersionIn = data + case "versionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.VersionNotIn = data + case "versionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionGT = data + case "versionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionGTE = data + case "versionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionLT = data + case "versionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionLTE = data + case "versionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionContains = data + case "versionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionHasPrefix = data + case "versionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionHasSuffix = data + case "versionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionEqualFold = data + case "versionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntitlementPlanWhereInput(ctx context.Context, obj interface{}) (generated.EntitlementPlanWhereInput, error) { + var it generated.EntitlementPlanWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameIsNil", "displayNameNotNil", "displayNameEqualFold", "displayNameContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "description", "descriptionNEQ", "descriptionIn", "descriptionNotIn", "descriptionGT", "descriptionGTE", "descriptionLT", "descriptionLTE", "descriptionContains", "descriptionHasPrefix", "descriptionHasSuffix", "descriptionIsNil", "descriptionNotNil", "descriptionEqualFold", "descriptionContainsFold", "version", "versionNEQ", "versionIn", "versionNotIn", "versionGT", "versionGTE", "versionLT", "versionLTE", "versionContains", "versionHasPrefix", "versionHasSuffix", "versionEqualFold", "versionContainsFold", "hasOwner", "hasOwnerWith", "hasEntitlements", "hasEntitlementsWith", "hasBaseFeatures", "hasBaseFeaturesWith", "hasEvents", "hasEventsWith", "hasFeatures", "hasFeaturesWith"} + 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.unmarshalOEntitlementPlanWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntitlementPlanWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntitlementPlanWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIsNil = data + case "displayNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotNil = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "descriptionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNEQ = data + case "descriptionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIn = data + case "descriptionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotIn = data + case "descriptionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGT = data + case "descriptionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGTE = data + case "descriptionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLT = data + case "descriptionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLTE = data + case "descriptionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContains = data + case "descriptionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasPrefix = data + case "descriptionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasSuffix = data + case "descriptionIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIsNil = data + case "descriptionNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotNil = data + case "descriptionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionEqualFold = data + case "descriptionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContainsFold = data + case "version": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("version")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Version = data + case "versionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionNEQ = data + case "versionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.VersionIn = data + case "versionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.VersionNotIn = data + case "versionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionGT = data + case "versionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionGTE = data + case "versionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionLT = data + case "versionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionLTE = data + case "versionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionContains = data + case "versionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionHasPrefix = data + case "versionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionHasSuffix = data + case "versionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionEqualFold = data + case "versionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.VersionContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasEntitlements": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlements")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlements = data + case "hasEntitlementsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementsWith")) + data, err := ec.unmarshalOEntitlementWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementsWith = data + case "hasBaseFeatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasBaseFeatures")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasBaseFeatures = data + case "hasBaseFeaturesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasBaseFeaturesWith")) + data, err := ec.unmarshalOFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasBaseFeaturesWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + case "hasFeatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeatures")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFeatures = data + case "hasFeaturesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeaturesWith")) + data, err := ec.unmarshalOEntitlementPlanFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFeaturesWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntitlementWhereInput(ctx context.Context, obj interface{}) (generated.EntitlementWhereInput, error) { + var it generated.EntitlementWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "planID", "planIDNEQ", "planIDIn", "planIDNotIn", "planIDGT", "planIDGTE", "planIDLT", "planIDLTE", "planIDContains", "planIDHasPrefix", "planIDHasSuffix", "planIDEqualFold", "planIDContainsFold", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDEqualFold", "organizationIDContainsFold", "externalCustomerID", "externalCustomerIDNEQ", "externalCustomerIDIn", "externalCustomerIDNotIn", "externalCustomerIDGT", "externalCustomerIDGTE", "externalCustomerIDLT", "externalCustomerIDLTE", "externalCustomerIDContains", "externalCustomerIDHasPrefix", "externalCustomerIDHasSuffix", "externalCustomerIDIsNil", "externalCustomerIDNotNil", "externalCustomerIDEqualFold", "externalCustomerIDContainsFold", "externalSubscriptionID", "externalSubscriptionIDNEQ", "externalSubscriptionIDIn", "externalSubscriptionIDNotIn", "externalSubscriptionIDGT", "externalSubscriptionIDGTE", "externalSubscriptionIDLT", "externalSubscriptionIDLTE", "externalSubscriptionIDContains", "externalSubscriptionIDHasPrefix", "externalSubscriptionIDHasSuffix", "externalSubscriptionIDIsNil", "externalSubscriptionIDNotNil", "externalSubscriptionIDEqualFold", "externalSubscriptionIDContainsFold", "expires", "expiresNEQ", "expiresAt", "expiresAtNEQ", "expiresAtIn", "expiresAtNotIn", "expiresAtGT", "expiresAtGTE", "expiresAtLT", "expiresAtLTE", "expiresAtIsNil", "expiresAtNotNil", "cancelled", "cancelledNEQ", "hasOwner", "hasOwnerWith", "hasPlan", "hasPlanWith", "hasOrganization", "hasOrganizationWith", "hasEvents", "hasEventsWith"} + 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.unmarshalOEntitlementWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntitlementWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntitlementWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "planID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanID = data + case "planIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDNEQ = data + case "planIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PlanIDIn = data + case "planIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PlanIDNotIn = data + case "planIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDGT = data + case "planIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDGTE = data + case "planIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDLT = data + case "planIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDLTE = data + case "planIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDContains = data + case "planIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDHasPrefix = data + case "planIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDHasSuffix = data + case "planIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDEqualFold = data + case "planIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("planIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PlanIDContainsFold = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "organizationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNEQ = data + case "organizationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDIn = data + case "organizationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNotIn = data + case "organizationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGT = data + case "organizationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGTE = data + case "organizationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLT = data + case "organizationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLTE = data + case "organizationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContains = data + case "organizationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasPrefix = data + case "organizationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasSuffix = data + case "organizationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDEqualFold = data + case "organizationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContainsFold = data + case "externalCustomerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerID = data + case "externalCustomerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDNEQ = data + case "externalCustomerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDIn = data + case "externalCustomerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDNotIn = data + case "externalCustomerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDGT = data + case "externalCustomerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDGTE = data + case "externalCustomerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDLT = data + case "externalCustomerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDLTE = data + case "externalCustomerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDContains = data + case "externalCustomerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDHasPrefix = data + case "externalCustomerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDHasSuffix = data + case "externalCustomerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDIsNil = data + case "externalCustomerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDNotNil = data + case "externalCustomerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDEqualFold = data + case "externalCustomerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerIDContainsFold = data + case "externalSubscriptionID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionID = data + case "externalSubscriptionIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDNEQ = data + case "externalSubscriptionIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDIn = data + case "externalSubscriptionIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDNotIn = data + case "externalSubscriptionIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDGT = data + case "externalSubscriptionIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDGTE = data + case "externalSubscriptionIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDLT = data + case "externalSubscriptionIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDLTE = data + case "externalSubscriptionIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDContains = data + case "externalSubscriptionIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDHasPrefix = data + case "externalSubscriptionIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDHasSuffix = data + case "externalSubscriptionIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDIsNil = data + case "externalSubscriptionIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDNotNil = data + case "externalSubscriptionIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDEqualFold = data + case "externalSubscriptionIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionIDContainsFold = data + case "expires": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Expires = data + case "expiresNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresNEQ = data + case "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "expiresAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNEQ = data + case "expiresAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIn = data + case "expiresAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotIn = data + case "expiresAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGT = data + case "expiresAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGTE = data + case "expiresAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLT = data + case "expiresAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLTE = data + case "expiresAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIsNil = data + case "expiresAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotNil = data + case "cancelled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cancelled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Cancelled = data + case "cancelledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cancelledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.CancelledNEQ = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasPlan": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPlan")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPlan = data + case "hasPlanWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPlanWith")) + data, err := ec.unmarshalOEntitlementPlanWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPlanWith = data + case "hasOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganization")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganization = data + case "hasOrganizationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityHistoryOrder(ctx context.Context, obj interface{}) (generated.EntityHistoryOrder, error) { + var it generated.EntityHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNEntityHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityHistoryWhereInput(ctx context.Context, obj interface{}) (generated.EntityHistoryWhereInput, error) { + var it generated.EntityHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameIsNil", "nameNotNil", "nameEqualFold", "nameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameIsNil", "displayNameNotNil", "displayNameEqualFold", "displayNameContainsFold", "entityTypeID", "entityTypeIDNEQ", "entityTypeIDIn", "entityTypeIDNotIn", "entityTypeIDGT", "entityTypeIDGTE", "entityTypeIDLT", "entityTypeIDLTE", "entityTypeIDContains", "entityTypeIDHasPrefix", "entityTypeIDHasSuffix", "entityTypeIDIsNil", "entityTypeIDNotNil", "entityTypeIDEqualFold", "entityTypeIDContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "statusGT", "statusGTE", "statusLT", "statusLTE", "statusContains", "statusHasPrefix", "statusHasSuffix", "statusIsNil", "statusNotNil", "statusEqualFold", "statusContainsFold"} + 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.unmarshalOEntityHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntityHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntityHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOEntityHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOEntityHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOEntityHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOEntityHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "nameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.NameIsNil = data + case "nameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.NameNotNil = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIsNil = data + case "displayNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotNil = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "entityTypeID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeID = data + case "entityTypeIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDNEQ = data + case "entityTypeIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDIn = data + case "entityTypeIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDNotIn = data + case "entityTypeIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDGT = data + case "entityTypeIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDGTE = data + case "entityTypeIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDLT = data + case "entityTypeIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDLTE = data + case "entityTypeIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDContains = data + case "entityTypeIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDHasPrefix = data + case "entityTypeIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDHasSuffix = data + case "entityTypeIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDIsNil = data + case "entityTypeIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDNotNil = data + case "entityTypeIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDEqualFold = data + case "entityTypeIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusNotIn = data + case "statusGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusGT = data + case "statusGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusGTE = data + case "statusLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusLT = data + case "statusLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusLTE = data + case "statusContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusContains = data + case "statusHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusHasPrefix = data + case "statusHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusHasSuffix = data + case "statusIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.StatusIsNil = data + case "statusNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.StatusNotNil = data + case "statusEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusEqualFold = data + case "statusContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityOrder(ctx context.Context, obj interface{}) (generated.EntityOrder, error) { + var it generated.EntityOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNEntityOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityTypeHistoryOrder(ctx context.Context, obj interface{}) (generated.EntityTypeHistoryOrder, error) { + var it generated.EntityTypeHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNEntityTypeHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityTypeHistoryWhereInput(ctx context.Context, obj interface{}) (generated.EntityTypeHistoryWhereInput, error) { + var it generated.EntityTypeHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold"} + 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.unmarshalOEntityTypeHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntityTypeHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntityTypeHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOEntityTypeHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOEntityTypeHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOEntityTypeHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOEntityTypeHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityTypeOrder(ctx context.Context, obj interface{}) (generated.EntityTypeOrder, error) { + var it generated.EntityTypeOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNEntityTypeOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityTypeWhereInput(ctx context.Context, obj interface{}) (generated.EntityTypeWhereInput, error) { + var it generated.EntityTypeWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "hasOwner", "hasOwnerWith", "hasEntities", "hasEntitiesWith"} + 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.unmarshalOEntityTypeWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntityTypeWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntityTypeWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasEntities": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntities")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntities = data + case "hasEntitiesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitiesWith")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitiesWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEntityWhereInput(ctx context.Context, obj interface{}) (generated.EntityWhereInput, error) { + var it generated.EntityWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameIsNil", "nameNotNil", "nameEqualFold", "nameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameIsNil", "displayNameNotNil", "displayNameEqualFold", "displayNameContainsFold", "entityTypeID", "entityTypeIDNEQ", "entityTypeIDIn", "entityTypeIDNotIn", "entityTypeIDGT", "entityTypeIDGTE", "entityTypeIDLT", "entityTypeIDLTE", "entityTypeIDContains", "entityTypeIDHasPrefix", "entityTypeIDHasSuffix", "entityTypeIDIsNil", "entityTypeIDNotNil", "entityTypeIDEqualFold", "entityTypeIDContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "statusGT", "statusGTE", "statusLT", "statusLTE", "statusContains", "statusHasPrefix", "statusHasSuffix", "statusIsNil", "statusNotNil", "statusEqualFold", "statusContainsFold", "hasOwner", "hasOwnerWith", "hasContacts", "hasContactsWith", "hasDocuments", "hasDocumentsWith", "hasNotes", "hasNotesWith", "hasFiles", "hasFilesWith", "hasEntityType", "hasEntityTypeWith"} + 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.unmarshalOEntityWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "nameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.NameIsNil = data + case "nameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.NameNotNil = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIsNil = data + case "displayNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotNil = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "entityTypeID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeID = data + case "entityTypeIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDNEQ = data + case "entityTypeIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDIn = data + case "entityTypeIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDNotIn = data + case "entityTypeIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDGT = data + case "entityTypeIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDGTE = data + case "entityTypeIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDLT = data + case "entityTypeIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDLTE = data + case "entityTypeIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDContains = data + case "entityTypeIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDHasPrefix = data + case "entityTypeIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDHasSuffix = data + case "entityTypeIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDIsNil = data + case "entityTypeIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDNotNil = data + case "entityTypeIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDEqualFold = data + case "entityTypeIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeIDContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusNotIn = data + case "statusGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusGT = data + case "statusGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusGTE = data + case "statusLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusLT = data + case "statusLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusLTE = data + case "statusContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusContains = data + case "statusHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusHasPrefix = data + case "statusHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusHasSuffix = data + case "statusIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.StatusIsNil = data + case "statusNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.StatusNotNil = data + case "statusEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusEqualFold = data + case "statusContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StatusContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasContacts": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasContacts")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasContacts = data + case "hasContactsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasContactsWith")) + data, err := ec.unmarshalOContactWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasContactsWith = data + case "hasDocuments": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDocuments")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasDocuments = data + case "hasDocumentsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDocumentsWith")) + data, err := ec.unmarshalODocumentDataWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasDocumentsWith = data + case "hasNotes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasNotes")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasNotes = data + case "hasNotesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasNotesWith")) + data, err := ec.unmarshalONoteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasNotesWith = data + case "hasFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFiles")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFiles = data + case "hasFilesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFilesWith")) + data, err := ec.unmarshalOFileWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFilesWith = data + case "hasEntityType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntityType")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntityType = data + case "hasEntityTypeWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntityTypeWith")) + data, err := ec.unmarshalOEntityTypeWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntityTypeWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEventHistoryWhereInput(ctx context.Context, obj interface{}) (generated.EventHistoryWhereInput, error) { + var it generated.EventHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "eventID", "eventIDNEQ", "eventIDIn", "eventIDNotIn", "eventIDGT", "eventIDGTE", "eventIDLT", "eventIDLTE", "eventIDContains", "eventIDHasPrefix", "eventIDHasSuffix", "eventIDIsNil", "eventIDNotNil", "eventIDEqualFold", "eventIDContainsFold", "correlationID", "correlationIDNEQ", "correlationIDIn", "correlationIDNotIn", "correlationIDGT", "correlationIDGTE", "correlationIDLT", "correlationIDLTE", "correlationIDContains", "correlationIDHasPrefix", "correlationIDHasSuffix", "correlationIDIsNil", "correlationIDNotNil", "correlationIDEqualFold", "correlationIDContainsFold", "eventType", "eventTypeNEQ", "eventTypeIn", "eventTypeNotIn", "eventTypeGT", "eventTypeGTE", "eventTypeLT", "eventTypeLTE", "eventTypeContains", "eventTypeHasPrefix", "eventTypeHasSuffix", "eventTypeEqualFold", "eventTypeContainsFold"} + 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.unmarshalOEventHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEventHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEventHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOEventHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOEventHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOEventHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOEventHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "eventID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventID = data + case "eventIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDNEQ = data + case "eventIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDIn = data + case "eventIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDNotIn = data + case "eventIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDGT = data + case "eventIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDGTE = data + case "eventIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDLT = data + case "eventIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDLTE = data + case "eventIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDContains = data + case "eventIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDHasPrefix = data + case "eventIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDHasSuffix = data + case "eventIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EventIDIsNil = data + case "eventIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EventIDNotNil = data + case "eventIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDEqualFold = data + case "eventIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDContainsFold = data + case "correlationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationID = data + case "correlationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDNEQ = data + case "correlationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDIn = data + case "correlationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDNotIn = data + case "correlationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDGT = data + case "correlationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDGTE = data + case "correlationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDLT = data + case "correlationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDLTE = data + case "correlationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDContains = data + case "correlationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDHasPrefix = data + case "correlationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDHasSuffix = data + case "correlationIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDIsNil = data + case "correlationIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDNotNil = data + case "correlationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDEqualFold = data + case "correlationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDContainsFold = data + case "eventType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventType = data + case "eventTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeNEQ = data + case "eventTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventTypeIn = data + case "eventTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventTypeNotIn = data + case "eventTypeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeGT = data + case "eventTypeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeGTE = data + case "eventTypeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeLT = data + case "eventTypeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeLTE = data + case "eventTypeContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeContains = data + case "eventTypeHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeHasPrefix = data + case "eventTypeHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeHasSuffix = data + case "eventTypeEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeEqualFold = data + case "eventTypeContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputEventWhereInput(ctx context.Context, obj interface{}) (generated.EventWhereInput, error) { + var it generated.EventWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "eventID", "eventIDNEQ", "eventIDIn", "eventIDNotIn", "eventIDGT", "eventIDGTE", "eventIDLT", "eventIDLTE", "eventIDContains", "eventIDHasPrefix", "eventIDHasSuffix", "eventIDIsNil", "eventIDNotNil", "eventIDEqualFold", "eventIDContainsFold", "correlationID", "correlationIDNEQ", "correlationIDIn", "correlationIDNotIn", "correlationIDGT", "correlationIDGTE", "correlationIDLT", "correlationIDLTE", "correlationIDContains", "correlationIDHasPrefix", "correlationIDHasSuffix", "correlationIDIsNil", "correlationIDNotNil", "correlationIDEqualFold", "correlationIDContainsFold", "eventType", "eventTypeNEQ", "eventTypeIn", "eventTypeNotIn", "eventTypeGT", "eventTypeGTE", "eventTypeLT", "eventTypeLTE", "eventTypeContains", "eventTypeHasPrefix", "eventTypeHasSuffix", "eventTypeEqualFold", "eventTypeContainsFold", "hasUser", "hasUserWith", "hasGroup", "hasGroupWith", "hasIntegration", "hasIntegrationWith", "hasOrganization", "hasOrganizationWith", "hasInvite", "hasInviteWith", "hasFeature", "hasFeatureWith", "hasEntitlementplan", "hasEntitlementplanWith", "hasEntitlementplanfeature", "hasEntitlementplanfeatureWith", "hasPersonalAccessToken", "hasPersonalAccessTokenWith", "hasOauth2token", "hasOauth2tokenWith", "hasHush", "hasHushWith", "hasOrgmembership", "hasOrgmembershipWith", "hasGroupmembership", "hasGroupmembershipWith", "hasEntitlement", "hasEntitlementWith", "hasWebhook", "hasWebhookWith", "hasSubscriber", "hasSubscriberWith"} + 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.unmarshalOEventWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "eventID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventID = data + case "eventIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDNEQ = data + case "eventIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDIn = data + case "eventIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventIDNotIn = data + case "eventIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDGT = data + case "eventIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDGTE = data + case "eventIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDLT = data + case "eventIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDLTE = data + case "eventIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDContains = data + case "eventIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDHasPrefix = data + case "eventIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDHasSuffix = data + case "eventIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EventIDIsNil = data + case "eventIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.EventIDNotNil = data + case "eventIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDEqualFold = data + case "eventIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventIDContainsFold = data + case "correlationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationID = data + case "correlationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDNEQ = data + case "correlationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDIn = data + case "correlationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDNotIn = data + case "correlationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDGT = data + case "correlationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDGTE = data + case "correlationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDLT = data + case "correlationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDLTE = data + case "correlationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDContains = data + case "correlationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDHasPrefix = data + case "correlationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDHasSuffix = data + case "correlationIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDIsNil = data + case "correlationIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDNotNil = data + case "correlationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDEqualFold = data + case "correlationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationIDContainsFold = data + case "eventType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventType = data + case "eventTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeNEQ = data + case "eventTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventTypeIn = data + case "eventTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EventTypeNotIn = data + case "eventTypeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeGT = data + case "eventTypeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeGTE = data + case "eventTypeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeLT = data + case "eventTypeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeLTE = data + case "eventTypeContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeContains = data + case "eventTypeHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeHasPrefix = data + case "eventTypeHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeHasSuffix = data + case "eventTypeEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeEqualFold = data + case "eventTypeContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventTypeContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventTypeContainsFold = data + case "hasUser": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUser")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasUser = data + case "hasUserWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUserWith")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasUserWith = data + case "hasGroup": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroup")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGroup = data + case "hasGroupWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupWith")) + data, err := ec.unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGroupWith = data + case "hasIntegration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegration")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasIntegration = data + case "hasIntegrationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrationWith")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrationWith = data + case "hasOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganization")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganization = data + case "hasOrganizationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationWith = data + case "hasInvite": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasInvite")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasInvite = data + case "hasInviteWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasInviteWith")) + data, err := ec.unmarshalOInviteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasInviteWith = data + case "hasFeature": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeature")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFeature = data + case "hasFeatureWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeatureWith")) + data, err := ec.unmarshalOFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFeatureWith = data + case "hasEntitlementplan": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplan")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplan = data + case "hasEntitlementplanWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplanWith")) + data, err := ec.unmarshalOEntitlementPlanWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplanWith = data + case "hasEntitlementplanfeature": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplanfeature")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplanfeature = data + case "hasEntitlementplanfeatureWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplanfeatureWith")) + data, err := ec.unmarshalOEntitlementPlanFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplanfeatureWith = data + case "hasPersonalAccessToken": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPersonalAccessToken")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPersonalAccessToken = data + case "hasPersonalAccessTokenWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPersonalAccessTokenWith")) + data, err := ec.unmarshalOPersonalAccessTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPersonalAccessTokenWith = data + case "hasOauth2token": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOauth2token")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOauth2token = data + case "hasOauth2tokenWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOauth2tokenWith")) + data, err := ec.unmarshalOOhAuthTooTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOauth2tokenWith = data + case "hasHush": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasHush")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasHush = data + case "hasHushWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasHushWith")) + data, err := ec.unmarshalOHushWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasHushWith = data + case "hasOrgmembership": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrgmembership")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrgmembership = data + case "hasOrgmembershipWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrgmembershipWith")) + data, err := ec.unmarshalOOrgMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrgmembershipWith = data + case "hasGroupmembership": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupmembership")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGroupmembership = data + case "hasGroupmembershipWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupmembershipWith")) + data, err := ec.unmarshalOGroupMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGroupmembershipWith = data + case "hasEntitlement": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlement")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlement = data + case "hasEntitlementWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementWith")) + data, err := ec.unmarshalOEntitlementWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementWith = data + case "hasWebhook": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasWebhook")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasWebhook = data + case "hasWebhookWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasWebhookWith")) + data, err := ec.unmarshalOWebhookWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasWebhookWith = data + case "hasSubscriber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubscriber")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSubscriber = data + case "hasSubscriberWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubscriberWith")) + data, err := ec.unmarshalOSubscriberWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSubscriberWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFeatureHistoryWhereInput(ctx context.Context, obj interface{}) (generated.FeatureHistoryWhereInput, error) { + var it generated.FeatureHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameIsNil", "displayNameNotNil", "displayNameEqualFold", "displayNameContainsFold", "enabled", "enabledNEQ", "description", "descriptionNEQ", "descriptionIn", "descriptionNotIn", "descriptionGT", "descriptionGTE", "descriptionLT", "descriptionLTE", "descriptionContains", "descriptionHasPrefix", "descriptionHasSuffix", "descriptionIsNil", "descriptionNotNil", "descriptionEqualFold", "descriptionContainsFold"} + 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.unmarshalOFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOFeatureHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOFeatureHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIsNil = data + case "displayNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotNil = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "enabledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EnabledNEQ = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "descriptionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNEQ = data + case "descriptionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIn = data + case "descriptionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotIn = data + case "descriptionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGT = data + case "descriptionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGTE = data + case "descriptionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLT = data + case "descriptionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLTE = data + case "descriptionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContains = data + case "descriptionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasPrefix = data + case "descriptionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasSuffix = data + case "descriptionIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIsNil = data + case "descriptionNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotNil = data + case "descriptionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionEqualFold = data + case "descriptionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFeatureWhereInput(ctx context.Context, obj interface{}) (generated.FeatureWhereInput, error) { + var it generated.FeatureWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameIsNil", "displayNameNotNil", "displayNameEqualFold", "displayNameContainsFold", "enabled", "enabledNEQ", "description", "descriptionNEQ", "descriptionIn", "descriptionNotIn", "descriptionGT", "descriptionGTE", "descriptionLT", "descriptionLTE", "descriptionContains", "descriptionHasPrefix", "descriptionHasSuffix", "descriptionIsNil", "descriptionNotNil", "descriptionEqualFold", "descriptionContainsFold", "hasOwner", "hasOwnerWith", "hasPlans", "hasPlansWith", "hasEvents", "hasEventsWith", "hasFeatures", "hasFeaturesWith"} + 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.unmarshalOFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIsNil = data + case "displayNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotNil = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "enabledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EnabledNEQ = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "descriptionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNEQ = data + case "descriptionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIn = data + case "descriptionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotIn = data + case "descriptionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGT = data + case "descriptionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGTE = data + case "descriptionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLT = data + case "descriptionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLTE = data + case "descriptionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContains = data + case "descriptionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasPrefix = data + case "descriptionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasSuffix = data + case "descriptionIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIsNil = data + case "descriptionNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotNil = data + case "descriptionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionEqualFold = data + case "descriptionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasPlans": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPlans")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPlans = data + case "hasPlansWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPlansWith")) + data, err := ec.unmarshalOEntitlementPlanWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPlansWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + case "hasFeatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeatures")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFeatures = data + case "hasFeaturesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeaturesWith")) + data, err := ec.unmarshalOEntitlementPlanFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFeaturesWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFileHistoryWhereInput(ctx context.Context, obj interface{}) (generated.FileHistoryWhereInput, error) { + var it generated.FileHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "fileName", "fileNameNEQ", "fileNameIn", "fileNameNotIn", "fileNameGT", "fileNameGTE", "fileNameLT", "fileNameLTE", "fileNameContains", "fileNameHasPrefix", "fileNameHasSuffix", "fileNameEqualFold", "fileNameContainsFold", "fileExtension", "fileExtensionNEQ", "fileExtensionIn", "fileExtensionNotIn", "fileExtensionGT", "fileExtensionGTE", "fileExtensionLT", "fileExtensionLTE", "fileExtensionContains", "fileExtensionHasPrefix", "fileExtensionHasSuffix", "fileExtensionEqualFold", "fileExtensionContainsFold", "fileSize", "fileSizeNEQ", "fileSizeIn", "fileSizeNotIn", "fileSizeGT", "fileSizeGTE", "fileSizeLT", "fileSizeLTE", "fileSizeIsNil", "fileSizeNotNil", "contentType", "contentTypeNEQ", "contentTypeIn", "contentTypeNotIn", "contentTypeGT", "contentTypeGTE", "contentTypeLT", "contentTypeLTE", "contentTypeContains", "contentTypeHasPrefix", "contentTypeHasSuffix", "contentTypeEqualFold", "contentTypeContainsFold", "storeKey", "storeKeyNEQ", "storeKeyIn", "storeKeyNotIn", "storeKeyGT", "storeKeyGTE", "storeKeyLT", "storeKeyLTE", "storeKeyContains", "storeKeyHasPrefix", "storeKeyHasSuffix", "storeKeyEqualFold", "storeKeyContainsFold", "category", "categoryNEQ", "categoryIn", "categoryNotIn", "categoryGT", "categoryGTE", "categoryLT", "categoryLTE", "categoryContains", "categoryHasPrefix", "categoryHasSuffix", "categoryIsNil", "categoryNotNil", "categoryEqualFold", "categoryContainsFold", "annotation", "annotationNEQ", "annotationIn", "annotationNotIn", "annotationGT", "annotationGTE", "annotationLT", "annotationLTE", "annotationContains", "annotationHasPrefix", "annotationHasSuffix", "annotationIsNil", "annotationNotNil", "annotationEqualFold", "annotationContainsFold"} + 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.unmarshalOFileHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOFileHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOFileHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOFileHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOFileHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOFileHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOFileHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "fileName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileName = data + case "fileNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameNEQ = data + case "fileNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileNameIn = data + case "fileNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileNameNotIn = data + case "fileNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameGT = data + case "fileNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameGTE = data + case "fileNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameLT = data + case "fileNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameLTE = data + case "fileNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameContains = data + case "fileNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameHasPrefix = data + case "fileNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameHasSuffix = data + case "fileNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameEqualFold = data + case "fileNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameContainsFold = data + case "fileExtension": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtension")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtension = data + case "fileExtensionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionNEQ = data + case "fileExtensionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionIn = data + case "fileExtensionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionNotIn = data + case "fileExtensionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionGT = data + case "fileExtensionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionGTE = data + case "fileExtensionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionLT = data + case "fileExtensionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionLTE = data + case "fileExtensionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionContains = data + case "fileExtensionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionHasPrefix = data + case "fileExtensionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionHasSuffix = data + case "fileExtensionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionEqualFold = data + case "fileExtensionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionContainsFold = data + case "fileSize": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSize")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSize = data + case "fileSizeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeNEQ")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeNEQ = data + case "fileSizeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileSizeIn = data + case "fileSizeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeNotIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileSizeNotIn = data + case "fileSizeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeGT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeGT = data + case "fileSizeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeGTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeGTE = data + case "fileSizeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeLT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeLT = data + case "fileSizeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeLTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeLTE = data + case "fileSizeIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FileSizeIsNil = data + case "fileSizeNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FileSizeNotNil = data + case "contentType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentType = data + case "contentTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeNEQ = data + case "contentTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeIn = data + case "contentTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeNotIn = data + case "contentTypeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeGT = data + case "contentTypeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeGTE = data + case "contentTypeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeLT = data + case "contentTypeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeLTE = data + case "contentTypeContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeContains = data + case "contentTypeHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeHasPrefix = data + case "contentTypeHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeHasSuffix = data + case "contentTypeEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeEqualFold = data + case "contentTypeContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeContainsFold = data + case "storeKey": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKey")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKey = data + case "storeKeyNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyNEQ = data + case "storeKeyIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyIn = data + case "storeKeyNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyNotIn = data + case "storeKeyGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyGT = data + case "storeKeyGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyGTE = data + case "storeKeyLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyLT = data + case "storeKeyLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyLTE = data + case "storeKeyContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyContains = data + case "storeKeyHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyHasPrefix = data + case "storeKeyHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyHasSuffix = data + case "storeKeyEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyEqualFold = data + case "storeKeyContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyContainsFold = data + case "category": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Category = data + case "categoryNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryNEQ = data + case "categoryIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CategoryIn = data + case "categoryNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CategoryNotIn = data + case "categoryGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryGT = data + case "categoryGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryGTE = data + case "categoryLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryLT = data + case "categoryLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryLTE = data + case "categoryContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryContains = data + case "categoryHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryHasPrefix = data + case "categoryHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryHasSuffix = data + case "categoryIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CategoryIsNil = data + case "categoryNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CategoryNotNil = data + case "categoryEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryEqualFold = data + case "categoryContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryContainsFold = data + case "annotation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotation")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Annotation = data + case "annotationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationNEQ = data + case "annotationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AnnotationIn = data + case "annotationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AnnotationNotIn = data + case "annotationGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationGT = data + case "annotationGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationGTE = data + case "annotationLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationLT = data + case "annotationLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationLTE = data + case "annotationContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationContains = data + case "annotationHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationHasPrefix = data + case "annotationHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationHasSuffix = data + case "annotationIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AnnotationIsNil = data + case "annotationNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AnnotationNotNil = data + case "annotationEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationEqualFold = data + case "annotationContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFileWhereInput(ctx context.Context, obj interface{}) (generated.FileWhereInput, error) { + var it generated.FileWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "fileName", "fileNameNEQ", "fileNameIn", "fileNameNotIn", "fileNameGT", "fileNameGTE", "fileNameLT", "fileNameLTE", "fileNameContains", "fileNameHasPrefix", "fileNameHasSuffix", "fileNameEqualFold", "fileNameContainsFold", "fileExtension", "fileExtensionNEQ", "fileExtensionIn", "fileExtensionNotIn", "fileExtensionGT", "fileExtensionGTE", "fileExtensionLT", "fileExtensionLTE", "fileExtensionContains", "fileExtensionHasPrefix", "fileExtensionHasSuffix", "fileExtensionEqualFold", "fileExtensionContainsFold", "fileSize", "fileSizeNEQ", "fileSizeIn", "fileSizeNotIn", "fileSizeGT", "fileSizeGTE", "fileSizeLT", "fileSizeLTE", "fileSizeIsNil", "fileSizeNotNil", "contentType", "contentTypeNEQ", "contentTypeIn", "contentTypeNotIn", "contentTypeGT", "contentTypeGTE", "contentTypeLT", "contentTypeLTE", "contentTypeContains", "contentTypeHasPrefix", "contentTypeHasSuffix", "contentTypeEqualFold", "contentTypeContainsFold", "storeKey", "storeKeyNEQ", "storeKeyIn", "storeKeyNotIn", "storeKeyGT", "storeKeyGTE", "storeKeyLT", "storeKeyLTE", "storeKeyContains", "storeKeyHasPrefix", "storeKeyHasSuffix", "storeKeyEqualFold", "storeKeyContainsFold", "category", "categoryNEQ", "categoryIn", "categoryNotIn", "categoryGT", "categoryGTE", "categoryLT", "categoryLTE", "categoryContains", "categoryHasPrefix", "categoryHasSuffix", "categoryIsNil", "categoryNotNil", "categoryEqualFold", "categoryContainsFold", "annotation", "annotationNEQ", "annotationIn", "annotationNotIn", "annotationGT", "annotationGTE", "annotationLT", "annotationLTE", "annotationContains", "annotationHasPrefix", "annotationHasSuffix", "annotationIsNil", "annotationNotNil", "annotationEqualFold", "annotationContainsFold", "hasUser", "hasUserWith", "hasOrganization", "hasOrganizationWith", "hasEntity", "hasEntityWith", "hasGroup", "hasGroupWith"} + 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.unmarshalOFileWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOFileWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOFileWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "fileName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileName = data + case "fileNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameNEQ = data + case "fileNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileNameIn = data + case "fileNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileNameNotIn = data + case "fileNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameGT = data + case "fileNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameGTE = data + case "fileNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameLT = data + case "fileNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameLTE = data + case "fileNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameContains = data + case "fileNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameHasPrefix = data + case "fileNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameHasSuffix = data + case "fileNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameEqualFold = data + case "fileNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileNameContainsFold = data + case "fileExtension": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtension")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtension = data + case "fileExtensionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionNEQ = data + case "fileExtensionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionIn = data + case "fileExtensionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionNotIn = data + case "fileExtensionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionGT = data + case "fileExtensionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionGTE = data + case "fileExtensionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionLT = data + case "fileExtensionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionLTE = data + case "fileExtensionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionContains = data + case "fileExtensionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionHasPrefix = data + case "fileExtensionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionHasSuffix = data + case "fileExtensionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionEqualFold = data + case "fileExtensionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtensionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtensionContainsFold = data + case "fileSize": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSize")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSize = data + case "fileSizeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeNEQ")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeNEQ = data + case "fileSizeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileSizeIn = data + case "fileSizeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeNotIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FileSizeNotIn = data + case "fileSizeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeGT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeGT = data + case "fileSizeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeGTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeGTE = data + case "fileSizeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeLT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeLT = data + case "fileSizeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeLTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSizeLTE = data + case "fileSizeIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FileSizeIsNil = data + case "fileSizeNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSizeNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FileSizeNotNil = data + case "contentType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentType = data + case "contentTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeNEQ = data + case "contentTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeIn = data + case "contentTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeNotIn = data + case "contentTypeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeGT = data + case "contentTypeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeGTE = data + case "contentTypeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeLT = data + case "contentTypeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeLTE = data + case "contentTypeContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeContains = data + case "contentTypeHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeHasPrefix = data + case "contentTypeHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeHasSuffix = data + case "contentTypeEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeEqualFold = data + case "contentTypeContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentTypeContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentTypeContainsFold = data + case "storeKey": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKey")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKey = data + case "storeKeyNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyNEQ = data + case "storeKeyIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyIn = data + case "storeKeyNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyNotIn = data + case "storeKeyGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyGT = data + case "storeKeyGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyGTE = data + case "storeKeyLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyLT = data + case "storeKeyLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyLTE = data + case "storeKeyContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyContains = data + case "storeKeyHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyHasPrefix = data + case "storeKeyHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyHasSuffix = data + case "storeKeyEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyEqualFold = data + case "storeKeyContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKeyContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKeyContainsFold = data + case "category": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Category = data + case "categoryNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryNEQ = data + case "categoryIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CategoryIn = data + case "categoryNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CategoryNotIn = data + case "categoryGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryGT = data + case "categoryGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryGTE = data + case "categoryLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryLT = data + case "categoryLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryLTE = data + case "categoryContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryContains = data + case "categoryHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryHasPrefix = data + case "categoryHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryHasSuffix = data + case "categoryIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CategoryIsNil = data + case "categoryNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CategoryNotNil = data + case "categoryEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryEqualFold = data + case "categoryContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("categoryContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CategoryContainsFold = data + case "annotation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotation")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Annotation = data + case "annotationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationNEQ = data + case "annotationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AnnotationIn = data + case "annotationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AnnotationNotIn = data + case "annotationGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationGT = data + case "annotationGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationGTE = data + case "annotationLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationLT = data + case "annotationLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationLTE = data + case "annotationContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationContains = data + case "annotationHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationHasPrefix = data + case "annotationHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationHasSuffix = data + case "annotationIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AnnotationIsNil = data + case "annotationNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AnnotationNotNil = data + case "annotationEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationEqualFold = data + case "annotationContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotationContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AnnotationContainsFold = data + case "hasUser": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUser")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasUser = data + case "hasUserWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUserWith")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasUserWith = data + case "hasOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganization")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganization = data + case "hasOrganizationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationWith = data + case "hasEntity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntity")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntity = data + case "hasEntityWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntityWith")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntityWith = data + case "hasGroup": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroup")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGroup = data + case "hasGroupWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupWith")) + data, err := ec.unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGroupWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupHistoryOrder(ctx context.Context, obj interface{}) (generated.GroupHistoryOrder, error) { + var it generated.GroupHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNGroupHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupHistoryWhereInput(ctx context.Context, obj interface{}) (generated.GroupHistoryWhereInput, error) { + var it generated.GroupHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameEqualFold", "displayNameContainsFold"} + 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.unmarshalOGroupHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOGroupHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOGroupHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOGroupHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOGroupHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOGroupHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOGroupHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupMembershipHistoryWhereInput(ctx context.Context, obj interface{}) (generated.GroupMembershipHistoryWhereInput, error) { + var it generated.GroupMembershipHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "role", "roleNEQ", "roleIn", "roleNotIn", "groupID", "groupIDNEQ", "groupIDIn", "groupIDNotIn", "groupIDGT", "groupIDGTE", "groupIDLT", "groupIDLTE", "groupIDContains", "groupIDHasPrefix", "groupIDHasSuffix", "groupIDEqualFold", "groupIDContainsFold", "userID", "userIDNEQ", "userIDIn", "userIDNotIn", "userIDGT", "userIDGTE", "userIDLT", "userIDLTE", "userIDContains", "userIDHasPrefix", "userIDHasSuffix", "userIDEqualFold", "userIDContainsFold"} + 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.unmarshalOGroupMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOGroupMembershipHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOGroupMembershipHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOGroupMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOGroupMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOGroupMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOGroupMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOGroupMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "roleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ")) + data, err := ec.unmarshalOGroupMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.RoleNEQ = data + case "roleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIn")) + data, err := ec.unmarshalOGroupMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleIn = data + case "roleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotIn")) + data, err := ec.unmarshalOGroupMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleNotIn = data + case "groupID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupID = data + case "groupIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNEQ = data + case "groupIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDIn = data + case "groupIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNotIn = data + case "groupIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDGT = data + case "groupIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDGTE = data + case "groupIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDLT = data + case "groupIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDLTE = data + case "groupIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDContains = data + case "groupIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDHasPrefix = data + case "groupIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDHasSuffix = data + case "groupIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDEqualFold = data + case "groupIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDContainsFold = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "userIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDNEQ = data + case "userIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDIn = data + case "userIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDNotIn = data + case "userIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGT = data + case "userIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGTE = data + case "userIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLT = data + case "userIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLTE = data + case "userIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContains = data + case "userIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasPrefix = data + case "userIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasSuffix = data + case "userIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDEqualFold = data + case "userIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupMembershipWhereInput(ctx context.Context, obj interface{}) (generated.GroupMembershipWhereInput, error) { + var it generated.GroupMembershipWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "role", "roleNEQ", "roleIn", "roleNotIn", "groupID", "userID"} + 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.unmarshalOGroupMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOGroupMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOGroupMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOGroupMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "roleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ")) + data, err := ec.unmarshalOGroupMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.RoleNEQ = data + case "roleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIn")) + data, err := ec.unmarshalOGroupMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleIn = data + case "roleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotIn")) + data, err := ec.unmarshalOGroupMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleNotIn = data + case "groupID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupID = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupOrder(ctx context.Context, obj interface{}) (generated.GroupOrder, error) { + var it generated.GroupOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNGroupOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupSettingHistoryWhereInput(ctx context.Context, obj interface{}) (generated.GroupSettingHistoryWhereInput, error) { + var it generated.GroupSettingHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "visibility", "visibilityNEQ", "visibilityIn", "visibilityNotIn", "joinPolicy", "joinPolicyNEQ", "joinPolicyIn", "joinPolicyNotIn", "syncToSlack", "syncToSlackNEQ", "syncToSlackIsNil", "syncToSlackNotNil", "syncToGithub", "syncToGithubNEQ", "syncToGithubIsNil", "syncToGithubNotNil", "groupID", "groupIDNEQ", "groupIDIn", "groupIDNotIn", "groupIDGT", "groupIDGTE", "groupIDLT", "groupIDLTE", "groupIDContains", "groupIDHasPrefix", "groupIDHasSuffix", "groupIDIsNil", "groupIDNotNil", "groupIDEqualFold", "groupIDContainsFold"} + 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.unmarshalOGroupSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOGroupSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOGroupSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOGroupSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOGroupSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOGroupSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOGroupSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "visibility": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibility")) + data, err := ec.unmarshalOGroupSettingHistoryVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, v) + if err != nil { + return it, err + } + it.Visibility = data + case "visibilityNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibilityNEQ")) + data, err := ec.unmarshalOGroupSettingHistoryVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, v) + if err != nil { + return it, err + } + it.VisibilityNEQ = data + case "visibilityIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibilityIn")) + data, err := ec.unmarshalOGroupSettingHistoryVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx, v) + if err != nil { + return it, err + } + it.VisibilityIn = data + case "visibilityNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibilityNotIn")) + data, err := ec.unmarshalOGroupSettingHistoryVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx, v) + if err != nil { + return it, err + } + it.VisibilityNotIn = data + case "joinPolicy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicy")) + data, err := ec.unmarshalOGroupSettingHistoryJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicy = data + case "joinPolicyNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicyNEQ")) + data, err := ec.unmarshalOGroupSettingHistoryJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicyNEQ = data + case "joinPolicyIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicyIn")) + data, err := ec.unmarshalOGroupSettingHistoryJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicyIn = data + case "joinPolicyNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicyNotIn")) + data, err := ec.unmarshalOGroupSettingHistoryJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicyNotIn = data + case "syncToSlack": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlack")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlack = data + case "syncToSlackNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlackNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlackNEQ = data + case "syncToSlackIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlackIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlackIsNil = data + case "syncToSlackNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlackNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlackNotNil = data + case "syncToGithub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithub")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithub = data + case "syncToGithubNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithubNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithubNEQ = data + case "syncToGithubIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithubIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithubIsNil = data + case "syncToGithubNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithubNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithubNotNil = data + case "groupID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupID = data + case "groupIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNEQ = data + case "groupIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDIn = data + case "groupIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNotIn = data + case "groupIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDGT = data + case "groupIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDGTE = data + case "groupIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDLT = data + case "groupIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDLTE = data + case "groupIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDContains = data + case "groupIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDHasPrefix = data + case "groupIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDHasSuffix = data + case "groupIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GroupIDIsNil = data + case "groupIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNotNil = data + case "groupIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDEqualFold = data + case "groupIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupSettingWhereInput(ctx context.Context, obj interface{}) (generated.GroupSettingWhereInput, error) { + var it generated.GroupSettingWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "visibility", "visibilityNEQ", "visibilityIn", "visibilityNotIn", "joinPolicy", "joinPolicyNEQ", "joinPolicyIn", "joinPolicyNotIn", "syncToSlack", "syncToSlackNEQ", "syncToSlackIsNil", "syncToSlackNotNil", "syncToGithub", "syncToGithubNEQ", "syncToGithubIsNil", "syncToGithubNotNil", "groupID", "groupIDNEQ", "groupIDIn", "groupIDNotIn", "groupIDGT", "groupIDGTE", "groupIDLT", "groupIDLTE", "groupIDContains", "groupIDHasPrefix", "groupIDHasSuffix", "groupIDIsNil", "groupIDNotNil", "groupIDEqualFold", "groupIDContainsFold", "hasGroup", "hasGroupWith"} + 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.unmarshalOGroupSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOGroupSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOGroupSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "visibility": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibility")) + data, err := ec.unmarshalOGroupSettingVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, v) + if err != nil { + return it, err + } + it.Visibility = data + case "visibilityNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibilityNEQ")) + data, err := ec.unmarshalOGroupSettingVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, v) + if err != nil { + return it, err + } + it.VisibilityNEQ = data + case "visibilityIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibilityIn")) + data, err := ec.unmarshalOGroupSettingVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx, v) + if err != nil { + return it, err + } + it.VisibilityIn = data + case "visibilityNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibilityNotIn")) + data, err := ec.unmarshalOGroupSettingVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx, v) + if err != nil { + return it, err + } + it.VisibilityNotIn = data + case "joinPolicy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicy")) + data, err := ec.unmarshalOGroupSettingJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicy = data + case "joinPolicyNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicyNEQ")) + data, err := ec.unmarshalOGroupSettingJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicyNEQ = data + case "joinPolicyIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicyIn")) + data, err := ec.unmarshalOGroupSettingJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicyIn = data + case "joinPolicyNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicyNotIn")) + data, err := ec.unmarshalOGroupSettingJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicyNotIn = data + case "syncToSlack": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlack")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlack = data + case "syncToSlackNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlackNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlackNEQ = data + case "syncToSlackIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlackIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlackIsNil = data + case "syncToSlackNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlackNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlackNotNil = data + case "syncToGithub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithub")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithub = data + case "syncToGithubNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithubNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithubNEQ = data + case "syncToGithubIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithubIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithubIsNil = data + case "syncToGithubNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithubNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithubNotNil = data + case "groupID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupID = data + case "groupIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNEQ = data + case "groupIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDIn = data + case "groupIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNotIn = data + case "groupIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDGT = data + case "groupIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDGTE = data + case "groupIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDLT = data + case "groupIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDLTE = data + case "groupIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDContains = data + case "groupIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDHasPrefix = data + case "groupIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDHasSuffix = data + case "groupIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GroupIDIsNil = data + case "groupIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GroupIDNotNil = data + case "groupIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDEqualFold = data + case "groupIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupIDContainsFold = data + case "hasGroup": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroup")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGroup = data + case "hasGroupWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupWith")) + data, err := ec.unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGroupWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGroupWhereInput(ctx context.Context, obj interface{}) (generated.GroupWhereInput, error) { + var it generated.GroupWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameEqualFold", "displayNameContainsFold", "hasOwner", "hasOwnerWith", "hasSetting", "hasSettingWith", "hasUsers", "hasUsersWith", "hasEvents", "hasEventsWith", "hasIntegrations", "hasIntegrationsWith", "hasFiles", "hasFilesWith", "hasMembers", "hasMembersWith"} + 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.unmarshalOGroupWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasSetting": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSetting")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSetting = data + case "hasSettingWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSettingWith")) + data, err := ec.unmarshalOGroupSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSettingWith = data + case "hasUsers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUsers")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasUsers = data + case "hasUsersWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUsersWith")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasUsersWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + case "hasIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrations")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrations = data + case "hasIntegrationsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrationsWith")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrationsWith = data + case "hasFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFiles")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFiles = data + case "hasFilesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFilesWith")) + data, err := ec.unmarshalOFileWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFilesWith = data + case "hasMembers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasMembers")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasMembers = data + case "hasMembersWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasMembersWith")) + data, err := ec.unmarshalOGroupMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasMembersWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputHushHistoryOrder(ctx context.Context, obj interface{}) (generated.HushHistoryOrder, error) { + var it generated.HushHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNHushHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputHushHistoryWhereInput(ctx context.Context, obj interface{}) (generated.HushHistoryWhereInput, error) { + var it generated.HushHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "kind", "kindNEQ", "kindIn", "kindNotIn", "kindGT", "kindGTE", "kindLT", "kindLTE", "kindContains", "kindHasPrefix", "kindHasSuffix", "kindIsNil", "kindNotNil", "kindEqualFold", "kindContainsFold", "secretName", "secretNameNEQ", "secretNameIn", "secretNameNotIn", "secretNameGT", "secretNameGTE", "secretNameLT", "secretNameLTE", "secretNameContains", "secretNameHasPrefix", "secretNameHasSuffix", "secretNameIsNil", "secretNameNotNil", "secretNameEqualFold", "secretNameContainsFold"} + 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.unmarshalOHushHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOHushHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOHushHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOHushHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOHushHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOHushHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOHushHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = 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 "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "kindNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindNEQ = data + case "kindIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindIn = data + case "kindNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindNotIn = data + case "kindGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGT = data + case "kindGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGTE = data + case "kindLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLT = data + case "kindLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLTE = data + case "kindContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContains = data + case "kindHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasPrefix = data + case "kindHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasSuffix = data + case "kindIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindIsNil = data + case "kindNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindNotNil = data + case "kindEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindEqualFold = data + case "kindContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContainsFold = data + case "secretName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretName = data + case "secretNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameNEQ = data + case "secretNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SecretNameIn = data + case "secretNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SecretNameNotIn = data + case "secretNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameGT = data + case "secretNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameGTE = data + case "secretNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameLT = data + case "secretNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameLTE = data + case "secretNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameContains = data + case "secretNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameHasPrefix = data + case "secretNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameHasSuffix = data + case "secretNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SecretNameIsNil = data + case "secretNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SecretNameNotNil = data + case "secretNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameEqualFold = data + case "secretNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputHushOrder(ctx context.Context, obj interface{}) (generated.HushOrder, error) { + var it generated.HushOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNHushOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputHushWhereInput(ctx context.Context, obj interface{}) (generated.HushWhereInput, error) { + var it generated.HushWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "kind", "kindNEQ", "kindIn", "kindNotIn", "kindGT", "kindGTE", "kindLT", "kindLTE", "kindContains", "kindHasPrefix", "kindHasSuffix", "kindIsNil", "kindNotNil", "kindEqualFold", "kindContainsFold", "secretName", "secretNameNEQ", "secretNameIn", "secretNameNotIn", "secretNameGT", "secretNameGTE", "secretNameLT", "secretNameLTE", "secretNameContains", "secretNameHasPrefix", "secretNameHasSuffix", "secretNameIsNil", "secretNameNotNil", "secretNameEqualFold", "secretNameContainsFold", "hasIntegrations", "hasIntegrationsWith", "hasOrganization", "hasOrganizationWith", "hasEvents", "hasEventsWith"} + 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.unmarshalOHushWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOHushWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOHushWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = 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 "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "kindNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindNEQ = data + case "kindIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindIn = data + case "kindNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindNotIn = data + case "kindGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGT = data + case "kindGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGTE = data + case "kindLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLT = data + case "kindLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLTE = data + case "kindContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContains = data + case "kindHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasPrefix = data + case "kindHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasSuffix = data + case "kindIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindIsNil = data + case "kindNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindNotNil = data + case "kindEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindEqualFold = data + case "kindContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContainsFold = data + case "secretName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretName = data + case "secretNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameNEQ = data + case "secretNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SecretNameIn = data + case "secretNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SecretNameNotIn = data + case "secretNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameGT = data + case "secretNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameGTE = data + case "secretNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameLT = data + case "secretNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameLTE = data + case "secretNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameContains = data + case "secretNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameHasPrefix = data + case "secretNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameHasSuffix = data + case "secretNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SecretNameIsNil = data + case "secretNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SecretNameNotNil = data + case "secretNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameEqualFold = data + case "secretNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SecretNameContainsFold = data + case "hasIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrations")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrations = data + case "hasIntegrationsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrationsWith")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrationsWith = data + case "hasOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganization")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganization = data + case "hasOrganizationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputIntegrationHistoryOrder(ctx context.Context, obj interface{}) (generated.IntegrationHistoryOrder, error) { + var it generated.IntegrationHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNIntegrationHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputIntegrationHistoryWhereInput(ctx context.Context, obj interface{}) (generated.IntegrationHistoryWhereInput, error) { + var it generated.IntegrationHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "kind", "kindNEQ", "kindIn", "kindNotIn", "kindGT", "kindGTE", "kindLT", "kindLTE", "kindContains", "kindHasPrefix", "kindHasSuffix", "kindIsNil", "kindNotNil", "kindEqualFold", "kindContainsFold"} + 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.unmarshalOIntegrationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOIntegrationHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOIntegrationHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOIntegrationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOIntegrationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOIntegrationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOIntegrationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "kindNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindNEQ = data + case "kindIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindIn = data + case "kindNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindNotIn = data + case "kindGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGT = data + case "kindGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGTE = data + case "kindLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLT = data + case "kindLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLTE = data + case "kindContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContains = data + case "kindHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasPrefix = data + case "kindHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasSuffix = data + case "kindIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindIsNil = data + case "kindNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindNotNil = data + case "kindEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindEqualFold = data + case "kindContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputIntegrationOrder(ctx context.Context, obj interface{}) (generated.IntegrationOrder, error) { + var it generated.IntegrationOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNIntegrationOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputIntegrationWhereInput(ctx context.Context, obj interface{}) (generated.IntegrationWhereInput, error) { + var it generated.IntegrationWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "kind", "kindNEQ", "kindIn", "kindNotIn", "kindGT", "kindGTE", "kindLT", "kindLTE", "kindContains", "kindHasPrefix", "kindHasSuffix", "kindIsNil", "kindNotNil", "kindEqualFold", "kindContainsFold", "hasOwner", "hasOwnerWith", "hasSecrets", "hasSecretsWith", "hasOauth2tokens", "hasOauth2tokensWith", "hasEvents", "hasEventsWith", "hasWebhooks", "hasWebhooksWith"} + 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.unmarshalOIntegrationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "kindNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindNEQ = data + case "kindIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindIn = data + case "kindNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.KindNotIn = data + case "kindGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGT = data + case "kindGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindGTE = data + case "kindLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLT = data + case "kindLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindLTE = data + case "kindContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContains = data + case "kindHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasPrefix = data + case "kindHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindHasSuffix = data + case "kindIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindIsNil = data + case "kindNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.KindNotNil = data + case "kindEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindEqualFold = data + case "kindContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kindContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.KindContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasSecrets": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSecrets")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSecrets = data + case "hasSecretsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSecretsWith")) + data, err := ec.unmarshalOHushWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSecretsWith = data + case "hasOauth2tokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOauth2tokens")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOauth2tokens = data + case "hasOauth2tokensWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOauth2tokensWith")) + data, err := ec.unmarshalOOhAuthTooTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOauth2tokensWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + case "hasWebhooks": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasWebhooks")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasWebhooks = data + case "hasWebhooksWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasWebhooksWith")) + data, err := ec.unmarshalOWebhookWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasWebhooksWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputInviteWhereInput(ctx context.Context, obj interface{}) (generated.InviteWhereInput, error) { + var it generated.InviteWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "expires", "expiresNEQ", "expiresIn", "expiresNotIn", "expiresGT", "expiresGTE", "expiresLT", "expiresLTE", "expiresIsNil", "expiresNotNil", "recipient", "recipientNEQ", "recipientIn", "recipientNotIn", "recipientGT", "recipientGTE", "recipientLT", "recipientLTE", "recipientContains", "recipientHasPrefix", "recipientHasSuffix", "recipientEqualFold", "recipientContainsFold", "status", "statusNEQ", "statusIn", "statusNotIn", "role", "roleNEQ", "roleIn", "roleNotIn", "sendAttempts", "sendAttemptsNEQ", "sendAttemptsIn", "sendAttemptsNotIn", "sendAttemptsGT", "sendAttemptsGTE", "sendAttemptsLT", "sendAttemptsLTE", "requestorID", "requestorIDNEQ", "requestorIDIn", "requestorIDNotIn", "requestorIDGT", "requestorIDGTE", "requestorIDLT", "requestorIDLTE", "requestorIDContains", "requestorIDHasPrefix", "requestorIDHasSuffix", "requestorIDIsNil", "requestorIDNotNil", "requestorIDEqualFold", "requestorIDContainsFold", "hasOwner", "hasOwnerWith", "hasEvents", "hasEventsWith"} + 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.unmarshalOInviteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOInviteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOInviteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "expires": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Expires = data + case "expiresNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresNEQ = data + case "expiresIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresIn = data + case "expiresNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresNotIn = data + case "expiresGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresGT = data + case "expiresGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresGTE = data + case "expiresLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresLT = data + case "expiresLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresLTE = data + case "expiresIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresIsNil = data + case "expiresNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresNotNil = data + case "recipient": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipient")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Recipient = data + case "recipientNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientNEQ = data + case "recipientIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RecipientIn = data + case "recipientNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RecipientNotIn = data + case "recipientGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientGT = data + case "recipientGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientGTE = data + case "recipientLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientLT = data + case "recipientLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientLTE = data + case "recipientContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientContains = data + case "recipientHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientHasPrefix = data + case "recipientHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientHasSuffix = data + case "recipientEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientEqualFold = data + case "recipientContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recipientContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecipientContainsFold = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOInviteInviteStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOInviteInviteStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx, v) + if err != nil { + return it, err + } + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOInviteInviteStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOInviteInviteStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusNotIn = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOInviteRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "roleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ")) + data, err := ec.unmarshalOInviteRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.RoleNEQ = data + case "roleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIn")) + data, err := ec.unmarshalOInviteRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleIn = data + case "roleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotIn")) + data, err := ec.unmarshalOInviteRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleNotIn = data + case "sendAttempts": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttempts")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttempts = data + case "sendAttemptsNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttemptsNEQ")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttemptsNEQ = data + case "sendAttemptsIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttemptsIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.SendAttemptsIn = data + case "sendAttemptsNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttemptsNotIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.SendAttemptsNotIn = data + case "sendAttemptsGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttemptsGT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttemptsGT = data + case "sendAttemptsGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttemptsGTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttemptsGTE = data + case "sendAttemptsLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttemptsLT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttemptsLT = data + case "sendAttemptsLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttemptsLTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttemptsLTE = data + case "requestorID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorID = data + case "requestorIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDNEQ = data + case "requestorIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDIn = data + case "requestorIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDNotIn = data + case "requestorIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDGT = data + case "requestorIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDGTE = data + case "requestorIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDLT = data + case "requestorIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDLTE = data + case "requestorIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDContains = data + case "requestorIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDHasPrefix = data + case "requestorIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDHasSuffix = data + case "requestorIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDIsNil = data + case "requestorIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDNotNil = data + case "requestorIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDEqualFold = data + case "requestorIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestorIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RequestorIDContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNoteHistoryWhereInput(ctx context.Context, obj interface{}) (generated.NoteHistoryWhereInput, error) { + var it generated.NoteHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold"} + 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.unmarshalONoteHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalONoteHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalONoteHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalONoteHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalONoteHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalONoteHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalONoteHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "textNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextNEQ = data + case "textIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextIn = data + case "textNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextNotIn = data + case "textGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGT = data + case "textGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGTE = data + case "textLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLT = data + case "textLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLTE = data + case "textContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContains = data + case "textHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasPrefix = data + case "textHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasSuffix = data + case "textEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextEqualFold = data + case "textContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNoteWhereInput(ctx context.Context, obj interface{}) (generated.NoteWhereInput, error) { + var it generated.NoteWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "text", "textNEQ", "textIn", "textNotIn", "textGT", "textGTE", "textLT", "textLTE", "textContains", "textHasPrefix", "textHasSuffix", "textEqualFold", "textContainsFold", "hasOwner", "hasOwnerWith", "hasEntity", "hasEntityWith"} + 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.unmarshalONoteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalONoteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalONoteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "textNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextNEQ = data + case "textIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextIn = data + case "textNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TextNotIn = data + case "textGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGT = data + case "textGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextGTE = data + case "textLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLT = data + case "textLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextLTE = data + case "textContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContains = data + case "textHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasPrefix = data + case "textHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextHasSuffix = data + case "textEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextEqualFold = data + case "textContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("textContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TextContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasEntity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntity")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntity = data + case "hasEntityWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntityWith")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntityWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOauthProviderHistoryWhereInput(ctx context.Context, obj interface{}) (generated.OauthProviderHistoryWhereInput, error) { + var it generated.OauthProviderHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "clientID", "clientIDNEQ", "clientIDIn", "clientIDNotIn", "clientIDGT", "clientIDGTE", "clientIDLT", "clientIDLTE", "clientIDContains", "clientIDHasPrefix", "clientIDHasSuffix", "clientIDEqualFold", "clientIDContainsFold", "clientSecret", "clientSecretNEQ", "clientSecretIn", "clientSecretNotIn", "clientSecretGT", "clientSecretGTE", "clientSecretLT", "clientSecretLTE", "clientSecretContains", "clientSecretHasPrefix", "clientSecretHasSuffix", "clientSecretEqualFold", "clientSecretContainsFold", "redirectURL", "redirectURLNEQ", "redirectURLIn", "redirectURLNotIn", "redirectURLGT", "redirectURLGTE", "redirectURLLT", "redirectURLLTE", "redirectURLContains", "redirectURLHasPrefix", "redirectURLHasSuffix", "redirectURLEqualFold", "redirectURLContainsFold", "scopes", "scopesNEQ", "scopesIn", "scopesNotIn", "scopesGT", "scopesGTE", "scopesLT", "scopesLTE", "scopesContains", "scopesHasPrefix", "scopesHasSuffix", "scopesEqualFold", "scopesContainsFold", "authURL", "authURLNEQ", "authURLIn", "authURLNotIn", "authURLGT", "authURLGTE", "authURLLT", "authURLLTE", "authURLContains", "authURLHasPrefix", "authURLHasSuffix", "authURLEqualFold", "authURLContainsFold", "tokenURL", "tokenURLNEQ", "tokenURLIn", "tokenURLNotIn", "tokenURLGT", "tokenURLGTE", "tokenURLLT", "tokenURLLTE", "tokenURLContains", "tokenURLHasPrefix", "tokenURLHasSuffix", "tokenURLEqualFold", "tokenURLContainsFold", "authStyle", "authStyleNEQ", "authStyleIn", "authStyleNotIn", "authStyleGT", "authStyleGTE", "authStyleLT", "authStyleLTE", "infoURL", "infoURLNEQ", "infoURLIn", "infoURLNotIn", "infoURLGT", "infoURLGTE", "infoURLLT", "infoURLLTE", "infoURLContains", "infoURLHasPrefix", "infoURLHasSuffix", "infoURLEqualFold", "infoURLContainsFold"} + 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.unmarshalOOauthProviderHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOauthProviderHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOauthProviderHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOOauthProviderHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOOauthProviderHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOOauthProviderHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOOauthProviderHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "clientID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientID = data + case "clientIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDNEQ = data + case "clientIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientIDIn = data + case "clientIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientIDNotIn = data + case "clientIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDGT = data + case "clientIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDGTE = data + case "clientIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDLT = data + case "clientIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDLTE = data + case "clientIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDContains = data + case "clientIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDHasPrefix = data + case "clientIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDHasSuffix = data + case "clientIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDEqualFold = data + case "clientIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDContainsFold = data + case "clientSecret": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecret")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecret = data + case "clientSecretNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretNEQ = data + case "clientSecretIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretIn = data + case "clientSecretNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretNotIn = data + case "clientSecretGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretGT = data + case "clientSecretGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretGTE = data + case "clientSecretLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretLT = data + case "clientSecretLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretLTE = data + case "clientSecretContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretContains = data + case "clientSecretHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretHasPrefix = data + case "clientSecretHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretHasSuffix = data + case "clientSecretEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretEqualFold = data + case "clientSecretContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretContainsFold = data + case "redirectURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURL = data + case "redirectURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLNEQ = data + case "redirectURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLIn = data + case "redirectURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLNotIn = data + case "redirectURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLGT = data + case "redirectURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLGTE = data + case "redirectURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLLT = data + case "redirectURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLLTE = data + case "redirectURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLContains = data + case "redirectURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLHasPrefix = data + case "redirectURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLHasSuffix = data + case "redirectURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLEqualFold = data + case "redirectURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLContainsFold = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "scopesNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesNEQ = data + case "scopesIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ScopesIn = data + case "scopesNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ScopesNotIn = data + case "scopesGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesGT = data + case "scopesGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesGTE = data + case "scopesLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesLT = data + case "scopesLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesLTE = data + case "scopesContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesContains = data + case "scopesHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesHasPrefix = data + case "scopesHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesHasSuffix = data + case "scopesEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesEqualFold = data + case "scopesContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesContainsFold = data + case "authURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURL = data + case "authURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLNEQ = data + case "authURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthURLIn = data + case "authURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthURLNotIn = data + case "authURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLGT = data + case "authURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLGTE = data + case "authURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLLT = data + case "authURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLLTE = data + case "authURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLContains = data + case "authURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLHasPrefix = data + case "authURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLHasSuffix = data + case "authURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLEqualFold = data + case "authURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLContainsFold = data + case "tokenURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURL = data + case "tokenURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLNEQ = data + case "tokenURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TokenURLIn = data + case "tokenURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TokenURLNotIn = data + case "tokenURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLGT = data + case "tokenURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLGTE = data + case "tokenURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLLT = data + case "tokenURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLLTE = data + case "tokenURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLContains = data + case "tokenURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLHasPrefix = data + case "tokenURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLHasSuffix = data + case "tokenURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLEqualFold = data + case "tokenURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLContainsFold = data + case "authStyle": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyle")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyle = data + case "authStyleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleNEQ")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleNEQ = data + case "authStyleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleIn")) + data, err := ec.unmarshalOUint2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8ᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleIn = data + case "authStyleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleNotIn")) + data, err := ec.unmarshalOUint2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8ᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleNotIn = data + case "authStyleGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleGT")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleGT = data + case "authStyleGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleGTE")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleGTE = data + case "authStyleLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleLT")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleLT = data + case "authStyleLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleLTE")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleLTE = data + case "infoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURL = data + case "infoURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLNEQ = data + case "infoURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.InfoURLIn = data + case "infoURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.InfoURLNotIn = data + case "infoURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLGT = data + case "infoURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLGTE = data + case "infoURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLLT = data + case "infoURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLLTE = data + case "infoURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLContains = data + case "infoURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLHasPrefix = data + case "infoURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLHasSuffix = data + case "infoURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLEqualFold = data + case "infoURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOauthProviderWhereInput(ctx context.Context, obj interface{}) (generated.OauthProviderWhereInput, error) { + var it generated.OauthProviderWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "clientID", "clientIDNEQ", "clientIDIn", "clientIDNotIn", "clientIDGT", "clientIDGTE", "clientIDLT", "clientIDLTE", "clientIDContains", "clientIDHasPrefix", "clientIDHasSuffix", "clientIDEqualFold", "clientIDContainsFold", "clientSecret", "clientSecretNEQ", "clientSecretIn", "clientSecretNotIn", "clientSecretGT", "clientSecretGTE", "clientSecretLT", "clientSecretLTE", "clientSecretContains", "clientSecretHasPrefix", "clientSecretHasSuffix", "clientSecretEqualFold", "clientSecretContainsFold", "redirectURL", "redirectURLNEQ", "redirectURLIn", "redirectURLNotIn", "redirectURLGT", "redirectURLGTE", "redirectURLLT", "redirectURLLTE", "redirectURLContains", "redirectURLHasPrefix", "redirectURLHasSuffix", "redirectURLEqualFold", "redirectURLContainsFold", "scopes", "scopesNEQ", "scopesIn", "scopesNotIn", "scopesGT", "scopesGTE", "scopesLT", "scopesLTE", "scopesContains", "scopesHasPrefix", "scopesHasSuffix", "scopesEqualFold", "scopesContainsFold", "authURL", "authURLNEQ", "authURLIn", "authURLNotIn", "authURLGT", "authURLGTE", "authURLLT", "authURLLTE", "authURLContains", "authURLHasPrefix", "authURLHasSuffix", "authURLEqualFold", "authURLContainsFold", "tokenURL", "tokenURLNEQ", "tokenURLIn", "tokenURLNotIn", "tokenURLGT", "tokenURLGTE", "tokenURLLT", "tokenURLLTE", "tokenURLContains", "tokenURLHasPrefix", "tokenURLHasSuffix", "tokenURLEqualFold", "tokenURLContainsFold", "authStyle", "authStyleNEQ", "authStyleIn", "authStyleNotIn", "authStyleGT", "authStyleGTE", "authStyleLT", "authStyleLTE", "infoURL", "infoURLNEQ", "infoURLIn", "infoURLNotIn", "infoURLGT", "infoURLGTE", "infoURLLT", "infoURLLTE", "infoURLContains", "infoURLHasPrefix", "infoURLHasSuffix", "infoURLEqualFold", "infoURLContainsFold", "hasOwner", "hasOwnerWith"} + 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.unmarshalOOauthProviderWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOauthProviderWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOauthProviderWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "clientID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientID = data + case "clientIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDNEQ = data + case "clientIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientIDIn = data + case "clientIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientIDNotIn = data + case "clientIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDGT = data + case "clientIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDGTE = data + case "clientIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDLT = data + case "clientIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDLTE = data + case "clientIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDContains = data + case "clientIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDHasPrefix = data + case "clientIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDHasSuffix = data + case "clientIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDEqualFold = data + case "clientIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDContainsFold = data + case "clientSecret": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecret")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecret = data + case "clientSecretNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretNEQ = data + case "clientSecretIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretIn = data + case "clientSecretNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretNotIn = data + case "clientSecretGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretGT = data + case "clientSecretGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretGTE = data + case "clientSecretLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretLT = data + case "clientSecretLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretLTE = data + case "clientSecretContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretContains = data + case "clientSecretHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretHasPrefix = data + case "clientSecretHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretHasSuffix = data + case "clientSecretEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretEqualFold = data + case "clientSecretContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecretContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecretContainsFold = data + case "redirectURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURL = data + case "redirectURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLNEQ = data + case "redirectURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLIn = data + case "redirectURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLNotIn = data + case "redirectURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLGT = data + case "redirectURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLGTE = data + case "redirectURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLLT = data + case "redirectURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLLTE = data + case "redirectURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLContains = data + case "redirectURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLHasPrefix = data + case "redirectURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLHasSuffix = data + case "redirectURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLEqualFold = data + case "redirectURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURLContainsFold = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "scopesNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesNEQ = data + case "scopesIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ScopesIn = data + case "scopesNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ScopesNotIn = data + case "scopesGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesGT = data + case "scopesGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesGTE = data + case "scopesLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesLT = data + case "scopesLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesLTE = data + case "scopesContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesContains = data + case "scopesHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesHasPrefix = data + case "scopesHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesHasSuffix = data + case "scopesEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesEqualFold = data + case "scopesContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopesContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ScopesContainsFold = data + case "authURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURL = data + case "authURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLNEQ = data + case "authURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthURLIn = data + case "authURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthURLNotIn = data + case "authURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLGT = data + case "authURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLGTE = data + case "authURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLLT = data + case "authURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLLTE = data + case "authURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLContains = data + case "authURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLHasPrefix = data + case "authURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLHasSuffix = data + case "authURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLEqualFold = data + case "authURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURLContainsFold = data + case "tokenURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURL = data + case "tokenURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLNEQ = data + case "tokenURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TokenURLIn = data + case "tokenURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TokenURLNotIn = data + case "tokenURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLGT = data + case "tokenURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLGTE = data + case "tokenURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLLT = data + case "tokenURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLLTE = data + case "tokenURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLContains = data + case "tokenURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLHasPrefix = data + case "tokenURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLHasSuffix = data + case "tokenURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLEqualFold = data + case "tokenURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURLContainsFold = data + case "authStyle": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyle")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyle = data + case "authStyleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleNEQ")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleNEQ = data + case "authStyleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleIn")) + data, err := ec.unmarshalOUint2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8ᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleIn = data + case "authStyleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleNotIn")) + data, err := ec.unmarshalOUint2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8ᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleNotIn = data + case "authStyleGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleGT")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleGT = data + case "authStyleGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleGTE")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleGTE = data + case "authStyleLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleLT")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleLT = data + case "authStyleLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyleLTE")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyleLTE = data + case "infoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURL = data + case "infoURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLNEQ = data + case "infoURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.InfoURLIn = data + case "infoURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.InfoURLNotIn = data + case "infoURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLGT = data + case "infoURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLGTE = data + case "infoURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLLT = data + case "infoURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLLTE = data + case "infoURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLContains = data + case "infoURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLHasPrefix = data + case "infoURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLHasSuffix = data + case "infoURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLEqualFold = data + case "infoURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURLContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOhAuthTooTokenWhereInput(ctx context.Context, obj interface{}) (generated.OhAuthTooTokenWhereInput, error) { + var it generated.OhAuthTooTokenWhereInput + 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", "idEqualFold", "idContainsFold", "clientID", "clientIDNEQ", "clientIDIn", "clientIDNotIn", "clientIDGT", "clientIDGTE", "clientIDLT", "clientIDLTE", "clientIDContains", "clientIDHasPrefix", "clientIDHasSuffix", "clientIDEqualFold", "clientIDContainsFold", "nonce", "nonceNEQ", "nonceIn", "nonceNotIn", "nonceGT", "nonceGTE", "nonceLT", "nonceLTE", "nonceContains", "nonceHasPrefix", "nonceHasSuffix", "nonceEqualFold", "nonceContainsFold", "claimsUserID", "claimsUserIDNEQ", "claimsUserIDIn", "claimsUserIDNotIn", "claimsUserIDGT", "claimsUserIDGTE", "claimsUserIDLT", "claimsUserIDLTE", "claimsUserIDContains", "claimsUserIDHasPrefix", "claimsUserIDHasSuffix", "claimsUserIDEqualFold", "claimsUserIDContainsFold", "claimsUsername", "claimsUsernameNEQ", "claimsUsernameIn", "claimsUsernameNotIn", "claimsUsernameGT", "claimsUsernameGTE", "claimsUsernameLT", "claimsUsernameLTE", "claimsUsernameContains", "claimsUsernameHasPrefix", "claimsUsernameHasSuffix", "claimsUsernameEqualFold", "claimsUsernameContainsFold", "claimsEmail", "claimsEmailNEQ", "claimsEmailIn", "claimsEmailNotIn", "claimsEmailGT", "claimsEmailGTE", "claimsEmailLT", "claimsEmailLTE", "claimsEmailContains", "claimsEmailHasPrefix", "claimsEmailHasSuffix", "claimsEmailEqualFold", "claimsEmailContainsFold", "claimsEmailVerified", "claimsEmailVerifiedNEQ", "claimsPreferredUsername", "claimsPreferredUsernameNEQ", "claimsPreferredUsernameIn", "claimsPreferredUsernameNotIn", "claimsPreferredUsernameGT", "claimsPreferredUsernameGTE", "claimsPreferredUsernameLT", "claimsPreferredUsernameLTE", "claimsPreferredUsernameContains", "claimsPreferredUsernameHasPrefix", "claimsPreferredUsernameHasSuffix", "claimsPreferredUsernameEqualFold", "claimsPreferredUsernameContainsFold", "connectorID", "connectorIDNEQ", "connectorIDIn", "connectorIDNotIn", "connectorIDGT", "connectorIDGTE", "connectorIDLT", "connectorIDLTE", "connectorIDContains", "connectorIDHasPrefix", "connectorIDHasSuffix", "connectorIDEqualFold", "connectorIDContainsFold", "lastUsed", "lastUsedNEQ", "lastUsedIn", "lastUsedNotIn", "lastUsedGT", "lastUsedGTE", "lastUsedLT", "lastUsedLTE", "hasIntegration", "hasIntegrationWith", "hasEvents", "hasEventsWith"} + 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.unmarshalOOhAuthTooTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOhAuthTooTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOhAuthTooTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "clientID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientID = data + case "clientIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDNEQ = data + case "clientIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientIDIn = data + case "clientIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClientIDNotIn = data + case "clientIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDGT = data + case "clientIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDGTE = data + case "clientIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDLT = data + case "clientIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDLTE = data + case "clientIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDContains = data + case "clientIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDHasPrefix = data + case "clientIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDHasSuffix = data + case "clientIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDEqualFold = data + case "clientIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientIDContainsFold = data + case "nonce": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonce")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Nonce = data + case "nonceNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceNEQ = data + case "nonceIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.NonceIn = data + case "nonceNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.NonceNotIn = data + case "nonceGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceGT = data + case "nonceGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceGTE = data + case "nonceLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceLT = data + case "nonceLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceLTE = data + case "nonceContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceContains = data + case "nonceHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceHasPrefix = data + case "nonceHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceHasSuffix = data + case "nonceEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceEqualFold = data + case "nonceContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonceContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.NonceContainsFold = data + case "claimsUserID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserID = data + case "claimsUserIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDNEQ = data + case "claimsUserIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDIn = data + case "claimsUserIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDNotIn = data + case "claimsUserIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDGT = data + case "claimsUserIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDGTE = data + case "claimsUserIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDLT = data + case "claimsUserIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDLTE = data + case "claimsUserIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDContains = data + case "claimsUserIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDHasPrefix = data + case "claimsUserIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDHasSuffix = data + case "claimsUserIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDEqualFold = data + case "claimsUserIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserIDContainsFold = data + case "claimsUsername": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsername")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsername = data + case "claimsUsernameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameNEQ = data + case "claimsUsernameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameIn = data + case "claimsUsernameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameNotIn = data + case "claimsUsernameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameGT = data + case "claimsUsernameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameGTE = data + case "claimsUsernameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameLT = data + case "claimsUsernameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameLTE = data + case "claimsUsernameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameContains = data + case "claimsUsernameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameHasPrefix = data + case "claimsUsernameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameHasSuffix = data + case "claimsUsernameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameEqualFold = data + case "claimsUsernameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsernameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsernameContainsFold = data + case "claimsEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmail")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmail = data + case "claimsEmailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailNEQ = data + case "claimsEmailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailIn = data + case "claimsEmailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailNotIn = data + case "claimsEmailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailGT = data + case "claimsEmailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailGTE = data + case "claimsEmailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailLT = data + case "claimsEmailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailLTE = data + case "claimsEmailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailContains = data + case "claimsEmailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailHasPrefix = data + case "claimsEmailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailHasSuffix = data + case "claimsEmailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailEqualFold = data + case "claimsEmailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailContainsFold = data + case "claimsEmailVerified": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailVerified")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailVerified = data + case "claimsEmailVerifiedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailVerifiedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailVerifiedNEQ = data + case "claimsPreferredUsername": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsername")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsername = data + case "claimsPreferredUsernameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameNEQ = data + case "claimsPreferredUsernameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameIn = data + case "claimsPreferredUsernameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameNotIn = data + case "claimsPreferredUsernameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameGT = data + case "claimsPreferredUsernameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameGTE = data + case "claimsPreferredUsernameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameLT = data + case "claimsPreferredUsernameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameLTE = data + case "claimsPreferredUsernameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameContains = data + case "claimsPreferredUsernameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameHasPrefix = data + case "claimsPreferredUsernameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameHasSuffix = data + case "claimsPreferredUsernameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameEqualFold = data + case "claimsPreferredUsernameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsernameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsernameContainsFold = data + case "connectorID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorID = data + case "connectorIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDNEQ = data + case "connectorIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDIn = data + case "connectorIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDNotIn = data + case "connectorIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDGT = data + case "connectorIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDGTE = data + case "connectorIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDLT = data + case "connectorIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDLTE = data + case "connectorIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDContains = data + case "connectorIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDHasPrefix = data + case "connectorIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDHasSuffix = data + case "connectorIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDEqualFold = data + case "connectorIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorIDContainsFold = data + case "lastUsed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsed")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsed = data + case "lastUsedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedNEQ = data + case "lastUsedIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastUsedIn = data + case "lastUsedNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastUsedNotIn = data + case "lastUsedGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedGT = data + case "lastUsedGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedGTE = data + case "lastUsedLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedLT = data + case "lastUsedLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedLTE = data + case "hasIntegration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegration")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasIntegration = data + case "hasIntegrationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrationWith")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrationWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrgMembershipHistoryWhereInput(ctx context.Context, obj interface{}) (generated.OrgMembershipHistoryWhereInput, error) { + var it generated.OrgMembershipHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "role", "roleNEQ", "roleIn", "roleNotIn", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDEqualFold", "organizationIDContainsFold", "userID", "userIDNEQ", "userIDIn", "userIDNotIn", "userIDGT", "userIDGTE", "userIDLT", "userIDLTE", "userIDContains", "userIDHasPrefix", "userIDHasSuffix", "userIDEqualFold", "userIDContainsFold"} + 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.unmarshalOOrgMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOrgMembershipHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOrgMembershipHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOOrgMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOOrgMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOOrgMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOOrgMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOOrgMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "roleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ")) + data, err := ec.unmarshalOOrgMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.RoleNEQ = data + case "roleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIn")) + data, err := ec.unmarshalOOrgMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleIn = data + case "roleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotIn")) + data, err := ec.unmarshalOOrgMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleNotIn = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "organizationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNEQ = data + case "organizationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDIn = data + case "organizationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNotIn = data + case "organizationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGT = data + case "organizationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGTE = data + case "organizationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLT = data + case "organizationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLTE = data + case "organizationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContains = data + case "organizationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasPrefix = data + case "organizationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasSuffix = data + case "organizationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDEqualFold = data + case "organizationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContainsFold = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "userIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDNEQ = data + case "userIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDIn = data + case "userIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDNotIn = data + case "userIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGT = data + case "userIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGTE = data + case "userIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLT = data + case "userIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLTE = data + case "userIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContains = data + case "userIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasPrefix = data + case "userIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasSuffix = data + case "userIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDEqualFold = data + case "userIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrgMembershipWhereInput(ctx context.Context, obj interface{}) (generated.OrgMembershipWhereInput, error) { + var it generated.OrgMembershipWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "role", "roleNEQ", "roleIn", "roleNotIn", "organizationID", "userID"} + 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.unmarshalOOrgMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOrgMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOrgMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOOrgMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "roleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ")) + data, err := ec.unmarshalOOrgMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.RoleNEQ = data + case "roleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIn")) + data, err := ec.unmarshalOOrgMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleIn = data + case "roleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotIn")) + data, err := ec.unmarshalOOrgMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleNotIn = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrganizationHistoryOrder(ctx context.Context, obj interface{}) (generated.OrganizationHistoryOrder, error) { + var it generated.OrganizationHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNOrganizationHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrganizationHistoryWhereInput(ctx context.Context, obj interface{}) (generated.OrganizationHistoryWhereInput, error) { + var it generated.OrganizationHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameEqualFold", "displayNameContainsFold", "parentOrganizationID", "parentOrganizationIDNEQ", "parentOrganizationIDIn", "parentOrganizationIDNotIn", "parentOrganizationIDGT", "parentOrganizationIDGTE", "parentOrganizationIDLT", "parentOrganizationIDLTE", "parentOrganizationIDContains", "parentOrganizationIDHasPrefix", "parentOrganizationIDHasSuffix", "parentOrganizationIDIsNil", "parentOrganizationIDNotNil", "parentOrganizationIDEqualFold", "parentOrganizationIDContainsFold", "personalOrg", "personalOrgNEQ", "personalOrgIsNil", "personalOrgNotNil", "avatarRemoteURL", "avatarRemoteURLNEQ", "avatarRemoteURLIn", "avatarRemoteURLNotIn", "avatarRemoteURLGT", "avatarRemoteURLGTE", "avatarRemoteURLLT", "avatarRemoteURLLTE", "avatarRemoteURLContains", "avatarRemoteURLHasPrefix", "avatarRemoteURLHasSuffix", "avatarRemoteURLIsNil", "avatarRemoteURLNotNil", "avatarRemoteURLEqualFold", "avatarRemoteURLContainsFold"} + 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.unmarshalOOrganizationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOrganizationHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOrganizationHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOOrganizationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOOrganizationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOOrganizationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOOrganizationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "parentOrganizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationID = data + case "parentOrganizationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDNEQ = data + case "parentOrganizationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDIn = data + case "parentOrganizationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDNotIn = data + case "parentOrganizationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDGT = data + case "parentOrganizationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDGTE = data + case "parentOrganizationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDLT = data + case "parentOrganizationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDLTE = data + case "parentOrganizationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDContains = data + case "parentOrganizationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDHasPrefix = data + case "parentOrganizationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDHasSuffix = data + case "parentOrganizationIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDIsNil = data + case "parentOrganizationIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDNotNil = data + case "parentOrganizationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDEqualFold = data + case "parentOrganizationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDContainsFold = data + case "personalOrg": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrg")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrg = data + case "personalOrgNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrgNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrgNEQ = data + case "personalOrgIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrgIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrgIsNil = data + case "personalOrgNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrgNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrgNotNil = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "avatarRemoteURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNEQ = data + case "avatarRemoteURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIn = data + case "avatarRemoteURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotIn = data + case "avatarRemoteURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGT = data + case "avatarRemoteURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGTE = data + case "avatarRemoteURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLT = data + case "avatarRemoteURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLTE = data + case "avatarRemoteURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContains = data + case "avatarRemoteURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasPrefix = data + case "avatarRemoteURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasSuffix = data + case "avatarRemoteURLIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIsNil = data + case "avatarRemoteURLNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotNil = data + case "avatarRemoteURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLEqualFold = data + case "avatarRemoteURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrganizationOrder(ctx context.Context, obj interface{}) (generated.OrganizationOrder, error) { + var it generated.OrganizationOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNOrganizationOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrganizationSettingHistoryWhereInput(ctx context.Context, obj interface{}) (generated.OrganizationSettingHistoryWhereInput, error) { + var it generated.OrganizationSettingHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "billingContact", "billingContactNEQ", "billingContactIn", "billingContactNotIn", "billingContactGT", "billingContactGTE", "billingContactLT", "billingContactLTE", "billingContactContains", "billingContactHasPrefix", "billingContactHasSuffix", "billingContactIsNil", "billingContactNotNil", "billingContactEqualFold", "billingContactContainsFold", "billingEmail", "billingEmailNEQ", "billingEmailIn", "billingEmailNotIn", "billingEmailGT", "billingEmailGTE", "billingEmailLT", "billingEmailLTE", "billingEmailContains", "billingEmailHasPrefix", "billingEmailHasSuffix", "billingEmailIsNil", "billingEmailNotNil", "billingEmailEqualFold", "billingEmailContainsFold", "billingPhone", "billingPhoneNEQ", "billingPhoneIn", "billingPhoneNotIn", "billingPhoneGT", "billingPhoneGTE", "billingPhoneLT", "billingPhoneLTE", "billingPhoneContains", "billingPhoneHasPrefix", "billingPhoneHasSuffix", "billingPhoneIsNil", "billingPhoneNotNil", "billingPhoneEqualFold", "billingPhoneContainsFold", "billingAddress", "billingAddressNEQ", "billingAddressIn", "billingAddressNotIn", "billingAddressGT", "billingAddressGTE", "billingAddressLT", "billingAddressLTE", "billingAddressContains", "billingAddressHasPrefix", "billingAddressHasSuffix", "billingAddressIsNil", "billingAddressNotNil", "billingAddressEqualFold", "billingAddressContainsFold", "taxIdentifier", "taxIdentifierNEQ", "taxIdentifierIn", "taxIdentifierNotIn", "taxIdentifierGT", "taxIdentifierGTE", "taxIdentifierLT", "taxIdentifierLTE", "taxIdentifierContains", "taxIdentifierHasPrefix", "taxIdentifierHasSuffix", "taxIdentifierIsNil", "taxIdentifierNotNil", "taxIdentifierEqualFold", "taxIdentifierContainsFold", "geoLocation", "geoLocationNEQ", "geoLocationIn", "geoLocationNotIn", "geoLocationIsNil", "geoLocationNotNil", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDIsNil", "organizationIDNotNil", "organizationIDEqualFold", "organizationIDContainsFold"} + 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.unmarshalOOrganizationSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOrganizationSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOrganizationSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOOrganizationSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOOrganizationSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOOrganizationSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOOrganizationSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "billingContact": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContact")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContact = data + case "billingContactNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactNEQ = data + case "billingContactIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingContactIn = data + case "billingContactNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingContactNotIn = data + case "billingContactGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactGT = data + case "billingContactGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactGTE = data + case "billingContactLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactLT = data + case "billingContactLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactLTE = data + case "billingContactContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactContains = data + case "billingContactHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactHasPrefix = data + case "billingContactHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactHasSuffix = data + case "billingContactIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingContactIsNil = data + case "billingContactNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingContactNotNil = data + case "billingContactEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactEqualFold = data + case "billingContactContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactContainsFold = data + case "billingEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmail")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmail = data + case "billingEmailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailNEQ = data + case "billingEmailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailIn = data + case "billingEmailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailNotIn = data + case "billingEmailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailGT = data + case "billingEmailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailGTE = data + case "billingEmailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailLT = data + case "billingEmailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailLTE = data + case "billingEmailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailContains = data + case "billingEmailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailHasPrefix = data + case "billingEmailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailHasSuffix = data + case "billingEmailIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailIsNil = data + case "billingEmailNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailNotNil = data + case "billingEmailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailEqualFold = data + case "billingEmailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailContainsFold = data + case "billingPhone": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhone")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhone = data + case "billingPhoneNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneNEQ = data + case "billingPhoneIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneIn = data + case "billingPhoneNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneNotIn = data + case "billingPhoneGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneGT = data + case "billingPhoneGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneGTE = data + case "billingPhoneLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneLT = data + case "billingPhoneLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneLTE = data + case "billingPhoneContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneContains = data + case "billingPhoneHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneHasPrefix = data + case "billingPhoneHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneHasSuffix = data + case "billingPhoneIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneIsNil = data + case "billingPhoneNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneNotNil = data + case "billingPhoneEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneEqualFold = data + case "billingPhoneContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneContainsFold = data + case "billingAddress": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddress = data + case "billingAddressNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressNEQ = data + case "billingAddressIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressIn = data + case "billingAddressNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressNotIn = data + case "billingAddressGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressGT = data + case "billingAddressGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressGTE = data + case "billingAddressLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressLT = data + case "billingAddressLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressLTE = data + case "billingAddressContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressContains = data + case "billingAddressHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressHasPrefix = data + case "billingAddressHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressHasSuffix = data + case "billingAddressIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressIsNil = data + case "billingAddressNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressNotNil = data + case "billingAddressEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressEqualFold = data + case "billingAddressContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressContainsFold = data + case "taxIdentifier": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifier")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifier = data + case "taxIdentifierNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierNEQ = data + case "taxIdentifierIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierIn = data + case "taxIdentifierNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierNotIn = data + case "taxIdentifierGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierGT = data + case "taxIdentifierGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierGTE = data + case "taxIdentifierLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierLT = data + case "taxIdentifierLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierLTE = data + case "taxIdentifierContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierContains = data + case "taxIdentifierHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierHasPrefix = data + case "taxIdentifierHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierHasSuffix = data + case "taxIdentifierIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierIsNil = data + case "taxIdentifierNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierNotNil = data + case "taxIdentifierEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierEqualFold = data + case "taxIdentifierContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierContainsFold = data + case "geoLocation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocation")) + data, err := ec.unmarshalOOrganizationSettingHistoryRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, v) + if err != nil { + return it, err + } + it.GeoLocation = data + case "geoLocationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationNEQ")) + data, err := ec.unmarshalOOrganizationSettingHistoryRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationNEQ = data + case "geoLocationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationIn")) + data, err := ec.unmarshalOOrganizationSettingHistoryRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationIn = data + case "geoLocationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationNotIn")) + data, err := ec.unmarshalOOrganizationSettingHistoryRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationNotIn = data + case "geoLocationIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationIsNil = data + case "geoLocationNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationNotNil = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "organizationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNEQ = data + case "organizationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDIn = data + case "organizationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNotIn = data + case "organizationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGT = data + case "organizationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGTE = data + case "organizationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLT = data + case "organizationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLTE = data + case "organizationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContains = data + case "organizationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasPrefix = data + case "organizationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasSuffix = data + case "organizationIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDIsNil = data + case "organizationIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNotNil = data + case "organizationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDEqualFold = data + case "organizationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrganizationSettingWhereInput(ctx context.Context, obj interface{}) (generated.OrganizationSettingWhereInput, error) { + var it generated.OrganizationSettingWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "billingContact", "billingContactNEQ", "billingContactIn", "billingContactNotIn", "billingContactGT", "billingContactGTE", "billingContactLT", "billingContactLTE", "billingContactContains", "billingContactHasPrefix", "billingContactHasSuffix", "billingContactIsNil", "billingContactNotNil", "billingContactEqualFold", "billingContactContainsFold", "billingEmail", "billingEmailNEQ", "billingEmailIn", "billingEmailNotIn", "billingEmailGT", "billingEmailGTE", "billingEmailLT", "billingEmailLTE", "billingEmailContains", "billingEmailHasPrefix", "billingEmailHasSuffix", "billingEmailIsNil", "billingEmailNotNil", "billingEmailEqualFold", "billingEmailContainsFold", "billingPhone", "billingPhoneNEQ", "billingPhoneIn", "billingPhoneNotIn", "billingPhoneGT", "billingPhoneGTE", "billingPhoneLT", "billingPhoneLTE", "billingPhoneContains", "billingPhoneHasPrefix", "billingPhoneHasSuffix", "billingPhoneIsNil", "billingPhoneNotNil", "billingPhoneEqualFold", "billingPhoneContainsFold", "billingAddress", "billingAddressNEQ", "billingAddressIn", "billingAddressNotIn", "billingAddressGT", "billingAddressGTE", "billingAddressLT", "billingAddressLTE", "billingAddressContains", "billingAddressHasPrefix", "billingAddressHasSuffix", "billingAddressIsNil", "billingAddressNotNil", "billingAddressEqualFold", "billingAddressContainsFold", "taxIdentifier", "taxIdentifierNEQ", "taxIdentifierIn", "taxIdentifierNotIn", "taxIdentifierGT", "taxIdentifierGTE", "taxIdentifierLT", "taxIdentifierLTE", "taxIdentifierContains", "taxIdentifierHasPrefix", "taxIdentifierHasSuffix", "taxIdentifierIsNil", "taxIdentifierNotNil", "taxIdentifierEqualFold", "taxIdentifierContainsFold", "geoLocation", "geoLocationNEQ", "geoLocationIn", "geoLocationNotIn", "geoLocationIsNil", "geoLocationNotNil", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDIsNil", "organizationIDNotNil", "organizationIDEqualFold", "organizationIDContainsFold", "hasOrganization", "hasOrganizationWith"} + 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.unmarshalOOrganizationSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOrganizationSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOrganizationSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "billingContact": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContact")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContact = data + case "billingContactNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactNEQ = data + case "billingContactIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingContactIn = data + case "billingContactNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingContactNotIn = data + case "billingContactGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactGT = data + case "billingContactGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactGTE = data + case "billingContactLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactLT = data + case "billingContactLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactLTE = data + case "billingContactContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactContains = data + case "billingContactHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactHasPrefix = data + case "billingContactHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactHasSuffix = data + case "billingContactIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingContactIsNil = data + case "billingContactNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingContactNotNil = data + case "billingContactEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactEqualFold = data + case "billingContactContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContactContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContactContainsFold = data + case "billingEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmail")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmail = data + case "billingEmailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailNEQ = data + case "billingEmailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailIn = data + case "billingEmailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailNotIn = data + case "billingEmailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailGT = data + case "billingEmailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailGTE = data + case "billingEmailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailLT = data + case "billingEmailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailLTE = data + case "billingEmailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailContains = data + case "billingEmailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailHasPrefix = data + case "billingEmailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailHasSuffix = data + case "billingEmailIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailIsNil = data + case "billingEmailNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailNotNil = data + case "billingEmailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailEqualFold = data + case "billingEmailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmailContainsFold = data + case "billingPhone": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhone")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhone = data + case "billingPhoneNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneNEQ = data + case "billingPhoneIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneIn = data + case "billingPhoneNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneNotIn = data + case "billingPhoneGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneGT = data + case "billingPhoneGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneGTE = data + case "billingPhoneLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneLT = data + case "billingPhoneLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneLTE = data + case "billingPhoneContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneContains = data + case "billingPhoneHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneHasPrefix = data + case "billingPhoneHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneHasSuffix = data + case "billingPhoneIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneIsNil = data + case "billingPhoneNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneNotNil = data + case "billingPhoneEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneEqualFold = data + case "billingPhoneContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhoneContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhoneContainsFold = data + case "billingAddress": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddress = data + case "billingAddressNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressNEQ = data + case "billingAddressIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressIn = data + case "billingAddressNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressNotIn = data + case "billingAddressGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressGT = data + case "billingAddressGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressGTE = data + case "billingAddressLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressLT = data + case "billingAddressLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressLTE = data + case "billingAddressContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressContains = data + case "billingAddressHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressHasPrefix = data + case "billingAddressHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressHasSuffix = data + case "billingAddressIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressIsNil = data + case "billingAddressNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressNotNil = data + case "billingAddressEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressEqualFold = data + case "billingAddressContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddressContainsFold = data + case "taxIdentifier": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifier")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifier = data + case "taxIdentifierNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierNEQ = data + case "taxIdentifierIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierIn = data + case "taxIdentifierNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierNotIn = data + case "taxIdentifierGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierGT = data + case "taxIdentifierGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierGTE = data + case "taxIdentifierLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierLT = data + case "taxIdentifierLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierLTE = data + case "taxIdentifierContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierContains = data + case "taxIdentifierHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierHasPrefix = data + case "taxIdentifierHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierHasSuffix = data + case "taxIdentifierIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierIsNil = data + case "taxIdentifierNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierNotNil = data + case "taxIdentifierEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierEqualFold = data + case "taxIdentifierContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifierContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifierContainsFold = data + case "geoLocation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocation")) + data, err := ec.unmarshalOOrganizationSettingRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, v) + if err != nil { + return it, err + } + it.GeoLocation = data + case "geoLocationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationNEQ")) + data, err := ec.unmarshalOOrganizationSettingRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationNEQ = data + case "geoLocationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationIn")) + data, err := ec.unmarshalOOrganizationSettingRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationIn = data + case "geoLocationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationNotIn")) + data, err := ec.unmarshalOOrganizationSettingRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationNotIn = data + case "geoLocationIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationIsNil = data + case "geoLocationNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocationNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.GeoLocationNotNil = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "organizationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNEQ = data + case "organizationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDIn = data + case "organizationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNotIn = data + case "organizationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGT = data + case "organizationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDGTE = data + case "organizationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLT = data + case "organizationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDLTE = data + case "organizationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContains = data + case "organizationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasPrefix = data + case "organizationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDHasSuffix = data + case "organizationIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDIsNil = data + case "organizationIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDNotNil = data + case "organizationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDEqualFold = data + case "organizationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationIDContainsFold = data + case "hasOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganization")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganization = data + case "hasOrganizationWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOrganizationWhereInput(ctx context.Context, obj interface{}) (generated.OrganizationWhereInput, error) { + var it generated.OrganizationWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameEqualFold", "displayNameContainsFold", "parentOrganizationID", "parentOrganizationIDNEQ", "parentOrganizationIDIn", "parentOrganizationIDNotIn", "parentOrganizationIDGT", "parentOrganizationIDGTE", "parentOrganizationIDLT", "parentOrganizationIDLTE", "parentOrganizationIDContains", "parentOrganizationIDHasPrefix", "parentOrganizationIDHasSuffix", "parentOrganizationIDIsNil", "parentOrganizationIDNotNil", "parentOrganizationIDEqualFold", "parentOrganizationIDContainsFold", "personalOrg", "personalOrgNEQ", "personalOrgIsNil", "personalOrgNotNil", "avatarRemoteURL", "avatarRemoteURLNEQ", "avatarRemoteURLIn", "avatarRemoteURLNotIn", "avatarRemoteURLGT", "avatarRemoteURLGTE", "avatarRemoteURLLT", "avatarRemoteURLLTE", "avatarRemoteURLContains", "avatarRemoteURLHasPrefix", "avatarRemoteURLHasSuffix", "avatarRemoteURLIsNil", "avatarRemoteURLNotNil", "avatarRemoteURLEqualFold", "avatarRemoteURLContainsFold", "hasParent", "hasParentWith", "hasChildren", "hasChildrenWith", "hasGroups", "hasGroupsWith", "hasTemplates", "hasTemplatesWith", "hasIntegrations", "hasIntegrationsWith", "hasSetting", "hasSettingWith", "hasDocumentdata", "hasDocumentdataWith", "hasEntitlements", "hasEntitlementsWith", "hasOrganizationEntitlement", "hasOrganizationEntitlementWith", "hasPersonalAccessTokens", "hasPersonalAccessTokensWith", "hasAPITokens", "hasAPITokensWith", "hasOauthprovider", "hasOauthproviderWith", "hasUsers", "hasUsersWith", "hasInvites", "hasInvitesWith", "hasSubscribers", "hasSubscribersWith", "hasWebhooks", "hasWebhooksWith", "hasEvents", "hasEventsWith", "hasSecrets", "hasSecretsWith", "hasFeatures", "hasFeaturesWith", "hasFiles", "hasFilesWith", "hasEntitlementplans", "hasEntitlementplansWith", "hasEntitlementplanfeatures", "hasEntitlementplanfeaturesWith", "hasEntities", "hasEntitiesWith", "hasEntitytypes", "hasEntitytypesWith", "hasContacts", "hasContactsWith", "hasNotes", "hasNotesWith", "hasMembers", "hasMembersWith"} + 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.unmarshalOOrganizationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "parentOrganizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationID = data + case "parentOrganizationIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDNEQ = data + case "parentOrganizationIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDIn = data + case "parentOrganizationIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDNotIn = data + case "parentOrganizationIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDGT = data + case "parentOrganizationIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDGTE = data + case "parentOrganizationIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDLT = data + case "parentOrganizationIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDLTE = data + case "parentOrganizationIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDContains = data + case "parentOrganizationIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDHasPrefix = data + case "parentOrganizationIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDHasSuffix = data + case "parentOrganizationIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDIsNil = data + case "parentOrganizationIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDNotNil = data + case "parentOrganizationIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDEqualFold = data + case "parentOrganizationIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("parentOrganizationIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ParentOrganizationIDContainsFold = data + case "personalOrg": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrg")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrg = data + case "personalOrgNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrgNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrgNEQ = data + case "personalOrgIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrgIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrgIsNil = data + case "personalOrgNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("personalOrgNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PersonalOrgNotNil = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "avatarRemoteURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNEQ = data + case "avatarRemoteURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIn = data + case "avatarRemoteURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotIn = data + case "avatarRemoteURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGT = data + case "avatarRemoteURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGTE = data + case "avatarRemoteURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLT = data + case "avatarRemoteURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLTE = data + case "avatarRemoteURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContains = data + case "avatarRemoteURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasPrefix = data + case "avatarRemoteURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasSuffix = data + case "avatarRemoteURLIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIsNil = data + case "avatarRemoteURLNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotNil = data + case "avatarRemoteURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLEqualFold = data + case "avatarRemoteURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContainsFold = data + case "hasParent": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasParent")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasParent = data + case "hasParentWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasParentWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasParentWith = data + case "hasChildren": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasChildren")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasChildren = data + case "hasChildrenWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasChildrenWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasChildrenWith = data + case "hasGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroups")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGroups = data + case "hasGroupsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupsWith")) + data, err := ec.unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGroupsWith = data + case "hasTemplates": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTemplates")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasTemplates = data + case "hasTemplatesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTemplatesWith")) + data, err := ec.unmarshalOTemplateWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasTemplatesWith = data + case "hasIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrations")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrations = data + case "hasIntegrationsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrationsWith")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrationsWith = data + case "hasSetting": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSetting")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSetting = data + case "hasSettingWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSettingWith")) + data, err := ec.unmarshalOOrganizationSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSettingWith = data + case "hasDocumentdata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDocumentdata")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasDocumentdata = data + case "hasDocumentdataWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDocumentdataWith")) + data, err := ec.unmarshalODocumentDataWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasDocumentdataWith = data + case "hasEntitlements": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlements")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlements = data + case "hasEntitlementsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementsWith")) + data, err := ec.unmarshalOEntitlementWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementsWith = data + case "hasOrganizationEntitlement": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationEntitlement")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationEntitlement = data + case "hasOrganizationEntitlementWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationEntitlementWith")) + data, err := ec.unmarshalOEntitlementWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationEntitlementWith = data + case "hasPersonalAccessTokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPersonalAccessTokens")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPersonalAccessTokens = data + case "hasPersonalAccessTokensWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPersonalAccessTokensWith")) + data, err := ec.unmarshalOPersonalAccessTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPersonalAccessTokensWith = data + case "hasAPITokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAPITokens")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasAPITokens = data + case "hasAPITokensWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasAPITokensWith")) + data, err := ec.unmarshalOAPITokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasAPITokensWith = data + case "hasOauthprovider": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOauthprovider")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOauthprovider = data + case "hasOauthproviderWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOauthproviderWith")) + data, err := ec.unmarshalOOauthProviderWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOauthproviderWith = data + case "hasUsers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUsers")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasUsers = data + case "hasUsersWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUsersWith")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasUsersWith = data + case "hasInvites": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasInvites")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasInvites = data + case "hasInvitesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasInvitesWith")) + data, err := ec.unmarshalOInviteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasInvitesWith = data + case "hasSubscribers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubscribers")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSubscribers = data + case "hasSubscribersWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSubscribersWith")) + data, err := ec.unmarshalOSubscriberWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSubscribersWith = data + case "hasWebhooks": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasWebhooks")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasWebhooks = data + case "hasWebhooksWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasWebhooksWith")) + data, err := ec.unmarshalOWebhookWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasWebhooksWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + case "hasSecrets": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSecrets")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSecrets = data + case "hasSecretsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSecretsWith")) + data, err := ec.unmarshalOHushWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSecretsWith = data + case "hasFeatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeatures")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFeatures = data + case "hasFeaturesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFeaturesWith")) + data, err := ec.unmarshalOFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFeaturesWith = data + case "hasFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFiles")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFiles = data + case "hasFilesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFilesWith")) + data, err := ec.unmarshalOFileWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFilesWith = data + case "hasEntitlementplans": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplans")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplans = data + case "hasEntitlementplansWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplansWith")) + data, err := ec.unmarshalOEntitlementPlanWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplansWith = data + case "hasEntitlementplanfeatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplanfeatures")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplanfeatures = data + case "hasEntitlementplanfeaturesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitlementplanfeaturesWith")) + data, err := ec.unmarshalOEntitlementPlanFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitlementplanfeaturesWith = data + case "hasEntities": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntities")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntities = data + case "hasEntitiesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitiesWith")) + data, err := ec.unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitiesWith = data + case "hasEntitytypes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitytypes")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEntitytypes = data + case "hasEntitytypesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEntitytypesWith")) + data, err := ec.unmarshalOEntityTypeWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEntitytypesWith = data + case "hasContacts": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasContacts")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasContacts = data + case "hasContactsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasContactsWith")) + data, err := ec.unmarshalOContactWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasContactsWith = data + case "hasNotes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasNotes")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasNotes = data + case "hasNotesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasNotesWith")) + data, err := ec.unmarshalONoteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasNotesWith = data + case "hasMembers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasMembers")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasMembers = data + case "hasMembersWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasMembersWith")) + data, err := ec.unmarshalOOrgMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasMembersWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPersonalAccessTokenWhereInput(ctx context.Context, obj interface{}) (generated.PersonalAccessTokenWhereInput, error) { + var it generated.PersonalAccessTokenWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "expiresAt", "expiresAtNEQ", "expiresAtIn", "expiresAtNotIn", "expiresAtGT", "expiresAtGTE", "expiresAtLT", "expiresAtLTE", "expiresAtIsNil", "expiresAtNotNil", "lastUsedAt", "lastUsedAtNEQ", "lastUsedAtIn", "lastUsedAtNotIn", "lastUsedAtGT", "lastUsedAtGTE", "lastUsedAtLT", "lastUsedAtLTE", "lastUsedAtIsNil", "lastUsedAtNotNil", "hasOwner", "hasOwnerWith", "hasOrganizations", "hasOrganizationsWith", "hasEvents", "hasEventsWith"} + 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.unmarshalOPersonalAccessTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOPersonalAccessTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOPersonalAccessTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = 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 "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "expiresAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNEQ = data + case "expiresAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIn = data + case "expiresAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotIn = data + case "expiresAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGT = data + case "expiresAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtGTE = data + case "expiresAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLT = data + case "expiresAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtLTE = data + case "expiresAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtIsNil = data + case "expiresAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAtNotNil = data + case "lastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAt = data + case "lastUsedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtNEQ = data + case "lastUsedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtIn = data + case "lastUsedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtNotIn = data + case "lastUsedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtGT = data + case "lastUsedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtGTE = data + case "lastUsedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtLT = data + case "lastUsedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtLTE = data + case "lastUsedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtIsNil = data + case "lastUsedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAtNotNil = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasOrganizations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizations")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizations = data + case "hasOrganizationsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationsWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationsWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSubscriberWhereInput(ctx context.Context, obj interface{}) (generated.SubscriberWhereInput, error) { + var it generated.SubscriberWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "email", "emailNEQ", "emailIn", "emailNotIn", "emailGT", "emailGTE", "emailLT", "emailLTE", "emailContains", "emailHasPrefix", "emailHasSuffix", "emailEqualFold", "emailContainsFold", "phoneNumber", "phoneNumberNEQ", "phoneNumberIn", "phoneNumberNotIn", "phoneNumberGT", "phoneNumberGTE", "phoneNumberLT", "phoneNumberLTE", "phoneNumberContains", "phoneNumberHasPrefix", "phoneNumberHasSuffix", "phoneNumberIsNil", "phoneNumberNotNil", "phoneNumberEqualFold", "phoneNumberContainsFold", "verifiedEmail", "verifiedEmailNEQ", "verifiedPhone", "verifiedPhoneNEQ", "active", "activeNEQ", "hasOwner", "hasOwnerWith", "hasEvents", "hasEventsWith"} + 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.unmarshalOSubscriberWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOSubscriberWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOSubscriberWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "emailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailNEQ = data + case "emailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailIn = data + case "emailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailNotIn = data + case "emailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGT = data + case "emailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGTE = data + case "emailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLT = data + case "emailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLTE = data + case "emailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContains = data + case "emailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasPrefix = data + case "emailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasSuffix = data + case "emailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailEqualFold = data + case "emailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContainsFold = data + case "phoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumber")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumber = data + case "phoneNumberNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNEQ = data + case "phoneNumberIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberIn = data + case "phoneNumberNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNotIn = data + case "phoneNumberGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberGT = data + case "phoneNumberGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberGTE = data + case "phoneNumberLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberLT = data + case "phoneNumberLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberLTE = data + case "phoneNumberContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberContains = data + case "phoneNumberHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberHasPrefix = data + case "phoneNumberHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberHasSuffix = data + case "phoneNumberIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberIsNil = data + case "phoneNumberNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberNotNil = data + case "phoneNumberEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberEqualFold = data + case "phoneNumberContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumberContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumberContainsFold = data + case "verifiedEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verifiedEmail")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.VerifiedEmail = data + case "verifiedEmailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verifiedEmailNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.VerifiedEmailNEQ = data + case "verifiedPhone": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verifiedPhone")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.VerifiedPhone = data + case "verifiedPhoneNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verifiedPhoneNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.VerifiedPhoneNEQ = data + case "active": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("active")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Active = data + case "activeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activeNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ActiveNEQ = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTFASettingWhereInput(ctx context.Context, obj interface{}) (generated.TFASettingWhereInput, error) { + var it generated.TFASettingWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "tfaSecret", "tfaSecretNEQ", "tfaSecretIn", "tfaSecretNotIn", "tfaSecretGT", "tfaSecretGTE", "tfaSecretLT", "tfaSecretLTE", "tfaSecretContains", "tfaSecretHasPrefix", "tfaSecretHasSuffix", "tfaSecretIsNil", "tfaSecretNotNil", "tfaSecretEqualFold", "tfaSecretContainsFold", "verified", "verifiedNEQ", "totpAllowed", "totpAllowedNEQ", "totpAllowedIsNil", "totpAllowedNotNil", "hasOwner", "hasOwnerWith"} + 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.unmarshalOTFASettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOTFASettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOTFASettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "tfaSecret": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecret")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecret = data + case "tfaSecretNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretNEQ = data + case "tfaSecretIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretIn = data + case "tfaSecretNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretNotIn = data + case "tfaSecretGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretGT = data + case "tfaSecretGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretGTE = data + case "tfaSecretLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretLT = data + case "tfaSecretLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretLTE = data + case "tfaSecretContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretContains = data + case "tfaSecretHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretHasPrefix = data + case "tfaSecretHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretHasSuffix = data + case "tfaSecretIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretIsNil = data + case "tfaSecretNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretNotNil = data + case "tfaSecretEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretEqualFold = data + case "tfaSecretContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tfaSecretContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TfaSecretContainsFold = data + case "verified": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verified")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Verified = data + case "verifiedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verifiedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.VerifiedNEQ = data + case "totpAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("totpAllowed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.TotpAllowed = data + case "totpAllowedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("totpAllowedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.TotpAllowedNEQ = data + case "totpAllowedIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("totpAllowedIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TotpAllowedIsNil = data + case "totpAllowedNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("totpAllowedNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.TotpAllowedNotNil = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTemplateHistoryOrder(ctx context.Context, obj interface{}) (generated.TemplateHistoryOrder, error) { + var it generated.TemplateHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNTemplateHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTemplateHistoryWhereInput(ctx context.Context, obj interface{}) (generated.TemplateHistoryWhereInput, error) { + var it generated.TemplateHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "templateType", "templateTypeNEQ", "templateTypeIn", "templateTypeNotIn", "description", "descriptionNEQ", "descriptionIn", "descriptionNotIn", "descriptionGT", "descriptionGTE", "descriptionLT", "descriptionLTE", "descriptionContains", "descriptionHasPrefix", "descriptionHasSuffix", "descriptionIsNil", "descriptionNotNil", "descriptionEqualFold", "descriptionContainsFold"} + 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.unmarshalOTemplateHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOTemplateHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOTemplateHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOTemplateHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOTemplateHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOTemplateHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOTemplateHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "templateType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateType")) + data, err := ec.unmarshalOTemplateHistoryDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, v) + if err != nil { + return it, err + } + it.TemplateType = data + case "templateTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateTypeNEQ")) + data, err := ec.unmarshalOTemplateHistoryDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, v) + if err != nil { + return it, err + } + it.TemplateTypeNEQ = data + case "templateTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateTypeIn")) + data, err := ec.unmarshalOTemplateHistoryDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateTypeIn = data + case "templateTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateTypeNotIn")) + data, err := ec.unmarshalOTemplateHistoryDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateTypeNotIn = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "descriptionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNEQ = data + case "descriptionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIn = data + case "descriptionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotIn = data + case "descriptionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGT = data + case "descriptionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGTE = data + case "descriptionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLT = data + case "descriptionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLTE = data + case "descriptionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContains = data + case "descriptionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasPrefix = data + case "descriptionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasSuffix = data + case "descriptionIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIsNil = data + case "descriptionNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotNil = data + case "descriptionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionEqualFold = data + case "descriptionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTemplateOrder(ctx context.Context, obj interface{}) (generated.TemplateOrder, error) { + var it generated.TemplateOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNTemplateOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTemplateWhereInput(ctx context.Context, obj interface{}) (generated.TemplateWhereInput, error) { + var it generated.TemplateWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "templateType", "templateTypeNEQ", "templateTypeIn", "templateTypeNotIn", "description", "descriptionNEQ", "descriptionIn", "descriptionNotIn", "descriptionGT", "descriptionGTE", "descriptionLT", "descriptionLTE", "descriptionContains", "descriptionHasPrefix", "descriptionHasSuffix", "descriptionIsNil", "descriptionNotNil", "descriptionEqualFold", "descriptionContainsFold", "hasOwner", "hasOwnerWith", "hasDocuments", "hasDocumentsWith"} + 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.unmarshalOTemplateWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOTemplateWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOTemplateWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "templateType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateType")) + data, err := ec.unmarshalOTemplateDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, v) + if err != nil { + return it, err + } + it.TemplateType = data + case "templateTypeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateTypeNEQ")) + data, err := ec.unmarshalOTemplateDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, v) + if err != nil { + return it, err + } + it.TemplateTypeNEQ = data + case "templateTypeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateTypeIn")) + data, err := ec.unmarshalOTemplateDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateTypeIn = data + case "templateTypeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateTypeNotIn")) + data, err := ec.unmarshalOTemplateDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.TemplateTypeNotIn = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "descriptionNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNEQ = data + case "descriptionIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIn = data + case "descriptionNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotIn = data + case "descriptionGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGT = data + case "descriptionGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionGTE = data + case "descriptionLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLT = data + case "descriptionLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionLTE = data + case "descriptionContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContains = data + case "descriptionHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasPrefix = data + case "descriptionHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionHasSuffix = data + case "descriptionIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionIsNil = data + case "descriptionNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DescriptionNotNil = data + case "descriptionEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionEqualFold = data + case "descriptionContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DescriptionContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasDocuments": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDocuments")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasDocuments = data + case "hasDocumentsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDocumentsWith")) + data, err := ec.unmarshalODocumentDataWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasDocumentsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateAPITokenInput(ctx context.Context, obj interface{}) (generated.UpdateAPITokenInput, error) { + var it generated.UpdateAPITokenInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "description", "clearDescription", "scopes", "appendScopes", "clearScopes", "lastUsedAt", "clearLastUsedAt", "ownerID", "clearOwner"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "appendScopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendScopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendScopes = data + case "clearScopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearScopes")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearScopes = data + case "lastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAt = data + case "clearLastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearLastUsedAt")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearLastUsedAt = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateContactInput(ctx context.Context, obj interface{}) (generated.UpdateContactInput, error) { + var it generated.UpdateContactInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "fullName", "title", "clearTitle", "company", "clearCompany", "email", "clearEmail", "phoneNumber", "clearPhoneNumber", "address", "clearAddress", "status", "ownerID", "clearOwner", "addEntityIDs", "removeEntityIDs", "clearEntities"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "fullName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fullName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FullName = data + case "title": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Title = data + case "clearTitle": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTitle")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTitle = data + case "company": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("company")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Company = data + case "clearCompany": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearCompany")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearCompany = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "clearEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEmail")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEmail = data + case "phoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumber")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumber = data + case "clearPhoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPhoneNumber")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPhoneNumber = data + case "address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("address")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Address = data + case "clearAddress": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAddress")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearAddress = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOContactUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntityIDs = data + case "removeEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntityIDs = data + case "clearEntities": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntities")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntities = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateDocumentDataInput(ctx context.Context, obj interface{}) (generated.UpdateDocumentDataInput, error) { + var it generated.UpdateDocumentDataInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "data", "ownerID", "clearOwner", "templateID", "addEntityIDs", "removeEntityIDs", "clearEntity"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "data": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) + data, err := ec.unmarshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, v) + if err != nil { + return it, err + } + it.Data = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "templateID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TemplateID = data + case "addEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntityIDs = data + case "removeEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntityIDs = data + case "clearEntity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntity")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntity = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateEntitlementInput(ctx context.Context, obj interface{}) (generated.UpdateEntitlementInput, error) { + var it generated.UpdateEntitlementInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "externalCustomerID", "clearExternalCustomerID", "externalSubscriptionID", "clearExternalSubscriptionID", "expiresAt", "clearExpiresAt", "cancelled", "ownerID", "clearOwner", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "externalCustomerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalCustomerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalCustomerID = data + case "clearExternalCustomerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearExternalCustomerID")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearExternalCustomerID = data + case "externalSubscriptionID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalSubscriptionID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ExternalSubscriptionID = data + case "clearExternalSubscriptionID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearExternalSubscriptionID")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearExternalSubscriptionID = data + case "expiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.ExpiresAt = data + case "clearExpiresAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearExpiresAt")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearExpiresAt = data + case "cancelled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cancelled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Cancelled = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateEntitlementPlanFeatureInput(ctx context.Context, obj interface{}) (generated.UpdateEntitlementPlanFeatureInput, error) { + var it generated.UpdateEntitlementPlanFeatureInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "metadata", "clearMetadata", "ownerID", "clearOwner", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "clearMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearMetadata")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearMetadata = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateEntitlementPlanInput(ctx context.Context, obj interface{}) (generated.UpdateEntitlementPlanInput, error) { + var it generated.UpdateEntitlementPlanInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "displayName", "clearDisplayName", "description", "clearDescription", "metadata", "clearMetadata", "ownerID", "clearOwner", "addEntitlementIDs", "removeEntitlementIDs", "clearEntitlements", "addBaseFeatureIDs", "removeBaseFeatureIDs", "clearBaseFeatures", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "clearDisplayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDisplayName")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDisplayName = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "clearMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearMetadata")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearMetadata = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntitlementIDs = data + case "removeEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntitlementIDs = data + case "clearEntitlements": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntitlements")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntitlements = data + case "addBaseFeatureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addBaseFeatureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddBaseFeatureIDs = data + case "removeBaseFeatureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeBaseFeatureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveBaseFeatureIDs = data + case "clearBaseFeatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearBaseFeatures")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearBaseFeatures = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateEntityInput(ctx context.Context, obj interface{}) (generated.UpdateEntityInput, error) { + var it generated.UpdateEntityInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "clearName", "displayName", "clearDisplayName", "description", "clearDescription", "domains", "appendDomains", "clearDomains", "status", "clearStatus", "ownerID", "clearOwner", "addContactIDs", "removeContactIDs", "clearContacts", "addDocumentIDs", "removeDocumentIDs", "clearDocuments", "addNoteIDs", "removeNoteIDs", "clearNotes", "addFileIDs", "removeFileIDs", "clearFiles", "entityTypeID", "clearEntityType", "note"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "clearName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearName")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearName = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "clearDisplayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDisplayName")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDisplayName = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "domains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domains")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Domains = data + case "appendDomains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendDomains")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendDomains = data + case "clearDomains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDomains")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDomains = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "clearStatus": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearStatus")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearStatus = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addContactIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addContactIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddContactIDs = data + case "removeContactIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeContactIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveContactIDs = data + case "clearContacts": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearContacts")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearContacts = data + case "addDocumentIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addDocumentIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddDocumentIDs = data + case "removeDocumentIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeDocumentIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveDocumentIDs = data + case "clearDocuments": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDocuments")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDocuments = data + case "addNoteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addNoteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddNoteIDs = data + case "removeNoteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeNoteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveNoteIDs = data + case "clearNotes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearNotes")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearNotes = data + case "addFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddFileIDs = data + case "removeFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveFileIDs = data + case "clearFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFiles")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFiles = data + case "entityTypeID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityTypeID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityTypeID = data + case "clearEntityType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntityType")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntityType = data + case "note": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("note")) + data, err := ec.unmarshalOCreateNoteInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateNoteInput(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.UpdateEntityInput().Note(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateEntityTypeInput(ctx context.Context, obj interface{}) (generated.UpdateEntityTypeInput, error) { + var it generated.UpdateEntityTypeInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "ownerID", "clearOwner", "addEntityIDs", "removeEntityIDs", "clearEntities"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntityIDs = data + case "removeEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntityIDs = data + case "clearEntities": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntities")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntities = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateEventInput(ctx context.Context, obj interface{}) (generated.UpdateEventInput, error) { + var it generated.UpdateEventInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "eventID", "clearEventID", "correlationID", "clearCorrelationID", "eventType", "metadata", "clearMetadata", "addUserIDs", "removeUserIDs", "clearUser", "addGroupIDs", "removeGroupIDs", "clearGroup", "addIntegrationIDs", "removeIntegrationIDs", "clearIntegration", "addOrganizationIDs", "removeOrganizationIDs", "clearOrganization", "addInviteIDs", "removeInviteIDs", "clearInvite", "addFeatureIDs", "removeFeatureIDs", "clearFeature", "addEntitlementplanIDs", "removeEntitlementplanIDs", "clearEntitlementplan", "addPersonalAccessTokenIDs", "removePersonalAccessTokenIDs", "clearPersonalAccessToken", "addOauth2tokenIDs", "removeOauth2tokenIDs", "clearOauth2token", "addHushIDs", "removeHushIDs", "clearHush", "addEntitlementIDs", "removeEntitlementIDs", "clearEntitlement", "addWebhookIDs", "removeWebhookIDs", "clearWebhook", "addSubscriberIDs", "removeSubscriberIDs", "clearSubscriber"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "eventID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventID = data + case "clearEventID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEventID")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEventID = data + case "correlationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correlationID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CorrelationID = data + case "clearCorrelationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearCorrelationID")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearCorrelationID = data + case "eventType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eventType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EventType = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "clearMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearMetadata")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearMetadata = data + case "addUserIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addUserIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddUserIDs = data + case "removeUserIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeUserIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveUserIDs = data + case "clearUser": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUser")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearUser = data + case "addGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddGroupIDs = data + case "removeGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveGroupIDs = data + case "clearGroup": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearGroup")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearGroup = data + case "addIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddIntegrationIDs = data + case "removeIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveIntegrationIDs = data + case "clearIntegration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIntegration")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIntegration = data + case "addOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOrganizationIDs = data + case "removeOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOrganizationIDs = data + case "clearOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOrganization")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOrganization = data + case "addInviteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addInviteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddInviteIDs = data + case "removeInviteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeInviteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveInviteIDs = data + case "clearInvite": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearInvite")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearInvite = data + case "addFeatureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addFeatureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddFeatureIDs = data + case "removeFeatureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeFeatureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveFeatureIDs = data + case "clearFeature": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFeature")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFeature = data + case "addEntitlementplanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntitlementplanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntitlementplanIDs = data + case "removeEntitlementplanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntitlementplanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntitlementplanIDs = data + case "clearEntitlementplan": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntitlementplan")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntitlementplan = data + case "addPersonalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addPersonalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddPersonalAccessTokenIDs = data + case "removePersonalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removePersonalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemovePersonalAccessTokenIDs = data + case "clearPersonalAccessToken": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPersonalAccessToken")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPersonalAccessToken = data + case "addOauth2tokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOauth2tokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOauth2tokenIDs = data + case "removeOauth2tokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOauth2tokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOauth2tokenIDs = data + case "clearOauth2token": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOauth2token")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOauth2token = data + case "addHushIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addHushIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddHushIDs = data + case "removeHushIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeHushIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveHushIDs = data + case "clearHush": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearHush")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearHush = data + case "addEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntitlementIDs = data + case "removeEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntitlementIDs = data + case "clearEntitlement": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntitlement")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntitlement = data + case "addWebhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addWebhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddWebhookIDs = data + case "removeWebhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeWebhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveWebhookIDs = data + case "clearWebhook": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearWebhook")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearWebhook = data + case "addSubscriberIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addSubscriberIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddSubscriberIDs = data + case "removeSubscriberIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeSubscriberIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveSubscriberIDs = data + case "clearSubscriber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSubscriber")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSubscriber = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateFeatureInput(ctx context.Context, obj interface{}) (generated.UpdateFeatureInput, error) { + var it generated.UpdateFeatureInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "displayName", "clearDisplayName", "enabled", "description", "clearDescription", "metadata", "clearMetadata", "ownerID", "clearOwner", "addPlanIDs", "removePlanIDs", "clearPlans", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "clearDisplayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDisplayName")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDisplayName = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "metadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) + data, err := ec.unmarshalOMap2map(ctx, v) + if err != nil { + return it, err + } + it.Metadata = data + case "clearMetadata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearMetadata")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearMetadata = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addPlanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addPlanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddPlanIDs = data + case "removePlanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removePlanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemovePlanIDs = data + case "clearPlans": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPlans")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPlans = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateFileInput(ctx context.Context, obj interface{}) (generated.UpdateFileInput, error) { + var it generated.UpdateFileInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "fileName", "fileExtension", "fileSize", "clearFileSize", "contentType", "storeKey", "category", "clearCategory", "annotation", "clearAnnotation", "userID", "clearUser", "addOrganizationIDs", "removeOrganizationIDs", "clearOrganization", "addEntityIDs", "removeEntityIDs", "clearEntity", "addGroupIDs", "removeGroupIDs", "clearGroup"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "fileName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileName = data + case "fileExtension": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileExtension")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FileExtension = data + case "fileSize": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileSize")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FileSize = data + case "clearFileSize": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFileSize")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFileSize = data + case "contentType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentType")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ContentType = data + case "storeKey": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("storeKey")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.StoreKey = data + case "category": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("category")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Category = data + case "clearCategory": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearCategory")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearCategory = data + case "annotation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("annotation")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Annotation = data + case "clearAnnotation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAnnotation")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearAnnotation = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "clearUser": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUser")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearUser = data + case "addOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOrganizationIDs = data + case "removeOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOrganizationIDs = data + case "clearOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOrganization")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOrganization = data + case "addEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntityIDs = data + case "removeEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntityIDs = data + case "clearEntity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntity")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntity = data + case "addGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddGroupIDs = data + case "removeGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveGroupIDs = data + case "clearGroup": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearGroup")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearGroup = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateGroupInput(ctx context.Context, obj interface{}) (generated.UpdateGroupInput, error) { + var it generated.UpdateGroupInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "description", "clearDescription", "gravatarLogoURL", "clearGravatarLogoURL", "logoURL", "clearLogoURL", "displayName", "ownerID", "clearOwner", "settingID", "addUserIDs", "removeUserIDs", "clearUsers", "addEventIDs", "removeEventIDs", "clearEvents", "addIntegrationIDs", "removeIntegrationIDs", "clearIntegrations", "addFileIDs", "removeFileIDs", "clearFiles", "addGroupMembers", "updateGroupSettings"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "gravatarLogoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gravatarLogoURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GravatarLogoURL = data + case "clearGravatarLogoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearGravatarLogoURL")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearGravatarLogoURL = data + case "logoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logoURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LogoURL = data + case "clearLogoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearLogoURL")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearLogoURL = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "settingID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("settingID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SettingID = data + case "addUserIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addUserIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddUserIDs = data + case "removeUserIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeUserIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveUserIDs = data + case "clearUsers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUsers")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearUsers = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + case "addIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddIntegrationIDs = data + case "removeIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveIntegrationIDs = data + case "clearIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIntegrations")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIntegrations = data + case "addFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddFileIDs = data + case "removeFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveFileIDs = data + case "clearFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFiles")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFiles = data + case "addGroupMembers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addGroupMembers")) + data, err := ec.unmarshalOCreateGroupMembershipInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupMembershipInputᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.UpdateGroupInput().AddGroupMembers(ctx, &it, data); err != nil { + return it, err + } + case "updateGroupSettings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updateGroupSettings")) + data, err := ec.unmarshalOUpdateGroupSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupSettingInput(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.UpdateGroupInput().UpdateGroupSettings(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateGroupMembershipInput(ctx context.Context, obj interface{}) (generated.UpdateGroupMembershipInput, error) { + var it generated.UpdateGroupMembershipInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"role", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOGroupMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateGroupSettingInput(ctx context.Context, obj interface{}) (generated.UpdateGroupSettingInput, error) { + var it generated.UpdateGroupSettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "visibility", "joinPolicy", "syncToSlack", "clearSyncToSlack", "syncToGithub", "clearSyncToGithub", "groupID", "clearGroup"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "visibility": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibility")) + data, err := ec.unmarshalOGroupSettingVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, v) + if err != nil { + return it, err + } + it.Visibility = data + case "joinPolicy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("joinPolicy")) + data, err := ec.unmarshalOGroupSettingJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, v) + if err != nil { + return it, err + } + it.JoinPolicy = data + case "syncToSlack": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToSlack")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToSlack = data + case "clearSyncToSlack": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSyncToSlack")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSyncToSlack = data + case "syncToGithub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syncToGithub")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.SyncToGithub = data + case "clearSyncToGithub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSyncToGithub")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSyncToGithub = data + case "groupID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groupID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.GroupID = data + case "clearGroup": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearGroup")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearGroup = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateHushInput(ctx context.Context, obj interface{}) (generated.UpdateHushInput, error) { + var it generated.UpdateHushInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "description", "clearDescription", "kind", "clearKind", "addIntegrationIDs", "removeIntegrationIDs", "clearIntegrations", "addOrganizationIDs", "removeOrganizationIDs", "clearOrganization", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "clearKind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearKind")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearKind = data + case "addIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddIntegrationIDs = data + case "removeIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveIntegrationIDs = data + case "clearIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIntegrations")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIntegrations = data + case "addOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOrganizationIDs = data + case "removeOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOrganizationIDs = data + case "clearOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOrganization")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOrganization = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateIntegrationInput(ctx context.Context, obj interface{}) (generated.UpdateIntegrationInput, error) { + var it generated.UpdateIntegrationInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "description", "clearDescription", "kind", "clearKind", "ownerID", "clearOwner", "addSecretIDs", "removeSecretIDs", "clearSecrets", "addOauth2tokenIDs", "removeOauth2tokenIDs", "clearOauth2tokens", "addEventIDs", "removeEventIDs", "clearEvents", "addWebhookIDs", "removeWebhookIDs", "clearWebhooks"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "clearKind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearKind")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearKind = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addSecretIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addSecretIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddSecretIDs = data + case "removeSecretIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeSecretIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveSecretIDs = data + case "clearSecrets": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSecrets")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSecrets = data + case "addOauth2tokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOauth2tokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOauth2tokenIDs = data + case "removeOauth2tokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOauth2tokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOauth2tokenIDs = data + case "clearOauth2tokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOauth2tokens")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOauth2tokens = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + case "addWebhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addWebhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddWebhookIDs = data + case "removeWebhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeWebhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveWebhookIDs = data + case "clearWebhooks": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearWebhooks")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearWebhooks = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateInviteInput(ctx context.Context, obj interface{}) (generated.UpdateInviteInput, error) { + var it generated.UpdateInviteInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"expires", "clearExpires", "status", "role", "sendAttempts", "ownerID", "clearOwner", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "expires": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expires")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Expires = data + case "clearExpires": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearExpires")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearExpires = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOInviteInviteStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOInviteRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "sendAttempts": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sendAttempts")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.SendAttempts = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateNoteInput(ctx context.Context, obj interface{}) (generated.UpdateNoteInput, error) { + var it generated.UpdateNoteInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "text", "ownerID", "clearOwner", "entityID", "clearEntity"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "entityID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entityID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EntityID = data + case "clearEntity": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntity")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntity = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateOauthProviderInput(ctx context.Context, obj interface{}) (generated.UpdateOauthProviderInput, error) { + var it generated.UpdateOauthProviderInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "clientID", "clientSecret", "redirectURL", "scopes", "authURL", "tokenURL", "authStyle", "infoURL", "ownerID", "clearOwner"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "clientID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientID = data + case "clientSecret": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientSecret")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientSecret = data + case "redirectURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("redirectURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RedirectURL = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "authURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AuthURL = data + case "tokenURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tokenURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TokenURL = data + case "authStyle": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authStyle")) + data, err := ec.unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, v) + if err != nil { + return it, err + } + it.AuthStyle = data + case "infoURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infoURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.InfoURL = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateOhAuthTooTokenInput(ctx context.Context, obj interface{}) (generated.UpdateOhAuthTooTokenInput, error) { + var it generated.UpdateOhAuthTooTokenInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "clientID", "scopes", "appendScopes", "clearScopes", "nonce", "claimsUserID", "claimsUsername", "claimsEmail", "claimsEmailVerified", "claimsGroups", "appendClaimsGroups", "clearClaimsGroups", "claimsPreferredUsername", "connectorID", "connectorData", "appendConnectorData", "clearConnectorData", "lastUsed", "addIntegrationIDs", "removeIntegrationIDs", "clearIntegration", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "clientID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClientID = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "appendScopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendScopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendScopes = data + case "clearScopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearScopes")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearScopes = data + case "nonce": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nonce")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Nonce = data + case "claimsUserID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUserID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUserID = data + case "claimsUsername": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsUsername")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsUsername = data + case "claimsEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmail")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmail = data + case "claimsEmailVerified": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsEmailVerified")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.ClaimsEmailVerified = data + case "claimsGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsGroups")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ClaimsGroups = data + case "appendClaimsGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendClaimsGroups")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendClaimsGroups = data + case "clearClaimsGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearClaimsGroups")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearClaimsGroups = data + case "claimsPreferredUsername": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("claimsPreferredUsername")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ClaimsPreferredUsername = data + case "connectorID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ConnectorID = data + case "connectorData": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("connectorData")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.ConnectorData = data + case "appendConnectorData": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendConnectorData")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendConnectorData = data + case "clearConnectorData": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearConnectorData")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearConnectorData = data + case "lastUsed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsed")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsed = data + case "addIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddIntegrationIDs = data + case "removeIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveIntegrationIDs = data + case "clearIntegration": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIntegration")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIntegration = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateOrgMembershipInput(ctx context.Context, obj interface{}) (generated.UpdateOrgMembershipInput, error) { + var it generated.UpdateOrgMembershipInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"role", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOOrgMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateOrganizationInput(ctx context.Context, obj interface{}) (generated.UpdateOrganizationInput, error) { + var it generated.UpdateOrganizationInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "displayName", "description", "clearDescription", "avatarRemoteURL", "clearAvatarRemoteURL", "addGroupIDs", "removeGroupIDs", "clearGroups", "addTemplateIDs", "removeTemplateIDs", "clearTemplates", "addIntegrationIDs", "removeIntegrationIDs", "clearIntegrations", "settingID", "clearSetting", "addDocumentdatumIDs", "removeDocumentdatumIDs", "clearDocumentdata", "addEntitlementIDs", "removeEntitlementIDs", "clearEntitlements", "addOrganizationEntitlementIDs", "removeOrganizationEntitlementIDs", "clearOrganizationEntitlement", "addPersonalAccessTokenIDs", "removePersonalAccessTokenIDs", "clearPersonalAccessTokens", "addAPITokenIDs", "removeAPITokenIDs", "clearAPITokens", "addOauthproviderIDs", "removeOauthproviderIDs", "clearOauthprovider", "addUserIDs", "removeUserIDs", "clearUsers", "addInviteIDs", "removeInviteIDs", "clearInvites", "addSubscriberIDs", "removeSubscriberIDs", "clearSubscribers", "addWebhookIDs", "removeWebhookIDs", "clearWebhooks", "addEventIDs", "removeEventIDs", "clearEvents", "addSecretIDs", "removeSecretIDs", "clearSecrets", "addFeatureIDs", "removeFeatureIDs", "clearFeatures", "addFileIDs", "removeFileIDs", "clearFiles", "addEntitlementplanIDs", "removeEntitlementplanIDs", "clearEntitlementplans", "addEntityIDs", "removeEntityIDs", "clearEntities", "addEntitytypeIDs", "removeEntitytypeIDs", "clearEntitytypes", "addContactIDs", "removeContactIDs", "clearContacts", "addNoteIDs", "removeNoteIDs", "clearNotes", "addOrgMembers", "updateOrgSettings"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "clearAvatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAvatarRemoteURL")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearAvatarRemoteURL = data + case "addGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddGroupIDs = data + case "removeGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveGroupIDs = data + case "clearGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearGroups")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearGroups = data + case "addTemplateIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addTemplateIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddTemplateIDs = data + case "removeTemplateIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeTemplateIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveTemplateIDs = data + case "clearTemplates": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTemplates")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTemplates = data + case "addIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddIntegrationIDs = data + case "removeIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveIntegrationIDs = data + case "clearIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIntegrations")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIntegrations = data + case "settingID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("settingID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SettingID = data + case "clearSetting": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSetting")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSetting = data + case "addDocumentdatumIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addDocumentdatumIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddDocumentdatumIDs = data + case "removeDocumentdatumIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeDocumentdatumIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveDocumentdatumIDs = data + case "clearDocumentdata": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDocumentdata")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDocumentdata = data + case "addEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntitlementIDs = data + case "removeEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntitlementIDs = data + case "clearEntitlements": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntitlements")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntitlements = data + case "addOrganizationEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOrganizationEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOrganizationEntitlementIDs = data + case "removeOrganizationEntitlementIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOrganizationEntitlementIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOrganizationEntitlementIDs = data + case "clearOrganizationEntitlement": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOrganizationEntitlement")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOrganizationEntitlement = data + case "addPersonalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addPersonalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddPersonalAccessTokenIDs = data + case "removePersonalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removePersonalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemovePersonalAccessTokenIDs = data + case "clearPersonalAccessTokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPersonalAccessTokens")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPersonalAccessTokens = data + case "addAPITokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addAPITokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddAPITokenIDs = data + case "removeAPITokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeAPITokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveAPITokenIDs = data + case "clearAPITokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAPITokens")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearAPITokens = data + case "addOauthproviderIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOauthproviderIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOauthproviderIDs = data + case "removeOauthproviderIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOauthproviderIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOauthproviderIDs = data + case "clearOauthprovider": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOauthprovider")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOauthprovider = data + case "addUserIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addUserIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddUserIDs = data + case "removeUserIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeUserIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveUserIDs = data + case "clearUsers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUsers")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearUsers = data + case "addInviteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addInviteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddInviteIDs = data + case "removeInviteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeInviteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveInviteIDs = data + case "clearInvites": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearInvites")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearInvites = data + case "addSubscriberIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addSubscriberIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddSubscriberIDs = data + case "removeSubscriberIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeSubscriberIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveSubscriberIDs = data + case "clearSubscribers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSubscribers")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSubscribers = data + case "addWebhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addWebhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddWebhookIDs = data + case "removeWebhookIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeWebhookIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveWebhookIDs = data + case "clearWebhooks": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearWebhooks")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearWebhooks = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + case "addSecretIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addSecretIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddSecretIDs = data + case "removeSecretIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeSecretIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveSecretIDs = data + case "clearSecrets": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSecrets")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSecrets = data + case "addFeatureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addFeatureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddFeatureIDs = data + case "removeFeatureIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeFeatureIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveFeatureIDs = data + case "clearFeatures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFeatures")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFeatures = data + case "addFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddFileIDs = data + case "removeFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveFileIDs = data + case "clearFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFiles")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFiles = data + case "addEntitlementplanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntitlementplanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntitlementplanIDs = data + case "removeEntitlementplanIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntitlementplanIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntitlementplanIDs = data + case "clearEntitlementplans": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntitlementplans")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntitlementplans = data + case "addEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntityIDs = data + case "removeEntityIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntityIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntityIDs = data + case "clearEntities": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntities")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntities = data + case "addEntitytypeIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEntitytypeIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEntitytypeIDs = data + case "removeEntitytypeIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEntitytypeIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEntitytypeIDs = data + case "clearEntitytypes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEntitytypes")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEntitytypes = data + case "addContactIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addContactIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddContactIDs = data + case "removeContactIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeContactIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveContactIDs = data + case "clearContacts": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearContacts")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearContacts = data + case "addNoteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addNoteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddNoteIDs = data + case "removeNoteIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeNoteIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveNoteIDs = data + case "clearNotes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearNotes")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearNotes = data + case "addOrgMembers": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOrgMembers")) + data, err := ec.unmarshalOCreateOrgMembershipInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgMembershipInputᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.UpdateOrganizationInput().AddOrgMembers(ctx, &it, data); err != nil { + return it, err + } + case "updateOrgSettings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updateOrgSettings")) + data, err := ec.unmarshalOUpdateOrganizationSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrganizationSettingInput(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.UpdateOrganizationInput().UpdateOrgSettings(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateOrganizationSettingInput(ctx context.Context, obj interface{}) (generated.UpdateOrganizationSettingInput, error) { + var it generated.UpdateOrganizationSettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "domains", "appendDomains", "clearDomains", "billingContact", "clearBillingContact", "billingEmail", "clearBillingEmail", "billingPhone", "clearBillingPhone", "billingAddress", "clearBillingAddress", "taxIdentifier", "clearTaxIdentifier", "geoLocation", "clearGeoLocation", "organizationID", "clearOrganization"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "domains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("domains")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Domains = data + case "appendDomains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendDomains")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendDomains = data + case "clearDomains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDomains")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDomains = data + case "billingContact": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingContact")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingContact = data + case "clearBillingContact": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearBillingContact")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearBillingContact = data + case "billingEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingEmail")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingEmail = data + case "clearBillingEmail": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearBillingEmail")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearBillingEmail = data + case "billingPhone": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingPhone")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingPhone = data + case "clearBillingPhone": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearBillingPhone")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearBillingPhone = data + case "billingAddress": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.BillingAddress = data + case "clearBillingAddress": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearBillingAddress")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearBillingAddress = data + case "taxIdentifier": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifier")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TaxIdentifier = data + case "clearTaxIdentifier": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTaxIdentifier")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTaxIdentifier = data + case "geoLocation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("geoLocation")) + data, err := ec.unmarshalOOrganizationSettingRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, v) + if err != nil { + return it, err + } + it.GeoLocation = data + case "clearGeoLocation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearGeoLocation")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearGeoLocation = data + case "organizationID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OrganizationID = data + case "clearOrganization": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOrganization")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOrganization = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdatePersonalAccessTokenInput(ctx context.Context, obj interface{}) (generated.UpdatePersonalAccessTokenInput, error) { + var it generated.UpdatePersonalAccessTokenInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "description", "clearDescription", "scopes", "appendScopes", "clearScopes", "lastUsedAt", "clearLastUsedAt", "addOrganizationIDs", "removeOrganizationIDs", "clearOrganizations", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "scopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Scopes = data + case "appendScopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendScopes")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendScopes = data + case "clearScopes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearScopes")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearScopes = data + case "lastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastUsedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastUsedAt = data + case "clearLastUsedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearLastUsedAt")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearLastUsedAt = data + case "addOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOrganizationIDs = data + case "removeOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOrganizationIDs = data + case "clearOrganizations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOrganizations")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOrganizations = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateSubscriberInput(ctx context.Context, obj interface{}) (generated.UpdateSubscriberInput, error) { + var it generated.UpdateSubscriberInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "email", "phoneNumber", "clearPhoneNumber", "ownerID", "clearOwner", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "phoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phoneNumber")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PhoneNumber = data + case "clearPhoneNumber": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPhoneNumber")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPhoneNumber = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateTFASettingInput(ctx context.Context, obj interface{}) (generated.UpdateTFASettingInput, error) { + var it generated.UpdateTFASettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "verified", "totpAllowed", "clearTotpAllowed", "regenBackupCodes"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "verified": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verified")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Verified = data + case "totpAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("totpAllowed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.TotpAllowed = data + case "clearTotpAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTotpAllowed")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTotpAllowed = data + case "regenBackupCodes": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("regenBackupCodes")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.UpdateTFASettingInput().RegenBackupCodes(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateTemplateInput(ctx context.Context, obj interface{}) (generated.UpdateTemplateInput, error) { + var it generated.UpdateTemplateInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "templateType", "description", "clearDescription", "jsonconfig", "uischema", "clearUischema", "ownerID", "clearOwner", "addDocumentIDs", "removeDocumentIDs", "clearDocuments"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "templateType": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("templateType")) + data, err := ec.unmarshalOTemplateDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, v) + if err != nil { + return it, err + } + it.TemplateType = data + case "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "jsonconfig": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("jsonconfig")) + data, err := ec.unmarshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, v) + if err != nil { + return it, err + } + it.Jsonconfig = data + case "uischema": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uischema")) + data, err := ec.unmarshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx, v) + if err != nil { + return it, err + } + it.Uischema = data + case "clearUischema": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUischema")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearUischema = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addDocumentIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addDocumentIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddDocumentIDs = data + case "removeDocumentIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeDocumentIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveDocumentIDs = data + case "clearDocuments": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDocuments")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDocuments = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateUserInput(ctx context.Context, obj interface{}) (generated.UpdateUserInput, error) { + var it generated.UpdateUserInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "email", "firstName", "clearFirstName", "lastName", "clearLastName", "displayName", "avatarRemoteURL", "clearAvatarRemoteURL", "avatarLocalFile", "clearAvatarLocalFile", "avatarUpdatedAt", "clearAvatarUpdatedAt", "lastSeen", "clearLastSeen", "password", "clearPassword", "sub", "clearSub", "authProvider", "role", "clearRole", "addPersonalAccessTokenIDs", "removePersonalAccessTokenIDs", "clearPersonalAccessTokens", "addTfaSettingIDs", "removeTfaSettingIDs", "clearTfaSettings", "settingID", "addEmailVerificationTokenIDs", "removeEmailVerificationTokenIDs", "clearEmailVerificationTokens", "addPasswordResetTokenIDs", "removePasswordResetTokenIDs", "clearPasswordResetTokens", "addGroupIDs", "removeGroupIDs", "clearGroups", "addOrganizationIDs", "removeOrganizationIDs", "clearOrganizations", "addWebauthnIDs", "removeWebauthnIDs", "clearWebauthn", "addFileIDs", "removeFileIDs", "clearFiles", "addEventIDs", "removeEventIDs", "clearEvents"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "firstName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstName = data + case "clearFirstName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFirstName")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFirstName = data + case "lastName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastName = data + case "clearLastName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearLastName")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearLastName = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "clearAvatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAvatarRemoteURL")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearAvatarRemoteURL = data + case "avatarLocalFile": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFile")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFile = data + case "clearAvatarLocalFile": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAvatarLocalFile")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearAvatarLocalFile = data + case "avatarUpdatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAt = data + case "clearAvatarUpdatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearAvatarUpdatedAt")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearAvatarUpdatedAt = data + case "lastSeen": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeen")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeen = data + case "clearLastSeen": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearLastSeen")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearLastSeen = data + case "password": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Password = data + case "clearPassword": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPassword")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPassword = data + case "sub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sub")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Sub = data + case "clearSub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSub")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSub = data + case "authProvider": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProvider")) + data, err := ec.unmarshalOUserAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, v) + if err != nil { + return it, err + } + it.AuthProvider = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOUserRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "clearRole": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearRole")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearRole = data + case "addPersonalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addPersonalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddPersonalAccessTokenIDs = data + case "removePersonalAccessTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removePersonalAccessTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemovePersonalAccessTokenIDs = data + case "clearPersonalAccessTokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPersonalAccessTokens")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPersonalAccessTokens = data + case "addTfaSettingIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addTfaSettingIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddTfaSettingIDs = data + case "removeTfaSettingIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeTfaSettingIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveTfaSettingIDs = data + case "clearTfaSettings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTfaSettings")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTfaSettings = data + case "settingID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("settingID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SettingID = data + case "addEmailVerificationTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEmailVerificationTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEmailVerificationTokenIDs = data + case "removeEmailVerificationTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEmailVerificationTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEmailVerificationTokenIDs = data + case "clearEmailVerificationTokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEmailVerificationTokens")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEmailVerificationTokens = data + case "addPasswordResetTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addPasswordResetTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddPasswordResetTokenIDs = data + case "removePasswordResetTokenIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removePasswordResetTokenIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemovePasswordResetTokenIDs = data + case "clearPasswordResetTokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearPasswordResetTokens")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearPasswordResetTokens = data + case "addGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddGroupIDs = data + case "removeGroupIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeGroupIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveGroupIDs = data + case "clearGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearGroups")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearGroups = data + case "addOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddOrganizationIDs = data + case "removeOrganizationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeOrganizationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveOrganizationIDs = data + case "clearOrganizations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOrganizations")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOrganizations = data + case "addWebauthnIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addWebauthnIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddWebauthnIDs = data + case "removeWebauthnIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeWebauthnIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveWebauthnIDs = data + case "clearWebauthn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearWebauthn")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearWebauthn = data + case "addFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddFileIDs = data + case "removeFileIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeFileIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveFileIDs = data + case "clearFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFiles")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFiles = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateUserSettingInput(ctx context.Context, obj interface{}) (generated.UpdateUserSettingInput, error) { + var it generated.UpdateUserSettingInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "locked", "silencedAt", "clearSilencedAt", "suspendedAt", "clearSuspendedAt", "status", "emailConfirmed", "isWebauthnAllowed", "clearIsWebauthnAllowed", "isTfaEnabled", "clearIsTfaEnabled", "userID", "clearUser", "defaultOrgID", "clearDefaultOrg"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = data + case "locked": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("locked")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Locked = data + case "silencedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAt = data + case "clearSilencedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSilencedAt")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSilencedAt = data + case "suspendedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAt = data + case "clearSuspendedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearSuspendedAt")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearSuspendedAt = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOUserSettingUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "emailConfirmed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailConfirmed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EmailConfirmed = data + case "isWebauthnAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowed = data + case "clearIsWebauthnAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIsWebauthnAllowed")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIsWebauthnAllowed = data + case "isTfaEnabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabled = data + case "clearIsTfaEnabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIsTfaEnabled")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIsTfaEnabled = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "clearUser": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearUser")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearUser = data + case "defaultOrgID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defaultOrgID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DefaultOrgID = data + case "clearDefaultOrg": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDefaultOrg")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDefaultOrg = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateWebhookInput(ctx context.Context, obj interface{}) (generated.UpdateWebhookInput, error) { + var it generated.UpdateWebhookInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "name", "description", "clearDescription", "destinationURL", "enabled", "failures", "clearFailures", "lastError", "clearLastError", "lastResponse", "clearLastResponse", "ownerID", "clearOwner", "addEventIDs", "removeEventIDs", "clearEvents", "addIntegrationIDs", "removeIntegrationIDs", "clearIntegrations"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "tags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Tags = data + case "appendTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AppendTags = data + case "clearTags": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearTags = 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 "description": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Description = data + case "clearDescription": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearDescription")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearDescription = data + case "destinationURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURL = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "failures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failures")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Failures = data + case "clearFailures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFailures")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearFailures = data + case "lastError": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastError")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastError = data + case "clearLastError": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearLastError")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearLastError = data + case "lastResponse": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponse")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponse = data + case "clearLastResponse": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearLastResponse")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearLastResponse = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "clearOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearOwner = data + case "addEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddEventIDs = data + case "removeEventIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeEventIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveEventIDs = data + case "clearEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearEvents")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearEvents = data + case "addIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("addIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AddIntegrationIDs = data + case "removeIntegrationIDs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("removeIntegrationIDs")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RemoveIntegrationIDs = data + case "clearIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearIntegrations")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.ClearIntegrations = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUserHistoryOrder(ctx context.Context, obj interface{}) (generated.UserHistoryOrder, error) { + var it generated.UserHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNUserHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUserHistoryWhereInput(ctx context.Context, obj interface{}) (generated.UserHistoryWhereInput, error) { + var it generated.UserHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "email", "emailNEQ", "emailIn", "emailNotIn", "emailGT", "emailGTE", "emailLT", "emailLTE", "emailContains", "emailHasPrefix", "emailHasSuffix", "emailEqualFold", "emailContainsFold", "firstName", "firstNameNEQ", "firstNameIn", "firstNameNotIn", "firstNameGT", "firstNameGTE", "firstNameLT", "firstNameLTE", "firstNameContains", "firstNameHasPrefix", "firstNameHasSuffix", "firstNameIsNil", "firstNameNotNil", "firstNameEqualFold", "firstNameContainsFold", "lastName", "lastNameNEQ", "lastNameIn", "lastNameNotIn", "lastNameGT", "lastNameGTE", "lastNameLT", "lastNameLTE", "lastNameContains", "lastNameHasPrefix", "lastNameHasSuffix", "lastNameIsNil", "lastNameNotNil", "lastNameEqualFold", "lastNameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameEqualFold", "displayNameContainsFold", "avatarRemoteURL", "avatarRemoteURLNEQ", "avatarRemoteURLIn", "avatarRemoteURLNotIn", "avatarRemoteURLGT", "avatarRemoteURLGTE", "avatarRemoteURLLT", "avatarRemoteURLLTE", "avatarRemoteURLContains", "avatarRemoteURLHasPrefix", "avatarRemoteURLHasSuffix", "avatarRemoteURLIsNil", "avatarRemoteURLNotNil", "avatarRemoteURLEqualFold", "avatarRemoteURLContainsFold", "avatarLocalFile", "avatarLocalFileNEQ", "avatarLocalFileIn", "avatarLocalFileNotIn", "avatarLocalFileGT", "avatarLocalFileGTE", "avatarLocalFileLT", "avatarLocalFileLTE", "avatarLocalFileContains", "avatarLocalFileHasPrefix", "avatarLocalFileHasSuffix", "avatarLocalFileIsNil", "avatarLocalFileNotNil", "avatarLocalFileEqualFold", "avatarLocalFileContainsFold", "avatarUpdatedAt", "avatarUpdatedAtNEQ", "avatarUpdatedAtIn", "avatarUpdatedAtNotIn", "avatarUpdatedAtGT", "avatarUpdatedAtGTE", "avatarUpdatedAtLT", "avatarUpdatedAtLTE", "avatarUpdatedAtIsNil", "avatarUpdatedAtNotNil", "lastSeen", "lastSeenNEQ", "lastSeenIn", "lastSeenNotIn", "lastSeenGT", "lastSeenGTE", "lastSeenLT", "lastSeenLTE", "lastSeenIsNil", "lastSeenNotNil", "sub", "subNEQ", "subIn", "subNotIn", "subGT", "subGTE", "subLT", "subLTE", "subContains", "subHasPrefix", "subHasSuffix", "subIsNil", "subNotNil", "subEqualFold", "subContainsFold", "authProvider", "authProviderNEQ", "authProviderIn", "authProviderNotIn", "role", "roleNEQ", "roleIn", "roleNotIn", "roleIsNil", "roleNotNil"} + 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.unmarshalOUserHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOUserHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOUserHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOUserHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOUserHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOUserHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOUserHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "emailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailNEQ = data + case "emailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailIn = data + case "emailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailNotIn = data + case "emailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGT = data + case "emailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGTE = data + case "emailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLT = data + case "emailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLTE = data + case "emailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContains = data + case "emailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasPrefix = data + case "emailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasSuffix = data + case "emailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailEqualFold = data + case "emailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContainsFold = data + case "firstName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstName = data + case "firstNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameNEQ = data + case "firstNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FirstNameIn = data + case "firstNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FirstNameNotIn = data + case "firstNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameGT = data + case "firstNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameGTE = data + case "firstNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameLT = data + case "firstNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameLTE = data + case "firstNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameContains = data + case "firstNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameHasPrefix = data + case "firstNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameHasSuffix = data + case "firstNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FirstNameIsNil = data + case "firstNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FirstNameNotNil = data + case "firstNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameEqualFold = data + case "firstNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameContainsFold = data + case "lastName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastName = data + case "lastNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameNEQ = data + case "lastNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastNameIn = data + case "lastNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastNameNotIn = data + case "lastNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameGT = data + case "lastNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameGTE = data + case "lastNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameLT = data + case "lastNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameLTE = data + case "lastNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameContains = data + case "lastNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameHasPrefix = data + case "lastNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameHasSuffix = data + case "lastNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastNameIsNil = data + case "lastNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastNameNotNil = data + case "lastNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameEqualFold = data + case "lastNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameContainsFold = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "avatarRemoteURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNEQ = data + case "avatarRemoteURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIn = data + case "avatarRemoteURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotIn = data + case "avatarRemoteURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGT = data + case "avatarRemoteURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGTE = data + case "avatarRemoteURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLT = data + case "avatarRemoteURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLTE = data + case "avatarRemoteURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContains = data + case "avatarRemoteURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasPrefix = data + case "avatarRemoteURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasSuffix = data + case "avatarRemoteURLIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIsNil = data + case "avatarRemoteURLNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotNil = data + case "avatarRemoteURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLEqualFold = data + case "avatarRemoteURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContainsFold = data + case "avatarLocalFile": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFile")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFile = data + case "avatarLocalFileNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileNEQ = data + case "avatarLocalFileIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileIn = data + case "avatarLocalFileNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileNotIn = data + case "avatarLocalFileGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileGT = data + case "avatarLocalFileGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileGTE = data + case "avatarLocalFileLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileLT = data + case "avatarLocalFileLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileLTE = data + case "avatarLocalFileContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileContains = data + case "avatarLocalFileHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileHasPrefix = data + case "avatarLocalFileHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileHasSuffix = data + case "avatarLocalFileIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileIsNil = data + case "avatarLocalFileNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileNotNil = data + case "avatarLocalFileEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileEqualFold = data + case "avatarLocalFileContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileContainsFold = data + case "avatarUpdatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAt = data + case "avatarUpdatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtNEQ = data + case "avatarUpdatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtIn = data + case "avatarUpdatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtNotIn = data + case "avatarUpdatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtGT = data + case "avatarUpdatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtGTE = data + case "avatarUpdatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtLT = data + case "avatarUpdatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtLTE = data + case "avatarUpdatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtIsNil = data + case "avatarUpdatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtNotNil = data + case "lastSeen": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeen")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeen = data + case "lastSeenNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenNEQ = data + case "lastSeenIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastSeenIn = data + case "lastSeenNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastSeenNotIn = data + case "lastSeenGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenGT = data + case "lastSeenGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenGTE = data + case "lastSeenLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenLT = data + case "lastSeenLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenLTE = data + case "lastSeenIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastSeenIsNil = data + case "lastSeenNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastSeenNotNil = data + case "sub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sub")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Sub = data + case "subNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubNEQ = data + case "subIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SubIn = data + case "subNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SubNotIn = data + case "subGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubGT = data + case "subGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubGTE = data + case "subLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubLT = data + case "subLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubLTE = data + case "subContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubContains = data + case "subHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubHasPrefix = data + case "subHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubHasSuffix = data + case "subIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SubIsNil = data + case "subNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SubNotNil = data + case "subEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubEqualFold = data + case "subContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubContainsFold = data + case "authProvider": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProvider")) + data, err := ec.unmarshalOUserHistoryAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, v) + if err != nil { + return it, err + } + it.AuthProvider = data + case "authProviderNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProviderNEQ")) + data, err := ec.unmarshalOUserHistoryAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, v) + if err != nil { + return it, err + } + it.AuthProviderNEQ = data + case "authProviderIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProviderIn")) + data, err := ec.unmarshalOUserHistoryAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthProviderIn = data + case "authProviderNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProviderNotIn")) + data, err := ec.unmarshalOUserHistoryAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthProviderNotIn = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOUserHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "roleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ")) + data, err := ec.unmarshalOUserHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.RoleNEQ = data + case "roleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIn")) + data, err := ec.unmarshalOUserHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleIn = data + case "roleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotIn")) + data, err := ec.unmarshalOUserHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleNotIn = data + case "roleIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RoleIsNil = data + case "roleNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RoleNotNil = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUserOrder(ctx context.Context, obj interface{}) (generated.UserOrder, error) { + var it generated.UserOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNUserOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUserSettingHistoryWhereInput(ctx context.Context, obj interface{}) (generated.UserSettingHistoryWhereInput, error) { + var it generated.UserSettingHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "userID", "userIDNEQ", "userIDIn", "userIDNotIn", "userIDGT", "userIDGTE", "userIDLT", "userIDLTE", "userIDContains", "userIDHasPrefix", "userIDHasSuffix", "userIDIsNil", "userIDNotNil", "userIDEqualFold", "userIDContainsFold", "locked", "lockedNEQ", "silencedAt", "silencedAtNEQ", "silencedAtIn", "silencedAtNotIn", "silencedAtGT", "silencedAtGTE", "silencedAtLT", "silencedAtLTE", "silencedAtIsNil", "silencedAtNotNil", "suspendedAt", "suspendedAtNEQ", "suspendedAtIn", "suspendedAtNotIn", "suspendedAtGT", "suspendedAtGTE", "suspendedAtLT", "suspendedAtLTE", "suspendedAtIsNil", "suspendedAtNotNil", "status", "statusNEQ", "statusIn", "statusNotIn", "emailConfirmed", "emailConfirmedNEQ", "isWebauthnAllowed", "isWebauthnAllowedNEQ", "isWebauthnAllowedIsNil", "isWebauthnAllowedNotNil", "isTfaEnabled", "isTfaEnabledNEQ", "isTfaEnabledIsNil", "isTfaEnabledNotNil"} + 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.unmarshalOUserSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOUserSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOUserSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOUserSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOUserSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOUserSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOUserSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "userIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDNEQ = data + case "userIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDIn = data + case "userIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDNotIn = data + case "userIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGT = data + case "userIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGTE = data + case "userIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLT = data + case "userIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLTE = data + case "userIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContains = data + case "userIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasPrefix = data + case "userIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasSuffix = data + case "userIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UserIDIsNil = data + case "userIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UserIDNotNil = data + case "userIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDEqualFold = data + case "userIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContainsFold = data + case "locked": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("locked")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Locked = data + case "lockedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lockedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.LockedNEQ = data + case "silencedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAt = data + case "silencedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtNEQ = data + case "silencedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtIn = data + case "silencedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtNotIn = data + case "silencedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtGT = data + case "silencedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtGTE = data + case "silencedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtLT = data + case "silencedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtLTE = data + case "silencedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtIsNil = data + case "silencedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtNotNil = data + case "suspendedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAt = data + case "suspendedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtNEQ = data + case "suspendedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtIn = data + case "suspendedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtNotIn = data + case "suspendedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtGT = data + case "suspendedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtGTE = data + case "suspendedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtLT = data + case "suspendedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtLTE = data + case "suspendedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtIsNil = data + case "suspendedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtNotNil = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOUserSettingHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOUserSettingHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOUserSettingHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOUserSettingHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusNotIn = data + case "emailConfirmed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailConfirmed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EmailConfirmed = data + case "emailConfirmedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailConfirmedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EmailConfirmedNEQ = data + case "isWebauthnAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowed = data + case "isWebauthnAllowedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowedNEQ = data + case "isWebauthnAllowedIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowedIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowedIsNil = data + case "isWebauthnAllowedNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowedNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowedNotNil = data + case "isTfaEnabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabled = data + case "isTfaEnabledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabledNEQ = data + case "isTfaEnabledIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabledIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabledIsNil = data + case "isTfaEnabledNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabledNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabledNotNil = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUserSettingWhereInput(ctx context.Context, obj interface{}) (generated.UserSettingWhereInput, error) { + var it generated.UserSettingWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "userID", "userIDNEQ", "userIDIn", "userIDNotIn", "userIDGT", "userIDGTE", "userIDLT", "userIDLTE", "userIDContains", "userIDHasPrefix", "userIDHasSuffix", "userIDIsNil", "userIDNotNil", "userIDEqualFold", "userIDContainsFold", "locked", "lockedNEQ", "silencedAt", "silencedAtNEQ", "silencedAtIn", "silencedAtNotIn", "silencedAtGT", "silencedAtGTE", "silencedAtLT", "silencedAtLTE", "silencedAtIsNil", "silencedAtNotNil", "suspendedAt", "suspendedAtNEQ", "suspendedAtIn", "suspendedAtNotIn", "suspendedAtGT", "suspendedAtGTE", "suspendedAtLT", "suspendedAtLTE", "suspendedAtIsNil", "suspendedAtNotNil", "status", "statusNEQ", "statusIn", "statusNotIn", "emailConfirmed", "emailConfirmedNEQ", "isWebauthnAllowed", "isWebauthnAllowedNEQ", "isWebauthnAllowedIsNil", "isWebauthnAllowedNotNil", "isTfaEnabled", "isTfaEnabledNEQ", "isTfaEnabledIsNil", "isTfaEnabledNotNil", "hasUser", "hasUserWith", "hasDefaultOrg", "hasDefaultOrgWith"} + 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.unmarshalOUserSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOUserSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOUserSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "userID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserID = data + case "userIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDNEQ = data + case "userIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDIn = data + case "userIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UserIDNotIn = data + case "userIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGT = data + case "userIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDGTE = data + case "userIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLT = data + case "userIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDLTE = data + case "userIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContains = data + case "userIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasPrefix = data + case "userIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDHasSuffix = data + case "userIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UserIDIsNil = data + case "userIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UserIDNotNil = data + case "userIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDEqualFold = data + case "userIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UserIDContainsFold = data + case "locked": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("locked")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Locked = data + case "lockedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lockedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.LockedNEQ = data + case "silencedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAt = data + case "silencedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtNEQ = data + case "silencedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtIn = data + case "silencedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtNotIn = data + case "silencedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtGT = data + case "silencedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtGTE = data + case "silencedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtLT = data + case "silencedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtLTE = data + case "silencedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtIsNil = data + case "silencedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("silencedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SilencedAtNotNil = data + case "suspendedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAt = data + case "suspendedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtNEQ = data + case "suspendedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtIn = data + case "suspendedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtNotIn = data + case "suspendedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtGT = data + case "suspendedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtGTE = data + case "suspendedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtLT = data + case "suspendedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtLTE = data + case "suspendedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtIsNil = data + case "suspendedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("suspendedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SuspendedAtNotNil = data + case "status": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status")) + data, err := ec.unmarshalOUserSettingUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.Status = data + case "statusNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNEQ")) + data, err := ec.unmarshalOUserSettingUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, v) + if err != nil { + return it, err + } + it.StatusNEQ = data + case "statusIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusIn")) + data, err := ec.unmarshalOUserSettingUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusIn = data + case "statusNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("statusNotIn")) + data, err := ec.unmarshalOUserSettingUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx, v) + if err != nil { + return it, err + } + it.StatusNotIn = data + case "emailConfirmed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailConfirmed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EmailConfirmed = data + case "emailConfirmedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailConfirmedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EmailConfirmedNEQ = data + case "isWebauthnAllowed": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowed")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowed = data + case "isWebauthnAllowedNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowedNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowedNEQ = data + case "isWebauthnAllowedIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowedIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowedIsNil = data + case "isWebauthnAllowedNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isWebauthnAllowedNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsWebauthnAllowedNotNil = data + case "isTfaEnabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabled = data + case "isTfaEnabledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabledNEQ = data + case "isTfaEnabledIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabledIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabledIsNil = data + case "isTfaEnabledNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isTfaEnabledNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsTfaEnabledNotNil = data + case "hasUser": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUser")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasUser = data + case "hasUserWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasUserWith")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasUserWith = data + case "hasDefaultOrg": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDefaultOrg")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasDefaultOrg = data + case "hasDefaultOrgWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasDefaultOrgWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasDefaultOrgWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUserWhereInput(ctx context.Context, obj interface{}) (generated.UserWhereInput, error) { + var it generated.UserWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "email", "emailNEQ", "emailIn", "emailNotIn", "emailGT", "emailGTE", "emailLT", "emailLTE", "emailContains", "emailHasPrefix", "emailHasSuffix", "emailEqualFold", "emailContainsFold", "firstName", "firstNameNEQ", "firstNameIn", "firstNameNotIn", "firstNameGT", "firstNameGTE", "firstNameLT", "firstNameLTE", "firstNameContains", "firstNameHasPrefix", "firstNameHasSuffix", "firstNameIsNil", "firstNameNotNil", "firstNameEqualFold", "firstNameContainsFold", "lastName", "lastNameNEQ", "lastNameIn", "lastNameNotIn", "lastNameGT", "lastNameGTE", "lastNameLT", "lastNameLTE", "lastNameContains", "lastNameHasPrefix", "lastNameHasSuffix", "lastNameIsNil", "lastNameNotNil", "lastNameEqualFold", "lastNameContainsFold", "displayName", "displayNameNEQ", "displayNameIn", "displayNameNotIn", "displayNameGT", "displayNameGTE", "displayNameLT", "displayNameLTE", "displayNameContains", "displayNameHasPrefix", "displayNameHasSuffix", "displayNameEqualFold", "displayNameContainsFold", "avatarRemoteURL", "avatarRemoteURLNEQ", "avatarRemoteURLIn", "avatarRemoteURLNotIn", "avatarRemoteURLGT", "avatarRemoteURLGTE", "avatarRemoteURLLT", "avatarRemoteURLLTE", "avatarRemoteURLContains", "avatarRemoteURLHasPrefix", "avatarRemoteURLHasSuffix", "avatarRemoteURLIsNil", "avatarRemoteURLNotNil", "avatarRemoteURLEqualFold", "avatarRemoteURLContainsFold", "avatarLocalFile", "avatarLocalFileNEQ", "avatarLocalFileIn", "avatarLocalFileNotIn", "avatarLocalFileGT", "avatarLocalFileGTE", "avatarLocalFileLT", "avatarLocalFileLTE", "avatarLocalFileContains", "avatarLocalFileHasPrefix", "avatarLocalFileHasSuffix", "avatarLocalFileIsNil", "avatarLocalFileNotNil", "avatarLocalFileEqualFold", "avatarLocalFileContainsFold", "avatarUpdatedAt", "avatarUpdatedAtNEQ", "avatarUpdatedAtIn", "avatarUpdatedAtNotIn", "avatarUpdatedAtGT", "avatarUpdatedAtGTE", "avatarUpdatedAtLT", "avatarUpdatedAtLTE", "avatarUpdatedAtIsNil", "avatarUpdatedAtNotNil", "lastSeen", "lastSeenNEQ", "lastSeenIn", "lastSeenNotIn", "lastSeenGT", "lastSeenGTE", "lastSeenLT", "lastSeenLTE", "lastSeenIsNil", "lastSeenNotNil", "sub", "subNEQ", "subIn", "subNotIn", "subGT", "subGTE", "subLT", "subLTE", "subContains", "subHasPrefix", "subHasSuffix", "subIsNil", "subNotNil", "subEqualFold", "subContainsFold", "authProvider", "authProviderNEQ", "authProviderIn", "authProviderNotIn", "role", "roleNEQ", "roleIn", "roleNotIn", "roleIsNil", "roleNotNil", "hasPersonalAccessTokens", "hasPersonalAccessTokensWith", "hasTfaSettings", "hasTfaSettingsWith", "hasSetting", "hasSettingWith", "hasGroups", "hasGroupsWith", "hasOrganizations", "hasOrganizationsWith", "hasFiles", "hasFilesWith", "hasEvents", "hasEventsWith", "hasGroupMemberships", "hasGroupMembershipsWith", "hasOrgMemberships", "hasOrgMembershipsWith"} + 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.unmarshalOUserWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "email": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "emailNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailNEQ = data + case "emailIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailIn = data + case "emailNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.EmailNotIn = data + case "emailGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGT = data + case "emailGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailGTE = data + case "emailLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLT = data + case "emailLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailLTE = data + case "emailContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContains = data + case "emailHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasPrefix = data + case "emailHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailHasSuffix = data + case "emailEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailEqualFold = data + case "emailContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.EmailContainsFold = data + case "firstName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstName = data + case "firstNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameNEQ = data + case "firstNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FirstNameIn = data + case "firstNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.FirstNameNotIn = data + case "firstNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameGT = data + case "firstNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameGTE = data + case "firstNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameLT = data + case "firstNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameLTE = data + case "firstNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameContains = data + case "firstNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameHasPrefix = data + case "firstNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameHasSuffix = data + case "firstNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FirstNameIsNil = data + case "firstNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FirstNameNotNil = data + case "firstNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameEqualFold = data + case "firstNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("firstNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.FirstNameContainsFold = data + case "lastName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastName = data + case "lastNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameNEQ = data + case "lastNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastNameIn = data + case "lastNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastNameNotIn = data + case "lastNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameGT = data + case "lastNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameGTE = data + case "lastNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameLT = data + case "lastNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameLTE = data + case "lastNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameContains = data + case "lastNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameHasPrefix = data + case "lastNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameHasSuffix = data + case "lastNameIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastNameIsNil = data + case "lastNameNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastNameNotNil = data + case "lastNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameEqualFold = data + case "lastNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastNameContainsFold = data + case "displayName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayName = data + case "displayNameNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNEQ = data + case "displayNameIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameIn = data + case "displayNameNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameNotIn = data + case "displayNameGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGT = data + case "displayNameGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameGTE = data + case "displayNameLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLT = data + case "displayNameLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameLTE = data + case "displayNameContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContains = data + case "displayNameHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasPrefix = data + case "displayNameHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameHasSuffix = data + case "displayNameEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameEqualFold = data + case "displayNameContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DisplayNameContainsFold = data + case "avatarRemoteURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURL = data + case "avatarRemoteURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNEQ = data + case "avatarRemoteURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIn = data + case "avatarRemoteURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotIn = data + case "avatarRemoteURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGT = data + case "avatarRemoteURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLGTE = data + case "avatarRemoteURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLT = data + case "avatarRemoteURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLLTE = data + case "avatarRemoteURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContains = data + case "avatarRemoteURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasPrefix = data + case "avatarRemoteURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLHasSuffix = data + case "avatarRemoteURLIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLIsNil = data + case "avatarRemoteURLNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLNotNil = data + case "avatarRemoteURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLEqualFold = data + case "avatarRemoteURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarRemoteURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarRemoteURLContainsFold = data + case "avatarLocalFile": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFile")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFile = data + case "avatarLocalFileNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileNEQ = data + case "avatarLocalFileIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileIn = data + case "avatarLocalFileNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileNotIn = data + case "avatarLocalFileGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileGT = data + case "avatarLocalFileGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileGTE = data + case "avatarLocalFileLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileLT = data + case "avatarLocalFileLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileLTE = data + case "avatarLocalFileContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileContains = data + case "avatarLocalFileHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileHasPrefix = data + case "avatarLocalFileHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileHasSuffix = data + case "avatarLocalFileIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileIsNil = data + case "avatarLocalFileNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileNotNil = data + case "avatarLocalFileEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileEqualFold = data + case "avatarLocalFileContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarLocalFileContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.AvatarLocalFileContainsFold = data + case "avatarUpdatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAt = data + case "avatarUpdatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtNEQ = data + case "avatarUpdatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtIn = data + case "avatarUpdatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtNotIn = data + case "avatarUpdatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtGT = data + case "avatarUpdatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtGTE = data + case "avatarUpdatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtLT = data + case "avatarUpdatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtLTE = data + case "avatarUpdatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtIsNil = data + case "avatarUpdatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("avatarUpdatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.AvatarUpdatedAtNotNil = data + case "lastSeen": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeen")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeen = data + case "lastSeenNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenNEQ = data + case "lastSeenIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastSeenIn = data + case "lastSeenNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastSeenNotIn = data + case "lastSeenGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenGT = data + case "lastSeenGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenGTE = data + case "lastSeenLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenLT = data + case "lastSeenLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.LastSeenLTE = data + case "lastSeenIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastSeenIsNil = data + case "lastSeenNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastSeenNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastSeenNotNil = data + case "sub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sub")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Sub = data + case "subNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubNEQ = data + case "subIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SubIn = data + case "subNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.SubNotIn = data + case "subGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubGT = data + case "subGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubGTE = data + case "subLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubLT = data + case "subLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubLTE = data + case "subContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubContains = data + case "subHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubHasPrefix = data + case "subHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubHasSuffix = data + case "subIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SubIsNil = data + case "subNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.SubNotNil = data + case "subEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubEqualFold = data + case "subContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.SubContainsFold = data + case "authProvider": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProvider")) + data, err := ec.unmarshalOUserAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, v) + if err != nil { + return it, err + } + it.AuthProvider = data + case "authProviderNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProviderNEQ")) + data, err := ec.unmarshalOUserAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, v) + if err != nil { + return it, err + } + it.AuthProviderNEQ = data + case "authProviderIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProviderIn")) + data, err := ec.unmarshalOUserAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthProviderIn = data + case "authProviderNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authProviderNotIn")) + data, err := ec.unmarshalOUserAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx, v) + if err != nil { + return it, err + } + it.AuthProviderNotIn = data + case "role": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role")) + data, err := ec.unmarshalOUserRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.Role = data + case "roleNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ")) + data, err := ec.unmarshalOUserRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, v) + if err != nil { + return it, err + } + it.RoleNEQ = data + case "roleIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIn")) + data, err := ec.unmarshalOUserRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleIn = data + case "roleNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotIn")) + data, err := ec.unmarshalOUserRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx, v) + if err != nil { + return it, err + } + it.RoleNotIn = data + case "roleIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RoleIsNil = data + case "roleNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RoleNotNil = data + case "hasPersonalAccessTokens": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPersonalAccessTokens")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasPersonalAccessTokens = data + case "hasPersonalAccessTokensWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasPersonalAccessTokensWith")) + data, err := ec.unmarshalOPersonalAccessTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasPersonalAccessTokensWith = data + case "hasTfaSettings": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTfaSettings")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasTfaSettings = data + case "hasTfaSettingsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasTfaSettingsWith")) + data, err := ec.unmarshalOTFASettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasTfaSettingsWith = data + case "hasSetting": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSetting")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasSetting = data + case "hasSettingWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasSettingWith")) + data, err := ec.unmarshalOUserSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasSettingWith = data + case "hasGroups": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroups")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGroups = data + case "hasGroupsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupsWith")) + data, err := ec.unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGroupsWith = data + case "hasOrganizations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizations")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizations = data + case "hasOrganizationsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganizationsWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrganizationsWith = data + case "hasFiles": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFiles")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasFiles = data + case "hasFilesWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasFilesWith")) + data, err := ec.unmarshalOFileWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasFilesWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + case "hasGroupMemberships": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupMemberships")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasGroupMemberships = data + case "hasGroupMembershipsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasGroupMembershipsWith")) + data, err := ec.unmarshalOGroupMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasGroupMembershipsWith = data + case "hasOrgMemberships": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrgMemberships")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOrgMemberships = data + case "hasOrgMembershipsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrgMembershipsWith")) + data, err := ec.unmarshalOOrgMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOrgMembershipsWith = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputWebhookHistoryOrder(ctx context.Context, obj interface{}) (generated.WebhookHistoryOrder, error) { + var it generated.WebhookHistoryOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNWebhookHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputWebhookHistoryWhereInput(ctx context.Context, obj interface{}) (generated.WebhookHistoryWhereInput, error) { + var it generated.WebhookHistoryWhereInput + 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", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "destinationURL", "destinationURLNEQ", "destinationURLIn", "destinationURLNotIn", "destinationURLGT", "destinationURLGTE", "destinationURLLT", "destinationURLLTE", "destinationURLContains", "destinationURLHasPrefix", "destinationURLHasSuffix", "destinationURLEqualFold", "destinationURLContainsFold", "enabled", "enabledNEQ", "failures", "failuresNEQ", "failuresIn", "failuresNotIn", "failuresGT", "failuresGTE", "failuresLT", "failuresLTE", "failuresIsNil", "failuresNotNil", "lastError", "lastErrorNEQ", "lastErrorIn", "lastErrorNotIn", "lastErrorGT", "lastErrorGTE", "lastErrorLT", "lastErrorLTE", "lastErrorContains", "lastErrorHasPrefix", "lastErrorHasSuffix", "lastErrorIsNil", "lastErrorNotNil", "lastErrorEqualFold", "lastErrorContainsFold", "lastResponse", "lastResponseNEQ", "lastResponseIn", "lastResponseNotIn", "lastResponseGT", "lastResponseGTE", "lastResponseLT", "lastResponseLTE", "lastResponseContains", "lastResponseHasPrefix", "lastResponseHasSuffix", "lastResponseIsNil", "lastResponseNotNil", "lastResponseEqualFold", "lastResponseContainsFold"} + 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.unmarshalOWebhookHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOWebhookHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOWebhookHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "historyTime": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTime")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTime = data + case "historyTimeNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNEQ = data + case "historyTimeIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeIn = data + case "historyTimeNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeNotIn = data + case "historyTimeGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGT = data + case "historyTimeGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeGTE = data + case "historyTimeLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLT = data + case "historyTimeLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("historyTimeLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.HistoryTimeLTE = data + case "ref": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ref")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Ref = data + case "refNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefNEQ = data + case "refIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefIn = data + case "refNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.RefNotIn = data + case "refGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGT = data + case "refGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefGTE = data + case "refLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLT = data + case "refLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefLTE = data + case "refContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContains = data + case "refHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasPrefix = data + case "refHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefHasSuffix = data + case "refIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefIsNil = data + case "refNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.RefNotNil = data + case "refEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefEqualFold = data + case "refContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("refContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RefContainsFold = data + case "operation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operation")) + data, err := ec.unmarshalOWebhookHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.Operation = data + case "operationNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNEQ")) + data, err := ec.unmarshalOWebhookHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, v) + if err != nil { + return it, err + } + it.OperationNEQ = data + case "operationIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationIn")) + data, err := ec.unmarshalOWebhookHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationIn = data + case "operationNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("operationNotIn")) + data, err := ec.unmarshalOWebhookHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx, v) + if err != nil { + return it, err + } + it.OperationNotIn = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "destinationURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURL = data + case "destinationURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLNEQ = data + case "destinationURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLIn = data + case "destinationURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLNotIn = data + case "destinationURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLGT = data + case "destinationURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLGTE = data + case "destinationURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLLT = data + case "destinationURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLLTE = data + case "destinationURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLContains = data + case "destinationURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLHasPrefix = data + case "destinationURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLHasSuffix = data + case "destinationURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLEqualFold = data + case "destinationURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLContainsFold = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "enabledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EnabledNEQ = data + case "failures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failures")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Failures = data + case "failuresNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresNEQ")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresNEQ = data + case "failuresIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FailuresIn = data + case "failuresNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresNotIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FailuresNotIn = data + case "failuresGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresGT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresGT = data + case "failuresGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresGTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresGTE = data + case "failuresLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresLT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresLT = data + case "failuresLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresLTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresLTE = data + case "failuresIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FailuresIsNil = data + case "failuresNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FailuresNotNil = data + case "lastError": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastError")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastError = data + case "lastErrorNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorNEQ = data + case "lastErrorIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastErrorIn = data + case "lastErrorNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastErrorNotIn = data + case "lastErrorGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorGT = data + case "lastErrorGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorGTE = data + case "lastErrorLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorLT = data + case "lastErrorLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorLTE = data + case "lastErrorContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorContains = data + case "lastErrorHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorHasPrefix = data + case "lastErrorHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorHasSuffix = data + case "lastErrorIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastErrorIsNil = data + case "lastErrorNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastErrorNotNil = data + case "lastErrorEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorEqualFold = data + case "lastErrorContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorContainsFold = data + case "lastResponse": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponse")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponse = data + case "lastResponseNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseNEQ = data + case "lastResponseIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastResponseIn = data + case "lastResponseNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastResponseNotIn = data + case "lastResponseGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseGT = data + case "lastResponseGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseGTE = data + case "lastResponseLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseLT = data + case "lastResponseLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseLTE = data + case "lastResponseContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseContains = data + case "lastResponseHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseHasPrefix = data + case "lastResponseHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseHasSuffix = data + case "lastResponseIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastResponseIsNil = data + case "lastResponseNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastResponseNotNil = data + case "lastResponseEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseEqualFold = data + case "lastResponseContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseContainsFold = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputWebhookOrder(ctx context.Context, obj interface{}) (generated.WebhookOrder, error) { + var it generated.WebhookOrder + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + if _, present := asMap["direction"]; !present { + asMap["direction"] = "ASC" + } + + fieldsInOrder := [...]string{"direction", "field"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "direction": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("direction")) + data, err := ec.unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx, v) + if err != nil { + return it, err + } + it.Direction = data + case "field": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) + data, err := ec.unmarshalNWebhookOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookOrderField(ctx, v) + if err != nil { + return it, err + } + it.Field = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputWebhookWhereInput(ctx context.Context, obj interface{}) (generated.WebhookWhereInput, error) { + var it generated.WebhookWhereInput + 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", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "ownerID", "ownerIDNEQ", "ownerIDIn", "ownerIDNotIn", "ownerIDGT", "ownerIDGTE", "ownerIDLT", "ownerIDLTE", "ownerIDContains", "ownerIDHasPrefix", "ownerIDHasSuffix", "ownerIDIsNil", "ownerIDNotNil", "ownerIDEqualFold", "ownerIDContainsFold", "name", "nameNEQ", "nameIn", "nameNotIn", "nameGT", "nameGTE", "nameLT", "nameLTE", "nameContains", "nameHasPrefix", "nameHasSuffix", "nameEqualFold", "nameContainsFold", "destinationURL", "destinationURLNEQ", "destinationURLIn", "destinationURLNotIn", "destinationURLGT", "destinationURLGTE", "destinationURLLT", "destinationURLLTE", "destinationURLContains", "destinationURLHasPrefix", "destinationURLHasSuffix", "destinationURLEqualFold", "destinationURLContainsFold", "enabled", "enabledNEQ", "failures", "failuresNEQ", "failuresIn", "failuresNotIn", "failuresGT", "failuresGTE", "failuresLT", "failuresLTE", "failuresIsNil", "failuresNotNil", "lastError", "lastErrorNEQ", "lastErrorIn", "lastErrorNotIn", "lastErrorGT", "lastErrorGTE", "lastErrorLT", "lastErrorLTE", "lastErrorContains", "lastErrorHasPrefix", "lastErrorHasSuffix", "lastErrorIsNil", "lastErrorNotNil", "lastErrorEqualFold", "lastErrorContainsFold", "lastResponse", "lastResponseNEQ", "lastResponseIn", "lastResponseNotIn", "lastResponseGT", "lastResponseGTE", "lastResponseLT", "lastResponseLTE", "lastResponseContains", "lastResponseHasPrefix", "lastResponseHasSuffix", "lastResponseIsNil", "lastResponseNotNil", "lastResponseEqualFold", "lastResponseContainsFold", "hasOwner", "hasOwnerWith", "hasEvents", "hasEventsWith", "hasIntegrations", "hasIntegrationsWith"} + 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.unmarshalOWebhookWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInput(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("and")) + data, err := ec.unmarshalOWebhookWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or")) + data, err := ec.unmarshalOWebhookWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + data, err := ec.unmarshalOID2ᚖ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ᚖ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ᚕ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ᚕ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ᚖ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ᚖ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ᚖ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ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDLTE = data + case "idEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDEqualFold = data + case "idContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.IDContainsFold = data + case "createdAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAt = data + case "createdAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNEQ = data + case "createdAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIn = data + case "createdAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotIn = data + case "createdAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGT = data + case "createdAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtGTE = data + case "createdAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLT = data + case "createdAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtLTE = data + case "createdAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtIsNil = data + case "createdAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedAtNotNil = data + case "updatedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAt = data + case "updatedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNEQ = data + case "updatedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIn = data + case "updatedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotIn = data + case "updatedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGT = data + case "updatedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtGTE = data + case "updatedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLT = data + case "updatedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtLTE = data + case "updatedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtIsNil = data + case "updatedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedAtNotNil = data + case "createdBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedBy = data + case "createdByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNEQ = data + case "createdByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIn = data + case "createdByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotIn = data + case "createdByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGT = data + case "createdByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByGTE = data + case "createdByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLT = data + case "createdByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByLTE = data + case "createdByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContains = data + case "createdByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasPrefix = data + case "createdByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByHasSuffix = data + case "createdByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByIsNil = data + case "createdByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.CreatedByNotNil = data + case "createdByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByEqualFold = data + case "createdByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.CreatedByContainsFold = data + case "updatedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedBy = data + case "updatedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNEQ = data + case "updatedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIn = data + case "updatedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotIn = data + case "updatedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGT = data + case "updatedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByGTE = data + case "updatedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLT = data + case "updatedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByLTE = data + case "updatedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContains = data + case "updatedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasPrefix = data + case "updatedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByHasSuffix = data + case "updatedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByIsNil = data + case "updatedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByNotNil = data + case "updatedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByEqualFold = data + case "updatedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("updatedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.UpdatedByContainsFold = data + case "deletedAt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAt")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAt = data + case "deletedAtNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNEQ")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNEQ = data + case "deletedAtIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIn = data + case "deletedAtNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotIn")) + data, err := ec.unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotIn = data + case "deletedAtGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGT = data + case "deletedAtGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtGTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtGTE = data + case "deletedAtLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLT")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLT = data + case "deletedAtLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtLTE")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtLTE = data + case "deletedAtIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtIsNil = data + case "deletedAtNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedAtNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedAtNotNil = data + case "deletedBy": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedBy")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedBy = data + case "deletedByNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNEQ = data + case "deletedByIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIn = data + case "deletedByNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotIn = data + case "deletedByGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGT = data + case "deletedByGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByGTE = data + case "deletedByLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLT = data + case "deletedByLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByLTE = data + case "deletedByContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContains = data + case "deletedByHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasPrefix = data + case "deletedByHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByHasSuffix = data + case "deletedByIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByIsNil = data + case "deletedByNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.DeletedByNotNil = data + case "deletedByEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByEqualFold = data + case "deletedByContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deletedByContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DeletedByContainsFold = data + case "ownerID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerID = data + case "ownerIDNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNEQ")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNEQ = data + case "ownerIDIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIn = data + case "ownerIDNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotIn")) + data, err := ec.unmarshalOID2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotIn = data + case "ownerIDGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGT = data + case "ownerIDGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDGTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDGTE = data + case "ownerIDLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLT")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLT = data + case "ownerIDLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDLTE")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDLTE = data + case "ownerIDContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContains")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContains = data + case "ownerIDHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasPrefix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasPrefix = data + case "ownerIDHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDHasSuffix")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDHasSuffix = data + case "ownerIDIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDIsNil = data + case "ownerIDNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDNotNil = data + case "ownerIDEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDEqualFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDEqualFold = data + case "ownerIDContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerIDContainsFold")) + data, err := ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.OwnerIDContainsFold = 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 "destinationURL": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURL")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURL = data + case "destinationURLNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLNEQ = data + case "destinationURLIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLIn = data + case "destinationURLNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLNotIn = data + case "destinationURLGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLGT = data + case "destinationURLGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLGTE = data + case "destinationURLLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLLT = data + case "destinationURLLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLLTE = data + case "destinationURLContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLContains = data + case "destinationURLHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLHasPrefix = data + case "destinationURLHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLHasSuffix = data + case "destinationURLEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLEqualFold = data + case "destinationURLContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationURLContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.DestinationURLContainsFold = data + case "enabled": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabled")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Enabled = data + case "enabledNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enabledNEQ")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.EnabledNEQ = data + case "failures": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failures")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Failures = data + case "failuresNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresNEQ")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresNEQ = data + case "failuresIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FailuresIn = data + case "failuresNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresNotIn")) + data, err := ec.unmarshalOInt2ᚕintᚄ(ctx, v) + if err != nil { + return it, err + } + it.FailuresNotIn = data + case "failuresGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresGT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresGT = data + case "failuresGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresGTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresGTE = data + case "failuresLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresLT")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresLT = data + case "failuresLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresLTE")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FailuresLTE = data + case "failuresIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FailuresIsNil = data + case "failuresNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("failuresNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.FailuresNotNil = data + case "lastError": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastError")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastError = data + case "lastErrorNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorNEQ = data + case "lastErrorIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastErrorIn = data + case "lastErrorNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastErrorNotIn = data + case "lastErrorGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorGT = data + case "lastErrorGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorGTE = data + case "lastErrorLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorLT = data + case "lastErrorLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorLTE = data + case "lastErrorContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorContains = data + case "lastErrorHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorHasPrefix = data + case "lastErrorHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorHasSuffix = data + case "lastErrorIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastErrorIsNil = data + case "lastErrorNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastErrorNotNil = data + case "lastErrorEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorEqualFold = data + case "lastErrorContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastErrorContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastErrorContainsFold = data + case "lastResponse": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponse")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponse = data + case "lastResponseNEQ": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseNEQ")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseNEQ = data + case "lastResponseIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastResponseIn = data + case "lastResponseNotIn": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseNotIn")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.LastResponseNotIn = data + case "lastResponseGT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseGT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseGT = data + case "lastResponseGTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseGTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseGTE = data + case "lastResponseLT": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseLT")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseLT = data + case "lastResponseLTE": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseLTE")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseLTE = data + case "lastResponseContains": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseContains")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseContains = data + case "lastResponseHasPrefix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseHasPrefix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseHasPrefix = data + case "lastResponseHasSuffix": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseHasSuffix")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseHasSuffix = data + case "lastResponseIsNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseIsNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastResponseIsNil = data + case "lastResponseNotNil": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseNotNil")) + data, err := ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.LastResponseNotNil = data + case "lastResponseEqualFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseEqualFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseEqualFold = data + case "lastResponseContainsFold": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastResponseContainsFold")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.LastResponseContainsFold = data + case "hasOwner": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwner")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasOwner = data + case "hasOwnerWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOwnerWith")) + data, err := ec.unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasOwnerWith = data + case "hasEvents": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEvents")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasEvents = data + case "hasEventsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasEventsWith")) + data, err := ec.unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasEventsWith = data + case "hasIntegrations": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrations")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrations = data + case "hasIntegrationsWith": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasIntegrationsWith")) + data, err := ec.unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.HasIntegrationsWith = data + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) _GlobalSearchResult(ctx context.Context, sel ast.SelectionSet, obj GlobalSearchResult) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case OrganizationSearchResult: + return ec._OrganizationSearchResult(ctx, sel, &obj) + case *OrganizationSearchResult: + if obj == nil { + return graphql.Null + } + return ec._OrganizationSearchResult(ctx, sel, obj) + case GroupSearchResult: + return ec._GroupSearchResult(ctx, sel, &obj) + case *GroupSearchResult: + if obj == nil { + return graphql.Null + } + return ec._GroupSearchResult(ctx, sel, obj) + case UserSearchResult: + return ec._UserSearchResult(ctx, sel, &obj) + case *UserSearchResult: + if obj == nil { + return graphql.Null + } + return ec._UserSearchResult(ctx, sel, obj) + case SubscriberSearchResult: + return ec._SubscriberSearchResult(ctx, sel, &obj) + case *SubscriberSearchResult: + if obj == nil { + return graphql.Null + } + return ec._SubscriberSearchResult(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj generated.Noder) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case AuditLog: + return ec._AuditLog(ctx, sel, &obj) + case *AuditLog: + if obj == nil { + return graphql.Null + } + return ec._AuditLog(ctx, sel, obj) + case *generated.APIToken: + if obj == nil { + return graphql.Null + } + return ec._APIToken(ctx, sel, obj) + case *generated.Contact: + if obj == nil { + return graphql.Null + } + return ec._Contact(ctx, sel, obj) + case *generated.ContactHistory: + if obj == nil { + return graphql.Null + } + return ec._ContactHistory(ctx, sel, obj) + case *generated.DocumentData: + if obj == nil { + return graphql.Null + } + return ec._DocumentData(ctx, sel, obj) + case *generated.DocumentDataHistory: + if obj == nil { + return graphql.Null + } + return ec._DocumentDataHistory(ctx, sel, obj) + case *generated.Entitlement: + if obj == nil { + return graphql.Null + } + return ec._Entitlement(ctx, sel, obj) + case *generated.EntitlementHistory: + if obj == nil { + return graphql.Null + } + return ec._EntitlementHistory(ctx, sel, obj) + case *generated.EntitlementPlan: + if obj == nil { + return graphql.Null + } + return ec._EntitlementPlan(ctx, sel, obj) + case *generated.EntitlementPlanFeature: + if obj == nil { + return graphql.Null + } + return ec._EntitlementPlanFeature(ctx, sel, obj) + case *generated.EntitlementPlanFeatureHistory: + if obj == nil { + return graphql.Null + } + return ec._EntitlementPlanFeatureHistory(ctx, sel, obj) + case *generated.EntitlementPlanHistory: + if obj == nil { + return graphql.Null + } + return ec._EntitlementPlanHistory(ctx, sel, obj) + case *generated.Entity: + if obj == nil { + return graphql.Null + } + return ec._Entity(ctx, sel, obj) + case *generated.EntityHistory: + if obj == nil { + return graphql.Null + } + return ec._EntityHistory(ctx, sel, obj) + case *generated.EntityType: + if obj == nil { + return graphql.Null + } + return ec._EntityType(ctx, sel, obj) + case *generated.EntityTypeHistory: + if obj == nil { + return graphql.Null + } + return ec._EntityTypeHistory(ctx, sel, obj) + case *generated.Event: + if obj == nil { + return graphql.Null + } + return ec._Event(ctx, sel, obj) + case *generated.EventHistory: + if obj == nil { + return graphql.Null + } + return ec._EventHistory(ctx, sel, obj) + case *generated.Feature: + if obj == nil { + return graphql.Null + } + return ec._Feature(ctx, sel, obj) + case *generated.FeatureHistory: + if obj == nil { + return graphql.Null + } + return ec._FeatureHistory(ctx, sel, obj) + case *generated.File: + if obj == nil { + return graphql.Null + } + return ec._File(ctx, sel, obj) + case *generated.FileHistory: + if obj == nil { + return graphql.Null + } + return ec._FileHistory(ctx, sel, obj) + case *generated.Group: + if obj == nil { + return graphql.Null + } + return ec._Group(ctx, sel, obj) + case *generated.GroupHistory: + if obj == nil { + return graphql.Null + } + return ec._GroupHistory(ctx, sel, obj) + case *generated.GroupMembership: + if obj == nil { + return graphql.Null + } + return ec._GroupMembership(ctx, sel, obj) + case *generated.GroupMembershipHistory: + if obj == nil { + return graphql.Null + } + return ec._GroupMembershipHistory(ctx, sel, obj) + case *generated.GroupSetting: + if obj == nil { + return graphql.Null + } + return ec._GroupSetting(ctx, sel, obj) + case *generated.GroupSettingHistory: + if obj == nil { + return graphql.Null + } + return ec._GroupSettingHistory(ctx, sel, obj) + case *generated.Hush: + if obj == nil { + return graphql.Null + } + return ec._Hush(ctx, sel, obj) + case *generated.HushHistory: + if obj == nil { + return graphql.Null + } + return ec._HushHistory(ctx, sel, obj) + case *generated.Integration: + if obj == nil { + return graphql.Null + } + return ec._Integration(ctx, sel, obj) + case *generated.IntegrationHistory: + if obj == nil { + return graphql.Null + } + return ec._IntegrationHistory(ctx, sel, obj) + case *generated.Invite: + if obj == nil { + return graphql.Null + } + return ec._Invite(ctx, sel, obj) + case *generated.Note: + if obj == nil { + return graphql.Null + } + return ec._Note(ctx, sel, obj) + case *generated.NoteHistory: + if obj == nil { + return graphql.Null + } + return ec._NoteHistory(ctx, sel, obj) + case *generated.OauthProvider: + if obj == nil { + return graphql.Null + } + return ec._OauthProvider(ctx, sel, obj) + case *generated.OauthProviderHistory: + if obj == nil { + return graphql.Null + } + return ec._OauthProviderHistory(ctx, sel, obj) + case *generated.OhAuthTooToken: + if obj == nil { + return graphql.Null + } + return ec._OhAuthTooToken(ctx, sel, obj) + case *generated.OrgMembership: + if obj == nil { + return graphql.Null + } + return ec._OrgMembership(ctx, sel, obj) + case *generated.OrgMembershipHistory: + if obj == nil { + return graphql.Null + } + return ec._OrgMembershipHistory(ctx, sel, obj) + case *generated.Organization: + if obj == nil { + return graphql.Null + } + return ec._Organization(ctx, sel, obj) + case *generated.OrganizationHistory: + if obj == nil { + return graphql.Null + } + return ec._OrganizationHistory(ctx, sel, obj) + case *generated.OrganizationSetting: + if obj == nil { + return graphql.Null + } + return ec._OrganizationSetting(ctx, sel, obj) + case *generated.OrganizationSettingHistory: + if obj == nil { + return graphql.Null + } + return ec._OrganizationSettingHistory(ctx, sel, obj) + case *generated.PersonalAccessToken: + if obj == nil { + return graphql.Null + } + return ec._PersonalAccessToken(ctx, sel, obj) + case *generated.Subscriber: + if obj == nil { + return graphql.Null + } + return ec._Subscriber(ctx, sel, obj) + case *generated.TFASetting: + if obj == nil { + return graphql.Null + } + return ec._TFASetting(ctx, sel, obj) + case *generated.Template: + if obj == nil { + return graphql.Null + } + return ec._Template(ctx, sel, obj) + case *generated.TemplateHistory: + if obj == nil { + return graphql.Null + } + return ec._TemplateHistory(ctx, sel, obj) + case *generated.User: + if obj == nil { + return graphql.Null + } + return ec._User(ctx, sel, obj) + case *generated.UserHistory: + if obj == nil { + return graphql.Null + } + return ec._UserHistory(ctx, sel, obj) + case *generated.UserSetting: + if obj == nil { + return graphql.Null + } + return ec._UserSetting(ctx, sel, obj) + case *generated.UserSettingHistory: + if obj == nil { + return graphql.Null + } + return ec._UserSettingHistory(ctx, sel, obj) + case *generated.Webhook: + if obj == nil { + return graphql.Null + } + return ec._Webhook(ctx, sel, obj) + case *generated.WebhookHistory: + if obj == nil { + return graphql.Null + } + return ec._WebhookHistory(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var aPITokenImplementors = []string{"APIToken", "Node"} + +func (ec *executionContext) _APIToken(ctx context.Context, sel ast.SelectionSet, obj *generated.APIToken) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, aPITokenImplementors) + + 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("APIToken") + case "id": + out.Values[i] = ec._APIToken_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._APIToken_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._APIToken_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._APIToken_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._APIToken_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._APIToken_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._APIToken_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._APIToken_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._APIToken_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._APIToken_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "token": + out.Values[i] = ec._APIToken_token(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "expiresAt": + out.Values[i] = ec._APIToken_expiresAt(ctx, field, obj) + case "description": + out.Values[i] = ec._APIToken_description(ctx, field, obj) + case "scopes": + out.Values[i] = ec._APIToken_scopes(ctx, field, obj) + case "lastUsedAt": + out.Values[i] = ec._APIToken_lastUsedAt(ctx, field, obj) + case "owner": + 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._APIToken_owner(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)) + } + } + 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 aPITokenBulkCreatePayloadImplementors = []string{"APITokenBulkCreatePayload"} + +func (ec *executionContext) _APITokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *APITokenBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, aPITokenBulkCreatePayloadImplementors) + + 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("APITokenBulkCreatePayload") + case "apiTokens": + out.Values[i] = ec._APITokenBulkCreatePayload_apiTokens(ctx, field, obj) + 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 aPITokenConnectionImplementors = []string{"APITokenConnection"} + +func (ec *executionContext) _APITokenConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.APITokenConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, aPITokenConnectionImplementors) + + 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("APITokenConnection") + case "edges": + out.Values[i] = ec._APITokenConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._APITokenConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._APITokenConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 aPITokenCreatePayloadImplementors = []string{"APITokenCreatePayload"} + +func (ec *executionContext) _APITokenCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *APITokenCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, aPITokenCreatePayloadImplementors) + + 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("APITokenCreatePayload") + case "apiToken": + out.Values[i] = ec._APITokenCreatePayload_apiToken(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 aPITokenDeletePayloadImplementors = []string{"APITokenDeletePayload"} + +func (ec *executionContext) _APITokenDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *APITokenDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, aPITokenDeletePayloadImplementors) + + 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("APITokenDeletePayload") + case "deletedID": + out.Values[i] = ec._APITokenDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 aPITokenEdgeImplementors = []string{"APITokenEdge"} + +func (ec *executionContext) _APITokenEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.APITokenEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, aPITokenEdgeImplementors) + + 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("APITokenEdge") + case "node": + out.Values[i] = ec._APITokenEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._APITokenEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 aPITokenUpdatePayloadImplementors = []string{"APITokenUpdatePayload"} + +func (ec *executionContext) _APITokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *APITokenUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, aPITokenUpdatePayloadImplementors) + + 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("APITokenUpdatePayload") + case "apiToken": + out.Values[i] = ec._APITokenUpdatePayload_apiToken(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 auditLogImplementors = []string{"AuditLog", "Node"} + +func (ec *executionContext) _AuditLog(ctx context.Context, sel ast.SelectionSet, obj *AuditLog) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, auditLogImplementors) + + 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("AuditLog") + case "table": + out.Values[i] = ec._AuditLog_table(ctx, field, obj) + case "time": + out.Values[i] = ec._AuditLog_time(ctx, field, obj) + case "id": + out.Values[i] = ec._AuditLog_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "operation": + out.Values[i] = ec._AuditLog_operation(ctx, field, obj) + case "changes": + out.Values[i] = ec._AuditLog_changes(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._AuditLog_updatedBy(ctx, field, obj) + 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 auditLogConnectionImplementors = []string{"AuditLogConnection"} + +func (ec *executionContext) _AuditLogConnection(ctx context.Context, sel ast.SelectionSet, obj *AuditLogConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, auditLogConnectionImplementors) + + 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("AuditLogConnection") + case "edges": + out.Values[i] = ec._AuditLogConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._AuditLogConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._AuditLogConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 auditLogEdgeImplementors = []string{"AuditLogEdge"} + +func (ec *executionContext) _AuditLogEdge(ctx context.Context, sel ast.SelectionSet, obj *AuditLogEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, auditLogEdgeImplementors) + + 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("AuditLogEdge") + case "node": + out.Values[i] = ec._AuditLogEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._AuditLogEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactImplementors = []string{"Contact", "Node"} + +func (ec *executionContext) _Contact(ctx context.Context, sel ast.SelectionSet, obj *generated.Contact) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactImplementors) + + 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("Contact") + case "id": + out.Values[i] = ec._Contact_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Contact_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Contact_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Contact_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Contact_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Contact_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Contact_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Contact_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Contact_ownerID(ctx, field, obj) + case "fullName": + out.Values[i] = ec._Contact_fullName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "title": + out.Values[i] = ec._Contact_title(ctx, field, obj) + case "company": + out.Values[i] = ec._Contact_company(ctx, field, obj) + case "email": + out.Values[i] = ec._Contact_email(ctx, field, obj) + case "phoneNumber": + out.Values[i] = ec._Contact_phoneNumber(ctx, field, obj) + case "address": + out.Values[i] = ec._Contact_address(ctx, field, obj) + case "status": + out.Values[i] = ec._Contact_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._Contact_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entities": + 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._Contact_entities(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)) + } + } + 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 contactBulkCreatePayloadImplementors = []string{"ContactBulkCreatePayload"} + +func (ec *executionContext) _ContactBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *ContactBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactBulkCreatePayloadImplementors) + + 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("ContactBulkCreatePayload") + case "contacts": + out.Values[i] = ec._ContactBulkCreatePayload_contacts(ctx, field, obj) + 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 contactConnectionImplementors = []string{"ContactConnection"} + +func (ec *executionContext) _ContactConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.ContactConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactConnectionImplementors) + + 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("ContactConnection") + case "edges": + out.Values[i] = ec._ContactConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._ContactConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._ContactConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactCreatePayloadImplementors = []string{"ContactCreatePayload"} + +func (ec *executionContext) _ContactCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *ContactCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactCreatePayloadImplementors) + + 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("ContactCreatePayload") + case "contact": + out.Values[i] = ec._ContactCreatePayload_contact(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactDeletePayloadImplementors = []string{"ContactDeletePayload"} + +func (ec *executionContext) _ContactDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *ContactDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactDeletePayloadImplementors) + + 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("ContactDeletePayload") + case "deletedID": + out.Values[i] = ec._ContactDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactEdgeImplementors = []string{"ContactEdge"} + +func (ec *executionContext) _ContactEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.ContactEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactEdgeImplementors) + + 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("ContactEdge") + case "node": + out.Values[i] = ec._ContactEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._ContactEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactHistoryImplementors = []string{"ContactHistory", "Node"} + +func (ec *executionContext) _ContactHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.ContactHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactHistoryImplementors) + + 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("ContactHistory") + case "id": + out.Values[i] = ec._ContactHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._ContactHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._ContactHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._ContactHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._ContactHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._ContactHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._ContactHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._ContactHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._ContactHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._ContactHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._ContactHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._ContactHistory_ownerID(ctx, field, obj) + case "fullName": + out.Values[i] = ec._ContactHistory_fullName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "title": + out.Values[i] = ec._ContactHistory_title(ctx, field, obj) + case "company": + out.Values[i] = ec._ContactHistory_company(ctx, field, obj) + case "email": + out.Values[i] = ec._ContactHistory_email(ctx, field, obj) + case "phoneNumber": + out.Values[i] = ec._ContactHistory_phoneNumber(ctx, field, obj) + case "address": + out.Values[i] = ec._ContactHistory_address(ctx, field, obj) + case "status": + out.Values[i] = ec._ContactHistory_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactHistoryConnectionImplementors = []string{"ContactHistoryConnection"} + +func (ec *executionContext) _ContactHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.ContactHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactHistoryConnectionImplementors) + + 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("ContactHistoryConnection") + case "edges": + out.Values[i] = ec._ContactHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._ContactHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._ContactHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactHistoryEdgeImplementors = []string{"ContactHistoryEdge"} + +func (ec *executionContext) _ContactHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.ContactHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactHistoryEdgeImplementors) + + 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("ContactHistoryEdge") + case "node": + out.Values[i] = ec._ContactHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._ContactHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 contactUpdatePayloadImplementors = []string{"ContactUpdatePayload"} + +func (ec *executionContext) _ContactUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *ContactUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, contactUpdatePayloadImplementors) + + 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("ContactUpdatePayload") + case "contact": + out.Values[i] = ec._ContactUpdatePayload_contact(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataImplementors = []string{"DocumentData", "Node"} + +func (ec *executionContext) _DocumentData(ctx context.Context, sel ast.SelectionSet, obj *generated.DocumentData) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataImplementors) + + 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("DocumentData") + case "id": + out.Values[i] = ec._DocumentData_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._DocumentData_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._DocumentData_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._DocumentData_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._DocumentData_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._DocumentData_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._DocumentData_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._DocumentData_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._DocumentData_ownerID(ctx, field, obj) + case "templateID": + out.Values[i] = ec._DocumentData_templateID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "data": + out.Values[i] = ec._DocumentData_data(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._DocumentData_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "template": + 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._DocumentData_template(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entity": + 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._DocumentData_entity(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)) + } + } + 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 documentDataBulkCreatePayloadImplementors = []string{"DocumentDataBulkCreatePayload"} + +func (ec *executionContext) _DocumentDataBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *DocumentDataBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataBulkCreatePayloadImplementors) + + 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("DocumentDataBulkCreatePayload") + case "documentData": + out.Values[i] = ec._DocumentDataBulkCreatePayload_documentData(ctx, field, obj) + 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 documentDataConnectionImplementors = []string{"DocumentDataConnection"} + +func (ec *executionContext) _DocumentDataConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.DocumentDataConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataConnectionImplementors) + + 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("DocumentDataConnection") + case "edges": + out.Values[i] = ec._DocumentDataConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._DocumentDataConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._DocumentDataConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataCreatePayloadImplementors = []string{"DocumentDataCreatePayload"} + +func (ec *executionContext) _DocumentDataCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *DocumentDataCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataCreatePayloadImplementors) + + 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("DocumentDataCreatePayload") + case "documentData": + out.Values[i] = ec._DocumentDataCreatePayload_documentData(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataDeletePayloadImplementors = []string{"DocumentDataDeletePayload"} + +func (ec *executionContext) _DocumentDataDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *DocumentDataDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataDeletePayloadImplementors) + + 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("DocumentDataDeletePayload") + case "deletedID": + out.Values[i] = ec._DocumentDataDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataEdgeImplementors = []string{"DocumentDataEdge"} + +func (ec *executionContext) _DocumentDataEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.DocumentDataEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataEdgeImplementors) + + 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("DocumentDataEdge") + case "node": + out.Values[i] = ec._DocumentDataEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._DocumentDataEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataHistoryImplementors = []string{"DocumentDataHistory", "Node"} + +func (ec *executionContext) _DocumentDataHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.DocumentDataHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataHistoryImplementors) + + 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("DocumentDataHistory") + case "id": + out.Values[i] = ec._DocumentDataHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._DocumentDataHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._DocumentDataHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._DocumentDataHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._DocumentDataHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._DocumentDataHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._DocumentDataHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._DocumentDataHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._DocumentDataHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._DocumentDataHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._DocumentDataHistory_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._DocumentDataHistory_ownerID(ctx, field, obj) + case "templateID": + out.Values[i] = ec._DocumentDataHistory_templateID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "data": + out.Values[i] = ec._DocumentDataHistory_data(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataHistoryConnectionImplementors = []string{"DocumentDataHistoryConnection"} + +func (ec *executionContext) _DocumentDataHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.DocumentDataHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataHistoryConnectionImplementors) + + 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("DocumentDataHistoryConnection") + case "edges": + out.Values[i] = ec._DocumentDataHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._DocumentDataHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._DocumentDataHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataHistoryEdgeImplementors = []string{"DocumentDataHistoryEdge"} + +func (ec *executionContext) _DocumentDataHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.DocumentDataHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataHistoryEdgeImplementors) + + 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("DocumentDataHistoryEdge") + case "node": + out.Values[i] = ec._DocumentDataHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._DocumentDataHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 documentDataUpdatePayloadImplementors = []string{"DocumentDataUpdatePayload"} + +func (ec *executionContext) _DocumentDataUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *DocumentDataUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, documentDataUpdatePayloadImplementors) + + 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("DocumentDataUpdatePayload") + case "documentData": + out.Values[i] = ec._DocumentDataUpdatePayload_documentData(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementImplementors = []string{"Entitlement", "Node"} + +func (ec *executionContext) _Entitlement(ctx context.Context, sel ast.SelectionSet, obj *generated.Entitlement) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementImplementors) + + 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("Entitlement") + case "id": + out.Values[i] = ec._Entitlement_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Entitlement_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Entitlement_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Entitlement_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Entitlement_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Entitlement_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Entitlement_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Entitlement_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Entitlement_ownerID(ctx, field, obj) + case "planID": + out.Values[i] = ec._Entitlement_planID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "organizationID": + out.Values[i] = ec._Entitlement_organizationID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "externalCustomerID": + out.Values[i] = ec._Entitlement_externalCustomerID(ctx, field, obj) + case "externalSubscriptionID": + out.Values[i] = ec._Entitlement_externalSubscriptionID(ctx, field, obj) + case "expires": + out.Values[i] = ec._Entitlement_expires(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "expiresAt": + out.Values[i] = ec._Entitlement_expiresAt(ctx, field, obj) + case "cancelled": + out.Values[i] = ec._Entitlement_cancelled(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._Entitlement_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "plan": + 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._Entitlement_plan(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organization": + 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._Entitlement_organization(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Entitlement_events(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)) + } + } + 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 entitlementBulkCreatePayloadImplementors = []string{"EntitlementBulkCreatePayload"} + +func (ec *executionContext) _EntitlementBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementBulkCreatePayloadImplementors) + + 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("EntitlementBulkCreatePayload") + case "entitlements": + out.Values[i] = ec._EntitlementBulkCreatePayload_entitlements(ctx, field, obj) + 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 entitlementConnectionImplementors = []string{"EntitlementConnection"} + +func (ec *executionContext) _EntitlementConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementConnectionImplementors) + + 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("EntitlementConnection") + case "edges": + out.Values[i] = ec._EntitlementConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntitlementConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntitlementConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementCreatePayloadImplementors = []string{"EntitlementCreatePayload"} + +func (ec *executionContext) _EntitlementCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementCreatePayloadImplementors) + + 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("EntitlementCreatePayload") + case "entitlement": + out.Values[i] = ec._EntitlementCreatePayload_entitlement(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementDeletePayloadImplementors = []string{"EntitlementDeletePayload"} + +func (ec *executionContext) _EntitlementDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementDeletePayloadImplementors) + + 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("EntitlementDeletePayload") + case "deletedID": + out.Values[i] = ec._EntitlementDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementEdgeImplementors = []string{"EntitlementEdge"} + +func (ec *executionContext) _EntitlementEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementEdgeImplementors) + + 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("EntitlementEdge") + case "node": + out.Values[i] = ec._EntitlementEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntitlementEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementHistoryImplementors = []string{"EntitlementHistory", "Node"} + +func (ec *executionContext) _EntitlementHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementHistoryImplementors) + + 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("EntitlementHistory") + case "id": + out.Values[i] = ec._EntitlementHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._EntitlementHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._EntitlementHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._EntitlementHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._EntitlementHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntitlementHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntitlementHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntitlementHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntitlementHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntitlementHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntitlementHistory_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntitlementHistory_ownerID(ctx, field, obj) + case "planID": + out.Values[i] = ec._EntitlementHistory_planID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "organizationID": + out.Values[i] = ec._EntitlementHistory_organizationID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "externalCustomerID": + out.Values[i] = ec._EntitlementHistory_externalCustomerID(ctx, field, obj) + case "externalSubscriptionID": + out.Values[i] = ec._EntitlementHistory_externalSubscriptionID(ctx, field, obj) + case "expires": + out.Values[i] = ec._EntitlementHistory_expires(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "expiresAt": + out.Values[i] = ec._EntitlementHistory_expiresAt(ctx, field, obj) + case "cancelled": + out.Values[i] = ec._EntitlementHistory_cancelled(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementHistoryConnectionImplementors = []string{"EntitlementHistoryConnection"} + +func (ec *executionContext) _EntitlementHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementHistoryConnectionImplementors) + + 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("EntitlementHistoryConnection") + case "edges": + out.Values[i] = ec._EntitlementHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntitlementHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntitlementHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementHistoryEdgeImplementors = []string{"EntitlementHistoryEdge"} + +func (ec *executionContext) _EntitlementHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementHistoryEdgeImplementors) + + 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("EntitlementHistoryEdge") + case "node": + out.Values[i] = ec._EntitlementHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntitlementHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanImplementors = []string{"EntitlementPlan", "Node"} + +func (ec *executionContext) _EntitlementPlan(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlan) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanImplementors) + + 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("EntitlementPlan") + case "id": + out.Values[i] = ec._EntitlementPlan_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._EntitlementPlan_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntitlementPlan_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntitlementPlan_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntitlementPlan_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntitlementPlan_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntitlementPlan_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntitlementPlan_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntitlementPlan_ownerID(ctx, field, obj) + case "displayName": + out.Values[i] = ec._EntitlementPlan_displayName(ctx, field, obj) + case "name": + out.Values[i] = ec._EntitlementPlan_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._EntitlementPlan_description(ctx, field, obj) + case "version": + out.Values[i] = ec._EntitlementPlan_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "metadata": + out.Values[i] = ec._EntitlementPlan_metadata(ctx, field, obj) + case "owner": + 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._EntitlementPlan_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitlements": + 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._EntitlementPlan_entitlements(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "baseFeatures": + 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._EntitlementPlan_baseFeatures(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._EntitlementPlan_events(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "features": + 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._EntitlementPlan_features(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)) + } + } + 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 entitlementPlanBulkCreatePayloadImplementors = []string{"EntitlementPlanBulkCreatePayload"} + +func (ec *executionContext) _EntitlementPlanBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanBulkCreatePayloadImplementors) + + 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("EntitlementPlanBulkCreatePayload") + case "entitlementPlans": + out.Values[i] = ec._EntitlementPlanBulkCreatePayload_entitlementPlans(ctx, field, obj) + 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 entitlementPlanConnectionImplementors = []string{"EntitlementPlanConnection"} + +func (ec *executionContext) _EntitlementPlanConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanConnectionImplementors) + + 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("EntitlementPlanConnection") + case "edges": + out.Values[i] = ec._EntitlementPlanConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntitlementPlanConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntitlementPlanConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanCreatePayloadImplementors = []string{"EntitlementPlanCreatePayload"} + +func (ec *executionContext) _EntitlementPlanCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanCreatePayloadImplementors) + + 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("EntitlementPlanCreatePayload") + case "entitlementPlan": + out.Values[i] = ec._EntitlementPlanCreatePayload_entitlementPlan(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanDeletePayloadImplementors = []string{"EntitlementPlanDeletePayload"} + +func (ec *executionContext) _EntitlementPlanDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanDeletePayloadImplementors) + + 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("EntitlementPlanDeletePayload") + case "deletedID": + out.Values[i] = ec._EntitlementPlanDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanEdgeImplementors = []string{"EntitlementPlanEdge"} + +func (ec *executionContext) _EntitlementPlanEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanEdgeImplementors) + + 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("EntitlementPlanEdge") + case "node": + out.Values[i] = ec._EntitlementPlanEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntitlementPlanEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureImplementors = []string{"EntitlementPlanFeature", "Node"} + +func (ec *executionContext) _EntitlementPlanFeature(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanFeature) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureImplementors) + + 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("EntitlementPlanFeature") + case "id": + out.Values[i] = ec._EntitlementPlanFeature_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._EntitlementPlanFeature_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntitlementPlanFeature_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntitlementPlanFeature_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntitlementPlanFeature_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntitlementPlanFeature_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntitlementPlanFeature_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntitlementPlanFeature_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntitlementPlanFeature_ownerID(ctx, field, obj) + case "metadata": + out.Values[i] = ec._EntitlementPlanFeature_metadata(ctx, field, obj) + case "planID": + out.Values[i] = ec._EntitlementPlanFeature_planID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "featureID": + out.Values[i] = ec._EntitlementPlanFeature_featureID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._EntitlementPlanFeature_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "plan": + 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._EntitlementPlanFeature_plan(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "feature": + 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._EntitlementPlanFeature_feature(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._EntitlementPlanFeature_events(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)) + } + } + 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 entitlementPlanFeatureBulkCreatePayloadImplementors = []string{"EntitlementPlanFeatureBulkCreatePayload"} + +func (ec *executionContext) _EntitlementPlanFeatureBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanFeatureBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureBulkCreatePayloadImplementors) + + 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("EntitlementPlanFeatureBulkCreatePayload") + case "entitlementPlanFeatures": + out.Values[i] = ec._EntitlementPlanFeatureBulkCreatePayload_entitlementPlanFeatures(ctx, field, obj) + 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 entitlementPlanFeatureConnectionImplementors = []string{"EntitlementPlanFeatureConnection"} + +func (ec *executionContext) _EntitlementPlanFeatureConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanFeatureConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureConnectionImplementors) + + 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("EntitlementPlanFeatureConnection") + case "edges": + out.Values[i] = ec._EntitlementPlanFeatureConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntitlementPlanFeatureConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntitlementPlanFeatureConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureCreatePayloadImplementors = []string{"EntitlementPlanFeatureCreatePayload"} + +func (ec *executionContext) _EntitlementPlanFeatureCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanFeatureCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureCreatePayloadImplementors) + + 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("EntitlementPlanFeatureCreatePayload") + case "entitlementPlanFeature": + out.Values[i] = ec._EntitlementPlanFeatureCreatePayload_entitlementPlanFeature(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureDeletePayloadImplementors = []string{"EntitlementPlanFeatureDeletePayload"} + +func (ec *executionContext) _EntitlementPlanFeatureDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanFeatureDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureDeletePayloadImplementors) + + 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("EntitlementPlanFeatureDeletePayload") + case "deletedID": + out.Values[i] = ec._EntitlementPlanFeatureDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureEdgeImplementors = []string{"EntitlementPlanFeatureEdge"} + +func (ec *executionContext) _EntitlementPlanFeatureEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanFeatureEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureEdgeImplementors) + + 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("EntitlementPlanFeatureEdge") + case "node": + out.Values[i] = ec._EntitlementPlanFeatureEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntitlementPlanFeatureEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureHistoryImplementors = []string{"EntitlementPlanFeatureHistory", "Node"} + +func (ec *executionContext) _EntitlementPlanFeatureHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanFeatureHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureHistoryImplementors) + + 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("EntitlementPlanFeatureHistory") + case "id": + out.Values[i] = ec._EntitlementPlanFeatureHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._EntitlementPlanFeatureHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._EntitlementPlanFeatureHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._EntitlementPlanFeatureHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._EntitlementPlanFeatureHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntitlementPlanFeatureHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntitlementPlanFeatureHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntitlementPlanFeatureHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntitlementPlanFeatureHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntitlementPlanFeatureHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntitlementPlanFeatureHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntitlementPlanFeatureHistory_ownerID(ctx, field, obj) + case "metadata": + out.Values[i] = ec._EntitlementPlanFeatureHistory_metadata(ctx, field, obj) + case "planID": + out.Values[i] = ec._EntitlementPlanFeatureHistory_planID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "featureID": + out.Values[i] = ec._EntitlementPlanFeatureHistory_featureID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureHistoryConnectionImplementors = []string{"EntitlementPlanFeatureHistoryConnection"} + +func (ec *executionContext) _EntitlementPlanFeatureHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanFeatureHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureHistoryConnectionImplementors) + + 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("EntitlementPlanFeatureHistoryConnection") + case "edges": + out.Values[i] = ec._EntitlementPlanFeatureHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntitlementPlanFeatureHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntitlementPlanFeatureHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureHistoryEdgeImplementors = []string{"EntitlementPlanFeatureHistoryEdge"} + +func (ec *executionContext) _EntitlementPlanFeatureHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanFeatureHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureHistoryEdgeImplementors) + + 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("EntitlementPlanFeatureHistoryEdge") + case "node": + out.Values[i] = ec._EntitlementPlanFeatureHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntitlementPlanFeatureHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanFeatureUpdatePayloadImplementors = []string{"EntitlementPlanFeatureUpdatePayload"} + +func (ec *executionContext) _EntitlementPlanFeatureUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanFeatureUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanFeatureUpdatePayloadImplementors) + + 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("EntitlementPlanFeatureUpdatePayload") + case "entitlementPlanFeature": + out.Values[i] = ec._EntitlementPlanFeatureUpdatePayload_entitlementPlanFeature(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanHistoryImplementors = []string{"EntitlementPlanHistory", "Node"} + +func (ec *executionContext) _EntitlementPlanHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanHistoryImplementors) + + 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("EntitlementPlanHistory") + case "id": + out.Values[i] = ec._EntitlementPlanHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._EntitlementPlanHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._EntitlementPlanHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._EntitlementPlanHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._EntitlementPlanHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntitlementPlanHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntitlementPlanHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntitlementPlanHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntitlementPlanHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntitlementPlanHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntitlementPlanHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntitlementPlanHistory_ownerID(ctx, field, obj) + case "displayName": + out.Values[i] = ec._EntitlementPlanHistory_displayName(ctx, field, obj) + case "name": + out.Values[i] = ec._EntitlementPlanHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._EntitlementPlanHistory_description(ctx, field, obj) + case "version": + out.Values[i] = ec._EntitlementPlanHistory_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "metadata": + out.Values[i] = ec._EntitlementPlanHistory_metadata(ctx, field, obj) + 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 entitlementPlanHistoryConnectionImplementors = []string{"EntitlementPlanHistoryConnection"} + +func (ec *executionContext) _EntitlementPlanHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanHistoryConnectionImplementors) + + 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("EntitlementPlanHistoryConnection") + case "edges": + out.Values[i] = ec._EntitlementPlanHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntitlementPlanHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntitlementPlanHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanHistoryEdgeImplementors = []string{"EntitlementPlanHistoryEdge"} + +func (ec *executionContext) _EntitlementPlanHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntitlementPlanHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanHistoryEdgeImplementors) + + 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("EntitlementPlanHistoryEdge") + case "node": + out.Values[i] = ec._EntitlementPlanHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntitlementPlanHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementPlanUpdatePayloadImplementors = []string{"EntitlementPlanUpdatePayload"} + +func (ec *executionContext) _EntitlementPlanUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementPlanUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementPlanUpdatePayloadImplementors) + + 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("EntitlementPlanUpdatePayload") + case "entitlementPlan": + out.Values[i] = ec._EntitlementPlanUpdatePayload_entitlementPlan(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entitlementUpdatePayloadImplementors = []string{"EntitlementUpdatePayload"} + +func (ec *executionContext) _EntitlementUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntitlementUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entitlementUpdatePayloadImplementors) + + 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("EntitlementUpdatePayload") + case "entitlement": + out.Values[i] = ec._EntitlementUpdatePayload_entitlement(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityImplementors = []string{"Entity", "Node"} + +func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet, obj *generated.Entity) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors) + + 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("Entity") + case "id": + out.Values[i] = ec._Entity_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Entity_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Entity_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Entity_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Entity_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Entity_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Entity_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Entity_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Entity_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._Entity_name(ctx, field, obj) + case "displayName": + out.Values[i] = ec._Entity_displayName(ctx, field, obj) + case "description": + out.Values[i] = ec._Entity_description(ctx, field, obj) + case "domains": + out.Values[i] = ec._Entity_domains(ctx, field, obj) + case "entityTypeID": + out.Values[i] = ec._Entity_entityTypeID(ctx, field, obj) + case "status": + out.Values[i] = ec._Entity_status(ctx, field, obj) + case "owner": + 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._Entity_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "contacts": + 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._Entity_contacts(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "documents": + 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._Entity_documents(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "notes": + 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._Entity_notes(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "files": + 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._Entity_files(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entityType": + 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._Entity_entityType(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)) + } + } + 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 entityBulkCreatePayloadImplementors = []string{"EntityBulkCreatePayload"} + +func (ec *executionContext) _EntityBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityBulkCreatePayloadImplementors) + + 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("EntityBulkCreatePayload") + case "entities": + out.Values[i] = ec._EntityBulkCreatePayload_entities(ctx, field, obj) + 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 entityConnectionImplementors = []string{"EntityConnection"} + +func (ec *executionContext) _EntityConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityConnectionImplementors) + + 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("EntityConnection") + case "edges": + out.Values[i] = ec._EntityConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntityConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntityConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityCreatePayloadImplementors = []string{"EntityCreatePayload"} + +func (ec *executionContext) _EntityCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityCreatePayloadImplementors) + + 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("EntityCreatePayload") + case "entity": + out.Values[i] = ec._EntityCreatePayload_entity(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityDeletePayloadImplementors = []string{"EntityDeletePayload"} + +func (ec *executionContext) _EntityDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityDeletePayloadImplementors) + + 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("EntityDeletePayload") + case "deletedID": + out.Values[i] = ec._EntityDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityEdgeImplementors = []string{"EntityEdge"} + +func (ec *executionContext) _EntityEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityEdgeImplementors) + + 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("EntityEdge") + case "node": + out.Values[i] = ec._EntityEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntityEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityHistoryImplementors = []string{"EntityHistory", "Node"} + +func (ec *executionContext) _EntityHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityHistoryImplementors) + + 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("EntityHistory") + case "id": + out.Values[i] = ec._EntityHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._EntityHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._EntityHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._EntityHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._EntityHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntityHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntityHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntityHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntityHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntityHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntityHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntityHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._EntityHistory_name(ctx, field, obj) + case "displayName": + out.Values[i] = ec._EntityHistory_displayName(ctx, field, obj) + case "description": + out.Values[i] = ec._EntityHistory_description(ctx, field, obj) + case "domains": + out.Values[i] = ec._EntityHistory_domains(ctx, field, obj) + case "entityTypeID": + out.Values[i] = ec._EntityHistory_entityTypeID(ctx, field, obj) + case "status": + out.Values[i] = ec._EntityHistory_status(ctx, field, obj) + 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 entityHistoryConnectionImplementors = []string{"EntityHistoryConnection"} + +func (ec *executionContext) _EntityHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityHistoryConnectionImplementors) + + 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("EntityHistoryConnection") + case "edges": + out.Values[i] = ec._EntityHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntityHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntityHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityHistoryEdgeImplementors = []string{"EntityHistoryEdge"} + +func (ec *executionContext) _EntityHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityHistoryEdgeImplementors) + + 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("EntityHistoryEdge") + case "node": + out.Values[i] = ec._EntityHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntityHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeImplementors = []string{"EntityType", "Node"} + +func (ec *executionContext) _EntityType(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityType) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeImplementors) + + 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("EntityType") + case "id": + out.Values[i] = ec._EntityType_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._EntityType_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntityType_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntityType_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntityType_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntityType_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntityType_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntityType_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntityType_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._EntityType_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._EntityType_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entities": + 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._EntityType_entities(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)) + } + } + 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 entityTypeBulkCreatePayloadImplementors = []string{"EntityTypeBulkCreatePayload"} + +func (ec *executionContext) _EntityTypeBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityTypeBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeBulkCreatePayloadImplementors) + + 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("EntityTypeBulkCreatePayload") + case "entityTypes": + out.Values[i] = ec._EntityTypeBulkCreatePayload_entityTypes(ctx, field, obj) + 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 entityTypeConnectionImplementors = []string{"EntityTypeConnection"} + +func (ec *executionContext) _EntityTypeConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityTypeConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeConnectionImplementors) + + 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("EntityTypeConnection") + case "edges": + out.Values[i] = ec._EntityTypeConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntityTypeConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntityTypeConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeCreatePayloadImplementors = []string{"EntityTypeCreatePayload"} + +func (ec *executionContext) _EntityTypeCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityTypeCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeCreatePayloadImplementors) + + 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("EntityTypeCreatePayload") + case "entityType": + out.Values[i] = ec._EntityTypeCreatePayload_entityType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeDeletePayloadImplementors = []string{"EntityTypeDeletePayload"} + +func (ec *executionContext) _EntityTypeDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityTypeDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeDeletePayloadImplementors) + + 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("EntityTypeDeletePayload") + case "deletedID": + out.Values[i] = ec._EntityTypeDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeEdgeImplementors = []string{"EntityTypeEdge"} + +func (ec *executionContext) _EntityTypeEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityTypeEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeEdgeImplementors) + + 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("EntityTypeEdge") + case "node": + out.Values[i] = ec._EntityTypeEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntityTypeEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeHistoryImplementors = []string{"EntityTypeHistory", "Node"} + +func (ec *executionContext) _EntityTypeHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityTypeHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeHistoryImplementors) + + 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("EntityTypeHistory") + case "id": + out.Values[i] = ec._EntityTypeHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._EntityTypeHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._EntityTypeHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._EntityTypeHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._EntityTypeHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EntityTypeHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EntityTypeHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EntityTypeHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._EntityTypeHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._EntityTypeHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EntityTypeHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._EntityTypeHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._EntityTypeHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeHistoryConnectionImplementors = []string{"EntityTypeHistoryConnection"} + +func (ec *executionContext) _EntityTypeHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityTypeHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeHistoryConnectionImplementors) + + 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("EntityTypeHistoryConnection") + case "edges": + out.Values[i] = ec._EntityTypeHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EntityTypeHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EntityTypeHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeHistoryEdgeImplementors = []string{"EntityTypeHistoryEdge"} + +func (ec *executionContext) _EntityTypeHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EntityTypeHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeHistoryEdgeImplementors) + + 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("EntityTypeHistoryEdge") + case "node": + out.Values[i] = ec._EntityTypeHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EntityTypeHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityTypeUpdatePayloadImplementors = []string{"EntityTypeUpdatePayload"} + +func (ec *executionContext) _EntityTypeUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityTypeUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityTypeUpdatePayloadImplementors) + + 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("EntityTypeUpdatePayload") + case "entityType": + out.Values[i] = ec._EntityTypeUpdatePayload_entityType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 entityUpdatePayloadImplementors = []string{"EntityUpdatePayload"} + +func (ec *executionContext) _EntityUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *EntityUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, entityUpdatePayloadImplementors) + + 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("EntityUpdatePayload") + case "entity": + out.Values[i] = ec._EntityUpdatePayload_entity(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 eventImplementors = []string{"Event", "Node"} + +func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, obj *generated.Event) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventImplementors) + + 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("Event") + case "id": + out.Values[i] = ec._Event_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Event_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Event_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Event_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Event_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Event_tags(ctx, field, obj) + case "eventID": + out.Values[i] = ec._Event_eventID(ctx, field, obj) + case "correlationID": + out.Values[i] = ec._Event_correlationID(ctx, field, obj) + case "eventType": + out.Values[i] = ec._Event_eventType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "metadata": + out.Values[i] = ec._Event_metadata(ctx, field, obj) + case "user": + 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._Event_user(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "group": + 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._Event_group(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "integration": + 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._Event_integration(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organization": + 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._Event_organization(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "invite": + 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._Event_invite(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "feature": + 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._Event_feature(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitlementplan": + 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._Event_entitlementplan(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitlementplanfeature": + 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._Event_entitlementplanfeature(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "personalAccessToken": + 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._Event_personalAccessToken(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "oauth2token": + 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._Event_oauth2token(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "hush": + 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._Event_hush(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "orgmembership": + 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._Event_orgmembership(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "groupmembership": + 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._Event_groupmembership(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitlement": + 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._Event_entitlement(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "webhook": + 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._Event_webhook(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "subscriber": + 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._Event_subscriber(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)) + } + } + 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 eventBulkCreatePayloadImplementors = []string{"EventBulkCreatePayload"} + +func (ec *executionContext) _EventBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EventBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventBulkCreatePayloadImplementors) + + 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("EventBulkCreatePayload") + case "events": + out.Values[i] = ec._EventBulkCreatePayload_events(ctx, field, obj) + 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 eventConnectionImplementors = []string{"EventConnection"} + +func (ec *executionContext) _EventConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EventConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventConnectionImplementors) + + 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("EventConnection") + case "edges": + out.Values[i] = ec._EventConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EventConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EventConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 eventCreatePayloadImplementors = []string{"EventCreatePayload"} + +func (ec *executionContext) _EventCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *EventCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventCreatePayloadImplementors) + + 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("EventCreatePayload") + case "event": + out.Values[i] = ec._EventCreatePayload_event(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 eventDeletePayloadImplementors = []string{"EventDeletePayload"} + +func (ec *executionContext) _EventDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *EventDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventDeletePayloadImplementors) + + 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("EventDeletePayload") + case "deletedID": + out.Values[i] = ec._EventDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 eventEdgeImplementors = []string{"EventEdge"} + +func (ec *executionContext) _EventEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EventEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventEdgeImplementors) + + 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("EventEdge") + case "node": + out.Values[i] = ec._EventEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EventEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 eventHistoryImplementors = []string{"EventHistory", "Node"} + +func (ec *executionContext) _EventHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.EventHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventHistoryImplementors) + + 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("EventHistory") + case "id": + out.Values[i] = ec._EventHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._EventHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._EventHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._EventHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._EventHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._EventHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._EventHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._EventHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._EventHistory_tags(ctx, field, obj) + case "eventID": + out.Values[i] = ec._EventHistory_eventID(ctx, field, obj) + case "correlationID": + out.Values[i] = ec._EventHistory_correlationID(ctx, field, obj) + case "eventType": + out.Values[i] = ec._EventHistory_eventType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "metadata": + out.Values[i] = ec._EventHistory_metadata(ctx, field, obj) + 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 eventHistoryConnectionImplementors = []string{"EventHistoryConnection"} + +func (ec *executionContext) _EventHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.EventHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventHistoryConnectionImplementors) + + 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("EventHistoryConnection") + case "edges": + out.Values[i] = ec._EventHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._EventHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._EventHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 eventHistoryEdgeImplementors = []string{"EventHistoryEdge"} + +func (ec *executionContext) _EventHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.EventHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventHistoryEdgeImplementors) + + 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("EventHistoryEdge") + case "node": + out.Values[i] = ec._EventHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._EventHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 eventUpdatePayloadImplementors = []string{"EventUpdatePayload"} + +func (ec *executionContext) _EventUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *EventUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, eventUpdatePayloadImplementors) + + 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("EventUpdatePayload") + case "event": + out.Values[i] = ec._EventUpdatePayload_event(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 featureImplementors = []string{"Feature", "Node"} + +func (ec *executionContext) _Feature(ctx context.Context, sel ast.SelectionSet, obj *generated.Feature) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureImplementors) + + 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("Feature") + case "id": + out.Values[i] = ec._Feature_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Feature_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Feature_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Feature_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Feature_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Feature_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Feature_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Feature_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Feature_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._Feature_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "displayName": + out.Values[i] = ec._Feature_displayName(ctx, field, obj) + case "enabled": + out.Values[i] = ec._Feature_enabled(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Feature_description(ctx, field, obj) + case "metadata": + out.Values[i] = ec._Feature_metadata(ctx, field, obj) + case "owner": + 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._Feature_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "plans": + 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._Feature_plans(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Feature_events(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "features": + 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._Feature_features(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)) + } + } + 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 featureBulkCreatePayloadImplementors = []string{"FeatureBulkCreatePayload"} + +func (ec *executionContext) _FeatureBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *FeatureBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureBulkCreatePayloadImplementors) + + 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("FeatureBulkCreatePayload") + case "features": + out.Values[i] = ec._FeatureBulkCreatePayload_features(ctx, field, obj) + 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 featureConnectionImplementors = []string{"FeatureConnection"} + +func (ec *executionContext) _FeatureConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.FeatureConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureConnectionImplementors) + + 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("FeatureConnection") + case "edges": + out.Values[i] = ec._FeatureConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._FeatureConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._FeatureConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 featureCreatePayloadImplementors = []string{"FeatureCreatePayload"} + +func (ec *executionContext) _FeatureCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *FeatureCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureCreatePayloadImplementors) + + 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("FeatureCreatePayload") + case "feature": + out.Values[i] = ec._FeatureCreatePayload_feature(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 featureDeletePayloadImplementors = []string{"FeatureDeletePayload"} + +func (ec *executionContext) _FeatureDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *FeatureDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureDeletePayloadImplementors) + + 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("FeatureDeletePayload") + case "deletedID": + out.Values[i] = ec._FeatureDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 featureEdgeImplementors = []string{"FeatureEdge"} + +func (ec *executionContext) _FeatureEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.FeatureEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureEdgeImplementors) + + 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("FeatureEdge") + case "node": + out.Values[i] = ec._FeatureEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._FeatureEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 featureHistoryImplementors = []string{"FeatureHistory", "Node"} + +func (ec *executionContext) _FeatureHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.FeatureHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureHistoryImplementors) + + 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("FeatureHistory") + case "id": + out.Values[i] = ec._FeatureHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._FeatureHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._FeatureHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._FeatureHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._FeatureHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._FeatureHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._FeatureHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._FeatureHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._FeatureHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._FeatureHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._FeatureHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._FeatureHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._FeatureHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "displayName": + out.Values[i] = ec._FeatureHistory_displayName(ctx, field, obj) + case "enabled": + out.Values[i] = ec._FeatureHistory_enabled(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._FeatureHistory_description(ctx, field, obj) + case "metadata": + out.Values[i] = ec._FeatureHistory_metadata(ctx, field, obj) + 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 featureHistoryConnectionImplementors = []string{"FeatureHistoryConnection"} + +func (ec *executionContext) _FeatureHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.FeatureHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureHistoryConnectionImplementors) + + 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("FeatureHistoryConnection") + case "edges": + out.Values[i] = ec._FeatureHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._FeatureHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._FeatureHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 featureHistoryEdgeImplementors = []string{"FeatureHistoryEdge"} + +func (ec *executionContext) _FeatureHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.FeatureHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureHistoryEdgeImplementors) + + 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("FeatureHistoryEdge") + case "node": + out.Values[i] = ec._FeatureHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._FeatureHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 featureUpdatePayloadImplementors = []string{"FeatureUpdatePayload"} + +func (ec *executionContext) _FeatureUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *FeatureUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, featureUpdatePayloadImplementors) + + 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("FeatureUpdatePayload") + case "feature": + out.Values[i] = ec._FeatureUpdatePayload_feature(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 fileImplementors = []string{"File", "Node"} + +func (ec *executionContext) _File(ctx context.Context, sel ast.SelectionSet, obj *generated.File) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileImplementors) + + 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("File") + case "id": + out.Values[i] = ec._File_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._File_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._File_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._File_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._File_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._File_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._File_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._File_tags(ctx, field, obj) + case "fileName": + out.Values[i] = ec._File_fileName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "fileExtension": + out.Values[i] = ec._File_fileExtension(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "fileSize": + out.Values[i] = ec._File_fileSize(ctx, field, obj) + case "contentType": + out.Values[i] = ec._File_contentType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "storeKey": + out.Values[i] = ec._File_storeKey(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "category": + out.Values[i] = ec._File_category(ctx, field, obj) + case "annotation": + out.Values[i] = ec._File_annotation(ctx, field, obj) + case "user": + 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._File_user(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organization": + 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._File_organization(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entity": + 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._File_entity(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "group": + 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._File_group(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)) + } + } + 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 fileBulkCreatePayloadImplementors = []string{"FileBulkCreatePayload"} + +func (ec *executionContext) _FileBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *FileBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileBulkCreatePayloadImplementors) + + 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("FileBulkCreatePayload") + case "files": + out.Values[i] = ec._FileBulkCreatePayload_files(ctx, field, obj) + 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 fileConnectionImplementors = []string{"FileConnection"} + +func (ec *executionContext) _FileConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.FileConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileConnectionImplementors) + + 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("FileConnection") + case "edges": + out.Values[i] = ec._FileConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._FileConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._FileConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 fileCreatePayloadImplementors = []string{"FileCreatePayload"} + +func (ec *executionContext) _FileCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *FileCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileCreatePayloadImplementors) + + 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("FileCreatePayload") + case "file": + out.Values[i] = ec._FileCreatePayload_file(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 fileDeletePayloadImplementors = []string{"FileDeletePayload"} + +func (ec *executionContext) _FileDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *FileDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileDeletePayloadImplementors) + + 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("FileDeletePayload") + case "deletedID": + out.Values[i] = ec._FileDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 fileEdgeImplementors = []string{"FileEdge"} + +func (ec *executionContext) _FileEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.FileEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileEdgeImplementors) + + 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("FileEdge") + case "node": + out.Values[i] = ec._FileEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._FileEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 fileHistoryImplementors = []string{"FileHistory", "Node"} + +func (ec *executionContext) _FileHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.FileHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileHistoryImplementors) + + 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("FileHistory") + case "id": + out.Values[i] = ec._FileHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._FileHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._FileHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._FileHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._FileHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._FileHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._FileHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._FileHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._FileHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._FileHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._FileHistory_tags(ctx, field, obj) + case "fileName": + out.Values[i] = ec._FileHistory_fileName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fileExtension": + out.Values[i] = ec._FileHistory_fileExtension(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fileSize": + out.Values[i] = ec._FileHistory_fileSize(ctx, field, obj) + case "contentType": + out.Values[i] = ec._FileHistory_contentType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "storeKey": + out.Values[i] = ec._FileHistory_storeKey(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "category": + out.Values[i] = ec._FileHistory_category(ctx, field, obj) + case "annotation": + out.Values[i] = ec._FileHistory_annotation(ctx, field, obj) + 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 fileHistoryConnectionImplementors = []string{"FileHistoryConnection"} + +func (ec *executionContext) _FileHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.FileHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileHistoryConnectionImplementors) + + 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("FileHistoryConnection") + case "edges": + out.Values[i] = ec._FileHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._FileHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._FileHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 fileHistoryEdgeImplementors = []string{"FileHistoryEdge"} + +func (ec *executionContext) _FileHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.FileHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileHistoryEdgeImplementors) + + 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("FileHistoryEdge") + case "node": + out.Values[i] = ec._FileHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._FileHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 fileUpdatePayloadImplementors = []string{"FileUpdatePayload"} + +func (ec *executionContext) _FileUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *FileUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fileUpdatePayloadImplementors) + + 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("FileUpdatePayload") + case "file": + out.Values[i] = ec._FileUpdatePayload_file(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 globalSearchResultConnectionImplementors = []string{"GlobalSearchResultConnection"} + +func (ec *executionContext) _GlobalSearchResultConnection(ctx context.Context, sel ast.SelectionSet, obj *GlobalSearchResultConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, globalSearchResultConnectionImplementors) + + 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("GlobalSearchResultConnection") + case "page": + out.Values[i] = ec._GlobalSearchResultConnection_page(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "nodes": + out.Values[i] = ec._GlobalSearchResultConnection_nodes(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupImplementors = []string{"Group", "Node"} + +func (ec *executionContext) _Group(ctx context.Context, sel ast.SelectionSet, obj *generated.Group) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupImplementors) + + 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("Group") + case "id": + out.Values[i] = ec._Group_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Group_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Group_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Group_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Group_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Group_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Group_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Group_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Group_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._Group_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Group_description(ctx, field, obj) + case "gravatarLogoURL": + out.Values[i] = ec._Group_gravatarLogoURL(ctx, field, obj) + case "logoURL": + out.Values[i] = ec._Group_logoURL(ctx, field, obj) + case "displayName": + out.Values[i] = ec._Group_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._Group_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "setting": + 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._Group_setting(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "users": + 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._Group_users(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Group_events(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "integrations": + 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._Group_integrations(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "files": + 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._Group_files(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "members": + 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._Group_members(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)) + } + } + 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 groupBulkCreatePayloadImplementors = []string{"GroupBulkCreatePayload"} + +func (ec *executionContext) _GroupBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupBulkCreatePayloadImplementors) + + 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("GroupBulkCreatePayload") + case "groups": + out.Values[i] = ec._GroupBulkCreatePayload_groups(ctx, field, obj) + 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 groupConnectionImplementors = []string{"GroupConnection"} + +func (ec *executionContext) _GroupConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupConnectionImplementors) + + 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("GroupConnection") + case "edges": + out.Values[i] = ec._GroupConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._GroupConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._GroupConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupCreatePayloadImplementors = []string{"GroupCreatePayload"} + +func (ec *executionContext) _GroupCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupCreatePayloadImplementors) + + 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("GroupCreatePayload") + case "group": + out.Values[i] = ec._GroupCreatePayload_group(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupDeletePayloadImplementors = []string{"GroupDeletePayload"} + +func (ec *executionContext) _GroupDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupDeletePayloadImplementors) + + 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("GroupDeletePayload") + case "deletedID": + out.Values[i] = ec._GroupDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupEdgeImplementors = []string{"GroupEdge"} + +func (ec *executionContext) _GroupEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupEdgeImplementors) + + 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("GroupEdge") + case "node": + out.Values[i] = ec._GroupEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._GroupEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupHistoryImplementors = []string{"GroupHistory", "Node"} + +func (ec *executionContext) _GroupHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupHistoryImplementors) + + 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("GroupHistory") + case "id": + out.Values[i] = ec._GroupHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._GroupHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._GroupHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._GroupHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._GroupHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._GroupHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._GroupHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._GroupHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._GroupHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._GroupHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._GroupHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._GroupHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._GroupHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._GroupHistory_description(ctx, field, obj) + case "gravatarLogoURL": + out.Values[i] = ec._GroupHistory_gravatarLogoURL(ctx, field, obj) + case "logoURL": + out.Values[i] = ec._GroupHistory_logoURL(ctx, field, obj) + case "displayName": + out.Values[i] = ec._GroupHistory_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupHistoryConnectionImplementors = []string{"GroupHistoryConnection"} + +func (ec *executionContext) _GroupHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupHistoryConnectionImplementors) + + 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("GroupHistoryConnection") + case "edges": + out.Values[i] = ec._GroupHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._GroupHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._GroupHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupHistoryEdgeImplementors = []string{"GroupHistoryEdge"} + +func (ec *executionContext) _GroupHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupHistoryEdgeImplementors) + + 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("GroupHistoryEdge") + case "node": + out.Values[i] = ec._GroupHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._GroupHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipImplementors = []string{"GroupMembership", "Node"} + +func (ec *executionContext) _GroupMembership(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupMembership) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipImplementors) + + 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("GroupMembership") + case "id": + out.Values[i] = ec._GroupMembership_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._GroupMembership_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._GroupMembership_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._GroupMembership_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._GroupMembership_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._GroupMembership_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._GroupMembership_deletedBy(ctx, field, obj) + case "role": + out.Values[i] = ec._GroupMembership_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "groupID": + out.Values[i] = ec._GroupMembership_groupID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "userID": + out.Values[i] = ec._GroupMembership_userID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "group": + 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._GroupMembership_group(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "user": + 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._GroupMembership_user(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._GroupMembership_events(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)) + } + } + 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 groupMembershipBulkCreatePayloadImplementors = []string{"GroupMembershipBulkCreatePayload"} + +func (ec *executionContext) _GroupMembershipBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupMembershipBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipBulkCreatePayloadImplementors) + + 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("GroupMembershipBulkCreatePayload") + case "groupMemberships": + out.Values[i] = ec._GroupMembershipBulkCreatePayload_groupMemberships(ctx, field, obj) + 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 groupMembershipConnectionImplementors = []string{"GroupMembershipConnection"} + +func (ec *executionContext) _GroupMembershipConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupMembershipConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipConnectionImplementors) + + 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("GroupMembershipConnection") + case "edges": + out.Values[i] = ec._GroupMembershipConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._GroupMembershipConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._GroupMembershipConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipCreatePayloadImplementors = []string{"GroupMembershipCreatePayload"} + +func (ec *executionContext) _GroupMembershipCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupMembershipCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipCreatePayloadImplementors) + + 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("GroupMembershipCreatePayload") + case "groupMembership": + out.Values[i] = ec._GroupMembershipCreatePayload_groupMembership(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipDeletePayloadImplementors = []string{"GroupMembershipDeletePayload"} + +func (ec *executionContext) _GroupMembershipDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupMembershipDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipDeletePayloadImplementors) + + 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("GroupMembershipDeletePayload") + case "deletedID": + out.Values[i] = ec._GroupMembershipDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipEdgeImplementors = []string{"GroupMembershipEdge"} + +func (ec *executionContext) _GroupMembershipEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupMembershipEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipEdgeImplementors) + + 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("GroupMembershipEdge") + case "node": + out.Values[i] = ec._GroupMembershipEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._GroupMembershipEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipHistoryImplementors = []string{"GroupMembershipHistory", "Node"} + +func (ec *executionContext) _GroupMembershipHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupMembershipHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipHistoryImplementors) + + 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("GroupMembershipHistory") + case "id": + out.Values[i] = ec._GroupMembershipHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._GroupMembershipHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._GroupMembershipHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._GroupMembershipHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._GroupMembershipHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._GroupMembershipHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._GroupMembershipHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._GroupMembershipHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._GroupMembershipHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._GroupMembershipHistory_deletedBy(ctx, field, obj) + case "role": + out.Values[i] = ec._GroupMembershipHistory_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "groupID": + out.Values[i] = ec._GroupMembershipHistory_groupID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "userID": + out.Values[i] = ec._GroupMembershipHistory_userID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipHistoryConnectionImplementors = []string{"GroupMembershipHistoryConnection"} + +func (ec *executionContext) _GroupMembershipHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupMembershipHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipHistoryConnectionImplementors) + + 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("GroupMembershipHistoryConnection") + case "edges": + out.Values[i] = ec._GroupMembershipHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._GroupMembershipHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._GroupMembershipHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipHistoryEdgeImplementors = []string{"GroupMembershipHistoryEdge"} + +func (ec *executionContext) _GroupMembershipHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupMembershipHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipHistoryEdgeImplementors) + + 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("GroupMembershipHistoryEdge") + case "node": + out.Values[i] = ec._GroupMembershipHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._GroupMembershipHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupMembershipUpdatePayloadImplementors = []string{"GroupMembershipUpdatePayload"} + +func (ec *executionContext) _GroupMembershipUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupMembershipUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupMembershipUpdatePayloadImplementors) + + 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("GroupMembershipUpdatePayload") + case "groupMembership": + out.Values[i] = ec._GroupMembershipUpdatePayload_groupMembership(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupSearchResultImplementors = []string{"GroupSearchResult", "GlobalSearchResult"} + +func (ec *executionContext) _GroupSearchResult(ctx context.Context, sel ast.SelectionSet, obj *GroupSearchResult) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSearchResultImplementors) + + 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("GroupSearchResult") + case "groups": + out.Values[i] = ec._GroupSearchResult_groups(ctx, field, obj) + 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 groupSettingImplementors = []string{"GroupSetting", "Node"} + +func (ec *executionContext) _GroupSetting(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupSetting) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingImplementors) + + 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("GroupSetting") + case "id": + out.Values[i] = ec._GroupSetting_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._GroupSetting_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._GroupSetting_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._GroupSetting_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._GroupSetting_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._GroupSetting_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._GroupSetting_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._GroupSetting_deletedBy(ctx, field, obj) + case "visibility": + out.Values[i] = ec._GroupSetting_visibility(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "joinPolicy": + out.Values[i] = ec._GroupSetting_joinPolicy(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "syncToSlack": + out.Values[i] = ec._GroupSetting_syncToSlack(ctx, field, obj) + case "syncToGithub": + out.Values[i] = ec._GroupSetting_syncToGithub(ctx, field, obj) + case "groupID": + out.Values[i] = ec._GroupSetting_groupID(ctx, field, obj) + case "group": + 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._GroupSetting_group(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)) + } + } + 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 groupSettingBulkCreatePayloadImplementors = []string{"GroupSettingBulkCreatePayload"} + +func (ec *executionContext) _GroupSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupSettingBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingBulkCreatePayloadImplementors) + + 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("GroupSettingBulkCreatePayload") + case "groupSettings": + out.Values[i] = ec._GroupSettingBulkCreatePayload_groupSettings(ctx, field, obj) + 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 groupSettingConnectionImplementors = []string{"GroupSettingConnection"} + +func (ec *executionContext) _GroupSettingConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupSettingConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingConnectionImplementors) + + 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("GroupSettingConnection") + case "edges": + out.Values[i] = ec._GroupSettingConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._GroupSettingConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._GroupSettingConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupSettingCreatePayloadImplementors = []string{"GroupSettingCreatePayload"} + +func (ec *executionContext) _GroupSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupSettingCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingCreatePayloadImplementors) + + 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("GroupSettingCreatePayload") + case "groupSetting": + out.Values[i] = ec._GroupSettingCreatePayload_groupSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupSettingDeletePayloadImplementors = []string{"GroupSettingDeletePayload"} + +func (ec *executionContext) _GroupSettingDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupSettingDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingDeletePayloadImplementors) + + 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("GroupSettingDeletePayload") + case "deletedID": + out.Values[i] = ec._GroupSettingDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupSettingEdgeImplementors = []string{"GroupSettingEdge"} + +func (ec *executionContext) _GroupSettingEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupSettingEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingEdgeImplementors) + + 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("GroupSettingEdge") + case "node": + out.Values[i] = ec._GroupSettingEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._GroupSettingEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupSettingHistoryImplementors = []string{"GroupSettingHistory", "Node"} + +func (ec *executionContext) _GroupSettingHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupSettingHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingHistoryImplementors) + + 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("GroupSettingHistory") + case "id": + out.Values[i] = ec._GroupSettingHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._GroupSettingHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._GroupSettingHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._GroupSettingHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._GroupSettingHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._GroupSettingHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._GroupSettingHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._GroupSettingHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._GroupSettingHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._GroupSettingHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._GroupSettingHistory_deletedBy(ctx, field, obj) + case "visibility": + out.Values[i] = ec._GroupSettingHistory_visibility(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "joinPolicy": + out.Values[i] = ec._GroupSettingHistory_joinPolicy(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "syncToSlack": + out.Values[i] = ec._GroupSettingHistory_syncToSlack(ctx, field, obj) + case "syncToGithub": + out.Values[i] = ec._GroupSettingHistory_syncToGithub(ctx, field, obj) + case "groupID": + out.Values[i] = ec._GroupSettingHistory_groupID(ctx, field, obj) + 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 groupSettingHistoryConnectionImplementors = []string{"GroupSettingHistoryConnection"} + +func (ec *executionContext) _GroupSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupSettingHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingHistoryConnectionImplementors) + + 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("GroupSettingHistoryConnection") + case "edges": + out.Values[i] = ec._GroupSettingHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._GroupSettingHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._GroupSettingHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupSettingHistoryEdgeImplementors = []string{"GroupSettingHistoryEdge"} + +func (ec *executionContext) _GroupSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.GroupSettingHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingHistoryEdgeImplementors) + + 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("GroupSettingHistoryEdge") + case "node": + out.Values[i] = ec._GroupSettingHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._GroupSettingHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupSettingUpdatePayloadImplementors = []string{"GroupSettingUpdatePayload"} + +func (ec *executionContext) _GroupSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupSettingUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupSettingUpdatePayloadImplementors) + + 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("GroupSettingUpdatePayload") + case "groupSetting": + out.Values[i] = ec._GroupSettingUpdatePayload_groupSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 groupUpdatePayloadImplementors = []string{"GroupUpdatePayload"} + +func (ec *executionContext) _GroupUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *GroupUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, groupUpdatePayloadImplementors) + + 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("GroupUpdatePayload") + case "group": + out.Values[i] = ec._GroupUpdatePayload_group(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 hushImplementors = []string{"Hush", "Node"} + +func (ec *executionContext) _Hush(ctx context.Context, sel ast.SelectionSet, obj *generated.Hush) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushImplementors) + + 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("Hush") + case "id": + out.Values[i] = ec._Hush_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Hush_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Hush_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Hush_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Hush_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Hush_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Hush_deletedBy(ctx, field, obj) + case "name": + out.Values[i] = ec._Hush_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Hush_description(ctx, field, obj) + case "kind": + out.Values[i] = ec._Hush_kind(ctx, field, obj) + case "secretName": + out.Values[i] = ec._Hush_secretName(ctx, field, obj) + case "integrations": + 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._Hush_integrations(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organization": + 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._Hush_organization(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Hush_events(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)) + } + } + 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 hushBulkCreatePayloadImplementors = []string{"HushBulkCreatePayload"} + +func (ec *executionContext) _HushBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *HushBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushBulkCreatePayloadImplementors) + + 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("HushBulkCreatePayload") + case "hushes": + out.Values[i] = ec._HushBulkCreatePayload_hushes(ctx, field, obj) + 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 hushConnectionImplementors = []string{"HushConnection"} + +func (ec *executionContext) _HushConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.HushConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushConnectionImplementors) + + 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("HushConnection") + case "edges": + out.Values[i] = ec._HushConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._HushConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._HushConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 hushCreatePayloadImplementors = []string{"HushCreatePayload"} + +func (ec *executionContext) _HushCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *HushCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushCreatePayloadImplementors) + + 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("HushCreatePayload") + case "hush": + out.Values[i] = ec._HushCreatePayload_hush(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 hushDeletePayloadImplementors = []string{"HushDeletePayload"} + +func (ec *executionContext) _HushDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *HushDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushDeletePayloadImplementors) + + 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("HushDeletePayload") + case "deletedID": + out.Values[i] = ec._HushDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 hushEdgeImplementors = []string{"HushEdge"} + +func (ec *executionContext) _HushEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.HushEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushEdgeImplementors) + + 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("HushEdge") + case "node": + out.Values[i] = ec._HushEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._HushEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 hushHistoryImplementors = []string{"HushHistory", "Node"} + +func (ec *executionContext) _HushHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.HushHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushHistoryImplementors) + + 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("HushHistory") + case "id": + out.Values[i] = ec._HushHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._HushHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._HushHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._HushHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._HushHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._HushHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._HushHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._HushHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._HushHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._HushHistory_deletedBy(ctx, field, obj) + case "name": + out.Values[i] = ec._HushHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._HushHistory_description(ctx, field, obj) + case "kind": + out.Values[i] = ec._HushHistory_kind(ctx, field, obj) + case "secretName": + out.Values[i] = ec._HushHistory_secretName(ctx, field, obj) + 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 hushHistoryConnectionImplementors = []string{"HushHistoryConnection"} + +func (ec *executionContext) _HushHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.HushHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushHistoryConnectionImplementors) + + 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("HushHistoryConnection") + case "edges": + out.Values[i] = ec._HushHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._HushHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._HushHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 hushHistoryEdgeImplementors = []string{"HushHistoryEdge"} + +func (ec *executionContext) _HushHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.HushHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushHistoryEdgeImplementors) + + 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("HushHistoryEdge") + case "node": + out.Values[i] = ec._HushHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._HushHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 hushUpdatePayloadImplementors = []string{"HushUpdatePayload"} + +func (ec *executionContext) _HushUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *HushUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, hushUpdatePayloadImplementors) + + 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("HushUpdatePayload") + case "hush": + out.Values[i] = ec._HushUpdatePayload_hush(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 integrationImplementors = []string{"Integration", "Node"} + +func (ec *executionContext) _Integration(ctx context.Context, sel ast.SelectionSet, obj *generated.Integration) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationImplementors) + + 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("Integration") + case "id": + out.Values[i] = ec._Integration_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Integration_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Integration_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Integration_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Integration_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Integration_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Integration_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Integration_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Integration_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._Integration_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Integration_description(ctx, field, obj) + case "kind": + out.Values[i] = ec._Integration_kind(ctx, field, obj) + case "owner": + 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._Integration_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "secrets": + 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._Integration_secrets(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "oauth2tokens": + 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._Integration_oauth2tokens(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Integration_events(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "webhooks": + 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._Integration_webhooks(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)) + } + } + 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 integrationBulkCreatePayloadImplementors = []string{"IntegrationBulkCreatePayload"} + +func (ec *executionContext) _IntegrationBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *IntegrationBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationBulkCreatePayloadImplementors) + + 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("IntegrationBulkCreatePayload") + case "integrations": + out.Values[i] = ec._IntegrationBulkCreatePayload_integrations(ctx, field, obj) + 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 integrationConnectionImplementors = []string{"IntegrationConnection"} + +func (ec *executionContext) _IntegrationConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.IntegrationConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationConnectionImplementors) + + 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("IntegrationConnection") + case "edges": + out.Values[i] = ec._IntegrationConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._IntegrationConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._IntegrationConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 integrationCreatePayloadImplementors = []string{"IntegrationCreatePayload"} + +func (ec *executionContext) _IntegrationCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *IntegrationCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationCreatePayloadImplementors) + + 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("IntegrationCreatePayload") + case "integration": + out.Values[i] = ec._IntegrationCreatePayload_integration(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 integrationDeletePayloadImplementors = []string{"IntegrationDeletePayload"} + +func (ec *executionContext) _IntegrationDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *IntegrationDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationDeletePayloadImplementors) + + 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("IntegrationDeletePayload") + case "deletedID": + out.Values[i] = ec._IntegrationDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 integrationEdgeImplementors = []string{"IntegrationEdge"} + +func (ec *executionContext) _IntegrationEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.IntegrationEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationEdgeImplementors) + + 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("IntegrationEdge") + case "node": + out.Values[i] = ec._IntegrationEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._IntegrationEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 integrationHistoryImplementors = []string{"IntegrationHistory", "Node"} + +func (ec *executionContext) _IntegrationHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.IntegrationHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationHistoryImplementors) + + 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("IntegrationHistory") + case "id": + out.Values[i] = ec._IntegrationHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._IntegrationHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._IntegrationHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._IntegrationHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._IntegrationHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._IntegrationHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._IntegrationHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._IntegrationHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._IntegrationHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._IntegrationHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._IntegrationHistory_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._IntegrationHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._IntegrationHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._IntegrationHistory_description(ctx, field, obj) + case "kind": + out.Values[i] = ec._IntegrationHistory_kind(ctx, field, obj) + 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 integrationHistoryConnectionImplementors = []string{"IntegrationHistoryConnection"} + +func (ec *executionContext) _IntegrationHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.IntegrationHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationHistoryConnectionImplementors) + + 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("IntegrationHistoryConnection") + case "edges": + out.Values[i] = ec._IntegrationHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._IntegrationHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._IntegrationHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 integrationHistoryEdgeImplementors = []string{"IntegrationHistoryEdge"} + +func (ec *executionContext) _IntegrationHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.IntegrationHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationHistoryEdgeImplementors) + + 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("IntegrationHistoryEdge") + case "node": + out.Values[i] = ec._IntegrationHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._IntegrationHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 integrationUpdatePayloadImplementors = []string{"IntegrationUpdatePayload"} + +func (ec *executionContext) _IntegrationUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *IntegrationUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, integrationUpdatePayloadImplementors) + + 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("IntegrationUpdatePayload") + case "integration": + out.Values[i] = ec._IntegrationUpdatePayload_integration(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 inviteImplementors = []string{"Invite", "Node"} + +func (ec *executionContext) _Invite(ctx context.Context, sel ast.SelectionSet, obj *generated.Invite) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, inviteImplementors) + + 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("Invite") + case "id": + out.Values[i] = ec._Invite_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Invite_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Invite_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Invite_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Invite_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Invite_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Invite_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Invite_ownerID(ctx, field, obj) + case "expires": + out.Values[i] = ec._Invite_expires(ctx, field, obj) + case "recipient": + out.Values[i] = ec._Invite_recipient(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "status": + out.Values[i] = ec._Invite_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "role": + out.Values[i] = ec._Invite_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "sendAttempts": + out.Values[i] = ec._Invite_sendAttempts(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "requestorID": + out.Values[i] = ec._Invite_requestorID(ctx, field, obj) + case "owner": + 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._Invite_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Invite_events(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)) + } + } + 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 inviteBulkCreatePayloadImplementors = []string{"InviteBulkCreatePayload"} + +func (ec *executionContext) _InviteBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *InviteBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, inviteBulkCreatePayloadImplementors) + + 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("InviteBulkCreatePayload") + case "invites": + out.Values[i] = ec._InviteBulkCreatePayload_invites(ctx, field, obj) + 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 inviteConnectionImplementors = []string{"InviteConnection"} + +func (ec *executionContext) _InviteConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.InviteConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, inviteConnectionImplementors) + + 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("InviteConnection") + case "edges": + out.Values[i] = ec._InviteConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._InviteConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._InviteConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 inviteCreatePayloadImplementors = []string{"InviteCreatePayload"} + +func (ec *executionContext) _InviteCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *InviteCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, inviteCreatePayloadImplementors) + + 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("InviteCreatePayload") + case "invite": + out.Values[i] = ec._InviteCreatePayload_invite(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 inviteDeletePayloadImplementors = []string{"InviteDeletePayload"} + +func (ec *executionContext) _InviteDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *InviteDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, inviteDeletePayloadImplementors) + + 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("InviteDeletePayload") + case "deletedID": + out.Values[i] = ec._InviteDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 inviteEdgeImplementors = []string{"InviteEdge"} + +func (ec *executionContext) _InviteEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.InviteEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, inviteEdgeImplementors) + + 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("InviteEdge") + case "node": + out.Values[i] = ec._InviteEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._InviteEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 inviteUpdatePayloadImplementors = []string{"InviteUpdatePayload"} + +func (ec *executionContext) _InviteUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *InviteUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, inviteUpdatePayloadImplementors) + + 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("InviteUpdatePayload") + case "invite": + out.Values[i] = ec._InviteUpdatePayload_invite(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mutation") + case "createAPIToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createAPIToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkAPIToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkAPIToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVAPIToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVAPIToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateAPIToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateAPIToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteAPIToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteAPIToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createContact": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createContact(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkContact": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkContact(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVContact": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVContact(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateContact": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateContact(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteContact": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteContact(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createDocumentData": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createDocumentData(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkDocumentData": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkDocumentData(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVDocumentData": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVDocumentData(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateDocumentData": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateDocumentData(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteDocumentData": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteDocumentData(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createEntitlement": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createEntitlement(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkEntitlement": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkEntitlement(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVEntitlement": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVEntitlement(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateEntitlement": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateEntitlement(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteEntitlement": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteEntitlement(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createEntitlementPlan": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createEntitlementPlan(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkEntitlementPlan": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkEntitlementPlan(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVEntitlementPlan": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVEntitlementPlan(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateEntitlementPlan": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateEntitlementPlan(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteEntitlementPlan": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteEntitlementPlan(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createEntitlementPlanFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createEntitlementPlanFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkEntitlementPlanFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkEntitlementPlanFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVEntitlementPlanFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVEntitlementPlanFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateEntitlementPlanFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateEntitlementPlanFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteEntitlementPlanFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteEntitlementPlanFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createEntity": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createEntity(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkEntity": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkEntity(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVEntity": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVEntity(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateEntity": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateEntity(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteEntity": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteEntity(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createEntityType": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createEntityType(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkEntityType": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkEntityType(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVEntityType": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVEntityType(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateEntityType": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateEntityType(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteEntityType": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteEntityType(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createEvent": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createEvent(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkEvent": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkEvent(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVEvent": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVEvent(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateEvent": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateEvent(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteEvent": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteEvent(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteFeature": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteFeature(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createFile": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createFile(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkFile": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkFile(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVFile": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVFile(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateFile": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateFile(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteFile": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteFile(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createGroup": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createGroup(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkGroup": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkGroup(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVGroup": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVGroup(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateGroup": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateGroup(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteGroup": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteGroup(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createGroupMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createGroupMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkGroupMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkGroupMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVGroupMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVGroupMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateGroupMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateGroupMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteGroupMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteGroupMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createGroupSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createGroupSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkGroupSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkGroupSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVGroupSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVGroupSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateGroupSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateGroupSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteGroupSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteGroupSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createHush": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createHush(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkHush": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkHush(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVHush": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVHush(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateHush": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateHush(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteHush": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteHush(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createIntegration": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createIntegration(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkIntegration": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkIntegration(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVIntegration": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVIntegration(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateIntegration": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateIntegration(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteIntegration": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteIntegration(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createInvite": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createInvite(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkInvite": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkInvite(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVInvite": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVInvite(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateInvite": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateInvite(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteInvite": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteInvite(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createOauthProvider": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createOauthProvider(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkOauthProvider": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkOauthProvider(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVOauthProvider": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVOauthProvider(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateOauthProvider": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateOauthProvider(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteOauthProvider": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteOauthProvider(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createOhAuthTooToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createOhAuthTooToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkOhAuthTooToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkOhAuthTooToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVOhAuthTooToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVOhAuthTooToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateOhAuthTooToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateOhAuthTooToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteOhAuthTooToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteOhAuthTooToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createOrganization": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createOrganization(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkOrganization": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkOrganization(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVOrganization": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVOrganization(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateOrganization": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateOrganization(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteOrganization": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteOrganization(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createOrganizationSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createOrganizationSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkOrganizationSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkOrganizationSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVOrganizationSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVOrganizationSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateOrganizationSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateOrganizationSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteOrganizationSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteOrganizationSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createOrgMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createOrgMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkOrgMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkOrgMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVOrgMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVOrgMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateOrgMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateOrgMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteOrgMembership": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteOrgMembership(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createPersonalAccessToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createPersonalAccessToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkPersonalAccessToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkPersonalAccessToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVPersonalAccessToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVPersonalAccessToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updatePersonalAccessToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updatePersonalAccessToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deletePersonalAccessToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deletePersonalAccessToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createSubscriber": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createSubscriber(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkSubscriber": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkSubscriber(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVSubscriber": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVSubscriber(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateSubscriber": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateSubscriber(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteSubscriber": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteSubscriber(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createTemplate": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createTemplate(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkTemplate": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkTemplate(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVTemplate": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVTemplate(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateTemplate": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateTemplate(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteTemplate": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteTemplate(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createTFASetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createTFASetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateTFASetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateTFASetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createUser": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createUser(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateUser": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateUser(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteUser": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteUser(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createUserSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createUserSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkUserSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkUserSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVUserSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVUserSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateUserSetting": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateUserSetting(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createWebhook": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createWebhook(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkWebhook": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkWebhook(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createBulkCSVWebhook": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBulkCSVWebhook(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateWebhook": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateWebhook(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteWebhook": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteWebhook(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 noteImplementors = []string{"Note", "Node"} + +func (ec *executionContext) _Note(ctx context.Context, sel ast.SelectionSet, obj *generated.Note) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, noteImplementors) + + 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("Note") + case "id": + out.Values[i] = ec._Note_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Note_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Note_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Note_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Note_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Note_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Note_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Note_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Note_ownerID(ctx, field, obj) + case "text": + out.Values[i] = ec._Note_text(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._Note_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entity": + 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._Note_entity(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)) + } + } + 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 noteConnectionImplementors = []string{"NoteConnection"} + +func (ec *executionContext) _NoteConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.NoteConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, noteConnectionImplementors) + + 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("NoteConnection") + case "edges": + out.Values[i] = ec._NoteConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._NoteConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._NoteConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 noteEdgeImplementors = []string{"NoteEdge"} + +func (ec *executionContext) _NoteEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.NoteEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, noteEdgeImplementors) + + 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("NoteEdge") + case "node": + out.Values[i] = ec._NoteEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._NoteEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 noteHistoryImplementors = []string{"NoteHistory", "Node"} + +func (ec *executionContext) _NoteHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.NoteHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, noteHistoryImplementors) + + 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("NoteHistory") + case "id": + out.Values[i] = ec._NoteHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._NoteHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._NoteHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._NoteHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._NoteHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._NoteHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._NoteHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._NoteHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._NoteHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._NoteHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._NoteHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._NoteHistory_ownerID(ctx, field, obj) + case "text": + out.Values[i] = ec._NoteHistory_text(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 noteHistoryConnectionImplementors = []string{"NoteHistoryConnection"} + +func (ec *executionContext) _NoteHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.NoteHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, noteHistoryConnectionImplementors) + + 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("NoteHistoryConnection") + case "edges": + out.Values[i] = ec._NoteHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._NoteHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._NoteHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 noteHistoryEdgeImplementors = []string{"NoteHistoryEdge"} + +func (ec *executionContext) _NoteHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.NoteHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, noteHistoryEdgeImplementors) + + 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("NoteHistoryEdge") + case "node": + out.Values[i] = ec._NoteHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._NoteHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderImplementors = []string{"OauthProvider", "Node"} + +func (ec *executionContext) _OauthProvider(ctx context.Context, sel ast.SelectionSet, obj *generated.OauthProvider) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderImplementors) + + 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("OauthProvider") + case "id": + out.Values[i] = ec._OauthProvider_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._OauthProvider_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._OauthProvider_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._OauthProvider_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._OauthProvider_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._OauthProvider_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._OauthProvider_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._OauthProvider_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._OauthProvider_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._OauthProvider_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "clientID": + out.Values[i] = ec._OauthProvider_clientID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "clientSecret": + out.Values[i] = ec._OauthProvider_clientSecret(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "redirectURL": + out.Values[i] = ec._OauthProvider_redirectURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "scopes": + out.Values[i] = ec._OauthProvider_scopes(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "authURL": + out.Values[i] = ec._OauthProvider_authURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "tokenURL": + out.Values[i] = ec._OauthProvider_tokenURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "authStyle": + out.Values[i] = ec._OauthProvider_authStyle(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "infoURL": + out.Values[i] = ec._OauthProvider_infoURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._OauthProvider_owner(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)) + } + } + 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 oauthProviderBulkCreatePayloadImplementors = []string{"OauthProviderBulkCreatePayload"} + +func (ec *executionContext) _OauthProviderBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OauthProviderBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderBulkCreatePayloadImplementors) + + 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("OauthProviderBulkCreatePayload") + case "oauthProviders": + out.Values[i] = ec._OauthProviderBulkCreatePayload_oauthProviders(ctx, field, obj) + 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 oauthProviderConnectionImplementors = []string{"OauthProviderConnection"} + +func (ec *executionContext) _OauthProviderConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OauthProviderConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderConnectionImplementors) + + 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("OauthProviderConnection") + case "edges": + out.Values[i] = ec._OauthProviderConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OauthProviderConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OauthProviderConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderCreatePayloadImplementors = []string{"OauthProviderCreatePayload"} + +func (ec *executionContext) _OauthProviderCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OauthProviderCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderCreatePayloadImplementors) + + 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("OauthProviderCreatePayload") + case "oauthProvider": + out.Values[i] = ec._OauthProviderCreatePayload_oauthProvider(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderDeletePayloadImplementors = []string{"OauthProviderDeletePayload"} + +func (ec *executionContext) _OauthProviderDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *OauthProviderDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderDeletePayloadImplementors) + + 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("OauthProviderDeletePayload") + case "deletedID": + out.Values[i] = ec._OauthProviderDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderEdgeImplementors = []string{"OauthProviderEdge"} + +func (ec *executionContext) _OauthProviderEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OauthProviderEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderEdgeImplementors) + + 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("OauthProviderEdge") + case "node": + out.Values[i] = ec._OauthProviderEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OauthProviderEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderHistoryImplementors = []string{"OauthProviderHistory", "Node"} + +func (ec *executionContext) _OauthProviderHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.OauthProviderHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderHistoryImplementors) + + 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("OauthProviderHistory") + case "id": + out.Values[i] = ec._OauthProviderHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._OauthProviderHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._OauthProviderHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._OauthProviderHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._OauthProviderHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._OauthProviderHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._OauthProviderHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._OauthProviderHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._OauthProviderHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._OauthProviderHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._OauthProviderHistory_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._OauthProviderHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._OauthProviderHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "clientID": + out.Values[i] = ec._OauthProviderHistory_clientID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "clientSecret": + out.Values[i] = ec._OauthProviderHistory_clientSecret(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "redirectURL": + out.Values[i] = ec._OauthProviderHistory_redirectURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "scopes": + out.Values[i] = ec._OauthProviderHistory_scopes(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "authURL": + out.Values[i] = ec._OauthProviderHistory_authURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "tokenURL": + out.Values[i] = ec._OauthProviderHistory_tokenURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "authStyle": + out.Values[i] = ec._OauthProviderHistory_authStyle(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "infoURL": + out.Values[i] = ec._OauthProviderHistory_infoURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderHistoryConnectionImplementors = []string{"OauthProviderHistoryConnection"} + +func (ec *executionContext) _OauthProviderHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OauthProviderHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderHistoryConnectionImplementors) + + 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("OauthProviderHistoryConnection") + case "edges": + out.Values[i] = ec._OauthProviderHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OauthProviderHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OauthProviderHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderHistoryEdgeImplementors = []string{"OauthProviderHistoryEdge"} + +func (ec *executionContext) _OauthProviderHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OauthProviderHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderHistoryEdgeImplementors) + + 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("OauthProviderHistoryEdge") + case "node": + out.Values[i] = ec._OauthProviderHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OauthProviderHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 oauthProviderUpdatePayloadImplementors = []string{"OauthProviderUpdatePayload"} + +func (ec *executionContext) _OauthProviderUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *OauthProviderUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oauthProviderUpdatePayloadImplementors) + + 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("OauthProviderUpdatePayload") + case "oauthProvider": + out.Values[i] = ec._OauthProviderUpdatePayload_oauthProvider(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 ohAuthTooTokenImplementors = []string{"OhAuthTooToken", "Node"} + +func (ec *executionContext) _OhAuthTooToken(ctx context.Context, sel ast.SelectionSet, obj *generated.OhAuthTooToken) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ohAuthTooTokenImplementors) + + 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("OhAuthTooToken") + case "id": + out.Values[i] = ec._OhAuthTooToken_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "tags": + out.Values[i] = ec._OhAuthTooToken_tags(ctx, field, obj) + case "clientID": + out.Values[i] = ec._OhAuthTooToken_clientID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "scopes": + out.Values[i] = ec._OhAuthTooToken_scopes(ctx, field, obj) + case "nonce": + out.Values[i] = ec._OhAuthTooToken_nonce(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "claimsUserID": + out.Values[i] = ec._OhAuthTooToken_claimsUserID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "claimsUsername": + out.Values[i] = ec._OhAuthTooToken_claimsUsername(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "claimsEmail": + out.Values[i] = ec._OhAuthTooToken_claimsEmail(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "claimsEmailVerified": + out.Values[i] = ec._OhAuthTooToken_claimsEmailVerified(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "claimsGroups": + out.Values[i] = ec._OhAuthTooToken_claimsGroups(ctx, field, obj) + case "claimsPreferredUsername": + out.Values[i] = ec._OhAuthTooToken_claimsPreferredUsername(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "connectorID": + out.Values[i] = ec._OhAuthTooToken_connectorID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "connectorData": + out.Values[i] = ec._OhAuthTooToken_connectorData(ctx, field, obj) + case "lastUsed": + out.Values[i] = ec._OhAuthTooToken_lastUsed(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "integration": + 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._OhAuthTooToken_integration(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._OhAuthTooToken_events(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)) + } + } + 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 ohAuthTooTokenBulkCreatePayloadImplementors = []string{"OhAuthTooTokenBulkCreatePayload"} + +func (ec *executionContext) _OhAuthTooTokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OhAuthTooTokenBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ohAuthTooTokenBulkCreatePayloadImplementors) + + 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("OhAuthTooTokenBulkCreatePayload") + case "ohAuthTooTokens": + out.Values[i] = ec._OhAuthTooTokenBulkCreatePayload_ohAuthTooTokens(ctx, field, obj) + 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 ohAuthTooTokenConnectionImplementors = []string{"OhAuthTooTokenConnection"} + +func (ec *executionContext) _OhAuthTooTokenConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OhAuthTooTokenConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ohAuthTooTokenConnectionImplementors) + + 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("OhAuthTooTokenConnection") + case "edges": + out.Values[i] = ec._OhAuthTooTokenConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OhAuthTooTokenConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OhAuthTooTokenConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 ohAuthTooTokenCreatePayloadImplementors = []string{"OhAuthTooTokenCreatePayload"} + +func (ec *executionContext) _OhAuthTooTokenCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OhAuthTooTokenCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ohAuthTooTokenCreatePayloadImplementors) + + 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("OhAuthTooTokenCreatePayload") + case "ohAuthTooToken": + out.Values[i] = ec._OhAuthTooTokenCreatePayload_ohAuthTooToken(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 ohAuthTooTokenDeletePayloadImplementors = []string{"OhAuthTooTokenDeletePayload"} + +func (ec *executionContext) _OhAuthTooTokenDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *OhAuthTooTokenDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ohAuthTooTokenDeletePayloadImplementors) + + 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("OhAuthTooTokenDeletePayload") + case "deletedID": + out.Values[i] = ec._OhAuthTooTokenDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 ohAuthTooTokenEdgeImplementors = []string{"OhAuthTooTokenEdge"} + +func (ec *executionContext) _OhAuthTooTokenEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OhAuthTooTokenEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ohAuthTooTokenEdgeImplementors) + + 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("OhAuthTooTokenEdge") + case "node": + out.Values[i] = ec._OhAuthTooTokenEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OhAuthTooTokenEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 ohAuthTooTokenUpdatePayloadImplementors = []string{"OhAuthTooTokenUpdatePayload"} + +func (ec *executionContext) _OhAuthTooTokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *OhAuthTooTokenUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ohAuthTooTokenUpdatePayloadImplementors) + + 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("OhAuthTooTokenUpdatePayload") + case "ohAuthTooToken": + out.Values[i] = ec._OhAuthTooTokenUpdatePayload_ohAuthTooToken(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipImplementors = []string{"OrgMembership", "Node"} + +func (ec *executionContext) _OrgMembership(ctx context.Context, sel ast.SelectionSet, obj *generated.OrgMembership) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipImplementors) + + 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("OrgMembership") + case "id": + out.Values[i] = ec._OrgMembership_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._OrgMembership_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._OrgMembership_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._OrgMembership_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._OrgMembership_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._OrgMembership_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._OrgMembership_deletedBy(ctx, field, obj) + case "role": + out.Values[i] = ec._OrgMembership_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "organizationID": + out.Values[i] = ec._OrgMembership_organizationID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "userID": + out.Values[i] = ec._OrgMembership_userID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "organization": + 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._OrgMembership_organization(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "user": + 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._OrgMembership_user(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._OrgMembership_events(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)) + } + } + 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 orgMembershipBulkCreatePayloadImplementors = []string{"OrgMembershipBulkCreatePayload"} + +func (ec *executionContext) _OrgMembershipBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrgMembershipBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipBulkCreatePayloadImplementors) + + 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("OrgMembershipBulkCreatePayload") + case "orgMemberships": + out.Values[i] = ec._OrgMembershipBulkCreatePayload_orgMemberships(ctx, field, obj) + 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 orgMembershipConnectionImplementors = []string{"OrgMembershipConnection"} + +func (ec *executionContext) _OrgMembershipConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OrgMembershipConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipConnectionImplementors) + + 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("OrgMembershipConnection") + case "edges": + out.Values[i] = ec._OrgMembershipConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OrgMembershipConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OrgMembershipConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipCreatePayloadImplementors = []string{"OrgMembershipCreatePayload"} + +func (ec *executionContext) _OrgMembershipCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrgMembershipCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipCreatePayloadImplementors) + + 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("OrgMembershipCreatePayload") + case "orgMembership": + out.Values[i] = ec._OrgMembershipCreatePayload_orgMembership(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipDeletePayloadImplementors = []string{"OrgMembershipDeletePayload"} + +func (ec *executionContext) _OrgMembershipDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *OrgMembershipDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipDeletePayloadImplementors) + + 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("OrgMembershipDeletePayload") + case "deletedID": + out.Values[i] = ec._OrgMembershipDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipEdgeImplementors = []string{"OrgMembershipEdge"} + +func (ec *executionContext) _OrgMembershipEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OrgMembershipEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipEdgeImplementors) + + 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("OrgMembershipEdge") + case "node": + out.Values[i] = ec._OrgMembershipEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OrgMembershipEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipHistoryImplementors = []string{"OrgMembershipHistory", "Node"} + +func (ec *executionContext) _OrgMembershipHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.OrgMembershipHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipHistoryImplementors) + + 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("OrgMembershipHistory") + case "id": + out.Values[i] = ec._OrgMembershipHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._OrgMembershipHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._OrgMembershipHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._OrgMembershipHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._OrgMembershipHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._OrgMembershipHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._OrgMembershipHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._OrgMembershipHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._OrgMembershipHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._OrgMembershipHistory_deletedBy(ctx, field, obj) + case "role": + out.Values[i] = ec._OrgMembershipHistory_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "organizationID": + out.Values[i] = ec._OrgMembershipHistory_organizationID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "userID": + out.Values[i] = ec._OrgMembershipHistory_userID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipHistoryConnectionImplementors = []string{"OrgMembershipHistoryConnection"} + +func (ec *executionContext) _OrgMembershipHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OrgMembershipHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipHistoryConnectionImplementors) + + 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("OrgMembershipHistoryConnection") + case "edges": + out.Values[i] = ec._OrgMembershipHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OrgMembershipHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OrgMembershipHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipHistoryEdgeImplementors = []string{"OrgMembershipHistoryEdge"} + +func (ec *executionContext) _OrgMembershipHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OrgMembershipHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipHistoryEdgeImplementors) + + 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("OrgMembershipHistoryEdge") + case "node": + out.Values[i] = ec._OrgMembershipHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OrgMembershipHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 orgMembershipUpdatePayloadImplementors = []string{"OrgMembershipUpdatePayload"} + +func (ec *executionContext) _OrgMembershipUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrgMembershipUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, orgMembershipUpdatePayloadImplementors) + + 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("OrgMembershipUpdatePayload") + case "orgMembership": + out.Values[i] = ec._OrgMembershipUpdatePayload_orgMembership(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationImplementors = []string{"Organization", "Node"} + +func (ec *executionContext) _Organization(ctx context.Context, sel ast.SelectionSet, obj *generated.Organization) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationImplementors) + + 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("Organization") + case "id": + out.Values[i] = ec._Organization_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Organization_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Organization_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Organization_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Organization_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Organization_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Organization_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Organization_deletedBy(ctx, field, obj) + case "name": + out.Values[i] = ec._Organization_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "displayName": + out.Values[i] = ec._Organization_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Organization_description(ctx, field, obj) + case "personalOrg": + out.Values[i] = ec._Organization_personalOrg(ctx, field, obj) + case "avatarRemoteURL": + out.Values[i] = ec._Organization_avatarRemoteURL(ctx, field, obj) + case "dedicatedDb": + out.Values[i] = ec._Organization_dedicatedDb(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "parent": + 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._Organization_parent(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "children": + 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._Organization_children(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "groups": + 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._Organization_groups(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "templates": + 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._Organization_templates(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "integrations": + 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._Organization_integrations(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "setting": + 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._Organization_setting(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "documentdata": + 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._Organization_documentdata(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitlements": + 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._Organization_entitlements(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organizationEntitlement": + 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._Organization_organizationEntitlement(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "personalAccessTokens": + 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._Organization_personalAccessTokens(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "apiTokens": + 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._Organization_apiTokens(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "oauthprovider": + 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._Organization_oauthprovider(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "users": + 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._Organization_users(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "invites": + 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._Organization_invites(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "subscribers": + 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._Organization_subscribers(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "webhooks": + 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._Organization_webhooks(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Organization_events(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "secrets": + 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._Organization_secrets(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "features": + 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._Organization_features(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "files": + 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._Organization_files(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitlementplans": + 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._Organization_entitlementplans(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitlementplanfeatures": + 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._Organization_entitlementplanfeatures(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entities": + 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._Organization_entities(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "entitytypes": + 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._Organization_entitytypes(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "contacts": + 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._Organization_contacts(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "notes": + 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._Organization_notes(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "members": + 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._Organization_members(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)) + } + } + 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 organizationBulkCreatePayloadImplementors = []string{"OrganizationBulkCreatePayload"} + +func (ec *executionContext) _OrganizationBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationBulkCreatePayloadImplementors) + + 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("OrganizationBulkCreatePayload") + case "organizations": + out.Values[i] = ec._OrganizationBulkCreatePayload_organizations(ctx, field, obj) + 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 organizationConnectionImplementors = []string{"OrganizationConnection"} + +func (ec *executionContext) _OrganizationConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationConnectionImplementors) + + 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("OrganizationConnection") + case "edges": + out.Values[i] = ec._OrganizationConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OrganizationConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OrganizationConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationCreatePayloadImplementors = []string{"OrganizationCreatePayload"} + +func (ec *executionContext) _OrganizationCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationCreatePayloadImplementors) + + 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("OrganizationCreatePayload") + case "organization": + out.Values[i] = ec._OrganizationCreatePayload_organization(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationDeletePayloadImplementors = []string{"OrganizationDeletePayload"} + +func (ec *executionContext) _OrganizationDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationDeletePayloadImplementors) + + 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("OrganizationDeletePayload") + case "deletedID": + out.Values[i] = ec._OrganizationDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationEdgeImplementors = []string{"OrganizationEdge"} + +func (ec *executionContext) _OrganizationEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationEdgeImplementors) + + 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("OrganizationEdge") + case "node": + out.Values[i] = ec._OrganizationEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OrganizationEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationHistoryImplementors = []string{"OrganizationHistory", "Node"} + +func (ec *executionContext) _OrganizationHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationHistoryImplementors) + + 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("OrganizationHistory") + case "id": + out.Values[i] = ec._OrganizationHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._OrganizationHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._OrganizationHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._OrganizationHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._OrganizationHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._OrganizationHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._OrganizationHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._OrganizationHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._OrganizationHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._OrganizationHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._OrganizationHistory_deletedBy(ctx, field, obj) + case "name": + out.Values[i] = ec._OrganizationHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "displayName": + out.Values[i] = ec._OrganizationHistory_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._OrganizationHistory_description(ctx, field, obj) + case "personalOrg": + out.Values[i] = ec._OrganizationHistory_personalOrg(ctx, field, obj) + case "avatarRemoteURL": + out.Values[i] = ec._OrganizationHistory_avatarRemoteURL(ctx, field, obj) + case "dedicatedDb": + out.Values[i] = ec._OrganizationHistory_dedicatedDb(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationHistoryConnectionImplementors = []string{"OrganizationHistoryConnection"} + +func (ec *executionContext) _OrganizationHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationHistoryConnectionImplementors) + + 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("OrganizationHistoryConnection") + case "edges": + out.Values[i] = ec._OrganizationHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OrganizationHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OrganizationHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationHistoryEdgeImplementors = []string{"OrganizationHistoryEdge"} + +func (ec *executionContext) _OrganizationHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationHistoryEdgeImplementors) + + 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("OrganizationHistoryEdge") + case "node": + out.Values[i] = ec._OrganizationHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OrganizationHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationSearchResultImplementors = []string{"OrganizationSearchResult", "GlobalSearchResult"} + +func (ec *executionContext) _OrganizationSearchResult(ctx context.Context, sel ast.SelectionSet, obj *OrganizationSearchResult) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSearchResultImplementors) + + 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("OrganizationSearchResult") + case "organizations": + out.Values[i] = ec._OrganizationSearchResult_organizations(ctx, field, obj) + 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 organizationSettingImplementors = []string{"OrganizationSetting", "Node"} + +func (ec *executionContext) _OrganizationSetting(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationSetting) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingImplementors) + + 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("OrganizationSetting") + case "id": + out.Values[i] = ec._OrganizationSetting_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._OrganizationSetting_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._OrganizationSetting_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._OrganizationSetting_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._OrganizationSetting_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._OrganizationSetting_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._OrganizationSetting_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._OrganizationSetting_deletedBy(ctx, field, obj) + case "domains": + out.Values[i] = ec._OrganizationSetting_domains(ctx, field, obj) + case "billingContact": + out.Values[i] = ec._OrganizationSetting_billingContact(ctx, field, obj) + case "billingEmail": + out.Values[i] = ec._OrganizationSetting_billingEmail(ctx, field, obj) + case "billingPhone": + out.Values[i] = ec._OrganizationSetting_billingPhone(ctx, field, obj) + case "billingAddress": + out.Values[i] = ec._OrganizationSetting_billingAddress(ctx, field, obj) + case "taxIdentifier": + out.Values[i] = ec._OrganizationSetting_taxIdentifier(ctx, field, obj) + case "geoLocation": + out.Values[i] = ec._OrganizationSetting_geoLocation(ctx, field, obj) + case "organizationID": + out.Values[i] = ec._OrganizationSetting_organizationID(ctx, field, obj) + case "organization": + 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._OrganizationSetting_organization(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)) + } + } + 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 organizationSettingBulkCreatePayloadImplementors = []string{"OrganizationSettingBulkCreatePayload"} + +func (ec *executionContext) _OrganizationSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationSettingBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingBulkCreatePayloadImplementors) + + 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("OrganizationSettingBulkCreatePayload") + case "organizationSettings": + out.Values[i] = ec._OrganizationSettingBulkCreatePayload_organizationSettings(ctx, field, obj) + 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 organizationSettingConnectionImplementors = []string{"OrganizationSettingConnection"} + +func (ec *executionContext) _OrganizationSettingConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationSettingConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingConnectionImplementors) + + 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("OrganizationSettingConnection") + case "edges": + out.Values[i] = ec._OrganizationSettingConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OrganizationSettingConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OrganizationSettingConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationSettingCreatePayloadImplementors = []string{"OrganizationSettingCreatePayload"} + +func (ec *executionContext) _OrganizationSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationSettingCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingCreatePayloadImplementors) + + 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("OrganizationSettingCreatePayload") + case "organizationSetting": + out.Values[i] = ec._OrganizationSettingCreatePayload_organizationSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationSettingDeletePayloadImplementors = []string{"OrganizationSettingDeletePayload"} + +func (ec *executionContext) _OrganizationSettingDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationSettingDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingDeletePayloadImplementors) + + 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("OrganizationSettingDeletePayload") + case "deletedID": + out.Values[i] = ec._OrganizationSettingDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationSettingEdgeImplementors = []string{"OrganizationSettingEdge"} + +func (ec *executionContext) _OrganizationSettingEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationSettingEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingEdgeImplementors) + + 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("OrganizationSettingEdge") + case "node": + out.Values[i] = ec._OrganizationSettingEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OrganizationSettingEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationSettingHistoryImplementors = []string{"OrganizationSettingHistory", "Node"} + +func (ec *executionContext) _OrganizationSettingHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationSettingHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingHistoryImplementors) + + 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("OrganizationSettingHistory") + case "id": + out.Values[i] = ec._OrganizationSettingHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._OrganizationSettingHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._OrganizationSettingHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._OrganizationSettingHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._OrganizationSettingHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._OrganizationSettingHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._OrganizationSettingHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._OrganizationSettingHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._OrganizationSettingHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._OrganizationSettingHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._OrganizationSettingHistory_deletedBy(ctx, field, obj) + case "domains": + out.Values[i] = ec._OrganizationSettingHistory_domains(ctx, field, obj) + case "billingContact": + out.Values[i] = ec._OrganizationSettingHistory_billingContact(ctx, field, obj) + case "billingEmail": + out.Values[i] = ec._OrganizationSettingHistory_billingEmail(ctx, field, obj) + case "billingPhone": + out.Values[i] = ec._OrganizationSettingHistory_billingPhone(ctx, field, obj) + case "billingAddress": + out.Values[i] = ec._OrganizationSettingHistory_billingAddress(ctx, field, obj) + case "taxIdentifier": + out.Values[i] = ec._OrganizationSettingHistory_taxIdentifier(ctx, field, obj) + case "geoLocation": + out.Values[i] = ec._OrganizationSettingHistory_geoLocation(ctx, field, obj) + case "organizationID": + out.Values[i] = ec._OrganizationSettingHistory_organizationID(ctx, field, obj) + 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 organizationSettingHistoryConnectionImplementors = []string{"OrganizationSettingHistoryConnection"} + +func (ec *executionContext) _OrganizationSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationSettingHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingHistoryConnectionImplementors) + + 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("OrganizationSettingHistoryConnection") + case "edges": + out.Values[i] = ec._OrganizationSettingHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._OrganizationSettingHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._OrganizationSettingHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationSettingHistoryEdgeImplementors = []string{"OrganizationSettingHistoryEdge"} + +func (ec *executionContext) _OrganizationSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.OrganizationSettingHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingHistoryEdgeImplementors) + + 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("OrganizationSettingHistoryEdge") + case "node": + out.Values[i] = ec._OrganizationSettingHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._OrganizationSettingHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationSettingUpdatePayloadImplementors = []string{"OrganizationSettingUpdatePayload"} + +func (ec *executionContext) _OrganizationSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationSettingUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationSettingUpdatePayloadImplementors) + + 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("OrganizationSettingUpdatePayload") + case "organizationSetting": + out.Values[i] = ec._OrganizationSettingUpdatePayload_organizationSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 organizationUpdatePayloadImplementors = []string{"OrganizationUpdatePayload"} + +func (ec *executionContext) _OrganizationUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *OrganizationUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, organizationUpdatePayloadImplementors) + + 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("OrganizationUpdatePayload") + case "organization": + out.Values[i] = ec._OrganizationUpdatePayload_organization(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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[string]) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) + + 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("PageInfo") + case "hasNextPage": + out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "hasPreviousPage": + out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "startCursor": + out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) + case "endCursor": + out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(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 personalAccessTokenImplementors = []string{"PersonalAccessToken", "Node"} + +func (ec *executionContext) _PersonalAccessToken(ctx context.Context, sel ast.SelectionSet, obj *generated.PersonalAccessToken) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalAccessTokenImplementors) + + 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("PersonalAccessToken") + case "id": + out.Values[i] = ec._PersonalAccessToken_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._PersonalAccessToken_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._PersonalAccessToken_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._PersonalAccessToken_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._PersonalAccessToken_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._PersonalAccessToken_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._PersonalAccessToken_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._PersonalAccessToken_tags(ctx, field, obj) + case "name": + out.Values[i] = ec._PersonalAccessToken_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "token": + out.Values[i] = ec._PersonalAccessToken_token(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "expiresAt": + out.Values[i] = ec._PersonalAccessToken_expiresAt(ctx, field, obj) + case "description": + out.Values[i] = ec._PersonalAccessToken_description(ctx, field, obj) + case "scopes": + out.Values[i] = ec._PersonalAccessToken_scopes(ctx, field, obj) + case "lastUsedAt": + out.Values[i] = ec._PersonalAccessToken_lastUsedAt(ctx, field, obj) + case "owner": + 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._PersonalAccessToken_owner(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organizations": + 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._PersonalAccessToken_organizations(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._PersonalAccessToken_events(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)) + } + } + 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 personalAccessTokenBulkCreatePayloadImplementors = []string{"PersonalAccessTokenBulkCreatePayload"} + +func (ec *executionContext) _PersonalAccessTokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *PersonalAccessTokenBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalAccessTokenBulkCreatePayloadImplementors) + + 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("PersonalAccessTokenBulkCreatePayload") + case "personalAccessTokens": + out.Values[i] = ec._PersonalAccessTokenBulkCreatePayload_personalAccessTokens(ctx, field, obj) + 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 personalAccessTokenConnectionImplementors = []string{"PersonalAccessTokenConnection"} + +func (ec *executionContext) _PersonalAccessTokenConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.PersonalAccessTokenConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalAccessTokenConnectionImplementors) + + 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("PersonalAccessTokenConnection") + case "edges": + out.Values[i] = ec._PersonalAccessTokenConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._PersonalAccessTokenConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._PersonalAccessTokenConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 personalAccessTokenCreatePayloadImplementors = []string{"PersonalAccessTokenCreatePayload"} + +func (ec *executionContext) _PersonalAccessTokenCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *PersonalAccessTokenCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalAccessTokenCreatePayloadImplementors) + + 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("PersonalAccessTokenCreatePayload") + case "personalAccessToken": + out.Values[i] = ec._PersonalAccessTokenCreatePayload_personalAccessToken(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 personalAccessTokenDeletePayloadImplementors = []string{"PersonalAccessTokenDeletePayload"} + +func (ec *executionContext) _PersonalAccessTokenDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *PersonalAccessTokenDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalAccessTokenDeletePayloadImplementors) + + 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("PersonalAccessTokenDeletePayload") + case "deletedID": + out.Values[i] = ec._PersonalAccessTokenDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 personalAccessTokenEdgeImplementors = []string{"PersonalAccessTokenEdge"} + +func (ec *executionContext) _PersonalAccessTokenEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.PersonalAccessTokenEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalAccessTokenEdgeImplementors) + + 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("PersonalAccessTokenEdge") + case "node": + out.Values[i] = ec._PersonalAccessTokenEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._PersonalAccessTokenEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 personalAccessTokenUpdatePayloadImplementors = []string{"PersonalAccessTokenUpdatePayload"} + +func (ec *executionContext) _PersonalAccessTokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *PersonalAccessTokenUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, personalAccessTokenUpdatePayloadImplementors) + + 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("PersonalAccessTokenUpdatePayload") + case "personalAccessToken": + out.Values[i] = ec._PersonalAccessTokenUpdatePayload_personalAccessToken(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "node": + 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._Query_node(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "nodes": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_nodes(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "apiTokens": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_apiTokens(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "contacts": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_contacts(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "contactHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_contactHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "documentDataSlice": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_documentDataSlice(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "documentDataHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_documentDataHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlements": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlements(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlementHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlementHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlementPlans": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlementPlans(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlementPlanFeatures": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlementPlanFeatures(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlementPlanFeatureHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlementPlanFeatureHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlementPlanHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlementPlanHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entities": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entities(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entityHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entityHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entityTypes": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entityTypes(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entityTypeHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entityTypeHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "events": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_events(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "eventHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_eventHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "features": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_features(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "featureHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_featureHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "files": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_files(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "fileHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_fileHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groups": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groups(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groupHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groupHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groupMemberships": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groupMemberships(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groupMembershipHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groupMembershipHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groupSettings": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groupSettings(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groupSettingHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groupSettingHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "hushes": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_hushes(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "hushHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_hushHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "integrations": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_integrations(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "integrationHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_integrationHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "invites": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_invites(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "notes": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_notes(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "noteHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_noteHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "oauthProviders": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_oauthProviders(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "oauthProviderHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_oauthProviderHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "ohAuthTooTokens": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_ohAuthTooTokens(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "orgMemberships": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_orgMemberships(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "orgMembershipHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_orgMembershipHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "organizations": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_organizations(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "organizationHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_organizationHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "organizationSettings": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_organizationSettings(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "organizationSettingHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_organizationSettingHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "personalAccessTokens": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_personalAccessTokens(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "subscribers": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_subscribers(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "tfaSettings": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_tfaSettings(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "templates": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_templates(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "templateHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_templateHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "users": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_users(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "userHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_userHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "userSettings": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_userSettings(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "userSettingHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_userSettingHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "webhooks": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_webhooks(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "webhookHistories": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_webhookHistories(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "apiToken": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_apiToken(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "auditLogs": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_auditLogs(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "contact": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_contact(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "documentData": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_documentData(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlement": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlement(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlementPlan": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlementPlan(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entitlementPlanFeature": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entitlementPlanFeature(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entity": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entity(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "entityType": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_entityType(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "event": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_event(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "feature": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_feature(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "file": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_file(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "group": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_group(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groupMembership": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groupMembership(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "groupSetting": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_groupSetting(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "hush": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_hush(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "integration": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_integration(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "invite": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_invite(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "oauthProvider": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_oauthProvider(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "ohAuthTooToken": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_ohAuthTooToken(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "organization": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_organization(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "organizationSetting": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_organizationSetting(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "orgMembership": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_orgMembership(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "personalAccessToken": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_personalAccessToken(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "search": + 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._Query_search(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "subscriber": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_subscriber(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "template": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_template(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "tfaSetting": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_tfaSetting(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "user": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_user(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "userSetting": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_userSetting(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "webhook": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_webhook(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var subscriberImplementors = []string{"Subscriber", "Node"} + +func (ec *executionContext) _Subscriber(ctx context.Context, sel ast.SelectionSet, obj *generated.Subscriber) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberImplementors) + + 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("Subscriber") + case "id": + out.Values[i] = ec._Subscriber_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Subscriber_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Subscriber_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Subscriber_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Subscriber_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Subscriber_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Subscriber_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Subscriber_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Subscriber_ownerID(ctx, field, obj) + case "email": + out.Values[i] = ec._Subscriber_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "phoneNumber": + out.Values[i] = ec._Subscriber_phoneNumber(ctx, field, obj) + case "verifiedEmail": + out.Values[i] = ec._Subscriber_verifiedEmail(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "verifiedPhone": + out.Values[i] = ec._Subscriber_verifiedPhone(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "active": + out.Values[i] = ec._Subscriber_active(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + 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._Subscriber_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Subscriber_events(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)) + } + } + 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 subscriberBulkCreatePayloadImplementors = []string{"SubscriberBulkCreatePayload"} + +func (ec *executionContext) _SubscriberBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *SubscriberBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberBulkCreatePayloadImplementors) + + 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("SubscriberBulkCreatePayload") + case "subscribers": + out.Values[i] = ec._SubscriberBulkCreatePayload_subscribers(ctx, field, obj) + 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 subscriberConnectionImplementors = []string{"SubscriberConnection"} + +func (ec *executionContext) _SubscriberConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.SubscriberConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberConnectionImplementors) + + 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("SubscriberConnection") + case "edges": + out.Values[i] = ec._SubscriberConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._SubscriberConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._SubscriberConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 subscriberCreatePayloadImplementors = []string{"SubscriberCreatePayload"} + +func (ec *executionContext) _SubscriberCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *SubscriberCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberCreatePayloadImplementors) + + 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("SubscriberCreatePayload") + case "subscriber": + out.Values[i] = ec._SubscriberCreatePayload_subscriber(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 subscriberDeletePayloadImplementors = []string{"SubscriberDeletePayload"} + +func (ec *executionContext) _SubscriberDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *SubscriberDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberDeletePayloadImplementors) + + 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("SubscriberDeletePayload") + case "email": + out.Values[i] = ec._SubscriberDeletePayload_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 subscriberEdgeImplementors = []string{"SubscriberEdge"} + +func (ec *executionContext) _SubscriberEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.SubscriberEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberEdgeImplementors) + + 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("SubscriberEdge") + case "node": + out.Values[i] = ec._SubscriberEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._SubscriberEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 subscriberSearchResultImplementors = []string{"SubscriberSearchResult", "GlobalSearchResult"} + +func (ec *executionContext) _SubscriberSearchResult(ctx context.Context, sel ast.SelectionSet, obj *SubscriberSearchResult) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberSearchResultImplementors) + + 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("SubscriberSearchResult") + case "subscribers": + out.Values[i] = ec._SubscriberSearchResult_subscribers(ctx, field, obj) + 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 subscriberUpdatePayloadImplementors = []string{"SubscriberUpdatePayload"} + +func (ec *executionContext) _SubscriberUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *SubscriberUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriberUpdatePayloadImplementors) + + 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("SubscriberUpdatePayload") + case "subscriber": + out.Values[i] = ec._SubscriberUpdatePayload_subscriber(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 tFASettingImplementors = []string{"TFASetting", "Node"} + +func (ec *executionContext) _TFASetting(ctx context.Context, sel ast.SelectionSet, obj *generated.TFASetting) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, tFASettingImplementors) + + 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("TFASetting") + case "id": + out.Values[i] = ec._TFASetting_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._TFASetting_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._TFASetting_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._TFASetting_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._TFASetting_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._TFASetting_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._TFASetting_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._TFASetting_tags(ctx, field, obj) + case "tfaSecret": + out.Values[i] = ec._TFASetting_tfaSecret(ctx, field, obj) + case "verified": + out.Values[i] = ec._TFASetting_verified(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "recoveryCodes": + out.Values[i] = ec._TFASetting_recoveryCodes(ctx, field, obj) + case "totpAllowed": + out.Values[i] = ec._TFASetting_totpAllowed(ctx, field, obj) + case "owner": + 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._TFASetting_owner(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)) + } + } + 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 tFASettingConnectionImplementors = []string{"TFASettingConnection"} + +func (ec *executionContext) _TFASettingConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.TFASettingConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, tFASettingConnectionImplementors) + + 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("TFASettingConnection") + case "edges": + out.Values[i] = ec._TFASettingConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._TFASettingConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._TFASettingConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 tFASettingCreatePayloadImplementors = []string{"TFASettingCreatePayload"} + +func (ec *executionContext) _TFASettingCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *TFASettingCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, tFASettingCreatePayloadImplementors) + + 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("TFASettingCreatePayload") + case "tfaSetting": + out.Values[i] = ec._TFASettingCreatePayload_tfaSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 tFASettingEdgeImplementors = []string{"TFASettingEdge"} + +func (ec *executionContext) _TFASettingEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.TFASettingEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, tFASettingEdgeImplementors) + + 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("TFASettingEdge") + case "node": + out.Values[i] = ec._TFASettingEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._TFASettingEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 tFASettingUpdatePayloadImplementors = []string{"TFASettingUpdatePayload"} + +func (ec *executionContext) _TFASettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *TFASettingUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, tFASettingUpdatePayloadImplementors) + + 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("TFASettingUpdatePayload") + case "tfaSetting": + out.Values[i] = ec._TFASettingUpdatePayload_tfaSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 templateImplementors = []string{"Template", "Node"} + +func (ec *executionContext) _Template(ctx context.Context, sel ast.SelectionSet, obj *generated.Template) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateImplementors) + + 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("Template") + case "id": + out.Values[i] = ec._Template_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Template_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Template_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Template_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Template_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Template_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Template_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Template_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Template_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._Template_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "templateType": + out.Values[i] = ec._Template_templateType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Template_description(ctx, field, obj) + case "jsonconfig": + out.Values[i] = ec._Template_jsonconfig(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "uischema": + out.Values[i] = ec._Template_uischema(ctx, field, obj) + case "owner": + 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._Template_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "documents": + 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._Template_documents(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)) + } + } + 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 templateBulkCreatePayloadImplementors = []string{"TemplateBulkCreatePayload"} + +func (ec *executionContext) _TemplateBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *TemplateBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateBulkCreatePayloadImplementors) + + 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("TemplateBulkCreatePayload") + case "templates": + out.Values[i] = ec._TemplateBulkCreatePayload_templates(ctx, field, obj) + 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 templateConnectionImplementors = []string{"TemplateConnection"} + +func (ec *executionContext) _TemplateConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.TemplateConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateConnectionImplementors) + + 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("TemplateConnection") + case "edges": + out.Values[i] = ec._TemplateConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._TemplateConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._TemplateConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 templateCreatePayloadImplementors = []string{"TemplateCreatePayload"} + +func (ec *executionContext) _TemplateCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *TemplateCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateCreatePayloadImplementors) + + 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("TemplateCreatePayload") + case "template": + out.Values[i] = ec._TemplateCreatePayload_template(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 templateDeletePayloadImplementors = []string{"TemplateDeletePayload"} + +func (ec *executionContext) _TemplateDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *TemplateDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateDeletePayloadImplementors) + + 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("TemplateDeletePayload") + case "deletedID": + out.Values[i] = ec._TemplateDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 templateEdgeImplementors = []string{"TemplateEdge"} + +func (ec *executionContext) _TemplateEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.TemplateEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateEdgeImplementors) + + 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("TemplateEdge") + case "node": + out.Values[i] = ec._TemplateEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._TemplateEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 templateHistoryImplementors = []string{"TemplateHistory", "Node"} + +func (ec *executionContext) _TemplateHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.TemplateHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateHistoryImplementors) + + 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("TemplateHistory") + case "id": + out.Values[i] = ec._TemplateHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._TemplateHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._TemplateHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._TemplateHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._TemplateHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._TemplateHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._TemplateHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._TemplateHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._TemplateHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._TemplateHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._TemplateHistory_tags(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._TemplateHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._TemplateHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "templateType": + out.Values[i] = ec._TemplateHistory_templateType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._TemplateHistory_description(ctx, field, obj) + case "jsonconfig": + out.Values[i] = ec._TemplateHistory_jsonconfig(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "uischema": + out.Values[i] = ec._TemplateHistory_uischema(ctx, field, obj) + 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 templateHistoryConnectionImplementors = []string{"TemplateHistoryConnection"} + +func (ec *executionContext) _TemplateHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.TemplateHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateHistoryConnectionImplementors) + + 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("TemplateHistoryConnection") + case "edges": + out.Values[i] = ec._TemplateHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._TemplateHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._TemplateHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 templateHistoryEdgeImplementors = []string{"TemplateHistoryEdge"} + +func (ec *executionContext) _TemplateHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.TemplateHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateHistoryEdgeImplementors) + + 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("TemplateHistoryEdge") + case "node": + out.Values[i] = ec._TemplateHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._TemplateHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 templateUpdatePayloadImplementors = []string{"TemplateUpdatePayload"} + +func (ec *executionContext) _TemplateUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *TemplateUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, templateUpdatePayloadImplementors) + + 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("TemplateUpdatePayload") + case "template": + out.Values[i] = ec._TemplateUpdatePayload_template(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userImplementors = []string{"User", "Node"} + +func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *generated.User) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userImplementors) + + 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("User") + case "id": + out.Values[i] = ec._User_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._User_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._User_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._User_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._User_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._User_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._User_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._User_tags(ctx, field, obj) + case "email": + out.Values[i] = ec._User_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "firstName": + out.Values[i] = ec._User_firstName(ctx, field, obj) + case "lastName": + out.Values[i] = ec._User_lastName(ctx, field, obj) + case "displayName": + out.Values[i] = ec._User_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "avatarRemoteURL": + out.Values[i] = ec._User_avatarRemoteURL(ctx, field, obj) + case "avatarLocalFile": + out.Values[i] = ec._User_avatarLocalFile(ctx, field, obj) + case "avatarUpdatedAt": + out.Values[i] = ec._User_avatarUpdatedAt(ctx, field, obj) + case "lastSeen": + out.Values[i] = ec._User_lastSeen(ctx, field, obj) + case "sub": + out.Values[i] = ec._User_sub(ctx, field, obj) + case "authProvider": + out.Values[i] = ec._User_authProvider(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "role": + out.Values[i] = ec._User_role(ctx, field, obj) + case "personalAccessTokens": + 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._User_personalAccessTokens(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "tfaSettings": + 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._User_tfaSettings(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "setting": + 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._User_setting(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "groups": + 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._User_groups(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "organizations": + 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._User_organizations(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "files": + 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._User_files(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._User_events(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "groupMemberships": + 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._User_groupMemberships(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "orgMemberships": + 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._User_orgMemberships(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)) + } + } + 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 userBulkCreatePayloadImplementors = []string{"UserBulkCreatePayload"} + +func (ec *executionContext) _UserBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *UserBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userBulkCreatePayloadImplementors) + + 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("UserBulkCreatePayload") + case "users": + out.Values[i] = ec._UserBulkCreatePayload_users(ctx, field, obj) + 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 userConnectionImplementors = []string{"UserConnection"} + +func (ec *executionContext) _UserConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.UserConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userConnectionImplementors) + + 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("UserConnection") + case "edges": + out.Values[i] = ec._UserConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._UserConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._UserConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userCreatePayloadImplementors = []string{"UserCreatePayload"} + +func (ec *executionContext) _UserCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *UserCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userCreatePayloadImplementors) + + 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("UserCreatePayload") + case "user": + out.Values[i] = ec._UserCreatePayload_user(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userDeletePayloadImplementors = []string{"UserDeletePayload"} + +func (ec *executionContext) _UserDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *UserDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userDeletePayloadImplementors) + + 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("UserDeletePayload") + case "deletedID": + out.Values[i] = ec._UserDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userEdgeImplementors = []string{"UserEdge"} + +func (ec *executionContext) _UserEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.UserEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userEdgeImplementors) + + 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("UserEdge") + case "node": + out.Values[i] = ec._UserEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._UserEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userHistoryImplementors = []string{"UserHistory", "Node"} + +func (ec *executionContext) _UserHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.UserHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userHistoryImplementors) + + 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("UserHistory") + case "id": + out.Values[i] = ec._UserHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._UserHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._UserHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._UserHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._UserHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._UserHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._UserHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._UserHistory_updatedBy(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._UserHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._UserHistory_deletedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._UserHistory_tags(ctx, field, obj) + case "email": + out.Values[i] = ec._UserHistory_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "firstName": + out.Values[i] = ec._UserHistory_firstName(ctx, field, obj) + case "lastName": + out.Values[i] = ec._UserHistory_lastName(ctx, field, obj) + case "displayName": + out.Values[i] = ec._UserHistory_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "avatarRemoteURL": + out.Values[i] = ec._UserHistory_avatarRemoteURL(ctx, field, obj) + case "avatarLocalFile": + out.Values[i] = ec._UserHistory_avatarLocalFile(ctx, field, obj) + case "avatarUpdatedAt": + out.Values[i] = ec._UserHistory_avatarUpdatedAt(ctx, field, obj) + case "lastSeen": + out.Values[i] = ec._UserHistory_lastSeen(ctx, field, obj) + case "sub": + out.Values[i] = ec._UserHistory_sub(ctx, field, obj) + case "authProvider": + out.Values[i] = ec._UserHistory_authProvider(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "role": + out.Values[i] = ec._UserHistory_role(ctx, field, obj) + 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 userHistoryConnectionImplementors = []string{"UserHistoryConnection"} + +func (ec *executionContext) _UserHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.UserHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userHistoryConnectionImplementors) + + 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("UserHistoryConnection") + case "edges": + out.Values[i] = ec._UserHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._UserHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._UserHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userHistoryEdgeImplementors = []string{"UserHistoryEdge"} + +func (ec *executionContext) _UserHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.UserHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userHistoryEdgeImplementors) + + 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("UserHistoryEdge") + case "node": + out.Values[i] = ec._UserHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._UserHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userSearchResultImplementors = []string{"UserSearchResult", "GlobalSearchResult"} + +func (ec *executionContext) _UserSearchResult(ctx context.Context, sel ast.SelectionSet, obj *UserSearchResult) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSearchResultImplementors) + + 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("UserSearchResult") + case "users": + out.Values[i] = ec._UserSearchResult_users(ctx, field, obj) + 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 userSettingImplementors = []string{"UserSetting", "Node"} + +func (ec *executionContext) _UserSetting(ctx context.Context, sel ast.SelectionSet, obj *generated.UserSetting) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingImplementors) + + 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("UserSetting") + case "id": + out.Values[i] = ec._UserSetting_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._UserSetting_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._UserSetting_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._UserSetting_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._UserSetting_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._UserSetting_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._UserSetting_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._UserSetting_deletedBy(ctx, field, obj) + case "userID": + out.Values[i] = ec._UserSetting_userID(ctx, field, obj) + case "locked": + out.Values[i] = ec._UserSetting_locked(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "silencedAt": + out.Values[i] = ec._UserSetting_silencedAt(ctx, field, obj) + case "suspendedAt": + out.Values[i] = ec._UserSetting_suspendedAt(ctx, field, obj) + case "status": + out.Values[i] = ec._UserSetting_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "emailConfirmed": + out.Values[i] = ec._UserSetting_emailConfirmed(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "isWebauthnAllowed": + out.Values[i] = ec._UserSetting_isWebauthnAllowed(ctx, field, obj) + case "isTfaEnabled": + out.Values[i] = ec._UserSetting_isTfaEnabled(ctx, field, obj) + case "user": + 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._UserSetting_user(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "defaultOrg": + 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._UserSetting_defaultOrg(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)) + } + } + 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 userSettingBulkCreatePayloadImplementors = []string{"UserSettingBulkCreatePayload"} + +func (ec *executionContext) _UserSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *UserSettingBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingBulkCreatePayloadImplementors) + + 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("UserSettingBulkCreatePayload") + case "userSettings": + out.Values[i] = ec._UserSettingBulkCreatePayload_userSettings(ctx, field, obj) + 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 userSettingConnectionImplementors = []string{"UserSettingConnection"} + +func (ec *executionContext) _UserSettingConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.UserSettingConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingConnectionImplementors) + + 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("UserSettingConnection") + case "edges": + out.Values[i] = ec._UserSettingConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._UserSettingConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._UserSettingConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userSettingCreatePayloadImplementors = []string{"UserSettingCreatePayload"} + +func (ec *executionContext) _UserSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *UserSettingCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingCreatePayloadImplementors) + + 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("UserSettingCreatePayload") + case "userSetting": + out.Values[i] = ec._UserSettingCreatePayload_userSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userSettingEdgeImplementors = []string{"UserSettingEdge"} + +func (ec *executionContext) _UserSettingEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.UserSettingEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingEdgeImplementors) + + 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("UserSettingEdge") + case "node": + out.Values[i] = ec._UserSettingEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._UserSettingEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userSettingHistoryImplementors = []string{"UserSettingHistory", "Node"} + +func (ec *executionContext) _UserSettingHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.UserSettingHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingHistoryImplementors) + + 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("UserSettingHistory") + case "id": + out.Values[i] = ec._UserSettingHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._UserSettingHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._UserSettingHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._UserSettingHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._UserSettingHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._UserSettingHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._UserSettingHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._UserSettingHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._UserSettingHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._UserSettingHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._UserSettingHistory_deletedBy(ctx, field, obj) + case "userID": + out.Values[i] = ec._UserSettingHistory_userID(ctx, field, obj) + case "locked": + out.Values[i] = ec._UserSettingHistory_locked(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "silencedAt": + out.Values[i] = ec._UserSettingHistory_silencedAt(ctx, field, obj) + case "suspendedAt": + out.Values[i] = ec._UserSettingHistory_suspendedAt(ctx, field, obj) + case "status": + out.Values[i] = ec._UserSettingHistory_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "emailConfirmed": + out.Values[i] = ec._UserSettingHistory_emailConfirmed(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isWebauthnAllowed": + out.Values[i] = ec._UserSettingHistory_isWebauthnAllowed(ctx, field, obj) + case "isTfaEnabled": + out.Values[i] = ec._UserSettingHistory_isTfaEnabled(ctx, field, obj) + 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 userSettingHistoryConnectionImplementors = []string{"UserSettingHistoryConnection"} + +func (ec *executionContext) _UserSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.UserSettingHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingHistoryConnectionImplementors) + + 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("UserSettingHistoryConnection") + case "edges": + out.Values[i] = ec._UserSettingHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._UserSettingHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._UserSettingHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userSettingHistoryEdgeImplementors = []string{"UserSettingHistoryEdge"} + +func (ec *executionContext) _UserSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.UserSettingHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingHistoryEdgeImplementors) + + 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("UserSettingHistoryEdge") + case "node": + out.Values[i] = ec._UserSettingHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._UserSettingHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userSettingUpdatePayloadImplementors = []string{"UserSettingUpdatePayload"} + +func (ec *executionContext) _UserSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *UserSettingUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userSettingUpdatePayloadImplementors) + + 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("UserSettingUpdatePayload") + case "userSetting": + out.Values[i] = ec._UserSettingUpdatePayload_userSetting(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 userUpdatePayloadImplementors = []string{"UserUpdatePayload"} + +func (ec *executionContext) _UserUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *UserUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userUpdatePayloadImplementors) + + 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("UserUpdatePayload") + case "user": + out.Values[i] = ec._UserUpdatePayload_user(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 webhookImplementors = []string{"Webhook", "Node"} + +func (ec *executionContext) _Webhook(ctx context.Context, sel ast.SelectionSet, obj *generated.Webhook) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookImplementors) + + 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("Webhook") + case "id": + out.Values[i] = ec._Webhook_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdAt": + out.Values[i] = ec._Webhook_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._Webhook_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._Webhook_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._Webhook_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._Webhook_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._Webhook_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._Webhook_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._Webhook_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._Webhook_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._Webhook_description(ctx, field, obj) + case "destinationURL": + out.Values[i] = ec._Webhook_destinationURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "enabled": + out.Values[i] = ec._Webhook_enabled(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "failures": + out.Values[i] = ec._Webhook_failures(ctx, field, obj) + case "lastError": + out.Values[i] = ec._Webhook_lastError(ctx, field, obj) + case "lastResponse": + out.Values[i] = ec._Webhook_lastResponse(ctx, field, obj) + case "owner": + 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._Webhook_owner(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "events": + 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._Webhook_events(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "integrations": + 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._Webhook_integrations(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)) + } + } + 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 webhookBulkCreatePayloadImplementors = []string{"WebhookBulkCreatePayload"} + +func (ec *executionContext) _WebhookBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *WebhookBulkCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookBulkCreatePayloadImplementors) + + 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("WebhookBulkCreatePayload") + case "webhooks": + out.Values[i] = ec._WebhookBulkCreatePayload_webhooks(ctx, field, obj) + 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 webhookConnectionImplementors = []string{"WebhookConnection"} + +func (ec *executionContext) _WebhookConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.WebhookConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookConnectionImplementors) + + 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("WebhookConnection") + case "edges": + out.Values[i] = ec._WebhookConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._WebhookConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._WebhookConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 webhookCreatePayloadImplementors = []string{"WebhookCreatePayload"} + +func (ec *executionContext) _WebhookCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *WebhookCreatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookCreatePayloadImplementors) + + 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("WebhookCreatePayload") + case "webhook": + out.Values[i] = ec._WebhookCreatePayload_webhook(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 webhookDeletePayloadImplementors = []string{"WebhookDeletePayload"} + +func (ec *executionContext) _WebhookDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *WebhookDeletePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookDeletePayloadImplementors) + + 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("WebhookDeletePayload") + case "deletedID": + out.Values[i] = ec._WebhookDeletePayload_deletedID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 webhookEdgeImplementors = []string{"WebhookEdge"} + +func (ec *executionContext) _WebhookEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.WebhookEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookEdgeImplementors) + + 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("WebhookEdge") + case "node": + out.Values[i] = ec._WebhookEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._WebhookEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 webhookHistoryImplementors = []string{"WebhookHistory", "Node"} + +func (ec *executionContext) _WebhookHistory(ctx context.Context, sel ast.SelectionSet, obj *generated.WebhookHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookHistoryImplementors) + + 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("WebhookHistory") + case "id": + out.Values[i] = ec._WebhookHistory_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "historyTime": + out.Values[i] = ec._WebhookHistory_historyTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ref": + out.Values[i] = ec._WebhookHistory_ref(ctx, field, obj) + case "operation": + out.Values[i] = ec._WebhookHistory_operation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdAt": + out.Values[i] = ec._WebhookHistory_createdAt(ctx, field, obj) + case "updatedAt": + out.Values[i] = ec._WebhookHistory_updatedAt(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._WebhookHistory_createdBy(ctx, field, obj) + case "updatedBy": + out.Values[i] = ec._WebhookHistory_updatedBy(ctx, field, obj) + case "tags": + out.Values[i] = ec._WebhookHistory_tags(ctx, field, obj) + case "deletedAt": + out.Values[i] = ec._WebhookHistory_deletedAt(ctx, field, obj) + case "deletedBy": + out.Values[i] = ec._WebhookHistory_deletedBy(ctx, field, obj) + case "ownerID": + out.Values[i] = ec._WebhookHistory_ownerID(ctx, field, obj) + case "name": + out.Values[i] = ec._WebhookHistory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._WebhookHistory_description(ctx, field, obj) + case "destinationURL": + out.Values[i] = ec._WebhookHistory_destinationURL(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "enabled": + out.Values[i] = ec._WebhookHistory_enabled(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "failures": + out.Values[i] = ec._WebhookHistory_failures(ctx, field, obj) + case "lastError": + out.Values[i] = ec._WebhookHistory_lastError(ctx, field, obj) + case "lastResponse": + out.Values[i] = ec._WebhookHistory_lastResponse(ctx, field, obj) + 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 webhookHistoryConnectionImplementors = []string{"WebhookHistoryConnection"} + +func (ec *executionContext) _WebhookHistoryConnection(ctx context.Context, sel ast.SelectionSet, obj *generated.WebhookHistoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookHistoryConnectionImplementors) + + 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("WebhookHistoryConnection") + case "edges": + out.Values[i] = ec._WebhookHistoryConnection_edges(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._WebhookHistoryConnection_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._WebhookHistoryConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 webhookHistoryEdgeImplementors = []string{"WebhookHistoryEdge"} + +func (ec *executionContext) _WebhookHistoryEdge(ctx context.Context, sel ast.SelectionSet, obj *generated.WebhookHistoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookHistoryEdgeImplementors) + + 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("WebhookHistoryEdge") + case "node": + out.Values[i] = ec._WebhookHistoryEdge_node(ctx, field, obj) + case "cursor": + out.Values[i] = ec._WebhookHistoryEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 webhookUpdatePayloadImplementors = []string{"WebhookUpdatePayload"} + +func (ec *executionContext) _WebhookUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *WebhookUpdatePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookUpdatePayloadImplementors) + + 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("WebhookUpdatePayload") + case "webhook": + out.Values[i] = ec._WebhookUpdatePayload_webhook(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + 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 __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + 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 __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + 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 __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + 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 __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + 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 __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(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 +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) marshalNAPIToken2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx context.Context, sel ast.SelectionSet, v generated.APIToken) graphql.Marshaler { + return ec._APIToken(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAPIToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx context.Context, sel ast.SelectionSet, v *generated.APIToken) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._APIToken(ctx, sel, v) +} + +func (ec *executionContext) marshalNAPITokenBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v APITokenBulkCreatePayload) graphql.Marshaler { + return ec._APITokenBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAPITokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *APITokenBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._APITokenBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNAPITokenConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenConnection(ctx context.Context, sel ast.SelectionSet, v generated.APITokenConnection) graphql.Marshaler { + return ec._APITokenConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAPITokenConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenConnection(ctx context.Context, sel ast.SelectionSet, v *generated.APITokenConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._APITokenConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNAPITokenCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenCreatePayload(ctx context.Context, sel ast.SelectionSet, v APITokenCreatePayload) graphql.Marshaler { + return ec._APITokenCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAPITokenCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenCreatePayload(ctx context.Context, sel ast.SelectionSet, v *APITokenCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._APITokenCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNAPITokenDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenDeletePayload(ctx context.Context, sel ast.SelectionSet, v APITokenDeletePayload) graphql.Marshaler { + return ec._APITokenDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAPITokenDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenDeletePayload(ctx context.Context, sel ast.SelectionSet, v *APITokenDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._APITokenDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNAPITokenUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, v APITokenUpdatePayload) graphql.Marshaler { + return ec._APITokenUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAPITokenUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAPITokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *APITokenUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._APITokenUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNAPITokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInput(ctx context.Context, v interface{}) (*generated.APITokenWhereInput, error) { + res, err := ec.unmarshalInputAPITokenWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNAuditLogConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogConnection(ctx context.Context, sel ast.SelectionSet, v AuditLogConnection) graphql.Marshaler { + return ec._AuditLogConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNAuditLogConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogConnection(ctx context.Context, sel ast.SelectionSet, v *AuditLogConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._AuditLogConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNContact2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx context.Context, sel ast.SelectionSet, v generated.Contact) graphql.Marshaler { + return ec._Contact(ctx, sel, &v) +} + +func (ec *executionContext) marshalNContact2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx context.Context, sel ast.SelectionSet, v *generated.Contact) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Contact(ctx, sel, v) +} + +func (ec *executionContext) marshalNContactBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v ContactBulkCreatePayload) graphql.Marshaler { + return ec._ContactBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNContactBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *ContactBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ContactBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNContactConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactConnection(ctx context.Context, sel ast.SelectionSet, v generated.ContactConnection) graphql.Marshaler { + return ec._ContactConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNContactConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactConnection(ctx context.Context, sel ast.SelectionSet, v *generated.ContactConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ContactConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNContactCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactCreatePayload(ctx context.Context, sel ast.SelectionSet, v ContactCreatePayload) graphql.Marshaler { + return ec._ContactCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNContactCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactCreatePayload(ctx context.Context, sel ast.SelectionSet, v *ContactCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ContactCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNContactDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactDeletePayload(ctx context.Context, sel ast.SelectionSet, v ContactDeletePayload) graphql.Marshaler { + return ec._ContactDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNContactDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactDeletePayload(ctx context.Context, sel ast.SelectionSet, v *ContactDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ContactDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNContactHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.ContactHistoryConnection) graphql.Marshaler { + return ec._ContactHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNContactHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.ContactHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ContactHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNContactHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNContactHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNContactHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (enums.UserStatus, error) { + var res enums.UserStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNContactHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v enums.UserStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNContactHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInput(ctx context.Context, v interface{}) (*generated.ContactHistoryWhereInput, error) { + res, err := ec.unmarshalInputContactHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNContactUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactUpdatePayload(ctx context.Context, sel ast.SelectionSet, v ContactUpdatePayload) graphql.Marshaler { + return ec._ContactUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNContactUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐContactUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *ContactUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ContactUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNContactUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (enums.UserStatus, error) { + var res enums.UserStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNContactUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v enums.UserStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNContactWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInput(ctx context.Context, v interface{}) (*generated.ContactWhereInput, error) { + res, err := ec.unmarshalInputContactWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateAPITokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateAPITokenInput(ctx context.Context, v interface{}) (generated.CreateAPITokenInput, error) { + res, err := ec.unmarshalInputCreateAPITokenInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateAPITokenInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateAPITokenInput(ctx context.Context, v interface{}) (*generated.CreateAPITokenInput, error) { + res, err := ec.unmarshalInputCreateAPITokenInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateContactInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateContactInput(ctx context.Context, v interface{}) (generated.CreateContactInput, error) { + res, err := ec.unmarshalInputCreateContactInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateContactInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateContactInput(ctx context.Context, v interface{}) (*generated.CreateContactInput, error) { + res, err := ec.unmarshalInputCreateContactInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateDocumentDataInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateDocumentDataInput(ctx context.Context, v interface{}) (generated.CreateDocumentDataInput, error) { + res, err := ec.unmarshalInputCreateDocumentDataInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateDocumentDataInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateDocumentDataInput(ctx context.Context, v interface{}) (*generated.CreateDocumentDataInput, error) { + res, err := ec.unmarshalInputCreateDocumentDataInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntitlementInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementInput(ctx context.Context, v interface{}) (generated.CreateEntitlementInput, error) { + res, err := ec.unmarshalInputCreateEntitlementInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntitlementInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementInput(ctx context.Context, v interface{}) (*generated.CreateEntitlementInput, error) { + res, err := ec.unmarshalInputCreateEntitlementInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntitlementPlanFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanFeatureInput(ctx context.Context, v interface{}) (generated.CreateEntitlementPlanFeatureInput, error) { + res, err := ec.unmarshalInputCreateEntitlementPlanFeatureInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntitlementPlanFeatureInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanFeatureInput(ctx context.Context, v interface{}) (*generated.CreateEntitlementPlanFeatureInput, error) { + res, err := ec.unmarshalInputCreateEntitlementPlanFeatureInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntitlementPlanInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanInput(ctx context.Context, v interface{}) (generated.CreateEntitlementPlanInput, error) { + res, err := ec.unmarshalInputCreateEntitlementPlanInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntitlementPlanInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanInput(ctx context.Context, v interface{}) (*generated.CreateEntitlementPlanInput, error) { + res, err := ec.unmarshalInputCreateEntitlementPlanInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntityInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityInput(ctx context.Context, v interface{}) (generated.CreateEntityInput, error) { + res, err := ec.unmarshalInputCreateEntityInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntityInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityInput(ctx context.Context, v interface{}) (*generated.CreateEntityInput, error) { + res, err := ec.unmarshalInputCreateEntityInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntityTypeInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityTypeInput(ctx context.Context, v interface{}) (generated.CreateEntityTypeInput, error) { + res, err := ec.unmarshalInputCreateEntityTypeInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEntityTypeInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityTypeInput(ctx context.Context, v interface{}) (*generated.CreateEntityTypeInput, error) { + res, err := ec.unmarshalInputCreateEntityTypeInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEventInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEventInput(ctx context.Context, v interface{}) (generated.CreateEventInput, error) { + res, err := ec.unmarshalInputCreateEventInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateEventInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEventInput(ctx context.Context, v interface{}) (*generated.CreateEventInput, error) { + res, err := ec.unmarshalInputCreateEventInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFeatureInput(ctx context.Context, v interface{}) (generated.CreateFeatureInput, error) { + res, err := ec.unmarshalInputCreateFeatureInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateFeatureInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFeatureInput(ctx context.Context, v interface{}) (*generated.CreateFeatureInput, error) { + res, err := ec.unmarshalInputCreateFeatureInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateFileInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFileInput(ctx context.Context, v interface{}) (generated.CreateFileInput, error) { + res, err := ec.unmarshalInputCreateFileInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateFileInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFileInput(ctx context.Context, v interface{}) (*generated.CreateFileInput, error) { + res, err := ec.unmarshalInputCreateFileInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateGroupInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupInput(ctx context.Context, v interface{}) (generated.CreateGroupInput, error) { + res, err := ec.unmarshalInputCreateGroupInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateGroupInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupInput(ctx context.Context, v interface{}) (*generated.CreateGroupInput, error) { + res, err := ec.unmarshalInputCreateGroupInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateGroupMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupMembershipInput(ctx context.Context, v interface{}) (generated.CreateGroupMembershipInput, error) { + res, err := ec.unmarshalInputCreateGroupMembershipInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateGroupMembershipInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupMembershipInput(ctx context.Context, v interface{}) (*generated.CreateGroupMembershipInput, error) { + res, err := ec.unmarshalInputCreateGroupMembershipInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateGroupSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInput(ctx context.Context, v interface{}) (generated.CreateGroupSettingInput, error) { + res, err := ec.unmarshalInputCreateGroupSettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateGroupSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInput(ctx context.Context, v interface{}) (*generated.CreateGroupSettingInput, error) { + res, err := ec.unmarshalInputCreateGroupSettingInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateHushInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateHushInput(ctx context.Context, v interface{}) (generated.CreateHushInput, error) { + res, err := ec.unmarshalInputCreateHushInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateHushInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateHushInput(ctx context.Context, v interface{}) (*generated.CreateHushInput, error) { + res, err := ec.unmarshalInputCreateHushInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateIntegrationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateIntegrationInput(ctx context.Context, v interface{}) (generated.CreateIntegrationInput, error) { + res, err := ec.unmarshalInputCreateIntegrationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateIntegrationInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateIntegrationInput(ctx context.Context, v interface{}) (*generated.CreateIntegrationInput, error) { + res, err := ec.unmarshalInputCreateIntegrationInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateInviteInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateInviteInput(ctx context.Context, v interface{}) (generated.CreateInviteInput, error) { + res, err := ec.unmarshalInputCreateInviteInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateInviteInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateInviteInput(ctx context.Context, v interface{}) (*generated.CreateInviteInput, error) { + res, err := ec.unmarshalInputCreateInviteInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOauthProviderInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOauthProviderInput(ctx context.Context, v interface{}) (generated.CreateOauthProviderInput, error) { + res, err := ec.unmarshalInputCreateOauthProviderInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOauthProviderInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOauthProviderInput(ctx context.Context, v interface{}) (*generated.CreateOauthProviderInput, error) { + res, err := ec.unmarshalInputCreateOauthProviderInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOhAuthTooTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOhAuthTooTokenInput(ctx context.Context, v interface{}) (generated.CreateOhAuthTooTokenInput, error) { + res, err := ec.unmarshalInputCreateOhAuthTooTokenInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOhAuthTooTokenInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOhAuthTooTokenInput(ctx context.Context, v interface{}) (*generated.CreateOhAuthTooTokenInput, error) { + res, err := ec.unmarshalInputCreateOhAuthTooTokenInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOrgMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgMembershipInput(ctx context.Context, v interface{}) (generated.CreateOrgMembershipInput, error) { + res, err := ec.unmarshalInputCreateOrgMembershipInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOrgMembershipInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgMembershipInput(ctx context.Context, v interface{}) (*generated.CreateOrgMembershipInput, error) { + res, err := ec.unmarshalInputCreateOrgMembershipInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOrganizationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInput(ctx context.Context, v interface{}) (generated.CreateOrganizationInput, error) { + res, err := ec.unmarshalInputCreateOrganizationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOrganizationInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInput(ctx context.Context, v interface{}) (*generated.CreateOrganizationInput, error) { + res, err := ec.unmarshalInputCreateOrganizationInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOrganizationSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInput(ctx context.Context, v interface{}) (generated.CreateOrganizationSettingInput, error) { + res, err := ec.unmarshalInputCreateOrganizationSettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateOrganizationSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInput(ctx context.Context, v interface{}) (*generated.CreateOrganizationSettingInput, error) { + res, err := ec.unmarshalInputCreateOrganizationSettingInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreatePersonalAccessTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreatePersonalAccessTokenInput(ctx context.Context, v interface{}) (generated.CreatePersonalAccessTokenInput, error) { + res, err := ec.unmarshalInputCreatePersonalAccessTokenInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreatePersonalAccessTokenInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreatePersonalAccessTokenInput(ctx context.Context, v interface{}) (*generated.CreatePersonalAccessTokenInput, error) { + res, err := ec.unmarshalInputCreatePersonalAccessTokenInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateSubscriberInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateSubscriberInput(ctx context.Context, v interface{}) (generated.CreateSubscriberInput, error) { + res, err := ec.unmarshalInputCreateSubscriberInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateSubscriberInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateSubscriberInput(ctx context.Context, v interface{}) (*generated.CreateSubscriberInput, error) { + res, err := ec.unmarshalInputCreateSubscriberInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateTFASettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTFASettingInput(ctx context.Context, v interface{}) (generated.CreateTFASettingInput, error) { + res, err := ec.unmarshalInputCreateTFASettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateTemplateInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTemplateInput(ctx context.Context, v interface{}) (generated.CreateTemplateInput, error) { + res, err := ec.unmarshalInputCreateTemplateInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateTemplateInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTemplateInput(ctx context.Context, v interface{}) (*generated.CreateTemplateInput, error) { + res, err := ec.unmarshalInputCreateTemplateInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateUserInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserInput(ctx context.Context, v interface{}) (generated.CreateUserInput, error) { + res, err := ec.unmarshalInputCreateUserInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateUserSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserSettingInput(ctx context.Context, v interface{}) (generated.CreateUserSettingInput, error) { + res, err := ec.unmarshalInputCreateUserSettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateUserSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserSettingInput(ctx context.Context, v interface{}) (*generated.CreateUserSettingInput, error) { + res, err := ec.unmarshalInputCreateUserSettingInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateWebhookInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateWebhookInput(ctx context.Context, v interface{}) (generated.CreateWebhookInput, error) { + res, err := ec.unmarshalInputCreateWebhookInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCreateWebhookInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateWebhookInput(ctx context.Context, v interface{}) (*generated.CreateWebhookInput, error) { + res, err := ec.unmarshalInputCreateWebhookInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, v interface{}) (entgql.Cursor[string], error) { + var res entgql.Cursor[string] + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNCursor2entgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, sel ast.SelectionSet, v entgql.Cursor[string]) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNDocumentData2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx context.Context, sel ast.SelectionSet, v generated.DocumentData) graphql.Marshaler { + return ec._DocumentData(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDocumentData2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx context.Context, sel ast.SelectionSet, v *generated.DocumentData) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DocumentData(ctx, sel, v) +} + +func (ec *executionContext) marshalNDocumentDataBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v DocumentDataBulkCreatePayload) graphql.Marshaler { + return ec._DocumentDataBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDocumentDataBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *DocumentDataBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DocumentDataBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNDocumentDataConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataConnection(ctx context.Context, sel ast.SelectionSet, v generated.DocumentDataConnection) graphql.Marshaler { + return ec._DocumentDataConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDocumentDataConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataConnection(ctx context.Context, sel ast.SelectionSet, v *generated.DocumentDataConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DocumentDataConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNDocumentDataCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataCreatePayload(ctx context.Context, sel ast.SelectionSet, v DocumentDataCreatePayload) graphql.Marshaler { + return ec._DocumentDataCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDocumentDataCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataCreatePayload(ctx context.Context, sel ast.SelectionSet, v *DocumentDataCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DocumentDataCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNDocumentDataDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataDeletePayload(ctx context.Context, sel ast.SelectionSet, v DocumentDataDeletePayload) graphql.Marshaler { + return ec._DocumentDataDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDocumentDataDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataDeletePayload(ctx context.Context, sel ast.SelectionSet, v *DocumentDataDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DocumentDataDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNDocumentDataHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.DocumentDataHistoryConnection) graphql.Marshaler { + return ec._DocumentDataHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDocumentDataHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.DocumentDataHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DocumentDataHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDocumentDataHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNDocumentDataHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNDocumentDataHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInput(ctx context.Context, v interface{}) (*generated.DocumentDataHistoryWhereInput, error) { + res, err := ec.unmarshalInputDocumentDataHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNDocumentDataUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataUpdatePayload(ctx context.Context, sel ast.SelectionSet, v DocumentDataUpdatePayload) graphql.Marshaler { + return ec._DocumentDataUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDocumentDataUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐDocumentDataUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *DocumentDataUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DocumentDataUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDocumentDataWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInput(ctx context.Context, v interface{}) (*generated.DocumentDataWhereInput, error) { + res, err := ec.unmarshalInputDocumentDataWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlement2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx context.Context, sel ast.SelectionSet, v generated.Entitlement) graphql.Marshaler { + return ec._Entitlement(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlement2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx context.Context, sel ast.SelectionSet, v *generated.Entitlement) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Entitlement(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementBulkCreatePayload) graphql.Marshaler { + return ec._EntitlementBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementConnection) graphql.Marshaler { + return ec._EntitlementConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementCreatePayload) graphql.Marshaler { + return ec._EntitlementCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementDeletePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementDeletePayload) graphql.Marshaler { + return ec._EntitlementDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementDeletePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementHistoryConnection) graphql.Marshaler { + return ec._EntitlementHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntitlementHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNEntitlementHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementHistoryWhereInput, error) { + res, err := ec.unmarshalInputEntitlementHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementPlan2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementPlan) graphql.Marshaler { + return ec._EntitlementPlan(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlan) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlan(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanBulkCreatePayload) graphql.Marshaler { + return ec._EntitlementPlanBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementPlanConnection) graphql.Marshaler { + return ec._EntitlementPlanConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanCreatePayload) graphql.Marshaler { + return ec._EntitlementPlanCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanDeletePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanDeletePayload) graphql.Marshaler { + return ec._EntitlementPlanDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanDeletePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeature2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementPlanFeature) graphql.Marshaler { + return ec._EntitlementPlanFeature(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanFeature) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanFeature(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanFeatureBulkCreatePayload) graphql.Marshaler { + return ec._EntitlementPlanFeatureBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanFeatureBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanFeatureBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementPlanFeatureConnection) graphql.Marshaler { + return ec._EntitlementPlanFeatureConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanFeatureConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanFeatureConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanFeatureCreatePayload) graphql.Marshaler { + return ec._EntitlementPlanFeatureCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanFeatureCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanFeatureCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureDeletePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanFeatureDeletePayload) graphql.Marshaler { + return ec._EntitlementPlanFeatureDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureDeletePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanFeatureDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanFeatureDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementPlanFeatureHistoryConnection) graphql.Marshaler { + return ec._EntitlementPlanFeatureHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanFeatureHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanFeatureHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntitlementPlanFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNEntitlementPlanFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanFeatureHistoryWhereInput, error) { + res, err := ec.unmarshalInputEntitlementPlanFeatureHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureUpdatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanFeatureUpdatePayload) graphql.Marshaler { + return ec._EntitlementPlanFeatureUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanFeatureUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanFeatureUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanFeatureUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanFeatureUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntitlementPlanFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanFeatureWhereInput, error) { + res, err := ec.unmarshalInputEntitlementPlanFeatureWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementPlanHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntitlementPlanHistoryConnection) graphql.Marshaler { + return ec._EntitlementPlanHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntitlementPlanHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementPlanHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNEntitlementPlanHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanHistoryWhereInput, error) { + res, err := ec.unmarshalInputEntitlementPlanHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementPlanUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanUpdatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementPlanUpdatePayload) graphql.Marshaler { + return ec._EntitlementPlanUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementPlanUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementPlanUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementPlanUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementPlanUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntitlementPlanWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanWhereInput, error) { + res, err := ec.unmarshalInputEntitlementPlanWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntitlementUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementUpdatePayload(ctx context.Context, sel ast.SelectionSet, v EntitlementUpdatePayload) graphql.Marshaler { + return ec._EntitlementUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntitlementUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntitlementUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *EntitlementUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntitlementUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntitlementWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementWhereInput, error) { + res, err := ec.unmarshalInputEntitlementWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntity2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx context.Context, sel ast.SelectionSet, v generated.Entity) graphql.Marshaler { + return ec._Entity(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx context.Context, sel ast.SelectionSet, v *generated.Entity) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntityBulkCreatePayload) graphql.Marshaler { + return ec._EntityBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntityBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntityConnection) graphql.Marshaler { + return ec._EntityConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntityConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntityCreatePayload) graphql.Marshaler { + return ec._EntityCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntityCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityDeletePayload(ctx context.Context, sel ast.SelectionSet, v EntityDeletePayload) graphql.Marshaler { + return ec._EntityDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityDeletePayload(ctx context.Context, sel ast.SelectionSet, v *EntityDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntityHistoryConnection) graphql.Marshaler { + return ec._EntityHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntityHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntityHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntityHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNEntityHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryOrderField(ctx context.Context, v interface{}) (*generated.EntityHistoryOrderField, error) { + var res = new(generated.EntityHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntityHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.EntityHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNEntityHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntityHistoryWhereInput, error) { + res, err := ec.unmarshalInputEntityHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNEntityOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityOrderField(ctx context.Context, v interface{}) (*generated.EntityOrderField, error) { + var res = new(generated.EntityOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntityOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.EntityOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNEntityType2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx context.Context, sel ast.SelectionSet, v generated.EntityType) graphql.Marshaler { + return ec._EntityType(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx context.Context, sel ast.SelectionSet, v *generated.EntityType) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityType(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityTypeBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntityTypeBulkCreatePayload) graphql.Marshaler { + return ec._EntityTypeBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityTypeBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntityTypeBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityTypeBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityTypeConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntityTypeConnection) graphql.Marshaler { + return ec._EntityTypeConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityTypeConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntityTypeConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityTypeConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityTypeCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeCreatePayload(ctx context.Context, sel ast.SelectionSet, v EntityTypeCreatePayload) graphql.Marshaler { + return ec._EntityTypeCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityTypeCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EntityTypeCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityTypeCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityTypeDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeDeletePayload(ctx context.Context, sel ast.SelectionSet, v EntityTypeDeletePayload) graphql.Marshaler { + return ec._EntityTypeDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityTypeDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeDeletePayload(ctx context.Context, sel ast.SelectionSet, v *EntityTypeDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityTypeDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEntityTypeHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.EntityTypeHistoryConnection) graphql.Marshaler { + return ec._EntityTypeHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityTypeHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EntityTypeHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityTypeHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntityTypeHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntityTypeHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNEntityTypeHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryOrderField(ctx context.Context, v interface{}) (*generated.EntityTypeHistoryOrderField, error) { + var res = new(generated.EntityTypeHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntityTypeHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.EntityTypeHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNEntityTypeHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntityTypeHistoryWhereInput, error) { + res, err := ec.unmarshalInputEntityTypeHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNEntityTypeOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeOrderField(ctx context.Context, v interface{}) (*generated.EntityTypeOrderField, error) { + var res = new(generated.EntityTypeOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntityTypeOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.EntityTypeOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNEntityTypeUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeUpdatePayload(ctx context.Context, sel ast.SelectionSet, v EntityTypeUpdatePayload) graphql.Marshaler { + return ec._EntityTypeUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityTypeUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityTypeUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *EntityTypeUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityTypeUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntityTypeWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInput(ctx context.Context, v interface{}) (*generated.EntityTypeWhereInput, error) { + res, err := ec.unmarshalInputEntityTypeWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEntityUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityUpdatePayload(ctx context.Context, sel ast.SelectionSet, v EntityUpdatePayload) graphql.Marshaler { + return ec._EntityUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEntityUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEntityUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *EntityUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EntityUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEntityWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInput(ctx context.Context, v interface{}) (*generated.EntityWhereInput, error) { + res, err := ec.unmarshalInputEntityWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEvent2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx context.Context, sel ast.SelectionSet, v generated.Event) graphql.Marshaler { + return ec._Event(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEvent2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx context.Context, sel ast.SelectionSet, v *generated.Event) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Event(ctx, sel, v) +} + +func (ec *executionContext) marshalNEventBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v EventBulkCreatePayload) graphql.Marshaler { + return ec._EventBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEventBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EventBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EventBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEventConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventConnection(ctx context.Context, sel ast.SelectionSet, v generated.EventConnection) graphql.Marshaler { + return ec._EventConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEventConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EventConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EventConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNEventCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventCreatePayload(ctx context.Context, sel ast.SelectionSet, v EventCreatePayload) graphql.Marshaler { + return ec._EventCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEventCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventCreatePayload(ctx context.Context, sel ast.SelectionSet, v *EventCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EventCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEventDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventDeletePayload(ctx context.Context, sel ast.SelectionSet, v EventDeletePayload) graphql.Marshaler { + return ec._EventDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEventDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventDeletePayload(ctx context.Context, sel ast.SelectionSet, v *EventDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EventDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNEventHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.EventHistoryConnection) graphql.Marshaler { + return ec._EventHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEventHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.EventHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EventHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEventHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEventHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNEventHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EventHistoryWhereInput, error) { + res, err := ec.unmarshalInputEventHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNEventUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventUpdatePayload(ctx context.Context, sel ast.SelectionSet, v EventUpdatePayload) graphql.Marshaler { + return ec._EventUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNEventUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐEventUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *EventUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._EventUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNEventWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInput(ctx context.Context, v interface{}) (*generated.EventWhereInput, error) { + res, err := ec.unmarshalInputEventWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFeature2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx context.Context, sel ast.SelectionSet, v generated.Feature) graphql.Marshaler { + return ec._Feature(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx context.Context, sel ast.SelectionSet, v *generated.Feature) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Feature(ctx, sel, v) +} + +func (ec *executionContext) marshalNFeatureBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v FeatureBulkCreatePayload) graphql.Marshaler { + return ec._FeatureBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFeatureBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *FeatureBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FeatureBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNFeatureConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureConnection(ctx context.Context, sel ast.SelectionSet, v generated.FeatureConnection) graphql.Marshaler { + return ec._FeatureConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFeatureConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureConnection(ctx context.Context, sel ast.SelectionSet, v *generated.FeatureConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FeatureConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNFeatureCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureCreatePayload(ctx context.Context, sel ast.SelectionSet, v FeatureCreatePayload) graphql.Marshaler { + return ec._FeatureCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFeatureCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureCreatePayload(ctx context.Context, sel ast.SelectionSet, v *FeatureCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FeatureCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNFeatureDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureDeletePayload(ctx context.Context, sel ast.SelectionSet, v FeatureDeletePayload) graphql.Marshaler { + return ec._FeatureDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFeatureDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureDeletePayload(ctx context.Context, sel ast.SelectionSet, v *FeatureDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FeatureDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNFeatureHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.FeatureHistoryConnection) graphql.Marshaler { + return ec._FeatureHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFeatureHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.FeatureHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FeatureHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInput(ctx context.Context, v interface{}) (*generated.FeatureHistoryWhereInput, error) { + res, err := ec.unmarshalInputFeatureHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFeatureUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureUpdatePayload(ctx context.Context, sel ast.SelectionSet, v FeatureUpdatePayload) graphql.Marshaler { + return ec._FeatureUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFeatureUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFeatureUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *FeatureUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FeatureUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInput(ctx context.Context, v interface{}) (*generated.FeatureWhereInput, error) { + res, err := ec.unmarshalInputFeatureWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFile2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx context.Context, sel ast.SelectionSet, v generated.File) graphql.Marshaler { + return ec._File(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFile2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx context.Context, sel ast.SelectionSet, v *generated.File) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._File(ctx, sel, v) +} + +func (ec *executionContext) marshalNFileBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v FileBulkCreatePayload) graphql.Marshaler { + return ec._FileBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFileBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *FileBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FileBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNFileConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileConnection(ctx context.Context, sel ast.SelectionSet, v generated.FileConnection) graphql.Marshaler { + return ec._FileConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFileConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileConnection(ctx context.Context, sel ast.SelectionSet, v *generated.FileConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FileConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNFileCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileCreatePayload(ctx context.Context, sel ast.SelectionSet, v FileCreatePayload) graphql.Marshaler { + return ec._FileCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFileCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileCreatePayload(ctx context.Context, sel ast.SelectionSet, v *FileCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FileCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNFileDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileDeletePayload(ctx context.Context, sel ast.SelectionSet, v FileDeletePayload) graphql.Marshaler { + return ec._FileDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFileDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileDeletePayload(ctx context.Context, sel ast.SelectionSet, v *FileDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FileDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNFileHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.FileHistoryConnection) graphql.Marshaler { + return ec._FileHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFileHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.FileHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FileHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFileHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFileHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNFileHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInput(ctx context.Context, v interface{}) (*generated.FileHistoryWhereInput, error) { + res, err := ec.unmarshalInputFileHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFileUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileUpdatePayload(ctx context.Context, sel ast.SelectionSet, v FileUpdatePayload) graphql.Marshaler { + return ec._FileUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNFileUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐFileUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *FileUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._FileUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFileWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInput(ctx context.Context, v interface{}) (*generated.FileWhereInput, error) { + res, err := ec.unmarshalInputFileWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGlobalSearchResult2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGlobalSearchResult(ctx context.Context, sel ast.SelectionSet, v GlobalSearchResult) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GlobalSearchResult(ctx, sel, v) +} + +func (ec *executionContext) marshalNGlobalSearchResult2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGlobalSearchResultᚄ(ctx context.Context, sel ast.SelectionSet, v []GlobalSearchResult) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGlobalSearchResult2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGlobalSearchResult(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNGroup2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx context.Context, sel ast.SelectionSet, v generated.Group) graphql.Marshaler { + return ec._Group(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx context.Context, sel ast.SelectionSet, v *generated.Group) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Group(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v GroupBulkCreatePayload) graphql.Marshaler { + return ec._GroupBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupConnection(ctx context.Context, sel ast.SelectionSet, v generated.GroupConnection) graphql.Marshaler { + return ec._GroupConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupConnection(ctx context.Context, sel ast.SelectionSet, v *generated.GroupConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupCreatePayload(ctx context.Context, sel ast.SelectionSet, v GroupCreatePayload) graphql.Marshaler { + return ec._GroupCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupCreatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupDeletePayload(ctx context.Context, sel ast.SelectionSet, v GroupDeletePayload) graphql.Marshaler { + return ec._GroupDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupDeletePayload(ctx context.Context, sel ast.SelectionSet, v *GroupDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.GroupHistoryConnection) graphql.Marshaler { + return ec._GroupHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.GroupHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGroupHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNGroupHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryOrderField(ctx context.Context, v interface{}) (*generated.GroupHistoryOrderField, error) { + var res = new(generated.GroupHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.GroupHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNGroupHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInput(ctx context.Context, v interface{}) (*generated.GroupHistoryWhereInput, error) { + res, err := ec.unmarshalInputGroupHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupMembership2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx context.Context, sel ast.SelectionSet, v generated.GroupMembership) graphql.Marshaler { + return ec._GroupMembership(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx context.Context, sel ast.SelectionSet, v *generated.GroupMembership) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupMembership(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupMembershipBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v GroupMembershipBulkCreatePayload) graphql.Marshaler { + return ec._GroupMembershipBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupMembershipBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupMembershipBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupMembershipBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupMembershipConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipConnection(ctx context.Context, sel ast.SelectionSet, v generated.GroupMembershipConnection) graphql.Marshaler { + return ec._GroupMembershipConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupMembershipConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipConnection(ctx context.Context, sel ast.SelectionSet, v *generated.GroupMembershipConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupMembershipConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupMembershipCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipCreatePayload(ctx context.Context, sel ast.SelectionSet, v GroupMembershipCreatePayload) graphql.Marshaler { + return ec._GroupMembershipCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupMembershipCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipCreatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupMembershipCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupMembershipCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupMembershipDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipDeletePayload(ctx context.Context, sel ast.SelectionSet, v GroupMembershipDeletePayload) graphql.Marshaler { + return ec._GroupMembershipDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupMembershipDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipDeletePayload(ctx context.Context, sel ast.SelectionSet, v *GroupMembershipDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupMembershipDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupMembershipHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.GroupMembershipHistoryConnection) graphql.Marshaler { + return ec._GroupMembershipHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupMembershipHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.GroupMembershipHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupMembershipHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGroupMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNGroupMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNGroupMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInput(ctx context.Context, v interface{}) (*generated.GroupMembershipHistoryWhereInput, error) { + res, err := ec.unmarshalInputGroupMembershipHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNGroupMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNGroupMembershipUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipUpdatePayload(ctx context.Context, sel ast.SelectionSet, v GroupMembershipUpdatePayload) graphql.Marshaler { + return ec._GroupMembershipUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupMembershipUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupMembershipUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupMembershipUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupMembershipUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGroupMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInput(ctx context.Context, v interface{}) (*generated.GroupMembershipWhereInput, error) { + res, err := ec.unmarshalInputGroupMembershipWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNGroupOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupOrderField(ctx context.Context, v interface{}) (*generated.GroupOrderField, error) { + var res = new(generated.GroupOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.GroupOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNGroupSetting2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx context.Context, sel ast.SelectionSet, v generated.GroupSetting) graphql.Marshaler { + return ec._GroupSetting(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx context.Context, sel ast.SelectionSet, v *generated.GroupSetting) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupSetting(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupSettingBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v GroupSettingBulkCreatePayload) graphql.Marshaler { + return ec._GroupSettingBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupSettingBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupSettingBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupSettingConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingConnection(ctx context.Context, sel ast.SelectionSet, v generated.GroupSettingConnection) graphql.Marshaler { + return ec._GroupSettingConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupSettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingConnection(ctx context.Context, sel ast.SelectionSet, v *generated.GroupSettingConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupSettingConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupSettingCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v GroupSettingCreatePayload) graphql.Marshaler { + return ec._GroupSettingCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupSettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupSettingCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupSettingCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupSettingDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingDeletePayload(ctx context.Context, sel ast.SelectionSet, v GroupSettingDeletePayload) graphql.Marshaler { + return ec._GroupSettingDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupSettingDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingDeletePayload(ctx context.Context, sel ast.SelectionSet, v *GroupSettingDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupSettingDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNGroupSettingHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.GroupSettingHistoryConnection) graphql.Marshaler { + return ec._GroupSettingHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupSettingHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.GroupSettingHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupSettingHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGroupSettingHistoryJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, v interface{}) (enums.JoinPolicy, error) { + var res enums.JoinPolicy + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupSettingHistoryJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, sel ast.SelectionSet, v enums.JoinPolicy) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNGroupSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNGroupSettingHistoryVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, v interface{}) (enums.Visibility, error) { + var res enums.Visibility + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupSettingHistoryVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, sel ast.SelectionSet, v enums.Visibility) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNGroupSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInput(ctx context.Context, v interface{}) (*generated.GroupSettingHistoryWhereInput, error) { + res, err := ec.unmarshalInputGroupSettingHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNGroupSettingJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, v interface{}) (enums.JoinPolicy, error) { + var res enums.JoinPolicy + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupSettingJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, sel ast.SelectionSet, v enums.JoinPolicy) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNGroupSettingUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v GroupSettingUpdatePayload) graphql.Marshaler { + return ec._GroupSettingUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupSettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupSettingUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupSettingUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGroupSettingVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, v interface{}) (enums.Visibility, error) { + var res enums.Visibility + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupSettingVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, sel ast.SelectionSet, v enums.Visibility) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNGroupSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInput(ctx context.Context, v interface{}) (*generated.GroupSettingWhereInput, error) { + res, err := ec.unmarshalInputGroupSettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNGroupUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupUpdatePayload(ctx context.Context, sel ast.SelectionSet, v GroupUpdatePayload) graphql.Marshaler { + return ec._GroupUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNGroupUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGroupUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *GroupUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._GroupUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGroupWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInput(ctx context.Context, v interface{}) (*generated.GroupWhereInput, error) { + res, err := ec.unmarshalInputGroupWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNHush2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx context.Context, sel ast.SelectionSet, v generated.Hush) graphql.Marshaler { + return ec._Hush(ctx, sel, &v) +} + +func (ec *executionContext) marshalNHush2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx context.Context, sel ast.SelectionSet, v *generated.Hush) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Hush(ctx, sel, v) +} + +func (ec *executionContext) marshalNHushBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v HushBulkCreatePayload) graphql.Marshaler { + return ec._HushBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNHushBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *HushBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._HushBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNHushConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushConnection(ctx context.Context, sel ast.SelectionSet, v generated.HushConnection) graphql.Marshaler { + return ec._HushConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNHushConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushConnection(ctx context.Context, sel ast.SelectionSet, v *generated.HushConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._HushConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNHushCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushCreatePayload(ctx context.Context, sel ast.SelectionSet, v HushCreatePayload) graphql.Marshaler { + return ec._HushCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNHushCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushCreatePayload(ctx context.Context, sel ast.SelectionSet, v *HushCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._HushCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNHushDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushDeletePayload(ctx context.Context, sel ast.SelectionSet, v HushDeletePayload) graphql.Marshaler { + return ec._HushDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNHushDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushDeletePayload(ctx context.Context, sel ast.SelectionSet, v *HushDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._HushDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNHushHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.HushHistoryConnection) graphql.Marshaler { + return ec._HushHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNHushHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.HushHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._HushHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNHushHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNHushHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNHushHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryOrderField(ctx context.Context, v interface{}) (*generated.HushHistoryOrderField, error) { + var res = new(generated.HushHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNHushHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.HushHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNHushHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInput(ctx context.Context, v interface{}) (*generated.HushHistoryWhereInput, error) { + res, err := ec.unmarshalInputHushHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNHushOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushOrderField(ctx context.Context, v interface{}) (*generated.HushOrderField, error) { + var res = new(generated.HushOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNHushOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.HushOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNHushUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushUpdatePayload(ctx context.Context, sel ast.SelectionSet, v HushUpdatePayload) graphql.Marshaler { + return ec._HushUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNHushUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐHushUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *HushUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._HushUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNHushWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInput(ctx context.Context, v interface{}) (*generated.HushWhereInput, error) { + res, err := ec.unmarshalInputHushWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNID2ᚕ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.unmarshalNID2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNID2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNID2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNIntegration2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx context.Context, sel ast.SelectionSet, v generated.Integration) graphql.Marshaler { + return ec._Integration(ctx, sel, &v) +} + +func (ec *executionContext) marshalNIntegration2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx context.Context, sel ast.SelectionSet, v *generated.Integration) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Integration(ctx, sel, v) +} + +func (ec *executionContext) marshalNIntegrationBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v IntegrationBulkCreatePayload) graphql.Marshaler { + return ec._IntegrationBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNIntegrationBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *IntegrationBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._IntegrationBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNIntegrationConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationConnection(ctx context.Context, sel ast.SelectionSet, v generated.IntegrationConnection) graphql.Marshaler { + return ec._IntegrationConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNIntegrationConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationConnection(ctx context.Context, sel ast.SelectionSet, v *generated.IntegrationConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._IntegrationConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNIntegrationCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationCreatePayload(ctx context.Context, sel ast.SelectionSet, v IntegrationCreatePayload) graphql.Marshaler { + return ec._IntegrationCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNIntegrationCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationCreatePayload(ctx context.Context, sel ast.SelectionSet, v *IntegrationCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._IntegrationCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNIntegrationDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationDeletePayload(ctx context.Context, sel ast.SelectionSet, v IntegrationDeletePayload) graphql.Marshaler { + return ec._IntegrationDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNIntegrationDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationDeletePayload(ctx context.Context, sel ast.SelectionSet, v *IntegrationDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._IntegrationDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNIntegrationHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.IntegrationHistoryConnection) graphql.Marshaler { + return ec._IntegrationHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNIntegrationHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.IntegrationHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._IntegrationHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNIntegrationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNIntegrationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNIntegrationHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryOrderField(ctx context.Context, v interface{}) (*generated.IntegrationHistoryOrderField, error) { + var res = new(generated.IntegrationHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNIntegrationHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.IntegrationHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNIntegrationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInput(ctx context.Context, v interface{}) (*generated.IntegrationHistoryWhereInput, error) { + res, err := ec.unmarshalInputIntegrationHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNIntegrationOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationOrderField(ctx context.Context, v interface{}) (*generated.IntegrationOrderField, error) { + var res = new(generated.IntegrationOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNIntegrationOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.IntegrationOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNIntegrationUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationUpdatePayload(ctx context.Context, sel ast.SelectionSet, v IntegrationUpdatePayload) graphql.Marshaler { + return ec._IntegrationUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNIntegrationUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐIntegrationUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *IntegrationUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._IntegrationUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNIntegrationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInput(ctx context.Context, v interface{}) (*generated.IntegrationWhereInput, error) { + res, err := ec.unmarshalInputIntegrationWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInvite2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx context.Context, sel ast.SelectionSet, v generated.Invite) graphql.Marshaler { + return ec._Invite(ctx, sel, &v) +} + +func (ec *executionContext) marshalNInvite2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx context.Context, sel ast.SelectionSet, v *generated.Invite) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Invite(ctx, sel, v) +} + +func (ec *executionContext) marshalNInviteBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v InviteBulkCreatePayload) graphql.Marshaler { + return ec._InviteBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNInviteBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *InviteBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._InviteBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNInviteConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteConnection(ctx context.Context, sel ast.SelectionSet, v generated.InviteConnection) graphql.Marshaler { + return ec._InviteConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNInviteConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteConnection(ctx context.Context, sel ast.SelectionSet, v *generated.InviteConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._InviteConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNInviteCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteCreatePayload(ctx context.Context, sel ast.SelectionSet, v InviteCreatePayload) graphql.Marshaler { + return ec._InviteCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNInviteCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteCreatePayload(ctx context.Context, sel ast.SelectionSet, v *InviteCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._InviteCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNInviteDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteDeletePayload(ctx context.Context, sel ast.SelectionSet, v InviteDeletePayload) graphql.Marshaler { + return ec._InviteDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNInviteDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteDeletePayload(ctx context.Context, sel ast.SelectionSet, v *InviteDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._InviteDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInviteInviteStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx context.Context, v interface{}) (enums.InviteStatus, error) { + var res enums.InviteStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInviteInviteStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx context.Context, sel ast.SelectionSet, v enums.InviteStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNInviteRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInviteRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNInviteUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteUpdatePayload(ctx context.Context, sel ast.SelectionSet, v InviteUpdatePayload) graphql.Marshaler { + return ec._InviteUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNInviteUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐInviteUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *InviteUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._InviteUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInviteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInput(ctx context.Context, v interface{}) (*generated.InviteWhereInput, error) { + res, err := ec.unmarshalInputInviteWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx context.Context, v interface{}) (customtypes.JSONObject, error) { + var res customtypes.JSONObject + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx context.Context, sel ast.SelectionSet, v customtypes.JSONObject) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNNode2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoder(ctx context.Context, sel ast.SelectionSet, v []generated.Noder) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalONode2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoder(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalNNote2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNote(ctx context.Context, sel ast.SelectionSet, v *generated.Note) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Note(ctx, sel, v) +} + +func (ec *executionContext) marshalNNoteConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteConnection(ctx context.Context, sel ast.SelectionSet, v generated.NoteConnection) graphql.Marshaler { + return ec._NoteConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNNoteConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteConnection(ctx context.Context, sel ast.SelectionSet, v *generated.NoteConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._NoteConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNNoteHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.NoteHistoryConnection) graphql.Marshaler { + return ec._NoteHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNNoteHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.NoteHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._NoteHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNNoteHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNNoteHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNNoteHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInput(ctx context.Context, v interface{}) (*generated.NoteHistoryWhereInput, error) { + res, err := ec.unmarshalInputNoteHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNNoteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInput(ctx context.Context, v interface{}) (*generated.NoteWhereInput, error) { + res, err := ec.unmarshalInputNoteWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOauthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx context.Context, sel ast.SelectionSet, v generated.OauthProvider) graphql.Marshaler { + return ec._OauthProvider(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOauthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx context.Context, sel ast.SelectionSet, v *generated.OauthProvider) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OauthProvider(ctx, sel, v) +} + +func (ec *executionContext) marshalNOauthProviderBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v OauthProviderBulkCreatePayload) graphql.Marshaler { + return ec._OauthProviderBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOauthProviderBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OauthProviderBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OauthProviderBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOauthProviderConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderConnection(ctx context.Context, sel ast.SelectionSet, v generated.OauthProviderConnection) graphql.Marshaler { + return ec._OauthProviderConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOauthProviderConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OauthProviderConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OauthProviderConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNOauthProviderCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderCreatePayload(ctx context.Context, sel ast.SelectionSet, v OauthProviderCreatePayload) graphql.Marshaler { + return ec._OauthProviderCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOauthProviderCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OauthProviderCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OauthProviderCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOauthProviderDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderDeletePayload(ctx context.Context, sel ast.SelectionSet, v OauthProviderDeletePayload) graphql.Marshaler { + return ec._OauthProviderDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOauthProviderDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderDeletePayload(ctx context.Context, sel ast.SelectionSet, v *OauthProviderDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OauthProviderDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOauthProviderHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.OauthProviderHistoryConnection) graphql.Marshaler { + return ec._OauthProviderHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOauthProviderHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OauthProviderHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OauthProviderHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOauthProviderHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOauthProviderHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNOauthProviderHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OauthProviderHistoryWhereInput, error) { + res, err := ec.unmarshalInputOauthProviderHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOauthProviderUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderUpdatePayload(ctx context.Context, sel ast.SelectionSet, v OauthProviderUpdatePayload) graphql.Marshaler { + return ec._OauthProviderUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOauthProviderUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOauthProviderUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *OauthProviderUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OauthProviderUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOauthProviderWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInput(ctx context.Context, v interface{}) (*generated.OauthProviderWhereInput, error) { + res, err := ec.unmarshalInputOauthProviderWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOhAuthTooToken2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx context.Context, sel ast.SelectionSet, v generated.OhAuthTooToken) graphql.Marshaler { + return ec._OhAuthTooToken(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOhAuthTooToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx context.Context, sel ast.SelectionSet, v *generated.OhAuthTooToken) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OhAuthTooToken(ctx, sel, v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v OhAuthTooTokenBulkCreatePayload) graphql.Marshaler { + return ec._OhAuthTooTokenBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OhAuthTooTokenBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OhAuthTooTokenBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenConnection(ctx context.Context, sel ast.SelectionSet, v generated.OhAuthTooTokenConnection) graphql.Marshaler { + return ec._OhAuthTooTokenConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OhAuthTooTokenConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OhAuthTooTokenConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenCreatePayload(ctx context.Context, sel ast.SelectionSet, v OhAuthTooTokenCreatePayload) graphql.Marshaler { + return ec._OhAuthTooTokenCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OhAuthTooTokenCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OhAuthTooTokenCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenDeletePayload(ctx context.Context, sel ast.SelectionSet, v OhAuthTooTokenDeletePayload) graphql.Marshaler { + return ec._OhAuthTooTokenDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenDeletePayload(ctx context.Context, sel ast.SelectionSet, v *OhAuthTooTokenDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OhAuthTooTokenDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, v OhAuthTooTokenUpdatePayload) graphql.Marshaler { + return ec._OhAuthTooTokenUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOhAuthTooTokenUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOhAuthTooTokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *OhAuthTooTokenUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OhAuthTooTokenUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOhAuthTooTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInput(ctx context.Context, v interface{}) (*generated.OhAuthTooTokenWhereInput, error) { + res, err := ec.unmarshalInputOhAuthTooTokenWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx context.Context, v interface{}) (entgql.OrderDirection, error) { + var res entgql.OrderDirection + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrderDirection2entgoᚗioᚋcontribᚋentgqlᚐOrderDirection(ctx context.Context, sel ast.SelectionSet, v entgql.OrderDirection) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNOrgMembership2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx context.Context, sel ast.SelectionSet, v generated.OrgMembership) graphql.Marshaler { + return ec._OrgMembership(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrgMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx context.Context, sel ast.SelectionSet, v *generated.OrgMembership) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrgMembership(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrgMembershipBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v OrgMembershipBulkCreatePayload) graphql.Marshaler { + return ec._OrgMembershipBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrgMembershipBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OrgMembershipBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrgMembershipBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrgMembershipConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipConnection(ctx context.Context, sel ast.SelectionSet, v generated.OrgMembershipConnection) graphql.Marshaler { + return ec._OrgMembershipConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrgMembershipConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OrgMembershipConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrgMembershipConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrgMembershipCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipCreatePayload(ctx context.Context, sel ast.SelectionSet, v OrgMembershipCreatePayload) graphql.Marshaler { + return ec._OrgMembershipCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrgMembershipCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OrgMembershipCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrgMembershipCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrgMembershipDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipDeletePayload(ctx context.Context, sel ast.SelectionSet, v OrgMembershipDeletePayload) graphql.Marshaler { + return ec._OrgMembershipDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrgMembershipDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipDeletePayload(ctx context.Context, sel ast.SelectionSet, v *OrgMembershipDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrgMembershipDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrgMembershipHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.OrgMembershipHistoryConnection) graphql.Marshaler { + return ec._OrgMembershipHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrgMembershipHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OrgMembershipHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrgMembershipHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOrgMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrgMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNOrgMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrgMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNOrgMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OrgMembershipHistoryWhereInput, error) { + res, err := ec.unmarshalInputOrgMembershipHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNOrgMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrgMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNOrgMembershipUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipUpdatePayload(ctx context.Context, sel ast.SelectionSet, v OrgMembershipUpdatePayload) graphql.Marshaler { + return ec._OrgMembershipUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrgMembershipUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrgMembershipUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *OrgMembershipUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrgMembershipUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOrgMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInput(ctx context.Context, v interface{}) (*generated.OrgMembershipWhereInput, error) { + res, err := ec.unmarshalInputOrgMembershipWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganization2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx context.Context, sel ast.SelectionSet, v generated.Organization) graphql.Marshaler { + return ec._Organization(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx context.Context, sel ast.SelectionSet, v *generated.Organization) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Organization(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationBulkCreatePayload) graphql.Marshaler { + return ec._OrganizationBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationConnection(ctx context.Context, sel ast.SelectionSet, v generated.OrganizationConnection) graphql.Marshaler { + return ec._OrganizationConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationCreatePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationCreatePayload) graphql.Marshaler { + return ec._OrganizationCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationDeletePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationDeletePayload) graphql.Marshaler { + return ec._OrganizationDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationDeletePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.OrganizationHistoryConnection) graphql.Marshaler { + return ec._OrganizationHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOrganizationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganizationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNOrganizationHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryOrderField(ctx context.Context, v interface{}) (*generated.OrganizationHistoryOrderField, error) { + var res = new(generated.OrganizationHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganizationHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNOrganizationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationHistoryWhereInput, error) { + res, err := ec.unmarshalInputOrganizationHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNOrganizationOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationOrderField(ctx context.Context, v interface{}) (*generated.OrganizationOrderField, error) { + var res = new(generated.OrganizationOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganizationOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNOrganizationSetting2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx context.Context, sel ast.SelectionSet, v generated.OrganizationSetting) graphql.Marshaler { + return ec._OrganizationSetting(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationSetting) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationSetting(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationSettingBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationSettingBulkCreatePayload) graphql.Marshaler { + return ec._OrganizationSettingBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationSettingBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationSettingBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationSettingConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingConnection(ctx context.Context, sel ast.SelectionSet, v generated.OrganizationSettingConnection) graphql.Marshaler { + return ec._OrganizationSettingConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationSettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationSettingConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationSettingConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationSettingCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationSettingCreatePayload) graphql.Marshaler { + return ec._OrganizationSettingCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationSettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationSettingCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationSettingCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationSettingDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingDeletePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationSettingDeletePayload) graphql.Marshaler { + return ec._OrganizationSettingDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationSettingDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingDeletePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationSettingDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationSettingDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNOrganizationSettingHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.OrganizationSettingHistoryConnection) graphql.Marshaler { + return ec._OrganizationSettingHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationSettingHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationSettingHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationSettingHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOrganizationSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganizationSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNOrganizationSettingHistoryRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, v interface{}) (enums.Region, error) { + var res enums.Region + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganizationSettingHistoryRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, sel ast.SelectionSet, v enums.Region) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNOrganizationSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationSettingHistoryWhereInput, error) { + res, err := ec.unmarshalInputOrganizationSettingHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNOrganizationSettingRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, v interface{}) (enums.Region, error) { + var res enums.Region + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganizationSettingRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, sel ast.SelectionSet, v enums.Region) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNOrganizationSettingUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationSettingUpdatePayload) graphql.Marshaler { + return ec._OrganizationSettingUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationSettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationSettingUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationSettingUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOrganizationSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationSettingWhereInput, error) { + res, err := ec.unmarshalInputOrganizationSettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNOrganizationUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationUpdatePayload(ctx context.Context, sel ast.SelectionSet, v OrganizationUpdatePayload) graphql.Marshaler { + return ec._OrganizationUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganizationUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐOrganizationUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *OrganizationUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._OrganizationUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNOrganizationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationWhereInput, error) { + res, err := ec.unmarshalInputOrganizationWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNPageInfo2entgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v entgql.PageInfo[string]) graphql.Marshaler { + return ec._PageInfo(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPageInfo2ᚖentgoᚗioᚋcontribᚋentgqlᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v *entgql.PageInfo[string]) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PageInfo(ctx, sel, v) +} + +func (ec *executionContext) marshalNPersonalAccessToken2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx context.Context, sel ast.SelectionSet, v generated.PersonalAccessToken) graphql.Marshaler { + return ec._PersonalAccessToken(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalAccessToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx context.Context, sel ast.SelectionSet, v *generated.PersonalAccessToken) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PersonalAccessToken(ctx, sel, v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v PersonalAccessTokenBulkCreatePayload) graphql.Marshaler { + return ec._PersonalAccessTokenBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *PersonalAccessTokenBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PersonalAccessTokenBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenConnection(ctx context.Context, sel ast.SelectionSet, v generated.PersonalAccessTokenConnection) graphql.Marshaler { + return ec._PersonalAccessTokenConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenConnection(ctx context.Context, sel ast.SelectionSet, v *generated.PersonalAccessTokenConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PersonalAccessTokenConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenCreatePayload(ctx context.Context, sel ast.SelectionSet, v PersonalAccessTokenCreatePayload) graphql.Marshaler { + return ec._PersonalAccessTokenCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenCreatePayload(ctx context.Context, sel ast.SelectionSet, v *PersonalAccessTokenCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PersonalAccessTokenCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenDeletePayload(ctx context.Context, sel ast.SelectionSet, v PersonalAccessTokenDeletePayload) graphql.Marshaler { + return ec._PersonalAccessTokenDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenDeletePayload(ctx context.Context, sel ast.SelectionSet, v *PersonalAccessTokenDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PersonalAccessTokenDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, v PersonalAccessTokenUpdatePayload) graphql.Marshaler { + return ec._PersonalAccessTokenUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNPersonalAccessTokenUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐPersonalAccessTokenUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *PersonalAccessTokenUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._PersonalAccessTokenUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNPersonalAccessTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInput(ctx context.Context, v interface{}) (*generated.PersonalAccessTokenWhereInput, error) { + res, err := ec.unmarshalInputPersonalAccessTokenWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNSubscriber2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx context.Context, sel ast.SelectionSet, v generated.Subscriber) graphql.Marshaler { + return ec._Subscriber(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSubscriber2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx context.Context, sel ast.SelectionSet, v *generated.Subscriber) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Subscriber(ctx, sel, v) +} + +func (ec *executionContext) marshalNSubscriberBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v SubscriberBulkCreatePayload) graphql.Marshaler { + return ec._SubscriberBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSubscriberBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *SubscriberBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._SubscriberBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNSubscriberConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberConnection(ctx context.Context, sel ast.SelectionSet, v generated.SubscriberConnection) graphql.Marshaler { + return ec._SubscriberConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSubscriberConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberConnection(ctx context.Context, sel ast.SelectionSet, v *generated.SubscriberConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._SubscriberConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNSubscriberCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberCreatePayload(ctx context.Context, sel ast.SelectionSet, v SubscriberCreatePayload) graphql.Marshaler { + return ec._SubscriberCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSubscriberCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberCreatePayload(ctx context.Context, sel ast.SelectionSet, v *SubscriberCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._SubscriberCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNSubscriberDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberDeletePayload(ctx context.Context, sel ast.SelectionSet, v SubscriberDeletePayload) graphql.Marshaler { + return ec._SubscriberDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSubscriberDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberDeletePayload(ctx context.Context, sel ast.SelectionSet, v *SubscriberDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._SubscriberDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNSubscriberUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberUpdatePayload(ctx context.Context, sel ast.SelectionSet, v SubscriberUpdatePayload) graphql.Marshaler { + return ec._SubscriberUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSubscriberUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐSubscriberUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *SubscriberUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._SubscriberUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNSubscriberWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInput(ctx context.Context, v interface{}) (*generated.SubscriberWhereInput, error) { + res, err := ec.unmarshalInputSubscriberWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTFASetting2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx context.Context, sel ast.SelectionSet, v generated.TFASetting) graphql.Marshaler { + return ec._TFASetting(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTFASetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx context.Context, sel ast.SelectionSet, v *generated.TFASetting) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TFASetting(ctx, sel, v) +} + +func (ec *executionContext) marshalNTFASettingConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingConnection(ctx context.Context, sel ast.SelectionSet, v generated.TFASettingConnection) graphql.Marshaler { + return ec._TFASettingConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTFASettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingConnection(ctx context.Context, sel ast.SelectionSet, v *generated.TFASettingConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TFASettingConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNTFASettingCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTFASettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v TFASettingCreatePayload) graphql.Marshaler { + return ec._TFASettingCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTFASettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTFASettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v *TFASettingCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TFASettingCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNTFASettingUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTFASettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v TFASettingUpdatePayload) graphql.Marshaler { + return ec._TFASettingUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTFASettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTFASettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *TFASettingUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TFASettingUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNTFASettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInput(ctx context.Context, v interface{}) (*generated.TFASettingWhereInput, error) { + res, err := ec.unmarshalInputTFASettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTemplate2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx context.Context, sel ast.SelectionSet, v generated.Template) graphql.Marshaler { + return ec._Template(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx context.Context, sel ast.SelectionSet, v *generated.Template) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Template(ctx, sel, v) +} + +func (ec *executionContext) marshalNTemplateBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v TemplateBulkCreatePayload) graphql.Marshaler { + return ec._TemplateBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTemplateBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *TemplateBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TemplateBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNTemplateConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateConnection(ctx context.Context, sel ast.SelectionSet, v generated.TemplateConnection) graphql.Marshaler { + return ec._TemplateConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTemplateConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateConnection(ctx context.Context, sel ast.SelectionSet, v *generated.TemplateConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TemplateConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNTemplateCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateCreatePayload(ctx context.Context, sel ast.SelectionSet, v TemplateCreatePayload) graphql.Marshaler { + return ec._TemplateCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTemplateCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateCreatePayload(ctx context.Context, sel ast.SelectionSet, v *TemplateCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TemplateCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNTemplateDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateDeletePayload(ctx context.Context, sel ast.SelectionSet, v TemplateDeletePayload) graphql.Marshaler { + return ec._TemplateDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTemplateDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateDeletePayload(ctx context.Context, sel ast.SelectionSet, v *TemplateDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TemplateDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNTemplateDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, v interface{}) (enums.DocumentType, error) { + var res enums.DocumentType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTemplateDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, sel ast.SelectionSet, v enums.DocumentType) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNTemplateHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.TemplateHistoryConnection) graphql.Marshaler { + return ec._TemplateHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTemplateHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.TemplateHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TemplateHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNTemplateHistoryDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, v interface{}) (enums.DocumentType, error) { + var res enums.DocumentType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTemplateHistoryDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, sel ast.SelectionSet, v enums.DocumentType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNTemplateHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTemplateHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNTemplateHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryOrderField(ctx context.Context, v interface{}) (*generated.TemplateHistoryOrderField, error) { + var res = new(generated.TemplateHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTemplateHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.TemplateHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNTemplateHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInput(ctx context.Context, v interface{}) (*generated.TemplateHistoryWhereInput, error) { + res, err := ec.unmarshalInputTemplateHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNTemplateOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateOrderField(ctx context.Context, v interface{}) (*generated.TemplateOrderField, error) { + var res = new(generated.TemplateOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTemplateOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.TemplateOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNTemplateUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateUpdatePayload(ctx context.Context, sel ast.SelectionSet, v TemplateUpdatePayload) graphql.Marshaler { + return ec._TemplateUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTemplateUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐTemplateUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *TemplateUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TemplateUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNTemplateWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInput(ctx context.Context, v interface{}) (*generated.TemplateWhereInput, error) { + res, err := ec.unmarshalInputTemplateWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { + res, err := graphql.UnmarshalTime(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { + res := graphql.MarshalTime(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNUint2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx context.Context, v interface{}) (customtypes.Uint8, error) { + var res customtypes.Uint8 + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUint2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx context.Context, sel ast.SelectionSet, v customtypes.Uint8) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNUpdateAPITokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateAPITokenInput(ctx context.Context, v interface{}) (generated.UpdateAPITokenInput, error) { + res, err := ec.unmarshalInputUpdateAPITokenInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateContactInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateContactInput(ctx context.Context, v interface{}) (generated.UpdateContactInput, error) { + res, err := ec.unmarshalInputUpdateContactInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateDocumentDataInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateDocumentDataInput(ctx context.Context, v interface{}) (generated.UpdateDocumentDataInput, error) { + res, err := ec.unmarshalInputUpdateDocumentDataInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateEntitlementInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntitlementInput(ctx context.Context, v interface{}) (generated.UpdateEntitlementInput, error) { + res, err := ec.unmarshalInputUpdateEntitlementInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateEntitlementPlanFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntitlementPlanFeatureInput(ctx context.Context, v interface{}) (generated.UpdateEntitlementPlanFeatureInput, error) { + res, err := ec.unmarshalInputUpdateEntitlementPlanFeatureInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateEntitlementPlanInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntitlementPlanInput(ctx context.Context, v interface{}) (generated.UpdateEntitlementPlanInput, error) { + res, err := ec.unmarshalInputUpdateEntitlementPlanInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateEntityInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntityInput(ctx context.Context, v interface{}) (generated.UpdateEntityInput, error) { + res, err := ec.unmarshalInputUpdateEntityInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateEntityTypeInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEntityTypeInput(ctx context.Context, v interface{}) (generated.UpdateEntityTypeInput, error) { + res, err := ec.unmarshalInputUpdateEntityTypeInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateEventInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateEventInput(ctx context.Context, v interface{}) (generated.UpdateEventInput, error) { + res, err := ec.unmarshalInputUpdateEventInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateFeatureInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateFeatureInput(ctx context.Context, v interface{}) (generated.UpdateFeatureInput, error) { + res, err := ec.unmarshalInputUpdateFeatureInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateFileInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateFileInput(ctx context.Context, v interface{}) (generated.UpdateFileInput, error) { + res, err := ec.unmarshalInputUpdateFileInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateGroupInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupInput(ctx context.Context, v interface{}) (generated.UpdateGroupInput, error) { + res, err := ec.unmarshalInputUpdateGroupInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateGroupMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupMembershipInput(ctx context.Context, v interface{}) (generated.UpdateGroupMembershipInput, error) { + res, err := ec.unmarshalInputUpdateGroupMembershipInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateGroupSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupSettingInput(ctx context.Context, v interface{}) (generated.UpdateGroupSettingInput, error) { + res, err := ec.unmarshalInputUpdateGroupSettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateHushInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateHushInput(ctx context.Context, v interface{}) (generated.UpdateHushInput, error) { + res, err := ec.unmarshalInputUpdateHushInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateIntegrationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateIntegrationInput(ctx context.Context, v interface{}) (generated.UpdateIntegrationInput, error) { + res, err := ec.unmarshalInputUpdateIntegrationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateInviteInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateInviteInput(ctx context.Context, v interface{}) (generated.UpdateInviteInput, error) { + res, err := ec.unmarshalInputUpdateInviteInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateOauthProviderInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOauthProviderInput(ctx context.Context, v interface{}) (generated.UpdateOauthProviderInput, error) { + res, err := ec.unmarshalInputUpdateOauthProviderInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateOhAuthTooTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOhAuthTooTokenInput(ctx context.Context, v interface{}) (generated.UpdateOhAuthTooTokenInput, error) { + res, err := ec.unmarshalInputUpdateOhAuthTooTokenInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateOrgMembershipInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrgMembershipInput(ctx context.Context, v interface{}) (generated.UpdateOrgMembershipInput, error) { + res, err := ec.unmarshalInputUpdateOrgMembershipInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateOrganizationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrganizationInput(ctx context.Context, v interface{}) (generated.UpdateOrganizationInput, error) { + res, err := ec.unmarshalInputUpdateOrganizationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateOrganizationSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrganizationSettingInput(ctx context.Context, v interface{}) (generated.UpdateOrganizationSettingInput, error) { + res, err := ec.unmarshalInputUpdateOrganizationSettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdatePersonalAccessTokenInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdatePersonalAccessTokenInput(ctx context.Context, v interface{}) (generated.UpdatePersonalAccessTokenInput, error) { + res, err := ec.unmarshalInputUpdatePersonalAccessTokenInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateSubscriberInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateSubscriberInput(ctx context.Context, v interface{}) (generated.UpdateSubscriberInput, error) { + res, err := ec.unmarshalInputUpdateSubscriberInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateTFASettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateTFASettingInput(ctx context.Context, v interface{}) (generated.UpdateTFASettingInput, error) { + res, err := ec.unmarshalInputUpdateTFASettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateTemplateInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateTemplateInput(ctx context.Context, v interface{}) (generated.UpdateTemplateInput, error) { + res, err := ec.unmarshalInputUpdateTemplateInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateUserInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateUserInput(ctx context.Context, v interface{}) (generated.UpdateUserInput, error) { + res, err := ec.unmarshalInputUpdateUserInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateUserSettingInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateUserSettingInput(ctx context.Context, v interface{}) (generated.UpdateUserSettingInput, error) { + res, err := ec.unmarshalInputUpdateUserSettingInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpdateWebhookInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateWebhookInput(ctx context.Context, v interface{}) (generated.UpdateWebhookInput, error) { + res, err := ec.unmarshalInputUpdateWebhookInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v interface{}) (graphql.Upload, error) { + res, err := graphql.UnmarshalUpload(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, sel ast.SelectionSet, v graphql.Upload) graphql.Marshaler { + res := graphql.MarshalUpload(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNUser2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx context.Context, sel ast.SelectionSet, v generated.User) graphql.Marshaler { + return ec._User(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx context.Context, sel ast.SelectionSet, v *generated.User) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._User(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNUserAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, v interface{}) (enums.AuthProvider, error) { + var res enums.AuthProvider + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, sel ast.SelectionSet, v enums.AuthProvider) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNUserConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserConnection(ctx context.Context, sel ast.SelectionSet, v generated.UserConnection) graphql.Marshaler { + return ec._UserConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserConnection(ctx context.Context, sel ast.SelectionSet, v *generated.UserConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNUserCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserCreatePayload(ctx context.Context, sel ast.SelectionSet, v UserCreatePayload) graphql.Marshaler { + return ec._UserCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserCreatePayload(ctx context.Context, sel ast.SelectionSet, v *UserCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNUserDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserDeletePayload(ctx context.Context, sel ast.SelectionSet, v UserDeletePayload) graphql.Marshaler { + return ec._UserDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserDeletePayload(ctx context.Context, sel ast.SelectionSet, v *UserDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNUserHistoryAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, v interface{}) (enums.AuthProvider, error) { + var res enums.AuthProvider + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserHistoryAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, sel ast.SelectionSet, v enums.AuthProvider) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNUserHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.UserHistoryConnection) graphql.Marshaler { + return ec._UserHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.UserHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNUserHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNUserHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryOrderField(ctx context.Context, v interface{}) (*generated.UserHistoryOrderField, error) { + var res = new(generated.UserHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.UserHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNUserHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNUserHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInput(ctx context.Context, v interface{}) (*generated.UserHistoryWhereInput, error) { + res, err := ec.unmarshalInputUserHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNUserOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserOrderField(ctx context.Context, v interface{}) (*generated.UserOrderField, error) { + var res = new(generated.UserOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.UserOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNUserRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNUserSetting2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx context.Context, sel ast.SelectionSet, v generated.UserSetting) graphql.Marshaler { + return ec._UserSetting(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx context.Context, sel ast.SelectionSet, v *generated.UserSetting) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserSetting(ctx, sel, v) +} + +func (ec *executionContext) marshalNUserSettingBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v UserSettingBulkCreatePayload) graphql.Marshaler { + return ec._UserSettingBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserSettingBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *UserSettingBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserSettingBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNUserSettingConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingConnection(ctx context.Context, sel ast.SelectionSet, v generated.UserSettingConnection) graphql.Marshaler { + return ec._UserSettingConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserSettingConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingConnection(ctx context.Context, sel ast.SelectionSet, v *generated.UserSettingConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserSettingConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNUserSettingCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v UserSettingCreatePayload) graphql.Marshaler { + return ec._UserSettingCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserSettingCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingCreatePayload(ctx context.Context, sel ast.SelectionSet, v *UserSettingCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserSettingCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNUserSettingHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.UserSettingHistoryConnection) graphql.Marshaler { + return ec._UserSettingHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserSettingHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.UserSettingHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserSettingHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNUserSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNUserSettingHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (enums.UserStatus, error) { + var res enums.UserStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserSettingHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v enums.UserStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNUserSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInput(ctx context.Context, v interface{}) (*generated.UserSettingHistoryWhereInput, error) { + res, err := ec.unmarshalInputUserSettingHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserSettingUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v UserSettingUpdatePayload) graphql.Marshaler { + return ec._UserSettingUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserSettingUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserSettingUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *UserSettingUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserSettingUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNUserSettingUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (enums.UserStatus, error) { + var res enums.UserStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserSettingUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v enums.UserStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNUserSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInput(ctx context.Context, v interface{}) (*generated.UserSettingWhereInput, error) { + res, err := ec.unmarshalInputUserSettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNUserUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserUpdatePayload(ctx context.Context, sel ast.SelectionSet, v UserUpdatePayload) graphql.Marshaler { + return ec._UserUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUserUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐUserUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *UserUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._UserUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNUserWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInput(ctx context.Context, v interface{}) (*generated.UserWhereInput, error) { + res, err := ec.unmarshalInputUserWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNWebhook2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx context.Context, sel ast.SelectionSet, v generated.Webhook) graphql.Marshaler { + return ec._Webhook(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWebhook2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx context.Context, sel ast.SelectionSet, v *generated.Webhook) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Webhook(ctx, sel, v) +} + +func (ec *executionContext) marshalNWebhookBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v WebhookBulkCreatePayload) graphql.Marshaler { + return ec._WebhookBulkCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWebhookBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *WebhookBulkCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._WebhookBulkCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNWebhookConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookConnection(ctx context.Context, sel ast.SelectionSet, v generated.WebhookConnection) graphql.Marshaler { + return ec._WebhookConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWebhookConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookConnection(ctx context.Context, sel ast.SelectionSet, v *generated.WebhookConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._WebhookConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalNWebhookCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookCreatePayload(ctx context.Context, sel ast.SelectionSet, v WebhookCreatePayload) graphql.Marshaler { + return ec._WebhookCreatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWebhookCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookCreatePayload(ctx context.Context, sel ast.SelectionSet, v *WebhookCreatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._WebhookCreatePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNWebhookDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookDeletePayload(ctx context.Context, sel ast.SelectionSet, v WebhookDeletePayload) graphql.Marshaler { + return ec._WebhookDeletePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWebhookDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookDeletePayload(ctx context.Context, sel ast.SelectionSet, v *WebhookDeletePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._WebhookDeletePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNWebhookHistoryConnection2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryConnection(ctx context.Context, sel ast.SelectionSet, v generated.WebhookHistoryConnection) graphql.Marshaler { + return ec._WebhookHistoryConnection(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWebhookHistoryConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryConnection(ctx context.Context, sel ast.SelectionSet, v *generated.WebhookHistoryConnection) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._WebhookHistoryConnection(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNWebhookHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (history.OpType, error) { + var res history.OpType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNWebhookHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v history.OpType) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNWebhookHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryOrderField(ctx context.Context, v interface{}) (*generated.WebhookHistoryOrderField, error) { + var res = new(generated.WebhookHistoryOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNWebhookHistoryOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.WebhookHistoryOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalNWebhookHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInput(ctx context.Context, v interface{}) (*generated.WebhookHistoryWhereInput, error) { + res, err := ec.unmarshalInputWebhookHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNWebhookOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookOrderField(ctx context.Context, v interface{}) (*generated.WebhookOrderField, error) { + var res = new(generated.WebhookOrderField) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNWebhookOrderField2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookOrderField(ctx context.Context, sel ast.SelectionSet, v *generated.WebhookOrderField) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalNWebhookUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookUpdatePayload(ctx context.Context, sel ast.SelectionSet, v WebhookUpdatePayload) graphql.Marshaler { + return ec._WebhookUpdatePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNWebhookUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐWebhookUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *WebhookUpdatePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._WebhookUpdatePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNWebhookWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInput(ctx context.Context, v interface{}) (*generated.WebhookWhereInput, error) { + res, err := ec.unmarshalInputWebhookWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕ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.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalOAPIToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.APIToken) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNAPIToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOAPIToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPIToken(ctx context.Context, sel ast.SelectionSet, v *generated.APIToken) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._APIToken(ctx, sel, v) +} + +func (ec *executionContext) marshalOAPITokenEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.APITokenEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOAPITokenEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOAPITokenEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenEdge(ctx context.Context, sel ast.SelectionSet, v *generated.APITokenEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._APITokenEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOAPITokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.APITokenWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.APITokenWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNAPITokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOAPITokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐAPITokenWhereInput(ctx context.Context, v interface{}) (*generated.APITokenWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputAPITokenWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOAuditLog2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLog(ctx context.Context, sel ast.SelectionSet, v *AuditLog) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._AuditLog(ctx, sel, v) +} + +func (ec *executionContext) marshalOAuditLogEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogEdge(ctx context.Context, sel ast.SelectionSet, v []*AuditLogEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOAuditLogEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOAuditLogEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogEdge(ctx context.Context, sel ast.SelectionSet, v *AuditLogEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._AuditLogEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOAuditLogWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐAuditLogWhereInput(ctx context.Context, v interface{}) (*AuditLogWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputAuditLogWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) marshalOContact2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Contact) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNContact2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOContact2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContact(ctx context.Context, sel ast.SelectionSet, v *generated.Contact) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Contact(ctx, sel, v) +} + +func (ec *executionContext) marshalOContactEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.ContactEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOContactEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOContactEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactEdge(ctx context.Context, sel ast.SelectionSet, v *generated.ContactEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ContactEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOContactHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistory(ctx context.Context, sel ast.SelectionSet, v *generated.ContactHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ContactHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOContactHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.ContactHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOContactHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOContactHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.ContactHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ContactHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOContactHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNContactHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOContactHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNContactHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOContactHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOContactHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOContactHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, v interface{}) ([]enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.UserStatus, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNContactHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOContactHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNContactHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOContactHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (*enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var res = new(enums.UserStatus) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOContactHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v *enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOContactHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.ContactHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.ContactHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNContactHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOContactHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactHistoryWhereInput(ctx context.Context, v interface{}) (*generated.ContactHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputContactHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOContactUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, v interface{}) ([]enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.UserStatus, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNContactUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOContactUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNContactUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOContactUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (*enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var res = new(enums.UserStatus) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOContactUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v *enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOContactWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.ContactWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.ContactWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNContactWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOContactWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐContactWhereInput(ctx context.Context, v interface{}) (*generated.ContactWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputContactWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOCreateAPITokenInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateAPITokenInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateAPITokenInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateAPITokenInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateAPITokenInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateAPITokenInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateContactInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateContactInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateContactInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateContactInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateContactInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateContactInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateDocumentDataInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateDocumentDataInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateDocumentDataInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateDocumentDataInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateDocumentDataInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateDocumentDataInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateEntitlementInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateEntitlementInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateEntitlementInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateEntitlementInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateEntitlementPlanFeatureInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanFeatureInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateEntitlementPlanFeatureInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateEntitlementPlanFeatureInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateEntitlementPlanFeatureInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanFeatureInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateEntitlementPlanInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateEntitlementPlanInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateEntitlementPlanInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateEntitlementPlanInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntitlementPlanInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateEntityInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateEntityInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateEntityInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateEntityInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateEntityTypeInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityTypeInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateEntityTypeInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateEntityTypeInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateEntityTypeInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEntityTypeInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateEventInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEventInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateEventInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateEventInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateEventInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateEventInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateFeatureInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFeatureInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateFeatureInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateFeatureInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateFeatureInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFeatureInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateFileInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFileInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateFileInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateFileInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateFileInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateFileInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateGroupInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateGroupInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateGroupInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateGroupInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateGroupMembershipInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupMembershipInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateGroupMembershipInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateGroupMembershipInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateGroupMembershipInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupMembershipInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateGroupSettingInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateGroupSettingInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateGroupSettingInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateGroupSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateGroupSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateGroupSettingInput(ctx context.Context, v interface{}) (*generated.CreateGroupSettingInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputCreateGroupSettingInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOCreateHushInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateHushInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateHushInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateHushInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateHushInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateHushInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateIntegrationInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateIntegrationInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateIntegrationInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateIntegrationInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateIntegrationInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateIntegrationInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateInviteInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateInviteInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateInviteInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateInviteInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateInviteInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateInviteInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateNoteInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateNoteInput(ctx context.Context, v interface{}) (*generated.CreateNoteInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputCreateNoteInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOCreateOauthProviderInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOauthProviderInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateOauthProviderInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateOauthProviderInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateOauthProviderInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOauthProviderInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateOhAuthTooTokenInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOhAuthTooTokenInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateOhAuthTooTokenInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateOhAuthTooTokenInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateOhAuthTooTokenInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOhAuthTooTokenInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateOrgMembershipInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgMembershipInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateOrgMembershipInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateOrgMembershipInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateOrgMembershipInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgMembershipInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateOrganizationInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateOrganizationInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateOrganizationInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateOrganizationInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateOrganizationSettingInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateOrganizationSettingInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateOrganizationSettingInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateOrganizationSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateOrganizationSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationSettingInput(ctx context.Context, v interface{}) (*generated.CreateOrganizationSettingInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputCreateOrganizationSettingInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOCreatePersonalAccessTokenInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreatePersonalAccessTokenInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreatePersonalAccessTokenInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreatePersonalAccessTokenInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreatePersonalAccessTokenInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreatePersonalAccessTokenInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateSubscriberInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateSubscriberInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateSubscriberInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateSubscriberInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateSubscriberInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateSubscriberInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateTemplateInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTemplateInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateTemplateInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateTemplateInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateTemplateInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateTemplateInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateUserSettingInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserSettingInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateUserSettingInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateUserSettingInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateUserSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateUserSettingInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCreateWebhookInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateWebhookInputᚄ(ctx context.Context, v interface{}) ([]*generated.CreateWebhookInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.CreateWebhookInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCreateWebhookInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateWebhookInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, v interface{}) (*entgql.Cursor[string], error) { + if v == nil { + return nil, nil + } + var res = new(entgql.Cursor[string]) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOCursor2ᚖentgoᚗioᚋcontribᚋentgqlᚐCursor(ctx context.Context, sel ast.SelectionSet, v *entgql.Cursor[string]) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalODocumentData2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.DocumentData) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDocumentData2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalODocumentData2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentData(ctx context.Context, sel ast.SelectionSet, v *generated.DocumentData) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DocumentData(ctx, sel, v) +} + +func (ec *executionContext) marshalODocumentDataEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.DocumentDataEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalODocumentDataEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalODocumentDataEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataEdge(ctx context.Context, sel ast.SelectionSet, v *generated.DocumentDataEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DocumentDataEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalODocumentDataHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistory(ctx context.Context, sel ast.SelectionSet, v *generated.DocumentDataHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DocumentDataHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalODocumentDataHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.DocumentDataHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalODocumentDataHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalODocumentDataHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.DocumentDataHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DocumentDataHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalODocumentDataHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNDocumentDataHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalODocumentDataHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDocumentDataHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalODocumentDataHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalODocumentDataHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalODocumentDataHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.DocumentDataHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.DocumentDataHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNDocumentDataHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalODocumentDataHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataHistoryWhereInput(ctx context.Context, v interface{}) (*generated.DocumentDataHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDocumentDataHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalODocumentDataWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.DocumentDataWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.DocumentDataWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNDocumentDataWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalODocumentDataWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐDocumentDataWhereInput(ctx context.Context, v interface{}) (*generated.DocumentDataWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDocumentDataWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntitlement2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Entitlement) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntitlement2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOEntitlement2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlement(ctx context.Context, sel ast.SelectionSet, v *generated.Entitlement) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Entitlement(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntitlementEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntitlementEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistory(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntitlementHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntitlementHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOEntitlementHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOEntitlementHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntitlementHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOEntitlementHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntitlementHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOEntitlementHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntitlementHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntitlementHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntitlementHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntitlementHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntitlementPlan2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementPlan) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOEntitlementPlan2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlan(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlan) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlan(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementPlanEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementPlanEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntitlementPlanEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntitlementPlanEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlanEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementPlanFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementPlanFeature) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntitlementPlanFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOEntitlementPlanFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeature(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanFeature) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlanFeature(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementPlanFeatureEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementPlanFeatureEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntitlementPlanFeatureEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntitlementPlanFeatureEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanFeatureEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlanFeatureEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementPlanFeatureHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistory(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanFeatureHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlanFeatureHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementPlanFeatureHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementPlanFeatureHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntitlementPlanFeatureHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntitlementPlanFeatureHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanFeatureHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlanFeatureHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOEntitlementPlanFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementPlanFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOEntitlementPlanFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntitlementPlanFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOEntitlementPlanFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntitlementPlanFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOEntitlementPlanFeatureHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntitlementPlanFeatureHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntitlementPlanFeatureHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementPlanFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntitlementPlanFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanFeatureHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntitlementPlanFeatureHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntitlementPlanFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntitlementPlanFeatureWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntitlementPlanFeatureWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementPlanFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntitlementPlanFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanFeatureWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanFeatureWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntitlementPlanFeatureWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntitlementPlanHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistory(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlanHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntitlementPlanHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntitlementPlanHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntitlementPlanHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntitlementPlanHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntitlementPlanHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntitlementPlanHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOEntitlementPlanHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementPlanHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOEntitlementPlanHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntitlementPlanHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOEntitlementPlanHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntitlementPlanHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOEntitlementPlanHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntitlementPlanHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntitlementPlanHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementPlanHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntitlementPlanHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntitlementPlanHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntitlementPlanWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntitlementPlanWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntitlementPlanWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementPlanWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntitlementPlanWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementPlanWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementPlanWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntitlementPlanWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntitlementWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntitlementWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntitlementWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntitlementWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntitlementWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntitlementWhereInput(ctx context.Context, v interface{}) (*generated.EntitlementWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntitlementWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntity2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOEntity2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntity(ctx context.Context, sel ast.SelectionSet, v *generated.Entity) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Entity(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntityEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntityEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntityEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntityEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntityEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntityEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntityHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistory(ctx context.Context, sel ast.SelectionSet, v *generated.EntityHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntityHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntityHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntityHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntityHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntityHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntityHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntityHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOEntityHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntityHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOEntityHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntityHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOEntityHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntityHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOEntityHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryOrder(ctx context.Context, v interface{}) (*generated.EntityHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntityHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntityHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntityHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntityHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntityHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntityHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntityOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityOrder(ctx context.Context, v interface{}) (*generated.EntityOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntityType2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.EntityType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOEntityType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityType(ctx context.Context, sel ast.SelectionSet, v *generated.EntityType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntityType(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntityTypeEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntityTypeEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntityTypeEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntityTypeEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntityTypeEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntityTypeEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntityTypeHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistory(ctx context.Context, sel ast.SelectionSet, v *generated.EntityTypeHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntityTypeHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOEntityTypeHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EntityTypeHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEntityTypeHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEntityTypeHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EntityTypeHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EntityTypeHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOEntityTypeHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntityTypeHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOEntityTypeHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEntityTypeHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOEntityTypeHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEntityTypeHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOEntityTypeHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryOrder(ctx context.Context, v interface{}) (*generated.EntityTypeHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityTypeHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntityTypeHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntityTypeHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntityTypeHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntityTypeHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntityTypeHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EntityTypeHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityTypeHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntityTypeOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeOrder(ctx context.Context, v interface{}) (*generated.EntityTypeOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityTypeOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntityTypeWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntityTypeWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntityTypeWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntityTypeWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntityTypeWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityTypeWhereInput(ctx context.Context, v interface{}) (*generated.EntityTypeWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityTypeWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEntityWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EntityWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EntityWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEntityWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEntityWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEntityWhereInput(ctx context.Context, v interface{}) (*generated.EntityWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEntityWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEvent2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Event) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEvent2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOEvent2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEvent(ctx context.Context, sel ast.SelectionSet, v *generated.Event) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Event(ctx, sel, v) +} + +func (ec *executionContext) marshalOEventEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EventEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEventEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEventEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EventEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EventEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOEventHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistory(ctx context.Context, sel ast.SelectionSet, v *generated.EventHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EventHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOEventHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.EventHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEventHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOEventHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.EventHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._EventHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOEventHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEventHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOEventHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEventHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOEventHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOEventHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOEventHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EventHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EventHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEventHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEventHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventHistoryWhereInput(ctx context.Context, v interface{}) (*generated.EventHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEventHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOEventWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.EventWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.EventWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEventWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEventWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐEventWhereInput(ctx context.Context, v interface{}) (*generated.EventWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputEventWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFeature2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Feature) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOFeature2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeature(ctx context.Context, sel ast.SelectionSet, v *generated.Feature) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Feature(ctx, sel, v) +} + +func (ec *executionContext) marshalOFeatureEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.FeatureEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOFeatureEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOFeatureEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureEdge(ctx context.Context, sel ast.SelectionSet, v *generated.FeatureEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._FeatureEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOFeatureHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistory(ctx context.Context, sel ast.SelectionSet, v *generated.FeatureHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._FeatureHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOFeatureHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.FeatureHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOFeatureHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOFeatureHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.FeatureHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._FeatureHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOFeatureHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNFeatureHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFeatureHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOFeatureHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.FeatureHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.FeatureHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFeatureHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureHistoryWhereInput(ctx context.Context, v interface{}) (*generated.FeatureHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFeatureHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFeatureWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.FeatureWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.FeatureWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFeatureWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFeatureWhereInput(ctx context.Context, v interface{}) (*generated.FeatureWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFeatureWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFile2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.File) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNFile2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOFile2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFile(ctx context.Context, sel ast.SelectionSet, v *generated.File) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._File(ctx, sel, v) +} + +func (ec *executionContext) marshalOFileEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.FileEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOFileEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOFileEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileEdge(ctx context.Context, sel ast.SelectionSet, v *generated.FileEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._FileEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOFileHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistory(ctx context.Context, sel ast.SelectionSet, v *generated.FileHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._FileHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOFileHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.FileHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOFileHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOFileHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.FileHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._FileHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOFileHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFileHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOFileHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNFileHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOFileHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFileHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOFileHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.FileHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.FileHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFileHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFileHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileHistoryWhereInput(ctx context.Context, v interface{}) (*generated.FileHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFileHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFileWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.FileWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.FileWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFileWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFileWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐFileWhereInput(ctx context.Context, v interface{}) (*generated.FileWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFileWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGlobalSearchResultConnection2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚐGlobalSearchResultConnection(ctx context.Context, sel ast.SelectionSet, v *GlobalSearchResultConnection) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GlobalSearchResultConnection(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroup2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Group) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOGroup2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroup(ctx context.Context, sel ast.SelectionSet, v *generated.Group) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Group(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOGroupEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOGroupEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupEdge(ctx context.Context, sel ast.SelectionSet, v *generated.GroupEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistory(ctx context.Context, sel ast.SelectionSet, v *generated.GroupHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOGroupHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOGroupHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.GroupHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGroupHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryOrder(ctx context.Context, v interface{}) (*generated.GroupHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOGroupHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.GroupHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.GroupHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOGroupHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupHistoryWhereInput(ctx context.Context, v interface{}) (*generated.GroupHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupMembership) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOGroupMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembership(ctx context.Context, sel ast.SelectionSet, v *generated.GroupMembership) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupMembership(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupMembershipEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupMembershipEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOGroupMembershipEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOGroupMembershipEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipEdge(ctx context.Context, sel ast.SelectionSet, v *generated.GroupMembershipEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupMembershipEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupMembershipHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistory(ctx context.Context, sel ast.SelectionSet, v *generated.GroupMembershipHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupMembershipHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupMembershipHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupMembershipHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOGroupMembershipHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOGroupMembershipHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.GroupMembershipHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupMembershipHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGroupMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, v interface{}) ([]enums.Role, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Role, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (*enums.Role, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Role) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v *enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupMembershipHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.GroupMembershipHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.GroupMembershipHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOGroupMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipHistoryWhereInput(ctx context.Context, v interface{}) (*generated.GroupMembershipHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupMembershipHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOGroupMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, v interface{}) ([]enums.Role, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Role, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (*enums.Role, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Role) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v *enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.GroupMembershipWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.GroupMembershipWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOGroupMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupMembershipWhereInput(ctx context.Context, v interface{}) (*generated.GroupMembershipWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupMembershipWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOGroupOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupOrder(ctx context.Context, v interface{}) (*generated.GroupOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupSetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupSetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOGroupSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSetting(ctx context.Context, sel ast.SelectionSet, v *generated.GroupSetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupSetting(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupSettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupSettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOGroupSettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOGroupSettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingEdge(ctx context.Context, sel ast.SelectionSet, v *generated.GroupSettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupSettingEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupSettingHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistory(ctx context.Context, sel ast.SelectionSet, v *generated.GroupSettingHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupSettingHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOGroupSettingHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.GroupSettingHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOGroupSettingHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOGroupSettingHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.GroupSettingHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GroupSettingHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx context.Context, v interface{}) ([]enums.JoinPolicy, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.JoinPolicy, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupSettingHistoryJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupSettingHistoryJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.JoinPolicy) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupSettingHistoryJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, v interface{}) (*enums.JoinPolicy, error) { + if v == nil { + return nil, nil + } + var res = new(enums.JoinPolicy) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupSettingHistoryJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, sel ast.SelectionSet, v *enums.JoinPolicy) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx context.Context, v interface{}) ([]enums.Visibility, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Visibility, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupSettingHistoryVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupSettingHistoryVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Visibility) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupSettingHistoryVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, v interface{}) (*enums.Visibility, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Visibility) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupSettingHistoryVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, sel ast.SelectionSet, v *enums.Visibility) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.GroupSettingHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.GroupSettingHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOGroupSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingHistoryWhereInput(ctx context.Context, v interface{}) (*generated.GroupSettingHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupSettingHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOGroupSettingJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx context.Context, v interface{}) ([]enums.JoinPolicy, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.JoinPolicy, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupSettingJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupSettingJoinPolicy2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicyᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.JoinPolicy) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupSettingJoinPolicy2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupSettingJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, v interface{}) (*enums.JoinPolicy, error) { + if v == nil { + return nil, nil + } + var res = new(enums.JoinPolicy) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupSettingJoinPolicy2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐJoinPolicy(ctx context.Context, sel ast.SelectionSet, v *enums.JoinPolicy) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupSettingVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx context.Context, v interface{}) ([]enums.Visibility, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Visibility, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupSettingVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOGroupSettingVisibility2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibilityᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Visibility) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGroupSettingVisibility2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGroupSettingVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, v interface{}) (*enums.Visibility, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Visibility) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGroupSettingVisibility2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐVisibility(ctx context.Context, sel ast.SelectionSet, v *enums.Visibility) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOGroupSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.GroupSettingWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.GroupSettingWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOGroupSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupSettingWhereInput(ctx context.Context, v interface{}) (*generated.GroupSettingWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupSettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOGroupWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.GroupWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.GroupWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGroupWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOGroupWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐGroupWhereInput(ctx context.Context, v interface{}) (*generated.GroupWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGroupWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOHush2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Hush) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNHush2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOHush2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHush(ctx context.Context, sel ast.SelectionSet, v *generated.Hush) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Hush(ctx, sel, v) +} + +func (ec *executionContext) marshalOHushEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.HushEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOHushEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOHushEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushEdge(ctx context.Context, sel ast.SelectionSet, v *generated.HushEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._HushEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOHushHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistory(ctx context.Context, sel ast.SelectionSet, v *generated.HushHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._HushHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOHushHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.HushHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOHushHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOHushHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.HushHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._HushHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOHushHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNHushHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOHushHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNHushHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOHushHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOHushHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOHushHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryOrder(ctx context.Context, v interface{}) (*generated.HushHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputHushHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOHushHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.HushHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.HushHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNHushHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOHushHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushHistoryWhereInput(ctx context.Context, v interface{}) (*generated.HushHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputHushHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOHushOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushOrder(ctx context.Context, v interface{}) (*generated.HushOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputHushOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOHushWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.HushWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.HushWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNHushWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOHushWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐHushWhereInput(ctx context.Context, v interface{}) (*generated.HushWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputHushWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOID2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOID2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + if v == nil { + return nil, nil + } + 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.unmarshalNID2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOID2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNID2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) unmarshalOInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + return res +} + +func (ec *executionContext) unmarshalOInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]int, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInt2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNInt2int(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalInt(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalInt(*v) + return res +} + +func (ec *executionContext) marshalOIntegration2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Integration) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNIntegration2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOIntegration2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegration(ctx context.Context, sel ast.SelectionSet, v *generated.Integration) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Integration(ctx, sel, v) +} + +func (ec *executionContext) marshalOIntegrationEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.IntegrationEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOIntegrationEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOIntegrationEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationEdge(ctx context.Context, sel ast.SelectionSet, v *generated.IntegrationEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._IntegrationEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOIntegrationHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistory(ctx context.Context, sel ast.SelectionSet, v *generated.IntegrationHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._IntegrationHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOIntegrationHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.IntegrationHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOIntegrationHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOIntegrationHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.IntegrationHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._IntegrationHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOIntegrationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNIntegrationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOIntegrationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNIntegrationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOIntegrationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOIntegrationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOIntegrationHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryOrder(ctx context.Context, v interface{}) (*generated.IntegrationHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputIntegrationHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOIntegrationHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.IntegrationHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.IntegrationHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNIntegrationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOIntegrationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationHistoryWhereInput(ctx context.Context, v interface{}) (*generated.IntegrationHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputIntegrationHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOIntegrationOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationOrder(ctx context.Context, v interface{}) (*generated.IntegrationOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputIntegrationOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOIntegrationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.IntegrationWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.IntegrationWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNIntegrationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOIntegrationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐIntegrationWhereInput(ctx context.Context, v interface{}) (*generated.IntegrationWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputIntegrationWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInvite2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Invite) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNInvite2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOInvite2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInvite(ctx context.Context, sel ast.SelectionSet, v *generated.Invite) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Invite(ctx, sel, v) +} + +func (ec *executionContext) marshalOInviteEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.InviteEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOInviteEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOInviteEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteEdge(ctx context.Context, sel ast.SelectionSet, v *generated.InviteEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._InviteEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOInviteInviteStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatusᚄ(ctx context.Context, v interface{}) ([]enums.InviteStatus, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.InviteStatus, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInviteInviteStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInviteInviteStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.InviteStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNInviteInviteStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOInviteInviteStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx context.Context, v interface{}) (*enums.InviteStatus, error) { + if v == nil { + return nil, nil + } + var res = new(enums.InviteStatus) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInviteInviteStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐInviteStatus(ctx context.Context, sel ast.SelectionSet, v *enums.InviteStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOInviteRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, v interface{}) ([]enums.Role, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Role, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInviteRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInviteRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNInviteRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOInviteRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (*enums.Role, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Role) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInviteRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v *enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOInviteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.InviteWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.InviteWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInviteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOInviteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐInviteWhereInput(ctx context.Context, v interface{}) (*generated.InviteWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputInviteWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx context.Context, v interface{}) (customtypes.JSONObject, error) { + if v == nil { + return nil, nil + } + var res customtypes.JSONObject + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOJSON2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐJSONObject(ctx context.Context, sel ast.SelectionSet, v customtypes.JSONObject) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalMap(v) + return res +} + +func (ec *executionContext) marshalONode2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoder(ctx context.Context, sel ast.SelectionSet, v generated.Noder) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Node(ctx, sel, v) +} + +func (ec *executionContext) marshalONote2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Note) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNNote2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNote(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalONote2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNote(ctx context.Context, sel ast.SelectionSet, v *generated.Note) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Note(ctx, sel, v) +} + +func (ec *executionContext) marshalONoteEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.NoteEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalONoteEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalONoteEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteEdge(ctx context.Context, sel ast.SelectionSet, v *generated.NoteEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._NoteEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalONoteHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistory(ctx context.Context, sel ast.SelectionSet, v *generated.NoteHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._NoteHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalONoteHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.NoteHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalONoteHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalONoteHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.NoteHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._NoteHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalONoteHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNNoteHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalONoteHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNNoteHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalONoteHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalONoteHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalONoteHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.NoteHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.NoteHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNNoteHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONoteHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteHistoryWhereInput(ctx context.Context, v interface{}) (*generated.NoteHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNoteHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONoteWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.NoteWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.NoteWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNNoteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONoteWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐNoteWhereInput(ctx context.Context, v interface{}) (*generated.NoteWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNoteWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOauthProvider2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.OauthProvider) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOauthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOOauthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProvider(ctx context.Context, sel ast.SelectionSet, v *generated.OauthProvider) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OauthProvider(ctx, sel, v) +} + +func (ec *executionContext) marshalOOauthProviderEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OauthProviderEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOauthProviderEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOauthProviderEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OauthProviderEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OauthProviderEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOOauthProviderHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistory(ctx context.Context, sel ast.SelectionSet, v *generated.OauthProviderHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OauthProviderHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOOauthProviderHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OauthProviderHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOauthProviderHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOauthProviderHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OauthProviderHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OauthProviderHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOOauthProviderHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOauthProviderHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOauthProviderHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOauthProviderHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOauthProviderHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOauthProviderHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOauthProviderHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OauthProviderHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OauthProviderHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOauthProviderHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOauthProviderHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OauthProviderHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOauthProviderHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOOauthProviderWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OauthProviderWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OauthProviderWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOauthProviderWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOauthProviderWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOauthProviderWhereInput(ctx context.Context, v interface{}) (*generated.OauthProviderWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOauthProviderWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOhAuthTooToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.OhAuthTooToken) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOhAuthTooToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOOhAuthTooToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooToken(ctx context.Context, sel ast.SelectionSet, v *generated.OhAuthTooToken) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OhAuthTooToken(ctx, sel, v) +} + +func (ec *executionContext) marshalOOhAuthTooTokenEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OhAuthTooTokenEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOhAuthTooTokenEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOhAuthTooTokenEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OhAuthTooTokenEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OhAuthTooTokenEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOOhAuthTooTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OhAuthTooTokenWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OhAuthTooTokenWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOhAuthTooTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOhAuthTooTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOhAuthTooTokenWhereInput(ctx context.Context, v interface{}) (*generated.OhAuthTooTokenWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOhAuthTooTokenWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrgMembership2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.OrgMembership) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrgMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOOrgMembership2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembership(ctx context.Context, sel ast.SelectionSet, v *generated.OrgMembership) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrgMembership(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrgMembershipEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OrgMembershipEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOrgMembershipEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOrgMembershipEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OrgMembershipEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrgMembershipEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrgMembershipHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistory(ctx context.Context, sel ast.SelectionSet, v *generated.OrgMembershipHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrgMembershipHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrgMembershipHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OrgMembershipHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOrgMembershipHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOrgMembershipHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OrgMembershipHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrgMembershipHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOOrgMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrgMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOrgMembershipHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrgMembershipHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOrgMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrgMembershipHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOrgMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, v interface{}) ([]enums.Role, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Role, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrgMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOrgMembershipHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrgMembershipHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOrgMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (*enums.Role, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Role) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrgMembershipHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v *enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOrgMembershipHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OrgMembershipHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OrgMembershipHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrgMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOrgMembershipHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OrgMembershipHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrgMembershipHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOOrgMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, v interface{}) ([]enums.Role, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Role, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrgMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOrgMembershipRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrgMembershipRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOrgMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (*enums.Role, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Role) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrgMembershipRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v *enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOrgMembershipWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OrgMembershipWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OrgMembershipWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrgMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOrgMembershipWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgMembershipWhereInput(ctx context.Context, v interface{}) (*generated.OrgMembershipWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrgMembershipWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganization2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Organization) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOOrganization2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganization(ctx context.Context, sel ast.SelectionSet, v *generated.Organization) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Organization(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrganizationEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OrganizationEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOrganizationEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOrganizationEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrganizationEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrganizationHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistory(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrganizationHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrganizationHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OrganizationHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOrganizationHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOrganizationHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrganizationHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOOrganizationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOrganizationHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrganizationHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOrganizationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganizationHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOrganizationHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryOrder(ctx context.Context, v interface{}) (*generated.OrganizationHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrganizationHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOOrganizationHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OrganizationHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OrganizationHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOrganizationHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrganizationHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOOrganizationOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationOrder(ctx context.Context, v interface{}) (*generated.OrganizationOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrganizationOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganizationSetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.OrganizationSetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOOrganizationSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSetting(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationSetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrganizationSetting(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrganizationSettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OrganizationSettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOrganizationSettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOrganizationSettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationSettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrganizationSettingEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrganizationSettingHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistory(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationSettingHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrganizationSettingHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOOrganizationSettingHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.OrganizationSettingHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOOrganizationSettingHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOrganizationSettingHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.OrganizationSettingHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OrganizationSettingHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOOrganizationSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOrganizationSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrganizationSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOrganizationSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganizationSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOrganizationSettingHistoryRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, v interface{}) (enums.Region, error) { + var res enums.Region + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganizationSettingHistoryRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, sel ast.SelectionSet, v enums.Region) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalOOrganizationSettingHistoryRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx context.Context, v interface{}) ([]enums.Region, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Region, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationSettingHistoryRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOrganizationSettingHistoryRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Region) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrganizationSettingHistoryRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOrganizationSettingHistoryRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, v interface{}) (*enums.Region, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Region) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganizationSettingHistoryRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, sel ast.SelectionSet, v *enums.Region) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOrganizationSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OrganizationSettingHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OrganizationSettingHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOrganizationSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingHistoryWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationSettingHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrganizationSettingHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOOrganizationSettingRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, v interface{}) (enums.Region, error) { + var res enums.Region + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganizationSettingRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, sel ast.SelectionSet, v enums.Region) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalOOrganizationSettingRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx context.Context, v interface{}) ([]enums.Region, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Region, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationSettingRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOrganizationSettingRegion2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegionᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Region) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrganizationSettingRegion2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOOrganizationSettingRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, v interface{}) (*enums.Region, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Region) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOrganizationSettingRegion2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRegion(ctx context.Context, sel ast.SelectionSet, v *enums.Region) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOOrganizationSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OrganizationSettingWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OrganizationSettingWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOrganizationSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationSettingWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationSettingWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrganizationSettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOOrganizationWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.OrganizationWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.OrganizationWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNOrganizationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOOrganizationWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrganizationWhereInput(ctx context.Context, v interface{}) (*generated.OrganizationWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOrganizationWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOPersonalAccessToken2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.PersonalAccessToken) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNPersonalAccessToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOPersonalAccessToken2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessToken(ctx context.Context, sel ast.SelectionSet, v *generated.PersonalAccessToken) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PersonalAccessToken(ctx, sel, v) +} + +func (ec *executionContext) marshalOPersonalAccessTokenEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.PersonalAccessTokenEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOPersonalAccessTokenEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOPersonalAccessTokenEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenEdge(ctx context.Context, sel ast.SelectionSet, v *generated.PersonalAccessTokenEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PersonalAccessTokenEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOPersonalAccessTokenWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.PersonalAccessTokenWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.PersonalAccessTokenWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNPersonalAccessTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOPersonalAccessTokenWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐPersonalAccessTokenWhereInput(ctx context.Context, v interface{}) (*generated.PersonalAccessTokenWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputPersonalAccessTokenWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + return res +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + if v == nil { + return nil, nil + } + 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) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + 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) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalOSubscriber2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Subscriber) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNSubscriber2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOSubscriber2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriber(ctx context.Context, sel ast.SelectionSet, v *generated.Subscriber) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Subscriber(ctx, sel, v) +} + +func (ec *executionContext) marshalOSubscriberEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.SubscriberEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOSubscriberEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOSubscriberEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberEdge(ctx context.Context, sel ast.SelectionSet, v *generated.SubscriberEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._SubscriberEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOSubscriberWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.SubscriberWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.SubscriberWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNSubscriberWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOSubscriberWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐSubscriberWhereInput(ctx context.Context, v interface{}) (*generated.SubscriberWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputSubscriberWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTFASetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.TFASetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNTFASetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOTFASetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASetting(ctx context.Context, sel ast.SelectionSet, v *generated.TFASetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._TFASetting(ctx, sel, v) +} + +func (ec *executionContext) marshalOTFASettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.TFASettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOTFASettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOTFASettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingEdge(ctx context.Context, sel ast.SelectionSet, v *generated.TFASettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._TFASettingEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOTFASettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.TFASettingWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.TFASettingWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNTFASettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOTFASettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTFASettingWhereInput(ctx context.Context, v interface{}) (*generated.TFASettingWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputTFASettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTemplate2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Template) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOTemplate2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplate(ctx context.Context, sel ast.SelectionSet, v *generated.Template) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Template(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOTemplateDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx context.Context, v interface{}) ([]enums.DocumentType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.DocumentType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNTemplateDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOTemplateDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.DocumentType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNTemplateDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOTemplateDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, v interface{}) (*enums.DocumentType, error) { + if v == nil { + return nil, nil + } + var res = new(enums.DocumentType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTemplateDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, sel ast.SelectionSet, v *enums.DocumentType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOTemplateEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.TemplateEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOTemplateEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOTemplateEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateEdge(ctx context.Context, sel ast.SelectionSet, v *generated.TemplateEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._TemplateEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOTemplateHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistory(ctx context.Context, sel ast.SelectionSet, v *generated.TemplateHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._TemplateHistory(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOTemplateHistoryDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx context.Context, v interface{}) ([]enums.DocumentType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.DocumentType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNTemplateHistoryDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOTemplateHistoryDocumentType2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.DocumentType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNTemplateHistoryDocumentType2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOTemplateHistoryDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, v interface{}) (*enums.DocumentType, error) { + if v == nil { + return nil, nil + } + var res = new(enums.DocumentType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTemplateHistoryDocumentType2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐDocumentType(ctx context.Context, sel ast.SelectionSet, v *enums.DocumentType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOTemplateHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.TemplateHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOTemplateHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOTemplateHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.TemplateHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._TemplateHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOTemplateHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNTemplateHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOTemplateHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNTemplateHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOTemplateHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTemplateHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOTemplateHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryOrder(ctx context.Context, v interface{}) (*generated.TemplateHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputTemplateHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOTemplateHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.TemplateHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.TemplateHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNTemplateHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOTemplateHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateHistoryWhereInput(ctx context.Context, v interface{}) (*generated.TemplateHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputTemplateHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOTemplateOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateOrder(ctx context.Context, v interface{}) (*generated.TemplateOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputTemplateOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOTemplateWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.TemplateWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.TemplateWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNTemplateWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOTemplateWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐTemplateWhereInput(ctx context.Context, v interface{}) (*generated.TemplateWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputTemplateWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { + res, err := graphql.UnmarshalTime(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { + res := graphql.MarshalTime(v) + return res +} + +func (ec *executionContext) unmarshalOTime2ᚕtimeᚐTimeᚄ(ctx context.Context, v interface{}) ([]time.Time, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]time.Time, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNTime2timeᚐTime(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOTime2ᚕtimeᚐTimeᚄ(ctx context.Context, sel ast.SelectionSet, v []time.Time) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNTime2timeᚐTime(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalTime(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalTime(*v) + return res +} + +func (ec *executionContext) unmarshalOUint2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8ᚄ(ctx context.Context, v interface{}) ([]customtypes.Uint8, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]customtypes.Uint8, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUint2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUint2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8ᚄ(ctx context.Context, sel ast.SelectionSet, v []customtypes.Uint8) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNUint2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx context.Context, v interface{}) (*customtypes.Uint8, error) { + if v == nil { + return nil, nil + } + var res = new(customtypes.Uint8) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUint2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋcustomtypesᚐUint8(ctx context.Context, sel ast.SelectionSet, v *customtypes.Uint8) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOUpdateGroupSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateGroupSettingInput(ctx context.Context, v interface{}) (*generated.UpdateGroupSettingInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUpdateGroupSettingInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOUpdateOrganizationSettingInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrganizationSettingInput(ctx context.Context, v interface{}) (*generated.UpdateOrganizationSettingInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUpdateOrganizationSettingInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUser2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.User) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOUser2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUser(ctx context.Context, sel ast.SelectionSet, v *generated.User) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._User(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOUserAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx context.Context, v interface{}) ([]enums.AuthProvider, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.AuthProvider, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.AuthProvider) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, v interface{}) (*enums.AuthProvider, error) { + if v == nil { + return nil, nil + } + var res = new(enums.AuthProvider) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, sel ast.SelectionSet, v *enums.AuthProvider) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOUserEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.UserEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOUserEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOUserEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserEdge(ctx context.Context, sel ast.SelectionSet, v *generated.UserEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOUserHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistory(ctx context.Context, sel ast.SelectionSet, v *generated.UserHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserHistory(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOUserHistoryAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx context.Context, v interface{}) ([]enums.AuthProvider, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.AuthProvider, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserHistoryAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserHistoryAuthProvider2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProviderᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.AuthProvider) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserHistoryAuthProvider2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserHistoryAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, v interface{}) (*enums.AuthProvider, error) { + if v == nil { + return nil, nil + } + var res = new(enums.AuthProvider) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserHistoryAuthProvider2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐAuthProvider(ctx context.Context, sel ast.SelectionSet, v *enums.AuthProvider) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOUserHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.UserHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOUserHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOUserHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.UserHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOUserHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOUserHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryOrder(ctx context.Context, v interface{}) (*generated.UserHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUserHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOUserHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalOUserHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, v interface{}) ([]enums.Role, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Role, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserHistoryRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserHistoryRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (*enums.Role, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Role) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserHistoryRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v *enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOUserHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.UserHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.UserHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOUserHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserHistoryWhereInput(ctx context.Context, v interface{}) (*generated.UserHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUserHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOUserOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserOrder(ctx context.Context, v interface{}) (*generated.UserOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUserOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOUserRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (enums.Role, error) { + var res enums.Role + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v enums.Role) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalOUserRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, v interface{}) ([]enums.Role, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.Role, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserRole2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserRole2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, v interface{}) (*enums.Role, error) { + if v == nil { + return nil, nil + } + var res = new(enums.Role) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserRole2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐRole(ctx context.Context, sel ast.SelectionSet, v *enums.Role) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) marshalOUserSetting2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.UserSetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOUserSetting2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSetting(ctx context.Context, sel ast.SelectionSet, v *generated.UserSetting) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserSetting(ctx, sel, v) +} + +func (ec *executionContext) marshalOUserSettingEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.UserSettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOUserSettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOUserSettingEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingEdge(ctx context.Context, sel ast.SelectionSet, v *generated.UserSettingEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserSettingEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOUserSettingHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistory(ctx context.Context, sel ast.SelectionSet, v *generated.UserSettingHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserSettingHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOUserSettingHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.UserSettingHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOUserSettingHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOUserSettingHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.UserSettingHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._UserSettingHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOUserSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserSettingHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserSettingHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserSettingHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOUserSettingHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, v interface{}) ([]enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.UserStatus, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserSettingHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserSettingHistoryUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserSettingHistoryUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserSettingHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (*enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var res = new(enums.UserStatus) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserSettingHistoryUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v *enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOUserSettingHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.UserSettingHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.UserSettingHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOUserSettingHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingHistoryWhereInput(ctx context.Context, v interface{}) (*generated.UserSettingHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUserSettingHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOUserSettingUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, v interface{}) ([]enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]enums.UserStatus, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserSettingUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOUserSettingUserStatus2ᚕgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatusᚄ(ctx context.Context, sel ast.SelectionSet, v []enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNUserSettingUserStatus2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOUserSettingUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, v interface{}) (*enums.UserStatus, error) { + if v == nil { + return nil, nil + } + var res = new(enums.UserStatus) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUserSettingUserStatus2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋenumsᚐUserStatus(ctx context.Context, sel ast.SelectionSet, v *enums.UserStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOUserSettingWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.UserSettingWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.UserSettingWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOUserSettingWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserSettingWhereInput(ctx context.Context, v interface{}) (*generated.UserSettingWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUserSettingWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOUserWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.UserWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.UserWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNUserWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOUserWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUserWhereInput(ctx context.Context, v interface{}) (*generated.UserWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputUserWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOWebhook2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookᚄ(ctx context.Context, sel ast.SelectionSet, v []*generated.Webhook) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNWebhook2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOWebhook2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhook(ctx context.Context, sel ast.SelectionSet, v *generated.Webhook) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Webhook(ctx, sel, v) +} + +func (ec *executionContext) marshalOWebhookEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.WebhookEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOWebhookEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOWebhookEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookEdge(ctx context.Context, sel ast.SelectionSet, v *generated.WebhookEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._WebhookEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalOWebhookHistory2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistory(ctx context.Context, sel ast.SelectionSet, v *generated.WebhookHistory) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._WebhookHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalOWebhookHistoryEdge2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryEdge(ctx context.Context, sel ast.SelectionSet, v []*generated.WebhookHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOWebhookHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryEdge(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOWebhookHistoryEdge2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryEdge(ctx context.Context, sel ast.SelectionSet, v *generated.WebhookHistoryEdge) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._WebhookHistoryEdge(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOWebhookHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, v interface{}) ([]history.OpType, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]history.OpType, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNWebhookHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOWebhookHistoryOpType2ᚕgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNWebhookHistoryOpType2githubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOWebhookHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, v interface{}) (*history.OpType, error) { + if v == nil { + return nil, nil + } + var res = new(history.OpType) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOWebhookHistoryOpType2ᚖgithubᚗcomᚋtheopenlaneᚋentxᚋhistoryᚐOpType(ctx context.Context, sel ast.SelectionSet, v *history.OpType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + +func (ec *executionContext) unmarshalOWebhookHistoryOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryOrder(ctx context.Context, v interface{}) (*generated.WebhookHistoryOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputWebhookHistoryOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOWebhookHistoryWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.WebhookHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.WebhookHistoryWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNWebhookHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOWebhookHistoryWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookHistoryWhereInput(ctx context.Context, v interface{}) (*generated.WebhookHistoryWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputWebhookHistoryWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOWebhookOrder2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookOrder(ctx context.Context, v interface{}) (*generated.WebhookOrder, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputWebhookOrder(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOWebhookWhereInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInputᚄ(ctx context.Context, v interface{}) ([]*generated.WebhookWhereInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*generated.WebhookWhereInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNWebhookWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOWebhookWhereInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐWebhookWhereInput(ctx context.Context, v interface{}) (*generated.WebhookWhereInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputWebhookWhereInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/internal/graphapi/generate/generate.go b/internal/graphapi/generate/generate.go new file mode 100644 index 0000000..93efbcd --- /dev/null +++ b/internal/graphapi/generate/generate.go @@ -0,0 +1,30 @@ +// go:build ignore + +package main + +import ( + "fmt" + "os" + + "github.com/99designs/gqlgen/api" + "github.com/99designs/gqlgen/codegen/config" + "github.com/theopenlane/core/pkg/gqlplugin/bulkgen" + + "github.com/theopenlane/core/pkg/gqlplugin/resolvergen" +) + +func main() { + cfg, err := config.LoadConfigFromDefaultLocations() + if err != nil { + fmt.Fprintln(os.Stderr, "failed to load config", err.Error()) + os.Exit(2) + } + + if err := api.Generate(cfg, + api.ReplacePlugin(resolvergen.New()), // replace the resolvergen plugin + api.AddPlugin(bulkgen.New()), // add the bulkgen plugin + ); err != nil { + fmt.Fprintln(os.Stderr, err.Error()) + os.Exit(3) + } +} diff --git a/internal/graphapi/group.resolvers.go b/internal/graphapi/group.resolvers.go new file mode 100644 index 0000000..0d88764 --- /dev/null +++ b/internal/graphapi/group.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateGroup is the resolver for the createGroup field. +func (r *mutationResolver) CreateGroup(ctx context.Context, input generated.CreateGroupInput) (*GroupCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Group.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "group"}, r.logger) + } + + return &GroupCreatePayload{ + Group: res, + }, nil +} + +// CreateBulkGroup is the resolver for the createBulkGroup field. +func (r *mutationResolver) CreateBulkGroup(ctx context.Context, input []*generated.CreateGroupInput) (*GroupBulkCreatePayload, error) { + return r.bulkCreateGroup(ctx, input) +} + +// CreateBulkCSVGroup is the resolver for the createBulkCSVGroup field. +func (r *mutationResolver) CreateBulkCSVGroup(ctx context.Context, input graphql.Upload) (*GroupBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateGroupInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateGroup(ctx, data) +} + +// UpdateGroup is the resolver for the updateGroup field. +func (r *mutationResolver) UpdateGroup(ctx context.Context, id string, input generated.UpdateGroupInput) (*GroupUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Group.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "group"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "group"}, r.logger) + } + + return &GroupUpdatePayload{ + Group: res, + }, nil +} + +// DeleteGroup is the resolver for the deleteGroup field. +func (r *mutationResolver) DeleteGroup(ctx context.Context, id string) (*GroupDeletePayload, error) { + if err := withTransactionalMutation(ctx).Group.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "group"}, r.logger) + } + + if err := generated.GroupEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &GroupDeletePayload{ + DeletedID: id, + }, nil +} + +// Group is the resolver for the group field. +func (r *queryResolver) Group(ctx context.Context, id string) (*generated.Group, error) { + res, err := withTransactionalMutation(ctx).Group.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "group"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/group_test.go b/internal/graphapi/group_test.go new file mode 100644 index 0000000..f6ba941 --- /dev/null +++ b/internal/graphapi/group_test.go @@ -0,0 +1,721 @@ +package graphapi_test + +import ( + "context" + "fmt" + "testing" + + "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *GraphTestSuite) TestQueryGroup() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + group1 := (&GroupBuilder{client: suite.client}).MustNew(reqCtx, t) + + listGroups := []string{fmt.Sprintf("group:%s", group1.ID)} + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expected *ent.Group + errorMsg string + }{ + { + name: "happy path group", + client: suite.client.api, + ctx: reqCtx, + allowed: true, + queryID: group1.ID, + expected: group1, + }, + { + name: "happy path group, using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + queryID: group1.ID, + expected: group1, + }, + { + name: "happy path group, using personal access token", + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + queryID: group1.ID, + expected: group1, + }, + { + name: "no access", + client: suite.client.api, + ctx: reqCtx, + allowed: false, + queryID: group1.ID, + errorMsg: "not authorized", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + // second check won't happen if org does not exist + if tc.errorMsg == "" { + mock_fga.ListTimes(t, suite.client.fga, listGroups, 1) + } + + resp, err := suite.client.api.GetGroupByID(reqCtx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Group) + }) + } + + // delete created org and group + (&GroupCleanup{client: suite.client, ID: group1.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestQueryGroupsByOwner() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org1 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + org2 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, org1.ID) + require.NoError(t, err) + + group1 := (&GroupBuilder{client: suite.client, Owner: org1.ID}).MustNew(reqCtx, t) + group2 := (&GroupBuilder{client: suite.client, Owner: org2.ID}).MustNew(reqCtx, t) + + t.Run("Get Groups By Owner", func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check tuple per org + listGroups := []string{fmt.Sprintf("group:%s", group1.ID)} + + mock_fga.ListAny(t, suite.client.fga, listGroups) + + whereInput := &openlaneclient.GroupWhereInput{ + HasOwnerWith: []*openlaneclient.OrganizationWhereInput{ + { + ID: &org1.ID, + }, + }, + } + + resp, err := suite.client.api.GetGroups(reqCtx, whereInput) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Groups.Edges) + + // make sure 1 group is returned + assert.Equal(t, 1, len(resp.Groups.Edges)) + + group1Found := false + group2Found := false + + for _, o := range resp.Groups.Edges { + if o.Node.ID == group1.ID { + group1Found = true + } else if o.Node.ID == group2.ID { + group2Found = true + } + } + + // group1 should be returned, group 2 should not be returned + if !group1Found || group2Found { + t.Fail() + } + + whereInput = &openlaneclient.GroupWhereInput{ + HasOwnerWith: []*openlaneclient.OrganizationWhereInput{ + { + ID: &org2.ID, + }, + }, + } + + resp, err = suite.client.api.GetGroups(reqCtx, whereInput) + + require.NoError(t, err) + require.Empty(t, resp.Groups.Edges) + }) + + // delete created orgs and groups + reqCtx2, err := auth.NewTestContextWithOrgID(testUser.ID, org2.ID) + require.NoError(t, err) + + (&OrganizationCleanup{client: suite.client, ID: org1.ID}).MustDelete(reqCtx, t) + (&OrganizationCleanup{client: suite.client, ID: org2.ID}).MustDelete(reqCtx2, t) +} + +func (suite *GraphTestSuite) TestQueryGroups() { + t := suite.T() + + // setup user context + reqCtx2, err := userContext() + require.NoError(t, err) + + org1 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx2, t) + org2 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx2, t) + + reqCtx1, err := auth.NewTestContextWithOrgID(testUser.ID, org1.ID) + require.NoError(t, err) + + reqCtx2, err = auth.NewTestContextWithOrgID(testUser.ID, org2.ID) + require.NoError(t, err) + + group1 := (&GroupBuilder{client: suite.client, Owner: org1.ID}).MustNew(reqCtx1, t) + group2 := (&GroupBuilder{client: suite.client, Owner: org2.ID}).MustNew(reqCtx2, t) + group3 := (&GroupBuilder{client: suite.client, Owner: org2.ID}).MustNew(reqCtx2, t) + + t.Run("Get Groups", func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // check org tuples + listGroups := []string{fmt.Sprintf("group:%s", group2.ID), fmt.Sprintf("group:%s", group3.ID)} + + mock_fga.ListTimes(t, suite.client.fga, listGroups, 1) + + resp, err := suite.client.api.GetAllGroups(reqCtx2) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Groups.Edges) + + // make sure two organizations are returned (group 2 and group 3) + assert.Equal(t, 2, len(resp.Groups.Edges)) + + group1Found := false + group2Found := false + group3Found := false + + for _, o := range resp.Groups.Edges { + switch id := o.Node.ID; id { + case group1.ID: + group1Found = true + case group2.ID: + group2Found = true + case group3.ID: + group3Found = true + } + } + + // if one of the groups isn't found, fail the test + if !group2Found || !group3Found { + t.Fail() + } + + // if group 1 (which belongs to an unauthorized org) is found, fail the test + if group1Found { + t.Fail() + } + + // Check user with no relations, gets no groups back + mock_fga.ListAny(t, suite.client.fga, []string{}) + + resp, err = suite.client.api.GetAllGroups(reqCtx2) + + require.NoError(t, err) + require.NotNil(t, resp) + + // make sure no organizations are returned + assert.Equal(t, 0, len(resp.Groups.Edges)) + }) + + // delete created orgs and groups + (&GroupCleanup{client: suite.client, ID: group1.ID}).MustDelete(reqCtx1, t) + (&GroupCleanup{client: suite.client, ID: group2.ID}).MustDelete(reqCtx2, t) + (&GroupCleanup{client: suite.client, ID: group3.ID}).MustDelete(reqCtx2, t) + (&OrganizationCleanup{client: suite.client, ID: org1.ID}).MustDelete(reqCtx1, t) + (&OrganizationCleanup{client: suite.client, ID: org2.ID}).MustDelete(reqCtx2, t) +} + +func (suite *GraphTestSuite) TestMutationCreateGroup() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + otherOwner := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + listObjects := []string{fmt.Sprintf("organization:%s", testOrgID), fmt.Sprintf("organization:%s", testPersonalOrgID)} + + testCases := []struct { + name string + groupName string + description string + displayName string + owner string + settings *openlaneclient.CreateGroupSettingInput + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + list bool + check bool + errorMsg string + }{ + { + name: "happy path group", + groupName: gofakeit.Name(), + displayName: gofakeit.LetterN(50), + description: gofakeit.HipsterSentence(10), + client: suite.client.api, + ctx: reqCtx, + allowed: true, + list: true, + check: true, + }, + { + name: "happy path group using api token", + groupName: gofakeit.Name(), + displayName: gofakeit.LetterN(50), + description: gofakeit.HipsterSentence(10), + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + // TODO (sfunk): look at the authz logic, this one looks slightly different from other objects + // but should be the same + list: false, // no list objects because the api token can only be associated with a single org + check: true, + }, + { + name: "happy path group using personal access token", + groupName: gofakeit.Name(), + displayName: gofakeit.LetterN(50), + owner: testOrgID, + description: gofakeit.HipsterSentence(10), + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + list: true, + check: true, + }, + { + name: "happy path group with settings", + groupName: gofakeit.Name(), + displayName: gofakeit.LetterN(50), + description: gofakeit.HipsterSentence(10), + settings: &openlaneclient.CreateGroupSettingInput{ + JoinPolicy: &enums.JoinPolicyInviteOnly, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + list: true, + check: true, + }, + { + name: "no access to owner", + groupName: gofakeit.Name(), + displayName: gofakeit.LetterN(50), + description: gofakeit.HipsterSentence(10), + owner: otherOwner.ID, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + check: true, + list: true, + errorMsg: "not authorized", + }, + { + name: "happy path group, minimum fields", + groupName: gofakeit.Name(), + client: suite.client.api, + ctx: reqCtx, + allowed: true, + list: true, + check: true, + }, + { + name: "missing name", + errorMsg: "validator failed", + client: suite.client.api, + ctx: reqCtx, + allowed: true, + list: true, + check: true, + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + // clear mocks at end of each test + defer mock_fga.ClearMocks(suite.client.fga) + + tc := tc + input := openlaneclient.CreateGroupInput{ + Name: tc.groupName, + Description: &tc.description, + DisplayName: &tc.displayName, + } + + if tc.owner != "" { + input.OwnerID = &tc.owner + } + + if tc.displayName != "" { + input.DisplayName = &tc.displayName + } + + if tc.settings != nil { + input.CreateGroupSettings = tc.settings + } + + if tc.check { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + // When calls are expected to fail, we won't ever write tuples + if tc.errorMsg == "" { + mock_fga.WriteAny(t, suite.client.fga) + + if tc.list { + mock_fga.ListAny(t, suite.client.fga, listObjects) + } + } + + resp, err := tc.client.CreateGroup(tc.ctx, input) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreateGroup.Group) + + // Make sure provided values match + assert.Equal(t, tc.groupName, resp.CreateGroup.Group.Name) + assert.Equal(t, tc.description, *resp.CreateGroup.Group.Description) + + if tc.displayName != "" { + assert.Equal(t, tc.displayName, resp.CreateGroup.Group.DisplayName) + } else { + // display name defaults to the name if not set + assert.Equal(t, tc.groupName, resp.CreateGroup.Group.DisplayName) + } + + if tc.settings != nil { + assert.Equal(t, resp.CreateGroup.Group.Setting.JoinPolicy, enums.JoinPolicyInviteOnly) + } + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateGroup() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + nameUpdate := gofakeit.Name() + displayNameUpdate := gofakeit.LetterN(40) + descriptionUpdate := gofakeit.HipsterSentence(10) + gravatarURLUpdate := gofakeit.URL() + + group := (&GroupBuilder{client: suite.client}).MustNew(reqCtx, t) + + om := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + + // setup auth for the tests + listObjects := []string{fmt.Sprintf("group:%s", group.ID)} + + testCases := []struct { + name string + allowed bool + updateInput openlaneclient.UpdateGroupInput + expectedRes openlaneclient.UpdateGroup_UpdateGroup_Group + client *openlaneclient.OpenLaneClient + ctx context.Context + list bool + errorMsg string + }{ + { + name: "update name, happy path", + allowed: true, + updateInput: openlaneclient.UpdateGroupInput{ + Name: &nameUpdate, + DisplayName: &displayNameUpdate, + Description: &descriptionUpdate, + }, + client: suite.client.api, + ctx: reqCtx, + list: true, + expectedRes: openlaneclient.UpdateGroup_UpdateGroup_Group{ + ID: group.ID, + Name: nameUpdate, + DisplayName: displayNameUpdate, + Description: &descriptionUpdate, + }, + }, + { + name: "add user as admin using api token", + allowed: true, + updateInput: openlaneclient.UpdateGroupInput{ + AddGroupMembers: []*openlaneclient.CreateGroupMembershipInput{ + { + UserID: om.UserID, + Role: &enums.RoleAdmin, + }, + }, + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + list: true, + expectedRes: openlaneclient.UpdateGroup_UpdateGroup_Group{ + ID: group.ID, + Name: nameUpdate, + DisplayName: displayNameUpdate, + Description: &descriptionUpdate, + Members: []*openlaneclient.UpdateGroup_UpdateGroup_Group_Members{ + { + Role: enums.RoleAdmin, + User: openlaneclient.UpdateGroup_UpdateGroup_Group_Members_User{ + ID: om.UserID, + }, + }, + }, + }, + }, + { + name: "update gravatar, happy path using personal access token", + allowed: true, + updateInput: openlaneclient.UpdateGroupInput{ + LogoURL: &gravatarURLUpdate, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + list: true, + expectedRes: openlaneclient.UpdateGroup_UpdateGroup_Group{ + ID: group.ID, + Name: nameUpdate, + DisplayName: displayNameUpdate, + Description: &descriptionUpdate, + LogoURL: &gravatarURLUpdate, + }, + }, + { + name: "update settings, happy path", + allowed: true, + updateInput: openlaneclient.UpdateGroupInput{ + UpdateGroupSettings: &openlaneclient.UpdateGroupSettingInput{ + JoinPolicy: &enums.JoinPolicyOpen, + }, + }, + client: suite.client.api, + ctx: reqCtx, + list: true, + expectedRes: openlaneclient.UpdateGroup_UpdateGroup_Group{ + ID: group.ID, + Name: nameUpdate, + DisplayName: displayNameUpdate, + Description: &descriptionUpdate, + Setting: openlaneclient.UpdateGroup_UpdateGroup_Group_Setting{ + JoinPolicy: enums.JoinPolicyOpen, + }, + }, + }, + { + name: "no access", + allowed: false, + updateInput: openlaneclient.UpdateGroupInput{ + Name: &nameUpdate, + DisplayName: &displayNameUpdate, + Description: &descriptionUpdate, + }, + client: suite.client.api, + ctx: reqCtx, + list: false, + errorMsg: "not authorized", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + if tc.list { + mock_fga.ListAny(t, suite.client.fga, listObjects) + } + + if tc.updateInput.AddGroupMembers != nil && tc.errorMsg == "" { + mock_fga.WriteAny(t, suite.client.fga) + } + + // update group + resp, err := tc.client.UpdateGroup(tc.ctx, group.ID, tc.updateInput) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateGroup.Group) + + // Make sure provided values match + updatedGroup := resp.GetUpdateGroup().Group + assert.Equal(t, tc.expectedRes.Name, updatedGroup.Name) + assert.Equal(t, tc.expectedRes.DisplayName, updatedGroup.DisplayName) + assert.Equal(t, tc.expectedRes.Description, updatedGroup.Description) + + if tc.updateInput.GravatarLogoURL != nil { + assert.Equal(t, *tc.expectedRes.LogoURL, *updatedGroup.LogoURL) + } + + if tc.updateInput.AddGroupMembers != nil { + // Adding a member to an group will make it 2 users, there is an admin + // assigned to the group automatically + assert.Len(t, updatedGroup.Members, 2) + assert.Equal(t, tc.expectedRes.Members[0].Role, updatedGroup.Members[1].Role) + assert.Equal(t, tc.expectedRes.Members[0].User.ID, updatedGroup.Members[1].User.ID) + } + + if tc.updateInput.UpdateGroupSettings != nil { + assert.Equal(t, updatedGroup.GetSetting().JoinPolicy, enums.JoinPolicyOpen) + } + }) + } + + (&GroupCleanup{client: suite.client, ID: group.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationDeleteGroup() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + group1 := (&GroupBuilder{client: suite.client}).MustNew(reqCtx, t) + group2 := (&GroupBuilder{client: suite.client}).MustNew(reqCtx, t) + group3 := (&GroupBuilder{client: suite.client}).MustNew(reqCtx, t) + + listObjects := []string{ + fmt.Sprintf("group:%s", group1.ID), + fmt.Sprintf("group:%s", group2.ID), + fmt.Sprintf("group:%s", group3.ID), + } + + testCases := []struct { + name string + groupID string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + errorMsg string + }{ + { + name: "delete group, happy path", + client: suite.client.api, + ctx: reqCtx, + allowed: true, + groupID: group1.ID, + }, + { + name: "delete group, happy path using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + groupID: group2.ID, + }, + { + name: "delete group, happy path using personal access token", + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + groupID: group3.ID, + }, + { + name: "delete group, no access", + client: suite.client.api, + ctx: reqCtx, + allowed: false, + groupID: group1.ID, + errorMsg: "not authorized", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // mock read of tuple + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + if tc.allowed { + mock_fga.ReadAny(t, suite.client.fga) + mock_fga.ListAny(t, suite.client.fga, listObjects) + mock_fga.WriteAny(t, suite.client.fga) + } + + // delete group + resp, err := tc.client.DeleteGroup(tc.ctx, tc.groupID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.DeleteGroup.DeletedID) + + // make sure the deletedID matches the ID we wanted to delete + assert.Equal(t, tc.groupID, resp.DeleteGroup.DeletedID) + + o, err := suite.client.api.GetGroupByID(reqCtx, tc.groupID) + + require.Nil(t, o) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + }) + } +} diff --git a/internal/graphapi/groupextended.resolvers.go b/internal/graphapi/groupextended.resolvers.go new file mode 100644 index 0000000..133cf15 --- /dev/null +++ b/internal/graphapi/groupextended.resolvers.go @@ -0,0 +1,88 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateGroupSettings is the resolver for the createGroupSettings field. +func (r *createGroupInputResolver) CreateGroupSettings(ctx context.Context, obj *generated.CreateGroupInput, data *generated.CreateGroupSettingInput) error { + c := withTransactionalMutation(ctx) + + groupSettings, err := c.GroupSetting.Create().SetInput(*data).Save(ctx) + if err != nil { + return err + } + + obj.SettingID = groupSettings.ID + + return nil +} + +// AddGroupMembers is the resolver for the addGroupMembers field. +func (r *updateGroupInputResolver) AddGroupMembers(ctx context.Context, obj *generated.UpdateGroupInput, data []*generated.CreateGroupMembershipInput) error { + opCtx := graphql.GetOperationContext(ctx) + groupID, ok := opCtx.Variables["updateGroupId"] + if !ok { + r.logger.Errorw("unable to get group from context") + + return ErrInternalServerError + } + + c := withTransactionalMutation(ctx) + builders := make([]*generated.GroupMembershipCreate, len(data)) + for i := range data { + input := *data[i] + input.GroupID = groupID.(string) + builders[i] = c.GroupMembership.Create().SetInput(input) + } + + _, err := c.GroupMembership.CreateBulk(builders...).Save(ctx) + if err != nil { + return err + } + + return nil +} + +// UpdateGroupSettings is the resolver for the updateGroupSettings field. +func (r *updateGroupInputResolver) UpdateGroupSettings(ctx context.Context, obj *generated.UpdateGroupInput, data *generated.UpdateGroupSettingInput) error { + opCtx := graphql.GetOperationContext(ctx) + groupID, ok := opCtx.Variables["updateGroupId"] + if !ok { + r.logger.Errorw("unable to get group from context") + + return ErrInternalServerError + } + + c := withTransactionalMutation(ctx) + + // get setting ID to update + settingID := obj.SettingID + if settingID == nil { + group, err := c.Group.Get(ctx, groupID.(string)) + if err != nil { + return err + } + + setting, err := group.Setting(ctx) + if err != nil { + return err + } + + settingID = &setting.ID + } + + _, err := c.GroupSetting.UpdateOneID(*settingID).SetInput(*data).Save(ctx) + if err != nil { + return err + } + + return nil +} diff --git a/internal/graphapi/groupmembers_test.go b/internal/graphapi/groupmembers_test.go new file mode 100644 index 0000000..48f3994 --- /dev/null +++ b/internal/graphapi/groupmembers_test.go @@ -0,0 +1,529 @@ +package graphapi_test + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryGroupMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + group := (&GroupBuilder{client: suite.client}).MustNew(reqCtx, t) + + // allow access to group + checkCtx := privacy.DecisionContext(reqCtx, privacy.Allow) + + groupMember, err := group.Members(checkCtx) + require.NoError(t, err) + require.Len(t, groupMember, 1) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expected *ent.GroupMembership + errExpected bool + }{ + { + name: "happy path, get group member by group id", + queryID: group.ID, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expected: groupMember[0], + }, + { + name: "happy path, get group member by group id using api token", + queryID: group.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + expected: groupMember[0], + }, + { + name: "happy path, get group member by group id using personal access token", + queryID: group.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + expected: groupMember[0], + }, + { + name: "get group member by group id, no access", + queryID: group.ID, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expected: nil, + errExpected: true, + }, + { + name: "invalid-id", + queryID: "tacos-for-dinner", + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expected: nil, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + groupID := tc.queryID + whereInput := openlaneclient.GroupMembershipWhereInput{ + GroupID: &groupID, + } + + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + + if tc.expected != nil { + // list groups in order to determine access to group level data + mock_fga.ListAny(t, suite.client.fga, []string{fmt.Sprintf("group:%s", group.ID)}) + } + + resp, err := tc.client.GetGroupMembersByGroupID(tc.ctx, &whereInput) + + if tc.errExpected { + require.Error(t, err) + assert.ErrorContains(t, err, "deny rule") + + return + } + + require.NoError(t, err) + + if tc.expected == nil { + assert.Empty(t, resp.GroupMemberships.Edges) + + return + } + + require.NotNil(t, resp) + require.NotNil(t, resp.GroupMemberships) + assert.Equal(t, tc.expected.UserID, resp.GroupMemberships.Edges[0].Node.GetUser().GetID()) + assert.Equal(t, tc.expected.Role, resp.GroupMemberships.Edges[0].Node.Role) + }) + } + + // delete created group + (&GroupCleanup{client: suite.client, ID: group.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationCreateGroupMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + group1 := (&GroupBuilder{client: suite.client}).MustNew(reqCtx, t) + + // allow access to group + checkCtx := privacy.DecisionContext(reqCtx, privacy.Allow) + + groupMember, err := group1.Members(checkCtx) + require.NoError(t, err) + require.Len(t, groupMember, 1) + + orgMember1 := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + orgMember2 := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + orgMember3 := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + + testCases := []struct { + name string + groupID string + userID string + role enums.Role + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + check bool + list bool + errMsg string + }{ + { + name: "happy path, add admin", + groupID: group1.ID, + userID: orgMember1.UserID, + role: enums.RoleAdmin, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + check: true, + list: true, + }, + { + name: "happy path, add member using api token", + groupID: group1.ID, + userID: orgMember2.UserID, + role: enums.RoleMember, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + check: true, + list: true, + }, + { + name: "happy path, add member using personal access token", + groupID: group1.ID, + userID: orgMember3.UserID, + role: enums.RoleMember, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + check: true, + list: true, + }, + { + name: "add member, no access", + groupID: group1.ID, + userID: orgMember2.UserID, + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + check: true, + list: false, + errMsg: "you are not authorized to perform this action", + }, + { + name: "owner relation not valid for groups", + groupID: group1.ID, + userID: orgMember2.UserID, + role: enums.RoleOwner, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + check: false, + list: false, + errMsg: "OWNER is not a valid GroupMembershipRole", + }, + { + name: "duplicate user, different role", + groupID: group1.ID, + userID: orgMember1.UserID, + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + check: true, + list: true, + errMsg: "already exists", + }, + { + name: "invalid user", + groupID: group1.ID, + userID: "not-a-valid-user-id", + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + check: true, + list: true, + errMsg: "constraint failed", + }, + { + name: "invalid group", + groupID: "not-a-valid-group-id", + userID: orgMember1.UserID, + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + check: true, + list: true, + errMsg: "constraint failed", + }, + { + name: "invalid role", + groupID: group1.ID, + userID: orgMember1.UserID, + role: enums.RoleInvalid, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + check: false, + list: false, + errMsg: "not a valid GroupMembershipRole", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errMsg == "" { + mock_fga.WriteAny(t, suite.client.fga) + } + + if tc.check { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + if tc.list { + mock_fga.ListOnce(t, suite.client.fga, []string{fmt.Sprintf("organization:%s", group1.OwnerID)}, nil) + } + + if tc.errMsg == "" { + mock_fga.ListOnce(t, suite.client.fga, []string{fmt.Sprintf("group:%s", group1.ID)}, nil) + } + + role := tc.role + input := openlaneclient.CreateGroupMembershipInput{ + GroupID: tc.groupID, + UserID: tc.userID, + Role: &role, + } + + resp, err := tc.client.AddUserToGroupWithRole(tc.ctx, input) + + if tc.errMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errMsg) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreateGroupMembership) + assert.Equal(t, tc.userID, resp.CreateGroupMembership.GroupMembership.UserID) + assert.Equal(t, tc.groupID, resp.CreateGroupMembership.GroupMembership.GroupID) + assert.Equal(t, tc.role, resp.CreateGroupMembership.GroupMembership.Role) + }) + } + + // delete created group and users + (&GroupCleanup{client: suite.client, ID: group1.ID}).MustDelete(reqCtx, t) + (&OrgMemberCleanup{client: suite.client, ID: orgMember1.ID}).MustDelete(reqCtx, t) + (&OrgMemberCleanup{client: suite.client, ID: orgMember2.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationUpdateGroupMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + orgMember := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + + gm := (&GroupMemberBuilder{client: suite.client, UserID: orgMember.UserID}).MustNew(reqCtx, t) + + testCases := []struct { + name string + role enums.Role + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + check bool + errMsg string + }{ + { + name: "happy path, update to admin from member", + role: enums.RoleAdmin, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + check: true, + }, + { + name: "happy path, update to member from admin using api token", + role: enums.RoleMember, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + check: true, + }, + { + name: "happy path, update to admin from member using personal access token", + role: enums.RoleAdmin, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + check: true, + }, + { + name: "invalid role", + role: enums.RoleInvalid, + client: suite.client.api, + ctx: reqCtx, + errMsg: "not a valid GroupMembershipRole", + allowed: true, + check: false, + }, + { + name: "no access", + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + errMsg: "you are not authorized to perform this action", + allowed: false, + check: true, + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errMsg == "" { + mock_fga.WriteAny(t, suite.client.fga) + } + + if tc.check { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + if tc.errMsg == "" { + mock_fga.ListOnce(t, suite.client.fga, []string{fmt.Sprintf("group:%s", gm.GroupID)}, nil) + } + + role := tc.role + input := openlaneclient.UpdateGroupMembershipInput{ + Role: &role, + } + + resp, err := tc.client.UpdateUserRoleInGroup(tc.ctx, gm.ID, input) + + if tc.errMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errMsg) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateGroupMembership) + assert.Equal(t, tc.role, resp.UpdateGroupMembership.GroupMembership.Role) + }) + } + + // delete created objects + (&GroupMemberCleanup{client: suite.client, ID: gm.ID}).MustDelete(reqCtx, t) + (&OrgMemberCleanup{client: suite.client, ID: orgMember.ID}).MustDelete(reqCtx, t) + (&GroupCleanup{client: suite.client, ID: gm.GroupID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationDeleteGroupMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + gm1 := (&GroupMemberBuilder{client: suite.client}).MustNew(reqCtx, t) + gm2 := (&GroupMemberBuilder{client: suite.client}).MustNew(reqCtx, t) + gm3 := (&GroupMemberBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + idToDelete string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + checkAccess bool + expectedErr string + }{ + { + name: "not allowed to delete", + idToDelete: gm1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: false, + expectedErr: "you are not authorized to perform this action: delete on groupmembership", + }, + { + name: "happy path, delete org member", + idToDelete: gm1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: true, + allowed: true, + }, + { + name: "group member already deleted, not found", + idToDelete: gm1.ID, + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "group_membership not found", + }, + { + name: "happy path, delete group member using api token", + idToDelete: gm2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "happy path, delete group member using personal access token", + idToDelete: gm3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkAccess: true, + allowed: true, + }, + { + name: "unknown group member, not found", + idToDelete: ulids.New().String(), + client: suite.client.api, + ctx: reqCtx, + checkAccess: false, + allowed: true, + expectedErr: "group_membership not found", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.expectedErr == "" { + mock_fga.WriteAny(t, suite.client.fga) + } + + if tc.checkAccess { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.RemoveUserFromGroup(tc.ctx, tc.idToDelete) + if tc.expectedErr != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.expectedErr) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.DeleteGroupMembership) + assert.Equal(t, tc.idToDelete, resp.DeleteGroupMembership.DeletedID) + }) + } + +} diff --git a/internal/graphapi/groupmembership.resolvers.go b/internal/graphapi/groupmembership.resolvers.go new file mode 100644 index 0000000..ca569c1 --- /dev/null +++ b/internal/graphapi/groupmembership.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateGroupMembership is the resolver for the createGroupMembership field. +func (r *mutationResolver) CreateGroupMembership(ctx context.Context, input generated.CreateGroupMembershipInput) (*GroupMembershipCreatePayload, error) { + res, err := withTransactionalMutation(ctx).GroupMembership.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "groupmembership"}, r.logger) + } + + return &GroupMembershipCreatePayload{ + GroupMembership: res, + }, nil +} + +// CreateBulkGroupMembership is the resolver for the createBulkGroupMembership field. +func (r *mutationResolver) CreateBulkGroupMembership(ctx context.Context, input []*generated.CreateGroupMembershipInput) (*GroupMembershipBulkCreatePayload, error) { + return r.bulkCreateGroupMembership(ctx, input) +} + +// CreateBulkCSVGroupMembership is the resolver for the createBulkCSVGroupMembership field. +func (r *mutationResolver) CreateBulkCSVGroupMembership(ctx context.Context, input graphql.Upload) (*GroupMembershipBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateGroupMembershipInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateGroupMembership(ctx, data) +} + +// UpdateGroupMembership is the resolver for the updateGroupMembership field. +func (r *mutationResolver) UpdateGroupMembership(ctx context.Context, id string, input generated.UpdateGroupMembershipInput) (*GroupMembershipUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).GroupMembership.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "groupmembership"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "groupmembership"}, r.logger) + } + + return &GroupMembershipUpdatePayload{ + GroupMembership: res, + }, nil +} + +// DeleteGroupMembership is the resolver for the deleteGroupMembership field. +func (r *mutationResolver) DeleteGroupMembership(ctx context.Context, id string) (*GroupMembershipDeletePayload, error) { + if err := withTransactionalMutation(ctx).GroupMembership.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "groupmembership"}, r.logger) + } + + if err := generated.GroupMembershipEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &GroupMembershipDeletePayload{ + DeletedID: id, + }, nil +} + +// GroupMembership is the resolver for the groupMembership field. +func (r *queryResolver) GroupMembership(ctx context.Context, id string) (*generated.GroupMembership, error) { + res, err := withTransactionalMutation(ctx).GroupMembership.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "groupmembership"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/groupsetting.resolvers.go b/internal/graphapi/groupsetting.resolvers.go new file mode 100644 index 0000000..261c063 --- /dev/null +++ b/internal/graphapi/groupsetting.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateGroupSetting is the resolver for the createGroupSetting field. +func (r *mutationResolver) CreateGroupSetting(ctx context.Context, input generated.CreateGroupSettingInput) (*GroupSettingCreatePayload, error) { + res, err := withTransactionalMutation(ctx).GroupSetting.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "groupsetting"}, r.logger) + } + + return &GroupSettingCreatePayload{ + GroupSetting: res, + }, nil +} + +// CreateBulkGroupSetting is the resolver for the createBulkGroupSetting field. +func (r *mutationResolver) CreateBulkGroupSetting(ctx context.Context, input []*generated.CreateGroupSettingInput) (*GroupSettingBulkCreatePayload, error) { + return r.bulkCreateGroupSetting(ctx, input) +} + +// CreateBulkCSVGroupSetting is the resolver for the createBulkCSVGroupSetting field. +func (r *mutationResolver) CreateBulkCSVGroupSetting(ctx context.Context, input graphql.Upload) (*GroupSettingBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateGroupSettingInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateGroupSetting(ctx, data) +} + +// UpdateGroupSetting is the resolver for the updateGroupSetting field. +func (r *mutationResolver) UpdateGroupSetting(ctx context.Context, id string, input generated.UpdateGroupSettingInput) (*GroupSettingUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).GroupSetting.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "groupsetting"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "groupsetting"}, r.logger) + } + + return &GroupSettingUpdatePayload{ + GroupSetting: res, + }, nil +} + +// DeleteGroupSetting is the resolver for the deleteGroupSetting field. +func (r *mutationResolver) DeleteGroupSetting(ctx context.Context, id string) (*GroupSettingDeletePayload, error) { + if err := withTransactionalMutation(ctx).GroupSetting.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "groupsetting"}, r.logger) + } + + if err := generated.GroupSettingEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &GroupSettingDeletePayload{ + DeletedID: id, + }, nil +} + +// GroupSetting is the resolver for the groupSetting field. +func (r *queryResolver) GroupSetting(ctx context.Context, id string) (*generated.GroupSetting, error) { + res, err := withTransactionalMutation(ctx).GroupSetting.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "groupsetting"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/helpers.go b/internal/graphapi/helpers.go new file mode 100644 index 0000000..509b799 --- /dev/null +++ b/internal/graphapi/helpers.go @@ -0,0 +1,122 @@ +package graphapi + +import ( + "context" + "fmt" + "io" + + "github.com/99designs/gqlgen/graphql" + "github.com/gocarina/gocsv" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/events/soiree" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/utils/rout" + sliceutil "github.com/theopenlane/utils/slice" +) + +const ( + // defaultMaxWorkers is the default number of workers in the pond pool when the pool was not created on server startup + defaultMaxWorkers = 10 + // defaultMaxCapacity is the default capacity of the pond pool when the pool was not created on server startup + defaultMaxCapacity = 100 +) + +// withTransactionalMutation automatically wrap the GraphQL mutations with a database transaction. +// This allows the ent.Client to commit at the end, or rollback the transaction in case of a GraphQL error. +func withTransactionalMutation(ctx context.Context) *ent.Client { + return ent.FromContext(ctx) +} + +// injectClient adds the db client to the context to be used with transactional mutations +func injectClient(client *ent.Client) graphql.OperationMiddleware { + return func(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler { + ctx = ent.NewContext(ctx, client) + return next(ctx) + } +} + +// withPool returns the existing pool or creates a new one if it does not exist +func (r *queryResolver) withPool() *soiree.PondPool { + if r.pool != nil { + return r.pool + } + + r.pool = soiree.NewPondPool(defaultMaxWorkers, defaultMaxCapacity) + + return r.pool +} + +// unmarshalBulkData unmarshals the input bulk data into a slice of the given type +func unmarshalBulkData[T any](input graphql.Upload) ([]*T, error) { + // read the csv file + var data []*T + stream, readErr := io.ReadAll(input.File) + if readErr != nil { + return nil, readErr + } + + // parse the csv + if err := gocsv.UnmarshalBytes(stream, &data); err != nil { + return nil, err + } + + return data, nil +} + +// setOrganizationInAuthContext sets the organization in the auth context based on the input if it is not already set +// in most cases this is a no-op because the organization id is set in the auth middleware +// only when multiple organizations are authorized (e.g. with a PAT) is this necessary +func setOrganizationInAuthContext(ctx context.Context, inputOrgID *string) error { + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err == nil && orgID != "" { + return nil + } + + if inputOrgID == nil { + // this would happen on a PAT authenticated request because the org id is not set + return fmt.Errorf("unable to determine organization id") + } + + // ensure this org is authenticated + orgIDs, err := auth.GetOrganizationIDsFromContext(ctx) + if err != nil { + return err + } + + if !sliceutil.Contains(orgIDs, *inputOrgID) { + return fmt.Errorf("organization id %s not found in the authenticated organizations", orgID) + } + + au, err := auth.GetAuthenticatedUserContext(ctx) + if err != nil { + return err + } + + au.OrganizationID = *inputOrgID + + ec, err := echocontext.EchoContextFromContext(ctx) + if err != nil { + return err + } + + auth.SetAuthenticatedUserContext(ec, au) + + return nil +} + +// checkAllowedAuthType checks how the user is authenticated and returns an error +// if the user is authenticated with an API token for a user owned setting +func checkAllowedAuthType(ctx context.Context) error { + ac, err := auth.GetAuthenticatedUserContext(ctx) + if err != nil { + return err + } + + if ac.AuthenticationType == auth.APITokenAuthentication { + return fmt.Errorf("%w: unable to use API token to update user settings", rout.ErrBadRequest) + } + + return nil +} diff --git a/internal/graphapi/hush.resolvers.go b/internal/graphapi/hush.resolvers.go new file mode 100644 index 0000000..e6d4662 --- /dev/null +++ b/internal/graphapi/hush.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateHush is the resolver for the createHush field. +func (r *mutationResolver) CreateHush(ctx context.Context, input generated.CreateHushInput) (*HushCreatePayload, error) { + res, err := withTransactionalMutation(ctx).Hush.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "hush"}, r.logger) + } + + return &HushCreatePayload{ + Hush: res, + }, nil +} + +// CreateBulkHush is the resolver for the createBulkHush field. +func (r *mutationResolver) CreateBulkHush(ctx context.Context, input []*generated.CreateHushInput) (*HushBulkCreatePayload, error) { + return r.bulkCreateHush(ctx, input) +} + +// CreateBulkCSVHush is the resolver for the createBulkCSVHush field. +func (r *mutationResolver) CreateBulkCSVHush(ctx context.Context, input graphql.Upload) (*HushBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateHushInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateHush(ctx, data) +} + +// UpdateHush is the resolver for the updateHush field. +func (r *mutationResolver) UpdateHush(ctx context.Context, id string, input generated.UpdateHushInput) (*HushUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Hush.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "hush"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "hush"}, r.logger) + } + + return &HushUpdatePayload{ + Hush: res, + }, nil +} + +// DeleteHush is the resolver for the deleteHush field. +func (r *mutationResolver) DeleteHush(ctx context.Context, id string) (*HushDeletePayload, error) { + if err := withTransactionalMutation(ctx).Hush.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "hush"}, r.logger) + } + + if err := generated.HushEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &HushDeletePayload{ + DeletedID: id, + }, nil +} + +// Hush is the resolver for the hush field. +func (r *queryResolver) Hush(ctx context.Context, id string) (*generated.Hush, error) { + res, err := withTransactionalMutation(ctx).Hush.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "hush"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/integration.resolvers.go b/internal/graphapi/integration.resolvers.go new file mode 100644 index 0000000..af2ac7c --- /dev/null +++ b/internal/graphapi/integration.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateIntegration is the resolver for the createIntegration field. +func (r *mutationResolver) CreateIntegration(ctx context.Context, input generated.CreateIntegrationInput) (*IntegrationCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Integration.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "integration"}, r.logger) + } + + return &IntegrationCreatePayload{ + Integration: res, + }, nil +} + +// CreateBulkIntegration is the resolver for the createBulkIntegration field. +func (r *mutationResolver) CreateBulkIntegration(ctx context.Context, input []*generated.CreateIntegrationInput) (*IntegrationBulkCreatePayload, error) { + return r.bulkCreateIntegration(ctx, input) +} + +// CreateBulkCSVIntegration is the resolver for the createBulkCSVIntegration field. +func (r *mutationResolver) CreateBulkCSVIntegration(ctx context.Context, input graphql.Upload) (*IntegrationBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateIntegrationInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateIntegration(ctx, data) +} + +// UpdateIntegration is the resolver for the updateIntegration field. +func (r *mutationResolver) UpdateIntegration(ctx context.Context, id string, input generated.UpdateIntegrationInput) (*IntegrationUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Integration.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "integration"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "integration"}, r.logger) + } + + return &IntegrationUpdatePayload{ + Integration: res, + }, nil +} + +// DeleteIntegration is the resolver for the deleteIntegration field. +func (r *mutationResolver) DeleteIntegration(ctx context.Context, id string) (*IntegrationDeletePayload, error) { + if err := withTransactionalMutation(ctx).Integration.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "integration"}, r.logger) + } + + if err := generated.IntegrationEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &IntegrationDeletePayload{ + DeletedID: id, + }, nil +} + +// Integration is the resolver for the integration field. +func (r *queryResolver) Integration(ctx context.Context, id string) (*generated.Integration, error) { + res, err := withTransactionalMutation(ctx).Integration.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "integration"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/invite.resolvers.go b/internal/graphapi/invite.resolvers.go new file mode 100644 index 0000000..2fccc9b --- /dev/null +++ b/internal/graphapi/invite.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateInvite is the resolver for the createInvite field. +func (r *mutationResolver) CreateInvite(ctx context.Context, input generated.CreateInviteInput) (*InviteCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Invite.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "invite"}, r.logger) + } + + return &InviteCreatePayload{ + Invite: res, + }, nil +} + +// CreateBulkInvite is the resolver for the createBulkInvite field. +func (r *mutationResolver) CreateBulkInvite(ctx context.Context, input []*generated.CreateInviteInput) (*InviteBulkCreatePayload, error) { + return r.bulkCreateInvite(ctx, input) +} + +// CreateBulkCSVInvite is the resolver for the createBulkCSVInvite field. +func (r *mutationResolver) CreateBulkCSVInvite(ctx context.Context, input graphql.Upload) (*InviteBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateInviteInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateInvite(ctx, data) +} + +// UpdateInvite is the resolver for the updateInvite field. +func (r *mutationResolver) UpdateInvite(ctx context.Context, id string, input generated.UpdateInviteInput) (*InviteUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Invite.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "invite"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "invite"}, r.logger) + } + + return &InviteUpdatePayload{ + Invite: res, + }, nil +} + +// DeleteInvite is the resolver for the deleteInvite field. +func (r *mutationResolver) DeleteInvite(ctx context.Context, id string) (*InviteDeletePayload, error) { + if err := withTransactionalMutation(ctx).Invite.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "invite"}, r.logger) + } + + if err := generated.InviteEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &InviteDeletePayload{ + DeletedID: id, + }, nil +} + +// Invite is the resolver for the invite field. +func (r *queryResolver) Invite(ctx context.Context, id string) (*generated.Invite, error) { + res, err := withTransactionalMutation(ctx).Invite.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "invite"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/invite_test.go b/internal/graphapi/invite_test.go new file mode 100644 index 0000000..62f56e3 --- /dev/null +++ b/internal/graphapi/invite_test.go @@ -0,0 +1,389 @@ +package graphapi_test + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/iam/fgax" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *GraphTestSuite) TestQueryInvite() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + invite := (&InviteBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + shouldCheck bool + wantErr bool + }{ + { + name: "happy path", + queryID: invite.ID, + client: suite.client.api, + ctx: reqCtx, + shouldCheck: true, + wantErr: false, + }, + { + name: "happy path with api token", + queryID: invite.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + shouldCheck: true, + wantErr: false, + }, + { + name: "invalid id", + queryID: "allthefooandbar", + client: suite.client.api, + ctx: reqCtx, + shouldCheck: false, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.shouldCheck { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.GetInviteByID(tc.ctx, tc.queryID) + + if tc.wantErr { + require.Error(t, err) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Invite) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateInvite() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // existing user to invite to org + existingUser := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + // existing user already a member of org + existingUser2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID, UserID: existingUser2.ID}).MustNew(reqCtx, t) + + // org member context + orgMember := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + orgMemberCtx, err := auth.NewTestContextWithOrgID(orgMember.UserID, testOrgID) + require.NoError(t, err) + + testCases := []struct { + name string + recipient string + orgID string + role enums.Role + client *openlaneclient.OpenLaneClient + ctx context.Context + accessAllowed bool + skipMockCheck bool + requestorID string + expectedStatus enums.InviteStatus + expectedAttempts int64 + wantErr bool + }{ + { + name: "happy path, new user as member", + recipient: "meow@theopenlane.io", + orgID: testOrgID, + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + accessAllowed: true, + requestorID: testUser.ID, + expectedStatus: enums.InvitationSent, + expectedAttempts: 0, + wantErr: false, + }, + { + name: "re-invite new user as member using api token", + recipient: "meow@theopenlane.io", + orgID: testOrgID, + role: enums.RoleMember, + client: suite.client.apiWithToken, + ctx: context.Background(), + accessAllowed: true, + requestorID: testUser.ID, + expectedStatus: enums.InvitationSent, + expectedAttempts: 1, + wantErr: false, + }, + { + name: "happy path, new user as admin using pat", + recipient: "woof@theopenlane.io", + orgID: testOrgID, + role: enums.RoleAdmin, + client: suite.client.apiWithPAT, + ctx: context.Background(), + accessAllowed: true, + requestorID: testUser.ID, + expectedStatus: enums.InvitationSent, + expectedAttempts: 0, + wantErr: false, + }, + { + name: "happy path, new user as member, by member", + recipient: "meow-meow@theopenlane.io", + orgID: testOrgID, + role: enums.RoleMember, + client: suite.client.api, + ctx: orgMemberCtx, + requestorID: orgMember.UserID, + accessAllowed: true, + expectedStatus: enums.InvitationSent, + expectedAttempts: 0, + wantErr: false, + }, + { + name: "new user as admin, by member, not allowed", + recipient: "meow-meow@theopenlane.io", + orgID: testOrgID, + role: enums.RoleAdmin, + client: suite.client.api, + ctx: orgMemberCtx, + requestorID: orgMember.UserID, + accessAllowed: false, // member cannot invite admins + wantErr: true, + }, + { + name: "new user as owner should fail", + recipient: "woof@theopenlane.io", + orgID: testOrgID, + role: enums.RoleOwner, + client: suite.client.api, + ctx: reqCtx, + skipMockCheck: true, // this request will fail before ever reaching the FGA check + wantErr: true, + }, + { + name: "user not allowed to add to org", + recipient: "oink@theopenlane.io", + orgID: testOrgID, + role: enums.RoleAdmin, + client: suite.client.api, + ctx: reqCtx, + accessAllowed: false, + wantErr: true, + }, + { + name: "happy path, existing user as member", + recipient: existingUser.Email, + orgID: testOrgID, + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + accessAllowed: true, + requestorID: testUser.ID, + expectedStatus: enums.InvitationSent, + expectedAttempts: 0, + wantErr: false, + }, + { + name: "user already a member, will still send an invite", + recipient: existingUser2.Email, + orgID: testOrgID, + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + accessAllowed: true, + requestorID: testUser.ID, + expectedStatus: enums.InvitationSent, + expectedAttempts: 0, + wantErr: false, + }, + { + name: "invalid org", + recipient: existingUser.Email, + orgID: "boommeowboom", + role: enums.RoleMember, + client: suite.client.api, + ctx: reqCtx, + accessAllowed: false, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if !tc.skipMockCheck { + mock_fga.CheckAny(t, suite.client.fga, tc.accessAllowed) + } + + role := tc.role + input := openlaneclient.CreateInviteInput{ + Recipient: tc.recipient, + OwnerID: &tc.orgID, + Role: &role, + } + + resp, err := tc.client.CreateInvite(tc.ctx, input) + + if tc.wantErr { + require.Error(t, err) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + // Assert matching fields + assert.Equal(t, tc.orgID, resp.CreateInvite.Invite.Owner.ID) + assert.Equal(t, tc.role, resp.CreateInvite.Invite.Role) + assert.Equal(t, tc.requestorID, *resp.CreateInvite.Invite.RequestorID) + assert.Equal(t, tc.expectedStatus, resp.CreateInvite.Invite.Status) + assert.Equal(t, tc.expectedAttempts, resp.CreateInvite.Invite.SendAttempts) + assert.WithinDuration(t, time.Now().UTC().AddDate(0, 0, 14), *resp.CreateInvite.Invite.Expires, time.Minute) + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteInvite() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + invite1 := (&InviteBuilder{client: suite.client}).MustNew(reqCtx, t) + invite2 := (&InviteBuilder{client: suite.client}).MustNew(reqCtx, t) + invite3 := (&InviteBuilder{client: suite.client}).MustNew(reqCtx, t) + invite4 := (&InviteBuilder{client: suite.client}).MustNew(reqCtx, t) + invite5 := (&InviteBuilder{client: suite.client, Role: fgax.AdminRelation}).MustNew(reqCtx, t) + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, invite1.OwnerID) + require.NoError(t, err) + + // Org member context + orgMember := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + orgMemberCtx, err := auth.NewTestContextWithOrgID(orgMember.UserID, testOrgID) + require.NoError(t, err) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + skipMockCheck bool + allowed bool + wantErr bool + }{ + { + name: "happy path", + queryID: invite1.ID, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + wantErr: false, + }, + { + name: "happy path, using api token", + queryID: invite2.ID, + client: suite.client.apiWithToken, + ctx: context.Background(), + allowed: true, + wantErr: false, + }, + { + name: "happy path, using personal access token", + queryID: invite3.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + allowed: true, + wantErr: false, + }, + { + name: "happy path, org member deleting member invite", + queryID: invite4.ID, + client: suite.client.api, + ctx: orgMemberCtx, + allowed: true, + wantErr: false, + }, + { + name: "org member deleting admin invite", + queryID: invite5.ID, + client: suite.client.api, + ctx: orgMemberCtx, + allowed: false, + wantErr: true, + }, + { + name: "org owner deleting admin invite", + queryID: invite5.ID, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + wantErr: false, + }, + { + name: "invalid id", + queryID: "allthefooandbar", + client: suite.client.api, + ctx: reqCtx, + skipMockCheck: true, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if !tc.skipMockCheck { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.DeleteInvite(tc.ctx, tc.queryID) + + if tc.wantErr { + require.Error(t, err) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + // assert equal + assert.Equal(t, tc.queryID, resp.DeleteInvite.DeletedID) + }) + } +} diff --git a/internal/graphapi/models_test.go b/internal/graphapi/models_test.go new file mode 100644 index 0000000..f615f26 --- /dev/null +++ b/internal/graphapi/models_test.go @@ -0,0 +1,895 @@ +package graphapi_test + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/enums" +) + +type OrganizationBuilder struct { + client *client + + // Fields + Name string + DisplayName string + Description *string + OrgID string + ParentOrgID string + PersonalOrg bool +} + +type OrganizationCleanup struct { + client *client + + // Fields + ID string +} + +type GroupBuilder struct { + client *client + + // Fields + Name string + Owner string +} + +type GroupCleanup struct { + client *client + + // Fields + ID string +} + +type UserBuilder struct { + client *client + + // Fields + FirstName string + LastName string + Email string + Password string +} + +type UserCleanup struct { + client *client + + // Fields + ID string +} + +type TFASettingBuilder struct { + client *client +} + +type OrgMemberBuilder struct { + client *client + + // Fields + UserID string + OrgID string + Role string +} + +type OrgMemberCleanup struct { + client *client + + // Fields + ID string +} + +type GroupMemberBuilder struct { + client *client + + // Fields + UserID string + GroupID string + Role string +} + +type GroupMemberCleanup struct { + client *client + + // Fields + ID string +} + +type InviteBuilder struct { + client *client + + // Fields + Recipient string + Role string +} + +type InviteCleanup struct { + client *client + + // Fields + ID string +} + +type PersonalAccessTokenBuilder struct { + client *client + + // Fields + Name string + Token string + Abilities []string + Description string + ExpiresAt *time.Time + OwnerID string + OrganizationIDs []string +} + +type APITokenBuilder struct { + client *client + + // Fields + Name string + Token string + Scopes []string + Description string + ExpiresAt *time.Time + OwnerID string +} + +type SubscriberBuilder struct { + client *client + + // Fields + Email string + OrgID string +} + +type SubscriberCleanup struct { + client *client + + // Fields + Email string +} + +type FeatureBuilder struct { + client *client + + // Fields + Name string + Description string + DisplayName string +} + +type FeatureCleanup struct { + client *client + + // Fields + ID string +} + +type EntitlementBuilder struct { + client *client + + // Fields + PlanID string + OrganizationID string +} + +type EntitlementCleanup struct { + client *client + + // Fields + ID string +} + +type EntitlementPlanBuilder struct { + client *client + + // Fields + Name string + Description string + DisplayName string + Version string +} + +type EntitlementPlanCleanup struct { + client *client + + // Fields + ID string +} + +type EntitlementPlanFeatureBuilder struct { + client *client + + // Fields + PlanID string + FeatureID string + MetaData map[string]interface{} +} + +type EntitlementPlanFeatureCleanup struct { + client *client + + // Fields + ID string +} + +type EntityBuilder struct { + client *client + + // Fields + Name string + DisplayName string + TypeID string + Description string + Owner string +} + +type EntityCleanup struct { + client *client + + // Fields + ID string +} + +type EntityTypeBuilder struct { + client *client + + // Fields + Name string +} + +type EntityTypeCleanup struct { + client *client + + // Fields + ID string +} + +type ContactBuilder struct { + client *client + + // Fields + Name string + Email string + Address string + Phone string + Title string + Company string + Status enums.UserStatus +} + +type ContactCleanup struct { + client *client + + // Fields + ID string +} + +// MustNew organization builder is used to create, without authz checks, orgs in the database +func (o *OrganizationBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Organization { + // no auth, so allow policy + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + // add client to context + // the organization hook expects the client to be in the context + // which happens automatically when using the graph resolvers + ctx = ent.NewContext(ctx, o.client.db) + + if !o.PersonalOrg { + // mock writes + mock_fga.WriteOnce(t, o.client.fga) + } + + if o.Name == "" { + o.Name = gofakeit.LetterN(40) + } + + if o.DisplayName == "" { + o.DisplayName = gofakeit.LetterN(40) + } + + if o.Description == nil { + desc := gofakeit.HipsterSentence(10) + o.Description = &desc + } + + m := o.client.db.Organization.Create().SetName(o.Name).SetDescription(*o.Description).SetDisplayName(o.DisplayName).SetPersonalOrg(o.PersonalOrg) + + if o.ParentOrgID != "" { + m.SetParentID(o.ParentOrgID) + } + + org := m.SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(o.client.fga) + + return org +} + +// MustDelete is used to cleanup, without authz checks, orgs in the database +func (o *OrganizationCleanup) MustDelete(ctx context.Context, t *testing.T) { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + o.client.db.Organization.DeleteOneID(o.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(o.client.fga) +} + +// MustNew user builder is used to create, without authz checks, users in the database +func (u *UserBuilder) MustNew(ctx context.Context, t *testing.T) *ent.User { + // mock writes + mock_fga.WriteOnce(t, u.client.fga) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if u.FirstName == "" { + u.FirstName = gofakeit.FirstName() + } + + if u.LastName == "" { + u.LastName = gofakeit.LastName() + } + + if u.Email == "" { + u.Email = gofakeit.Email() + } + + if u.Password == "" { + u.Password = gofakeit.Password(true, true, true, true, false, 20) + } + + // create user setting + userSetting := u.client.db.UserSetting.Create().SaveX(ctx) + + user := u.client.db.User.Create(). + SetFirstName(u.FirstName). + SetLastName(u.LastName). + SetEmail(u.Email). + SetPassword(u.Password). + SetSetting(userSetting). + SaveX(ctx) + + user.Edges.Setting.DefaultOrg(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(u.client.fga) + + return user +} + +// MustDelete is used to cleanup, without authz checks, users in the database +func (u *UserCleanup) MustDelete(ctx context.Context, t *testing.T) { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + u.client.db.User.DeleteOneID(u.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(u.client.fga) +} + +// MustNew tfa settings builder is used to create, without authz checks, tfa settings in the database +func (tf *TFASettingBuilder) MustNew(ctx context.Context, t *testing.T, userID string) *ent.TFASetting { + return tf.client.db.TFASetting.Create(). + SetTotpAllowed(true). + SetOwnerID(userID). + SaveX(ctx) +} + +// MustNew org members builder is used to create, without authz checks, org members in the database +func (om *OrgMemberBuilder) MustNew(ctx context.Context, t *testing.T) *ent.OrgMembership { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if om.OrgID == "" { + org := (&OrganizationBuilder{client: om.client}).MustNew(ctx, t) + om.OrgID = org.ID + } + + if om.UserID == "" { + user := (&UserBuilder{client: om.client}).MustNew(ctx, t) + om.UserID = user.ID + } + + role := enums.ToRole(om.Role) + if role == &enums.RoleInvalid { + role = &enums.RoleMember + } + + // mock writes + mock_fga.WriteOnce(t, om.client.fga) + + orgMembers := om.client.db.OrgMembership.Create(). + SetUserID(om.UserID). + SetOrganizationID(om.OrgID). + SetRole(*role). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(om.client.fga) + + return orgMembers +} + +// MustDelete is used to cleanup, without authz checks, org members in the database +func (om *OrgMemberCleanup) MustDelete(ctx context.Context, t *testing.T) { + // mock writes + mock_fga.WriteOnce(t, om.client.fga) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + om.client.db.OrgMembership.DeleteOneID(om.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(om.client.fga) +} + +// MustNew group builder is used to create, without authz checks, groups in the database +func (g *GroupBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Group { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if g.Name == "" { + g.Name = gofakeit.AppName() + } + + // create owner if not provided + owner := g.Owner + + if g.Owner == "" { + owner = testPersonalOrgID + } + + // mock writes + mock_fga.WriteAny(t, g.client.fga) + + mock_fga.ListAny(t, g.client.fga, []string{fmt.Sprintf("group:%s", owner)}) + + group := g.client.db.Group.Create().SetName(g.Name).SetOwnerID(owner).SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(g.client.fga) + + return group +} + +// MustDelete is used to cleanup, without authz checks, groups in the database +func (g *GroupCleanup) MustDelete(ctx context.Context, t *testing.T) { + mock_fga.ClearMocks(g.client.fga) + + // mock writes + mock_fga.ReadAny(t, g.client.fga) + mock_fga.ListAny(t, g.client.fga, []string{fmt.Sprintf("group:%s", g.ID)}) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + g.client.db.Group.DeleteOneID(g.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(g.client.fga) +} + +// MustNew invite builder is used to create, without authz checks, invites in the database +func (i *InviteBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Invite { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + // create user if not provided + rec := i.Recipient + + if rec == "" { + rec = gofakeit.Email() + } + + inviteQuery := i.client.db.Invite.Create(). + SetRecipient(rec) + + if i.Role != "" { + inviteQuery.SetRole(*enums.ToRole(i.Role)) + } + + invite := inviteQuery.SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(i.client.fga) + + return invite +} + +// MustDelete is used to cleanup, without authz checks, invites in the database +func (i *InviteCleanup) MustDelete(ctx context.Context, t *testing.T) { + // mock writes + mock_fga.ReadAny(t, i.client.fga) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + i.client.db.Invite.DeleteOneID(i.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(i.client.fga) +} + +// MustNew subscriber builder is used to create, without authz checks, subscribers in the database +func (i *SubscriberBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Subscriber { + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + + // create user if not provided + rec := i.Email + + if rec == "" { + rec = gofakeit.Email() + } + + sub := i.client.db.Subscriber.Create(). + SetEmail(rec). + SetActive(true).SaveX(reqCtx) + + return sub +} + +// MustNew personal access tokens builder is used to create, without authz checks, personal access tokens in the database +func (pat *PersonalAccessTokenBuilder) MustNew(ctx context.Context, t *testing.T) *ent.PersonalAccessToken { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if pat.Name == "" { + pat.Name = gofakeit.AppName() + } + + if pat.Description == "" { + pat.Description = gofakeit.HipsterSentence(5) + } + + if pat.OwnerID == "" { + owner := (&UserBuilder{client: pat.client}).MustNew(ctx, t) + pat.OwnerID = owner.ID + } + + if pat.OrganizationIDs == nil { + org := (&OrganizationBuilder{client: pat.client}).MustNew(ctx, t) + pat.OrganizationIDs = []string{org.ID} + } + + request := pat.client.db.PersonalAccessToken.Create(). + SetName(pat.Name). + SetOwnerID(pat.OwnerID). + SetDescription(pat.Description). + AddOrganizationIDs(pat.OrganizationIDs...) + + if pat.ExpiresAt != nil { + request.SetExpiresAt(*pat.ExpiresAt) + } + + token := request.SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(pat.client.fga) + + return token +} + +// MustNew api tokens builder is used to create, without authz checks, api tokens in the database +func (at *APITokenBuilder) MustNew(ctx context.Context, t *testing.T) *ent.APIToken { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + // mock writes + if len(at.Scopes) > 0 { + mock_fga.WriteOnce(t, at.client.fga) + } + + if at.Name == "" { + at.Name = gofakeit.AppName() + } + + if at.Description == "" { + at.Description = gofakeit.HipsterSentence(5) + } + + request := at.client.db.APIToken.Create(). + SetName(at.Name). + SetDescription(at.Description). + SetScopes(at.Scopes) + + if at.OwnerID != "" { + request.SetOwnerID(at.OwnerID) + } + + if at.ExpiresAt != nil { + request.SetExpiresAt(*at.ExpiresAt) + } + + token := request.SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(at.client.fga) + + return token +} + +// MustNew user builder is used to create, without authz checks, group members in the database +func (gm *GroupMemberBuilder) MustNew(ctx context.Context, t *testing.T) *ent.GroupMembership { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if gm.GroupID == "" { + group := (&GroupBuilder{client: gm.client}).MustNew(ctx, t) + gm.GroupID = group.ID + } + + if gm.UserID == "" { + user := (&UserBuilder{client: gm.client}).MustNew(ctx, t) + gm.UserID = user.ID + } + + // mock writes + mock_fga.ListAny(t, gm.client.fga, []string{fmt.Sprintf("organization:%s", testPersonalOrgID)}) + mock_fga.WriteOnce(t, gm.client.fga) + + groupMember := gm.client.db.GroupMembership.Create(). + SetUserID(gm.UserID). + SetGroupID(gm.GroupID). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(gm.client.fga) + + return groupMember +} + +// MustDelete is used to cleanup, without authz checks, group members in the database +func (gm *GroupMemberCleanup) MustDelete(ctx context.Context, t *testing.T) { + // mock writes + mock_fga.WriteOnce(t, gm.client.fga) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + gm.client.db.GroupMembership.DeleteOneID(gm.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(gm.client.fga) +} + +// MustNew feature builder is used to create, without authz checks, features in the database +func (f *FeatureBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Feature { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if f.Name == "" { + f.Name = gofakeit.AppName() + } + + if f.Description == "" { + f.Description = gofakeit.HipsterSentence(5) + } + + feature := f.client.db.Feature.Create(). + SetName(f.Name). + SetDescription(f.Description). + SetDisplayName(f.DisplayName). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(f.client.fga) + + return feature +} + +// MustNew plan builder is used to create, without authz checks, plans in the database +func (p *EntitlementPlanBuilder) MustNew(ctx context.Context, t *testing.T) *ent.EntitlementPlan { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if p.Name == "" { + p.Name = gofakeit.AppName() + } + + if p.Description == "" { + p.Description = gofakeit.HipsterSentence(5) + } + + if p.Version == "" { + p.Version = fmt.Sprintf("v%d", gofakeit.Number(1, 10)) + } + + plan := p.client.db.EntitlementPlan.Create(). + SetName(p.Name). + SetVersion(p.Version). + SetDescription(p.Description). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(p.client.fga) + + return plan +} + +// MustNew entitlement builder is used to create, without authz checks, entitlements in the database +func (e *EntitlementBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Entitlement { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if e.PlanID == "" { + plan := (&EntitlementPlanBuilder{client: e.client}).MustNew(ctx, t) + e.PlanID = plan.ID + } + + if e.OrganizationID == "" { + org := (&OrganizationBuilder{client: e.client}).MustNew(ctx, t) + e.OrganizationID = org.ID + } + + entitlement := e.client.db.Entitlement.Create(). + SetPlanID(e.PlanID). + SetOrganizationID(e.OrganizationID). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) + + return entitlement +} + +// MustNew entitlement plan feature builder is used to create, without authz checks, plan features in the database +func (e *EntitlementPlanFeatureBuilder) MustNew(ctx context.Context, t *testing.T) *ent.EntitlementPlanFeature { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if e.PlanID == "" { + plan := (&EntitlementPlanBuilder{client: e.client}).MustNew(ctx, t) + e.PlanID = plan.ID + } + + if e.FeatureID == "" { + feature := (&FeatureBuilder{client: e.client}).MustNew(ctx, t) + e.FeatureID = feature.ID + } + + if e.MetaData == nil { + e.MetaData = map[string]interface{}{ + "limit_type": "days", + "limit": 30, + } + } + + planFeature := e.client.db.EntitlementPlanFeature.Create(). + SetPlanID(e.PlanID). + SetFeatureID(e.FeatureID). + SetMetadata(e.MetaData). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) + + return planFeature +} + +// MustNew entity type builder is used to create, without authz checks, entity types in the database +func (e *EntityTypeBuilder) MustNew(ctx context.Context, t *testing.T) *ent.EntityType { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if e.Name == "" { + e.Name = gofakeit.AppName() + } + + entityType := e.client.db.EntityType.Create(). + SetName(e.Name). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) + + return entityType +} + +// MustDelete is used to cleanup, without authz checks, entities in the database +func (e *EntityTypeCleanup) MustDelete(ctx context.Context, t *testing.T) { + mock_fga.ClearMocks(e.client.fga) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + e.client.db.EntityType.DeleteOneID(e.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) +} + +// MustNew entity builder is used to create, without authz checks, entities in the database +func (e *EntityBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Entity { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if e.Name == "" { + e.Name = gofakeit.AppName() + } + + if e.DisplayName == "" { + e.DisplayName = e.Name + } + + if e.Description == "" { + e.Description = gofakeit.HipsterSentence(5) + } + + if e.TypeID == "" { + et := (&EntityTypeBuilder{client: e.client}).MustNew(ctx, t) + e.TypeID = et.ID + } + + entity := e.client.db.Entity.Create(). + SetName(e.Name). + SetDisplayName(e.DisplayName). + SetEntityTypeID(e.TypeID). + SetDescription(e.Description). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) + + return entity +} + +// MustDelete is used to cleanup, without authz checks, entities in the database +func (e *EntityCleanup) MustDelete(ctx context.Context, t *testing.T) { + mock_fga.ClearMocks(e.client.fga) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + e.client.db.Entity.DeleteOneID(e.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) +} + +// MustNew contact builder is used to create, without authz checks, contacts in the database +func (e *ContactBuilder) MustNew(ctx context.Context, t *testing.T) *ent.Contact { + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + if e.Name == "" { + e.Name = gofakeit.AppName() + } + + if e.Email == "" { + e.Email = gofakeit.Email() + } + + if e.Phone == "" { + e.Phone = gofakeit.Phone() + } + + if e.Address == "" { + address := gofakeit.Address() + e.Address = fmt.Sprintf("%s, %s, %s, %s", address.Street, address.City, address.State, address.Zip) + } + + if e.Title == "" { + e.Title = gofakeit.JobTitle() + } + + if e.Company == "" { + e.Company = gofakeit.Company() + } + + entity := e.client.db.Contact.Create(). + SetFullName(e.Name). + SetEmail(e.Email). + SetPhoneNumber(e.Phone). + SetAddress(e.Address). + SetTitle(e.Title). + SetCompany(e.Company). + SaveX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) + + return entity +} + +// MustDelete is used to cleanup, without authz checks, contacts in the database +func (e *ContactCleanup) MustDelete(ctx context.Context, t *testing.T) { + mock_fga.ClearMocks(e.client.fga) + + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + e.client.db.Contact.DeleteOneID(e.ID).ExecX(ctx) + + // clear mocks before going to tests + mock_fga.ClearMocks(e.client.fga) +} diff --git a/internal/graphapi/oauthprovider.resolvers.go b/internal/graphapi/oauthprovider.resolvers.go new file mode 100644 index 0000000..d82f653 --- /dev/null +++ b/internal/graphapi/oauthprovider.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateOauthProvider is the resolver for the createOauthProvider field. +func (r *mutationResolver) CreateOauthProvider(ctx context.Context, input generated.CreateOauthProviderInput) (*OauthProviderCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).OauthProvider.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "oauthprovider"}, r.logger) + } + + return &OauthProviderCreatePayload{ + OauthProvider: res, + }, nil +} + +// CreateBulkOauthProvider is the resolver for the createBulkOauthProvider field. +func (r *mutationResolver) CreateBulkOauthProvider(ctx context.Context, input []*generated.CreateOauthProviderInput) (*OauthProviderBulkCreatePayload, error) { + return r.bulkCreateOauthProvider(ctx, input) +} + +// CreateBulkCSVOauthProvider is the resolver for the createBulkCSVOauthProvider field. +func (r *mutationResolver) CreateBulkCSVOauthProvider(ctx context.Context, input graphql.Upload) (*OauthProviderBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateOauthProviderInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateOauthProvider(ctx, data) +} + +// UpdateOauthProvider is the resolver for the updateOauthProvider field. +func (r *mutationResolver) UpdateOauthProvider(ctx context.Context, id string, input generated.UpdateOauthProviderInput) (*OauthProviderUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).OauthProvider.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "oauthprovider"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "oauthprovider"}, r.logger) + } + + return &OauthProviderUpdatePayload{ + OauthProvider: res, + }, nil +} + +// DeleteOauthProvider is the resolver for the deleteOauthProvider field. +func (r *mutationResolver) DeleteOauthProvider(ctx context.Context, id string) (*OauthProviderDeletePayload, error) { + if err := withTransactionalMutation(ctx).OauthProvider.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "oauthprovider"}, r.logger) + } + + if err := generated.OauthProviderEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &OauthProviderDeletePayload{ + DeletedID: id, + }, nil +} + +// OauthProvider is the resolver for the oauthProvider field. +func (r *queryResolver) OauthProvider(ctx context.Context, id string) (*generated.OauthProvider, error) { + res, err := withTransactionalMutation(ctx).OauthProvider.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "oauthprovider"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/ohauthtootoken.resolvers.go b/internal/graphapi/ohauthtootoken.resolvers.go new file mode 100644 index 0000000..c14f0d4 --- /dev/null +++ b/internal/graphapi/ohauthtootoken.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateOhAuthTooToken is the resolver for the createOhAuthTooToken field. +func (r *mutationResolver) CreateOhAuthTooToken(ctx context.Context, input generated.CreateOhAuthTooTokenInput) (*OhAuthTooTokenCreatePayload, error) { + res, err := withTransactionalMutation(ctx).OhAuthTooToken.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "ohauthtootoken"}, r.logger) + } + + return &OhAuthTooTokenCreatePayload{ + OhAuthTooToken: res, + }, nil +} + +// CreateBulkOhAuthTooToken is the resolver for the createBulkOhAuthTooToken field. +func (r *mutationResolver) CreateBulkOhAuthTooToken(ctx context.Context, input []*generated.CreateOhAuthTooTokenInput) (*OhAuthTooTokenBulkCreatePayload, error) { + return r.bulkCreateOhAuthTooToken(ctx, input) +} + +// CreateBulkCSVOhAuthTooToken is the resolver for the createBulkCSVOhAuthTooToken field. +func (r *mutationResolver) CreateBulkCSVOhAuthTooToken(ctx context.Context, input graphql.Upload) (*OhAuthTooTokenBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateOhAuthTooTokenInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateOhAuthTooToken(ctx, data) +} + +// UpdateOhAuthTooToken is the resolver for the updateOhAuthTooToken field. +func (r *mutationResolver) UpdateOhAuthTooToken(ctx context.Context, id string, input generated.UpdateOhAuthTooTokenInput) (*OhAuthTooTokenUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).OhAuthTooToken.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "ohauthtootoken"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags).AppendScopes(input.AppendScopes).AppendClaimsGroups(input.AppendClaimsGroups).AppendConnectorData(input.AppendConnectorData) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "ohauthtootoken"}, r.logger) + } + + return &OhAuthTooTokenUpdatePayload{ + OhAuthTooToken: res, + }, nil +} + +// DeleteOhAuthTooToken is the resolver for the deleteOhAuthTooToken field. +func (r *mutationResolver) DeleteOhAuthTooToken(ctx context.Context, id string) (*OhAuthTooTokenDeletePayload, error) { + if err := withTransactionalMutation(ctx).OhAuthTooToken.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "ohauthtootoken"}, r.logger) + } + + if err := generated.OhAuthTooTokenEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &OhAuthTooTokenDeletePayload{ + DeletedID: id, + }, nil +} + +// OhAuthTooToken is the resolver for the ohAuthTooToken field. +func (r *queryResolver) OhAuthTooToken(ctx context.Context, id string) (*generated.OhAuthTooToken, error) { + res, err := withTransactionalMutation(ctx).OhAuthTooToken.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "ohauthtootoken"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/organization.resolvers.go b/internal/graphapi/organization.resolvers.go new file mode 100644 index 0000000..e049936 --- /dev/null +++ b/internal/graphapi/organization.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateOrganization is the resolver for the createOrganization field. +func (r *mutationResolver) CreateOrganization(ctx context.Context, input generated.CreateOrganizationInput) (*OrganizationCreatePayload, error) { + res, err := withTransactionalMutation(ctx).Organization.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "organization"}, r.logger) + } + + return &OrganizationCreatePayload{ + Organization: res, + }, nil +} + +// CreateBulkOrganization is the resolver for the createBulkOrganization field. +func (r *mutationResolver) CreateBulkOrganization(ctx context.Context, input []*generated.CreateOrganizationInput) (*OrganizationBulkCreatePayload, error) { + return r.bulkCreateOrganization(ctx, input) +} + +// CreateBulkCSVOrganization is the resolver for the createBulkCSVOrganization field. +func (r *mutationResolver) CreateBulkCSVOrganization(ctx context.Context, input graphql.Upload) (*OrganizationBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateOrganizationInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateOrganization(ctx, data) +} + +// UpdateOrganization is the resolver for the updateOrganization field. +func (r *mutationResolver) UpdateOrganization(ctx context.Context, id string, input generated.UpdateOrganizationInput) (*OrganizationUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Organization.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "organization"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "organization"}, r.logger) + } + + return &OrganizationUpdatePayload{ + Organization: res, + }, nil +} + +// DeleteOrganization is the resolver for the deleteOrganization field. +func (r *mutationResolver) DeleteOrganization(ctx context.Context, id string) (*OrganizationDeletePayload, error) { + if err := withTransactionalMutation(ctx).Organization.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "organization"}, r.logger) + } + + if err := generated.OrganizationEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &OrganizationDeletePayload{ + DeletedID: id, + }, nil +} + +// Organization is the resolver for the organization field. +func (r *queryResolver) Organization(ctx context.Context, id string) (*generated.Organization, error) { + res, err := withTransactionalMutation(ctx).Organization.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "organization"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/organization_test.go b/internal/graphapi/organization_test.go new file mode 100644 index 0000000..c51b0e1 --- /dev/null +++ b/internal/graphapi/organization_test.go @@ -0,0 +1,788 @@ +package graphapi_test + +import ( + "context" + "errors" + "fmt" + "testing" + + "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/entx" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *GraphTestSuite) TestQueryOrganization() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org1 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + orgMember := (&OrgMemberBuilder{client: suite.client, OrgID: org1.ID}).MustNew(reqCtx, t) + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, org1.ID) + require.NoError(t, err) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + expected *ent.Organization + orgMembersExpected int + errorMsg string + }{ + { + name: "happy path, get organization", + queryID: org1.ID, + client: suite.client.api, + ctx: reqCtx, + orgMembersExpected: 2, + expected: org1, + }, + { + name: "happy path, get using api token", + queryID: testOrgID, + client: suite.client.apiWithToken, + ctx: context.Background(), + orgMembersExpected: 1, + expected: org1, + }, + { + name: "happy path, get using personal access token", + queryID: testOrgID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + orgMembersExpected: 1, + expected: org1, + }, + { + name: "invalid-id", + queryID: "tacos-for-dinner", + client: suite.client.api, + ctx: reqCtx, + errorMsg: "organization not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, true) + resp, err := tc.client.GetOrganizationByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Organization) + require.NotNil(t, resp.Organization.Members) + assert.Len(t, resp.Organization.Members, tc.orgMembersExpected) + + if tc.orgMembersExpected > 1 { + orgMemberFound := false + for _, m := range resp.Organization.Members { + if m.User.ID == orgMember.UserID { + orgMemberFound = true + } + } + + assert.True(t, orgMemberFound) + } + }) + } + + // delete created org + (&OrganizationCleanup{client: suite.client, ID: org1.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestQueryOrganizations() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org1 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + org2 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + t.Run("Get Organizations", func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, true) + + resp, err := suite.client.api.GetAllOrganizations(reqCtx) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Organizations.Edges) + + // make sure two organizations are returned, the two created and + // the personal org and test org created at suite setup + assert.Equal(t, 4, len(resp.Organizations.Edges)) + + org1Found := false + org2Found := false + + for _, o := range resp.Organizations.Edges { + if o.Node.ID == org1.ID { + org1Found = true + } else if o.Node.ID == org2.ID { + org2Found = true + } + } + + // if one of the orgs isn't found, fail the test + if !org1Found || !org2Found { + t.Fail() + } + }) +} + +func (suite *GraphTestSuite) TestMutationCreateOrganization() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + mock_fga.CheckAny(t, suite.client.fga, true) + + parentOrg, err := suite.client.api.GetOrganizationByID(reqCtx, testOrgID) + require.NoError(t, err) + + mock_fga.ClearMocks(suite.client.fga) + + // setup deleted org + orgToDelete := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + // delete said org + (&OrganizationCleanup{client: suite.client, ID: orgToDelete.ID}).MustDelete(reqCtx, t) + + testCases := []struct { + name string + orgName string + displayName string + orgDescription string + parentOrgID string + settings *openlaneclient.CreateOrganizationSettingInput + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedDefaultOrgUpdate bool + errorMsg string + }{ + { + name: "happy path organization", + orgName: gofakeit.Name(), + displayName: gofakeit.LetterN(50), + orgDescription: gofakeit.HipsterSentence(10), + expectedDefaultOrgUpdate: true, // only the first org created should update the default org + parentOrgID: "", // root org + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path organization with settings", + orgName: gofakeit.Name(), + displayName: gofakeit.LetterN(50), + orgDescription: gofakeit.HipsterSentence(10), + settings: &openlaneclient.CreateOrganizationSettingInput{ + Domains: []string{"meow.theopenlane.io"}, + }, + parentOrgID: "", // root org + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path organization with parent org", + orgName: gofakeit.Name(), + orgDescription: gofakeit.HipsterSentence(10), + parentOrgID: testOrgID, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path organization with parent org using personal access token", + orgName: gofakeit.Name(), + orgDescription: gofakeit.HipsterSentence(10), + parentOrgID: testOrgID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "organization with parent personal org", + orgName: gofakeit.Name(), + orgDescription: gofakeit.HipsterSentence(10), + parentOrgID: testPersonalOrgID, + errorMsg: "personal organizations are not allowed to have child organizations", + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "empty organization name", + orgName: "", + orgDescription: gofakeit.HipsterSentence(10), + errorMsg: "value is less than the required length", + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "long organization name", + orgName: gofakeit.LetterN(161), + orgDescription: gofakeit.HipsterSentence(10), + errorMsg: "value is greater than the required length", + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "organization with no description", + orgName: gofakeit.Name(), + orgDescription: "", + parentOrgID: testOrgID, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "duplicate organization name", + orgName: parentOrg.Organization.Name, + orgDescription: gofakeit.HipsterSentence(10), + errorMsg: "already exists", + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "duplicate organization name, but other was deleted, should pass", + orgName: orgToDelete.Name, + orgDescription: gofakeit.HipsterSentence(10), + errorMsg: "", + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "duplicate display name, should be allowed", + orgName: gofakeit.LetterN(80), + displayName: parentOrg.Organization.DisplayName, + orgDescription: gofakeit.HipsterSentence(10), + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "display name with spaces should pass", + orgName: gofakeit.Name(), + displayName: gofakeit.Sentence(3), + orgDescription: gofakeit.HipsterSentence(10), + client: suite.client.api, + ctx: reqCtx, + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + tc := tc + input := openlaneclient.CreateOrganizationInput{ + Name: tc.orgName, + Description: &tc.orgDescription, + } + + if tc.displayName != "" { + input.DisplayName = &tc.displayName + } + + if tc.parentOrgID != "" { + input.ParentID = &tc.parentOrgID + + if tc.errorMsg != "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + } + + if tc.settings != nil { + input.CreateOrgSettings = tc.settings + } + + // When calls are expected to fail, we won't ever write tuples + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + mock_fga.WriteAny(t, suite.client.fga) + } + + resp, err := tc.client.CreateOrganization(tc.ctx, input) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreateOrganization.Organization) + + // Make sure provided values match + assert.Equal(t, tc.orgName, resp.CreateOrganization.Organization.Name) + assert.Equal(t, tc.orgDescription, *resp.CreateOrganization.Organization.Description) + + if tc.parentOrgID == "" { + assert.Nil(t, resp.CreateOrganization.Organization.Parent) + } else { + parent := resp.CreateOrganization.Organization.GetParent() + assert.Equal(t, tc.parentOrgID, parent.ID) + } + + // Ensure org settings is not null + assert.NotNil(t, resp.CreateOrganization.Organization.Setting.ID) + + // Ensure display name is not empty + assert.NotEmpty(t, resp.CreateOrganization.Organization.DisplayName) + + if tc.settings != nil { + assert.Len(t, resp.CreateOrganization.Organization.Setting.Domains, 1) + + // make sure default org is updated if it's the first org created + userResp, err := tc.client.GetUserByID(tc.ctx, testUser.ID) + require.NoError(t, err) + if tc.expectedDefaultOrgUpdate { + assert.Equal(t, resp.CreateOrganization.Organization.ID, userResp.User.Setting.DefaultOrg.ID) + } else { + assert.NotEqual(t, resp.CreateOrganization.Organization.ID, userResp.User.Setting.DefaultOrg.ID) + } + } + + // ensure entity types are created + newCtx, err := auth.NewTestContextWithOrgID(testUser.ID, resp.CreateOrganization.Organization.ID) + require.NoError(t, err) + + et, err := suite.client.api.GetEntityTypes(newCtx, &openlaneclient.EntityTypeWhereInput{ + OwnerID: &resp.CreateOrganization.Organization.ID, + }) + require.NoError(t, err) + + require.Len(t, et.EntityTypes.Edges, 1) + assert.Equal(t, "vendor", et.EntityTypes.Edges[0].Node.Name) + assert.Equal(t, resp.CreateOrganization.Organization.ID, *et.EntityTypes.Edges[0].Node.OwnerID) + + // cleanup org + (&OrganizationCleanup{client: suite.client, ID: resp.CreateOrganization.Organization.ID}).MustDelete(reqCtx, t) + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateOrganization() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + nameUpdate := gofakeit.Name() + displayNameUpdate := gofakeit.LetterN(40) + descriptionUpdate := gofakeit.HipsterSentence(10) + nameUpdateLong := gofakeit.LetterN(200) + + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + testUser1 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, org.ID) + require.NoError(t, err) + + testCases := []struct { + name string + updateInput openlaneclient.UpdateOrganizationInput + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedRes openlaneclient.UpdateOrganization_UpdateOrganization_Organization + errorMsg string + }{ + { + name: "update name, happy path", + updateInput: openlaneclient.UpdateOrganizationInput{ + Name: &nameUpdate, + }, + client: suite.client.api, + ctx: reqCtx, + expectedRes: openlaneclient.UpdateOrganization_UpdateOrganization_Organization{ + ID: org.ID, + Name: nameUpdate, + DisplayName: org.DisplayName, + Description: &org.Description, + }, + }, + { + name: "add member as admin", + updateInput: openlaneclient.UpdateOrganizationInput{ + AddOrgMembers: []*openlaneclient.CreateOrgMembershipInput{ + { + UserID: testUser1.ID, + Role: &enums.RoleAdmin, + }, + }, + }, + client: suite.client.api, + ctx: reqCtx, + expectedRes: openlaneclient.UpdateOrganization_UpdateOrganization_Organization{ + ID: org.ID, + Name: nameUpdate, + DisplayName: org.DisplayName, + Description: &org.Description, + Members: []*openlaneclient.UpdateOrganization_UpdateOrganization_Organization_Members{ + { + Role: enums.RoleAdmin, + UserID: testUser1.ID, + }, + }, + }, + }, + { + name: "update description, happy path", + updateInput: openlaneclient.UpdateOrganizationInput{ + Description: &descriptionUpdate, + }, + client: suite.client.api, + ctx: reqCtx, + expectedRes: openlaneclient.UpdateOrganization_UpdateOrganization_Organization{ + ID: org.ID, + Name: nameUpdate, // this would have been updated on the prior test + DisplayName: org.DisplayName, + Description: &descriptionUpdate, + }, + }, + { + name: "update display name, happy path", + updateInput: openlaneclient.UpdateOrganizationInput{ + DisplayName: &displayNameUpdate, + }, + client: suite.client.api, + ctx: reqCtx, + expectedRes: openlaneclient.UpdateOrganization_UpdateOrganization_Organization{ + ID: org.ID, + Name: nameUpdate, // this would have been updated on the prior test + DisplayName: displayNameUpdate, + Description: &descriptionUpdate, + }, + }, + { + name: "update settings, happy path", + updateInput: openlaneclient.UpdateOrganizationInput{ + Description: &descriptionUpdate, + UpdateOrgSettings: &openlaneclient.UpdateOrganizationSettingInput{ + Domains: []string{"meow.theopenlane.io", "woof.theopenlane.io"}, + }, + }, + client: suite.client.api, + ctx: reqCtx, + expectedRes: openlaneclient.UpdateOrganization_UpdateOrganization_Organization{ + ID: org.ID, + Name: nameUpdate, // this would have been updated on the prior test + DisplayName: displayNameUpdate, // this would have been updated on the prior test + Description: &descriptionUpdate, + }, + }, + { + name: "update name, too long", + updateInput: openlaneclient.UpdateOrganizationInput{ + Name: &nameUpdateLong, + }, + client: suite.client.api, + ctx: reqCtx, + errorMsg: "value is greater than the required length", + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + // mock checks of tuple + defer mock_fga.ClearMocks(suite.client.fga) + // get and update organization + mock_fga.CheckAny(t, suite.client.fga, true) + + if tc.updateInput.AddOrgMembers != nil { + mock_fga.WriteAny(t, suite.client.fga) + } + + // update org + resp, err := tc.client.UpdateOrganization(tc.ctx, org.ID, tc.updateInput) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateOrganization.Organization) + + // Make sure provided values match + updatedOrg := resp.GetUpdateOrganization().Organization + assert.Equal(t, tc.expectedRes.Name, updatedOrg.Name) + assert.Equal(t, tc.expectedRes.DisplayName, updatedOrg.DisplayName) + assert.Equal(t, tc.expectedRes.Description, updatedOrg.Description) + + if tc.updateInput.AddOrgMembers != nil { + // Adding a member to an org will make it 2 users, there is an owner + // assigned to the org automatically + assert.Len(t, updatedOrg.Members, 2) + assert.Equal(t, tc.expectedRes.Members[0].Role, updatedOrg.Members[1].Role) + assert.Equal(t, tc.expectedRes.Members[0].UserID, updatedOrg.Members[1].UserID) + } + + if tc.updateInput.UpdateOrgSettings != nil { + assert.Len(t, updatedOrg.GetSetting().Domains, 2) + } + }) + } + + (&OrganizationCleanup{client: suite.client, ID: org.ID}).MustDelete(reqCtx, t) + (&UserCleanup{client: suite.client, ID: testUser1.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationDeleteOrganization() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + // setup auth + listObjects := []string{fmt.Sprintf("organization:%s", org.ID)} + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, org.ID) + require.NoError(t, err) + + // update default org for user + // setup mocks for update user setting + mock_fga.CheckAny(t, suite.client.fga, true) + setting, err := suite.client.api.UpdateUserSetting(reqCtx, testUser.Edges.Setting.ID, + openlaneclient.UpdateUserSettingInput{ + DefaultOrgID: &org.ID, + }, + ) + require.NoError(t, err) + require.Equal(t, org.ID, setting.UpdateUserSetting.UserSetting.DefaultOrg.ID) + // clear mocks + mock_fga.ClearMocks(suite.client.fga) + + testCases := []struct { + name string + orgID string + accessAllowed bool + errorMsg string + }{ + { + name: "delete org, access denied", + orgID: org.ID, + accessAllowed: false, + errorMsg: "you are not authorized to perform this action", + }, + { + name: "delete org, happy path", + orgID: org.ID, + accessAllowed: true, + }, + { + name: "delete org, personal org not allowed", + orgID: testPersonalOrgID, + accessAllowed: true, + errorMsg: "cannot delete personal organizations", + }, + { + name: "delete org, not found", + orgID: "tacos-tuesday", + accessAllowed: false, + errorMsg: "you are not authorized to perform this action", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // mock read of tuple + mock_fga.CheckAny(t, suite.client.fga, tc.accessAllowed) + + if tc.errorMsg == "" { + mock_fga.ListAny(t, suite.client.fga, listObjects) + } + + // additional check happens when the resource is found + if tc.errorMsg == "" { + mock_fga.WriteAny(t, suite.client.fga) + } + + // delete org + resp, err := suite.client.api.DeleteOrganization(reqCtx, tc.orgID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.DeleteOrganization.DeletedID) + + // make sure the deletedID matches the ID we wanted to delete + assert.Equal(t, tc.orgID, resp.DeleteOrganization.DeletedID) + + // make sure the default org is reset + settingUpdated, err := suite.client.api.GetUserSettingByID(reqCtx, testUser.Edges.Setting.ID) + require.NoError(t, err) + require.NotNil(t, settingUpdated.UserSetting.DefaultOrg) + assert.NotEqual(t, org.ID, settingUpdated.UserSetting.DefaultOrg.ID) + + o, err := suite.client.api.GetOrganizationByID(reqCtx, tc.orgID) + + require.Nil(t, o) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + + ctx := entx.SkipSoftDelete(reqCtx) + + o, err = suite.client.api.GetOrganizationByID(ctx, tc.orgID) + + require.Equal(t, o.Organization.ID, tc.orgID) + require.NoError(t, err) + }) + } +} + +func (suite *GraphTestSuite) TestMutationOrganizationCascadeDelete() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, org.ID) + require.NoError(t, err) + + // add child org + childOrg := (&OrganizationBuilder{client: suite.client, ParentOrgID: org.ID}).MustNew(reqCtx, t) + + group1 := (&GroupBuilder{client: suite.client, Owner: org.ID}).MustNew(reqCtx, t) + + listGroups := []string{fmt.Sprintf("group:%s", group1.ID)} + + // mocks checks for all calls + mock_fga.CheckAny(t, suite.client.fga, true) + + mock_fga.ListAny(t, suite.client.fga, listGroups) + + // mock writes to delete member of org + mock_fga.WriteAny(t, suite.client.fga) + + // delete org + resp, err := suite.client.api.DeleteOrganization(reqCtx, org.ID) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.DeleteOrganization.DeletedID) + + // make sure the deletedID matches the ID we wanted to delete + assert.Equal(t, org.ID, resp.DeleteOrganization.DeletedID) + + o, err := suite.client.api.GetOrganizationByID(reqCtx, org.ID) + + require.Nil(t, o) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + + co, err := suite.client.api.GetOrganizationByID(reqCtx, childOrg.ID) + + require.Nil(t, co) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + + g, err := suite.client.api.GetGroupByID(reqCtx, group1.ID) + + require.Nil(t, g) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + + // allow after tuples have been deleted + ctx := privacy.DecisionContext(reqCtx, privacy.Allow) + + ctx = entx.SkipSoftDelete(ctx) + + o, err = suite.client.api.GetOrganizationByID(ctx, org.ID) + + require.NoError(t, err) + require.Equal(t, o.Organization.ID, org.ID) + + // allow after tuples have been deleted + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + g, err = suite.client.api.GetGroupByID(ctx, group1.ID) + require.NoError(t, err) + + require.Equal(t, g.Group.ID, group1.ID) + + // allow after tuples have been deleted + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + co, err = suite.client.api.GetOrganizationByID(ctx, childOrg.ID) + require.NoError(t, err) + + require.Equal(t, co.Organization.ID, childOrg.ID) +} + +func (suite *GraphTestSuite) TestMutationCreateOrganizationTransaction() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + t.Run("Create should not write if FGA transaction fails", func(t *testing.T) { + input := openlaneclient.CreateOrganizationInput{ + Name: gofakeit.Name(), + } + + fgaErr := errors.New("unable to create relationship") //nolint:err113 + mock_fga.WriteError(t, suite.client.fga, fgaErr) + + resp, err := suite.client.api.CreateOrganization(reqCtx, input) + + require.Error(t, err) + require.Empty(t, resp) + + ctx := privacy.DecisionContext(reqCtx, privacy.Allow) + + orgs, err := suite.client.api.GetAllOrganizations(ctx) + require.NoError(t, err) + + for _, o := range orgs.Organizations.Edges { + if o.Node.Name == input.Name { + t.Errorf("org found that should not have been created due to FGA error") + } + } + }) +} diff --git a/internal/graphapi/organizationsetting.resolvers.go b/internal/graphapi/organizationsetting.resolvers.go new file mode 100644 index 0000000..a7f4ddc --- /dev/null +++ b/internal/graphapi/organizationsetting.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateOrganizationSetting is the resolver for the createOrganizationSetting field. +func (r *mutationResolver) CreateOrganizationSetting(ctx context.Context, input generated.CreateOrganizationSettingInput) (*OrganizationSettingCreatePayload, error) { + res, err := withTransactionalMutation(ctx).OrganizationSetting.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "organizationsetting"}, r.logger) + } + + return &OrganizationSettingCreatePayload{ + OrganizationSetting: res, + }, nil +} + +// CreateBulkOrganizationSetting is the resolver for the createBulkOrganizationSetting field. +func (r *mutationResolver) CreateBulkOrganizationSetting(ctx context.Context, input []*generated.CreateOrganizationSettingInput) (*OrganizationSettingBulkCreatePayload, error) { + return r.bulkCreateOrganizationSetting(ctx, input) +} + +// CreateBulkCSVOrganizationSetting is the resolver for the createBulkCSVOrganizationSetting field. +func (r *mutationResolver) CreateBulkCSVOrganizationSetting(ctx context.Context, input graphql.Upload) (*OrganizationSettingBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateOrganizationSettingInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateOrganizationSetting(ctx, data) +} + +// UpdateOrganizationSetting is the resolver for the updateOrganizationSetting field. +func (r *mutationResolver) UpdateOrganizationSetting(ctx context.Context, id string, input generated.UpdateOrganizationSettingInput) (*OrganizationSettingUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).OrganizationSetting.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "organizationsetting"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags).AppendDomains(input.AppendDomains) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "organizationsetting"}, r.logger) + } + + return &OrganizationSettingUpdatePayload{ + OrganizationSetting: res, + }, nil +} + +// DeleteOrganizationSetting is the resolver for the deleteOrganizationSetting field. +func (r *mutationResolver) DeleteOrganizationSetting(ctx context.Context, id string) (*OrganizationSettingDeletePayload, error) { + if err := withTransactionalMutation(ctx).OrganizationSetting.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "organizationsetting"}, r.logger) + } + + if err := generated.OrganizationSettingEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &OrganizationSettingDeletePayload{ + DeletedID: id, + }, nil +} + +// OrganizationSetting is the resolver for the organizationSetting field. +func (r *queryResolver) OrganizationSetting(ctx context.Context, id string) (*generated.OrganizationSetting, error) { + res, err := withTransactionalMutation(ctx).OrganizationSetting.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "organizationsetting"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/orgextended.resolvers.go b/internal/graphapi/orgextended.resolvers.go new file mode 100644 index 0000000..0a6c553 --- /dev/null +++ b/internal/graphapi/orgextended.resolvers.go @@ -0,0 +1,88 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateOrgSettings is the resolver for the createOrgSettings field. +func (r *createOrganizationInputResolver) CreateOrgSettings(ctx context.Context, obj *generated.CreateOrganizationInput, data *generated.CreateOrganizationSettingInput) error { + c := withTransactionalMutation(ctx) + + orgSettings, err := c.OrganizationSetting.Create().SetInput(*data).Save(ctx) + if err != nil { + return err + } + + obj.SettingID = &orgSettings.ID + + return nil +} + +// AddOrgMembers is the resolver for the addOrgMembers field. +func (r *updateOrganizationInputResolver) AddOrgMembers(ctx context.Context, obj *generated.UpdateOrganizationInput, data []*generated.CreateOrgMembershipInput) error { + opCtx := graphql.GetOperationContext(ctx) + orgID, ok := opCtx.Variables["updateOrganizationId"] + if !ok { + r.logger.Errorw("unable to get org from context") + + return ErrInternalServerError + } + + c := withTransactionalMutation(ctx) + builders := make([]*generated.OrgMembershipCreate, len(data)) + for i := range data { + input := *data[i] + input.OrganizationID = orgID.(string) + builders[i] = c.OrgMembership.Create().SetInput(input) + } + + _, err := c.OrgMembership.CreateBulk(builders...).Save(ctx) + if err != nil { + return err + } + + return nil +} + +// UpdateOrgSettings is the resolver for the updateOrgSettings field. +func (r *updateOrganizationInputResolver) UpdateOrgSettings(ctx context.Context, obj *generated.UpdateOrganizationInput, data *generated.UpdateOrganizationSettingInput) error { + opCtx := graphql.GetOperationContext(ctx) + orgID, ok := opCtx.Variables["updateOrganizationId"] + if !ok { + r.logger.Errorw("unable to get org from context") + + return ErrInternalServerError + } + + c := withTransactionalMutation(ctx) + + // get setting ID to Update + settingID := obj.SettingID + if settingID == nil { + org, err := c.Organization.Get(ctx, orgID.(string)) + if err != nil { + return err + } + + setting, err := org.Setting(ctx) + if err != nil { + return err + } + + settingID = &setting.ID + } + + _, err := c.OrganizationSetting.UpdateOneID(*settingID).SetInput(*data).Save(ctx) + if err != nil { + return err + } + + return nil +} diff --git a/internal/graphapi/orgmembers_test.go b/internal/graphapi/orgmembers_test.go new file mode 100644 index 0000000..2884a44 --- /dev/null +++ b/internal/graphapi/orgmembers_test.go @@ -0,0 +1,390 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/hooks" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/utils/ulids" +) + +func (suite *GraphTestSuite) TestQueryOrgMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org1Member := (&OrgMemberBuilder{client: suite.client, OrgID: testOrgID}).MustNew(reqCtx, t) + + childOrg := (&OrganizationBuilder{client: suite.client, ParentOrgID: testOrgID}).MustNew(reqCtx, t) + + childReqCtx, err := auth.NewTestContextWithOrgID(testUser.ID, childOrg.ID) + require.NoError(t, err) + + (&OrgMemberBuilder{client: suite.client, OrgID: childOrg.ID}).MustNew(childReqCtx, t) + (&OrgMemberBuilder{client: suite.client, OrgID: childOrg.ID, UserID: org1Member.UserID}).MustNew(childReqCtx, t) + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + allowed bool + expectedLen int + expectErr bool + }{ + { + name: "happy path, get org members by org id", + queryID: testOrgID, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedLen: 2, + }, + { + name: "happy path, get org with parent members based on context", + client: suite.client.api, + ctx: childReqCtx, + allowed: true, + expectedLen: 3, // 2 from child org, 1 from parent org because we dedupe + }, + { + name: "happy path, get org with parent members using org ID, only direct members will be returned", + queryID: childOrg.ID, + client: suite.client.api, + ctx: childReqCtx, + allowed: true, + expectedLen: 2, // only child org members will be returned + }, + { + name: "no access", + queryID: testOrgID, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + expectedLen: 2, + expectErr: true, + }, + { + name: "invalid-id", + queryID: "tacos-for-dinner", + client: suite.client.api, + ctx: reqCtx, + allowed: true, + expectedLen: 0, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + orgID := tc.queryID + whereInput := openlaneclient.OrgMembershipWhereInput{} + + if orgID != "" { + whereInput.OrganizationID = &orgID + + // if thee user is providing an org id, we check if they have access to the org + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + resp, err := tc.client.GetOrgMembersByOrgID(tc.ctx, &whereInput) + + if tc.expectErr { + require.Error(t, err) + + return + } + + require.NoError(t, err) + + if tc.expectedLen == 0 { + assert.Empty(t, resp.OrgMemberships.Edges) + + return + } + + require.NotNil(t, resp) + require.NotNil(t, resp.OrgMemberships) + assert.Len(t, resp.OrgMemberships.Edges, tc.expectedLen) + }) + } + + // delete created org + (&OrganizationCleanup{client: suite.client, ID: childOrg.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationCreateOrgMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org1 := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + // allow access to organization + checkCtx := privacy.DecisionContext(reqCtx, privacy.Allow) + + orgMember, err := org1.Members(checkCtx) + require.NoError(t, err) + require.Len(t, orgMember, 1) + + testUser1 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + testUser2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + orgID string + userID string + role enums.Role + checkOrg bool + checkRole bool + errMsg string + }{ + { + name: "happy path, add admin", + orgID: org1.ID, + userID: testUser1.ID, + role: enums.RoleAdmin, + checkRole: true, + checkOrg: true, + }, + { + name: "happy path, add member", + orgID: org1.ID, + userID: testUser2.ID, + role: enums.RoleMember, + checkRole: true, + checkOrg: true, + }, + { + name: "duplicate user, different role", + orgID: org1.ID, + userID: testUser1.ID, + role: enums.RoleMember, + checkOrg: true, + checkRole: true, + errMsg: "already exists", + }, + { + name: "add user to personal org not allowed", + orgID: testPersonalOrgID, + userID: testUser1.ID, + role: enums.RoleMember, + checkOrg: true, + checkRole: true, + errMsg: hooks.ErrPersonalOrgsNoMembers.Error(), + }, + { + name: "invalid user", + orgID: org1.ID, + userID: ulids.New().String(), + role: enums.RoleMember, + checkOrg: true, + checkRole: true, + errMsg: "constraint failed, unable to complete the action", + }, + { + name: "invalid org", + orgID: ulids.New().String(), + userID: testUser1.ID, + role: enums.RoleMember, + checkOrg: false, + checkRole: true, + errMsg: "organization not found", + }, + { + name: "invalid role", + orgID: org1.ID, + userID: testUser1.ID, + role: enums.RoleInvalid, + checkOrg: false, + checkRole: false, + errMsg: "not a valid OrgMembershipRole", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errMsg == "" { + mock_fga.WriteAny(t, suite.client.fga) + } + + // checks role in org to ensure user has ability to add other members + if tc.checkRole { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + role := tc.role + input := openlaneclient.CreateOrgMembershipInput{ + OrganizationID: tc.orgID, + UserID: tc.userID, + Role: &role, + } + + resp, err := suite.client.api.AddUserToOrgWithRole(reqCtx, input) + + if tc.errMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errMsg) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreateOrgMembership) + assert.Equal(t, tc.userID, resp.CreateOrgMembership.OrgMembership.UserID) + assert.Equal(t, tc.orgID, resp.CreateOrgMembership.OrgMembership.OrganizationID) + assert.Equal(t, tc.role, resp.CreateOrgMembership.OrgMembership.Role) + + // make sure the user default org is set to the new org + suite.assertDefaultOrgUpdate(reqCtx, tc.userID, tc.orgID, true) + }) + } + + // delete created org and users + (&OrganizationCleanup{client: suite.client, ID: org1.ID}).MustDelete(reqCtx, t) + (&UserCleanup{client: suite.client, ID: testUser1.ID}).MustDelete(reqCtx, t) + (&UserCleanup{client: suite.client, ID: testUser2.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationUpdateOrgMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + om := (&OrgMemberBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, om.OrganizationID) + require.NoError(t, err) + + testCases := []struct { + name string + role enums.Role + tupleWrite bool + errMsg string + }{ + { + name: "happy path, update to admin from member", + tupleWrite: true, + role: enums.RoleAdmin, + }, + { + name: "happy path, update to member from admin", + tupleWrite: true, + role: enums.RoleMember, + }, + { + name: "update to same role", + tupleWrite: false, // nothing should change + role: enums.RoleMember, + }, + { + name: "invalid role", + role: enums.RoleInvalid, + tupleWrite: false, + errMsg: "not a valid OrgMembershipRole", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.tupleWrite { + mock_fga.WriteAny(t, suite.client.fga) + } + + if tc.errMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + role := tc.role + input := openlaneclient.UpdateOrgMembershipInput{ + Role: &role, + } + + resp, err := suite.client.api.UpdateUserRoleInOrg(reqCtx, om.ID, input) + + if tc.errMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errMsg) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateOrgMembership) + assert.Equal(t, tc.role, resp.UpdateOrgMembership.OrgMembership.Role) + }) + } + + // delete created org and users + (&OrgMemberCleanup{client: suite.client, ID: om.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationDeleteOrgMembers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + om := (&OrgMemberBuilder{client: suite.client}).MustNew(reqCtx, t) + + mock_fga.WriteAny(t, suite.client.fga) + mock_fga.CheckAny(t, suite.client.fga, true) + + reqCtx, err = auth.NewTestContextWithOrgID(testUser.ID, om.OrganizationID) + require.NoError(t, err) + + resp, err := suite.client.api.RemoveUserFromOrg(reqCtx, om.ID) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.DeleteOrgMembership) + assert.Equal(t, om.ID, resp.DeleteOrgMembership.DeletedID) + + // make sure the user default org is not set to the deleted org + suite.assertDefaultOrgUpdate(reqCtx, om.UserID, om.OrganizationID, false) +} + +func (suite *GraphTestSuite) assertDefaultOrgUpdate(ctx context.Context, userID, orgID string, isEqual bool) { + t := suite.T() + + // when an org membership is deleted, the user default org should be updated + // we need to allow the request because this is not for the user making the request + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + + where := openlaneclient.UserSettingWhereInput{ + UserID: &userID, + } + + userSettingResp, err := suite.client.api.GetUserSettings(allowCtx, where) + require.NoError(t, err) + require.NotNil(t, userSettingResp) + require.Len(t, userSettingResp.UserSettings.Edges, 1) + + if isEqual { + assert.Equal(t, orgID, userSettingResp.UserSettings.Edges[0].Node.DefaultOrg.ID) + } else { + assert.NotEqual(t, orgID, userSettingResp.UserSettings.Edges[0].Node.DefaultOrg.ID) + } +} diff --git a/internal/graphapi/orgmembership.resolvers.go b/internal/graphapi/orgmembership.resolvers.go new file mode 100644 index 0000000..1a53039 --- /dev/null +++ b/internal/graphapi/orgmembership.resolvers.go @@ -0,0 +1,92 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateOrgMembership is the resolver for the createOrgMembership field. +func (r *mutationResolver) CreateOrgMembership(ctx context.Context, input generated.CreateOrgMembershipInput) (*OrgMembershipCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &input.OrganizationID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + om, err := withTransactionalMutation(ctx).OrgMembership.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "orgmembership"}, r.logger) + } + + return &OrgMembershipCreatePayload{OrgMembership: om}, nil +} + +// CreateBulkOrgMembership is the resolver for the createBulkOrgMembership field. +func (r *mutationResolver) CreateBulkOrgMembership(ctx context.Context, input []*generated.CreateOrgMembershipInput) (*OrgMembershipBulkCreatePayload, error) { + return r.bulkCreateOrgMembership(ctx, input) +} + +// CreateBulkCSVOrgMembership is the resolver for the createBulkCSVOrgMembership field. +func (r *mutationResolver) CreateBulkCSVOrgMembership(ctx context.Context, input graphql.Upload) (*OrgMembershipBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateOrgMembershipInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateOrgMembership(ctx, data) +} + +// UpdateOrgMembership is the resolver for the updateOrgMembership field. +func (r *mutationResolver) UpdateOrgMembership(ctx context.Context, id string, input generated.UpdateOrgMembershipInput) (*OrgMembershipUpdatePayload, error) { + orgMember, err := withTransactionalMutation(ctx).OrgMembership.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "orgmembership"}, r.logger) + } + + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &orgMember.OrganizationID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + orgMember, err = orgMember.Update().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "orgmembership"}, r.logger) + } + + return &OrgMembershipUpdatePayload{OrgMembership: orgMember}, nil +} + +// DeleteOrgMembership is the resolver for the deleteOrgMembership field. +func (r *mutationResolver) DeleteOrgMembership(ctx context.Context, id string) (*OrgMembershipDeletePayload, error) { + if err := withTransactionalMutation(ctx).OrgMembership.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "orgmembership"}, r.logger) + } + + if err := generated.OrgMembershipEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &OrgMembershipDeletePayload{DeletedID: id}, nil +} + +// OrgMembership is the resolver for the orgMembership field. +func (r *queryResolver) OrgMembership(ctx context.Context, id string) (*generated.OrgMembership, error) { + org, err := withTransactionalMutation(ctx).OrgMembership.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "orgmembership"}, r.logger) + } + + return org, nil +} diff --git a/internal/graphapi/personalaccesstoken.resolvers.go b/internal/graphapi/personalaccesstoken.resolvers.go new file mode 100644 index 0000000..dc4bc38 --- /dev/null +++ b/internal/graphapi/personalaccesstoken.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreatePersonalAccessToken is the resolver for the createPersonalAccessToken field. +func (r *mutationResolver) CreatePersonalAccessToken(ctx context.Context, input generated.CreatePersonalAccessTokenInput) (*PersonalAccessTokenCreatePayload, error) { + res, err := withTransactionalMutation(ctx).PersonalAccessToken.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "personalaccesstoken"}, r.logger) + } + + return &PersonalAccessTokenCreatePayload{ + PersonalAccessToken: res, + }, nil +} + +// CreateBulkPersonalAccessToken is the resolver for the createBulkPersonalAccessToken field. +func (r *mutationResolver) CreateBulkPersonalAccessToken(ctx context.Context, input []*generated.CreatePersonalAccessTokenInput) (*PersonalAccessTokenBulkCreatePayload, error) { + return r.bulkCreatePersonalAccessToken(ctx, input) +} + +// CreateBulkCSVPersonalAccessToken is the resolver for the createBulkCSVPersonalAccessToken field. +func (r *mutationResolver) CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload) (*PersonalAccessTokenBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreatePersonalAccessTokenInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreatePersonalAccessToken(ctx, data) +} + +// UpdatePersonalAccessToken is the resolver for the updatePersonalAccessToken field. +func (r *mutationResolver) UpdatePersonalAccessToken(ctx context.Context, id string, input generated.UpdatePersonalAccessTokenInput) (*PersonalAccessTokenUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).PersonalAccessToken.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "personalaccesstoken"}, r.logger) + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags).AppendScopes(input.AppendScopes) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "personalaccesstoken"}, r.logger) + } + + return &PersonalAccessTokenUpdatePayload{ + PersonalAccessToken: res, + }, nil +} + +// DeletePersonalAccessToken is the resolver for the deletePersonalAccessToken field. +func (r *mutationResolver) DeletePersonalAccessToken(ctx context.Context, id string) (*PersonalAccessTokenDeletePayload, error) { + if err := withTransactionalMutation(ctx).PersonalAccessToken.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "personalaccesstoken"}, r.logger) + } + + if err := generated.PersonalAccessTokenEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &PersonalAccessTokenDeletePayload{ + DeletedID: id, + }, nil +} + +// PersonalAccessToken is the resolver for the personalAccessToken field. +func (r *queryResolver) PersonalAccessToken(ctx context.Context, id string) (*generated.PersonalAccessToken, error) { + res, err := withTransactionalMutation(ctx).PersonalAccessToken.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "personalaccesstoken"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/personalaccesstoken_test.go b/internal/graphapi/personalaccesstoken_test.go new file mode 100644 index 0000000..c83cc2c --- /dev/null +++ b/internal/graphapi/personalaccesstoken_test.go @@ -0,0 +1,451 @@ +package graphapi_test + +import ( + "context" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/pkg/openlaneclient" + + "github.com/theopenlane/core/pkg/testutils" +) + +const ( + notFoundErrorMsg = "personal_access_token not found" + redacted = "*****************************" +) + +func (suite *GraphTestSuite) TestQueryPersonalAccessToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // create user to get tokens + user := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx, err = userContextWithID(user.ID) + require.NoError(t, err) + + token := (&PersonalAccessTokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + queryID string + errorMsg string + }{ + { + name: "happy path pat", + queryID: token.ID, + }, + { + name: "not found", + queryID: "notfound", + errorMsg: notFoundErrorMsg, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := suite.client.api.GetPersonalAccessTokenByID(reqCtx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.PersonalAccessToken) + assert.Equal(t, redacted, resp.PersonalAccessToken.Token) + }) + } +} + +func (suite *GraphTestSuite) TestQueryPersonalAccessTokens() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + (&PersonalAccessTokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + // create user to get tokens + user := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx, err = userContextWithID(user.ID) + require.NoError(t, err) + + (&PersonalAccessTokenBuilder{client: suite.client}).MustNew(reqCtx, t) + (&PersonalAccessTokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + errorMsg string + }{ + { + name: "happy path, all pats", + }, + } + + for _, tc := range testCases { + t.Run("List "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := suite.client.api.GetAllPersonalAccessTokens(reqCtx) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + assert.Len(t, resp.PersonalAccessTokens.Edges, 2) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreatePersonalAccessToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // create user to get tokens + user2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + tokenDescription := gofakeit.Sentence(5) + expiration30Days := time.Now().Add(time.Hour * 24 * 30) + + testCases := []struct { + name string + input openlaneclient.CreatePersonalAccessTokenInput + errorMsg string + }{ + { + name: "happy path", + input: openlaneclient.CreatePersonalAccessTokenInput{ + Name: "forthethingz", + Description: &tokenDescription, + }, + }, + { + name: "happy path, set expire", + input: openlaneclient.CreatePersonalAccessTokenInput{ + Name: "forthethingz", + Description: &tokenDescription, + ExpiresAt: &expiration30Days, + }, + }, + { + name: "happy path, set org", + input: openlaneclient.CreatePersonalAccessTokenInput{ + Name: "forthethingz", + Description: &tokenDescription, + ExpiresAt: &expiration30Days, + OrganizationIDs: []string{org.ID, testPersonalOrgID}, + }, + }, + { + name: "happy path, name only", + input: openlaneclient.CreatePersonalAccessTokenInput{ + Name: "forthethingz", + }, + }, + { + name: "empty name", + input: openlaneclient.CreatePersonalAccessTokenInput{ + Description: &tokenDescription, + }, + errorMsg: "value is less than the required length", + }, + { + name: "setting other user id", + input: openlaneclient.CreatePersonalAccessTokenInput{ + OwnerID: user2.ID, // this should get ignored + Name: "forthethingz", + Description: &tokenDescription, + }, + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := suite.client.api.CreatePersonalAccessToken(reqCtx, tc.input) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreatePersonalAccessToken.PersonalAccessToken) + assert.Equal(t, resp.CreatePersonalAccessToken.PersonalAccessToken.Name, tc.input.Name) + assert.Equal(t, resp.CreatePersonalAccessToken.PersonalAccessToken.Description, tc.input.Description) + + // check expiration if set + if tc.input.ExpiresAt == nil { + assert.Empty(t, resp.CreatePersonalAccessToken.PersonalAccessToken.ExpiresAt) + } else { + assert.True(t, tc.input.ExpiresAt.Equal(*resp.CreatePersonalAccessToken.PersonalAccessToken.ExpiresAt)) + } + + // check organization is set if provided + if tc.input.OrganizationIDs != nil { + assert.Len(t, resp.CreatePersonalAccessToken.PersonalAccessToken.Organizations, len(tc.input.OrganizationIDs)) + + for _, orgID := range resp.CreatePersonalAccessToken.PersonalAccessToken.Organizations { + assert.Contains(t, tc.input.OrganizationIDs, orgID.ID) + } + } else { + assert.Len(t, resp.CreatePersonalAccessToken.PersonalAccessToken.Organizations, 0) + } + + // ensure the owner is the user that made the request + assert.Equal(t, testUser.ID, resp.CreatePersonalAccessToken.PersonalAccessToken.Owner.ID) + + // token should not be redacted on create + assert.NotEqual(t, redacted, resp.CreatePersonalAccessToken.PersonalAccessToken.Token) + + // ensure the token is prefixed + assert.Contains(t, resp.CreatePersonalAccessToken.PersonalAccessToken.Token, "dtmp_") + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdatePersonalAccessToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + // setup a token for another user + user2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + regCtx2, err := userContextWithID(user2.ID) + require.NoError(t, err) + tokenOther := (&PersonalAccessTokenBuilder{ + client: suite.client, + OwnerID: user2.ID}). + MustNew(regCtx2, t) + + token := (&PersonalAccessTokenBuilder{ + client: suite.client, + OwnerID: testUser.ID, + OrganizationIDs: []string{testPersonalOrgID}, + ExpiresAt: lo.ToPtr(time.Now().Add(time.Hour * 24 * 30))}). + MustNew(reqCtx, t) + + tokenDescription := gofakeit.Sentence(5) + tokenName := gofakeit.Word() + + testCases := []struct { + name string + tokenID string + input openlaneclient.UpdatePersonalAccessTokenInput + errorMsg string + }{ + { + name: "happy path, update name", + tokenID: token.ID, + input: openlaneclient.UpdatePersonalAccessTokenInput{ + Name: &tokenName, + }, + }, + { + name: "happy path, update description", + tokenID: token.ID, + input: openlaneclient.UpdatePersonalAccessTokenInput{ + Description: &tokenDescription, + }, + }, + { + name: "happy path, add org", + tokenID: token.ID, + input: openlaneclient.UpdatePersonalAccessTokenInput{ + AddOrganizationIDs: []string{org.ID}, + }, + }, + { + name: "happy path, remove org", + tokenID: token.ID, + input: openlaneclient.UpdatePersonalAccessTokenInput{ + RemoveOrganizationIDs: []string{org.ID}, + }, + }, + { + name: "invalid token id", + tokenID: "notvalidtoken", + input: openlaneclient.UpdatePersonalAccessTokenInput{ + Description: &tokenDescription, + }, + errorMsg: notFoundErrorMsg, + }, + { + name: "not authorized", + tokenID: tokenOther.ID, + input: openlaneclient.UpdatePersonalAccessTokenInput{ + Description: &tokenDescription, + }, + errorMsg: notFoundErrorMsg, + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := suite.client.api.UpdatePersonalAccessToken(reqCtx, tc.tokenID, tc.input) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdatePersonalAccessToken.PersonalAccessToken) + + if tc.input.Name != nil { + assert.Equal(t, resp.UpdatePersonalAccessToken.PersonalAccessToken.Name, *tc.input.Name) + } + + if tc.input.Description != nil { + assert.Equal(t, resp.UpdatePersonalAccessToken.PersonalAccessToken.Description, tc.input.Description) + } + + // make sure these fields did not get updated + if token.ExpiresAt != nil { + assert.WithinDuration(t, *token.ExpiresAt, *resp.UpdatePersonalAccessToken.PersonalAccessToken.ExpiresAt, 1*time.Second) + } else { + assert.Empty(t, resp.UpdatePersonalAccessToken.PersonalAccessToken.ExpiresAt) + } + + assert.Len(t, resp.UpdatePersonalAccessToken.PersonalAccessToken.Organizations, len(tc.input.AddOrganizationIDs)+1) + + // Ensure its removed + if tc.input.RemoveOrganizationIDs != nil { + assert.Len(t, resp.UpdatePersonalAccessToken.PersonalAccessToken.Organizations, 1) + } + + assert.Equal(t, testUser.ID, resp.UpdatePersonalAccessToken.PersonalAccessToken.Owner.ID) + + // token should be redacted on update + assert.Equal(t, redacted, resp.UpdatePersonalAccessToken.PersonalAccessToken.Token) + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeletePersonalAccessToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // token for another user + tokenOther := (&PersonalAccessTokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + // create user + user := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx, err = userContextWithID(user.ID) + require.NoError(t, err) + + token := (&PersonalAccessTokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + testCases := []struct { + name string + tokenID string + errorMsg string + }{ + { + name: "happy path, delete token", + tokenID: token.ID, + }, + { + name: "delete someone else's token, no go", + tokenID: tokenOther.ID, + errorMsg: notFoundErrorMsg, + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + resp, err := suite.client.api.DeletePersonalAccessToken(reqCtx, tc.tokenID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, tc.tokenID, resp.DeletePersonalAccessToken.DeletedID) + }) + } +} + +func (suite *GraphTestSuite) TestLastUsedPersonalAccessToken() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // create new personal access token + token := (&PersonalAccessTokenBuilder{client: suite.client}).MustNew(reqCtx, t) + + // check that the last used is empty + res, err := suite.client.api.GetPersonalAccessTokenByID(reqCtx, token.ID) + require.NoError(t, err) + assert.Empty(t, res.PersonalAccessToken.LastUsedAt) + + // setup graph client using the personal access token + authHeader := openlaneclient.Authorization{ + BearerToken: token.Token, + } + + graphClient, err := testutils.TestClientWithAuth(t, suite.client.db, openlaneclient.WithCredentials(authHeader)) + require.NoError(t, err) + + // get the token to make sure the last used is updated using the token + out, err := graphClient.GetPersonalAccessTokenByID(context.Background(), token.ID) + require.NoError(t, err) + assert.NotEmpty(t, out.PersonalAccessToken.LastUsedAt) +} diff --git a/internal/graphapi/resolver.go b/internal/graphapi/resolver.go new file mode 100644 index 0000000..2e483a1 --- /dev/null +++ b/internal/graphapi/resolver.go @@ -0,0 +1,233 @@ +package graphapi + +import ( + "context" + "fmt" + "net/http" + "time" + + "ariga.io/entcache" + "entgo.io/contrib/entgql" + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/handler/extension" + "github.com/99designs/gqlgen/graphql/handler/lru" + "github.com/99designs/gqlgen/graphql/handler/transport" + "github.com/alitto/pond" + "github.com/gorilla/websocket" + "github.com/ravilushqa/otelgqlgen" + echo "github.com/theopenlane/echox" + "github.com/vektah/gqlparser/v2/ast" + "github.com/wundergraph/graphql-go-tools/pkg/playground" + "go.uber.org/zap" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/events/soiree" +) + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +const ( + ActionGet = "get" + ActionUpdate = "update" + ActionDelete = "delete" + ActionCreate = "create" +) + +var ( + graphPath = "query" + playgroundPath = "playground" + + graphFullPath = fmt.Sprintf("/%s", graphPath) +) + +// Resolver provides a graph response resolver +type Resolver struct { + client *ent.Client + pool *soiree.PondPool + logger *zap.SugaredLogger + extensionsEnabled bool +} + +// NewResolver returns a resolver configured with the given ent client +func NewResolver(client *ent.Client) *Resolver { + return &Resolver{ + client: client, + } +} + +func (r Resolver) WithLogger(l *zap.SugaredLogger) *Resolver { + r.logger = l + + return &r +} + +func (r Resolver) WithExtensions(enabled bool) *Resolver { + r.extensionsEnabled = enabled + + return &r +} + +// Handler is an http handler wrapping a Resolver +type Handler struct { + r *Resolver + graphqlHandler *handler.Server + playground *playground.Playground + middleware []echo.MiddlewareFunc +} + +// Handler returns an http handler for a graph resolver +func (r *Resolver) Handler(withPlayground bool) *Handler { + srv := handler.NewDefaultServer( + NewExecutableSchema( + Config{ + Resolvers: r, + }, + ), + ) + + srv.AddTransport(transport.Websocket{ + KeepAlivePingInterval: 10 * time.Second, //nolint:mnd + Upgrader: websocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { + return true + }, + }, + }) + srv.AddTransport(transport.Options{}) + srv.AddTransport(transport.GET{}) + srv.AddTransport(transport.POST{}) + srv.AddTransport(transport.MultipartForm{}) + + srv.SetQueryCache(lru.New(1000)) //nolint:mnd + + srv.Use(extension.Introspection{}) + srv.Use(extension.AutomaticPersistedQuery{ + Cache: lru.New(100), //nolint:mnd + }) + + // add transactional db client + WithTransactions(srv, r.client) + + // add context level caching + WithContextLevelCache(srv) + + // add analytics + WithEvents(r.client) + + // add extensions if enabled + if r.extensionsEnabled { + AddAllExtensions(srv) + } + + srv.Use(otelgqlgen.Middleware()) + + h := &Handler{ + r: r, + graphqlHandler: srv, + } + + if withPlayground { + h.playground = playground.New(playground.Config{ + PathPrefix: "/", + PlaygroundPath: playgroundPath, + GraphqlEndpointPath: graphFullPath, + }) + } + + return h +} + +func WithEvents(c *ent.Client) { + // Add a global hook that runs on all types and all operations. + c.Use(func(next ent.Mutator) ent.Mutator { + return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { + retVal, err := next.Mutate(ctx, m) + if err != nil { + return retVal, err + } + + if TrackedEvent(m) { + CreateEvent(ctx, c, m, retVal) + } + + return retVal, nil + }) + }) +} + +// WithTransactions adds the transactioner to the ent db client +func WithTransactions(h *handler.Server, c *ent.Client) { + // setup transactional db client + h.AroundOperations(injectClient(c)) + h.Use(entgql.Transactioner{TxOpener: c}) +} + +// WithContextLevelCache adds a context level cache to the handler +func WithContextLevelCache(h *handler.Server) { + h.AroundResponses(func(ctx context.Context, next graphql.ResponseHandler) *graphql.Response { + if op := graphql.GetOperationContext(ctx).Operation; op != nil && op.Operation == ast.Query { + ctx = entcache.NewContext(ctx) + } + return next(ctx) + }) +} + +// WithSkipCache adds a skip cache middleware to the handler +// This is useful for testing, where you don't want to cache responses +// so you can see the changes immediately +func WithSkipCache(h *handler.Server) { + h.AroundResponses(func(ctx context.Context, next graphql.ResponseHandler) *graphql.Response { + return next(entcache.Skip(ctx)) + }) +} + +func (r *Resolver) WithPool(maxWorkers int, maxCapacity int, options ...pond.Option) { + // create the pool + r.pool = soiree.NewNamedPondPool(maxWorkers, maxCapacity, "graph", options...) + // add metrics + r.pool.NewStatsCollector() +} + +// Handler returns the http.HandlerFunc for the GraphAPI +func (h *Handler) Handler() http.HandlerFunc { + return h.graphqlHandler.ServeHTTP +} + +// Routes for the the server +func (h *Handler) Routes(e *echo.Group) { + e.Use(h.middleware...) + + // Create the default POST graph endpoint + e.POST("/"+graphPath, func(c echo.Context) error { + h.graphqlHandler.ServeHTTP(c.Response(), c.Request()) + return nil + }) + + // Create a GET query endpoint in order to create short queries with a query string + e.GET("/"+graphPath, func(c echo.Context) error { + h.graphqlHandler.ServeHTTP(c.Response(), c.Request()) + return nil + }) + + if h.playground != nil { + handlers, err := h.playground.Handlers() + if err != nil { + h.r.logger.Fatal("error configuring playground handlers", "error", err) + return + } + + for i := range handlers { + // with the function we need to dereference the handler so that it remains + // the same in the function below + hCopy := handlers[i].Handler + + e.GET(handlers[i].Path, func(c echo.Context) error { + hCopy.ServeHTTP(c.Response(), c.Request()) + return nil + }) + } + } +} diff --git a/internal/graphapi/search.go b/internal/graphapi/search.go new file mode 100644 index 0000000..fccb2c1 --- /dev/null +++ b/internal/graphapi/search.go @@ -0,0 +1,77 @@ +package graphapi + +import ( + "context" + "time" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/group" + "github.com/theopenlane/core/internal/ent/generated/organization" + "github.com/theopenlane/core/internal/ent/generated/orgmembership" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/user" +) + +var ( + maxSearchTime = time.Duration(30 * time.Second) +) + +// searchResult is a generic struct to hold the result of a search operation +type searchResult[T any] struct { + result T + err error +} + +// searchOrganizations searches for organizations based on the query string looking for matches in the name, description and display name +func searchOrganizations(ctx context.Context, query string) ([]*generated.Organization, error) { + return withTransactionalMutation(ctx).Organization.Query().Where( + organization.Or( + organization.NameContains(query), // search by name + organization.DescriptionContains(query), // search by description + organization.DisplayNameContains(query), // search by display name + ), + ).All(ctx) +} + +// searchGroups searches for groups based on the query string looking for matches in the name, description and display name +func searchGroups(ctx context.Context, query string) ([]*generated.Group, error) { + return withTransactionalMutation(ctx).Group.Query().Where( + group.Or( + group.NameContains(query), // search by name + group.DescriptionContains(query), // search by description + group.DisplayNameContains(query), // search by display name + ), + ).All(ctx) +} + +// searchUsers searches for org members based on the query string looking for matches in the email, display name, first name and last name +func searchUsers(ctx context.Context, query string) ([]*generated.User, error) { + members, err := withTransactionalMutation(ctx).OrgMembership.Query().Where( + orgmembership.Or( + orgmembership.HasUserWith(user.EmailContains(query)), // search by email + orgmembership.HasUserWith(user.DisplayNameContains(query)), // search by display name + orgmembership.HasUserWith(user.FirstNameContains(query)), // search by first name + orgmembership.HasUserWith(user.LastNameContains(query)), // search by last name + ), + ).WithUser().All(ctx) + + if members == nil || err != nil { + return nil, err + } + + users := make([]*generated.User, 0, len(members)) + for _, member := range members { + users = append(users, member.Edges.User) + } + + return users, err +} + +// searchSubscriber searches for subscribers based on the query string looking for matches in the email +func searchSubscriber(ctx context.Context, query string) ([]*generated.Subscriber, error) { + return withTransactionalMutation(ctx).Subscriber.Query().Where( + subscriber.Or( + subscriber.EmailContains(query), // search by email + ), + ).All(ctx) +} diff --git a/internal/graphapi/search.resolvers.go b/internal/graphapi/search.resolvers.go new file mode 100644 index 0000000..fe5611a --- /dev/null +++ b/internal/graphapi/search.resolvers.go @@ -0,0 +1,71 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated" +) + +// Search is the resolver for the search field. +func (r *queryResolver) Search(ctx context.Context, query string) (*GlobalSearchResultConnection, error) { + var ( + orgResults []*generated.Organization + orgErr error + + groupResults []*generated.Group + groupErr error + userResults []*generated.User + userErr error + subscriberResults []*generated.Subscriber + subscriberErr error + ) + + r.withPool().SubmitMultipleAndWait([]func(){ + func() { + orgResults, orgErr = searchOrganizations(ctx, query) + }, + func() { + groupResults, groupErr = searchGroups(ctx, query) + }, + func() { + userResults, userErr = searchUsers(ctx, query) + }, + func() { + subscriberResults, subscriberErr = searchSubscriber(ctx, query) + }, + }) + + // Check all errors and return a single error if any of the searches failed + if orgErr != nil || groupErr != nil || userErr != nil || subscriberErr != nil { + r.logger.Errorw("search failed", "error", + "org", orgErr, + "group", groupErr, + "user", userErr, + "subscriber", subscriberErr, + ) + + return nil, ErrSearchFailed + } + + // return the results + return &GlobalSearchResultConnection{ + Nodes: []GlobalSearchResult{ + OrganizationSearchResult{ + Organizations: orgResults, + }, + GroupSearchResult{ + Groups: groupResults, + }, + UserSearchResult{ + Users: userResults, + }, + SubscriberSearchResult{ + Subscribers: subscriberResults, + }, + }, + }, nil +} diff --git a/internal/graphapi/subscriber.resolvers.go b/internal/graphapi/subscriber.resolvers.go new file mode 100644 index 0000000..c7186c4 --- /dev/null +++ b/internal/graphapi/subscriber.resolvers.go @@ -0,0 +1,109 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/utils/rout" +) + +// CreateSubscriber is the resolver for the createSubscriber field. +func (r *mutationResolver) CreateSubscriber(ctx context.Context, input generated.CreateSubscriberInput) (*SubscriberCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + sub, err := withTransactionalMutation(ctx).Subscriber.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "subscriber"}, r.logger) + } + + return &SubscriberCreatePayload{Subscriber: sub}, nil +} + +// CreateBulkSubscriber is the resolver for the createBulkSubscriber field. +func (r *mutationResolver) CreateBulkSubscriber(ctx context.Context, input []*generated.CreateSubscriberInput) (*SubscriberBulkCreatePayload, error) { + return r.bulkCreateSubscriber(ctx, input) +} + +// CreateBulkCSVSubscriber is the resolver for the createBulkCSVSubscriber field. +func (r *mutationResolver) CreateBulkCSVSubscriber(ctx context.Context, input graphql.Upload) (*SubscriberBulkCreatePayload, error) { + subscriberInput, err := unmarshalBulkData[generated.CreateSubscriberInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateSubscriber(ctx, subscriberInput) +} + +// UpdateSubscriber is the resolver for the updateSubscriber field. +func (r *mutationResolver) UpdateSubscriber(ctx context.Context, email string, input generated.UpdateSubscriberInput) (*SubscriberUpdatePayload, error) { + subscriber, err := withTransactionalMutation(ctx).Subscriber.Query(). + Where( + subscriber.EmailEQ(email), + ).Only(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "subscriber"}, r.logger) + } + + if err := setOrganizationInAuthContext(ctx, &subscriber.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + subscriber, err = subscriber.Update().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "subscriber"}, r.logger) + } + + return &SubscriberUpdatePayload{Subscriber: subscriber}, nil +} + +// DeleteSubscriber is the resolver for the deleteSubscriber field. +func (r *mutationResolver) DeleteSubscriber(ctx context.Context, email string, ownerID *string) (*SubscriberDeletePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, ownerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + num, err := withTransactionalMutation(ctx).Subscriber.Delete(). + Where( + subscriber.EmailEQ(email), + ).Exec(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "subscriber"}, r.logger) + } + + if num == 0 { + return nil, ErrSubscriberNotFound + } + + return &SubscriberDeletePayload{Email: email}, nil +} + +// Subscriber is the resolver for the subscriber field. +func (r *queryResolver) Subscriber(ctx context.Context, email string) (*generated.Subscriber, error) { + subscriber, err := withTransactionalMutation(ctx).Subscriber.Query(). + Where( + subscriber.EmailEQ(email), + ).Only(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "subscriber"}, r.logger) + } + + return subscriber, nil +} diff --git a/internal/graphapi/subscriber_test.go b/internal/graphapi/subscriber_test.go new file mode 100644 index 0000000..f93e34f --- /dev/null +++ b/internal/graphapi/subscriber_test.go @@ -0,0 +1,464 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/openlaneclient" + mock_fga "github.com/theopenlane/iam/fgax/mockery" +) + +func (suite *GraphTestSuite) TestQuerySubscriber() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + subscriber := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx, t) + + // setup valid user context with another org + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx2, err := auth.NewTestContextWithOrgID(testUser.ID, org.ID) + require.NoError(t, err) + + sub := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx2, t) + + testCases := []struct { + name string + email string + client *openlaneclient.OpenLaneClient + ctx context.Context + shouldCheck bool + wantErr bool + }{ + { + name: "happy path", + email: subscriber.Email, + client: suite.client.api, + ctx: reqCtx, + shouldCheck: true, + wantErr: false, + }, + { + name: "happy path, using api token", + email: subscriber.Email, + client: suite.client.apiWithToken, + ctx: context.Background(), + shouldCheck: true, + wantErr: false, + }, + { + name: "happy path, using personal access token", + email: subscriber.Email, + client: suite.client.apiWithPAT, + ctx: context.Background(), + shouldCheck: true, + wantErr: false, + }, + { + name: "invalid email", + email: "beep@boop.com", + client: suite.client.api, + ctx: reqCtx, + shouldCheck: false, + wantErr: true, + }, + { + name: "subscriber for another org", + email: sub.Email, + client: suite.client.api, + ctx: reqCtx, + shouldCheck: false, + wantErr: true, + }, + { + name: "subscriber for another org using api token", + email: sub.Email, + client: suite.client.apiWithToken, + ctx: context.Background(), + shouldCheck: false, + wantErr: true, + }, + { + name: "subscriber for another org using personal access token", + email: sub.Email, + client: suite.client.apiWithPAT, + ctx: context.Background(), + shouldCheck: false, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.shouldCheck { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.GetSubscriberByEmail(tc.ctx, tc.email) + + if tc.wantErr { + require.Error(t, err) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Subscriber) + }) + } +} + +func (suite *GraphTestSuite) TestQuerySubscribers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + _ = (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx, t) + _ = (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx, t) + + // setup valid user context with another org + + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + reqCtx2, err := auth.NewTestContextWithOrgID(testUser.ID, org.ID) + require.NoError(t, err) + + _ = (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx2, t) + + testCases := []struct { + name string + client *openlaneclient.OpenLaneClient + ctx context.Context + numExpected int + check bool + }{ + { + name: "happy path, multiple subscribers", + client: suite.client.api, + ctx: reqCtx, + check: false, + numExpected: 2, + }, + { + name: "happy path, multiple subscribers using api token", + client: suite.client.apiWithToken, + ctx: context.Background(), + check: false, + numExpected: 2, + }, + { + name: "happy path, multiple subscribers using personal access token", + client: suite.client.apiWithPAT, + ctx: context.Background(), + check: false, + numExpected: 2, + }, + { + name: "happy path, one subscriber", + client: suite.client.api, + ctx: reqCtx2, + check: true, + numExpected: 1, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // TODO (sfunk): this is because of 1 vs multiple returned, look at the filter check + if tc.check { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.GetAllSubscribers(tc.ctx) + + require.NoError(t, err) + require.NotNil(t, resp) + require.Len(t, resp.Subscribers.Edges, tc.numExpected) + }) + } +} + +func (suite *GraphTestSuite) TestMutationCreateSubscriber() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + testCases := []struct { + name string + email string + ownerID string + client *openlaneclient.OpenLaneClient + ctx context.Context + wantErr bool + }{ + { + name: "happy path, new subscriber", + email: "c.stark@example.com", + client: suite.client.api, + ctx: reqCtx, + wantErr: false, + }, + { + name: "happy path, new subscriber using api token", + email: "e.stark@example.com", + client: suite.client.apiWithToken, + ctx: context.Background(), + wantErr: false, + }, + { + name: "happy path, new subscriber using personal access token", + email: "a.stark@example.com", + ownerID: testOrgID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + wantErr: false, + }, + { + name: "missing email", + client: suite.client.api, + ctx: reqCtx, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, true) + + input := openlaneclient.CreateSubscriberInput{ + Email: tc.email, + } + + if tc.ownerID != "" { + input.OwnerID = &tc.ownerID + } + + resp, err := tc.client.CreateSubscriber(tc.ctx, input) + + if tc.wantErr { + require.Error(t, err) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + + // Assert matching fields + assert.Equal(t, tc.email, resp.CreateSubscriber.Subscriber.Email) + + }) + } +} + +func (suite *GraphTestSuite) TestUpdateSubscriber() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + subscriber := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx, t) + + // setup valid user context with another org + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx2, err := auth.NewTestContextWithOrgID(testUser.ID, org.ID) + require.NoError(t, err) + + sub := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx2, t) + + testCases := []struct { + name string + email string + updateInput openlaneclient.UpdateSubscriberInput + client *openlaneclient.OpenLaneClient + ctx context.Context + shouldCheck bool + wantErr bool + }{ + { + name: "happy path", + email: subscriber.Email, + updateInput: openlaneclient.UpdateSubscriberInput{ + PhoneNumber: lo.ToPtr("+1-555-867-5309"), + }, + client: suite.client.api, + ctx: reqCtx, + wantErr: false, + }, + { + name: "happy path, using api token", + email: subscriber.Email, + updateInput: openlaneclient.UpdateSubscriberInput{ + PhoneNumber: lo.ToPtr("+1-555-867-5310"), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + wantErr: false, + }, + { + name: "happy path, using personal access token", + email: subscriber.Email, + updateInput: openlaneclient.UpdateSubscriberInput{ + PhoneNumber: lo.ToPtr("+1-555-867-5311"), + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + wantErr: false, + }, + { + name: "invalid email", + email: "beep@boop.com", + updateInput: openlaneclient.UpdateSubscriberInput{ + PhoneNumber: lo.ToPtr("+1-555-867-5309"), + }, + client: suite.client.api, + ctx: reqCtx, + wantErr: true, + }, + { + name: "subscriber for another org", + email: sub.Email, + updateInput: openlaneclient.UpdateSubscriberInput{ + PhoneNumber: lo.ToPtr("+1-555-867-5309"), + }, + client: suite.client.api, + ctx: reqCtx, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if !tc.wantErr { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := tc.client.UpdateSubscriber(tc.ctx, tc.email, tc.updateInput) + + if tc.wantErr { + require.Error(t, err) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, tc.email, resp.UpdateSubscriber.Subscriber.Email) + + if tc.updateInput.PhoneNumber != nil { + require.Equal(t, tc.updateInput.PhoneNumber, resp.UpdateSubscriber.Subscriber.PhoneNumber) + } + }) + } +} + +func (suite *GraphTestSuite) TestDeleteSubscriber() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + subscriber1 := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx, t) + subscriber2 := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx, t) + subscriber3 := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx, t) + + // setup valid user context with another org + org := (&OrganizationBuilder{client: suite.client}).MustNew(reqCtx, t) + + reqCtx2, err := auth.NewTestContextWithOrgID(testUser.ID, org.ID) + require.NoError(t, err) + + sub := (&SubscriberBuilder{client: suite.client}).MustNew(reqCtx2, t) + + testCases := []struct { + name string + email string + organizationID string + client *openlaneclient.OpenLaneClient + ctx context.Context + wantErr bool + }{ + { + name: "happy path", + email: subscriber1.Email, + client: suite.client.api, + ctx: reqCtx, + wantErr: false, + }, + { + name: "happy path, using api token", + email: subscriber2.Email, + client: suite.client.apiWithToken, + ctx: context.Background(), + wantErr: false, + }, + { + name: "happy path, using personal access token", + email: subscriber3.Email, + organizationID: testOrgID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + wantErr: false, + }, + { + name: "invalid email", + email: "beep@boop.com", + client: suite.client.api, + ctx: reqCtx, + wantErr: true, + }, + { + name: "subscriber for another org", + email: sub.Email, + client: suite.client.api, + ctx: reqCtx, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + mock_fga.CheckAny(t, suite.client.fga, true) + + resp, err := tc.client.DeleteSubscriber(tc.ctx, tc.email, &tc.organizationID) + + if tc.wantErr { + require.Error(t, err) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, tc.email, resp.DeleteSubscriber.Email) + }) + } +} diff --git a/internal/graphapi/template.resolvers.go b/internal/graphapi/template.resolvers.go new file mode 100644 index 0000000..f96870e --- /dev/null +++ b/internal/graphapi/template.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateTemplate is the resolver for the createTemplate field. +func (r *mutationResolver) CreateTemplate(ctx context.Context, input generated.CreateTemplateInput) (*TemplateCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Template.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "template"}, r.logger) + } + + return &TemplateCreatePayload{ + Template: res, + }, nil +} + +// CreateBulkTemplate is the resolver for the createBulkTemplate field. +func (r *mutationResolver) CreateBulkTemplate(ctx context.Context, input []*generated.CreateTemplateInput) (*TemplateBulkCreatePayload, error) { + return r.bulkCreateTemplate(ctx, input) +} + +// CreateBulkCSVTemplate is the resolver for the createBulkCSVTemplate field. +func (r *mutationResolver) CreateBulkCSVTemplate(ctx context.Context, input graphql.Upload) (*TemplateBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateTemplateInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateTemplate(ctx, data) +} + +// UpdateTemplate is the resolver for the updateTemplate field. +func (r *mutationResolver) UpdateTemplate(ctx context.Context, id string, input generated.UpdateTemplateInput) (*TemplateUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Template.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "template"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "template"}, r.logger) + } + + return &TemplateUpdatePayload{ + Template: res, + }, nil +} + +// DeleteTemplate is the resolver for the deleteTemplate field. +func (r *mutationResolver) DeleteTemplate(ctx context.Context, id string) (*TemplateDeletePayload, error) { + if err := withTransactionalMutation(ctx).Template.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "template"}, r.logger) + } + + if err := generated.TemplateEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &TemplateDeletePayload{ + DeletedID: id, + }, nil +} + +// Template is the resolver for the template field. +func (r *queryResolver) Template(ctx context.Context, id string) (*generated.Template, error) { + res, err := withTransactionalMutation(ctx).Template.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "template"}, r.logger) + } + + return res, nil +} diff --git a/internal/graphapi/tfasetting.resolvers.go b/internal/graphapi/tfasetting.resolvers.go new file mode 100644 index 0000000..ee8de61 --- /dev/null +++ b/internal/graphapi/tfasetting.resolvers.go @@ -0,0 +1,86 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/tfasetting" + "github.com/theopenlane/core/pkg/auth" +) + +// CreateTFASetting is the resolver for the createTFASetting field. +func (r *mutationResolver) CreateTFASetting(ctx context.Context, input generated.CreateTFASettingInput) (*TFASettingCreatePayload, error) { + if err := checkAllowedAuthType(ctx); err != nil { + return nil, err + } + + settings, err := withTransactionalMutation(ctx).TFASetting.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "tfasetting"}, r.logger) + } + + return &TFASettingCreatePayload{TfaSetting: settings}, nil +} + +// UpdateTFASetting is the resolver for the updateTFASetting field. +func (r *mutationResolver) UpdateTFASetting(ctx context.Context, input generated.UpdateTFASettingInput) (*TFASettingUpdatePayload, error) { + if err := checkAllowedAuthType(ctx); err != nil { + return nil, err + } + + // get the userID from the context + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return nil, err + } + + settings, err := withTransactionalMutation(ctx).TFASetting.Query().Where(tfasetting.OwnerID(userID)).Only(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "tfasetting"}, r.logger) + } + + settings, err = settings.Update().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "tfasetting"}, r.logger) + } + + return &TFASettingUpdatePayload{TfaSetting: settings}, nil +} + +// TfaSetting is the resolver for the tfaSettings field. +func (r *queryResolver) TfaSetting(ctx context.Context, id *string) (*generated.TFASetting, error) { + if err := checkAllowedAuthType(ctx); err != nil { + return nil, err + } + + // get the userID from the context + userID, err := auth.GetUserIDFromContext(ctx) + if err != nil { + return nil, err + } + + if id != nil && *id != "" { + settings, err := withTransactionalMutation(ctx).TFASetting.Get(ctx, *id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "tfasetting"}, r.logger) + } + + return settings, nil + } + + settings, err := withTransactionalMutation(ctx).TFASetting.Query().Where(tfasetting.OwnerID(userID)).Only(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "tfasetting"}, r.logger) + } + + return settings, nil +} + +// RegenBackupCodes is the resolver for the regenBackupCodes field. +func (r *updateTFASettingInputResolver) RegenBackupCodes(ctx context.Context, obj *generated.UpdateTFASettingInput, data *bool) error { + return nil +} diff --git a/internal/graphapi/tfasetting_test.go b/internal/graphapi/tfasetting_test.go new file mode 100644 index 0000000..91bbcc8 --- /dev/null +++ b/internal/graphapi/tfasetting_test.go @@ -0,0 +1,266 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/utils/rout" +) + +func (suite *GraphTestSuite) TestQueryTFASetting() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + (&TFASettingBuilder{client: suite.client}).MustNew(reqCtx, t, testUser.ID) + + user2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + user2Ctx, err := userContextWithID(user2.ID) + require.NoError(t, err) + + testCases := []struct { + name string + userID string + client *openlaneclient.OpenLaneClient + ctx context.Context + errorMsg string + }{ + { + name: "happy path user", + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path, using personal access token", + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "valid user, but not auth", + client: suite.client.api, + ctx: user2Ctx, + errorMsg: "tfa_setting not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetTFASetting(tc.ctx) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + }) + } + + (&UserCleanup{client: suite.client, ID: user2.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestMutationCreateTFASetting() { + t := suite.T() + + // setup user context + ctx, err := userContext() + require.NoError(t, err) + + user := (&UserBuilder{client: suite.client}).MustNew(ctx, t) + require.NoError(t, err) + + // setup valid user context + reqCtx, err := userContextWithID(user.ID) + require.NoError(t, err) + + testCases := []struct { + name string + userID string + input openlaneclient.CreateTFASettingInput + client *openlaneclient.OpenLaneClient + ctx context.Context + errMsg string + }{ + { + name: "happy path", + userID: user.ID, + input: openlaneclient.CreateTFASettingInput{ + TotpAllowed: lo.ToPtr(true), + }, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "happy path, using personal access token", + userID: testUser.ID, + input: openlaneclient.CreateTFASettingInput{ + TotpAllowed: lo.ToPtr(true), + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "unable to create using api token", + userID: testUser.ID, + input: openlaneclient.CreateTFASettingInput{ + TotpAllowed: lo.ToPtr(true), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + errMsg: rout.ErrBadRequest.Error(), + }, + { + name: "already exists", + userID: user.ID, + input: openlaneclient.CreateTFASettingInput{ + TotpAllowed: lo.ToPtr(true), + }, + client: suite.client.api, + ctx: reqCtx, + errMsg: "tfasetting already exists", + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + // create tfa setting for user + resp, err := tc.client.CreateTFASetting(tc.ctx, tc.input) + + if tc.errMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreateTFASetting.TfaSetting) + + // Make sure provided values match + assert.Equal(t, tc.input.TotpAllowed, resp.CreateTFASetting.TfaSetting.TotpAllowed) + assert.Empty(t, resp.CreateTFASetting.TfaSetting.RecoveryCodes) + assert.Equal(t, tc.userID, resp.CreateTFASetting.TfaSetting.Owner.ID) + + // make sure user setting was not updated + userSetting, err := user.Setting(ctx) + require.NoError(t, err) + + assert.False(t, userSetting.IsTfaEnabled) + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateTFASetting() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + (&TFASettingBuilder{client: suite.client}).MustNew(reqCtx, t, testUser.ID) + + recoveryCodes := []string{} + + testCases := []struct { + name string + input openlaneclient.UpdateTFASettingInput + client *openlaneclient.OpenLaneClient + ctx context.Context + errMsg string + }{ + { + name: "update verify", + input: openlaneclient.UpdateTFASettingInput{ + Verified: lo.ToPtr(true), + }, + client: suite.client.api, + ctx: reqCtx, + }, + { + name: "regen codes using personal access token", + input: openlaneclient.UpdateTFASettingInput{ + RegenBackupCodes: lo.ToPtr(true), + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + }, + { + name: "regen codes using api token not allowed", + input: openlaneclient.UpdateTFASettingInput{ + RegenBackupCodes: lo.ToPtr(true), + }, + client: suite.client.apiWithToken, + ctx: context.Background(), + errMsg: rout.ErrBadRequest.Error(), + }, + { + name: "regen codes - false", + input: openlaneclient.UpdateTFASettingInput{ + RegenBackupCodes: lo.ToPtr(false), + }, + client: suite.client.api, + ctx: reqCtx, + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // update tfa settings + resp, err := tc.client.UpdateTFASetting(tc.ctx, tc.input) + + if tc.errMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateTFASetting.TfaSetting) + + // Make sure provided values match + assert.NotEmpty(t, resp.UpdateTFASetting.TfaSetting.RecoveryCodes) + + // backup codes should only be regenerated on explicit request + if tc.input.RegenBackupCodes != nil { + if *tc.input.RegenBackupCodes { + assert.NotEqual(t, recoveryCodes, resp.UpdateTFASetting.TfaSetting.RecoveryCodes) + } else { + assert.Equal(t, recoveryCodes, resp.UpdateTFASetting.TfaSetting.RecoveryCodes) + } + } + + // make sure user setting was not updated + userSettings, err := tc.client.GetAllUserSettings(tc.ctx) + require.NoError(t, err) + require.Len(t, userSettings.UserSettings.Edges, 1) + + if resp.UpdateTFASetting.TfaSetting.Verified { + assert.True(t, *userSettings.UserSettings.Edges[0].Node.IsTfaEnabled) + } + + // set at the end so we can compare later + recoveryCodes = resp.UpdateTFASetting.TfaSetting.RecoveryCodes + }) + } +} diff --git a/internal/graphapi/tools_test.go b/internal/graphapi/tools_test.go new file mode 100644 index 0000000..26b8c28 --- /dev/null +++ b/internal/graphapi/tools_test.go @@ -0,0 +1,252 @@ +package graphapi_test + +import ( + "bufio" + "bytes" + "context" + "log" + "path/filepath" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/theopenlane/iam/fgax" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + + "github.com/theopenlane/core/internal/ent/entconfig" + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/entdb" + "github.com/theopenlane/core/pkg/analytics" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/testutils" + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/totp" + "github.com/theopenlane/utils/ulids" +) + +var ( + testUser *ent.User + testPersonalOrgID string + testOrgID string +) + +// TestGraphTestSuite runs all the tests in the GraphTestSuite +func TestGraphTestSuite(t *testing.T) { + suite.Run(t, new(GraphTestSuite)) +} + +// GraphTestSuite handles the setup and teardown between tests +type GraphTestSuite struct { + suite.Suite + client *client + tf *testutils.TestFixture +} + +// client contains all the clients the test need to interact with +type client struct { + db *ent.Client + api *openlaneclient.OpenLaneClient + apiWithPAT *openlaneclient.OpenLaneClient + apiWithToken *openlaneclient.OpenLaneClient + fga *mock_fga.MockSdkClient +} + +func (suite *GraphTestSuite) SetupSuite() { + suite.tf = entdb.NewTestFixture() +} + +func (suite *GraphTestSuite) SetupTest() { + t := suite.T() + + ctx := context.Background() + + // setup fga mock + c := &client{ + fga: mock_fga.NewMockSdkClient(t), + } + + // create mock FGA client + fc := fgax.NewMockFGAClient(t, c.fga) + + // setup logger + logger := zap.NewNop().Sugar() + + // setup email manager + emConfig := emails.Config{ + Testing: true, + Archive: filepath.Join("fixtures", "emails"), + FromEmail: "mitb@theopenlane.io", + } + + em, err := emails.New(emConfig) + if err != nil { + t.Fatal("error creating email manager") + } + + // setup task manager + tmConfig := marionette.Config{} + + taskMan := marionette.New(tmConfig) + + taskMan.Start() + + // setup otp manager + otpOpts := []totp.ConfigOption{ + totp.WithCodeLength(6), + totp.WithIssuer("theopenlane"), + totp.WithSecret(totp.Secret{ + Version: 0, + Key: ulids.New().String(), + }), + } + + tm, err := testutils.CreateTokenManager(15 * time.Minute) //nolint:mnd + if err != nil { + t.Fatal("error creating token manager") + } + + sm := testutils.CreateSessionManager() + rc := testutils.NewRedisClient() + + sessionConfig := sessions.NewSessionConfig( + sm, + sessions.WithPersistence(rc), + sessions.WithLogger(logger), + ) + + sessionConfig.CookieConfig = &sessions.DebugOnlyCookieConfig + + otpMan := totp.NewOTP(otpOpts...) + + opts := []ent.Option{ + ent.Logger(*logger), + ent.Authz(*fc), + ent.Emails(em), + ent.Marionette(taskMan), + ent.Analytics(&analytics.EventManager{Enabled: false}), + ent.TOTP(&totp.Manager{ + TOTPManager: otpMan, + }), + ent.TokenManager(tm), + ent.SessionConfig(&sessionConfig), + ent.EntConfig(&entconfig.Config{ + EntityTypes: []string{"vendor"}, + Flags: entconfig.Flags{ + UseListUserService: false, + UseListObjectService: false, + }, + }), + } + + // create database connection + db, err := entdb.NewTestClient(ctx, suite.tf, opts) + require.NoError(t, err, "failed opening connection to database") + + // assign values + c.db = db + c.api, err = testutils.TestClient(t, c.db) + require.NoError(t, err) + + // create test user + ctx = echocontext.NewTestContext() + testUser = (&UserBuilder{client: c}).MustNew(ctx, t) + testPersonalOrg, err := testUser.Edges.Setting.DefaultOrg(ctx) + require.NoError(t, err) + + testPersonalOrgID = testPersonalOrg.ID + + userCtx, err := auth.NewTestContextWithOrgID(testUser.ID, testPersonalOrgID) + require.NoError(t, err) + + // setup a non-personal org + testOrg := (&OrganizationBuilder{client: c}).MustNew(userCtx, t) + testOrgID = testOrg.ID + + userCtx, err = userContext() + require.NoError(t, err) + + // setup client with a personal access token + pat := (&PersonalAccessTokenBuilder{client: c, OwnerID: testUser.ID, OrganizationIDs: []string{testOrgID, testPersonalOrgID}}).MustNew(userCtx, t) + authHeaderPAT := openlaneclient.Authorization{ + BearerToken: pat.Token, + } + + c.apiWithPAT, err = testutils.TestClientWithAuth(t, c.db, openlaneclient.WithCredentials(authHeaderPAT)) + require.NoError(t, err) + + // setup client with an API token + apiToken := (&APITokenBuilder{client: c}).MustNew(userCtx, t) + + authHeaderAPIToken := openlaneclient.Authorization{ + BearerToken: apiToken.Token, + } + c.apiWithToken, err = testutils.TestClientWithAuth(t, c.db, openlaneclient.WithCredentials(authHeaderAPIToken)) + require.NoError(t, err) + + suite.client = c +} + +func (suite *GraphTestSuite) TearDownTest() { + // clear all fga mocks + mock_fga.ClearMocks(suite.client.fga) + + if suite.client.db != nil { + if err := suite.client.db.Close(); err != nil { + log.Fatalf("failed to close database: %s", err) + } + } +} + +func (suite *GraphTestSuite) TearDownSuite() { + testutils.TeardownFixture(suite.tf) +} + +// userContext creates a new user in the database and returns a context with +// the user claims attached +func userContext() (context.Context, error) { + return auth.NewTestContextWithOrgID(testUser.ID, testOrgID) +} + +// userContextWithID creates a new user context with the provided user ID +func userContextWithID(userID string) (context.Context, error) { + // Use that user to create the organization + ec, err := auth.NewTestEchoContextWithValidUser(userID) + if err != nil { + return nil, err + } + + reqCtx := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec) + + ec.SetRequest(ec.Request().WithContext(reqCtx)) + + return reqCtx, nil +} + +func (suite *GraphTestSuite) captureOutput(funcToRun func()) string { + var buffer bytes.Buffer + + oldLogger := suite.client.db.Logger + encoder := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig()) + writer := bufio.NewWriter(&buffer) + + logger := zap.New( + zapcore.NewCore(encoder, zapcore.AddSync(writer), zapcore.DebugLevel)). + Sugar() + + suite.client.db.Logger = *logger + + funcToRun() + writer.Flush() + + suite.client.db.Logger = oldLogger + + return buffer.String() +} diff --git a/internal/graphapi/user.resolvers.go b/internal/graphapi/user.resolvers.go new file mode 100644 index 0000000..07e1a22 --- /dev/null +++ b/internal/graphapi/user.resolvers.go @@ -0,0 +1,65 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + "errors" + + "github.com/theopenlane/core/internal/ent/generated" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/pkg/auth" +) + +// CreateUser is the resolver for the createUser field. +func (r *mutationResolver) CreateUser(ctx context.Context, input generated.CreateUserInput) (*UserCreatePayload, error) { + // TODO: look at allowing this resolver to invite the user instead of creating them directly + // for now, return permission denied + return nil, ErrPermissionDenied +} + +// UpdateUser is the resolver for the updateUser field. +func (r *mutationResolver) UpdateUser(ctx context.Context, id string, input generated.UpdateUserInput) (*UserUpdatePayload, error) { + user, err := withTransactionalMutation(ctx).User.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "user"}, r.logger) + } + + user, err = user.Update().SetInput(input).Save(ctx) + if err != nil { + // the password field is encrypted so we cannot use the + // built in validation function/validation error + if errors.Is(err, auth.ErrPasswordTooWeak) { + return nil, err + } + + return nil, parseRequestError(err, action{action: ActionUpdate, object: "user"}, r.logger) + } + + return &UserUpdatePayload{User: user}, nil +} + +// DeleteUser is the resolver for the deleteUser field. +func (r *mutationResolver) DeleteUser(ctx context.Context, id string) (*UserDeletePayload, error) { + if err := withTransactionalMutation(ctx).User.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "user"}, r.logger) + } + + if err := generated.UserEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &UserDeletePayload{DeletedID: id}, nil +} + +// User is the resolver for the user field. +func (r *queryResolver) User(ctx context.Context, id string) (*generated.User, error) { + user, err := withTransactionalMutation(ctx).User.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "user"}, r.logger) + } + + return user, nil +} diff --git a/internal/graphapi/user_test.go b/internal/graphapi/user_test.go new file mode 100644 index 0000000..d8f6f75 --- /dev/null +++ b/internal/graphapi/user_test.go @@ -0,0 +1,488 @@ +package graphapi_test + +import ( + "testing" + + "github.com/brianvoe/gofakeit/v7" + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/theopenlane/entx" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/graphapi" + auth "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *GraphTestSuite) TestQueryUser() { + t := suite.T() + + // setup user context + ctx, err := userContext() + require.NoError(t, err) + + user1 := (&UserBuilder{client: suite.client}).MustNew(ctx, t) + user2 := (&UserBuilder{client: suite.client}).MustNew(ctx, t) + + // setup valid user context + reqCtx, err := auth.NewTestContextWithOrgID(user1.ID, user1.Edges.Setting.Edges.DefaultOrg.ID) + require.NoError(t, err) + + testCases := []struct { + name string + queryID string + expected *ent.User + errorMsg string + }{ + { + name: "happy path user", + queryID: user1.ID, + expected: user1, + }, + { + name: "valid user, but no auth", + queryID: user2.ID, + errorMsg: "user not found", + }, + { + name: "invalid-id", + queryID: "tacos-for-dinner", + errorMsg: "user not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + // mock check calls + mock_fga.CheckAny(t, suite.client.fga, true) + } + + resp, err := suite.client.api.GetUserByID(reqCtx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.User) + }) + } + + (&UserCleanup{client: suite.client, ID: user1.ID}).MustDelete(reqCtx, t) + (&UserCleanup{client: suite.client, ID: user2.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestQueryUsers() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + user1 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + user2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + t.Run("Get Users", func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := suite.client.api.GetAllUsers(reqCtx) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Users.Edges) + + // make sure only the current user is returned + assert.Equal(t, len(resp.Users.Edges), 1) + + // setup valid user context + reqCtx, err := userContextWithID(user1.ID) + require.NoError(t, err) + + resp, err = suite.client.api.GetAllUsers(reqCtx) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.Users.Edges) + + // only user that is making the request should be returned + assert.Equal(t, len(resp.Users.Edges), 1) + + user1Found := false + user2Found := false + + for _, o := range resp.Users.Edges { + if o.Node.ID == user1.ID { + user1Found = true + } else if o.Node.ID == user2.ID { + user2Found = true + } + } + + // only user 1 should be found + if !user1Found { + t.Errorf("user 1 was expected to be found but was not") + } + + // user 2 should not be found + if user2Found { + t.Errorf("user 2 was not expected to be found but was returned") + } + }) +} +func (suite *GraphTestSuite) TestMutationCreateUser() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + // weakPassword := "notsecure" + strongPassword := "my&supers3cr3tpassw0rd!" + + testCases := []struct { + name string + userInput openlaneclient.CreateUserInput + errorMsg string + }{ + { + name: "no auth create user", + userInput: openlaneclient.CreateUserInput{ + FirstName: lo.ToPtr(gofakeit.FirstName()), + LastName: lo.ToPtr(gofakeit.LastName()), + DisplayName: gofakeit.LetterN(50), + Email: gofakeit.Email(), + Password: &strongPassword, + }, + errorMsg: graphapi.ErrPermissionDenied.Error(), + }, + } + + for _, tc := range testCases { + t.Run("Create "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + // mock writes to create personal org membership + mock_fga.WriteAny(t, suite.client.fga) + } + + resp, err := suite.client.api.CreateUser(reqCtx, tc.userInput) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.CreateUser.User) + + // Make sure provided values match + assert.Equal(t, tc.userInput.FirstName, resp.CreateUser.User.FirstName) + assert.Equal(t, tc.userInput.LastName, resp.CreateUser.User.LastName) + assert.Equal(t, tc.userInput.Email, resp.CreateUser.User.Email) + + // display name defaults to email if not provided + if tc.userInput.DisplayName == "" { + assert.Equal(t, tc.userInput.Email, resp.CreateUser.User.DisplayName) + } else { + assert.Equal(t, tc.userInput.DisplayName, resp.CreateUser.User.DisplayName) + } + + // ensure a user setting was created + assert.NotNil(t, resp.CreateUser.User.Setting) + + // ensure personal org is created + // default org will always be the personal org when the user is first created + personalOrgID := resp.CreateUser.User.Setting.DefaultOrg.ID + + org, err := suite.client.api.GetOrganizationByID(reqCtx, personalOrgID, nil) + require.NoError(t, err) + assert.Equal(t, personalOrgID, org.Organization.ID) + assert.True(t, *org.Organization.PersonalOrg) + }) + } +} + +func (suite *GraphTestSuite) TestMutationUpdateUser() { + t := suite.T() + + // setup user context + ctx, err := userContext() + require.NoError(t, err) + + firstNameUpdate := gofakeit.FirstName() + lastNameUpdate := gofakeit.LastName() + emailUpdate := gofakeit.Email() + displayNameUpdate := gofakeit.LetterN(40) + nameUpdateLong := gofakeit.LetterN(200) + + user := (&UserBuilder{client: suite.client}).MustNew(ctx, t) + + // setup valid user context + reqCtx, err := auth.NewTestContextWithOrgID(user.ID, user.Edges.Setting.Edges.DefaultOrg.ID) + require.NoError(t, err) + + weakPassword := "notsecure" + + testCases := []struct { + name string + updateInput openlaneclient.UpdateUserInput + expectedRes openlaneclient.UpdateUser_UpdateUser_User + errorMsg string + }{ + { + name: "update first name and password, happy path", + updateInput: openlaneclient.UpdateUserInput{ + FirstName: &firstNameUpdate, + }, + expectedRes: openlaneclient.UpdateUser_UpdateUser_User{ + ID: user.ID, + FirstName: &firstNameUpdate, + LastName: &user.LastName, + DisplayName: user.DisplayName, + Email: user.Email, + }, + }, + { + name: "update last name, happy path", + updateInput: openlaneclient.UpdateUserInput{ + LastName: &lastNameUpdate, + }, + expectedRes: openlaneclient.UpdateUser_UpdateUser_User{ + ID: user.ID, + FirstName: &firstNameUpdate, // this would have been updated on the prior test + LastName: &lastNameUpdate, + DisplayName: user.DisplayName, + Email: user.Email, + }, + }, + { + name: "update email, happy path", + updateInput: openlaneclient.UpdateUserInput{ + Email: &emailUpdate, + }, + expectedRes: openlaneclient.UpdateUser_UpdateUser_User{ + ID: user.ID, + FirstName: &firstNameUpdate, + LastName: &lastNameUpdate, // this would have been updated on the prior test + DisplayName: user.DisplayName, + Email: emailUpdate, + }, + }, + { + name: "update display name, happy path", + updateInput: openlaneclient.UpdateUserInput{ + DisplayName: &displayNameUpdate, + }, + expectedRes: openlaneclient.UpdateUser_UpdateUser_User{ + ID: user.ID, + FirstName: &firstNameUpdate, + LastName: &lastNameUpdate, + DisplayName: displayNameUpdate, + Email: emailUpdate, // this would have been updated on the prior test + }, + }, + { + name: "update name, too long", + updateInput: openlaneclient.UpdateUserInput{ + FirstName: &nameUpdateLong, + }, + errorMsg: "value is greater than the required length", + }, + { + name: "update with weak password", + updateInput: openlaneclient.UpdateUserInput{ + Password: &weakPassword, + }, + errorMsg: auth.ErrPasswordTooWeak.Error(), + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + } + + // update user + resp, err := suite.client.api.UpdateUser(reqCtx, user.ID, tc.updateInput) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateUser.User) + + // Make sure provided values match + updatedUser := resp.GetUpdateUser().User + assert.Equal(t, tc.expectedRes.FirstName, updatedUser.FirstName) + assert.Equal(t, tc.expectedRes.LastName, updatedUser.LastName) + assert.Equal(t, tc.expectedRes.DisplayName, updatedUser.DisplayName) + assert.Equal(t, tc.expectedRes.Email, updatedUser.Email) + }) + } +} + +func (suite *GraphTestSuite) TestMutationDeleteUser() { + t := suite.T() + + // setup user context + ctx, err := userContext() + require.NoError(t, err) + + // bypass auth on object creation + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + user := (&UserBuilder{client: suite.client}).MustNew(ctx, t) + + userSetting := user.Edges.Setting + + // personal org will be the default org when the user is created + personalOrgID := user.Edges.Setting.Edges.DefaultOrg.ID + + // setup valid user context + reqCtx, err := auth.NewTestContextWithOrgID(user.ID, personalOrgID) + require.NoError(t, err) + + testCases := []struct { + name string + userID string + errorMsg string + }{ + { + name: "delete user, happy path", + userID: user.ID, + }, + { + name: "delete user, not found", + userID: "tacos-tuesday", + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run("Delete "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // mock check calls + if tc.errorMsg == "" { + mock_fga.CheckAny(t, suite.client.fga, true) + + mock_fga.WriteAny(t, suite.client.fga) + } + + // delete user + resp, err := suite.client.api.DeleteUser(reqCtx, tc.userID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.DeleteUser.DeletedID) + + // make sure the personal org is deleted + org, err := suite.client.api.GetOrganizationByID(reqCtx, personalOrgID) + require.Nil(t, org) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + + // make sure the deletedID matches the ID we wanted to delete + assert.Equal(t, tc.userID, resp.DeleteUser.DeletedID) + + // make sure the user setting is deleted + out, err := suite.client.api.GetUserSettingByID(reqCtx, userSetting.ID) + require.Nil(t, out) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + }) + } +} + +func (suite *GraphTestSuite) TestMutationUserCascadeDelete() { + t := suite.T() + + // setup user context + ctx, err := userContext() + require.NoError(t, err) + + user := (&UserBuilder{client: suite.client}).MustNew(ctx, t) + + reqCtx, err := auth.NewTestContextWithOrgID(user.ID, user.Edges.Setting.Edges.DefaultOrg.ID) + require.NoError(t, err) + + token := (&PersonalAccessTokenBuilder{client: suite.client, OwnerID: user.ID}).MustNew(reqCtx, t) + + // mock checks + mock_fga.CheckAny(t, suite.client.fga, true) + // mock writes to clean up personal org + mock_fga.WriteAny(t, suite.client.fga) + + // delete user + resp, err := suite.client.api.DeleteUser(reqCtx, user.ID) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.DeleteUser.DeletedID) + + // make sure the deletedID matches the ID we wanted to delete + assert.Equal(t, user.ID, resp.DeleteUser.DeletedID) + + o, err := suite.client.api.GetUserByID(reqCtx, user.ID) + + require.Nil(t, o) + require.Error(t, err) + assert.ErrorContains(t, err, "not found") + + g, err := suite.client.api.GetPersonalAccessTokenByID(reqCtx, token.ID) + require.Error(t, err) + + require.Nil(t, g) + assert.ErrorContains(t, err, "not found") + + ctx = entx.SkipSoftDelete(reqCtx) + + // skip checks because tuples will be deleted at this point + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + o, err = suite.client.api.GetUserByID(ctx, user.ID) + require.NoError(t, err) + + require.Equal(t, o.User.ID, user.ID) + + // Bypass auth check to get owner of access token + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + g, err = suite.client.api.GetPersonalAccessTokenByID(ctx, token.ID) + require.NoError(t, err) + + require.Equal(t, g.PersonalAccessToken.ID, token.ID) +} diff --git a/internal/graphapi/usersetting.resolvers.go b/internal/graphapi/usersetting.resolvers.go new file mode 100644 index 0000000..f03f102 --- /dev/null +++ b/internal/graphapi/usersetting.resolvers.go @@ -0,0 +1,70 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" +) + +// CreateUserSetting is the resolver for the createUserSetting field. +func (r *mutationResolver) CreateUserSetting(ctx context.Context, input generated.CreateUserSettingInput) (*UserSettingCreatePayload, error) { + res, err := withTransactionalMutation(ctx).UserSetting.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "usersetting"}, r.logger) + } + + return &UserSettingCreatePayload{ + UserSetting: res, + }, nil +} + +// CreateBulkUserSetting is the resolver for the createBulkUserSetting field. +func (r *mutationResolver) CreateBulkUserSetting(ctx context.Context, input []*generated.CreateUserSettingInput) (*UserSettingBulkCreatePayload, error) { + return r.bulkCreateUserSetting(ctx, input) +} + +// CreateBulkCSVUserSetting is the resolver for the createBulkCSVUserSetting field. +func (r *mutationResolver) CreateBulkCSVUserSetting(ctx context.Context, input graphql.Upload) (*UserSettingBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateUserSettingInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateUserSetting(ctx, data) +} + +// UpdateUserSetting is the resolver for the updateUserSetting field. +func (r *mutationResolver) UpdateUserSetting(ctx context.Context, id string, input generated.UpdateUserSettingInput) (*UserSettingUpdatePayload, error) { + userSetting, err := withTransactionalMutation(ctx).UserSetting.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "usersetting"}, r.logger) + } + + userSetting, err = userSetting.Update().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "usersetting"}, r.logger) + } + + return &UserSettingUpdatePayload{UserSetting: userSetting}, nil +} + +// UserSetting is the resolver for the UserSetting field. +func (r *queryResolver) UserSetting(ctx context.Context, id string) (*generated.UserSetting, error) { + userSetting, err := withTransactionalMutation(ctx).UserSetting.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "usersetting"}, r.logger) + } + + if err := generated.UserSettingEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return userSetting, nil +} diff --git a/internal/graphapi/usersetting_test.go b/internal/graphapi/usersetting_test.go new file mode 100644 index 0000000..f436791 --- /dev/null +++ b/internal/graphapi/usersetting_test.go @@ -0,0 +1,249 @@ +package graphapi_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *GraphTestSuite) TestQueryUserSetting() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + user2 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + user2Setting, err := user2.Setting(reqCtx) + require.NoError(t, err) + + // setup valid user context + user1SettingResp, err := suite.client.api.GetUserSettings(reqCtx, openlaneclient.UserSettingWhereInput{}) + require.NoError(t, err) + require.Len(t, user1SettingResp.UserSettings.Edges, 1) + + user1Setting := user1SettingResp.UserSettings.Edges[0].Node + + testCases := []struct { + name string + queryID string + client *openlaneclient.OpenLaneClient + ctx context.Context + expected *openlaneclient.GetUserSettings_UserSettings_Edges_Node + errorMsg string + }{ + { + name: "happy path user", + queryID: user1Setting.ID, + client: suite.client.api, + ctx: reqCtx, + expected: user1Setting, + }, + { + name: "happy path user, using personal access token", + queryID: user1Setting.ID, + client: suite.client.apiWithPAT, + ctx: context.Background(), + expected: user1Setting, + }, + { + name: "valid user, but not auth", + queryID: user2Setting.ID, + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not found", + }, + { + name: "invalid-id", + queryID: "tacos-for-dinner", + client: suite.client.api, + ctx: reqCtx, + errorMsg: "not found", + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := tc.client.GetUserSettingByID(tc.ctx, tc.queryID) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UserSetting) + require.Equal(t, tc.expected.Status, resp.UserSetting.Status) + }) + } + + (&UserCleanup{client: suite.client, ID: user2.ID}).MustDelete(reqCtx, t) +} + +func (suite *GraphTestSuite) TestQueryUserSettings() { + t := suite.T() + + // setup user context + reqCtx, err := userContext() + require.NoError(t, err) + + user1 := (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + user1Setting, err := user1.Setting(reqCtx) + require.NoError(t, err) + + // create another user to make sure we don't get their settings back + _ = (&UserBuilder{client: suite.client}).MustNew(reqCtx, t) + + t.Run("Get User Settings", func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + resp, err := suite.client.api.GetAllUserSettings(reqCtx) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UserSettings.Edges) + + // make sure only the current user settings are returned + assert.Equal(t, len(resp.UserSettings.Edges), 1) + + // setup valid user context + reqCtx, err := userContextWithID(user1.ID) + require.NoError(t, err) + + resp, err = suite.client.api.GetAllUserSettings(reqCtx) + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UserSettings.Edges) + require.Equal(t, user1Setting.ID, resp.UserSettings.Edges[0].Node.ID) + }) +} + +func (suite *GraphTestSuite) TestMutationUpdateUserSetting() { + t := suite.T() + + // setup user context + ctx, err := userContext() + require.NoError(t, err) + + org := (&OrganizationBuilder{client: suite.client}).MustNew(ctx, t) + + // create another user to make sure we don't get their settings back + (&UserBuilder{client: suite.client}).MustNew(ctx, t) + org2 := (&OrganizationBuilder{client: suite.client}).MustNew(ctx, t) + + // setup valid user context + reqCtx, err := auth.NewTestContextWithOrgID(testUser.ID, testPersonalOrgID) + require.NoError(t, err) + + testCases := []struct { + name string + updateInput openlaneclient.UpdateUserSettingInput + client *openlaneclient.OpenLaneClient + ctx context.Context + expectedRes openlaneclient.UpdateUserSetting_UpdateUserSetting_UserSetting + allowed bool + checkOrg bool + errorMsg string + }{ + { + name: "update default org and tags", + updateInput: openlaneclient.UpdateUserSettingInput{ + DefaultOrgID: &org.ID, + Tags: []string{"mitb", "funk"}, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: true, + checkOrg: true, + expectedRes: openlaneclient.UpdateUserSetting_UpdateUserSetting_UserSetting{ + Status: enums.UserStatusActive, + Tags: []string{"mitb", "funk"}, + DefaultOrg: &openlaneclient.UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg{ + ID: org.ID, + }, + }, + }, + { + name: "update default org to org without access", + updateInput: openlaneclient.UpdateUserSettingInput{ + DefaultOrgID: &org2.ID, + }, + client: suite.client.api, + ctx: reqCtx, + allowed: false, + checkOrg: true, + errorMsg: "Organization with the specified ID was not found", + }, + { + name: "update status to invalid", + updateInput: openlaneclient.UpdateUserSettingInput{ + Status: &enums.UserStatusInvalid, + }, + client: suite.client.api, + ctx: reqCtx, + checkOrg: false, + errorMsg: "INVALID is not a valid UserSettingUserStatus", + }, + { + name: "update status to suspended using personal access token", + updateInput: openlaneclient.UpdateUserSettingInput{ + Status: &enums.UserStatusSuspended, + }, + client: suite.client.apiWithPAT, + ctx: context.Background(), + checkOrg: false, + expectedRes: openlaneclient.UpdateUserSetting_UpdateUserSetting_UserSetting{ + Status: enums.UserStatusSuspended, + Tags: []string{"mitb", "funk"}, + }, + }, + } + + for _, tc := range testCases { + t.Run("Update "+tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.client.fga) + + // when attempting to update default org, we do a check + if tc.checkOrg { + mock_fga.CheckAny(t, suite.client.fga, tc.allowed) + } + + // update user + resp, err := tc.client.UpdateUserSetting(tc.ctx, testUser.Edges.Setting.ID, tc.updateInput) + + if tc.errorMsg != "" { + require.Error(t, err) + assert.ErrorContains(t, err, tc.errorMsg) + assert.Nil(t, resp) + + return + } + + require.NoError(t, err) + require.NotNil(t, resp) + require.NotNil(t, resp.UpdateUserSetting.UserSetting) + + // Make sure provided values match + assert.Equal(t, tc.expectedRes.Status, resp.UpdateUserSetting.UserSetting.Status) + assert.ElementsMatch(t, tc.expectedRes.Tags, resp.UpdateUserSetting.UserSetting.Tags) + + if tc.updateInput.DefaultOrgID != nil { + assert.Equal(t, tc.expectedRes.DefaultOrg.ID, resp.UpdateUserSetting.UserSetting.DefaultOrg.ID) + } + }) + } +} diff --git a/internal/graphapi/webhook.resolvers.go b/internal/graphapi/webhook.resolvers.go new file mode 100644 index 0000000..b2be96f --- /dev/null +++ b/internal/graphapi/webhook.resolvers.go @@ -0,0 +1,100 @@ +package graphapi + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/utils/rout" +) + +// CreateWebhook is the resolver for the createWebhook field. +func (r *mutationResolver) CreateWebhook(ctx context.Context, input generated.CreateWebhookInput) (*WebhookCreatePayload, error) { + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") + } + + res, err := withTransactionalMutation(ctx).Webhook.Create().SetInput(input).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "webhook"}, r.logger) + } + + return &WebhookCreatePayload{ + Webhook: res, + }, nil +} + +// CreateBulkWebhook is the resolver for the createBulkWebhook field. +func (r *mutationResolver) CreateBulkWebhook(ctx context.Context, input []*generated.CreateWebhookInput) (*WebhookBulkCreatePayload, error) { + return r.bulkCreateWebhook(ctx, input) +} + +// CreateBulkCSVWebhook is the resolver for the createBulkCSVWebhook field. +func (r *mutationResolver) CreateBulkCSVWebhook(ctx context.Context, input graphql.Upload) (*WebhookBulkCreatePayload, error) { + data, err := unmarshalBulkData[generated.CreateWebhookInput](input) + if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err + } + + return r.bulkCreateWebhook(ctx, data) +} + +// UpdateWebhook is the resolver for the updateWebhook field. +func (r *mutationResolver) UpdateWebhook(ctx context.Context, id string, input generated.UpdateWebhookInput) (*WebhookUpdatePayload, error) { + res, err := withTransactionalMutation(ctx).Webhook.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "webhook"}, r.logger) + } + // set the organization in the auth context if its not done for us + if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied + } + + // setup update request + req := res.Update().SetInput(input).AppendTags(input.AppendTags) + + res, err = req.Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "webhook"}, r.logger) + } + + return &WebhookUpdatePayload{ + Webhook: res, + }, nil +} + +// DeleteWebhook is the resolver for the deleteWebhook field. +func (r *mutationResolver) DeleteWebhook(ctx context.Context, id string) (*WebhookDeletePayload, error) { + if err := withTransactionalMutation(ctx).Webhook.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "webhook"}, r.logger) + } + + if err := generated.WebhookEdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) + } + + return &WebhookDeletePayload{ + DeletedID: id, + }, nil +} + +// Webhook is the resolver for the webhook field. +func (r *queryResolver) Webhook(ctx context.Context, id string) (*generated.Webhook, error) { + res, err := withTransactionalMutation(ctx).Webhook.Get(ctx, id) + if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "webhook"}, r.logger) + } + + return res, nil +} diff --git a/internal/httpserve/authmanager/authmanager.go b/internal/httpserve/authmanager/authmanager.go new file mode 100644 index 0000000..c05450e --- /dev/null +++ b/internal/httpserve/authmanager/authmanager.go @@ -0,0 +1,162 @@ +package authmanager + +import ( + "context" + "fmt" + "net/http" + + "github.com/golang-jwt/jwt/v5" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" + "github.com/theopenlane/httpsling" +) + +type Config struct { + tokenManager *tokens.TokenManager + sessionConfig *sessions.SessionConfig +} + +func New() *Config { + return &Config{} +} + +// SetSessionConfig sets the session config for the auth session +func (a *Config) SetSessionConfig(sc *sessions.SessionConfig) { + if a == nil { + a = &Config{} + } + + a.sessionConfig = sc +} + +func (a *Config) GetSessionConfig() *sessions.SessionConfig { + return a.sessionConfig +} + +// SetTokenManager sets the token manager for the auth session +func (a *Config) SetTokenManager(tm *tokens.TokenManager) { + if a == nil { + a = &Config{} + } + + a.tokenManager = tm +} + +func (a *Config) GetTokenManager() *tokens.TokenManager { + return a.tokenManager +} + +// createClaims creates the claims for the JWT token using the id for the user and organization +func createClaimsWithOrg(u *generated.User, targetOrgID string) *tokens.Claims { + if targetOrgID == "" { + if u.Edges.Setting.Edges.DefaultOrg != nil { + targetOrgID = u.Edges.Setting.Edges.DefaultOrg.ID + } + } + + return &tokens.Claims{ + RegisteredClaims: jwt.RegisteredClaims{ + Subject: u.ID, + }, + UserID: u.ID, + OrgID: targetOrgID, + } +} + +// generateNewAuthSession creates a new auth session for the user and their default organization id +func (a *Config) GenerateUserAuthSession(ctx echo.Context, user *generated.User) (*models.AuthData, error) { + return a.GenerateUserAuthSessionWithOrg(ctx, user, "") +} + +// generateUserAuthSessionWithOrg creates a new auth session for the user and the new target organization id +func (a *Config) GenerateUserAuthSessionWithOrg(ctx echo.Context, user *generated.User, targetOrgID string) (*models.AuthData, error) { + auth, err := a.createTokenPair(user, targetOrgID) + if err != nil { + return nil, err + } + + auth.Session, err = a.generateUserSession(ctx, user.ID) + if err != nil { + return nil, err + } + + auth.TokenType = string(httpsling.BearerAuthType) + + return auth, nil +} + +// GenerateOauthAuthSession creates a new auth session for the oauth user and their default organization id +func (a *Config) GenerateOauthAuthSession(ctx context.Context, w http.ResponseWriter, user *generated.User, oauthRequest models.OauthTokenRequest) (*models.AuthData, error) { + auth, err := a.createTokenPair(user, "") + if err != nil { + return nil, err + } + + auth.Session, err = a.generateOauthUserSession(ctx, w, user.ID, oauthRequest) + if err != nil { + return nil, err + } + + auth.TokenType = string(httpsling.BearerAuthType) + + return auth, nil +} + +// createTokenPair creates a new token pair for the user and the target organization id (or default org if none provided) +func (a *Config) createTokenPair(user *generated.User, targetOrgID string) (*models.AuthData, error) { + // create new claims for the user + newClaims := createClaimsWithOrg(user, targetOrgID) + + // create a new token pair for the user + access, refresh, err := a.tokenManager.CreateTokenPair(newClaims) + if err != nil { + return nil, err + } + + return &models.AuthData{ + AccessToken: access, + RefreshToken: refresh, + }, nil +} + +// GenerateUserSession creates a new session for the user and stores it in the response +func (a *Config) generateUserSession(ctx echo.Context, userID string) (string, error) { + // set sessions in response + if err := a.sessionConfig.CreateAndStoreSession(ctx, userID); err != nil { + return "", err + } + + // return the session value for the UI to use + session, err := sessions.SessionToken(ctx.Request().Context()) + if err != nil { + return "", err + } + + return session, nil +} + +// generateOauthUserSession creates a new session for the oauth user and stores it in the response +func (a *Config) generateOauthUserSession(ctx context.Context, w http.ResponseWriter, userID string, oauthRequest models.OauthTokenRequest) (string, error) { + setSessionMap := map[string]any{} + setSessionMap[sessions.ExternalUserIDKey] = fmt.Sprintf("%v", oauthRequest.ExternalUserID) + setSessionMap[sessions.UsernameKey] = oauthRequest.ExternalUserName + setSessionMap[sessions.UserTypeKey] = oauthRequest.AuthProvider + setSessionMap[sessions.EmailKey] = oauthRequest.Email + setSessionMap[sessions.UserIDKey] = userID + + c, err := a.sessionConfig.SaveAndStoreSession(ctx, w, setSessionMap, userID) + if err != nil { + return "", err + } + + session, err := sessions.SessionToken(c) + if err != nil { + return "", err + } + + return session, nil +} diff --git a/internal/httpserve/authmanager/doc.go b/internal/httpserve/authmanager/doc.go new file mode 100644 index 0000000..f6cf2a5 --- /dev/null +++ b/internal/httpserve/authmanager/doc.go @@ -0,0 +1,2 @@ +// Package authmanager provides the authentication manager for the server +package authmanager diff --git a/internal/httpserve/config/config.go b/internal/httpserve/config/config.go new file mode 100644 index 0000000..ed200f6 --- /dev/null +++ b/internal/httpserve/config/config.go @@ -0,0 +1,98 @@ +package config + +import ( + "crypto/tls" + "net/http" + "time" + + echo "github.com/theopenlane/echox" + "go.uber.org/zap" + "golang.org/x/crypto/acme" + "golang.org/x/crypto/acme/autocert" + + "github.com/theopenlane/core/config" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/sessions" +) + +var ( + // DefaultConfigRefresh sets the default interval to refresh the config. + DefaultConfigRefresh = 10 * time.Minute + // DefaultTLSConfig is the default TLS config used when HTTPS is enabled + DefaultTLSConfig = &tls.Config{ + MinVersion: tls.VersionTLS12, + CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256}, + PreferServerCipherSuites: true, + CipherSuites: []uint16{ + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + }, + } +) + +// Config is the configuration for the http server +type Config struct { + // add all the configuration settings for the server + Settings config.Config + // Logger contains the logger used by echo functions + Logger *zap.SugaredLogger + // Routes contains the handler functions + Routes []http.Handler + // DefaultMiddleware to enable on the echo server used on all requests + DefaultMiddleware []echo.MiddlewareFunc + // GraphMiddleware to enable on the echo server used on graph requests + GraphMiddleware []echo.MiddlewareFunc + // Handler contains the required settings for REST handlers including ready checks and JWT keys + Handler handlers.Handler + // SessionConfig manages sessions for users + SessionConfig *sessions.SessionConfig +} + +// Ensure that *Config implements ConfigProvider interface. +var _ ConfigProvider = &Config{} + +// GetConfig implements ConfigProvider. +func (c *Config) GetConfig() (*Config, error) { + return c, nil +} + +// WithTLSDefaults sets tls default settings assuming a default cert and key file location. +func (c Config) WithTLSDefaults() Config { + c.WithDefaultTLSConfig() + + return c +} + +// WithDefaultTLSConfig sets the default TLS Configuration +func (c Config) WithDefaultTLSConfig() Config { + c.Settings.Server.TLS.Enabled = true + c.Settings.Server.TLS.Config = DefaultTLSConfig + + return c +} + +// WithTLSCerts sets the TLS Cert and Key locations +func (c *Config) WithTLSCerts(certFile, certKey string) *Config { + c.Settings.Server.TLS.CertFile = certFile + c.Settings.Server.TLS.CertKey = certKey + + return c +} + +// WithAutoCert generates a letsencrypt certificate, a valid host must be provided +func (c *Config) WithAutoCert(host string) *Config { + autoTLSManager := autocert.Manager{ + Prompt: autocert.AcceptTOS, + // Cache certificates to avoid issues with rate limits (https://letsencrypt.org/docs/rate-limits) + Cache: autocert.DirCache("/var/www/.cache"), + HostPolicy: autocert.HostWhitelist(host), + } + + c.Settings.Server.TLS.Enabled = true + c.Settings.Server.TLS.Config = DefaultTLSConfig + + c.Settings.Server.TLS.Config.GetCertificate = autoTLSManager.GetCertificate + c.Settings.Server.TLS.Config.NextProtos = []string{acme.ALPNProto} + + return c +} diff --git a/internal/httpserve/config/configprovider.go b/internal/httpserve/config/configprovider.go new file mode 100644 index 0000000..3d63f69 --- /dev/null +++ b/internal/httpserve/config/configprovider.go @@ -0,0 +1,7 @@ +package config + +// ConfigProvider serves as a common interface to read echo server configuration +type ConfigProvider interface { + // GetConfig returns the server configuration + GetConfig() (*Config, error) +} diff --git a/internal/httpserve/config/configproviderrefresh.go b/internal/httpserve/config/configproviderrefresh.go new file mode 100644 index 0000000..32a65b2 --- /dev/null +++ b/internal/httpserve/config/configproviderrefresh.go @@ -0,0 +1,92 @@ +package config + +import ( + "sync" + "time" +) + +// ConfigProviderWithRefresh shows a config provider with automatic refresh; it contains fields and methods to manage the configuration, +// and refresh it periodically based on a specified interval +type ConfigProviderWithRefresh struct { + sync.RWMutex + + config *Config + + configProvider ConfigProvider + + refreshInterval time.Duration + + ticker *time.Ticker + stop chan bool +} + +// NewConfigProviderWithRefresh function is a constructor function that creates a new instance of ConfigProviderWithRefresh +func NewConfigProviderWithRefresh(cfgProvider ConfigProvider) (*ConfigProviderWithRefresh, error) { + cfg, err := cfgProvider.GetConfig() + if err != nil { + return nil, err + } + + cfgRefresh := &ConfigProviderWithRefresh{ + config: cfg, + configProvider: cfgProvider, + refreshInterval: cfg.Settings.RefreshInterval, + } + cfgRefresh.initialize() + + return cfgRefresh, nil +} + +// GetConfig retrieves the current echo server configuration; it acquires a read lock to ensure thread safety and returns the `config` field +func (s *ConfigProviderWithRefresh) GetConfig() (*Config, error) { + s.RLock() + defer s.RUnlock() + + return s.config, nil +} + +// initialize the config provider with refresh +func (s *ConfigProviderWithRefresh) initialize() { + if s.refreshInterval != 0 { + s.stop = make(chan bool) + s.ticker = time.NewTicker(s.refreshInterval) + + go s.refreshConfig() + } +} + +func (s *ConfigProviderWithRefresh) refreshConfig() { + for { + select { + case <-s.stop: + break + case <-s.ticker.C: + } + + newConfig, err := s.configProvider.GetConfig() + if err != nil { + s.config.Logger.Error("failed to load new server configuration") + continue + } + + s.config.Logger.Info("loaded new server configuration") + + s.Lock() + s.config = newConfig + s.Unlock() + } +} + +// Close function is used to stop the automatic refresh of the configuration. +// It stops the ticker that triggers the refresh and closes the stop channel, +// which signals the goroutine to stop refreshing the configuration +func (s *ConfigProviderWithRefresh) Close() { + if s.ticker != nil { + s.ticker.Stop() + } + + if s.stop != nil { + s.stop <- true + close(s.stop) + } +} diff --git a/internal/httpserve/config/doc.go b/internal/httpserve/config/doc.go new file mode 100644 index 0000000..7c130bc --- /dev/null +++ b/internal/httpserve/config/doc.go @@ -0,0 +1,2 @@ +// Package config holds the echo server configuration utilities +package config diff --git a/internal/httpserve/handlers/acccountaccess.go b/internal/httpserve/handlers/acccountaccess.go new file mode 100644 index 0000000..8827e11 --- /dev/null +++ b/internal/httpserve/handlers/acccountaccess.go @@ -0,0 +1,74 @@ +package handlers + +import ( + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" +) + +// AccountAccessHandler checks if a subject has access to an object +func (h *Handler) AccountAccessHandler(ctx echo.Context) error { + var in models.AccountAccessRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.BadRequest(ctx, err) + } + + req := fgax.AccessCheck{ + SubjectType: in.SubjectType, + Relation: in.Relation, + ObjectID: in.ObjectID, + ObjectType: fgax.Kind(in.ObjectType), + } + + subjectID, err := auth.GetUserIDFromContext(ctx.Request().Context()) + if err != nil { + h.Logger.Errorw("error getting user id from context", "error", err) + + return h.InternalServerError(ctx, err) + } + + req.SubjectID = subjectID + + allow, err := h.DBClient.Authz.CheckAccess(ctx.Request().Context(), req) + if err != nil { + h.Logger.Errorw("error checking access", "error", err) + + return h.InternalServerError(ctx, err) + } + + return h.Success(ctx, models.AccountAccessReply{ + Reply: rout.Reply{Success: true}, + Allowed: allow, + }) +} + +// BindAccountAccess returns the OpenAPI3 operation for accepting an account access request +func (h *Handler) BindAccountAccess() *openapi3.Operation { + checkAccess := openapi3.NewOperation() + checkAccess.Description = "Check Subject Access to Object" + checkAccess.OperationID = "AccountAccess" + checkAccess.Security = &openapi3.SecurityRequirements{ + openapi3.SecurityRequirement{ + "bearerAuth": []string{}, + }, + } + + h.AddRequestBody("AccountAccessRequest", models.ExampleAccountAccessRequest, checkAccess) + h.AddResponse("AccountAccessReply", "success", models.ExampleAccountAccessReply, checkAccess, http.StatusOK) + checkAccess.AddResponse(http.StatusInternalServerError, internalServerError()) + checkAccess.AddResponse(http.StatusBadRequest, badRequest()) + checkAccess.AddResponse(http.StatusUnauthorized, unauthorized()) + + return checkAccess +} diff --git a/internal/httpserve/handlers/acccountroles.go b/internal/httpserve/handlers/acccountroles.go new file mode 100644 index 0000000..fb1e0b2 --- /dev/null +++ b/internal/httpserve/handlers/acccountroles.go @@ -0,0 +1,91 @@ +package handlers + +import ( + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" +) + +// DefaultAllRelations is the default list of relations to check +// these come from the fga/model/model.fga file relations +// TODO (sfunk): look into a way to get this from the fga model +var DefaultAllRelations = []string{ + "can_view", + "can_edit", + "can_delete", + "audit_log_viewer", + "can_invite_admins", + "can_invite_members", +} + +// AccountAccessHandler list roles a subject has access to in relation an object +func (h *Handler) AccountRolesHandler(ctx echo.Context) error { + var in models.AccountRolesRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.BadRequest(ctx, err) + } + + req := fgax.ListAccess{ + SubjectType: in.SubjectType, + ObjectID: in.ObjectID, + ObjectType: fgax.Kind(in.ObjectType), + Relations: in.Relations, + } + + // if no relations are provided, default to all relations + if len(req.Relations) == 0 { + req.Relations = DefaultAllRelations + } + + subjectID, err := auth.GetUserIDFromContext(ctx.Request().Context()) + if err != nil { + h.Logger.Errorw("error getting user id from context", "error", err) + + return h.InternalServerError(ctx, err) + } + + req.SubjectID = subjectID + + roles, err := h.DBClient.Authz.ListRelations(ctx.Request().Context(), req) + if err != nil { + h.Logger.Error("error checking access", "error", err) + + return h.InternalServerError(ctx, err) + } + + return h.Success(ctx, models.AccountRolesReply{ + Reply: rout.Reply{Success: true}, + Roles: roles, + }) +} + +// BindAccountRoles returns the OpenAPI3 operation for accepting an account roles request +func (h *Handler) BindAccountRoles() *openapi3.Operation { + roles := openapi3.NewOperation() + roles.Description = "List roles a subject has in relation to an object" + roles.OperationID = "AccountRoles" + roles.Security = &openapi3.SecurityRequirements{ + openapi3.SecurityRequirement{ + "bearerAuth": []string{}, + }, + } + + h.AddRequestBody("AccountRolesRequest", models.ExampleAccountRolesRequest, roles) + h.AddResponse("AccountRolesReply", "success", models.ExampleAccountRolesReply, roles, http.StatusOK) + roles.AddResponse(http.StatusInternalServerError, internalServerError()) + roles.AddResponse(http.StatusBadRequest, badRequest()) + roles.AddResponse(http.StatusUnauthorized, unauthorized()) + + return roles +} diff --git a/internal/httpserve/handlers/acccountrolesorganization.go b/internal/httpserve/handlers/acccountrolesorganization.go new file mode 100644 index 0000000..e29e800 --- /dev/null +++ b/internal/httpserve/handlers/acccountrolesorganization.go @@ -0,0 +1,131 @@ +package handlers + +import ( + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" + + sliceutil "github.com/theopenlane/utils/slice" +) + +// AccountRolesOrganizationHandler lists roles a subject has in relation to an organization +func (h *Handler) AccountRolesOrganizationHandler(ctx echo.Context) error { + var in models.AccountRolesOrganizationRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + au, err := auth.GetAuthenticatedUserContext(ctx.Request().Context()) + if err != nil { + h.Logger.Error("error getting authenticated user", "error", err) + + return h.InternalServerError(ctx, err) + } + + in.ID, err = h.getOrganizationID(in, au) + if err != nil { + return h.BadRequest(ctx, err) + } + + // validate the input + if err := in.Validate(); err != nil { + return h.BadRequest(ctx, err) + } + + // determine the subject type + subjectType := "user" + if au.AuthenticationType == auth.APITokenAuthentication { + subjectType = "service" + } + + req := fgax.ListAccess{ + SubjectType: subjectType, + SubjectID: au.SubjectID, + ObjectID: in.ID, + ObjectType: fgax.Kind("organization"), + Relations: DefaultAllRelations, + } + + roles, err := h.DBClient.Authz.ListRelations(ctx.Request().Context(), req) + if err != nil { + h.Logger.Errorw("error checking access", "error", err) + + return h.InternalServerError(ctx, err) + } + + return h.Success(ctx, models.AccountRolesOrganizationReply{ + Reply: rout.Reply{Success: true}, + Roles: roles, + OrganizationID: req.ObjectID, + }) +} + +// getOrganizationID returns the organization ID to use for the request based on the input and authenticated user +func (h *Handler) getOrganizationID(in models.AccountRolesOrganizationRequest, au *auth.AuthenticatedUser) (string, error) { + // if an ID is provided, check if the authenticated user has access to it + if in.ID != "" { + if !sliceutil.Contains(au.OrganizationIDs, in.ID) { + return "", ErrInvalidInput + } + + return in.ID, nil + } + + // if no ID is provided, default to the authenticated organization + if au.OrganizationID != "" { + return au.OrganizationID, nil + } + + // if it is still empty, and the personal access token only has one organization use that + if len(au.OrganizationIDs) == 1 { + return au.OrganizationIDs[0], nil + } + + return "", nil +} + +// BindAccountRolesOrganization returns the OpenAPI3 operation for accepting an account roles organization request +func (h *Handler) BindAccountRolesOrganization() *openapi3.Operation { + orgRoles := openapi3.NewOperation() + orgRoles.Description = "List roles a subject has in relation to the authenticated organization" + orgRoles.OperationID = "AccountRolesOrganization" + orgRoles.Security = &openapi3.SecurityRequirements{ + openapi3.SecurityRequirement{ + "bearerAuth": []string{}, + }, + } + + h.AddResponse("AccountRolesOrganizationReply", "success", models.ExampleAccountRolesOrganizationReply, orgRoles, http.StatusOK) + orgRoles.AddResponse(http.StatusInternalServerError, internalServerError()) + orgRoles.AddResponse(http.StatusBadRequest, badRequest()) + orgRoles.AddResponse(http.StatusUnauthorized, unauthorized()) + + return orgRoles +} + +// BindAccountRolesOrganization returns the OpenAPI3 operation for accepting an account roles organization request +func (h *Handler) BindAccountRolesOrganizationWithParam() *openapi3.Operation { + orgRoles := openapi3.NewOperation() + orgRoles.Description = "List roles a subject has in relation to a specific organization id" + orgRoles.OperationID = "AccountRolesOrganizationWithID" + orgRoles.Security = &openapi3.SecurityRequirements{ + openapi3.SecurityRequirement{ + "bearerAuth": []string{}, + }, + } + + h.AddRequestBody("AccountRolesOrganizationRequest", models.ExampleAccountRolesOrganizationRequest, orgRoles) + h.AddResponse("AccountRolesOrganizationReply", "success", models.ExampleAccountRolesOrganizationReply, orgRoles, http.StatusOK) + orgRoles.AddResponse(http.StatusInternalServerError, internalServerError()) + orgRoles.AddResponse(http.StatusBadRequest, badRequest()) + orgRoles.AddResponse(http.StatusUnauthorized, unauthorized()) + + return orgRoles +} diff --git a/internal/httpserve/handlers/accountaccess_test.go b/internal/httpserve/handlers/accountaccess_test.go new file mode 100644 index 0000000..643493a --- /dev/null +++ b/internal/httpserve/handlers/accountaccess_test.go @@ -0,0 +1,142 @@ +package handlers_test + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestAccountAccessHandler() { + t := suite.T() + + // add handler + suite.e.POST("account/access", suite.h.AccountAccessHandler) + + // bypass auth + ctx := context.Background() + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + mock_fga.WriteAny(t, suite.fga) + + // setup test data + requestor := suite.db.User.Create(). + SetEmail("marco@theopenlane.io"). + SetFirstName("Marco"). + SetLastName("Polo"). + SaveX(ctx) + + reqCtx, err := userContextWithID(requestor.ID) + require.NoError(t, err) + + mock_fga.ClearMocks(suite.fga) + + testCases := []struct { + name string + request models.AccountAccessRequest + mockAllow bool + errMsg string + }{ + { + name: "happy path, allow access", + mockAllow: true, + request: models.AccountAccessRequest{ + ObjectID: "org-id", + ObjectType: "organization", + Relation: "can_view", + }, + }, + { + name: "access denied", + mockAllow: false, + request: models.AccountAccessRequest{ + ObjectID: "another-org-id", + ObjectType: "organization", + Relation: "can_delete", + }, + }, + { + name: "missing object id", + request: models.AccountAccessRequest{ + ObjectType: "organization", + Relation: "can_delete", + }, + errMsg: "objectId is required", + }, + { + name: "missing object type", + request: models.AccountAccessRequest{ + ObjectID: "org-id", + Relation: "can_delete", + }, + errMsg: "objectType is required", + }, + { + name: "missing relation", + request: models.AccountAccessRequest{ + ObjectID: "org-id", + ObjectType: "organization", + }, + errMsg: "relation is required", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + if tc.errMsg == "" { + mock_fga.CheckAny(t, suite.fga, tc.mockAllow) + } + + target := "/account/access" + + body, err := json.Marshal(tc.request) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, target, strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req.WithContext(reqCtx)) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.AccountAccessReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + if tc.errMsg != "" { + assert.Equal(t, http.StatusBadRequest, recorder.Code) + assert.False(t, out.Success) + assert.Equal(t, tc.errMsg, out.Error) + + return + } + + assert.Equal(t, http.StatusOK, recorder.Code) + assert.True(t, out.Success) + assert.Equal(t, tc.mockAllow, out.Allowed) + }) + } +} diff --git a/internal/httpserve/handlers/accountroles_test.go b/internal/httpserve/handlers/accountroles_test.go new file mode 100644 index 0000000..981cf3b --- /dev/null +++ b/internal/httpserve/handlers/accountroles_test.go @@ -0,0 +1,136 @@ +package handlers_test + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestAccountRolesHandler() { + t := suite.T() + + // add handler + suite.e.POST("account/roles", suite.h.AccountRolesHandler) + + // bypass auth + ctx := context.Background() + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + mock_fga.WriteAny(t, suite.fga) + + // setup test data + requestor := suite.db.User.Create(). + SetEmail("milione@theopenlane.io"). + SetFirstName("Milione"). + SetLastName("Polo"). + SaveX(ctx) + + reqCtx, err := userContextWithID(requestor.ID) + require.NoError(t, err) + + mock_fga.ClearMocks(suite.fga) + + testCases := []struct { + name string + request models.AccountRolesRequest + mockRoles []string + errMsg string + }{ + { + name: "happy path, default roles access", + mockRoles: []string{"can_view"}, + request: models.AccountRolesRequest{ + ObjectID: "org-id", + ObjectType: "organization", + }, + }, + { + name: "happy path, provide roles", + mockRoles: []string{"meow"}, + request: models.AccountRolesRequest{ + ObjectID: "org-id", + ObjectType: "organization", + Relations: []string{"meow", "woof"}, + }, + }, + { + name: "missing object id", + request: models.AccountRolesRequest{ + ObjectType: "organization", + }, + errMsg: "objectId is required", + }, + { + name: "missing object type", + request: models.AccountRolesRequest{ + ObjectID: "org-id", + }, + errMsg: "objectType is required", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + if tc.errMsg == "" { + if len(tc.request.Relations) == 0 { + tc.request.Relations = handlers.DefaultAllRelations + } + + mock_fga.BatchCheck(t, suite.fga, tc.mockRoles, tc.request.Relations) + } + + target := "/account/roles" + + body, err := json.Marshal(tc.request) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, target, strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req.WithContext(reqCtx)) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.AccountRolesReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + if tc.errMsg != "" { + assert.Equal(t, http.StatusBadRequest, recorder.Code) + assert.False(t, out.Success) + assert.Equal(t, tc.errMsg, out.Error) + + return + } + + assert.Equal(t, http.StatusOK, recorder.Code) + assert.True(t, out.Success) + assert.Equal(t, tc.mockRoles, out.Roles) + }) + } +} diff --git a/internal/httpserve/handlers/accountrolesorganization_test.go b/internal/httpserve/handlers/accountrolesorganization_test.go new file mode 100644 index 0000000..cab7fd7 --- /dev/null +++ b/internal/httpserve/handlers/accountrolesorganization_test.go @@ -0,0 +1,109 @@ +package handlers_test + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/models" +) + +func (suite *HandlerTestSuite) TestAccountRolesOrganizationHandler() { + t := suite.T() + + // add handler + suite.e.GET("account/roles/organization", suite.h.AccountRolesOrganizationHandler) + suite.e.GET("account/roles/organization/:id", suite.h.AccountRolesOrganizationHandler) + + // bypass auth + ctx := context.Background() + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + mock_fga.WriteAny(t, suite.fga) + + // setup test data + requestor := suite.db.User.Create(). + SetEmail("mp@theopenlane.io"). + SetFirstName("Mikey"). + SetLastName("Polo"). + SaveX(ctx) + + reqCtx, err := userContextWithID(requestor.ID) + require.NoError(t, err) + + mock_fga.ClearMocks(suite.fga) + + testCases := []struct { + name string + id string + target string + mockRoles []string + errMsg string + }{ + { + name: "happy path, no id provided", + target: "/account/roles/organization", + mockRoles: []string{"can_view"}, + }, + { + name: "happy path, id provided", + target: "/account/roles/organization/ulid_id_of_org", + mockRoles: []string{"can_view"}, + }, + { + name: "org not authorized", + target: "/account/roles/organization/another_ulid_id_of_org", + errMsg: "invalid input", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + if tc.errMsg == "" { + mock_fga.BatchCheck(t, suite.fga, tc.mockRoles, handlers.DefaultAllRelations) + } + + req := httptest.NewRequest(http.MethodGet, tc.target, nil) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req.WithContext(reqCtx)) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.AccountRolesOrganizationReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + if tc.errMsg != "" { + assert.Equal(t, http.StatusBadRequest, recorder.Code) + assert.False(t, out.Success) + assert.Equal(t, tc.errMsg, out.Error) + + return + } + + assert.Equal(t, http.StatusOK, recorder.Code) + assert.True(t, out.Success) + assert.Equal(t, tc.mockRoles, out.Roles) + assert.Equal(t, "ulid_id_of_org", out.OrganizationID) + }) + } +} diff --git a/internal/httpserve/handlers/doc.go b/internal/httpserve/handlers/doc.go new file mode 100644 index 0000000..de283b7 --- /dev/null +++ b/internal/httpserve/handlers/doc.go @@ -0,0 +1,2 @@ +// Package handlers contains custom handler functions +package handlers diff --git a/internal/httpserve/handlers/email.go b/internal/httpserve/handlers/email.go new file mode 100644 index 0000000..2d2fab1 --- /dev/null +++ b/internal/httpserve/handlers/email.go @@ -0,0 +1,142 @@ +package handlers + +import ( + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/sendgrid" +) + +// SendVerificationEmail sends an email to a user to verify their email address +func (h *Handler) SendVerificationEmail(user *User) error { + contact := &sendgrid.Contact{ + Email: user.Email, + FirstName: user.FirstName, + LastName: user.LastName, + } + + data := emails.VerifyEmailData{ + EmailData: emails.EmailData{ + Sender: h.EmailManager.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: user.Email, + FirstName: user.FirstName, + LastName: user.LastName, + }, + }, + FullName: contact.FullName(), + } + + var err error + if data.VerifyURL, err = h.EmailManager.VerifyURL(user.GetVerificationToken()); err != nil { + return err + } + + msg, err := emails.VerifyEmail(data) + if err != nil { + return err + } + + // Send the email + return h.EmailManager.Send(msg) +} + +// SendSubscriberEmail sends an email to confirm a user's subscription +func (h *Handler) SendSubscriberEmail(user *User, orgName string) error { + data := emails.SubscriberEmailData{ + OrgName: orgName, + EmailData: emails.EmailData{ + Sender: h.EmailManager.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: user.Email, + }, + }, + } + + var err error + if data.VerifySubscriberURL, err = h.EmailManager.SubscriberVerifyURL(user.GetVerificationToken()); err != nil { + return err + } + + msg, err := emails.SubscribeEmail(data) + if err != nil { + return err + } + + // Send the email + return h.EmailManager.Send(msg) +} + +// SendPasswordResetRequestEmail Send an email to a user to request them to reset their password +func (h *Handler) SendPasswordResetRequestEmail(user *User) error { + data := emails.ResetRequestData{ + EmailData: emails.EmailData{ + Sender: h.EmailManager.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: user.Email, + FirstName: user.FirstName, + LastName: user.LastName, + }, + }, + } + data.Recipient.ParseName(user.Name) + + var err error + if data.ResetURL, err = h.EmailManager.ResetURL(user.GetPasswordResetToken()); err != nil { + return err + } + + msg, err := emails.PasswordResetRequestEmail(data) + if err != nil { + return err + } + + // Send the email + return h.EmailManager.Send(msg) +} + +// SendPasswordResetSuccessEmail Send an email to a user to inform them that their password has been reset +func (h *Handler) SendPasswordResetSuccessEmail(user *User) error { + data := emails.ResetSuccessData{ + EmailData: emails.EmailData{ + Sender: h.EmailManager.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: user.Email, + }, + }, + } + + data.Recipient.ParseName(user.Name) + + msg, err := emails.PasswordResetSuccessEmail(data) + if err != nil { + return err + } + + // Send the email + return h.EmailManager.Send(msg) +} + +// SendOrgInvitationEmail sends an email inviting a user to join an existing organization +func (h *Handler) SendOrgInvitationEmail(i *emails.Invite) error { + data := emails.InviteData{ + InviterName: i.Requestor, + OrgName: i.OrgName, + EmailData: emails.EmailData{ + Sender: h.EmailManager.MustFromContact(), + Recipient: sendgrid.Contact{ + Email: i.Recipient, + }, + }, + } + + var err error + if data.InviteURL, err = h.EmailManager.InviteURL(i.Token); err != nil { + return err + } + + msg, err := emails.InviteEmail(data) + if err != nil { + return err + } + + return h.EmailManager.Send(msg) +} diff --git a/internal/httpserve/handlers/ent.go b/internal/httpserve/handlers/ent.go new file mode 100644 index 0000000..b09a7d6 --- /dev/null +++ b/internal/httpserve/handlers/ent.go @@ -0,0 +1,502 @@ +package handlers + +import ( + "context" + "time" + + gowebauthn "github.com/go-webauthn/webauthn/webauthn" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/emailverificationtoken" + "github.com/theopenlane/core/internal/ent/generated/invite" + "github.com/theopenlane/core/internal/ent/generated/passwordresettoken" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/internal/ent/generated/subscriber" + "github.com/theopenlane/core/internal/ent/generated/user" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/ent/generated/webauthn" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/middleware/transaction" +) + +// updateUserLastSeen updates the last seen timestamp of the user +func (h *Handler) updateUserLastSeen(ctx context.Context, id string) error { + if _, err := transaction.FromContext(ctx). + User. + UpdateOneID(id). + SetLastSeen(time.Now()). + Save(ctx); err != nil { + h.Logger.Errorw("error updating user last seen", "error", err) + + return err + } + + return nil +} + +// createUser creates a user in the database based on the input and returns the user with user settings +func (h *Handler) createUser(ctx context.Context, input ent.CreateUserInput) (*ent.User, error) { + meowuser, err := transaction.FromContext(ctx).User.Create(). + SetInput(input). + Save(ctx) + if err != nil { + h.Logger.Errorw("error creating new user", "error", err) + + return nil, err + } + + return meowuser, nil +} + +// updateSubscriberVerifiedEmail updates a subscriber by in the database based on the input and sets to active with verified email +func (h *Handler) updateSubscriberVerifiedEmail(ctx context.Context, id string, input ent.UpdateSubscriberInput) error { + _, err := transaction.FromContext(ctx).Subscriber.UpdateOneID(id). + SetInput(input). + SetActive(true). + SetVerifiedEmail(true). + Save(ctx) + if err != nil { + h.Logger.Errorw("error updating subscriber verified", "error", err) + return err + } + + return nil +} + +// updateSubscriber updates a subscriber by in the database based on the input +func (h *Handler) updateSubscriberVerificationToken(ctx context.Context, user *User) error { + ttl, err := time.Parse(time.RFC3339Nano, user.EmailVerificationExpires.String) + if err != nil { + h.Logger.Errorw("unable to parse ttl", "error", err) + return err + } + + _, err = transaction.FromContext(ctx).Subscriber.UpdateOneID(user.ID). + SetToken(user.EmailVerificationToken.String). + SetSecret(user.EmailVerificationSecret). + SetTTL(ttl). + Save(ctx) + if err != nil { + h.Logger.Errorw("error updating subscriber tokens", "error", err) + + return err + } + + return nil +} + +// createEmailVerificationToken creates a new email verification for the user +func (h *Handler) createEmailVerificationToken(ctx context.Context, user *User) (*ent.EmailVerificationToken, error) { + ttl, err := time.Parse(time.RFC3339Nano, user.EmailVerificationExpires.String) + if err != nil { + h.Logger.Errorw("unable to parse ttl", "error", err) + return nil, err + } + + meowtoken, err := transaction.FromContext(ctx).EmailVerificationToken.Create(). + SetOwnerID(user.ID). + SetToken(user.EmailVerificationToken.String). + SetTTL(ttl). + SetEmail(user.Email). + SetSecret(user.EmailVerificationSecret). + Save(ctx) + if err != nil { + h.Logger.Errorw("error creating email verification token", "error", err) + + return nil, err + } + + return meowtoken, nil +} + +func (h *Handler) createPasswordResetToken(ctx context.Context, user *User) (*ent.PasswordResetToken, error) { + ttl, err := time.Parse(time.RFC3339Nano, user.PasswordResetExpires.String) + if err != nil { + h.Logger.Errorw("unable to parse ttl", "error", err) + return nil, err + } + + meowtoken, err := transaction.FromContext(ctx).PasswordResetToken.Create(). + SetOwnerID(user.ID). + SetToken(user.PasswordResetToken.String). + SetTTL(ttl). + SetEmail(user.Email). + SetSecret(user.PasswordResetSecret). + Save(ctx) + if err != nil { + h.Logger.Errorw("error creating password reset token", "error", err) + + return nil, err + } + + return meowtoken, nil +} + +// getUserByEVToken returns the ent user with the user settings and email verification token fields based on the +// token in the request +func (h *Handler) getUserByEVToken(ctx context.Context, token string) (*ent.User, error) { + user, err := transaction.FromContext(ctx).EmailVerificationToken.Query(). + Where( + emailverificationtoken.Token(token), + ). + QueryOwner().WithSetting().WithEmailVerificationTokens().Only(ctx) + if err != nil { + h.Logger.Errorw("error obtaining user from email verification token", "error", err) + + return nil, err + } + + return user, nil +} + +// getUserByResetToken returns the ent user with the user settings and password reset tokens based on the +// token in the request +func (h *Handler) getUserByResetToken(ctx context.Context, token string) (*ent.User, error) { + user, err := transaction.FromContext(ctx).PasswordResetToken.Query(). + Where( + passwordresettoken.Token(token), + ). + QueryOwner().WithSetting().WithPasswordResetTokens().Only(ctx) + if err != nil { + h.Logger.Errorw("error obtaining user from reset token", "error", err) + + return nil, err + } + + return user, nil +} + +// getUserByEmail returns the ent user with the user settings based on the email and auth provider in the request +func (h *Handler) getUserByEmail(ctx context.Context, email string, authProvider enums.AuthProvider) (*ent.User, error) { + user, err := transaction.FromContext(ctx).User.Query().WithSetting(). + Where(user.Email(email)). + Where(user.AuthProviderEQ(authProvider)). + Only(ctx) + if err != nil { + h.Logger.Errorw("error obtaining user from email", "error", err) + + return nil, err + } + + return user, nil +} + +// getUserByID returns the ent user with the user settings based on the email and auth provider in the request +func (h *Handler) getUserByID(ctx context.Context, id string, authProvider enums.AuthProvider) (*ent.User, error) { + user, err := transaction.FromContext(ctx).User.Query().WithSetting(). + Where(user.ID(id)). + Where(user.AuthProviderEQ(authProvider)). + Only(ctx) + if err != nil { + h.Logger.Errorw("error obtaining user from id", "error", err) + + return nil, err + } + + // Add webauthn to the response + user.Edges.Webauthn = user.QueryWebauthn().AllX(ctx) + + return user, nil +} + +// addCredentialToUser adds a new webauthn credential to the user +func (h *Handler) addCredentialToUser(ctx context.Context, user *ent.User, credential gowebauthn.Credential) error { + transports := []string{} + for _, t := range credential.Transport { + transports = append(transports, string(t)) + } + + count, err := transaction.FromContext(ctx).Webauthn.Query().Where( + webauthn.OwnerID(user.ID), + ).Count(ctx) + if err != nil { + h.Logger.Errorw("error checking existing webauthn credentials", "error", err) + + return err + } + + if count >= h.OauthProvider.Webauthn.MaxDevices { + h.Logger.Errorw("max devices reached", "error", err) + + return ErrMaxDeviceLimit + } + + _, err = transaction.FromContext(ctx).Webauthn.Create(). + SetOwnerID(user.ID). + SetTransports(transports). + SetAttestationType(credential.AttestationType). + SetAaguid(credential.Authenticator.AAGUID). + SetCredentialID(credential.ID). + SetPublicKey(credential.PublicKey). + SetBackupState(credential.Flags.BackupEligible). + SetBackupEligible(credential.Flags.BackupEligible). + SetUserPresent(credential.Flags.UserPresent). + SetUserVerified(credential.Flags.UserVerified). + SetSignCount(int32(credential.Authenticator.SignCount)). // nolint:gosec + Save(ctx) + if err != nil { + h.Logger.Errorw("error creating email verification token", "error", err) + + return err + } + + return nil +} + +// getUserDetailsByID returns the ent user with the user settings based on the user ID +func (h *Handler) getUserDetailsByID(ctx context.Context, userID string) (*ent.User, error) { + user, err := transaction.FromContext(ctx).User.Query().WithSetting().Where( + user.ID(userID), + ).Only(ctx) + if err != nil { + h.Logger.Errorf("error retrieving user", "error", err) + + return nil, err + } + + return user, nil +} + +// getUserByInviteToken returns the ent user based on the invite token in the request +func (h *Handler) getUserByInviteToken(ctx context.Context, token string) (*ent.Invite, error) { + recipient, err := transaction.FromContext(ctx).Invite.Query(). + Where( + invite.Token(token), + ).WithOwner().Only(ctx) + + if err != nil { + h.Logger.Errorw("error obtaining user from token", "error", err) + + return nil, err + } + + return recipient, err +} + +// countVerificationTokensUserByEmail counts number of existing email verification attempts before issuing a new one +func (h *Handler) countVerificationTokensUserByEmail(ctx context.Context, email string) (int, error) { + attempts, err := transaction.FromContext(ctx).EmailVerificationToken.Query().WithOwner().Where( + emailverificationtoken.And( + emailverificationtoken.Email(email), + )).Count(ctx) + if err != nil { + h.Logger.Errorw("error counting verification reset tokens", "error", err) + + return 0, err + } + + return attempts, nil +} + +// expireAllVerificationTokensUserByEmail expires all existing email verification tokens before issuing a new one +func (h *Handler) expireAllVerificationTokensUserByEmail(ctx context.Context, email string) error { + prs, err := transaction.FromContext(ctx).EmailVerificationToken.Query().WithOwner().Where( + emailverificationtoken.And( + emailverificationtoken.Email(email), + emailverificationtoken.TTLGT(time.Now()), + )).All(ctx) + if err != nil { + h.Logger.Errorw("error obtaining verification reset tokens", "error", err) + + return err + } + + for _, pr := range prs { + if err := pr.Update().SetTTL(time.Now()).Exec(ctx); err != nil { + h.Logger.Errorw("error expiring verification token", "error", err) + + return err + } + } + + return nil +} + +// expireAllResetTokensUserByEmail expires all existing password reset tokens before issuing a new one +func (h *Handler) expireAllResetTokensUserByEmail(ctx context.Context, email string) error { + prs, err := transaction.FromContext(ctx).PasswordResetToken.Query().WithOwner().Where( + passwordresettoken.And( + passwordresettoken.Email(email), + passwordresettoken.TTLGT(time.Now()), + )).All(ctx) + if err != nil { + h.Logger.Errorw("error obtaining password reset tokens", "error", err) + + return err + } + + for _, pr := range prs { + if err := pr.Update().SetTTL(time.Now()).Exec(ctx); err != nil { + h.Logger.Errorw("error expiring password reset token", "error", err) + + return err + } + } + + return nil +} + +// setEmailConfirmed sets the user setting field email_confirmed to true within a transaction +func (h *Handler) setEmailConfirmed(ctx context.Context, user *ent.User) error { + if _, err := transaction.FromContext(ctx).UserSetting.Update().SetEmailConfirmed(true). + Where( + usersetting.ID(user.Edges.Setting.ID), + ).Save(ctx); err != nil { + h.Logger.Errorw("error setting email confirmed", "error", err) + + return err + } + + return nil +} + +// updateUserPassword changes a updates a user's password in the database +func (h *Handler) updateUserPassword(ctx context.Context, id string, password string) error { + if _, err := transaction.FromContext(ctx).User.UpdateOneID(id).SetPassword(password).Save(ctx); err != nil { + h.Logger.Errorw("error updating user password", "error", err) + + return err + } + + return nil +} + +// addDefaultOrgToUserQuery adds the default org to the user object, user must be authenticated before calling this +func (h *Handler) addDefaultOrgToUserQuery(ctx context.Context, user *ent.User) error { + // get the default org for the user, allow access, accessible orgs will be filtered by the interceptor + orgCtx := privacy.DecisionContext(ctx, privacy.Allow) + + org, err := user.Edges.Setting.DefaultOrg(orgCtx) + if err != nil { + h.Logger.Errorw("error obtaining default org", "error", err) + + return err + } + + // add default org to user object + user.Edges.Setting.Edges.DefaultOrg = org + + return nil +} + +// CheckAndCreateUser takes a user with an OauthTooToken set in the context and checks if the user is already created +// if the user already exists, update last seen +func (h *Handler) CheckAndCreateUser(ctx context.Context, name, email string, provider enums.AuthProvider, image string) (*ent.User, error) { + // check if users exists + entUser, err := h.getUserByEmail(ctx, email, provider) + if err != nil { + // if the user is not found, create now + if ent.IsNotFound(err) { + // create the input based on the provider + input := createUserInput(name, email, provider, image) + + // create user in the database + entUser, err = h.createUser(ctx, input) + if err != nil { + h.Logger.Errorw("error creating new user", "error", err) + + return nil, err + } + + // return newly created user + return entUser, nil + } + + return nil, err + } + + // update last seen of user + if err := h.updateUserLastSeen(ctx, entUser.ID); err != nil { + h.Logger.Errorw("unable to update last seen", "error", err) + + return nil, err + } + + // update user avatar + if err := h.updateUserAvatar(ctx, entUser, image); err != nil { + h.Logger.Errorw("error updating user avatar", "error", err) + + return nil, err + } + + return entUser, nil +} + +// createUserInput creates a new user input based on the name, email, image and provider +func createUserInput(name, email string, provider enums.AuthProvider, image string) ent.CreateUserInput { + lastSeen := time.Now().UTC() + + // create new user input + input := parseName(name) + input.Email = email + input.AuthProvider = &provider + input.LastSeen = &lastSeen + + if image != "" { + input.AvatarRemoteURL = &image + } + + return input +} + +func (h *Handler) updateUserAvatar(ctx context.Context, user *ent.User, image string) error { + if image == "" { + return nil + } + + if user.AvatarRemoteURL != nil && *user.AvatarRemoteURL == image { + return nil + } + + if _, err := transaction.FromContext(ctx). + User.UpdateOneID(user.ID). + SetAvatarRemoteURL(image). + Save(ctx); err != nil { + h.Logger.Errorw("error updating user avatar", "error", err) + return err + } + + return nil +} + +// setWebauthnAllowed sets the user setting field is_webauthn_allowed to true within a transaction +func (h *Handler) setWebauthnAllowed(ctx context.Context, user *ent.User) error { + if _, err := transaction.FromContext(ctx).UserSetting.Update().SetIsWebauthnAllowed(true). + Where( + usersetting.UserID(user.ID), + ).Save(ctx); err != nil { + h.Logger.Errorw("error setting webauthn allowed", "error", err) + + return err + } + + return nil +} + +// getSubscriberByToken returns the subscriber based on the token in the request +func (h *Handler) getSubscriberByToken(ctx context.Context, token string) (*ent.Subscriber, error) { + subscriber, err := transaction.FromContext(ctx).Subscriber.Query(). + Where( + subscriber.Token(token), + ). + Only(ctx) + if err != nil { + h.Logger.Errorw("error obtaining subscriber from verification token", "error", err) + + return nil, err + } + + return subscriber, nil +} + +// getOrgByID returns the organization based on the id in the request +func (h *Handler) getOrgByID(ctx context.Context, id string) (*ent.Organization, error) { + org, err := transaction.FromContext(ctx).Organization.Get(ctx, id) + if err != nil { + h.Logger.Errorw("error obtaining organization from id", "error", err) + + return nil, err + } + + return org, nil +} diff --git a/internal/httpserve/handlers/ent_test.go b/internal/httpserve/handlers/ent_test.go new file mode 100644 index 0000000..3785045 --- /dev/null +++ b/internal/httpserve/handlers/ent_test.go @@ -0,0 +1,116 @@ +package handlers + +import ( + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/enums" +) + +func TestCreateUserInput(t *testing.T) { + name := "Walter White" + email := "ww@theopenlane.io" + firstName := "Walter" + lastName := "White" + image := gofakeit.URL() + + testCases := []struct { + testName string + name string + email string + provider enums.AuthProvider + expected ent.CreateUserInput + image string + }{ + { + testName: "oauth provider - github", + name: name, + email: email, + provider: enums.AuthProviderGitHub, + expected: ent.CreateUserInput{ + FirstName: &firstName, + LastName: &lastName, + Email: email, + AuthProvider: &enums.AuthProviderGitHub, + LastSeen: lo.ToPtr(time.Now().UTC()), + AvatarRemoteURL: &image, + }, + image: image, + }, + { + testName: "oauth provider - github, only first name", + name: "meow", + email: email, + provider: enums.AuthProviderGitHub, + expected: ent.CreateUserInput{ + FirstName: lo.ToPtr("meow"), + Email: email, + AuthProvider: &enums.AuthProviderGitHub, + LastSeen: lo.ToPtr(time.Now().UTC()), + AvatarRemoteURL: &image, + }, + image: image, + }, + { + testName: "oauth provider - google", + name: name, + email: email, + provider: enums.AuthProviderGoogle, + expected: ent.CreateUserInput{ + FirstName: &firstName, + LastName: &lastName, + Email: email, + AuthProvider: &enums.AuthProviderGoogle, + LastSeen: lo.ToPtr(time.Now().UTC()), + AvatarRemoteURL: &image, + }, + image: image, + }, + { + testName: "webauthn provider", + name: name, + email: email, + provider: enums.AuthProviderWebauthn, + expected: ent.CreateUserInput{ + FirstName: &firstName, + LastName: &lastName, + Email: email, + AuthProvider: &enums.AuthProviderWebauthn, + LastSeen: lo.ToPtr(time.Now().UTC()), + AvatarRemoteURL: nil, + }, + image: "", + }, + { + testName: "no image", + name: "Wanda Maximoff", + email: "wmaximoff@marvel.com", + provider: enums.AuthProviderWebauthn, + expected: ent.CreateUserInput{ + FirstName: lo.ToPtr("Wanda"), + LastName: lo.ToPtr("Maximoff"), + Email: "wmaximoff@marvel.com", + AuthProvider: &enums.AuthProviderWebauthn, + LastSeen: lo.ToPtr(time.Now().UTC()), + AvatarRemoteURL: nil, + }, + image: "", + }, + } + for _, tc := range testCases { + t.Run(tc.testName, func(t *testing.T) { + input := createUserInput(tc.name, tc.email, tc.provider, tc.image) + assert.Equal(t, tc.expected.FirstName, input.FirstName) + assert.Equal(t, tc.expected.LastName, input.LastName) + assert.Equal(t, tc.expected.Email, input.Email) + assert.Equal(t, tc.expected.AuthProvider, input.AuthProvider) + assert.WithinDuration(t, *tc.expected.LastSeen, *input.LastSeen, 1*time.Minute) // allow for a reasonable drift while tests are running + assert.Equal(t, tc.expected.AvatarRemoteURL, input.AvatarRemoteURL) + }) + } +} diff --git a/internal/httpserve/handlers/errors.go b/internal/httpserve/handlers/errors.go new file mode 100644 index 0000000..53359c7 --- /dev/null +++ b/internal/httpserve/handlers/errors.go @@ -0,0 +1,229 @@ +package handlers + +import ( + "errors" + "fmt" + "net/http" + "strings" + + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" +) + +var ( + // ErrBadRequest is returned when the request cannot be processed + ErrBadRequest = errors.New("invalid request") + + // ErrProcessingRequest is returned when the request cannot be processed + ErrProcessingRequest = errors.New("error processing request, please try again") + + // ErrMissingRequiredFields is returned when the login request has an empty username or password + ErrMissingRequiredFields = errors.New("invalid request, missing username and/or password") + + // ErrInvalidInput is returned when the input is invalid + ErrInvalidInput = errors.New("invalid input") + + // ErrNotFound is returned when the requested object is not found + ErrNotFound = errors.New("object not found in the database") + + // ErrMissingField is returned when a field is missing duh + ErrMissingField = errors.New("missing required field") + + // ErrInvalidCredentials is returned when the password is invalid or missing + ErrInvalidCredentials = errors.New("credentials are missing or invalid") + + // ErrUnverifiedUser is returned when email_verified on the user is false + ErrUnverifiedUser = errors.New("user is not verified") + + // ErrUnableToVerifyEmail is returned when user's email is not able to be verified + ErrUnableToVerifyEmail = errors.New("could not verify email") + + // ErrMaxAttempts is returned when user has requested the max retry attempts to verify their email + ErrMaxAttempts = errors.New("max attempts verifying email address") + + // ErrNoEmailFound is returned when using an oauth provider and the email address cannot be determined + ErrNoEmailFound = errors.New("no email found from oauth provider") + + // ErrInvalidProvider is returned when registering a user with an unsupported oauth provider + ErrInvalidProvider = errors.New("oauth2 provider not supported") + + // ErrNoAuthUser is returned when the user couldn't be identified by the request + ErrNoAuthUser = errors.New("could not identify authenticated user in request") + + // ErrPassWordResetTokenInvalid is returned when the provided token and secret do not match the stored + ErrPassWordResetTokenInvalid = errors.New("password reset token invalid") + + // ErrNonUniquePassword is returned when the password was already used + ErrNonUniquePassword = errors.New("password was already used, please try again") + + // ErrPasswordTooWeak is returned when the password is too weak + ErrPasswordTooWeak = errors.New("password is too weak: use a combination of upper and lower case letters, numbers, and special characters") + + // ErrMaxDeviceLimit is returned when the user has reached the max device limit + ErrMaxDeviceLimit = errors.New("max device limit reached") + + // ErrDeviceAlreadyRegistered is returned when the device is already registered + ErrDeviceAlreadyRegistered = errors.New("device already registered") + + // ErrSubscriberNotFound is returned when the subscriber is not found + ErrSubscriberNotFound = errors.New("subscriber not found") + + // ErrExpiredToken is returned when the token has expired + ErrExpiredToken = errors.New("token has expired") + + // ErrUnauthorized is returned when the user is not authorized to make the request + ErrUnauthorized = errors.New("not authorized") + + // ErrConflict is returned when the request cannot be processed due to a conflict + ErrConflict = errors.New("conflict") + + // ErrAlreadySwitchedIntoOrg is returned when a user attempts to switch into an org they are currently authenticated in + ErrAlreadySwitchedIntoOrg = errors.New("user already switched into organization") +) + +var ( + // DeviceRegisteredErrCode is returned when the device is already registered + DeviceRegisteredErrCode rout.ErrorCode = "DEVICE_REGISTERED" + // UserExistsErrCode is returned when the user already exists + UserExistsErrCode rout.ErrorCode = "USER_EXISTS" + // InvalidInputErrCode is returned when the input is invalid + InvalidInputErrCode rout.ErrorCode = "INVALID_INPUT" +) + +// IsConstraintError returns true if the error resulted from a database constraint violation. +func IsConstraintError(err error) bool { + var e *generated.ConstraintError + return errors.As(err, &e) || IsUniqueConstraintError(err) || IsForeignKeyConstraintError(err) +} + +// IsUniqueConstraintError reports if the error resulted from a DB uniqueness constraint violation. +// e.g. duplicate value in unique index. +func IsUniqueConstraintError(err error) bool { + if err == nil { + return false + } + + for _, s := range []string{ + "Error 1062", // MySQL + "violates unique constraint", // Postgres + "UNIQUE constraint failed", // SQLite + } { + if strings.Contains(err.Error(), s) { + return true + } + } + + return false +} + +// IsForeignKeyConstraintError reports if the error resulted from a database foreign-key constraint violation. +// e.g. parent row does not exist. +func IsForeignKeyConstraintError(err error) bool { + if err == nil { + return false + } + + for _, s := range []string{ + "Error 1451", // MySQL (Cannot delete or update a parent row). + "Error 1452", // MySQL (Cannot add or update a child row). + "violates foreign key constraint", // Postgres + "FOREIGN KEY constraint failed", // SQLite + } { + if strings.Contains(err.Error(), s) { + return true + } + } + + return false +} + +func invalidInputError(err error) error { + field := err.(*generated.ValidationError).Name + + return fmt.Errorf("%w: %s was invalid", ErrInvalidInput, field) +} + +// InternalServerError returns a 500 Internal Server Error response with the error message. +func (h *Handler) InternalServerError(ctx echo.Context, err error) error { + if err := ctx.JSON(http.StatusInternalServerError, rout.ErrorResponse(err)); err != nil { + return err + } + + return err +} + +// Unauthorized returns a 401 Unauthorized response with the error message. +func (h *Handler) Unauthorized(ctx echo.Context, err error) error { + if err := ctx.JSON(http.StatusUnauthorized, rout.ErrorResponse(err)); err != nil { + return err + } + + return err +} + +// NotFound returns a 404 Not Found response with the error message. +func (h *Handler) NotFound(ctx echo.Context, err error) error { + if err := ctx.JSON(http.StatusNotFound, rout.ErrorResponse(err)); err != nil { + return err + } + + return err +} + +// BadRequest returns a 400 Bad Request response with the error message. +func (h *Handler) BadRequest(ctx echo.Context, err error) error { + if err := ctx.JSON(http.StatusBadRequest, rout.ErrorResponse(err)); err != nil { + return err + } + + return err +} + +// BadRequest returns a 400 Bad Request response with the error message. +func (h *Handler) BadRequestWithCode(ctx echo.Context, err error, code rout.ErrorCode) error { + if err := ctx.JSON(http.StatusBadRequest, rout.ErrorResponseWithCode(err, code)); err != nil { + return err + } + + return err +} + +// InvalidInput returns a 400 Bad Request response with the error message. +func (h *Handler) InvalidInput(ctx echo.Context, err error) error { + if err := ctx.JSON(http.StatusBadRequest, rout.ErrorResponseWithCode(err, InvalidInputErrCode)); err != nil { + return err + } + + return err +} + +// Conflict returns a 409 Conflict response with the error message. +func (h *Handler) Conflict(ctx echo.Context, err string, code rout.ErrorCode) error { + if err := ctx.JSON(http.StatusConflict, rout.ErrorResponseWithCode(err, code)); err != nil { + return err + } + + return fmt.Errorf("%w: %v", ErrConflict, err) +} + +// TooManyRequests returns a 429 Too Many Requests response with the error message. +func (h *Handler) TooManyRequests(ctx echo.Context, err error) error { + if err := ctx.JSON(http.StatusTooManyRequests, rout.ErrorResponse(err)); err != nil { + return err + } + + return err +} + +// Success returns a 200 OK response with the response object. +func (h *Handler) Success(ctx echo.Context, rep interface{}) error { + return ctx.JSON(http.StatusOK, rep) +} + +// Created returns a 201 Created response with the response object. +func (h *Handler) Created(ctx echo.Context, rep interface{}) error { + return ctx.JSON(http.StatusCreated, rep) +} diff --git a/internal/httpserve/handlers/eventpublisher.go b/internal/httpserve/handlers/eventpublisher.go new file mode 100644 index 0000000..2d91e18 --- /dev/null +++ b/internal/httpserve/handlers/eventpublisher.go @@ -0,0 +1,54 @@ +package handlers + +import ( + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/pkg/models" +) + +// EventPublisher publishes an event to the configured topic in the message payload - today this can be anything but there is no event consumer on the other side yet +func (h *Handler) EventPublisher(ctx echo.Context) error { + var in models.PublishRequest + if err := ctx.Bind(&in); err != nil { + return h.BadRequest(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := h.EventManager.Publish(in.Topic, []byte(in.Message)); err != nil { + return h.InternalServerError(ctx, err) + } + + out := &models.PublishReply{ + Reply: rout.Reply{Success: true}, + Message: "success!", + } + + return h.Success(ctx, out) +} + +// BindEventPublisher is used to bind the event publisher endpoint to the OpenAPI schema +func (h *Handler) BindEventPublisher() *openapi3.Operation { + eventCreate := openapi3.NewOperation() + eventCreate.Description = "Publish and Correleate Events" + eventCreate.OperationID = "EventPublisher" + eventCreate.Security = &openapi3.SecurityRequirements{ + openapi3.SecurityRequirement{ + "apiKey": []string{}, + }, + } + + h.AddRequestBody("EventPublishRequest", models.ExamplePublishSuccessRequest, eventCreate) + h.AddResponse("EventPublishReply", "success", models.ExamplePublishSuccessResponse, eventCreate, http.StatusOK) + eventCreate.AddResponse(http.StatusInternalServerError, internalServerError()) + eventCreate.AddResponse(http.StatusBadRequest, badRequest()) + + return eventCreate +} diff --git a/internal/httpserve/handlers/forgotpassword.go b/internal/httpserve/handlers/forgotpassword.go new file mode 100644 index 0000000..b181e8f --- /dev/null +++ b/internal/httpserve/handlers/forgotpassword.go @@ -0,0 +1,114 @@ +package handlers + +import ( + "context" + "net/http" + + "github.com/cenkalti/backoff/v4" + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/rout" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" +) + +// ForgotPassword will send an forgot password email if the provided email exists +func (h *Handler) ForgotPassword(ctx echo.Context) error { + var in models.ForgotPasswordRequest + if err := ctx.Bind(&in); err != nil { + return h.BadRequest(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + out := &models.ForgotPasswordReply{ + Reply: rout.Reply{ + Success: true, + }, + Message: "We've received your request to have the password associated with this email reset. Please check your email.", + } + + entUser, err := h.getUserByEmail(ctx.Request().Context(), in.Email, enums.AuthProviderCredentials) + if err != nil { + if ent.IsNotFound(err) { + // return a 200 response even if user is not found to avoid + // exposing confidential information + return h.Success(ctx, out) + } + + h.Logger.Errorf("error retrieving user email", "error", err) + + return h.InternalServerError(ctx, err) + } + + // create password reset email token + user := &User{ + FirstName: entUser.FirstName, + LastName: entUser.LastName, + Email: entUser.Email, + ID: entUser.ID, + } + + authCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: entUser.ID, + }) + + if _, err = h.storeAndSendPasswordResetToken(authCtx, user); err != nil { + return h.InternalServerError(ctx, err) + } + + return h.Success(ctx, out) +} + +// storeAndSendPasswordResetToken creates a password reset token for the user and sends an email with the token +func (h *Handler) storeAndSendPasswordResetToken(ctx context.Context, user *User) (*ent.PasswordResetToken, error) { + if err := h.expireAllResetTokensUserByEmail(ctx, user.Email); err != nil { + h.Logger.Errorw("error expiring existing tokens", "error", err) + + return nil, err + } + + if err := user.CreatePasswordResetToken(); err != nil { + h.Logger.Errorw("unable to create password reset token", "error", err) + return nil, err + } + + meowtoken, err := h.createPasswordResetToken(ctx, user) + if err != nil { + return nil, err + } + + // send emails via TaskMan as to not create blocking operations in the server + if err := h.TaskMan.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return h.SendPasswordResetRequestEmail(user) + }), marionette.WithRetries(3), //nolint:mnd + marionette.WithBackoff(backoff.NewExponentialBackOff()), + marionette.WithErrorf("could not send password reset email to user %s", user.ID), + ); err != nil { + return nil, err + } + + return meowtoken, nil +} + +// BindForgotPassword is used to bind the forgot password endpoint to the OpenAPI schema +func (h *Handler) BindForgotPassword() *openapi3.Operation { + forgotPassword := openapi3.NewOperation() + forgotPassword.Description = "ForgotPassword is a service for users to request a password reset email. The email address must be provided in the POST request and the user must exist in the database. This endpoint always returns 200 regardless of whether the user exists or not to avoid leaking information about users in the database" + forgotPassword.OperationID = "ForgotPassword" + forgotPassword.Security = &openapi3.SecurityRequirements{} + + h.AddRequestBody("ForgotPasswordRequest", models.ExampleForgotPasswordSuccessRequest, forgotPassword) + h.AddResponse("ForgotPasswordReply", "success", models.ExampleForgotPasswordSuccessResponse, forgotPassword, http.StatusOK) + forgotPassword.AddResponse(http.StatusInternalServerError, internalServerError()) + forgotPassword.AddResponse(http.StatusBadRequest, badRequest()) + + return forgotPassword +} diff --git a/internal/httpserve/handlers/forgotpassword_test.go b/internal/httpserve/handlers/forgotpassword_test.go new file mode 100644 index 0000000..3bef0dd --- /dev/null +++ b/internal/httpserve/handlers/forgotpassword_test.go @@ -0,0 +1,154 @@ +package handlers_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/rShetty/asyncwait" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/emails/mock" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestForgotPasswordHandler() { + t := suite.T() + + // setup handler + suite.e.POST("forgot-password", suite.h.ForgotPassword) + + ec := echocontext.NewTestEchoContext().Request().Context() + + // create user in the database + ctx := privacy.DecisionContext(ec, privacy.Allow) + + // add mocks for writes + mock_fga.WriteAny(t, suite.fga) + + userSetting := suite.db.UserSetting.Create(). + SetEmailConfirmed(false). + SaveX(ctx) + + _ = suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail("asandler@theopenlane.io"). + SetPassword(validPassword). + SetSetting(userSetting). + SaveX(ctx) + + var mitb = "mitb@theopenlane.io" + + testCases := []struct { + name string + from string + email string + emailExpected bool + expectedErrMessage string + expectedStatus int + }{ + { + name: "happy path", + email: "asandler@theopenlane.io", + from: mitb, + emailExpected: true, + expectedStatus: http.StatusOK, + }, + { + name: "email does not exist, should still return 200", + email: "asandler1@theopenlane.io", + from: mitb, + emailExpected: false, + expectedStatus: http.StatusOK, + }, + { + name: "email not sent in request", + from: mitb, + emailExpected: false, + expectedStatus: http.StatusBadRequest, + expectedErrMessage: "email is required", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + sent := time.Now() + + mock.ResetEmailMock() + + resendJSON := models.ForgotPasswordRequest{ + Email: tc.email, + } + + body, err := json.Marshal(resendJSON) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, "/forgot-password", strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + assert.Equal(t, tc.expectedStatus, recorder.Code) + + if tc.expectedStatus != http.StatusOK { + var out *models.ForgotPasswordReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + assert.Contains(t, out.Error, tc.expectedErrMessage) + assert.False(t, out.Success) + } + + // Test that one verify email was sent to each user + messages := []*mock.EmailMetadata{ + { + To: tc.email, + From: tc.from, + Subject: emails.PasswordResetRequestRE, + Timestamp: sent, + }, + } + + // wait for messages + predicate := func() bool { + return suite.h.TaskMan.GetQueueLength() == 0 + } + successful := asyncwait.NewAsyncWait(maxWaitInMillis, pollIntervalInMillis).Check(predicate) + + if successful != true { + t.Errorf("max wait of email send") + } + + if tc.emailExpected { + mock.CheckEmails(t, messages) + } else { + mock.CheckEmails(t, nil) + } + }) + } +} diff --git a/internal/httpserve/handlers/handlers.go b/internal/httpserve/handlers/handlers.go new file mode 100644 index 0000000..36b6595 --- /dev/null +++ b/internal/httpserve/handlers/handlers.go @@ -0,0 +1,58 @@ +package handlers + +import ( + "github.com/go-webauthn/webauthn/webauthn" + "github.com/lestrrat-go/jwx/v2/jwk" + "github.com/redis/go-redis/v9" + echo "github.com/theopenlane/echox" + "go.uber.org/zap" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/totp" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/httpserve/authmanager" + "github.com/theopenlane/core/pkg/analytics" + "github.com/theopenlane/core/pkg/events/kafka/publisher" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" +) + +// Handler contains configuration options for handlers +type Handler struct { + // IsTest is a flag to determine if the application is running in test mode and will mock external calls + IsTest bool + // DBClient to interact with the generated ent schema + DBClient *ent.Client + // RedisClient to interact with redis + RedisClient *redis.Client + // AuthManager contains the required configuration for the auth session creation + AuthManager *authmanager.Config + // TokenManager contains the token manager in order to validate auth requests + TokenManager *tokens.TokenManager + // Logger provides the zap logger to do logging things from the handlers + Logger *zap.SugaredLogger + // ReadyChecks is a set of checkFuncs to determine if the application is "ready" upon startup + ReadyChecks Checks + // JWTKeys contains the set of valid JWT authentication key + JWTKeys jwk.Set + // SessionConfig to handle sessions + SessionConfig *sessions.SessionConfig + // EmailManager to handle sending emails + EmailManager *emails.EmailManager + // TaskMan manages tasks in a separate goroutine to allow for non blocking operations + TaskMan *marionette.TaskManager + // AnalyticsClient is the client used to send analytics events + AnalyticsClient *analytics.EventManager + // OauthProvider contains the configuration settings for all supported Oauth2 providers + OauthProvider OauthProviderConfig + // AuthMiddleware contains the middleware to be used for authenticated endpoints + AuthMiddleware []echo.MiddlewareFunc + // WebAuthn contains the configuration settings for the webauthn provider + WebAuthn *webauthn.WebAuthn + // OTPManager contains the configuration settings for the OTP provider + OTPManager *totp.Manager + // EventManager contains the configuration settings for the event publisher + EventManager *publisher.KafkaPublisher +} diff --git a/internal/httpserve/handlers/invite.go b/internal/httpserve/handlers/invite.go new file mode 100644 index 0000000..af64b42 --- /dev/null +++ b/internal/httpserve/handlers/invite.go @@ -0,0 +1,276 @@ +package handlers + +import ( + "context" + "errors" + "net/http" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/getkin/kin-openapi/openapi3" + "github.com/oklog/ulid/v2" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/middleware/transaction" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/tokens" +) + +// Invite holds the Token, InviteToken references, and the additional user input to complete acceptance of the invitation +type Invite struct { + Token string + UserID ulid.ULID + Email string + DestOrgID ulid.ULID + Role enums.Role + InviteToken +} + +// InviteToken holds data specific to a future user of the system for invite logic +type InviteToken struct { + Expires sql.NullString + Token sql.NullString + Secret []byte +} + +// OrganizationInviteAccept is responsible for handling the invitation of a user to an organization. +// It receives a request with the user's invitation details, validates the request, +// and creates organization membership for the user +// On success, it returns a response with the organization information +func (h *Handler) OrganizationInviteAccept(ctx echo.Context) error { + // parse the token out of the context + in := new(models.InviteRequest) + if err := ctx.Bind(in); err != nil { + return h.BadRequest(ctx, err) + } + + reqCtx := ctx.Request().Context() + + // get the authenticated user from the context + userID, err := auth.GetUserIDFromContext(reqCtx) + if err != nil { + h.Logger.Errorw("unable to get user id from context", "error", err) + + return h.BadRequest(ctx, err) + } + + inv := &Invite{ + Token: in.Token, + } + + // ensure the user that is logged in, matches the invited user + if err := inv.validateInviteRequest(); err != nil { + return h.BadRequest(ctx, err) + } + + // set the initial context based on the token + ctxWithToken := token.NewContextWithOrgInviteToken(reqCtx, inv.Token) + + // fetch the recipient and org owner based on token + invitedUser, err := h.getUserByInviteToken(ctxWithToken, inv.Token) + if err != nil { + if generated.IsNotFound(err) { + return h.BadRequest(ctx, err) + } + + h.Logger.Errorf("error retrieving invite token", "error", err) + + return h.InternalServerError(ctx, nil) + } + + // add email to the invite + inv.Email = invitedUser.Recipient + + // get user details for logged in user + user, err := h.getUserDetailsByID(reqCtx, userID) + if err != nil { + h.Logger.Errorw("unable to get user for request", "error", err) + + return h.Unauthorized(ctx, err) + } + + // ensure the user that is logged in, matches the invited user + if err := inv.validateUser(user.Email); err != nil { + return h.BadRequest(ctx, err) + } + + // string to ulid so we can match the token input + oid, err := ulid.Parse(invitedUser.OwnerID) + if err != nil { + return h.BadRequest(ctx, err) + } + + // string to ulid so we can match the token input + uid, err := ulid.Parse(userID) + if err != nil { + return h.BadRequest(ctx, err) + } + + // construct the invite details but set email to the original recipient, and the joining organization ID as the current owner of the invitation + invite := &Invite{ + Email: invitedUser.Recipient, + UserID: uid, + DestOrgID: oid, + Role: invitedUser.Role, + } + + // set tokens for request + if err := invite.setOrgInviteTokens(invitedUser, inv.Token); err != nil { + h.Logger.Errorw("unable to set invite token for request", "error", err) + + return h.BadRequest(ctx, err) + } + + // reconstruct the token based on recipient & owning organization so we can compare it to the one were receiving + t := &tokens.OrgInviteToken{ + Email: invitedUser.Recipient, + OrgID: oid, + } + + // check and ensure the token has not expired + if t.ExpiresAt, err = invite.GetInviteExpires(); err != nil { + h.Logger.Errorw("unable to parse expiration", "error", err) + + return h.InternalServerError(ctx, err) + } + + // Verify the token is valid with the stored secret + if err = t.Verify(invite.GetInviteToken(), invite.Secret); err != nil { + if errors.Is(err, tokens.ErrTokenExpired) { + if err := updateInviteStatusExpired(ctxWithToken, invitedUser); err != nil { + return err + } + + return h.BadRequest(ctx, ErrExpiredToken) + } + + return h.BadRequest(ctx, err) + } + + if err := updateInviteStatusAccepted(ctxWithToken, invitedUser); err != nil { + h.Logger.Errorw("unable to update invite status", "error", err) + + return h.BadRequest(ctx, err) + } + + // create new claims for the user + auth, err := h.AuthManager.GenerateUserAuthSessionWithOrg(ctx, user, invitedUser.OwnerID) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + return h.InternalServerError(ctx, err) + } + + // reply with the relevant details + out := &models.InviteReply{ + Reply: rout.Reply{Success: true}, + ID: userID, + Email: invitedUser.Recipient, + JoinedOrgID: invitedUser.OwnerID, + Role: string(invitedUser.Role), + Message: "Welcome to your new organization!", + AuthData: *auth, + } + + return h.Created(ctx, out) +} + +// validateInviteRequest validates the required fields are set in the user request +func (i *Invite) validateInviteRequest() error { + // ensure the token is set + if i.Token == "" { + return rout.NewMissingRequiredFieldError("token") + } + + return nil +} + +func (i *Invite) validateUser(email string) error { + // ensure the logged in user is the same as the invite + if i.Email != email { + return ErrUnableToVerifyEmail + } + + return nil +} + +// GetInviteToken returns the invitation token if its valid +func (i *Invite) GetInviteToken() string { + if i.InviteToken.Token.Valid { + return i.InviteToken.Token.String + } + + return "" +} + +// GetInviteExpires returns the expiration time of invite token +func (i *Invite) GetInviteExpires() (time.Time, error) { + if i.InviteToken.Expires.Valid { + return time.Parse(time.RFC3339Nano, i.InviteToken.Expires.String) + } + + return time.Time{}, nil +} + +// setOrgInviteTokens sets the fields of the `Invite` struct to verify the email +// invitation. It takes in an `Invite` object and an invitation token as parameters. If +// the invitation token matches the token stored in the `Invite` object, it sets the +// `Token`, `Secret`, and `Expires` fields of the `InviteToken` struct. This allows the +// token to be verified later when the user accepts the invitation +func (i *Invite) setOrgInviteTokens(inv *generated.Invite, invToken string) error { + if inv.Token == invToken { + i.InviteToken.Token = sql.NullString{String: inv.Token, Valid: true} + i.InviteToken.Secret = *inv.Secret + i.InviteToken.Expires = sql.NullString{String: inv.Expires.Format(time.RFC3339Nano), Valid: true} + + return nil + } + + return ErrNotFound +} + +// updateInviteStatusAccepted updates the status of an invite to "Accepted" +func updateInviteStatusAccepted(ctx context.Context, i *generated.Invite) error { + _, err := transaction.FromContext(ctx).Invite.UpdateOneID(i.ID).SetStatus(enums.InvitationAccepted).Save(ctx) + if err != nil { + return err + } + + return nil +} + +// updateInviteStatusAccepted updates the status of an invite to "Expired" +func updateInviteStatusExpired(ctx context.Context, i *generated.Invite) error { + _, err := transaction.FromContext(ctx).Invite.UpdateOneID(i.ID).SetStatus(enums.InvitationExpired).Save(ctx) + if err != nil { + return err + } + + return nil +} + +// BindOrganizationInviteAccept returns the OpenAPI3 operation for accepting an organization invite +func (h *Handler) BindOrganizationInviteAccept() *openapi3.Operation { + inviteAccept := openapi3.NewOperation() + inviteAccept.Description = "Accept an Organization Invite" + inviteAccept.OperationID = "OrganizationInviteAccept" + inviteAccept.Security = &openapi3.SecurityRequirements{ + openapi3.SecurityRequirement{ + "bearerAuth": []string{}, + }, + } + + h.AddRequestBody("InviteRequest", models.ExampleInviteRequest, inviteAccept) + h.AddResponse("InviteReply", "success", models.ExampleInviteResponse, inviteAccept, http.StatusCreated) + inviteAccept.AddResponse(http.StatusInternalServerError, internalServerError()) + inviteAccept.AddResponse(http.StatusBadRequest, badRequest()) + inviteAccept.AddResponse(http.StatusUnauthorized, unauthorized()) + + return inviteAccept +} diff --git a/internal/httpserve/handlers/invite_test.go b/internal/httpserve/handlers/invite_test.go new file mode 100644 index 0000000..b2eb3dd --- /dev/null +++ b/internal/httpserve/handlers/invite_test.go @@ -0,0 +1,199 @@ +package handlers_test + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/rShetty/asyncwait" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/emails/mock" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *HandlerTestSuite) TestOrgInviteAcceptHandler() { + t := suite.T() + + // add handler + suite.e.GET("invite", suite.h.OrganizationInviteAccept) + + // bypass auth + ctx := context.Background() + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + mock_fga.WriteAny(t, suite.fga) + mock_fga.CheckAny(t, suite.fga, true) + + // setup test data + requestor := suite.db.User.Create(). + SetEmail("rocket@theopenlane.io"). + SetFirstName("Rocket"). + SetLastName("Racoon"). + SaveX(ctx) + + reqCtx, err := userContextWithID(requestor.ID) + require.NoError(t, err) + + input := openlaneclient.CreateOrganizationInput{ + Name: "avengers", + } + + org, err := suite.api.CreateOrganization(reqCtx, input) + require.NoError(t, err) + + var groot = "groot@theopenlane.io" + + // recipient test data + recipient := suite.db.User.Create(). + SetEmail(groot). + SetFirstName("Groot"). + SetLastName("JustGroot"). + SetAuthProvider(enums.AuthProviderGoogle). + SaveX(ctx) + + userCtx, err := auth.NewTestContextWithOrgID(requestor.ID, org.CreateOrganization.Organization.ID) + require.NoError(t, err) + + userSetting, err := recipient.Setting(ctx) + require.NoError(t, err) + + recipientCtx, err := auth.NewTestContextWithOrgID(recipient.ID, userSetting.Edges.DefaultOrg.ID) + require.NoError(t, err) + + testCases := []struct { + name string + email string + tokenSet bool + emailExpected bool + wantErr bool + errMsg string + }{ + { + name: "happy path", + email: groot, + emailExpected: true, + tokenSet: true, + }, + { + name: "missing token", + email: groot, + tokenSet: false, + wantErr: true, + errMsg: "token is required", + }, + { + name: "emails do not match token", + email: "drax@theopenlane.io", + tokenSet: true, + wantErr: true, + errMsg: "could not verify email", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + sent := time.Now() + + mock.ResetEmailMock() + + ctx := privacy.DecisionContext(userCtx, privacy.Allow) + + invite := suite.db.Invite.Create(). + SetRecipient(tc.email).SaveX(ctx) + + // wait for messages so we don't have conflicts with the accept message + predicate := func() bool { + return suite.h.TaskMan.GetQueueLength() == 0 + } + + asyncwait.NewAsyncWait(maxWaitInMillis, pollIntervalInMillis).Check(predicate) + + mock.ResetEmailMock() + + target := "/invite" + if tc.tokenSet { + target = fmt.Sprintf("/invite?token=%s", invite.Token) + } + + req := httptest.NewRequest(http.MethodGet, target, nil) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req.WithContext(recipientCtx)) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.InviteReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + if tc.wantErr { + assert.Equal(t, http.StatusBadRequest, recorder.Code) + + assert.Equal(t, tc.errMsg, out.Error) + + return + } + + assert.Equal(t, http.StatusCreated, recorder.Code) + assert.Equal(t, org.CreateOrganization.Organization.ID, out.JoinedOrgID) + assert.Equal(t, tc.email, out.Email) + + // Test the default org is updated + user, err := suite.api.GetUserByID(recipientCtx, recipient.ID) + require.NoError(t, err) + require.NotNil(t, user) + require.NotNil(t, user.User.Setting.DefaultOrg) + + assert.Equal(t, org.CreateOrganization.Organization.ID, user.User.Setting.DefaultOrg.ID) + + // Test that one email was sent for accepted invite + messages := []*mock.EmailMetadata{ + { + To: tc.email, + From: "mitb@theopenlane.io", + Subject: emails.InviteBeenAccepted, + Timestamp: sent, + }, + } + + // wait for messages + predicate = func() bool { + return suite.h.TaskMan.GetQueueLength() == 0 + } + successful := asyncwait.NewAsyncWait(maxWaitInMillis, pollIntervalInMillis).Check(predicate) + + if successful != true { + t.Errorf("max wait of email send") + } + + if tc.emailExpected { + mock.CheckEmails(t, messages) + } else { + mock.CheckEmails(t, nil) + } + }) + } +} diff --git a/internal/httpserve/handlers/login.go b/internal/httpserve/handlers/login.go new file mode 100644 index 0000000..3012710 --- /dev/null +++ b/internal/httpserve/handlers/login.go @@ -0,0 +1,102 @@ +package handlers + +import ( + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + ph "github.com/posthog/posthog-go" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/passwd" +) + +// LoginHandler validates the user credentials and returns a valid cookie +// this handler only supports username password login +func (h *Handler) LoginHandler(ctx echo.Context) error { + var in models.LoginRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + // check user in the database, username == email and ensure only one record is returned + user, err := h.getUserByEmail(ctx.Request().Context(), in.Username, enums.AuthProviderCredentials) + if err != nil { + return h.BadRequest(ctx, auth.ErrNoAuthUser) + } + + if user.Edges.Setting.Status != "ACTIVE" { + return h.BadRequest(ctx, auth.ErrNoAuthUser) + } + + // verify the password is correct + valid, err := passwd.VerifyDerivedKey(*user.Password, in.Password) + if err != nil || !valid { + return h.BadRequest(ctx, rout.ErrInvalidCredentials) + } + + if !user.Edges.Setting.EmailConfirmed { + return h.BadRequest(ctx, auth.ErrUnverifiedUser) + } + + // set context for remaining request based on logged in user + userCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: user.ID, + }) + + if err := h.addDefaultOrgToUserQuery(userCtx, user); err != nil { + return h.InternalServerError(ctx, err) + } + + // create new claims for the user + auth, err := h.AuthManager.GenerateUserAuthSession(ctx, user) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + return h.InternalServerError(ctx, err) + } + + if err := h.updateUserLastSeen(userCtx, user.ID); err != nil { + h.Logger.Errorw("unable to update last seen", "error", err) + + return h.InternalServerError(ctx, err) + } + + props := ph.NewProperties(). + Set("user_id", user.ID). + Set("email", user.Email). + Set("organization_id", user.Edges.Setting.Edges.DefaultOrg.ID). // user is logged into their default org + Set("auth_provider", user.AuthProvider) + + h.AnalyticsClient.Event("user_authenticated", props) + + out := models.LoginReply{ + Reply: rout.Reply{Success: true}, + Message: "success", + AuthData: *auth, + } + + return h.Success(ctx, out) +} + +// BindLoginHandler binds the login request to the OpenAPI schema +func (h *Handler) BindLoginHandler() *openapi3.Operation { + login := openapi3.NewOperation() + login.Description = "Login is oriented towards human users who use their email and password for authentication. Login verifies the password submitted for the user is correct by looking up the user by email and using the argon2 derived key verification process to confirm the password matches. Upon authentication an access token and a refresh token with the authorized claims of the user are returned. The user can use the access token to authenticate to our systems. The access token has an expiration and the refresh token can be used with the refresh endpoint to get a new access token without the user having to log in again. The refresh token overlaps with the access token to provide a seamless authentication experience and the user can refresh their access token so long as the refresh token is valid" + login.OperationID = "LoginHandler" + + h.AddRequestBody("LoginRequest", models.ExampleLoginSuccessRequest, login) + h.AddResponse("LoginReply", "success", models.ExampleLoginSuccessResponse, login, http.StatusOK) + login.AddResponse(http.StatusInternalServerError, internalServerError()) + login.AddResponse(http.StatusBadRequest, badRequest()) + + return login +} diff --git a/internal/httpserve/handlers/login_test.go b/internal/httpserve/handlers/login_test.go new file mode 100644 index 0000000..d2479d7 --- /dev/null +++ b/internal/httpserve/handlers/login_test.go @@ -0,0 +1,162 @@ +package handlers_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestLoginHandler() { + t := suite.T() + + // add login handler + suite.e.POST("login", suite.h.LoginHandler) + + ec := echocontext.NewTestEchoContext().Request().Context() + + // set privacy allow in order to allow the creation of the users without + // authentication in the tests + ctx := privacy.DecisionContext(ec, privacy.Allow) + + // add mocks for writes + mock_fga.WriteAny(t, suite.fga) + + // create user in the database + validConfirmedUser := "rsanchez@theopenlane.io" + validPassword := "sup3rs3cu7e!" + + userSetting := suite.db.UserSetting.Create(). + SetEmailConfirmed(true). + SaveX(ctx) + + _ = suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail(validConfirmedUser). + SetPassword(validPassword). + SetSetting(userSetting). + SaveX(ctx) + + validUnconfirmedUser := "msmith@theopenlane.io" + + userSetting = suite.db.UserSetting.Create(). + SetEmailConfirmed(false). + SaveX(ctx) + + _ = suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail(validUnconfirmedUser). + SetPassword(validPassword). + SetSetting(userSetting). + SaveX(ctx) + + testCases := []struct { + name string + username string + password string + expectedErr error + expectedStatus int + }{ + { + name: "happy path, valid credentials", + username: validConfirmedUser, + password: validPassword, + expectedStatus: http.StatusOK, + }, + { + name: "email unverified", + username: validUnconfirmedUser, + password: validPassword, + expectedStatus: http.StatusBadRequest, + expectedErr: auth.ErrUnverifiedUser, + }, + { + name: "invalid password", + username: validConfirmedUser, + password: "thisisnottherightone", + expectedStatus: http.StatusBadRequest, + expectedErr: rout.ErrInvalidCredentials, + }, + { + name: "user not found", + username: "rick.sanchez@theopenlane.io", + password: validPassword, + expectedStatus: http.StatusBadRequest, + expectedErr: auth.ErrNoAuthUser, + }, + { + name: "empty username", + username: "", + password: validPassword, + expectedStatus: http.StatusBadRequest, + expectedErr: rout.NewMissingRequiredFieldError("username"), + }, + { + name: "empty password", + username: validConfirmedUser, + password: "", + expectedStatus: http.StatusBadRequest, + expectedErr: rout.NewMissingRequiredFieldError("password"), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + loginJSON := models.LoginRequest{ + Username: tc.username, + Password: tc.password, + } + + body, err := json.Marshal(loginJSON) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, "/login", strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.LoginReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + assert.Equal(t, tc.expectedStatus, recorder.Code) + + if tc.expectedStatus == http.StatusOK { + assert.True(t, out.Success) + } else { + assert.Contains(t, out.Error, tc.expectedErr.Error()) + } + }) + } +} diff --git a/internal/httpserve/handlers/oauth_login.go b/internal/httpserve/handlers/oauth_login.go new file mode 100644 index 0000000..8127b14 --- /dev/null +++ b/internal/httpserve/handlers/oauth_login.go @@ -0,0 +1,252 @@ +package handlers + +import ( + "fmt" + "net/http" + "strings" + + "golang.org/x/oauth2" + githubOAuth2 "golang.org/x/oauth2/github" + googleOAuth2 "golang.org/x/oauth2/google" + + "github.com/samber/lo" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/providers/github" + "github.com/theopenlane/core/pkg/providers/google" + oauth "github.com/theopenlane/core/pkg/providers/oauth2" + "github.com/theopenlane/core/pkg/providers/webauthn" + "github.com/theopenlane/core/pkg/sessions" +) + +// OauthProviderConfig represents the configuration for OAuth providers such as Github and Google +type OauthProviderConfig struct { + // RedirectURL is the URL that the OAuth2 client will redirect to after authentication is complete + RedirectURL string `json:"redirectUrl" koanf:"redirectUrl" default:"http://localhost:3001/api/auth/callback/theopenlane"` + // Github contains the configuration settings for the Github Oauth Provider + Github github.ProviderConfig `json:"github" koanf:"github"` + // Google contains the configuration settings for the Google Oauth Provider + Google google.ProviderConfig `json:"google" koanf:"google"` + // Webauthn contains the configuration settings for the Webauthn Oauth Provider + Webauthn webauthn.ProviderConfig `json:"webauthn" koanf:"webauthn"` +} + +const ( + githubProvider = "github" + googleProvider = "google" +) + +func (h *Handler) getGoogleOauth2Config() *oauth2.Config { + return &oauth2.Config{ + ClientID: h.OauthProvider.Google.ClientID, + ClientSecret: h.OauthProvider.Google.ClientSecret, + RedirectURL: fmt.Sprintf("%s%s", h.OauthProvider.Google.ClientEndpoint, h.OauthProvider.Google.RedirectURL), + Endpoint: googleOAuth2.Endpoint, + Scopes: h.OauthProvider.Google.Scopes, + } +} + +func (h *Handler) getGithubOauth2Config() *oauth2.Config { + return &oauth2.Config{ + ClientID: h.OauthProvider.Github.ClientID, + ClientSecret: h.OauthProvider.Github.ClientSecret, + RedirectURL: fmt.Sprintf("%s%s", h.OauthProvider.Github.ClientEndpoint, h.OauthProvider.Github.RedirectURL), + Endpoint: githubOAuth2.Endpoint, + Scopes: h.OauthProvider.Github.Scopes, + } +} + +// RequireLogin redirects unauthenticated users to the login route +func (h *Handler) RequireLogin(next http.Handler) http.Handler { + fn := func(w http.ResponseWriter, req *http.Request) { + if !h.IsAuthenticated(req) { + http.Redirect(w, req, "/", http.StatusFound) + return + } + + next.ServeHTTP(w, req) + } + + return http.HandlerFunc(fn) +} + +// IsAuthenticated checks the sessions to a valid session cookie +func (h *Handler) IsAuthenticated(req *http.Request) bool { + if _, err := h.SessionConfig.SessionManager.Get(req, h.SessionConfig.CookieConfig.Name); err == nil { + return true + } + + return false +} + +// GetGoogleLoginHandlers returns the google login and callback handlers +func (h *Handler) GetGoogleLoginHandlers() (http.Handler, http.Handler) { + oauth2Config := h.getGoogleOauth2Config() + + loginHandler := google.StateHandler(*h.SessionConfig.CookieConfig, google.LoginHandler(oauth2Config, nil)) + callbackHandler := google.StateHandler(*h.SessionConfig.CookieConfig, google.CallbackHandler(oauth2Config, h.issueGoogleSession(), nil)) + + return loginHandler, callbackHandler +} + +// issueGoogleSession issues a cookie session after successful Facebook login +func (h *Handler) issueGoogleSession() http.Handler { + fn := func(w http.ResponseWriter, req *http.Request) { + ctx := req.Context() + + redirectURI, err := h.getRedirectURI(req) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + googleUser, err := google.UserFromContext(ctx) + + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + ctxWithToken := token.NewContextWithOauthTooToken(ctx, googleUser.Email) + + // check if users exists and create if not + user, err := h.CheckAndCreateUser(ctxWithToken, googleUser.Name, googleUser.Email, enums.AuthProviderGoogle, googleUser.Picture) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + // Create session with external data + oauthReq := models.OauthTokenRequest{ + Email: googleUser.Email, + ExternalUserName: googleUser.Name, + ExternalUserID: googleUser.Id, + AuthProvider: googleProvider, + } + + auth, err := h.AuthManager.GenerateOauthAuthSession(ctxWithToken, w, user, oauthReq) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + http.Error(w, err.Error(), http.StatusInternalServerError) + + return + } + + if err := h.addDefaultOrgToUserQuery(ctx, user); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + // remove cookie + sessions.RemoveCookie(w, "redirect_to", *h.SessionConfig.CookieConfig) + + http.Redirect(w, req, fmt.Sprintf("%s?session=%s", redirectURI, auth.Session), http.StatusFound) + } + + return http.HandlerFunc(fn) +} + +// GetGitHubLoginHandlers returns the github login and callback handlers +func (h *Handler) GetGitHubLoginHandlers() (http.Handler, http.Handler) { + oauth2Config := h.getGithubOauth2Config() + + loginHandler := github.StateHandler(*h.SessionConfig.CookieConfig, github.LoginHandler(oauth2Config, nil)) + callbackHandler := github.StateHandler(*h.SessionConfig.CookieConfig, github.CallbackHandler(oauth2Config, h.issueGitHubSession(), nil)) + + return loginHandler, callbackHandler +} + +// issueGitHubSession issues a cookie session after successful Facebook login +func (h *Handler) issueGitHubSession() http.Handler { + fn := func(w http.ResponseWriter, req *http.Request) { + ctx := req.Context() + + redirectURI, err := h.getRedirectURI(req) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + githubUser, err := github.UserFromContext(ctx) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + // we need the email to keep going, if its not there error the request + if githubUser.Email == nil { + http.Error(w, ErrNoEmailFound.Error(), http.StatusBadRequest) + return + } + + ctxWithToken := token.NewContextWithOauthTooToken(ctx, *githubUser.Email) + + // check if users exists and create if not, updates last seen of existing user + user, err := h.CheckAndCreateUser(ctxWithToken, *githubUser.Name, *githubUser.Email, enums.AuthProviderGitHub, *githubUser.AvatarURL) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + if err := h.addDefaultOrgToUserQuery(ctx, user); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + oauthReq := models.OauthTokenRequest{ + Email: *githubUser.Email, + ExternalUserName: *githubUser.Login, + ExternalUserID: fmt.Sprintf("%v", githubUser.ID), + AuthProvider: githubProvider, + } + + auth, err := h.AuthManager.GenerateOauthAuthSession(ctxWithToken, w, user, oauthReq) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + http.Error(w, err.Error(), http.StatusInternalServerError) + + return + } + + // remove cookie now that its in the context + sessions.RemoveCookie(w, "redirect_to", *h.SessionConfig.CookieConfig) + + // redirect with context set + http.Redirect(w, req, fmt.Sprintf("%s?session=%s", redirectURI, auth.Session), http.StatusFound) + } + + return http.HandlerFunc(fn) +} + +// parseName attempts to parse a full name into first and last names of the user +func parseName(name string) (c ent.CreateUserInput) { + if name == "" { + return + } + + parts := strings.Split(name, " ") + c.FirstName = &parts[0] + + if len(parts) > 1 { + c.LastName = lo.ToPtr(strings.Join(parts[1:], " ")) + } + + return +} + +// getRedirectURI checks headers for a request type, if not set, will default to the browser redirect url +func (h *Handler) getRedirectURI(req *http.Request) (string, error) { + redirectURI := oauth.RedirectFromContext(req.Context()) + + // use the default if it was not passed in + if redirectURI == "" { + redirectURI = h.OauthProvider.RedirectURL + } + + return redirectURI, nil +} diff --git a/internal/httpserve/handlers/oauth_login_handlers_test.go b/internal/httpserve/handlers/oauth_login_handlers_test.go new file mode 100644 index 0000000..5be4cf5 --- /dev/null +++ b/internal/httpserve/handlers/oauth_login_handlers_test.go @@ -0,0 +1,178 @@ +package handlers_test + +import ( + "testing" + "time" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/middleware/transaction" +) + +func (suite *HandlerTestSuite) TestHandlerCheckAndCreateUser() { + t := suite.T() + + // add login handler + suite.e.POST("login", suite.h.LoginHandler) + + ec := echocontext.NewTestEchoContext().Request().Context() + + // set privacy allow in order to allow the creation of the users without + // authentication in the tests + ctx := privacy.DecisionContext(ec, privacy.Allow) + + type args struct { + name string + email string + provider enums.AuthProvider + image string + } + + tests := []struct { + name string + args args + want *ent.User + writes bool + wantErr bool + }{ + { + name: "happy path, github", + args: args{ + name: "Wanda Maximoff", + email: "wmaximoff@marvel.com", + provider: enums.AuthProviderGitHub, + image: "https://example.com/images/photo.jpg", + }, + want: &ent.User{ + FirstName: "Wanda", + LastName: "Maximoff", + Email: "wmaximoff@marvel.com", + AuthProvider: enums.AuthProviderGitHub, + AvatarRemoteURL: lo.ToPtr("https://example.com/images/photo.jpg"), + }, + writes: true, + }, + { + name: "happy path, same email, different provider", + args: args{ + name: "Wanda Maximoff", + email: "wmaximoff@marvel.com", + provider: enums.AuthProviderGoogle, + image: "https://example.com/images/photo.jpg", + }, + want: &ent.User{ + FirstName: "Wanda", + LastName: "Maximoff", + Email: "wmaximoff@marvel.com", + AuthProvider: enums.AuthProviderGoogle, + AvatarRemoteURL: lo.ToPtr("https://example.com/images/photo.jpg"), + }, + writes: true, + }, + { + name: "user already exists, should not fail, just update last seen", + args: args{ + name: "Wanda Maximoff", + email: "wmaximoff@marvel.com", + provider: enums.AuthProviderGoogle, + image: "https://example.com/images/photo.jpg", + }, + want: &ent.User{ + FirstName: "Wanda", + LastName: "Maximoff", + Email: "wmaximoff@marvel.com", + AuthProvider: enums.AuthProviderGoogle, + AvatarRemoteURL: lo.ToPtr("https://example.com/images/photo.jpg"), + }, + writes: false, + }, + { + name: "no image, avatar URL nil ", + args: args{ + name: "Wand Maxim", + email: "wmaximoff1@marvel.com", + provider: enums.AuthProviderGitHub, + image: "", + }, + want: &ent.User{ + FirstName: "Wand", + LastName: "Maxim", + Email: "wmaximoff1@marvel.com", + AuthProvider: enums.AuthProviderGitHub, + AvatarRemoteURL: nil, + }, + writes: true, + }, + { + name: "no image, update last seen", + args: args{ + name: "Wand Maxim", + email: "wmaximoff1@marvel.com", + provider: enums.AuthProviderGitHub, + image: "", + }, + want: &ent.User{ + FirstName: "Wand", + LastName: "Maxim", + Email: "wmaximoff1@marvel.com", + AuthProvider: enums.AuthProviderGitHub, + AvatarRemoteURL: nil, + }, + writes: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + if tt.writes { + // add mocks for writes when a new user is created + mock_fga.WriteOnce(t, suite.fga) + } + + now := time.Now() + + // start transaction because the query expects a transaction in the context + tx, err := suite.h.DBClient.Tx(ctx) + require.NoError(t, err) + + // commit transaction after test finishes + defer tx.Commit() //nolint:errcheck + + // set transaction in the context + ctx = transaction.NewContext(ctx, tx) + + got, err := suite.h.CheckAndCreateUser(ctx, tt.args.name, tt.args.email, tt.args.provider, tt.args.image) + if tt.wantErr { + require.Error(t, err) + assert.Nil(t, got) + + return + } + + // check if user was created + require.NoError(t, err) + require.NotNil(t, got) + + // verify fields + assert.Equal(t, tt.want.FirstName, got.FirstName) + assert.Equal(t, tt.want.LastName, got.LastName) + assert.Equal(t, tt.want.Email, got.Email) + assert.Equal(t, tt.want.AuthProvider, got.AuthProvider) + assert.WithinDuration(t, now, *got.LastSeen, time.Second*5) + + if tt.want.AvatarRemoteURL == nil { + assert.Empty(t, got.AvatarRemoteURL) + } else { + assert.Equal(t, *tt.want.AvatarRemoteURL, *got.AvatarRemoteURL) + } + }) + } +} diff --git a/internal/httpserve/handlers/oauth_login_test.go b/internal/httpserve/handlers/oauth_login_test.go new file mode 100644 index 0000000..233d76b --- /dev/null +++ b/internal/httpserve/handlers/oauth_login_test.go @@ -0,0 +1,54 @@ +package handlers + +import ( + "testing" + + "github.com/samber/lo" + "github.com/stretchr/testify/assert" + + ent "github.com/theopenlane/core/internal/ent/generated" +) + +func TestParseName(t *testing.T) { + tests := []struct { + name string + user string + want ent.CreateUserInput + }{ + { + name: "happy path", + user: "Matty Anderson", + want: ent.CreateUserInput{ + FirstName: lo.ToPtr("Matty"), + LastName: lo.ToPtr("Anderson"), + }, + }, + { + name: "very long name", + user: "Matty Anderson Is The Best", + want: ent.CreateUserInput{ + FirstName: lo.ToPtr("Matty"), + LastName: lo.ToPtr("Anderson Is The Best"), + }, + }, + { + name: "single name", + user: "Matty", + want: ent.CreateUserInput{ + FirstName: lo.ToPtr("Matty"), + }, + }, + { + name: "empty name", + user: "", + want: ent.CreateUserInput{}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := parseName(tt.user) + + assert.Equal(t, tt.want, got) + }) + } +} diff --git a/internal/httpserve/handlers/oauth_register.go b/internal/httpserve/handlers/oauth_register.go new file mode 100644 index 0000000..039a6a2 --- /dev/null +++ b/internal/httpserve/handlers/oauth_register.go @@ -0,0 +1,90 @@ +package handlers + +import ( + "context" + "strings" + + ph "github.com/posthog/posthog-go" + echo "github.com/theopenlane/echox" + "golang.org/x/oauth2" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/providers/github" + "github.com/theopenlane/core/pkg/providers/google" +) + +// OauthRegister returns the TokenResponse for a verified authenticated external oauth user +func (h *Handler) OauthRegister(ctx echo.Context) error { + var in models.OauthTokenRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + ctxWithToken := token.NewContextWithOauthTooToken(ctx.Request().Context(), in.Email) + + // create oauth2 token from request input + tok := &oauth2.Token{ + AccessToken: in.ClientToken, + } + + // verify the token provided to ensure the user is valid + if err := h.verifyClientToken(ctxWithToken, in.AuthProvider, tok, in.Email); err != nil { + return h.InvalidInput(ctx, err) + } + + // check if users exists and create if not, updates last seen of existing user + user, err := h.CheckAndCreateUser(ctxWithToken, in.Name, in.Email, enums.AuthProvider(strings.ToUpper(in.AuthProvider)), in.Image) + if err != nil { + return h.InternalServerError(ctx, err) + } + + if err := h.addDefaultOrgToUserQuery(ctxWithToken, user); err != nil { + return h.InternalServerError(ctx, err) + } + + // create claims for verified user + auth, err := h.AuthManager.GenerateOauthAuthSession(ctx.Request().Context(), ctx.Response().Writer, user, in) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + return h.InternalServerError(ctx, err) + } + + props := ph.NewProperties(). + Set("user_id", user.ID). + Set("email", user.Email). + Set("organization_id", user.Edges.Setting.Edges.DefaultOrg.ID). // user is logged into their default org + Set("auth_provider", in.AuthProvider) + + h.AnalyticsClient.Event("user_authenticated", props) + + out := models.LoginReply{ + Reply: rout.Reply{Success: true}, + Message: "success", + AuthData: *auth, + } + + // Return the access token + return h.Success(ctx, out) +} + +// verifyClientToken verifies the provided access token from an external oauth2 provider is valid and matches the user's email +// supported providers are Github and Google +func (h *Handler) verifyClientToken(ctx context.Context, provider string, token *oauth2.Token, email string) error { + switch strings.ToLower(provider) { + case githubProvider: + config := h.getGithubOauth2Config() + cc := github.ClientConfig{IsEnterprise: false, IsMock: h.IsTest} + + return github.VerifyClientToken(ctx, token, config, email, &cc) + case googleProvider: + config := h.getGoogleOauth2Config() + return google.VerifyClientToken(ctx, token, config, email) + default: + return ErrInvalidProvider + } +} diff --git a/internal/httpserve/handlers/oauth_register_test.go b/internal/httpserve/handlers/oauth_register_test.go new file mode 100644 index 0000000..49008ea --- /dev/null +++ b/internal/httpserve/handlers/oauth_register_test.go @@ -0,0 +1,138 @@ +package handlers_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestOauthRegister() { + t := suite.T() + + // add login handler + suite.e.POST("oauth/register", suite.h.OauthRegister) + + type args struct { + name string + email string + provider enums.AuthProvider + username string + userID string + token string + } + + tests := []struct { + name string + args args + writes bool + expectedStatus int + expectedErr string + expectedErrCode rout.ErrorCode + wantErr bool + }{ + { + name: "happy path, github", + args: args{ + name: "Ant Man", + email: "antman@theopenlane.io", + provider: enums.AuthProviderGitHub, + username: "scarletwitch", + userID: "123456", + token: "gh_thistokenisvalid", + }, + expectedStatus: http.StatusOK, + writes: true, + }, + { + name: "happy path, github, same user", + args: args{ + name: "Ant Man", + email: "antman@theopenlane.io", + provider: enums.AuthProviderGitHub, + username: "scarletwitch", + userID: "123456", + token: "gh_thistokenisvalid", + }, + expectedStatus: http.StatusOK, + writes: false, // user already created, no FGA writes this time + }, + { + name: "mismatch email", + args: args{ + name: "Ant Man", + email: "antman@marvel.com", + provider: enums.AuthProviderGitHub, + username: "scarletwitch", + userID: "123456", + token: "gh_thistokenisvalid", + }, + expectedStatus: http.StatusBadRequest, + expectedErrCode: handlers.InvalidInputErrCode, + writes: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if tt.writes { + // add mocks for writes when a new user is created + mock_fga.WriteOnce(t, suite.fga) + } + + registerJSON := models.OauthTokenRequest{ + Name: tt.args.name, + Email: tt.args.email, + AuthProvider: tt.args.provider.String(), + ExternalUserID: tt.args.userID, + ExternalUserName: tt.args.username, + ClientToken: tt.args.token, + } + + body, err := json.Marshal(registerJSON) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, "/oauth/register", strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.LoginReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + assert.Equal(t, tt.expectedStatus, recorder.Code) + assert.Equal(t, tt.expectedErrCode, out.ErrorCode) + + if tt.expectedStatus == http.StatusOK { + assert.NotNil(t, out.AccessToken) + assert.NotNil(t, out.RefreshToken) + assert.True(t, out.Success) + assert.Equal(t, "Bearer", out.TokenType) + } + }) + } +} diff --git a/internal/httpserve/handlers/openapi.go b/internal/httpserve/handlers/openapi.go new file mode 100644 index 0000000..a477c06 --- /dev/null +++ b/internal/httpserve/handlers/openapi.go @@ -0,0 +1,70 @@ +package handlers + +import ( + "github.com/getkin/kin-openapi/openapi3" + + "github.com/theopenlane/httpsling" +) + +// badRequest is a wrapper for openaAPI bad request response +func badRequest() *openapi3.Response { + return openapi3.NewResponse(). + WithDescription("Bad Request"). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/responses/BadRequest"})) +} + +// internalServerError is a wrapper for openaAPI internal server error response +func internalServerError() *openapi3.Response { + return openapi3.NewResponse(). + WithDescription("Internal Server Error"). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/responses/InternalServerError"})) +} + +// notFound is a wrapper for openaAPI not found response +func notFound() *openapi3.Response { + return openapi3.NewResponse(). + WithDescription("Not Found"). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/responses/NotFound"})) +} + +// created is a wrapper for openaAPI created response +func created() *openapi3.Response { + return openapi3.NewResponse(). + WithDescription("Created"). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/responses/Created"})) +} + +// conflict is a wrapper for openaAPI conflict response +func conflict() *openapi3.Response { + return openapi3.NewResponse(). + WithDescription("Conflict"). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/responses/Conflict"})) +} + +// unauthorized is a wrapper for openaAPI unauthorized response +func unauthorized() *openapi3.Response { + return openapi3.NewResponse(). + WithDescription("Unauthorized"). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/responses/Unauthorized"})) +} + +// AddRequestBody is used to add a request body definition to the OpenAPI schema +func (h *Handler) AddRequestBody(name string, body interface{}, op *openapi3.Operation) { + request := openapi3.NewRequestBody(). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/schemas/" + name})) + op.RequestBody = &openapi3.RequestBodyRef{Value: request} + + request.Content.Get(httpsling.ContentTypeJSON).Examples = make(map[string]*openapi3.ExampleRef) + request.Content.Get(httpsling.ContentTypeJSON).Examples["success"] = &openapi3.ExampleRef{Value: openapi3.NewExample(body)} +} + +// AddResponse is used to add a response definition to the OpenAPI schema +func (h *Handler) AddResponse(name string, description string, body interface{}, op *openapi3.Operation, status int) { + response := openapi3.NewResponse(). + WithDescription(description). + WithContent(openapi3.NewContentWithJSONSchemaRef(&openapi3.SchemaRef{Ref: "#/components/schemas/" + name})) + op.AddResponse(status, response) + + response.Content.Get(httpsling.ContentTypeJSON).Examples = make(map[string]*openapi3.ExampleRef) + response.Content.Get(httpsling.ContentTypeJSON).Examples["success"] = &openapi3.ExampleRef{Value: openapi3.NewExample(body)} +} diff --git a/internal/httpserve/handlers/readiness.go b/internal/httpserve/handlers/readiness.go new file mode 100644 index 0000000..cd98434 --- /dev/null +++ b/internal/httpserve/handlers/readiness.go @@ -0,0 +1,57 @@ +package handlers + +import ( + "context" + "net/http" + + echo "github.com/theopenlane/echox" +) + +// StatusReply returns server status +type StatusReply struct { + Status map[string]string `json:"status"` +} + +// CheckFunc is a function that can be used to check the status of a service +type CheckFunc func(ctx context.Context) error + +type Checks struct { + checks map[string]CheckFunc +} + +// AddReadinessCheck will accept a function to be ran during calls to /readyz +// These functions should accept a context and only return an error. When adding +// a readiness check a name is also provided, this name will be used when returning +// the state of all the checks +func (h *Handler) AddReadinessCheck(name string, f CheckFunc) { + // if this is null, create the struct before trying to add + if h.ReadyChecks.checks == nil { + h.ReadyChecks.checks = map[string]CheckFunc{} + } + + h.ReadyChecks.checks[name] = f +} + +func (c *Checks) ReadyHandler(ctx echo.Context) error { + failed := false + status := map[string]string{} + + for name, check := range c.checks { + if err := check(ctx.Request().Context()); err != nil { + failed = true + status[name] = err.Error() + } else { + status[name] = "OK" + } + } + + if failed { + return ctx.JSON(http.StatusServiceUnavailable, status) + } + + out := &StatusReply{ + Status: status, + } + + return ctx.JSON(http.StatusOK, out) +} diff --git a/internal/httpserve/handlers/refresh.go b/internal/httpserve/handlers/refresh.go new file mode 100644 index 0000000..5050c67 --- /dev/null +++ b/internal/httpserve/handlers/refresh.go @@ -0,0 +1,104 @@ +package handlers + +import ( + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" +) + +// RefreshHandler allows users to refresh their access token using their refresh token + +func (h *Handler) RefreshHandler(ctx echo.Context) error { + var in models.RefreshRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + // verify the refresh token + claims, err := h.TokenManager.Verify(in.RefreshToken) + if err != nil { + h.Logger.Errorw("error verifying token", "error", err) + + return h.BadRequest(ctx, err) + } + + // check user in the database, sub == claims subject and ensure only one record is returned + user, err := h.getUserDetailsByID(ctx.Request().Context(), claims.Subject) + if err != nil { + if ent.IsNotFound(err) { + return h.NotFound(ctx, ErrNoAuthUser) + } + + return h.InternalServerError(ctx, ErrProcessingRequest) + } + + // ensure the user is still active + if user.Edges.Setting.Status != "ACTIVE" { + return h.NotFound(ctx, ErrNoAuthUser) + } + + // UserID is not on the refresh token, so we need to set it now + claims.UserID = user.ID + + accessToken, refreshToken, err := h.TokenManager.CreateTokenPair(claims) + if err != nil { + h.Logger.Errorw("error creating token pair", "error", err) + + return h.InternalServerError(ctx, ErrProcessingRequest) + } + + // set cookies on request with the access and refresh token + auth.SetAuthCookies(ctx.Response().Writer, accessToken, refreshToken, *h.SessionConfig.CookieConfig) + + // set sessions in response + if err := h.SessionConfig.CreateAndStoreSession(ctx, user.ID); err != nil { + h.Logger.Errorw("unable to save session", "error", err) + + return err + } + + out := &models.RefreshReply{ + Reply: rout.Reply{Success: true}, + Message: "success", + AuthData: models.AuthData{ + AccessToken: accessToken, + RefreshToken: refreshToken, + }, + } + + return h.Success(ctx, out) +} + +// BindRefreshHandler is used to bind the refresh endpoint to the OpenAPI schema +func (h *Handler) BindRefreshHandler() *openapi3.Operation { + refresh := openapi3.NewOperation() + refresh.Description = "The Refresh endpoint re-authenticates users and API keys using a refresh token rather than requiring a username and password or API key credentials a second time and returns a new access and refresh token pair with the current credentials of the user. This endpoint is intended to facilitate long-running connections to the systems that last longer than the duration of an access token; e.g. long sessions on the UI or (especially) long running publishers and subscribers (machine users) that need to stay authenticated semi-permanently." + refresh.OperationID = "RefreshHandler" + refresh.Security = &openapi3.SecurityRequirements{ + openapi3.SecurityRequirement{ + "bearerAuth": []string{}, + }, + openapi3.SecurityRequirement{ + "basicAuth": []string{}, + }, + } + + h.AddRequestBody("RefreshRequest", models.ExampleRefreshRequest, refresh) + h.AddResponse("RefreshReply", "success", models.ExampleRefreshSuccessResponse, refresh, http.StatusOK) + refresh.AddResponse(http.StatusInternalServerError, internalServerError()) + refresh.AddResponse(http.StatusBadRequest, badRequest()) + refresh.AddResponse(http.StatusNotFound, notFound()) + + return refresh +} diff --git a/internal/httpserve/handlers/refresh_test.go b/internal/httpserve/handlers/refresh_test.go new file mode 100644 index 0000000..57b52fb --- /dev/null +++ b/internal/httpserve/handlers/refresh_test.go @@ -0,0 +1,141 @@ +package handlers_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/golang-jwt/jwt/v5" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/testutils" + "github.com/theopenlane/core/pkg/tokens" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestRefreshHandler() { + t := suite.T() + + // add handler + suite.e.POST("refresh", suite.h.RefreshHandler) + + // Set full overlap of the refresh and access token so the refresh token is immediately valid + tm, err := testutils.CreateTokenManager(-60 * time.Minute) //nolint:mnd + if err != nil { + t.Error("error creating token manager") + } + + suite.h.TokenManager = tm + + ec := echocontext.NewTestEchoContext().Request().Context() + + // set privacy allow in order to allow the creation of the users without + // authentication in the tests + ec = privacy.DecisionContext(ec, privacy.Allow) + + // add mocks for writes + mock_fga.WriteAny(t, suite.fga) + + // create user in the database + validUser := gofakeit.Email() + validPassword := gofakeit.Password(true, true, true, true, false, 20) + + userID := ulids.New().String() + + userSetting := suite.db.UserSetting.Create(). + SetEmailConfirmed(true). + SaveX(ec) + + user := suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail(validUser). + SetPassword(validPassword). + SetSetting(userSetting). + SetID(userID). + SetSub(userID). // this is required to parse the refresh token + SaveX(ec) + + claims := &tokens.Claims{ + RegisteredClaims: jwt.RegisteredClaims{ + Subject: user.ID, + }, + UserID: user.ID, + } + + _, refresh, err := tm.CreateTokenPair(claims) + if err != nil { + t.Error("error creating token pair") + } + + testCases := []struct { + name string + refresh string + expectedErrMessage string + expectedStatus int + }{ + { + name: "happy path, valid credentials", + refresh: refresh, + expectedStatus: http.StatusOK, + }, + { + name: "empty refresh", + refresh: "", + expectedStatus: http.StatusBadRequest, + expectedErrMessage: "refresh_token is required", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + refreshJSON := models.RefreshRequest{ + RefreshToken: tc.refresh, + } + + body, err := json.Marshal(refreshJSON) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, "/refresh", strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.RefreshReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + assert.Equal(t, tc.expectedStatus, recorder.Code) + + if tc.expectedStatus == http.StatusOK { + assert.True(t, out.Success) + } else { + assert.Contains(t, out.Error, tc.expectedErrMessage) + } + }) + } +} diff --git a/internal/httpserve/handlers/register.go b/internal/httpserve/handlers/register.go new file mode 100644 index 0000000..8c09f8c --- /dev/null +++ b/internal/httpserve/handlers/register.go @@ -0,0 +1,163 @@ +package handlers + +import ( + "context" + "net/http" + + "github.com/cenkalti/backoff/v4" + "github.com/getkin/kin-openapi/openapi3" + ph "github.com/posthog/posthog-go" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" +) + +const ( + maxEmailAttempts = 5 +) + +// RegisterHandler handles the registration of a new user, creating the user, personal organization +// and sending an email verification to the email address in the request +// the user will not be able to authenticate until the email is verified +// [MermaidChart: 5a357443-f959-4f16-a07f-ec504f67f0eb] +func (h *Handler) RegisterHandler(ctx echo.Context) error { + var in models.RegisterRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + // create user + input := generated.CreateUserInput{ + FirstName: &in.FirstName, + LastName: &in.LastName, + Email: in.Email, + Password: &in.Password, + } + + // set viewer context + ctxWithToken := token.NewContextWithSignUpToken(ctx.Request().Context(), in.Email) + + meowuser, err := h.createUser(ctxWithToken, input) + if err != nil { + h.Logger.Errorw("error creating new user", "error", err) + + if IsUniqueConstraintError(err) { + return h.Conflict(ctx, "user already exists", UserExistsErrCode) + } + + if generated.IsValidationError(err) { + return h.InvalidInput(ctx, invalidInputError(err)) + } + + return err + } + + // setup user context + userCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: meowuser.ID, + }) + + // create email verification token + user := &User{ + FirstName: in.FirstName, + LastName: in.LastName, + Email: in.Email, + ID: meowuser.ID, + } + + meowtoken, err := h.storeAndSendEmailVerificationToken(userCtx, user) + if err != nil { + h.Logger.Errorw("error storing token", "error", err) + + return h.InternalServerError(ctx, err) + } + + out := &models.RegisterReply{ + Reply: rout.Reply{Success: true}, + ID: meowuser.ID, + Email: meowuser.Email, + Message: "Welcome to OpenLane!", + Token: meowtoken.Token, + } + + return h.Created(ctx, out) +} + +func (h *Handler) storeAndSendEmailVerificationToken(ctx context.Context, user *User) (*generated.EmailVerificationToken, error) { + // expire all existing tokens + if err := h.expireAllVerificationTokensUserByEmail(ctx, user.Email); err != nil { + h.Logger.Errorw("error expiring existing tokens", "error", err) + + return nil, err + } + + // check if the user has attempted to verify their email too many times + attempts, err := h.countVerificationTokensUserByEmail(ctx, user.Email) + if err != nil { + h.Logger.Errorw("error getting existing tokens", "error", err) + + return nil, err + } + + if attempts >= maxEmailAttempts { + return nil, ErrMaxAttempts + } + + // create a new token and store it in the database + if err := user.CreateVerificationToken(); err != nil { + h.Logger.Errorw("unable to create verification token", "error", err) + + return nil, err + } + + meowtoken, err := h.createEmailVerificationToken(ctx, user) + if err != nil { + return nil, err + } + + props := ph.NewProperties(). + Set("user_id", user.ID). + Set("email", user.Email). + Set("first_name", user.FirstName). + Set("last_name", user.LastName) + + h.AnalyticsClient.Event("email_verification_sent", props) + + // send emails via TaskMan as to not create blocking operations in the server + if err := h.TaskMan.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return h.SendVerificationEmail(user) + }), marionette.WithRetries(3), //nolint:mnd + marionette.WithBackoff(backoff.NewExponentialBackOff()), + marionette.WithErrorf("could not send verification email to user %s", user.ID), + ); err != nil { + return nil, err + } + + return meowtoken, nil +} + +// BindRegisterHandler is used to bind the register endpoint to the OpenAPI schema +func (h *Handler) BindRegisterHandler() *openapi3.Operation { + register := openapi3.NewOperation() + register.Description = "Register creates a new user in the database with the specified password, allowing the user to login to OpenLane. This endpoint requires a 'strong' password and a valid register request, otherwise a 400 reply is returned. The password is stored in the database as an argon2 derived key so it is impossible for a hacker to get access to raw passwords. A personal organization is created for the user registering based on the organization data in the register request and the user is assigned the Owner role" + register.OperationID = "RegisterHandler" + register.Security = &openapi3.SecurityRequirements{} + + h.AddRequestBody("RegisterRequest", models.ExampleRegisterSuccessRequest, register) + h.AddResponse("RegisterReply", "success", models.ExampleRegisterSuccessResponse, register, http.StatusCreated) + register.AddResponse(http.StatusInternalServerError, internalServerError()) + register.AddResponse(http.StatusBadRequest, badRequest()) + register.AddResponse(http.StatusConflict, conflict()) + + return register +} diff --git a/internal/httpserve/handlers/register_test.go b/internal/httpserve/handlers/register_test.go new file mode 100644 index 0000000..fab7c8f --- /dev/null +++ b/internal/httpserve/handlers/register_test.go @@ -0,0 +1,204 @@ +package handlers_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/rShetty/asyncwait" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/emails/mock" + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/internal/ent/generated/usersetting" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestRegisterHandler() { + t := suite.T() + + // add handler + suite.e.POST("register", suite.h.RegisterHandler) + + var bonkers = "b!a!n!a!n!a!s!" + + testCases := []struct { + name string + email string + firstName string + lastName string + password string + emailExpected bool + expectedErrMessage string + expectedErrorCode rout.ErrorCode + expectedStatus int + from string + }{ + { + name: "happy path", + email: "bananas@theopenlane.io", + firstName: "Princess", + lastName: "Fiona", + password: bonkers, + emailExpected: true, + expectedStatus: http.StatusCreated, + }, + { + name: "invalid email", + email: "bananas.net", + firstName: "Princess", + lastName: "Fiona", + password: bonkers, + emailExpected: false, + expectedErrMessage: "email was invalid", + expectedStatus: http.StatusBadRequest, + expectedErrorCode: handlers.InvalidInputErrCode, + }, + { + name: "missing email", + firstName: "Princess", + lastName: "Fiona", + password: bonkers, + emailExpected: false, + expectedErrMessage: "missing required field: email", + expectedStatus: http.StatusBadRequest, + expectedErrorCode: handlers.InvalidInputErrCode, + }, + { + name: "bad password", + email: "pancakes@theopenlane.io", + firstName: "Princess", + lastName: "Fiona", + password: "asfghjkl", + emailExpected: false, + expectedErrMessage: "password is too weak", + expectedStatus: http.StatusBadRequest, + expectedErrorCode: handlers.InvalidInputErrCode, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + sent := time.Now() + + mock.ResetEmailMock() + + // setup mock authz writes + if tc.expectedErrMessage == "" { + mock_fga.WriteAny(t, suite.fga) + mock_fga.CheckAny(t, suite.fga, true) + } + + registerJSON := models.RegisterRequest{ + FirstName: tc.firstName, + LastName: tc.lastName, + Email: tc.email, + Password: tc.password, + } + + body, err := json.Marshal(registerJSON) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, "/register", strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.RegisterReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + assert.Equal(t, tc.expectedStatus, recorder.Code) + assert.Equal(t, tc.expectedErrorCode, out.ErrorCode) + + if tc.expectedStatus == http.StatusCreated { + assert.Equal(t, out.Email, tc.email) + assert.NotEmpty(t, out.Message) + assert.NotEmpty(t, out.ID) + + // setup context to get the data back + ctx, err := auth.NewTestContextWithValidUser(out.ID) + require.NoError(t, err) + + // we haven't set the user's default org yet in the context + // so allow the request to go through + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + // get the user and make sure things were created as expected + u, err := suite.db.UserSetting.Query().Where(usersetting.UserID(out.ID)).WithDefaultOrg().Only(ctx) + require.NoError(t, err) + + assert.NotEmpty(t, u.Edges.DefaultOrg) + require.NotEmpty(t, u.Edges.DefaultOrg.ID) + + // setup echo context + ctx, err = auth.NewTestContextWithOrgID(out.ID, u.Edges.DefaultOrg.ID) + require.NoError(t, err) + + // make sure user is an owner of their personal org + orgMemberships, err := suite.api.GetOrgMembersByOrgID(ctx, &openlaneclient.OrgMembershipWhereInput{ + OrganizationID: &u.Edges.DefaultOrg.ID, + }) + require.NoError(t, err) + require.Len(t, orgMemberships.OrgMemberships.Edges, 1) + assert.Equal(t, orgMemberships.OrgMemberships.Edges[0].Node.Role, enums.RoleOwner) + } else { + assert.Contains(t, out.Error, tc.expectedErrMessage) + } + + // Test that one verify email was sent to each user + messages := []*mock.EmailMetadata{ + { + To: tc.email, + From: "mitb@theopenlane.io", + Subject: emails.VerifyEmailRE, + Timestamp: sent, + }, + } + + // wait for messages + predicate := func() bool { + return suite.h.TaskMan.GetQueueLength() == 0 + } + successful := asyncwait.NewAsyncWait(maxWaitInMillis, pollIntervalInMillis).Check(predicate) + + if successful != true { + t.Errorf("max wait of email send") + } + + if tc.emailExpected { + mock.CheckEmails(t, messages) + } else { + mock.CheckEmails(t, nil) + } + }) + } +} diff --git a/internal/httpserve/handlers/resend_test.go b/internal/httpserve/handlers/resend_test.go new file mode 100644 index 0000000..d619211 --- /dev/null +++ b/internal/httpserve/handlers/resend_test.go @@ -0,0 +1,161 @@ +package handlers_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/httpsling" +) + +func (suite *HandlerTestSuite) TestResendHandler() { + t := suite.T() + + // add handler + suite.e.POST("resend", suite.h.ResendEmail) + + ec := echocontext.NewTestEchoContext().Request().Context() + + ctx := privacy.DecisionContext(ec, privacy.Allow) + + // add mocks for writes + mock_fga.WriteAny(t, suite.fga) + + // create user in the database + userSetting := suite.db.UserSetting.Create(). + SetEmailConfirmed(false). + SaveX(ctx) + + _ = suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail("bsanderson@theopenlane.io"). + SetPassword(validPassword). + SetSetting(userSetting). + SaveX(ctx) + + // create user in the database + userSetting2 := suite.db.UserSetting.Create(). + SetEmailConfirmed(true). + SaveX(ctx) + + _ = suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail("dabraham@theopenlane.io"). + SetPassword(validPassword). + SetSetting(userSetting2). + SaveX(ctx) + + testCases := []struct { + name string + email string + expectedMessage string + expectedStatus int + }{ + { + name: "happy path", + email: "bsanderson@theopenlane.io", + expectedStatus: http.StatusOK, + expectedMessage: "received your request to be resend", + }, + { + name: "happy path, attempt 2", + email: "bsanderson@theopenlane.io", + expectedStatus: http.StatusOK, + expectedMessage: "received your request to be resend", + }, + { + name: "happy path, attempt 3", + email: "bsanderson@theopenlane.io", + expectedStatus: http.StatusOK, + expectedMessage: "received your request to be resend", + }, + { + name: "happy path, attempt 4", + email: "bsanderson@theopenlane.io", + expectedStatus: http.StatusOK, + expectedMessage: "received your request to be resend", + }, + { + name: "happy path, attempt 5", + email: "bsanderson@theopenlane.io", + expectedStatus: http.StatusOK, + expectedMessage: "received your request to be resend", + }, + { + name: "happy path, attempt 6 should fail", + email: "bsanderson@theopenlane.io", + expectedStatus: http.StatusTooManyRequests, + expectedMessage: "max attempts", + }, + { + name: "email does not exist, should still return 204", + email: "bsanderson1@theopenlane.io", + expectedStatus: http.StatusOK, + expectedMessage: "received your request to be resend", + }, + { + name: "email confirmed", + email: "dabraham@theopenlane.io", + expectedStatus: http.StatusOK, + expectedMessage: "email is already confirmed", + }, + { + name: "email not sent in request", + expectedStatus: http.StatusBadRequest, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + resendJSON := models.ResendRequest{ + Email: tc.email, + } + + body, err := json.Marshal(resendJSON) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, "/resend", strings.NewReader(string(body))) + req.Header.Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.ResendReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + require.Equal(t, tc.expectedStatus, recorder.Code) + + if tc.expectedStatus == http.StatusOK { + require.NotEmpty(t, out) + assert.NotEmpty(t, out.Message) + } else { + assert.Contains(t, out.Error, tc.expectedMessage) + } + }) + } +} diff --git a/internal/httpserve/handlers/resendemail.go b/internal/httpserve/handlers/resendemail.go new file mode 100644 index 0000000..eee1b6b --- /dev/null +++ b/internal/httpserve/handlers/resendemail.go @@ -0,0 +1,98 @@ +package handlers + +import ( + "errors" + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" +) + +// ResendEmail will resend an email verification email if the provided email exists +func (h *Handler) ResendEmail(ctx echo.Context) error { + var in models.ResendRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + // set viewer context + ctxWithToken := token.NewContextWithSignUpToken(ctx.Request().Context(), in.Email) + + out := &models.ResendReply{ + Reply: rout.Reply{Success: true}, + Message: "We've received your request to be resent an email to complete verification. Please check your email.", + } + + // email verifications only come to users that were created with username/password logins + entUser, err := h.getUserByEmail(ctxWithToken, in.Email, enums.AuthProviderCredentials) + if err != nil { + if ent.IsNotFound(err) { + // return a 200 response even if user is not found to avoid + // exposing confidential information + return h.Success(ctx, out) + } + + h.Logger.Errorf("error retrieving user email", "error", err) + + return h.InternalServerError(ctx, ErrProcessingRequest) + } + + // check to see if user is already confirmed + if entUser.Edges.Setting.EmailConfirmed { + out.Message = "email is already confirmed" + + return h.Success(ctx, out) + } + + // setup user context + userCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: entUser.ID, + }) + + // create email verification token + user := &User{ + FirstName: entUser.FirstName, + LastName: entUser.LastName, + Email: entUser.Email, + ID: entUser.ID, + } + + if _, err = h.storeAndSendEmailVerificationToken(userCtx, user); err != nil { + h.Logger.Errorw("error storing token", "error", err) + + if errors.Is(err, ErrMaxAttempts) { + return h.TooManyRequests(ctx, err) + } + + return h.InternalServerError(ctx, ErrProcessingRequest) + } + + return h.Success(ctx, out) +} + +// BindResendEmailHandler binds the resend email verification endpoint to the OpenAPI schema +func (h *Handler) BindResendEmailHandler() *openapi3.Operation { + resendEmail := openapi3.NewOperation() + resendEmail.Description = "ResendEmail accepts an email address via a POST request and always returns a 200 Status OK response, no matter the input or result of the processing. This is to ensure that no secure information is leaked from this unauthenticated endpoint. If the email address belongs to a user who has not been verified, another verification email is sent. If the post request contains an orgID and the user is invited to that organization but hasn't accepted the invite, then the invite is resent." + resendEmail.OperationID = "ResendEmail" + resendEmail.Security = &openapi3.SecurityRequirements{} + + h.AddRequestBody("ResendEmail", models.ExampleResendEmailSuccessRequest, resendEmail) + h.AddResponse("ResendReply", "success", models.ExampleResendEmailSuccessResponse, resendEmail, http.StatusOK) + resendEmail.AddResponse(http.StatusInternalServerError, internalServerError()) + resendEmail.AddResponse(http.StatusBadRequest, badRequest()) + + return resendEmail +} diff --git a/internal/httpserve/handlers/resetpassword.go b/internal/httpserve/handlers/resetpassword.go new file mode 100644 index 0000000..4bc1aef --- /dev/null +++ b/internal/httpserve/handlers/resetpassword.go @@ -0,0 +1,172 @@ +package handlers + +import ( + "context" + "database/sql" + "errors" + "fmt" + "net/http" + "time" + + "github.com/cenkalti/backoff/v4" + "github.com/getkin/kin-openapi/openapi3" + "github.com/oklog/ulid/v2" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/passwd" + "github.com/theopenlane/core/pkg/tokens" +) + +// ResetPassword allows the user (after requesting a password reset) to +// set a new password - the password reset token needs to be set in the request +// and not expired. If the request is successful, a confirmation of the reset is sent +// to the user and a 204 no content is returned +func (h *Handler) ResetPassword(ctx echo.Context) error { + var in models.ResetPasswordRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + // setup viewer context + ctxWithToken := token.NewContextWithResetToken(ctx.Request().Context(), in.Token) + + // lookup user from db based on provided token + entUser, err := h.getUserByResetToken(ctxWithToken, in.Token) + if err != nil { + h.Logger.Errorf("error retrieving user token", "error", err) + + if generated.IsNotFound(err) { + return h.BadRequest(ctx, ErrPassWordResetTokenInvalid) + } + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + + // ent user to &User for funcs + user := &User{ + ID: entUser.ID, + Email: entUser.Email, + } + + // set tokens for request + if err := user.setResetTokens(entUser, in.Token); err != nil { + h.Logger.Errorw("unable to set reset tokens for request", "error", err) + + return h.BadRequest(ctx, err) + } + + // Construct the user token from the database fields + // type ulid to string + uid, err := ulid.Parse(entUser.ID) + if err != nil { + return err + } + + // construct token from db fields + token := &tokens.ResetToken{ + UserID: uid, + } + + if token.ExpiresAt, err = user.GetPasswordResetExpires(); err != nil { + h.Logger.Errorw("unable to parse expiration", "error", err) + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + + // Verify the token is valid with the stored secret + if err = token.Verify(user.GetPasswordResetToken(), user.PasswordResetSecret); err != nil { + if errors.Is(err, tokens.ErrTokenExpired) { + errMsg := "reset token is expired, please request a new token using forgot-password" + + return h.BadRequest(ctx, fmt.Errorf("%w: %s", ErrPassWordResetTokenInvalid, errMsg)) + } + + return h.BadRequest(ctx, err) + } + + // make sure its not the same password as current + valid, err := passwd.VerifyDerivedKey(*entUser.Password, in.Password) + if err != nil || valid { + return h.BadRequest(ctx, ErrNonUniquePassword) + } + + // set context for remaining request based on logged in user + userCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: entUser.ID, + }) + + if err := h.updateUserPassword(userCtx, entUser.ID, in.Password); err != nil { + h.Logger.Errorw("error updating user password", "error", err) + + return h.BadRequest(ctx, err) + } + + if err := h.expireAllResetTokensUserByEmail(userCtx, user.Email); err != nil { + h.Logger.Errorw("error expiring existing tokens", "error", err) + + return h.BadRequest(ctx, err) + } + + if err := h.TaskMan.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return h.SendPasswordResetSuccessEmail(user) + }), marionette.WithRetries(3), //nolint:mnd + marionette.WithBackoff(backoff.NewExponentialBackOff()), + marionette.WithErrorf("could not send password reset confirmation email to user %s", user.Email), + ); err != nil { + h.Logger.Errorw("error sending confirmation email", "error", err) + + return h.InternalServerError(ctx, ErrProcessingRequest) + } + + out := &models.ResetPasswordReply{ + Reply: rout.Reply{Success: true}, + Message: "password has been re-set successfully", + } + + return h.Success(ctx, out) +} + +// setResetTokens sets the fields for the password reset +func (u *User) setResetTokens(user *generated.User, reqToken string) error { + tokens := user.Edges.PasswordResetTokens + for _, t := range tokens { + if t.Token == reqToken { + u.PasswordResetToken = sql.NullString{String: t.Token, Valid: true} + u.PasswordResetSecret = *t.Secret + u.PasswordResetExpires = sql.NullString{String: t.TTL.Format(time.RFC3339Nano), Valid: true} + + return nil + } + } + + // This should only happen on a race condition with two request + // otherwise, since we get the user by the token, it should always + // be there + return ErrPassWordResetTokenInvalid +} + +// BindResetPasswordHandler binds the reset password handler to the OpenAPI schema +func (h *Handler) BindResetPasswordHandler() *openapi3.Operation { + resetPassword := openapi3.NewOperation() + resetPassword.Description = "ResetPassword allows the user (after requesting a password reset) to set a new password - the password reset token needs to be set in the request and not expired. If the request is successful, a confirmation of the reset is sent to the user and a 200 StatusOK is returned" + resetPassword.OperationID = "PasswordReset" + resetPassword.Security = &openapi3.SecurityRequirements{} + + h.AddRequestBody("ResetPasswordRequest", models.ExampleResetPasswordSuccessRequest, resetPassword) + h.AddResponse("ResetPasswordReply", "success", models.ExampleResetPasswordSuccessResponse, resetPassword, http.StatusOK) + resetPassword.AddResponse(http.StatusInternalServerError, internalServerError()) + resetPassword.AddResponse(http.StatusBadRequest, badRequest()) + + return resetPassword +} diff --git a/internal/httpserve/handlers/resetpassword_test.go b/internal/httpserve/handlers/resetpassword_test.go new file mode 100644 index 0000000..e842bad --- /dev/null +++ b/internal/httpserve/handlers/resetpassword_test.go @@ -0,0 +1,255 @@ +package handlers_test + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/rShetty/asyncwait" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/emails/mock" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/models" +) + +func (suite *HandlerTestSuite) TestResetPasswordHandler() { + t := suite.T() + + // setup request request + suite.e.POST("password-reset", suite.h.ResetPassword) + + ec := echocontext.NewTestEchoContext().Request().Context() + + var newPassword = "6z9Fqc-E-9v32NsJzLNU" //nolint:gosec + + expiredTTL := time.Now().AddDate(0, 0, -1).Format(time.RFC3339Nano) + + testCases := []struct { + name string + email string + newPassword string + tokenSet bool + tokenProvided string + ttl string + emailExpected bool + expectedEmailSubject string + expectedResp string + expectedStatus int + from string + }{ + { + name: "happy path", + email: "kelsier@theopenlane.io", + tokenSet: true, + newPassword: newPassword, + from: "mitb@theopenlane.io", + emailExpected: true, + expectedEmailSubject: emails.PasswordResetSuccessRE, + expectedResp: emptyResponse, + expectedStatus: http.StatusOK, + }, + { + name: "bad token (user not found)", + email: "eventure@theopenlane.io", + tokenSet: true, + tokenProvided: "thisisnotavalidtoken", + newPassword: newPassword, + emailExpected: false, + from: "notactuallyanemail", + expectedResp: "password reset token invalid", + expectedStatus: http.StatusBadRequest, + }, + { + name: "weak password", + email: "sazed@theopenlane.io", + tokenSet: true, + newPassword: "weak1", + emailExpected: false, + from: "nottodaysatan", + expectedResp: "password is too weak", + expectedStatus: http.StatusBadRequest, + }, + { + name: "same password", + email: "sventure@theopenlane.io", + tokenSet: true, + newPassword: validPassword, + emailExpected: false, + from: "mmhmm", + expectedResp: "password was already used", + expectedStatus: http.StatusBadRequest, + }, + { + name: "missing token", + email: "dockson@theopenlane.io", + tokenSet: false, + newPassword: newPassword, + emailExpected: false, + from: "yadayadayada", + expectedResp: "token is required", + expectedStatus: http.StatusBadRequest, + }, + { + name: "expired reset token", + email: "tensoon@theopenlane.io", + newPassword: "6z9Fqc-E-9v32NsJzLNP", + tokenSet: true, + emailExpected: false, + from: "zonkertons", + ttl: expiredTTL, + expectedResp: "reset token is expired, please request a new token using forgot-password", + expectedStatus: http.StatusBadRequest, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + sent := time.Now() + + mock.ResetEmailMock() + + // create user in the database + rt, _, err := suite.createUserWithResetToken(t, ec, tc.email, tc.ttl) + require.NoError(t, err) + + pwResetJSON := models.ResetPasswordRequest{ + Password: tc.newPassword, + } + + if tc.tokenSet { + pwResetJSON.Token = rt.Token + if tc.tokenProvided != "" { + pwResetJSON.Token = tc.tokenProvided + } + } + + body, err := json.Marshal(pwResetJSON) + if err != nil { + require.NoError(t, err) + } + + req := httptest.NewRequest(http.MethodPost, "/password-reset", strings.NewReader(string(body))) + req.Header.Set("Content-Type", "application/json") + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + // get result + res := recorder.Result() + defer res.Body.Close() + + // check status + assert.Equal(t, tc.expectedStatus, recorder.Code) + + var out *models.ResetPasswordReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + if tc.expectedStatus != http.StatusOK { + assert.Contains(t, out.Error, tc.expectedResp) + } + + // Test that one verify email was sent to each user + messages := []*mock.EmailMetadata{ + { + To: tc.email, + From: tc.from, + Subject: tc.expectedEmailSubject, + Timestamp: sent, + }, + } + + // wait for messages + predicate := func() bool { + return suite.h.TaskMan.GetQueueLength() == 0 + } + successful := asyncwait.NewAsyncWait(maxWaitInMillis, pollIntervalInMillis).Check(predicate) + + if successful != true { + t.Errorf("max wait of email send") + } + + if tc.emailExpected { + mock.CheckEmails(t, messages) + } else { + mock.CheckEmails(t, nil) + } + }) + } +} + +// createUserWithResetToken creates a user with a valid reset token and returns the token, user id, and error if one occurred +func (suite *HandlerTestSuite) createUserWithResetToken(t *testing.T, ec context.Context, email string, ttl string) (*ent.PasswordResetToken, string, error) { + ctx := privacy.DecisionContext(ec, privacy.Allow) + + // add mocks for writes + mock_fga.WriteAny(t, suite.fga) + + userSetting := suite.db.UserSetting.Create(). + SetEmailConfirmed(true). + SaveX(ctx) + + u := suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail(email). + SetPassword(validPassword). + SetSetting(userSetting). + SaveX(ctx) + + user := handlers.User{ + FirstName: u.FirstName, + LastName: u.LastName, + Email: u.Email, + ID: u.ID, + } + + // create token + if err := user.CreatePasswordResetToken(); err != nil { + return nil, "", err + } + + if ttl != "" { + user.PasswordResetExpires.String = ttl + } + + // set expiry if provided in test case + expiry, err := time.Parse(time.RFC3339Nano, user.PasswordResetExpires.String) + if err != nil { + return nil, "", err + } + + // store token in db + pr := suite.db.PasswordResetToken.Create(). + SetOwner(u). + SetToken(user.PasswordResetToken.String). + SetEmail(user.Email). + SetSecret(user.PasswordResetSecret). + SetTTL(expiry). + SaveX(ctx) + + // clear mocks + mock_fga.ClearMocks(suite.fga) + + return pr, u.ID, nil +} diff --git a/internal/httpserve/handlers/switch.go b/internal/httpserve/handlers/switch.go new file mode 100644 index 0000000..7a952e2 --- /dev/null +++ b/internal/httpserve/handlers/switch.go @@ -0,0 +1,121 @@ +package handlers + +import ( + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + ph "github.com/posthog/posthog-go" + echo "github.com/theopenlane/echox" + "github.com/theopenlane/iam/fgax" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" +) + +// SwitchHandler is responsible for handling requests to the `/switch` endpoint, and changing the user's logged in organization context +func (h *Handler) SwitchHandler(ctx echo.Context) error { + var in models.SwitchOrganizationRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + reqCtx := ctx.Request().Context() + + userID, err := auth.GetUserIDFromContext(reqCtx) + if err != nil { + h.Logger.Errorw("unable to get user id from context", "error", err) + + return h.BadRequest(ctx, err) + } + + // get user from database by subject + user, err := h.getUserDetailsByID(reqCtx, userID) + if err != nil { + h.Logger.Errorw("unable to get user by subject", "error", err) + + return h.BadRequest(ctx, err) + } + + orgID, err := auth.GetOrganizationIDFromContext(reqCtx) + if err != nil { + h.Logger.Errorw("unable to get organization id from context", "error", err) + + return h.BadRequest(ctx, err) + } + + // ensure the user is not already in the target organization + if orgID == in.TargetOrganizationID { + return h.BadRequest(ctx, ErrAlreadySwitchedIntoOrg) + } + + // ensure user is already a member of the destination organization + req := fgax.AccessCheck{ + SubjectID: userID, + SubjectType: auth.UserSubjectType, + ObjectID: in.TargetOrganizationID, + } + + if allow, err := h.DBClient.Authz.CheckOrgReadAccess(reqCtx, req); err != nil || !allow { + h.Logger.Errorw("user not authorized to access organization", "error", err) + + return h.Unauthorized(ctx, err) + } + + // get the target organization + orgGetCtx := privacy.DecisionContext(reqCtx, privacy.Allow) + + org, err := h.getOrgByID(orgGetCtx, in.TargetOrganizationID) + if err != nil { + h.Logger.Errorw("unable to get target organization by id", "error", err) + + return h.BadRequest(ctx, err) + } + + // create new claims for the user + auth, err := h.AuthManager.GenerateUserAuthSessionWithOrg(ctx, user, org.ID) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + return h.InternalServerError(ctx, err) + } + + // track the organization switch event + props := ph.NewProperties(). + Set("user_id", user.ID). + Set("email", user.Email). + Set("target_organization_id", org.ID). + Set("auth_provider", user.AuthProvider). + Set("previous_organization_id", orgID) + + h.AnalyticsClient.Event("organization_switched", props) + + // set the out attributes we send back to the client only on success + out := &models.SwitchOrganizationReply{ + Reply: rout.Reply{Success: true}, + AuthData: *auth, + } + + return h.Success(ctx, out) +} + +// BindSwitchHandler binds the reset password handler to the OpenAPI schema +func (h *Handler) BindSwitchHandler() *openapi3.Operation { + switchHandler := openapi3.NewOperation() + switchHandler.Description = "Switch the user's organization context" + switchHandler.OperationID = "OrganizationSwitch" + + h.AddRequestBody("SwitchOrganizationRequest", models.ExampleSwitchSuccessRequest, switchHandler) + h.AddResponse("SwitchOrganizationReply", "success", models.ExampleSwitchSuccessReply, switchHandler, http.StatusOK) + switchHandler.AddResponse(http.StatusInternalServerError, internalServerError()) + switchHandler.AddResponse(http.StatusBadRequest, badRequest()) + switchHandler.AddResponse(http.StatusUnauthorized, unauthorized()) + + return switchHandler +} diff --git a/internal/httpserve/handlers/tools_test.go b/internal/httpserve/handlers/tools_test.go new file mode 100644 index 0000000..7870c80 --- /dev/null +++ b/internal/httpserve/handlers/tools_test.go @@ -0,0 +1,215 @@ +package handlers_test + +import ( + "context" + "log" + "path/filepath" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + echo "github.com/theopenlane/echox" + "github.com/theopenlane/iam/fgax" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + "go.uber.org/zap" + "go.uber.org/zap/zaptest" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + + "github.com/theopenlane/core/internal/ent/entconfig" + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/entdb" + "github.com/theopenlane/core/internal/httpserve/authmanager" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/analytics" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/middleware/transaction" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/testutils" +) + +var ( + // commonly used vars in tests + emptyResponse = "null\n" + validPassword = "sup3rs3cu7e!" + + // mock email send settings + maxWaitInMillis = 2000 + pollIntervalInMillis = 100 +) + +// HandlerTestSuite handles the setup and teardown between tests +type HandlerTestSuite struct { + suite.Suite + e *echo.Echo + db *ent.Client + api *openlaneclient.OpenLaneClient + h *handlers.Handler + fga *mock_fga.MockSdkClient + tf *testutils.TestFixture +} + +// TestHandlerTestSuite runs all the tests in the HandlerTestSuite +func TestHandlerTestSuite(t *testing.T) { + suite.Run(t, new(HandlerTestSuite)) +} + +func (suite *HandlerTestSuite) SetupSuite() { + suite.tf = entdb.NewTestFixture() +} + +func (suite *HandlerTestSuite) SetupTest() { + t := suite.T() + + ctx := context.Background() + + suite.fga = mock_fga.NewMockSdkClient(t) + + // create mock FGA client + fc := fgax.NewMockFGAClient(t, suite.fga) + + // setup logger + logger := zap.NewNop().Sugar() + + emConfig := emails.Config{ + Testing: true, + Archive: filepath.Join("fixtures", "emails"), + FromEmail: "mitb@theopenlane.io", + } + + em, err := emails.New(emConfig) + if err != nil { + t.Fatal("error creating email manager") + } + + // Start task manager + tmConfig := marionette.Config{} + + taskMan := marionette.New(tmConfig) + + taskMan.Start() + + tm, err := testutils.CreateTokenManager(15 * time.Minute) //nolint:mnd + if err != nil { + t.Fatal("error creating token manager") + } + + sm := testutils.CreateSessionManager() + rc := testutils.NewRedisClient() + + sessionConfig := sessions.NewSessionConfig( + sm, + sessions.WithPersistence(rc), + sessions.WithLogger(logger), + ) + + sessionConfig.CookieConfig = &sessions.DebugOnlyCookieConfig + + opts := []ent.Option{ + ent.Logger(*logger), + ent.Authz(*fc), + ent.Marionette(taskMan), + ent.Emails(em), + ent.TokenManager(tm), + ent.SessionConfig(&sessionConfig), + ent.Analytics(&analytics.EventManager{Enabled: false}), + ent.EntConfig(&entconfig.Config{ + Flags: entconfig.Flags{ + UseListUserService: false, + UseListObjectService: false, + }, + }), + } + + // create database connection + db, err := entdb.NewTestClient(ctx, suite.tf, opts) + require.NoError(t, err, "failed opening connection to database") + + // add db to test client + suite.db = db + + // add the client + suite.api, err = testutils.TestClient(t, suite.db) + require.NoError(t, err) + + // setup handler + suite.h = handlerSetup(t, suite.db) + + // setup echo router + suite.e = setupEcho(suite.db) +} + +func (suite *HandlerTestSuite) TearDownTest() { + // clear all fga mocks + mock_fga.ClearMocks(suite.fga) + + if suite.db != nil { + if err := suite.db.Close(); err != nil { + log.Fatalf("failed to close database: %s", err) + } + } +} + +func (suite *HandlerTestSuite) TearDownSuite() { + testutils.TeardownFixture(suite.tf) +} + +func setupEcho(entClient *ent.Client) *echo.Echo { + // create echo context with middleware + e := echo.New() + transactionConfig := transaction.Client{ + EntDBClient: entClient, + Logger: zap.NewNop().Sugar(), + } + + e.Use(transactionConfig.Middleware) + + return e +} + +// handlerSetup to be used for required references in the handler tests +func handlerSetup(t *testing.T, ent *ent.Client) *handlers.Handler { + logger := zaptest.NewLogger(t, zaptest.Level(zap.ErrorLevel)).Sugar() + + as := authmanager.New() + as.SetTokenManager(ent.TokenManager) + as.SetSessionConfig(ent.SessionConfig) + + h := &handlers.Handler{ + IsTest: true, + TokenManager: ent.TokenManager, + DBClient: ent, + RedisClient: ent.SessionConfig.RedisClient, + Logger: logger, + SessionConfig: ent.SessionConfig, + AuthManager: as, + EmailManager: ent.Emails, + TaskMan: ent.Marionette, + AnalyticsClient: &analytics.EventManager{ + Enabled: false, + }, + } + + return h +} + +// userContextWithID creates a new user context with the provided user ID +// and adds it to a new echo context +func userContextWithID(userID string) (context.Context, error) { + // Use that user to create the organization + ec, err := auth.NewTestEchoContextWithValidUser(userID) + if err != nil { + return nil, err + } + + reqCtx := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec) + + ec.SetRequest(ec.Request().WithContext(reqCtx)) + + return reqCtx, nil +} diff --git a/internal/httpserve/handlers/userinfo.go b/internal/httpserve/handlers/userinfo.go new file mode 100644 index 0000000..1f10713 --- /dev/null +++ b/internal/httpserve/handlers/userinfo.go @@ -0,0 +1,30 @@ +package handlers + +import ( + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/core/pkg/auth" +) + +// UserInfo returns the user information for the authenticated user +func (h *Handler) UserInfo(ctx echo.Context) error { + // setup view context + reqCtx := ctx.Request().Context() + + userID, err := auth.GetUserIDFromContext(reqCtx) + if err != nil { + h.Logger.Errorw("unable to get user id from context", "error", err) + + return h.BadRequest(ctx, err) + } + + // get user from database by subject + user, err := h.getUserDetailsByID(reqCtx, userID) + if err != nil { + h.Logger.Errorw("unable to get user by subject", "error", err) + + return h.BadRequest(ctx, err) + } + + return h.Success(ctx, user) +} diff --git a/internal/httpserve/handlers/userinfo_test.go b/internal/httpserve/handlers/userinfo_test.go new file mode 100644 index 0000000..d123598 --- /dev/null +++ b/internal/httpserve/handlers/userinfo_test.go @@ -0,0 +1,92 @@ +package handlers_test + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" +) + +func (suite *HandlerTestSuite) TestUserInfoHandler() { + t := suite.T() + + // bypass auth + ctx := context.Background() + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + mock_fga.WriteAny(t, suite.fga) + + // setup test data + user := suite.db.User.Create(). + SetEmail("juju@theopenlane.io"). + SetFirstName("Juju"). + SetLastName("Bee"). + SaveX(ctx) + + ec, err := auth.NewTestEchoContextWithValidUser(user.ID) + require.NoError(t, err) + + reqCtx := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec) + + suite.e.GET("oauth/userinfo", suite.h.UserInfo) + + tests := []struct { + name string + ctx context.Context + wantErr bool + }{ + { + name: "happy path", + ctx: reqCtx, + wantErr: false, + }, + { + name: "empty context", + ctx: context.Background(), + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create a new request + req := httptest.NewRequest(http.MethodGet, "/oauth/userinfo", nil) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req.WithContext(tt.ctx)) + + res := recorder.Result() + defer res.Body.Close() + + var out *ent.User + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + if tt.wantErr { + assert.Equal(t, http.StatusBadRequest, recorder.Code) + + return + } + + assert.Equal(t, http.StatusOK, recorder.Code) + require.NotNil(t, out) + + assert.Equal(t, user.ID, out.ID) + }) + } +} diff --git a/internal/httpserve/handlers/users.go b/internal/httpserve/handlers/users.go new file mode 100644 index 0000000..d893159 --- /dev/null +++ b/internal/httpserve/handlers/users.go @@ -0,0 +1,117 @@ +package handlers + +import ( + "database/sql" + "time" + + "github.com/oklog/ulid/v2" + + "github.com/theopenlane/core/pkg/tokens" +) + +// User holds data specific to the user for the REST handlers for +// login, registration, verification, etc +type User struct { + ID string + FirstName string + LastName string + Name string + Email string + Password *string + OTPSecret string `json:"-"` + EmailVerificationExpires sql.NullString + EmailVerificationToken sql.NullString + EmailVerificationSecret []byte + PasswordResetExpires sql.NullString + PasswordResetToken sql.NullString + PasswordResetSecret []byte + URLToken +} + +// URLToken holds data specific to a future user of the system for invite logic +type URLToken struct { + Expires sql.NullString + Token sql.NullString + Secret []byte +} + +// GetVerificationToken returns the verification token if its valid +func (u *User) GetVerificationToken() string { + if u.EmailVerificationToken.Valid { + return u.EmailVerificationToken.String + } + + return "" +} + +// GetVerificationExpires returns the expiration time of email verification token +func (u *User) GetVerificationExpires() (time.Time, error) { + if u.EmailVerificationExpires.Valid { + return time.Parse(time.RFC3339Nano, u.EmailVerificationExpires.String) + } + + return time.Time{}, nil +} + +// CreateVerificationToken creates a new email verification token for the user +func (u *User) CreateVerificationToken() error { + // Create a unique token from the user's email address + verify, err := tokens.NewVerificationToken(u.Email) + if err != nil { + return err + } + + // Sign the token to ensure that we can verify it later + token, secret, err := verify.Sign() + if err != nil { + return err + } + + u.EmailVerificationToken = sql.NullString{Valid: true, String: token} + u.EmailVerificationExpires = sql.NullString{Valid: true, String: verify.ExpiresAt.Format(time.RFC3339Nano)} + u.EmailVerificationSecret = secret + + return nil +} + +// GetPasswordResetToken returns the password reset token if its valid +func (u *User) GetPasswordResetToken() string { + if u.PasswordResetToken.Valid { + return u.PasswordResetToken.String + } + + return "" +} + +// GetPasswordResetExpires returns the expiration time of password verification token +func (u *User) GetPasswordResetExpires() (time.Time, error) { + if u.PasswordResetExpires.Valid { + return time.Parse(time.RFC3339Nano, u.PasswordResetExpires.String) + } + + return time.Time{}, nil +} + +// CreatePasswordResetToken creates a new reset token for the user +func (u *User) CreatePasswordResetToken() error { + uid, err := ulid.Parse(u.ID) + if err != nil { + return err + } + + reset, err := tokens.NewResetToken(uid) + if err != nil { + return err + } + + token, secret, err := reset.Sign() + if err != nil { + return err + } + + u.PasswordResetToken = sql.NullString{Valid: true, String: token} + u.PasswordResetExpires = sql.NullString{Valid: true, String: reset.ExpiresAt.Format(time.RFC3339Nano)} + u.PasswordResetSecret = secret + + return nil +} diff --git a/internal/httpserve/handlers/verify_test.go b/internal/httpserve/handlers/verify_test.go new file mode 100644 index 0000000..938ab7c --- /dev/null +++ b/internal/httpserve/handlers/verify_test.go @@ -0,0 +1,164 @@ +package handlers_test + +import ( + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/models" +) + +func (suite *HandlerTestSuite) TestVerifyHandler() { + t := suite.T() + + // add handler + suite.e.GET("verify", suite.h.VerifyEmail) + + ec := echocontext.NewTestEchoContext().Request().Context() + + expiredTTL := time.Now().AddDate(0, 0, -1).Format(time.RFC3339Nano) + + testCases := []struct { + name string + userConfirmed bool + email string + ttl string + tokenSet bool + expectedMessage string + expectedStatus int + }{ + { + name: "happy path, unconfirmed user", + userConfirmed: false, + email: "mitb@theopenlane.io", + tokenSet: true, + expectedMessage: "success", + expectedStatus: http.StatusOK, + }, + { + name: "happy path, already confirmed user", + userConfirmed: true, + email: "sitb@theopenlane.io", + tokenSet: true, + expectedMessage: "success", + expectedStatus: http.StatusOK, + }, + { + name: "missing token", + userConfirmed: true, + email: "santa@theopenlane.io", + tokenSet: false, + expectedMessage: "token is required", + expectedStatus: http.StatusBadRequest, + }, + { + name: "expired token, but not already confirmed", + userConfirmed: false, + email: "elf@theopenlane.io", + tokenSet: true, + ttl: expiredTTL, + expectedMessage: "Token expired, a new token has been issued. Please try again", + expectedStatus: http.StatusCreated, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + // set privacy allow in order to allow the creation of the users without + // authentication in the tests + ctx := privacy.DecisionContext(ec, privacy.Allow) + + // create user in the database + userSetting := suite.db.UserSetting.Create(). + SetEmailConfirmed(tc.userConfirmed). + SaveX(ctx) + + // mock writes for user creation + mock_fga.WriteAny(t, suite.fga) + + u := suite.db.User.Create(). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SetEmail(tc.email). + SetPassword(validPassword). + SetSetting(userSetting). + SaveX(ctx) + + user := handlers.User{ + FirstName: u.FirstName, + LastName: u.LastName, + Email: u.Email, + ID: u.ID, + } + + // create token + if err := user.CreateVerificationToken(); err != nil { + require.NoError(t, err) + } + + if tc.ttl != "" { + user.EmailVerificationExpires.String = tc.ttl + } + + ttl, err := time.Parse(time.RFC3339Nano, user.EmailVerificationExpires.String) + if err != nil { + require.NoError(t, err) + } + + // store token in db + allowCtx := privacy.DecisionContext(ec, privacy.Allow) + et := suite.db.EmailVerificationToken.Create(). + SetOwner(u). + SetToken(user.EmailVerificationToken.String). + SetEmail(user.Email). + SetSecret(user.EmailVerificationSecret). + SetTTL(ttl). + SaveX(allowCtx) + + target := "/verify" + if tc.tokenSet { + target = fmt.Sprintf("/verify?token=%s", et.Token) + } + + req := httptest.NewRequest(http.MethodGet, target, nil) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + assert.Equal(t, tc.expectedStatus, recorder.Code) + + var out *models.VerifyReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + if tc.expectedStatus >= http.StatusOK && tc.expectedStatus <= http.StatusCreated { + assert.Contains(t, out.Message, tc.expectedMessage) + } else { + assert.Contains(t, out.Error, tc.expectedMessage) + } + }) + } +} diff --git a/internal/httpserve/handlers/verifyemail.go b/internal/httpserve/handlers/verifyemail.go new file mode 100644 index 0000000..b87f2a2 --- /dev/null +++ b/internal/httpserve/handlers/verifyemail.go @@ -0,0 +1,169 @@ +package handlers + +import ( + "errors" + "net/http" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/getkin/kin-openapi/openapi3" + ph "github.com/posthog/posthog-go" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/tokens" +) + +// VerifyEmail is the handler for the email verification endpoint +func (h *Handler) VerifyEmail(ctx echo.Context) error { + var in models.VerifyRequest + if err := ctx.Bind(&in); err != nil { + return h.InvalidInput(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + // setup viewer context + ctxWithToken := token.NewContextWithVerifyToken(ctx.Request().Context(), in.Token) + + entUser, err := h.getUserByEVToken(ctxWithToken, in.Token) + if err != nil { + if generated.IsNotFound(err) { + return h.BadRequest(ctx, err) + } + + h.Logger.Errorf("error retrieving user token", "error", err) + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + + // create email verification + user := &User{ + ID: entUser.ID, + Email: entUser.Email, + } + + userCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: entUser.ID, + }) + + // check to see if user is already confirmed + if !entUser.Edges.Setting.EmailConfirmed { + // set tokens for request + if err := user.setUserTokens(entUser, in.Token); err != nil { + h.Logger.Errorw("unable to set user tokens for request", "error", err) + + return h.BadRequest(ctx, err) + } + + // Construct the user token from the database fields + t := &tokens.VerificationToken{ + Email: entUser.Email, + } + + if t.ExpiresAt, err = user.GetVerificationExpires(); err != nil { + h.Logger.Errorw("unable to parse expiration", "error", err) + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + + // Verify the token with the stored secret + if err = t.Verify(user.GetVerificationToken(), user.EmailVerificationSecret); err != nil { + if errors.Is(err, tokens.ErrTokenExpired) { + userCtx = token.NewContextWithSignUpToken(userCtx, user.Email) + + meowtoken, err := h.storeAndSendEmailVerificationToken(userCtx, user) + if err != nil { + h.Logger.Errorw("unable to resend verification token", "error", err) + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + + out := &models.VerifyReply{ + Reply: rout.Reply{Success: false}, + ID: meowtoken.ID, + Email: user.Email, + Message: "Token expired, a new token has been issued. Please try again.", + Token: meowtoken.Token, + } + + return h.Created(ctx, out) + } + + return h.BadRequest(ctx, err) + } + + if err := h.setEmailConfirmed(userCtx, entUser); err != nil { + return h.BadRequest(ctx, err) + } + } + + if err := h.addDefaultOrgToUserQuery(userCtx, entUser); err != nil { + return h.InternalServerError(ctx, err) + } + + // create new claims for the user + auth, err := h.AuthManager.GenerateUserAuthSession(ctx, entUser) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + return h.InternalServerError(ctx, err) + } + + props := ph.NewProperties(). + Set("user_id", user.ID). + Set("email", user.Email). + Set("first_name", user.FirstName). + Set("last_name", user.LastName) + + h.AnalyticsClient.Event("email_verified", props) + + out := &models.VerifyReply{ + ID: entUser.ID, + Email: entUser.Email, + Reply: rout.Reply{Success: true}, + Message: "success", + AuthData: *auth, + } + + return h.Success(ctx, out) +} + +// setUserTokens sets the fields to verify the email +func (u *User) setUserTokens(user *generated.User, reqToken string) error { + tokens := user.Edges.EmailVerificationTokens + for _, t := range tokens { + if t.Token == reqToken { + u.EmailVerificationToken = sql.NullString{String: t.Token, Valid: true} + u.EmailVerificationSecret = *t.Secret + u.EmailVerificationExpires = sql.NullString{String: t.TTL.Format(time.RFC3339Nano), Valid: true} + + return nil + } + } + + return ErrNotFound +} + +// BindVerifyEmailHandler binds the verify email verification endpoint to the OpenAPI schema +func (h *Handler) BindVerifyEmailHandler() *openapi3.Operation { + verify := openapi3.NewOperation() + verify.Description = "VerifyEmail verifies a user's email address by validating the token in the request and setting the user's validated field in the database to true. This endpoint is intended to be called by frontend applications after the user has followed the link in the verification email" + verify.OperationID = "VerifyEmail" + verify.Security = &openapi3.SecurityRequirements{} + + h.AddRequestBody("VerifyEmailRequest", models.ExampleVerifySuccessRequest, verify) + h.AddResponse("VerifyEmailReply", "success", models.ExampleVerifySuccessResponse, verify, http.StatusOK) + verify.AddResponse(http.StatusInternalServerError, internalServerError()) + verify.AddResponse(http.StatusBadRequest, badRequest()) + verify.AddResponse(http.StatusCreated, created()) + + return verify +} diff --git a/internal/httpserve/handlers/verifysubscribe.go b/internal/httpserve/handlers/verifysubscribe.go new file mode 100644 index 0000000..2878c73 --- /dev/null +++ b/internal/httpserve/handlers/verifysubscribe.go @@ -0,0 +1,204 @@ +package handlers + +import ( + "context" + "errors" + "fmt" + "net/http" + "time" + + "entgo.io/ent/dialect/sql" + "github.com/cenkalti/backoff/v4" + "github.com/getkin/kin-openapi/openapi3" + ph "github.com/posthog/posthog-go" + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/tokens" +) + +// VerifySubscriptionHandler is the handler for the subscription verification endpoint +func (h *Handler) VerifySubscriptionHandler(ctx echo.Context) error { + var in models.VerifySubscribeRequest + if err := ctx.Bind(&in); err != nil { + return h.BadRequest(ctx, err) + } + + if err := in.Validate(); err != nil { + return h.InvalidInput(ctx, err) + } + + // setup viewer context + ctxWithToken := token.NewContextWithVerifyToken(ctx.Request().Context(), in.Token) + + entSubscriber, err := h.getSubscriberByToken(ctxWithToken, in.Token) + if err != nil { + if generated.IsNotFound(err) { + return h.BadRequest(ctx, err) + } + + h.Logger.Errorf("error retrieving subscriber", "error", err) + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + + // add org to the authenticated context + reqCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + OrganizationID: entSubscriber.OwnerID, + OrganizationIDs: []string{entSubscriber.OwnerID}, + }) + + ctxWithToken = token.NewContextWithVerifyToken(reqCtx, in.Token) + + if !entSubscriber.VerifiedEmail { + if err := h.verifySubscriberToken(ctxWithToken, entSubscriber); err != nil { + if errors.Is(err, ErrExpiredToken) { + out := &models.VerifySubscribeReply{ + Reply: rout.Reply{Success: false}, + Message: "The verification link has expired, a new one has been sent to your email.", + } + + return h.Created(ctx, out) + } + + h.Logger.Errorf("error verifying subscriber token", "error", err) + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + + input := generated.UpdateSubscriberInput{ + Email: &entSubscriber.Email, + } + + if err := h.updateSubscriberVerifiedEmail(ctxWithToken, entSubscriber.ID, input); err != nil { + h.Logger.Errorf("error updating subscriber", "error", err) + + return h.InternalServerError(ctx, ErrUnableToVerifyEmail) + } + } + + props := ph.NewProperties(). + Set("email", entSubscriber.Email) + + h.AnalyticsClient.Event("subscriber_verified", props) + + out := &models.VerifySubscribeReply{ + Reply: rout.Reply{Success: true}, + Message: "Subscription confirmed, looking forward to sending you updates!", + } + + return h.Success(ctx, out) +} + +// verifySubscriberToken checks the token provided by the user and verifies it against the database +func (h *Handler) verifySubscriberToken(ctx context.Context, entSubscriber *generated.Subscriber) error { + // create User struct from entSubscriber + user := &User{ + ID: entSubscriber.ID, + Email: entSubscriber.Email, + EmailVerificationSecret: *entSubscriber.Secret, + EmailVerificationToken: sql.NullString{String: entSubscriber.Token, Valid: true}, + EmailVerificationExpires: sql.NullString{String: entSubscriber.TTL.Format(time.RFC3339Nano), Valid: true}, + } + + // setup token to be validated + t := &tokens.VerificationToken{ + Email: entSubscriber.Email, + } + + var err error + t.ExpiresAt, err = user.GetVerificationExpires() + + if err != nil { + h.Logger.Errorw("unable to parse expiration", "error", err) + + return ErrUnableToVerifyEmail + } + + // verify token is valid, otherwise reset and send new token + if err := t.Verify(user.GetVerificationToken(), user.EmailVerificationSecret); err != nil { + // if token is expired, create new token and send email + if errors.Is(err, tokens.ErrTokenExpired) { + if err := user.CreateVerificationToken(); err != nil { + h.Logger.Errorw("error creating verification token", "error", err) + + return err + } + + // update token settings in the database + if err := h.updateSubscriberVerificationToken(ctx, user); err != nil { + h.Logger.Errorw("error updating subscriber verification token", "error", err) + + return err + } + + // set viewer context + ctxWithToken := token.NewContextWithSignUpToken(ctx, entSubscriber.Email) + + // resend email with new token to the subscriber + if err := h.sendSubscriberEmail(ctxWithToken, user, entSubscriber.OwnerID); err != nil { + h.Logger.Errorw("error sending subscriber email", "error", err) + + return err + } + } + + return ErrExpiredToken + } + + return nil +} + +func (h *Handler) sendSubscriberEmail(ctx context.Context, user *User, orgID string) error { + if orgID == "" { + return fmt.Errorf("%w, subscriber organization not found", ErrMissingField) + } + + org, err := h.getOrgByID(ctx, orgID) + if err != nil { + return err + } + + // send emails via TaskMan as to not create blocking operations in the server + if err := h.TaskMan.Queue(marionette.TaskFunc(func(ctx context.Context) error { + return h.SendSubscriberEmail(user, org.Name) + }), marionette.WithRetries(3), //nolint:mnd + marionette.WithBackoff(backoff.NewExponentialBackOff()), + marionette.WithErrorf("could not send subscriber verification email to user %s", user.Email), + ); err != nil { + return err + } + + props := ph.NewProperties(). + Set("user_id", user.ID). + Set("email", user.Email). + Set("first_name", user.FirstName). + Set("last_name", user.LastName). + Set("organization_name", org.Name) + + h.AnalyticsClient.Event("email_verification_sent", props) + + return nil +} + +// BindVerifySubscriberHandler creates the openapi operation for the subscription verification endpoint +func (h *Handler) BindVerifySubscriberHandler() *openapi3.Operation { + verify := openapi3.NewOperation() + verify.Description = "Verify an email address for a subscription" + verify.OperationID = "VerifySubscriberEmail" + verify.Security = &openapi3.SecurityRequirements{} + + h.AddRequestBody("VerifySubscriptionEmail", models.ExampleVerifySubscriptionSuccessRequest, verify) + h.AddResponse("VerifySubscriptionReply", "success", models.ExampleVerifySubscriptionResponse, verify, http.StatusOK) + verify.AddResponse(http.StatusInternalServerError, internalServerError()) + verify.AddResponse(http.StatusBadRequest, badRequest()) + verify.AddResponse(http.StatusCreated, created()) + + return verify +} diff --git a/internal/httpserve/handlers/verifysubscribe_test.go b/internal/httpserve/handlers/verifysubscribe_test.go new file mode 100644 index 0000000..7fc25f6 --- /dev/null +++ b/internal/httpserve/handlers/verifysubscribe_test.go @@ -0,0 +1,196 @@ +package handlers_test + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/brianvoe/gofakeit/v7" + "github.com/rShetty/asyncwait" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + mock_fga "github.com/theopenlane/iam/fgax/mockery" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/emails/mock" + "github.com/theopenlane/utils/ulids" + + ent "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/privacy" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +func (suite *HandlerTestSuite) TestVerifySubscribeHandler() { + t := suite.T() + + // add handler + suite.e.GET("subscribe/verify", suite.h.VerifySubscriptionHandler) + + // bypass auth + ctx := context.Background() + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + mock_fga.WriteAny(t, suite.fga) + + // setup test data + user := suite.db.User.Create(). + SetEmail(gofakeit.Email()). + SetFirstName(gofakeit.FirstName()). + SetLastName(gofakeit.LastName()). + SaveX(ctx) + + reqCtx, err := userContextWithID(user.ID) + require.NoError(t, err) + + ctx = privacy.DecisionContext(reqCtx, privacy.Allow) + + input := openlaneclient.CreateOrganizationInput{ + Name: "mitb", + } + + org, err := suite.api.CreateOrganization(ctx, input) + require.NoError(t, err) + + expiredTTL := time.Now().AddDate(0, 0, -1).Format(time.RFC3339Nano) + + testCases := []struct { + name string + email string + ttl string + tokenSet bool + emailExpected bool + expectedStatus int + }{ + { + name: "happy path, new subscriber", + email: gofakeit.Email(), + tokenSet: true, + emailExpected: false, + expectedStatus: http.StatusOK, + }, + { + name: "expired token", + email: gofakeit.Email(), + tokenSet: true, + ttl: expiredTTL, + emailExpected: true, + expectedStatus: http.StatusOK, + }, + { + name: "missing token", + email: gofakeit.Email(), + tokenSet: false, + emailExpected: false, + expectedStatus: http.StatusBadRequest, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer mock_fga.ClearMocks(suite.fga) + + sent := time.Now() + + mock.ResetEmailMock() + + sub := suite.createTestSubscriber(t, org.CreateOrganization.Organization.ID, tc.email, tc.ttl) + + target := "/subscribe/verify" + if tc.tokenSet { + target = fmt.Sprintf("/subscribe/verify?token=%s", sub.Token) + } + + req := httptest.NewRequest(http.MethodGet, target, nil) + + // Set writer for tests that write on the response + recorder := httptest.NewRecorder() + + // Using the ServerHTTP on echo will trigger the router and middleware + suite.e.ServeHTTP(recorder, req) + + res := recorder.Result() + defer res.Body.Close() + + var out *models.VerifySubscribeReply + + // parse request body + if err := json.NewDecoder(res.Body).Decode(&out); err != nil { + t.Error("error parsing response", err) + } + + assert.Equal(t, tc.expectedStatus, recorder.Code) + + if tc.expectedStatus == http.StatusOK { + assert.NotEmpty(t, out.Message) + } + + // Test that one verify email was sent to each user + messages := []*mock.EmailMetadata{ + { + To: tc.email, + From: "mitb@theopenlane.io", + Subject: fmt.Sprintf(emails.Subscribed, "mitb"), + Timestamp: sent, + }, + } + + // wait for messages + predicate := func() bool { + return suite.h.TaskMan.GetQueueLength() == 0 + } + successful := asyncwait.NewAsyncWait(maxWaitInMillis, pollIntervalInMillis).Check(predicate) + + if successful != true { + t.Errorf("max wait of email send") + } + + if tc.emailExpected { + mock.CheckEmails(t, messages) + } + }) + } +} + +// createTestSubscriber is a helper to create a test subscriber +func (suite *HandlerTestSuite) createTestSubscriber(t *testing.T, orgID, email, ttl string) *ent.Subscriber { + user := handlers.User{ + Email: email, + } + + // create token + if err := user.CreateVerificationToken(); err != nil { + require.NoError(t, err) + } + + if ttl != "" { + user.EmailVerificationExpires.String = ttl + } + + expires, err := time.Parse(time.RFC3339Nano, user.EmailVerificationExpires.String) + if err != nil { + require.NoError(t, err) + } + + // set privacy allow in order to allow the creation of the users without + // authentication in the tests + ctx, err := auth.NewTestContextWithOrgID(ulids.New().String(), orgID) + require.NoError(t, err) + + reqCtx := privacy.DecisionContext(ctx, privacy.Allow) + + // store token in db + return suite.db.Subscriber.Create(). + SetToken(user.EmailVerificationToken.String). + SetEmail(user.Email). + SetSecret(user.EmailVerificationSecret). + SetTTL(expires). + SaveX(reqCtx) +} diff --git a/internal/httpserve/handlers/webauthn.go b/internal/httpserve/handlers/webauthn.go new file mode 100644 index 0000000..f47e596 --- /dev/null +++ b/internal/httpserve/handlers/webauthn.go @@ -0,0 +1,304 @@ +package handlers + +import ( + "context" + + echo "github.com/theopenlane/echox" + + "github.com/go-webauthn/webauthn/protocol" + "github.com/go-webauthn/webauthn/webauthn" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/privacy/token" + "github.com/theopenlane/core/pkg/auth" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" + provider "github.com/theopenlane/core/pkg/providers/webauthn" + "github.com/theopenlane/core/pkg/sessions" +) + +const ( + webauthnProvider = "WEBAUTHN" + webauthnRegistration = "WEBAUTHN_REGISTRATION" + webauthnLogin = "WEBAUTHN_LOGIN" +) + +// BeginWebauthnRegistration is the request to begin a webauthn login +func (h *Handler) BeginWebauthnRegistration(ctx echo.Context) error { + var r models.WebauthnRegistrationRequest + if err := ctx.Bind(&r); err != nil { + return h.InvalidInput(ctx, err) + } + + ctxWithToken := token.NewContextWithOauthTooToken(ctx.Request().Context(), r.Email) + + // to register a new passkey, the user needs to be created + logged in first + // once the the passkey is added to the user's account, they can use it to login + // we treat this verify similar to the oauth or basic registration flow + // user is created first, no credential method is set / they are unable to login until the credential flow is finished + entUser, err := h.CheckAndCreateUser(ctxWithToken, r.Name, r.Email, enums.AuthProvider(webauthnProvider), "") + if err != nil { + return h.InternalServerError(ctx, err) + } + + // set context for remaining request based on logged in user + userCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: entUser.ID, + }) + + // set webauthn allowed + if err := h.setWebauthnAllowed(userCtx, entUser); err != nil { + return h.InternalServerError(ctx, err) + } + + if err := h.addDefaultOrgToUserQuery(userCtx, entUser); err != nil { + return h.InternalServerError(ctx, err) + } + + user := &provider.User{ + ID: entUser.ID, + Email: entUser.Email, + Name: entUser.FirstName + " " + entUser.LastName, + } + + // options is the object that needs to be returned for the front end to open the creation dialog for the user to create the passkey + options, session, err := h.WebAuthn.BeginRegistration(user, + webauthn.WithResidentKeyRequirement(protocol.ResidentKeyRequirementRequired), + webauthn.WithExclusions(user.CredentialExcludeList()), + ) + if err != nil { + return err + } + + // we have to set not just a regular session for the user but also capture the return of the webauthn session + setSessionMap := map[string]any{} + setSessionMap[sessions.WebAuthnKey] = session + setSessionMap[sessions.UsernameKey] = r.Name + setSessionMap[sessions.UserTypeKey] = webauthnRegistration + setSessionMap[sessions.EmailKey] = r.Email + setSessionMap[sessions.UserIDKey] = user.ID + + sessionCtx, err := h.SessionConfig.SaveAndStoreSession(userCtx, ctx.Response().Writer, setSessionMap, user.ID) + if err != nil { + return h.InternalServerError(ctx, err) + } + + // return the session value for the UI to use + // the UI will need to set the cookie because authentication is handled + // server side + s, err := sessions.SessionToken(sessionCtx) + if err != nil { + return h.InternalServerError(ctx, err) + } + + out := &models.WebauthnBeginRegistrationResponse{ + Reply: rout.Reply{Success: true}, + CredentialCreation: options, + Session: s, + } + + return h.Success(ctx, out) +} + +// FinishWebauthnRegistration is the request to finish a webauthn registration - this is where we get the credential created by the user back +func (h *Handler) FinishWebauthnRegistration(ctx echo.Context) error { + // lookup userID in cache to ensure cookie and tokens match + session, err := h.SessionConfig.SessionManager.Get(ctx.Request(), h.SessionConfig.CookieConfig.Name) + if err != nil { + return h.BadRequest(ctx, err) + } + + // Get sessionID from cookie and check against redis + sessionID := h.SessionConfig.SessionManager.GetSessionIDFromCookie(session) + + userID, err := h.SessionConfig.RedisStore.GetSession(ctx.Request().Context(), sessionID) + if err != nil { + return h.BadRequest(ctx, err) + } + + // get session data from cookie to get the user id stored + sessionData := h.SessionConfig.SessionManager.GetSessionDataFromCookie(session) + + userIDFromCookie := sessionData.(map[string]any)[sessions.UserIDKey] + + // ensure the user is the same as the one who started the registration + if userIDFromCookie != userID { + return h.BadRequest(ctx, err) + } + + // get user from the database + entUser, err := h.getUserByID(ctx.Request().Context(), userID, enums.AuthProvider(webauthnProvider)) + if err != nil { + return h.InternalServerError(ctx, err) + } + + // set user in the viewer context for the rest of the request + userCtx := auth.AddAuthenticatedUserContext(ctx, &auth.AuthenticatedUser{ + SubjectID: entUser.ID, + }) + + // follows https://www.w3.org/TR/webauthn/#sctn-registering-a-new-credential + response, err := protocol.ParseCredentialCreationResponseBody(ctx.Request().Body) + if err != nil { + return h.BadRequest(ctx, err) + } + + // get webauthn session data from the session + webauthnData := sessionData.(map[string]any)[sessions.WebAuthnKey] + + wd, ok := webauthnData.(webauthn.SessionData) + if !ok { + return h.BadRequest(ctx, ErrNoAuthUser) + } + + user := &provider.User{ + ID: entUser.ID, + Email: entUser.Email, + Name: entUser.FirstName + " " + entUser.LastName, + } + + // validate the credential + credential, err := h.WebAuthn.CreateCredential(user, wd, response) + if err != nil { + return h.BadRequest(ctx, err) + } + + // save the credential to the database + if err := h.addCredentialToUser(userCtx, entUser, *credential); err != nil { + if IsConstraintError(err) { + return h.BadRequestWithCode(ctx, ErrDeviceAlreadyRegistered, DeviceRegisteredErrCode) + } + + return h.InternalServerError(ctx, err) + } + + // create new claims for the user + auth, err := h.AuthManager.GenerateUserAuthSession(ctx, entUser) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + return h.InternalServerError(ctx, err) + } + + out := &models.WebauthnRegistrationResponse{ + Reply: rout.Reply{Success: true}, + Message: "passkey successfully created", + AuthData: *auth, + } + + return h.Success(ctx, out) +} + +// BeginWebauthnLogin is the request to begin a webauthn login +func (h *Handler) BeginWebauthnLogin(ctx echo.Context) error { + credential, session, err := h.WebAuthn.BeginDiscoverableLogin() + if err != nil { + return err + } + + setSessionMap := map[string]any{} + setSessionMap[sessions.WebAuthnKey] = session + setSessionMap[sessions.UserTypeKey] = webauthnLogin + + sessionCtx, err := h.SessionConfig.SaveAndStoreSession(ctx.Request().Context(), ctx.Response().Writer, setSessionMap, "") + if err != nil { + return h.InternalServerError(ctx, err) + } + + // return the session value for the UI to use + // the UI will need to set the cookie because authentication is handled + // server side + s, err := sessions.SessionToken(sessionCtx) + if err != nil { + return h.InternalServerError(ctx, err) + } + + out := &models.WebauthnBeginLoginResponse{ + Reply: rout.Reply{Success: true}, + CredentialAssertion: credential, + Session: s, + } + + return h.Success(ctx, out) +} + +// FinishWebauthnLogin is the request to finish a webauthn login +func (h *Handler) FinishWebauthnLogin(ctx echo.Context) error { + session, err := h.SessionConfig.SessionManager.Get(ctx.Request(), h.SessionConfig.CookieConfig.Name) + if err != nil { + return h.BadRequest(ctx, err) + } + + sessionData := h.SessionConfig.SessionManager.GetSessionDataFromCookie(session) + webauthnData := sessionData.(map[string]any)[sessions.WebAuthnKey] + + wd, ok := webauthnData.(webauthn.SessionData) + if !ok { + return h.BadRequest(ctx, ErrNoAuthUser) + } + + response, err := protocol.ParseCredentialRequestResponseBody(ctx.Request().Body) + if err != nil { + return h.BadRequest(ctx, err) + } + + if _, err = h.WebAuthn.ValidateDiscoverableLogin(h.userHandler(ctx.Request().Context()), wd, response); err != nil { + return h.BadRequest(ctx, err) + } + + // get user from the database + entUser, err := h.getUserByID(ctx.Request().Context(), string(response.Response.UserHandle), enums.AuthProvider(webauthnProvider)) + if err != nil { + return h.InternalServerError(ctx, err) + } + + // create claims for verified user + auth, err := h.AuthManager.GenerateUserAuthSession(ctx, entUser) + if err != nil { + h.Logger.Errorw("unable create new auth session", "error", err) + + return h.InternalServerError(ctx, err) + } + + out := &models.WebauthnLoginResponse{ + Reply: rout.Reply{Success: true}, + Message: "passkey successfully created", + AuthData: *auth, + } + + return h.Success(ctx, out) +} + +// userHandler returns a webauthn.DiscoverableUserHandler that can be used to look up a user by their userHandle +func (h *Handler) userHandler(ctx context.Context) webauthn.DiscoverableUserHandler { + return func(rawID, userHandle []byte) (user webauthn.User, err error) { + u, err := h.getUserByID(ctx, string(userHandle), enums.AuthProvider(webauthnProvider)) + if err != nil { + return nil, err + } + + authnUser := &provider.User{ + ID: u.ID, + Email: u.Email, + Name: u.FirstName + " " + u.LastName, + WebauthnCredentials: []webauthn.Credential{}, + } + + for _, cred := range u.Edges.Webauthn { + authnCred := webauthn.Credential{ + ID: cred.CredentialID, + PublicKey: cred.PublicKey, + AttestationType: cred.AttestationType, + } + + for _, t := range cred.Transports { + authnCred.Transport = append(authnCred.Transport, protocol.AuthenticatorTransport(t)) + } + + authnUser.WebauthnCredentials = append(authnUser.WebauthnCredentials, authnCred) + } + + return authnUser, nil + } +} diff --git a/internal/httpserve/route/accountaccess.go b/internal/httpserve/route/accountaccess.go new file mode 100644 index 0000000..ba8f8eb --- /dev/null +++ b/internal/httpserve/route/accountaccess.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerAccountAccessHandler registers the /account/access handler +func registerAccountAccessHandler(router *Router) (err error) { + path := "/account/access" + method := http.MethodPost + name := "AccountAccess" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: authMW, + Handler: func(c echo.Context) error { + return router.Handler.AccountAccessHandler(c) + }, + } + + accountAccessOperation := router.Handler.BindAccountAccess() + + if err := router.Addv1Route(path, method, accountAccessOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/accountroles.go b/internal/httpserve/route/accountroles.go new file mode 100644 index 0000000..3427e0a --- /dev/null +++ b/internal/httpserve/route/accountroles.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerAccountRolesHandler registers the /account/roles handler +func registerAccountRolesHandler(router *Router) (err error) { + path := "/account/roles" + method := http.MethodPost + name := "AccountRoles" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: authMW, + Handler: func(c echo.Context) error { + return router.Handler.AccountRolesHandler(c) + }, + } + + rolesOperation := router.Handler.BindAccountRoles() + + if err := router.Addv1Route(path, method, rolesOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/accountrolesorganization.go b/internal/httpserve/route/accountrolesorganization.go new file mode 100644 index 0000000..ae1faa6 --- /dev/null +++ b/internal/httpserve/route/accountrolesorganization.go @@ -0,0 +1,42 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerAccountRolesOrganizationHandler registers the /account/roles/organization handler +func registerAccountRolesOrganizationHandler(router *Router) (err error) { + // add route without the path param + path := "/account/roles/organization" + method := http.MethodGet + name := "AccountRolesOrganization" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: authMW, + Handler: func(c echo.Context) error { + return router.Handler.AccountRolesOrganizationHandler(c) + }, + } + + rolesOrganizationOperation := router.Handler.BindAccountRolesOrganization() + + if err := router.Addv1Route(route.Path, route.Method, rolesOrganizationOperation, route); err != nil { + return err + } + + // add an additional route with the path param + route.Path = "/account/roles/organization/:id" + + rolesOrganizationOperation = router.Handler.BindAccountRolesOrganizationWithParam() + + if err := router.Addv1Route(route.Path, route.Method, rolesOrganizationOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/assets/favicon.ico b/internal/httpserve/route/assets/favicon.ico new file mode 100644 index 0000000..62071ce Binary files /dev/null and b/internal/httpserve/route/assets/favicon.ico differ diff --git a/internal/httpserve/route/base.go b/internal/httpserve/route/base.go new file mode 100644 index 0000000..d89e419 --- /dev/null +++ b/internal/httpserve/route/base.go @@ -0,0 +1,71 @@ +package route + +import ( + "net/http" + + "github.com/prometheus/client_golang/prometheus/promhttp" + echo "github.com/theopenlane/echox" +) + +// registerLivenessHandler registers the liveness handler +func registerLivenessHandler(router *Router) (err error) { + path := "/livez" + method := http.MethodGet + + route := echo.Route{ + Name: "Livez", + Method: method, + Path: path, + Handler: func(c echo.Context) error { + return c.JSON(http.StatusOK, echo.Map{ + "status": "UP", + }) + }, + } + + if err := router.AddUnversionedRoute(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerReadinessHandler registers the readiness handler +func registerReadinessHandler(router *Router) (err error) { + path := "/ready" + method := http.MethodGet + + route := echo.Route{ + Name: "Ready", + Method: method, + Path: path, + Handler: func(c echo.Context) error { + return router.Handler.ReadyChecks.ReadyHandler(c) + }, + } + + if err := router.AddUnversionedRoute(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerMetricsHandler registers the metrics handler +func registerMetricsHandler(router *Router) (err error) { + path := "/metrics" + method := http.MethodGet + + route := echo.Route{ + Name: "Metrics", + Method: method, + Path: path, + Handler: echo.WrapHandler(promhttp.Handler()), + } + + if err := router.AddUnversionedRoute(path, method, nil, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/doc.go b/internal/httpserve/route/doc.go new file mode 100644 index 0000000..b008eab --- /dev/null +++ b/internal/httpserve/route/doc.go @@ -0,0 +1,2 @@ +// Package route will hold the routes and route groups +package route diff --git a/internal/httpserve/route/events.go b/internal/httpserve/route/events.go new file mode 100644 index 0000000..cc75c4f --- /dev/null +++ b/internal/httpserve/route/events.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerEventPublisher registers the event publisher endpoint +func registerEventPublisher(router *Router) (err error) { + path := "/event/publish" + method := http.MethodPost + name := "EventPublisher" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: authMW, + Handler: func(c echo.Context) error { + return router.Handler.EventPublisher(c) + }, + } + + eventOperation := router.Handler.BindEventPublisher() + + if err := router.Addv1Route(path, method, eventOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/forgotpass.go b/internal/httpserve/route/forgotpass.go new file mode 100644 index 0000000..0335ef9 --- /dev/null +++ b/internal/httpserve/route/forgotpass.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerForgotPasswordHandler registers the forgot password handler and route +func registerForgotPasswordHandler(router *Router) (err error) { + path := "/forgot-password" + method := http.MethodPost + name := "ForgotPassword" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: restrictedEndpointsMW, + Handler: func(c echo.Context) error { + return router.Handler.ForgotPassword(c) + }, + } + + forgotPasswordOperation := router.Handler.BindForgotPassword() + + if err := router.Addv1Route(path, method, forgotPasswordOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/invite.go b/internal/httpserve/route/invite.go new file mode 100644 index 0000000..25e0256 --- /dev/null +++ b/internal/httpserve/route/invite.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerInviteHandler registers the invite handler +func registerInviteHandler(router *Router) (err error) { + path := "/invite" + method := http.MethodGet + name := "OrganizationInviteAccept" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: authMW, + Handler: func(c echo.Context) error { + return router.Handler.OrganizationInviteAccept(c) + }, + } + + inviteOperation := router.Handler.BindOrganizationInviteAccept() + + if err := router.Addv1Route(path, method, inviteOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/login.go b/internal/httpserve/route/login.go new file mode 100644 index 0000000..1838886 --- /dev/null +++ b/internal/httpserve/route/login.go @@ -0,0 +1,33 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// Login is oriented towards human users who use their email and password for +// authentication - see the handlers/login.go for more information +func registerLoginHandler(router *Router) (err error) { + path := "/login" + method := http.MethodPost + name := "Login" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.LoginHandler(c) + }, + } + + loginOperation := router.Handler.BindLoginHandler() + + if err := router.Addv1Route(path, method, loginOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/oauth.go b/internal/httpserve/route/oauth.go new file mode 100644 index 0000000..f93fddf --- /dev/null +++ b/internal/httpserve/route/oauth.go @@ -0,0 +1,170 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/httpsling" +) + +// registerOAuthRegisterHandler registers the oauth register handler used by the UI to register +// users logging in with an oauth provider +func registerOAuthRegisterHandler(router *Router) (err error) { + path := "/oauth/register" + method := http.MethodPost + name := "OAuthRegister" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.OauthRegister(c) + }, + } + + if err := router.AddUnversionedRoute(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerUserInfoHandler registers the userinfo handler +func registerUserInfoHandler(router *Router) (err error) { + path := "/oauth/userinfo" + method := http.MethodGet + name := "UserInfo" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: authMW, + Handler: func(c echo.Context) error { + c.Response().Header().Set(httpsling.HeaderContentType, httpsling.ContentTypeJSONUTF8) + + return router.Handler.UserInfo(c) + }, + } + + if err := router.AddUnversionedRoute(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerGithubLoginHandler registers the github login handler +func registerGithubLoginHandler(router *Router) (err error) { + path := "/github/login" + method := http.MethodGet + name := "GitHubLogin" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: githubLogin(router), + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerGithubCallbackHandler registers the github callback handler +func registerGithubCallbackHandler(router *Router) (err error) { + path := "/github/callback" + method := http.MethodGet + name := "GitHubCallback" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: githubCallback(router), + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerGoogleLoginHandler registers the google login handler +func registerGoogleLoginHandler(router *Router) (err error) { + path := "/google/login" + method := http.MethodGet + name := "GoogleLogin" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: googleLogin(router), + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerGoogleCallbackHandler registers the google callback handler +func registerGoogleCallbackHandler(router *Router) (err error) { + path := "/google/callback" + method := http.MethodGet + name := "GoogleCallback" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: googleCallback(router), + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// githubLogin wraps getloginhandlers +func githubLogin(h *Router) echo.HandlerFunc { + login, _ := h.Handler.GetGitHubLoginHandlers() + + return echo.WrapHandler(login) +} + +// googleLogin wraps getloginhandlers +func googleLogin(h *Router) echo.HandlerFunc { + login, _ := h.Handler.GetGoogleLoginHandlers() + + return echo.WrapHandler(login) +} + +// githubCallback wraps getloginhandlers +func githubCallback(h *Router) echo.HandlerFunc { + _, callback := h.Handler.GetGitHubLoginHandlers() + + return echo.WrapHandler(callback) +} + +// googleCallback wraps getloginhandlers +func googleCallback(h *Router) echo.HandlerFunc { + _, callback := h.Handler.GetGoogleLoginHandlers() + + return echo.WrapHandler(callback) +} diff --git a/internal/httpserve/route/refresh.go b/internal/httpserve/route/refresh.go new file mode 100644 index 0000000..d2bd4c3 --- /dev/null +++ b/internal/httpserve/route/refresh.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerRefreshHandler registers the refresh handler and route +func registerRefreshHandler(router *Router) (err error) { + path := "/refresh" + method := http.MethodPost + name := "Refresh" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.RefreshHandler(c) + }, + } + + refreshOperation := router.Handler.BindRefreshHandler() + + if err := router.Addv1Route(path, method, refreshOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/register.go b/internal/httpserve/route/register.go new file mode 100644 index 0000000..b82e437 --- /dev/null +++ b/internal/httpserve/route/register.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerRegisterHandler registers the register handler and route +func registerRegisterHandler(router *Router) (err error) { + path := "/register" + method := http.MethodPost + name := "Register" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: restrictedEndpointsMW, + Handler: func(c echo.Context) error { + return router.Handler.RegisterHandler(c) + }, + } + + registerOperation := router.Handler.BindRegisterHandler() + + if err := router.Addv1Route(path, method, registerOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/resend.go b/internal/httpserve/route/resend.go new file mode 100644 index 0000000..3984bd8 --- /dev/null +++ b/internal/httpserve/route/resend.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerResendEmailHandler registers the resend email handler and route +func registerResendEmailHandler(router *Router) (err error) { + path := "/resend" + method := http.MethodPost + name := "ResendEmail" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.ResendEmail(c) + }, + } + + resendOperation := router.Handler.BindResendEmailHandler() + + if err := router.Addv1Route(path, method, resendOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/resetpass.go b/internal/httpserve/route/resetpass.go new file mode 100644 index 0000000..ae0d9a2 --- /dev/null +++ b/internal/httpserve/route/resetpass.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerResetPasswordHandler registers the reset password handler and route +func registerResetPasswordHandler(router *Router) (err error) { + path := "/password-reset" + method := http.MethodPost + name := "ResetPassword" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.ResetPassword(c) + }, + } + + resetOperation := router.Handler.BindResetPasswordHandler() + + if err := router.Addv1Route(path, method, resetOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/robots.txt b/internal/httpserve/route/robots.txt new file mode 100644 index 0000000..77470cb --- /dev/null +++ b/internal/httpserve/route/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file diff --git a/internal/httpserve/route/router.go b/internal/httpserve/route/router.go new file mode 100644 index 0000000..6b1bca0 --- /dev/null +++ b/internal/httpserve/route/router.go @@ -0,0 +1,158 @@ +package route + +import ( + "time" + + "github.com/getkin/kin-openapi/openapi3" + echo "github.com/theopenlane/echox" + "github.com/theopenlane/echox/middleware" + + "github.com/theopenlane/core/internal/httpserve/handlers" + "github.com/theopenlane/core/pkg/middleware/ratelimit" + "github.com/theopenlane/core/pkg/middleware/transaction" +) + +var ( + mw = []echo.MiddlewareFunc{middleware.Recover()} + authMW = []echo.MiddlewareFunc{} + + restrictedRateLimit = &ratelimit.Config{RateLimit: 10, BurstLimit: 10, ExpiresIn: 15 * time.Minute} //nolint:mnd + restrictedEndpointsMW = []echo.MiddlewareFunc{} +) + +// Router is a struct that holds the echo router, the OpenAPI schema, and the handler - it's a way to group these components together +type Router struct { + Echo *echo.Echo + OAS *openapi3.T + Handler *handlers.Handler +} + +// AddRoute is used to add a route to the echo router and OpenAPI schema at the same time ensuring consistency between the spec and the server +func (r *Router) AddRoute(pattern, method string, op *openapi3.Operation, route echo.Routable) error { + _, err := r.Echo.AddRoute(route) + if err != nil { + return err + } + + r.OAS.AddOperation(pattern, method, op) + + return nil +} + +// AddRoute is used to add a route to the echo router and OpenAPI schema at the same time ensuring consistency between the spec and the server +func (r *Router) Addv1Route(pattern, method string, op *openapi3.Operation, route echo.Routable) error { + grp := r.VersionOne() + + _, err := grp.AddRoute(route) + if err != nil { + return err + } + + r.OAS.AddOperation(pattern, method, op) + + return nil +} + +// AddRoute is used to add a route to the echo router and OpenAPI schema at the same time ensuring consistency between the spec and the server +func (r *Router) AddUnversionedRoute(pattern, method string, op *openapi3.Operation, route echo.Routable) error { + grp := r.Base() + + _, err := grp.AddRoute(route) + if err != nil { + return err + } + + r.OAS.AddOperation(pattern, method, op) + + return nil +} + +// AddEchoOnlyRoute is used to add a route to the echo router without adding it to the OpenAPI schema +func (r *Router) AddEchoOnlyRoute(pattern, method string, route echo.Routable) error { + grp := r.Base() + + _, err := grp.AddRoute(route) + if err != nil { + return err + } + + return nil +} + +// VersionOne returns a new echo group for version 1 of the API +func (r *Router) VersionOne() *echo.Group { + return r.Echo.Group("v1") +} + +// VersionTwo returns a new echo group for version 2 of the API - lets anticipate the future +func (r *Router) VersionTwo() *echo.Group { + return r.Echo.Group("v2") +} + +// Base returns the base echo group - no "version" prefix for the router group +func (r *Router) Base() *echo.Group { + return r.Echo.Group("") +} + +// RegisterRoutes with the echo routers - Router is defined within openapi.go +func RegisterRoutes(router *Router) error { + // add transaction middleware + transactionConfig := transaction.Client{ + EntDBClient: router.Handler.DBClient, + Logger: router.Handler.Logger, + } + + mw = append(mw, transactionConfig.Middleware) + + // Middleware for restricted endpoints + restrictedEndpointsMW = append(restrictedEndpointsMW, mw...) + restrictedEndpointsMW = append(restrictedEndpointsMW, ratelimit.RateLimiterWithConfig(restrictedRateLimit)) // add restricted ratelimit middleware + + // Middleware for authenticated endpoints + authMW = append(authMW, mw...) + authMW = append(authMW, router.Handler.AuthMiddleware...) + + // routeHandlers that take the router and handler as input + routeHandlers := []interface{}{ + registerReadinessHandler, + registerForgotPasswordHandler, + registerVerifyHandler, + registerResetPasswordHandler, + registerResendEmailHandler, + registerRegisterHandler, + registerVerifySubscribeHandler, + registerRefreshHandler, + registerJwksWellKnownHandler, + registerInviteHandler, + registerGithubLoginHandler, + registerGithubCallbackHandler, + registerGoogleLoginHandler, + registerGoogleCallbackHandler, + registerWebauthnRegistrationHandler, + registerWebauthnVerificationsHandler, + registerWebauthnAuthenticationHandler, + registerWebauthnAuthVerificationHandler, + registerUserInfoHandler, + registerOAuthRegisterHandler, + registerSwitchRoute, + registerEventPublisher, + registerLivenessHandler, + registerMetricsHandler, + registerSecurityTxtHandler, + registerRobotsHandler, + registerFaviconHandler, + registerOpenAPIHandler, + registerLoginHandler, + registerAccountAccessHandler, + registerAccountRolesHandler, + registerAccountRolesOrganizationHandler, + } + + for _, route := range routeHandlers { + if err := route.(func(*Router) error)(router); err != nil { + return err + } + } + + return nil +} diff --git a/internal/httpserve/route/security.txt b/internal/httpserve/route/security.txt new file mode 100644 index 0000000..5e9cf04 --- /dev/null +++ b/internal/httpserve/route/security.txt @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA512 + +Contact: mailto:security@theopenlane.io +Expires: 2026-01-09T12:34:00.000Z +Encryption: https://keys.openpgp.org/vks/v1/by-fingerprint/CDD6CB47F5C8C90340CEB56F5024ED84F6BF803F +Preferred-Languages: en +Canonical: https://api.theopenlane.io/.well-known/security.txt +Policy: https://github.com/theopenlane/core/security/policy +-----BEGIN PGP SIGNATURE----- + +iHUEARYKAB0WIQTN1stH9cjJA0DOtW9QJO2E9r+APwUCZZ6RLgAKCRBQJO2E9r+A +PyjIAQC13xI75wq7o4MhparBplTo6ZCF+bJTyCrO5c5izag9IQD+KbAXRKq3pjXu +kwa/7CNQAyf7R//ZzA2npg2Ly5Jv4Qs= +=Uh5X +-----END PGP SIGNATURE----- \ No newline at end of file diff --git a/internal/httpserve/route/static.go b/internal/httpserve/route/static.go new file mode 100644 index 0000000..2299a89 --- /dev/null +++ b/internal/httpserve/route/static.go @@ -0,0 +1,126 @@ +package route + +import ( + "embed" + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerJwksWellKnownHandler supplies the JWKS endpoint +func registerJwksWellKnownHandler(router *Router) (err error) { + path := "/.well-known/jwks.json" + method := http.MethodGet + name := "JWKS" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return c.JSON(http.StatusOK, router.Handler.JWTKeys) + }, + } + + if err := router.AddUnversionedRoute(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerOpenAPISpecHandler embeds our generated open api specs and serves it behind /api-docs +func registerOpenAPIHandler(router *Router) (err error) { + path := "/api-docs" + method := http.MethodGet + name := "APIDocs" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: echo.HandlerFunc(func(c echo.Context) error { + return c.JSON(http.StatusOK, router.OAS) + }), + } + + if err := router.AddEchoOnlyRoute(path, method, route); err != nil { + return err + } + + return nil +} + +//go:embed security.txt +var securityTxt embed.FS + +// registerSecurityTxtHandler serves up the text output of the security.txt +func registerSecurityTxtHandler(router *Router) (err error) { + path := "/.well-known/security.txt" + method := http.MethodGet + name := "SecurityTxt" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: echo.StaticFileHandler("security.txt", securityTxt), + } + + if err := router.AddEchoOnlyRoute(path, method, route); err != nil { + return err + } + + return nil +} + +//go:embed robots.txt +var robotsTxt embed.FS + +// registerRobotsHandler serves up the robots.txt file via the RobotsHandler +func registerRobotsHandler(router *Router) (err error) { + path := "/robots.txt" + method := http.MethodGet + name := "Robots" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: echo.StaticFileHandler("robots.txt", robotsTxt), + } + + if err := router.AddEchoOnlyRoute(path, method, route); err != nil { + return err + } + + return nil +} + +//go:embed assets/* +var assets embed.FS + +// registerFaviconHandler serves up the favicon.ico +func registerFaviconHandler(router *Router) (err error) { + path := "/favicon.ico" + method := http.MethodGet + name := "Favicon" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: echo.StaticFileHandler("assets/favicon.ico", assets), + } + + if err := router.AddEchoOnlyRoute(path, method, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/subscribe.go b/internal/httpserve/route/subscribe.go new file mode 100644 index 0000000..da6d6dc --- /dev/null +++ b/internal/httpserve/route/subscribe.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerVerifySubscribeHandler registers the verify subscription handler and route +func registerVerifySubscribeHandler(router *Router) (err error) { + path := "/subscribe/verify" + method := http.MethodGet + name := "VerifySubscription" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: restrictedEndpointsMW, + Handler: func(c echo.Context) error { + return router.Handler.VerifySubscriptionHandler(c) + }, + } + + subscribeOperation := router.Handler.BindVerifySubscriberHandler() + + if err := router.Addv1Route(path, method, subscribeOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/switch.go b/internal/httpserve/route/switch.go new file mode 100644 index 0000000..869293c --- /dev/null +++ b/internal/httpserve/route/switch.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerSwitchRoute registers the switch route to switch the user's logged in organization context +func registerSwitchRoute(router *Router) (err error) { + path := "/switch" + method := http.MethodPost + name := "Switch" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: authMW, + Handler: func(c echo.Context) error { + return router.Handler.SwitchHandler(c) + }, + } + + switchOperation := router.Handler.BindSwitchHandler() + + if err := router.Addv1Route(path, method, switchOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/verify.go b/internal/httpserve/route/verify.go new file mode 100644 index 0000000..856538b --- /dev/null +++ b/internal/httpserve/route/verify.go @@ -0,0 +1,32 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerVerifyHandler registers the verify handler and route which handles email verification +func registerVerifyHandler(router *Router) (err error) { + path := "/verify" + method := http.MethodGet + name := "VerifyEmail" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: restrictedEndpointsMW, + Handler: func(c echo.Context) error { + return router.Handler.VerifyEmail(c) + }, + } + + verifyOperation := router.Handler.BindVerifyEmailHandler() + + if err := router.Addv1Route(path, method, verifyOperation, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/route/webauthn.go b/internal/httpserve/route/webauthn.go new file mode 100644 index 0000000..b0905d0 --- /dev/null +++ b/internal/httpserve/route/webauthn.go @@ -0,0 +1,99 @@ +package route + +import ( + "net/http" + + echo "github.com/theopenlane/echox" +) + +// registerWebauthnRegistrationHandler registers the webauthn registration handler +func registerWebauthnRegistrationHandler(router *Router) (err error) { + path := "/registration/options" + method := http.MethodPost + name := "WebauthnRegistration" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.BeginWebauthnRegistration(c) + }, + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerWebauthnVerificationsHandler registers the webauthn registration verification handler +func registerWebauthnVerificationsHandler(router *Router) (err error) { + path := "/registration/verification" + method := http.MethodPost + name := "WebauthnRegistrationVerification" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.FinishWebauthnRegistration(c) + }, + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerWebauthnAuthenticationHandler registers the webauthn authentication handler +func registerWebauthnAuthenticationHandler(router *Router) (err error) { + path := "/authentication/options" + method := http.MethodPost + name := "WebauthnAuthentication" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.BeginWebauthnLogin(c) + }, + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} + +// registerWebauthnAuthVerificationHandler registers the webauthn authentication verification handler +func registerWebauthnAuthVerificationHandler(router *Router) (err error) { + path := "/authentication/verification" + method := http.MethodPost + name := "WebauthnAuthenticationVerification" + + route := echo.Route{ + Name: name, + Method: method, + Path: path, + Middlewares: mw, + Handler: func(c echo.Context) error { + return router.Handler.FinishWebauthnLogin(c) + }, + } + + if err := router.Addv1Route(path, method, nil, route); err != nil { + return err + } + + return nil +} diff --git a/internal/httpserve/server/doc.go b/internal/httpserve/server/doc.go new file mode 100644 index 0000000..63321b5 --- /dev/null +++ b/internal/httpserve/server/doc.go @@ -0,0 +1,2 @@ +// Package server contains the server functions +package server diff --git a/internal/httpserve/server/openapi.go b/internal/httpserve/server/openapi.go new file mode 100644 index 0000000..244f354 --- /dev/null +++ b/internal/httpserve/server/openapi.go @@ -0,0 +1,240 @@ +package server + +import ( + "github.com/getkin/kin-openapi/openapi3" + "github.com/getkin/kin-openapi/openapi3gen" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/pkg/models" +) + +// NewOpenAPISpec creates a new OpenAPI 3.1.0 specification based on the configured go interfaces and the operation types appended within the individual handlers +func NewOpenAPISpec() (*openapi3.T, error) { + schemas := make(openapi3.Schemas) + responses := make(openapi3.ResponseBodies) + parameters := make(openapi3.ParametersMap) + requestbodies := make(openapi3.RequestBodies) + securityschemes := make(openapi3.SecuritySchemes) + examples := make(openapi3.Examples) + + generator := openapi3gen.NewGenerator(openapi3gen.UseAllExportedFields()) + for key, val := range openAPISchemas { + ref, err := generator.NewSchemaRefForValue(val, schemas) + if err != nil { + return nil, err + } + + schemas[key] = ref + } + + errorResponse := &openapi3.SchemaRef{ + Ref: "#/components/schemas/ErrorResponse", + } + + _, err := openapi3gen.NewSchemaRefForValue(&rout.StatusError{}, schemas) + if err != nil { + return nil, err + } + + internalServerError := openapi3.NewResponse(). + WithDescription("Internal Server Error"). + WithContent(openapi3.NewContentWithJSONSchemaRef(errorResponse)) + responses["InternalServerError"] = &openapi3.ResponseRef{Value: internalServerError} + + badRequest := openapi3.NewResponse(). + WithDescription("Bad Request"). + WithContent(openapi3.NewContentWithJSONSchemaRef(errorResponse)) + responses["BadRequest"] = &openapi3.ResponseRef{Value: badRequest} + + unauthorized := openapi3.NewResponse(). + WithDescription("Unauthorized"). + WithContent(openapi3.NewContentWithJSONSchemaRef(errorResponse)) + responses["Unauthorized"] = &openapi3.ResponseRef{Value: unauthorized} + + conflict := openapi3.NewResponse(). + WithDescription("Conflict"). + WithContent(openapi3.NewContentWithJSONSchemaRef(errorResponse)) + responses["Conflict"] = &openapi3.ResponseRef{Value: conflict} + + securityschemes["bearer"] = &openapi3.SecuritySchemeRef{ + Value: openapi3.NewSecurityScheme(). + WithType("http"). + WithScheme("bearer"). + WithIn("header"). + WithDescription("Bearer authentication, the token must be a valid API token"), + } + + securityschemes["oauth2"] = &openapi3.SecuritySchemeRef{ + Value: (*OAuth2)(&OAuth2{ + AuthorizationURL: "https://api.theopenlane.io/oauth2/authorize", + TokenURL: "https://api.theopenlane.io/oauth2/token", + RefreshURL: "https://api.theopenlane.io/oauth2/refresh", + Scopes: map[string]string{ + "read": "Read access", + "write": "Write access", + }, + }).Scheme(), + } + + securityschemes["openid"] = &openapi3.SecuritySchemeRef{ + Value: (*OpenID)(&OpenID{ + ConnectURL: "https://api.theopenlane.io/.well-known/openid-configuration", + }).Scheme(), + } + + securityschemes["apikey"] = &openapi3.SecuritySchemeRef{ + Value: (*APIKey)(&APIKey{ + Name: "X-API-Key", + }).Scheme(), + } + + securityschemes["basic"] = &openapi3.SecuritySchemeRef{ + Value: (*Basic)(&Basic{ + Username: "username", + Password: "password", + }).Scheme(), + } + + return &openapi3.T{ + OpenAPI: "3.1.0", + Info: &openapi3.Info{ + Title: "OpenLane OpenAPI 3.1.0 Specifications", + Version: "v1.0.0", + Contact: &openapi3.Contact{ + Name: "OpenLane", + Email: "support@theopenlane.io", + URL: "https://theopenlane.io", + }, + License: &openapi3.License{ + Name: "Apache 2.0", + URL: "https://www.apache.org/licenses/LICENSE-2.0", + }, + }, + Paths: openapi3.NewPaths(), + Servers: openapi3.Servers{ + &openapi3.Server{ + Description: "OpenLane API Server", + URL: "https://api.theopenlane.io/v1", + }, + &openapi3.Server{ + Description: "OpenLane API Server (local)", + URL: "http://localhost:17608/v1", + }, + }, + ExternalDocs: &openapi3.ExternalDocs{ + Description: "Documentation for OpenLane's API services", + URL: "https://docs.theopenlane.io", + }, + + Components: &openapi3.Components{ + Schemas: schemas, + Responses: responses, + Parameters: parameters, + RequestBodies: requestbodies, + SecuritySchemes: securityschemes, + Examples: examples, + }, + Tags: openapi3.Tags{ + &openapi3.Tag{ + Name: "schema", + Description: "Add or update schema definitions", + }, + &openapi3.Tag{ + Name: "graphql", + Description: "GraphQL query endpoints", + }, + }, + }, nil +} + +// openAPISchemas is a mapping of types to auto generate schemas for - these specifically live under the OAS "schema" type so that we can simply make schemaRef's to them and not have to define them all individually in the OAS paths +var openAPISchemas = map[string]any{ + "LoginRequest": &models.LoginRequest{}, + "LoginResponse": &models.LoginReply{}, + "ForgotPasswordRequest": &models.ForgotPasswordRequest{}, + "ForgotPasswordResponse": &models.ForgotPasswordReply{}, + "ResetPasswordRequest": &models.ResetPasswordRequest{}, + "ResetPasswordResponse": &models.ResetPasswordReply{}, + "RefreshRequest": &models.RefreshRequest{}, + "RefreshResponse": &models.RefreshReply{}, + "RegisterRequest": &models.RegisterRequest{}, + "RegisterResponse": &models.RegisterReply{}, + "ResendEmailRequest": &models.ResendRequest{}, + "ResendEmailResponse": &models.ResendReply{}, + "VerifyRequest": &models.VerifyRequest{}, + "VerifyResponse": &models.VerifyReply{}, + "PublishRequest": &models.PublishRequest{}, + "PublishResponse": &models.PublishReply{}, + "SwitchRequest": &models.SwitchOrganizationRequest{}, + "SwitchResponse": &models.SwitchOrganizationReply{}, + "VerifySubscriptionRequest": &models.VerifySubscribeRequest{}, + "VerifySubscriptionResponse": &models.VerifySubscribeReply{}, + "InviteRequest": &models.InviteRequest{}, + "InviteResponse": &models.InviteReply{}, + "ErrorResponse": &rout.StatusError{}, +} + +// OAuth2 is a struct that represents an OAuth2 security scheme +type OAuth2 struct { + AuthorizationURL string + TokenURL string + RefreshURL string + Scopes map[string]string +} + +// Scheme returns the OAuth2 security scheme +func (i *OAuth2) Scheme() *openapi3.SecurityScheme { + return &openapi3.SecurityScheme{ + Type: "oauth2", + Flows: &openapi3.OAuthFlows{ + AuthorizationCode: &openapi3.OAuthFlow{ + AuthorizationURL: i.AuthorizationURL, + TokenURL: i.TokenURL, + RefreshURL: i.RefreshURL, + Scopes: i.Scopes, + }, + }, + } +} + +// OpenID is a struct that represents an OpenID Connect security scheme +type OpenID struct { + ConnectURL string +} + +// Scheme returns the OpenID Connect security scheme +func (i *OpenID) Scheme() *openapi3.SecurityScheme { + return &openapi3.SecurityScheme{ + Type: "openIdConnect", + OpenIdConnectUrl: i.ConnectURL, + } +} + +// APIKey is a struct that represents an API Key security scheme +type APIKey struct { + Name string +} + +// Scheme returns the API Key security scheme +func (k *APIKey) Scheme() *openapi3.SecurityScheme { + return &openapi3.SecurityScheme{ + Type: "http", + In: "header", + Name: k.Name, + } +} + +// Basic is a struct that represents a Basic Auth security scheme +type Basic struct { + Username string + Password string +} + +// Scheme returns the Basic Auth security scheme +func (b *Basic) Scheme() *openapi3.SecurityScheme { + return &openapi3.SecurityScheme{ + Type: "http", + Scheme: "basic", + } +} diff --git a/internal/httpserve/server/server.go b/internal/httpserve/server/server.go new file mode 100644 index 0000000..c2bcecc --- /dev/null +++ b/internal/httpserve/server/server.go @@ -0,0 +1,128 @@ +package server + +import ( + "context" + + echo "github.com/theopenlane/echox" + "go.uber.org/zap" + + "github.com/theopenlane/core/internal/httpserve/config" + "github.com/theopenlane/core/internal/httpserve/route" + echodebug "github.com/theopenlane/core/pkg/middleware/debug" +) + +type Server struct { + // config contains the base server settings + config config.Config + // logger contains the zap logger + logger *zap.SugaredLogger + // handlers contains additional handlers to register with the echo server + handlers []handler +} + +type handler interface { + Routes(*echo.Group) +} + +// NewRouter creates a wrapper router so that the echo server and OAS specification can be generated simultaneously +func NewRouter() (*route.Router, error) { + oas, err := NewOpenAPISpec() + if err != nil { + return nil, err + } + + return &route.Router{ + Echo: echo.New(), + OAS: oas, + }, nil +} + +// AddHandler provides the ability to add additional HTTP handlers that process +// requests. The handler that is provided should have a Routes(*echo.Group) +// function, which allows the routes to be added to the server. +func (s *Server) AddHandler(r handler) { + s.handlers = append(s.handlers, r) +} + +// NewServer returns a new Server configuration +func NewServer(c config.Config, l *zap.SugaredLogger) *Server { + return &Server{ + config: c, + logger: l, + } +} + +// StartEchoServer creates and starts the echo server with configured middleware and handlers +func (s *Server) StartEchoServer(ctx context.Context) error { + srv, err := NewRouter() + if err != nil { + return err + } + + sc := echo.StartConfig{ + HideBanner: true, + HidePort: true, + Address: s.config.Settings.Server.Listen, + GracefulTimeout: s.config.Settings.Server.ShutdownGracePeriod, + GracefulContext: ctx, + } + + srv.Echo.Debug = s.config.Settings.Server.Debug + + if srv.Echo.Debug { + srv.Echo.Use(echodebug.BodyDump(s.logger)) + } + + for _, m := range s.config.DefaultMiddleware { + srv.Echo.Use(m) + } + + srv.Handler = &s.config.Handler + + // Add base routes to the server + if err := route.RegisterRoutes(srv); err != nil { + return err + } + + // Registers additional routes for the graph endpoints with middleware defined + for _, handler := range s.handlers { + handler.Routes(srv.Echo.Group("", s.config.GraphMiddleware...)) + } + + // Print routes on startup + routes := srv.Echo.Router().Routes() + for _, r := range routes { + s.logger.Infow("registered route", "route", r.Path(), "method", r.Method()) + } + + // if TLS is enabled, start new echo server with TLS + if s.config.Settings.Server.TLS.Enabled { + s.logger.Infow("starting in https mode") + + return sc.StartTLS(srv.Echo, s.config.Settings.Server.TLS.CertFile, s.config.Settings.Server.TLS.CertKey) + } + + s.logger.Infow(startBlock) + + // otherwise, start without TLS + return sc.Start(srv.Echo) +} + +var startBlock = ` +┌────────────────────────────────────────────────────────────────────────────────────┐ +│ │ +│ │ +│ │ +| ******* ** │ +| **/////** ****** /** │ +| ** //**/**///** ***** ******* /** ****** ******* ***** │ +| /** /**/** /** **///**//**///** /** //////** //**///** **///** │ +| /** /**/****** /******* /** /** /** ******* /** /**/******* │ +| //** ** /**/// /**//// /** /** /** **////** /** /**/**//// │ +| //******* /** //****** *** /** /********//******** *** /**//****** │ +| /////// // ////// /// // //////// //////// /// // ////// │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────┘` diff --git a/internal/httpserve/serveropts/doc.go b/internal/httpserve/serveropts/doc.go new file mode 100644 index 0000000..116a06a --- /dev/null +++ b/internal/httpserve/serveropts/doc.go @@ -0,0 +1,2 @@ +// Package serveropts contains an echo server options wrapper +package serveropts diff --git a/internal/httpserve/serveropts/option.go b/internal/httpserve/serveropts/option.go new file mode 100644 index 0000000..b09d622 --- /dev/null +++ b/internal/httpserve/serveropts/option.go @@ -0,0 +1,464 @@ +package serveropts + +import ( + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/pem" + "fmt" + "os" + + "github.com/redis/go-redis/v9" + echoprometheus "github.com/theopenlane/echo-prometheus" + echo "github.com/theopenlane/echox" + "github.com/theopenlane/echox/middleware" + "github.com/theopenlane/echozap" + "github.com/theopenlane/entx" + "github.com/theopenlane/iam/fgax" + "go.uber.org/zap" + + "github.com/theopenlane/utils/emails" + "github.com/theopenlane/utils/marionette" + "github.com/theopenlane/utils/totp" + "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/graphapi" + "github.com/theopenlane/core/internal/httpserve/config" + "github.com/theopenlane/core/internal/httpserve/server" + "github.com/theopenlane/core/pkg/analytics" + "github.com/theopenlane/core/pkg/cache" + "github.com/theopenlane/core/pkg/events/kafka/publisher" + authmw "github.com/theopenlane/core/pkg/middleware/auth" + "github.com/theopenlane/core/pkg/middleware/cachecontrol" + "github.com/theopenlane/core/pkg/middleware/cors" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/middleware/mime" + "github.com/theopenlane/core/pkg/middleware/ratelimit" + "github.com/theopenlane/core/pkg/middleware/redirect" + "github.com/theopenlane/core/pkg/middleware/secure" + "github.com/theopenlane/core/pkg/providers/webauthn" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" + "github.com/theopenlane/httpsling" +) + +type ServerOption interface { + apply(*ServerOptions) +} + +type applyFunc struct { + applyInternal func(*ServerOptions) +} + +func (fso *applyFunc) apply(s *ServerOptions) { + fso.applyInternal(s) +} + +func newApplyFunc(apply func(option *ServerOptions)) *applyFunc { + return &applyFunc{ + applyInternal: apply, + } +} + +// WithConfigProvider supplies the config for the server +func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption { + return newApplyFunc(func(s *ServerOptions) { + s.ConfigProvider = cfgProvider + }) +} + +// WithLogger supplies the logger for the server +func WithLogger(l *zap.SugaredLogger) ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // Add logger to main config + s.Config.Logger = l + // Add logger to the handlers config + s.Config.Handler.Logger = l + }) +} + +// WithHTTPS sets up TLS config settings for the server +func WithHTTPS() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + if !s.Config.Settings.Server.TLS.Enabled { + // this is set to enabled by WithServer + // if TLS is not enabled, move on + return + } + + s.Config.WithTLSDefaults() + + if !s.Config.Settings.Server.TLS.AutoCert { + s.Config.WithTLSCerts(s.Config.Settings.Server.TLS.CertFile, s.Config.Settings.Server.TLS.CertKey) + } + }) +} + +// WithGeneratedKeys will generate a public/private key pair +// that can be used for jwt signing. +// This should only be used in a development environment +func WithGeneratedKeys() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + privFileName := "private_key.pem" + + // generate a new private key if one doesn't exist + if _, err := os.Stat(privFileName); err != nil { + // Generate a new RSA private key with 2048 bits + privateKey, err := rsa.GenerateKey(rand.Reader, 2048) //nolint:mnd + if err != nil { + s.Config.Logger.Panicf("Error generating RSA private key:", err) + } + + // Encode the private key to the PEM format + privateKeyPEM := &pem.Block{ + Type: "RSA PRIVATE KEY", + Bytes: x509.MarshalPKCS1PrivateKey(privateKey), + } + + privateKeyFile, err := os.Create(privFileName) + if err != nil { + s.Config.Logger.Panicf("Error creating private key file:", err) + } + + if err := pem.Encode(privateKeyFile, privateKeyPEM); err != nil { + s.Config.Logger.Panicw("unable to encode pem on startup", "error", err.Error()) + } + + privateKeyFile.Close() + } + + keys := map[string]string{} + + // check if kid was passed in + kidPriv := s.Config.Settings.Auth.Token.KID + + // if we didn't get a kid in the settings, assign one + if kidPriv == "" { + kidPriv = ulids.New().String() + } + + keys[kidPriv] = fmt.Sprintf("%v", privFileName) + + s.Config.Settings.Auth.Token.Keys = keys + }) +} + +// WithTokenManager sets up the token manager for the server +func WithTokenManager() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // Setup token manager + tm, err := tokens.New(s.Config.Settings.Auth.Token) + if err != nil { + panic(err) + } + + keys, err := tm.Keys() + if err != nil { + panic(err) + } + + // pass to the REST handlers + s.Config.Handler.JWTKeys = keys + s.Config.Handler.TokenManager = tm + s.Config.Handler.AuthManager.SetTokenManager(tm) + }) +} + +// WithAuth supplies the authn and jwt config for the server +func WithAuth() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // add oauth providers + s.Config.Handler.OauthProvider = s.Config.Settings.Auth.Providers + + // add auth middleware + conf := authmw.NewAuthOptions( + authmw.WithAudience(s.Config.Settings.Auth.Token.Audience), + authmw.WithIssuer(s.Config.Settings.Auth.Token.Issuer), + authmw.WithJWKSEndpoint(s.Config.Settings.Auth.Token.JWKSEndpoint), + authmw.WithDBClient(s.Config.Handler.DBClient), + authmw.WithCookieConfig(s.Config.SessionConfig.CookieConfig), + ) + + s.Config.Handler.WebAuthn = webauthn.NewWithConfig(s.Config.Settings.Auth.Providers.Webauthn) + + s.Config.GraphMiddleware = append(s.Config.GraphMiddleware, authmw.Authenticate(&conf)) + s.Config.Handler.AuthMiddleware = append(s.Config.Handler.AuthMiddleware, authmw.Authenticate(&conf)) + }) +} + +// WithReadyChecks adds readiness checks to the server +func WithReadyChecks(c *entx.EntClientConfig, f *fgax.Client, r *redis.Client) ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // Always add a check to the primary db connection + s.Config.Handler.AddReadinessCheck("db_primary", entx.Healthcheck(c.GetPrimaryDB())) + + // Check the secondary db, if enabled + if s.Config.Settings.DB.MultiWrite { + s.Config.Handler.AddReadinessCheck("db_secondary", entx.Healthcheck(c.GetSecondaryDB())) + } + + // Check the connection to openFGA, if enabled + if s.Config.Settings.Authz.Enabled { + s.Config.Handler.AddReadinessCheck("fga", fgax.Healthcheck(*f)) + } + + // Check the connection to redis, if enabled + if s.Config.Settings.Redis.Enabled { + s.Config.Handler.AddReadinessCheck("redis", cache.Healthcheck(r)) + } + }) +} + +// WithGraphRoute adds the graph handler to the server +func WithGraphRoute(srv *server.Server, c *generated.Client) ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // Setup Graph API Handlers + r := graphapi.NewResolver(c). + WithLogger(s.Config.Logger.Named("resolvers")). + WithExtensions(s.Config.Settings.Server.EnableGraphExtensions) + + // add pool to the resolver to manage the number of goroutines + r.WithPool( + s.Config.Settings.Server.GraphPool.MaxWorkers, + s.Config.Settings.Server.GraphPool.MaxCapacity, + ) + + handler := r.Handler(s.Config.Settings.Server.Dev) + + // Add Graph Handler + srv.AddHandler(handler) + }) +} + +// WithMiddleware adds the middleware to the server +func WithMiddleware() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // Initialize middleware if null + if s.Config.DefaultMiddleware == nil { + s.Config.DefaultMiddleware = []echo.MiddlewareFunc{} + } + + // default middleware + s.Config.DefaultMiddleware = append(s.Config.DefaultMiddleware, + middleware.RequestID(), // add request id + middleware.Recover(), // recover server from any panic/fatal error gracefully + middleware.LoggerWithConfig(middleware.LoggerConfig{ + Format: "remote_ip=${remote_ip}, method=${method}, uri=${uri}, status=${status}, session=${header:Set-Cookie}, host=${host}, referer=${referer}, user_agent=${user_agent}, route=${route}, path=${path}, auth=${header:Authorization}\n", + }), + echoprometheus.MetricsMiddleware(), // add prometheus metrics + echozap.ZapLogger(s.Config.Logger.Desugar()), // add zap logger, middleware requires the "regular" zap logger + echocontext.EchoContextToContextMiddleware(), // adds echo context to parent + mime.NewWithConfig(mime.Config{DefaultContentType: httpsling.ContentTypeJSONUTF8}), // add mime middleware + ) + }) +} + +// WithEventPublisher sets up the default Kafka event publisher +func WithEventPublisher() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + ep := publisher.KafkaPublisher{ + Config: s.Config.Settings.Events, + } + + publisher := publisher.NewKafkaPublisher(ep.Config.Addresses) + + s.Config.Handler.EventManager = publisher + }) +} + +// WithEmailManager sets up the default SendGrid email manager to be used to send emails to users +// on registration, password reset, etc +func WithEmailManager() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + em, err := emails.New(s.Config.Settings.Email) + if err != nil { + panic(err) + } + + if err := s.Config.Settings.Email.ConsoleURLConfig.Validate(); err != nil { + panic(err) + } + + em.ConsoleURLConfig = s.Config.Settings.Email.ConsoleURLConfig + + if err := s.Config.Settings.Email.MarketingURLConfig.Validate(); err != nil { + panic(err) + } + + em.MarketingURLConfig = s.Config.Settings.Email.MarketingURLConfig + + s.Config.Handler.EmailManager = em + }) +} + +// WithTaskManager sets up the default Marionette task manager to be used for delegating background tasks +func WithTaskManager() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // Start task manager + tmConfig := marionette.Config{ + // Logger: s.Config.Logger, + } + + tm := marionette.New(tmConfig) + + tm.Start() + + s.Config.Handler.TaskMan = tm + }) +} + +// WithSessionManager sets up the default session manager with a 10 minute ttl +// with persistence to redis +func WithSessionManager(rc *redis.Client) ServerOption { + return newApplyFunc(func(s *ServerOptions) { + cc := sessions.DefaultCookieConfig + + // In order for things to work in dev mode with localhost + // we need to se the debug cookie config + if s.Config.Settings.Server.Dev { + cc = &sessions.DebugOnlyCookieConfig + } else { + cc.Name = sessions.DefaultCookieName + } + + if s.Config.Settings.Sessions.Domain != "" { + cc.Domain = s.Config.Settings.Sessions.Domain + } + + sm := sessions.NewCookieStore[map[string]any](cc, + []byte(s.Config.Settings.Sessions.SigningKey), + []byte(s.Config.Settings.Sessions.EncryptionKey), + ) + + // add session middleware, this has to be added after the authMiddleware so we have the user id + // when we get to the session. this is also added here so its only added to the graph routes + // REST routes are expected to add the session middleware, as required + sessionConfig := sessions.NewSessionConfig( + sm, + sessions.WithPersistence(rc), + sessions.WithLogger(s.Config.Logger), + sessions.WithSkipperFunc(authmw.SessionSkipperFunc), + ) + + // set cookie config to be used + sessionConfig.CookieConfig = cc + + // Make the cookie session store available + // to graph and REST endpoints + s.Config.Handler.SessionConfig = &sessionConfig + s.Config.SessionConfig = &sessionConfig + s.Config.Handler.AuthManager.SetSessionConfig(&sessionConfig) + }) +} + +// WithSessionMiddleware sets up the session middleware for the server +func WithSessionMiddleware() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + // add session middleware, this has to be added after the authMiddleware + s.Config.GraphMiddleware = append(s.Config.GraphMiddleware, + sessions.LoadAndSaveWithConfig(*s.Config.SessionConfig), + ) + }) +} + +// WithAnalytics sets up the PostHog analytics manager +func WithAnalytics() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + ph := s.Config.Settings.PostHog.Init() + if ph == nil { + s.Config.Handler.AnalyticsClient = &analytics.EventManager{ + Enabled: false, + Handler: nil, + } + + return + } + + s.Config.Handler.AnalyticsClient = &analytics.EventManager{ + Enabled: true, + Handler: ph, + } + }) +} + +// WithOTP sets up the OTP provider +func WithOTP() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + if s.Config.Settings.TOTP.Enabled { + if s.Config.Settings.TOTP.Secret == "" { + s.Config.Settings.TOTP.Secret = ulids.New().String() + } + + opts := []totp.ConfigOption{ + totp.WithCodeLength(s.Config.Settings.TOTP.CodeLength), + totp.WithIssuer(s.Config.Settings.TOTP.Issuer), + totp.WithSecret(totp.Secret{ + Version: 0, + Key: s.Config.Settings.TOTP.Secret, + }), + } + + // append redis client if enabed + if s.Config.Settings.TOTP.WithRedis { + opts = append(opts, totp.WithRedis(s.Config.Handler.RedisClient)) + } + + // setup new opt manager + otpMan := totp.NewOTP( + opts..., + ) + + s.Config.Handler.OTPManager = &totp.Manager{ + TOTPManager: otpMan, + } + } + }) +} + +// WithRateLimiter sets up the rate limiter for the server +func WithRateLimiter() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + if s.Config.Settings.Ratelimit.Enabled { + s.Config.DefaultMiddleware = append(s.Config.DefaultMiddleware, ratelimit.RateLimiterWithConfig(&s.Config.Settings.Ratelimit)) + } + }) +} + +// WithSecureMW sets up the secure middleware for the server +func WithSecureMW() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + if s.Config.Settings.Server.Secure.Enabled { + s.Config.DefaultMiddleware = append(s.Config.DefaultMiddleware, secure.Secure(&s.Config.Settings.Server.Secure)) + } + }) +} + +// WithRedirects sets up the redirects for the server +func WithRedirects() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + if s.Config.Settings.Server.Redirects.Enabled { + redirects := s.Config.Settings.Server.Redirects + s.Config.DefaultMiddleware = append(s.Config.DefaultMiddleware, redirect.NewWithConfig(redirects)) + } + }) +} + +// WithCacheHeaders sets up the cache control headers for the server +func WithCacheHeaders() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + if s.Config.Settings.Server.CacheControl.Enabled { + cacheConfig := s.Config.Settings.Server.CacheControl + s.Config.DefaultMiddleware = append(s.Config.DefaultMiddleware, cachecontrol.NewWithConfig(cacheConfig)) + } + }) +} + +// WithCORS sets up the CORS middleware for the server +func WithCORS() ServerOption { + return newApplyFunc(func(s *ServerOptions) { + if s.Config.Settings.Server.CORS.Enabled { + s.Config.DefaultMiddleware = append(s.Config.DefaultMiddleware, cors.New(s.Config.Settings.Server.CORS.AllowOrigins)) + } + }) +} diff --git a/internal/httpserve/serveropts/server.go b/internal/httpserve/serveropts/server.go new file mode 100644 index 0000000..90e19fd --- /dev/null +++ b/internal/httpserve/serveropts/server.go @@ -0,0 +1,37 @@ +package serveropts + +import ( + "github.com/theopenlane/core/config" + serverconfig "github.com/theopenlane/core/internal/httpserve/config" +) + +type ServerOptions struct { + ConfigProvider serverconfig.ConfigProvider + Config serverconfig.Config +} + +func NewServerOptions(opts []ServerOption, cfgLoc string) *ServerOptions { + // load koanf config + c, err := config.Load(&cfgLoc) + if err != nil { + panic(err) + } + + so := &ServerOptions{ + Config: serverconfig.Config{ + Settings: *c, + }, + } + + for _, opt := range opts { + opt.apply(so) + } + + return so +} + +// AddServerOptions applies a server option after the initial setup +// this should be used when information is not available on NewServerOptions +func (so *ServerOptions) AddServerOptions(opt ServerOption) { + opt.apply(so) +} diff --git a/jsonschema/Taskfile.yaml b/jsonschema/Taskfile.yaml new file mode 100644 index 0000000..f48082e --- /dev/null +++ b/jsonschema/Taskfile.yaml @@ -0,0 +1,36 @@ +version: '3' + +tasks: + install: + desc: install dependencies + cmds: + - npm install jsonschema2mk --global + + generate: + desc: generate the jsonschema and documentation + cmds: + - task: schema + - task: docs + + schema: + desc: generate a new jsonschema and corresponding config/config.example.yaml + cmds: + - go run jsonschema/schema_generator.go + + docs: + desc: generate documentation from the jsonschema + cmds: + - npx jsonschema2mk --schema jsonschema/core.config.json > jsonschema/api-docs.md + + ci: + desc: a task that runs during CI to confirm there are no changes after running generate + cmds: + - task: generate + - "git config --global --add safe.directory /workdir" + - | + status=$(git status --porcelain) + if [ -n "$status" ]; then + echo "detected git diff after running generate; please re-run tasks" + echo "$status" + exit 1 + fi diff --git a/jsonschema/api-docs.md b/jsonschema/api-docs.md new file mode 100644 index 0000000..0795fdf --- /dev/null +++ b/jsonschema/api-docs.md @@ -0,0 +1,647 @@ +# object + +Config contains the configuration for the core server + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**refreshInterval**|`integer`|RefreshInterval determines how often to reload the config
|| +|[**server**](#server)|`object`|Server settings for the echo server
|yes| +|[**entConfig**](#entconfig)|`object`|Config holds the configuration for the ent server
|| +|[**auth**](#auth)|`object`|Auth settings including oauth2 providers and token configuration
|yes| +|[**authz**](#authz)|`object`||yes| +|[**db**](#db)|`object`||yes| +|[**dbx**](#dbx)|`object`||| +|[**redis**](#redis)|`object`|Config for the redis client used to store key-value pairs
|| +|[**tracer**](#tracer)|`object`|Config defines the configuration settings for opentelemetry tracing
|| +|[**email**](#email)|`object`||| +|[**sessions**](#sessions)|`object`|Config contains the configuration for the session store
|| +|[**posthog**](#posthog)|`object`|Config is the configuration for PostHog
|| +|[**totp**](#totp)|`object`||| +|[**ratelimit**](#ratelimit)|`object`|Config defines the configuration settings for the default rate limiter
|| +|[**publisherConfig**](#publisherconfig)|`object`|Config is the configuration for the Kafka event source
|| + +**Additional Properties:** not allowed + +## server: object + +Server settings for the echo server + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**debug**|`boolean`|Debug enables debug mode for the server
|no| +|**dev**|`boolean`|Dev enables echo's dev mode options
|no| +|**listen**|`string`|Listen sets the listen address to serve the echo server on
|yes| +|**shutdownGracePeriod**|`integer`|ShutdownGracePeriod sets the grace period for in flight requests before shutting down
|no| +|**readTimeout**|`integer`|ReadTimeout sets the maximum duration for reading the entire request including the body
|no| +|**writeTimeout**|`integer`|WriteTimeout sets the maximum duration before timing out writes of the response
|no| +|**idleTimeout**|`integer`|IdleTimeout sets the maximum amount of time to wait for the next request when keep-alives are enabled
|no| +|**readHeaderTimeout**|`integer`|ReadHeaderTimeout sets the amount of time allowed to read request headers
|no| +|[**tls**](#servertls)|`object`|TLS settings for the server for secure connections
|no| +|[**cors**](#servercors)|`object`|Config holds the cors configuration settings
|no| +|[**secure**](#serversecure)|`object`|Config contains the types used in the mw middleware
|no| +|[**redirects**](#serverredirects)|`object`|Config contains the types used in executing redirects via the redirect middleware
|no| +|[**cacheControl**](#servercachecontrol)|`object`|Config is the config values for the cache-control middleware
|no| +|[**mime**](#servermime)|`object`|Config defines the config for Mime middleware
|no| +|[**graphPool**](#servergraphpool)|`object`|PondPool contains the settings for the goroutine pool
|no| +|**enableGraphExtensions**|`boolean`|EnableGraphExtensions enables the graph extensions for the graph resolvers
|no| + +**Additional Properties:** not allowed + +### server\.tls: object + +TLS settings for the server for secure connections + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled turns on TLS settings for the server
|| +|**certFile**|`string`|CertFile location for the TLS server
|| +|**certKey**|`string`|CertKey file location for the TLS server
|| +|**autoCert**|`boolean`|AutoCert generates the cert with letsencrypt, this does not work on localhost
|| + +**Additional Properties:** not allowed + +### server\.cors: object + +Config holds the cors configuration settings + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enable or disable the CORS middleware
|| +|[**prefixes**](#servercorsprefixes)|`object`||| +|[**allowOrigins**](#servercorsalloworigins)|`string[]`||| +|**cookieInsecure**|`boolean`|CookieInsecure sets the cookie to be insecure
|| + +**Additional Properties:** not allowed + +#### server\.cors\.prefixes: object + +**Additional Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| + + +#### server\.cors\.allowOrigins: array + +**Items** + +**Item Type:** `string` + +### server\.secure: object + +Config contains the types used in the mw middleware + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled indicates if the secure middleware should be enabled
|| +|**xssprotection**|`string`|XSSProtection is the value to set the X-XSS-Protection header to - default is 1; mode=block
|| +|**contenttypenosniff**|`string`|ContentTypeNosniff is the value to set the X-Content-Type-Options header to - default is nosniff
|| +|**xframeoptions**|`string`|XFrameOptions is the value to set the X-Frame-Options header to - default is SAMEORIGIN
|| +|**hstspreloadenabled**|`boolean`|HSTSPreloadEnabled is a boolean to enable HSTS preloading - default is false
|| +|**hstsmaxage**|`integer`|HSTSMaxAge is the max age to set the HSTS header to - default is 31536000
|| +|**contentsecuritypolicy**|`string`|ContentSecurityPolicy is the value to set the Content-Security-Policy header to - default is default-src 'self'
|| +|**referrerpolicy**|`string`|ReferrerPolicy is the value to set the Referrer-Policy header to - default is same-origin
|| +|**cspreportonly**|`boolean`|CSPReportOnly is a boolean to enable the Content-Security-Policy-Report-Only header - default is false
|| + +**Additional Properties:** not allowed + +### server\.redirects: object + +Config contains the types used in executing redirects via the redirect middleware + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled indicates if the redirect middleware should be enabled
|| +|[**redirects**](#serverredirectsredirects)|`object`||| +|**code**|`integer`|Code is the HTTP status code to use for the redirect
|| + +**Additional Properties:** not allowed + +#### server\.redirects\.redirects: object + +**Additional Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| + + +### server\.cacheControl: object + +Config is the config values for the cache-control middleware + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`||| +|[**noCacheHeaders**](#servercachecontrolnocacheheaders)|`object`||| +|[**etagHeaders**](#servercachecontroletagheaders)|`string[]`||| + +**Additional Properties:** not allowed + +#### server\.cacheControl\.noCacheHeaders: object + +**Additional Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| + + +#### server\.cacheControl\.etagHeaders: array + +**Items** + +**Item Type:** `string` + +### server\.mime: object + +Config defines the config for Mime middleware + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled indicates if the mime middleware should be enabled
|| +|**mimeTypesFile**|`string`|MimeTypesFile is the file to load mime types from
|| +|**defaultContentType**|`string`|DefaultContentType is the default content type to set if no mime type is found
|| + +**Additional Properties:** not allowed + +### server\.graphPool: object + +PondPool contains the settings for the goroutine pool + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**maxWorkers**|`integer`|MaxWorkers is the maximum number of workers in the pool
|| +|**maxCapacity**|`integer`|MaxCapacity is the maximum number of tasks that can be queued
|| + +**Additional Properties:** not allowed + +## entConfig: object + +Config holds the configuration for the ent server + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|[**flags**](#entconfigflags)|`object`|Flags contains the flags for the server to allow use to test different code paths
|| +|[**entityTypes**](#entconfigentitytypes)|`string[]`||| + +**Additional Properties:** not allowed + +### entConfig\.flags: object + +Flags contains the flags for the server to allow use to test different code paths + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**useListUserService**|`boolean`|use list services endpoint for object access
|| +|**useListObjectServices**|`boolean`|use list object services endpoint for object access
|| + +**Additional Properties:** not allowed + +### entConfig\.entityTypes: array + +**Items** + +**Item Type:** `string` + +## auth: object + +Auth settings including oauth2 providers and token configuration + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled authentication on the server, not recommended to disable
|no| +|[**token**](#authtoken)|`object`|Config defines the configuration settings for authentication tokens used in the server
|yes| +|[**supportedProviders**](#authsupportedproviders)|`string[]`||no| +|[**providers**](#authproviders)|`object`|OauthProviderConfig represents the configuration for OAuth providers such as Github and Google
|no| + +**Additional Properties:** not allowed + +### auth\.token: object + +Config defines the configuration settings for authentication tokens used in the server + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**kid**|`string`|KID represents the Key ID used in the configuration.
|yes| +|**audience**|`string`|Audience represents the target audience for the tokens.
|yes| +|**refreshAudience**|`string`|RefreshAudience represents the audience for refreshing tokens.
|no| +|**issuer**|`string`|Issuer represents the issuer of the tokens
|yes| +|**accessDuration**|`integer`|AccessDuration represents the duration of the access token is valid for
|no| +|**refreshDuration**|`integer`|RefreshDuration represents the duration of the refresh token is valid for
|no| +|**refreshOverlap**|`integer`|RefreshOverlap represents the overlap time for a refresh and access token
|no| +|**jwksEndpoint**|`string`|JWKSEndpoint represents the endpoint for the JSON Web Key Set
|no| +|[**keys**](#authtokenkeys)|`object`||yes| +|**generateKeys**|`boolean`|GenerateKeys is a boolean to determine if the keys should be generated
|no| + +**Additional Properties:** not allowed + +#### auth\.token\.keys: object + +**Additional Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| + + +### auth\.supportedProviders: array + +**Items** + +**Item Type:** `string` + +### auth\.providers: object + +OauthProviderConfig represents the configuration for OAuth providers such as Github and Google + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**redirectUrl**|`string`|RedirectURL is the URL that the OAuth2 client will redirect to after authentication is complete
|| +|[**github**](#authprovidersgithub)|`object`|ProviderConfig represents the configuration settings for a Github Oauth Provider
|yes| +|[**google**](#authprovidersgoogle)|`object`|ProviderConfig represents the configuration settings for a Google Oauth Provider
|yes| +|[**webauthn**](#authproviderswebauthn)|`object`|ProviderConfig represents the configuration settings for a Webauthn Provider
|yes| + +**Additional Properties:** not allowed + +#### auth\.providers\.github: object + +ProviderConfig represents the configuration settings for a Github Oauth Provider + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**clientId**|`string`|ClientID is the public identifier for the GitHub oauth2 client
|yes| +|**clientSecret**|`string`|ClientSecret is the secret for the GitHub oauth2 client
|yes| +|**clientEndpoint**|`string`|ClientEndpoint is the endpoint for the GitHub oauth2 client
|no| +|[**scopes**](#authprovidersgithubscopes)|`string[]`||yes| +|**redirectUrl**|`string`|RedirectURL is the URL that the GitHub oauth2 client will redirect to after authentication with Github
|yes| + +**Additional Properties:** not allowed + +##### auth\.providers\.github\.scopes: array + +**Items** + +**Item Type:** `string` + +#### auth\.providers\.google: object + +ProviderConfig represents the configuration settings for a Google Oauth Provider + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**clientId**|`string`|ClientID is the public identifier for the Google oauth2 client
|yes| +|**clientSecret**|`string`|ClientSecret is the secret for the Google oauth2 client
|yes| +|**clientEndpoint**|`string`|ClientEndpoint is the endpoint for the Google oauth2 client
|no| +|[**scopes**](#authprovidersgooglescopes)|`string[]`||yes| +|**redirectUrl**|`string`|RedirectURL is the URL that the Google oauth2 client will redirect to after authentication with Google
|yes| + +**Additional Properties:** not allowed + +##### auth\.providers\.google\.scopes: array + +**Items** + +**Item Type:** `string` + +#### auth\.providers\.webauthn: object + +ProviderConfig represents the configuration settings for a Webauthn Provider + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled is the provider enabled
|no| +|**displayName**|`string`|DisplayName is the site display name
|yes| +|**relyingPartyId**|`string`|RelyingPartyID is the relying party identifier
set to localhost for development, no port
|yes| +|[**requestOrigins**](#authproviderswebauthnrequestorigins)|`string[]`||yes| +|**maxDevices**|`integer`|MaxDevices is the maximum number of devices that can be associated with a user
|no| +|**enforceTimeout**|`boolean`|EnforceTimeout at the Relying Party / Server. This means if enabled and the user takes too long that even if the browser does not
enforce a timeout, the server will
|no| +|**timeout**|`integer`|Timeout is the timeout in seconds
|no| +|**debug**|`boolean`|Debug enables debug mode
|no| + +**Additional Properties:** not allowed + +##### auth\.providers\.webauthn\.requestOrigins: array + +**Items** + +**Item Type:** `string` + +## authz: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|enables authorization checks with openFGA
|no| +|**storeName**|`string`|name of openFGA store
|no| +|**hostUrl**|`string`|host url with scheme of the openFGA API
|yes| +|**storeId**|`string`|id of openFGA store
|no| +|**modelId**|`string`|id of openFGA model
|no| +|**createNewModel**|`boolean`|force create a new model
|no| +|**modelFile**|`string`|path to the fga model file
|no| +|[**credentials**](#authzcredentials)|`object`||no| + +**Additional Properties:** not allowed + +### authz\.credentials: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**apiToken**|`string`|api token for the openFGA client
|| +|**clientId**|`string`|client id for the openFGA client
|| +|**clientSecret**|`string`|client secret for the openFGA client
|| +|**audience**|`string`|audience for the openFGA client
|| +|**issuer**|`string`|issuer for the openFGA client
|| +|**scopes**|`string`|scopes for the openFGA client
|| + +**Additional Properties:** not allowed + +## db: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**debug**|`boolean`|debug enables printing the debug database logs
|no| +|**databaseName**|`string`|the name of the database to use with otel tracing
|no| +|**driverName**|`string`|sql driver name
|no| +|**multiWrite**|`boolean`|enables writing to two databases simultaneously
|no| +|**primaryDbSource**|`string`|dsn of the primary database
|yes| +|**secondaryDbSource**|`string`|dsn of the secondary database if multi-write is enabled
|no| +|**cacheTTL**|`integer`|cache results for subsequent requests
|no| +|**runMigrations**|`boolean`|run migrations on startup
|no| +|**migrationProvider**|`string`|migration provider to use for running migrations
|no| +|**enableHistory**|`boolean`|enable history data to be logged to the database
|no| + +**Additional Properties:** not allowed + +## dbx: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enable the dbx client
|| +|**baseUrl**|`string`|Base URL for the dbx service
|| +|**endpoint**|`string`|Endpoint for the graphql api
|| +|**debug**|`boolean`|Enable debug mode
|| + +**Additional Properties:** not allowed + +## redis: object + +Config for the redis client used to store key-value pairs + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled to enable redis client in the server
|| +|**address**|`string`|Address is the host:port to connect to redis
|| +|**name**|`string`|Name of the connecting client
|| +|**username**|`string`|Username to connect to redis
|| +|**password**|`string`|Password, must match the password specified in the server configuration
|| +|**db**|`integer`|DB to be selected after connecting to the server, 0 uses the default
|| +|**dialTimeout**|`integer`|Dial timeout for establishing new connections, defaults to 5s
|| +|**readTimeout**|`integer`|Timeout for socket reads. If reached, commands will fail
with a timeout instead of blocking. Supported values:
- `0` - default timeout (3 seconds).
- `-1` - no timeout (block indefinitely).
- `-2` - disables SetReadDeadline calls completely.
|| +|**writeTimeout**|`integer`|Timeout for socket writes. If reached, commands will fail
with a timeout instead of blocking. Supported values:
- `0` - default timeout (3 seconds).
- `-1` - no timeout (block indefinitely).
- `-2` - disables SetWriteDeadline calls completely.
|| +|**maxRetries**|`integer`|MaxRetries before giving up.
Default is 3 retries; -1 (not 0) disables retries.
|| +|**minIdleConns**|`integer`|MinIdleConns is useful when establishing new connection is slow.
Default is 0. the idle connections are not closed by default.
|| +|**maxIdleConns**|`integer`|Maximum number of idle connections.
Default is 0. the idle connections are not closed by default.
|| +|**maxActiveConns**|`integer`|Maximum number of connections allocated by the pool at a given time.
When zero, there is no limit on the number of connections in the pool.
|| + +**Additional Properties:** not allowed + +## tracer: object + +Config defines the configuration settings for opentelemetry tracing + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled to enable tracing
|| +|**provider**|`string`|Provider to use for tracing
|| +|**environment**|`string`|Environment to set for the service
|| +|[**stdout**](#tracerstdout)|`object`|StdOut settings for the stdout provider
|| +|[**otlp**](#tracerotlp)|`object`|OTLP settings for the otlp provider
|| + +**Additional Properties:** not allowed + +### tracer\.stdout: object + +StdOut settings for the stdout provider + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**pretty**|`boolean`|Pretty enables pretty printing of the output
|| +|**disableTimestamp**|`boolean`|DisableTimestamp disables the timestamp in the output
|| + +**Additional Properties:** not allowed + +### tracer\.otlp: object + +OTLP settings for the otlp provider + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**endpoint**|`string`|Endpoint to send the traces to
|| +|**insecure**|`boolean`|Insecure to disable TLS
|| +|**certificate**|`string`|Certificate to use for TLS
|| +|[**headers**](#tracerotlpheaders)|`string[]`||| +|**compression**|`string`|Compression to use for the request
|| +|**timeout**|`integer`|Timeout for the request
|| + +**Additional Properties:** not allowed + +#### tracer\.otlp\.headers: array + +**Items** + +**Item Type:** `string` + +## email: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**sendGridApiKey**|`string`||| +|**fromEmail**|`string`||| +|**testing**|`boolean`||| +|**archive**|`string`||| +|**listId**|`string`||| +|**adminEmail**|`string`||| +|[**consoleUrl**](#emailconsoleurl)|`object`||| +|[**marketingUrl**](#emailmarketingurl)|`object`||| + +**Additional Properties:** not allowed + +### email\.consoleUrl: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**consoleBase**|`string`||| +|**verify**|`string`||| +|**invite**|`string`||| +|**reset**|`string`||| + +**Additional Properties:** not allowed + +### email\.marketingUrl: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**marketingBase**|`string`||| +|**subscriberVerify**|`string`||| + +**Additional Properties:** not allowed + +## sessions: object + +Config contains the configuration for the session store + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**signingKey**|`string`|SigningKey must be a 16, 32, or 64 character string used to encode the cookie
|| +|**encryptionKey**|`string`|EncryptionKey must be a 16, 32, or 64 character string used to encode the cookie
|| +|**domain**|`string`|Domain is the domain for the cookie, leave empty to use the default value of the server
|| + +**Additional Properties:** not allowed + +## posthog: object + +Config is the configuration for PostHog + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled is a flag to enable or disable PostHog
|| +|**apiKey**|`string`|APIKey is the PostHog API Key
|| +|**host**|`string`|Host is the PostHog API Host
|| + +**Additional Properties:** not allowed + +## totp: object + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`||| +|**codeLength**|`integer`||| +|**issuer**|`string`||| +|**redis**|`boolean`||| +|**secret**|`string`||| +|**recoveryCodeCount**|`integer`||| +|**recoveryCodeLength**|`integer`||| + +**Additional Properties:** not allowed + +## ratelimit: object + +Config defines the configuration settings for the default rate limiter + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`||| +|**limit**|`number`||| +|**burst**|`integer`||| +|**expires**|`integer`||| + +**Additional Properties:** not allowed + +## publisherConfig: object + +Config is the configuration for the Kafka event source + + +**Properties** + +|Name|Type|Description|Required| +|----|----|-----------|--------| +|**enabled**|`boolean`|Enabled is a flag to determine if the Kafka event source is enabled
|| +|**appName**|`string`|AppName is the name of the application that is publishing events
|| +|**address**|`string`|Address is the address of the Kafka broker
|| +|[**addresses**](#publisherconfigaddresses)|`string[]`||| +|**debug**|`boolean`|Debug is a flag to determine if the Kafka client should run in debug mode
|| + +**Additional Properties:** not allowed + +### publisherConfig\.addresses: array + +**Items** + +**Item Type:** `string` + diff --git a/jsonschema/core.config.json b/jsonschema/core.config.json new file mode 100644 index 0000000..92c94f6 --- /dev/null +++ b/jsonschema/core.config.json @@ -0,0 +1,1010 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/theopenlane/core/config/config.-config", + "$defs": { + "[]string": { + "items": { + "type": "string" + }, + "type": "array" + }, + "cache.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled to enable redis client in the server" + }, + "address": { + "type": "string", + "description": "Address is the host:port to connect to redis" + }, + "name": { + "type": "string", + "description": "Name of the connecting client" + }, + "username": { + "type": "string", + "description": "Username to connect to redis" + }, + "password": { + "type": "string", + "description": "Password, must match the password specified in the server configuration" + }, + "db": { + "type": "integer", + "description": "DB to be selected after connecting to the server, 0 uses the default" + }, + "dialTimeout": { + "type": "integer", + "description": "Dial timeout for establishing new connections, defaults to 5s" + }, + "readTimeout": { + "type": "integer", + "description": "Timeout for socket reads. If reached, commands will fail\nwith a timeout instead of blocking. Supported values:\n - `0` - default timeout (3 seconds).\n - `-1` - no timeout (block indefinitely).\n - `-2` - disables SetReadDeadline calls completely." + }, + "writeTimeout": { + "type": "integer", + "description": "Timeout for socket writes. If reached, commands will fail\nwith a timeout instead of blocking. Supported values:\n - `0` - default timeout (3 seconds).\n - `-1` - no timeout (block indefinitely).\n - `-2` - disables SetWriteDeadline calls completely." + }, + "maxRetries": { + "type": "integer", + "description": "MaxRetries before giving up.\nDefault is 3 retries; -1 (not 0) disables retries." + }, + "minIdleConns": { + "type": "integer", + "description": "MinIdleConns is useful when establishing new connection is slow.\nDefault is 0. the idle connections are not closed by default." + }, + "maxIdleConns": { + "type": "integer", + "description": "Maximum number of idle connections.\nDefault is 0. the idle connections are not closed by default." + }, + "maxActiveConns": { + "type": "integer", + "description": "Maximum number of connections allocated by the pool at a given time.\nWhen zero, there is no limit on the number of connections in the pool." + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config for the redis client used to store key-value pairs" + }, + "cachecontrol.Config": { + "properties": { + "enabled": { + "type": "boolean" + }, + "noCacheHeaders": { + "$ref": "#/$defs/map[string]string", + "description": "noCacheHeaders is the header \u003c-\u003e match map pair to match in http for entity headers to remove" + }, + "etagHeaders": { + "$ref": "#/$defs/[]string", + "description": "etagHeaders is the string of entity headers to remove" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config is the config values for the cache-control middleware" + }, + "config.Auth": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled authentication on the server, not recommended to disable" + }, + "token": { + "$ref": "#/$defs/tokens.Config", + "description": "Token contains the token config settings for the issued tokens" + }, + "supportedProviders": { + "$ref": "#/$defs/[]string", + "description": "SupportedProviders are the supported oauth providers that have been configured" + }, + "providers": { + "$ref": "#/$defs/handlers.OauthProviderConfig", + "description": "Providers contains supported oauth2 providers configuration" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "token" + ], + "description": "Auth settings including oauth2 providers and token configuration" + }, + "config.PondPool": { + "properties": { + "maxWorkers": { + "type": "integer", + "description": "MaxWorkers is the maximum number of workers in the pool" + }, + "maxCapacity": { + "type": "integer", + "description": "MaxCapacity is the maximum number of tasks that can be queued" + } + }, + "additionalProperties": false, + "type": "object", + "description": "PondPool contains the settings for the goroutine pool" + }, + "config.Server": { + "properties": { + "debug": { + "type": "boolean", + "description": "Debug enables debug mode for the server" + }, + "dev": { + "type": "boolean", + "description": "Dev enables echo's dev mode options" + }, + "listen": { + "type": "string", + "description": "Listen sets the listen address to serve the echo server on" + }, + "shutdownGracePeriod": { + "type": "integer", + "description": "ShutdownGracePeriod sets the grace period for in flight requests before shutting down" + }, + "readTimeout": { + "type": "integer", + "description": "ReadTimeout sets the maximum duration for reading the entire request including the body" + }, + "writeTimeout": { + "type": "integer", + "description": "WriteTimeout sets the maximum duration before timing out writes of the response" + }, + "idleTimeout": { + "type": "integer", + "description": "IdleTimeout sets the maximum amount of time to wait for the next request when keep-alives are enabled" + }, + "readHeaderTimeout": { + "type": "integer", + "description": "ReadHeaderTimeout sets the amount of time allowed to read request headers" + }, + "tls": { + "$ref": "#/$defs/config.TLS", + "description": "TLS contains the tls configuration settings" + }, + "cors": { + "$ref": "#/$defs/cors.Config", + "description": "CORS contains settings to allow cross origin settings and insecure cookies" + }, + "secure": { + "$ref": "#/$defs/secure.Config", + "description": "Secure contains settings for the secure middleware" + }, + "redirects": { + "$ref": "#/$defs/redirect.Config", + "description": "Redirect contains settings for the redirect middleware" + }, + "cacheControl": { + "$ref": "#/$defs/cachecontrol.Config", + "description": "CacheControl contains settings for the cache control middleware" + }, + "mime": { + "$ref": "#/$defs/mime.Config", + "description": "Mime contains settings for the mime middleware" + }, + "graphPool": { + "$ref": "#/$defs/config.PondPool", + "description": "GraphPool contains settings for the goroutine pool used by the graph resolvers" + }, + "enableGraphExtensions": { + "type": "boolean", + "description": "EnableGraphExtensions enables the graph extensions for the graph resolvers" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "listen" + ], + "description": "Server settings for the echo server" + }, + "config.TLS": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled turns on TLS settings for the server" + }, + "certFile": { + "type": "string", + "description": "CertFile location for the TLS server" + }, + "certKey": { + "type": "string", + "description": "CertKey file location for the TLS server" + }, + "autoCert": { + "type": "boolean", + "description": "AutoCert generates the cert with letsencrypt, this does not work on localhost" + } + }, + "additionalProperties": false, + "type": "object", + "description": "TLS settings for the server for secure connections" + }, + "cors.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable or disable the CORS middleware" + }, + "prefixes": { + "$ref": "#/$defs/map[string][]string", + "description": "Prefixes is a map of prefixes to allowed origins" + }, + "allowOrigins": { + "$ref": "#/$defs/[]string", + "description": "AllowOrigins is a list of allowed origins" + }, + "cookieInsecure": { + "type": "boolean", + "description": "CookieInsecure sets the cookie to be insecure" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config holds the cors configuration settings" + }, + "dbxclient.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable the dbx client" + }, + "baseUrl": { + "type": "string", + "description": "Base URL for the dbx service" + }, + "endpoint": { + "type": "string", + "description": "Endpoint for the graphql api" + }, + "debug": { + "type": "boolean", + "description": "Enable debug mode" + } + }, + "additionalProperties": false, + "type": "object" + }, + "emails.Config": { + "properties": { + "sendGridApiKey": { + "type": "string" + }, + "fromEmail": { + "type": "string" + }, + "testing": { + "type": "boolean" + }, + "archive": { + "type": "string" + }, + "listId": { + "type": "string" + }, + "adminEmail": { + "type": "string" + }, + "consoleUrl": { + "$ref": "#/$defs/emails.ConsoleURLConfig" + }, + "marketingUrl": { + "$ref": "#/$defs/emails.MarketingURLConfig" + } + }, + "additionalProperties": false, + "type": "object" + }, + "emails.ConsoleURLConfig": { + "properties": { + "consoleBase": { + "type": "string" + }, + "verify": { + "type": "string" + }, + "invite": { + "type": "string" + }, + "reset": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "emails.MarketingURLConfig": { + "properties": { + "marketingBase": { + "type": "string" + }, + "subscriberVerify": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "entconfig.Config": { + "properties": { + "flags": { + "$ref": "#/$defs/entconfig.Flags", + "description": "flags for the server" + }, + "entityTypes": { + "$ref": "#/$defs/[]string", + "description": "EntityTypes is the list of entity types to create by default for the organization" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config holds the configuration for the ent server" + }, + "entconfig.Flags": { + "properties": { + "useListUserService": { + "type": "boolean", + "description": "use list services endpoint for object access" + }, + "useListObjectServices": { + "type": "boolean", + "description": "use list object services endpoint for object access" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Flags contains the flags for the server to allow use to test different code paths" + }, + "entx.Config": { + "properties": { + "debug": { + "type": "boolean", + "description": "debug enables printing the debug database logs" + }, + "databaseName": { + "type": "string", + "description": "the name of the database to use with otel tracing" + }, + "driverName": { + "type": "string", + "description": "sql driver name" + }, + "multiWrite": { + "type": "boolean", + "description": "enables writing to two databases simultaneously" + }, + "primaryDbSource": { + "type": "string", + "description": "dsn of the primary database" + }, + "secondaryDbSource": { + "type": "string", + "description": "dsn of the secondary database if multi-write is enabled" + }, + "cacheTTL": { + "type": "integer", + "description": "cache results for subsequent requests" + }, + "runMigrations": { + "type": "boolean", + "description": "run migrations on startup" + }, + "migrationProvider": { + "type": "string", + "description": "migration provider to use for running migrations" + }, + "enableHistory": { + "type": "boolean", + "description": "enable history data to be logged to the database" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "primaryDbSource" + ] + }, + "fgax.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "enables authorization checks with openFGA" + }, + "storeName": { + "type": "string", + "description": "name of openFGA store" + }, + "hostUrl": { + "type": "string", + "description": "host url with scheme of the openFGA API" + }, + "storeId": { + "type": "string", + "description": "id of openFGA store" + }, + "modelId": { + "type": "string", + "description": "id of openFGA model" + }, + "createNewModel": { + "type": "boolean", + "description": "force create a new model" + }, + "modelFile": { + "type": "string", + "description": "path to the fga model file" + }, + "credentials": { + "$ref": "#/$defs/fgax.Credentials", + "description": "credentials for the openFGA client" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "hostUrl" + ] + }, + "fgax.Credentials": { + "properties": { + "apiToken": { + "type": "string", + "description": "api token for the openFGA client" + }, + "clientId": { + "type": "string", + "description": "client id for the openFGA client" + }, + "clientSecret": { + "type": "string", + "description": "client secret for the openFGA client" + }, + "audience": { + "type": "string", + "description": "audience for the openFGA client" + }, + "issuer": { + "type": "string", + "description": "issuer for the openFGA client" + }, + "scopes": { + "type": "string", + "description": "scopes for the openFGA client" + } + }, + "additionalProperties": false, + "type": "object" + }, + "github.ProviderConfig": { + "properties": { + "clientId": { + "type": "string", + "description": "ClientID is the public identifier for the GitHub oauth2 client" + }, + "clientSecret": { + "type": "string", + "description": "ClientSecret is the secret for the GitHub oauth2 client" + }, + "clientEndpoint": { + "type": "string", + "description": "ClientEndpoint is the endpoint for the GitHub oauth2 client" + }, + "scopes": { + "$ref": "#/$defs/[]string", + "description": "Scopes are the scopes that the GitHub oauth2 client will request" + }, + "redirectUrl": { + "type": "string", + "description": "RedirectURL is the URL that the GitHub oauth2 client will redirect to after authentication with Github" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "clientId", + "clientSecret", + "scopes", + "redirectUrl" + ], + "description": "ProviderConfig represents the configuration settings for a Github Oauth Provider" + }, + "google.ProviderConfig": { + "properties": { + "clientId": { + "type": "string", + "description": "ClientID is the public identifier for the Google oauth2 client" + }, + "clientSecret": { + "type": "string", + "description": "ClientSecret is the secret for the Google oauth2 client" + }, + "clientEndpoint": { + "type": "string", + "description": "ClientEndpoint is the endpoint for the Google oauth2 client" + }, + "scopes": { + "$ref": "#/$defs/[]string", + "description": "Scopes are the scopes that the Google oauth2 client will request" + }, + "redirectUrl": { + "type": "string", + "description": "RedirectURL is the URL that the Google oauth2 client will redirect to after authentication with Google" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "clientId", + "clientSecret", + "scopes", + "redirectUrl" + ], + "description": "ProviderConfig represents the configuration settings for a Google Oauth Provider" + }, + "handlers.OauthProviderConfig": { + "properties": { + "redirectUrl": { + "type": "string", + "description": "RedirectURL is the URL that the OAuth2 client will redirect to after authentication is complete" + }, + "github": { + "$ref": "#/$defs/github.ProviderConfig", + "description": "Github contains the configuration settings for the Github Oauth Provider" + }, + "google": { + "$ref": "#/$defs/google.ProviderConfig", + "description": "Google contains the configuration settings for the Google Oauth Provider" + }, + "webauthn": { + "$ref": "#/$defs/webauthn.ProviderConfig", + "description": "Webauthn contains the configuration settings for the Webauthn Oauth Provider" + } + }, + "additionalProperties": false, + "type": "object", + "description": "OauthProviderConfig represents the configuration for OAuth providers such as Github and Google" + }, + "kafkaconfig.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled is a flag to determine if the Kafka event source is enabled" + }, + "appName": { + "type": "string", + "description": "AppName is the name of the application that is publishing events" + }, + "address": { + "type": "string", + "description": "Address is the address of the Kafka broker" + }, + "addresses": { + "$ref": "#/$defs/[]string", + "description": "Addresses is a list of addresses of the Kafka brokers" + }, + "debug": { + "type": "boolean", + "description": "Debug is a flag to determine if the Kafka client should run in debug mode" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config is the configuration for the Kafka event source" + }, + "map[string][]string": { + "additionalProperties": { + "$ref": "#/$defs/[]string" + }, + "type": "object" + }, + "map[string]string": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "mime.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled indicates if the mime middleware should be enabled" + }, + "mimeTypesFile": { + "type": "string", + "description": "MimeTypesFile is the file to load mime types from" + }, + "defaultContentType": { + "type": "string", + "description": "DefaultContentType is the default content type to set if no mime type is found" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config defines the config for Mime middleware" + }, + "otelx.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled to enable tracing" + }, + "provider": { + "type": "string", + "description": "Provider to use for tracing" + }, + "environment": { + "type": "string", + "description": "Environment to set for the service" + }, + "stdout": { + "$ref": "#/$defs/otelx.StdOut", + "description": "StdOut settings for the stdout provider" + }, + "otlp": { + "$ref": "#/$defs/otelx.OTLP", + "description": "OTLP settings for the otlp provider" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config defines the configuration settings for opentelemetry tracing" + }, + "otelx.OTLP": { + "properties": { + "endpoint": { + "type": "string", + "description": "Endpoint to send the traces to" + }, + "insecure": { + "type": "boolean", + "description": "Insecure to disable TLS" + }, + "certificate": { + "type": "string", + "description": "Certificate to use for TLS" + }, + "headers": { + "$ref": "#/$defs/[]string", + "description": "Headers to send with the request" + }, + "compression": { + "type": "string", + "description": "Compression to use for the request" + }, + "timeout": { + "type": "integer", + "description": "Timeout for the request" + } + }, + "additionalProperties": false, + "type": "object", + "description": "OTLP settings for the otlp provider" + }, + "otelx.StdOut": { + "properties": { + "pretty": { + "type": "boolean", + "description": "Pretty enables pretty printing of the output" + }, + "disableTimestamp": { + "type": "boolean", + "description": "DisableTimestamp disables the timestamp in the output" + } + }, + "additionalProperties": false, + "type": "object", + "description": "StdOut settings for the stdout provider" + }, + "posthog.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled is a flag to enable or disable PostHog" + }, + "apiKey": { + "type": "string", + "description": "APIKey is the PostHog API Key" + }, + "host": { + "type": "string", + "description": "Host is the PostHog API Host" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config is the configuration for PostHog" + }, + "ratelimit.Config": { + "properties": { + "enabled": { + "type": "boolean" + }, + "limit": { + "type": "number" + }, + "burst": { + "type": "integer" + }, + "expires": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config defines the configuration settings for the default rate limiter" + }, + "redirect.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled indicates if the redirect middleware should be enabled" + }, + "redirects": { + "$ref": "#/$defs/map[string]string", + "description": "Redirects is a map of paths to redirect to" + }, + "code": { + "type": "integer", + "description": "Code is the HTTP status code to use for the redirect" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config contains the types used in executing redirects via the redirect middleware" + }, + "secure.Config": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled indicates if the secure middleware should be enabled" + }, + "xssprotection": { + "type": "string", + "description": "XSSProtection is the value to set the X-XSS-Protection header to - default is 1; mode=block" + }, + "contenttypenosniff": { + "type": "string", + "description": "ContentTypeNosniff is the value to set the X-Content-Type-Options header to - default is nosniff" + }, + "xframeoptions": { + "type": "string", + "description": "XFrameOptions is the value to set the X-Frame-Options header to - default is SAMEORIGIN" + }, + "hstspreloadenabled": { + "type": "boolean", + "description": "HSTSPreloadEnabled is a boolean to enable HSTS preloading - default is false" + }, + "hstsmaxage": { + "type": "integer", + "description": "HSTSMaxAge is the max age to set the HSTS header to - default is 31536000" + }, + "contentsecuritypolicy": { + "type": "string", + "description": "ContentSecurityPolicy is the value to set the Content-Security-Policy header to - default is default-src 'self'" + }, + "referrerpolicy": { + "type": "string", + "description": "ReferrerPolicy is the value to set the Referrer-Policy header to - default is same-origin" + }, + "cspreportonly": { + "type": "boolean", + "description": "CSPReportOnly is a boolean to enable the Content-Security-Policy-Report-Only header - default is false" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config contains the types used in the mw middleware" + }, + "sessions.Config": { + "properties": { + "signingKey": { + "type": "string", + "description": "SigningKey must be a 16, 32, or 64 character string used to encode the cookie" + }, + "encryptionKey": { + "type": "string", + "description": "EncryptionKey must be a 16, 32, or 64 character string used to encode the cookie" + }, + "domain": { + "type": "string", + "description": "Domain is the domain for the cookie, leave empty to use the default value of the server" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config contains the configuration for the session store" + }, + "tokens.Config": { + "properties": { + "kid": { + "type": "string", + "description": "KID represents the Key ID used in the configuration." + }, + "audience": { + "type": "string", + "description": "Audience represents the target audience for the tokens." + }, + "refreshAudience": { + "type": "string", + "description": "RefreshAudience represents the audience for refreshing tokens." + }, + "issuer": { + "type": "string", + "description": "Issuer represents the issuer of the tokens" + }, + "accessDuration": { + "type": "integer", + "description": "AccessDuration represents the duration of the access token is valid for" + }, + "refreshDuration": { + "type": "integer", + "description": "RefreshDuration represents the duration of the refresh token is valid for" + }, + "refreshOverlap": { + "type": "integer", + "description": "RefreshOverlap represents the overlap time for a refresh and access token" + }, + "jwksEndpoint": { + "type": "string", + "description": "JWKSEndpoint represents the endpoint for the JSON Web Key Set" + }, + "keys": { + "$ref": "#/$defs/map[string]string", + "description": "Keys represents the key pairs used for signing the tokens" + }, + "generateKeys": { + "type": "boolean", + "description": "GenerateKeys is a boolean to determine if the keys should be generated" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "kid", + "audience", + "issuer", + "keys" + ], + "description": "Config defines the configuration settings for authentication tokens used in the server" + }, + "totp.Config": { + "properties": { + "enabled": { + "type": "boolean" + }, + "codeLength": { + "type": "integer" + }, + "issuer": { + "type": "string" + }, + "redis": { + "type": "boolean" + }, + "secret": { + "type": "string" + }, + "recoveryCodeCount": { + "type": "integer" + }, + "recoveryCodeLength": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "webauthn.ProviderConfig": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Enabled is the provider enabled" + }, + "displayName": { + "type": "string", + "description": "DisplayName is the site display name" + }, + "relyingPartyId": { + "type": "string", + "description": "RelyingPartyID is the relying party identifier\nset to localhost for development, no port" + }, + "requestOrigins": { + "$ref": "#/$defs/[]string", + "description": "RequestOrigins the origin domain(s) for authentication requests\ninclude the scheme and port" + }, + "maxDevices": { + "type": "integer", + "description": "MaxDevices is the maximum number of devices that can be associated with a user" + }, + "enforceTimeout": { + "type": "boolean", + "description": "EnforceTimeout at the Relying Party / Server. This means if enabled and the user takes too long that even if the browser does not\nenforce a timeout, the server will" + }, + "timeout": { + "type": "integer", + "description": "Timeout is the timeout in seconds" + }, + "debug": { + "type": "boolean", + "description": "Debug enables debug mode" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "displayName", + "relyingPartyId", + "requestOrigins" + ], + "description": "ProviderConfig represents the configuration settings for a Webauthn Provider" + } + }, + "properties": { + "refreshInterval": { + "type": "integer", + "description": "RefreshInterval determines how often to reload the config" + }, + "server": { + "$ref": "#/$defs/config.Server", + "description": "Server contains the echo server settings" + }, + "entConfig": { + "$ref": "#/$defs/entconfig.Config", + "description": "EntConfig contains the ent configuration used by the ent middleware" + }, + "auth": { + "$ref": "#/$defs/config.Auth", + "description": "Auth contains the authentication token settings and provider(s)" + }, + "authz": { + "$ref": "#/$defs/fgax.Config", + "description": "Authz contains the authorization settings for fine grained access control" + }, + "db": { + "$ref": "#/$defs/entx.Config", + "description": "DB contains the database configuration for the ent client" + }, + "dbx": { + "$ref": "#/$defs/dbxclient.Config", + "description": "DBx contains the dbx client configuration" + }, + "redis": { + "$ref": "#/$defs/cache.Config", + "description": "Redis contains the redis configuration for the key-value store" + }, + "tracer": { + "$ref": "#/$defs/otelx.Config", + "description": "Tracer contains the tracing config for opentelemetry" + }, + "email": { + "$ref": "#/$defs/emails.Config", + "description": "Email contains email sending configuration for the server" + }, + "sessions": { + "$ref": "#/$defs/sessions.Config", + "description": "Sessions config for user sessions and cookies" + }, + "posthog": { + "$ref": "#/$defs/posthog.Config", + "description": "PostHog contains the configuration for the PostHog analytics" + }, + "totp": { + "$ref": "#/$defs/totp.Config", + "description": "TOTP contains the configuration for the TOTP provider" + }, + "ratelimit": { + "$ref": "#/$defs/ratelimit.Config", + "description": "Ratelimit contains the configuration for the rate limiter" + }, + "publisherConfig": { + "$ref": "#/$defs/kafkaconfig.Config", + "description": "EventPublisher contains the configuration for the event publisher" + } + }, + "additionalProperties": false, + "type": "object", + "description": "Config contains the configuration for the core server" +} \ No newline at end of file diff --git a/jsonschema/envparse/doc.go b/jsonschema/envparse/doc.go new file mode 100644 index 0000000..c666efa --- /dev/null +++ b/jsonschema/envparse/doc.go @@ -0,0 +1,2 @@ +// Package envparse provides a way to parse environment variables from a struct +package envparse diff --git a/jsonschema/envparse/parse.go b/jsonschema/envparse/parse.go new file mode 100644 index 0000000..11f3e06 --- /dev/null +++ b/jsonschema/envparse/parse.go @@ -0,0 +1,128 @@ +package envparse + +import ( + "errors" + "fmt" + "reflect" + "strings" + + "github.com/stoewer/go-strcase" +) + +// ErrInvalidSpecification indicates that a specification is of the wrong type. +var ErrInvalidSpecification = errors.New("specification must be a struct pointer") + +type Config struct { + // FieldTagName is the name of the struct tag to use for the field name + FieldTagName string + // Skipper is the value of the tag to skip parsing of the field + Skipper string +} + +// varInfo maintains information about the configuration variable +type varInfo struct { + FieldName string + FullPath string + Key string + Type reflect.Type + Tags reflect.StructTag +} + +// GatherEnvInfo gathers information about the specified struct, including defaults and environment variable names. +func (c Config) GatherEnvInfo(prefix string, spec interface{}) ([]varInfo, error) { + s := reflect.ValueOf(spec) + + // Ensure the specification is a pointer to a struct + if s.Kind() != reflect.Ptr { + return nil, ErrInvalidSpecification + } + + s = s.Elem() + if s.Kind() != reflect.Struct { + return nil, ErrInvalidSpecification + } + + typeOfSpec := s.Type() + + // Create a slice to hold the information about the configuration variables + var infos []varInfo + + // Iterate over the struct fields + for i := range s.NumField() { + f := s.Field(i) + ftype := typeOfSpec.Field(i) + + if !f.CanSet() { + continue + } + + for f.Kind() == reflect.Ptr { + if f.IsNil() { + if f.Type().Elem().Kind() != reflect.Struct { + // nil pointer to a non-struct: leave it alone + break + } + + // nil pointer to struct: create a zero instance + f.Set(reflect.New(f.Type().Elem())) + } + + f = f.Elem() + } + + // Capture information about the config variable + fieldName := c.getFieldName(ftype) + if fieldName == c.Skipper { + continue + } + + info := varInfo{ + FieldName: fieldName, + FullPath: ftype.Name, + Type: ftype.Type, + Tags: ftype.Tag, + } + + // Default to the field name as the env var name (will be upcased) + info.Key = info.FieldName + + if prefix != "" { + info.Key = fmt.Sprintf("%s_%s", prefix, info.Key) + info.FullPath = fmt.Sprintf("%s.%s", strcase.LowerCamelCase(strings.Replace(prefix, "_", ".", -1)), info.FieldName) // nolint: gocritic + } + + info.Key = strings.ToUpper(info.Key) + infos = append(infos, info) + + if f.Kind() == reflect.Struct { + innerPrefix := prefix + + if !ftype.Anonymous { + innerPrefix = prefix + "_" + info.Tags.Get("json") + } + + embeddedPtr := f.Addr().Interface() + + // Recursively gather information about the embedded struct + embeddedInfos, err := c.GatherEnvInfo(innerPrefix, embeddedPtr) + if err != nil { + return nil, err + } + + infos = append(infos[:len(infos)-1], embeddedInfos...) + + continue + } + } + + return infos, nil +} + +func (c Config) getFieldName(ftype reflect.StructField) string { + if ftype.Tag.Get(c.FieldTagName) != "" { + return ftype.Tag.Get(c.FieldTagName) + } + + // default to skip if the koanf tag is not present + return c.Skipper +} diff --git a/jsonschema/schema_generator.go b/jsonschema/schema_generator.go new file mode 100644 index 0000000..1282d3c --- /dev/null +++ b/jsonschema/schema_generator.go @@ -0,0 +1,178 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + "reflect" + "strings" + + "github.com/invopop/jsonschema" + "github.com/invopop/yaml" + "github.com/mcuadros/go-defaults" + + "github.com/theopenlane/core/config" + "github.com/theopenlane/core/jsonschema/envparse" +) + +// const values used for the schema generator +const ( + tagName = "koanf" + skipper = "-" + defaultTag = "default" + jsonSchemaPath = "./jsonschema/core.config.json" + yamlConfigPath = "./config/config.example.yaml" + envConfigPath = "./config/.env.example" + configMapPath = "./config/configmap.yaml" + varPrefix = "CORE" + ownerReadWrite = 0600 +) + +// includedPackages is a list of packages to include in the schema generation +// that contain Go comments to be added to the schema +// any external packages must use the jsonschema description tags to add comments +var includedPackages = []string{ + "./config", + "./pkg/cache", + "./internal/ent", + "./internal/entdb", + "./internal/httpserve/handlers", + "./pkg/otelx", + "./pkg/sessions", + "./pkg/tokens", + "./pkg/utils", + "./pkg/providers", + "./pkg/analytics", + "./pkg/middleware", + "./pkg/events/kafka/kafkaconfig", +} + +// schemaConfig represents the configuration for the schema generator +type schemaConfig struct { + // jsonSchemaPath represents the file path of the JSON schema to be generated + jsonSchemaPath string + // yamlConfigPath is the file path to the YAML configuration to be generated + yamlConfigPath string + // envConfigPath is the file path to the environment variable configuration to be generated + envConfigPath string + // configMapPath is the file path to the kubernetes config map configuration to be generated + configMapPath string +} + +func main() { + c := schemaConfig{ + jsonSchemaPath: jsonSchemaPath, + yamlConfigPath: yamlConfigPath, + envConfigPath: envConfigPath, + configMapPath: configMapPath, + } + + if err := generateSchema(c, &config.Config{}); err != nil { + panic(err) + } +} + +// generateSchema generates a JSON schema and a YAML schema based on the provided schemaConfig and structure +func generateSchema(c schemaConfig, structure interface{}) error { + // override the default name to using the prefixed pkg name + r := jsonschema.Reflector{Namer: namePkg} + r.ExpandedStruct = true + // set `jsonschema:required` tag to true to generate required fields + r.RequiredFromJSONSchemaTags = true + // set the tag name to `koanf` for the koanf struct tags + r.FieldNameTag = tagName + + // add go comments to the schema + for _, pkg := range includedPackages { + if err := r.AddGoComments("github.com/theopenlane/core/", pkg); err != nil { + panic(err.Error()) + } + } + + s := r.Reflect(structure) + + // generate the json schema + data, err := json.MarshalIndent(s, "", " ") + if err != nil { + panic(err.Error()) + } + + if err = os.WriteFile(c.jsonSchemaPath, data, ownerReadWrite); err != nil { + panic(err.Error()) + } + + // generate yaml schema with default + yamlConfig := &config.Config{} + defaults.SetDefaults(yamlConfig) + + // this uses the `json` tag to generate the yaml schema + yamlSchema, err := yaml.Marshal(yamlConfig) + if err != nil { + panic(err.Error()) + } + + if err = os.WriteFile(c.yamlConfigPath, yamlSchema, ownerReadWrite); err != nil { + panic(err.Error()) + } + + cp := envparse.Config{ + FieldTagName: tagName, + Skipper: skipper, + } + + out, err := cp.GatherEnvInfo(varPrefix, &config.Config{}) + if err != nil { + panic(err.Error()) + } + + // generate the environment variables from the config + envSchema := "" + configMapSchema := "\n" + + for _, k := range out { + defaultVal := k.Tags.Get(defaultTag) + + envSchema += fmt.Sprintf("%s=\"%s\"\n", k.Key, defaultVal) + + // if the default value is empty, use the value from the values.yaml + if defaultVal == "" { + configMapSchema += fmt.Sprintf(" %s: {{ .Values.%s }}\n", k.Key, k.FullPath) + } else { + switch k.Type.Kind() { + case reflect.String, reflect.Int64: + defaultVal = "\"" + defaultVal + "\"" // add quotes to the string + case reflect.Slice: + defaultVal = strings.Replace(defaultVal, "[", "", 1) + defaultVal = strings.Replace(defaultVal, "]", "", 1) + defaultVal = "\"" + defaultVal + "\"" // add quotes to the string + } + + configMapSchema += fmt.Sprintf(" %s: {{ .Values.%s | default %s }}\n", k.Key, k.FullPath, defaultVal) + } + } + + // write the environment variables to a file + if err = os.WriteFile(c.envConfigPath, []byte(envSchema), ownerReadWrite); err != nil { + panic(err.Error()) + } + + // Get the configmap header + cm, err := os.ReadFile("./jsonschema/templates/configmap.tmpl") + if err != nil { + panic(err.Error()) + } + + // append the configmap schema to the header + cm = append(cm, []byte(configMapSchema)...) + + // write the configmap to a file + if err = os.WriteFile(c.configMapPath, cm, ownerReadWrite); err != nil { + panic(err.Error()) + } + + return nil +} + +func namePkg(r reflect.Type) string { + return r.String() +} diff --git a/jsonschema/templates/configmap.tmpl b/jsonschema/templates/configmap.tmpl new file mode 100644 index 0000000..177a335 --- /dev/null +++ b/jsonschema/templates/configmap.tmpl @@ -0,0 +1,12 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.names.fullname" . -}}-config + {{ $labels := include "common.tplvalues.merge" (dict "values" ( list .Values.api.commonLabels (include "common.labels.standard" .) ) "context" . ) }} + labels: {{- include "common.tplvalues.render" ( dict "value" $labels "context" $) | nindent 4 }} + {{- if .Values.api.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.api.commonAnnotations ) "context" . ) }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- end }} +data: \ No newline at end of file diff --git a/main.go b/main.go new file mode 100644 index 0000000..a27a7ff --- /dev/null +++ b/main.go @@ -0,0 +1,11 @@ +// package main is the entry point +package main + +import ( + "github.com/theopenlane/core/cmd" + _ "github.com/theopenlane/core/internal/ent/generated/runtime" +) + +func main() { + cmd.Execute() +} diff --git a/pkg/auth/context.go b/pkg/auth/context.go index d6162cb..4c602ce 100644 --- a/pkg/auth/context.go +++ b/pkg/auth/context.go @@ -5,8 +5,9 @@ import ( echo "github.com/theopenlane/echox" - "github.com/theopenlane/core/pkg/middleware/echocontext" "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/pkg/middleware/echocontext" ) type AuthenticationType string diff --git a/pkg/auth/context_test.go b/pkg/auth/context_test.go index 264567c..20f013b 100644 --- a/pkg/auth/context_test.go +++ b/pkg/auth/context_test.go @@ -6,9 +6,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/theopenlane/core/pkg/middleware/echocontext" "github.com/theopenlane/utils/ulids" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/auth" ) diff --git a/pkg/coreclient/graphclient.go b/pkg/coreclient/graphclient.go new file mode 100644 index 0000000..784ef39 --- /dev/null +++ b/pkg/coreclient/graphclient.go @@ -0,0 +1,39577 @@ +// Code generated by github.com/Yamashou/gqlgenc, DO NOT EDIT. + +package coreclient + +import ( + "context" + "encoding/json" + "net/http" + "time" + + "github.com/99designs/gqlgen/graphql" + "github.com/Yamashou/gqlgenc/clientv2" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +type OpenLaneGraphClient interface { + CreateAPIToken(ctx context.Context, input CreateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateAPIToken, error) + UpdateAPIToken(ctx context.Context, updateAPITokenID string, input UpdateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateAPIToken, error) + GetAllAPITokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllAPITokens, error) + GetAPITokenByID(ctx context.Context, apiTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetAPITokenByID, error) + DeleteAPIToken(ctx context.Context, deleteAPITokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteAPIToken, error) + CreateBulkCSVContact(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVContact, error) + CreateBulkContact(ctx context.Context, input []*CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkContact, error) + CreateContact(ctx context.Context, input CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateContact, error) + DeleteContact(ctx context.Context, deleteContactID string, interceptors ...clientv2.RequestInterceptor) (*DeleteContact, error) + GetAllContacts(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContacts, error) + GetContactByID(ctx context.Context, contactID string, interceptors ...clientv2.RequestInterceptor) (*GetContactByID, error) + GetContacts(ctx context.Context, where *ContactWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContacts, error) + UpdateContact(ctx context.Context, updateContactID string, input UpdateContactInput, interceptors ...clientv2.RequestInterceptor) (*UpdateContact, error) + GetAllContactHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContactHistories, error) + GetContactHistories(ctx context.Context, where *ContactHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContactHistories, error) + CreateDocumentData(ctx context.Context, input CreateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*CreateDocumentData, error) + DeleteDocumentData(ctx context.Context, deleteDocumentDataID string, interceptors ...clientv2.RequestInterceptor) (*DeleteDocumentData, error) + GetDocumentDataByID(ctx context.Context, documentDataID string, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataByID, error) + UpdateDocumentData(ctx context.Context, updateDocumentDataID string, input UpdateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*UpdateDocumentData, error) + GetAllDocumentDataHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllDocumentDataHistories, error) + GetDocumentDataHistories(ctx context.Context, where *DocumentDataHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataHistories, error) + CreateBulkCSVEntitlement(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlement, error) + CreateBulkEntitlement(ctx context.Context, input []*CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlement, error) + CreateEntitlement(ctx context.Context, input CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlement, error) + DeleteEntitlement(ctx context.Context, deleteEntitlementID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlement, error) + GetAllEntitlements(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlements, error) + GetEntitlementByID(ctx context.Context, entitlementID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementByID, error) + GetEntitlements(ctx context.Context, where *EntitlementWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlements, error) + UpdateEntitlement(ctx context.Context, updateEntitlementID string, input UpdateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlement, error) + GetAllEntitlementHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementHistories, error) + GetEntitlementHistories(ctx context.Context, where *EntitlementHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementHistories, error) + CreateBulkCSVEntitlementPlan(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlan, error) + CreateBulkEntitlementPlan(ctx context.Context, input []*CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlan, error) + CreateEntitlementPlan(ctx context.Context, input CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlan, error) + DeleteEntitlementPlan(ctx context.Context, deleteEntitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlan, error) + GetAllEntitlementPlans(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlans, error) + GetEntitlementPlanByID(ctx context.Context, entitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanByID, error) + GetEntitlementPlans(ctx context.Context, where *EntitlementPlanWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlans, error) + UpdateEntitlementPlan(ctx context.Context, updateEntitlementPlanID string, input UpdateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlan, error) + GetAllEntitlementPlanFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatures, error) + GetEntitlementPlanFeatureByID(ctx context.Context, entitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureByID, error) + GetEntitlementPlanFeatures(ctx context.Context, where *EntitlementPlanFeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatures, error) + CreateEntitlementPlanFeature(ctx context.Context, input CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlanFeature, error) + CreateBulkCSVEntitlementPlanFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlanFeature, error) + CreateBulkEntitlementPlanFeature(ctx context.Context, input []*CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlanFeature, error) + UpdateEntitlementPlanFeature(ctx context.Context, updateEntitlementPlanFeatureID string, input UpdateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlanFeature, error) + DeleteEntitlementPlanFeature(ctx context.Context, deleteEntitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlanFeature, error) + GetAllEntitlementPlanFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatureHistories, error) + GetEntitlementPlanFeatureHistories(ctx context.Context, where *EntitlementPlanFeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureHistories, error) + GetAllEntitlementPlanHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanHistories, error) + GetEntitlementPlanHistories(ctx context.Context, where *EntitlementPlanHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanHistories, error) + CreateBulkCSVEntity(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntity, error) + CreateBulkEntity(ctx context.Context, input []*CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntity, error) + CreateEntity(ctx context.Context, input CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntity, error) + DeleteEntity(ctx context.Context, deleteEntityID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntity, error) + GetAllEntities(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntities, error) + GetEntities(ctx context.Context, where *EntityWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntities, error) + GetEntityByID(ctx context.Context, entityID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityByID, error) + UpdateEntity(ctx context.Context, updateEntityID string, input UpdateEntityInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntity, error) + GetAllEntityHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityHistories, error) + GetEntityHistories(ctx context.Context, where *EntityHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityHistories, error) + CreateBulkCSVEntityType(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntityType, error) + CreateBulkEntityType(ctx context.Context, input []*CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntityType, error) + CreateEntityType(ctx context.Context, input CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntityType, error) + DeleteEntityType(ctx context.Context, deleteEntityTypeID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntityType, error) + GetAllEntityTypes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypes, error) + GetEntityTypeByID(ctx context.Context, entityTypeID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeByID, error) + GetEntityTypes(ctx context.Context, where *EntityTypeWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypes, error) + UpdateEntityType(ctx context.Context, updateEntityTypeID string, input UpdateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntityType, error) + GetAllEntityTypeHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypeHistories, error) + GetEntityTypeHistories(ctx context.Context, where *EntityTypeHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeHistories, error) + GetEvents(ctx context.Context, where *EventWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEvents, error) + GetEventByID(ctx context.Context, eventID string, interceptors ...clientv2.RequestInterceptor) (*GetEventByID, error) + GetAllEvents(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEvents, error) + CreateEvent(ctx context.Context, input CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateEvent, error) + CreateBulkEvent(ctx context.Context, input []*CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEvent, error) + CreateBulkCSVEvent(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEvent, error) + UpdateEvent(ctx context.Context, updateEventID string, input UpdateEventInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEvent, error) + DeleteEvent(ctx context.Context, deleteEventID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEvent, error) + GetAllEventHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEventHistories, error) + GetEventHistories(ctx context.Context, where *EventHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEventHistories, error) + CreateBulkCSVFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFeature, error) + CreateBulkFeature(ctx context.Context, input []*CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFeature, error) + CreateFeature(ctx context.Context, input CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateFeature, error) + DeleteFeature(ctx context.Context, deleteFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFeature, error) + GetAllFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatures, error) + GetFeatureByID(ctx context.Context, featureID string, interceptors ...clientv2.RequestInterceptor) (*GetFeatureByID, error) + GetFeatures(ctx context.Context, where *FeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatures, error) + UpdateFeature(ctx context.Context, updateFeatureID string, input UpdateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFeature, error) + GetAllFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatureHistories, error) + GetFeatureHistories(ctx context.Context, where *FeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatureHistories, error) + CreateBulkCSVFile(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFile, error) + CreateBulkFile(ctx context.Context, input []*CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFile, error) + CreateFile(ctx context.Context, input CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateFile, error) + DeleteFile(ctx context.Context, deleteFileID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFile, error) + GetAllFiles(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFiles, error) + GetFiles(ctx context.Context, where *FileWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFiles, error) + UpdateFile(ctx context.Context, updateFileID string, input UpdateFileInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFile, error) + GetAllFileHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFileHistories, error) + GetFileHistories(ctx context.Context, where *FileHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFileHistories, error) + CreateBulkCSVGroup(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroup, error) + CreateBulkGroup(ctx context.Context, input []*CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroup, error) + CreateGroup(ctx context.Context, input CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateGroup, error) + DeleteGroup(ctx context.Context, deleteGroupID string, interceptors ...clientv2.RequestInterceptor) (*DeleteGroup, error) + GetAllGroups(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroups, error) + GetGroupByID(ctx context.Context, groupID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupByID, error) + GetGroups(ctx context.Context, where *GroupWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroups, error) + UpdateGroup(ctx context.Context, updateGroupID string, input UpdateGroupInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroup, error) + GetAllGroupHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupHistories, error) + GetGroupHistories(ctx context.Context, where *GroupHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupHistories, error) + AddUserToGroupWithRole(ctx context.Context, input CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToGroupWithRole, error) + CreateBulkCSVGroupMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroupMembers, error) + CreateBulkGroupMembers(ctx context.Context, input []*CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroupMembers, error) + GetGroupMembersByGroupID(ctx context.Context, where *GroupMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembersByGroupID, error) + RemoveUserFromGroup(ctx context.Context, deleteGroupMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromGroup, error) + UpdateUserRoleInGroup(ctx context.Context, updateGroupMemberID string, input UpdateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInGroup, error) + GetAllGroupMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupMembershipHistories, error) + GetGroupMembershipHistories(ctx context.Context, where *GroupMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembershipHistories, error) + GetAllGroupSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettings, error) + GetGroupSettingByID(ctx context.Context, groupSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingByID, error) + GetGroupSettings(ctx context.Context, where GroupSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettings, error) + UpdateGroupSetting(ctx context.Context, updateGroupSettingID string, input UpdateGroupSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroupSetting, error) + GetAllGroupSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettingHistories, error) + GetGroupSettingHistories(ctx context.Context, where *GroupSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingHistories, error) + CreateBulkCSVHush(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVHush, error) + CreateBulkHush(ctx context.Context, input []*CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkHush, error) + CreateHush(ctx context.Context, input CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateHush, error) + GetAllHushes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushes, error) + GetHushByID(ctx context.Context, hushID string, interceptors ...clientv2.RequestInterceptor) (*GetHushByID, error) + GetHushes(ctx context.Context, where *HushWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushes, error) + UpdateHush(ctx context.Context, updateHushID string, input UpdateHushInput, interceptors ...clientv2.RequestInterceptor) (*UpdateHush, error) + GetAllHushHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushHistories, error) + GetHushHistories(ctx context.Context, where *HushHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushHistories, error) + CreateBulkCSVIntegration(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVIntegration, error) + CreateBulkIntegration(ctx context.Context, input []*CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkIntegration, error) + CreateIntegration(ctx context.Context, input CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateIntegration, error) + DeleteIntegration(ctx context.Context, deleteIntegrationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteIntegration, error) + GetAllIntegrations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrations, error) + GetIntegrationByID(ctx context.Context, integrationID string, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationByID, error) + GetIntegrations(ctx context.Context, where *IntegrationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrations, error) + UpdateIntegration(ctx context.Context, updateIntegrationID string, input UpdateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateIntegration, error) + GetAllIntegrationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrationHistories, error) + GetIntegrationHistories(ctx context.Context, where *IntegrationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationHistories, error) + CreateBulkCSVInvite(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVInvite, error) + CreateBulkInvite(ctx context.Context, input []*CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkInvite, error) + CreateInvite(ctx context.Context, input CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateInvite, error) + DeleteInvite(ctx context.Context, deleteInviteID string, interceptors ...clientv2.RequestInterceptor) (*DeleteInvite, error) + GetInviteByID(ctx context.Context, inviteID string, interceptors ...clientv2.RequestInterceptor) (*GetInviteByID, error) + GetAllInvites(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllInvites, error) + InvitesByOrgID(ctx context.Context, where *InviteWhereInput, interceptors ...clientv2.RequestInterceptor) (*InvitesByOrgID, error) + GetAllNoteHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllNoteHistories, error) + GetNoteHistories(ctx context.Context, where *NoteHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetNoteHistories, error) + GetAllOauthProviderHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOauthProviderHistories, error) + GetOauthProviderHistories(ctx context.Context, where *OauthProviderHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOauthProviderHistories, error) + CreateBulkCSVOhAuthTooToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOhAuthTooToken, error) + CreateBulkOhAuthTooToken(ctx context.Context, input []*CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOhAuthTooToken, error) + CreateOhAuthTooToken(ctx context.Context, input CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateOhAuthTooToken, error) + DeleteOhAuthTooToken(ctx context.Context, deleteOhAuthTooTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOhAuthTooToken, error) + GetOhAuthTooTokens(ctx context.Context, where *OhAuthTooTokenWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOhAuthTooTokens, error) + UpdateOhAuthTooToken(ctx context.Context, updateOhAuthTooTokenID string, input UpdateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOhAuthTooToken, error) + CreateBulkCSVOrganization(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrganization, error) + CreateBulkOrganization(ctx context.Context, input []*CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrganization, error) + CreateOrganization(ctx context.Context, input CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateOrganization, error) + DeleteOrganization(ctx context.Context, deleteOrganizationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOrganization, error) + GetAllOrganizations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizations, error) + GetOrganizationByID(ctx context.Context, organizationID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationByID, error) + GetOrganizations(ctx context.Context, where *OrganizationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizations, error) + UpdateOrganization(ctx context.Context, updateOrganizationID string, input UpdateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganization, error) + GetAllOrganizationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationHistories, error) + GetOrganizationHistories(ctx context.Context, where *OrganizationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationHistories, error) + GetAllOrganizationSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettings, error) + GetOrganizationSettingByID(ctx context.Context, organizationSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingByID, error) + GetOrganizationSettings(ctx context.Context, where OrganizationSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettings, error) + UpdateOrganizationSetting(ctx context.Context, updateOrganizationSettingID string, input UpdateOrganizationSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganizationSetting, error) + GetAllOrganizationSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettingHistories, error) + GetOrganizationSettingHistories(ctx context.Context, where *OrganizationSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingHistories, error) + AddUserToOrgWithRole(ctx context.Context, input CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToOrgWithRole, error) + CreateBulkCSVOrgMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrgMembers, error) + CreateBulkOrgMembers(ctx context.Context, input []*CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrgMembers, error) + GetOrgMembersByOrgID(ctx context.Context, where *OrgMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembersByOrgID, error) + RemoveUserFromOrg(ctx context.Context, deleteOrgMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromOrg, error) + UpdateUserRoleInOrg(ctx context.Context, updateOrgMemberID string, input UpdateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInOrg, error) + GetAllOrgMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrgMembershipHistories, error) + GetOrgMembershipHistories(ctx context.Context, where *OrgMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembershipHistories, error) + CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVPersonalAccessToken, error) + CreateBulkPersonalAccessToken(ctx context.Context, input []*CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkPersonalAccessToken, error) + CreatePersonalAccessToken(ctx context.Context, input CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreatePersonalAccessToken, error) + DeletePersonalAccessToken(ctx context.Context, deletePersonalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeletePersonalAccessToken, error) + GetAllPersonalAccessTokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllPersonalAccessTokens, error) + GetPersonalAccessTokenByID(ctx context.Context, personalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetPersonalAccessTokenByID, error) + UpdatePersonalAccessToken(ctx context.Context, updatePersonalAccessTokenID string, input UpdatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdatePersonalAccessToken, error) + Search(ctx context.Context, query string, interceptors ...clientv2.RequestInterceptor) (*Search, error) + CreateBulkCSVSubscriber(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVSubscriber, error) + CreateBulkSubscriber(ctx context.Context, input []*CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkSubscriber, error) + CreateSubscriber(ctx context.Context, input CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateSubscriber, error) + DeleteSubscriber(ctx context.Context, deleteSubscriberEmail string, subscriberOrganization *string, interceptors ...clientv2.RequestInterceptor) (*DeleteSubscriber, error) + GetAllSubscribers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllSubscribers, error) + GetSubscriberByEmail(ctx context.Context, email string, interceptors ...clientv2.RequestInterceptor) (*GetSubscriberByEmail, error) + GetSubscribers(ctx context.Context, where *SubscriberWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetSubscribers, error) + UpdateSubscriber(ctx context.Context, email string, input UpdateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*UpdateSubscriber, error) + CreateBulkCSVTemplate(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVTemplate, error) + CreateBulkTemplate(ctx context.Context, input []*CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkTemplate, error) + CreateTemplate(ctx context.Context, input CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateTemplate, error) + GetAllTemplates(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplates, error) + GetTemplateByID(ctx context.Context, getTemplateID string, interceptors ...clientv2.RequestInterceptor) (*GetTemplateByID, error) + UpdateTemplate(ctx context.Context, updateTemplateID string, input UpdateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTemplate, error) + GetAllTemplateHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplateHistories, error) + GetTemplateHistories(ctx context.Context, where *TemplateHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetTemplateHistories, error) + CreateTFASetting(ctx context.Context, input CreateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*CreateTFASetting, error) + GetAllTFASettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTFASettings, error) + GetTFASetting(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetTFASetting, error) + UpdateTFASetting(ctx context.Context, input UpdateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTFASetting, error) + CreateUser(ctx context.Context, input CreateUserInput, interceptors ...clientv2.RequestInterceptor) (*CreateUser, error) + DeleteUser(ctx context.Context, deleteUserID string, interceptors ...clientv2.RequestInterceptor) (*DeleteUser, error) + GetAllUsers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUsers, error) + GetUserByID(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByID, error) + GetUserByIDWithOrgs(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByIDWithOrgs, error) + UpdateUser(ctx context.Context, updateUserID string, input UpdateUserInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUser, error) + GetAllUserHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserHistories, error) + GetUserHistories(ctx context.Context, where *UserHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserHistories, error) + GetAllUserSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettings, error) + GetUserSettingByID(ctx context.Context, userSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingByID, error) + GetUserSettings(ctx context.Context, where UserSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettings, error) + UpdateUserSetting(ctx context.Context, updateUserSettingID string, input UpdateUserSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserSetting, error) + GetAllUserSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettingHistories, error) + GetUserSettingHistories(ctx context.Context, where *UserSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingHistories, error) + GetWebhookByID(ctx context.Context, webhookID string, interceptors ...clientv2.RequestInterceptor) (*GetWebhookByID, error) + GetAllWebhooks(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhooks, error) + CreateWebhook(ctx context.Context, input CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateWebhook, error) + CreateBulkWebhook(ctx context.Context, input []*CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkWebhook, error) + CreateBulkCSVWebhook(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVWebhook, error) + UpdateWebhook(ctx context.Context, updateWebhookID string, input UpdateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*UpdateWebhook, error) + DeleteWebhook(ctx context.Context, deleteWebhookID string, interceptors ...clientv2.RequestInterceptor) (*DeleteWebhook, error) + GetAllWebhookHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhookHistories, error) + GetWebhookHistories(ctx context.Context, where *WebhookHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetWebhookHistories, error) +} + +type Client struct { + Client *clientv2.Client +} + +func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) OpenLaneGraphClient { + return &Client{Client: clientv2.NewClient(cli, baseURL, options, interceptors...)} +} + +type CreateAPIToken_CreateAPIToken_APIToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateAPIToken_CreateAPIToken_APIToken_Owner) GetID() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken_Owner{} + } + return t.ID +} + +type CreateAPIToken_CreateAPIToken_APIToken struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *CreateAPIToken_CreateAPIToken_APIToken_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetID() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.ID +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetToken() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Token +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetScopes() []string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Scopes +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetOwner() *CreateAPIToken_CreateAPIToken_APIToken_Owner { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Owner +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.CreatedAt +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.UpdatedAt +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetCreatedBy() *string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.CreatedBy +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetUpdatedBy() *string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.UpdatedBy +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetName() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Name +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.ExpiresAt +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetDescription() *string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Description +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.LastUsedAt +} + +type CreateAPIToken_CreateAPIToken struct { + APIToken CreateAPIToken_CreateAPIToken_APIToken "json:\"apiToken\" graphql:\"apiToken\"" +} + +func (t *CreateAPIToken_CreateAPIToken) GetAPIToken() *CreateAPIToken_CreateAPIToken_APIToken { + if t == nil { + t = &CreateAPIToken_CreateAPIToken{} + } + return &t.APIToken +} + +type UpdateAPIToken_UpdateAPIToken_APIToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateAPIToken_UpdateAPIToken_APIToken_Owner) GetID() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken_Owner{} + } + return t.ID +} + +type UpdateAPIToken_UpdateAPIToken_APIToken struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *UpdateAPIToken_UpdateAPIToken_APIToken_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetID() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.ID +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetToken() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Token +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetScopes() []string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Scopes +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetOwner() *UpdateAPIToken_UpdateAPIToken_APIToken_Owner { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Owner +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.CreatedAt +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.UpdatedAt +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetCreatedBy() *string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.CreatedBy +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetUpdatedBy() *string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.UpdatedBy +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetName() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Name +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetExpiresAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.ExpiresAt +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetDescription() *string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Description +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.LastUsedAt +} + +type UpdateAPIToken_UpdateAPIToken struct { + APIToken UpdateAPIToken_UpdateAPIToken_APIToken "json:\"apiToken\" graphql:\"apiToken\"" +} + +func (t *UpdateAPIToken_UpdateAPIToken) GetAPIToken() *UpdateAPIToken_UpdateAPIToken_APIToken { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken{} + } + return &t.APIToken +} + +type GetAllAPITokens_APITokens_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllAPITokens_APITokens_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllAPITokens_APITokens_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *GetAllAPITokens_APITokens_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *GetAllAPITokens_APITokens_Edges_Node) GetID() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.ID +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetToken() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Token +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetScopes() []string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Scopes +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetOwner() *GetAllAPITokens_APITokens_Edges_Node_Owner { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Owner +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetName() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Name +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Description +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.LastUsedAt +} + +type GetAllAPITokens_APITokens_Edges struct { + Node *GetAllAPITokens_APITokens_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllAPITokens_APITokens_Edges) GetNode() *GetAllAPITokens_APITokens_Edges_Node { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges{} + } + return t.Node +} + +type GetAllAPITokens_APITokens struct { + Edges []*GetAllAPITokens_APITokens_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllAPITokens_APITokens) GetEdges() []*GetAllAPITokens_APITokens_Edges { + if t == nil { + t = &GetAllAPITokens_APITokens{} + } + return t.Edges +} + +type GetAPITokenByID_APIToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAPITokenByID_APIToken_Owner) GetID() string { + if t == nil { + t = &GetAPITokenByID_APIToken_Owner{} + } + return t.ID +} + +type GetAPITokenByID_APIToken struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *GetAPITokenByID_APIToken_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *GetAPITokenByID_APIToken) GetID() string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.ID +} +func (t *GetAPITokenByID_APIToken) GetToken() string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Token +} +func (t *GetAPITokenByID_APIToken) GetScopes() []string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Scopes +} +func (t *GetAPITokenByID_APIToken) GetOwner() *GetAPITokenByID_APIToken_Owner { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Owner +} +func (t *GetAPITokenByID_APIToken) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.CreatedAt +} +func (t *GetAPITokenByID_APIToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.UpdatedAt +} +func (t *GetAPITokenByID_APIToken) GetCreatedBy() *string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.CreatedBy +} +func (t *GetAPITokenByID_APIToken) GetUpdatedBy() *string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.UpdatedBy +} +func (t *GetAPITokenByID_APIToken) GetName() string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Name +} +func (t *GetAPITokenByID_APIToken) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.ExpiresAt +} +func (t *GetAPITokenByID_APIToken) GetDescription() *string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Description +} +func (t *GetAPITokenByID_APIToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.LastUsedAt +} + +type DeleteAPIToken_DeleteAPIToken struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteAPIToken_DeleteAPIToken) GetDeletedID() string { + if t == nil { + t = &DeleteAPIToken_DeleteAPIToken{} + } + return t.DeletedID +} + +type CreateBulkCSVContact_CreateBulkCSVContact_Contacts struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetAddress() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Address +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetCompany() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Company +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.CreatedAt +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.CreatedBy +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetEmail() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Email +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetFullName() string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.FullName +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetID() string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.ID +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.OwnerID +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetPhoneNumber() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.PhoneNumber +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return &t.Status +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetTags() []string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Tags +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetTitle() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Title +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.UpdatedBy +} + +type CreateBulkCSVContact_CreateBulkCSVContact struct { + Contacts []*CreateBulkCSVContact_CreateBulkCSVContact_Contacts "json:\"contacts,omitempty\" graphql:\"contacts\"" +} + +func (t *CreateBulkCSVContact_CreateBulkCSVContact) GetContacts() []*CreateBulkCSVContact_CreateBulkCSVContact_Contacts { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact{} + } + return t.Contacts +} + +type CreateBulkContact_CreateBulkContact_Contacts struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetAddress() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Address +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetCompany() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Company +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.CreatedAt +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.CreatedBy +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetEmail() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Email +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetFullName() string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.FullName +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetID() string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.ID +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetOwnerID() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.OwnerID +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetPhoneNumber() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.PhoneNumber +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return &t.Status +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetTags() []string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Tags +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetTitle() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Title +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.UpdatedAt +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.UpdatedBy +} + +type CreateBulkContact_CreateBulkContact struct { + Contacts []*CreateBulkContact_CreateBulkContact_Contacts "json:\"contacts,omitempty\" graphql:\"contacts\"" +} + +func (t *CreateBulkContact_CreateBulkContact) GetContacts() []*CreateBulkContact_CreateBulkContact_Contacts { + if t == nil { + t = &CreateBulkContact_CreateBulkContact{} + } + return t.Contacts +} + +type CreateContact_CreateContact_Contact struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateContact_CreateContact_Contact) GetAddress() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Address +} +func (t *CreateContact_CreateContact_Contact) GetCompany() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Company +} +func (t *CreateContact_CreateContact_Contact) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.CreatedAt +} +func (t *CreateContact_CreateContact_Contact) GetCreatedBy() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.CreatedBy +} +func (t *CreateContact_CreateContact_Contact) GetEmail() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Email +} +func (t *CreateContact_CreateContact_Contact) GetFullName() string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.FullName +} +func (t *CreateContact_CreateContact_Contact) GetID() string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.ID +} +func (t *CreateContact_CreateContact_Contact) GetOwnerID() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.OwnerID +} +func (t *CreateContact_CreateContact_Contact) GetPhoneNumber() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.PhoneNumber +} +func (t *CreateContact_CreateContact_Contact) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return &t.Status +} +func (t *CreateContact_CreateContact_Contact) GetTags() []string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Tags +} +func (t *CreateContact_CreateContact_Contact) GetTitle() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Title +} +func (t *CreateContact_CreateContact_Contact) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.UpdatedAt +} +func (t *CreateContact_CreateContact_Contact) GetUpdatedBy() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.UpdatedBy +} + +type CreateContact_CreateContact struct { + Contact CreateContact_CreateContact_Contact "json:\"contact\" graphql:\"contact\"" +} + +func (t *CreateContact_CreateContact) GetContact() *CreateContact_CreateContact_Contact { + if t == nil { + t = &CreateContact_CreateContact{} + } + return &t.Contact +} + +type DeleteContact_DeleteContact struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteContact_DeleteContact) GetDeletedID() string { + if t == nil { + t = &DeleteContact_DeleteContact{} + } + return t.DeletedID +} + +type GetAllContacts_Contacts_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllContacts_Contacts_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Address +} +func (t *GetAllContacts_Contacts_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Company +} +func (t *GetAllContacts_Contacts_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllContacts_Contacts_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllContacts_Contacts_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Email +} +func (t *GetAllContacts_Contacts_Edges_Node) GetFullName() string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.FullName +} +func (t *GetAllContacts_Contacts_Edges_Node) GetID() string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.ID +} +func (t *GetAllContacts_Contacts_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllContacts_Contacts_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetAllContacts_Contacts_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return &t.Status +} +func (t *GetAllContacts_Contacts_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Tags +} +func (t *GetAllContacts_Contacts_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Title +} +func (t *GetAllContacts_Contacts_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllContacts_Contacts_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllContacts_Contacts_Edges struct { + Node *GetAllContacts_Contacts_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllContacts_Contacts_Edges) GetNode() *GetAllContacts_Contacts_Edges_Node { + if t == nil { + t = &GetAllContacts_Contacts_Edges{} + } + return t.Node +} + +type GetAllContacts_Contacts struct { + Edges []*GetAllContacts_Contacts_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllContacts_Contacts) GetEdges() []*GetAllContacts_Contacts_Edges { + if t == nil { + t = &GetAllContacts_Contacts{} + } + return t.Edges +} + +type GetContactByID_Contact struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetContactByID_Contact) GetAddress() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Address +} +func (t *GetContactByID_Contact) GetCompany() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Company +} +func (t *GetContactByID_Contact) GetCreatedAt() *time.Time { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.CreatedAt +} +func (t *GetContactByID_Contact) GetCreatedBy() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.CreatedBy +} +func (t *GetContactByID_Contact) GetEmail() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Email +} +func (t *GetContactByID_Contact) GetFullName() string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.FullName +} +func (t *GetContactByID_Contact) GetID() string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.ID +} +func (t *GetContactByID_Contact) GetOwnerID() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.OwnerID +} +func (t *GetContactByID_Contact) GetPhoneNumber() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.PhoneNumber +} +func (t *GetContactByID_Contact) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetContactByID_Contact{} + } + return &t.Status +} +func (t *GetContactByID_Contact) GetTags() []string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Tags +} +func (t *GetContactByID_Contact) GetTitle() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Title +} +func (t *GetContactByID_Contact) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.UpdatedAt +} +func (t *GetContactByID_Contact) GetUpdatedBy() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.UpdatedBy +} + +type GetContacts_Contacts_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetContacts_Contacts_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Address +} +func (t *GetContacts_Contacts_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Company +} +func (t *GetContacts_Contacts_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetContacts_Contacts_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetContacts_Contacts_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Email +} +func (t *GetContacts_Contacts_Edges_Node) GetFullName() string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.FullName +} +func (t *GetContacts_Contacts_Edges_Node) GetID() string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.ID +} +func (t *GetContacts_Contacts_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.OwnerID +} +func (t *GetContacts_Contacts_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetContacts_Contacts_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return &t.Status +} +func (t *GetContacts_Contacts_Edges_Node) GetTags() []string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Tags +} +func (t *GetContacts_Contacts_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Title +} +func (t *GetContacts_Contacts_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetContacts_Contacts_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.UpdatedBy +} + +type GetContacts_Contacts_Edges struct { + Node *GetContacts_Contacts_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetContacts_Contacts_Edges) GetNode() *GetContacts_Contacts_Edges_Node { + if t == nil { + t = &GetContacts_Contacts_Edges{} + } + return t.Node +} + +type GetContacts_Contacts struct { + Edges []*GetContacts_Contacts_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetContacts_Contacts) GetEdges() []*GetContacts_Contacts_Edges { + if t == nil { + t = &GetContacts_Contacts{} + } + return t.Edges +} + +type UpdateContact_UpdateContact_Contact struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateContact_UpdateContact_Contact) GetAddress() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Address +} +func (t *UpdateContact_UpdateContact_Contact) GetCompany() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Company +} +func (t *UpdateContact_UpdateContact_Contact) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.CreatedAt +} +func (t *UpdateContact_UpdateContact_Contact) GetCreatedBy() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.CreatedBy +} +func (t *UpdateContact_UpdateContact_Contact) GetEmail() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Email +} +func (t *UpdateContact_UpdateContact_Contact) GetFullName() string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.FullName +} +func (t *UpdateContact_UpdateContact_Contact) GetID() string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.ID +} +func (t *UpdateContact_UpdateContact_Contact) GetOwnerID() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.OwnerID +} +func (t *UpdateContact_UpdateContact_Contact) GetPhoneNumber() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.PhoneNumber +} +func (t *UpdateContact_UpdateContact_Contact) GetStatus() *enums.UserStatus { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return &t.Status +} +func (t *UpdateContact_UpdateContact_Contact) GetTags() []string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Tags +} +func (t *UpdateContact_UpdateContact_Contact) GetTitle() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Title +} +func (t *UpdateContact_UpdateContact_Contact) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.UpdatedAt +} +func (t *UpdateContact_UpdateContact_Contact) GetUpdatedBy() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.UpdatedBy +} + +type UpdateContact_UpdateContact struct { + Contact UpdateContact_UpdateContact_Contact "json:\"contact\" graphql:\"contact\"" +} + +func (t *UpdateContact_UpdateContact) GetContact() *UpdateContact_UpdateContact_Contact { + if t == nil { + t = &UpdateContact_UpdateContact{} + } + return &t.Contact +} + +type GetAllContactHistories_ContactHistories_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Address +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Company +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Email +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetFullName() string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.FullName +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Title +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllContactHistories_ContactHistories_Edges struct { + Node *GetAllContactHistories_ContactHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllContactHistories_ContactHistories_Edges) GetNode() *GetAllContactHistories_ContactHistories_Edges_Node { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges{} + } + return t.Node +} + +type GetAllContactHistories_ContactHistories struct { + Edges []*GetAllContactHistories_ContactHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllContactHistories_ContactHistories) GetEdges() []*GetAllContactHistories_ContactHistories_Edges { + if t == nil { + t = &GetAllContactHistories_ContactHistories{} + } + return t.Edges +} + +type GetContactHistories_ContactHistories_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetContactHistories_ContactHistories_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Address +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Company +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Email +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetFullName() string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.FullName +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.ID +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Title +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetContactHistories_ContactHistories_Edges struct { + Node *GetContactHistories_ContactHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetContactHistories_ContactHistories_Edges) GetNode() *GetContactHistories_ContactHistories_Edges_Node { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges{} + } + return t.Node +} + +type GetContactHistories_ContactHistories struct { + Edges []*GetContactHistories_ContactHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetContactHistories_ContactHistories) GetEdges() []*GetContactHistories_ContactHistories_Edges { + if t == nil { + t = &GetContactHistories_ContactHistories{} + } + return t.Edges +} + +type CreateDocumentData_CreateDocumentData_DocumentData struct { + ID string "json:\"id\" graphql:\"id\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetID() string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.ID +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetTemplateID() string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.TemplateID +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetData() *json.RawMessage { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return &t.Data +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.CreatedAt +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetCreatedBy() *string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.CreatedBy +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.UpdatedAt +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetUpdatedBy() *string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.UpdatedBy +} + +type CreateDocumentData_CreateDocumentData struct { + DocumentData CreateDocumentData_CreateDocumentData_DocumentData "json:\"documentData\" graphql:\"documentData\"" +} + +func (t *CreateDocumentData_CreateDocumentData) GetDocumentData() *CreateDocumentData_CreateDocumentData_DocumentData { + if t == nil { + t = &CreateDocumentData_CreateDocumentData{} + } + return &t.DocumentData +} + +type DeleteDocumentData_DeleteDocumentData struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteDocumentData_DeleteDocumentData) GetDeletedID() string { + if t == nil { + t = &DeleteDocumentData_DeleteDocumentData{} + } + return t.DeletedID +} + +type GetDocumentDataByID_DocumentData struct { + ID string "json:\"id\" graphql:\"id\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetDocumentDataByID_DocumentData) GetID() string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.ID +} +func (t *GetDocumentDataByID_DocumentData) GetTemplateID() string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.TemplateID +} +func (t *GetDocumentDataByID_DocumentData) GetData() *json.RawMessage { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return &t.Data +} +func (t *GetDocumentDataByID_DocumentData) GetCreatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.CreatedAt +} +func (t *GetDocumentDataByID_DocumentData) GetCreatedBy() *string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.CreatedBy +} +func (t *GetDocumentDataByID_DocumentData) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.UpdatedAt +} +func (t *GetDocumentDataByID_DocumentData) GetUpdatedBy() *string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.UpdatedBy +} + +type UpdateDocumentData_UpdateDocumentData_DocumentData struct { + ID string "json:\"id\" graphql:\"id\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetID() string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.ID +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetTemplateID() string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.TemplateID +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetData() *json.RawMessage { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return &t.Data +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.CreatedAt +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetCreatedBy() *string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.CreatedBy +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.UpdatedAt +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetUpdatedBy() *string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.UpdatedBy +} + +type UpdateDocumentData_UpdateDocumentData struct { + DocumentData UpdateDocumentData_UpdateDocumentData_DocumentData "json:\"documentData\" graphql:\"documentData\"" +} + +func (t *UpdateDocumentData_UpdateDocumentData) GetDocumentData() *UpdateDocumentData_UpdateDocumentData_DocumentData { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData{} + } + return &t.DocumentData +} + +type GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetData() *json.RawMessage { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Data +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTemplateID() string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.TemplateID +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllDocumentDataHistories_DocumentDataHistories_Edges struct { + Node *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges) GetNode() *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges{} + } + return t.Node +} + +type GetAllDocumentDataHistories_DocumentDataHistories struct { + Edges []*GetAllDocumentDataHistories_DocumentDataHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllDocumentDataHistories_DocumentDataHistories) GetEdges() []*GetAllDocumentDataHistories_DocumentDataHistories_Edges { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories{} + } + return t.Edges +} + +type GetDocumentDataHistories_DocumentDataHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetData() *json.RawMessage { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Data +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.ID +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTemplateID() string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.TemplateID +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetDocumentDataHistories_DocumentDataHistories_Edges struct { + Node *GetDocumentDataHistories_DocumentDataHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges) GetNode() *GetDocumentDataHistories_DocumentDataHistories_Edges_Node { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges{} + } + return t.Node +} + +type GetDocumentDataHistories_DocumentDataHistories struct { + Edges []*GetDocumentDataHistories_DocumentDataHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetDocumentDataHistories_DocumentDataHistories) GetEdges() []*GetDocumentDataHistories_DocumentDataHistories_Edges { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan{} + } + return t.Name +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization{} + } + return t.Name +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements struct { + ID string "json:\"id\" graphql:\"id\"" + Plan CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan "json:\"plan\" graphql:\"plan\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" + Organization CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetPlan() *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return &t.Plan +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExpires() bool { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.Expires +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ExpiresAt +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetCancelled() bool { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.Cancelled +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExternalCustomerID() *string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ExternalCustomerID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExternalSubscriptionID() *string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ExternalSubscriptionID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetOrganization() *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return &t.Organization +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement struct { + Entitlements []*CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements "json:\"entitlements,omitempty\" graphql:\"entitlements\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement) GetEntitlements() []*CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement{} + } + return t.Entitlements +} + +type CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan) GetID() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan{} + } + return t.ID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan) GetName() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan{} + } + return t.Name +} + +type CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization) GetID() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization{} + } + return t.ID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization) GetName() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization{} + } + return t.Name +} + +type CreateBulkEntitlement_CreateBulkEntitlement_Entitlements struct { + ID string "json:\"id\" graphql:\"id\"" + Plan CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan "json:\"plan\" graphql:\"plan\"" + Organization CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetID() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetPlan() *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return &t.Plan +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetOrganization() *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return &t.Organization +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExpires() bool { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.Expires +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ExpiresAt +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetCancelled() bool { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.Cancelled +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExternalCustomerID() *string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ExternalCustomerID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExternalSubscriptionID() *string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ExternalSubscriptionID +} + +type CreateBulkEntitlement_CreateBulkEntitlement struct { + Entitlements []*CreateBulkEntitlement_CreateBulkEntitlement_Entitlements "json:\"entitlements,omitempty\" graphql:\"entitlements\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement) GetEntitlements() []*CreateBulkEntitlement_CreateBulkEntitlement_Entitlements { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement{} + } + return t.Entitlements +} + +type CreateEntitlement_CreateEntitlement_Entitlement_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Plan) GetID() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Plan{} + } + return t.ID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Plan) GetName() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Plan{} + } + return t.Name +} + +type CreateEntitlement_CreateEntitlement_Entitlement_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Organization) GetID() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Organization{} + } + return t.ID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Organization) GetName() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Organization{} + } + return t.Name +} + +type CreateEntitlement_CreateEntitlement_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" + Plan CreateEntitlement_CreateEntitlement_Entitlement_Plan "json:\"plan\" graphql:\"plan\"" + Organization CreateEntitlement_CreateEntitlement_Entitlement_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetID() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetPlan() *CreateEntitlement_CreateEntitlement_Entitlement_Plan { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return &t.Plan +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetOrganization() *CreateEntitlement_CreateEntitlement_Entitlement_Organization { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return &t.Organization +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExpires() bool { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.Expires +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ExpiresAt +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetCancelled() bool { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.Cancelled +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExternalCustomerID() *string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ExternalCustomerID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExternalSubscriptionID() *string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ExternalSubscriptionID +} + +type CreateEntitlement_CreateEntitlement struct { + Entitlement CreateEntitlement_CreateEntitlement_Entitlement "json:\"entitlement\" graphql:\"entitlement\"" +} + +func (t *CreateEntitlement_CreateEntitlement) GetEntitlement() *CreateEntitlement_CreateEntitlement_Entitlement { + if t == nil { + t = &CreateEntitlement_CreateEntitlement{} + } + return &t.Entitlement +} + +type DeleteEntitlement_DeleteEntitlement struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntitlement_DeleteEntitlement) GetDeletedID() string { + if t == nil { + t = &DeleteEntitlement_DeleteEntitlement{} + } + return t.DeletedID +} + +type GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetName() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.Name +} + +type GetAllEntitlements_Entitlements_Edges_Node_Plan_Features struct { + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Feature GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return t.Metadata +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features) GetFeature() *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return &t.Feature +} + +type GetAllEntitlements_Entitlements_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Features []*GetAllEntitlements_Entitlements_Edges_Node_Plan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Name +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan) GetFeatures() []*GetAllEntitlements_Entitlements_Edges_Node_Plan_Features { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Features +} + +type GetAllEntitlements_Entitlements_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.Name +} + +type GetAllEntitlements_Entitlements_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Plan GetAllEntitlements_Entitlements_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" + Organization GetAllEntitlements_Entitlements_Edges_Node_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetPlan() *GetAllEntitlements_Entitlements_Edges_Node_Plan { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return &t.Plan +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetOrganization() *GetAllEntitlements_Entitlements_Edges_Node_Organization { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return &t.Organization +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.Expires +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.Cancelled +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalSubscriptionID +} + +type GetAllEntitlements_Entitlements_Edges struct { + Node *GetAllEntitlements_Entitlements_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges) GetNode() *GetAllEntitlements_Entitlements_Edges_Node { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges{} + } + return t.Node +} + +type GetAllEntitlements_Entitlements struct { + Edges []*GetAllEntitlements_Entitlements_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlements_Entitlements) GetEdges() []*GetAllEntitlements_Entitlements_Edges { + if t == nil { + t = &GetAllEntitlements_Entitlements{} + } + return t.Edges +} + +type GetEntitlementByID_Entitlement_Plan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementByID_Entitlement_Plan_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement_Plan_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features_Feature{} + } + return t.Name +} + +type GetEntitlementByID_Entitlement_Plan_Features struct { + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Feature GetEntitlementByID_Entitlement_Plan_Features_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlementByID_Entitlement_Plan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features{} + } + return t.Metadata +} +func (t *GetEntitlementByID_Entitlement_Plan_Features) GetFeature() *GetEntitlementByID_Entitlement_Plan_Features_Feature { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features{} + } + return &t.Feature +} + +type GetEntitlementByID_Entitlement_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Features []*GetEntitlementByID_Entitlement_Plan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlementByID_Entitlement_Plan) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement_Plan) GetName() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan{} + } + return t.Name +} +func (t *GetEntitlementByID_Entitlement_Plan) GetFeatures() []*GetEntitlementByID_Entitlement_Plan_Features { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan{} + } + return t.Features +} + +type GetEntitlementByID_Entitlement_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementByID_Entitlement_Organization) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Organization{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement_Organization) GetName() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Organization{} + } + return t.Name +} + +type GetEntitlementByID_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" + Plan GetEntitlementByID_Entitlement_Plan "json:\"plan\" graphql:\"plan\"" + Organization GetEntitlementByID_Entitlement_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *GetEntitlementByID_Entitlement) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement) GetPlan() *GetEntitlementByID_Entitlement_Plan { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return &t.Plan +} +func (t *GetEntitlementByID_Entitlement) GetOrganization() *GetEntitlementByID_Entitlement_Organization { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return &t.Organization +} +func (t *GetEntitlementByID_Entitlement) GetExpires() bool { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.Expires +} +func (t *GetEntitlementByID_Entitlement) GetExpiresAt() *time.Time { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ExpiresAt +} +func (t *GetEntitlementByID_Entitlement) GetCancelled() bool { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.Cancelled +} +func (t *GetEntitlementByID_Entitlement) GetExternalCustomerID() *string { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ExternalCustomerID +} +func (t *GetEntitlementByID_Entitlement) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ExternalSubscriptionID +} + +type GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.Name +} + +type GetEntitlements_Entitlements_Edges_Node_Plan_Features struct { + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Feature GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return t.Metadata +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features) GetFeature() *GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return &t.Feature +} + +type GetEntitlements_Entitlements_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Features []*GetEntitlements_Entitlements_Edges_Node_Plan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Name +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan) GetFeatures() []*GetEntitlements_Entitlements_Edges_Node_Plan_Features { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Features +} + +type GetEntitlements_Entitlements_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.Name +} + +type GetEntitlements_Entitlements_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Plan GetEntitlements_Entitlements_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" + Organization GetEntitlements_Entitlements_Edges_Node_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetPlan() *GetEntitlements_Entitlements_Edges_Node_Plan { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return &t.Plan +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetOrganization() *GetEntitlements_Entitlements_Edges_Node_Organization { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return &t.Organization +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.Expires +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.Cancelled +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalSubscriptionID +} + +type GetEntitlements_Entitlements_Edges struct { + Node *GetEntitlements_Entitlements_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlements_Entitlements_Edges) GetNode() *GetEntitlements_Entitlements_Edges_Node { + if t == nil { + t = &GetEntitlements_Entitlements_Edges{} + } + return t.Node +} + +type GetEntitlements_Entitlements struct { + Edges []*GetEntitlements_Entitlements_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlements_Entitlements) GetEdges() []*GetEntitlements_Entitlements_Edges { + if t == nil { + t = &GetEntitlements_Entitlements{} + } + return t.Edges +} + +type UpdateEntitlement_UpdateEntitlement_Entitlement_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement_Plan) GetID() string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement_Plan{} + } + return t.ID +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement_Plan) GetName() string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement_Plan{} + } + return t.Name +} + +type UpdateEntitlement_UpdateEntitlement_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" + Plan UpdateEntitlement_UpdateEntitlement_Entitlement_Plan "json:\"plan\" graphql:\"plan\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetID() string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ID +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetPlan() *UpdateEntitlement_UpdateEntitlement_Entitlement_Plan { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return &t.Plan +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExpires() bool { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.Expires +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExpiresAt() *time.Time { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ExpiresAt +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetCancelled() bool { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.Cancelled +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExternalCustomerID() *string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ExternalCustomerID +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExternalSubscriptionID() *string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ExternalSubscriptionID +} + +type UpdateEntitlement_UpdateEntitlement struct { + Entitlement UpdateEntitlement_UpdateEntitlement_Entitlement "json:\"entitlement\" graphql:\"entitlement\"" +} + +func (t *UpdateEntitlement_UpdateEntitlement) GetEntitlement() *UpdateEntitlement_UpdateEntitlement_Entitlement { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement{} + } + return &t.Entitlement +} + +type GetAllEntitlementHistories_EntitlementHistories_Edges_Node struct { + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Cancelled +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Expires +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalSubscriptionID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntitlementHistories_EntitlementHistories_Edges struct { + Node *GetAllEntitlementHistories_EntitlementHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges) GetNode() *GetAllEntitlementHistories_EntitlementHistories_Edges_Node { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges{} + } + return t.Node +} + +type GetAllEntitlementHistories_EntitlementHistories struct { + Edges []*GetAllEntitlementHistories_EntitlementHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementHistories_EntitlementHistories) GetEdges() []*GetAllEntitlementHistories_EntitlementHistories_Edges { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories{} + } + return t.Edges +} + +type GetEntitlementHistories_EntitlementHistories_Edges_Node struct { + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Cancelled +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Expires +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalSubscriptionID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntitlementHistories_EntitlementHistories_Edges struct { + Node *GetEntitlementHistories_EntitlementHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementHistories_EntitlementHistories_Edges) GetNode() *GetEntitlementHistories_EntitlementHistories_Edges_Node { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges{} + } + return t.Node +} + +type GetEntitlementHistories_EntitlementHistories struct { + Edges []*GetEntitlementHistories_EntitlementHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementHistories_EntitlementHistories) GetEdges() []*GetEntitlementHistories_EntitlementHistories_Edges { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Name +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetDisplayName() *string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.DisplayName +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Metadata +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetTags() []string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Tags +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetVersion() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Version +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Description +} + +type CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan struct { + EntitlementPlans []*CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans "json:\"entitlementPlans,omitempty\" graphql:\"entitlementPlans\"" +} + +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan) GetEntitlementPlans() []*CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan{} + } + return t.EntitlementPlans +} + +type CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetName() string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Name +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetDisplayName() *string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.DisplayName +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Metadata +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetTags() []string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Tags +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetVersion() string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Version +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetDescription() *string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Description +} + +type CreateBulkEntitlementPlan_CreateBulkEntitlementPlan struct { + EntitlementPlans []*CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans "json:\"entitlementPlans,omitempty\" graphql:\"entitlementPlans\"" +} + +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan) GetEntitlementPlans() []*CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan{} + } + return t.EntitlementPlans +} + +type CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetID() string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.ID +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetName() string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Name +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetDisplayName() *string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.DisplayName +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Metadata +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetTags() []string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Tags +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetVersion() string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Version +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetDescription() *string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Description +} + +type CreateEntitlementPlan_CreateEntitlementPlan struct { + EntitlementPlan CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan "json:\"entitlementPlan\" graphql:\"entitlementPlan\"" +} + +func (t *CreateEntitlementPlan_CreateEntitlementPlan) GetEntitlementPlan() *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan{} + } + return &t.EntitlementPlan +} + +type DeleteEntitlementPlan_DeleteEntitlementPlan struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntitlementPlan_DeleteEntitlementPlan) GetDeletedID() string { + if t == nil { + t = &DeleteEntitlementPlan_DeleteEntitlementPlan{} + } + return t.DeletedID +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetID() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.ID +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetName() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Name +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features struct { + Feature GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetFeature() *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return &t.Feature +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Tags +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Features []*GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetVersion() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Version +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetFeatures() []*GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Features +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges struct { + Node *GetAllEntitlementPlans_EntitlementPlans_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges) GetNode() *GetAllEntitlementPlans_EntitlementPlans_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlans_EntitlementPlans struct { + Edges []*GetAllEntitlementPlans_EntitlementPlans_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans) GetEdges() []*GetAllEntitlementPlans_EntitlementPlans_Edges { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans{} + } + return t.Edges +} + +type GetEntitlementPlanByID_EntitlementPlan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanByID_EntitlementPlan_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features_Feature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features_Feature{} + } + return t.Metadata +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features_Feature{} + } + return t.Name +} + +type GetEntitlementPlanByID_EntitlementPlan_Features struct { + Feature GetEntitlementPlanByID_EntitlementPlan_Features_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetEntitlementPlanByID_EntitlementPlan_Features) GetFeature() *GetEntitlementPlanByID_EntitlementPlan_Features_Feature { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features{} + } + return &t.Feature +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features{} + } + return t.Metadata +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features{} + } + return t.Tags +} + +type GetEntitlementPlanByID_EntitlementPlan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Features []*GetEntitlementPlanByID_EntitlementPlan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlementPlanByID_EntitlementPlan) GetID() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.ID +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetName() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Name +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetDisplayName() *string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.DisplayName +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Metadata +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Tags +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetVersion() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Version +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetDescription() *string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Description +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetFeatures() []*GetEntitlementPlanByID_EntitlementPlan_Features { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Features +} + +type GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Metadata +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Name +} + +type GetEntitlementPlans_EntitlementPlans_Edges_Node_Features struct { + Feature GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetFeature() *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return &t.Feature +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Metadata +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetTags() []string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Tags +} + +type GetEntitlementPlans_EntitlementPlans_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Features []*GetEntitlementPlans_EntitlementPlans_Edges_Node_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetName() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Name +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetVersion() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Version +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Description +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetFeatures() []*GetEntitlementPlans_EntitlementPlans_Edges_Node_Features { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Features +} + +type GetEntitlementPlans_EntitlementPlans_Edges struct { + Node *GetEntitlementPlans_EntitlementPlans_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges) GetNode() *GetEntitlementPlans_EntitlementPlans_Edges_Node { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges{} + } + return t.Node +} + +type GetEntitlementPlans_EntitlementPlans struct { + Edges []*GetEntitlementPlans_EntitlementPlans_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans) GetEdges() []*GetEntitlementPlans_EntitlementPlans_Edges { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans{} + } + return t.Edges +} + +type UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetID() string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.ID +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetName() string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Name +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetDisplayName() *string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.DisplayName +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetMetadata() map[string]interface{} { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Metadata +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetTags() []string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Tags +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetVersion() string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Version +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetDescription() *string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Description +} + +type UpdateEntitlementPlan_UpdateEntitlementPlan struct { + EntitlementPlan UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan "json:\"entitlementPlan\" graphql:\"entitlementPlan\"" +} + +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan) GetEntitlementPlan() *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan{} + } + return &t.EntitlementPlan +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetName() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.Name +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.Name +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Feature GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetFeature() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Feature +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetPlan() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Plan +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges struct { + Node *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges) GetNode() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures struct { + Edges []*GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures) GetEdges() []*GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures{} + } + return t.Edges +} + +type GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan{} + } + return t.Name +} + +type GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature{} + } + return t.Name +} + +type GetEntitlementPlanFeatureByID_EntitlementPlanFeature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan "json:\"plan\" graphql:\"plan\"" + Feature GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return t.Metadata +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetPlan() *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return &t.Plan +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetFeature() *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return &t.Feature +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.Name +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.Name +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" + Feature GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetPlan() *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Plan +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetFeature() *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Feature +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges struct { + Node *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges) GetNode() *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges{} + } + return t.Node +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures struct { + Edges []*GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures) GetEdges() []*GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures{} + } + return t.Edges +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetID() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.ID +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetName() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.Name +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetID() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.ID +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetName() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.Name +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan "json:\"plan\" graphql:\"plan\"" + Feature CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetID() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.ID +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.Metadata +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetPlan() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Plan +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetFeature() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Feature +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature struct { + EntitlementPlanFeature CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature "json:\"entitlementPlanFeature\" graphql:\"entitlementPlanFeature\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature) GetEntitlementPlanFeature() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature{} + } + return &t.EntitlementPlanFeature +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.Name +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.Name +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan "json:\"plan\" graphql:\"plan\"" + Feature CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.Metadata +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetPlan() *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Plan +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetFeature() *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Feature +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature struct { + EntitlementPlanFeatures []*CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures "json:\"entitlementPlanFeatures,omitempty\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature) GetEntitlementPlanFeatures() []*CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature{} + } + return t.EntitlementPlanFeatures +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetName() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.Name +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetName() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.Name +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan "json:\"plan\" graphql:\"plan\"" + Feature CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.Metadata +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetPlan() *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Plan +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetFeature() *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Feature +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature struct { + EntitlementPlanFeatures []*CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures "json:\"entitlementPlanFeatures,omitempty\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature) GetEntitlementPlanFeatures() []*CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature{} + } + return t.EntitlementPlanFeatures +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetID() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.ID +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetName() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.Name +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetID() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.ID +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetName() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.Name +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan "json:\"plan\" graphql:\"plan\"" + Feature UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetID() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.ID +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetMetadata() map[string]interface{} { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.Metadata +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetPlan() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Plan +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetFeature() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Feature +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature struct { + EntitlementPlanFeature UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature "json:\"entitlementPlanFeature\" graphql:\"entitlementPlanFeature\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature) GetEntitlementPlanFeature() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature{} + } + return &t.EntitlementPlanFeature +} + +type DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature) GetDeletedID() string { + if t == nil { + t = &DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature{} + } + return t.DeletedID +} + +type GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FeatureID string "json:\"featureID\" graphql:\"featureID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetFeatureID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.FeatureID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges struct { + Node *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges) GetNode() *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories struct { + Edges []*GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories) GetEdges() []*GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories{} + } + return t.Edges +} + +type GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FeatureID string "json:\"featureID\" graphql:\"featureID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetFeatureID() string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.FeatureID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges struct { + Node *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges) GetNode() *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges{} + } + return t.Node +} + +type GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories struct { + Edges []*GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories) GetEdges() []*GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories{} + } + return t.Edges +} + +type GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Version string "json:\"version\" graphql:\"version\"" +} + +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetVersion() string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Version +} + +type GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges struct { + Node *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges) GetNode() *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlanHistories_EntitlementPlanHistories struct { + Edges []*GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories) GetEdges() []*GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories{} + } + return t.Edges +} + +type GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Version string "json:\"version\" graphql:\"version\"" +} + +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Description +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Name +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetVersion() string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Version +} + +type GetEntitlementPlanHistories_EntitlementPlanHistories_Edges struct { + Node *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges) GetNode() *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges{} + } + return t.Node +} + +type GetEntitlementPlanHistories_EntitlementPlanHistories struct { + Edges []*GetEntitlementPlanHistories_EntitlementPlanHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories) GetEdges() []*GetEntitlementPlanHistories_EntitlementPlanHistories_Edges { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes) GetText() string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes{} + } + return t.Text +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes{} + } + return t.UpdatedBy +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType) GetName() string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType{} + } + return t.Name +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity_Entities struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.CreatedAt +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.CreatedBy +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Description +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetDisplayName() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.DisplayName +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetStatus() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Status +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetDomains() []string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Domains +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetNotes() []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Notes +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetEntityType() *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.EntityType +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetID() string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.ID +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetName() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Name +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.OwnerID +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetTags() []string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Tags +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.UpdatedBy +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity struct { + Entities []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities "json:\"entities,omitempty\" graphql:\"entities\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity) GetEntities() []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity{} + } + return t.Entities +} + +type CreateBulkEntity_CreateBulkEntity_Entities_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity_Entities_Notes) GetText() string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_Notes{} + } + return t.Text +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_Notes{} + } + return t.UpdatedAt +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities_Notes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_Notes{} + } + return t.UpdatedBy +} + +type CreateBulkEntity_CreateBulkEntity_Entities_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity_Entities_EntityType) GetName() string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_EntityType{} + } + return t.Name +} + +type CreateBulkEntity_CreateBulkEntity_Entities struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*CreateBulkEntity_CreateBulkEntity_Entities_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *CreateBulkEntity_CreateBulkEntity_Entities_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.CreatedAt +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.CreatedBy +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetDescription() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Description +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetDisplayName() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.DisplayName +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetStatus() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Status +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetDomains() []string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Domains +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetNotes() []*CreateBulkEntity_CreateBulkEntity_Entities_Notes { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Notes +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetEntityType() *CreateBulkEntity_CreateBulkEntity_Entities_EntityType { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.EntityType +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetID() string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.ID +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetName() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Name +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetOwnerID() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.OwnerID +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetTags() []string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Tags +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.UpdatedAt +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.UpdatedBy +} + +type CreateBulkEntity_CreateBulkEntity struct { + Entities []*CreateBulkEntity_CreateBulkEntity_Entities "json:\"entities,omitempty\" graphql:\"entities\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity) GetEntities() []*CreateBulkEntity_CreateBulkEntity_Entities { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity{} + } + return t.Entities +} + +type CreateEntity_CreateEntity_Entity_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateEntity_CreateEntity_Entity_Notes) GetText() string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_Notes{} + } + return t.Text +} +func (t *CreateEntity_CreateEntity_Entity_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_Notes{} + } + return t.UpdatedAt +} +func (t *CreateEntity_CreateEntity_Entity_Notes) GetUpdatedBy() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_Notes{} + } + return t.UpdatedBy +} + +type CreateEntity_CreateEntity_Entity_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntity_CreateEntity_Entity_EntityType) GetName() string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_EntityType{} + } + return t.Name +} + +type CreateEntity_CreateEntity_Entity struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*CreateEntity_CreateEntity_Entity_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *CreateEntity_CreateEntity_Entity_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateEntity_CreateEntity_Entity) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.CreatedAt +} +func (t *CreateEntity_CreateEntity_Entity) GetCreatedBy() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.CreatedBy +} +func (t *CreateEntity_CreateEntity_Entity) GetDescription() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Description +} +func (t *CreateEntity_CreateEntity_Entity) GetDisplayName() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.DisplayName +} +func (t *CreateEntity_CreateEntity_Entity) GetStatus() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Status +} +func (t *CreateEntity_CreateEntity_Entity) GetDomains() []string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Domains +} +func (t *CreateEntity_CreateEntity_Entity) GetNotes() []*CreateEntity_CreateEntity_Entity_Notes { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Notes +} +func (t *CreateEntity_CreateEntity_Entity) GetEntityType() *CreateEntity_CreateEntity_Entity_EntityType { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.EntityType +} +func (t *CreateEntity_CreateEntity_Entity) GetID() string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.ID +} +func (t *CreateEntity_CreateEntity_Entity) GetName() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Name +} +func (t *CreateEntity_CreateEntity_Entity) GetOwnerID() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.OwnerID +} +func (t *CreateEntity_CreateEntity_Entity) GetTags() []string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Tags +} +func (t *CreateEntity_CreateEntity_Entity) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.UpdatedAt +} +func (t *CreateEntity_CreateEntity_Entity) GetUpdatedBy() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.UpdatedBy +} + +type CreateEntity_CreateEntity struct { + Entity CreateEntity_CreateEntity_Entity "json:\"entity\" graphql:\"entity\"" +} + +func (t *CreateEntity_CreateEntity) GetEntity() *CreateEntity_CreateEntity_Entity { + if t == nil { + t = &CreateEntity_CreateEntity{} + } + return &t.Entity +} + +type DeleteEntity_DeleteEntity struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntity_DeleteEntity) GetDeletedID() string { + if t == nil { + t = &DeleteEntity_DeleteEntity{} + } + return t.DeletedID +} + +type GetAllEntities_Entities_Edges_Node_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntities_Entities_Edges_Node_Notes) GetText() string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_Notes{} + } + return t.Text +} +func (t *GetAllEntities_Entities_Edges_Node_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedAt +} +func (t *GetAllEntities_Entities_Edges_Node_Notes) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedBy +} + +type GetAllEntities_Entities_Edges_Node_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntities_Entities_Edges_Node_EntityType) GetName() string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_EntityType{} + } + return t.Name +} + +type GetAllEntities_Entities_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*GetAllEntities_Entities_Edges_Node_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *GetAllEntities_Entities_Edges_Node_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntities_Entities_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntities_Entities_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntities_Entities_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntities_Entities_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntities_Entities_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Status +} +func (t *GetAllEntities_Entities_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Domains +} +func (t *GetAllEntities_Entities_Edges_Node) GetNotes() []*GetAllEntities_Entities_Edges_Node_Notes { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Notes +} +func (t *GetAllEntities_Entities_Edges_Node) GetEntityType() *GetAllEntities_Entities_Edges_Node_EntityType { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.EntityType +} +func (t *GetAllEntities_Entities_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntities_Entities_Edges_Node) GetName() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntities_Entities_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntities_Entities_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntities_Entities_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntities_Entities_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntities_Entities_Edges struct { + Node *GetAllEntities_Entities_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntities_Entities_Edges) GetNode() *GetAllEntities_Entities_Edges_Node { + if t == nil { + t = &GetAllEntities_Entities_Edges{} + } + return t.Node +} + +type GetAllEntities_Entities struct { + Edges []*GetAllEntities_Entities_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntities_Entities) GetEdges() []*GetAllEntities_Entities_Edges { + if t == nil { + t = &GetAllEntities_Entities{} + } + return t.Edges +} + +type GetEntities_Entities_Edges_Node_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntities_Entities_Edges_Node_Notes) GetText() string { + if t == nil { + t = &GetEntities_Entities_Edges_Node_Notes{} + } + return t.Text +} +func (t *GetEntities_Entities_Edges_Node_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedAt +} +func (t *GetEntities_Entities_Edges_Node_Notes) GetUpdatedBy() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedBy +} + +type GetEntities_Entities_Edges_Node_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntities_Entities_Edges_Node_EntityType) GetName() string { + if t == nil { + t = &GetEntities_Entities_Edges_Node_EntityType{} + } + return t.Name +} + +type GetEntities_Entities_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*GetEntities_Entities_Edges_Node_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *GetEntities_Entities_Edges_Node_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntities_Entities_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntities_Entities_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntities_Entities_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Description +} +func (t *GetEntities_Entities_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntities_Entities_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Status +} +func (t *GetEntities_Entities_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Domains +} +func (t *GetEntities_Entities_Edges_Node) GetNotes() []*GetEntities_Entities_Edges_Node_Notes { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Notes +} +func (t *GetEntities_Entities_Edges_Node) GetEntityType() *GetEntities_Entities_Edges_Node_EntityType { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.EntityType +} +func (t *GetEntities_Entities_Edges_Node) GetID() string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.ID +} +func (t *GetEntities_Entities_Edges_Node) GetName() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Name +} +func (t *GetEntities_Entities_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntities_Entities_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Tags +} +func (t *GetEntities_Entities_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntities_Entities_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntities_Entities_Edges struct { + Node *GetEntities_Entities_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntities_Entities_Edges) GetNode() *GetEntities_Entities_Edges_Node { + if t == nil { + t = &GetEntities_Entities_Edges{} + } + return t.Node +} + +type GetEntities_Entities struct { + Edges []*GetEntities_Entities_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntities_Entities) GetEdges() []*GetEntities_Entities_Edges { + if t == nil { + t = &GetEntities_Entities{} + } + return t.Edges +} + +type GetEntityByID_Entity_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityByID_Entity_Notes) GetText() string { + if t == nil { + t = &GetEntityByID_Entity_Notes{} + } + return t.Text +} +func (t *GetEntityByID_Entity_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityByID_Entity_Notes{} + } + return t.UpdatedAt +} +func (t *GetEntityByID_Entity_Notes) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityByID_Entity_Notes{} + } + return t.UpdatedBy +} + +type GetEntityByID_Entity_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntityByID_Entity_EntityType) GetName() string { + if t == nil { + t = &GetEntityByID_Entity_EntityType{} + } + return t.Name +} + +type GetEntityByID_Entity_Contacts struct { + ID string "json:\"id\" graphql:\"id\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + Address *string "json:\"address,omitempty\" graphql:\"address\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" +} + +func (t *GetEntityByID_Entity_Contacts) GetID() string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.ID +} +func (t *GetEntityByID_Entity_Contacts) GetFullName() string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.FullName +} +func (t *GetEntityByID_Entity_Contacts) GetEmail() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Email +} +func (t *GetEntityByID_Entity_Contacts) GetTitle() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Title +} +func (t *GetEntityByID_Entity_Contacts) GetCompany() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Company +} +func (t *GetEntityByID_Entity_Contacts) GetAddress() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Address +} +func (t *GetEntityByID_Entity_Contacts) GetPhoneNumber() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.PhoneNumber +} + +type GetEntityByID_Entity struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*GetEntityByID_Entity_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *GetEntityByID_Entity_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Contacts []*GetEntityByID_Entity_Contacts "json:\"contacts,omitempty\" graphql:\"contacts\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityByID_Entity) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.CreatedAt +} +func (t *GetEntityByID_Entity) GetCreatedBy() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.CreatedBy +} +func (t *GetEntityByID_Entity) GetDescription() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Description +} +func (t *GetEntityByID_Entity) GetDisplayName() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.DisplayName +} +func (t *GetEntityByID_Entity) GetStatus() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Status +} +func (t *GetEntityByID_Entity) GetDomains() []string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Domains +} +func (t *GetEntityByID_Entity) GetNotes() []*GetEntityByID_Entity_Notes { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Notes +} +func (t *GetEntityByID_Entity) GetEntityType() *GetEntityByID_Entity_EntityType { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.EntityType +} +func (t *GetEntityByID_Entity) GetID() string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.ID +} +func (t *GetEntityByID_Entity) GetName() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Name +} +func (t *GetEntityByID_Entity) GetOwnerID() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.OwnerID +} +func (t *GetEntityByID_Entity) GetContacts() []*GetEntityByID_Entity_Contacts { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Contacts +} +func (t *GetEntityByID_Entity) GetTags() []string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Tags +} +func (t *GetEntityByID_Entity) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.UpdatedAt +} +func (t *GetEntityByID_Entity) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.UpdatedBy +} + +type UpdateEntity_UpdateEntity_Entity_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateEntity_UpdateEntity_Entity_Notes) GetText() string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_Notes{} + } + return t.Text +} +func (t *UpdateEntity_UpdateEntity_Entity_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_Notes{} + } + return t.UpdatedAt +} +func (t *UpdateEntity_UpdateEntity_Entity_Notes) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_Notes{} + } + return t.UpdatedBy +} + +type UpdateEntity_UpdateEntity_Entity_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntity_UpdateEntity_Entity_EntityType) GetName() string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_EntityType{} + } + return t.Name +} + +type UpdateEntity_UpdateEntity_Entity struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*UpdateEntity_UpdateEntity_Entity_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *UpdateEntity_UpdateEntity_Entity_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateEntity_UpdateEntity_Entity) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.CreatedAt +} +func (t *UpdateEntity_UpdateEntity_Entity) GetCreatedBy() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.CreatedBy +} +func (t *UpdateEntity_UpdateEntity_Entity) GetDescription() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Description +} +func (t *UpdateEntity_UpdateEntity_Entity) GetDisplayName() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.DisplayName +} +func (t *UpdateEntity_UpdateEntity_Entity) GetStatus() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Status +} +func (t *UpdateEntity_UpdateEntity_Entity) GetDomains() []string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Domains +} +func (t *UpdateEntity_UpdateEntity_Entity) GetNotes() []*UpdateEntity_UpdateEntity_Entity_Notes { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Notes +} +func (t *UpdateEntity_UpdateEntity_Entity) GetEntityType() *UpdateEntity_UpdateEntity_Entity_EntityType { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.EntityType +} +func (t *UpdateEntity_UpdateEntity_Entity) GetID() string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.ID +} +func (t *UpdateEntity_UpdateEntity_Entity) GetName() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Name +} +func (t *UpdateEntity_UpdateEntity_Entity) GetOwnerID() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.OwnerID +} +func (t *UpdateEntity_UpdateEntity_Entity) GetTags() []string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Tags +} +func (t *UpdateEntity_UpdateEntity_Entity) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.UpdatedAt +} +func (t *UpdateEntity_UpdateEntity_Entity) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.UpdatedBy +} + +type UpdateEntity_UpdateEntity struct { + Entity UpdateEntity_UpdateEntity_Entity "json:\"entity\" graphql:\"entity\"" +} + +func (t *UpdateEntity_UpdateEntity) GetEntity() *UpdateEntity_UpdateEntity_Entity { + if t == nil { + t = &UpdateEntity_UpdateEntity{} + } + return &t.Entity +} + +type GetAllEntityHistories_EntityHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + EntityTypeID *string "json:\"entityTypeID,omitempty\" graphql:\"entityTypeID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetEntityTypeID() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.EntityTypeID +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetName() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Status +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntityHistories_EntityHistories_Edges struct { + Node *GetAllEntityHistories_EntityHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntityHistories_EntityHistories_Edges) GetNode() *GetAllEntityHistories_EntityHistories_Edges_Node { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges{} + } + return t.Node +} + +type GetAllEntityHistories_EntityHistories struct { + Edges []*GetAllEntityHistories_EntityHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntityHistories_EntityHistories) GetEdges() []*GetAllEntityHistories_EntityHistories_Edges { + if t == nil { + t = &GetAllEntityHistories_EntityHistories{} + } + return t.Edges +} + +type GetEntityHistories_EntityHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + EntityTypeID *string "json:\"entityTypeID,omitempty\" graphql:\"entityTypeID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Description +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetEntityTypeID() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.EntityTypeID +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetName() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Name +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Status +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntityHistories_EntityHistories_Edges struct { + Node *GetEntityHistories_EntityHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntityHistories_EntityHistories_Edges) GetNode() *GetEntityHistories_EntityHistories_Edges_Node { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges{} + } + return t.Node +} + +type GetEntityHistories_EntityHistories struct { + Edges []*GetEntityHistories_EntityHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntityHistories_EntityHistories) GetEdges() []*GetEntityHistories_EntityHistories_Edges { + if t == nil { + t = &GetEntityHistories_EntityHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.CreatedAt +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.CreatedBy +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetID() string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.ID +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetName() string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.Name +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.OwnerID +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetTags() []string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.Tags +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.UpdatedBy +} + +type CreateBulkCSVEntityType_CreateBulkCSVEntityType struct { + EntityTypes []*CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes "json:\"entityTypes,omitempty\" graphql:\"entityTypes\"" +} + +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType) GetEntityTypes() []*CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType{} + } + return t.EntityTypes +} + +type CreateBulkEntityType_CreateBulkEntityType_EntityTypes struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.CreatedAt +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.CreatedBy +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetID() string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.ID +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetName() string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.Name +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetOwnerID() *string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.OwnerID +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetTags() []string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.Tags +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.UpdatedAt +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.UpdatedBy +} + +type CreateBulkEntityType_CreateBulkEntityType struct { + EntityTypes []*CreateBulkEntityType_CreateBulkEntityType_EntityTypes "json:\"entityTypes,omitempty\" graphql:\"entityTypes\"" +} + +func (t *CreateBulkEntityType_CreateBulkEntityType) GetEntityTypes() []*CreateBulkEntityType_CreateBulkEntityType_EntityTypes { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType{} + } + return t.EntityTypes +} + +type CreateEntityType_CreateEntityType_EntityType struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateEntityType_CreateEntityType_EntityType) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.CreatedAt +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetCreatedBy() *string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.CreatedBy +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetID() string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.ID +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetName() string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.Name +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetOwnerID() *string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.OwnerID +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetTags() []string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.Tags +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.UpdatedAt +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetUpdatedBy() *string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.UpdatedBy +} + +type CreateEntityType_CreateEntityType struct { + EntityType CreateEntityType_CreateEntityType_EntityType "json:\"entityType\" graphql:\"entityType\"" +} + +func (t *CreateEntityType_CreateEntityType) GetEntityType() *CreateEntityType_CreateEntityType_EntityType { + if t == nil { + t = &CreateEntityType_CreateEntityType{} + } + return &t.EntityType +} + +type DeleteEntityType_DeleteEntityType struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntityType_DeleteEntityType) GetDeletedID() string { + if t == nil { + t = &DeleteEntityType_DeleteEntityType{} + } + return t.DeletedID +} + +type GetAllEntityTypes_EntityTypes_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntityTypes_EntityTypes_Edges struct { + Node *GetAllEntityTypes_EntityTypes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntityTypes_EntityTypes_Edges) GetNode() *GetAllEntityTypes_EntityTypes_Edges_Node { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges{} + } + return t.Node +} + +type GetAllEntityTypes_EntityTypes struct { + Edges []*GetAllEntityTypes_EntityTypes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntityTypes_EntityTypes) GetEdges() []*GetAllEntityTypes_EntityTypes_Edges { + if t == nil { + t = &GetAllEntityTypes_EntityTypes{} + } + return t.Edges +} + +type GetEntityTypeByID_EntityType struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityTypeByID_EntityType) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.CreatedAt +} +func (t *GetEntityTypeByID_EntityType) GetCreatedBy() *string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.CreatedBy +} +func (t *GetEntityTypeByID_EntityType) GetID() string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.ID +} +func (t *GetEntityTypeByID_EntityType) GetName() string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.Name +} +func (t *GetEntityTypeByID_EntityType) GetOwnerID() *string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.OwnerID +} +func (t *GetEntityTypeByID_EntityType) GetTags() []string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.Tags +} +func (t *GetEntityTypeByID_EntityType) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.UpdatedAt +} +func (t *GetEntityTypeByID_EntityType) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.UpdatedBy +} + +type GetEntityTypes_EntityTypes_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetID() string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.ID +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetName() string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.Name +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.Tags +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntityTypes_EntityTypes_Edges struct { + Node *GetEntityTypes_EntityTypes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntityTypes_EntityTypes_Edges) GetNode() *GetEntityTypes_EntityTypes_Edges_Node { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges{} + } + return t.Node +} + +type GetEntityTypes_EntityTypes struct { + Edges []*GetEntityTypes_EntityTypes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntityTypes_EntityTypes) GetEdges() []*GetEntityTypes_EntityTypes_Edges { + if t == nil { + t = &GetEntityTypes_EntityTypes{} + } + return t.Edges +} + +type UpdateEntityType_UpdateEntityType_EntityType struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.CreatedAt +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetCreatedBy() *string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.CreatedBy +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetID() string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.ID +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetName() string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.Name +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetOwnerID() *string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.OwnerID +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetTags() []string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.Tags +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.UpdatedAt +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.UpdatedBy +} + +type UpdateEntityType_UpdateEntityType struct { + EntityType UpdateEntityType_UpdateEntityType_EntityType "json:\"entityType\" graphql:\"entityType\"" +} + +func (t *UpdateEntityType_UpdateEntityType) GetEntityType() *UpdateEntityType_UpdateEntityType_EntityType { + if t == nil { + t = &UpdateEntityType_UpdateEntityType{} + } + return &t.EntityType +} + +type GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntityTypeHistories_EntityTypeHistories_Edges struct { + Node *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges) GetNode() *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges{} + } + return t.Node +} + +type GetAllEntityTypeHistories_EntityTypeHistories struct { + Edges []*GetAllEntityTypeHistories_EntityTypeHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntityTypeHistories_EntityTypeHistories) GetEdges() []*GetAllEntityTypeHistories_EntityTypeHistories_Edges { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories{} + } + return t.Edges +} + +type GetEntityTypeHistories_EntityTypeHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Name +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntityTypeHistories_EntityTypeHistories_Edges struct { + Node *GetEntityTypeHistories_EntityTypeHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges) GetNode() *GetEntityTypeHistories_EntityTypeHistories_Edges_Node { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges{} + } + return t.Node +} + +type GetEntityTypeHistories_EntityTypeHistories struct { + Edges []*GetEntityTypeHistories_EntityTypeHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntityTypeHistories_EntityTypeHistories) GetEdges() []*GetEntityTypeHistories_EntityTypeHistories_Edges { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories{} + } + return t.Edges +} + +type GetEvents_Events_Edges_Node struct { + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + ID string "json:\"id\" graphql:\"id\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" +} + +func (t *GetEvents_Events_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.EventID +} +func (t *GetEvents_Events_Edges_Node) GetID() string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.ID +} +func (t *GetEvents_Events_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetEvents_Events_Edges_Node) GetEventType() string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.EventType +} +func (t *GetEvents_Events_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.Metadata +} + +type GetEvents_Events_Edges struct { + Node *GetEvents_Events_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEvents_Events_Edges) GetNode() *GetEvents_Events_Edges_Node { + if t == nil { + t = &GetEvents_Events_Edges{} + } + return t.Node +} + +type GetEvents_Events struct { + Edges []*GetEvents_Events_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEvents_Events) GetEdges() []*GetEvents_Events_Edges { + if t == nil { + t = &GetEvents_Events{} + } + return t.Edges +} + +type GetEventByID_Event_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_User) GetID() string { + if t == nil { + t = &GetEventByID_Event_User{} + } + return t.ID +} + +type GetEventByID_Event_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Group) GetID() string { + if t == nil { + t = &GetEventByID_Event_Group{} + } + return t.ID +} + +type GetEventByID_Event_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Integration) GetID() string { + if t == nil { + t = &GetEventByID_Event_Integration{} + } + return t.ID +} + +type GetEventByID_Event_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Organization) GetID() string { + if t == nil { + t = &GetEventByID_Event_Organization{} + } + return t.ID +} + +type GetEventByID_Event_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Invite) GetID() string { + if t == nil { + t = &GetEventByID_Event_Invite{} + } + return t.ID +} + +type GetEventByID_Event_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Feature) GetID() string { + if t == nil { + t = &GetEventByID_Event_Feature{} + } + return t.ID +} + +type GetEventByID_Event_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_PersonalAccessToken) GetID() string { + if t == nil { + t = &GetEventByID_Event_PersonalAccessToken{} + } + return t.ID +} + +type GetEventByID_Event_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Oauth2token) GetID() string { + if t == nil { + t = &GetEventByID_Event_Oauth2token{} + } + return t.ID +} + +type GetEventByID_Event_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Hush) GetID() string { + if t == nil { + t = &GetEventByID_Event_Hush{} + } + return t.ID +} + +type GetEventByID_Event_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Orgmembership) GetID() string { + if t == nil { + t = &GetEventByID_Event_Orgmembership{} + } + return t.ID +} + +type GetEventByID_Event_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Groupmembership) GetID() string { + if t == nil { + t = &GetEventByID_Event_Groupmembership{} + } + return t.ID +} + +type GetEventByID_Event_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Entitlement) GetID() string { + if t == nil { + t = &GetEventByID_Event_Entitlement{} + } + return t.ID +} + +type GetEventByID_Event_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Webhook) GetID() string { + if t == nil { + t = &GetEventByID_Event_Webhook{} + } + return t.ID +} + +type GetEventByID_Event struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*GetEventByID_Event_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*GetEventByID_Event_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*GetEventByID_Event_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*GetEventByID_Event_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*GetEventByID_Event_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*GetEventByID_Event_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*GetEventByID_Event_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*GetEventByID_Event_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*GetEventByID_Event_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*GetEventByID_Event_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*GetEventByID_Event_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*GetEventByID_Event_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*GetEventByID_Event_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *GetEventByID_Event) GetID() string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.ID +} +func (t *GetEventByID_Event) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEventByID_Event{} + } + return t.CreatedAt +} +func (t *GetEventByID_Event) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEventByID_Event{} + } + return t.UpdatedAt +} +func (t *GetEventByID_Event) GetCreatedBy() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.CreatedBy +} +func (t *GetEventByID_Event) GetUpdatedBy() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.UpdatedBy +} +func (t *GetEventByID_Event) GetEventID() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.EventID +} +func (t *GetEventByID_Event) GetCorrelationID() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.CorrelationID +} +func (t *GetEventByID_Event) GetEventType() string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.EventType +} +func (t *GetEventByID_Event) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Metadata +} +func (t *GetEventByID_Event) GetUser() []*GetEventByID_Event_User { + if t == nil { + t = &GetEventByID_Event{} + } + return t.User +} +func (t *GetEventByID_Event) GetGroup() []*GetEventByID_Event_Group { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Group +} +func (t *GetEventByID_Event) GetIntegration() []*GetEventByID_Event_Integration { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Integration +} +func (t *GetEventByID_Event) GetOrganization() []*GetEventByID_Event_Organization { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Organization +} +func (t *GetEventByID_Event) GetInvite() []*GetEventByID_Event_Invite { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Invite +} +func (t *GetEventByID_Event) GetFeature() []*GetEventByID_Event_Feature { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Feature +} +func (t *GetEventByID_Event) GetPersonalAccessToken() []*GetEventByID_Event_PersonalAccessToken { + if t == nil { + t = &GetEventByID_Event{} + } + return t.PersonalAccessToken +} +func (t *GetEventByID_Event) GetOauth2token() []*GetEventByID_Event_Oauth2token { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Oauth2token +} +func (t *GetEventByID_Event) GetHush() []*GetEventByID_Event_Hush { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Hush +} +func (t *GetEventByID_Event) GetOrgmembership() []*GetEventByID_Event_Orgmembership { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Orgmembership +} +func (t *GetEventByID_Event) GetGroupmembership() []*GetEventByID_Event_Groupmembership { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Groupmembership +} +func (t *GetEventByID_Event) GetEntitlement() []*GetEventByID_Event_Entitlement { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Entitlement +} +func (t *GetEventByID_Event) GetWebhook() []*GetEventByID_Event_Webhook { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Webhook +} + +type GetAllEvents_Events_Edges_Node_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_User) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_User{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Group{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Integration) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Integration{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Organization{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Invite) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Invite{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Feature) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Feature{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_PersonalAccessToken) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_PersonalAccessToken{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Oauth2token) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Oauth2token{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Hush) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Hush{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Orgmembership) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Orgmembership{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Groupmembership) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Groupmembership{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Entitlement) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Entitlement{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Webhook) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Webhook{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*GetAllEvents_Events_Edges_Node_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*GetAllEvents_Events_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*GetAllEvents_Events_Edges_Node_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*GetAllEvents_Events_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*GetAllEvents_Events_Edges_Node_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*GetAllEvents_Events_Edges_Node_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*GetAllEvents_Events_Edges_Node_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*GetAllEvents_Events_Edges_Node_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*GetAllEvents_Events_Edges_Node_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*GetAllEvents_Events_Edges_Node_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*GetAllEvents_Events_Edges_Node_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*GetAllEvents_Events_Edges_Node_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*GetAllEvents_Events_Edges_Node_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *GetAllEvents_Events_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.ID +} +func (t *GetAllEvents_Events_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEvents_Events_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEvents_Events_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEvents_Events_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllEvents_Events_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.EventID +} +func (t *GetAllEvents_Events_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetAllEvents_Events_Edges_Node) GetEventType() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.EventType +} +func (t *GetAllEvents_Events_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEvents_Events_Edges_Node) GetUser() []*GetAllEvents_Events_Edges_Node_User { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.User +} +func (t *GetAllEvents_Events_Edges_Node) GetGroup() []*GetAllEvents_Events_Edges_Node_Group { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Group +} +func (t *GetAllEvents_Events_Edges_Node) GetIntegration() []*GetAllEvents_Events_Edges_Node_Integration { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Integration +} +func (t *GetAllEvents_Events_Edges_Node) GetOrganization() []*GetAllEvents_Events_Edges_Node_Organization { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Organization +} +func (t *GetAllEvents_Events_Edges_Node) GetInvite() []*GetAllEvents_Events_Edges_Node_Invite { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Invite +} +func (t *GetAllEvents_Events_Edges_Node) GetFeature() []*GetAllEvents_Events_Edges_Node_Feature { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Feature +} +func (t *GetAllEvents_Events_Edges_Node) GetPersonalAccessToken() []*GetAllEvents_Events_Edges_Node_PersonalAccessToken { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.PersonalAccessToken +} +func (t *GetAllEvents_Events_Edges_Node) GetOauth2token() []*GetAllEvents_Events_Edges_Node_Oauth2token { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Oauth2token +} +func (t *GetAllEvents_Events_Edges_Node) GetHush() []*GetAllEvents_Events_Edges_Node_Hush { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Hush +} +func (t *GetAllEvents_Events_Edges_Node) GetOrgmembership() []*GetAllEvents_Events_Edges_Node_Orgmembership { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Orgmembership +} +func (t *GetAllEvents_Events_Edges_Node) GetGroupmembership() []*GetAllEvents_Events_Edges_Node_Groupmembership { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Groupmembership +} +func (t *GetAllEvents_Events_Edges_Node) GetEntitlement() []*GetAllEvents_Events_Edges_Node_Entitlement { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Entitlement +} +func (t *GetAllEvents_Events_Edges_Node) GetWebhook() []*GetAllEvents_Events_Edges_Node_Webhook { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Webhook +} + +type GetAllEvents_Events_Edges struct { + Node *GetAllEvents_Events_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEvents_Events_Edges) GetNode() *GetAllEvents_Events_Edges_Node { + if t == nil { + t = &GetAllEvents_Events_Edges{} + } + return t.Node +} + +type GetAllEvents_Events struct { + Edges []*GetAllEvents_Events_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEvents_Events) GetEdges() []*GetAllEvents_Events_Edges { + if t == nil { + t = &GetAllEvents_Events{} + } + return t.Edges +} + +type CreateEvent_CreateEvent_Event_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_User) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_User{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Group) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Group{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Integration) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Integration{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Organization) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Organization{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Invite) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Invite{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Feature) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Feature{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_PersonalAccessToken{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Oauth2token) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Oauth2token{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Hush) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Hush{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Orgmembership) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Orgmembership{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Groupmembership) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Groupmembership{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Entitlement) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Entitlement{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Webhook) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Webhook{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event struct { + ID string "json:\"id\" graphql:\"id\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*CreateEvent_CreateEvent_Event_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*CreateEvent_CreateEvent_Event_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*CreateEvent_CreateEvent_Event_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*CreateEvent_CreateEvent_Event_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*CreateEvent_CreateEvent_Event_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*CreateEvent_CreateEvent_Event_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*CreateEvent_CreateEvent_Event_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*CreateEvent_CreateEvent_Event_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*CreateEvent_CreateEvent_Event_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*CreateEvent_CreateEvent_Event_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*CreateEvent_CreateEvent_Event_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*CreateEvent_CreateEvent_Event_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*CreateEvent_CreateEvent_Event_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *CreateEvent_CreateEvent_Event) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.ID +} +func (t *CreateEvent_CreateEvent_Event) GetEventID() *string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.EventID +} +func (t *CreateEvent_CreateEvent_Event) GetCorrelationID() *string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.CorrelationID +} +func (t *CreateEvent_CreateEvent_Event) GetEventType() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.EventType +} +func (t *CreateEvent_CreateEvent_Event) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Metadata +} +func (t *CreateEvent_CreateEvent_Event) GetUser() []*CreateEvent_CreateEvent_Event_User { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.User +} +func (t *CreateEvent_CreateEvent_Event) GetGroup() []*CreateEvent_CreateEvent_Event_Group { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Group +} +func (t *CreateEvent_CreateEvent_Event) GetIntegration() []*CreateEvent_CreateEvent_Event_Integration { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Integration +} +func (t *CreateEvent_CreateEvent_Event) GetOrganization() []*CreateEvent_CreateEvent_Event_Organization { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Organization +} +func (t *CreateEvent_CreateEvent_Event) GetInvite() []*CreateEvent_CreateEvent_Event_Invite { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Invite +} +func (t *CreateEvent_CreateEvent_Event) GetFeature() []*CreateEvent_CreateEvent_Event_Feature { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Feature +} +func (t *CreateEvent_CreateEvent_Event) GetPersonalAccessToken() []*CreateEvent_CreateEvent_Event_PersonalAccessToken { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.PersonalAccessToken +} +func (t *CreateEvent_CreateEvent_Event) GetOauth2token() []*CreateEvent_CreateEvent_Event_Oauth2token { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Oauth2token +} +func (t *CreateEvent_CreateEvent_Event) GetHush() []*CreateEvent_CreateEvent_Event_Hush { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Hush +} +func (t *CreateEvent_CreateEvent_Event) GetOrgmembership() []*CreateEvent_CreateEvent_Event_Orgmembership { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Orgmembership +} +func (t *CreateEvent_CreateEvent_Event) GetGroupmembership() []*CreateEvent_CreateEvent_Event_Groupmembership { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Groupmembership +} +func (t *CreateEvent_CreateEvent_Event) GetEntitlement() []*CreateEvent_CreateEvent_Event_Entitlement { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Entitlement +} +func (t *CreateEvent_CreateEvent_Event) GetWebhook() []*CreateEvent_CreateEvent_Event_Webhook { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Webhook +} + +type CreateEvent_CreateEvent struct { + Event CreateEvent_CreateEvent_Event "json:\"event\" graphql:\"event\"" +} + +func (t *CreateEvent_CreateEvent) GetEvent() *CreateEvent_CreateEvent_Event { + if t == nil { + t = &CreateEvent_CreateEvent{} + } + return &t.Event +} + +type CreateBulkEvent_CreateBulkEvent_Events_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_User) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_User{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Group) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Group{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Integration) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Integration{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Organization) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Organization{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Invite) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Invite{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Feature) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Feature{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Oauth2token) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Oauth2token{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Hush) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Hush{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Orgmembership) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Orgmembership{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Groupmembership) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Groupmembership{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Entitlement) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Entitlement{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Webhook) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Webhook{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events struct { + ID string "json:\"id\" graphql:\"id\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*CreateBulkEvent_CreateBulkEvent_Events_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*CreateBulkEvent_CreateBulkEvent_Events_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*CreateBulkEvent_CreateBulkEvent_Events_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*CreateBulkEvent_CreateBulkEvent_Events_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*CreateBulkEvent_CreateBulkEvent_Events_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*CreateBulkEvent_CreateBulkEvent_Events_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*CreateBulkEvent_CreateBulkEvent_Events_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*CreateBulkEvent_CreateBulkEvent_Events_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*CreateBulkEvent_CreateBulkEvent_Events_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*CreateBulkEvent_CreateBulkEvent_Events_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*CreateBulkEvent_CreateBulkEvent_Events_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*CreateBulkEvent_CreateBulkEvent_Events_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.ID +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetEventID() *string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.EventID +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetCorrelationID() *string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.CorrelationID +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetEventType() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.EventType +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Metadata +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetUser() []*CreateBulkEvent_CreateBulkEvent_Events_User { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.User +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetGroup() []*CreateBulkEvent_CreateBulkEvent_Events_Group { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Group +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetIntegration() []*CreateBulkEvent_CreateBulkEvent_Events_Integration { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Integration +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetOrganization() []*CreateBulkEvent_CreateBulkEvent_Events_Organization { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Organization +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetInvite() []*CreateBulkEvent_CreateBulkEvent_Events_Invite { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Invite +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetFeature() []*CreateBulkEvent_CreateBulkEvent_Events_Feature { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Feature +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetPersonalAccessToken() []*CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.PersonalAccessToken +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetOauth2token() []*CreateBulkEvent_CreateBulkEvent_Events_Oauth2token { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Oauth2token +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetHush() []*CreateBulkEvent_CreateBulkEvent_Events_Hush { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Hush +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetOrgmembership() []*CreateBulkEvent_CreateBulkEvent_Events_Orgmembership { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Orgmembership +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetGroupmembership() []*CreateBulkEvent_CreateBulkEvent_Events_Groupmembership { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Groupmembership +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetEntitlement() []*CreateBulkEvent_CreateBulkEvent_Events_Entitlement { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Entitlement +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetWebhook() []*CreateBulkEvent_CreateBulkEvent_Events_Webhook { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Webhook +} + +type CreateBulkEvent_CreateBulkEvent struct { + Events []*CreateBulkEvent_CreateBulkEvent_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent) GetEvents() []*CreateBulkEvent_CreateBulkEvent_Events { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent{} + } + return t.Events +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events struct { + ID string "json:\"id\" graphql:\"id\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.ID +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetEventID() *string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.EventID +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetCorrelationID() *string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.CorrelationID +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetEventType() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.EventType +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Metadata +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetUser() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.User +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetGroup() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Group +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetIntegration() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Integration +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetOrganization() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Organization +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetInvite() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Invite +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetFeature() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Feature +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetPersonalAccessToken() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.PersonalAccessToken +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetOauth2token() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Oauth2token +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetHush() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Hush +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetOrgmembership() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Orgmembership +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetGroupmembership() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Groupmembership +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetEntitlement() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Entitlement +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetWebhook() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Webhook +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent struct { + Events []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent) GetEvents() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent{} + } + return t.Events +} + +type UpdateEvent_UpdateEvent_Event_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_User) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_User{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Group) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Group{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Integration) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Integration{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Organization) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Organization{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Invite) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Invite{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Feature) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Feature{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_PersonalAccessToken) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_PersonalAccessToken{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Oauth2token) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Oauth2token{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Hush) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Hush{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Orgmembership) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Orgmembership{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Groupmembership) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Groupmembership{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Entitlement) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Entitlement{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Webhook) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Webhook{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*UpdateEvent_UpdateEvent_Event_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*UpdateEvent_UpdateEvent_Event_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*UpdateEvent_UpdateEvent_Event_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*UpdateEvent_UpdateEvent_Event_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*UpdateEvent_UpdateEvent_Event_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*UpdateEvent_UpdateEvent_Event_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*UpdateEvent_UpdateEvent_Event_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*UpdateEvent_UpdateEvent_Event_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*UpdateEvent_UpdateEvent_Event_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*UpdateEvent_UpdateEvent_Event_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*UpdateEvent_UpdateEvent_Event_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*UpdateEvent_UpdateEvent_Event_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*UpdateEvent_UpdateEvent_Event_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *UpdateEvent_UpdateEvent_Event) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.ID +} +func (t *UpdateEvent_UpdateEvent_Event) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.CreatedAt +} +func (t *UpdateEvent_UpdateEvent_Event) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.UpdatedAt +} +func (t *UpdateEvent_UpdateEvent_Event) GetCreatedBy() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.CreatedBy +} +func (t *UpdateEvent_UpdateEvent_Event) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.UpdatedBy +} +func (t *UpdateEvent_UpdateEvent_Event) GetEventID() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.EventID +} +func (t *UpdateEvent_UpdateEvent_Event) GetCorrelationID() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.CorrelationID +} +func (t *UpdateEvent_UpdateEvent_Event) GetEventType() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.EventType +} +func (t *UpdateEvent_UpdateEvent_Event) GetMetadata() map[string]interface{} { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Metadata +} +func (t *UpdateEvent_UpdateEvent_Event) GetUser() []*UpdateEvent_UpdateEvent_Event_User { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.User +} +func (t *UpdateEvent_UpdateEvent_Event) GetGroup() []*UpdateEvent_UpdateEvent_Event_Group { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Group +} +func (t *UpdateEvent_UpdateEvent_Event) GetIntegration() []*UpdateEvent_UpdateEvent_Event_Integration { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Integration +} +func (t *UpdateEvent_UpdateEvent_Event) GetOrganization() []*UpdateEvent_UpdateEvent_Event_Organization { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Organization +} +func (t *UpdateEvent_UpdateEvent_Event) GetInvite() []*UpdateEvent_UpdateEvent_Event_Invite { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Invite +} +func (t *UpdateEvent_UpdateEvent_Event) GetFeature() []*UpdateEvent_UpdateEvent_Event_Feature { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Feature +} +func (t *UpdateEvent_UpdateEvent_Event) GetPersonalAccessToken() []*UpdateEvent_UpdateEvent_Event_PersonalAccessToken { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.PersonalAccessToken +} +func (t *UpdateEvent_UpdateEvent_Event) GetOauth2token() []*UpdateEvent_UpdateEvent_Event_Oauth2token { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Oauth2token +} +func (t *UpdateEvent_UpdateEvent_Event) GetHush() []*UpdateEvent_UpdateEvent_Event_Hush { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Hush +} +func (t *UpdateEvent_UpdateEvent_Event) GetOrgmembership() []*UpdateEvent_UpdateEvent_Event_Orgmembership { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Orgmembership +} +func (t *UpdateEvent_UpdateEvent_Event) GetGroupmembership() []*UpdateEvent_UpdateEvent_Event_Groupmembership { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Groupmembership +} +func (t *UpdateEvent_UpdateEvent_Event) GetEntitlement() []*UpdateEvent_UpdateEvent_Event_Entitlement { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Entitlement +} +func (t *UpdateEvent_UpdateEvent_Event) GetWebhook() []*UpdateEvent_UpdateEvent_Event_Webhook { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Webhook +} + +type UpdateEvent_UpdateEvent struct { + Event UpdateEvent_UpdateEvent_Event "json:\"event\" graphql:\"event\"" +} + +func (t *UpdateEvent_UpdateEvent) GetEvent() *UpdateEvent_UpdateEvent_Event { + if t == nil { + t = &UpdateEvent_UpdateEvent{} + } + return &t.Event +} + +type DeleteEvent_DeleteEvent struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEvent_DeleteEvent) GetDeletedID() string { + if t == nil { + t = &DeleteEvent_DeleteEvent{} + } + return t.DeletedID +} + +type GetAllEventHistories_EventHistories_Edges_Node struct { + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.EventID +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetEventType() string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.EventType +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEventHistories_EventHistories_Edges struct { + Node *GetAllEventHistories_EventHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEventHistories_EventHistories_Edges) GetNode() *GetAllEventHistories_EventHistories_Edges_Node { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges{} + } + return t.Node +} + +type GetAllEventHistories_EventHistories struct { + Edges []*GetAllEventHistories_EventHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEventHistories_EventHistories) GetEdges() []*GetAllEventHistories_EventHistories_Edges { + if t == nil { + t = &GetAllEventHistories_EventHistories{} + } + return t.Edges +} + +type GetEventHistories_EventHistories_Edges_Node struct { + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEventHistories_EventHistories_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.EventID +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetEventType() string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.EventType +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEventHistories_EventHistories_Edges struct { + Node *GetEventHistories_EventHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEventHistories_EventHistories_Edges) GetNode() *GetEventHistories_EventHistories_Edges_Node { + if t == nil { + t = &GetEventHistories_EventHistories_Edges{} + } + return t.Node +} + +type GetEventHistories_EventHistories struct { + Edges []*GetEventHistories_EventHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEventHistories_EventHistories) GetEdges() []*GetEventHistories_EventHistories_Edges { + if t == nil { + t = &GetEventHistories_EventHistories{} + } + return t.Edges +} + +type CreateBulkCSVFeature_CreateBulkCSVFeature_Features struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Description +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetEnabled() bool { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Enabled +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetID() string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.ID +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetName() string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Name +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetDisplayName() *string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.DisplayName +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetTags() []string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Tags +} + +type CreateBulkCSVFeature_CreateBulkCSVFeature struct { + Features []*CreateBulkCSVFeature_CreateBulkCSVFeature_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature) GetFeatures() []*CreateBulkCSVFeature_CreateBulkCSVFeature_Features { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature{} + } + return t.Features +} + +type CreateBulkFeature_CreateBulkFeature_Features struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetDescription() *string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Description +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetEnabled() bool { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Enabled +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetID() string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.ID +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetName() string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Name +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetDisplayName() *string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.DisplayName +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetTags() []string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Tags +} + +type CreateBulkFeature_CreateBulkFeature struct { + Features []*CreateBulkFeature_CreateBulkFeature_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *CreateBulkFeature_CreateBulkFeature) GetFeatures() []*CreateBulkFeature_CreateBulkFeature_Features { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature{} + } + return t.Features +} + +type CreateFeature_CreateFeature_Feature struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateFeature_CreateFeature_Feature) GetDescription() *string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Description +} +func (t *CreateFeature_CreateFeature_Feature) GetEnabled() bool { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Enabled +} +func (t *CreateFeature_CreateFeature_Feature) GetID() string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.ID +} +func (t *CreateFeature_CreateFeature_Feature) GetName() string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Name +} +func (t *CreateFeature_CreateFeature_Feature) GetDisplayName() *string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.DisplayName +} +func (t *CreateFeature_CreateFeature_Feature) GetTags() []string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Tags +} + +type CreateFeature_CreateFeature struct { + Feature CreateFeature_CreateFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateFeature_CreateFeature) GetFeature() *CreateFeature_CreateFeature_Feature { + if t == nil { + t = &CreateFeature_CreateFeature{} + } + return &t.Feature +} + +type DeleteFeature_DeleteFeature struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteFeature_DeleteFeature) GetDeletedID() string { + if t == nil { + t = &DeleteFeature_DeleteFeature{} + } + return t.DeletedID +} + +type GetAllFeatures_Features_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetAllFeatures_Features_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Description +} +func (t *GetAllFeatures_Features_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllFeatures_Features_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.ID +} +func (t *GetAllFeatures_Features_Edges_Node) GetName() string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Name +} +func (t *GetAllFeatures_Features_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllFeatures_Features_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Tags +} + +type GetAllFeatures_Features_Edges struct { + Node *GetAllFeatures_Features_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFeatures_Features_Edges) GetNode() *GetAllFeatures_Features_Edges_Node { + if t == nil { + t = &GetAllFeatures_Features_Edges{} + } + return t.Node +} + +type GetAllFeatures_Features struct { + Edges []*GetAllFeatures_Features_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFeatures_Features) GetEdges() []*GetAllFeatures_Features_Edges { + if t == nil { + t = &GetAllFeatures_Features{} + } + return t.Edges +} + +type GetFeatureByID_Feature struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetFeatureByID_Feature) GetDescription() *string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Description +} +func (t *GetFeatureByID_Feature) GetEnabled() bool { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Enabled +} +func (t *GetFeatureByID_Feature) GetID() string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.ID +} +func (t *GetFeatureByID_Feature) GetName() string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Name +} +func (t *GetFeatureByID_Feature) GetDisplayName() *string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.DisplayName +} +func (t *GetFeatureByID_Feature) GetTags() []string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Tags +} + +type GetFeatures_Features_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetFeatures_Features_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Description +} +func (t *GetFeatures_Features_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Enabled +} +func (t *GetFeatures_Features_Edges_Node) GetID() string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.ID +} +func (t *GetFeatures_Features_Edges_Node) GetName() string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Name +} +func (t *GetFeatures_Features_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.DisplayName +} +func (t *GetFeatures_Features_Edges_Node) GetTags() []string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Tags +} + +type GetFeatures_Features_Edges struct { + Node *GetFeatures_Features_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFeatures_Features_Edges) GetNode() *GetFeatures_Features_Edges_Node { + if t == nil { + t = &GetFeatures_Features_Edges{} + } + return t.Node +} + +type GetFeatures_Features struct { + Edges []*GetFeatures_Features_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFeatures_Features) GetEdges() []*GetFeatures_Features_Edges { + if t == nil { + t = &GetFeatures_Features{} + } + return t.Edges +} + +type UpdateFeature_UpdateFeature_Feature struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *UpdateFeature_UpdateFeature_Feature) GetDescription() *string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Description +} +func (t *UpdateFeature_UpdateFeature_Feature) GetEnabled() bool { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Enabled +} +func (t *UpdateFeature_UpdateFeature_Feature) GetID() string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.ID +} +func (t *UpdateFeature_UpdateFeature_Feature) GetName() string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Name +} +func (t *UpdateFeature_UpdateFeature_Feature) GetDisplayName() *string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.DisplayName +} +func (t *UpdateFeature_UpdateFeature_Feature) GetTags() []string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Tags +} + +type UpdateFeature_UpdateFeature struct { + Feature UpdateFeature_UpdateFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *UpdateFeature_UpdateFeature) GetFeature() *UpdateFeature_UpdateFeature_Feature { + if t == nil { + t = &UpdateFeature_UpdateFeature{} + } + return &t.Feature +} + +type GetAllFeatureHistories_FeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllFeatureHistories_FeatureHistories_Edges struct { + Node *GetAllFeatureHistories_FeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFeatureHistories_FeatureHistories_Edges) GetNode() *GetAllFeatureHistories_FeatureHistories_Edges_Node { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges{} + } + return t.Node +} + +type GetAllFeatureHistories_FeatureHistories struct { + Edges []*GetAllFeatureHistories_FeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFeatureHistories_FeatureHistories) GetEdges() []*GetAllFeatureHistories_FeatureHistories_Edges { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories{} + } + return t.Edges +} + +type GetFeatureHistories_FeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Description +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Name +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetFeatureHistories_FeatureHistories_Edges struct { + Node *GetFeatureHistories_FeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFeatureHistories_FeatureHistories_Edges) GetNode() *GetFeatureHistories_FeatureHistories_Edges_Node { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges{} + } + return t.Node +} + +type GetFeatureHistories_FeatureHistories struct { + Edges []*GetFeatureHistories_FeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFeatureHistories_FeatureHistories) GetEdges() []*GetFeatureHistories_FeatureHistories_Edges { + if t == nil { + t = &GetFeatureHistories_FeatureHistories{} + } + return t.Edges +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files_User) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files_User{} + } + return t.ID +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization{} + } + return t.ID +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files_Group) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files_Group{} + } + return t.ID +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + User *CreateBulkCSVFile_CreateBulkCSVFile_Files_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetAnnotation() *string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Annotation +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetCategory() *string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Category +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetContentType() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.ContentType +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetFileExtension() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.FileExtension +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetFileName() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.FileName +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetFileSize() *int64 { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.FileSize +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.ID +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetStoreKey() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.StoreKey +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetUser() *CreateBulkCSVFile_CreateBulkCSVFile_Files_User { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.User +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetOrganization() []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Organization +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetGroup() []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Group { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Group +} + +type CreateBulkCSVFile_CreateBulkCSVFile struct { + Files []*CreateBulkCSVFile_CreateBulkCSVFile_Files "json:\"files,omitempty\" graphql:\"files\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile) GetFiles() []*CreateBulkCSVFile_CreateBulkCSVFile_Files { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile{} + } + return t.Files +} + +type CreateBulkFile_CreateBulkFile_Files_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files_User) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files_User{} + } + return t.ID +} + +type CreateBulkFile_CreateBulkFile_Files_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files_Organization) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files_Organization{} + } + return t.ID +} + +type CreateBulkFile_CreateBulkFile_Files_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files_Group) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files_Group{} + } + return t.ID +} + +type CreateBulkFile_CreateBulkFile_Files struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + User *CreateBulkFile_CreateBulkFile_Files_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*CreateBulkFile_CreateBulkFile_Files_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*CreateBulkFile_CreateBulkFile_Files_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files) GetAnnotation() *string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Annotation +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetCategory() *string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Category +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetContentType() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.ContentType +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetFileExtension() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.FileExtension +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetFileName() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.FileName +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetFileSize() *int64 { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.FileSize +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.ID +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetStoreKey() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.StoreKey +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetUser() *CreateBulkFile_CreateBulkFile_Files_User { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.User +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetOrganization() []*CreateBulkFile_CreateBulkFile_Files_Organization { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Organization +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetGroup() []*CreateBulkFile_CreateBulkFile_Files_Group { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Group +} + +type CreateBulkFile_CreateBulkFile struct { + Files []*CreateBulkFile_CreateBulkFile_Files "json:\"files,omitempty\" graphql:\"files\"" +} + +func (t *CreateBulkFile_CreateBulkFile) GetFiles() []*CreateBulkFile_CreateBulkFile_Files { + if t == nil { + t = &CreateBulkFile_CreateBulkFile{} + } + return t.Files +} + +type CreateFile_CreateFile_File_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateFile_CreateFile_File_User) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File_User{} + } + return t.ID +} + +type CreateFile_CreateFile_File_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateFile_CreateFile_File_Organization) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File_Organization{} + } + return t.ID +} + +type CreateFile_CreateFile_File_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateFile_CreateFile_File_Group) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File_Group{} + } + return t.ID +} + +type CreateFile_CreateFile_File struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + User *CreateFile_CreateFile_File_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*CreateFile_CreateFile_File_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*CreateFile_CreateFile_File_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *CreateFile_CreateFile_File) GetAnnotation() *string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Annotation +} +func (t *CreateFile_CreateFile_File) GetCategory() *string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Category +} +func (t *CreateFile_CreateFile_File) GetContentType() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.ContentType +} +func (t *CreateFile_CreateFile_File) GetFileExtension() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.FileExtension +} +func (t *CreateFile_CreateFile_File) GetFileName() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.FileName +} +func (t *CreateFile_CreateFile_File) GetFileSize() *int64 { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.FileSize +} +func (t *CreateFile_CreateFile_File) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.ID +} +func (t *CreateFile_CreateFile_File) GetStoreKey() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.StoreKey +} +func (t *CreateFile_CreateFile_File) GetUser() *CreateFile_CreateFile_File_User { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.User +} +func (t *CreateFile_CreateFile_File) GetOrganization() []*CreateFile_CreateFile_File_Organization { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Organization +} +func (t *CreateFile_CreateFile_File) GetGroup() []*CreateFile_CreateFile_File_Group { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Group +} + +type CreateFile_CreateFile struct { + File CreateFile_CreateFile_File "json:\"file\" graphql:\"file\"" +} + +func (t *CreateFile_CreateFile) GetFile() *CreateFile_CreateFile_File { + if t == nil { + t = &CreateFile_CreateFile{} + } + return &t.File +} + +type DeleteFile_DeleteFile struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteFile_DeleteFile) GetDeletedID() string { + if t == nil { + t = &DeleteFile_DeleteFile{} + } + return t.DeletedID +} + +type GetAllFiles_Files_Edges_Node_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllFiles_Files_Edges_Node_User) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node_User{} + } + return t.ID +} + +type GetAllFiles_Files_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllFiles_Files_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node_Organization{} + } + return t.ID +} + +type GetAllFiles_Files_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllFiles_Files_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node_Group{} + } + return t.ID +} + +type GetAllFiles_Files_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + User *GetAllFiles_Files_Edges_Node_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*GetAllFiles_Files_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*GetAllFiles_Files_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *GetAllFiles_Files_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Annotation +} +func (t *GetAllFiles_Files_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Category +} +func (t *GetAllFiles_Files_Edges_Node) GetContentType() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.ContentType +} +func (t *GetAllFiles_Files_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllFiles_Files_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllFiles_Files_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.FileExtension +} +func (t *GetAllFiles_Files_Edges_Node) GetFileName() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.FileName +} +func (t *GetAllFiles_Files_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.FileSize +} +func (t *GetAllFiles_Files_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.ID +} +func (t *GetAllFiles_Files_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.StoreKey +} +func (t *GetAllFiles_Files_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllFiles_Files_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllFiles_Files_Edges_Node) GetUser() *GetAllFiles_Files_Edges_Node_User { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.User +} +func (t *GetAllFiles_Files_Edges_Node) GetOrganization() []*GetAllFiles_Files_Edges_Node_Organization { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Organization +} +func (t *GetAllFiles_Files_Edges_Node) GetGroup() []*GetAllFiles_Files_Edges_Node_Group { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Group +} + +type GetAllFiles_Files_Edges struct { + Node *GetAllFiles_Files_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFiles_Files_Edges) GetNode() *GetAllFiles_Files_Edges_Node { + if t == nil { + t = &GetAllFiles_Files_Edges{} + } + return t.Node +} + +type GetAllFiles_Files struct { + Edges []*GetAllFiles_Files_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFiles_Files) GetEdges() []*GetAllFiles_Files_Edges { + if t == nil { + t = &GetAllFiles_Files{} + } + return t.Edges +} + +type GetFiles_Files_Edges_Node_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetFiles_Files_Edges_Node_User) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node_User{} + } + return t.ID +} + +type GetFiles_Files_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetFiles_Files_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node_Organization{} + } + return t.ID +} + +type GetFiles_Files_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetFiles_Files_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node_Group{} + } + return t.ID +} + +type GetFiles_Files_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + User *GetFiles_Files_Edges_Node_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*GetFiles_Files_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*GetFiles_Files_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *GetFiles_Files_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Annotation +} +func (t *GetFiles_Files_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Category +} +func (t *GetFiles_Files_Edges_Node) GetContentType() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.ContentType +} +func (t *GetFiles_Files_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetFiles_Files_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetFiles_Files_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.FileExtension +} +func (t *GetFiles_Files_Edges_Node) GetFileName() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.FileName +} +func (t *GetFiles_Files_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.FileSize +} +func (t *GetFiles_Files_Edges_Node) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.ID +} +func (t *GetFiles_Files_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.StoreKey +} +func (t *GetFiles_Files_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetFiles_Files_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetFiles_Files_Edges_Node) GetUser() *GetFiles_Files_Edges_Node_User { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.User +} +func (t *GetFiles_Files_Edges_Node) GetOrganization() []*GetFiles_Files_Edges_Node_Organization { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Organization +} +func (t *GetFiles_Files_Edges_Node) GetGroup() []*GetFiles_Files_Edges_Node_Group { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Group +} + +type GetFiles_Files_Edges struct { + Node *GetFiles_Files_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFiles_Files_Edges) GetNode() *GetFiles_Files_Edges_Node { + if t == nil { + t = &GetFiles_Files_Edges{} + } + return t.Node +} + +type GetFiles_Files struct { + Edges []*GetFiles_Files_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFiles_Files) GetEdges() []*GetFiles_Files_Edges { + if t == nil { + t = &GetFiles_Files{} + } + return t.Edges +} + +type UpdateFile_UpdateFile_File_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateFile_UpdateFile_File_User) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File_User{} + } + return t.ID +} + +type UpdateFile_UpdateFile_File_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateFile_UpdateFile_File_Organization) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File_Organization{} + } + return t.ID +} + +type UpdateFile_UpdateFile_File_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateFile_UpdateFile_File_Group) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File_Group{} + } + return t.ID +} + +type UpdateFile_UpdateFile_File struct { + ID string "json:\"id\" graphql:\"id\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + User *UpdateFile_UpdateFile_File_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*UpdateFile_UpdateFile_File_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*UpdateFile_UpdateFile_File_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *UpdateFile_UpdateFile_File) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.ID +} +func (t *UpdateFile_UpdateFile_File) GetFileName() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.FileName +} +func (t *UpdateFile_UpdateFile_File) GetFileExtension() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.FileExtension +} +func (t *UpdateFile_UpdateFile_File) GetFileSize() *int64 { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.FileSize +} +func (t *UpdateFile_UpdateFile_File) GetContentType() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.ContentType +} +func (t *UpdateFile_UpdateFile_File) GetStoreKey() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.StoreKey +} +func (t *UpdateFile_UpdateFile_File) GetCategory() *string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Category +} +func (t *UpdateFile_UpdateFile_File) GetAnnotation() *string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Annotation +} +func (t *UpdateFile_UpdateFile_File) GetUser() *UpdateFile_UpdateFile_File_User { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.User +} +func (t *UpdateFile_UpdateFile_File) GetOrganization() []*UpdateFile_UpdateFile_File_Organization { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Organization +} +func (t *UpdateFile_UpdateFile_File) GetGroup() []*UpdateFile_UpdateFile_File_Group { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Group +} + +type UpdateFile_UpdateFile struct { + File UpdateFile_UpdateFile_File "json:\"file\" graphql:\"file\"" +} + +func (t *UpdateFile_UpdateFile) GetFile() *UpdateFile_UpdateFile_File { + if t == nil { + t = &UpdateFile_UpdateFile{} + } + return &t.File +} + +type GetAllFileHistories_FileHistories_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Annotation +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Category +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetContentType() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.ContentType +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.FileExtension +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetFileName() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.FileName +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.FileSize +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.StoreKey +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllFileHistories_FileHistories_Edges struct { + Node *GetAllFileHistories_FileHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFileHistories_FileHistories_Edges) GetNode() *GetAllFileHistories_FileHistories_Edges_Node { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges{} + } + return t.Node +} + +type GetAllFileHistories_FileHistories struct { + Edges []*GetAllFileHistories_FileHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFileHistories_FileHistories) GetEdges() []*GetAllFileHistories_FileHistories_Edges { + if t == nil { + t = &GetAllFileHistories_FileHistories{} + } + return t.Edges +} + +type GetFileHistories_FileHistories_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetFileHistories_FileHistories_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Annotation +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Category +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetContentType() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.ContentType +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.FileExtension +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetFileName() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.FileName +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.FileSize +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.ID +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.StoreKey +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetFileHistories_FileHistories_Edges struct { + Node *GetFileHistories_FileHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFileHistories_FileHistories_Edges) GetNode() *GetFileHistories_FileHistories_Edges_Node { + if t == nil { + t = &GetFileHistories_FileHistories_Edges{} + } + return t.Node +} + +type GetFileHistories_FileHistories struct { + Edges []*GetFileHistories_FileHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFileHistories_FileHistories) GetEdges() []*GetFileHistories_FileHistories_Edges { + if t == nil { + t = &GetFileHistories_FileHistories{} + } + return t.Edges +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner{} + } + return t.DisplayName +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return &t.JoinPolicy +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.SyncToGithub +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.SyncToSlack +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetTags() []string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.Tags +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return &t.Visibility +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User{} + } + return t.FirstName +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User) GetLastName() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User{} + } + return t.LastName +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members{} + } + return &t.Role +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members) GetUser() *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members{} + } + return &t.User +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting "json:\"setting\" graphql:\"setting\"" + Members []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Description +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.DisplayName +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetLogoURL() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.LogoURL +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetName() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Name +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetTags() []string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Tags +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetOwner() *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Owner +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetSetting() *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return &t.Setting +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetMembers() []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Members +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup struct { + Groups []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups "json:\"groups,omitempty\" graphql:\"groups\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup) GetGroups() []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup{} + } + return t.Groups +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Owner) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Owner{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Owner) GetDisplayName() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Owner{} + } + return t.DisplayName +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return &t.JoinPolicy +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.SyncToGithub +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.SyncToSlack +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetTags() []string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.Tags +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return &t.Visibility +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members_User) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members_User{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members_User{} + } + return t.FirstName +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members_User) GetLastName() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members_User{} + } + return t.LastName +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User CreateBulkGroup_CreateBulkGroup_Groups_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members{} + } + return &t.Role +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members) GetUser() *CreateBulkGroup_CreateBulkGroup_Groups_Members_User { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members{} + } + return &t.User +} + +type CreateBulkGroup_CreateBulkGroup_Groups struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *CreateBulkGroup_CreateBulkGroup_Groups_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting CreateBulkGroup_CreateBulkGroup_Groups_Setting "json:\"setting\" graphql:\"setting\"" + Members []*CreateBulkGroup_CreateBulkGroup_Groups_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetDescription() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Description +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetDisplayName() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.DisplayName +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetLogoURL() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.LogoURL +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetName() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Name +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetTags() []string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Tags +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetOwner() *CreateBulkGroup_CreateBulkGroup_Groups_Owner { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Owner +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetSetting() *CreateBulkGroup_CreateBulkGroup_Groups_Setting { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return &t.Setting +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetMembers() []*CreateBulkGroup_CreateBulkGroup_Groups_Members { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Members +} + +type CreateBulkGroup_CreateBulkGroup struct { + Groups []*CreateBulkGroup_CreateBulkGroup_Groups "json:\"groups,omitempty\" graphql:\"groups\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup) GetGroups() []*CreateBulkGroup_CreateBulkGroup_Groups { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup{} + } + return t.Groups +} + +type CreateGroup_CreateGroup_Group_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *CreateGroup_CreateGroup_Group_Owner) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Owner{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Owner) GetDisplayName() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Owner{} + } + return t.DisplayName +} + +type CreateGroup_CreateGroup_Group_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *CreateGroup_CreateGroup_Group_Setting) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return &t.JoinPolicy +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.SyncToGithub +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.SyncToSlack +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetTags() []string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.Tags +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return &t.Visibility +} + +type CreateGroup_CreateGroup_Group_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateGroup_CreateGroup_Group_Members_User) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members_User{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Members_User) GetFirstName() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members_User{} + } + return t.FirstName +} +func (t *CreateGroup_CreateGroup_Group_Members_User) GetLastName() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members_User{} + } + return t.LastName +} + +type CreateGroup_CreateGroup_Group_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User CreateGroup_CreateGroup_Group_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateGroup_CreateGroup_Group_Members) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Members) GetRole() *enums.Role { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members{} + } + return &t.Role +} +func (t *CreateGroup_CreateGroup_Group_Members) GetUser() *CreateGroup_CreateGroup_Group_Members_User { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members{} + } + return &t.User +} + +type CreateGroup_CreateGroup_Group struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *CreateGroup_CreateGroup_Group_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting CreateGroup_CreateGroup_Group_Setting "json:\"setting\" graphql:\"setting\"" + Members []*CreateGroup_CreateGroup_Group_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *CreateGroup_CreateGroup_Group) GetDescription() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Description +} +func (t *CreateGroup_CreateGroup_Group) GetDisplayName() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.DisplayName +} +func (t *CreateGroup_CreateGroup_Group) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group) GetLogoURL() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.LogoURL +} +func (t *CreateGroup_CreateGroup_Group) GetName() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Name +} +func (t *CreateGroup_CreateGroup_Group) GetTags() []string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Tags +} +func (t *CreateGroup_CreateGroup_Group) GetOwner() *CreateGroup_CreateGroup_Group_Owner { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Owner +} +func (t *CreateGroup_CreateGroup_Group) GetSetting() *CreateGroup_CreateGroup_Group_Setting { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return &t.Setting +} +func (t *CreateGroup_CreateGroup_Group) GetMembers() []*CreateGroup_CreateGroup_Group_Members { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Members +} + +type CreateGroup_CreateGroup struct { + Group CreateGroup_CreateGroup_Group "json:\"group\" graphql:\"group\"" +} + +func (t *CreateGroup_CreateGroup) GetGroup() *CreateGroup_CreateGroup_Group { + if t == nil { + t = &CreateGroup_CreateGroup{} + } + return &t.Group +} + +type DeleteGroup_DeleteGroup struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteGroup_DeleteGroup) GetDeletedID() string { + if t == nil { + t = &DeleteGroup_DeleteGroup{} + } + return t.DeletedID +} + +type GetAllGroups_Groups_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Owner{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Owner) GetDisplayName() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Owner{} + } + return t.DisplayName +} + +type GetAllGroups_Groups_Edges_Node_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return &t.JoinPolicy +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToGithub +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToSlack +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.Tags +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return &t.Visibility +} + +type GetAllGroups_Groups_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetAllGroups_Groups_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetAllGroups_Groups_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetAllGroups_Groups_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetAllGroups_Groups_Edges_Node_Members) GetUser() *GetAllGroups_Groups_Edges_Node_Members_User { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members{} + } + return &t.User +} + +type GetAllGroups_Groups_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *GetAllGroups_Groups_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting GetAllGroups_Groups_Edges_Node_Setting "json:\"setting\" graphql:\"setting\"" + Members []*GetAllGroups_Groups_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllGroups_Groups_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Description +} +func (t *GetAllGroups_Groups_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllGroups_Groups_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.LogoURL +} +func (t *GetAllGroups_Groups_Edges_Node) GetName() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Name +} +func (t *GetAllGroups_Groups_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroups_Groups_Edges_Node) GetOwner() *GetAllGroups_Groups_Edges_Node_Owner { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Owner +} +func (t *GetAllGroups_Groups_Edges_Node) GetSetting() *GetAllGroups_Groups_Edges_Node_Setting { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return &t.Setting +} +func (t *GetAllGroups_Groups_Edges_Node) GetMembers() []*GetAllGroups_Groups_Edges_Node_Members { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Members +} +func (t *GetAllGroups_Groups_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroups_Groups_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroups_Groups_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroups_Groups_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllGroups_Groups_Edges struct { + Node *GetAllGroups_Groups_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroups_Groups_Edges) GetNode() *GetAllGroups_Groups_Edges_Node { + if t == nil { + t = &GetAllGroups_Groups_Edges{} + } + return t.Node +} + +type GetAllGroups_Groups struct { + Edges []*GetAllGroups_Groups_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroups_Groups) GetEdges() []*GetAllGroups_Groups_Edges { + if t == nil { + t = &GetAllGroups_Groups{} + } + return t.Edges +} + +type GetGroupByID_Group_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *GetGroupByID_Group_Owner) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Owner{} + } + return t.ID +} +func (t *GetGroupByID_Group_Owner) GetDisplayName() string { + if t == nil { + t = &GetGroupByID_Group_Owner{} + } + return t.DisplayName +} + +type GetGroupByID_Group_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetGroupByID_Group_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.CreatedAt +} +func (t *GetGroupByID_Group_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.CreatedBy +} +func (t *GetGroupByID_Group_Setting) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.ID +} +func (t *GetGroupByID_Group_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return &t.JoinPolicy +} +func (t *GetGroupByID_Group_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.SyncToGithub +} +func (t *GetGroupByID_Group_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.SyncToSlack +} +func (t *GetGroupByID_Group_Setting) GetTags() []string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.Tags +} +func (t *GetGroupByID_Group_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.UpdatedAt +} +func (t *GetGroupByID_Group_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.UpdatedBy +} +func (t *GetGroupByID_Group_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return &t.Visibility +} + +type GetGroupByID_Group_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetGroupByID_Group_Members_User) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Members_User{} + } + return t.ID +} +func (t *GetGroupByID_Group_Members_User) GetFirstName() *string { + if t == nil { + t = &GetGroupByID_Group_Members_User{} + } + return t.FirstName +} +func (t *GetGroupByID_Group_Members_User) GetLastName() *string { + if t == nil { + t = &GetGroupByID_Group_Members_User{} + } + return t.LastName +} + +type GetGroupByID_Group_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetGroupByID_Group_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetGroupByID_Group_Members) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Members{} + } + return t.ID +} +func (t *GetGroupByID_Group_Members) GetRole() *enums.Role { + if t == nil { + t = &GetGroupByID_Group_Members{} + } + return &t.Role +} +func (t *GetGroupByID_Group_Members) GetUser() *GetGroupByID_Group_Members_User { + if t == nil { + t = &GetGroupByID_Group_Members{} + } + return &t.User +} + +type GetGroupByID_Group struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *GetGroupByID_Group_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting GetGroupByID_Group_Setting "json:\"setting\" graphql:\"setting\"" + Members []*GetGroupByID_Group_Members "json:\"members,omitempty\" graphql:\"members\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupByID_Group) GetDescription() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Description +} +func (t *GetGroupByID_Group) GetDisplayName() string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.DisplayName +} +func (t *GetGroupByID_Group) GetID() string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.ID +} +func (t *GetGroupByID_Group) GetLogoURL() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.LogoURL +} +func (t *GetGroupByID_Group) GetName() string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Name +} +func (t *GetGroupByID_Group) GetTags() []string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Tags +} +func (t *GetGroupByID_Group) GetOwner() *GetGroupByID_Group_Owner { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Owner +} +func (t *GetGroupByID_Group) GetSetting() *GetGroupByID_Group_Setting { + if t == nil { + t = &GetGroupByID_Group{} + } + return &t.Setting +} +func (t *GetGroupByID_Group) GetMembers() []*GetGroupByID_Group_Members { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Members +} +func (t *GetGroupByID_Group) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.CreatedAt +} +func (t *GetGroupByID_Group) GetCreatedBy() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.CreatedBy +} +func (t *GetGroupByID_Group) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.UpdatedAt +} +func (t *GetGroupByID_Group) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.UpdatedBy +} + +type GetGroups_Groups_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *GetGroups_Groups_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Owner{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Owner) GetDisplayName() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Owner{} + } + return t.DisplayName +} + +type GetGroups_Groups_Edges_Node_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetGroups_Groups_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return &t.JoinPolicy +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToGithub +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToSlack +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.Tags +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return &t.Visibility +} + +type GetGroups_Groups_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetGroups_Groups_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetGroups_Groups_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetGroups_Groups_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetGroups_Groups_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetGroups_Groups_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetGroups_Groups_Edges_Node_Members) GetUser() *GetGroups_Groups_Edges_Node_Members_User { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members{} + } + return &t.User +} + +type GetGroups_Groups_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *GetGroups_Groups_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting GetGroups_Groups_Edges_Node_Setting "json:\"setting\" graphql:\"setting\"" + Members []*GetGroups_Groups_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroups_Groups_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Description +} +func (t *GetGroups_Groups_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.DisplayName +} +func (t *GetGroups_Groups_Edges_Node) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.LogoURL +} +func (t *GetGroups_Groups_Edges_Node) GetName() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Name +} +func (t *GetGroups_Groups_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Tags +} +func (t *GetGroups_Groups_Edges_Node) GetOwner() *GetGroups_Groups_Edges_Node_Owner { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Owner +} +func (t *GetGroups_Groups_Edges_Node) GetSetting() *GetGroups_Groups_Edges_Node_Setting { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return &t.Setting +} +func (t *GetGroups_Groups_Edges_Node) GetMembers() []*GetGroups_Groups_Edges_Node_Members { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Members +} +func (t *GetGroups_Groups_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroups_Groups_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroups_Groups_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroups_Groups_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.UpdatedBy +} + +type GetGroups_Groups_Edges struct { + Node *GetGroups_Groups_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroups_Groups_Edges) GetNode() *GetGroups_Groups_Edges_Node { + if t == nil { + t = &GetGroups_Groups_Edges{} + } + return t.Node +} + +type GetGroups_Groups struct { + Edges []*GetGroups_Groups_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroups_Groups) GetEdges() []*GetGroups_Groups_Edges { + if t == nil { + t = &GetGroups_Groups{} + } + return t.Edges +} + +type UpdateGroup_UpdateGroup_Group_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Owner) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Owner{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Owner) GetDisplayName() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Owner{} + } + return t.DisplayName +} + +type UpdateGroup_UpdateGroup_Group_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.CreatedAt +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetCreatedBy() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.CreatedBy +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return &t.JoinPolicy +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.SyncToGithub +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.SyncToSlack +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetTags() []string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.Tags +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.UpdatedAt +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.UpdatedBy +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return &t.Visibility +} + +type UpdateGroup_UpdateGroup_Group_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Members_User) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members_User{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Members_User) GetFirstName() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members_User{} + } + return t.FirstName +} +func (t *UpdateGroup_UpdateGroup_Group_Members_User) GetLastName() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members_User{} + } + return t.LastName +} + +type UpdateGroup_UpdateGroup_Group_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User UpdateGroup_UpdateGroup_Group_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Members) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Members) GetRole() *enums.Role { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members{} + } + return &t.Role +} +func (t *UpdateGroup_UpdateGroup_Group_Members) GetUser() *UpdateGroup_UpdateGroup_Group_Members_User { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members{} + } + return &t.User +} + +type UpdateGroup_UpdateGroup_Group struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *UpdateGroup_UpdateGroup_Group_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting UpdateGroup_UpdateGroup_Group_Setting "json:\"setting\" graphql:\"setting\"" + Members []*UpdateGroup_UpdateGroup_Group_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *UpdateGroup_UpdateGroup_Group) GetDescription() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Description +} +func (t *UpdateGroup_UpdateGroup_Group) GetDisplayName() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.DisplayName +} +func (t *UpdateGroup_UpdateGroup_Group) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group) GetLogoURL() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.LogoURL +} +func (t *UpdateGroup_UpdateGroup_Group) GetName() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Name +} +func (t *UpdateGroup_UpdateGroup_Group) GetTags() []string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Tags +} +func (t *UpdateGroup_UpdateGroup_Group) GetOwner() *UpdateGroup_UpdateGroup_Group_Owner { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Owner +} +func (t *UpdateGroup_UpdateGroup_Group) GetSetting() *UpdateGroup_UpdateGroup_Group_Setting { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return &t.Setting +} +func (t *UpdateGroup_UpdateGroup_Group) GetMembers() []*UpdateGroup_UpdateGroup_Group_Members { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Members +} + +type UpdateGroup_UpdateGroup struct { + Group UpdateGroup_UpdateGroup_Group "json:\"group\" graphql:\"group\"" +} + +func (t *UpdateGroup_UpdateGroup) GetGroup() *UpdateGroup_UpdateGroup_Group { + if t == nil { + t = &UpdateGroup_UpdateGroup{} + } + return &t.Group +} + +type GetAllGroupHistories_GroupHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + GravatarLogoURL *string "json:\"gravatarLogoURL,omitempty\" graphql:\"gravatarLogoURL\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetGravatarLogoURL() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.GravatarLogoURL +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.LogoURL +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllGroupHistories_GroupHistories_Edges struct { + Node *GetAllGroupHistories_GroupHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupHistories_GroupHistories_Edges) GetNode() *GetAllGroupHistories_GroupHistories_Edges_Node { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges{} + } + return t.Node +} + +type GetAllGroupHistories_GroupHistories struct { + Edges []*GetAllGroupHistories_GroupHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupHistories_GroupHistories) GetEdges() []*GetAllGroupHistories_GroupHistories_Edges { + if t == nil { + t = &GetAllGroupHistories_GroupHistories{} + } + return t.Edges +} + +type GetGroupHistories_GroupHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + GravatarLogoURL *string "json:\"gravatarLogoURL,omitempty\" graphql:\"gravatarLogoURL\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Description +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetGravatarLogoURL() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.GravatarLogoURL +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.ID +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.LogoURL +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Name +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetGroupHistories_GroupHistories_Edges struct { + Node *GetGroupHistories_GroupHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupHistories_GroupHistories_Edges) GetNode() *GetGroupHistories_GroupHistories_Edges_Node { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges{} + } + return t.Node +} + +type GetGroupHistories_GroupHistories struct { + Edges []*GetGroupHistories_GroupHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupHistories_GroupHistories) GetEdges() []*GetGroupHistories_GroupHistories_Edges { + if t == nil { + t = &GetGroupHistories_GroupHistories{} + } + return t.Edges +} + +type AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group) GetID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group{} + } + return t.ID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group) GetName() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group{} + } + return t.Name +} + +type AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetDisplayName() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.DisplayName +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetEmail() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.Email +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetFirstName() *string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.FirstName +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.ID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetLastName() *string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.LastName +} + +type AddUserToGroupWithRole_CreateGroupMembership_GroupMembership struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User "json:\"user\" graphql:\"user\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetGroupID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return t.GroupID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetGroup() *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return &t.Group +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return t.ID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetRole() *enums.Role { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return &t.Role +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetUserID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return t.UserID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetUser() *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return &t.User +} + +type AddUserToGroupWithRole_CreateGroupMembership struct { + GroupMembership AddUserToGroupWithRole_CreateGroupMembership_GroupMembership "json:\"groupMembership\" graphql:\"groupMembership\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership) GetGroupMembership() *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership{} + } + return &t.GroupMembership +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group) GetID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group{} + } + return t.ID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group) GetName() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group{} + } + return t.Name +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.DisplayName +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetEmail() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.Email +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.FirstName +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.ID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetLastName() *string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.LastName +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetGroupID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return t.GroupID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetGroup() *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return &t.Group +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return t.ID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return &t.Role +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return t.UserID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetUser() *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return &t.User +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership struct { + GroupMemberships []*CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership) GetGroupMemberships() []*CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership{} + } + return t.GroupMemberships +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group) GetID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group{} + } + return t.ID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group) GetName() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group{} + } + return t.Name +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetDisplayName() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.DisplayName +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetEmail() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.Email +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.FirstName +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.ID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetLastName() *string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.LastName +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetGroupID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return t.GroupID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetGroup() *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return &t.Group +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return t.ID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return &t.Role +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return t.UserID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetUser() *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return &t.User +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership struct { + GroupMemberships []*CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership) GetGroupMemberships() []*CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership{} + } + return t.GroupMemberships +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group{} + } + return t.ID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group) GetName() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group{} + } + return t.Name +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetDisplayName() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.DisplayName +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetEmail() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.Email +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetFirstName() *string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.FirstName +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.ID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetLastName() *string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.LastName +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges_Node struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetGroupID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return t.GroupID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetGroup() *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return &t.Group +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return t.ID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return &t.Role +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetUserID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return t.UserID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetUser() *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return &t.User +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges struct { + Node *GetGroupMembersByGroupID_GroupMemberships_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges) GetNode() *GetGroupMembersByGroupID_GroupMemberships_Edges_Node { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges{} + } + return t.Node +} + +type GetGroupMembersByGroupID_GroupMemberships struct { + Edges []*GetGroupMembersByGroupID_GroupMemberships_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships) GetEdges() []*GetGroupMembersByGroupID_GroupMemberships_Edges { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships{} + } + return t.Edges +} + +type RemoveUserFromGroup_DeleteGroupMembership struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *RemoveUserFromGroup_DeleteGroupMembership) GetDeletedID() string { + if t == nil { + t = &RemoveUserFromGroup_DeleteGroupMembership{} + } + return t.DeletedID +} + +type UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group) GetID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group{} + } + return t.ID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group) GetName() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group{} + } + return t.Name +} + +type UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetDisplayName() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.DisplayName +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetEmail() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.Email +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetFirstName() *string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.FirstName +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.ID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetLastName() *string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.LastName +} + +type UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User "json:\"user\" graphql:\"user\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetGroupID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return t.GroupID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetGroup() *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return &t.Group +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return t.ID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetRole() *enums.Role { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return &t.Role +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetUserID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return t.UserID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetUser() *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return &t.User +} + +type UpdateUserRoleInGroup_UpdateGroupMembership struct { + GroupMembership UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership "json:\"groupMembership\" graphql:\"groupMembership\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership) GetGroupMembership() *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership{} + } + return &t.GroupMembership +} + +type GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID string "json:\"groupID\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetGroupID() string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetAllGroupMembershipHistories_GroupMembershipHistories_Edges struct { + Node *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges) GetNode() *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges{} + } + return t.Node +} + +type GetAllGroupMembershipHistories_GroupMembershipHistories struct { + Edges []*GetAllGroupMembershipHistories_GroupMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories) GetEdges() []*GetAllGroupMembershipHistories_GroupMembershipHistories_Edges { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories{} + } + return t.Edges +} + +type GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID string "json:\"groupID\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetGroupID() string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetGroupMembershipHistories_GroupMembershipHistories_Edges struct { + Node *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges) GetNode() *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges{} + } + return t.Node +} + +type GetGroupMembershipHistories_GroupMembershipHistories struct { + Edges []*GetGroupMembershipHistories_GroupMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupMembershipHistories_GroupMembershipHistories) GetEdges() []*GetGroupMembershipHistories_GroupMembershipHistories_Edges { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories{} + } + return t.Edges +} + +type GetAllGroupSettings_GroupSettings_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllGroupSettings_GroupSettings_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.ID +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node_Group) GetName() string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.Name +} + +type GetAllGroupSettings_GroupSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *GetAllGroupSettings_GroupSettings_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return &t.Visibility +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetGroup() *GetAllGroupSettings_GroupSettings_Edges_Node_Group { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.Group +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllGroupSettings_GroupSettings_Edges struct { + Node *GetAllGroupSettings_GroupSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupSettings_GroupSettings_Edges) GetNode() *GetAllGroupSettings_GroupSettings_Edges_Node { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges{} + } + return t.Node +} + +type GetAllGroupSettings_GroupSettings struct { + Edges []*GetAllGroupSettings_GroupSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupSettings_GroupSettings) GetEdges() []*GetAllGroupSettings_GroupSettings_Edges { + if t == nil { + t = &GetAllGroupSettings_GroupSettings{} + } + return t.Edges +} + +type GetGroupSettingByID_GroupSetting_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetGroupSettingByID_GroupSetting_Group) GetID() string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting_Group{} + } + return t.ID +} +func (t *GetGroupSettingByID_GroupSetting_Group) GetName() string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting_Group{} + } + return t.Name +} + +type GetGroupSettingByID_GroupSetting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *GetGroupSettingByID_GroupSetting_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupSettingByID_GroupSetting) GetID() string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.ID +} +func (t *GetGroupSettingByID_GroupSetting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return &t.JoinPolicy +} +func (t *GetGroupSettingByID_GroupSetting) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.SyncToGithub +} +func (t *GetGroupSettingByID_GroupSetting) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.SyncToSlack +} +func (t *GetGroupSettingByID_GroupSetting) GetTags() []string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.Tags +} +func (t *GetGroupSettingByID_GroupSetting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return &t.Visibility +} +func (t *GetGroupSettingByID_GroupSetting) GetGroup() *GetGroupSettingByID_GroupSetting_Group { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.Group +} +func (t *GetGroupSettingByID_GroupSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.CreatedAt +} +func (t *GetGroupSettingByID_GroupSetting) GetCreatedBy() *string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.CreatedBy +} +func (t *GetGroupSettingByID_GroupSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.UpdatedAt +} +func (t *GetGroupSettingByID_GroupSetting) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.UpdatedBy +} + +type GetGroupSettings_GroupSettings_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetGroupSettings_GroupSettings_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.ID +} +func (t *GetGroupSettings_GroupSettings_Edges_Node_Group) GetName() string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.Name +} + +type GetGroupSettings_GroupSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *GetGroupSettings_GroupSettings_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.ID +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return &t.Visibility +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetGroup() *GetGroupSettings_GroupSettings_Edges_Node_Group { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.Group +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetGroupSettings_GroupSettings_Edges struct { + Node *GetGroupSettings_GroupSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupSettings_GroupSettings_Edges) GetNode() *GetGroupSettings_GroupSettings_Edges_Node { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges{} + } + return t.Node +} + +type GetGroupSettings_GroupSettings struct { + Edges []*GetGroupSettings_GroupSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupSettings_GroupSettings) GetEdges() []*GetGroupSettings_GroupSettings_Edges { + if t == nil { + t = &GetGroupSettings_GroupSettings{} + } + return t.Edges +} + +type UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group) GetID() string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group{} + } + return t.ID +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group) GetName() string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group{} + } + return t.Name +} + +type UpdateGroupSetting_UpdateGroupSetting_GroupSetting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetID() string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.ID +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return &t.JoinPolicy +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetSyncToGithub() *bool { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.SyncToGithub +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetSyncToSlack() *bool { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.SyncToSlack +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetTags() []string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.Tags +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetVisibility() *enums.Visibility { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return &t.Visibility +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetGroup() *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.Group +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.CreatedAt +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetCreatedBy() *string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.CreatedBy +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.UpdatedAt +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.UpdatedBy +} + +type UpdateGroupSetting_UpdateGroupSetting struct { + GroupSetting UpdateGroupSetting_UpdateGroupSetting_GroupSetting "json:\"groupSetting\" graphql:\"groupSetting\"" +} + +func (t *UpdateGroupSetting_UpdateGroupSetting) GetGroupSetting() *UpdateGroupSetting_UpdateGroupSetting_GroupSetting { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting{} + } + return &t.GroupSetting +} + +type GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID *string "json:\"groupID,omitempty\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetGroupID() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Visibility +} + +type GetAllGroupSettingHistories_GroupSettingHistories_Edges struct { + Node *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges) GetNode() *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges{} + } + return t.Node +} + +type GetAllGroupSettingHistories_GroupSettingHistories struct { + Edges []*GetAllGroupSettingHistories_GroupSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupSettingHistories_GroupSettingHistories) GetEdges() []*GetAllGroupSettingHistories_GroupSettingHistories_Edges { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories{} + } + return t.Edges +} + +type GetGroupSettingHistories_GroupSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID *string "json:\"groupID,omitempty\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetGroupID() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Visibility +} + +type GetGroupSettingHistories_GroupSettingHistories_Edges struct { + Node *GetGroupSettingHistories_GroupSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges) GetNode() *GetGroupSettingHistories_GroupSettingHistories_Edges_Node { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges{} + } + return t.Node +} + +type GetGroupSettingHistories_GroupSettingHistories struct { + Edges []*GetGroupSettingHistories_GroupSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupSettingHistories_GroupSettingHistories) GetEdges() []*GetGroupSettingHistories_GroupSettingHistories_Edges { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories{} + } + return t.Edges +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations{} + } + return t.ID +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization{} + } + return t.ID +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events{} + } + return t.ID +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Description +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.ID +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetKind() *string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Kind +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetName() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Name +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetSecretName() *string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.SecretName +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetIntegrations() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Integrations +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetOrganization() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Organization +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetEvents() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Events +} + +type CreateBulkCSVHush_CreateBulkCSVHush struct { + Hushes []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes "json:\"hushes,omitempty\" graphql:\"hushes\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush) GetHushes() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush{} + } + return t.Hushes +} + +type CreateBulkHush_CreateBulkHush_Hushes_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes_Integrations) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes_Integrations{} + } + return t.ID +} + +type CreateBulkHush_CreateBulkHush_Hushes_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes_Organization) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes_Organization{} + } + return t.ID +} + +type CreateBulkHush_CreateBulkHush_Hushes_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes_Events) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes_Events{} + } + return t.ID +} + +type CreateBulkHush_CreateBulkHush_Hushes struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*CreateBulkHush_CreateBulkHush_Hushes_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*CreateBulkHush_CreateBulkHush_Hushes_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*CreateBulkHush_CreateBulkHush_Hushes_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetDescription() *string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Description +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.ID +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetKind() *string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Kind +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetName() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Name +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetSecretName() *string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.SecretName +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetIntegrations() []*CreateBulkHush_CreateBulkHush_Hushes_Integrations { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Integrations +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetOrganization() []*CreateBulkHush_CreateBulkHush_Hushes_Organization { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Organization +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetEvents() []*CreateBulkHush_CreateBulkHush_Hushes_Events { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Events +} + +type CreateBulkHush_CreateBulkHush struct { + Hushes []*CreateBulkHush_CreateBulkHush_Hushes "json:\"hushes,omitempty\" graphql:\"hushes\"" +} + +func (t *CreateBulkHush_CreateBulkHush) GetHushes() []*CreateBulkHush_CreateBulkHush_Hushes { + if t == nil { + t = &CreateBulkHush_CreateBulkHush{} + } + return t.Hushes +} + +type CreateHush_CreateHush_Hush_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateHush_CreateHush_Hush_Integrations) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush_Integrations{} + } + return t.ID +} + +type CreateHush_CreateHush_Hush_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateHush_CreateHush_Hush_Organization) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush_Organization{} + } + return t.ID +} + +type CreateHush_CreateHush_Hush_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateHush_CreateHush_Hush_Events) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush_Events{} + } + return t.ID +} + +type CreateHush_CreateHush_Hush struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*CreateHush_CreateHush_Hush_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*CreateHush_CreateHush_Hush_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*CreateHush_CreateHush_Hush_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateHush_CreateHush_Hush) GetDescription() *string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Description +} +func (t *CreateHush_CreateHush_Hush) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.ID +} +func (t *CreateHush_CreateHush_Hush) GetKind() *string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Kind +} +func (t *CreateHush_CreateHush_Hush) GetName() string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Name +} +func (t *CreateHush_CreateHush_Hush) GetSecretName() *string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.SecretName +} +func (t *CreateHush_CreateHush_Hush) GetIntegrations() []*CreateHush_CreateHush_Hush_Integrations { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Integrations +} +func (t *CreateHush_CreateHush_Hush) GetOrganization() []*CreateHush_CreateHush_Hush_Organization { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Organization +} +func (t *CreateHush_CreateHush_Hush) GetEvents() []*CreateHush_CreateHush_Hush_Events { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Events +} + +type CreateHush_CreateHush struct { + Hush CreateHush_CreateHush_Hush "json:\"hush\" graphql:\"hush\"" +} + +func (t *CreateHush_CreateHush) GetHush() *CreateHush_CreateHush_Hush { + if t == nil { + t = &CreateHush_CreateHush{} + } + return &t.Hush +} + +type GetAllHushes_Hushes_Edges_Node_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node_Integrations) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node_Integrations{} + } + return t.ID +} + +type GetAllHushes_Hushes_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node_Organization{} + } + return t.ID +} + +type GetAllHushes_Hushes_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node_Events{} + } + return t.ID +} + +type GetAllHushes_Hushes_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*GetAllHushes_Hushes_Edges_Node_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*GetAllHushes_Hushes_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*GetAllHushes_Hushes_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Description +} +func (t *GetAllHushes_Hushes_Edges_Node) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.ID +} +func (t *GetAllHushes_Hushes_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Kind +} +func (t *GetAllHushes_Hushes_Edges_Node) GetName() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Name +} +func (t *GetAllHushes_Hushes_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.SecretName +} +func (t *GetAllHushes_Hushes_Edges_Node) GetIntegrations() []*GetAllHushes_Hushes_Edges_Node_Integrations { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Integrations +} +func (t *GetAllHushes_Hushes_Edges_Node) GetOrganization() []*GetAllHushes_Hushes_Edges_Node_Organization { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Organization +} +func (t *GetAllHushes_Hushes_Edges_Node) GetEvents() []*GetAllHushes_Hushes_Edges_Node_Events { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Events +} +func (t *GetAllHushes_Hushes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllHushes_Hushes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllHushes_Hushes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllHushes_Hushes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllHushes_Hushes_Edges struct { + Node *GetAllHushes_Hushes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllHushes_Hushes_Edges) GetNode() *GetAllHushes_Hushes_Edges_Node { + if t == nil { + t = &GetAllHushes_Hushes_Edges{} + } + return t.Node +} + +type GetAllHushes_Hushes struct { + Edges []*GetAllHushes_Hushes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllHushes_Hushes) GetEdges() []*GetAllHushes_Hushes_Edges { + if t == nil { + t = &GetAllHushes_Hushes{} + } + return t.Edges +} + +type GetHushByID_Hush_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushByID_Hush_Integrations) GetID() string { + if t == nil { + t = &GetHushByID_Hush_Integrations{} + } + return t.ID +} + +type GetHushByID_Hush_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushByID_Hush_Organization) GetID() string { + if t == nil { + t = &GetHushByID_Hush_Organization{} + } + return t.ID +} + +type GetHushByID_Hush_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushByID_Hush_Events) GetID() string { + if t == nil { + t = &GetHushByID_Hush_Events{} + } + return t.ID +} + +type GetHushByID_Hush struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*GetHushByID_Hush_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*GetHushByID_Hush_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*GetHushByID_Hush_Events "json:\"events,omitempty\" graphql:\"events\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetHushByID_Hush) GetDescription() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Description +} +func (t *GetHushByID_Hush) GetID() string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.ID +} +func (t *GetHushByID_Hush) GetKind() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Kind +} +func (t *GetHushByID_Hush) GetName() string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Name +} +func (t *GetHushByID_Hush) GetSecretName() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.SecretName +} +func (t *GetHushByID_Hush) GetIntegrations() []*GetHushByID_Hush_Integrations { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Integrations +} +func (t *GetHushByID_Hush) GetOrganization() []*GetHushByID_Hush_Organization { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Organization +} +func (t *GetHushByID_Hush) GetEvents() []*GetHushByID_Hush_Events { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Events +} +func (t *GetHushByID_Hush) GetCreatedAt() *time.Time { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.CreatedAt +} +func (t *GetHushByID_Hush) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.UpdatedAt +} +func (t *GetHushByID_Hush) GetCreatedBy() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.CreatedBy +} +func (t *GetHushByID_Hush) GetUpdatedBy() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.UpdatedBy +} + +type GetHushes_Hushes_Edges_Node_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushes_Hushes_Edges_Node_Integrations) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node_Integrations{} + } + return t.ID +} + +type GetHushes_Hushes_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushes_Hushes_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node_Organization{} + } + return t.ID +} + +type GetHushes_Hushes_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushes_Hushes_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node_Events{} + } + return t.ID +} + +type GetHushes_Hushes_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*GetHushes_Hushes_Edges_Node_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*GetHushes_Hushes_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*GetHushes_Hushes_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetHushes_Hushes_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Description +} +func (t *GetHushes_Hushes_Edges_Node) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.ID +} +func (t *GetHushes_Hushes_Edges_Node) GetKind() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Kind +} +func (t *GetHushes_Hushes_Edges_Node) GetName() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Name +} +func (t *GetHushes_Hushes_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.SecretName +} +func (t *GetHushes_Hushes_Edges_Node) GetIntegrations() []*GetHushes_Hushes_Edges_Node_Integrations { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Integrations +} +func (t *GetHushes_Hushes_Edges_Node) GetOrganization() []*GetHushes_Hushes_Edges_Node_Organization { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Organization +} +func (t *GetHushes_Hushes_Edges_Node) GetEvents() []*GetHushes_Hushes_Edges_Node_Events { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Events +} +func (t *GetHushes_Hushes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetHushes_Hushes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetHushes_Hushes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetHushes_Hushes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetHushes_Hushes_Edges struct { + Node *GetHushes_Hushes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetHushes_Hushes_Edges) GetNode() *GetHushes_Hushes_Edges_Node { + if t == nil { + t = &GetHushes_Hushes_Edges{} + } + return t.Node +} + +type GetHushes_Hushes struct { + Edges []*GetHushes_Hushes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetHushes_Hushes) GetEdges() []*GetHushes_Hushes_Edges { + if t == nil { + t = &GetHushes_Hushes{} + } + return t.Edges +} + +type UpdateHush_UpdateHush_Hush_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateHush_UpdateHush_Hush_Integrations) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush_Integrations{} + } + return t.ID +} + +type UpdateHush_UpdateHush_Hush_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateHush_UpdateHush_Hush_Organization) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush_Organization{} + } + return t.ID +} + +type UpdateHush_UpdateHush_Hush_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateHush_UpdateHush_Hush_Events) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush_Events{} + } + return t.ID +} + +type UpdateHush_UpdateHush_Hush struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*UpdateHush_UpdateHush_Hush_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*UpdateHush_UpdateHush_Hush_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*UpdateHush_UpdateHush_Hush_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *UpdateHush_UpdateHush_Hush) GetDescription() *string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Description +} +func (t *UpdateHush_UpdateHush_Hush) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.ID +} +func (t *UpdateHush_UpdateHush_Hush) GetKind() *string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Kind +} +func (t *UpdateHush_UpdateHush_Hush) GetName() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Name +} +func (t *UpdateHush_UpdateHush_Hush) GetSecretName() *string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.SecretName +} +func (t *UpdateHush_UpdateHush_Hush) GetIntegrations() []*UpdateHush_UpdateHush_Hush_Integrations { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Integrations +} +func (t *UpdateHush_UpdateHush_Hush) GetOrganization() []*UpdateHush_UpdateHush_Hush_Organization { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Organization +} +func (t *UpdateHush_UpdateHush_Hush) GetEvents() []*UpdateHush_UpdateHush_Hush_Events { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Events +} + +type UpdateHush_UpdateHush struct { + Hush UpdateHush_UpdateHush_Hush "json:\"hush\" graphql:\"hush\"" +} + +func (t *UpdateHush_UpdateHush) GetHush() *UpdateHush_UpdateHush_Hush { + if t == nil { + t = &UpdateHush_UpdateHush{} + } + return &t.Hush +} + +type GetAllHushHistories_HushHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.SecretName +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllHushHistories_HushHistories_Edges struct { + Node *GetAllHushHistories_HushHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllHushHistories_HushHistories_Edges) GetNode() *GetAllHushHistories_HushHistories_Edges_Node { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges{} + } + return t.Node +} + +type GetAllHushHistories_HushHistories struct { + Edges []*GetAllHushHistories_HushHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllHushHistories_HushHistories) GetEdges() []*GetAllHushHistories_HushHistories_Edges { + if t == nil { + t = &GetAllHushHistories_HushHistories{} + } + return t.Edges +} + +type GetHushHistories_HushHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetHushHistories_HushHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Description +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.ID +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Name +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.SecretName +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetHushHistories_HushHistories_Edges struct { + Node *GetHushHistories_HushHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetHushHistories_HushHistories_Edges) GetNode() *GetHushHistories_HushHistories_Edges_Node { + if t == nil { + t = &GetHushHistories_HushHistories_Edges{} + } + return t.Node +} + +type GetHushHistories_HushHistories struct { + Edges []*GetHushHistories_HushHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetHushHistories_HushHistories) GetEdges() []*GetHushHistories_HushHistories_Edges { + if t == nil { + t = &GetHushHistories_HushHistories{} + } + return t.Edges +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks{} + } + return t.ID +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks{} + } + return t.Enabled +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Description +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.ID +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetKind() *string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Kind +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetName() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Name +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.OwnerID +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetOwner() *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Owner +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetSecrets() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Secrets +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetOauth2tokens() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Oauth2tokens +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetEvents() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Events +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetWebhooks() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Webhooks +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration struct { + Integrations []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration) GetIntegrations() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration{} + } + return t.Integrations +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Events) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Events{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks{} + } + return t.ID +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks{} + } + return t.Enabled +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetDescription() *string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Description +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.ID +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetKind() *string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Kind +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetName() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Name +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetOwnerID() *string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.OwnerID +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetOwner() *CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Owner +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetSecrets() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Secrets +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetOauth2tokens() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Oauth2tokens +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetEvents() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Events { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Events +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetWebhooks() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Webhooks +} + +type CreateBulkIntegration_CreateBulkIntegration struct { + Integrations []*CreateBulkIntegration_CreateBulkIntegration_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration) GetIntegrations() []*CreateBulkIntegration_CreateBulkIntegration_Integrations { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration{} + } + return t.Integrations +} + +type CreateIntegration_CreateIntegration_Integration_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Owner) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Owner{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Secrets) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Secrets{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Oauth2tokens) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Oauth2tokens{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Events) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Events{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Webhooks) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Webhooks{} + } + return t.ID +} +func (t *CreateIntegration_CreateIntegration_Integration_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateIntegration_CreateIntegration_Integration_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Webhooks{} + } + return t.Enabled +} + +type CreateIntegration_CreateIntegration_Integration struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *CreateIntegration_CreateIntegration_Integration_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*CreateIntegration_CreateIntegration_Integration_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*CreateIntegration_CreateIntegration_Integration_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*CreateIntegration_CreateIntegration_Integration_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*CreateIntegration_CreateIntegration_Integration_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration) GetDescription() *string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Description +} +func (t *CreateIntegration_CreateIntegration_Integration) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.ID +} +func (t *CreateIntegration_CreateIntegration_Integration) GetKind() *string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Kind +} +func (t *CreateIntegration_CreateIntegration_Integration) GetName() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Name +} +func (t *CreateIntegration_CreateIntegration_Integration) GetOwnerID() *string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.OwnerID +} +func (t *CreateIntegration_CreateIntegration_Integration) GetOwner() *CreateIntegration_CreateIntegration_Integration_Owner { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Owner +} +func (t *CreateIntegration_CreateIntegration_Integration) GetSecrets() []*CreateIntegration_CreateIntegration_Integration_Secrets { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Secrets +} +func (t *CreateIntegration_CreateIntegration_Integration) GetOauth2tokens() []*CreateIntegration_CreateIntegration_Integration_Oauth2tokens { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Oauth2tokens +} +func (t *CreateIntegration_CreateIntegration_Integration) GetEvents() []*CreateIntegration_CreateIntegration_Integration_Events { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Events +} +func (t *CreateIntegration_CreateIntegration_Integration) GetWebhooks() []*CreateIntegration_CreateIntegration_Integration_Webhooks { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Webhooks +} + +type CreateIntegration_CreateIntegration struct { + Integration CreateIntegration_CreateIntegration_Integration "json:\"integration\" graphql:\"integration\"" +} + +func (t *CreateIntegration_CreateIntegration) GetIntegration() *CreateIntegration_CreateIntegration_Integration { + if t == nil { + t = &CreateIntegration_CreateIntegration{} + } + return &t.Integration +} + +type DeleteIntegration_DeleteIntegration struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteIntegration_DeleteIntegration) GetDeletedID() string { + if t == nil { + t = &DeleteIntegration_DeleteIntegration{} + } + return t.DeletedID +} + +type GetAllIntegrations_Integrations_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Secrets) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Secrets{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Events{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Webhooks) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.ID +} +func (t *GetAllIntegrations_Integrations_Edges_Node_Webhooks) GetDestinationURL() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.DestinationURL +} +func (t *GetAllIntegrations_Integrations_Edges_Node_Webhooks) GetEnabled() bool { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.Enabled +} + +type GetAllIntegrations_Integrations_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *GetAllIntegrations_Integrations_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*GetAllIntegrations_Integrations_Edges_Node_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*GetAllIntegrations_Integrations_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*GetAllIntegrations_Integrations_Edges_Node_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Description +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.ID +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Kind +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetName() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Name +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetOwner() *GetAllIntegrations_Integrations_Edges_Node_Owner { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Owner +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetSecrets() []*GetAllIntegrations_Integrations_Edges_Node_Secrets { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Secrets +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetOauth2tokens() []*GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Oauth2tokens +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetEvents() []*GetAllIntegrations_Integrations_Edges_Node_Events { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Events +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetWebhooks() []*GetAllIntegrations_Integrations_Edges_Node_Webhooks { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Webhooks +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllIntegrations_Integrations_Edges struct { + Node *GetAllIntegrations_Integrations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllIntegrations_Integrations_Edges) GetNode() *GetAllIntegrations_Integrations_Edges_Node { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges{} + } + return t.Node +} + +type GetAllIntegrations_Integrations struct { + Edges []*GetAllIntegrations_Integrations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllIntegrations_Integrations) GetEdges() []*GetAllIntegrations_Integrations_Edges { + if t == nil { + t = &GetAllIntegrations_Integrations{} + } + return t.Edges +} + +type GetIntegrationByID_Integration_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Owner) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Owner{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Secrets) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Secrets{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Oauth2tokens) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Oauth2tokens{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Events) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Events{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *GetIntegrationByID_Integration_Webhooks) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Webhooks{} + } + return t.ID +} +func (t *GetIntegrationByID_Integration_Webhooks) GetDestinationURL() string { + if t == nil { + t = &GetIntegrationByID_Integration_Webhooks{} + } + return t.DestinationURL +} +func (t *GetIntegrationByID_Integration_Webhooks) GetEnabled() bool { + if t == nil { + t = &GetIntegrationByID_Integration_Webhooks{} + } + return t.Enabled +} + +type GetIntegrationByID_Integration struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *GetIntegrationByID_Integration_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*GetIntegrationByID_Integration_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*GetIntegrationByID_Integration_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*GetIntegrationByID_Integration_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*GetIntegrationByID_Integration_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetIntegrationByID_Integration) GetDescription() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Description +} +func (t *GetIntegrationByID_Integration) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.ID +} +func (t *GetIntegrationByID_Integration) GetKind() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Kind +} +func (t *GetIntegrationByID_Integration) GetName() string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Name +} +func (t *GetIntegrationByID_Integration) GetOwnerID() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.OwnerID +} +func (t *GetIntegrationByID_Integration) GetOwner() *GetIntegrationByID_Integration_Owner { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Owner +} +func (t *GetIntegrationByID_Integration) GetSecrets() []*GetIntegrationByID_Integration_Secrets { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Secrets +} +func (t *GetIntegrationByID_Integration) GetOauth2tokens() []*GetIntegrationByID_Integration_Oauth2tokens { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Oauth2tokens +} +func (t *GetIntegrationByID_Integration) GetEvents() []*GetIntegrationByID_Integration_Events { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Events +} +func (t *GetIntegrationByID_Integration) GetWebhooks() []*GetIntegrationByID_Integration_Webhooks { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Webhooks +} +func (t *GetIntegrationByID_Integration) GetCreatedAt() *time.Time { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.CreatedAt +} +func (t *GetIntegrationByID_Integration) GetCreatedBy() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.CreatedBy +} +func (t *GetIntegrationByID_Integration) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.UpdatedAt +} +func (t *GetIntegrationByID_Integration) GetUpdatedBy() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.UpdatedBy +} + +type GetIntegrations_Integrations_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Owner{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Secrets) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Secrets{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Oauth2tokens) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Oauth2tokens{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Events{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Webhooks) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.ID +} +func (t *GetIntegrations_Integrations_Edges_Node_Webhooks) GetDestinationURL() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.DestinationURL +} +func (t *GetIntegrations_Integrations_Edges_Node_Webhooks) GetEnabled() bool { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.Enabled +} + +type GetIntegrations_Integrations_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *GetIntegrations_Integrations_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*GetIntegrations_Integrations_Edges_Node_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*GetIntegrations_Integrations_Edges_Node_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*GetIntegrations_Integrations_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*GetIntegrations_Integrations_Edges_Node_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Description +} +func (t *GetIntegrations_Integrations_Edges_Node) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.ID +} +func (t *GetIntegrations_Integrations_Edges_Node) GetKind() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Kind +} +func (t *GetIntegrations_Integrations_Edges_Node) GetName() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Name +} +func (t *GetIntegrations_Integrations_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.OwnerID +} +func (t *GetIntegrations_Integrations_Edges_Node) GetOwner() *GetIntegrations_Integrations_Edges_Node_Owner { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Owner +} +func (t *GetIntegrations_Integrations_Edges_Node) GetSecrets() []*GetIntegrations_Integrations_Edges_Node_Secrets { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Secrets +} +func (t *GetIntegrations_Integrations_Edges_Node) GetOauth2tokens() []*GetIntegrations_Integrations_Edges_Node_Oauth2tokens { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Oauth2tokens +} +func (t *GetIntegrations_Integrations_Edges_Node) GetEvents() []*GetIntegrations_Integrations_Edges_Node_Events { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Events +} +func (t *GetIntegrations_Integrations_Edges_Node) GetWebhooks() []*GetIntegrations_Integrations_Edges_Node_Webhooks { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Webhooks +} +func (t *GetIntegrations_Integrations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetIntegrations_Integrations_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetIntegrations_Integrations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetIntegrations_Integrations_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedBy +} + +type GetIntegrations_Integrations_Edges struct { + Node *GetIntegrations_Integrations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetIntegrations_Integrations_Edges) GetNode() *GetIntegrations_Integrations_Edges_Node { + if t == nil { + t = &GetIntegrations_Integrations_Edges{} + } + return t.Node +} + +type GetIntegrations_Integrations struct { + Edges []*GetIntegrations_Integrations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetIntegrations_Integrations) GetEdges() []*GetIntegrations_Integrations_Edges { + if t == nil { + t = &GetIntegrations_Integrations{} + } + return t.Edges +} + +type UpdateIntegration_UpdateIntegration_Integration_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Owner) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Owner{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Secrets) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Secrets{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Events) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Events{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Webhooks) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Webhooks{} + } + return t.ID +} +func (t *UpdateIntegration_UpdateIntegration_Integration_Webhooks) GetDestinationURL() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Webhooks{} + } + return t.DestinationURL +} +func (t *UpdateIntegration_UpdateIntegration_Integration_Webhooks) GetEnabled() bool { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Webhooks{} + } + return t.Enabled +} + +type UpdateIntegration_UpdateIntegration_Integration struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *UpdateIntegration_UpdateIntegration_Integration_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*UpdateIntegration_UpdateIntegration_Integration_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*UpdateIntegration_UpdateIntegration_Integration_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*UpdateIntegration_UpdateIntegration_Integration_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration) GetDescription() *string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Description +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.ID +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetKind() *string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Kind +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetName() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Name +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetOwnerID() *string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.OwnerID +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetOwner() *UpdateIntegration_UpdateIntegration_Integration_Owner { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Owner +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetSecrets() []*UpdateIntegration_UpdateIntegration_Integration_Secrets { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Secrets +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetOauth2tokens() []*UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Oauth2tokens +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetEvents() []*UpdateIntegration_UpdateIntegration_Integration_Events { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Events +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetWebhooks() []*UpdateIntegration_UpdateIntegration_Integration_Webhooks { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Webhooks +} + +type UpdateIntegration_UpdateIntegration struct { + Integration UpdateIntegration_UpdateIntegration_Integration "json:\"integration\" graphql:\"integration\"" +} + +func (t *UpdateIntegration_UpdateIntegration) GetIntegration() *UpdateIntegration_UpdateIntegration_Integration { + if t == nil { + t = &UpdateIntegration_UpdateIntegration{} + } + return &t.Integration +} + +type GetAllIntegrationHistories_IntegrationHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllIntegrationHistories_IntegrationHistories_Edges struct { + Node *GetAllIntegrationHistories_IntegrationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges) GetNode() *GetAllIntegrationHistories_IntegrationHistories_Edges_Node { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges{} + } + return t.Node +} + +type GetAllIntegrationHistories_IntegrationHistories struct { + Edges []*GetAllIntegrationHistories_IntegrationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllIntegrationHistories_IntegrationHistories) GetEdges() []*GetAllIntegrationHistories_IntegrationHistories_Edges { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories{} + } + return t.Edges +} + +type GetIntegrationHistories_IntegrationHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetIntegrationHistories_IntegrationHistories_Edges struct { + Node *GetIntegrationHistories_IntegrationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetIntegrationHistories_IntegrationHistories_Edges) GetNode() *GetIntegrationHistories_IntegrationHistories_Edges_Node { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges{} + } + return t.Node +} + +type GetIntegrationHistories_IntegrationHistories struct { + Edges []*GetIntegrationHistories_IntegrationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetIntegrationHistories_IntegrationHistories) GetEdges() []*GetIntegrationHistories_IntegrationHistories_Edges { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories{} + } + return t.Edges +} + +type CreateBulkCSVInvite_CreateBulkCSVInvite_Invites struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetExpires() *time.Time { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.Expires +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetID() string { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.ID +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetRecipient() string { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.Recipient +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetRequestorID() *string { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.RequestorID +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return &t.Role +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetSendAttempts() int64 { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.SendAttempts +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetStatus() *enums.InviteStatus { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return &t.Status +} + +type CreateBulkCSVInvite_CreateBulkCSVInvite struct { + Invites []*CreateBulkCSVInvite_CreateBulkCSVInvite_Invites "json:\"invites,omitempty\" graphql:\"invites\"" +} + +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite) GetInvites() []*CreateBulkCSVInvite_CreateBulkCSVInvite_Invites { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite{} + } + return t.Invites +} + +type CreateBulkInvite_CreateBulkInvite_Invites struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetExpires() *time.Time { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.Expires +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetID() string { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.ID +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetRecipient() string { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.Recipient +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetRequestorID() *string { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.RequestorID +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return &t.Role +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetSendAttempts() int64 { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.SendAttempts +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetStatus() *enums.InviteStatus { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return &t.Status +} + +type CreateBulkInvite_CreateBulkInvite struct { + Invites []*CreateBulkInvite_CreateBulkInvite_Invites "json:\"invites,omitempty\" graphql:\"invites\"" +} + +func (t *CreateBulkInvite_CreateBulkInvite) GetInvites() []*CreateBulkInvite_CreateBulkInvite_Invites { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite{} + } + return t.Invites +} + +type CreateInvite_CreateInvite_Invite_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateInvite_CreateInvite_Invite_Owner) GetID() string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite_Owner{} + } + return t.ID +} + +type CreateInvite_CreateInvite_Invite struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" + Owner *CreateInvite_CreateInvite_Invite_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateInvite_CreateInvite_Invite) GetExpires() *time.Time { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.Expires +} +func (t *CreateInvite_CreateInvite_Invite) GetID() string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.ID +} +func (t *CreateInvite_CreateInvite_Invite) GetRecipient() string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.Recipient +} +func (t *CreateInvite_CreateInvite_Invite) GetRequestorID() *string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.RequestorID +} +func (t *CreateInvite_CreateInvite_Invite) GetRole() *enums.Role { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return &t.Role +} +func (t *CreateInvite_CreateInvite_Invite) GetSendAttempts() int64 { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.SendAttempts +} +func (t *CreateInvite_CreateInvite_Invite) GetStatus() *enums.InviteStatus { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return &t.Status +} +func (t *CreateInvite_CreateInvite_Invite) GetOwner() *CreateInvite_CreateInvite_Invite_Owner { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.Owner +} + +type CreateInvite_CreateInvite struct { + Invite CreateInvite_CreateInvite_Invite "json:\"invite\" graphql:\"invite\"" +} + +func (t *CreateInvite_CreateInvite) GetInvite() *CreateInvite_CreateInvite_Invite { + if t == nil { + t = &CreateInvite_CreateInvite{} + } + return &t.Invite +} + +type DeleteInvite_DeleteInvite struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteInvite_DeleteInvite) GetDeletedID() string { + if t == nil { + t = &DeleteInvite_DeleteInvite{} + } + return t.DeletedID +} + +type GetInviteByID_Invite_Owner struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetInviteByID_Invite_Owner) GetDisplayName() string { + if t == nil { + t = &GetInviteByID_Invite_Owner{} + } + return t.DisplayName +} +func (t *GetInviteByID_Invite_Owner) GetID() string { + if t == nil { + t = &GetInviteByID_Invite_Owner{} + } + return t.ID +} +func (t *GetInviteByID_Invite_Owner) GetName() string { + if t == nil { + t = &GetInviteByID_Invite_Owner{} + } + return t.Name +} + +type GetInviteByID_Invite struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" + Owner *GetInviteByID_Invite_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetInviteByID_Invite) GetExpires() *time.Time { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.Expires +} +func (t *GetInviteByID_Invite) GetID() string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.ID +} +func (t *GetInviteByID_Invite) GetRecipient() string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.Recipient +} +func (t *GetInviteByID_Invite) GetRequestorID() *string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.RequestorID +} +func (t *GetInviteByID_Invite) GetRole() *enums.Role { + if t == nil { + t = &GetInviteByID_Invite{} + } + return &t.Role +} +func (t *GetInviteByID_Invite) GetSendAttempts() int64 { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.SendAttempts +} +func (t *GetInviteByID_Invite) GetStatus() *enums.InviteStatus { + if t == nil { + t = &GetInviteByID_Invite{} + } + return &t.Status +} +func (t *GetInviteByID_Invite) GetOwner() *GetInviteByID_Invite_Owner { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.Owner +} +func (t *GetInviteByID_Invite) GetCreatedAt() *time.Time { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.CreatedAt +} +func (t *GetInviteByID_Invite) GetCreatedBy() *string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.CreatedBy +} +func (t *GetInviteByID_Invite) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.UpdatedAt +} +func (t *GetInviteByID_Invite) GetUpdatedBy() *string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.UpdatedBy +} + +type GetAllInvites_Invites_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *GetAllInvites_Invites_Edges_Node) GetID() string { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return t.ID +} +func (t *GetAllInvites_Invites_Edges_Node) GetRecipient() string { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return t.Recipient +} +func (t *GetAllInvites_Invites_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return &t.Role +} +func (t *GetAllInvites_Invites_Edges_Node) GetStatus() *enums.InviteStatus { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return &t.Status +} + +type GetAllInvites_Invites_Edges struct { + Node *GetAllInvites_Invites_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllInvites_Invites_Edges) GetNode() *GetAllInvites_Invites_Edges_Node { + if t == nil { + t = &GetAllInvites_Invites_Edges{} + } + return t.Node +} + +type GetAllInvites_Invites struct { + Edges []*GetAllInvites_Invites_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllInvites_Invites) GetEdges() []*GetAllInvites_Invites_Edges { + if t == nil { + t = &GetAllInvites_Invites{} + } + return t.Edges +} + +type InvitesByOrgID_Invites_Edges_Node_Owner_Invites struct { + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetRecipient() string { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return t.Recipient +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetRequestorID() *string { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return t.RequestorID +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetRole() *enums.Role { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return &t.Role +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetSendAttempts() int64 { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return t.SendAttempts +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetStatus() *enums.InviteStatus { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return &t.Status +} + +type InvitesByOrgID_Invites_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + Invites []*InvitesByOrgID_Invites_Edges_Node_Owner_Invites "json:\"invites,omitempty\" graphql:\"invites\"" +} + +func (t *InvitesByOrgID_Invites_Edges_Node_Owner) GetID() string { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner{} + } + return t.ID +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner) GetInvites() []*InvitesByOrgID_Invites_Edges_Node_Owner_Invites { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner{} + } + return t.Invites +} + +type InvitesByOrgID_Invites_Edges_Node struct { + Owner *InvitesByOrgID_Invites_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *InvitesByOrgID_Invites_Edges_Node) GetOwner() *InvitesByOrgID_Invites_Edges_Node_Owner { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node{} + } + return t.Owner +} + +type InvitesByOrgID_Invites_Edges struct { + Node *InvitesByOrgID_Invites_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *InvitesByOrgID_Invites_Edges) GetNode() *InvitesByOrgID_Invites_Edges_Node { + if t == nil { + t = &InvitesByOrgID_Invites_Edges{} + } + return t.Node +} + +type InvitesByOrgID_Invites struct { + Edges []*InvitesByOrgID_Invites_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *InvitesByOrgID_Invites) GetEdges() []*InvitesByOrgID_Invites_Edges { + if t == nil { + t = &InvitesByOrgID_Invites{} + } + return t.Edges +} + +type GetAllNoteHistories_NoteHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetText() string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.Text +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllNoteHistories_NoteHistories_Edges struct { + Node *GetAllNoteHistories_NoteHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllNoteHistories_NoteHistories_Edges) GetNode() *GetAllNoteHistories_NoteHistories_Edges_Node { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges{} + } + return t.Node +} + +type GetAllNoteHistories_NoteHistories struct { + Edges []*GetAllNoteHistories_NoteHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllNoteHistories_NoteHistories) GetEdges() []*GetAllNoteHistories_NoteHistories_Edges { + if t == nil { + t = &GetAllNoteHistories_NoteHistories{} + } + return t.Edges +} + +type GetNoteHistories_NoteHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.ID +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetText() string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.Text +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetNoteHistories_NoteHistories_Edges struct { + Node *GetNoteHistories_NoteHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetNoteHistories_NoteHistories_Edges) GetNode() *GetNoteHistories_NoteHistories_Edges_Node { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges{} + } + return t.Node +} + +type GetNoteHistories_NoteHistories struct { + Edges []*GetNoteHistories_NoteHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetNoteHistories_NoteHistories) GetEdges() []*GetNoteHistories_NoteHistories_Edges { + if t == nil { + t = &GetNoteHistories_NoteHistories{} + } + return t.Edges +} + +type GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node struct { + AuthStyle string "json:\"authStyle\" graphql:\"authStyle\"" + AuthURL string "json:\"authURL\" graphql:\"authURL\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ClientSecret string "json:\"clientSecret\" graphql:\"clientSecret\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + InfoURL string "json:\"infoURL\" graphql:\"infoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + RedirectURL string "json:\"redirectURL\" graphql:\"redirectURL\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Scopes string "json:\"scopes\" graphql:\"scopes\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TokenURL string "json:\"tokenURL\" graphql:\"tokenURL\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthStyle() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthStyle +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientID() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientID +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientSecret() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientSecret +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetInfoURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.InfoURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRedirectURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.RedirectURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetScopes() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Scopes +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTokenURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.TokenURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllOauthProviderHistories_OauthProviderHistories_Edges struct { + Node *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges) GetNode() *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges{} + } + return t.Node +} + +type GetAllOauthProviderHistories_OauthProviderHistories struct { + Edges []*GetAllOauthProviderHistories_OauthProviderHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOauthProviderHistories_OauthProviderHistories) GetEdges() []*GetAllOauthProviderHistories_OauthProviderHistories_Edges { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories{} + } + return t.Edges +} + +type GetOauthProviderHistories_OauthProviderHistories_Edges_Node struct { + AuthStyle string "json:\"authStyle\" graphql:\"authStyle\"" + AuthURL string "json:\"authURL\" graphql:\"authURL\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ClientSecret string "json:\"clientSecret\" graphql:\"clientSecret\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + InfoURL string "json:\"infoURL\" graphql:\"infoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + RedirectURL string "json:\"redirectURL\" graphql:\"redirectURL\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Scopes string "json:\"scopes\" graphql:\"scopes\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TokenURL string "json:\"tokenURL\" graphql:\"tokenURL\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthStyle() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthStyle +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientID() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientID +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientSecret() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientSecret +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetInfoURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.InfoURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Name +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRedirectURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.RedirectURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetScopes() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Scopes +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTokenURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.TokenURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetOauthProviderHistories_OauthProviderHistories_Edges struct { + Node *GetOauthProviderHistories_OauthProviderHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges) GetNode() *GetOauthProviderHistories_OauthProviderHistories_Edges_Node { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges{} + } + return t.Node +} + +type GetOauthProviderHistories_OauthProviderHistories struct { + Edges []*GetOauthProviderHistories_OauthProviderHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOauthProviderHistories_OauthProviderHistories) GetEdges() []*GetOauthProviderHistories_OauthProviderHistories_Edges { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories{} + } + return t.Edges +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration) GetID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration{} + } + return t.ID +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events{} + } + return t.ID +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsEmail() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmail +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsEmailVerified() bool { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmailVerified +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsGroups() []string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsGroups +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsPreferredUsername() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsPreferredUsername +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsUserID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUserID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsUsername() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUsername +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClientID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClientID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetConnectorData() []string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorData +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetConnectorID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetLastUsed() *time.Time { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return &t.LastUsed +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetNonce() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Nonce +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Scopes +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetIntegration() []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Integration +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetEvents() []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Events +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken struct { + OhAuthTooTokens []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens "json:\"ohAuthTooTokens,omitempty\" graphql:\"ohAuthTooTokens\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken) GetOhAuthTooTokens() []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken{} + } + return t.OhAuthTooTokens +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration) GetID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration{} + } + return t.ID +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events) GetID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events{} + } + return t.ID +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsEmail() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmail +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsEmailVerified() bool { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmailVerified +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsGroups() []string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsGroups +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsPreferredUsername() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsPreferredUsername +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsUserID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUserID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsUsername() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUsername +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClientID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClientID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetConnectorData() []string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorData +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetConnectorID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetLastUsed() *time.Time { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return &t.LastUsed +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetNonce() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Nonce +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Scopes +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetIntegration() []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Integration +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetEvents() []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Events +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken struct { + OhAuthTooTokens []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens "json:\"ohAuthTooTokens,omitempty\" graphql:\"ohAuthTooTokens\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken) GetOhAuthTooTokens() []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken{} + } + return t.OhAuthTooTokens +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration) GetID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration{} + } + return t.ID +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events) GetID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events{} + } + return t.ID +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsEmail() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmail +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsEmailVerified() bool { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmailVerified +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsGroups() []string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsGroups +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsPreferredUsername() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsPreferredUsername +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsUserID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUserID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsUsername() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUsername +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClientID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClientID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetConnectorData() []string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorData +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetConnectorID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetLastUsed() *time.Time { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return &t.LastUsed +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetNonce() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Nonce +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetScopes() []string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Scopes +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetIntegration() []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Integration +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetEvents() []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Events +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken struct { + OhAuthTooToken CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken "json:\"ohAuthTooToken\" graphql:\"ohAuthTooToken\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken) GetOhAuthTooToken() *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken{} + } + return &t.OhAuthTooToken +} + +type DeleteOhAuthTooToken_DeleteOhAuthTooToken struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteOhAuthTooToken_DeleteOhAuthTooToken) GetDeletedID() string { + if t == nil { + t = &DeleteOhAuthTooToken_DeleteOhAuthTooToken{} + } + return t.DeletedID +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration) GetID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration{} + } + return t.ID +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events{} + } + return t.ID +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsEmail() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsEmail +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsEmailVerified() bool { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsEmailVerified +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsGroups() []string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsGroups +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsPreferredUsername() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsPreferredUsername +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsUserID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsUserID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsUsername() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsUsername +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClientID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClientID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetConnectorData() []string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ConnectorData +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetConnectorID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ConnectorID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetLastUsed() *time.Time { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return &t.LastUsed +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetNonce() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Nonce +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetScopes() []string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Scopes +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetIntegration() []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Integration +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetEvents() []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Events +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges struct { + Node *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges) GetNode() *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges{} + } + return t.Node +} + +type GetOhAuthTooTokens_OhAuthTooTokens struct { + Edges []*GetOhAuthTooTokens_OhAuthTooTokens_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens) GetEdges() []*GetOhAuthTooTokens_OhAuthTooTokens_Edges { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens{} + } + return t.Edges +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration) GetID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration{} + } + return t.ID +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events) GetID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events{} + } + return t.ID +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsEmail() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmail +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsEmailVerified() bool { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmailVerified +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsGroups() []string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsGroups +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsPreferredUsername() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsPreferredUsername +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsUserID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUserID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsUsername() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUsername +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClientID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClientID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetConnectorData() []string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorData +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetConnectorID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetLastUsed() *time.Time { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return &t.LastUsed +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetNonce() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Nonce +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetScopes() []string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Scopes +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetIntegration() []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Integration +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetEvents() []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Events +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken struct { + OhAuthTooToken UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken "json:\"ohAuthTooToken\" graphql:\"ohAuthTooToken\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken) GetOhAuthTooToken() *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken{} + } + return &t.OhAuthTooToken +} + +type CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetID() string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.ID +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetName() string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.Name +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.DisplayName +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.Description +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetPersonalOrg() *bool { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.PersonalOrg +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetTags() []string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.Tags +} + +type CreateBulkCSVOrganization_CreateBulkCSVOrganization struct { + Organizations []*CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization) GetOrganizations() []*CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization{} + } + return t.Organizations +} + +type CreateBulkOrganization_CreateBulkOrganization_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetID() string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.ID +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetName() string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.Name +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetDisplayName() string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.DisplayName +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetDescription() *string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.Description +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetPersonalOrg() *bool { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.PersonalOrg +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetTags() []string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.Tags +} + +type CreateBulkOrganization_CreateBulkOrganization struct { + Organizations []*CreateBulkOrganization_CreateBulkOrganization_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkOrganization_CreateBulkOrganization) GetOrganizations() []*CreateBulkOrganization_CreateBulkOrganization_Organizations { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization{} + } + return t.Organizations +} + +type CreateOrganization_CreateOrganization_Organization_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.CreatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.UpdatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetCreatedBy() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.CreatedBy +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetUpdatedBy() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.UpdatedBy +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetDomains() []string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.Domains +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingContact() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingContact +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingEmail() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingEmail +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingPhone() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingPhone +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingAddress() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingAddress +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.TaxIdentifier +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.GeoLocation +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetTags() []string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.Tags +} + +type CreateOrganization_CreateOrganization_Organization_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Parent) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Parent{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization_Parent) GetName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Parent{} + } + return t.Name +} + +type CreateOrganization_CreateOrganization_Organization_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.Name +} +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.Description +} + +type CreateOrganization_CreateOrganization_Organization_Children_Edges struct { + Node *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges) GetNode() *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges{} + } + return t.Node +} + +type CreateOrganization_CreateOrganization_Organization_Children struct { + Edges []*CreateOrganization_CreateOrganization_Organization_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Children) GetEdges() []*CreateOrganization_CreateOrganization_Organization_Children_Edges { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children{} + } + return t.Edges +} + +type CreateOrganization_CreateOrganization_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + Setting *CreateOrganization_CreateOrganization_Organization_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + Parent *CreateOrganization_CreateOrganization_Organization_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children CreateOrganization_CreateOrganization_Organization_Children "json:\"children\" graphql:\"children\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization) GetName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Name +} +func (t *CreateOrganization_CreateOrganization_Organization) GetDisplayName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.DisplayName +} +func (t *CreateOrganization_CreateOrganization_Organization) GetDescription() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Description +} +func (t *CreateOrganization_CreateOrganization_Organization) GetPersonalOrg() *bool { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.PersonalOrg +} +func (t *CreateOrganization_CreateOrganization_Organization) GetTags() []string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Tags +} +func (t *CreateOrganization_CreateOrganization_Organization) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.CreatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.UpdatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization) GetSetting() *CreateOrganization_CreateOrganization_Organization_Setting { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Setting +} +func (t *CreateOrganization_CreateOrganization_Organization) GetParent() *CreateOrganization_CreateOrganization_Organization_Parent { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Parent +} +func (t *CreateOrganization_CreateOrganization_Organization) GetChildren() *CreateOrganization_CreateOrganization_Organization_Children { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return &t.Children +} + +type CreateOrganization_CreateOrganization struct { + Organization CreateOrganization_CreateOrganization_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *CreateOrganization_CreateOrganization) GetOrganization() *CreateOrganization_CreateOrganization_Organization { + if t == nil { + t = &CreateOrganization_CreateOrganization{} + } + return &t.Organization +} + +type DeleteOrganization_DeleteOrganization struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteOrganization_DeleteOrganization) GetDeletedID() string { + if t == nil { + t = &DeleteOrganization_DeleteOrganization{} + } + return t.DeletedID +} + +type GetAllOrganizations_Organizations_Edges_Node_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Parent) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Parent{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Parent) GetName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Parent{} + } + return t.Name +} + +type GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Name +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Description +} + +type GetAllOrganizations_Organizations_Edges_Node_Children_Edges struct { + Node *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges) GetNode() *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges{} + } + return t.Node +} + +type GetAllOrganizations_Organizations_Edges_Node_Children struct { + Edges []*GetAllOrganizations_Organizations_Edges_Node_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Children) GetEdges() []*GetAllOrganizations_Organizations_Edges_Node_Children_Edges { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children{} + } + return t.Edges +} + +type GetAllOrganizations_Organizations_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetAllOrganizations_Organizations_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetAllOrganizations_Organizations_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members) GetUser() *GetAllOrganizations_Organizations_Edges_Node_Members_User { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members{} + } + return &t.User +} + +type GetAllOrganizations_Organizations_Edges_Node_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetDomains() []string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Domains +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingContact() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingContact +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingEmail() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingEmail +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingPhone() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingPhone +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingAddress +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.TaxIdentifier +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.GeoLocation +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Tags +} + +type GetAllOrganizations_Organizations_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Parent *GetAllOrganizations_Organizations_Edges_Node_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children GetAllOrganizations_Organizations_Edges_Node_Children "json:\"children\" graphql:\"children\"" + Members []*GetAllOrganizations_Organizations_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *GetAllOrganizations_Organizations_Edges_Node_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Name +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Description +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetParent() *GetAllOrganizations_Organizations_Edges_Node_Parent { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Parent +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetChildren() *GetAllOrganizations_Organizations_Edges_Node_Children { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return &t.Children +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetMembers() []*GetAllOrganizations_Organizations_Edges_Node_Members { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Members +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetSetting() *GetAllOrganizations_Organizations_Edges_Node_Setting { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Setting +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.UpdatedAt +} + +type GetAllOrganizations_Organizations_Edges struct { + Node *GetAllOrganizations_Organizations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizations_Organizations_Edges) GetNode() *GetAllOrganizations_Organizations_Edges_Node { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges{} + } + return t.Node +} + +type GetAllOrganizations_Organizations struct { + Edges []*GetAllOrganizations_Organizations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizations_Organizations) GetEdges() []*GetAllOrganizations_Organizations_Edges { + if t == nil { + t = &GetAllOrganizations_Organizations{} + } + return t.Edges +} + +type GetOrganizationByID_Organization_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizationByID_Organization_Parent) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Parent{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Parent) GetName() string { + if t == nil { + t = &GetOrganizationByID_Organization_Parent{} + } + return t.Name +} + +type GetOrganizationByID_Organization_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.Description +} + +type GetOrganizationByID_Organization_Children_Edges struct { + Node *GetOrganizationByID_Organization_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationByID_Organization_Children_Edges) GetNode() *GetOrganizationByID_Organization_Children_Edges_Node { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges{} + } + return t.Node +} + +type GetOrganizationByID_Organization_Children struct { + Edges []*GetOrganizationByID_Organization_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationByID_Organization_Children) GetEdges() []*GetOrganizationByID_Organization_Children_Edges { + if t == nil { + t = &GetOrganizationByID_Organization_Children{} + } + return t.Edges +} + +type GetOrganizationByID_Organization_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetOrganizationByID_Organization_Members_User) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Members_User{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Members_User) GetFirstName() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Members_User{} + } + return t.FirstName +} +func (t *GetOrganizationByID_Organization_Members_User) GetLastName() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Members_User{} + } + return t.LastName +} + +type GetOrganizationByID_Organization_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetOrganizationByID_Organization_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetOrganizationByID_Organization_Members) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Members{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Members) GetRole() *enums.Role { + if t == nil { + t = &GetOrganizationByID_Organization_Members{} + } + return &t.Role +} +func (t *GetOrganizationByID_Organization_Members) GetUser() *GetOrganizationByID_Organization_Members_User { + if t == nil { + t = &GetOrganizationByID_Organization_Members{} + } + return &t.User +} + +type GetOrganizationByID_Organization_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetOrganizationByID_Organization_Setting) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.CreatedAt +} +func (t *GetOrganizationByID_Organization_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.UpdatedAt +} +func (t *GetOrganizationByID_Organization_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.CreatedBy +} +func (t *GetOrganizationByID_Organization_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.UpdatedBy +} +func (t *GetOrganizationByID_Organization_Setting) GetDomains() []string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.Domains +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingContact +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingEmail +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingPhone +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingAddress +} +func (t *GetOrganizationByID_Organization_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationByID_Organization_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.GeoLocation +} +func (t *GetOrganizationByID_Organization_Setting) GetTags() []string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.Tags +} + +type GetOrganizationByID_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Parent *GetOrganizationByID_Organization_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children GetOrganizationByID_Organization_Children "json:\"children\" graphql:\"children\"" + Members []*GetOrganizationByID_Organization_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *GetOrganizationByID_Organization_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationByID_Organization) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization) GetName() string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Name +} +func (t *GetOrganizationByID_Organization) GetDisplayName() string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.DisplayName +} +func (t *GetOrganizationByID_Organization) GetDescription() *string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Description +} +func (t *GetOrganizationByID_Organization) GetPersonalOrg() *bool { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.PersonalOrg +} +func (t *GetOrganizationByID_Organization) GetTags() []string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Tags +} +func (t *GetOrganizationByID_Organization) GetParent() *GetOrganizationByID_Organization_Parent { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Parent +} +func (t *GetOrganizationByID_Organization) GetChildren() *GetOrganizationByID_Organization_Children { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return &t.Children +} +func (t *GetOrganizationByID_Organization) GetMembers() []*GetOrganizationByID_Organization_Members { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Members +} +func (t *GetOrganizationByID_Organization) GetSetting() *GetOrganizationByID_Organization_Setting { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Setting +} +func (t *GetOrganizationByID_Organization) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.CreatedAt +} +func (t *GetOrganizationByID_Organization) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.CreatedBy +} +func (t *GetOrganizationByID_Organization) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.UpdatedAt +} +func (t *GetOrganizationByID_Organization) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.UpdatedBy +} + +type GetOrganizations_Organizations_Edges_Node_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Parent) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Parent{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Parent) GetName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Parent{} + } + return t.Name +} + +type GetOrganizations_Organizations_Edges_Node_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Description +} + +type GetOrganizations_Organizations_Edges_Node_Children_Edges struct { + Node *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges) GetNode() *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges{} + } + return t.Node +} + +type GetOrganizations_Organizations_Edges_Node_Children struct { + Edges []*GetOrganizations_Organizations_Edges_Node_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Children) GetEdges() []*GetOrganizations_Organizations_Edges_Node_Children_Edges { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children{} + } + return t.Edges +} + +type GetOrganizations_Organizations_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetOrganizations_Organizations_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetOrganizations_Organizations_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetOrganizations_Organizations_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetOrganizations_Organizations_Edges_Node_Members) GetUser() *GetOrganizations_Organizations_Edges_Node_Members_User { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members{} + } + return &t.User +} + +type GetOrganizations_Organizations_Edges_Node_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetDomains() []string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Domains +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingContact() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingContact +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingEmail +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingPhone +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingAddress +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.TaxIdentifier +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.GeoLocation +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Tags +} + +type GetOrganizations_Organizations_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Parent *GetOrganizations_Organizations_Edges_Node_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children GetOrganizations_Organizations_Edges_Node_Children "json:\"children\" graphql:\"children\"" + Members []*GetOrganizations_Organizations_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *GetOrganizations_Organizations_Edges_Node_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizations_Organizations_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizations_Organizations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Description +} +func (t *GetOrganizations_Organizations_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetOrganizations_Organizations_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizations_Organizations_Edges_Node) GetParent() *GetOrganizations_Organizations_Edges_Node_Parent { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Parent +} +func (t *GetOrganizations_Organizations_Edges_Node) GetChildren() *GetOrganizations_Organizations_Edges_Node_Children { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return &t.Children +} +func (t *GetOrganizations_Organizations_Edges_Node) GetMembers() []*GetOrganizations_Organizations_Edges_Node_Members { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Members +} +func (t *GetOrganizations_Organizations_Edges_Node) GetSetting() *GetOrganizations_Organizations_Edges_Node_Setting { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Setting +} +func (t *GetOrganizations_Organizations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizations_Organizations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.UpdatedAt +} + +type GetOrganizations_Organizations_Edges struct { + Node *GetOrganizations_Organizations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizations_Organizations_Edges) GetNode() *GetOrganizations_Organizations_Edges_Node { + if t == nil { + t = &GetOrganizations_Organizations_Edges{} + } + return t.Node +} + +type GetOrganizations_Organizations struct { + Edges []*GetOrganizations_Organizations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizations_Organizations) GetEdges() []*GetOrganizations_Organizations_Edges { + if t == nil { + t = &GetOrganizations_Organizations{} + } + return t.Edges +} + +type UpdateOrganization_UpdateOrganization_Organization_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *UpdateOrganization_UpdateOrganization_Organization_Members) GetID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Members{} + } + return t.ID +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Members) GetRole() *enums.Role { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Members{} + } + return &t.Role +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Members) GetUserID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Members{} + } + return t.UserID +} + +type UpdateOrganization_UpdateOrganization_Organization_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.ID +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.CreatedAt +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.UpdatedAt +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetCreatedBy() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.CreatedBy +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.UpdatedBy +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetDomains() []string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.Domains +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingContact() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingContact +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingEmail() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingEmail +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingPhone() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingPhone +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingAddress() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingAddress +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.TaxIdentifier +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.GeoLocation +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetTags() []string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.Tags +} + +type UpdateOrganization_UpdateOrganization_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Members []*UpdateOrganization_UpdateOrganization_Organization_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *UpdateOrganization_UpdateOrganization_Organization_Setting "json:\"setting,omitempty\" graphql:\"setting\"" +} + +func (t *UpdateOrganization_UpdateOrganization_Organization) GetID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.ID +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetName() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Name +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetDisplayName() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.DisplayName +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetDescription() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Description +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetPersonalOrg() *bool { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.PersonalOrg +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetTags() []string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Tags +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetMembers() []*UpdateOrganization_UpdateOrganization_Organization_Members { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Members +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetSetting() *UpdateOrganization_UpdateOrganization_Organization_Setting { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Setting +} + +type UpdateOrganization_UpdateOrganization struct { + Organization UpdateOrganization_UpdateOrganization_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *UpdateOrganization_UpdateOrganization) GetOrganization() *UpdateOrganization_UpdateOrganization_Organization { + if t == nil { + t = &UpdateOrganization_UpdateOrganization{} + } + return &t.Organization +} + +type GetAllOrganizationHistories_OrganizationHistories_Edges_Node struct { + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DedicatedDb bool "json:\"dedicatedDb\" graphql:\"dedicatedDb\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetDedicatedDb() bool { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DedicatedDb +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllOrganizationHistories_OrganizationHistories_Edges struct { + Node *GetAllOrganizationHistories_OrganizationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges) GetNode() *GetAllOrganizationHistories_OrganizationHistories_Edges_Node { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges{} + } + return t.Node +} + +type GetAllOrganizationHistories_OrganizationHistories struct { + Edges []*GetAllOrganizationHistories_OrganizationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizationHistories_OrganizationHistories) GetEdges() []*GetAllOrganizationHistories_OrganizationHistories_Edges { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories{} + } + return t.Edges +} + +type GetOrganizationHistories_OrganizationHistories_Edges_Node struct { + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DedicatedDb bool "json:\"dedicatedDb\" graphql:\"dedicatedDb\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetDedicatedDb() bool { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DedicatedDb +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetOrganizationHistories_OrganizationHistories_Edges struct { + Node *GetOrganizationHistories_OrganizationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationHistories_OrganizationHistories_Edges) GetNode() *GetOrganizationHistories_OrganizationHistories_Edges_Node { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges{} + } + return t.Node +} + +type GetOrganizationHistories_OrganizationHistories struct { + Edges []*GetOrganizationHistories_OrganizationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationHistories_OrganizationHistories) GetEdges() []*GetOrganizationHistories_OrganizationHistories_Edges { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories{} + } + return t.Edges +} + +type GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.Name +} + +type GetAllOrganizationSettings_OrganizationSettings_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingContact +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Domains +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetOrganization() *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Organization +} + +type GetAllOrganizationSettings_OrganizationSettings_Edges struct { + Node *GetAllOrganizationSettings_OrganizationSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges) GetNode() *GetAllOrganizationSettings_OrganizationSettings_Edges_Node { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges{} + } + return t.Node +} + +type GetAllOrganizationSettings_OrganizationSettings struct { + Edges []*GetAllOrganizationSettings_OrganizationSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings) GetEdges() []*GetAllOrganizationSettings_OrganizationSettings_Edges { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings{} + } + return t.Edges +} + +type GetOrganizationSettingByID_OrganizationSetting_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizationSettingByID_OrganizationSetting_Organization) GetID() string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting_Organization{} + } + return t.ID +} +func (t *GetOrganizationSettingByID_OrganizationSetting_Organization) GetName() string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting_Organization{} + } + return t.Name +} + +type GetOrganizationSettingByID_OrganizationSetting struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *GetOrganizationSettingByID_OrganizationSetting_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingAddress +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingContact +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingEmail +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingPhone +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.CreatedAt +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.CreatedBy +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetDomains() []string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.Domains +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.GeoLocation +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetID() string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.ID +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetTags() []string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.Tags +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.UpdatedAt +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.UpdatedBy +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetOrganization() *GetOrganizationSettingByID_OrganizationSetting_Organization { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.Organization +} + +type GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.Name +} + +type GetOrganizationSettings_OrganizationSettings_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingContact +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Domains +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetOrganization() *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Organization +} + +type GetOrganizationSettings_OrganizationSettings_Edges struct { + Node *GetOrganizationSettings_OrganizationSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings_Edges) GetNode() *GetOrganizationSettings_OrganizationSettings_Edges_Node { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges{} + } + return t.Node +} + +type GetOrganizationSettings_OrganizationSettings struct { + Edges []*GetOrganizationSettings_OrganizationSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings) GetEdges() []*GetOrganizationSettings_OrganizationSettings_Edges { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings{} + } + return t.Edges +} + +type UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization) GetID() string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization{} + } + return t.ID +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization) GetName() string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization{} + } + return t.Name +} + +type UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingAddress() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingAddress +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingContact() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingContact +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingEmail() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingEmail +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingPhone() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingPhone +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.CreatedAt +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetCreatedBy() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.CreatedBy +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetDomains() []string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.Domains +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetGeoLocation() *enums.Region { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.GeoLocation +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetID() string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.ID +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetTags() []string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.Tags +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetTaxIdentifier() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.TaxIdentifier +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.UpdatedAt +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.UpdatedBy +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetOrganization() *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.Organization +} + +type UpdateOrganizationSetting_UpdateOrganizationSetting struct { + OrganizationSetting UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting "json:\"organizationSetting\" graphql:\"organizationSetting\"" +} + +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting) GetOrganizationSetting() *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting{} + } + return &t.OrganizationSetting +} + +type GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingContact +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOrganizationID() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges struct { + Node *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges) GetNode() *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges{} + } + return t.Node +} + +type GetAllOrganizationSettingHistories_OrganizationSettingHistories struct { + Edges []*GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories) GetEdges() []*GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories{} + } + return t.Edges +} + +type GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingContact +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOrganizationID() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetOrganizationSettingHistories_OrganizationSettingHistories_Edges struct { + Node *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges) GetNode() *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges{} + } + return t.Node +} + +type GetOrganizationSettingHistories_OrganizationSettingHistories struct { + Edges []*GetOrganizationSettingHistories_OrganizationSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories) GetEdges() []*GetOrganizationSettingHistories_OrganizationSettingHistories_Edges { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories{} + } + return t.Edges +} + +type AddUserToOrgWithRole_CreateOrgMembership_OrgMembership struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" +} + +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetID() string { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return t.ID +} +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetRole() *enums.Role { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return &t.Role +} +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetUserID() string { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return t.UserID +} +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetOrganizationID() string { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return t.OrganizationID +} + +type AddUserToOrgWithRole_CreateOrgMembership struct { + OrgMembership AddUserToOrgWithRole_CreateOrgMembership_OrgMembership "json:\"orgMembership\" graphql:\"orgMembership\"" +} + +func (t *AddUserToOrgWithRole_CreateOrgMembership) GetOrgMembership() *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership{} + } + return &t.OrgMembership +} + +type CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetID() string { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return t.ID +} +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetOrganizationID() string { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return t.OrganizationID +} +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return &t.Role +} +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return t.UserID +} + +type CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership struct { + OrgMemberships []*CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" +} + +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership) GetOrgMemberships() []*CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership{} + } + return t.OrgMemberships +} + +type CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetID() string { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return t.ID +} +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetOrganizationID() string { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return t.OrganizationID +} +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return &t.Role +} +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return t.UserID +} + +type CreateBulkOrgMembers_CreateBulkOrgMembership struct { + OrgMemberships []*CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" +} + +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership) GetOrgMemberships() []*CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership{} + } + return t.OrgMemberships +} + +type GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User struct { + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetFirstName() *string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.FirstName +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetLastName() *string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.LastName +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.ID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetDisplayName() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.DisplayName +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetEmail() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.Email +} + +type GetOrgMembersByOrgID_OrgMemberships_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + UserID string "json:\"userID\" graphql:\"userID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return t.ID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetUserID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return t.UserID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return &t.Role +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetUser() *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return &t.User +} + +type GetOrgMembersByOrgID_OrgMemberships_Edges struct { + Node *GetOrgMembersByOrgID_OrgMemberships_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges) GetNode() *GetOrgMembersByOrgID_OrgMemberships_Edges_Node { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges{} + } + return t.Node +} + +type GetOrgMembersByOrgID_OrgMemberships struct { + Edges []*GetOrgMembersByOrgID_OrgMemberships_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships) GetEdges() []*GetOrgMembersByOrgID_OrgMemberships_Edges { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships{} + } + return t.Edges +} + +type RemoveUserFromOrg_DeleteOrgMembership struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *RemoveUserFromOrg_DeleteOrgMembership) GetDeletedID() string { + if t == nil { + t = &RemoveUserFromOrg_DeleteOrgMembership{} + } + return t.DeletedID +} + +type UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" +} + +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetID() string { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return t.ID +} +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetRole() *enums.Role { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return &t.Role +} +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetUserID() string { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return t.UserID +} +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetOrganizationID() string { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return t.OrganizationID +} + +type UpdateUserRoleInOrg_UpdateOrgMembership struct { + OrgMembership UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership "json:\"orgMembership\" graphql:\"orgMembership\"" +} + +func (t *UpdateUserRoleInOrg_UpdateOrgMembership) GetOrgMembership() *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership{} + } + return &t.OrgMembership +} + +type GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetAllOrgMembershipHistories_OrgMembershipHistories_Edges struct { + Node *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges) GetNode() *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges{} + } + return t.Node +} + +type GetAllOrgMembershipHistories_OrgMembershipHistories struct { + Edges []*GetAllOrgMembershipHistories_OrgMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories) GetEdges() []*GetAllOrgMembershipHistories_OrgMembershipHistories_Edges { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories{} + } + return t.Edges +} + +type GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetOrgMembershipHistories_OrgMembershipHistories_Edges struct { + Node *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges) GetNode() *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges{} + } + return t.Node +} + +type GetOrgMembershipHistories_OrgMembershipHistories struct { + Edges []*GetOrgMembershipHistories_OrgMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrgMembershipHistories_OrgMembershipHistories) GetEdges() []*GetOrgMembershipHistories_OrgMembershipHistories_Edges { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories{} + } + return t.Edges +} + +type CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations) GetID() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.ID +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations) GetName() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.Name +} + +type CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Description +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.ExpiresAt +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetID() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.ID +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.LastUsedAt +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetName() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Name +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Scopes +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetToken() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Token +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedBy +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetOrganizations() []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Organizations +} + +type CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken struct { + PersonalAccessTokens []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens "json:\"personalAccessTokens,omitempty\" graphql:\"personalAccessTokens\"" +} + +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken) GetPersonalAccessTokens() []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken{} + } + return t.PersonalAccessTokens +} + +type CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations) GetID() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.ID +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations) GetName() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.Name +} + +type CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetDescription() *string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Description +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.ExpiresAt +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetID() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.ID +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.LastUsedAt +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetName() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Name +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Scopes +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetToken() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Token +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedAt +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedBy +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetOrganizations() []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Organizations +} + +type CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken struct { + PersonalAccessTokens []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens "json:\"personalAccessTokens,omitempty\" graphql:\"personalAccessTokens\"" +} + +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken) GetPersonalAccessTokens() []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken{} + } + return t.PersonalAccessTokens +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations) GetID() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.ID +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations) GetName() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.Name +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner) GetID() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner{} + } + return t.ID +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" + Owner CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner "json:\"owner\" graphql:\"owner\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetDescription() *string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Description +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetExpiresAt() *time.Time { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.ExpiresAt +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.ID +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.LastUsedAt +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetName() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Name +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetScopes() []string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Scopes +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetToken() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Token +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedAt +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetUpdatedBy() *string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedBy +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetOrganizations() []*CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Organizations +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetOwner() *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return &t.Owner +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken struct { + PersonalAccessToken CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken "json:\"personalAccessToken\" graphql:\"personalAccessToken\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken) GetPersonalAccessToken() *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken{} + } + return &t.PersonalAccessToken +} + +type DeletePersonalAccessToken_DeletePersonalAccessToken struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeletePersonalAccessToken_DeletePersonalAccessToken) GetDeletedID() string { + if t == nil { + t = &DeletePersonalAccessToken_DeletePersonalAccessToken{} + } + return t.DeletedID +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations) GetID() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations{} + } + return t.ID +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations) GetName() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations{} + } + return t.Name +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Description +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetID() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.ID +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.LastUsedAt +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetName() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Name +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetScopes() []string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Scopes +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetToken() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Token +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetOrganizations() []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Organizations +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens_Edges struct { + Node *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges) GetNode() *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges{} + } + return t.Node +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens struct { + Edges []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens) GetEdges() []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens{} + } + return t.Edges +} + +type GetPersonalAccessTokenByID_PersonalAccessToken_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetPersonalAccessTokenByID_PersonalAccessToken_Organizations) GetID() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken_Organizations{} + } + return t.ID +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken_Organizations) GetName() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken_Organizations{} + } + return t.Name +} + +type GetPersonalAccessTokenByID_PersonalAccessToken struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*GetPersonalAccessTokenByID_PersonalAccessToken_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetDescription() *string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Description +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetExpiresAt() *time.Time { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.ExpiresAt +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetID() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.ID +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.LastUsedAt +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetName() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Name +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetScopes() []string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Scopes +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetToken() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Token +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.UpdatedAt +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetUpdatedBy() *string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.UpdatedBy +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetOrganizations() []*GetPersonalAccessTokenByID_PersonalAccessToken_Organizations { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Organizations +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations) GetID() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.ID +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations) GetName() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.Name +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner) GetID() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner{} + } + return t.ID +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" + Owner UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner "json:\"owner\" graphql:\"owner\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetDescription() *string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Description +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetExpiresAt() *time.Time { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.ExpiresAt +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetID() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.ID +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.LastUsedAt +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetName() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Name +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetScopes() []string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Scopes +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetToken() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Token +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedAt +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetUpdatedBy() *string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedBy +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetOrganizations() []*UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Organizations +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetOwner() *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return &t.Owner +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken struct { + PersonalAccessToken UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken "json:\"personalAccessToken\" graphql:\"personalAccessToken\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken) GetPersonalAccessToken() *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken{} + } + return &t.PersonalAccessToken +} + +type Search_Search_Nodes_OrganizationSearchResult_Organizations struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetDescription() *string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.Description +} +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetDisplayName() string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.DisplayName +} +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetID() string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.ID +} +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetName() string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.Name +} + +type Search_Search_Nodes_OrganizationSearchResult struct { + Organizations []*Search_Search_Nodes_OrganizationSearchResult_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *Search_Search_Nodes_OrganizationSearchResult) GetOrganizations() []*Search_Search_Nodes_OrganizationSearchResult_Organizations { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult{} + } + return t.Organizations +} + +type Search_Search_Nodes_GroupSearchResult_Groups struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetDescription() *string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.Description +} +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetDisplayName() string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.DisplayName +} +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetID() string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.ID +} +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetName() string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.Name +} + +type Search_Search_Nodes_GroupSearchResult struct { + Groups []*Search_Search_Nodes_GroupSearchResult_Groups "json:\"groups,omitempty\" graphql:\"groups\"" +} + +func (t *Search_Search_Nodes_GroupSearchResult) GetGroups() []*Search_Search_Nodes_GroupSearchResult_Groups { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult{} + } + return t.Groups +} + +type Search_Search_Nodes_UserSearchResult_Users struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *Search_Search_Nodes_UserSearchResult_Users) GetDisplayName() string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.DisplayName +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetEmail() string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.Email +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetFirstName() *string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.FirstName +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetID() string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.ID +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetLastName() *string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.LastName +} + +type Search_Search_Nodes_UserSearchResult struct { + Users []*Search_Search_Nodes_UserSearchResult_Users "json:\"users,omitempty\" graphql:\"users\"" +} + +func (t *Search_Search_Nodes_UserSearchResult) GetUsers() []*Search_Search_Nodes_UserSearchResult_Users { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult{} + } + return t.Users +} + +type Search_Search_Nodes_SubscriberSearchResult_Subscribers struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *Search_Search_Nodes_SubscriberSearchResult_Subscribers) GetActive() bool { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult_Subscribers{} + } + return t.Active +} +func (t *Search_Search_Nodes_SubscriberSearchResult_Subscribers) GetEmail() string { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult_Subscribers{} + } + return t.Email +} +func (t *Search_Search_Nodes_SubscriberSearchResult_Subscribers) GetID() string { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult_Subscribers{} + } + return t.ID +} + +type Search_Search_Nodes_SubscriberSearchResult struct { + Subscribers []*Search_Search_Nodes_SubscriberSearchResult_Subscribers "json:\"subscribers,omitempty\" graphql:\"subscribers\"" +} + +func (t *Search_Search_Nodes_SubscriberSearchResult) GetSubscribers() []*Search_Search_Nodes_SubscriberSearchResult_Subscribers { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult{} + } + return t.Subscribers +} + +type Search_Search_Nodes struct { + OrganizationSearchResult Search_Search_Nodes_OrganizationSearchResult "graphql:\"... on OrganizationSearchResult\"" + GroupSearchResult Search_Search_Nodes_GroupSearchResult "graphql:\"... on GroupSearchResult\"" + UserSearchResult Search_Search_Nodes_UserSearchResult "graphql:\"... on UserSearchResult\"" + SubscriberSearchResult Search_Search_Nodes_SubscriberSearchResult "graphql:\"... on SubscriberSearchResult\"" +} + +func (t *Search_Search_Nodes) GetOrganizationSearchResult() *Search_Search_Nodes_OrganizationSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.OrganizationSearchResult +} +func (t *Search_Search_Nodes) GetGroupSearchResult() *Search_Search_Nodes_GroupSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.GroupSearchResult +} +func (t *Search_Search_Nodes) GetUserSearchResult() *Search_Search_Nodes_UserSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.UserSearchResult +} +func (t *Search_Search_Nodes) GetSubscriberSearchResult() *Search_Search_Nodes_SubscriberSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.SubscriberSearchResult +} + +type Search_Search struct { + Nodes []*Search_Search_Nodes "json:\"nodes\" graphql:\"nodes\"" +} + +func (t *Search_Search) GetNodes() []*Search_Search_Nodes { + if t == nil { + t = &Search_Search{} + } + return t.Nodes +} + +type CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetActive() bool { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.Active +} +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetEmail() string { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.Email +} +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetID() string { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.ID +} +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetVerifiedEmail() bool { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.VerifiedEmail +} + +type CreateBulkCSVSubscriber_CreateBulkCSVSubscriber struct { + Subscribers []*CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers "json:\"subscribers,omitempty\" graphql:\"subscribers\"" +} + +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber) GetSubscribers() []*CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber{} + } + return t.Subscribers +} + +type CreateBulkSubscriber_CreateBulkSubscriber_Subscribers struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetActive() bool { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.Active +} +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetEmail() string { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.Email +} +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetID() string { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.ID +} +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetVerifiedEmail() bool { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.VerifiedEmail +} + +type CreateBulkSubscriber_CreateBulkSubscriber struct { + Subscribers []*CreateBulkSubscriber_CreateBulkSubscriber_Subscribers "json:\"subscribers,omitempty\" graphql:\"subscribers\"" +} + +func (t *CreateBulkSubscriber_CreateBulkSubscriber) GetSubscribers() []*CreateBulkSubscriber_CreateBulkSubscriber_Subscribers { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber{} + } + return t.Subscribers +} + +type CreateSubscriber_CreateSubscriber_Subscriber struct { + Active bool "json:\"active\" graphql:\"active\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetActive() bool { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.Active +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.CreatedAt +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetCreatedBy() *string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.CreatedBy +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetEmail() string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.Email +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetID() string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.ID +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.UpdatedAt +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetUpdatedBy() *string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.UpdatedBy +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetVerifiedEmail() bool { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.VerifiedEmail +} + +type CreateSubscriber_CreateSubscriber struct { + Subscriber CreateSubscriber_CreateSubscriber_Subscriber "json:\"subscriber\" graphql:\"subscriber\"" +} + +func (t *CreateSubscriber_CreateSubscriber) GetSubscriber() *CreateSubscriber_CreateSubscriber_Subscriber { + if t == nil { + t = &CreateSubscriber_CreateSubscriber{} + } + return &t.Subscriber +} + +type DeleteSubscriber_DeleteSubscriber struct { + Email string "json:\"email\" graphql:\"email\"" +} + +func (t *DeleteSubscriber_DeleteSubscriber) GetEmail() string { + if t == nil { + t = &DeleteSubscriber_DeleteSubscriber{} + } + return t.Email +} + +type GetAllSubscribers_Subscribers_Edges_Node struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetActive() bool { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.Active +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetEmail() string { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.Email +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetID() string { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.ID +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetVerifiedEmail() bool { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.VerifiedEmail +} + +type GetAllSubscribers_Subscribers_Edges struct { + Node *GetAllSubscribers_Subscribers_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllSubscribers_Subscribers_Edges) GetNode() *GetAllSubscribers_Subscribers_Edges_Node { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges{} + } + return t.Node +} + +type GetAllSubscribers_Subscribers struct { + Edges []*GetAllSubscribers_Subscribers_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllSubscribers_Subscribers) GetEdges() []*GetAllSubscribers_Subscribers_Edges { + if t == nil { + t = &GetAllSubscribers_Subscribers{} + } + return t.Edges +} + +type GetSubscriberByEmail_Subscriber struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *GetSubscriberByEmail_Subscriber) GetActive() bool { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.Active +} +func (t *GetSubscriberByEmail_Subscriber) GetEmail() string { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.Email +} +func (t *GetSubscriberByEmail_Subscriber) GetID() string { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.ID +} +func (t *GetSubscriberByEmail_Subscriber) GetOwnerID() *string { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.OwnerID +} +func (t *GetSubscriberByEmail_Subscriber) GetVerifiedEmail() bool { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.VerifiedEmail +} + +type GetSubscribers_Subscribers_Edges_Node struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *GetSubscribers_Subscribers_Edges_Node) GetActive() bool { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.Active +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetEmail() string { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.Email +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetID() string { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.ID +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.OwnerID +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetVerifiedEmail() bool { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.VerifiedEmail +} + +type GetSubscribers_Subscribers_Edges struct { + Node *GetSubscribers_Subscribers_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetSubscribers_Subscribers_Edges) GetNode() *GetSubscribers_Subscribers_Edges_Node { + if t == nil { + t = &GetSubscribers_Subscribers_Edges{} + } + return t.Node +} + +type GetSubscribers_Subscribers struct { + Edges []*GetSubscribers_Subscribers_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetSubscribers_Subscribers) GetEdges() []*GetSubscribers_Subscribers_Edges { + if t == nil { + t = &GetSubscribers_Subscribers{} + } + return t.Edges +} + +type UpdateSubscriber_UpdateSubscriber_Subscriber struct { + Active bool "json:\"active\" graphql:\"active\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" + VerifiedPhone bool "json:\"verifiedPhone\" graphql:\"verifiedPhone\"" +} + +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetActive() bool { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.Active +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.CreatedAt +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetCreatedBy() *string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.CreatedBy +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetEmail() string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.Email +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetID() string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.ID +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetPhoneNumber() *string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.PhoneNumber +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.UpdatedAt +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetUpdatedBy() *string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.UpdatedBy +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetVerifiedEmail() bool { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.VerifiedEmail +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetVerifiedPhone() bool { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.VerifiedPhone +} + +type UpdateSubscriber_UpdateSubscriber struct { + Subscriber UpdateSubscriber_UpdateSubscriber_Subscriber "json:\"subscriber\" graphql:\"subscriber\"" +} + +func (t *UpdateSubscriber_UpdateSubscriber) GetSubscriber() *UpdateSubscriber_UpdateSubscriber_Subscriber { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber{} + } + return &t.Subscriber +} + +type CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner) GetID() string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner{} + } + return t.ID +} + +type CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + Owner *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.Description +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetID() string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.ID +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return &t.Jsonconfig +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetName() string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.Name +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetUischema() *json.RawMessage { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return &t.Uischema +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetOwner() *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.Owner +} + +type CreateBulkCSVTemplate_CreateBulkCSVTemplate struct { + Templates []*CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates "json:\"templates,omitempty\" graphql:\"templates\"" +} + +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate) GetTemplates() []*CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate{} + } + return t.Templates +} + +type CreateBulkTemplate_CreateBulkTemplate_Templates_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates_Owner) GetID() string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates_Owner{} + } + return t.ID +} + +type CreateBulkTemplate_CreateBulkTemplate_Templates struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + Owner *CreateBulkTemplate_CreateBulkTemplate_Templates_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetDescription() *string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.Description +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetID() string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.ID +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return &t.Jsonconfig +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetName() string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.Name +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetUischema() *json.RawMessage { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return &t.Uischema +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetOwner() *CreateBulkTemplate_CreateBulkTemplate_Templates_Owner { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.Owner +} + +type CreateBulkTemplate_CreateBulkTemplate struct { + Templates []*CreateBulkTemplate_CreateBulkTemplate_Templates "json:\"templates,omitempty\" graphql:\"templates\"" +} + +func (t *CreateBulkTemplate_CreateBulkTemplate) GetTemplates() []*CreateBulkTemplate_CreateBulkTemplate_Templates { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate{} + } + return t.Templates +} + +type CreateTemplate_CreateTemplate_Template_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateTemplate_CreateTemplate_Template_Owner) GetID() string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template_Owner{} + } + return t.ID +} + +type CreateTemplate_CreateTemplate_Template struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + Owner *CreateTemplate_CreateTemplate_Template_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateTemplate_CreateTemplate_Template) GetDescription() *string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.Description +} +func (t *CreateTemplate_CreateTemplate_Template) GetID() string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.ID +} +func (t *CreateTemplate_CreateTemplate_Template) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return &t.Jsonconfig +} +func (t *CreateTemplate_CreateTemplate_Template) GetName() string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.Name +} +func (t *CreateTemplate_CreateTemplate_Template) GetUischema() *json.RawMessage { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return &t.Uischema +} +func (t *CreateTemplate_CreateTemplate_Template) GetOwner() *CreateTemplate_CreateTemplate_Template_Owner { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.Owner +} + +type CreateTemplate_CreateTemplate struct { + Template CreateTemplate_CreateTemplate_Template "json:\"template\" graphql:\"template\"" +} + +func (t *CreateTemplate_CreateTemplate) GetTemplate() *CreateTemplate_CreateTemplate_Template { + if t == nil { + t = &CreateTemplate_CreateTemplate{} + } + return &t.Template +} + +type GetAllTemplates_Templates_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllTemplates_Templates_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllTemplates_Templates_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Owner *GetAllTemplates_Templates_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetAllTemplates_Templates_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllTemplates_Templates_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllTemplates_Templates_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.Description +} +func (t *GetAllTemplates_Templates_Edges_Node) GetID() string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.ID +} +func (t *GetAllTemplates_Templates_Edges_Node) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return &t.Jsonconfig +} +func (t *GetAllTemplates_Templates_Edges_Node) GetName() string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.Name +} +func (t *GetAllTemplates_Templates_Edges_Node) GetUischema() *json.RawMessage { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return &t.Uischema +} +func (t *GetAllTemplates_Templates_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllTemplates_Templates_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllTemplates_Templates_Edges_Node) GetOwner() *GetAllTemplates_Templates_Edges_Node_Owner { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.Owner +} + +type GetAllTemplates_Templates_Edges struct { + Node *GetAllTemplates_Templates_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllTemplates_Templates_Edges) GetNode() *GetAllTemplates_Templates_Edges_Node { + if t == nil { + t = &GetAllTemplates_Templates_Edges{} + } + return t.Node +} + +type GetAllTemplates_Templates struct { + Edges []*GetAllTemplates_Templates_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllTemplates_Templates) GetEdges() []*GetAllTemplates_Templates_Edges { + if t == nil { + t = &GetAllTemplates_Templates{} + } + return t.Edges +} + +type GetTemplateByID_Template_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetTemplateByID_Template_Owner) GetID() string { + if t == nil { + t = &GetTemplateByID_Template_Owner{} + } + return t.ID +} + +type GetTemplateByID_Template struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Owner *GetTemplateByID_Template_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetTemplateByID_Template) GetCreatedAt() *time.Time { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.CreatedAt +} +func (t *GetTemplateByID_Template) GetCreatedBy() *string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.CreatedBy +} +func (t *GetTemplateByID_Template) GetDescription() *string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.Description +} +func (t *GetTemplateByID_Template) GetID() string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.ID +} +func (t *GetTemplateByID_Template) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetTemplateByID_Template{} + } + return &t.Jsonconfig +} +func (t *GetTemplateByID_Template) GetName() string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.Name +} +func (t *GetTemplateByID_Template) GetUischema() *json.RawMessage { + if t == nil { + t = &GetTemplateByID_Template{} + } + return &t.Uischema +} +func (t *GetTemplateByID_Template) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.UpdatedAt +} +func (t *GetTemplateByID_Template) GetUpdatedBy() *string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.UpdatedBy +} +func (t *GetTemplateByID_Template) GetOwner() *GetTemplateByID_Template_Owner { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.Owner +} + +type UpdateTemplate_UpdateTemplate_Template_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateTemplate_UpdateTemplate_Template_Owner) GetID() string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template_Owner{} + } + return t.ID +} + +type UpdateTemplate_UpdateTemplate_Template struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Owner *UpdateTemplate_UpdateTemplate_Template_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *UpdateTemplate_UpdateTemplate_Template) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.CreatedAt +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetCreatedBy() *string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.CreatedBy +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetDescription() *string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.Description +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetID() string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.ID +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return &t.Jsonconfig +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetName() string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.Name +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetUischema() *json.RawMessage { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return &t.Uischema +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.UpdatedAt +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetUpdatedBy() *string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.UpdatedBy +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetOwner() *UpdateTemplate_UpdateTemplate_Template_Owner { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.Owner +} + +type UpdateTemplate_UpdateTemplate struct { + Template UpdateTemplate_UpdateTemplate_Template "json:\"template\" graphql:\"template\"" +} + +func (t *UpdateTemplate_UpdateTemplate) GetTemplate() *UpdateTemplate_UpdateTemplate_Template { + if t == nil { + t = &UpdateTemplate_UpdateTemplate{} + } + return &t.Template +} + +type GetAllTemplateHistories_TemplateHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateType enums.DocumentType "json:\"templateType\" graphql:\"templateType\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Jsonconfig +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetTemplateType() *enums.DocumentType { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.TemplateType +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetUischema() *json.RawMessage { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Uischema +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllTemplateHistories_TemplateHistories_Edges struct { + Node *GetAllTemplateHistories_TemplateHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllTemplateHistories_TemplateHistories_Edges) GetNode() *GetAllTemplateHistories_TemplateHistories_Edges_Node { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges{} + } + return t.Node +} + +type GetAllTemplateHistories_TemplateHistories struct { + Edges []*GetAllTemplateHistories_TemplateHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllTemplateHistories_TemplateHistories) GetEdges() []*GetAllTemplateHistories_TemplateHistories_Edges { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories{} + } + return t.Edges +} + +type GetTemplateHistories_TemplateHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateType enums.DocumentType "json:\"templateType\" graphql:\"templateType\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Description +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.ID +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Jsonconfig +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Name +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetTemplateType() *enums.DocumentType { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.TemplateType +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetUischema() *json.RawMessage { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Uischema +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetTemplateHistories_TemplateHistories_Edges struct { + Node *GetTemplateHistories_TemplateHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetTemplateHistories_TemplateHistories_Edges) GetNode() *GetTemplateHistories_TemplateHistories_Edges_Node { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges{} + } + return t.Node +} + +type GetTemplateHistories_TemplateHistories struct { + Edges []*GetTemplateHistories_TemplateHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetTemplateHistories_TemplateHistories) GetEdges() []*GetTemplateHistories_TemplateHistories_Edges { + if t == nil { + t = &GetTemplateHistories_TemplateHistories{} + } + return t.Edges +} + +type CreateTFASetting_CreateTFASetting_TfaSetting_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateTFASetting_CreateTFASetting_TfaSetting_Owner) GetID() string { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting_Owner{} + } + return t.ID +} + +type CreateTFASetting_CreateTFASetting_TfaSetting struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" + Owner *CreateTFASetting_CreateTFASetting_TfaSetting_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetRecoveryCodes() []string { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.RecoveryCodes +} +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetTotpAllowed() *bool { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.TotpAllowed +} +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetVerified() bool { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.Verified +} +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetOwner() *CreateTFASetting_CreateTFASetting_TfaSetting_Owner { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.Owner +} + +type CreateTFASetting_CreateTFASetting struct { + TfaSetting CreateTFASetting_CreateTFASetting_TfaSetting "json:\"tfaSetting\" graphql:\"tfaSetting\"" +} + +func (t *CreateTFASetting_CreateTFASetting) GetTfaSetting() *CreateTFASetting_CreateTFASetting_TfaSetting { + if t == nil { + t = &CreateTFASetting_CreateTFASetting{} + } + return &t.TfaSetting +} + +type GetAllTFASettings_TfaSettings_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllTFASettings_TfaSettings_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllTFASettings_TfaSettings_Edges_Node struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" + Owner *GetAllTFASettings_TfaSettings_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetRecoveryCodes() []string { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.RecoveryCodes +} +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetTotpAllowed() *bool { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.TotpAllowed +} +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetVerified() bool { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.Verified +} +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetOwner() *GetAllTFASettings_TfaSettings_Edges_Node_Owner { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.Owner +} + +type GetAllTFASettings_TfaSettings_Edges struct { + Node *GetAllTFASettings_TfaSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllTFASettings_TfaSettings_Edges) GetNode() *GetAllTFASettings_TfaSettings_Edges_Node { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges{} + } + return t.Node +} + +type GetAllTFASettings_TfaSettings struct { + Edges []*GetAllTFASettings_TfaSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllTFASettings_TfaSettings) GetEdges() []*GetAllTFASettings_TfaSettings_Edges { + if t == nil { + t = &GetAllTFASettings_TfaSettings{} + } + return t.Edges +} + +type GetTFASetting_TfaSetting_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetTFASetting_TfaSetting_Owner) GetID() string { + if t == nil { + t = &GetTFASetting_TfaSetting_Owner{} + } + return t.ID +} + +type GetTFASetting_TfaSetting struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" + Owner *GetTFASetting_TfaSetting_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetTFASetting_TfaSetting) GetRecoveryCodes() []string { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.RecoveryCodes +} +func (t *GetTFASetting_TfaSetting) GetTotpAllowed() *bool { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.TotpAllowed +} +func (t *GetTFASetting_TfaSetting) GetVerified() bool { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.Verified +} +func (t *GetTFASetting_TfaSetting) GetOwner() *GetTFASetting_TfaSetting_Owner { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.Owner +} + +type UpdateTFASetting_UpdateTFASetting_TfaSetting struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" +} + +func (t *UpdateTFASetting_UpdateTFASetting_TfaSetting) GetRecoveryCodes() []string { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting_TfaSetting{} + } + return t.RecoveryCodes +} +func (t *UpdateTFASetting_UpdateTFASetting_TfaSetting) GetTotpAllowed() *bool { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting_TfaSetting{} + } + return t.TotpAllowed +} +func (t *UpdateTFASetting_UpdateTFASetting_TfaSetting) GetVerified() bool { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting_TfaSetting{} + } + return t.Verified +} + +type UpdateTFASetting_UpdateTFASetting struct { + TfaSetting UpdateTFASetting_UpdateTFASetting_TfaSetting "json:\"tfaSetting\" graphql:\"tfaSetting\"" +} + +func (t *UpdateTFASetting_UpdateTFASetting) GetTfaSetting() *UpdateTFASetting_UpdateTFASetting_TfaSetting { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting{} + } + return &t.TfaSetting +} + +type CreateUser_CreateUser_User_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" +} + +func (t *CreateUser_CreateUser_User_OrgMemberships) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User_OrgMemberships{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User_OrgMemberships) GetOrganizationID() string { + if t == nil { + t = &CreateUser_CreateUser_User_OrgMemberships{} + } + return t.OrganizationID +} + +type CreateUser_CreateUser_User_GroupMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + GroupID string "json:\"groupID\" graphql:\"groupID\"" +} + +func (t *CreateUser_CreateUser_User_GroupMemberships) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User_GroupMemberships{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User_GroupMemberships) GetGroupID() string { + if t == nil { + t = &CreateUser_CreateUser_User_GroupMemberships{} + } + return t.GroupID +} + +type CreateUser_CreateUser_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *CreateUser_CreateUser_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *CreateUser_CreateUser_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &CreateUser_CreateUser_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type CreateUser_CreateUser_User_Setting struct { + DefaultOrg *CreateUser_CreateUser_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateUser_CreateUser_User_Setting) GetDefaultOrg() *CreateUser_CreateUser_User_Setting_DefaultOrg { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.DefaultOrg +} +func (t *CreateUser_CreateUser_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.CreatedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.CreatedBy +} +func (t *CreateUser_CreateUser_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.EmailConfirmed +} +func (t *CreateUser_CreateUser_User_Setting) GetLocked() bool { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.Locked +} +func (t *CreateUser_CreateUser_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.SilencedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return &t.Status +} +func (t *CreateUser_CreateUser_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.SuspendedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetTags() []string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.Tags +} +func (t *CreateUser_CreateUser_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.UpdatedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.UpdatedBy +} + +type CreateUser_CreateUser_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + OrgMemberships []*CreateUser_CreateUser_User_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" + GroupMemberships []*CreateUser_CreateUser_User_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" + Setting CreateUser_CreateUser_User_Setting "json:\"setting\" graphql:\"setting\"" +} + +func (t *CreateUser_CreateUser_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return &t.AuthProvider +} +func (t *CreateUser_CreateUser_User) GetAvatarLocalFile() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.AvatarLocalFile +} +func (t *CreateUser_CreateUser_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.AvatarRemoteURL +} +func (t *CreateUser_CreateUser_User) GetDisplayName() string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.DisplayName +} +func (t *CreateUser_CreateUser_User) GetEmail() string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.Email +} +func (t *CreateUser_CreateUser_User) GetFirstName() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.FirstName +} +func (t *CreateUser_CreateUser_User) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User) GetLastName() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.LastName +} +func (t *CreateUser_CreateUser_User) GetSub() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.Sub +} +func (t *CreateUser_CreateUser_User) GetTags() []string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.Tags +} +func (t *CreateUser_CreateUser_User) GetOrgMemberships() []*CreateUser_CreateUser_User_OrgMemberships { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.OrgMemberships +} +func (t *CreateUser_CreateUser_User) GetGroupMemberships() []*CreateUser_CreateUser_User_GroupMemberships { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.GroupMemberships +} +func (t *CreateUser_CreateUser_User) GetSetting() *CreateUser_CreateUser_User_Setting { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return &t.Setting +} + +type CreateUser_CreateUser struct { + User CreateUser_CreateUser_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateUser_CreateUser) GetUser() *CreateUser_CreateUser_User { + if t == nil { + t = &CreateUser_CreateUser{} + } + return &t.User +} + +type DeleteUser_DeleteUser struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteUser_DeleteUser) GetDeletedID() string { + if t == nil { + t = &DeleteUser_DeleteUser{} + } + return t.DeletedID +} + +type GetAllUsers_Users_Edges_Node_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting_DefaultOrg{} + } + return t.ID +} +func (t *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting_DefaultOrg{} + } + return t.Name +} +func (t *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetAllUsers_Users_Edges_Node_Setting struct { + DefaultOrg *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUsers_Users_Edges_Node_Setting) GetDefaultOrg() *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.DefaultOrg +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.EmailConfirmed +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetLocked() bool { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.Locked +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.SilencedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return &t.Status +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.SuspendedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.Tags +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.UpdatedBy +} + +type GetAllUsers_Users_Edges_Node struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Setting GetAllUsers_Users_Edges_Node_Setting "json:\"setting\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUsers_Users_Edges_Node) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return &t.AuthProvider +} +func (t *GetAllUsers_Users_Edges_Node) GetAvatarLocalFile() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.AvatarLocalFile +} +func (t *GetAllUsers_Users_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetAllUsers_Users_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllUsers_Users_Edges_Node) GetEmail() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.Email +} +func (t *GetAllUsers_Users_Edges_Node) GetFirstName() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.FirstName +} +func (t *GetAllUsers_Users_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.ID +} +func (t *GetAllUsers_Users_Edges_Node) GetLastName() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.LastName +} +func (t *GetAllUsers_Users_Edges_Node) GetLastSeen() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.LastSeen +} +func (t *GetAllUsers_Users_Edges_Node) GetSub() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.Sub +} +func (t *GetAllUsers_Users_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUsers_Users_Edges_Node) GetSetting() *GetAllUsers_Users_Edges_Node_Setting { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return &t.Setting +} +func (t *GetAllUsers_Users_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUsers_Users_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUsers_Users_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUsers_Users_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllUsers_Users_Edges struct { + Node *GetAllUsers_Users_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUsers_Users_Edges) GetNode() *GetAllUsers_Users_Edges_Node { + if t == nil { + t = &GetAllUsers_Users_Edges{} + } + return t.Node +} + +type GetAllUsers_Users struct { + Edges []*GetAllUsers_Users_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUsers_Users) GetEdges() []*GetAllUsers_Users_Edges { + if t == nil { + t = &GetAllUsers_Users{} + } + return t.Edges +} + +type GetUserByID_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserByID_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserByID_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *GetUserByID_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserByID_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *GetUserByID_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserByID_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserByID_User_Setting struct { + DefaultOrg *GetUserByID_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserByID_User_Setting) GetDefaultOrg() *GetUserByID_User_Setting_DefaultOrg { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.DefaultOrg +} +func (t *GetUserByID_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.CreatedAt +} +func (t *GetUserByID_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.CreatedBy +} +func (t *GetUserByID_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.EmailConfirmed +} +func (t *GetUserByID_User_Setting) GetLocked() bool { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.Locked +} +func (t *GetUserByID_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.SilencedAt +} +func (t *GetUserByID_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return &t.Status +} +func (t *GetUserByID_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.SuspendedAt +} +func (t *GetUserByID_User_Setting) GetTags() []string { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.Tags +} +func (t *GetUserByID_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.UpdatedAt +} +func (t *GetUserByID_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.UpdatedBy +} + +type GetUserByID_User_Organizations_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" +} + +func (t *GetUserByID_User_Organizations_Members) GetID() string { + if t == nil { + t = &GetUserByID_User_Organizations_Members{} + } + return t.ID +} +func (t *GetUserByID_User_Organizations_Members) GetRole() *enums.Role { + if t == nil { + t = &GetUserByID_User_Organizations_Members{} + } + return &t.Role +} + +type GetUserByID_User_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Members []*GetUserByID_User_Organizations_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *GetUserByID_User_Organizations) GetID() string { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.ID +} +func (t *GetUserByID_User_Organizations) GetName() string { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.Name +} +func (t *GetUserByID_User_Organizations) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.PersonalOrg +} +func (t *GetUserByID_User_Organizations) GetMembers() []*GetUserByID_User_Organizations_Members { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.Members +} + +type GetUserByID_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Setting GetUserByID_User_Setting "json:\"setting\" graphql:\"setting\"" + Organizations []*GetUserByID_User_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" +} + +func (t *GetUserByID_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetUserByID_User{} + } + return &t.AuthProvider +} +func (t *GetUserByID_User) GetAvatarLocalFile() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.AvatarLocalFile +} +func (t *GetUserByID_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.AvatarRemoteURL +} +func (t *GetUserByID_User) GetDisplayName() string { + if t == nil { + t = &GetUserByID_User{} + } + return t.DisplayName +} +func (t *GetUserByID_User) GetEmail() string { + if t == nil { + t = &GetUserByID_User{} + } + return t.Email +} +func (t *GetUserByID_User) GetFirstName() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.FirstName +} +func (t *GetUserByID_User) GetID() string { + if t == nil { + t = &GetUserByID_User{} + } + return t.ID +} +func (t *GetUserByID_User) GetLastName() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.LastName +} +func (t *GetUserByID_User) GetLastSeen() *time.Time { + if t == nil { + t = &GetUserByID_User{} + } + return t.LastSeen +} +func (t *GetUserByID_User) GetSub() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.Sub +} +func (t *GetUserByID_User) GetTags() []string { + if t == nil { + t = &GetUserByID_User{} + } + return t.Tags +} +func (t *GetUserByID_User) GetSetting() *GetUserByID_User_Setting { + if t == nil { + t = &GetUserByID_User{} + } + return &t.Setting +} +func (t *GetUserByID_User) GetOrganizations() []*GetUserByID_User_Organizations { + if t == nil { + t = &GetUserByID_User{} + } + return t.Organizations +} +func (t *GetUserByID_User) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User{} + } + return t.UpdatedAt +} +func (t *GetUserByID_User) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.UpdatedBy +} +func (t *GetUserByID_User) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User{} + } + return t.CreatedAt +} +func (t *GetUserByID_User) GetCreatedBy() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.CreatedBy +} + +type GetUserByIDWithOrgs_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserByIDWithOrgs_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *GetUserByIDWithOrgs_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *GetUserByIDWithOrgs_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserByIDWithOrgs_User_Setting struct { + DefaultOrg *GetUserByIDWithOrgs_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserByIDWithOrgs_User_Setting) GetDefaultOrg() *GetUserByIDWithOrgs_User_Setting_DefaultOrg { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.DefaultOrg +} +func (t *GetUserByIDWithOrgs_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.CreatedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.CreatedBy +} +func (t *GetUserByIDWithOrgs_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.EmailConfirmed +} +func (t *GetUserByIDWithOrgs_User_Setting) GetLocked() bool { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.Locked +} +func (t *GetUserByIDWithOrgs_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.SilencedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return &t.Status +} +func (t *GetUserByIDWithOrgs_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.SuspendedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetTags() []string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.Tags +} +func (t *GetUserByIDWithOrgs_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.UpdatedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.UpdatedBy +} + +type GetUserByIDWithOrgs_User_OrgMemberships_User struct { + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetUserByIDWithOrgs_User_OrgMemberships_User) GetFirstName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships_User{} + } + return t.FirstName +} +func (t *GetUserByIDWithOrgs_User_OrgMemberships_User) GetLastName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships_User{} + } + return t.LastName +} + +type GetUserByIDWithOrgs_User_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetUserByIDWithOrgs_User_OrgMemberships_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetUserByIDWithOrgs_User_OrgMemberships) GetID() string { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships{} + } + return t.ID +} +func (t *GetUserByIDWithOrgs_User_OrgMemberships) GetRole() *enums.Role { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships{} + } + return &t.Role +} +func (t *GetUserByIDWithOrgs_User_OrgMemberships) GetUser() *GetUserByIDWithOrgs_User_OrgMemberships_User { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships{} + } + return &t.User +} + +type GetUserByIDWithOrgs_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Setting GetUserByIDWithOrgs_User_Setting "json:\"setting\" graphql:\"setting\"" + OrgMemberships []*GetUserByIDWithOrgs_User_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserByIDWithOrgs_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return &t.AuthProvider +} +func (t *GetUserByIDWithOrgs_User) GetAvatarLocalFile() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.AvatarLocalFile +} +func (t *GetUserByIDWithOrgs_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.AvatarRemoteURL +} +func (t *GetUserByIDWithOrgs_User) GetDisplayName() string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.DisplayName +} +func (t *GetUserByIDWithOrgs_User) GetEmail() string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.Email +} +func (t *GetUserByIDWithOrgs_User) GetFirstName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.FirstName +} +func (t *GetUserByIDWithOrgs_User) GetID() string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.ID +} +func (t *GetUserByIDWithOrgs_User) GetLastName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.LastName +} +func (t *GetUserByIDWithOrgs_User) GetLastSeen() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.LastSeen +} +func (t *GetUserByIDWithOrgs_User) GetSub() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.Sub +} +func (t *GetUserByIDWithOrgs_User) GetTags() []string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.Tags +} +func (t *GetUserByIDWithOrgs_User) GetSetting() *GetUserByIDWithOrgs_User_Setting { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return &t.Setting +} +func (t *GetUserByIDWithOrgs_User) GetOrgMemberships() []*GetUserByIDWithOrgs_User_OrgMemberships { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.OrgMemberships +} +func (t *GetUserByIDWithOrgs_User) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.CreatedAt +} +func (t *GetUserByIDWithOrgs_User) GetCreatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.CreatedBy +} +func (t *GetUserByIDWithOrgs_User) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.UpdatedAt +} +func (t *GetUserByIDWithOrgs_User) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.UpdatedBy +} + +type UpdateUser_UpdateUser_User_GroupMemberships struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateUser_UpdateUser_User_GroupMemberships) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_GroupMemberships{} + } + return t.ID +} + +type UpdateUser_UpdateUser_User_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateUser_UpdateUser_User_OrgMemberships) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_OrgMemberships{} + } + return t.ID +} + +type UpdateUser_UpdateUser_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *UpdateUser_UpdateUser_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *UpdateUser_UpdateUser_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *UpdateUser_UpdateUser_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type UpdateUser_UpdateUser_User_Setting struct { + DefaultOrg *UpdateUser_UpdateUser_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateUser_UpdateUser_User_Setting) GetDefaultOrg() *UpdateUser_UpdateUser_User_Setting_DefaultOrg { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.DefaultOrg +} +func (t *UpdateUser_UpdateUser_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.CreatedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.CreatedBy +} +func (t *UpdateUser_UpdateUser_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.EmailConfirmed +} +func (t *UpdateUser_UpdateUser_User_Setting) GetLocked() bool { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.Locked +} +func (t *UpdateUser_UpdateUser_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.SilencedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return &t.Status +} +func (t *UpdateUser_UpdateUser_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.SuspendedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetTags() []string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.Tags +} +func (t *UpdateUser_UpdateUser_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.UpdatedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.UpdatedBy +} + +type UpdateUser_UpdateUser_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + GroupMemberships []*UpdateUser_UpdateUser_User_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" + OrgMemberships []*UpdateUser_UpdateUser_User_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" + Setting UpdateUser_UpdateUser_User_Setting "json:\"setting\" graphql:\"setting\"" +} + +func (t *UpdateUser_UpdateUser_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return &t.AuthProvider +} +func (t *UpdateUser_UpdateUser_User) GetAvatarLocalFile() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.AvatarLocalFile +} +func (t *UpdateUser_UpdateUser_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.AvatarRemoteURL +} +func (t *UpdateUser_UpdateUser_User) GetDisplayName() string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.DisplayName +} +func (t *UpdateUser_UpdateUser_User) GetEmail() string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.Email +} +func (t *UpdateUser_UpdateUser_User) GetFirstName() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.FirstName +} +func (t *UpdateUser_UpdateUser_User) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.ID +} +func (t *UpdateUser_UpdateUser_User) GetLastName() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.LastName +} +func (t *UpdateUser_UpdateUser_User) GetSub() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.Sub +} +func (t *UpdateUser_UpdateUser_User) GetTags() []string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.Tags +} +func (t *UpdateUser_UpdateUser_User) GetGroupMemberships() []*UpdateUser_UpdateUser_User_GroupMemberships { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.GroupMemberships +} +func (t *UpdateUser_UpdateUser_User) GetOrgMemberships() []*UpdateUser_UpdateUser_User_OrgMemberships { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.OrgMemberships +} +func (t *UpdateUser_UpdateUser_User) GetSetting() *UpdateUser_UpdateUser_User_Setting { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return &t.Setting +} + +type UpdateUser_UpdateUser struct { + User UpdateUser_UpdateUser_User "json:\"user\" graphql:\"user\"" +} + +func (t *UpdateUser_UpdateUser) GetUser() *UpdateUser_UpdateUser_User { + if t == nil { + t = &UpdateUser_UpdateUser{} + } + return &t.User +} + +type GetAllUserHistories_UserHistories_Edges_Node struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + AvatarUpdatedAt *time.Time "json:\"avatarUpdatedAt,omitempty\" graphql:\"avatarUpdatedAt\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role *enums.Role "json:\"role,omitempty\" graphql:\"role\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return &t.AuthProvider +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAvatarLocalFile() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarLocalFile +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAvatarUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarUpdatedAt +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetEmail() string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Email +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetFirstName() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.FirstName +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetLastName() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.LastName +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetLastSeen() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.LastSeen +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Role +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetSub() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Sub +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllUserHistories_UserHistories_Edges struct { + Node *GetAllUserHistories_UserHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUserHistories_UserHistories_Edges) GetNode() *GetAllUserHistories_UserHistories_Edges_Node { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges{} + } + return t.Node +} + +type GetAllUserHistories_UserHistories struct { + Edges []*GetAllUserHistories_UserHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUserHistories_UserHistories) GetEdges() []*GetAllUserHistories_UserHistories_Edges { + if t == nil { + t = &GetAllUserHistories_UserHistories{} + } + return t.Edges +} + +type GetUserHistories_UserHistories_Edges_Node struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + AvatarUpdatedAt *time.Time "json:\"avatarUpdatedAt,omitempty\" graphql:\"avatarUpdatedAt\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role *enums.Role "json:\"role,omitempty\" graphql:\"role\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserHistories_UserHistories_Edges_Node) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return &t.AuthProvider +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetAvatarLocalFile() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarLocalFile +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetAvatarUpdatedAt() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarUpdatedAt +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetEmail() string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Email +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetFirstName() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.FirstName +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.ID +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetLastName() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.LastName +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetLastSeen() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.LastSeen +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Role +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetSub() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Sub +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetUserHistories_UserHistories_Edges struct { + Node *GetUserHistories_UserHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetUserHistories_UserHistories_Edges) GetNode() *GetUserHistories_UserHistories_Edges_Node { + if t == nil { + t = &GetUserHistories_UserHistories_Edges{} + } + return t.Node +} + +type GetUserHistories_UserHistories struct { + Edges []*GetUserHistories_UserHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetUserHistories_UserHistories) GetEdges() []*GetUserHistories_UserHistories_Edges { + if t == nil { + t = &GetUserHistories_UserHistories{} + } + return t.Edges +} + +type GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg) GetID() string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.ID +} +func (t *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg) GetName() string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.Name +} +func (t *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetAllUserSettings_UserSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.ID +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return &t.Status +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetDefaultOrg() *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.DefaultOrg +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.Locked +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetDeletedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetDeletedBy() *string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedBy +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllUserSettings_UserSettings_Edges struct { + Node *GetAllUserSettings_UserSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUserSettings_UserSettings_Edges) GetNode() *GetAllUserSettings_UserSettings_Edges_Node { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges{} + } + return t.Node +} + +type GetAllUserSettings_UserSettings struct { + Edges []*GetAllUserSettings_UserSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUserSettings_UserSettings) GetEdges() []*GetAllUserSettings_UserSettings_Edges { + if t == nil { + t = &GetAllUserSettings_UserSettings{} + } + return t.Edges +} + +type GetUserSettingByID_UserSetting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserSettingByID_UserSetting_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserSettingByID_UserSetting_DefaultOrg{} + } + return t.ID +} +func (t *GetUserSettingByID_UserSetting_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserSettingByID_UserSetting_DefaultOrg{} + } + return t.Name +} +func (t *GetUserSettingByID_UserSetting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserSettingByID_UserSetting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserSettingByID_UserSetting struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *GetUserSettingByID_UserSetting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserSettingByID_UserSetting) GetID() string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.ID +} +func (t *GetUserSettingByID_UserSetting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.SilencedAt +} +func (t *GetUserSettingByID_UserSetting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return &t.Status +} +func (t *GetUserSettingByID_UserSetting) GetDefaultOrg() *GetUserSettingByID_UserSetting_DefaultOrg { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.DefaultOrg +} +func (t *GetUserSettingByID_UserSetting) GetTags() []string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.Tags +} +func (t *GetUserSettingByID_UserSetting) GetLocked() bool { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.Locked +} +func (t *GetUserSettingByID_UserSetting) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.IsTfaEnabled +} +func (t *GetUserSettingByID_UserSetting) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.EmailConfirmed +} +func (t *GetUserSettingByID_UserSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.CreatedAt +} +func (t *GetUserSettingByID_UserSetting) GetCreatedBy() *string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.CreatedBy +} +func (t *GetUserSettingByID_UserSetting) GetDeletedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.DeletedAt +} +func (t *GetUserSettingByID_UserSetting) GetDeletedBy() *string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.DeletedBy +} +func (t *GetUserSettingByID_UserSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.UpdatedAt +} +func (t *GetUserSettingByID_UserSetting) GetUpdatedBy() *string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.UpdatedBy +} + +type GetUserSettings_UserSettings_Edges_Node_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserSettings_UserSettings_Edges_Node_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.ID +} +func (t *GetUserSettings_UserSettings_Edges_Node_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.Name +} +func (t *GetUserSettings_UserSettings_Edges_Node_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserSettings_UserSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *GetUserSettings_UserSettings_Edges_Node_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserSettings_UserSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.ID +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return &t.Status +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetDefaultOrg() *GetUserSettings_UserSettings_Edges_Node_DefaultOrg { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.DefaultOrg +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.Locked +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetDeletedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetDeletedBy() *string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedBy +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetUserSettings_UserSettings_Edges struct { + Node *GetUserSettings_UserSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetUserSettings_UserSettings_Edges) GetNode() *GetUserSettings_UserSettings_Edges_Node { + if t == nil { + t = &GetUserSettings_UserSettings_Edges{} + } + return t.Node +} + +type GetUserSettings_UserSettings struct { + Edges []*GetUserSettings_UserSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetUserSettings_UserSettings) GetEdges() []*GetUserSettings_UserSettings_Edges { + if t == nil { + t = &GetUserSettings_UserSettings{} + } + return t.Edges +} + +type UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg) GetID() string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg{} + } + return t.ID +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg) GetName() string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg{} + } + return t.Name +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg{} + } + return t.PersonalOrg +} + +type UpdateUserSetting_UpdateUserSetting_UserSetting struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetID() string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.ID +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetSilencedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.SilencedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetStatus() *enums.UserStatus { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return &t.Status +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetDefaultOrg() *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.DefaultOrg +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetTags() []string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.Tags +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetLocked() bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.Locked +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetIsTfaEnabled() *bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.IsTfaEnabled +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetEmailConfirmed() bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.EmailConfirmed +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.CreatedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetCreatedBy() *string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.CreatedBy +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetDeletedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.DeletedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetDeletedBy() *string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.DeletedBy +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.UpdatedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.UpdatedBy +} + +type UpdateUserSetting_UpdateUserSetting struct { + UserSetting UpdateUserSetting_UpdateUserSetting_UserSetting "json:\"userSetting\" graphql:\"userSetting\"" +} + +func (t *UpdateUserSetting_UpdateUserSetting) GetUserSetting() *UpdateUserSetting_UpdateUserSetting_UserSetting { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting{} + } + return &t.UserSetting +} + +type GetAllUserSettingHistories_UserSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + IsWebauthnAllowed *bool "json:\"isWebauthnAllowed,omitempty\" graphql:\"isWebauthnAllowed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID *string "json:\"userID,omitempty\" graphql:\"userID\"" +} + +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetIsWebauthnAllowed() *bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsWebauthnAllowed +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Locked +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SuspendedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetUserID() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UserID +} + +type GetAllUserSettingHistories_UserSettingHistories_Edges struct { + Node *GetAllUserSettingHistories_UserSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges) GetNode() *GetAllUserSettingHistories_UserSettingHistories_Edges_Node { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges{} + } + return t.Node +} + +type GetAllUserSettingHistories_UserSettingHistories struct { + Edges []*GetAllUserSettingHistories_UserSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUserSettingHistories_UserSettingHistories) GetEdges() []*GetAllUserSettingHistories_UserSettingHistories_Edges { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories{} + } + return t.Edges +} + +type GetUserSettingHistories_UserSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + IsWebauthnAllowed *bool "json:\"isWebauthnAllowed,omitempty\" graphql:\"isWebauthnAllowed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID *string "json:\"userID,omitempty\" graphql:\"userID\"" +} + +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetIsWebauthnAllowed() *bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsWebauthnAllowed +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Locked +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SuspendedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetUserID() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UserID +} + +type GetUserSettingHistories_UserSettingHistories_Edges struct { + Node *GetUserSettingHistories_UserSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetUserSettingHistories_UserSettingHistories_Edges) GetNode() *GetUserSettingHistories_UserSettingHistories_Edges_Node { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges{} + } + return t.Node +} + +type GetUserSettingHistories_UserSettingHistories struct { + Edges []*GetUserSettingHistories_UserSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetUserSettingHistories_UserSettingHistories) GetEdges() []*GetUserSettingHistories_UserSettingHistories_Edges { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories{} + } + return t.Edges +} + +type GetWebhookByID_Webhook_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetWebhookByID_Webhook_Events) GetID() string { + if t == nil { + t = &GetWebhookByID_Webhook_Events{} + } + return t.ID +} + +type GetWebhookByID_Webhook struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Events []*GetWebhookByID_Webhook_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *GetWebhookByID_Webhook) GetCreatedAt() *time.Time { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.CreatedAt +} +func (t *GetWebhookByID_Webhook) GetCreatedBy() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.CreatedBy +} +func (t *GetWebhookByID_Webhook) GetDescription() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Description +} +func (t *GetWebhookByID_Webhook) GetDestinationURL() string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.DestinationURL +} +func (t *GetWebhookByID_Webhook) GetEnabled() bool { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Enabled +} +func (t *GetWebhookByID_Webhook) GetFailures() *int64 { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Failures +} +func (t *GetWebhookByID_Webhook) GetID() string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.ID +} +func (t *GetWebhookByID_Webhook) GetLastError() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.LastError +} +func (t *GetWebhookByID_Webhook) GetLastResponse() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.LastResponse +} +func (t *GetWebhookByID_Webhook) GetName() string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Name +} +func (t *GetWebhookByID_Webhook) GetOwnerID() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.OwnerID +} +func (t *GetWebhookByID_Webhook) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.UpdatedAt +} +func (t *GetWebhookByID_Webhook) GetUpdatedBy() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.UpdatedBy +} +func (t *GetWebhookByID_Webhook) GetEvents() []*GetWebhookByID_Webhook_Events { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Events +} + +type GetAllWebhooks_Webhooks_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllWebhooks_Webhooks_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node_Events{} + } + return t.ID +} + +type GetAllWebhooks_Webhooks_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Events []*GetAllWebhooks_Webhooks_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Description +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetDestinationURL() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.DestinationURL +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetFailures() *int64 { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Failures +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetID() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.ID +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetLastError() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.LastError +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetLastResponse() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.LastResponse +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetName() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Name +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetEvents() []*GetAllWebhooks_Webhooks_Edges_Node_Events { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Events +} + +type GetAllWebhooks_Webhooks_Edges struct { + Node *GetAllWebhooks_Webhooks_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllWebhooks_Webhooks_Edges) GetNode() *GetAllWebhooks_Webhooks_Edges_Node { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges{} + } + return t.Node +} + +type GetAllWebhooks_Webhooks struct { + Edges []*GetAllWebhooks_Webhooks_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllWebhooks_Webhooks) GetEdges() []*GetAllWebhooks_Webhooks_Edges { + if t == nil { + t = &GetAllWebhooks_Webhooks{} + } + return t.Edges +} + +type CreateWebhook_CreateWebhook_Webhook_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateWebhook_CreateWebhook_Webhook_Events) GetID() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook_Events{} + } + return t.ID +} + +type CreateWebhook_CreateWebhook_Webhook struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Events []*CreateWebhook_CreateWebhook_Webhook_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateWebhook_CreateWebhook_Webhook) GetDescription() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Description +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetDestinationURL() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.DestinationURL +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetEnabled() bool { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Enabled +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetFailures() *int64 { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Failures +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetID() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.ID +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetLastError() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.LastError +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetLastResponse() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.LastResponse +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetName() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Name +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetOwnerID() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.OwnerID +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetEvents() []*CreateWebhook_CreateWebhook_Webhook_Events { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Events +} + +type CreateWebhook_CreateWebhook struct { + Webhook CreateWebhook_CreateWebhook_Webhook "json:\"webhook\" graphql:\"webhook\"" +} + +func (t *CreateWebhook_CreateWebhook) GetWebhook() *CreateWebhook_CreateWebhook_Webhook { + if t == nil { + t = &CreateWebhook_CreateWebhook{} + } + return &t.Webhook +} + +type CreateBulkWebhook_CreateBulkWebhook_Webhooks struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" +} + +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetDescription() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Description +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Enabled +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetFailures() *int64 { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Failures +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.ID +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetLastError() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.LastError +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetLastResponse() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.LastResponse +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetName() string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Name +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetOwnerID() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.OwnerID +} + +type CreateBulkWebhook_CreateBulkWebhook struct { + Webhooks []*CreateBulkWebhook_CreateBulkWebhook_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkWebhook_CreateBulkWebhook) GetWebhooks() []*CreateBulkWebhook_CreateBulkWebhook_Webhooks { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook{} + } + return t.Webhooks +} + +type CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" +} + +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Description +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Enabled +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetFailures() *int64 { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Failures +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.ID +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetLastError() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.LastError +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetLastResponse() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.LastResponse +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetName() string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Name +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.OwnerID +} + +type CreateBulkCSVWebhook_CreateBulkCSVWebhook struct { + Webhooks []*CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook) GetWebhooks() []*CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook{} + } + return t.Webhooks +} + +type UpdateWebhook_UpdateWebhook_Webhook_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateWebhook_UpdateWebhook_Webhook_Events) GetID() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook_Events{} + } + return t.ID +} + +type UpdateWebhook_UpdateWebhook_Webhook struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Events []*UpdateWebhook_UpdateWebhook_Webhook_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.CreatedAt +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetCreatedBy() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.CreatedBy +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetDescription() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Description +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetDestinationURL() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.DestinationURL +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetEnabled() bool { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Enabled +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetFailures() *int64 { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Failures +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetID() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.ID +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetLastError() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.LastError +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetLastResponse() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.LastResponse +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetName() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Name +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetOwnerID() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.OwnerID +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.UpdatedAt +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetUpdatedBy() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.UpdatedBy +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetEvents() []*UpdateWebhook_UpdateWebhook_Webhook_Events { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Events +} + +type UpdateWebhook_UpdateWebhook struct { + Webhook UpdateWebhook_UpdateWebhook_Webhook "json:\"webhook\" graphql:\"webhook\"" +} + +func (t *UpdateWebhook_UpdateWebhook) GetWebhook() *UpdateWebhook_UpdateWebhook_Webhook { + if t == nil { + t = &UpdateWebhook_UpdateWebhook{} + } + return &t.Webhook +} + +type DeleteWebhook_DeleteWebhook struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteWebhook_DeleteWebhook) GetDeletedID() string { + if t == nil { + t = &DeleteWebhook_DeleteWebhook{} + } + return t.DeletedID +} + +type GetAllWebhookHistories_WebhookHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetDestinationURL() string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.DestinationURL +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetFailures() *int64 { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Failures +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetLastError() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastError +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetLastResponse() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastResponse +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllWebhookHistories_WebhookHistories_Edges struct { + Node *GetAllWebhookHistories_WebhookHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllWebhookHistories_WebhookHistories_Edges) GetNode() *GetAllWebhookHistories_WebhookHistories_Edges_Node { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges{} + } + return t.Node +} + +type GetAllWebhookHistories_WebhookHistories struct { + Edges []*GetAllWebhookHistories_WebhookHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllWebhookHistories_WebhookHistories) GetEdges() []*GetAllWebhookHistories_WebhookHistories_Edges { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories{} + } + return t.Edges +} + +type GetWebhookHistories_WebhookHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Description +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetDestinationURL() string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.DestinationURL +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetFailures() *int64 { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Failures +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.ID +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetLastError() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastError +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetLastResponse() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastResponse +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Name +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetWebhookHistories_WebhookHistories_Edges struct { + Node *GetWebhookHistories_WebhookHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetWebhookHistories_WebhookHistories_Edges) GetNode() *GetWebhookHistories_WebhookHistories_Edges_Node { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges{} + } + return t.Node +} + +type GetWebhookHistories_WebhookHistories struct { + Edges []*GetWebhookHistories_WebhookHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetWebhookHistories_WebhookHistories) GetEdges() []*GetWebhookHistories_WebhookHistories_Edges { + if t == nil { + t = &GetWebhookHistories_WebhookHistories{} + } + return t.Edges +} + +type CreateAPIToken struct { + CreateAPIToken CreateAPIToken_CreateAPIToken "json:\"createAPIToken\" graphql:\"createAPIToken\"" +} + +func (t *CreateAPIToken) GetCreateAPIToken() *CreateAPIToken_CreateAPIToken { + if t == nil { + t = &CreateAPIToken{} + } + return &t.CreateAPIToken +} + +type UpdateAPIToken struct { + UpdateAPIToken UpdateAPIToken_UpdateAPIToken "json:\"updateAPIToken\" graphql:\"updateAPIToken\"" +} + +func (t *UpdateAPIToken) GetUpdateAPIToken() *UpdateAPIToken_UpdateAPIToken { + if t == nil { + t = &UpdateAPIToken{} + } + return &t.UpdateAPIToken +} + +type GetAllAPITokens struct { + APITokens GetAllAPITokens_APITokens "json:\"apiTokens\" graphql:\"apiTokens\"" +} + +func (t *GetAllAPITokens) GetAPITokens() *GetAllAPITokens_APITokens { + if t == nil { + t = &GetAllAPITokens{} + } + return &t.APITokens +} + +type GetAPITokenByID struct { + APIToken GetAPITokenByID_APIToken "json:\"apiToken\" graphql:\"apiToken\"" +} + +func (t *GetAPITokenByID) GetAPIToken() *GetAPITokenByID_APIToken { + if t == nil { + t = &GetAPITokenByID{} + } + return &t.APIToken +} + +type DeleteAPIToken struct { + DeleteAPIToken DeleteAPIToken_DeleteAPIToken "json:\"deleteAPIToken\" graphql:\"deleteAPIToken\"" +} + +func (t *DeleteAPIToken) GetDeleteAPIToken() *DeleteAPIToken_DeleteAPIToken { + if t == nil { + t = &DeleteAPIToken{} + } + return &t.DeleteAPIToken +} + +type CreateBulkCSVContact struct { + CreateBulkCSVContact CreateBulkCSVContact_CreateBulkCSVContact "json:\"createBulkCSVContact\" graphql:\"createBulkCSVContact\"" +} + +func (t *CreateBulkCSVContact) GetCreateBulkCSVContact() *CreateBulkCSVContact_CreateBulkCSVContact { + if t == nil { + t = &CreateBulkCSVContact{} + } + return &t.CreateBulkCSVContact +} + +type CreateBulkContact struct { + CreateBulkContact CreateBulkContact_CreateBulkContact "json:\"createBulkContact\" graphql:\"createBulkContact\"" +} + +func (t *CreateBulkContact) GetCreateBulkContact() *CreateBulkContact_CreateBulkContact { + if t == nil { + t = &CreateBulkContact{} + } + return &t.CreateBulkContact +} + +type CreateContact struct { + CreateContact CreateContact_CreateContact "json:\"createContact\" graphql:\"createContact\"" +} + +func (t *CreateContact) GetCreateContact() *CreateContact_CreateContact { + if t == nil { + t = &CreateContact{} + } + return &t.CreateContact +} + +type DeleteContact struct { + DeleteContact DeleteContact_DeleteContact "json:\"deleteContact\" graphql:\"deleteContact\"" +} + +func (t *DeleteContact) GetDeleteContact() *DeleteContact_DeleteContact { + if t == nil { + t = &DeleteContact{} + } + return &t.DeleteContact +} + +type GetAllContacts struct { + Contacts GetAllContacts_Contacts "json:\"contacts\" graphql:\"contacts\"" +} + +func (t *GetAllContacts) GetContacts() *GetAllContacts_Contacts { + if t == nil { + t = &GetAllContacts{} + } + return &t.Contacts +} + +type GetContactByID struct { + Contact GetContactByID_Contact "json:\"contact\" graphql:\"contact\"" +} + +func (t *GetContactByID) GetContact() *GetContactByID_Contact { + if t == nil { + t = &GetContactByID{} + } + return &t.Contact +} + +type GetContacts struct { + Contacts GetContacts_Contacts "json:\"contacts\" graphql:\"contacts\"" +} + +func (t *GetContacts) GetContacts() *GetContacts_Contacts { + if t == nil { + t = &GetContacts{} + } + return &t.Contacts +} + +type UpdateContact struct { + UpdateContact UpdateContact_UpdateContact "json:\"updateContact\" graphql:\"updateContact\"" +} + +func (t *UpdateContact) GetUpdateContact() *UpdateContact_UpdateContact { + if t == nil { + t = &UpdateContact{} + } + return &t.UpdateContact +} + +type GetAllContactHistories struct { + ContactHistories GetAllContactHistories_ContactHistories "json:\"contactHistories\" graphql:\"contactHistories\"" +} + +func (t *GetAllContactHistories) GetContactHistories() *GetAllContactHistories_ContactHistories { + if t == nil { + t = &GetAllContactHistories{} + } + return &t.ContactHistories +} + +type GetContactHistories struct { + ContactHistories GetContactHistories_ContactHistories "json:\"contactHistories\" graphql:\"contactHistories\"" +} + +func (t *GetContactHistories) GetContactHistories() *GetContactHistories_ContactHistories { + if t == nil { + t = &GetContactHistories{} + } + return &t.ContactHistories +} + +type CreateDocumentData struct { + CreateDocumentData CreateDocumentData_CreateDocumentData "json:\"createDocumentData\" graphql:\"createDocumentData\"" +} + +func (t *CreateDocumentData) GetCreateDocumentData() *CreateDocumentData_CreateDocumentData { + if t == nil { + t = &CreateDocumentData{} + } + return &t.CreateDocumentData +} + +type DeleteDocumentData struct { + DeleteDocumentData DeleteDocumentData_DeleteDocumentData "json:\"deleteDocumentData\" graphql:\"deleteDocumentData\"" +} + +func (t *DeleteDocumentData) GetDeleteDocumentData() *DeleteDocumentData_DeleteDocumentData { + if t == nil { + t = &DeleteDocumentData{} + } + return &t.DeleteDocumentData +} + +type GetDocumentDataByID struct { + DocumentData GetDocumentDataByID_DocumentData "json:\"documentData\" graphql:\"documentData\"" +} + +func (t *GetDocumentDataByID) GetDocumentData() *GetDocumentDataByID_DocumentData { + if t == nil { + t = &GetDocumentDataByID{} + } + return &t.DocumentData +} + +type UpdateDocumentData struct { + UpdateDocumentData UpdateDocumentData_UpdateDocumentData "json:\"updateDocumentData\" graphql:\"updateDocumentData\"" +} + +func (t *UpdateDocumentData) GetUpdateDocumentData() *UpdateDocumentData_UpdateDocumentData { + if t == nil { + t = &UpdateDocumentData{} + } + return &t.UpdateDocumentData +} + +type GetAllDocumentDataHistories struct { + DocumentDataHistories GetAllDocumentDataHistories_DocumentDataHistories "json:\"documentDataHistories\" graphql:\"documentDataHistories\"" +} + +func (t *GetAllDocumentDataHistories) GetDocumentDataHistories() *GetAllDocumentDataHistories_DocumentDataHistories { + if t == nil { + t = &GetAllDocumentDataHistories{} + } + return &t.DocumentDataHistories +} + +type GetDocumentDataHistories struct { + DocumentDataHistories GetDocumentDataHistories_DocumentDataHistories "json:\"documentDataHistories\" graphql:\"documentDataHistories\"" +} + +func (t *GetDocumentDataHistories) GetDocumentDataHistories() *GetDocumentDataHistories_DocumentDataHistories { + if t == nil { + t = &GetDocumentDataHistories{} + } + return &t.DocumentDataHistories +} + +type CreateBulkCSVEntitlement struct { + CreateBulkCSVEntitlement CreateBulkCSVEntitlement_CreateBulkCSVEntitlement "json:\"createBulkCSVEntitlement\" graphql:\"createBulkCSVEntitlement\"" +} + +func (t *CreateBulkCSVEntitlement) GetCreateBulkCSVEntitlement() *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement { + if t == nil { + t = &CreateBulkCSVEntitlement{} + } + return &t.CreateBulkCSVEntitlement +} + +type CreateBulkEntitlement struct { + CreateBulkEntitlement CreateBulkEntitlement_CreateBulkEntitlement "json:\"createBulkEntitlement\" graphql:\"createBulkEntitlement\"" +} + +func (t *CreateBulkEntitlement) GetCreateBulkEntitlement() *CreateBulkEntitlement_CreateBulkEntitlement { + if t == nil { + t = &CreateBulkEntitlement{} + } + return &t.CreateBulkEntitlement +} + +type CreateEntitlement struct { + CreateEntitlement CreateEntitlement_CreateEntitlement "json:\"createEntitlement\" graphql:\"createEntitlement\"" +} + +func (t *CreateEntitlement) GetCreateEntitlement() *CreateEntitlement_CreateEntitlement { + if t == nil { + t = &CreateEntitlement{} + } + return &t.CreateEntitlement +} + +type DeleteEntitlement struct { + DeleteEntitlement DeleteEntitlement_DeleteEntitlement "json:\"deleteEntitlement\" graphql:\"deleteEntitlement\"" +} + +func (t *DeleteEntitlement) GetDeleteEntitlement() *DeleteEntitlement_DeleteEntitlement { + if t == nil { + t = &DeleteEntitlement{} + } + return &t.DeleteEntitlement +} + +type GetAllEntitlements struct { + Entitlements GetAllEntitlements_Entitlements "json:\"entitlements\" graphql:\"entitlements\"" +} + +func (t *GetAllEntitlements) GetEntitlements() *GetAllEntitlements_Entitlements { + if t == nil { + t = &GetAllEntitlements{} + } + return &t.Entitlements +} + +type GetEntitlementByID struct { + Entitlement GetEntitlementByID_Entitlement "json:\"entitlement\" graphql:\"entitlement\"" +} + +func (t *GetEntitlementByID) GetEntitlement() *GetEntitlementByID_Entitlement { + if t == nil { + t = &GetEntitlementByID{} + } + return &t.Entitlement +} + +type GetEntitlements struct { + Entitlements GetEntitlements_Entitlements "json:\"entitlements\" graphql:\"entitlements\"" +} + +func (t *GetEntitlements) GetEntitlements() *GetEntitlements_Entitlements { + if t == nil { + t = &GetEntitlements{} + } + return &t.Entitlements +} + +type UpdateEntitlement struct { + UpdateEntitlement UpdateEntitlement_UpdateEntitlement "json:\"updateEntitlement\" graphql:\"updateEntitlement\"" +} + +func (t *UpdateEntitlement) GetUpdateEntitlement() *UpdateEntitlement_UpdateEntitlement { + if t == nil { + t = &UpdateEntitlement{} + } + return &t.UpdateEntitlement +} + +type GetAllEntitlementHistories struct { + EntitlementHistories GetAllEntitlementHistories_EntitlementHistories "json:\"entitlementHistories\" graphql:\"entitlementHistories\"" +} + +func (t *GetAllEntitlementHistories) GetEntitlementHistories() *GetAllEntitlementHistories_EntitlementHistories { + if t == nil { + t = &GetAllEntitlementHistories{} + } + return &t.EntitlementHistories +} + +type GetEntitlementHistories struct { + EntitlementHistories GetEntitlementHistories_EntitlementHistories "json:\"entitlementHistories\" graphql:\"entitlementHistories\"" +} + +func (t *GetEntitlementHistories) GetEntitlementHistories() *GetEntitlementHistories_EntitlementHistories { + if t == nil { + t = &GetEntitlementHistories{} + } + return &t.EntitlementHistories +} + +type CreateBulkCSVEntitlementPlan struct { + CreateBulkCSVEntitlementPlan CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan "json:\"createBulkCSVEntitlementPlan\" graphql:\"createBulkCSVEntitlementPlan\"" +} + +func (t *CreateBulkCSVEntitlementPlan) GetCreateBulkCSVEntitlementPlan() *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan { + if t == nil { + t = &CreateBulkCSVEntitlementPlan{} + } + return &t.CreateBulkCSVEntitlementPlan +} + +type CreateBulkEntitlementPlan struct { + CreateBulkEntitlementPlan CreateBulkEntitlementPlan_CreateBulkEntitlementPlan "json:\"createBulkEntitlementPlan\" graphql:\"createBulkEntitlementPlan\"" +} + +func (t *CreateBulkEntitlementPlan) GetCreateBulkEntitlementPlan() *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan { + if t == nil { + t = &CreateBulkEntitlementPlan{} + } + return &t.CreateBulkEntitlementPlan +} + +type CreateEntitlementPlan struct { + CreateEntitlementPlan CreateEntitlementPlan_CreateEntitlementPlan "json:\"createEntitlementPlan\" graphql:\"createEntitlementPlan\"" +} + +func (t *CreateEntitlementPlan) GetCreateEntitlementPlan() *CreateEntitlementPlan_CreateEntitlementPlan { + if t == nil { + t = &CreateEntitlementPlan{} + } + return &t.CreateEntitlementPlan +} + +type DeleteEntitlementPlan struct { + DeleteEntitlementPlan DeleteEntitlementPlan_DeleteEntitlementPlan "json:\"deleteEntitlementPlan\" graphql:\"deleteEntitlementPlan\"" +} + +func (t *DeleteEntitlementPlan) GetDeleteEntitlementPlan() *DeleteEntitlementPlan_DeleteEntitlementPlan { + if t == nil { + t = &DeleteEntitlementPlan{} + } + return &t.DeleteEntitlementPlan +} + +type GetAllEntitlementPlans struct { + EntitlementPlans GetAllEntitlementPlans_EntitlementPlans "json:\"entitlementPlans\" graphql:\"entitlementPlans\"" +} + +func (t *GetAllEntitlementPlans) GetEntitlementPlans() *GetAllEntitlementPlans_EntitlementPlans { + if t == nil { + t = &GetAllEntitlementPlans{} + } + return &t.EntitlementPlans +} + +type GetEntitlementPlanByID struct { + EntitlementPlan GetEntitlementPlanByID_EntitlementPlan "json:\"entitlementPlan\" graphql:\"entitlementPlan\"" +} + +func (t *GetEntitlementPlanByID) GetEntitlementPlan() *GetEntitlementPlanByID_EntitlementPlan { + if t == nil { + t = &GetEntitlementPlanByID{} + } + return &t.EntitlementPlan +} + +type GetEntitlementPlans struct { + EntitlementPlans GetEntitlementPlans_EntitlementPlans "json:\"entitlementPlans\" graphql:\"entitlementPlans\"" +} + +func (t *GetEntitlementPlans) GetEntitlementPlans() *GetEntitlementPlans_EntitlementPlans { + if t == nil { + t = &GetEntitlementPlans{} + } + return &t.EntitlementPlans +} + +type UpdateEntitlementPlan struct { + UpdateEntitlementPlan UpdateEntitlementPlan_UpdateEntitlementPlan "json:\"updateEntitlementPlan\" graphql:\"updateEntitlementPlan\"" +} + +func (t *UpdateEntitlementPlan) GetUpdateEntitlementPlan() *UpdateEntitlementPlan_UpdateEntitlementPlan { + if t == nil { + t = &UpdateEntitlementPlan{} + } + return &t.UpdateEntitlementPlan +} + +type GetAllEntitlementPlanFeatures struct { + EntitlementPlanFeatures GetAllEntitlementPlanFeatures_EntitlementPlanFeatures "json:\"entitlementPlanFeatures\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *GetAllEntitlementPlanFeatures) GetEntitlementPlanFeatures() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures { + if t == nil { + t = &GetAllEntitlementPlanFeatures{} + } + return &t.EntitlementPlanFeatures +} + +type GetEntitlementPlanFeatureByID struct { + EntitlementPlanFeature GetEntitlementPlanFeatureByID_EntitlementPlanFeature "json:\"entitlementPlanFeature\" graphql:\"entitlementPlanFeature\"" +} + +func (t *GetEntitlementPlanFeatureByID) GetEntitlementPlanFeature() *GetEntitlementPlanFeatureByID_EntitlementPlanFeature { + if t == nil { + t = &GetEntitlementPlanFeatureByID{} + } + return &t.EntitlementPlanFeature +} + +type GetEntitlementPlanFeatures struct { + EntitlementPlanFeatures GetEntitlementPlanFeatures_EntitlementPlanFeatures "json:\"entitlementPlanFeatures\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *GetEntitlementPlanFeatures) GetEntitlementPlanFeatures() *GetEntitlementPlanFeatures_EntitlementPlanFeatures { + if t == nil { + t = &GetEntitlementPlanFeatures{} + } + return &t.EntitlementPlanFeatures +} + +type CreateEntitlementPlanFeature struct { + CreateEntitlementPlanFeature CreateEntitlementPlanFeature_CreateEntitlementPlanFeature "json:\"createEntitlementPlanFeature\" graphql:\"createEntitlementPlanFeature\"" +} + +func (t *CreateEntitlementPlanFeature) GetCreateEntitlementPlanFeature() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature { + if t == nil { + t = &CreateEntitlementPlanFeature{} + } + return &t.CreateEntitlementPlanFeature +} + +type CreateBulkCSVEntitlementPlanFeature struct { + CreateBulkCSVEntitlementPlanFeature CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature "json:\"createBulkCSVEntitlementPlanFeature\" graphql:\"createBulkCSVEntitlementPlanFeature\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature) GetCreateBulkCSVEntitlementPlanFeature() *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature{} + } + return &t.CreateBulkCSVEntitlementPlanFeature +} + +type CreateBulkEntitlementPlanFeature struct { + CreateBulkEntitlementPlanFeature CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature "json:\"createBulkEntitlementPlanFeature\" graphql:\"createBulkEntitlementPlanFeature\"" +} + +func (t *CreateBulkEntitlementPlanFeature) GetCreateBulkEntitlementPlanFeature() *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature { + if t == nil { + t = &CreateBulkEntitlementPlanFeature{} + } + return &t.CreateBulkEntitlementPlanFeature +} + +type UpdateEntitlementPlanFeature struct { + UpdateEntitlementPlanFeature UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature "json:\"updateEntitlementPlanFeature\" graphql:\"updateEntitlementPlanFeature\"" +} + +func (t *UpdateEntitlementPlanFeature) GetUpdateEntitlementPlanFeature() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature { + if t == nil { + t = &UpdateEntitlementPlanFeature{} + } + return &t.UpdateEntitlementPlanFeature +} + +type DeleteEntitlementPlanFeature struct { + DeleteEntitlementPlanFeature DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature "json:\"deleteEntitlementPlanFeature\" graphql:\"deleteEntitlementPlanFeature\"" +} + +func (t *DeleteEntitlementPlanFeature) GetDeleteEntitlementPlanFeature() *DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature { + if t == nil { + t = &DeleteEntitlementPlanFeature{} + } + return &t.DeleteEntitlementPlanFeature +} + +type GetAllEntitlementPlanFeatureHistories struct { + EntitlementPlanFeatureHistories GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories "json:\"entitlementPlanFeatureHistories\" graphql:\"entitlementPlanFeatureHistories\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories) GetEntitlementPlanFeatureHistories() *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories{} + } + return &t.EntitlementPlanFeatureHistories +} + +type GetEntitlementPlanFeatureHistories struct { + EntitlementPlanFeatureHistories GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories "json:\"entitlementPlanFeatureHistories\" graphql:\"entitlementPlanFeatureHistories\"" +} + +func (t *GetEntitlementPlanFeatureHistories) GetEntitlementPlanFeatureHistories() *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories { + if t == nil { + t = &GetEntitlementPlanFeatureHistories{} + } + return &t.EntitlementPlanFeatureHistories +} + +type GetAllEntitlementPlanHistories struct { + EntitlementPlanHistories GetAllEntitlementPlanHistories_EntitlementPlanHistories "json:\"entitlementPlanHistories\" graphql:\"entitlementPlanHistories\"" +} + +func (t *GetAllEntitlementPlanHistories) GetEntitlementPlanHistories() *GetAllEntitlementPlanHistories_EntitlementPlanHistories { + if t == nil { + t = &GetAllEntitlementPlanHistories{} + } + return &t.EntitlementPlanHistories +} + +type GetEntitlementPlanHistories struct { + EntitlementPlanHistories GetEntitlementPlanHistories_EntitlementPlanHistories "json:\"entitlementPlanHistories\" graphql:\"entitlementPlanHistories\"" +} + +func (t *GetEntitlementPlanHistories) GetEntitlementPlanHistories() *GetEntitlementPlanHistories_EntitlementPlanHistories { + if t == nil { + t = &GetEntitlementPlanHistories{} + } + return &t.EntitlementPlanHistories +} + +type CreateBulkCSVEntity struct { + CreateBulkCSVEntity CreateBulkCSVEntity_CreateBulkCSVEntity "json:\"createBulkCSVEntity\" graphql:\"createBulkCSVEntity\"" +} + +func (t *CreateBulkCSVEntity) GetCreateBulkCSVEntity() *CreateBulkCSVEntity_CreateBulkCSVEntity { + if t == nil { + t = &CreateBulkCSVEntity{} + } + return &t.CreateBulkCSVEntity +} + +type CreateBulkEntity struct { + CreateBulkEntity CreateBulkEntity_CreateBulkEntity "json:\"createBulkEntity\" graphql:\"createBulkEntity\"" +} + +func (t *CreateBulkEntity) GetCreateBulkEntity() *CreateBulkEntity_CreateBulkEntity { + if t == nil { + t = &CreateBulkEntity{} + } + return &t.CreateBulkEntity +} + +type CreateEntity struct { + CreateEntity CreateEntity_CreateEntity "json:\"createEntity\" graphql:\"createEntity\"" +} + +func (t *CreateEntity) GetCreateEntity() *CreateEntity_CreateEntity { + if t == nil { + t = &CreateEntity{} + } + return &t.CreateEntity +} + +type DeleteEntity struct { + DeleteEntity DeleteEntity_DeleteEntity "json:\"deleteEntity\" graphql:\"deleteEntity\"" +} + +func (t *DeleteEntity) GetDeleteEntity() *DeleteEntity_DeleteEntity { + if t == nil { + t = &DeleteEntity{} + } + return &t.DeleteEntity +} + +type GetAllEntities struct { + Entities GetAllEntities_Entities "json:\"entities\" graphql:\"entities\"" +} + +func (t *GetAllEntities) GetEntities() *GetAllEntities_Entities { + if t == nil { + t = &GetAllEntities{} + } + return &t.Entities +} + +type GetEntities struct { + Entities GetEntities_Entities "json:\"entities\" graphql:\"entities\"" +} + +func (t *GetEntities) GetEntities() *GetEntities_Entities { + if t == nil { + t = &GetEntities{} + } + return &t.Entities +} + +type GetEntityByID struct { + Entity GetEntityByID_Entity "json:\"entity\" graphql:\"entity\"" +} + +func (t *GetEntityByID) GetEntity() *GetEntityByID_Entity { + if t == nil { + t = &GetEntityByID{} + } + return &t.Entity +} + +type UpdateEntity struct { + UpdateEntity UpdateEntity_UpdateEntity "json:\"updateEntity\" graphql:\"updateEntity\"" +} + +func (t *UpdateEntity) GetUpdateEntity() *UpdateEntity_UpdateEntity { + if t == nil { + t = &UpdateEntity{} + } + return &t.UpdateEntity +} + +type GetAllEntityHistories struct { + EntityHistories GetAllEntityHistories_EntityHistories "json:\"entityHistories\" graphql:\"entityHistories\"" +} + +func (t *GetAllEntityHistories) GetEntityHistories() *GetAllEntityHistories_EntityHistories { + if t == nil { + t = &GetAllEntityHistories{} + } + return &t.EntityHistories +} + +type GetEntityHistories struct { + EntityHistories GetEntityHistories_EntityHistories "json:\"entityHistories\" graphql:\"entityHistories\"" +} + +func (t *GetEntityHistories) GetEntityHistories() *GetEntityHistories_EntityHistories { + if t == nil { + t = &GetEntityHistories{} + } + return &t.EntityHistories +} + +type CreateBulkCSVEntityType struct { + CreateBulkCSVEntityType CreateBulkCSVEntityType_CreateBulkCSVEntityType "json:\"createBulkCSVEntityType\" graphql:\"createBulkCSVEntityType\"" +} + +func (t *CreateBulkCSVEntityType) GetCreateBulkCSVEntityType() *CreateBulkCSVEntityType_CreateBulkCSVEntityType { + if t == nil { + t = &CreateBulkCSVEntityType{} + } + return &t.CreateBulkCSVEntityType +} + +type CreateBulkEntityType struct { + CreateBulkEntityType CreateBulkEntityType_CreateBulkEntityType "json:\"createBulkEntityType\" graphql:\"createBulkEntityType\"" +} + +func (t *CreateBulkEntityType) GetCreateBulkEntityType() *CreateBulkEntityType_CreateBulkEntityType { + if t == nil { + t = &CreateBulkEntityType{} + } + return &t.CreateBulkEntityType +} + +type CreateEntityType struct { + CreateEntityType CreateEntityType_CreateEntityType "json:\"createEntityType\" graphql:\"createEntityType\"" +} + +func (t *CreateEntityType) GetCreateEntityType() *CreateEntityType_CreateEntityType { + if t == nil { + t = &CreateEntityType{} + } + return &t.CreateEntityType +} + +type DeleteEntityType struct { + DeleteEntityType DeleteEntityType_DeleteEntityType "json:\"deleteEntityType\" graphql:\"deleteEntityType\"" +} + +func (t *DeleteEntityType) GetDeleteEntityType() *DeleteEntityType_DeleteEntityType { + if t == nil { + t = &DeleteEntityType{} + } + return &t.DeleteEntityType +} + +type GetAllEntityTypes struct { + EntityTypes GetAllEntityTypes_EntityTypes "json:\"entityTypes\" graphql:\"entityTypes\"" +} + +func (t *GetAllEntityTypes) GetEntityTypes() *GetAllEntityTypes_EntityTypes { + if t == nil { + t = &GetAllEntityTypes{} + } + return &t.EntityTypes +} + +type GetEntityTypeByID struct { + EntityType GetEntityTypeByID_EntityType "json:\"entityType\" graphql:\"entityType\"" +} + +func (t *GetEntityTypeByID) GetEntityType() *GetEntityTypeByID_EntityType { + if t == nil { + t = &GetEntityTypeByID{} + } + return &t.EntityType +} + +type GetEntityTypes struct { + EntityTypes GetEntityTypes_EntityTypes "json:\"entityTypes\" graphql:\"entityTypes\"" +} + +func (t *GetEntityTypes) GetEntityTypes() *GetEntityTypes_EntityTypes { + if t == nil { + t = &GetEntityTypes{} + } + return &t.EntityTypes +} + +type UpdateEntityType struct { + UpdateEntityType UpdateEntityType_UpdateEntityType "json:\"updateEntityType\" graphql:\"updateEntityType\"" +} + +func (t *UpdateEntityType) GetUpdateEntityType() *UpdateEntityType_UpdateEntityType { + if t == nil { + t = &UpdateEntityType{} + } + return &t.UpdateEntityType +} + +type GetAllEntityTypeHistories struct { + EntityTypeHistories GetAllEntityTypeHistories_EntityTypeHistories "json:\"entityTypeHistories\" graphql:\"entityTypeHistories\"" +} + +func (t *GetAllEntityTypeHistories) GetEntityTypeHistories() *GetAllEntityTypeHistories_EntityTypeHistories { + if t == nil { + t = &GetAllEntityTypeHistories{} + } + return &t.EntityTypeHistories +} + +type GetEntityTypeHistories struct { + EntityTypeHistories GetEntityTypeHistories_EntityTypeHistories "json:\"entityTypeHistories\" graphql:\"entityTypeHistories\"" +} + +func (t *GetEntityTypeHistories) GetEntityTypeHistories() *GetEntityTypeHistories_EntityTypeHistories { + if t == nil { + t = &GetEntityTypeHistories{} + } + return &t.EntityTypeHistories +} + +type GetEvents struct { + Events GetEvents_Events "json:\"events\" graphql:\"events\"" +} + +func (t *GetEvents) GetEvents() *GetEvents_Events { + if t == nil { + t = &GetEvents{} + } + return &t.Events +} + +type GetEventByID struct { + Event GetEventByID_Event "json:\"event\" graphql:\"event\"" +} + +func (t *GetEventByID) GetEvent() *GetEventByID_Event { + if t == nil { + t = &GetEventByID{} + } + return &t.Event +} + +type GetAllEvents struct { + Events GetAllEvents_Events "json:\"events\" graphql:\"events\"" +} + +func (t *GetAllEvents) GetEvents() *GetAllEvents_Events { + if t == nil { + t = &GetAllEvents{} + } + return &t.Events +} + +type CreateEvent struct { + CreateEvent CreateEvent_CreateEvent "json:\"createEvent\" graphql:\"createEvent\"" +} + +func (t *CreateEvent) GetCreateEvent() *CreateEvent_CreateEvent { + if t == nil { + t = &CreateEvent{} + } + return &t.CreateEvent +} + +type CreateBulkEvent struct { + CreateBulkEvent CreateBulkEvent_CreateBulkEvent "json:\"createBulkEvent\" graphql:\"createBulkEvent\"" +} + +func (t *CreateBulkEvent) GetCreateBulkEvent() *CreateBulkEvent_CreateBulkEvent { + if t == nil { + t = &CreateBulkEvent{} + } + return &t.CreateBulkEvent +} + +type CreateBulkCSVEvent struct { + CreateBulkCSVEvent CreateBulkCSVEvent_CreateBulkCSVEvent "json:\"createBulkCSVEvent\" graphql:\"createBulkCSVEvent\"" +} + +func (t *CreateBulkCSVEvent) GetCreateBulkCSVEvent() *CreateBulkCSVEvent_CreateBulkCSVEvent { + if t == nil { + t = &CreateBulkCSVEvent{} + } + return &t.CreateBulkCSVEvent +} + +type UpdateEvent struct { + UpdateEvent UpdateEvent_UpdateEvent "json:\"updateEvent\" graphql:\"updateEvent\"" +} + +func (t *UpdateEvent) GetUpdateEvent() *UpdateEvent_UpdateEvent { + if t == nil { + t = &UpdateEvent{} + } + return &t.UpdateEvent +} + +type DeleteEvent struct { + DeleteEvent DeleteEvent_DeleteEvent "json:\"deleteEvent\" graphql:\"deleteEvent\"" +} + +func (t *DeleteEvent) GetDeleteEvent() *DeleteEvent_DeleteEvent { + if t == nil { + t = &DeleteEvent{} + } + return &t.DeleteEvent +} + +type GetAllEventHistories struct { + EventHistories GetAllEventHistories_EventHistories "json:\"eventHistories\" graphql:\"eventHistories\"" +} + +func (t *GetAllEventHistories) GetEventHistories() *GetAllEventHistories_EventHistories { + if t == nil { + t = &GetAllEventHistories{} + } + return &t.EventHistories +} + +type GetEventHistories struct { + EventHistories GetEventHistories_EventHistories "json:\"eventHistories\" graphql:\"eventHistories\"" +} + +func (t *GetEventHistories) GetEventHistories() *GetEventHistories_EventHistories { + if t == nil { + t = &GetEventHistories{} + } + return &t.EventHistories +} + +type CreateBulkCSVFeature struct { + CreateBulkCSVFeature CreateBulkCSVFeature_CreateBulkCSVFeature "json:\"createBulkCSVFeature\" graphql:\"createBulkCSVFeature\"" +} + +func (t *CreateBulkCSVFeature) GetCreateBulkCSVFeature() *CreateBulkCSVFeature_CreateBulkCSVFeature { + if t == nil { + t = &CreateBulkCSVFeature{} + } + return &t.CreateBulkCSVFeature +} + +type CreateBulkFeature struct { + CreateBulkFeature CreateBulkFeature_CreateBulkFeature "json:\"createBulkFeature\" graphql:\"createBulkFeature\"" +} + +func (t *CreateBulkFeature) GetCreateBulkFeature() *CreateBulkFeature_CreateBulkFeature { + if t == nil { + t = &CreateBulkFeature{} + } + return &t.CreateBulkFeature +} + +type CreateFeature struct { + CreateFeature CreateFeature_CreateFeature "json:\"createFeature\" graphql:\"createFeature\"" +} + +func (t *CreateFeature) GetCreateFeature() *CreateFeature_CreateFeature { + if t == nil { + t = &CreateFeature{} + } + return &t.CreateFeature +} + +type DeleteFeature struct { + DeleteFeature DeleteFeature_DeleteFeature "json:\"deleteFeature\" graphql:\"deleteFeature\"" +} + +func (t *DeleteFeature) GetDeleteFeature() *DeleteFeature_DeleteFeature { + if t == nil { + t = &DeleteFeature{} + } + return &t.DeleteFeature +} + +type GetAllFeatures struct { + Features GetAllFeatures_Features "json:\"features\" graphql:\"features\"" +} + +func (t *GetAllFeatures) GetFeatures() *GetAllFeatures_Features { + if t == nil { + t = &GetAllFeatures{} + } + return &t.Features +} + +type GetFeatureByID struct { + Feature GetFeatureByID_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetFeatureByID) GetFeature() *GetFeatureByID_Feature { + if t == nil { + t = &GetFeatureByID{} + } + return &t.Feature +} + +type GetFeatures struct { + Features GetFeatures_Features "json:\"features\" graphql:\"features\"" +} + +func (t *GetFeatures) GetFeatures() *GetFeatures_Features { + if t == nil { + t = &GetFeatures{} + } + return &t.Features +} + +type UpdateFeature struct { + UpdateFeature UpdateFeature_UpdateFeature "json:\"updateFeature\" graphql:\"updateFeature\"" +} + +func (t *UpdateFeature) GetUpdateFeature() *UpdateFeature_UpdateFeature { + if t == nil { + t = &UpdateFeature{} + } + return &t.UpdateFeature +} + +type GetAllFeatureHistories struct { + FeatureHistories GetAllFeatureHistories_FeatureHistories "json:\"featureHistories\" graphql:\"featureHistories\"" +} + +func (t *GetAllFeatureHistories) GetFeatureHistories() *GetAllFeatureHistories_FeatureHistories { + if t == nil { + t = &GetAllFeatureHistories{} + } + return &t.FeatureHistories +} + +type GetFeatureHistories struct { + FeatureHistories GetFeatureHistories_FeatureHistories "json:\"featureHistories\" graphql:\"featureHistories\"" +} + +func (t *GetFeatureHistories) GetFeatureHistories() *GetFeatureHistories_FeatureHistories { + if t == nil { + t = &GetFeatureHistories{} + } + return &t.FeatureHistories +} + +type CreateBulkCSVFile struct { + CreateBulkCSVFile CreateBulkCSVFile_CreateBulkCSVFile "json:\"createBulkCSVFile\" graphql:\"createBulkCSVFile\"" +} + +func (t *CreateBulkCSVFile) GetCreateBulkCSVFile() *CreateBulkCSVFile_CreateBulkCSVFile { + if t == nil { + t = &CreateBulkCSVFile{} + } + return &t.CreateBulkCSVFile +} + +type CreateBulkFile struct { + CreateBulkFile CreateBulkFile_CreateBulkFile "json:\"createBulkFile\" graphql:\"createBulkFile\"" +} + +func (t *CreateBulkFile) GetCreateBulkFile() *CreateBulkFile_CreateBulkFile { + if t == nil { + t = &CreateBulkFile{} + } + return &t.CreateBulkFile +} + +type CreateFile struct { + CreateFile CreateFile_CreateFile "json:\"createFile\" graphql:\"createFile\"" +} + +func (t *CreateFile) GetCreateFile() *CreateFile_CreateFile { + if t == nil { + t = &CreateFile{} + } + return &t.CreateFile +} + +type DeleteFile struct { + DeleteFile DeleteFile_DeleteFile "json:\"deleteFile\" graphql:\"deleteFile\"" +} + +func (t *DeleteFile) GetDeleteFile() *DeleteFile_DeleteFile { + if t == nil { + t = &DeleteFile{} + } + return &t.DeleteFile +} + +type GetAllFiles struct { + Files GetAllFiles_Files "json:\"files\" graphql:\"files\"" +} + +func (t *GetAllFiles) GetFiles() *GetAllFiles_Files { + if t == nil { + t = &GetAllFiles{} + } + return &t.Files +} + +type GetFiles struct { + Files GetFiles_Files "json:\"files\" graphql:\"files\"" +} + +func (t *GetFiles) GetFiles() *GetFiles_Files { + if t == nil { + t = &GetFiles{} + } + return &t.Files +} + +type UpdateFile struct { + UpdateFile UpdateFile_UpdateFile "json:\"updateFile\" graphql:\"updateFile\"" +} + +func (t *UpdateFile) GetUpdateFile() *UpdateFile_UpdateFile { + if t == nil { + t = &UpdateFile{} + } + return &t.UpdateFile +} + +type GetAllFileHistories struct { + FileHistories GetAllFileHistories_FileHistories "json:\"fileHistories\" graphql:\"fileHistories\"" +} + +func (t *GetAllFileHistories) GetFileHistories() *GetAllFileHistories_FileHistories { + if t == nil { + t = &GetAllFileHistories{} + } + return &t.FileHistories +} + +type GetFileHistories struct { + FileHistories GetFileHistories_FileHistories "json:\"fileHistories\" graphql:\"fileHistories\"" +} + +func (t *GetFileHistories) GetFileHistories() *GetFileHistories_FileHistories { + if t == nil { + t = &GetFileHistories{} + } + return &t.FileHistories +} + +type CreateBulkCSVGroup struct { + CreateBulkCSVGroup CreateBulkCSVGroup_CreateBulkCSVGroup "json:\"createBulkCSVGroup\" graphql:\"createBulkCSVGroup\"" +} + +func (t *CreateBulkCSVGroup) GetCreateBulkCSVGroup() *CreateBulkCSVGroup_CreateBulkCSVGroup { + if t == nil { + t = &CreateBulkCSVGroup{} + } + return &t.CreateBulkCSVGroup +} + +type CreateBulkGroup struct { + CreateBulkGroup CreateBulkGroup_CreateBulkGroup "json:\"createBulkGroup\" graphql:\"createBulkGroup\"" +} + +func (t *CreateBulkGroup) GetCreateBulkGroup() *CreateBulkGroup_CreateBulkGroup { + if t == nil { + t = &CreateBulkGroup{} + } + return &t.CreateBulkGroup +} + +type CreateGroup struct { + CreateGroup CreateGroup_CreateGroup "json:\"createGroup\" graphql:\"createGroup\"" +} + +func (t *CreateGroup) GetCreateGroup() *CreateGroup_CreateGroup { + if t == nil { + t = &CreateGroup{} + } + return &t.CreateGroup +} + +type DeleteGroup struct { + DeleteGroup DeleteGroup_DeleteGroup "json:\"deleteGroup\" graphql:\"deleteGroup\"" +} + +func (t *DeleteGroup) GetDeleteGroup() *DeleteGroup_DeleteGroup { + if t == nil { + t = &DeleteGroup{} + } + return &t.DeleteGroup +} + +type GetAllGroups struct { + Groups GetAllGroups_Groups "json:\"groups\" graphql:\"groups\"" +} + +func (t *GetAllGroups) GetGroups() *GetAllGroups_Groups { + if t == nil { + t = &GetAllGroups{} + } + return &t.Groups +} + +type GetGroupByID struct { + Group GetGroupByID_Group "json:\"group\" graphql:\"group\"" +} + +func (t *GetGroupByID) GetGroup() *GetGroupByID_Group { + if t == nil { + t = &GetGroupByID{} + } + return &t.Group +} + +type GetGroups struct { + Groups GetGroups_Groups "json:\"groups\" graphql:\"groups\"" +} + +func (t *GetGroups) GetGroups() *GetGroups_Groups { + if t == nil { + t = &GetGroups{} + } + return &t.Groups +} + +type UpdateGroup struct { + UpdateGroup UpdateGroup_UpdateGroup "json:\"updateGroup\" graphql:\"updateGroup\"" +} + +func (t *UpdateGroup) GetUpdateGroup() *UpdateGroup_UpdateGroup { + if t == nil { + t = &UpdateGroup{} + } + return &t.UpdateGroup +} + +type GetAllGroupHistories struct { + GroupHistories GetAllGroupHistories_GroupHistories "json:\"groupHistories\" graphql:\"groupHistories\"" +} + +func (t *GetAllGroupHistories) GetGroupHistories() *GetAllGroupHistories_GroupHistories { + if t == nil { + t = &GetAllGroupHistories{} + } + return &t.GroupHistories +} + +type GetGroupHistories struct { + GroupHistories GetGroupHistories_GroupHistories "json:\"groupHistories\" graphql:\"groupHistories\"" +} + +func (t *GetGroupHistories) GetGroupHistories() *GetGroupHistories_GroupHistories { + if t == nil { + t = &GetGroupHistories{} + } + return &t.GroupHistories +} + +type AddUserToGroupWithRole struct { + CreateGroupMembership AddUserToGroupWithRole_CreateGroupMembership "json:\"createGroupMembership\" graphql:\"createGroupMembership\"" +} + +func (t *AddUserToGroupWithRole) GetCreateGroupMembership() *AddUserToGroupWithRole_CreateGroupMembership { + if t == nil { + t = &AddUserToGroupWithRole{} + } + return &t.CreateGroupMembership +} + +type CreateBulkCSVGroupMembers struct { + CreateBulkCSVGroupMembership CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership "json:\"createBulkCSVGroupMembership\" graphql:\"createBulkCSVGroupMembership\"" +} + +func (t *CreateBulkCSVGroupMembers) GetCreateBulkCSVGroupMembership() *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership { + if t == nil { + t = &CreateBulkCSVGroupMembers{} + } + return &t.CreateBulkCSVGroupMembership +} + +type CreateBulkGroupMembers struct { + CreateBulkGroupMembership CreateBulkGroupMembers_CreateBulkGroupMembership "json:\"createBulkGroupMembership\" graphql:\"createBulkGroupMembership\"" +} + +func (t *CreateBulkGroupMembers) GetCreateBulkGroupMembership() *CreateBulkGroupMembers_CreateBulkGroupMembership { + if t == nil { + t = &CreateBulkGroupMembers{} + } + return &t.CreateBulkGroupMembership +} + +type GetGroupMembersByGroupID struct { + GroupMemberships GetGroupMembersByGroupID_GroupMemberships "json:\"groupMemberships\" graphql:\"groupMemberships\"" +} + +func (t *GetGroupMembersByGroupID) GetGroupMemberships() *GetGroupMembersByGroupID_GroupMemberships { + if t == nil { + t = &GetGroupMembersByGroupID{} + } + return &t.GroupMemberships +} + +type RemoveUserFromGroup struct { + DeleteGroupMembership RemoveUserFromGroup_DeleteGroupMembership "json:\"deleteGroupMembership\" graphql:\"deleteGroupMembership\"" +} + +func (t *RemoveUserFromGroup) GetDeleteGroupMembership() *RemoveUserFromGroup_DeleteGroupMembership { + if t == nil { + t = &RemoveUserFromGroup{} + } + return &t.DeleteGroupMembership +} + +type UpdateUserRoleInGroup struct { + UpdateGroupMembership UpdateUserRoleInGroup_UpdateGroupMembership "json:\"updateGroupMembership\" graphql:\"updateGroupMembership\"" +} + +func (t *UpdateUserRoleInGroup) GetUpdateGroupMembership() *UpdateUserRoleInGroup_UpdateGroupMembership { + if t == nil { + t = &UpdateUserRoleInGroup{} + } + return &t.UpdateGroupMembership +} + +type GetAllGroupMembershipHistories struct { + GroupMembershipHistories GetAllGroupMembershipHistories_GroupMembershipHistories "json:\"groupMembershipHistories\" graphql:\"groupMembershipHistories\"" +} + +func (t *GetAllGroupMembershipHistories) GetGroupMembershipHistories() *GetAllGroupMembershipHistories_GroupMembershipHistories { + if t == nil { + t = &GetAllGroupMembershipHistories{} + } + return &t.GroupMembershipHistories +} + +type GetGroupMembershipHistories struct { + GroupMembershipHistories GetGroupMembershipHistories_GroupMembershipHistories "json:\"groupMembershipHistories\" graphql:\"groupMembershipHistories\"" +} + +func (t *GetGroupMembershipHistories) GetGroupMembershipHistories() *GetGroupMembershipHistories_GroupMembershipHistories { + if t == nil { + t = &GetGroupMembershipHistories{} + } + return &t.GroupMembershipHistories +} + +type GetAllGroupSettings struct { + GroupSettings GetAllGroupSettings_GroupSettings "json:\"groupSettings\" graphql:\"groupSettings\"" +} + +func (t *GetAllGroupSettings) GetGroupSettings() *GetAllGroupSettings_GroupSettings { + if t == nil { + t = &GetAllGroupSettings{} + } + return &t.GroupSettings +} + +type GetGroupSettingByID struct { + GroupSetting GetGroupSettingByID_GroupSetting "json:\"groupSetting\" graphql:\"groupSetting\"" +} + +func (t *GetGroupSettingByID) GetGroupSetting() *GetGroupSettingByID_GroupSetting { + if t == nil { + t = &GetGroupSettingByID{} + } + return &t.GroupSetting +} + +type GetGroupSettings struct { + GroupSettings GetGroupSettings_GroupSettings "json:\"groupSettings\" graphql:\"groupSettings\"" +} + +func (t *GetGroupSettings) GetGroupSettings() *GetGroupSettings_GroupSettings { + if t == nil { + t = &GetGroupSettings{} + } + return &t.GroupSettings +} + +type UpdateGroupSetting struct { + UpdateGroupSetting UpdateGroupSetting_UpdateGroupSetting "json:\"updateGroupSetting\" graphql:\"updateGroupSetting\"" +} + +func (t *UpdateGroupSetting) GetUpdateGroupSetting() *UpdateGroupSetting_UpdateGroupSetting { + if t == nil { + t = &UpdateGroupSetting{} + } + return &t.UpdateGroupSetting +} + +type GetAllGroupSettingHistories struct { + GroupSettingHistories GetAllGroupSettingHistories_GroupSettingHistories "json:\"groupSettingHistories\" graphql:\"groupSettingHistories\"" +} + +func (t *GetAllGroupSettingHistories) GetGroupSettingHistories() *GetAllGroupSettingHistories_GroupSettingHistories { + if t == nil { + t = &GetAllGroupSettingHistories{} + } + return &t.GroupSettingHistories +} + +type GetGroupSettingHistories struct { + GroupSettingHistories GetGroupSettingHistories_GroupSettingHistories "json:\"groupSettingHistories\" graphql:\"groupSettingHistories\"" +} + +func (t *GetGroupSettingHistories) GetGroupSettingHistories() *GetGroupSettingHistories_GroupSettingHistories { + if t == nil { + t = &GetGroupSettingHistories{} + } + return &t.GroupSettingHistories +} + +type CreateBulkCSVHush struct { + CreateBulkCSVHush CreateBulkCSVHush_CreateBulkCSVHush "json:\"createBulkCSVHush\" graphql:\"createBulkCSVHush\"" +} + +func (t *CreateBulkCSVHush) GetCreateBulkCSVHush() *CreateBulkCSVHush_CreateBulkCSVHush { + if t == nil { + t = &CreateBulkCSVHush{} + } + return &t.CreateBulkCSVHush +} + +type CreateBulkHush struct { + CreateBulkHush CreateBulkHush_CreateBulkHush "json:\"createBulkHush\" graphql:\"createBulkHush\"" +} + +func (t *CreateBulkHush) GetCreateBulkHush() *CreateBulkHush_CreateBulkHush { + if t == nil { + t = &CreateBulkHush{} + } + return &t.CreateBulkHush +} + +type CreateHush struct { + CreateHush CreateHush_CreateHush "json:\"createHush\" graphql:\"createHush\"" +} + +func (t *CreateHush) GetCreateHush() *CreateHush_CreateHush { + if t == nil { + t = &CreateHush{} + } + return &t.CreateHush +} + +type GetAllHushes struct { + Hushes GetAllHushes_Hushes "json:\"hushes\" graphql:\"hushes\"" +} + +func (t *GetAllHushes) GetHushes() *GetAllHushes_Hushes { + if t == nil { + t = &GetAllHushes{} + } + return &t.Hushes +} + +type GetHushByID struct { + Hush GetHushByID_Hush "json:\"hush\" graphql:\"hush\"" +} + +func (t *GetHushByID) GetHush() *GetHushByID_Hush { + if t == nil { + t = &GetHushByID{} + } + return &t.Hush +} + +type GetHushes struct { + Hushes GetHushes_Hushes "json:\"hushes\" graphql:\"hushes\"" +} + +func (t *GetHushes) GetHushes() *GetHushes_Hushes { + if t == nil { + t = &GetHushes{} + } + return &t.Hushes +} + +type UpdateHush struct { + UpdateHush UpdateHush_UpdateHush "json:\"updateHush\" graphql:\"updateHush\"" +} + +func (t *UpdateHush) GetUpdateHush() *UpdateHush_UpdateHush { + if t == nil { + t = &UpdateHush{} + } + return &t.UpdateHush +} + +type GetAllHushHistories struct { + HushHistories GetAllHushHistories_HushHistories "json:\"hushHistories\" graphql:\"hushHistories\"" +} + +func (t *GetAllHushHistories) GetHushHistories() *GetAllHushHistories_HushHistories { + if t == nil { + t = &GetAllHushHistories{} + } + return &t.HushHistories +} + +type GetHushHistories struct { + HushHistories GetHushHistories_HushHistories "json:\"hushHistories\" graphql:\"hushHistories\"" +} + +func (t *GetHushHistories) GetHushHistories() *GetHushHistories_HushHistories { + if t == nil { + t = &GetHushHistories{} + } + return &t.HushHistories +} + +type CreateBulkCSVIntegration struct { + CreateBulkCSVIntegration CreateBulkCSVIntegration_CreateBulkCSVIntegration "json:\"createBulkCSVIntegration\" graphql:\"createBulkCSVIntegration\"" +} + +func (t *CreateBulkCSVIntegration) GetCreateBulkCSVIntegration() *CreateBulkCSVIntegration_CreateBulkCSVIntegration { + if t == nil { + t = &CreateBulkCSVIntegration{} + } + return &t.CreateBulkCSVIntegration +} + +type CreateBulkIntegration struct { + CreateBulkIntegration CreateBulkIntegration_CreateBulkIntegration "json:\"createBulkIntegration\" graphql:\"createBulkIntegration\"" +} + +func (t *CreateBulkIntegration) GetCreateBulkIntegration() *CreateBulkIntegration_CreateBulkIntegration { + if t == nil { + t = &CreateBulkIntegration{} + } + return &t.CreateBulkIntegration +} + +type CreateIntegration struct { + CreateIntegration CreateIntegration_CreateIntegration "json:\"createIntegration\" graphql:\"createIntegration\"" +} + +func (t *CreateIntegration) GetCreateIntegration() *CreateIntegration_CreateIntegration { + if t == nil { + t = &CreateIntegration{} + } + return &t.CreateIntegration +} + +type DeleteIntegration struct { + DeleteIntegration DeleteIntegration_DeleteIntegration "json:\"deleteIntegration\" graphql:\"deleteIntegration\"" +} + +func (t *DeleteIntegration) GetDeleteIntegration() *DeleteIntegration_DeleteIntegration { + if t == nil { + t = &DeleteIntegration{} + } + return &t.DeleteIntegration +} + +type GetAllIntegrations struct { + Integrations GetAllIntegrations_Integrations "json:\"integrations\" graphql:\"integrations\"" +} + +func (t *GetAllIntegrations) GetIntegrations() *GetAllIntegrations_Integrations { + if t == nil { + t = &GetAllIntegrations{} + } + return &t.Integrations +} + +type GetIntegrationByID struct { + Integration GetIntegrationByID_Integration "json:\"integration\" graphql:\"integration\"" +} + +func (t *GetIntegrationByID) GetIntegration() *GetIntegrationByID_Integration { + if t == nil { + t = &GetIntegrationByID{} + } + return &t.Integration +} + +type GetIntegrations struct { + Integrations GetIntegrations_Integrations "json:\"integrations\" graphql:\"integrations\"" +} + +func (t *GetIntegrations) GetIntegrations() *GetIntegrations_Integrations { + if t == nil { + t = &GetIntegrations{} + } + return &t.Integrations +} + +type UpdateIntegration struct { + UpdateIntegration UpdateIntegration_UpdateIntegration "json:\"updateIntegration\" graphql:\"updateIntegration\"" +} + +func (t *UpdateIntegration) GetUpdateIntegration() *UpdateIntegration_UpdateIntegration { + if t == nil { + t = &UpdateIntegration{} + } + return &t.UpdateIntegration +} + +type GetAllIntegrationHistories struct { + IntegrationHistories GetAllIntegrationHistories_IntegrationHistories "json:\"integrationHistories\" graphql:\"integrationHistories\"" +} + +func (t *GetAllIntegrationHistories) GetIntegrationHistories() *GetAllIntegrationHistories_IntegrationHistories { + if t == nil { + t = &GetAllIntegrationHistories{} + } + return &t.IntegrationHistories +} + +type GetIntegrationHistories struct { + IntegrationHistories GetIntegrationHistories_IntegrationHistories "json:\"integrationHistories\" graphql:\"integrationHistories\"" +} + +func (t *GetIntegrationHistories) GetIntegrationHistories() *GetIntegrationHistories_IntegrationHistories { + if t == nil { + t = &GetIntegrationHistories{} + } + return &t.IntegrationHistories +} + +type CreateBulkCSVInvite struct { + CreateBulkCSVInvite CreateBulkCSVInvite_CreateBulkCSVInvite "json:\"createBulkCSVInvite\" graphql:\"createBulkCSVInvite\"" +} + +func (t *CreateBulkCSVInvite) GetCreateBulkCSVInvite() *CreateBulkCSVInvite_CreateBulkCSVInvite { + if t == nil { + t = &CreateBulkCSVInvite{} + } + return &t.CreateBulkCSVInvite +} + +type CreateBulkInvite struct { + CreateBulkInvite CreateBulkInvite_CreateBulkInvite "json:\"createBulkInvite\" graphql:\"createBulkInvite\"" +} + +func (t *CreateBulkInvite) GetCreateBulkInvite() *CreateBulkInvite_CreateBulkInvite { + if t == nil { + t = &CreateBulkInvite{} + } + return &t.CreateBulkInvite +} + +type CreateInvite struct { + CreateInvite CreateInvite_CreateInvite "json:\"createInvite\" graphql:\"createInvite\"" +} + +func (t *CreateInvite) GetCreateInvite() *CreateInvite_CreateInvite { + if t == nil { + t = &CreateInvite{} + } + return &t.CreateInvite +} + +type DeleteInvite struct { + DeleteInvite DeleteInvite_DeleteInvite "json:\"deleteInvite\" graphql:\"deleteInvite\"" +} + +func (t *DeleteInvite) GetDeleteInvite() *DeleteInvite_DeleteInvite { + if t == nil { + t = &DeleteInvite{} + } + return &t.DeleteInvite +} + +type GetInviteByID struct { + Invite GetInviteByID_Invite "json:\"invite\" graphql:\"invite\"" +} + +func (t *GetInviteByID) GetInvite() *GetInviteByID_Invite { + if t == nil { + t = &GetInviteByID{} + } + return &t.Invite +} + +type GetAllInvites struct { + Invites GetAllInvites_Invites "json:\"invites\" graphql:\"invites\"" +} + +func (t *GetAllInvites) GetInvites() *GetAllInvites_Invites { + if t == nil { + t = &GetAllInvites{} + } + return &t.Invites +} + +type InvitesByOrgID struct { + Invites InvitesByOrgID_Invites "json:\"invites\" graphql:\"invites\"" +} + +func (t *InvitesByOrgID) GetInvites() *InvitesByOrgID_Invites { + if t == nil { + t = &InvitesByOrgID{} + } + return &t.Invites +} + +type GetAllNoteHistories struct { + NoteHistories GetAllNoteHistories_NoteHistories "json:\"noteHistories\" graphql:\"noteHistories\"" +} + +func (t *GetAllNoteHistories) GetNoteHistories() *GetAllNoteHistories_NoteHistories { + if t == nil { + t = &GetAllNoteHistories{} + } + return &t.NoteHistories +} + +type GetNoteHistories struct { + NoteHistories GetNoteHistories_NoteHistories "json:\"noteHistories\" graphql:\"noteHistories\"" +} + +func (t *GetNoteHistories) GetNoteHistories() *GetNoteHistories_NoteHistories { + if t == nil { + t = &GetNoteHistories{} + } + return &t.NoteHistories +} + +type GetAllOauthProviderHistories struct { + OauthProviderHistories GetAllOauthProviderHistories_OauthProviderHistories "json:\"oauthProviderHistories\" graphql:\"oauthProviderHistories\"" +} + +func (t *GetAllOauthProviderHistories) GetOauthProviderHistories() *GetAllOauthProviderHistories_OauthProviderHistories { + if t == nil { + t = &GetAllOauthProviderHistories{} + } + return &t.OauthProviderHistories +} + +type GetOauthProviderHistories struct { + OauthProviderHistories GetOauthProviderHistories_OauthProviderHistories "json:\"oauthProviderHistories\" graphql:\"oauthProviderHistories\"" +} + +func (t *GetOauthProviderHistories) GetOauthProviderHistories() *GetOauthProviderHistories_OauthProviderHistories { + if t == nil { + t = &GetOauthProviderHistories{} + } + return &t.OauthProviderHistories +} + +type CreateBulkCSVOhAuthTooToken struct { + CreateBulkCSVOhAuthTooToken CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken "json:\"createBulkCSVOhAuthTooToken\" graphql:\"createBulkCSVOhAuthTooToken\"" +} + +func (t *CreateBulkCSVOhAuthTooToken) GetCreateBulkCSVOhAuthTooToken() *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken{} + } + return &t.CreateBulkCSVOhAuthTooToken +} + +type CreateBulkOhAuthTooToken struct { + CreateBulkOhAuthTooToken CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken "json:\"createBulkOhAuthTooToken\" graphql:\"createBulkOhAuthTooToken\"" +} + +func (t *CreateBulkOhAuthTooToken) GetCreateBulkOhAuthTooToken() *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken { + if t == nil { + t = &CreateBulkOhAuthTooToken{} + } + return &t.CreateBulkOhAuthTooToken +} + +type CreateOhAuthTooToken struct { + CreateOhAuthTooToken CreateOhAuthTooToken_CreateOhAuthTooToken "json:\"createOhAuthTooToken\" graphql:\"createOhAuthTooToken\"" +} + +func (t *CreateOhAuthTooToken) GetCreateOhAuthTooToken() *CreateOhAuthTooToken_CreateOhAuthTooToken { + if t == nil { + t = &CreateOhAuthTooToken{} + } + return &t.CreateOhAuthTooToken +} + +type DeleteOhAuthTooToken struct { + DeleteOhAuthTooToken DeleteOhAuthTooToken_DeleteOhAuthTooToken "json:\"deleteOhAuthTooToken\" graphql:\"deleteOhAuthTooToken\"" +} + +func (t *DeleteOhAuthTooToken) GetDeleteOhAuthTooToken() *DeleteOhAuthTooToken_DeleteOhAuthTooToken { + if t == nil { + t = &DeleteOhAuthTooToken{} + } + return &t.DeleteOhAuthTooToken +} + +type GetOhAuthTooTokens struct { + OhAuthTooTokens GetOhAuthTooTokens_OhAuthTooTokens "json:\"ohAuthTooTokens\" graphql:\"ohAuthTooTokens\"" +} + +func (t *GetOhAuthTooTokens) GetOhAuthTooTokens() *GetOhAuthTooTokens_OhAuthTooTokens { + if t == nil { + t = &GetOhAuthTooTokens{} + } + return &t.OhAuthTooTokens +} + +type UpdateOhAuthTooToken struct { + UpdateOhAuthTooToken UpdateOhAuthTooToken_UpdateOhAuthTooToken "json:\"updateOhAuthTooToken\" graphql:\"updateOhAuthTooToken\"" +} + +func (t *UpdateOhAuthTooToken) GetUpdateOhAuthTooToken() *UpdateOhAuthTooToken_UpdateOhAuthTooToken { + if t == nil { + t = &UpdateOhAuthTooToken{} + } + return &t.UpdateOhAuthTooToken +} + +type CreateBulkCSVOrganization struct { + CreateBulkCSVOrganization CreateBulkCSVOrganization_CreateBulkCSVOrganization "json:\"createBulkCSVOrganization\" graphql:\"createBulkCSVOrganization\"" +} + +func (t *CreateBulkCSVOrganization) GetCreateBulkCSVOrganization() *CreateBulkCSVOrganization_CreateBulkCSVOrganization { + if t == nil { + t = &CreateBulkCSVOrganization{} + } + return &t.CreateBulkCSVOrganization +} + +type CreateBulkOrganization struct { + CreateBulkOrganization CreateBulkOrganization_CreateBulkOrganization "json:\"createBulkOrganization\" graphql:\"createBulkOrganization\"" +} + +func (t *CreateBulkOrganization) GetCreateBulkOrganization() *CreateBulkOrganization_CreateBulkOrganization { + if t == nil { + t = &CreateBulkOrganization{} + } + return &t.CreateBulkOrganization +} + +type CreateOrganization struct { + CreateOrganization CreateOrganization_CreateOrganization "json:\"createOrganization\" graphql:\"createOrganization\"" +} + +func (t *CreateOrganization) GetCreateOrganization() *CreateOrganization_CreateOrganization { + if t == nil { + t = &CreateOrganization{} + } + return &t.CreateOrganization +} + +type DeleteOrganization struct { + DeleteOrganization DeleteOrganization_DeleteOrganization "json:\"deleteOrganization\" graphql:\"deleteOrganization\"" +} + +func (t *DeleteOrganization) GetDeleteOrganization() *DeleteOrganization_DeleteOrganization { + if t == nil { + t = &DeleteOrganization{} + } + return &t.DeleteOrganization +} + +type GetAllOrganizations struct { + Organizations GetAllOrganizations_Organizations "json:\"organizations\" graphql:\"organizations\"" +} + +func (t *GetAllOrganizations) GetOrganizations() *GetAllOrganizations_Organizations { + if t == nil { + t = &GetAllOrganizations{} + } + return &t.Organizations +} + +type GetOrganizationByID struct { + Organization GetOrganizationByID_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *GetOrganizationByID) GetOrganization() *GetOrganizationByID_Organization { + if t == nil { + t = &GetOrganizationByID{} + } + return &t.Organization +} + +type GetOrganizations struct { + Organizations GetOrganizations_Organizations "json:\"organizations\" graphql:\"organizations\"" +} + +func (t *GetOrganizations) GetOrganizations() *GetOrganizations_Organizations { + if t == nil { + t = &GetOrganizations{} + } + return &t.Organizations +} + +type UpdateOrganization struct { + UpdateOrganization UpdateOrganization_UpdateOrganization "json:\"updateOrganization\" graphql:\"updateOrganization\"" +} + +func (t *UpdateOrganization) GetUpdateOrganization() *UpdateOrganization_UpdateOrganization { + if t == nil { + t = &UpdateOrganization{} + } + return &t.UpdateOrganization +} + +type GetAllOrganizationHistories struct { + OrganizationHistories GetAllOrganizationHistories_OrganizationHistories "json:\"organizationHistories\" graphql:\"organizationHistories\"" +} + +func (t *GetAllOrganizationHistories) GetOrganizationHistories() *GetAllOrganizationHistories_OrganizationHistories { + if t == nil { + t = &GetAllOrganizationHistories{} + } + return &t.OrganizationHistories +} + +type GetOrganizationHistories struct { + OrganizationHistories GetOrganizationHistories_OrganizationHistories "json:\"organizationHistories\" graphql:\"organizationHistories\"" +} + +func (t *GetOrganizationHistories) GetOrganizationHistories() *GetOrganizationHistories_OrganizationHistories { + if t == nil { + t = &GetOrganizationHistories{} + } + return &t.OrganizationHistories +} + +type GetAllOrganizationSettings struct { + OrganizationSettings GetAllOrganizationSettings_OrganizationSettings "json:\"organizationSettings\" graphql:\"organizationSettings\"" +} + +func (t *GetAllOrganizationSettings) GetOrganizationSettings() *GetAllOrganizationSettings_OrganizationSettings { + if t == nil { + t = &GetAllOrganizationSettings{} + } + return &t.OrganizationSettings +} + +type GetOrganizationSettingByID struct { + OrganizationSetting GetOrganizationSettingByID_OrganizationSetting "json:\"organizationSetting\" graphql:\"organizationSetting\"" +} + +func (t *GetOrganizationSettingByID) GetOrganizationSetting() *GetOrganizationSettingByID_OrganizationSetting { + if t == nil { + t = &GetOrganizationSettingByID{} + } + return &t.OrganizationSetting +} + +type GetOrganizationSettings struct { + OrganizationSettings GetOrganizationSettings_OrganizationSettings "json:\"organizationSettings\" graphql:\"organizationSettings\"" +} + +func (t *GetOrganizationSettings) GetOrganizationSettings() *GetOrganizationSettings_OrganizationSettings { + if t == nil { + t = &GetOrganizationSettings{} + } + return &t.OrganizationSettings +} + +type UpdateOrganizationSetting struct { + UpdateOrganizationSetting UpdateOrganizationSetting_UpdateOrganizationSetting "json:\"updateOrganizationSetting\" graphql:\"updateOrganizationSetting\"" +} + +func (t *UpdateOrganizationSetting) GetUpdateOrganizationSetting() *UpdateOrganizationSetting_UpdateOrganizationSetting { + if t == nil { + t = &UpdateOrganizationSetting{} + } + return &t.UpdateOrganizationSetting +} + +type GetAllOrganizationSettingHistories struct { + OrganizationSettingHistories GetAllOrganizationSettingHistories_OrganizationSettingHistories "json:\"organizationSettingHistories\" graphql:\"organizationSettingHistories\"" +} + +func (t *GetAllOrganizationSettingHistories) GetOrganizationSettingHistories() *GetAllOrganizationSettingHistories_OrganizationSettingHistories { + if t == nil { + t = &GetAllOrganizationSettingHistories{} + } + return &t.OrganizationSettingHistories +} + +type GetOrganizationSettingHistories struct { + OrganizationSettingHistories GetOrganizationSettingHistories_OrganizationSettingHistories "json:\"organizationSettingHistories\" graphql:\"organizationSettingHistories\"" +} + +func (t *GetOrganizationSettingHistories) GetOrganizationSettingHistories() *GetOrganizationSettingHistories_OrganizationSettingHistories { + if t == nil { + t = &GetOrganizationSettingHistories{} + } + return &t.OrganizationSettingHistories +} + +type AddUserToOrgWithRole struct { + CreateOrgMembership AddUserToOrgWithRole_CreateOrgMembership "json:\"createOrgMembership\" graphql:\"createOrgMembership\"" +} + +func (t *AddUserToOrgWithRole) GetCreateOrgMembership() *AddUserToOrgWithRole_CreateOrgMembership { + if t == nil { + t = &AddUserToOrgWithRole{} + } + return &t.CreateOrgMembership +} + +type CreateBulkCSVOrgMembers struct { + CreateBulkCSVOrgMembership CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership "json:\"createBulkCSVOrgMembership\" graphql:\"createBulkCSVOrgMembership\"" +} + +func (t *CreateBulkCSVOrgMembers) GetCreateBulkCSVOrgMembership() *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership { + if t == nil { + t = &CreateBulkCSVOrgMembers{} + } + return &t.CreateBulkCSVOrgMembership +} + +type CreateBulkOrgMembers struct { + CreateBulkOrgMembership CreateBulkOrgMembers_CreateBulkOrgMembership "json:\"createBulkOrgMembership\" graphql:\"createBulkOrgMembership\"" +} + +func (t *CreateBulkOrgMembers) GetCreateBulkOrgMembership() *CreateBulkOrgMembers_CreateBulkOrgMembership { + if t == nil { + t = &CreateBulkOrgMembers{} + } + return &t.CreateBulkOrgMembership +} + +type GetOrgMembersByOrgID struct { + OrgMemberships GetOrgMembersByOrgID_OrgMemberships "json:\"orgMemberships\" graphql:\"orgMemberships\"" +} + +func (t *GetOrgMembersByOrgID) GetOrgMemberships() *GetOrgMembersByOrgID_OrgMemberships { + if t == nil { + t = &GetOrgMembersByOrgID{} + } + return &t.OrgMemberships +} + +type RemoveUserFromOrg struct { + DeleteOrgMembership RemoveUserFromOrg_DeleteOrgMembership "json:\"deleteOrgMembership\" graphql:\"deleteOrgMembership\"" +} + +func (t *RemoveUserFromOrg) GetDeleteOrgMembership() *RemoveUserFromOrg_DeleteOrgMembership { + if t == nil { + t = &RemoveUserFromOrg{} + } + return &t.DeleteOrgMembership +} + +type UpdateUserRoleInOrg struct { + UpdateOrgMembership UpdateUserRoleInOrg_UpdateOrgMembership "json:\"updateOrgMembership\" graphql:\"updateOrgMembership\"" +} + +func (t *UpdateUserRoleInOrg) GetUpdateOrgMembership() *UpdateUserRoleInOrg_UpdateOrgMembership { + if t == nil { + t = &UpdateUserRoleInOrg{} + } + return &t.UpdateOrgMembership +} + +type GetAllOrgMembershipHistories struct { + OrgMembershipHistories GetAllOrgMembershipHistories_OrgMembershipHistories "json:\"orgMembershipHistories\" graphql:\"orgMembershipHistories\"" +} + +func (t *GetAllOrgMembershipHistories) GetOrgMembershipHistories() *GetAllOrgMembershipHistories_OrgMembershipHistories { + if t == nil { + t = &GetAllOrgMembershipHistories{} + } + return &t.OrgMembershipHistories +} + +type GetOrgMembershipHistories struct { + OrgMembershipHistories GetOrgMembershipHistories_OrgMembershipHistories "json:\"orgMembershipHistories\" graphql:\"orgMembershipHistories\"" +} + +func (t *GetOrgMembershipHistories) GetOrgMembershipHistories() *GetOrgMembershipHistories_OrgMembershipHistories { + if t == nil { + t = &GetOrgMembershipHistories{} + } + return &t.OrgMembershipHistories +} + +type CreateBulkCSVPersonalAccessToken struct { + CreateBulkCSVPersonalAccessToken CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken "json:\"createBulkCSVPersonalAccessToken\" graphql:\"createBulkCSVPersonalAccessToken\"" +} + +func (t *CreateBulkCSVPersonalAccessToken) GetCreateBulkCSVPersonalAccessToken() *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken{} + } + return &t.CreateBulkCSVPersonalAccessToken +} + +type CreateBulkPersonalAccessToken struct { + CreateBulkPersonalAccessToken CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken "json:\"createBulkPersonalAccessToken\" graphql:\"createBulkPersonalAccessToken\"" +} + +func (t *CreateBulkPersonalAccessToken) GetCreateBulkPersonalAccessToken() *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken { + if t == nil { + t = &CreateBulkPersonalAccessToken{} + } + return &t.CreateBulkPersonalAccessToken +} + +type CreatePersonalAccessToken struct { + CreatePersonalAccessToken CreatePersonalAccessToken_CreatePersonalAccessToken "json:\"createPersonalAccessToken\" graphql:\"createPersonalAccessToken\"" +} + +func (t *CreatePersonalAccessToken) GetCreatePersonalAccessToken() *CreatePersonalAccessToken_CreatePersonalAccessToken { + if t == nil { + t = &CreatePersonalAccessToken{} + } + return &t.CreatePersonalAccessToken +} + +type DeletePersonalAccessToken struct { + DeletePersonalAccessToken DeletePersonalAccessToken_DeletePersonalAccessToken "json:\"deletePersonalAccessToken\" graphql:\"deletePersonalAccessToken\"" +} + +func (t *DeletePersonalAccessToken) GetDeletePersonalAccessToken() *DeletePersonalAccessToken_DeletePersonalAccessToken { + if t == nil { + t = &DeletePersonalAccessToken{} + } + return &t.DeletePersonalAccessToken +} + +type GetAllPersonalAccessTokens struct { + PersonalAccessTokens GetAllPersonalAccessTokens_PersonalAccessTokens "json:\"personalAccessTokens\" graphql:\"personalAccessTokens\"" +} + +func (t *GetAllPersonalAccessTokens) GetPersonalAccessTokens() *GetAllPersonalAccessTokens_PersonalAccessTokens { + if t == nil { + t = &GetAllPersonalAccessTokens{} + } + return &t.PersonalAccessTokens +} + +type GetPersonalAccessTokenByID struct { + PersonalAccessToken GetPersonalAccessTokenByID_PersonalAccessToken "json:\"personalAccessToken\" graphql:\"personalAccessToken\"" +} + +func (t *GetPersonalAccessTokenByID) GetPersonalAccessToken() *GetPersonalAccessTokenByID_PersonalAccessToken { + if t == nil { + t = &GetPersonalAccessTokenByID{} + } + return &t.PersonalAccessToken +} + +type UpdatePersonalAccessToken struct { + UpdatePersonalAccessToken UpdatePersonalAccessToken_UpdatePersonalAccessToken "json:\"updatePersonalAccessToken\" graphql:\"updatePersonalAccessToken\"" +} + +func (t *UpdatePersonalAccessToken) GetUpdatePersonalAccessToken() *UpdatePersonalAccessToken_UpdatePersonalAccessToken { + if t == nil { + t = &UpdatePersonalAccessToken{} + } + return &t.UpdatePersonalAccessToken +} + +type Search struct { + Search *Search_Search "json:\"search,omitempty\" graphql:\"search\"" +} + +func (t *Search) GetSearch() *Search_Search { + if t == nil { + t = &Search{} + } + return t.Search +} + +type CreateBulkCSVSubscriber struct { + CreateBulkCSVSubscriber CreateBulkCSVSubscriber_CreateBulkCSVSubscriber "json:\"createBulkCSVSubscriber\" graphql:\"createBulkCSVSubscriber\"" +} + +func (t *CreateBulkCSVSubscriber) GetCreateBulkCSVSubscriber() *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber { + if t == nil { + t = &CreateBulkCSVSubscriber{} + } + return &t.CreateBulkCSVSubscriber +} + +type CreateBulkSubscriber struct { + CreateBulkSubscriber CreateBulkSubscriber_CreateBulkSubscriber "json:\"createBulkSubscriber\" graphql:\"createBulkSubscriber\"" +} + +func (t *CreateBulkSubscriber) GetCreateBulkSubscriber() *CreateBulkSubscriber_CreateBulkSubscriber { + if t == nil { + t = &CreateBulkSubscriber{} + } + return &t.CreateBulkSubscriber +} + +type CreateSubscriber struct { + CreateSubscriber CreateSubscriber_CreateSubscriber "json:\"createSubscriber\" graphql:\"createSubscriber\"" +} + +func (t *CreateSubscriber) GetCreateSubscriber() *CreateSubscriber_CreateSubscriber { + if t == nil { + t = &CreateSubscriber{} + } + return &t.CreateSubscriber +} + +type DeleteSubscriber struct { + DeleteSubscriber DeleteSubscriber_DeleteSubscriber "json:\"deleteSubscriber\" graphql:\"deleteSubscriber\"" +} + +func (t *DeleteSubscriber) GetDeleteSubscriber() *DeleteSubscriber_DeleteSubscriber { + if t == nil { + t = &DeleteSubscriber{} + } + return &t.DeleteSubscriber +} + +type GetAllSubscribers struct { + Subscribers GetAllSubscribers_Subscribers "json:\"subscribers\" graphql:\"subscribers\"" +} + +func (t *GetAllSubscribers) GetSubscribers() *GetAllSubscribers_Subscribers { + if t == nil { + t = &GetAllSubscribers{} + } + return &t.Subscribers +} + +type GetSubscriberByEmail struct { + Subscriber GetSubscriberByEmail_Subscriber "json:\"subscriber\" graphql:\"subscriber\"" +} + +func (t *GetSubscriberByEmail) GetSubscriber() *GetSubscriberByEmail_Subscriber { + if t == nil { + t = &GetSubscriberByEmail{} + } + return &t.Subscriber +} + +type GetSubscribers struct { + Subscribers GetSubscribers_Subscribers "json:\"subscribers\" graphql:\"subscribers\"" +} + +func (t *GetSubscribers) GetSubscribers() *GetSubscribers_Subscribers { + if t == nil { + t = &GetSubscribers{} + } + return &t.Subscribers +} + +type UpdateSubscriber struct { + UpdateSubscriber UpdateSubscriber_UpdateSubscriber "json:\"updateSubscriber\" graphql:\"updateSubscriber\"" +} + +func (t *UpdateSubscriber) GetUpdateSubscriber() *UpdateSubscriber_UpdateSubscriber { + if t == nil { + t = &UpdateSubscriber{} + } + return &t.UpdateSubscriber +} + +type CreateBulkCSVTemplate struct { + CreateBulkCSVTemplate CreateBulkCSVTemplate_CreateBulkCSVTemplate "json:\"createBulkCSVTemplate\" graphql:\"createBulkCSVTemplate\"" +} + +func (t *CreateBulkCSVTemplate) GetCreateBulkCSVTemplate() *CreateBulkCSVTemplate_CreateBulkCSVTemplate { + if t == nil { + t = &CreateBulkCSVTemplate{} + } + return &t.CreateBulkCSVTemplate +} + +type CreateBulkTemplate struct { + CreateBulkTemplate CreateBulkTemplate_CreateBulkTemplate "json:\"createBulkTemplate\" graphql:\"createBulkTemplate\"" +} + +func (t *CreateBulkTemplate) GetCreateBulkTemplate() *CreateBulkTemplate_CreateBulkTemplate { + if t == nil { + t = &CreateBulkTemplate{} + } + return &t.CreateBulkTemplate +} + +type CreateTemplate struct { + CreateTemplate CreateTemplate_CreateTemplate "json:\"createTemplate\" graphql:\"createTemplate\"" +} + +func (t *CreateTemplate) GetCreateTemplate() *CreateTemplate_CreateTemplate { + if t == nil { + t = &CreateTemplate{} + } + return &t.CreateTemplate +} + +type GetAllTemplates struct { + Templates GetAllTemplates_Templates "json:\"templates\" graphql:\"templates\"" +} + +func (t *GetAllTemplates) GetTemplates() *GetAllTemplates_Templates { + if t == nil { + t = &GetAllTemplates{} + } + return &t.Templates +} + +type GetTemplateByID struct { + Template GetTemplateByID_Template "json:\"template\" graphql:\"template\"" +} + +func (t *GetTemplateByID) GetTemplate() *GetTemplateByID_Template { + if t == nil { + t = &GetTemplateByID{} + } + return &t.Template +} + +type UpdateTemplate struct { + UpdateTemplate UpdateTemplate_UpdateTemplate "json:\"updateTemplate\" graphql:\"updateTemplate\"" +} + +func (t *UpdateTemplate) GetUpdateTemplate() *UpdateTemplate_UpdateTemplate { + if t == nil { + t = &UpdateTemplate{} + } + return &t.UpdateTemplate +} + +type GetAllTemplateHistories struct { + TemplateHistories GetAllTemplateHistories_TemplateHistories "json:\"templateHistories\" graphql:\"templateHistories\"" +} + +func (t *GetAllTemplateHistories) GetTemplateHistories() *GetAllTemplateHistories_TemplateHistories { + if t == nil { + t = &GetAllTemplateHistories{} + } + return &t.TemplateHistories +} + +type GetTemplateHistories struct { + TemplateHistories GetTemplateHistories_TemplateHistories "json:\"templateHistories\" graphql:\"templateHistories\"" +} + +func (t *GetTemplateHistories) GetTemplateHistories() *GetTemplateHistories_TemplateHistories { + if t == nil { + t = &GetTemplateHistories{} + } + return &t.TemplateHistories +} + +type CreateTFASetting struct { + CreateTFASetting CreateTFASetting_CreateTFASetting "json:\"createTFASetting\" graphql:\"createTFASetting\"" +} + +func (t *CreateTFASetting) GetCreateTFASetting() *CreateTFASetting_CreateTFASetting { + if t == nil { + t = &CreateTFASetting{} + } + return &t.CreateTFASetting +} + +type GetAllTFASettings struct { + TfaSettings GetAllTFASettings_TfaSettings "json:\"tfaSettings\" graphql:\"tfaSettings\"" +} + +func (t *GetAllTFASettings) GetTfaSettings() *GetAllTFASettings_TfaSettings { + if t == nil { + t = &GetAllTFASettings{} + } + return &t.TfaSettings +} + +type GetTFASetting struct { + TfaSetting GetTFASetting_TfaSetting "json:\"tfaSetting\" graphql:\"tfaSetting\"" +} + +func (t *GetTFASetting) GetTfaSetting() *GetTFASetting_TfaSetting { + if t == nil { + t = &GetTFASetting{} + } + return &t.TfaSetting +} + +type UpdateTFASetting struct { + UpdateTFASetting UpdateTFASetting_UpdateTFASetting "json:\"updateTFASetting\" graphql:\"updateTFASetting\"" +} + +func (t *UpdateTFASetting) GetUpdateTFASetting() *UpdateTFASetting_UpdateTFASetting { + if t == nil { + t = &UpdateTFASetting{} + } + return &t.UpdateTFASetting +} + +type CreateUser struct { + CreateUser CreateUser_CreateUser "json:\"createUser\" graphql:\"createUser\"" +} + +func (t *CreateUser) GetCreateUser() *CreateUser_CreateUser { + if t == nil { + t = &CreateUser{} + } + return &t.CreateUser +} + +type DeleteUser struct { + DeleteUser DeleteUser_DeleteUser "json:\"deleteUser\" graphql:\"deleteUser\"" +} + +func (t *DeleteUser) GetDeleteUser() *DeleteUser_DeleteUser { + if t == nil { + t = &DeleteUser{} + } + return &t.DeleteUser +} + +type GetAllUsers struct { + Users GetAllUsers_Users "json:\"users\" graphql:\"users\"" +} + +func (t *GetAllUsers) GetUsers() *GetAllUsers_Users { + if t == nil { + t = &GetAllUsers{} + } + return &t.Users +} + +type GetUserByID struct { + User GetUserByID_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetUserByID) GetUser() *GetUserByID_User { + if t == nil { + t = &GetUserByID{} + } + return &t.User +} + +type GetUserByIDWithOrgs struct { + User GetUserByIDWithOrgs_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetUserByIDWithOrgs) GetUser() *GetUserByIDWithOrgs_User { + if t == nil { + t = &GetUserByIDWithOrgs{} + } + return &t.User +} + +type UpdateUser struct { + UpdateUser UpdateUser_UpdateUser "json:\"updateUser\" graphql:\"updateUser\"" +} + +func (t *UpdateUser) GetUpdateUser() *UpdateUser_UpdateUser { + if t == nil { + t = &UpdateUser{} + } + return &t.UpdateUser +} + +type GetAllUserHistories struct { + UserHistories GetAllUserHistories_UserHistories "json:\"userHistories\" graphql:\"userHistories\"" +} + +func (t *GetAllUserHistories) GetUserHistories() *GetAllUserHistories_UserHistories { + if t == nil { + t = &GetAllUserHistories{} + } + return &t.UserHistories +} + +type GetUserHistories struct { + UserHistories GetUserHistories_UserHistories "json:\"userHistories\" graphql:\"userHistories\"" +} + +func (t *GetUserHistories) GetUserHistories() *GetUserHistories_UserHistories { + if t == nil { + t = &GetUserHistories{} + } + return &t.UserHistories +} + +type GetAllUserSettings struct { + UserSettings GetAllUserSettings_UserSettings "json:\"userSettings\" graphql:\"userSettings\"" +} + +func (t *GetAllUserSettings) GetUserSettings() *GetAllUserSettings_UserSettings { + if t == nil { + t = &GetAllUserSettings{} + } + return &t.UserSettings +} + +type GetUserSettingByID struct { + UserSetting GetUserSettingByID_UserSetting "json:\"userSetting\" graphql:\"userSetting\"" +} + +func (t *GetUserSettingByID) GetUserSetting() *GetUserSettingByID_UserSetting { + if t == nil { + t = &GetUserSettingByID{} + } + return &t.UserSetting +} + +type GetUserSettings struct { + UserSettings GetUserSettings_UserSettings "json:\"userSettings\" graphql:\"userSettings\"" +} + +func (t *GetUserSettings) GetUserSettings() *GetUserSettings_UserSettings { + if t == nil { + t = &GetUserSettings{} + } + return &t.UserSettings +} + +type UpdateUserSetting struct { + UpdateUserSetting UpdateUserSetting_UpdateUserSetting "json:\"updateUserSetting\" graphql:\"updateUserSetting\"" +} + +func (t *UpdateUserSetting) GetUpdateUserSetting() *UpdateUserSetting_UpdateUserSetting { + if t == nil { + t = &UpdateUserSetting{} + } + return &t.UpdateUserSetting +} + +type GetAllUserSettingHistories struct { + UserSettingHistories GetAllUserSettingHistories_UserSettingHistories "json:\"userSettingHistories\" graphql:\"userSettingHistories\"" +} + +func (t *GetAllUserSettingHistories) GetUserSettingHistories() *GetAllUserSettingHistories_UserSettingHistories { + if t == nil { + t = &GetAllUserSettingHistories{} + } + return &t.UserSettingHistories +} + +type GetUserSettingHistories struct { + UserSettingHistories GetUserSettingHistories_UserSettingHistories "json:\"userSettingHistories\" graphql:\"userSettingHistories\"" +} + +func (t *GetUserSettingHistories) GetUserSettingHistories() *GetUserSettingHistories_UserSettingHistories { + if t == nil { + t = &GetUserSettingHistories{} + } + return &t.UserSettingHistories +} + +type GetWebhookByID struct { + Webhook GetWebhookByID_Webhook "json:\"webhook\" graphql:\"webhook\"" +} + +func (t *GetWebhookByID) GetWebhook() *GetWebhookByID_Webhook { + if t == nil { + t = &GetWebhookByID{} + } + return &t.Webhook +} + +type GetAllWebhooks struct { + Webhooks GetAllWebhooks_Webhooks "json:\"webhooks\" graphql:\"webhooks\"" +} + +func (t *GetAllWebhooks) GetWebhooks() *GetAllWebhooks_Webhooks { + if t == nil { + t = &GetAllWebhooks{} + } + return &t.Webhooks +} + +type CreateWebhook struct { + CreateWebhook CreateWebhook_CreateWebhook "json:\"createWebhook\" graphql:\"createWebhook\"" +} + +func (t *CreateWebhook) GetCreateWebhook() *CreateWebhook_CreateWebhook { + if t == nil { + t = &CreateWebhook{} + } + return &t.CreateWebhook +} + +type CreateBulkWebhook struct { + CreateBulkWebhook CreateBulkWebhook_CreateBulkWebhook "json:\"createBulkWebhook\" graphql:\"createBulkWebhook\"" +} + +func (t *CreateBulkWebhook) GetCreateBulkWebhook() *CreateBulkWebhook_CreateBulkWebhook { + if t == nil { + t = &CreateBulkWebhook{} + } + return &t.CreateBulkWebhook +} + +type CreateBulkCSVWebhook struct { + CreateBulkCSVWebhook CreateBulkCSVWebhook_CreateBulkCSVWebhook "json:\"createBulkCSVWebhook\" graphql:\"createBulkCSVWebhook\"" +} + +func (t *CreateBulkCSVWebhook) GetCreateBulkCSVWebhook() *CreateBulkCSVWebhook_CreateBulkCSVWebhook { + if t == nil { + t = &CreateBulkCSVWebhook{} + } + return &t.CreateBulkCSVWebhook +} + +type UpdateWebhook struct { + UpdateWebhook UpdateWebhook_UpdateWebhook "json:\"updateWebhook\" graphql:\"updateWebhook\"" +} + +func (t *UpdateWebhook) GetUpdateWebhook() *UpdateWebhook_UpdateWebhook { + if t == nil { + t = &UpdateWebhook{} + } + return &t.UpdateWebhook +} + +type DeleteWebhook struct { + DeleteWebhook DeleteWebhook_DeleteWebhook "json:\"deleteWebhook\" graphql:\"deleteWebhook\"" +} + +func (t *DeleteWebhook) GetDeleteWebhook() *DeleteWebhook_DeleteWebhook { + if t == nil { + t = &DeleteWebhook{} + } + return &t.DeleteWebhook +} + +type GetAllWebhookHistories struct { + WebhookHistories GetAllWebhookHistories_WebhookHistories "json:\"webhookHistories\" graphql:\"webhookHistories\"" +} + +func (t *GetAllWebhookHistories) GetWebhookHistories() *GetAllWebhookHistories_WebhookHistories { + if t == nil { + t = &GetAllWebhookHistories{} + } + return &t.WebhookHistories +} + +type GetWebhookHistories struct { + WebhookHistories GetWebhookHistories_WebhookHistories "json:\"webhookHistories\" graphql:\"webhookHistories\"" +} + +func (t *GetWebhookHistories) GetWebhookHistories() *GetWebhookHistories_WebhookHistories { + if t == nil { + t = &GetWebhookHistories{} + } + return &t.WebhookHistories +} + +const CreateAPITokenDocument = `mutation CreateAPIToken ($input: CreateAPITokenInput!) { + createAPIToken(input: $input) { + apiToken { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } +} +` + +func (c *Client) CreateAPIToken(ctx context.Context, input CreateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateAPIToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateAPIToken + if err := c.Client.Post(ctx, "CreateAPIToken", CreateAPITokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateAPITokenDocument = `mutation UpdateAPIToken ($updateAPITokenId: ID!, $input: UpdateAPITokenInput!) { + updateAPIToken(id: $updateAPITokenId, input: $input) { + apiToken { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } +} +` + +func (c *Client) UpdateAPIToken(ctx context.Context, updateAPITokenID string, input UpdateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateAPIToken, error) { + vars := map[string]any{ + "updateAPITokenId": updateAPITokenID, + "input": input, + } + + var res UpdateAPIToken + if err := c.Client.Post(ctx, "UpdateAPIToken", UpdateAPITokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllAPITokensDocument = `query GetAllAPITokens { + apiTokens { + edges { + node { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } + } +} +` + +func (c *Client) GetAllAPITokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllAPITokens, error) { + vars := map[string]any{} + + var res GetAllAPITokens + if err := c.Client.Post(ctx, "GetAllAPITokens", GetAllAPITokensDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAPITokenByIDDocument = `query GetAPITokenByID ($apiTokenId: ID!) { + apiToken(id: $apiTokenId) { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } +} +` + +func (c *Client) GetAPITokenByID(ctx context.Context, apiTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetAPITokenByID, error) { + vars := map[string]any{ + "apiTokenId": apiTokenID, + } + + var res GetAPITokenByID + if err := c.Client.Post(ctx, "GetAPITokenByID", GetAPITokenByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteAPITokenDocument = `mutation DeleteAPIToken ($deleteAPITokenId: ID!) { + deleteAPIToken(id: $deleteAPITokenId) { + deletedID + } +} +` + +func (c *Client) DeleteAPIToken(ctx context.Context, deleteAPITokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteAPIToken, error) { + vars := map[string]any{ + "deleteAPITokenId": deleteAPITokenID, + } + + var res DeleteAPIToken + if err := c.Client.Post(ctx, "DeleteAPIToken", DeleteAPITokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVContactDocument = `mutation CreateBulkCSVContact ($input: Upload!) { + createBulkCSVContact(input: $input) { + contacts { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkCSVContact(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVContact, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVContact + if err := c.Client.Post(ctx, "CreateBulkCSVContact", CreateBulkCSVContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkContactDocument = `mutation CreateBulkContact ($input: [CreateContactInput!]) { + createBulkContact(input: $input) { + contacts { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkContact(ctx context.Context, input []*CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkContact, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkContact + if err := c.Client.Post(ctx, "CreateBulkContact", CreateBulkContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateContactDocument = `mutation CreateContact ($input: CreateContactInput!) { + createContact(input: $input) { + contact { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateContact(ctx context.Context, input CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateContact, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateContact + if err := c.Client.Post(ctx, "CreateContact", CreateContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteContactDocument = `mutation DeleteContact ($deleteContactId: ID!) { + deleteContact(id: $deleteContactId) { + deletedID + } +} +` + +func (c *Client) DeleteContact(ctx context.Context, deleteContactID string, interceptors ...clientv2.RequestInterceptor) (*DeleteContact, error) { + vars := map[string]any{ + "deleteContactId": deleteContactID, + } + + var res DeleteContact + if err := c.Client.Post(ctx, "DeleteContact", DeleteContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllContactsDocument = `query GetAllContacts { + contacts { + edges { + node { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllContacts(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContacts, error) { + vars := map[string]any{} + + var res GetAllContacts + if err := c.Client.Post(ctx, "GetAllContacts", GetAllContactsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetContactByIDDocument = `query GetContactByID ($contactId: ID!) { + contact(id: $contactId) { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } +} +` + +func (c *Client) GetContactByID(ctx context.Context, contactID string, interceptors ...clientv2.RequestInterceptor) (*GetContactByID, error) { + vars := map[string]any{ + "contactId": contactID, + } + + var res GetContactByID + if err := c.Client.Post(ctx, "GetContactByID", GetContactByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetContactsDocument = `query GetContacts ($where: ContactWhereInput) { + contacts(where: $where) { + edges { + node { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetContacts(ctx context.Context, where *ContactWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContacts, error) { + vars := map[string]any{ + "where": where, + } + + var res GetContacts + if err := c.Client.Post(ctx, "GetContacts", GetContactsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateContactDocument = `mutation UpdateContact ($updateContactId: ID!, $input: UpdateContactInput!) { + updateContact(id: $updateContactId, input: $input) { + contact { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateContact(ctx context.Context, updateContactID string, input UpdateContactInput, interceptors ...clientv2.RequestInterceptor) (*UpdateContact, error) { + vars := map[string]any{ + "updateContactId": updateContactID, + "input": input, + } + + var res UpdateContact + if err := c.Client.Post(ctx, "UpdateContact", UpdateContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllContactHistoriesDocument = `query GetAllContactHistories { + contactHistories { + edges { + node { + address + company + createdAt + createdBy + email + fullName + historyTime + id + operation + ownerID + phoneNumber + ref + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllContactHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContactHistories, error) { + vars := map[string]any{} + + var res GetAllContactHistories + if err := c.Client.Post(ctx, "GetAllContactHistories", GetAllContactHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetContactHistoriesDocument = `query GetContactHistories ($where: ContactHistoryWhereInput) { + contactHistories(where: $where) { + edges { + node { + address + company + createdAt + createdBy + email + fullName + historyTime + id + operation + ownerID + phoneNumber + ref + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetContactHistories(ctx context.Context, where *ContactHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContactHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetContactHistories + if err := c.Client.Post(ctx, "GetContactHistories", GetContactHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateDocumentDataDocument = `mutation CreateDocumentData ($input: CreateDocumentDataInput!) { + createDocumentData(input: $input) { + documentData { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateDocumentData(ctx context.Context, input CreateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*CreateDocumentData, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateDocumentData + if err := c.Client.Post(ctx, "CreateDocumentData", CreateDocumentDataDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteDocumentDataDocument = `mutation DeleteDocumentData ($deleteDocumentDataId: ID!) { + deleteDocumentData(id: $deleteDocumentDataId) { + deletedID + } +} +` + +func (c *Client) DeleteDocumentData(ctx context.Context, deleteDocumentDataID string, interceptors ...clientv2.RequestInterceptor) (*DeleteDocumentData, error) { + vars := map[string]any{ + "deleteDocumentDataId": deleteDocumentDataID, + } + + var res DeleteDocumentData + if err := c.Client.Post(ctx, "DeleteDocumentData", DeleteDocumentDataDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetDocumentDataByIDDocument = `query GetDocumentDataByID ($documentDataId: ID!) { + documentData(id: $documentDataId) { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetDocumentDataByID(ctx context.Context, documentDataID string, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataByID, error) { + vars := map[string]any{ + "documentDataId": documentDataID, + } + + var res GetDocumentDataByID + if err := c.Client.Post(ctx, "GetDocumentDataByID", GetDocumentDataByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateDocumentDataDocument = `mutation UpdateDocumentData ($updateDocumentDataId: ID!, $input: UpdateDocumentDataInput!) { + updateDocumentData(id: $updateDocumentDataId, input: $input) { + documentData { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateDocumentData(ctx context.Context, updateDocumentDataID string, input UpdateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*UpdateDocumentData, error) { + vars := map[string]any{ + "updateDocumentDataId": updateDocumentDataID, + "input": input, + } + + var res UpdateDocumentData + if err := c.Client.Post(ctx, "UpdateDocumentData", UpdateDocumentDataDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllDocumentDataHistoriesDocument = `query GetAllDocumentDataHistories { + documentDataHistories { + edges { + node { + createdAt + createdBy + data + historyTime + id + operation + ownerID + ref + tags + templateID + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllDocumentDataHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllDocumentDataHistories, error) { + vars := map[string]any{} + + var res GetAllDocumentDataHistories + if err := c.Client.Post(ctx, "GetAllDocumentDataHistories", GetAllDocumentDataHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetDocumentDataHistoriesDocument = `query GetDocumentDataHistories ($where: DocumentDataHistoryWhereInput) { + documentDataHistories(where: $where) { + edges { + node { + createdAt + createdBy + data + historyTime + id + operation + ownerID + ref + tags + templateID + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetDocumentDataHistories(ctx context.Context, where *DocumentDataHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetDocumentDataHistories + if err := c.Client.Post(ctx, "GetDocumentDataHistories", GetDocumentDataHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntitlementDocument = `mutation CreateBulkCSVEntitlement ($input: Upload!) { + createBulkCSVEntitlement(input: $input) { + entitlements { + id + plan { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + organization { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkCSVEntitlement(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlement, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntitlement + if err := c.Client.Post(ctx, "CreateBulkCSVEntitlement", CreateBulkCSVEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntitlementDocument = `mutation CreateBulkEntitlement ($input: [CreateEntitlementInput!]) { + createBulkEntitlement(input: $input) { + entitlements { + id + plan { + id + name + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} +` + +func (c *Client) CreateBulkEntitlement(ctx context.Context, input []*CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlement, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntitlement + if err := c.Client.Post(ctx, "CreateBulkEntitlement", CreateBulkEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntitlementDocument = `mutation CreateEntitlement ($input: CreateEntitlementInput!) { + createEntitlement(input: $input) { + entitlement { + id + plan { + id + name + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} +` + +func (c *Client) CreateEntitlement(ctx context.Context, input CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlement, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntitlement + if err := c.Client.Post(ctx, "CreateEntitlement", CreateEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntitlementDocument = `mutation DeleteEntitlement ($deleteEntitlementId: ID!) { + deleteEntitlement(id: $deleteEntitlementId) { + deletedID + } +} +` + +func (c *Client) DeleteEntitlement(ctx context.Context, deleteEntitlementID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlement, error) { + vars := map[string]any{ + "deleteEntitlementId": deleteEntitlementID, + } + + var res DeleteEntitlement + if err := c.Client.Post(ctx, "DeleteEntitlement", DeleteEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementsDocument = `query GetAllEntitlements { + entitlements { + edges { + node { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } + } +} +` + +func (c *Client) GetAllEntitlements(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlements, error) { + vars := map[string]any{} + + var res GetAllEntitlements + if err := c.Client.Post(ctx, "GetAllEntitlements", GetAllEntitlementsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementByIDDocument = `query GetEntitlementByID ($entitlementId: ID!) { + entitlement(id: $entitlementId) { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } +} +` + +func (c *Client) GetEntitlementByID(ctx context.Context, entitlementID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementByID, error) { + vars := map[string]any{ + "entitlementId": entitlementID, + } + + var res GetEntitlementByID + if err := c.Client.Post(ctx, "GetEntitlementByID", GetEntitlementByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementsDocument = `query GetEntitlements ($where: EntitlementWhereInput) { + entitlements(where: $where) { + edges { + node { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } + } +} +` + +func (c *Client) GetEntitlements(ctx context.Context, where *EntitlementWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlements, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlements + if err := c.Client.Post(ctx, "GetEntitlements", GetEntitlementsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntitlementDocument = `mutation UpdateEntitlement ($updateEntitlementId: ID!, $input: UpdateEntitlementInput!) { + updateEntitlement(id: $updateEntitlementId, input: $input) { + entitlement { + id + plan { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} +` + +func (c *Client) UpdateEntitlement(ctx context.Context, updateEntitlementID string, input UpdateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlement, error) { + vars := map[string]any{ + "updateEntitlementId": updateEntitlementID, + "input": input, + } + + var res UpdateEntitlement + if err := c.Client.Post(ctx, "UpdateEntitlement", UpdateEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementHistoriesDocument = `query GetAllEntitlementHistories { + entitlementHistories { + edges { + node { + cancelled + createdAt + createdBy + expires + expiresAt + externalCustomerID + externalSubscriptionID + historyTime + id + operation + organizationID + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntitlementHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementHistories, error) { + vars := map[string]any{} + + var res GetAllEntitlementHistories + if err := c.Client.Post(ctx, "GetAllEntitlementHistories", GetAllEntitlementHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementHistoriesDocument = `query GetEntitlementHistories ($where: EntitlementHistoryWhereInput) { + entitlementHistories(where: $where) { + edges { + node { + cancelled + createdAt + createdBy + expires + expiresAt + externalCustomerID + externalSubscriptionID + historyTime + id + operation + organizationID + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntitlementHistories(ctx context.Context, where *EntitlementHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementHistories + if err := c.Client.Post(ctx, "GetEntitlementHistories", GetEntitlementHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntitlementPlanDocument = `mutation CreateBulkCSVEntitlementPlan ($input: Upload!) { + createBulkCSVEntitlementPlan(input: $input) { + entitlementPlans { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) CreateBulkCSVEntitlementPlan(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlan, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntitlementPlan + if err := c.Client.Post(ctx, "CreateBulkCSVEntitlementPlan", CreateBulkCSVEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntitlementPlanDocument = `mutation CreateBulkEntitlementPlan ($input: [CreateEntitlementPlanInput!]) { + createBulkEntitlementPlan(input: $input) { + entitlementPlans { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) CreateBulkEntitlementPlan(ctx context.Context, input []*CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlan, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntitlementPlan + if err := c.Client.Post(ctx, "CreateBulkEntitlementPlan", CreateBulkEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntitlementPlanDocument = `mutation CreateEntitlementPlan ($input: CreateEntitlementPlanInput!) { + createEntitlementPlan(input: $input) { + entitlementPlan { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) CreateEntitlementPlan(ctx context.Context, input CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlan, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntitlementPlan + if err := c.Client.Post(ctx, "CreateEntitlementPlan", CreateEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntitlementPlanDocument = `mutation DeleteEntitlementPlan ($deleteEntitlementPlanId: ID!) { + deleteEntitlementPlan(id: $deleteEntitlementPlanId) { + deletedID + } +} +` + +func (c *Client) DeleteEntitlementPlan(ctx context.Context, deleteEntitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlan, error) { + vars := map[string]any{ + "deleteEntitlementPlanId": deleteEntitlementPlanID, + } + + var res DeleteEntitlementPlan + if err := c.Client.Post(ctx, "DeleteEntitlementPlan", DeleteEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlansDocument = `query GetAllEntitlementPlans { + entitlementPlans { + edges { + node { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlans(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlans, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlans + if err := c.Client.Post(ctx, "GetAllEntitlementPlans", GetAllEntitlementPlansDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanByIDDocument = `query GetEntitlementPlanByID ($entitlementPlanId: ID!) { + entitlementPlan(id: $entitlementPlanId) { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } +} +` + +func (c *Client) GetEntitlementPlanByID(ctx context.Context, entitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanByID, error) { + vars := map[string]any{ + "entitlementPlanId": entitlementPlanID, + } + + var res GetEntitlementPlanByID + if err := c.Client.Post(ctx, "GetEntitlementPlanByID", GetEntitlementPlanByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlansDocument = `query GetEntitlementPlans ($where: EntitlementPlanWhereInput) { + entitlementPlans(where: $where) { + edges { + node { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } + } + } +} +` + +func (c *Client) GetEntitlementPlans(ctx context.Context, where *EntitlementPlanWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlans, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlans + if err := c.Client.Post(ctx, "GetEntitlementPlans", GetEntitlementPlansDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntitlementPlanDocument = `mutation UpdateEntitlementPlan ($updateEntitlementPlanId: ID!, $input: UpdateEntitlementPlanInput!) { + updateEntitlementPlan(id: $updateEntitlementPlanId, input: $input) { + entitlementPlan { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) UpdateEntitlementPlan(ctx context.Context, updateEntitlementPlanID string, input UpdateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlan, error) { + vars := map[string]any{ + "updateEntitlementPlanId": updateEntitlementPlanID, + "input": input, + } + + var res UpdateEntitlementPlan + if err := c.Client.Post(ctx, "UpdateEntitlementPlan", UpdateEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlanFeaturesDocument = `query GetAllEntitlementPlanFeatures { + entitlementPlanFeatures { + edges { + node { + id + feature { + id + name + } + metadata + plan { + id + name + } + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlanFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatures, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlanFeatures + if err := c.Client.Post(ctx, "GetAllEntitlementPlanFeatures", GetAllEntitlementPlanFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanFeatureByIDDocument = `query GetEntitlementPlanFeatureByID ($entitlementPlanFeatureId: ID!) { + entitlementPlanFeature(id: $entitlementPlanFeatureId) { + id + metadata + plan { + id + name + } + feature { + id + name + } + } +} +` + +func (c *Client) GetEntitlementPlanFeatureByID(ctx context.Context, entitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureByID, error) { + vars := map[string]any{ + "entitlementPlanFeatureId": entitlementPlanFeatureID, + } + + var res GetEntitlementPlanFeatureByID + if err := c.Client.Post(ctx, "GetEntitlementPlanFeatureByID", GetEntitlementPlanFeatureByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanFeaturesDocument = `query GetEntitlementPlanFeatures ($where: EntitlementPlanFeatureWhereInput) { + entitlementPlanFeatures(where: $where) { + edges { + node { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } + } +} +` + +func (c *Client) GetEntitlementPlanFeatures(ctx context.Context, where *EntitlementPlanFeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatures, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlanFeatures + if err := c.Client.Post(ctx, "GetEntitlementPlanFeatures", GetEntitlementPlanFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntitlementPlanFeatureDocument = `mutation CreateEntitlementPlanFeature ($input: CreateEntitlementPlanFeatureInput!) { + createEntitlementPlanFeature(input: $input) { + entitlementPlanFeature { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) CreateEntitlementPlanFeature(ctx context.Context, input CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlanFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntitlementPlanFeature + if err := c.Client.Post(ctx, "CreateEntitlementPlanFeature", CreateEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntitlementPlanFeatureDocument = `mutation CreateBulkCSVEntitlementPlanFeature ($input: Upload!) { + createBulkCSVEntitlementPlanFeature(input: $input) { + entitlementPlanFeatures { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkCSVEntitlementPlanFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlanFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntitlementPlanFeature + if err := c.Client.Post(ctx, "CreateBulkCSVEntitlementPlanFeature", CreateBulkCSVEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntitlementPlanFeatureDocument = `mutation CreateBulkEntitlementPlanFeature ($input: [CreateEntitlementPlanFeatureInput!]) { + createBulkEntitlementPlanFeature(input: $input) { + entitlementPlanFeatures { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkEntitlementPlanFeature(ctx context.Context, input []*CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlanFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntitlementPlanFeature + if err := c.Client.Post(ctx, "CreateBulkEntitlementPlanFeature", CreateBulkEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntitlementPlanFeatureDocument = `mutation UpdateEntitlementPlanFeature ($updateEntitlementPlanFeatureId: ID!, $input: UpdateEntitlementPlanFeatureInput!) { + updateEntitlementPlanFeature(id: $updateEntitlementPlanFeatureId, input: $input) { + entitlementPlanFeature { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) UpdateEntitlementPlanFeature(ctx context.Context, updateEntitlementPlanFeatureID string, input UpdateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlanFeature, error) { + vars := map[string]any{ + "updateEntitlementPlanFeatureId": updateEntitlementPlanFeatureID, + "input": input, + } + + var res UpdateEntitlementPlanFeature + if err := c.Client.Post(ctx, "UpdateEntitlementPlanFeature", UpdateEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntitlementPlanFeatureDocument = `mutation DeleteEntitlementPlanFeature ($deleteEntitlementPlanFeatureId: ID!) { + deleteEntitlementPlanFeature(id: $deleteEntitlementPlanFeatureId) { + deletedID + } +} +` + +func (c *Client) DeleteEntitlementPlanFeature(ctx context.Context, deleteEntitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlanFeature, error) { + vars := map[string]any{ + "deleteEntitlementPlanFeatureId": deleteEntitlementPlanFeatureID, + } + + var res DeleteEntitlementPlanFeature + if err := c.Client.Post(ctx, "DeleteEntitlementPlanFeature", DeleteEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlanFeatureHistoriesDocument = `query GetAllEntitlementPlanFeatureHistories { + entitlementPlanFeatureHistories { + edges { + node { + createdAt + createdBy + featureID + historyTime + id + metadata + operation + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlanFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatureHistories, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlanFeatureHistories + if err := c.Client.Post(ctx, "GetAllEntitlementPlanFeatureHistories", GetAllEntitlementPlanFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanFeatureHistoriesDocument = `query GetEntitlementPlanFeatureHistories ($where: EntitlementPlanFeatureHistoryWhereInput) { + entitlementPlanFeatureHistories(where: $where) { + edges { + node { + createdAt + createdBy + featureID + historyTime + id + metadata + operation + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntitlementPlanFeatureHistories(ctx context.Context, where *EntitlementPlanFeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlanFeatureHistories + if err := c.Client.Post(ctx, "GetEntitlementPlanFeatureHistories", GetEntitlementPlanFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlanHistoriesDocument = `query GetAllEntitlementPlanHistories { + entitlementPlanHistories { + edges { + node { + createdAt + createdBy + description + displayName + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + version + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlanHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanHistories, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlanHistories + if err := c.Client.Post(ctx, "GetAllEntitlementPlanHistories", GetAllEntitlementPlanHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanHistoriesDocument = `query GetEntitlementPlanHistories ($where: EntitlementPlanHistoryWhereInput) { + entitlementPlanHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + version + } + } + } +} +` + +func (c *Client) GetEntitlementPlanHistories(ctx context.Context, where *EntitlementPlanHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlanHistories + if err := c.Client.Post(ctx, "GetEntitlementPlanHistories", GetEntitlementPlanHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntityDocument = `mutation CreateBulkCSVEntity ($input: Upload!) { + createBulkCSVEntity(input: $input) { + entities { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkCSVEntity(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntity, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntity + if err := c.Client.Post(ctx, "CreateBulkCSVEntity", CreateBulkCSVEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntityDocument = `mutation CreateBulkEntity ($input: [CreateEntityInput!]) { + createBulkEntity(input: $input) { + entities { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkEntity(ctx context.Context, input []*CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntity, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntity + if err := c.Client.Post(ctx, "CreateBulkEntity", CreateBulkEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntityDocument = `mutation CreateEntity ($input: CreateEntityInput!) { + createEntity(input: $input) { + entity { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateEntity(ctx context.Context, input CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntity, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntity + if err := c.Client.Post(ctx, "CreateEntity", CreateEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntityDocument = `mutation DeleteEntity ($deleteEntityId: ID!) { + deleteEntity(id: $deleteEntityId) { + deletedID + } +} +` + +func (c *Client) DeleteEntity(ctx context.Context, deleteEntityID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntity, error) { + vars := map[string]any{ + "deleteEntityId": deleteEntityID, + } + + var res DeleteEntity + if err := c.Client.Post(ctx, "DeleteEntity", DeleteEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitiesDocument = `query GetAllEntities { + entities { + edges { + node { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntities(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntities, error) { + vars := map[string]any{} + + var res GetAllEntities + if err := c.Client.Post(ctx, "GetAllEntities", GetAllEntitiesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitiesDocument = `query GetEntities ($where: EntityWhereInput) { + entities(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntities(ctx context.Context, where *EntityWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntities, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntities + if err := c.Client.Post(ctx, "GetEntities", GetEntitiesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityByIDDocument = `query GetEntityByID ($entityId: ID!) { + entity(id: $entityId) { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + contacts { + id + fullName + email + title + company + address + phoneNumber + } + tags + updatedAt + updatedBy + } +} +` + +func (c *Client) GetEntityByID(ctx context.Context, entityID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityByID, error) { + vars := map[string]any{ + "entityId": entityID, + } + + var res GetEntityByID + if err := c.Client.Post(ctx, "GetEntityByID", GetEntityByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntityDocument = `mutation UpdateEntity ($updateEntityId: ID!, $input: UpdateEntityInput!) { + updateEntity(id: $updateEntityId, input: $input) { + entity { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateEntity(ctx context.Context, updateEntityID string, input UpdateEntityInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntity, error) { + vars := map[string]any{ + "updateEntityId": updateEntityID, + "input": input, + } + + var res UpdateEntity + if err := c.Client.Post(ctx, "UpdateEntity", UpdateEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntityHistoriesDocument = `query GetAllEntityHistories { + entityHistories { + edges { + node { + createdAt + createdBy + description + displayName + domains + entityTypeID + historyTime + id + name + operation + ownerID + ref + status + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntityHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityHistories, error) { + vars := map[string]any{} + + var res GetAllEntityHistories + if err := c.Client.Post(ctx, "GetAllEntityHistories", GetAllEntityHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityHistoriesDocument = `query GetEntityHistories ($where: EntityHistoryWhereInput) { + entityHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + domains + entityTypeID + historyTime + id + name + operation + ownerID + ref + status + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntityHistories(ctx context.Context, where *EntityHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntityHistories + if err := c.Client.Post(ctx, "GetEntityHistories", GetEntityHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntityTypeDocument = `mutation CreateBulkCSVEntityType ($input: Upload!) { + createBulkCSVEntityType(input: $input) { + entityTypes { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkCSVEntityType(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntityType, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntityType + if err := c.Client.Post(ctx, "CreateBulkCSVEntityType", CreateBulkCSVEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntityTypeDocument = `mutation CreateBulkEntityType ($input: [CreateEntityTypeInput!]) { + createBulkEntityType(input: $input) { + entityTypes { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkEntityType(ctx context.Context, input []*CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntityType, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntityType + if err := c.Client.Post(ctx, "CreateBulkEntityType", CreateBulkEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntityTypeDocument = `mutation CreateEntityType ($input: CreateEntityTypeInput!) { + createEntityType(input: $input) { + entityType { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateEntityType(ctx context.Context, input CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntityType, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntityType + if err := c.Client.Post(ctx, "CreateEntityType", CreateEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntityTypeDocument = `mutation DeleteEntityType ($deleteEntityTypeId: ID!) { + deleteEntityType(id: $deleteEntityTypeId) { + deletedID + } +} +` + +func (c *Client) DeleteEntityType(ctx context.Context, deleteEntityTypeID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntityType, error) { + vars := map[string]any{ + "deleteEntityTypeId": deleteEntityTypeID, + } + + var res DeleteEntityType + if err := c.Client.Post(ctx, "DeleteEntityType", DeleteEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntityTypesDocument = `query GetAllEntityTypes { + entityTypes { + edges { + node { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntityTypes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypes, error) { + vars := map[string]any{} + + var res GetAllEntityTypes + if err := c.Client.Post(ctx, "GetAllEntityTypes", GetAllEntityTypesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityTypeByIDDocument = `query GetEntityTypeByID ($entityTypeId: ID!) { + entityType(id: $entityTypeId) { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } +} +` + +func (c *Client) GetEntityTypeByID(ctx context.Context, entityTypeID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeByID, error) { + vars := map[string]any{ + "entityTypeId": entityTypeID, + } + + var res GetEntityTypeByID + if err := c.Client.Post(ctx, "GetEntityTypeByID", GetEntityTypeByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityTypesDocument = `query GetEntityTypes ($where: EntityTypeWhereInput) { + entityTypes(where: $where) { + edges { + node { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntityTypes(ctx context.Context, where *EntityTypeWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypes, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntityTypes + if err := c.Client.Post(ctx, "GetEntityTypes", GetEntityTypesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntityTypeDocument = `mutation UpdateEntityType ($updateEntityTypeId: ID!, $input: UpdateEntityTypeInput!) { + updateEntityType(id: $updateEntityTypeId, input: $input) { + entityType { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateEntityType(ctx context.Context, updateEntityTypeID string, input UpdateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntityType, error) { + vars := map[string]any{ + "updateEntityTypeId": updateEntityTypeID, + "input": input, + } + + var res UpdateEntityType + if err := c.Client.Post(ctx, "UpdateEntityType", UpdateEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntityTypeHistoriesDocument = `query GetAllEntityTypeHistories { + entityTypeHistories { + edges { + node { + createdAt + createdBy + historyTime + id + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntityTypeHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypeHistories, error) { + vars := map[string]any{} + + var res GetAllEntityTypeHistories + if err := c.Client.Post(ctx, "GetAllEntityTypeHistories", GetAllEntityTypeHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityTypeHistoriesDocument = `query GetEntityTypeHistories ($where: EntityTypeHistoryWhereInput) { + entityTypeHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntityTypeHistories(ctx context.Context, where *EntityTypeHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntityTypeHistories + if err := c.Client.Post(ctx, "GetEntityTypeHistories", GetEntityTypeHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEventsDocument = `query GetEvents ($where: EventWhereInput) { + events(where: $where) { + edges { + node { + eventID + id + correlationID + eventType + metadata + } + } + } +} +` + +func (c *Client) GetEvents(ctx context.Context, where *EventWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEvents, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEvents + if err := c.Client.Post(ctx, "GetEvents", GetEventsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEventByIDDocument = `query GetEventByID ($eventId: ID!) { + event(id: $eventId) { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } +} +` + +func (c *Client) GetEventByID(ctx context.Context, eventID string, interceptors ...clientv2.RequestInterceptor) (*GetEventByID, error) { + vars := map[string]any{ + "eventId": eventID, + } + + var res GetEventByID + if err := c.Client.Post(ctx, "GetEventByID", GetEventByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEventsDocument = `query GetAllEvents { + events { + edges { + node { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } + } +} +` + +func (c *Client) GetAllEvents(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEvents, error) { + vars := map[string]any{} + + var res GetAllEvents + if err := c.Client.Post(ctx, "GetAllEvents", GetAllEventsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEventDocument = `mutation CreateEvent ($input: CreateEventInput!) { + createEvent(input: $input) { + event { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) CreateEvent(ctx context.Context, input CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateEvent, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEvent + if err := c.Client.Post(ctx, "CreateEvent", CreateEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEventDocument = `mutation CreateBulkEvent ($input: [CreateEventInput!]) { + createBulkEvent(input: $input) { + events { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) CreateBulkEvent(ctx context.Context, input []*CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEvent, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEvent + if err := c.Client.Post(ctx, "CreateBulkEvent", CreateBulkEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEventDocument = `mutation CreateBulkCSVEvent ($input: Upload!) { + createBulkCSVEvent(input: $input) { + events { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVEvent(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEvent, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEvent + if err := c.Client.Post(ctx, "CreateBulkCSVEvent", CreateBulkCSVEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEventDocument = `mutation UpdateEvent ($updateEventId: ID!, $input: UpdateEventInput!) { + updateEvent(id: $updateEventId, input: $input) { + event { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) UpdateEvent(ctx context.Context, updateEventID string, input UpdateEventInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEvent, error) { + vars := map[string]any{ + "updateEventId": updateEventID, + "input": input, + } + + var res UpdateEvent + if err := c.Client.Post(ctx, "UpdateEvent", UpdateEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEventDocument = `mutation DeleteEvent ($deleteEventId: ID!) { + deleteEvent(id: $deleteEventId) { + deletedID + } +} +` + +func (c *Client) DeleteEvent(ctx context.Context, deleteEventID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEvent, error) { + vars := map[string]any{ + "deleteEventId": deleteEventID, + } + + var res DeleteEvent + if err := c.Client.Post(ctx, "DeleteEvent", DeleteEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEventHistoriesDocument = `query GetAllEventHistories { + eventHistories { + edges { + node { + correlationID + createdAt + createdBy + eventID + eventType + historyTime + id + metadata + operation + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEventHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEventHistories, error) { + vars := map[string]any{} + + var res GetAllEventHistories + if err := c.Client.Post(ctx, "GetAllEventHistories", GetAllEventHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEventHistoriesDocument = `query GetEventHistories ($where: EventHistoryWhereInput) { + eventHistories(where: $where) { + edges { + node { + correlationID + createdAt + createdBy + eventID + eventType + historyTime + id + metadata + operation + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEventHistories(ctx context.Context, where *EventHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEventHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEventHistories + if err := c.Client.Post(ctx, "GetEventHistories", GetEventHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVFeatureDocument = `mutation CreateBulkCSVFeature ($input: Upload!) { + createBulkCSVFeature(input: $input) { + features { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) CreateBulkCSVFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVFeature + if err := c.Client.Post(ctx, "CreateBulkCSVFeature", CreateBulkCSVFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkFeatureDocument = `mutation CreateBulkFeature ($input: [CreateFeatureInput!]) { + createBulkFeature(input: $input) { + features { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) CreateBulkFeature(ctx context.Context, input []*CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkFeature + if err := c.Client.Post(ctx, "CreateBulkFeature", CreateBulkFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateFeatureDocument = `mutation CreateFeature ($input: CreateFeatureInput!) { + createFeature(input: $input) { + feature { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) CreateFeature(ctx context.Context, input CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateFeature + if err := c.Client.Post(ctx, "CreateFeature", CreateFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteFeatureDocument = `mutation DeleteFeature ($deleteFeatureId: ID!) { + deleteFeature(id: $deleteFeatureId) { + deletedID + } +} +` + +func (c *Client) DeleteFeature(ctx context.Context, deleteFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFeature, error) { + vars := map[string]any{ + "deleteFeatureId": deleteFeatureID, + } + + var res DeleteFeature + if err := c.Client.Post(ctx, "DeleteFeature", DeleteFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFeaturesDocument = `query GetAllFeatures { + features { + edges { + node { + description + enabled + id + name + displayName + tags + } + } + } +} +` + +func (c *Client) GetAllFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatures, error) { + vars := map[string]any{} + + var res GetAllFeatures + if err := c.Client.Post(ctx, "GetAllFeatures", GetAllFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFeatureByIDDocument = `query GetFeatureByID ($featureId: ID!) { + feature(id: $featureId) { + description + enabled + id + name + displayName + tags + } +} +` + +func (c *Client) GetFeatureByID(ctx context.Context, featureID string, interceptors ...clientv2.RequestInterceptor) (*GetFeatureByID, error) { + vars := map[string]any{ + "featureId": featureID, + } + + var res GetFeatureByID + if err := c.Client.Post(ctx, "GetFeatureByID", GetFeatureByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFeaturesDocument = `query GetFeatures ($where: FeatureWhereInput) { + features(where: $where) { + edges { + node { + description + enabled + id + name + displayName + tags + } + } + } +} +` + +func (c *Client) GetFeatures(ctx context.Context, where *FeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatures, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFeatures + if err := c.Client.Post(ctx, "GetFeatures", GetFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateFeatureDocument = `mutation UpdateFeature ($updateFeatureId: ID!, $input: UpdateFeatureInput!) { + updateFeature(id: $updateFeatureId, input: $input) { + feature { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) UpdateFeature(ctx context.Context, updateFeatureID string, input UpdateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFeature, error) { + vars := map[string]any{ + "updateFeatureId": updateFeatureID, + "input": input, + } + + var res UpdateFeature + if err := c.Client.Post(ctx, "UpdateFeature", UpdateFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFeatureHistoriesDocument = `query GetAllFeatureHistories { + featureHistories { + edges { + node { + createdAt + createdBy + description + displayName + enabled + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatureHistories, error) { + vars := map[string]any{} + + var res GetAllFeatureHistories + if err := c.Client.Post(ctx, "GetAllFeatureHistories", GetAllFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFeatureHistoriesDocument = `query GetFeatureHistories ($where: FeatureHistoryWhereInput) { + featureHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + enabled + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetFeatureHistories(ctx context.Context, where *FeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatureHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFeatureHistories + if err := c.Client.Post(ctx, "GetFeatureHistories", GetFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVFileDocument = `mutation CreateBulkCSVFile ($input: Upload!) { + createBulkCSVFile(input: $input) { + files { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVFile(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFile, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVFile + if err := c.Client.Post(ctx, "CreateBulkCSVFile", CreateBulkCSVFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkFileDocument = `mutation CreateBulkFile ($input: [CreateFileInput!]) { + createBulkFile(input: $input) { + files { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) CreateBulkFile(ctx context.Context, input []*CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFile, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkFile + if err := c.Client.Post(ctx, "CreateBulkFile", CreateBulkFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateFileDocument = `mutation CreateFile ($input: CreateFileInput!) { + createFile(input: $input) { + file { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) CreateFile(ctx context.Context, input CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateFile, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateFile + if err := c.Client.Post(ctx, "CreateFile", CreateFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteFileDocument = `mutation DeleteFile ($deleteFileId: ID!) { + deleteFile(id: $deleteFileId) { + deletedID + } +} +` + +func (c *Client) DeleteFile(ctx context.Context, deleteFileID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFile, error) { + vars := map[string]any{ + "deleteFileId": deleteFileID, + } + + var res DeleteFile + if err := c.Client.Post(ctx, "DeleteFile", DeleteFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFilesDocument = `query GetAllFiles { + files { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + id + storeKey + updatedAt + updatedBy + user { + id + } + organization { + id + } + group { + id + } + } + } + } +} +` + +func (c *Client) GetAllFiles(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFiles, error) { + vars := map[string]any{} + + var res GetAllFiles + if err := c.Client.Post(ctx, "GetAllFiles", GetAllFilesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFilesDocument = `query GetFiles ($where: FileWhereInput) { + files(where: $where) { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + id + storeKey + updatedAt + updatedBy + user { + id + } + organization { + id + } + group { + id + } + } + } + } +} +` + +func (c *Client) GetFiles(ctx context.Context, where *FileWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFiles, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFiles + if err := c.Client.Post(ctx, "GetFiles", GetFilesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateFileDocument = `mutation UpdateFile ($updateFileId: ID!, $input: UpdateFileInput!) { + updateFile(id: $updateFileId, input: $input) { + file { + id + fileName + fileExtension + fileSize + contentType + storeKey + category + annotation + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) UpdateFile(ctx context.Context, updateFileID string, input UpdateFileInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFile, error) { + vars := map[string]any{ + "updateFileId": updateFileID, + "input": input, + } + + var res UpdateFile + if err := c.Client.Post(ctx, "UpdateFile", UpdateFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFileHistoriesDocument = `query GetAllFileHistories { + fileHistories { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + historyTime + id + operation + ref + storeKey + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllFileHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFileHistories, error) { + vars := map[string]any{} + + var res GetAllFileHistories + if err := c.Client.Post(ctx, "GetAllFileHistories", GetAllFileHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFileHistoriesDocument = `query GetFileHistories ($where: FileHistoryWhereInput) { + fileHistories(where: $where) { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + historyTime + id + operation + ref + storeKey + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetFileHistories(ctx context.Context, where *FileHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFileHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFileHistories + if err := c.Client.Post(ctx, "GetFileHistories", GetFileHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVGroupDocument = `mutation CreateBulkCSVGroup ($input: Upload!) { + createBulkCSVGroup(input: $input) { + groups { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) CreateBulkCSVGroup(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroup, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVGroup + if err := c.Client.Post(ctx, "CreateBulkCSVGroup", CreateBulkCSVGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkGroupDocument = `mutation CreateBulkGroup ($input: [CreateGroupInput!]) { + createBulkGroup(input: $input) { + groups { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) CreateBulkGroup(ctx context.Context, input []*CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroup, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkGroup + if err := c.Client.Post(ctx, "CreateBulkGroup", CreateBulkGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateGroupDocument = `mutation CreateGroup ($input: CreateGroupInput!) { + createGroup(input: $input) { + group { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) CreateGroup(ctx context.Context, input CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateGroup, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateGroup + if err := c.Client.Post(ctx, "CreateGroup", CreateGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteGroupDocument = `mutation DeleteGroup ($deleteGroupId: ID!) { + deleteGroup(id: $deleteGroupId) { + deletedID + } +} +` + +func (c *Client) DeleteGroup(ctx context.Context, deleteGroupID string, interceptors ...clientv2.RequestInterceptor) (*DeleteGroup, error) { + vars := map[string]any{ + "deleteGroupId": deleteGroupID, + } + + var res DeleteGroup + if err := c.Client.Post(ctx, "DeleteGroup", DeleteGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupsDocument = `query GetAllGroups { + groups { + edges { + node { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllGroups(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroups, error) { + vars := map[string]any{} + + var res GetAllGroups + if err := c.Client.Post(ctx, "GetAllGroups", GetAllGroupsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupByIDDocument = `query GetGroupByID ($groupId: ID!) { + group(id: $groupId) { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetGroupByID(ctx context.Context, groupID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupByID, error) { + vars := map[string]any{ + "groupId": groupID, + } + + var res GetGroupByID + if err := c.Client.Post(ctx, "GetGroupByID", GetGroupByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupsDocument = `query GetGroups ($where: GroupWhereInput) { + groups(where: $where) { + edges { + node { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetGroups(ctx context.Context, where *GroupWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroups, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroups + if err := c.Client.Post(ctx, "GetGroups", GetGroupsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateGroupDocument = `mutation UpdateGroup ($updateGroupId: ID!, $input: UpdateGroupInput!) { + updateGroup(id: $updateGroupId, input: $input) { + group { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) UpdateGroup(ctx context.Context, updateGroupID string, input UpdateGroupInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroup, error) { + vars := map[string]any{ + "updateGroupId": updateGroupID, + "input": input, + } + + var res UpdateGroup + if err := c.Client.Post(ctx, "UpdateGroup", UpdateGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupHistoriesDocument = `query GetAllGroupHistories { + groupHistories { + edges { + node { + createdAt + createdBy + description + displayName + gravatarLogoURL + historyTime + id + logoURL + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllGroupHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupHistories, error) { + vars := map[string]any{} + + var res GetAllGroupHistories + if err := c.Client.Post(ctx, "GetAllGroupHistories", GetAllGroupHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupHistoriesDocument = `query GetGroupHistories ($where: GroupHistoryWhereInput) { + groupHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + gravatarLogoURL + historyTime + id + logoURL + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetGroupHistories(ctx context.Context, where *GroupHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupHistories + if err := c.Client.Post(ctx, "GetGroupHistories", GetGroupHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const AddUserToGroupWithRoleDocument = `mutation AddUserToGroupWithRole ($input: CreateGroupMembershipInput!) { + createGroupMembership(input: $input) { + groupMembership { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) AddUserToGroupWithRole(ctx context.Context, input CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToGroupWithRole, error) { + vars := map[string]any{ + "input": input, + } + + var res AddUserToGroupWithRole + if err := c.Client.Post(ctx, "AddUserToGroupWithRole", AddUserToGroupWithRoleDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVGroupMembersDocument = `mutation CreateBulkCSVGroupMembers ($input: Upload!) { + createBulkCSVGroupMembership(input: $input) { + groupMemberships { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) CreateBulkCSVGroupMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroupMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVGroupMembers + if err := c.Client.Post(ctx, "CreateBulkCSVGroupMembers", CreateBulkCSVGroupMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkGroupMembersDocument = `mutation CreateBulkGroupMembers ($input: [CreateGroupMembershipInput!]) { + createBulkGroupMembership(input: $input) { + groupMemberships { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) CreateBulkGroupMembers(ctx context.Context, input []*CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroupMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkGroupMembers + if err := c.Client.Post(ctx, "CreateBulkGroupMembers", CreateBulkGroupMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupMembersByGroupIDDocument = `query GetGroupMembersByGroupID ($where: GroupMembershipWhereInput) { + groupMemberships(where: $where) { + edges { + node { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } + } +} +` + +func (c *Client) GetGroupMembersByGroupID(ctx context.Context, where *GroupMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembersByGroupID, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupMembersByGroupID + if err := c.Client.Post(ctx, "GetGroupMembersByGroupID", GetGroupMembersByGroupIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const RemoveUserFromGroupDocument = `mutation RemoveUserFromGroup ($deleteGroupMembershipId: ID!) { + deleteGroupMembership(id: $deleteGroupMembershipId) { + deletedID + } +} +` + +func (c *Client) RemoveUserFromGroup(ctx context.Context, deleteGroupMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromGroup, error) { + vars := map[string]any{ + "deleteGroupMembershipId": deleteGroupMembershipID, + } + + var res RemoveUserFromGroup + if err := c.Client.Post(ctx, "RemoveUserFromGroup", RemoveUserFromGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserRoleInGroupDocument = `mutation UpdateUserRoleInGroup ($updateGroupMemberId: ID!, $input: UpdateGroupMembershipInput!) { + updateGroupMembership(id: $updateGroupMemberId, input: $input) { + groupMembership { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) UpdateUserRoleInGroup(ctx context.Context, updateGroupMemberID string, input UpdateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInGroup, error) { + vars := map[string]any{ + "updateGroupMemberId": updateGroupMemberID, + "input": input, + } + + var res UpdateUserRoleInGroup + if err := c.Client.Post(ctx, "UpdateUserRoleInGroup", UpdateUserRoleInGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupMembershipHistoriesDocument = `query GetAllGroupMembershipHistories { + groupMembershipHistories { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + operation + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetAllGroupMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupMembershipHistories, error) { + vars := map[string]any{} + + var res GetAllGroupMembershipHistories + if err := c.Client.Post(ctx, "GetAllGroupMembershipHistories", GetAllGroupMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupMembershipHistoriesDocument = `query GetGroupMembershipHistories ($where: GroupMembershipHistoryWhereInput) { + groupMembershipHistories(where: $where) { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + operation + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetGroupMembershipHistories(ctx context.Context, where *GroupMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembershipHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupMembershipHistories + if err := c.Client.Post(ctx, "GetGroupMembershipHistories", GetGroupMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupSettingsDocument = `query GetAllGroupSettings { + groupSettings { + edges { + node { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllGroupSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettings, error) { + vars := map[string]any{} + + var res GetAllGroupSettings + if err := c.Client.Post(ctx, "GetAllGroupSettings", GetAllGroupSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupSettingByIDDocument = `query GetGroupSettingByID ($groupSettingId: ID!) { + groupSetting(id: $groupSettingId) { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetGroupSettingByID(ctx context.Context, groupSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingByID, error) { + vars := map[string]any{ + "groupSettingId": groupSettingID, + } + + var res GetGroupSettingByID + if err := c.Client.Post(ctx, "GetGroupSettingByID", GetGroupSettingByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupSettingsDocument = `query GetGroupSettings ($where: GroupSettingWhereInput!) { + groupSettings(where: $where) { + edges { + node { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetGroupSettings(ctx context.Context, where GroupSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettings, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupSettings + if err := c.Client.Post(ctx, "GetGroupSettings", GetGroupSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateGroupSettingDocument = `mutation UpdateGroupSetting ($updateGroupSettingId: ID!, $input: UpdateGroupSettingInput!) { + updateGroupSetting(id: $updateGroupSettingId, input: $input) { + groupSetting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateGroupSetting(ctx context.Context, updateGroupSettingID string, input UpdateGroupSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroupSetting, error) { + vars := map[string]any{ + "updateGroupSettingId": updateGroupSettingID, + "input": input, + } + + var res UpdateGroupSetting + if err := c.Client.Post(ctx, "UpdateGroupSetting", UpdateGroupSettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupSettingHistoriesDocument = `query GetAllGroupSettingHistories { + groupSettingHistories { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + joinPolicy + operation + ref + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + } + } +} +` + +func (c *Client) GetAllGroupSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettingHistories, error) { + vars := map[string]any{} + + var res GetAllGroupSettingHistories + if err := c.Client.Post(ctx, "GetAllGroupSettingHistories", GetAllGroupSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupSettingHistoriesDocument = `query GetGroupSettingHistories ($where: GroupSettingHistoryWhereInput) { + groupSettingHistories(where: $where) { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + joinPolicy + operation + ref + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + } + } +} +` + +func (c *Client) GetGroupSettingHistories(ctx context.Context, where *GroupSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupSettingHistories + if err := c.Client.Post(ctx, "GetGroupSettingHistories", GetGroupSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVHushDocument = `mutation CreateBulkCSVHush ($input: Upload!) { + createBulkCSVHush(input: $input) { + hushes { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVHush(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVHush, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVHush + if err := c.Client.Post(ctx, "CreateBulkCSVHush", CreateBulkCSVHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkHushDocument = `mutation CreateBulkHush ($input: [CreateHushInput!]) { + createBulkHush(input: $input) { + hushes { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkHush(ctx context.Context, input []*CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkHush, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkHush + if err := c.Client.Post(ctx, "CreateBulkHush", CreateBulkHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateHushDocument = `mutation CreateHush ($input: CreateHushInput!) { + createHush(input: $input) { + hush { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateHush(ctx context.Context, input CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateHush, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateHush + if err := c.Client.Post(ctx, "CreateHush", CreateHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllHushesDocument = `query GetAllHushes { + hushes { + edges { + node { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } + } + } +} +` + +func (c *Client) GetAllHushes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushes, error) { + vars := map[string]any{} + + var res GetAllHushes + if err := c.Client.Post(ctx, "GetAllHushes", GetAllHushesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetHushByIDDocument = `query GetHushByID ($hushId: ID!) { + hush(id: $hushId) { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } +} +` + +func (c *Client) GetHushByID(ctx context.Context, hushID string, interceptors ...clientv2.RequestInterceptor) (*GetHushByID, error) { + vars := map[string]any{ + "hushId": hushID, + } + + var res GetHushByID + if err := c.Client.Post(ctx, "GetHushByID", GetHushByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetHushesDocument = `query GetHushes ($where: HushWhereInput) { + hushes(where: $where) { + edges { + node { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } + } + } +} +` + +func (c *Client) GetHushes(ctx context.Context, where *HushWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushes, error) { + vars := map[string]any{ + "where": where, + } + + var res GetHushes + if err := c.Client.Post(ctx, "GetHushes", GetHushesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateHushDocument = `mutation UpdateHush ($updateHushId: ID!, $input: UpdateHushInput!) { + updateHush(id: $updateHushId, input: $input) { + hush { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) UpdateHush(ctx context.Context, updateHushID string, input UpdateHushInput, interceptors ...clientv2.RequestInterceptor) (*UpdateHush, error) { + vars := map[string]any{ + "updateHushId": updateHushID, + "input": input, + } + + var res UpdateHush + if err := c.Client.Post(ctx, "UpdateHush", UpdateHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllHushHistoriesDocument = `query GetAllHushHistories { + hushHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ref + secretName + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllHushHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushHistories, error) { + vars := map[string]any{} + + var res GetAllHushHistories + if err := c.Client.Post(ctx, "GetAllHushHistories", GetAllHushHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetHushHistoriesDocument = `query GetHushHistories ($where: HushHistoryWhereInput) { + hushHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ref + secretName + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetHushHistories(ctx context.Context, where *HushHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetHushHistories + if err := c.Client.Post(ctx, "GetHushHistories", GetHushHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVIntegrationDocument = `mutation CreateBulkCSVIntegration ($input: Upload!) { + createBulkCSVIntegration(input: $input) { + integrations { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) CreateBulkCSVIntegration(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVIntegration, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVIntegration + if err := c.Client.Post(ctx, "CreateBulkCSVIntegration", CreateBulkCSVIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkIntegrationDocument = `mutation CreateBulkIntegration ($input: [CreateIntegrationInput!]) { + createBulkIntegration(input: $input) { + integrations { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) CreateBulkIntegration(ctx context.Context, input []*CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkIntegration, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkIntegration + if err := c.Client.Post(ctx, "CreateBulkIntegration", CreateBulkIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateIntegrationDocument = `mutation CreateIntegration ($input: CreateIntegrationInput!) { + createIntegration(input: $input) { + integration { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) CreateIntegration(ctx context.Context, input CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateIntegration, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateIntegration + if err := c.Client.Post(ctx, "CreateIntegration", CreateIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteIntegrationDocument = `mutation DeleteIntegration ($deleteIntegrationId: ID!) { + deleteIntegration(id: $deleteIntegrationId) { + deletedID + } +} +` + +func (c *Client) DeleteIntegration(ctx context.Context, deleteIntegrationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteIntegration, error) { + vars := map[string]any{ + "deleteIntegrationId": deleteIntegrationID, + } + + var res DeleteIntegration + if err := c.Client.Post(ctx, "DeleteIntegration", DeleteIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllIntegrationsDocument = `query GetAllIntegrations { + integrations { + edges { + node { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllIntegrations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrations, error) { + vars := map[string]any{} + + var res GetAllIntegrations + if err := c.Client.Post(ctx, "GetAllIntegrations", GetAllIntegrationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetIntegrationByIDDocument = `query GetIntegrationByID ($integrationId: ID!) { + integration(id: $integrationId) { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetIntegrationByID(ctx context.Context, integrationID string, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationByID, error) { + vars := map[string]any{ + "integrationId": integrationID, + } + + var res GetIntegrationByID + if err := c.Client.Post(ctx, "GetIntegrationByID", GetIntegrationByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetIntegrationsDocument = `query GetIntegrations ($where: IntegrationWhereInput) { + integrations(where: $where) { + edges { + node { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetIntegrations(ctx context.Context, where *IntegrationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrations, error) { + vars := map[string]any{ + "where": where, + } + + var res GetIntegrations + if err := c.Client.Post(ctx, "GetIntegrations", GetIntegrationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateIntegrationDocument = `mutation UpdateIntegration ($updateIntegrationId: ID!, $input: UpdateIntegrationInput!) { + updateIntegration(id: $updateIntegrationId, input: $input) { + integration { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) UpdateIntegration(ctx context.Context, updateIntegrationID string, input UpdateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateIntegration, error) { + vars := map[string]any{ + "updateIntegrationId": updateIntegrationID, + "input": input, + } + + var res UpdateIntegration + if err := c.Client.Post(ctx, "UpdateIntegration", UpdateIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllIntegrationHistoriesDocument = `query GetAllIntegrationHistories { + integrationHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllIntegrationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrationHistories, error) { + vars := map[string]any{} + + var res GetAllIntegrationHistories + if err := c.Client.Post(ctx, "GetAllIntegrationHistories", GetAllIntegrationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetIntegrationHistoriesDocument = `query GetIntegrationHistories ($where: IntegrationHistoryWhereInput) { + integrationHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetIntegrationHistories(ctx context.Context, where *IntegrationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetIntegrationHistories + if err := c.Client.Post(ctx, "GetIntegrationHistories", GetIntegrationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVInviteDocument = `mutation CreateBulkCSVInvite ($input: Upload!) { + createBulkCSVInvite(input: $input) { + invites { + expires + id + recipient + requestorID + role + sendAttempts + status + } + } +} +` + +func (c *Client) CreateBulkCSVInvite(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVInvite, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVInvite + if err := c.Client.Post(ctx, "CreateBulkCSVInvite", CreateBulkCSVInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkInviteDocument = `mutation CreateBulkInvite ($input: [CreateInviteInput!]) { + createBulkInvite(input: $input) { + invites { + expires + id + recipient + requestorID + role + sendAttempts + status + } + } +} +` + +func (c *Client) CreateBulkInvite(ctx context.Context, input []*CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkInvite, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkInvite + if err := c.Client.Post(ctx, "CreateBulkInvite", CreateBulkInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateInviteDocument = `mutation CreateInvite ($input: CreateInviteInput!) { + createInvite(input: $input) { + invite { + expires + id + recipient + requestorID + role + sendAttempts + status + owner { + id + } + } + } +} +` + +func (c *Client) CreateInvite(ctx context.Context, input CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateInvite, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateInvite + if err := c.Client.Post(ctx, "CreateInvite", CreateInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteInviteDocument = `mutation DeleteInvite ($deleteInviteId: ID!) { + deleteInvite(id: $deleteInviteId) { + deletedID + } +} +` + +func (c *Client) DeleteInvite(ctx context.Context, deleteInviteID string, interceptors ...clientv2.RequestInterceptor) (*DeleteInvite, error) { + vars := map[string]any{ + "deleteInviteId": deleteInviteID, + } + + var res DeleteInvite + if err := c.Client.Post(ctx, "DeleteInvite", DeleteInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetInviteByIDDocument = `query GetInviteByID ($inviteId: ID!) { + invite(id: $inviteId) { + expires + id + recipient + requestorID + role + sendAttempts + status + owner { + displayName + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetInviteByID(ctx context.Context, inviteID string, interceptors ...clientv2.RequestInterceptor) (*GetInviteByID, error) { + vars := map[string]any{ + "inviteId": inviteID, + } + + var res GetInviteByID + if err := c.Client.Post(ctx, "GetInviteByID", GetInviteByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllInvitesDocument = `query GetAllInvites { + invites { + edges { + node { + id + recipient + role + status + } + } + } +} +` + +func (c *Client) GetAllInvites(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllInvites, error) { + vars := map[string]any{} + + var res GetAllInvites + if err := c.Client.Post(ctx, "GetAllInvites", GetAllInvitesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const InvitesByOrgIDDocument = `query InvitesByOrgID ($where: InviteWhereInput) { + invites(where: $where) { + edges { + node { + owner { + id + invites { + recipient + requestorID + role + sendAttempts + status + } + } + } + } + } +} +` + +func (c *Client) InvitesByOrgID(ctx context.Context, where *InviteWhereInput, interceptors ...clientv2.RequestInterceptor) (*InvitesByOrgID, error) { + vars := map[string]any{ + "where": where, + } + + var res InvitesByOrgID + if err := c.Client.Post(ctx, "InvitesByOrgID", InvitesByOrgIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllNoteHistoriesDocument = `query GetAllNoteHistories { + noteHistories { + edges { + node { + createdAt + createdBy + historyTime + id + operation + ownerID + ref + tags + text + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllNoteHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllNoteHistories, error) { + vars := map[string]any{} + + var res GetAllNoteHistories + if err := c.Client.Post(ctx, "GetAllNoteHistories", GetAllNoteHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetNoteHistoriesDocument = `query GetNoteHistories ($where: NoteHistoryWhereInput) { + noteHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + operation + ownerID + ref + tags + text + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetNoteHistories(ctx context.Context, where *NoteHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetNoteHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetNoteHistories + if err := c.Client.Post(ctx, "GetNoteHistories", GetNoteHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOauthProviderHistoriesDocument = `query GetAllOauthProviderHistories { + oauthProviderHistories { + edges { + node { + authStyle + authURL + clientID + clientSecret + createdAt + createdBy + historyTime + id + infoURL + name + operation + ownerID + redirectURL + ref + scopes + tags + tokenURL + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllOauthProviderHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOauthProviderHistories, error) { + vars := map[string]any{} + + var res GetAllOauthProviderHistories + if err := c.Client.Post(ctx, "GetAllOauthProviderHistories", GetAllOauthProviderHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOauthProviderHistoriesDocument = `query GetOauthProviderHistories ($where: OauthProviderHistoryWhereInput) { + oauthProviderHistories(where: $where) { + edges { + node { + authStyle + authURL + clientID + clientSecret + createdAt + createdBy + historyTime + id + infoURL + name + operation + ownerID + redirectURL + ref + scopes + tags + tokenURL + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetOauthProviderHistories(ctx context.Context, where *OauthProviderHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOauthProviderHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOauthProviderHistories + if err := c.Client.Post(ctx, "GetOauthProviderHistories", GetOauthProviderHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVOhAuthTooTokenDocument = `mutation CreateBulkCSVOhAuthTooToken ($input: Upload!) { + createBulkCSVOhAuthTooToken(input: $input) { + ohAuthTooTokens { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVOhAuthTooToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOhAuthTooToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVOhAuthTooToken + if err := c.Client.Post(ctx, "CreateBulkCSVOhAuthTooToken", CreateBulkCSVOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkOhAuthTooTokenDocument = `mutation CreateBulkOhAuthTooToken ($input: [CreateOhAuthTooTokenInput!]) { + createBulkOhAuthTooToken(input: $input) { + ohAuthTooTokens { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkOhAuthTooToken(ctx context.Context, input []*CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOhAuthTooToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkOhAuthTooToken + if err := c.Client.Post(ctx, "CreateBulkOhAuthTooToken", CreateBulkOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateOhAuthTooTokenDocument = `mutation CreateOhAuthTooToken ($input: CreateOhAuthTooTokenInput!) { + createOhAuthTooToken(input: $input) { + ohAuthTooToken { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateOhAuthTooToken(ctx context.Context, input CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateOhAuthTooToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateOhAuthTooToken + if err := c.Client.Post(ctx, "CreateOhAuthTooToken", CreateOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteOhAuthTooTokenDocument = `mutation DeleteOhAuthTooToken ($deleteOhAuthTooTokenId: ID!) { + deleteOhAuthTooToken(id: $deleteOhAuthTooTokenId) { + deletedID + } +} +` + +func (c *Client) DeleteOhAuthTooToken(ctx context.Context, deleteOhAuthTooTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOhAuthTooToken, error) { + vars := map[string]any{ + "deleteOhAuthTooTokenId": deleteOhAuthTooTokenID, + } + + var res DeleteOhAuthTooToken + if err := c.Client.Post(ctx, "DeleteOhAuthTooToken", DeleteOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOhAuthTooTokensDocument = `query GetOhAuthTooTokens ($where: OhAuthTooTokenWhereInput) { + ohAuthTooTokens(where: $where) { + edges { + node { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } + } +} +` + +func (c *Client) GetOhAuthTooTokens(ctx context.Context, where *OhAuthTooTokenWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOhAuthTooTokens, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOhAuthTooTokens + if err := c.Client.Post(ctx, "GetOhAuthTooTokens", GetOhAuthTooTokensDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateOhAuthTooTokenDocument = `mutation UpdateOhAuthTooToken ($updateOhAuthTooTokenId: ID!, $input: UpdateOhAuthTooTokenInput!) { + updateOhAuthTooToken(id: $updateOhAuthTooTokenId, input: $input) { + ohAuthTooToken { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) UpdateOhAuthTooToken(ctx context.Context, updateOhAuthTooTokenID string, input UpdateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOhAuthTooToken, error) { + vars := map[string]any{ + "updateOhAuthTooTokenId": updateOhAuthTooTokenID, + "input": input, + } + + var res UpdateOhAuthTooToken + if err := c.Client.Post(ctx, "UpdateOhAuthTooToken", UpdateOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVOrganizationDocument = `mutation CreateBulkCSVOrganization ($input: Upload!) { + createBulkCSVOrganization(input: $input) { + organizations { + id + name + displayName + description + personalOrg + tags + } + } +} +` + +func (c *Client) CreateBulkCSVOrganization(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrganization, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVOrganization + if err := c.Client.Post(ctx, "CreateBulkCSVOrganization", CreateBulkCSVOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkOrganizationDocument = `mutation CreateBulkOrganization ($input: [CreateOrganizationInput!]) { + createBulkOrganization(input: $input) { + organizations { + id + name + displayName + description + personalOrg + tags + } + } +} +` + +func (c *Client) CreateBulkOrganization(ctx context.Context, input []*CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrganization, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkOrganization + if err := c.Client.Post(ctx, "CreateBulkOrganization", CreateBulkOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateOrganizationDocument = `mutation CreateOrganization ($input: CreateOrganizationInput!) { + createOrganization(input: $input) { + organization { + id + name + displayName + description + personalOrg + tags + createdAt + updatedAt + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + } + } +} +` + +func (c *Client) CreateOrganization(ctx context.Context, input CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateOrganization, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateOrganization + if err := c.Client.Post(ctx, "CreateOrganization", CreateOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteOrganizationDocument = `mutation DeleteOrganization ($deleteOrganizationId: ID!) { + deleteOrganization(id: $deleteOrganizationId) { + deletedID + } +} +` + +func (c *Client) DeleteOrganization(ctx context.Context, deleteOrganizationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOrganization, error) { + vars := map[string]any{ + "deleteOrganizationId": deleteOrganizationID, + } + + var res DeleteOrganization + if err := c.Client.Post(ctx, "DeleteOrganization", DeleteOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationsDocument = `query GetAllOrganizations { + organizations { + edges { + node { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + updatedAt + } + } + } +} +` + +func (c *Client) GetAllOrganizations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizations, error) { + vars := map[string]any{} + + var res GetAllOrganizations + if err := c.Client.Post(ctx, "GetAllOrganizations", GetAllOrganizationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationByIDDocument = `query GetOrganizationByID ($organizationId: ID!) { + organization(id: $organizationId) { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetOrganizationByID(ctx context.Context, organizationID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationByID, error) { + vars := map[string]any{ + "organizationId": organizationID, + } + + var res GetOrganizationByID + if err := c.Client.Post(ctx, "GetOrganizationByID", GetOrganizationByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationsDocument = `query GetOrganizations ($where: OrganizationWhereInput) { + organizations(where: $where) { + edges { + node { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + updatedAt + } + } + } +} +` + +func (c *Client) GetOrganizations(ctx context.Context, where *OrganizationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizations, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizations + if err := c.Client.Post(ctx, "GetOrganizations", GetOrganizationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateOrganizationDocument = `mutation UpdateOrganization ($updateOrganizationId: ID!, $input: UpdateOrganizationInput!) { + updateOrganization(id: $updateOrganizationId, input: $input) { + organization { + id + name + displayName + description + personalOrg + tags + members { + id + role + userID + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + } + } +} +` + +func (c *Client) UpdateOrganization(ctx context.Context, updateOrganizationID string, input UpdateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganization, error) { + vars := map[string]any{ + "updateOrganizationId": updateOrganizationID, + "input": input, + } + + var res UpdateOrganization + if err := c.Client.Post(ctx, "UpdateOrganization", UpdateOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationHistoriesDocument = `query GetAllOrganizationHistories { + organizationHistories { + edges { + node { + avatarRemoteURL + createdAt + createdBy + dedicatedDb + description + displayName + historyTime + id + name + operation + personalOrg + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllOrganizationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationHistories, error) { + vars := map[string]any{} + + var res GetAllOrganizationHistories + if err := c.Client.Post(ctx, "GetAllOrganizationHistories", GetAllOrganizationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationHistoriesDocument = `query GetOrganizationHistories ($where: OrganizationHistoryWhereInput) { + organizationHistories(where: $where) { + edges { + node { + avatarRemoteURL + createdAt + createdBy + dedicatedDb + description + displayName + historyTime + id + name + operation + personalOrg + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetOrganizationHistories(ctx context.Context, where *OrganizationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizationHistories + if err := c.Client.Post(ctx, "GetOrganizationHistories", GetOrganizationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationSettingsDocument = `query GetAllOrganizationSettings { + organizationSettings { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } + } +} +` + +func (c *Client) GetAllOrganizationSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettings, error) { + vars := map[string]any{} + + var res GetAllOrganizationSettings + if err := c.Client.Post(ctx, "GetAllOrganizationSettings", GetAllOrganizationSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationSettingByIDDocument = `query GetOrganizationSettingByID ($organizationSettingId: ID!) { + organizationSetting(id: $organizationSettingId) { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } +} +` + +func (c *Client) GetOrganizationSettingByID(ctx context.Context, organizationSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingByID, error) { + vars := map[string]any{ + "organizationSettingId": organizationSettingID, + } + + var res GetOrganizationSettingByID + if err := c.Client.Post(ctx, "GetOrganizationSettingByID", GetOrganizationSettingByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationSettingsDocument = `query GetOrganizationSettings ($where: OrganizationSettingWhereInput!) { + organizationSettings(where: $where) { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } + } +} +` + +func (c *Client) GetOrganizationSettings(ctx context.Context, where OrganizationSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettings, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizationSettings + if err := c.Client.Post(ctx, "GetOrganizationSettings", GetOrganizationSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateOrganizationSettingDocument = `mutation UpdateOrganizationSetting ($updateOrganizationSettingId: ID!, $input: UpdateOrganizationSettingInput!) { + updateOrganizationSetting(id: $updateOrganizationSettingId, input: $input) { + organizationSetting { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } +} +` + +func (c *Client) UpdateOrganizationSetting(ctx context.Context, updateOrganizationSettingID string, input UpdateOrganizationSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganizationSetting, error) { + vars := map[string]any{ + "updateOrganizationSettingId": updateOrganizationSettingID, + "input": input, + } + + var res UpdateOrganizationSetting + if err := c.Client.Post(ctx, "UpdateOrganizationSetting", UpdateOrganizationSettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationSettingHistoriesDocument = `query GetAllOrganizationSettingHistories { + organizationSettingHistories { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + historyTime + id + operation + organizationID + ref + tags + taxIdentifier + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllOrganizationSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettingHistories, error) { + vars := map[string]any{} + + var res GetAllOrganizationSettingHistories + if err := c.Client.Post(ctx, "GetAllOrganizationSettingHistories", GetAllOrganizationSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationSettingHistoriesDocument = `query GetOrganizationSettingHistories ($where: OrganizationSettingHistoryWhereInput) { + organizationSettingHistories(where: $where) { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + historyTime + id + operation + organizationID + ref + tags + taxIdentifier + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetOrganizationSettingHistories(ctx context.Context, where *OrganizationSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizationSettingHistories + if err := c.Client.Post(ctx, "GetOrganizationSettingHistories", GetOrganizationSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const AddUserToOrgWithRoleDocument = `mutation AddUserToOrgWithRole ($input: CreateOrgMembershipInput!) { + createOrgMembership(input: $input) { + orgMembership { + id + role + userID + organizationID + } + } +} +` + +func (c *Client) AddUserToOrgWithRole(ctx context.Context, input CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToOrgWithRole, error) { + vars := map[string]any{ + "input": input, + } + + var res AddUserToOrgWithRole + if err := c.Client.Post(ctx, "AddUserToOrgWithRole", AddUserToOrgWithRoleDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVOrgMembersDocument = `mutation CreateBulkCSVOrgMembers ($input: Upload!) { + createBulkCSVOrgMembership(input: $input) { + orgMemberships { + id + organizationID + role + userID + } + } +} +` + +func (c *Client) CreateBulkCSVOrgMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrgMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVOrgMembers + if err := c.Client.Post(ctx, "CreateBulkCSVOrgMembers", CreateBulkCSVOrgMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkOrgMembersDocument = `mutation CreateBulkOrgMembers ($input: [CreateOrgMembershipInput!]) { + createBulkOrgMembership(input: $input) { + orgMemberships { + id + organizationID + role + userID + } + } +} +` + +func (c *Client) CreateBulkOrgMembers(ctx context.Context, input []*CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrgMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkOrgMembers + if err := c.Client.Post(ctx, "CreateBulkOrgMembers", CreateBulkOrgMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrgMembersByOrgIDDocument = `query GetOrgMembersByOrgID ($where: OrgMembershipWhereInput) { + orgMemberships(where: $where) { + edges { + node { + id + organizationID + userID + role + user { + firstName + lastName + id + displayName + email + } + } + } + } +} +` + +func (c *Client) GetOrgMembersByOrgID(ctx context.Context, where *OrgMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembersByOrgID, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrgMembersByOrgID + if err := c.Client.Post(ctx, "GetOrgMembersByOrgID", GetOrgMembersByOrgIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const RemoveUserFromOrgDocument = `mutation RemoveUserFromOrg ($deleteOrgMembershipId: ID!) { + deleteOrgMembership(id: $deleteOrgMembershipId) { + deletedID + } +} +` + +func (c *Client) RemoveUserFromOrg(ctx context.Context, deleteOrgMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromOrg, error) { + vars := map[string]any{ + "deleteOrgMembershipId": deleteOrgMembershipID, + } + + var res RemoveUserFromOrg + if err := c.Client.Post(ctx, "RemoveUserFromOrg", RemoveUserFromOrgDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserRoleInOrgDocument = `mutation UpdateUserRoleInOrg ($updateOrgMemberId: ID!, $input: UpdateOrgMembershipInput!) { + updateOrgMembership(id: $updateOrgMemberId, input: $input) { + orgMembership { + id + role + userID + organizationID + } + } +} +` + +func (c *Client) UpdateUserRoleInOrg(ctx context.Context, updateOrgMemberID string, input UpdateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInOrg, error) { + vars := map[string]any{ + "updateOrgMemberId": updateOrgMemberID, + "input": input, + } + + var res UpdateUserRoleInOrg + if err := c.Client.Post(ctx, "UpdateUserRoleInOrg", UpdateUserRoleInOrgDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrgMembershipHistoriesDocument = `query GetAllOrgMembershipHistories { + orgMembershipHistories { + edges { + node { + createdAt + createdBy + historyTime + id + operation + organizationID + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetAllOrgMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrgMembershipHistories, error) { + vars := map[string]any{} + + var res GetAllOrgMembershipHistories + if err := c.Client.Post(ctx, "GetAllOrgMembershipHistories", GetAllOrgMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrgMembershipHistoriesDocument = `query GetOrgMembershipHistories ($where: OrgMembershipHistoryWhereInput) { + orgMembershipHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + operation + organizationID + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetOrgMembershipHistories(ctx context.Context, where *OrgMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembershipHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrgMembershipHistories + if err := c.Client.Post(ctx, "GetOrgMembershipHistories", GetOrgMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVPersonalAccessTokenDocument = `mutation CreateBulkCSVPersonalAccessToken ($input: Upload!) { + createBulkCSVPersonalAccessToken(input: $input) { + personalAccessTokens { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVPersonalAccessToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVPersonalAccessToken + if err := c.Client.Post(ctx, "CreateBulkCSVPersonalAccessToken", CreateBulkCSVPersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkPersonalAccessTokenDocument = `mutation CreateBulkPersonalAccessToken ($input: [CreatePersonalAccessTokenInput!]) { + createBulkPersonalAccessToken(input: $input) { + personalAccessTokens { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkPersonalAccessToken(ctx context.Context, input []*CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkPersonalAccessToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkPersonalAccessToken + if err := c.Client.Post(ctx, "CreateBulkPersonalAccessToken", CreateBulkPersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreatePersonalAccessTokenDocument = `mutation CreatePersonalAccessToken ($input: CreatePersonalAccessTokenInput!) { + createPersonalAccessToken(input: $input) { + personalAccessToken { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + owner { + id + } + } + } +} +` + +func (c *Client) CreatePersonalAccessToken(ctx context.Context, input CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreatePersonalAccessToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreatePersonalAccessToken + if err := c.Client.Post(ctx, "CreatePersonalAccessToken", CreatePersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeletePersonalAccessTokenDocument = `mutation DeletePersonalAccessToken ($deletePersonalAccessTokenId: ID!) { + deletePersonalAccessToken(id: $deletePersonalAccessTokenId) { + deletedID + } +} +` + +func (c *Client) DeletePersonalAccessToken(ctx context.Context, deletePersonalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeletePersonalAccessToken, error) { + vars := map[string]any{ + "deletePersonalAccessTokenId": deletePersonalAccessTokenID, + } + + var res DeletePersonalAccessToken + if err := c.Client.Post(ctx, "DeletePersonalAccessToken", DeletePersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllPersonalAccessTokensDocument = `query GetAllPersonalAccessTokens { + personalAccessTokens { + edges { + node { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } + } +} +` + +func (c *Client) GetAllPersonalAccessTokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllPersonalAccessTokens, error) { + vars := map[string]any{} + + var res GetAllPersonalAccessTokens + if err := c.Client.Post(ctx, "GetAllPersonalAccessTokens", GetAllPersonalAccessTokensDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetPersonalAccessTokenByIDDocument = `query GetPersonalAccessTokenByID ($personalAccessTokenId: ID!) { + personalAccessToken(id: $personalAccessTokenId) { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } +} +` + +func (c *Client) GetPersonalAccessTokenByID(ctx context.Context, personalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetPersonalAccessTokenByID, error) { + vars := map[string]any{ + "personalAccessTokenId": personalAccessTokenID, + } + + var res GetPersonalAccessTokenByID + if err := c.Client.Post(ctx, "GetPersonalAccessTokenByID", GetPersonalAccessTokenByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdatePersonalAccessTokenDocument = `mutation UpdatePersonalAccessToken ($updatePersonalAccessTokenId: ID!, $input: UpdatePersonalAccessTokenInput!) { + updatePersonalAccessToken(id: $updatePersonalAccessTokenId, input: $input) { + personalAccessToken { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + owner { + id + } + } + } +} +` + +func (c *Client) UpdatePersonalAccessToken(ctx context.Context, updatePersonalAccessTokenID string, input UpdatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdatePersonalAccessToken, error) { + vars := map[string]any{ + "updatePersonalAccessTokenId": updatePersonalAccessTokenID, + "input": input, + } + + var res UpdatePersonalAccessToken + if err := c.Client.Post(ctx, "UpdatePersonalAccessToken", UpdatePersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const SearchDocument = `query Search ($query: String!) { + search(query: $query) { + nodes { + ... on OrganizationSearchResult { + organizations { + description + displayName + id + name + } + } + ... on GroupSearchResult { + groups { + description + displayName + id + name + } + } + ... on UserSearchResult { + users { + displayName + email + firstName + id + lastName + } + } + ... on SubscriberSearchResult { + subscribers { + active + email + id + } + } + } + } +} +` + +func (c *Client) Search(ctx context.Context, query string, interceptors ...clientv2.RequestInterceptor) (*Search, error) { + vars := map[string]any{ + "query": query, + } + + var res Search + if err := c.Client.Post(ctx, "Search", SearchDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVSubscriberDocument = `mutation CreateBulkCSVSubscriber ($input: Upload!) { + createBulkCSVSubscriber(input: $input) { + subscribers { + active + email + id + verifiedEmail + } + } +} +` + +func (c *Client) CreateBulkCSVSubscriber(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVSubscriber, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVSubscriber + if err := c.Client.Post(ctx, "CreateBulkCSVSubscriber", CreateBulkCSVSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkSubscriberDocument = `mutation CreateBulkSubscriber ($input: [CreateSubscriberInput!]) { + createBulkSubscriber(input: $input) { + subscribers { + active + email + id + verifiedEmail + } + } +} +` + +func (c *Client) CreateBulkSubscriber(ctx context.Context, input []*CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkSubscriber, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkSubscriber + if err := c.Client.Post(ctx, "CreateBulkSubscriber", CreateBulkSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateSubscriberDocument = `mutation CreateSubscriber ($input: CreateSubscriberInput!) { + createSubscriber(input: $input) { + subscriber { + active + createdAt + createdBy + email + id + updatedAt + updatedBy + verifiedEmail + } + } +} +` + +func (c *Client) CreateSubscriber(ctx context.Context, input CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateSubscriber, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateSubscriber + if err := c.Client.Post(ctx, "CreateSubscriber", CreateSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteSubscriberDocument = `mutation DeleteSubscriber ($deleteSubscriberEmail: String!, $subscriberOrganization: ID) { + deleteSubscriber(email: $deleteSubscriberEmail, ownerID: $subscriberOrganization) { + email + } +} +` + +func (c *Client) DeleteSubscriber(ctx context.Context, deleteSubscriberEmail string, subscriberOrganization *string, interceptors ...clientv2.RequestInterceptor) (*DeleteSubscriber, error) { + vars := map[string]any{ + "deleteSubscriberEmail": deleteSubscriberEmail, + "subscriberOrganization": subscriberOrganization, + } + + var res DeleteSubscriber + if err := c.Client.Post(ctx, "DeleteSubscriber", DeleteSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllSubscribersDocument = `query GetAllSubscribers { + subscribers { + edges { + node { + active + email + id + ownerID + verifiedEmail + } + } + } +} +` + +func (c *Client) GetAllSubscribers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllSubscribers, error) { + vars := map[string]any{} + + var res GetAllSubscribers + if err := c.Client.Post(ctx, "GetAllSubscribers", GetAllSubscribersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetSubscriberByEmailDocument = `query GetSubscriberByEmail ($email: String!) { + subscriber(email: $email) { + active + email + id + ownerID + verifiedEmail + } +} +` + +func (c *Client) GetSubscriberByEmail(ctx context.Context, email string, interceptors ...clientv2.RequestInterceptor) (*GetSubscriberByEmail, error) { + vars := map[string]any{ + "email": email, + } + + var res GetSubscriberByEmail + if err := c.Client.Post(ctx, "GetSubscriberByEmail", GetSubscriberByEmailDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetSubscribersDocument = `query GetSubscribers ($where: SubscriberWhereInput) { + subscribers(where: $where) { + edges { + node { + active + email + id + ownerID + verifiedEmail + } + } + } +} +` + +func (c *Client) GetSubscribers(ctx context.Context, where *SubscriberWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetSubscribers, error) { + vars := map[string]any{ + "where": where, + } + + var res GetSubscribers + if err := c.Client.Post(ctx, "GetSubscribers", GetSubscribersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateSubscriberDocument = `mutation UpdateSubscriber ($email: String!, $input: UpdateSubscriberInput!) { + updateSubscriber(email: $email, input: $input) { + subscriber { + active + createdAt + createdBy + email + id + phoneNumber + updatedAt + updatedBy + verifiedEmail + verifiedPhone + } + } +} +` + +func (c *Client) UpdateSubscriber(ctx context.Context, email string, input UpdateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*UpdateSubscriber, error) { + vars := map[string]any{ + "email": email, + "input": input, + } + + var res UpdateSubscriber + if err := c.Client.Post(ctx, "UpdateSubscriber", UpdateSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVTemplateDocument = `mutation CreateBulkCSVTemplate ($input: Upload!) { + createBulkCSVTemplate(input: $input) { + templates { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVTemplate(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVTemplate, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVTemplate + if err := c.Client.Post(ctx, "CreateBulkCSVTemplate", CreateBulkCSVTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkTemplateDocument = `mutation CreateBulkTemplate ($input: [CreateTemplateInput!]) { + createBulkTemplate(input: $input) { + templates { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} +` + +func (c *Client) CreateBulkTemplate(ctx context.Context, input []*CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkTemplate, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkTemplate + if err := c.Client.Post(ctx, "CreateBulkTemplate", CreateBulkTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateTemplateDocument = `mutation CreateTemplate ($input: CreateTemplateInput!) { + createTemplate(input: $input) { + template { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} +` + +func (c *Client) CreateTemplate(ctx context.Context, input CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateTemplate, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateTemplate + if err := c.Client.Post(ctx, "CreateTemplate", CreateTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllTemplatesDocument = `query GetAllTemplates { + templates { + edges { + node { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } + } + } +} +` + +func (c *Client) GetAllTemplates(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplates, error) { + vars := map[string]any{} + + var res GetAllTemplates + if err := c.Client.Post(ctx, "GetAllTemplates", GetAllTemplatesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetTemplateByIDDocument = `query GetTemplateByID ($getTemplateId: ID!) { + template(id: $getTemplateId) { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } +} +` + +func (c *Client) GetTemplateByID(ctx context.Context, getTemplateID string, interceptors ...clientv2.RequestInterceptor) (*GetTemplateByID, error) { + vars := map[string]any{ + "getTemplateId": getTemplateID, + } + + var res GetTemplateByID + if err := c.Client.Post(ctx, "GetTemplateByID", GetTemplateByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateTemplateDocument = `mutation UpdateTemplate ($updateTemplateId: ID!, $input: UpdateTemplateInput!) { + updateTemplate(id: $updateTemplateId, input: $input) { + template { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } + } +} +` + +func (c *Client) UpdateTemplate(ctx context.Context, updateTemplateID string, input UpdateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTemplate, error) { + vars := map[string]any{ + "updateTemplateId": updateTemplateID, + "input": input, + } + + var res UpdateTemplate + if err := c.Client.Post(ctx, "UpdateTemplate", UpdateTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllTemplateHistoriesDocument = `query GetAllTemplateHistories { + templateHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + jsonconfig + name + operation + ownerID + ref + tags + templateType + uischema + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllTemplateHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplateHistories, error) { + vars := map[string]any{} + + var res GetAllTemplateHistories + if err := c.Client.Post(ctx, "GetAllTemplateHistories", GetAllTemplateHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetTemplateHistoriesDocument = `query GetTemplateHistories ($where: TemplateHistoryWhereInput) { + templateHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + jsonconfig + name + operation + ownerID + ref + tags + templateType + uischema + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetTemplateHistories(ctx context.Context, where *TemplateHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetTemplateHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetTemplateHistories + if err := c.Client.Post(ctx, "GetTemplateHistories", GetTemplateHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateTFASettingDocument = `mutation CreateTFASetting ($input: CreateTFASettingInput!) { + createTFASetting(input: $input) { + tfaSetting { + recoveryCodes + totpAllowed + verified + owner { + id + } + } + } +} +` + +func (c *Client) CreateTFASetting(ctx context.Context, input CreateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*CreateTFASetting, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateTFASetting + if err := c.Client.Post(ctx, "CreateTFASetting", CreateTFASettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllTFASettingsDocument = `query GetAllTFASettings { + tfaSettings { + edges { + node { + recoveryCodes + totpAllowed + verified + owner { + id + } + } + } + } +} +` + +func (c *Client) GetAllTFASettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTFASettings, error) { + vars := map[string]any{} + + var res GetAllTFASettings + if err := c.Client.Post(ctx, "GetAllTFASettings", GetAllTFASettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetTFASettingDocument = `query GetTFASetting { + tfaSetting { + recoveryCodes + totpAllowed + verified + owner { + id + } + } +} +` + +func (c *Client) GetTFASetting(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetTFASetting, error) { + vars := map[string]any{} + + var res GetTFASetting + if err := c.Client.Post(ctx, "GetTFASetting", GetTFASettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateTFASettingDocument = `mutation UpdateTFASetting ($input: UpdateTFASettingInput!) { + updateTFASetting(input: $input) { + tfaSetting { + recoveryCodes + totpAllowed + verified + } + } +} +` + +func (c *Client) UpdateTFASetting(ctx context.Context, input UpdateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTFASetting, error) { + vars := map[string]any{ + "input": input, + } + + var res UpdateTFASetting + if err := c.Client.Post(ctx, "UpdateTFASetting", UpdateTFASettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateUserDocument = `mutation CreateUser ($input: CreateUserInput!) { + createUser(input: $input) { + user { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + sub + tags + orgMemberships { + id + organizationID + } + groupMemberships { + id + groupID + } + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) CreateUser(ctx context.Context, input CreateUserInput, interceptors ...clientv2.RequestInterceptor) (*CreateUser, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateUser + if err := c.Client.Post(ctx, "CreateUser", CreateUserDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteUserDocument = `mutation DeleteUser ($deleteUserId: ID!) { + deleteUser(id: $deleteUserId) { + deletedID + } +} +` + +func (c *Client) DeleteUser(ctx context.Context, deleteUserID string, interceptors ...clientv2.RequestInterceptor) (*DeleteUser, error) { + vars := map[string]any{ + "deleteUserId": deleteUserID, + } + + var res DeleteUser + if err := c.Client.Post(ctx, "DeleteUser", DeleteUserDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUsersDocument = `query GetAllUsers { + users { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllUsers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUsers, error) { + vars := map[string]any{} + + var res GetAllUsers + if err := c.Client.Post(ctx, "GetAllUsers", GetAllUsersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserByIDDocument = `query GetUserByID ($userId: ID!) { + user(id: $userId) { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + organizations { + id + name + personalOrg + members { + id + role + } + } + updatedAt + updatedBy + createdAt + createdBy + } +} +` + +func (c *Client) GetUserByID(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByID, error) { + vars := map[string]any{ + "userId": userID, + } + + var res GetUserByID + if err := c.Client.Post(ctx, "GetUserByID", GetUserByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserByIDWithOrgsDocument = `query GetUserByIDWithOrgs ($userId: ID!) { + user(id: $userId) { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + orgMemberships { + id + role + user { + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetUserByIDWithOrgs(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByIDWithOrgs, error) { + vars := map[string]any{ + "userId": userID, + } + + var res GetUserByIDWithOrgs + if err := c.Client.Post(ctx, "GetUserByIDWithOrgs", GetUserByIDWithOrgsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserDocument = `mutation UpdateUser ($updateUserId: ID!, $input: UpdateUserInput!) { + updateUser(id: $updateUserId, input: $input) { + user { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + sub + tags + groupMemberships { + id + } + orgMemberships { + id + } + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) UpdateUser(ctx context.Context, updateUserID string, input UpdateUserInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUser, error) { + vars := map[string]any{ + "updateUserId": updateUserID, + "input": input, + } + + var res UpdateUser + if err := c.Client.Post(ctx, "UpdateUser", UpdateUserDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUserHistoriesDocument = `query GetAllUserHistories { + userHistories { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + avatarUpdatedAt + createdAt + createdBy + displayName + email + firstName + historyTime + id + lastName + lastSeen + operation + ref + role + sub + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllUserHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserHistories, error) { + vars := map[string]any{} + + var res GetAllUserHistories + if err := c.Client.Post(ctx, "GetAllUserHistories", GetAllUserHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserHistoriesDocument = `query GetUserHistories ($where: UserHistoryWhereInput) { + userHistories(where: $where) { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + avatarUpdatedAt + createdAt + createdBy + displayName + email + firstName + historyTime + id + lastName + lastSeen + operation + ref + role + sub + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetUserHistories(ctx context.Context, where *UserHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetUserHistories + if err := c.Client.Post(ctx, "GetUserHistories", GetUserHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUserSettingsDocument = `query GetAllUserSettings { + userSettings { + edges { + node { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllUserSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettings, error) { + vars := map[string]any{} + + var res GetAllUserSettings + if err := c.Client.Post(ctx, "GetAllUserSettings", GetAllUserSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserSettingByIDDocument = `query GetUserSettingByID ($userSettingId: ID!) { + userSetting(id: $userSettingId) { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetUserSettingByID(ctx context.Context, userSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingByID, error) { + vars := map[string]any{ + "userSettingId": userSettingID, + } + + var res GetUserSettingByID + if err := c.Client.Post(ctx, "GetUserSettingByID", GetUserSettingByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserSettingsDocument = `query GetUserSettings ($where: UserSettingWhereInput!) { + userSettings(where: $where) { + edges { + node { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetUserSettings(ctx context.Context, where UserSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettings, error) { + vars := map[string]any{ + "where": where, + } + + var res GetUserSettings + if err := c.Client.Post(ctx, "GetUserSettings", GetUserSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserSettingDocument = `mutation UpdateUserSetting ($updateUserSettingId: ID!, $input: UpdateUserSettingInput!) { + updateUserSetting(id: $updateUserSettingId, input: $input) { + userSetting { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateUserSetting(ctx context.Context, updateUserSettingID string, input UpdateUserSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserSetting, error) { + vars := map[string]any{ + "updateUserSettingId": updateUserSettingID, + "input": input, + } + + var res UpdateUserSetting + if err := c.Client.Post(ctx, "UpdateUserSetting", UpdateUserSettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUserSettingHistoriesDocument = `query GetAllUserSettingHistories { + userSettingHistories { + edges { + node { + createdAt + createdBy + emailConfirmed + historyTime + id + isTfaEnabled + isWebauthnAllowed + locked + operation + ref + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetAllUserSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettingHistories, error) { + vars := map[string]any{} + + var res GetAllUserSettingHistories + if err := c.Client.Post(ctx, "GetAllUserSettingHistories", GetAllUserSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserSettingHistoriesDocument = `query GetUserSettingHistories ($where: UserSettingHistoryWhereInput) { + userSettingHistories(where: $where) { + edges { + node { + createdAt + createdBy + emailConfirmed + historyTime + id + isTfaEnabled + isWebauthnAllowed + locked + operation + ref + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetUserSettingHistories(ctx context.Context, where *UserSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetUserSettingHistories + if err := c.Client.Post(ctx, "GetUserSettingHistories", GetUserSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetWebhookByIDDocument = `query GetWebhookByID ($webhookId: ID!) { + webhook(id: $webhookId) { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } +} +` + +func (c *Client) GetWebhookByID(ctx context.Context, webhookID string, interceptors ...clientv2.RequestInterceptor) (*GetWebhookByID, error) { + vars := map[string]any{ + "webhookId": webhookID, + } + + var res GetWebhookByID + if err := c.Client.Post(ctx, "GetWebhookByID", GetWebhookByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllWebhooksDocument = `query GetAllWebhooks { + webhooks { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } + } + } +} +` + +func (c *Client) GetAllWebhooks(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhooks, error) { + vars := map[string]any{} + + var res GetAllWebhooks + if err := c.Client.Post(ctx, "GetAllWebhooks", GetAllWebhooksDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateWebhookDocument = `mutation CreateWebhook ($input: CreateWebhookInput!) { + createWebhook(input: $input) { + webhook { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + events { + id + } + } + } +} +` + +func (c *Client) CreateWebhook(ctx context.Context, input CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateWebhook, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateWebhook + if err := c.Client.Post(ctx, "CreateWebhook", CreateWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkWebhookDocument = `mutation CreateBulkWebhook ($input: [CreateWebhookInput!]) { + createBulkWebhook(input: $input) { + webhooks { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + } + } +} +` + +func (c *Client) CreateBulkWebhook(ctx context.Context, input []*CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkWebhook, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkWebhook + if err := c.Client.Post(ctx, "CreateBulkWebhook", CreateBulkWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVWebhookDocument = `mutation CreateBulkCSVWebhook ($input: Upload!) { + createBulkCSVWebhook(input: $input) { + webhooks { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + } + } +} +` + +func (c *Client) CreateBulkCSVWebhook(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVWebhook, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVWebhook + if err := c.Client.Post(ctx, "CreateBulkCSVWebhook", CreateBulkCSVWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateWebhookDocument = `mutation UpdateWebhook ($updateWebhookId: ID!, $input: UpdateWebhookInput!) { + updateWebhook(id: $updateWebhookId, input: $input) { + webhook { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } + } +} +` + +func (c *Client) UpdateWebhook(ctx context.Context, updateWebhookID string, input UpdateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*UpdateWebhook, error) { + vars := map[string]any{ + "updateWebhookId": updateWebhookID, + "input": input, + } + + var res UpdateWebhook + if err := c.Client.Post(ctx, "UpdateWebhook", UpdateWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteWebhookDocument = `mutation DeleteWebhook ($deleteWebhookId: ID!) { + deleteWebhook(id: $deleteWebhookId) { + deletedID + } +} +` + +func (c *Client) DeleteWebhook(ctx context.Context, deleteWebhookID string, interceptors ...clientv2.RequestInterceptor) (*DeleteWebhook, error) { + vars := map[string]any{ + "deleteWebhookId": deleteWebhookID, + } + + var res DeleteWebhook + if err := c.Client.Post(ctx, "DeleteWebhook", DeleteWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllWebhookHistoriesDocument = `query GetAllWebhookHistories { + webhookHistories { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + historyTime + id + lastError + lastResponse + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllWebhookHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhookHistories, error) { + vars := map[string]any{} + + var res GetAllWebhookHistories + if err := c.Client.Post(ctx, "GetAllWebhookHistories", GetAllWebhookHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetWebhookHistoriesDocument = `query GetWebhookHistories ($where: WebhookHistoryWhereInput) { + webhookHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + historyTime + id + lastError + lastResponse + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetWebhookHistories(ctx context.Context, where *WebhookHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetWebhookHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetWebhookHistories + if err := c.Client.Post(ctx, "GetWebhookHistories", GetWebhookHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +var DocumentOperationNames = map[string]string{ + CreateAPITokenDocument: "CreateAPIToken", + UpdateAPITokenDocument: "UpdateAPIToken", + GetAllAPITokensDocument: "GetAllAPITokens", + GetAPITokenByIDDocument: "GetAPITokenByID", + DeleteAPITokenDocument: "DeleteAPIToken", + CreateBulkCSVContactDocument: "CreateBulkCSVContact", + CreateBulkContactDocument: "CreateBulkContact", + CreateContactDocument: "CreateContact", + DeleteContactDocument: "DeleteContact", + GetAllContactsDocument: "GetAllContacts", + GetContactByIDDocument: "GetContactByID", + GetContactsDocument: "GetContacts", + UpdateContactDocument: "UpdateContact", + GetAllContactHistoriesDocument: "GetAllContactHistories", + GetContactHistoriesDocument: "GetContactHistories", + CreateDocumentDataDocument: "CreateDocumentData", + DeleteDocumentDataDocument: "DeleteDocumentData", + GetDocumentDataByIDDocument: "GetDocumentDataByID", + UpdateDocumentDataDocument: "UpdateDocumentData", + GetAllDocumentDataHistoriesDocument: "GetAllDocumentDataHistories", + GetDocumentDataHistoriesDocument: "GetDocumentDataHistories", + CreateBulkCSVEntitlementDocument: "CreateBulkCSVEntitlement", + CreateBulkEntitlementDocument: "CreateBulkEntitlement", + CreateEntitlementDocument: "CreateEntitlement", + DeleteEntitlementDocument: "DeleteEntitlement", + GetAllEntitlementsDocument: "GetAllEntitlements", + GetEntitlementByIDDocument: "GetEntitlementByID", + GetEntitlementsDocument: "GetEntitlements", + UpdateEntitlementDocument: "UpdateEntitlement", + GetAllEntitlementHistoriesDocument: "GetAllEntitlementHistories", + GetEntitlementHistoriesDocument: "GetEntitlementHistories", + CreateBulkCSVEntitlementPlanDocument: "CreateBulkCSVEntitlementPlan", + CreateBulkEntitlementPlanDocument: "CreateBulkEntitlementPlan", + CreateEntitlementPlanDocument: "CreateEntitlementPlan", + DeleteEntitlementPlanDocument: "DeleteEntitlementPlan", + GetAllEntitlementPlansDocument: "GetAllEntitlementPlans", + GetEntitlementPlanByIDDocument: "GetEntitlementPlanByID", + GetEntitlementPlansDocument: "GetEntitlementPlans", + UpdateEntitlementPlanDocument: "UpdateEntitlementPlan", + GetAllEntitlementPlanFeaturesDocument: "GetAllEntitlementPlanFeatures", + GetEntitlementPlanFeatureByIDDocument: "GetEntitlementPlanFeatureByID", + GetEntitlementPlanFeaturesDocument: "GetEntitlementPlanFeatures", + CreateEntitlementPlanFeatureDocument: "CreateEntitlementPlanFeature", + CreateBulkCSVEntitlementPlanFeatureDocument: "CreateBulkCSVEntitlementPlanFeature", + CreateBulkEntitlementPlanFeatureDocument: "CreateBulkEntitlementPlanFeature", + UpdateEntitlementPlanFeatureDocument: "UpdateEntitlementPlanFeature", + DeleteEntitlementPlanFeatureDocument: "DeleteEntitlementPlanFeature", + GetAllEntitlementPlanFeatureHistoriesDocument: "GetAllEntitlementPlanFeatureHistories", + GetEntitlementPlanFeatureHistoriesDocument: "GetEntitlementPlanFeatureHistories", + GetAllEntitlementPlanHistoriesDocument: "GetAllEntitlementPlanHistories", + GetEntitlementPlanHistoriesDocument: "GetEntitlementPlanHistories", + CreateBulkCSVEntityDocument: "CreateBulkCSVEntity", + CreateBulkEntityDocument: "CreateBulkEntity", + CreateEntityDocument: "CreateEntity", + DeleteEntityDocument: "DeleteEntity", + GetAllEntitiesDocument: "GetAllEntities", + GetEntitiesDocument: "GetEntities", + GetEntityByIDDocument: "GetEntityByID", + UpdateEntityDocument: "UpdateEntity", + GetAllEntityHistoriesDocument: "GetAllEntityHistories", + GetEntityHistoriesDocument: "GetEntityHistories", + CreateBulkCSVEntityTypeDocument: "CreateBulkCSVEntityType", + CreateBulkEntityTypeDocument: "CreateBulkEntityType", + CreateEntityTypeDocument: "CreateEntityType", + DeleteEntityTypeDocument: "DeleteEntityType", + GetAllEntityTypesDocument: "GetAllEntityTypes", + GetEntityTypeByIDDocument: "GetEntityTypeByID", + GetEntityTypesDocument: "GetEntityTypes", + UpdateEntityTypeDocument: "UpdateEntityType", + GetAllEntityTypeHistoriesDocument: "GetAllEntityTypeHistories", + GetEntityTypeHistoriesDocument: "GetEntityTypeHistories", + GetEventsDocument: "GetEvents", + GetEventByIDDocument: "GetEventByID", + GetAllEventsDocument: "GetAllEvents", + CreateEventDocument: "CreateEvent", + CreateBulkEventDocument: "CreateBulkEvent", + CreateBulkCSVEventDocument: "CreateBulkCSVEvent", + UpdateEventDocument: "UpdateEvent", + DeleteEventDocument: "DeleteEvent", + GetAllEventHistoriesDocument: "GetAllEventHistories", + GetEventHistoriesDocument: "GetEventHistories", + CreateBulkCSVFeatureDocument: "CreateBulkCSVFeature", + CreateBulkFeatureDocument: "CreateBulkFeature", + CreateFeatureDocument: "CreateFeature", + DeleteFeatureDocument: "DeleteFeature", + GetAllFeaturesDocument: "GetAllFeatures", + GetFeatureByIDDocument: "GetFeatureByID", + GetFeaturesDocument: "GetFeatures", + UpdateFeatureDocument: "UpdateFeature", + GetAllFeatureHistoriesDocument: "GetAllFeatureHistories", + GetFeatureHistoriesDocument: "GetFeatureHistories", + CreateBulkCSVFileDocument: "CreateBulkCSVFile", + CreateBulkFileDocument: "CreateBulkFile", + CreateFileDocument: "CreateFile", + DeleteFileDocument: "DeleteFile", + GetAllFilesDocument: "GetAllFiles", + GetFilesDocument: "GetFiles", + UpdateFileDocument: "UpdateFile", + GetAllFileHistoriesDocument: "GetAllFileHistories", + GetFileHistoriesDocument: "GetFileHistories", + CreateBulkCSVGroupDocument: "CreateBulkCSVGroup", + CreateBulkGroupDocument: "CreateBulkGroup", + CreateGroupDocument: "CreateGroup", + DeleteGroupDocument: "DeleteGroup", + GetAllGroupsDocument: "GetAllGroups", + GetGroupByIDDocument: "GetGroupByID", + GetGroupsDocument: "GetGroups", + UpdateGroupDocument: "UpdateGroup", + GetAllGroupHistoriesDocument: "GetAllGroupHistories", + GetGroupHistoriesDocument: "GetGroupHistories", + AddUserToGroupWithRoleDocument: "AddUserToGroupWithRole", + CreateBulkCSVGroupMembersDocument: "CreateBulkCSVGroupMembers", + CreateBulkGroupMembersDocument: "CreateBulkGroupMembers", + GetGroupMembersByGroupIDDocument: "GetGroupMembersByGroupID", + RemoveUserFromGroupDocument: "RemoveUserFromGroup", + UpdateUserRoleInGroupDocument: "UpdateUserRoleInGroup", + GetAllGroupMembershipHistoriesDocument: "GetAllGroupMembershipHistories", + GetGroupMembershipHistoriesDocument: "GetGroupMembershipHistories", + GetAllGroupSettingsDocument: "GetAllGroupSettings", + GetGroupSettingByIDDocument: "GetGroupSettingByID", + GetGroupSettingsDocument: "GetGroupSettings", + UpdateGroupSettingDocument: "UpdateGroupSetting", + GetAllGroupSettingHistoriesDocument: "GetAllGroupSettingHistories", + GetGroupSettingHistoriesDocument: "GetGroupSettingHistories", + CreateBulkCSVHushDocument: "CreateBulkCSVHush", + CreateBulkHushDocument: "CreateBulkHush", + CreateHushDocument: "CreateHush", + GetAllHushesDocument: "GetAllHushes", + GetHushByIDDocument: "GetHushByID", + GetHushesDocument: "GetHushes", + UpdateHushDocument: "UpdateHush", + GetAllHushHistoriesDocument: "GetAllHushHistories", + GetHushHistoriesDocument: "GetHushHistories", + CreateBulkCSVIntegrationDocument: "CreateBulkCSVIntegration", + CreateBulkIntegrationDocument: "CreateBulkIntegration", + CreateIntegrationDocument: "CreateIntegration", + DeleteIntegrationDocument: "DeleteIntegration", + GetAllIntegrationsDocument: "GetAllIntegrations", + GetIntegrationByIDDocument: "GetIntegrationByID", + GetIntegrationsDocument: "GetIntegrations", + UpdateIntegrationDocument: "UpdateIntegration", + GetAllIntegrationHistoriesDocument: "GetAllIntegrationHistories", + GetIntegrationHistoriesDocument: "GetIntegrationHistories", + CreateBulkCSVInviteDocument: "CreateBulkCSVInvite", + CreateBulkInviteDocument: "CreateBulkInvite", + CreateInviteDocument: "CreateInvite", + DeleteInviteDocument: "DeleteInvite", + GetInviteByIDDocument: "GetInviteByID", + GetAllInvitesDocument: "GetAllInvites", + InvitesByOrgIDDocument: "InvitesByOrgID", + GetAllNoteHistoriesDocument: "GetAllNoteHistories", + GetNoteHistoriesDocument: "GetNoteHistories", + GetAllOauthProviderHistoriesDocument: "GetAllOauthProviderHistories", + GetOauthProviderHistoriesDocument: "GetOauthProviderHistories", + CreateBulkCSVOhAuthTooTokenDocument: "CreateBulkCSVOhAuthTooToken", + CreateBulkOhAuthTooTokenDocument: "CreateBulkOhAuthTooToken", + CreateOhAuthTooTokenDocument: "CreateOhAuthTooToken", + DeleteOhAuthTooTokenDocument: "DeleteOhAuthTooToken", + GetOhAuthTooTokensDocument: "GetOhAuthTooTokens", + UpdateOhAuthTooTokenDocument: "UpdateOhAuthTooToken", + CreateBulkCSVOrganizationDocument: "CreateBulkCSVOrganization", + CreateBulkOrganizationDocument: "CreateBulkOrganization", + CreateOrganizationDocument: "CreateOrganization", + DeleteOrganizationDocument: "DeleteOrganization", + GetAllOrganizationsDocument: "GetAllOrganizations", + GetOrganizationByIDDocument: "GetOrganizationByID", + GetOrganizationsDocument: "GetOrganizations", + UpdateOrganizationDocument: "UpdateOrganization", + GetAllOrganizationHistoriesDocument: "GetAllOrganizationHistories", + GetOrganizationHistoriesDocument: "GetOrganizationHistories", + GetAllOrganizationSettingsDocument: "GetAllOrganizationSettings", + GetOrganizationSettingByIDDocument: "GetOrganizationSettingByID", + GetOrganizationSettingsDocument: "GetOrganizationSettings", + UpdateOrganizationSettingDocument: "UpdateOrganizationSetting", + GetAllOrganizationSettingHistoriesDocument: "GetAllOrganizationSettingHistories", + GetOrganizationSettingHistoriesDocument: "GetOrganizationSettingHistories", + AddUserToOrgWithRoleDocument: "AddUserToOrgWithRole", + CreateBulkCSVOrgMembersDocument: "CreateBulkCSVOrgMembers", + CreateBulkOrgMembersDocument: "CreateBulkOrgMembers", + GetOrgMembersByOrgIDDocument: "GetOrgMembersByOrgID", + RemoveUserFromOrgDocument: "RemoveUserFromOrg", + UpdateUserRoleInOrgDocument: "UpdateUserRoleInOrg", + GetAllOrgMembershipHistoriesDocument: "GetAllOrgMembershipHistories", + GetOrgMembershipHistoriesDocument: "GetOrgMembershipHistories", + CreateBulkCSVPersonalAccessTokenDocument: "CreateBulkCSVPersonalAccessToken", + CreateBulkPersonalAccessTokenDocument: "CreateBulkPersonalAccessToken", + CreatePersonalAccessTokenDocument: "CreatePersonalAccessToken", + DeletePersonalAccessTokenDocument: "DeletePersonalAccessToken", + GetAllPersonalAccessTokensDocument: "GetAllPersonalAccessTokens", + GetPersonalAccessTokenByIDDocument: "GetPersonalAccessTokenByID", + UpdatePersonalAccessTokenDocument: "UpdatePersonalAccessToken", + SearchDocument: "Search", + CreateBulkCSVSubscriberDocument: "CreateBulkCSVSubscriber", + CreateBulkSubscriberDocument: "CreateBulkSubscriber", + CreateSubscriberDocument: "CreateSubscriber", + DeleteSubscriberDocument: "DeleteSubscriber", + GetAllSubscribersDocument: "GetAllSubscribers", + GetSubscriberByEmailDocument: "GetSubscriberByEmail", + GetSubscribersDocument: "GetSubscribers", + UpdateSubscriberDocument: "UpdateSubscriber", + CreateBulkCSVTemplateDocument: "CreateBulkCSVTemplate", + CreateBulkTemplateDocument: "CreateBulkTemplate", + CreateTemplateDocument: "CreateTemplate", + GetAllTemplatesDocument: "GetAllTemplates", + GetTemplateByIDDocument: "GetTemplateByID", + UpdateTemplateDocument: "UpdateTemplate", + GetAllTemplateHistoriesDocument: "GetAllTemplateHistories", + GetTemplateHistoriesDocument: "GetTemplateHistories", + CreateTFASettingDocument: "CreateTFASetting", + GetAllTFASettingsDocument: "GetAllTFASettings", + GetTFASettingDocument: "GetTFASetting", + UpdateTFASettingDocument: "UpdateTFASetting", + CreateUserDocument: "CreateUser", + DeleteUserDocument: "DeleteUser", + GetAllUsersDocument: "GetAllUsers", + GetUserByIDDocument: "GetUserByID", + GetUserByIDWithOrgsDocument: "GetUserByIDWithOrgs", + UpdateUserDocument: "UpdateUser", + GetAllUserHistoriesDocument: "GetAllUserHistories", + GetUserHistoriesDocument: "GetUserHistories", + GetAllUserSettingsDocument: "GetAllUserSettings", + GetUserSettingByIDDocument: "GetUserSettingByID", + GetUserSettingsDocument: "GetUserSettings", + UpdateUserSettingDocument: "UpdateUserSetting", + GetAllUserSettingHistoriesDocument: "GetAllUserSettingHistories", + GetUserSettingHistoriesDocument: "GetUserSettingHistories", + GetWebhookByIDDocument: "GetWebhookByID", + GetAllWebhooksDocument: "GetAllWebhooks", + CreateWebhookDocument: "CreateWebhook", + CreateBulkWebhookDocument: "CreateBulkWebhook", + CreateBulkCSVWebhookDocument: "CreateBulkCSVWebhook", + UpdateWebhookDocument: "UpdateWebhook", + DeleteWebhookDocument: "DeleteWebhook", + GetAllWebhookHistoriesDocument: "GetAllWebhookHistories", + GetWebhookHistoriesDocument: "GetWebhookHistories", +} diff --git a/pkg/coreclient/models.go b/pkg/coreclient/models.go new file mode 100644 index 0000000..c03ff07 --- /dev/null +++ b/pkg/coreclient/models.go @@ -0,0 +1,15426 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package coreclient + +import ( + "encoding/json" + "fmt" + "io" + "strconv" + "time" + + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +type GlobalSearchResult interface { + IsGlobalSearchResult() +} + +type APIToken struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name associated with the token + Name string `json:"name"` + Token string `json:"token"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + Owner *Organization `json:"owner,omitempty"` +} + +func (APIToken) IsNode() {} + +// Return response for createBulkAPIToken mutation +type APITokenBulkCreatePayload struct { + // Created apiTokens + APITokens []*APIToken `json:"apiTokens,omitempty"` +} + +// A connection to a list of items. +type APITokenConnection struct { + // A list of edges. + Edges []*APITokenEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createAPIToken mutation +type APITokenCreatePayload struct { + // Created apiToken + APIToken *APIToken `json:"apiToken"` +} + +// Return response for deleteAPIToken mutation +type APITokenDeletePayload struct { + // Deleted apiToken ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type APITokenEdge struct { + // The item at the end of the edge. + Node *APIToken `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateAPIToken mutation +type APITokenUpdatePayload struct { + // Updated apiToken + APIToken *APIToken `json:"apiToken"` +} + +// APITokenWhereInput is used for filtering APIToken objects. +// Input was generated by ent. +type APITokenWhereInput struct { + Not *APITokenWhereInput `json:"not,omitempty"` + And []*APITokenWhereInput `json:"and,omitempty"` + Or []*APITokenWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // last_used_at field predicates + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + LastUsedAtNeq *time.Time `json:"lastUsedAtNEQ,omitempty"` + LastUsedAtIn []*time.Time `json:"lastUsedAtIn,omitempty"` + LastUsedAtNotIn []*time.Time `json:"lastUsedAtNotIn,omitempty"` + LastUsedAtGt *time.Time `json:"lastUsedAtGT,omitempty"` + LastUsedAtGte *time.Time `json:"lastUsedAtGTE,omitempty"` + LastUsedAtLt *time.Time `json:"lastUsedAtLT,omitempty"` + LastUsedAtLte *time.Time `json:"lastUsedAtLTE,omitempty"` + LastUsedAtIsNil *bool `json:"lastUsedAtIsNil,omitempty"` + LastUsedAtNotNil *bool `json:"lastUsedAtNotNil,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` +} + +type AuditLog struct { + Table *string `json:"table,omitempty"` + Time *time.Time `json:"time,omitempty"` + ID string `json:"id"` + Operation *string `json:"operation,omitempty"` + Changes []string `json:"changes,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` +} + +func (AuditLog) IsNode() {} + +// A connection to a list of items. +type AuditLogConnection struct { + // A list of edges. + Edges []*AuditLogEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type AuditLogEdge struct { + // The item at the end of the edge. + Node *AuditLog `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type AuditLogWhereInput struct { + RefID *string `json:"refID,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + Operation *string `json:"operation,omitempty"` + Table *string `json:"table,omitempty"` + Before *time.Time `json:"before,omitempty"` + After *time.Time `json:"after,omitempty"` +} + +type Contact struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the full name of the contact + FullName string `json:"fullName"` + // the title of the contact + Title *string `json:"title,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + // status of the contact + Status enums.UserStatus `json:"status"` + Owner *Organization `json:"owner,omitempty"` + Entities []*Entity `json:"entities,omitempty"` +} + +func (Contact) IsNode() {} + +// Return response for createBulkContact mutation +type ContactBulkCreatePayload struct { + // Created contacts + Contacts []*Contact `json:"contacts,omitempty"` +} + +// A connection to a list of items. +type ContactConnection struct { + // A list of edges. + Edges []*ContactEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createContact mutation +type ContactCreatePayload struct { + // Created contact + Contact *Contact `json:"contact"` +} + +// Return response for deleteContact mutation +type ContactDeletePayload struct { + // Deleted contact ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type ContactEdge struct { + // The item at the end of the edge. + Node *Contact `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type ContactHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the full name of the contact + FullName string `json:"fullName"` + // the title of the contact + Title *string `json:"title,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + // status of the contact + Status enums.UserStatus `json:"status"` +} + +func (ContactHistory) IsNode() {} + +// A connection to a list of items. +type ContactHistoryConnection struct { + // A list of edges. + Edges []*ContactHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type ContactHistoryEdge struct { + // The item at the end of the edge. + Node *ContactHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// ContactHistoryWhereInput is used for filtering ContactHistory objects. +// Input was generated by ent. +type ContactHistoryWhereInput struct { + Not *ContactHistoryWhereInput `json:"not,omitempty"` + And []*ContactHistoryWhereInput `json:"and,omitempty"` + Or []*ContactHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // full_name field predicates + FullName *string `json:"fullName,omitempty"` + FullNameNeq *string `json:"fullNameNEQ,omitempty"` + FullNameIn []string `json:"fullNameIn,omitempty"` + FullNameNotIn []string `json:"fullNameNotIn,omitempty"` + FullNameGt *string `json:"fullNameGT,omitempty"` + FullNameGte *string `json:"fullNameGTE,omitempty"` + FullNameLt *string `json:"fullNameLT,omitempty"` + FullNameLte *string `json:"fullNameLTE,omitempty"` + FullNameContains *string `json:"fullNameContains,omitempty"` + FullNameHasPrefix *string `json:"fullNameHasPrefix,omitempty"` + FullNameHasSuffix *string `json:"fullNameHasSuffix,omitempty"` + FullNameEqualFold *string `json:"fullNameEqualFold,omitempty"` + FullNameContainsFold *string `json:"fullNameContainsFold,omitempty"` + // title field predicates + Title *string `json:"title,omitempty"` + TitleNeq *string `json:"titleNEQ,omitempty"` + TitleIn []string `json:"titleIn,omitempty"` + TitleNotIn []string `json:"titleNotIn,omitempty"` + TitleGt *string `json:"titleGT,omitempty"` + TitleGte *string `json:"titleGTE,omitempty"` + TitleLt *string `json:"titleLT,omitempty"` + TitleLte *string `json:"titleLTE,omitempty"` + TitleContains *string `json:"titleContains,omitempty"` + TitleHasPrefix *string `json:"titleHasPrefix,omitempty"` + TitleHasSuffix *string `json:"titleHasSuffix,omitempty"` + TitleIsNil *bool `json:"titleIsNil,omitempty"` + TitleNotNil *bool `json:"titleNotNil,omitempty"` + TitleEqualFold *string `json:"titleEqualFold,omitempty"` + TitleContainsFold *string `json:"titleContainsFold,omitempty"` + // company field predicates + Company *string `json:"company,omitempty"` + CompanyNeq *string `json:"companyNEQ,omitempty"` + CompanyIn []string `json:"companyIn,omitempty"` + CompanyNotIn []string `json:"companyNotIn,omitempty"` + CompanyGt *string `json:"companyGT,omitempty"` + CompanyGte *string `json:"companyGTE,omitempty"` + CompanyLt *string `json:"companyLT,omitempty"` + CompanyLte *string `json:"companyLTE,omitempty"` + CompanyContains *string `json:"companyContains,omitempty"` + CompanyHasPrefix *string `json:"companyHasPrefix,omitempty"` + CompanyHasSuffix *string `json:"companyHasSuffix,omitempty"` + CompanyIsNil *bool `json:"companyIsNil,omitempty"` + CompanyNotNil *bool `json:"companyNotNil,omitempty"` + CompanyEqualFold *string `json:"companyEqualFold,omitempty"` + CompanyContainsFold *string `json:"companyContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailIsNil *bool `json:"emailIsNil,omitempty"` + EmailNotNil *bool `json:"emailNotNil,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // phone_number field predicates + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNeq *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGt *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGte *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLt *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLte *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil *bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil *bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + // address field predicates + Address *string `json:"address,omitempty"` + AddressNeq *string `json:"addressNEQ,omitempty"` + AddressIn []string `json:"addressIn,omitempty"` + AddressNotIn []string `json:"addressNotIn,omitempty"` + AddressGt *string `json:"addressGT,omitempty"` + AddressGte *string `json:"addressGTE,omitempty"` + AddressLt *string `json:"addressLT,omitempty"` + AddressLte *string `json:"addressLTE,omitempty"` + AddressContains *string `json:"addressContains,omitempty"` + AddressHasPrefix *string `json:"addressHasPrefix,omitempty"` + AddressHasSuffix *string `json:"addressHasSuffix,omitempty"` + AddressIsNil *bool `json:"addressIsNil,omitempty"` + AddressNotNil *bool `json:"addressNotNil,omitempty"` + AddressEqualFold *string `json:"addressEqualFold,omitempty"` + AddressContainsFold *string `json:"addressContainsFold,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` +} + +// Return response for updateContact mutation +type ContactUpdatePayload struct { + // Updated contact + Contact *Contact `json:"contact"` +} + +// ContactWhereInput is used for filtering Contact objects. +// Input was generated by ent. +type ContactWhereInput struct { + Not *ContactWhereInput `json:"not,omitempty"` + And []*ContactWhereInput `json:"and,omitempty"` + Or []*ContactWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // full_name field predicates + FullName *string `json:"fullName,omitempty"` + FullNameNeq *string `json:"fullNameNEQ,omitempty"` + FullNameIn []string `json:"fullNameIn,omitempty"` + FullNameNotIn []string `json:"fullNameNotIn,omitempty"` + FullNameGt *string `json:"fullNameGT,omitempty"` + FullNameGte *string `json:"fullNameGTE,omitempty"` + FullNameLt *string `json:"fullNameLT,omitempty"` + FullNameLte *string `json:"fullNameLTE,omitempty"` + FullNameContains *string `json:"fullNameContains,omitempty"` + FullNameHasPrefix *string `json:"fullNameHasPrefix,omitempty"` + FullNameHasSuffix *string `json:"fullNameHasSuffix,omitempty"` + FullNameEqualFold *string `json:"fullNameEqualFold,omitempty"` + FullNameContainsFold *string `json:"fullNameContainsFold,omitempty"` + // title field predicates + Title *string `json:"title,omitempty"` + TitleNeq *string `json:"titleNEQ,omitempty"` + TitleIn []string `json:"titleIn,omitempty"` + TitleNotIn []string `json:"titleNotIn,omitempty"` + TitleGt *string `json:"titleGT,omitempty"` + TitleGte *string `json:"titleGTE,omitempty"` + TitleLt *string `json:"titleLT,omitempty"` + TitleLte *string `json:"titleLTE,omitempty"` + TitleContains *string `json:"titleContains,omitempty"` + TitleHasPrefix *string `json:"titleHasPrefix,omitempty"` + TitleHasSuffix *string `json:"titleHasSuffix,omitempty"` + TitleIsNil *bool `json:"titleIsNil,omitempty"` + TitleNotNil *bool `json:"titleNotNil,omitempty"` + TitleEqualFold *string `json:"titleEqualFold,omitempty"` + TitleContainsFold *string `json:"titleContainsFold,omitempty"` + // company field predicates + Company *string `json:"company,omitempty"` + CompanyNeq *string `json:"companyNEQ,omitempty"` + CompanyIn []string `json:"companyIn,omitempty"` + CompanyNotIn []string `json:"companyNotIn,omitempty"` + CompanyGt *string `json:"companyGT,omitempty"` + CompanyGte *string `json:"companyGTE,omitempty"` + CompanyLt *string `json:"companyLT,omitempty"` + CompanyLte *string `json:"companyLTE,omitempty"` + CompanyContains *string `json:"companyContains,omitempty"` + CompanyHasPrefix *string `json:"companyHasPrefix,omitempty"` + CompanyHasSuffix *string `json:"companyHasSuffix,omitempty"` + CompanyIsNil *bool `json:"companyIsNil,omitempty"` + CompanyNotNil *bool `json:"companyNotNil,omitempty"` + CompanyEqualFold *string `json:"companyEqualFold,omitempty"` + CompanyContainsFold *string `json:"companyContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailIsNil *bool `json:"emailIsNil,omitempty"` + EmailNotNil *bool `json:"emailNotNil,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // phone_number field predicates + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNeq *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGt *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGte *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLt *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLte *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil *bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil *bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + // address field predicates + Address *string `json:"address,omitempty"` + AddressNeq *string `json:"addressNEQ,omitempty"` + AddressIn []string `json:"addressIn,omitempty"` + AddressNotIn []string `json:"addressNotIn,omitempty"` + AddressGt *string `json:"addressGT,omitempty"` + AddressGte *string `json:"addressGTE,omitempty"` + AddressLt *string `json:"addressLT,omitempty"` + AddressLte *string `json:"addressLTE,omitempty"` + AddressContains *string `json:"addressContains,omitempty"` + AddressHasPrefix *string `json:"addressHasPrefix,omitempty"` + AddressHasSuffix *string `json:"addressHasSuffix,omitempty"` + AddressIsNil *bool `json:"addressIsNil,omitempty"` + AddressNotNil *bool `json:"addressNotNil,omitempty"` + AddressEqualFold *string `json:"addressEqualFold,omitempty"` + AddressContainsFold *string `json:"addressContainsFold,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entities edge predicates + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` +} + +// CreateAPITokenInput is used for create APIToken object. +// Input was generated by ent. +type CreateAPITokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name associated with the token + Name string `json:"name"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` +} + +// CreateContactInput is used for create Contact object. +// Input was generated by ent. +type CreateContactInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the full name of the contact + FullName string `json:"fullName"` + // the title of the contact + Title *string `json:"title,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + // status of the contact + Status *enums.UserStatus `json:"status,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` +} + +// CreateDocumentDataInput is used for create DocumentData object. +// Input was generated by ent. +type CreateDocumentDataInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the json data of the document + Data json.RawMessage `json:"data"` + OwnerID *string `json:"ownerID,omitempty"` + TemplateID string `json:"templateID"` + EntityIDs []string `json:"entityIDs,omitempty"` +} + +// CreateEntitlementInput is used for create Entitlement object. +// Input was generated by ent. +type CreateEntitlementInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled *bool `json:"cancelled,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + PlanID string `json:"planID"` + OrganizationID string `json:"organizationID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateEntitlementPlanFeatureInput is used for create EntitlementPlanFeature object. +// Input was generated by ent. +type CreateEntitlementPlanFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + PlanID string `json:"planID"` + FeatureID string `json:"featureID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateEntitlementPlanInput is used for create EntitlementPlan object. +// Input was generated by ent. +type CreateEntitlementPlanInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + // the unique name of the plan + Name string `json:"name"` + // a description of the plan + Description *string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EntitlementIDs []string `json:"entitlementIDs,omitempty"` + BaseFeatureIDs []string `json:"baseFeatureIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateEntityInput is used for create Entity object. +// Input was generated by ent. +type CreateEntityInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ContactIDs []string `json:"contactIDs,omitempty"` + DocumentIDs []string `json:"documentIDs,omitempty"` + NoteIDs []string `json:"noteIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + EntityTypeID *string `json:"entityTypeID,omitempty"` + Note *CreateNoteInput `json:"note,omitempty"` +} + +// CreateEntityTypeInput is used for create EntityType object. +// Input was generated by ent. +type CreateEntityTypeInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the entity + Name string `json:"name"` + OwnerID *string `json:"ownerID,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` +} + +// CreateEventInput is used for create Event object. +// Input was generated by ent. +type CreateEventInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + EventID *string `json:"eventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + EventType string `json:"eventType"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + UserIDs []string `json:"userIDs,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + InviteIDs []string `json:"inviteIDs,omitempty"` + FeatureIDs []string `json:"featureIDs,omitempty"` + EntitlementplanIDs []string `json:"entitlementplanIDs,omitempty"` + PersonalAccessTokenIDs []string `json:"personalAccessTokenIDs,omitempty"` + Oauth2tokenIDs []string `json:"oauth2tokenIDs,omitempty"` + HushIDs []string `json:"hushIDs,omitempty"` + EntitlementIDs []string `json:"entitlementIDs,omitempty"` + WebhookIDs []string `json:"webhookIDs,omitempty"` + SubscriberIDs []string `json:"subscriberIDs,omitempty"` +} + +// CreateFeatureInput is used for create Feature object. +// Input was generated by ent. +type CreateFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the unique name of the feature + Name string `json:"name"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + // enabled features are available for use + Enabled *bool `json:"enabled,omitempty"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + PlanIDs []string `json:"planIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateFileInput is used for create File object. +// Input was generated by ent. +type CreateFileInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + FileName string `json:"fileName"` + FileExtension string `json:"fileExtension"` + FileSize *int64 `json:"fileSize,omitempty"` + ContentType string `json:"contentType"` + StoreKey string `json:"storeKey"` + Category *string `json:"category,omitempty"` + Annotation *string `json:"annotation,omitempty"` + UserID *string `json:"userID,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` +} + +// CreateGroupInput is used for create Group object. +// Input was generated by ent. +type CreateGroupInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name"` + // the groups description + Description *string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + SettingID string `json:"settingID"` + UserIDs []string `json:"userIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + CreateGroupSettings *CreateGroupSettingInput `json:"createGroupSettings,omitempty"` +} + +// CreateGroupMembershipInput is used for create GroupMembership object. +// Input was generated by ent. +type CreateGroupMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + GroupID string `json:"groupID"` + UserID string `json:"userID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateGroupSettingInput is used for create GroupSetting object. +// Input was generated by ent. +type CreateGroupSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility *enums.Visibility `json:"visibility,omitempty"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + GroupID *string `json:"groupID,omitempty"` +} + +// CreateHushInput is used for create Hush object. +// Input was generated by ent. +type CreateHushInput struct { + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName *string `json:"secretName,omitempty"` + // the secret value + SecretValue *string `json:"secretValue,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateIntegrationInput is used for create Integration object. +// Input was generated by ent. +type CreateIntegrationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name"` + // a description of the integration + Description *string `json:"description,omitempty"` + Kind *string `json:"kind,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + SecretIDs []string `json:"secretIDs,omitempty"` + Oauth2tokenIDs []string `json:"oauth2tokenIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + WebhookIDs []string `json:"webhookIDs,omitempty"` +} + +// CreateInviteInput is used for create Invite object. +// Input was generated by ent. +type CreateInviteInput struct { + // the expiration date of the invitation token which defaults to 14 days in the future from creation + Expires *time.Time `json:"expires,omitempty"` + // the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + Recipient string `json:"recipient"` + // the status of the invitation + Status *enums.InviteStatus `json:"status,omitempty"` + Role *enums.Role `json:"role,omitempty"` + // the number of attempts made to perform email send of the invitation, maximum of 5 + SendAttempts *int64 `json:"sendAttempts,omitempty"` + // the user who initiated the invitation + RequestorID *string `json:"requestorID,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateNoteInput is used for create Note object. +// Input was generated by ent. +type CreateNoteInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the text of the note + Text string `json:"text"` + OwnerID *string `json:"ownerID,omitempty"` + EntityID *string `json:"entityID,omitempty"` +} + +// CreateOauthProviderInput is used for create OauthProvider object. +// Input was generated by ent. +type CreateOauthProviderInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the oauth provider's name + Name string `json:"name"` + // the client id for the oauth provider + ClientID string `json:"clientID"` + // the client secret + ClientSecret string `json:"clientSecret"` + // the redirect url + RedirectURL string `json:"redirectURL"` + // the scopes + Scopes string `json:"scopes"` + // the auth url of the provider + AuthURL string `json:"authURL"` + // the token url of the provider + TokenURL string `json:"tokenURL"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle string `json:"authStyle"` + // the URL to request user information by token + InfoURL string `json:"infoURL"` + OwnerID *string `json:"ownerID,omitempty"` +} + +// CreateOhAuthTooTokenInput is used for create OhAuthTooToken object. +// Input was generated by ent. +type CreateOhAuthTooTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + ClientID string `json:"clientID"` + Scopes []string `json:"scopes,omitempty"` + Nonce string `json:"nonce"` + ClaimsUserID string `json:"claimsUserID"` + ClaimsUsername string `json:"claimsUsername"` + ClaimsEmail string `json:"claimsEmail"` + ClaimsEmailVerified bool `json:"claimsEmailVerified"` + ClaimsGroups []string `json:"claimsGroups,omitempty"` + ClaimsPreferredUsername string `json:"claimsPreferredUsername"` + ConnectorID string `json:"connectorID"` + ConnectorData []string `json:"connectorData,omitempty"` + LastUsed *time.Time `json:"lastUsed,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateOrgMembershipInput is used for create OrgMembership object. +// Input was generated by ent. +type CreateOrgMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + OrganizationID string `json:"organizationID"` + UserID string `json:"userID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateOrganizationInput is used for create Organization object. +// Input was generated by ent. +type CreateOrganizationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the organization + Name string `json:"name"` + // The organization's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + // orgs directly associated with a user + PersonalOrg *bool `json:"personalOrg,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb *bool `json:"dedicatedDb,omitempty"` + ParentID *string `json:"parentID,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` + TemplateIDs []string `json:"templateIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + SettingID *string `json:"settingID,omitempty"` + DocumentdatumIDs []string `json:"documentdatumIDs,omitempty"` + EntitlementIDs []string `json:"entitlementIDs,omitempty"` + OrganizationEntitlementIDs []string `json:"organizationEntitlementIDs,omitempty"` + PersonalAccessTokenIDs []string `json:"personalAccessTokenIDs,omitempty"` + APITokenIDs []string `json:"apiTokenIDs,omitempty"` + OauthproviderIDs []string `json:"oauthproviderIDs,omitempty"` + UserIDs []string `json:"userIDs,omitempty"` + InviteIDs []string `json:"inviteIDs,omitempty"` + SubscriberIDs []string `json:"subscriberIDs,omitempty"` + WebhookIDs []string `json:"webhookIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + SecretIDs []string `json:"secretIDs,omitempty"` + FeatureIDs []string `json:"featureIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + EntitlementplanIDs []string `json:"entitlementplanIDs,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` + EntitytypeIDs []string `json:"entitytypeIDs,omitempty"` + ContactIDs []string `json:"contactIDs,omitempty"` + NoteIDs []string `json:"noteIDs,omitempty"` + CreateOrgSettings *CreateOrganizationSettingInput `json:"createOrgSettings,omitempty"` +} + +// CreateOrganizationSettingInput is used for create OrganizationSetting object. +// Input was generated by ent. +type CreateOrganizationSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` +} + +// CreatePersonalAccessTokenInput is used for create PersonalAccessToken object. +// Input was generated by ent. +type CreatePersonalAccessTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name associated with the token + Name string `json:"name"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + OwnerID string `json:"ownerID"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateSubscriberInput is used for create Subscriber object. +// Input was generated by ent. +type CreateSubscriberInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // email address of the subscriber + Email string `json:"email"` + // phone number of the subscriber + PhoneNumber *string `json:"phoneNumber,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateTFASettingInput is used for create TFASetting object. +// Input was generated by ent. +type CreateTFASettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + TotpAllowed *bool `json:"totpAllowed,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` +} + +// CreateTemplateInput is used for create Template object. +// Input was generated by ent. +type CreateTemplateInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the template + Name string `json:"name"` + // the type of the template, either a provided template or an implementation (document) + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + // the description of the template + Description *string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + DocumentIDs []string `json:"documentIDs,omitempty"` +} + +// CreateUserInput is used for create User object. +// Input was generated by ent. +type CreateUserInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + Email string `json:"email"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"displayName"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + // user password hash + Password *string `json:"password,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + // the user's role + Role *enums.Role `json:"role,omitempty"` + PersonalAccessTokenIDs []string `json:"personalAccessTokenIDs,omitempty"` + TfaSettingIDs []string `json:"tfaSettingIDs,omitempty"` + SettingID string `json:"settingID"` + EmailVerificationTokenIDs []string `json:"emailVerificationTokenIDs,omitempty"` + PasswordResetTokenIDs []string `json:"passwordResetTokenIDs,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + WebauthnIDs []string `json:"webauthnIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateUserSettingInput is used for create UserSetting object. +// Input was generated by ent. +type CreateUserSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked *bool `json:"locked,omitempty"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + // status of the user account + Status *enums.UserStatus `json:"status,omitempty"` + // whether the user has confirmed their email address + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + UserID *string `json:"userID,omitempty"` + DefaultOrgID *string `json:"defaultOrgID,omitempty"` +} + +// CreateWebhookInput is used for create Webhook object. +// Input was generated by ent. +type CreateWebhookInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the webhook + Name string `json:"name"` + // a description of the webhook + Description *string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destinationURL"` + // indicates if the webhook is active and enabled + Enabled *bool `json:"enabled,omitempty"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` +} + +type DocumentData struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the template id of the document + TemplateID string `json:"templateID"` + // the json data of the document + Data json.RawMessage `json:"data"` + Owner *Organization `json:"owner,omitempty"` + Template *Template `json:"template"` + Entity []*Entity `json:"entity,omitempty"` +} + +func (DocumentData) IsNode() {} + +// Return response for createBulkDocumentData mutation +type DocumentDataBulkCreatePayload struct { + // Created documentData + DocumentData []*DocumentData `json:"documentData,omitempty"` +} + +// A connection to a list of items. +type DocumentDataConnection struct { + // A list of edges. + Edges []*DocumentDataEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createDocumentData mutation +type DocumentDataCreatePayload struct { + // Created documentData + DocumentData *DocumentData `json:"documentData"` +} + +// Return response for deleteDocumentData mutation +type DocumentDataDeletePayload struct { + // Deleted documentData ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type DocumentDataEdge struct { + // The item at the end of the edge. + Node *DocumentData `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type DocumentDataHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the template id of the document + TemplateID string `json:"templateID"` + // the json data of the document + Data json.RawMessage `json:"data"` +} + +func (DocumentDataHistory) IsNode() {} + +// A connection to a list of items. +type DocumentDataHistoryConnection struct { + // A list of edges. + Edges []*DocumentDataHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type DocumentDataHistoryEdge struct { + // The item at the end of the edge. + Node *DocumentDataHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// DocumentDataHistoryWhereInput is used for filtering DocumentDataHistory objects. +// Input was generated by ent. +type DocumentDataHistoryWhereInput struct { + Not *DocumentDataHistoryWhereInput `json:"not,omitempty"` + And []*DocumentDataHistoryWhereInput `json:"and,omitempty"` + Or []*DocumentDataHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // template_id field predicates + TemplateID *string `json:"templateID,omitempty"` + TemplateIDNeq *string `json:"templateIDNEQ,omitempty"` + TemplateIDIn []string `json:"templateIDIn,omitempty"` + TemplateIDNotIn []string `json:"templateIDNotIn,omitempty"` + TemplateIDGt *string `json:"templateIDGT,omitempty"` + TemplateIDGte *string `json:"templateIDGTE,omitempty"` + TemplateIDLt *string `json:"templateIDLT,omitempty"` + TemplateIDLte *string `json:"templateIDLTE,omitempty"` + TemplateIDContains *string `json:"templateIDContains,omitempty"` + TemplateIDHasPrefix *string `json:"templateIDHasPrefix,omitempty"` + TemplateIDHasSuffix *string `json:"templateIDHasSuffix,omitempty"` + TemplateIDEqualFold *string `json:"templateIDEqualFold,omitempty"` + TemplateIDContainsFold *string `json:"templateIDContainsFold,omitempty"` +} + +// Return response for updateDocumentData mutation +type DocumentDataUpdatePayload struct { + // Updated documentData + DocumentData *DocumentData `json:"documentData"` +} + +// DocumentDataWhereInput is used for filtering DocumentData objects. +// Input was generated by ent. +type DocumentDataWhereInput struct { + Not *DocumentDataWhereInput `json:"not,omitempty"` + And []*DocumentDataWhereInput `json:"and,omitempty"` + Or []*DocumentDataWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // template_id field predicates + TemplateID *string `json:"templateID,omitempty"` + TemplateIDNeq *string `json:"templateIDNEQ,omitempty"` + TemplateIDIn []string `json:"templateIDIn,omitempty"` + TemplateIDNotIn []string `json:"templateIDNotIn,omitempty"` + TemplateIDGt *string `json:"templateIDGT,omitempty"` + TemplateIDGte *string `json:"templateIDGTE,omitempty"` + TemplateIDLt *string `json:"templateIDLT,omitempty"` + TemplateIDLte *string `json:"templateIDLTE,omitempty"` + TemplateIDContains *string `json:"templateIDContains,omitempty"` + TemplateIDHasPrefix *string `json:"templateIDHasPrefix,omitempty"` + TemplateIDHasSuffix *string `json:"templateIDHasSuffix,omitempty"` + TemplateIDEqualFold *string `json:"templateIDEqualFold,omitempty"` + TemplateIDContainsFold *string `json:"templateIDContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // template edge predicates + HasTemplate *bool `json:"hasTemplate,omitempty"` + HasTemplateWith []*TemplateWhereInput `json:"hasTemplateWith,omitempty"` + // entity edge predicates + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` +} + +type Entitlement struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the plan to which the entitlement belongs + PlanID string `json:"planID"` + // the organization to which the entitlement belongs + OrganizationID string `json:"organizationID"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + // whether or not the customers entitlement expires - expires_at will show the time + Expires bool `json:"expires"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled bool `json:"cancelled"` + Owner *Organization `json:"owner,omitempty"` + Plan *EntitlementPlan `json:"plan"` + Organization *Organization `json:"organization"` + Events []*Event `json:"events,omitempty"` +} + +func (Entitlement) IsNode() {} + +// Return response for createBulkEntitlement mutation +type EntitlementBulkCreatePayload struct { + // Created entitlements + Entitlements []*Entitlement `json:"entitlements,omitempty"` +} + +// A connection to a list of items. +type EntitlementConnection struct { + // A list of edges. + Edges []*EntitlementEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntitlement mutation +type EntitlementCreatePayload struct { + // Created entitlement + Entitlement *Entitlement `json:"entitlement"` +} + +// Return response for deleteEntitlement mutation +type EntitlementDeletePayload struct { + // Deleted entitlement ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntitlementEdge struct { + // The item at the end of the edge. + Node *Entitlement `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntitlementHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the plan to which the entitlement belongs + PlanID string `json:"planID"` + // the organization to which the entitlement belongs + OrganizationID string `json:"organizationID"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + // whether or not the customers entitlement expires - expires_at will show the time + Expires bool `json:"expires"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled bool `json:"cancelled"` +} + +func (EntitlementHistory) IsNode() {} + +// A connection to a list of items. +type EntitlementHistoryConnection struct { + // A list of edges. + Edges []*EntitlementHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntitlementHistoryEdge struct { + // The item at the end of the edge. + Node *EntitlementHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EntitlementHistoryWhereInput is used for filtering EntitlementHistory objects. +// Input was generated by ent. +type EntitlementHistoryWhereInput struct { + Not *EntitlementHistoryWhereInput `json:"not,omitempty"` + And []*EntitlementHistoryWhereInput `json:"and,omitempty"` + Or []*EntitlementHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // plan_id field predicates + PlanID *string `json:"planID,omitempty"` + PlanIDNeq *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGt *string `json:"planIDGT,omitempty"` + PlanIDGte *string `json:"planIDGTE,omitempty"` + PlanIDLt *string `json:"planIDLT,omitempty"` + PlanIDLte *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // external_customer_id field predicates + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ExternalCustomerIDNeq *string `json:"externalCustomerIDNEQ,omitempty"` + ExternalCustomerIDIn []string `json:"externalCustomerIDIn,omitempty"` + ExternalCustomerIDNotIn []string `json:"externalCustomerIDNotIn,omitempty"` + ExternalCustomerIDGt *string `json:"externalCustomerIDGT,omitempty"` + ExternalCustomerIDGte *string `json:"externalCustomerIDGTE,omitempty"` + ExternalCustomerIDLt *string `json:"externalCustomerIDLT,omitempty"` + ExternalCustomerIDLte *string `json:"externalCustomerIDLTE,omitempty"` + ExternalCustomerIDContains *string `json:"externalCustomerIDContains,omitempty"` + ExternalCustomerIDHasPrefix *string `json:"externalCustomerIDHasPrefix,omitempty"` + ExternalCustomerIDHasSuffix *string `json:"externalCustomerIDHasSuffix,omitempty"` + ExternalCustomerIDIsNil *bool `json:"externalCustomerIDIsNil,omitempty"` + ExternalCustomerIDNotNil *bool `json:"externalCustomerIDNotNil,omitempty"` + ExternalCustomerIDEqualFold *string `json:"externalCustomerIDEqualFold,omitempty"` + ExternalCustomerIDContainsFold *string `json:"externalCustomerIDContainsFold,omitempty"` + // external_subscription_id field predicates + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ExternalSubscriptionIDNeq *string `json:"externalSubscriptionIDNEQ,omitempty"` + ExternalSubscriptionIDIn []string `json:"externalSubscriptionIDIn,omitempty"` + ExternalSubscriptionIDNotIn []string `json:"externalSubscriptionIDNotIn,omitempty"` + ExternalSubscriptionIDGt *string `json:"externalSubscriptionIDGT,omitempty"` + ExternalSubscriptionIDGte *string `json:"externalSubscriptionIDGTE,omitempty"` + ExternalSubscriptionIDLt *string `json:"externalSubscriptionIDLT,omitempty"` + ExternalSubscriptionIDLte *string `json:"externalSubscriptionIDLTE,omitempty"` + ExternalSubscriptionIDContains *string `json:"externalSubscriptionIDContains,omitempty"` + ExternalSubscriptionIDHasPrefix *string `json:"externalSubscriptionIDHasPrefix,omitempty"` + ExternalSubscriptionIDHasSuffix *string `json:"externalSubscriptionIDHasSuffix,omitempty"` + ExternalSubscriptionIDIsNil *bool `json:"externalSubscriptionIDIsNil,omitempty"` + ExternalSubscriptionIDNotNil *bool `json:"externalSubscriptionIDNotNil,omitempty"` + ExternalSubscriptionIDEqualFold *string `json:"externalSubscriptionIDEqualFold,omitempty"` + ExternalSubscriptionIDContainsFold *string `json:"externalSubscriptionIDContainsFold,omitempty"` + // expires field predicates + Expires *bool `json:"expires,omitempty"` + ExpiresNeq *bool `json:"expiresNEQ,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // cancelled field predicates + Cancelled *bool `json:"cancelled,omitempty"` + CancelledNeq *bool `json:"cancelledNEQ,omitempty"` +} + +type EntitlementPlan struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + // the unique name of the plan + Name string `json:"name"` + // a description of the plan + Description *string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Entitlements []*Entitlement `json:"entitlements,omitempty"` + BaseFeatures []*Feature `json:"baseFeatures,omitempty"` + Events []*Event `json:"events,omitempty"` + Features []*EntitlementPlanFeature `json:"features,omitempty"` +} + +func (EntitlementPlan) IsNode() {} + +// Return response for createBulkEntitlementPlan mutation +type EntitlementPlanBulkCreatePayload struct { + // Created entitlementPlans + EntitlementPlans []*EntitlementPlan `json:"entitlementPlans,omitempty"` +} + +// A connection to a list of items. +type EntitlementPlanConnection struct { + // A list of edges. + Edges []*EntitlementPlanEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntitlementPlan mutation +type EntitlementPlanCreatePayload struct { + // Created entitlementPlan + EntitlementPlan *EntitlementPlan `json:"entitlementPlan"` +} + +// Return response for deleteEntitlementPlan mutation +type EntitlementPlanDeletePayload struct { + // Deleted entitlementPlan ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntitlementPlanEdge struct { + // The item at the end of the edge. + Node *EntitlementPlan `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntitlementPlanFeature struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + PlanID string `json:"planID"` + FeatureID string `json:"featureID"` + Owner *Organization `json:"owner,omitempty"` + Plan *EntitlementPlan `json:"plan"` + Feature *Feature `json:"feature"` + Events []*Event `json:"events,omitempty"` +} + +func (EntitlementPlanFeature) IsNode() {} + +// Return response for createBulkEntitlementPlanFeature mutation +type EntitlementPlanFeatureBulkCreatePayload struct { + // Created entitlementPlanFeatures + EntitlementPlanFeatures []*EntitlementPlanFeature `json:"entitlementPlanFeatures,omitempty"` +} + +// A connection to a list of items. +type EntitlementPlanFeatureConnection struct { + // A list of edges. + Edges []*EntitlementPlanFeatureEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntitlementPlanFeature mutation +type EntitlementPlanFeatureCreatePayload struct { + // Created entitlementPlanFeature + EntitlementPlanFeature *EntitlementPlanFeature `json:"entitlementPlanFeature"` +} + +// Return response for deleteEntitlementPlanFeature mutation +type EntitlementPlanFeatureDeletePayload struct { + // Deleted entitlementPlanFeature ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntitlementPlanFeatureEdge struct { + // The item at the end of the edge. + Node *EntitlementPlanFeature `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntitlementPlanFeatureHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + PlanID string `json:"planID"` + FeatureID string `json:"featureID"` +} + +func (EntitlementPlanFeatureHistory) IsNode() {} + +// A connection to a list of items. +type EntitlementPlanFeatureHistoryConnection struct { + // A list of edges. + Edges []*EntitlementPlanFeatureHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntitlementPlanFeatureHistoryEdge struct { + // The item at the end of the edge. + Node *EntitlementPlanFeatureHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EntitlementPlanFeatureHistoryWhereInput is used for filtering EntitlementPlanFeatureHistory objects. +// Input was generated by ent. +type EntitlementPlanFeatureHistoryWhereInput struct { + Not *EntitlementPlanFeatureHistoryWhereInput `json:"not,omitempty"` + And []*EntitlementPlanFeatureHistoryWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanFeatureHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // plan_id field predicates + PlanID *string `json:"planID,omitempty"` + PlanIDNeq *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGt *string `json:"planIDGT,omitempty"` + PlanIDGte *string `json:"planIDGTE,omitempty"` + PlanIDLt *string `json:"planIDLT,omitempty"` + PlanIDLte *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + // feature_id field predicates + FeatureID *string `json:"featureID,omitempty"` + FeatureIDNeq *string `json:"featureIDNEQ,omitempty"` + FeatureIDIn []string `json:"featureIDIn,omitempty"` + FeatureIDNotIn []string `json:"featureIDNotIn,omitempty"` + FeatureIDGt *string `json:"featureIDGT,omitempty"` + FeatureIDGte *string `json:"featureIDGTE,omitempty"` + FeatureIDLt *string `json:"featureIDLT,omitempty"` + FeatureIDLte *string `json:"featureIDLTE,omitempty"` + FeatureIDContains *string `json:"featureIDContains,omitempty"` + FeatureIDHasPrefix *string `json:"featureIDHasPrefix,omitempty"` + FeatureIDHasSuffix *string `json:"featureIDHasSuffix,omitempty"` + FeatureIDEqualFold *string `json:"featureIDEqualFold,omitempty"` + FeatureIDContainsFold *string `json:"featureIDContainsFold,omitempty"` +} + +// Return response for updateEntitlementPlanFeature mutation +type EntitlementPlanFeatureUpdatePayload struct { + // Updated entitlementPlanFeature + EntitlementPlanFeature *EntitlementPlanFeature `json:"entitlementPlanFeature"` +} + +// EntitlementPlanFeatureWhereInput is used for filtering EntitlementPlanFeature objects. +// Input was generated by ent. +type EntitlementPlanFeatureWhereInput struct { + Not *EntitlementPlanFeatureWhereInput `json:"not,omitempty"` + And []*EntitlementPlanFeatureWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanFeatureWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` +} + +type EntitlementPlanHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + // the unique name of the plan + Name string `json:"name"` + // a description of the plan + Description *string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +func (EntitlementPlanHistory) IsNode() {} + +// A connection to a list of items. +type EntitlementPlanHistoryConnection struct { + // A list of edges. + Edges []*EntitlementPlanHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntitlementPlanHistoryEdge struct { + // The item at the end of the edge. + Node *EntitlementPlanHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EntitlementPlanHistoryWhereInput is used for filtering EntitlementPlanHistory objects. +// Input was generated by ent. +type EntitlementPlanHistoryWhereInput struct { + Not *EntitlementPlanHistoryWhereInput `json:"not,omitempty"` + And []*EntitlementPlanHistoryWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // version field predicates + Version *string `json:"version,omitempty"` + VersionNeq *string `json:"versionNEQ,omitempty"` + VersionIn []string `json:"versionIn,omitempty"` + VersionNotIn []string `json:"versionNotIn,omitempty"` + VersionGt *string `json:"versionGT,omitempty"` + VersionGte *string `json:"versionGTE,omitempty"` + VersionLt *string `json:"versionLT,omitempty"` + VersionLte *string `json:"versionLTE,omitempty"` + VersionContains *string `json:"versionContains,omitempty"` + VersionHasPrefix *string `json:"versionHasPrefix,omitempty"` + VersionHasSuffix *string `json:"versionHasSuffix,omitempty"` + VersionEqualFold *string `json:"versionEqualFold,omitempty"` + VersionContainsFold *string `json:"versionContainsFold,omitempty"` +} + +// Return response for updateEntitlementPlan mutation +type EntitlementPlanUpdatePayload struct { + // Updated entitlementPlan + EntitlementPlan *EntitlementPlan `json:"entitlementPlan"` +} + +// EntitlementPlanWhereInput is used for filtering EntitlementPlan objects. +// Input was generated by ent. +type EntitlementPlanWhereInput struct { + Not *EntitlementPlanWhereInput `json:"not,omitempty"` + And []*EntitlementPlanWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // version field predicates + Version *string `json:"version,omitempty"` + VersionNeq *string `json:"versionNEQ,omitempty"` + VersionIn []string `json:"versionIn,omitempty"` + VersionNotIn []string `json:"versionNotIn,omitempty"` + VersionGt *string `json:"versionGT,omitempty"` + VersionGte *string `json:"versionGTE,omitempty"` + VersionLt *string `json:"versionLT,omitempty"` + VersionLte *string `json:"versionLTE,omitempty"` + VersionContains *string `json:"versionContains,omitempty"` + VersionHasPrefix *string `json:"versionHasPrefix,omitempty"` + VersionHasSuffix *string `json:"versionHasSuffix,omitempty"` + VersionEqualFold *string `json:"versionEqualFold,omitempty"` + VersionContainsFold *string `json:"versionContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entitlements edge predicates + HasEntitlements *bool `json:"hasEntitlements,omitempty"` + HasEntitlementsWith []*EntitlementWhereInput `json:"hasEntitlementsWith,omitempty"` + // base_features edge predicates + HasBaseFeatures *bool `json:"hasBaseFeatures,omitempty"` + HasBaseFeaturesWith []*FeatureWhereInput `json:"hasBaseFeaturesWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // features edge predicates + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasFeaturesWith,omitempty"` +} + +// Return response for updateEntitlement mutation +type EntitlementUpdatePayload struct { + // Updated entitlement + Entitlement *Entitlement `json:"entitlement"` +} + +// EntitlementWhereInput is used for filtering Entitlement objects. +// Input was generated by ent. +type EntitlementWhereInput struct { + Not *EntitlementWhereInput `json:"not,omitempty"` + And []*EntitlementWhereInput `json:"and,omitempty"` + Or []*EntitlementWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // plan_id field predicates + PlanID *string `json:"planID,omitempty"` + PlanIDNeq *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGt *string `json:"planIDGT,omitempty"` + PlanIDGte *string `json:"planIDGTE,omitempty"` + PlanIDLt *string `json:"planIDLT,omitempty"` + PlanIDLte *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // external_customer_id field predicates + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ExternalCustomerIDNeq *string `json:"externalCustomerIDNEQ,omitempty"` + ExternalCustomerIDIn []string `json:"externalCustomerIDIn,omitempty"` + ExternalCustomerIDNotIn []string `json:"externalCustomerIDNotIn,omitempty"` + ExternalCustomerIDGt *string `json:"externalCustomerIDGT,omitempty"` + ExternalCustomerIDGte *string `json:"externalCustomerIDGTE,omitempty"` + ExternalCustomerIDLt *string `json:"externalCustomerIDLT,omitempty"` + ExternalCustomerIDLte *string `json:"externalCustomerIDLTE,omitempty"` + ExternalCustomerIDContains *string `json:"externalCustomerIDContains,omitempty"` + ExternalCustomerIDHasPrefix *string `json:"externalCustomerIDHasPrefix,omitempty"` + ExternalCustomerIDHasSuffix *string `json:"externalCustomerIDHasSuffix,omitempty"` + ExternalCustomerIDIsNil *bool `json:"externalCustomerIDIsNil,omitempty"` + ExternalCustomerIDNotNil *bool `json:"externalCustomerIDNotNil,omitempty"` + ExternalCustomerIDEqualFold *string `json:"externalCustomerIDEqualFold,omitempty"` + ExternalCustomerIDContainsFold *string `json:"externalCustomerIDContainsFold,omitempty"` + // external_subscription_id field predicates + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ExternalSubscriptionIDNeq *string `json:"externalSubscriptionIDNEQ,omitempty"` + ExternalSubscriptionIDIn []string `json:"externalSubscriptionIDIn,omitempty"` + ExternalSubscriptionIDNotIn []string `json:"externalSubscriptionIDNotIn,omitempty"` + ExternalSubscriptionIDGt *string `json:"externalSubscriptionIDGT,omitempty"` + ExternalSubscriptionIDGte *string `json:"externalSubscriptionIDGTE,omitempty"` + ExternalSubscriptionIDLt *string `json:"externalSubscriptionIDLT,omitempty"` + ExternalSubscriptionIDLte *string `json:"externalSubscriptionIDLTE,omitempty"` + ExternalSubscriptionIDContains *string `json:"externalSubscriptionIDContains,omitempty"` + ExternalSubscriptionIDHasPrefix *string `json:"externalSubscriptionIDHasPrefix,omitempty"` + ExternalSubscriptionIDHasSuffix *string `json:"externalSubscriptionIDHasSuffix,omitempty"` + ExternalSubscriptionIDIsNil *bool `json:"externalSubscriptionIDIsNil,omitempty"` + ExternalSubscriptionIDNotNil *bool `json:"externalSubscriptionIDNotNil,omitempty"` + ExternalSubscriptionIDEqualFold *string `json:"externalSubscriptionIDEqualFold,omitempty"` + ExternalSubscriptionIDContainsFold *string `json:"externalSubscriptionIDContainsFold,omitempty"` + // expires field predicates + Expires *bool `json:"expires,omitempty"` + ExpiresNeq *bool `json:"expiresNEQ,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // cancelled field predicates + Cancelled *bool `json:"cancelled,omitempty"` + CancelledNeq *bool `json:"cancelledNEQ,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // plan edge predicates + HasPlan *bool `json:"hasPlan,omitempty"` + HasPlanWith []*EntitlementPlanWhereInput `json:"hasPlanWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Entity struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // The type of the entity + EntityTypeID *string `json:"entityTypeID,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Contacts []*Contact `json:"contacts,omitempty"` + Documents []*DocumentData `json:"documents,omitempty"` + Notes []*Note `json:"notes,omitempty"` + Files []*File `json:"files,omitempty"` + EntityType *EntityType `json:"entityType,omitempty"` +} + +func (Entity) IsNode() {} + +// Return response for createBulkEntity mutation +type EntityBulkCreatePayload struct { + // Created entities + Entities []*Entity `json:"entities,omitempty"` +} + +// A connection to a list of items. +type EntityConnection struct { + // A list of edges. + Edges []*EntityEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntity mutation +type EntityCreatePayload struct { + // Created entity + Entity *Entity `json:"entity"` +} + +// Return response for deleteEntity mutation +type EntityDeletePayload struct { + // Deleted entity ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntityEdge struct { + // The item at the end of the edge. + Node *Entity `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntityHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // The type of the entity + EntityTypeID *string `json:"entityTypeID,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` +} + +func (EntityHistory) IsNode() {} + +// A connection to a list of items. +type EntityHistoryConnection struct { + // A list of edges. + Edges []*EntityHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntityHistoryEdge struct { + // The item at the end of the edge. + Node *EntityHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for EntityHistory connections +type EntityHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order EntityHistories. + Field EntityHistoryOrderField `json:"field"` +} + +// EntityHistoryWhereInput is used for filtering EntityHistory objects. +// Input was generated by ent. +type EntityHistoryWhereInput struct { + Not *EntityHistoryWhereInput `json:"not,omitempty"` + And []*EntityHistoryWhereInput `json:"and,omitempty"` + Or []*EntityHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameIsNil *bool `json:"nameIsNil,omitempty"` + NameNotNil *bool `json:"nameNotNil,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // entity_type_id field predicates + EntityTypeID *string `json:"entityTypeID,omitempty"` + EntityTypeIDNeq *string `json:"entityTypeIDNEQ,omitempty"` + EntityTypeIDIn []string `json:"entityTypeIDIn,omitempty"` + EntityTypeIDNotIn []string `json:"entityTypeIDNotIn,omitempty"` + EntityTypeIDGt *string `json:"entityTypeIDGT,omitempty"` + EntityTypeIDGte *string `json:"entityTypeIDGTE,omitempty"` + EntityTypeIDLt *string `json:"entityTypeIDLT,omitempty"` + EntityTypeIDLte *string `json:"entityTypeIDLTE,omitempty"` + EntityTypeIDContains *string `json:"entityTypeIDContains,omitempty"` + EntityTypeIDHasPrefix *string `json:"entityTypeIDHasPrefix,omitempty"` + EntityTypeIDHasSuffix *string `json:"entityTypeIDHasSuffix,omitempty"` + EntityTypeIDIsNil *bool `json:"entityTypeIDIsNil,omitempty"` + EntityTypeIDNotNil *bool `json:"entityTypeIDNotNil,omitempty"` + EntityTypeIDEqualFold *string `json:"entityTypeIDEqualFold,omitempty"` + EntityTypeIDContainsFold *string `json:"entityTypeIDContainsFold,omitempty"` + // status field predicates + Status *string `json:"status,omitempty"` + StatusNeq *string `json:"statusNEQ,omitempty"` + StatusIn []string `json:"statusIn,omitempty"` + StatusNotIn []string `json:"statusNotIn,omitempty"` + StatusGt *string `json:"statusGT,omitempty"` + StatusGte *string `json:"statusGTE,omitempty"` + StatusLt *string `json:"statusLT,omitempty"` + StatusLte *string `json:"statusLTE,omitempty"` + StatusContains *string `json:"statusContains,omitempty"` + StatusHasPrefix *string `json:"statusHasPrefix,omitempty"` + StatusHasSuffix *string `json:"statusHasSuffix,omitempty"` + StatusIsNil *bool `json:"statusIsNil,omitempty"` + StatusNotNil *bool `json:"statusNotNil,omitempty"` + StatusEqualFold *string `json:"statusEqualFold,omitempty"` + StatusContainsFold *string `json:"statusContainsFold,omitempty"` +} + +// Ordering options for Entity connections +type EntityOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Entities. + Field EntityOrderField `json:"field"` +} + +type EntityType struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name string `json:"name"` + Owner *Organization `json:"owner,omitempty"` + Entities []*Entity `json:"entities,omitempty"` +} + +func (EntityType) IsNode() {} + +// Return response for createBulkEntityType mutation +type EntityTypeBulkCreatePayload struct { + // Created entityTypes + EntityTypes []*EntityType `json:"entityTypes,omitempty"` +} + +// A connection to a list of items. +type EntityTypeConnection struct { + // A list of edges. + Edges []*EntityTypeEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntityType mutation +type EntityTypeCreatePayload struct { + // Created entityType + EntityType *EntityType `json:"entityType"` +} + +// Return response for deleteEntityType mutation +type EntityTypeDeletePayload struct { + // Deleted entityType ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntityTypeEdge struct { + // The item at the end of the edge. + Node *EntityType `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntityTypeHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name string `json:"name"` +} + +func (EntityTypeHistory) IsNode() {} + +// A connection to a list of items. +type EntityTypeHistoryConnection struct { + // A list of edges. + Edges []*EntityTypeHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntityTypeHistoryEdge struct { + // The item at the end of the edge. + Node *EntityTypeHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for EntityTypeHistory connections +type EntityTypeHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order EntityTypeHistories. + Field EntityTypeHistoryOrderField `json:"field"` +} + +// EntityTypeHistoryWhereInput is used for filtering EntityTypeHistory objects. +// Input was generated by ent. +type EntityTypeHistoryWhereInput struct { + Not *EntityTypeHistoryWhereInput `json:"not,omitempty"` + And []*EntityTypeHistoryWhereInput `json:"and,omitempty"` + Or []*EntityTypeHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` +} + +// Ordering options for EntityType connections +type EntityTypeOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order EntityTypes. + Field EntityTypeOrderField `json:"field"` +} + +// Return response for updateEntityType mutation +type EntityTypeUpdatePayload struct { + // Updated entityType + EntityType *EntityType `json:"entityType"` +} + +// EntityTypeWhereInput is used for filtering EntityType objects. +// Input was generated by ent. +type EntityTypeWhereInput struct { + Not *EntityTypeWhereInput `json:"not,omitempty"` + And []*EntityTypeWhereInput `json:"and,omitempty"` + Or []*EntityTypeWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entities edge predicates + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` +} + +// Return response for updateEntity mutation +type EntityUpdatePayload struct { + // Updated entity + Entity *Entity `json:"entity"` +} + +// EntityWhereInput is used for filtering Entity objects. +// Input was generated by ent. +type EntityWhereInput struct { + Not *EntityWhereInput `json:"not,omitempty"` + And []*EntityWhereInput `json:"and,omitempty"` + Or []*EntityWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameIsNil *bool `json:"nameIsNil,omitempty"` + NameNotNil *bool `json:"nameNotNil,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // entity_type_id field predicates + EntityTypeID *string `json:"entityTypeID,omitempty"` + EntityTypeIDNeq *string `json:"entityTypeIDNEQ,omitempty"` + EntityTypeIDIn []string `json:"entityTypeIDIn,omitempty"` + EntityTypeIDNotIn []string `json:"entityTypeIDNotIn,omitempty"` + EntityTypeIDGt *string `json:"entityTypeIDGT,omitempty"` + EntityTypeIDGte *string `json:"entityTypeIDGTE,omitempty"` + EntityTypeIDLt *string `json:"entityTypeIDLT,omitempty"` + EntityTypeIDLte *string `json:"entityTypeIDLTE,omitempty"` + EntityTypeIDContains *string `json:"entityTypeIDContains,omitempty"` + EntityTypeIDHasPrefix *string `json:"entityTypeIDHasPrefix,omitempty"` + EntityTypeIDHasSuffix *string `json:"entityTypeIDHasSuffix,omitempty"` + EntityTypeIDIsNil *bool `json:"entityTypeIDIsNil,omitempty"` + EntityTypeIDNotNil *bool `json:"entityTypeIDNotNil,omitempty"` + EntityTypeIDEqualFold *string `json:"entityTypeIDEqualFold,omitempty"` + EntityTypeIDContainsFold *string `json:"entityTypeIDContainsFold,omitempty"` + // status field predicates + Status *string `json:"status,omitempty"` + StatusNeq *string `json:"statusNEQ,omitempty"` + StatusIn []string `json:"statusIn,omitempty"` + StatusNotIn []string `json:"statusNotIn,omitempty"` + StatusGt *string `json:"statusGT,omitempty"` + StatusGte *string `json:"statusGTE,omitempty"` + StatusLt *string `json:"statusLT,omitempty"` + StatusLte *string `json:"statusLTE,omitempty"` + StatusContains *string `json:"statusContains,omitempty"` + StatusHasPrefix *string `json:"statusHasPrefix,omitempty"` + StatusHasSuffix *string `json:"statusHasSuffix,omitempty"` + StatusIsNil *bool `json:"statusIsNil,omitempty"` + StatusNotNil *bool `json:"statusNotNil,omitempty"` + StatusEqualFold *string `json:"statusEqualFold,omitempty"` + StatusContainsFold *string `json:"statusContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // contacts edge predicates + HasContacts *bool `json:"hasContacts,omitempty"` + HasContactsWith []*ContactWhereInput `json:"hasContactsWith,omitempty"` + // documents edge predicates + HasDocuments *bool `json:"hasDocuments,omitempty"` + HasDocumentsWith []*DocumentDataWhereInput `json:"hasDocumentsWith,omitempty"` + // notes edge predicates + HasNotes *bool `json:"hasNotes,omitempty"` + HasNotesWith []*NoteWhereInput `json:"hasNotesWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // entity_type edge predicates + HasEntityType *bool `json:"hasEntityType,omitempty"` + HasEntityTypeWith []*EntityTypeWhereInput `json:"hasEntityTypeWith,omitempty"` +} + +type Event struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + EventID *string `json:"eventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + EventType string `json:"eventType"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + User []*User `json:"user,omitempty"` + Group []*Group `json:"group,omitempty"` + Integration []*Integration `json:"integration,omitempty"` + Organization []*Organization `json:"organization,omitempty"` + Invite []*Invite `json:"invite,omitempty"` + Feature []*Feature `json:"feature,omitempty"` + Entitlementplan []*EntitlementPlan `json:"entitlementplan,omitempty"` + Entitlementplanfeature []*EntitlementPlanFeature `json:"entitlementplanfeature,omitempty"` + PersonalAccessToken []*PersonalAccessToken `json:"personalAccessToken,omitempty"` + Oauth2token []*OhAuthTooToken `json:"oauth2token,omitempty"` + Hush []*Hush `json:"hush,omitempty"` + Orgmembership []*OrgMembership `json:"orgmembership,omitempty"` + Groupmembership []*GroupMembership `json:"groupmembership,omitempty"` + Entitlement []*Entitlement `json:"entitlement,omitempty"` + Webhook []*Webhook `json:"webhook,omitempty"` + Subscriber []*Subscriber `json:"subscriber,omitempty"` +} + +func (Event) IsNode() {} + +// Return response for createBulkEvent mutation +type EventBulkCreatePayload struct { + // Created events + Events []*Event `json:"events,omitempty"` +} + +// A connection to a list of items. +type EventConnection struct { + // A list of edges. + Edges []*EventEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEvent mutation +type EventCreatePayload struct { + // Created event + Event *Event `json:"event"` +} + +// Return response for deleteEvent mutation +type EventDeletePayload struct { + // Deleted event ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EventEdge struct { + // The item at the end of the edge. + Node *Event `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EventHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + EventID *string `json:"eventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + EventType string `json:"eventType"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +func (EventHistory) IsNode() {} + +// A connection to a list of items. +type EventHistoryConnection struct { + // A list of edges. + Edges []*EventHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EventHistoryEdge struct { + // The item at the end of the edge. + Node *EventHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EventHistoryWhereInput is used for filtering EventHistory objects. +// Input was generated by ent. +type EventHistoryWhereInput struct { + Not *EventHistoryWhereInput `json:"not,omitempty"` + And []*EventHistoryWhereInput `json:"and,omitempty"` + Or []*EventHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // event_id field predicates + EventID *string `json:"eventID,omitempty"` + EventIDNeq *string `json:"eventIDNEQ,omitempty"` + EventIDIn []string `json:"eventIDIn,omitempty"` + EventIDNotIn []string `json:"eventIDNotIn,omitempty"` + EventIDGt *string `json:"eventIDGT,omitempty"` + EventIDGte *string `json:"eventIDGTE,omitempty"` + EventIDLt *string `json:"eventIDLT,omitempty"` + EventIDLte *string `json:"eventIDLTE,omitempty"` + EventIDContains *string `json:"eventIDContains,omitempty"` + EventIDHasPrefix *string `json:"eventIDHasPrefix,omitempty"` + EventIDHasSuffix *string `json:"eventIDHasSuffix,omitempty"` + EventIDIsNil *bool `json:"eventIDIsNil,omitempty"` + EventIDNotNil *bool `json:"eventIDNotNil,omitempty"` + EventIDEqualFold *string `json:"eventIDEqualFold,omitempty"` + EventIDContainsFold *string `json:"eventIDContainsFold,omitempty"` + // correlation_id field predicates + CorrelationID *string `json:"correlationID,omitempty"` + CorrelationIDNeq *string `json:"correlationIDNEQ,omitempty"` + CorrelationIDIn []string `json:"correlationIDIn,omitempty"` + CorrelationIDNotIn []string `json:"correlationIDNotIn,omitempty"` + CorrelationIDGt *string `json:"correlationIDGT,omitempty"` + CorrelationIDGte *string `json:"correlationIDGTE,omitempty"` + CorrelationIDLt *string `json:"correlationIDLT,omitempty"` + CorrelationIDLte *string `json:"correlationIDLTE,omitempty"` + CorrelationIDContains *string `json:"correlationIDContains,omitempty"` + CorrelationIDHasPrefix *string `json:"correlationIDHasPrefix,omitempty"` + CorrelationIDHasSuffix *string `json:"correlationIDHasSuffix,omitempty"` + CorrelationIDIsNil *bool `json:"correlationIDIsNil,omitempty"` + CorrelationIDNotNil *bool `json:"correlationIDNotNil,omitempty"` + CorrelationIDEqualFold *string `json:"correlationIDEqualFold,omitempty"` + CorrelationIDContainsFold *string `json:"correlationIDContainsFold,omitempty"` + // event_type field predicates + EventType *string `json:"eventType,omitempty"` + EventTypeNeq *string `json:"eventTypeNEQ,omitempty"` + EventTypeIn []string `json:"eventTypeIn,omitempty"` + EventTypeNotIn []string `json:"eventTypeNotIn,omitempty"` + EventTypeGt *string `json:"eventTypeGT,omitempty"` + EventTypeGte *string `json:"eventTypeGTE,omitempty"` + EventTypeLt *string `json:"eventTypeLT,omitempty"` + EventTypeLte *string `json:"eventTypeLTE,omitempty"` + EventTypeContains *string `json:"eventTypeContains,omitempty"` + EventTypeHasPrefix *string `json:"eventTypeHasPrefix,omitempty"` + EventTypeHasSuffix *string `json:"eventTypeHasSuffix,omitempty"` + EventTypeEqualFold *string `json:"eventTypeEqualFold,omitempty"` + EventTypeContainsFold *string `json:"eventTypeContainsFold,omitempty"` +} + +// Return response for updateEvent mutation +type EventUpdatePayload struct { + // Updated event + Event *Event `json:"event"` +} + +// EventWhereInput is used for filtering Event objects. +// Input was generated by ent. +type EventWhereInput struct { + Not *EventWhereInput `json:"not,omitempty"` + And []*EventWhereInput `json:"and,omitempty"` + Or []*EventWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // event_id field predicates + EventID *string `json:"eventID,omitempty"` + EventIDNeq *string `json:"eventIDNEQ,omitempty"` + EventIDIn []string `json:"eventIDIn,omitempty"` + EventIDNotIn []string `json:"eventIDNotIn,omitempty"` + EventIDGt *string `json:"eventIDGT,omitempty"` + EventIDGte *string `json:"eventIDGTE,omitempty"` + EventIDLt *string `json:"eventIDLT,omitempty"` + EventIDLte *string `json:"eventIDLTE,omitempty"` + EventIDContains *string `json:"eventIDContains,omitempty"` + EventIDHasPrefix *string `json:"eventIDHasPrefix,omitempty"` + EventIDHasSuffix *string `json:"eventIDHasSuffix,omitempty"` + EventIDIsNil *bool `json:"eventIDIsNil,omitempty"` + EventIDNotNil *bool `json:"eventIDNotNil,omitempty"` + EventIDEqualFold *string `json:"eventIDEqualFold,omitempty"` + EventIDContainsFold *string `json:"eventIDContainsFold,omitempty"` + // correlation_id field predicates + CorrelationID *string `json:"correlationID,omitempty"` + CorrelationIDNeq *string `json:"correlationIDNEQ,omitempty"` + CorrelationIDIn []string `json:"correlationIDIn,omitempty"` + CorrelationIDNotIn []string `json:"correlationIDNotIn,omitempty"` + CorrelationIDGt *string `json:"correlationIDGT,omitempty"` + CorrelationIDGte *string `json:"correlationIDGTE,omitempty"` + CorrelationIDLt *string `json:"correlationIDLT,omitempty"` + CorrelationIDLte *string `json:"correlationIDLTE,omitempty"` + CorrelationIDContains *string `json:"correlationIDContains,omitempty"` + CorrelationIDHasPrefix *string `json:"correlationIDHasPrefix,omitempty"` + CorrelationIDHasSuffix *string `json:"correlationIDHasSuffix,omitempty"` + CorrelationIDIsNil *bool `json:"correlationIDIsNil,omitempty"` + CorrelationIDNotNil *bool `json:"correlationIDNotNil,omitempty"` + CorrelationIDEqualFold *string `json:"correlationIDEqualFold,omitempty"` + CorrelationIDContainsFold *string `json:"correlationIDContainsFold,omitempty"` + // event_type field predicates + EventType *string `json:"eventType,omitempty"` + EventTypeNeq *string `json:"eventTypeNEQ,omitempty"` + EventTypeIn []string `json:"eventTypeIn,omitempty"` + EventTypeNotIn []string `json:"eventTypeNotIn,omitempty"` + EventTypeGt *string `json:"eventTypeGT,omitempty"` + EventTypeGte *string `json:"eventTypeGTE,omitempty"` + EventTypeLt *string `json:"eventTypeLT,omitempty"` + EventTypeLte *string `json:"eventTypeLTE,omitempty"` + EventTypeContains *string `json:"eventTypeContains,omitempty"` + EventTypeHasPrefix *string `json:"eventTypeHasPrefix,omitempty"` + EventTypeHasSuffix *string `json:"eventTypeHasSuffix,omitempty"` + EventTypeEqualFold *string `json:"eventTypeEqualFold,omitempty"` + EventTypeContainsFold *string `json:"eventTypeContainsFold,omitempty"` + // user edge predicates + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + // group edge predicates + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` + // integration edge predicates + HasIntegration *bool `json:"hasIntegration,omitempty"` + HasIntegrationWith []*IntegrationWhereInput `json:"hasIntegrationWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // invite edge predicates + HasInvite *bool `json:"hasInvite,omitempty"` + HasInviteWith []*InviteWhereInput `json:"hasInviteWith,omitempty"` + // feature edge predicates + HasFeature *bool `json:"hasFeature,omitempty"` + HasFeatureWith []*FeatureWhereInput `json:"hasFeatureWith,omitempty"` + // entitlementplan edge predicates + HasEntitlementplan *bool `json:"hasEntitlementplan,omitempty"` + HasEntitlementplanWith []*EntitlementPlanWhereInput `json:"hasEntitlementplanWith,omitempty"` + // entitlementplanfeature edge predicates + HasEntitlementplanfeature *bool `json:"hasEntitlementplanfeature,omitempty"` + HasEntitlementplanfeatureWith []*EntitlementPlanFeatureWhereInput `json:"hasEntitlementplanfeatureWith,omitempty"` + // personal_access_token edge predicates + HasPersonalAccessToken *bool `json:"hasPersonalAccessToken,omitempty"` + HasPersonalAccessTokenWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokenWith,omitempty"` + // oauth2token edge predicates + HasOauth2token *bool `json:"hasOauth2token,omitempty"` + HasOauth2tokenWith []*OhAuthTooTokenWhereInput `json:"hasOauth2tokenWith,omitempty"` + // hush edge predicates + HasHush *bool `json:"hasHush,omitempty"` + HasHushWith []*HushWhereInput `json:"hasHushWith,omitempty"` + // orgmembership edge predicates + HasOrgmembership *bool `json:"hasOrgmembership,omitempty"` + HasOrgmembershipWith []*OrgMembershipWhereInput `json:"hasOrgmembershipWith,omitempty"` + // groupmembership edge predicates + HasGroupmembership *bool `json:"hasGroupmembership,omitempty"` + HasGroupmembershipWith []*GroupMembershipWhereInput `json:"hasGroupmembershipWith,omitempty"` + // entitlement edge predicates + HasEntitlement *bool `json:"hasEntitlement,omitempty"` + HasEntitlementWith []*EntitlementWhereInput `json:"hasEntitlementWith,omitempty"` + // webhook edge predicates + HasWebhook *bool `json:"hasWebhook,omitempty"` + HasWebhookWith []*WebhookWhereInput `json:"hasWebhookWith,omitempty"` + // subscriber edge predicates + HasSubscriber *bool `json:"hasSubscriber,omitempty"` + HasSubscriberWith []*SubscriberWhereInput `json:"hasSubscriberWith,omitempty"` +} + +type Feature struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the unique name of the feature + Name string `json:"name"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + // enabled features are available for use + Enabled bool `json:"enabled"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Plans []*EntitlementPlan `json:"plans,omitempty"` + Events []*Event `json:"events,omitempty"` + Features []*EntitlementPlanFeature `json:"features,omitempty"` +} + +func (Feature) IsNode() {} + +// Return response for createBulkFeature mutation +type FeatureBulkCreatePayload struct { + // Created features + Features []*Feature `json:"features,omitempty"` +} + +// A connection to a list of items. +type FeatureConnection struct { + // A list of edges. + Edges []*FeatureEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createFeature mutation +type FeatureCreatePayload struct { + // Created feature + Feature *Feature `json:"feature"` +} + +// Return response for deleteFeature mutation +type FeatureDeletePayload struct { + // Deleted feature ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type FeatureEdge struct { + // The item at the end of the edge. + Node *Feature `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type FeatureHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the unique name of the feature + Name string `json:"name"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + // enabled features are available for use + Enabled bool `json:"enabled"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +func (FeatureHistory) IsNode() {} + +// A connection to a list of items. +type FeatureHistoryConnection struct { + // A list of edges. + Edges []*FeatureHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type FeatureHistoryEdge struct { + // The item at the end of the edge. + Node *FeatureHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// FeatureHistoryWhereInput is used for filtering FeatureHistory objects. +// Input was generated by ent. +type FeatureHistoryWhereInput struct { + Not *FeatureHistoryWhereInput `json:"not,omitempty"` + And []*FeatureHistoryWhereInput `json:"and,omitempty"` + Or []*FeatureHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` +} + +// Return response for updateFeature mutation +type FeatureUpdatePayload struct { + // Updated feature + Feature *Feature `json:"feature"` +} + +// FeatureWhereInput is used for filtering Feature objects. +// Input was generated by ent. +type FeatureWhereInput struct { + Not *FeatureWhereInput `json:"not,omitempty"` + And []*FeatureWhereInput `json:"and,omitempty"` + Or []*FeatureWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // plans edge predicates + HasPlans *bool `json:"hasPlans,omitempty"` + HasPlansWith []*EntitlementPlanWhereInput `json:"hasPlansWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // features edge predicates + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasFeaturesWith,omitempty"` +} + +type File struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + FileName string `json:"fileName"` + FileExtension string `json:"fileExtension"` + FileSize *int64 `json:"fileSize,omitempty"` + ContentType string `json:"contentType"` + StoreKey string `json:"storeKey"` + Category *string `json:"category,omitempty"` + Annotation *string `json:"annotation,omitempty"` + User *User `json:"user,omitempty"` + Organization []*Organization `json:"organization,omitempty"` + Entity []*Entity `json:"entity,omitempty"` + Group []*Group `json:"group,omitempty"` +} + +func (File) IsNode() {} + +// Return response for createBulkFile mutation +type FileBulkCreatePayload struct { + // Created files + Files []*File `json:"files,omitempty"` +} + +// A connection to a list of items. +type FileConnection struct { + // A list of edges. + Edges []*FileEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createFile mutation +type FileCreatePayload struct { + // Created file + File *File `json:"file"` +} + +// Return response for deleteFile mutation +type FileDeletePayload struct { + // Deleted file ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type FileEdge struct { + // The item at the end of the edge. + Node *File `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type FileHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + FileName string `json:"fileName"` + FileExtension string `json:"fileExtension"` + FileSize *int64 `json:"fileSize,omitempty"` + ContentType string `json:"contentType"` + StoreKey string `json:"storeKey"` + Category *string `json:"category,omitempty"` + Annotation *string `json:"annotation,omitempty"` +} + +func (FileHistory) IsNode() {} + +// A connection to a list of items. +type FileHistoryConnection struct { + // A list of edges. + Edges []*FileHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type FileHistoryEdge struct { + // The item at the end of the edge. + Node *FileHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// FileHistoryWhereInput is used for filtering FileHistory objects. +// Input was generated by ent. +type FileHistoryWhereInput struct { + Not *FileHistoryWhereInput `json:"not,omitempty"` + And []*FileHistoryWhereInput `json:"and,omitempty"` + Or []*FileHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // file_name field predicates + FileName *string `json:"fileName,omitempty"` + FileNameNeq *string `json:"fileNameNEQ,omitempty"` + FileNameIn []string `json:"fileNameIn,omitempty"` + FileNameNotIn []string `json:"fileNameNotIn,omitempty"` + FileNameGt *string `json:"fileNameGT,omitempty"` + FileNameGte *string `json:"fileNameGTE,omitempty"` + FileNameLt *string `json:"fileNameLT,omitempty"` + FileNameLte *string `json:"fileNameLTE,omitempty"` + FileNameContains *string `json:"fileNameContains,omitempty"` + FileNameHasPrefix *string `json:"fileNameHasPrefix,omitempty"` + FileNameHasSuffix *string `json:"fileNameHasSuffix,omitempty"` + FileNameEqualFold *string `json:"fileNameEqualFold,omitempty"` + FileNameContainsFold *string `json:"fileNameContainsFold,omitempty"` + // file_extension field predicates + FileExtension *string `json:"fileExtension,omitempty"` + FileExtensionNeq *string `json:"fileExtensionNEQ,omitempty"` + FileExtensionIn []string `json:"fileExtensionIn,omitempty"` + FileExtensionNotIn []string `json:"fileExtensionNotIn,omitempty"` + FileExtensionGt *string `json:"fileExtensionGT,omitempty"` + FileExtensionGte *string `json:"fileExtensionGTE,omitempty"` + FileExtensionLt *string `json:"fileExtensionLT,omitempty"` + FileExtensionLte *string `json:"fileExtensionLTE,omitempty"` + FileExtensionContains *string `json:"fileExtensionContains,omitempty"` + FileExtensionHasPrefix *string `json:"fileExtensionHasPrefix,omitempty"` + FileExtensionHasSuffix *string `json:"fileExtensionHasSuffix,omitempty"` + FileExtensionEqualFold *string `json:"fileExtensionEqualFold,omitempty"` + FileExtensionContainsFold *string `json:"fileExtensionContainsFold,omitempty"` + // file_size field predicates + FileSize *int64 `json:"fileSize,omitempty"` + FileSizeNeq *int64 `json:"fileSizeNEQ,omitempty"` + FileSizeIn []int64 `json:"fileSizeIn,omitempty"` + FileSizeNotIn []int64 `json:"fileSizeNotIn,omitempty"` + FileSizeGt *int64 `json:"fileSizeGT,omitempty"` + FileSizeGte *int64 `json:"fileSizeGTE,omitempty"` + FileSizeLt *int64 `json:"fileSizeLT,omitempty"` + FileSizeLte *int64 `json:"fileSizeLTE,omitempty"` + FileSizeIsNil *bool `json:"fileSizeIsNil,omitempty"` + FileSizeNotNil *bool `json:"fileSizeNotNil,omitempty"` + // content_type field predicates + ContentType *string `json:"contentType,omitempty"` + ContentTypeNeq *string `json:"contentTypeNEQ,omitempty"` + ContentTypeIn []string `json:"contentTypeIn,omitempty"` + ContentTypeNotIn []string `json:"contentTypeNotIn,omitempty"` + ContentTypeGt *string `json:"contentTypeGT,omitempty"` + ContentTypeGte *string `json:"contentTypeGTE,omitempty"` + ContentTypeLt *string `json:"contentTypeLT,omitempty"` + ContentTypeLte *string `json:"contentTypeLTE,omitempty"` + ContentTypeContains *string `json:"contentTypeContains,omitempty"` + ContentTypeHasPrefix *string `json:"contentTypeHasPrefix,omitempty"` + ContentTypeHasSuffix *string `json:"contentTypeHasSuffix,omitempty"` + ContentTypeEqualFold *string `json:"contentTypeEqualFold,omitempty"` + ContentTypeContainsFold *string `json:"contentTypeContainsFold,omitempty"` + // store_key field predicates + StoreKey *string `json:"storeKey,omitempty"` + StoreKeyNeq *string `json:"storeKeyNEQ,omitempty"` + StoreKeyIn []string `json:"storeKeyIn,omitempty"` + StoreKeyNotIn []string `json:"storeKeyNotIn,omitempty"` + StoreKeyGt *string `json:"storeKeyGT,omitempty"` + StoreKeyGte *string `json:"storeKeyGTE,omitempty"` + StoreKeyLt *string `json:"storeKeyLT,omitempty"` + StoreKeyLte *string `json:"storeKeyLTE,omitempty"` + StoreKeyContains *string `json:"storeKeyContains,omitempty"` + StoreKeyHasPrefix *string `json:"storeKeyHasPrefix,omitempty"` + StoreKeyHasSuffix *string `json:"storeKeyHasSuffix,omitempty"` + StoreKeyEqualFold *string `json:"storeKeyEqualFold,omitempty"` + StoreKeyContainsFold *string `json:"storeKeyContainsFold,omitempty"` + // category field predicates + Category *string `json:"category,omitempty"` + CategoryNeq *string `json:"categoryNEQ,omitempty"` + CategoryIn []string `json:"categoryIn,omitempty"` + CategoryNotIn []string `json:"categoryNotIn,omitempty"` + CategoryGt *string `json:"categoryGT,omitempty"` + CategoryGte *string `json:"categoryGTE,omitempty"` + CategoryLt *string `json:"categoryLT,omitempty"` + CategoryLte *string `json:"categoryLTE,omitempty"` + CategoryContains *string `json:"categoryContains,omitempty"` + CategoryHasPrefix *string `json:"categoryHasPrefix,omitempty"` + CategoryHasSuffix *string `json:"categoryHasSuffix,omitempty"` + CategoryIsNil *bool `json:"categoryIsNil,omitempty"` + CategoryNotNil *bool `json:"categoryNotNil,omitempty"` + CategoryEqualFold *string `json:"categoryEqualFold,omitempty"` + CategoryContainsFold *string `json:"categoryContainsFold,omitempty"` + // annotation field predicates + Annotation *string `json:"annotation,omitempty"` + AnnotationNeq *string `json:"annotationNEQ,omitempty"` + AnnotationIn []string `json:"annotationIn,omitempty"` + AnnotationNotIn []string `json:"annotationNotIn,omitempty"` + AnnotationGt *string `json:"annotationGT,omitempty"` + AnnotationGte *string `json:"annotationGTE,omitempty"` + AnnotationLt *string `json:"annotationLT,omitempty"` + AnnotationLte *string `json:"annotationLTE,omitempty"` + AnnotationContains *string `json:"annotationContains,omitempty"` + AnnotationHasPrefix *string `json:"annotationHasPrefix,omitempty"` + AnnotationHasSuffix *string `json:"annotationHasSuffix,omitempty"` + AnnotationIsNil *bool `json:"annotationIsNil,omitempty"` + AnnotationNotNil *bool `json:"annotationNotNil,omitempty"` + AnnotationEqualFold *string `json:"annotationEqualFold,omitempty"` + AnnotationContainsFold *string `json:"annotationContainsFold,omitempty"` +} + +// Return response for updateFile mutation +type FileUpdatePayload struct { + // Updated file + File *File `json:"file"` +} + +// FileWhereInput is used for filtering File objects. +// Input was generated by ent. +type FileWhereInput struct { + Not *FileWhereInput `json:"not,omitempty"` + And []*FileWhereInput `json:"and,omitempty"` + Or []*FileWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // file_name field predicates + FileName *string `json:"fileName,omitempty"` + FileNameNeq *string `json:"fileNameNEQ,omitempty"` + FileNameIn []string `json:"fileNameIn,omitempty"` + FileNameNotIn []string `json:"fileNameNotIn,omitempty"` + FileNameGt *string `json:"fileNameGT,omitempty"` + FileNameGte *string `json:"fileNameGTE,omitempty"` + FileNameLt *string `json:"fileNameLT,omitempty"` + FileNameLte *string `json:"fileNameLTE,omitempty"` + FileNameContains *string `json:"fileNameContains,omitempty"` + FileNameHasPrefix *string `json:"fileNameHasPrefix,omitempty"` + FileNameHasSuffix *string `json:"fileNameHasSuffix,omitempty"` + FileNameEqualFold *string `json:"fileNameEqualFold,omitempty"` + FileNameContainsFold *string `json:"fileNameContainsFold,omitempty"` + // file_extension field predicates + FileExtension *string `json:"fileExtension,omitempty"` + FileExtensionNeq *string `json:"fileExtensionNEQ,omitempty"` + FileExtensionIn []string `json:"fileExtensionIn,omitempty"` + FileExtensionNotIn []string `json:"fileExtensionNotIn,omitempty"` + FileExtensionGt *string `json:"fileExtensionGT,omitempty"` + FileExtensionGte *string `json:"fileExtensionGTE,omitempty"` + FileExtensionLt *string `json:"fileExtensionLT,omitempty"` + FileExtensionLte *string `json:"fileExtensionLTE,omitempty"` + FileExtensionContains *string `json:"fileExtensionContains,omitempty"` + FileExtensionHasPrefix *string `json:"fileExtensionHasPrefix,omitempty"` + FileExtensionHasSuffix *string `json:"fileExtensionHasSuffix,omitempty"` + FileExtensionEqualFold *string `json:"fileExtensionEqualFold,omitempty"` + FileExtensionContainsFold *string `json:"fileExtensionContainsFold,omitempty"` + // file_size field predicates + FileSize *int64 `json:"fileSize,omitempty"` + FileSizeNeq *int64 `json:"fileSizeNEQ,omitempty"` + FileSizeIn []int64 `json:"fileSizeIn,omitempty"` + FileSizeNotIn []int64 `json:"fileSizeNotIn,omitempty"` + FileSizeGt *int64 `json:"fileSizeGT,omitempty"` + FileSizeGte *int64 `json:"fileSizeGTE,omitempty"` + FileSizeLt *int64 `json:"fileSizeLT,omitempty"` + FileSizeLte *int64 `json:"fileSizeLTE,omitempty"` + FileSizeIsNil *bool `json:"fileSizeIsNil,omitempty"` + FileSizeNotNil *bool `json:"fileSizeNotNil,omitempty"` + // content_type field predicates + ContentType *string `json:"contentType,omitempty"` + ContentTypeNeq *string `json:"contentTypeNEQ,omitempty"` + ContentTypeIn []string `json:"contentTypeIn,omitempty"` + ContentTypeNotIn []string `json:"contentTypeNotIn,omitempty"` + ContentTypeGt *string `json:"contentTypeGT,omitempty"` + ContentTypeGte *string `json:"contentTypeGTE,omitempty"` + ContentTypeLt *string `json:"contentTypeLT,omitempty"` + ContentTypeLte *string `json:"contentTypeLTE,omitempty"` + ContentTypeContains *string `json:"contentTypeContains,omitempty"` + ContentTypeHasPrefix *string `json:"contentTypeHasPrefix,omitempty"` + ContentTypeHasSuffix *string `json:"contentTypeHasSuffix,omitempty"` + ContentTypeEqualFold *string `json:"contentTypeEqualFold,omitempty"` + ContentTypeContainsFold *string `json:"contentTypeContainsFold,omitempty"` + // store_key field predicates + StoreKey *string `json:"storeKey,omitempty"` + StoreKeyNeq *string `json:"storeKeyNEQ,omitempty"` + StoreKeyIn []string `json:"storeKeyIn,omitempty"` + StoreKeyNotIn []string `json:"storeKeyNotIn,omitempty"` + StoreKeyGt *string `json:"storeKeyGT,omitempty"` + StoreKeyGte *string `json:"storeKeyGTE,omitempty"` + StoreKeyLt *string `json:"storeKeyLT,omitempty"` + StoreKeyLte *string `json:"storeKeyLTE,omitempty"` + StoreKeyContains *string `json:"storeKeyContains,omitempty"` + StoreKeyHasPrefix *string `json:"storeKeyHasPrefix,omitempty"` + StoreKeyHasSuffix *string `json:"storeKeyHasSuffix,omitempty"` + StoreKeyEqualFold *string `json:"storeKeyEqualFold,omitempty"` + StoreKeyContainsFold *string `json:"storeKeyContainsFold,omitempty"` + // category field predicates + Category *string `json:"category,omitempty"` + CategoryNeq *string `json:"categoryNEQ,omitempty"` + CategoryIn []string `json:"categoryIn,omitempty"` + CategoryNotIn []string `json:"categoryNotIn,omitempty"` + CategoryGt *string `json:"categoryGT,omitempty"` + CategoryGte *string `json:"categoryGTE,omitempty"` + CategoryLt *string `json:"categoryLT,omitempty"` + CategoryLte *string `json:"categoryLTE,omitempty"` + CategoryContains *string `json:"categoryContains,omitempty"` + CategoryHasPrefix *string `json:"categoryHasPrefix,omitempty"` + CategoryHasSuffix *string `json:"categoryHasSuffix,omitempty"` + CategoryIsNil *bool `json:"categoryIsNil,omitempty"` + CategoryNotNil *bool `json:"categoryNotNil,omitempty"` + CategoryEqualFold *string `json:"categoryEqualFold,omitempty"` + CategoryContainsFold *string `json:"categoryContainsFold,omitempty"` + // annotation field predicates + Annotation *string `json:"annotation,omitempty"` + AnnotationNeq *string `json:"annotationNEQ,omitempty"` + AnnotationIn []string `json:"annotationIn,omitempty"` + AnnotationNotIn []string `json:"annotationNotIn,omitempty"` + AnnotationGt *string `json:"annotationGT,omitempty"` + AnnotationGte *string `json:"annotationGTE,omitempty"` + AnnotationLt *string `json:"annotationLT,omitempty"` + AnnotationLte *string `json:"annotationLTE,omitempty"` + AnnotationContains *string `json:"annotationContains,omitempty"` + AnnotationHasPrefix *string `json:"annotationHasPrefix,omitempty"` + AnnotationHasSuffix *string `json:"annotationHasSuffix,omitempty"` + AnnotationIsNil *bool `json:"annotationIsNil,omitempty"` + AnnotationNotNil *bool `json:"annotationNotNil,omitempty"` + AnnotationEqualFold *string `json:"annotationEqualFold,omitempty"` + AnnotationContainsFold *string `json:"annotationContainsFold,omitempty"` + // user edge predicates + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // entity edge predicates + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` + // group edge predicates + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` +} + +type GlobalSearchResultConnection struct { + Page *PageInfo `json:"page"` + Nodes []GlobalSearchResult `json:"nodes"` +} + +type Group struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name"` + // the groups description + Description *string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName string `json:"displayName"` + Owner *Organization `json:"owner,omitempty"` + Setting *GroupSetting `json:"setting"` + Users []*User `json:"users,omitempty"` + Events []*Event `json:"events,omitempty"` + Integrations []*Integration `json:"integrations,omitempty"` + Files []*File `json:"files,omitempty"` + Members []*GroupMembership `json:"members,omitempty"` +} + +func (Group) IsNode() {} + +// Return response for createBulkGroup mutation +type GroupBulkCreatePayload struct { + // Created groups + Groups []*Group `json:"groups,omitempty"` +} + +// A connection to a list of items. +type GroupConnection struct { + // A list of edges. + Edges []*GroupEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createGroup mutation +type GroupCreatePayload struct { + // Created group + Group *Group `json:"group"` +} + +// Return response for deleteGroup mutation +type GroupDeletePayload struct { + // Deleted group ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type GroupEdge struct { + // The item at the end of the edge. + Node *Group `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type GroupHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name"` + // the groups description + Description *string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName string `json:"displayName"` +} + +func (GroupHistory) IsNode() {} + +// A connection to a list of items. +type GroupHistoryConnection struct { + // A list of edges. + Edges []*GroupHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type GroupHistoryEdge struct { + // The item at the end of the edge. + Node *GroupHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for GroupHistory connections +type GroupHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order GroupHistories. + Field GroupHistoryOrderField `json:"field"` +} + +// GroupHistoryWhereInput is used for filtering GroupHistory objects. +// Input was generated by ent. +type GroupHistoryWhereInput struct { + Not *GroupHistoryWhereInput `json:"not,omitempty"` + And []*GroupHistoryWhereInput `json:"and,omitempty"` + Or []*GroupHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` +} + +type GroupMembership struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + GroupID string `json:"groupID"` + UserID string `json:"userID"` + Group *Group `json:"group"` + User *User `json:"user"` + Events []*Event `json:"events,omitempty"` +} + +func (GroupMembership) IsNode() {} + +// Return response for createBulkGroupMembership mutation +type GroupMembershipBulkCreatePayload struct { + // Created groupMemberships + GroupMemberships []*GroupMembership `json:"groupMemberships,omitempty"` +} + +// A connection to a list of items. +type GroupMembershipConnection struct { + // A list of edges. + Edges []*GroupMembershipEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createGroupMembership mutation +type GroupMembershipCreatePayload struct { + // Created groupMembership + GroupMembership *GroupMembership `json:"groupMembership"` +} + +// Return response for deleteGroupMembership mutation +type GroupMembershipDeletePayload struct { + // Deleted groupMembership ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type GroupMembershipEdge struct { + // The item at the end of the edge. + Node *GroupMembership `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type GroupMembershipHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + GroupID string `json:"groupID"` + UserID string `json:"userID"` +} + +func (GroupMembershipHistory) IsNode() {} + +// A connection to a list of items. +type GroupMembershipHistoryConnection struct { + // A list of edges. + Edges []*GroupMembershipHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type GroupMembershipHistoryEdge struct { + // The item at the end of the edge. + Node *GroupMembershipHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// GroupMembershipHistoryWhereInput is used for filtering GroupMembershipHistory objects. +// Input was generated by ent. +type GroupMembershipHistoryWhereInput struct { + Not *GroupMembershipHistoryWhereInput `json:"not,omitempty"` + And []*GroupMembershipHistoryWhereInput `json:"and,omitempty"` + Or []*GroupMembershipHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + // group_id field predicates + GroupID *string `json:"groupID,omitempty"` + GroupIDNeq *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGt *string `json:"groupIDGT,omitempty"` + GroupIDGte *string `json:"groupIDGTE,omitempty"` + GroupIDLt *string `json:"groupIDLT,omitempty"` + GroupIDLte *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` +} + +// Return response for updateGroupMembership mutation +type GroupMembershipUpdatePayload struct { + // Updated groupMembership + GroupMembership *GroupMembership `json:"groupMembership"` +} + +// GroupMembershipWhereInput is used for filtering GroupMembership objects. +// Input was generated by ent. +type GroupMembershipWhereInput struct { + Not *GroupMembershipWhereInput `json:"not,omitempty"` + And []*GroupMembershipWhereInput `json:"and,omitempty"` + Or []*GroupMembershipWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + GroupID *string `json:"groupID,omitempty"` + UserID *string `json:"userID,omitempty"` +} + +// Ordering options for Group connections +type GroupOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Groups. + Field GroupOrderField `json:"field"` +} + +type GroupSearchResult struct { + Groups []*Group `json:"groups,omitempty"` +} + +func (GroupSearchResult) IsGlobalSearchResult() {} + +type GroupSetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility enums.Visibility `json:"visibility"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy enums.JoinPolicy `json:"joinPolicy"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + // the group id associated with the settings + GroupID *string `json:"groupID,omitempty"` + Group *Group `json:"group,omitempty"` +} + +func (GroupSetting) IsNode() {} + +// Return response for createBulkGroupSetting mutation +type GroupSettingBulkCreatePayload struct { + // Created groupSettings + GroupSettings []*GroupSetting `json:"groupSettings,omitempty"` +} + +// A connection to a list of items. +type GroupSettingConnection struct { + // A list of edges. + Edges []*GroupSettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createGroupSetting mutation +type GroupSettingCreatePayload struct { + // Created groupSetting + GroupSetting *GroupSetting `json:"groupSetting"` +} + +// Return response for deleteGroupSetting mutation +type GroupSettingDeletePayload struct { + // Deleted groupSetting ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type GroupSettingEdge struct { + // The item at the end of the edge. + Node *GroupSetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type GroupSettingHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility enums.Visibility `json:"visibility"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy enums.JoinPolicy `json:"joinPolicy"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + // the group id associated with the settings + GroupID *string `json:"groupID,omitempty"` +} + +func (GroupSettingHistory) IsNode() {} + +// A connection to a list of items. +type GroupSettingHistoryConnection struct { + // A list of edges. + Edges []*GroupSettingHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type GroupSettingHistoryEdge struct { + // The item at the end of the edge. + Node *GroupSettingHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// GroupSettingHistoryWhereInput is used for filtering GroupSettingHistory objects. +// Input was generated by ent. +type GroupSettingHistoryWhereInput struct { + Not *GroupSettingHistoryWhereInput `json:"not,omitempty"` + And []*GroupSettingHistoryWhereInput `json:"and,omitempty"` + Or []*GroupSettingHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // visibility field predicates + Visibility *enums.Visibility `json:"visibility,omitempty"` + VisibilityNeq *enums.Visibility `json:"visibilityNEQ,omitempty"` + VisibilityIn []enums.Visibility `json:"visibilityIn,omitempty"` + VisibilityNotIn []enums.Visibility `json:"visibilityNotIn,omitempty"` + // join_policy field predicates + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + JoinPolicyNeq *enums.JoinPolicy `json:"joinPolicyNEQ,omitempty"` + JoinPolicyIn []enums.JoinPolicy `json:"joinPolicyIn,omitempty"` + JoinPolicyNotIn []enums.JoinPolicy `json:"joinPolicyNotIn,omitempty"` + // sync_to_slack field predicates + SyncToSlack *bool `json:"syncToSlack,omitempty"` + SyncToSlackNeq *bool `json:"syncToSlackNEQ,omitempty"` + SyncToSlackIsNil *bool `json:"syncToSlackIsNil,omitempty"` + SyncToSlackNotNil *bool `json:"syncToSlackNotNil,omitempty"` + // sync_to_github field predicates + SyncToGithub *bool `json:"syncToGithub,omitempty"` + SyncToGithubNeq *bool `json:"syncToGithubNEQ,omitempty"` + SyncToGithubIsNil *bool `json:"syncToGithubIsNil,omitempty"` + SyncToGithubNotNil *bool `json:"syncToGithubNotNil,omitempty"` + // group_id field predicates + GroupID *string `json:"groupID,omitempty"` + GroupIDNeq *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGt *string `json:"groupIDGT,omitempty"` + GroupIDGte *string `json:"groupIDGTE,omitempty"` + GroupIDLt *string `json:"groupIDLT,omitempty"` + GroupIDLte *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDIsNil *bool `json:"groupIDIsNil,omitempty"` + GroupIDNotNil *bool `json:"groupIDNotNil,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` +} + +// Return response for updateGroupSetting mutation +type GroupSettingUpdatePayload struct { + // Updated groupSetting + GroupSetting *GroupSetting `json:"groupSetting"` +} + +// GroupSettingWhereInput is used for filtering GroupSetting objects. +// Input was generated by ent. +type GroupSettingWhereInput struct { + Not *GroupSettingWhereInput `json:"not,omitempty"` + And []*GroupSettingWhereInput `json:"and,omitempty"` + Or []*GroupSettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // visibility field predicates + Visibility *enums.Visibility `json:"visibility,omitempty"` + VisibilityNeq *enums.Visibility `json:"visibilityNEQ,omitempty"` + VisibilityIn []enums.Visibility `json:"visibilityIn,omitempty"` + VisibilityNotIn []enums.Visibility `json:"visibilityNotIn,omitempty"` + // join_policy field predicates + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + JoinPolicyNeq *enums.JoinPolicy `json:"joinPolicyNEQ,omitempty"` + JoinPolicyIn []enums.JoinPolicy `json:"joinPolicyIn,omitempty"` + JoinPolicyNotIn []enums.JoinPolicy `json:"joinPolicyNotIn,omitempty"` + // sync_to_slack field predicates + SyncToSlack *bool `json:"syncToSlack,omitempty"` + SyncToSlackNeq *bool `json:"syncToSlackNEQ,omitempty"` + SyncToSlackIsNil *bool `json:"syncToSlackIsNil,omitempty"` + SyncToSlackNotNil *bool `json:"syncToSlackNotNil,omitempty"` + // sync_to_github field predicates + SyncToGithub *bool `json:"syncToGithub,omitempty"` + SyncToGithubNeq *bool `json:"syncToGithubNEQ,omitempty"` + SyncToGithubIsNil *bool `json:"syncToGithubIsNil,omitempty"` + SyncToGithubNotNil *bool `json:"syncToGithubNotNil,omitempty"` + // group_id field predicates + GroupID *string `json:"groupID,omitempty"` + GroupIDNeq *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGt *string `json:"groupIDGT,omitempty"` + GroupIDGte *string `json:"groupIDGTE,omitempty"` + GroupIDLt *string `json:"groupIDLT,omitempty"` + GroupIDLte *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDIsNil *bool `json:"groupIDIsNil,omitempty"` + GroupIDNotNil *bool `json:"groupIDNotNil,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` + // group edge predicates + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` +} + +// Return response for updateGroup mutation +type GroupUpdatePayload struct { + // Updated group + Group *Group `json:"group"` +} + +// GroupWhereInput is used for filtering Group objects. +// Input was generated by ent. +type GroupWhereInput struct { + Not *GroupWhereInput `json:"not,omitempty"` + And []*GroupWhereInput `json:"and,omitempty"` + Or []*GroupWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // setting edge predicates + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*GroupSettingWhereInput `json:"hasSettingWith,omitempty"` + // users edge predicates + HasUsers *bool `json:"hasUsers,omitempty"` + HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // members edge predicates + HasMembers *bool `json:"hasMembers,omitempty"` + HasMembersWith []*GroupMembershipWhereInput `json:"hasMembersWith,omitempty"` +} + +type Hush struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName *string `json:"secretName,omitempty"` + // the integration associated with the secret + Integrations []*Integration `json:"integrations,omitempty"` + Organization []*Organization `json:"organization,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (Hush) IsNode() {} + +// Return response for createBulkHush mutation +type HushBulkCreatePayload struct { + // Created hushs + Hushes []*Hush `json:"hushes,omitempty"` +} + +// A connection to a list of items. +type HushConnection struct { + // A list of edges. + Edges []*HushEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createHush mutation +type HushCreatePayload struct { + // Created hush + Hush *Hush `json:"hush"` +} + +// Return response for deleteHush mutation +type HushDeletePayload struct { + // Deleted hush ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type HushEdge struct { + // The item at the end of the edge. + Node *Hush `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type HushHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName *string `json:"secretName,omitempty"` +} + +func (HushHistory) IsNode() {} + +// A connection to a list of items. +type HushHistoryConnection struct { + // A list of edges. + Edges []*HushHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type HushHistoryEdge struct { + // The item at the end of the edge. + Node *HushHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for HushHistory connections +type HushHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order HushHistories. + Field HushHistoryOrderField `json:"field"` +} + +// HushHistoryWhereInput is used for filtering HushHistory objects. +// Input was generated by ent. +type HushHistoryWhereInput struct { + Not *HushHistoryWhereInput `json:"not,omitempty"` + And []*HushHistoryWhereInput `json:"and,omitempty"` + Or []*HushHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + // secret_name field predicates + SecretName *string `json:"secretName,omitempty"` + SecretNameNeq *string `json:"secretNameNEQ,omitempty"` + SecretNameIn []string `json:"secretNameIn,omitempty"` + SecretNameNotIn []string `json:"secretNameNotIn,omitempty"` + SecretNameGt *string `json:"secretNameGT,omitempty"` + SecretNameGte *string `json:"secretNameGTE,omitempty"` + SecretNameLt *string `json:"secretNameLT,omitempty"` + SecretNameLte *string `json:"secretNameLTE,omitempty"` + SecretNameContains *string `json:"secretNameContains,omitempty"` + SecretNameHasPrefix *string `json:"secretNameHasPrefix,omitempty"` + SecretNameHasSuffix *string `json:"secretNameHasSuffix,omitempty"` + SecretNameIsNil *bool `json:"secretNameIsNil,omitempty"` + SecretNameNotNil *bool `json:"secretNameNotNil,omitempty"` + SecretNameEqualFold *string `json:"secretNameEqualFold,omitempty"` + SecretNameContainsFold *string `json:"secretNameContainsFold,omitempty"` +} + +// Ordering options for Hush connections +type HushOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Hushes. + Field HushOrderField `json:"field"` +} + +// Return response for updateHush mutation +type HushUpdatePayload struct { + // Updated hush + Hush *Hush `json:"hush"` +} + +// HushWhereInput is used for filtering Hush objects. +// Input was generated by ent. +type HushWhereInput struct { + Not *HushWhereInput `json:"not,omitempty"` + And []*HushWhereInput `json:"and,omitempty"` + Or []*HushWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + // secret_name field predicates + SecretName *string `json:"secretName,omitempty"` + SecretNameNeq *string `json:"secretNameNEQ,omitempty"` + SecretNameIn []string `json:"secretNameIn,omitempty"` + SecretNameNotIn []string `json:"secretNameNotIn,omitempty"` + SecretNameGt *string `json:"secretNameGT,omitempty"` + SecretNameGte *string `json:"secretNameGTE,omitempty"` + SecretNameLt *string `json:"secretNameLT,omitempty"` + SecretNameLte *string `json:"secretNameLTE,omitempty"` + SecretNameContains *string `json:"secretNameContains,omitempty"` + SecretNameHasPrefix *string `json:"secretNameHasPrefix,omitempty"` + SecretNameHasSuffix *string `json:"secretNameHasSuffix,omitempty"` + SecretNameIsNil *bool `json:"secretNameIsNil,omitempty"` + SecretNameNotNil *bool `json:"secretNameNotNil,omitempty"` + SecretNameEqualFold *string `json:"secretNameEqualFold,omitempty"` + SecretNameContainsFold *string `json:"secretNameContainsFold,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Integration struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name"` + // a description of the integration + Description *string `json:"description,omitempty"` + Kind *string `json:"kind,omitempty"` + Owner *Organization `json:"owner,omitempty"` + // the secrets associated with the integration + Secrets []*Hush `json:"secrets,omitempty"` + // the oauth2 tokens associated with the integration + Oauth2tokens []*OhAuthTooToken `json:"oauth2tokens,omitempty"` + Events []*Event `json:"events,omitempty"` + Webhooks []*Webhook `json:"webhooks,omitempty"` +} + +func (Integration) IsNode() {} + +// Return response for createBulkIntegration mutation +type IntegrationBulkCreatePayload struct { + // Created integrations + Integrations []*Integration `json:"integrations,omitempty"` +} + +// A connection to a list of items. +type IntegrationConnection struct { + // A list of edges. + Edges []*IntegrationEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createIntegration mutation +type IntegrationCreatePayload struct { + // Created integration + Integration *Integration `json:"integration"` +} + +// Return response for deleteIntegration mutation +type IntegrationDeletePayload struct { + // Deleted integration ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type IntegrationEdge struct { + // The item at the end of the edge. + Node *Integration `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type IntegrationHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name"` + // a description of the integration + Description *string `json:"description,omitempty"` + Kind *string `json:"kind,omitempty"` +} + +func (IntegrationHistory) IsNode() {} + +// A connection to a list of items. +type IntegrationHistoryConnection struct { + // A list of edges. + Edges []*IntegrationHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type IntegrationHistoryEdge struct { + // The item at the end of the edge. + Node *IntegrationHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for IntegrationHistory connections +type IntegrationHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order IntegrationHistories. + Field IntegrationHistoryOrderField `json:"field"` +} + +// IntegrationHistoryWhereInput is used for filtering IntegrationHistory objects. +// Input was generated by ent. +type IntegrationHistoryWhereInput struct { + Not *IntegrationHistoryWhereInput `json:"not,omitempty"` + And []*IntegrationHistoryWhereInput `json:"and,omitempty"` + Or []*IntegrationHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` +} + +// Ordering options for Integration connections +type IntegrationOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Integrations. + Field IntegrationOrderField `json:"field"` +} + +// Return response for updateIntegration mutation +type IntegrationUpdatePayload struct { + // Updated integration + Integration *Integration `json:"integration"` +} + +// IntegrationWhereInput is used for filtering Integration objects. +// Input was generated by ent. +type IntegrationWhereInput struct { + Not *IntegrationWhereInput `json:"not,omitempty"` + And []*IntegrationWhereInput `json:"and,omitempty"` + Or []*IntegrationWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // secrets edge predicates + HasSecrets *bool `json:"hasSecrets,omitempty"` + HasSecretsWith []*HushWhereInput `json:"hasSecretsWith,omitempty"` + // oauth2tokens edge predicates + HasOauth2tokens *bool `json:"hasOauth2tokens,omitempty"` + HasOauth2tokensWith []*OhAuthTooTokenWhereInput `json:"hasOauth2tokensWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // webhooks edge predicates + HasWebhooks *bool `json:"hasWebhooks,omitempty"` + HasWebhooksWith []*WebhookWhereInput `json:"hasWebhooksWith,omitempty"` +} + +type Invite struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the expiration date of the invitation token which defaults to 14 days in the future from creation + Expires *time.Time `json:"expires,omitempty"` + // the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + Recipient string `json:"recipient"` + // the status of the invitation + Status enums.InviteStatus `json:"status"` + Role enums.Role `json:"role"` + // the number of attempts made to perform email send of the invitation, maximum of 5 + SendAttempts int64 `json:"sendAttempts"` + // the user who initiated the invitation + RequestorID *string `json:"requestorID,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (Invite) IsNode() {} + +// Return response for createBulkInvite mutation +type InviteBulkCreatePayload struct { + // Created invites + Invites []*Invite `json:"invites,omitempty"` +} + +// A connection to a list of items. +type InviteConnection struct { + // A list of edges. + Edges []*InviteEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createInvite mutation +type InviteCreatePayload struct { + // Created invite + Invite *Invite `json:"invite"` +} + +// Return response for deleteInvite mutation +type InviteDeletePayload struct { + // Deleted invite ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type InviteEdge struct { + // The item at the end of the edge. + Node *Invite `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateInvite mutation +type InviteUpdatePayload struct { + // Updated invite + Invite *Invite `json:"invite"` +} + +// InviteWhereInput is used for filtering Invite objects. +// Input was generated by ent. +type InviteWhereInput struct { + Not *InviteWhereInput `json:"not,omitempty"` + And []*InviteWhereInput `json:"and,omitempty"` + Or []*InviteWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // expires field predicates + Expires *time.Time `json:"expires,omitempty"` + ExpiresNeq *time.Time `json:"expiresNEQ,omitempty"` + ExpiresIn []*time.Time `json:"expiresIn,omitempty"` + ExpiresNotIn []*time.Time `json:"expiresNotIn,omitempty"` + ExpiresGt *time.Time `json:"expiresGT,omitempty"` + ExpiresGte *time.Time `json:"expiresGTE,omitempty"` + ExpiresLt *time.Time `json:"expiresLT,omitempty"` + ExpiresLte *time.Time `json:"expiresLTE,omitempty"` + ExpiresIsNil *bool `json:"expiresIsNil,omitempty"` + ExpiresNotNil *bool `json:"expiresNotNil,omitempty"` + // recipient field predicates + Recipient *string `json:"recipient,omitempty"` + RecipientNeq *string `json:"recipientNEQ,omitempty"` + RecipientIn []string `json:"recipientIn,omitempty"` + RecipientNotIn []string `json:"recipientNotIn,omitempty"` + RecipientGt *string `json:"recipientGT,omitempty"` + RecipientGte *string `json:"recipientGTE,omitempty"` + RecipientLt *string `json:"recipientLT,omitempty"` + RecipientLte *string `json:"recipientLTE,omitempty"` + RecipientContains *string `json:"recipientContains,omitempty"` + RecipientHasPrefix *string `json:"recipientHasPrefix,omitempty"` + RecipientHasSuffix *string `json:"recipientHasSuffix,omitempty"` + RecipientEqualFold *string `json:"recipientEqualFold,omitempty"` + RecipientContainsFold *string `json:"recipientContainsFold,omitempty"` + // status field predicates + Status *enums.InviteStatus `json:"status,omitempty"` + StatusNeq *enums.InviteStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.InviteStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.InviteStatus `json:"statusNotIn,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + // send_attempts field predicates + SendAttempts *int64 `json:"sendAttempts,omitempty"` + SendAttemptsNeq *int64 `json:"sendAttemptsNEQ,omitempty"` + SendAttemptsIn []int64 `json:"sendAttemptsIn,omitempty"` + SendAttemptsNotIn []int64 `json:"sendAttemptsNotIn,omitempty"` + SendAttemptsGt *int64 `json:"sendAttemptsGT,omitempty"` + SendAttemptsGte *int64 `json:"sendAttemptsGTE,omitempty"` + SendAttemptsLt *int64 `json:"sendAttemptsLT,omitempty"` + SendAttemptsLte *int64 `json:"sendAttemptsLTE,omitempty"` + // requestor_id field predicates + RequestorID *string `json:"requestorID,omitempty"` + RequestorIDNeq *string `json:"requestorIDNEQ,omitempty"` + RequestorIDIn []string `json:"requestorIDIn,omitempty"` + RequestorIDNotIn []string `json:"requestorIDNotIn,omitempty"` + RequestorIDGt *string `json:"requestorIDGT,omitempty"` + RequestorIDGte *string `json:"requestorIDGTE,omitempty"` + RequestorIDLt *string `json:"requestorIDLT,omitempty"` + RequestorIDLte *string `json:"requestorIDLTE,omitempty"` + RequestorIDContains *string `json:"requestorIDContains,omitempty"` + RequestorIDHasPrefix *string `json:"requestorIDHasPrefix,omitempty"` + RequestorIDHasSuffix *string `json:"requestorIDHasSuffix,omitempty"` + RequestorIDIsNil *bool `json:"requestorIDIsNil,omitempty"` + RequestorIDNotNil *bool `json:"requestorIDNotNil,omitempty"` + RequestorIDEqualFold *string `json:"requestorIDEqualFold,omitempty"` + RequestorIDContainsFold *string `json:"requestorIDContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Mutation struct { +} + +type Note struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the text of the note + Text string `json:"text"` + Owner *Organization `json:"owner,omitempty"` + Entity *Entity `json:"entity,omitempty"` +} + +func (Note) IsNode() {} + +// A connection to a list of items. +type NoteConnection struct { + // A list of edges. + Edges []*NoteEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type NoteEdge struct { + // The item at the end of the edge. + Node *Note `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type NoteHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the text of the note + Text string `json:"text"` +} + +func (NoteHistory) IsNode() {} + +// A connection to a list of items. +type NoteHistoryConnection struct { + // A list of edges. + Edges []*NoteHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type NoteHistoryEdge struct { + // The item at the end of the edge. + Node *NoteHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// NoteHistoryWhereInput is used for filtering NoteHistory objects. +// Input was generated by ent. +type NoteHistoryWhereInput struct { + Not *NoteHistoryWhereInput `json:"not,omitempty"` + And []*NoteHistoryWhereInput `json:"and,omitempty"` + Or []*NoteHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // text field predicates + Text *string `json:"text,omitempty"` + TextNeq *string `json:"textNEQ,omitempty"` + TextIn []string `json:"textIn,omitempty"` + TextNotIn []string `json:"textNotIn,omitempty"` + TextGt *string `json:"textGT,omitempty"` + TextGte *string `json:"textGTE,omitempty"` + TextLt *string `json:"textLT,omitempty"` + TextLte *string `json:"textLTE,omitempty"` + TextContains *string `json:"textContains,omitempty"` + TextHasPrefix *string `json:"textHasPrefix,omitempty"` + TextHasSuffix *string `json:"textHasSuffix,omitempty"` + TextEqualFold *string `json:"textEqualFold,omitempty"` + TextContainsFold *string `json:"textContainsFold,omitempty"` +} + +// NoteWhereInput is used for filtering Note objects. +// Input was generated by ent. +type NoteWhereInput struct { + Not *NoteWhereInput `json:"not,omitempty"` + And []*NoteWhereInput `json:"and,omitempty"` + Or []*NoteWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // text field predicates + Text *string `json:"text,omitempty"` + TextNeq *string `json:"textNEQ,omitempty"` + TextIn []string `json:"textIn,omitempty"` + TextNotIn []string `json:"textNotIn,omitempty"` + TextGt *string `json:"textGT,omitempty"` + TextGte *string `json:"textGTE,omitempty"` + TextLt *string `json:"textLT,omitempty"` + TextLte *string `json:"textLTE,omitempty"` + TextContains *string `json:"textContains,omitempty"` + TextHasPrefix *string `json:"textHasPrefix,omitempty"` + TextHasSuffix *string `json:"textHasSuffix,omitempty"` + TextEqualFold *string `json:"textEqualFold,omitempty"` + TextContainsFold *string `json:"textContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entity edge predicates + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` +} + +type OauthProvider struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the oauth provider's name + Name string `json:"name"` + // the client id for the oauth provider + ClientID string `json:"clientID"` + // the client secret + ClientSecret string `json:"clientSecret"` + // the redirect url + RedirectURL string `json:"redirectURL"` + // the scopes + Scopes string `json:"scopes"` + // the auth url of the provider + AuthURL string `json:"authURL"` + // the token url of the provider + TokenURL string `json:"tokenURL"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle string `json:"authStyle"` + // the URL to request user information by token + InfoURL string `json:"infoURL"` + Owner *Organization `json:"owner,omitempty"` +} + +func (OauthProvider) IsNode() {} + +// Return response for createBulkOauthProvider mutation +type OauthProviderBulkCreatePayload struct { + // Created oauthProviders + OauthProviders []*OauthProvider `json:"oauthProviders,omitempty"` +} + +// A connection to a list of items. +type OauthProviderConnection struct { + // A list of edges. + Edges []*OauthProviderEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOauthProvider mutation +type OauthProviderCreatePayload struct { + // Created oauthProvider + OauthProvider *OauthProvider `json:"oauthProvider"` +} + +// Return response for deleteOauthProvider mutation +type OauthProviderDeletePayload struct { + // Deleted oauthProvider ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OauthProviderEdge struct { + // The item at the end of the edge. + Node *OauthProvider `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OauthProviderHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the oauth provider's name + Name string `json:"name"` + // the client id for the oauth provider + ClientID string `json:"clientID"` + // the client secret + ClientSecret string `json:"clientSecret"` + // the redirect url + RedirectURL string `json:"redirectURL"` + // the scopes + Scopes string `json:"scopes"` + // the auth url of the provider + AuthURL string `json:"authURL"` + // the token url of the provider + TokenURL string `json:"tokenURL"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle string `json:"authStyle"` + // the URL to request user information by token + InfoURL string `json:"infoURL"` +} + +func (OauthProviderHistory) IsNode() {} + +// A connection to a list of items. +type OauthProviderHistoryConnection struct { + // A list of edges. + Edges []*OauthProviderHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OauthProviderHistoryEdge struct { + // The item at the end of the edge. + Node *OauthProviderHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// OauthProviderHistoryWhereInput is used for filtering OauthProviderHistory objects. +// Input was generated by ent. +type OauthProviderHistoryWhereInput struct { + Not *OauthProviderHistoryWhereInput `json:"not,omitempty"` + And []*OauthProviderHistoryWhereInput `json:"and,omitempty"` + Or []*OauthProviderHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // client_id field predicates + ClientID *string `json:"clientID,omitempty"` + ClientIDNeq *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGt *string `json:"clientIDGT,omitempty"` + ClientIDGte *string `json:"clientIDGTE,omitempty"` + ClientIDLt *string `json:"clientIDLT,omitempty"` + ClientIDLte *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + // client_secret field predicates + ClientSecret *string `json:"clientSecret,omitempty"` + ClientSecretNeq *string `json:"clientSecretNEQ,omitempty"` + ClientSecretIn []string `json:"clientSecretIn,omitempty"` + ClientSecretNotIn []string `json:"clientSecretNotIn,omitempty"` + ClientSecretGt *string `json:"clientSecretGT,omitempty"` + ClientSecretGte *string `json:"clientSecretGTE,omitempty"` + ClientSecretLt *string `json:"clientSecretLT,omitempty"` + ClientSecretLte *string `json:"clientSecretLTE,omitempty"` + ClientSecretContains *string `json:"clientSecretContains,omitempty"` + ClientSecretHasPrefix *string `json:"clientSecretHasPrefix,omitempty"` + ClientSecretHasSuffix *string `json:"clientSecretHasSuffix,omitempty"` + ClientSecretEqualFold *string `json:"clientSecretEqualFold,omitempty"` + ClientSecretContainsFold *string `json:"clientSecretContainsFold,omitempty"` + // redirect_url field predicates + RedirectURL *string `json:"redirectURL,omitempty"` + RedirectURLNeq *string `json:"redirectURLNEQ,omitempty"` + RedirectURLIn []string `json:"redirectURLIn,omitempty"` + RedirectURLNotIn []string `json:"redirectURLNotIn,omitempty"` + RedirectURLGt *string `json:"redirectURLGT,omitempty"` + RedirectURLGte *string `json:"redirectURLGTE,omitempty"` + RedirectURLLt *string `json:"redirectURLLT,omitempty"` + RedirectURLLte *string `json:"redirectURLLTE,omitempty"` + RedirectURLContains *string `json:"redirectURLContains,omitempty"` + RedirectURLHasPrefix *string `json:"redirectURLHasPrefix,omitempty"` + RedirectURLHasSuffix *string `json:"redirectURLHasSuffix,omitempty"` + RedirectURLEqualFold *string `json:"redirectURLEqualFold,omitempty"` + RedirectURLContainsFold *string `json:"redirectURLContainsFold,omitempty"` + // scopes field predicates + Scopes *string `json:"scopes,omitempty"` + ScopesNeq *string `json:"scopesNEQ,omitempty"` + ScopesIn []string `json:"scopesIn,omitempty"` + ScopesNotIn []string `json:"scopesNotIn,omitempty"` + ScopesGt *string `json:"scopesGT,omitempty"` + ScopesGte *string `json:"scopesGTE,omitempty"` + ScopesLt *string `json:"scopesLT,omitempty"` + ScopesLte *string `json:"scopesLTE,omitempty"` + ScopesContains *string `json:"scopesContains,omitempty"` + ScopesHasPrefix *string `json:"scopesHasPrefix,omitempty"` + ScopesHasSuffix *string `json:"scopesHasSuffix,omitempty"` + ScopesEqualFold *string `json:"scopesEqualFold,omitempty"` + ScopesContainsFold *string `json:"scopesContainsFold,omitempty"` + // auth_url field predicates + AuthURL *string `json:"authURL,omitempty"` + AuthURLNeq *string `json:"authURLNEQ,omitempty"` + AuthURLIn []string `json:"authURLIn,omitempty"` + AuthURLNotIn []string `json:"authURLNotIn,omitempty"` + AuthURLGt *string `json:"authURLGT,omitempty"` + AuthURLGte *string `json:"authURLGTE,omitempty"` + AuthURLLt *string `json:"authURLLT,omitempty"` + AuthURLLte *string `json:"authURLLTE,omitempty"` + AuthURLContains *string `json:"authURLContains,omitempty"` + AuthURLHasPrefix *string `json:"authURLHasPrefix,omitempty"` + AuthURLHasSuffix *string `json:"authURLHasSuffix,omitempty"` + AuthURLEqualFold *string `json:"authURLEqualFold,omitempty"` + AuthURLContainsFold *string `json:"authURLContainsFold,omitempty"` + // token_url field predicates + TokenURL *string `json:"tokenURL,omitempty"` + TokenURLNeq *string `json:"tokenURLNEQ,omitempty"` + TokenURLIn []string `json:"tokenURLIn,omitempty"` + TokenURLNotIn []string `json:"tokenURLNotIn,omitempty"` + TokenURLGt *string `json:"tokenURLGT,omitempty"` + TokenURLGte *string `json:"tokenURLGTE,omitempty"` + TokenURLLt *string `json:"tokenURLLT,omitempty"` + TokenURLLte *string `json:"tokenURLLTE,omitempty"` + TokenURLContains *string `json:"tokenURLContains,omitempty"` + TokenURLHasPrefix *string `json:"tokenURLHasPrefix,omitempty"` + TokenURLHasSuffix *string `json:"tokenURLHasSuffix,omitempty"` + TokenURLEqualFold *string `json:"tokenURLEqualFold,omitempty"` + TokenURLContainsFold *string `json:"tokenURLContainsFold,omitempty"` + // auth_style field predicates + AuthStyle *string `json:"authStyle,omitempty"` + AuthStyleNeq *string `json:"authStyleNEQ,omitempty"` + AuthStyleIn []string `json:"authStyleIn,omitempty"` + AuthStyleNotIn []string `json:"authStyleNotIn,omitempty"` + AuthStyleGt *string `json:"authStyleGT,omitempty"` + AuthStyleGte *string `json:"authStyleGTE,omitempty"` + AuthStyleLt *string `json:"authStyleLT,omitempty"` + AuthStyleLte *string `json:"authStyleLTE,omitempty"` + // info_url field predicates + InfoURL *string `json:"infoURL,omitempty"` + InfoURLNeq *string `json:"infoURLNEQ,omitempty"` + InfoURLIn []string `json:"infoURLIn,omitempty"` + InfoURLNotIn []string `json:"infoURLNotIn,omitempty"` + InfoURLGt *string `json:"infoURLGT,omitempty"` + InfoURLGte *string `json:"infoURLGTE,omitempty"` + InfoURLLt *string `json:"infoURLLT,omitempty"` + InfoURLLte *string `json:"infoURLLTE,omitempty"` + InfoURLContains *string `json:"infoURLContains,omitempty"` + InfoURLHasPrefix *string `json:"infoURLHasPrefix,omitempty"` + InfoURLHasSuffix *string `json:"infoURLHasSuffix,omitempty"` + InfoURLEqualFold *string `json:"infoURLEqualFold,omitempty"` + InfoURLContainsFold *string `json:"infoURLContainsFold,omitempty"` +} + +// Return response for updateOauthProvider mutation +type OauthProviderUpdatePayload struct { + // Updated oauthProvider + OauthProvider *OauthProvider `json:"oauthProvider"` +} + +// OauthProviderWhereInput is used for filtering OauthProvider objects. +// Input was generated by ent. +type OauthProviderWhereInput struct { + Not *OauthProviderWhereInput `json:"not,omitempty"` + And []*OauthProviderWhereInput `json:"and,omitempty"` + Or []*OauthProviderWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // client_id field predicates + ClientID *string `json:"clientID,omitempty"` + ClientIDNeq *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGt *string `json:"clientIDGT,omitempty"` + ClientIDGte *string `json:"clientIDGTE,omitempty"` + ClientIDLt *string `json:"clientIDLT,omitempty"` + ClientIDLte *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + // client_secret field predicates + ClientSecret *string `json:"clientSecret,omitempty"` + ClientSecretNeq *string `json:"clientSecretNEQ,omitempty"` + ClientSecretIn []string `json:"clientSecretIn,omitempty"` + ClientSecretNotIn []string `json:"clientSecretNotIn,omitempty"` + ClientSecretGt *string `json:"clientSecretGT,omitempty"` + ClientSecretGte *string `json:"clientSecretGTE,omitempty"` + ClientSecretLt *string `json:"clientSecretLT,omitempty"` + ClientSecretLte *string `json:"clientSecretLTE,omitempty"` + ClientSecretContains *string `json:"clientSecretContains,omitempty"` + ClientSecretHasPrefix *string `json:"clientSecretHasPrefix,omitempty"` + ClientSecretHasSuffix *string `json:"clientSecretHasSuffix,omitempty"` + ClientSecretEqualFold *string `json:"clientSecretEqualFold,omitempty"` + ClientSecretContainsFold *string `json:"clientSecretContainsFold,omitempty"` + // redirect_url field predicates + RedirectURL *string `json:"redirectURL,omitempty"` + RedirectURLNeq *string `json:"redirectURLNEQ,omitempty"` + RedirectURLIn []string `json:"redirectURLIn,omitempty"` + RedirectURLNotIn []string `json:"redirectURLNotIn,omitempty"` + RedirectURLGt *string `json:"redirectURLGT,omitempty"` + RedirectURLGte *string `json:"redirectURLGTE,omitempty"` + RedirectURLLt *string `json:"redirectURLLT,omitempty"` + RedirectURLLte *string `json:"redirectURLLTE,omitempty"` + RedirectURLContains *string `json:"redirectURLContains,omitempty"` + RedirectURLHasPrefix *string `json:"redirectURLHasPrefix,omitempty"` + RedirectURLHasSuffix *string `json:"redirectURLHasSuffix,omitempty"` + RedirectURLEqualFold *string `json:"redirectURLEqualFold,omitempty"` + RedirectURLContainsFold *string `json:"redirectURLContainsFold,omitempty"` + // scopes field predicates + Scopes *string `json:"scopes,omitempty"` + ScopesNeq *string `json:"scopesNEQ,omitempty"` + ScopesIn []string `json:"scopesIn,omitempty"` + ScopesNotIn []string `json:"scopesNotIn,omitempty"` + ScopesGt *string `json:"scopesGT,omitempty"` + ScopesGte *string `json:"scopesGTE,omitempty"` + ScopesLt *string `json:"scopesLT,omitempty"` + ScopesLte *string `json:"scopesLTE,omitempty"` + ScopesContains *string `json:"scopesContains,omitempty"` + ScopesHasPrefix *string `json:"scopesHasPrefix,omitempty"` + ScopesHasSuffix *string `json:"scopesHasSuffix,omitempty"` + ScopesEqualFold *string `json:"scopesEqualFold,omitempty"` + ScopesContainsFold *string `json:"scopesContainsFold,omitempty"` + // auth_url field predicates + AuthURL *string `json:"authURL,omitempty"` + AuthURLNeq *string `json:"authURLNEQ,omitempty"` + AuthURLIn []string `json:"authURLIn,omitempty"` + AuthURLNotIn []string `json:"authURLNotIn,omitempty"` + AuthURLGt *string `json:"authURLGT,omitempty"` + AuthURLGte *string `json:"authURLGTE,omitempty"` + AuthURLLt *string `json:"authURLLT,omitempty"` + AuthURLLte *string `json:"authURLLTE,omitempty"` + AuthURLContains *string `json:"authURLContains,omitempty"` + AuthURLHasPrefix *string `json:"authURLHasPrefix,omitempty"` + AuthURLHasSuffix *string `json:"authURLHasSuffix,omitempty"` + AuthURLEqualFold *string `json:"authURLEqualFold,omitempty"` + AuthURLContainsFold *string `json:"authURLContainsFold,omitempty"` + // token_url field predicates + TokenURL *string `json:"tokenURL,omitempty"` + TokenURLNeq *string `json:"tokenURLNEQ,omitempty"` + TokenURLIn []string `json:"tokenURLIn,omitempty"` + TokenURLNotIn []string `json:"tokenURLNotIn,omitempty"` + TokenURLGt *string `json:"tokenURLGT,omitempty"` + TokenURLGte *string `json:"tokenURLGTE,omitempty"` + TokenURLLt *string `json:"tokenURLLT,omitempty"` + TokenURLLte *string `json:"tokenURLLTE,omitempty"` + TokenURLContains *string `json:"tokenURLContains,omitempty"` + TokenURLHasPrefix *string `json:"tokenURLHasPrefix,omitempty"` + TokenURLHasSuffix *string `json:"tokenURLHasSuffix,omitempty"` + TokenURLEqualFold *string `json:"tokenURLEqualFold,omitempty"` + TokenURLContainsFold *string `json:"tokenURLContainsFold,omitempty"` + // auth_style field predicates + AuthStyle *string `json:"authStyle,omitempty"` + AuthStyleNeq *string `json:"authStyleNEQ,omitempty"` + AuthStyleIn []string `json:"authStyleIn,omitempty"` + AuthStyleNotIn []string `json:"authStyleNotIn,omitempty"` + AuthStyleGt *string `json:"authStyleGT,omitempty"` + AuthStyleGte *string `json:"authStyleGTE,omitempty"` + AuthStyleLt *string `json:"authStyleLT,omitempty"` + AuthStyleLte *string `json:"authStyleLTE,omitempty"` + // info_url field predicates + InfoURL *string `json:"infoURL,omitempty"` + InfoURLNeq *string `json:"infoURLNEQ,omitempty"` + InfoURLIn []string `json:"infoURLIn,omitempty"` + InfoURLNotIn []string `json:"infoURLNotIn,omitempty"` + InfoURLGt *string `json:"infoURLGT,omitempty"` + InfoURLGte *string `json:"infoURLGTE,omitempty"` + InfoURLLt *string `json:"infoURLLT,omitempty"` + InfoURLLte *string `json:"infoURLLTE,omitempty"` + InfoURLContains *string `json:"infoURLContains,omitempty"` + InfoURLHasPrefix *string `json:"infoURLHasPrefix,omitempty"` + InfoURLHasSuffix *string `json:"infoURLHasSuffix,omitempty"` + InfoURLEqualFold *string `json:"infoURLEqualFold,omitempty"` + InfoURLContainsFold *string `json:"infoURLContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` +} + +type OhAuthTooToken struct { + ID string `json:"id"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + ClientID string `json:"clientID"` + Scopes []string `json:"scopes,omitempty"` + Nonce string `json:"nonce"` + ClaimsUserID string `json:"claimsUserID"` + ClaimsUsername string `json:"claimsUsername"` + ClaimsEmail string `json:"claimsEmail"` + ClaimsEmailVerified bool `json:"claimsEmailVerified"` + ClaimsGroups []string `json:"claimsGroups,omitempty"` + ClaimsPreferredUsername string `json:"claimsPreferredUsername"` + ConnectorID string `json:"connectorID"` + ConnectorData []string `json:"connectorData,omitempty"` + LastUsed time.Time `json:"lastUsed"` + Integration []*Integration `json:"integration,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (OhAuthTooToken) IsNode() {} + +// Return response for createBulkOhAuthTooToken mutation +type OhAuthTooTokenBulkCreatePayload struct { + // Created ohAuthTooTokens + OhAuthTooTokens []*OhAuthTooToken `json:"ohAuthTooTokens,omitempty"` +} + +// A connection to a list of items. +type OhAuthTooTokenConnection struct { + // A list of edges. + Edges []*OhAuthTooTokenEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOhAuthTooToken mutation +type OhAuthTooTokenCreatePayload struct { + // Created ohAuthTooToken + OhAuthTooToken *OhAuthTooToken `json:"ohAuthTooToken"` +} + +// Return response for deleteOhAuthTooToken mutation +type OhAuthTooTokenDeletePayload struct { + // Deleted ohAuthTooToken ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OhAuthTooTokenEdge struct { + // The item at the end of the edge. + Node *OhAuthTooToken `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateOhAuthTooToken mutation +type OhAuthTooTokenUpdatePayload struct { + // Updated ohAuthTooToken + OhAuthTooToken *OhAuthTooToken `json:"ohAuthTooToken"` +} + +// OhAuthTooTokenWhereInput is used for filtering OhAuthTooToken objects. +// Input was generated by ent. +type OhAuthTooTokenWhereInput struct { + Not *OhAuthTooTokenWhereInput `json:"not,omitempty"` + And []*OhAuthTooTokenWhereInput `json:"and,omitempty"` + Or []*OhAuthTooTokenWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // client_id field predicates + ClientID *string `json:"clientID,omitempty"` + ClientIDNeq *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGt *string `json:"clientIDGT,omitempty"` + ClientIDGte *string `json:"clientIDGTE,omitempty"` + ClientIDLt *string `json:"clientIDLT,omitempty"` + ClientIDLte *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + // nonce field predicates + Nonce *string `json:"nonce,omitempty"` + NonceNeq *string `json:"nonceNEQ,omitempty"` + NonceIn []string `json:"nonceIn,omitempty"` + NonceNotIn []string `json:"nonceNotIn,omitempty"` + NonceGt *string `json:"nonceGT,omitempty"` + NonceGte *string `json:"nonceGTE,omitempty"` + NonceLt *string `json:"nonceLT,omitempty"` + NonceLte *string `json:"nonceLTE,omitempty"` + NonceContains *string `json:"nonceContains,omitempty"` + NonceHasPrefix *string `json:"nonceHasPrefix,omitempty"` + NonceHasSuffix *string `json:"nonceHasSuffix,omitempty"` + NonceEqualFold *string `json:"nonceEqualFold,omitempty"` + NonceContainsFold *string `json:"nonceContainsFold,omitempty"` + // claims_user_id field predicates + ClaimsUserID *string `json:"claimsUserID,omitempty"` + ClaimsUserIDNeq *string `json:"claimsUserIDNEQ,omitempty"` + ClaimsUserIDIn []string `json:"claimsUserIDIn,omitempty"` + ClaimsUserIDNotIn []string `json:"claimsUserIDNotIn,omitempty"` + ClaimsUserIDGt *string `json:"claimsUserIDGT,omitempty"` + ClaimsUserIDGte *string `json:"claimsUserIDGTE,omitempty"` + ClaimsUserIDLt *string `json:"claimsUserIDLT,omitempty"` + ClaimsUserIDLte *string `json:"claimsUserIDLTE,omitempty"` + ClaimsUserIDContains *string `json:"claimsUserIDContains,omitempty"` + ClaimsUserIDHasPrefix *string `json:"claimsUserIDHasPrefix,omitempty"` + ClaimsUserIDHasSuffix *string `json:"claimsUserIDHasSuffix,omitempty"` + ClaimsUserIDEqualFold *string `json:"claimsUserIDEqualFold,omitempty"` + ClaimsUserIDContainsFold *string `json:"claimsUserIDContainsFold,omitempty"` + // claims_username field predicates + ClaimsUsername *string `json:"claimsUsername,omitempty"` + ClaimsUsernameNeq *string `json:"claimsUsernameNEQ,omitempty"` + ClaimsUsernameIn []string `json:"claimsUsernameIn,omitempty"` + ClaimsUsernameNotIn []string `json:"claimsUsernameNotIn,omitempty"` + ClaimsUsernameGt *string `json:"claimsUsernameGT,omitempty"` + ClaimsUsernameGte *string `json:"claimsUsernameGTE,omitempty"` + ClaimsUsernameLt *string `json:"claimsUsernameLT,omitempty"` + ClaimsUsernameLte *string `json:"claimsUsernameLTE,omitempty"` + ClaimsUsernameContains *string `json:"claimsUsernameContains,omitempty"` + ClaimsUsernameHasPrefix *string `json:"claimsUsernameHasPrefix,omitempty"` + ClaimsUsernameHasSuffix *string `json:"claimsUsernameHasSuffix,omitempty"` + ClaimsUsernameEqualFold *string `json:"claimsUsernameEqualFold,omitempty"` + ClaimsUsernameContainsFold *string `json:"claimsUsernameContainsFold,omitempty"` + // claims_email field predicates + ClaimsEmail *string `json:"claimsEmail,omitempty"` + ClaimsEmailNeq *string `json:"claimsEmailNEQ,omitempty"` + ClaimsEmailIn []string `json:"claimsEmailIn,omitempty"` + ClaimsEmailNotIn []string `json:"claimsEmailNotIn,omitempty"` + ClaimsEmailGt *string `json:"claimsEmailGT,omitempty"` + ClaimsEmailGte *string `json:"claimsEmailGTE,omitempty"` + ClaimsEmailLt *string `json:"claimsEmailLT,omitempty"` + ClaimsEmailLte *string `json:"claimsEmailLTE,omitempty"` + ClaimsEmailContains *string `json:"claimsEmailContains,omitempty"` + ClaimsEmailHasPrefix *string `json:"claimsEmailHasPrefix,omitempty"` + ClaimsEmailHasSuffix *string `json:"claimsEmailHasSuffix,omitempty"` + ClaimsEmailEqualFold *string `json:"claimsEmailEqualFold,omitempty"` + ClaimsEmailContainsFold *string `json:"claimsEmailContainsFold,omitempty"` + // claims_email_verified field predicates + ClaimsEmailVerified *bool `json:"claimsEmailVerified,omitempty"` + ClaimsEmailVerifiedNeq *bool `json:"claimsEmailVerifiedNEQ,omitempty"` + // claims_preferred_username field predicates + ClaimsPreferredUsername *string `json:"claimsPreferredUsername,omitempty"` + ClaimsPreferredUsernameNeq *string `json:"claimsPreferredUsernameNEQ,omitempty"` + ClaimsPreferredUsernameIn []string `json:"claimsPreferredUsernameIn,omitempty"` + ClaimsPreferredUsernameNotIn []string `json:"claimsPreferredUsernameNotIn,omitempty"` + ClaimsPreferredUsernameGt *string `json:"claimsPreferredUsernameGT,omitempty"` + ClaimsPreferredUsernameGte *string `json:"claimsPreferredUsernameGTE,omitempty"` + ClaimsPreferredUsernameLt *string `json:"claimsPreferredUsernameLT,omitempty"` + ClaimsPreferredUsernameLte *string `json:"claimsPreferredUsernameLTE,omitempty"` + ClaimsPreferredUsernameContains *string `json:"claimsPreferredUsernameContains,omitempty"` + ClaimsPreferredUsernameHasPrefix *string `json:"claimsPreferredUsernameHasPrefix,omitempty"` + ClaimsPreferredUsernameHasSuffix *string `json:"claimsPreferredUsernameHasSuffix,omitempty"` + ClaimsPreferredUsernameEqualFold *string `json:"claimsPreferredUsernameEqualFold,omitempty"` + ClaimsPreferredUsernameContainsFold *string `json:"claimsPreferredUsernameContainsFold,omitempty"` + // connector_id field predicates + ConnectorID *string `json:"connectorID,omitempty"` + ConnectorIDNeq *string `json:"connectorIDNEQ,omitempty"` + ConnectorIDIn []string `json:"connectorIDIn,omitempty"` + ConnectorIDNotIn []string `json:"connectorIDNotIn,omitempty"` + ConnectorIDGt *string `json:"connectorIDGT,omitempty"` + ConnectorIDGte *string `json:"connectorIDGTE,omitempty"` + ConnectorIDLt *string `json:"connectorIDLT,omitempty"` + ConnectorIDLte *string `json:"connectorIDLTE,omitempty"` + ConnectorIDContains *string `json:"connectorIDContains,omitempty"` + ConnectorIDHasPrefix *string `json:"connectorIDHasPrefix,omitempty"` + ConnectorIDHasSuffix *string `json:"connectorIDHasSuffix,omitempty"` + ConnectorIDEqualFold *string `json:"connectorIDEqualFold,omitempty"` + ConnectorIDContainsFold *string `json:"connectorIDContainsFold,omitempty"` + // last_used field predicates + LastUsed *time.Time `json:"lastUsed,omitempty"` + LastUsedNeq *time.Time `json:"lastUsedNEQ,omitempty"` + LastUsedIn []*time.Time `json:"lastUsedIn,omitempty"` + LastUsedNotIn []*time.Time `json:"lastUsedNotIn,omitempty"` + LastUsedGt *time.Time `json:"lastUsedGT,omitempty"` + LastUsedGte *time.Time `json:"lastUsedGTE,omitempty"` + LastUsedLt *time.Time `json:"lastUsedLT,omitempty"` + LastUsedLte *time.Time `json:"lastUsedLTE,omitempty"` + // integration edge predicates + HasIntegration *bool `json:"hasIntegration,omitempty"` + HasIntegrationWith []*IntegrationWhereInput `json:"hasIntegrationWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type OrgMembership struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + OrganizationID string `json:"organizationID"` + UserID string `json:"userID"` + Organization *Organization `json:"organization"` + User *User `json:"user"` + Events []*Event `json:"events,omitempty"` +} + +func (OrgMembership) IsNode() {} + +// Return response for createBulkOrgMembership mutation +type OrgMembershipBulkCreatePayload struct { + // Created orgMemberships + OrgMemberships []*OrgMembership `json:"orgMemberships,omitempty"` +} + +// A connection to a list of items. +type OrgMembershipConnection struct { + // A list of edges. + Edges []*OrgMembershipEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOrgMembership mutation +type OrgMembershipCreatePayload struct { + // Created orgMembership + OrgMembership *OrgMembership `json:"orgMembership"` +} + +// Return response for deleteOrgMembership mutation +type OrgMembershipDeletePayload struct { + // Deleted orgMembership ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OrgMembershipEdge struct { + // The item at the end of the edge. + Node *OrgMembership `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OrgMembershipHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + OrganizationID string `json:"organizationID"` + UserID string `json:"userID"` +} + +func (OrgMembershipHistory) IsNode() {} + +// A connection to a list of items. +type OrgMembershipHistoryConnection struct { + // A list of edges. + Edges []*OrgMembershipHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OrgMembershipHistoryEdge struct { + // The item at the end of the edge. + Node *OrgMembershipHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// OrgMembershipHistoryWhereInput is used for filtering OrgMembershipHistory objects. +// Input was generated by ent. +type OrgMembershipHistoryWhereInput struct { + Not *OrgMembershipHistoryWhereInput `json:"not,omitempty"` + And []*OrgMembershipHistoryWhereInput `json:"and,omitempty"` + Or []*OrgMembershipHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` +} + +// Return response for updateOrgMembership mutation +type OrgMembershipUpdatePayload struct { + // Updated orgMembership + OrgMembership *OrgMembership `json:"orgMembership"` +} + +// OrgMembershipWhereInput is used for filtering OrgMembership objects. +// Input was generated by ent. +type OrgMembershipWhereInput struct { + Not *OrgMembershipWhereInput `json:"not,omitempty"` + And []*OrgMembershipWhereInput `json:"and,omitempty"` + Or []*OrgMembershipWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` + UserID *string `json:"userID,omitempty"` +} + +type Organization struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the name of the organization + Name string `json:"name"` + // The organization's displayed 'friendly' name + DisplayName string `json:"displayName"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + // orgs directly associated with a user + PersonalOrg *bool `json:"personalOrg,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb bool `json:"dedicatedDb"` + Parent *Organization `json:"parent,omitempty"` + Children *OrganizationConnection `json:"children"` + Groups []*Group `json:"groups,omitempty"` + Templates []*Template `json:"templates,omitempty"` + Integrations []*Integration `json:"integrations,omitempty"` + Setting *OrganizationSetting `json:"setting,omitempty"` + Documentdata []*DocumentData `json:"documentdata,omitempty"` + Entitlements []*Entitlement `json:"entitlements,omitempty"` + OrganizationEntitlement []*Entitlement `json:"organizationEntitlement,omitempty"` + PersonalAccessTokens []*PersonalAccessToken `json:"personalAccessTokens,omitempty"` + APITokens []*APIToken `json:"apiTokens,omitempty"` + Oauthprovider []*OauthProvider `json:"oauthprovider,omitempty"` + Users []*User `json:"users,omitempty"` + Invites []*Invite `json:"invites,omitempty"` + Subscribers []*Subscriber `json:"subscribers,omitempty"` + Webhooks []*Webhook `json:"webhooks,omitempty"` + Events []*Event `json:"events,omitempty"` + Secrets []*Hush `json:"secrets,omitempty"` + Features []*Feature `json:"features,omitempty"` + Files []*File `json:"files,omitempty"` + Entitlementplans []*EntitlementPlan `json:"entitlementplans,omitempty"` + Entitlementplanfeatures []*EntitlementPlanFeature `json:"entitlementplanfeatures,omitempty"` + Entities []*Entity `json:"entities,omitempty"` + Entitytypes []*EntityType `json:"entitytypes,omitempty"` + Contacts []*Contact `json:"contacts,omitempty"` + Notes []*Note `json:"notes,omitempty"` + Members []*OrgMembership `json:"members,omitempty"` +} + +func (Organization) IsNode() {} + +// Return response for createBulkOrganization mutation +type OrganizationBulkCreatePayload struct { + // Created organizations + Organizations []*Organization `json:"organizations,omitempty"` +} + +// A connection to a list of items. +type OrganizationConnection struct { + // A list of edges. + Edges []*OrganizationEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOrganization mutation +type OrganizationCreatePayload struct { + // Created organization + Organization *Organization `json:"organization"` +} + +// Return response for deleteOrganization mutation +type OrganizationDeletePayload struct { + // Deleted organization ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OrganizationEdge struct { + // The item at the end of the edge. + Node *Organization `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OrganizationHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the name of the organization + Name string `json:"name"` + // The organization's displayed 'friendly' name + DisplayName string `json:"displayName"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + // orgs directly associated with a user + PersonalOrg *bool `json:"personalOrg,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb bool `json:"dedicatedDb"` +} + +func (OrganizationHistory) IsNode() {} + +// A connection to a list of items. +type OrganizationHistoryConnection struct { + // A list of edges. + Edges []*OrganizationHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OrganizationHistoryEdge struct { + // The item at the end of the edge. + Node *OrganizationHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for OrganizationHistory connections +type OrganizationHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order OrganizationHistories. + Field OrganizationHistoryOrderField `json:"field"` +} + +// OrganizationHistoryWhereInput is used for filtering OrganizationHistory objects. +// Input was generated by ent. +type OrganizationHistoryWhereInput struct { + Not *OrganizationHistoryWhereInput `json:"not,omitempty"` + And []*OrganizationHistoryWhereInput `json:"and,omitempty"` + Or []*OrganizationHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // parent_organization_id field predicates + ParentOrganizationID *string `json:"parentOrganizationID,omitempty"` + ParentOrganizationIDNeq *string `json:"parentOrganizationIDNEQ,omitempty"` + ParentOrganizationIDIn []string `json:"parentOrganizationIDIn,omitempty"` + ParentOrganizationIDNotIn []string `json:"parentOrganizationIDNotIn,omitempty"` + ParentOrganizationIDGt *string `json:"parentOrganizationIDGT,omitempty"` + ParentOrganizationIDGte *string `json:"parentOrganizationIDGTE,omitempty"` + ParentOrganizationIDLt *string `json:"parentOrganizationIDLT,omitempty"` + ParentOrganizationIDLte *string `json:"parentOrganizationIDLTE,omitempty"` + ParentOrganizationIDContains *string `json:"parentOrganizationIDContains,omitempty"` + ParentOrganizationIDHasPrefix *string `json:"parentOrganizationIDHasPrefix,omitempty"` + ParentOrganizationIDHasSuffix *string `json:"parentOrganizationIDHasSuffix,omitempty"` + ParentOrganizationIDIsNil *bool `json:"parentOrganizationIDIsNil,omitempty"` + ParentOrganizationIDNotNil *bool `json:"parentOrganizationIDNotNil,omitempty"` + ParentOrganizationIDEqualFold *string `json:"parentOrganizationIDEqualFold,omitempty"` + ParentOrganizationIDContainsFold *string `json:"parentOrganizationIDContainsFold,omitempty"` + // personal_org field predicates + PersonalOrg *bool `json:"personalOrg,omitempty"` + PersonalOrgNeq *bool `json:"personalOrgNEQ,omitempty"` + PersonalOrgIsNil *bool `json:"personalOrgIsNil,omitempty"` + PersonalOrgNotNil *bool `json:"personalOrgNotNil,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` +} + +// Ordering options for Organization connections +type OrganizationOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Organizations. + Field OrganizationOrderField `json:"field"` +} + +type OrganizationSearchResult struct { + Organizations []*Organization `json:"organizations,omitempty"` +} + +func (OrganizationSearchResult) IsGlobalSearchResult() {} + +type OrganizationSetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + // the ID of the organization the settings belong to + OrganizationID *string `json:"organizationID,omitempty"` + Organization *Organization `json:"organization,omitempty"` +} + +func (OrganizationSetting) IsNode() {} + +// Return response for createBulkOrganizationSetting mutation +type OrganizationSettingBulkCreatePayload struct { + // Created organizationSettings + OrganizationSettings []*OrganizationSetting `json:"organizationSettings,omitempty"` +} + +// A connection to a list of items. +type OrganizationSettingConnection struct { + // A list of edges. + Edges []*OrganizationSettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOrganizationSetting mutation +type OrganizationSettingCreatePayload struct { + // Created organizationSetting + OrganizationSetting *OrganizationSetting `json:"organizationSetting"` +} + +// Return response for deleteOrganizationSetting mutation +type OrganizationSettingDeletePayload struct { + // Deleted organizationSetting ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OrganizationSettingEdge struct { + // The item at the end of the edge. + Node *OrganizationSetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OrganizationSettingHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + // the ID of the organization the settings belong to + OrganizationID *string `json:"organizationID,omitempty"` +} + +func (OrganizationSettingHistory) IsNode() {} + +// A connection to a list of items. +type OrganizationSettingHistoryConnection struct { + // A list of edges. + Edges []*OrganizationSettingHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OrganizationSettingHistoryEdge struct { + // The item at the end of the edge. + Node *OrganizationSettingHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// OrganizationSettingHistoryWhereInput is used for filtering OrganizationSettingHistory objects. +// Input was generated by ent. +type OrganizationSettingHistoryWhereInput struct { + Not *OrganizationSettingHistoryWhereInput `json:"not,omitempty"` + And []*OrganizationSettingHistoryWhereInput `json:"and,omitempty"` + Or []*OrganizationSettingHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // billing_contact field predicates + BillingContact *string `json:"billingContact,omitempty"` + BillingContactNeq *string `json:"billingContactNEQ,omitempty"` + BillingContactIn []string `json:"billingContactIn,omitempty"` + BillingContactNotIn []string `json:"billingContactNotIn,omitempty"` + BillingContactGt *string `json:"billingContactGT,omitempty"` + BillingContactGte *string `json:"billingContactGTE,omitempty"` + BillingContactLt *string `json:"billingContactLT,omitempty"` + BillingContactLte *string `json:"billingContactLTE,omitempty"` + BillingContactContains *string `json:"billingContactContains,omitempty"` + BillingContactHasPrefix *string `json:"billingContactHasPrefix,omitempty"` + BillingContactHasSuffix *string `json:"billingContactHasSuffix,omitempty"` + BillingContactIsNil *bool `json:"billingContactIsNil,omitempty"` + BillingContactNotNil *bool `json:"billingContactNotNil,omitempty"` + BillingContactEqualFold *string `json:"billingContactEqualFold,omitempty"` + BillingContactContainsFold *string `json:"billingContactContainsFold,omitempty"` + // billing_email field predicates + BillingEmail *string `json:"billingEmail,omitempty"` + BillingEmailNeq *string `json:"billingEmailNEQ,omitempty"` + BillingEmailIn []string `json:"billingEmailIn,omitempty"` + BillingEmailNotIn []string `json:"billingEmailNotIn,omitempty"` + BillingEmailGt *string `json:"billingEmailGT,omitempty"` + BillingEmailGte *string `json:"billingEmailGTE,omitempty"` + BillingEmailLt *string `json:"billingEmailLT,omitempty"` + BillingEmailLte *string `json:"billingEmailLTE,omitempty"` + BillingEmailContains *string `json:"billingEmailContains,omitempty"` + BillingEmailHasPrefix *string `json:"billingEmailHasPrefix,omitempty"` + BillingEmailHasSuffix *string `json:"billingEmailHasSuffix,omitempty"` + BillingEmailIsNil *bool `json:"billingEmailIsNil,omitempty"` + BillingEmailNotNil *bool `json:"billingEmailNotNil,omitempty"` + BillingEmailEqualFold *string `json:"billingEmailEqualFold,omitempty"` + BillingEmailContainsFold *string `json:"billingEmailContainsFold,omitempty"` + // billing_phone field predicates + BillingPhone *string `json:"billingPhone,omitempty"` + BillingPhoneNeq *string `json:"billingPhoneNEQ,omitempty"` + BillingPhoneIn []string `json:"billingPhoneIn,omitempty"` + BillingPhoneNotIn []string `json:"billingPhoneNotIn,omitempty"` + BillingPhoneGt *string `json:"billingPhoneGT,omitempty"` + BillingPhoneGte *string `json:"billingPhoneGTE,omitempty"` + BillingPhoneLt *string `json:"billingPhoneLT,omitempty"` + BillingPhoneLte *string `json:"billingPhoneLTE,omitempty"` + BillingPhoneContains *string `json:"billingPhoneContains,omitempty"` + BillingPhoneHasPrefix *string `json:"billingPhoneHasPrefix,omitempty"` + BillingPhoneHasSuffix *string `json:"billingPhoneHasSuffix,omitempty"` + BillingPhoneIsNil *bool `json:"billingPhoneIsNil,omitempty"` + BillingPhoneNotNil *bool `json:"billingPhoneNotNil,omitempty"` + BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` + BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` + // billing_address field predicates + BillingAddress *string `json:"billingAddress,omitempty"` + BillingAddressNeq *string `json:"billingAddressNEQ,omitempty"` + BillingAddressIn []string `json:"billingAddressIn,omitempty"` + BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` + BillingAddressGt *string `json:"billingAddressGT,omitempty"` + BillingAddressGte *string `json:"billingAddressGTE,omitempty"` + BillingAddressLt *string `json:"billingAddressLT,omitempty"` + BillingAddressLte *string `json:"billingAddressLTE,omitempty"` + BillingAddressContains *string `json:"billingAddressContains,omitempty"` + BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` + BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` + BillingAddressIsNil *bool `json:"billingAddressIsNil,omitempty"` + BillingAddressNotNil *bool `json:"billingAddressNotNil,omitempty"` + BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` + BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` + // tax_identifier field predicates + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + TaxIdentifierNeq *string `json:"taxIdentifierNEQ,omitempty"` + TaxIdentifierIn []string `json:"taxIdentifierIn,omitempty"` + TaxIdentifierNotIn []string `json:"taxIdentifierNotIn,omitempty"` + TaxIdentifierGt *string `json:"taxIdentifierGT,omitempty"` + TaxIdentifierGte *string `json:"taxIdentifierGTE,omitempty"` + TaxIdentifierLt *string `json:"taxIdentifierLT,omitempty"` + TaxIdentifierLte *string `json:"taxIdentifierLTE,omitempty"` + TaxIdentifierContains *string `json:"taxIdentifierContains,omitempty"` + TaxIdentifierHasPrefix *string `json:"taxIdentifierHasPrefix,omitempty"` + TaxIdentifierHasSuffix *string `json:"taxIdentifierHasSuffix,omitempty"` + TaxIdentifierIsNil *bool `json:"taxIdentifierIsNil,omitempty"` + TaxIdentifierNotNil *bool `json:"taxIdentifierNotNil,omitempty"` + TaxIdentifierEqualFold *string `json:"taxIdentifierEqualFold,omitempty"` + TaxIdentifierContainsFold *string `json:"taxIdentifierContainsFold,omitempty"` + // geo_location field predicates + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + GeoLocationNeq *enums.Region `json:"geoLocationNEQ,omitempty"` + GeoLocationIn []enums.Region `json:"geoLocationIn,omitempty"` + GeoLocationNotIn []enums.Region `json:"geoLocationNotIn,omitempty"` + GeoLocationIsNil *bool `json:"geoLocationIsNil,omitempty"` + GeoLocationNotNil *bool `json:"geoLocationNotNil,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDIsNil *bool `json:"organizationIDIsNil,omitempty"` + OrganizationIDNotNil *bool `json:"organizationIDNotNil,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` +} + +// Return response for updateOrganizationSetting mutation +type OrganizationSettingUpdatePayload struct { + // Updated organizationSetting + OrganizationSetting *OrganizationSetting `json:"organizationSetting"` +} + +// OrganizationSettingWhereInput is used for filtering OrganizationSetting objects. +// Input was generated by ent. +type OrganizationSettingWhereInput struct { + Not *OrganizationSettingWhereInput `json:"not,omitempty"` + And []*OrganizationSettingWhereInput `json:"and,omitempty"` + Or []*OrganizationSettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // billing_contact field predicates + BillingContact *string `json:"billingContact,omitempty"` + BillingContactNeq *string `json:"billingContactNEQ,omitempty"` + BillingContactIn []string `json:"billingContactIn,omitempty"` + BillingContactNotIn []string `json:"billingContactNotIn,omitempty"` + BillingContactGt *string `json:"billingContactGT,omitempty"` + BillingContactGte *string `json:"billingContactGTE,omitempty"` + BillingContactLt *string `json:"billingContactLT,omitempty"` + BillingContactLte *string `json:"billingContactLTE,omitempty"` + BillingContactContains *string `json:"billingContactContains,omitempty"` + BillingContactHasPrefix *string `json:"billingContactHasPrefix,omitempty"` + BillingContactHasSuffix *string `json:"billingContactHasSuffix,omitempty"` + BillingContactIsNil *bool `json:"billingContactIsNil,omitempty"` + BillingContactNotNil *bool `json:"billingContactNotNil,omitempty"` + BillingContactEqualFold *string `json:"billingContactEqualFold,omitempty"` + BillingContactContainsFold *string `json:"billingContactContainsFold,omitempty"` + // billing_email field predicates + BillingEmail *string `json:"billingEmail,omitempty"` + BillingEmailNeq *string `json:"billingEmailNEQ,omitempty"` + BillingEmailIn []string `json:"billingEmailIn,omitempty"` + BillingEmailNotIn []string `json:"billingEmailNotIn,omitempty"` + BillingEmailGt *string `json:"billingEmailGT,omitempty"` + BillingEmailGte *string `json:"billingEmailGTE,omitempty"` + BillingEmailLt *string `json:"billingEmailLT,omitempty"` + BillingEmailLte *string `json:"billingEmailLTE,omitempty"` + BillingEmailContains *string `json:"billingEmailContains,omitempty"` + BillingEmailHasPrefix *string `json:"billingEmailHasPrefix,omitempty"` + BillingEmailHasSuffix *string `json:"billingEmailHasSuffix,omitempty"` + BillingEmailIsNil *bool `json:"billingEmailIsNil,omitempty"` + BillingEmailNotNil *bool `json:"billingEmailNotNil,omitempty"` + BillingEmailEqualFold *string `json:"billingEmailEqualFold,omitempty"` + BillingEmailContainsFold *string `json:"billingEmailContainsFold,omitempty"` + // billing_phone field predicates + BillingPhone *string `json:"billingPhone,omitempty"` + BillingPhoneNeq *string `json:"billingPhoneNEQ,omitempty"` + BillingPhoneIn []string `json:"billingPhoneIn,omitempty"` + BillingPhoneNotIn []string `json:"billingPhoneNotIn,omitempty"` + BillingPhoneGt *string `json:"billingPhoneGT,omitempty"` + BillingPhoneGte *string `json:"billingPhoneGTE,omitempty"` + BillingPhoneLt *string `json:"billingPhoneLT,omitempty"` + BillingPhoneLte *string `json:"billingPhoneLTE,omitempty"` + BillingPhoneContains *string `json:"billingPhoneContains,omitempty"` + BillingPhoneHasPrefix *string `json:"billingPhoneHasPrefix,omitempty"` + BillingPhoneHasSuffix *string `json:"billingPhoneHasSuffix,omitempty"` + BillingPhoneIsNil *bool `json:"billingPhoneIsNil,omitempty"` + BillingPhoneNotNil *bool `json:"billingPhoneNotNil,omitempty"` + BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` + BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` + // billing_address field predicates + BillingAddress *string `json:"billingAddress,omitempty"` + BillingAddressNeq *string `json:"billingAddressNEQ,omitempty"` + BillingAddressIn []string `json:"billingAddressIn,omitempty"` + BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` + BillingAddressGt *string `json:"billingAddressGT,omitempty"` + BillingAddressGte *string `json:"billingAddressGTE,omitempty"` + BillingAddressLt *string `json:"billingAddressLT,omitempty"` + BillingAddressLte *string `json:"billingAddressLTE,omitempty"` + BillingAddressContains *string `json:"billingAddressContains,omitempty"` + BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` + BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` + BillingAddressIsNil *bool `json:"billingAddressIsNil,omitempty"` + BillingAddressNotNil *bool `json:"billingAddressNotNil,omitempty"` + BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` + BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` + // tax_identifier field predicates + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + TaxIdentifierNeq *string `json:"taxIdentifierNEQ,omitempty"` + TaxIdentifierIn []string `json:"taxIdentifierIn,omitempty"` + TaxIdentifierNotIn []string `json:"taxIdentifierNotIn,omitempty"` + TaxIdentifierGt *string `json:"taxIdentifierGT,omitempty"` + TaxIdentifierGte *string `json:"taxIdentifierGTE,omitempty"` + TaxIdentifierLt *string `json:"taxIdentifierLT,omitempty"` + TaxIdentifierLte *string `json:"taxIdentifierLTE,omitempty"` + TaxIdentifierContains *string `json:"taxIdentifierContains,omitempty"` + TaxIdentifierHasPrefix *string `json:"taxIdentifierHasPrefix,omitempty"` + TaxIdentifierHasSuffix *string `json:"taxIdentifierHasSuffix,omitempty"` + TaxIdentifierIsNil *bool `json:"taxIdentifierIsNil,omitempty"` + TaxIdentifierNotNil *bool `json:"taxIdentifierNotNil,omitempty"` + TaxIdentifierEqualFold *string `json:"taxIdentifierEqualFold,omitempty"` + TaxIdentifierContainsFold *string `json:"taxIdentifierContainsFold,omitempty"` + // geo_location field predicates + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + GeoLocationNeq *enums.Region `json:"geoLocationNEQ,omitempty"` + GeoLocationIn []enums.Region `json:"geoLocationIn,omitempty"` + GeoLocationNotIn []enums.Region `json:"geoLocationNotIn,omitempty"` + GeoLocationIsNil *bool `json:"geoLocationIsNil,omitempty"` + GeoLocationNotNil *bool `json:"geoLocationNotNil,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDIsNil *bool `json:"organizationIDIsNil,omitempty"` + OrganizationIDNotNil *bool `json:"organizationIDNotNil,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` +} + +// Return response for updateOrganization mutation +type OrganizationUpdatePayload struct { + // Updated organization + Organization *Organization `json:"organization"` +} + +// OrganizationWhereInput is used for filtering Organization objects. +// Input was generated by ent. +type OrganizationWhereInput struct { + Not *OrganizationWhereInput `json:"not,omitempty"` + And []*OrganizationWhereInput `json:"and,omitempty"` + Or []*OrganizationWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // parent_organization_id field predicates + ParentOrganizationID *string `json:"parentOrganizationID,omitempty"` + ParentOrganizationIDNeq *string `json:"parentOrganizationIDNEQ,omitempty"` + ParentOrganizationIDIn []string `json:"parentOrganizationIDIn,omitempty"` + ParentOrganizationIDNotIn []string `json:"parentOrganizationIDNotIn,omitempty"` + ParentOrganizationIDGt *string `json:"parentOrganizationIDGT,omitempty"` + ParentOrganizationIDGte *string `json:"parentOrganizationIDGTE,omitempty"` + ParentOrganizationIDLt *string `json:"parentOrganizationIDLT,omitempty"` + ParentOrganizationIDLte *string `json:"parentOrganizationIDLTE,omitempty"` + ParentOrganizationIDContains *string `json:"parentOrganizationIDContains,omitempty"` + ParentOrganizationIDHasPrefix *string `json:"parentOrganizationIDHasPrefix,omitempty"` + ParentOrganizationIDHasSuffix *string `json:"parentOrganizationIDHasSuffix,omitempty"` + ParentOrganizationIDIsNil *bool `json:"parentOrganizationIDIsNil,omitempty"` + ParentOrganizationIDNotNil *bool `json:"parentOrganizationIDNotNil,omitempty"` + ParentOrganizationIDEqualFold *string `json:"parentOrganizationIDEqualFold,omitempty"` + ParentOrganizationIDContainsFold *string `json:"parentOrganizationIDContainsFold,omitempty"` + // personal_org field predicates + PersonalOrg *bool `json:"personalOrg,omitempty"` + PersonalOrgNeq *bool `json:"personalOrgNEQ,omitempty"` + PersonalOrgIsNil *bool `json:"personalOrgIsNil,omitempty"` + PersonalOrgNotNil *bool `json:"personalOrgNotNil,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + // parent edge predicates + HasParent *bool `json:"hasParent,omitempty"` + HasParentWith []*OrganizationWhereInput `json:"hasParentWith,omitempty"` + // children edge predicates + HasChildren *bool `json:"hasChildren,omitempty"` + HasChildrenWith []*OrganizationWhereInput `json:"hasChildrenWith,omitempty"` + // groups edge predicates + HasGroups *bool `json:"hasGroups,omitempty"` + HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"` + // templates edge predicates + HasTemplates *bool `json:"hasTemplates,omitempty"` + HasTemplatesWith []*TemplateWhereInput `json:"hasTemplatesWith,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + // setting edge predicates + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*OrganizationSettingWhereInput `json:"hasSettingWith,omitempty"` + // documentdata edge predicates + HasDocumentdata *bool `json:"hasDocumentdata,omitempty"` + HasDocumentdataWith []*DocumentDataWhereInput `json:"hasDocumentdataWith,omitempty"` + // entitlements edge predicates + HasEntitlements *bool `json:"hasEntitlements,omitempty"` + HasEntitlementsWith []*EntitlementWhereInput `json:"hasEntitlementsWith,omitempty"` + // organization_entitlement edge predicates + HasOrganizationEntitlement *bool `json:"hasOrganizationEntitlement,omitempty"` + HasOrganizationEntitlementWith []*EntitlementWhereInput `json:"hasOrganizationEntitlementWith,omitempty"` + // personal_access_tokens edge predicates + HasPersonalAccessTokens *bool `json:"hasPersonalAccessTokens,omitempty"` + HasPersonalAccessTokensWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokensWith,omitempty"` + // api_tokens edge predicates + HasAPITokens *bool `json:"hasAPITokens,omitempty"` + HasAPITokensWith []*APITokenWhereInput `json:"hasAPITokensWith,omitempty"` + // oauthprovider edge predicates + HasOauthprovider *bool `json:"hasOauthprovider,omitempty"` + HasOauthproviderWith []*OauthProviderWhereInput `json:"hasOauthproviderWith,omitempty"` + // users edge predicates + HasUsers *bool `json:"hasUsers,omitempty"` + HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"` + // invites edge predicates + HasInvites *bool `json:"hasInvites,omitempty"` + HasInvitesWith []*InviteWhereInput `json:"hasInvitesWith,omitempty"` + // subscribers edge predicates + HasSubscribers *bool `json:"hasSubscribers,omitempty"` + HasSubscribersWith []*SubscriberWhereInput `json:"hasSubscribersWith,omitempty"` + // webhooks edge predicates + HasWebhooks *bool `json:"hasWebhooks,omitempty"` + HasWebhooksWith []*WebhookWhereInput `json:"hasWebhooksWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // secrets edge predicates + HasSecrets *bool `json:"hasSecrets,omitempty"` + HasSecretsWith []*HushWhereInput `json:"hasSecretsWith,omitempty"` + // features edge predicates + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*FeatureWhereInput `json:"hasFeaturesWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // entitlementplans edge predicates + HasEntitlementplans *bool `json:"hasEntitlementplans,omitempty"` + HasEntitlementplansWith []*EntitlementPlanWhereInput `json:"hasEntitlementplansWith,omitempty"` + // entitlementplanfeatures edge predicates + HasEntitlementplanfeatures *bool `json:"hasEntitlementplanfeatures,omitempty"` + HasEntitlementplanfeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasEntitlementplanfeaturesWith,omitempty"` + // entities edge predicates + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` + // entitytypes edge predicates + HasEntitytypes *bool `json:"hasEntitytypes,omitempty"` + HasEntitytypesWith []*EntityTypeWhereInput `json:"hasEntitytypesWith,omitempty"` + // contacts edge predicates + HasContacts *bool `json:"hasContacts,omitempty"` + HasContactsWith []*ContactWhereInput `json:"hasContactsWith,omitempty"` + // notes edge predicates + HasNotes *bool `json:"hasNotes,omitempty"` + HasNotesWith []*NoteWhereInput `json:"hasNotesWith,omitempty"` + // members edge predicates + HasMembers *bool `json:"hasMembers,omitempty"` + HasMembersWith []*OrgMembershipWhereInput `json:"hasMembersWith,omitempty"` +} + +// Information about pagination in a connection. +// https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo +type PageInfo struct { + // When paginating forwards, are there more items? + HasNextPage bool `json:"hasNextPage"` + // When paginating backwards, are there more items? + HasPreviousPage bool `json:"hasPreviousPage"` + // When paginating backwards, the cursor to continue. + StartCursor *string `json:"startCursor,omitempty"` + // When paginating forwards, the cursor to continue. + EndCursor *string `json:"endCursor,omitempty"` +} + +type PersonalAccessToken struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name associated with the token + Name string `json:"name"` + Token string `json:"token"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + Owner *User `json:"owner"` + // the organization(s) the token is associated with + Organizations []*Organization `json:"organizations,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (PersonalAccessToken) IsNode() {} + +// Return response for createBulkPersonalAccessToken mutation +type PersonalAccessTokenBulkCreatePayload struct { + // Created personalAccessTokens + PersonalAccessTokens []*PersonalAccessToken `json:"personalAccessTokens,omitempty"` +} + +// A connection to a list of items. +type PersonalAccessTokenConnection struct { + // A list of edges. + Edges []*PersonalAccessTokenEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createPersonalAccessToken mutation +type PersonalAccessTokenCreatePayload struct { + // Created personalAccessToken + PersonalAccessToken *PersonalAccessToken `json:"personalAccessToken"` +} + +// Return response for deletePersonalAccessToken mutation +type PersonalAccessTokenDeletePayload struct { + // Deleted personalAccessToken ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type PersonalAccessTokenEdge struct { + // The item at the end of the edge. + Node *PersonalAccessToken `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updatePersonalAccessToken mutation +type PersonalAccessTokenUpdatePayload struct { + // Updated personalAccessToken + PersonalAccessToken *PersonalAccessToken `json:"personalAccessToken"` +} + +// PersonalAccessTokenWhereInput is used for filtering PersonalAccessToken objects. +// Input was generated by ent. +type PersonalAccessTokenWhereInput struct { + Not *PersonalAccessTokenWhereInput `json:"not,omitempty"` + And []*PersonalAccessTokenWhereInput `json:"and,omitempty"` + Or []*PersonalAccessTokenWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // last_used_at field predicates + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + LastUsedAtNeq *time.Time `json:"lastUsedAtNEQ,omitempty"` + LastUsedAtIn []*time.Time `json:"lastUsedAtIn,omitempty"` + LastUsedAtNotIn []*time.Time `json:"lastUsedAtNotIn,omitempty"` + LastUsedAtGt *time.Time `json:"lastUsedAtGT,omitempty"` + LastUsedAtGte *time.Time `json:"lastUsedAtGTE,omitempty"` + LastUsedAtLt *time.Time `json:"lastUsedAtLT,omitempty"` + LastUsedAtLte *time.Time `json:"lastUsedAtLTE,omitempty"` + LastUsedAtIsNil *bool `json:"lastUsedAtIsNil,omitempty"` + LastUsedAtNotNil *bool `json:"lastUsedAtNotNil,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*UserWhereInput `json:"hasOwnerWith,omitempty"` + // organizations edge predicates + HasOrganizations *bool `json:"hasOrganizations,omitempty"` + HasOrganizationsWith []*OrganizationWhereInput `json:"hasOrganizationsWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Query struct { +} + +type Subscriber struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // email address of the subscriber + Email string `json:"email"` + // phone number of the subscriber + PhoneNumber *string `json:"phoneNumber,omitempty"` + // indicates if the email address has been verified + VerifiedEmail bool `json:"verifiedEmail"` + // indicates if the phone number has been verified + VerifiedPhone bool `json:"verifiedPhone"` + // indicates if the subscriber is active or not, active users will have at least one verified contact method + Active bool `json:"active"` + Owner *Organization `json:"owner,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (Subscriber) IsNode() {} + +// Return response for createBulkSubscriber mutation +type SubscriberBulkCreatePayload struct { + // Created subscribers + Subscribers []*Subscriber `json:"subscribers,omitempty"` +} + +// A connection to a list of items. +type SubscriberConnection struct { + // A list of edges. + Edges []*SubscriberEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createSubscriber mutation +type SubscriberCreatePayload struct { + // Created subscriber + Subscriber *Subscriber `json:"subscriber"` +} + +// Return response for deleteSubscriber mutation +type SubscriberDeletePayload struct { + // Deleted subscriber email + Email string `json:"email"` +} + +// An edge in a connection. +type SubscriberEdge struct { + // The item at the end of the edge. + Node *Subscriber `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type SubscriberSearchResult struct { + Subscribers []*Subscriber `json:"subscribers,omitempty"` +} + +func (SubscriberSearchResult) IsGlobalSearchResult() {} + +// Return response for updateSubscriber mutation +type SubscriberUpdatePayload struct { + // Updated subscriber + Subscriber *Subscriber `json:"subscriber"` +} + +// SubscriberWhereInput is used for filtering Subscriber objects. +// Input was generated by ent. +type SubscriberWhereInput struct { + Not *SubscriberWhereInput `json:"not,omitempty"` + And []*SubscriberWhereInput `json:"and,omitempty"` + Or []*SubscriberWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // phone_number field predicates + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNeq *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGt *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGte *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLt *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLte *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil *bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil *bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + // verified_email field predicates + VerifiedEmail *bool `json:"verifiedEmail,omitempty"` + VerifiedEmailNeq *bool `json:"verifiedEmailNEQ,omitempty"` + // verified_phone field predicates + VerifiedPhone *bool `json:"verifiedPhone,omitempty"` + VerifiedPhoneNeq *bool `json:"verifiedPhoneNEQ,omitempty"` + // active field predicates + Active *bool `json:"active,omitempty"` + ActiveNeq *bool `json:"activeNEQ,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type TFASetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // TFA secret for the user + TfaSecret *string `json:"tfaSecret,omitempty"` + // specifies if the TFA device has been verified + Verified bool `json:"verified"` + // recovery codes for 2fa + RecoveryCodes []string `json:"recoveryCodes,omitempty"` + // specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + TotpAllowed *bool `json:"totpAllowed,omitempty"` + Owner *User `json:"owner,omitempty"` +} + +func (TFASetting) IsNode() {} + +// A connection to a list of items. +type TFASettingConnection struct { + // A list of edges. + Edges []*TFASettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createTFASetting mutation +type TFASettingCreatePayload struct { + // Created tfaSetting + TfaSetting *TFASetting `json:"tfaSetting"` +} + +// An edge in a connection. +type TFASettingEdge struct { + // The item at the end of the edge. + Node *TFASetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateTFASetting mutation +type TFASettingUpdatePayload struct { + // Updated tfaSetting + TfaSetting *TFASetting `json:"tfaSetting"` +} + +// TFASettingWhereInput is used for filtering TFASetting objects. +// Input was generated by ent. +type TFASettingWhereInput struct { + Not *TFASettingWhereInput `json:"not,omitempty"` + And []*TFASettingWhereInput `json:"and,omitempty"` + Or []*TFASettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // tfa_secret field predicates + TfaSecret *string `json:"tfaSecret,omitempty"` + TfaSecretNeq *string `json:"tfaSecretNEQ,omitempty"` + TfaSecretIn []string `json:"tfaSecretIn,omitempty"` + TfaSecretNotIn []string `json:"tfaSecretNotIn,omitempty"` + TfaSecretGt *string `json:"tfaSecretGT,omitempty"` + TfaSecretGte *string `json:"tfaSecretGTE,omitempty"` + TfaSecretLt *string `json:"tfaSecretLT,omitempty"` + TfaSecretLte *string `json:"tfaSecretLTE,omitempty"` + TfaSecretContains *string `json:"tfaSecretContains,omitempty"` + TfaSecretHasPrefix *string `json:"tfaSecretHasPrefix,omitempty"` + TfaSecretHasSuffix *string `json:"tfaSecretHasSuffix,omitempty"` + TfaSecretIsNil *bool `json:"tfaSecretIsNil,omitempty"` + TfaSecretNotNil *bool `json:"tfaSecretNotNil,omitempty"` + TfaSecretEqualFold *string `json:"tfaSecretEqualFold,omitempty"` + TfaSecretContainsFold *string `json:"tfaSecretContainsFold,omitempty"` + // verified field predicates + Verified *bool `json:"verified,omitempty"` + VerifiedNeq *bool `json:"verifiedNEQ,omitempty"` + // totp_allowed field predicates + TotpAllowed *bool `json:"totpAllowed,omitempty"` + TotpAllowedNeq *bool `json:"totpAllowedNEQ,omitempty"` + TotpAllowedIsNil *bool `json:"totpAllowedIsNil,omitempty"` + TotpAllowedNotNil *bool `json:"totpAllowedNotNil,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*UserWhereInput `json:"hasOwnerWith,omitempty"` +} + +type Template struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the template + Name string `json:"name"` + // the type of the template, either a provided template or an implementation (document) + TemplateType enums.DocumentType `json:"templateType"` + // the description of the template + Description *string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Documents []*DocumentData `json:"documents,omitempty"` +} + +func (Template) IsNode() {} + +// Return response for createBulkTemplate mutation +type TemplateBulkCreatePayload struct { + // Created templates + Templates []*Template `json:"templates,omitempty"` +} + +// A connection to a list of items. +type TemplateConnection struct { + // A list of edges. + Edges []*TemplateEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createTemplate mutation +type TemplateCreatePayload struct { + // Created template + Template *Template `json:"template"` +} + +// Return response for deleteTemplate mutation +type TemplateDeletePayload struct { + // Deleted template ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type TemplateEdge struct { + // The item at the end of the edge. + Node *Template `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type TemplateHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the template + Name string `json:"name"` + // the type of the template, either a provided template or an implementation (document) + TemplateType enums.DocumentType `json:"templateType"` + // the description of the template + Description *string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` +} + +func (TemplateHistory) IsNode() {} + +// A connection to a list of items. +type TemplateHistoryConnection struct { + // A list of edges. + Edges []*TemplateHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type TemplateHistoryEdge struct { + // The item at the end of the edge. + Node *TemplateHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for TemplateHistory connections +type TemplateHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order TemplateHistories. + Field TemplateHistoryOrderField `json:"field"` +} + +// TemplateHistoryWhereInput is used for filtering TemplateHistory objects. +// Input was generated by ent. +type TemplateHistoryWhereInput struct { + Not *TemplateHistoryWhereInput `json:"not,omitempty"` + And []*TemplateHistoryWhereInput `json:"and,omitempty"` + Or []*TemplateHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // template_type field predicates + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + TemplateTypeNeq *enums.DocumentType `json:"templateTypeNEQ,omitempty"` + TemplateTypeIn []enums.DocumentType `json:"templateTypeIn,omitempty"` + TemplateTypeNotIn []enums.DocumentType `json:"templateTypeNotIn,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` +} + +// Ordering options for Template connections +type TemplateOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Templates. + Field TemplateOrderField `json:"field"` +} + +// Return response for updateTemplate mutation +type TemplateUpdatePayload struct { + // Updated template + Template *Template `json:"template"` +} + +// TemplateWhereInput is used for filtering Template objects. +// Input was generated by ent. +type TemplateWhereInput struct { + Not *TemplateWhereInput `json:"not,omitempty"` + And []*TemplateWhereInput `json:"and,omitempty"` + Or []*TemplateWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // template_type field predicates + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + TemplateTypeNeq *enums.DocumentType `json:"templateTypeNEQ,omitempty"` + TemplateTypeIn []enums.DocumentType `json:"templateTypeIn,omitempty"` + TemplateTypeNotIn []enums.DocumentType `json:"templateTypeNotIn,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // documents edge predicates + HasDocuments *bool `json:"hasDocuments,omitempty"` + HasDocumentsWith []*DocumentDataWhereInput `json:"hasDocumentsWith,omitempty"` +} + +// UpdateAPITokenInput is used for update APIToken object. +// Input was generated by ent. +type UpdateAPITokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name associated with the token + Name *string `json:"name,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + Scopes []string `json:"scopes,omitempty"` + AppendScopes []string `json:"appendScopes,omitempty"` + ClearScopes *bool `json:"clearScopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + ClearLastUsedAt *bool `json:"clearLastUsedAt,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` +} + +// UpdateContactInput is used for update Contact object. +// Input was generated by ent. +type UpdateContactInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the full name of the contact + FullName *string `json:"fullName,omitempty"` + // the title of the contact + Title *string `json:"title,omitempty"` + ClearTitle *bool `json:"clearTitle,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + ClearCompany *bool `json:"clearCompany,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + ClearEmail *bool `json:"clearEmail,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + ClearPhoneNumber *bool `json:"clearPhoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + ClearAddress *bool `json:"clearAddress,omitempty"` + // status of the contact + Status *enums.UserStatus `json:"status,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntities *bool `json:"clearEntities,omitempty"` +} + +// UpdateDocumentDataInput is used for update DocumentData object. +// Input was generated by ent. +type UpdateDocumentDataInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the json data of the document + Data json.RawMessage `json:"data,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + TemplateID *string `json:"templateID,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntity *bool `json:"clearEntity,omitempty"` +} + +// UpdateEntitlementInput is used for update Entitlement object. +// Input was generated by ent. +type UpdateEntitlementInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ClearExternalCustomerID *bool `json:"clearExternalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ClearExternalSubscriptionID *bool `json:"clearExternalSubscriptionID,omitempty"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ClearExpiresAt *bool `json:"clearExpiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled *bool `json:"cancelled,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateEntitlementPlanFeatureInput is used for update EntitlementPlanFeature object. +// Input was generated by ent. +type UpdateEntitlementPlanFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateEntitlementPlanInput is used for update EntitlementPlan object. +// Input was generated by ent. +type UpdateEntitlementPlanInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + ClearDisplayName *bool `json:"clearDisplayName,omitempty"` + // a description of the plan + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEntitlementIDs []string `json:"addEntitlementIDs,omitempty"` + RemoveEntitlementIDs []string `json:"removeEntitlementIDs,omitempty"` + ClearEntitlements *bool `json:"clearEntitlements,omitempty"` + AddBaseFeatureIDs []string `json:"addBaseFeatureIDs,omitempty"` + RemoveBaseFeatureIDs []string `json:"removeBaseFeatureIDs,omitempty"` + ClearBaseFeatures *bool `json:"clearBaseFeatures,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateEntityInput is used for update Entity object. +// Input was generated by ent. +type UpdateEntityInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + ClearName *bool `json:"clearName,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + ClearDisplayName *bool `json:"clearDisplayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + AppendDomains []string `json:"appendDomains,omitempty"` + ClearDomains *bool `json:"clearDomains,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` + ClearStatus *bool `json:"clearStatus,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddContactIDs []string `json:"addContactIDs,omitempty"` + RemoveContactIDs []string `json:"removeContactIDs,omitempty"` + ClearContacts *bool `json:"clearContacts,omitempty"` + AddDocumentIDs []string `json:"addDocumentIDs,omitempty"` + RemoveDocumentIDs []string `json:"removeDocumentIDs,omitempty"` + ClearDocuments *bool `json:"clearDocuments,omitempty"` + AddNoteIDs []string `json:"addNoteIDs,omitempty"` + RemoveNoteIDs []string `json:"removeNoteIDs,omitempty"` + ClearNotes *bool `json:"clearNotes,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + EntityTypeID *string `json:"entityTypeID,omitempty"` + ClearEntityType *bool `json:"clearEntityType,omitempty"` + Note *CreateNoteInput `json:"note,omitempty"` +} + +// UpdateEntityTypeInput is used for update EntityType object. +// Input was generated by ent. +type UpdateEntityTypeInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntities *bool `json:"clearEntities,omitempty"` +} + +// UpdateEventInput is used for update Event object. +// Input was generated by ent. +type UpdateEventInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + EventID *string `json:"eventID,omitempty"` + ClearEventID *bool `json:"clearEventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + ClearCorrelationID *bool `json:"clearCorrelationID,omitempty"` + EventType *string `json:"eventType,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + AddUserIDs []string `json:"addUserIDs,omitempty"` + RemoveUserIDs []string `json:"removeUserIDs,omitempty"` + ClearUser *bool `json:"clearUser,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroup *bool `json:"clearGroup,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegration *bool `json:"clearIntegration,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` + AddInviteIDs []string `json:"addInviteIDs,omitempty"` + RemoveInviteIDs []string `json:"removeInviteIDs,omitempty"` + ClearInvite *bool `json:"clearInvite,omitempty"` + AddFeatureIDs []string `json:"addFeatureIDs,omitempty"` + RemoveFeatureIDs []string `json:"removeFeatureIDs,omitempty"` + ClearFeature *bool `json:"clearFeature,omitempty"` + AddEntitlementplanIDs []string `json:"addEntitlementplanIDs,omitempty"` + RemoveEntitlementplanIDs []string `json:"removeEntitlementplanIDs,omitempty"` + ClearEntitlementplan *bool `json:"clearEntitlementplan,omitempty"` + AddPersonalAccessTokenIDs []string `json:"addPersonalAccessTokenIDs,omitempty"` + RemovePersonalAccessTokenIDs []string `json:"removePersonalAccessTokenIDs,omitempty"` + ClearPersonalAccessToken *bool `json:"clearPersonalAccessToken,omitempty"` + AddOauth2tokenIDs []string `json:"addOauth2tokenIDs,omitempty"` + RemoveOauth2tokenIDs []string `json:"removeOauth2tokenIDs,omitempty"` + ClearOauth2token *bool `json:"clearOauth2token,omitempty"` + AddHushIDs []string `json:"addHushIDs,omitempty"` + RemoveHushIDs []string `json:"removeHushIDs,omitempty"` + ClearHush *bool `json:"clearHush,omitempty"` + AddEntitlementIDs []string `json:"addEntitlementIDs,omitempty"` + RemoveEntitlementIDs []string `json:"removeEntitlementIDs,omitempty"` + ClearEntitlement *bool `json:"clearEntitlement,omitempty"` + AddWebhookIDs []string `json:"addWebhookIDs,omitempty"` + RemoveWebhookIDs []string `json:"removeWebhookIDs,omitempty"` + ClearWebhook *bool `json:"clearWebhook,omitempty"` + AddSubscriberIDs []string `json:"addSubscriberIDs,omitempty"` + RemoveSubscriberIDs []string `json:"removeSubscriberIDs,omitempty"` + ClearSubscriber *bool `json:"clearSubscriber,omitempty"` +} + +// UpdateFeatureInput is used for update Feature object. +// Input was generated by ent. +type UpdateFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + ClearDisplayName *bool `json:"clearDisplayName,omitempty"` + // enabled features are available for use + Enabled *bool `json:"enabled,omitempty"` + // a description of the feature + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddPlanIDs []string `json:"addPlanIDs,omitempty"` + RemovePlanIDs []string `json:"removePlanIDs,omitempty"` + ClearPlans *bool `json:"clearPlans,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateFileInput is used for update File object. +// Input was generated by ent. +type UpdateFileInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + FileName *string `json:"fileName,omitempty"` + FileExtension *string `json:"fileExtension,omitempty"` + FileSize *int64 `json:"fileSize,omitempty"` + ClearFileSize *bool `json:"clearFileSize,omitempty"` + ContentType *string `json:"contentType,omitempty"` + StoreKey *string `json:"storeKey,omitempty"` + Category *string `json:"category,omitempty"` + ClearCategory *bool `json:"clearCategory,omitempty"` + Annotation *string `json:"annotation,omitempty"` + ClearAnnotation *bool `json:"clearAnnotation,omitempty"` + UserID *string `json:"userID,omitempty"` + ClearUser *bool `json:"clearUser,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntity *bool `json:"clearEntity,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroup *bool `json:"clearGroup,omitempty"` +} + +// UpdateGroupInput is used for update Group object. +// Input was generated by ent. +type UpdateGroupInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the group - must be unique within the organization + Name *string `json:"name,omitempty"` + // the groups description + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + ClearGravatarLogoURL *bool `json:"clearGravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + ClearLogoURL *bool `json:"clearLogoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + SettingID *string `json:"settingID,omitempty"` + AddUserIDs []string `json:"addUserIDs,omitempty"` + RemoveUserIDs []string `json:"removeUserIDs,omitempty"` + ClearUsers *bool `json:"clearUsers,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + AddGroupMembers []*CreateGroupMembershipInput `json:"addGroupMembers,omitempty"` + UpdateGroupSettings *UpdateGroupSettingInput `json:"updateGroupSettings,omitempty"` +} + +// UpdateGroupMembershipInput is used for update GroupMembership object. +// Input was generated by ent. +type UpdateGroupMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateGroupSettingInput is used for update GroupSetting object. +// Input was generated by ent. +type UpdateGroupSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility *enums.Visibility `json:"visibility,omitempty"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + ClearSyncToSlack *bool `json:"clearSyncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + ClearSyncToGithub *bool `json:"clearSyncToGithub,omitempty"` + GroupID *string `json:"groupID,omitempty"` + ClearGroup *bool `json:"clearGroup,omitempty"` +} + +// UpdateHushInput is used for update Hush object. +// Input was generated by ent. +type UpdateHushInput struct { + // the logical name of the corresponding hush secret or it's general grouping + Name *string `json:"name,omitempty"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + ClearKind *bool `json:"clearKind,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateIntegrationInput is used for update Integration object. +// Input was generated by ent. +type UpdateIntegrationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the integration - must be unique within the organization + Name *string `json:"name,omitempty"` + // a description of the integration + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + Kind *string `json:"kind,omitempty"` + ClearKind *bool `json:"clearKind,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddSecretIDs []string `json:"addSecretIDs,omitempty"` + RemoveSecretIDs []string `json:"removeSecretIDs,omitempty"` + ClearSecrets *bool `json:"clearSecrets,omitempty"` + AddOauth2tokenIDs []string `json:"addOauth2tokenIDs,omitempty"` + RemoveOauth2tokenIDs []string `json:"removeOauth2tokenIDs,omitempty"` + ClearOauth2tokens *bool `json:"clearOauth2tokens,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddWebhookIDs []string `json:"addWebhookIDs,omitempty"` + RemoveWebhookIDs []string `json:"removeWebhookIDs,omitempty"` + ClearWebhooks *bool `json:"clearWebhooks,omitempty"` +} + +// UpdateInviteInput is used for update Invite object. +// Input was generated by ent. +type UpdateInviteInput struct { + // the expiration date of the invitation token which defaults to 14 days in the future from creation + Expires *time.Time `json:"expires,omitempty"` + ClearExpires *bool `json:"clearExpires,omitempty"` + // the status of the invitation + Status *enums.InviteStatus `json:"status,omitempty"` + Role *enums.Role `json:"role,omitempty"` + // the number of attempts made to perform email send of the invitation, maximum of 5 + SendAttempts *int64 `json:"sendAttempts,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateNoteInput is used for update Note object. +// Input was generated by ent. +type UpdateNoteInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the text of the note + Text *string `json:"text,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + EntityID *string `json:"entityID,omitempty"` + ClearEntity *bool `json:"clearEntity,omitempty"` +} + +// UpdateOauthProviderInput is used for update OauthProvider object. +// Input was generated by ent. +type UpdateOauthProviderInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the oauth provider's name + Name *string `json:"name,omitempty"` + // the client id for the oauth provider + ClientID *string `json:"clientID,omitempty"` + // the client secret + ClientSecret *string `json:"clientSecret,omitempty"` + // the redirect url + RedirectURL *string `json:"redirectURL,omitempty"` + // the scopes + Scopes *string `json:"scopes,omitempty"` + // the auth url of the provider + AuthURL *string `json:"authURL,omitempty"` + // the token url of the provider + TokenURL *string `json:"tokenURL,omitempty"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle *string `json:"authStyle,omitempty"` + // the URL to request user information by token + InfoURL *string `json:"infoURL,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` +} + +// UpdateOhAuthTooTokenInput is used for update OhAuthTooToken object. +// Input was generated by ent. +type UpdateOhAuthTooTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + ClientID *string `json:"clientID,omitempty"` + Scopes []string `json:"scopes,omitempty"` + AppendScopes []string `json:"appendScopes,omitempty"` + ClearScopes *bool `json:"clearScopes,omitempty"` + Nonce *string `json:"nonce,omitempty"` + ClaimsUserID *string `json:"claimsUserID,omitempty"` + ClaimsUsername *string `json:"claimsUsername,omitempty"` + ClaimsEmail *string `json:"claimsEmail,omitempty"` + ClaimsEmailVerified *bool `json:"claimsEmailVerified,omitempty"` + ClaimsGroups []string `json:"claimsGroups,omitempty"` + AppendClaimsGroups []string `json:"appendClaimsGroups,omitempty"` + ClearClaimsGroups *bool `json:"clearClaimsGroups,omitempty"` + ClaimsPreferredUsername *string `json:"claimsPreferredUsername,omitempty"` + ConnectorID *string `json:"connectorID,omitempty"` + ConnectorData []string `json:"connectorData,omitempty"` + AppendConnectorData []string `json:"appendConnectorData,omitempty"` + ClearConnectorData *bool `json:"clearConnectorData,omitempty"` + LastUsed *time.Time `json:"lastUsed,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegration *bool `json:"clearIntegration,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateOrgMembershipInput is used for update OrgMembership object. +// Input was generated by ent. +type UpdateOrgMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateOrganizationInput is used for update Organization object. +// Input was generated by ent. +type UpdateOrganizationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the organization + Name *string `json:"name,omitempty"` + // The organization's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + ClearAvatarRemoteURL *bool `json:"clearAvatarRemoteURL,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroups *bool `json:"clearGroups,omitempty"` + AddTemplateIDs []string `json:"addTemplateIDs,omitempty"` + RemoveTemplateIDs []string `json:"removeTemplateIDs,omitempty"` + ClearTemplates *bool `json:"clearTemplates,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` + SettingID *string `json:"settingID,omitempty"` + ClearSetting *bool `json:"clearSetting,omitempty"` + AddDocumentdatumIDs []string `json:"addDocumentdatumIDs,omitempty"` + RemoveDocumentdatumIDs []string `json:"removeDocumentdatumIDs,omitempty"` + ClearDocumentdata *bool `json:"clearDocumentdata,omitempty"` + AddEntitlementIDs []string `json:"addEntitlementIDs,omitempty"` + RemoveEntitlementIDs []string `json:"removeEntitlementIDs,omitempty"` + ClearEntitlements *bool `json:"clearEntitlements,omitempty"` + AddOrganizationEntitlementIDs []string `json:"addOrganizationEntitlementIDs,omitempty"` + RemoveOrganizationEntitlementIDs []string `json:"removeOrganizationEntitlementIDs,omitempty"` + ClearOrganizationEntitlement *bool `json:"clearOrganizationEntitlement,omitempty"` + AddPersonalAccessTokenIDs []string `json:"addPersonalAccessTokenIDs,omitempty"` + RemovePersonalAccessTokenIDs []string `json:"removePersonalAccessTokenIDs,omitempty"` + ClearPersonalAccessTokens *bool `json:"clearPersonalAccessTokens,omitempty"` + AddAPITokenIDs []string `json:"addAPITokenIDs,omitempty"` + RemoveAPITokenIDs []string `json:"removeAPITokenIDs,omitempty"` + ClearAPITokens *bool `json:"clearAPITokens,omitempty"` + AddOauthproviderIDs []string `json:"addOauthproviderIDs,omitempty"` + RemoveOauthproviderIDs []string `json:"removeOauthproviderIDs,omitempty"` + ClearOauthprovider *bool `json:"clearOauthprovider,omitempty"` + AddUserIDs []string `json:"addUserIDs,omitempty"` + RemoveUserIDs []string `json:"removeUserIDs,omitempty"` + ClearUsers *bool `json:"clearUsers,omitempty"` + AddInviteIDs []string `json:"addInviteIDs,omitempty"` + RemoveInviteIDs []string `json:"removeInviteIDs,omitempty"` + ClearInvites *bool `json:"clearInvites,omitempty"` + AddSubscriberIDs []string `json:"addSubscriberIDs,omitempty"` + RemoveSubscriberIDs []string `json:"removeSubscriberIDs,omitempty"` + ClearSubscribers *bool `json:"clearSubscribers,omitempty"` + AddWebhookIDs []string `json:"addWebhookIDs,omitempty"` + RemoveWebhookIDs []string `json:"removeWebhookIDs,omitempty"` + ClearWebhooks *bool `json:"clearWebhooks,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddSecretIDs []string `json:"addSecretIDs,omitempty"` + RemoveSecretIDs []string `json:"removeSecretIDs,omitempty"` + ClearSecrets *bool `json:"clearSecrets,omitempty"` + AddFeatureIDs []string `json:"addFeatureIDs,omitempty"` + RemoveFeatureIDs []string `json:"removeFeatureIDs,omitempty"` + ClearFeatures *bool `json:"clearFeatures,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + AddEntitlementplanIDs []string `json:"addEntitlementplanIDs,omitempty"` + RemoveEntitlementplanIDs []string `json:"removeEntitlementplanIDs,omitempty"` + ClearEntitlementplans *bool `json:"clearEntitlementplans,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntities *bool `json:"clearEntities,omitempty"` + AddEntitytypeIDs []string `json:"addEntitytypeIDs,omitempty"` + RemoveEntitytypeIDs []string `json:"removeEntitytypeIDs,omitempty"` + ClearEntitytypes *bool `json:"clearEntitytypes,omitempty"` + AddContactIDs []string `json:"addContactIDs,omitempty"` + RemoveContactIDs []string `json:"removeContactIDs,omitempty"` + ClearContacts *bool `json:"clearContacts,omitempty"` + AddNoteIDs []string `json:"addNoteIDs,omitempty"` + RemoveNoteIDs []string `json:"removeNoteIDs,omitempty"` + ClearNotes *bool `json:"clearNotes,omitempty"` + AddOrgMembers []*CreateOrgMembershipInput `json:"addOrgMembers,omitempty"` + UpdateOrgSettings *UpdateOrganizationSettingInput `json:"updateOrgSettings,omitempty"` +} + +// UpdateOrganizationSettingInput is used for update OrganizationSetting object. +// Input was generated by ent. +type UpdateOrganizationSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + AppendDomains []string `json:"appendDomains,omitempty"` + ClearDomains *bool `json:"clearDomains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + ClearBillingContact *bool `json:"clearBillingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + ClearBillingEmail *bool `json:"clearBillingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + ClearBillingPhone *bool `json:"clearBillingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + ClearBillingAddress *bool `json:"clearBillingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + ClearTaxIdentifier *bool `json:"clearTaxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + ClearGeoLocation *bool `json:"clearGeoLocation,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` +} + +// UpdatePersonalAccessTokenInput is used for update PersonalAccessToken object. +// Input was generated by ent. +type UpdatePersonalAccessTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name associated with the token + Name *string `json:"name,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + Scopes []string `json:"scopes,omitempty"` + AppendScopes []string `json:"appendScopes,omitempty"` + ClearScopes *bool `json:"clearScopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + ClearLastUsedAt *bool `json:"clearLastUsedAt,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganizations *bool `json:"clearOrganizations,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateSubscriberInput is used for update Subscriber object. +// Input was generated by ent. +type UpdateSubscriberInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // email address of the subscriber + Email *string `json:"email,omitempty"` + // phone number of the subscriber + PhoneNumber *string `json:"phoneNumber,omitempty"` + ClearPhoneNumber *bool `json:"clearPhoneNumber,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateTFASettingInput is used for update TFASetting object. +// Input was generated by ent. +type UpdateTFASettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // specifies if the TFA device has been verified + Verified *bool `json:"verified,omitempty"` + // specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + TotpAllowed *bool `json:"totpAllowed,omitempty"` + ClearTotpAllowed *bool `json:"clearTotpAllowed,omitempty"` + // Whether to regenerate backup codes + RegenBackupCodes *bool `json:"regenBackupCodes,omitempty"` +} + +// UpdateTemplateInput is used for update Template object. +// Input was generated by ent. +type UpdateTemplateInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the template + Name *string `json:"name,omitempty"` + // the type of the template, either a provided template or an implementation (document) + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + // the description of the template + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig,omitempty"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` + ClearUischema *bool `json:"clearUischema,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddDocumentIDs []string `json:"addDocumentIDs,omitempty"` + RemoveDocumentIDs []string `json:"removeDocumentIDs,omitempty"` + ClearDocuments *bool `json:"clearDocuments,omitempty"` +} + +// UpdateUserInput is used for update User object. +// Input was generated by ent. +type UpdateUserInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + Email *string `json:"email,omitempty"` + FirstName *string `json:"firstName,omitempty"` + ClearFirstName *bool `json:"clearFirstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + ClearLastName *bool `json:"clearLastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + ClearAvatarRemoteURL *bool `json:"clearAvatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + ClearAvatarLocalFile *bool `json:"clearAvatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + ClearAvatarUpdatedAt *bool `json:"clearAvatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + ClearLastSeen *bool `json:"clearLastSeen,omitempty"` + // user password hash + Password *string `json:"password,omitempty"` + ClearPassword *bool `json:"clearPassword,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + ClearSub *bool `json:"clearSub,omitempty"` + // auth provider used to register the account + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + // the user's role + Role *enums.Role `json:"role,omitempty"` + ClearRole *bool `json:"clearRole,omitempty"` + AddPersonalAccessTokenIDs []string `json:"addPersonalAccessTokenIDs,omitempty"` + RemovePersonalAccessTokenIDs []string `json:"removePersonalAccessTokenIDs,omitempty"` + ClearPersonalAccessTokens *bool `json:"clearPersonalAccessTokens,omitempty"` + AddTfaSettingIDs []string `json:"addTfaSettingIDs,omitempty"` + RemoveTfaSettingIDs []string `json:"removeTfaSettingIDs,omitempty"` + ClearTfaSettings *bool `json:"clearTfaSettings,omitempty"` + SettingID *string `json:"settingID,omitempty"` + AddEmailVerificationTokenIDs []string `json:"addEmailVerificationTokenIDs,omitempty"` + RemoveEmailVerificationTokenIDs []string `json:"removeEmailVerificationTokenIDs,omitempty"` + ClearEmailVerificationTokens *bool `json:"clearEmailVerificationTokens,omitempty"` + AddPasswordResetTokenIDs []string `json:"addPasswordResetTokenIDs,omitempty"` + RemovePasswordResetTokenIDs []string `json:"removePasswordResetTokenIDs,omitempty"` + ClearPasswordResetTokens *bool `json:"clearPasswordResetTokens,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroups *bool `json:"clearGroups,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganizations *bool `json:"clearOrganizations,omitempty"` + AddWebauthnIDs []string `json:"addWebauthnIDs,omitempty"` + RemoveWebauthnIDs []string `json:"removeWebauthnIDs,omitempty"` + ClearWebauthn *bool `json:"clearWebauthn,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateUserSettingInput is used for update UserSetting object. +// Input was generated by ent. +type UpdateUserSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked *bool `json:"locked,omitempty"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + ClearSilencedAt *bool `json:"clearSilencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + ClearSuspendedAt *bool `json:"clearSuspendedAt,omitempty"` + // status of the user account + Status *enums.UserStatus `json:"status,omitempty"` + // whether the user has confirmed their email address + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + ClearIsWebauthnAllowed *bool `json:"clearIsWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + ClearIsTfaEnabled *bool `json:"clearIsTfaEnabled,omitempty"` + UserID *string `json:"userID,omitempty"` + ClearUser *bool `json:"clearUser,omitempty"` + DefaultOrgID *string `json:"defaultOrgID,omitempty"` + ClearDefaultOrg *bool `json:"clearDefaultOrg,omitempty"` +} + +// UpdateWebhookInput is used for update Webhook object. +// Input was generated by ent. +type UpdateWebhookInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the webhook + Name *string `json:"name,omitempty"` + // a description of the webhook + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the url to send the webhook to + DestinationURL *string `json:"destinationURL,omitempty"` + // indicates if the webhook is active and enabled + Enabled *bool `json:"enabled,omitempty"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + ClearFailures *bool `json:"clearFailures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + ClearLastError *bool `json:"clearLastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` + ClearLastResponse *bool `json:"clearLastResponse,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` +} + +type User struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + Email string `json:"email"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"displayName"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider enums.AuthProvider `json:"authProvider"` + // the user's role + Role *enums.Role `json:"role,omitempty"` + PersonalAccessTokens []*PersonalAccessToken `json:"personalAccessTokens,omitempty"` + TfaSettings []*TFASetting `json:"tfaSettings,omitempty"` + Setting *UserSetting `json:"setting"` + Groups []*Group `json:"groups,omitempty"` + Organizations []*Organization `json:"organizations,omitempty"` + Files []*File `json:"files,omitempty"` + Events []*Event `json:"events,omitempty"` + GroupMemberships []*GroupMembership `json:"groupMemberships,omitempty"` + OrgMemberships []*OrgMembership `json:"orgMemberships,omitempty"` +} + +func (User) IsNode() {} + +// Return response for createBulkUser mutation +type UserBulkCreatePayload struct { + // Created users + Users []*User `json:"users,omitempty"` +} + +// A connection to a list of items. +type UserConnection struct { + // A list of edges. + Edges []*UserEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createUser mutation +type UserCreatePayload struct { + // Created user + User *User `json:"user"` +} + +// Return response for deleteUser mutation +type UserDeletePayload struct { + // Deleted user ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type UserEdge struct { + // The item at the end of the edge. + Node *User `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type UserHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + Email string `json:"email"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"displayName"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider enums.AuthProvider `json:"authProvider"` + // the user's role + Role *enums.Role `json:"role,omitempty"` +} + +func (UserHistory) IsNode() {} + +// A connection to a list of items. +type UserHistoryConnection struct { + // A list of edges. + Edges []*UserHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type UserHistoryEdge struct { + // The item at the end of the edge. + Node *UserHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for UserHistory connections +type UserHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order UserHistories. + Field UserHistoryOrderField `json:"field"` +} + +// UserHistoryWhereInput is used for filtering UserHistory objects. +// Input was generated by ent. +type UserHistoryWhereInput struct { + Not *UserHistoryWhereInput `json:"not,omitempty"` + And []*UserHistoryWhereInput `json:"and,omitempty"` + Or []*UserHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // first_name field predicates + FirstName *string `json:"firstName,omitempty"` + FirstNameNeq *string `json:"firstNameNEQ,omitempty"` + FirstNameIn []string `json:"firstNameIn,omitempty"` + FirstNameNotIn []string `json:"firstNameNotIn,omitempty"` + FirstNameGt *string `json:"firstNameGT,omitempty"` + FirstNameGte *string `json:"firstNameGTE,omitempty"` + FirstNameLt *string `json:"firstNameLT,omitempty"` + FirstNameLte *string `json:"firstNameLTE,omitempty"` + FirstNameContains *string `json:"firstNameContains,omitempty"` + FirstNameHasPrefix *string `json:"firstNameHasPrefix,omitempty"` + FirstNameHasSuffix *string `json:"firstNameHasSuffix,omitempty"` + FirstNameIsNil *bool `json:"firstNameIsNil,omitempty"` + FirstNameNotNil *bool `json:"firstNameNotNil,omitempty"` + FirstNameEqualFold *string `json:"firstNameEqualFold,omitempty"` + FirstNameContainsFold *string `json:"firstNameContainsFold,omitempty"` + // last_name field predicates + LastName *string `json:"lastName,omitempty"` + LastNameNeq *string `json:"lastNameNEQ,omitempty"` + LastNameIn []string `json:"lastNameIn,omitempty"` + LastNameNotIn []string `json:"lastNameNotIn,omitempty"` + LastNameGt *string `json:"lastNameGT,omitempty"` + LastNameGte *string `json:"lastNameGTE,omitempty"` + LastNameLt *string `json:"lastNameLT,omitempty"` + LastNameLte *string `json:"lastNameLTE,omitempty"` + LastNameContains *string `json:"lastNameContains,omitempty"` + LastNameHasPrefix *string `json:"lastNameHasPrefix,omitempty"` + LastNameHasSuffix *string `json:"lastNameHasSuffix,omitempty"` + LastNameIsNil *bool `json:"lastNameIsNil,omitempty"` + LastNameNotNil *bool `json:"lastNameNotNil,omitempty"` + LastNameEqualFold *string `json:"lastNameEqualFold,omitempty"` + LastNameContainsFold *string `json:"lastNameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + // avatar_local_file field predicates + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + AvatarLocalFileNeq *string `json:"avatarLocalFileNEQ,omitempty"` + AvatarLocalFileIn []string `json:"avatarLocalFileIn,omitempty"` + AvatarLocalFileNotIn []string `json:"avatarLocalFileNotIn,omitempty"` + AvatarLocalFileGt *string `json:"avatarLocalFileGT,omitempty"` + AvatarLocalFileGte *string `json:"avatarLocalFileGTE,omitempty"` + AvatarLocalFileLt *string `json:"avatarLocalFileLT,omitempty"` + AvatarLocalFileLte *string `json:"avatarLocalFileLTE,omitempty"` + AvatarLocalFileContains *string `json:"avatarLocalFileContains,omitempty"` + AvatarLocalFileHasPrefix *string `json:"avatarLocalFileHasPrefix,omitempty"` + AvatarLocalFileHasSuffix *string `json:"avatarLocalFileHasSuffix,omitempty"` + AvatarLocalFileIsNil *bool `json:"avatarLocalFileIsNil,omitempty"` + AvatarLocalFileNotNil *bool `json:"avatarLocalFileNotNil,omitempty"` + AvatarLocalFileEqualFold *string `json:"avatarLocalFileEqualFold,omitempty"` + AvatarLocalFileContainsFold *string `json:"avatarLocalFileContainsFold,omitempty"` + // avatar_updated_at field predicates + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + AvatarUpdatedAtNeq *time.Time `json:"avatarUpdatedAtNEQ,omitempty"` + AvatarUpdatedAtIn []*time.Time `json:"avatarUpdatedAtIn,omitempty"` + AvatarUpdatedAtNotIn []*time.Time `json:"avatarUpdatedAtNotIn,omitempty"` + AvatarUpdatedAtGt *time.Time `json:"avatarUpdatedAtGT,omitempty"` + AvatarUpdatedAtGte *time.Time `json:"avatarUpdatedAtGTE,omitempty"` + AvatarUpdatedAtLt *time.Time `json:"avatarUpdatedAtLT,omitempty"` + AvatarUpdatedAtLte *time.Time `json:"avatarUpdatedAtLTE,omitempty"` + AvatarUpdatedAtIsNil *bool `json:"avatarUpdatedAtIsNil,omitempty"` + AvatarUpdatedAtNotNil *bool `json:"avatarUpdatedAtNotNil,omitempty"` + // last_seen field predicates + LastSeen *time.Time `json:"lastSeen,omitempty"` + LastSeenNeq *time.Time `json:"lastSeenNEQ,omitempty"` + LastSeenIn []*time.Time `json:"lastSeenIn,omitempty"` + LastSeenNotIn []*time.Time `json:"lastSeenNotIn,omitempty"` + LastSeenGt *time.Time `json:"lastSeenGT,omitempty"` + LastSeenGte *time.Time `json:"lastSeenGTE,omitempty"` + LastSeenLt *time.Time `json:"lastSeenLT,omitempty"` + LastSeenLte *time.Time `json:"lastSeenLTE,omitempty"` + LastSeenIsNil *bool `json:"lastSeenIsNil,omitempty"` + LastSeenNotNil *bool `json:"lastSeenNotNil,omitempty"` + // sub field predicates + Sub *string `json:"sub,omitempty"` + SubNeq *string `json:"subNEQ,omitempty"` + SubIn []string `json:"subIn,omitempty"` + SubNotIn []string `json:"subNotIn,omitempty"` + SubGt *string `json:"subGT,omitempty"` + SubGte *string `json:"subGTE,omitempty"` + SubLt *string `json:"subLT,omitempty"` + SubLte *string `json:"subLTE,omitempty"` + SubContains *string `json:"subContains,omitempty"` + SubHasPrefix *string `json:"subHasPrefix,omitempty"` + SubHasSuffix *string `json:"subHasSuffix,omitempty"` + SubIsNil *bool `json:"subIsNil,omitempty"` + SubNotNil *bool `json:"subNotNil,omitempty"` + SubEqualFold *string `json:"subEqualFold,omitempty"` + SubContainsFold *string `json:"subContainsFold,omitempty"` + // auth_provider field predicates + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + AuthProviderNeq *enums.AuthProvider `json:"authProviderNEQ,omitempty"` + AuthProviderIn []enums.AuthProvider `json:"authProviderIn,omitempty"` + AuthProviderNotIn []enums.AuthProvider `json:"authProviderNotIn,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + RoleIsNil *bool `json:"roleIsNil,omitempty"` + RoleNotNil *bool `json:"roleNotNil,omitempty"` +} + +// Ordering options for User connections +type UserOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Users. + Field UserOrderField `json:"field"` +} + +type UserSearchResult struct { + Users []*User `json:"users,omitempty"` +} + +func (UserSearchResult) IsGlobalSearchResult() {} + +type UserSetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + UserID *string `json:"userID,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked bool `json:"locked"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + // status of the user account + Status enums.UserStatus `json:"status"` + // whether the user has confirmed their email address + EmailConfirmed bool `json:"emailConfirmed"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + User *User `json:"user,omitempty"` + // organization to load on user login + DefaultOrg *Organization `json:"defaultOrg,omitempty"` +} + +func (UserSetting) IsNode() {} + +// Return response for createBulkUserSetting mutation +type UserSettingBulkCreatePayload struct { + // Created userSettings + UserSettings []*UserSetting `json:"userSettings,omitempty"` +} + +// A connection to a list of items. +type UserSettingConnection struct { + // A list of edges. + Edges []*UserSettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createUserSetting mutation +type UserSettingCreatePayload struct { + // Created userSetting + UserSetting *UserSetting `json:"userSetting"` +} + +// An edge in a connection. +type UserSettingEdge struct { + // The item at the end of the edge. + Node *UserSetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type UserSettingHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + UserID *string `json:"userID,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked bool `json:"locked"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + // status of the user account + Status enums.UserStatus `json:"status"` + // whether the user has confirmed their email address + EmailConfirmed bool `json:"emailConfirmed"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` +} + +func (UserSettingHistory) IsNode() {} + +// A connection to a list of items. +type UserSettingHistoryConnection struct { + // A list of edges. + Edges []*UserSettingHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type UserSettingHistoryEdge struct { + // The item at the end of the edge. + Node *UserSettingHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// UserSettingHistoryWhereInput is used for filtering UserSettingHistory objects. +// Input was generated by ent. +type UserSettingHistoryWhereInput struct { + Not *UserSettingHistoryWhereInput `json:"not,omitempty"` + And []*UserSettingHistoryWhereInput `json:"and,omitempty"` + Or []*UserSettingHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDIsNil *bool `json:"userIDIsNil,omitempty"` + UserIDNotNil *bool `json:"userIDNotNil,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + // locked field predicates + Locked *bool `json:"locked,omitempty"` + LockedNeq *bool `json:"lockedNEQ,omitempty"` + // silenced_at field predicates + SilencedAt *time.Time `json:"silencedAt,omitempty"` + SilencedAtNeq *time.Time `json:"silencedAtNEQ,omitempty"` + SilencedAtIn []*time.Time `json:"silencedAtIn,omitempty"` + SilencedAtNotIn []*time.Time `json:"silencedAtNotIn,omitempty"` + SilencedAtGt *time.Time `json:"silencedAtGT,omitempty"` + SilencedAtGte *time.Time `json:"silencedAtGTE,omitempty"` + SilencedAtLt *time.Time `json:"silencedAtLT,omitempty"` + SilencedAtLte *time.Time `json:"silencedAtLTE,omitempty"` + SilencedAtIsNil *bool `json:"silencedAtIsNil,omitempty"` + SilencedAtNotNil *bool `json:"silencedAtNotNil,omitempty"` + // suspended_at field predicates + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + SuspendedAtNeq *time.Time `json:"suspendedAtNEQ,omitempty"` + SuspendedAtIn []*time.Time `json:"suspendedAtIn,omitempty"` + SuspendedAtNotIn []*time.Time `json:"suspendedAtNotIn,omitempty"` + SuspendedAtGt *time.Time `json:"suspendedAtGT,omitempty"` + SuspendedAtGte *time.Time `json:"suspendedAtGTE,omitempty"` + SuspendedAtLt *time.Time `json:"suspendedAtLT,omitempty"` + SuspendedAtLte *time.Time `json:"suspendedAtLTE,omitempty"` + SuspendedAtIsNil *bool `json:"suspendedAtIsNil,omitempty"` + SuspendedAtNotNil *bool `json:"suspendedAtNotNil,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + // email_confirmed field predicates + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + EmailConfirmedNeq *bool `json:"emailConfirmedNEQ,omitempty"` + // is_webauthn_allowed field predicates + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + IsWebauthnAllowedNeq *bool `json:"isWebauthnAllowedNEQ,omitempty"` + IsWebauthnAllowedIsNil *bool `json:"isWebauthnAllowedIsNil,omitempty"` + IsWebauthnAllowedNotNil *bool `json:"isWebauthnAllowedNotNil,omitempty"` + // is_tfa_enabled field predicates + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + IsTfaEnabledNeq *bool `json:"isTfaEnabledNEQ,omitempty"` + IsTfaEnabledIsNil *bool `json:"isTfaEnabledIsNil,omitempty"` + IsTfaEnabledNotNil *bool `json:"isTfaEnabledNotNil,omitempty"` +} + +// Return response for updateUserSetting mutation +type UserSettingUpdatePayload struct { + // Updated userSetting + UserSetting *UserSetting `json:"userSetting"` +} + +// UserSettingWhereInput is used for filtering UserSetting objects. +// Input was generated by ent. +type UserSettingWhereInput struct { + Not *UserSettingWhereInput `json:"not,omitempty"` + And []*UserSettingWhereInput `json:"and,omitempty"` + Or []*UserSettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDIsNil *bool `json:"userIDIsNil,omitempty"` + UserIDNotNil *bool `json:"userIDNotNil,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + // locked field predicates + Locked *bool `json:"locked,omitempty"` + LockedNeq *bool `json:"lockedNEQ,omitempty"` + // silenced_at field predicates + SilencedAt *time.Time `json:"silencedAt,omitempty"` + SilencedAtNeq *time.Time `json:"silencedAtNEQ,omitempty"` + SilencedAtIn []*time.Time `json:"silencedAtIn,omitempty"` + SilencedAtNotIn []*time.Time `json:"silencedAtNotIn,omitempty"` + SilencedAtGt *time.Time `json:"silencedAtGT,omitempty"` + SilencedAtGte *time.Time `json:"silencedAtGTE,omitempty"` + SilencedAtLt *time.Time `json:"silencedAtLT,omitempty"` + SilencedAtLte *time.Time `json:"silencedAtLTE,omitempty"` + SilencedAtIsNil *bool `json:"silencedAtIsNil,omitempty"` + SilencedAtNotNil *bool `json:"silencedAtNotNil,omitempty"` + // suspended_at field predicates + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + SuspendedAtNeq *time.Time `json:"suspendedAtNEQ,omitempty"` + SuspendedAtIn []*time.Time `json:"suspendedAtIn,omitempty"` + SuspendedAtNotIn []*time.Time `json:"suspendedAtNotIn,omitempty"` + SuspendedAtGt *time.Time `json:"suspendedAtGT,omitempty"` + SuspendedAtGte *time.Time `json:"suspendedAtGTE,omitempty"` + SuspendedAtLt *time.Time `json:"suspendedAtLT,omitempty"` + SuspendedAtLte *time.Time `json:"suspendedAtLTE,omitempty"` + SuspendedAtIsNil *bool `json:"suspendedAtIsNil,omitempty"` + SuspendedAtNotNil *bool `json:"suspendedAtNotNil,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + // email_confirmed field predicates + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + EmailConfirmedNeq *bool `json:"emailConfirmedNEQ,omitempty"` + // is_webauthn_allowed field predicates + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + IsWebauthnAllowedNeq *bool `json:"isWebauthnAllowedNEQ,omitempty"` + IsWebauthnAllowedIsNil *bool `json:"isWebauthnAllowedIsNil,omitempty"` + IsWebauthnAllowedNotNil *bool `json:"isWebauthnAllowedNotNil,omitempty"` + // is_tfa_enabled field predicates + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + IsTfaEnabledNeq *bool `json:"isTfaEnabledNEQ,omitempty"` + IsTfaEnabledIsNil *bool `json:"isTfaEnabledIsNil,omitempty"` + IsTfaEnabledNotNil *bool `json:"isTfaEnabledNotNil,omitempty"` + // user edge predicates + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + // default_org edge predicates + HasDefaultOrg *bool `json:"hasDefaultOrg,omitempty"` + HasDefaultOrgWith []*OrganizationWhereInput `json:"hasDefaultOrgWith,omitempty"` +} + +// Return response for updateUser mutation +type UserUpdatePayload struct { + // Updated user + User *User `json:"user"` +} + +// UserWhereInput is used for filtering User objects. +// Input was generated by ent. +type UserWhereInput struct { + Not *UserWhereInput `json:"not,omitempty"` + And []*UserWhereInput `json:"and,omitempty"` + Or []*UserWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // first_name field predicates + FirstName *string `json:"firstName,omitempty"` + FirstNameNeq *string `json:"firstNameNEQ,omitempty"` + FirstNameIn []string `json:"firstNameIn,omitempty"` + FirstNameNotIn []string `json:"firstNameNotIn,omitempty"` + FirstNameGt *string `json:"firstNameGT,omitempty"` + FirstNameGte *string `json:"firstNameGTE,omitempty"` + FirstNameLt *string `json:"firstNameLT,omitempty"` + FirstNameLte *string `json:"firstNameLTE,omitempty"` + FirstNameContains *string `json:"firstNameContains,omitempty"` + FirstNameHasPrefix *string `json:"firstNameHasPrefix,omitempty"` + FirstNameHasSuffix *string `json:"firstNameHasSuffix,omitempty"` + FirstNameIsNil *bool `json:"firstNameIsNil,omitempty"` + FirstNameNotNil *bool `json:"firstNameNotNil,omitempty"` + FirstNameEqualFold *string `json:"firstNameEqualFold,omitempty"` + FirstNameContainsFold *string `json:"firstNameContainsFold,omitempty"` + // last_name field predicates + LastName *string `json:"lastName,omitempty"` + LastNameNeq *string `json:"lastNameNEQ,omitempty"` + LastNameIn []string `json:"lastNameIn,omitempty"` + LastNameNotIn []string `json:"lastNameNotIn,omitempty"` + LastNameGt *string `json:"lastNameGT,omitempty"` + LastNameGte *string `json:"lastNameGTE,omitempty"` + LastNameLt *string `json:"lastNameLT,omitempty"` + LastNameLte *string `json:"lastNameLTE,omitempty"` + LastNameContains *string `json:"lastNameContains,omitempty"` + LastNameHasPrefix *string `json:"lastNameHasPrefix,omitempty"` + LastNameHasSuffix *string `json:"lastNameHasSuffix,omitempty"` + LastNameIsNil *bool `json:"lastNameIsNil,omitempty"` + LastNameNotNil *bool `json:"lastNameNotNil,omitempty"` + LastNameEqualFold *string `json:"lastNameEqualFold,omitempty"` + LastNameContainsFold *string `json:"lastNameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + // avatar_local_file field predicates + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + AvatarLocalFileNeq *string `json:"avatarLocalFileNEQ,omitempty"` + AvatarLocalFileIn []string `json:"avatarLocalFileIn,omitempty"` + AvatarLocalFileNotIn []string `json:"avatarLocalFileNotIn,omitempty"` + AvatarLocalFileGt *string `json:"avatarLocalFileGT,omitempty"` + AvatarLocalFileGte *string `json:"avatarLocalFileGTE,omitempty"` + AvatarLocalFileLt *string `json:"avatarLocalFileLT,omitempty"` + AvatarLocalFileLte *string `json:"avatarLocalFileLTE,omitempty"` + AvatarLocalFileContains *string `json:"avatarLocalFileContains,omitempty"` + AvatarLocalFileHasPrefix *string `json:"avatarLocalFileHasPrefix,omitempty"` + AvatarLocalFileHasSuffix *string `json:"avatarLocalFileHasSuffix,omitempty"` + AvatarLocalFileIsNil *bool `json:"avatarLocalFileIsNil,omitempty"` + AvatarLocalFileNotNil *bool `json:"avatarLocalFileNotNil,omitempty"` + AvatarLocalFileEqualFold *string `json:"avatarLocalFileEqualFold,omitempty"` + AvatarLocalFileContainsFold *string `json:"avatarLocalFileContainsFold,omitempty"` + // avatar_updated_at field predicates + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + AvatarUpdatedAtNeq *time.Time `json:"avatarUpdatedAtNEQ,omitempty"` + AvatarUpdatedAtIn []*time.Time `json:"avatarUpdatedAtIn,omitempty"` + AvatarUpdatedAtNotIn []*time.Time `json:"avatarUpdatedAtNotIn,omitempty"` + AvatarUpdatedAtGt *time.Time `json:"avatarUpdatedAtGT,omitempty"` + AvatarUpdatedAtGte *time.Time `json:"avatarUpdatedAtGTE,omitempty"` + AvatarUpdatedAtLt *time.Time `json:"avatarUpdatedAtLT,omitempty"` + AvatarUpdatedAtLte *time.Time `json:"avatarUpdatedAtLTE,omitempty"` + AvatarUpdatedAtIsNil *bool `json:"avatarUpdatedAtIsNil,omitempty"` + AvatarUpdatedAtNotNil *bool `json:"avatarUpdatedAtNotNil,omitempty"` + // last_seen field predicates + LastSeen *time.Time `json:"lastSeen,omitempty"` + LastSeenNeq *time.Time `json:"lastSeenNEQ,omitempty"` + LastSeenIn []*time.Time `json:"lastSeenIn,omitempty"` + LastSeenNotIn []*time.Time `json:"lastSeenNotIn,omitempty"` + LastSeenGt *time.Time `json:"lastSeenGT,omitempty"` + LastSeenGte *time.Time `json:"lastSeenGTE,omitempty"` + LastSeenLt *time.Time `json:"lastSeenLT,omitempty"` + LastSeenLte *time.Time `json:"lastSeenLTE,omitempty"` + LastSeenIsNil *bool `json:"lastSeenIsNil,omitempty"` + LastSeenNotNil *bool `json:"lastSeenNotNil,omitempty"` + // sub field predicates + Sub *string `json:"sub,omitempty"` + SubNeq *string `json:"subNEQ,omitempty"` + SubIn []string `json:"subIn,omitempty"` + SubNotIn []string `json:"subNotIn,omitempty"` + SubGt *string `json:"subGT,omitempty"` + SubGte *string `json:"subGTE,omitempty"` + SubLt *string `json:"subLT,omitempty"` + SubLte *string `json:"subLTE,omitempty"` + SubContains *string `json:"subContains,omitempty"` + SubHasPrefix *string `json:"subHasPrefix,omitempty"` + SubHasSuffix *string `json:"subHasSuffix,omitempty"` + SubIsNil *bool `json:"subIsNil,omitempty"` + SubNotNil *bool `json:"subNotNil,omitempty"` + SubEqualFold *string `json:"subEqualFold,omitempty"` + SubContainsFold *string `json:"subContainsFold,omitempty"` + // auth_provider field predicates + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + AuthProviderNeq *enums.AuthProvider `json:"authProviderNEQ,omitempty"` + AuthProviderIn []enums.AuthProvider `json:"authProviderIn,omitempty"` + AuthProviderNotIn []enums.AuthProvider `json:"authProviderNotIn,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + RoleIsNil *bool `json:"roleIsNil,omitempty"` + RoleNotNil *bool `json:"roleNotNil,omitempty"` + // personal_access_tokens edge predicates + HasPersonalAccessTokens *bool `json:"hasPersonalAccessTokens,omitempty"` + HasPersonalAccessTokensWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokensWith,omitempty"` + // tfa_settings edge predicates + HasTfaSettings *bool `json:"hasTfaSettings,omitempty"` + HasTfaSettingsWith []*TFASettingWhereInput `json:"hasTfaSettingsWith,omitempty"` + // setting edge predicates + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*UserSettingWhereInput `json:"hasSettingWith,omitempty"` + // groups edge predicates + HasGroups *bool `json:"hasGroups,omitempty"` + HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"` + // organizations edge predicates + HasOrganizations *bool `json:"hasOrganizations,omitempty"` + HasOrganizationsWith []*OrganizationWhereInput `json:"hasOrganizationsWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // group_memberships edge predicates + HasGroupMemberships *bool `json:"hasGroupMemberships,omitempty"` + HasGroupMembershipsWith []*GroupMembershipWhereInput `json:"hasGroupMembershipsWith,omitempty"` + // org_memberships edge predicates + HasOrgMemberships *bool `json:"hasOrgMemberships,omitempty"` + HasOrgMembershipsWith []*OrgMembershipWhereInput `json:"hasOrgMembershipsWith,omitempty"` +} + +type Webhook struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the webhook + Name string `json:"name"` + // a description of the webhook + Description *string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destinationURL"` + // indicates if the webhook is active and enabled + Enabled bool `json:"enabled"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Events []*Event `json:"events,omitempty"` + Integrations []*Integration `json:"integrations,omitempty"` +} + +func (Webhook) IsNode() {} + +// Return response for createBulkWebhook mutation +type WebhookBulkCreatePayload struct { + // Created webhooks + Webhooks []*Webhook `json:"webhooks,omitempty"` +} + +// A connection to a list of items. +type WebhookConnection struct { + // A list of edges. + Edges []*WebhookEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createWebhook mutation +type WebhookCreatePayload struct { + // Created webhook + Webhook *Webhook `json:"webhook"` +} + +// Return response for deleteWebhook mutation +type WebhookDeletePayload struct { + // Deleted webhook ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type WebhookEdge struct { + // The item at the end of the edge. + Node *Webhook `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type WebhookHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the webhook + Name string `json:"name"` + // a description of the webhook + Description *string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destinationURL"` + // indicates if the webhook is active and enabled + Enabled bool `json:"enabled"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` +} + +func (WebhookHistory) IsNode() {} + +// A connection to a list of items. +type WebhookHistoryConnection struct { + // A list of edges. + Edges []*WebhookHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type WebhookHistoryEdge struct { + // The item at the end of the edge. + Node *WebhookHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for WebhookHistory connections +type WebhookHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order WebhookHistories. + Field WebhookHistoryOrderField `json:"field"` +} + +// WebhookHistoryWhereInput is used for filtering WebhookHistory objects. +// Input was generated by ent. +type WebhookHistoryWhereInput struct { + Not *WebhookHistoryWhereInput `json:"not,omitempty"` + And []*WebhookHistoryWhereInput `json:"and,omitempty"` + Or []*WebhookHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // destination_url field predicates + DestinationURL *string `json:"destinationURL,omitempty"` + DestinationURLNeq *string `json:"destinationURLNEQ,omitempty"` + DestinationURLIn []string `json:"destinationURLIn,omitempty"` + DestinationURLNotIn []string `json:"destinationURLNotIn,omitempty"` + DestinationURLGt *string `json:"destinationURLGT,omitempty"` + DestinationURLGte *string `json:"destinationURLGTE,omitempty"` + DestinationURLLt *string `json:"destinationURLLT,omitempty"` + DestinationURLLte *string `json:"destinationURLLTE,omitempty"` + DestinationURLContains *string `json:"destinationURLContains,omitempty"` + DestinationURLHasPrefix *string `json:"destinationURLHasPrefix,omitempty"` + DestinationURLHasSuffix *string `json:"destinationURLHasSuffix,omitempty"` + DestinationURLEqualFold *string `json:"destinationURLEqualFold,omitempty"` + DestinationURLContainsFold *string `json:"destinationURLContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // failures field predicates + Failures *int64 `json:"failures,omitempty"` + FailuresNeq *int64 `json:"failuresNEQ,omitempty"` + FailuresIn []int64 `json:"failuresIn,omitempty"` + FailuresNotIn []int64 `json:"failuresNotIn,omitempty"` + FailuresGt *int64 `json:"failuresGT,omitempty"` + FailuresGte *int64 `json:"failuresGTE,omitempty"` + FailuresLt *int64 `json:"failuresLT,omitempty"` + FailuresLte *int64 `json:"failuresLTE,omitempty"` + FailuresIsNil *bool `json:"failuresIsNil,omitempty"` + FailuresNotNil *bool `json:"failuresNotNil,omitempty"` + // last_error field predicates + LastError *string `json:"lastError,omitempty"` + LastErrorNeq *string `json:"lastErrorNEQ,omitempty"` + LastErrorIn []string `json:"lastErrorIn,omitempty"` + LastErrorNotIn []string `json:"lastErrorNotIn,omitempty"` + LastErrorGt *string `json:"lastErrorGT,omitempty"` + LastErrorGte *string `json:"lastErrorGTE,omitempty"` + LastErrorLt *string `json:"lastErrorLT,omitempty"` + LastErrorLte *string `json:"lastErrorLTE,omitempty"` + LastErrorContains *string `json:"lastErrorContains,omitempty"` + LastErrorHasPrefix *string `json:"lastErrorHasPrefix,omitempty"` + LastErrorHasSuffix *string `json:"lastErrorHasSuffix,omitempty"` + LastErrorIsNil *bool `json:"lastErrorIsNil,omitempty"` + LastErrorNotNil *bool `json:"lastErrorNotNil,omitempty"` + LastErrorEqualFold *string `json:"lastErrorEqualFold,omitempty"` + LastErrorContainsFold *string `json:"lastErrorContainsFold,omitempty"` + // last_response field predicates + LastResponse *string `json:"lastResponse,omitempty"` + LastResponseNeq *string `json:"lastResponseNEQ,omitempty"` + LastResponseIn []string `json:"lastResponseIn,omitempty"` + LastResponseNotIn []string `json:"lastResponseNotIn,omitempty"` + LastResponseGt *string `json:"lastResponseGT,omitempty"` + LastResponseGte *string `json:"lastResponseGTE,omitempty"` + LastResponseLt *string `json:"lastResponseLT,omitempty"` + LastResponseLte *string `json:"lastResponseLTE,omitempty"` + LastResponseContains *string `json:"lastResponseContains,omitempty"` + LastResponseHasPrefix *string `json:"lastResponseHasPrefix,omitempty"` + LastResponseHasSuffix *string `json:"lastResponseHasSuffix,omitempty"` + LastResponseIsNil *bool `json:"lastResponseIsNil,omitempty"` + LastResponseNotNil *bool `json:"lastResponseNotNil,omitempty"` + LastResponseEqualFold *string `json:"lastResponseEqualFold,omitempty"` + LastResponseContainsFold *string `json:"lastResponseContainsFold,omitempty"` +} + +// Ordering options for Webhook connections +type WebhookOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Webhooks. + Field WebhookOrderField `json:"field"` +} + +// Return response for updateWebhook mutation +type WebhookUpdatePayload struct { + // Updated webhook + Webhook *Webhook `json:"webhook"` +} + +// WebhookWhereInput is used for filtering Webhook objects. +// Input was generated by ent. +type WebhookWhereInput struct { + Not *WebhookWhereInput `json:"not,omitempty"` + And []*WebhookWhereInput `json:"and,omitempty"` + Or []*WebhookWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // destination_url field predicates + DestinationURL *string `json:"destinationURL,omitempty"` + DestinationURLNeq *string `json:"destinationURLNEQ,omitempty"` + DestinationURLIn []string `json:"destinationURLIn,omitempty"` + DestinationURLNotIn []string `json:"destinationURLNotIn,omitempty"` + DestinationURLGt *string `json:"destinationURLGT,omitempty"` + DestinationURLGte *string `json:"destinationURLGTE,omitempty"` + DestinationURLLt *string `json:"destinationURLLT,omitempty"` + DestinationURLLte *string `json:"destinationURLLTE,omitempty"` + DestinationURLContains *string `json:"destinationURLContains,omitempty"` + DestinationURLHasPrefix *string `json:"destinationURLHasPrefix,omitempty"` + DestinationURLHasSuffix *string `json:"destinationURLHasSuffix,omitempty"` + DestinationURLEqualFold *string `json:"destinationURLEqualFold,omitempty"` + DestinationURLContainsFold *string `json:"destinationURLContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // failures field predicates + Failures *int64 `json:"failures,omitempty"` + FailuresNeq *int64 `json:"failuresNEQ,omitempty"` + FailuresIn []int64 `json:"failuresIn,omitempty"` + FailuresNotIn []int64 `json:"failuresNotIn,omitempty"` + FailuresGt *int64 `json:"failuresGT,omitempty"` + FailuresGte *int64 `json:"failuresGTE,omitempty"` + FailuresLt *int64 `json:"failuresLT,omitempty"` + FailuresLte *int64 `json:"failuresLTE,omitempty"` + FailuresIsNil *bool `json:"failuresIsNil,omitempty"` + FailuresNotNil *bool `json:"failuresNotNil,omitempty"` + // last_error field predicates + LastError *string `json:"lastError,omitempty"` + LastErrorNeq *string `json:"lastErrorNEQ,omitempty"` + LastErrorIn []string `json:"lastErrorIn,omitempty"` + LastErrorNotIn []string `json:"lastErrorNotIn,omitempty"` + LastErrorGt *string `json:"lastErrorGT,omitempty"` + LastErrorGte *string `json:"lastErrorGTE,omitempty"` + LastErrorLt *string `json:"lastErrorLT,omitempty"` + LastErrorLte *string `json:"lastErrorLTE,omitempty"` + LastErrorContains *string `json:"lastErrorContains,omitempty"` + LastErrorHasPrefix *string `json:"lastErrorHasPrefix,omitempty"` + LastErrorHasSuffix *string `json:"lastErrorHasSuffix,omitempty"` + LastErrorIsNil *bool `json:"lastErrorIsNil,omitempty"` + LastErrorNotNil *bool `json:"lastErrorNotNil,omitempty"` + LastErrorEqualFold *string `json:"lastErrorEqualFold,omitempty"` + LastErrorContainsFold *string `json:"lastErrorContainsFold,omitempty"` + // last_response field predicates + LastResponse *string `json:"lastResponse,omitempty"` + LastResponseNeq *string `json:"lastResponseNEQ,omitempty"` + LastResponseIn []string `json:"lastResponseIn,omitempty"` + LastResponseNotIn []string `json:"lastResponseNotIn,omitempty"` + LastResponseGt *string `json:"lastResponseGT,omitempty"` + LastResponseGte *string `json:"lastResponseGTE,omitempty"` + LastResponseLt *string `json:"lastResponseLT,omitempty"` + LastResponseLte *string `json:"lastResponseLTE,omitempty"` + LastResponseContains *string `json:"lastResponseContains,omitempty"` + LastResponseHasPrefix *string `json:"lastResponseHasPrefix,omitempty"` + LastResponseHasSuffix *string `json:"lastResponseHasSuffix,omitempty"` + LastResponseIsNil *bool `json:"lastResponseIsNil,omitempty"` + LastResponseNotNil *bool `json:"lastResponseNotNil,omitempty"` + LastResponseEqualFold *string `json:"lastResponseEqualFold,omitempty"` + LastResponseContainsFold *string `json:"lastResponseContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` +} + +// Properties by which EntityHistory connections can be ordered. +type EntityHistoryOrderField string + +const ( + EntityHistoryOrderFieldName EntityHistoryOrderField = "name" + EntityHistoryOrderFieldDisplayName EntityHistoryOrderField = "display_name" +) + +var AllEntityHistoryOrderField = []EntityHistoryOrderField{ + EntityHistoryOrderFieldName, + EntityHistoryOrderFieldDisplayName, +} + +func (e EntityHistoryOrderField) IsValid() bool { + switch e { + case EntityHistoryOrderFieldName, EntityHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e EntityHistoryOrderField) String() string { + return string(e) +} + +func (e *EntityHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityHistoryOrderField", str) + } + return nil +} + +func (e EntityHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Entity connections can be ordered. +type EntityOrderField string + +const ( + EntityOrderFieldName EntityOrderField = "name" + EntityOrderFieldDisplayName EntityOrderField = "display_name" +) + +var AllEntityOrderField = []EntityOrderField{ + EntityOrderFieldName, + EntityOrderFieldDisplayName, +} + +func (e EntityOrderField) IsValid() bool { + switch e { + case EntityOrderFieldName, EntityOrderFieldDisplayName: + return true + } + return false +} + +func (e EntityOrderField) String() string { + return string(e) +} + +func (e *EntityOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityOrderField", str) + } + return nil +} + +func (e EntityOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which EntityTypeHistory connections can be ordered. +type EntityTypeHistoryOrderField string + +const ( + EntityTypeHistoryOrderFieldName EntityTypeHistoryOrderField = "name" +) + +var AllEntityTypeHistoryOrderField = []EntityTypeHistoryOrderField{ + EntityTypeHistoryOrderFieldName, +} + +func (e EntityTypeHistoryOrderField) IsValid() bool { + switch e { + case EntityTypeHistoryOrderFieldName: + return true + } + return false +} + +func (e EntityTypeHistoryOrderField) String() string { + return string(e) +} + +func (e *EntityTypeHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityTypeHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityTypeHistoryOrderField", str) + } + return nil +} + +func (e EntityTypeHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which EntityType connections can be ordered. +type EntityTypeOrderField string + +const ( + EntityTypeOrderFieldName EntityTypeOrderField = "name" +) + +var AllEntityTypeOrderField = []EntityTypeOrderField{ + EntityTypeOrderFieldName, +} + +func (e EntityTypeOrderField) IsValid() bool { + switch e { + case EntityTypeOrderFieldName: + return true + } + return false +} + +func (e EntityTypeOrderField) String() string { + return string(e) +} + +func (e *EntityTypeOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityTypeOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityTypeOrderField", str) + } + return nil +} + +func (e EntityTypeOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which GroupHistory connections can be ordered. +type GroupHistoryOrderField string + +const ( + GroupHistoryOrderFieldName GroupHistoryOrderField = "name" + GroupHistoryOrderFieldDisplayName GroupHistoryOrderField = "display_name" +) + +var AllGroupHistoryOrderField = []GroupHistoryOrderField{ + GroupHistoryOrderFieldName, + GroupHistoryOrderFieldDisplayName, +} + +func (e GroupHistoryOrderField) IsValid() bool { + switch e { + case GroupHistoryOrderFieldName, GroupHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e GroupHistoryOrderField) String() string { + return string(e) +} + +func (e *GroupHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GroupHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid GroupHistoryOrderField", str) + } + return nil +} + +func (e GroupHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Group connections can be ordered. +type GroupOrderField string + +const ( + GroupOrderFieldName GroupOrderField = "name" + GroupOrderFieldDisplayName GroupOrderField = "display_name" +) + +var AllGroupOrderField = []GroupOrderField{ + GroupOrderFieldName, + GroupOrderFieldDisplayName, +} + +func (e GroupOrderField) IsValid() bool { + switch e { + case GroupOrderFieldName, GroupOrderFieldDisplayName: + return true + } + return false +} + +func (e GroupOrderField) String() string { + return string(e) +} + +func (e *GroupOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GroupOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid GroupOrderField", str) + } + return nil +} + +func (e GroupOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which HushHistory connections can be ordered. +type HushHistoryOrderField string + +const ( + HushHistoryOrderFieldName HushHistoryOrderField = "name" + HushHistoryOrderFieldKind HushHistoryOrderField = "kind" +) + +var AllHushHistoryOrderField = []HushHistoryOrderField{ + HushHistoryOrderFieldName, + HushHistoryOrderFieldKind, +} + +func (e HushHistoryOrderField) IsValid() bool { + switch e { + case HushHistoryOrderFieldName, HushHistoryOrderFieldKind: + return true + } + return false +} + +func (e HushHistoryOrderField) String() string { + return string(e) +} + +func (e *HushHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = HushHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid HushHistoryOrderField", str) + } + return nil +} + +func (e HushHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Hush connections can be ordered. +type HushOrderField string + +const ( + HushOrderFieldName HushOrderField = "name" + HushOrderFieldKind HushOrderField = "kind" +) + +var AllHushOrderField = []HushOrderField{ + HushOrderFieldName, + HushOrderFieldKind, +} + +func (e HushOrderField) IsValid() bool { + switch e { + case HushOrderFieldName, HushOrderFieldKind: + return true + } + return false +} + +func (e HushOrderField) String() string { + return string(e) +} + +func (e *HushOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = HushOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid HushOrderField", str) + } + return nil +} + +func (e HushOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which IntegrationHistory connections can be ordered. +type IntegrationHistoryOrderField string + +const ( + IntegrationHistoryOrderFieldName IntegrationHistoryOrderField = "name" + IntegrationHistoryOrderFieldKind IntegrationHistoryOrderField = "kind" +) + +var AllIntegrationHistoryOrderField = []IntegrationHistoryOrderField{ + IntegrationHistoryOrderFieldName, + IntegrationHistoryOrderFieldKind, +} + +func (e IntegrationHistoryOrderField) IsValid() bool { + switch e { + case IntegrationHistoryOrderFieldName, IntegrationHistoryOrderFieldKind: + return true + } + return false +} + +func (e IntegrationHistoryOrderField) String() string { + return string(e) +} + +func (e *IntegrationHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = IntegrationHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid IntegrationHistoryOrderField", str) + } + return nil +} + +func (e IntegrationHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Integration connections can be ordered. +type IntegrationOrderField string + +const ( + IntegrationOrderFieldName IntegrationOrderField = "name" + IntegrationOrderFieldKind IntegrationOrderField = "kind" +) + +var AllIntegrationOrderField = []IntegrationOrderField{ + IntegrationOrderFieldName, + IntegrationOrderFieldKind, +} + +func (e IntegrationOrderField) IsValid() bool { + switch e { + case IntegrationOrderFieldName, IntegrationOrderFieldKind: + return true + } + return false +} + +func (e IntegrationOrderField) String() string { + return string(e) +} + +func (e *IntegrationOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = IntegrationOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid IntegrationOrderField", str) + } + return nil +} + +func (e IntegrationOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Possible directions in which to order a list of items when provided an `orderBy` argument. +type OrderDirection string + +const ( + // Specifies an ascending order for a given `orderBy` argument. + OrderDirectionAsc OrderDirection = "ASC" + // Specifies a descending order for a given `orderBy` argument. + OrderDirectionDesc OrderDirection = "DESC" +) + +var AllOrderDirection = []OrderDirection{ + OrderDirectionAsc, + OrderDirectionDesc, +} + +func (e OrderDirection) IsValid() bool { + switch e { + case OrderDirectionAsc, OrderDirectionDesc: + return true + } + return false +} + +func (e OrderDirection) String() string { + return string(e) +} + +func (e *OrderDirection) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = OrderDirection(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid OrderDirection", str) + } + return nil +} + +func (e OrderDirection) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which OrganizationHistory connections can be ordered. +type OrganizationHistoryOrderField string + +const ( + OrganizationHistoryOrderFieldName OrganizationHistoryOrderField = "name" + OrganizationHistoryOrderFieldDisplayName OrganizationHistoryOrderField = "display_name" +) + +var AllOrganizationHistoryOrderField = []OrganizationHistoryOrderField{ + OrganizationHistoryOrderFieldName, + OrganizationHistoryOrderFieldDisplayName, +} + +func (e OrganizationHistoryOrderField) IsValid() bool { + switch e { + case OrganizationHistoryOrderFieldName, OrganizationHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e OrganizationHistoryOrderField) String() string { + return string(e) +} + +func (e *OrganizationHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = OrganizationHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid OrganizationHistoryOrderField", str) + } + return nil +} + +func (e OrganizationHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Organization connections can be ordered. +type OrganizationOrderField string + +const ( + OrganizationOrderFieldName OrganizationOrderField = "name" + OrganizationOrderFieldDisplayName OrganizationOrderField = "display_name" +) + +var AllOrganizationOrderField = []OrganizationOrderField{ + OrganizationOrderFieldName, + OrganizationOrderFieldDisplayName, +} + +func (e OrganizationOrderField) IsValid() bool { + switch e { + case OrganizationOrderFieldName, OrganizationOrderFieldDisplayName: + return true + } + return false +} + +func (e OrganizationOrderField) String() string { + return string(e) +} + +func (e *OrganizationOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = OrganizationOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid OrganizationOrderField", str) + } + return nil +} + +func (e OrganizationOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which TemplateHistory connections can be ordered. +type TemplateHistoryOrderField string + +const ( + TemplateHistoryOrderFieldName TemplateHistoryOrderField = "name" +) + +var AllTemplateHistoryOrderField = []TemplateHistoryOrderField{ + TemplateHistoryOrderFieldName, +} + +func (e TemplateHistoryOrderField) IsValid() bool { + switch e { + case TemplateHistoryOrderFieldName: + return true + } + return false +} + +func (e TemplateHistoryOrderField) String() string { + return string(e) +} + +func (e *TemplateHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = TemplateHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid TemplateHistoryOrderField", str) + } + return nil +} + +func (e TemplateHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Template connections can be ordered. +type TemplateOrderField string + +const ( + TemplateOrderFieldName TemplateOrderField = "name" +) + +var AllTemplateOrderField = []TemplateOrderField{ + TemplateOrderFieldName, +} + +func (e TemplateOrderField) IsValid() bool { + switch e { + case TemplateOrderFieldName: + return true + } + return false +} + +func (e TemplateOrderField) String() string { + return string(e) +} + +func (e *TemplateOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = TemplateOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid TemplateOrderField", str) + } + return nil +} + +func (e TemplateOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which UserHistory connections can be ordered. +type UserHistoryOrderField string + +const ( + UserHistoryOrderFieldFirstName UserHistoryOrderField = "first_name" + UserHistoryOrderFieldLastName UserHistoryOrderField = "last_name" + UserHistoryOrderFieldDisplayName UserHistoryOrderField = "display_name" +) + +var AllUserHistoryOrderField = []UserHistoryOrderField{ + UserHistoryOrderFieldFirstName, + UserHistoryOrderFieldLastName, + UserHistoryOrderFieldDisplayName, +} + +func (e UserHistoryOrderField) IsValid() bool { + switch e { + case UserHistoryOrderFieldFirstName, UserHistoryOrderFieldLastName, UserHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e UserHistoryOrderField) String() string { + return string(e) +} + +func (e *UserHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = UserHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid UserHistoryOrderField", str) + } + return nil +} + +func (e UserHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which User connections can be ordered. +type UserOrderField string + +const ( + UserOrderFieldFirstName UserOrderField = "first_name" + UserOrderFieldLastName UserOrderField = "last_name" + UserOrderFieldDisplayName UserOrderField = "display_name" +) + +var AllUserOrderField = []UserOrderField{ + UserOrderFieldFirstName, + UserOrderFieldLastName, + UserOrderFieldDisplayName, +} + +func (e UserOrderField) IsValid() bool { + switch e { + case UserOrderFieldFirstName, UserOrderFieldLastName, UserOrderFieldDisplayName: + return true + } + return false +} + +func (e UserOrderField) String() string { + return string(e) +} + +func (e *UserOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = UserOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid UserOrderField", str) + } + return nil +} + +func (e UserOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which WebhookHistory connections can be ordered. +type WebhookHistoryOrderField string + +const ( + WebhookHistoryOrderFieldName WebhookHistoryOrderField = "name" + WebhookHistoryOrderFieldURL WebhookHistoryOrderField = "url" +) + +var AllWebhookHistoryOrderField = []WebhookHistoryOrderField{ + WebhookHistoryOrderFieldName, + WebhookHistoryOrderFieldURL, +} + +func (e WebhookHistoryOrderField) IsValid() bool { + switch e { + case WebhookHistoryOrderFieldName, WebhookHistoryOrderFieldURL: + return true + } + return false +} + +func (e WebhookHistoryOrderField) String() string { + return string(e) +} + +func (e *WebhookHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = WebhookHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid WebhookHistoryOrderField", str) + } + return nil +} + +func (e WebhookHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Webhook connections can be ordered. +type WebhookOrderField string + +const ( + WebhookOrderFieldName WebhookOrderField = "name" + WebhookOrderFieldURL WebhookOrderField = "url" +) + +var AllWebhookOrderField = []WebhookOrderField{ + WebhookOrderFieldName, + WebhookOrderFieldURL, +} + +func (e WebhookOrderField) IsValid() bool { + switch e { + case WebhookOrderFieldName, WebhookOrderFieldURL: + return true + } + return false +} + +func (e WebhookOrderField) String() string { + return string(e) +} + +func (e *WebhookOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = WebhookOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid WebhookOrderField", str) + } + return nil +} + +func (e WebhookOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} diff --git a/pkg/events/soiree/README.md b/pkg/events/soiree/README.md index 4af7886..651e858 100644 --- a/pkg/events/soiree/README.md +++ b/pkg/events/soiree/README.md @@ -326,7 +326,7 @@ func main() { } ``` -Listeners are now identified by a UUID vs. the standard ULID generated by The Open Lane. You can also create listeners with a similar naming convention as the topic so you can identify them more easily. Generally speaking, though: listeners are acting on the events immediately. This is an in-memory implementation so the most appropriate use of the goroutine pools are either writing to a persistent store immediately when the event occurs to perform other future actions if required, handling an event immediately based on a criteria (e.g. webhooks, outbound http methods) or other idempotent actions. +Listeners are now identified by a UUID vs. the standard ULID generated by The OpenLane. You can also create listeners with a similar naming convention as the topic so you can identify them more easily. Generally speaking, though: listeners are acting on the events immediately. This is an in-memory implementation so the most appropriate use of the goroutine pools are either writing to a persistent store immediately when the event occurs to perform other future actions if required, handling an event immediately based on a criteria (e.g. webhooks, outbound http methods) or other idempotent actions. ### Handling Panics diff --git a/pkg/events/soiree/pool.go b/pkg/events/soiree/pool.go index a87576c..63197e5 100644 --- a/pkg/events/soiree/pool.go +++ b/pkg/events/soiree/pool.go @@ -125,27 +125,27 @@ func (p *PondPool) IdleWorkers() int { // SubmittedTasks returns the number of tasks submitted to the pool func (p *PondPool) SubmittedTasks() int { - return int(p.pool.SubmittedTasks()) + return int(p.pool.SubmittedTasks()) // nolint:gosec } // WaitingTasks returns the number of tasks waiting in the pool func (p *PondPool) WaitingTasks() int { - return int(p.pool.WaitingTasks()) + return int(p.pool.WaitingTasks()) // nolint:gosec } // SuccessfulTasks returns the number of tasks that completed successfully func (p *PondPool) SuccessfulTasks() int { - return int(p.pool.SuccessfulTasks()) + return int(p.pool.SuccessfulTasks()) // nolint:gosec } // FailedTasks returns the number of tasks that completed with a panic func (p *PondPool) FailedTasks() int { - return int(p.pool.FailedTasks()) + return int(p.pool.FailedTasks()) // nolint:gosec } // CompletedTasks returns the number of tasks that completed either successfully or with a panic func (p *PondPool) CompletedTasks() int { - return int(p.pool.CompletedTasks()) + return int(p.pool.CompletedTasks()) // nolint:gosec } // StopAndWaitFor stops this pool and waits until either all tasks in the queue are completed diff --git a/pkg/gencmd/README.md b/pkg/gencmd/README.md new file mode 100644 index 0000000..bd7eaa6 --- /dev/null +++ b/pkg/gencmd/README.md @@ -0,0 +1,93 @@ +# GenCMD + +This package is used to generate the base CRUD operations for a cli command for the `OpenLaneClient` + +## Usage + +The [Taskfile](Taskfile.yaml) includes two commands: + +``` +* cli:generate: generates a new cli cmd +* cli:generate:ro: generates a new cli cmd with only the read cmds +``` + +To use the cli directly instead of the `Taskfile`: + +``` +go run cmd/cli/gencmd/generate/main.go generate --help +generate is the command to generate the stub files for a given cli cmd + +Usage: + generate [flags] + +Flags: + -d, --dir string root directory location to generate the files (default "cmd") + -h, --help help for generate + -i, --interactive interactive prompt, set to false to disable (default true) + -n, --name string name of the command to generate + -r, --read-only only generate the read only commands, no create, update or delete commands + ``` + +### Generate All CRUD Operations + +1. Run the generate command + ``` + task cli:generate + task: [cli:generate] go run gencmd/generate/main.go generate + Name of the command (should be the singular version of the object): Contact + ----> creating cli cmd for: Contact + ----> executing template: create.tmpl + ----> executing template: delete.tmpl + ----> executing template: doc.tmpl + ----> executing template: get.tmpl + ----> executing template: root.tmpl + ----> executing template: update.tmpl + ``` +1. This will create a set of cobra command files: + ``` + ls -l cmd/cli/cmd/contact/ + total 48 + -rw-r--r-- 1 sarahfunkhouser staff 1261 Jun 27 13:30 create.go + -rw-r--r-- 1 sarahfunkhouser staff 1086 Jun 27 13:30 delete.go + -rw-r--r-- 1 sarahfunkhouser staff 102 Jun 27 13:30 doc.go + -rw-r--r-- 1 sarahfunkhouser staff 1079 Jun 27 13:30 get.go + -rw-r--r-- 1 sarahfunkhouser staff 2570 Jun 27 13:30 root.go + -rw-r--r-- 1 sarahfunkhouser staff 1511 Jun 27 13:30 update.go + ``` +1. Add the new package to `cmd/cli/main.go`, in this case it would be: + ```go + _ "github.com/theopenlane/core/cmd/cli/cmd/contact" + ``` +1. Add flags for the `Create` and `Update` commands for input +1. Add validation to the `createValidation()` and `updateValidation()` functions for the required input +1. Add fields for the table output in `root.go` in `tableOutput()` function, by default it only includes `ID`. + ```go + // tableOutput prints the plans in a table format + func tableOutput(plans []openlaneclient.Contact) { + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Name", "Email", "PhoneNumber") + + for _, p := range plans { + writer.AddRow(p.ID, p.Name, *p.Email, *p.PhoneNumber) + } + + writer.Render() + } + ``` + +### Generate Read-Only Operations + +A common use-case for some of the resolvers is a `read-only` set of functions, particularly in our `History` schemas. To generate the cmds with **only** the `get` functionality use the `--read-only` flag: + +1. Run the read-only generate command + ``` + task cli:generate:ro + ``` +1. The resulting commands will just be a `get` command + ``` + task: [cli:generate:ro] go run gencmd/generate/main.go generate --read-only + Name of the command (should be the singular version of the object): ContactHistory + ----> creating cli cmd for: ContactHistory + ----> executing template: doc.tmpl + ----> executing template: get.tmpl + ----> executing template: root.tmpl + ``` \ No newline at end of file diff --git a/pkg/gencmd/generate.go b/pkg/gencmd/generate.go new file mode 100644 index 0000000..e5bba15 --- /dev/null +++ b/pkg/gencmd/generate.go @@ -0,0 +1,168 @@ +package gencmd + +import ( + "bytes" + "embed" + "fmt" + "html/template" + "os" + "path/filepath" + "slices" + "strings" + + "github.com/gertd/go-pluralize" + "github.com/stoewer/go-strcase" + "golang.org/x/tools/imports" +) + +var ( + //go:embed templates/* + _templates embed.FS +) + +const ( + templateSuffix = ".tmpl" +) + +// cmd data for the template +type cmd struct { + // Name is the name of the command + Name string + // ListOnly is a flag to indicate if the command is list only + ListOnly bool + // HistoryCmd is a flag to indicate if the command is for history + HistoryCmd bool +} + +var ( + mutationTemplates = []string{"create.tmpl", "update.tmpl", "delete.tmpl"} +) + +// Generate generates the cli command files for the given command name +func Generate(cmdName string, cmdDirName string, readOnly bool, force bool) error { + // trim any leading/trailing spaces + cmdName = strings.Trim(cmdName, " ") + + // create new directory first + if err := os.MkdirAll(getNewCmdDirName(cmdDirName, cmdName), os.ModePerm); err != nil { + return err + } + + fmt.Println("----> creating cli cmd for:", cmdName) + + templates, err := _templates.ReadDir("templates") + if err != nil { + return err + } + + // generate all the cmd files + for _, t := range templates { + // if read only, skip the mutation templates + if readOnly && slices.Contains(mutationTemplates, t.Name()) { + continue + } + + if err := generateCmdFile(cmdName, cmdDirName, t.Name(), readOnly, force); err != nil { + return err + } + } + + return nil +} + +// createCmd creates a new template for generating cli commands +func createCmd(name string) (*template.Template, error) { + // function map for template + fm := template.FuncMap{ + "ToUpperCamel": strcase.UpperCamelCase, + "ToLowerCamel": strcase.LowerCamelCase, + "ToLower": strings.ToLower, + "ToPlural": pluralize.NewClient().Plural, + "ToKebabCase": strcase.KebabCase, + } + + // create schema template + tmpl, err := template.New(name).Funcs(fm).ParseFS(_templates, fmt.Sprintf("templates/%s", name)) + if err != nil { + return nil, err + } + + return tmpl, nil +} + +// generateCmdFile generates the cmd file for the given command name and template name +func generateCmdFile(cmdName, cmdDirName, templateName string, readOnly bool, force bool) error { + // create the template + tmpl, err := createCmd(templateName) + if err != nil { + return err + } + + // get the file name + filePath := getFileName(cmdDirName, cmdName, templateName) + + // check if schema already exists, skip generation so we don't overwrite manual changes + if _, err := os.Stat(filePath); err == nil && !force { + return nil + } + + isHistory := false + if strings.Contains(cmdName, "History") { + isHistory = true + } + + // setup the data required for the template + c := cmd{ + Name: cmdName, + ListOnly: readOnly, // if read only, set the list only flag + HistoryCmd: isHistory, + } + + fmt.Println("----> executing template:", templateName) + + // execute the template + var buf bytes.Buffer + if err := tmpl.Execute(&buf, c); err != nil { + return err + } + + out, err := imports.Process(filePath, buf.Bytes(), nil) + if err != nil { + return err + } + + // create the file + file, err := os.Create(filePath) + if err != nil { + return err + } + + if _, err := file.Write(out); err != nil { + return err + } + + return nil +} + +// getFileName returns the file name for the cmd file to be generated +func getFileName(dir, cmdName, templateName string) string { + // trim the trailing slash, if any + dir = strings.TrimRight(dir, "/") + + // trim the suffix to get the file name + fileName := strings.TrimSuffix(templateName, templateSuffix) + + fullPath := fmt.Sprintf("%s/%s/%s.go", dir, strings.ToLower(cmdName), strings.ToLower(fileName)) + + return filepath.Clean(fullPath) +} + +// getNewCmdDirName returns the directory name for the cmd files to be generated +func getNewCmdDirName(dir, cmdName string) string { + // trim the trailing slash, if any + dir = strings.TrimRight(dir, "/") + + fullPath := fmt.Sprintf("%s/%s", dir, strings.ToLower(cmdName)) + + return filepath.Clean(fullPath) +} diff --git a/pkg/gencmd/generate/cmd/generate.go b/pkg/gencmd/generate/cmd/generate.go new file mode 100644 index 0000000..11cf3e4 --- /dev/null +++ b/pkg/gencmd/generate/cmd/generate.go @@ -0,0 +1,78 @@ +package cmd + +import ( + "strings" + + "entgo.io/ent/entc" + "entgo.io/ent/entc/gen" + "github.com/spf13/cobra" + + "github.com/theopenlane/core/pkg/gencmd" + "github.com/theopenlane/core/pkg/gencmd/generate/prompts" +) + +const ( + relativeSchemaPath = "../../internal/ent/schema" +) + +var generateCmd = &cobra.Command{ + Use: "generate", + Short: "generate is the command to generate the stub files for a given cli cmd", + Run: func(cmd *cobra.Command, args []string) { + err := generateStubFiles() + cobra.CheckErr(err) + }, +} + +func init() { + rootCmd.AddCommand(generateCmd) + + generateCmd.Flags().StringP("name", "n", "", "name of the command to generate") + generateCmd.Flags().StringP("dir", "d", "cmd", "root directory location to generate the files") + generateCmd.Flags().BoolP("read-only", "r", false, "only generate the read only commands, no create, update or delete commands") + generateCmd.Flags().BoolP("interactive", "i", true, "interactive prompt, set to false to disable") + generateCmd.Flags().BoolP("force", "f", false, "force overwrite of existing files") +} + +func generateStubFiles() (err error) { + interactive := Config.Bool("interactive") + + cmdName := Config.String("name") + hasHistory := false + + if interactive { + cmdName, err = prompts.Name(cmdName) + cobra.CheckErr(err) + + if hasHistorySchema(cmdName) { + hasHistory = prompts.GenerateHistory() + } + } + + dirName := Config.String("dir") + readOnly := Config.Bool("read-only") + force := Config.Bool("force") + + err = gencmd.Generate(cmdName, dirName, readOnly, force) + cobra.CheckErr(err) + + if !hasHistory { + return nil + } + + return gencmd.Generate(cmdName+"History", dirName, true, force) +} + +// hasHistorySchemas loads the schema and checks if the history schema exists +func hasHistorySchema(cmdName string) bool { + graph, err := entc.LoadGraph(relativeSchemaPath, &gen.Config{}) + cobra.CheckErr(err) + + for _, s := range graph.Schemas { + if strings.EqualFold(s.Name, cmdName+"history") { + return true + } + } + + return false +} diff --git a/pkg/gencmd/generate/cmd/root.go b/pkg/gencmd/generate/cmd/root.go new file mode 100644 index 0000000..58f48b7 --- /dev/null +++ b/pkg/gencmd/generate/cmd/root.go @@ -0,0 +1,44 @@ +/* +Copyright © 2024 NAME HERE +*/ +package cmd + +import ( + "github.com/knadh/koanf/providers/posflag" + "github.com/knadh/koanf/v2" + "github.com/spf13/cobra" +) + +var ( + Config *koanf.Koanf +) + +// rootCmd represents the base command when called without any subcommands +var rootCmd = &cobra.Command{ + Use: "", + Short: "generate the stub files for a given cli cmd", + PersistentPreRun: func(cmd *cobra.Command, args []string) { + initConfiguration(cmd) + }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +func Execute() { + err := rootCmd.Execute() + cobra.CheckErr(err) +} + +func init() { + Config = koanf.New(".") // Create a new koanf instance. +} + +// initConfiguration loads the configuration from the command flags of the given cobra command +func initConfiguration(cmd *cobra.Command) { + loadFlags(cmd) +} + +func loadFlags(cmd *cobra.Command) { + err := Config.Load(posflag.Provider(cmd.Flags(), Config.Delim(), Config), nil) + + cobra.CheckErr(err) +} diff --git a/pkg/gencmd/generate/main.go b/pkg/gencmd/generate/main.go new file mode 100644 index 0000000..2a567a8 --- /dev/null +++ b/pkg/gencmd/generate/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/theopenlane/core/pkg/gencmd/generate/cmd" + +func main() { + cmd.Execute() +} diff --git a/pkg/gencmd/generate/prompts/history.go b/pkg/gencmd/generate/prompts/history.go new file mode 100644 index 0000000..e4f5eb9 --- /dev/null +++ b/pkg/gencmd/generate/prompts/history.go @@ -0,0 +1,28 @@ +package prompts + +import ( + "regexp" + + "github.com/manifoldco/promptui" +) + +// GenerateHistory prompts the user if a history schema is found to +// generate the history command +func GenerateHistory() bool { + prompt := promptui.Prompt{ + Label: "Generate history command as well? (y/n):", + IsConfirm: true, + Templates: templates, + } + + resp, _ := prompt.Run() + + return isConfirm(resp) +} + +// acceptable answers: y,yes,Y,YES,1 +var confirmExp = regexp.MustCompile("(?i)y(?:es)?|1") + +func isConfirm(confirm string) bool { + return confirmExp.MatchString(confirm) +} diff --git a/pkg/gencmd/generate/prompts/name.go b/pkg/gencmd/generate/prompts/name.go new file mode 100644 index 0000000..0b76609 --- /dev/null +++ b/pkg/gencmd/generate/prompts/name.go @@ -0,0 +1,31 @@ +package prompts + +import ( + "errors" + + "github.com/manifoldco/promptui" +) + +// Name prompts the user for the name of the command +func Name(defaultName string) (string, error) { + validate := func(input string) error { + if len(input) == 0 { + return errors.New("name is required") //nolint:err113 + } + + if input[len(input)-1:] == "s" { + return errors.New("name should be singular") //nolint:err113 + } + + return nil + } + + prompt := promptui.Prompt{ + Label: "Name of the command (should be the singular version of the object):", + Default: defaultName, + Templates: templates, + Validate: validate, + } + + return prompt.Run() +} diff --git a/pkg/gencmd/generate/prompts/template.go b/pkg/gencmd/generate/prompts/template.go new file mode 100644 index 0000000..dcfdc9d --- /dev/null +++ b/pkg/gencmd/generate/prompts/template.go @@ -0,0 +1,10 @@ +package prompts + +import "github.com/manifoldco/promptui" + +var templates = &promptui.PromptTemplates{ + Prompt: "{{ . }} ", + Valid: "{{ . | green }} ", + Invalid: "{{ . | red }} ", + Success: "{{ . | bold }} ", +} diff --git a/pkg/gencmd/templates/create.tmpl b/pkg/gencmd/templates/create.tmpl new file mode 100644 index 0000000..f84818e --- /dev/null +++ b/pkg/gencmd/templates/create.tmpl @@ -0,0 +1,52 @@ +package {{ .Name | ToLower }} + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var createCmd = &cobra.Command{ + Use: "create", + Short: "create a new {{ .Name | ToLowerCamel }}", + Run: func(cmd *cobra.Command, args []string) { + err := create(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(createCmd) + + // command line flags for the create command + + // example: + // createCmd.Flags().StringP("name", "n", "", "name of the {{ .Name | ToLowerCamel }}") +} + +// createValidation validates the required fields for the command +func createValidation() (input openlaneclient.Create{{ .Name | ToUpperCamel }}Input, err error) { + // validation of required fields for the create command + // output the input struct with the required fields and optional fields based on the command line flags + + return input, nil +} + +// create a new {{ .Name | ToLowerCamel }} +func create(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + input, err := createValidation() + cobra.CheckErr(err) + + o, err := client.Create{{ .Name | ToUpperCamel }}(ctx, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/pkg/gencmd/templates/delete.tmpl b/pkg/gencmd/templates/delete.tmpl new file mode 100644 index 0000000..e3fd7cf --- /dev/null +++ b/pkg/gencmd/templates/delete.tmpl @@ -0,0 +1,50 @@ +package {{ .Name | ToLower }} + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var deleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete an existing {{ .Name | ToLower }}", + Run: func(cmd *cobra.Command, args []string) { + err := delete(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(deleteCmd) + + deleteCmd.Flags().StringP("id", "i", "", "{{ .Name | ToLower }} id to delete") +} + +// deleteValidation validates the required fields for the command +func deleteValidation() (string, error) { + id := cmd.Config.String("id") + if id == "" { + return "", cmd.NewRequiredFieldMissingError("{{ .Name | ToLower }} id") + } + + return id, nil +} + +// delete an existing {{ .Name | ToLowerCamel }} in the platform +func delete(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, err := deleteValidation() + cobra.CheckErr(err) + + o, err := client.Delete{{ .Name | ToUpperCamel }}(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/pkg/gencmd/templates/doc.tmpl b/pkg/gencmd/templates/doc.tmpl new file mode 100644 index 0000000..544c062 --- /dev/null +++ b/pkg/gencmd/templates/doc.tmpl @@ -0,0 +1,2 @@ +// Package {{ .Name | ToLower }} is our cobra cli for {{ .Name | ToLowerCamel }} endpoints +package {{ .Name | ToLower }} diff --git a/pkg/gencmd/templates/get.tmpl b/pkg/gencmd/templates/get.tmpl new file mode 100644 index 0000000..8fe6fad --- /dev/null +++ b/pkg/gencmd/templates/get.tmpl @@ -0,0 +1,70 @@ +package {{ .Name | ToLower }} + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing {{ .Name | ToLowerCamel }}", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + + {{- if not .HistoryCmd }} + getCmd.Flags().StringP("id", "i", "", "{{ .Name | ToLowerCamel }} id to query") + {{ else }} + getCmd.Flags().StringP("id", "i", "", "id to query") + {{- end }} +} + +// get an existing {{ .Name | ToLowerCamel }} in the platform +func get(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + {{- if not .ListOnly }} + // filter options + id := cmd.Config.String("id") + + // if an {{ .Name | ToLowerCamel }} ID is provided, filter on that {{ .Name | ToLowerCamel }}, otherwise get all + if id != "" { + o, err := client.Get{{ .Name | ToUpperCamel }}ByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + {{- end }} + + {{- if .HistoryCmd }} + + // filter options + id := cmd.Config.String("id") + if id != "" { + o, err := client.Get{{ .Name | ToUpperCamel | ToPlural }}(ctx, &openlaneclient.{{ .Name | ToUpperCamel }}WhereInput{ + Ref: &id, + }) + cobra.CheckErr(err) + + return consoleOutput(o) + } + {{- end }} + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAll{{ .Name | ToUpperCamel | ToPlural }}(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/pkg/gencmd/templates/root.tmpl b/pkg/gencmd/templates/root.tmpl new file mode 100644 index 0000000..8977a91 --- /dev/null +++ b/pkg/gencmd/templates/root.tmpl @@ -0,0 +1,117 @@ +package {{ .Name | ToLower }} + +import ( + "encoding/json" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/utils/cli/tables" +) + +// command represents the base {{ .Name | ToLowerCamel }} command when called without any subcommands +var command = &cobra.Command{ + Use: "{{ .Name | ToKebabCase }}", + Short: "the subcommands for working with {{ .Name | ToLowerCamel | ToPlural }}", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the {{ .Name | ToLowerCamel | ToPlural }} in JSON format + if cmd.OutputFormat == cmd.JSONOutput { + return jsonOutput(e) + } + + // check the type of the {{ .Name | ToLowerCamel | ToPlural }} and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAll{{ .Name | ToUpperCamel | ToPlural }}: + var nodes []*openlaneclient.GetAll{{ .Name | ToUpperCamel | ToPlural }}_{{ .Name | ToUpperCamel | ToPlural }}_Edges_Node + + for _, i := range v.{{ .Name | ToUpperCamel | ToPlural }}.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.Get{{ .Name | ToUpperCamel | ToPlural }}: + var nodes []*openlaneclient.Get{{ .Name | ToUpperCamel | ToPlural }}_{{ .Name | ToUpperCamel | ToPlural }}_Edges_Node + + for _, i := range v.{{ .Name | ToUpperCamel | ToPlural }}.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + {{- if not .ListOnly }} + case *openlaneclient.Get{{ .Name | ToUpperCamel }}ByID: + e = v.{{ .Name | ToUpperCamel }} + case *openlaneclient.Create{{ .Name | ToUpperCamel }}: + e = v.Create{{ .Name | ToUpperCamel }}.{{ .Name | ToUpperCamel }} + case *openlaneclient.Update{{ .Name | ToUpperCamel }}: + e = v.Update{{ .Name | ToUpperCamel }}.{{ .Name | ToUpperCamel }} + case *openlaneclient.Delete{{ .Name | ToUpperCamel }}: + deletedTableOutput(v) + return nil + {{- end }} + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.{{ .Name | ToUpperCamel }} + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.{{ .Name | ToUpperCamel }} + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.{{ .Name | ToUpperCamel }}) { + // create a table writer + {{- if .HistoryCmd }} + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Ref", "Operation", "UpdatedAt", "UpdatedBy") + {{- else }} + // TODO: add additional columns to the table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID") + {{- end }} + for _, i := range out { + {{- if .HistoryCmd }} + writer.AddRow(i.ID, *i.Ref, i.Operation, *i.UpdatedAt, *i.UpdatedBy) + {{- else }} + writer.AddRow(i.ID) + {{- end }} + } + + writer.Render() +} + +{{- if not .ListOnly }} +// deleteTableOutput prints the deleted id in a table format +func deletedTableOutput(e *openlaneclient.Delete{{ .Name | ToUpperCamel }}) { + writer := tables.NewTableWriter(command.OutOrStdout(), "DeletedID") + + writer.AddRow(e.Delete{{ .Name | ToUpperCamel }}.DeletedID) + + writer.Render() +} +{{- end }} diff --git a/pkg/gencmd/templates/update.tmpl b/pkg/gencmd/templates/update.tmpl new file mode 100644 index 0000000..6290180 --- /dev/null +++ b/pkg/gencmd/templates/update.tmpl @@ -0,0 +1,59 @@ +package {{ .Name | ToLower }} + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" +) + +var updateCmd = &cobra.Command{ + Use: "update", + Short: "update an existing {{ .Name | ToLowerCamel }}", + Run: func(cmd *cobra.Command, args []string) { + err := update(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(updateCmd) + + updateCmd.Flags().StringP("id", "i", "", "{{ .Name | ToLowerCamel }} id to update") + + // command line flags for the update command + + // example: + // updateCmd.Flags().StringP("name", "n", "", "name of the {{ .Name | ToLowerCamel }}") +} + +// updateValidation validates the required fields for the command +func updateValidation() (id string, input openlaneclient.Update{{ .Name | ToUpperCamel }}Input, err error) { + id = cmd.Config.String("id") + if id == "" { + return id, input, cmd.NewRequiredFieldMissingError("{{ .Name | ToLowerCamel }} id") + } + + // validation of required fields for the update command + // output the input struct with the required fields and optional fields based on the command line flags + + return id, input, nil +} + +// update an existing {{ .Name | ToLowerCamel }} in the platform +func update(ctx context.Context) error { + // setup http client + client, err := cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + + id, input, err := updateValidation() + cobra.CheckErr(err) + + o, err := client.Update{{ .Name | ToUpperCamel }}(ctx, id, input) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/pkg/gqlplugin/bulkgen/bulk.gotpl b/pkg/gqlplugin/bulkgen/bulk.gotpl new file mode 100644 index 0000000..67aa178 --- /dev/null +++ b/pkg/gqlplugin/bulkgen/bulk.gotpl @@ -0,0 +1,30 @@ +{{ reserveImport "context" }} +{{ reserveImport "errors" }} + +{{reserveImport "github.com/theopenlane/core/internal/ent/generated" }} +{{reserveImport "github.com/theopenlane/core/internal/ent/generated/privacy"}} + +{{ $root := . }} + +{{ range $object := .Objects }} + +// bulkCreate{{ $object.Name }} uses the CreateBulk function to create multiple {{ $object.Name }} entities +func (r *mutationResolver) bulkCreate{{ $object.Name }} (ctx context.Context, input []*generated.Create{{ $object.Name }}Input) (*{{ $object.Name }}BulkCreatePayload, error) { + c := withTransactionalMutation(ctx) + builders := make([]*generated.{{ $object.Name }}Create, len(input)) + for i, data := range input { + builders[i] = c.{{ $object.Name }}.Create().SetInput(*data) + } + + res, err := c.{{ $object.Name }}.CreateBulk(builders...).Save(ctx) + if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "{{ $object.Name | toLower }}"}, r.logger) + } + + // return response + return &{{ $object.Name }}BulkCreatePayload{ + {{ $object.PluralName }}: res, + }, nil +} + +{{ end }} \ No newline at end of file diff --git a/pkg/gqlplugin/bulkgen/bulkresolvers.go b/pkg/gqlplugin/bulkgen/bulkresolvers.go new file mode 100644 index 0000000..8402f56 --- /dev/null +++ b/pkg/gqlplugin/bulkgen/bulkresolvers.go @@ -0,0 +1,87 @@ +package bulkgen + +import ( + _ "embed" + "strings" + "text/template" + + "github.com/99designs/gqlgen/codegen" + "github.com/99designs/gqlgen/codegen/templates" + "github.com/99designs/gqlgen/plugin" + "github.com/gertd/go-pluralize" +) + +//go:embed bulk.gotpl +var bulkTemplate string + +// New returns a new plugin +func New() plugin.Plugin { + return &Plugin{} +} + +// Plugin is a gqlgen plugin to generate bulk resolver functions used for mutations +type Plugin struct{} + +// Name returns the name of the plugin +func (m *Plugin) Name() string { + return "bulkgen" +} + +// BulkResolverBuild is a struct to hold the objects for the bulk resolver +type BulkResolverBuild struct { + // Objects is a list of objects to generate bulk resolvers for + Objects []Object +} + +// Object is a struct to hold the object name for the bulk resolver +type Object struct { + // Name of the object + Name string + // PluralName of the object + PluralName string +} + +// GenerateCode generates the bulk resolver code +func (m *Plugin) GenerateCode(data *codegen.Data) error { + if !data.Config.Resolver.IsDefined() { + return nil + } + + return m.generateSingleFile(*data) +} + +// generateSingleFile generates the bulk resolver code, this is all done in a single file and +// used by the resolvergen plugin for each bulk resolver +func (m *Plugin) generateSingleFile(data codegen.Data) error { + inputData := BulkResolverBuild{ + Objects: []Object{}, + } + + for _, f := range data.Schema.Mutation.Fields { + lowerName := strings.ToLower(f.Name) + + // if the field is a bulk create mutation, add it to the list of objects + // we skip csv bulk mutations because they will reuse the same functions + if strings.Contains(lowerName, "bulk") && !strings.Contains(lowerName, "csv") { + objectName := strings.Replace(f.Name, "createBulk", "", 1) + + inputData.Objects = append(inputData.Objects, Object{ + Name: objectName, + PluralName: pluralize.NewClient().Plural(objectName), + }) + } + } + + // render the bulk resolver template + return templates.Render(templates.Options{ + PackageName: data.Config.Resolver.Package, // use the resolver package + Filename: data.Config.Resolver.Dir() + "/bulk.go", // write to the resolver directory + FileNotice: `// THIS CODE IS REGENERATED BY github.com/theopenlane/core/pkg/gqlplugin. DO NOT EDIT.`, + Data: inputData, + Funcs: template.FuncMap{ + "toLower": strings.ToLower, + }, + Packages: data.Config.Packages, + Template: bulkTemplate, + }) +} diff --git a/pkg/gqlplugin/bulkgen/doc.go b/pkg/gqlplugin/bulkgen/doc.go new file mode 100644 index 0000000..838c78f --- /dev/null +++ b/pkg/gqlplugin/bulkgen/doc.go @@ -0,0 +1,2 @@ +// Package bulkgen provides a gqlgen plugin to generate bulk resolver functions used for mutations +package bulkgen diff --git a/pkg/gqlplugin/resolvergen/crud.go b/pkg/gqlplugin/resolvergen/crud.go new file mode 100644 index 0000000..ed2f18b --- /dev/null +++ b/pkg/gqlplugin/resolvergen/crud.go @@ -0,0 +1,154 @@ +package resolvergen + +import ( + "embed" + + "bytes" + "html/template" + "strings" + + "github.com/99designs/gqlgen/codegen" + gqltemplates "github.com/99designs/gqlgen/codegen/templates" + + "github.com/stoewer/go-strcase" + gqlast "github.com/vektah/gqlparser/v2/ast" +) + +//go:embed templates/**.gotpl +var templates embed.FS + +// crudResolver is a struct to hold the field for the CRUD resolver +type crudResolver struct { + Field *codegen.Field + AppendFields []string +} + +// renderTemplate renders the template with the given name +func renderTemplate(templateName string, input *crudResolver) string { + t, err := template.New(templateName).Funcs(template.FuncMap{ + "getEntityName": getEntityName, + "toLower": strings.ToLower, + "toLowerCamel": strcase.LowerCamelCase, + "hasArgument": hasArgument, + "hasOwnerField": hasOwnerField, + "reserveImport": gqltemplates.CurrentImports.Reserve, + }).ParseFS(templates, "templates/"+templateName) + if err != nil { + panic(err) + } + + var code bytes.Buffer + + if err = t.Execute(&code, input); err != nil { + panic(err) + } + + return strings.Trim(code.String(), "\t \n") +} + +// renderCreate renders the create template +func renderCreate(field *codegen.Field) string { + return renderTemplate("create.gotpl", &crudResolver{ + Field: field, + }) +} + +// renderUpdate renders the update template +func renderUpdate(field *codegen.Field) string { + appendFields := getAppendFields(field) + + cr := &crudResolver{ + Field: field, + AppendFields: appendFields, + } + + return renderTemplate("update.gotpl", cr) +} + +// renderDelete renders the delete template +func renderDelete(field *codegen.Field) string { + return renderTemplate("delete.gotpl", &crudResolver{ + Field: field, + }) +} + +// renderBulkUpload renders the bulk upload template +func renderBulkUpload(field *codegen.Field) string { + return renderTemplate("upload.gotpl", &crudResolver{ + Field: field, + }) +} + +// renderBulk renders the bulk template +func renderBulk(field *codegen.Field) string { + return renderTemplate("bulk.gotpl", &crudResolver{ + Field: field, + }) +} + +// renderQuery renders the query template +func renderQuery(field *codegen.Field) string { + return renderTemplate("get.gotpl", &crudResolver{ + Field: field, + }) +} + +// renderList renders the list template +func renderList(field *codegen.Field) string { + return renderTemplate("list.gotpl", &crudResolver{ + Field: field, + }) +} + +// crudTypes is a list of CRUD operations that are included in the resolver name +var stripStrings = []string{"Create", "Update", "Delete", "Bulk", "CSV", "Connection", "Payload"} + +// getEntityName returns the entity name by stripping the CRUD operation from the resolver name +func getEntityName(name string) string { + for _, s := range stripStrings { + if strings.Contains(name, s) { + name = strings.ReplaceAll(name, s, "") + } + } + + return name +} + +// hasArgument checks if the argument is present in the list of arguments +func hasArgument(arg string, args gqlast.ArgumentDefinitionList) bool { + for _, a := range args { + if a.Name == arg { + return true + } + } + + return false +} + +// hasOwnerField checks if the field has an owner field in the input arguments +func hasOwnerField(field *codegen.Field) bool { + for _, arg := range field.Args { + if arg.TypeReference.Definition.Kind == gqlast.InputObject { + if arg.TypeReference.Definition.Fields.ForName("ownerID") != nil { + return true + } + } + } + + return false +} + +// getAppendFields returns the list of fields that are appendable in the update mutation +func getAppendFields(field *codegen.Field) (appendFields []string) { + for _, arg := range field.Args { + if arg.TypeReference.Definition.Kind == gqlast.InputObject { + for _, f := range arg.TypeReference.Definition.Fields { + if strings.Contains(f.Name, "append") { + appendFields = append(appendFields, strcase.UpperCamelCase(f.Name)) + } + } + } + } + + return +} diff --git a/pkg/gqlplugin/resolvergen/crud_test.go b/pkg/gqlplugin/resolvergen/crud_test.go new file mode 100644 index 0000000..e214a86 --- /dev/null +++ b/pkg/gqlplugin/resolvergen/crud_test.go @@ -0,0 +1,100 @@ +package resolvergen + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/vektah/gqlparser/v2/ast" +) + +func TestHasArgument(t *testing.T) { + args := ast.ArgumentDefinitionList{ + {Name: "where"}, + {Name: "here"}, + } + + testCases := []struct { + name string + argName string + expected bool + }{ + { + name: "arg found", + argName: "where", + expected: true, + }, + { + name: "arg not found", + argName: "nowhere", + expected: false, + }, + { + name: "empty arg", + argName: "", + expected: false, + }, + } + + for _, tc := range testCases { + t.Run("Get "+tc.name, func(t *testing.T) { + res := hasArgument(tc.argName, args) + assert.Equal(t, tc.expected, res) + }) + } +} + +func TestGetEntityName(t *testing.T) { + testCases := []struct { + name string + input string + expected string + }{ + { + name: "strip Create", + input: "CreateUser", + expected: "User", + }, + { + name: "strip Update", + input: "UpdatePost", + expected: "Post", + }, + { + name: "strip Delete", + input: "DeleteComment", + expected: "Comment", + }, + { + name: "strip Bulk", + input: "BulkUpdateProduct", + expected: "Product", + }, + { + name: "strip CSV + Bulk", + input: "BulkCSVOrder", + expected: "Order", + }, + { + name: "strip Connection", + input: "UserConnection", + expected: "User", + }, + { + name: "strip Payload", + input: "PayloadUser", + expected: "User", + }, + { + name: "no strip", + input: "User", + expected: "User", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + res := getEntityName(tc.input) + assert.Equal(t, tc.expected, res) + }) + } +} diff --git a/pkg/gqlplugin/resolvergen/doc.go b/pkg/gqlplugin/resolvergen/doc.go new file mode 100644 index 0000000..309553d --- /dev/null +++ b/pkg/gqlplugin/resolvergen/doc.go @@ -0,0 +1,2 @@ +// Package resolvergen provides the a resolver template for the gqlgen resolver plugin to override the default resolver functions +package resolvergen diff --git a/pkg/gqlplugin/resolvergen/resolver.go b/pkg/gqlplugin/resolvergen/resolver.go new file mode 100644 index 0000000..31a2db6 --- /dev/null +++ b/pkg/gqlplugin/resolvergen/resolver.go @@ -0,0 +1,113 @@ +package resolvergen + +import ( + "fmt" + "strings" + + "github.com/99designs/gqlgen/codegen" + "github.com/99designs/gqlgen/plugin" + "github.com/99designs/gqlgen/plugin/resolvergen" +) + +var ( + _ plugin.ResolverImplementer = (*ResolverPlugin)(nil) +) + +const ( + defaultImplementation = "panic(fmt.Errorf(\"not implemented: %v - %v\"))" +) + +// ResolverPlugin is a gqlgen plugin to generate resolver functions +type ResolverPlugin struct { + *resolvergen.Plugin +} + +// Name returns the name of the plugin +// This name must match the upstream resolvergen to replace during code generation +func (r ResolverPlugin) Name() string { + return "resolvergen" +} + +// New returns a new resolver plugin +func New() *ResolverPlugin { + return &ResolverPlugin{} +} + +// Implement gqlgen api.ResolverImplementer +func (r ResolverPlugin) Implement(s string, f *codegen.Field) (val string) { + // if the field has a custom resolver, use it + // panic is not a custom resolver so attempt to implement the field + if s != "" && !strings.Contains(s, "panic") { + return s + } + + switch { + case isMutation(f): + return mutationImplementer(f) + case isQuery(f): + return queryImplementer(f) + default: + return fmt.Sprintf(defaultImplementation, f.GoFieldName, f.Name) + } +} + +// GenerateCode implements api.CodeGenerator +func (r ResolverPlugin) GenerateCode(data *codegen.Data) error { + // use the default resolver plugin to generate the code + return r.Plugin.GenerateCode(data) +} + +// isMutation returns true if the field is a mutation +func isMutation(f *codegen.Field) bool { + return f.Object.Definition.Name == "Mutation" +} + +// isQuery returns true if the field is a query +func isQuery(f *codegen.Field) bool { + return f.Object.Definition.Name == "Query" +} + +// mutationImplementer returns the implementation for the mutation +func mutationImplementer(f *codegen.Field) string { + switch crudType(f) { + case "BulkCSV": + return renderBulkUpload(f) + case "Bulk": + return renderBulk(f) + case "Create": + return renderCreate(f) + case "Update": + return renderUpdate(f) + case "Delete": + return renderDelete(f) + default: + return fmt.Sprintf(defaultImplementation, f.GoFieldName, f.Name) + } +} + +// queryImplementer returns the implementation for the query +func queryImplementer(f *codegen.Field) string { + if strings.Contains(f.TypeReference.Definition.Name, "Connection") { + return renderList(f) + } + + return renderQuery(f) +} + +// crudType returns the type of CRUD operation +func crudType(f *codegen.Field) string { + switch { + case strings.Contains(f.GoFieldName, "CSV"): + return "BulkCSV" + case strings.Contains(f.GoFieldName, "Bulk"): + return "Bulk" + case strings.Contains(f.GoFieldName, "Create"): + return "Create" + case strings.Contains(f.GoFieldName, "Update"): + return "Update" + case strings.Contains(f.GoFieldName, "Delete"): + return "Delete" + default: + return "unknown" + } +} diff --git a/pkg/gqlplugin/resolvergen/templates/bulk.gotpl b/pkg/gqlplugin/resolvergen/templates/bulk.gotpl new file mode 100644 index 0000000..aa8749e --- /dev/null +++ b/pkg/gqlplugin/resolvergen/templates/bulk.gotpl @@ -0,0 +1,3 @@ +{{ $entity := .Field.TypeReference.Definition.Name | getEntityName -}} + +return r.bulkCreate{{ $entity }}(ctx, input) \ No newline at end of file diff --git a/pkg/gqlplugin/resolvergen/templates/create.gotpl b/pkg/gqlplugin/resolvergen/templates/create.gotpl new file mode 100644 index 0000000..1a75435 --- /dev/null +++ b/pkg/gqlplugin/resolvergen/templates/create.gotpl @@ -0,0 +1,22 @@ +{{ reserveImport "github.com/theopenlane/utils/rout" }} + +{{ $entity := .Field.TypeReference.Definition.Name | getEntityName -}} +{{ $isOrgOwned := .Field | hasOwnerField -}} + +{{- if $isOrgOwned }} +// set the organization in the auth context if its not done for us +if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, rout.NewMissingRequiredFieldError("owner_id") +} +{{- end }} + +res, err := withTransactionalMutation(ctx).{{ $entity }}.Create().SetInput(input).Save(ctx) +if err != nil { + return nil, parseRequestError(err, action{action: ActionCreate, object: "{{ $entity | toLower }}"}, r.logger) +} + +return &{{ $entity }}CreatePayload{ + {{ $entity }}: res, +}, nil diff --git a/pkg/gqlplugin/resolvergen/templates/delete.gotpl b/pkg/gqlplugin/resolvergen/templates/delete.gotpl new file mode 100644 index 0000000..b81deb3 --- /dev/null +++ b/pkg/gqlplugin/resolvergen/templates/delete.gotpl @@ -0,0 +1,13 @@ +{{ $entity := .Field.TypeReference.Definition.Name | getEntityName -}} + +if err := withTransactionalMutation(ctx).{{ $entity }}.DeleteOneID(id).Exec(ctx); err != nil { + return nil, parseRequestError(err, action{action: ActionDelete, object: "{{ $entity | toLower }}"}, r.logger) +} + +if err := generated.{{ $entity }}EdgeCleanup(ctx, id); err != nil { + return nil, newCascadeDeleteError(err) +} + +return &{{ $entity }}DeletePayload{ + DeletedID: id, +}, nil \ No newline at end of file diff --git a/pkg/gqlplugin/resolvergen/templates/get.gotpl b/pkg/gqlplugin/resolvergen/templates/get.gotpl new file mode 100644 index 0000000..3162942 --- /dev/null +++ b/pkg/gqlplugin/resolvergen/templates/get.gotpl @@ -0,0 +1,8 @@ +{{ $entity := .Field.TypeReference.Definition.Name | getEntityName -}} + +res, err := withTransactionalMutation(ctx).{{ $entity }}.Get(ctx, id) +if err != nil { + return nil, parseRequestError(err, action{action: ActionGet, object: "{{ $entity | toLower }}"}, r.logger) +} + +return res, nil \ No newline at end of file diff --git a/pkg/gqlplugin/resolvergen/templates/list.gotpl b/pkg/gqlplugin/resolvergen/templates/list.gotpl new file mode 100644 index 0000000..63b8ad2 --- /dev/null +++ b/pkg/gqlplugin/resolvergen/templates/list.gotpl @@ -0,0 +1,29 @@ +{{ $entity := .Field.TypeReference.Definition.Name | getEntityName -}} +{{ $hasAfter := hasArgument "after" .Field.FieldDefinition.Arguments }} +{{ $hasFirst := hasArgument "first" .Field.FieldDefinition.Arguments }} +{{ $hasBefore := hasArgument "before" .Field.FieldDefinition.Arguments }} +{{ $hasLast := hasArgument "last" .Field.FieldDefinition.Arguments }} +{{ $hasOrderBy := hasArgument "orderBy" .Field.FieldDefinition.Arguments }} +{{ $hasWhere := hasArgument "where" .Field.FieldDefinition.Arguments }} + +return withTransactionalMutation(ctx).{{ $entity }}.Query().Paginate( + ctx, + {{- if $hasAfter }} + after, + {{- end -}} + {{- if $hasFirst }} + first, + {{- end -}} + {{- if $hasBefore }} + before, + {{- end -}} + {{- if $hasLast }} + last, + {{- end -}} + {{- if $hasOrderBy }} + generated.With{{ $entity }}Order(orderBy), + {{- end -}} + {{- if $hasWhere }} + generated.With{{ $entity }}Filter(where.Filter), + {{- end -}} +) \ No newline at end of file diff --git a/pkg/gqlplugin/resolvergen/templates/update.gotpl b/pkg/gqlplugin/resolvergen/templates/update.gotpl new file mode 100644 index 0000000..3d9be4b --- /dev/null +++ b/pkg/gqlplugin/resolvergen/templates/update.gotpl @@ -0,0 +1,28 @@ +{{ $entity := .Field.TypeReference.Definition.Name | getEntityName -}} +{{ $isOrgOwned := .Field | hasOwnerField -}} + +res, err := withTransactionalMutation(ctx).{{ $entity }}.Get(ctx, id) +if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "{{ $entity | toLower }}"}, r.logger) +} + +{{- if $isOrgOwned }} +// set the organization in the auth context if its not done for us +if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { + r.logger.Errorw("failed to set organization in auth context", "error", err) + + return nil, ErrPermissionDenied +} +{{- end }} + +// setup update request +req := res.Update().SetInput(input){{- range $appendField := .AppendFields }}.{{ $appendField }}(input.{{ $appendField }}){{- end }} + +res, err = req.Save(ctx) +if err != nil { + return nil, parseRequestError(err, action{action: ActionUpdate, object: "{{ $entity | toLower }}"}, r.logger) +} + +return &{{ $entity }}UpdatePayload{ + {{ $entity }}: res, + }, nil \ No newline at end of file diff --git a/pkg/gqlplugin/resolvergen/templates/upload.gotpl b/pkg/gqlplugin/resolvergen/templates/upload.gotpl new file mode 100644 index 0000000..e5c8506 --- /dev/null +++ b/pkg/gqlplugin/resolvergen/templates/upload.gotpl @@ -0,0 +1,10 @@ +{{ $entity := .Field.TypeReference.Definition.Name | getEntityName -}} + +data, err := unmarshalBulkData[generated.Create{{ $entity }}Input](input) +if err != nil { + r.logger.Errorw("failed to unmarshal bulk data", "error", err) + + return nil, err +} + +return r.bulkCreate{{ $entity }}(ctx, data) \ No newline at end of file diff --git a/pkg/httpsling/README.md b/pkg/httpsling/README.md deleted file mode 100644 index f51407c..0000000 --- a/pkg/httpsling/README.md +++ /dev/null @@ -1,869 +0,0 @@ -# Slinging HTTP - -The `httpsling` library simplifies the way you make HTTP httpsling. It's intended to provide an easy-to-use interface for sending requests and handling responses, reducing the boilerplate code typically associated with the `net/http` package. - -## Overview - -Creating a new HTTP client and making a request should be straightforward: - -```go -package main - -import ( - "github.com/theopenlane/core/pkg/httpsling" - "log" -) - -func main() { - // Create a client using a base URL - client := httpsling.URL("http://mattisthebest.com") - - // Alternatively, create a client with custom configuration - client = httpsling.Create(&httpsling.Config{ - BaseURL: "http://mattisthebest.com", - Timeout: 30 * time.Second, - }) - - // Perform a GET request - resp, err := client.Get("/resource") - if err != nil { - log.Fatal(err) - } - - defer resp.Close() - - log.Println(resp.String()) -} -``` - -## Client - -The `Client` struct is your gateway to making HTTP requests. You can configure it to your needs, setting default headers, cookies, timeout durations, etc. - -```go -client := httpsling.URL("http://mattisthebest.com") - -// Or, with full configuration -client = httpsling.Create(&httpsling.Config{ - BaseURL: "http://mattisthebest.com", - Timeout: 5 * time.Second, - Headers: &http.Header{ - HeaderContentType: []string{ContentTypeJSON}, - }, -}) -``` - -### Initializing the Client - -You can start by creating a `Client` with specific configurations using the `Create` method: - -```go -client := httpsling.Create(&httpsling.Config{ - BaseURL: "https://the.cats.meow.com", - Timeout: 30 * time.Second, - Headers: &http.Header{ - HeaderAuthorization: []string{"Bearer YOUR_ACCESS_TOKEN"}, - HeaderContentType: []string{ContentTypeJSON}, - }, - Cookies: map[string]string{ - "session_token": "YOUR_SESSION_TOKEN", - }, - TLSConfig: &tls.Config{ - InsecureSkipVerify: true, - }, - MaxRetries: 3, - RetryStrategy: httpsling.ExponentialBackoffStrategy(1*time.Second, 2, 30*time.Second), - RetryIf: httpsling.DefaultRetryIf, -}) -``` - -This setup creates a `Client` tailored for your API communication, including base URL, request timeout, default headers, and cookies - -### Configuring with Set Methods - -Alternatively, you can use `Set` methods for a more dynamic configuration approach: - -```go -client := httpsling.URL("https://the.cats.meow.com"). - SetDefaultHeader(HeaderAuthorization, "Bearer YOUR_ACCESS_TOKEN"). - SetDefaultHeader(HeaderContentType, ContentTypeJSON). - SetDefaultCookie("session_token", "YOUR_SESSION_TOKEN"). - SetTLSConfig(&tls.Config{InsecureSkipVerify: true}). - SetMaxRetries(3). - SetRetryStrategy(httpsling.ExponentialBackoffStrategy(1*time.Second, 2, 30*time.Second)). - SetRetryIf(httpsling.DefaultRetryIf). - SetProxy("http://localhost:8080") -``` - -### Configuring BaseURL - -Set the base URL for all requests: - -```go -client.SetBaseURL("https://the.cats.meow.com") -``` - -### Setting Headers - -Set default headers for all requests: - -```go -client.SetDefaultHeader(HeaderAuthorization, "Bearer YOUR_ACCESS_TOKEN") -client.SetDefaultHeader(HeaderContentType, ContentTypeJSON) -``` - -Bulk set default headers: - -```go -headers := &http.Header{ - HeaderAuthorization: []string{"Bearer YOUR_ACCESS_TOKEN"}, - HeaderContentType: []string{ContentTypeJSON}, -} -client.SetDefaultHeaders(headers) -``` - -Add or remove a header: - -```go -client.AddDefaultHeader("X-Custom-Header", "Value1") -client.DelDefaultHeader("X-Unneeded-Header") -``` - -### Managing Cookies - -Set default cookies for all requests: - -```go -client.SetDefaultCookie("session_id", "123456") -``` - -Bulk set default cookies: - -```go -cookies := map[string]string{ - "session_id": "123456", - "preferences": "dark_mode=true", -} -client.SetDefaultCookies(cookies) -``` - -Remove a default cookie: - -```go -client.DelDefaultCookie("session_id") -``` - -This approach simplifies managing base URLs, headers, and cookies across all requests made with the client, ensuring consistency. - -### Configuring Timeouts - -Define a global timeout for all requests to prevent indefinitely hanging operations: - -```go -client := httpsling.Create(&httpsling.Config{ - Timeout: 15 * time.Second, -}) -``` - -### TLS Configuration - -Custom TLS configurations can be applied for enhanced security measures, such as loading custom certificates: - -```go -tlsConfig := &tls.Config{InsecureSkipVerify: true} -client.SetTLSConfig(tlsConfig) -``` - -## Requests - -The library provides a `RequestBuilder` to construct and dispatch HTTP httpsling. Here are examples of performing various types of requests, including adding query parameters, setting headers, and attaching a body to your httpsling. - -#### GET Request - -```go -resp, err := client.Get("/path"). - Query("search", "query"). - Header(HeaderAccept, ContentTypeJSON). - Send(context.Background()) -``` - -#### POST Request - -```go -resp, err := client.Post("/path"). - Header(HeaderContentType, ContentTypeJSON). - JSONBody(map[string]interface{}{"key": "value"}). - Send(context.Background()) -``` - -#### PUT Request - -```go -resp, err := client.Put("/stff/{stuff_id}"). - PathParam("stuff_id", "123456"). - JSONBody(map[string]interface{}{"updatedKey": "newValue"}). - Send(context.Background()) -``` - -#### DELETE Request - -```go -resp, err := client.Delete("/stffs/{stuff_id}"). - PathParam("stuff_id", "123456meowmeow"). - Send(context.Background()) -``` - -### Retry Mechanism - -Automatically retry requests on failure with customizable strategies: - -```go -client.SetMaxRetries(3) -client.SetRetryStrategy(httpsling.ExponentialBackoffStrategy(1*time.Second, 2, 30*time.Second)) -client.SetRetryIf(func(req *http.Request, resp *http.Response, err error) bool { - // Only retry for 500 Internal Server Error - return resp.StatusCode == http.StatusInternalServerError -}) -``` - -### Configuring Retry Strategies - -#### Applying a Default Backoff Strategy - -For consistent delay intervals between retries: - -```go -client.SetRetryStrategy(httpsling.DefaultBackoffStrategy(5 * time.Second)) -``` - -#### Utilizing a Linear Backoff Strategy - -To increase delay intervals linearly with each retry attempt: - -```go -client.SetRetryStrategy(httpsling.LinearBackoffStrategy(1 * time.Second)) -``` - -#### Employing an Exponential Backoff Strategy - -For exponential delay increases between attempts, with an option to cap the delay: - -```go -client.SetRetryStrategy(httpsling.ExponentialBackoffStrategy(1*time.Second, 2, 30*time.Second)) -``` - -### Customizing Retry Conditions - -Define when retries should be attempted based on response status codes or errors: - -```go -client.SetRetryIf(func(req *http.Request, resp *http.Response, err error) bool { - return resp.StatusCode == http.StatusInternalServerError || err != nil -}) -``` - -### Setting Maximum Retry Attempts - -To limit the number of retries, use the `SetMaxRetries` method: - -```go -client.SetMaxRetries(3) -``` - -### Proxy Configuration - -Route requests through a proxy server: - -```go -client.SetProxy("http://localhost:8080") -``` - -### Authentication - -Supports various authentication methods: - -- **Basic Auth**: - -```go -client.SetAuth(httpsling.BasicAuth{ - Username: "user", - Password: "pass", -}) -``` - -- **Bearer Token**: - -```go -client.SetAuth(httpsling.BearerAuth{ - Token: "YOUR_ACCESS_TOKEN", -}) -``` - -### Query Parameters - -Add query parameters to your request using `Query`, `Queries`, `QueriesStruct`, or remove them with `DelQuery` - -```go -// Add a single query parameter -request.Query("search", "query") - -// Add multiple query parameters -request.Queries(url.Values{"sort": []string{"date"}, "limit": []string{"10"}}) - -// Add query parameters from a struct -type queryParams struct { - Sort string `url:"sort"` - Limit int `url:"limit"` -} -request.QueriesStruct(queryParams{Sort: "date", Limit: 10}) - -// Remove one or more query parameters -request.DelQuery("sort", "limit") -``` - -### Headers - -Set request headers using `Header`, `Headers`, or related methods - -```go -request.Header(HeaderAuthorization, "Bearer YOUR_ACCESS_TOKEN") -request.Headers(http.Header{HeaderContentType: []string{ContentTypeJSON}}) - -// Convenient methods for common headers -request.ContentType(ContentTypeJSON) -request.Accept(ContentTypeJSON) -request.UserAgent("MyCustomClient/1.0") -request.Referer("https://example.com") -``` - -### Cookies - -Add cookies to your request using `Cookie`, `Cookies`, or remove them with `DelCookie`. - -```go -// Add a single cookie -request.Cookie("session_token", "YOUR_SESSION_TOKEN") - -// Add multiple cookies at once -request.Cookies(map[string]string{ - "session_token": "YOUR_SESSION_TOKEN", - "user_id": "12345", -}) - -// Remove one or more cookies -request.DelCookie("session_token", "user_id") - -``` - -### Body Content - -Specify the request body directly with `Body` or use format-specific methods like `JSONBody`, `XMLBody`, `YAMLBody`, `TextBody`, or `RawBody` for appropriate content types. - -```go -// Setting JSON body -request.JSONBody(map[string]interface{}{"key": "value"}) - -// Setting XML body -request.XMLBody(myXmlStruct) - -// Setting YAML body -request.YAMLBody(myYamlStruct) - -// Setting text body -request.TextBody("plain text content") - -// Setting raw body -request.RawBody([]byte("raw data")) -``` - -### Timeout and Retries - -Configure request-specific timeout and retry strategies: - -```go -request.Timeout(10 * time.Second).MaxRetries(3) -``` - -### Sending Requests - -The `Send(ctx)` method executes the HTTP request built with the Request builder. It requires a `context.Context` argument, allowing you to control request cancellation and timeouts. - -```go -resp, err := request.Send(context.Background()) -if err != nil { - log.Fatalf("Request failed: %v", err) -} -// Process response... -``` -### Advanced Features - -#### Handling Cancellation - -To cancel a request, simply use the context's cancel function. This is particularly useful for long-running requests that you may want to abort if they take too long or if certain conditions are met. - -```go -ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) -defer cancel() // Ensures resources are freed up after the operation completes or times out - -// Cancel the request if it hasn't completed within the timeout -resp, err := request.Send(ctx) -if errors.Is(err, context.Canceled) { - log.Println("Request was canceled") -} -``` - -#### HTTP Client Customization - -Directly customize the underlying `http.Client`: - -```go -customHTTPClient := &http.Client{Timeout: 20 * time.Second} -client.SetHTTPClient(customHTTPClient) -``` - -#### Path Parameters - -To insert or modify path parameters in your URL, use `PathParam` for individual parameters or `PathParams` for multiple. For removal, use `DelPathParam`. - -```go -// Setting a single path parameter -request.PathParam("userId", "123") - -// Setting multiple path parameters at once -request.PathParams(map[string]string{"userId": "123", "postId": "456"}) - -// Removing path parameters -request.DelPathParam("userId", "postId") -``` - -When using `client.Get("/users/{userId}/posts/{postId}")`, replace `{userId}` and `{postId}` with actual values by using `PathParams` or `PathParam`. - -#### Form Data - -For `application/x-www-form-urlencoded` content, utilize `FormField` for individual fields or `FormFields` for multiple. - -```go -// Adding individual form field -request.FormField("name", "John Snow") - -// Setting multiple form fields at once -fields := map[string]interface{}{"name": "John", "age": "30"} -request.FormFields(fields) -``` - -#### File Uploads - -To include files in a `multipart/form-data` request, specify each file's form field name, file name, and content using `File` or add multiple files with `Files`. - -```go -// Adding a single file -file, _ := os.Open("path/to/file") -request.File("profile_picture", "filename.jpg", file) - -// Adding multiple files -request.Files(file1, file2) -``` - -### Authentication - -Apply authentication methods directly to the request: - -```go -request.Auth(httpsling.BasicAuth{ - Username: "user", - Password: "pass", -}) -``` - -## Middleware - -Add custom middleware to process the request or response: - -```go -request.AddMiddleware(func(next httpsling.MiddlewareHandlerFunc) httpsling.MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - // Custom logic before request - resp, err := next(req) - // Custom logic after response - return resp, err - } -}) -``` - -### Understanding Middleware - -Middleware functions wrap around HTTP requests, allowing pre- and post-processing of requests and responses. They can modify requests before they are sent, examine responses, and decide whether to modify them, retry the request, or take other actions. - -### Client-Level Middleware - -Client-level middleware is applied to all requests made by a client. It's ideal for cross-cutting concerns like logging, error handling, and metrics collection. - -**Adding Middleware to a Client:** - -```go -client := httpsling.Create(&httpsling.Config{BaseURL: "https://the.cats.meow.com"}) -client.AddMiddleware(func(next httpsling.MiddlewareHandlerFunc) httpsling.MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - // Pre-request manipulation - fmt.Println("Request URL:", req.URL) - - // Proceed with the request - resp, err := next(req) - - // Post-response manipulation - if err == nil { - fmt.Println("Response status:", resp.Status) - } - - return resp, err - } -}) -``` - -### Request-Level Middleware - -Request-level middleware applies only to individual httpsling. This is useful for request-specific concerns, such as request tracing or modifying the request based on dynamic context. - -**Adding Middleware to a Request:** - -```go -request := client.NewRequestBuilder(MethodGet, "/path").AddMiddleware(func(next httpsling.MiddlewareHandlerFunc) httpsling.MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - // Modify the request here - req.Header.Add("X-Request-ID", "12345") - - // Proceed with the modified request - return next(req) - } -}) -``` - -### Implementing Custom Middleware - -Custom middleware can perform a variety of tasks, such as authentication, logging, and metrics. Here's a simple logging middleware example: - -```go -func loggingMiddleware(next httpsling.MiddlewareHandlerFunc) httpsling.MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - log.Printf("Requesting %s %s", req.Method, req.URL) - resp, err := next(req) - if err != nil { - log.Printf("Request to %s failed: %v", req.URL, err) - } else { - log.Printf("Received %d response from %s", resp.StatusCode, req.URL) - } - return resp, err - } -} -``` - -### Integrating OpenTelemetry Middleware - -OpenTelemetry middleware can be used to collect tracing and metrics for your requests if you're into that sort of thing. Below is an example of how to set up a basic trace for an HTTP request: - -**Implementing OpenTelemetry Middleware:** - -```go -func openTelemetryMiddleware(next httpsling.MiddlewareHandlerFunc) httpsling.MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - ctx, span := otel.Tracer("requests").Start(req.Context(), req.URL.Path) - defer span.End() - - // Add trace ID to request headers if needed - traceID := span.SpanContext().TraceID().String() - req.Header.Set("X-Trace-ID", traceID) - - resp, err := next(req) - - // Set span attributes based on response - if err == nil { - span.SetAttributes(attribute.Int("http.status_code", resp.StatusCode)) - } else { - span.RecordError(err) - } - - return resp, err - } -} -``` - - -## Responses - -Handling responses is necessary in determining the outcome of your HTTP requests - the library has some built-in response code validators and other tasty things. - -```go -type APIResponse struct { - Data string `json:"data"` -} - -var apiResp APIResponse -if err := resp.ScanJSON(&apiResp); err != nil { - log.Fatal(err) -} - -log.Printf("Status Code: %d\n", resp.StatusCode()) -log.Printf("Response Data: %s\n", apiResp.Data) -``` - -### Parsing Response Body - -By leveraging the `Scan`, `ScanJSON`, `ScanXML`, and `ScanYAML` methods, you can decode responses based on the `Content-Type` - -#### JSON Responses - -Given a JSON response, you can unmarshal it directly into a Go struct using either the specific `ScanJSON` method or the generic `Scan` method, which automatically detects the content type: - -```go -var jsonData struct { - Name string `json:"name"` - Age int `json:"age"` -} - -// Unmarshal using ScanJSON -if err := response.ScanJSON(&jsonData); err != nil { - log.Fatalf("Error unmarshalling JSON: %v", err) -} - -// Alternatively, unmarshal using Scan -if err := response.Scan(&jsonData); err != nil { - log.Fatalf("Error unmarshalling response: %v", err) -} -``` - -#### XML Responses - -For XML responses, use `ScanXML` or `Scan` to decode into a Go struct. Here's an example assuming the response contains XML data: - -```go -var xmlData struct { - Name string `xml:"name"` - Age int `xml:"age"` -} - -// Unmarshal using ScanXML -if err := response.ScanXML(&xmlData); err != nil { - log.Fatalf("Error unmarshalling XML: %v", err) -} - -// Alternatively, unmarshal using Scan -if err := response.Scan(&xmlData); err != nil { - log.Fatalf("Error unmarshalling response: %v", err) -} -``` - -#### YAML Responses - -YAML content is similarly straightforward to handle. The `ScanYAML` or `Scan` method decodes the YAML response into the specified Go struct: - -```go -var yamlData struct { - Name string `yaml:"name"` - Age int `yaml:"age"` -} - -// Unmarshal using ScanYAML -if err := response.ScanYAML(&yamlData); err != nil { - log.Fatalf("Error unmarshalling YAML: %v", err) -} - -// Alternatively, unmarshal using Scan -if err := response.Scan(&yamlData); err != nil { - log.Fatalf("Error unmarshalling response: %v", err) -} -``` - -### Storing Response Content - -For saving the response body to a file or streaming it to an `io.Writer`: - -- **Save**: Write the response body to a designated location - - ```go - // Save response to a file - if err := response.Save("downloaded_file.txt"); err != nil { - log.Fatalf("Failed to save file: %v", err) - } - ``` - -### Evaluating Response Success - -To assess whether the HTTP request was successful: - -- **IsSuccess**: Check if the status code signifies a successful response - - ```go - if response.IsSuccess() { - fmt.Println("The request succeeded hot diggity dog") - } - ``` - - -## Enabling Logging - -To turn on logging, you must explicitly initialize and set a `Logger` in the client configuration. Here's how to create and use the `DefaultLogger`, which logs to `os.Stderr` by default, and is configured to log errors only: - -```go -logger := httpsling.NewDefaultLogger(os.Stderr, slog.LevelError) -client := httpsling.Create(&httpsling.Config{ - Logger: logger, -}) -``` - -Or, for an already instantiated client: - -```go -client.SetLogger(httpsling.NewDefaultLogger(os.Stderr, slog.LevelError)) -``` - -### Adjusting Log Levels - -Adjusting the log level is straightforward. After defining your logger, simply set the desired level. This allows you to control the verbosity of the logs based on your requirements. - -```go -logger := httpsling.NewDefaultLogger(os.Stderr, httpsling.LevelError) -logger.SetLevel(httpsling.LevelInfo) // Set to Info level to capture more detailed logs - -client := httpsling.Create(&httpsling.Config{ - Logger: logger, -}) -``` - -The available log levels are: - -- `LevelDebug` -- `LevelInfo` -- `LevelWarn` -- `LevelError` - -### Implementing a Custom Logger - -For more advanced scenarios where you might want to integrate with an existing logging system or format logs differently, implement the `Logger` interface. This requires methods for each level of logging (`Debugf`, `Infof`, `Warnf`, `Errorf`) and a method to set the log level (`SetLevel`). - -Here is a simplified example: - -```go -type MyLogger struct { - // Include your custom logging mechanism here -} - -func (l *MyLogger) Debugf(format string, v ...any) { - // Custom debug logging implementation -} - -func (l *MyLogger) Infof(format string, v ...any) { - // Custom info logging implementation -} - -func (l *MyLogger) Warnf(format string, v ...any) { - // Custom warn logging implementation -} - -func (l *MyLogger) Errorf(format string, v ...any) { - // Custom error logging implementation -} - -func (l *MyLogger) SetLevel(level httpsling.Level) { - // Implement setting the log level in your logger -} - -// Usage -myLogger := &MyLogger{} -myLogger.SetLevel(httpsling.LevelDebug) // Example setting to Debug level - -client := httpsling.Create(&httpsling.Config{ - Logger: myLogger, -}) -``` - -## Stream Callbacks - -Stream callbacks are functions that you define to handle chunks of data as they are received from the server. The Requests library supports three types of stream callbacks: - -- **StreamCallback**: Invoked for each chunk of data received -- **StreamErrCallback**: Invoked when an error occurs during streaming -- **StreamDoneCallback**: Invoked once streaming is completed, regardless of whether it ended due to an error or successfully - -### Configuring Stream Callbacks - -To configure streaming for a request, use the `Stream` method on a `RequestBuilder` instance. This method accepts a `StreamCallback` function, which will be called with each chunk of data received from the server. - -```go -streamCallback := func(data []byte) error { - fmt.Println("Received stream data:", string(data)) - return nil // Return an error if needed to stop streaming -} - -request := client.Get("/stream-endpoint").Stream(streamCallback) -``` - -### Handling Stream Errors - -To handle errors that occur during streaming, set a `StreamErrCallback` using the `StreamErr` method on the `Response` object. - -```go -streamErrCallback := func(err error) { - fmt.Printf("Stream error: %v\n", err) -} - -response, _ := request.Send(context.Background()) -response.StreamErr(streamErrCallback) -``` - -### Completing Stream Processing - -Once streaming is complete, you can use the `StreamDone` method on the `Response` object to set a `StreamDoneCallback`. This callback is invoked after the stream is fully processed, either successfully or due to an error. - -```go -streamDoneCallback := func() { - fmt.Println("Stream processing completed") -} - -response.StreamDone(streamDoneCallback) -``` - -### Example: Consuming an SSE Stream - -The following example demonstrates how to consume a Server-Sent Events (SSE) stream, processing each event as it arrives, handling errors, and performing cleanup once the stream ends. - -```go -// Configure the stream callback to handle data chunks -streamCallback := func(data []byte) error { - fmt.Println("Received stream event:", string(data)) - return nil -} - -// Configure error and done callbacks -streamErrCallback := func(err error) { - fmt.Printf("Error during streaming: %v\n", err) -} - -streamDoneCallback := func() { - fmt.Println("Stream ended") -} - -// Create the streaming request -client := httpsling.Create(&httpsling.Config{BaseURL: "https://example.com"}) -request := client.Get("/events").Stream(streamCallback) - -// Send the request and configure callbacks -response, err := request.Send(context.Background()) -if err != nil { - fmt.Printf("Failed to start streaming: %v\n", err) - return -} - -response.StreamErr(streamErrCallback).StreamDone(streamDoneCallback) -``` - - -## Inspirations - -This library was inspired by and built upon the work of several other HTTP client libraries: - -- [Dghubble/sling](https://github.com/dghubble/sling) -- [Monaco-io/request](https://github.com/monaco-io/request) -- [Go-resty/resty](https://github.com/go-resty/resty) -- [Fiber Client](https://github.com/gofiber/fiber) - -Props to dghubble for a great name with `sling`, which was totally ripped off to make `httpsling` <3. I chose not to use any of these directly because I wanted to have layers of control we may need within our services echosystem. \ No newline at end of file diff --git a/pkg/httpsling/auth.go b/pkg/httpsling/auth.go deleted file mode 100644 index 0a38480..0000000 --- a/pkg/httpsling/auth.go +++ /dev/null @@ -1,71 +0,0 @@ -package httpsling - -import "net/http" - -// AuthType represents the type of authentication method -type AuthType string - -var ( - // BearerAuthType is the Bearer token authentication type using the Authorization header - BearerAuthType AuthType = "Bearer" - // BasicAuthType is the Basic authentication type using a username and password - BasicAuthType AuthType = "Basic" -) - -// AuthMethod defines the interface for applying authentication strategies to httpsling -type AuthMethod interface { - // Apply adds the authentication method to the request - Apply(req *http.Request) - // Valid checks if the authentication method is valid - Valid() bool -} - -// BasicAuth represents HTTP Basic Authentication credentials -type BasicAuth struct { - Username string - Password string -} - -// CustomAuth allows for custom Authorization header values -type CustomAuth struct { - Header string -} - -// BearerAuth represents an OAuth 2.0 Bearer token -type BearerAuth struct { - Token string -} - -// Apply adds the Basic Auth credentials to the request -func (b BasicAuth) Apply(req *http.Request) { - req.SetBasicAuth(b.Username, b.Password) -} - -// Valid checks if the Basic Auth credentials are present -func (b BasicAuth) Valid() bool { - return b.Username != "" && b.Password != "" -} - -// Apply adds the Bearer token to the request's Authorization header -func (b BearerAuth) Apply(req *http.Request) { - if b.Valid() { - req.Header.Set(HeaderAuthorization, "Bearer "+b.Token) - } -} - -// Valid checks if the Bearer token is present -func (b BearerAuth) Valid() bool { - return b.Token != "" -} - -// Apply sets a custom Authorization header value -func (c CustomAuth) Apply(req *http.Request) { - if c.Valid() { - req.Header.Set(HeaderAuthorization, c.Header) - } -} - -// Valid checks if the custom Authorization header value is present -func (c CustomAuth) Valid() bool { - return c.Header != "" -} diff --git a/pkg/httpsling/auth_test.go b/pkg/httpsling/auth_test.go deleted file mode 100644 index b01b775..0000000 --- a/pkg/httpsling/auth_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package httpsling - -import ( - "context" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestBasicAuthApply(t *testing.T) { - req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://hotdogs.com", nil) - - auth := BasicAuth{ - Username: "user", - Password: "pass", - } - auth.Apply(req) - - assert.Equal(t, "Basic dXNlcjpwYXNz", req.Header.Get("Authorization")) -} - -func TestBasicAuthValid(t *testing.T) { - auth := BasicAuth{ - Username: "user", - Password: "pass", - } - - assert.True(t, auth.Valid()) -} - -func TestBearerAuthApply(t *testing.T) { - req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://sarahisgreat.com", nil) - - auth := BearerAuth{ - Token: "token", - } - auth.Apply(req) - - assert.Equal(t, "Bearer token", req.Header.Get("Authorization")) -} - -func TestBearerAuthValid(t *testing.T) { - auth := BearerAuth{ - Token: "token", - } - - assert.True(t, auth.Valid()) -} - -func TestCustomAuthApply(t *testing.T) { - req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://meow.com", nil) - - auth := CustomAuth{ - Header: "CustomValue", - } - auth.Apply(req) - - assert.Equal(t, "CustomValue", req.Header.Get("Authorization")) -} - -func TestCustomAuthValid(t *testing.T) { - auth := CustomAuth{ - Header: "CustomValue", - } - - assert.True(t, auth.Valid()) -} diff --git a/pkg/httpsling/client.go b/pkg/httpsling/client.go deleted file mode 100644 index 0cf832e..0000000 --- a/pkg/httpsling/client.go +++ /dev/null @@ -1,524 +0,0 @@ -package httpsling - -import ( - "crypto/tls" - "net/http" - "net/http/cookiejar" - "sync" - "time" -) - -// Client represents an HTTP client and is the main control mechanism for making HTTP requests -type Client struct { - // mu is a mutex to protect the client's configuration - mu sync.RWMutex - // BaseURL is the base URL for all httpsling made by this client - BaseURL string - // Headers are the default headers to be sent with each request - Headers *http.Header - // Cookies are the default cookies to be sent with each request - Cookies []*http.Cookie - // Middlewares are the request/response manipulation middlewares - Middlewares []Middleware - // TLSConfig is the TLS configuration for the client - TLSConfig *tls.Config - // MaxRetries is the maximum number of retry attempts - MaxRetries int - // RetryStrategy is the backoff strategy for retries - RetryStrategy BackoffStrategy - // RetryIf is the custom retry condition function - RetryIf RetryIfFunc - // HTTPClient is the underlying HTTP client - HTTPClient *http.Client - // JSONEncoder is the JSON encoder for the client - JSONEncoder Encoder - // JSONDecoder is the JSON decoder for the client - JSONDecoder Decoder - // XMLEncoder is the XML encoder for the client - XMLEncoder Encoder - // XMLDecoder is the XML decoder for the client - XMLDecoder Decoder - // YAMLEncoder is the YAML encoder for the client - YAMLEncoder Encoder - // YAMLDecoder is the YAML decoder for the client - YAMLDecoder Decoder - // Logger is the logger instance for the client - Logger Logger - // auth is the authentication method for the client - Auth AuthMethod -} - -// Config sets up the initial configuration for the HTTP client - you need to initialize multiple if you want the behaviors to be different -type Config struct { - // The base URL for all httpsling made by this client - BaseURL string - // Default headers to be sent with each request - Headers *http.Header - // Default Cookies to be sent with each request - Cookies map[string]string - // Timeout for httpsling - Timeout time.Duration - // Cookie jar for the client - CookieJar *cookiejar.Jar - // Middlewares for request/response manipulation - Middlewares []Middleware - // TLS configuration for the client - TLSConfig *tls.Config - // Custom transport for the client - Transport http.RoundTripper - // Maximum number of retry attempts - MaxRetries int - // RetryStrategy defines the backoff strategy for retries - RetryStrategy BackoffStrategy - // RetryIf defines the custom retry condition function - RetryIf RetryIfFunc - // Logger instance for the client - Logger Logger -} - -// URL creates a new HTTP client with the given base URL -func URL(baseURL string) *Client { - return Create(&Config{BaseURL: baseURL}) -} - -// Create initializes a new HTTP client with the given configuration -func Create(config *Config) *Client { - cfg, httpClient := setInitialClientDetails(config) - - // Return a new Client instance - client := &Client{ - BaseURL: cfg.BaseURL, - HTTPClient: httpClient, - JSONEncoder: DefaultJSONEncoder, - JSONDecoder: DefaultJSONDecoder, - XMLEncoder: DefaultXMLEncoder, - XMLDecoder: DefaultXMLDecoder, - YAMLEncoder: DefaultYAMLEncoder, - YAMLDecoder: DefaultYAMLDecoder, - TLSConfig: cfg.TLSConfig, - } - - if config != nil { - client.Headers = config.Headers - } - - return finalizeClientChecks(client, cfg, httpClient) -} - -// finalizeClientChecks is a helper function to finalize the client configuration -func finalizeClientChecks(client *Client, config *Config, httpClient *http.Client) *Client { - if client.TLSConfig != nil && httpClient.Transport != nil { - httpTransport := httpClient.Transport.(*http.Transport) - httpTransport.TLSClientConfig = client.TLSConfig - } else if client.TLSConfig != nil { - httpClient.Transport = &http.Transport{ - TLSClientConfig: client.TLSConfig, - } - } - - if config.Middlewares != nil { - client.Middlewares = config.Middlewares - } else { - client.Middlewares = make([]Middleware, 0) - } - - if config.Cookies != nil { - client.SetDefaultCookies(config.Cookies) - } - - if config.MaxRetries != 0 { - client.MaxRetries = config.MaxRetries - } - - if config.RetryStrategy != nil { - client.RetryStrategy = config.RetryStrategy - } else { - client.RetryStrategy = DefaultBackoffStrategy(1 * time.Second) - } - - if config.RetryIf != nil { - client.RetryIf = config.RetryIf - } else { - client.RetryIf = DefaultRetryIf - } - - if config.Logger != nil { - client.Logger = config.Logger - } - - return client -} - -// setInitialClientDetails is a helper function that sets the initial configuration for the client and mostly breaks up how large of a function check the Create function is -func setInitialClientDetails(config *Config) (*Config, *http.Client) { - if config == nil { - config = &Config{} - } - - httpClient := &http.Client{} - - if config.Transport != nil { - httpClient.Transport = config.Transport - } - - if config.Timeout != 0 { - httpClient.Timeout = config.Timeout - } - - if config.CookieJar != nil { - httpClient.Jar = config.CookieJar - } - - return config, httpClient -} - -// SetBaseURL sets the base URL for the client -func (c *Client) SetBaseURL(baseURL string) { - c.mu.Lock() - defer c.mu.Unlock() - - c.BaseURL = baseURL -} - -// AddMiddleware adds a middleware to the client -func (c *Client) AddMiddleware(middlewares ...Middleware) { - c.mu.Lock() - defer c.mu.Unlock() - - c.Middlewares = append(c.Middlewares, middlewares...) -} - -// SetTLSConfig sets the TLS configuration for the client -func (c *Client) SetTLSConfig(config *tls.Config) *Client { - c.mu.Lock() - defer c.mu.Unlock() - - c.TLSConfig = config - - if c.HTTPClient == nil { - c.HTTPClient = &http.Client{} - } - - // Apply the TLS configuration to the existing transport if possible - // If the current transport is not an *http.Transport, replace it - if transport, ok := c.HTTPClient.Transport.(*http.Transport); ok { - transport.TLSClientConfig = config - } else { - c.HTTPClient.Transport = &http.Transport{ - TLSClientConfig: config, - } - } - - return c -} - -// InsecureSkipVerify sets the TLS configuration to skip certificate verification -func (c *Client) InsecureSkipVerify() *Client { - c.mu.Lock() - defer c.mu.Unlock() - - if c.TLSConfig == nil { - c.TLSConfig = &tls.Config{ - MinVersion: tls.VersionTLS12, - } - } - - c.TLSConfig.InsecureSkipVerify = true - - if c.HTTPClient == nil { - c.HTTPClient = &http.Client{} - } - - if transport, ok := c.HTTPClient.Transport.(*http.Transport); ok { - transport.TLSClientConfig = c.TLSConfig - } else { - c.HTTPClient.Transport = &http.Transport{ - TLSClientConfig: c.TLSConfig, - } - } - - return c -} - -// SetHTTPClient sets the HTTP client for the client -func (c *Client) SetHTTPClient(httpClient *http.Client) { - c.mu.Lock() - defer c.mu.Unlock() - - c.HTTPClient = httpClient -} - -// SetDefaultHeaders sets the default headers for the client -func (c *Client) SetDefaultHeaders(headers *http.Header) { - c.mu.Lock() - defer c.mu.Unlock() - - c.Headers = headers -} - -// SetDefaultHeader adds or updates a default header -func (c *Client) SetDefaultHeader(key, value string) { - c.mu.Lock() - defer c.mu.Unlock() - - if c.Headers == nil { - c.Headers = &http.Header{} - } - - c.Headers.Set(key, value) -} - -// AddDefaultHeader adds a default header -func (c *Client) AddDefaultHeader(key, value string) { - c.mu.Lock() - defer c.mu.Unlock() - - if c.Headers == nil { - c.Headers = &http.Header{} - } - - c.Headers.Add(key, value) -} - -// DelDefaultHeader removes a default header -func (c *Client) DelDefaultHeader(key string) { - c.mu.Lock() - defer c.mu.Unlock() - - if c.Headers != nil { // only attempt to delete if initialized - c.Headers.Del(key) - } -} - -// SetDefaultContentType sets the default content type for the client -func (c *Client) SetDefaultContentType(contentType string) { - c.SetDefaultHeader(HeaderContentType, contentType) -} - -// SetDefaultAccept sets the default accept header for the client -func (c *Client) SetDefaultAccept(accept string) { - c.SetDefaultHeader(HeaderAccept, accept) -} - -// SetDefaultUserAgent sets the default user agent for the client -func (c *Client) SetDefaultUserAgent(userAgent string) { - c.SetDefaultHeader(HeaderUserAgent, userAgent) -} - -// SetDefaultReferer sets the default referer for the client -func (c *Client) SetDefaultReferer(referer string) { - c.SetDefaultHeader(HeaderReferer, referer) -} - -// SetDefaultTimeout sets the default timeout for the client -func (c *Client) SetDefaultTimeout(timeout time.Duration) { - c.mu.Lock() - defer c.mu.Unlock() - - c.HTTPClient.Timeout = timeout -} - -// SetDefaultTransport sets the default transport for the client -func (c *Client) SetDefaultTransport(transport http.RoundTripper) { - c.mu.Lock() - defer c.mu.Unlock() - - c.HTTPClient.Transport = transport -} - -// SetDefaultCookieJar sets the default cookie jar for the client -func (c *Client) SetCookieJar(jar *cookiejar.Jar) { - c.mu.Lock() - defer c.mu.Unlock() - - c.HTTPClient.Jar = jar -} - -// SetDefaultCookieJar sets the creates a new cookie jar and sets it for the client -func (c *Client) SetDefaultCookieJar() error { - c.mu.Lock() - defer c.mu.Unlock() - - // Create a new cookie jar - jar, err := cookiejar.New(nil) - if err != nil { - return err - } - - c.HTTPClient.Jar = jar - - return nil -} - -// SetDefaultCookies sets the default cookies for the client -func (c *Client) SetDefaultCookies(cookies map[string]string) { - for name, value := range cookies { - c.SetDefaultCookie(name, value) - } -} - -// SetDefaultCookie sets a default cookie for the client -func (c *Client) SetDefaultCookie(name, value string) { - c.mu.Lock() - defer c.mu.Unlock() - - if c.Cookies == nil { - c.Cookies = make([]*http.Cookie, 0) - } - - c.Cookies = append(c.Cookies, &http.Cookie{Name: name, Value: value}) -} - -// DelDefaultCookie removes a default cookie from the client -func (c *Client) DelDefaultCookie(name string) { - c.mu.Lock() - defer c.mu.Unlock() - - if c.Cookies != nil { // Only attempt to delete if Cookies is initialized - for i, cookie := range c.Cookies { - if cookie.Name == name { - c.Cookies = append(c.Cookies[:i], c.Cookies[i+1:]...) - break - } - } - } -} - -// SetJSONMarshal sets the JSON marshal function for the client's JSONEncoder -func (c *Client) SetJSONMarshal(marshalFunc func(v any) ([]byte, error)) { - c.JSONEncoder = &JSONEncoder{ - MarshalFunc: marshalFunc, - } -} - -// SetJSONUnmarshal sets the JSON unmarshal function for the client's JSONDecoder -func (c *Client) SetJSONUnmarshal(unmarshalFunc func(data []byte, v any) error) { - c.JSONDecoder = &JSONDecoder{ - UnmarshalFunc: unmarshalFunc, - } -} - -// SetXMLMarshal sets the XML marshal function for the client's XMLEncoder -func (c *Client) SetXMLMarshal(marshalFunc func(v any) ([]byte, error)) { - c.XMLEncoder = &XMLEncoder{ - MarshalFunc: marshalFunc, - } -} - -// SetXMLUnmarshal sets the XML unmarshal function for the client's XMLDecoder -func (c *Client) SetXMLUnmarshal(unmarshalFunc func(data []byte, v any) error) { - c.XMLDecoder = &XMLDecoder{ - UnmarshalFunc: unmarshalFunc, - } -} - -// SetYAMLMarshal sets the YAML marshal function for the client's YAMLEncoder -func (c *Client) SetYAMLMarshal(marshalFunc func(v any) ([]byte, error)) { - c.YAMLEncoder = &YAMLEncoder{ - MarshalFunc: marshalFunc, - } -} - -// SetYAMLUnmarshal sets the YAML unmarshal function for the client's YAMLDecoder -func (c *Client) SetYAMLUnmarshal(unmarshalFunc func(data []byte, v any) error) { - c.YAMLDecoder = &YAMLDecoder{ - UnmarshalFunc: unmarshalFunc, - } -} - -// SetMaxRetries sets the maximum number of retry attempts -func (c *Client) SetMaxRetries(maxRetries int) *Client { - c.mu.Lock() - defer c.mu.Unlock() - - c.MaxRetries = maxRetries - - return c -} - -// SetRetryStrategy sets the backoff strategy for retries -func (c *Client) SetRetryStrategy(strategy BackoffStrategy) *Client { - c.mu.Lock() - defer c.mu.Unlock() - - c.RetryStrategy = strategy - - return c -} - -// SetRetryIf sets the custom retry condition function -func (c *Client) SetRetryIf(retryIf RetryIfFunc) *Client { - c.mu.Lock() - defer c.mu.Unlock() - - c.RetryIf = retryIf - - return c -} - -// SetAuth configures an authentication method for the client -func (c *Client) SetAuth(auth AuthMethod) { - if auth.Valid() { - c.Auth = auth - } -} - -// SetLogger sets logger instance in client -func (c *Client) SetLogger(logger Logger) *Client { - c.mu.Lock() - defer c.mu.Unlock() - - c.Logger = logger - - return c -} - -// Get initiates a GET request -func (c *Client) Get(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodGet, path) -} - -// Post initiates a POST request -func (c *Client) Post(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodPost, path) -} - -// Delete initiates a DELETE request -func (c *Client) Delete(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodDelete, path) -} - -// Put initiates a PUT request -func (c *Client) Put(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodPut, path) -} - -// Patch initiates a PATCH request -func (c *Client) Patch(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodPatch, path) -} - -// Options initiates an OPTIONS request -func (c *Client) Options(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodOptions, path) -} - -// Head initiates a HEAD request -func (c *Client) Head(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodHead, path) -} - -// Connect initiates a CONNECT request -func (c *Client) Connect(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodConnect, path) -} - -// Trace initiates a TRACE request -func (c *Client) Trace(path string) *RequestBuilder { - return c.NewRequestBuilder(http.MethodTrace, path) -} - -// Custom initiates a custom request -func (c *Client) Custom(path, method string) *RequestBuilder { - return c.NewRequestBuilder(method, path) -} diff --git a/pkg/httpsling/client_test.go b/pkg/httpsling/client_test.go deleted file mode 100644 index a9f7a2f..0000000 --- a/pkg/httpsling/client_test.go +++ /dev/null @@ -1,783 +0,0 @@ -package httpsling - -import ( - "context" - "encoding/base64" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "net" - "net/http" - "net/http/cookiejar" - "net/http/httptest" - "testing" - "time" - - "github.com/bytedance/sonic" - yaml "github.com/goccy/go-yaml" - "github.com/stretchr/testify/assert" -) - -// startTestHTTPServer starts a test HTTP server that responds to various endpoints for testing purposes -func startTestHTTPServer() *httptest.Server { - handler := http.NewServeMux() - handler.HandleFunc("/test-get", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "GET response") - }) - - handler.HandleFunc("/test-post", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "POST response") - }) - - handler.HandleFunc("/test-put", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "PUT response") - }) - - handler.HandleFunc("/test-delete", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "DELETE response") - }) - - handler.HandleFunc("/test-patch", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "PATCH response") - }) - - handler.HandleFunc("/test-status-code", func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusCreated) // 201 - fmt.Fprintln(w, `Created`) - }) - - handler.HandleFunc("/test-headers", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Custom-Header", "TestValue") - fmt.Fprintln(w, `Headers test`) - }) - - handler.HandleFunc("/test-cookies", func(w http.ResponseWriter, r *http.Request) { - http.SetCookie(w, &http.Cookie{Name: "test-cookie", Value: "cookie-value"}) - fmt.Fprintln(w, `Cookies test`) - }) - - handler.HandleFunc("/test-body", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "This is the response body.") - }) - - handler.HandleFunc("/test-empty", func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - }) - - handler.HandleFunc("/test-json", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeJSON) - fmt.Fprintln(w, `{"message": "This is a JSON response", "status": true}`) - }) - - handler.HandleFunc("/test-xml", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeXML) - fmt.Fprintln(w, `This is an XML responsetrue`) - }) - - handler.HandleFunc("/test-text", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeText) - fmt.Fprintln(w, `This is a text response`) - }) - - handler.HandleFunc("/test-pdf", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, "application/pdf") - fmt.Fprintln(w, `This is a PDF response`) - }) - - handler.HandleFunc("/test-redirect", func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "/test-redirected", http.StatusFound) - }) - - handler.HandleFunc("/test-redirected", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "Redirected") - }) - - handler.HandleFunc("/test-failure", func(w http.ResponseWriter, r *http.Request) { - http.Error(w, "Internal Server Error", http.StatusInternalServerError) - }) - - return httptest.NewServer(handler) -} - -// testRoundTripperFunc type is an adapter to allow the use of ordinary functions as http.RoundTrippers -type testRoundTripperFunc func(*http.Request) (*http.Response, error) - -// RoundTrip executes a single HTTP transaction -func (f testRoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) { - return f(req) -} - -// TestSetHTTPClient verifies that SetHTTPClient correctly sets a custom http.Client and uses it for subsequent httpsling, specifically checking for cookie modifications -func TestSetHTTPClient(t *testing.T) { - // Create a mock server that inspects incoming httpsling for a specific cookie - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check for the presence of a specific cookie - cookie, err := r.Cookie("X-Custom-Test-Cookie") - if err != nil || cookie.Value != "true" { - // If the cookie is missing or not as expected, respond with a 400 Bad Request - w.WriteHeader(http.StatusBadRequest) - return - } - // If the cookie is present and correct, respond with a 200 - w.WriteHeader(http.StatusOK) - })) - - defer mockServer.Close() - - // Create a new instance of your Client - client := Create(&Config{ - BaseURL: mockServer.URL, - }) - - // Define a custom transport that adds a custom cookie to all outgoing httpsling - customTransport := testRoundTripperFunc(func(req *http.Request) (*http.Response, error) { - // Add the custom cookie to the request - req.AddCookie(&http.Cookie{Name: "X-Custom-Test-Cookie", Value: "true"}) - // Proceed with the default transport after adding the cookie - return http.DefaultTransport.RoundTrip(req) - }) - - // Set the custom http.Client with the custom transport to your Client - client.SetHTTPClient(&http.Client{ - Transport: customTransport, - }) - - // Send a request using the custom http.Client - resp, err := client.Get("/test").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - defer resp.Close() //nolint: errcheck - - // Verify that the server responded with a 200 OK, indicating the custom cookie was successfully added. - if resp.StatusCode() != http.StatusOK { - t.Errorf("Expected status code 200, got %d. Indicates custom cookie was not recognized by the server.", resp.StatusCode()) - } -} - -func TestClientURL(t *testing.T) { - client := URL("http://localhost:8080") - assert.NotNil(t, client) - assert.Equal(t, "http://localhost:8080", client.BaseURL) -} - -func TestClientGetRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-get").Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, "GET response\n", resp.String()) -} - -func TestClientPostRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Post("/test-post").Body(map[string]interface{}{"key": "value"}).Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, "POST response\n", resp.String()) -} - -func TestClientPutRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Put("/test-put").Body(map[string]interface{}{"key": "value"}).Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, "PUT response\n", resp.String()) -} - -func TestClientDeleteRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Delete("/test-delete").Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, "DELETE response\n", resp.String()) -} - -func TestClientPatchRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Patch("/test-patch").Body(map[string]interface{}{"key": "value"}).Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, "PATCH response\n", resp.String()) -} - -func TestClientOptionsRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Options("/test-get").Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.RawResponse.StatusCode) -} - -func TestClientHeadRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Head("/test-get").Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.RawResponse.StatusCode) -} - -func TestClientTraceRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Trace("/test-get").Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.RawResponse.StatusCode) -} - -func TestClientCustomMethodRequest(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Custom("/test-get", "OPTIONS").Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.RawResponse.StatusCode) -} - -// testSchema represents the JSON structure for testing -type testSchema struct { - Name string `json:"name"` - Age int `json:"age"` -} - -// TestSetJSONMarshal tests custom JSON marshal functionality -func TestSetJSONMarshal(t *testing.T) { - // Start a mock HTTP server. - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Read body from the request - var received testSchema - err := json.NewDecoder(r.Body).Decode(&received) - assert.NoError(t, err) - assert.Equal(t, "John Snow", received.Name) - assert.Equal(t, 30, received.Age) - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - client.SetJSONMarshal(sonic.Marshal) - - data := testSchema{ - Name: "John Snow", - Age: 30, - } - - // Send a request with the custom marshaled body - resp, err := client.Post("/").JSONBody(&data).Send(context.Background()) - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.StatusCode()) -} - -// TestSetJSONUnmarshal tests custom JSON unmarshal functionality -func TestSetJSONUnmarshal(t *testing.T) { - // Mock response data - mockResponse := `{"name":"Jane Doe","age":25}` - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeJSON) - fmt.Fprintln(w, mockResponse) - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Set the custom JSON unmarshal function - client.SetJSONUnmarshal(sonic.Unmarshal) - - // Fetch and unmarshal the response - resp, err := client.Get("/").Send(context.Background()) - assert.NoError(t, err) - - var result testSchema - err = resp.Scan(&result) - assert.NoError(t, err) - assert.Equal(t, "Jane Doe", result.Name) - assert.Equal(t, 25, result.Age) -} - -type xmlTestSchema struct { - XMLName xml.Name `xml:"Test"` - Message string `xml:"Message"` - Status bool `xml:"Status"` -} - -func TestSetXMLMarshal(t *testing.T) { - // Mock server to check the received XML - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - var received xmlTestSchema - err := xml.NewDecoder(r.Body).Decode(&received) - assert.NoError(t, err) - assert.Equal(t, "Test message", received.Message) - assert.True(t, received.Status) - })) - - defer server.Close() - - // Create your client and set the XML marshal function to use Go's default - client := Create(&Config{BaseURL: server.URL}) - client.SetXMLMarshal(xml.Marshal) - - // Data to marshal and send - data := xmlTestSchema{ - Message: "Test message", - Status: true, - } - - // Marshal and send the data - resp, err := client.Post("/").XMLBody(&data).Send(context.Background()) - assert.NoError(t, err) - assert.NotNil(t, resp) -} - -func TestSetXMLUnmarshal(t *testing.T) { - // Mock server to send XML data - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeXML) - fmt.Fprintln(w, `Response messagetrue`) - })) - defer server.Close() - - // Create your client and set the XML unmarshal function to use go's default - client := Create(&Config{BaseURL: server.URL}) - client.SetXMLUnmarshal(xml.Unmarshal) - - // Fetch and attempt to unmarshal the data - resp, err := client.Get("/").Send(context.Background()) - assert.NoError(t, err) - - var result xmlTestSchema - err = resp.Scan(&result) - assert.NoError(t, err) - assert.Equal(t, "Response message", result.Message) - assert.True(t, result.Status) -} - -func TestSetYAMLMarshal(t *testing.T) { - type yamlTestSchema struct { - Message string `yaml:"message"` - Status bool `yaml:"status"` - } - - // Mock server to check the received YAML - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - var received yamlTestSchema - err := yaml.NewDecoder(r.Body).Decode(&received) - assert.NoError(t, err) - assert.Equal(t, "Test message", received.Message) - assert.True(t, received.Status) - })) - - defer server.Close() - - // Create your client and set the YAML marshal function to use goccy/go-yaml's Marshal - client := Create(&Config{BaseURL: server.URL}) - client.SetYAMLMarshal(yaml.Marshal) - - // Data to marshal and send - data := yamlTestSchema{ - Message: "Test message", - Status: true, - } - - // Marshal and send the data - resp, err := client.Post("/").YAMLBody(&data).Send(context.Background()) - assert.NoError(t, err) - assert.NotNil(t, resp) -} - -func TestSetYAMLUnmarshal(t *testing.T) { - // Define a test schema - type yamlTestSchema struct { - Message string `yaml:"message"` - Status bool `yaml:"status"` - } - - // Mock server to send YAML data - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeYAML) - fmt.Fprintln(w, "message: Response message\nstatus: true") - })) - defer server.Close() - - // Create your client and set the YAML unmarshal function to use goccy/go-yaml's Unmarshal - client := Create(&Config{BaseURL: server.URL}) - client.SetYAMLUnmarshal(yaml.Unmarshal) - - // Fetch and attempt to unmarshal the data - resp, err := client.Get("/").Send(context.Background()) - assert.NoError(t, err) - - var result yamlTestSchema - err = resp.Scan(&result) - assert.NoError(t, err) - assert.Equal(t, "Response message", result.Message) - assert.True(t, result.Status) -} - -// TestSetAuth verifies that SetAuth correctly sets the Authorization header for basic authentication -func TestSetAuth(t *testing.T) { - // Expected username and password - expectedUsername := "testuser" - expectedPassword := "testpass" - - // Expected Authorization header value - expectedAuthValue := "Basic " + base64.StdEncoding.EncodeToString([]byte(expectedUsername+":"+expectedPassword)) - - // Create a mock server that checks the Authorization header - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Retrieve the Authorization header from the request. - authHeader := r.Header.Get(HeaderAuthorization) - - // Check if the Authorization header matches the expected value - if authHeader != expectedAuthValue { - // If not, respond with 401 - w.WriteHeader(http.StatusUnauthorized) - return - } - - // If the header is correct, respond with 200 OK - w.WriteHeader(http.StatusOK) - })) - - defer mockServer.Close() - - client := Create(&Config{ - BaseURL: mockServer.URL, - }) - - // Set basic authentication using the SetBasicAuth method - client.SetAuth(BasicAuth{ - Username: expectedUsername, - Password: expectedPassword, - }) - - // Send the request through the client - resp, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - defer resp.Close() //nolint: errcheck - - // Check the response status code - if resp.StatusCode() != http.StatusOK { - t.Errorf("Expected status code 200, got %d. Indicates Authorization header was not set correctly.", resp.StatusCode()) - } -} - -func TestSetDefaultHeaders(t *testing.T) { - // Create a mock server to check headers - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Header.Get("X-Custom-Header") != "HeaderValue" { - t.Error("Default header 'X-Custom-Header' not found or value incorrect") - } - })) - - defer mockServer.Close() - - // Initialize the client and set a default header - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultHeader("X-Custom-Header", "HeaderValue") - - // Make a request to trigger the header check - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } -} - -func TestDelDefaultHeader(t *testing.T) { - // Mock server to check for the absence of a specific header - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Header.Get("X-Deleted-Header") != "" { - t.Error("Deleted default header 'X-Deleted-Header' was found in the request") - } - })) - - defer mockServer.Close() - - // Initialize the client, set, and then delete a default header - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultHeader("X-Deleted-Header", "ShouldBeDeleted") - client.DelDefaultHeader("X-Deleted-Header") - - // Make a request to check for the absence of the deleted header - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } -} - -func TestSetDefaultContentType(t *testing.T) { - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check the Content-Type header - if r.Header.Get(HeaderContentType) != ContentTypeJSON { - t.Error("Default Content-Type header not set correctly") - } - })) - defer mockServer.Close() - - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultContentType(ContentTypeJSON) - - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } -} - -func TestSetDefaultAccept(t *testing.T) { - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check the Accept header - if r.Header.Get(HeaderAccept) != ContentTypeXML { - t.Error("Default Accept header not set correctly") - } - })) - defer mockServer.Close() - - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultAccept(ContentTypeXML) - - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } -} - -func TestSetDefaultUserAgent(t *testing.T) { - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check the User-Agent header - if r.Header.Get(HeaderUserAgent) != "MyCustomAgent/1.0" { - t.Error("Default User-Agent header not set correctly") - } - })) - defer mockServer.Close() - - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultUserAgent("MyCustomAgent/1.0") - - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } -} - -func TestSetDefaultTimeout(t *testing.T) { - // Create a server that delays its response - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - time.Sleep(2 * time.Second) // Delay longer than client's timeout - })) - defer mockServer.Close() - - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultTimeout(1 * time.Second) // Set timeout to 1 second - - _, err := client.Get("/").Send(context.Background()) - if err == nil { - t.Fatal("Expected a timeout error, got nil") - } - - var netErr net.Error - if errors.As(err, &netErr) && netErr.Timeout() { - // Check if the error is a timeout error - } else { - t.Fatalf("Expected a timeout error, got %v", err) - } -} - -func TestSetDefaultCookieJar(t *testing.T) { - jar, _ := cookiejar.New(nil) - - // Initialize the client and set the default cookie jar nom nom nom - client := Create(&Config{}) - client.SetCookieJar(jar) - - // Start a test HTTP server that sets a cookie - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == "/set-cookie" { - http.SetCookie(w, &http.Cookie{Name: "test", Value: "cookie"}) - return - } - - // Check for the cookie on a different endpoint - cookie, err := r.Cookie("test") - if err != nil { - t.Fatal("Cookie 'test' not found in request, cookie jar not working") - } - - if cookie.Value != "cookie" { - t.Fatalf("Expected cookie 'test' to have value 'cookie', got '%s'", cookie.Value) - } - })) - - defer server.Close() - - // First request to set the cookie - _, err := client.Get(server.URL + "/set-cookie").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - // Second request to check if the cookie is sent back - _, err = client.Get(server.URL + "/check-cookie").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send second request: %v", err) - } -} - -func TestSetDefaultCookies(t *testing.T) { - // Create a mock server to check cookies - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check for the presence of specific cookies - sessionCookie, err := r.Cookie("session_id") - if err != nil || sessionCookie.Value != "abcd1234" { - t.Error("Default cookie 'session_id' not found or value incorrect") - } - - authCookie, err := r.Cookie("auth_token") - if err != nil || authCookie.Value != "token1234" { - t.Error("Default cookie 'auth_token' not found or value incorrect") - } - })) - - defer mockServer.Close() - - // Initialize the client and set default cookies - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultCookies(map[string]string{ - "session_id": "abcd1234", - "auth_token": "token1234", - }) - - // Make a request to trigger the cookie check - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } -} - -func TestDelDefaultCookie(t *testing.T) { - // Mock server to check for absence of a specific cookie - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - _, err := r.Cookie("session_id") - if err == nil { - t.Error("Deleted default cookie 'session_id' was found in the request") - } - })) - - defer mockServer.Close() - - // Initialize the client, set, and then delete a default cookie - client := Create(&Config{BaseURL: mockServer.URL}) - client.SetDefaultCookie("session_id", "abcd1234") - client.DelDefaultCookie("session_id") - - // Make a request to check for the absence of the deleted cookie - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } -} - -func createTestRetryServer(t *testing.T) *httptest.Server { - var requestCount int - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - requestCount++ - switch requestCount { - case 1: - w.WriteHeader(http.StatusInternalServerError) // Simulate server error on first attempt - case 2: - w.WriteHeader(http.StatusOK) // Successful on second attempt - default: - t.Fatalf("Unexpected number of httpsling: %d", requestCount) - } - })) - - return server -} - -func TestSetMaxRetriesAndRetryStrategy(t *testing.T) { - server := createTestRetryServer(t) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - retryCalled := false - - client.SetMaxRetries(1).SetRetryStrategy(func(attempt int) time.Duration { - retryCalled = true - return 10 * time.Millisecond // Short delay for testing - }) - - // Make a request to the test server - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - if !retryCalled { - t.Error("Expected retry strategy to be called, but it wasn't") - } -} - -func TestSetRetryIf(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusInternalServerError) // Always return server error - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - client.SetMaxRetries(2).SetRetryIf(func(req *http.Request, resp *http.Response, err error) bool { - return resp.StatusCode == http.StatusInternalServerError - }) - - retryCount := 0 - - client.SetRetryStrategy(func(int) time.Duration { - retryCount++ - return 10 * time.Millisecond // Short delay for testing - }) - - // Make a request to the test server - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - if retryCount != 2 { - t.Errorf("Expected 2 retries, got %d", retryCount) - } -} diff --git a/pkg/httpsling/doc.go b/pkg/httpsling/doc.go deleted file mode 100644 index 52a2b9b..0000000 --- a/pkg/httpsling/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package httpsling is a wrapper for creating and sending http httpsling (e.g. for webhooks, external 3d party integrations) -package httpsling diff --git a/pkg/httpsling/encoders.go b/pkg/httpsling/encoders.go deleted file mode 100644 index 0ecee1b..0000000 --- a/pkg/httpsling/encoders.go +++ /dev/null @@ -1,264 +0,0 @@ -package httpsling - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "io" - - "github.com/goccy/go-yaml" - "github.com/valyala/bytebufferpool" -) - -// Encoder is the interface that wraps the Encode method -type Encoder interface { - // Encode encodes the provided value into a reader - Encode(v any) (io.Reader, error) - // ContentType returns the content type of the encoded data - ContentType() string -} - -// Decoder is the interface that wraps the Decode method -type Decoder interface { - // Decode decodes the data from the reader into the provided value - Decode(r io.Reader, v any) error -} - -// StreamCallback is a callback function that is called when data is received -type StreamCallback func([]byte) error - -// StreamErrCallback is a callback function that is called when an error occurs -type StreamErrCallback func(error) - -// StreamDoneCallback is a callback function that is called when the stream is done -type StreamDoneCallback func() - -// JSONEncoder handles encoding of JSON data -type JSONEncoder struct { - // MarshalFunc is the custom marshal function to use - MarshalFunc func(v any) ([]byte, error) -} - -// JSONDecoder handles decoding of JSON data -type JSONDecoder struct { - UnmarshalFunc func(data []byte, v any) error -} - -// DefaultJSONEncoder instance using the standard json.Marshal function -var DefaultJSONEncoder = &JSONEncoder{ - MarshalFunc: json.Marshal, -} - -// DefaultJSONDecoder instance using the standard json.Unmarshal function -var DefaultJSONDecoder = &JSONDecoder{ - UnmarshalFunc: json.Unmarshal, -} - -var bufferPool bytebufferpool.Pool - -// poolReader wraps bytes.Reader to return the buffer to the pool when closed -type poolReader struct { - // *bytes.Reader is an io.Reader - *bytes.Reader - // poolBuf is a bytebufferpool.ByteBuffer - poolBuf *bytebufferpool.ByteBuffer -} - -// ContentType returns the content type for JSON data -func (e *JSONEncoder) ContentType() string { - return ContentTypeJSONUTF8 -} - -// Encode marshals the provided value into JSON format -func (e *JSONEncoder) Encode(v any) (io.Reader, error) { - var err error - - var data []byte - - if e.MarshalFunc == nil { - data, err = json.Marshal(v) // Fallback to standard JSON marshal if no custom function is provided - } else { - data, err = e.MarshalFunc(v) - } - - if err != nil { - return nil, err - } - - buf := GetBuffer() - - _, err = buf.Write(data) - - if err != nil { - PutBuffer(buf) // Ensure the buffer is returned to the pool in case of an error - return nil, err - } - - // we need to ensure the buffer will be returned to the pool after being read - reader := &poolReader{Reader: bytes.NewReader(buf.B), poolBuf: buf} - - return reader, nil -} - -// Decode reads the data from the reader and unmarshals it into the provided value -func (d *JSONDecoder) Decode(r io.Reader, v any) error { - data, err := io.ReadAll(r) - if err != nil { - return err - } - - if d.UnmarshalFunc != nil { - return d.UnmarshalFunc(data, v) - } - - return json.Unmarshal(data, v) -} - -// GetBuffer retrieves a buffer from the pool -func GetBuffer() *bytebufferpool.ByteBuffer { - return bufferPool.Get() -} - -// PutBuffer returns a buffer to the pool -func PutBuffer(b *bytebufferpool.ByteBuffer) { - bufferPool.Put(b) -} - -func (r *poolReader) Close() error { - PutBuffer(r.poolBuf) - - return nil -} - -// XMLEncoder handles encoding of XML data -type XMLEncoder struct { - MarshalFunc func(v any) ([]byte, error) -} - -// DefaultXMLEncoder instance using the standard xml.Marshal function -var DefaultXMLEncoder = &XMLEncoder{ - MarshalFunc: xml.Marshal, -} - -// XMLDecoder handles decoding of XML data -type XMLDecoder struct { - UnmarshalFunc func(data []byte, v any) error -} - -// DefaultXMLDecoder instance using the standard xml.Unmarshal function -var DefaultXMLDecoder = &XMLDecoder{ - UnmarshalFunc: xml.Unmarshal, -} - -// Encode marshals the provided value into XML format -func (e *XMLEncoder) Encode(v any) (io.Reader, error) { - var err error - - var data []byte - - if e.MarshalFunc != nil { - data, err = e.MarshalFunc(v) - } else { - data, err = xml.Marshal(v) - } - - if err != nil { - return nil, err - } - - buf := GetBuffer() - _, err = buf.Write(data) - - if err != nil { - PutBuffer(buf) - return nil, err - } - - return &poolReader{Reader: bytes.NewReader(buf.B), poolBuf: buf}, nil -} - -// ContentType returns the content type for XML data -func (e *XMLEncoder) ContentType() string { - return ContentTypeXMLUTF8 -} - -// Decode unmarshals the XML data from the reader into the provided value -func (d *XMLDecoder) Decode(r io.Reader, v any) error { - data, err := io.ReadAll(r) - if err != nil { - return err - } - - if d.UnmarshalFunc != nil { - return d.UnmarshalFunc(data, v) - } - - return xml.Unmarshal(data, v) -} - -// YAMLEncoder handles encoding of YAML data -type YAMLEncoder struct { - MarshalFunc func(v any) ([]byte, error) -} - -// DefaultYAMLEncoder instance using the goccy/go-yaml Marshal function -var DefaultYAMLEncoder = &YAMLEncoder{ - MarshalFunc: yaml.Marshal, -} - -// YAMLDecoder handles decoding of YAML data -type YAMLDecoder struct { - UnmarshalFunc func(data []byte, v any) error -} - -// DefaultYAMLDecoder instance using the goccy/go-yaml Unmarshal function -var DefaultYAMLDecoder = &YAMLDecoder{ - UnmarshalFunc: yaml.Unmarshal, -} - -// Encode marshals the provided value into YAML format -func (e *YAMLEncoder) Encode(v any) (io.Reader, error) { - var err error - - var data []byte - - if e.MarshalFunc != nil { - data, err = e.MarshalFunc(v) - } else { - data, err = yaml.Marshal(v) - } - - if err != nil { - return nil, err - } - - buf := GetBuffer() - _, err = buf.Write(data) - - if err != nil { - PutBuffer(buf) - return nil, err - } - - return &poolReader{Reader: bytes.NewReader(buf.B), poolBuf: buf}, nil -} - -// ContentType returns the content type for YAML data -func (e *YAMLEncoder) ContentType() string { - return ContentTypeYAMLUTF8 -} - -// Decode reads the data from the reader and unmarshals it into the provided value -func (d *YAMLDecoder) Decode(r io.Reader, v any) error { - data, err := io.ReadAll(r) - if err != nil { - return err - } - - if d.UnmarshalFunc != nil { - return d.UnmarshalFunc(data, v) - } - - // Fallback to standard YAML unmarshal using goccy/go-yaml - return yaml.Unmarshal(data, v) -} diff --git a/pkg/httpsling/encoders_test.go b/pkg/httpsling/encoders_test.go deleted file mode 100644 index ccd8725..0000000 --- a/pkg/httpsling/encoders_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package httpsling_test - -import ( - "bytes" - "io" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/theopenlane/core/pkg/httpsling" -) - -func TestJSONEncoderEncode(t *testing.T) { - encoder := &httpsling.JSONEncoder{} - - // Test encoding a struct - data := struct { - Name string `json:"name"` - Age int `json:"age"` - }{ - Name: "John Doe", - Age: 30, - } - - reader, err := encoder.Encode(data) - require.NoError(t, err) - - encodedData, err := io.ReadAll(reader) - require.NoError(t, err) - - expectedData := `{"name":"John Doe","age":30}` - require.Equal(t, expectedData, string(encodedData)) -} - -func TestJSONDecoderDecode(t *testing.T) { - decoder := &httpsling.JSONDecoder{} - - // Test decoding JSON data into a struct - jsonData := `{"name":"John Snow","age":30}` - - var data struct { - Name string `json:"name"` - Age int `json:"age"` - } - - err := decoder.Decode(bytes.NewReader([]byte(jsonData)), &data) - require.NoError(t, err) - - expectedData := struct { - Name string `json:"name"` - Age int `json:"age"` - }{ - Name: "John Snow", - Age: 30, - } - require.Equal(t, expectedData, data) -} - -func TestXMLDecoderDecode(t *testing.T) { - decoder := &httpsling.XMLDecoder{} - - // Test decoding XML data into a struct - xmlData := `John Meow30` - - var data struct { - Name string `xml:"name"` - Age int `xml:"age"` - } - - err := decoder.Decode(bytes.NewReader([]byte(xmlData)), &data) - require.NoError(t, err) - - expectedData := struct { - Name string `xml:"name"` - Age int `xml:"age"` - }{ - Name: "John Meow", - Age: 30, - } - require.Equal(t, expectedData, data) -} - -func TestYAMLEncoderEncode(t *testing.T) { - encoder := &httpsling.YAMLEncoder{} - - // Test encoding a struct - data := struct { - Name string `yaml:"name"` - Age int `yaml:"age"` - }{ - Name: "John Flow", - Age: 30, - } - - reader, err := encoder.Encode(data) - require.NoError(t, err) - - encodedData, err := io.ReadAll(reader) - require.NoError(t, err) - - expectedData := "name: John Flow\nage: 30\n" - require.Equal(t, expectedData, string(encodedData)) -} - -func TestYAMLDecoderDecode(t *testing.T) { - decoder := &httpsling.YAMLDecoder{} - - // Test decoding YAML data into a struct - yamlData := "name: John Show\nage: 30\n" - - var data struct { - Name string `yaml:"name"` - Age int `yaml:"age"` - } - - err := decoder.Decode(bytes.NewReader([]byte(yamlData)), &data) - require.NoError(t, err) - - expectedData := struct { - Name string `yaml:"name"` - Age int `yaml:"age"` - }{ - Name: "John Show", - Age: 30, - } - require.Equal(t, expectedData, data) -} diff --git a/pkg/httpsling/errors.go b/pkg/httpsling/errors.go deleted file mode 100644 index d4902e9..0000000 --- a/pkg/httpsling/errors.go +++ /dev/null @@ -1,32 +0,0 @@ -package httpsling - -import ( - "errors" -) - -var ( - // ErrUnsupportedContentType is returned when the content type is unsupported - ErrUnsupportedContentType = errors.New("unsupported content type") - // ErrUnsupportedDataType is returned when the data type is unsupported - ErrUnsupportedDataType = errors.New("unsupported data type") - // ErrEncodingFailed is returned when the encoding fails - ErrEncodingFailed = errors.New("encoding failed") - // ErrRequestCreationFailed is returned when the request cannot be created - ErrRequestCreationFailed = errors.New("failed to create request") - // ErrResponseReadFailed is returned when the response cannot be read - ErrResponseReadFailed = errors.New("failed to read response") - // ErrUnsupportedScheme is returned when the proxy scheme is unsupported - ErrUnsupportedScheme = errors.New("unsupported proxy scheme") - // ErrUnsupportedFormFieldsType is returned when the form fields type is unsupported - ErrUnsupportedFormFieldsType = errors.New("unsupported form fields type") - // ErrNotSupportSaveMethod is returned when the provided type for saving is not supported - ErrNotSupportSaveMethod = errors.New("the provided type for saving is not supported") - // ErrInvalidTransportType is returned when the transport type is invalid - ErrInvalidTransportType = errors.New("invalid transport type") - // ErrResponseNil is returned when the response is nil - ErrResponseNil = errors.New("response is nil") - // ErrFailedToCloseResponseBody is returned when the response body cannot be closed - ErrFailedToCloseResponseBody = errors.New("failed to close response body") - // ErrMapper - ErrMapper = "%w: %v" -) diff --git a/pkg/httpsling/examples/main.go b/pkg/httpsling/examples/main.go deleted file mode 100644 index 20e4cdd..0000000 --- a/pkg/httpsling/examples/main.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "context" - "log" - "time" - - "github.com/theopenlane/core/pkg/httpsling" -) - -// Post represents a simple structure to map JSON Placeholder posts -type Post struct { - UserID int `json:"userId"` - ID int `json:"id"` - Title string `json:"title"` - Body string `json:"body"` -} - -func main() { - // Initialize the client with a base URL and a default timeout - client := httpsling.Create(&httpsling.Config{ - BaseURL: "https://jsonplaceholder.typicode.com", - Timeout: 30 * time.Second, - }) - - // Perform a GET request to the /posts endpoint - resp, err := client.Get("/posts/{post_id}").PathParam("post_id", "1").Send(context.Background()) - if err != nil { - log.Fatalf("Failed to make request: %v", err) - } - - // Decode the JSON response into our Post struct - var post Post - if err := resp.ScanJSON(&post); err != nil { - log.Fatalf("Failed to parse response: %v", err) - } - - // Output the result - log.Printf("Post Received: %+v\n", post) -} diff --git a/pkg/httpsling/form.go b/pkg/httpsling/form.go deleted file mode 100644 index 4ecb41d..0000000 --- a/pkg/httpsling/form.go +++ /dev/null @@ -1,147 +0,0 @@ -package httpsling - -import ( - "fmt" - "io" - "net/url" - "strings" - - "github.com/google/go-querystring/query" -) - -// File represents a form file -type File struct { - // Name is the form field name - Name string - // FileName is the file name - FileName string - // Content is the file content - Content io.ReadCloser - // FileMime is the file mime type - FileMime string -} - -// FormEncoder handles encoding of form data -type FormEncoder struct{} - -// DefaultFormEncoder instance -var DefaultFormEncoder = &FormEncoder{} - -// SetContent sets the content of the file -func (f *File) SetContent(content io.ReadCloser) { - f.Content = content -} - -// SetFileName sets the file name -func (f *File) SetFileName(fileName string) { - f.FileName = fileName -} - -// SetName sets the form field name -func (f *File) SetName(name string) { - f.Name = name -} - -// parseFormFields parses the given form fields into url.Values -func parseFormFields(fields any) (url.Values, error) { - switch data := fields.(type) { - case url.Values: - return data, nil - case map[string][]string: - return url.Values(data), nil - case map[string]string: - values := make(url.Values) - - for key, value := range data { - values.Set(key, value) - } - - return values, nil - default: - if values, err := query.Values(fields); err == nil { - return values, nil - } else { - return nil, fmt.Errorf("%w: %v", ErrUnsupportedFormFieldsType, err) - } - } -} - -// parseForm parses the given form data into url.Values and []*File -func parseForm(v any) (url.Values, []*File, error) { - switch data := v.(type) { - case url.Values: - // Directly return url.Values data - return data, nil, nil - case map[string][]string: - // Convert and return map[string][]string data as url.Values - return url.Values(data), nil, nil - case map[string]string: - // Convert and return map[string]string data as url.Values - values := make(url.Values) - for key, value := range data { - values.Set(key, value) - } - - return values, nil, nil - case map[string]any: - // Convert and return map[string]any data as url.Values and []*File - values := make(url.Values) - - files := make([]*File, 0) - - for key, value := range data { - switch v := value.(type) { - case string: - values.Set(key, v) - case []string: - for _, v := range v { - values.Add(key, v) - } - case *File: - v.SetName(key) - files = append(files, v) - default: - return nil, nil, fmt.Errorf("%w: %T", ErrUnsupportedDataType, value) - } - } - - return values, files, nil - default: - // Attempt to use query.Values for encoding struct types - if values, err := query.Values(v); err == nil { - return values, nil, nil - } else { - return nil, nil, fmt.Errorf("%w: %v", ErrUnsupportedFormFieldsType, err) - } - } -} - -// Encode encodes the given value into URL-encoded form data -func (e *FormEncoder) Encode(v any) (io.Reader, error) { - switch data := v.(type) { - case url.Values: - // Directly encode url.Values data. - return strings.NewReader(data.Encode()), nil - case map[string][]string: - // Convert and encode map[string][]string data as url.Values - values := url.Values(data) - return strings.NewReader(values.Encode()), nil - case map[string]string: - // Convert and encode map[string]string data as url.Values - values := make(url.Values) - - for key, value := range data { - values.Set(key, value) - } - - return strings.NewReader(values.Encode()), nil - default: - // Attempt to use query.Values for encoding struct types - if values, err := query.Values(v); err == nil { - return strings.NewReader(values.Encode()), nil - } else { - // Return an error if encoding fails or type is unsupported - return nil, fmt.Errorf("%w: %v", ErrEncodingFailed, err) - } - } -} diff --git a/pkg/httpsling/form_test.go b/pkg/httpsling/form_test.go deleted file mode 100644 index 3710703..0000000 --- a/pkg/httpsling/form_test.go +++ /dev/null @@ -1,152 +0,0 @@ -package httpsling - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "net/http/httptest" - "strings" - "testing" - - "github.com/stretchr/testify/assert" -) - -// startFileUploadServer starts a mock server to test file uploads -func startFileUploadServer() *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - err := r.ParseMultipartForm(10 << 20) // Limit: 10MB - if err != nil { - http.Error(w, "Failed to parse multipart form", http.StatusBadRequest) - - return - } - - // Collect file upload details - uploads := make(map[string][]string) - - for key, files := range r.MultipartForm.File { - for _, fileHeader := range files { - file, err := fileHeader.Open() - if err != nil { - http.Error(w, "Failed to open file", http.StatusInternalServerError) - return - } - - defer file.Close() //nolint: errcheck - - // Read file content (for demonstration; in real tests, might hash or skip) - content, err := io.ReadAll(file) - if err != nil { - http.Error(w, "Failed to read file content", http.StatusInternalServerError) - - return - } - - // Store file details (e.g., filename and a snippet of content for verification) - contentSnippet := string(content) - if len(contentSnippet) > 10 { - contentSnippet = contentSnippet[:10] + "..." - } - - uploads[key] = append(uploads[key], fmt.Sprintf("%s: %s", fileHeader.Filename, contentSnippet)) - } - } - - // Respond with details of the uploaded files in JSON format - w.Header().Set(HeaderContentType, ContentTypeJSON) - - if encoder := json.NewEncoder(w); encoder != nil { - if err = encoder.Encode(uploads); err != nil { - http.Error(w, "Failed to encode response", http.StatusInternalServerError) - } - } else { - http.Error(w, "Failed to create JSON encoder", http.StatusInternalServerError) - } - })) -} - -func TestFiles(t *testing.T) { - server := startFileUploadServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - fileContent1 := strings.NewReader("File content 1") - fileContent2 := strings.NewReader("File content 2") - - resp, err := client.Post("/"). - Files( - &File{Name: "file1", FileName: "test1.txt", Content: io.NopCloser(fileContent1)}, - &File{Name: "file2", FileName: "test2.txt", Content: io.NopCloser(fileContent2)}, - ). - Send(context.Background()) - - assert.NoError(t, err, "No error expected on sending request") - - var uploads map[string][]string - err = resp.ScanJSON(&uploads) - assert.NoError(t, err, "Expect no error on parsing response") - - // Validate the file uploads - assert.Contains(t, uploads, "file1", "file1 should be present in the uploads") - assert.Contains(t, uploads, "file2", "file2 should be present in the uploads") -} -func TestFile(t *testing.T) { - server := startFileUploadServer() // Start the mock file upload server - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Simulate a file's content - fileContent := strings.NewReader("This is the file content") - - // Send a request with a single file - resp, err := client.Post("/"). - File("file", "single.txt", io.NopCloser(fileContent)). - Send(context.Background()) - assert.NoError(t, err, "No error expected on sending request") - - // Parse the server's JSON response - var uploads map[string][]string - err = resp.ScanJSON(&uploads) - assert.NoError(t, err, "Expect no error on parsing response") - - // Check if the server received the file correctly - assert.Contains(t, uploads, "file", "The file should be present in the uploads") - assert.Contains(t, uploads["file"][0], "single.txt", "The file name should be correctly received") -} - -func TestDelFile(t *testing.T) { - server := startFileUploadServer() // Start the mock file upload server - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Simulate file contents - fileContent1 := strings.NewReader("File content 1") - fileContent2 := strings.NewReader("File content 2") - - // Prepare the request with two files, then delete one before sending - resp, err := client.Post("/"). - Files( - &File{Name: "file1", FileName: "file1.txt", Content: io.NopCloser(fileContent1)}, - &File{Name: "file2", FileName: "file2.txt", Content: io.NopCloser(fileContent2)}, - ). - DelFile("file1"). // Remove the first file - Send(context.Background()) - assert.NoError(t, err, "No error expected on sending request") - - // Parse the server's JSON response - var uploads map[string][]string - - err = resp.ScanJSON(&uploads) - - assert.NoError(t, err, "Expect no error on parsing response") - - // Validate that only the second file was uploaded - assert.NotContains(t, uploads, "file1", "file1 should have been removed from the uploads") - assert.Contains(t, uploads, "file2", "file2 should be present in the uploads") -} diff --git a/pkg/httpsling/headers.go b/pkg/httpsling/headers.go deleted file mode 100644 index ab138df..0000000 --- a/pkg/httpsling/headers.go +++ /dev/null @@ -1,176 +0,0 @@ -package httpsling - -const ( - // Authentication - HeaderAuthorization = "Authorization" - HeaderProxyAuthenticate = "Proxy-Authenticate" - HeaderProxyAuthorization = "Proxy-Authorization" - HeaderWWWAuthenticate = "WWW-Authenticate" - - // Caching - HeaderAge = "Age" - HeaderCacheControl = "Cache-Control" - HeaderClearSiteData = "Clear-Site-Data" - HeaderExpires = "Expires" - HeaderPragma = "Pragma" - HeaderWarning = "Warning" - - // Client hints - HeaderAcceptCH = "Accept-CH" - HeaderAcceptCHLifetime = "Accept-CH-Lifetime" - HeaderContentDPR = "Content-DPR" - HeaderDPR = "DPR" - HeaderEarlyData = "Early-Data" - HeaderSaveData = "Save-Data" - HeaderViewportWidth = "Viewport-Width" - HeaderWidth = "Width" - - // Conditionals - HeaderETag = "ETag" - HeaderIfMatch = "If-Match" - HeaderIfModifiedSince = "If-Modified-Since" - HeaderIfNoneMatch = "If-None-Match" - HeaderIfUnmodifiedSince = "If-Unmodified-Since" - HeaderLastModified = "Last-Modified" - HeaderVary = "Vary" - - // Connection management - HeaderConnection = "Connection" - HeaderKeepAlive = "Keep-Alive" - HeaderProxyConnection = "Proxy-Connection" - - // Content negotiation - HeaderAccept = "Accept" - HeaderAcceptCharset = "Accept-Charset" - HeaderAcceptEncoding = "Accept-Encoding" - HeaderAcceptLanguage = "Accept-Language" - - // Controls - HeaderCookie = "Cookie" - HeaderExpect = "Expect" - HeaderMaxForwards = "Max-Forwards" - HeaderSetCookie = "Set-Cookie" - - // CORS - HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials" - HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers" - HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods" - HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin" - HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers" - HeaderAccessControlMaxAge = "Access-Control-Max-Age" - HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers" - HeaderAccessControlRequestMethod = "Access-Control-Request-Method" - HeaderOrigin = "Origin" - HeaderTimingAllowOrigin = "Timing-Allow-Origin" - HeaderXPermittedCrossDomainPolicies = "X-Permitted-Cross-Domain-Policies" - - // Do Not Track - HeaderDNT = "DNT" - HeaderTk = "Tk" - - // Downloads - HeaderContentDisposition = "Content-Disposition" - - // Message body information - HeaderContentEncoding = "Content-Encoding" - HeaderContentLanguage = "Content-Language" - HeaderContentLength = "Content-Length" - HeaderContentLocation = "Content-Location" - HeaderContentType = "Content-Type" - - // Content Types - ContentTypeForm = "application/x-www-form-urlencoded" // https://datatracker.ietf.org/doc/html/rfc1866 - ContentTypeMultipart = "multipart/form-data" // https://datatracker.ietf.org/doc/html/rfc2388 - ContentTypeJSON = "application/json" // https://datatracker.ietf.org/doc/html/rfc4627 - ContentTypeJSONUTF8 = "application/json;charset=utf-8" // https://datatracker.ietf.org/doc/html/rfc4627 - ContentTypeXML = "application/xml" // https://datatracker.ietf.org/doc/html/rfc3023 - ContentTypeXMLUTF8 = "application/xml;charset=utf-8" - ContentTypeYAML = "application/yaml" // https://www.rfc-editor.org/rfc/rfc9512.html - ContentTypeYAMLUTF8 = "application/yaml;charset=utf-8" - ContentTypeText = "text/plain" - ContentTypeApplicationOctetStream = "application/octet-stream" - - // Proxies - HeaderForwarded = "Forwarded" - HeaderVia = "Via" - HeaderXForwardedFor = "X-Forwarded-For" - HeaderXForwardedHost = "X-Forwarded-Host" - HeaderXForwardedProto = "X-Forwarded-Proto" - - // Redirects - HeaderLocation = "Location" - - // Request context - HeaderFrom = "From" - HeaderHost = "Host" - HeaderReferer = "Referer" - HeaderReferrerPolicy = "Referrer-Policy" - HeaderUserAgent = "User-Agent" - - // Response context - HeaderAllow = "Allow" - HeaderServer = "Server" - - // Range requests. - HeaderAcceptRanges = "Accept-Ranges" - HeaderContentRange = "Content-Range" - HeaderIfRange = "If-Range" - HeaderRange = "Range" - - // Security - HeaderContentSecurityPolicy = "Content-Security-Policy" - HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only" - HeaderCrossOriginResourcePolicy = "Cross-Origin-Resource-Policy" - HeaderExpectCT = "Expect-CT" - HeaderFeaturePolicy = "Feature-Policy" - HeaderPublicKeyPins = "Public-Key-Pins" - HeaderPublicKeyPinsReportOnly = "Public-Key-Pins-Report-Only" - HeaderStrictTransportSecurity = "Strict-Transport-Security" - HeaderUpgradeInsecureRequests = "Upgrade-Insecure-Requests" - HeaderXContentTypeOptions = "X-Content-Type-Options" - HeaderXDownloadOptions = "X-Download-Options" - HeaderXFrameOptions = "X-Frame-Options" - HeaderXPoweredBy = "X-Powered-By" - HeaderXXSSProtection = "X-XSS-Protection" - - // Server-sent event - HeaderLastEventID = "Last-Event-ID" - HeaderNEL = "NEL" - HeaderPingFrom = "Ping-From" - HeaderPingTo = "Ping-To" - HeaderReportTo = "Report-To" - - // Transfer coding - HeaderTE = "TE" - HeaderTrailer = "Trailer" - HeaderTransferEncoding = "Transfer-Encoding" - - // WebSockets - HeaderSecWebSocketAccept = "Sec-WebSocket-Accept" - HeaderSecWebSocketExtensions = "Sec-WebSocket-Extensions" /* #nosec G101 */ - HeaderSecWebSocketKey = "Sec-WebSocket-Key" - HeaderSecWebSocketProtocol = "Sec-WebSocket-Protocol" - HeaderSecWebSocketVersion = "Sec-WebSocket-Version" - - // Other - HeaderAcceptPatch = "Accept-Patch" - HeaderAcceptPushPolicy = "Accept-Push-Policy" - HeaderAcceptSignature = "Accept-Signature" - HeaderAltSvc = "Alt-Svc" - HeaderDate = "Date" - HeaderIndex = "Index" - HeaderLargeAllocation = "Large-Allocation" - HeaderLink = "Link" - HeaderPushPolicy = "Push-Policy" - HeaderRetryAfter = "Retry-After" - HeaderServerTiming = "Server-Timing" - HeaderSignature = "Signature" - HeaderSignedHeaders = "Signed-Headers" - HeaderSourceMap = "SourceMap" - HeaderUpgrade = "Upgrade" - HeaderXDNSPrefetchControl = "X-DNS-Prefetch-Control" - HeaderXPingback = "X-Pingback" - HeaderXRequestedWith = "X-Requested-With" - HeaderXRobotsTag = "X-Robots-Tag" - HeaderXUACompatible = "X-UA-Compatible" -) diff --git a/pkg/httpsling/logger.go b/pkg/httpsling/logger.go deleted file mode 100644 index 9e4dfc3..0000000 --- a/pkg/httpsling/logger.go +++ /dev/null @@ -1,86 +0,0 @@ -package httpsling - -import ( - "fmt" - "io" - - "golang.org/x/exp/slog" -) - -// Level is a type that represents the log level -type Level int - -// The levels of logs -const ( - LevelDebug Level = iota - LevelInfo - LevelWarn - LevelError -) - -// Logger is a logger interface that output logs with a format -type Logger interface { - Debugf(format string, v ...any) - Infof(format string, v ...any) - Warnf(format string, v ...any) - Errorf(format string, v ...any) - SetLevel(level Level) -} - -// DefaultLogger is a default logger that uses `slog` as the underlying logger -type DefaultLogger struct { - logger *slog.Logger - level *slog.LevelVar -} - -// Debugf logs a message at the Debug level -func (l *DefaultLogger) Debugf(format string, v ...any) { - l.logger.Debug(fmt.Sprintf(format, v...)) -} - -// Infof logs a message at the Info level -func (l *DefaultLogger) Infof(format string, v ...any) { - l.logger.Info(fmt.Sprintf(format, v...)) -} - -// Warnf logs a message at the Warn level -func (l *DefaultLogger) Warnf(format string, v ...any) { - l.logger.Warn(fmt.Sprintf(format, v...)) -} - -// Errorf logs a message at the Error level -func (l *DefaultLogger) Errorf(format string, v ...any) { - l.logger.Error(fmt.Sprintf(format, v...)) -} - -// SetLevel sets the log level of the logger -func (l *DefaultLogger) SetLevel(level Level) { - switch level { - case LevelDebug: - l.level.Set(slog.LevelDebug) - case LevelInfo: - l.level.Set(slog.LevelInfo) - case LevelWarn: - l.level.Set(slog.LevelWarn) - case LevelError: - l.level.Set(slog.LevelError) - } -} - -// NewDefaultLogger creates a new `DefaultLogger` with the given output and log level -func NewDefaultLogger(output io.Writer, level Level) Logger { - levelVar := &slog.LevelVar{} - - textHandler := slog.NewTextHandler(output, &slog.HandlerOptions{ - Level: levelVar, - }) - - logger := &DefaultLogger{ - logger: slog.New(textHandler), - level: levelVar, - } - - logger.SetLevel(level) - - return logger -} diff --git a/pkg/httpsling/logger_test.go b/pkg/httpsling/logger_test.go deleted file mode 100644 index 5c8e66b..0000000 --- a/pkg/httpsling/logger_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package httpsling - -import ( - "context" - "fmt" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -type mockLoggerRecorder struct { - Records []string -} - -// Write writes the given bytes to the recorder -func (m *mockLoggerRecorder) Write(p []byte) (n int, err error) { - m.Records = append(m.Records, string(p)) - - return len(p), nil -} - -func TestDefaultLoggerLevels(t *testing.T) { - rec := &mockLoggerRecorder{} - logger := NewDefaultLogger(rec, LevelDebug) - - logger.Debugf("debug %s", "message") - logger.Infof("info %s", "message") - logger.Warnf("warn %s", "message") - logger.Errorf("error %s", "message") - - assert.Len(t, rec.Records, 4, "Should log 4 messages") - assert.Contains(t, rec.Records[0], "debug message", "Debug log message should match") - assert.Contains(t, rec.Records[1], "info message", "Info log message should match") - assert.Contains(t, rec.Records[2], "warn message", "Warn log message should match") - assert.Contains(t, rec.Records[3], "error message", "Error log message should match") -} - -type mockLogger struct { - Infos []string - Errors []string -} - -func (m *mockLogger) Debugf(format string, v ...any) { - m.Infos = append(m.Infos, fmt.Sprintf(format, v...)) -} -func (m *mockLogger) Infof(format string, v ...any) { - m.Infos = append(m.Infos, fmt.Sprintf(format, v...)) -} -func (m *mockLogger) Warnf(format string, v ...any) { - m.Infos = append(m.Infos, fmt.Sprintf(format, v...)) -} -func (m *mockLogger) Errorf(format string, v ...any) { - m.Errors = append(m.Errors, fmt.Sprintf(format, v...)) -} - -func (m *mockLogger) SetLevel(level Level) {} -func TestRetryLogMessage(t *testing.T) { - // Initialize attempt counter - var attempts int - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - attempts++ - if attempts == 1 { - // Fail initially to trigger a retry - w.WriteHeader(http.StatusServiceUnavailable) - } else { - // Succeed in the next attempt - w.WriteHeader(http.StatusOK) - } - })) - - defer server.Close() - - mockLogger := &mockLogger{} - client := Create(&Config{ - BaseURL: server.URL, - Logger: mockLogger, - }).SetMaxRetries(1).SetRetryStrategy(func(attempt int) time.Duration { - return 0 // No delay for testing - }) - - // Making a request that should trigger a retry - _, err := client.Get("/test").Send(context.Background()) - assert.Nil(t, err, "Did not expect an error after retry") - - // Check if the retry log message was recorded - expectedLogMessage := "Retrying request (attempt 1) after backoff" - found := false - - for _, logMsg := range mockLogger.Infos { - if strings.Contains(logMsg, expectedLogMessage) { - found = true - break - } - } - - assert.True(t, found, "Expected retry log message was not recorded") -} diff --git a/pkg/httpsling/middleware.go b/pkg/httpsling/middleware.go deleted file mode 100644 index 6dd5323..0000000 --- a/pkg/httpsling/middleware.go +++ /dev/null @@ -1,9 +0,0 @@ -package httpsling - -import "net/http" - -// MiddlewareHandlerFunc defines a function that takes an http.Request and returns an http.Response -type MiddlewareHandlerFunc func(req *http.Request) (*http.Response, error) - -// Middleware takes MiddlewareHandlerFunc and wraps around a next function call, which can be another middleware or the final transport layer call -type Middleware func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc diff --git a/pkg/httpsling/middleware_test.go b/pkg/httpsling/middleware_test.go deleted file mode 100644 index d3f8339..0000000 --- a/pkg/httpsling/middleware_test.go +++ /dev/null @@ -1,224 +0,0 @@ -package httpsling - -import ( - "bytes" - "context" - "net/http" - "net/http/httptest" - "testing" -) - -// TestMiddleware ensures that the Middleware correctly applies middleware to outgoing httpsling -func TestMiddleware(t *testing.T) { - // Set up a mock server to inspect incoming httpsling - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check for the custom header added by our middleware - if r.Header.Get("X-Custom-Header") != "true" { - t.Errorf("Expected custom header 'X-Custom-Header' to be 'true', got '%s'", r.Header.Get("X-Custom-Header")) - w.WriteHeader(http.StatusBadRequest) // Indicate a bad request if header is missing - - return - } - - w.WriteHeader(http.StatusOK) // All good if the header is present - })) - - defer mockServer.Close() - - // Define the middleware that adds a custom header - customHeaderMiddleware := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - // Add the custom header - req.Header.Set("X-Custom-Header", "true") - // Proceed with the next middleware or the actual request - return next(req) - } - } - - // Initialize the client with our custom middleware - client := Create(&Config{ - BaseURL: mockServer.URL, // Use our mock server as the base URL - Transport: http.DefaultTransport, // Use the default transport - Middlewares: []Middleware{customHeaderMiddleware}, // Apply our custom header middleware - }) - - // Create an HTTP request object - resp, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - defer resp.Close() //nolint: errcheck - - // Check if the server responded with a 200 OK, indicating the middleware applied the header successfully - if resp.StatusCode() != http.StatusOK { - t.Errorf("Expected status code 200, got %d", resp.StatusCode()) - } -} - -func TestNestedMiddleware(t *testing.T) { - var buf bytes.Buffer - - mid0 := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - buf.WriteString("0>>") - - resp, err := next(req) - - buf.WriteString(">>0") - - return resp, err - } - } - - mid1 := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - buf.WriteString("1>>") - - resp, err := next(req) - - buf.WriteString(">>1") - - return resp, err - } - } - - mid2 := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - buf.WriteString("2>>") - - resp, err := next(req) - - buf.WriteString(">>2") - - return resp, err - } - } - - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - buf.WriteString("(served)") - w.WriteHeader(http.StatusOK) - })) - - defer mockServer.Close() - - client := Create(&Config{ - BaseURL: mockServer.URL, - Middlewares: []Middleware{mid0, mid1, mid2}, - }) - - // Create an HTTP request object - resp, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - defer resp.Close() //nolint: errcheck - - expected := "0>>1>>2>>(served)>>2>>1>>0" - if buf.String() != expected { - t.Errorf("Expected sequence %s, got %s", expected, buf.String()) - } -} - -// TestDynamicMiddlewareAddition tests the dynamic addition of middleware to the client -func TestDynamicMiddlewareAddition(t *testing.T) { - // Buffer to track middleware execution order - var executionOrder bytes.Buffer - - // Define middleware functions - loggingMiddleware := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - executionOrder.WriteString("Logging>") - return next(req) - } - } - - authenticationMiddleware := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - executionOrder.WriteString("Auth>") - return next(req) - } - } - - // Set up a mock server - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - executionOrder.WriteString("Handler") - w.WriteHeader(http.StatusOK) - })) - - defer mockServer.Close() - - // Create a new client - client := Create(&Config{ - BaseURL: mockServer.URL, - }) - - // Dynamically add middleware - client.AddMiddleware(loggingMiddleware) - client.AddMiddleware(authenticationMiddleware) - - // Make a request to the mock server - _, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - // Check the order of middleware execution - expectedOrder := "Logging>Auth>Handler" - if executionOrder.String() != expectedOrder { - t.Errorf("Middleware executed in incorrect order. Expected %s, got %s", expectedOrder, executionOrder.String()) - } -} - -// TestRequestMiddlewareAddition tests the addition of middleware at the request level, -// and ensures that both client and request level middlewares are executed in the correct order -func TestRequestMiddlewareAddition(t *testing.T) { - // Buffer to track middleware execution order - var executionOrder bytes.Buffer - - // Define client-level middleware - clientLoggingMiddleware := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - executionOrder.WriteString("ClientLogging>") - return next(req) - } - } - - // Define request-level middleware - requestAuthMiddleware := func(next MiddlewareHandlerFunc) MiddlewareHandlerFunc { - return func(req *http.Request) (*http.Response, error) { - executionOrder.WriteString("RequestAuth>") - return next(req) - } - } - - // Set up a mock server - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - executionOrder.WriteString("Handler") - w.WriteHeader(http.StatusOK) - })) - - defer mockServer.Close() - - // Create a new client with client-level middleware - client := Create(&Config{ - BaseURL: mockServer.URL, - Middlewares: []Middleware{clientLoggingMiddleware}, // Apply client-level middleware - }) - - // Create a request and dynamically add request-level middleware - reqBuilder := client.Get("/") - reqBuilder.AddMiddleware(requestAuthMiddleware) // Apply request-level middleware - - // Make a request to the mock server - _, err := reqBuilder.Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - // Check the order of middleware execution - expectedOrder := "ClientLogging>RequestAuth>Handler" - if executionOrder.String() != expectedOrder { - t.Errorf("Middleware executed in incorrect order. Expected %s, got %s", expectedOrder, executionOrder.String()) - } -} diff --git a/pkg/httpsling/proxy.go b/pkg/httpsling/proxy.go deleted file mode 100644 index fbce0bd..0000000 --- a/pkg/httpsling/proxy.go +++ /dev/null @@ -1,69 +0,0 @@ -package httpsling - -import ( - "net/http" - "net/url" - - "github.com/theopenlane/utils/rout" -) - -// verifyProxy validates the given proxy URL, supporting http, https, and socks5 schemes -func verifyProxy(proxyURL string) (*url.URL, error) { - parsedURL, err := url.Parse(proxyURL) - if err != nil { - return nil, err - } - - // Check if the scheme is supported - switch parsedURL.Scheme { - case "http", "https", "socks5": - return parsedURL, nil - default: - return nil, ErrUnsupportedScheme - } -} - -// SetProxy configures the client to use a proxy. Supports http, https, and socks5 proxies -func (c *Client) SetProxy(proxyURL string) error { - c.mu.Lock() - defer c.mu.Unlock() - - // Validate and parse the proxy URL - validatedProxyURL, err := verifyProxy(proxyURL) - if err != nil { - return err - } - - // Ensure the HTTPClient's Transport is properly initialized - if c.HTTPClient.Transport == nil { - c.HTTPClient.Transport = &http.Transport{} - } - - // Assert the Transport to *http.Transport to access the Proxy field - transport, ok := c.HTTPClient.Transport.(*http.Transport) - if !ok { - return rout.HTTPErrorResponse(err) - } - - transport.Proxy = http.ProxyURL(validatedProxyURL) - - return nil -} - -// RemoveProxy clears any configured proxy, allowing direct connections -func (c *Client) RemoveProxy() { - c.mu.Lock() - defer c.mu.Unlock() - - if c.HTTPClient.Transport == nil { - return - } - - transport, ok := c.HTTPClient.Transport.(*http.Transport) - - if !ok { - return // If it's not *http.Transport, it doesn't have a proxy to remove - } - - transport.Proxy = nil -} diff --git a/pkg/httpsling/proxy_test.go b/pkg/httpsling/proxy_test.go deleted file mode 100644 index e35f344..0000000 --- a/pkg/httpsling/proxy_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package httpsling - -import ( - "context" - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" -) - -// createTestServerForProxy creates a simple HTTP server for testing purposes -func createTestServerForProxy() *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - })) -} - -// TestSetProxyValidProxy tests setting a valid proxy and making a request through it -func TestSetProxyValidProxy(t *testing.T) { - server := createTestServerForProxy() - - defer server.Close() - - proxyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Indicate the request passed through the proxy - w.Header().Set("X-Test-Proxy", "true") - w.WriteHeader(http.StatusOK) - })) - - defer proxyServer.Close() - - client := URL(server.URL) - - err := client.SetProxy(proxyServer.URL) - assert.Nil(t, err, "Setting a valid proxy should not result in an error") - - resp, err := client.Get("/").Send(context.Background()) - assert.Nil(t, err, "Request through a valid proxy should succeed") - assert.NotNil(t, resp, "Response should not be nil") - assert.Equal(t, "true", resp.Header().Get("X-Test-Proxy"), "Request should have passed through the proxy") -} - -// TestSetProxyInvalidProxy tests handling of invalid proxy URLs -func TestSetProxyInvalidProxy(t *testing.T) { - server := createTestServerForProxy() - - defer server.Close() - - client := URL(server.URL) - - invalidProxyURL := "://invalid_url" - err := client.SetProxy(invalidProxyURL) - assert.NotNil(t, err, "Setting an invalid proxy URL should result in an error") -} - -// TestSetProxyRemoveProxy tests removing proxy settings -func TestSetProxyRemoveProxy(t *testing.T) { - server := createTestServerForProxy() - - defer server.Close() - - proxyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Proxy server response - w.WriteHeader(http.StatusOK) - })) - - defer proxyServer.Close() - - client := URL(server.URL) - - // Set then remove the proxy - err := client.SetProxy(proxyServer.URL) - assert.Nil(t, err, "Setting a proxy should not result in an error") - - client.RemoveProxy() - - // Make a request and check it doesn't go through the proxy - resp, err := client.Get("/").Send(context.Background()) - assert.Nil(t, err, "Request after removing proxy should succeed") - assert.NotNil(t, resp, "Response should not be ni.") - assert.NotEqual(t, "true", resp.Header().Get("X-Test-Proxy"), "Request should not have passed through the proxy") -} diff --git a/pkg/httpsling/request.go b/pkg/httpsling/request.go deleted file mode 100644 index 85ef868..0000000 --- a/pkg/httpsling/request.go +++ /dev/null @@ -1,840 +0,0 @@ -package httpsling - -import ( - "bytes" - "context" - "fmt" - "io" - "mime/multipart" - "net/http" - "net/url" - "slices" - "strings" - "time" - - "github.com/google/go-querystring/query" - - "github.com/theopenlane/utils/rout" -) - -// RequestBuilder facilitates building and executing HTTP requests -type RequestBuilder struct { - // client is the HTTP client instance - client *Client - // method is the HTTP method for the request - method string - // path is the URL path for the request - path string - // headers contains the request headers - headers *http.Header - // cookies contains the request cookies - cookies []*http.Cookie - // queries contains the request query parameters - queries url.Values - // pathParams contains the request path parameters - pathParams map[string]string - // formFields contains the request form fields - formFields url.Values - // formFiles contains the request form files - formFiles []*File - // boundary is the custom boundary for multipart requests - boundary string - // bodyData is the request body - bodyData interface{} - // timeout is the request timeout - timeout time.Duration - // middlewares contains the request middlewares - middlewares []Middleware - // maxRetries is the maximum number of retry attempts - maxRetries int - // retryStrategy is the backoff strategy for retries - retryStrategy BackoffStrategy - // retryIf is the custom retry condition function - retryIf RetryIfFunc - // auth is the authentication method for the request - auth AuthMethod - // stream is the stream callback for the request - stream StreamCallback - // streamErr is the error callback for the request - streamErr StreamErrCallback - // streamDone is the done callback for the request - streamDone StreamDoneCallback - // BeforeRequest is a hook that can be used to modify the request object - // before the request has been fired. This is useful for adding authentication - // and other functionality not provided in this library - BeforeRequest func(req *http.Request) error -} - -// NewRequestBuilder creates a new RequestBuilder with default settings -func (c *Client) NewRequestBuilder(method, path string) *RequestBuilder { - rb := &RequestBuilder{ - client: c, - method: method, - path: path, - queries: url.Values{}, - headers: &http.Header{}, - } - - if c.Headers != nil { - rb.headers = c.Headers - } - - return rb -} - -// AddMiddleware adds a middleware to the request -func (b *RequestBuilder) AddMiddleware(middlewares ...Middleware) { - if b.middlewares == nil { - b.middlewares = []Middleware{} - } - - b.middlewares = append(b.middlewares, middlewares...) -} - -// Method sets the HTTP method for the request -func (b *RequestBuilder) Method(method string) *RequestBuilder { - b.method = method - - return b -} - -// Path sets the URL path for the request -func (b *RequestBuilder) Path(path string) *RequestBuilder { - b.path = path - - return b -} - -// PathParams sets multiple path params fields and their values at one go in the RequestBuilder instance -func (b *RequestBuilder) PathParams(params map[string]string) *RequestBuilder { - if b.pathParams == nil { - b.pathParams = map[string]string{} - } - - for key, value := range params { - b.pathParams[key] = value - } - - return b -} - -// PathParam sets a single path param field and its value in the RequestBuilder instance -func (b *RequestBuilder) PathParam(key, value string) *RequestBuilder { - if b.pathParams == nil { - b.pathParams = map[string]string{} - } - - b.pathParams[key] = value - - return b -} - -// DelPathParam removes one or more path params fields from the RequestBuilder instance -func (b *RequestBuilder) DelPathParam(key ...string) *RequestBuilder { - if b.pathParams != nil { - for _, k := range key { - delete(b.pathParams, k) - } - } - - return b -} - -// preparePath replaces path parameters in the URL path -func (b *RequestBuilder) preparePath() string { - if b.pathParams == nil { - return b.path - } - - preparedPath := b.path - - for key, value := range b.pathParams { - placeholder := "{" + key + "}" - preparedPath = strings.ReplaceAll(preparedPath, placeholder, url.PathEscape(value)) - } - - return preparedPath -} - -// Queries adds query parameters to the request -func (b *RequestBuilder) Queries(params url.Values) *RequestBuilder { - for key, values := range params { - for _, value := range values { - b.queries.Add(key, value) - } - } - - return b -} - -// Query adds a single query parameter to the request -func (b *RequestBuilder) Query(key, value string) *RequestBuilder { - b.queries.Add(key, value) - - return b -} - -// DelQuery removes one or more query parameters from the request -func (b *RequestBuilder) DelQuery(key ...string) *RequestBuilder { - for _, k := range key { - b.queries.Del(k) - } - - return b -} - -// QueriesStruct adds query parameters to the request based on a struct tagged with url tags -func (b *RequestBuilder) QueriesStruct(queryStruct interface{}) *RequestBuilder { - values, _ := query.Values(queryStruct) // safely ignore error for simplicity - - for key, value := range values { - for _, v := range value { - b.queries.Add(key, v) - } - } - - return b -} - -// Headers set headers to the request -func (b *RequestBuilder) Headers(headers http.Header) *RequestBuilder { - for key, values := range headers { - for _, value := range values { - b.headers.Set(key, value) - } - } - - return b -} - -// Header sets (or replaces) a header in the request -func (b *RequestBuilder) Header(key, value string) *RequestBuilder { - b.headers.Set(key, value) - - return b -} - -// AddHeader adds a header to the request -func (b *RequestBuilder) AddHeader(key, value string) *RequestBuilder { - b.headers.Add(key, value) - - return b -} - -// DelHeader removes one or more headers from the request -func (b *RequestBuilder) DelHeader(key ...string) *RequestBuilder { - for _, k := range key { - b.headers.Del(k) - } - - return b -} - -// Cookies method for map -func (b *RequestBuilder) Cookies(cookies map[string]string) *RequestBuilder { - for key, value := range cookies { - b.Cookie(key, value) - } - - return b -} - -// Cookie adds a cookie to the request -func (b *RequestBuilder) Cookie(key, value string) *RequestBuilder { - if b.cookies == nil { - b.cookies = []*http.Cookie{} - } - - b.cookies = append(b.cookies, &http.Cookie{Name: key, Value: value}) - - return b -} - -// DelCookie removes one or more cookies from the request -func (b *RequestBuilder) DelCookie(key ...string) *RequestBuilder { - if b.cookies != nil { - for i, cookie := range b.cookies { - if slices.Contains(key, cookie.Name) { - b.cookies = append(b.cookies[:i], b.cookies[i+1:]...) - } - } - } - - return b -} - -// ContentType sets the Content-Type header for the request -func (b *RequestBuilder) ContentType(contentType string) *RequestBuilder { - b.headers.Set(HeaderContentType, contentType) - - return b -} - -// Accept sets the Accept header for the request -func (b *RequestBuilder) Accept(accept string) *RequestBuilder { - b.headers.Set(HeaderAccept, accept) - - return b -} - -// UserAgent sets the User-Agent header for the request -func (b *RequestBuilder) UserAgent(userAgent string) *RequestBuilder { - b.headers.Set(HeaderUserAgent, userAgent) - - return b -} - -// Referer sets the Referer header for the request -func (b *RequestBuilder) Referer(referer string) *RequestBuilder { - b.headers.Set(HeaderReferer, referer) - - return b -} - -// Auth applies an authentication method to the request -func (b *RequestBuilder) Auth(auth AuthMethod) *RequestBuilder { - if auth.Valid() { - b.auth = auth - } - - return b -} - -// Form sets form fields and files for the request -func (b *RequestBuilder) Form(v any) *RequestBuilder { - formFields, formFiles, err := parseForm(v) - - if err != nil { - if b.client.Logger != nil { - b.client.Logger.Errorf("Error parsing form: %v", err) - } - - return b - } - - if formFields != nil { - b.formFields = formFields - } - - if formFiles != nil { - b.formFiles = formFiles - } - - return b -} - -// FormFields sets multiple form fields at once -func (b *RequestBuilder) FormFields(fields any) *RequestBuilder { - if b.formFields == nil { - b.formFields = url.Values{} - } - - values, err := parseFormFields(fields) - if err != nil { - if b.client.Logger != nil { - b.client.Logger.Errorf("Error parsing form fields: %v", err) - } - - return b - } - - for key, value := range values { - for _, v := range value { - b.formFields.Add(key, v) - } - } - - return b -} - -// FormField adds or updates a form field -func (b *RequestBuilder) FormField(key, val string) *RequestBuilder { - if b.formFields == nil { - b.formFields = url.Values{} - } - - b.formFields.Add(key, val) - - return b -} - -// DelFormField removes one or more form fields -func (b *RequestBuilder) DelFormField(key ...string) *RequestBuilder { - if b.formFields != nil { - for _, k := range key { - b.formFields.Del(k) - } - } - - return b -} - -// Files sets multiple files at once -func (b *RequestBuilder) Files(files ...*File) *RequestBuilder { - if b.formFiles == nil { - b.formFiles = []*File{} - } - - b.formFiles = append(b.formFiles, files...) - - return b -} - -// File adds a file to the request -func (b *RequestBuilder) File(key, filename string, content io.ReadCloser) *RequestBuilder { - if b.formFiles == nil { - b.formFiles = []*File{} - } - - b.formFiles = append(b.formFiles, &File{ - Name: key, - FileName: filename, - Content: content, - }) - - return b -} - -// DelFile removes one or more files from the request -func (b *RequestBuilder) DelFile(key ...string) *RequestBuilder { - if b.formFiles != nil { - for i, file := range b.formFiles { - if slices.Contains(key, file.Name) { - b.formFiles = append(b.formFiles[:i], b.formFiles[i+1:]...) - } - } - } - - return b -} - -// Body sets the request body -func (b *RequestBuilder) Body(body interface{}) *RequestBuilder { - b.bodyData = body - - return b -} - -// JSONBody sets the request body as JSON -func (b *RequestBuilder) JSONBody(v interface{}) *RequestBuilder { - b.bodyData = v - b.headers.Set(HeaderContentType, ContentTypeJSON) - - return b -} - -// XMLBody sets the request body as XML -func (b *RequestBuilder) XMLBody(v interface{}) *RequestBuilder { - b.bodyData = v - b.headers.Set(HeaderContentType, ContentTypeXML) - - return b -} - -// YAMLBody sets the request body as YAML -func (b *RequestBuilder) YAMLBody(v interface{}) *RequestBuilder { - b.bodyData = v - b.headers.Set(HeaderContentType, ContentTypeYAML) - - return b -} - -// TextBody sets the request body as plain text -func (b *RequestBuilder) TextBody(v string) *RequestBuilder { - b.bodyData = v - b.headers.Set(HeaderContentType, ContentTypeText) - - return b -} - -// RawBody sets the request body as raw bytes -func (b *RequestBuilder) RawBody(v []byte) *RequestBuilder { - b.bodyData = v - - return b -} - -// Timeout sets the request timeout -func (b *RequestBuilder) Timeout(timeout time.Duration) *RequestBuilder { - b.timeout = timeout - - return b -} - -// MaxRetries sets the maximum number of retry attempts -func (b *RequestBuilder) MaxRetries(maxRetries int) *RequestBuilder { - b.maxRetries = maxRetries - - return b -} - -// RetryStrategy sets the backoff strategy for retries -func (b *RequestBuilder) RetryStrategy(strategy BackoffStrategy) *RequestBuilder { - b.retryStrategy = strategy - - return b -} - -// RetryIf sets the custom retry condition function -func (b *RequestBuilder) RetryIf(retryIf RetryIfFunc) *RequestBuilder { - b.retryIf = retryIf - - return b -} - -func (b *RequestBuilder) do(ctx context.Context, req *http.Request) (*http.Response, error) { - finalHandler := MiddlewareHandlerFunc(func(req *http.Request) (*http.Response, error) { - var maxRetries = b.client.MaxRetries - if b.maxRetries > 0 { - maxRetries = b.maxRetries - } - - var retryStrategy = b.client.RetryStrategy - - if b.retryStrategy != nil { - retryStrategy = b.retryStrategy - } - - var retryIf = b.client.RetryIf - - if b.retryIf != nil { - retryIf = b.retryIf - } - - if maxRetries < 1 { - return b.client.HTTPClient.Do(req) - } - - var lastErr error - - var resp *http.Response - - for attempt := 0; attempt <= maxRetries; attempt++ { - resp, lastErr = b.client.HTTPClient.Do(req) - - shouldRetry := lastErr != nil || (resp != nil && retryIf != nil && retryIf(req, resp, lastErr)) - if !shouldRetry || attempt == maxRetries { - if lastErr != nil { - if b.client.Logger != nil { - b.client.Logger.Errorf("Error after %d attempts: %v", attempt+1, lastErr) - } - } - - break - } - - if resp != nil { - if err := resp.Body.Close(); err != nil { - if b.client.Logger != nil { - b.client.Logger.Errorf("Error closing response body: %v", err) - } - } - } - - if b.client.Logger != nil { - b.client.Logger.Infof("Retrying request (attempt %d) after backoff", attempt+1) - } - - // Logging context cancellation as an error condition - select { - case <-ctx.Done(): - if b.client.Logger != nil { - b.client.Logger.Errorf("Request canceled or timed out: %v", ctx.Err()) - } - - return nil, ctx.Err() - - case <-time.After(retryStrategy(attempt)): - } - } - - return resp, lastErr - }) - - if b.middlewares != nil { - for i := len(b.middlewares) - 1; i >= 0; i-- { - finalHandler = b.middlewares[i](finalHandler) - } - } - - if b.client.Middlewares != nil { - for i := len(b.client.Middlewares) - 1; i >= 0; i-- { - finalHandler = b.client.Middlewares[i](finalHandler) - } - } - - return finalHandler(req) -} - -// Stream sets the stream callback for the request -func (b *RequestBuilder) Stream(callback StreamCallback) *RequestBuilder { - b.stream = callback - - return b -} - -// StreamErr sets the error callback for the request. -func (b *RequestBuilder) StreamErr(callback StreamErrCallback) *RequestBuilder { - b.streamErr = callback - - return b -} - -// StreamDone sets the done callback for the request. -func (b *RequestBuilder) StreamDone(callback StreamDoneCallback) *RequestBuilder { - b.streamDone = callback - - return b -} - -func (b *RequestBuilder) setContentType() (io.Reader, string, error) { - var body io.Reader - - var contentType string - - var err error - - switch { - case len(b.formFiles) > 0: - // If the request includes files, indicating multipart/form-data encoding is required - body, contentType, err = b.prepareMultipartBody() - - case len(b.formFields) > 0: - // For form fields without files, use application/x-www-form-urlencoded encoding - body, contentType = b.prepareFormFieldsBody() - - case b.bodyData != nil: - // Fallback to handling as per original logic for JSON, XML, etc - body, contentType, err = b.prepareBodyBasedOnContentType() - } - - if err != nil { - if b.client.Logger != nil { - // surface to the client logger as well - b.client.Logger.Errorf("Error preparing request body: %v", err) - } - - return nil, contentType, err - } - - if contentType != "" { - b.headers.Set(HeaderContentType, contentType) - } - - return body, contentType, nil -} - -func (b *RequestBuilder) requestChecks(req *http.Request) *http.Request { - // apply the authentication method to the request - if b.auth != nil { - b.auth.Apply(req) - } else if b.client.Auth != nil { - b.client.Auth.Apply(req) - } - - // set the headers from the client - if b.client.Headers != nil { - for key := range *b.client.Headers { - values := (*b.client.Headers)[key] - for _, value := range values { - req.Header.Set(key, value) - } - } - } - // set the headers from the request builder - if b.headers != nil { - for key := range *b.headers { - values := (*b.headers)[key] - for _, value := range values { - req.Header.Set(key, value) - } - } - } - - // merge cookies from the client - if b.client.Cookies != nil { - for _, cookie := range b.client.Cookies { - req.AddCookie(cookie) - } - } - // merge cookies from the request builder - if b.cookies != nil { - for _, cookie := range b.cookies { - req.AddCookie(cookie) - } - } - - return req -} - -// Send executes the HTTP request -func (b *RequestBuilder) Send(ctx context.Context) (*Response, error) { - body, _, err := b.setContentType() - if err != nil { - return nil, err - } - - parsedURL, err := url.Parse(b.client.BaseURL + b.preparePath()) - if err != nil { - if b.client.Logger != nil { - // surface the error to the client logger as well - b.client.Logger.Errorf("Error parsing URL: %v", err) - } - - return nil, err - } - - query := parsedURL.Query() - - for key, values := range b.queries { - for _, value := range values { - query.Set(key, value) - } - } - - parsedURL.RawQuery = query.Encode() - - var cancel context.CancelFunc - - if _, ok := ctx.Deadline(); !ok { - if b.timeout > 0 { - ctx, cancel = context.WithTimeout(ctx, b.timeout) - defer cancel() - } - } - - req, err := http.NewRequestWithContext(ctx, b.method, parsedURL.String(), body) - if err != nil { - if b.client.Logger != nil { - b.client.Logger.Errorf("Error creating request: %v", err) - } - - return nil, rout.HTTPErrorResponse(err) - } - - req = b.requestChecks(req) - - // Execute the HTTP request - resp, err := b.do(ctx, req) - if err != nil { - if b.client.Logger != nil { - b.client.Logger.Errorf("Error executing request: %v", err) - } - - if resp != nil { - _ = resp.Body.Close() - } - - return nil, err - } - - if resp == nil { - if b.client.Logger != nil { - b.client.Logger.Errorf("Response is nil") - } - - return nil, fmt.Errorf("%w: %v", ErrResponseNil, err) - } - - // Wrap and return the response - return NewResponse(ctx, resp, b.client, b.stream, b.streamErr, b.streamDone) -} - -func (b *RequestBuilder) prepareMultipartBody() (io.Reader, string, error) { - var buf bytes.Buffer - writer := multipart.NewWriter(&buf) - - // if a custom boundary is set, use it - if b.boundary != "" { - if err := writer.SetBoundary(b.boundary); err != nil { - return nil, "", rout.HTTPErrorResponse(err) - } - } - - // add form fields - for key, vals := range b.formFields { - for _, val := range vals { - if err := writer.WriteField(key, val); err != nil { - return nil, "", rout.HTTPErrorResponse(err) - } - } - } - - // add form files - for _, file := range b.formFiles { - // create a new multipart part for the file - part, err := writer.CreateFormFile(file.Name, file.FileName) - - if err != nil { - return nil, "", rout.HTTPErrorResponse(err) - } - // copy the file content to the part - if _, err = io.Copy(part, file.Content); err != nil { - return nil, "", rout.HTTPErrorResponse(err) - } - - // close the file content if it's a closer - if closer, ok := file.Content.(io.Closer); ok { - if err = closer.Close(); err != nil { - return nil, "", rout.HTTPErrorResponse(err) - } - } - } - - // close the multipart writer - if err := writer.Close(); err != nil { - return nil, "", rout.HTTPErrorResponse(err) - } - - return &buf, writer.FormDataContentType(), nil -} - -func (b *RequestBuilder) prepareFormFieldsBody() (io.Reader, string) { - data := b.formFields.Encode() - - return strings.NewReader(data), ContentTypeForm -} - -func (b *RequestBuilder) prepareBodyBasedOnContentType() (io.Reader, string, error) { - contentType := b.headers.Get(HeaderContentType) - - if contentType == "" && b.bodyData != nil { - switch b.bodyData.(type) { - case url.Values, map[string][]string, map[string]string: - contentType = ContentTypeForm - case map[string]interface{}, []interface{}, struct{}: - contentType = ContentTypeJSONUTF8 - case string, []byte: - contentType = ContentTypeText - } - b.headers.Set(HeaderContentType, contentType) - } - - var body io.Reader - - var err error - - switch contentType { - case ContentTypeJSON, ContentTypeJSONUTF8: - body, err = b.client.JSONEncoder.Encode(b.bodyData) - case ContentTypeXML: - body, err = b.client.XMLEncoder.Encode(b.bodyData) - case ContentTypeYAML: - body, err = b.client.YAMLEncoder.Encode(b.bodyData) - case ContentTypeForm: - body, err = DefaultFormEncoder.Encode(b.bodyData) - case ContentTypeText, ContentTypeApplicationOctetStream: - switch data := b.bodyData.(type) { - case string: - body = strings.NewReader(data) - case []byte: - body = bytes.NewReader(data) - default: - err = fmt.Errorf("%w: %s", ErrUnsupportedContentType, contentType) - } - default: - err = fmt.Errorf("%w: %s", ErrUnsupportedContentType, contentType) - } - - return body, contentType, err -} diff --git a/pkg/httpsling/request_test.go b/pkg/httpsling/request_test.go deleted file mode 100644 index 21e9111..0000000 --- a/pkg/httpsling/request_test.go +++ /dev/null @@ -1,889 +0,0 @@ -package httpsling - -import ( - "context" - "encoding/base64" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "net/http" - "net/http/httptest" - "net/url" - "strings" - "sync/atomic" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestRequestCancellation(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - time.Sleep(2 * time.Second) // Simulate a long-running operation - fmt.Fprintln(w, "This response may never be sent") - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - ctx, cancel := context.WithCancel(context.Background()) - - defer cancel() // Ensure resources are cleaned up - - // Cancel the request after 1 second - go func() { - time.Sleep(1 * time.Second) - cancel() - }() - - // Attempt to make a request that will be canceled - _, err := client.Get("/").Send(ctx) - if err == nil { - t.Errorf("Expected an error due to cancellation, but got none") - } - - // Check if the error is due to context cancellation - if !errors.Is(err, context.Canceled) { - t.Errorf("Expected context.Canceled error, got %v", err) - } -} - -// TestSendMethodQuery checks the Send method for handling query parameters. -func TestSendMethodQuery(t *testing.T) { - // Start a test HTTP server. - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Respond with the full URL received, including query parameters. - fmt.Fprintln(w, r.URL.String()) - })) - defer server.Close() - - // Define a client with the test server's URL. - client := Create(&Config{BaseURL: server.URL}) - - tests := []struct { - name string - url string // URL to request, may include query params - additionalQPS map[string]string // Query params added via Query method - expectedURL string // Expected URL path and query received by the server - }{ - { - name: "URL only", - url: "/test?param1=value1", - expectedURL: "/test?param1=value1", - }, - { - name: "Method only", - url: "/test", - additionalQPS: map[string]string{"param2": "value2"}, - expectedURL: "/test?param2=value2", - }, - { - name: "URL and Method", - url: "/test?param1=value1", - additionalQPS: map[string]string{"param2": "value2"}, - expectedURL: "/test?param1=value1¶m2=value2", - }, - { - name: "Method overwrites URL", - url: "/test?param1=value1", - additionalQPS: map[string]string{"param1": "value2"}, - expectedURL: "/test?param1=value2", - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - // Create a new RequestBuilder for each test case. - rb := client.NewRequestBuilder(http.MethodGet, tc.url) - - // If there are additional query params defined, add them. - if tc.additionalQPS != nil { - for key, value := range tc.additionalQPS { - rb.Queries(map[string][]string{key: {value}}) - } - } - - // Send the request. - resp, err := rb.Send(context.Background()) - assert.NoError(t, err) - - // Read the response body. - bodyBytes, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - - body := string(bodyBytes) - - // The body should contain the expected URL path and query. - assert.Contains(t, body, tc.expectedURL, "The server did not receive the expected URL.") - }) - } -} - -type testAddress struct { - Postcode string `url:"postcode"` - City string `url:"city"` -} - -type testQueryStruct struct { - Name string `url:"name"` - Occupation string `url:"occupation,omitempty"` - Age int `url:"age"` - IsActive bool `url:"is_active,int"` - Tags []string `url:"tags,comma"` - Address testAddress `url:"addr"` -} - -func TestQueryStructWithClient(t *testing.T) { - // Start a test HTTP server that JSON-encodes and echoes back the query parameters received - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - queryParams := r.URL.Query() - - w.Header().Set(HeaderContentType, ContentTypeJSON) - - if encoder := json.NewEncoder(w); encoder != nil { - if err := encoder.Encode(queryParams); err != nil { - http.Error(w, "Failed to encode response", http.StatusInternalServerError) - } - } else { - http.Error(w, "Failed to create JSON encoder", http.StatusInternalServerError) - } - })) - - defer server.Close() - - // Create an instance of the client, pointing to the test server - client := Create(&Config{BaseURL: server.URL}) - - // Define the struct to be used for query parameters - exampleStruct := testQueryStruct{ - Name: "John Snow", - Occupation: "Developer", - Age: 30, - IsActive: true, - Tags: []string{"go", "programming"}, - Address: testAddress{ - Postcode: "1234", - City: "GoCity", - }, - } - - // Send a request to the server using the client and the struct for query parameters - resp, err := client.NewRequestBuilder(http.MethodGet, "/").QueriesStruct(exampleStruct).Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - var response map[string][]string - err = resp.ScanJSON(&response) - assert.NoError(t, err) - - // Now we can assert the values directly - assert.Contains(t, response, "name") - assert.Equal(t, []string{"John Snow"}, response["name"]) - assert.Contains(t, response, "occupation") - assert.Equal(t, []string{"Developer"}, response["occupation"]) - assert.Contains(t, response, "age") - assert.Equal(t, []string{"30"}, response["age"]) - assert.Contains(t, response, "is_active") - assert.Equal(t, []string{"1"}, response["is_active"]) - assert.Contains(t, response, "tags") - assert.Equal(t, []string{"go,programming"}, response["tags"]) - - err = resp.Close() - assert.NoError(t, err) -} - -func TestHeaderManipulationMethods(t *testing.T) { - // Start a test HTTP server that checks received headers - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check headers - assert.Equal(t, ContentTypeJSON, r.Header.Get(HeaderContentType)) - assert.Equal(t, "Bearer token", r.Header.Get(HeaderAuthorization)) - assert.Empty(t, r.Header.Get("X-Deprecated-Header")) - - fmt.Fprintln(w, "Headers received") - })) - - defer server.Close() - - // Create an instance of the client, pointing to the test server - rq := Create(&Config{BaseURL: server.URL}).Get("/test-headers") - rq.Headers(http.Header{HeaderContentType: []string{ContentTypeJSON}}) - rq.AddHeader(HeaderAuthorization, "Bearer token") - rq.Header("X-Modified-Header", "NewValue") - rq.AddHeader("X-Deprecated-Header", "OldValue") - rq.DelHeader("X-Deprecated-Header") - - // Send the request - resp, err := rq.Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - responseBody, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - assert.Contains(t, string(responseBody), "Headers received") -} - -func TestUserAgentMethod(t *testing.T) { - // Start a test HTTP server that checks received User-Agent header - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check User-Agent header - assert.Equal(t, "MyCustomUserAgent", r.Header.Get(HeaderUserAgent)) - - fmt.Fprintln(w, "User-Agent received") - })) - defer server.Close() - - // Create an instance of the client, pointing to the test server - client := Create(&Config{BaseURL: server.URL}) - rq := client.Get("/test-user-agent") - - // Set the User-Agent header using the UserAgent method - rq.UserAgent("MyCustomUserAgent") - - // Send the request - resp, err := rq.Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - responseBody, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - assert.Contains(t, string(responseBody), "User-Agent received") -} - -func TestContentTypeMethod(t *testing.T) { - // Start a test HTTP server that checks received Content-Type header - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check Content-Type header - assert.Equal(t, ContentTypeJSON, r.Header.Get(HeaderContentType)) - - fmt.Fprintln(w, "Content-Type received") - })) - - defer server.Close() - - // Create an instance of the client, pointing to the test server - client := Create(&Config{BaseURL: server.URL}) - rq := client.Get("/test-content-type") - - // Set the Content-Type header using the ContentType method - rq.ContentType(ContentTypeJSON) - - // Send the request - resp, err := rq.Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - responseBody, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - assert.Contains(t, string(responseBody), "Content-Type received") -} - -func TestAcceptMethod(t *testing.T) { - // Start a test HTTP server that checks received Accept header - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check Accept header - assert.Equal(t, ContentTypeXML, r.Header.Get(HeaderAccept)) - - fmt.Fprintln(w, "Accept received") - })) - - defer server.Close() - - // Create an instance of the client, pointing to the test server - client := Create(&Config{BaseURL: server.URL}) - rq := client.Get("/test-accept") - - // Set the Accept header using the Accept method - rq.Accept(ContentTypeXML) - - // Send the request - resp, err := rq.Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - responseBody, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - assert.Contains(t, string(responseBody), "Accept received") -} - -func TestRefererMethod(t *testing.T) { - // Start a test HTTP server that checks received Referer header - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check Referer header - assert.Equal(t, "https://example.com", r.Header.Get(HeaderReferer)) - - fmt.Fprintln(w, "Referer received") - })) - - defer server.Close() - - // Create an instance of the client, pointing to the test server - client := Create(&Config{BaseURL: server.URL}) - rq := client.Get("/test-referer") - - // Set the Referer header - rq.Referer("https://example.com") - - // Send the request - resp, err := rq.Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - responseBody, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - assert.Contains(t, string(responseBody), "Referer received") -} - -func TestCookieManipulationMethods(t *testing.T) { - // Start a test HTTP server that checks received cookies - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check cookies - cookie1, err1 := r.Cookie("SessionID") - assert.NoError(t, err1) - assert.Equal(t, "12345", cookie1.Value) - - cookie2, err2 := r.Cookie("AuthToken") - assert.NoError(t, err2) - assert.Equal(t, "abcdef", cookie2.Value) - - // Ensure the deleted cookie is not present - _, err3 := r.Cookie("DeletedCookie") - assert.Error(t, err3) // We expect an error because the cookie should not be present - - fmt.Fprintln(w, "Cookies received") - })) - - defer server.Close() - - // Create an instance of the client, pointing to the test server - rq := Create(&Config{BaseURL: server.URL}).Get("/test-cookies") - // Using SetCookies to set multiple cookies at once - rq.Cookies(map[string]string{ - "SessionID": "12345", - "AuthToken": "abcdef", - "DeletedCookie": "should-be-deleted", - }) - // Demonstrate individual cookie manipulation - rq.Cookie("SingleCookie", "single-value") - // Removing a previously set cookie - rq.DelCookie("DeletedCookie") - - // Send the request - resp, err := rq.Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - responseBody, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - assert.Contains(t, string(responseBody), "Cookies received") -} - -func TestPathParameterMethods(t *testing.T) { - // Start a test HTTP server that checks the received path for correctness - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check if the path is as expected - expectedPath := "/users/johnDoe/posts/123" - if r.URL.Path != expectedPath { - t.Errorf("expected path %s, got %s", expectedPath, r.URL.Path) - } - - fmt.Fprintln(w, "Path parameters received correctly") - })) - - defer server.Close() - - // Create an instance of the client, pointing to the test server - client := Create(&Config{BaseURL: server.URL}) - rq := client.Get("/users/{userId}/posts/{postId}") - - // Using PathParams to set multiple path params at once - rq.PathParams(map[string]string{ - "postId": "123", - }) - - // Demonstrate individual path parameter manipulation - rq.PathParam("userId", "johnDoe").PathParam("hello", "world") - rq.DelPathParam("hello") - - // Send the request - resp, err := rq.Send(context.Background()) - assert.NoError(t, err) - - // Read and verify the response - responseBody, err := io.ReadAll(resp.RawResponse.Body) - assert.NoError(t, err) - assert.Contains(t, string(responseBody), "Path parameters received correctly") -} - -func startEchoServer() *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - bodyBytes, _ := io.ReadAll(r.Body) - - w.Header().Set(HeaderContentType, ContentTypeJSON) - - response := map[string]string{ - "body": string(bodyBytes), - "contentType": r.Header.Get(HeaderContentType), - } - - if encoder := json.NewEncoder(w); encoder != nil { - if err := encoder.Encode(response); err != nil { - http.Error(w, "Failed to encode response", http.StatusInternalServerError) - } - } else { - http.Error(w, "Failed to create JSON encoder", http.StatusInternalServerError) - } - })) -} - -func TestFormFields(t *testing.T) { - server := startEchoServer() // Starts a mock HTTP server that echoes back received requests - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Example form data using a map - formData := map[string]string{ - "name": "Jane Doe", - "age": "32", - } - - resp, err := client.Post("/"). - FormFields(formData). // Using FormFields to set form data - Send(context.Background()) - assert.NoError(t, err, "Request should not fail") - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err, "Response should be parsed without error") - - // Validates that the form data was correctly encoded and sent in the request body - expectedEncodedFormData := url.Values{"name": {"Jane Doe"}, "age": {"32"}}.Encode() - - assert.Equal(t, expectedEncodedFormData, response["body"], "The body content should match the encoded form data") - assert.Equal(t, ContentTypeForm, response["contentType"], "The content type should be application/x-www-form-urlencoded") -} - -func TestFormField(t *testing.T) { - server := startEchoServer() // Simulated HTTP server - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - resp, err := client.Post("/"). - FormField("name", "John Snow"). // Adding a single form field - Send(context.Background()) - assert.NoError(t, err, "No error expected on sending request") - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err, "Parsing response should not error") - - // Validate that the single form field was correctly encoded and sent - expectedEncodedFormData := "name=John+Snow" - assert.Equal(t, expectedEncodedFormData, response["body"], "The body content should match the single form field") -} - -func TestDelFormField(t *testing.T) { - server := startEchoServer() // Setup mock server - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Set initial form fields - initialFormData := map[string]string{ - "name": "Jane Doe", - "age": "32", - } - - // Delete the "age" field before sending - resp, err := client.Post("/"). - FormFields(initialFormData). - DelFormField("age"). // Removing an existing form field - Send(context.Background()) - assert.NoError(t, err, "Expect no error on request send") - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err, "Expect no error on response parse") - - // Validates that the "age" field was correctly removed - expectedEncodedFormData := "name=Jane+Doe" - assert.Equal(t, expectedEncodedFormData, response["body"], "The body should match after deleting a field") -} - -func TestBody(t *testing.T) { - server := startEchoServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Example body data - bodyData := url.Values{"key": []string{"value"}} - encodedData := bodyData.Encode() - - resp, err := client.Post("/"). - Body(bodyData). - ContentType(ContentTypeForm). - Send(context.Background()) - - assert.NoError(t, err) - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err) - - // Asserts - assert.Equal(t, encodedData, response["body"], "The body content should match.") - assert.Equal(t, ContentTypeForm, response["contentType"], "The content type should be set correctly.") -} - -func TestJSONBody(t *testing.T) { - server := startEchoServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Example JSON data - jsonData := map[string]interface{}{"name": "John Snow", "age": 30} - jsonDataStr, _ := json.Marshal(jsonData) - - resp, err := client.Post("/"). - JSONBody(jsonData). - Send(context.Background()) - assert.NoError(t, err) - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err) - - // Asserts - assert.JSONEq(t, string(jsonDataStr), response["body"], "The body content should match.") - assert.Equal(t, ContentTypeJSON, response["contentType"], "The content type should be set to application/json.") -} - -func TestXMLBody(t *testing.T) { - server := startEchoServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Example XML data - xmlData := struct { - XMLName xml.Name `xml:"Person"` - Name string `xml:"Name"` - Age int `xml:"Age"` - }{Name: "Jane Doe", Age: 32} - xmlDataStr, _ := xml.Marshal(xmlData) - - resp, err := client.Post("/"). - XMLBody(xmlData). - Send(context.Background()) - assert.NoError(t, err) - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err) - - // Asserts - assert.Equal(t, string(xmlDataStr), strings.TrimSpace(response["body"]), "The body content should match.") - assert.Equal(t, ContentTypeXML, response["contentType"], "The content type should be set to application/xml.") -} - -func TestFormWithUrlValues(t *testing.T) { - server := startEchoServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Example form data - formData := url.Values{ - "name": []string{"Jane Doe"}, - "age": []string{"32"}, - } - - resp, err := client.Post("/"). - Form(formData). - Send(context.Background()) - assert.NoError(t, err) - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err) - - // Asserts - assert.Equal(t, formData.Encode(), response["body"], "The body content should match.") - assert.Equal(t, ContentTypeForm, response["contentType"], "The content type should be set correctly.") -} - -func TestTextBody(t *testing.T) { - server := startEchoServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Example text data - textData := "This is a plain text body." - - resp, err := client.Post("/"). - TextBody(textData). - Send(context.Background()) - assert.NoError(t, err) - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err) - - // Asserts - assert.Equal(t, textData, response["body"], "The body content should match.") - assert.Equal(t, ContentTypeText, response["contentType"], "The content type should be set to text/plain.") -} - -func TestRawBody(t *testing.T) { - server := startEchoServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - // Example raw data - rawData := []byte("This is raw byte data.") - - resp, err := client.Post("/"). - RawBody(rawData). - ContentType("application/octet-stream"). // Explicitly set content type - Send(context.Background()) - assert.NoError(t, err) - - var response map[string]string - err = resp.Scan(&response) - assert.NoError(t, err) - - // Asserts - assert.Equal(t, string(rawData), response["body"], "The body content should match.") - assert.Equal(t, "application/octet-stream", response["contentType"], "The content type should be set to application/octet-stream.") -} - -func TestRequestLevelRetries(t *testing.T) { - var requestCount int32 - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - count := atomic.AddInt32(&requestCount, 1) - if count == 1 { - // Simulate a server error on the first request - w.WriteHeader(http.StatusInternalServerError) - } else { - // Succeed on subsequent attempts - w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "Success") - } - })) - - defer server.Close() - - // Set up a request builder with retry configuration - client := Create(&Config{BaseURL: server.URL}) - rq := client.Get("/") - rq.MaxRetries(2) // Allow up to 2 retries - rq.RetryStrategy(func(attempt int) time.Duration { return 10 * time.Millisecond }) - rq.RetryIf(func(req *http.Request, resp *http.Response, err error) bool { - // Retry on server error - return resp.StatusCode == http.StatusInternalServerError - }) - - // Send the request - _, err := rq.Send(context.Background()) - if err != nil { - t.Fatalf("Request failed: %v", err) - } - - // Verify that the retry logic was applied - expectedAttempts := int32(2) - if requestCount != expectedAttempts { - t.Errorf("Expected %d attempts, got %d", expectedAttempts, requestCount) - } -} - -func TestFormWithNil(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeJSON) - // Ensure a valid JSON response is sent back for all scenarios - response := map[string]interface{}{ - "status": "received", - "body": "empty or nil form", - } - if encoder := json.NewEncoder(w); encoder != nil { - if err := encoder.Encode(response); err != nil { - http.Error(w, "Failed to encode response", http.StatusInternalServerError) - } - } else { - http.Error(w, "Failed to create JSON encoder", http.StatusInternalServerError) - } - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - resp, err := client.Post("/").Form(nil).Send(context.Background()) - assert.NoError(t, err, "No error expected on sending request with nil form") - - var response map[string]interface{} - err = resp.ScanJSON(&response) - assert.NoError(t, err, "Expect no error on parsing response") - - // Assert form is correctly received - assert.Contains(t, response, "status", "Status should be present") - assert.Contains(t, response, "body", "Body should be present") -} - -func startFormHandlingServer() *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeJSON) - - err := r.ParseMultipartForm(32 << 20) // limit to 32MB - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - fields := make(map[string][]string) - files := make(map[string][]string) - - if r.MultipartForm != nil { - for key, values := range r.MultipartForm.Value { - fields[key] = values - } - - for key, fileHeaders := range r.MultipartForm.File { - for _, fileHeader := range fileHeaders { - files[key] = append(files[key], fileHeader.Filename) - } - } - } - - response := map[string]interface{}{ - "fields": fields, - "files": files, - } - - if encoder := json.NewEncoder(w); encoder != nil { - if err := encoder.Encode(response); err != nil { - http.Error(w, "Failed to encode response", http.StatusInternalServerError) - } - } else { - http.Error(w, "Failed to create JSON encoder", http.StatusInternalServerError) - } - })) -} - -func TestFormWithFiles(t *testing.T) { - server := startFormHandlingServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - fileContent1 := strings.NewReader("File content 1") - fileContent2 := strings.NewReader("File content 2") - - formData := map[string]any{ - "file1": &File{Name: "file1", FileName: "file1.txt", Content: io.NopCloser(fileContent1)}, - "file2": &File{Name: "file2", FileName: "file2.txt", Content: io.NopCloser(fileContent2)}, - } - - resp, err := client.Post("/").Form(formData).Send(context.Background()) - assert.NoError(t, err, "No error expected on sending request with files") - - var response map[string]interface{} - err = resp.ScanJSON(&response) - assert.NoError(t, err, "Expect no error on parsing response") - - // Assert files are correctly received - assert.Contains(t, response["files"].(map[string]interface{}), "file1", "File1 should be present") - assert.Contains(t, response["files"].(map[string]interface{}), "file2", "File2 should be present") -} - -func TestFormWithMixedFilesAndFields(t *testing.T) { - server := startFormHandlingServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - fileContent := strings.NewReader("File content 1") - - formData := map[string]any{ - "name": "John Snow", - "age": "30", - "file": &File{Name: "file", FileName: "file.txt", Content: io.NopCloser(fileContent)}, - } - - resp, err := client.Post("/").Form(formData).Send(context.Background()) - assert.NoError(t, err, "No error expected on sending request with mixed form data") - - var response map[string]interface{} - err = resp.Scan(&response) - assert.NoError(t, err, "Expect no error on parsing response") - - // Assert fields and files are correctly received - fields := response["fields"].(map[string]interface{}) - assert.Contains(t, fields, "name", "Name should be present") - assert.Contains(t, fields, "age", "Age should be present") - - files := response["files"].(map[string]interface{}) - assert.Contains(t, files, "file", "File should be present") -} - -// TestAuthRequest verifies that the Auth method correctly applies basic authentication to a request -func TestAuthRequest(t *testing.T) { - // Expected username and password for basic authentication - expectedUsername := "testuser" - expectedPassword := "testpass" - - // Encode the username and password into the expected format for the Authorization header - expectedAuthValue := "Basic " + base64.StdEncoding.EncodeToString([]byte(expectedUsername+":"+expectedPassword)) - - // Set up a mock server to handle the request. This server checks the Authorization header - mockServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Retrieve the Authorization header from the incoming request - authHeader := r.Header.Get(HeaderAuthorization) - - // Compare the Authorization header to the expected value - if authHeader != expectedAuthValue { - // If they don't match, respond with 401 Unauthorized to indicate a failed authentication attempt - w.WriteHeader(http.StatusUnauthorized) - return - } - - // If the Authorization header is correct, respond with 200 OK to indicate successful authentication - w.WriteHeader(http.StatusOK) - })) - - defer mockServer.Close() // Ensure the server is shut down at the end of the test - - // Initialize the HTTP client with the base URL set to the mock server's URL - client := Create(&Config{ - BaseURL: mockServer.URL, - }) - - // Create a request to the mock server with basic authentication credentials - resp, err := client.Get("/").Auth(BasicAuth{ - Username: expectedUsername, - Password: expectedPassword, - }).Send(context.Background()) - - if err != nil { - // If there's an error sending the request, fail the test - t.Fatalf("Failed to send request: %v", err) - } - - defer resp.Close() //nolint: errcheck - - // Check if the response status code is 200 OK, which indicates successful authentication - if resp.StatusCode() != http.StatusOK { - // If the status code is not 200, it indicates the Authorization header was not set correctly - t.Errorf("Expected status code 200, got %d. Indicates Authorization header was not set correctly", resp.StatusCode()) - } -} diff --git a/pkg/httpsling/response.go b/pkg/httpsling/response.go deleted file mode 100644 index 1ea5e66..0000000 --- a/pkg/httpsling/response.go +++ /dev/null @@ -1,295 +0,0 @@ -package httpsling - -import ( - "bufio" - "bytes" - "context" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "os" - "path/filepath" - "strings" - - "github.com/theopenlane/utils/rout" -) - -// Response represents an HTTP response -type Response struct { - // stream is the callback function for streaming responses - stream StreamCallback - // streamErr is the callback function for streaming errors - streamErr StreamErrCallback - // streamDone is the callback function for when the stream is done - streamDone StreamDoneCallback - // RawResponse is the original HTTP response - RawResponse *http.Response - // BodyBytes is the response body as a juicy byte slice - BodyBytes []byte - // Context is the request context - Context context.Context - // Client is the HTTP client - Client *Client -} - -// NewResponse creates a new wrapped response object leveraging the buffer pool -func NewResponse(ctx context.Context, resp *http.Response, client *Client, stream StreamCallback, streamErr StreamErrCallback, streamDone StreamDoneCallback) (*Response, error) { - response := &Response{ - RawResponse: resp, - Context: ctx, - BodyBytes: nil, - stream: stream, - streamErr: streamErr, - streamDone: streamDone, - Client: client, - } - - if response.stream != nil { - go response.handleStream() - } else if err := response.handleNonStream(); err != nil { - return nil, err - } - - return response, nil -} - -var maxStreamBufferSize = 512 * 1024 - -// handleStream processes the HTTP response as a stream -func (r *Response) handleStream() { - defer func() { - if err := r.RawResponse.Body.Close(); err != nil { - r.Client.Logger.Errorf("failed to close response body: %v", err) - } - }() - - scanner := bufio.NewScanner(r.RawResponse.Body) - - scanBuf := make([]byte, 0, maxStreamBufferSize) - - scanner.Buffer(scanBuf, maxStreamBufferSize) - - for scanner.Scan() { - if err := r.stream(scanner.Bytes()); err != nil { - break - } - } - - if err := scanner.Err(); err != nil && r.streamErr != nil { - r.streamErr(err) - } - - if r.streamDone != nil { - r.streamDone() - } -} - -// handleNonStream reads the HTTP response body into a buffer for non-streaming responses -func (r *Response) handleNonStream() error { - buf := GetBuffer() - defer PutBuffer(buf) - - _, err := buf.ReadFrom(r.RawResponse.Body) - if err != nil { - return fmt.Errorf("%w: %v", ErrResponseReadFailed, err) - } - - _ = r.RawResponse.Body.Close() - - r.RawResponse.Body = io.NopCloser(bytes.NewReader(buf.B)) - r.BodyBytes = buf.B - - return nil -} - -// StatusCode returns the HTTP status code of the response -func (r *Response) StatusCode() int { - return r.RawResponse.StatusCode -} - -// Status returns the status string of the response -func (r *Response) Status() string { - return r.RawResponse.Status -} - -// Header returns the response headers -func (r *Response) Header() http.Header { - return r.RawResponse.Header -} - -// Cookies parses and returns the cookies set in the response -func (r *Response) Cookies() []*http.Cookie { - return r.RawResponse.Cookies() -} - -// Location returns the URL redirected address -func (r *Response) Location() (*url.URL, error) { - return r.RawResponse.Location() -} - -// URL returns the request URL that elicited the response -func (r *Response) URL() *url.URL { - return r.RawResponse.Request.URL -} - -// ContentType returns the value of the HeaderContentType header -func (r *Response) ContentType() string { - return r.Header().Get(HeaderContentType) -} - -// IsContentType Checks if the response Content-Type header matches a given content type -func (r *Response) IsContentType(contentType string) bool { - return strings.Contains(r.ContentType(), contentType) -} - -// IsJSON checks if the response Content-Type indicates JSON -func (r *Response) IsJSON() bool { - return r.IsContentType(ContentTypeJSON) -} - -// IsXML checks if the response Content-Type indicates XML -func (r *Response) IsXML() bool { - return r.IsContentType(ContentTypeXML) -} - -// IsYAML checks if the response Content-Type indicates YAML -func (r *Response) IsYAML() bool { - return r.IsContentType(ContentTypeYAML) -} - -// ContentLength returns the length of the response body -func (r *Response) ContentLength() int { - if r.BodyBytes == nil { - return 0 - } - - return len(r.BodyBytes) -} - -// IsEmpty checks if the response body is empty -func (r *Response) IsEmpty() bool { - return r.ContentLength() == 0 -} - -// IsSuccess checks if the response status code indicates success -func (r *Response) IsSuccess() bool { - code := r.StatusCode() - - return code >= http.StatusOK && code <= http.StatusIMUsed -} - -// Body returns the response body as a juicy byte slice -func (r *Response) Body() []byte { - return r.BodyBytes -} - -// String returns the response body as a string -func (r *Response) String() string { - return string(r.BodyBytes) -} - -// Scan attempts to unmarshal the response body based on its content type -func (r *Response) Scan(v interface{}) error { - switch { - case r.IsJSON(): - return r.ScanJSON(v) - case r.IsXML(): - return r.ScanXML(v) - case r.IsYAML(): - return r.ScanYAML(v) - } - - return fmt.Errorf("%w: %s", ErrUnsupportedContentType, r.ContentType()) -} - -// ScanJSON unmarshals the response body into a struct via JSON decoding -func (r *Response) ScanJSON(v interface{}) error { - if r.BodyBytes == nil { - return nil - } - - return r.Client.JSONDecoder.Decode(bytes.NewReader(r.BodyBytes), v) -} - -// ScanXML unmarshals the response body into a struct via XML decoding -func (r *Response) ScanXML(v interface{}) error { - if r.BodyBytes == nil { - return nil - } - - return r.Client.XMLDecoder.Decode(bytes.NewReader(r.BodyBytes), v) -} - -// ScanYAML unmarshals the response body into a struct via YAML decoding -func (r *Response) ScanYAML(v interface{}) error { - if r.BodyBytes == nil { - return nil - } - - return r.Client.YAMLDecoder.Decode(bytes.NewReader(r.BodyBytes), v) -} - -const dirPermissions = 0755 - -// Save saves the response body to a file or io.Writer -func (r *Response) Save(v any) error { - switch p := v.(type) { - case string: - file := filepath.Clean(p) - dir := filepath.Dir(file) - - // Create the directory if it doesn't exist - if _, err := os.Stat(dir); err != nil { - if !errors.Is(err, os.ErrNotExist) { - return rout.HTTPErrorResponse(err) - } - - if err = os.MkdirAll(dir, dirPermissions); err != nil { - return rout.HTTPErrorResponse(err) - } - } - - // Create and open the file for writing - outFile, err := os.Create(file) - if err != nil { - return rout.HTTPErrorResponse(err) - } - - defer func() { - if err := outFile.Close(); err != nil { - r.Client.Logger.Errorf("failed to close file: %v", err) - } - }() - - // Write the response body to the file - _, err = io.Copy(outFile, bytes.NewReader(r.Body())) - if err != nil { - return rout.HTTPErrorResponse(err) - } - - return nil - case io.Writer: - // Write the response body directly to the provided io.Writer - _, err := io.Copy(p, bytes.NewReader(r.Body())) - if err != nil { - return rout.HTTPErrorResponse(err) - } - - if pc, ok := p.(io.WriteCloser); ok { - if err := pc.Close(); err != nil { - r.Client.Logger.Errorf("failed to close io.Writer: %v", err) - } - } - - return nil - default: - return ErrNotSupportSaveMethod - } -} - -// Close closes the response body -func (r *Response) Close() error { - return r.RawResponse.Body.Close() -} diff --git a/pkg/httpsling/response_test.go b/pkg/httpsling/response_test.go deleted file mode 100644 index bc3d755..0000000 --- a/pkg/httpsling/response_test.go +++ /dev/null @@ -1,424 +0,0 @@ -package httpsling - -import ( - "bytes" - "context" - "encoding/xml" - "fmt" - "net/http" - "net/http/httptest" - "net/url" - "os" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestResponseContentType(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - tests := []struct { - url string - contentType string - expected bool - }{ - {"/test-json", ContentTypeJSON, true}, - {"/test-xml", ContentTypeXML, true}, - {"/test-text", ContentTypeText, true}, - {"/test-text", ContentTypeJSON, false}, - {"/test-json", ContentTypeText, false}, - } - - for _, tt := range tests { - t.Run(fmt.Sprintf("ContentType is %s", tt.contentType), func(t *testing.T) { - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get(tt.url).Send(context.Background()) - assert.NoError(t, err) - assert.Equal(t, tt.expected, resp.IsContentType(tt.contentType)) - }) - } -} - -func TestResponseStatusAndStatusCode(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-status-code").Send(context.Background()) - - assert.NoError(t, err) - assert.Equal(t, 201, resp.StatusCode()) - assert.Contains(t, resp.Status(), "201 Created") -} - -func TestResponseHeaderAndCookies(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - t.Run("Test Headers", func(t *testing.T) { - resp, err := client.Get("/test-headers").Send(context.Background()) - assert.NoError(t, err) - assert.Equal(t, "TestValue", resp.Header().Get("X-Custom-Header")) - }) - - t.Run("Test Cookies", func(t *testing.T) { - resp, err := client.Get("/test-cookies").Send(context.Background()) - assert.NoError(t, err) - - cookies := resp.Cookies() - - assert.Equal(t, 1, len(cookies)) - assert.Equal(t, "test-cookie", cookies[0].Name) - assert.Equal(t, "cookie-value", cookies[0].Value) - }) -} - -func TestResponseContentLengthAndIsEmpty(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - - t.Run("Non-empty response", func(t *testing.T) { - resp, err := client.Get("/test-content-type?ct=text/plain").Send(context.Background()) - assert.NoError(t, err) - assert.False(t, resp.IsEmpty()) - assert.Greater(t, resp.ContentLength(), 0) - }) - - t.Run("Empty response", func(t *testing.T) { - resp, err := client.Get("/test-empty").Send(context.Background()) - assert.NoError(t, err) - assert.True(t, resp.IsEmpty()) - assert.Equal(t, 0, resp.ContentLength()) - }) -} - -func TestResponseIsSuccess(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-status-code").Send(context.Background()) // This endpoint sets status 201 - assert.NoError(t, err) - - assert.True(t, resp.IsSuccess()) -} - -func TestResponseIsSuccessForFailure(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-failure").Send(context.Background()) // This endpoint sets status 500 - assert.NoError(t, err) - - assert.False(t, resp.IsSuccess()) -} - -func TestResponseAfterRedirect(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-redirect").Send(context.Background()) - assert.NoError(t, err) - - bodyStr := resp.String() - expectedContent := "Redirected\n" - assert.Contains(t, bodyStr, expectedContent, "The response content should be 'Redirected'") -} - -func TestResponseBodyAndString(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-body").Send(context.Background()) - assert.NoError(t, err) - - bodyStr := resp.String() - assert.Contains(t, bodyStr, "This is the response body.") - - bodyBytes := resp.Body() - assert.Contains(t, string(bodyBytes), "This is the response body.") -} - -func TestResponseScanJSON(t *testing.T) { - type jsonTestResponse struct { - Message string `json:"message"` - Status bool `json:"status"` - } - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeJSON) - fmt.Fprintln(w, `{"message": "Call your buddy JSON", "status": true}`) - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-json").Send(context.Background()) - assert.NoError(t, err) - - var jsonResponse jsonTestResponse - err = resp.Scan(&jsonResponse) - - assert.NoError(t, err) - assert.Equal(t, "Call your buddy JSON", jsonResponse.Message) - assert.True(t, jsonResponse.Status) -} - -func TestResponseScanXML(t *testing.T) { - type xmlTestResponse struct { - XMLName xml.Name `xml:"Response"` - Message string `xml:"Message"` - Status bool `xml:"Status"` - } - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(HeaderContentType, ContentTypeXML) - fmt.Fprintln(w, `XML is terribletrue`) - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-xml").Send(context.Background()) - assert.NoError(t, err) - - var xmlResponse xmlTestResponse - err = resp.Scan(&xmlResponse) - - assert.NoError(t, err) - assert.Equal(t, "XML is terrible", xmlResponse.Message) - assert.True(t, xmlResponse.Status) -} - -func TestResponseScanYAML(t *testing.T) { - type yamlTestResponse struct { - Message string `yaml:"message"` - Status bool `yaml:"status"` - } - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - yml := `--- -message: My YAML is better than your YAML -status: true -` - - w.Header().Set(HeaderContentType, ContentTypeYAML) - fmt.Fprint(w, yml) - })) - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-yaml").Send(context.Background()) - assert.NoError(t, err) - - var yamlResponse yamlTestResponse - err = resp.Scan(&yamlResponse) - - assert.NoError(t, err) - assert.Equal(t, "My YAML is better than your YAML", yamlResponse.Message) - assert.True(t, yamlResponse.Status) -} - -func TestResponseScanUnsupportedContentType(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-pdf").Send(context.Background()) - assert.NoError(t, err) - - var dummyResponse struct{} - err = resp.Scan(&dummyResponse) - - assert.Error(t, err, "expected an error for unsupported content type") - assert.ErrorIs(t, err, ErrUnsupportedContentType) -} - -func TestResponseClose(t *testing.T) { - server := startTestHTTPServer() - - defer server.Close() - - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get("/test-get").Send(context.Background()) - assert.NoError(t, err) - - err = resp.Close() - assert.NoError(t, err, "expected no error when closing the response") -} - -func TestResponseURL(t *testing.T) { - server := startTestHTTPServer() - defer server.Close() - - tests := []struct { - name string - path string // Path to append to the base URL - expected string // Expected final URL (for comparison) - }{ - { - name: "Base URL", - path: "", - expected: server.URL, - }, - { - name: "Path Parameter", - path: "/path-param", - expected: server.URL + "/path-param", - }, - { - name: "Query Parameter", - path: "/query?param=value", - expected: server.URL + "/query?param=value", - }, - { - name: "Hash Fragment", - path: "/hash#fragment", - expected: server.URL + "/hash#fragment", - }, - { - name: "Complex URL", - path: "/complex/path?param=value#fragment", - expected: server.URL + "/complex/path?param=value#fragment", - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - client := Create(&Config{BaseURL: server.URL}) - resp, err := client.Get(tc.path).Send(context.Background()) - assert.NoError(t, err) - - expectedURL, _ := url.Parse(tc.expected) - - assert.Equal(t, expectedURL.String(), resp.URL().String(), "The response URL should match the expected URL") - }) - } -} - -func TestResponseSaveToFile(t *testing.T) { - // Setup a test server - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, "Where is the money, Lebowski") - })) - - defer server.Close() - - // Create client and send request - client := Create(&Config{BaseURL: server.URL}) - - resp, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - // Define the path where to save the response body - filePath := "./testdata/sample_response.txt" - - err = resp.Save(filePath) - if err != nil { - t.Fatalf("Failed to save response to file: %v", err) - } - - // Read the saved file - savedData, err := os.ReadFile(filePath) - if err != nil { - t.Fatalf("Failed to read saved file: %v", err) - } - - // Verify the file content - expected := "Where is the money, Lebowski" - if string(savedData) != expected { - t.Errorf("Expected file content %q, got %q", expected, string(savedData)) - } - - // Clean up the saved file - err = os.Remove(filePath) - if err != nil { - t.Fatalf("Failed to remove saved file: %v", err) - } -} - -func TestResponseSaveToWriter(t *testing.T) { - // Setup a test server - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, "You know nothing, John Snow") - })) - defer server.Close() - - // Create client and send request - client := Create(&Config{BaseURL: server.URL}) - - resp, err := client.Get("/").Send(context.Background()) - if err != nil { - t.Fatalf("Failed to send request: %v", err) - } - - // Use bytes.Buffer as the writer - var buffer bytes.Buffer - - err = resp.Save(&buffer) - if err != nil { - t.Fatalf("Failed to save response to buffer: %v", err) - } - - // Verify the buffer content - expected := "You know nothing, John Snow" - if buffer.String() != expected { - t.Errorf("Expected buffer content %q, got %q", expected, buffer.String()) - } -} - -func TestStream(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set(HeaderContentType, "text/event-stream") - - for i := 0; i < 3; i++ { - fmt.Fprintf(w, "data: Message %d\n", i) - w.(http.Flusher).Flush() - time.Sleep(100 * time.Millisecond) - } - })) - - defer server.Close() - - doneCh := make(chan struct{}) - dataReceived := make([]string, 0) - - client := Create(&Config{BaseURL: server.URL}) - _, err := client.Get("/").Stream(func(data []byte) error { - dataReceived = append(dataReceived, string(data)) - - assert.Contains(t, string(data), "data: Message") - return nil - }).StreamErr(func(err error) { - assert.NoError(t, err) - }).StreamDone(func() { - assert.Equal(t, 3, len(dataReceived)) - close(doneCh) - }).Send(context.Background()) - assert.NoError(t, err) - - time.Sleep(1 * time.Second) - <-doneCh - - assert.Equal(t, 3, len(dataReceived)) -} diff --git a/pkg/httpsling/retry.go b/pkg/httpsling/retry.go deleted file mode 100644 index ffbc26b..0000000 --- a/pkg/httpsling/retry.go +++ /dev/null @@ -1,55 +0,0 @@ -package httpsling - -import ( - "math" - "net/http" - "time" -) - -// RetryConfig defines the configuration for retrying requests -type RetryConfig struct { - // MaxRetries is the maximum number of retry attempts - MaxRetries int - // Strategy is the backoff strategy function - Strategy BackoffStrategy - // RetryIf is the custom retry condition function - RetryIf RetryIfFunc -} - -// RetryIfFunc defines the function signature for retry conditions -type RetryIfFunc func(req *http.Request, resp *http.Response, err error) bool - -// BackoffStrategy defines a function that returns the delay before the next retry -type BackoffStrategy func(attempt int) time.Duration - -// DefaultBackoffStrategy provides a simple constant delay between retries -func DefaultBackoffStrategy(delay time.Duration) func(int) time.Duration { - return func(attempt int) time.Duration { - return delay - } -} - -// LinearBackoffStrategy increases the delay linearly with each retry attempt -func LinearBackoffStrategy(initialInterval time.Duration) func(int) time.Duration { - return func(attempt int) time.Duration { - return initialInterval * time.Duration(attempt+1) - } -} - -// ExponentialBackoffStrategy increases the delay exponentially with each retry attempt -func ExponentialBackoffStrategy(initialInterval time.Duration, multiplier float64, maxBackoffTime time.Duration) func(int) time.Duration { - return func(attempt int) time.Duration { - delay := initialInterval * time.Duration(math.Pow(multiplier, float64(attempt))) - - if delay > maxBackoffTime { - return maxBackoffTime - } - - return delay - } -} - -// DefaultRetryIf is a simple retry condition that retries on 5xx status codes -func DefaultRetryIf(req *http.Request, resp *http.Response, err error) bool { - return resp.StatusCode >= http.StatusInternalServerError || err != nil -} diff --git a/pkg/keygen/keygen.go b/pkg/keygen/keygen.go index a2ca1df..77f6fdb 100644 --- a/pkg/keygen/keygen.go +++ b/pkg/keygen/keygen.go @@ -21,7 +21,7 @@ const ( idxmax = 63 / idxbits ) -// Defaults for the length of key IDs and secrets in Datum +// Defaults for the length of key IDs and secrets const ( KeyIDLength = 32 SecretLength = 64 @@ -72,7 +72,7 @@ func generate(n int, chars string) string { cache, remain = CryptoRandInt(), idxmax } - if idx := int(cache & idxmask); idx < len(chars) { + if idx := int(cache & idxmask); idx < len(chars) { // nolint:gosec sb.WriteByte(chars[idx]) i-- diff --git a/pkg/keygen/keygen_test.go b/pkg/keygen/keygen_test.go index fbc5635..f3d0ede 100644 --- a/pkg/keygen/keygen_test.go +++ b/pkg/keygen/keygen_test.go @@ -32,6 +32,7 @@ func TestAlpha(t *testing.T) { val := keygen.Alpha(16) vals[val] = struct{}{} } + require.Len(t, vals, 10000, "there is a very low chance that a duplicate value was generated") } @@ -55,6 +56,7 @@ func TestAlphaNumeric(t *testing.T) { val := keygen.AlphaNumeric(16) vals[val] = struct{}{} } + require.Len(t, vals, 10000, "there is a very low chance that a duplicate value was generated") } @@ -83,6 +85,7 @@ func TestCryptoRandInt(t *testing.T) { val := keygen.CryptoRandInt() nums[val] = struct{}{} } + require.Len(t, nums, 10000, "there is a very low chance that a duplicate value was generated") } diff --git a/pkg/middleware/auth/auth.go b/pkg/middleware/auth/auth.go new file mode 100644 index 0000000..8cfd01d --- /dev/null +++ b/pkg/middleware/auth/auth.go @@ -0,0 +1,278 @@ +package auth + +import ( + "context" + "errors" + "fmt" + "time" + + echo "github.com/theopenlane/echox" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/apitoken" + "github.com/theopenlane/core/internal/ent/generated/personalaccesstoken" + "github.com/theopenlane/core/internal/ent/generated/privacy" + "github.com/theopenlane/core/pkg/auth" + api "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/tokens" +) + +// SessionSkipperFunc is the function that determines if the session check should be skipped +// due to the request being a PAT or API Token auth request +var SessionSkipperFunc = func(c echo.Context) bool { + return auth.GetAuthTypeFromEchoContext(c) != auth.JWTAuthentication +} + +// Authenticate is a middleware function that is used to authenticate requests - it is not applied to all routes so be cognizant of that +func Authenticate(conf *AuthOptions) echo.MiddlewareFunc { + return func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + // if skipper function returns true, skip this middleware + if conf.Skipper(c) { + return next(c) + } + + // execute any before functions + if conf.BeforeFunc != nil { + conf.BeforeFunc(c) + } + + validator, err := conf.Validator() + if err != nil { + return err + } + + // Create a reauthenticator function to handle refresh tokens if they are provided. + reauthenticate := Reauthenticate(conf, validator) + + // Get access token from the request, if not available then attempt to refresh + // using the refresh token cookie. + accessToken, err := auth.GetAccessToken(c) + if err != nil { + switch { + case errors.Is(err, ErrNoAuthorization): + if accessToken, err = reauthenticate(c); err != nil { + return rout.HTTPErrorResponse(err) + } + default: + return rout.HTTPErrorResponse(err) + } + } + + // verify the access token is authorized for use and extract claims. + authType := auth.JWTAuthentication + + var ( + au *auth.AuthenticatedUser + id string + ) + + claims, err := validator.Verify(accessToken) + + if err != nil { + // if its not a JWT, check to see if its a PAT or API Token + if conf.DBClient == nil { + return rout.HTTPErrorResponse(rout.ErrInvalidCredentials) + } + + au, id, err = checkToken(c.Request().Context(), conf, accessToken) + if err != nil { + return rout.HTTPErrorResponse(rout.ErrInvalidCredentials) + } + } else { + // Add claims to context for use in downstream processing and continue handlers + au, err = createAuthenticatedUserFromClaims(c.Request().Context(), conf.DBClient, claims, authType) + if err != nil { + return rout.HTTPErrorResponse(rout.ErrInvalidCredentials) + } + + auth.SetAccessTokenContext(c, accessToken) + } + + auth.SetAuthenticatedUserContext(c, au) + + if err := updateLastUsed(c.Request().Context(), conf.DBClient, au, id); err != nil { + return rout.HTTPErrorResponse(rout.ErrInvalidCredentials) + } + + return next(c) + } + } +} + +// updateLastUsed updates the last used time for the token depending on the authentication type +func updateLastUsed(ctx context.Context, dbClient *generated.Client, au *auth.AuthenticatedUser, tokenID string) error { + switch au.AuthenticationType { + case auth.PATAuthentication: + // allow the request, we know the user has access to the token, no need to check + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + if err := dbClient.PersonalAccessToken.UpdateOneID(tokenID).SetLastUsedAt(time.Now()).Exec(allowCtx); err != nil { + return err + } + case auth.APITokenAuthentication: + // allow the request, we know the user has access to the token, no need to check + allowCtx := privacy.DecisionContext(ctx, privacy.Allow) + if err := dbClient.APIToken.UpdateOneID(tokenID).SetLastUsedAt(time.Now()).Exec(allowCtx); err != nil { + return err + } + } + + return nil +} + +// Reauthenticate is a middleware helper that can use refresh tokens in the echo context +// to obtain a new access token. If it is unable to obtain a new valid access token, +// then an error is returned and processing should stop. +func Reauthenticate(conf *AuthOptions, validator tokens.Validator) func(c echo.Context) (string, error) { + // If no reauthenticator is available on the configuration, always return an error. + if conf.reauth == nil { + return func(c echo.Context) (string, error) { + return "", ErrRefreshDisabled + } + } + + // If the reauthenticator is available, return a function that utilizes it. + return func(c echo.Context) (string, error) { + // Get the refresh token from the cookies or the headers of the request. + refreshToken, err := auth.GetRefreshToken(c) + if err != nil { + return "", err + } + + // Check to ensure the refresh token is still valid. + if _, err = validator.Verify(refreshToken); err != nil { + return "", err + } + + // Reauthenticate using the refresh token. + req := &api.RefreshRequest{RefreshToken: refreshToken} + + reply, err := conf.reauth.Refresh(c.Request().Context(), req) + if err != nil { + return "", err + } + + // Set the new access and refresh cookies + auth.SetAuthCookies(c.Response().Writer, reply.AccessToken, reply.RefreshToken, *conf.CookieConfig) + + return reply.AccessToken, nil + } +} + +// createAuthenticatedUserFromClaims creates an authenticated user from the claims provided +func createAuthenticatedUserFromClaims(ctx context.Context, dbClient *generated.Client, claims *tokens.Claims, authType auth.AuthenticationType) (*auth.AuthenticatedUser, error) { + // get the user ID from the claims + user, err := dbClient.User.Get(ctx, claims.UserID) + if err != nil { + return nil, err + } + + // all the query to get the organization, need to bypass the authz filter to get the org + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + org, err := dbClient.Organization.Get(ctx, claims.OrgID) + if err != nil { + return nil, err + } + + return &auth.AuthenticatedUser{ + SubjectID: user.ID, + SubjectName: getSubjectName(user), + OrganizationID: org.ID, + OrganizationName: org.Name, + OrganizationIDs: []string{org.ID}, + AuthenticationType: authType, + }, nil +} + +// checkToken checks the bearer authorization token against the database to see if the provided +// token is an active personal access token or api token. +// If the token is valid, the authenticated user is returned +func checkToken(ctx context.Context, conf *AuthOptions, token string) (*auth.AuthenticatedUser, string, error) { + // allow check to bypass privacy rules + ctx = privacy.DecisionContext(ctx, privacy.Allow) + + // check if the token is a personal access token + au, id, err := isValidPersonalAccessToken(ctx, conf.DBClient, token) + if err == nil { + return au, id, nil + } + + // check if the token is an API token + au, id, err = isValidAPIToken(ctx, conf.DBClient, token) + if err == nil { + return au, id, nil + } + + return nil, "", err +} + +// isValidPersonalAccessToken checks if the provided token is a valid personal access token and returns the authenticated user +func isValidPersonalAccessToken(ctx context.Context, dbClient *generated.Client, token string) (*auth.AuthenticatedUser, string, error) { + pat, err := dbClient.PersonalAccessToken.Query().Where(personalaccesstoken.Token(token)). + WithOwner(). + WithOrganizations(). + Only(ctx) + if err != nil { + return nil, "", err + } + + // check if the token has expired + if pat.ExpiresAt != nil && pat.ExpiresAt.Before(time.Now()) { + return nil, "", rout.ErrExpiredCredentials + } + + // gather the authorized organization IDs + var orgIDs []string + + orgs := pat.Edges.Organizations + + if len(orgs) == 0 { + // an access token must have at least one organization to be used + return nil, "", rout.ErrInvalidCredentials + } + + for _, org := range orgs { + orgIDs = append(orgIDs, org.ID) + } + + return &auth.AuthenticatedUser{ + SubjectID: pat.OwnerID, + SubjectName: getSubjectName(pat.Edges.Owner), + OrganizationIDs: orgIDs, + AuthenticationType: auth.PATAuthentication, + }, pat.ID, nil +} + +func isValidAPIToken(ctx context.Context, dbClient *generated.Client, token string) (*auth.AuthenticatedUser, string, error) { + t, err := dbClient.APIToken.Query().Where(apitoken.Token(token)). + Only(ctx) + if err != nil { + return nil, "", err + } + + // check if the token has expired + if t.ExpiresAt != nil && t.ExpiresAt.Before(time.Now()) { + return nil, "", rout.ErrExpiredCredentials + } + + return &auth.AuthenticatedUser{ + SubjectID: t.ID, + SubjectName: fmt.Sprintf("service: %s", t.Name), + OrganizationID: t.OwnerID, + OrganizationIDs: []string{t.OwnerID}, + AuthenticationType: auth.APITokenAuthentication, + }, t.ID, nil +} + +// getSubjectName returns the subject name for the user +func getSubjectName(user *generated.User) string { + subjectName := user.FirstName + " " + user.LastName + if subjectName == "" { + subjectName = user.DisplayName + } + + return subjectName +} diff --git a/pkg/middleware/auth/authoptions.go b/pkg/middleware/auth/authoptions.go new file mode 100644 index 0000000..dbcaf0c --- /dev/null +++ b/pkg/middleware/auth/authoptions.go @@ -0,0 +1,235 @@ +package auth + +import ( + "context" + "time" + + "github.com/lestrrat-go/jwx/v2/jwk" + "github.com/theopenlane/echox/middleware" + + ent "github.com/theopenlane/core/internal/ent/generated" + api "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/core/pkg/tokens" +) + +// AuthOption allows users to optionally supply configuration to the Authorization middleware. +type AuthOption func(opts *AuthOptions) + +// AuthOptions is constructed from variadic AuthOption arguments with reasonable defaults. +type AuthOptions struct { + // KeysURL endpoint to the JWKS public keys on the server + KeysURL string `default:"http://localhost:17608/.well-known/jwks.json"` + // Audience to verify on tokens + Audience string `default:"http://localhost:17608"` + // Issuer to verify on tokens + Issuer string `default:"http://localhost:17608"` + // MinRefreshInterval to cache the JWKS public keys + MinRefreshInterval time.Duration `default:"5m"` + // Context to control the lifecycle of the background fetch routine + Context context.Context + + // CookieConfig to set the cookie configuration for the auth middleware + CookieConfig *sessions.CookieConfig + + // validator constructed by the auth options (can be directly supplied by the user). + validator tokens.Validator + // reauth constructed by the auth options (can be directly supplied by the user). + reauth Reauthenticator + + // Skipper defines a function to skip middleware + Skipper middleware.Skipper + // BeforeFunc defines a function which is executed just before the middleware + BeforeFunc middleware.BeforeFunc + + // Used to check other auth types like personal access tokens + DBClient *ent.Client +} + +// Reauthenticator generates new access and refresh pair given a valid refresh token. +type Reauthenticator interface { + Refresh(context.Context, *api.RefreshRequest) (*api.LoginReply, error) +} + +var DefaultAuthOptions = AuthOptions{ + KeysURL: "http://localhost:17608/.well-known/jwks.json", + Audience: "http://localhost:17608", + Issuer: "http://localhost:17608", + MinRefreshInterval: 5 * time.Minute, //nolint:mnd + Skipper: middleware.DefaultSkipper, + CookieConfig: sessions.DefaultCookieConfig, +} + +// NewAuthOptions creates an AuthOptions object with reasonable defaults and any user +// supplied input from the AuthOption variadic arguments. +func NewAuthOptions(opts ...AuthOption) (conf AuthOptions) { + conf = DefaultAuthOptions + + for _, opt := range opts { + opt(&conf) + } + + // Create a context if one has not been supplied by the user. + if conf.Context == nil && conf.validator == nil { + conf.Context = context.Background() + } + + return conf +} + +// Validator returns the user supplied validator or constructs a new JWKS Cache +// Validator from the supplied options. If the options are invalid or the validator +// cannot be created an error is returned +func (conf *AuthOptions) Validator() (tokens.Validator, error) { + if conf.validator != nil { + return conf.validator, nil + } + + cache := jwk.NewCache(conf.Context) + + err := cache.Register(conf.KeysURL, jwk.WithMinRefreshInterval(conf.MinRefreshInterval)) + if err != nil { + return nil, ErrUnableToConstructValidator + } + + conf.validator, err = tokens.NewCachedJWKSValidator(conf.Context, cache, conf.KeysURL, conf.Audience, conf.Issuer) + if err != nil { + return nil, err + } + + return conf.validator, nil +} + +// WithLocalValidator returns a new JWKS Validator constructed from the supplied options using +// the local keys instead of fetching them from the server +func (conf *AuthOptions) WithLocalValidator() error { + if conf.validator != nil { + return nil + } + + cache := jwk.NewCache(conf.Context) + + if err := cache.Register(conf.KeysURL, jwk.WithMinRefreshInterval(conf.MinRefreshInterval)); err != nil { + return ErrUnableToConstructValidator + } + + keys, err := conf.DBClient.TokenManager.Keys() + if err != nil { + return err + } + + conf.validator = tokens.NewJWKSValidator(keys, conf.Audience, conf.Issuer) + + return nil +} + +// WithAuthOptions allows the user to update the default auth options with an auth +// options struct to set many options values at once. Zero values are ignored, so if +// using this option, the defaults will still be preserved if not set on the input. +func WithAuthOptions(opts AuthOptions) AuthOption { + return func(conf *AuthOptions) { + if opts.KeysURL != "" { + conf.KeysURL = opts.KeysURL + } + + if opts.Audience != "" { + conf.Audience = opts.Audience + } + + if opts.Issuer != "" { + conf.Issuer = opts.Issuer + } + + if opts.MinRefreshInterval != 0 { + conf.MinRefreshInterval = opts.MinRefreshInterval + } + + if opts.Context != nil { + conf.Context = opts.Context + } + } +} + +// WithJWKSEndpoint allows the user to specify an alternative endpoint to fetch the JWKS +// public keys from. This is useful for testing or for different environments. +func WithJWKSEndpoint(url string) AuthOption { + return func(opts *AuthOptions) { + opts.KeysURL = url + } +} + +// WithAudience allows the user to specify an alternative audience. +func WithAudience(audience string) AuthOption { + return func(opts *AuthOptions) { + opts.Audience = audience + } +} + +// WithIssuer allows the user to specify an alternative issuer. +func WithIssuer(issuer string) AuthOption { + return func(opts *AuthOptions) { + opts.Issuer = issuer + } +} + +// WithMinRefreshInterval allows the user to specify an alternative minimum duration +// between cache refreshes to control refresh behavior for the JWKS public keys. +func WithMinRefreshInterval(interval time.Duration) AuthOption { + return func(opts *AuthOptions) { + opts.MinRefreshInterval = interval + } +} + +// WithContext allows the user to specify an external, cancelable context to control +// the background refresh behavior of the JWKS cache. +func WithContext(ctx context.Context) AuthOption { + return func(opts *AuthOptions) { + opts.Context = ctx + } +} + +// WithValidator allows the user to specify an alternative validator to the auth +// middleware. This is particularly useful for testing authentication. +func WithValidator(validator tokens.Validator) AuthOption { + return func(opts *AuthOptions) { + opts.validator = validator + } +} + +// WithReauthenticator allows the user to specify a reauthenticator to the auth +// middleware. +func WithReauthenticator(reauth Reauthenticator) AuthOption { + return func(opts *AuthOptions) { + opts.reauth = reauth + } +} + +// WithSkipperFunc allows the user to specify a skipper function for the middleware +func WithSkipperFunc(skipper middleware.Skipper) AuthOption { + return func(opts *AuthOptions) { + opts.Skipper = skipper + } +} + +// WithBeforeFunc allows the user to specify a function to happen before the auth middleware +func WithBeforeFunc(before middleware.BeforeFunc) AuthOption { + return func(opts *AuthOptions) { + opts.BeforeFunc = before + } +} + +// WithDBClient is a function that returns an AuthOption function which sets the DBClient field of AuthOptions. +// The DBClient field is used to specify the database client to be to check authentication with personal access tokens. +func WithDBClient(client *ent.Client) AuthOption { + return func(opts *AuthOptions) { + opts.DBClient = client + } +} + +// WithCookieConfig allows the user to specify a cookie configuration for the auth middleware +// in order to override the default cookie configuration. +func WithCookieConfig(cookieConfig *sessions.CookieConfig) AuthOption { + return func(opts *AuthOptions) { + opts.CookieConfig = cookieConfig + } +} diff --git a/pkg/middleware/auth/authoptions_test.go b/pkg/middleware/auth/authoptions_test.go new file mode 100644 index 0000000..817621a --- /dev/null +++ b/pkg/middleware/auth/authoptions_test.go @@ -0,0 +1,79 @@ +package auth_test + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/theopenlane/core/pkg/middleware/auth" + "github.com/theopenlane/core/pkg/tokens" +) + +func TestDefaultAuthOptions(t *testing.T) { + // Should be able to create a default auth options with no extra input. + conf := auth.NewAuthOptions() + require.NotZero(t, conf, "a zero valued configuration was returned") + require.Equal(t, auth.DefaultAuthOptions.KeysURL, conf.KeysURL) + require.Equal(t, auth.DefaultAuthOptions.Audience, conf.Audience) + require.Equal(t, auth.DefaultAuthOptions.Issuer, conf.Issuer) + require.Equal(t, auth.DefaultAuthOptions.MinRefreshInterval, conf.MinRefreshInterval) + require.NotNil(t, conf.Context, "no context was created") +} + +func TestAuthOptions(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + conf := auth.NewAuthOptions( + auth.WithJWKSEndpoint("http://localhost:8088/.well-known/jwks.json"), + auth.WithAudience("http://localhost:3000"), + auth.WithIssuer("http://localhost:8088"), + auth.WithMinRefreshInterval(67*time.Minute), + auth.WithContext(ctx), + ) + + cancel() + require.NotZero(t, conf, "a zero valued configuration was returned") + require.Equal(t, "http://localhost:8088/.well-known/jwks.json", conf.KeysURL) + require.Equal(t, "http://localhost:3000", conf.Audience) + require.Equal(t, "http://localhost:8088", conf.Issuer) + require.Equal(t, 67*time.Minute, conf.MinRefreshInterval) + require.ErrorIs(t, conf.Context.Err(), context.Canceled) +} + +func TestAuthOptionsOverride(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + opts := auth.AuthOptions{ + KeysURL: "http://localhost:8088/.well-known/jwks.json", + Audience: "http://localhost:3000", + Issuer: "http://localhost:8088", + MinRefreshInterval: 42 * time.Minute, + Context: ctx, + } + + conf := auth.NewAuthOptions( + auth.WithAuthOptions(opts), + ) + + require.NotSame(t, opts, conf, "expected a new configuration object to be created") + assert.Equal(t, opts.KeysURL, conf.KeysURL) + assert.Equal(t, opts.Audience, conf.Audience) + assert.Equal(t, opts.Issuer, conf.Issuer) + assert.Equal(t, opts.MinRefreshInterval, conf.MinRefreshInterval) + assert.Equal(t, opts.Context, conf.Context) + + // Ensure the context is the same on the configuration + cancel() + require.ErrorIs(t, conf.Context.Err(), context.Canceled) +} + +func TestAuthOptionsValidator(t *testing.T) { + validator := &tokens.MockValidator{} + conf := auth.NewAuthOptions(auth.WithValidator(validator)) + require.NotZero(t, conf, "a zero valued configuration was returned") + + actual, err := conf.Validator() + require.NoError(t, err, "could not create default validator") + require.Same(t, validator, actual, "conf did not return the same validator") +} diff --git a/pkg/middleware/auth/doc.go b/pkg/middleware/auth/doc.go new file mode 100644 index 0000000..cab6146 --- /dev/null +++ b/pkg/middleware/auth/doc.go @@ -0,0 +1,2 @@ +// Package auth handles auth +package auth diff --git a/pkg/middleware/auth/errors.go b/pkg/middleware/auth/errors.go new file mode 100644 index 0000000..5eca81a --- /dev/null +++ b/pkg/middleware/auth/errors.go @@ -0,0 +1,37 @@ +package auth + +import ( + "errors" +) + +var ( + // ErrNoClaims is returned when no claims are found on the request context + ErrNoClaims = errors.New("no claims found on the request context") + + // ErrNoUserInfo is returned when no user info is found on the request context + ErrNoUserInfo = errors.New("no user info found on the request context") + + // ErrUnverifiedUser is returned when the user is not verified + ErrUnverifiedUser = errors.New("user is not verified") + + // ErrParseBearer is returned when the bearer token could not be parsed from the authorization header + ErrParseBearer = errors.New("could not parse bearer token from authorization header") + + // ErrNoAuthorization is returned when no authorization header is found in the request + ErrNoAuthorization = errors.New("no authorization header in request") + + // ErrNoRequest is returned when no request is found on the context + ErrNoRequest = errors.New("no request found on the context") + + // ErrNoRefreshToken is returned when no refresh token is found on the request + ErrNoRefreshToken = errors.New("no refresh token available on request") + + // ErrRefreshDisabled is returned when re-authentication with refresh tokens is disabled + ErrRefreshDisabled = errors.New("re-authentication with refresh tokens disabled") + + // ErrUnableToConstructValidator is returned when the validator cannot be constructed + ErrUnableToConstructValidator = errors.New("unable to construct validator") + + // ErrPasswordTooWeak is returned when the password is too weak + ErrPasswordTooWeak = errors.New("password is too weak: use a combination of upper and lower case letters, numbers, and special characters") +) diff --git a/pkg/middleware/authtest/authtest_test.go b/pkg/middleware/authtest/authtest_test.go index c2329e1..4c3211e 100644 --- a/pkg/middleware/authtest/authtest_test.go +++ b/pkg/middleware/authtest/authtest_test.go @@ -5,9 +5,10 @@ import ( "github.com/stretchr/testify/require" + "github.com/theopenlane/utils/ulids" + authtest "github.com/theopenlane/core/pkg/middleware/authtest" "github.com/theopenlane/core/pkg/tokens" - "github.com/theopenlane/utils/ulids" ) // This test generates an example token with fake RSA keys for use in examples, diff --git a/pkg/middleware/transaction/doc.go b/pkg/middleware/transaction/doc.go new file mode 100644 index 0000000..cc06795 --- /dev/null +++ b/pkg/middleware/transaction/doc.go @@ -0,0 +1,2 @@ +// Package transaction implements a transaction middleware for REST endpoints using the ent db client +package transaction diff --git a/pkg/middleware/transaction/transaction.go b/pkg/middleware/transaction/transaction.go new file mode 100644 index 0000000..2fdfdf4 --- /dev/null +++ b/pkg/middleware/transaction/transaction.go @@ -0,0 +1,80 @@ +package transaction + +import ( + "context" + "errors" + "net/http" + + echo "github.com/theopenlane/echox" + "go.uber.org/zap" + + ent "github.com/theopenlane/core/internal/ent/generated" +) + +const ( + rollbackErr = "error rolling back transaction" + transactionStartErr = "error starting transaction" + transactionCommitErr = "error committing transaction" +) + +var ( + // ErrProcessingRequest is returned when the request cannot be processed + ErrProcessingRequest = errors.New("error processing request, please try again") +) + +type Client struct { + EntDBClient *ent.Client + Logger *zap.SugaredLogger +} + +type entClientCtxKey struct{} + +// FromContext returns a TX Client stored inside a context, or nil if there isn't one +func FromContext(ctx context.Context) *ent.Tx { + c, _ := ctx.Value(entClientCtxKey{}).(*ent.Tx) + return c +} + +// NewContext returns a new context with the given TX Client attached +func NewContext(parent context.Context, c *ent.Tx) context.Context { + return context.WithValue(parent, entClientCtxKey{}, c) +} + +// Middleware returns a middleware function for transactions on REST endpoints +func (d *Client) Middleware(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + client, err := d.EntDBClient.Tx(c.Request().Context()) + if err != nil { + d.Logger.Errorw(transactionStartErr, "error", err) + + return c.JSON(http.StatusInternalServerError, ErrProcessingRequest) + } + + // add to context + ctx := NewContext(c.Request().Context(), client) + + c.SetRequest(c.Request().WithContext(ctx)) + + if err := next(c); err != nil { + d.Logger.Debug("rolling back transaction in middleware") + + if err := client.Rollback(); err != nil { + d.Logger.Errorw(rollbackErr, "error", err) + + return c.JSON(http.StatusInternalServerError, ErrProcessingRequest) + } + + return err + } + + d.Logger.Debug("committing transaction in middleware") + + if err := client.Commit(); err != nil { + d.Logger.Errorw(transactionCommitErr, "error", err) + + return c.JSON(http.StatusInternalServerError, ErrProcessingRequest) + } + + return nil + } +} diff --git a/pkg/models/models.go b/pkg/models/models.go index da1c97f..8a031eb 100644 --- a/pkg/models/models.go +++ b/pkg/models/models.go @@ -5,9 +5,10 @@ import ( "github.com/go-webauthn/webauthn/protocol" - "github.com/theopenlane/core/pkg/passwd" "github.com/theopenlane/utils/rout" "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/pkg/passwd" ) // ========= @@ -170,7 +171,7 @@ var ExampleRegisterSuccessResponse = RegisterReply{ Reply: rout.Reply{Success: true}, ID: "1234", Email: "", - Message: "Welcome to Datum!", + Message: "Welcome to OpenLane!", Token: "", } @@ -565,7 +566,7 @@ var ExampleInviteResponse = InviteReply{ // OAUTH // ========= -// OauthTokenRequest to authenticate an oauth user with the Datum Server +// OauthTokenRequest to authenticate an oauth user with the Server type OauthTokenRequest struct { Name string `json:"name"` Email string `json:"email"` diff --git a/pkg/openlaneclient/client.go b/pkg/openlaneclient/client.go new file mode 100644 index 0000000..734d94b --- /dev/null +++ b/pkg/openlaneclient/client.go @@ -0,0 +1,254 @@ +package openlaneclient + +import ( + "context" + "net/http" + "net/url" + "strings" + "time" + + "golang.org/x/oauth2" + + "github.com/theopenlane/core/pkg/auth" + api "github.com/theopenlane/core/pkg/models" + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/httpsling" +) + +const ( + // cookieExpiryMinutes is the duration for which the cookies are valid + cookieExpiryMinutes = 10 * time.Minute +) + +// OpenLaneClient wraps The OpenLane API client methods to form a single client interface +type OpenLaneClient struct { + OpenLaneRestClient + OpenLaneGraphClient +} + +// A Reauthenticator generates new access and refresh pair given a valid refresh token +type Reauthenticator interface { + Refresh(context.Context, *api.RefreshRequest) (*api.RefreshReply, error) +} + +// NewWithDefaults creates a new API v1 client with default configuration +func NewWithDefaults(opts ...ClientOption) (*OpenLaneClient, error) { + config := NewDefaultConfig() + + return New(config, opts...) +} + +// New creates a new API v1 client that implements the Client interface +func New(config Config, opts ...ClientOption) (*OpenLaneClient, error) { + // configure rest client + c, err := NewRestClient(config, opts...) + if err != nil { + return nil, err + } + + api := c.(*APIv1) + + // create the graph client + // use api.Config instead of config because some fields are updated in NewRestClient + graphClient := NewClient( + api.HTTPSlingClient.HTTPClient, + graphRequestPath(api.Config), + &api.Config.Clientv2Options, + api.Config.Interceptors..., + ) + + return &OpenLaneClient{ + c, + graphClient, + }, nil +} + +// newHTTPClient creates a new HTTP sling client with the given configuration +func newHTTPClient(config Config) (*httpsling.Client, error) { + // copy the values from the base config to the httpsling config + if config.HTTPSling == nil { + config.HTTPSling = &httpsling.Config{} + } + + if config.HTTPSling.BaseURL == "" { + config.HTTPSling.BaseURL = config.BaseURL.String() + } + + client := httpsling.Create(config.HTTPSling) + + // set the default cookie jar + if err := client.SetDefaultCookieJar(); err != nil { + return nil, err + } + + return client, nil +} + +// APIv1 implements the Client interface and provides methods to interact with the API +type APIv1 struct { + // Config is the configuration for the APIv1 client + Config Config + // HTTPSlingClient is the HTTP client for the APIv1 client + HTTPSlingClient *httpsling.Client +} + +// Config is the configuration for the APIv1 client +func (c *OpenLaneClient) Config() Config { + api := c.OpenLaneRestClient.(*APIv1) + + return api.Config +} + +// HTTPSlingClient is the http client for the APIv1 client +func (c *OpenLaneClient) HTTPSlingClient() *httpsling.Client { + api := c.OpenLaneRestClient.(*APIv1) + + return api.HTTPSlingClient +} + +// AccessToken returns the access token cached on the client or an error if it is not +// available. This method is primarily used for testing but can be used to fetch the +// access token for debugging or inspection if necessary. +func (c *OpenLaneClient) AccessToken() (_ string, err error) { + var cookies []*http.Cookie + + if cookies, err = c.Cookies(); err != nil { + return "", err + } + + for _, cookie := range cookies { + if cookie.Name == auth.AccessTokenCookie { + return cookie.Value, nil + } + } + + return "", err +} + +// RefreshToken returns the refresh token cached on the client or an error if it is not +// available. This method is primarily used for testing but can be used to fetch the +// refresh token for debugging or inspection if necessary. +func (c *OpenLaneClient) RefreshToken() (_ string, err error) { + var cookies []*http.Cookie + + if cookies, err = c.Cookies(); err != nil { + return "", err + } + + for _, cookie := range cookies { + if cookie.Name == auth.RefreshTokenCookie { + return cookie.Value, nil + } + } + + return "", err +} + +// SetAuthTokens is a helper function to set the access and refresh tokens on the +// client cookie jar. +func (c *OpenLaneClient) SetAuthTokens(access, refresh string) error { + if c.HTTPSlingClient().HTTPClient.Jar == nil { + return ErrNoCookieJarSet + } + + // The URL for the cookies + u := c.Config().BaseURL.ResolveReference(&url.URL{Path: "/"}) + + // Set the cookies on the client + cookies := make([]*http.Cookie, 0, 2) //nolint:mnd + if access != "" { + cookies = append(cookies, &http.Cookie{ + Name: auth.AccessTokenCookie, + Value: access, + Expires: time.Now().Add(cookieExpiryMinutes), + HttpOnly: true, + Secure: true, + }) + } + + if refresh != "" { + cookies = append(cookies, &http.Cookie{ + Name: auth.RefreshTokenCookie, + Value: refresh, + Expires: time.Now().Add(cookieExpiryMinutes), + Secure: true, + }) + } + + c.Config().HTTPSling.CookieJar.SetCookies(u, cookies) + + return nil +} + +// ClearAuthTokens clears the access and refresh tokens on the client Jar. +func (c *OpenLaneClient) ClearAuthTokens() { + if cookies, err := c.Cookies(); err == nil { + // Expire the access and refresh cookies. + for _, cookie := range cookies { + switch cookie.Name { + case auth.AccessTokenCookie: + cookie.MaxAge = -1 + case auth.RefreshTokenCookie: + cookie.MaxAge = -1 + } + } + } +} + +// Returns the cookies set from the previous request(s) on the client Jar. +func (c *OpenLaneClient) Cookies() ([]*http.Cookie, error) { + if c.HTTPSlingClient().HTTPClient.Jar == nil { + return nil, ErrNoCookieJarSet + } + + cookies := c.HTTPSlingClient().HTTPClient.Jar.Cookies(c.Config().BaseURL) + + return cookies, nil +} + +// GetSessionFromCookieJar parses the cookie jar for the session cookie +func (c *OpenLaneClient) GetSessionFromCookieJar() (sessionID string, err error) { + cookies, err := c.Cookies() + if err != nil { + return "", err + } + + cookieName := sessions.DefaultCookieName + + // Use the dev cookie when running on localhost + if strings.Contains(c.Config().BaseURL.Host, "localhost") { + cookieName = sessions.DevCookieName + } + + for _, c := range cookies { + if c.Name == cookieName { + return c.Value, nil + } + } + + return "", nil +} + +// GetAuthTokensFromCookieJar gets the access and refresh tokens from the cookie jar +// and returns them as an oauth2.Token if they are set +func (c *OpenLaneClient) GetAuthTokensFromCookieJar() *oauth2.Token { + token := oauth2.Token{} + + if cookies, err := c.Cookies(); err == nil { + for _, cookie := range cookies { + switch cookie.Name { + case auth.AccessTokenCookie: + token.AccessToken = cookie.Value + case auth.RefreshTokenCookie: + token.RefreshToken = cookie.Value + } + } + } + + // return nil if the tokens are not set + if token.AccessToken == "" || token.RefreshToken == "" { + return nil + } + + return &token +} diff --git a/pkg/openlaneclient/config.go b/pkg/openlaneclient/config.go new file mode 100644 index 0000000..8b97ce9 --- /dev/null +++ b/pkg/openlaneclient/config.go @@ -0,0 +1,55 @@ +package openlaneclient + +import ( + "net/http" + "net/url" + + "github.com/Yamashou/gqlgenc/clientv2" + + "github.com/theopenlane/httpsling" +) + +// Config is the configuration for the API client +type Config struct { + // BaseURL is the base URL for the API + BaseURL *url.URL `json:"baseUrl" yaml:"base_url" default:"http://localhost:17608"` + // GraphQLPath is the path to the GraphQL endpoint + GraphQLPath string `json:"graphqlPath" default:"/query"` + // HTTPSling is the configuration for the HTTPSling client + HTTPSling *httpsling.Config + // Interceptors are the request interceptors for the graph client + Interceptors []clientv2.RequestInterceptor + // Credentials are the credentials for the client + Credentials Credentials + // Clientv2Options are the options for the graph client + Clientv2Options clientv2.Options +} + +// graphRequestPath returns the full URL path for the GraphQL endpoint +func graphRequestPath(config Config) string { + baseurl := config.BaseURL.String() + + return baseurl + config.GraphQLPath +} + +// NewDefaultConfig returns a new default configuration for the API client +func NewDefaultConfig() Config { + return defaultClientConfig +} + +var defaultClientConfig = Config{ + BaseURL: &url.URL{ + Scheme: "http", + Host: "localhost:17608", + }, + GraphQLPath: "/query", + HTTPSling: &httpsling.Config{ + Headers: &http.Header{ + "Accept": []string{httpsling.ContentTypeJSONUTF8}, + "Accept-Language": []string{"en-US,en"}, + "Content-Type": []string{httpsling.ContentTypeJSONUTF8}, + }, + }, + Interceptors: []clientv2.RequestInterceptor{}, + Clientv2Options: clientv2.Options{ParseDataAlongWithErrors: false}, +} diff --git a/pkg/openlaneclient/creds.go b/pkg/openlaneclient/creds.go new file mode 100644 index 0000000..0a65e7e --- /dev/null +++ b/pkg/openlaneclient/creds.go @@ -0,0 +1,83 @@ +package openlaneclient + +import ( + "net/http" + "strings" + + "github.com/theopenlane/utils/rout" + + "github.com/theopenlane/core/pkg/sessions" + "github.com/theopenlane/httpsling" +) + +// Credentials provides a basic interface for loading credentials +type Credentials interface { + AccessToken() (string, error) + GetSession() string +} + +// Authorization contains the bearer token and optional session cookie +type Authorization struct { + // BearerToken is the bearer token to be used in the authorization header + // this can be the access token, api token, or personal access token + BearerToken string + // Session is the session cookie to be used in the request + // this is required for requests using the access token + Session string +} + +func NewAuthorization(creds Credentials) (Authorization, error) { + token, err := creds.AccessToken() + if err != nil { + return Authorization{}, err + } + + session := creds.GetSession() + + return Authorization{ + BearerToken: token, + Session: session, + }, nil +} + +// Token implements the credentials interface and performs limited validation +func (a Authorization) AccessToken() (string, error) { + if string(a.BearerToken) == "" { + return "", rout.ErrInvalidCredentials + } + + return a.BearerToken, nil +} + +// Session implements the credentials interface +// session is not always required so no validation is provided +func (a Authorization) GetSession() string { + return a.Session +} + +// SetAuthorizationHeader sets the authorization header on the request if +// not already set +func (a Authorization) SetAuthorizationHeader(req *http.Request) { + h := req.Header.Get(httpsling.HeaderAuthorization) + if h == "" { + // ignore error as we are setting the header + token, _ := a.AccessToken() + + auth := httpsling.BearerAuth{ + Token: token, + } + + auth.Apply(req) + } +} + +// SetSessionCookie sets the session cookie on the request if the session is not empty +func (a Authorization) SetSessionCookie(req *http.Request) { + if a.Session != "" { + if strings.Contains(req.Host, "localhost") { + req.AddCookie(sessions.NewDevSessionCookie(a.GetSession())) + } else { + req.AddCookie(sessions.NewSessionCookie(a.GetSession())) + } + } +} diff --git a/pkg/openlaneclient/doc.go b/pkg/openlaneclient/doc.go new file mode 100644 index 0000000..2d884e8 --- /dev/null +++ b/pkg/openlaneclient/doc.go @@ -0,0 +1,2 @@ +// Package openlaneclient contains the client to interact with the openlane server +package openlaneclient diff --git a/pkg/openlaneclient/errors.go b/pkg/openlaneclient/errors.go new file mode 100644 index 0000000..a3fbb03 --- /dev/null +++ b/pkg/openlaneclient/errors.go @@ -0,0 +1,63 @@ +package openlaneclient + +import ( + "fmt" + "strings" + + "github.com/pkg/errors" +) + +var ( + ErrFailedToGetOauthToken = errors.New("failed to get oauth2 token") + ErrNoCookieJarSet = errors.New("client does not have a cookie jar, cannot set cookies") +) + +// AuthenticationError is returned when a user cannot be authenticated +type AuthenticationError struct { + // StatusCode is the http response code that was returned + StatusCode int + // Body of the response + Body string +} + +// Error returns the AuthenticationError in string format +func (e *AuthenticationError) Error() string { + if e.Body == "" { + return fmt.Sprintf("unable to authenticate (status %d)", e.StatusCode) + } + + return fmt.Sprintf("unable to authenticate (status %d): %s", e.StatusCode, strings.ToLower(e.Body)) +} + +// newAuthenticationError returns an error when authentication fails +func newAuthenticationError(statusCode int, body string) *AuthenticationError { + return &AuthenticationError{ + StatusCode: statusCode, + Body: body, + } +} + +// RequestError is a generic error when a request with the client fails +type RequestError struct { + // StatusCode is the http response code that was returned + StatusCode int + // Body of the response + Body string +} + +// Error returns the RequestError in string format +func (e *RequestError) Error() string { + if e.Body == "" { + return fmt.Sprintf("unable to process request (status %d)", e.StatusCode) + } + + return fmt.Sprintf("unable to process request (status %d): %s", e.StatusCode, strings.ToLower(e.Body)) +} + +// newRequestError returns an error when a client request fails +func newRequestError(statusCode int, body string) *RequestError { + return &RequestError{ + StatusCode: statusCode, + Body: body, + } +} diff --git a/pkg/openlaneclient/graphclient.go b/pkg/openlaneclient/graphclient.go new file mode 100644 index 0000000..9726228 --- /dev/null +++ b/pkg/openlaneclient/graphclient.go @@ -0,0 +1,39577 @@ +// Code generated by github.com/Yamashou/gqlgenc, DO NOT EDIT. + +package openlaneclient + +import ( + "context" + "encoding/json" + "net/http" + "time" + + "github.com/99designs/gqlgen/graphql" + "github.com/Yamashou/gqlgenc/clientv2" + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +type OpenLaneGraphClient interface { + CreateAPIToken(ctx context.Context, input CreateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateAPIToken, error) + UpdateAPIToken(ctx context.Context, updateAPITokenID string, input UpdateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateAPIToken, error) + GetAllAPITokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllAPITokens, error) + GetAPITokenByID(ctx context.Context, apiTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetAPITokenByID, error) + DeleteAPIToken(ctx context.Context, deleteAPITokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteAPIToken, error) + CreateBulkCSVContact(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVContact, error) + CreateBulkContact(ctx context.Context, input []*CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkContact, error) + CreateContact(ctx context.Context, input CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateContact, error) + DeleteContact(ctx context.Context, deleteContactID string, interceptors ...clientv2.RequestInterceptor) (*DeleteContact, error) + GetAllContacts(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContacts, error) + GetContactByID(ctx context.Context, contactID string, interceptors ...clientv2.RequestInterceptor) (*GetContactByID, error) + GetContacts(ctx context.Context, where *ContactWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContacts, error) + UpdateContact(ctx context.Context, updateContactID string, input UpdateContactInput, interceptors ...clientv2.RequestInterceptor) (*UpdateContact, error) + GetAllContactHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContactHistories, error) + GetContactHistories(ctx context.Context, where *ContactHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContactHistories, error) + CreateDocumentData(ctx context.Context, input CreateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*CreateDocumentData, error) + DeleteDocumentData(ctx context.Context, deleteDocumentDataID string, interceptors ...clientv2.RequestInterceptor) (*DeleteDocumentData, error) + GetDocumentDataByID(ctx context.Context, documentDataID string, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataByID, error) + UpdateDocumentData(ctx context.Context, updateDocumentDataID string, input UpdateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*UpdateDocumentData, error) + GetAllDocumentDataHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllDocumentDataHistories, error) + GetDocumentDataHistories(ctx context.Context, where *DocumentDataHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataHistories, error) + CreateBulkCSVEntitlement(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlement, error) + CreateBulkEntitlement(ctx context.Context, input []*CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlement, error) + CreateEntitlement(ctx context.Context, input CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlement, error) + DeleteEntitlement(ctx context.Context, deleteEntitlementID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlement, error) + GetAllEntitlements(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlements, error) + GetEntitlementByID(ctx context.Context, entitlementID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementByID, error) + GetEntitlements(ctx context.Context, where *EntitlementWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlements, error) + UpdateEntitlement(ctx context.Context, updateEntitlementID string, input UpdateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlement, error) + GetAllEntitlementHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementHistories, error) + GetEntitlementHistories(ctx context.Context, where *EntitlementHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementHistories, error) + CreateBulkCSVEntitlementPlan(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlan, error) + CreateBulkEntitlementPlan(ctx context.Context, input []*CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlan, error) + CreateEntitlementPlan(ctx context.Context, input CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlan, error) + DeleteEntitlementPlan(ctx context.Context, deleteEntitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlan, error) + GetAllEntitlementPlans(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlans, error) + GetEntitlementPlanByID(ctx context.Context, entitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanByID, error) + GetEntitlementPlans(ctx context.Context, where *EntitlementPlanWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlans, error) + UpdateEntitlementPlan(ctx context.Context, updateEntitlementPlanID string, input UpdateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlan, error) + GetAllEntitlementPlanFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatures, error) + GetEntitlementPlanFeatureByID(ctx context.Context, entitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureByID, error) + GetEntitlementPlanFeatures(ctx context.Context, where *EntitlementPlanFeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatures, error) + CreateEntitlementPlanFeature(ctx context.Context, input CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlanFeature, error) + CreateBulkCSVEntitlementPlanFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlanFeature, error) + CreateBulkEntitlementPlanFeature(ctx context.Context, input []*CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlanFeature, error) + UpdateEntitlementPlanFeature(ctx context.Context, updateEntitlementPlanFeatureID string, input UpdateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlanFeature, error) + DeleteEntitlementPlanFeature(ctx context.Context, deleteEntitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlanFeature, error) + GetAllEntitlementPlanFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatureHistories, error) + GetEntitlementPlanFeatureHistories(ctx context.Context, where *EntitlementPlanFeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureHistories, error) + GetAllEntitlementPlanHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanHistories, error) + GetEntitlementPlanHistories(ctx context.Context, where *EntitlementPlanHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanHistories, error) + CreateBulkCSVEntity(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntity, error) + CreateBulkEntity(ctx context.Context, input []*CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntity, error) + CreateEntity(ctx context.Context, input CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntity, error) + DeleteEntity(ctx context.Context, deleteEntityID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntity, error) + GetAllEntities(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntities, error) + GetEntities(ctx context.Context, where *EntityWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntities, error) + GetEntityByID(ctx context.Context, entityID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityByID, error) + UpdateEntity(ctx context.Context, updateEntityID string, input UpdateEntityInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntity, error) + GetAllEntityHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityHistories, error) + GetEntityHistories(ctx context.Context, where *EntityHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityHistories, error) + CreateBulkCSVEntityType(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntityType, error) + CreateBulkEntityType(ctx context.Context, input []*CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntityType, error) + CreateEntityType(ctx context.Context, input CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntityType, error) + DeleteEntityType(ctx context.Context, deleteEntityTypeID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntityType, error) + GetAllEntityTypes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypes, error) + GetEntityTypeByID(ctx context.Context, entityTypeID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeByID, error) + GetEntityTypes(ctx context.Context, where *EntityTypeWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypes, error) + UpdateEntityType(ctx context.Context, updateEntityTypeID string, input UpdateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntityType, error) + GetAllEntityTypeHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypeHistories, error) + GetEntityTypeHistories(ctx context.Context, where *EntityTypeHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeHistories, error) + GetEvents(ctx context.Context, where *EventWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEvents, error) + GetEventByID(ctx context.Context, eventID string, interceptors ...clientv2.RequestInterceptor) (*GetEventByID, error) + GetAllEvents(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEvents, error) + CreateEvent(ctx context.Context, input CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateEvent, error) + CreateBulkEvent(ctx context.Context, input []*CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEvent, error) + CreateBulkCSVEvent(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEvent, error) + UpdateEvent(ctx context.Context, updateEventID string, input UpdateEventInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEvent, error) + DeleteEvent(ctx context.Context, deleteEventID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEvent, error) + GetAllEventHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEventHistories, error) + GetEventHistories(ctx context.Context, where *EventHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEventHistories, error) + CreateBulkCSVFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFeature, error) + CreateBulkFeature(ctx context.Context, input []*CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFeature, error) + CreateFeature(ctx context.Context, input CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateFeature, error) + DeleteFeature(ctx context.Context, deleteFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFeature, error) + GetAllFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatures, error) + GetFeatureByID(ctx context.Context, featureID string, interceptors ...clientv2.RequestInterceptor) (*GetFeatureByID, error) + GetFeatures(ctx context.Context, where *FeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatures, error) + UpdateFeature(ctx context.Context, updateFeatureID string, input UpdateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFeature, error) + GetAllFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatureHistories, error) + GetFeatureHistories(ctx context.Context, where *FeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatureHistories, error) + CreateBulkCSVFile(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFile, error) + CreateBulkFile(ctx context.Context, input []*CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFile, error) + CreateFile(ctx context.Context, input CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateFile, error) + DeleteFile(ctx context.Context, deleteFileID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFile, error) + GetAllFiles(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFiles, error) + GetFiles(ctx context.Context, where *FileWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFiles, error) + UpdateFile(ctx context.Context, updateFileID string, input UpdateFileInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFile, error) + GetAllFileHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFileHistories, error) + GetFileHistories(ctx context.Context, where *FileHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFileHistories, error) + CreateBulkCSVGroup(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroup, error) + CreateBulkGroup(ctx context.Context, input []*CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroup, error) + CreateGroup(ctx context.Context, input CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateGroup, error) + DeleteGroup(ctx context.Context, deleteGroupID string, interceptors ...clientv2.RequestInterceptor) (*DeleteGroup, error) + GetAllGroups(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroups, error) + GetGroupByID(ctx context.Context, groupID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupByID, error) + GetGroups(ctx context.Context, where *GroupWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroups, error) + UpdateGroup(ctx context.Context, updateGroupID string, input UpdateGroupInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroup, error) + GetAllGroupHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupHistories, error) + GetGroupHistories(ctx context.Context, where *GroupHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupHistories, error) + AddUserToGroupWithRole(ctx context.Context, input CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToGroupWithRole, error) + CreateBulkCSVGroupMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroupMembers, error) + CreateBulkGroupMembers(ctx context.Context, input []*CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroupMembers, error) + GetGroupMembersByGroupID(ctx context.Context, where *GroupMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembersByGroupID, error) + RemoveUserFromGroup(ctx context.Context, deleteGroupMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromGroup, error) + UpdateUserRoleInGroup(ctx context.Context, updateGroupMemberID string, input UpdateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInGroup, error) + GetAllGroupMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupMembershipHistories, error) + GetGroupMembershipHistories(ctx context.Context, where *GroupMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembershipHistories, error) + GetAllGroupSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettings, error) + GetGroupSettingByID(ctx context.Context, groupSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingByID, error) + GetGroupSettings(ctx context.Context, where GroupSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettings, error) + UpdateGroupSetting(ctx context.Context, updateGroupSettingID string, input UpdateGroupSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroupSetting, error) + GetAllGroupSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettingHistories, error) + GetGroupSettingHistories(ctx context.Context, where *GroupSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingHistories, error) + CreateBulkCSVHush(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVHush, error) + CreateBulkHush(ctx context.Context, input []*CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkHush, error) + CreateHush(ctx context.Context, input CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateHush, error) + GetAllHushes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushes, error) + GetHushByID(ctx context.Context, hushID string, interceptors ...clientv2.RequestInterceptor) (*GetHushByID, error) + GetHushes(ctx context.Context, where *HushWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushes, error) + UpdateHush(ctx context.Context, updateHushID string, input UpdateHushInput, interceptors ...clientv2.RequestInterceptor) (*UpdateHush, error) + GetAllHushHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushHistories, error) + GetHushHistories(ctx context.Context, where *HushHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushHistories, error) + CreateBulkCSVIntegration(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVIntegration, error) + CreateBulkIntegration(ctx context.Context, input []*CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkIntegration, error) + CreateIntegration(ctx context.Context, input CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateIntegration, error) + DeleteIntegration(ctx context.Context, deleteIntegrationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteIntegration, error) + GetAllIntegrations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrations, error) + GetIntegrationByID(ctx context.Context, integrationID string, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationByID, error) + GetIntegrations(ctx context.Context, where *IntegrationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrations, error) + UpdateIntegration(ctx context.Context, updateIntegrationID string, input UpdateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateIntegration, error) + GetAllIntegrationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrationHistories, error) + GetIntegrationHistories(ctx context.Context, where *IntegrationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationHistories, error) + CreateBulkCSVInvite(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVInvite, error) + CreateBulkInvite(ctx context.Context, input []*CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkInvite, error) + CreateInvite(ctx context.Context, input CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateInvite, error) + DeleteInvite(ctx context.Context, deleteInviteID string, interceptors ...clientv2.RequestInterceptor) (*DeleteInvite, error) + GetInviteByID(ctx context.Context, inviteID string, interceptors ...clientv2.RequestInterceptor) (*GetInviteByID, error) + GetAllInvites(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllInvites, error) + InvitesByOrgID(ctx context.Context, where *InviteWhereInput, interceptors ...clientv2.RequestInterceptor) (*InvitesByOrgID, error) + GetAllNoteHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllNoteHistories, error) + GetNoteHistories(ctx context.Context, where *NoteHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetNoteHistories, error) + GetAllOauthProviderHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOauthProviderHistories, error) + GetOauthProviderHistories(ctx context.Context, where *OauthProviderHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOauthProviderHistories, error) + CreateBulkCSVOhAuthTooToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOhAuthTooToken, error) + CreateBulkOhAuthTooToken(ctx context.Context, input []*CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOhAuthTooToken, error) + CreateOhAuthTooToken(ctx context.Context, input CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateOhAuthTooToken, error) + DeleteOhAuthTooToken(ctx context.Context, deleteOhAuthTooTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOhAuthTooToken, error) + GetOhAuthTooTokens(ctx context.Context, where *OhAuthTooTokenWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOhAuthTooTokens, error) + UpdateOhAuthTooToken(ctx context.Context, updateOhAuthTooTokenID string, input UpdateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOhAuthTooToken, error) + CreateBulkCSVOrganization(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrganization, error) + CreateBulkOrganization(ctx context.Context, input []*CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrganization, error) + CreateOrganization(ctx context.Context, input CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateOrganization, error) + DeleteOrganization(ctx context.Context, deleteOrganizationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOrganization, error) + GetAllOrganizations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizations, error) + GetOrganizationByID(ctx context.Context, organizationID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationByID, error) + GetOrganizations(ctx context.Context, where *OrganizationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizations, error) + UpdateOrganization(ctx context.Context, updateOrganizationID string, input UpdateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganization, error) + GetAllOrganizationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationHistories, error) + GetOrganizationHistories(ctx context.Context, where *OrganizationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationHistories, error) + GetAllOrganizationSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettings, error) + GetOrganizationSettingByID(ctx context.Context, organizationSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingByID, error) + GetOrganizationSettings(ctx context.Context, where OrganizationSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettings, error) + UpdateOrganizationSetting(ctx context.Context, updateOrganizationSettingID string, input UpdateOrganizationSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganizationSetting, error) + GetAllOrganizationSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettingHistories, error) + GetOrganizationSettingHistories(ctx context.Context, where *OrganizationSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingHistories, error) + AddUserToOrgWithRole(ctx context.Context, input CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToOrgWithRole, error) + CreateBulkCSVOrgMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrgMembers, error) + CreateBulkOrgMembers(ctx context.Context, input []*CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrgMembers, error) + GetOrgMembersByOrgID(ctx context.Context, where *OrgMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembersByOrgID, error) + RemoveUserFromOrg(ctx context.Context, deleteOrgMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromOrg, error) + UpdateUserRoleInOrg(ctx context.Context, updateOrgMemberID string, input UpdateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInOrg, error) + GetAllOrgMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrgMembershipHistories, error) + GetOrgMembershipHistories(ctx context.Context, where *OrgMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembershipHistories, error) + CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVPersonalAccessToken, error) + CreateBulkPersonalAccessToken(ctx context.Context, input []*CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkPersonalAccessToken, error) + CreatePersonalAccessToken(ctx context.Context, input CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreatePersonalAccessToken, error) + DeletePersonalAccessToken(ctx context.Context, deletePersonalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeletePersonalAccessToken, error) + GetAllPersonalAccessTokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllPersonalAccessTokens, error) + GetPersonalAccessTokenByID(ctx context.Context, personalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetPersonalAccessTokenByID, error) + UpdatePersonalAccessToken(ctx context.Context, updatePersonalAccessTokenID string, input UpdatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdatePersonalAccessToken, error) + Search(ctx context.Context, query string, interceptors ...clientv2.RequestInterceptor) (*Search, error) + CreateBulkCSVSubscriber(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVSubscriber, error) + CreateBulkSubscriber(ctx context.Context, input []*CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkSubscriber, error) + CreateSubscriber(ctx context.Context, input CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateSubscriber, error) + DeleteSubscriber(ctx context.Context, deleteSubscriberEmail string, subscriberOrganization *string, interceptors ...clientv2.RequestInterceptor) (*DeleteSubscriber, error) + GetAllSubscribers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllSubscribers, error) + GetSubscriberByEmail(ctx context.Context, email string, interceptors ...clientv2.RequestInterceptor) (*GetSubscriberByEmail, error) + GetSubscribers(ctx context.Context, where *SubscriberWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetSubscribers, error) + UpdateSubscriber(ctx context.Context, email string, input UpdateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*UpdateSubscriber, error) + CreateBulkCSVTemplate(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVTemplate, error) + CreateBulkTemplate(ctx context.Context, input []*CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkTemplate, error) + CreateTemplate(ctx context.Context, input CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateTemplate, error) + GetAllTemplates(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplates, error) + GetTemplateByID(ctx context.Context, getTemplateID string, interceptors ...clientv2.RequestInterceptor) (*GetTemplateByID, error) + UpdateTemplate(ctx context.Context, updateTemplateID string, input UpdateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTemplate, error) + GetAllTemplateHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplateHistories, error) + GetTemplateHistories(ctx context.Context, where *TemplateHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetTemplateHistories, error) + CreateTFASetting(ctx context.Context, input CreateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*CreateTFASetting, error) + GetAllTFASettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTFASettings, error) + GetTFASetting(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetTFASetting, error) + UpdateTFASetting(ctx context.Context, input UpdateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTFASetting, error) + CreateUser(ctx context.Context, input CreateUserInput, interceptors ...clientv2.RequestInterceptor) (*CreateUser, error) + DeleteUser(ctx context.Context, deleteUserID string, interceptors ...clientv2.RequestInterceptor) (*DeleteUser, error) + GetAllUsers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUsers, error) + GetUserByID(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByID, error) + GetUserByIDWithOrgs(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByIDWithOrgs, error) + UpdateUser(ctx context.Context, updateUserID string, input UpdateUserInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUser, error) + GetAllUserHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserHistories, error) + GetUserHistories(ctx context.Context, where *UserHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserHistories, error) + GetAllUserSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettings, error) + GetUserSettingByID(ctx context.Context, userSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingByID, error) + GetUserSettings(ctx context.Context, where UserSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettings, error) + UpdateUserSetting(ctx context.Context, updateUserSettingID string, input UpdateUserSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserSetting, error) + GetAllUserSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettingHistories, error) + GetUserSettingHistories(ctx context.Context, where *UserSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingHistories, error) + GetWebhookByID(ctx context.Context, webhookID string, interceptors ...clientv2.RequestInterceptor) (*GetWebhookByID, error) + GetAllWebhooks(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhooks, error) + CreateWebhook(ctx context.Context, input CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateWebhook, error) + CreateBulkWebhook(ctx context.Context, input []*CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkWebhook, error) + CreateBulkCSVWebhook(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVWebhook, error) + UpdateWebhook(ctx context.Context, updateWebhookID string, input UpdateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*UpdateWebhook, error) + DeleteWebhook(ctx context.Context, deleteWebhookID string, interceptors ...clientv2.RequestInterceptor) (*DeleteWebhook, error) + GetAllWebhookHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhookHistories, error) + GetWebhookHistories(ctx context.Context, where *WebhookHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetWebhookHistories, error) +} + +type Client struct { + Client *clientv2.Client +} + +func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) OpenLaneGraphClient { + return &Client{Client: clientv2.NewClient(cli, baseURL, options, interceptors...)} +} + +type CreateAPIToken_CreateAPIToken_APIToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateAPIToken_CreateAPIToken_APIToken_Owner) GetID() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken_Owner{} + } + return t.ID +} + +type CreateAPIToken_CreateAPIToken_APIToken struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *CreateAPIToken_CreateAPIToken_APIToken_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetID() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.ID +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetToken() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Token +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetScopes() []string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Scopes +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetOwner() *CreateAPIToken_CreateAPIToken_APIToken_Owner { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Owner +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.CreatedAt +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.UpdatedAt +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetCreatedBy() *string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.CreatedBy +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetUpdatedBy() *string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.UpdatedBy +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetName() string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Name +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.ExpiresAt +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetDescription() *string { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.Description +} +func (t *CreateAPIToken_CreateAPIToken_APIToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreateAPIToken_CreateAPIToken_APIToken{} + } + return t.LastUsedAt +} + +type CreateAPIToken_CreateAPIToken struct { + APIToken CreateAPIToken_CreateAPIToken_APIToken "json:\"apiToken\" graphql:\"apiToken\"" +} + +func (t *CreateAPIToken_CreateAPIToken) GetAPIToken() *CreateAPIToken_CreateAPIToken_APIToken { + if t == nil { + t = &CreateAPIToken_CreateAPIToken{} + } + return &t.APIToken +} + +type UpdateAPIToken_UpdateAPIToken_APIToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateAPIToken_UpdateAPIToken_APIToken_Owner) GetID() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken_Owner{} + } + return t.ID +} + +type UpdateAPIToken_UpdateAPIToken_APIToken struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *UpdateAPIToken_UpdateAPIToken_APIToken_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetID() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.ID +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetToken() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Token +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetScopes() []string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Scopes +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetOwner() *UpdateAPIToken_UpdateAPIToken_APIToken_Owner { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Owner +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.CreatedAt +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.UpdatedAt +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetCreatedBy() *string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.CreatedBy +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetUpdatedBy() *string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.UpdatedBy +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetName() string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Name +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetExpiresAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.ExpiresAt +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetDescription() *string { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.Description +} +func (t *UpdateAPIToken_UpdateAPIToken_APIToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken_APIToken{} + } + return t.LastUsedAt +} + +type UpdateAPIToken_UpdateAPIToken struct { + APIToken UpdateAPIToken_UpdateAPIToken_APIToken "json:\"apiToken\" graphql:\"apiToken\"" +} + +func (t *UpdateAPIToken_UpdateAPIToken) GetAPIToken() *UpdateAPIToken_UpdateAPIToken_APIToken { + if t == nil { + t = &UpdateAPIToken_UpdateAPIToken{} + } + return &t.APIToken +} + +type GetAllAPITokens_APITokens_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllAPITokens_APITokens_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllAPITokens_APITokens_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *GetAllAPITokens_APITokens_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *GetAllAPITokens_APITokens_Edges_Node) GetID() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.ID +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetToken() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Token +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetScopes() []string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Scopes +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetOwner() *GetAllAPITokens_APITokens_Edges_Node_Owner { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Owner +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetName() string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Name +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.Description +} +func (t *GetAllAPITokens_APITokens_Edges_Node) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges_Node{} + } + return t.LastUsedAt +} + +type GetAllAPITokens_APITokens_Edges struct { + Node *GetAllAPITokens_APITokens_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllAPITokens_APITokens_Edges) GetNode() *GetAllAPITokens_APITokens_Edges_Node { + if t == nil { + t = &GetAllAPITokens_APITokens_Edges{} + } + return t.Node +} + +type GetAllAPITokens_APITokens struct { + Edges []*GetAllAPITokens_APITokens_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllAPITokens_APITokens) GetEdges() []*GetAllAPITokens_APITokens_Edges { + if t == nil { + t = &GetAllAPITokens_APITokens{} + } + return t.Edges +} + +type GetAPITokenByID_APIToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAPITokenByID_APIToken_Owner) GetID() string { + if t == nil { + t = &GetAPITokenByID_APIToken_Owner{} + } + return t.ID +} + +type GetAPITokenByID_APIToken struct { + ID string "json:\"id\" graphql:\"id\"" + Token string "json:\"token\" graphql:\"token\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Owner *GetAPITokenByID_APIToken_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Name string "json:\"name\" graphql:\"name\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" +} + +func (t *GetAPITokenByID_APIToken) GetID() string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.ID +} +func (t *GetAPITokenByID_APIToken) GetToken() string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Token +} +func (t *GetAPITokenByID_APIToken) GetScopes() []string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Scopes +} +func (t *GetAPITokenByID_APIToken) GetOwner() *GetAPITokenByID_APIToken_Owner { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Owner +} +func (t *GetAPITokenByID_APIToken) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.CreatedAt +} +func (t *GetAPITokenByID_APIToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.UpdatedAt +} +func (t *GetAPITokenByID_APIToken) GetCreatedBy() *string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.CreatedBy +} +func (t *GetAPITokenByID_APIToken) GetUpdatedBy() *string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.UpdatedBy +} +func (t *GetAPITokenByID_APIToken) GetName() string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Name +} +func (t *GetAPITokenByID_APIToken) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.ExpiresAt +} +func (t *GetAPITokenByID_APIToken) GetDescription() *string { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.Description +} +func (t *GetAPITokenByID_APIToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetAPITokenByID_APIToken{} + } + return t.LastUsedAt +} + +type DeleteAPIToken_DeleteAPIToken struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteAPIToken_DeleteAPIToken) GetDeletedID() string { + if t == nil { + t = &DeleteAPIToken_DeleteAPIToken{} + } + return t.DeletedID +} + +type CreateBulkCSVContact_CreateBulkCSVContact_Contacts struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetAddress() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Address +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetCompany() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Company +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.CreatedAt +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.CreatedBy +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetEmail() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Email +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetFullName() string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.FullName +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetID() string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.ID +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.OwnerID +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetPhoneNumber() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.PhoneNumber +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return &t.Status +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetTags() []string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Tags +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetTitle() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.Title +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVContact_CreateBulkCSVContact_Contacts) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact_Contacts{} + } + return t.UpdatedBy +} + +type CreateBulkCSVContact_CreateBulkCSVContact struct { + Contacts []*CreateBulkCSVContact_CreateBulkCSVContact_Contacts "json:\"contacts,omitempty\" graphql:\"contacts\"" +} + +func (t *CreateBulkCSVContact_CreateBulkCSVContact) GetContacts() []*CreateBulkCSVContact_CreateBulkCSVContact_Contacts { + if t == nil { + t = &CreateBulkCSVContact_CreateBulkCSVContact{} + } + return t.Contacts +} + +type CreateBulkContact_CreateBulkContact_Contacts struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetAddress() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Address +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetCompany() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Company +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.CreatedAt +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.CreatedBy +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetEmail() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Email +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetFullName() string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.FullName +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetID() string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.ID +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetOwnerID() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.OwnerID +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetPhoneNumber() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.PhoneNumber +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return &t.Status +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetTags() []string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Tags +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetTitle() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.Title +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.UpdatedAt +} +func (t *CreateBulkContact_CreateBulkContact_Contacts) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkContact_CreateBulkContact_Contacts{} + } + return t.UpdatedBy +} + +type CreateBulkContact_CreateBulkContact struct { + Contacts []*CreateBulkContact_CreateBulkContact_Contacts "json:\"contacts,omitempty\" graphql:\"contacts\"" +} + +func (t *CreateBulkContact_CreateBulkContact) GetContacts() []*CreateBulkContact_CreateBulkContact_Contacts { + if t == nil { + t = &CreateBulkContact_CreateBulkContact{} + } + return t.Contacts +} + +type CreateContact_CreateContact_Contact struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateContact_CreateContact_Contact) GetAddress() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Address +} +func (t *CreateContact_CreateContact_Contact) GetCompany() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Company +} +func (t *CreateContact_CreateContact_Contact) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.CreatedAt +} +func (t *CreateContact_CreateContact_Contact) GetCreatedBy() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.CreatedBy +} +func (t *CreateContact_CreateContact_Contact) GetEmail() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Email +} +func (t *CreateContact_CreateContact_Contact) GetFullName() string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.FullName +} +func (t *CreateContact_CreateContact_Contact) GetID() string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.ID +} +func (t *CreateContact_CreateContact_Contact) GetOwnerID() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.OwnerID +} +func (t *CreateContact_CreateContact_Contact) GetPhoneNumber() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.PhoneNumber +} +func (t *CreateContact_CreateContact_Contact) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return &t.Status +} +func (t *CreateContact_CreateContact_Contact) GetTags() []string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Tags +} +func (t *CreateContact_CreateContact_Contact) GetTitle() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.Title +} +func (t *CreateContact_CreateContact_Contact) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.UpdatedAt +} +func (t *CreateContact_CreateContact_Contact) GetUpdatedBy() *string { + if t == nil { + t = &CreateContact_CreateContact_Contact{} + } + return t.UpdatedBy +} + +type CreateContact_CreateContact struct { + Contact CreateContact_CreateContact_Contact "json:\"contact\" graphql:\"contact\"" +} + +func (t *CreateContact_CreateContact) GetContact() *CreateContact_CreateContact_Contact { + if t == nil { + t = &CreateContact_CreateContact{} + } + return &t.Contact +} + +type DeleteContact_DeleteContact struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteContact_DeleteContact) GetDeletedID() string { + if t == nil { + t = &DeleteContact_DeleteContact{} + } + return t.DeletedID +} + +type GetAllContacts_Contacts_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllContacts_Contacts_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Address +} +func (t *GetAllContacts_Contacts_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Company +} +func (t *GetAllContacts_Contacts_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllContacts_Contacts_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllContacts_Contacts_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Email +} +func (t *GetAllContacts_Contacts_Edges_Node) GetFullName() string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.FullName +} +func (t *GetAllContacts_Contacts_Edges_Node) GetID() string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.ID +} +func (t *GetAllContacts_Contacts_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllContacts_Contacts_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetAllContacts_Contacts_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return &t.Status +} +func (t *GetAllContacts_Contacts_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Tags +} +func (t *GetAllContacts_Contacts_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.Title +} +func (t *GetAllContacts_Contacts_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllContacts_Contacts_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllContacts_Contacts_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllContacts_Contacts_Edges struct { + Node *GetAllContacts_Contacts_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllContacts_Contacts_Edges) GetNode() *GetAllContacts_Contacts_Edges_Node { + if t == nil { + t = &GetAllContacts_Contacts_Edges{} + } + return t.Node +} + +type GetAllContacts_Contacts struct { + Edges []*GetAllContacts_Contacts_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllContacts_Contacts) GetEdges() []*GetAllContacts_Contacts_Edges { + if t == nil { + t = &GetAllContacts_Contacts{} + } + return t.Edges +} + +type GetContactByID_Contact struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetContactByID_Contact) GetAddress() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Address +} +func (t *GetContactByID_Contact) GetCompany() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Company +} +func (t *GetContactByID_Contact) GetCreatedAt() *time.Time { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.CreatedAt +} +func (t *GetContactByID_Contact) GetCreatedBy() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.CreatedBy +} +func (t *GetContactByID_Contact) GetEmail() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Email +} +func (t *GetContactByID_Contact) GetFullName() string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.FullName +} +func (t *GetContactByID_Contact) GetID() string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.ID +} +func (t *GetContactByID_Contact) GetOwnerID() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.OwnerID +} +func (t *GetContactByID_Contact) GetPhoneNumber() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.PhoneNumber +} +func (t *GetContactByID_Contact) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetContactByID_Contact{} + } + return &t.Status +} +func (t *GetContactByID_Contact) GetTags() []string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Tags +} +func (t *GetContactByID_Contact) GetTitle() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.Title +} +func (t *GetContactByID_Contact) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.UpdatedAt +} +func (t *GetContactByID_Contact) GetUpdatedBy() *string { + if t == nil { + t = &GetContactByID_Contact{} + } + return t.UpdatedBy +} + +type GetContacts_Contacts_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetContacts_Contacts_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Address +} +func (t *GetContacts_Contacts_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Company +} +func (t *GetContacts_Contacts_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetContacts_Contacts_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetContacts_Contacts_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Email +} +func (t *GetContacts_Contacts_Edges_Node) GetFullName() string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.FullName +} +func (t *GetContacts_Contacts_Edges_Node) GetID() string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.ID +} +func (t *GetContacts_Contacts_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.OwnerID +} +func (t *GetContacts_Contacts_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetContacts_Contacts_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return &t.Status +} +func (t *GetContacts_Contacts_Edges_Node) GetTags() []string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Tags +} +func (t *GetContacts_Contacts_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.Title +} +func (t *GetContacts_Contacts_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetContacts_Contacts_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetContacts_Contacts_Edges_Node{} + } + return t.UpdatedBy +} + +type GetContacts_Contacts_Edges struct { + Node *GetContacts_Contacts_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetContacts_Contacts_Edges) GetNode() *GetContacts_Contacts_Edges_Node { + if t == nil { + t = &GetContacts_Contacts_Edges{} + } + return t.Node +} + +type GetContacts_Contacts struct { + Edges []*GetContacts_Contacts_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetContacts_Contacts) GetEdges() []*GetContacts_Contacts_Edges { + if t == nil { + t = &GetContacts_Contacts{} + } + return t.Edges +} + +type UpdateContact_UpdateContact_Contact struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateContact_UpdateContact_Contact) GetAddress() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Address +} +func (t *UpdateContact_UpdateContact_Contact) GetCompany() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Company +} +func (t *UpdateContact_UpdateContact_Contact) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.CreatedAt +} +func (t *UpdateContact_UpdateContact_Contact) GetCreatedBy() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.CreatedBy +} +func (t *UpdateContact_UpdateContact_Contact) GetEmail() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Email +} +func (t *UpdateContact_UpdateContact_Contact) GetFullName() string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.FullName +} +func (t *UpdateContact_UpdateContact_Contact) GetID() string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.ID +} +func (t *UpdateContact_UpdateContact_Contact) GetOwnerID() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.OwnerID +} +func (t *UpdateContact_UpdateContact_Contact) GetPhoneNumber() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.PhoneNumber +} +func (t *UpdateContact_UpdateContact_Contact) GetStatus() *enums.UserStatus { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return &t.Status +} +func (t *UpdateContact_UpdateContact_Contact) GetTags() []string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Tags +} +func (t *UpdateContact_UpdateContact_Contact) GetTitle() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.Title +} +func (t *UpdateContact_UpdateContact_Contact) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.UpdatedAt +} +func (t *UpdateContact_UpdateContact_Contact) GetUpdatedBy() *string { + if t == nil { + t = &UpdateContact_UpdateContact_Contact{} + } + return t.UpdatedBy +} + +type UpdateContact_UpdateContact struct { + Contact UpdateContact_UpdateContact_Contact "json:\"contact\" graphql:\"contact\"" +} + +func (t *UpdateContact_UpdateContact) GetContact() *UpdateContact_UpdateContact_Contact { + if t == nil { + t = &UpdateContact_UpdateContact{} + } + return &t.Contact +} + +type GetAllContactHistories_ContactHistories_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Address +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Company +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Email +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetFullName() string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.FullName +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.Title +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllContactHistories_ContactHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllContactHistories_ContactHistories_Edges struct { + Node *GetAllContactHistories_ContactHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllContactHistories_ContactHistories_Edges) GetNode() *GetAllContactHistories_ContactHistories_Edges_Node { + if t == nil { + t = &GetAllContactHistories_ContactHistories_Edges{} + } + return t.Node +} + +type GetAllContactHistories_ContactHistories struct { + Edges []*GetAllContactHistories_ContactHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllContactHistories_ContactHistories) GetEdges() []*GetAllContactHistories_ContactHistories_Edges { + if t == nil { + t = &GetAllContactHistories_ContactHistories{} + } + return t.Edges +} + +type GetContactHistories_ContactHistories_Edges_Node struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetContactHistories_ContactHistories_Edges_Node) GetAddress() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Address +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetCompany() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Company +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetEmail() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Email +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetFullName() string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.FullName +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.ID +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetPhoneNumber() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.PhoneNumber +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetTitle() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.Title +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetContactHistories_ContactHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetContactHistories_ContactHistories_Edges struct { + Node *GetContactHistories_ContactHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetContactHistories_ContactHistories_Edges) GetNode() *GetContactHistories_ContactHistories_Edges_Node { + if t == nil { + t = &GetContactHistories_ContactHistories_Edges{} + } + return t.Node +} + +type GetContactHistories_ContactHistories struct { + Edges []*GetContactHistories_ContactHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetContactHistories_ContactHistories) GetEdges() []*GetContactHistories_ContactHistories_Edges { + if t == nil { + t = &GetContactHistories_ContactHistories{} + } + return t.Edges +} + +type CreateDocumentData_CreateDocumentData_DocumentData struct { + ID string "json:\"id\" graphql:\"id\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetID() string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.ID +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetTemplateID() string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.TemplateID +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetData() *json.RawMessage { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return &t.Data +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.CreatedAt +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetCreatedBy() *string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.CreatedBy +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.UpdatedAt +} +func (t *CreateDocumentData_CreateDocumentData_DocumentData) GetUpdatedBy() *string { + if t == nil { + t = &CreateDocumentData_CreateDocumentData_DocumentData{} + } + return t.UpdatedBy +} + +type CreateDocumentData_CreateDocumentData struct { + DocumentData CreateDocumentData_CreateDocumentData_DocumentData "json:\"documentData\" graphql:\"documentData\"" +} + +func (t *CreateDocumentData_CreateDocumentData) GetDocumentData() *CreateDocumentData_CreateDocumentData_DocumentData { + if t == nil { + t = &CreateDocumentData_CreateDocumentData{} + } + return &t.DocumentData +} + +type DeleteDocumentData_DeleteDocumentData struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteDocumentData_DeleteDocumentData) GetDeletedID() string { + if t == nil { + t = &DeleteDocumentData_DeleteDocumentData{} + } + return t.DeletedID +} + +type GetDocumentDataByID_DocumentData struct { + ID string "json:\"id\" graphql:\"id\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetDocumentDataByID_DocumentData) GetID() string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.ID +} +func (t *GetDocumentDataByID_DocumentData) GetTemplateID() string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.TemplateID +} +func (t *GetDocumentDataByID_DocumentData) GetData() *json.RawMessage { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return &t.Data +} +func (t *GetDocumentDataByID_DocumentData) GetCreatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.CreatedAt +} +func (t *GetDocumentDataByID_DocumentData) GetCreatedBy() *string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.CreatedBy +} +func (t *GetDocumentDataByID_DocumentData) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.UpdatedAt +} +func (t *GetDocumentDataByID_DocumentData) GetUpdatedBy() *string { + if t == nil { + t = &GetDocumentDataByID_DocumentData{} + } + return t.UpdatedBy +} + +type UpdateDocumentData_UpdateDocumentData_DocumentData struct { + ID string "json:\"id\" graphql:\"id\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetID() string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.ID +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetTemplateID() string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.TemplateID +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetData() *json.RawMessage { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return &t.Data +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.CreatedAt +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetCreatedBy() *string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.CreatedBy +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.UpdatedAt +} +func (t *UpdateDocumentData_UpdateDocumentData_DocumentData) GetUpdatedBy() *string { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData_DocumentData{} + } + return t.UpdatedBy +} + +type UpdateDocumentData_UpdateDocumentData struct { + DocumentData UpdateDocumentData_UpdateDocumentData_DocumentData "json:\"documentData\" graphql:\"documentData\"" +} + +func (t *UpdateDocumentData_UpdateDocumentData) GetDocumentData() *UpdateDocumentData_UpdateDocumentData_DocumentData { + if t == nil { + t = &UpdateDocumentData_UpdateDocumentData{} + } + return &t.DocumentData +} + +type GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetData() *json.RawMessage { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Data +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTemplateID() string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.TemplateID +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllDocumentDataHistories_DocumentDataHistories_Edges struct { + Node *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllDocumentDataHistories_DocumentDataHistories_Edges) GetNode() *GetAllDocumentDataHistories_DocumentDataHistories_Edges_Node { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories_Edges{} + } + return t.Node +} + +type GetAllDocumentDataHistories_DocumentDataHistories struct { + Edges []*GetAllDocumentDataHistories_DocumentDataHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllDocumentDataHistories_DocumentDataHistories) GetEdges() []*GetAllDocumentDataHistories_DocumentDataHistories_Edges { + if t == nil { + t = &GetAllDocumentDataHistories_DocumentDataHistories{} + } + return t.Edges +} + +type GetDocumentDataHistories_DocumentDataHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Data json.RawMessage "json:\"data\" graphql:\"data\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateID string "json:\"templateID\" graphql:\"templateID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetData() *json.RawMessage { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Data +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.ID +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetTemplateID() string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.TemplateID +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetDocumentDataHistories_DocumentDataHistories_Edges struct { + Node *GetDocumentDataHistories_DocumentDataHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetDocumentDataHistories_DocumentDataHistories_Edges) GetNode() *GetDocumentDataHistories_DocumentDataHistories_Edges_Node { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories_Edges{} + } + return t.Node +} + +type GetDocumentDataHistories_DocumentDataHistories struct { + Edges []*GetDocumentDataHistories_DocumentDataHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetDocumentDataHistories_DocumentDataHistories) GetEdges() []*GetDocumentDataHistories_DocumentDataHistories_Edges { + if t == nil { + t = &GetDocumentDataHistories_DocumentDataHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan{} + } + return t.Name +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization{} + } + return t.Name +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements struct { + ID string "json:\"id\" graphql:\"id\"" + Plan CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan "json:\"plan\" graphql:\"plan\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" + Organization CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetPlan() *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Plan { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return &t.Plan +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExpires() bool { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.Expires +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ExpiresAt +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetCancelled() bool { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.Cancelled +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExternalCustomerID() *string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ExternalCustomerID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetExternalSubscriptionID() *string { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return t.ExternalSubscriptionID +} +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements) GetOrganization() *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements_Organization { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements{} + } + return &t.Organization +} + +type CreateBulkCSVEntitlement_CreateBulkCSVEntitlement struct { + Entitlements []*CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements "json:\"entitlements,omitempty\" graphql:\"entitlements\"" +} + +func (t *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement) GetEntitlements() []*CreateBulkCSVEntitlement_CreateBulkCSVEntitlement_Entitlements { + if t == nil { + t = &CreateBulkCSVEntitlement_CreateBulkCSVEntitlement{} + } + return t.Entitlements +} + +type CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan) GetID() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan{} + } + return t.ID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan) GetName() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan{} + } + return t.Name +} + +type CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization) GetID() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization{} + } + return t.ID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization) GetName() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization{} + } + return t.Name +} + +type CreateBulkEntitlement_CreateBulkEntitlement_Entitlements struct { + ID string "json:\"id\" graphql:\"id\"" + Plan CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan "json:\"plan\" graphql:\"plan\"" + Organization CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetID() string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetPlan() *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Plan { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return &t.Plan +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetOrganization() *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements_Organization { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return &t.Organization +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExpires() bool { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.Expires +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ExpiresAt +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetCancelled() bool { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.Cancelled +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExternalCustomerID() *string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ExternalCustomerID +} +func (t *CreateBulkEntitlement_CreateBulkEntitlement_Entitlements) GetExternalSubscriptionID() *string { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement_Entitlements{} + } + return t.ExternalSubscriptionID +} + +type CreateBulkEntitlement_CreateBulkEntitlement struct { + Entitlements []*CreateBulkEntitlement_CreateBulkEntitlement_Entitlements "json:\"entitlements,omitempty\" graphql:\"entitlements\"" +} + +func (t *CreateBulkEntitlement_CreateBulkEntitlement) GetEntitlements() []*CreateBulkEntitlement_CreateBulkEntitlement_Entitlements { + if t == nil { + t = &CreateBulkEntitlement_CreateBulkEntitlement{} + } + return t.Entitlements +} + +type CreateEntitlement_CreateEntitlement_Entitlement_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Plan) GetID() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Plan{} + } + return t.ID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Plan) GetName() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Plan{} + } + return t.Name +} + +type CreateEntitlement_CreateEntitlement_Entitlement_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Organization) GetID() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Organization{} + } + return t.ID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement_Organization) GetName() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement_Organization{} + } + return t.Name +} + +type CreateEntitlement_CreateEntitlement_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" + Plan CreateEntitlement_CreateEntitlement_Entitlement_Plan "json:\"plan\" graphql:\"plan\"" + Organization CreateEntitlement_CreateEntitlement_Entitlement_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetID() string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetPlan() *CreateEntitlement_CreateEntitlement_Entitlement_Plan { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return &t.Plan +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetOrganization() *CreateEntitlement_CreateEntitlement_Entitlement_Organization { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return &t.Organization +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExpires() bool { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.Expires +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ExpiresAt +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetCancelled() bool { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.Cancelled +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExternalCustomerID() *string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ExternalCustomerID +} +func (t *CreateEntitlement_CreateEntitlement_Entitlement) GetExternalSubscriptionID() *string { + if t == nil { + t = &CreateEntitlement_CreateEntitlement_Entitlement{} + } + return t.ExternalSubscriptionID +} + +type CreateEntitlement_CreateEntitlement struct { + Entitlement CreateEntitlement_CreateEntitlement_Entitlement "json:\"entitlement\" graphql:\"entitlement\"" +} + +func (t *CreateEntitlement_CreateEntitlement) GetEntitlement() *CreateEntitlement_CreateEntitlement_Entitlement { + if t == nil { + t = &CreateEntitlement_CreateEntitlement{} + } + return &t.Entitlement +} + +type DeleteEntitlement_DeleteEntitlement struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntitlement_DeleteEntitlement) GetDeletedID() string { + if t == nil { + t = &DeleteEntitlement_DeleteEntitlement{} + } + return t.DeletedID +} + +type GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetName() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.Name +} + +type GetAllEntitlements_Entitlements_Edges_Node_Plan_Features struct { + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Feature GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return t.Metadata +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features) GetFeature() *GetAllEntitlements_Entitlements_Edges_Node_Plan_Features_Feature { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return &t.Feature +} + +type GetAllEntitlements_Entitlements_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Features []*GetAllEntitlements_Entitlements_Edges_Node_Plan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Name +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Plan) GetFeatures() []*GetAllEntitlements_Entitlements_Edges_Node_Plan_Features { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Features +} + +type GetAllEntitlements_Entitlements_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.Name +} + +type GetAllEntitlements_Entitlements_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Plan GetAllEntitlements_Entitlements_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" + Organization GetAllEntitlements_Entitlements_Edges_Node_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetPlan() *GetAllEntitlements_Entitlements_Edges_Node_Plan { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return &t.Plan +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetOrganization() *GetAllEntitlements_Entitlements_Edges_Node_Organization { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return &t.Organization +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.Expires +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.Cancelled +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetAllEntitlements_Entitlements_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalSubscriptionID +} + +type GetAllEntitlements_Entitlements_Edges struct { + Node *GetAllEntitlements_Entitlements_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlements_Entitlements_Edges) GetNode() *GetAllEntitlements_Entitlements_Edges_Node { + if t == nil { + t = &GetAllEntitlements_Entitlements_Edges{} + } + return t.Node +} + +type GetAllEntitlements_Entitlements struct { + Edges []*GetAllEntitlements_Entitlements_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlements_Entitlements) GetEdges() []*GetAllEntitlements_Entitlements_Edges { + if t == nil { + t = &GetAllEntitlements_Entitlements{} + } + return t.Edges +} + +type GetEntitlementByID_Entitlement_Plan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementByID_Entitlement_Plan_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement_Plan_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features_Feature{} + } + return t.Name +} + +type GetEntitlementByID_Entitlement_Plan_Features struct { + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Feature GetEntitlementByID_Entitlement_Plan_Features_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlementByID_Entitlement_Plan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features{} + } + return t.Metadata +} +func (t *GetEntitlementByID_Entitlement_Plan_Features) GetFeature() *GetEntitlementByID_Entitlement_Plan_Features_Feature { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan_Features{} + } + return &t.Feature +} + +type GetEntitlementByID_Entitlement_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Features []*GetEntitlementByID_Entitlement_Plan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlementByID_Entitlement_Plan) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement_Plan) GetName() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan{} + } + return t.Name +} +func (t *GetEntitlementByID_Entitlement_Plan) GetFeatures() []*GetEntitlementByID_Entitlement_Plan_Features { + if t == nil { + t = &GetEntitlementByID_Entitlement_Plan{} + } + return t.Features +} + +type GetEntitlementByID_Entitlement_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementByID_Entitlement_Organization) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Organization{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement_Organization) GetName() string { + if t == nil { + t = &GetEntitlementByID_Entitlement_Organization{} + } + return t.Name +} + +type GetEntitlementByID_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" + Plan GetEntitlementByID_Entitlement_Plan "json:\"plan\" graphql:\"plan\"" + Organization GetEntitlementByID_Entitlement_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *GetEntitlementByID_Entitlement) GetID() string { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ID +} +func (t *GetEntitlementByID_Entitlement) GetPlan() *GetEntitlementByID_Entitlement_Plan { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return &t.Plan +} +func (t *GetEntitlementByID_Entitlement) GetOrganization() *GetEntitlementByID_Entitlement_Organization { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return &t.Organization +} +func (t *GetEntitlementByID_Entitlement) GetExpires() bool { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.Expires +} +func (t *GetEntitlementByID_Entitlement) GetExpiresAt() *time.Time { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ExpiresAt +} +func (t *GetEntitlementByID_Entitlement) GetCancelled() bool { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.Cancelled +} +func (t *GetEntitlementByID_Entitlement) GetExternalCustomerID() *string { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ExternalCustomerID +} +func (t *GetEntitlementByID_Entitlement) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetEntitlementByID_Entitlement{} + } + return t.ExternalSubscriptionID +} + +type GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature{} + } + return t.Name +} + +type GetEntitlements_Entitlements_Edges_Node_Plan_Features struct { + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Feature GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return t.Metadata +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan_Features) GetFeature() *GetEntitlements_Entitlements_Edges_Node_Plan_Features_Feature { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan_Features{} + } + return &t.Feature +} + +type GetEntitlements_Entitlements_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Features []*GetEntitlements_Entitlements_Edges_Node_Plan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Name +} +func (t *GetEntitlements_Entitlements_Edges_Node_Plan) GetFeatures() []*GetEntitlements_Entitlements_Edges_Node_Plan_Features { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Plan{} + } + return t.Features +} + +type GetEntitlements_Entitlements_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node_Organization{} + } + return t.Name +} + +type GetEntitlements_Entitlements_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Plan GetEntitlements_Entitlements_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" + Organization GetEntitlements_Entitlements_Edges_Node_Organization "json:\"organization\" graphql:\"organization\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *GetEntitlements_Entitlements_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetPlan() *GetEntitlements_Entitlements_Edges_Node_Plan { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return &t.Plan +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetOrganization() *GetEntitlements_Entitlements_Edges_Node_Organization { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return &t.Organization +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.Expires +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.Cancelled +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetEntitlements_Entitlements_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetEntitlements_Entitlements_Edges_Node{} + } + return t.ExternalSubscriptionID +} + +type GetEntitlements_Entitlements_Edges struct { + Node *GetEntitlements_Entitlements_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlements_Entitlements_Edges) GetNode() *GetEntitlements_Entitlements_Edges_Node { + if t == nil { + t = &GetEntitlements_Entitlements_Edges{} + } + return t.Node +} + +type GetEntitlements_Entitlements struct { + Edges []*GetEntitlements_Entitlements_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlements_Entitlements) GetEdges() []*GetEntitlements_Entitlements_Edges { + if t == nil { + t = &GetEntitlements_Entitlements{} + } + return t.Edges +} + +type UpdateEntitlement_UpdateEntitlement_Entitlement_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement_Plan) GetID() string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement_Plan{} + } + return t.ID +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement_Plan) GetName() string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement_Plan{} + } + return t.Name +} + +type UpdateEntitlement_UpdateEntitlement_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" + Plan UpdateEntitlement_UpdateEntitlement_Entitlement_Plan "json:\"plan\" graphql:\"plan\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" +} + +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetID() string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ID +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetPlan() *UpdateEntitlement_UpdateEntitlement_Entitlement_Plan { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return &t.Plan +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExpires() bool { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.Expires +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExpiresAt() *time.Time { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ExpiresAt +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetCancelled() bool { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.Cancelled +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExternalCustomerID() *string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ExternalCustomerID +} +func (t *UpdateEntitlement_UpdateEntitlement_Entitlement) GetExternalSubscriptionID() *string { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement_Entitlement{} + } + return t.ExternalSubscriptionID +} + +type UpdateEntitlement_UpdateEntitlement struct { + Entitlement UpdateEntitlement_UpdateEntitlement_Entitlement "json:\"entitlement\" graphql:\"entitlement\"" +} + +func (t *UpdateEntitlement_UpdateEntitlement) GetEntitlement() *UpdateEntitlement_UpdateEntitlement_Entitlement { + if t == nil { + t = &UpdateEntitlement_UpdateEntitlement{} + } + return &t.Entitlement +} + +type GetAllEntitlementHistories_EntitlementHistories_Edges_Node struct { + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Cancelled +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Expires +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalSubscriptionID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntitlementHistories_EntitlementHistories_Edges struct { + Node *GetAllEntitlementHistories_EntitlementHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementHistories_EntitlementHistories_Edges) GetNode() *GetAllEntitlementHistories_EntitlementHistories_Edges_Node { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories_Edges{} + } + return t.Node +} + +type GetAllEntitlementHistories_EntitlementHistories struct { + Edges []*GetAllEntitlementHistories_EntitlementHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementHistories_EntitlementHistories) GetEdges() []*GetAllEntitlementHistories_EntitlementHistories_Edges { + if t == nil { + t = &GetAllEntitlementHistories_EntitlementHistories{} + } + return t.Edges +} + +type GetEntitlementHistories_EntitlementHistories_Edges_Node struct { + Cancelled bool "json:\"cancelled\" graphql:\"cancelled\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Expires bool "json:\"expires\" graphql:\"expires\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ExternalCustomerID *string "json:\"externalCustomerID,omitempty\" graphql:\"externalCustomerID\"" + ExternalSubscriptionID *string "json:\"externalSubscriptionID,omitempty\" graphql:\"externalSubscriptionID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetCancelled() bool { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Cancelled +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExpires() bool { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Expires +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalCustomerID() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalCustomerID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetExternalSubscriptionID() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ExternalSubscriptionID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntitlementHistories_EntitlementHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntitlementHistories_EntitlementHistories_Edges struct { + Node *GetEntitlementHistories_EntitlementHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementHistories_EntitlementHistories_Edges) GetNode() *GetEntitlementHistories_EntitlementHistories_Edges_Node { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories_Edges{} + } + return t.Node +} + +type GetEntitlementHistories_EntitlementHistories struct { + Edges []*GetEntitlementHistories_EntitlementHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementHistories_EntitlementHistories) GetEdges() []*GetEntitlementHistories_EntitlementHistories_Edges { + if t == nil { + t = &GetEntitlementHistories_EntitlementHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Name +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetDisplayName() *string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.DisplayName +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Metadata +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetTags() []string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Tags +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetVersion() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Version +} +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans{} + } + return t.Description +} + +type CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan struct { + EntitlementPlans []*CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans "json:\"entitlementPlans,omitempty\" graphql:\"entitlementPlans\"" +} + +func (t *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan) GetEntitlementPlans() []*CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan_EntitlementPlans { + if t == nil { + t = &CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan{} + } + return t.EntitlementPlans +} + +type CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetName() string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Name +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetDisplayName() *string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.DisplayName +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Metadata +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetTags() []string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Tags +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetVersion() string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Version +} +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans) GetDescription() *string { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans{} + } + return t.Description +} + +type CreateBulkEntitlementPlan_CreateBulkEntitlementPlan struct { + EntitlementPlans []*CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans "json:\"entitlementPlans,omitempty\" graphql:\"entitlementPlans\"" +} + +func (t *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan) GetEntitlementPlans() []*CreateBulkEntitlementPlan_CreateBulkEntitlementPlan_EntitlementPlans { + if t == nil { + t = &CreateBulkEntitlementPlan_CreateBulkEntitlementPlan{} + } + return t.EntitlementPlans +} + +type CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetID() string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.ID +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetName() string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Name +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetDisplayName() *string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.DisplayName +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Metadata +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetTags() []string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Tags +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetVersion() string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Version +} +func (t *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan) GetDescription() *string { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan{} + } + return t.Description +} + +type CreateEntitlementPlan_CreateEntitlementPlan struct { + EntitlementPlan CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan "json:\"entitlementPlan\" graphql:\"entitlementPlan\"" +} + +func (t *CreateEntitlementPlan_CreateEntitlementPlan) GetEntitlementPlan() *CreateEntitlementPlan_CreateEntitlementPlan_EntitlementPlan { + if t == nil { + t = &CreateEntitlementPlan_CreateEntitlementPlan{} + } + return &t.EntitlementPlan +} + +type DeleteEntitlementPlan_DeleteEntitlementPlan struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntitlementPlan_DeleteEntitlementPlan) GetDeletedID() string { + if t == nil { + t = &DeleteEntitlementPlan_DeleteEntitlementPlan{} + } + return t.DeletedID +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetID() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.ID +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetName() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Name +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features struct { + Feature GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetFeature() *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return &t.Feature +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Tags +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Features []*GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetVersion() string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Version +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges_Node) GetFeatures() []*GetAllEntitlementPlans_EntitlementPlans_Edges_Node_Features { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Features +} + +type GetAllEntitlementPlans_EntitlementPlans_Edges struct { + Node *GetAllEntitlementPlans_EntitlementPlans_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans_Edges) GetNode() *GetAllEntitlementPlans_EntitlementPlans_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlans_EntitlementPlans struct { + Edges []*GetAllEntitlementPlans_EntitlementPlans_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlans_EntitlementPlans) GetEdges() []*GetAllEntitlementPlans_EntitlementPlans_Edges { + if t == nil { + t = &GetAllEntitlementPlans_EntitlementPlans{} + } + return t.Edges +} + +type GetEntitlementPlanByID_EntitlementPlan_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanByID_EntitlementPlan_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features_Feature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features_Feature{} + } + return t.Metadata +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features_Feature{} + } + return t.Name +} + +type GetEntitlementPlanByID_EntitlementPlan_Features struct { + Feature GetEntitlementPlanByID_EntitlementPlan_Features_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetEntitlementPlanByID_EntitlementPlan_Features) GetFeature() *GetEntitlementPlanByID_EntitlementPlan_Features_Feature { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features{} + } + return &t.Feature +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features{} + } + return t.Metadata +} +func (t *GetEntitlementPlanByID_EntitlementPlan_Features) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan_Features{} + } + return t.Tags +} + +type GetEntitlementPlanByID_EntitlementPlan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Features []*GetEntitlementPlanByID_EntitlementPlan_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlementPlanByID_EntitlementPlan) GetID() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.ID +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetName() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Name +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetDisplayName() *string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.DisplayName +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Metadata +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Tags +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetVersion() string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Version +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetDescription() *string { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Description +} +func (t *GetEntitlementPlanByID_EntitlementPlan) GetFeatures() []*GetEntitlementPlanByID_EntitlementPlan_Features { + if t == nil { + t = &GetEntitlementPlanByID_EntitlementPlan{} + } + return t.Features +} + +type GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Metadata +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature{} + } + return t.Name +} + +type GetEntitlementPlans_EntitlementPlans_Edges_Node_Features struct { + Feature GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetFeature() *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features_Feature { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return &t.Feature +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Metadata +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node_Features) GetTags() []string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node_Features{} + } + return t.Tags +} + +type GetEntitlementPlans_EntitlementPlans_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Features []*GetEntitlementPlans_EntitlementPlans_Edges_Node_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetName() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Name +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetVersion() string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Version +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Description +} +func (t *GetEntitlementPlans_EntitlementPlans_Edges_Node) GetFeatures() []*GetEntitlementPlans_EntitlementPlans_Edges_Node_Features { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges_Node{} + } + return t.Features +} + +type GetEntitlementPlans_EntitlementPlans_Edges struct { + Node *GetEntitlementPlans_EntitlementPlans_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans_Edges) GetNode() *GetEntitlementPlans_EntitlementPlans_Edges_Node { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans_Edges{} + } + return t.Node +} + +type GetEntitlementPlans_EntitlementPlans struct { + Edges []*GetEntitlementPlans_EntitlementPlans_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlans_EntitlementPlans) GetEdges() []*GetEntitlementPlans_EntitlementPlans_Edges { + if t == nil { + t = &GetEntitlementPlans_EntitlementPlans{} + } + return t.Edges +} + +type UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Version string "json:\"version\" graphql:\"version\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetID() string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.ID +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetName() string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Name +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetDisplayName() *string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.DisplayName +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetMetadata() map[string]interface{} { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Metadata +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetTags() []string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Tags +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetVersion() string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Version +} +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan) GetDescription() *string { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan{} + } + return t.Description +} + +type UpdateEntitlementPlan_UpdateEntitlementPlan struct { + EntitlementPlan UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan "json:\"entitlementPlan\" graphql:\"entitlementPlan\"" +} + +func (t *UpdateEntitlementPlan_UpdateEntitlementPlan) GetEntitlementPlan() *UpdateEntitlementPlan_UpdateEntitlementPlan_EntitlementPlan { + if t == nil { + t = &UpdateEntitlementPlan_UpdateEntitlementPlan{} + } + return &t.EntitlementPlan +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetName() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.Name +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.Name +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Feature GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature "json:\"feature\" graphql:\"feature\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetFeature() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Feature +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetPlan() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Plan +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges struct { + Node *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges) GetNode() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlanFeatures_EntitlementPlanFeatures struct { + Edges []*GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures) GetEdges() []*GetAllEntitlementPlanFeatures_EntitlementPlanFeatures_Edges { + if t == nil { + t = &GetAllEntitlementPlanFeatures_EntitlementPlanFeatures{} + } + return t.Edges +} + +type GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan{} + } + return t.Name +} + +type GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature{} + } + return t.Name +} + +type GetEntitlementPlanFeatureByID_EntitlementPlanFeature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan "json:\"plan\" graphql:\"plan\"" + Feature GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return t.Metadata +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetPlan() *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Plan { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return &t.Plan +} +func (t *GetEntitlementPlanFeatureByID_EntitlementPlanFeature) GetFeature() *GetEntitlementPlanFeatureByID_EntitlementPlanFeature_Feature { + if t == nil { + t = &GetEntitlementPlanFeatureByID_EntitlementPlanFeature{} + } + return &t.Feature +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan{} + } + return t.Name +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature) GetName() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature{} + } + return t.Name +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan "json:\"plan\" graphql:\"plan\"" + Feature GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetPlan() *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Plan { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Plan +} +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node) GetFeature() *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node_Feature { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node{} + } + return &t.Feature +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges struct { + Node *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges) GetNode() *GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges_Node { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges{} + } + return t.Node +} + +type GetEntitlementPlanFeatures_EntitlementPlanFeatures struct { + Edges []*GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlanFeatures_EntitlementPlanFeatures) GetEdges() []*GetEntitlementPlanFeatures_EntitlementPlanFeatures_Edges { + if t == nil { + t = &GetEntitlementPlanFeatures_EntitlementPlanFeatures{} + } + return t.Edges +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetID() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.ID +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetName() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.Name +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetID() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.ID +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetName() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.Name +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan "json:\"plan\" graphql:\"plan\"" + Feature CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetID() string { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.ID +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.Metadata +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetPlan() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Plan { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Plan +} +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature) GetFeature() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature_Feature { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Feature +} + +type CreateEntitlementPlanFeature_CreateEntitlementPlanFeature struct { + EntitlementPlanFeature CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature "json:\"entitlementPlanFeature\" graphql:\"entitlementPlanFeature\"" +} + +func (t *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature) GetEntitlementPlanFeature() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature_EntitlementPlanFeature { + if t == nil { + t = &CreateEntitlementPlanFeature_CreateEntitlementPlanFeature{} + } + return &t.EntitlementPlanFeature +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.Name +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetName() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.Name +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan "json:\"plan\" graphql:\"plan\"" + Feature CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetID() string { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.ID +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.Metadata +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetPlan() *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Plan { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Plan +} +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures) GetFeature() *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures_Feature { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Feature +} + +type CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature struct { + EntitlementPlanFeatures []*CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures "json:\"entitlementPlanFeatures,omitempty\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature) GetEntitlementPlanFeatures() []*CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature_EntitlementPlanFeatures { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature{} + } + return t.EntitlementPlanFeatures +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan) GetName() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan{} + } + return t.Name +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature) GetName() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature{} + } + return t.Name +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan "json:\"plan\" graphql:\"plan\"" + Feature CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetID() string { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.ID +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return t.Metadata +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetPlan() *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Plan { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Plan +} +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures) GetFeature() *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures_Feature { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures{} + } + return &t.Feature +} + +type CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature struct { + EntitlementPlanFeatures []*CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures "json:\"entitlementPlanFeatures,omitempty\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature) GetEntitlementPlanFeatures() []*CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature_EntitlementPlanFeatures { + if t == nil { + t = &CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature{} + } + return t.EntitlementPlanFeatures +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetID() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.ID +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan) GetName() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan{} + } + return t.Name +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetID() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.ID +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature) GetName() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature{} + } + return t.Name +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature struct { + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Plan UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan "json:\"plan\" graphql:\"plan\"" + Feature UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetID() string { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.ID +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetMetadata() map[string]interface{} { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return t.Metadata +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetPlan() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Plan { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Plan +} +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature) GetFeature() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature_Feature { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature{} + } + return &t.Feature +} + +type UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature struct { + EntitlementPlanFeature UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature "json:\"entitlementPlanFeature\" graphql:\"entitlementPlanFeature\"" +} + +func (t *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature) GetEntitlementPlanFeature() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature_EntitlementPlanFeature { + if t == nil { + t = &UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature{} + } + return &t.EntitlementPlanFeature +} + +type DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature) GetDeletedID() string { + if t == nil { + t = &DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature{} + } + return t.DeletedID +} + +type GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FeatureID string "json:\"featureID\" graphql:\"featureID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetFeatureID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.FeatureID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges struct { + Node *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges) GetNode() *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories struct { + Edges []*GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories) GetEdges() []*GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories{} + } + return t.Edges +} + +type GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FeatureID string "json:\"featureID\" graphql:\"featureID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + PlanID string "json:\"planID\" graphql:\"planID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetFeatureID() string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.FeatureID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetPlanID() string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.PlanID +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges struct { + Node *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges) GetNode() *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges_Node { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges{} + } + return t.Node +} + +type GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories struct { + Edges []*GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories) GetEdges() []*GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories_Edges { + if t == nil { + t = &GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories{} + } + return t.Edges +} + +type GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Version string "json:\"version\" graphql:\"version\"" +} + +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetVersion() string { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Version +} + +type GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges struct { + Node *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges) GetNode() *GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges{} + } + return t.Node +} + +type GetAllEntitlementPlanHistories_EntitlementPlanHistories struct { + Edges []*GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntitlementPlanHistories_EntitlementPlanHistories) GetEdges() []*GetAllEntitlementPlanHistories_EntitlementPlanHistories_Edges { + if t == nil { + t = &GetAllEntitlementPlanHistories_EntitlementPlanHistories{} + } + return t.Edges +} + +type GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Version string "json:\"version\" graphql:\"version\"" +} + +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Description +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Name +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node) GetVersion() string { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node{} + } + return t.Version +} + +type GetEntitlementPlanHistories_EntitlementPlanHistories_Edges struct { + Node *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges) GetNode() *GetEntitlementPlanHistories_EntitlementPlanHistories_Edges_Node { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories_Edges{} + } + return t.Node +} + +type GetEntitlementPlanHistories_EntitlementPlanHistories struct { + Edges []*GetEntitlementPlanHistories_EntitlementPlanHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntitlementPlanHistories_EntitlementPlanHistories) GetEdges() []*GetEntitlementPlanHistories_EntitlementPlanHistories_Edges { + if t == nil { + t = &GetEntitlementPlanHistories_EntitlementPlanHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes) GetText() string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes{} + } + return t.Text +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes{} + } + return t.UpdatedBy +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType) GetName() string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType{} + } + return t.Name +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity_Entities struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.CreatedAt +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.CreatedBy +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Description +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetDisplayName() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.DisplayName +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetStatus() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Status +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetDomains() []string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Domains +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetNotes() []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_Notes { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Notes +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetEntityType() *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities_EntityType { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.EntityType +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetID() string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.ID +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetName() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Name +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.OwnerID +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetTags() []string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.Tags +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity_Entities) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity_Entities{} + } + return t.UpdatedBy +} + +type CreateBulkCSVEntity_CreateBulkCSVEntity struct { + Entities []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities "json:\"entities,omitempty\" graphql:\"entities\"" +} + +func (t *CreateBulkCSVEntity_CreateBulkCSVEntity) GetEntities() []*CreateBulkCSVEntity_CreateBulkCSVEntity_Entities { + if t == nil { + t = &CreateBulkCSVEntity_CreateBulkCSVEntity{} + } + return t.Entities +} + +type CreateBulkEntity_CreateBulkEntity_Entities_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity_Entities_Notes) GetText() string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_Notes{} + } + return t.Text +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_Notes{} + } + return t.UpdatedAt +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities_Notes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_Notes{} + } + return t.UpdatedBy +} + +type CreateBulkEntity_CreateBulkEntity_Entities_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity_Entities_EntityType) GetName() string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities_EntityType{} + } + return t.Name +} + +type CreateBulkEntity_CreateBulkEntity_Entities struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*CreateBulkEntity_CreateBulkEntity_Entities_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *CreateBulkEntity_CreateBulkEntity_Entities_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.CreatedAt +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.CreatedBy +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetDescription() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Description +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetDisplayName() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.DisplayName +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetStatus() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Status +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetDomains() []string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Domains +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetNotes() []*CreateBulkEntity_CreateBulkEntity_Entities_Notes { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Notes +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetEntityType() *CreateBulkEntity_CreateBulkEntity_Entities_EntityType { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.EntityType +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetID() string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.ID +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetName() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Name +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetOwnerID() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.OwnerID +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetTags() []string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.Tags +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.UpdatedAt +} +func (t *CreateBulkEntity_CreateBulkEntity_Entities) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity_Entities{} + } + return t.UpdatedBy +} + +type CreateBulkEntity_CreateBulkEntity struct { + Entities []*CreateBulkEntity_CreateBulkEntity_Entities "json:\"entities,omitempty\" graphql:\"entities\"" +} + +func (t *CreateBulkEntity_CreateBulkEntity) GetEntities() []*CreateBulkEntity_CreateBulkEntity_Entities { + if t == nil { + t = &CreateBulkEntity_CreateBulkEntity{} + } + return t.Entities +} + +type CreateEntity_CreateEntity_Entity_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateEntity_CreateEntity_Entity_Notes) GetText() string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_Notes{} + } + return t.Text +} +func (t *CreateEntity_CreateEntity_Entity_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_Notes{} + } + return t.UpdatedAt +} +func (t *CreateEntity_CreateEntity_Entity_Notes) GetUpdatedBy() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_Notes{} + } + return t.UpdatedBy +} + +type CreateEntity_CreateEntity_Entity_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateEntity_CreateEntity_Entity_EntityType) GetName() string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity_EntityType{} + } + return t.Name +} + +type CreateEntity_CreateEntity_Entity struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*CreateEntity_CreateEntity_Entity_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *CreateEntity_CreateEntity_Entity_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateEntity_CreateEntity_Entity) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.CreatedAt +} +func (t *CreateEntity_CreateEntity_Entity) GetCreatedBy() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.CreatedBy +} +func (t *CreateEntity_CreateEntity_Entity) GetDescription() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Description +} +func (t *CreateEntity_CreateEntity_Entity) GetDisplayName() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.DisplayName +} +func (t *CreateEntity_CreateEntity_Entity) GetStatus() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Status +} +func (t *CreateEntity_CreateEntity_Entity) GetDomains() []string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Domains +} +func (t *CreateEntity_CreateEntity_Entity) GetNotes() []*CreateEntity_CreateEntity_Entity_Notes { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Notes +} +func (t *CreateEntity_CreateEntity_Entity) GetEntityType() *CreateEntity_CreateEntity_Entity_EntityType { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.EntityType +} +func (t *CreateEntity_CreateEntity_Entity) GetID() string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.ID +} +func (t *CreateEntity_CreateEntity_Entity) GetName() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Name +} +func (t *CreateEntity_CreateEntity_Entity) GetOwnerID() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.OwnerID +} +func (t *CreateEntity_CreateEntity_Entity) GetTags() []string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.Tags +} +func (t *CreateEntity_CreateEntity_Entity) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.UpdatedAt +} +func (t *CreateEntity_CreateEntity_Entity) GetUpdatedBy() *string { + if t == nil { + t = &CreateEntity_CreateEntity_Entity{} + } + return t.UpdatedBy +} + +type CreateEntity_CreateEntity struct { + Entity CreateEntity_CreateEntity_Entity "json:\"entity\" graphql:\"entity\"" +} + +func (t *CreateEntity_CreateEntity) GetEntity() *CreateEntity_CreateEntity_Entity { + if t == nil { + t = &CreateEntity_CreateEntity{} + } + return &t.Entity +} + +type DeleteEntity_DeleteEntity struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntity_DeleteEntity) GetDeletedID() string { + if t == nil { + t = &DeleteEntity_DeleteEntity{} + } + return t.DeletedID +} + +type GetAllEntities_Entities_Edges_Node_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntities_Entities_Edges_Node_Notes) GetText() string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_Notes{} + } + return t.Text +} +func (t *GetAllEntities_Entities_Edges_Node_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedAt +} +func (t *GetAllEntities_Entities_Edges_Node_Notes) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedBy +} + +type GetAllEntities_Entities_Edges_Node_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllEntities_Entities_Edges_Node_EntityType) GetName() string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node_EntityType{} + } + return t.Name +} + +type GetAllEntities_Entities_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*GetAllEntities_Entities_Edges_Node_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *GetAllEntities_Entities_Edges_Node_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntities_Entities_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntities_Entities_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntities_Entities_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntities_Entities_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntities_Entities_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Status +} +func (t *GetAllEntities_Entities_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Domains +} +func (t *GetAllEntities_Entities_Edges_Node) GetNotes() []*GetAllEntities_Entities_Edges_Node_Notes { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Notes +} +func (t *GetAllEntities_Entities_Edges_Node) GetEntityType() *GetAllEntities_Entities_Edges_Node_EntityType { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.EntityType +} +func (t *GetAllEntities_Entities_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntities_Entities_Edges_Node) GetName() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntities_Entities_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntities_Entities_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntities_Entities_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntities_Entities_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntities_Entities_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntities_Entities_Edges struct { + Node *GetAllEntities_Entities_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntities_Entities_Edges) GetNode() *GetAllEntities_Entities_Edges_Node { + if t == nil { + t = &GetAllEntities_Entities_Edges{} + } + return t.Node +} + +type GetAllEntities_Entities struct { + Edges []*GetAllEntities_Entities_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntities_Entities) GetEdges() []*GetAllEntities_Entities_Edges { + if t == nil { + t = &GetAllEntities_Entities{} + } + return t.Edges +} + +type GetEntities_Entities_Edges_Node_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntities_Entities_Edges_Node_Notes) GetText() string { + if t == nil { + t = &GetEntities_Entities_Edges_Node_Notes{} + } + return t.Text +} +func (t *GetEntities_Entities_Edges_Node_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedAt +} +func (t *GetEntities_Entities_Edges_Node_Notes) GetUpdatedBy() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node_Notes{} + } + return t.UpdatedBy +} + +type GetEntities_Entities_Edges_Node_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntities_Entities_Edges_Node_EntityType) GetName() string { + if t == nil { + t = &GetEntities_Entities_Edges_Node_EntityType{} + } + return t.Name +} + +type GetEntities_Entities_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*GetEntities_Entities_Edges_Node_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *GetEntities_Entities_Edges_Node_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntities_Entities_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntities_Entities_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntities_Entities_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Description +} +func (t *GetEntities_Entities_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntities_Entities_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Status +} +func (t *GetEntities_Entities_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Domains +} +func (t *GetEntities_Entities_Edges_Node) GetNotes() []*GetEntities_Entities_Edges_Node_Notes { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Notes +} +func (t *GetEntities_Entities_Edges_Node) GetEntityType() *GetEntities_Entities_Edges_Node_EntityType { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.EntityType +} +func (t *GetEntities_Entities_Edges_Node) GetID() string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.ID +} +func (t *GetEntities_Entities_Edges_Node) GetName() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Name +} +func (t *GetEntities_Entities_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntities_Entities_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.Tags +} +func (t *GetEntities_Entities_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntities_Entities_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntities_Entities_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntities_Entities_Edges struct { + Node *GetEntities_Entities_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntities_Entities_Edges) GetNode() *GetEntities_Entities_Edges_Node { + if t == nil { + t = &GetEntities_Entities_Edges{} + } + return t.Node +} + +type GetEntities_Entities struct { + Edges []*GetEntities_Entities_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntities_Entities) GetEdges() []*GetEntities_Entities_Edges { + if t == nil { + t = &GetEntities_Entities{} + } + return t.Edges +} + +type GetEntityByID_Entity_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityByID_Entity_Notes) GetText() string { + if t == nil { + t = &GetEntityByID_Entity_Notes{} + } + return t.Text +} +func (t *GetEntityByID_Entity_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityByID_Entity_Notes{} + } + return t.UpdatedAt +} +func (t *GetEntityByID_Entity_Notes) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityByID_Entity_Notes{} + } + return t.UpdatedBy +} + +type GetEntityByID_Entity_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetEntityByID_Entity_EntityType) GetName() string { + if t == nil { + t = &GetEntityByID_Entity_EntityType{} + } + return t.Name +} + +type GetEntityByID_Entity_Contacts struct { + ID string "json:\"id\" graphql:\"id\"" + FullName string "json:\"fullName\" graphql:\"fullName\"" + Email *string "json:\"email,omitempty\" graphql:\"email\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + Company *string "json:\"company,omitempty\" graphql:\"company\"" + Address *string "json:\"address,omitempty\" graphql:\"address\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" +} + +func (t *GetEntityByID_Entity_Contacts) GetID() string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.ID +} +func (t *GetEntityByID_Entity_Contacts) GetFullName() string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.FullName +} +func (t *GetEntityByID_Entity_Contacts) GetEmail() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Email +} +func (t *GetEntityByID_Entity_Contacts) GetTitle() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Title +} +func (t *GetEntityByID_Entity_Contacts) GetCompany() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Company +} +func (t *GetEntityByID_Entity_Contacts) GetAddress() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.Address +} +func (t *GetEntityByID_Entity_Contacts) GetPhoneNumber() *string { + if t == nil { + t = &GetEntityByID_Entity_Contacts{} + } + return t.PhoneNumber +} + +type GetEntityByID_Entity struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*GetEntityByID_Entity_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *GetEntityByID_Entity_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Contacts []*GetEntityByID_Entity_Contacts "json:\"contacts,omitempty\" graphql:\"contacts\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityByID_Entity) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.CreatedAt +} +func (t *GetEntityByID_Entity) GetCreatedBy() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.CreatedBy +} +func (t *GetEntityByID_Entity) GetDescription() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Description +} +func (t *GetEntityByID_Entity) GetDisplayName() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.DisplayName +} +func (t *GetEntityByID_Entity) GetStatus() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Status +} +func (t *GetEntityByID_Entity) GetDomains() []string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Domains +} +func (t *GetEntityByID_Entity) GetNotes() []*GetEntityByID_Entity_Notes { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Notes +} +func (t *GetEntityByID_Entity) GetEntityType() *GetEntityByID_Entity_EntityType { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.EntityType +} +func (t *GetEntityByID_Entity) GetID() string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.ID +} +func (t *GetEntityByID_Entity) GetName() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Name +} +func (t *GetEntityByID_Entity) GetOwnerID() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.OwnerID +} +func (t *GetEntityByID_Entity) GetContacts() []*GetEntityByID_Entity_Contacts { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Contacts +} +func (t *GetEntityByID_Entity) GetTags() []string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.Tags +} +func (t *GetEntityByID_Entity) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.UpdatedAt +} +func (t *GetEntityByID_Entity) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityByID_Entity{} + } + return t.UpdatedBy +} + +type UpdateEntity_UpdateEntity_Entity_Notes struct { + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateEntity_UpdateEntity_Entity_Notes) GetText() string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_Notes{} + } + return t.Text +} +func (t *UpdateEntity_UpdateEntity_Entity_Notes) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_Notes{} + } + return t.UpdatedAt +} +func (t *UpdateEntity_UpdateEntity_Entity_Notes) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_Notes{} + } + return t.UpdatedBy +} + +type UpdateEntity_UpdateEntity_Entity_EntityType struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateEntity_UpdateEntity_Entity_EntityType) GetName() string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity_EntityType{} + } + return t.Name +} + +type UpdateEntity_UpdateEntity_Entity struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + Notes []*UpdateEntity_UpdateEntity_Entity_Notes "json:\"notes,omitempty\" graphql:\"notes\"" + EntityType *UpdateEntity_UpdateEntity_Entity_EntityType "json:\"entityType,omitempty\" graphql:\"entityType\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateEntity_UpdateEntity_Entity) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.CreatedAt +} +func (t *UpdateEntity_UpdateEntity_Entity) GetCreatedBy() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.CreatedBy +} +func (t *UpdateEntity_UpdateEntity_Entity) GetDescription() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Description +} +func (t *UpdateEntity_UpdateEntity_Entity) GetDisplayName() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.DisplayName +} +func (t *UpdateEntity_UpdateEntity_Entity) GetStatus() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Status +} +func (t *UpdateEntity_UpdateEntity_Entity) GetDomains() []string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Domains +} +func (t *UpdateEntity_UpdateEntity_Entity) GetNotes() []*UpdateEntity_UpdateEntity_Entity_Notes { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Notes +} +func (t *UpdateEntity_UpdateEntity_Entity) GetEntityType() *UpdateEntity_UpdateEntity_Entity_EntityType { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.EntityType +} +func (t *UpdateEntity_UpdateEntity_Entity) GetID() string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.ID +} +func (t *UpdateEntity_UpdateEntity_Entity) GetName() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Name +} +func (t *UpdateEntity_UpdateEntity_Entity) GetOwnerID() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.OwnerID +} +func (t *UpdateEntity_UpdateEntity_Entity) GetTags() []string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.Tags +} +func (t *UpdateEntity_UpdateEntity_Entity) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.UpdatedAt +} +func (t *UpdateEntity_UpdateEntity_Entity) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEntity_UpdateEntity_Entity{} + } + return t.UpdatedBy +} + +type UpdateEntity_UpdateEntity struct { + Entity UpdateEntity_UpdateEntity_Entity "json:\"entity\" graphql:\"entity\"" +} + +func (t *UpdateEntity_UpdateEntity) GetEntity() *UpdateEntity_UpdateEntity_Entity { + if t == nil { + t = &UpdateEntity_UpdateEntity{} + } + return &t.Entity +} + +type GetAllEntityHistories_EntityHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + EntityTypeID *string "json:\"entityTypeID,omitempty\" graphql:\"entityTypeID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetEntityTypeID() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.EntityTypeID +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetName() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Status +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntityHistories_EntityHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntityHistories_EntityHistories_Edges struct { + Node *GetAllEntityHistories_EntityHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntityHistories_EntityHistories_Edges) GetNode() *GetAllEntityHistories_EntityHistories_Edges_Node { + if t == nil { + t = &GetAllEntityHistories_EntityHistories_Edges{} + } + return t.Node +} + +type GetAllEntityHistories_EntityHistories struct { + Edges []*GetAllEntityHistories_EntityHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntityHistories_EntityHistories) GetEdges() []*GetAllEntityHistories_EntityHistories_Edges { + if t == nil { + t = &GetAllEntityHistories_EntityHistories{} + } + return t.Edges +} + +type GetEntityHistories_EntityHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + EntityTypeID *string "json:\"entityTypeID,omitempty\" graphql:\"entityTypeID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name *string "json:\"name,omitempty\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Status *string "json:\"status,omitempty\" graphql:\"status\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Description +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetEntityTypeID() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.EntityTypeID +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetName() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Name +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetStatus() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Status +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntityHistories_EntityHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntityHistories_EntityHistories_Edges struct { + Node *GetEntityHistories_EntityHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntityHistories_EntityHistories_Edges) GetNode() *GetEntityHistories_EntityHistories_Edges_Node { + if t == nil { + t = &GetEntityHistories_EntityHistories_Edges{} + } + return t.Node +} + +type GetEntityHistories_EntityHistories struct { + Edges []*GetEntityHistories_EntityHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntityHistories_EntityHistories) GetEdges() []*GetEntityHistories_EntityHistories_Edges { + if t == nil { + t = &GetEntityHistories_EntityHistories{} + } + return t.Edges +} + +type CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.CreatedAt +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.CreatedBy +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetID() string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.ID +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetName() string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.Name +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.OwnerID +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetTags() []string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.Tags +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes{} + } + return t.UpdatedBy +} + +type CreateBulkCSVEntityType_CreateBulkCSVEntityType struct { + EntityTypes []*CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes "json:\"entityTypes,omitempty\" graphql:\"entityTypes\"" +} + +func (t *CreateBulkCSVEntityType_CreateBulkCSVEntityType) GetEntityTypes() []*CreateBulkCSVEntityType_CreateBulkCSVEntityType_EntityTypes { + if t == nil { + t = &CreateBulkCSVEntityType_CreateBulkCSVEntityType{} + } + return t.EntityTypes +} + +type CreateBulkEntityType_CreateBulkEntityType_EntityTypes struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.CreatedAt +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetCreatedBy() *string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.CreatedBy +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetID() string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.ID +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetName() string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.Name +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetOwnerID() *string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.OwnerID +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetTags() []string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.Tags +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.UpdatedAt +} +func (t *CreateBulkEntityType_CreateBulkEntityType_EntityTypes) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType_EntityTypes{} + } + return t.UpdatedBy +} + +type CreateBulkEntityType_CreateBulkEntityType struct { + EntityTypes []*CreateBulkEntityType_CreateBulkEntityType_EntityTypes "json:\"entityTypes,omitempty\" graphql:\"entityTypes\"" +} + +func (t *CreateBulkEntityType_CreateBulkEntityType) GetEntityTypes() []*CreateBulkEntityType_CreateBulkEntityType_EntityTypes { + if t == nil { + t = &CreateBulkEntityType_CreateBulkEntityType{} + } + return t.EntityTypes +} + +type CreateEntityType_CreateEntityType_EntityType struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateEntityType_CreateEntityType_EntityType) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.CreatedAt +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetCreatedBy() *string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.CreatedBy +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetID() string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.ID +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetName() string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.Name +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetOwnerID() *string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.OwnerID +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetTags() []string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.Tags +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.UpdatedAt +} +func (t *CreateEntityType_CreateEntityType_EntityType) GetUpdatedBy() *string { + if t == nil { + t = &CreateEntityType_CreateEntityType_EntityType{} + } + return t.UpdatedBy +} + +type CreateEntityType_CreateEntityType struct { + EntityType CreateEntityType_CreateEntityType_EntityType "json:\"entityType\" graphql:\"entityType\"" +} + +func (t *CreateEntityType_CreateEntityType) GetEntityType() *CreateEntityType_CreateEntityType_EntityType { + if t == nil { + t = &CreateEntityType_CreateEntityType{} + } + return &t.EntityType +} + +type DeleteEntityType_DeleteEntityType struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEntityType_DeleteEntityType) GetDeletedID() string { + if t == nil { + t = &DeleteEntityType_DeleteEntityType{} + } + return t.DeletedID +} + +type GetAllEntityTypes_EntityTypes_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntityTypes_EntityTypes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntityTypes_EntityTypes_Edges struct { + Node *GetAllEntityTypes_EntityTypes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntityTypes_EntityTypes_Edges) GetNode() *GetAllEntityTypes_EntityTypes_Edges_Node { + if t == nil { + t = &GetAllEntityTypes_EntityTypes_Edges{} + } + return t.Node +} + +type GetAllEntityTypes_EntityTypes struct { + Edges []*GetAllEntityTypes_EntityTypes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntityTypes_EntityTypes) GetEdges() []*GetAllEntityTypes_EntityTypes_Edges { + if t == nil { + t = &GetAllEntityTypes_EntityTypes{} + } + return t.Edges +} + +type GetEntityTypeByID_EntityType struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityTypeByID_EntityType) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.CreatedAt +} +func (t *GetEntityTypeByID_EntityType) GetCreatedBy() *string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.CreatedBy +} +func (t *GetEntityTypeByID_EntityType) GetID() string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.ID +} +func (t *GetEntityTypeByID_EntityType) GetName() string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.Name +} +func (t *GetEntityTypeByID_EntityType) GetOwnerID() *string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.OwnerID +} +func (t *GetEntityTypeByID_EntityType) GetTags() []string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.Tags +} +func (t *GetEntityTypeByID_EntityType) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.UpdatedAt +} +func (t *GetEntityTypeByID_EntityType) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityTypeByID_EntityType{} + } + return t.UpdatedBy +} + +type GetEntityTypes_EntityTypes_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetID() string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.ID +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetName() string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.Name +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.Tags +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntityTypes_EntityTypes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntityTypes_EntityTypes_Edges struct { + Node *GetEntityTypes_EntityTypes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntityTypes_EntityTypes_Edges) GetNode() *GetEntityTypes_EntityTypes_Edges_Node { + if t == nil { + t = &GetEntityTypes_EntityTypes_Edges{} + } + return t.Node +} + +type GetEntityTypes_EntityTypes struct { + Edges []*GetEntityTypes_EntityTypes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntityTypes_EntityTypes) GetEdges() []*GetEntityTypes_EntityTypes_Edges { + if t == nil { + t = &GetEntityTypes_EntityTypes{} + } + return t.Edges +} + +type UpdateEntityType_UpdateEntityType_EntityType struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.CreatedAt +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetCreatedBy() *string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.CreatedBy +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetID() string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.ID +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetName() string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.Name +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetOwnerID() *string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.OwnerID +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetTags() []string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.Tags +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.UpdatedAt +} +func (t *UpdateEntityType_UpdateEntityType_EntityType) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEntityType_UpdateEntityType_EntityType{} + } + return t.UpdatedBy +} + +type UpdateEntityType_UpdateEntityType struct { + EntityType UpdateEntityType_UpdateEntityType_EntityType "json:\"entityType\" graphql:\"entityType\"" +} + +func (t *UpdateEntityType_UpdateEntityType) GetEntityType() *UpdateEntityType_UpdateEntityType_EntityType { + if t == nil { + t = &UpdateEntityType_UpdateEntityType{} + } + return &t.EntityType +} + +type GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEntityTypeHistories_EntityTypeHistories_Edges struct { + Node *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEntityTypeHistories_EntityTypeHistories_Edges) GetNode() *GetAllEntityTypeHistories_EntityTypeHistories_Edges_Node { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories_Edges{} + } + return t.Node +} + +type GetAllEntityTypeHistories_EntityTypeHistories struct { + Edges []*GetAllEntityTypeHistories_EntityTypeHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEntityTypeHistories_EntityTypeHistories) GetEdges() []*GetAllEntityTypeHistories_EntityTypeHistories_Edges { + if t == nil { + t = &GetAllEntityTypeHistories_EntityTypeHistories{} + } + return t.Edges +} + +type GetEntityTypeHistories_EntityTypeHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Name +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEntityTypeHistories_EntityTypeHistories_Edges struct { + Node *GetEntityTypeHistories_EntityTypeHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEntityTypeHistories_EntityTypeHistories_Edges) GetNode() *GetEntityTypeHistories_EntityTypeHistories_Edges_Node { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories_Edges{} + } + return t.Node +} + +type GetEntityTypeHistories_EntityTypeHistories struct { + Edges []*GetEntityTypeHistories_EntityTypeHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEntityTypeHistories_EntityTypeHistories) GetEdges() []*GetEntityTypeHistories_EntityTypeHistories_Edges { + if t == nil { + t = &GetEntityTypeHistories_EntityTypeHistories{} + } + return t.Edges +} + +type GetEvents_Events_Edges_Node struct { + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + ID string "json:\"id\" graphql:\"id\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" +} + +func (t *GetEvents_Events_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.EventID +} +func (t *GetEvents_Events_Edges_Node) GetID() string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.ID +} +func (t *GetEvents_Events_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetEvents_Events_Edges_Node) GetEventType() string { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.EventType +} +func (t *GetEvents_Events_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEvents_Events_Edges_Node{} + } + return t.Metadata +} + +type GetEvents_Events_Edges struct { + Node *GetEvents_Events_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEvents_Events_Edges) GetNode() *GetEvents_Events_Edges_Node { + if t == nil { + t = &GetEvents_Events_Edges{} + } + return t.Node +} + +type GetEvents_Events struct { + Edges []*GetEvents_Events_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEvents_Events) GetEdges() []*GetEvents_Events_Edges { + if t == nil { + t = &GetEvents_Events{} + } + return t.Edges +} + +type GetEventByID_Event_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_User) GetID() string { + if t == nil { + t = &GetEventByID_Event_User{} + } + return t.ID +} + +type GetEventByID_Event_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Group) GetID() string { + if t == nil { + t = &GetEventByID_Event_Group{} + } + return t.ID +} + +type GetEventByID_Event_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Integration) GetID() string { + if t == nil { + t = &GetEventByID_Event_Integration{} + } + return t.ID +} + +type GetEventByID_Event_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Organization) GetID() string { + if t == nil { + t = &GetEventByID_Event_Organization{} + } + return t.ID +} + +type GetEventByID_Event_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Invite) GetID() string { + if t == nil { + t = &GetEventByID_Event_Invite{} + } + return t.ID +} + +type GetEventByID_Event_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Feature) GetID() string { + if t == nil { + t = &GetEventByID_Event_Feature{} + } + return t.ID +} + +type GetEventByID_Event_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_PersonalAccessToken) GetID() string { + if t == nil { + t = &GetEventByID_Event_PersonalAccessToken{} + } + return t.ID +} + +type GetEventByID_Event_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Oauth2token) GetID() string { + if t == nil { + t = &GetEventByID_Event_Oauth2token{} + } + return t.ID +} + +type GetEventByID_Event_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Hush) GetID() string { + if t == nil { + t = &GetEventByID_Event_Hush{} + } + return t.ID +} + +type GetEventByID_Event_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Orgmembership) GetID() string { + if t == nil { + t = &GetEventByID_Event_Orgmembership{} + } + return t.ID +} + +type GetEventByID_Event_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Groupmembership) GetID() string { + if t == nil { + t = &GetEventByID_Event_Groupmembership{} + } + return t.ID +} + +type GetEventByID_Event_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Entitlement) GetID() string { + if t == nil { + t = &GetEventByID_Event_Entitlement{} + } + return t.ID +} + +type GetEventByID_Event_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetEventByID_Event_Webhook) GetID() string { + if t == nil { + t = &GetEventByID_Event_Webhook{} + } + return t.ID +} + +type GetEventByID_Event struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*GetEventByID_Event_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*GetEventByID_Event_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*GetEventByID_Event_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*GetEventByID_Event_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*GetEventByID_Event_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*GetEventByID_Event_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*GetEventByID_Event_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*GetEventByID_Event_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*GetEventByID_Event_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*GetEventByID_Event_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*GetEventByID_Event_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*GetEventByID_Event_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*GetEventByID_Event_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *GetEventByID_Event) GetID() string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.ID +} +func (t *GetEventByID_Event) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEventByID_Event{} + } + return t.CreatedAt +} +func (t *GetEventByID_Event) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEventByID_Event{} + } + return t.UpdatedAt +} +func (t *GetEventByID_Event) GetCreatedBy() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.CreatedBy +} +func (t *GetEventByID_Event) GetUpdatedBy() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.UpdatedBy +} +func (t *GetEventByID_Event) GetEventID() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.EventID +} +func (t *GetEventByID_Event) GetCorrelationID() *string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.CorrelationID +} +func (t *GetEventByID_Event) GetEventType() string { + if t == nil { + t = &GetEventByID_Event{} + } + return t.EventType +} +func (t *GetEventByID_Event) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Metadata +} +func (t *GetEventByID_Event) GetUser() []*GetEventByID_Event_User { + if t == nil { + t = &GetEventByID_Event{} + } + return t.User +} +func (t *GetEventByID_Event) GetGroup() []*GetEventByID_Event_Group { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Group +} +func (t *GetEventByID_Event) GetIntegration() []*GetEventByID_Event_Integration { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Integration +} +func (t *GetEventByID_Event) GetOrganization() []*GetEventByID_Event_Organization { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Organization +} +func (t *GetEventByID_Event) GetInvite() []*GetEventByID_Event_Invite { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Invite +} +func (t *GetEventByID_Event) GetFeature() []*GetEventByID_Event_Feature { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Feature +} +func (t *GetEventByID_Event) GetPersonalAccessToken() []*GetEventByID_Event_PersonalAccessToken { + if t == nil { + t = &GetEventByID_Event{} + } + return t.PersonalAccessToken +} +func (t *GetEventByID_Event) GetOauth2token() []*GetEventByID_Event_Oauth2token { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Oauth2token +} +func (t *GetEventByID_Event) GetHush() []*GetEventByID_Event_Hush { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Hush +} +func (t *GetEventByID_Event) GetOrgmembership() []*GetEventByID_Event_Orgmembership { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Orgmembership +} +func (t *GetEventByID_Event) GetGroupmembership() []*GetEventByID_Event_Groupmembership { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Groupmembership +} +func (t *GetEventByID_Event) GetEntitlement() []*GetEventByID_Event_Entitlement { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Entitlement +} +func (t *GetEventByID_Event) GetWebhook() []*GetEventByID_Event_Webhook { + if t == nil { + t = &GetEventByID_Event{} + } + return t.Webhook +} + +type GetAllEvents_Events_Edges_Node_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_User) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_User{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Group{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Integration) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Integration{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Organization{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Invite) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Invite{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Feature) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Feature{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_PersonalAccessToken) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_PersonalAccessToken{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Oauth2token) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Oauth2token{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Hush) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Hush{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Orgmembership) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Orgmembership{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Groupmembership) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Groupmembership{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Entitlement) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Entitlement{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllEvents_Events_Edges_Node_Webhook) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node_Webhook{} + } + return t.ID +} + +type GetAllEvents_Events_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*GetAllEvents_Events_Edges_Node_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*GetAllEvents_Events_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*GetAllEvents_Events_Edges_Node_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*GetAllEvents_Events_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*GetAllEvents_Events_Edges_Node_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*GetAllEvents_Events_Edges_Node_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*GetAllEvents_Events_Edges_Node_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*GetAllEvents_Events_Edges_Node_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*GetAllEvents_Events_Edges_Node_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*GetAllEvents_Events_Edges_Node_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*GetAllEvents_Events_Edges_Node_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*GetAllEvents_Events_Edges_Node_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*GetAllEvents_Events_Edges_Node_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *GetAllEvents_Events_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.ID +} +func (t *GetAllEvents_Events_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEvents_Events_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEvents_Events_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEvents_Events_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllEvents_Events_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.EventID +} +func (t *GetAllEvents_Events_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetAllEvents_Events_Edges_Node) GetEventType() string { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.EventType +} +func (t *GetAllEvents_Events_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEvents_Events_Edges_Node) GetUser() []*GetAllEvents_Events_Edges_Node_User { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.User +} +func (t *GetAllEvents_Events_Edges_Node) GetGroup() []*GetAllEvents_Events_Edges_Node_Group { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Group +} +func (t *GetAllEvents_Events_Edges_Node) GetIntegration() []*GetAllEvents_Events_Edges_Node_Integration { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Integration +} +func (t *GetAllEvents_Events_Edges_Node) GetOrganization() []*GetAllEvents_Events_Edges_Node_Organization { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Organization +} +func (t *GetAllEvents_Events_Edges_Node) GetInvite() []*GetAllEvents_Events_Edges_Node_Invite { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Invite +} +func (t *GetAllEvents_Events_Edges_Node) GetFeature() []*GetAllEvents_Events_Edges_Node_Feature { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Feature +} +func (t *GetAllEvents_Events_Edges_Node) GetPersonalAccessToken() []*GetAllEvents_Events_Edges_Node_PersonalAccessToken { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.PersonalAccessToken +} +func (t *GetAllEvents_Events_Edges_Node) GetOauth2token() []*GetAllEvents_Events_Edges_Node_Oauth2token { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Oauth2token +} +func (t *GetAllEvents_Events_Edges_Node) GetHush() []*GetAllEvents_Events_Edges_Node_Hush { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Hush +} +func (t *GetAllEvents_Events_Edges_Node) GetOrgmembership() []*GetAllEvents_Events_Edges_Node_Orgmembership { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Orgmembership +} +func (t *GetAllEvents_Events_Edges_Node) GetGroupmembership() []*GetAllEvents_Events_Edges_Node_Groupmembership { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Groupmembership +} +func (t *GetAllEvents_Events_Edges_Node) GetEntitlement() []*GetAllEvents_Events_Edges_Node_Entitlement { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Entitlement +} +func (t *GetAllEvents_Events_Edges_Node) GetWebhook() []*GetAllEvents_Events_Edges_Node_Webhook { + if t == nil { + t = &GetAllEvents_Events_Edges_Node{} + } + return t.Webhook +} + +type GetAllEvents_Events_Edges struct { + Node *GetAllEvents_Events_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEvents_Events_Edges) GetNode() *GetAllEvents_Events_Edges_Node { + if t == nil { + t = &GetAllEvents_Events_Edges{} + } + return t.Node +} + +type GetAllEvents_Events struct { + Edges []*GetAllEvents_Events_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEvents_Events) GetEdges() []*GetAllEvents_Events_Edges { + if t == nil { + t = &GetAllEvents_Events{} + } + return t.Edges +} + +type CreateEvent_CreateEvent_Event_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_User) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_User{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Group) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Group{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Integration) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Integration{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Organization) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Organization{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Invite) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Invite{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Feature) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Feature{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_PersonalAccessToken{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Oauth2token) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Oauth2token{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Hush) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Hush{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Orgmembership) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Orgmembership{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Groupmembership) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Groupmembership{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Entitlement) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Entitlement{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateEvent_CreateEvent_Event_Webhook) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event_Webhook{} + } + return t.ID +} + +type CreateEvent_CreateEvent_Event struct { + ID string "json:\"id\" graphql:\"id\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*CreateEvent_CreateEvent_Event_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*CreateEvent_CreateEvent_Event_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*CreateEvent_CreateEvent_Event_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*CreateEvent_CreateEvent_Event_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*CreateEvent_CreateEvent_Event_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*CreateEvent_CreateEvent_Event_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*CreateEvent_CreateEvent_Event_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*CreateEvent_CreateEvent_Event_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*CreateEvent_CreateEvent_Event_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*CreateEvent_CreateEvent_Event_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*CreateEvent_CreateEvent_Event_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*CreateEvent_CreateEvent_Event_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*CreateEvent_CreateEvent_Event_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *CreateEvent_CreateEvent_Event) GetID() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.ID +} +func (t *CreateEvent_CreateEvent_Event) GetEventID() *string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.EventID +} +func (t *CreateEvent_CreateEvent_Event) GetCorrelationID() *string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.CorrelationID +} +func (t *CreateEvent_CreateEvent_Event) GetEventType() string { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.EventType +} +func (t *CreateEvent_CreateEvent_Event) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Metadata +} +func (t *CreateEvent_CreateEvent_Event) GetUser() []*CreateEvent_CreateEvent_Event_User { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.User +} +func (t *CreateEvent_CreateEvent_Event) GetGroup() []*CreateEvent_CreateEvent_Event_Group { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Group +} +func (t *CreateEvent_CreateEvent_Event) GetIntegration() []*CreateEvent_CreateEvent_Event_Integration { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Integration +} +func (t *CreateEvent_CreateEvent_Event) GetOrganization() []*CreateEvent_CreateEvent_Event_Organization { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Organization +} +func (t *CreateEvent_CreateEvent_Event) GetInvite() []*CreateEvent_CreateEvent_Event_Invite { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Invite +} +func (t *CreateEvent_CreateEvent_Event) GetFeature() []*CreateEvent_CreateEvent_Event_Feature { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Feature +} +func (t *CreateEvent_CreateEvent_Event) GetPersonalAccessToken() []*CreateEvent_CreateEvent_Event_PersonalAccessToken { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.PersonalAccessToken +} +func (t *CreateEvent_CreateEvent_Event) GetOauth2token() []*CreateEvent_CreateEvent_Event_Oauth2token { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Oauth2token +} +func (t *CreateEvent_CreateEvent_Event) GetHush() []*CreateEvent_CreateEvent_Event_Hush { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Hush +} +func (t *CreateEvent_CreateEvent_Event) GetOrgmembership() []*CreateEvent_CreateEvent_Event_Orgmembership { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Orgmembership +} +func (t *CreateEvent_CreateEvent_Event) GetGroupmembership() []*CreateEvent_CreateEvent_Event_Groupmembership { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Groupmembership +} +func (t *CreateEvent_CreateEvent_Event) GetEntitlement() []*CreateEvent_CreateEvent_Event_Entitlement { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Entitlement +} +func (t *CreateEvent_CreateEvent_Event) GetWebhook() []*CreateEvent_CreateEvent_Event_Webhook { + if t == nil { + t = &CreateEvent_CreateEvent_Event{} + } + return t.Webhook +} + +type CreateEvent_CreateEvent struct { + Event CreateEvent_CreateEvent_Event "json:\"event\" graphql:\"event\"" +} + +func (t *CreateEvent_CreateEvent) GetEvent() *CreateEvent_CreateEvent_Event { + if t == nil { + t = &CreateEvent_CreateEvent{} + } + return &t.Event +} + +type CreateBulkEvent_CreateBulkEvent_Events_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_User) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_User{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Group) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Group{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Integration) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Integration{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Organization) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Organization{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Invite) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Invite{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Feature) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Feature{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Oauth2token) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Oauth2token{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Hush) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Hush{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Orgmembership) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Orgmembership{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Groupmembership) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Groupmembership{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Entitlement) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Entitlement{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events_Webhook) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events_Webhook{} + } + return t.ID +} + +type CreateBulkEvent_CreateBulkEvent_Events struct { + ID string "json:\"id\" graphql:\"id\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*CreateBulkEvent_CreateBulkEvent_Events_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*CreateBulkEvent_CreateBulkEvent_Events_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*CreateBulkEvent_CreateBulkEvent_Events_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*CreateBulkEvent_CreateBulkEvent_Events_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*CreateBulkEvent_CreateBulkEvent_Events_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*CreateBulkEvent_CreateBulkEvent_Events_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*CreateBulkEvent_CreateBulkEvent_Events_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*CreateBulkEvent_CreateBulkEvent_Events_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*CreateBulkEvent_CreateBulkEvent_Events_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*CreateBulkEvent_CreateBulkEvent_Events_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*CreateBulkEvent_CreateBulkEvent_Events_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*CreateBulkEvent_CreateBulkEvent_Events_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetID() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.ID +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetEventID() *string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.EventID +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetCorrelationID() *string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.CorrelationID +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetEventType() string { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.EventType +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Metadata +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetUser() []*CreateBulkEvent_CreateBulkEvent_Events_User { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.User +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetGroup() []*CreateBulkEvent_CreateBulkEvent_Events_Group { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Group +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetIntegration() []*CreateBulkEvent_CreateBulkEvent_Events_Integration { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Integration +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetOrganization() []*CreateBulkEvent_CreateBulkEvent_Events_Organization { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Organization +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetInvite() []*CreateBulkEvent_CreateBulkEvent_Events_Invite { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Invite +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetFeature() []*CreateBulkEvent_CreateBulkEvent_Events_Feature { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Feature +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetPersonalAccessToken() []*CreateBulkEvent_CreateBulkEvent_Events_PersonalAccessToken { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.PersonalAccessToken +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetOauth2token() []*CreateBulkEvent_CreateBulkEvent_Events_Oauth2token { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Oauth2token +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetHush() []*CreateBulkEvent_CreateBulkEvent_Events_Hush { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Hush +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetOrgmembership() []*CreateBulkEvent_CreateBulkEvent_Events_Orgmembership { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Orgmembership +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetGroupmembership() []*CreateBulkEvent_CreateBulkEvent_Events_Groupmembership { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Groupmembership +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetEntitlement() []*CreateBulkEvent_CreateBulkEvent_Events_Entitlement { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Entitlement +} +func (t *CreateBulkEvent_CreateBulkEvent_Events) GetWebhook() []*CreateBulkEvent_CreateBulkEvent_Events_Webhook { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent_Events{} + } + return t.Webhook +} + +type CreateBulkEvent_CreateBulkEvent struct { + Events []*CreateBulkEvent_CreateBulkEvent_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkEvent_CreateBulkEvent) GetEvents() []*CreateBulkEvent_CreateBulkEvent_Events { + if t == nil { + t = &CreateBulkEvent_CreateBulkEvent{} + } + return t.Events +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook{} + } + return t.ID +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent_Events struct { + ID string "json:\"id\" graphql:\"id\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.ID +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetEventID() *string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.EventID +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetCorrelationID() *string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.CorrelationID +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetEventType() string { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.EventType +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetMetadata() map[string]interface{} { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Metadata +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetUser() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_User { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.User +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetGroup() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Group { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Group +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetIntegration() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Integration { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Integration +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetOrganization() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Organization { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Organization +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetInvite() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Invite { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Invite +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetFeature() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Feature { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Feature +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetPersonalAccessToken() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_PersonalAccessToken { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.PersonalAccessToken +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetOauth2token() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Oauth2token { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Oauth2token +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetHush() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Hush { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Hush +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetOrgmembership() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Orgmembership { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Orgmembership +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetGroupmembership() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Groupmembership { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Groupmembership +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetEntitlement() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Entitlement { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Entitlement +} +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent_Events) GetWebhook() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events_Webhook { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent_Events{} + } + return t.Webhook +} + +type CreateBulkCSVEvent_CreateBulkCSVEvent struct { + Events []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkCSVEvent_CreateBulkCSVEvent) GetEvents() []*CreateBulkCSVEvent_CreateBulkCSVEvent_Events { + if t == nil { + t = &CreateBulkCSVEvent_CreateBulkCSVEvent{} + } + return t.Events +} + +type UpdateEvent_UpdateEvent_Event_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_User) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_User{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Group) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Group{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Integration) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Integration{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Organization) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Organization{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Invite struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Invite) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Invite{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Feature struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Feature) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Feature{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_PersonalAccessToken struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_PersonalAccessToken) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_PersonalAccessToken{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Oauth2token struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Oauth2token) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Oauth2token{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Hush struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Hush) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Hush{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Orgmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Orgmembership) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Orgmembership{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Groupmembership struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Groupmembership) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Groupmembership{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Entitlement struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Entitlement) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Entitlement{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event_Webhook struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateEvent_UpdateEvent_Event_Webhook) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event_Webhook{} + } + return t.ID +} + +type UpdateEvent_UpdateEvent_Event struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + User []*UpdateEvent_UpdateEvent_Event_User "json:\"user,omitempty\" graphql:\"user\"" + Group []*UpdateEvent_UpdateEvent_Event_Group "json:\"group,omitempty\" graphql:\"group\"" + Integration []*UpdateEvent_UpdateEvent_Event_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Organization []*UpdateEvent_UpdateEvent_Event_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Invite []*UpdateEvent_UpdateEvent_Event_Invite "json:\"invite,omitempty\" graphql:\"invite\"" + Feature []*UpdateEvent_UpdateEvent_Event_Feature "json:\"feature,omitempty\" graphql:\"feature\"" + PersonalAccessToken []*UpdateEvent_UpdateEvent_Event_PersonalAccessToken "json:\"personalAccessToken,omitempty\" graphql:\"personalAccessToken\"" + Oauth2token []*UpdateEvent_UpdateEvent_Event_Oauth2token "json:\"oauth2token,omitempty\" graphql:\"oauth2token\"" + Hush []*UpdateEvent_UpdateEvent_Event_Hush "json:\"hush,omitempty\" graphql:\"hush\"" + Orgmembership []*UpdateEvent_UpdateEvent_Event_Orgmembership "json:\"orgmembership,omitempty\" graphql:\"orgmembership\"" + Groupmembership []*UpdateEvent_UpdateEvent_Event_Groupmembership "json:\"groupmembership,omitempty\" graphql:\"groupmembership\"" + Entitlement []*UpdateEvent_UpdateEvent_Event_Entitlement "json:\"entitlement,omitempty\" graphql:\"entitlement\"" + Webhook []*UpdateEvent_UpdateEvent_Event_Webhook "json:\"webhook,omitempty\" graphql:\"webhook\"" +} + +func (t *UpdateEvent_UpdateEvent_Event) GetID() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.ID +} +func (t *UpdateEvent_UpdateEvent_Event) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.CreatedAt +} +func (t *UpdateEvent_UpdateEvent_Event) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.UpdatedAt +} +func (t *UpdateEvent_UpdateEvent_Event) GetCreatedBy() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.CreatedBy +} +func (t *UpdateEvent_UpdateEvent_Event) GetUpdatedBy() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.UpdatedBy +} +func (t *UpdateEvent_UpdateEvent_Event) GetEventID() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.EventID +} +func (t *UpdateEvent_UpdateEvent_Event) GetCorrelationID() *string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.CorrelationID +} +func (t *UpdateEvent_UpdateEvent_Event) GetEventType() string { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.EventType +} +func (t *UpdateEvent_UpdateEvent_Event) GetMetadata() map[string]interface{} { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Metadata +} +func (t *UpdateEvent_UpdateEvent_Event) GetUser() []*UpdateEvent_UpdateEvent_Event_User { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.User +} +func (t *UpdateEvent_UpdateEvent_Event) GetGroup() []*UpdateEvent_UpdateEvent_Event_Group { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Group +} +func (t *UpdateEvent_UpdateEvent_Event) GetIntegration() []*UpdateEvent_UpdateEvent_Event_Integration { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Integration +} +func (t *UpdateEvent_UpdateEvent_Event) GetOrganization() []*UpdateEvent_UpdateEvent_Event_Organization { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Organization +} +func (t *UpdateEvent_UpdateEvent_Event) GetInvite() []*UpdateEvent_UpdateEvent_Event_Invite { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Invite +} +func (t *UpdateEvent_UpdateEvent_Event) GetFeature() []*UpdateEvent_UpdateEvent_Event_Feature { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Feature +} +func (t *UpdateEvent_UpdateEvent_Event) GetPersonalAccessToken() []*UpdateEvent_UpdateEvent_Event_PersonalAccessToken { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.PersonalAccessToken +} +func (t *UpdateEvent_UpdateEvent_Event) GetOauth2token() []*UpdateEvent_UpdateEvent_Event_Oauth2token { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Oauth2token +} +func (t *UpdateEvent_UpdateEvent_Event) GetHush() []*UpdateEvent_UpdateEvent_Event_Hush { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Hush +} +func (t *UpdateEvent_UpdateEvent_Event) GetOrgmembership() []*UpdateEvent_UpdateEvent_Event_Orgmembership { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Orgmembership +} +func (t *UpdateEvent_UpdateEvent_Event) GetGroupmembership() []*UpdateEvent_UpdateEvent_Event_Groupmembership { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Groupmembership +} +func (t *UpdateEvent_UpdateEvent_Event) GetEntitlement() []*UpdateEvent_UpdateEvent_Event_Entitlement { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Entitlement +} +func (t *UpdateEvent_UpdateEvent_Event) GetWebhook() []*UpdateEvent_UpdateEvent_Event_Webhook { + if t == nil { + t = &UpdateEvent_UpdateEvent_Event{} + } + return t.Webhook +} + +type UpdateEvent_UpdateEvent struct { + Event UpdateEvent_UpdateEvent_Event "json:\"event\" graphql:\"event\"" +} + +func (t *UpdateEvent_UpdateEvent) GetEvent() *UpdateEvent_UpdateEvent_Event { + if t == nil { + t = &UpdateEvent_UpdateEvent{} + } + return &t.Event +} + +type DeleteEvent_DeleteEvent struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteEvent_DeleteEvent) GetDeletedID() string { + if t == nil { + t = &DeleteEvent_DeleteEvent{} + } + return t.DeletedID +} + +type GetAllEventHistories_EventHistories_Edges_Node struct { + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.EventID +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetEventType() string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.EventType +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllEventHistories_EventHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllEventHistories_EventHistories_Edges struct { + Node *GetAllEventHistories_EventHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllEventHistories_EventHistories_Edges) GetNode() *GetAllEventHistories_EventHistories_Edges_Node { + if t == nil { + t = &GetAllEventHistories_EventHistories_Edges{} + } + return t.Node +} + +type GetAllEventHistories_EventHistories struct { + Edges []*GetAllEventHistories_EventHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllEventHistories_EventHistories) GetEdges() []*GetAllEventHistories_EventHistories_Edges { + if t == nil { + t = &GetAllEventHistories_EventHistories{} + } + return t.Edges +} + +type GetEventHistories_EventHistories_Edges_Node struct { + CorrelationID *string "json:\"correlationID,omitempty\" graphql:\"correlationID\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EventID *string "json:\"eventID,omitempty\" graphql:\"eventID\"" + EventType string "json:\"eventType\" graphql:\"eventType\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetEventHistories_EventHistories_Edges_Node) GetCorrelationID() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.CorrelationID +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetEventID() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.EventID +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetEventType() string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.EventType +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.ID +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetEventHistories_EventHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetEventHistories_EventHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetEventHistories_EventHistories_Edges struct { + Node *GetEventHistories_EventHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetEventHistories_EventHistories_Edges) GetNode() *GetEventHistories_EventHistories_Edges_Node { + if t == nil { + t = &GetEventHistories_EventHistories_Edges{} + } + return t.Node +} + +type GetEventHistories_EventHistories struct { + Edges []*GetEventHistories_EventHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetEventHistories_EventHistories) GetEdges() []*GetEventHistories_EventHistories_Edges { + if t == nil { + t = &GetEventHistories_EventHistories{} + } + return t.Edges +} + +type CreateBulkCSVFeature_CreateBulkCSVFeature_Features struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Description +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetEnabled() bool { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Enabled +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetID() string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.ID +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetName() string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Name +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetDisplayName() *string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.DisplayName +} +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature_Features) GetTags() []string { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature_Features{} + } + return t.Tags +} + +type CreateBulkCSVFeature_CreateBulkCSVFeature struct { + Features []*CreateBulkCSVFeature_CreateBulkCSVFeature_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *CreateBulkCSVFeature_CreateBulkCSVFeature) GetFeatures() []*CreateBulkCSVFeature_CreateBulkCSVFeature_Features { + if t == nil { + t = &CreateBulkCSVFeature_CreateBulkCSVFeature{} + } + return t.Features +} + +type CreateBulkFeature_CreateBulkFeature_Features struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetDescription() *string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Description +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetEnabled() bool { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Enabled +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetID() string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.ID +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetName() string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Name +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetDisplayName() *string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.DisplayName +} +func (t *CreateBulkFeature_CreateBulkFeature_Features) GetTags() []string { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature_Features{} + } + return t.Tags +} + +type CreateBulkFeature_CreateBulkFeature struct { + Features []*CreateBulkFeature_CreateBulkFeature_Features "json:\"features,omitempty\" graphql:\"features\"" +} + +func (t *CreateBulkFeature_CreateBulkFeature) GetFeatures() []*CreateBulkFeature_CreateBulkFeature_Features { + if t == nil { + t = &CreateBulkFeature_CreateBulkFeature{} + } + return t.Features +} + +type CreateFeature_CreateFeature_Feature struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateFeature_CreateFeature_Feature) GetDescription() *string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Description +} +func (t *CreateFeature_CreateFeature_Feature) GetEnabled() bool { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Enabled +} +func (t *CreateFeature_CreateFeature_Feature) GetID() string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.ID +} +func (t *CreateFeature_CreateFeature_Feature) GetName() string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Name +} +func (t *CreateFeature_CreateFeature_Feature) GetDisplayName() *string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.DisplayName +} +func (t *CreateFeature_CreateFeature_Feature) GetTags() []string { + if t == nil { + t = &CreateFeature_CreateFeature_Feature{} + } + return t.Tags +} + +type CreateFeature_CreateFeature struct { + Feature CreateFeature_CreateFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *CreateFeature_CreateFeature) GetFeature() *CreateFeature_CreateFeature_Feature { + if t == nil { + t = &CreateFeature_CreateFeature{} + } + return &t.Feature +} + +type DeleteFeature_DeleteFeature struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteFeature_DeleteFeature) GetDeletedID() string { + if t == nil { + t = &DeleteFeature_DeleteFeature{} + } + return t.DeletedID +} + +type GetAllFeatures_Features_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetAllFeatures_Features_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Description +} +func (t *GetAllFeatures_Features_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllFeatures_Features_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.ID +} +func (t *GetAllFeatures_Features_Edges_Node) GetName() string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Name +} +func (t *GetAllFeatures_Features_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllFeatures_Features_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllFeatures_Features_Edges_Node{} + } + return t.Tags +} + +type GetAllFeatures_Features_Edges struct { + Node *GetAllFeatures_Features_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFeatures_Features_Edges) GetNode() *GetAllFeatures_Features_Edges_Node { + if t == nil { + t = &GetAllFeatures_Features_Edges{} + } + return t.Node +} + +type GetAllFeatures_Features struct { + Edges []*GetAllFeatures_Features_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFeatures_Features) GetEdges() []*GetAllFeatures_Features_Edges { + if t == nil { + t = &GetAllFeatures_Features{} + } + return t.Edges +} + +type GetFeatureByID_Feature struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetFeatureByID_Feature) GetDescription() *string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Description +} +func (t *GetFeatureByID_Feature) GetEnabled() bool { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Enabled +} +func (t *GetFeatureByID_Feature) GetID() string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.ID +} +func (t *GetFeatureByID_Feature) GetName() string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Name +} +func (t *GetFeatureByID_Feature) GetDisplayName() *string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.DisplayName +} +func (t *GetFeatureByID_Feature) GetTags() []string { + if t == nil { + t = &GetFeatureByID_Feature{} + } + return t.Tags +} + +type GetFeatures_Features_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetFeatures_Features_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Description +} +func (t *GetFeatures_Features_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Enabled +} +func (t *GetFeatures_Features_Edges_Node) GetID() string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.ID +} +func (t *GetFeatures_Features_Edges_Node) GetName() string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Name +} +func (t *GetFeatures_Features_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.DisplayName +} +func (t *GetFeatures_Features_Edges_Node) GetTags() []string { + if t == nil { + t = &GetFeatures_Features_Edges_Node{} + } + return t.Tags +} + +type GetFeatures_Features_Edges struct { + Node *GetFeatures_Features_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFeatures_Features_Edges) GetNode() *GetFeatures_Features_Edges_Node { + if t == nil { + t = &GetFeatures_Features_Edges{} + } + return t.Node +} + +type GetFeatures_Features struct { + Edges []*GetFeatures_Features_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFeatures_Features) GetEdges() []*GetFeatures_Features_Edges { + if t == nil { + t = &GetFeatures_Features{} + } + return t.Edges +} + +type UpdateFeature_UpdateFeature_Feature struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *UpdateFeature_UpdateFeature_Feature) GetDescription() *string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Description +} +func (t *UpdateFeature_UpdateFeature_Feature) GetEnabled() bool { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Enabled +} +func (t *UpdateFeature_UpdateFeature_Feature) GetID() string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.ID +} +func (t *UpdateFeature_UpdateFeature_Feature) GetName() string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Name +} +func (t *UpdateFeature_UpdateFeature_Feature) GetDisplayName() *string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.DisplayName +} +func (t *UpdateFeature_UpdateFeature_Feature) GetTags() []string { + if t == nil { + t = &UpdateFeature_UpdateFeature_Feature{} + } + return t.Tags +} + +type UpdateFeature_UpdateFeature struct { + Feature UpdateFeature_UpdateFeature_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *UpdateFeature_UpdateFeature) GetFeature() *UpdateFeature_UpdateFeature_Feature { + if t == nil { + t = &UpdateFeature_UpdateFeature{} + } + return &t.Feature +} + +type GetAllFeatureHistories_FeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllFeatureHistories_FeatureHistories_Edges struct { + Node *GetAllFeatureHistories_FeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFeatureHistories_FeatureHistories_Edges) GetNode() *GetAllFeatureHistories_FeatureHistories_Edges_Node { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories_Edges{} + } + return t.Node +} + +type GetAllFeatureHistories_FeatureHistories struct { + Edges []*GetAllFeatureHistories_FeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFeatureHistories_FeatureHistories) GetEdges() []*GetAllFeatureHistories_FeatureHistories_Edges { + if t == nil { + t = &GetAllFeatureHistories_FeatureHistories{} + } + return t.Edges +} + +type GetFeatureHistories_FeatureHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName *string "json:\"displayName,omitempty\" graphql:\"displayName\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Metadata map[string]interface{} "json:\"metadata,omitempty\" graphql:\"metadata\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Description +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetDisplayName() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.ID +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetMetadata() map[string]interface{} { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Metadata +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Name +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetFeatureHistories_FeatureHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetFeatureHistories_FeatureHistories_Edges struct { + Node *GetFeatureHistories_FeatureHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFeatureHistories_FeatureHistories_Edges) GetNode() *GetFeatureHistories_FeatureHistories_Edges_Node { + if t == nil { + t = &GetFeatureHistories_FeatureHistories_Edges{} + } + return t.Node +} + +type GetFeatureHistories_FeatureHistories struct { + Edges []*GetFeatureHistories_FeatureHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFeatureHistories_FeatureHistories) GetEdges() []*GetFeatureHistories_FeatureHistories_Edges { + if t == nil { + t = &GetFeatureHistories_FeatureHistories{} + } + return t.Edges +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files_User) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files_User{} + } + return t.ID +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization{} + } + return t.ID +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files_Group) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files_Group{} + } + return t.ID +} + +type CreateBulkCSVFile_CreateBulkCSVFile_Files struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + User *CreateBulkCSVFile_CreateBulkCSVFile_Files_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetAnnotation() *string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Annotation +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetCategory() *string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Category +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetContentType() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.ContentType +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetFileExtension() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.FileExtension +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetFileName() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.FileName +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetFileSize() *int64 { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.FileSize +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetID() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.ID +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetStoreKey() string { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.StoreKey +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetUser() *CreateBulkCSVFile_CreateBulkCSVFile_Files_User { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.User +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetOrganization() []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Organization { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Organization +} +func (t *CreateBulkCSVFile_CreateBulkCSVFile_Files) GetGroup() []*CreateBulkCSVFile_CreateBulkCSVFile_Files_Group { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile_Files{} + } + return t.Group +} + +type CreateBulkCSVFile_CreateBulkCSVFile struct { + Files []*CreateBulkCSVFile_CreateBulkCSVFile_Files "json:\"files,omitempty\" graphql:\"files\"" +} + +func (t *CreateBulkCSVFile_CreateBulkCSVFile) GetFiles() []*CreateBulkCSVFile_CreateBulkCSVFile_Files { + if t == nil { + t = &CreateBulkCSVFile_CreateBulkCSVFile{} + } + return t.Files +} + +type CreateBulkFile_CreateBulkFile_Files_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files_User) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files_User{} + } + return t.ID +} + +type CreateBulkFile_CreateBulkFile_Files_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files_Organization) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files_Organization{} + } + return t.ID +} + +type CreateBulkFile_CreateBulkFile_Files_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files_Group) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files_Group{} + } + return t.ID +} + +type CreateBulkFile_CreateBulkFile_Files struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + User *CreateBulkFile_CreateBulkFile_Files_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*CreateBulkFile_CreateBulkFile_Files_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*CreateBulkFile_CreateBulkFile_Files_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *CreateBulkFile_CreateBulkFile_Files) GetAnnotation() *string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Annotation +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetCategory() *string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Category +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetContentType() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.ContentType +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetFileExtension() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.FileExtension +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetFileName() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.FileName +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetFileSize() *int64 { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.FileSize +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetID() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.ID +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetStoreKey() string { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.StoreKey +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetUser() *CreateBulkFile_CreateBulkFile_Files_User { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.User +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetOrganization() []*CreateBulkFile_CreateBulkFile_Files_Organization { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Organization +} +func (t *CreateBulkFile_CreateBulkFile_Files) GetGroup() []*CreateBulkFile_CreateBulkFile_Files_Group { + if t == nil { + t = &CreateBulkFile_CreateBulkFile_Files{} + } + return t.Group +} + +type CreateBulkFile_CreateBulkFile struct { + Files []*CreateBulkFile_CreateBulkFile_Files "json:\"files,omitempty\" graphql:\"files\"" +} + +func (t *CreateBulkFile_CreateBulkFile) GetFiles() []*CreateBulkFile_CreateBulkFile_Files { + if t == nil { + t = &CreateBulkFile_CreateBulkFile{} + } + return t.Files +} + +type CreateFile_CreateFile_File_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateFile_CreateFile_File_User) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File_User{} + } + return t.ID +} + +type CreateFile_CreateFile_File_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateFile_CreateFile_File_Organization) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File_Organization{} + } + return t.ID +} + +type CreateFile_CreateFile_File_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateFile_CreateFile_File_Group) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File_Group{} + } + return t.ID +} + +type CreateFile_CreateFile_File struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + User *CreateFile_CreateFile_File_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*CreateFile_CreateFile_File_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*CreateFile_CreateFile_File_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *CreateFile_CreateFile_File) GetAnnotation() *string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Annotation +} +func (t *CreateFile_CreateFile_File) GetCategory() *string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Category +} +func (t *CreateFile_CreateFile_File) GetContentType() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.ContentType +} +func (t *CreateFile_CreateFile_File) GetFileExtension() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.FileExtension +} +func (t *CreateFile_CreateFile_File) GetFileName() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.FileName +} +func (t *CreateFile_CreateFile_File) GetFileSize() *int64 { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.FileSize +} +func (t *CreateFile_CreateFile_File) GetID() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.ID +} +func (t *CreateFile_CreateFile_File) GetStoreKey() string { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.StoreKey +} +func (t *CreateFile_CreateFile_File) GetUser() *CreateFile_CreateFile_File_User { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.User +} +func (t *CreateFile_CreateFile_File) GetOrganization() []*CreateFile_CreateFile_File_Organization { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Organization +} +func (t *CreateFile_CreateFile_File) GetGroup() []*CreateFile_CreateFile_File_Group { + if t == nil { + t = &CreateFile_CreateFile_File{} + } + return t.Group +} + +type CreateFile_CreateFile struct { + File CreateFile_CreateFile_File "json:\"file\" graphql:\"file\"" +} + +func (t *CreateFile_CreateFile) GetFile() *CreateFile_CreateFile_File { + if t == nil { + t = &CreateFile_CreateFile{} + } + return &t.File +} + +type DeleteFile_DeleteFile struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteFile_DeleteFile) GetDeletedID() string { + if t == nil { + t = &DeleteFile_DeleteFile{} + } + return t.DeletedID +} + +type GetAllFiles_Files_Edges_Node_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllFiles_Files_Edges_Node_User) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node_User{} + } + return t.ID +} + +type GetAllFiles_Files_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllFiles_Files_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node_Organization{} + } + return t.ID +} + +type GetAllFiles_Files_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllFiles_Files_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node_Group{} + } + return t.ID +} + +type GetAllFiles_Files_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + User *GetAllFiles_Files_Edges_Node_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*GetAllFiles_Files_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*GetAllFiles_Files_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *GetAllFiles_Files_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Annotation +} +func (t *GetAllFiles_Files_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Category +} +func (t *GetAllFiles_Files_Edges_Node) GetContentType() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.ContentType +} +func (t *GetAllFiles_Files_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllFiles_Files_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllFiles_Files_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.FileExtension +} +func (t *GetAllFiles_Files_Edges_Node) GetFileName() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.FileName +} +func (t *GetAllFiles_Files_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.FileSize +} +func (t *GetAllFiles_Files_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.ID +} +func (t *GetAllFiles_Files_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.StoreKey +} +func (t *GetAllFiles_Files_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllFiles_Files_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllFiles_Files_Edges_Node) GetUser() *GetAllFiles_Files_Edges_Node_User { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.User +} +func (t *GetAllFiles_Files_Edges_Node) GetOrganization() []*GetAllFiles_Files_Edges_Node_Organization { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Organization +} +func (t *GetAllFiles_Files_Edges_Node) GetGroup() []*GetAllFiles_Files_Edges_Node_Group { + if t == nil { + t = &GetAllFiles_Files_Edges_Node{} + } + return t.Group +} + +type GetAllFiles_Files_Edges struct { + Node *GetAllFiles_Files_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFiles_Files_Edges) GetNode() *GetAllFiles_Files_Edges_Node { + if t == nil { + t = &GetAllFiles_Files_Edges{} + } + return t.Node +} + +type GetAllFiles_Files struct { + Edges []*GetAllFiles_Files_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFiles_Files) GetEdges() []*GetAllFiles_Files_Edges { + if t == nil { + t = &GetAllFiles_Files{} + } + return t.Edges +} + +type GetFiles_Files_Edges_Node_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetFiles_Files_Edges_Node_User) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node_User{} + } + return t.ID +} + +type GetFiles_Files_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetFiles_Files_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node_Organization{} + } + return t.ID +} + +type GetFiles_Files_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetFiles_Files_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node_Group{} + } + return t.ID +} + +type GetFiles_Files_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ID string "json:\"id\" graphql:\"id\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + User *GetFiles_Files_Edges_Node_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*GetFiles_Files_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*GetFiles_Files_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *GetFiles_Files_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Annotation +} +func (t *GetFiles_Files_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Category +} +func (t *GetFiles_Files_Edges_Node) GetContentType() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.ContentType +} +func (t *GetFiles_Files_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetFiles_Files_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetFiles_Files_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.FileExtension +} +func (t *GetFiles_Files_Edges_Node) GetFileName() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.FileName +} +func (t *GetFiles_Files_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.FileSize +} +func (t *GetFiles_Files_Edges_Node) GetID() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.ID +} +func (t *GetFiles_Files_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.StoreKey +} +func (t *GetFiles_Files_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetFiles_Files_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetFiles_Files_Edges_Node) GetUser() *GetFiles_Files_Edges_Node_User { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.User +} +func (t *GetFiles_Files_Edges_Node) GetOrganization() []*GetFiles_Files_Edges_Node_Organization { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Organization +} +func (t *GetFiles_Files_Edges_Node) GetGroup() []*GetFiles_Files_Edges_Node_Group { + if t == nil { + t = &GetFiles_Files_Edges_Node{} + } + return t.Group +} + +type GetFiles_Files_Edges struct { + Node *GetFiles_Files_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFiles_Files_Edges) GetNode() *GetFiles_Files_Edges_Node { + if t == nil { + t = &GetFiles_Files_Edges{} + } + return t.Node +} + +type GetFiles_Files struct { + Edges []*GetFiles_Files_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFiles_Files) GetEdges() []*GetFiles_Files_Edges { + if t == nil { + t = &GetFiles_Files{} + } + return t.Edges +} + +type UpdateFile_UpdateFile_File_User struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateFile_UpdateFile_File_User) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File_User{} + } + return t.ID +} + +type UpdateFile_UpdateFile_File_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateFile_UpdateFile_File_Organization) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File_Organization{} + } + return t.ID +} + +type UpdateFile_UpdateFile_File_Group struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateFile_UpdateFile_File_Group) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File_Group{} + } + return t.ID +} + +type UpdateFile_UpdateFile_File struct { + ID string "json:\"id\" graphql:\"id\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + User *UpdateFile_UpdateFile_File_User "json:\"user,omitempty\" graphql:\"user\"" + Organization []*UpdateFile_UpdateFile_File_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Group []*UpdateFile_UpdateFile_File_Group "json:\"group,omitempty\" graphql:\"group\"" +} + +func (t *UpdateFile_UpdateFile_File) GetID() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.ID +} +func (t *UpdateFile_UpdateFile_File) GetFileName() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.FileName +} +func (t *UpdateFile_UpdateFile_File) GetFileExtension() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.FileExtension +} +func (t *UpdateFile_UpdateFile_File) GetFileSize() *int64 { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.FileSize +} +func (t *UpdateFile_UpdateFile_File) GetContentType() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.ContentType +} +func (t *UpdateFile_UpdateFile_File) GetStoreKey() string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.StoreKey +} +func (t *UpdateFile_UpdateFile_File) GetCategory() *string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Category +} +func (t *UpdateFile_UpdateFile_File) GetAnnotation() *string { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Annotation +} +func (t *UpdateFile_UpdateFile_File) GetUser() *UpdateFile_UpdateFile_File_User { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.User +} +func (t *UpdateFile_UpdateFile_File) GetOrganization() []*UpdateFile_UpdateFile_File_Organization { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Organization +} +func (t *UpdateFile_UpdateFile_File) GetGroup() []*UpdateFile_UpdateFile_File_Group { + if t == nil { + t = &UpdateFile_UpdateFile_File{} + } + return t.Group +} + +type UpdateFile_UpdateFile struct { + File UpdateFile_UpdateFile_File "json:\"file\" graphql:\"file\"" +} + +func (t *UpdateFile_UpdateFile) GetFile() *UpdateFile_UpdateFile_File { + if t == nil { + t = &UpdateFile_UpdateFile{} + } + return &t.File +} + +type GetAllFileHistories_FileHistories_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Annotation +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Category +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetContentType() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.ContentType +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.FileExtension +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetFileName() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.FileName +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.FileSize +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.StoreKey +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllFileHistories_FileHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllFileHistories_FileHistories_Edges struct { + Node *GetAllFileHistories_FileHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllFileHistories_FileHistories_Edges) GetNode() *GetAllFileHistories_FileHistories_Edges_Node { + if t == nil { + t = &GetAllFileHistories_FileHistories_Edges{} + } + return t.Node +} + +type GetAllFileHistories_FileHistories struct { + Edges []*GetAllFileHistories_FileHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllFileHistories_FileHistories) GetEdges() []*GetAllFileHistories_FileHistories_Edges { + if t == nil { + t = &GetAllFileHistories_FileHistories{} + } + return t.Edges +} + +type GetFileHistories_FileHistories_Edges_Node struct { + Annotation *string "json:\"annotation,omitempty\" graphql:\"annotation\"" + Category *string "json:\"category,omitempty\" graphql:\"category\"" + ContentType string "json:\"contentType\" graphql:\"contentType\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + FileExtension string "json:\"fileExtension\" graphql:\"fileExtension\"" + FileName string "json:\"fileName\" graphql:\"fileName\"" + FileSize *int64 "json:\"fileSize,omitempty\" graphql:\"fileSize\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + StoreKey string "json:\"storeKey\" graphql:\"storeKey\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetFileHistories_FileHistories_Edges_Node) GetAnnotation() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Annotation +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetCategory() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Category +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetContentType() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.ContentType +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetFileExtension() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.FileExtension +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetFileName() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.FileName +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetFileSize() *int64 { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.FileSize +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.ID +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetStoreKey() string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.StoreKey +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetFileHistories_FileHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetFileHistories_FileHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetFileHistories_FileHistories_Edges struct { + Node *GetFileHistories_FileHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetFileHistories_FileHistories_Edges) GetNode() *GetFileHistories_FileHistories_Edges_Node { + if t == nil { + t = &GetFileHistories_FileHistories_Edges{} + } + return t.Node +} + +type GetFileHistories_FileHistories struct { + Edges []*GetFileHistories_FileHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetFileHistories_FileHistories) GetEdges() []*GetFileHistories_FileHistories_Edges { + if t == nil { + t = &GetFileHistories_FileHistories{} + } + return t.Edges +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner{} + } + return t.DisplayName +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return &t.JoinPolicy +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.SyncToGithub +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.SyncToSlack +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetTags() []string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return t.Tags +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting{} + } + return &t.Visibility +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User{} + } + return t.FirstName +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User) GetLastName() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User{} + } + return t.LastName +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members{} + } + return &t.Role +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members) GetUser() *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members_User { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members{} + } + return &t.User +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup_Groups struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting "json:\"setting\" graphql:\"setting\"" + Members []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Description +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.DisplayName +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetID() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.ID +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetLogoURL() *string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.LogoURL +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetName() string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Name +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetTags() []string { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Tags +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetOwner() *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Owner { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Owner +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetSetting() *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Setting { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return &t.Setting +} +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup_Groups) GetMembers() []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups_Members { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup_Groups{} + } + return t.Members +} + +type CreateBulkCSVGroup_CreateBulkCSVGroup struct { + Groups []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups "json:\"groups,omitempty\" graphql:\"groups\"" +} + +func (t *CreateBulkCSVGroup_CreateBulkCSVGroup) GetGroups() []*CreateBulkCSVGroup_CreateBulkCSVGroup_Groups { + if t == nil { + t = &CreateBulkCSVGroup_CreateBulkCSVGroup{} + } + return t.Groups +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Owner) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Owner{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Owner) GetDisplayName() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Owner{} + } + return t.DisplayName +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return &t.JoinPolicy +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.SyncToGithub +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.SyncToSlack +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetTags() []string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return t.Tags +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Setting{} + } + return &t.Visibility +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members_User) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members_User{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members_User{} + } + return t.FirstName +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members_User) GetLastName() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members_User{} + } + return t.LastName +} + +type CreateBulkGroup_CreateBulkGroup_Groups_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User CreateBulkGroup_CreateBulkGroup_Groups_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members{} + } + return &t.Role +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups_Members) GetUser() *CreateBulkGroup_CreateBulkGroup_Groups_Members_User { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups_Members{} + } + return &t.User +} + +type CreateBulkGroup_CreateBulkGroup_Groups struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *CreateBulkGroup_CreateBulkGroup_Groups_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting CreateBulkGroup_CreateBulkGroup_Groups_Setting "json:\"setting\" graphql:\"setting\"" + Members []*CreateBulkGroup_CreateBulkGroup_Groups_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetDescription() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Description +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetDisplayName() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.DisplayName +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetID() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.ID +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetLogoURL() *string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.LogoURL +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetName() string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Name +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetTags() []string { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Tags +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetOwner() *CreateBulkGroup_CreateBulkGroup_Groups_Owner { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Owner +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetSetting() *CreateBulkGroup_CreateBulkGroup_Groups_Setting { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return &t.Setting +} +func (t *CreateBulkGroup_CreateBulkGroup_Groups) GetMembers() []*CreateBulkGroup_CreateBulkGroup_Groups_Members { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup_Groups{} + } + return t.Members +} + +type CreateBulkGroup_CreateBulkGroup struct { + Groups []*CreateBulkGroup_CreateBulkGroup_Groups "json:\"groups,omitempty\" graphql:\"groups\"" +} + +func (t *CreateBulkGroup_CreateBulkGroup) GetGroups() []*CreateBulkGroup_CreateBulkGroup_Groups { + if t == nil { + t = &CreateBulkGroup_CreateBulkGroup{} + } + return t.Groups +} + +type CreateGroup_CreateGroup_Group_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *CreateGroup_CreateGroup_Group_Owner) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Owner{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Owner) GetDisplayName() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Owner{} + } + return t.DisplayName +} + +type CreateGroup_CreateGroup_Group_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *CreateGroup_CreateGroup_Group_Setting) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return &t.JoinPolicy +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.SyncToGithub +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.SyncToSlack +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetTags() []string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return t.Tags +} +func (t *CreateGroup_CreateGroup_Group_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Setting{} + } + return &t.Visibility +} + +type CreateGroup_CreateGroup_Group_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateGroup_CreateGroup_Group_Members_User) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members_User{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Members_User) GetFirstName() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members_User{} + } + return t.FirstName +} +func (t *CreateGroup_CreateGroup_Group_Members_User) GetLastName() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members_User{} + } + return t.LastName +} + +type CreateGroup_CreateGroup_Group_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User CreateGroup_CreateGroup_Group_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateGroup_CreateGroup_Group_Members) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group_Members) GetRole() *enums.Role { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members{} + } + return &t.Role +} +func (t *CreateGroup_CreateGroup_Group_Members) GetUser() *CreateGroup_CreateGroup_Group_Members_User { + if t == nil { + t = &CreateGroup_CreateGroup_Group_Members{} + } + return &t.User +} + +type CreateGroup_CreateGroup_Group struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *CreateGroup_CreateGroup_Group_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting CreateGroup_CreateGroup_Group_Setting "json:\"setting\" graphql:\"setting\"" + Members []*CreateGroup_CreateGroup_Group_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *CreateGroup_CreateGroup_Group) GetDescription() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Description +} +func (t *CreateGroup_CreateGroup_Group) GetDisplayName() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.DisplayName +} +func (t *CreateGroup_CreateGroup_Group) GetID() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.ID +} +func (t *CreateGroup_CreateGroup_Group) GetLogoURL() *string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.LogoURL +} +func (t *CreateGroup_CreateGroup_Group) GetName() string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Name +} +func (t *CreateGroup_CreateGroup_Group) GetTags() []string { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Tags +} +func (t *CreateGroup_CreateGroup_Group) GetOwner() *CreateGroup_CreateGroup_Group_Owner { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Owner +} +func (t *CreateGroup_CreateGroup_Group) GetSetting() *CreateGroup_CreateGroup_Group_Setting { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return &t.Setting +} +func (t *CreateGroup_CreateGroup_Group) GetMembers() []*CreateGroup_CreateGroup_Group_Members { + if t == nil { + t = &CreateGroup_CreateGroup_Group{} + } + return t.Members +} + +type CreateGroup_CreateGroup struct { + Group CreateGroup_CreateGroup_Group "json:\"group\" graphql:\"group\"" +} + +func (t *CreateGroup_CreateGroup) GetGroup() *CreateGroup_CreateGroup_Group { + if t == nil { + t = &CreateGroup_CreateGroup{} + } + return &t.Group +} + +type DeleteGroup_DeleteGroup struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteGroup_DeleteGroup) GetDeletedID() string { + if t == nil { + t = &DeleteGroup_DeleteGroup{} + } + return t.DeletedID +} + +type GetAllGroups_Groups_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Owner{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Owner) GetDisplayName() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Owner{} + } + return t.DisplayName +} + +type GetAllGroups_Groups_Edges_Node_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return &t.JoinPolicy +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToGithub +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToSlack +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.Tags +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetAllGroups_Groups_Edges_Node_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Setting{} + } + return &t.Visibility +} + +type GetAllGroups_Groups_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetAllGroups_Groups_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetAllGroups_Groups_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetAllGroups_Groups_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetAllGroups_Groups_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetAllGroups_Groups_Edges_Node_Members) GetUser() *GetAllGroups_Groups_Edges_Node_Members_User { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node_Members{} + } + return &t.User +} + +type GetAllGroups_Groups_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *GetAllGroups_Groups_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting GetAllGroups_Groups_Edges_Node_Setting "json:\"setting\" graphql:\"setting\"" + Members []*GetAllGroups_Groups_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllGroups_Groups_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Description +} +func (t *GetAllGroups_Groups_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllGroups_Groups_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroups_Groups_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.LogoURL +} +func (t *GetAllGroups_Groups_Edges_Node) GetName() string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Name +} +func (t *GetAllGroups_Groups_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroups_Groups_Edges_Node) GetOwner() *GetAllGroups_Groups_Edges_Node_Owner { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Owner +} +func (t *GetAllGroups_Groups_Edges_Node) GetSetting() *GetAllGroups_Groups_Edges_Node_Setting { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return &t.Setting +} +func (t *GetAllGroups_Groups_Edges_Node) GetMembers() []*GetAllGroups_Groups_Edges_Node_Members { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.Members +} +func (t *GetAllGroups_Groups_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroups_Groups_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroups_Groups_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroups_Groups_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroups_Groups_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllGroups_Groups_Edges struct { + Node *GetAllGroups_Groups_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroups_Groups_Edges) GetNode() *GetAllGroups_Groups_Edges_Node { + if t == nil { + t = &GetAllGroups_Groups_Edges{} + } + return t.Node +} + +type GetAllGroups_Groups struct { + Edges []*GetAllGroups_Groups_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroups_Groups) GetEdges() []*GetAllGroups_Groups_Edges { + if t == nil { + t = &GetAllGroups_Groups{} + } + return t.Edges +} + +type GetGroupByID_Group_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *GetGroupByID_Group_Owner) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Owner{} + } + return t.ID +} +func (t *GetGroupByID_Group_Owner) GetDisplayName() string { + if t == nil { + t = &GetGroupByID_Group_Owner{} + } + return t.DisplayName +} + +type GetGroupByID_Group_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetGroupByID_Group_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.CreatedAt +} +func (t *GetGroupByID_Group_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.CreatedBy +} +func (t *GetGroupByID_Group_Setting) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.ID +} +func (t *GetGroupByID_Group_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return &t.JoinPolicy +} +func (t *GetGroupByID_Group_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.SyncToGithub +} +func (t *GetGroupByID_Group_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.SyncToSlack +} +func (t *GetGroupByID_Group_Setting) GetTags() []string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.Tags +} +func (t *GetGroupByID_Group_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.UpdatedAt +} +func (t *GetGroupByID_Group_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return t.UpdatedBy +} +func (t *GetGroupByID_Group_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupByID_Group_Setting{} + } + return &t.Visibility +} + +type GetGroupByID_Group_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetGroupByID_Group_Members_User) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Members_User{} + } + return t.ID +} +func (t *GetGroupByID_Group_Members_User) GetFirstName() *string { + if t == nil { + t = &GetGroupByID_Group_Members_User{} + } + return t.FirstName +} +func (t *GetGroupByID_Group_Members_User) GetLastName() *string { + if t == nil { + t = &GetGroupByID_Group_Members_User{} + } + return t.LastName +} + +type GetGroupByID_Group_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetGroupByID_Group_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetGroupByID_Group_Members) GetID() string { + if t == nil { + t = &GetGroupByID_Group_Members{} + } + return t.ID +} +func (t *GetGroupByID_Group_Members) GetRole() *enums.Role { + if t == nil { + t = &GetGroupByID_Group_Members{} + } + return &t.Role +} +func (t *GetGroupByID_Group_Members) GetUser() *GetGroupByID_Group_Members_User { + if t == nil { + t = &GetGroupByID_Group_Members{} + } + return &t.User +} + +type GetGroupByID_Group struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *GetGroupByID_Group_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting GetGroupByID_Group_Setting "json:\"setting\" graphql:\"setting\"" + Members []*GetGroupByID_Group_Members "json:\"members,omitempty\" graphql:\"members\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupByID_Group) GetDescription() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Description +} +func (t *GetGroupByID_Group) GetDisplayName() string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.DisplayName +} +func (t *GetGroupByID_Group) GetID() string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.ID +} +func (t *GetGroupByID_Group) GetLogoURL() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.LogoURL +} +func (t *GetGroupByID_Group) GetName() string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Name +} +func (t *GetGroupByID_Group) GetTags() []string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Tags +} +func (t *GetGroupByID_Group) GetOwner() *GetGroupByID_Group_Owner { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Owner +} +func (t *GetGroupByID_Group) GetSetting() *GetGroupByID_Group_Setting { + if t == nil { + t = &GetGroupByID_Group{} + } + return &t.Setting +} +func (t *GetGroupByID_Group) GetMembers() []*GetGroupByID_Group_Members { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.Members +} +func (t *GetGroupByID_Group) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.CreatedAt +} +func (t *GetGroupByID_Group) GetCreatedBy() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.CreatedBy +} +func (t *GetGroupByID_Group) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.UpdatedAt +} +func (t *GetGroupByID_Group) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupByID_Group{} + } + return t.UpdatedBy +} + +type GetGroups_Groups_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *GetGroups_Groups_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Owner{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Owner) GetDisplayName() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Owner{} + } + return t.DisplayName +} + +type GetGroups_Groups_Edges_Node_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetGroups_Groups_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return &t.JoinPolicy +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToGithub +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.SyncToSlack +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.Tags +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetGroups_Groups_Edges_Node_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Setting{} + } + return &t.Visibility +} + +type GetGroups_Groups_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetGroups_Groups_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetGroups_Groups_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetGroups_Groups_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetGroups_Groups_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetGroups_Groups_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetGroups_Groups_Edges_Node_Members) GetUser() *GetGroups_Groups_Edges_Node_Members_User { + if t == nil { + t = &GetGroups_Groups_Edges_Node_Members{} + } + return &t.User +} + +type GetGroups_Groups_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *GetGroups_Groups_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting GetGroups_Groups_Edges_Node_Setting "json:\"setting\" graphql:\"setting\"" + Members []*GetGroups_Groups_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroups_Groups_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Description +} +func (t *GetGroups_Groups_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.DisplayName +} +func (t *GetGroups_Groups_Edges_Node) GetID() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.ID +} +func (t *GetGroups_Groups_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.LogoURL +} +func (t *GetGroups_Groups_Edges_Node) GetName() string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Name +} +func (t *GetGroups_Groups_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Tags +} +func (t *GetGroups_Groups_Edges_Node) GetOwner() *GetGroups_Groups_Edges_Node_Owner { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Owner +} +func (t *GetGroups_Groups_Edges_Node) GetSetting() *GetGroups_Groups_Edges_Node_Setting { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return &t.Setting +} +func (t *GetGroups_Groups_Edges_Node) GetMembers() []*GetGroups_Groups_Edges_Node_Members { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.Members +} +func (t *GetGroups_Groups_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroups_Groups_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroups_Groups_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroups_Groups_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroups_Groups_Edges_Node{} + } + return t.UpdatedBy +} + +type GetGroups_Groups_Edges struct { + Node *GetGroups_Groups_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroups_Groups_Edges) GetNode() *GetGroups_Groups_Edges_Node { + if t == nil { + t = &GetGroups_Groups_Edges{} + } + return t.Node +} + +type GetGroups_Groups struct { + Edges []*GetGroups_Groups_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroups_Groups) GetEdges() []*GetGroups_Groups_Edges { + if t == nil { + t = &GetGroups_Groups{} + } + return t.Edges +} + +type UpdateGroup_UpdateGroup_Group_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Owner) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Owner{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Owner) GetDisplayName() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Owner{} + } + return t.DisplayName +} + +type UpdateGroup_UpdateGroup_Group_Setting struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.CreatedAt +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetCreatedBy() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.CreatedBy +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return &t.JoinPolicy +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetSyncToGithub() *bool { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.SyncToGithub +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetSyncToSlack() *bool { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.SyncToSlack +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetTags() []string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.Tags +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.UpdatedAt +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return t.UpdatedBy +} +func (t *UpdateGroup_UpdateGroup_Group_Setting) GetVisibility() *enums.Visibility { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Setting{} + } + return &t.Visibility +} + +type UpdateGroup_UpdateGroup_Group_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Members_User) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members_User{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Members_User) GetFirstName() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members_User{} + } + return t.FirstName +} +func (t *UpdateGroup_UpdateGroup_Group_Members_User) GetLastName() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members_User{} + } + return t.LastName +} + +type UpdateGroup_UpdateGroup_Group_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User UpdateGroup_UpdateGroup_Group_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *UpdateGroup_UpdateGroup_Group_Members) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group_Members) GetRole() *enums.Role { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members{} + } + return &t.Role +} +func (t *UpdateGroup_UpdateGroup_Group_Members) GetUser() *UpdateGroup_UpdateGroup_Group_Members_User { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group_Members{} + } + return &t.User +} + +type UpdateGroup_UpdateGroup_Group struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Owner *UpdateGroup_UpdateGroup_Group_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Setting UpdateGroup_UpdateGroup_Group_Setting "json:\"setting\" graphql:\"setting\"" + Members []*UpdateGroup_UpdateGroup_Group_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *UpdateGroup_UpdateGroup_Group) GetDescription() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Description +} +func (t *UpdateGroup_UpdateGroup_Group) GetDisplayName() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.DisplayName +} +func (t *UpdateGroup_UpdateGroup_Group) GetID() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.ID +} +func (t *UpdateGroup_UpdateGroup_Group) GetLogoURL() *string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.LogoURL +} +func (t *UpdateGroup_UpdateGroup_Group) GetName() string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Name +} +func (t *UpdateGroup_UpdateGroup_Group) GetTags() []string { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Tags +} +func (t *UpdateGroup_UpdateGroup_Group) GetOwner() *UpdateGroup_UpdateGroup_Group_Owner { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Owner +} +func (t *UpdateGroup_UpdateGroup_Group) GetSetting() *UpdateGroup_UpdateGroup_Group_Setting { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return &t.Setting +} +func (t *UpdateGroup_UpdateGroup_Group) GetMembers() []*UpdateGroup_UpdateGroup_Group_Members { + if t == nil { + t = &UpdateGroup_UpdateGroup_Group{} + } + return t.Members +} + +type UpdateGroup_UpdateGroup struct { + Group UpdateGroup_UpdateGroup_Group "json:\"group\" graphql:\"group\"" +} + +func (t *UpdateGroup_UpdateGroup) GetGroup() *UpdateGroup_UpdateGroup_Group { + if t == nil { + t = &UpdateGroup_UpdateGroup{} + } + return &t.Group +} + +type GetAllGroupHistories_GroupHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + GravatarLogoURL *string "json:\"gravatarLogoURL,omitempty\" graphql:\"gravatarLogoURL\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetGravatarLogoURL() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.GravatarLogoURL +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.LogoURL +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupHistories_GroupHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllGroupHistories_GroupHistories_Edges struct { + Node *GetAllGroupHistories_GroupHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupHistories_GroupHistories_Edges) GetNode() *GetAllGroupHistories_GroupHistories_Edges_Node { + if t == nil { + t = &GetAllGroupHistories_GroupHistories_Edges{} + } + return t.Node +} + +type GetAllGroupHistories_GroupHistories struct { + Edges []*GetAllGroupHistories_GroupHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupHistories_GroupHistories) GetEdges() []*GetAllGroupHistories_GroupHistories_Edges { + if t == nil { + t = &GetAllGroupHistories_GroupHistories{} + } + return t.Edges +} + +type GetGroupHistories_GroupHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + GravatarLogoURL *string "json:\"gravatarLogoURL,omitempty\" graphql:\"gravatarLogoURL\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LogoURL *string "json:\"logoURL,omitempty\" graphql:\"logoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Description +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetGravatarLogoURL() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.GravatarLogoURL +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.ID +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetLogoURL() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.LogoURL +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Name +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupHistories_GroupHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetGroupHistories_GroupHistories_Edges struct { + Node *GetGroupHistories_GroupHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupHistories_GroupHistories_Edges) GetNode() *GetGroupHistories_GroupHistories_Edges_Node { + if t == nil { + t = &GetGroupHistories_GroupHistories_Edges{} + } + return t.Node +} + +type GetGroupHistories_GroupHistories struct { + Edges []*GetGroupHistories_GroupHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupHistories_GroupHistories) GetEdges() []*GetGroupHistories_GroupHistories_Edges { + if t == nil { + t = &GetGroupHistories_GroupHistories{} + } + return t.Edges +} + +type AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group) GetID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group{} + } + return t.ID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group) GetName() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group{} + } + return t.Name +} + +type AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetDisplayName() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.DisplayName +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetEmail() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.Email +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetFirstName() *string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.FirstName +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.ID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User) GetLastName() *string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User{} + } + return t.LastName +} + +type AddUserToGroupWithRole_CreateGroupMembership_GroupMembership struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User "json:\"user\" graphql:\"user\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetGroupID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return t.GroupID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetGroup() *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_Group { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return &t.Group +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return t.ID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetRole() *enums.Role { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return &t.Role +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetUserID() string { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return t.UserID +} +func (t *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership) GetUser() *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership_User { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership_GroupMembership{} + } + return &t.User +} + +type AddUserToGroupWithRole_CreateGroupMembership struct { + GroupMembership AddUserToGroupWithRole_CreateGroupMembership_GroupMembership "json:\"groupMembership\" graphql:\"groupMembership\"" +} + +func (t *AddUserToGroupWithRole_CreateGroupMembership) GetGroupMembership() *AddUserToGroupWithRole_CreateGroupMembership_GroupMembership { + if t == nil { + t = &AddUserToGroupWithRole_CreateGroupMembership{} + } + return &t.GroupMembership +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group) GetID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group{} + } + return t.ID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group) GetName() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group{} + } + return t.Name +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.DisplayName +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetEmail() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.Email +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.FirstName +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.ID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User) GetLastName() *string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User{} + } + return t.LastName +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetGroupID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return t.GroupID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetGroup() *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_Group { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return &t.Group +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return t.ID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return &t.Role +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return t.UserID +} +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships) GetUser() *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships_User { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships{} + } + return &t.User +} + +type CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership struct { + GroupMemberships []*CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" +} + +func (t *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership) GetGroupMemberships() []*CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership_GroupMemberships { + if t == nil { + t = &CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership{} + } + return t.GroupMemberships +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group) GetID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group{} + } + return t.ID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group) GetName() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group{} + } + return t.Name +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetDisplayName() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.DisplayName +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetEmail() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.Email +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetFirstName() *string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.FirstName +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.ID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User) GetLastName() *string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User{} + } + return t.LastName +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetGroupID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return t.GroupID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetGroup() *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_Group { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return &t.Group +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return t.ID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return &t.Role +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return t.UserID +} +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships) GetUser() *CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships_User { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships{} + } + return &t.User +} + +type CreateBulkGroupMembers_CreateBulkGroupMembership struct { + GroupMemberships []*CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" +} + +func (t *CreateBulkGroupMembers_CreateBulkGroupMembership) GetGroupMemberships() []*CreateBulkGroupMembers_CreateBulkGroupMembership_GroupMemberships { + if t == nil { + t = &CreateBulkGroupMembers_CreateBulkGroupMembership{} + } + return t.GroupMemberships +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group{} + } + return t.ID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group) GetName() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group{} + } + return t.Name +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetDisplayName() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.DisplayName +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetEmail() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.Email +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetFirstName() *string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.FirstName +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.ID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User) GetLastName() *string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User{} + } + return t.LastName +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges_Node struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetGroupID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return t.GroupID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetGroup() *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_Group { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return &t.Group +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return t.ID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return &t.Role +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetUserID() string { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return t.UserID +} +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges_Node) GetUser() *GetGroupMembersByGroupID_GroupMemberships_Edges_Node_User { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges_Node{} + } + return &t.User +} + +type GetGroupMembersByGroupID_GroupMemberships_Edges struct { + Node *GetGroupMembersByGroupID_GroupMemberships_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships_Edges) GetNode() *GetGroupMembersByGroupID_GroupMemberships_Edges_Node { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships_Edges{} + } + return t.Node +} + +type GetGroupMembersByGroupID_GroupMemberships struct { + Edges []*GetGroupMembersByGroupID_GroupMemberships_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupMembersByGroupID_GroupMemberships) GetEdges() []*GetGroupMembersByGroupID_GroupMemberships_Edges { + if t == nil { + t = &GetGroupMembersByGroupID_GroupMemberships{} + } + return t.Edges +} + +type RemoveUserFromGroup_DeleteGroupMembership struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *RemoveUserFromGroup_DeleteGroupMembership) GetDeletedID() string { + if t == nil { + t = &RemoveUserFromGroup_DeleteGroupMembership{} + } + return t.DeletedID +} + +type UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group) GetID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group{} + } + return t.ID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group) GetName() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group{} + } + return t.Name +} + +type UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetDisplayName() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.DisplayName +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetEmail() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.Email +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetFirstName() *string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.FirstName +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.ID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User) GetLastName() *string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User{} + } + return t.LastName +} + +type UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership struct { + GroupID string "json:\"groupID\" graphql:\"groupID\"" + Group UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group "json:\"group\" graphql:\"group\"" + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + User UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User "json:\"user\" graphql:\"user\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetGroupID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return t.GroupID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetGroup() *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_Group { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return &t.Group +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return t.ID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetRole() *enums.Role { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return &t.Role +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetUserID() string { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return t.UserID +} +func (t *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership) GetUser() *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership_User { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership{} + } + return &t.User +} + +type UpdateUserRoleInGroup_UpdateGroupMembership struct { + GroupMembership UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership "json:\"groupMembership\" graphql:\"groupMembership\"" +} + +func (t *UpdateUserRoleInGroup_UpdateGroupMembership) GetGroupMembership() *UpdateUserRoleInGroup_UpdateGroupMembership_GroupMembership { + if t == nil { + t = &UpdateUserRoleInGroup_UpdateGroupMembership{} + } + return &t.GroupMembership +} + +type GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID string "json:\"groupID\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetGroupID() string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetAllGroupMembershipHistories_GroupMembershipHistories_Edges struct { + Node *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges) GetNode() *GetAllGroupMembershipHistories_GroupMembershipHistories_Edges_Node { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories_Edges{} + } + return t.Node +} + +type GetAllGroupMembershipHistories_GroupMembershipHistories struct { + Edges []*GetAllGroupMembershipHistories_GroupMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupMembershipHistories_GroupMembershipHistories) GetEdges() []*GetAllGroupMembershipHistories_GroupMembershipHistories_Edges { + if t == nil { + t = &GetAllGroupMembershipHistories_GroupMembershipHistories{} + } + return t.Edges +} + +type GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID string "json:\"groupID\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetGroupID() string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetGroupMembershipHistories_GroupMembershipHistories_Edges struct { + Node *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupMembershipHistories_GroupMembershipHistories_Edges) GetNode() *GetGroupMembershipHistories_GroupMembershipHistories_Edges_Node { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories_Edges{} + } + return t.Node +} + +type GetGroupMembershipHistories_GroupMembershipHistories struct { + Edges []*GetGroupMembershipHistories_GroupMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupMembershipHistories_GroupMembershipHistories) GetEdges() []*GetGroupMembershipHistories_GroupMembershipHistories_Edges { + if t == nil { + t = &GetGroupMembershipHistories_GroupMembershipHistories{} + } + return t.Edges +} + +type GetAllGroupSettings_GroupSettings_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllGroupSettings_GroupSettings_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.ID +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node_Group) GetName() string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.Name +} + +type GetAllGroupSettings_GroupSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *GetAllGroupSettings_GroupSettings_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return &t.Visibility +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetGroup() *GetAllGroupSettings_GroupSettings_Edges_Node_Group { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.Group +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupSettings_GroupSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllGroupSettings_GroupSettings_Edges struct { + Node *GetAllGroupSettings_GroupSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupSettings_GroupSettings_Edges) GetNode() *GetAllGroupSettings_GroupSettings_Edges_Node { + if t == nil { + t = &GetAllGroupSettings_GroupSettings_Edges{} + } + return t.Node +} + +type GetAllGroupSettings_GroupSettings struct { + Edges []*GetAllGroupSettings_GroupSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupSettings_GroupSettings) GetEdges() []*GetAllGroupSettings_GroupSettings_Edges { + if t == nil { + t = &GetAllGroupSettings_GroupSettings{} + } + return t.Edges +} + +type GetGroupSettingByID_GroupSetting_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetGroupSettingByID_GroupSetting_Group) GetID() string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting_Group{} + } + return t.ID +} +func (t *GetGroupSettingByID_GroupSetting_Group) GetName() string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting_Group{} + } + return t.Name +} + +type GetGroupSettingByID_GroupSetting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *GetGroupSettingByID_GroupSetting_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupSettingByID_GroupSetting) GetID() string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.ID +} +func (t *GetGroupSettingByID_GroupSetting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return &t.JoinPolicy +} +func (t *GetGroupSettingByID_GroupSetting) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.SyncToGithub +} +func (t *GetGroupSettingByID_GroupSetting) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.SyncToSlack +} +func (t *GetGroupSettingByID_GroupSetting) GetTags() []string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.Tags +} +func (t *GetGroupSettingByID_GroupSetting) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return &t.Visibility +} +func (t *GetGroupSettingByID_GroupSetting) GetGroup() *GetGroupSettingByID_GroupSetting_Group { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.Group +} +func (t *GetGroupSettingByID_GroupSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.CreatedAt +} +func (t *GetGroupSettingByID_GroupSetting) GetCreatedBy() *string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.CreatedBy +} +func (t *GetGroupSettingByID_GroupSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.UpdatedAt +} +func (t *GetGroupSettingByID_GroupSetting) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupSettingByID_GroupSetting{} + } + return t.UpdatedBy +} + +type GetGroupSettings_GroupSettings_Edges_Node_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetGroupSettings_GroupSettings_Edges_Node_Group) GetID() string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.ID +} +func (t *GetGroupSettings_GroupSettings_Edges_Node_Group) GetName() string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node_Group{} + } + return t.Name +} + +type GetGroupSettings_GroupSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *GetGroupSettings_GroupSettings_Edges_Node_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.ID +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return &t.Visibility +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetGroup() *GetGroupSettings_GroupSettings_Edges_Node_Group { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.Group +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupSettings_GroupSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetGroupSettings_GroupSettings_Edges struct { + Node *GetGroupSettings_GroupSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupSettings_GroupSettings_Edges) GetNode() *GetGroupSettings_GroupSettings_Edges_Node { + if t == nil { + t = &GetGroupSettings_GroupSettings_Edges{} + } + return t.Node +} + +type GetGroupSettings_GroupSettings struct { + Edges []*GetGroupSettings_GroupSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupSettings_GroupSettings) GetEdges() []*GetGroupSettings_GroupSettings_Edges { + if t == nil { + t = &GetGroupSettings_GroupSettings{} + } + return t.Edges +} + +type UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group) GetID() string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group{} + } + return t.ID +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group) GetName() string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group{} + } + return t.Name +} + +type UpdateGroupSetting_UpdateGroupSetting_GroupSetting struct { + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" + Group *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group "json:\"group,omitempty\" graphql:\"group\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetID() string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.ID +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return &t.JoinPolicy +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetSyncToGithub() *bool { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.SyncToGithub +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetSyncToSlack() *bool { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.SyncToSlack +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetTags() []string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.Tags +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetVisibility() *enums.Visibility { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return &t.Visibility +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetGroup() *UpdateGroupSetting_UpdateGroupSetting_GroupSetting_Group { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.Group +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.CreatedAt +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetCreatedBy() *string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.CreatedBy +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.UpdatedAt +} +func (t *UpdateGroupSetting_UpdateGroupSetting_GroupSetting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting_GroupSetting{} + } + return t.UpdatedBy +} + +type UpdateGroupSetting_UpdateGroupSetting struct { + GroupSetting UpdateGroupSetting_UpdateGroupSetting_GroupSetting "json:\"groupSetting\" graphql:\"groupSetting\"" +} + +func (t *UpdateGroupSetting_UpdateGroupSetting) GetGroupSetting() *UpdateGroupSetting_UpdateGroupSetting_GroupSetting { + if t == nil { + t = &UpdateGroupSetting_UpdateGroupSetting{} + } + return &t.GroupSetting +} + +type GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID *string "json:\"groupID,omitempty\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetGroupID() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Visibility +} + +type GetAllGroupSettingHistories_GroupSettingHistories_Edges struct { + Node *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllGroupSettingHistories_GroupSettingHistories_Edges) GetNode() *GetAllGroupSettingHistories_GroupSettingHistories_Edges_Node { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories_Edges{} + } + return t.Node +} + +type GetAllGroupSettingHistories_GroupSettingHistories struct { + Edges []*GetAllGroupSettingHistories_GroupSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllGroupSettingHistories_GroupSettingHistories) GetEdges() []*GetAllGroupSettingHistories_GroupSettingHistories_Edges { + if t == nil { + t = &GetAllGroupSettingHistories_GroupSettingHistories{} + } + return t.Edges +} + +type GetGroupSettingHistories_GroupSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + GroupID *string "json:\"groupID,omitempty\" graphql:\"groupID\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + JoinPolicy enums.JoinPolicy "json:\"joinPolicy\" graphql:\"joinPolicy\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SyncToGithub *bool "json:\"syncToGithub,omitempty\" graphql:\"syncToGithub\"" + SyncToSlack *bool "json:\"syncToSlack,omitempty\" graphql:\"syncToSlack\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Visibility enums.Visibility "json:\"visibility\" graphql:\"visibility\"" +} + +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetGroupID() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.GroupID +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetJoinPolicy() *enums.JoinPolicy { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.JoinPolicy +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToGithub() *bool { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToGithub +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetSyncToSlack() *bool { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.SyncToSlack +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges_Node) GetVisibility() *enums.Visibility { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges_Node{} + } + return &t.Visibility +} + +type GetGroupSettingHistories_GroupSettingHistories_Edges struct { + Node *GetGroupSettingHistories_GroupSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetGroupSettingHistories_GroupSettingHistories_Edges) GetNode() *GetGroupSettingHistories_GroupSettingHistories_Edges_Node { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories_Edges{} + } + return t.Node +} + +type GetGroupSettingHistories_GroupSettingHistories struct { + Edges []*GetGroupSettingHistories_GroupSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetGroupSettingHistories_GroupSettingHistories) GetEdges() []*GetGroupSettingHistories_GroupSettingHistories_Edges { + if t == nil { + t = &GetGroupSettingHistories_GroupSettingHistories{} + } + return t.Edges +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations{} + } + return t.ID +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization{} + } + return t.ID +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events{} + } + return t.ID +} + +type CreateBulkCSVHush_CreateBulkCSVHush_Hushes struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Description +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetID() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.ID +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetKind() *string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Kind +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetName() string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Name +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetSecretName() *string { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.SecretName +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetIntegrations() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Integrations { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Integrations +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetOrganization() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Organization { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Organization +} +func (t *CreateBulkCSVHush_CreateBulkCSVHush_Hushes) GetEvents() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes_Events { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush_Hushes{} + } + return t.Events +} + +type CreateBulkCSVHush_CreateBulkCSVHush struct { + Hushes []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes "json:\"hushes,omitempty\" graphql:\"hushes\"" +} + +func (t *CreateBulkCSVHush_CreateBulkCSVHush) GetHushes() []*CreateBulkCSVHush_CreateBulkCSVHush_Hushes { + if t == nil { + t = &CreateBulkCSVHush_CreateBulkCSVHush{} + } + return t.Hushes +} + +type CreateBulkHush_CreateBulkHush_Hushes_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes_Integrations) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes_Integrations{} + } + return t.ID +} + +type CreateBulkHush_CreateBulkHush_Hushes_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes_Organization) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes_Organization{} + } + return t.ID +} + +type CreateBulkHush_CreateBulkHush_Hushes_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes_Events) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes_Events{} + } + return t.ID +} + +type CreateBulkHush_CreateBulkHush_Hushes struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*CreateBulkHush_CreateBulkHush_Hushes_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*CreateBulkHush_CreateBulkHush_Hushes_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*CreateBulkHush_CreateBulkHush_Hushes_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetDescription() *string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Description +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetID() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.ID +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetKind() *string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Kind +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetName() string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Name +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetSecretName() *string { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.SecretName +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetIntegrations() []*CreateBulkHush_CreateBulkHush_Hushes_Integrations { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Integrations +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetOrganization() []*CreateBulkHush_CreateBulkHush_Hushes_Organization { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Organization +} +func (t *CreateBulkHush_CreateBulkHush_Hushes) GetEvents() []*CreateBulkHush_CreateBulkHush_Hushes_Events { + if t == nil { + t = &CreateBulkHush_CreateBulkHush_Hushes{} + } + return t.Events +} + +type CreateBulkHush_CreateBulkHush struct { + Hushes []*CreateBulkHush_CreateBulkHush_Hushes "json:\"hushes,omitempty\" graphql:\"hushes\"" +} + +func (t *CreateBulkHush_CreateBulkHush) GetHushes() []*CreateBulkHush_CreateBulkHush_Hushes { + if t == nil { + t = &CreateBulkHush_CreateBulkHush{} + } + return t.Hushes +} + +type CreateHush_CreateHush_Hush_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateHush_CreateHush_Hush_Integrations) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush_Integrations{} + } + return t.ID +} + +type CreateHush_CreateHush_Hush_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateHush_CreateHush_Hush_Organization) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush_Organization{} + } + return t.ID +} + +type CreateHush_CreateHush_Hush_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateHush_CreateHush_Hush_Events) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush_Events{} + } + return t.ID +} + +type CreateHush_CreateHush_Hush struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*CreateHush_CreateHush_Hush_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*CreateHush_CreateHush_Hush_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*CreateHush_CreateHush_Hush_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateHush_CreateHush_Hush) GetDescription() *string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Description +} +func (t *CreateHush_CreateHush_Hush) GetID() string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.ID +} +func (t *CreateHush_CreateHush_Hush) GetKind() *string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Kind +} +func (t *CreateHush_CreateHush_Hush) GetName() string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Name +} +func (t *CreateHush_CreateHush_Hush) GetSecretName() *string { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.SecretName +} +func (t *CreateHush_CreateHush_Hush) GetIntegrations() []*CreateHush_CreateHush_Hush_Integrations { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Integrations +} +func (t *CreateHush_CreateHush_Hush) GetOrganization() []*CreateHush_CreateHush_Hush_Organization { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Organization +} +func (t *CreateHush_CreateHush_Hush) GetEvents() []*CreateHush_CreateHush_Hush_Events { + if t == nil { + t = &CreateHush_CreateHush_Hush{} + } + return t.Events +} + +type CreateHush_CreateHush struct { + Hush CreateHush_CreateHush_Hush "json:\"hush\" graphql:\"hush\"" +} + +func (t *CreateHush_CreateHush) GetHush() *CreateHush_CreateHush_Hush { + if t == nil { + t = &CreateHush_CreateHush{} + } + return &t.Hush +} + +type GetAllHushes_Hushes_Edges_Node_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node_Integrations) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node_Integrations{} + } + return t.ID +} + +type GetAllHushes_Hushes_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node_Organization{} + } + return t.ID +} + +type GetAllHushes_Hushes_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node_Events{} + } + return t.ID +} + +type GetAllHushes_Hushes_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*GetAllHushes_Hushes_Edges_Node_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*GetAllHushes_Hushes_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*GetAllHushes_Hushes_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllHushes_Hushes_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Description +} +func (t *GetAllHushes_Hushes_Edges_Node) GetID() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.ID +} +func (t *GetAllHushes_Hushes_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Kind +} +func (t *GetAllHushes_Hushes_Edges_Node) GetName() string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Name +} +func (t *GetAllHushes_Hushes_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.SecretName +} +func (t *GetAllHushes_Hushes_Edges_Node) GetIntegrations() []*GetAllHushes_Hushes_Edges_Node_Integrations { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Integrations +} +func (t *GetAllHushes_Hushes_Edges_Node) GetOrganization() []*GetAllHushes_Hushes_Edges_Node_Organization { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Organization +} +func (t *GetAllHushes_Hushes_Edges_Node) GetEvents() []*GetAllHushes_Hushes_Edges_Node_Events { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.Events +} +func (t *GetAllHushes_Hushes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllHushes_Hushes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllHushes_Hushes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllHushes_Hushes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllHushes_Hushes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllHushes_Hushes_Edges struct { + Node *GetAllHushes_Hushes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllHushes_Hushes_Edges) GetNode() *GetAllHushes_Hushes_Edges_Node { + if t == nil { + t = &GetAllHushes_Hushes_Edges{} + } + return t.Node +} + +type GetAllHushes_Hushes struct { + Edges []*GetAllHushes_Hushes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllHushes_Hushes) GetEdges() []*GetAllHushes_Hushes_Edges { + if t == nil { + t = &GetAllHushes_Hushes{} + } + return t.Edges +} + +type GetHushByID_Hush_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushByID_Hush_Integrations) GetID() string { + if t == nil { + t = &GetHushByID_Hush_Integrations{} + } + return t.ID +} + +type GetHushByID_Hush_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushByID_Hush_Organization) GetID() string { + if t == nil { + t = &GetHushByID_Hush_Organization{} + } + return t.ID +} + +type GetHushByID_Hush_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushByID_Hush_Events) GetID() string { + if t == nil { + t = &GetHushByID_Hush_Events{} + } + return t.ID +} + +type GetHushByID_Hush struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*GetHushByID_Hush_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*GetHushByID_Hush_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*GetHushByID_Hush_Events "json:\"events,omitempty\" graphql:\"events\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetHushByID_Hush) GetDescription() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Description +} +func (t *GetHushByID_Hush) GetID() string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.ID +} +func (t *GetHushByID_Hush) GetKind() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Kind +} +func (t *GetHushByID_Hush) GetName() string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Name +} +func (t *GetHushByID_Hush) GetSecretName() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.SecretName +} +func (t *GetHushByID_Hush) GetIntegrations() []*GetHushByID_Hush_Integrations { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Integrations +} +func (t *GetHushByID_Hush) GetOrganization() []*GetHushByID_Hush_Organization { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Organization +} +func (t *GetHushByID_Hush) GetEvents() []*GetHushByID_Hush_Events { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.Events +} +func (t *GetHushByID_Hush) GetCreatedAt() *time.Time { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.CreatedAt +} +func (t *GetHushByID_Hush) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.UpdatedAt +} +func (t *GetHushByID_Hush) GetCreatedBy() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.CreatedBy +} +func (t *GetHushByID_Hush) GetUpdatedBy() *string { + if t == nil { + t = &GetHushByID_Hush{} + } + return t.UpdatedBy +} + +type GetHushes_Hushes_Edges_Node_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushes_Hushes_Edges_Node_Integrations) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node_Integrations{} + } + return t.ID +} + +type GetHushes_Hushes_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushes_Hushes_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node_Organization{} + } + return t.ID +} + +type GetHushes_Hushes_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetHushes_Hushes_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node_Events{} + } + return t.ID +} + +type GetHushes_Hushes_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*GetHushes_Hushes_Edges_Node_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*GetHushes_Hushes_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*GetHushes_Hushes_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetHushes_Hushes_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Description +} +func (t *GetHushes_Hushes_Edges_Node) GetID() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.ID +} +func (t *GetHushes_Hushes_Edges_Node) GetKind() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Kind +} +func (t *GetHushes_Hushes_Edges_Node) GetName() string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Name +} +func (t *GetHushes_Hushes_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.SecretName +} +func (t *GetHushes_Hushes_Edges_Node) GetIntegrations() []*GetHushes_Hushes_Edges_Node_Integrations { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Integrations +} +func (t *GetHushes_Hushes_Edges_Node) GetOrganization() []*GetHushes_Hushes_Edges_Node_Organization { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Organization +} +func (t *GetHushes_Hushes_Edges_Node) GetEvents() []*GetHushes_Hushes_Edges_Node_Events { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.Events +} +func (t *GetHushes_Hushes_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetHushes_Hushes_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetHushes_Hushes_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetHushes_Hushes_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetHushes_Hushes_Edges_Node{} + } + return t.UpdatedBy +} + +type GetHushes_Hushes_Edges struct { + Node *GetHushes_Hushes_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetHushes_Hushes_Edges) GetNode() *GetHushes_Hushes_Edges_Node { + if t == nil { + t = &GetHushes_Hushes_Edges{} + } + return t.Node +} + +type GetHushes_Hushes struct { + Edges []*GetHushes_Hushes_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetHushes_Hushes) GetEdges() []*GetHushes_Hushes_Edges { + if t == nil { + t = &GetHushes_Hushes{} + } + return t.Edges +} + +type UpdateHush_UpdateHush_Hush_Integrations struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateHush_UpdateHush_Hush_Integrations) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush_Integrations{} + } + return t.ID +} + +type UpdateHush_UpdateHush_Hush_Organization struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateHush_UpdateHush_Hush_Organization) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush_Organization{} + } + return t.ID +} + +type UpdateHush_UpdateHush_Hush_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateHush_UpdateHush_Hush_Events) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush_Events{} + } + return t.ID +} + +type UpdateHush_UpdateHush_Hush struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + Integrations []*UpdateHush_UpdateHush_Hush_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" + Organization []*UpdateHush_UpdateHush_Hush_Organization "json:\"organization,omitempty\" graphql:\"organization\"" + Events []*UpdateHush_UpdateHush_Hush_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *UpdateHush_UpdateHush_Hush) GetDescription() *string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Description +} +func (t *UpdateHush_UpdateHush_Hush) GetID() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.ID +} +func (t *UpdateHush_UpdateHush_Hush) GetKind() *string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Kind +} +func (t *UpdateHush_UpdateHush_Hush) GetName() string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Name +} +func (t *UpdateHush_UpdateHush_Hush) GetSecretName() *string { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.SecretName +} +func (t *UpdateHush_UpdateHush_Hush) GetIntegrations() []*UpdateHush_UpdateHush_Hush_Integrations { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Integrations +} +func (t *UpdateHush_UpdateHush_Hush) GetOrganization() []*UpdateHush_UpdateHush_Hush_Organization { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Organization +} +func (t *UpdateHush_UpdateHush_Hush) GetEvents() []*UpdateHush_UpdateHush_Hush_Events { + if t == nil { + t = &UpdateHush_UpdateHush_Hush{} + } + return t.Events +} + +type UpdateHush_UpdateHush struct { + Hush UpdateHush_UpdateHush_Hush "json:\"hush\" graphql:\"hush\"" +} + +func (t *UpdateHush_UpdateHush) GetHush() *UpdateHush_UpdateHush_Hush { + if t == nil { + t = &UpdateHush_UpdateHush{} + } + return &t.Hush +} + +type GetAllHushHistories_HushHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.SecretName +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllHushHistories_HushHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllHushHistories_HushHistories_Edges struct { + Node *GetAllHushHistories_HushHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllHushHistories_HushHistories_Edges) GetNode() *GetAllHushHistories_HushHistories_Edges_Node { + if t == nil { + t = &GetAllHushHistories_HushHistories_Edges{} + } + return t.Node +} + +type GetAllHushHistories_HushHistories struct { + Edges []*GetAllHushHistories_HushHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllHushHistories_HushHistories) GetEdges() []*GetAllHushHistories_HushHistories_Edges { + if t == nil { + t = &GetAllHushHistories_HushHistories{} + } + return t.Edges +} + +type GetHushHistories_HushHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SecretName *string "json:\"secretName,omitempty\" graphql:\"secretName\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetHushHistories_HushHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Description +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.ID +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Name +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetSecretName() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.SecretName +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetHushHistories_HushHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetHushHistories_HushHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetHushHistories_HushHistories_Edges struct { + Node *GetHushHistories_HushHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetHushHistories_HushHistories_Edges) GetNode() *GetHushHistories_HushHistories_Edges_Node { + if t == nil { + t = &GetHushHistories_HushHistories_Edges{} + } + return t.Node +} + +type GetHushHistories_HushHistories struct { + Edges []*GetHushHistories_HushHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetHushHistories_HushHistories) GetEdges() []*GetHushHistories_HushHistories_Edges { + if t == nil { + t = &GetHushHistories_HushHistories{} + } + return t.Edges +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events{} + } + return t.ID +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks{} + } + return t.ID +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks{} + } + return t.Enabled +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Description +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetID() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.ID +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetKind() *string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Kind +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetName() string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Name +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.OwnerID +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetOwner() *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Owner { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Owner +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetSecrets() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Secrets { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Secrets +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetOauth2tokens() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Oauth2tokens { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Oauth2tokens +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetEvents() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Events { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Events +} +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations) GetWebhooks() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations_Webhooks { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations{} + } + return t.Webhooks +} + +type CreateBulkCSVIntegration_CreateBulkCSVIntegration struct { + Integrations []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" +} + +func (t *CreateBulkCSVIntegration_CreateBulkCSVIntegration) GetIntegrations() []*CreateBulkCSVIntegration_CreateBulkCSVIntegration_Integrations { + if t == nil { + t = &CreateBulkCSVIntegration_CreateBulkCSVIntegration{} + } + return t.Integrations +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Events) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Events{} + } + return t.ID +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks{} + } + return t.ID +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks{} + } + return t.Enabled +} + +type CreateBulkIntegration_CreateBulkIntegration_Integrations struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetDescription() *string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Description +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetID() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.ID +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetKind() *string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Kind +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetName() string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Name +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetOwnerID() *string { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.OwnerID +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetOwner() *CreateBulkIntegration_CreateBulkIntegration_Integrations_Owner { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Owner +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetSecrets() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Secrets { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Secrets +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetOauth2tokens() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Oauth2tokens { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Oauth2tokens +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetEvents() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Events { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Events +} +func (t *CreateBulkIntegration_CreateBulkIntegration_Integrations) GetWebhooks() []*CreateBulkIntegration_CreateBulkIntegration_Integrations_Webhooks { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration_Integrations{} + } + return t.Webhooks +} + +type CreateBulkIntegration_CreateBulkIntegration struct { + Integrations []*CreateBulkIntegration_CreateBulkIntegration_Integrations "json:\"integrations,omitempty\" graphql:\"integrations\"" +} + +func (t *CreateBulkIntegration_CreateBulkIntegration) GetIntegrations() []*CreateBulkIntegration_CreateBulkIntegration_Integrations { + if t == nil { + t = &CreateBulkIntegration_CreateBulkIntegration{} + } + return t.Integrations +} + +type CreateIntegration_CreateIntegration_Integration_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Owner) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Owner{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Secrets) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Secrets{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Oauth2tokens) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Oauth2tokens{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Events) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Events{} + } + return t.ID +} + +type CreateIntegration_CreateIntegration_Integration_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration_Webhooks) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Webhooks{} + } + return t.ID +} +func (t *CreateIntegration_CreateIntegration_Integration_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateIntegration_CreateIntegration_Integration_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration_Webhooks{} + } + return t.Enabled +} + +type CreateIntegration_CreateIntegration_Integration struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *CreateIntegration_CreateIntegration_Integration_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*CreateIntegration_CreateIntegration_Integration_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*CreateIntegration_CreateIntegration_Integration_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*CreateIntegration_CreateIntegration_Integration_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*CreateIntegration_CreateIntegration_Integration_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateIntegration_CreateIntegration_Integration) GetDescription() *string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Description +} +func (t *CreateIntegration_CreateIntegration_Integration) GetID() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.ID +} +func (t *CreateIntegration_CreateIntegration_Integration) GetKind() *string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Kind +} +func (t *CreateIntegration_CreateIntegration_Integration) GetName() string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Name +} +func (t *CreateIntegration_CreateIntegration_Integration) GetOwnerID() *string { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.OwnerID +} +func (t *CreateIntegration_CreateIntegration_Integration) GetOwner() *CreateIntegration_CreateIntegration_Integration_Owner { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Owner +} +func (t *CreateIntegration_CreateIntegration_Integration) GetSecrets() []*CreateIntegration_CreateIntegration_Integration_Secrets { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Secrets +} +func (t *CreateIntegration_CreateIntegration_Integration) GetOauth2tokens() []*CreateIntegration_CreateIntegration_Integration_Oauth2tokens { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Oauth2tokens +} +func (t *CreateIntegration_CreateIntegration_Integration) GetEvents() []*CreateIntegration_CreateIntegration_Integration_Events { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Events +} +func (t *CreateIntegration_CreateIntegration_Integration) GetWebhooks() []*CreateIntegration_CreateIntegration_Integration_Webhooks { + if t == nil { + t = &CreateIntegration_CreateIntegration_Integration{} + } + return t.Webhooks +} + +type CreateIntegration_CreateIntegration struct { + Integration CreateIntegration_CreateIntegration_Integration "json:\"integration\" graphql:\"integration\"" +} + +func (t *CreateIntegration_CreateIntegration) GetIntegration() *CreateIntegration_CreateIntegration_Integration { + if t == nil { + t = &CreateIntegration_CreateIntegration{} + } + return &t.Integration +} + +type DeleteIntegration_DeleteIntegration struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteIntegration_DeleteIntegration) GetDeletedID() string { + if t == nil { + t = &DeleteIntegration_DeleteIntegration{} + } + return t.DeletedID +} + +type GetAllIntegrations_Integrations_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Secrets) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Secrets{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Events{} + } + return t.ID +} + +type GetAllIntegrations_Integrations_Edges_Node_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node_Webhooks) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.ID +} +func (t *GetAllIntegrations_Integrations_Edges_Node_Webhooks) GetDestinationURL() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.DestinationURL +} +func (t *GetAllIntegrations_Integrations_Edges_Node_Webhooks) GetEnabled() bool { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.Enabled +} + +type GetAllIntegrations_Integrations_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *GetAllIntegrations_Integrations_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*GetAllIntegrations_Integrations_Edges_Node_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*GetAllIntegrations_Integrations_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*GetAllIntegrations_Integrations_Edges_Node_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllIntegrations_Integrations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Description +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetID() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.ID +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Kind +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetName() string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Name +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetOwner() *GetAllIntegrations_Integrations_Edges_Node_Owner { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Owner +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetSecrets() []*GetAllIntegrations_Integrations_Edges_Node_Secrets { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Secrets +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetOauth2tokens() []*GetAllIntegrations_Integrations_Edges_Node_Oauth2tokens { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Oauth2tokens +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetEvents() []*GetAllIntegrations_Integrations_Edges_Node_Events { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Events +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetWebhooks() []*GetAllIntegrations_Integrations_Edges_Node_Webhooks { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.Webhooks +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllIntegrations_Integrations_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllIntegrations_Integrations_Edges struct { + Node *GetAllIntegrations_Integrations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllIntegrations_Integrations_Edges) GetNode() *GetAllIntegrations_Integrations_Edges_Node { + if t == nil { + t = &GetAllIntegrations_Integrations_Edges{} + } + return t.Node +} + +type GetAllIntegrations_Integrations struct { + Edges []*GetAllIntegrations_Integrations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllIntegrations_Integrations) GetEdges() []*GetAllIntegrations_Integrations_Edges { + if t == nil { + t = &GetAllIntegrations_Integrations{} + } + return t.Edges +} + +type GetIntegrationByID_Integration_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Owner) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Owner{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Secrets) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Secrets{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Oauth2tokens) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Oauth2tokens{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrationByID_Integration_Events) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Events{} + } + return t.ID +} + +type GetIntegrationByID_Integration_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *GetIntegrationByID_Integration_Webhooks) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration_Webhooks{} + } + return t.ID +} +func (t *GetIntegrationByID_Integration_Webhooks) GetDestinationURL() string { + if t == nil { + t = &GetIntegrationByID_Integration_Webhooks{} + } + return t.DestinationURL +} +func (t *GetIntegrationByID_Integration_Webhooks) GetEnabled() bool { + if t == nil { + t = &GetIntegrationByID_Integration_Webhooks{} + } + return t.Enabled +} + +type GetIntegrationByID_Integration struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *GetIntegrationByID_Integration_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*GetIntegrationByID_Integration_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*GetIntegrationByID_Integration_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*GetIntegrationByID_Integration_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*GetIntegrationByID_Integration_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetIntegrationByID_Integration) GetDescription() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Description +} +func (t *GetIntegrationByID_Integration) GetID() string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.ID +} +func (t *GetIntegrationByID_Integration) GetKind() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Kind +} +func (t *GetIntegrationByID_Integration) GetName() string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Name +} +func (t *GetIntegrationByID_Integration) GetOwnerID() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.OwnerID +} +func (t *GetIntegrationByID_Integration) GetOwner() *GetIntegrationByID_Integration_Owner { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Owner +} +func (t *GetIntegrationByID_Integration) GetSecrets() []*GetIntegrationByID_Integration_Secrets { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Secrets +} +func (t *GetIntegrationByID_Integration) GetOauth2tokens() []*GetIntegrationByID_Integration_Oauth2tokens { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Oauth2tokens +} +func (t *GetIntegrationByID_Integration) GetEvents() []*GetIntegrationByID_Integration_Events { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Events +} +func (t *GetIntegrationByID_Integration) GetWebhooks() []*GetIntegrationByID_Integration_Webhooks { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.Webhooks +} +func (t *GetIntegrationByID_Integration) GetCreatedAt() *time.Time { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.CreatedAt +} +func (t *GetIntegrationByID_Integration) GetCreatedBy() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.CreatedBy +} +func (t *GetIntegrationByID_Integration) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.UpdatedAt +} +func (t *GetIntegrationByID_Integration) GetUpdatedBy() *string { + if t == nil { + t = &GetIntegrationByID_Integration{} + } + return t.UpdatedBy +} + +type GetIntegrations_Integrations_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Owner{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Secrets) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Secrets{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Oauth2tokens) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Oauth2tokens{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Events{} + } + return t.ID +} + +type GetIntegrations_Integrations_Edges_Node_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node_Webhooks) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.ID +} +func (t *GetIntegrations_Integrations_Edges_Node_Webhooks) GetDestinationURL() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.DestinationURL +} +func (t *GetIntegrations_Integrations_Edges_Node_Webhooks) GetEnabled() bool { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node_Webhooks{} + } + return t.Enabled +} + +type GetIntegrations_Integrations_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *GetIntegrations_Integrations_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*GetIntegrations_Integrations_Edges_Node_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*GetIntegrations_Integrations_Edges_Node_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*GetIntegrations_Integrations_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*GetIntegrations_Integrations_Edges_Node_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetIntegrations_Integrations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Description +} +func (t *GetIntegrations_Integrations_Edges_Node) GetID() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.ID +} +func (t *GetIntegrations_Integrations_Edges_Node) GetKind() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Kind +} +func (t *GetIntegrations_Integrations_Edges_Node) GetName() string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Name +} +func (t *GetIntegrations_Integrations_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.OwnerID +} +func (t *GetIntegrations_Integrations_Edges_Node) GetOwner() *GetIntegrations_Integrations_Edges_Node_Owner { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Owner +} +func (t *GetIntegrations_Integrations_Edges_Node) GetSecrets() []*GetIntegrations_Integrations_Edges_Node_Secrets { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Secrets +} +func (t *GetIntegrations_Integrations_Edges_Node) GetOauth2tokens() []*GetIntegrations_Integrations_Edges_Node_Oauth2tokens { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Oauth2tokens +} +func (t *GetIntegrations_Integrations_Edges_Node) GetEvents() []*GetIntegrations_Integrations_Edges_Node_Events { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Events +} +func (t *GetIntegrations_Integrations_Edges_Node) GetWebhooks() []*GetIntegrations_Integrations_Edges_Node_Webhooks { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.Webhooks +} +func (t *GetIntegrations_Integrations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetIntegrations_Integrations_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetIntegrations_Integrations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetIntegrations_Integrations_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetIntegrations_Integrations_Edges_Node{} + } + return t.UpdatedBy +} + +type GetIntegrations_Integrations_Edges struct { + Node *GetIntegrations_Integrations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetIntegrations_Integrations_Edges) GetNode() *GetIntegrations_Integrations_Edges_Node { + if t == nil { + t = &GetIntegrations_Integrations_Edges{} + } + return t.Node +} + +type GetIntegrations_Integrations struct { + Edges []*GetIntegrations_Integrations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetIntegrations_Integrations) GetEdges() []*GetIntegrations_Integrations_Edges { + if t == nil { + t = &GetIntegrations_Integrations{} + } + return t.Edges +} + +type UpdateIntegration_UpdateIntegration_Integration_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Owner) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Owner{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Secrets struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Secrets) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Secrets{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Events) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Events{} + } + return t.ID +} + +type UpdateIntegration_UpdateIntegration_Integration_Webhooks struct { + ID string "json:\"id\" graphql:\"id\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration_Webhooks) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Webhooks{} + } + return t.ID +} +func (t *UpdateIntegration_UpdateIntegration_Integration_Webhooks) GetDestinationURL() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Webhooks{} + } + return t.DestinationURL +} +func (t *UpdateIntegration_UpdateIntegration_Integration_Webhooks) GetEnabled() bool { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration_Webhooks{} + } + return t.Enabled +} + +type UpdateIntegration_UpdateIntegration_Integration struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Owner *UpdateIntegration_UpdateIntegration_Integration_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + Secrets []*UpdateIntegration_UpdateIntegration_Integration_Secrets "json:\"secrets,omitempty\" graphql:\"secrets\"" + Oauth2tokens []*UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens "json:\"oauth2tokens,omitempty\" graphql:\"oauth2tokens\"" + Events []*UpdateIntegration_UpdateIntegration_Integration_Events "json:\"events,omitempty\" graphql:\"events\"" + Webhooks []*UpdateIntegration_UpdateIntegration_Integration_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *UpdateIntegration_UpdateIntegration_Integration) GetDescription() *string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Description +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetID() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.ID +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetKind() *string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Kind +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetName() string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Name +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetOwnerID() *string { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.OwnerID +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetOwner() *UpdateIntegration_UpdateIntegration_Integration_Owner { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Owner +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetSecrets() []*UpdateIntegration_UpdateIntegration_Integration_Secrets { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Secrets +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetOauth2tokens() []*UpdateIntegration_UpdateIntegration_Integration_Oauth2tokens { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Oauth2tokens +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetEvents() []*UpdateIntegration_UpdateIntegration_Integration_Events { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Events +} +func (t *UpdateIntegration_UpdateIntegration_Integration) GetWebhooks() []*UpdateIntegration_UpdateIntegration_Integration_Webhooks { + if t == nil { + t = &UpdateIntegration_UpdateIntegration_Integration{} + } + return t.Webhooks +} + +type UpdateIntegration_UpdateIntegration struct { + Integration UpdateIntegration_UpdateIntegration_Integration "json:\"integration\" graphql:\"integration\"" +} + +func (t *UpdateIntegration_UpdateIntegration) GetIntegration() *UpdateIntegration_UpdateIntegration_Integration { + if t == nil { + t = &UpdateIntegration_UpdateIntegration{} + } + return &t.Integration +} + +type GetAllIntegrationHistories_IntegrationHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllIntegrationHistories_IntegrationHistories_Edges struct { + Node *GetAllIntegrationHistories_IntegrationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllIntegrationHistories_IntegrationHistories_Edges) GetNode() *GetAllIntegrationHistories_IntegrationHistories_Edges_Node { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories_Edges{} + } + return t.Node +} + +type GetAllIntegrationHistories_IntegrationHistories struct { + Edges []*GetAllIntegrationHistories_IntegrationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllIntegrationHistories_IntegrationHistories) GetEdges() []*GetAllIntegrationHistories_IntegrationHistories_Edges { + if t == nil { + t = &GetAllIntegrationHistories_IntegrationHistories{} + } + return t.Edges +} + +type GetIntegrationHistories_IntegrationHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Kind *string "json:\"kind,omitempty\" graphql:\"kind\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetKind() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Kind +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetIntegrationHistories_IntegrationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetIntegrationHistories_IntegrationHistories_Edges struct { + Node *GetIntegrationHistories_IntegrationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetIntegrationHistories_IntegrationHistories_Edges) GetNode() *GetIntegrationHistories_IntegrationHistories_Edges_Node { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories_Edges{} + } + return t.Node +} + +type GetIntegrationHistories_IntegrationHistories struct { + Edges []*GetIntegrationHistories_IntegrationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetIntegrationHistories_IntegrationHistories) GetEdges() []*GetIntegrationHistories_IntegrationHistories_Edges { + if t == nil { + t = &GetIntegrationHistories_IntegrationHistories{} + } + return t.Edges +} + +type CreateBulkCSVInvite_CreateBulkCSVInvite_Invites struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetExpires() *time.Time { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.Expires +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetID() string { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.ID +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetRecipient() string { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.Recipient +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetRequestorID() *string { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.RequestorID +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return &t.Role +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetSendAttempts() int64 { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return t.SendAttempts +} +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite_Invites) GetStatus() *enums.InviteStatus { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite_Invites{} + } + return &t.Status +} + +type CreateBulkCSVInvite_CreateBulkCSVInvite struct { + Invites []*CreateBulkCSVInvite_CreateBulkCSVInvite_Invites "json:\"invites,omitempty\" graphql:\"invites\"" +} + +func (t *CreateBulkCSVInvite_CreateBulkCSVInvite) GetInvites() []*CreateBulkCSVInvite_CreateBulkCSVInvite_Invites { + if t == nil { + t = &CreateBulkCSVInvite_CreateBulkCSVInvite{} + } + return t.Invites +} + +type CreateBulkInvite_CreateBulkInvite_Invites struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetExpires() *time.Time { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.Expires +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetID() string { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.ID +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetRecipient() string { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.Recipient +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetRequestorID() *string { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.RequestorID +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return &t.Role +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetSendAttempts() int64 { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return t.SendAttempts +} +func (t *CreateBulkInvite_CreateBulkInvite_Invites) GetStatus() *enums.InviteStatus { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite_Invites{} + } + return &t.Status +} + +type CreateBulkInvite_CreateBulkInvite struct { + Invites []*CreateBulkInvite_CreateBulkInvite_Invites "json:\"invites,omitempty\" graphql:\"invites\"" +} + +func (t *CreateBulkInvite_CreateBulkInvite) GetInvites() []*CreateBulkInvite_CreateBulkInvite_Invites { + if t == nil { + t = &CreateBulkInvite_CreateBulkInvite{} + } + return t.Invites +} + +type CreateInvite_CreateInvite_Invite_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateInvite_CreateInvite_Invite_Owner) GetID() string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite_Owner{} + } + return t.ID +} + +type CreateInvite_CreateInvite_Invite struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" + Owner *CreateInvite_CreateInvite_Invite_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateInvite_CreateInvite_Invite) GetExpires() *time.Time { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.Expires +} +func (t *CreateInvite_CreateInvite_Invite) GetID() string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.ID +} +func (t *CreateInvite_CreateInvite_Invite) GetRecipient() string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.Recipient +} +func (t *CreateInvite_CreateInvite_Invite) GetRequestorID() *string { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.RequestorID +} +func (t *CreateInvite_CreateInvite_Invite) GetRole() *enums.Role { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return &t.Role +} +func (t *CreateInvite_CreateInvite_Invite) GetSendAttempts() int64 { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.SendAttempts +} +func (t *CreateInvite_CreateInvite_Invite) GetStatus() *enums.InviteStatus { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return &t.Status +} +func (t *CreateInvite_CreateInvite_Invite) GetOwner() *CreateInvite_CreateInvite_Invite_Owner { + if t == nil { + t = &CreateInvite_CreateInvite_Invite{} + } + return t.Owner +} + +type CreateInvite_CreateInvite struct { + Invite CreateInvite_CreateInvite_Invite "json:\"invite\" graphql:\"invite\"" +} + +func (t *CreateInvite_CreateInvite) GetInvite() *CreateInvite_CreateInvite_Invite { + if t == nil { + t = &CreateInvite_CreateInvite{} + } + return &t.Invite +} + +type DeleteInvite_DeleteInvite struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteInvite_DeleteInvite) GetDeletedID() string { + if t == nil { + t = &DeleteInvite_DeleteInvite{} + } + return t.DeletedID +} + +type GetInviteByID_Invite_Owner struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetInviteByID_Invite_Owner) GetDisplayName() string { + if t == nil { + t = &GetInviteByID_Invite_Owner{} + } + return t.DisplayName +} +func (t *GetInviteByID_Invite_Owner) GetID() string { + if t == nil { + t = &GetInviteByID_Invite_Owner{} + } + return t.ID +} +func (t *GetInviteByID_Invite_Owner) GetName() string { + if t == nil { + t = &GetInviteByID_Invite_Owner{} + } + return t.Name +} + +type GetInviteByID_Invite struct { + Expires *time.Time "json:\"expires,omitempty\" graphql:\"expires\"" + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" + Owner *GetInviteByID_Invite_Owner "json:\"owner,omitempty\" graphql:\"owner\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetInviteByID_Invite) GetExpires() *time.Time { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.Expires +} +func (t *GetInviteByID_Invite) GetID() string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.ID +} +func (t *GetInviteByID_Invite) GetRecipient() string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.Recipient +} +func (t *GetInviteByID_Invite) GetRequestorID() *string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.RequestorID +} +func (t *GetInviteByID_Invite) GetRole() *enums.Role { + if t == nil { + t = &GetInviteByID_Invite{} + } + return &t.Role +} +func (t *GetInviteByID_Invite) GetSendAttempts() int64 { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.SendAttempts +} +func (t *GetInviteByID_Invite) GetStatus() *enums.InviteStatus { + if t == nil { + t = &GetInviteByID_Invite{} + } + return &t.Status +} +func (t *GetInviteByID_Invite) GetOwner() *GetInviteByID_Invite_Owner { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.Owner +} +func (t *GetInviteByID_Invite) GetCreatedAt() *time.Time { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.CreatedAt +} +func (t *GetInviteByID_Invite) GetCreatedBy() *string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.CreatedBy +} +func (t *GetInviteByID_Invite) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.UpdatedAt +} +func (t *GetInviteByID_Invite) GetUpdatedBy() *string { + if t == nil { + t = &GetInviteByID_Invite{} + } + return t.UpdatedBy +} + +type GetAllInvites_Invites_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Recipient string "json:\"recipient\" graphql:\"recipient\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *GetAllInvites_Invites_Edges_Node) GetID() string { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return t.ID +} +func (t *GetAllInvites_Invites_Edges_Node) GetRecipient() string { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return t.Recipient +} +func (t *GetAllInvites_Invites_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return &t.Role +} +func (t *GetAllInvites_Invites_Edges_Node) GetStatus() *enums.InviteStatus { + if t == nil { + t = &GetAllInvites_Invites_Edges_Node{} + } + return &t.Status +} + +type GetAllInvites_Invites_Edges struct { + Node *GetAllInvites_Invites_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllInvites_Invites_Edges) GetNode() *GetAllInvites_Invites_Edges_Node { + if t == nil { + t = &GetAllInvites_Invites_Edges{} + } + return t.Node +} + +type GetAllInvites_Invites struct { + Edges []*GetAllInvites_Invites_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllInvites_Invites) GetEdges() []*GetAllInvites_Invites_Edges { + if t == nil { + t = &GetAllInvites_Invites{} + } + return t.Edges +} + +type InvitesByOrgID_Invites_Edges_Node_Owner_Invites struct { + Recipient string "json:\"recipient\" graphql:\"recipient\"" + RequestorID *string "json:\"requestorID,omitempty\" graphql:\"requestorID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + SendAttempts int64 "json:\"sendAttempts\" graphql:\"sendAttempts\"" + Status enums.InviteStatus "json:\"status\" graphql:\"status\"" +} + +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetRecipient() string { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return t.Recipient +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetRequestorID() *string { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return t.RequestorID +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetRole() *enums.Role { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return &t.Role +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetSendAttempts() int64 { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return t.SendAttempts +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner_Invites) GetStatus() *enums.InviteStatus { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner_Invites{} + } + return &t.Status +} + +type InvitesByOrgID_Invites_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" + Invites []*InvitesByOrgID_Invites_Edges_Node_Owner_Invites "json:\"invites,omitempty\" graphql:\"invites\"" +} + +func (t *InvitesByOrgID_Invites_Edges_Node_Owner) GetID() string { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner{} + } + return t.ID +} +func (t *InvitesByOrgID_Invites_Edges_Node_Owner) GetInvites() []*InvitesByOrgID_Invites_Edges_Node_Owner_Invites { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node_Owner{} + } + return t.Invites +} + +type InvitesByOrgID_Invites_Edges_Node struct { + Owner *InvitesByOrgID_Invites_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *InvitesByOrgID_Invites_Edges_Node) GetOwner() *InvitesByOrgID_Invites_Edges_Node_Owner { + if t == nil { + t = &InvitesByOrgID_Invites_Edges_Node{} + } + return t.Owner +} + +type InvitesByOrgID_Invites_Edges struct { + Node *InvitesByOrgID_Invites_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *InvitesByOrgID_Invites_Edges) GetNode() *InvitesByOrgID_Invites_Edges_Node { + if t == nil { + t = &InvitesByOrgID_Invites_Edges{} + } + return t.Node +} + +type InvitesByOrgID_Invites struct { + Edges []*InvitesByOrgID_Invites_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *InvitesByOrgID_Invites) GetEdges() []*InvitesByOrgID_Invites_Edges { + if t == nil { + t = &InvitesByOrgID_Invites{} + } + return t.Edges +} + +type GetAllNoteHistories_NoteHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetText() string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.Text +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllNoteHistories_NoteHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllNoteHistories_NoteHistories_Edges struct { + Node *GetAllNoteHistories_NoteHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllNoteHistories_NoteHistories_Edges) GetNode() *GetAllNoteHistories_NoteHistories_Edges_Node { + if t == nil { + t = &GetAllNoteHistories_NoteHistories_Edges{} + } + return t.Node +} + +type GetAllNoteHistories_NoteHistories struct { + Edges []*GetAllNoteHistories_NoteHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllNoteHistories_NoteHistories) GetEdges() []*GetAllNoteHistories_NoteHistories_Edges { + if t == nil { + t = &GetAllNoteHistories_NoteHistories{} + } + return t.Edges +} + +type GetNoteHistories_NoteHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Text string "json:\"text\" graphql:\"text\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.ID +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetText() string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.Text +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetNoteHistories_NoteHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetNoteHistories_NoteHistories_Edges struct { + Node *GetNoteHistories_NoteHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetNoteHistories_NoteHistories_Edges) GetNode() *GetNoteHistories_NoteHistories_Edges_Node { + if t == nil { + t = &GetNoteHistories_NoteHistories_Edges{} + } + return t.Node +} + +type GetNoteHistories_NoteHistories struct { + Edges []*GetNoteHistories_NoteHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetNoteHistories_NoteHistories) GetEdges() []*GetNoteHistories_NoteHistories_Edges { + if t == nil { + t = &GetNoteHistories_NoteHistories{} + } + return t.Edges +} + +type GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node struct { + AuthStyle string "json:\"authStyle\" graphql:\"authStyle\"" + AuthURL string "json:\"authURL\" graphql:\"authURL\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ClientSecret string "json:\"clientSecret\" graphql:\"clientSecret\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + InfoURL string "json:\"infoURL\" graphql:\"infoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + RedirectURL string "json:\"redirectURL\" graphql:\"redirectURL\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Scopes string "json:\"scopes\" graphql:\"scopes\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TokenURL string "json:\"tokenURL\" graphql:\"tokenURL\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthStyle() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthStyle +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientID() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientID +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientSecret() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientSecret +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetInfoURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.InfoURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRedirectURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.RedirectURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetScopes() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Scopes +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTokenURL() string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.TokenURL +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllOauthProviderHistories_OauthProviderHistories_Edges struct { + Node *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOauthProviderHistories_OauthProviderHistories_Edges) GetNode() *GetAllOauthProviderHistories_OauthProviderHistories_Edges_Node { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories_Edges{} + } + return t.Node +} + +type GetAllOauthProviderHistories_OauthProviderHistories struct { + Edges []*GetAllOauthProviderHistories_OauthProviderHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOauthProviderHistories_OauthProviderHistories) GetEdges() []*GetAllOauthProviderHistories_OauthProviderHistories_Edges { + if t == nil { + t = &GetAllOauthProviderHistories_OauthProviderHistories{} + } + return t.Edges +} + +type GetOauthProviderHistories_OauthProviderHistories_Edges_Node struct { + AuthStyle string "json:\"authStyle\" graphql:\"authStyle\"" + AuthURL string "json:\"authURL\" graphql:\"authURL\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ClientSecret string "json:\"clientSecret\" graphql:\"clientSecret\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + InfoURL string "json:\"infoURL\" graphql:\"infoURL\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + RedirectURL string "json:\"redirectURL\" graphql:\"redirectURL\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Scopes string "json:\"scopes\" graphql:\"scopes\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TokenURL string "json:\"tokenURL\" graphql:\"tokenURL\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthStyle() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthStyle +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetAuthURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.AuthURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientID() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientID +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetClientSecret() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ClientSecret +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetInfoURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.InfoURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Name +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRedirectURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.RedirectURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetScopes() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Scopes +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetTokenURL() string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.TokenURL +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetOauthProviderHistories_OauthProviderHistories_Edges struct { + Node *GetOauthProviderHistories_OauthProviderHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOauthProviderHistories_OauthProviderHistories_Edges) GetNode() *GetOauthProviderHistories_OauthProviderHistories_Edges_Node { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories_Edges{} + } + return t.Node +} + +type GetOauthProviderHistories_OauthProviderHistories struct { + Edges []*GetOauthProviderHistories_OauthProviderHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOauthProviderHistories_OauthProviderHistories) GetEdges() []*GetOauthProviderHistories_OauthProviderHistories_Edges { + if t == nil { + t = &GetOauthProviderHistories_OauthProviderHistories{} + } + return t.Edges +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration) GetID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration{} + } + return t.ID +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events) GetID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events{} + } + return t.ID +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsEmail() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmail +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsEmailVerified() bool { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmailVerified +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsGroups() []string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsGroups +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsPreferredUsername() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsPreferredUsername +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsUserID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUserID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClaimsUsername() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUsername +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetClientID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClientID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetConnectorData() []string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorData +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetConnectorID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetID() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.ID +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetLastUsed() *time.Time { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return &t.LastUsed +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetNonce() string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Nonce +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Scopes +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetIntegration() []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Integration { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Integration +} +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens) GetEvents() []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens_Events { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens{} + } + return t.Events +} + +type CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken struct { + OhAuthTooTokens []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens "json:\"ohAuthTooTokens,omitempty\" graphql:\"ohAuthTooTokens\"" +} + +func (t *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken) GetOhAuthTooTokens() []*CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken_OhAuthTooTokens { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken{} + } + return t.OhAuthTooTokens +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration) GetID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration{} + } + return t.ID +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events) GetID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events{} + } + return t.ID +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsEmail() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmail +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsEmailVerified() bool { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsEmailVerified +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsGroups() []string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsGroups +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsPreferredUsername() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsPreferredUsername +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsUserID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUserID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClaimsUsername() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClaimsUsername +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetClientID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ClientID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetConnectorData() []string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorData +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetConnectorID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ConnectorID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetID() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.ID +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetLastUsed() *time.Time { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return &t.LastUsed +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetNonce() string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Nonce +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Scopes +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetIntegration() []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Integration { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Integration +} +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens) GetEvents() []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens_Events { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens{} + } + return t.Events +} + +type CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken struct { + OhAuthTooTokens []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens "json:\"ohAuthTooTokens,omitempty\" graphql:\"ohAuthTooTokens\"" +} + +func (t *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken) GetOhAuthTooTokens() []*CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken_OhAuthTooTokens { + if t == nil { + t = &CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken{} + } + return t.OhAuthTooTokens +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration) GetID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration{} + } + return t.ID +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events) GetID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events{} + } + return t.ID +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsEmail() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmail +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsEmailVerified() bool { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmailVerified +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsGroups() []string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsGroups +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsPreferredUsername() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsPreferredUsername +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsUserID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUserID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClaimsUsername() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUsername +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetClientID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClientID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetConnectorData() []string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorData +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetConnectorID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetID() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.ID +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetLastUsed() *time.Time { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return &t.LastUsed +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetNonce() string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Nonce +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetScopes() []string { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Scopes +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetIntegration() []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Integration { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Integration +} +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken) GetEvents() []*CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken_Events { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken{} + } + return t.Events +} + +type CreateOhAuthTooToken_CreateOhAuthTooToken struct { + OhAuthTooToken CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken "json:\"ohAuthTooToken\" graphql:\"ohAuthTooToken\"" +} + +func (t *CreateOhAuthTooToken_CreateOhAuthTooToken) GetOhAuthTooToken() *CreateOhAuthTooToken_CreateOhAuthTooToken_OhAuthTooToken { + if t == nil { + t = &CreateOhAuthTooToken_CreateOhAuthTooToken{} + } + return &t.OhAuthTooToken +} + +type DeleteOhAuthTooToken_DeleteOhAuthTooToken struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteOhAuthTooToken_DeleteOhAuthTooToken) GetDeletedID() string { + if t == nil { + t = &DeleteOhAuthTooToken_DeleteOhAuthTooToken{} + } + return t.DeletedID +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration) GetID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration{} + } + return t.ID +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events{} + } + return t.ID +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsEmail() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsEmail +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsEmailVerified() bool { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsEmailVerified +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsGroups() []string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsGroups +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsPreferredUsername() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsPreferredUsername +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsUserID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsUserID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClaimsUsername() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClaimsUsername +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetClientID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ClientID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetConnectorData() []string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ConnectorData +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetConnectorID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ConnectorID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetID() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.ID +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetLastUsed() *time.Time { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return &t.LastUsed +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetNonce() string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Nonce +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetScopes() []string { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Scopes +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetIntegration() []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Integration { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Integration +} +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node) GetEvents() []*GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node_Events { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node{} + } + return t.Events +} + +type GetOhAuthTooTokens_OhAuthTooTokens_Edges struct { + Node *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens_Edges) GetNode() *GetOhAuthTooTokens_OhAuthTooTokens_Edges_Node { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens_Edges{} + } + return t.Node +} + +type GetOhAuthTooTokens_OhAuthTooTokens struct { + Edges []*GetOhAuthTooTokens_OhAuthTooTokens_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOhAuthTooTokens_OhAuthTooTokens) GetEdges() []*GetOhAuthTooTokens_OhAuthTooTokens_Edges { + if t == nil { + t = &GetOhAuthTooTokens_OhAuthTooTokens{} + } + return t.Edges +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration) GetID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration{} + } + return t.ID +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events) GetID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events{} + } + return t.ID +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken struct { + ClaimsEmail string "json:\"claimsEmail\" graphql:\"claimsEmail\"" + ClaimsEmailVerified bool "json:\"claimsEmailVerified\" graphql:\"claimsEmailVerified\"" + ClaimsGroups []string "json:\"claimsGroups,omitempty\" graphql:\"claimsGroups\"" + ClaimsPreferredUsername string "json:\"claimsPreferredUsername\" graphql:\"claimsPreferredUsername\"" + ClaimsUserID string "json:\"claimsUserID\" graphql:\"claimsUserID\"" + ClaimsUsername string "json:\"claimsUsername\" graphql:\"claimsUsername\"" + ClientID string "json:\"clientID\" graphql:\"clientID\"" + ConnectorData []string "json:\"connectorData,omitempty\" graphql:\"connectorData\"" + ConnectorID string "json:\"connectorID\" graphql:\"connectorID\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsed time.Time "json:\"lastUsed\" graphql:\"lastUsed\"" + Nonce string "json:\"nonce\" graphql:\"nonce\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Integration []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration "json:\"integration,omitempty\" graphql:\"integration\"" + Events []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsEmail() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmail +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsEmailVerified() bool { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsEmailVerified +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsGroups() []string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsGroups +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsPreferredUsername() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsPreferredUsername +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsUserID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUserID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClaimsUsername() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClaimsUsername +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetClientID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ClientID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetConnectorData() []string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorData +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetConnectorID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ConnectorID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetID() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.ID +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetLastUsed() *time.Time { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return &t.LastUsed +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetNonce() string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Nonce +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetScopes() []string { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Scopes +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetIntegration() []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Integration { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Integration +} +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken) GetEvents() []*UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken_Events { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken{} + } + return t.Events +} + +type UpdateOhAuthTooToken_UpdateOhAuthTooToken struct { + OhAuthTooToken UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken "json:\"ohAuthTooToken\" graphql:\"ohAuthTooToken\"" +} + +func (t *UpdateOhAuthTooToken_UpdateOhAuthTooToken) GetOhAuthTooToken() *UpdateOhAuthTooToken_UpdateOhAuthTooToken_OhAuthTooToken { + if t == nil { + t = &UpdateOhAuthTooToken_UpdateOhAuthTooToken{} + } + return &t.OhAuthTooToken +} + +type CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetID() string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.ID +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetName() string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.Name +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetDisplayName() string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.DisplayName +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.Description +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetPersonalOrg() *bool { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.PersonalOrg +} +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations) GetTags() []string { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations{} + } + return t.Tags +} + +type CreateBulkCSVOrganization_CreateBulkCSVOrganization struct { + Organizations []*CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkCSVOrganization_CreateBulkCSVOrganization) GetOrganizations() []*CreateBulkCSVOrganization_CreateBulkCSVOrganization_Organizations { + if t == nil { + t = &CreateBulkCSVOrganization_CreateBulkCSVOrganization{} + } + return t.Organizations +} + +type CreateBulkOrganization_CreateBulkOrganization_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetID() string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.ID +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetName() string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.Name +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetDisplayName() string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.DisplayName +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetDescription() *string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.Description +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetPersonalOrg() *bool { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.PersonalOrg +} +func (t *CreateBulkOrganization_CreateBulkOrganization_Organizations) GetTags() []string { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization_Organizations{} + } + return t.Tags +} + +type CreateBulkOrganization_CreateBulkOrganization struct { + Organizations []*CreateBulkOrganization_CreateBulkOrganization_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkOrganization_CreateBulkOrganization) GetOrganizations() []*CreateBulkOrganization_CreateBulkOrganization_Organizations { + if t == nil { + t = &CreateBulkOrganization_CreateBulkOrganization{} + } + return t.Organizations +} + +type CreateOrganization_CreateOrganization_Organization_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.CreatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.UpdatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetCreatedBy() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.CreatedBy +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetUpdatedBy() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.UpdatedBy +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetDomains() []string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.Domains +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingContact() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingContact +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingEmail() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingEmail +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingPhone() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingPhone +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingAddress() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.BillingAddress +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.TaxIdentifier +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.GeoLocation +} +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetTags() []string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Setting{} + } + return t.Tags +} + +type CreateOrganization_CreateOrganization_Organization_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Parent) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Parent{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization_Parent) GetName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Parent{} + } + return t.Name +} + +type CreateOrganization_CreateOrganization_Organization_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.Name +} +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges_Node{} + } + return t.Description +} + +type CreateOrganization_CreateOrganization_Organization_Children_Edges struct { + Node *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Children_Edges) GetNode() *CreateOrganization_CreateOrganization_Organization_Children_Edges_Node { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children_Edges{} + } + return t.Node +} + +type CreateOrganization_CreateOrganization_Organization_Children struct { + Edges []*CreateOrganization_CreateOrganization_Organization_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Children) GetEdges() []*CreateOrganization_CreateOrganization_Organization_Children_Edges { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization_Children{} + } + return t.Edges +} + +type CreateOrganization_CreateOrganization_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + Setting *CreateOrganization_CreateOrganization_Organization_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + Parent *CreateOrganization_CreateOrganization_Organization_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children CreateOrganization_CreateOrganization_Organization_Children "json:\"children\" graphql:\"children\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization) GetID() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.ID +} +func (t *CreateOrganization_CreateOrganization_Organization) GetName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Name +} +func (t *CreateOrganization_CreateOrganization_Organization) GetDisplayName() string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.DisplayName +} +func (t *CreateOrganization_CreateOrganization_Organization) GetDescription() *string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Description +} +func (t *CreateOrganization_CreateOrganization_Organization) GetPersonalOrg() *bool { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.PersonalOrg +} +func (t *CreateOrganization_CreateOrganization_Organization) GetTags() []string { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Tags +} +func (t *CreateOrganization_CreateOrganization_Organization) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.CreatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.UpdatedAt +} +func (t *CreateOrganization_CreateOrganization_Organization) GetSetting() *CreateOrganization_CreateOrganization_Organization_Setting { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Setting +} +func (t *CreateOrganization_CreateOrganization_Organization) GetParent() *CreateOrganization_CreateOrganization_Organization_Parent { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return t.Parent +} +func (t *CreateOrganization_CreateOrganization_Organization) GetChildren() *CreateOrganization_CreateOrganization_Organization_Children { + if t == nil { + t = &CreateOrganization_CreateOrganization_Organization{} + } + return &t.Children +} + +type CreateOrganization_CreateOrganization struct { + Organization CreateOrganization_CreateOrganization_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *CreateOrganization_CreateOrganization) GetOrganization() *CreateOrganization_CreateOrganization_Organization { + if t == nil { + t = &CreateOrganization_CreateOrganization{} + } + return &t.Organization +} + +type DeleteOrganization_DeleteOrganization struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteOrganization_DeleteOrganization) GetDeletedID() string { + if t == nil { + t = &DeleteOrganization_DeleteOrganization{} + } + return t.DeletedID +} + +type GetAllOrganizations_Organizations_Edges_Node_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Parent) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Parent{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Parent) GetName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Parent{} + } + return t.Name +} + +type GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Name +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Description +} + +type GetAllOrganizations_Organizations_Edges_Node_Children_Edges struct { + Node *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Children_Edges) GetNode() *GetAllOrganizations_Organizations_Edges_Node_Children_Edges_Node { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children_Edges{} + } + return t.Node +} + +type GetAllOrganizations_Organizations_Edges_Node_Children struct { + Edges []*GetAllOrganizations_Organizations_Edges_Node_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Children) GetEdges() []*GetAllOrganizations_Organizations_Edges_Node_Children_Edges { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Children{} + } + return t.Edges +} + +type GetAllOrganizations_Organizations_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetAllOrganizations_Organizations_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetAllOrganizations_Organizations_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Members) GetUser() *GetAllOrganizations_Organizations_Edges_Node_Members_User { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Members{} + } + return &t.User +} + +type GetAllOrganizations_Organizations_Edges_Node_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetDomains() []string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Domains +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingContact() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingContact +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingEmail() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingEmail +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingPhone() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingPhone +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingAddress +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.TaxIdentifier +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.GeoLocation +} +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Tags +} + +type GetAllOrganizations_Organizations_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Parent *GetAllOrganizations_Organizations_Edges_Node_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children GetAllOrganizations_Organizations_Edges_Node_Children "json:\"children\" graphql:\"children\"" + Members []*GetAllOrganizations_Organizations_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *GetAllOrganizations_Organizations_Edges_Node_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Name +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Description +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetParent() *GetAllOrganizations_Organizations_Edges_Node_Parent { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Parent +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetChildren() *GetAllOrganizations_Organizations_Edges_Node_Children { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return &t.Children +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetMembers() []*GetAllOrganizations_Organizations_Edges_Node_Members { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Members +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetSetting() *GetAllOrganizations_Organizations_Edges_Node_Setting { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.Setting +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizations_Organizations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges_Node{} + } + return t.UpdatedAt +} + +type GetAllOrganizations_Organizations_Edges struct { + Node *GetAllOrganizations_Organizations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizations_Organizations_Edges) GetNode() *GetAllOrganizations_Organizations_Edges_Node { + if t == nil { + t = &GetAllOrganizations_Organizations_Edges{} + } + return t.Node +} + +type GetAllOrganizations_Organizations struct { + Edges []*GetAllOrganizations_Organizations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizations_Organizations) GetEdges() []*GetAllOrganizations_Organizations_Edges { + if t == nil { + t = &GetAllOrganizations_Organizations{} + } + return t.Edges +} + +type GetOrganizationByID_Organization_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizationByID_Organization_Parent) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Parent{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Parent) GetName() string { + if t == nil { + t = &GetOrganizationByID_Organization_Parent{} + } + return t.Name +} + +type GetOrganizationByID_Organization_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizationByID_Organization_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges_Node{} + } + return t.Description +} + +type GetOrganizationByID_Organization_Children_Edges struct { + Node *GetOrganizationByID_Organization_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationByID_Organization_Children_Edges) GetNode() *GetOrganizationByID_Organization_Children_Edges_Node { + if t == nil { + t = &GetOrganizationByID_Organization_Children_Edges{} + } + return t.Node +} + +type GetOrganizationByID_Organization_Children struct { + Edges []*GetOrganizationByID_Organization_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationByID_Organization_Children) GetEdges() []*GetOrganizationByID_Organization_Children_Edges { + if t == nil { + t = &GetOrganizationByID_Organization_Children{} + } + return t.Edges +} + +type GetOrganizationByID_Organization_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetOrganizationByID_Organization_Members_User) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Members_User{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Members_User) GetFirstName() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Members_User{} + } + return t.FirstName +} +func (t *GetOrganizationByID_Organization_Members_User) GetLastName() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Members_User{} + } + return t.LastName +} + +type GetOrganizationByID_Organization_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetOrganizationByID_Organization_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetOrganizationByID_Organization_Members) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Members{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Members) GetRole() *enums.Role { + if t == nil { + t = &GetOrganizationByID_Organization_Members{} + } + return &t.Role +} +func (t *GetOrganizationByID_Organization_Members) GetUser() *GetOrganizationByID_Organization_Members_User { + if t == nil { + t = &GetOrganizationByID_Organization_Members{} + } + return &t.User +} + +type GetOrganizationByID_Organization_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetOrganizationByID_Organization_Setting) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.CreatedAt +} +func (t *GetOrganizationByID_Organization_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.UpdatedAt +} +func (t *GetOrganizationByID_Organization_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.CreatedBy +} +func (t *GetOrganizationByID_Organization_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.UpdatedBy +} +func (t *GetOrganizationByID_Organization_Setting) GetDomains() []string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.Domains +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingContact +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingEmail +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingPhone +} +func (t *GetOrganizationByID_Organization_Setting) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.BillingAddress +} +func (t *GetOrganizationByID_Organization_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationByID_Organization_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.GeoLocation +} +func (t *GetOrganizationByID_Organization_Setting) GetTags() []string { + if t == nil { + t = &GetOrganizationByID_Organization_Setting{} + } + return t.Tags +} + +type GetOrganizationByID_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Parent *GetOrganizationByID_Organization_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children GetOrganizationByID_Organization_Children "json:\"children\" graphql:\"children\"" + Members []*GetOrganizationByID_Organization_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *GetOrganizationByID_Organization_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationByID_Organization) GetID() string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.ID +} +func (t *GetOrganizationByID_Organization) GetName() string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Name +} +func (t *GetOrganizationByID_Organization) GetDisplayName() string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.DisplayName +} +func (t *GetOrganizationByID_Organization) GetDescription() *string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Description +} +func (t *GetOrganizationByID_Organization) GetPersonalOrg() *bool { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.PersonalOrg +} +func (t *GetOrganizationByID_Organization) GetTags() []string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Tags +} +func (t *GetOrganizationByID_Organization) GetParent() *GetOrganizationByID_Organization_Parent { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Parent +} +func (t *GetOrganizationByID_Organization) GetChildren() *GetOrganizationByID_Organization_Children { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return &t.Children +} +func (t *GetOrganizationByID_Organization) GetMembers() []*GetOrganizationByID_Organization_Members { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Members +} +func (t *GetOrganizationByID_Organization) GetSetting() *GetOrganizationByID_Organization_Setting { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.Setting +} +func (t *GetOrganizationByID_Organization) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.CreatedAt +} +func (t *GetOrganizationByID_Organization) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.CreatedBy +} +func (t *GetOrganizationByID_Organization) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.UpdatedAt +} +func (t *GetOrganizationByID_Organization) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationByID_Organization{} + } + return t.UpdatedBy +} + +type GetOrganizations_Organizations_Edges_Node_Parent struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Parent) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Parent{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Parent) GetName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Parent{} + } + return t.Name +} + +type GetOrganizations_Organizations_Edges_Node_Children_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges_Node{} + } + return t.Description +} + +type GetOrganizations_Organizations_Edges_Node_Children_Edges struct { + Node *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Children_Edges) GetNode() *GetOrganizations_Organizations_Edges_Node_Children_Edges_Node { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children_Edges{} + } + return t.Node +} + +type GetOrganizations_Organizations_Edges_Node_Children struct { + Edges []*GetOrganizations_Organizations_Edges_Node_Children_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Children) GetEdges() []*GetOrganizations_Organizations_Edges_Node_Children_Edges { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Children{} + } + return t.Edges +} + +type GetOrganizations_Organizations_Edges_Node_Members_User struct { + ID string "json:\"id\" graphql:\"id\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Members_User) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Members_User) GetFirstName() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.FirstName +} +func (t *GetOrganizations_Organizations_Edges_Node_Members_User) GetLastName() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members_User{} + } + return t.LastName +} + +type GetOrganizations_Organizations_Edges_Node_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetOrganizations_Organizations_Edges_Node_Members_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Members) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Members) GetRole() *enums.Role { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members{} + } + return &t.Role +} +func (t *GetOrganizations_Organizations_Edges_Node_Members) GetUser() *GetOrganizations_Organizations_Edges_Node_Members_User { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Members{} + } + return &t.User +} + +type GetOrganizations_Organizations_Edges_Node_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.UpdatedBy +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetDomains() []string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Domains +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingContact() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingContact +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingEmail +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingPhone +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.BillingAddress +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.TaxIdentifier +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.GeoLocation +} +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node_Setting{} + } + return t.Tags +} + +type GetOrganizations_Organizations_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Parent *GetOrganizations_Organizations_Edges_Node_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Children GetOrganizations_Organizations_Edges_Node_Children "json:\"children\" graphql:\"children\"" + Members []*GetOrganizations_Organizations_Edges_Node_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *GetOrganizations_Organizations_Edges_Node_Setting "json:\"setting,omitempty\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizations_Organizations_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizations_Organizations_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizations_Organizations_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Description +} +func (t *GetOrganizations_Organizations_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetOrganizations_Organizations_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizations_Organizations_Edges_Node) GetParent() *GetOrganizations_Organizations_Edges_Node_Parent { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Parent +} +func (t *GetOrganizations_Organizations_Edges_Node) GetChildren() *GetOrganizations_Organizations_Edges_Node_Children { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return &t.Children +} +func (t *GetOrganizations_Organizations_Edges_Node) GetMembers() []*GetOrganizations_Organizations_Edges_Node_Members { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Members +} +func (t *GetOrganizations_Organizations_Edges_Node) GetSetting() *GetOrganizations_Organizations_Edges_Node_Setting { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.Setting +} +func (t *GetOrganizations_Organizations_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizations_Organizations_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizations_Organizations_Edges_Node{} + } + return t.UpdatedAt +} + +type GetOrganizations_Organizations_Edges struct { + Node *GetOrganizations_Organizations_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizations_Organizations_Edges) GetNode() *GetOrganizations_Organizations_Edges_Node { + if t == nil { + t = &GetOrganizations_Organizations_Edges{} + } + return t.Node +} + +type GetOrganizations_Organizations struct { + Edges []*GetOrganizations_Organizations_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizations_Organizations) GetEdges() []*GetOrganizations_Organizations_Edges { + if t == nil { + t = &GetOrganizations_Organizations{} + } + return t.Edges +} + +type UpdateOrganization_UpdateOrganization_Organization_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *UpdateOrganization_UpdateOrganization_Organization_Members) GetID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Members{} + } + return t.ID +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Members) GetRole() *enums.Role { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Members{} + } + return &t.Role +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Members) GetUserID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Members{} + } + return t.UserID +} + +type UpdateOrganization_UpdateOrganization_Organization_Setting struct { + ID string "json:\"id\" graphql:\"id\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" +} + +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.ID +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.CreatedAt +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.UpdatedAt +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetCreatedBy() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.CreatedBy +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.UpdatedBy +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetDomains() []string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.Domains +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingContact() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingContact +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingEmail() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingEmail +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingPhone() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingPhone +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingAddress() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.BillingAddress +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetTaxIdentifier() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.TaxIdentifier +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetGeoLocation() *enums.Region { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.GeoLocation +} +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetTags() []string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} + } + return t.Tags +} + +type UpdateOrganization_UpdateOrganization_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Members []*UpdateOrganization_UpdateOrganization_Organization_Members "json:\"members,omitempty\" graphql:\"members\"" + Setting *UpdateOrganization_UpdateOrganization_Organization_Setting "json:\"setting,omitempty\" graphql:\"setting\"" +} + +func (t *UpdateOrganization_UpdateOrganization_Organization) GetID() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.ID +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetName() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Name +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetDisplayName() string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.DisplayName +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetDescription() *string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Description +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetPersonalOrg() *bool { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.PersonalOrg +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetTags() []string { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Tags +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetMembers() []*UpdateOrganization_UpdateOrganization_Organization_Members { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Members +} +func (t *UpdateOrganization_UpdateOrganization_Organization) GetSetting() *UpdateOrganization_UpdateOrganization_Organization_Setting { + if t == nil { + t = &UpdateOrganization_UpdateOrganization_Organization{} + } + return t.Setting +} + +type UpdateOrganization_UpdateOrganization struct { + Organization UpdateOrganization_UpdateOrganization_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *UpdateOrganization_UpdateOrganization) GetOrganization() *UpdateOrganization_UpdateOrganization_Organization { + if t == nil { + t = &UpdateOrganization_UpdateOrganization{} + } + return &t.Organization +} + +type GetAllOrganizationHistories_OrganizationHistories_Edges_Node struct { + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DedicatedDb bool "json:\"dedicatedDb\" graphql:\"dedicatedDb\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetDedicatedDb() bool { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DedicatedDb +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllOrganizationHistories_OrganizationHistories_Edges struct { + Node *GetAllOrganizationHistories_OrganizationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizationHistories_OrganizationHistories_Edges) GetNode() *GetAllOrganizationHistories_OrganizationHistories_Edges_Node { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories_Edges{} + } + return t.Node +} + +type GetAllOrganizationHistories_OrganizationHistories struct { + Edges []*GetAllOrganizationHistories_OrganizationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizationHistories_OrganizationHistories) GetEdges() []*GetAllOrganizationHistories_OrganizationHistories_Edges { + if t == nil { + t = &GetAllOrganizationHistories_OrganizationHistories{} + } + return t.Edges +} + +type GetOrganizationHistories_OrganizationHistories_Edges_Node struct { + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DedicatedDb bool "json:\"dedicatedDb\" graphql:\"dedicatedDb\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetDedicatedDb() bool { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DedicatedDb +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Description +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Name +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetPersonalOrg() *bool { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.PersonalOrg +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrganizationHistories_OrganizationHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetOrganizationHistories_OrganizationHistories_Edges struct { + Node *GetOrganizationHistories_OrganizationHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationHistories_OrganizationHistories_Edges) GetNode() *GetOrganizationHistories_OrganizationHistories_Edges_Node { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories_Edges{} + } + return t.Node +} + +type GetOrganizationHistories_OrganizationHistories struct { + Edges []*GetOrganizationHistories_OrganizationHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationHistories_OrganizationHistories) GetEdges() []*GetOrganizationHistories_OrganizationHistories_Edges { + if t == nil { + t = &GetOrganizationHistories_OrganizationHistories{} + } + return t.Edges +} + +type GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.Name +} + +type GetAllOrganizationSettings_OrganizationSettings_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingContact +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Domains +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetOrganization() *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Organization +} + +type GetAllOrganizationSettings_OrganizationSettings_Edges struct { + Node *GetAllOrganizationSettings_OrganizationSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges) GetNode() *GetAllOrganizationSettings_OrganizationSettings_Edges_Node { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings_Edges{} + } + return t.Node +} + +type GetAllOrganizationSettings_OrganizationSettings struct { + Edges []*GetAllOrganizationSettings_OrganizationSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizationSettings_OrganizationSettings) GetEdges() []*GetAllOrganizationSettings_OrganizationSettings_Edges { + if t == nil { + t = &GetAllOrganizationSettings_OrganizationSettings{} + } + return t.Edges +} + +type GetOrganizationSettingByID_OrganizationSetting_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizationSettingByID_OrganizationSetting_Organization) GetID() string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting_Organization{} + } + return t.ID +} +func (t *GetOrganizationSettingByID_OrganizationSetting_Organization) GetName() string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting_Organization{} + } + return t.Name +} + +type GetOrganizationSettingByID_OrganizationSetting struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *GetOrganizationSettingByID_OrganizationSetting_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingAddress +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingContact +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingEmail +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.BillingPhone +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.CreatedAt +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.CreatedBy +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetDomains() []string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.Domains +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.GeoLocation +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetID() string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.ID +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetTags() []string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.Tags +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.UpdatedAt +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.UpdatedBy +} +func (t *GetOrganizationSettingByID_OrganizationSetting) GetOrganization() *GetOrganizationSettingByID_OrganizationSetting_Organization { + if t == nil { + t = &GetOrganizationSettingByID_OrganizationSetting{} + } + return t.Organization +} + +type GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetID() string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.ID +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization) GetName() string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization{} + } + return t.Name +} + +type GetOrganizationSettings_OrganizationSettings_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingContact +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Domains +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetOrganization() *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} + } + return t.Organization +} + +type GetOrganizationSettings_OrganizationSettings_Edges struct { + Node *GetOrganizationSettings_OrganizationSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings_Edges) GetNode() *GetOrganizationSettings_OrganizationSettings_Edges_Node { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings_Edges{} + } + return t.Node +} + +type GetOrganizationSettings_OrganizationSettings struct { + Edges []*GetOrganizationSettings_OrganizationSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationSettings_OrganizationSettings) GetEdges() []*GetOrganizationSettings_OrganizationSettings_Edges { + if t == nil { + t = &GetOrganizationSettings_OrganizationSettings{} + } + return t.Edges +} + +type UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization) GetID() string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization{} + } + return t.ID +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization) GetName() string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization{} + } + return t.Name +} + +type UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organization *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization "json:\"organization,omitempty\" graphql:\"organization\"" +} + +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingAddress() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingAddress +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingContact() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingContact +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingEmail() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingEmail +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingPhone() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.BillingPhone +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.CreatedAt +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetCreatedBy() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.CreatedBy +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetDomains() []string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.Domains +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetGeoLocation() *enums.Region { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.GeoLocation +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetID() string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.ID +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetTags() []string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.Tags +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetTaxIdentifier() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.TaxIdentifier +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.UpdatedAt +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.UpdatedBy +} +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetOrganization() *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} + } + return t.Organization +} + +type UpdateOrganizationSetting_UpdateOrganizationSetting struct { + OrganizationSetting UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting "json:\"organizationSetting\" graphql:\"organizationSetting\"" +} + +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting) GetOrganizationSetting() *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting { + if t == nil { + t = &UpdateOrganizationSetting_UpdateOrganizationSetting{} + } + return &t.OrganizationSetting +} + +type GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingContact +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOrganizationID() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges struct { + Node *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges) GetNode() *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges{} + } + return t.Node +} + +type GetAllOrganizationSettingHistories_OrganizationSettingHistories struct { + Edges []*GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories) GetEdges() []*GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges { + if t == nil { + t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories{} + } + return t.Edges +} + +type GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node struct { + BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingAddress +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingContact() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingContact +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingEmail() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingEmail +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingPhone() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.BillingPhone +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetDomains() []string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Domains +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetGeoLocation() *enums.Region { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.GeoLocation +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetOrganizationID() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetTaxIdentifier() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.TaxIdentifier +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetOrganizationSettingHistories_OrganizationSettingHistories_Edges struct { + Node *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges) GetNode() *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges{} + } + return t.Node +} + +type GetOrganizationSettingHistories_OrganizationSettingHistories struct { + Edges []*GetOrganizationSettingHistories_OrganizationSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories) GetEdges() []*GetOrganizationSettingHistories_OrganizationSettingHistories_Edges { + if t == nil { + t = &GetOrganizationSettingHistories_OrganizationSettingHistories{} + } + return t.Edges +} + +type AddUserToOrgWithRole_CreateOrgMembership_OrgMembership struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" +} + +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetID() string { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return t.ID +} +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetRole() *enums.Role { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return &t.Role +} +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetUserID() string { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return t.UserID +} +func (t *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership) GetOrganizationID() string { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership_OrgMembership{} + } + return t.OrganizationID +} + +type AddUserToOrgWithRole_CreateOrgMembership struct { + OrgMembership AddUserToOrgWithRole_CreateOrgMembership_OrgMembership "json:\"orgMembership\" graphql:\"orgMembership\"" +} + +func (t *AddUserToOrgWithRole_CreateOrgMembership) GetOrgMembership() *AddUserToOrgWithRole_CreateOrgMembership_OrgMembership { + if t == nil { + t = &AddUserToOrgWithRole_CreateOrgMembership{} + } + return &t.OrgMembership +} + +type CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetID() string { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return t.ID +} +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetOrganizationID() string { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return t.OrganizationID +} +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return &t.Role +} +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships{} + } + return t.UserID +} + +type CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership struct { + OrgMemberships []*CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" +} + +func (t *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership) GetOrgMemberships() []*CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership_OrgMemberships { + if t == nil { + t = &CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership{} + } + return t.OrgMemberships +} + +type CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetID() string { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return t.ID +} +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetOrganizationID() string { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return t.OrganizationID +} +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetRole() *enums.Role { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return &t.Role +} +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships) GetUserID() string { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships{} + } + return t.UserID +} + +type CreateBulkOrgMembers_CreateBulkOrgMembership struct { + OrgMemberships []*CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" +} + +func (t *CreateBulkOrgMembers_CreateBulkOrgMembership) GetOrgMemberships() []*CreateBulkOrgMembers_CreateBulkOrgMembership_OrgMemberships { + if t == nil { + t = &CreateBulkOrgMembers_CreateBulkOrgMembership{} + } + return t.OrgMemberships +} + +type GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User struct { + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + ID string "json:\"id\" graphql:\"id\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetFirstName() *string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.FirstName +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetLastName() *string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.LastName +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.ID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetDisplayName() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.DisplayName +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User) GetEmail() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User{} + } + return t.Email +} + +type GetOrgMembersByOrgID_OrgMemberships_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + UserID string "json:\"userID\" graphql:\"userID\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return t.ID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetUserID() string { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return t.UserID +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return &t.Role +} +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges_Node) GetUser() *GetOrgMembersByOrgID_OrgMemberships_Edges_Node_User { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges_Node{} + } + return &t.User +} + +type GetOrgMembersByOrgID_OrgMemberships_Edges struct { + Node *GetOrgMembersByOrgID_OrgMemberships_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships_Edges) GetNode() *GetOrgMembersByOrgID_OrgMemberships_Edges_Node { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships_Edges{} + } + return t.Node +} + +type GetOrgMembersByOrgID_OrgMemberships struct { + Edges []*GetOrgMembersByOrgID_OrgMemberships_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrgMembersByOrgID_OrgMemberships) GetEdges() []*GetOrgMembersByOrgID_OrgMemberships_Edges { + if t == nil { + t = &GetOrgMembersByOrgID_OrgMemberships{} + } + return t.Edges +} + +type RemoveUserFromOrg_DeleteOrgMembership struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *RemoveUserFromOrg_DeleteOrgMembership) GetDeletedID() string { + if t == nil { + t = &RemoveUserFromOrg_DeleteOrgMembership{} + } + return t.DeletedID +} + +type UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UserID string "json:\"userID\" graphql:\"userID\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" +} + +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetID() string { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return t.ID +} +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetRole() *enums.Role { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return &t.Role +} +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetUserID() string { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return t.UserID +} +func (t *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership) GetOrganizationID() string { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership{} + } + return t.OrganizationID +} + +type UpdateUserRoleInOrg_UpdateOrgMembership struct { + OrgMembership UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership "json:\"orgMembership\" graphql:\"orgMembership\"" +} + +func (t *UpdateUserRoleInOrg_UpdateOrgMembership) GetOrgMembership() *UpdateUserRoleInOrg_UpdateOrgMembership_OrgMembership { + if t == nil { + t = &UpdateUserRoleInOrg_UpdateOrgMembership{} + } + return &t.OrgMembership +} + +type GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetAllOrgMembershipHistories_OrgMembershipHistories_Edges struct { + Node *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges) GetNode() *GetAllOrgMembershipHistories_OrgMembershipHistories_Edges_Node { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories_Edges{} + } + return t.Node +} + +type GetAllOrgMembershipHistories_OrgMembershipHistories struct { + Edges []*GetAllOrgMembershipHistories_OrgMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllOrgMembershipHistories_OrgMembershipHistories) GetEdges() []*GetAllOrgMembershipHistories_OrgMembershipHistories_Edges { + if t == nil { + t = &GetAllOrgMembershipHistories_OrgMembershipHistories{} + } + return t.Edges +} + +type GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID string "json:\"userID\" graphql:\"userID\"" +} + +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.ID +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetOrganizationID() string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.OrganizationID +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return &t.Role +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node) GetUserID() string { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node{} + } + return t.UserID +} + +type GetOrgMembershipHistories_OrgMembershipHistories_Edges struct { + Node *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetOrgMembershipHistories_OrgMembershipHistories_Edges) GetNode() *GetOrgMembershipHistories_OrgMembershipHistories_Edges_Node { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories_Edges{} + } + return t.Node +} + +type GetOrgMembershipHistories_OrgMembershipHistories struct { + Edges []*GetOrgMembershipHistories_OrgMembershipHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetOrgMembershipHistories_OrgMembershipHistories) GetEdges() []*GetOrgMembershipHistories_OrgMembershipHistories_Edges { + if t == nil { + t = &GetOrgMembershipHistories_OrgMembershipHistories{} + } + return t.Edges +} + +type CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations) GetID() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.ID +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations) GetName() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.Name +} + +type CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Description +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.ExpiresAt +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetID() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.ID +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.LastUsedAt +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetName() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Name +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Scopes +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetToken() string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Token +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedAt +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedBy +} +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens) GetOrganizations() []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens_Organizations { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens{} + } + return t.Organizations +} + +type CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken struct { + PersonalAccessTokens []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens "json:\"personalAccessTokens,omitempty\" graphql:\"personalAccessTokens\"" +} + +func (t *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken) GetPersonalAccessTokens() []*CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken_PersonalAccessTokens { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken{} + } + return t.PersonalAccessTokens +} + +type CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations) GetID() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.ID +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations) GetName() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations{} + } + return t.Name +} + +type CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetDescription() *string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Description +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetExpiresAt() *time.Time { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.ExpiresAt +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetID() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.ID +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.LastUsedAt +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetName() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Name +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetScopes() []string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Scopes +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetToken() string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Token +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedAt +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetUpdatedBy() *string { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.UpdatedBy +} +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens) GetOrganizations() []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens_Organizations { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens{} + } + return t.Organizations +} + +type CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken struct { + PersonalAccessTokens []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens "json:\"personalAccessTokens,omitempty\" graphql:\"personalAccessTokens\"" +} + +func (t *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken) GetPersonalAccessTokens() []*CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken_PersonalAccessTokens { + if t == nil { + t = &CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken{} + } + return t.PersonalAccessTokens +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations) GetID() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.ID +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations) GetName() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.Name +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner) GetID() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner{} + } + return t.ID +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" + Owner CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner "json:\"owner\" graphql:\"owner\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetDescription() *string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Description +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetExpiresAt() *time.Time { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.ExpiresAt +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetID() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.ID +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.LastUsedAt +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetName() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Name +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetScopes() []string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Scopes +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetToken() string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Token +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedAt +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetUpdatedBy() *string { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedBy +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetOrganizations() []*CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Organizations { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return t.Organizations +} +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken) GetOwner() *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken_Owner { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken{} + } + return &t.Owner +} + +type CreatePersonalAccessToken_CreatePersonalAccessToken struct { + PersonalAccessToken CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken "json:\"personalAccessToken\" graphql:\"personalAccessToken\"" +} + +func (t *CreatePersonalAccessToken_CreatePersonalAccessToken) GetPersonalAccessToken() *CreatePersonalAccessToken_CreatePersonalAccessToken_PersonalAccessToken { + if t == nil { + t = &CreatePersonalAccessToken_CreatePersonalAccessToken{} + } + return &t.PersonalAccessToken +} + +type DeletePersonalAccessToken_DeletePersonalAccessToken struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeletePersonalAccessToken_DeletePersonalAccessToken) GetDeletedID() string { + if t == nil { + t = &DeletePersonalAccessToken_DeletePersonalAccessToken{} + } + return t.DeletedID +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations) GetID() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations{} + } + return t.ID +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations) GetName() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations{} + } + return t.Name +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Description +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetExpiresAt() *time.Time { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.ExpiresAt +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetID() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.ID +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.LastUsedAt +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetName() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Name +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetScopes() []string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Scopes +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetToken() string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Token +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node) GetOrganizations() []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node_Organizations { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node{} + } + return t.Organizations +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens_Edges struct { + Node *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges) GetNode() *GetAllPersonalAccessTokens_PersonalAccessTokens_Edges_Node { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens_Edges{} + } + return t.Node +} + +type GetAllPersonalAccessTokens_PersonalAccessTokens struct { + Edges []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllPersonalAccessTokens_PersonalAccessTokens) GetEdges() []*GetAllPersonalAccessTokens_PersonalAccessTokens_Edges { + if t == nil { + t = &GetAllPersonalAccessTokens_PersonalAccessTokens{} + } + return t.Edges +} + +type GetPersonalAccessTokenByID_PersonalAccessToken_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *GetPersonalAccessTokenByID_PersonalAccessToken_Organizations) GetID() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken_Organizations{} + } + return t.ID +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken_Organizations) GetName() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken_Organizations{} + } + return t.Name +} + +type GetPersonalAccessTokenByID_PersonalAccessToken struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*GetPersonalAccessTokenByID_PersonalAccessToken_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetDescription() *string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Description +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetExpiresAt() *time.Time { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.ExpiresAt +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetID() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.ID +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.LastUsedAt +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetName() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Name +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetScopes() []string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Scopes +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetToken() string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Token +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.UpdatedAt +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetUpdatedBy() *string { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.UpdatedBy +} +func (t *GetPersonalAccessTokenByID_PersonalAccessToken) GetOrganizations() []*GetPersonalAccessTokenByID_PersonalAccessToken_Organizations { + if t == nil { + t = &GetPersonalAccessTokenByID_PersonalAccessToken{} + } + return t.Organizations +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations) GetID() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.ID +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations) GetName() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations{} + } + return t.Name +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner) GetID() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner{} + } + return t.ID +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" + ID string "json:\"id\" graphql:\"id\"" + LastUsedAt *time.Time "json:\"lastUsedAt,omitempty\" graphql:\"lastUsedAt\"" + Name string "json:\"name\" graphql:\"name\"" + Scopes []string "json:\"scopes,omitempty\" graphql:\"scopes\"" + Token string "json:\"token\" graphql:\"token\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Organizations []*UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" + Owner UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner "json:\"owner\" graphql:\"owner\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetDescription() *string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Description +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetExpiresAt() *time.Time { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.ExpiresAt +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetID() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.ID +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetLastUsedAt() *time.Time { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.LastUsedAt +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetName() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Name +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetScopes() []string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Scopes +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetToken() string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Token +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedAt +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetUpdatedBy() *string { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.UpdatedBy +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetOrganizations() []*UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Organizations { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return t.Organizations +} +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken) GetOwner() *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken_Owner { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken{} + } + return &t.Owner +} + +type UpdatePersonalAccessToken_UpdatePersonalAccessToken struct { + PersonalAccessToken UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken "json:\"personalAccessToken\" graphql:\"personalAccessToken\"" +} + +func (t *UpdatePersonalAccessToken_UpdatePersonalAccessToken) GetPersonalAccessToken() *UpdatePersonalAccessToken_UpdatePersonalAccessToken_PersonalAccessToken { + if t == nil { + t = &UpdatePersonalAccessToken_UpdatePersonalAccessToken{} + } + return &t.PersonalAccessToken +} + +type Search_Search_Nodes_OrganizationSearchResult_Organizations struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetDescription() *string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.Description +} +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetDisplayName() string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.DisplayName +} +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetID() string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.ID +} +func (t *Search_Search_Nodes_OrganizationSearchResult_Organizations) GetName() string { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult_Organizations{} + } + return t.Name +} + +type Search_Search_Nodes_OrganizationSearchResult struct { + Organizations []*Search_Search_Nodes_OrganizationSearchResult_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" +} + +func (t *Search_Search_Nodes_OrganizationSearchResult) GetOrganizations() []*Search_Search_Nodes_OrganizationSearchResult_Organizations { + if t == nil { + t = &Search_Search_Nodes_OrganizationSearchResult{} + } + return t.Organizations +} + +type Search_Search_Nodes_GroupSearchResult_Groups struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetDescription() *string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.Description +} +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetDisplayName() string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.DisplayName +} +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetID() string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.ID +} +func (t *Search_Search_Nodes_GroupSearchResult_Groups) GetName() string { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult_Groups{} + } + return t.Name +} + +type Search_Search_Nodes_GroupSearchResult struct { + Groups []*Search_Search_Nodes_GroupSearchResult_Groups "json:\"groups,omitempty\" graphql:\"groups\"" +} + +func (t *Search_Search_Nodes_GroupSearchResult) GetGroups() []*Search_Search_Nodes_GroupSearchResult_Groups { + if t == nil { + t = &Search_Search_Nodes_GroupSearchResult{} + } + return t.Groups +} + +type Search_Search_Nodes_UserSearchResult_Users struct { + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *Search_Search_Nodes_UserSearchResult_Users) GetDisplayName() string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.DisplayName +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetEmail() string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.Email +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetFirstName() *string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.FirstName +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetID() string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.ID +} +func (t *Search_Search_Nodes_UserSearchResult_Users) GetLastName() *string { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult_Users{} + } + return t.LastName +} + +type Search_Search_Nodes_UserSearchResult struct { + Users []*Search_Search_Nodes_UserSearchResult_Users "json:\"users,omitempty\" graphql:\"users\"" +} + +func (t *Search_Search_Nodes_UserSearchResult) GetUsers() []*Search_Search_Nodes_UserSearchResult_Users { + if t == nil { + t = &Search_Search_Nodes_UserSearchResult{} + } + return t.Users +} + +type Search_Search_Nodes_SubscriberSearchResult_Subscribers struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *Search_Search_Nodes_SubscriberSearchResult_Subscribers) GetActive() bool { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult_Subscribers{} + } + return t.Active +} +func (t *Search_Search_Nodes_SubscriberSearchResult_Subscribers) GetEmail() string { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult_Subscribers{} + } + return t.Email +} +func (t *Search_Search_Nodes_SubscriberSearchResult_Subscribers) GetID() string { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult_Subscribers{} + } + return t.ID +} + +type Search_Search_Nodes_SubscriberSearchResult struct { + Subscribers []*Search_Search_Nodes_SubscriberSearchResult_Subscribers "json:\"subscribers,omitempty\" graphql:\"subscribers\"" +} + +func (t *Search_Search_Nodes_SubscriberSearchResult) GetSubscribers() []*Search_Search_Nodes_SubscriberSearchResult_Subscribers { + if t == nil { + t = &Search_Search_Nodes_SubscriberSearchResult{} + } + return t.Subscribers +} + +type Search_Search_Nodes struct { + OrganizationSearchResult Search_Search_Nodes_OrganizationSearchResult "graphql:\"... on OrganizationSearchResult\"" + GroupSearchResult Search_Search_Nodes_GroupSearchResult "graphql:\"... on GroupSearchResult\"" + UserSearchResult Search_Search_Nodes_UserSearchResult "graphql:\"... on UserSearchResult\"" + SubscriberSearchResult Search_Search_Nodes_SubscriberSearchResult "graphql:\"... on SubscriberSearchResult\"" +} + +func (t *Search_Search_Nodes) GetOrganizationSearchResult() *Search_Search_Nodes_OrganizationSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.OrganizationSearchResult +} +func (t *Search_Search_Nodes) GetGroupSearchResult() *Search_Search_Nodes_GroupSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.GroupSearchResult +} +func (t *Search_Search_Nodes) GetUserSearchResult() *Search_Search_Nodes_UserSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.UserSearchResult +} +func (t *Search_Search_Nodes) GetSubscriberSearchResult() *Search_Search_Nodes_SubscriberSearchResult { + if t == nil { + t = &Search_Search_Nodes{} + } + return &t.SubscriberSearchResult +} + +type Search_Search struct { + Nodes []*Search_Search_Nodes "json:\"nodes\" graphql:\"nodes\"" +} + +func (t *Search_Search) GetNodes() []*Search_Search_Nodes { + if t == nil { + t = &Search_Search{} + } + return t.Nodes +} + +type CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetActive() bool { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.Active +} +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetEmail() string { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.Email +} +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetID() string { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.ID +} +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers) GetVerifiedEmail() bool { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers{} + } + return t.VerifiedEmail +} + +type CreateBulkCSVSubscriber_CreateBulkCSVSubscriber struct { + Subscribers []*CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers "json:\"subscribers,omitempty\" graphql:\"subscribers\"" +} + +func (t *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber) GetSubscribers() []*CreateBulkCSVSubscriber_CreateBulkCSVSubscriber_Subscribers { + if t == nil { + t = &CreateBulkCSVSubscriber_CreateBulkCSVSubscriber{} + } + return t.Subscribers +} + +type CreateBulkSubscriber_CreateBulkSubscriber_Subscribers struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetActive() bool { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.Active +} +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetEmail() string { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.Email +} +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetID() string { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.ID +} +func (t *CreateBulkSubscriber_CreateBulkSubscriber_Subscribers) GetVerifiedEmail() bool { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber_Subscribers{} + } + return t.VerifiedEmail +} + +type CreateBulkSubscriber_CreateBulkSubscriber struct { + Subscribers []*CreateBulkSubscriber_CreateBulkSubscriber_Subscribers "json:\"subscribers,omitempty\" graphql:\"subscribers\"" +} + +func (t *CreateBulkSubscriber_CreateBulkSubscriber) GetSubscribers() []*CreateBulkSubscriber_CreateBulkSubscriber_Subscribers { + if t == nil { + t = &CreateBulkSubscriber_CreateBulkSubscriber{} + } + return t.Subscribers +} + +type CreateSubscriber_CreateSubscriber_Subscriber struct { + Active bool "json:\"active\" graphql:\"active\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetActive() bool { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.Active +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.CreatedAt +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetCreatedBy() *string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.CreatedBy +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetEmail() string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.Email +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetID() string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.ID +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.UpdatedAt +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetUpdatedBy() *string { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.UpdatedBy +} +func (t *CreateSubscriber_CreateSubscriber_Subscriber) GetVerifiedEmail() bool { + if t == nil { + t = &CreateSubscriber_CreateSubscriber_Subscriber{} + } + return t.VerifiedEmail +} + +type CreateSubscriber_CreateSubscriber struct { + Subscriber CreateSubscriber_CreateSubscriber_Subscriber "json:\"subscriber\" graphql:\"subscriber\"" +} + +func (t *CreateSubscriber_CreateSubscriber) GetSubscriber() *CreateSubscriber_CreateSubscriber_Subscriber { + if t == nil { + t = &CreateSubscriber_CreateSubscriber{} + } + return &t.Subscriber +} + +type DeleteSubscriber_DeleteSubscriber struct { + Email string "json:\"email\" graphql:\"email\"" +} + +func (t *DeleteSubscriber_DeleteSubscriber) GetEmail() string { + if t == nil { + t = &DeleteSubscriber_DeleteSubscriber{} + } + return t.Email +} + +type GetAllSubscribers_Subscribers_Edges_Node struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetActive() bool { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.Active +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetEmail() string { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.Email +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetID() string { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.ID +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllSubscribers_Subscribers_Edges_Node) GetVerifiedEmail() bool { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges_Node{} + } + return t.VerifiedEmail +} + +type GetAllSubscribers_Subscribers_Edges struct { + Node *GetAllSubscribers_Subscribers_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllSubscribers_Subscribers_Edges) GetNode() *GetAllSubscribers_Subscribers_Edges_Node { + if t == nil { + t = &GetAllSubscribers_Subscribers_Edges{} + } + return t.Node +} + +type GetAllSubscribers_Subscribers struct { + Edges []*GetAllSubscribers_Subscribers_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllSubscribers_Subscribers) GetEdges() []*GetAllSubscribers_Subscribers_Edges { + if t == nil { + t = &GetAllSubscribers_Subscribers{} + } + return t.Edges +} + +type GetSubscriberByEmail_Subscriber struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *GetSubscriberByEmail_Subscriber) GetActive() bool { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.Active +} +func (t *GetSubscriberByEmail_Subscriber) GetEmail() string { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.Email +} +func (t *GetSubscriberByEmail_Subscriber) GetID() string { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.ID +} +func (t *GetSubscriberByEmail_Subscriber) GetOwnerID() *string { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.OwnerID +} +func (t *GetSubscriberByEmail_Subscriber) GetVerifiedEmail() bool { + if t == nil { + t = &GetSubscriberByEmail_Subscriber{} + } + return t.VerifiedEmail +} + +type GetSubscribers_Subscribers_Edges_Node struct { + Active bool "json:\"active\" graphql:\"active\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" +} + +func (t *GetSubscribers_Subscribers_Edges_Node) GetActive() bool { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.Active +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetEmail() string { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.Email +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetID() string { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.ID +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.OwnerID +} +func (t *GetSubscribers_Subscribers_Edges_Node) GetVerifiedEmail() bool { + if t == nil { + t = &GetSubscribers_Subscribers_Edges_Node{} + } + return t.VerifiedEmail +} + +type GetSubscribers_Subscribers_Edges struct { + Node *GetSubscribers_Subscribers_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetSubscribers_Subscribers_Edges) GetNode() *GetSubscribers_Subscribers_Edges_Node { + if t == nil { + t = &GetSubscribers_Subscribers_Edges{} + } + return t.Node +} + +type GetSubscribers_Subscribers struct { + Edges []*GetSubscribers_Subscribers_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetSubscribers_Subscribers) GetEdges() []*GetSubscribers_Subscribers_Edges { + if t == nil { + t = &GetSubscribers_Subscribers{} + } + return t.Edges +} + +type UpdateSubscriber_UpdateSubscriber_Subscriber struct { + Active bool "json:\"active\" graphql:\"active\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Email string "json:\"email\" graphql:\"email\"" + ID string "json:\"id\" graphql:\"id\"" + PhoneNumber *string "json:\"phoneNumber,omitempty\" graphql:\"phoneNumber\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + VerifiedEmail bool "json:\"verifiedEmail\" graphql:\"verifiedEmail\"" + VerifiedPhone bool "json:\"verifiedPhone\" graphql:\"verifiedPhone\"" +} + +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetActive() bool { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.Active +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.CreatedAt +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetCreatedBy() *string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.CreatedBy +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetEmail() string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.Email +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetID() string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.ID +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetPhoneNumber() *string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.PhoneNumber +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.UpdatedAt +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetUpdatedBy() *string { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.UpdatedBy +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetVerifiedEmail() bool { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.VerifiedEmail +} +func (t *UpdateSubscriber_UpdateSubscriber_Subscriber) GetVerifiedPhone() bool { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber_Subscriber{} + } + return t.VerifiedPhone +} + +type UpdateSubscriber_UpdateSubscriber struct { + Subscriber UpdateSubscriber_UpdateSubscriber_Subscriber "json:\"subscriber\" graphql:\"subscriber\"" +} + +func (t *UpdateSubscriber_UpdateSubscriber) GetSubscriber() *UpdateSubscriber_UpdateSubscriber_Subscriber { + if t == nil { + t = &UpdateSubscriber_UpdateSubscriber{} + } + return &t.Subscriber +} + +type CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner) GetID() string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner{} + } + return t.ID +} + +type CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + Owner *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.Description +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetID() string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.ID +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return &t.Jsonconfig +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetName() string { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.Name +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetUischema() *json.RawMessage { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return &t.Uischema +} +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates) GetOwner() *CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates_Owner { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates{} + } + return t.Owner +} + +type CreateBulkCSVTemplate_CreateBulkCSVTemplate struct { + Templates []*CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates "json:\"templates,omitempty\" graphql:\"templates\"" +} + +func (t *CreateBulkCSVTemplate_CreateBulkCSVTemplate) GetTemplates() []*CreateBulkCSVTemplate_CreateBulkCSVTemplate_Templates { + if t == nil { + t = &CreateBulkCSVTemplate_CreateBulkCSVTemplate{} + } + return t.Templates +} + +type CreateBulkTemplate_CreateBulkTemplate_Templates_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates_Owner) GetID() string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates_Owner{} + } + return t.ID +} + +type CreateBulkTemplate_CreateBulkTemplate_Templates struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + Owner *CreateBulkTemplate_CreateBulkTemplate_Templates_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetDescription() *string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.Description +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetID() string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.ID +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return &t.Jsonconfig +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetName() string { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.Name +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetUischema() *json.RawMessage { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return &t.Uischema +} +func (t *CreateBulkTemplate_CreateBulkTemplate_Templates) GetOwner() *CreateBulkTemplate_CreateBulkTemplate_Templates_Owner { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate_Templates{} + } + return t.Owner +} + +type CreateBulkTemplate_CreateBulkTemplate struct { + Templates []*CreateBulkTemplate_CreateBulkTemplate_Templates "json:\"templates,omitempty\" graphql:\"templates\"" +} + +func (t *CreateBulkTemplate_CreateBulkTemplate) GetTemplates() []*CreateBulkTemplate_CreateBulkTemplate_Templates { + if t == nil { + t = &CreateBulkTemplate_CreateBulkTemplate{} + } + return t.Templates +} + +type CreateTemplate_CreateTemplate_Template_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateTemplate_CreateTemplate_Template_Owner) GetID() string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template_Owner{} + } + return t.ID +} + +type CreateTemplate_CreateTemplate_Template struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + Owner *CreateTemplate_CreateTemplate_Template_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateTemplate_CreateTemplate_Template) GetDescription() *string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.Description +} +func (t *CreateTemplate_CreateTemplate_Template) GetID() string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.ID +} +func (t *CreateTemplate_CreateTemplate_Template) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return &t.Jsonconfig +} +func (t *CreateTemplate_CreateTemplate_Template) GetName() string { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.Name +} +func (t *CreateTemplate_CreateTemplate_Template) GetUischema() *json.RawMessage { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return &t.Uischema +} +func (t *CreateTemplate_CreateTemplate_Template) GetOwner() *CreateTemplate_CreateTemplate_Template_Owner { + if t == nil { + t = &CreateTemplate_CreateTemplate_Template{} + } + return t.Owner +} + +type CreateTemplate_CreateTemplate struct { + Template CreateTemplate_CreateTemplate_Template "json:\"template\" graphql:\"template\"" +} + +func (t *CreateTemplate_CreateTemplate) GetTemplate() *CreateTemplate_CreateTemplate_Template { + if t == nil { + t = &CreateTemplate_CreateTemplate{} + } + return &t.Template +} + +type GetAllTemplates_Templates_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllTemplates_Templates_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllTemplates_Templates_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Owner *GetAllTemplates_Templates_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetAllTemplates_Templates_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllTemplates_Templates_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllTemplates_Templates_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.Description +} +func (t *GetAllTemplates_Templates_Edges_Node) GetID() string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.ID +} +func (t *GetAllTemplates_Templates_Edges_Node) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return &t.Jsonconfig +} +func (t *GetAllTemplates_Templates_Edges_Node) GetName() string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.Name +} +func (t *GetAllTemplates_Templates_Edges_Node) GetUischema() *json.RawMessage { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return &t.Uischema +} +func (t *GetAllTemplates_Templates_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllTemplates_Templates_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllTemplates_Templates_Edges_Node) GetOwner() *GetAllTemplates_Templates_Edges_Node_Owner { + if t == nil { + t = &GetAllTemplates_Templates_Edges_Node{} + } + return t.Owner +} + +type GetAllTemplates_Templates_Edges struct { + Node *GetAllTemplates_Templates_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllTemplates_Templates_Edges) GetNode() *GetAllTemplates_Templates_Edges_Node { + if t == nil { + t = &GetAllTemplates_Templates_Edges{} + } + return t.Node +} + +type GetAllTemplates_Templates struct { + Edges []*GetAllTemplates_Templates_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllTemplates_Templates) GetEdges() []*GetAllTemplates_Templates_Edges { + if t == nil { + t = &GetAllTemplates_Templates{} + } + return t.Edges +} + +type GetTemplateByID_Template_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetTemplateByID_Template_Owner) GetID() string { + if t == nil { + t = &GetTemplateByID_Template_Owner{} + } + return t.ID +} + +type GetTemplateByID_Template struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Owner *GetTemplateByID_Template_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetTemplateByID_Template) GetCreatedAt() *time.Time { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.CreatedAt +} +func (t *GetTemplateByID_Template) GetCreatedBy() *string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.CreatedBy +} +func (t *GetTemplateByID_Template) GetDescription() *string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.Description +} +func (t *GetTemplateByID_Template) GetID() string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.ID +} +func (t *GetTemplateByID_Template) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetTemplateByID_Template{} + } + return &t.Jsonconfig +} +func (t *GetTemplateByID_Template) GetName() string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.Name +} +func (t *GetTemplateByID_Template) GetUischema() *json.RawMessage { + if t == nil { + t = &GetTemplateByID_Template{} + } + return &t.Uischema +} +func (t *GetTemplateByID_Template) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.UpdatedAt +} +func (t *GetTemplateByID_Template) GetUpdatedBy() *string { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.UpdatedBy +} +func (t *GetTemplateByID_Template) GetOwner() *GetTemplateByID_Template_Owner { + if t == nil { + t = &GetTemplateByID_Template{} + } + return t.Owner +} + +type UpdateTemplate_UpdateTemplate_Template_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateTemplate_UpdateTemplate_Template_Owner) GetID() string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template_Owner{} + } + return t.ID +} + +type UpdateTemplate_UpdateTemplate_Template struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Owner *UpdateTemplate_UpdateTemplate_Template_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *UpdateTemplate_UpdateTemplate_Template) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.CreatedAt +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetCreatedBy() *string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.CreatedBy +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetDescription() *string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.Description +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetID() string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.ID +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return &t.Jsonconfig +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetName() string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.Name +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetUischema() *json.RawMessage { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return &t.Uischema +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.UpdatedAt +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetUpdatedBy() *string { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.UpdatedBy +} +func (t *UpdateTemplate_UpdateTemplate_Template) GetOwner() *UpdateTemplate_UpdateTemplate_Template_Owner { + if t == nil { + t = &UpdateTemplate_UpdateTemplate_Template{} + } + return t.Owner +} + +type UpdateTemplate_UpdateTemplate struct { + Template UpdateTemplate_UpdateTemplate_Template "json:\"template\" graphql:\"template\"" +} + +func (t *UpdateTemplate_UpdateTemplate) GetTemplate() *UpdateTemplate_UpdateTemplate_Template { + if t == nil { + t = &UpdateTemplate_UpdateTemplate{} + } + return &t.Template +} + +type GetAllTemplateHistories_TemplateHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateType enums.DocumentType "json:\"templateType\" graphql:\"templateType\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Jsonconfig +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetTemplateType() *enums.DocumentType { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.TemplateType +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetUischema() *json.RawMessage { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Uischema +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllTemplateHistories_TemplateHistories_Edges struct { + Node *GetAllTemplateHistories_TemplateHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllTemplateHistories_TemplateHistories_Edges) GetNode() *GetAllTemplateHistories_TemplateHistories_Edges_Node { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories_Edges{} + } + return t.Node +} + +type GetAllTemplateHistories_TemplateHistories struct { + Edges []*GetAllTemplateHistories_TemplateHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllTemplateHistories_TemplateHistories) GetEdges() []*GetAllTemplateHistories_TemplateHistories_Edges { + if t == nil { + t = &GetAllTemplateHistories_TemplateHistories{} + } + return t.Edges +} + +type GetTemplateHistories_TemplateHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Jsonconfig json.RawMessage "json:\"jsonconfig\" graphql:\"jsonconfig\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TemplateType enums.DocumentType "json:\"templateType\" graphql:\"templateType\"" + Uischema json.RawMessage "json:\"uischema,omitempty\" graphql:\"uischema\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Description +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.ID +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetJsonconfig() *json.RawMessage { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Jsonconfig +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Name +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetTemplateType() *enums.DocumentType { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.TemplateType +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetUischema() *json.RawMessage { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return &t.Uischema +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetTemplateHistories_TemplateHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetTemplateHistories_TemplateHistories_Edges struct { + Node *GetTemplateHistories_TemplateHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetTemplateHistories_TemplateHistories_Edges) GetNode() *GetTemplateHistories_TemplateHistories_Edges_Node { + if t == nil { + t = &GetTemplateHistories_TemplateHistories_Edges{} + } + return t.Node +} + +type GetTemplateHistories_TemplateHistories struct { + Edges []*GetTemplateHistories_TemplateHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetTemplateHistories_TemplateHistories) GetEdges() []*GetTemplateHistories_TemplateHistories_Edges { + if t == nil { + t = &GetTemplateHistories_TemplateHistories{} + } + return t.Edges +} + +type CreateTFASetting_CreateTFASetting_TfaSetting_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateTFASetting_CreateTFASetting_TfaSetting_Owner) GetID() string { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting_Owner{} + } + return t.ID +} + +type CreateTFASetting_CreateTFASetting_TfaSetting struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" + Owner *CreateTFASetting_CreateTFASetting_TfaSetting_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetRecoveryCodes() []string { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.RecoveryCodes +} +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetTotpAllowed() *bool { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.TotpAllowed +} +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetVerified() bool { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.Verified +} +func (t *CreateTFASetting_CreateTFASetting_TfaSetting) GetOwner() *CreateTFASetting_CreateTFASetting_TfaSetting_Owner { + if t == nil { + t = &CreateTFASetting_CreateTFASetting_TfaSetting{} + } + return t.Owner +} + +type CreateTFASetting_CreateTFASetting struct { + TfaSetting CreateTFASetting_CreateTFASetting_TfaSetting "json:\"tfaSetting\" graphql:\"tfaSetting\"" +} + +func (t *CreateTFASetting_CreateTFASetting) GetTfaSetting() *CreateTFASetting_CreateTFASetting_TfaSetting { + if t == nil { + t = &CreateTFASetting_CreateTFASetting{} + } + return &t.TfaSetting +} + +type GetAllTFASettings_TfaSettings_Edges_Node_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllTFASettings_TfaSettings_Edges_Node_Owner) GetID() string { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node_Owner{} + } + return t.ID +} + +type GetAllTFASettings_TfaSettings_Edges_Node struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" + Owner *GetAllTFASettings_TfaSettings_Edges_Node_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetRecoveryCodes() []string { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.RecoveryCodes +} +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetTotpAllowed() *bool { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.TotpAllowed +} +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetVerified() bool { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.Verified +} +func (t *GetAllTFASettings_TfaSettings_Edges_Node) GetOwner() *GetAllTFASettings_TfaSettings_Edges_Node_Owner { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges_Node{} + } + return t.Owner +} + +type GetAllTFASettings_TfaSettings_Edges struct { + Node *GetAllTFASettings_TfaSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllTFASettings_TfaSettings_Edges) GetNode() *GetAllTFASettings_TfaSettings_Edges_Node { + if t == nil { + t = &GetAllTFASettings_TfaSettings_Edges{} + } + return t.Node +} + +type GetAllTFASettings_TfaSettings struct { + Edges []*GetAllTFASettings_TfaSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllTFASettings_TfaSettings) GetEdges() []*GetAllTFASettings_TfaSettings_Edges { + if t == nil { + t = &GetAllTFASettings_TfaSettings{} + } + return t.Edges +} + +type GetTFASetting_TfaSetting_Owner struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetTFASetting_TfaSetting_Owner) GetID() string { + if t == nil { + t = &GetTFASetting_TfaSetting_Owner{} + } + return t.ID +} + +type GetTFASetting_TfaSetting struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" + Owner *GetTFASetting_TfaSetting_Owner "json:\"owner,omitempty\" graphql:\"owner\"" +} + +func (t *GetTFASetting_TfaSetting) GetRecoveryCodes() []string { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.RecoveryCodes +} +func (t *GetTFASetting_TfaSetting) GetTotpAllowed() *bool { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.TotpAllowed +} +func (t *GetTFASetting_TfaSetting) GetVerified() bool { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.Verified +} +func (t *GetTFASetting_TfaSetting) GetOwner() *GetTFASetting_TfaSetting_Owner { + if t == nil { + t = &GetTFASetting_TfaSetting{} + } + return t.Owner +} + +type UpdateTFASetting_UpdateTFASetting_TfaSetting struct { + RecoveryCodes []string "json:\"recoveryCodes,omitempty\" graphql:\"recoveryCodes\"" + TotpAllowed *bool "json:\"totpAllowed,omitempty\" graphql:\"totpAllowed\"" + Verified bool "json:\"verified\" graphql:\"verified\"" +} + +func (t *UpdateTFASetting_UpdateTFASetting_TfaSetting) GetRecoveryCodes() []string { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting_TfaSetting{} + } + return t.RecoveryCodes +} +func (t *UpdateTFASetting_UpdateTFASetting_TfaSetting) GetTotpAllowed() *bool { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting_TfaSetting{} + } + return t.TotpAllowed +} +func (t *UpdateTFASetting_UpdateTFASetting_TfaSetting) GetVerified() bool { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting_TfaSetting{} + } + return t.Verified +} + +type UpdateTFASetting_UpdateTFASetting struct { + TfaSetting UpdateTFASetting_UpdateTFASetting_TfaSetting "json:\"tfaSetting\" graphql:\"tfaSetting\"" +} + +func (t *UpdateTFASetting_UpdateTFASetting) GetTfaSetting() *UpdateTFASetting_UpdateTFASetting_TfaSetting { + if t == nil { + t = &UpdateTFASetting_UpdateTFASetting{} + } + return &t.TfaSetting +} + +type CreateUser_CreateUser_User_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + OrganizationID string "json:\"organizationID\" graphql:\"organizationID\"" +} + +func (t *CreateUser_CreateUser_User_OrgMemberships) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User_OrgMemberships{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User_OrgMemberships) GetOrganizationID() string { + if t == nil { + t = &CreateUser_CreateUser_User_OrgMemberships{} + } + return t.OrganizationID +} + +type CreateUser_CreateUser_User_GroupMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + GroupID string "json:\"groupID\" graphql:\"groupID\"" +} + +func (t *CreateUser_CreateUser_User_GroupMemberships) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User_GroupMemberships{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User_GroupMemberships) GetGroupID() string { + if t == nil { + t = &CreateUser_CreateUser_User_GroupMemberships{} + } + return t.GroupID +} + +type CreateUser_CreateUser_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *CreateUser_CreateUser_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *CreateUser_CreateUser_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &CreateUser_CreateUser_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type CreateUser_CreateUser_User_Setting struct { + DefaultOrg *CreateUser_CreateUser_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateUser_CreateUser_User_Setting) GetDefaultOrg() *CreateUser_CreateUser_User_Setting_DefaultOrg { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.DefaultOrg +} +func (t *CreateUser_CreateUser_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.CreatedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.CreatedBy +} +func (t *CreateUser_CreateUser_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.EmailConfirmed +} +func (t *CreateUser_CreateUser_User_Setting) GetLocked() bool { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.Locked +} +func (t *CreateUser_CreateUser_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.SilencedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return &t.Status +} +func (t *CreateUser_CreateUser_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.SuspendedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetTags() []string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.Tags +} +func (t *CreateUser_CreateUser_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.UpdatedAt +} +func (t *CreateUser_CreateUser_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &CreateUser_CreateUser_User_Setting{} + } + return t.UpdatedBy +} + +type CreateUser_CreateUser_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + OrgMemberships []*CreateUser_CreateUser_User_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" + GroupMemberships []*CreateUser_CreateUser_User_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" + Setting CreateUser_CreateUser_User_Setting "json:\"setting\" graphql:\"setting\"" +} + +func (t *CreateUser_CreateUser_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return &t.AuthProvider +} +func (t *CreateUser_CreateUser_User) GetAvatarLocalFile() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.AvatarLocalFile +} +func (t *CreateUser_CreateUser_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.AvatarRemoteURL +} +func (t *CreateUser_CreateUser_User) GetDisplayName() string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.DisplayName +} +func (t *CreateUser_CreateUser_User) GetEmail() string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.Email +} +func (t *CreateUser_CreateUser_User) GetFirstName() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.FirstName +} +func (t *CreateUser_CreateUser_User) GetID() string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.ID +} +func (t *CreateUser_CreateUser_User) GetLastName() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.LastName +} +func (t *CreateUser_CreateUser_User) GetSub() *string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.Sub +} +func (t *CreateUser_CreateUser_User) GetTags() []string { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.Tags +} +func (t *CreateUser_CreateUser_User) GetOrgMemberships() []*CreateUser_CreateUser_User_OrgMemberships { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.OrgMemberships +} +func (t *CreateUser_CreateUser_User) GetGroupMemberships() []*CreateUser_CreateUser_User_GroupMemberships { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return t.GroupMemberships +} +func (t *CreateUser_CreateUser_User) GetSetting() *CreateUser_CreateUser_User_Setting { + if t == nil { + t = &CreateUser_CreateUser_User{} + } + return &t.Setting +} + +type CreateUser_CreateUser struct { + User CreateUser_CreateUser_User "json:\"user\" graphql:\"user\"" +} + +func (t *CreateUser_CreateUser) GetUser() *CreateUser_CreateUser_User { + if t == nil { + t = &CreateUser_CreateUser{} + } + return &t.User +} + +type DeleteUser_DeleteUser struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteUser_DeleteUser) GetDeletedID() string { + if t == nil { + t = &DeleteUser_DeleteUser{} + } + return t.DeletedID +} + +type GetAllUsers_Users_Edges_Node_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting_DefaultOrg{} + } + return t.ID +} +func (t *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting_DefaultOrg{} + } + return t.Name +} +func (t *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetAllUsers_Users_Edges_Node_Setting struct { + DefaultOrg *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUsers_Users_Edges_Node_Setting) GetDefaultOrg() *GetAllUsers_Users_Edges_Node_Setting_DefaultOrg { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.DefaultOrg +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.CreatedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.CreatedBy +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.EmailConfirmed +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetLocked() bool { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.Locked +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.SilencedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return &t.Status +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.SuspendedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetTags() []string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.Tags +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.UpdatedAt +} +func (t *GetAllUsers_Users_Edges_Node_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node_Setting{} + } + return t.UpdatedBy +} + +type GetAllUsers_Users_Edges_Node struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Setting GetAllUsers_Users_Edges_Node_Setting "json:\"setting\" graphql:\"setting\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUsers_Users_Edges_Node) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return &t.AuthProvider +} +func (t *GetAllUsers_Users_Edges_Node) GetAvatarLocalFile() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.AvatarLocalFile +} +func (t *GetAllUsers_Users_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetAllUsers_Users_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllUsers_Users_Edges_Node) GetEmail() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.Email +} +func (t *GetAllUsers_Users_Edges_Node) GetFirstName() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.FirstName +} +func (t *GetAllUsers_Users_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.ID +} +func (t *GetAllUsers_Users_Edges_Node) GetLastName() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.LastName +} +func (t *GetAllUsers_Users_Edges_Node) GetLastSeen() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.LastSeen +} +func (t *GetAllUsers_Users_Edges_Node) GetSub() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.Sub +} +func (t *GetAllUsers_Users_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUsers_Users_Edges_Node) GetSetting() *GetAllUsers_Users_Edges_Node_Setting { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return &t.Setting +} +func (t *GetAllUsers_Users_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUsers_Users_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUsers_Users_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUsers_Users_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUsers_Users_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllUsers_Users_Edges struct { + Node *GetAllUsers_Users_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUsers_Users_Edges) GetNode() *GetAllUsers_Users_Edges_Node { + if t == nil { + t = &GetAllUsers_Users_Edges{} + } + return t.Node +} + +type GetAllUsers_Users struct { + Edges []*GetAllUsers_Users_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUsers_Users) GetEdges() []*GetAllUsers_Users_Edges { + if t == nil { + t = &GetAllUsers_Users{} + } + return t.Edges +} + +type GetUserByID_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserByID_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserByID_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *GetUserByID_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserByID_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *GetUserByID_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserByID_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserByID_User_Setting struct { + DefaultOrg *GetUserByID_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserByID_User_Setting) GetDefaultOrg() *GetUserByID_User_Setting_DefaultOrg { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.DefaultOrg +} +func (t *GetUserByID_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.CreatedAt +} +func (t *GetUserByID_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.CreatedBy +} +func (t *GetUserByID_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.EmailConfirmed +} +func (t *GetUserByID_User_Setting) GetLocked() bool { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.Locked +} +func (t *GetUserByID_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.SilencedAt +} +func (t *GetUserByID_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return &t.Status +} +func (t *GetUserByID_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.SuspendedAt +} +func (t *GetUserByID_User_Setting) GetTags() []string { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.Tags +} +func (t *GetUserByID_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.UpdatedAt +} +func (t *GetUserByID_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByID_User_Setting{} + } + return t.UpdatedBy +} + +type GetUserByID_User_Organizations_Members struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" +} + +func (t *GetUserByID_User_Organizations_Members) GetID() string { + if t == nil { + t = &GetUserByID_User_Organizations_Members{} + } + return t.ID +} +func (t *GetUserByID_User_Organizations_Members) GetRole() *enums.Role { + if t == nil { + t = &GetUserByID_User_Organizations_Members{} + } + return &t.Role +} + +type GetUserByID_User_Organizations struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" + Members []*GetUserByID_User_Organizations_Members "json:\"members,omitempty\" graphql:\"members\"" +} + +func (t *GetUserByID_User_Organizations) GetID() string { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.ID +} +func (t *GetUserByID_User_Organizations) GetName() string { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.Name +} +func (t *GetUserByID_User_Organizations) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.PersonalOrg +} +func (t *GetUserByID_User_Organizations) GetMembers() []*GetUserByID_User_Organizations_Members { + if t == nil { + t = &GetUserByID_User_Organizations{} + } + return t.Members +} + +type GetUserByID_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Setting GetUserByID_User_Setting "json:\"setting\" graphql:\"setting\"" + Organizations []*GetUserByID_User_Organizations "json:\"organizations,omitempty\" graphql:\"organizations\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" +} + +func (t *GetUserByID_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetUserByID_User{} + } + return &t.AuthProvider +} +func (t *GetUserByID_User) GetAvatarLocalFile() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.AvatarLocalFile +} +func (t *GetUserByID_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.AvatarRemoteURL +} +func (t *GetUserByID_User) GetDisplayName() string { + if t == nil { + t = &GetUserByID_User{} + } + return t.DisplayName +} +func (t *GetUserByID_User) GetEmail() string { + if t == nil { + t = &GetUserByID_User{} + } + return t.Email +} +func (t *GetUserByID_User) GetFirstName() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.FirstName +} +func (t *GetUserByID_User) GetID() string { + if t == nil { + t = &GetUserByID_User{} + } + return t.ID +} +func (t *GetUserByID_User) GetLastName() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.LastName +} +func (t *GetUserByID_User) GetLastSeen() *time.Time { + if t == nil { + t = &GetUserByID_User{} + } + return t.LastSeen +} +func (t *GetUserByID_User) GetSub() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.Sub +} +func (t *GetUserByID_User) GetTags() []string { + if t == nil { + t = &GetUserByID_User{} + } + return t.Tags +} +func (t *GetUserByID_User) GetSetting() *GetUserByID_User_Setting { + if t == nil { + t = &GetUserByID_User{} + } + return &t.Setting +} +func (t *GetUserByID_User) GetOrganizations() []*GetUserByID_User_Organizations { + if t == nil { + t = &GetUserByID_User{} + } + return t.Organizations +} +func (t *GetUserByID_User) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User{} + } + return t.UpdatedAt +} +func (t *GetUserByID_User) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.UpdatedBy +} +func (t *GetUserByID_User) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByID_User{} + } + return t.CreatedAt +} +func (t *GetUserByID_User) GetCreatedBy() *string { + if t == nil { + t = &GetUserByID_User{} + } + return t.CreatedBy +} + +type GetUserByIDWithOrgs_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserByIDWithOrgs_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *GetUserByIDWithOrgs_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *GetUserByIDWithOrgs_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserByIDWithOrgs_User_Setting struct { + DefaultOrg *GetUserByIDWithOrgs_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserByIDWithOrgs_User_Setting) GetDefaultOrg() *GetUserByIDWithOrgs_User_Setting_DefaultOrg { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.DefaultOrg +} +func (t *GetUserByIDWithOrgs_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.CreatedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.CreatedBy +} +func (t *GetUserByIDWithOrgs_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.EmailConfirmed +} +func (t *GetUserByIDWithOrgs_User_Setting) GetLocked() bool { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.Locked +} +func (t *GetUserByIDWithOrgs_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.SilencedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return &t.Status +} +func (t *GetUserByIDWithOrgs_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.SuspendedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetTags() []string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.Tags +} +func (t *GetUserByIDWithOrgs_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.UpdatedAt +} +func (t *GetUserByIDWithOrgs_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_Setting{} + } + return t.UpdatedBy +} + +type GetUserByIDWithOrgs_User_OrgMemberships_User struct { + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" +} + +func (t *GetUserByIDWithOrgs_User_OrgMemberships_User) GetFirstName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships_User{} + } + return t.FirstName +} +func (t *GetUserByIDWithOrgs_User_OrgMemberships_User) GetLastName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships_User{} + } + return t.LastName +} + +type GetUserByIDWithOrgs_User_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" + Role enums.Role "json:\"role\" graphql:\"role\"" + User GetUserByIDWithOrgs_User_OrgMemberships_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetUserByIDWithOrgs_User_OrgMemberships) GetID() string { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships{} + } + return t.ID +} +func (t *GetUserByIDWithOrgs_User_OrgMemberships) GetRole() *enums.Role { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships{} + } + return &t.Role +} +func (t *GetUserByIDWithOrgs_User_OrgMemberships) GetUser() *GetUserByIDWithOrgs_User_OrgMemberships_User { + if t == nil { + t = &GetUserByIDWithOrgs_User_OrgMemberships{} + } + return &t.User +} + +type GetUserByIDWithOrgs_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Setting GetUserByIDWithOrgs_User_Setting "json:\"setting\" graphql:\"setting\"" + OrgMemberships []*GetUserByIDWithOrgs_User_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserByIDWithOrgs_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return &t.AuthProvider +} +func (t *GetUserByIDWithOrgs_User) GetAvatarLocalFile() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.AvatarLocalFile +} +func (t *GetUserByIDWithOrgs_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.AvatarRemoteURL +} +func (t *GetUserByIDWithOrgs_User) GetDisplayName() string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.DisplayName +} +func (t *GetUserByIDWithOrgs_User) GetEmail() string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.Email +} +func (t *GetUserByIDWithOrgs_User) GetFirstName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.FirstName +} +func (t *GetUserByIDWithOrgs_User) GetID() string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.ID +} +func (t *GetUserByIDWithOrgs_User) GetLastName() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.LastName +} +func (t *GetUserByIDWithOrgs_User) GetLastSeen() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.LastSeen +} +func (t *GetUserByIDWithOrgs_User) GetSub() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.Sub +} +func (t *GetUserByIDWithOrgs_User) GetTags() []string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.Tags +} +func (t *GetUserByIDWithOrgs_User) GetSetting() *GetUserByIDWithOrgs_User_Setting { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return &t.Setting +} +func (t *GetUserByIDWithOrgs_User) GetOrgMemberships() []*GetUserByIDWithOrgs_User_OrgMemberships { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.OrgMemberships +} +func (t *GetUserByIDWithOrgs_User) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.CreatedAt +} +func (t *GetUserByIDWithOrgs_User) GetCreatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.CreatedBy +} +func (t *GetUserByIDWithOrgs_User) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.UpdatedAt +} +func (t *GetUserByIDWithOrgs_User) GetUpdatedBy() *string { + if t == nil { + t = &GetUserByIDWithOrgs_User{} + } + return t.UpdatedBy +} + +type UpdateUser_UpdateUser_User_GroupMemberships struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateUser_UpdateUser_User_GroupMemberships) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_GroupMemberships{} + } + return t.ID +} + +type UpdateUser_UpdateUser_User_OrgMemberships struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateUser_UpdateUser_User_OrgMemberships) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_OrgMemberships{} + } + return t.ID +} + +type UpdateUser_UpdateUser_User_Setting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *UpdateUser_UpdateUser_User_Setting_DefaultOrg) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting_DefaultOrg{} + } + return t.ID +} +func (t *UpdateUser_UpdateUser_User_Setting_DefaultOrg) GetName() string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting_DefaultOrg{} + } + return t.Name +} +func (t *UpdateUser_UpdateUser_User_Setting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting_DefaultOrg{} + } + return t.PersonalOrg +} + +type UpdateUser_UpdateUser_User_Setting struct { + DefaultOrg *UpdateUser_UpdateUser_User_Setting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateUser_UpdateUser_User_Setting) GetDefaultOrg() *UpdateUser_UpdateUser_User_Setting_DefaultOrg { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.DefaultOrg +} +func (t *UpdateUser_UpdateUser_User_Setting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.CreatedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetCreatedBy() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.CreatedBy +} +func (t *UpdateUser_UpdateUser_User_Setting) GetEmailConfirmed() bool { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.EmailConfirmed +} +func (t *UpdateUser_UpdateUser_User_Setting) GetLocked() bool { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.Locked +} +func (t *UpdateUser_UpdateUser_User_Setting) GetSilencedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.SilencedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetStatus() *enums.UserStatus { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return &t.Status +} +func (t *UpdateUser_UpdateUser_User_Setting) GetSuspendedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.SuspendedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetTags() []string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.Tags +} +func (t *UpdateUser_UpdateUser_User_Setting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.UpdatedAt +} +func (t *UpdateUser_UpdateUser_User_Setting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User_Setting{} + } + return t.UpdatedBy +} + +type UpdateUser_UpdateUser_User struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + GroupMemberships []*UpdateUser_UpdateUser_User_GroupMemberships "json:\"groupMemberships,omitempty\" graphql:\"groupMemberships\"" + OrgMemberships []*UpdateUser_UpdateUser_User_OrgMemberships "json:\"orgMemberships,omitempty\" graphql:\"orgMemberships\"" + Setting UpdateUser_UpdateUser_User_Setting "json:\"setting\" graphql:\"setting\"" +} + +func (t *UpdateUser_UpdateUser_User) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return &t.AuthProvider +} +func (t *UpdateUser_UpdateUser_User) GetAvatarLocalFile() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.AvatarLocalFile +} +func (t *UpdateUser_UpdateUser_User) GetAvatarRemoteURL() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.AvatarRemoteURL +} +func (t *UpdateUser_UpdateUser_User) GetDisplayName() string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.DisplayName +} +func (t *UpdateUser_UpdateUser_User) GetEmail() string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.Email +} +func (t *UpdateUser_UpdateUser_User) GetFirstName() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.FirstName +} +func (t *UpdateUser_UpdateUser_User) GetID() string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.ID +} +func (t *UpdateUser_UpdateUser_User) GetLastName() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.LastName +} +func (t *UpdateUser_UpdateUser_User) GetSub() *string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.Sub +} +func (t *UpdateUser_UpdateUser_User) GetTags() []string { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.Tags +} +func (t *UpdateUser_UpdateUser_User) GetGroupMemberships() []*UpdateUser_UpdateUser_User_GroupMemberships { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.GroupMemberships +} +func (t *UpdateUser_UpdateUser_User) GetOrgMemberships() []*UpdateUser_UpdateUser_User_OrgMemberships { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return t.OrgMemberships +} +func (t *UpdateUser_UpdateUser_User) GetSetting() *UpdateUser_UpdateUser_User_Setting { + if t == nil { + t = &UpdateUser_UpdateUser_User{} + } + return &t.Setting +} + +type UpdateUser_UpdateUser struct { + User UpdateUser_UpdateUser_User "json:\"user\" graphql:\"user\"" +} + +func (t *UpdateUser_UpdateUser) GetUser() *UpdateUser_UpdateUser_User { + if t == nil { + t = &UpdateUser_UpdateUser{} + } + return &t.User +} + +type GetAllUserHistories_UserHistories_Edges_Node struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + AvatarUpdatedAt *time.Time "json:\"avatarUpdatedAt,omitempty\" graphql:\"avatarUpdatedAt\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role *enums.Role "json:\"role,omitempty\" graphql:\"role\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return &t.AuthProvider +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAvatarLocalFile() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarLocalFile +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetAvatarUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarUpdatedAt +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetEmail() string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Email +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetFirstName() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.FirstName +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetLastName() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.LastName +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetLastSeen() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.LastSeen +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Role +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetSub() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Sub +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUserHistories_UserHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllUserHistories_UserHistories_Edges struct { + Node *GetAllUserHistories_UserHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUserHistories_UserHistories_Edges) GetNode() *GetAllUserHistories_UserHistories_Edges_Node { + if t == nil { + t = &GetAllUserHistories_UserHistories_Edges{} + } + return t.Node +} + +type GetAllUserHistories_UserHistories struct { + Edges []*GetAllUserHistories_UserHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUserHistories_UserHistories) GetEdges() []*GetAllUserHistories_UserHistories_Edges { + if t == nil { + t = &GetAllUserHistories_UserHistories{} + } + return t.Edges +} + +type GetUserHistories_UserHistories_Edges_Node struct { + AuthProvider enums.AuthProvider "json:\"authProvider\" graphql:\"authProvider\"" + AvatarLocalFile *string "json:\"avatarLocalFile,omitempty\" graphql:\"avatarLocalFile\"" + AvatarRemoteURL *string "json:\"avatarRemoteURL,omitempty\" graphql:\"avatarRemoteURL\"" + AvatarUpdatedAt *time.Time "json:\"avatarUpdatedAt,omitempty\" graphql:\"avatarUpdatedAt\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DisplayName string "json:\"displayName\" graphql:\"displayName\"" + Email string "json:\"email\" graphql:\"email\"" + FirstName *string "json:\"firstName,omitempty\" graphql:\"firstName\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastName *string "json:\"lastName,omitempty\" graphql:\"lastName\"" + LastSeen *time.Time "json:\"lastSeen,omitempty\" graphql:\"lastSeen\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Role *enums.Role "json:\"role,omitempty\" graphql:\"role\"" + Sub *string "json:\"sub,omitempty\" graphql:\"sub\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserHistories_UserHistories_Edges_Node) GetAuthProvider() *enums.AuthProvider { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return &t.AuthProvider +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetAvatarLocalFile() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarLocalFile +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetAvatarRemoteURL() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarRemoteURL +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetAvatarUpdatedAt() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.AvatarUpdatedAt +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetDisplayName() string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.DisplayName +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetEmail() string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Email +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetFirstName() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.FirstName +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.ID +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetLastName() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.LastName +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetLastSeen() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.LastSeen +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetRole() *enums.Role { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Role +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetSub() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Sub +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetUserHistories_UserHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetUserHistories_UserHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetUserHistories_UserHistories_Edges struct { + Node *GetUserHistories_UserHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetUserHistories_UserHistories_Edges) GetNode() *GetUserHistories_UserHistories_Edges_Node { + if t == nil { + t = &GetUserHistories_UserHistories_Edges{} + } + return t.Node +} + +type GetUserHistories_UserHistories struct { + Edges []*GetUserHistories_UserHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetUserHistories_UserHistories) GetEdges() []*GetUserHistories_UserHistories_Edges { + if t == nil { + t = &GetUserHistories_UserHistories{} + } + return t.Edges +} + +type GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg) GetID() string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.ID +} +func (t *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg) GetName() string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.Name +} +func (t *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetAllUserSettings_UserSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.ID +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return &t.Status +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetDefaultOrg() *GetAllUserSettings_UserSettings_Edges_Node_DefaultOrg { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.DefaultOrg +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.Locked +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetDeletedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetDeletedBy() *string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedBy +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUserSettings_UserSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllUserSettings_UserSettings_Edges struct { + Node *GetAllUserSettings_UserSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUserSettings_UserSettings_Edges) GetNode() *GetAllUserSettings_UserSettings_Edges_Node { + if t == nil { + t = &GetAllUserSettings_UserSettings_Edges{} + } + return t.Node +} + +type GetAllUserSettings_UserSettings struct { + Edges []*GetAllUserSettings_UserSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUserSettings_UserSettings) GetEdges() []*GetAllUserSettings_UserSettings_Edges { + if t == nil { + t = &GetAllUserSettings_UserSettings{} + } + return t.Edges +} + +type GetUserSettingByID_UserSetting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserSettingByID_UserSetting_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserSettingByID_UserSetting_DefaultOrg{} + } + return t.ID +} +func (t *GetUserSettingByID_UserSetting_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserSettingByID_UserSetting_DefaultOrg{} + } + return t.Name +} +func (t *GetUserSettingByID_UserSetting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserSettingByID_UserSetting_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserSettingByID_UserSetting struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *GetUserSettingByID_UserSetting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserSettingByID_UserSetting) GetID() string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.ID +} +func (t *GetUserSettingByID_UserSetting) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.SilencedAt +} +func (t *GetUserSettingByID_UserSetting) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return &t.Status +} +func (t *GetUserSettingByID_UserSetting) GetDefaultOrg() *GetUserSettingByID_UserSetting_DefaultOrg { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.DefaultOrg +} +func (t *GetUserSettingByID_UserSetting) GetTags() []string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.Tags +} +func (t *GetUserSettingByID_UserSetting) GetLocked() bool { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.Locked +} +func (t *GetUserSettingByID_UserSetting) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.IsTfaEnabled +} +func (t *GetUserSettingByID_UserSetting) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.EmailConfirmed +} +func (t *GetUserSettingByID_UserSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.CreatedAt +} +func (t *GetUserSettingByID_UserSetting) GetCreatedBy() *string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.CreatedBy +} +func (t *GetUserSettingByID_UserSetting) GetDeletedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.DeletedAt +} +func (t *GetUserSettingByID_UserSetting) GetDeletedBy() *string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.DeletedBy +} +func (t *GetUserSettingByID_UserSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.UpdatedAt +} +func (t *GetUserSettingByID_UserSetting) GetUpdatedBy() *string { + if t == nil { + t = &GetUserSettingByID_UserSetting{} + } + return t.UpdatedBy +} + +type GetUserSettings_UserSettings_Edges_Node_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *GetUserSettings_UserSettings_Edges_Node_DefaultOrg) GetID() string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.ID +} +func (t *GetUserSettings_UserSettings_Edges_Node_DefaultOrg) GetName() string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.Name +} +func (t *GetUserSettings_UserSettings_Edges_Node_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node_DefaultOrg{} + } + return t.PersonalOrg +} + +type GetUserSettings_UserSettings_Edges_Node struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *GetUserSettings_UserSettings_Edges_Node_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetUserSettings_UserSettings_Edges_Node) GetID() string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.ID +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return &t.Status +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetDefaultOrg() *GetUserSettings_UserSettings_Edges_Node_DefaultOrg { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.DefaultOrg +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetTags() []string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.Tags +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.Locked +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetDeletedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetDeletedBy() *string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.DeletedBy +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetUserSettings_UserSettings_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetUserSettings_UserSettings_Edges_Node{} + } + return t.UpdatedBy +} + +type GetUserSettings_UserSettings_Edges struct { + Node *GetUserSettings_UserSettings_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetUserSettings_UserSettings_Edges) GetNode() *GetUserSettings_UserSettings_Edges_Node { + if t == nil { + t = &GetUserSettings_UserSettings_Edges{} + } + return t.Node +} + +type GetUserSettings_UserSettings struct { + Edges []*GetUserSettings_UserSettings_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetUserSettings_UserSettings) GetEdges() []*GetUserSettings_UserSettings_Edges { + if t == nil { + t = &GetUserSettings_UserSettings{} + } + return t.Edges +} + +type UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg struct { + ID string "json:\"id\" graphql:\"id\"" + Name string "json:\"name\" graphql:\"name\"" + PersonalOrg *bool "json:\"personalOrg,omitempty\" graphql:\"personalOrg\"" +} + +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg) GetID() string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg{} + } + return t.ID +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg) GetName() string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg{} + } + return t.Name +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg) GetPersonalOrg() *bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg{} + } + return t.PersonalOrg +} + +type UpdateUserSetting_UpdateUserSetting_UserSetting struct { + ID string "json:\"id\" graphql:\"id\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + DefaultOrg *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg "json:\"defaultOrg,omitempty\" graphql:\"defaultOrg\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + DeletedAt *time.Time "json:\"deletedAt,omitempty\" graphql:\"deletedAt\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetID() string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.ID +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetSilencedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.SilencedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetStatus() *enums.UserStatus { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return &t.Status +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetDefaultOrg() *UpdateUserSetting_UpdateUserSetting_UserSetting_DefaultOrg { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.DefaultOrg +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetTags() []string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.Tags +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetLocked() bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.Locked +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetIsTfaEnabled() *bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.IsTfaEnabled +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetEmailConfirmed() bool { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.EmailConfirmed +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.CreatedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetCreatedBy() *string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.CreatedBy +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetDeletedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.DeletedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetDeletedBy() *string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.DeletedBy +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.UpdatedAt +} +func (t *UpdateUserSetting_UpdateUserSetting_UserSetting) GetUpdatedBy() *string { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting_UserSetting{} + } + return t.UpdatedBy +} + +type UpdateUserSetting_UpdateUserSetting struct { + UserSetting UpdateUserSetting_UpdateUserSetting_UserSetting "json:\"userSetting\" graphql:\"userSetting\"" +} + +func (t *UpdateUserSetting_UpdateUserSetting) GetUserSetting() *UpdateUserSetting_UpdateUserSetting_UserSetting { + if t == nil { + t = &UpdateUserSetting_UpdateUserSetting{} + } + return &t.UserSetting +} + +type GetAllUserSettingHistories_UserSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + IsWebauthnAllowed *bool "json:\"isWebauthnAllowed,omitempty\" graphql:\"isWebauthnAllowed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID *string "json:\"userID,omitempty\" graphql:\"userID\"" +} + +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetIsWebauthnAllowed() *bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsWebauthnAllowed +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Locked +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SuspendedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges_Node) GetUserID() *string { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UserID +} + +type GetAllUserSettingHistories_UserSettingHistories_Edges struct { + Node *GetAllUserSettingHistories_UserSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllUserSettingHistories_UserSettingHistories_Edges) GetNode() *GetAllUserSettingHistories_UserSettingHistories_Edges_Node { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories_Edges{} + } + return t.Node +} + +type GetAllUserSettingHistories_UserSettingHistories struct { + Edges []*GetAllUserSettingHistories_UserSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllUserSettingHistories_UserSettingHistories) GetEdges() []*GetAllUserSettingHistories_UserSettingHistories_Edges { + if t == nil { + t = &GetAllUserSettingHistories_UserSettingHistories{} + } + return t.Edges +} + +type GetUserSettingHistories_UserSettingHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + EmailConfirmed bool "json:\"emailConfirmed\" graphql:\"emailConfirmed\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + IsTfaEnabled *bool "json:\"isTfaEnabled,omitempty\" graphql:\"isTfaEnabled\"" + IsWebauthnAllowed *bool "json:\"isWebauthnAllowed,omitempty\" graphql:\"isWebauthnAllowed\"" + Locked bool "json:\"locked\" graphql:\"locked\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + SilencedAt *time.Time "json:\"silencedAt,omitempty\" graphql:\"silencedAt\"" + Status enums.UserStatus "json:\"status\" graphql:\"status\"" + SuspendedAt *time.Time "json:\"suspendedAt,omitempty\" graphql:\"suspendedAt\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + UserID *string "json:\"userID,omitempty\" graphql:\"userID\"" +} + +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetEmailConfirmed() bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.EmailConfirmed +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.ID +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetIsTfaEnabled() *bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsTfaEnabled +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetIsWebauthnAllowed() *bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.IsWebauthnAllowed +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetLocked() bool { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Locked +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetSilencedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SilencedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetStatus() *enums.UserStatus { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return &t.Status +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetSuspendedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.SuspendedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetUserSettingHistories_UserSettingHistories_Edges_Node) GetUserID() *string { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges_Node{} + } + return t.UserID +} + +type GetUserSettingHistories_UserSettingHistories_Edges struct { + Node *GetUserSettingHistories_UserSettingHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetUserSettingHistories_UserSettingHistories_Edges) GetNode() *GetUserSettingHistories_UserSettingHistories_Edges_Node { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories_Edges{} + } + return t.Node +} + +type GetUserSettingHistories_UserSettingHistories struct { + Edges []*GetUserSettingHistories_UserSettingHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetUserSettingHistories_UserSettingHistories) GetEdges() []*GetUserSettingHistories_UserSettingHistories_Edges { + if t == nil { + t = &GetUserSettingHistories_UserSettingHistories{} + } + return t.Edges +} + +type GetWebhookByID_Webhook_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetWebhookByID_Webhook_Events) GetID() string { + if t == nil { + t = &GetWebhookByID_Webhook_Events{} + } + return t.ID +} + +type GetWebhookByID_Webhook struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Events []*GetWebhookByID_Webhook_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *GetWebhookByID_Webhook) GetCreatedAt() *time.Time { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.CreatedAt +} +func (t *GetWebhookByID_Webhook) GetCreatedBy() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.CreatedBy +} +func (t *GetWebhookByID_Webhook) GetDescription() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Description +} +func (t *GetWebhookByID_Webhook) GetDestinationURL() string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.DestinationURL +} +func (t *GetWebhookByID_Webhook) GetEnabled() bool { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Enabled +} +func (t *GetWebhookByID_Webhook) GetFailures() *int64 { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Failures +} +func (t *GetWebhookByID_Webhook) GetID() string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.ID +} +func (t *GetWebhookByID_Webhook) GetLastError() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.LastError +} +func (t *GetWebhookByID_Webhook) GetLastResponse() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.LastResponse +} +func (t *GetWebhookByID_Webhook) GetName() string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Name +} +func (t *GetWebhookByID_Webhook) GetOwnerID() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.OwnerID +} +func (t *GetWebhookByID_Webhook) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.UpdatedAt +} +func (t *GetWebhookByID_Webhook) GetUpdatedBy() *string { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.UpdatedBy +} +func (t *GetWebhookByID_Webhook) GetEvents() []*GetWebhookByID_Webhook_Events { + if t == nil { + t = &GetWebhookByID_Webhook{} + } + return t.Events +} + +type GetAllWebhooks_Webhooks_Edges_Node_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *GetAllWebhooks_Webhooks_Edges_Node_Events) GetID() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node_Events{} + } + return t.ID +} + +type GetAllWebhooks_Webhooks_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Events []*GetAllWebhooks_Webhooks_Edges_Node_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Description +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetDestinationURL() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.DestinationURL +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetFailures() *int64 { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Failures +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetID() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.ID +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetLastError() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.LastError +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetLastResponse() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.LastResponse +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetName() string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Name +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.UpdatedBy +} +func (t *GetAllWebhooks_Webhooks_Edges_Node) GetEvents() []*GetAllWebhooks_Webhooks_Edges_Node_Events { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges_Node{} + } + return t.Events +} + +type GetAllWebhooks_Webhooks_Edges struct { + Node *GetAllWebhooks_Webhooks_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllWebhooks_Webhooks_Edges) GetNode() *GetAllWebhooks_Webhooks_Edges_Node { + if t == nil { + t = &GetAllWebhooks_Webhooks_Edges{} + } + return t.Node +} + +type GetAllWebhooks_Webhooks struct { + Edges []*GetAllWebhooks_Webhooks_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllWebhooks_Webhooks) GetEdges() []*GetAllWebhooks_Webhooks_Edges { + if t == nil { + t = &GetAllWebhooks_Webhooks{} + } + return t.Edges +} + +type CreateWebhook_CreateWebhook_Webhook_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *CreateWebhook_CreateWebhook_Webhook_Events) GetID() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook_Events{} + } + return t.ID +} + +type CreateWebhook_CreateWebhook_Webhook struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Events []*CreateWebhook_CreateWebhook_Webhook_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *CreateWebhook_CreateWebhook_Webhook) GetDescription() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Description +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetDestinationURL() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.DestinationURL +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetEnabled() bool { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Enabled +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetFailures() *int64 { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Failures +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetID() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.ID +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetLastError() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.LastError +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetLastResponse() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.LastResponse +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetName() string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Name +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetOwnerID() *string { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.OwnerID +} +func (t *CreateWebhook_CreateWebhook_Webhook) GetEvents() []*CreateWebhook_CreateWebhook_Webhook_Events { + if t == nil { + t = &CreateWebhook_CreateWebhook_Webhook{} + } + return t.Events +} + +type CreateWebhook_CreateWebhook struct { + Webhook CreateWebhook_CreateWebhook_Webhook "json:\"webhook\" graphql:\"webhook\"" +} + +func (t *CreateWebhook_CreateWebhook) GetWebhook() *CreateWebhook_CreateWebhook_Webhook { + if t == nil { + t = &CreateWebhook_CreateWebhook{} + } + return &t.Webhook +} + +type CreateBulkWebhook_CreateBulkWebhook_Webhooks struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" +} + +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetDescription() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Description +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Enabled +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetFailures() *int64 { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Failures +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.ID +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetLastError() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.LastError +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetLastResponse() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.LastResponse +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetName() string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.Name +} +func (t *CreateBulkWebhook_CreateBulkWebhook_Webhooks) GetOwnerID() *string { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook_Webhooks{} + } + return t.OwnerID +} + +type CreateBulkWebhook_CreateBulkWebhook struct { + Webhooks []*CreateBulkWebhook_CreateBulkWebhook_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkWebhook_CreateBulkWebhook) GetWebhooks() []*CreateBulkWebhook_CreateBulkWebhook_Webhooks { + if t == nil { + t = &CreateBulkWebhook_CreateBulkWebhook{} + } + return t.Webhooks +} + +type CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks struct { + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" +} + +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetDescription() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Description +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetDestinationURL() string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.DestinationURL +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetEnabled() bool { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Enabled +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetFailures() *int64 { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Failures +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetID() string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.ID +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetLastError() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.LastError +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetLastResponse() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.LastResponse +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetName() string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.Name +} +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks) GetOwnerID() *string { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks{} + } + return t.OwnerID +} + +type CreateBulkCSVWebhook_CreateBulkCSVWebhook struct { + Webhooks []*CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks "json:\"webhooks,omitempty\" graphql:\"webhooks\"" +} + +func (t *CreateBulkCSVWebhook_CreateBulkCSVWebhook) GetWebhooks() []*CreateBulkCSVWebhook_CreateBulkCSVWebhook_Webhooks { + if t == nil { + t = &CreateBulkCSVWebhook_CreateBulkCSVWebhook{} + } + return t.Webhooks +} + +type UpdateWebhook_UpdateWebhook_Webhook_Events struct { + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *UpdateWebhook_UpdateWebhook_Webhook_Events) GetID() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook_Events{} + } + return t.ID +} + +type UpdateWebhook_UpdateWebhook_Webhook struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" + Events []*UpdateWebhook_UpdateWebhook_Webhook_Events "json:\"events,omitempty\" graphql:\"events\"" +} + +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetCreatedAt() *time.Time { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.CreatedAt +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetCreatedBy() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.CreatedBy +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetDescription() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Description +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetDestinationURL() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.DestinationURL +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetEnabled() bool { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Enabled +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetFailures() *int64 { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Failures +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetID() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.ID +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetLastError() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.LastError +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetLastResponse() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.LastResponse +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetName() string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Name +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetOwnerID() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.OwnerID +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetUpdatedAt() *time.Time { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.UpdatedAt +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetUpdatedBy() *string { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.UpdatedBy +} +func (t *UpdateWebhook_UpdateWebhook_Webhook) GetEvents() []*UpdateWebhook_UpdateWebhook_Webhook_Events { + if t == nil { + t = &UpdateWebhook_UpdateWebhook_Webhook{} + } + return t.Events +} + +type UpdateWebhook_UpdateWebhook struct { + Webhook UpdateWebhook_UpdateWebhook_Webhook "json:\"webhook\" graphql:\"webhook\"" +} + +func (t *UpdateWebhook_UpdateWebhook) GetWebhook() *UpdateWebhook_UpdateWebhook_Webhook { + if t == nil { + t = &UpdateWebhook_UpdateWebhook{} + } + return &t.Webhook +} + +type DeleteWebhook_DeleteWebhook struct { + DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" +} + +func (t *DeleteWebhook_DeleteWebhook) GetDeletedID() string { + if t == nil { + t = &DeleteWebhook_DeleteWebhook{} + } + return t.DeletedID +} + +type GetAllWebhookHistories_WebhookHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Description +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetDestinationURL() string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.DestinationURL +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetFailures() *int64 { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Failures +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.ID +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetLastError() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastError +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetLastResponse() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastResponse +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Name +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetAllWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetAllWebhookHistories_WebhookHistories_Edges struct { + Node *GetAllWebhookHistories_WebhookHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetAllWebhookHistories_WebhookHistories_Edges) GetNode() *GetAllWebhookHistories_WebhookHistories_Edges_Node { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories_Edges{} + } + return t.Node +} + +type GetAllWebhookHistories_WebhookHistories struct { + Edges []*GetAllWebhookHistories_WebhookHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetAllWebhookHistories_WebhookHistories) GetEdges() []*GetAllWebhookHistories_WebhookHistories_Edges { + if t == nil { + t = &GetAllWebhookHistories_WebhookHistories{} + } + return t.Edges +} + +type GetWebhookHistories_WebhookHistories_Edges_Node struct { + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" + DestinationURL string "json:\"destinationURL\" graphql:\"destinationURL\"" + Enabled bool "json:\"enabled\" graphql:\"enabled\"" + Failures *int64 "json:\"failures,omitempty\" graphql:\"failures\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + LastError *string "json:\"lastError,omitempty\" graphql:\"lastError\"" + LastResponse *string "json:\"lastResponse,omitempty\" graphql:\"lastResponse\"" + Name string "json:\"name\" graphql:\"name\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetCreatedAt() *time.Time { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedAt +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetCreatedBy() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.CreatedBy +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetDescription() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Description +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetDestinationURL() string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.DestinationURL +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetEnabled() bool { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Enabled +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetFailures() *int64 { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Failures +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetHistoryTime() *time.Time { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.HistoryTime +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetID() string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.ID +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetLastError() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastError +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetLastResponse() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.LastResponse +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetName() string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Name +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetOperation() *history.OpType { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return &t.Operation +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetOwnerID() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.OwnerID +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetRef() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Ref +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetTags() []string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.Tags +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedAt() *time.Time { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedAt +} +func (t *GetWebhookHistories_WebhookHistories_Edges_Node) GetUpdatedBy() *string { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges_Node{} + } + return t.UpdatedBy +} + +type GetWebhookHistories_WebhookHistories_Edges struct { + Node *GetWebhookHistories_WebhookHistories_Edges_Node "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *GetWebhookHistories_WebhookHistories_Edges) GetNode() *GetWebhookHistories_WebhookHistories_Edges_Node { + if t == nil { + t = &GetWebhookHistories_WebhookHistories_Edges{} + } + return t.Node +} + +type GetWebhookHistories_WebhookHistories struct { + Edges []*GetWebhookHistories_WebhookHistories_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *GetWebhookHistories_WebhookHistories) GetEdges() []*GetWebhookHistories_WebhookHistories_Edges { + if t == nil { + t = &GetWebhookHistories_WebhookHistories{} + } + return t.Edges +} + +type CreateAPIToken struct { + CreateAPIToken CreateAPIToken_CreateAPIToken "json:\"createAPIToken\" graphql:\"createAPIToken\"" +} + +func (t *CreateAPIToken) GetCreateAPIToken() *CreateAPIToken_CreateAPIToken { + if t == nil { + t = &CreateAPIToken{} + } + return &t.CreateAPIToken +} + +type UpdateAPIToken struct { + UpdateAPIToken UpdateAPIToken_UpdateAPIToken "json:\"updateAPIToken\" graphql:\"updateAPIToken\"" +} + +func (t *UpdateAPIToken) GetUpdateAPIToken() *UpdateAPIToken_UpdateAPIToken { + if t == nil { + t = &UpdateAPIToken{} + } + return &t.UpdateAPIToken +} + +type GetAllAPITokens struct { + APITokens GetAllAPITokens_APITokens "json:\"apiTokens\" graphql:\"apiTokens\"" +} + +func (t *GetAllAPITokens) GetAPITokens() *GetAllAPITokens_APITokens { + if t == nil { + t = &GetAllAPITokens{} + } + return &t.APITokens +} + +type GetAPITokenByID struct { + APIToken GetAPITokenByID_APIToken "json:\"apiToken\" graphql:\"apiToken\"" +} + +func (t *GetAPITokenByID) GetAPIToken() *GetAPITokenByID_APIToken { + if t == nil { + t = &GetAPITokenByID{} + } + return &t.APIToken +} + +type DeleteAPIToken struct { + DeleteAPIToken DeleteAPIToken_DeleteAPIToken "json:\"deleteAPIToken\" graphql:\"deleteAPIToken\"" +} + +func (t *DeleteAPIToken) GetDeleteAPIToken() *DeleteAPIToken_DeleteAPIToken { + if t == nil { + t = &DeleteAPIToken{} + } + return &t.DeleteAPIToken +} + +type CreateBulkCSVContact struct { + CreateBulkCSVContact CreateBulkCSVContact_CreateBulkCSVContact "json:\"createBulkCSVContact\" graphql:\"createBulkCSVContact\"" +} + +func (t *CreateBulkCSVContact) GetCreateBulkCSVContact() *CreateBulkCSVContact_CreateBulkCSVContact { + if t == nil { + t = &CreateBulkCSVContact{} + } + return &t.CreateBulkCSVContact +} + +type CreateBulkContact struct { + CreateBulkContact CreateBulkContact_CreateBulkContact "json:\"createBulkContact\" graphql:\"createBulkContact\"" +} + +func (t *CreateBulkContact) GetCreateBulkContact() *CreateBulkContact_CreateBulkContact { + if t == nil { + t = &CreateBulkContact{} + } + return &t.CreateBulkContact +} + +type CreateContact struct { + CreateContact CreateContact_CreateContact "json:\"createContact\" graphql:\"createContact\"" +} + +func (t *CreateContact) GetCreateContact() *CreateContact_CreateContact { + if t == nil { + t = &CreateContact{} + } + return &t.CreateContact +} + +type DeleteContact struct { + DeleteContact DeleteContact_DeleteContact "json:\"deleteContact\" graphql:\"deleteContact\"" +} + +func (t *DeleteContact) GetDeleteContact() *DeleteContact_DeleteContact { + if t == nil { + t = &DeleteContact{} + } + return &t.DeleteContact +} + +type GetAllContacts struct { + Contacts GetAllContacts_Contacts "json:\"contacts\" graphql:\"contacts\"" +} + +func (t *GetAllContacts) GetContacts() *GetAllContacts_Contacts { + if t == nil { + t = &GetAllContacts{} + } + return &t.Contacts +} + +type GetContactByID struct { + Contact GetContactByID_Contact "json:\"contact\" graphql:\"contact\"" +} + +func (t *GetContactByID) GetContact() *GetContactByID_Contact { + if t == nil { + t = &GetContactByID{} + } + return &t.Contact +} + +type GetContacts struct { + Contacts GetContacts_Contacts "json:\"contacts\" graphql:\"contacts\"" +} + +func (t *GetContacts) GetContacts() *GetContacts_Contacts { + if t == nil { + t = &GetContacts{} + } + return &t.Contacts +} + +type UpdateContact struct { + UpdateContact UpdateContact_UpdateContact "json:\"updateContact\" graphql:\"updateContact\"" +} + +func (t *UpdateContact) GetUpdateContact() *UpdateContact_UpdateContact { + if t == nil { + t = &UpdateContact{} + } + return &t.UpdateContact +} + +type GetAllContactHistories struct { + ContactHistories GetAllContactHistories_ContactHistories "json:\"contactHistories\" graphql:\"contactHistories\"" +} + +func (t *GetAllContactHistories) GetContactHistories() *GetAllContactHistories_ContactHistories { + if t == nil { + t = &GetAllContactHistories{} + } + return &t.ContactHistories +} + +type GetContactHistories struct { + ContactHistories GetContactHistories_ContactHistories "json:\"contactHistories\" graphql:\"contactHistories\"" +} + +func (t *GetContactHistories) GetContactHistories() *GetContactHistories_ContactHistories { + if t == nil { + t = &GetContactHistories{} + } + return &t.ContactHistories +} + +type CreateDocumentData struct { + CreateDocumentData CreateDocumentData_CreateDocumentData "json:\"createDocumentData\" graphql:\"createDocumentData\"" +} + +func (t *CreateDocumentData) GetCreateDocumentData() *CreateDocumentData_CreateDocumentData { + if t == nil { + t = &CreateDocumentData{} + } + return &t.CreateDocumentData +} + +type DeleteDocumentData struct { + DeleteDocumentData DeleteDocumentData_DeleteDocumentData "json:\"deleteDocumentData\" graphql:\"deleteDocumentData\"" +} + +func (t *DeleteDocumentData) GetDeleteDocumentData() *DeleteDocumentData_DeleteDocumentData { + if t == nil { + t = &DeleteDocumentData{} + } + return &t.DeleteDocumentData +} + +type GetDocumentDataByID struct { + DocumentData GetDocumentDataByID_DocumentData "json:\"documentData\" graphql:\"documentData\"" +} + +func (t *GetDocumentDataByID) GetDocumentData() *GetDocumentDataByID_DocumentData { + if t == nil { + t = &GetDocumentDataByID{} + } + return &t.DocumentData +} + +type UpdateDocumentData struct { + UpdateDocumentData UpdateDocumentData_UpdateDocumentData "json:\"updateDocumentData\" graphql:\"updateDocumentData\"" +} + +func (t *UpdateDocumentData) GetUpdateDocumentData() *UpdateDocumentData_UpdateDocumentData { + if t == nil { + t = &UpdateDocumentData{} + } + return &t.UpdateDocumentData +} + +type GetAllDocumentDataHistories struct { + DocumentDataHistories GetAllDocumentDataHistories_DocumentDataHistories "json:\"documentDataHistories\" graphql:\"documentDataHistories\"" +} + +func (t *GetAllDocumentDataHistories) GetDocumentDataHistories() *GetAllDocumentDataHistories_DocumentDataHistories { + if t == nil { + t = &GetAllDocumentDataHistories{} + } + return &t.DocumentDataHistories +} + +type GetDocumentDataHistories struct { + DocumentDataHistories GetDocumentDataHistories_DocumentDataHistories "json:\"documentDataHistories\" graphql:\"documentDataHistories\"" +} + +func (t *GetDocumentDataHistories) GetDocumentDataHistories() *GetDocumentDataHistories_DocumentDataHistories { + if t == nil { + t = &GetDocumentDataHistories{} + } + return &t.DocumentDataHistories +} + +type CreateBulkCSVEntitlement struct { + CreateBulkCSVEntitlement CreateBulkCSVEntitlement_CreateBulkCSVEntitlement "json:\"createBulkCSVEntitlement\" graphql:\"createBulkCSVEntitlement\"" +} + +func (t *CreateBulkCSVEntitlement) GetCreateBulkCSVEntitlement() *CreateBulkCSVEntitlement_CreateBulkCSVEntitlement { + if t == nil { + t = &CreateBulkCSVEntitlement{} + } + return &t.CreateBulkCSVEntitlement +} + +type CreateBulkEntitlement struct { + CreateBulkEntitlement CreateBulkEntitlement_CreateBulkEntitlement "json:\"createBulkEntitlement\" graphql:\"createBulkEntitlement\"" +} + +func (t *CreateBulkEntitlement) GetCreateBulkEntitlement() *CreateBulkEntitlement_CreateBulkEntitlement { + if t == nil { + t = &CreateBulkEntitlement{} + } + return &t.CreateBulkEntitlement +} + +type CreateEntitlement struct { + CreateEntitlement CreateEntitlement_CreateEntitlement "json:\"createEntitlement\" graphql:\"createEntitlement\"" +} + +func (t *CreateEntitlement) GetCreateEntitlement() *CreateEntitlement_CreateEntitlement { + if t == nil { + t = &CreateEntitlement{} + } + return &t.CreateEntitlement +} + +type DeleteEntitlement struct { + DeleteEntitlement DeleteEntitlement_DeleteEntitlement "json:\"deleteEntitlement\" graphql:\"deleteEntitlement\"" +} + +func (t *DeleteEntitlement) GetDeleteEntitlement() *DeleteEntitlement_DeleteEntitlement { + if t == nil { + t = &DeleteEntitlement{} + } + return &t.DeleteEntitlement +} + +type GetAllEntitlements struct { + Entitlements GetAllEntitlements_Entitlements "json:\"entitlements\" graphql:\"entitlements\"" +} + +func (t *GetAllEntitlements) GetEntitlements() *GetAllEntitlements_Entitlements { + if t == nil { + t = &GetAllEntitlements{} + } + return &t.Entitlements +} + +type GetEntitlementByID struct { + Entitlement GetEntitlementByID_Entitlement "json:\"entitlement\" graphql:\"entitlement\"" +} + +func (t *GetEntitlementByID) GetEntitlement() *GetEntitlementByID_Entitlement { + if t == nil { + t = &GetEntitlementByID{} + } + return &t.Entitlement +} + +type GetEntitlements struct { + Entitlements GetEntitlements_Entitlements "json:\"entitlements\" graphql:\"entitlements\"" +} + +func (t *GetEntitlements) GetEntitlements() *GetEntitlements_Entitlements { + if t == nil { + t = &GetEntitlements{} + } + return &t.Entitlements +} + +type UpdateEntitlement struct { + UpdateEntitlement UpdateEntitlement_UpdateEntitlement "json:\"updateEntitlement\" graphql:\"updateEntitlement\"" +} + +func (t *UpdateEntitlement) GetUpdateEntitlement() *UpdateEntitlement_UpdateEntitlement { + if t == nil { + t = &UpdateEntitlement{} + } + return &t.UpdateEntitlement +} + +type GetAllEntitlementHistories struct { + EntitlementHistories GetAllEntitlementHistories_EntitlementHistories "json:\"entitlementHistories\" graphql:\"entitlementHistories\"" +} + +func (t *GetAllEntitlementHistories) GetEntitlementHistories() *GetAllEntitlementHistories_EntitlementHistories { + if t == nil { + t = &GetAllEntitlementHistories{} + } + return &t.EntitlementHistories +} + +type GetEntitlementHistories struct { + EntitlementHistories GetEntitlementHistories_EntitlementHistories "json:\"entitlementHistories\" graphql:\"entitlementHistories\"" +} + +func (t *GetEntitlementHistories) GetEntitlementHistories() *GetEntitlementHistories_EntitlementHistories { + if t == nil { + t = &GetEntitlementHistories{} + } + return &t.EntitlementHistories +} + +type CreateBulkCSVEntitlementPlan struct { + CreateBulkCSVEntitlementPlan CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan "json:\"createBulkCSVEntitlementPlan\" graphql:\"createBulkCSVEntitlementPlan\"" +} + +func (t *CreateBulkCSVEntitlementPlan) GetCreateBulkCSVEntitlementPlan() *CreateBulkCSVEntitlementPlan_CreateBulkCSVEntitlementPlan { + if t == nil { + t = &CreateBulkCSVEntitlementPlan{} + } + return &t.CreateBulkCSVEntitlementPlan +} + +type CreateBulkEntitlementPlan struct { + CreateBulkEntitlementPlan CreateBulkEntitlementPlan_CreateBulkEntitlementPlan "json:\"createBulkEntitlementPlan\" graphql:\"createBulkEntitlementPlan\"" +} + +func (t *CreateBulkEntitlementPlan) GetCreateBulkEntitlementPlan() *CreateBulkEntitlementPlan_CreateBulkEntitlementPlan { + if t == nil { + t = &CreateBulkEntitlementPlan{} + } + return &t.CreateBulkEntitlementPlan +} + +type CreateEntitlementPlan struct { + CreateEntitlementPlan CreateEntitlementPlan_CreateEntitlementPlan "json:\"createEntitlementPlan\" graphql:\"createEntitlementPlan\"" +} + +func (t *CreateEntitlementPlan) GetCreateEntitlementPlan() *CreateEntitlementPlan_CreateEntitlementPlan { + if t == nil { + t = &CreateEntitlementPlan{} + } + return &t.CreateEntitlementPlan +} + +type DeleteEntitlementPlan struct { + DeleteEntitlementPlan DeleteEntitlementPlan_DeleteEntitlementPlan "json:\"deleteEntitlementPlan\" graphql:\"deleteEntitlementPlan\"" +} + +func (t *DeleteEntitlementPlan) GetDeleteEntitlementPlan() *DeleteEntitlementPlan_DeleteEntitlementPlan { + if t == nil { + t = &DeleteEntitlementPlan{} + } + return &t.DeleteEntitlementPlan +} + +type GetAllEntitlementPlans struct { + EntitlementPlans GetAllEntitlementPlans_EntitlementPlans "json:\"entitlementPlans\" graphql:\"entitlementPlans\"" +} + +func (t *GetAllEntitlementPlans) GetEntitlementPlans() *GetAllEntitlementPlans_EntitlementPlans { + if t == nil { + t = &GetAllEntitlementPlans{} + } + return &t.EntitlementPlans +} + +type GetEntitlementPlanByID struct { + EntitlementPlan GetEntitlementPlanByID_EntitlementPlan "json:\"entitlementPlan\" graphql:\"entitlementPlan\"" +} + +func (t *GetEntitlementPlanByID) GetEntitlementPlan() *GetEntitlementPlanByID_EntitlementPlan { + if t == nil { + t = &GetEntitlementPlanByID{} + } + return &t.EntitlementPlan +} + +type GetEntitlementPlans struct { + EntitlementPlans GetEntitlementPlans_EntitlementPlans "json:\"entitlementPlans\" graphql:\"entitlementPlans\"" +} + +func (t *GetEntitlementPlans) GetEntitlementPlans() *GetEntitlementPlans_EntitlementPlans { + if t == nil { + t = &GetEntitlementPlans{} + } + return &t.EntitlementPlans +} + +type UpdateEntitlementPlan struct { + UpdateEntitlementPlan UpdateEntitlementPlan_UpdateEntitlementPlan "json:\"updateEntitlementPlan\" graphql:\"updateEntitlementPlan\"" +} + +func (t *UpdateEntitlementPlan) GetUpdateEntitlementPlan() *UpdateEntitlementPlan_UpdateEntitlementPlan { + if t == nil { + t = &UpdateEntitlementPlan{} + } + return &t.UpdateEntitlementPlan +} + +type GetAllEntitlementPlanFeatures struct { + EntitlementPlanFeatures GetAllEntitlementPlanFeatures_EntitlementPlanFeatures "json:\"entitlementPlanFeatures\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *GetAllEntitlementPlanFeatures) GetEntitlementPlanFeatures() *GetAllEntitlementPlanFeatures_EntitlementPlanFeatures { + if t == nil { + t = &GetAllEntitlementPlanFeatures{} + } + return &t.EntitlementPlanFeatures +} + +type GetEntitlementPlanFeatureByID struct { + EntitlementPlanFeature GetEntitlementPlanFeatureByID_EntitlementPlanFeature "json:\"entitlementPlanFeature\" graphql:\"entitlementPlanFeature\"" +} + +func (t *GetEntitlementPlanFeatureByID) GetEntitlementPlanFeature() *GetEntitlementPlanFeatureByID_EntitlementPlanFeature { + if t == nil { + t = &GetEntitlementPlanFeatureByID{} + } + return &t.EntitlementPlanFeature +} + +type GetEntitlementPlanFeatures struct { + EntitlementPlanFeatures GetEntitlementPlanFeatures_EntitlementPlanFeatures "json:\"entitlementPlanFeatures\" graphql:\"entitlementPlanFeatures\"" +} + +func (t *GetEntitlementPlanFeatures) GetEntitlementPlanFeatures() *GetEntitlementPlanFeatures_EntitlementPlanFeatures { + if t == nil { + t = &GetEntitlementPlanFeatures{} + } + return &t.EntitlementPlanFeatures +} + +type CreateEntitlementPlanFeature struct { + CreateEntitlementPlanFeature CreateEntitlementPlanFeature_CreateEntitlementPlanFeature "json:\"createEntitlementPlanFeature\" graphql:\"createEntitlementPlanFeature\"" +} + +func (t *CreateEntitlementPlanFeature) GetCreateEntitlementPlanFeature() *CreateEntitlementPlanFeature_CreateEntitlementPlanFeature { + if t == nil { + t = &CreateEntitlementPlanFeature{} + } + return &t.CreateEntitlementPlanFeature +} + +type CreateBulkCSVEntitlementPlanFeature struct { + CreateBulkCSVEntitlementPlanFeature CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature "json:\"createBulkCSVEntitlementPlanFeature\" graphql:\"createBulkCSVEntitlementPlanFeature\"" +} + +func (t *CreateBulkCSVEntitlementPlanFeature) GetCreateBulkCSVEntitlementPlanFeature() *CreateBulkCSVEntitlementPlanFeature_CreateBulkCSVEntitlementPlanFeature { + if t == nil { + t = &CreateBulkCSVEntitlementPlanFeature{} + } + return &t.CreateBulkCSVEntitlementPlanFeature +} + +type CreateBulkEntitlementPlanFeature struct { + CreateBulkEntitlementPlanFeature CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature "json:\"createBulkEntitlementPlanFeature\" graphql:\"createBulkEntitlementPlanFeature\"" +} + +func (t *CreateBulkEntitlementPlanFeature) GetCreateBulkEntitlementPlanFeature() *CreateBulkEntitlementPlanFeature_CreateBulkEntitlementPlanFeature { + if t == nil { + t = &CreateBulkEntitlementPlanFeature{} + } + return &t.CreateBulkEntitlementPlanFeature +} + +type UpdateEntitlementPlanFeature struct { + UpdateEntitlementPlanFeature UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature "json:\"updateEntitlementPlanFeature\" graphql:\"updateEntitlementPlanFeature\"" +} + +func (t *UpdateEntitlementPlanFeature) GetUpdateEntitlementPlanFeature() *UpdateEntitlementPlanFeature_UpdateEntitlementPlanFeature { + if t == nil { + t = &UpdateEntitlementPlanFeature{} + } + return &t.UpdateEntitlementPlanFeature +} + +type DeleteEntitlementPlanFeature struct { + DeleteEntitlementPlanFeature DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature "json:\"deleteEntitlementPlanFeature\" graphql:\"deleteEntitlementPlanFeature\"" +} + +func (t *DeleteEntitlementPlanFeature) GetDeleteEntitlementPlanFeature() *DeleteEntitlementPlanFeature_DeleteEntitlementPlanFeature { + if t == nil { + t = &DeleteEntitlementPlanFeature{} + } + return &t.DeleteEntitlementPlanFeature +} + +type GetAllEntitlementPlanFeatureHistories struct { + EntitlementPlanFeatureHistories GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories "json:\"entitlementPlanFeatureHistories\" graphql:\"entitlementPlanFeatureHistories\"" +} + +func (t *GetAllEntitlementPlanFeatureHistories) GetEntitlementPlanFeatureHistories() *GetAllEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories { + if t == nil { + t = &GetAllEntitlementPlanFeatureHistories{} + } + return &t.EntitlementPlanFeatureHistories +} + +type GetEntitlementPlanFeatureHistories struct { + EntitlementPlanFeatureHistories GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories "json:\"entitlementPlanFeatureHistories\" graphql:\"entitlementPlanFeatureHistories\"" +} + +func (t *GetEntitlementPlanFeatureHistories) GetEntitlementPlanFeatureHistories() *GetEntitlementPlanFeatureHistories_EntitlementPlanFeatureHistories { + if t == nil { + t = &GetEntitlementPlanFeatureHistories{} + } + return &t.EntitlementPlanFeatureHistories +} + +type GetAllEntitlementPlanHistories struct { + EntitlementPlanHistories GetAllEntitlementPlanHistories_EntitlementPlanHistories "json:\"entitlementPlanHistories\" graphql:\"entitlementPlanHistories\"" +} + +func (t *GetAllEntitlementPlanHistories) GetEntitlementPlanHistories() *GetAllEntitlementPlanHistories_EntitlementPlanHistories { + if t == nil { + t = &GetAllEntitlementPlanHistories{} + } + return &t.EntitlementPlanHistories +} + +type GetEntitlementPlanHistories struct { + EntitlementPlanHistories GetEntitlementPlanHistories_EntitlementPlanHistories "json:\"entitlementPlanHistories\" graphql:\"entitlementPlanHistories\"" +} + +func (t *GetEntitlementPlanHistories) GetEntitlementPlanHistories() *GetEntitlementPlanHistories_EntitlementPlanHistories { + if t == nil { + t = &GetEntitlementPlanHistories{} + } + return &t.EntitlementPlanHistories +} + +type CreateBulkCSVEntity struct { + CreateBulkCSVEntity CreateBulkCSVEntity_CreateBulkCSVEntity "json:\"createBulkCSVEntity\" graphql:\"createBulkCSVEntity\"" +} + +func (t *CreateBulkCSVEntity) GetCreateBulkCSVEntity() *CreateBulkCSVEntity_CreateBulkCSVEntity { + if t == nil { + t = &CreateBulkCSVEntity{} + } + return &t.CreateBulkCSVEntity +} + +type CreateBulkEntity struct { + CreateBulkEntity CreateBulkEntity_CreateBulkEntity "json:\"createBulkEntity\" graphql:\"createBulkEntity\"" +} + +func (t *CreateBulkEntity) GetCreateBulkEntity() *CreateBulkEntity_CreateBulkEntity { + if t == nil { + t = &CreateBulkEntity{} + } + return &t.CreateBulkEntity +} + +type CreateEntity struct { + CreateEntity CreateEntity_CreateEntity "json:\"createEntity\" graphql:\"createEntity\"" +} + +func (t *CreateEntity) GetCreateEntity() *CreateEntity_CreateEntity { + if t == nil { + t = &CreateEntity{} + } + return &t.CreateEntity +} + +type DeleteEntity struct { + DeleteEntity DeleteEntity_DeleteEntity "json:\"deleteEntity\" graphql:\"deleteEntity\"" +} + +func (t *DeleteEntity) GetDeleteEntity() *DeleteEntity_DeleteEntity { + if t == nil { + t = &DeleteEntity{} + } + return &t.DeleteEntity +} + +type GetAllEntities struct { + Entities GetAllEntities_Entities "json:\"entities\" graphql:\"entities\"" +} + +func (t *GetAllEntities) GetEntities() *GetAllEntities_Entities { + if t == nil { + t = &GetAllEntities{} + } + return &t.Entities +} + +type GetEntities struct { + Entities GetEntities_Entities "json:\"entities\" graphql:\"entities\"" +} + +func (t *GetEntities) GetEntities() *GetEntities_Entities { + if t == nil { + t = &GetEntities{} + } + return &t.Entities +} + +type GetEntityByID struct { + Entity GetEntityByID_Entity "json:\"entity\" graphql:\"entity\"" +} + +func (t *GetEntityByID) GetEntity() *GetEntityByID_Entity { + if t == nil { + t = &GetEntityByID{} + } + return &t.Entity +} + +type UpdateEntity struct { + UpdateEntity UpdateEntity_UpdateEntity "json:\"updateEntity\" graphql:\"updateEntity\"" +} + +func (t *UpdateEntity) GetUpdateEntity() *UpdateEntity_UpdateEntity { + if t == nil { + t = &UpdateEntity{} + } + return &t.UpdateEntity +} + +type GetAllEntityHistories struct { + EntityHistories GetAllEntityHistories_EntityHistories "json:\"entityHistories\" graphql:\"entityHistories\"" +} + +func (t *GetAllEntityHistories) GetEntityHistories() *GetAllEntityHistories_EntityHistories { + if t == nil { + t = &GetAllEntityHistories{} + } + return &t.EntityHistories +} + +type GetEntityHistories struct { + EntityHistories GetEntityHistories_EntityHistories "json:\"entityHistories\" graphql:\"entityHistories\"" +} + +func (t *GetEntityHistories) GetEntityHistories() *GetEntityHistories_EntityHistories { + if t == nil { + t = &GetEntityHistories{} + } + return &t.EntityHistories +} + +type CreateBulkCSVEntityType struct { + CreateBulkCSVEntityType CreateBulkCSVEntityType_CreateBulkCSVEntityType "json:\"createBulkCSVEntityType\" graphql:\"createBulkCSVEntityType\"" +} + +func (t *CreateBulkCSVEntityType) GetCreateBulkCSVEntityType() *CreateBulkCSVEntityType_CreateBulkCSVEntityType { + if t == nil { + t = &CreateBulkCSVEntityType{} + } + return &t.CreateBulkCSVEntityType +} + +type CreateBulkEntityType struct { + CreateBulkEntityType CreateBulkEntityType_CreateBulkEntityType "json:\"createBulkEntityType\" graphql:\"createBulkEntityType\"" +} + +func (t *CreateBulkEntityType) GetCreateBulkEntityType() *CreateBulkEntityType_CreateBulkEntityType { + if t == nil { + t = &CreateBulkEntityType{} + } + return &t.CreateBulkEntityType +} + +type CreateEntityType struct { + CreateEntityType CreateEntityType_CreateEntityType "json:\"createEntityType\" graphql:\"createEntityType\"" +} + +func (t *CreateEntityType) GetCreateEntityType() *CreateEntityType_CreateEntityType { + if t == nil { + t = &CreateEntityType{} + } + return &t.CreateEntityType +} + +type DeleteEntityType struct { + DeleteEntityType DeleteEntityType_DeleteEntityType "json:\"deleteEntityType\" graphql:\"deleteEntityType\"" +} + +func (t *DeleteEntityType) GetDeleteEntityType() *DeleteEntityType_DeleteEntityType { + if t == nil { + t = &DeleteEntityType{} + } + return &t.DeleteEntityType +} + +type GetAllEntityTypes struct { + EntityTypes GetAllEntityTypes_EntityTypes "json:\"entityTypes\" graphql:\"entityTypes\"" +} + +func (t *GetAllEntityTypes) GetEntityTypes() *GetAllEntityTypes_EntityTypes { + if t == nil { + t = &GetAllEntityTypes{} + } + return &t.EntityTypes +} + +type GetEntityTypeByID struct { + EntityType GetEntityTypeByID_EntityType "json:\"entityType\" graphql:\"entityType\"" +} + +func (t *GetEntityTypeByID) GetEntityType() *GetEntityTypeByID_EntityType { + if t == nil { + t = &GetEntityTypeByID{} + } + return &t.EntityType +} + +type GetEntityTypes struct { + EntityTypes GetEntityTypes_EntityTypes "json:\"entityTypes\" graphql:\"entityTypes\"" +} + +func (t *GetEntityTypes) GetEntityTypes() *GetEntityTypes_EntityTypes { + if t == nil { + t = &GetEntityTypes{} + } + return &t.EntityTypes +} + +type UpdateEntityType struct { + UpdateEntityType UpdateEntityType_UpdateEntityType "json:\"updateEntityType\" graphql:\"updateEntityType\"" +} + +func (t *UpdateEntityType) GetUpdateEntityType() *UpdateEntityType_UpdateEntityType { + if t == nil { + t = &UpdateEntityType{} + } + return &t.UpdateEntityType +} + +type GetAllEntityTypeHistories struct { + EntityTypeHistories GetAllEntityTypeHistories_EntityTypeHistories "json:\"entityTypeHistories\" graphql:\"entityTypeHistories\"" +} + +func (t *GetAllEntityTypeHistories) GetEntityTypeHistories() *GetAllEntityTypeHistories_EntityTypeHistories { + if t == nil { + t = &GetAllEntityTypeHistories{} + } + return &t.EntityTypeHistories +} + +type GetEntityTypeHistories struct { + EntityTypeHistories GetEntityTypeHistories_EntityTypeHistories "json:\"entityTypeHistories\" graphql:\"entityTypeHistories\"" +} + +func (t *GetEntityTypeHistories) GetEntityTypeHistories() *GetEntityTypeHistories_EntityTypeHistories { + if t == nil { + t = &GetEntityTypeHistories{} + } + return &t.EntityTypeHistories +} + +type GetEvents struct { + Events GetEvents_Events "json:\"events\" graphql:\"events\"" +} + +func (t *GetEvents) GetEvents() *GetEvents_Events { + if t == nil { + t = &GetEvents{} + } + return &t.Events +} + +type GetEventByID struct { + Event GetEventByID_Event "json:\"event\" graphql:\"event\"" +} + +func (t *GetEventByID) GetEvent() *GetEventByID_Event { + if t == nil { + t = &GetEventByID{} + } + return &t.Event +} + +type GetAllEvents struct { + Events GetAllEvents_Events "json:\"events\" graphql:\"events\"" +} + +func (t *GetAllEvents) GetEvents() *GetAllEvents_Events { + if t == nil { + t = &GetAllEvents{} + } + return &t.Events +} + +type CreateEvent struct { + CreateEvent CreateEvent_CreateEvent "json:\"createEvent\" graphql:\"createEvent\"" +} + +func (t *CreateEvent) GetCreateEvent() *CreateEvent_CreateEvent { + if t == nil { + t = &CreateEvent{} + } + return &t.CreateEvent +} + +type CreateBulkEvent struct { + CreateBulkEvent CreateBulkEvent_CreateBulkEvent "json:\"createBulkEvent\" graphql:\"createBulkEvent\"" +} + +func (t *CreateBulkEvent) GetCreateBulkEvent() *CreateBulkEvent_CreateBulkEvent { + if t == nil { + t = &CreateBulkEvent{} + } + return &t.CreateBulkEvent +} + +type CreateBulkCSVEvent struct { + CreateBulkCSVEvent CreateBulkCSVEvent_CreateBulkCSVEvent "json:\"createBulkCSVEvent\" graphql:\"createBulkCSVEvent\"" +} + +func (t *CreateBulkCSVEvent) GetCreateBulkCSVEvent() *CreateBulkCSVEvent_CreateBulkCSVEvent { + if t == nil { + t = &CreateBulkCSVEvent{} + } + return &t.CreateBulkCSVEvent +} + +type UpdateEvent struct { + UpdateEvent UpdateEvent_UpdateEvent "json:\"updateEvent\" graphql:\"updateEvent\"" +} + +func (t *UpdateEvent) GetUpdateEvent() *UpdateEvent_UpdateEvent { + if t == nil { + t = &UpdateEvent{} + } + return &t.UpdateEvent +} + +type DeleteEvent struct { + DeleteEvent DeleteEvent_DeleteEvent "json:\"deleteEvent\" graphql:\"deleteEvent\"" +} + +func (t *DeleteEvent) GetDeleteEvent() *DeleteEvent_DeleteEvent { + if t == nil { + t = &DeleteEvent{} + } + return &t.DeleteEvent +} + +type GetAllEventHistories struct { + EventHistories GetAllEventHistories_EventHistories "json:\"eventHistories\" graphql:\"eventHistories\"" +} + +func (t *GetAllEventHistories) GetEventHistories() *GetAllEventHistories_EventHistories { + if t == nil { + t = &GetAllEventHistories{} + } + return &t.EventHistories +} + +type GetEventHistories struct { + EventHistories GetEventHistories_EventHistories "json:\"eventHistories\" graphql:\"eventHistories\"" +} + +func (t *GetEventHistories) GetEventHistories() *GetEventHistories_EventHistories { + if t == nil { + t = &GetEventHistories{} + } + return &t.EventHistories +} + +type CreateBulkCSVFeature struct { + CreateBulkCSVFeature CreateBulkCSVFeature_CreateBulkCSVFeature "json:\"createBulkCSVFeature\" graphql:\"createBulkCSVFeature\"" +} + +func (t *CreateBulkCSVFeature) GetCreateBulkCSVFeature() *CreateBulkCSVFeature_CreateBulkCSVFeature { + if t == nil { + t = &CreateBulkCSVFeature{} + } + return &t.CreateBulkCSVFeature +} + +type CreateBulkFeature struct { + CreateBulkFeature CreateBulkFeature_CreateBulkFeature "json:\"createBulkFeature\" graphql:\"createBulkFeature\"" +} + +func (t *CreateBulkFeature) GetCreateBulkFeature() *CreateBulkFeature_CreateBulkFeature { + if t == nil { + t = &CreateBulkFeature{} + } + return &t.CreateBulkFeature +} + +type CreateFeature struct { + CreateFeature CreateFeature_CreateFeature "json:\"createFeature\" graphql:\"createFeature\"" +} + +func (t *CreateFeature) GetCreateFeature() *CreateFeature_CreateFeature { + if t == nil { + t = &CreateFeature{} + } + return &t.CreateFeature +} + +type DeleteFeature struct { + DeleteFeature DeleteFeature_DeleteFeature "json:\"deleteFeature\" graphql:\"deleteFeature\"" +} + +func (t *DeleteFeature) GetDeleteFeature() *DeleteFeature_DeleteFeature { + if t == nil { + t = &DeleteFeature{} + } + return &t.DeleteFeature +} + +type GetAllFeatures struct { + Features GetAllFeatures_Features "json:\"features\" graphql:\"features\"" +} + +func (t *GetAllFeatures) GetFeatures() *GetAllFeatures_Features { + if t == nil { + t = &GetAllFeatures{} + } + return &t.Features +} + +type GetFeatureByID struct { + Feature GetFeatureByID_Feature "json:\"feature\" graphql:\"feature\"" +} + +func (t *GetFeatureByID) GetFeature() *GetFeatureByID_Feature { + if t == nil { + t = &GetFeatureByID{} + } + return &t.Feature +} + +type GetFeatures struct { + Features GetFeatures_Features "json:\"features\" graphql:\"features\"" +} + +func (t *GetFeatures) GetFeatures() *GetFeatures_Features { + if t == nil { + t = &GetFeatures{} + } + return &t.Features +} + +type UpdateFeature struct { + UpdateFeature UpdateFeature_UpdateFeature "json:\"updateFeature\" graphql:\"updateFeature\"" +} + +func (t *UpdateFeature) GetUpdateFeature() *UpdateFeature_UpdateFeature { + if t == nil { + t = &UpdateFeature{} + } + return &t.UpdateFeature +} + +type GetAllFeatureHistories struct { + FeatureHistories GetAllFeatureHistories_FeatureHistories "json:\"featureHistories\" graphql:\"featureHistories\"" +} + +func (t *GetAllFeatureHistories) GetFeatureHistories() *GetAllFeatureHistories_FeatureHistories { + if t == nil { + t = &GetAllFeatureHistories{} + } + return &t.FeatureHistories +} + +type GetFeatureHistories struct { + FeatureHistories GetFeatureHistories_FeatureHistories "json:\"featureHistories\" graphql:\"featureHistories\"" +} + +func (t *GetFeatureHistories) GetFeatureHistories() *GetFeatureHistories_FeatureHistories { + if t == nil { + t = &GetFeatureHistories{} + } + return &t.FeatureHistories +} + +type CreateBulkCSVFile struct { + CreateBulkCSVFile CreateBulkCSVFile_CreateBulkCSVFile "json:\"createBulkCSVFile\" graphql:\"createBulkCSVFile\"" +} + +func (t *CreateBulkCSVFile) GetCreateBulkCSVFile() *CreateBulkCSVFile_CreateBulkCSVFile { + if t == nil { + t = &CreateBulkCSVFile{} + } + return &t.CreateBulkCSVFile +} + +type CreateBulkFile struct { + CreateBulkFile CreateBulkFile_CreateBulkFile "json:\"createBulkFile\" graphql:\"createBulkFile\"" +} + +func (t *CreateBulkFile) GetCreateBulkFile() *CreateBulkFile_CreateBulkFile { + if t == nil { + t = &CreateBulkFile{} + } + return &t.CreateBulkFile +} + +type CreateFile struct { + CreateFile CreateFile_CreateFile "json:\"createFile\" graphql:\"createFile\"" +} + +func (t *CreateFile) GetCreateFile() *CreateFile_CreateFile { + if t == nil { + t = &CreateFile{} + } + return &t.CreateFile +} + +type DeleteFile struct { + DeleteFile DeleteFile_DeleteFile "json:\"deleteFile\" graphql:\"deleteFile\"" +} + +func (t *DeleteFile) GetDeleteFile() *DeleteFile_DeleteFile { + if t == nil { + t = &DeleteFile{} + } + return &t.DeleteFile +} + +type GetAllFiles struct { + Files GetAllFiles_Files "json:\"files\" graphql:\"files\"" +} + +func (t *GetAllFiles) GetFiles() *GetAllFiles_Files { + if t == nil { + t = &GetAllFiles{} + } + return &t.Files +} + +type GetFiles struct { + Files GetFiles_Files "json:\"files\" graphql:\"files\"" +} + +func (t *GetFiles) GetFiles() *GetFiles_Files { + if t == nil { + t = &GetFiles{} + } + return &t.Files +} + +type UpdateFile struct { + UpdateFile UpdateFile_UpdateFile "json:\"updateFile\" graphql:\"updateFile\"" +} + +func (t *UpdateFile) GetUpdateFile() *UpdateFile_UpdateFile { + if t == nil { + t = &UpdateFile{} + } + return &t.UpdateFile +} + +type GetAllFileHistories struct { + FileHistories GetAllFileHistories_FileHistories "json:\"fileHistories\" graphql:\"fileHistories\"" +} + +func (t *GetAllFileHistories) GetFileHistories() *GetAllFileHistories_FileHistories { + if t == nil { + t = &GetAllFileHistories{} + } + return &t.FileHistories +} + +type GetFileHistories struct { + FileHistories GetFileHistories_FileHistories "json:\"fileHistories\" graphql:\"fileHistories\"" +} + +func (t *GetFileHistories) GetFileHistories() *GetFileHistories_FileHistories { + if t == nil { + t = &GetFileHistories{} + } + return &t.FileHistories +} + +type CreateBulkCSVGroup struct { + CreateBulkCSVGroup CreateBulkCSVGroup_CreateBulkCSVGroup "json:\"createBulkCSVGroup\" graphql:\"createBulkCSVGroup\"" +} + +func (t *CreateBulkCSVGroup) GetCreateBulkCSVGroup() *CreateBulkCSVGroup_CreateBulkCSVGroup { + if t == nil { + t = &CreateBulkCSVGroup{} + } + return &t.CreateBulkCSVGroup +} + +type CreateBulkGroup struct { + CreateBulkGroup CreateBulkGroup_CreateBulkGroup "json:\"createBulkGroup\" graphql:\"createBulkGroup\"" +} + +func (t *CreateBulkGroup) GetCreateBulkGroup() *CreateBulkGroup_CreateBulkGroup { + if t == nil { + t = &CreateBulkGroup{} + } + return &t.CreateBulkGroup +} + +type CreateGroup struct { + CreateGroup CreateGroup_CreateGroup "json:\"createGroup\" graphql:\"createGroup\"" +} + +func (t *CreateGroup) GetCreateGroup() *CreateGroup_CreateGroup { + if t == nil { + t = &CreateGroup{} + } + return &t.CreateGroup +} + +type DeleteGroup struct { + DeleteGroup DeleteGroup_DeleteGroup "json:\"deleteGroup\" graphql:\"deleteGroup\"" +} + +func (t *DeleteGroup) GetDeleteGroup() *DeleteGroup_DeleteGroup { + if t == nil { + t = &DeleteGroup{} + } + return &t.DeleteGroup +} + +type GetAllGroups struct { + Groups GetAllGroups_Groups "json:\"groups\" graphql:\"groups\"" +} + +func (t *GetAllGroups) GetGroups() *GetAllGroups_Groups { + if t == nil { + t = &GetAllGroups{} + } + return &t.Groups +} + +type GetGroupByID struct { + Group GetGroupByID_Group "json:\"group\" graphql:\"group\"" +} + +func (t *GetGroupByID) GetGroup() *GetGroupByID_Group { + if t == nil { + t = &GetGroupByID{} + } + return &t.Group +} + +type GetGroups struct { + Groups GetGroups_Groups "json:\"groups\" graphql:\"groups\"" +} + +func (t *GetGroups) GetGroups() *GetGroups_Groups { + if t == nil { + t = &GetGroups{} + } + return &t.Groups +} + +type UpdateGroup struct { + UpdateGroup UpdateGroup_UpdateGroup "json:\"updateGroup\" graphql:\"updateGroup\"" +} + +func (t *UpdateGroup) GetUpdateGroup() *UpdateGroup_UpdateGroup { + if t == nil { + t = &UpdateGroup{} + } + return &t.UpdateGroup +} + +type GetAllGroupHistories struct { + GroupHistories GetAllGroupHistories_GroupHistories "json:\"groupHistories\" graphql:\"groupHistories\"" +} + +func (t *GetAllGroupHistories) GetGroupHistories() *GetAllGroupHistories_GroupHistories { + if t == nil { + t = &GetAllGroupHistories{} + } + return &t.GroupHistories +} + +type GetGroupHistories struct { + GroupHistories GetGroupHistories_GroupHistories "json:\"groupHistories\" graphql:\"groupHistories\"" +} + +func (t *GetGroupHistories) GetGroupHistories() *GetGroupHistories_GroupHistories { + if t == nil { + t = &GetGroupHistories{} + } + return &t.GroupHistories +} + +type AddUserToGroupWithRole struct { + CreateGroupMembership AddUserToGroupWithRole_CreateGroupMembership "json:\"createGroupMembership\" graphql:\"createGroupMembership\"" +} + +func (t *AddUserToGroupWithRole) GetCreateGroupMembership() *AddUserToGroupWithRole_CreateGroupMembership { + if t == nil { + t = &AddUserToGroupWithRole{} + } + return &t.CreateGroupMembership +} + +type CreateBulkCSVGroupMembers struct { + CreateBulkCSVGroupMembership CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership "json:\"createBulkCSVGroupMembership\" graphql:\"createBulkCSVGroupMembership\"" +} + +func (t *CreateBulkCSVGroupMembers) GetCreateBulkCSVGroupMembership() *CreateBulkCSVGroupMembers_CreateBulkCSVGroupMembership { + if t == nil { + t = &CreateBulkCSVGroupMembers{} + } + return &t.CreateBulkCSVGroupMembership +} + +type CreateBulkGroupMembers struct { + CreateBulkGroupMembership CreateBulkGroupMembers_CreateBulkGroupMembership "json:\"createBulkGroupMembership\" graphql:\"createBulkGroupMembership\"" +} + +func (t *CreateBulkGroupMembers) GetCreateBulkGroupMembership() *CreateBulkGroupMembers_CreateBulkGroupMembership { + if t == nil { + t = &CreateBulkGroupMembers{} + } + return &t.CreateBulkGroupMembership +} + +type GetGroupMembersByGroupID struct { + GroupMemberships GetGroupMembersByGroupID_GroupMemberships "json:\"groupMemberships\" graphql:\"groupMemberships\"" +} + +func (t *GetGroupMembersByGroupID) GetGroupMemberships() *GetGroupMembersByGroupID_GroupMemberships { + if t == nil { + t = &GetGroupMembersByGroupID{} + } + return &t.GroupMemberships +} + +type RemoveUserFromGroup struct { + DeleteGroupMembership RemoveUserFromGroup_DeleteGroupMembership "json:\"deleteGroupMembership\" graphql:\"deleteGroupMembership\"" +} + +func (t *RemoveUserFromGroup) GetDeleteGroupMembership() *RemoveUserFromGroup_DeleteGroupMembership { + if t == nil { + t = &RemoveUserFromGroup{} + } + return &t.DeleteGroupMembership +} + +type UpdateUserRoleInGroup struct { + UpdateGroupMembership UpdateUserRoleInGroup_UpdateGroupMembership "json:\"updateGroupMembership\" graphql:\"updateGroupMembership\"" +} + +func (t *UpdateUserRoleInGroup) GetUpdateGroupMembership() *UpdateUserRoleInGroup_UpdateGroupMembership { + if t == nil { + t = &UpdateUserRoleInGroup{} + } + return &t.UpdateGroupMembership +} + +type GetAllGroupMembershipHistories struct { + GroupMembershipHistories GetAllGroupMembershipHistories_GroupMembershipHistories "json:\"groupMembershipHistories\" graphql:\"groupMembershipHistories\"" +} + +func (t *GetAllGroupMembershipHistories) GetGroupMembershipHistories() *GetAllGroupMembershipHistories_GroupMembershipHistories { + if t == nil { + t = &GetAllGroupMembershipHistories{} + } + return &t.GroupMembershipHistories +} + +type GetGroupMembershipHistories struct { + GroupMembershipHistories GetGroupMembershipHistories_GroupMembershipHistories "json:\"groupMembershipHistories\" graphql:\"groupMembershipHistories\"" +} + +func (t *GetGroupMembershipHistories) GetGroupMembershipHistories() *GetGroupMembershipHistories_GroupMembershipHistories { + if t == nil { + t = &GetGroupMembershipHistories{} + } + return &t.GroupMembershipHistories +} + +type GetAllGroupSettings struct { + GroupSettings GetAllGroupSettings_GroupSettings "json:\"groupSettings\" graphql:\"groupSettings\"" +} + +func (t *GetAllGroupSettings) GetGroupSettings() *GetAllGroupSettings_GroupSettings { + if t == nil { + t = &GetAllGroupSettings{} + } + return &t.GroupSettings +} + +type GetGroupSettingByID struct { + GroupSetting GetGroupSettingByID_GroupSetting "json:\"groupSetting\" graphql:\"groupSetting\"" +} + +func (t *GetGroupSettingByID) GetGroupSetting() *GetGroupSettingByID_GroupSetting { + if t == nil { + t = &GetGroupSettingByID{} + } + return &t.GroupSetting +} + +type GetGroupSettings struct { + GroupSettings GetGroupSettings_GroupSettings "json:\"groupSettings\" graphql:\"groupSettings\"" +} + +func (t *GetGroupSettings) GetGroupSettings() *GetGroupSettings_GroupSettings { + if t == nil { + t = &GetGroupSettings{} + } + return &t.GroupSettings +} + +type UpdateGroupSetting struct { + UpdateGroupSetting UpdateGroupSetting_UpdateGroupSetting "json:\"updateGroupSetting\" graphql:\"updateGroupSetting\"" +} + +func (t *UpdateGroupSetting) GetUpdateGroupSetting() *UpdateGroupSetting_UpdateGroupSetting { + if t == nil { + t = &UpdateGroupSetting{} + } + return &t.UpdateGroupSetting +} + +type GetAllGroupSettingHistories struct { + GroupSettingHistories GetAllGroupSettingHistories_GroupSettingHistories "json:\"groupSettingHistories\" graphql:\"groupSettingHistories\"" +} + +func (t *GetAllGroupSettingHistories) GetGroupSettingHistories() *GetAllGroupSettingHistories_GroupSettingHistories { + if t == nil { + t = &GetAllGroupSettingHistories{} + } + return &t.GroupSettingHistories +} + +type GetGroupSettingHistories struct { + GroupSettingHistories GetGroupSettingHistories_GroupSettingHistories "json:\"groupSettingHistories\" graphql:\"groupSettingHistories\"" +} + +func (t *GetGroupSettingHistories) GetGroupSettingHistories() *GetGroupSettingHistories_GroupSettingHistories { + if t == nil { + t = &GetGroupSettingHistories{} + } + return &t.GroupSettingHistories +} + +type CreateBulkCSVHush struct { + CreateBulkCSVHush CreateBulkCSVHush_CreateBulkCSVHush "json:\"createBulkCSVHush\" graphql:\"createBulkCSVHush\"" +} + +func (t *CreateBulkCSVHush) GetCreateBulkCSVHush() *CreateBulkCSVHush_CreateBulkCSVHush { + if t == nil { + t = &CreateBulkCSVHush{} + } + return &t.CreateBulkCSVHush +} + +type CreateBulkHush struct { + CreateBulkHush CreateBulkHush_CreateBulkHush "json:\"createBulkHush\" graphql:\"createBulkHush\"" +} + +func (t *CreateBulkHush) GetCreateBulkHush() *CreateBulkHush_CreateBulkHush { + if t == nil { + t = &CreateBulkHush{} + } + return &t.CreateBulkHush +} + +type CreateHush struct { + CreateHush CreateHush_CreateHush "json:\"createHush\" graphql:\"createHush\"" +} + +func (t *CreateHush) GetCreateHush() *CreateHush_CreateHush { + if t == nil { + t = &CreateHush{} + } + return &t.CreateHush +} + +type GetAllHushes struct { + Hushes GetAllHushes_Hushes "json:\"hushes\" graphql:\"hushes\"" +} + +func (t *GetAllHushes) GetHushes() *GetAllHushes_Hushes { + if t == nil { + t = &GetAllHushes{} + } + return &t.Hushes +} + +type GetHushByID struct { + Hush GetHushByID_Hush "json:\"hush\" graphql:\"hush\"" +} + +func (t *GetHushByID) GetHush() *GetHushByID_Hush { + if t == nil { + t = &GetHushByID{} + } + return &t.Hush +} + +type GetHushes struct { + Hushes GetHushes_Hushes "json:\"hushes\" graphql:\"hushes\"" +} + +func (t *GetHushes) GetHushes() *GetHushes_Hushes { + if t == nil { + t = &GetHushes{} + } + return &t.Hushes +} + +type UpdateHush struct { + UpdateHush UpdateHush_UpdateHush "json:\"updateHush\" graphql:\"updateHush\"" +} + +func (t *UpdateHush) GetUpdateHush() *UpdateHush_UpdateHush { + if t == nil { + t = &UpdateHush{} + } + return &t.UpdateHush +} + +type GetAllHushHistories struct { + HushHistories GetAllHushHistories_HushHistories "json:\"hushHistories\" graphql:\"hushHistories\"" +} + +func (t *GetAllHushHistories) GetHushHistories() *GetAllHushHistories_HushHistories { + if t == nil { + t = &GetAllHushHistories{} + } + return &t.HushHistories +} + +type GetHushHistories struct { + HushHistories GetHushHistories_HushHistories "json:\"hushHistories\" graphql:\"hushHistories\"" +} + +func (t *GetHushHistories) GetHushHistories() *GetHushHistories_HushHistories { + if t == nil { + t = &GetHushHistories{} + } + return &t.HushHistories +} + +type CreateBulkCSVIntegration struct { + CreateBulkCSVIntegration CreateBulkCSVIntegration_CreateBulkCSVIntegration "json:\"createBulkCSVIntegration\" graphql:\"createBulkCSVIntegration\"" +} + +func (t *CreateBulkCSVIntegration) GetCreateBulkCSVIntegration() *CreateBulkCSVIntegration_CreateBulkCSVIntegration { + if t == nil { + t = &CreateBulkCSVIntegration{} + } + return &t.CreateBulkCSVIntegration +} + +type CreateBulkIntegration struct { + CreateBulkIntegration CreateBulkIntegration_CreateBulkIntegration "json:\"createBulkIntegration\" graphql:\"createBulkIntegration\"" +} + +func (t *CreateBulkIntegration) GetCreateBulkIntegration() *CreateBulkIntegration_CreateBulkIntegration { + if t == nil { + t = &CreateBulkIntegration{} + } + return &t.CreateBulkIntegration +} + +type CreateIntegration struct { + CreateIntegration CreateIntegration_CreateIntegration "json:\"createIntegration\" graphql:\"createIntegration\"" +} + +func (t *CreateIntegration) GetCreateIntegration() *CreateIntegration_CreateIntegration { + if t == nil { + t = &CreateIntegration{} + } + return &t.CreateIntegration +} + +type DeleteIntegration struct { + DeleteIntegration DeleteIntegration_DeleteIntegration "json:\"deleteIntegration\" graphql:\"deleteIntegration\"" +} + +func (t *DeleteIntegration) GetDeleteIntegration() *DeleteIntegration_DeleteIntegration { + if t == nil { + t = &DeleteIntegration{} + } + return &t.DeleteIntegration +} + +type GetAllIntegrations struct { + Integrations GetAllIntegrations_Integrations "json:\"integrations\" graphql:\"integrations\"" +} + +func (t *GetAllIntegrations) GetIntegrations() *GetAllIntegrations_Integrations { + if t == nil { + t = &GetAllIntegrations{} + } + return &t.Integrations +} + +type GetIntegrationByID struct { + Integration GetIntegrationByID_Integration "json:\"integration\" graphql:\"integration\"" +} + +func (t *GetIntegrationByID) GetIntegration() *GetIntegrationByID_Integration { + if t == nil { + t = &GetIntegrationByID{} + } + return &t.Integration +} + +type GetIntegrations struct { + Integrations GetIntegrations_Integrations "json:\"integrations\" graphql:\"integrations\"" +} + +func (t *GetIntegrations) GetIntegrations() *GetIntegrations_Integrations { + if t == nil { + t = &GetIntegrations{} + } + return &t.Integrations +} + +type UpdateIntegration struct { + UpdateIntegration UpdateIntegration_UpdateIntegration "json:\"updateIntegration\" graphql:\"updateIntegration\"" +} + +func (t *UpdateIntegration) GetUpdateIntegration() *UpdateIntegration_UpdateIntegration { + if t == nil { + t = &UpdateIntegration{} + } + return &t.UpdateIntegration +} + +type GetAllIntegrationHistories struct { + IntegrationHistories GetAllIntegrationHistories_IntegrationHistories "json:\"integrationHistories\" graphql:\"integrationHistories\"" +} + +func (t *GetAllIntegrationHistories) GetIntegrationHistories() *GetAllIntegrationHistories_IntegrationHistories { + if t == nil { + t = &GetAllIntegrationHistories{} + } + return &t.IntegrationHistories +} + +type GetIntegrationHistories struct { + IntegrationHistories GetIntegrationHistories_IntegrationHistories "json:\"integrationHistories\" graphql:\"integrationHistories\"" +} + +func (t *GetIntegrationHistories) GetIntegrationHistories() *GetIntegrationHistories_IntegrationHistories { + if t == nil { + t = &GetIntegrationHistories{} + } + return &t.IntegrationHistories +} + +type CreateBulkCSVInvite struct { + CreateBulkCSVInvite CreateBulkCSVInvite_CreateBulkCSVInvite "json:\"createBulkCSVInvite\" graphql:\"createBulkCSVInvite\"" +} + +func (t *CreateBulkCSVInvite) GetCreateBulkCSVInvite() *CreateBulkCSVInvite_CreateBulkCSVInvite { + if t == nil { + t = &CreateBulkCSVInvite{} + } + return &t.CreateBulkCSVInvite +} + +type CreateBulkInvite struct { + CreateBulkInvite CreateBulkInvite_CreateBulkInvite "json:\"createBulkInvite\" graphql:\"createBulkInvite\"" +} + +func (t *CreateBulkInvite) GetCreateBulkInvite() *CreateBulkInvite_CreateBulkInvite { + if t == nil { + t = &CreateBulkInvite{} + } + return &t.CreateBulkInvite +} + +type CreateInvite struct { + CreateInvite CreateInvite_CreateInvite "json:\"createInvite\" graphql:\"createInvite\"" +} + +func (t *CreateInvite) GetCreateInvite() *CreateInvite_CreateInvite { + if t == nil { + t = &CreateInvite{} + } + return &t.CreateInvite +} + +type DeleteInvite struct { + DeleteInvite DeleteInvite_DeleteInvite "json:\"deleteInvite\" graphql:\"deleteInvite\"" +} + +func (t *DeleteInvite) GetDeleteInvite() *DeleteInvite_DeleteInvite { + if t == nil { + t = &DeleteInvite{} + } + return &t.DeleteInvite +} + +type GetInviteByID struct { + Invite GetInviteByID_Invite "json:\"invite\" graphql:\"invite\"" +} + +func (t *GetInviteByID) GetInvite() *GetInviteByID_Invite { + if t == nil { + t = &GetInviteByID{} + } + return &t.Invite +} + +type GetAllInvites struct { + Invites GetAllInvites_Invites "json:\"invites\" graphql:\"invites\"" +} + +func (t *GetAllInvites) GetInvites() *GetAllInvites_Invites { + if t == nil { + t = &GetAllInvites{} + } + return &t.Invites +} + +type InvitesByOrgID struct { + Invites InvitesByOrgID_Invites "json:\"invites\" graphql:\"invites\"" +} + +func (t *InvitesByOrgID) GetInvites() *InvitesByOrgID_Invites { + if t == nil { + t = &InvitesByOrgID{} + } + return &t.Invites +} + +type GetAllNoteHistories struct { + NoteHistories GetAllNoteHistories_NoteHistories "json:\"noteHistories\" graphql:\"noteHistories\"" +} + +func (t *GetAllNoteHistories) GetNoteHistories() *GetAllNoteHistories_NoteHistories { + if t == nil { + t = &GetAllNoteHistories{} + } + return &t.NoteHistories +} + +type GetNoteHistories struct { + NoteHistories GetNoteHistories_NoteHistories "json:\"noteHistories\" graphql:\"noteHistories\"" +} + +func (t *GetNoteHistories) GetNoteHistories() *GetNoteHistories_NoteHistories { + if t == nil { + t = &GetNoteHistories{} + } + return &t.NoteHistories +} + +type GetAllOauthProviderHistories struct { + OauthProviderHistories GetAllOauthProviderHistories_OauthProviderHistories "json:\"oauthProviderHistories\" graphql:\"oauthProviderHistories\"" +} + +func (t *GetAllOauthProviderHistories) GetOauthProviderHistories() *GetAllOauthProviderHistories_OauthProviderHistories { + if t == nil { + t = &GetAllOauthProviderHistories{} + } + return &t.OauthProviderHistories +} + +type GetOauthProviderHistories struct { + OauthProviderHistories GetOauthProviderHistories_OauthProviderHistories "json:\"oauthProviderHistories\" graphql:\"oauthProviderHistories\"" +} + +func (t *GetOauthProviderHistories) GetOauthProviderHistories() *GetOauthProviderHistories_OauthProviderHistories { + if t == nil { + t = &GetOauthProviderHistories{} + } + return &t.OauthProviderHistories +} + +type CreateBulkCSVOhAuthTooToken struct { + CreateBulkCSVOhAuthTooToken CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken "json:\"createBulkCSVOhAuthTooToken\" graphql:\"createBulkCSVOhAuthTooToken\"" +} + +func (t *CreateBulkCSVOhAuthTooToken) GetCreateBulkCSVOhAuthTooToken() *CreateBulkCSVOhAuthTooToken_CreateBulkCSVOhAuthTooToken { + if t == nil { + t = &CreateBulkCSVOhAuthTooToken{} + } + return &t.CreateBulkCSVOhAuthTooToken +} + +type CreateBulkOhAuthTooToken struct { + CreateBulkOhAuthTooToken CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken "json:\"createBulkOhAuthTooToken\" graphql:\"createBulkOhAuthTooToken\"" +} + +func (t *CreateBulkOhAuthTooToken) GetCreateBulkOhAuthTooToken() *CreateBulkOhAuthTooToken_CreateBulkOhAuthTooToken { + if t == nil { + t = &CreateBulkOhAuthTooToken{} + } + return &t.CreateBulkOhAuthTooToken +} + +type CreateOhAuthTooToken struct { + CreateOhAuthTooToken CreateOhAuthTooToken_CreateOhAuthTooToken "json:\"createOhAuthTooToken\" graphql:\"createOhAuthTooToken\"" +} + +func (t *CreateOhAuthTooToken) GetCreateOhAuthTooToken() *CreateOhAuthTooToken_CreateOhAuthTooToken { + if t == nil { + t = &CreateOhAuthTooToken{} + } + return &t.CreateOhAuthTooToken +} + +type DeleteOhAuthTooToken struct { + DeleteOhAuthTooToken DeleteOhAuthTooToken_DeleteOhAuthTooToken "json:\"deleteOhAuthTooToken\" graphql:\"deleteOhAuthTooToken\"" +} + +func (t *DeleteOhAuthTooToken) GetDeleteOhAuthTooToken() *DeleteOhAuthTooToken_DeleteOhAuthTooToken { + if t == nil { + t = &DeleteOhAuthTooToken{} + } + return &t.DeleteOhAuthTooToken +} + +type GetOhAuthTooTokens struct { + OhAuthTooTokens GetOhAuthTooTokens_OhAuthTooTokens "json:\"ohAuthTooTokens\" graphql:\"ohAuthTooTokens\"" +} + +func (t *GetOhAuthTooTokens) GetOhAuthTooTokens() *GetOhAuthTooTokens_OhAuthTooTokens { + if t == nil { + t = &GetOhAuthTooTokens{} + } + return &t.OhAuthTooTokens +} + +type UpdateOhAuthTooToken struct { + UpdateOhAuthTooToken UpdateOhAuthTooToken_UpdateOhAuthTooToken "json:\"updateOhAuthTooToken\" graphql:\"updateOhAuthTooToken\"" +} + +func (t *UpdateOhAuthTooToken) GetUpdateOhAuthTooToken() *UpdateOhAuthTooToken_UpdateOhAuthTooToken { + if t == nil { + t = &UpdateOhAuthTooToken{} + } + return &t.UpdateOhAuthTooToken +} + +type CreateBulkCSVOrganization struct { + CreateBulkCSVOrganization CreateBulkCSVOrganization_CreateBulkCSVOrganization "json:\"createBulkCSVOrganization\" graphql:\"createBulkCSVOrganization\"" +} + +func (t *CreateBulkCSVOrganization) GetCreateBulkCSVOrganization() *CreateBulkCSVOrganization_CreateBulkCSVOrganization { + if t == nil { + t = &CreateBulkCSVOrganization{} + } + return &t.CreateBulkCSVOrganization +} + +type CreateBulkOrganization struct { + CreateBulkOrganization CreateBulkOrganization_CreateBulkOrganization "json:\"createBulkOrganization\" graphql:\"createBulkOrganization\"" +} + +func (t *CreateBulkOrganization) GetCreateBulkOrganization() *CreateBulkOrganization_CreateBulkOrganization { + if t == nil { + t = &CreateBulkOrganization{} + } + return &t.CreateBulkOrganization +} + +type CreateOrganization struct { + CreateOrganization CreateOrganization_CreateOrganization "json:\"createOrganization\" graphql:\"createOrganization\"" +} + +func (t *CreateOrganization) GetCreateOrganization() *CreateOrganization_CreateOrganization { + if t == nil { + t = &CreateOrganization{} + } + return &t.CreateOrganization +} + +type DeleteOrganization struct { + DeleteOrganization DeleteOrganization_DeleteOrganization "json:\"deleteOrganization\" graphql:\"deleteOrganization\"" +} + +func (t *DeleteOrganization) GetDeleteOrganization() *DeleteOrganization_DeleteOrganization { + if t == nil { + t = &DeleteOrganization{} + } + return &t.DeleteOrganization +} + +type GetAllOrganizations struct { + Organizations GetAllOrganizations_Organizations "json:\"organizations\" graphql:\"organizations\"" +} + +func (t *GetAllOrganizations) GetOrganizations() *GetAllOrganizations_Organizations { + if t == nil { + t = &GetAllOrganizations{} + } + return &t.Organizations +} + +type GetOrganizationByID struct { + Organization GetOrganizationByID_Organization "json:\"organization\" graphql:\"organization\"" +} + +func (t *GetOrganizationByID) GetOrganization() *GetOrganizationByID_Organization { + if t == nil { + t = &GetOrganizationByID{} + } + return &t.Organization +} + +type GetOrganizations struct { + Organizations GetOrganizations_Organizations "json:\"organizations\" graphql:\"organizations\"" +} + +func (t *GetOrganizations) GetOrganizations() *GetOrganizations_Organizations { + if t == nil { + t = &GetOrganizations{} + } + return &t.Organizations +} + +type UpdateOrganization struct { + UpdateOrganization UpdateOrganization_UpdateOrganization "json:\"updateOrganization\" graphql:\"updateOrganization\"" +} + +func (t *UpdateOrganization) GetUpdateOrganization() *UpdateOrganization_UpdateOrganization { + if t == nil { + t = &UpdateOrganization{} + } + return &t.UpdateOrganization +} + +type GetAllOrganizationHistories struct { + OrganizationHistories GetAllOrganizationHistories_OrganizationHistories "json:\"organizationHistories\" graphql:\"organizationHistories\"" +} + +func (t *GetAllOrganizationHistories) GetOrganizationHistories() *GetAllOrganizationHistories_OrganizationHistories { + if t == nil { + t = &GetAllOrganizationHistories{} + } + return &t.OrganizationHistories +} + +type GetOrganizationHistories struct { + OrganizationHistories GetOrganizationHistories_OrganizationHistories "json:\"organizationHistories\" graphql:\"organizationHistories\"" +} + +func (t *GetOrganizationHistories) GetOrganizationHistories() *GetOrganizationHistories_OrganizationHistories { + if t == nil { + t = &GetOrganizationHistories{} + } + return &t.OrganizationHistories +} + +type GetAllOrganizationSettings struct { + OrganizationSettings GetAllOrganizationSettings_OrganizationSettings "json:\"organizationSettings\" graphql:\"organizationSettings\"" +} + +func (t *GetAllOrganizationSettings) GetOrganizationSettings() *GetAllOrganizationSettings_OrganizationSettings { + if t == nil { + t = &GetAllOrganizationSettings{} + } + return &t.OrganizationSettings +} + +type GetOrganizationSettingByID struct { + OrganizationSetting GetOrganizationSettingByID_OrganizationSetting "json:\"organizationSetting\" graphql:\"organizationSetting\"" +} + +func (t *GetOrganizationSettingByID) GetOrganizationSetting() *GetOrganizationSettingByID_OrganizationSetting { + if t == nil { + t = &GetOrganizationSettingByID{} + } + return &t.OrganizationSetting +} + +type GetOrganizationSettings struct { + OrganizationSettings GetOrganizationSettings_OrganizationSettings "json:\"organizationSettings\" graphql:\"organizationSettings\"" +} + +func (t *GetOrganizationSettings) GetOrganizationSettings() *GetOrganizationSettings_OrganizationSettings { + if t == nil { + t = &GetOrganizationSettings{} + } + return &t.OrganizationSettings +} + +type UpdateOrganizationSetting struct { + UpdateOrganizationSetting UpdateOrganizationSetting_UpdateOrganizationSetting "json:\"updateOrganizationSetting\" graphql:\"updateOrganizationSetting\"" +} + +func (t *UpdateOrganizationSetting) GetUpdateOrganizationSetting() *UpdateOrganizationSetting_UpdateOrganizationSetting { + if t == nil { + t = &UpdateOrganizationSetting{} + } + return &t.UpdateOrganizationSetting +} + +type GetAllOrganizationSettingHistories struct { + OrganizationSettingHistories GetAllOrganizationSettingHistories_OrganizationSettingHistories "json:\"organizationSettingHistories\" graphql:\"organizationSettingHistories\"" +} + +func (t *GetAllOrganizationSettingHistories) GetOrganizationSettingHistories() *GetAllOrganizationSettingHistories_OrganizationSettingHistories { + if t == nil { + t = &GetAllOrganizationSettingHistories{} + } + return &t.OrganizationSettingHistories +} + +type GetOrganizationSettingHistories struct { + OrganizationSettingHistories GetOrganizationSettingHistories_OrganizationSettingHistories "json:\"organizationSettingHistories\" graphql:\"organizationSettingHistories\"" +} + +func (t *GetOrganizationSettingHistories) GetOrganizationSettingHistories() *GetOrganizationSettingHistories_OrganizationSettingHistories { + if t == nil { + t = &GetOrganizationSettingHistories{} + } + return &t.OrganizationSettingHistories +} + +type AddUserToOrgWithRole struct { + CreateOrgMembership AddUserToOrgWithRole_CreateOrgMembership "json:\"createOrgMembership\" graphql:\"createOrgMembership\"" +} + +func (t *AddUserToOrgWithRole) GetCreateOrgMembership() *AddUserToOrgWithRole_CreateOrgMembership { + if t == nil { + t = &AddUserToOrgWithRole{} + } + return &t.CreateOrgMembership +} + +type CreateBulkCSVOrgMembers struct { + CreateBulkCSVOrgMembership CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership "json:\"createBulkCSVOrgMembership\" graphql:\"createBulkCSVOrgMembership\"" +} + +func (t *CreateBulkCSVOrgMembers) GetCreateBulkCSVOrgMembership() *CreateBulkCSVOrgMembers_CreateBulkCSVOrgMembership { + if t == nil { + t = &CreateBulkCSVOrgMembers{} + } + return &t.CreateBulkCSVOrgMembership +} + +type CreateBulkOrgMembers struct { + CreateBulkOrgMembership CreateBulkOrgMembers_CreateBulkOrgMembership "json:\"createBulkOrgMembership\" graphql:\"createBulkOrgMembership\"" +} + +func (t *CreateBulkOrgMembers) GetCreateBulkOrgMembership() *CreateBulkOrgMembers_CreateBulkOrgMembership { + if t == nil { + t = &CreateBulkOrgMembers{} + } + return &t.CreateBulkOrgMembership +} + +type GetOrgMembersByOrgID struct { + OrgMemberships GetOrgMembersByOrgID_OrgMemberships "json:\"orgMemberships\" graphql:\"orgMemberships\"" +} + +func (t *GetOrgMembersByOrgID) GetOrgMemberships() *GetOrgMembersByOrgID_OrgMemberships { + if t == nil { + t = &GetOrgMembersByOrgID{} + } + return &t.OrgMemberships +} + +type RemoveUserFromOrg struct { + DeleteOrgMembership RemoveUserFromOrg_DeleteOrgMembership "json:\"deleteOrgMembership\" graphql:\"deleteOrgMembership\"" +} + +func (t *RemoveUserFromOrg) GetDeleteOrgMembership() *RemoveUserFromOrg_DeleteOrgMembership { + if t == nil { + t = &RemoveUserFromOrg{} + } + return &t.DeleteOrgMembership +} + +type UpdateUserRoleInOrg struct { + UpdateOrgMembership UpdateUserRoleInOrg_UpdateOrgMembership "json:\"updateOrgMembership\" graphql:\"updateOrgMembership\"" +} + +func (t *UpdateUserRoleInOrg) GetUpdateOrgMembership() *UpdateUserRoleInOrg_UpdateOrgMembership { + if t == nil { + t = &UpdateUserRoleInOrg{} + } + return &t.UpdateOrgMembership +} + +type GetAllOrgMembershipHistories struct { + OrgMembershipHistories GetAllOrgMembershipHistories_OrgMembershipHistories "json:\"orgMembershipHistories\" graphql:\"orgMembershipHistories\"" +} + +func (t *GetAllOrgMembershipHistories) GetOrgMembershipHistories() *GetAllOrgMembershipHistories_OrgMembershipHistories { + if t == nil { + t = &GetAllOrgMembershipHistories{} + } + return &t.OrgMembershipHistories +} + +type GetOrgMembershipHistories struct { + OrgMembershipHistories GetOrgMembershipHistories_OrgMembershipHistories "json:\"orgMembershipHistories\" graphql:\"orgMembershipHistories\"" +} + +func (t *GetOrgMembershipHistories) GetOrgMembershipHistories() *GetOrgMembershipHistories_OrgMembershipHistories { + if t == nil { + t = &GetOrgMembershipHistories{} + } + return &t.OrgMembershipHistories +} + +type CreateBulkCSVPersonalAccessToken struct { + CreateBulkCSVPersonalAccessToken CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken "json:\"createBulkCSVPersonalAccessToken\" graphql:\"createBulkCSVPersonalAccessToken\"" +} + +func (t *CreateBulkCSVPersonalAccessToken) GetCreateBulkCSVPersonalAccessToken() *CreateBulkCSVPersonalAccessToken_CreateBulkCSVPersonalAccessToken { + if t == nil { + t = &CreateBulkCSVPersonalAccessToken{} + } + return &t.CreateBulkCSVPersonalAccessToken +} + +type CreateBulkPersonalAccessToken struct { + CreateBulkPersonalAccessToken CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken "json:\"createBulkPersonalAccessToken\" graphql:\"createBulkPersonalAccessToken\"" +} + +func (t *CreateBulkPersonalAccessToken) GetCreateBulkPersonalAccessToken() *CreateBulkPersonalAccessToken_CreateBulkPersonalAccessToken { + if t == nil { + t = &CreateBulkPersonalAccessToken{} + } + return &t.CreateBulkPersonalAccessToken +} + +type CreatePersonalAccessToken struct { + CreatePersonalAccessToken CreatePersonalAccessToken_CreatePersonalAccessToken "json:\"createPersonalAccessToken\" graphql:\"createPersonalAccessToken\"" +} + +func (t *CreatePersonalAccessToken) GetCreatePersonalAccessToken() *CreatePersonalAccessToken_CreatePersonalAccessToken { + if t == nil { + t = &CreatePersonalAccessToken{} + } + return &t.CreatePersonalAccessToken +} + +type DeletePersonalAccessToken struct { + DeletePersonalAccessToken DeletePersonalAccessToken_DeletePersonalAccessToken "json:\"deletePersonalAccessToken\" graphql:\"deletePersonalAccessToken\"" +} + +func (t *DeletePersonalAccessToken) GetDeletePersonalAccessToken() *DeletePersonalAccessToken_DeletePersonalAccessToken { + if t == nil { + t = &DeletePersonalAccessToken{} + } + return &t.DeletePersonalAccessToken +} + +type GetAllPersonalAccessTokens struct { + PersonalAccessTokens GetAllPersonalAccessTokens_PersonalAccessTokens "json:\"personalAccessTokens\" graphql:\"personalAccessTokens\"" +} + +func (t *GetAllPersonalAccessTokens) GetPersonalAccessTokens() *GetAllPersonalAccessTokens_PersonalAccessTokens { + if t == nil { + t = &GetAllPersonalAccessTokens{} + } + return &t.PersonalAccessTokens +} + +type GetPersonalAccessTokenByID struct { + PersonalAccessToken GetPersonalAccessTokenByID_PersonalAccessToken "json:\"personalAccessToken\" graphql:\"personalAccessToken\"" +} + +func (t *GetPersonalAccessTokenByID) GetPersonalAccessToken() *GetPersonalAccessTokenByID_PersonalAccessToken { + if t == nil { + t = &GetPersonalAccessTokenByID{} + } + return &t.PersonalAccessToken +} + +type UpdatePersonalAccessToken struct { + UpdatePersonalAccessToken UpdatePersonalAccessToken_UpdatePersonalAccessToken "json:\"updatePersonalAccessToken\" graphql:\"updatePersonalAccessToken\"" +} + +func (t *UpdatePersonalAccessToken) GetUpdatePersonalAccessToken() *UpdatePersonalAccessToken_UpdatePersonalAccessToken { + if t == nil { + t = &UpdatePersonalAccessToken{} + } + return &t.UpdatePersonalAccessToken +} + +type Search struct { + Search *Search_Search "json:\"search,omitempty\" graphql:\"search\"" +} + +func (t *Search) GetSearch() *Search_Search { + if t == nil { + t = &Search{} + } + return t.Search +} + +type CreateBulkCSVSubscriber struct { + CreateBulkCSVSubscriber CreateBulkCSVSubscriber_CreateBulkCSVSubscriber "json:\"createBulkCSVSubscriber\" graphql:\"createBulkCSVSubscriber\"" +} + +func (t *CreateBulkCSVSubscriber) GetCreateBulkCSVSubscriber() *CreateBulkCSVSubscriber_CreateBulkCSVSubscriber { + if t == nil { + t = &CreateBulkCSVSubscriber{} + } + return &t.CreateBulkCSVSubscriber +} + +type CreateBulkSubscriber struct { + CreateBulkSubscriber CreateBulkSubscriber_CreateBulkSubscriber "json:\"createBulkSubscriber\" graphql:\"createBulkSubscriber\"" +} + +func (t *CreateBulkSubscriber) GetCreateBulkSubscriber() *CreateBulkSubscriber_CreateBulkSubscriber { + if t == nil { + t = &CreateBulkSubscriber{} + } + return &t.CreateBulkSubscriber +} + +type CreateSubscriber struct { + CreateSubscriber CreateSubscriber_CreateSubscriber "json:\"createSubscriber\" graphql:\"createSubscriber\"" +} + +func (t *CreateSubscriber) GetCreateSubscriber() *CreateSubscriber_CreateSubscriber { + if t == nil { + t = &CreateSubscriber{} + } + return &t.CreateSubscriber +} + +type DeleteSubscriber struct { + DeleteSubscriber DeleteSubscriber_DeleteSubscriber "json:\"deleteSubscriber\" graphql:\"deleteSubscriber\"" +} + +func (t *DeleteSubscriber) GetDeleteSubscriber() *DeleteSubscriber_DeleteSubscriber { + if t == nil { + t = &DeleteSubscriber{} + } + return &t.DeleteSubscriber +} + +type GetAllSubscribers struct { + Subscribers GetAllSubscribers_Subscribers "json:\"subscribers\" graphql:\"subscribers\"" +} + +func (t *GetAllSubscribers) GetSubscribers() *GetAllSubscribers_Subscribers { + if t == nil { + t = &GetAllSubscribers{} + } + return &t.Subscribers +} + +type GetSubscriberByEmail struct { + Subscriber GetSubscriberByEmail_Subscriber "json:\"subscriber\" graphql:\"subscriber\"" +} + +func (t *GetSubscriberByEmail) GetSubscriber() *GetSubscriberByEmail_Subscriber { + if t == nil { + t = &GetSubscriberByEmail{} + } + return &t.Subscriber +} + +type GetSubscribers struct { + Subscribers GetSubscribers_Subscribers "json:\"subscribers\" graphql:\"subscribers\"" +} + +func (t *GetSubscribers) GetSubscribers() *GetSubscribers_Subscribers { + if t == nil { + t = &GetSubscribers{} + } + return &t.Subscribers +} + +type UpdateSubscriber struct { + UpdateSubscriber UpdateSubscriber_UpdateSubscriber "json:\"updateSubscriber\" graphql:\"updateSubscriber\"" +} + +func (t *UpdateSubscriber) GetUpdateSubscriber() *UpdateSubscriber_UpdateSubscriber { + if t == nil { + t = &UpdateSubscriber{} + } + return &t.UpdateSubscriber +} + +type CreateBulkCSVTemplate struct { + CreateBulkCSVTemplate CreateBulkCSVTemplate_CreateBulkCSVTemplate "json:\"createBulkCSVTemplate\" graphql:\"createBulkCSVTemplate\"" +} + +func (t *CreateBulkCSVTemplate) GetCreateBulkCSVTemplate() *CreateBulkCSVTemplate_CreateBulkCSVTemplate { + if t == nil { + t = &CreateBulkCSVTemplate{} + } + return &t.CreateBulkCSVTemplate +} + +type CreateBulkTemplate struct { + CreateBulkTemplate CreateBulkTemplate_CreateBulkTemplate "json:\"createBulkTemplate\" graphql:\"createBulkTemplate\"" +} + +func (t *CreateBulkTemplate) GetCreateBulkTemplate() *CreateBulkTemplate_CreateBulkTemplate { + if t == nil { + t = &CreateBulkTemplate{} + } + return &t.CreateBulkTemplate +} + +type CreateTemplate struct { + CreateTemplate CreateTemplate_CreateTemplate "json:\"createTemplate\" graphql:\"createTemplate\"" +} + +func (t *CreateTemplate) GetCreateTemplate() *CreateTemplate_CreateTemplate { + if t == nil { + t = &CreateTemplate{} + } + return &t.CreateTemplate +} + +type GetAllTemplates struct { + Templates GetAllTemplates_Templates "json:\"templates\" graphql:\"templates\"" +} + +func (t *GetAllTemplates) GetTemplates() *GetAllTemplates_Templates { + if t == nil { + t = &GetAllTemplates{} + } + return &t.Templates +} + +type GetTemplateByID struct { + Template GetTemplateByID_Template "json:\"template\" graphql:\"template\"" +} + +func (t *GetTemplateByID) GetTemplate() *GetTemplateByID_Template { + if t == nil { + t = &GetTemplateByID{} + } + return &t.Template +} + +type UpdateTemplate struct { + UpdateTemplate UpdateTemplate_UpdateTemplate "json:\"updateTemplate\" graphql:\"updateTemplate\"" +} + +func (t *UpdateTemplate) GetUpdateTemplate() *UpdateTemplate_UpdateTemplate { + if t == nil { + t = &UpdateTemplate{} + } + return &t.UpdateTemplate +} + +type GetAllTemplateHistories struct { + TemplateHistories GetAllTemplateHistories_TemplateHistories "json:\"templateHistories\" graphql:\"templateHistories\"" +} + +func (t *GetAllTemplateHistories) GetTemplateHistories() *GetAllTemplateHistories_TemplateHistories { + if t == nil { + t = &GetAllTemplateHistories{} + } + return &t.TemplateHistories +} + +type GetTemplateHistories struct { + TemplateHistories GetTemplateHistories_TemplateHistories "json:\"templateHistories\" graphql:\"templateHistories\"" +} + +func (t *GetTemplateHistories) GetTemplateHistories() *GetTemplateHistories_TemplateHistories { + if t == nil { + t = &GetTemplateHistories{} + } + return &t.TemplateHistories +} + +type CreateTFASetting struct { + CreateTFASetting CreateTFASetting_CreateTFASetting "json:\"createTFASetting\" graphql:\"createTFASetting\"" +} + +func (t *CreateTFASetting) GetCreateTFASetting() *CreateTFASetting_CreateTFASetting { + if t == nil { + t = &CreateTFASetting{} + } + return &t.CreateTFASetting +} + +type GetAllTFASettings struct { + TfaSettings GetAllTFASettings_TfaSettings "json:\"tfaSettings\" graphql:\"tfaSettings\"" +} + +func (t *GetAllTFASettings) GetTfaSettings() *GetAllTFASettings_TfaSettings { + if t == nil { + t = &GetAllTFASettings{} + } + return &t.TfaSettings +} + +type GetTFASetting struct { + TfaSetting GetTFASetting_TfaSetting "json:\"tfaSetting\" graphql:\"tfaSetting\"" +} + +func (t *GetTFASetting) GetTfaSetting() *GetTFASetting_TfaSetting { + if t == nil { + t = &GetTFASetting{} + } + return &t.TfaSetting +} + +type UpdateTFASetting struct { + UpdateTFASetting UpdateTFASetting_UpdateTFASetting "json:\"updateTFASetting\" graphql:\"updateTFASetting\"" +} + +func (t *UpdateTFASetting) GetUpdateTFASetting() *UpdateTFASetting_UpdateTFASetting { + if t == nil { + t = &UpdateTFASetting{} + } + return &t.UpdateTFASetting +} + +type CreateUser struct { + CreateUser CreateUser_CreateUser "json:\"createUser\" graphql:\"createUser\"" +} + +func (t *CreateUser) GetCreateUser() *CreateUser_CreateUser { + if t == nil { + t = &CreateUser{} + } + return &t.CreateUser +} + +type DeleteUser struct { + DeleteUser DeleteUser_DeleteUser "json:\"deleteUser\" graphql:\"deleteUser\"" +} + +func (t *DeleteUser) GetDeleteUser() *DeleteUser_DeleteUser { + if t == nil { + t = &DeleteUser{} + } + return &t.DeleteUser +} + +type GetAllUsers struct { + Users GetAllUsers_Users "json:\"users\" graphql:\"users\"" +} + +func (t *GetAllUsers) GetUsers() *GetAllUsers_Users { + if t == nil { + t = &GetAllUsers{} + } + return &t.Users +} + +type GetUserByID struct { + User GetUserByID_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetUserByID) GetUser() *GetUserByID_User { + if t == nil { + t = &GetUserByID{} + } + return &t.User +} + +type GetUserByIDWithOrgs struct { + User GetUserByIDWithOrgs_User "json:\"user\" graphql:\"user\"" +} + +func (t *GetUserByIDWithOrgs) GetUser() *GetUserByIDWithOrgs_User { + if t == nil { + t = &GetUserByIDWithOrgs{} + } + return &t.User +} + +type UpdateUser struct { + UpdateUser UpdateUser_UpdateUser "json:\"updateUser\" graphql:\"updateUser\"" +} + +func (t *UpdateUser) GetUpdateUser() *UpdateUser_UpdateUser { + if t == nil { + t = &UpdateUser{} + } + return &t.UpdateUser +} + +type GetAllUserHistories struct { + UserHistories GetAllUserHistories_UserHistories "json:\"userHistories\" graphql:\"userHistories\"" +} + +func (t *GetAllUserHistories) GetUserHistories() *GetAllUserHistories_UserHistories { + if t == nil { + t = &GetAllUserHistories{} + } + return &t.UserHistories +} + +type GetUserHistories struct { + UserHistories GetUserHistories_UserHistories "json:\"userHistories\" graphql:\"userHistories\"" +} + +func (t *GetUserHistories) GetUserHistories() *GetUserHistories_UserHistories { + if t == nil { + t = &GetUserHistories{} + } + return &t.UserHistories +} + +type GetAllUserSettings struct { + UserSettings GetAllUserSettings_UserSettings "json:\"userSettings\" graphql:\"userSettings\"" +} + +func (t *GetAllUserSettings) GetUserSettings() *GetAllUserSettings_UserSettings { + if t == nil { + t = &GetAllUserSettings{} + } + return &t.UserSettings +} + +type GetUserSettingByID struct { + UserSetting GetUserSettingByID_UserSetting "json:\"userSetting\" graphql:\"userSetting\"" +} + +func (t *GetUserSettingByID) GetUserSetting() *GetUserSettingByID_UserSetting { + if t == nil { + t = &GetUserSettingByID{} + } + return &t.UserSetting +} + +type GetUserSettings struct { + UserSettings GetUserSettings_UserSettings "json:\"userSettings\" graphql:\"userSettings\"" +} + +func (t *GetUserSettings) GetUserSettings() *GetUserSettings_UserSettings { + if t == nil { + t = &GetUserSettings{} + } + return &t.UserSettings +} + +type UpdateUserSetting struct { + UpdateUserSetting UpdateUserSetting_UpdateUserSetting "json:\"updateUserSetting\" graphql:\"updateUserSetting\"" +} + +func (t *UpdateUserSetting) GetUpdateUserSetting() *UpdateUserSetting_UpdateUserSetting { + if t == nil { + t = &UpdateUserSetting{} + } + return &t.UpdateUserSetting +} + +type GetAllUserSettingHistories struct { + UserSettingHistories GetAllUserSettingHistories_UserSettingHistories "json:\"userSettingHistories\" graphql:\"userSettingHistories\"" +} + +func (t *GetAllUserSettingHistories) GetUserSettingHistories() *GetAllUserSettingHistories_UserSettingHistories { + if t == nil { + t = &GetAllUserSettingHistories{} + } + return &t.UserSettingHistories +} + +type GetUserSettingHistories struct { + UserSettingHistories GetUserSettingHistories_UserSettingHistories "json:\"userSettingHistories\" graphql:\"userSettingHistories\"" +} + +func (t *GetUserSettingHistories) GetUserSettingHistories() *GetUserSettingHistories_UserSettingHistories { + if t == nil { + t = &GetUserSettingHistories{} + } + return &t.UserSettingHistories +} + +type GetWebhookByID struct { + Webhook GetWebhookByID_Webhook "json:\"webhook\" graphql:\"webhook\"" +} + +func (t *GetWebhookByID) GetWebhook() *GetWebhookByID_Webhook { + if t == nil { + t = &GetWebhookByID{} + } + return &t.Webhook +} + +type GetAllWebhooks struct { + Webhooks GetAllWebhooks_Webhooks "json:\"webhooks\" graphql:\"webhooks\"" +} + +func (t *GetAllWebhooks) GetWebhooks() *GetAllWebhooks_Webhooks { + if t == nil { + t = &GetAllWebhooks{} + } + return &t.Webhooks +} + +type CreateWebhook struct { + CreateWebhook CreateWebhook_CreateWebhook "json:\"createWebhook\" graphql:\"createWebhook\"" +} + +func (t *CreateWebhook) GetCreateWebhook() *CreateWebhook_CreateWebhook { + if t == nil { + t = &CreateWebhook{} + } + return &t.CreateWebhook +} + +type CreateBulkWebhook struct { + CreateBulkWebhook CreateBulkWebhook_CreateBulkWebhook "json:\"createBulkWebhook\" graphql:\"createBulkWebhook\"" +} + +func (t *CreateBulkWebhook) GetCreateBulkWebhook() *CreateBulkWebhook_CreateBulkWebhook { + if t == nil { + t = &CreateBulkWebhook{} + } + return &t.CreateBulkWebhook +} + +type CreateBulkCSVWebhook struct { + CreateBulkCSVWebhook CreateBulkCSVWebhook_CreateBulkCSVWebhook "json:\"createBulkCSVWebhook\" graphql:\"createBulkCSVWebhook\"" +} + +func (t *CreateBulkCSVWebhook) GetCreateBulkCSVWebhook() *CreateBulkCSVWebhook_CreateBulkCSVWebhook { + if t == nil { + t = &CreateBulkCSVWebhook{} + } + return &t.CreateBulkCSVWebhook +} + +type UpdateWebhook struct { + UpdateWebhook UpdateWebhook_UpdateWebhook "json:\"updateWebhook\" graphql:\"updateWebhook\"" +} + +func (t *UpdateWebhook) GetUpdateWebhook() *UpdateWebhook_UpdateWebhook { + if t == nil { + t = &UpdateWebhook{} + } + return &t.UpdateWebhook +} + +type DeleteWebhook struct { + DeleteWebhook DeleteWebhook_DeleteWebhook "json:\"deleteWebhook\" graphql:\"deleteWebhook\"" +} + +func (t *DeleteWebhook) GetDeleteWebhook() *DeleteWebhook_DeleteWebhook { + if t == nil { + t = &DeleteWebhook{} + } + return &t.DeleteWebhook +} + +type GetAllWebhookHistories struct { + WebhookHistories GetAllWebhookHistories_WebhookHistories "json:\"webhookHistories\" graphql:\"webhookHistories\"" +} + +func (t *GetAllWebhookHistories) GetWebhookHistories() *GetAllWebhookHistories_WebhookHistories { + if t == nil { + t = &GetAllWebhookHistories{} + } + return &t.WebhookHistories +} + +type GetWebhookHistories struct { + WebhookHistories GetWebhookHistories_WebhookHistories "json:\"webhookHistories\" graphql:\"webhookHistories\"" +} + +func (t *GetWebhookHistories) GetWebhookHistories() *GetWebhookHistories_WebhookHistories { + if t == nil { + t = &GetWebhookHistories{} + } + return &t.WebhookHistories +} + +const CreateAPITokenDocument = `mutation CreateAPIToken ($input: CreateAPITokenInput!) { + createAPIToken(input: $input) { + apiToken { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } +} +` + +func (c *Client) CreateAPIToken(ctx context.Context, input CreateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateAPIToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateAPIToken + if err := c.Client.Post(ctx, "CreateAPIToken", CreateAPITokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateAPITokenDocument = `mutation UpdateAPIToken ($updateAPITokenId: ID!, $input: UpdateAPITokenInput!) { + updateAPIToken(id: $updateAPITokenId, input: $input) { + apiToken { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } +} +` + +func (c *Client) UpdateAPIToken(ctx context.Context, updateAPITokenID string, input UpdateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateAPIToken, error) { + vars := map[string]any{ + "updateAPITokenId": updateAPITokenID, + "input": input, + } + + var res UpdateAPIToken + if err := c.Client.Post(ctx, "UpdateAPIToken", UpdateAPITokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllAPITokensDocument = `query GetAllAPITokens { + apiTokens { + edges { + node { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } + } +} +` + +func (c *Client) GetAllAPITokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllAPITokens, error) { + vars := map[string]any{} + + var res GetAllAPITokens + if err := c.Client.Post(ctx, "GetAllAPITokens", GetAllAPITokensDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAPITokenByIDDocument = `query GetAPITokenByID ($apiTokenId: ID!) { + apiToken(id: $apiTokenId) { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } +} +` + +func (c *Client) GetAPITokenByID(ctx context.Context, apiTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetAPITokenByID, error) { + vars := map[string]any{ + "apiTokenId": apiTokenID, + } + + var res GetAPITokenByID + if err := c.Client.Post(ctx, "GetAPITokenByID", GetAPITokenByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteAPITokenDocument = `mutation DeleteAPIToken ($deleteAPITokenId: ID!) { + deleteAPIToken(id: $deleteAPITokenId) { + deletedID + } +} +` + +func (c *Client) DeleteAPIToken(ctx context.Context, deleteAPITokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteAPIToken, error) { + vars := map[string]any{ + "deleteAPITokenId": deleteAPITokenID, + } + + var res DeleteAPIToken + if err := c.Client.Post(ctx, "DeleteAPIToken", DeleteAPITokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVContactDocument = `mutation CreateBulkCSVContact ($input: Upload!) { + createBulkCSVContact(input: $input) { + contacts { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkCSVContact(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVContact, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVContact + if err := c.Client.Post(ctx, "CreateBulkCSVContact", CreateBulkCSVContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkContactDocument = `mutation CreateBulkContact ($input: [CreateContactInput!]) { + createBulkContact(input: $input) { + contacts { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkContact(ctx context.Context, input []*CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkContact, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkContact + if err := c.Client.Post(ctx, "CreateBulkContact", CreateBulkContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateContactDocument = `mutation CreateContact ($input: CreateContactInput!) { + createContact(input: $input) { + contact { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateContact(ctx context.Context, input CreateContactInput, interceptors ...clientv2.RequestInterceptor) (*CreateContact, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateContact + if err := c.Client.Post(ctx, "CreateContact", CreateContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteContactDocument = `mutation DeleteContact ($deleteContactId: ID!) { + deleteContact(id: $deleteContactId) { + deletedID + } +} +` + +func (c *Client) DeleteContact(ctx context.Context, deleteContactID string, interceptors ...clientv2.RequestInterceptor) (*DeleteContact, error) { + vars := map[string]any{ + "deleteContactId": deleteContactID, + } + + var res DeleteContact + if err := c.Client.Post(ctx, "DeleteContact", DeleteContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllContactsDocument = `query GetAllContacts { + contacts { + edges { + node { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllContacts(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContacts, error) { + vars := map[string]any{} + + var res GetAllContacts + if err := c.Client.Post(ctx, "GetAllContacts", GetAllContactsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetContactByIDDocument = `query GetContactByID ($contactId: ID!) { + contact(id: $contactId) { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } +} +` + +func (c *Client) GetContactByID(ctx context.Context, contactID string, interceptors ...clientv2.RequestInterceptor) (*GetContactByID, error) { + vars := map[string]any{ + "contactId": contactID, + } + + var res GetContactByID + if err := c.Client.Post(ctx, "GetContactByID", GetContactByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetContactsDocument = `query GetContacts ($where: ContactWhereInput) { + contacts(where: $where) { + edges { + node { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetContacts(ctx context.Context, where *ContactWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContacts, error) { + vars := map[string]any{ + "where": where, + } + + var res GetContacts + if err := c.Client.Post(ctx, "GetContacts", GetContactsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateContactDocument = `mutation UpdateContact ($updateContactId: ID!, $input: UpdateContactInput!) { + updateContact(id: $updateContactId, input: $input) { + contact { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateContact(ctx context.Context, updateContactID string, input UpdateContactInput, interceptors ...clientv2.RequestInterceptor) (*UpdateContact, error) { + vars := map[string]any{ + "updateContactId": updateContactID, + "input": input, + } + + var res UpdateContact + if err := c.Client.Post(ctx, "UpdateContact", UpdateContactDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllContactHistoriesDocument = `query GetAllContactHistories { + contactHistories { + edges { + node { + address + company + createdAt + createdBy + email + fullName + historyTime + id + operation + ownerID + phoneNumber + ref + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllContactHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllContactHistories, error) { + vars := map[string]any{} + + var res GetAllContactHistories + if err := c.Client.Post(ctx, "GetAllContactHistories", GetAllContactHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetContactHistoriesDocument = `query GetContactHistories ($where: ContactHistoryWhereInput) { + contactHistories(where: $where) { + edges { + node { + address + company + createdAt + createdBy + email + fullName + historyTime + id + operation + ownerID + phoneNumber + ref + status + tags + title + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetContactHistories(ctx context.Context, where *ContactHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetContactHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetContactHistories + if err := c.Client.Post(ctx, "GetContactHistories", GetContactHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateDocumentDataDocument = `mutation CreateDocumentData ($input: CreateDocumentDataInput!) { + createDocumentData(input: $input) { + documentData { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateDocumentData(ctx context.Context, input CreateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*CreateDocumentData, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateDocumentData + if err := c.Client.Post(ctx, "CreateDocumentData", CreateDocumentDataDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteDocumentDataDocument = `mutation DeleteDocumentData ($deleteDocumentDataId: ID!) { + deleteDocumentData(id: $deleteDocumentDataId) { + deletedID + } +} +` + +func (c *Client) DeleteDocumentData(ctx context.Context, deleteDocumentDataID string, interceptors ...clientv2.RequestInterceptor) (*DeleteDocumentData, error) { + vars := map[string]any{ + "deleteDocumentDataId": deleteDocumentDataID, + } + + var res DeleteDocumentData + if err := c.Client.Post(ctx, "DeleteDocumentData", DeleteDocumentDataDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetDocumentDataByIDDocument = `query GetDocumentDataByID ($documentDataId: ID!) { + documentData(id: $documentDataId) { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetDocumentDataByID(ctx context.Context, documentDataID string, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataByID, error) { + vars := map[string]any{ + "documentDataId": documentDataID, + } + + var res GetDocumentDataByID + if err := c.Client.Post(ctx, "GetDocumentDataByID", GetDocumentDataByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateDocumentDataDocument = `mutation UpdateDocumentData ($updateDocumentDataId: ID!, $input: UpdateDocumentDataInput!) { + updateDocumentData(id: $updateDocumentDataId, input: $input) { + documentData { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateDocumentData(ctx context.Context, updateDocumentDataID string, input UpdateDocumentDataInput, interceptors ...clientv2.RequestInterceptor) (*UpdateDocumentData, error) { + vars := map[string]any{ + "updateDocumentDataId": updateDocumentDataID, + "input": input, + } + + var res UpdateDocumentData + if err := c.Client.Post(ctx, "UpdateDocumentData", UpdateDocumentDataDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllDocumentDataHistoriesDocument = `query GetAllDocumentDataHistories { + documentDataHistories { + edges { + node { + createdAt + createdBy + data + historyTime + id + operation + ownerID + ref + tags + templateID + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllDocumentDataHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllDocumentDataHistories, error) { + vars := map[string]any{} + + var res GetAllDocumentDataHistories + if err := c.Client.Post(ctx, "GetAllDocumentDataHistories", GetAllDocumentDataHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetDocumentDataHistoriesDocument = `query GetDocumentDataHistories ($where: DocumentDataHistoryWhereInput) { + documentDataHistories(where: $where) { + edges { + node { + createdAt + createdBy + data + historyTime + id + operation + ownerID + ref + tags + templateID + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetDocumentDataHistories(ctx context.Context, where *DocumentDataHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetDocumentDataHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetDocumentDataHistories + if err := c.Client.Post(ctx, "GetDocumentDataHistories", GetDocumentDataHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntitlementDocument = `mutation CreateBulkCSVEntitlement ($input: Upload!) { + createBulkCSVEntitlement(input: $input) { + entitlements { + id + plan { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + organization { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkCSVEntitlement(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlement, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntitlement + if err := c.Client.Post(ctx, "CreateBulkCSVEntitlement", CreateBulkCSVEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntitlementDocument = `mutation CreateBulkEntitlement ($input: [CreateEntitlementInput!]) { + createBulkEntitlement(input: $input) { + entitlements { + id + plan { + id + name + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} +` + +func (c *Client) CreateBulkEntitlement(ctx context.Context, input []*CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlement, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntitlement + if err := c.Client.Post(ctx, "CreateBulkEntitlement", CreateBulkEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntitlementDocument = `mutation CreateEntitlement ($input: CreateEntitlementInput!) { + createEntitlement(input: $input) { + entitlement { + id + plan { + id + name + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} +` + +func (c *Client) CreateEntitlement(ctx context.Context, input CreateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlement, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntitlement + if err := c.Client.Post(ctx, "CreateEntitlement", CreateEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntitlementDocument = `mutation DeleteEntitlement ($deleteEntitlementId: ID!) { + deleteEntitlement(id: $deleteEntitlementId) { + deletedID + } +} +` + +func (c *Client) DeleteEntitlement(ctx context.Context, deleteEntitlementID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlement, error) { + vars := map[string]any{ + "deleteEntitlementId": deleteEntitlementID, + } + + var res DeleteEntitlement + if err := c.Client.Post(ctx, "DeleteEntitlement", DeleteEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementsDocument = `query GetAllEntitlements { + entitlements { + edges { + node { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } + } +} +` + +func (c *Client) GetAllEntitlements(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlements, error) { + vars := map[string]any{} + + var res GetAllEntitlements + if err := c.Client.Post(ctx, "GetAllEntitlements", GetAllEntitlementsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementByIDDocument = `query GetEntitlementByID ($entitlementId: ID!) { + entitlement(id: $entitlementId) { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } +} +` + +func (c *Client) GetEntitlementByID(ctx context.Context, entitlementID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementByID, error) { + vars := map[string]any{ + "entitlementId": entitlementID, + } + + var res GetEntitlementByID + if err := c.Client.Post(ctx, "GetEntitlementByID", GetEntitlementByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementsDocument = `query GetEntitlements ($where: EntitlementWhereInput) { + entitlements(where: $where) { + edges { + node { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } + } +} +` + +func (c *Client) GetEntitlements(ctx context.Context, where *EntitlementWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlements, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlements + if err := c.Client.Post(ctx, "GetEntitlements", GetEntitlementsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntitlementDocument = `mutation UpdateEntitlement ($updateEntitlementId: ID!, $input: UpdateEntitlementInput!) { + updateEntitlement(id: $updateEntitlementId, input: $input) { + entitlement { + id + plan { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} +` + +func (c *Client) UpdateEntitlement(ctx context.Context, updateEntitlementID string, input UpdateEntitlementInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlement, error) { + vars := map[string]any{ + "updateEntitlementId": updateEntitlementID, + "input": input, + } + + var res UpdateEntitlement + if err := c.Client.Post(ctx, "UpdateEntitlement", UpdateEntitlementDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementHistoriesDocument = `query GetAllEntitlementHistories { + entitlementHistories { + edges { + node { + cancelled + createdAt + createdBy + expires + expiresAt + externalCustomerID + externalSubscriptionID + historyTime + id + operation + organizationID + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntitlementHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementHistories, error) { + vars := map[string]any{} + + var res GetAllEntitlementHistories + if err := c.Client.Post(ctx, "GetAllEntitlementHistories", GetAllEntitlementHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementHistoriesDocument = `query GetEntitlementHistories ($where: EntitlementHistoryWhereInput) { + entitlementHistories(where: $where) { + edges { + node { + cancelled + createdAt + createdBy + expires + expiresAt + externalCustomerID + externalSubscriptionID + historyTime + id + operation + organizationID + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntitlementHistories(ctx context.Context, where *EntitlementHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementHistories + if err := c.Client.Post(ctx, "GetEntitlementHistories", GetEntitlementHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntitlementPlanDocument = `mutation CreateBulkCSVEntitlementPlan ($input: Upload!) { + createBulkCSVEntitlementPlan(input: $input) { + entitlementPlans { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) CreateBulkCSVEntitlementPlan(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlan, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntitlementPlan + if err := c.Client.Post(ctx, "CreateBulkCSVEntitlementPlan", CreateBulkCSVEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntitlementPlanDocument = `mutation CreateBulkEntitlementPlan ($input: [CreateEntitlementPlanInput!]) { + createBulkEntitlementPlan(input: $input) { + entitlementPlans { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) CreateBulkEntitlementPlan(ctx context.Context, input []*CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlan, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntitlementPlan + if err := c.Client.Post(ctx, "CreateBulkEntitlementPlan", CreateBulkEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntitlementPlanDocument = `mutation CreateEntitlementPlan ($input: CreateEntitlementPlanInput!) { + createEntitlementPlan(input: $input) { + entitlementPlan { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) CreateEntitlementPlan(ctx context.Context, input CreateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlan, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntitlementPlan + if err := c.Client.Post(ctx, "CreateEntitlementPlan", CreateEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntitlementPlanDocument = `mutation DeleteEntitlementPlan ($deleteEntitlementPlanId: ID!) { + deleteEntitlementPlan(id: $deleteEntitlementPlanId) { + deletedID + } +} +` + +func (c *Client) DeleteEntitlementPlan(ctx context.Context, deleteEntitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlan, error) { + vars := map[string]any{ + "deleteEntitlementPlanId": deleteEntitlementPlanID, + } + + var res DeleteEntitlementPlan + if err := c.Client.Post(ctx, "DeleteEntitlementPlan", DeleteEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlansDocument = `query GetAllEntitlementPlans { + entitlementPlans { + edges { + node { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlans(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlans, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlans + if err := c.Client.Post(ctx, "GetAllEntitlementPlans", GetAllEntitlementPlansDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanByIDDocument = `query GetEntitlementPlanByID ($entitlementPlanId: ID!) { + entitlementPlan(id: $entitlementPlanId) { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } +} +` + +func (c *Client) GetEntitlementPlanByID(ctx context.Context, entitlementPlanID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanByID, error) { + vars := map[string]any{ + "entitlementPlanId": entitlementPlanID, + } + + var res GetEntitlementPlanByID + if err := c.Client.Post(ctx, "GetEntitlementPlanByID", GetEntitlementPlanByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlansDocument = `query GetEntitlementPlans ($where: EntitlementPlanWhereInput) { + entitlementPlans(where: $where) { + edges { + node { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } + } + } +} +` + +func (c *Client) GetEntitlementPlans(ctx context.Context, where *EntitlementPlanWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlans, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlans + if err := c.Client.Post(ctx, "GetEntitlementPlans", GetEntitlementPlansDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntitlementPlanDocument = `mutation UpdateEntitlementPlan ($updateEntitlementPlanId: ID!, $input: UpdateEntitlementPlanInput!) { + updateEntitlementPlan(id: $updateEntitlementPlanId, input: $input) { + entitlementPlan { + id + name + displayName + metadata + tags + version + description + } + } +} +` + +func (c *Client) UpdateEntitlementPlan(ctx context.Context, updateEntitlementPlanID string, input UpdateEntitlementPlanInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlan, error) { + vars := map[string]any{ + "updateEntitlementPlanId": updateEntitlementPlanID, + "input": input, + } + + var res UpdateEntitlementPlan + if err := c.Client.Post(ctx, "UpdateEntitlementPlan", UpdateEntitlementPlanDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlanFeaturesDocument = `query GetAllEntitlementPlanFeatures { + entitlementPlanFeatures { + edges { + node { + id + feature { + id + name + } + metadata + plan { + id + name + } + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlanFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatures, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlanFeatures + if err := c.Client.Post(ctx, "GetAllEntitlementPlanFeatures", GetAllEntitlementPlanFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanFeatureByIDDocument = `query GetEntitlementPlanFeatureByID ($entitlementPlanFeatureId: ID!) { + entitlementPlanFeature(id: $entitlementPlanFeatureId) { + id + metadata + plan { + id + name + } + feature { + id + name + } + } +} +` + +func (c *Client) GetEntitlementPlanFeatureByID(ctx context.Context, entitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureByID, error) { + vars := map[string]any{ + "entitlementPlanFeatureId": entitlementPlanFeatureID, + } + + var res GetEntitlementPlanFeatureByID + if err := c.Client.Post(ctx, "GetEntitlementPlanFeatureByID", GetEntitlementPlanFeatureByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanFeaturesDocument = `query GetEntitlementPlanFeatures ($where: EntitlementPlanFeatureWhereInput) { + entitlementPlanFeatures(where: $where) { + edges { + node { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } + } +} +` + +func (c *Client) GetEntitlementPlanFeatures(ctx context.Context, where *EntitlementPlanFeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatures, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlanFeatures + if err := c.Client.Post(ctx, "GetEntitlementPlanFeatures", GetEntitlementPlanFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntitlementPlanFeatureDocument = `mutation CreateEntitlementPlanFeature ($input: CreateEntitlementPlanFeatureInput!) { + createEntitlementPlanFeature(input: $input) { + entitlementPlanFeature { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) CreateEntitlementPlanFeature(ctx context.Context, input CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntitlementPlanFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntitlementPlanFeature + if err := c.Client.Post(ctx, "CreateEntitlementPlanFeature", CreateEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntitlementPlanFeatureDocument = `mutation CreateBulkCSVEntitlementPlanFeature ($input: Upload!) { + createBulkCSVEntitlementPlanFeature(input: $input) { + entitlementPlanFeatures { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkCSVEntitlementPlanFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntitlementPlanFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntitlementPlanFeature + if err := c.Client.Post(ctx, "CreateBulkCSVEntitlementPlanFeature", CreateBulkCSVEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntitlementPlanFeatureDocument = `mutation CreateBulkEntitlementPlanFeature ($input: [CreateEntitlementPlanFeatureInput!]) { + createBulkEntitlementPlanFeature(input: $input) { + entitlementPlanFeatures { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkEntitlementPlanFeature(ctx context.Context, input []*CreateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntitlementPlanFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntitlementPlanFeature + if err := c.Client.Post(ctx, "CreateBulkEntitlementPlanFeature", CreateBulkEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntitlementPlanFeatureDocument = `mutation UpdateEntitlementPlanFeature ($updateEntitlementPlanFeatureId: ID!, $input: UpdateEntitlementPlanFeatureInput!) { + updateEntitlementPlanFeature(id: $updateEntitlementPlanFeatureId, input: $input) { + entitlementPlanFeature { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} +` + +func (c *Client) UpdateEntitlementPlanFeature(ctx context.Context, updateEntitlementPlanFeatureID string, input UpdateEntitlementPlanFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntitlementPlanFeature, error) { + vars := map[string]any{ + "updateEntitlementPlanFeatureId": updateEntitlementPlanFeatureID, + "input": input, + } + + var res UpdateEntitlementPlanFeature + if err := c.Client.Post(ctx, "UpdateEntitlementPlanFeature", UpdateEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntitlementPlanFeatureDocument = `mutation DeleteEntitlementPlanFeature ($deleteEntitlementPlanFeatureId: ID!) { + deleteEntitlementPlanFeature(id: $deleteEntitlementPlanFeatureId) { + deletedID + } +} +` + +func (c *Client) DeleteEntitlementPlanFeature(ctx context.Context, deleteEntitlementPlanFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntitlementPlanFeature, error) { + vars := map[string]any{ + "deleteEntitlementPlanFeatureId": deleteEntitlementPlanFeatureID, + } + + var res DeleteEntitlementPlanFeature + if err := c.Client.Post(ctx, "DeleteEntitlementPlanFeature", DeleteEntitlementPlanFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlanFeatureHistoriesDocument = `query GetAllEntitlementPlanFeatureHistories { + entitlementPlanFeatureHistories { + edges { + node { + createdAt + createdBy + featureID + historyTime + id + metadata + operation + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlanFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanFeatureHistories, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlanFeatureHistories + if err := c.Client.Post(ctx, "GetAllEntitlementPlanFeatureHistories", GetAllEntitlementPlanFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanFeatureHistoriesDocument = `query GetEntitlementPlanFeatureHistories ($where: EntitlementPlanFeatureHistoryWhereInput) { + entitlementPlanFeatureHistories(where: $where) { + edges { + node { + createdAt + createdBy + featureID + historyTime + id + metadata + operation + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntitlementPlanFeatureHistories(ctx context.Context, where *EntitlementPlanFeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanFeatureHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlanFeatureHistories + if err := c.Client.Post(ctx, "GetEntitlementPlanFeatureHistories", GetEntitlementPlanFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitlementPlanHistoriesDocument = `query GetAllEntitlementPlanHistories { + entitlementPlanHistories { + edges { + node { + createdAt + createdBy + description + displayName + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + version + } + } + } +} +` + +func (c *Client) GetAllEntitlementPlanHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntitlementPlanHistories, error) { + vars := map[string]any{} + + var res GetAllEntitlementPlanHistories + if err := c.Client.Post(ctx, "GetAllEntitlementPlanHistories", GetAllEntitlementPlanHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitlementPlanHistoriesDocument = `query GetEntitlementPlanHistories ($where: EntitlementPlanHistoryWhereInput) { + entitlementPlanHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + version + } + } + } +} +` + +func (c *Client) GetEntitlementPlanHistories(ctx context.Context, where *EntitlementPlanHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntitlementPlanHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntitlementPlanHistories + if err := c.Client.Post(ctx, "GetEntitlementPlanHistories", GetEntitlementPlanHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntityDocument = `mutation CreateBulkCSVEntity ($input: Upload!) { + createBulkCSVEntity(input: $input) { + entities { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkCSVEntity(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntity, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntity + if err := c.Client.Post(ctx, "CreateBulkCSVEntity", CreateBulkCSVEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntityDocument = `mutation CreateBulkEntity ($input: [CreateEntityInput!]) { + createBulkEntity(input: $input) { + entities { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkEntity(ctx context.Context, input []*CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntity, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntity + if err := c.Client.Post(ctx, "CreateBulkEntity", CreateBulkEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntityDocument = `mutation CreateEntity ($input: CreateEntityInput!) { + createEntity(input: $input) { + entity { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateEntity(ctx context.Context, input CreateEntityInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntity, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntity + if err := c.Client.Post(ctx, "CreateEntity", CreateEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntityDocument = `mutation DeleteEntity ($deleteEntityId: ID!) { + deleteEntity(id: $deleteEntityId) { + deletedID + } +} +` + +func (c *Client) DeleteEntity(ctx context.Context, deleteEntityID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntity, error) { + vars := map[string]any{ + "deleteEntityId": deleteEntityID, + } + + var res DeleteEntity + if err := c.Client.Post(ctx, "DeleteEntity", DeleteEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntitiesDocument = `query GetAllEntities { + entities { + edges { + node { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntities(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntities, error) { + vars := map[string]any{} + + var res GetAllEntities + if err := c.Client.Post(ctx, "GetAllEntities", GetAllEntitiesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntitiesDocument = `query GetEntities ($where: EntityWhereInput) { + entities(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntities(ctx context.Context, where *EntityWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntities, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntities + if err := c.Client.Post(ctx, "GetEntities", GetEntitiesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityByIDDocument = `query GetEntityByID ($entityId: ID!) { + entity(id: $entityId) { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + contacts { + id + fullName + email + title + company + address + phoneNumber + } + tags + updatedAt + updatedBy + } +} +` + +func (c *Client) GetEntityByID(ctx context.Context, entityID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityByID, error) { + vars := map[string]any{ + "entityId": entityID, + } + + var res GetEntityByID + if err := c.Client.Post(ctx, "GetEntityByID", GetEntityByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntityDocument = `mutation UpdateEntity ($updateEntityId: ID!, $input: UpdateEntityInput!) { + updateEntity(id: $updateEntityId, input: $input) { + entity { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateEntity(ctx context.Context, updateEntityID string, input UpdateEntityInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntity, error) { + vars := map[string]any{ + "updateEntityId": updateEntityID, + "input": input, + } + + var res UpdateEntity + if err := c.Client.Post(ctx, "UpdateEntity", UpdateEntityDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntityHistoriesDocument = `query GetAllEntityHistories { + entityHistories { + edges { + node { + createdAt + createdBy + description + displayName + domains + entityTypeID + historyTime + id + name + operation + ownerID + ref + status + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntityHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityHistories, error) { + vars := map[string]any{} + + var res GetAllEntityHistories + if err := c.Client.Post(ctx, "GetAllEntityHistories", GetAllEntityHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityHistoriesDocument = `query GetEntityHistories ($where: EntityHistoryWhereInput) { + entityHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + domains + entityTypeID + historyTime + id + name + operation + ownerID + ref + status + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntityHistories(ctx context.Context, where *EntityHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntityHistories + if err := c.Client.Post(ctx, "GetEntityHistories", GetEntityHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEntityTypeDocument = `mutation CreateBulkCSVEntityType ($input: Upload!) { + createBulkCSVEntityType(input: $input) { + entityTypes { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkCSVEntityType(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEntityType, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEntityType + if err := c.Client.Post(ctx, "CreateBulkCSVEntityType", CreateBulkCSVEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEntityTypeDocument = `mutation CreateBulkEntityType ($input: [CreateEntityTypeInput!]) { + createBulkEntityType(input: $input) { + entityTypes { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateBulkEntityType(ctx context.Context, input []*CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEntityType, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEntityType + if err := c.Client.Post(ctx, "CreateBulkEntityType", CreateBulkEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEntityTypeDocument = `mutation CreateEntityType ($input: CreateEntityTypeInput!) { + createEntityType(input: $input) { + entityType { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) CreateEntityType(ctx context.Context, input CreateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*CreateEntityType, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEntityType + if err := c.Client.Post(ctx, "CreateEntityType", CreateEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEntityTypeDocument = `mutation DeleteEntityType ($deleteEntityTypeId: ID!) { + deleteEntityType(id: $deleteEntityTypeId) { + deletedID + } +} +` + +func (c *Client) DeleteEntityType(ctx context.Context, deleteEntityTypeID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEntityType, error) { + vars := map[string]any{ + "deleteEntityTypeId": deleteEntityTypeID, + } + + var res DeleteEntityType + if err := c.Client.Post(ctx, "DeleteEntityType", DeleteEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntityTypesDocument = `query GetAllEntityTypes { + entityTypes { + edges { + node { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntityTypes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypes, error) { + vars := map[string]any{} + + var res GetAllEntityTypes + if err := c.Client.Post(ctx, "GetAllEntityTypes", GetAllEntityTypesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityTypeByIDDocument = `query GetEntityTypeByID ($entityTypeId: ID!) { + entityType(id: $entityTypeId) { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } +} +` + +func (c *Client) GetEntityTypeByID(ctx context.Context, entityTypeID string, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeByID, error) { + vars := map[string]any{ + "entityTypeId": entityTypeID, + } + + var res GetEntityTypeByID + if err := c.Client.Post(ctx, "GetEntityTypeByID", GetEntityTypeByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityTypesDocument = `query GetEntityTypes ($where: EntityTypeWhereInput) { + entityTypes(where: $where) { + edges { + node { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntityTypes(ctx context.Context, where *EntityTypeWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypes, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntityTypes + if err := c.Client.Post(ctx, "GetEntityTypes", GetEntityTypesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEntityTypeDocument = `mutation UpdateEntityType ($updateEntityTypeId: ID!, $input: UpdateEntityTypeInput!) { + updateEntityType(id: $updateEntityTypeId, input: $input) { + entityType { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateEntityType(ctx context.Context, updateEntityTypeID string, input UpdateEntityTypeInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEntityType, error) { + vars := map[string]any{ + "updateEntityTypeId": updateEntityTypeID, + "input": input, + } + + var res UpdateEntityType + if err := c.Client.Post(ctx, "UpdateEntityType", UpdateEntityTypeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEntityTypeHistoriesDocument = `query GetAllEntityTypeHistories { + entityTypeHistories { + edges { + node { + createdAt + createdBy + historyTime + id + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEntityTypeHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEntityTypeHistories, error) { + vars := map[string]any{} + + var res GetAllEntityTypeHistories + if err := c.Client.Post(ctx, "GetAllEntityTypeHistories", GetAllEntityTypeHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEntityTypeHistoriesDocument = `query GetEntityTypeHistories ($where: EntityTypeHistoryWhereInput) { + entityTypeHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEntityTypeHistories(ctx context.Context, where *EntityTypeHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEntityTypeHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEntityTypeHistories + if err := c.Client.Post(ctx, "GetEntityTypeHistories", GetEntityTypeHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEventsDocument = `query GetEvents ($where: EventWhereInput) { + events(where: $where) { + edges { + node { + eventID + id + correlationID + eventType + metadata + } + } + } +} +` + +func (c *Client) GetEvents(ctx context.Context, where *EventWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEvents, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEvents + if err := c.Client.Post(ctx, "GetEvents", GetEventsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEventByIDDocument = `query GetEventByID ($eventId: ID!) { + event(id: $eventId) { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } +} +` + +func (c *Client) GetEventByID(ctx context.Context, eventID string, interceptors ...clientv2.RequestInterceptor) (*GetEventByID, error) { + vars := map[string]any{ + "eventId": eventID, + } + + var res GetEventByID + if err := c.Client.Post(ctx, "GetEventByID", GetEventByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEventsDocument = `query GetAllEvents { + events { + edges { + node { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } + } +} +` + +func (c *Client) GetAllEvents(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEvents, error) { + vars := map[string]any{} + + var res GetAllEvents + if err := c.Client.Post(ctx, "GetAllEvents", GetAllEventsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateEventDocument = `mutation CreateEvent ($input: CreateEventInput!) { + createEvent(input: $input) { + event { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) CreateEvent(ctx context.Context, input CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateEvent, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateEvent + if err := c.Client.Post(ctx, "CreateEvent", CreateEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkEventDocument = `mutation CreateBulkEvent ($input: [CreateEventInput!]) { + createBulkEvent(input: $input) { + events { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) CreateBulkEvent(ctx context.Context, input []*CreateEventInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkEvent, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkEvent + if err := c.Client.Post(ctx, "CreateBulkEvent", CreateBulkEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVEventDocument = `mutation CreateBulkCSVEvent ($input: Upload!) { + createBulkCSVEvent(input: $input) { + events { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVEvent(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVEvent, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVEvent + if err := c.Client.Post(ctx, "CreateBulkCSVEvent", CreateBulkCSVEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateEventDocument = `mutation UpdateEvent ($updateEventId: ID!, $input: UpdateEventInput!) { + updateEvent(id: $updateEventId, input: $input) { + event { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} +` + +func (c *Client) UpdateEvent(ctx context.Context, updateEventID string, input UpdateEventInput, interceptors ...clientv2.RequestInterceptor) (*UpdateEvent, error) { + vars := map[string]any{ + "updateEventId": updateEventID, + "input": input, + } + + var res UpdateEvent + if err := c.Client.Post(ctx, "UpdateEvent", UpdateEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteEventDocument = `mutation DeleteEvent ($deleteEventId: ID!) { + deleteEvent(id: $deleteEventId) { + deletedID + } +} +` + +func (c *Client) DeleteEvent(ctx context.Context, deleteEventID string, interceptors ...clientv2.RequestInterceptor) (*DeleteEvent, error) { + vars := map[string]any{ + "deleteEventId": deleteEventID, + } + + var res DeleteEvent + if err := c.Client.Post(ctx, "DeleteEvent", DeleteEventDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllEventHistoriesDocument = `query GetAllEventHistories { + eventHistories { + edges { + node { + correlationID + createdAt + createdBy + eventID + eventType + historyTime + id + metadata + operation + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllEventHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllEventHistories, error) { + vars := map[string]any{} + + var res GetAllEventHistories + if err := c.Client.Post(ctx, "GetAllEventHistories", GetAllEventHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetEventHistoriesDocument = `query GetEventHistories ($where: EventHistoryWhereInput) { + eventHistories(where: $where) { + edges { + node { + correlationID + createdAt + createdBy + eventID + eventType + historyTime + id + metadata + operation + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetEventHistories(ctx context.Context, where *EventHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetEventHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetEventHistories + if err := c.Client.Post(ctx, "GetEventHistories", GetEventHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVFeatureDocument = `mutation CreateBulkCSVFeature ($input: Upload!) { + createBulkCSVFeature(input: $input) { + features { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) CreateBulkCSVFeature(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVFeature + if err := c.Client.Post(ctx, "CreateBulkCSVFeature", CreateBulkCSVFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkFeatureDocument = `mutation CreateBulkFeature ($input: [CreateFeatureInput!]) { + createBulkFeature(input: $input) { + features { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) CreateBulkFeature(ctx context.Context, input []*CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkFeature + if err := c.Client.Post(ctx, "CreateBulkFeature", CreateBulkFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateFeatureDocument = `mutation CreateFeature ($input: CreateFeatureInput!) { + createFeature(input: $input) { + feature { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) CreateFeature(ctx context.Context, input CreateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*CreateFeature, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateFeature + if err := c.Client.Post(ctx, "CreateFeature", CreateFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteFeatureDocument = `mutation DeleteFeature ($deleteFeatureId: ID!) { + deleteFeature(id: $deleteFeatureId) { + deletedID + } +} +` + +func (c *Client) DeleteFeature(ctx context.Context, deleteFeatureID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFeature, error) { + vars := map[string]any{ + "deleteFeatureId": deleteFeatureID, + } + + var res DeleteFeature + if err := c.Client.Post(ctx, "DeleteFeature", DeleteFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFeaturesDocument = `query GetAllFeatures { + features { + edges { + node { + description + enabled + id + name + displayName + tags + } + } + } +} +` + +func (c *Client) GetAllFeatures(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatures, error) { + vars := map[string]any{} + + var res GetAllFeatures + if err := c.Client.Post(ctx, "GetAllFeatures", GetAllFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFeatureByIDDocument = `query GetFeatureByID ($featureId: ID!) { + feature(id: $featureId) { + description + enabled + id + name + displayName + tags + } +} +` + +func (c *Client) GetFeatureByID(ctx context.Context, featureID string, interceptors ...clientv2.RequestInterceptor) (*GetFeatureByID, error) { + vars := map[string]any{ + "featureId": featureID, + } + + var res GetFeatureByID + if err := c.Client.Post(ctx, "GetFeatureByID", GetFeatureByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFeaturesDocument = `query GetFeatures ($where: FeatureWhereInput) { + features(where: $where) { + edges { + node { + description + enabled + id + name + displayName + tags + } + } + } +} +` + +func (c *Client) GetFeatures(ctx context.Context, where *FeatureWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatures, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFeatures + if err := c.Client.Post(ctx, "GetFeatures", GetFeaturesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateFeatureDocument = `mutation UpdateFeature ($updateFeatureId: ID!, $input: UpdateFeatureInput!) { + updateFeature(id: $updateFeatureId, input: $input) { + feature { + description + enabled + id + name + displayName + tags + } + } +} +` + +func (c *Client) UpdateFeature(ctx context.Context, updateFeatureID string, input UpdateFeatureInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFeature, error) { + vars := map[string]any{ + "updateFeatureId": updateFeatureID, + "input": input, + } + + var res UpdateFeature + if err := c.Client.Post(ctx, "UpdateFeature", UpdateFeatureDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFeatureHistoriesDocument = `query GetAllFeatureHistories { + featureHistories { + edges { + node { + createdAt + createdBy + description + displayName + enabled + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllFeatureHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFeatureHistories, error) { + vars := map[string]any{} + + var res GetAllFeatureHistories + if err := c.Client.Post(ctx, "GetAllFeatureHistories", GetAllFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFeatureHistoriesDocument = `query GetFeatureHistories ($where: FeatureHistoryWhereInput) { + featureHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + enabled + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetFeatureHistories(ctx context.Context, where *FeatureHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFeatureHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFeatureHistories + if err := c.Client.Post(ctx, "GetFeatureHistories", GetFeatureHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVFileDocument = `mutation CreateBulkCSVFile ($input: Upload!) { + createBulkCSVFile(input: $input) { + files { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVFile(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVFile, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVFile + if err := c.Client.Post(ctx, "CreateBulkCSVFile", CreateBulkCSVFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkFileDocument = `mutation CreateBulkFile ($input: [CreateFileInput!]) { + createBulkFile(input: $input) { + files { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) CreateBulkFile(ctx context.Context, input []*CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkFile, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkFile + if err := c.Client.Post(ctx, "CreateBulkFile", CreateBulkFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateFileDocument = `mutation CreateFile ($input: CreateFileInput!) { + createFile(input: $input) { + file { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) CreateFile(ctx context.Context, input CreateFileInput, interceptors ...clientv2.RequestInterceptor) (*CreateFile, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateFile + if err := c.Client.Post(ctx, "CreateFile", CreateFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteFileDocument = `mutation DeleteFile ($deleteFileId: ID!) { + deleteFile(id: $deleteFileId) { + deletedID + } +} +` + +func (c *Client) DeleteFile(ctx context.Context, deleteFileID string, interceptors ...clientv2.RequestInterceptor) (*DeleteFile, error) { + vars := map[string]any{ + "deleteFileId": deleteFileID, + } + + var res DeleteFile + if err := c.Client.Post(ctx, "DeleteFile", DeleteFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFilesDocument = `query GetAllFiles { + files { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + id + storeKey + updatedAt + updatedBy + user { + id + } + organization { + id + } + group { + id + } + } + } + } +} +` + +func (c *Client) GetAllFiles(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFiles, error) { + vars := map[string]any{} + + var res GetAllFiles + if err := c.Client.Post(ctx, "GetAllFiles", GetAllFilesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFilesDocument = `query GetFiles ($where: FileWhereInput) { + files(where: $where) { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + id + storeKey + updatedAt + updatedBy + user { + id + } + organization { + id + } + group { + id + } + } + } + } +} +` + +func (c *Client) GetFiles(ctx context.Context, where *FileWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFiles, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFiles + if err := c.Client.Post(ctx, "GetFiles", GetFilesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateFileDocument = `mutation UpdateFile ($updateFileId: ID!, $input: UpdateFileInput!) { + updateFile(id: $updateFileId, input: $input) { + file { + id + fileName + fileExtension + fileSize + contentType + storeKey + category + annotation + user { + id + } + organization { + id + } + group { + id + } + } + } +} +` + +func (c *Client) UpdateFile(ctx context.Context, updateFileID string, input UpdateFileInput, interceptors ...clientv2.RequestInterceptor) (*UpdateFile, error) { + vars := map[string]any{ + "updateFileId": updateFileID, + "input": input, + } + + var res UpdateFile + if err := c.Client.Post(ctx, "UpdateFile", UpdateFileDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllFileHistoriesDocument = `query GetAllFileHistories { + fileHistories { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + historyTime + id + operation + ref + storeKey + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllFileHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllFileHistories, error) { + vars := map[string]any{} + + var res GetAllFileHistories + if err := c.Client.Post(ctx, "GetAllFileHistories", GetAllFileHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetFileHistoriesDocument = `query GetFileHistories ($where: FileHistoryWhereInput) { + fileHistories(where: $where) { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + historyTime + id + operation + ref + storeKey + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetFileHistories(ctx context.Context, where *FileHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetFileHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetFileHistories + if err := c.Client.Post(ctx, "GetFileHistories", GetFileHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVGroupDocument = `mutation CreateBulkCSVGroup ($input: Upload!) { + createBulkCSVGroup(input: $input) { + groups { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) CreateBulkCSVGroup(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroup, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVGroup + if err := c.Client.Post(ctx, "CreateBulkCSVGroup", CreateBulkCSVGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkGroupDocument = `mutation CreateBulkGroup ($input: [CreateGroupInput!]) { + createBulkGroup(input: $input) { + groups { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) CreateBulkGroup(ctx context.Context, input []*CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroup, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkGroup + if err := c.Client.Post(ctx, "CreateBulkGroup", CreateBulkGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateGroupDocument = `mutation CreateGroup ($input: CreateGroupInput!) { + createGroup(input: $input) { + group { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) CreateGroup(ctx context.Context, input CreateGroupInput, interceptors ...clientv2.RequestInterceptor) (*CreateGroup, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateGroup + if err := c.Client.Post(ctx, "CreateGroup", CreateGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteGroupDocument = `mutation DeleteGroup ($deleteGroupId: ID!) { + deleteGroup(id: $deleteGroupId) { + deletedID + } +} +` + +func (c *Client) DeleteGroup(ctx context.Context, deleteGroupID string, interceptors ...clientv2.RequestInterceptor) (*DeleteGroup, error) { + vars := map[string]any{ + "deleteGroupId": deleteGroupID, + } + + var res DeleteGroup + if err := c.Client.Post(ctx, "DeleteGroup", DeleteGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupsDocument = `query GetAllGroups { + groups { + edges { + node { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllGroups(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroups, error) { + vars := map[string]any{} + + var res GetAllGroups + if err := c.Client.Post(ctx, "GetAllGroups", GetAllGroupsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupByIDDocument = `query GetGroupByID ($groupId: ID!) { + group(id: $groupId) { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetGroupByID(ctx context.Context, groupID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupByID, error) { + vars := map[string]any{ + "groupId": groupID, + } + + var res GetGroupByID + if err := c.Client.Post(ctx, "GetGroupByID", GetGroupByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupsDocument = `query GetGroups ($where: GroupWhereInput) { + groups(where: $where) { + edges { + node { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetGroups(ctx context.Context, where *GroupWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroups, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroups + if err := c.Client.Post(ctx, "GetGroups", GetGroupsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateGroupDocument = `mutation UpdateGroup ($updateGroupId: ID!, $input: UpdateGroupInput!) { + updateGroup(id: $updateGroupId, input: $input) { + group { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} +` + +func (c *Client) UpdateGroup(ctx context.Context, updateGroupID string, input UpdateGroupInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroup, error) { + vars := map[string]any{ + "updateGroupId": updateGroupID, + "input": input, + } + + var res UpdateGroup + if err := c.Client.Post(ctx, "UpdateGroup", UpdateGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupHistoriesDocument = `query GetAllGroupHistories { + groupHistories { + edges { + node { + createdAt + createdBy + description + displayName + gravatarLogoURL + historyTime + id + logoURL + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllGroupHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupHistories, error) { + vars := map[string]any{} + + var res GetAllGroupHistories + if err := c.Client.Post(ctx, "GetAllGroupHistories", GetAllGroupHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupHistoriesDocument = `query GetGroupHistories ($where: GroupHistoryWhereInput) { + groupHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + gravatarLogoURL + historyTime + id + logoURL + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetGroupHistories(ctx context.Context, where *GroupHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupHistories + if err := c.Client.Post(ctx, "GetGroupHistories", GetGroupHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const AddUserToGroupWithRoleDocument = `mutation AddUserToGroupWithRole ($input: CreateGroupMembershipInput!) { + createGroupMembership(input: $input) { + groupMembership { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) AddUserToGroupWithRole(ctx context.Context, input CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToGroupWithRole, error) { + vars := map[string]any{ + "input": input, + } + + var res AddUserToGroupWithRole + if err := c.Client.Post(ctx, "AddUserToGroupWithRole", AddUserToGroupWithRoleDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVGroupMembersDocument = `mutation CreateBulkCSVGroupMembers ($input: Upload!) { + createBulkCSVGroupMembership(input: $input) { + groupMemberships { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) CreateBulkCSVGroupMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVGroupMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVGroupMembers + if err := c.Client.Post(ctx, "CreateBulkCSVGroupMembers", CreateBulkCSVGroupMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkGroupMembersDocument = `mutation CreateBulkGroupMembers ($input: [CreateGroupMembershipInput!]) { + createBulkGroupMembership(input: $input) { + groupMemberships { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) CreateBulkGroupMembers(ctx context.Context, input []*CreateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkGroupMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkGroupMembers + if err := c.Client.Post(ctx, "CreateBulkGroupMembers", CreateBulkGroupMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupMembersByGroupIDDocument = `query GetGroupMembersByGroupID ($where: GroupMembershipWhereInput) { + groupMemberships(where: $where) { + edges { + node { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } + } +} +` + +func (c *Client) GetGroupMembersByGroupID(ctx context.Context, where *GroupMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembersByGroupID, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupMembersByGroupID + if err := c.Client.Post(ctx, "GetGroupMembersByGroupID", GetGroupMembersByGroupIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const RemoveUserFromGroupDocument = `mutation RemoveUserFromGroup ($deleteGroupMembershipId: ID!) { + deleteGroupMembership(id: $deleteGroupMembershipId) { + deletedID + } +} +` + +func (c *Client) RemoveUserFromGroup(ctx context.Context, deleteGroupMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromGroup, error) { + vars := map[string]any{ + "deleteGroupMembershipId": deleteGroupMembershipID, + } + + var res RemoveUserFromGroup + if err := c.Client.Post(ctx, "RemoveUserFromGroup", RemoveUserFromGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserRoleInGroupDocument = `mutation UpdateUserRoleInGroup ($updateGroupMemberId: ID!, $input: UpdateGroupMembershipInput!) { + updateGroupMembership(id: $updateGroupMemberId, input: $input) { + groupMembership { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} +` + +func (c *Client) UpdateUserRoleInGroup(ctx context.Context, updateGroupMemberID string, input UpdateGroupMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInGroup, error) { + vars := map[string]any{ + "updateGroupMemberId": updateGroupMemberID, + "input": input, + } + + var res UpdateUserRoleInGroup + if err := c.Client.Post(ctx, "UpdateUserRoleInGroup", UpdateUserRoleInGroupDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupMembershipHistoriesDocument = `query GetAllGroupMembershipHistories { + groupMembershipHistories { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + operation + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetAllGroupMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupMembershipHistories, error) { + vars := map[string]any{} + + var res GetAllGroupMembershipHistories + if err := c.Client.Post(ctx, "GetAllGroupMembershipHistories", GetAllGroupMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupMembershipHistoriesDocument = `query GetGroupMembershipHistories ($where: GroupMembershipHistoryWhereInput) { + groupMembershipHistories(where: $where) { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + operation + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetGroupMembershipHistories(ctx context.Context, where *GroupMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupMembershipHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupMembershipHistories + if err := c.Client.Post(ctx, "GetGroupMembershipHistories", GetGroupMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupSettingsDocument = `query GetAllGroupSettings { + groupSettings { + edges { + node { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllGroupSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettings, error) { + vars := map[string]any{} + + var res GetAllGroupSettings + if err := c.Client.Post(ctx, "GetAllGroupSettings", GetAllGroupSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupSettingByIDDocument = `query GetGroupSettingByID ($groupSettingId: ID!) { + groupSetting(id: $groupSettingId) { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetGroupSettingByID(ctx context.Context, groupSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingByID, error) { + vars := map[string]any{ + "groupSettingId": groupSettingID, + } + + var res GetGroupSettingByID + if err := c.Client.Post(ctx, "GetGroupSettingByID", GetGroupSettingByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupSettingsDocument = `query GetGroupSettings ($where: GroupSettingWhereInput!) { + groupSettings(where: $where) { + edges { + node { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetGroupSettings(ctx context.Context, where GroupSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettings, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupSettings + if err := c.Client.Post(ctx, "GetGroupSettings", GetGroupSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateGroupSettingDocument = `mutation UpdateGroupSetting ($updateGroupSettingId: ID!, $input: UpdateGroupSettingInput!) { + updateGroupSetting(id: $updateGroupSettingId, input: $input) { + groupSetting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateGroupSetting(ctx context.Context, updateGroupSettingID string, input UpdateGroupSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateGroupSetting, error) { + vars := map[string]any{ + "updateGroupSettingId": updateGroupSettingID, + "input": input, + } + + var res UpdateGroupSetting + if err := c.Client.Post(ctx, "UpdateGroupSetting", UpdateGroupSettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllGroupSettingHistoriesDocument = `query GetAllGroupSettingHistories { + groupSettingHistories { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + joinPolicy + operation + ref + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + } + } +} +` + +func (c *Client) GetAllGroupSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllGroupSettingHistories, error) { + vars := map[string]any{} + + var res GetAllGroupSettingHistories + if err := c.Client.Post(ctx, "GetAllGroupSettingHistories", GetAllGroupSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetGroupSettingHistoriesDocument = `query GetGroupSettingHistories ($where: GroupSettingHistoryWhereInput) { + groupSettingHistories(where: $where) { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + joinPolicy + operation + ref + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + } + } +} +` + +func (c *Client) GetGroupSettingHistories(ctx context.Context, where *GroupSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetGroupSettingHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetGroupSettingHistories + if err := c.Client.Post(ctx, "GetGroupSettingHistories", GetGroupSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVHushDocument = `mutation CreateBulkCSVHush ($input: Upload!) { + createBulkCSVHush(input: $input) { + hushes { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVHush(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVHush, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVHush + if err := c.Client.Post(ctx, "CreateBulkCSVHush", CreateBulkCSVHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkHushDocument = `mutation CreateBulkHush ($input: [CreateHushInput!]) { + createBulkHush(input: $input) { + hushes { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkHush(ctx context.Context, input []*CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkHush, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkHush + if err := c.Client.Post(ctx, "CreateBulkHush", CreateBulkHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateHushDocument = `mutation CreateHush ($input: CreateHushInput!) { + createHush(input: $input) { + hush { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateHush(ctx context.Context, input CreateHushInput, interceptors ...clientv2.RequestInterceptor) (*CreateHush, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateHush + if err := c.Client.Post(ctx, "CreateHush", CreateHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllHushesDocument = `query GetAllHushes { + hushes { + edges { + node { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } + } + } +} +` + +func (c *Client) GetAllHushes(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushes, error) { + vars := map[string]any{} + + var res GetAllHushes + if err := c.Client.Post(ctx, "GetAllHushes", GetAllHushesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetHushByIDDocument = `query GetHushByID ($hushId: ID!) { + hush(id: $hushId) { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } +} +` + +func (c *Client) GetHushByID(ctx context.Context, hushID string, interceptors ...clientv2.RequestInterceptor) (*GetHushByID, error) { + vars := map[string]any{ + "hushId": hushID, + } + + var res GetHushByID + if err := c.Client.Post(ctx, "GetHushByID", GetHushByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetHushesDocument = `query GetHushes ($where: HushWhereInput) { + hushes(where: $where) { + edges { + node { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } + } + } +} +` + +func (c *Client) GetHushes(ctx context.Context, where *HushWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushes, error) { + vars := map[string]any{ + "where": where, + } + + var res GetHushes + if err := c.Client.Post(ctx, "GetHushes", GetHushesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateHushDocument = `mutation UpdateHush ($updateHushId: ID!, $input: UpdateHushInput!) { + updateHush(id: $updateHushId, input: $input) { + hush { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} +` + +func (c *Client) UpdateHush(ctx context.Context, updateHushID string, input UpdateHushInput, interceptors ...clientv2.RequestInterceptor) (*UpdateHush, error) { + vars := map[string]any{ + "updateHushId": updateHushID, + "input": input, + } + + var res UpdateHush + if err := c.Client.Post(ctx, "UpdateHush", UpdateHushDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllHushHistoriesDocument = `query GetAllHushHistories { + hushHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ref + secretName + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllHushHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllHushHistories, error) { + vars := map[string]any{} + + var res GetAllHushHistories + if err := c.Client.Post(ctx, "GetAllHushHistories", GetAllHushHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetHushHistoriesDocument = `query GetHushHistories ($where: HushHistoryWhereInput) { + hushHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ref + secretName + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetHushHistories(ctx context.Context, where *HushHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetHushHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetHushHistories + if err := c.Client.Post(ctx, "GetHushHistories", GetHushHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVIntegrationDocument = `mutation CreateBulkCSVIntegration ($input: Upload!) { + createBulkCSVIntegration(input: $input) { + integrations { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) CreateBulkCSVIntegration(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVIntegration, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVIntegration + if err := c.Client.Post(ctx, "CreateBulkCSVIntegration", CreateBulkCSVIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkIntegrationDocument = `mutation CreateBulkIntegration ($input: [CreateIntegrationInput!]) { + createBulkIntegration(input: $input) { + integrations { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) CreateBulkIntegration(ctx context.Context, input []*CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkIntegration, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkIntegration + if err := c.Client.Post(ctx, "CreateBulkIntegration", CreateBulkIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateIntegrationDocument = `mutation CreateIntegration ($input: CreateIntegrationInput!) { + createIntegration(input: $input) { + integration { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) CreateIntegration(ctx context.Context, input CreateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*CreateIntegration, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateIntegration + if err := c.Client.Post(ctx, "CreateIntegration", CreateIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteIntegrationDocument = `mutation DeleteIntegration ($deleteIntegrationId: ID!) { + deleteIntegration(id: $deleteIntegrationId) { + deletedID + } +} +` + +func (c *Client) DeleteIntegration(ctx context.Context, deleteIntegrationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteIntegration, error) { + vars := map[string]any{ + "deleteIntegrationId": deleteIntegrationID, + } + + var res DeleteIntegration + if err := c.Client.Post(ctx, "DeleteIntegration", DeleteIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllIntegrationsDocument = `query GetAllIntegrations { + integrations { + edges { + node { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllIntegrations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrations, error) { + vars := map[string]any{} + + var res GetAllIntegrations + if err := c.Client.Post(ctx, "GetAllIntegrations", GetAllIntegrationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetIntegrationByIDDocument = `query GetIntegrationByID ($integrationId: ID!) { + integration(id: $integrationId) { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetIntegrationByID(ctx context.Context, integrationID string, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationByID, error) { + vars := map[string]any{ + "integrationId": integrationID, + } + + var res GetIntegrationByID + if err := c.Client.Post(ctx, "GetIntegrationByID", GetIntegrationByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetIntegrationsDocument = `query GetIntegrations ($where: IntegrationWhereInput) { + integrations(where: $where) { + edges { + node { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetIntegrations(ctx context.Context, where *IntegrationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrations, error) { + vars := map[string]any{ + "where": where, + } + + var res GetIntegrations + if err := c.Client.Post(ctx, "GetIntegrations", GetIntegrationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateIntegrationDocument = `mutation UpdateIntegration ($updateIntegrationId: ID!, $input: UpdateIntegrationInput!) { + updateIntegration(id: $updateIntegrationId, input: $input) { + integration { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} +` + +func (c *Client) UpdateIntegration(ctx context.Context, updateIntegrationID string, input UpdateIntegrationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateIntegration, error) { + vars := map[string]any{ + "updateIntegrationId": updateIntegrationID, + "input": input, + } + + var res UpdateIntegration + if err := c.Client.Post(ctx, "UpdateIntegration", UpdateIntegrationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllIntegrationHistoriesDocument = `query GetAllIntegrationHistories { + integrationHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllIntegrationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllIntegrationHistories, error) { + vars := map[string]any{} + + var res GetAllIntegrationHistories + if err := c.Client.Post(ctx, "GetAllIntegrationHistories", GetAllIntegrationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetIntegrationHistoriesDocument = `query GetIntegrationHistories ($where: IntegrationHistoryWhereInput) { + integrationHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetIntegrationHistories(ctx context.Context, where *IntegrationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetIntegrationHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetIntegrationHistories + if err := c.Client.Post(ctx, "GetIntegrationHistories", GetIntegrationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVInviteDocument = `mutation CreateBulkCSVInvite ($input: Upload!) { + createBulkCSVInvite(input: $input) { + invites { + expires + id + recipient + requestorID + role + sendAttempts + status + } + } +} +` + +func (c *Client) CreateBulkCSVInvite(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVInvite, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVInvite + if err := c.Client.Post(ctx, "CreateBulkCSVInvite", CreateBulkCSVInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkInviteDocument = `mutation CreateBulkInvite ($input: [CreateInviteInput!]) { + createBulkInvite(input: $input) { + invites { + expires + id + recipient + requestorID + role + sendAttempts + status + } + } +} +` + +func (c *Client) CreateBulkInvite(ctx context.Context, input []*CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkInvite, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkInvite + if err := c.Client.Post(ctx, "CreateBulkInvite", CreateBulkInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateInviteDocument = `mutation CreateInvite ($input: CreateInviteInput!) { + createInvite(input: $input) { + invite { + expires + id + recipient + requestorID + role + sendAttempts + status + owner { + id + } + } + } +} +` + +func (c *Client) CreateInvite(ctx context.Context, input CreateInviteInput, interceptors ...clientv2.RequestInterceptor) (*CreateInvite, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateInvite + if err := c.Client.Post(ctx, "CreateInvite", CreateInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteInviteDocument = `mutation DeleteInvite ($deleteInviteId: ID!) { + deleteInvite(id: $deleteInviteId) { + deletedID + } +} +` + +func (c *Client) DeleteInvite(ctx context.Context, deleteInviteID string, interceptors ...clientv2.RequestInterceptor) (*DeleteInvite, error) { + vars := map[string]any{ + "deleteInviteId": deleteInviteID, + } + + var res DeleteInvite + if err := c.Client.Post(ctx, "DeleteInvite", DeleteInviteDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetInviteByIDDocument = `query GetInviteByID ($inviteId: ID!) { + invite(id: $inviteId) { + expires + id + recipient + requestorID + role + sendAttempts + status + owner { + displayName + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetInviteByID(ctx context.Context, inviteID string, interceptors ...clientv2.RequestInterceptor) (*GetInviteByID, error) { + vars := map[string]any{ + "inviteId": inviteID, + } + + var res GetInviteByID + if err := c.Client.Post(ctx, "GetInviteByID", GetInviteByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllInvitesDocument = `query GetAllInvites { + invites { + edges { + node { + id + recipient + role + status + } + } + } +} +` + +func (c *Client) GetAllInvites(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllInvites, error) { + vars := map[string]any{} + + var res GetAllInvites + if err := c.Client.Post(ctx, "GetAllInvites", GetAllInvitesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const InvitesByOrgIDDocument = `query InvitesByOrgID ($where: InviteWhereInput) { + invites(where: $where) { + edges { + node { + owner { + id + invites { + recipient + requestorID + role + sendAttempts + status + } + } + } + } + } +} +` + +func (c *Client) InvitesByOrgID(ctx context.Context, where *InviteWhereInput, interceptors ...clientv2.RequestInterceptor) (*InvitesByOrgID, error) { + vars := map[string]any{ + "where": where, + } + + var res InvitesByOrgID + if err := c.Client.Post(ctx, "InvitesByOrgID", InvitesByOrgIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllNoteHistoriesDocument = `query GetAllNoteHistories { + noteHistories { + edges { + node { + createdAt + createdBy + historyTime + id + operation + ownerID + ref + tags + text + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllNoteHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllNoteHistories, error) { + vars := map[string]any{} + + var res GetAllNoteHistories + if err := c.Client.Post(ctx, "GetAllNoteHistories", GetAllNoteHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetNoteHistoriesDocument = `query GetNoteHistories ($where: NoteHistoryWhereInput) { + noteHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + operation + ownerID + ref + tags + text + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetNoteHistories(ctx context.Context, where *NoteHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetNoteHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetNoteHistories + if err := c.Client.Post(ctx, "GetNoteHistories", GetNoteHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOauthProviderHistoriesDocument = `query GetAllOauthProviderHistories { + oauthProviderHistories { + edges { + node { + authStyle + authURL + clientID + clientSecret + createdAt + createdBy + historyTime + id + infoURL + name + operation + ownerID + redirectURL + ref + scopes + tags + tokenURL + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllOauthProviderHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOauthProviderHistories, error) { + vars := map[string]any{} + + var res GetAllOauthProviderHistories + if err := c.Client.Post(ctx, "GetAllOauthProviderHistories", GetAllOauthProviderHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOauthProviderHistoriesDocument = `query GetOauthProviderHistories ($where: OauthProviderHistoryWhereInput) { + oauthProviderHistories(where: $where) { + edges { + node { + authStyle + authURL + clientID + clientSecret + createdAt + createdBy + historyTime + id + infoURL + name + operation + ownerID + redirectURL + ref + scopes + tags + tokenURL + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetOauthProviderHistories(ctx context.Context, where *OauthProviderHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOauthProviderHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOauthProviderHistories + if err := c.Client.Post(ctx, "GetOauthProviderHistories", GetOauthProviderHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVOhAuthTooTokenDocument = `mutation CreateBulkCSVOhAuthTooToken ($input: Upload!) { + createBulkCSVOhAuthTooToken(input: $input) { + ohAuthTooTokens { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVOhAuthTooToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOhAuthTooToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVOhAuthTooToken + if err := c.Client.Post(ctx, "CreateBulkCSVOhAuthTooToken", CreateBulkCSVOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkOhAuthTooTokenDocument = `mutation CreateBulkOhAuthTooToken ($input: [CreateOhAuthTooTokenInput!]) { + createBulkOhAuthTooToken(input: $input) { + ohAuthTooTokens { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateBulkOhAuthTooToken(ctx context.Context, input []*CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOhAuthTooToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkOhAuthTooToken + if err := c.Client.Post(ctx, "CreateBulkOhAuthTooToken", CreateBulkOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateOhAuthTooTokenDocument = `mutation CreateOhAuthTooToken ($input: CreateOhAuthTooTokenInput!) { + createOhAuthTooToken(input: $input) { + ohAuthTooToken { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) CreateOhAuthTooToken(ctx context.Context, input CreateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateOhAuthTooToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateOhAuthTooToken + if err := c.Client.Post(ctx, "CreateOhAuthTooToken", CreateOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteOhAuthTooTokenDocument = `mutation DeleteOhAuthTooToken ($deleteOhAuthTooTokenId: ID!) { + deleteOhAuthTooToken(id: $deleteOhAuthTooTokenId) { + deletedID + } +} +` + +func (c *Client) DeleteOhAuthTooToken(ctx context.Context, deleteOhAuthTooTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOhAuthTooToken, error) { + vars := map[string]any{ + "deleteOhAuthTooTokenId": deleteOhAuthTooTokenID, + } + + var res DeleteOhAuthTooToken + if err := c.Client.Post(ctx, "DeleteOhAuthTooToken", DeleteOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOhAuthTooTokensDocument = `query GetOhAuthTooTokens ($where: OhAuthTooTokenWhereInput) { + ohAuthTooTokens(where: $where) { + edges { + node { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } + } +} +` + +func (c *Client) GetOhAuthTooTokens(ctx context.Context, where *OhAuthTooTokenWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOhAuthTooTokens, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOhAuthTooTokens + if err := c.Client.Post(ctx, "GetOhAuthTooTokens", GetOhAuthTooTokensDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateOhAuthTooTokenDocument = `mutation UpdateOhAuthTooToken ($updateOhAuthTooTokenId: ID!, $input: UpdateOhAuthTooTokenInput!) { + updateOhAuthTooToken(id: $updateOhAuthTooTokenId, input: $input) { + ohAuthTooToken { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} +` + +func (c *Client) UpdateOhAuthTooToken(ctx context.Context, updateOhAuthTooTokenID string, input UpdateOhAuthTooTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOhAuthTooToken, error) { + vars := map[string]any{ + "updateOhAuthTooTokenId": updateOhAuthTooTokenID, + "input": input, + } + + var res UpdateOhAuthTooToken + if err := c.Client.Post(ctx, "UpdateOhAuthTooToken", UpdateOhAuthTooTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVOrganizationDocument = `mutation CreateBulkCSVOrganization ($input: Upload!) { + createBulkCSVOrganization(input: $input) { + organizations { + id + name + displayName + description + personalOrg + tags + } + } +} +` + +func (c *Client) CreateBulkCSVOrganization(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrganization, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVOrganization + if err := c.Client.Post(ctx, "CreateBulkCSVOrganization", CreateBulkCSVOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkOrganizationDocument = `mutation CreateBulkOrganization ($input: [CreateOrganizationInput!]) { + createBulkOrganization(input: $input) { + organizations { + id + name + displayName + description + personalOrg + tags + } + } +} +` + +func (c *Client) CreateBulkOrganization(ctx context.Context, input []*CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrganization, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkOrganization + if err := c.Client.Post(ctx, "CreateBulkOrganization", CreateBulkOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateOrganizationDocument = `mutation CreateOrganization ($input: CreateOrganizationInput!) { + createOrganization(input: $input) { + organization { + id + name + displayName + description + personalOrg + tags + createdAt + updatedAt + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + } + } +} +` + +func (c *Client) CreateOrganization(ctx context.Context, input CreateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*CreateOrganization, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateOrganization + if err := c.Client.Post(ctx, "CreateOrganization", CreateOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteOrganizationDocument = `mutation DeleteOrganization ($deleteOrganizationId: ID!) { + deleteOrganization(id: $deleteOrganizationId) { + deletedID + } +} +` + +func (c *Client) DeleteOrganization(ctx context.Context, deleteOrganizationID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOrganization, error) { + vars := map[string]any{ + "deleteOrganizationId": deleteOrganizationID, + } + + var res DeleteOrganization + if err := c.Client.Post(ctx, "DeleteOrganization", DeleteOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationsDocument = `query GetAllOrganizations { + organizations { + edges { + node { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + updatedAt + } + } + } +} +` + +func (c *Client) GetAllOrganizations(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizations, error) { + vars := map[string]any{} + + var res GetAllOrganizations + if err := c.Client.Post(ctx, "GetAllOrganizations", GetAllOrganizationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationByIDDocument = `query GetOrganizationByID ($organizationId: ID!) { + organization(id: $organizationId) { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetOrganizationByID(ctx context.Context, organizationID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationByID, error) { + vars := map[string]any{ + "organizationId": organizationID, + } + + var res GetOrganizationByID + if err := c.Client.Post(ctx, "GetOrganizationByID", GetOrganizationByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationsDocument = `query GetOrganizations ($where: OrganizationWhereInput) { + organizations(where: $where) { + edges { + node { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + updatedAt + } + } + } +} +` + +func (c *Client) GetOrganizations(ctx context.Context, where *OrganizationWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizations, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizations + if err := c.Client.Post(ctx, "GetOrganizations", GetOrganizationsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateOrganizationDocument = `mutation UpdateOrganization ($updateOrganizationId: ID!, $input: UpdateOrganizationInput!) { + updateOrganization(id: $updateOrganizationId, input: $input) { + organization { + id + name + displayName + description + personalOrg + tags + members { + id + role + userID + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + } + } +} +` + +func (c *Client) UpdateOrganization(ctx context.Context, updateOrganizationID string, input UpdateOrganizationInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganization, error) { + vars := map[string]any{ + "updateOrganizationId": updateOrganizationID, + "input": input, + } + + var res UpdateOrganization + if err := c.Client.Post(ctx, "UpdateOrganization", UpdateOrganizationDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationHistoriesDocument = `query GetAllOrganizationHistories { + organizationHistories { + edges { + node { + avatarRemoteURL + createdAt + createdBy + dedicatedDb + description + displayName + historyTime + id + name + operation + personalOrg + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllOrganizationHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationHistories, error) { + vars := map[string]any{} + + var res GetAllOrganizationHistories + if err := c.Client.Post(ctx, "GetAllOrganizationHistories", GetAllOrganizationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationHistoriesDocument = `query GetOrganizationHistories ($where: OrganizationHistoryWhereInput) { + organizationHistories(where: $where) { + edges { + node { + avatarRemoteURL + createdAt + createdBy + dedicatedDb + description + displayName + historyTime + id + name + operation + personalOrg + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetOrganizationHistories(ctx context.Context, where *OrganizationHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizationHistories + if err := c.Client.Post(ctx, "GetOrganizationHistories", GetOrganizationHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationSettingsDocument = `query GetAllOrganizationSettings { + organizationSettings { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } + } +} +` + +func (c *Client) GetAllOrganizationSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettings, error) { + vars := map[string]any{} + + var res GetAllOrganizationSettings + if err := c.Client.Post(ctx, "GetAllOrganizationSettings", GetAllOrganizationSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationSettingByIDDocument = `query GetOrganizationSettingByID ($organizationSettingId: ID!) { + organizationSetting(id: $organizationSettingId) { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } +} +` + +func (c *Client) GetOrganizationSettingByID(ctx context.Context, organizationSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingByID, error) { + vars := map[string]any{ + "organizationSettingId": organizationSettingID, + } + + var res GetOrganizationSettingByID + if err := c.Client.Post(ctx, "GetOrganizationSettingByID", GetOrganizationSettingByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationSettingsDocument = `query GetOrganizationSettings ($where: OrganizationSettingWhereInput!) { + organizationSettings(where: $where) { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } + } +} +` + +func (c *Client) GetOrganizationSettings(ctx context.Context, where OrganizationSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettings, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizationSettings + if err := c.Client.Post(ctx, "GetOrganizationSettings", GetOrganizationSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateOrganizationSettingDocument = `mutation UpdateOrganizationSetting ($updateOrganizationSettingId: ID!, $input: UpdateOrganizationSettingInput!) { + updateOrganizationSetting(id: $updateOrganizationSettingId, input: $input) { + organizationSetting { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } +} +` + +func (c *Client) UpdateOrganizationSetting(ctx context.Context, updateOrganizationSettingID string, input UpdateOrganizationSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrganizationSetting, error) { + vars := map[string]any{ + "updateOrganizationSettingId": updateOrganizationSettingID, + "input": input, + } + + var res UpdateOrganizationSetting + if err := c.Client.Post(ctx, "UpdateOrganizationSetting", UpdateOrganizationSettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrganizationSettingHistoriesDocument = `query GetAllOrganizationSettingHistories { + organizationSettingHistories { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + historyTime + id + operation + organizationID + ref + tags + taxIdentifier + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllOrganizationSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrganizationSettingHistories, error) { + vars := map[string]any{} + + var res GetAllOrganizationSettingHistories + if err := c.Client.Post(ctx, "GetAllOrganizationSettingHistories", GetAllOrganizationSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrganizationSettingHistoriesDocument = `query GetOrganizationSettingHistories ($where: OrganizationSettingHistoryWhereInput) { + organizationSettingHistories(where: $where) { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + historyTime + id + operation + organizationID + ref + tags + taxIdentifier + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetOrganizationSettingHistories(ctx context.Context, where *OrganizationSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrganizationSettingHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrganizationSettingHistories + if err := c.Client.Post(ctx, "GetOrganizationSettingHistories", GetOrganizationSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const AddUserToOrgWithRoleDocument = `mutation AddUserToOrgWithRole ($input: CreateOrgMembershipInput!) { + createOrgMembership(input: $input) { + orgMembership { + id + role + userID + organizationID + } + } +} +` + +func (c *Client) AddUserToOrgWithRole(ctx context.Context, input CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*AddUserToOrgWithRole, error) { + vars := map[string]any{ + "input": input, + } + + var res AddUserToOrgWithRole + if err := c.Client.Post(ctx, "AddUserToOrgWithRole", AddUserToOrgWithRoleDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVOrgMembersDocument = `mutation CreateBulkCSVOrgMembers ($input: Upload!) { + createBulkCSVOrgMembership(input: $input) { + orgMemberships { + id + organizationID + role + userID + } + } +} +` + +func (c *Client) CreateBulkCSVOrgMembers(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrgMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVOrgMembers + if err := c.Client.Post(ctx, "CreateBulkCSVOrgMembers", CreateBulkCSVOrgMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkOrgMembersDocument = `mutation CreateBulkOrgMembers ($input: [CreateOrgMembershipInput!]) { + createBulkOrgMembership(input: $input) { + orgMemberships { + id + organizationID + role + userID + } + } +} +` + +func (c *Client) CreateBulkOrgMembers(ctx context.Context, input []*CreateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrgMembers, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkOrgMembers + if err := c.Client.Post(ctx, "CreateBulkOrgMembers", CreateBulkOrgMembersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrgMembersByOrgIDDocument = `query GetOrgMembersByOrgID ($where: OrgMembershipWhereInput) { + orgMemberships(where: $where) { + edges { + node { + id + organizationID + userID + role + user { + firstName + lastName + id + displayName + email + } + } + } + } +} +` + +func (c *Client) GetOrgMembersByOrgID(ctx context.Context, where *OrgMembershipWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembersByOrgID, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrgMembersByOrgID + if err := c.Client.Post(ctx, "GetOrgMembersByOrgID", GetOrgMembersByOrgIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const RemoveUserFromOrgDocument = `mutation RemoveUserFromOrg ($deleteOrgMembershipId: ID!) { + deleteOrgMembership(id: $deleteOrgMembershipId) { + deletedID + } +} +` + +func (c *Client) RemoveUserFromOrg(ctx context.Context, deleteOrgMembershipID string, interceptors ...clientv2.RequestInterceptor) (*RemoveUserFromOrg, error) { + vars := map[string]any{ + "deleteOrgMembershipId": deleteOrgMembershipID, + } + + var res RemoveUserFromOrg + if err := c.Client.Post(ctx, "RemoveUserFromOrg", RemoveUserFromOrgDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserRoleInOrgDocument = `mutation UpdateUserRoleInOrg ($updateOrgMemberId: ID!, $input: UpdateOrgMembershipInput!) { + updateOrgMembership(id: $updateOrgMemberId, input: $input) { + orgMembership { + id + role + userID + organizationID + } + } +} +` + +func (c *Client) UpdateUserRoleInOrg(ctx context.Context, updateOrgMemberID string, input UpdateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInOrg, error) { + vars := map[string]any{ + "updateOrgMemberId": updateOrgMemberID, + "input": input, + } + + var res UpdateUserRoleInOrg + if err := c.Client.Post(ctx, "UpdateUserRoleInOrg", UpdateUserRoleInOrgDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllOrgMembershipHistoriesDocument = `query GetAllOrgMembershipHistories { + orgMembershipHistories { + edges { + node { + createdAt + createdBy + historyTime + id + operation + organizationID + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetAllOrgMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrgMembershipHistories, error) { + vars := map[string]any{} + + var res GetAllOrgMembershipHistories + if err := c.Client.Post(ctx, "GetAllOrgMembershipHistories", GetAllOrgMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetOrgMembershipHistoriesDocument = `query GetOrgMembershipHistories ($where: OrgMembershipHistoryWhereInput) { + orgMembershipHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + operation + organizationID + ref + role + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetOrgMembershipHistories(ctx context.Context, where *OrgMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembershipHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetOrgMembershipHistories + if err := c.Client.Post(ctx, "GetOrgMembershipHistories", GetOrgMembershipHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVPersonalAccessTokenDocument = `mutation CreateBulkCSVPersonalAccessToken ($input: Upload!) { + createBulkCSVPersonalAccessToken(input: $input) { + personalAccessTokens { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVPersonalAccessToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVPersonalAccessToken + if err := c.Client.Post(ctx, "CreateBulkCSVPersonalAccessToken", CreateBulkCSVPersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkPersonalAccessTokenDocument = `mutation CreateBulkPersonalAccessToken ($input: [CreatePersonalAccessTokenInput!]) { + createBulkPersonalAccessToken(input: $input) { + personalAccessTokens { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } +} +` + +func (c *Client) CreateBulkPersonalAccessToken(ctx context.Context, input []*CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkPersonalAccessToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkPersonalAccessToken + if err := c.Client.Post(ctx, "CreateBulkPersonalAccessToken", CreateBulkPersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreatePersonalAccessTokenDocument = `mutation CreatePersonalAccessToken ($input: CreatePersonalAccessTokenInput!) { + createPersonalAccessToken(input: $input) { + personalAccessToken { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + owner { + id + } + } + } +} +` + +func (c *Client) CreatePersonalAccessToken(ctx context.Context, input CreatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*CreatePersonalAccessToken, error) { + vars := map[string]any{ + "input": input, + } + + var res CreatePersonalAccessToken + if err := c.Client.Post(ctx, "CreatePersonalAccessToken", CreatePersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeletePersonalAccessTokenDocument = `mutation DeletePersonalAccessToken ($deletePersonalAccessTokenId: ID!) { + deletePersonalAccessToken(id: $deletePersonalAccessTokenId) { + deletedID + } +} +` + +func (c *Client) DeletePersonalAccessToken(ctx context.Context, deletePersonalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*DeletePersonalAccessToken, error) { + vars := map[string]any{ + "deletePersonalAccessTokenId": deletePersonalAccessTokenID, + } + + var res DeletePersonalAccessToken + if err := c.Client.Post(ctx, "DeletePersonalAccessToken", DeletePersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllPersonalAccessTokensDocument = `query GetAllPersonalAccessTokens { + personalAccessTokens { + edges { + node { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } + } +} +` + +func (c *Client) GetAllPersonalAccessTokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllPersonalAccessTokens, error) { + vars := map[string]any{} + + var res GetAllPersonalAccessTokens + if err := c.Client.Post(ctx, "GetAllPersonalAccessTokens", GetAllPersonalAccessTokensDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetPersonalAccessTokenByIDDocument = `query GetPersonalAccessTokenByID ($personalAccessTokenId: ID!) { + personalAccessToken(id: $personalAccessTokenId) { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } +} +` + +func (c *Client) GetPersonalAccessTokenByID(ctx context.Context, personalAccessTokenID string, interceptors ...clientv2.RequestInterceptor) (*GetPersonalAccessTokenByID, error) { + vars := map[string]any{ + "personalAccessTokenId": personalAccessTokenID, + } + + var res GetPersonalAccessTokenByID + if err := c.Client.Post(ctx, "GetPersonalAccessTokenByID", GetPersonalAccessTokenByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdatePersonalAccessTokenDocument = `mutation UpdatePersonalAccessToken ($updatePersonalAccessTokenId: ID!, $input: UpdatePersonalAccessTokenInput!) { + updatePersonalAccessToken(id: $updatePersonalAccessTokenId, input: $input) { + personalAccessToken { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + owner { + id + } + } + } +} +` + +func (c *Client) UpdatePersonalAccessToken(ctx context.Context, updatePersonalAccessTokenID string, input UpdatePersonalAccessTokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdatePersonalAccessToken, error) { + vars := map[string]any{ + "updatePersonalAccessTokenId": updatePersonalAccessTokenID, + "input": input, + } + + var res UpdatePersonalAccessToken + if err := c.Client.Post(ctx, "UpdatePersonalAccessToken", UpdatePersonalAccessTokenDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const SearchDocument = `query Search ($query: String!) { + search(query: $query) { + nodes { + ... on OrganizationSearchResult { + organizations { + description + displayName + id + name + } + } + ... on GroupSearchResult { + groups { + description + displayName + id + name + } + } + ... on UserSearchResult { + users { + displayName + email + firstName + id + lastName + } + } + ... on SubscriberSearchResult { + subscribers { + active + email + id + } + } + } + } +} +` + +func (c *Client) Search(ctx context.Context, query string, interceptors ...clientv2.RequestInterceptor) (*Search, error) { + vars := map[string]any{ + "query": query, + } + + var res Search + if err := c.Client.Post(ctx, "Search", SearchDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVSubscriberDocument = `mutation CreateBulkCSVSubscriber ($input: Upload!) { + createBulkCSVSubscriber(input: $input) { + subscribers { + active + email + id + verifiedEmail + } + } +} +` + +func (c *Client) CreateBulkCSVSubscriber(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVSubscriber, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVSubscriber + if err := c.Client.Post(ctx, "CreateBulkCSVSubscriber", CreateBulkCSVSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkSubscriberDocument = `mutation CreateBulkSubscriber ($input: [CreateSubscriberInput!]) { + createBulkSubscriber(input: $input) { + subscribers { + active + email + id + verifiedEmail + } + } +} +` + +func (c *Client) CreateBulkSubscriber(ctx context.Context, input []*CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkSubscriber, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkSubscriber + if err := c.Client.Post(ctx, "CreateBulkSubscriber", CreateBulkSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateSubscriberDocument = `mutation CreateSubscriber ($input: CreateSubscriberInput!) { + createSubscriber(input: $input) { + subscriber { + active + createdAt + createdBy + email + id + updatedAt + updatedBy + verifiedEmail + } + } +} +` + +func (c *Client) CreateSubscriber(ctx context.Context, input CreateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*CreateSubscriber, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateSubscriber + if err := c.Client.Post(ctx, "CreateSubscriber", CreateSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteSubscriberDocument = `mutation DeleteSubscriber ($deleteSubscriberEmail: String!, $subscriberOrganization: ID) { + deleteSubscriber(email: $deleteSubscriberEmail, ownerID: $subscriberOrganization) { + email + } +} +` + +func (c *Client) DeleteSubscriber(ctx context.Context, deleteSubscriberEmail string, subscriberOrganization *string, interceptors ...clientv2.RequestInterceptor) (*DeleteSubscriber, error) { + vars := map[string]any{ + "deleteSubscriberEmail": deleteSubscriberEmail, + "subscriberOrganization": subscriberOrganization, + } + + var res DeleteSubscriber + if err := c.Client.Post(ctx, "DeleteSubscriber", DeleteSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllSubscribersDocument = `query GetAllSubscribers { + subscribers { + edges { + node { + active + email + id + ownerID + verifiedEmail + } + } + } +} +` + +func (c *Client) GetAllSubscribers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllSubscribers, error) { + vars := map[string]any{} + + var res GetAllSubscribers + if err := c.Client.Post(ctx, "GetAllSubscribers", GetAllSubscribersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetSubscriberByEmailDocument = `query GetSubscriberByEmail ($email: String!) { + subscriber(email: $email) { + active + email + id + ownerID + verifiedEmail + } +} +` + +func (c *Client) GetSubscriberByEmail(ctx context.Context, email string, interceptors ...clientv2.RequestInterceptor) (*GetSubscriberByEmail, error) { + vars := map[string]any{ + "email": email, + } + + var res GetSubscriberByEmail + if err := c.Client.Post(ctx, "GetSubscriberByEmail", GetSubscriberByEmailDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetSubscribersDocument = `query GetSubscribers ($where: SubscriberWhereInput) { + subscribers(where: $where) { + edges { + node { + active + email + id + ownerID + verifiedEmail + } + } + } +} +` + +func (c *Client) GetSubscribers(ctx context.Context, where *SubscriberWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetSubscribers, error) { + vars := map[string]any{ + "where": where, + } + + var res GetSubscribers + if err := c.Client.Post(ctx, "GetSubscribers", GetSubscribersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateSubscriberDocument = `mutation UpdateSubscriber ($email: String!, $input: UpdateSubscriberInput!) { + updateSubscriber(email: $email, input: $input) { + subscriber { + active + createdAt + createdBy + email + id + phoneNumber + updatedAt + updatedBy + verifiedEmail + verifiedPhone + } + } +} +` + +func (c *Client) UpdateSubscriber(ctx context.Context, email string, input UpdateSubscriberInput, interceptors ...clientv2.RequestInterceptor) (*UpdateSubscriber, error) { + vars := map[string]any{ + "email": email, + "input": input, + } + + var res UpdateSubscriber + if err := c.Client.Post(ctx, "UpdateSubscriber", UpdateSubscriberDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVTemplateDocument = `mutation CreateBulkCSVTemplate ($input: Upload!) { + createBulkCSVTemplate(input: $input) { + templates { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} +` + +func (c *Client) CreateBulkCSVTemplate(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVTemplate, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVTemplate + if err := c.Client.Post(ctx, "CreateBulkCSVTemplate", CreateBulkCSVTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkTemplateDocument = `mutation CreateBulkTemplate ($input: [CreateTemplateInput!]) { + createBulkTemplate(input: $input) { + templates { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} +` + +func (c *Client) CreateBulkTemplate(ctx context.Context, input []*CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkTemplate, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkTemplate + if err := c.Client.Post(ctx, "CreateBulkTemplate", CreateBulkTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateTemplateDocument = `mutation CreateTemplate ($input: CreateTemplateInput!) { + createTemplate(input: $input) { + template { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} +` + +func (c *Client) CreateTemplate(ctx context.Context, input CreateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*CreateTemplate, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateTemplate + if err := c.Client.Post(ctx, "CreateTemplate", CreateTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllTemplatesDocument = `query GetAllTemplates { + templates { + edges { + node { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } + } + } +} +` + +func (c *Client) GetAllTemplates(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplates, error) { + vars := map[string]any{} + + var res GetAllTemplates + if err := c.Client.Post(ctx, "GetAllTemplates", GetAllTemplatesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetTemplateByIDDocument = `query GetTemplateByID ($getTemplateId: ID!) { + template(id: $getTemplateId) { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } +} +` + +func (c *Client) GetTemplateByID(ctx context.Context, getTemplateID string, interceptors ...clientv2.RequestInterceptor) (*GetTemplateByID, error) { + vars := map[string]any{ + "getTemplateId": getTemplateID, + } + + var res GetTemplateByID + if err := c.Client.Post(ctx, "GetTemplateByID", GetTemplateByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateTemplateDocument = `mutation UpdateTemplate ($updateTemplateId: ID!, $input: UpdateTemplateInput!) { + updateTemplate(id: $updateTemplateId, input: $input) { + template { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } + } +} +` + +func (c *Client) UpdateTemplate(ctx context.Context, updateTemplateID string, input UpdateTemplateInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTemplate, error) { + vars := map[string]any{ + "updateTemplateId": updateTemplateID, + "input": input, + } + + var res UpdateTemplate + if err := c.Client.Post(ctx, "UpdateTemplate", UpdateTemplateDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllTemplateHistoriesDocument = `query GetAllTemplateHistories { + templateHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + jsonconfig + name + operation + ownerID + ref + tags + templateType + uischema + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllTemplateHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTemplateHistories, error) { + vars := map[string]any{} + + var res GetAllTemplateHistories + if err := c.Client.Post(ctx, "GetAllTemplateHistories", GetAllTemplateHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetTemplateHistoriesDocument = `query GetTemplateHistories ($where: TemplateHistoryWhereInput) { + templateHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + jsonconfig + name + operation + ownerID + ref + tags + templateType + uischema + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetTemplateHistories(ctx context.Context, where *TemplateHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetTemplateHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetTemplateHistories + if err := c.Client.Post(ctx, "GetTemplateHistories", GetTemplateHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateTFASettingDocument = `mutation CreateTFASetting ($input: CreateTFASettingInput!) { + createTFASetting(input: $input) { + tfaSetting { + recoveryCodes + totpAllowed + verified + owner { + id + } + } + } +} +` + +func (c *Client) CreateTFASetting(ctx context.Context, input CreateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*CreateTFASetting, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateTFASetting + if err := c.Client.Post(ctx, "CreateTFASetting", CreateTFASettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllTFASettingsDocument = `query GetAllTFASettings { + tfaSettings { + edges { + node { + recoveryCodes + totpAllowed + verified + owner { + id + } + } + } + } +} +` + +func (c *Client) GetAllTFASettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllTFASettings, error) { + vars := map[string]any{} + + var res GetAllTFASettings + if err := c.Client.Post(ctx, "GetAllTFASettings", GetAllTFASettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetTFASettingDocument = `query GetTFASetting { + tfaSetting { + recoveryCodes + totpAllowed + verified + owner { + id + } + } +} +` + +func (c *Client) GetTFASetting(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetTFASetting, error) { + vars := map[string]any{} + + var res GetTFASetting + if err := c.Client.Post(ctx, "GetTFASetting", GetTFASettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateTFASettingDocument = `mutation UpdateTFASetting ($input: UpdateTFASettingInput!) { + updateTFASetting(input: $input) { + tfaSetting { + recoveryCodes + totpAllowed + verified + } + } +} +` + +func (c *Client) UpdateTFASetting(ctx context.Context, input UpdateTFASettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateTFASetting, error) { + vars := map[string]any{ + "input": input, + } + + var res UpdateTFASetting + if err := c.Client.Post(ctx, "UpdateTFASetting", UpdateTFASettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateUserDocument = `mutation CreateUser ($input: CreateUserInput!) { + createUser(input: $input) { + user { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + sub + tags + orgMemberships { + id + organizationID + } + groupMemberships { + id + groupID + } + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) CreateUser(ctx context.Context, input CreateUserInput, interceptors ...clientv2.RequestInterceptor) (*CreateUser, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateUser + if err := c.Client.Post(ctx, "CreateUser", CreateUserDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteUserDocument = `mutation DeleteUser ($deleteUserId: ID!) { + deleteUser(id: $deleteUserId) { + deletedID + } +} +` + +func (c *Client) DeleteUser(ctx context.Context, deleteUserID string, interceptors ...clientv2.RequestInterceptor) (*DeleteUser, error) { + vars := map[string]any{ + "deleteUserId": deleteUserID, + } + + var res DeleteUser + if err := c.Client.Post(ctx, "DeleteUser", DeleteUserDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUsersDocument = `query GetAllUsers { + users { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllUsers(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUsers, error) { + vars := map[string]any{} + + var res GetAllUsers + if err := c.Client.Post(ctx, "GetAllUsers", GetAllUsersDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserByIDDocument = `query GetUserByID ($userId: ID!) { + user(id: $userId) { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + organizations { + id + name + personalOrg + members { + id + role + } + } + updatedAt + updatedBy + createdAt + createdBy + } +} +` + +func (c *Client) GetUserByID(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByID, error) { + vars := map[string]any{ + "userId": userID, + } + + var res GetUserByID + if err := c.Client.Post(ctx, "GetUserByID", GetUserByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserByIDWithOrgsDocument = `query GetUserByIDWithOrgs ($userId: ID!) { + user(id: $userId) { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + orgMemberships { + id + role + user { + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetUserByIDWithOrgs(ctx context.Context, userID string, interceptors ...clientv2.RequestInterceptor) (*GetUserByIDWithOrgs, error) { + vars := map[string]any{ + "userId": userID, + } + + var res GetUserByIDWithOrgs + if err := c.Client.Post(ctx, "GetUserByIDWithOrgs", GetUserByIDWithOrgsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserDocument = `mutation UpdateUser ($updateUserId: ID!, $input: UpdateUserInput!) { + updateUser(id: $updateUserId, input: $input) { + user { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + sub + tags + groupMemberships { + id + } + orgMemberships { + id + } + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) UpdateUser(ctx context.Context, updateUserID string, input UpdateUserInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUser, error) { + vars := map[string]any{ + "updateUserId": updateUserID, + "input": input, + } + + var res UpdateUser + if err := c.Client.Post(ctx, "UpdateUser", UpdateUserDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUserHistoriesDocument = `query GetAllUserHistories { + userHistories { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + avatarUpdatedAt + createdAt + createdBy + displayName + email + firstName + historyTime + id + lastName + lastSeen + operation + ref + role + sub + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllUserHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserHistories, error) { + vars := map[string]any{} + + var res GetAllUserHistories + if err := c.Client.Post(ctx, "GetAllUserHistories", GetAllUserHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserHistoriesDocument = `query GetUserHistories ($where: UserHistoryWhereInput) { + userHistories(where: $where) { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + avatarUpdatedAt + createdAt + createdBy + displayName + email + firstName + historyTime + id + lastName + lastSeen + operation + ref + role + sub + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetUserHistories(ctx context.Context, where *UserHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetUserHistories + if err := c.Client.Post(ctx, "GetUserHistories", GetUserHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUserSettingsDocument = `query GetAllUserSettings { + userSettings { + edges { + node { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllUserSettings(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettings, error) { + vars := map[string]any{} + + var res GetAllUserSettings + if err := c.Client.Post(ctx, "GetAllUserSettings", GetAllUserSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserSettingByIDDocument = `query GetUserSettingByID ($userSettingId: ID!) { + userSetting(id: $userSettingId) { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } +} +` + +func (c *Client) GetUserSettingByID(ctx context.Context, userSettingID string, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingByID, error) { + vars := map[string]any{ + "userSettingId": userSettingID, + } + + var res GetUserSettingByID + if err := c.Client.Post(ctx, "GetUserSettingByID", GetUserSettingByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserSettingsDocument = `query GetUserSettings ($where: UserSettingWhereInput!) { + userSettings(where: $where) { + edges { + node { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetUserSettings(ctx context.Context, where UserSettingWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettings, error) { + vars := map[string]any{ + "where": where, + } + + var res GetUserSettings + if err := c.Client.Post(ctx, "GetUserSettings", GetUserSettingsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateUserSettingDocument = `mutation UpdateUserSetting ($updateUserSettingId: ID!, $input: UpdateUserSettingInput!) { + updateUserSetting(id: $updateUserSettingId, input: $input) { + userSetting { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } +} +` + +func (c *Client) UpdateUserSetting(ctx context.Context, updateUserSettingID string, input UpdateUserSettingInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserSetting, error) { + vars := map[string]any{ + "updateUserSettingId": updateUserSettingID, + "input": input, + } + + var res UpdateUserSetting + if err := c.Client.Post(ctx, "UpdateUserSetting", UpdateUserSettingDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllUserSettingHistoriesDocument = `query GetAllUserSettingHistories { + userSettingHistories { + edges { + node { + createdAt + createdBy + emailConfirmed + historyTime + id + isTfaEnabled + isWebauthnAllowed + locked + operation + ref + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetAllUserSettingHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllUserSettingHistories, error) { + vars := map[string]any{} + + var res GetAllUserSettingHistories + if err := c.Client.Post(ctx, "GetAllUserSettingHistories", GetAllUserSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetUserSettingHistoriesDocument = `query GetUserSettingHistories ($where: UserSettingHistoryWhereInput) { + userSettingHistories(where: $where) { + edges { + node { + createdAt + createdBy + emailConfirmed + historyTime + id + isTfaEnabled + isWebauthnAllowed + locked + operation + ref + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + userID + } + } + } +} +` + +func (c *Client) GetUserSettingHistories(ctx context.Context, where *UserSettingHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetUserSettingHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetUserSettingHistories + if err := c.Client.Post(ctx, "GetUserSettingHistories", GetUserSettingHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetWebhookByIDDocument = `query GetWebhookByID ($webhookId: ID!) { + webhook(id: $webhookId) { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } +} +` + +func (c *Client) GetWebhookByID(ctx context.Context, webhookID string, interceptors ...clientv2.RequestInterceptor) (*GetWebhookByID, error) { + vars := map[string]any{ + "webhookId": webhookID, + } + + var res GetWebhookByID + if err := c.Client.Post(ctx, "GetWebhookByID", GetWebhookByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllWebhooksDocument = `query GetAllWebhooks { + webhooks { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } + } + } +} +` + +func (c *Client) GetAllWebhooks(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhooks, error) { + vars := map[string]any{} + + var res GetAllWebhooks + if err := c.Client.Post(ctx, "GetAllWebhooks", GetAllWebhooksDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateWebhookDocument = `mutation CreateWebhook ($input: CreateWebhookInput!) { + createWebhook(input: $input) { + webhook { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + events { + id + } + } + } +} +` + +func (c *Client) CreateWebhook(ctx context.Context, input CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateWebhook, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateWebhook + if err := c.Client.Post(ctx, "CreateWebhook", CreateWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkWebhookDocument = `mutation CreateBulkWebhook ($input: [CreateWebhookInput!]) { + createBulkWebhook(input: $input) { + webhooks { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + } + } +} +` + +func (c *Client) CreateBulkWebhook(ctx context.Context, input []*CreateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkWebhook, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkWebhook + if err := c.Client.Post(ctx, "CreateBulkWebhook", CreateBulkWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const CreateBulkCSVWebhookDocument = `mutation CreateBulkCSVWebhook ($input: Upload!) { + createBulkCSVWebhook(input: $input) { + webhooks { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + } + } +} +` + +func (c *Client) CreateBulkCSVWebhook(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVWebhook, error) { + vars := map[string]any{ + "input": input, + } + + var res CreateBulkCSVWebhook + if err := c.Client.Post(ctx, "CreateBulkCSVWebhook", CreateBulkCSVWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const UpdateWebhookDocument = `mutation UpdateWebhook ($updateWebhookId: ID!, $input: UpdateWebhookInput!) { + updateWebhook(id: $updateWebhookId, input: $input) { + webhook { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } + } +} +` + +func (c *Client) UpdateWebhook(ctx context.Context, updateWebhookID string, input UpdateWebhookInput, interceptors ...clientv2.RequestInterceptor) (*UpdateWebhook, error) { + vars := map[string]any{ + "updateWebhookId": updateWebhookID, + "input": input, + } + + var res UpdateWebhook + if err := c.Client.Post(ctx, "UpdateWebhook", UpdateWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const DeleteWebhookDocument = `mutation DeleteWebhook ($deleteWebhookId: ID!) { + deleteWebhook(id: $deleteWebhookId) { + deletedID + } +} +` + +func (c *Client) DeleteWebhook(ctx context.Context, deleteWebhookID string, interceptors ...clientv2.RequestInterceptor) (*DeleteWebhook, error) { + vars := map[string]any{ + "deleteWebhookId": deleteWebhookID, + } + + var res DeleteWebhook + if err := c.Client.Post(ctx, "DeleteWebhook", DeleteWebhookDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetAllWebhookHistoriesDocument = `query GetAllWebhookHistories { + webhookHistories { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + historyTime + id + lastError + lastResponse + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetAllWebhookHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllWebhookHistories, error) { + vars := map[string]any{} + + var res GetAllWebhookHistories + if err := c.Client.Post(ctx, "GetAllWebhookHistories", GetAllWebhookHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +const GetWebhookHistoriesDocument = `query GetWebhookHistories ($where: WebhookHistoryWhereInput) { + webhookHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + historyTime + id + lastError + lastResponse + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} +` + +func (c *Client) GetWebhookHistories(ctx context.Context, where *WebhookHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetWebhookHistories, error) { + vars := map[string]any{ + "where": where, + } + + var res GetWebhookHistories + if err := c.Client.Post(ctx, "GetWebhookHistories", GetWebhookHistoriesDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + +var DocumentOperationNames = map[string]string{ + CreateAPITokenDocument: "CreateAPIToken", + UpdateAPITokenDocument: "UpdateAPIToken", + GetAllAPITokensDocument: "GetAllAPITokens", + GetAPITokenByIDDocument: "GetAPITokenByID", + DeleteAPITokenDocument: "DeleteAPIToken", + CreateBulkCSVContactDocument: "CreateBulkCSVContact", + CreateBulkContactDocument: "CreateBulkContact", + CreateContactDocument: "CreateContact", + DeleteContactDocument: "DeleteContact", + GetAllContactsDocument: "GetAllContacts", + GetContactByIDDocument: "GetContactByID", + GetContactsDocument: "GetContacts", + UpdateContactDocument: "UpdateContact", + GetAllContactHistoriesDocument: "GetAllContactHistories", + GetContactHistoriesDocument: "GetContactHistories", + CreateDocumentDataDocument: "CreateDocumentData", + DeleteDocumentDataDocument: "DeleteDocumentData", + GetDocumentDataByIDDocument: "GetDocumentDataByID", + UpdateDocumentDataDocument: "UpdateDocumentData", + GetAllDocumentDataHistoriesDocument: "GetAllDocumentDataHistories", + GetDocumentDataHistoriesDocument: "GetDocumentDataHistories", + CreateBulkCSVEntitlementDocument: "CreateBulkCSVEntitlement", + CreateBulkEntitlementDocument: "CreateBulkEntitlement", + CreateEntitlementDocument: "CreateEntitlement", + DeleteEntitlementDocument: "DeleteEntitlement", + GetAllEntitlementsDocument: "GetAllEntitlements", + GetEntitlementByIDDocument: "GetEntitlementByID", + GetEntitlementsDocument: "GetEntitlements", + UpdateEntitlementDocument: "UpdateEntitlement", + GetAllEntitlementHistoriesDocument: "GetAllEntitlementHistories", + GetEntitlementHistoriesDocument: "GetEntitlementHistories", + CreateBulkCSVEntitlementPlanDocument: "CreateBulkCSVEntitlementPlan", + CreateBulkEntitlementPlanDocument: "CreateBulkEntitlementPlan", + CreateEntitlementPlanDocument: "CreateEntitlementPlan", + DeleteEntitlementPlanDocument: "DeleteEntitlementPlan", + GetAllEntitlementPlansDocument: "GetAllEntitlementPlans", + GetEntitlementPlanByIDDocument: "GetEntitlementPlanByID", + GetEntitlementPlansDocument: "GetEntitlementPlans", + UpdateEntitlementPlanDocument: "UpdateEntitlementPlan", + GetAllEntitlementPlanFeaturesDocument: "GetAllEntitlementPlanFeatures", + GetEntitlementPlanFeatureByIDDocument: "GetEntitlementPlanFeatureByID", + GetEntitlementPlanFeaturesDocument: "GetEntitlementPlanFeatures", + CreateEntitlementPlanFeatureDocument: "CreateEntitlementPlanFeature", + CreateBulkCSVEntitlementPlanFeatureDocument: "CreateBulkCSVEntitlementPlanFeature", + CreateBulkEntitlementPlanFeatureDocument: "CreateBulkEntitlementPlanFeature", + UpdateEntitlementPlanFeatureDocument: "UpdateEntitlementPlanFeature", + DeleteEntitlementPlanFeatureDocument: "DeleteEntitlementPlanFeature", + GetAllEntitlementPlanFeatureHistoriesDocument: "GetAllEntitlementPlanFeatureHistories", + GetEntitlementPlanFeatureHistoriesDocument: "GetEntitlementPlanFeatureHistories", + GetAllEntitlementPlanHistoriesDocument: "GetAllEntitlementPlanHistories", + GetEntitlementPlanHistoriesDocument: "GetEntitlementPlanHistories", + CreateBulkCSVEntityDocument: "CreateBulkCSVEntity", + CreateBulkEntityDocument: "CreateBulkEntity", + CreateEntityDocument: "CreateEntity", + DeleteEntityDocument: "DeleteEntity", + GetAllEntitiesDocument: "GetAllEntities", + GetEntitiesDocument: "GetEntities", + GetEntityByIDDocument: "GetEntityByID", + UpdateEntityDocument: "UpdateEntity", + GetAllEntityHistoriesDocument: "GetAllEntityHistories", + GetEntityHistoriesDocument: "GetEntityHistories", + CreateBulkCSVEntityTypeDocument: "CreateBulkCSVEntityType", + CreateBulkEntityTypeDocument: "CreateBulkEntityType", + CreateEntityTypeDocument: "CreateEntityType", + DeleteEntityTypeDocument: "DeleteEntityType", + GetAllEntityTypesDocument: "GetAllEntityTypes", + GetEntityTypeByIDDocument: "GetEntityTypeByID", + GetEntityTypesDocument: "GetEntityTypes", + UpdateEntityTypeDocument: "UpdateEntityType", + GetAllEntityTypeHistoriesDocument: "GetAllEntityTypeHistories", + GetEntityTypeHistoriesDocument: "GetEntityTypeHistories", + GetEventsDocument: "GetEvents", + GetEventByIDDocument: "GetEventByID", + GetAllEventsDocument: "GetAllEvents", + CreateEventDocument: "CreateEvent", + CreateBulkEventDocument: "CreateBulkEvent", + CreateBulkCSVEventDocument: "CreateBulkCSVEvent", + UpdateEventDocument: "UpdateEvent", + DeleteEventDocument: "DeleteEvent", + GetAllEventHistoriesDocument: "GetAllEventHistories", + GetEventHistoriesDocument: "GetEventHistories", + CreateBulkCSVFeatureDocument: "CreateBulkCSVFeature", + CreateBulkFeatureDocument: "CreateBulkFeature", + CreateFeatureDocument: "CreateFeature", + DeleteFeatureDocument: "DeleteFeature", + GetAllFeaturesDocument: "GetAllFeatures", + GetFeatureByIDDocument: "GetFeatureByID", + GetFeaturesDocument: "GetFeatures", + UpdateFeatureDocument: "UpdateFeature", + GetAllFeatureHistoriesDocument: "GetAllFeatureHistories", + GetFeatureHistoriesDocument: "GetFeatureHistories", + CreateBulkCSVFileDocument: "CreateBulkCSVFile", + CreateBulkFileDocument: "CreateBulkFile", + CreateFileDocument: "CreateFile", + DeleteFileDocument: "DeleteFile", + GetAllFilesDocument: "GetAllFiles", + GetFilesDocument: "GetFiles", + UpdateFileDocument: "UpdateFile", + GetAllFileHistoriesDocument: "GetAllFileHistories", + GetFileHistoriesDocument: "GetFileHistories", + CreateBulkCSVGroupDocument: "CreateBulkCSVGroup", + CreateBulkGroupDocument: "CreateBulkGroup", + CreateGroupDocument: "CreateGroup", + DeleteGroupDocument: "DeleteGroup", + GetAllGroupsDocument: "GetAllGroups", + GetGroupByIDDocument: "GetGroupByID", + GetGroupsDocument: "GetGroups", + UpdateGroupDocument: "UpdateGroup", + GetAllGroupHistoriesDocument: "GetAllGroupHistories", + GetGroupHistoriesDocument: "GetGroupHistories", + AddUserToGroupWithRoleDocument: "AddUserToGroupWithRole", + CreateBulkCSVGroupMembersDocument: "CreateBulkCSVGroupMembers", + CreateBulkGroupMembersDocument: "CreateBulkGroupMembers", + GetGroupMembersByGroupIDDocument: "GetGroupMembersByGroupID", + RemoveUserFromGroupDocument: "RemoveUserFromGroup", + UpdateUserRoleInGroupDocument: "UpdateUserRoleInGroup", + GetAllGroupMembershipHistoriesDocument: "GetAllGroupMembershipHistories", + GetGroupMembershipHistoriesDocument: "GetGroupMembershipHistories", + GetAllGroupSettingsDocument: "GetAllGroupSettings", + GetGroupSettingByIDDocument: "GetGroupSettingByID", + GetGroupSettingsDocument: "GetGroupSettings", + UpdateGroupSettingDocument: "UpdateGroupSetting", + GetAllGroupSettingHistoriesDocument: "GetAllGroupSettingHistories", + GetGroupSettingHistoriesDocument: "GetGroupSettingHistories", + CreateBulkCSVHushDocument: "CreateBulkCSVHush", + CreateBulkHushDocument: "CreateBulkHush", + CreateHushDocument: "CreateHush", + GetAllHushesDocument: "GetAllHushes", + GetHushByIDDocument: "GetHushByID", + GetHushesDocument: "GetHushes", + UpdateHushDocument: "UpdateHush", + GetAllHushHistoriesDocument: "GetAllHushHistories", + GetHushHistoriesDocument: "GetHushHistories", + CreateBulkCSVIntegrationDocument: "CreateBulkCSVIntegration", + CreateBulkIntegrationDocument: "CreateBulkIntegration", + CreateIntegrationDocument: "CreateIntegration", + DeleteIntegrationDocument: "DeleteIntegration", + GetAllIntegrationsDocument: "GetAllIntegrations", + GetIntegrationByIDDocument: "GetIntegrationByID", + GetIntegrationsDocument: "GetIntegrations", + UpdateIntegrationDocument: "UpdateIntegration", + GetAllIntegrationHistoriesDocument: "GetAllIntegrationHistories", + GetIntegrationHistoriesDocument: "GetIntegrationHistories", + CreateBulkCSVInviteDocument: "CreateBulkCSVInvite", + CreateBulkInviteDocument: "CreateBulkInvite", + CreateInviteDocument: "CreateInvite", + DeleteInviteDocument: "DeleteInvite", + GetInviteByIDDocument: "GetInviteByID", + GetAllInvitesDocument: "GetAllInvites", + InvitesByOrgIDDocument: "InvitesByOrgID", + GetAllNoteHistoriesDocument: "GetAllNoteHistories", + GetNoteHistoriesDocument: "GetNoteHistories", + GetAllOauthProviderHistoriesDocument: "GetAllOauthProviderHistories", + GetOauthProviderHistoriesDocument: "GetOauthProviderHistories", + CreateBulkCSVOhAuthTooTokenDocument: "CreateBulkCSVOhAuthTooToken", + CreateBulkOhAuthTooTokenDocument: "CreateBulkOhAuthTooToken", + CreateOhAuthTooTokenDocument: "CreateOhAuthTooToken", + DeleteOhAuthTooTokenDocument: "DeleteOhAuthTooToken", + GetOhAuthTooTokensDocument: "GetOhAuthTooTokens", + UpdateOhAuthTooTokenDocument: "UpdateOhAuthTooToken", + CreateBulkCSVOrganizationDocument: "CreateBulkCSVOrganization", + CreateBulkOrganizationDocument: "CreateBulkOrganization", + CreateOrganizationDocument: "CreateOrganization", + DeleteOrganizationDocument: "DeleteOrganization", + GetAllOrganizationsDocument: "GetAllOrganizations", + GetOrganizationByIDDocument: "GetOrganizationByID", + GetOrganizationsDocument: "GetOrganizations", + UpdateOrganizationDocument: "UpdateOrganization", + GetAllOrganizationHistoriesDocument: "GetAllOrganizationHistories", + GetOrganizationHistoriesDocument: "GetOrganizationHistories", + GetAllOrganizationSettingsDocument: "GetAllOrganizationSettings", + GetOrganizationSettingByIDDocument: "GetOrganizationSettingByID", + GetOrganizationSettingsDocument: "GetOrganizationSettings", + UpdateOrganizationSettingDocument: "UpdateOrganizationSetting", + GetAllOrganizationSettingHistoriesDocument: "GetAllOrganizationSettingHistories", + GetOrganizationSettingHistoriesDocument: "GetOrganizationSettingHistories", + AddUserToOrgWithRoleDocument: "AddUserToOrgWithRole", + CreateBulkCSVOrgMembersDocument: "CreateBulkCSVOrgMembers", + CreateBulkOrgMembersDocument: "CreateBulkOrgMembers", + GetOrgMembersByOrgIDDocument: "GetOrgMembersByOrgID", + RemoveUserFromOrgDocument: "RemoveUserFromOrg", + UpdateUserRoleInOrgDocument: "UpdateUserRoleInOrg", + GetAllOrgMembershipHistoriesDocument: "GetAllOrgMembershipHistories", + GetOrgMembershipHistoriesDocument: "GetOrgMembershipHistories", + CreateBulkCSVPersonalAccessTokenDocument: "CreateBulkCSVPersonalAccessToken", + CreateBulkPersonalAccessTokenDocument: "CreateBulkPersonalAccessToken", + CreatePersonalAccessTokenDocument: "CreatePersonalAccessToken", + DeletePersonalAccessTokenDocument: "DeletePersonalAccessToken", + GetAllPersonalAccessTokensDocument: "GetAllPersonalAccessTokens", + GetPersonalAccessTokenByIDDocument: "GetPersonalAccessTokenByID", + UpdatePersonalAccessTokenDocument: "UpdatePersonalAccessToken", + SearchDocument: "Search", + CreateBulkCSVSubscriberDocument: "CreateBulkCSVSubscriber", + CreateBulkSubscriberDocument: "CreateBulkSubscriber", + CreateSubscriberDocument: "CreateSubscriber", + DeleteSubscriberDocument: "DeleteSubscriber", + GetAllSubscribersDocument: "GetAllSubscribers", + GetSubscriberByEmailDocument: "GetSubscriberByEmail", + GetSubscribersDocument: "GetSubscribers", + UpdateSubscriberDocument: "UpdateSubscriber", + CreateBulkCSVTemplateDocument: "CreateBulkCSVTemplate", + CreateBulkTemplateDocument: "CreateBulkTemplate", + CreateTemplateDocument: "CreateTemplate", + GetAllTemplatesDocument: "GetAllTemplates", + GetTemplateByIDDocument: "GetTemplateByID", + UpdateTemplateDocument: "UpdateTemplate", + GetAllTemplateHistoriesDocument: "GetAllTemplateHistories", + GetTemplateHistoriesDocument: "GetTemplateHistories", + CreateTFASettingDocument: "CreateTFASetting", + GetAllTFASettingsDocument: "GetAllTFASettings", + GetTFASettingDocument: "GetTFASetting", + UpdateTFASettingDocument: "UpdateTFASetting", + CreateUserDocument: "CreateUser", + DeleteUserDocument: "DeleteUser", + GetAllUsersDocument: "GetAllUsers", + GetUserByIDDocument: "GetUserByID", + GetUserByIDWithOrgsDocument: "GetUserByIDWithOrgs", + UpdateUserDocument: "UpdateUser", + GetAllUserHistoriesDocument: "GetAllUserHistories", + GetUserHistoriesDocument: "GetUserHistories", + GetAllUserSettingsDocument: "GetAllUserSettings", + GetUserSettingByIDDocument: "GetUserSettingByID", + GetUserSettingsDocument: "GetUserSettings", + UpdateUserSettingDocument: "UpdateUserSetting", + GetAllUserSettingHistoriesDocument: "GetAllUserSettingHistories", + GetUserSettingHistoriesDocument: "GetUserSettingHistories", + GetWebhookByIDDocument: "GetWebhookByID", + GetAllWebhooksDocument: "GetAllWebhooks", + CreateWebhookDocument: "CreateWebhook", + CreateBulkWebhookDocument: "CreateBulkWebhook", + CreateBulkCSVWebhookDocument: "CreateBulkCSVWebhook", + UpdateWebhookDocument: "UpdateWebhook", + DeleteWebhookDocument: "DeleteWebhook", + GetAllWebhookHistoriesDocument: "GetAllWebhookHistories", + GetWebhookHistoriesDocument: "GetWebhookHistories", +} diff --git a/pkg/openlaneclient/interceptor.go b/pkg/openlaneclient/interceptor.go new file mode 100644 index 0000000..b834302 --- /dev/null +++ b/pkg/openlaneclient/interceptor.go @@ -0,0 +1,45 @@ +package openlaneclient + +import ( + "context" + "fmt" + "net/http" + + "github.com/Yamashou/gqlgenc/clientv2" +) + +// WithAuthorizationAndSession adds the authorization header and session to the client request +func (a Authorization) WithAuthorization() clientv2.RequestInterceptor { + return func( + ctx context.Context, + req *http.Request, + gqlInfo *clientv2.GQLRequestInfo, + res interface{}, + next clientv2.RequestInterceptorFunc, + ) error { + // setting authorization header if its not already set + a.SetAuthorizationHeader(req) + + // add session cookie + a.SetSessionCookie(req) + + return next(ctx, req, gqlInfo, res) + } +} + +// WithLoggingInterceptor adds a http debug logging interceptor +func WithLoggingInterceptor() clientv2.RequestInterceptor { + return func(ctx context.Context, req *http.Request, gqlInfo *clientv2.GQLRequestInfo, res interface{}, next clientv2.RequestInterceptorFunc) error { + fmt.Println("Request header sent:", req.Header) + fmt.Println("Request body sent:", req.Body) + + return next(ctx, req, gqlInfo, res) + } +} + +// WithEmptyInterceptor adds an empty interceptor +func WithEmptyInterceptor() clientv2.RequestInterceptor { + return func(ctx context.Context, req *http.Request, gqlInfo *clientv2.GQLRequestInfo, res interface{}, next clientv2.RequestInterceptorFunc) error { + return next(ctx, req, gqlInfo, res) + } +} diff --git a/pkg/openlaneclient/models.go b/pkg/openlaneclient/models.go new file mode 100644 index 0000000..4202b66 --- /dev/null +++ b/pkg/openlaneclient/models.go @@ -0,0 +1,15426 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package openlaneclient + +import ( + "encoding/json" + "fmt" + "io" + "strconv" + "time" + + "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/entx/history" +) + +type GlobalSearchResult interface { + IsGlobalSearchResult() +} + +type APIToken struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name associated with the token + Name string `json:"name"` + Token string `json:"token"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + Owner *Organization `json:"owner,omitempty"` +} + +func (APIToken) IsNode() {} + +// Return response for createBulkAPIToken mutation +type APITokenBulkCreatePayload struct { + // Created apiTokens + APITokens []*APIToken `json:"apiTokens,omitempty"` +} + +// A connection to a list of items. +type APITokenConnection struct { + // A list of edges. + Edges []*APITokenEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createAPIToken mutation +type APITokenCreatePayload struct { + // Created apiToken + APIToken *APIToken `json:"apiToken"` +} + +// Return response for deleteAPIToken mutation +type APITokenDeletePayload struct { + // Deleted apiToken ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type APITokenEdge struct { + // The item at the end of the edge. + Node *APIToken `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateAPIToken mutation +type APITokenUpdatePayload struct { + // Updated apiToken + APIToken *APIToken `json:"apiToken"` +} + +// APITokenWhereInput is used for filtering APIToken objects. +// Input was generated by ent. +type APITokenWhereInput struct { + Not *APITokenWhereInput `json:"not,omitempty"` + And []*APITokenWhereInput `json:"and,omitempty"` + Or []*APITokenWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // last_used_at field predicates + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + LastUsedAtNeq *time.Time `json:"lastUsedAtNEQ,omitempty"` + LastUsedAtIn []*time.Time `json:"lastUsedAtIn,omitempty"` + LastUsedAtNotIn []*time.Time `json:"lastUsedAtNotIn,omitempty"` + LastUsedAtGt *time.Time `json:"lastUsedAtGT,omitempty"` + LastUsedAtGte *time.Time `json:"lastUsedAtGTE,omitempty"` + LastUsedAtLt *time.Time `json:"lastUsedAtLT,omitempty"` + LastUsedAtLte *time.Time `json:"lastUsedAtLTE,omitempty"` + LastUsedAtIsNil *bool `json:"lastUsedAtIsNil,omitempty"` + LastUsedAtNotNil *bool `json:"lastUsedAtNotNil,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` +} + +type AuditLog struct { + Table *string `json:"table,omitempty"` + Time *time.Time `json:"time,omitempty"` + ID string `json:"id"` + Operation *string `json:"operation,omitempty"` + Changes []string `json:"changes,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` +} + +func (AuditLog) IsNode() {} + +// A connection to a list of items. +type AuditLogConnection struct { + // A list of edges. + Edges []*AuditLogEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type AuditLogEdge struct { + // The item at the end of the edge. + Node *AuditLog `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type AuditLogWhereInput struct { + RefID *string `json:"refID,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + Operation *string `json:"operation,omitempty"` + Table *string `json:"table,omitempty"` + Before *time.Time `json:"before,omitempty"` + After *time.Time `json:"after,omitempty"` +} + +type Contact struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the full name of the contact + FullName string `json:"fullName"` + // the title of the contact + Title *string `json:"title,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + // status of the contact + Status enums.UserStatus `json:"status"` + Owner *Organization `json:"owner,omitempty"` + Entities []*Entity `json:"entities,omitempty"` +} + +func (Contact) IsNode() {} + +// Return response for createBulkContact mutation +type ContactBulkCreatePayload struct { + // Created contacts + Contacts []*Contact `json:"contacts,omitempty"` +} + +// A connection to a list of items. +type ContactConnection struct { + // A list of edges. + Edges []*ContactEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createContact mutation +type ContactCreatePayload struct { + // Created contact + Contact *Contact `json:"contact"` +} + +// Return response for deleteContact mutation +type ContactDeletePayload struct { + // Deleted contact ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type ContactEdge struct { + // The item at the end of the edge. + Node *Contact `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type ContactHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the full name of the contact + FullName string `json:"fullName"` + // the title of the contact + Title *string `json:"title,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + // status of the contact + Status enums.UserStatus `json:"status"` +} + +func (ContactHistory) IsNode() {} + +// A connection to a list of items. +type ContactHistoryConnection struct { + // A list of edges. + Edges []*ContactHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type ContactHistoryEdge struct { + // The item at the end of the edge. + Node *ContactHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// ContactHistoryWhereInput is used for filtering ContactHistory objects. +// Input was generated by ent. +type ContactHistoryWhereInput struct { + Not *ContactHistoryWhereInput `json:"not,omitempty"` + And []*ContactHistoryWhereInput `json:"and,omitempty"` + Or []*ContactHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // full_name field predicates + FullName *string `json:"fullName,omitempty"` + FullNameNeq *string `json:"fullNameNEQ,omitempty"` + FullNameIn []string `json:"fullNameIn,omitempty"` + FullNameNotIn []string `json:"fullNameNotIn,omitempty"` + FullNameGt *string `json:"fullNameGT,omitempty"` + FullNameGte *string `json:"fullNameGTE,omitempty"` + FullNameLt *string `json:"fullNameLT,omitempty"` + FullNameLte *string `json:"fullNameLTE,omitempty"` + FullNameContains *string `json:"fullNameContains,omitempty"` + FullNameHasPrefix *string `json:"fullNameHasPrefix,omitempty"` + FullNameHasSuffix *string `json:"fullNameHasSuffix,omitempty"` + FullNameEqualFold *string `json:"fullNameEqualFold,omitempty"` + FullNameContainsFold *string `json:"fullNameContainsFold,omitempty"` + // title field predicates + Title *string `json:"title,omitempty"` + TitleNeq *string `json:"titleNEQ,omitempty"` + TitleIn []string `json:"titleIn,omitempty"` + TitleNotIn []string `json:"titleNotIn,omitempty"` + TitleGt *string `json:"titleGT,omitempty"` + TitleGte *string `json:"titleGTE,omitempty"` + TitleLt *string `json:"titleLT,omitempty"` + TitleLte *string `json:"titleLTE,omitempty"` + TitleContains *string `json:"titleContains,omitempty"` + TitleHasPrefix *string `json:"titleHasPrefix,omitempty"` + TitleHasSuffix *string `json:"titleHasSuffix,omitempty"` + TitleIsNil *bool `json:"titleIsNil,omitempty"` + TitleNotNil *bool `json:"titleNotNil,omitempty"` + TitleEqualFold *string `json:"titleEqualFold,omitempty"` + TitleContainsFold *string `json:"titleContainsFold,omitempty"` + // company field predicates + Company *string `json:"company,omitempty"` + CompanyNeq *string `json:"companyNEQ,omitempty"` + CompanyIn []string `json:"companyIn,omitempty"` + CompanyNotIn []string `json:"companyNotIn,omitempty"` + CompanyGt *string `json:"companyGT,omitempty"` + CompanyGte *string `json:"companyGTE,omitempty"` + CompanyLt *string `json:"companyLT,omitempty"` + CompanyLte *string `json:"companyLTE,omitempty"` + CompanyContains *string `json:"companyContains,omitempty"` + CompanyHasPrefix *string `json:"companyHasPrefix,omitempty"` + CompanyHasSuffix *string `json:"companyHasSuffix,omitempty"` + CompanyIsNil *bool `json:"companyIsNil,omitempty"` + CompanyNotNil *bool `json:"companyNotNil,omitempty"` + CompanyEqualFold *string `json:"companyEqualFold,omitempty"` + CompanyContainsFold *string `json:"companyContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailIsNil *bool `json:"emailIsNil,omitempty"` + EmailNotNil *bool `json:"emailNotNil,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // phone_number field predicates + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNeq *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGt *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGte *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLt *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLte *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil *bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil *bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + // address field predicates + Address *string `json:"address,omitempty"` + AddressNeq *string `json:"addressNEQ,omitempty"` + AddressIn []string `json:"addressIn,omitempty"` + AddressNotIn []string `json:"addressNotIn,omitempty"` + AddressGt *string `json:"addressGT,omitempty"` + AddressGte *string `json:"addressGTE,omitempty"` + AddressLt *string `json:"addressLT,omitempty"` + AddressLte *string `json:"addressLTE,omitempty"` + AddressContains *string `json:"addressContains,omitempty"` + AddressHasPrefix *string `json:"addressHasPrefix,omitempty"` + AddressHasSuffix *string `json:"addressHasSuffix,omitempty"` + AddressIsNil *bool `json:"addressIsNil,omitempty"` + AddressNotNil *bool `json:"addressNotNil,omitempty"` + AddressEqualFold *string `json:"addressEqualFold,omitempty"` + AddressContainsFold *string `json:"addressContainsFold,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` +} + +// Return response for updateContact mutation +type ContactUpdatePayload struct { + // Updated contact + Contact *Contact `json:"contact"` +} + +// ContactWhereInput is used for filtering Contact objects. +// Input was generated by ent. +type ContactWhereInput struct { + Not *ContactWhereInput `json:"not,omitempty"` + And []*ContactWhereInput `json:"and,omitempty"` + Or []*ContactWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // full_name field predicates + FullName *string `json:"fullName,omitempty"` + FullNameNeq *string `json:"fullNameNEQ,omitempty"` + FullNameIn []string `json:"fullNameIn,omitempty"` + FullNameNotIn []string `json:"fullNameNotIn,omitempty"` + FullNameGt *string `json:"fullNameGT,omitempty"` + FullNameGte *string `json:"fullNameGTE,omitempty"` + FullNameLt *string `json:"fullNameLT,omitempty"` + FullNameLte *string `json:"fullNameLTE,omitempty"` + FullNameContains *string `json:"fullNameContains,omitempty"` + FullNameHasPrefix *string `json:"fullNameHasPrefix,omitempty"` + FullNameHasSuffix *string `json:"fullNameHasSuffix,omitempty"` + FullNameEqualFold *string `json:"fullNameEqualFold,omitempty"` + FullNameContainsFold *string `json:"fullNameContainsFold,omitempty"` + // title field predicates + Title *string `json:"title,omitempty"` + TitleNeq *string `json:"titleNEQ,omitempty"` + TitleIn []string `json:"titleIn,omitempty"` + TitleNotIn []string `json:"titleNotIn,omitempty"` + TitleGt *string `json:"titleGT,omitempty"` + TitleGte *string `json:"titleGTE,omitempty"` + TitleLt *string `json:"titleLT,omitempty"` + TitleLte *string `json:"titleLTE,omitempty"` + TitleContains *string `json:"titleContains,omitempty"` + TitleHasPrefix *string `json:"titleHasPrefix,omitempty"` + TitleHasSuffix *string `json:"titleHasSuffix,omitempty"` + TitleIsNil *bool `json:"titleIsNil,omitempty"` + TitleNotNil *bool `json:"titleNotNil,omitempty"` + TitleEqualFold *string `json:"titleEqualFold,omitempty"` + TitleContainsFold *string `json:"titleContainsFold,omitempty"` + // company field predicates + Company *string `json:"company,omitempty"` + CompanyNeq *string `json:"companyNEQ,omitempty"` + CompanyIn []string `json:"companyIn,omitempty"` + CompanyNotIn []string `json:"companyNotIn,omitempty"` + CompanyGt *string `json:"companyGT,omitempty"` + CompanyGte *string `json:"companyGTE,omitempty"` + CompanyLt *string `json:"companyLT,omitempty"` + CompanyLte *string `json:"companyLTE,omitempty"` + CompanyContains *string `json:"companyContains,omitempty"` + CompanyHasPrefix *string `json:"companyHasPrefix,omitempty"` + CompanyHasSuffix *string `json:"companyHasSuffix,omitempty"` + CompanyIsNil *bool `json:"companyIsNil,omitempty"` + CompanyNotNil *bool `json:"companyNotNil,omitempty"` + CompanyEqualFold *string `json:"companyEqualFold,omitempty"` + CompanyContainsFold *string `json:"companyContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailIsNil *bool `json:"emailIsNil,omitempty"` + EmailNotNil *bool `json:"emailNotNil,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // phone_number field predicates + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNeq *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGt *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGte *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLt *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLte *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil *bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil *bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + // address field predicates + Address *string `json:"address,omitempty"` + AddressNeq *string `json:"addressNEQ,omitempty"` + AddressIn []string `json:"addressIn,omitempty"` + AddressNotIn []string `json:"addressNotIn,omitempty"` + AddressGt *string `json:"addressGT,omitempty"` + AddressGte *string `json:"addressGTE,omitempty"` + AddressLt *string `json:"addressLT,omitempty"` + AddressLte *string `json:"addressLTE,omitempty"` + AddressContains *string `json:"addressContains,omitempty"` + AddressHasPrefix *string `json:"addressHasPrefix,omitempty"` + AddressHasSuffix *string `json:"addressHasSuffix,omitempty"` + AddressIsNil *bool `json:"addressIsNil,omitempty"` + AddressNotNil *bool `json:"addressNotNil,omitempty"` + AddressEqualFold *string `json:"addressEqualFold,omitempty"` + AddressContainsFold *string `json:"addressContainsFold,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entities edge predicates + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` +} + +// CreateAPITokenInput is used for create APIToken object. +// Input was generated by ent. +type CreateAPITokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name associated with the token + Name string `json:"name"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` +} + +// CreateContactInput is used for create Contact object. +// Input was generated by ent. +type CreateContactInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the full name of the contact + FullName string `json:"fullName"` + // the title of the contact + Title *string `json:"title,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + // status of the contact + Status *enums.UserStatus `json:"status,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` +} + +// CreateDocumentDataInput is used for create DocumentData object. +// Input was generated by ent. +type CreateDocumentDataInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the json data of the document + Data json.RawMessage `json:"data"` + OwnerID *string `json:"ownerID,omitempty"` + TemplateID string `json:"templateID"` + EntityIDs []string `json:"entityIDs,omitempty"` +} + +// CreateEntitlementInput is used for create Entitlement object. +// Input was generated by ent. +type CreateEntitlementInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled *bool `json:"cancelled,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + PlanID string `json:"planID"` + OrganizationID string `json:"organizationID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateEntitlementPlanFeatureInput is used for create EntitlementPlanFeature object. +// Input was generated by ent. +type CreateEntitlementPlanFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + PlanID string `json:"planID"` + FeatureID string `json:"featureID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateEntitlementPlanInput is used for create EntitlementPlan object. +// Input was generated by ent. +type CreateEntitlementPlanInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + // the unique name of the plan + Name string `json:"name"` + // a description of the plan + Description *string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EntitlementIDs []string `json:"entitlementIDs,omitempty"` + BaseFeatureIDs []string `json:"baseFeatureIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateEntityInput is used for create Entity object. +// Input was generated by ent. +type CreateEntityInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ContactIDs []string `json:"contactIDs,omitempty"` + DocumentIDs []string `json:"documentIDs,omitempty"` + NoteIDs []string `json:"noteIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + EntityTypeID *string `json:"entityTypeID,omitempty"` + Note *CreateNoteInput `json:"note,omitempty"` +} + +// CreateEntityTypeInput is used for create EntityType object. +// Input was generated by ent. +type CreateEntityTypeInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the entity + Name string `json:"name"` + OwnerID *string `json:"ownerID,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` +} + +// CreateEventInput is used for create Event object. +// Input was generated by ent. +type CreateEventInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + EventID *string `json:"eventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + EventType string `json:"eventType"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + UserIDs []string `json:"userIDs,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + InviteIDs []string `json:"inviteIDs,omitempty"` + FeatureIDs []string `json:"featureIDs,omitempty"` + EntitlementplanIDs []string `json:"entitlementplanIDs,omitempty"` + PersonalAccessTokenIDs []string `json:"personalAccessTokenIDs,omitempty"` + Oauth2tokenIDs []string `json:"oauth2tokenIDs,omitempty"` + HushIDs []string `json:"hushIDs,omitempty"` + EntitlementIDs []string `json:"entitlementIDs,omitempty"` + WebhookIDs []string `json:"webhookIDs,omitempty"` + SubscriberIDs []string `json:"subscriberIDs,omitempty"` +} + +// CreateFeatureInput is used for create Feature object. +// Input was generated by ent. +type CreateFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the unique name of the feature + Name string `json:"name"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + // enabled features are available for use + Enabled *bool `json:"enabled,omitempty"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + PlanIDs []string `json:"planIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateFileInput is used for create File object. +// Input was generated by ent. +type CreateFileInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + FileName string `json:"fileName"` + FileExtension string `json:"fileExtension"` + FileSize *int64 `json:"fileSize,omitempty"` + ContentType string `json:"contentType"` + StoreKey string `json:"storeKey"` + Category *string `json:"category,omitempty"` + Annotation *string `json:"annotation,omitempty"` + UserID *string `json:"userID,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` +} + +// CreateGroupInput is used for create Group object. +// Input was generated by ent. +type CreateGroupInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name"` + // the groups description + Description *string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + SettingID string `json:"settingID"` + UserIDs []string `json:"userIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + CreateGroupSettings *CreateGroupSettingInput `json:"createGroupSettings,omitempty"` +} + +// CreateGroupMembershipInput is used for create GroupMembership object. +// Input was generated by ent. +type CreateGroupMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + GroupID string `json:"groupID"` + UserID string `json:"userID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateGroupSettingInput is used for create GroupSetting object. +// Input was generated by ent. +type CreateGroupSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility *enums.Visibility `json:"visibility,omitempty"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + GroupID *string `json:"groupID,omitempty"` +} + +// CreateHushInput is used for create Hush object. +// Input was generated by ent. +type CreateHushInput struct { + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName *string `json:"secretName,omitempty"` + // the secret value + SecretValue *string `json:"secretValue,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateIntegrationInput is used for create Integration object. +// Input was generated by ent. +type CreateIntegrationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name"` + // a description of the integration + Description *string `json:"description,omitempty"` + Kind *string `json:"kind,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + SecretIDs []string `json:"secretIDs,omitempty"` + Oauth2tokenIDs []string `json:"oauth2tokenIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + WebhookIDs []string `json:"webhookIDs,omitempty"` +} + +// CreateInviteInput is used for create Invite object. +// Input was generated by ent. +type CreateInviteInput struct { + // the expiration date of the invitation token which defaults to 14 days in the future from creation + Expires *time.Time `json:"expires,omitempty"` + // the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + Recipient string `json:"recipient"` + // the status of the invitation + Status *enums.InviteStatus `json:"status,omitempty"` + Role *enums.Role `json:"role,omitempty"` + // the number of attempts made to perform email send of the invitation, maximum of 5 + SendAttempts *int64 `json:"sendAttempts,omitempty"` + // the user who initiated the invitation + RequestorID *string `json:"requestorID,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateNoteInput is used for create Note object. +// Input was generated by ent. +type CreateNoteInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the text of the note + Text string `json:"text"` + OwnerID *string `json:"ownerID,omitempty"` + EntityID *string `json:"entityID,omitempty"` +} + +// CreateOauthProviderInput is used for create OauthProvider object. +// Input was generated by ent. +type CreateOauthProviderInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the oauth provider's name + Name string `json:"name"` + // the client id for the oauth provider + ClientID string `json:"clientID"` + // the client secret + ClientSecret string `json:"clientSecret"` + // the redirect url + RedirectURL string `json:"redirectURL"` + // the scopes + Scopes string `json:"scopes"` + // the auth url of the provider + AuthURL string `json:"authURL"` + // the token url of the provider + TokenURL string `json:"tokenURL"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle string `json:"authStyle"` + // the URL to request user information by token + InfoURL string `json:"infoURL"` + OwnerID *string `json:"ownerID,omitempty"` +} + +// CreateOhAuthTooTokenInput is used for create OhAuthTooToken object. +// Input was generated by ent. +type CreateOhAuthTooTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + ClientID string `json:"clientID"` + Scopes []string `json:"scopes,omitempty"` + Nonce string `json:"nonce"` + ClaimsUserID string `json:"claimsUserID"` + ClaimsUsername string `json:"claimsUsername"` + ClaimsEmail string `json:"claimsEmail"` + ClaimsEmailVerified bool `json:"claimsEmailVerified"` + ClaimsGroups []string `json:"claimsGroups,omitempty"` + ClaimsPreferredUsername string `json:"claimsPreferredUsername"` + ConnectorID string `json:"connectorID"` + ConnectorData []string `json:"connectorData,omitempty"` + LastUsed *time.Time `json:"lastUsed,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateOrgMembershipInput is used for create OrgMembership object. +// Input was generated by ent. +type CreateOrgMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + OrganizationID string `json:"organizationID"` + UserID string `json:"userID"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateOrganizationInput is used for create Organization object. +// Input was generated by ent. +type CreateOrganizationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the organization + Name string `json:"name"` + // The organization's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + // orgs directly associated with a user + PersonalOrg *bool `json:"personalOrg,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb *bool `json:"dedicatedDb,omitempty"` + ParentID *string `json:"parentID,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` + TemplateIDs []string `json:"templateIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` + SettingID *string `json:"settingID,omitempty"` + DocumentdatumIDs []string `json:"documentdatumIDs,omitempty"` + EntitlementIDs []string `json:"entitlementIDs,omitempty"` + OrganizationEntitlementIDs []string `json:"organizationEntitlementIDs,omitempty"` + PersonalAccessTokenIDs []string `json:"personalAccessTokenIDs,omitempty"` + APITokenIDs []string `json:"apiTokenIDs,omitempty"` + OauthproviderIDs []string `json:"oauthproviderIDs,omitempty"` + UserIDs []string `json:"userIDs,omitempty"` + InviteIDs []string `json:"inviteIDs,omitempty"` + SubscriberIDs []string `json:"subscriberIDs,omitempty"` + WebhookIDs []string `json:"webhookIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + SecretIDs []string `json:"secretIDs,omitempty"` + FeatureIDs []string `json:"featureIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + EntitlementplanIDs []string `json:"entitlementplanIDs,omitempty"` + EntityIDs []string `json:"entityIDs,omitempty"` + EntitytypeIDs []string `json:"entitytypeIDs,omitempty"` + ContactIDs []string `json:"contactIDs,omitempty"` + NoteIDs []string `json:"noteIDs,omitempty"` + CreateOrgSettings *CreateOrganizationSettingInput `json:"createOrgSettings,omitempty"` +} + +// CreateOrganizationSettingInput is used for create OrganizationSetting object. +// Input was generated by ent. +type CreateOrganizationSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` +} + +// CreatePersonalAccessTokenInput is used for create PersonalAccessToken object. +// Input was generated by ent. +type CreatePersonalAccessTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name associated with the token + Name string `json:"name"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + OwnerID string `json:"ownerID"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateSubscriberInput is used for create Subscriber object. +// Input was generated by ent. +type CreateSubscriberInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // email address of the subscriber + Email string `json:"email"` + // phone number of the subscriber + PhoneNumber *string `json:"phoneNumber,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateTFASettingInput is used for create TFASetting object. +// Input was generated by ent. +type CreateTFASettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + TotpAllowed *bool `json:"totpAllowed,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` +} + +// CreateTemplateInput is used for create Template object. +// Input was generated by ent. +type CreateTemplateInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the template + Name string `json:"name"` + // the type of the template, either a provided template or an implementation (document) + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + // the description of the template + Description *string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + DocumentIDs []string `json:"documentIDs,omitempty"` +} + +// CreateUserInput is used for create User object. +// Input was generated by ent. +type CreateUserInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + Email string `json:"email"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"displayName"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + // user password hash + Password *string `json:"password,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + // the user's role + Role *enums.Role `json:"role,omitempty"` + PersonalAccessTokenIDs []string `json:"personalAccessTokenIDs,omitempty"` + TfaSettingIDs []string `json:"tfaSettingIDs,omitempty"` + SettingID string `json:"settingID"` + EmailVerificationTokenIDs []string `json:"emailVerificationTokenIDs,omitempty"` + PasswordResetTokenIDs []string `json:"passwordResetTokenIDs,omitempty"` + GroupIDs []string `json:"groupIDs,omitempty"` + OrganizationIDs []string `json:"organizationIDs,omitempty"` + WebauthnIDs []string `json:"webauthnIDs,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` +} + +// CreateUserSettingInput is used for create UserSetting object. +// Input was generated by ent. +type CreateUserSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked *bool `json:"locked,omitempty"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + // status of the user account + Status *enums.UserStatus `json:"status,omitempty"` + // whether the user has confirmed their email address + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + UserID *string `json:"userID,omitempty"` + DefaultOrgID *string `json:"defaultOrgID,omitempty"` +} + +// CreateWebhookInput is used for create Webhook object. +// Input was generated by ent. +type CreateWebhookInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name of the webhook + Name string `json:"name"` + // a description of the webhook + Description *string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destinationURL"` + // indicates if the webhook is active and enabled + Enabled *bool `json:"enabled,omitempty"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + EventIDs []string `json:"eventIDs,omitempty"` + IntegrationIDs []string `json:"integrationIDs,omitempty"` +} + +type DocumentData struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the template id of the document + TemplateID string `json:"templateID"` + // the json data of the document + Data json.RawMessage `json:"data"` + Owner *Organization `json:"owner,omitempty"` + Template *Template `json:"template"` + Entity []*Entity `json:"entity,omitempty"` +} + +func (DocumentData) IsNode() {} + +// Return response for createBulkDocumentData mutation +type DocumentDataBulkCreatePayload struct { + // Created documentData + DocumentData []*DocumentData `json:"documentData,omitempty"` +} + +// A connection to a list of items. +type DocumentDataConnection struct { + // A list of edges. + Edges []*DocumentDataEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createDocumentData mutation +type DocumentDataCreatePayload struct { + // Created documentData + DocumentData *DocumentData `json:"documentData"` +} + +// Return response for deleteDocumentData mutation +type DocumentDataDeletePayload struct { + // Deleted documentData ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type DocumentDataEdge struct { + // The item at the end of the edge. + Node *DocumentData `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type DocumentDataHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the template id of the document + TemplateID string `json:"templateID"` + // the json data of the document + Data json.RawMessage `json:"data"` +} + +func (DocumentDataHistory) IsNode() {} + +// A connection to a list of items. +type DocumentDataHistoryConnection struct { + // A list of edges. + Edges []*DocumentDataHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type DocumentDataHistoryEdge struct { + // The item at the end of the edge. + Node *DocumentDataHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// DocumentDataHistoryWhereInput is used for filtering DocumentDataHistory objects. +// Input was generated by ent. +type DocumentDataHistoryWhereInput struct { + Not *DocumentDataHistoryWhereInput `json:"not,omitempty"` + And []*DocumentDataHistoryWhereInput `json:"and,omitempty"` + Or []*DocumentDataHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // template_id field predicates + TemplateID *string `json:"templateID,omitempty"` + TemplateIDNeq *string `json:"templateIDNEQ,omitempty"` + TemplateIDIn []string `json:"templateIDIn,omitempty"` + TemplateIDNotIn []string `json:"templateIDNotIn,omitempty"` + TemplateIDGt *string `json:"templateIDGT,omitempty"` + TemplateIDGte *string `json:"templateIDGTE,omitempty"` + TemplateIDLt *string `json:"templateIDLT,omitempty"` + TemplateIDLte *string `json:"templateIDLTE,omitempty"` + TemplateIDContains *string `json:"templateIDContains,omitempty"` + TemplateIDHasPrefix *string `json:"templateIDHasPrefix,omitempty"` + TemplateIDHasSuffix *string `json:"templateIDHasSuffix,omitempty"` + TemplateIDEqualFold *string `json:"templateIDEqualFold,omitempty"` + TemplateIDContainsFold *string `json:"templateIDContainsFold,omitempty"` +} + +// Return response for updateDocumentData mutation +type DocumentDataUpdatePayload struct { + // Updated documentData + DocumentData *DocumentData `json:"documentData"` +} + +// DocumentDataWhereInput is used for filtering DocumentData objects. +// Input was generated by ent. +type DocumentDataWhereInput struct { + Not *DocumentDataWhereInput `json:"not,omitempty"` + And []*DocumentDataWhereInput `json:"and,omitempty"` + Or []*DocumentDataWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // template_id field predicates + TemplateID *string `json:"templateID,omitempty"` + TemplateIDNeq *string `json:"templateIDNEQ,omitempty"` + TemplateIDIn []string `json:"templateIDIn,omitempty"` + TemplateIDNotIn []string `json:"templateIDNotIn,omitempty"` + TemplateIDGt *string `json:"templateIDGT,omitempty"` + TemplateIDGte *string `json:"templateIDGTE,omitempty"` + TemplateIDLt *string `json:"templateIDLT,omitempty"` + TemplateIDLte *string `json:"templateIDLTE,omitempty"` + TemplateIDContains *string `json:"templateIDContains,omitempty"` + TemplateIDHasPrefix *string `json:"templateIDHasPrefix,omitempty"` + TemplateIDHasSuffix *string `json:"templateIDHasSuffix,omitempty"` + TemplateIDEqualFold *string `json:"templateIDEqualFold,omitempty"` + TemplateIDContainsFold *string `json:"templateIDContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // template edge predicates + HasTemplate *bool `json:"hasTemplate,omitempty"` + HasTemplateWith []*TemplateWhereInput `json:"hasTemplateWith,omitempty"` + // entity edge predicates + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` +} + +type Entitlement struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the plan to which the entitlement belongs + PlanID string `json:"planID"` + // the organization to which the entitlement belongs + OrganizationID string `json:"organizationID"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + // whether or not the customers entitlement expires - expires_at will show the time + Expires bool `json:"expires"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled bool `json:"cancelled"` + Owner *Organization `json:"owner,omitempty"` + Plan *EntitlementPlan `json:"plan"` + Organization *Organization `json:"organization"` + Events []*Event `json:"events,omitempty"` +} + +func (Entitlement) IsNode() {} + +// Return response for createBulkEntitlement mutation +type EntitlementBulkCreatePayload struct { + // Created entitlements + Entitlements []*Entitlement `json:"entitlements,omitempty"` +} + +// A connection to a list of items. +type EntitlementConnection struct { + // A list of edges. + Edges []*EntitlementEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntitlement mutation +type EntitlementCreatePayload struct { + // Created entitlement + Entitlement *Entitlement `json:"entitlement"` +} + +// Return response for deleteEntitlement mutation +type EntitlementDeletePayload struct { + // Deleted entitlement ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntitlementEdge struct { + // The item at the end of the edge. + Node *Entitlement `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntitlementHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the plan to which the entitlement belongs + PlanID string `json:"planID"` + // the organization to which the entitlement belongs + OrganizationID string `json:"organizationID"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + // whether or not the customers entitlement expires - expires_at will show the time + Expires bool `json:"expires"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled bool `json:"cancelled"` +} + +func (EntitlementHistory) IsNode() {} + +// A connection to a list of items. +type EntitlementHistoryConnection struct { + // A list of edges. + Edges []*EntitlementHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntitlementHistoryEdge struct { + // The item at the end of the edge. + Node *EntitlementHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EntitlementHistoryWhereInput is used for filtering EntitlementHistory objects. +// Input was generated by ent. +type EntitlementHistoryWhereInput struct { + Not *EntitlementHistoryWhereInput `json:"not,omitempty"` + And []*EntitlementHistoryWhereInput `json:"and,omitempty"` + Or []*EntitlementHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // plan_id field predicates + PlanID *string `json:"planID,omitempty"` + PlanIDNeq *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGt *string `json:"planIDGT,omitempty"` + PlanIDGte *string `json:"planIDGTE,omitempty"` + PlanIDLt *string `json:"planIDLT,omitempty"` + PlanIDLte *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // external_customer_id field predicates + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ExternalCustomerIDNeq *string `json:"externalCustomerIDNEQ,omitempty"` + ExternalCustomerIDIn []string `json:"externalCustomerIDIn,omitempty"` + ExternalCustomerIDNotIn []string `json:"externalCustomerIDNotIn,omitempty"` + ExternalCustomerIDGt *string `json:"externalCustomerIDGT,omitempty"` + ExternalCustomerIDGte *string `json:"externalCustomerIDGTE,omitempty"` + ExternalCustomerIDLt *string `json:"externalCustomerIDLT,omitempty"` + ExternalCustomerIDLte *string `json:"externalCustomerIDLTE,omitempty"` + ExternalCustomerIDContains *string `json:"externalCustomerIDContains,omitempty"` + ExternalCustomerIDHasPrefix *string `json:"externalCustomerIDHasPrefix,omitempty"` + ExternalCustomerIDHasSuffix *string `json:"externalCustomerIDHasSuffix,omitempty"` + ExternalCustomerIDIsNil *bool `json:"externalCustomerIDIsNil,omitempty"` + ExternalCustomerIDNotNil *bool `json:"externalCustomerIDNotNil,omitempty"` + ExternalCustomerIDEqualFold *string `json:"externalCustomerIDEqualFold,omitempty"` + ExternalCustomerIDContainsFold *string `json:"externalCustomerIDContainsFold,omitempty"` + // external_subscription_id field predicates + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ExternalSubscriptionIDNeq *string `json:"externalSubscriptionIDNEQ,omitempty"` + ExternalSubscriptionIDIn []string `json:"externalSubscriptionIDIn,omitempty"` + ExternalSubscriptionIDNotIn []string `json:"externalSubscriptionIDNotIn,omitempty"` + ExternalSubscriptionIDGt *string `json:"externalSubscriptionIDGT,omitempty"` + ExternalSubscriptionIDGte *string `json:"externalSubscriptionIDGTE,omitempty"` + ExternalSubscriptionIDLt *string `json:"externalSubscriptionIDLT,omitempty"` + ExternalSubscriptionIDLte *string `json:"externalSubscriptionIDLTE,omitempty"` + ExternalSubscriptionIDContains *string `json:"externalSubscriptionIDContains,omitempty"` + ExternalSubscriptionIDHasPrefix *string `json:"externalSubscriptionIDHasPrefix,omitempty"` + ExternalSubscriptionIDHasSuffix *string `json:"externalSubscriptionIDHasSuffix,omitempty"` + ExternalSubscriptionIDIsNil *bool `json:"externalSubscriptionIDIsNil,omitempty"` + ExternalSubscriptionIDNotNil *bool `json:"externalSubscriptionIDNotNil,omitempty"` + ExternalSubscriptionIDEqualFold *string `json:"externalSubscriptionIDEqualFold,omitempty"` + ExternalSubscriptionIDContainsFold *string `json:"externalSubscriptionIDContainsFold,omitempty"` + // expires field predicates + Expires *bool `json:"expires,omitempty"` + ExpiresNeq *bool `json:"expiresNEQ,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // cancelled field predicates + Cancelled *bool `json:"cancelled,omitempty"` + CancelledNeq *bool `json:"cancelledNEQ,omitempty"` +} + +type EntitlementPlan struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + // the unique name of the plan + Name string `json:"name"` + // a description of the plan + Description *string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Entitlements []*Entitlement `json:"entitlements,omitempty"` + BaseFeatures []*Feature `json:"baseFeatures,omitempty"` + Events []*Event `json:"events,omitempty"` + Features []*EntitlementPlanFeature `json:"features,omitempty"` +} + +func (EntitlementPlan) IsNode() {} + +// Return response for createBulkEntitlementPlan mutation +type EntitlementPlanBulkCreatePayload struct { + // Created entitlementPlans + EntitlementPlans []*EntitlementPlan `json:"entitlementPlans,omitempty"` +} + +// A connection to a list of items. +type EntitlementPlanConnection struct { + // A list of edges. + Edges []*EntitlementPlanEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntitlementPlan mutation +type EntitlementPlanCreatePayload struct { + // Created entitlementPlan + EntitlementPlan *EntitlementPlan `json:"entitlementPlan"` +} + +// Return response for deleteEntitlementPlan mutation +type EntitlementPlanDeletePayload struct { + // Deleted entitlementPlan ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntitlementPlanEdge struct { + // The item at the end of the edge. + Node *EntitlementPlan `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntitlementPlanFeature struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + PlanID string `json:"planID"` + FeatureID string `json:"featureID"` + Owner *Organization `json:"owner,omitempty"` + Plan *EntitlementPlan `json:"plan"` + Feature *Feature `json:"feature"` + Events []*Event `json:"events,omitempty"` +} + +func (EntitlementPlanFeature) IsNode() {} + +// Return response for createBulkEntitlementPlanFeature mutation +type EntitlementPlanFeatureBulkCreatePayload struct { + // Created entitlementPlanFeatures + EntitlementPlanFeatures []*EntitlementPlanFeature `json:"entitlementPlanFeatures,omitempty"` +} + +// A connection to a list of items. +type EntitlementPlanFeatureConnection struct { + // A list of edges. + Edges []*EntitlementPlanFeatureEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntitlementPlanFeature mutation +type EntitlementPlanFeatureCreatePayload struct { + // Created entitlementPlanFeature + EntitlementPlanFeature *EntitlementPlanFeature `json:"entitlementPlanFeature"` +} + +// Return response for deleteEntitlementPlanFeature mutation +type EntitlementPlanFeatureDeletePayload struct { + // Deleted entitlementPlanFeature ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntitlementPlanFeatureEdge struct { + // The item at the end of the edge. + Node *EntitlementPlanFeature `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntitlementPlanFeatureHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + PlanID string `json:"planID"` + FeatureID string `json:"featureID"` +} + +func (EntitlementPlanFeatureHistory) IsNode() {} + +// A connection to a list of items. +type EntitlementPlanFeatureHistoryConnection struct { + // A list of edges. + Edges []*EntitlementPlanFeatureHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntitlementPlanFeatureHistoryEdge struct { + // The item at the end of the edge. + Node *EntitlementPlanFeatureHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EntitlementPlanFeatureHistoryWhereInput is used for filtering EntitlementPlanFeatureHistory objects. +// Input was generated by ent. +type EntitlementPlanFeatureHistoryWhereInput struct { + Not *EntitlementPlanFeatureHistoryWhereInput `json:"not,omitempty"` + And []*EntitlementPlanFeatureHistoryWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanFeatureHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // plan_id field predicates + PlanID *string `json:"planID,omitempty"` + PlanIDNeq *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGt *string `json:"planIDGT,omitempty"` + PlanIDGte *string `json:"planIDGTE,omitempty"` + PlanIDLt *string `json:"planIDLT,omitempty"` + PlanIDLte *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + // feature_id field predicates + FeatureID *string `json:"featureID,omitempty"` + FeatureIDNeq *string `json:"featureIDNEQ,omitempty"` + FeatureIDIn []string `json:"featureIDIn,omitempty"` + FeatureIDNotIn []string `json:"featureIDNotIn,omitempty"` + FeatureIDGt *string `json:"featureIDGT,omitempty"` + FeatureIDGte *string `json:"featureIDGTE,omitempty"` + FeatureIDLt *string `json:"featureIDLT,omitempty"` + FeatureIDLte *string `json:"featureIDLTE,omitempty"` + FeatureIDContains *string `json:"featureIDContains,omitempty"` + FeatureIDHasPrefix *string `json:"featureIDHasPrefix,omitempty"` + FeatureIDHasSuffix *string `json:"featureIDHasSuffix,omitempty"` + FeatureIDEqualFold *string `json:"featureIDEqualFold,omitempty"` + FeatureIDContainsFold *string `json:"featureIDContainsFold,omitempty"` +} + +// Return response for updateEntitlementPlanFeature mutation +type EntitlementPlanFeatureUpdatePayload struct { + // Updated entitlementPlanFeature + EntitlementPlanFeature *EntitlementPlanFeature `json:"entitlementPlanFeature"` +} + +// EntitlementPlanFeatureWhereInput is used for filtering EntitlementPlanFeature objects. +// Input was generated by ent. +type EntitlementPlanFeatureWhereInput struct { + Not *EntitlementPlanFeatureWhereInput `json:"not,omitempty"` + And []*EntitlementPlanFeatureWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanFeatureWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` +} + +type EntitlementPlanHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + // the unique name of the plan + Name string `json:"name"` + // a description of the plan + Description *string `json:"description,omitempty"` + // the version of the plan + Version string `json:"version"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +func (EntitlementPlanHistory) IsNode() {} + +// A connection to a list of items. +type EntitlementPlanHistoryConnection struct { + // A list of edges. + Edges []*EntitlementPlanHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntitlementPlanHistoryEdge struct { + // The item at the end of the edge. + Node *EntitlementPlanHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EntitlementPlanHistoryWhereInput is used for filtering EntitlementPlanHistory objects. +// Input was generated by ent. +type EntitlementPlanHistoryWhereInput struct { + Not *EntitlementPlanHistoryWhereInput `json:"not,omitempty"` + And []*EntitlementPlanHistoryWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // version field predicates + Version *string `json:"version,omitempty"` + VersionNeq *string `json:"versionNEQ,omitempty"` + VersionIn []string `json:"versionIn,omitempty"` + VersionNotIn []string `json:"versionNotIn,omitempty"` + VersionGt *string `json:"versionGT,omitempty"` + VersionGte *string `json:"versionGTE,omitempty"` + VersionLt *string `json:"versionLT,omitempty"` + VersionLte *string `json:"versionLTE,omitempty"` + VersionContains *string `json:"versionContains,omitempty"` + VersionHasPrefix *string `json:"versionHasPrefix,omitempty"` + VersionHasSuffix *string `json:"versionHasSuffix,omitempty"` + VersionEqualFold *string `json:"versionEqualFold,omitempty"` + VersionContainsFold *string `json:"versionContainsFold,omitempty"` +} + +// Return response for updateEntitlementPlan mutation +type EntitlementPlanUpdatePayload struct { + // Updated entitlementPlan + EntitlementPlan *EntitlementPlan `json:"entitlementPlan"` +} + +// EntitlementPlanWhereInput is used for filtering EntitlementPlan objects. +// Input was generated by ent. +type EntitlementPlanWhereInput struct { + Not *EntitlementPlanWhereInput `json:"not,omitempty"` + And []*EntitlementPlanWhereInput `json:"and,omitempty"` + Or []*EntitlementPlanWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // version field predicates + Version *string `json:"version,omitempty"` + VersionNeq *string `json:"versionNEQ,omitempty"` + VersionIn []string `json:"versionIn,omitempty"` + VersionNotIn []string `json:"versionNotIn,omitempty"` + VersionGt *string `json:"versionGT,omitempty"` + VersionGte *string `json:"versionGTE,omitempty"` + VersionLt *string `json:"versionLT,omitempty"` + VersionLte *string `json:"versionLTE,omitempty"` + VersionContains *string `json:"versionContains,omitempty"` + VersionHasPrefix *string `json:"versionHasPrefix,omitempty"` + VersionHasSuffix *string `json:"versionHasSuffix,omitempty"` + VersionEqualFold *string `json:"versionEqualFold,omitempty"` + VersionContainsFold *string `json:"versionContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entitlements edge predicates + HasEntitlements *bool `json:"hasEntitlements,omitempty"` + HasEntitlementsWith []*EntitlementWhereInput `json:"hasEntitlementsWith,omitempty"` + // base_features edge predicates + HasBaseFeatures *bool `json:"hasBaseFeatures,omitempty"` + HasBaseFeaturesWith []*FeatureWhereInput `json:"hasBaseFeaturesWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // features edge predicates + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasFeaturesWith,omitempty"` +} + +// Return response for updateEntitlement mutation +type EntitlementUpdatePayload struct { + // Updated entitlement + Entitlement *Entitlement `json:"entitlement"` +} + +// EntitlementWhereInput is used for filtering Entitlement objects. +// Input was generated by ent. +type EntitlementWhereInput struct { + Not *EntitlementWhereInput `json:"not,omitempty"` + And []*EntitlementWhereInput `json:"and,omitempty"` + Or []*EntitlementWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // plan_id field predicates + PlanID *string `json:"planID,omitempty"` + PlanIDNeq *string `json:"planIDNEQ,omitempty"` + PlanIDIn []string `json:"planIDIn,omitempty"` + PlanIDNotIn []string `json:"planIDNotIn,omitempty"` + PlanIDGt *string `json:"planIDGT,omitempty"` + PlanIDGte *string `json:"planIDGTE,omitempty"` + PlanIDLt *string `json:"planIDLT,omitempty"` + PlanIDLte *string `json:"planIDLTE,omitempty"` + PlanIDContains *string `json:"planIDContains,omitempty"` + PlanIDHasPrefix *string `json:"planIDHasPrefix,omitempty"` + PlanIDHasSuffix *string `json:"planIDHasSuffix,omitempty"` + PlanIDEqualFold *string `json:"planIDEqualFold,omitempty"` + PlanIDContainsFold *string `json:"planIDContainsFold,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // external_customer_id field predicates + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ExternalCustomerIDNeq *string `json:"externalCustomerIDNEQ,omitempty"` + ExternalCustomerIDIn []string `json:"externalCustomerIDIn,omitempty"` + ExternalCustomerIDNotIn []string `json:"externalCustomerIDNotIn,omitempty"` + ExternalCustomerIDGt *string `json:"externalCustomerIDGT,omitempty"` + ExternalCustomerIDGte *string `json:"externalCustomerIDGTE,omitempty"` + ExternalCustomerIDLt *string `json:"externalCustomerIDLT,omitempty"` + ExternalCustomerIDLte *string `json:"externalCustomerIDLTE,omitempty"` + ExternalCustomerIDContains *string `json:"externalCustomerIDContains,omitempty"` + ExternalCustomerIDHasPrefix *string `json:"externalCustomerIDHasPrefix,omitempty"` + ExternalCustomerIDHasSuffix *string `json:"externalCustomerIDHasSuffix,omitempty"` + ExternalCustomerIDIsNil *bool `json:"externalCustomerIDIsNil,omitempty"` + ExternalCustomerIDNotNil *bool `json:"externalCustomerIDNotNil,omitempty"` + ExternalCustomerIDEqualFold *string `json:"externalCustomerIDEqualFold,omitempty"` + ExternalCustomerIDContainsFold *string `json:"externalCustomerIDContainsFold,omitempty"` + // external_subscription_id field predicates + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ExternalSubscriptionIDNeq *string `json:"externalSubscriptionIDNEQ,omitempty"` + ExternalSubscriptionIDIn []string `json:"externalSubscriptionIDIn,omitempty"` + ExternalSubscriptionIDNotIn []string `json:"externalSubscriptionIDNotIn,omitempty"` + ExternalSubscriptionIDGt *string `json:"externalSubscriptionIDGT,omitempty"` + ExternalSubscriptionIDGte *string `json:"externalSubscriptionIDGTE,omitempty"` + ExternalSubscriptionIDLt *string `json:"externalSubscriptionIDLT,omitempty"` + ExternalSubscriptionIDLte *string `json:"externalSubscriptionIDLTE,omitempty"` + ExternalSubscriptionIDContains *string `json:"externalSubscriptionIDContains,omitempty"` + ExternalSubscriptionIDHasPrefix *string `json:"externalSubscriptionIDHasPrefix,omitempty"` + ExternalSubscriptionIDHasSuffix *string `json:"externalSubscriptionIDHasSuffix,omitempty"` + ExternalSubscriptionIDIsNil *bool `json:"externalSubscriptionIDIsNil,omitempty"` + ExternalSubscriptionIDNotNil *bool `json:"externalSubscriptionIDNotNil,omitempty"` + ExternalSubscriptionIDEqualFold *string `json:"externalSubscriptionIDEqualFold,omitempty"` + ExternalSubscriptionIDContainsFold *string `json:"externalSubscriptionIDContainsFold,omitempty"` + // expires field predicates + Expires *bool `json:"expires,omitempty"` + ExpiresNeq *bool `json:"expiresNEQ,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // cancelled field predicates + Cancelled *bool `json:"cancelled,omitempty"` + CancelledNeq *bool `json:"cancelledNEQ,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // plan edge predicates + HasPlan *bool `json:"hasPlan,omitempty"` + HasPlanWith []*EntitlementPlanWhereInput `json:"hasPlanWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Entity struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // The type of the entity + EntityTypeID *string `json:"entityTypeID,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Contacts []*Contact `json:"contacts,omitempty"` + Documents []*DocumentData `json:"documents,omitempty"` + Notes []*Note `json:"notes,omitempty"` + Files []*File `json:"files,omitempty"` + EntityType *EntityType `json:"entityType,omitempty"` +} + +func (Entity) IsNode() {} + +// Return response for createBulkEntity mutation +type EntityBulkCreatePayload struct { + // Created entities + Entities []*Entity `json:"entities,omitempty"` +} + +// A connection to a list of items. +type EntityConnection struct { + // A list of edges. + Edges []*EntityEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntity mutation +type EntityCreatePayload struct { + // Created entity + Entity *Entity `json:"entity"` +} + +// Return response for deleteEntity mutation +type EntityDeletePayload struct { + // Deleted entity ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntityEdge struct { + // The item at the end of the edge. + Node *Entity `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntityHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + // The type of the entity + EntityTypeID *string `json:"entityTypeID,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` +} + +func (EntityHistory) IsNode() {} + +// A connection to a list of items. +type EntityHistoryConnection struct { + // A list of edges. + Edges []*EntityHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntityHistoryEdge struct { + // The item at the end of the edge. + Node *EntityHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for EntityHistory connections +type EntityHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order EntityHistories. + Field EntityHistoryOrderField `json:"field"` +} + +// EntityHistoryWhereInput is used for filtering EntityHistory objects. +// Input was generated by ent. +type EntityHistoryWhereInput struct { + Not *EntityHistoryWhereInput `json:"not,omitempty"` + And []*EntityHistoryWhereInput `json:"and,omitempty"` + Or []*EntityHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameIsNil *bool `json:"nameIsNil,omitempty"` + NameNotNil *bool `json:"nameNotNil,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // entity_type_id field predicates + EntityTypeID *string `json:"entityTypeID,omitempty"` + EntityTypeIDNeq *string `json:"entityTypeIDNEQ,omitempty"` + EntityTypeIDIn []string `json:"entityTypeIDIn,omitempty"` + EntityTypeIDNotIn []string `json:"entityTypeIDNotIn,omitempty"` + EntityTypeIDGt *string `json:"entityTypeIDGT,omitempty"` + EntityTypeIDGte *string `json:"entityTypeIDGTE,omitempty"` + EntityTypeIDLt *string `json:"entityTypeIDLT,omitempty"` + EntityTypeIDLte *string `json:"entityTypeIDLTE,omitempty"` + EntityTypeIDContains *string `json:"entityTypeIDContains,omitempty"` + EntityTypeIDHasPrefix *string `json:"entityTypeIDHasPrefix,omitempty"` + EntityTypeIDHasSuffix *string `json:"entityTypeIDHasSuffix,omitempty"` + EntityTypeIDIsNil *bool `json:"entityTypeIDIsNil,omitempty"` + EntityTypeIDNotNil *bool `json:"entityTypeIDNotNil,omitempty"` + EntityTypeIDEqualFold *string `json:"entityTypeIDEqualFold,omitempty"` + EntityTypeIDContainsFold *string `json:"entityTypeIDContainsFold,omitempty"` + // status field predicates + Status *string `json:"status,omitempty"` + StatusNeq *string `json:"statusNEQ,omitempty"` + StatusIn []string `json:"statusIn,omitempty"` + StatusNotIn []string `json:"statusNotIn,omitempty"` + StatusGt *string `json:"statusGT,omitempty"` + StatusGte *string `json:"statusGTE,omitempty"` + StatusLt *string `json:"statusLT,omitempty"` + StatusLte *string `json:"statusLTE,omitempty"` + StatusContains *string `json:"statusContains,omitempty"` + StatusHasPrefix *string `json:"statusHasPrefix,omitempty"` + StatusHasSuffix *string `json:"statusHasSuffix,omitempty"` + StatusIsNil *bool `json:"statusIsNil,omitempty"` + StatusNotNil *bool `json:"statusNotNil,omitempty"` + StatusEqualFold *string `json:"statusEqualFold,omitempty"` + StatusContainsFold *string `json:"statusContainsFold,omitempty"` +} + +// Ordering options for Entity connections +type EntityOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Entities. + Field EntityOrderField `json:"field"` +} + +type EntityType struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name string `json:"name"` + Owner *Organization `json:"owner,omitempty"` + Entities []*Entity `json:"entities,omitempty"` +} + +func (EntityType) IsNode() {} + +// Return response for createBulkEntityType mutation +type EntityTypeBulkCreatePayload struct { + // Created entityTypes + EntityTypes []*EntityType `json:"entityTypes,omitempty"` +} + +// A connection to a list of items. +type EntityTypeConnection struct { + // A list of edges. + Edges []*EntityTypeEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEntityType mutation +type EntityTypeCreatePayload struct { + // Created entityType + EntityType *EntityType `json:"entityType"` +} + +// Return response for deleteEntityType mutation +type EntityTypeDeletePayload struct { + // Deleted entityType ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EntityTypeEdge struct { + // The item at the end of the edge. + Node *EntityType `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EntityTypeHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the entity + Name string `json:"name"` +} + +func (EntityTypeHistory) IsNode() {} + +// A connection to a list of items. +type EntityTypeHistoryConnection struct { + // A list of edges. + Edges []*EntityTypeHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EntityTypeHistoryEdge struct { + // The item at the end of the edge. + Node *EntityTypeHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for EntityTypeHistory connections +type EntityTypeHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order EntityTypeHistories. + Field EntityTypeHistoryOrderField `json:"field"` +} + +// EntityTypeHistoryWhereInput is used for filtering EntityTypeHistory objects. +// Input was generated by ent. +type EntityTypeHistoryWhereInput struct { + Not *EntityTypeHistoryWhereInput `json:"not,omitempty"` + And []*EntityTypeHistoryWhereInput `json:"and,omitempty"` + Or []*EntityTypeHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` +} + +// Ordering options for EntityType connections +type EntityTypeOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order EntityTypes. + Field EntityTypeOrderField `json:"field"` +} + +// Return response for updateEntityType mutation +type EntityTypeUpdatePayload struct { + // Updated entityType + EntityType *EntityType `json:"entityType"` +} + +// EntityTypeWhereInput is used for filtering EntityType objects. +// Input was generated by ent. +type EntityTypeWhereInput struct { + Not *EntityTypeWhereInput `json:"not,omitempty"` + And []*EntityTypeWhereInput `json:"and,omitempty"` + Or []*EntityTypeWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entities edge predicates + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` +} + +// Return response for updateEntity mutation +type EntityUpdatePayload struct { + // Updated entity + Entity *Entity `json:"entity"` +} + +// EntityWhereInput is used for filtering Entity objects. +// Input was generated by ent. +type EntityWhereInput struct { + Not *EntityWhereInput `json:"not,omitempty"` + And []*EntityWhereInput `json:"and,omitempty"` + Or []*EntityWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameIsNil *bool `json:"nameIsNil,omitempty"` + NameNotNil *bool `json:"nameNotNil,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // entity_type_id field predicates + EntityTypeID *string `json:"entityTypeID,omitempty"` + EntityTypeIDNeq *string `json:"entityTypeIDNEQ,omitempty"` + EntityTypeIDIn []string `json:"entityTypeIDIn,omitempty"` + EntityTypeIDNotIn []string `json:"entityTypeIDNotIn,omitempty"` + EntityTypeIDGt *string `json:"entityTypeIDGT,omitempty"` + EntityTypeIDGte *string `json:"entityTypeIDGTE,omitempty"` + EntityTypeIDLt *string `json:"entityTypeIDLT,omitempty"` + EntityTypeIDLte *string `json:"entityTypeIDLTE,omitempty"` + EntityTypeIDContains *string `json:"entityTypeIDContains,omitempty"` + EntityTypeIDHasPrefix *string `json:"entityTypeIDHasPrefix,omitempty"` + EntityTypeIDHasSuffix *string `json:"entityTypeIDHasSuffix,omitempty"` + EntityTypeIDIsNil *bool `json:"entityTypeIDIsNil,omitempty"` + EntityTypeIDNotNil *bool `json:"entityTypeIDNotNil,omitempty"` + EntityTypeIDEqualFold *string `json:"entityTypeIDEqualFold,omitempty"` + EntityTypeIDContainsFold *string `json:"entityTypeIDContainsFold,omitempty"` + // status field predicates + Status *string `json:"status,omitempty"` + StatusNeq *string `json:"statusNEQ,omitempty"` + StatusIn []string `json:"statusIn,omitempty"` + StatusNotIn []string `json:"statusNotIn,omitempty"` + StatusGt *string `json:"statusGT,omitempty"` + StatusGte *string `json:"statusGTE,omitempty"` + StatusLt *string `json:"statusLT,omitempty"` + StatusLte *string `json:"statusLTE,omitempty"` + StatusContains *string `json:"statusContains,omitempty"` + StatusHasPrefix *string `json:"statusHasPrefix,omitempty"` + StatusHasSuffix *string `json:"statusHasSuffix,omitempty"` + StatusIsNil *bool `json:"statusIsNil,omitempty"` + StatusNotNil *bool `json:"statusNotNil,omitempty"` + StatusEqualFold *string `json:"statusEqualFold,omitempty"` + StatusContainsFold *string `json:"statusContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // contacts edge predicates + HasContacts *bool `json:"hasContacts,omitempty"` + HasContactsWith []*ContactWhereInput `json:"hasContactsWith,omitempty"` + // documents edge predicates + HasDocuments *bool `json:"hasDocuments,omitempty"` + HasDocumentsWith []*DocumentDataWhereInput `json:"hasDocumentsWith,omitempty"` + // notes edge predicates + HasNotes *bool `json:"hasNotes,omitempty"` + HasNotesWith []*NoteWhereInput `json:"hasNotesWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // entity_type edge predicates + HasEntityType *bool `json:"hasEntityType,omitempty"` + HasEntityTypeWith []*EntityTypeWhereInput `json:"hasEntityTypeWith,omitempty"` +} + +type Event struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + EventID *string `json:"eventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + EventType string `json:"eventType"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + User []*User `json:"user,omitempty"` + Group []*Group `json:"group,omitempty"` + Integration []*Integration `json:"integration,omitempty"` + Organization []*Organization `json:"organization,omitempty"` + Invite []*Invite `json:"invite,omitempty"` + Feature []*Feature `json:"feature,omitempty"` + Entitlementplan []*EntitlementPlan `json:"entitlementplan,omitempty"` + Entitlementplanfeature []*EntitlementPlanFeature `json:"entitlementplanfeature,omitempty"` + PersonalAccessToken []*PersonalAccessToken `json:"personalAccessToken,omitempty"` + Oauth2token []*OhAuthTooToken `json:"oauth2token,omitempty"` + Hush []*Hush `json:"hush,omitempty"` + Orgmembership []*OrgMembership `json:"orgmembership,omitempty"` + Groupmembership []*GroupMembership `json:"groupmembership,omitempty"` + Entitlement []*Entitlement `json:"entitlement,omitempty"` + Webhook []*Webhook `json:"webhook,omitempty"` + Subscriber []*Subscriber `json:"subscriber,omitempty"` +} + +func (Event) IsNode() {} + +// Return response for createBulkEvent mutation +type EventBulkCreatePayload struct { + // Created events + Events []*Event `json:"events,omitempty"` +} + +// A connection to a list of items. +type EventConnection struct { + // A list of edges. + Edges []*EventEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createEvent mutation +type EventCreatePayload struct { + // Created event + Event *Event `json:"event"` +} + +// Return response for deleteEvent mutation +type EventDeletePayload struct { + // Deleted event ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type EventEdge struct { + // The item at the end of the edge. + Node *Event `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type EventHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + EventID *string `json:"eventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + EventType string `json:"eventType"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +func (EventHistory) IsNode() {} + +// A connection to a list of items. +type EventHistoryConnection struct { + // A list of edges. + Edges []*EventHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type EventHistoryEdge struct { + // The item at the end of the edge. + Node *EventHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// EventHistoryWhereInput is used for filtering EventHistory objects. +// Input was generated by ent. +type EventHistoryWhereInput struct { + Not *EventHistoryWhereInput `json:"not,omitempty"` + And []*EventHistoryWhereInput `json:"and,omitempty"` + Or []*EventHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // event_id field predicates + EventID *string `json:"eventID,omitempty"` + EventIDNeq *string `json:"eventIDNEQ,omitempty"` + EventIDIn []string `json:"eventIDIn,omitempty"` + EventIDNotIn []string `json:"eventIDNotIn,omitempty"` + EventIDGt *string `json:"eventIDGT,omitempty"` + EventIDGte *string `json:"eventIDGTE,omitempty"` + EventIDLt *string `json:"eventIDLT,omitempty"` + EventIDLte *string `json:"eventIDLTE,omitempty"` + EventIDContains *string `json:"eventIDContains,omitempty"` + EventIDHasPrefix *string `json:"eventIDHasPrefix,omitempty"` + EventIDHasSuffix *string `json:"eventIDHasSuffix,omitempty"` + EventIDIsNil *bool `json:"eventIDIsNil,omitempty"` + EventIDNotNil *bool `json:"eventIDNotNil,omitempty"` + EventIDEqualFold *string `json:"eventIDEqualFold,omitempty"` + EventIDContainsFold *string `json:"eventIDContainsFold,omitempty"` + // correlation_id field predicates + CorrelationID *string `json:"correlationID,omitempty"` + CorrelationIDNeq *string `json:"correlationIDNEQ,omitempty"` + CorrelationIDIn []string `json:"correlationIDIn,omitempty"` + CorrelationIDNotIn []string `json:"correlationIDNotIn,omitempty"` + CorrelationIDGt *string `json:"correlationIDGT,omitempty"` + CorrelationIDGte *string `json:"correlationIDGTE,omitempty"` + CorrelationIDLt *string `json:"correlationIDLT,omitempty"` + CorrelationIDLte *string `json:"correlationIDLTE,omitempty"` + CorrelationIDContains *string `json:"correlationIDContains,omitempty"` + CorrelationIDHasPrefix *string `json:"correlationIDHasPrefix,omitempty"` + CorrelationIDHasSuffix *string `json:"correlationIDHasSuffix,omitempty"` + CorrelationIDIsNil *bool `json:"correlationIDIsNil,omitempty"` + CorrelationIDNotNil *bool `json:"correlationIDNotNil,omitempty"` + CorrelationIDEqualFold *string `json:"correlationIDEqualFold,omitempty"` + CorrelationIDContainsFold *string `json:"correlationIDContainsFold,omitempty"` + // event_type field predicates + EventType *string `json:"eventType,omitempty"` + EventTypeNeq *string `json:"eventTypeNEQ,omitempty"` + EventTypeIn []string `json:"eventTypeIn,omitempty"` + EventTypeNotIn []string `json:"eventTypeNotIn,omitempty"` + EventTypeGt *string `json:"eventTypeGT,omitempty"` + EventTypeGte *string `json:"eventTypeGTE,omitempty"` + EventTypeLt *string `json:"eventTypeLT,omitempty"` + EventTypeLte *string `json:"eventTypeLTE,omitempty"` + EventTypeContains *string `json:"eventTypeContains,omitempty"` + EventTypeHasPrefix *string `json:"eventTypeHasPrefix,omitempty"` + EventTypeHasSuffix *string `json:"eventTypeHasSuffix,omitempty"` + EventTypeEqualFold *string `json:"eventTypeEqualFold,omitempty"` + EventTypeContainsFold *string `json:"eventTypeContainsFold,omitempty"` +} + +// Return response for updateEvent mutation +type EventUpdatePayload struct { + // Updated event + Event *Event `json:"event"` +} + +// EventWhereInput is used for filtering Event objects. +// Input was generated by ent. +type EventWhereInput struct { + Not *EventWhereInput `json:"not,omitempty"` + And []*EventWhereInput `json:"and,omitempty"` + Or []*EventWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // event_id field predicates + EventID *string `json:"eventID,omitempty"` + EventIDNeq *string `json:"eventIDNEQ,omitempty"` + EventIDIn []string `json:"eventIDIn,omitempty"` + EventIDNotIn []string `json:"eventIDNotIn,omitempty"` + EventIDGt *string `json:"eventIDGT,omitempty"` + EventIDGte *string `json:"eventIDGTE,omitempty"` + EventIDLt *string `json:"eventIDLT,omitempty"` + EventIDLte *string `json:"eventIDLTE,omitempty"` + EventIDContains *string `json:"eventIDContains,omitempty"` + EventIDHasPrefix *string `json:"eventIDHasPrefix,omitempty"` + EventIDHasSuffix *string `json:"eventIDHasSuffix,omitempty"` + EventIDIsNil *bool `json:"eventIDIsNil,omitempty"` + EventIDNotNil *bool `json:"eventIDNotNil,omitempty"` + EventIDEqualFold *string `json:"eventIDEqualFold,omitempty"` + EventIDContainsFold *string `json:"eventIDContainsFold,omitempty"` + // correlation_id field predicates + CorrelationID *string `json:"correlationID,omitempty"` + CorrelationIDNeq *string `json:"correlationIDNEQ,omitempty"` + CorrelationIDIn []string `json:"correlationIDIn,omitempty"` + CorrelationIDNotIn []string `json:"correlationIDNotIn,omitempty"` + CorrelationIDGt *string `json:"correlationIDGT,omitempty"` + CorrelationIDGte *string `json:"correlationIDGTE,omitempty"` + CorrelationIDLt *string `json:"correlationIDLT,omitempty"` + CorrelationIDLte *string `json:"correlationIDLTE,omitempty"` + CorrelationIDContains *string `json:"correlationIDContains,omitempty"` + CorrelationIDHasPrefix *string `json:"correlationIDHasPrefix,omitempty"` + CorrelationIDHasSuffix *string `json:"correlationIDHasSuffix,omitempty"` + CorrelationIDIsNil *bool `json:"correlationIDIsNil,omitempty"` + CorrelationIDNotNil *bool `json:"correlationIDNotNil,omitempty"` + CorrelationIDEqualFold *string `json:"correlationIDEqualFold,omitempty"` + CorrelationIDContainsFold *string `json:"correlationIDContainsFold,omitempty"` + // event_type field predicates + EventType *string `json:"eventType,omitempty"` + EventTypeNeq *string `json:"eventTypeNEQ,omitempty"` + EventTypeIn []string `json:"eventTypeIn,omitempty"` + EventTypeNotIn []string `json:"eventTypeNotIn,omitempty"` + EventTypeGt *string `json:"eventTypeGT,omitempty"` + EventTypeGte *string `json:"eventTypeGTE,omitempty"` + EventTypeLt *string `json:"eventTypeLT,omitempty"` + EventTypeLte *string `json:"eventTypeLTE,omitempty"` + EventTypeContains *string `json:"eventTypeContains,omitempty"` + EventTypeHasPrefix *string `json:"eventTypeHasPrefix,omitempty"` + EventTypeHasSuffix *string `json:"eventTypeHasSuffix,omitempty"` + EventTypeEqualFold *string `json:"eventTypeEqualFold,omitempty"` + EventTypeContainsFold *string `json:"eventTypeContainsFold,omitempty"` + // user edge predicates + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + // group edge predicates + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` + // integration edge predicates + HasIntegration *bool `json:"hasIntegration,omitempty"` + HasIntegrationWith []*IntegrationWhereInput `json:"hasIntegrationWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // invite edge predicates + HasInvite *bool `json:"hasInvite,omitempty"` + HasInviteWith []*InviteWhereInput `json:"hasInviteWith,omitempty"` + // feature edge predicates + HasFeature *bool `json:"hasFeature,omitempty"` + HasFeatureWith []*FeatureWhereInput `json:"hasFeatureWith,omitempty"` + // entitlementplan edge predicates + HasEntitlementplan *bool `json:"hasEntitlementplan,omitempty"` + HasEntitlementplanWith []*EntitlementPlanWhereInput `json:"hasEntitlementplanWith,omitempty"` + // entitlementplanfeature edge predicates + HasEntitlementplanfeature *bool `json:"hasEntitlementplanfeature,omitempty"` + HasEntitlementplanfeatureWith []*EntitlementPlanFeatureWhereInput `json:"hasEntitlementplanfeatureWith,omitempty"` + // personal_access_token edge predicates + HasPersonalAccessToken *bool `json:"hasPersonalAccessToken,omitempty"` + HasPersonalAccessTokenWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokenWith,omitempty"` + // oauth2token edge predicates + HasOauth2token *bool `json:"hasOauth2token,omitempty"` + HasOauth2tokenWith []*OhAuthTooTokenWhereInput `json:"hasOauth2tokenWith,omitempty"` + // hush edge predicates + HasHush *bool `json:"hasHush,omitempty"` + HasHushWith []*HushWhereInput `json:"hasHushWith,omitempty"` + // orgmembership edge predicates + HasOrgmembership *bool `json:"hasOrgmembership,omitempty"` + HasOrgmembershipWith []*OrgMembershipWhereInput `json:"hasOrgmembershipWith,omitempty"` + // groupmembership edge predicates + HasGroupmembership *bool `json:"hasGroupmembership,omitempty"` + HasGroupmembershipWith []*GroupMembershipWhereInput `json:"hasGroupmembershipWith,omitempty"` + // entitlement edge predicates + HasEntitlement *bool `json:"hasEntitlement,omitempty"` + HasEntitlementWith []*EntitlementWhereInput `json:"hasEntitlementWith,omitempty"` + // webhook edge predicates + HasWebhook *bool `json:"hasWebhook,omitempty"` + HasWebhookWith []*WebhookWhereInput `json:"hasWebhookWith,omitempty"` + // subscriber edge predicates + HasSubscriber *bool `json:"hasSubscriber,omitempty"` + HasSubscriberWith []*SubscriberWhereInput `json:"hasSubscriberWith,omitempty"` +} + +type Feature struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the unique name of the feature + Name string `json:"name"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + // enabled features are available for use + Enabled bool `json:"enabled"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Plans []*EntitlementPlan `json:"plans,omitempty"` + Events []*Event `json:"events,omitempty"` + Features []*EntitlementPlanFeature `json:"features,omitempty"` +} + +func (Feature) IsNode() {} + +// Return response for createBulkFeature mutation +type FeatureBulkCreatePayload struct { + // Created features + Features []*Feature `json:"features,omitempty"` +} + +// A connection to a list of items. +type FeatureConnection struct { + // A list of edges. + Edges []*FeatureEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createFeature mutation +type FeatureCreatePayload struct { + // Created feature + Feature *Feature `json:"feature"` +} + +// Return response for deleteFeature mutation +type FeatureDeletePayload struct { + // Deleted feature ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type FeatureEdge struct { + // The item at the end of the edge. + Node *Feature `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type FeatureHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the unique name of the feature + Name string `json:"name"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + // enabled features are available for use + Enabled bool `json:"enabled"` + // a description of the feature + Description *string `json:"description,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +func (FeatureHistory) IsNode() {} + +// A connection to a list of items. +type FeatureHistoryConnection struct { + // A list of edges. + Edges []*FeatureHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type FeatureHistoryEdge struct { + // The item at the end of the edge. + Node *FeatureHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// FeatureHistoryWhereInput is used for filtering FeatureHistory objects. +// Input was generated by ent. +type FeatureHistoryWhereInput struct { + Not *FeatureHistoryWhereInput `json:"not,omitempty"` + And []*FeatureHistoryWhereInput `json:"and,omitempty"` + Or []*FeatureHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` +} + +// Return response for updateFeature mutation +type FeatureUpdatePayload struct { + // Updated feature + Feature *Feature `json:"feature"` +} + +// FeatureWhereInput is used for filtering Feature objects. +// Input was generated by ent. +type FeatureWhereInput struct { + Not *FeatureWhereInput `json:"not,omitempty"` + And []*FeatureWhereInput `json:"and,omitempty"` + Or []*FeatureWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameIsNil *bool `json:"displayNameIsNil,omitempty"` + DisplayNameNotNil *bool `json:"displayNameNotNil,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // plans edge predicates + HasPlans *bool `json:"hasPlans,omitempty"` + HasPlansWith []*EntitlementPlanWhereInput `json:"hasPlansWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // features edge predicates + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasFeaturesWith,omitempty"` +} + +type File struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + FileName string `json:"fileName"` + FileExtension string `json:"fileExtension"` + FileSize *int64 `json:"fileSize,omitempty"` + ContentType string `json:"contentType"` + StoreKey string `json:"storeKey"` + Category *string `json:"category,omitempty"` + Annotation *string `json:"annotation,omitempty"` + User *User `json:"user,omitempty"` + Organization []*Organization `json:"organization,omitempty"` + Entity []*Entity `json:"entity,omitempty"` + Group []*Group `json:"group,omitempty"` +} + +func (File) IsNode() {} + +// Return response for createBulkFile mutation +type FileBulkCreatePayload struct { + // Created files + Files []*File `json:"files,omitempty"` +} + +// A connection to a list of items. +type FileConnection struct { + // A list of edges. + Edges []*FileEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createFile mutation +type FileCreatePayload struct { + // Created file + File *File `json:"file"` +} + +// Return response for deleteFile mutation +type FileDeletePayload struct { + // Deleted file ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type FileEdge struct { + // The item at the end of the edge. + Node *File `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type FileHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + FileName string `json:"fileName"` + FileExtension string `json:"fileExtension"` + FileSize *int64 `json:"fileSize,omitempty"` + ContentType string `json:"contentType"` + StoreKey string `json:"storeKey"` + Category *string `json:"category,omitempty"` + Annotation *string `json:"annotation,omitempty"` +} + +func (FileHistory) IsNode() {} + +// A connection to a list of items. +type FileHistoryConnection struct { + // A list of edges. + Edges []*FileHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type FileHistoryEdge struct { + // The item at the end of the edge. + Node *FileHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// FileHistoryWhereInput is used for filtering FileHistory objects. +// Input was generated by ent. +type FileHistoryWhereInput struct { + Not *FileHistoryWhereInput `json:"not,omitempty"` + And []*FileHistoryWhereInput `json:"and,omitempty"` + Or []*FileHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // file_name field predicates + FileName *string `json:"fileName,omitempty"` + FileNameNeq *string `json:"fileNameNEQ,omitempty"` + FileNameIn []string `json:"fileNameIn,omitempty"` + FileNameNotIn []string `json:"fileNameNotIn,omitempty"` + FileNameGt *string `json:"fileNameGT,omitempty"` + FileNameGte *string `json:"fileNameGTE,omitempty"` + FileNameLt *string `json:"fileNameLT,omitempty"` + FileNameLte *string `json:"fileNameLTE,omitempty"` + FileNameContains *string `json:"fileNameContains,omitempty"` + FileNameHasPrefix *string `json:"fileNameHasPrefix,omitempty"` + FileNameHasSuffix *string `json:"fileNameHasSuffix,omitempty"` + FileNameEqualFold *string `json:"fileNameEqualFold,omitempty"` + FileNameContainsFold *string `json:"fileNameContainsFold,omitempty"` + // file_extension field predicates + FileExtension *string `json:"fileExtension,omitempty"` + FileExtensionNeq *string `json:"fileExtensionNEQ,omitempty"` + FileExtensionIn []string `json:"fileExtensionIn,omitempty"` + FileExtensionNotIn []string `json:"fileExtensionNotIn,omitempty"` + FileExtensionGt *string `json:"fileExtensionGT,omitempty"` + FileExtensionGte *string `json:"fileExtensionGTE,omitempty"` + FileExtensionLt *string `json:"fileExtensionLT,omitempty"` + FileExtensionLte *string `json:"fileExtensionLTE,omitempty"` + FileExtensionContains *string `json:"fileExtensionContains,omitempty"` + FileExtensionHasPrefix *string `json:"fileExtensionHasPrefix,omitempty"` + FileExtensionHasSuffix *string `json:"fileExtensionHasSuffix,omitempty"` + FileExtensionEqualFold *string `json:"fileExtensionEqualFold,omitempty"` + FileExtensionContainsFold *string `json:"fileExtensionContainsFold,omitempty"` + // file_size field predicates + FileSize *int64 `json:"fileSize,omitempty"` + FileSizeNeq *int64 `json:"fileSizeNEQ,omitempty"` + FileSizeIn []int64 `json:"fileSizeIn,omitempty"` + FileSizeNotIn []int64 `json:"fileSizeNotIn,omitempty"` + FileSizeGt *int64 `json:"fileSizeGT,omitempty"` + FileSizeGte *int64 `json:"fileSizeGTE,omitempty"` + FileSizeLt *int64 `json:"fileSizeLT,omitempty"` + FileSizeLte *int64 `json:"fileSizeLTE,omitempty"` + FileSizeIsNil *bool `json:"fileSizeIsNil,omitempty"` + FileSizeNotNil *bool `json:"fileSizeNotNil,omitempty"` + // content_type field predicates + ContentType *string `json:"contentType,omitempty"` + ContentTypeNeq *string `json:"contentTypeNEQ,omitempty"` + ContentTypeIn []string `json:"contentTypeIn,omitempty"` + ContentTypeNotIn []string `json:"contentTypeNotIn,omitempty"` + ContentTypeGt *string `json:"contentTypeGT,omitempty"` + ContentTypeGte *string `json:"contentTypeGTE,omitempty"` + ContentTypeLt *string `json:"contentTypeLT,omitempty"` + ContentTypeLte *string `json:"contentTypeLTE,omitempty"` + ContentTypeContains *string `json:"contentTypeContains,omitempty"` + ContentTypeHasPrefix *string `json:"contentTypeHasPrefix,omitempty"` + ContentTypeHasSuffix *string `json:"contentTypeHasSuffix,omitempty"` + ContentTypeEqualFold *string `json:"contentTypeEqualFold,omitempty"` + ContentTypeContainsFold *string `json:"contentTypeContainsFold,omitempty"` + // store_key field predicates + StoreKey *string `json:"storeKey,omitempty"` + StoreKeyNeq *string `json:"storeKeyNEQ,omitempty"` + StoreKeyIn []string `json:"storeKeyIn,omitempty"` + StoreKeyNotIn []string `json:"storeKeyNotIn,omitempty"` + StoreKeyGt *string `json:"storeKeyGT,omitempty"` + StoreKeyGte *string `json:"storeKeyGTE,omitempty"` + StoreKeyLt *string `json:"storeKeyLT,omitempty"` + StoreKeyLte *string `json:"storeKeyLTE,omitempty"` + StoreKeyContains *string `json:"storeKeyContains,omitempty"` + StoreKeyHasPrefix *string `json:"storeKeyHasPrefix,omitempty"` + StoreKeyHasSuffix *string `json:"storeKeyHasSuffix,omitempty"` + StoreKeyEqualFold *string `json:"storeKeyEqualFold,omitempty"` + StoreKeyContainsFold *string `json:"storeKeyContainsFold,omitempty"` + // category field predicates + Category *string `json:"category,omitempty"` + CategoryNeq *string `json:"categoryNEQ,omitempty"` + CategoryIn []string `json:"categoryIn,omitempty"` + CategoryNotIn []string `json:"categoryNotIn,omitempty"` + CategoryGt *string `json:"categoryGT,omitempty"` + CategoryGte *string `json:"categoryGTE,omitempty"` + CategoryLt *string `json:"categoryLT,omitempty"` + CategoryLte *string `json:"categoryLTE,omitempty"` + CategoryContains *string `json:"categoryContains,omitempty"` + CategoryHasPrefix *string `json:"categoryHasPrefix,omitempty"` + CategoryHasSuffix *string `json:"categoryHasSuffix,omitempty"` + CategoryIsNil *bool `json:"categoryIsNil,omitempty"` + CategoryNotNil *bool `json:"categoryNotNil,omitempty"` + CategoryEqualFold *string `json:"categoryEqualFold,omitempty"` + CategoryContainsFold *string `json:"categoryContainsFold,omitempty"` + // annotation field predicates + Annotation *string `json:"annotation,omitempty"` + AnnotationNeq *string `json:"annotationNEQ,omitempty"` + AnnotationIn []string `json:"annotationIn,omitempty"` + AnnotationNotIn []string `json:"annotationNotIn,omitempty"` + AnnotationGt *string `json:"annotationGT,omitempty"` + AnnotationGte *string `json:"annotationGTE,omitempty"` + AnnotationLt *string `json:"annotationLT,omitempty"` + AnnotationLte *string `json:"annotationLTE,omitempty"` + AnnotationContains *string `json:"annotationContains,omitempty"` + AnnotationHasPrefix *string `json:"annotationHasPrefix,omitempty"` + AnnotationHasSuffix *string `json:"annotationHasSuffix,omitempty"` + AnnotationIsNil *bool `json:"annotationIsNil,omitempty"` + AnnotationNotNil *bool `json:"annotationNotNil,omitempty"` + AnnotationEqualFold *string `json:"annotationEqualFold,omitempty"` + AnnotationContainsFold *string `json:"annotationContainsFold,omitempty"` +} + +// Return response for updateFile mutation +type FileUpdatePayload struct { + // Updated file + File *File `json:"file"` +} + +// FileWhereInput is used for filtering File objects. +// Input was generated by ent. +type FileWhereInput struct { + Not *FileWhereInput `json:"not,omitempty"` + And []*FileWhereInput `json:"and,omitempty"` + Or []*FileWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // file_name field predicates + FileName *string `json:"fileName,omitempty"` + FileNameNeq *string `json:"fileNameNEQ,omitempty"` + FileNameIn []string `json:"fileNameIn,omitempty"` + FileNameNotIn []string `json:"fileNameNotIn,omitempty"` + FileNameGt *string `json:"fileNameGT,omitempty"` + FileNameGte *string `json:"fileNameGTE,omitempty"` + FileNameLt *string `json:"fileNameLT,omitempty"` + FileNameLte *string `json:"fileNameLTE,omitempty"` + FileNameContains *string `json:"fileNameContains,omitempty"` + FileNameHasPrefix *string `json:"fileNameHasPrefix,omitempty"` + FileNameHasSuffix *string `json:"fileNameHasSuffix,omitempty"` + FileNameEqualFold *string `json:"fileNameEqualFold,omitempty"` + FileNameContainsFold *string `json:"fileNameContainsFold,omitempty"` + // file_extension field predicates + FileExtension *string `json:"fileExtension,omitempty"` + FileExtensionNeq *string `json:"fileExtensionNEQ,omitempty"` + FileExtensionIn []string `json:"fileExtensionIn,omitempty"` + FileExtensionNotIn []string `json:"fileExtensionNotIn,omitempty"` + FileExtensionGt *string `json:"fileExtensionGT,omitempty"` + FileExtensionGte *string `json:"fileExtensionGTE,omitempty"` + FileExtensionLt *string `json:"fileExtensionLT,omitempty"` + FileExtensionLte *string `json:"fileExtensionLTE,omitempty"` + FileExtensionContains *string `json:"fileExtensionContains,omitempty"` + FileExtensionHasPrefix *string `json:"fileExtensionHasPrefix,omitempty"` + FileExtensionHasSuffix *string `json:"fileExtensionHasSuffix,omitempty"` + FileExtensionEqualFold *string `json:"fileExtensionEqualFold,omitempty"` + FileExtensionContainsFold *string `json:"fileExtensionContainsFold,omitempty"` + // file_size field predicates + FileSize *int64 `json:"fileSize,omitempty"` + FileSizeNeq *int64 `json:"fileSizeNEQ,omitempty"` + FileSizeIn []int64 `json:"fileSizeIn,omitempty"` + FileSizeNotIn []int64 `json:"fileSizeNotIn,omitempty"` + FileSizeGt *int64 `json:"fileSizeGT,omitempty"` + FileSizeGte *int64 `json:"fileSizeGTE,omitempty"` + FileSizeLt *int64 `json:"fileSizeLT,omitempty"` + FileSizeLte *int64 `json:"fileSizeLTE,omitempty"` + FileSizeIsNil *bool `json:"fileSizeIsNil,omitempty"` + FileSizeNotNil *bool `json:"fileSizeNotNil,omitempty"` + // content_type field predicates + ContentType *string `json:"contentType,omitempty"` + ContentTypeNeq *string `json:"contentTypeNEQ,omitempty"` + ContentTypeIn []string `json:"contentTypeIn,omitempty"` + ContentTypeNotIn []string `json:"contentTypeNotIn,omitempty"` + ContentTypeGt *string `json:"contentTypeGT,omitempty"` + ContentTypeGte *string `json:"contentTypeGTE,omitempty"` + ContentTypeLt *string `json:"contentTypeLT,omitempty"` + ContentTypeLte *string `json:"contentTypeLTE,omitempty"` + ContentTypeContains *string `json:"contentTypeContains,omitempty"` + ContentTypeHasPrefix *string `json:"contentTypeHasPrefix,omitempty"` + ContentTypeHasSuffix *string `json:"contentTypeHasSuffix,omitempty"` + ContentTypeEqualFold *string `json:"contentTypeEqualFold,omitempty"` + ContentTypeContainsFold *string `json:"contentTypeContainsFold,omitempty"` + // store_key field predicates + StoreKey *string `json:"storeKey,omitempty"` + StoreKeyNeq *string `json:"storeKeyNEQ,omitempty"` + StoreKeyIn []string `json:"storeKeyIn,omitempty"` + StoreKeyNotIn []string `json:"storeKeyNotIn,omitempty"` + StoreKeyGt *string `json:"storeKeyGT,omitempty"` + StoreKeyGte *string `json:"storeKeyGTE,omitempty"` + StoreKeyLt *string `json:"storeKeyLT,omitempty"` + StoreKeyLte *string `json:"storeKeyLTE,omitempty"` + StoreKeyContains *string `json:"storeKeyContains,omitempty"` + StoreKeyHasPrefix *string `json:"storeKeyHasPrefix,omitempty"` + StoreKeyHasSuffix *string `json:"storeKeyHasSuffix,omitempty"` + StoreKeyEqualFold *string `json:"storeKeyEqualFold,omitempty"` + StoreKeyContainsFold *string `json:"storeKeyContainsFold,omitempty"` + // category field predicates + Category *string `json:"category,omitempty"` + CategoryNeq *string `json:"categoryNEQ,omitempty"` + CategoryIn []string `json:"categoryIn,omitempty"` + CategoryNotIn []string `json:"categoryNotIn,omitempty"` + CategoryGt *string `json:"categoryGT,omitempty"` + CategoryGte *string `json:"categoryGTE,omitempty"` + CategoryLt *string `json:"categoryLT,omitempty"` + CategoryLte *string `json:"categoryLTE,omitempty"` + CategoryContains *string `json:"categoryContains,omitempty"` + CategoryHasPrefix *string `json:"categoryHasPrefix,omitempty"` + CategoryHasSuffix *string `json:"categoryHasSuffix,omitempty"` + CategoryIsNil *bool `json:"categoryIsNil,omitempty"` + CategoryNotNil *bool `json:"categoryNotNil,omitempty"` + CategoryEqualFold *string `json:"categoryEqualFold,omitempty"` + CategoryContainsFold *string `json:"categoryContainsFold,omitempty"` + // annotation field predicates + Annotation *string `json:"annotation,omitempty"` + AnnotationNeq *string `json:"annotationNEQ,omitempty"` + AnnotationIn []string `json:"annotationIn,omitempty"` + AnnotationNotIn []string `json:"annotationNotIn,omitempty"` + AnnotationGt *string `json:"annotationGT,omitempty"` + AnnotationGte *string `json:"annotationGTE,omitempty"` + AnnotationLt *string `json:"annotationLT,omitempty"` + AnnotationLte *string `json:"annotationLTE,omitempty"` + AnnotationContains *string `json:"annotationContains,omitempty"` + AnnotationHasPrefix *string `json:"annotationHasPrefix,omitempty"` + AnnotationHasSuffix *string `json:"annotationHasSuffix,omitempty"` + AnnotationIsNil *bool `json:"annotationIsNil,omitempty"` + AnnotationNotNil *bool `json:"annotationNotNil,omitempty"` + AnnotationEqualFold *string `json:"annotationEqualFold,omitempty"` + AnnotationContainsFold *string `json:"annotationContainsFold,omitempty"` + // user edge predicates + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // entity edge predicates + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` + // group edge predicates + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` +} + +type GlobalSearchResultConnection struct { + Page *PageInfo `json:"page"` + Nodes []GlobalSearchResult `json:"nodes"` +} + +type Group struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name"` + // the groups description + Description *string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName string `json:"displayName"` + Owner *Organization `json:"owner,omitempty"` + Setting *GroupSetting `json:"setting"` + Users []*User `json:"users,omitempty"` + Events []*Event `json:"events,omitempty"` + Integrations []*Integration `json:"integrations,omitempty"` + Files []*File `json:"files,omitempty"` + Members []*GroupMembership `json:"members,omitempty"` +} + +func (Group) IsNode() {} + +// Return response for createBulkGroup mutation +type GroupBulkCreatePayload struct { + // Created groups + Groups []*Group `json:"groups,omitempty"` +} + +// A connection to a list of items. +type GroupConnection struct { + // A list of edges. + Edges []*GroupEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createGroup mutation +type GroupCreatePayload struct { + // Created group + Group *Group `json:"group"` +} + +// Return response for deleteGroup mutation +type GroupDeletePayload struct { + // Deleted group ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type GroupEdge struct { + // The item at the end of the edge. + Node *Group `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type GroupHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the group - must be unique within the organization + Name string `json:"name"` + // the groups description + Description *string `json:"description,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName string `json:"displayName"` +} + +func (GroupHistory) IsNode() {} + +// A connection to a list of items. +type GroupHistoryConnection struct { + // A list of edges. + Edges []*GroupHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type GroupHistoryEdge struct { + // The item at the end of the edge. + Node *GroupHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for GroupHistory connections +type GroupHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order GroupHistories. + Field GroupHistoryOrderField `json:"field"` +} + +// GroupHistoryWhereInput is used for filtering GroupHistory objects. +// Input was generated by ent. +type GroupHistoryWhereInput struct { + Not *GroupHistoryWhereInput `json:"not,omitempty"` + And []*GroupHistoryWhereInput `json:"and,omitempty"` + Or []*GroupHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` +} + +type GroupMembership struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + GroupID string `json:"groupID"` + UserID string `json:"userID"` + Group *Group `json:"group"` + User *User `json:"user"` + Events []*Event `json:"events,omitempty"` +} + +func (GroupMembership) IsNode() {} + +// Return response for createBulkGroupMembership mutation +type GroupMembershipBulkCreatePayload struct { + // Created groupMemberships + GroupMemberships []*GroupMembership `json:"groupMemberships,omitempty"` +} + +// A connection to a list of items. +type GroupMembershipConnection struct { + // A list of edges. + Edges []*GroupMembershipEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createGroupMembership mutation +type GroupMembershipCreatePayload struct { + // Created groupMembership + GroupMembership *GroupMembership `json:"groupMembership"` +} + +// Return response for deleteGroupMembership mutation +type GroupMembershipDeletePayload struct { + // Deleted groupMembership ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type GroupMembershipEdge struct { + // The item at the end of the edge. + Node *GroupMembership `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type GroupMembershipHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + GroupID string `json:"groupID"` + UserID string `json:"userID"` +} + +func (GroupMembershipHistory) IsNode() {} + +// A connection to a list of items. +type GroupMembershipHistoryConnection struct { + // A list of edges. + Edges []*GroupMembershipHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type GroupMembershipHistoryEdge struct { + // The item at the end of the edge. + Node *GroupMembershipHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// GroupMembershipHistoryWhereInput is used for filtering GroupMembershipHistory objects. +// Input was generated by ent. +type GroupMembershipHistoryWhereInput struct { + Not *GroupMembershipHistoryWhereInput `json:"not,omitempty"` + And []*GroupMembershipHistoryWhereInput `json:"and,omitempty"` + Or []*GroupMembershipHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + // group_id field predicates + GroupID *string `json:"groupID,omitempty"` + GroupIDNeq *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGt *string `json:"groupIDGT,omitempty"` + GroupIDGte *string `json:"groupIDGTE,omitempty"` + GroupIDLt *string `json:"groupIDLT,omitempty"` + GroupIDLte *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` +} + +// Return response for updateGroupMembership mutation +type GroupMembershipUpdatePayload struct { + // Updated groupMembership + GroupMembership *GroupMembership `json:"groupMembership"` +} + +// GroupMembershipWhereInput is used for filtering GroupMembership objects. +// Input was generated by ent. +type GroupMembershipWhereInput struct { + Not *GroupMembershipWhereInput `json:"not,omitempty"` + And []*GroupMembershipWhereInput `json:"and,omitempty"` + Or []*GroupMembershipWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + GroupID *string `json:"groupID,omitempty"` + UserID *string `json:"userID,omitempty"` +} + +// Ordering options for Group connections +type GroupOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Groups. + Field GroupOrderField `json:"field"` +} + +type GroupSearchResult struct { + Groups []*Group `json:"groups,omitempty"` +} + +func (GroupSearchResult) IsGlobalSearchResult() {} + +type GroupSetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility enums.Visibility `json:"visibility"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy enums.JoinPolicy `json:"joinPolicy"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + // the group id associated with the settings + GroupID *string `json:"groupID,omitempty"` + Group *Group `json:"group,omitempty"` +} + +func (GroupSetting) IsNode() {} + +// Return response for createBulkGroupSetting mutation +type GroupSettingBulkCreatePayload struct { + // Created groupSettings + GroupSettings []*GroupSetting `json:"groupSettings,omitempty"` +} + +// A connection to a list of items. +type GroupSettingConnection struct { + // A list of edges. + Edges []*GroupSettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createGroupSetting mutation +type GroupSettingCreatePayload struct { + // Created groupSetting + GroupSetting *GroupSetting `json:"groupSetting"` +} + +// Return response for deleteGroupSetting mutation +type GroupSettingDeletePayload struct { + // Deleted groupSetting ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type GroupSettingEdge struct { + // The item at the end of the edge. + Node *GroupSetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type GroupSettingHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility enums.Visibility `json:"visibility"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy enums.JoinPolicy `json:"joinPolicy"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + // the group id associated with the settings + GroupID *string `json:"groupID,omitempty"` +} + +func (GroupSettingHistory) IsNode() {} + +// A connection to a list of items. +type GroupSettingHistoryConnection struct { + // A list of edges. + Edges []*GroupSettingHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type GroupSettingHistoryEdge struct { + // The item at the end of the edge. + Node *GroupSettingHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// GroupSettingHistoryWhereInput is used for filtering GroupSettingHistory objects. +// Input was generated by ent. +type GroupSettingHistoryWhereInput struct { + Not *GroupSettingHistoryWhereInput `json:"not,omitempty"` + And []*GroupSettingHistoryWhereInput `json:"and,omitempty"` + Or []*GroupSettingHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // visibility field predicates + Visibility *enums.Visibility `json:"visibility,omitempty"` + VisibilityNeq *enums.Visibility `json:"visibilityNEQ,omitempty"` + VisibilityIn []enums.Visibility `json:"visibilityIn,omitempty"` + VisibilityNotIn []enums.Visibility `json:"visibilityNotIn,omitempty"` + // join_policy field predicates + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + JoinPolicyNeq *enums.JoinPolicy `json:"joinPolicyNEQ,omitempty"` + JoinPolicyIn []enums.JoinPolicy `json:"joinPolicyIn,omitempty"` + JoinPolicyNotIn []enums.JoinPolicy `json:"joinPolicyNotIn,omitempty"` + // sync_to_slack field predicates + SyncToSlack *bool `json:"syncToSlack,omitempty"` + SyncToSlackNeq *bool `json:"syncToSlackNEQ,omitempty"` + SyncToSlackIsNil *bool `json:"syncToSlackIsNil,omitempty"` + SyncToSlackNotNil *bool `json:"syncToSlackNotNil,omitempty"` + // sync_to_github field predicates + SyncToGithub *bool `json:"syncToGithub,omitempty"` + SyncToGithubNeq *bool `json:"syncToGithubNEQ,omitempty"` + SyncToGithubIsNil *bool `json:"syncToGithubIsNil,omitempty"` + SyncToGithubNotNil *bool `json:"syncToGithubNotNil,omitempty"` + // group_id field predicates + GroupID *string `json:"groupID,omitempty"` + GroupIDNeq *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGt *string `json:"groupIDGT,omitempty"` + GroupIDGte *string `json:"groupIDGTE,omitempty"` + GroupIDLt *string `json:"groupIDLT,omitempty"` + GroupIDLte *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDIsNil *bool `json:"groupIDIsNil,omitempty"` + GroupIDNotNil *bool `json:"groupIDNotNil,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` +} + +// Return response for updateGroupSetting mutation +type GroupSettingUpdatePayload struct { + // Updated groupSetting + GroupSetting *GroupSetting `json:"groupSetting"` +} + +// GroupSettingWhereInput is used for filtering GroupSetting objects. +// Input was generated by ent. +type GroupSettingWhereInput struct { + Not *GroupSettingWhereInput `json:"not,omitempty"` + And []*GroupSettingWhereInput `json:"and,omitempty"` + Or []*GroupSettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // visibility field predicates + Visibility *enums.Visibility `json:"visibility,omitempty"` + VisibilityNeq *enums.Visibility `json:"visibilityNEQ,omitempty"` + VisibilityIn []enums.Visibility `json:"visibilityIn,omitempty"` + VisibilityNotIn []enums.Visibility `json:"visibilityNotIn,omitempty"` + // join_policy field predicates + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + JoinPolicyNeq *enums.JoinPolicy `json:"joinPolicyNEQ,omitempty"` + JoinPolicyIn []enums.JoinPolicy `json:"joinPolicyIn,omitempty"` + JoinPolicyNotIn []enums.JoinPolicy `json:"joinPolicyNotIn,omitempty"` + // sync_to_slack field predicates + SyncToSlack *bool `json:"syncToSlack,omitempty"` + SyncToSlackNeq *bool `json:"syncToSlackNEQ,omitempty"` + SyncToSlackIsNil *bool `json:"syncToSlackIsNil,omitempty"` + SyncToSlackNotNil *bool `json:"syncToSlackNotNil,omitempty"` + // sync_to_github field predicates + SyncToGithub *bool `json:"syncToGithub,omitempty"` + SyncToGithubNeq *bool `json:"syncToGithubNEQ,omitempty"` + SyncToGithubIsNil *bool `json:"syncToGithubIsNil,omitempty"` + SyncToGithubNotNil *bool `json:"syncToGithubNotNil,omitempty"` + // group_id field predicates + GroupID *string `json:"groupID,omitempty"` + GroupIDNeq *string `json:"groupIDNEQ,omitempty"` + GroupIDIn []string `json:"groupIDIn,omitempty"` + GroupIDNotIn []string `json:"groupIDNotIn,omitempty"` + GroupIDGt *string `json:"groupIDGT,omitempty"` + GroupIDGte *string `json:"groupIDGTE,omitempty"` + GroupIDLt *string `json:"groupIDLT,omitempty"` + GroupIDLte *string `json:"groupIDLTE,omitempty"` + GroupIDContains *string `json:"groupIDContains,omitempty"` + GroupIDHasPrefix *string `json:"groupIDHasPrefix,omitempty"` + GroupIDHasSuffix *string `json:"groupIDHasSuffix,omitempty"` + GroupIDIsNil *bool `json:"groupIDIsNil,omitempty"` + GroupIDNotNil *bool `json:"groupIDNotNil,omitempty"` + GroupIDEqualFold *string `json:"groupIDEqualFold,omitempty"` + GroupIDContainsFold *string `json:"groupIDContainsFold,omitempty"` + // group edge predicates + HasGroup *bool `json:"hasGroup,omitempty"` + HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"` +} + +// Return response for updateGroup mutation +type GroupUpdatePayload struct { + // Updated group + Group *Group `json:"group"` +} + +// GroupWhereInput is used for filtering Group objects. +// Input was generated by ent. +type GroupWhereInput struct { + Not *GroupWhereInput `json:"not,omitempty"` + And []*GroupWhereInput `json:"and,omitempty"` + Or []*GroupWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // setting edge predicates + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*GroupSettingWhereInput `json:"hasSettingWith,omitempty"` + // users edge predicates + HasUsers *bool `json:"hasUsers,omitempty"` + HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // members edge predicates + HasMembers *bool `json:"hasMembers,omitempty"` + HasMembersWith []*GroupMembershipWhereInput `json:"hasMembersWith,omitempty"` +} + +type Hush struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName *string `json:"secretName,omitempty"` + // the integration associated with the secret + Integrations []*Integration `json:"integrations,omitempty"` + Organization []*Organization `json:"organization,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (Hush) IsNode() {} + +// Return response for createBulkHush mutation +type HushBulkCreatePayload struct { + // Created hushs + Hushes []*Hush `json:"hushes,omitempty"` +} + +// A connection to a list of items. +type HushConnection struct { + // A list of edges. + Edges []*HushEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createHush mutation +type HushCreatePayload struct { + // Created hush + Hush *Hush `json:"hush"` +} + +// Return response for deleteHush mutation +type HushDeletePayload struct { + // Deleted hush ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type HushEdge struct { + // The item at the end of the edge. + Node *Hush `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type HushHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the logical name of the corresponding hush secret or it's general grouping + Name string `json:"name"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + // the generic name of a secret associated with the organization + SecretName *string `json:"secretName,omitempty"` +} + +func (HushHistory) IsNode() {} + +// A connection to a list of items. +type HushHistoryConnection struct { + // A list of edges. + Edges []*HushHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type HushHistoryEdge struct { + // The item at the end of the edge. + Node *HushHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for HushHistory connections +type HushHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order HushHistories. + Field HushHistoryOrderField `json:"field"` +} + +// HushHistoryWhereInput is used for filtering HushHistory objects. +// Input was generated by ent. +type HushHistoryWhereInput struct { + Not *HushHistoryWhereInput `json:"not,omitempty"` + And []*HushHistoryWhereInput `json:"and,omitempty"` + Or []*HushHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + // secret_name field predicates + SecretName *string `json:"secretName,omitempty"` + SecretNameNeq *string `json:"secretNameNEQ,omitempty"` + SecretNameIn []string `json:"secretNameIn,omitempty"` + SecretNameNotIn []string `json:"secretNameNotIn,omitempty"` + SecretNameGt *string `json:"secretNameGT,omitempty"` + SecretNameGte *string `json:"secretNameGTE,omitempty"` + SecretNameLt *string `json:"secretNameLT,omitempty"` + SecretNameLte *string `json:"secretNameLTE,omitempty"` + SecretNameContains *string `json:"secretNameContains,omitempty"` + SecretNameHasPrefix *string `json:"secretNameHasPrefix,omitempty"` + SecretNameHasSuffix *string `json:"secretNameHasSuffix,omitempty"` + SecretNameIsNil *bool `json:"secretNameIsNil,omitempty"` + SecretNameNotNil *bool `json:"secretNameNotNil,omitempty"` + SecretNameEqualFold *string `json:"secretNameEqualFold,omitempty"` + SecretNameContainsFold *string `json:"secretNameContainsFold,omitempty"` +} + +// Ordering options for Hush connections +type HushOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Hushes. + Field HushOrderField `json:"field"` +} + +// Return response for updateHush mutation +type HushUpdatePayload struct { + // Updated hush + Hush *Hush `json:"hush"` +} + +// HushWhereInput is used for filtering Hush objects. +// Input was generated by ent. +type HushWhereInput struct { + Not *HushWhereInput `json:"not,omitempty"` + And []*HushWhereInput `json:"and,omitempty"` + Or []*HushWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + // secret_name field predicates + SecretName *string `json:"secretName,omitempty"` + SecretNameNeq *string `json:"secretNameNEQ,omitempty"` + SecretNameIn []string `json:"secretNameIn,omitempty"` + SecretNameNotIn []string `json:"secretNameNotIn,omitempty"` + SecretNameGt *string `json:"secretNameGT,omitempty"` + SecretNameGte *string `json:"secretNameGTE,omitempty"` + SecretNameLt *string `json:"secretNameLT,omitempty"` + SecretNameLte *string `json:"secretNameLTE,omitempty"` + SecretNameContains *string `json:"secretNameContains,omitempty"` + SecretNameHasPrefix *string `json:"secretNameHasPrefix,omitempty"` + SecretNameHasSuffix *string `json:"secretNameHasSuffix,omitempty"` + SecretNameIsNil *bool `json:"secretNameIsNil,omitempty"` + SecretNameNotNil *bool `json:"secretNameNotNil,omitempty"` + SecretNameEqualFold *string `json:"secretNameEqualFold,omitempty"` + SecretNameContainsFold *string `json:"secretNameContainsFold,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Integration struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name"` + // a description of the integration + Description *string `json:"description,omitempty"` + Kind *string `json:"kind,omitempty"` + Owner *Organization `json:"owner,omitempty"` + // the secrets associated with the integration + Secrets []*Hush `json:"secrets,omitempty"` + // the oauth2 tokens associated with the integration + Oauth2tokens []*OhAuthTooToken `json:"oauth2tokens,omitempty"` + Events []*Event `json:"events,omitempty"` + Webhooks []*Webhook `json:"webhooks,omitempty"` +} + +func (Integration) IsNode() {} + +// Return response for createBulkIntegration mutation +type IntegrationBulkCreatePayload struct { + // Created integrations + Integrations []*Integration `json:"integrations,omitempty"` +} + +// A connection to a list of items. +type IntegrationConnection struct { + // A list of edges. + Edges []*IntegrationEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createIntegration mutation +type IntegrationCreatePayload struct { + // Created integration + Integration *Integration `json:"integration"` +} + +// Return response for deleteIntegration mutation +type IntegrationDeletePayload struct { + // Deleted integration ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type IntegrationEdge struct { + // The item at the end of the edge. + Node *Integration `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type IntegrationHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the integration - must be unique within the organization + Name string `json:"name"` + // a description of the integration + Description *string `json:"description,omitempty"` + Kind *string `json:"kind,omitempty"` +} + +func (IntegrationHistory) IsNode() {} + +// A connection to a list of items. +type IntegrationHistoryConnection struct { + // A list of edges. + Edges []*IntegrationHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type IntegrationHistoryEdge struct { + // The item at the end of the edge. + Node *IntegrationHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for IntegrationHistory connections +type IntegrationHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order IntegrationHistories. + Field IntegrationHistoryOrderField `json:"field"` +} + +// IntegrationHistoryWhereInput is used for filtering IntegrationHistory objects. +// Input was generated by ent. +type IntegrationHistoryWhereInput struct { + Not *IntegrationHistoryWhereInput `json:"not,omitempty"` + And []*IntegrationHistoryWhereInput `json:"and,omitempty"` + Or []*IntegrationHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` +} + +// Ordering options for Integration connections +type IntegrationOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Integrations. + Field IntegrationOrderField `json:"field"` +} + +// Return response for updateIntegration mutation +type IntegrationUpdatePayload struct { + // Updated integration + Integration *Integration `json:"integration"` +} + +// IntegrationWhereInput is used for filtering Integration objects. +// Input was generated by ent. +type IntegrationWhereInput struct { + Not *IntegrationWhereInput `json:"not,omitempty"` + And []*IntegrationWhereInput `json:"and,omitempty"` + Or []*IntegrationWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // kind field predicates + Kind *string `json:"kind,omitempty"` + KindNeq *string `json:"kindNEQ,omitempty"` + KindIn []string `json:"kindIn,omitempty"` + KindNotIn []string `json:"kindNotIn,omitempty"` + KindGt *string `json:"kindGT,omitempty"` + KindGte *string `json:"kindGTE,omitempty"` + KindLt *string `json:"kindLT,omitempty"` + KindLte *string `json:"kindLTE,omitempty"` + KindContains *string `json:"kindContains,omitempty"` + KindHasPrefix *string `json:"kindHasPrefix,omitempty"` + KindHasSuffix *string `json:"kindHasSuffix,omitempty"` + KindIsNil *bool `json:"kindIsNil,omitempty"` + KindNotNil *bool `json:"kindNotNil,omitempty"` + KindEqualFold *string `json:"kindEqualFold,omitempty"` + KindContainsFold *string `json:"kindContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // secrets edge predicates + HasSecrets *bool `json:"hasSecrets,omitempty"` + HasSecretsWith []*HushWhereInput `json:"hasSecretsWith,omitempty"` + // oauth2tokens edge predicates + HasOauth2tokens *bool `json:"hasOauth2tokens,omitempty"` + HasOauth2tokensWith []*OhAuthTooTokenWhereInput `json:"hasOauth2tokensWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // webhooks edge predicates + HasWebhooks *bool `json:"hasWebhooks,omitempty"` + HasWebhooksWith []*WebhookWhereInput `json:"hasWebhooksWith,omitempty"` +} + +type Invite struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the expiration date of the invitation token which defaults to 14 days in the future from creation + Expires *time.Time `json:"expires,omitempty"` + // the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + Recipient string `json:"recipient"` + // the status of the invitation + Status enums.InviteStatus `json:"status"` + Role enums.Role `json:"role"` + // the number of attempts made to perform email send of the invitation, maximum of 5 + SendAttempts int64 `json:"sendAttempts"` + // the user who initiated the invitation + RequestorID *string `json:"requestorID,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (Invite) IsNode() {} + +// Return response for createBulkInvite mutation +type InviteBulkCreatePayload struct { + // Created invites + Invites []*Invite `json:"invites,omitempty"` +} + +// A connection to a list of items. +type InviteConnection struct { + // A list of edges. + Edges []*InviteEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createInvite mutation +type InviteCreatePayload struct { + // Created invite + Invite *Invite `json:"invite"` +} + +// Return response for deleteInvite mutation +type InviteDeletePayload struct { + // Deleted invite ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type InviteEdge struct { + // The item at the end of the edge. + Node *Invite `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateInvite mutation +type InviteUpdatePayload struct { + // Updated invite + Invite *Invite `json:"invite"` +} + +// InviteWhereInput is used for filtering Invite objects. +// Input was generated by ent. +type InviteWhereInput struct { + Not *InviteWhereInput `json:"not,omitempty"` + And []*InviteWhereInput `json:"and,omitempty"` + Or []*InviteWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // expires field predicates + Expires *time.Time `json:"expires,omitempty"` + ExpiresNeq *time.Time `json:"expiresNEQ,omitempty"` + ExpiresIn []*time.Time `json:"expiresIn,omitempty"` + ExpiresNotIn []*time.Time `json:"expiresNotIn,omitempty"` + ExpiresGt *time.Time `json:"expiresGT,omitempty"` + ExpiresGte *time.Time `json:"expiresGTE,omitempty"` + ExpiresLt *time.Time `json:"expiresLT,omitempty"` + ExpiresLte *time.Time `json:"expiresLTE,omitempty"` + ExpiresIsNil *bool `json:"expiresIsNil,omitempty"` + ExpiresNotNil *bool `json:"expiresNotNil,omitempty"` + // recipient field predicates + Recipient *string `json:"recipient,omitempty"` + RecipientNeq *string `json:"recipientNEQ,omitempty"` + RecipientIn []string `json:"recipientIn,omitempty"` + RecipientNotIn []string `json:"recipientNotIn,omitempty"` + RecipientGt *string `json:"recipientGT,omitempty"` + RecipientGte *string `json:"recipientGTE,omitempty"` + RecipientLt *string `json:"recipientLT,omitempty"` + RecipientLte *string `json:"recipientLTE,omitempty"` + RecipientContains *string `json:"recipientContains,omitempty"` + RecipientHasPrefix *string `json:"recipientHasPrefix,omitempty"` + RecipientHasSuffix *string `json:"recipientHasSuffix,omitempty"` + RecipientEqualFold *string `json:"recipientEqualFold,omitempty"` + RecipientContainsFold *string `json:"recipientContainsFold,omitempty"` + // status field predicates + Status *enums.InviteStatus `json:"status,omitempty"` + StatusNeq *enums.InviteStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.InviteStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.InviteStatus `json:"statusNotIn,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + // send_attempts field predicates + SendAttempts *int64 `json:"sendAttempts,omitempty"` + SendAttemptsNeq *int64 `json:"sendAttemptsNEQ,omitempty"` + SendAttemptsIn []int64 `json:"sendAttemptsIn,omitempty"` + SendAttemptsNotIn []int64 `json:"sendAttemptsNotIn,omitempty"` + SendAttemptsGt *int64 `json:"sendAttemptsGT,omitempty"` + SendAttemptsGte *int64 `json:"sendAttemptsGTE,omitempty"` + SendAttemptsLt *int64 `json:"sendAttemptsLT,omitempty"` + SendAttemptsLte *int64 `json:"sendAttemptsLTE,omitempty"` + // requestor_id field predicates + RequestorID *string `json:"requestorID,omitempty"` + RequestorIDNeq *string `json:"requestorIDNEQ,omitempty"` + RequestorIDIn []string `json:"requestorIDIn,omitempty"` + RequestorIDNotIn []string `json:"requestorIDNotIn,omitempty"` + RequestorIDGt *string `json:"requestorIDGT,omitempty"` + RequestorIDGte *string `json:"requestorIDGTE,omitempty"` + RequestorIDLt *string `json:"requestorIDLT,omitempty"` + RequestorIDLte *string `json:"requestorIDLTE,omitempty"` + RequestorIDContains *string `json:"requestorIDContains,omitempty"` + RequestorIDHasPrefix *string `json:"requestorIDHasPrefix,omitempty"` + RequestorIDHasSuffix *string `json:"requestorIDHasSuffix,omitempty"` + RequestorIDIsNil *bool `json:"requestorIDIsNil,omitempty"` + RequestorIDNotNil *bool `json:"requestorIDNotNil,omitempty"` + RequestorIDEqualFold *string `json:"requestorIDEqualFold,omitempty"` + RequestorIDContainsFold *string `json:"requestorIDContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Mutation struct { +} + +type Note struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the text of the note + Text string `json:"text"` + Owner *Organization `json:"owner,omitempty"` + Entity *Entity `json:"entity,omitempty"` +} + +func (Note) IsNode() {} + +// A connection to a list of items. +type NoteConnection struct { + // A list of edges. + Edges []*NoteEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type NoteEdge struct { + // The item at the end of the edge. + Node *Note `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type NoteHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the text of the note + Text string `json:"text"` +} + +func (NoteHistory) IsNode() {} + +// A connection to a list of items. +type NoteHistoryConnection struct { + // A list of edges. + Edges []*NoteHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type NoteHistoryEdge struct { + // The item at the end of the edge. + Node *NoteHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// NoteHistoryWhereInput is used for filtering NoteHistory objects. +// Input was generated by ent. +type NoteHistoryWhereInput struct { + Not *NoteHistoryWhereInput `json:"not,omitempty"` + And []*NoteHistoryWhereInput `json:"and,omitempty"` + Or []*NoteHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // text field predicates + Text *string `json:"text,omitempty"` + TextNeq *string `json:"textNEQ,omitempty"` + TextIn []string `json:"textIn,omitempty"` + TextNotIn []string `json:"textNotIn,omitempty"` + TextGt *string `json:"textGT,omitempty"` + TextGte *string `json:"textGTE,omitempty"` + TextLt *string `json:"textLT,omitempty"` + TextLte *string `json:"textLTE,omitempty"` + TextContains *string `json:"textContains,omitempty"` + TextHasPrefix *string `json:"textHasPrefix,omitempty"` + TextHasSuffix *string `json:"textHasSuffix,omitempty"` + TextEqualFold *string `json:"textEqualFold,omitempty"` + TextContainsFold *string `json:"textContainsFold,omitempty"` +} + +// NoteWhereInput is used for filtering Note objects. +// Input was generated by ent. +type NoteWhereInput struct { + Not *NoteWhereInput `json:"not,omitempty"` + And []*NoteWhereInput `json:"and,omitempty"` + Or []*NoteWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // text field predicates + Text *string `json:"text,omitempty"` + TextNeq *string `json:"textNEQ,omitempty"` + TextIn []string `json:"textIn,omitempty"` + TextNotIn []string `json:"textNotIn,omitempty"` + TextGt *string `json:"textGT,omitempty"` + TextGte *string `json:"textGTE,omitempty"` + TextLt *string `json:"textLT,omitempty"` + TextLte *string `json:"textLTE,omitempty"` + TextContains *string `json:"textContains,omitempty"` + TextHasPrefix *string `json:"textHasPrefix,omitempty"` + TextHasSuffix *string `json:"textHasSuffix,omitempty"` + TextEqualFold *string `json:"textEqualFold,omitempty"` + TextContainsFold *string `json:"textContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // entity edge predicates + HasEntity *bool `json:"hasEntity,omitempty"` + HasEntityWith []*EntityWhereInput `json:"hasEntityWith,omitempty"` +} + +type OauthProvider struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the oauth provider's name + Name string `json:"name"` + // the client id for the oauth provider + ClientID string `json:"clientID"` + // the client secret + ClientSecret string `json:"clientSecret"` + // the redirect url + RedirectURL string `json:"redirectURL"` + // the scopes + Scopes string `json:"scopes"` + // the auth url of the provider + AuthURL string `json:"authURL"` + // the token url of the provider + TokenURL string `json:"tokenURL"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle string `json:"authStyle"` + // the URL to request user information by token + InfoURL string `json:"infoURL"` + Owner *Organization `json:"owner,omitempty"` +} + +func (OauthProvider) IsNode() {} + +// Return response for createBulkOauthProvider mutation +type OauthProviderBulkCreatePayload struct { + // Created oauthProviders + OauthProviders []*OauthProvider `json:"oauthProviders,omitempty"` +} + +// A connection to a list of items. +type OauthProviderConnection struct { + // A list of edges. + Edges []*OauthProviderEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOauthProvider mutation +type OauthProviderCreatePayload struct { + // Created oauthProvider + OauthProvider *OauthProvider `json:"oauthProvider"` +} + +// Return response for deleteOauthProvider mutation +type OauthProviderDeletePayload struct { + // Deleted oauthProvider ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OauthProviderEdge struct { + // The item at the end of the edge. + Node *OauthProvider `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OauthProviderHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the oauth provider's name + Name string `json:"name"` + // the client id for the oauth provider + ClientID string `json:"clientID"` + // the client secret + ClientSecret string `json:"clientSecret"` + // the redirect url + RedirectURL string `json:"redirectURL"` + // the scopes + Scopes string `json:"scopes"` + // the auth url of the provider + AuthURL string `json:"authURL"` + // the token url of the provider + TokenURL string `json:"tokenURL"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle string `json:"authStyle"` + // the URL to request user information by token + InfoURL string `json:"infoURL"` +} + +func (OauthProviderHistory) IsNode() {} + +// A connection to a list of items. +type OauthProviderHistoryConnection struct { + // A list of edges. + Edges []*OauthProviderHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OauthProviderHistoryEdge struct { + // The item at the end of the edge. + Node *OauthProviderHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// OauthProviderHistoryWhereInput is used for filtering OauthProviderHistory objects. +// Input was generated by ent. +type OauthProviderHistoryWhereInput struct { + Not *OauthProviderHistoryWhereInput `json:"not,omitempty"` + And []*OauthProviderHistoryWhereInput `json:"and,omitempty"` + Or []*OauthProviderHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // client_id field predicates + ClientID *string `json:"clientID,omitempty"` + ClientIDNeq *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGt *string `json:"clientIDGT,omitempty"` + ClientIDGte *string `json:"clientIDGTE,omitempty"` + ClientIDLt *string `json:"clientIDLT,omitempty"` + ClientIDLte *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + // client_secret field predicates + ClientSecret *string `json:"clientSecret,omitempty"` + ClientSecretNeq *string `json:"clientSecretNEQ,omitempty"` + ClientSecretIn []string `json:"clientSecretIn,omitempty"` + ClientSecretNotIn []string `json:"clientSecretNotIn,omitempty"` + ClientSecretGt *string `json:"clientSecretGT,omitempty"` + ClientSecretGte *string `json:"clientSecretGTE,omitempty"` + ClientSecretLt *string `json:"clientSecretLT,omitempty"` + ClientSecretLte *string `json:"clientSecretLTE,omitempty"` + ClientSecretContains *string `json:"clientSecretContains,omitempty"` + ClientSecretHasPrefix *string `json:"clientSecretHasPrefix,omitempty"` + ClientSecretHasSuffix *string `json:"clientSecretHasSuffix,omitempty"` + ClientSecretEqualFold *string `json:"clientSecretEqualFold,omitempty"` + ClientSecretContainsFold *string `json:"clientSecretContainsFold,omitempty"` + // redirect_url field predicates + RedirectURL *string `json:"redirectURL,omitempty"` + RedirectURLNeq *string `json:"redirectURLNEQ,omitempty"` + RedirectURLIn []string `json:"redirectURLIn,omitempty"` + RedirectURLNotIn []string `json:"redirectURLNotIn,omitempty"` + RedirectURLGt *string `json:"redirectURLGT,omitempty"` + RedirectURLGte *string `json:"redirectURLGTE,omitempty"` + RedirectURLLt *string `json:"redirectURLLT,omitempty"` + RedirectURLLte *string `json:"redirectURLLTE,omitempty"` + RedirectURLContains *string `json:"redirectURLContains,omitempty"` + RedirectURLHasPrefix *string `json:"redirectURLHasPrefix,omitempty"` + RedirectURLHasSuffix *string `json:"redirectURLHasSuffix,omitempty"` + RedirectURLEqualFold *string `json:"redirectURLEqualFold,omitempty"` + RedirectURLContainsFold *string `json:"redirectURLContainsFold,omitempty"` + // scopes field predicates + Scopes *string `json:"scopes,omitempty"` + ScopesNeq *string `json:"scopesNEQ,omitempty"` + ScopesIn []string `json:"scopesIn,omitempty"` + ScopesNotIn []string `json:"scopesNotIn,omitempty"` + ScopesGt *string `json:"scopesGT,omitempty"` + ScopesGte *string `json:"scopesGTE,omitempty"` + ScopesLt *string `json:"scopesLT,omitempty"` + ScopesLte *string `json:"scopesLTE,omitempty"` + ScopesContains *string `json:"scopesContains,omitempty"` + ScopesHasPrefix *string `json:"scopesHasPrefix,omitempty"` + ScopesHasSuffix *string `json:"scopesHasSuffix,omitempty"` + ScopesEqualFold *string `json:"scopesEqualFold,omitempty"` + ScopesContainsFold *string `json:"scopesContainsFold,omitempty"` + // auth_url field predicates + AuthURL *string `json:"authURL,omitempty"` + AuthURLNeq *string `json:"authURLNEQ,omitempty"` + AuthURLIn []string `json:"authURLIn,omitempty"` + AuthURLNotIn []string `json:"authURLNotIn,omitempty"` + AuthURLGt *string `json:"authURLGT,omitempty"` + AuthURLGte *string `json:"authURLGTE,omitempty"` + AuthURLLt *string `json:"authURLLT,omitempty"` + AuthURLLte *string `json:"authURLLTE,omitempty"` + AuthURLContains *string `json:"authURLContains,omitempty"` + AuthURLHasPrefix *string `json:"authURLHasPrefix,omitempty"` + AuthURLHasSuffix *string `json:"authURLHasSuffix,omitempty"` + AuthURLEqualFold *string `json:"authURLEqualFold,omitempty"` + AuthURLContainsFold *string `json:"authURLContainsFold,omitempty"` + // token_url field predicates + TokenURL *string `json:"tokenURL,omitempty"` + TokenURLNeq *string `json:"tokenURLNEQ,omitempty"` + TokenURLIn []string `json:"tokenURLIn,omitempty"` + TokenURLNotIn []string `json:"tokenURLNotIn,omitempty"` + TokenURLGt *string `json:"tokenURLGT,omitempty"` + TokenURLGte *string `json:"tokenURLGTE,omitempty"` + TokenURLLt *string `json:"tokenURLLT,omitempty"` + TokenURLLte *string `json:"tokenURLLTE,omitempty"` + TokenURLContains *string `json:"tokenURLContains,omitempty"` + TokenURLHasPrefix *string `json:"tokenURLHasPrefix,omitempty"` + TokenURLHasSuffix *string `json:"tokenURLHasSuffix,omitempty"` + TokenURLEqualFold *string `json:"tokenURLEqualFold,omitempty"` + TokenURLContainsFold *string `json:"tokenURLContainsFold,omitempty"` + // auth_style field predicates + AuthStyle *string `json:"authStyle,omitempty"` + AuthStyleNeq *string `json:"authStyleNEQ,omitempty"` + AuthStyleIn []string `json:"authStyleIn,omitempty"` + AuthStyleNotIn []string `json:"authStyleNotIn,omitempty"` + AuthStyleGt *string `json:"authStyleGT,omitempty"` + AuthStyleGte *string `json:"authStyleGTE,omitempty"` + AuthStyleLt *string `json:"authStyleLT,omitempty"` + AuthStyleLte *string `json:"authStyleLTE,omitempty"` + // info_url field predicates + InfoURL *string `json:"infoURL,omitempty"` + InfoURLNeq *string `json:"infoURLNEQ,omitempty"` + InfoURLIn []string `json:"infoURLIn,omitempty"` + InfoURLNotIn []string `json:"infoURLNotIn,omitempty"` + InfoURLGt *string `json:"infoURLGT,omitempty"` + InfoURLGte *string `json:"infoURLGTE,omitempty"` + InfoURLLt *string `json:"infoURLLT,omitempty"` + InfoURLLte *string `json:"infoURLLTE,omitempty"` + InfoURLContains *string `json:"infoURLContains,omitempty"` + InfoURLHasPrefix *string `json:"infoURLHasPrefix,omitempty"` + InfoURLHasSuffix *string `json:"infoURLHasSuffix,omitempty"` + InfoURLEqualFold *string `json:"infoURLEqualFold,omitempty"` + InfoURLContainsFold *string `json:"infoURLContainsFold,omitempty"` +} + +// Return response for updateOauthProvider mutation +type OauthProviderUpdatePayload struct { + // Updated oauthProvider + OauthProvider *OauthProvider `json:"oauthProvider"` +} + +// OauthProviderWhereInput is used for filtering OauthProvider objects. +// Input was generated by ent. +type OauthProviderWhereInput struct { + Not *OauthProviderWhereInput `json:"not,omitempty"` + And []*OauthProviderWhereInput `json:"and,omitempty"` + Or []*OauthProviderWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // client_id field predicates + ClientID *string `json:"clientID,omitempty"` + ClientIDNeq *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGt *string `json:"clientIDGT,omitempty"` + ClientIDGte *string `json:"clientIDGTE,omitempty"` + ClientIDLt *string `json:"clientIDLT,omitempty"` + ClientIDLte *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + // client_secret field predicates + ClientSecret *string `json:"clientSecret,omitempty"` + ClientSecretNeq *string `json:"clientSecretNEQ,omitempty"` + ClientSecretIn []string `json:"clientSecretIn,omitempty"` + ClientSecretNotIn []string `json:"clientSecretNotIn,omitempty"` + ClientSecretGt *string `json:"clientSecretGT,omitempty"` + ClientSecretGte *string `json:"clientSecretGTE,omitempty"` + ClientSecretLt *string `json:"clientSecretLT,omitempty"` + ClientSecretLte *string `json:"clientSecretLTE,omitempty"` + ClientSecretContains *string `json:"clientSecretContains,omitempty"` + ClientSecretHasPrefix *string `json:"clientSecretHasPrefix,omitempty"` + ClientSecretHasSuffix *string `json:"clientSecretHasSuffix,omitempty"` + ClientSecretEqualFold *string `json:"clientSecretEqualFold,omitempty"` + ClientSecretContainsFold *string `json:"clientSecretContainsFold,omitempty"` + // redirect_url field predicates + RedirectURL *string `json:"redirectURL,omitempty"` + RedirectURLNeq *string `json:"redirectURLNEQ,omitempty"` + RedirectURLIn []string `json:"redirectURLIn,omitempty"` + RedirectURLNotIn []string `json:"redirectURLNotIn,omitempty"` + RedirectURLGt *string `json:"redirectURLGT,omitempty"` + RedirectURLGte *string `json:"redirectURLGTE,omitempty"` + RedirectURLLt *string `json:"redirectURLLT,omitempty"` + RedirectURLLte *string `json:"redirectURLLTE,omitempty"` + RedirectURLContains *string `json:"redirectURLContains,omitempty"` + RedirectURLHasPrefix *string `json:"redirectURLHasPrefix,omitempty"` + RedirectURLHasSuffix *string `json:"redirectURLHasSuffix,omitempty"` + RedirectURLEqualFold *string `json:"redirectURLEqualFold,omitempty"` + RedirectURLContainsFold *string `json:"redirectURLContainsFold,omitempty"` + // scopes field predicates + Scopes *string `json:"scopes,omitempty"` + ScopesNeq *string `json:"scopesNEQ,omitempty"` + ScopesIn []string `json:"scopesIn,omitempty"` + ScopesNotIn []string `json:"scopesNotIn,omitempty"` + ScopesGt *string `json:"scopesGT,omitempty"` + ScopesGte *string `json:"scopesGTE,omitempty"` + ScopesLt *string `json:"scopesLT,omitempty"` + ScopesLte *string `json:"scopesLTE,omitempty"` + ScopesContains *string `json:"scopesContains,omitempty"` + ScopesHasPrefix *string `json:"scopesHasPrefix,omitempty"` + ScopesHasSuffix *string `json:"scopesHasSuffix,omitempty"` + ScopesEqualFold *string `json:"scopesEqualFold,omitempty"` + ScopesContainsFold *string `json:"scopesContainsFold,omitempty"` + // auth_url field predicates + AuthURL *string `json:"authURL,omitempty"` + AuthURLNeq *string `json:"authURLNEQ,omitempty"` + AuthURLIn []string `json:"authURLIn,omitempty"` + AuthURLNotIn []string `json:"authURLNotIn,omitempty"` + AuthURLGt *string `json:"authURLGT,omitempty"` + AuthURLGte *string `json:"authURLGTE,omitempty"` + AuthURLLt *string `json:"authURLLT,omitempty"` + AuthURLLte *string `json:"authURLLTE,omitempty"` + AuthURLContains *string `json:"authURLContains,omitempty"` + AuthURLHasPrefix *string `json:"authURLHasPrefix,omitempty"` + AuthURLHasSuffix *string `json:"authURLHasSuffix,omitempty"` + AuthURLEqualFold *string `json:"authURLEqualFold,omitempty"` + AuthURLContainsFold *string `json:"authURLContainsFold,omitempty"` + // token_url field predicates + TokenURL *string `json:"tokenURL,omitempty"` + TokenURLNeq *string `json:"tokenURLNEQ,omitempty"` + TokenURLIn []string `json:"tokenURLIn,omitempty"` + TokenURLNotIn []string `json:"tokenURLNotIn,omitempty"` + TokenURLGt *string `json:"tokenURLGT,omitempty"` + TokenURLGte *string `json:"tokenURLGTE,omitempty"` + TokenURLLt *string `json:"tokenURLLT,omitempty"` + TokenURLLte *string `json:"tokenURLLTE,omitempty"` + TokenURLContains *string `json:"tokenURLContains,omitempty"` + TokenURLHasPrefix *string `json:"tokenURLHasPrefix,omitempty"` + TokenURLHasSuffix *string `json:"tokenURLHasSuffix,omitempty"` + TokenURLEqualFold *string `json:"tokenURLEqualFold,omitempty"` + TokenURLContainsFold *string `json:"tokenURLContainsFold,omitempty"` + // auth_style field predicates + AuthStyle *string `json:"authStyle,omitempty"` + AuthStyleNeq *string `json:"authStyleNEQ,omitempty"` + AuthStyleIn []string `json:"authStyleIn,omitempty"` + AuthStyleNotIn []string `json:"authStyleNotIn,omitempty"` + AuthStyleGt *string `json:"authStyleGT,omitempty"` + AuthStyleGte *string `json:"authStyleGTE,omitempty"` + AuthStyleLt *string `json:"authStyleLT,omitempty"` + AuthStyleLte *string `json:"authStyleLTE,omitempty"` + // info_url field predicates + InfoURL *string `json:"infoURL,omitempty"` + InfoURLNeq *string `json:"infoURLNEQ,omitempty"` + InfoURLIn []string `json:"infoURLIn,omitempty"` + InfoURLNotIn []string `json:"infoURLNotIn,omitempty"` + InfoURLGt *string `json:"infoURLGT,omitempty"` + InfoURLGte *string `json:"infoURLGTE,omitempty"` + InfoURLLt *string `json:"infoURLLT,omitempty"` + InfoURLLte *string `json:"infoURLLTE,omitempty"` + InfoURLContains *string `json:"infoURLContains,omitempty"` + InfoURLHasPrefix *string `json:"infoURLHasPrefix,omitempty"` + InfoURLHasSuffix *string `json:"infoURLHasSuffix,omitempty"` + InfoURLEqualFold *string `json:"infoURLEqualFold,omitempty"` + InfoURLContainsFold *string `json:"infoURLContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` +} + +type OhAuthTooToken struct { + ID string `json:"id"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + ClientID string `json:"clientID"` + Scopes []string `json:"scopes,omitempty"` + Nonce string `json:"nonce"` + ClaimsUserID string `json:"claimsUserID"` + ClaimsUsername string `json:"claimsUsername"` + ClaimsEmail string `json:"claimsEmail"` + ClaimsEmailVerified bool `json:"claimsEmailVerified"` + ClaimsGroups []string `json:"claimsGroups,omitempty"` + ClaimsPreferredUsername string `json:"claimsPreferredUsername"` + ConnectorID string `json:"connectorID"` + ConnectorData []string `json:"connectorData,omitempty"` + LastUsed time.Time `json:"lastUsed"` + Integration []*Integration `json:"integration,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (OhAuthTooToken) IsNode() {} + +// Return response for createBulkOhAuthTooToken mutation +type OhAuthTooTokenBulkCreatePayload struct { + // Created ohAuthTooTokens + OhAuthTooTokens []*OhAuthTooToken `json:"ohAuthTooTokens,omitempty"` +} + +// A connection to a list of items. +type OhAuthTooTokenConnection struct { + // A list of edges. + Edges []*OhAuthTooTokenEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOhAuthTooToken mutation +type OhAuthTooTokenCreatePayload struct { + // Created ohAuthTooToken + OhAuthTooToken *OhAuthTooToken `json:"ohAuthTooToken"` +} + +// Return response for deleteOhAuthTooToken mutation +type OhAuthTooTokenDeletePayload struct { + // Deleted ohAuthTooToken ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OhAuthTooTokenEdge struct { + // The item at the end of the edge. + Node *OhAuthTooToken `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateOhAuthTooToken mutation +type OhAuthTooTokenUpdatePayload struct { + // Updated ohAuthTooToken + OhAuthTooToken *OhAuthTooToken `json:"ohAuthTooToken"` +} + +// OhAuthTooTokenWhereInput is used for filtering OhAuthTooToken objects. +// Input was generated by ent. +type OhAuthTooTokenWhereInput struct { + Not *OhAuthTooTokenWhereInput `json:"not,omitempty"` + And []*OhAuthTooTokenWhereInput `json:"and,omitempty"` + Or []*OhAuthTooTokenWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // client_id field predicates + ClientID *string `json:"clientID,omitempty"` + ClientIDNeq *string `json:"clientIDNEQ,omitempty"` + ClientIDIn []string `json:"clientIDIn,omitempty"` + ClientIDNotIn []string `json:"clientIDNotIn,omitempty"` + ClientIDGt *string `json:"clientIDGT,omitempty"` + ClientIDGte *string `json:"clientIDGTE,omitempty"` + ClientIDLt *string `json:"clientIDLT,omitempty"` + ClientIDLte *string `json:"clientIDLTE,omitempty"` + ClientIDContains *string `json:"clientIDContains,omitempty"` + ClientIDHasPrefix *string `json:"clientIDHasPrefix,omitempty"` + ClientIDHasSuffix *string `json:"clientIDHasSuffix,omitempty"` + ClientIDEqualFold *string `json:"clientIDEqualFold,omitempty"` + ClientIDContainsFold *string `json:"clientIDContainsFold,omitempty"` + // nonce field predicates + Nonce *string `json:"nonce,omitempty"` + NonceNeq *string `json:"nonceNEQ,omitempty"` + NonceIn []string `json:"nonceIn,omitempty"` + NonceNotIn []string `json:"nonceNotIn,omitempty"` + NonceGt *string `json:"nonceGT,omitempty"` + NonceGte *string `json:"nonceGTE,omitempty"` + NonceLt *string `json:"nonceLT,omitempty"` + NonceLte *string `json:"nonceLTE,omitempty"` + NonceContains *string `json:"nonceContains,omitempty"` + NonceHasPrefix *string `json:"nonceHasPrefix,omitempty"` + NonceHasSuffix *string `json:"nonceHasSuffix,omitempty"` + NonceEqualFold *string `json:"nonceEqualFold,omitempty"` + NonceContainsFold *string `json:"nonceContainsFold,omitempty"` + // claims_user_id field predicates + ClaimsUserID *string `json:"claimsUserID,omitempty"` + ClaimsUserIDNeq *string `json:"claimsUserIDNEQ,omitempty"` + ClaimsUserIDIn []string `json:"claimsUserIDIn,omitempty"` + ClaimsUserIDNotIn []string `json:"claimsUserIDNotIn,omitempty"` + ClaimsUserIDGt *string `json:"claimsUserIDGT,omitempty"` + ClaimsUserIDGte *string `json:"claimsUserIDGTE,omitempty"` + ClaimsUserIDLt *string `json:"claimsUserIDLT,omitempty"` + ClaimsUserIDLte *string `json:"claimsUserIDLTE,omitempty"` + ClaimsUserIDContains *string `json:"claimsUserIDContains,omitempty"` + ClaimsUserIDHasPrefix *string `json:"claimsUserIDHasPrefix,omitempty"` + ClaimsUserIDHasSuffix *string `json:"claimsUserIDHasSuffix,omitempty"` + ClaimsUserIDEqualFold *string `json:"claimsUserIDEqualFold,omitempty"` + ClaimsUserIDContainsFold *string `json:"claimsUserIDContainsFold,omitempty"` + // claims_username field predicates + ClaimsUsername *string `json:"claimsUsername,omitempty"` + ClaimsUsernameNeq *string `json:"claimsUsernameNEQ,omitempty"` + ClaimsUsernameIn []string `json:"claimsUsernameIn,omitempty"` + ClaimsUsernameNotIn []string `json:"claimsUsernameNotIn,omitempty"` + ClaimsUsernameGt *string `json:"claimsUsernameGT,omitempty"` + ClaimsUsernameGte *string `json:"claimsUsernameGTE,omitempty"` + ClaimsUsernameLt *string `json:"claimsUsernameLT,omitempty"` + ClaimsUsernameLte *string `json:"claimsUsernameLTE,omitempty"` + ClaimsUsernameContains *string `json:"claimsUsernameContains,omitempty"` + ClaimsUsernameHasPrefix *string `json:"claimsUsernameHasPrefix,omitempty"` + ClaimsUsernameHasSuffix *string `json:"claimsUsernameHasSuffix,omitempty"` + ClaimsUsernameEqualFold *string `json:"claimsUsernameEqualFold,omitempty"` + ClaimsUsernameContainsFold *string `json:"claimsUsernameContainsFold,omitempty"` + // claims_email field predicates + ClaimsEmail *string `json:"claimsEmail,omitempty"` + ClaimsEmailNeq *string `json:"claimsEmailNEQ,omitempty"` + ClaimsEmailIn []string `json:"claimsEmailIn,omitempty"` + ClaimsEmailNotIn []string `json:"claimsEmailNotIn,omitempty"` + ClaimsEmailGt *string `json:"claimsEmailGT,omitempty"` + ClaimsEmailGte *string `json:"claimsEmailGTE,omitempty"` + ClaimsEmailLt *string `json:"claimsEmailLT,omitempty"` + ClaimsEmailLte *string `json:"claimsEmailLTE,omitempty"` + ClaimsEmailContains *string `json:"claimsEmailContains,omitempty"` + ClaimsEmailHasPrefix *string `json:"claimsEmailHasPrefix,omitempty"` + ClaimsEmailHasSuffix *string `json:"claimsEmailHasSuffix,omitempty"` + ClaimsEmailEqualFold *string `json:"claimsEmailEqualFold,omitempty"` + ClaimsEmailContainsFold *string `json:"claimsEmailContainsFold,omitempty"` + // claims_email_verified field predicates + ClaimsEmailVerified *bool `json:"claimsEmailVerified,omitempty"` + ClaimsEmailVerifiedNeq *bool `json:"claimsEmailVerifiedNEQ,omitempty"` + // claims_preferred_username field predicates + ClaimsPreferredUsername *string `json:"claimsPreferredUsername,omitempty"` + ClaimsPreferredUsernameNeq *string `json:"claimsPreferredUsernameNEQ,omitempty"` + ClaimsPreferredUsernameIn []string `json:"claimsPreferredUsernameIn,omitempty"` + ClaimsPreferredUsernameNotIn []string `json:"claimsPreferredUsernameNotIn,omitempty"` + ClaimsPreferredUsernameGt *string `json:"claimsPreferredUsernameGT,omitempty"` + ClaimsPreferredUsernameGte *string `json:"claimsPreferredUsernameGTE,omitempty"` + ClaimsPreferredUsernameLt *string `json:"claimsPreferredUsernameLT,omitempty"` + ClaimsPreferredUsernameLte *string `json:"claimsPreferredUsernameLTE,omitempty"` + ClaimsPreferredUsernameContains *string `json:"claimsPreferredUsernameContains,omitempty"` + ClaimsPreferredUsernameHasPrefix *string `json:"claimsPreferredUsernameHasPrefix,omitempty"` + ClaimsPreferredUsernameHasSuffix *string `json:"claimsPreferredUsernameHasSuffix,omitempty"` + ClaimsPreferredUsernameEqualFold *string `json:"claimsPreferredUsernameEqualFold,omitempty"` + ClaimsPreferredUsernameContainsFold *string `json:"claimsPreferredUsernameContainsFold,omitempty"` + // connector_id field predicates + ConnectorID *string `json:"connectorID,omitempty"` + ConnectorIDNeq *string `json:"connectorIDNEQ,omitempty"` + ConnectorIDIn []string `json:"connectorIDIn,omitempty"` + ConnectorIDNotIn []string `json:"connectorIDNotIn,omitempty"` + ConnectorIDGt *string `json:"connectorIDGT,omitempty"` + ConnectorIDGte *string `json:"connectorIDGTE,omitempty"` + ConnectorIDLt *string `json:"connectorIDLT,omitempty"` + ConnectorIDLte *string `json:"connectorIDLTE,omitempty"` + ConnectorIDContains *string `json:"connectorIDContains,omitempty"` + ConnectorIDHasPrefix *string `json:"connectorIDHasPrefix,omitempty"` + ConnectorIDHasSuffix *string `json:"connectorIDHasSuffix,omitempty"` + ConnectorIDEqualFold *string `json:"connectorIDEqualFold,omitempty"` + ConnectorIDContainsFold *string `json:"connectorIDContainsFold,omitempty"` + // last_used field predicates + LastUsed *time.Time `json:"lastUsed,omitempty"` + LastUsedNeq *time.Time `json:"lastUsedNEQ,omitempty"` + LastUsedIn []*time.Time `json:"lastUsedIn,omitempty"` + LastUsedNotIn []*time.Time `json:"lastUsedNotIn,omitempty"` + LastUsedGt *time.Time `json:"lastUsedGT,omitempty"` + LastUsedGte *time.Time `json:"lastUsedGTE,omitempty"` + LastUsedLt *time.Time `json:"lastUsedLT,omitempty"` + LastUsedLte *time.Time `json:"lastUsedLTE,omitempty"` + // integration edge predicates + HasIntegration *bool `json:"hasIntegration,omitempty"` + HasIntegrationWith []*IntegrationWhereInput `json:"hasIntegrationWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type OrgMembership struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + OrganizationID string `json:"organizationID"` + UserID string `json:"userID"` + Organization *Organization `json:"organization"` + User *User `json:"user"` + Events []*Event `json:"events,omitempty"` +} + +func (OrgMembership) IsNode() {} + +// Return response for createBulkOrgMembership mutation +type OrgMembershipBulkCreatePayload struct { + // Created orgMemberships + OrgMemberships []*OrgMembership `json:"orgMemberships,omitempty"` +} + +// A connection to a list of items. +type OrgMembershipConnection struct { + // A list of edges. + Edges []*OrgMembershipEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOrgMembership mutation +type OrgMembershipCreatePayload struct { + // Created orgMembership + OrgMembership *OrgMembership `json:"orgMembership"` +} + +// Return response for deleteOrgMembership mutation +type OrgMembershipDeletePayload struct { + // Deleted orgMembership ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OrgMembershipEdge struct { + // The item at the end of the edge. + Node *OrgMembership `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OrgMembershipHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + Role enums.Role `json:"role"` + OrganizationID string `json:"organizationID"` + UserID string `json:"userID"` +} + +func (OrgMembershipHistory) IsNode() {} + +// A connection to a list of items. +type OrgMembershipHistoryConnection struct { + // A list of edges. + Edges []*OrgMembershipHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OrgMembershipHistoryEdge struct { + // The item at the end of the edge. + Node *OrgMembershipHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// OrgMembershipHistoryWhereInput is used for filtering OrgMembershipHistory objects. +// Input was generated by ent. +type OrgMembershipHistoryWhereInput struct { + Not *OrgMembershipHistoryWhereInput `json:"not,omitempty"` + And []*OrgMembershipHistoryWhereInput `json:"and,omitempty"` + Or []*OrgMembershipHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` +} + +// Return response for updateOrgMembership mutation +type OrgMembershipUpdatePayload struct { + // Updated orgMembership + OrgMembership *OrgMembership `json:"orgMembership"` +} + +// OrgMembershipWhereInput is used for filtering OrgMembership objects. +// Input was generated by ent. +type OrgMembershipWhereInput struct { + Not *OrgMembershipWhereInput `json:"not,omitempty"` + And []*OrgMembershipWhereInput `json:"and,omitempty"` + Or []*OrgMembershipWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` + UserID *string `json:"userID,omitempty"` +} + +type Organization struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the name of the organization + Name string `json:"name"` + // The organization's displayed 'friendly' name + DisplayName string `json:"displayName"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + // orgs directly associated with a user + PersonalOrg *bool `json:"personalOrg,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb bool `json:"dedicatedDb"` + Parent *Organization `json:"parent,omitempty"` + Children *OrganizationConnection `json:"children"` + Groups []*Group `json:"groups,omitempty"` + Templates []*Template `json:"templates,omitempty"` + Integrations []*Integration `json:"integrations,omitempty"` + Setting *OrganizationSetting `json:"setting,omitempty"` + Documentdata []*DocumentData `json:"documentdata,omitempty"` + Entitlements []*Entitlement `json:"entitlements,omitempty"` + OrganizationEntitlement []*Entitlement `json:"organizationEntitlement,omitempty"` + PersonalAccessTokens []*PersonalAccessToken `json:"personalAccessTokens,omitempty"` + APITokens []*APIToken `json:"apiTokens,omitempty"` + Oauthprovider []*OauthProvider `json:"oauthprovider,omitempty"` + Users []*User `json:"users,omitempty"` + Invites []*Invite `json:"invites,omitempty"` + Subscribers []*Subscriber `json:"subscribers,omitempty"` + Webhooks []*Webhook `json:"webhooks,omitempty"` + Events []*Event `json:"events,omitempty"` + Secrets []*Hush `json:"secrets,omitempty"` + Features []*Feature `json:"features,omitempty"` + Files []*File `json:"files,omitempty"` + Entitlementplans []*EntitlementPlan `json:"entitlementplans,omitempty"` + Entitlementplanfeatures []*EntitlementPlanFeature `json:"entitlementplanfeatures,omitempty"` + Entities []*Entity `json:"entities,omitempty"` + Entitytypes []*EntityType `json:"entitytypes,omitempty"` + Contacts []*Contact `json:"contacts,omitempty"` + Notes []*Note `json:"notes,omitempty"` + Members []*OrgMembership `json:"members,omitempty"` +} + +func (Organization) IsNode() {} + +// Return response for createBulkOrganization mutation +type OrganizationBulkCreatePayload struct { + // Created organizations + Organizations []*Organization `json:"organizations,omitempty"` +} + +// A connection to a list of items. +type OrganizationConnection struct { + // A list of edges. + Edges []*OrganizationEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOrganization mutation +type OrganizationCreatePayload struct { + // Created organization + Organization *Organization `json:"organization"` +} + +// Return response for deleteOrganization mutation +type OrganizationDeletePayload struct { + // Deleted organization ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OrganizationEdge struct { + // The item at the end of the edge. + Node *Organization `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OrganizationHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // the name of the organization + Name string `json:"name"` + // The organization's displayed 'friendly' name + DisplayName string `json:"displayName"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + // orgs directly associated with a user + PersonalOrg *bool `json:"personalOrg,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // Whether the organization has a dedicated database + DedicatedDb bool `json:"dedicatedDb"` +} + +func (OrganizationHistory) IsNode() {} + +// A connection to a list of items. +type OrganizationHistoryConnection struct { + // A list of edges. + Edges []*OrganizationHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OrganizationHistoryEdge struct { + // The item at the end of the edge. + Node *OrganizationHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for OrganizationHistory connections +type OrganizationHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order OrganizationHistories. + Field OrganizationHistoryOrderField `json:"field"` +} + +// OrganizationHistoryWhereInput is used for filtering OrganizationHistory objects. +// Input was generated by ent. +type OrganizationHistoryWhereInput struct { + Not *OrganizationHistoryWhereInput `json:"not,omitempty"` + And []*OrganizationHistoryWhereInput `json:"and,omitempty"` + Or []*OrganizationHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // parent_organization_id field predicates + ParentOrganizationID *string `json:"parentOrganizationID,omitempty"` + ParentOrganizationIDNeq *string `json:"parentOrganizationIDNEQ,omitempty"` + ParentOrganizationIDIn []string `json:"parentOrganizationIDIn,omitempty"` + ParentOrganizationIDNotIn []string `json:"parentOrganizationIDNotIn,omitempty"` + ParentOrganizationIDGt *string `json:"parentOrganizationIDGT,omitempty"` + ParentOrganizationIDGte *string `json:"parentOrganizationIDGTE,omitempty"` + ParentOrganizationIDLt *string `json:"parentOrganizationIDLT,omitempty"` + ParentOrganizationIDLte *string `json:"parentOrganizationIDLTE,omitempty"` + ParentOrganizationIDContains *string `json:"parentOrganizationIDContains,omitempty"` + ParentOrganizationIDHasPrefix *string `json:"parentOrganizationIDHasPrefix,omitempty"` + ParentOrganizationIDHasSuffix *string `json:"parentOrganizationIDHasSuffix,omitempty"` + ParentOrganizationIDIsNil *bool `json:"parentOrganizationIDIsNil,omitempty"` + ParentOrganizationIDNotNil *bool `json:"parentOrganizationIDNotNil,omitempty"` + ParentOrganizationIDEqualFold *string `json:"parentOrganizationIDEqualFold,omitempty"` + ParentOrganizationIDContainsFold *string `json:"parentOrganizationIDContainsFold,omitempty"` + // personal_org field predicates + PersonalOrg *bool `json:"personalOrg,omitempty"` + PersonalOrgNeq *bool `json:"personalOrgNEQ,omitempty"` + PersonalOrgIsNil *bool `json:"personalOrgIsNil,omitempty"` + PersonalOrgNotNil *bool `json:"personalOrgNotNil,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` +} + +// Ordering options for Organization connections +type OrganizationOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Organizations. + Field OrganizationOrderField `json:"field"` +} + +type OrganizationSearchResult struct { + Organizations []*Organization `json:"organizations,omitempty"` +} + +func (OrganizationSearchResult) IsGlobalSearchResult() {} + +type OrganizationSetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + // the ID of the organization the settings belong to + OrganizationID *string `json:"organizationID,omitempty"` + Organization *Organization `json:"organization,omitempty"` +} + +func (OrganizationSetting) IsNode() {} + +// Return response for createBulkOrganizationSetting mutation +type OrganizationSettingBulkCreatePayload struct { + // Created organizationSettings + OrganizationSettings []*OrganizationSetting `json:"organizationSettings,omitempty"` +} + +// A connection to a list of items. +type OrganizationSettingConnection struct { + // A list of edges. + Edges []*OrganizationSettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createOrganizationSetting mutation +type OrganizationSettingCreatePayload struct { + // Created organizationSetting + OrganizationSetting *OrganizationSetting `json:"organizationSetting"` +} + +// Return response for deleteOrganizationSetting mutation +type OrganizationSettingDeletePayload struct { + // Deleted organizationSetting ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type OrganizationSettingEdge struct { + // The item at the end of the edge. + Node *OrganizationSetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type OrganizationSettingHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + // the ID of the organization the settings belong to + OrganizationID *string `json:"organizationID,omitempty"` +} + +func (OrganizationSettingHistory) IsNode() {} + +// A connection to a list of items. +type OrganizationSettingHistoryConnection struct { + // A list of edges. + Edges []*OrganizationSettingHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type OrganizationSettingHistoryEdge struct { + // The item at the end of the edge. + Node *OrganizationSettingHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// OrganizationSettingHistoryWhereInput is used for filtering OrganizationSettingHistory objects. +// Input was generated by ent. +type OrganizationSettingHistoryWhereInput struct { + Not *OrganizationSettingHistoryWhereInput `json:"not,omitempty"` + And []*OrganizationSettingHistoryWhereInput `json:"and,omitempty"` + Or []*OrganizationSettingHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // billing_contact field predicates + BillingContact *string `json:"billingContact,omitempty"` + BillingContactNeq *string `json:"billingContactNEQ,omitempty"` + BillingContactIn []string `json:"billingContactIn,omitempty"` + BillingContactNotIn []string `json:"billingContactNotIn,omitempty"` + BillingContactGt *string `json:"billingContactGT,omitempty"` + BillingContactGte *string `json:"billingContactGTE,omitempty"` + BillingContactLt *string `json:"billingContactLT,omitempty"` + BillingContactLte *string `json:"billingContactLTE,omitempty"` + BillingContactContains *string `json:"billingContactContains,omitempty"` + BillingContactHasPrefix *string `json:"billingContactHasPrefix,omitempty"` + BillingContactHasSuffix *string `json:"billingContactHasSuffix,omitempty"` + BillingContactIsNil *bool `json:"billingContactIsNil,omitempty"` + BillingContactNotNil *bool `json:"billingContactNotNil,omitempty"` + BillingContactEqualFold *string `json:"billingContactEqualFold,omitempty"` + BillingContactContainsFold *string `json:"billingContactContainsFold,omitempty"` + // billing_email field predicates + BillingEmail *string `json:"billingEmail,omitempty"` + BillingEmailNeq *string `json:"billingEmailNEQ,omitempty"` + BillingEmailIn []string `json:"billingEmailIn,omitempty"` + BillingEmailNotIn []string `json:"billingEmailNotIn,omitempty"` + BillingEmailGt *string `json:"billingEmailGT,omitempty"` + BillingEmailGte *string `json:"billingEmailGTE,omitempty"` + BillingEmailLt *string `json:"billingEmailLT,omitempty"` + BillingEmailLte *string `json:"billingEmailLTE,omitempty"` + BillingEmailContains *string `json:"billingEmailContains,omitempty"` + BillingEmailHasPrefix *string `json:"billingEmailHasPrefix,omitempty"` + BillingEmailHasSuffix *string `json:"billingEmailHasSuffix,omitempty"` + BillingEmailIsNil *bool `json:"billingEmailIsNil,omitempty"` + BillingEmailNotNil *bool `json:"billingEmailNotNil,omitempty"` + BillingEmailEqualFold *string `json:"billingEmailEqualFold,omitempty"` + BillingEmailContainsFold *string `json:"billingEmailContainsFold,omitempty"` + // billing_phone field predicates + BillingPhone *string `json:"billingPhone,omitempty"` + BillingPhoneNeq *string `json:"billingPhoneNEQ,omitempty"` + BillingPhoneIn []string `json:"billingPhoneIn,omitempty"` + BillingPhoneNotIn []string `json:"billingPhoneNotIn,omitempty"` + BillingPhoneGt *string `json:"billingPhoneGT,omitempty"` + BillingPhoneGte *string `json:"billingPhoneGTE,omitempty"` + BillingPhoneLt *string `json:"billingPhoneLT,omitempty"` + BillingPhoneLte *string `json:"billingPhoneLTE,omitempty"` + BillingPhoneContains *string `json:"billingPhoneContains,omitempty"` + BillingPhoneHasPrefix *string `json:"billingPhoneHasPrefix,omitempty"` + BillingPhoneHasSuffix *string `json:"billingPhoneHasSuffix,omitempty"` + BillingPhoneIsNil *bool `json:"billingPhoneIsNil,omitempty"` + BillingPhoneNotNil *bool `json:"billingPhoneNotNil,omitempty"` + BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` + BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` + // billing_address field predicates + BillingAddress *string `json:"billingAddress,omitempty"` + BillingAddressNeq *string `json:"billingAddressNEQ,omitempty"` + BillingAddressIn []string `json:"billingAddressIn,omitempty"` + BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` + BillingAddressGt *string `json:"billingAddressGT,omitempty"` + BillingAddressGte *string `json:"billingAddressGTE,omitempty"` + BillingAddressLt *string `json:"billingAddressLT,omitempty"` + BillingAddressLte *string `json:"billingAddressLTE,omitempty"` + BillingAddressContains *string `json:"billingAddressContains,omitempty"` + BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` + BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` + BillingAddressIsNil *bool `json:"billingAddressIsNil,omitempty"` + BillingAddressNotNil *bool `json:"billingAddressNotNil,omitempty"` + BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` + BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` + // tax_identifier field predicates + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + TaxIdentifierNeq *string `json:"taxIdentifierNEQ,omitempty"` + TaxIdentifierIn []string `json:"taxIdentifierIn,omitempty"` + TaxIdentifierNotIn []string `json:"taxIdentifierNotIn,omitempty"` + TaxIdentifierGt *string `json:"taxIdentifierGT,omitempty"` + TaxIdentifierGte *string `json:"taxIdentifierGTE,omitempty"` + TaxIdentifierLt *string `json:"taxIdentifierLT,omitempty"` + TaxIdentifierLte *string `json:"taxIdentifierLTE,omitempty"` + TaxIdentifierContains *string `json:"taxIdentifierContains,omitempty"` + TaxIdentifierHasPrefix *string `json:"taxIdentifierHasPrefix,omitempty"` + TaxIdentifierHasSuffix *string `json:"taxIdentifierHasSuffix,omitempty"` + TaxIdentifierIsNil *bool `json:"taxIdentifierIsNil,omitempty"` + TaxIdentifierNotNil *bool `json:"taxIdentifierNotNil,omitempty"` + TaxIdentifierEqualFold *string `json:"taxIdentifierEqualFold,omitempty"` + TaxIdentifierContainsFold *string `json:"taxIdentifierContainsFold,omitempty"` + // geo_location field predicates + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + GeoLocationNeq *enums.Region `json:"geoLocationNEQ,omitempty"` + GeoLocationIn []enums.Region `json:"geoLocationIn,omitempty"` + GeoLocationNotIn []enums.Region `json:"geoLocationNotIn,omitempty"` + GeoLocationIsNil *bool `json:"geoLocationIsNil,omitempty"` + GeoLocationNotNil *bool `json:"geoLocationNotNil,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDIsNil *bool `json:"organizationIDIsNil,omitempty"` + OrganizationIDNotNil *bool `json:"organizationIDNotNil,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` +} + +// Return response for updateOrganizationSetting mutation +type OrganizationSettingUpdatePayload struct { + // Updated organizationSetting + OrganizationSetting *OrganizationSetting `json:"organizationSetting"` +} + +// OrganizationSettingWhereInput is used for filtering OrganizationSetting objects. +// Input was generated by ent. +type OrganizationSettingWhereInput struct { + Not *OrganizationSettingWhereInput `json:"not,omitempty"` + And []*OrganizationSettingWhereInput `json:"and,omitempty"` + Or []*OrganizationSettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // billing_contact field predicates + BillingContact *string `json:"billingContact,omitempty"` + BillingContactNeq *string `json:"billingContactNEQ,omitempty"` + BillingContactIn []string `json:"billingContactIn,omitempty"` + BillingContactNotIn []string `json:"billingContactNotIn,omitempty"` + BillingContactGt *string `json:"billingContactGT,omitempty"` + BillingContactGte *string `json:"billingContactGTE,omitempty"` + BillingContactLt *string `json:"billingContactLT,omitempty"` + BillingContactLte *string `json:"billingContactLTE,omitempty"` + BillingContactContains *string `json:"billingContactContains,omitempty"` + BillingContactHasPrefix *string `json:"billingContactHasPrefix,omitempty"` + BillingContactHasSuffix *string `json:"billingContactHasSuffix,omitempty"` + BillingContactIsNil *bool `json:"billingContactIsNil,omitempty"` + BillingContactNotNil *bool `json:"billingContactNotNil,omitempty"` + BillingContactEqualFold *string `json:"billingContactEqualFold,omitempty"` + BillingContactContainsFold *string `json:"billingContactContainsFold,omitempty"` + // billing_email field predicates + BillingEmail *string `json:"billingEmail,omitempty"` + BillingEmailNeq *string `json:"billingEmailNEQ,omitempty"` + BillingEmailIn []string `json:"billingEmailIn,omitempty"` + BillingEmailNotIn []string `json:"billingEmailNotIn,omitempty"` + BillingEmailGt *string `json:"billingEmailGT,omitempty"` + BillingEmailGte *string `json:"billingEmailGTE,omitempty"` + BillingEmailLt *string `json:"billingEmailLT,omitempty"` + BillingEmailLte *string `json:"billingEmailLTE,omitempty"` + BillingEmailContains *string `json:"billingEmailContains,omitempty"` + BillingEmailHasPrefix *string `json:"billingEmailHasPrefix,omitempty"` + BillingEmailHasSuffix *string `json:"billingEmailHasSuffix,omitempty"` + BillingEmailIsNil *bool `json:"billingEmailIsNil,omitempty"` + BillingEmailNotNil *bool `json:"billingEmailNotNil,omitempty"` + BillingEmailEqualFold *string `json:"billingEmailEqualFold,omitempty"` + BillingEmailContainsFold *string `json:"billingEmailContainsFold,omitempty"` + // billing_phone field predicates + BillingPhone *string `json:"billingPhone,omitempty"` + BillingPhoneNeq *string `json:"billingPhoneNEQ,omitempty"` + BillingPhoneIn []string `json:"billingPhoneIn,omitempty"` + BillingPhoneNotIn []string `json:"billingPhoneNotIn,omitempty"` + BillingPhoneGt *string `json:"billingPhoneGT,omitempty"` + BillingPhoneGte *string `json:"billingPhoneGTE,omitempty"` + BillingPhoneLt *string `json:"billingPhoneLT,omitempty"` + BillingPhoneLte *string `json:"billingPhoneLTE,omitempty"` + BillingPhoneContains *string `json:"billingPhoneContains,omitempty"` + BillingPhoneHasPrefix *string `json:"billingPhoneHasPrefix,omitempty"` + BillingPhoneHasSuffix *string `json:"billingPhoneHasSuffix,omitempty"` + BillingPhoneIsNil *bool `json:"billingPhoneIsNil,omitempty"` + BillingPhoneNotNil *bool `json:"billingPhoneNotNil,omitempty"` + BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` + BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` + // billing_address field predicates + BillingAddress *string `json:"billingAddress,omitempty"` + BillingAddressNeq *string `json:"billingAddressNEQ,omitempty"` + BillingAddressIn []string `json:"billingAddressIn,omitempty"` + BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` + BillingAddressGt *string `json:"billingAddressGT,omitempty"` + BillingAddressGte *string `json:"billingAddressGTE,omitempty"` + BillingAddressLt *string `json:"billingAddressLT,omitempty"` + BillingAddressLte *string `json:"billingAddressLTE,omitempty"` + BillingAddressContains *string `json:"billingAddressContains,omitempty"` + BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` + BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` + BillingAddressIsNil *bool `json:"billingAddressIsNil,omitempty"` + BillingAddressNotNil *bool `json:"billingAddressNotNil,omitempty"` + BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` + BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` + // tax_identifier field predicates + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + TaxIdentifierNeq *string `json:"taxIdentifierNEQ,omitempty"` + TaxIdentifierIn []string `json:"taxIdentifierIn,omitempty"` + TaxIdentifierNotIn []string `json:"taxIdentifierNotIn,omitempty"` + TaxIdentifierGt *string `json:"taxIdentifierGT,omitempty"` + TaxIdentifierGte *string `json:"taxIdentifierGTE,omitempty"` + TaxIdentifierLt *string `json:"taxIdentifierLT,omitempty"` + TaxIdentifierLte *string `json:"taxIdentifierLTE,omitempty"` + TaxIdentifierContains *string `json:"taxIdentifierContains,omitempty"` + TaxIdentifierHasPrefix *string `json:"taxIdentifierHasPrefix,omitempty"` + TaxIdentifierHasSuffix *string `json:"taxIdentifierHasSuffix,omitempty"` + TaxIdentifierIsNil *bool `json:"taxIdentifierIsNil,omitempty"` + TaxIdentifierNotNil *bool `json:"taxIdentifierNotNil,omitempty"` + TaxIdentifierEqualFold *string `json:"taxIdentifierEqualFold,omitempty"` + TaxIdentifierContainsFold *string `json:"taxIdentifierContainsFold,omitempty"` + // geo_location field predicates + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + GeoLocationNeq *enums.Region `json:"geoLocationNEQ,omitempty"` + GeoLocationIn []enums.Region `json:"geoLocationIn,omitempty"` + GeoLocationNotIn []enums.Region `json:"geoLocationNotIn,omitempty"` + GeoLocationIsNil *bool `json:"geoLocationIsNil,omitempty"` + GeoLocationNotNil *bool `json:"geoLocationNotNil,omitempty"` + // organization_id field predicates + OrganizationID *string `json:"organizationID,omitempty"` + OrganizationIDNeq *string `json:"organizationIDNEQ,omitempty"` + OrganizationIDIn []string `json:"organizationIDIn,omitempty"` + OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` + OrganizationIDGt *string `json:"organizationIDGT,omitempty"` + OrganizationIDGte *string `json:"organizationIDGTE,omitempty"` + OrganizationIDLt *string `json:"organizationIDLT,omitempty"` + OrganizationIDLte *string `json:"organizationIDLTE,omitempty"` + OrganizationIDContains *string `json:"organizationIDContains,omitempty"` + OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` + OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` + OrganizationIDIsNil *bool `json:"organizationIDIsNil,omitempty"` + OrganizationIDNotNil *bool `json:"organizationIDNotNil,omitempty"` + OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` + OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` + // organization edge predicates + HasOrganization *bool `json:"hasOrganization,omitempty"` + HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` +} + +// Return response for updateOrganization mutation +type OrganizationUpdatePayload struct { + // Updated organization + Organization *Organization `json:"organization"` +} + +// OrganizationWhereInput is used for filtering Organization objects. +// Input was generated by ent. +type OrganizationWhereInput struct { + Not *OrganizationWhereInput `json:"not,omitempty"` + And []*OrganizationWhereInput `json:"and,omitempty"` + Or []*OrganizationWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // parent_organization_id field predicates + ParentOrganizationID *string `json:"parentOrganizationID,omitempty"` + ParentOrganizationIDNeq *string `json:"parentOrganizationIDNEQ,omitempty"` + ParentOrganizationIDIn []string `json:"parentOrganizationIDIn,omitempty"` + ParentOrganizationIDNotIn []string `json:"parentOrganizationIDNotIn,omitempty"` + ParentOrganizationIDGt *string `json:"parentOrganizationIDGT,omitempty"` + ParentOrganizationIDGte *string `json:"parentOrganizationIDGTE,omitempty"` + ParentOrganizationIDLt *string `json:"parentOrganizationIDLT,omitempty"` + ParentOrganizationIDLte *string `json:"parentOrganizationIDLTE,omitempty"` + ParentOrganizationIDContains *string `json:"parentOrganizationIDContains,omitempty"` + ParentOrganizationIDHasPrefix *string `json:"parentOrganizationIDHasPrefix,omitempty"` + ParentOrganizationIDHasSuffix *string `json:"parentOrganizationIDHasSuffix,omitempty"` + ParentOrganizationIDIsNil *bool `json:"parentOrganizationIDIsNil,omitempty"` + ParentOrganizationIDNotNil *bool `json:"parentOrganizationIDNotNil,omitempty"` + ParentOrganizationIDEqualFold *string `json:"parentOrganizationIDEqualFold,omitempty"` + ParentOrganizationIDContainsFold *string `json:"parentOrganizationIDContainsFold,omitempty"` + // personal_org field predicates + PersonalOrg *bool `json:"personalOrg,omitempty"` + PersonalOrgNeq *bool `json:"personalOrgNEQ,omitempty"` + PersonalOrgIsNil *bool `json:"personalOrgIsNil,omitempty"` + PersonalOrgNotNil *bool `json:"personalOrgNotNil,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + // parent edge predicates + HasParent *bool `json:"hasParent,omitempty"` + HasParentWith []*OrganizationWhereInput `json:"hasParentWith,omitempty"` + // children edge predicates + HasChildren *bool `json:"hasChildren,omitempty"` + HasChildrenWith []*OrganizationWhereInput `json:"hasChildrenWith,omitempty"` + // groups edge predicates + HasGroups *bool `json:"hasGroups,omitempty"` + HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"` + // templates edge predicates + HasTemplates *bool `json:"hasTemplates,omitempty"` + HasTemplatesWith []*TemplateWhereInput `json:"hasTemplatesWith,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` + // setting edge predicates + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*OrganizationSettingWhereInput `json:"hasSettingWith,omitempty"` + // documentdata edge predicates + HasDocumentdata *bool `json:"hasDocumentdata,omitempty"` + HasDocumentdataWith []*DocumentDataWhereInput `json:"hasDocumentdataWith,omitempty"` + // entitlements edge predicates + HasEntitlements *bool `json:"hasEntitlements,omitempty"` + HasEntitlementsWith []*EntitlementWhereInput `json:"hasEntitlementsWith,omitempty"` + // organization_entitlement edge predicates + HasOrganizationEntitlement *bool `json:"hasOrganizationEntitlement,omitempty"` + HasOrganizationEntitlementWith []*EntitlementWhereInput `json:"hasOrganizationEntitlementWith,omitempty"` + // personal_access_tokens edge predicates + HasPersonalAccessTokens *bool `json:"hasPersonalAccessTokens,omitempty"` + HasPersonalAccessTokensWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokensWith,omitempty"` + // api_tokens edge predicates + HasAPITokens *bool `json:"hasAPITokens,omitempty"` + HasAPITokensWith []*APITokenWhereInput `json:"hasAPITokensWith,omitempty"` + // oauthprovider edge predicates + HasOauthprovider *bool `json:"hasOauthprovider,omitempty"` + HasOauthproviderWith []*OauthProviderWhereInput `json:"hasOauthproviderWith,omitempty"` + // users edge predicates + HasUsers *bool `json:"hasUsers,omitempty"` + HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"` + // invites edge predicates + HasInvites *bool `json:"hasInvites,omitempty"` + HasInvitesWith []*InviteWhereInput `json:"hasInvitesWith,omitempty"` + // subscribers edge predicates + HasSubscribers *bool `json:"hasSubscribers,omitempty"` + HasSubscribersWith []*SubscriberWhereInput `json:"hasSubscribersWith,omitempty"` + // webhooks edge predicates + HasWebhooks *bool `json:"hasWebhooks,omitempty"` + HasWebhooksWith []*WebhookWhereInput `json:"hasWebhooksWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // secrets edge predicates + HasSecrets *bool `json:"hasSecrets,omitempty"` + HasSecretsWith []*HushWhereInput `json:"hasSecretsWith,omitempty"` + // features edge predicates + HasFeatures *bool `json:"hasFeatures,omitempty"` + HasFeaturesWith []*FeatureWhereInput `json:"hasFeaturesWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // entitlementplans edge predicates + HasEntitlementplans *bool `json:"hasEntitlementplans,omitempty"` + HasEntitlementplansWith []*EntitlementPlanWhereInput `json:"hasEntitlementplansWith,omitempty"` + // entitlementplanfeatures edge predicates + HasEntitlementplanfeatures *bool `json:"hasEntitlementplanfeatures,omitempty"` + HasEntitlementplanfeaturesWith []*EntitlementPlanFeatureWhereInput `json:"hasEntitlementplanfeaturesWith,omitempty"` + // entities edge predicates + HasEntities *bool `json:"hasEntities,omitempty"` + HasEntitiesWith []*EntityWhereInput `json:"hasEntitiesWith,omitempty"` + // entitytypes edge predicates + HasEntitytypes *bool `json:"hasEntitytypes,omitempty"` + HasEntitytypesWith []*EntityTypeWhereInput `json:"hasEntitytypesWith,omitempty"` + // contacts edge predicates + HasContacts *bool `json:"hasContacts,omitempty"` + HasContactsWith []*ContactWhereInput `json:"hasContactsWith,omitempty"` + // notes edge predicates + HasNotes *bool `json:"hasNotes,omitempty"` + HasNotesWith []*NoteWhereInput `json:"hasNotesWith,omitempty"` + // members edge predicates + HasMembers *bool `json:"hasMembers,omitempty"` + HasMembersWith []*OrgMembershipWhereInput `json:"hasMembersWith,omitempty"` +} + +// Information about pagination in a connection. +// https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo +type PageInfo struct { + // When paginating forwards, are there more items? + HasNextPage bool `json:"hasNextPage"` + // When paginating backwards, are there more items? + HasPreviousPage bool `json:"hasPreviousPage"` + // When paginating backwards, the cursor to continue. + StartCursor *string `json:"startCursor,omitempty"` + // When paginating forwards, the cursor to continue. + EndCursor *string `json:"endCursor,omitempty"` +} + +type PersonalAccessToken struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // the name associated with the token + Name string `json:"name"` + Token string `json:"token"` + // when the token expires + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + Scopes []string `json:"scopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + Owner *User `json:"owner"` + // the organization(s) the token is associated with + Organizations []*Organization `json:"organizations,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (PersonalAccessToken) IsNode() {} + +// Return response for createBulkPersonalAccessToken mutation +type PersonalAccessTokenBulkCreatePayload struct { + // Created personalAccessTokens + PersonalAccessTokens []*PersonalAccessToken `json:"personalAccessTokens,omitempty"` +} + +// A connection to a list of items. +type PersonalAccessTokenConnection struct { + // A list of edges. + Edges []*PersonalAccessTokenEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createPersonalAccessToken mutation +type PersonalAccessTokenCreatePayload struct { + // Created personalAccessToken + PersonalAccessToken *PersonalAccessToken `json:"personalAccessToken"` +} + +// Return response for deletePersonalAccessToken mutation +type PersonalAccessTokenDeletePayload struct { + // Deleted personalAccessToken ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type PersonalAccessTokenEdge struct { + // The item at the end of the edge. + Node *PersonalAccessToken `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updatePersonalAccessToken mutation +type PersonalAccessTokenUpdatePayload struct { + // Updated personalAccessToken + PersonalAccessToken *PersonalAccessToken `json:"personalAccessToken"` +} + +// PersonalAccessTokenWhereInput is used for filtering PersonalAccessToken objects. +// Input was generated by ent. +type PersonalAccessTokenWhereInput struct { + Not *PersonalAccessTokenWhereInput `json:"not,omitempty"` + And []*PersonalAccessTokenWhereInput `json:"and,omitempty"` + Or []*PersonalAccessTokenWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // expires_at field predicates + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ExpiresAtNeq *time.Time `json:"expiresAtNEQ,omitempty"` + ExpiresAtIn []*time.Time `json:"expiresAtIn,omitempty"` + ExpiresAtNotIn []*time.Time `json:"expiresAtNotIn,omitempty"` + ExpiresAtGt *time.Time `json:"expiresAtGT,omitempty"` + ExpiresAtGte *time.Time `json:"expiresAtGTE,omitempty"` + ExpiresAtLt *time.Time `json:"expiresAtLT,omitempty"` + ExpiresAtLte *time.Time `json:"expiresAtLTE,omitempty"` + ExpiresAtIsNil *bool `json:"expiresAtIsNil,omitempty"` + ExpiresAtNotNil *bool `json:"expiresAtNotNil,omitempty"` + // last_used_at field predicates + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + LastUsedAtNeq *time.Time `json:"lastUsedAtNEQ,omitempty"` + LastUsedAtIn []*time.Time `json:"lastUsedAtIn,omitempty"` + LastUsedAtNotIn []*time.Time `json:"lastUsedAtNotIn,omitempty"` + LastUsedAtGt *time.Time `json:"lastUsedAtGT,omitempty"` + LastUsedAtGte *time.Time `json:"lastUsedAtGTE,omitempty"` + LastUsedAtLt *time.Time `json:"lastUsedAtLT,omitempty"` + LastUsedAtLte *time.Time `json:"lastUsedAtLTE,omitempty"` + LastUsedAtIsNil *bool `json:"lastUsedAtIsNil,omitempty"` + LastUsedAtNotNil *bool `json:"lastUsedAtNotNil,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*UserWhereInput `json:"hasOwnerWith,omitempty"` + // organizations edge predicates + HasOrganizations *bool `json:"hasOrganizations,omitempty"` + HasOrganizationsWith []*OrganizationWhereInput `json:"hasOrganizationsWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type Query struct { +} + +type Subscriber struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // email address of the subscriber + Email string `json:"email"` + // phone number of the subscriber + PhoneNumber *string `json:"phoneNumber,omitempty"` + // indicates if the email address has been verified + VerifiedEmail bool `json:"verifiedEmail"` + // indicates if the phone number has been verified + VerifiedPhone bool `json:"verifiedPhone"` + // indicates if the subscriber is active or not, active users will have at least one verified contact method + Active bool `json:"active"` + Owner *Organization `json:"owner,omitempty"` + Events []*Event `json:"events,omitempty"` +} + +func (Subscriber) IsNode() {} + +// Return response for createBulkSubscriber mutation +type SubscriberBulkCreatePayload struct { + // Created subscribers + Subscribers []*Subscriber `json:"subscribers,omitempty"` +} + +// A connection to a list of items. +type SubscriberConnection struct { + // A list of edges. + Edges []*SubscriberEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createSubscriber mutation +type SubscriberCreatePayload struct { + // Created subscriber + Subscriber *Subscriber `json:"subscriber"` +} + +// Return response for deleteSubscriber mutation +type SubscriberDeletePayload struct { + // Deleted subscriber email + Email string `json:"email"` +} + +// An edge in a connection. +type SubscriberEdge struct { + // The item at the end of the edge. + Node *Subscriber `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type SubscriberSearchResult struct { + Subscribers []*Subscriber `json:"subscribers,omitempty"` +} + +func (SubscriberSearchResult) IsGlobalSearchResult() {} + +// Return response for updateSubscriber mutation +type SubscriberUpdatePayload struct { + // Updated subscriber + Subscriber *Subscriber `json:"subscriber"` +} + +// SubscriberWhereInput is used for filtering Subscriber objects. +// Input was generated by ent. +type SubscriberWhereInput struct { + Not *SubscriberWhereInput `json:"not,omitempty"` + And []*SubscriberWhereInput `json:"and,omitempty"` + Or []*SubscriberWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // phone_number field predicates + PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumberNeq *string `json:"phoneNumberNEQ,omitempty"` + PhoneNumberIn []string `json:"phoneNumberIn,omitempty"` + PhoneNumberNotIn []string `json:"phoneNumberNotIn,omitempty"` + PhoneNumberGt *string `json:"phoneNumberGT,omitempty"` + PhoneNumberGte *string `json:"phoneNumberGTE,omitempty"` + PhoneNumberLt *string `json:"phoneNumberLT,omitempty"` + PhoneNumberLte *string `json:"phoneNumberLTE,omitempty"` + PhoneNumberContains *string `json:"phoneNumberContains,omitempty"` + PhoneNumberHasPrefix *string `json:"phoneNumberHasPrefix,omitempty"` + PhoneNumberHasSuffix *string `json:"phoneNumberHasSuffix,omitempty"` + PhoneNumberIsNil *bool `json:"phoneNumberIsNil,omitempty"` + PhoneNumberNotNil *bool `json:"phoneNumberNotNil,omitempty"` + PhoneNumberEqualFold *string `json:"phoneNumberEqualFold,omitempty"` + PhoneNumberContainsFold *string `json:"phoneNumberContainsFold,omitempty"` + // verified_email field predicates + VerifiedEmail *bool `json:"verifiedEmail,omitempty"` + VerifiedEmailNeq *bool `json:"verifiedEmailNEQ,omitempty"` + // verified_phone field predicates + VerifiedPhone *bool `json:"verifiedPhone,omitempty"` + VerifiedPhoneNeq *bool `json:"verifiedPhoneNEQ,omitempty"` + // active field predicates + Active *bool `json:"active,omitempty"` + ActiveNeq *bool `json:"activeNEQ,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` +} + +type TFASetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // TFA secret for the user + TfaSecret *string `json:"tfaSecret,omitempty"` + // specifies if the TFA device has been verified + Verified bool `json:"verified"` + // recovery codes for 2fa + RecoveryCodes []string `json:"recoveryCodes,omitempty"` + // specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + TotpAllowed *bool `json:"totpAllowed,omitempty"` + Owner *User `json:"owner,omitempty"` +} + +func (TFASetting) IsNode() {} + +// A connection to a list of items. +type TFASettingConnection struct { + // A list of edges. + Edges []*TFASettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createTFASetting mutation +type TFASettingCreatePayload struct { + // Created tfaSetting + TfaSetting *TFASetting `json:"tfaSetting"` +} + +// An edge in a connection. +type TFASettingEdge struct { + // The item at the end of the edge. + Node *TFASetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Return response for updateTFASetting mutation +type TFASettingUpdatePayload struct { + // Updated tfaSetting + TfaSetting *TFASetting `json:"tfaSetting"` +} + +// TFASettingWhereInput is used for filtering TFASetting objects. +// Input was generated by ent. +type TFASettingWhereInput struct { + Not *TFASettingWhereInput `json:"not,omitempty"` + And []*TFASettingWhereInput `json:"and,omitempty"` + Or []*TFASettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // tfa_secret field predicates + TfaSecret *string `json:"tfaSecret,omitempty"` + TfaSecretNeq *string `json:"tfaSecretNEQ,omitempty"` + TfaSecretIn []string `json:"tfaSecretIn,omitempty"` + TfaSecretNotIn []string `json:"tfaSecretNotIn,omitempty"` + TfaSecretGt *string `json:"tfaSecretGT,omitempty"` + TfaSecretGte *string `json:"tfaSecretGTE,omitempty"` + TfaSecretLt *string `json:"tfaSecretLT,omitempty"` + TfaSecretLte *string `json:"tfaSecretLTE,omitempty"` + TfaSecretContains *string `json:"tfaSecretContains,omitempty"` + TfaSecretHasPrefix *string `json:"tfaSecretHasPrefix,omitempty"` + TfaSecretHasSuffix *string `json:"tfaSecretHasSuffix,omitempty"` + TfaSecretIsNil *bool `json:"tfaSecretIsNil,omitempty"` + TfaSecretNotNil *bool `json:"tfaSecretNotNil,omitempty"` + TfaSecretEqualFold *string `json:"tfaSecretEqualFold,omitempty"` + TfaSecretContainsFold *string `json:"tfaSecretContainsFold,omitempty"` + // verified field predicates + Verified *bool `json:"verified,omitempty"` + VerifiedNeq *bool `json:"verifiedNEQ,omitempty"` + // totp_allowed field predicates + TotpAllowed *bool `json:"totpAllowed,omitempty"` + TotpAllowedNeq *bool `json:"totpAllowedNEQ,omitempty"` + TotpAllowedIsNil *bool `json:"totpAllowedIsNil,omitempty"` + TotpAllowedNotNil *bool `json:"totpAllowedNotNil,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*UserWhereInput `json:"hasOwnerWith,omitempty"` +} + +type Template struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the template + Name string `json:"name"` + // the type of the template, either a provided template or an implementation (document) + TemplateType enums.DocumentType `json:"templateType"` + // the description of the template + Description *string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Documents []*DocumentData `json:"documents,omitempty"` +} + +func (Template) IsNode() {} + +// Return response for createBulkTemplate mutation +type TemplateBulkCreatePayload struct { + // Created templates + Templates []*Template `json:"templates,omitempty"` +} + +// A connection to a list of items. +type TemplateConnection struct { + // A list of edges. + Edges []*TemplateEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createTemplate mutation +type TemplateCreatePayload struct { + // Created template + Template *Template `json:"template"` +} + +// Return response for deleteTemplate mutation +type TemplateDeletePayload struct { + // Deleted template ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type TemplateEdge struct { + // The item at the end of the edge. + Node *Template `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type TemplateHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the template + Name string `json:"name"` + // the type of the template, either a provided template or an implementation (document) + TemplateType enums.DocumentType `json:"templateType"` + // the description of the template + Description *string `json:"description,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` +} + +func (TemplateHistory) IsNode() {} + +// A connection to a list of items. +type TemplateHistoryConnection struct { + // A list of edges. + Edges []*TemplateHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type TemplateHistoryEdge struct { + // The item at the end of the edge. + Node *TemplateHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for TemplateHistory connections +type TemplateHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order TemplateHistories. + Field TemplateHistoryOrderField `json:"field"` +} + +// TemplateHistoryWhereInput is used for filtering TemplateHistory objects. +// Input was generated by ent. +type TemplateHistoryWhereInput struct { + Not *TemplateHistoryWhereInput `json:"not,omitempty"` + And []*TemplateHistoryWhereInput `json:"and,omitempty"` + Or []*TemplateHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // template_type field predicates + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + TemplateTypeNeq *enums.DocumentType `json:"templateTypeNEQ,omitempty"` + TemplateTypeIn []enums.DocumentType `json:"templateTypeIn,omitempty"` + TemplateTypeNotIn []enums.DocumentType `json:"templateTypeNotIn,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` +} + +// Ordering options for Template connections +type TemplateOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Templates. + Field TemplateOrderField `json:"field"` +} + +// Return response for updateTemplate mutation +type TemplateUpdatePayload struct { + // Updated template + Template *Template `json:"template"` +} + +// TemplateWhereInput is used for filtering Template objects. +// Input was generated by ent. +type TemplateWhereInput struct { + Not *TemplateWhereInput `json:"not,omitempty"` + And []*TemplateWhereInput `json:"and,omitempty"` + Or []*TemplateWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // template_type field predicates + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + TemplateTypeNeq *enums.DocumentType `json:"templateTypeNEQ,omitempty"` + TemplateTypeIn []enums.DocumentType `json:"templateTypeIn,omitempty"` + TemplateTypeNotIn []enums.DocumentType `json:"templateTypeNotIn,omitempty"` + // description field predicates + Description *string `json:"description,omitempty"` + DescriptionNeq *string `json:"descriptionNEQ,omitempty"` + DescriptionIn []string `json:"descriptionIn,omitempty"` + DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` + DescriptionGt *string `json:"descriptionGT,omitempty"` + DescriptionGte *string `json:"descriptionGTE,omitempty"` + DescriptionLt *string `json:"descriptionLT,omitempty"` + DescriptionLte *string `json:"descriptionLTE,omitempty"` + DescriptionContains *string `json:"descriptionContains,omitempty"` + DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` + DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` + DescriptionIsNil *bool `json:"descriptionIsNil,omitempty"` + DescriptionNotNil *bool `json:"descriptionNotNil,omitempty"` + DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` + DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // documents edge predicates + HasDocuments *bool `json:"hasDocuments,omitempty"` + HasDocumentsWith []*DocumentDataWhereInput `json:"hasDocumentsWith,omitempty"` +} + +// UpdateAPITokenInput is used for update APIToken object. +// Input was generated by ent. +type UpdateAPITokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name associated with the token + Name *string `json:"name,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + Scopes []string `json:"scopes,omitempty"` + AppendScopes []string `json:"appendScopes,omitempty"` + ClearScopes *bool `json:"clearScopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + ClearLastUsedAt *bool `json:"clearLastUsedAt,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` +} + +// UpdateContactInput is used for update Contact object. +// Input was generated by ent. +type UpdateContactInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the full name of the contact + FullName *string `json:"fullName,omitempty"` + // the title of the contact + Title *string `json:"title,omitempty"` + ClearTitle *bool `json:"clearTitle,omitempty"` + // the company of the contact + Company *string `json:"company,omitempty"` + ClearCompany *bool `json:"clearCompany,omitempty"` + // the email of the contact + Email *string `json:"email,omitempty"` + ClearEmail *bool `json:"clearEmail,omitempty"` + // the phone number of the contact + PhoneNumber *string `json:"phoneNumber,omitempty"` + ClearPhoneNumber *bool `json:"clearPhoneNumber,omitempty"` + // the address of the contact + Address *string `json:"address,omitempty"` + ClearAddress *bool `json:"clearAddress,omitempty"` + // status of the contact + Status *enums.UserStatus `json:"status,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntities *bool `json:"clearEntities,omitempty"` +} + +// UpdateDocumentDataInput is used for update DocumentData object. +// Input was generated by ent. +type UpdateDocumentDataInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the json data of the document + Data json.RawMessage `json:"data,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + TemplateID *string `json:"templateID,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntity *bool `json:"clearEntity,omitempty"` +} + +// UpdateEntitlementInput is used for update Entitlement object. +// Input was generated by ent. +type UpdateEntitlementInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalCustomerID *string `json:"externalCustomerID,omitempty"` + ClearExternalCustomerID *bool `json:"clearExternalCustomerID,omitempty"` + // used to store references to external systems, e.g. Stripe + ExternalSubscriptionID *string `json:"externalSubscriptionID,omitempty"` + ClearExternalSubscriptionID *bool `json:"clearExternalSubscriptionID,omitempty"` + // the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + ExpiresAt *time.Time `json:"expiresAt,omitempty"` + ClearExpiresAt *bool `json:"clearExpiresAt,omitempty"` + // whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + Cancelled *bool `json:"cancelled,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateEntitlementPlanFeatureInput is used for update EntitlementPlanFeature object. +// Input was generated by ent. +type UpdateEntitlementPlanFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // metadata for the entitlement plan feature such as usage limits + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateEntitlementPlanInput is used for update EntitlementPlan object. +// Input was generated by ent. +type UpdateEntitlementPlanInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the displayed 'friendly' name of the plan + DisplayName *string `json:"displayName,omitempty"` + ClearDisplayName *bool `json:"clearDisplayName,omitempty"` + // a description of the plan + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // metadata for the plan + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEntitlementIDs []string `json:"addEntitlementIDs,omitempty"` + RemoveEntitlementIDs []string `json:"removeEntitlementIDs,omitempty"` + ClearEntitlements *bool `json:"clearEntitlements,omitempty"` + AddBaseFeatureIDs []string `json:"addBaseFeatureIDs,omitempty"` + RemoveBaseFeatureIDs []string `json:"removeBaseFeatureIDs,omitempty"` + ClearBaseFeatures *bool `json:"clearBaseFeatures,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateEntityInput is used for update Entity object. +// Input was generated by ent. +type UpdateEntityInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + ClearName *bool `json:"clearName,omitempty"` + // The entity's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + ClearDisplayName *bool `json:"clearDisplayName,omitempty"` + // An optional description of the entity + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // domains associated with the entity + Domains []string `json:"domains,omitempty"` + AppendDomains []string `json:"appendDomains,omitempty"` + ClearDomains *bool `json:"clearDomains,omitempty"` + // status of the entity + Status *string `json:"status,omitempty"` + ClearStatus *bool `json:"clearStatus,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddContactIDs []string `json:"addContactIDs,omitempty"` + RemoveContactIDs []string `json:"removeContactIDs,omitempty"` + ClearContacts *bool `json:"clearContacts,omitempty"` + AddDocumentIDs []string `json:"addDocumentIDs,omitempty"` + RemoveDocumentIDs []string `json:"removeDocumentIDs,omitempty"` + ClearDocuments *bool `json:"clearDocuments,omitempty"` + AddNoteIDs []string `json:"addNoteIDs,omitempty"` + RemoveNoteIDs []string `json:"removeNoteIDs,omitempty"` + ClearNotes *bool `json:"clearNotes,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + EntityTypeID *string `json:"entityTypeID,omitempty"` + ClearEntityType *bool `json:"clearEntityType,omitempty"` + Note *CreateNoteInput `json:"note,omitempty"` +} + +// UpdateEntityTypeInput is used for update EntityType object. +// Input was generated by ent. +type UpdateEntityTypeInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the entity + Name *string `json:"name,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntities *bool `json:"clearEntities,omitempty"` +} + +// UpdateEventInput is used for update Event object. +// Input was generated by ent. +type UpdateEventInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + EventID *string `json:"eventID,omitempty"` + ClearEventID *bool `json:"clearEventID,omitempty"` + CorrelationID *string `json:"correlationID,omitempty"` + ClearCorrelationID *bool `json:"clearCorrelationID,omitempty"` + EventType *string `json:"eventType,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + AddUserIDs []string `json:"addUserIDs,omitempty"` + RemoveUserIDs []string `json:"removeUserIDs,omitempty"` + ClearUser *bool `json:"clearUser,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroup *bool `json:"clearGroup,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegration *bool `json:"clearIntegration,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` + AddInviteIDs []string `json:"addInviteIDs,omitempty"` + RemoveInviteIDs []string `json:"removeInviteIDs,omitempty"` + ClearInvite *bool `json:"clearInvite,omitempty"` + AddFeatureIDs []string `json:"addFeatureIDs,omitempty"` + RemoveFeatureIDs []string `json:"removeFeatureIDs,omitempty"` + ClearFeature *bool `json:"clearFeature,omitempty"` + AddEntitlementplanIDs []string `json:"addEntitlementplanIDs,omitempty"` + RemoveEntitlementplanIDs []string `json:"removeEntitlementplanIDs,omitempty"` + ClearEntitlementplan *bool `json:"clearEntitlementplan,omitempty"` + AddPersonalAccessTokenIDs []string `json:"addPersonalAccessTokenIDs,omitempty"` + RemovePersonalAccessTokenIDs []string `json:"removePersonalAccessTokenIDs,omitempty"` + ClearPersonalAccessToken *bool `json:"clearPersonalAccessToken,omitempty"` + AddOauth2tokenIDs []string `json:"addOauth2tokenIDs,omitempty"` + RemoveOauth2tokenIDs []string `json:"removeOauth2tokenIDs,omitempty"` + ClearOauth2token *bool `json:"clearOauth2token,omitempty"` + AddHushIDs []string `json:"addHushIDs,omitempty"` + RemoveHushIDs []string `json:"removeHushIDs,omitempty"` + ClearHush *bool `json:"clearHush,omitempty"` + AddEntitlementIDs []string `json:"addEntitlementIDs,omitempty"` + RemoveEntitlementIDs []string `json:"removeEntitlementIDs,omitempty"` + ClearEntitlement *bool `json:"clearEntitlement,omitempty"` + AddWebhookIDs []string `json:"addWebhookIDs,omitempty"` + RemoveWebhookIDs []string `json:"removeWebhookIDs,omitempty"` + ClearWebhook *bool `json:"clearWebhook,omitempty"` + AddSubscriberIDs []string `json:"addSubscriberIDs,omitempty"` + RemoveSubscriberIDs []string `json:"removeSubscriberIDs,omitempty"` + ClearSubscriber *bool `json:"clearSubscriber,omitempty"` +} + +// UpdateFeatureInput is used for update Feature object. +// Input was generated by ent. +type UpdateFeatureInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the displayed 'friendly' name of the feature + DisplayName *string `json:"displayName,omitempty"` + ClearDisplayName *bool `json:"clearDisplayName,omitempty"` + // enabled features are available for use + Enabled *bool `json:"enabled,omitempty"` + // a description of the feature + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // metadata for the feature + Metadata map[string]interface{} `json:"metadata,omitempty"` + ClearMetadata *bool `json:"clearMetadata,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddPlanIDs []string `json:"addPlanIDs,omitempty"` + RemovePlanIDs []string `json:"removePlanIDs,omitempty"` + ClearPlans *bool `json:"clearPlans,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateFileInput is used for update File object. +// Input was generated by ent. +type UpdateFileInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + FileName *string `json:"fileName,omitempty"` + FileExtension *string `json:"fileExtension,omitempty"` + FileSize *int64 `json:"fileSize,omitempty"` + ClearFileSize *bool `json:"clearFileSize,omitempty"` + ContentType *string `json:"contentType,omitempty"` + StoreKey *string `json:"storeKey,omitempty"` + Category *string `json:"category,omitempty"` + ClearCategory *bool `json:"clearCategory,omitempty"` + Annotation *string `json:"annotation,omitempty"` + ClearAnnotation *bool `json:"clearAnnotation,omitempty"` + UserID *string `json:"userID,omitempty"` + ClearUser *bool `json:"clearUser,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntity *bool `json:"clearEntity,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroup *bool `json:"clearGroup,omitempty"` +} + +// UpdateGroupInput is used for update Group object. +// Input was generated by ent. +type UpdateGroupInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the group - must be unique within the organization + Name *string `json:"name,omitempty"` + // the groups description + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the URL to an auto generated gravatar image for the group + GravatarLogoURL *string `json:"gravatarLogoURL,omitempty"` + ClearGravatarLogoURL *bool `json:"clearGravatarLogoURL,omitempty"` + // the URL to an image uploaded by the customer for the groups avatar image + LogoURL *string `json:"logoURL,omitempty"` + ClearLogoURL *bool `json:"clearLogoURL,omitempty"` + // The group's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + SettingID *string `json:"settingID,omitempty"` + AddUserIDs []string `json:"addUserIDs,omitempty"` + RemoveUserIDs []string `json:"removeUserIDs,omitempty"` + ClearUsers *bool `json:"clearUsers,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + AddGroupMembers []*CreateGroupMembershipInput `json:"addGroupMembers,omitempty"` + UpdateGroupSettings *UpdateGroupSettingInput `json:"updateGroupSettings,omitempty"` +} + +// UpdateGroupMembershipInput is used for update GroupMembership object. +// Input was generated by ent. +type UpdateGroupMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateGroupSettingInput is used for update GroupSetting object. +// Input was generated by ent. +type UpdateGroupSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + Visibility *enums.Visibility `json:"visibility,omitempty"` + // the policy governing ability to freely join a group, whether it requires an invitation, application, or either + JoinPolicy *enums.JoinPolicy `json:"joinPolicy,omitempty"` + // whether to sync group members to slack groups + SyncToSlack *bool `json:"syncToSlack,omitempty"` + ClearSyncToSlack *bool `json:"clearSyncToSlack,omitempty"` + // whether to sync group members to github groups + SyncToGithub *bool `json:"syncToGithub,omitempty"` + ClearSyncToGithub *bool `json:"clearSyncToGithub,omitempty"` + GroupID *string `json:"groupID,omitempty"` + ClearGroup *bool `json:"clearGroup,omitempty"` +} + +// UpdateHushInput is used for update Hush object. +// Input was generated by ent. +type UpdateHushInput struct { + // the logical name of the corresponding hush secret or it's general grouping + Name *string `json:"name,omitempty"` + // a description of the hush value or purpose, such as github PAT + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the kind of secret, such as sshkey, certificate, api token, etc. + Kind *string `json:"kind,omitempty"` + ClearKind *bool `json:"clearKind,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateIntegrationInput is used for update Integration object. +// Input was generated by ent. +type UpdateIntegrationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the integration - must be unique within the organization + Name *string `json:"name,omitempty"` + // a description of the integration + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + Kind *string `json:"kind,omitempty"` + ClearKind *bool `json:"clearKind,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddSecretIDs []string `json:"addSecretIDs,omitempty"` + RemoveSecretIDs []string `json:"removeSecretIDs,omitempty"` + ClearSecrets *bool `json:"clearSecrets,omitempty"` + AddOauth2tokenIDs []string `json:"addOauth2tokenIDs,omitempty"` + RemoveOauth2tokenIDs []string `json:"removeOauth2tokenIDs,omitempty"` + ClearOauth2tokens *bool `json:"clearOauth2tokens,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddWebhookIDs []string `json:"addWebhookIDs,omitempty"` + RemoveWebhookIDs []string `json:"removeWebhookIDs,omitempty"` + ClearWebhooks *bool `json:"clearWebhooks,omitempty"` +} + +// UpdateInviteInput is used for update Invite object. +// Input was generated by ent. +type UpdateInviteInput struct { + // the expiration date of the invitation token which defaults to 14 days in the future from creation + Expires *time.Time `json:"expires,omitempty"` + ClearExpires *bool `json:"clearExpires,omitempty"` + // the status of the invitation + Status *enums.InviteStatus `json:"status,omitempty"` + Role *enums.Role `json:"role,omitempty"` + // the number of attempts made to perform email send of the invitation, maximum of 5 + SendAttempts *int64 `json:"sendAttempts,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateNoteInput is used for update Note object. +// Input was generated by ent. +type UpdateNoteInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the text of the note + Text *string `json:"text,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + EntityID *string `json:"entityID,omitempty"` + ClearEntity *bool `json:"clearEntity,omitempty"` +} + +// UpdateOauthProviderInput is used for update OauthProvider object. +// Input was generated by ent. +type UpdateOauthProviderInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the oauth provider's name + Name *string `json:"name,omitempty"` + // the client id for the oauth provider + ClientID *string `json:"clientID,omitempty"` + // the client secret + ClientSecret *string `json:"clientSecret,omitempty"` + // the redirect url + RedirectURL *string `json:"redirectURL,omitempty"` + // the scopes + Scopes *string `json:"scopes,omitempty"` + // the auth url of the provider + AuthURL *string `json:"authURL,omitempty"` + // the token url of the provider + TokenURL *string `json:"tokenURL,omitempty"` + // the auth style, 0: auto detect 1: third party log in 2: log in with username and password + AuthStyle *string `json:"authStyle,omitempty"` + // the URL to request user information by token + InfoURL *string `json:"infoURL,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` +} + +// UpdateOhAuthTooTokenInput is used for update OhAuthTooToken object. +// Input was generated by ent. +type UpdateOhAuthTooTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + ClientID *string `json:"clientID,omitempty"` + Scopes []string `json:"scopes,omitempty"` + AppendScopes []string `json:"appendScopes,omitempty"` + ClearScopes *bool `json:"clearScopes,omitempty"` + Nonce *string `json:"nonce,omitempty"` + ClaimsUserID *string `json:"claimsUserID,omitempty"` + ClaimsUsername *string `json:"claimsUsername,omitempty"` + ClaimsEmail *string `json:"claimsEmail,omitempty"` + ClaimsEmailVerified *bool `json:"claimsEmailVerified,omitempty"` + ClaimsGroups []string `json:"claimsGroups,omitempty"` + AppendClaimsGroups []string `json:"appendClaimsGroups,omitempty"` + ClearClaimsGroups *bool `json:"clearClaimsGroups,omitempty"` + ClaimsPreferredUsername *string `json:"claimsPreferredUsername,omitempty"` + ConnectorID *string `json:"connectorID,omitempty"` + ConnectorData []string `json:"connectorData,omitempty"` + AppendConnectorData []string `json:"appendConnectorData,omitempty"` + ClearConnectorData *bool `json:"clearConnectorData,omitempty"` + LastUsed *time.Time `json:"lastUsed,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegration *bool `json:"clearIntegration,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateOrgMembershipInput is used for update OrgMembership object. +// Input was generated by ent. +type UpdateOrgMembershipInput struct { + Role *enums.Role `json:"role,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateOrganizationInput is used for update Organization object. +// Input was generated by ent. +type UpdateOrganizationInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the organization + Name *string `json:"name,omitempty"` + // The organization's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // An optional description of the organization + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + ClearAvatarRemoteURL *bool `json:"clearAvatarRemoteURL,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroups *bool `json:"clearGroups,omitempty"` + AddTemplateIDs []string `json:"addTemplateIDs,omitempty"` + RemoveTemplateIDs []string `json:"removeTemplateIDs,omitempty"` + ClearTemplates *bool `json:"clearTemplates,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` + SettingID *string `json:"settingID,omitempty"` + ClearSetting *bool `json:"clearSetting,omitempty"` + AddDocumentdatumIDs []string `json:"addDocumentdatumIDs,omitempty"` + RemoveDocumentdatumIDs []string `json:"removeDocumentdatumIDs,omitempty"` + ClearDocumentdata *bool `json:"clearDocumentdata,omitempty"` + AddEntitlementIDs []string `json:"addEntitlementIDs,omitempty"` + RemoveEntitlementIDs []string `json:"removeEntitlementIDs,omitempty"` + ClearEntitlements *bool `json:"clearEntitlements,omitempty"` + AddOrganizationEntitlementIDs []string `json:"addOrganizationEntitlementIDs,omitempty"` + RemoveOrganizationEntitlementIDs []string `json:"removeOrganizationEntitlementIDs,omitempty"` + ClearOrganizationEntitlement *bool `json:"clearOrganizationEntitlement,omitempty"` + AddPersonalAccessTokenIDs []string `json:"addPersonalAccessTokenIDs,omitempty"` + RemovePersonalAccessTokenIDs []string `json:"removePersonalAccessTokenIDs,omitempty"` + ClearPersonalAccessTokens *bool `json:"clearPersonalAccessTokens,omitempty"` + AddAPITokenIDs []string `json:"addAPITokenIDs,omitempty"` + RemoveAPITokenIDs []string `json:"removeAPITokenIDs,omitempty"` + ClearAPITokens *bool `json:"clearAPITokens,omitempty"` + AddOauthproviderIDs []string `json:"addOauthproviderIDs,omitempty"` + RemoveOauthproviderIDs []string `json:"removeOauthproviderIDs,omitempty"` + ClearOauthprovider *bool `json:"clearOauthprovider,omitempty"` + AddUserIDs []string `json:"addUserIDs,omitempty"` + RemoveUserIDs []string `json:"removeUserIDs,omitempty"` + ClearUsers *bool `json:"clearUsers,omitempty"` + AddInviteIDs []string `json:"addInviteIDs,omitempty"` + RemoveInviteIDs []string `json:"removeInviteIDs,omitempty"` + ClearInvites *bool `json:"clearInvites,omitempty"` + AddSubscriberIDs []string `json:"addSubscriberIDs,omitempty"` + RemoveSubscriberIDs []string `json:"removeSubscriberIDs,omitempty"` + ClearSubscribers *bool `json:"clearSubscribers,omitempty"` + AddWebhookIDs []string `json:"addWebhookIDs,omitempty"` + RemoveWebhookIDs []string `json:"removeWebhookIDs,omitempty"` + ClearWebhooks *bool `json:"clearWebhooks,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddSecretIDs []string `json:"addSecretIDs,omitempty"` + RemoveSecretIDs []string `json:"removeSecretIDs,omitempty"` + ClearSecrets *bool `json:"clearSecrets,omitempty"` + AddFeatureIDs []string `json:"addFeatureIDs,omitempty"` + RemoveFeatureIDs []string `json:"removeFeatureIDs,omitempty"` + ClearFeatures *bool `json:"clearFeatures,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + AddEntitlementplanIDs []string `json:"addEntitlementplanIDs,omitempty"` + RemoveEntitlementplanIDs []string `json:"removeEntitlementplanIDs,omitempty"` + ClearEntitlementplans *bool `json:"clearEntitlementplans,omitempty"` + AddEntityIDs []string `json:"addEntityIDs,omitempty"` + RemoveEntityIDs []string `json:"removeEntityIDs,omitempty"` + ClearEntities *bool `json:"clearEntities,omitempty"` + AddEntitytypeIDs []string `json:"addEntitytypeIDs,omitempty"` + RemoveEntitytypeIDs []string `json:"removeEntitytypeIDs,omitempty"` + ClearEntitytypes *bool `json:"clearEntitytypes,omitempty"` + AddContactIDs []string `json:"addContactIDs,omitempty"` + RemoveContactIDs []string `json:"removeContactIDs,omitempty"` + ClearContacts *bool `json:"clearContacts,omitempty"` + AddNoteIDs []string `json:"addNoteIDs,omitempty"` + RemoveNoteIDs []string `json:"removeNoteIDs,omitempty"` + ClearNotes *bool `json:"clearNotes,omitempty"` + AddOrgMembers []*CreateOrgMembershipInput `json:"addOrgMembers,omitempty"` + UpdateOrgSettings *UpdateOrganizationSettingInput `json:"updateOrgSettings,omitempty"` +} + +// UpdateOrganizationSettingInput is used for update OrganizationSetting object. +// Input was generated by ent. +type UpdateOrganizationSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // domains associated with the organization + Domains []string `json:"domains,omitempty"` + AppendDomains []string `json:"appendDomains,omitempty"` + ClearDomains *bool `json:"clearDomains,omitempty"` + // Name of the person to contact for billing + BillingContact *string `json:"billingContact,omitempty"` + ClearBillingContact *bool `json:"clearBillingContact,omitempty"` + // Email address of the person to contact for billing + BillingEmail *string `json:"billingEmail,omitempty"` + ClearBillingEmail *bool `json:"clearBillingEmail,omitempty"` + // Phone number to contact for billing + BillingPhone *string `json:"billingPhone,omitempty"` + ClearBillingPhone *bool `json:"clearBillingPhone,omitempty"` + // Address to send billing information to + BillingAddress *string `json:"billingAddress,omitempty"` + ClearBillingAddress *bool `json:"clearBillingAddress,omitempty"` + // Usually government-issued tax ID or business ID such as ABN in Australia + TaxIdentifier *string `json:"taxIdentifier,omitempty"` + ClearTaxIdentifier *bool `json:"clearTaxIdentifier,omitempty"` + // geographical location of the organization + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + ClearGeoLocation *bool `json:"clearGeoLocation,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` +} + +// UpdatePersonalAccessTokenInput is used for update PersonalAccessToken object. +// Input was generated by ent. +type UpdatePersonalAccessTokenInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name associated with the token + Name *string `json:"name,omitempty"` + // a description of the token's purpose + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + Scopes []string `json:"scopes,omitempty"` + AppendScopes []string `json:"appendScopes,omitempty"` + ClearScopes *bool `json:"clearScopes,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + ClearLastUsedAt *bool `json:"clearLastUsedAt,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganizations *bool `json:"clearOrganizations,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateSubscriberInput is used for update Subscriber object. +// Input was generated by ent. +type UpdateSubscriberInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // email address of the subscriber + Email *string `json:"email,omitempty"` + // phone number of the subscriber + PhoneNumber *string `json:"phoneNumber,omitempty"` + ClearPhoneNumber *bool `json:"clearPhoneNumber,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateTFASettingInput is used for update TFASetting object. +// Input was generated by ent. +type UpdateTFASettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // specifies if the TFA device has been verified + Verified *bool `json:"verified,omitempty"` + // specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + TotpAllowed *bool `json:"totpAllowed,omitempty"` + ClearTotpAllowed *bool `json:"clearTotpAllowed,omitempty"` + // Whether to regenerate backup codes + RegenBackupCodes *bool `json:"regenBackupCodes,omitempty"` +} + +// UpdateTemplateInput is used for update Template object. +// Input was generated by ent. +type UpdateTemplateInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the template + Name *string `json:"name,omitempty"` + // the type of the template, either a provided template or an implementation (document) + TemplateType *enums.DocumentType `json:"templateType,omitempty"` + // the description of the template + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the jsonschema object of the template + Jsonconfig json.RawMessage `json:"jsonconfig,omitempty"` + // the uischema for the template to render in the UI + Uischema json.RawMessage `json:"uischema,omitempty"` + ClearUischema *bool `json:"clearUischema,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddDocumentIDs []string `json:"addDocumentIDs,omitempty"` + RemoveDocumentIDs []string `json:"removeDocumentIDs,omitempty"` + ClearDocuments *bool `json:"clearDocuments,omitempty"` +} + +// UpdateUserInput is used for update User object. +// Input was generated by ent. +type UpdateUserInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + Email *string `json:"email,omitempty"` + FirstName *string `json:"firstName,omitempty"` + ClearFirstName *bool `json:"clearFirstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + ClearLastName *bool `json:"clearLastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName *string `json:"displayName,omitempty"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + ClearAvatarRemoteURL *bool `json:"clearAvatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + ClearAvatarLocalFile *bool `json:"clearAvatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + ClearAvatarUpdatedAt *bool `json:"clearAvatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + ClearLastSeen *bool `json:"clearLastSeen,omitempty"` + // user password hash + Password *string `json:"password,omitempty"` + ClearPassword *bool `json:"clearPassword,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + ClearSub *bool `json:"clearSub,omitempty"` + // auth provider used to register the account + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + // the user's role + Role *enums.Role `json:"role,omitempty"` + ClearRole *bool `json:"clearRole,omitempty"` + AddPersonalAccessTokenIDs []string `json:"addPersonalAccessTokenIDs,omitempty"` + RemovePersonalAccessTokenIDs []string `json:"removePersonalAccessTokenIDs,omitempty"` + ClearPersonalAccessTokens *bool `json:"clearPersonalAccessTokens,omitempty"` + AddTfaSettingIDs []string `json:"addTfaSettingIDs,omitempty"` + RemoveTfaSettingIDs []string `json:"removeTfaSettingIDs,omitempty"` + ClearTfaSettings *bool `json:"clearTfaSettings,omitempty"` + SettingID *string `json:"settingID,omitempty"` + AddEmailVerificationTokenIDs []string `json:"addEmailVerificationTokenIDs,omitempty"` + RemoveEmailVerificationTokenIDs []string `json:"removeEmailVerificationTokenIDs,omitempty"` + ClearEmailVerificationTokens *bool `json:"clearEmailVerificationTokens,omitempty"` + AddPasswordResetTokenIDs []string `json:"addPasswordResetTokenIDs,omitempty"` + RemovePasswordResetTokenIDs []string `json:"removePasswordResetTokenIDs,omitempty"` + ClearPasswordResetTokens *bool `json:"clearPasswordResetTokens,omitempty"` + AddGroupIDs []string `json:"addGroupIDs,omitempty"` + RemoveGroupIDs []string `json:"removeGroupIDs,omitempty"` + ClearGroups *bool `json:"clearGroups,omitempty"` + AddOrganizationIDs []string `json:"addOrganizationIDs,omitempty"` + RemoveOrganizationIDs []string `json:"removeOrganizationIDs,omitempty"` + ClearOrganizations *bool `json:"clearOrganizations,omitempty"` + AddWebauthnIDs []string `json:"addWebauthnIDs,omitempty"` + RemoveWebauthnIDs []string `json:"removeWebauthnIDs,omitempty"` + ClearWebauthn *bool `json:"clearWebauthn,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` +} + +// UpdateUserSettingInput is used for update UserSetting object. +// Input was generated by ent. +type UpdateUserSettingInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked *bool `json:"locked,omitempty"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + ClearSilencedAt *bool `json:"clearSilencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + ClearSuspendedAt *bool `json:"clearSuspendedAt,omitempty"` + // status of the user account + Status *enums.UserStatus `json:"status,omitempty"` + // whether the user has confirmed their email address + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + ClearIsWebauthnAllowed *bool `json:"clearIsWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + ClearIsTfaEnabled *bool `json:"clearIsTfaEnabled,omitempty"` + UserID *string `json:"userID,omitempty"` + ClearUser *bool `json:"clearUser,omitempty"` + DefaultOrgID *string `json:"defaultOrgID,omitempty"` + ClearDefaultOrg *bool `json:"clearDefaultOrg,omitempty"` +} + +// UpdateWebhookInput is used for update Webhook object. +// Input was generated by ent. +type UpdateWebhookInput struct { + // tags associated with the object + Tags []string `json:"tags,omitempty"` + AppendTags []string `json:"appendTags,omitempty"` + ClearTags *bool `json:"clearTags,omitempty"` + // the name of the webhook + Name *string `json:"name,omitempty"` + // a description of the webhook + Description *string `json:"description,omitempty"` + ClearDescription *bool `json:"clearDescription,omitempty"` + // the url to send the webhook to + DestinationURL *string `json:"destinationURL,omitempty"` + // indicates if the webhook is active and enabled + Enabled *bool `json:"enabled,omitempty"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + ClearFailures *bool `json:"clearFailures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + ClearLastError *bool `json:"clearLastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` + ClearLastResponse *bool `json:"clearLastResponse,omitempty"` + OwnerID *string `json:"ownerID,omitempty"` + ClearOwner *bool `json:"clearOwner,omitempty"` + AddEventIDs []string `json:"addEventIDs,omitempty"` + RemoveEventIDs []string `json:"removeEventIDs,omitempty"` + ClearEvents *bool `json:"clearEvents,omitempty"` + AddIntegrationIDs []string `json:"addIntegrationIDs,omitempty"` + RemoveIntegrationIDs []string `json:"removeIntegrationIDs,omitempty"` + ClearIntegrations *bool `json:"clearIntegrations,omitempty"` +} + +type User struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + Email string `json:"email"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"displayName"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider enums.AuthProvider `json:"authProvider"` + // the user's role + Role *enums.Role `json:"role,omitempty"` + PersonalAccessTokens []*PersonalAccessToken `json:"personalAccessTokens,omitempty"` + TfaSettings []*TFASetting `json:"tfaSettings,omitempty"` + Setting *UserSetting `json:"setting"` + Groups []*Group `json:"groups,omitempty"` + Organizations []*Organization `json:"organizations,omitempty"` + Files []*File `json:"files,omitempty"` + Events []*Event `json:"events,omitempty"` + GroupMemberships []*GroupMembership `json:"groupMemberships,omitempty"` + OrgMemberships []*OrgMembership `json:"orgMemberships,omitempty"` +} + +func (User) IsNode() {} + +// Return response for createBulkUser mutation +type UserBulkCreatePayload struct { + // Created users + Users []*User `json:"users,omitempty"` +} + +// A connection to a list of items. +type UserConnection struct { + // A list of edges. + Edges []*UserEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createUser mutation +type UserCreatePayload struct { + // Created user + User *User `json:"user"` +} + +// Return response for deleteUser mutation +type UserDeletePayload struct { + // Deleted user ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type UserEdge struct { + // The item at the end of the edge. + Node *User `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type UserHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + Email string `json:"email"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + // The user's displayed 'friendly' name + DisplayName string `json:"displayName"` + // URL of the user's remote avatar + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + // The user's local avatar file + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + // The time the user's (local) avatar was last updated + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + // the time the user was last seen + LastSeen *time.Time `json:"lastSeen,omitempty"` + // the Subject of the user JWT + Sub *string `json:"sub,omitempty"` + // auth provider used to register the account + AuthProvider enums.AuthProvider `json:"authProvider"` + // the user's role + Role *enums.Role `json:"role,omitempty"` +} + +func (UserHistory) IsNode() {} + +// A connection to a list of items. +type UserHistoryConnection struct { + // A list of edges. + Edges []*UserHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type UserHistoryEdge struct { + // The item at the end of the edge. + Node *UserHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for UserHistory connections +type UserHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order UserHistories. + Field UserHistoryOrderField `json:"field"` +} + +// UserHistoryWhereInput is used for filtering UserHistory objects. +// Input was generated by ent. +type UserHistoryWhereInput struct { + Not *UserHistoryWhereInput `json:"not,omitempty"` + And []*UserHistoryWhereInput `json:"and,omitempty"` + Or []*UserHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // first_name field predicates + FirstName *string `json:"firstName,omitempty"` + FirstNameNeq *string `json:"firstNameNEQ,omitempty"` + FirstNameIn []string `json:"firstNameIn,omitempty"` + FirstNameNotIn []string `json:"firstNameNotIn,omitempty"` + FirstNameGt *string `json:"firstNameGT,omitempty"` + FirstNameGte *string `json:"firstNameGTE,omitempty"` + FirstNameLt *string `json:"firstNameLT,omitempty"` + FirstNameLte *string `json:"firstNameLTE,omitempty"` + FirstNameContains *string `json:"firstNameContains,omitempty"` + FirstNameHasPrefix *string `json:"firstNameHasPrefix,omitempty"` + FirstNameHasSuffix *string `json:"firstNameHasSuffix,omitempty"` + FirstNameIsNil *bool `json:"firstNameIsNil,omitempty"` + FirstNameNotNil *bool `json:"firstNameNotNil,omitempty"` + FirstNameEqualFold *string `json:"firstNameEqualFold,omitempty"` + FirstNameContainsFold *string `json:"firstNameContainsFold,omitempty"` + // last_name field predicates + LastName *string `json:"lastName,omitempty"` + LastNameNeq *string `json:"lastNameNEQ,omitempty"` + LastNameIn []string `json:"lastNameIn,omitempty"` + LastNameNotIn []string `json:"lastNameNotIn,omitempty"` + LastNameGt *string `json:"lastNameGT,omitempty"` + LastNameGte *string `json:"lastNameGTE,omitempty"` + LastNameLt *string `json:"lastNameLT,omitempty"` + LastNameLte *string `json:"lastNameLTE,omitempty"` + LastNameContains *string `json:"lastNameContains,omitempty"` + LastNameHasPrefix *string `json:"lastNameHasPrefix,omitempty"` + LastNameHasSuffix *string `json:"lastNameHasSuffix,omitempty"` + LastNameIsNil *bool `json:"lastNameIsNil,omitempty"` + LastNameNotNil *bool `json:"lastNameNotNil,omitempty"` + LastNameEqualFold *string `json:"lastNameEqualFold,omitempty"` + LastNameContainsFold *string `json:"lastNameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + // avatar_local_file field predicates + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + AvatarLocalFileNeq *string `json:"avatarLocalFileNEQ,omitempty"` + AvatarLocalFileIn []string `json:"avatarLocalFileIn,omitempty"` + AvatarLocalFileNotIn []string `json:"avatarLocalFileNotIn,omitempty"` + AvatarLocalFileGt *string `json:"avatarLocalFileGT,omitempty"` + AvatarLocalFileGte *string `json:"avatarLocalFileGTE,omitempty"` + AvatarLocalFileLt *string `json:"avatarLocalFileLT,omitempty"` + AvatarLocalFileLte *string `json:"avatarLocalFileLTE,omitempty"` + AvatarLocalFileContains *string `json:"avatarLocalFileContains,omitempty"` + AvatarLocalFileHasPrefix *string `json:"avatarLocalFileHasPrefix,omitempty"` + AvatarLocalFileHasSuffix *string `json:"avatarLocalFileHasSuffix,omitempty"` + AvatarLocalFileIsNil *bool `json:"avatarLocalFileIsNil,omitempty"` + AvatarLocalFileNotNil *bool `json:"avatarLocalFileNotNil,omitempty"` + AvatarLocalFileEqualFold *string `json:"avatarLocalFileEqualFold,omitempty"` + AvatarLocalFileContainsFold *string `json:"avatarLocalFileContainsFold,omitempty"` + // avatar_updated_at field predicates + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + AvatarUpdatedAtNeq *time.Time `json:"avatarUpdatedAtNEQ,omitempty"` + AvatarUpdatedAtIn []*time.Time `json:"avatarUpdatedAtIn,omitempty"` + AvatarUpdatedAtNotIn []*time.Time `json:"avatarUpdatedAtNotIn,omitempty"` + AvatarUpdatedAtGt *time.Time `json:"avatarUpdatedAtGT,omitempty"` + AvatarUpdatedAtGte *time.Time `json:"avatarUpdatedAtGTE,omitempty"` + AvatarUpdatedAtLt *time.Time `json:"avatarUpdatedAtLT,omitempty"` + AvatarUpdatedAtLte *time.Time `json:"avatarUpdatedAtLTE,omitempty"` + AvatarUpdatedAtIsNil *bool `json:"avatarUpdatedAtIsNil,omitempty"` + AvatarUpdatedAtNotNil *bool `json:"avatarUpdatedAtNotNil,omitempty"` + // last_seen field predicates + LastSeen *time.Time `json:"lastSeen,omitempty"` + LastSeenNeq *time.Time `json:"lastSeenNEQ,omitempty"` + LastSeenIn []*time.Time `json:"lastSeenIn,omitempty"` + LastSeenNotIn []*time.Time `json:"lastSeenNotIn,omitempty"` + LastSeenGt *time.Time `json:"lastSeenGT,omitempty"` + LastSeenGte *time.Time `json:"lastSeenGTE,omitempty"` + LastSeenLt *time.Time `json:"lastSeenLT,omitempty"` + LastSeenLte *time.Time `json:"lastSeenLTE,omitempty"` + LastSeenIsNil *bool `json:"lastSeenIsNil,omitempty"` + LastSeenNotNil *bool `json:"lastSeenNotNil,omitempty"` + // sub field predicates + Sub *string `json:"sub,omitempty"` + SubNeq *string `json:"subNEQ,omitempty"` + SubIn []string `json:"subIn,omitempty"` + SubNotIn []string `json:"subNotIn,omitempty"` + SubGt *string `json:"subGT,omitempty"` + SubGte *string `json:"subGTE,omitempty"` + SubLt *string `json:"subLT,omitempty"` + SubLte *string `json:"subLTE,omitempty"` + SubContains *string `json:"subContains,omitempty"` + SubHasPrefix *string `json:"subHasPrefix,omitempty"` + SubHasSuffix *string `json:"subHasSuffix,omitempty"` + SubIsNil *bool `json:"subIsNil,omitempty"` + SubNotNil *bool `json:"subNotNil,omitempty"` + SubEqualFold *string `json:"subEqualFold,omitempty"` + SubContainsFold *string `json:"subContainsFold,omitempty"` + // auth_provider field predicates + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + AuthProviderNeq *enums.AuthProvider `json:"authProviderNEQ,omitempty"` + AuthProviderIn []enums.AuthProvider `json:"authProviderIn,omitempty"` + AuthProviderNotIn []enums.AuthProvider `json:"authProviderNotIn,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + RoleIsNil *bool `json:"roleIsNil,omitempty"` + RoleNotNil *bool `json:"roleNotNil,omitempty"` +} + +// Ordering options for User connections +type UserOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Users. + Field UserOrderField `json:"field"` +} + +type UserSearchResult struct { + Users []*User `json:"users,omitempty"` +} + +func (UserSearchResult) IsGlobalSearchResult() {} + +type UserSetting struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + UserID *string `json:"userID,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked bool `json:"locked"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + // status of the user account + Status enums.UserStatus `json:"status"` + // whether the user has confirmed their email address + EmailConfirmed bool `json:"emailConfirmed"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + User *User `json:"user,omitempty"` + // organization to load on user login + DefaultOrg *Organization `json:"defaultOrg,omitempty"` +} + +func (UserSetting) IsNode() {} + +// Return response for createBulkUserSetting mutation +type UserSettingBulkCreatePayload struct { + // Created userSettings + UserSettings []*UserSetting `json:"userSettings,omitempty"` +} + +// A connection to a list of items. +type UserSettingConnection struct { + // A list of edges. + Edges []*UserSettingEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createUserSetting mutation +type UserSettingCreatePayload struct { + // Created userSetting + UserSetting *UserSetting `json:"userSetting"` +} + +// An edge in a connection. +type UserSettingEdge struct { + // The item at the end of the edge. + Node *UserSetting `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type UserSettingHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + UserID *string `json:"userID,omitempty"` + // user account is locked if unconfirmed or explicitly locked + Locked bool `json:"locked"` + // The time notifications regarding the user were silenced + SilencedAt *time.Time `json:"silencedAt,omitempty"` + // The time the user was suspended + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + // status of the user account + Status enums.UserStatus `json:"status"` + // whether the user has confirmed their email address + EmailConfirmed bool `json:"emailConfirmed"` + // specifies a user may complete authentication by verifying a WebAuthn capable device + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + // whether the user has two factor authentication enabled + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` +} + +func (UserSettingHistory) IsNode() {} + +// A connection to a list of items. +type UserSettingHistoryConnection struct { + // A list of edges. + Edges []*UserSettingHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type UserSettingHistoryEdge struct { + // The item at the end of the edge. + Node *UserSettingHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// UserSettingHistoryWhereInput is used for filtering UserSettingHistory objects. +// Input was generated by ent. +type UserSettingHistoryWhereInput struct { + Not *UserSettingHistoryWhereInput `json:"not,omitempty"` + And []*UserSettingHistoryWhereInput `json:"and,omitempty"` + Or []*UserSettingHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDIsNil *bool `json:"userIDIsNil,omitempty"` + UserIDNotNil *bool `json:"userIDNotNil,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + // locked field predicates + Locked *bool `json:"locked,omitempty"` + LockedNeq *bool `json:"lockedNEQ,omitempty"` + // silenced_at field predicates + SilencedAt *time.Time `json:"silencedAt,omitempty"` + SilencedAtNeq *time.Time `json:"silencedAtNEQ,omitempty"` + SilencedAtIn []*time.Time `json:"silencedAtIn,omitempty"` + SilencedAtNotIn []*time.Time `json:"silencedAtNotIn,omitempty"` + SilencedAtGt *time.Time `json:"silencedAtGT,omitempty"` + SilencedAtGte *time.Time `json:"silencedAtGTE,omitempty"` + SilencedAtLt *time.Time `json:"silencedAtLT,omitempty"` + SilencedAtLte *time.Time `json:"silencedAtLTE,omitempty"` + SilencedAtIsNil *bool `json:"silencedAtIsNil,omitempty"` + SilencedAtNotNil *bool `json:"silencedAtNotNil,omitempty"` + // suspended_at field predicates + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + SuspendedAtNeq *time.Time `json:"suspendedAtNEQ,omitempty"` + SuspendedAtIn []*time.Time `json:"suspendedAtIn,omitempty"` + SuspendedAtNotIn []*time.Time `json:"suspendedAtNotIn,omitempty"` + SuspendedAtGt *time.Time `json:"suspendedAtGT,omitempty"` + SuspendedAtGte *time.Time `json:"suspendedAtGTE,omitempty"` + SuspendedAtLt *time.Time `json:"suspendedAtLT,omitempty"` + SuspendedAtLte *time.Time `json:"suspendedAtLTE,omitempty"` + SuspendedAtIsNil *bool `json:"suspendedAtIsNil,omitempty"` + SuspendedAtNotNil *bool `json:"suspendedAtNotNil,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + // email_confirmed field predicates + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + EmailConfirmedNeq *bool `json:"emailConfirmedNEQ,omitempty"` + // is_webauthn_allowed field predicates + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + IsWebauthnAllowedNeq *bool `json:"isWebauthnAllowedNEQ,omitempty"` + IsWebauthnAllowedIsNil *bool `json:"isWebauthnAllowedIsNil,omitempty"` + IsWebauthnAllowedNotNil *bool `json:"isWebauthnAllowedNotNil,omitempty"` + // is_tfa_enabled field predicates + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + IsTfaEnabledNeq *bool `json:"isTfaEnabledNEQ,omitempty"` + IsTfaEnabledIsNil *bool `json:"isTfaEnabledIsNil,omitempty"` + IsTfaEnabledNotNil *bool `json:"isTfaEnabledNotNil,omitempty"` +} + +// Return response for updateUserSetting mutation +type UserSettingUpdatePayload struct { + // Updated userSetting + UserSetting *UserSetting `json:"userSetting"` +} + +// UserSettingWhereInput is used for filtering UserSetting objects. +// Input was generated by ent. +type UserSettingWhereInput struct { + Not *UserSettingWhereInput `json:"not,omitempty"` + And []*UserSettingWhereInput `json:"and,omitempty"` + Or []*UserSettingWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // user_id field predicates + UserID *string `json:"userID,omitempty"` + UserIDNeq *string `json:"userIDNEQ,omitempty"` + UserIDIn []string `json:"userIDIn,omitempty"` + UserIDNotIn []string `json:"userIDNotIn,omitempty"` + UserIDGt *string `json:"userIDGT,omitempty"` + UserIDGte *string `json:"userIDGTE,omitempty"` + UserIDLt *string `json:"userIDLT,omitempty"` + UserIDLte *string `json:"userIDLTE,omitempty"` + UserIDContains *string `json:"userIDContains,omitempty"` + UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` + UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` + UserIDIsNil *bool `json:"userIDIsNil,omitempty"` + UserIDNotNil *bool `json:"userIDNotNil,omitempty"` + UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` + UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` + // locked field predicates + Locked *bool `json:"locked,omitempty"` + LockedNeq *bool `json:"lockedNEQ,omitempty"` + // silenced_at field predicates + SilencedAt *time.Time `json:"silencedAt,omitempty"` + SilencedAtNeq *time.Time `json:"silencedAtNEQ,omitempty"` + SilencedAtIn []*time.Time `json:"silencedAtIn,omitempty"` + SilencedAtNotIn []*time.Time `json:"silencedAtNotIn,omitempty"` + SilencedAtGt *time.Time `json:"silencedAtGT,omitempty"` + SilencedAtGte *time.Time `json:"silencedAtGTE,omitempty"` + SilencedAtLt *time.Time `json:"silencedAtLT,omitempty"` + SilencedAtLte *time.Time `json:"silencedAtLTE,omitempty"` + SilencedAtIsNil *bool `json:"silencedAtIsNil,omitempty"` + SilencedAtNotNil *bool `json:"silencedAtNotNil,omitempty"` + // suspended_at field predicates + SuspendedAt *time.Time `json:"suspendedAt,omitempty"` + SuspendedAtNeq *time.Time `json:"suspendedAtNEQ,omitempty"` + SuspendedAtIn []*time.Time `json:"suspendedAtIn,omitempty"` + SuspendedAtNotIn []*time.Time `json:"suspendedAtNotIn,omitempty"` + SuspendedAtGt *time.Time `json:"suspendedAtGT,omitempty"` + SuspendedAtGte *time.Time `json:"suspendedAtGTE,omitempty"` + SuspendedAtLt *time.Time `json:"suspendedAtLT,omitempty"` + SuspendedAtLte *time.Time `json:"suspendedAtLTE,omitempty"` + SuspendedAtIsNil *bool `json:"suspendedAtIsNil,omitempty"` + SuspendedAtNotNil *bool `json:"suspendedAtNotNil,omitempty"` + // status field predicates + Status *enums.UserStatus `json:"status,omitempty"` + StatusNeq *enums.UserStatus `json:"statusNEQ,omitempty"` + StatusIn []enums.UserStatus `json:"statusIn,omitempty"` + StatusNotIn []enums.UserStatus `json:"statusNotIn,omitempty"` + // email_confirmed field predicates + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + EmailConfirmedNeq *bool `json:"emailConfirmedNEQ,omitempty"` + // is_webauthn_allowed field predicates + IsWebauthnAllowed *bool `json:"isWebauthnAllowed,omitempty"` + IsWebauthnAllowedNeq *bool `json:"isWebauthnAllowedNEQ,omitempty"` + IsWebauthnAllowedIsNil *bool `json:"isWebauthnAllowedIsNil,omitempty"` + IsWebauthnAllowedNotNil *bool `json:"isWebauthnAllowedNotNil,omitempty"` + // is_tfa_enabled field predicates + IsTfaEnabled *bool `json:"isTfaEnabled,omitempty"` + IsTfaEnabledNeq *bool `json:"isTfaEnabledNEQ,omitempty"` + IsTfaEnabledIsNil *bool `json:"isTfaEnabledIsNil,omitempty"` + IsTfaEnabledNotNil *bool `json:"isTfaEnabledNotNil,omitempty"` + // user edge predicates + HasUser *bool `json:"hasUser,omitempty"` + HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` + // default_org edge predicates + HasDefaultOrg *bool `json:"hasDefaultOrg,omitempty"` + HasDefaultOrgWith []*OrganizationWhereInput `json:"hasDefaultOrgWith,omitempty"` +} + +// Return response for updateUser mutation +type UserUpdatePayload struct { + // Updated user + User *User `json:"user"` +} + +// UserWhereInput is used for filtering User objects. +// Input was generated by ent. +type UserWhereInput struct { + Not *UserWhereInput `json:"not,omitempty"` + And []*UserWhereInput `json:"and,omitempty"` + Or []*UserWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // email field predicates + Email *string `json:"email,omitempty"` + EmailNeq *string `json:"emailNEQ,omitempty"` + EmailIn []string `json:"emailIn,omitempty"` + EmailNotIn []string `json:"emailNotIn,omitempty"` + EmailGt *string `json:"emailGT,omitempty"` + EmailGte *string `json:"emailGTE,omitempty"` + EmailLt *string `json:"emailLT,omitempty"` + EmailLte *string `json:"emailLTE,omitempty"` + EmailContains *string `json:"emailContains,omitempty"` + EmailHasPrefix *string `json:"emailHasPrefix,omitempty"` + EmailHasSuffix *string `json:"emailHasSuffix,omitempty"` + EmailEqualFold *string `json:"emailEqualFold,omitempty"` + EmailContainsFold *string `json:"emailContainsFold,omitempty"` + // first_name field predicates + FirstName *string `json:"firstName,omitempty"` + FirstNameNeq *string `json:"firstNameNEQ,omitempty"` + FirstNameIn []string `json:"firstNameIn,omitempty"` + FirstNameNotIn []string `json:"firstNameNotIn,omitempty"` + FirstNameGt *string `json:"firstNameGT,omitempty"` + FirstNameGte *string `json:"firstNameGTE,omitempty"` + FirstNameLt *string `json:"firstNameLT,omitempty"` + FirstNameLte *string `json:"firstNameLTE,omitempty"` + FirstNameContains *string `json:"firstNameContains,omitempty"` + FirstNameHasPrefix *string `json:"firstNameHasPrefix,omitempty"` + FirstNameHasSuffix *string `json:"firstNameHasSuffix,omitempty"` + FirstNameIsNil *bool `json:"firstNameIsNil,omitempty"` + FirstNameNotNil *bool `json:"firstNameNotNil,omitempty"` + FirstNameEqualFold *string `json:"firstNameEqualFold,omitempty"` + FirstNameContainsFold *string `json:"firstNameContainsFold,omitempty"` + // last_name field predicates + LastName *string `json:"lastName,omitempty"` + LastNameNeq *string `json:"lastNameNEQ,omitempty"` + LastNameIn []string `json:"lastNameIn,omitempty"` + LastNameNotIn []string `json:"lastNameNotIn,omitempty"` + LastNameGt *string `json:"lastNameGT,omitempty"` + LastNameGte *string `json:"lastNameGTE,omitempty"` + LastNameLt *string `json:"lastNameLT,omitempty"` + LastNameLte *string `json:"lastNameLTE,omitempty"` + LastNameContains *string `json:"lastNameContains,omitempty"` + LastNameHasPrefix *string `json:"lastNameHasPrefix,omitempty"` + LastNameHasSuffix *string `json:"lastNameHasSuffix,omitempty"` + LastNameIsNil *bool `json:"lastNameIsNil,omitempty"` + LastNameNotNil *bool `json:"lastNameNotNil,omitempty"` + LastNameEqualFold *string `json:"lastNameEqualFold,omitempty"` + LastNameContainsFold *string `json:"lastNameContainsFold,omitempty"` + // display_name field predicates + DisplayName *string `json:"displayName,omitempty"` + DisplayNameNeq *string `json:"displayNameNEQ,omitempty"` + DisplayNameIn []string `json:"displayNameIn,omitempty"` + DisplayNameNotIn []string `json:"displayNameNotIn,omitempty"` + DisplayNameGt *string `json:"displayNameGT,omitempty"` + DisplayNameGte *string `json:"displayNameGTE,omitempty"` + DisplayNameLt *string `json:"displayNameLT,omitempty"` + DisplayNameLte *string `json:"displayNameLTE,omitempty"` + DisplayNameContains *string `json:"displayNameContains,omitempty"` + DisplayNameHasPrefix *string `json:"displayNameHasPrefix,omitempty"` + DisplayNameHasSuffix *string `json:"displayNameHasSuffix,omitempty"` + DisplayNameEqualFold *string `json:"displayNameEqualFold,omitempty"` + DisplayNameContainsFold *string `json:"displayNameContainsFold,omitempty"` + // avatar_remote_url field predicates + AvatarRemoteURL *string `json:"avatarRemoteURL,omitempty"` + AvatarRemoteURLNeq *string `json:"avatarRemoteURLNEQ,omitempty"` + AvatarRemoteURLIn []string `json:"avatarRemoteURLIn,omitempty"` + AvatarRemoteURLNotIn []string `json:"avatarRemoteURLNotIn,omitempty"` + AvatarRemoteURLGt *string `json:"avatarRemoteURLGT,omitempty"` + AvatarRemoteURLGte *string `json:"avatarRemoteURLGTE,omitempty"` + AvatarRemoteURLLt *string `json:"avatarRemoteURLLT,omitempty"` + AvatarRemoteURLLte *string `json:"avatarRemoteURLLTE,omitempty"` + AvatarRemoteURLContains *string `json:"avatarRemoteURLContains,omitempty"` + AvatarRemoteURLHasPrefix *string `json:"avatarRemoteURLHasPrefix,omitempty"` + AvatarRemoteURLHasSuffix *string `json:"avatarRemoteURLHasSuffix,omitempty"` + AvatarRemoteURLIsNil *bool `json:"avatarRemoteURLIsNil,omitempty"` + AvatarRemoteURLNotNil *bool `json:"avatarRemoteURLNotNil,omitempty"` + AvatarRemoteURLEqualFold *string `json:"avatarRemoteURLEqualFold,omitempty"` + AvatarRemoteURLContainsFold *string `json:"avatarRemoteURLContainsFold,omitempty"` + // avatar_local_file field predicates + AvatarLocalFile *string `json:"avatarLocalFile,omitempty"` + AvatarLocalFileNeq *string `json:"avatarLocalFileNEQ,omitempty"` + AvatarLocalFileIn []string `json:"avatarLocalFileIn,omitempty"` + AvatarLocalFileNotIn []string `json:"avatarLocalFileNotIn,omitempty"` + AvatarLocalFileGt *string `json:"avatarLocalFileGT,omitempty"` + AvatarLocalFileGte *string `json:"avatarLocalFileGTE,omitempty"` + AvatarLocalFileLt *string `json:"avatarLocalFileLT,omitempty"` + AvatarLocalFileLte *string `json:"avatarLocalFileLTE,omitempty"` + AvatarLocalFileContains *string `json:"avatarLocalFileContains,omitempty"` + AvatarLocalFileHasPrefix *string `json:"avatarLocalFileHasPrefix,omitempty"` + AvatarLocalFileHasSuffix *string `json:"avatarLocalFileHasSuffix,omitempty"` + AvatarLocalFileIsNil *bool `json:"avatarLocalFileIsNil,omitempty"` + AvatarLocalFileNotNil *bool `json:"avatarLocalFileNotNil,omitempty"` + AvatarLocalFileEqualFold *string `json:"avatarLocalFileEqualFold,omitempty"` + AvatarLocalFileContainsFold *string `json:"avatarLocalFileContainsFold,omitempty"` + // avatar_updated_at field predicates + AvatarUpdatedAt *time.Time `json:"avatarUpdatedAt,omitempty"` + AvatarUpdatedAtNeq *time.Time `json:"avatarUpdatedAtNEQ,omitempty"` + AvatarUpdatedAtIn []*time.Time `json:"avatarUpdatedAtIn,omitempty"` + AvatarUpdatedAtNotIn []*time.Time `json:"avatarUpdatedAtNotIn,omitempty"` + AvatarUpdatedAtGt *time.Time `json:"avatarUpdatedAtGT,omitempty"` + AvatarUpdatedAtGte *time.Time `json:"avatarUpdatedAtGTE,omitempty"` + AvatarUpdatedAtLt *time.Time `json:"avatarUpdatedAtLT,omitempty"` + AvatarUpdatedAtLte *time.Time `json:"avatarUpdatedAtLTE,omitempty"` + AvatarUpdatedAtIsNil *bool `json:"avatarUpdatedAtIsNil,omitempty"` + AvatarUpdatedAtNotNil *bool `json:"avatarUpdatedAtNotNil,omitempty"` + // last_seen field predicates + LastSeen *time.Time `json:"lastSeen,omitempty"` + LastSeenNeq *time.Time `json:"lastSeenNEQ,omitempty"` + LastSeenIn []*time.Time `json:"lastSeenIn,omitempty"` + LastSeenNotIn []*time.Time `json:"lastSeenNotIn,omitempty"` + LastSeenGt *time.Time `json:"lastSeenGT,omitempty"` + LastSeenGte *time.Time `json:"lastSeenGTE,omitempty"` + LastSeenLt *time.Time `json:"lastSeenLT,omitempty"` + LastSeenLte *time.Time `json:"lastSeenLTE,omitempty"` + LastSeenIsNil *bool `json:"lastSeenIsNil,omitempty"` + LastSeenNotNil *bool `json:"lastSeenNotNil,omitempty"` + // sub field predicates + Sub *string `json:"sub,omitempty"` + SubNeq *string `json:"subNEQ,omitempty"` + SubIn []string `json:"subIn,omitempty"` + SubNotIn []string `json:"subNotIn,omitempty"` + SubGt *string `json:"subGT,omitempty"` + SubGte *string `json:"subGTE,omitempty"` + SubLt *string `json:"subLT,omitempty"` + SubLte *string `json:"subLTE,omitempty"` + SubContains *string `json:"subContains,omitempty"` + SubHasPrefix *string `json:"subHasPrefix,omitempty"` + SubHasSuffix *string `json:"subHasSuffix,omitempty"` + SubIsNil *bool `json:"subIsNil,omitempty"` + SubNotNil *bool `json:"subNotNil,omitempty"` + SubEqualFold *string `json:"subEqualFold,omitempty"` + SubContainsFold *string `json:"subContainsFold,omitempty"` + // auth_provider field predicates + AuthProvider *enums.AuthProvider `json:"authProvider,omitempty"` + AuthProviderNeq *enums.AuthProvider `json:"authProviderNEQ,omitempty"` + AuthProviderIn []enums.AuthProvider `json:"authProviderIn,omitempty"` + AuthProviderNotIn []enums.AuthProvider `json:"authProviderNotIn,omitempty"` + // role field predicates + Role *enums.Role `json:"role,omitempty"` + RoleNeq *enums.Role `json:"roleNEQ,omitempty"` + RoleIn []enums.Role `json:"roleIn,omitempty"` + RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` + RoleIsNil *bool `json:"roleIsNil,omitempty"` + RoleNotNil *bool `json:"roleNotNil,omitempty"` + // personal_access_tokens edge predicates + HasPersonalAccessTokens *bool `json:"hasPersonalAccessTokens,omitempty"` + HasPersonalAccessTokensWith []*PersonalAccessTokenWhereInput `json:"hasPersonalAccessTokensWith,omitempty"` + // tfa_settings edge predicates + HasTfaSettings *bool `json:"hasTfaSettings,omitempty"` + HasTfaSettingsWith []*TFASettingWhereInput `json:"hasTfaSettingsWith,omitempty"` + // setting edge predicates + HasSetting *bool `json:"hasSetting,omitempty"` + HasSettingWith []*UserSettingWhereInput `json:"hasSettingWith,omitempty"` + // groups edge predicates + HasGroups *bool `json:"hasGroups,omitempty"` + HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"` + // organizations edge predicates + HasOrganizations *bool `json:"hasOrganizations,omitempty"` + HasOrganizationsWith []*OrganizationWhereInput `json:"hasOrganizationsWith,omitempty"` + // files edge predicates + HasFiles *bool `json:"hasFiles,omitempty"` + HasFilesWith []*FileWhereInput `json:"hasFilesWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // group_memberships edge predicates + HasGroupMemberships *bool `json:"hasGroupMemberships,omitempty"` + HasGroupMembershipsWith []*GroupMembershipWhereInput `json:"hasGroupMembershipsWith,omitempty"` + // org_memberships edge predicates + HasOrgMemberships *bool `json:"hasOrgMemberships,omitempty"` + HasOrgMembershipsWith []*OrgMembershipWhereInput `json:"hasOrgMembershipsWith,omitempty"` +} + +type Webhook struct { + ID string `json:"id"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the webhook + Name string `json:"name"` + // a description of the webhook + Description *string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destinationURL"` + // indicates if the webhook is active and enabled + Enabled bool `json:"enabled"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` + Owner *Organization `json:"owner,omitempty"` + Events []*Event `json:"events,omitempty"` + Integrations []*Integration `json:"integrations,omitempty"` +} + +func (Webhook) IsNode() {} + +// Return response for createBulkWebhook mutation +type WebhookBulkCreatePayload struct { + // Created webhooks + Webhooks []*Webhook `json:"webhooks,omitempty"` +} + +// A connection to a list of items. +type WebhookConnection struct { + // A list of edges. + Edges []*WebhookEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// Return response for createWebhook mutation +type WebhookCreatePayload struct { + // Created webhook + Webhook *Webhook `json:"webhook"` +} + +// Return response for deleteWebhook mutation +type WebhookDeletePayload struct { + // Deleted webhook ID + DeletedID string `json:"deletedID"` +} + +// An edge in a connection. +type WebhookEdge struct { + // The item at the end of the edge. + Node *Webhook `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +type WebhookHistory struct { + ID string `json:"id"` + HistoryTime time.Time `json:"historyTime"` + Ref *string `json:"ref,omitempty"` + Operation history.OpType `json:"operation"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + // tags associated with the object + Tags []string `json:"tags,omitempty"` + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedBy *string `json:"deletedBy,omitempty"` + // The organization id that owns the object + OwnerID *string `json:"ownerID,omitempty"` + // the name of the webhook + Name string `json:"name"` + // a description of the webhook + Description *string `json:"description,omitempty"` + // the url to send the webhook to + DestinationURL string `json:"destinationURL"` + // indicates if the webhook is active and enabled + Enabled bool `json:"enabled"` + // the number of failures + Failures *int64 `json:"failures,omitempty"` + // the last error message + LastError *string `json:"lastError,omitempty"` + // the last response + LastResponse *string `json:"lastResponse,omitempty"` +} + +func (WebhookHistory) IsNode() {} + +// A connection to a list of items. +type WebhookHistoryConnection struct { + // A list of edges. + Edges []*WebhookHistoryEdge `json:"edges,omitempty"` + // Information to aid in pagination. + PageInfo *PageInfo `json:"pageInfo"` + // Identifies the total count of items in the connection. + TotalCount int64 `json:"totalCount"` +} + +// An edge in a connection. +type WebhookHistoryEdge struct { + // The item at the end of the edge. + Node *WebhookHistory `json:"node,omitempty"` + // A cursor for use in pagination. + Cursor string `json:"cursor"` +} + +// Ordering options for WebhookHistory connections +type WebhookHistoryOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order WebhookHistories. + Field WebhookHistoryOrderField `json:"field"` +} + +// WebhookHistoryWhereInput is used for filtering WebhookHistory objects. +// Input was generated by ent. +type WebhookHistoryWhereInput struct { + Not *WebhookHistoryWhereInput `json:"not,omitempty"` + And []*WebhookHistoryWhereInput `json:"and,omitempty"` + Or []*WebhookHistoryWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // history_time field predicates + HistoryTime *time.Time `json:"historyTime,omitempty"` + HistoryTimeNeq *time.Time `json:"historyTimeNEQ,omitempty"` + HistoryTimeIn []*time.Time `json:"historyTimeIn,omitempty"` + HistoryTimeNotIn []*time.Time `json:"historyTimeNotIn,omitempty"` + HistoryTimeGt *time.Time `json:"historyTimeGT,omitempty"` + HistoryTimeGte *time.Time `json:"historyTimeGTE,omitempty"` + HistoryTimeLt *time.Time `json:"historyTimeLT,omitempty"` + HistoryTimeLte *time.Time `json:"historyTimeLTE,omitempty"` + // ref field predicates + Ref *string `json:"ref,omitempty"` + RefNeq *string `json:"refNEQ,omitempty"` + RefIn []string `json:"refIn,omitempty"` + RefNotIn []string `json:"refNotIn,omitempty"` + RefGt *string `json:"refGT,omitempty"` + RefGte *string `json:"refGTE,omitempty"` + RefLt *string `json:"refLT,omitempty"` + RefLte *string `json:"refLTE,omitempty"` + RefContains *string `json:"refContains,omitempty"` + RefHasPrefix *string `json:"refHasPrefix,omitempty"` + RefHasSuffix *string `json:"refHasSuffix,omitempty"` + RefIsNil *bool `json:"refIsNil,omitempty"` + RefNotNil *bool `json:"refNotNil,omitempty"` + RefEqualFold *string `json:"refEqualFold,omitempty"` + RefContainsFold *string `json:"refContainsFold,omitempty"` + // operation field predicates + Operation *history.OpType `json:"operation,omitempty"` + OperationNeq *history.OpType `json:"operationNEQ,omitempty"` + OperationIn []history.OpType `json:"operationIn,omitempty"` + OperationNotIn []history.OpType `json:"operationNotIn,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // destination_url field predicates + DestinationURL *string `json:"destinationURL,omitempty"` + DestinationURLNeq *string `json:"destinationURLNEQ,omitempty"` + DestinationURLIn []string `json:"destinationURLIn,omitempty"` + DestinationURLNotIn []string `json:"destinationURLNotIn,omitempty"` + DestinationURLGt *string `json:"destinationURLGT,omitempty"` + DestinationURLGte *string `json:"destinationURLGTE,omitempty"` + DestinationURLLt *string `json:"destinationURLLT,omitempty"` + DestinationURLLte *string `json:"destinationURLLTE,omitempty"` + DestinationURLContains *string `json:"destinationURLContains,omitempty"` + DestinationURLHasPrefix *string `json:"destinationURLHasPrefix,omitempty"` + DestinationURLHasSuffix *string `json:"destinationURLHasSuffix,omitempty"` + DestinationURLEqualFold *string `json:"destinationURLEqualFold,omitempty"` + DestinationURLContainsFold *string `json:"destinationURLContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // failures field predicates + Failures *int64 `json:"failures,omitempty"` + FailuresNeq *int64 `json:"failuresNEQ,omitempty"` + FailuresIn []int64 `json:"failuresIn,omitempty"` + FailuresNotIn []int64 `json:"failuresNotIn,omitempty"` + FailuresGt *int64 `json:"failuresGT,omitempty"` + FailuresGte *int64 `json:"failuresGTE,omitempty"` + FailuresLt *int64 `json:"failuresLT,omitempty"` + FailuresLte *int64 `json:"failuresLTE,omitempty"` + FailuresIsNil *bool `json:"failuresIsNil,omitempty"` + FailuresNotNil *bool `json:"failuresNotNil,omitempty"` + // last_error field predicates + LastError *string `json:"lastError,omitempty"` + LastErrorNeq *string `json:"lastErrorNEQ,omitempty"` + LastErrorIn []string `json:"lastErrorIn,omitempty"` + LastErrorNotIn []string `json:"lastErrorNotIn,omitempty"` + LastErrorGt *string `json:"lastErrorGT,omitempty"` + LastErrorGte *string `json:"lastErrorGTE,omitempty"` + LastErrorLt *string `json:"lastErrorLT,omitempty"` + LastErrorLte *string `json:"lastErrorLTE,omitempty"` + LastErrorContains *string `json:"lastErrorContains,omitempty"` + LastErrorHasPrefix *string `json:"lastErrorHasPrefix,omitempty"` + LastErrorHasSuffix *string `json:"lastErrorHasSuffix,omitempty"` + LastErrorIsNil *bool `json:"lastErrorIsNil,omitempty"` + LastErrorNotNil *bool `json:"lastErrorNotNil,omitempty"` + LastErrorEqualFold *string `json:"lastErrorEqualFold,omitempty"` + LastErrorContainsFold *string `json:"lastErrorContainsFold,omitempty"` + // last_response field predicates + LastResponse *string `json:"lastResponse,omitempty"` + LastResponseNeq *string `json:"lastResponseNEQ,omitempty"` + LastResponseIn []string `json:"lastResponseIn,omitempty"` + LastResponseNotIn []string `json:"lastResponseNotIn,omitempty"` + LastResponseGt *string `json:"lastResponseGT,omitempty"` + LastResponseGte *string `json:"lastResponseGTE,omitempty"` + LastResponseLt *string `json:"lastResponseLT,omitempty"` + LastResponseLte *string `json:"lastResponseLTE,omitempty"` + LastResponseContains *string `json:"lastResponseContains,omitempty"` + LastResponseHasPrefix *string `json:"lastResponseHasPrefix,omitempty"` + LastResponseHasSuffix *string `json:"lastResponseHasSuffix,omitempty"` + LastResponseIsNil *bool `json:"lastResponseIsNil,omitempty"` + LastResponseNotNil *bool `json:"lastResponseNotNil,omitempty"` + LastResponseEqualFold *string `json:"lastResponseEqualFold,omitempty"` + LastResponseContainsFold *string `json:"lastResponseContainsFold,omitempty"` +} + +// Ordering options for Webhook connections +type WebhookOrder struct { + // The ordering direction. + Direction OrderDirection `json:"direction"` + // The field by which to order Webhooks. + Field WebhookOrderField `json:"field"` +} + +// Return response for updateWebhook mutation +type WebhookUpdatePayload struct { + // Updated webhook + Webhook *Webhook `json:"webhook"` +} + +// WebhookWhereInput is used for filtering Webhook objects. +// Input was generated by ent. +type WebhookWhereInput struct { + Not *WebhookWhereInput `json:"not,omitempty"` + And []*WebhookWhereInput `json:"and,omitempty"` + Or []*WebhookWhereInput `json:"or,omitempty"` + // id field predicates + ID *string `json:"id,omitempty"` + IDNeq *string `json:"idNEQ,omitempty"` + IDIn []string `json:"idIn,omitempty"` + IDNotIn []string `json:"idNotIn,omitempty"` + IDGt *string `json:"idGT,omitempty"` + IDGte *string `json:"idGTE,omitempty"` + IDLt *string `json:"idLT,omitempty"` + IDLte *string `json:"idLTE,omitempty"` + IDEqualFold *string `json:"idEqualFold,omitempty"` + IDContainsFold *string `json:"idContainsFold,omitempty"` + // created_at field predicates + CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` + CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` + CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` + CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` + CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` + CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` + CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` + CreatedAtIsNil *bool `json:"createdAtIsNil,omitempty"` + CreatedAtNotNil *bool `json:"createdAtNotNil,omitempty"` + // updated_at field predicates + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` + UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` + UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` + UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` + UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` + UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` + UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` + UpdatedAtIsNil *bool `json:"updatedAtIsNil,omitempty"` + UpdatedAtNotNil *bool `json:"updatedAtNotNil,omitempty"` + // created_by field predicates + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByNeq *string `json:"createdByNEQ,omitempty"` + CreatedByIn []string `json:"createdByIn,omitempty"` + CreatedByNotIn []string `json:"createdByNotIn,omitempty"` + CreatedByGt *string `json:"createdByGT,omitempty"` + CreatedByGte *string `json:"createdByGTE,omitempty"` + CreatedByLt *string `json:"createdByLT,omitempty"` + CreatedByLte *string `json:"createdByLTE,omitempty"` + CreatedByContains *string `json:"createdByContains,omitempty"` + CreatedByHasPrefix *string `json:"createdByHasPrefix,omitempty"` + CreatedByHasSuffix *string `json:"createdByHasSuffix,omitempty"` + CreatedByIsNil *bool `json:"createdByIsNil,omitempty"` + CreatedByNotNil *bool `json:"createdByNotNil,omitempty"` + CreatedByEqualFold *string `json:"createdByEqualFold,omitempty"` + CreatedByContainsFold *string `json:"createdByContainsFold,omitempty"` + // updated_by field predicates + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedByNeq *string `json:"updatedByNEQ,omitempty"` + UpdatedByIn []string `json:"updatedByIn,omitempty"` + UpdatedByNotIn []string `json:"updatedByNotIn,omitempty"` + UpdatedByGt *string `json:"updatedByGT,omitempty"` + UpdatedByGte *string `json:"updatedByGTE,omitempty"` + UpdatedByLt *string `json:"updatedByLT,omitempty"` + UpdatedByLte *string `json:"updatedByLTE,omitempty"` + UpdatedByContains *string `json:"updatedByContains,omitempty"` + UpdatedByHasPrefix *string `json:"updatedByHasPrefix,omitempty"` + UpdatedByHasSuffix *string `json:"updatedByHasSuffix,omitempty"` + UpdatedByIsNil *bool `json:"updatedByIsNil,omitempty"` + UpdatedByNotNil *bool `json:"updatedByNotNil,omitempty"` + UpdatedByEqualFold *string `json:"updatedByEqualFold,omitempty"` + UpdatedByContainsFold *string `json:"updatedByContainsFold,omitempty"` + // deleted_at field predicates + DeletedAt *time.Time `json:"deletedAt,omitempty"` + DeletedAtNeq *time.Time `json:"deletedAtNEQ,omitempty"` + DeletedAtIn []*time.Time `json:"deletedAtIn,omitempty"` + DeletedAtNotIn []*time.Time `json:"deletedAtNotIn,omitempty"` + DeletedAtGt *time.Time `json:"deletedAtGT,omitempty"` + DeletedAtGte *time.Time `json:"deletedAtGTE,omitempty"` + DeletedAtLt *time.Time `json:"deletedAtLT,omitempty"` + DeletedAtLte *time.Time `json:"deletedAtLTE,omitempty"` + DeletedAtIsNil *bool `json:"deletedAtIsNil,omitempty"` + DeletedAtNotNil *bool `json:"deletedAtNotNil,omitempty"` + // deleted_by field predicates + DeletedBy *string `json:"deletedBy,omitempty"` + DeletedByNeq *string `json:"deletedByNEQ,omitempty"` + DeletedByIn []string `json:"deletedByIn,omitempty"` + DeletedByNotIn []string `json:"deletedByNotIn,omitempty"` + DeletedByGt *string `json:"deletedByGT,omitempty"` + DeletedByGte *string `json:"deletedByGTE,omitempty"` + DeletedByLt *string `json:"deletedByLT,omitempty"` + DeletedByLte *string `json:"deletedByLTE,omitempty"` + DeletedByContains *string `json:"deletedByContains,omitempty"` + DeletedByHasPrefix *string `json:"deletedByHasPrefix,omitempty"` + DeletedByHasSuffix *string `json:"deletedByHasSuffix,omitempty"` + DeletedByIsNil *bool `json:"deletedByIsNil,omitempty"` + DeletedByNotNil *bool `json:"deletedByNotNil,omitempty"` + DeletedByEqualFold *string `json:"deletedByEqualFold,omitempty"` + DeletedByContainsFold *string `json:"deletedByContainsFold,omitempty"` + // owner_id field predicates + OwnerID *string `json:"ownerID,omitempty"` + OwnerIDNeq *string `json:"ownerIDNEQ,omitempty"` + OwnerIDIn []string `json:"ownerIDIn,omitempty"` + OwnerIDNotIn []string `json:"ownerIDNotIn,omitempty"` + OwnerIDGt *string `json:"ownerIDGT,omitempty"` + OwnerIDGte *string `json:"ownerIDGTE,omitempty"` + OwnerIDLt *string `json:"ownerIDLT,omitempty"` + OwnerIDLte *string `json:"ownerIDLTE,omitempty"` + OwnerIDContains *string `json:"ownerIDContains,omitempty"` + OwnerIDHasPrefix *string `json:"ownerIDHasPrefix,omitempty"` + OwnerIDHasSuffix *string `json:"ownerIDHasSuffix,omitempty"` + OwnerIDIsNil *bool `json:"ownerIDIsNil,omitempty"` + OwnerIDNotNil *bool `json:"ownerIDNotNil,omitempty"` + OwnerIDEqualFold *string `json:"ownerIDEqualFold,omitempty"` + OwnerIDContainsFold *string `json:"ownerIDContainsFold,omitempty"` + // name field predicates + Name *string `json:"name,omitempty"` + NameNeq *string `json:"nameNEQ,omitempty"` + NameIn []string `json:"nameIn,omitempty"` + NameNotIn []string `json:"nameNotIn,omitempty"` + NameGt *string `json:"nameGT,omitempty"` + NameGte *string `json:"nameGTE,omitempty"` + NameLt *string `json:"nameLT,omitempty"` + NameLte *string `json:"nameLTE,omitempty"` + NameContains *string `json:"nameContains,omitempty"` + NameHasPrefix *string `json:"nameHasPrefix,omitempty"` + NameHasSuffix *string `json:"nameHasSuffix,omitempty"` + NameEqualFold *string `json:"nameEqualFold,omitempty"` + NameContainsFold *string `json:"nameContainsFold,omitempty"` + // destination_url field predicates + DestinationURL *string `json:"destinationURL,omitempty"` + DestinationURLNeq *string `json:"destinationURLNEQ,omitempty"` + DestinationURLIn []string `json:"destinationURLIn,omitempty"` + DestinationURLNotIn []string `json:"destinationURLNotIn,omitempty"` + DestinationURLGt *string `json:"destinationURLGT,omitempty"` + DestinationURLGte *string `json:"destinationURLGTE,omitempty"` + DestinationURLLt *string `json:"destinationURLLT,omitempty"` + DestinationURLLte *string `json:"destinationURLLTE,omitempty"` + DestinationURLContains *string `json:"destinationURLContains,omitempty"` + DestinationURLHasPrefix *string `json:"destinationURLHasPrefix,omitempty"` + DestinationURLHasSuffix *string `json:"destinationURLHasSuffix,omitempty"` + DestinationURLEqualFold *string `json:"destinationURLEqualFold,omitempty"` + DestinationURLContainsFold *string `json:"destinationURLContainsFold,omitempty"` + // enabled field predicates + Enabled *bool `json:"enabled,omitempty"` + EnabledNeq *bool `json:"enabledNEQ,omitempty"` + // failures field predicates + Failures *int64 `json:"failures,omitempty"` + FailuresNeq *int64 `json:"failuresNEQ,omitempty"` + FailuresIn []int64 `json:"failuresIn,omitempty"` + FailuresNotIn []int64 `json:"failuresNotIn,omitempty"` + FailuresGt *int64 `json:"failuresGT,omitempty"` + FailuresGte *int64 `json:"failuresGTE,omitempty"` + FailuresLt *int64 `json:"failuresLT,omitempty"` + FailuresLte *int64 `json:"failuresLTE,omitempty"` + FailuresIsNil *bool `json:"failuresIsNil,omitempty"` + FailuresNotNil *bool `json:"failuresNotNil,omitempty"` + // last_error field predicates + LastError *string `json:"lastError,omitempty"` + LastErrorNeq *string `json:"lastErrorNEQ,omitempty"` + LastErrorIn []string `json:"lastErrorIn,omitempty"` + LastErrorNotIn []string `json:"lastErrorNotIn,omitempty"` + LastErrorGt *string `json:"lastErrorGT,omitempty"` + LastErrorGte *string `json:"lastErrorGTE,omitempty"` + LastErrorLt *string `json:"lastErrorLT,omitempty"` + LastErrorLte *string `json:"lastErrorLTE,omitempty"` + LastErrorContains *string `json:"lastErrorContains,omitempty"` + LastErrorHasPrefix *string `json:"lastErrorHasPrefix,omitempty"` + LastErrorHasSuffix *string `json:"lastErrorHasSuffix,omitempty"` + LastErrorIsNil *bool `json:"lastErrorIsNil,omitempty"` + LastErrorNotNil *bool `json:"lastErrorNotNil,omitempty"` + LastErrorEqualFold *string `json:"lastErrorEqualFold,omitempty"` + LastErrorContainsFold *string `json:"lastErrorContainsFold,omitempty"` + // last_response field predicates + LastResponse *string `json:"lastResponse,omitempty"` + LastResponseNeq *string `json:"lastResponseNEQ,omitempty"` + LastResponseIn []string `json:"lastResponseIn,omitempty"` + LastResponseNotIn []string `json:"lastResponseNotIn,omitempty"` + LastResponseGt *string `json:"lastResponseGT,omitempty"` + LastResponseGte *string `json:"lastResponseGTE,omitempty"` + LastResponseLt *string `json:"lastResponseLT,omitempty"` + LastResponseLte *string `json:"lastResponseLTE,omitempty"` + LastResponseContains *string `json:"lastResponseContains,omitempty"` + LastResponseHasPrefix *string `json:"lastResponseHasPrefix,omitempty"` + LastResponseHasSuffix *string `json:"lastResponseHasSuffix,omitempty"` + LastResponseIsNil *bool `json:"lastResponseIsNil,omitempty"` + LastResponseNotNil *bool `json:"lastResponseNotNil,omitempty"` + LastResponseEqualFold *string `json:"lastResponseEqualFold,omitempty"` + LastResponseContainsFold *string `json:"lastResponseContainsFold,omitempty"` + // owner edge predicates + HasOwner *bool `json:"hasOwner,omitempty"` + HasOwnerWith []*OrganizationWhereInput `json:"hasOwnerWith,omitempty"` + // events edge predicates + HasEvents *bool `json:"hasEvents,omitempty"` + HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"` + // integrations edge predicates + HasIntegrations *bool `json:"hasIntegrations,omitempty"` + HasIntegrationsWith []*IntegrationWhereInput `json:"hasIntegrationsWith,omitempty"` +} + +// Properties by which EntityHistory connections can be ordered. +type EntityHistoryOrderField string + +const ( + EntityHistoryOrderFieldName EntityHistoryOrderField = "name" + EntityHistoryOrderFieldDisplayName EntityHistoryOrderField = "display_name" +) + +var AllEntityHistoryOrderField = []EntityHistoryOrderField{ + EntityHistoryOrderFieldName, + EntityHistoryOrderFieldDisplayName, +} + +func (e EntityHistoryOrderField) IsValid() bool { + switch e { + case EntityHistoryOrderFieldName, EntityHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e EntityHistoryOrderField) String() string { + return string(e) +} + +func (e *EntityHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityHistoryOrderField", str) + } + return nil +} + +func (e EntityHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Entity connections can be ordered. +type EntityOrderField string + +const ( + EntityOrderFieldName EntityOrderField = "name" + EntityOrderFieldDisplayName EntityOrderField = "display_name" +) + +var AllEntityOrderField = []EntityOrderField{ + EntityOrderFieldName, + EntityOrderFieldDisplayName, +} + +func (e EntityOrderField) IsValid() bool { + switch e { + case EntityOrderFieldName, EntityOrderFieldDisplayName: + return true + } + return false +} + +func (e EntityOrderField) String() string { + return string(e) +} + +func (e *EntityOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityOrderField", str) + } + return nil +} + +func (e EntityOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which EntityTypeHistory connections can be ordered. +type EntityTypeHistoryOrderField string + +const ( + EntityTypeHistoryOrderFieldName EntityTypeHistoryOrderField = "name" +) + +var AllEntityTypeHistoryOrderField = []EntityTypeHistoryOrderField{ + EntityTypeHistoryOrderFieldName, +} + +func (e EntityTypeHistoryOrderField) IsValid() bool { + switch e { + case EntityTypeHistoryOrderFieldName: + return true + } + return false +} + +func (e EntityTypeHistoryOrderField) String() string { + return string(e) +} + +func (e *EntityTypeHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityTypeHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityTypeHistoryOrderField", str) + } + return nil +} + +func (e EntityTypeHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which EntityType connections can be ordered. +type EntityTypeOrderField string + +const ( + EntityTypeOrderFieldName EntityTypeOrderField = "name" +) + +var AllEntityTypeOrderField = []EntityTypeOrderField{ + EntityTypeOrderFieldName, +} + +func (e EntityTypeOrderField) IsValid() bool { + switch e { + case EntityTypeOrderFieldName: + return true + } + return false +} + +func (e EntityTypeOrderField) String() string { + return string(e) +} + +func (e *EntityTypeOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = EntityTypeOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid EntityTypeOrderField", str) + } + return nil +} + +func (e EntityTypeOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which GroupHistory connections can be ordered. +type GroupHistoryOrderField string + +const ( + GroupHistoryOrderFieldName GroupHistoryOrderField = "name" + GroupHistoryOrderFieldDisplayName GroupHistoryOrderField = "display_name" +) + +var AllGroupHistoryOrderField = []GroupHistoryOrderField{ + GroupHistoryOrderFieldName, + GroupHistoryOrderFieldDisplayName, +} + +func (e GroupHistoryOrderField) IsValid() bool { + switch e { + case GroupHistoryOrderFieldName, GroupHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e GroupHistoryOrderField) String() string { + return string(e) +} + +func (e *GroupHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GroupHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid GroupHistoryOrderField", str) + } + return nil +} + +func (e GroupHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Group connections can be ordered. +type GroupOrderField string + +const ( + GroupOrderFieldName GroupOrderField = "name" + GroupOrderFieldDisplayName GroupOrderField = "display_name" +) + +var AllGroupOrderField = []GroupOrderField{ + GroupOrderFieldName, + GroupOrderFieldDisplayName, +} + +func (e GroupOrderField) IsValid() bool { + switch e { + case GroupOrderFieldName, GroupOrderFieldDisplayName: + return true + } + return false +} + +func (e GroupOrderField) String() string { + return string(e) +} + +func (e *GroupOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GroupOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid GroupOrderField", str) + } + return nil +} + +func (e GroupOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which HushHistory connections can be ordered. +type HushHistoryOrderField string + +const ( + HushHistoryOrderFieldName HushHistoryOrderField = "name" + HushHistoryOrderFieldKind HushHistoryOrderField = "kind" +) + +var AllHushHistoryOrderField = []HushHistoryOrderField{ + HushHistoryOrderFieldName, + HushHistoryOrderFieldKind, +} + +func (e HushHistoryOrderField) IsValid() bool { + switch e { + case HushHistoryOrderFieldName, HushHistoryOrderFieldKind: + return true + } + return false +} + +func (e HushHistoryOrderField) String() string { + return string(e) +} + +func (e *HushHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = HushHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid HushHistoryOrderField", str) + } + return nil +} + +func (e HushHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Hush connections can be ordered. +type HushOrderField string + +const ( + HushOrderFieldName HushOrderField = "name" + HushOrderFieldKind HushOrderField = "kind" +) + +var AllHushOrderField = []HushOrderField{ + HushOrderFieldName, + HushOrderFieldKind, +} + +func (e HushOrderField) IsValid() bool { + switch e { + case HushOrderFieldName, HushOrderFieldKind: + return true + } + return false +} + +func (e HushOrderField) String() string { + return string(e) +} + +func (e *HushOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = HushOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid HushOrderField", str) + } + return nil +} + +func (e HushOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which IntegrationHistory connections can be ordered. +type IntegrationHistoryOrderField string + +const ( + IntegrationHistoryOrderFieldName IntegrationHistoryOrderField = "name" + IntegrationHistoryOrderFieldKind IntegrationHistoryOrderField = "kind" +) + +var AllIntegrationHistoryOrderField = []IntegrationHistoryOrderField{ + IntegrationHistoryOrderFieldName, + IntegrationHistoryOrderFieldKind, +} + +func (e IntegrationHistoryOrderField) IsValid() bool { + switch e { + case IntegrationHistoryOrderFieldName, IntegrationHistoryOrderFieldKind: + return true + } + return false +} + +func (e IntegrationHistoryOrderField) String() string { + return string(e) +} + +func (e *IntegrationHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = IntegrationHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid IntegrationHistoryOrderField", str) + } + return nil +} + +func (e IntegrationHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Integration connections can be ordered. +type IntegrationOrderField string + +const ( + IntegrationOrderFieldName IntegrationOrderField = "name" + IntegrationOrderFieldKind IntegrationOrderField = "kind" +) + +var AllIntegrationOrderField = []IntegrationOrderField{ + IntegrationOrderFieldName, + IntegrationOrderFieldKind, +} + +func (e IntegrationOrderField) IsValid() bool { + switch e { + case IntegrationOrderFieldName, IntegrationOrderFieldKind: + return true + } + return false +} + +func (e IntegrationOrderField) String() string { + return string(e) +} + +func (e *IntegrationOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = IntegrationOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid IntegrationOrderField", str) + } + return nil +} + +func (e IntegrationOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Possible directions in which to order a list of items when provided an `orderBy` argument. +type OrderDirection string + +const ( + // Specifies an ascending order for a given `orderBy` argument. + OrderDirectionAsc OrderDirection = "ASC" + // Specifies a descending order for a given `orderBy` argument. + OrderDirectionDesc OrderDirection = "DESC" +) + +var AllOrderDirection = []OrderDirection{ + OrderDirectionAsc, + OrderDirectionDesc, +} + +func (e OrderDirection) IsValid() bool { + switch e { + case OrderDirectionAsc, OrderDirectionDesc: + return true + } + return false +} + +func (e OrderDirection) String() string { + return string(e) +} + +func (e *OrderDirection) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = OrderDirection(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid OrderDirection", str) + } + return nil +} + +func (e OrderDirection) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which OrganizationHistory connections can be ordered. +type OrganizationHistoryOrderField string + +const ( + OrganizationHistoryOrderFieldName OrganizationHistoryOrderField = "name" + OrganizationHistoryOrderFieldDisplayName OrganizationHistoryOrderField = "display_name" +) + +var AllOrganizationHistoryOrderField = []OrganizationHistoryOrderField{ + OrganizationHistoryOrderFieldName, + OrganizationHistoryOrderFieldDisplayName, +} + +func (e OrganizationHistoryOrderField) IsValid() bool { + switch e { + case OrganizationHistoryOrderFieldName, OrganizationHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e OrganizationHistoryOrderField) String() string { + return string(e) +} + +func (e *OrganizationHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = OrganizationHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid OrganizationHistoryOrderField", str) + } + return nil +} + +func (e OrganizationHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Organization connections can be ordered. +type OrganizationOrderField string + +const ( + OrganizationOrderFieldName OrganizationOrderField = "name" + OrganizationOrderFieldDisplayName OrganizationOrderField = "display_name" +) + +var AllOrganizationOrderField = []OrganizationOrderField{ + OrganizationOrderFieldName, + OrganizationOrderFieldDisplayName, +} + +func (e OrganizationOrderField) IsValid() bool { + switch e { + case OrganizationOrderFieldName, OrganizationOrderFieldDisplayName: + return true + } + return false +} + +func (e OrganizationOrderField) String() string { + return string(e) +} + +func (e *OrganizationOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = OrganizationOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid OrganizationOrderField", str) + } + return nil +} + +func (e OrganizationOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which TemplateHistory connections can be ordered. +type TemplateHistoryOrderField string + +const ( + TemplateHistoryOrderFieldName TemplateHistoryOrderField = "name" +) + +var AllTemplateHistoryOrderField = []TemplateHistoryOrderField{ + TemplateHistoryOrderFieldName, +} + +func (e TemplateHistoryOrderField) IsValid() bool { + switch e { + case TemplateHistoryOrderFieldName: + return true + } + return false +} + +func (e TemplateHistoryOrderField) String() string { + return string(e) +} + +func (e *TemplateHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = TemplateHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid TemplateHistoryOrderField", str) + } + return nil +} + +func (e TemplateHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Template connections can be ordered. +type TemplateOrderField string + +const ( + TemplateOrderFieldName TemplateOrderField = "name" +) + +var AllTemplateOrderField = []TemplateOrderField{ + TemplateOrderFieldName, +} + +func (e TemplateOrderField) IsValid() bool { + switch e { + case TemplateOrderFieldName: + return true + } + return false +} + +func (e TemplateOrderField) String() string { + return string(e) +} + +func (e *TemplateOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = TemplateOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid TemplateOrderField", str) + } + return nil +} + +func (e TemplateOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which UserHistory connections can be ordered. +type UserHistoryOrderField string + +const ( + UserHistoryOrderFieldFirstName UserHistoryOrderField = "first_name" + UserHistoryOrderFieldLastName UserHistoryOrderField = "last_name" + UserHistoryOrderFieldDisplayName UserHistoryOrderField = "display_name" +) + +var AllUserHistoryOrderField = []UserHistoryOrderField{ + UserHistoryOrderFieldFirstName, + UserHistoryOrderFieldLastName, + UserHistoryOrderFieldDisplayName, +} + +func (e UserHistoryOrderField) IsValid() bool { + switch e { + case UserHistoryOrderFieldFirstName, UserHistoryOrderFieldLastName, UserHistoryOrderFieldDisplayName: + return true + } + return false +} + +func (e UserHistoryOrderField) String() string { + return string(e) +} + +func (e *UserHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = UserHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid UserHistoryOrderField", str) + } + return nil +} + +func (e UserHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which User connections can be ordered. +type UserOrderField string + +const ( + UserOrderFieldFirstName UserOrderField = "first_name" + UserOrderFieldLastName UserOrderField = "last_name" + UserOrderFieldDisplayName UserOrderField = "display_name" +) + +var AllUserOrderField = []UserOrderField{ + UserOrderFieldFirstName, + UserOrderFieldLastName, + UserOrderFieldDisplayName, +} + +func (e UserOrderField) IsValid() bool { + switch e { + case UserOrderFieldFirstName, UserOrderFieldLastName, UserOrderFieldDisplayName: + return true + } + return false +} + +func (e UserOrderField) String() string { + return string(e) +} + +func (e *UserOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = UserOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid UserOrderField", str) + } + return nil +} + +func (e UserOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which WebhookHistory connections can be ordered. +type WebhookHistoryOrderField string + +const ( + WebhookHistoryOrderFieldName WebhookHistoryOrderField = "name" + WebhookHistoryOrderFieldURL WebhookHistoryOrderField = "url" +) + +var AllWebhookHistoryOrderField = []WebhookHistoryOrderField{ + WebhookHistoryOrderFieldName, + WebhookHistoryOrderFieldURL, +} + +func (e WebhookHistoryOrderField) IsValid() bool { + switch e { + case WebhookHistoryOrderFieldName, WebhookHistoryOrderFieldURL: + return true + } + return false +} + +func (e WebhookHistoryOrderField) String() string { + return string(e) +} + +func (e *WebhookHistoryOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = WebhookHistoryOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid WebhookHistoryOrderField", str) + } + return nil +} + +func (e WebhookHistoryOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Properties by which Webhook connections can be ordered. +type WebhookOrderField string + +const ( + WebhookOrderFieldName WebhookOrderField = "name" + WebhookOrderFieldURL WebhookOrderField = "url" +) + +var AllWebhookOrderField = []WebhookOrderField{ + WebhookOrderFieldName, + WebhookOrderFieldURL, +} + +func (e WebhookOrderField) IsValid() bool { + switch e { + case WebhookOrderFieldName, WebhookOrderFieldURL: + return true + } + return false +} + +func (e WebhookOrderField) String() string { + return string(e) +} + +func (e *WebhookOrderField) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = WebhookOrderField(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid WebhookOrderField", str) + } + return nil +} + +func (e WebhookOrderField) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} diff --git a/pkg/openlaneclient/options.go b/pkg/openlaneclient/options.go new file mode 100644 index 0000000..30031ec --- /dev/null +++ b/pkg/openlaneclient/options.go @@ -0,0 +1,94 @@ +package openlaneclient + +import ( + "net/http" + "net/url" + + "github.com/Yamashou/gqlgenc/clientv2" + + "github.com/theopenlane/httpsling" +) + +// ClientOption allows us to configure the APIv1 client when it is created +type ClientOption func(c *APIv1) error + +// WithClient sets the client for the APIv1 client +func WithClient(client *httpsling.Client) ClientOption { + return func(c *APIv1) error { + c.HTTPSlingClient = client + return nil + } +} + +// WithCredentials sets the credentials for the APIv1 client +func WithCredentials(creds Credentials) ClientOption { + return func(c *APIv1) error { + c.Config.Credentials = creds + + // If the credentials are set, we should also set the token for graph interceptor + auth, err := NewAuthorization(creds) + if err != nil { + return err + } + + c.Config.Interceptors = append(c.Config.Interceptors, auth.WithAuthorization()) + + // Set the bearer token for the HTTPSling client, used for REST requests + c.Config.HTTPSling.Headers.Set(httpsling.HeaderAuthorization, "Bearer "+auth.BearerToken) + + return nil + } +} + +// WithHTTPSlingConfig sets the config for the APIv1 client +func WithHTTPSlingConfig(config *httpsling.Config) ClientOption { + return func(c *APIv1) error { + c.Config.HTTPSling = config + return nil + } +} + +// WithInterceptors sets the interceptors for the APIv1 client +func WithInterceptors(interceptors clientv2.RequestInterceptor) ClientOption { + return func(c *APIv1) error { + c.Config.Interceptors = []clientv2.RequestInterceptor{interceptors} + return nil + } +} + +// WithClientV2Option sets the clientv2 options for the APIv1 client +func WithClientV2Option(option clientv2.Options) ClientOption { + return func(c *APIv1) error { + c.Config.Clientv2Options = option + return nil + } +} + +// WithGraphQueryEndpoint sets the graph query endpoint for the APIv1 client +func WithGraphQueryEndpoint(endpoint string) ClientOption { + return func(c *APIv1) error { + c.Config.GraphQLPath = endpoint + return nil + } +} + +// WithBaseURL sets the base URL for the APIv1 client +func WithBaseURL(baseURL *url.URL) ClientOption { + return func(c *APIv1) error { + // Set the base URL for the APIv1 client + c.Config.BaseURL = baseURL + + // Set the base URL for the HTTPSling client + c.Config.HTTPSling.BaseURL = baseURL.String() + + return nil + } +} + +// WithTransport sets the transport for the APIv1 client +func WithTransport(transport http.RoundTripper) ClientOption { + return func(c *APIv1) error { + c.Config.HTTPSling.Transport = transport + return nil + } +} diff --git a/pkg/openlaneclient/restclient.go b/pkg/openlaneclient/restclient.go new file mode 100644 index 0000000..78cb35b --- /dev/null +++ b/pkg/openlaneclient/restclient.go @@ -0,0 +1,267 @@ +package openlaneclient + +import ( + "context" + "net/http" + + "github.com/theopenlane/core/pkg/models" +) + +// OpenLaneRestClient is the interface that wraps the OpenLane API REST client methods +type OpenLaneRestClient interface { + // Register a new user with the API + Register(context.Context, *models.RegisterRequest) (*models.RegisterReply, error) + // Login to the API + Login(context.Context, *models.LoginRequest) (*models.LoginReply, error) + // Refresh a user's access token + Refresh(context.Context, *models.RefreshRequest) (*models.RefreshReply, error) + // Switch the current organization context + Switch(context.Context, *models.SwitchOrganizationRequest) (*models.SwitchOrganizationReply, error) + // VerifyEmail verifies the email address of a user + VerifyEmail(context.Context, *models.VerifyRequest) (*models.VerifyReply, error) + // ResendEmail re-sends the verification email to the user + ResendEmail(context.Context, *models.ResendRequest) (*models.ResendReply, error) + // ForgotPassword sends a password reset email to the user + ForgotPassword(context.Context, *models.ForgotPasswordRequest) (*models.ForgotPasswordReply, error) + // ResetPassword resets the user's password + ResetPassword(context.Context, *models.ResetPasswordRequest) (*models.ResetPasswordReply, error) + // AcceptInvite accepts an invite to join an organization + AcceptInvite(context.Context, *models.InviteRequest) (*models.InviteReply, error) +} + +// New creates a new API v1 client that implements the OpenLane Client interface +func NewRestClient(config Config, opts ...ClientOption) (_ OpenLaneRestClient, err error) { + c := &APIv1{ + Config: config, + } + + // Apply our options + for _, opt := range opts { + if err := opt(c); err != nil { + return nil, err + } + } + + // create the HTTP sling client if it is not set + if c.HTTPSlingClient == nil { + c.HTTPSlingClient, err = newHTTPClient(c.Config) + if err != nil { + return nil, err + } + } + + return c, nil +} + +// Ensure the APIv1 implements the OpenLaneClient interface +var _ OpenLaneRestClient = &APIv1{} + +// Register a new user with the API +func (s *APIv1) Register(ctx context.Context, in *models.RegisterRequest) (out *models.RegisterReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodPost, "/v1/register") + req.Body(in) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newRequestError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// Login to the API +func (s *APIv1) Login(ctx context.Context, in *models.LoginRequest) (out *models.LoginReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodPost, "/v1/login") + req.Body(in) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newAuthenticationError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// Refresh a user's access token +func (s *APIv1) Refresh(ctx context.Context, in *models.RefreshRequest) (out *models.RefreshReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodPost, "/v1/refresh") + req.Body(in) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newAuthenticationError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// Switch the current organization context +func (s *APIv1) Switch(ctx context.Context, in *models.SwitchOrganizationRequest) (out *models.SwitchOrganizationReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodPost, "/v1/switch") + req.Body(in) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newAuthenticationError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// VerifyEmail verifies the email address of a user +func (s *APIv1) VerifyEmail(ctx context.Context, in *models.VerifyRequest) (out *models.VerifyReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodGet, "/v1/verify") + req.Query("token", in.Token) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newRequestError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// ResendEmail resends the verification email to the user +func (s *APIv1) ResendEmail(ctx context.Context, in *models.ResendRequest) (out *models.ResendReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodPost, "/v1/resend") + req.Body(in) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newRequestError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// ForgotPassword sends a password reset email to the user +func (s *APIv1) ForgotPassword(ctx context.Context, in *models.ForgotPasswordRequest) (out *models.ForgotPasswordReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodPost, "/v1/forgot-password") + req.Body(in) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newRequestError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// ResetPassword resets the user's password +func (s *APIv1) ResetPassword(ctx context.Context, in *models.ResetPasswordRequest) (out *models.ResetPasswordReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodPost, "/v1/password-reset") + req.Body(in) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newRequestError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// AcceptInvite accepts an invite to join an organization +func (s *APIv1) AcceptInvite(ctx context.Context, in *models.InviteRequest) (out *models.InviteReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodGet, "/v1/invite") + req.Query("token", in.Token) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newRequestError(resp.StatusCode(), out.Error) + } + + return out, nil +} + +// VerifySubscriberEmail verifies the email address of a subscriber +func (s *APIv1) VerifySubscriberEmail(ctx context.Context, in *models.VerifySubscribeRequest) (out *models.VerifySubscribeReply, err error) { + req := s.HTTPSlingClient.NewRequestBuilder(http.MethodGet, "/v1/subscribe/verify") + req.Query("token", in.Token) + + resp, err := req.Send(ctx) + if err != nil { + return nil, err + } + + if err := resp.ScanJSON(&out); err != nil { + return nil, err + } + + if !resp.IsSuccess() { + return nil, newRequestError(resp.StatusCode(), out.Error) + } + + return out, nil +} diff --git a/pkg/passwd/dk.go b/pkg/passwd/dk.go index 411fea5..2ec68f7 100644 --- a/pkg/passwd/dk.go +++ b/pkg/passwd/dk.go @@ -60,7 +60,7 @@ func VerifyDerivedKey(dk, password string) (bool, error) { return false, err } - vdk := argon2.IDKey([]byte(password), salt, t, m, p, uint32(len(dkb))) + vdk := argon2.IDKey([]byte(password), salt, t, m, p, uint32(len(dkb))) // nolint:gosec return bytes.Equal(dkb, vdk), nil } @@ -97,19 +97,19 @@ func ParseDerivedKey(encoded string) (dk, salt []byte, time, memory uint32, thre return nil, nil, 0, 0, 0, newParseError("memory", parts[3], err.Error()) } - memory = uint32(memory64) + memory = uint32(memory64) // nolint:gosec if time64, err = strconv.ParseUint(parts[4], 10, 32); err != nil { return nil, nil, 0, 0, 0, newParseError("time", parts[4], err.Error()) } - time = uint32(time64) + time = uint32(time64) // nolint:gosec if threads64, err = strconv.ParseUint(parts[5], 10, 8); err != nil { return nil, nil, 0, 0, 0, newParseError("threads", parts[5], err.Error()) } - threads = uint8(threads64) + threads = uint8(threads64) // nolint:gosec if salt, err = base64.StdEncoding.DecodeString(parts[6]); err != nil { return nil, nil, 0, 0, 0, newParseError("salt", parts[6], err.Error()) diff --git a/pkg/testutils/client.go b/pkg/testutils/client.go new file mode 100644 index 0000000..0e8285d --- /dev/null +++ b/pkg/testutils/client.go @@ -0,0 +1,130 @@ +package testutils + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/handler/extension" + "github.com/99designs/gqlgen/graphql/handler/lru" + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/graphapi" + "github.com/theopenlane/core/pkg/middleware/auth" + "github.com/theopenlane/core/pkg/middleware/echocontext" + "github.com/theopenlane/core/pkg/openlaneclient" + echo "github.com/theopenlane/echox" + "go.uber.org/zap" + "go.uber.org/zap/zaptest" +) + +// localRoundTripper is an http.RoundTripper that executes HTTP transactions +// by using handler directly, instead of going over an HTTP connection. +type localRoundTripper struct { + server *echo.Echo +} + +func (l localRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + w := httptest.NewRecorder() + l.server.ServeHTTP(w, req) + + return w.Result(), nil +} + +// TestClient creates a new OpenLaneClient for testing +func TestClient(t *testing.T, c *generated.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenLaneClient, error) { + e := testEchoServer(t, c, false) + + // setup interceptors + if opts == nil { + opts = []openlaneclient.ClientOption{} + } + + opts = append(opts, openlaneclient.WithTransport(localRoundTripper{server: e})) + + config := openlaneclient.NewDefaultConfig() + + return openlaneclient.New(config, opts...) +} + +// TestClientWithAuth creates a new OpenLaneClient for testing that includes the auth middleware +func TestClientWithAuth(t *testing.T, c *generated.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenLaneClient, error) { + e := testEchoServer(t, c, true) + + // setup interceptors + if opts == nil { + opts = []openlaneclient.ClientOption{} + } + + opts = append(opts, openlaneclient.WithTransport(localRoundTripper{server: e})) + + config := openlaneclient.NewDefaultConfig() + + return openlaneclient.New(config, opts...) +} + +// testEchoServer creates a new echo server for testing the graph api +// and optionally includes the middleware for authentication testing +func testEchoServer(t *testing.T, c *generated.Client, includeMiddleware bool) *echo.Echo { + srv := testGraphServer(t, c) + + e := echo.New() + + if includeMiddleware { + e.Use(echocontext.EchoContextToContextMiddleware()) + e.Use(auth.Authenticate(createAuthConfig(c))) + } + + e.POST("/query", func(c echo.Context) error { + req := c.Request() + res := c.Response() + + srv.ServeHTTP(res, req) + + return nil + }) + + return e +} + +// createAuthConfig creates a new auth config for testing with the provided client +// and local validator +func createAuthConfig(c *generated.Client) *auth.AuthOptions { + // setup auth middleware + opts := []auth.AuthOption{ + auth.WithDBClient(c), + } + + authConfig := auth.NewAuthOptions(opts...) + + authConfig.WithLocalValidator() + + return &authConfig +} + +// testGraphServer creates a new graphql server for testing the graph api +func testGraphServer(t *testing.T, c *generated.Client) *handler.Server { + logger := zaptest.NewLogger(t, zaptest.Level(zap.ErrorLevel)).Sugar() + + srv := handler.NewDefaultServer( + graphapi.NewExecutableSchema( + graphapi.Config{Resolvers: graphapi.NewResolver(c).WithLogger(logger)}, + )) + + // lower the cache size for testing + srv.SetQueryCache(lru.New(1000)) + + srv.Use(extension.AutomaticPersistedQuery{ + Cache: lru.New(100), //nolint:mnd + }) + + // add all extension to the server + graphapi.AddAllExtensions(srv) + + graphapi.WithTransactions(srv, c) + + // if you do not want sleeps (the writer prefers naps anyways), skip cache + graphapi.WithSkipCache(srv) + + return srv +} diff --git a/pkg/tokens/claims_test.go b/pkg/tokens/claims_test.go index 921711c..bb4e939 100644 --- a/pkg/tokens/claims_test.go +++ b/pkg/tokens/claims_test.go @@ -5,8 +5,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/theopenlane/core/pkg/tokens" "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/pkg/tokens" ) func TestClaimsParseOrgID(t *testing.T) { diff --git a/pkg/tokens/tokens_test.go b/pkg/tokens/tokens_test.go index 0252b94..c9d9b65 100644 --- a/pkg/tokens/tokens_test.go +++ b/pkg/tokens/tokens_test.go @@ -10,8 +10,9 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/theopenlane/core/pkg/tokens" "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/pkg/tokens" ) const ( diff --git a/pkg/tokens/urltokens_test.go b/pkg/tokens/urltokens_test.go index de0a1a2..539ae85 100644 --- a/pkg/tokens/urltokens_test.go +++ b/pkg/tokens/urltokens_test.go @@ -7,8 +7,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/theopenlane/core/pkg/tokens" ulids "github.com/theopenlane/utils/ulids" + + "github.com/theopenlane/core/pkg/tokens" ) var rusty = "rusty.shackleford@gmail.com" diff --git a/pkg/tokens/validator.go b/pkg/tokens/validator.go index addef0f..d3820ae 100644 --- a/pkg/tokens/validator.go +++ b/pkg/tokens/validator.go @@ -7,7 +7,7 @@ import ( ) // Validator are able to verify that access and refresh tokens were issued by -// Datum and that their claims are valid (e.g. not expired). +// OpenLane and that their claims are valid (e.g. not expired). type Validator interface { // Verify an access or a refresh token after parsing and return its claims Verify(tks string) (claims *Claims, err error) diff --git a/pkg/transaction/doc.go b/pkg/transaction/doc.go new file mode 100644 index 0000000..cc06795 --- /dev/null +++ b/pkg/transaction/doc.go @@ -0,0 +1,2 @@ +// Package transaction implements a transaction middleware for REST endpoints using the ent db client +package transaction diff --git a/pkg/transaction/transaction.go b/pkg/transaction/transaction.go new file mode 100644 index 0000000..2fdfdf4 --- /dev/null +++ b/pkg/transaction/transaction.go @@ -0,0 +1,80 @@ +package transaction + +import ( + "context" + "errors" + "net/http" + + echo "github.com/theopenlane/echox" + "go.uber.org/zap" + + ent "github.com/theopenlane/core/internal/ent/generated" +) + +const ( + rollbackErr = "error rolling back transaction" + transactionStartErr = "error starting transaction" + transactionCommitErr = "error committing transaction" +) + +var ( + // ErrProcessingRequest is returned when the request cannot be processed + ErrProcessingRequest = errors.New("error processing request, please try again") +) + +type Client struct { + EntDBClient *ent.Client + Logger *zap.SugaredLogger +} + +type entClientCtxKey struct{} + +// FromContext returns a TX Client stored inside a context, or nil if there isn't one +func FromContext(ctx context.Context) *ent.Tx { + c, _ := ctx.Value(entClientCtxKey{}).(*ent.Tx) + return c +} + +// NewContext returns a new context with the given TX Client attached +func NewContext(parent context.Context, c *ent.Tx) context.Context { + return context.WithValue(parent, entClientCtxKey{}, c) +} + +// Middleware returns a middleware function for transactions on REST endpoints +func (d *Client) Middleware(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + client, err := d.EntDBClient.Tx(c.Request().Context()) + if err != nil { + d.Logger.Errorw(transactionStartErr, "error", err) + + return c.JSON(http.StatusInternalServerError, ErrProcessingRequest) + } + + // add to context + ctx := NewContext(c.Request().Context(), client) + + c.SetRequest(c.Request().WithContext(ctx)) + + if err := next(c); err != nil { + d.Logger.Debug("rolling back transaction in middleware") + + if err := client.Rollback(); err != nil { + d.Logger.Errorw(rollbackErr, "error", err) + + return c.JSON(http.StatusInternalServerError, ErrProcessingRequest) + } + + return err + } + + d.Logger.Debug("committing transaction in middleware") + + if err := client.Commit(); err != nil { + d.Logger.Errorw(transactionCommitErr, "error", err) + + return c.JSON(http.StatusInternalServerError, ErrProcessingRequest) + } + + return nil + } +} diff --git a/pkg/utils/cli/useragent/doc.go b/pkg/utils/cli/useragent/doc.go new file mode 100644 index 0000000..e9bce63 --- /dev/null +++ b/pkg/utils/cli/useragent/doc.go @@ -0,0 +1,2 @@ +// Package useragent is a utility package for generating the user agent string for the CLI +package useragent diff --git a/pkg/utils/cli/useragent/useragent.go b/pkg/utils/cli/useragent/useragent.go new file mode 100644 index 0000000..977fc55 --- /dev/null +++ b/pkg/utils/cli/useragent/useragent.go @@ -0,0 +1,19 @@ +package useragent + +import ( + "fmt" + "runtime" + + "github.com/theopenlane/core/internal/constants" +) + +// GetUserAgent returns the user agent string for the CLI +func GetUserAgent() string { + product := "openlane-cli" + productVersion := constants.CLIVersion + + userAgent := fmt.Sprintf("%s/%s (%s) %s (%s)", + product, productVersion, runtime.GOOS, runtime.GOARCH, runtime.Version()) + + return userAgent +} diff --git a/query/.gitkeep b/query/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/query/apitoken.graphql b/query/apitoken.graphql new file mode 100644 index 0000000..80d4d56 --- /dev/null +++ b/query/apitoken.graphql @@ -0,0 +1,89 @@ +mutation CreateAPIToken($input: CreateAPITokenInput!) { + createAPIToken(input: $input) { + apiToken { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } +} + +mutation UpdateAPIToken($updateAPITokenId: ID!, $input: UpdateAPITokenInput!) { + updateAPIToken(id: $updateAPITokenId, input: $input) { + apiToken { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } +} + +query GetAllAPITokens { + apiTokens { + edges { + node { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } + } + } +} + +query GetAPITokenByID($apiTokenId: ID!) { + apiToken(id: $apiTokenId) { + id + token + scopes + owner { + id + } + createdAt + updatedAt + createdBy + updatedBy + name + expiresAt + description + lastUsedAt + } +} + +mutation DeleteAPIToken($deleteAPITokenId: ID!) { + deleteAPIToken(id: $deleteAPITokenId) { + deletedID + } +} diff --git a/query/contact.graphql b/query/contact.graphql new file mode 100644 index 0000000..afd207c --- /dev/null +++ b/query/contact.graphql @@ -0,0 +1,153 @@ + +mutation CreateBulkCSVContact($input: Upload!) { + createBulkCSVContact(input: $input) { + contacts { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} + +mutation CreateBulkContact($input: [CreateContactInput!]) { + createBulkContact(input: $input) { + contacts { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} + +mutation CreateContact($input: CreateContactInput!) { + createContact(input: $input) { + contact { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} + +mutation DeleteContact($deleteContactId: ID!) { + deleteContact(id: $deleteContactId) { + deletedID + } +} + +query GetAllContacts { + contacts { + edges { + node { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } + } +} +query GetContactByID($contactId: ID!) { + contact(id: $contactId) { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } +} + +query GetContacts($where: ContactWhereInput) { + contacts(where: $where) { + edges { + node { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } + } +} +mutation UpdateContact($updateContactId: ID!, $input: UpdateContactInput!) { + updateContact(id: $updateContactId, input: $input) { + contact { + address + company + createdAt + createdBy + email + fullName + id + ownerID + phoneNumber + status + tags + title + updatedAt + updatedBy + } + } +} diff --git a/query/contacthistory.graphql b/query/contacthistory.graphql new file mode 100644 index 0000000..b841046 --- /dev/null +++ b/query/contacthistory.graphql @@ -0,0 +1,51 @@ +query GetAllContactHistories { + contactHistories { + edges { + node { + address + company + createdAt + createdBy + email + fullName + historyTime + id + operation + ownerID + phoneNumber + ref + status + tags + title + updatedAt + updatedBy + } + } + } +} + +query GetContactHistories($where: ContactHistoryWhereInput) { + contactHistories(where: $where) { + edges { + node { + address + company + createdAt + createdBy + email + fullName + historyTime + id + operation + ownerID + phoneNumber + ref + status + tags + title + updatedAt + updatedBy + } + } + } +} diff --git a/query/documentdata.graphql b/query/documentdata.graphql new file mode 100644 index 0000000..5b15bf4 --- /dev/null +++ b/query/documentdata.graphql @@ -0,0 +1,45 @@ +mutation CreateDocumentData($input: CreateDocumentDataInput!) { + createDocumentData(input: $input) { + documentData { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } + } +} + +mutation DeleteDocumentData($deleteDocumentDataId: ID!) { + deleteDocumentData(id: $deleteDocumentDataId) { + deletedID + } +} + +query GetDocumentDataByID($documentDataId: ID!) { + documentData(id: $documentDataId) { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } +} + +mutation UpdateDocumentData($updateDocumentDataId: ID!, $input: UpdateDocumentDataInput!) { + updateDocumentData(id: $updateDocumentDataId, input: $input) { + documentData { + id + templateID + data + createdAt + createdBy + updatedAt + updatedBy + } + } +} diff --git a/query/documentdatahistory.graphql b/query/documentdatahistory.graphql new file mode 100644 index 0000000..ffa45c7 --- /dev/null +++ b/query/documentdatahistory.graphql @@ -0,0 +1,43 @@ + + +query GetAllDocumentDataHistories { + documentDataHistories { + edges { + node { + createdAt + createdBy + data + historyTime + id + operation + ownerID + ref + tags + templateID + updatedAt + updatedBy + } + } + } +} + +query GetDocumentDataHistories($where: DocumentDataHistoryWhereInput) { + documentDataHistories(where: $where) { + edges { + node { + createdAt + createdBy + data + historyTime + id + operation + ownerID + ref + tags + templateID + updatedAt + updatedBy + } + } + } +} diff --git a/query/entitlement.graphql b/query/entitlement.graphql new file mode 100644 index 0000000..717aad2 --- /dev/null +++ b/query/entitlement.graphql @@ -0,0 +1,171 @@ +mutation CreateBulkCSVEntitlement($input: Upload!) { + createBulkCSVEntitlement(input: $input) { + entitlements { + id + plan { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + organization { + id + name + } + } + } +} + +mutation CreateBulkEntitlement($input: [CreateEntitlementInput!]) { + createBulkEntitlement(input: $input) { + entitlements { + id + plan { + id + name + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} + +mutation CreateEntitlement($input: CreateEntitlementInput!) { + createEntitlement(input: $input) { + entitlement { + id + plan { + id + name + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} + +mutation DeleteEntitlement($deleteEntitlementId: ID!) { + deleteEntitlement(id: $deleteEntitlementId) { + deletedID + } +} + +query GetAllEntitlements { + entitlements { + edges { + node { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } + } +} + +query GetEntitlementByID($entitlementId: ID!) { + entitlement(id: $entitlementId) { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } +} + +query GetEntitlements($where: EntitlementWhereInput) { + entitlements(where: $where) { + edges { + node { + id + plan { + id + name + features { + metadata + feature { + id + name + } + } + } + organization { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } + } +} + +mutation UpdateEntitlement($updateEntitlementId: ID!, $input: UpdateEntitlementInput!) { + updateEntitlement(id: $updateEntitlementId, input: $input) { + entitlement { + id + plan { + id + name + } + expires + expiresAt + cancelled + externalCustomerID + externalSubscriptionID + } + } +} diff --git a/query/entitlementhistory.graphql b/query/entitlementhistory.graphql new file mode 100644 index 0000000..7b5586f --- /dev/null +++ b/query/entitlementhistory.graphql @@ -0,0 +1,51 @@ +query GetAllEntitlementHistories { + entitlementHistories { + edges { + node { + cancelled + createdAt + createdBy + expires + expiresAt + externalCustomerID + externalSubscriptionID + historyTime + id + operation + organizationID + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetEntitlementHistories($where: EntitlementHistoryWhereInput) { + entitlementHistories(where: $where) { + edges { + node { + cancelled + createdAt + createdBy + expires + expiresAt + externalCustomerID + externalSubscriptionID + historyTime + id + operation + organizationID + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/entitlementplan.graphql b/query/entitlementplan.graphql new file mode 100644 index 0000000..a3f82b3 --- /dev/null +++ b/query/entitlementplan.graphql @@ -0,0 +1,132 @@ +mutation CreateBulkCSVEntitlementPlan($input: Upload!) { + createBulkCSVEntitlementPlan(input: $input) { + entitlementPlans { + id + name + displayName + metadata + tags + version + description + } + } +} + +mutation CreateBulkEntitlementPlan($input: [CreateEntitlementPlanInput!]) { + createBulkEntitlementPlan(input: $input) { + entitlementPlans { + id + name + displayName + metadata + tags + version + description + } + } +} + +mutation CreateEntitlementPlan($input: CreateEntitlementPlanInput!) { + createEntitlementPlan(input: $input) { + entitlementPlan { + id + name + displayName + metadata + tags + version + description + } + } +} + +mutation DeleteEntitlementPlan($deleteEntitlementPlanId: ID!) { + deleteEntitlementPlan(id: $deleteEntitlementPlanId) { + deletedID + } +} + +query GetAllEntitlementPlans { + entitlementPlans { + edges { + node { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } + } + } +} + +query GetEntitlementPlanByID($entitlementPlanId: ID!) { + entitlementPlan(id: $entitlementPlanId) { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } +} + +query GetEntitlementPlans($where: EntitlementPlanWhereInput) { + entitlementPlans(where: $where) { + edges { + node { + id + name + displayName + metadata + tags + version + description + features { + feature { + id + metadata + name + } + metadata + tags + } + } + } + } +} + +mutation UpdateEntitlementPlan($updateEntitlementPlanId: ID!, $input: UpdateEntitlementPlanInput!) { + updateEntitlementPlan(id: $updateEntitlementPlanId, input: $input) { + entitlementPlan { + id + name + displayName + metadata + tags + version + description + } + } +} diff --git a/query/entitlementplanfeature.graphql b/query/entitlementplanfeature.graphql new file mode 100644 index 0000000..048e7f2 --- /dev/null +++ b/query/entitlementplanfeature.graphql @@ -0,0 +1,126 @@ +query GetAllEntitlementPlanFeatures { + entitlementPlanFeatures { + edges { + node { + id + feature { + id + name + } + metadata + plan { + id + name + } + } + } + } +} + +query GetEntitlementPlanFeatureByID($entitlementPlanFeatureId: ID!) { + entitlementPlanFeature(id: $entitlementPlanFeatureId) { + id + metadata + plan { + id + name + } + feature { + id + name + } + } +} + +query GetEntitlementPlanFeatures($where: EntitlementPlanFeatureWhereInput) { + entitlementPlanFeatures(where: $where) { + edges { + node { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } + } +} + +mutation CreateEntitlementPlanFeature($input: CreateEntitlementPlanFeatureInput!) { + createEntitlementPlanFeature(input: $input) { + entitlementPlanFeature { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} + +mutation CreateBulkCSVEntitlementPlanFeature($input: Upload!) { + createBulkCSVEntitlementPlanFeature(input: $input) { + entitlementPlanFeatures { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} + +mutation CreateBulkEntitlementPlanFeature($input: [CreateEntitlementPlanFeatureInput!]) { + createBulkEntitlementPlanFeature(input: $input) { + entitlementPlanFeatures { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} + +mutation UpdateEntitlementPlanFeature($updateEntitlementPlanFeatureId: ID!, $input: UpdateEntitlementPlanFeatureInput!) { + updateEntitlementPlanFeature(id: $updateEntitlementPlanFeatureId, input: $input) { + entitlementPlanFeature { + id + metadata + plan { + id + name + } + feature { + id + name + } + } + } +} + +mutation DeleteEntitlementPlanFeature($deleteEntitlementPlanFeatureId: ID!) { + deleteEntitlementPlanFeature(id: $deleteEntitlementPlanFeatureId) { + deletedID + } +} \ No newline at end of file diff --git a/query/entitlementplanfeaturehistory.graphql b/query/entitlementplanfeaturehistory.graphql new file mode 100644 index 0000000..ab1e5c4 --- /dev/null +++ b/query/entitlementplanfeaturehistory.graphql @@ -0,0 +1,43 @@ +query GetAllEntitlementPlanFeatureHistories { + entitlementPlanFeatureHistories { + edges { + node { + createdAt + createdBy + featureID + historyTime + id + metadata + operation + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetEntitlementPlanFeatureHistories($where: EntitlementPlanFeatureHistoryWhereInput) { + entitlementPlanFeatureHistories(where: $where) { + edges { + node { + createdAt + createdBy + featureID + historyTime + id + metadata + operation + ownerID + planID + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/entitlementplanhistory.graphql b/query/entitlementplanhistory.graphql new file mode 100644 index 0000000..cef3846 --- /dev/null +++ b/query/entitlementplanhistory.graphql @@ -0,0 +1,47 @@ +query GetAllEntitlementPlanHistories { + entitlementPlanHistories { + edges { + node { + createdAt + createdBy + description + displayName + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + version + } + } + } +} + +query GetEntitlementPlanHistories($where: EntitlementPlanHistoryWhereInput) { + entitlementPlanHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + version + } + } + } +} diff --git a/query/entity.graphql b/query/entity.graphql new file mode 100644 index 0000000..a27e386 --- /dev/null +++ b/query/entity.graphql @@ -0,0 +1,205 @@ +mutation CreateBulkCSVEntity($input: Upload!) { + createBulkCSVEntity(input: $input) { + entities { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} + +mutation CreateBulkEntity($input: [CreateEntityInput!]) { + createBulkEntity(input: $input) { + entities { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} + +mutation CreateEntity($input: CreateEntityInput!) { + createEntity(input: $input) { + entity { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} + +mutation DeleteEntity($deleteEntityId: ID!) { + deleteEntity(id: $deleteEntityId) { + deletedID + } +} + +query GetAllEntities { + entities { + edges { + node { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} + +query GetEntities($where: EntityWhereInput) { + entities(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} + +query GetEntityByID($entityId: ID!) { + entity(id: $entityId) { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + contacts { + id + fullName + email + title + company + address + phoneNumber + } + tags + updatedAt + updatedBy + } +} + +mutation UpdateEntity($updateEntityId: ID!, $input: UpdateEntityInput!) { + updateEntity(id: $updateEntityId, input: $input) { + entity { + createdAt + createdBy + description + displayName + status + domains + notes { + text + updatedAt + updatedBy + } + entityType { + name + } + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} diff --git a/query/entityhistory.graphql b/query/entityhistory.graphql new file mode 100644 index 0000000..dfa646d --- /dev/null +++ b/query/entityhistory.graphql @@ -0,0 +1,49 @@ +query GetAllEntityHistories { + entityHistories { + edges { + node { + createdAt + createdBy + description + displayName + domains + entityTypeID + historyTime + id + name + operation + ownerID + ref + status + tags + updatedAt + updatedBy + } + } + } +} + +query GetEntityHistories($where: EntityHistoryWhereInput) { + entityHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + domains + entityTypeID + historyTime + id + name + operation + ownerID + ref + status + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/entitytype.graphql b/query/entitytype.graphql new file mode 100644 index 0000000..22dffcd --- /dev/null +++ b/query/entitytype.graphql @@ -0,0 +1,112 @@ + +mutation CreateBulkCSVEntityType($input: Upload!) { + createBulkCSVEntityType(input: $input) { + entityTypes { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} + +mutation CreateBulkEntityType($input: [CreateEntityTypeInput!]) { + createBulkEntityType(input: $input) { + entityTypes { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} + +mutation CreateEntityType($input: CreateEntityTypeInput!) { + createEntityType(input: $input) { + entityType { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} + +mutation DeleteEntityType($deleteEntityTypeId: ID!) { + deleteEntityType(id: $deleteEntityTypeId) { + deletedID + } +} + +query GetAllEntityTypes { + entityTypes { + edges { + node { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} + +query GetEntityTypeByID($entityTypeId: ID!) { + entityType(id: $entityTypeId) { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } +} + +query GetEntityTypes($where: EntityTypeWhereInput) { + entityTypes(where: $where) { + edges { + node { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } + } +} +mutation UpdateEntityType($updateEntityTypeId: ID!, $input: UpdateEntityTypeInput!) { + updateEntityType(id: $updateEntityTypeId, input: $input) { + entityType { + createdAt + createdBy + id + name + ownerID + tags + updatedAt + updatedBy + } + } +} diff --git a/query/entitytypehistory.graphql b/query/entitytypehistory.graphql new file mode 100644 index 0000000..c569de1 --- /dev/null +++ b/query/entitytypehistory.graphql @@ -0,0 +1,41 @@ + + +query GetAllEntityTypeHistories { + entityTypeHistories { + edges { + node { + createdAt + createdBy + historyTime + id + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetEntityTypeHistories($where: EntityTypeHistoryWhereInput) { + entityTypeHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/event.graphql b/query/event.graphql new file mode 100644 index 0000000..a203efc --- /dev/null +++ b/query/event.graphql @@ -0,0 +1,338 @@ +query GetEvents($where: EventWhereInput) { + events(where: $where) { + edges { + node { + eventID + id + correlationID + eventType + metadata + } + } + } +} + +query GetEventByID($eventId: ID!) { + event(id: $eventId) { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } +} + +query GetAllEvents { + events { + edges { + node { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } + } +} + +mutation CreateEvent($input: CreateEventInput!) { + createEvent(input: $input) { + event { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} + +mutation CreateBulkEvent($input: [CreateEventInput!]) { + createBulkEvent(input: $input) { + events { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} + +mutation CreateBulkCSVEvent($input: Upload!) { + createBulkCSVEvent(input: $input) { + events { + id + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} + +mutation UpdateEvent($updateEventId: ID!, $input: UpdateEventInput!) { + updateEvent(id: $updateEventId, input: $input) { + event { + id + createdAt + updatedAt + createdBy + updatedBy + eventID + correlationID + eventType + metadata + user { + id + } + group { + id + } + integration { + id + } + organization { + id + } + invite { + id + } + feature { + id + } + personalAccessToken { + id + } + oauth2token { + id + } + hush { + id + } + orgmembership { + id + } + groupmembership { + id + } + entitlement { + id + } + webhook { + id + } + } + } +} + + +mutation DeleteEvent($deleteEventId: ID!) { + deleteEvent(id: $deleteEventId) { + deletedID + } +} \ No newline at end of file diff --git a/query/eventhistory.graphql b/query/eventhistory.graphql new file mode 100644 index 0000000..cb2b7b9 --- /dev/null +++ b/query/eventhistory.graphql @@ -0,0 +1,45 @@ + + +query GetAllEventHistories { + eventHistories { + edges { + node { + correlationID + createdAt + createdBy + eventID + eventType + historyTime + id + metadata + operation + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetEventHistories($where: EventHistoryWhereInput) { + eventHistories(where: $where) { + edges { + node { + correlationID + createdAt + createdBy + eventID + eventType + historyTime + id + metadata + operation + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/feature.graphql b/query/feature.graphql new file mode 100644 index 0000000..88a87b6 --- /dev/null +++ b/query/feature.graphql @@ -0,0 +1,98 @@ +mutation CreateBulkCSVFeature($input: Upload!) { + createBulkCSVFeature(input: $input) { + features { + description + enabled + id + name + displayName + tags + } + } +} + +mutation CreateBulkFeature($input: [CreateFeatureInput!]) { + createBulkFeature(input: $input) { + features { + description + enabled + id + name + displayName + tags + } + } +} + +mutation CreateFeature($input: CreateFeatureInput!) { + createFeature(input: $input) { + feature { + description + enabled + id + name + displayName + tags + } + } +} + +mutation DeleteFeature($deleteFeatureId: ID!) { + deleteFeature(id: $deleteFeatureId) { + deletedID + } +} + +query GetAllFeatures { + features { + edges { + node { + description + enabled + id + name + displayName + tags + } + } + } +} + +query GetFeatureByID($featureId: ID!) { + feature(id: $featureId) { + description + enabled + id + name + displayName + tags + } +} + +query GetFeatures($where: FeatureWhereInput) { + features(where: $where) { + edges { + node { + description + enabled + id + name + displayName + tags + } + } + } +} + +mutation UpdateFeature($updateFeatureId: ID!, $input: UpdateFeatureInput!) { + updateFeature(id: $updateFeatureId, input: $input) { + feature { + description + enabled + id + name + displayName + tags + } + } +} diff --git a/query/featurehistory.graphql b/query/featurehistory.graphql new file mode 100644 index 0000000..b702560 --- /dev/null +++ b/query/featurehistory.graphql @@ -0,0 +1,49 @@ + + +query GetAllFeatureHistories { + featureHistories { + edges { + node { + createdAt + createdBy + description + displayName + enabled + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetFeatureHistories($where: FeatureHistoryWhereInput) { + featureHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + enabled + historyTime + id + metadata + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/file.graphql b/query/file.graphql new file mode 100644 index 0000000..b97a84f --- /dev/null +++ b/query/file.graphql @@ -0,0 +1,161 @@ +mutation CreateBulkCSVFile($input: Upload!) { + createBulkCSVFile(input: $input) { + files { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} + +mutation CreateBulkFile($input: [CreateFileInput!]) { + createBulkFile(input: $input) { + files { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} + +mutation CreateFile($input: CreateFileInput!) { + createFile(input: $input) { + file { + annotation + category + contentType + fileExtension + fileName + fileSize + id + storeKey + user { + id + } + organization { + id + } + group { + id + } + } + } +} + +mutation DeleteFile($deleteFileId: ID!) { + deleteFile(id: $deleteFileId) { + deletedID + } +} + +query GetAllFiles { + files { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + id + storeKey + updatedAt + updatedBy + user { + id + } + organization { + id + } + group { + id + } + } + } + } +} + +query GetFiles($where: FileWhereInput) { + files(where: $where) { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + id + storeKey + updatedAt + updatedBy + user { + id + } + organization { + id + } + group { + id + } + } + } + } +} + +mutation UpdateFile($updateFileId: ID!, $input: UpdateFileInput!) { + updateFile(id: $updateFileId, input: $input) { + file { + id + fileName + fileExtension + fileSize + contentType + storeKey + category + annotation + user { + id + } + organization { + id + } + group { + id + } + } + } +} diff --git a/query/filehistory.graphql b/query/filehistory.graphql new file mode 100644 index 0000000..83ef199 --- /dev/null +++ b/query/filehistory.graphql @@ -0,0 +1,51 @@ + + +query GetAllFileHistories { + fileHistories { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + historyTime + id + operation + ref + storeKey + tags + updatedAt + updatedBy + } + } + } +} + +query GetFileHistories($where: FileHistoryWhereInput) { + fileHistories(where: $where) { + edges { + node { + annotation + category + contentType + createdAt + createdBy + fileExtension + fileName + fileSize + historyTime + id + operation + ref + storeKey + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/group.graphql b/query/group.graphql new file mode 100644 index 0000000..bfefa37 --- /dev/null +++ b/query/group.graphql @@ -0,0 +1,273 @@ +mutation CreateBulkCSVGroup($input: Upload!) { + createBulkCSVGroup(input: $input) { + groups { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} + +mutation CreateBulkGroup($input: [CreateGroupInput!]) { + createBulkGroup(input: $input) { + groups { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} + +mutation CreateGroup($input: CreateGroupInput!) { + createGroup(input: $input) { + group { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} + +mutation DeleteGroup($deleteGroupId: ID!) { + deleteGroup(id: $deleteGroupId) { + deletedID + } +} + +query GetAllGroups { + groups { + edges { + node { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} + +query GetGroupByID($groupId: ID!) { + group(id: $groupId) { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } +} + +query GetGroups($where: GroupWhereInput) { + groups(where: $where) { + edges { + node { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} + +mutation UpdateGroup($updateGroupId: ID!, $input: UpdateGroupInput!) { + updateGroup(id: $updateGroupId, input: $input) { + group { + description + displayName + id + logoURL + name + tags + owner { + id + displayName + } + setting { + createdAt + createdBy + id + joinPolicy + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + members { + id + role + user { + id + firstName + lastName + } + } + } + } +} diff --git a/query/grouphistory.graphql b/query/grouphistory.graphql new file mode 100644 index 0000000..fbdff06 --- /dev/null +++ b/query/grouphistory.graphql @@ -0,0 +1,47 @@ +query GetAllGroupHistories { + groupHistories { + edges { + node { + createdAt + createdBy + description + displayName + gravatarLogoURL + historyTime + id + logoURL + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetGroupHistories($where: GroupHistoryWhereInput) { + groupHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + displayName + gravatarLogoURL + historyTime + id + logoURL + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/groupmembership.graphql b/query/groupmembership.graphql new file mode 100644 index 0000000..ccdbe0c --- /dev/null +++ b/query/groupmembership.graphql @@ -0,0 +1,117 @@ +mutation AddUserToGroupWithRole($input: CreateGroupMembershipInput!) { + createGroupMembership(input: $input) { + groupMembership { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} + +mutation CreateBulkCSVGroupMembers($input: Upload!) { + createBulkCSVGroupMembership(input: $input) { + groupMemberships { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} + +mutation CreateBulkGroupMembers($input: [CreateGroupMembershipInput!]) { + createBulkGroupMembership(input: $input) { + groupMemberships { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} + +query GetGroupMembersByGroupID($where: GroupMembershipWhereInput) { + groupMemberships(where: $where) { + edges { + node { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } + } +} + +mutation RemoveUserFromGroup($deleteGroupMembershipId: ID!) { + deleteGroupMembership(id: $deleteGroupMembershipId) { + deletedID + } +} + +mutation UpdateUserRoleInGroup($updateGroupMemberId: ID!, $input: UpdateGroupMembershipInput!) { + updateGroupMembership(id: $updateGroupMemberId, input: $input) { + groupMembership { + groupID + group { + id + name + } + id + role + userID + user { + displayName + email + firstName + id + lastName + } + } + } +} diff --git a/query/groupmembershiphistory.graphql b/query/groupmembershiphistory.graphql new file mode 100644 index 0000000..f843ade --- /dev/null +++ b/query/groupmembershiphistory.graphql @@ -0,0 +1,39 @@ +query GetAllGroupMembershipHistories { + groupMembershipHistories { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + operation + ref + role + updatedAt + updatedBy + userID + } + } + } +} + +query GetGroupMembershipHistories($where: GroupMembershipHistoryWhereInput) { + groupMembershipHistories(where: $where) { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + operation + ref + role + updatedAt + updatedBy + userID + } + } + } +} diff --git a/query/groupsetting.graphql b/query/groupsetting.graphql new file mode 100644 index 0000000..221fb82 --- /dev/null +++ b/query/groupsetting.graphql @@ -0,0 +1,85 @@ +query GetAllGroupSettings { + groupSettings { + edges { + node { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} + +query GetGroupSettingByID($groupSettingId: ID!) { + groupSetting(id: $groupSettingId) { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } +} + +query GetGroupSettings($where: GroupSettingWhereInput!) { + groupSettings(where: $where) { + edges { + node { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} + +mutation UpdateGroupSetting($updateGroupSettingId: ID!, $input: UpdateGroupSettingInput!) { + updateGroupSetting(id: $updateGroupSettingId, input: $input) { + groupSetting { + id + joinPolicy + syncToGithub + syncToSlack + tags + visibility + group { + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } + } +} diff --git a/query/groupsettinghistory.graphql b/query/groupsettinghistory.graphql new file mode 100644 index 0000000..3e5d9c2 --- /dev/null +++ b/query/groupsettinghistory.graphql @@ -0,0 +1,45 @@ +query GetAllGroupSettingHistories { + groupSettingHistories { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + joinPolicy + operation + ref + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + } + } +} + +query GetGroupSettingHistories($where: GroupSettingHistoryWhereInput) { + groupSettingHistories(where: $where) { + edges { + node { + createdAt + createdBy + groupID + historyTime + id + joinPolicy + operation + ref + syncToGithub + syncToSlack + tags + updatedAt + updatedBy + visibility + } + } + } +} diff --git a/query/hush.graphql b/query/hush.graphql new file mode 100644 index 0000000..0c21b11 --- /dev/null +++ b/query/hush.graphql @@ -0,0 +1,160 @@ +mutation CreateBulkCSVHush($input: Upload!) { + createBulkCSVHush(input: $input) { + hushes { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} + +mutation CreateBulkHush($input: [CreateHushInput!]) { + createBulkHush(input: $input) { + hushes { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} + +mutation CreateHush($input: CreateHushInput!) { + createHush(input: $input) { + hush { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} + +query GetAllHushes { + hushes { + edges { + node { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } + } + } +} + +query GetHushByID($hushId: ID!) { + hush(id: $hushId) { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } +} + +query GetHushes($where: HushWhereInput) { + hushes(where: $where) { + edges { + node { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + createdAt + updatedAt + createdBy + updatedBy + } + } + } +} + +mutation UpdateHush($updateHushId: ID!, $input: UpdateHushInput!) { + updateHush(id: $updateHushId, input: $input) { + hush { + description + id + kind + name + secretName + integrations { + id + } + organization { + id + } + events { + id + } + } + } +} diff --git a/query/hushhistory.graphql b/query/hushhistory.graphql new file mode 100644 index 0000000..e729288 --- /dev/null +++ b/query/hushhistory.graphql @@ -0,0 +1,41 @@ +query GetAllHushHistories { + hushHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ref + secretName + updatedAt + updatedBy + } + } + } +} + +query GetHushHistories($where: HushHistoryWhereInput) { + hushHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ref + secretName + updatedAt + updatedBy + } + } + } +} diff --git a/query/integration.graphql b/query/integration.graphql new file mode 100644 index 0000000..f7f73a7 --- /dev/null +++ b/query/integration.graphql @@ -0,0 +1,222 @@ +mutation CreateBulkCSVIntegration($input: Upload!) { + createBulkCSVIntegration(input: $input) { + integrations { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} + +mutation CreateBulkIntegration($input: [CreateIntegrationInput!]) { + createBulkIntegration(input: $input) { + integrations { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} + +mutation CreateIntegration($input: CreateIntegrationInput!) { + createIntegration(input: $input) { + integration { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} + +mutation DeleteIntegration($deleteIntegrationId: ID!) { + deleteIntegration(id: $deleteIntegrationId) { + deletedID + } +} + +query GetAllIntegrations { + integrations { + edges { + node { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} + +query GetIntegrationByID($integrationId: ID!) { + integration(id: $integrationId) { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } +} + +query GetIntegrations($where: IntegrationWhereInput) { + integrations(where: $where) { + edges { + node { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} + +mutation UpdateIntegration($updateIntegrationId: ID!, $input: UpdateIntegrationInput!) { + updateIntegration(id: $updateIntegrationId, input: $input) { + integration { + description + id + kind + name + ownerID + owner { + id + } + secrets { + id + } + oauth2tokens { + id + } + events { + id + } + webhooks { + id + destinationURL + enabled + } + } + } +} diff --git a/query/integrationhistory.graphql b/query/integrationhistory.graphql new file mode 100644 index 0000000..f10dd67 --- /dev/null +++ b/query/integrationhistory.graphql @@ -0,0 +1,43 @@ +query GetAllIntegrationHistories { + integrationHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetIntegrationHistories($where: IntegrationHistoryWhereInput) { + integrationHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + kind + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/invite.graphql b/query/invite.graphql new file mode 100644 index 0000000..40fb4a7 --- /dev/null +++ b/query/invite.graphql @@ -0,0 +1,103 @@ +mutation CreateBulkCSVInvite($input: Upload!) { + createBulkCSVInvite(input: $input) { + invites { + expires + id + recipient + requestorID + role + sendAttempts + status + } + } +} + +mutation CreateBulkInvite($input: [CreateInviteInput!]) { + createBulkInvite(input: $input) { + invites { + expires + id + recipient + requestorID + role + sendAttempts + status + } + } +} + +mutation CreateInvite($input: CreateInviteInput!) { + createInvite(input: $input) { + invite { + expires + id + recipient + requestorID + role + sendAttempts + status + owner { + id + } + } + } +} + +mutation DeleteInvite($deleteInviteId: ID!) { + deleteInvite(id: $deleteInviteId) { + deletedID + } +} + +query GetInviteByID($inviteId: ID!) { + invite(id: $inviteId) { + expires + id + recipient + requestorID + role + sendAttempts + status + owner { + displayName + id + name + } + createdAt + createdBy + updatedAt + updatedBy + } +} + +query GetAllInvites { + invites { + edges { + node { + id + recipient + role + status + } + } + } +} + +query InvitesByOrgID($where: InviteWhereInput) { + invites(where: $where) { + edges { + node { + owner { + id + invites { + recipient + requestorID + role + sendAttempts + status + } + } + } + } + } +} diff --git a/query/notehistory.graphql b/query/notehistory.graphql new file mode 100644 index 0000000..e7beeb1 --- /dev/null +++ b/query/notehistory.graphql @@ -0,0 +1,41 @@ + + +query GetAllNoteHistories { + noteHistories { + edges { + node { + createdAt + createdBy + historyTime + id + operation + ownerID + ref + tags + text + updatedAt + updatedBy + } + } + } +} + +query GetNoteHistories($where: NoteHistoryWhereInput) { + noteHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + operation + ownerID + ref + tags + text + updatedAt + updatedBy + } + } + } +} diff --git a/query/oauthproviderhistory.graphql b/query/oauthproviderhistory.graphql new file mode 100644 index 0000000..eacad23 --- /dev/null +++ b/query/oauthproviderhistory.graphql @@ -0,0 +1,57 @@ + + +query GetAllOauthProviderHistories { + oauthProviderHistories { + edges { + node { + authStyle + authURL + clientID + clientSecret + createdAt + createdBy + historyTime + id + infoURL + name + operation + ownerID + redirectURL + ref + scopes + tags + tokenURL + updatedAt + updatedBy + } + } + } +} + +query GetOauthProviderHistories($where: OauthProviderHistoryWhereInput) { + oauthProviderHistories(where: $where) { + edges { + node { + authStyle + authURL + clientID + clientSecret + createdAt + createdBy + historyTime + id + infoURL + name + operation + ownerID + redirectURL + ref + scopes + tags + tokenURL + updatedAt + updatedBy + } + } + } +} diff --git a/query/ohauthtootoken.graphql b/query/ohauthtootoken.graphql new file mode 100644 index 0000000..31a590c --- /dev/null +++ b/query/ohauthtootoken.graphql @@ -0,0 +1,137 @@ +mutation CreateBulkCSVOhAuthTooToken($input: Upload!) { + createBulkCSVOhAuthTooToken(input: $input) { + ohAuthTooTokens { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} + +mutation CreateBulkOhAuthTooToken($input: [CreateOhAuthTooTokenInput!]) { + createBulkOhAuthTooToken(input: $input) { + ohAuthTooTokens { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} + +mutation CreateOhAuthTooToken($input: CreateOhAuthTooTokenInput!) { + createOhAuthTooToken(input: $input) { + ohAuthTooToken { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} + +mutation DeleteOhAuthTooToken($deleteOhAuthTooTokenId: ID!) { + deleteOhAuthTooToken(id: $deleteOhAuthTooTokenId) { + deletedID + } +} + +query GetOhAuthTooTokens($where: OhAuthTooTokenWhereInput) { + ohAuthTooTokens(where: $where) { + edges { + node { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } + } +} + +mutation UpdateOhAuthTooToken($updateOhAuthTooTokenId: ID!, $input: UpdateOhAuthTooTokenInput!) { + updateOhAuthTooToken(id: $updateOhAuthTooTokenId, input: $input) { + ohAuthTooToken { + claimsEmail + claimsEmailVerified + claimsGroups + claimsPreferredUsername + claimsUserID + claimsUsername + clientID + connectorData + connectorID + id + lastUsed + nonce + scopes + integration { + id + } + events { + id + } + } + } +} diff --git a/query/organization.graphql b/query/organization.graphql new file mode 100644 index 0000000..8c824c8 --- /dev/null +++ b/query/organization.graphql @@ -0,0 +1,271 @@ +mutation CreateBulkCSVOrganization($input: Upload!) { + createBulkCSVOrganization(input: $input) { + organizations { + id + name + displayName + description + personalOrg + tags + } + } +} + +mutation CreateBulkOrganization($input: [CreateOrganizationInput!]) { + createBulkOrganization(input: $input) { + organizations { + id + name + displayName + description + personalOrg + tags + } + } +} + +mutation CreateOrganization($input: CreateOrganizationInput!) { + createOrganization(input: $input) { + organization { + id + name + displayName + description + personalOrg + tags + createdAt + updatedAt + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + } + } +} + +mutation DeleteOrganization($deleteOrganizationId: ID!) { + deleteOrganization(id: $deleteOrganizationId) { + deletedID + } +} + +query GetAllOrganizations { + organizations { + edges { + node { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + updatedAt + } + } + } +} + +query GetOrganizationByID($organizationId: ID!) { + organization(id: $organizationId) { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + createdBy + updatedAt + updatedBy + } +} + +query GetOrganizations($where: OrganizationWhereInput) { + organizations(where: $where) { + edges { + node { + id + name + displayName + description + personalOrg + tags + parent { + id + name + } + children { + edges { + node { + id + name + displayName + description + } + } + } + members { + id + role + user { + id + firstName + lastName + } + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + createdAt + updatedAt + } + } + } +} + +mutation UpdateOrganization($updateOrganizationId: ID!, $input: UpdateOrganizationInput!) { + updateOrganization(id: $updateOrganizationId, input: $input) { + organization { + id + name + displayName + description + personalOrg + tags + members { + id + role + userID + } + setting { + id + createdAt + updatedAt + createdBy + updatedBy + domains + billingContact + billingEmail + billingPhone + billingAddress + taxIdentifier + geoLocation + tags + } + } + } +} diff --git a/query/organizationhistory.graphql b/query/organizationhistory.graphql new file mode 100644 index 0000000..6593d87 --- /dev/null +++ b/query/organizationhistory.graphql @@ -0,0 +1,49 @@ + + +query GetAllOrganizationHistories { + organizationHistories { + edges { + node { + avatarRemoteURL + createdAt + createdBy + dedicatedDb + description + displayName + historyTime + id + name + operation + personalOrg + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetOrganizationHistories($where: OrganizationHistoryWhereInput) { + organizationHistories(where: $where) { + edges { + node { + avatarRemoteURL + createdAt + createdBy + dedicatedDb + description + displayName + historyTime + id + name + operation + personalOrg + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/organizationsetting.graphql b/query/organizationsetting.graphql new file mode 100644 index 0000000..c56d5d2 --- /dev/null +++ b/query/organizationsetting.graphql @@ -0,0 +1,97 @@ +query GetAllOrganizationSettings { + organizationSettings { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } + } +} + +query GetOrganizationSettingByID($organizationSettingId: ID!) { + organizationSetting(id: $organizationSettingId) { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } +} + +query GetOrganizationSettings($where: OrganizationSettingWhereInput!) { + organizationSettings(where: $where) { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } + } +} + +mutation UpdateOrganizationSetting($updateOrganizationSettingId: ID!, $input: UpdateOrganizationSettingInput!) { + updateOrganizationSetting(id: $updateOrganizationSettingId, input: $input) { + organizationSetting { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + id + tags + taxIdentifier + updatedAt + updatedBy + organization { + id + name + } + } + } +} diff --git a/query/organizationsettinghistory.graphql b/query/organizationsettinghistory.graphql new file mode 100644 index 0000000..f9569cb --- /dev/null +++ b/query/organizationsettinghistory.graphql @@ -0,0 +1,51 @@ +query GetAllOrganizationSettingHistories { + organizationSettingHistories { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + historyTime + id + operation + organizationID + ref + tags + taxIdentifier + updatedAt + updatedBy + } + } + } +} + +query GetOrganizationSettingHistories($where: OrganizationSettingHistoryWhereInput) { + organizationSettingHistories(where: $where) { + edges { + node { + billingAddress + billingContact + billingEmail + billingPhone + createdAt + createdBy + domains + geoLocation + historyTime + id + operation + organizationID + ref + tags + taxIdentifier + updatedAt + updatedBy + } + } + } +} diff --git a/query/orgmembership.graphql b/query/orgmembership.graphql new file mode 100644 index 0000000..e7037b5 --- /dev/null +++ b/query/orgmembership.graphql @@ -0,0 +1,69 @@ +mutation AddUserToOrgWithRole($input: CreateOrgMembershipInput!) { + createOrgMembership(input: $input) { + orgMembership { + id + role + userID + organizationID + } + } +} + +mutation CreateBulkCSVOrgMembers($input: Upload!) { + createBulkCSVOrgMembership(input: $input) { + orgMemberships { + id + organizationID + role + userID + } + } +} + +mutation CreateBulkOrgMembers($input: [CreateOrgMembershipInput!]) { + createBulkOrgMembership(input: $input) { + orgMemberships { + id + organizationID + role + userID + } + } +} + +query GetOrgMembersByOrgID($where: OrgMembershipWhereInput) { + orgMemberships(where: $where) { + edges { + node { + id + organizationID + userID + role + user { + firstName + lastName + id + displayName + email + } + } + } + } +} + +mutation RemoveUserFromOrg($deleteOrgMembershipId: ID!) { + deleteOrgMembership(id: $deleteOrgMembershipId) { + deletedID + } +} + +mutation UpdateUserRoleInOrg($updateOrgMemberId: ID!, $input: UpdateOrgMembershipInput!) { + updateOrgMembership(id: $updateOrgMemberId, input: $input) { + orgMembership { + id + role + userID + organizationID + } + } +} diff --git a/query/orgmembershiphistory.graphql b/query/orgmembershiphistory.graphql new file mode 100644 index 0000000..3947f21 --- /dev/null +++ b/query/orgmembershiphistory.graphql @@ -0,0 +1,41 @@ + + +query GetAllOrgMembershipHistories { + orgMembershipHistories { + edges { + node { + createdAt + createdBy + historyTime + id + operation + organizationID + ref + role + updatedAt + updatedBy + userID + } + } + } +} + +query GetOrgMembershipHistories($where: OrgMembershipHistoryWhereInput) { + orgMembershipHistories(where: $where) { + edges { + node { + createdAt + createdBy + historyTime + id + operation + organizationID + ref + role + updatedAt + updatedBy + userID + } + } + } +} diff --git a/query/personalaccesstoken.graphql b/query/personalaccesstoken.graphql new file mode 100644 index 0000000..28f11a3 --- /dev/null +++ b/query/personalaccesstoken.graphql @@ -0,0 +1,131 @@ +mutation CreateBulkCSVPersonalAccessToken($input: Upload!) { + createBulkCSVPersonalAccessToken(input: $input) { + personalAccessTokens { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } +} + +mutation CreateBulkPersonalAccessToken($input: [CreatePersonalAccessTokenInput!]) { + createBulkPersonalAccessToken(input: $input) { + personalAccessTokens { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } +} + +mutation CreatePersonalAccessToken($input: CreatePersonalAccessTokenInput!) { + createPersonalAccessToken(input: $input) { + personalAccessToken { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + owner { + id + } + } + } +} + +mutation DeletePersonalAccessToken($deletePersonalAccessTokenId: ID!) { + deletePersonalAccessToken(id: $deletePersonalAccessTokenId) { + deletedID + } +} + +query GetAllPersonalAccessTokens { + personalAccessTokens { + edges { + node { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } + } + } +} + +query GetPersonalAccessTokenByID($personalAccessTokenId: ID!) { + personalAccessToken(id: $personalAccessTokenId) { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + } +} + +mutation UpdatePersonalAccessToken($updatePersonalAccessTokenId: ID!, $input: UpdatePersonalAccessTokenInput!) { + updatePersonalAccessToken(id: $updatePersonalAccessTokenId, input: $input) { + personalAccessToken { + description + expiresAt + id + lastUsedAt + name + scopes + token + updatedAt + updatedBy + organizations { + id + name + } + owner { + id + } + } + } +} diff --git a/query/search.graphql b/query/search.graphql new file mode 100644 index 0000000..8a54f8d --- /dev/null +++ b/query/search.graphql @@ -0,0 +1,38 @@ +query Search($query: String!) { + search(query: $query) { + nodes { + ... on OrganizationSearchResult { + organizations { + description + displayName + id + name + } + } + ... on GroupSearchResult { + groups { + description + displayName + id + name + } + } + ... on UserSearchResult { + users { + displayName + email + firstName + id + lastName + } + } + ... on SubscriberSearchResult { + subscribers { + active + email + id + } + } + } + } +} diff --git a/query/subscriber.graphql b/query/subscriber.graphql new file mode 100644 index 0000000..8158674 --- /dev/null +++ b/query/subscriber.graphql @@ -0,0 +1,100 @@ +mutation CreateBulkCSVSubscriber($input: Upload!) { + createBulkCSVSubscriber(input: $input) { + subscribers { + active + email + id + verifiedEmail + } + } +} + +mutation CreateBulkSubscriber($input: [CreateSubscriberInput!]) { + createBulkSubscriber(input: $input) { + subscribers { + active + email + id + verifiedEmail + } + } +} + +mutation CreateSubscriber($input: CreateSubscriberInput!) { + createSubscriber(input: $input) { + subscriber { + active + createdAt + createdBy + email + id + updatedAt + updatedBy + verifiedEmail + } + } +} + +mutation DeleteSubscriber($deleteSubscriberEmail: String!, $subscriberOrganization: ID) { + deleteSubscriber( + email: $deleteSubscriberEmail + ownerID: $subscriberOrganization + ) { + email + } +} + +query GetAllSubscribers { + subscribers { + edges { + node { + active + email + id + ownerID + verifiedEmail + } + } + } +} + +query GetSubscriberByEmail($email: String!) { + subscriber(email: $email) { + active + email + id + ownerID + verifiedEmail + } +} + +query GetSubscribers($where: SubscriberWhereInput) { + subscribers(where: $where) { + edges { + node { + active + email + id + ownerID + verifiedEmail + } + } + } +} + +mutation UpdateSubscriber($email: String!, $input: UpdateSubscriberInput!) { + updateSubscriber(email: $email, input: $input) { + subscriber { + active + createdAt + createdBy + email + id + phoneNumber + updatedAt + updatedBy + verifiedEmail + verifiedPhone + } + } +} diff --git a/query/template.graphql b/query/template.graphql new file mode 100644 index 0000000..2cec562 --- /dev/null +++ b/query/template.graphql @@ -0,0 +1,101 @@ +mutation CreateBulkCSVTemplate($input: Upload!) { + createBulkCSVTemplate(input: $input) { + templates { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} + +mutation CreateBulkTemplate($input: [CreateTemplateInput!]) { + createBulkTemplate(input: $input) { + templates { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} + +mutation CreateTemplate($input: CreateTemplateInput!) { + createTemplate(input: $input) { + template { + description + id + jsonconfig + name + uischema + owner { + id + } + } + } +} + +query GetAllTemplates { + templates { + edges { + node { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } + } + } +} + +query GetTemplateByID($getTemplateId: ID!) { + template(id: $getTemplateId) { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } +} + +mutation UpdateTemplate($updateTemplateId: ID!, $input: UpdateTemplateInput!) { + updateTemplate(id: $updateTemplateId, input: $input) { + template { + createdAt + createdBy + description + id + jsonconfig + name + uischema + updatedAt + updatedBy + owner { + id + } + } + } +} diff --git a/query/templatehistory.graphql b/query/templatehistory.graphql new file mode 100644 index 0000000..53f66d2 --- /dev/null +++ b/query/templatehistory.graphql @@ -0,0 +1,47 @@ +query GetAllTemplateHistories { + templateHistories { + edges { + node { + createdAt + createdBy + description + historyTime + id + jsonconfig + name + operation + ownerID + ref + tags + templateType + uischema + updatedAt + updatedBy + } + } + } +} + +query GetTemplateHistories($where: TemplateHistoryWhereInput) { + templateHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + historyTime + id + jsonconfig + name + operation + ownerID + ref + tags + templateType + uischema + updatedAt + updatedBy + } + } + } +} diff --git a/query/tfasetting.graphql b/query/tfasetting.graphql new file mode 100644 index 0000000..25dc837 --- /dev/null +++ b/query/tfasetting.graphql @@ -0,0 +1,48 @@ +mutation CreateTFASetting($input: CreateTFASettingInput!) { + createTFASetting(input: $input) { + tfaSetting { + recoveryCodes + totpAllowed + verified + owner { + id + } + } + } +} + +query GetAllTFASettings { + tfaSettings { + edges { + node { + recoveryCodes + totpAllowed + verified + owner { + id + } + } + } + } +} + +query GetTFASetting { + tfaSetting { + recoveryCodes + totpAllowed + verified + owner { + id + } + } +} + +mutation UpdateTFASetting($input: UpdateTFASettingInput!) { + updateTFASetting(input: $input) { + tfaSetting { + recoveryCodes + totpAllowed + verified + } + } +} diff --git a/query/user.graphql b/query/user.graphql new file mode 100644 index 0000000..e3679dd --- /dev/null +++ b/query/user.graphql @@ -0,0 +1,219 @@ +mutation CreateUser($input: CreateUserInput!) { + createUser(input: $input) { + user { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + sub + tags + orgMemberships { + id + organizationID + } + groupMemberships { + id + groupID + } + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + } + } +} + +mutation DeleteUser($deleteUserId: ID!) { + deleteUser(id: $deleteUserId) { + deletedID + } +} + +query GetAllUsers { + users { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + createdAt + createdBy + updatedAt + updatedBy + } + } + } +} + +query GetUserByID($userId: ID!) { + user(id: $userId) { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + organizations { + id + name + personalOrg + members { + id + role + } + } + updatedAt + updatedBy + createdAt + createdBy + } +} + +query GetUserByIDWithOrgs($userId: ID!) { + user(id: $userId) { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + lastSeen + sub + tags + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + orgMemberships { + id + role + user { + firstName + lastName + } + } + createdAt + createdBy + updatedAt + updatedBy + } +} + +mutation UpdateUser($updateUserId: ID!, $input: UpdateUserInput!) { + updateUser(id: $updateUserId, input: $input) { + user { + authProvider + avatarLocalFile + avatarRemoteURL + displayName + email + firstName + id + lastName + sub + tags + groupMemberships { + id + } + orgMemberships { + id + } + setting { + defaultOrg { + id + name + personalOrg + } + createdAt + createdBy + emailConfirmed + locked + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/userhistory.graphql b/query/userhistory.graphql new file mode 100644 index 0000000..de52cf4 --- /dev/null +++ b/query/userhistory.graphql @@ -0,0 +1,57 @@ +query GetAllUserHistories { + userHistories { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + avatarUpdatedAt + createdAt + createdBy + displayName + email + firstName + historyTime + id + lastName + lastSeen + operation + ref + role + sub + tags + updatedAt + updatedBy + } + } + } +} + +query GetUserHistories($where: UserHistoryWhereInput) { + userHistories(where: $where) { + edges { + node { + authProvider + avatarLocalFile + avatarRemoteURL + avatarUpdatedAt + createdAt + createdBy + displayName + email + firstName + historyTime + id + lastName + lastSeen + operation + ref + role + sub + tags + updatedAt + updatedBy + } + } + } +} diff --git a/query/usersetting.graphql b/query/usersetting.graphql new file mode 100644 index 0000000..4113bb5 --- /dev/null +++ b/query/usersetting.graphql @@ -0,0 +1,101 @@ +query GetAllUserSettings { + userSettings { + edges { + node { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } + } +} + +query GetUserSettingByID($userSettingId: ID!) { + userSetting(id: $userSettingId) { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } +} + +query GetUserSettings($where: UserSettingWhereInput!) { + userSettings(where: $where) { + edges { + node { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } + } +} + +mutation UpdateUserSetting($updateUserSettingId: ID!, $input: UpdateUserSettingInput!) { + updateUserSetting(id: $updateUserSettingId, input: $input) { + userSetting { + id + silencedAt + status + defaultOrg { + id + name + personalOrg + } + tags + locked + isTfaEnabled + emailConfirmed + createdAt + createdBy + deletedAt + deletedBy + updatedAt + updatedBy + } + } +} diff --git a/query/usersettinghistory.graphql b/query/usersettinghistory.graphql new file mode 100644 index 0000000..66928c3 --- /dev/null +++ b/query/usersettinghistory.graphql @@ -0,0 +1,53 @@ + + +query GetAllUserSettingHistories { + userSettingHistories { + edges { + node { + createdAt + createdBy + emailConfirmed + historyTime + id + isTfaEnabled + isWebauthnAllowed + locked + operation + ref + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + userID + } + } + } +} + +query GetUserSettingHistories($where: UserSettingHistoryWhereInput) { + userSettingHistories(where: $where) { + edges { + node { + createdAt + createdBy + emailConfirmed + historyTime + id + isTfaEnabled + isWebauthnAllowed + locked + operation + ref + silencedAt + status + suspendedAt + tags + updatedAt + updatedBy + userID + } + } + } +} diff --git a/query/webhook.graphql b/query/webhook.graphql new file mode 100644 index 0000000..7209306 --- /dev/null +++ b/query/webhook.graphql @@ -0,0 +1,125 @@ +query GetWebhookByID($webhookId: ID!) { + webhook(id: $webhookId) { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } +} + +query GetAllWebhooks { + webhooks { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } + } + } +} + +mutation CreateWebhook($input: CreateWebhookInput!) { + createWebhook(input: $input) { + webhook { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + events { + id + } + } + } +} + +mutation CreateBulkWebhook($input: [CreateWebhookInput!]) { + createBulkWebhook(input: $input) { + webhooks { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + } + } +} + +mutation CreateBulkCSVWebhook($input: Upload!) { + createBulkCSVWebhook(input: $input) { + webhooks { + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + } + } +} + +mutation UpdateWebhook($updateWebhookId: ID!, $input: UpdateWebhookInput!) { + updateWebhook(id: $updateWebhookId, input: $input) { + webhook { + createdAt + createdBy + description + destinationURL + enabled + failures + id + lastError + lastResponse + name + ownerID + updatedAt + updatedBy + events { + id + } + } + } +} + +mutation DeleteWebhook($deleteWebhookId: ID!) { + deleteWebhook(id: $deleteWebhookId) { + deletedID + } +} diff --git a/query/webhookhistory.graphql b/query/webhookhistory.graphql new file mode 100644 index 0000000..f203de9 --- /dev/null +++ b/query/webhookhistory.graphql @@ -0,0 +1,51 @@ +query GetAllWebhookHistories { + webhookHistories { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + historyTime + id + lastError + lastResponse + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} + +query GetWebhookHistories($where: WebhookHistoryWhereInput) { + webhookHistories(where: $where) { + edges { + node { + createdAt + createdBy + description + destinationURL + enabled + failures + historyTime + id + lastError + lastResponse + name + operation + ownerID + ref + tags + updatedAt + updatedBy + } + } + } +} diff --git a/schema.graphql b/schema.graphql new file mode 100644 index 0000000..4ddd50c --- /dev/null +++ b/schema.graphql @@ -0,0 +1,22218 @@ +directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION +type APIToken implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name associated with the token + """ + name: String! + token: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + owner: Organization +} +""" +Return response for createBulkAPIToken mutation +""" +type APITokenBulkCreatePayload { + """ + Created apiTokens + """ + apiTokens: [APIToken!] +} +""" +A connection to a list of items. +""" +type APITokenConnection { + """ + A list of edges. + """ + edges: [APITokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createAPIToken mutation +""" +type APITokenCreatePayload { + """ + Created apiToken + """ + apiToken: APIToken! +} +""" +Return response for deleteAPIToken mutation +""" +type APITokenDeletePayload { + """ + Deleted apiToken ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type APITokenEdge { + """ + The item at the end of the edge. + """ + node: APIToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +Return response for updateAPIToken mutation +""" +type APITokenUpdatePayload { + """ + Updated apiToken + """ + apiToken: APIToken! +} +""" +APITokenWhereInput is used for filtering APIToken objects. +Input was generated by ent. +""" +input APITokenWhereInput { + not: APITokenWhereInput + and: [APITokenWhereInput!] + or: [APITokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + last_used_at field predicates + """ + lastUsedAt: Time + lastUsedAtNEQ: Time + lastUsedAtIn: [Time!] + lastUsedAtNotIn: [Time!] + lastUsedAtGT: Time + lastUsedAtGTE: Time + lastUsedAtLT: Time + lastUsedAtLTE: Time + lastUsedAtIsNil: Boolean + lastUsedAtNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] +} +type AuditLog implements Node { + table: String + time: Time + id: ID! + operation: String + changes: [String!] + updatedBy: ID +} +""" +A connection to a list of items. +""" +type AuditLogConnection { + """ + A list of edges. + """ + edges: [AuditLogEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type AuditLogEdge { + """ + The item at the end of the edge. + """ + node: AuditLog + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +input AuditLogWhereInput { + refID: ID + updatedBy: ID + operation: String + table: ID + before: Time + after: Time +} +type Contact implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactUserStatus! + owner: Organization + entities: [Entity!] +} +""" +Return response for createBulkContact mutation +""" +type ContactBulkCreatePayload { + """ + Created contacts + """ + contacts: [Contact!] +} +""" +A connection to a list of items. +""" +type ContactConnection { + """ + A list of edges. + """ + edges: [ContactEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createContact mutation +""" +type ContactCreatePayload { + """ + Created contact + """ + contact: Contact! +} +""" +Return response for deleteContact mutation +""" +type ContactDeletePayload { + """ + Deleted contact ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type ContactEdge { + """ + The item at the end of the edge. + """ + node: Contact + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type ContactHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: ContactHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactHistoryUserStatus! +} +""" +A connection to a list of items. +""" +type ContactHistoryConnection { + """ + A list of edges. + """ + edges: [ContactHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type ContactHistoryEdge { + """ + The item at the end of the edge. + """ + node: ContactHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +ContactHistoryOpType is enum for the field operation +""" +enum ContactHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +ContactHistoryUserStatus is enum for the field status +""" +enum ContactHistoryUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +ContactHistoryWhereInput is used for filtering ContactHistory objects. +Input was generated by ent. +""" +input ContactHistoryWhereInput { + not: ContactHistoryWhereInput + and: [ContactHistoryWhereInput!] + or: [ContactHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: ContactHistoryOpType + operationNEQ: ContactHistoryOpType + operationIn: [ContactHistoryOpType!] + operationNotIn: [ContactHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + full_name field predicates + """ + fullName: String + fullNameNEQ: String + fullNameIn: [String!] + fullNameNotIn: [String!] + fullNameGT: String + fullNameGTE: String + fullNameLT: String + fullNameLTE: String + fullNameContains: String + fullNameHasPrefix: String + fullNameHasSuffix: String + fullNameEqualFold: String + fullNameContainsFold: String + """ + title field predicates + """ + title: String + titleNEQ: String + titleIn: [String!] + titleNotIn: [String!] + titleGT: String + titleGTE: String + titleLT: String + titleLTE: String + titleContains: String + titleHasPrefix: String + titleHasSuffix: String + titleIsNil: Boolean + titleNotNil: Boolean + titleEqualFold: String + titleContainsFold: String + """ + company field predicates + """ + company: String + companyNEQ: String + companyIn: [String!] + companyNotIn: [String!] + companyGT: String + companyGTE: String + companyLT: String + companyLTE: String + companyContains: String + companyHasPrefix: String + companyHasSuffix: String + companyIsNil: Boolean + companyNotNil: Boolean + companyEqualFold: String + companyContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailIsNil: Boolean + emailNotNil: Boolean + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + address field predicates + """ + address: String + addressNEQ: String + addressIn: [String!] + addressNotIn: [String!] + addressGT: String + addressGTE: String + addressLT: String + addressLTE: String + addressContains: String + addressHasPrefix: String + addressHasSuffix: String + addressIsNil: Boolean + addressNotNil: Boolean + addressEqualFold: String + addressContainsFold: String + """ + status field predicates + """ + status: ContactHistoryUserStatus + statusNEQ: ContactHistoryUserStatus + statusIn: [ContactHistoryUserStatus!] + statusNotIn: [ContactHistoryUserStatus!] +} +""" +Return response for updateContact mutation +""" +type ContactUpdatePayload { + """ + Updated contact + """ + contact: Contact! +} +""" +ContactUserStatus is enum for the field status +""" +enum ContactUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +ContactWhereInput is used for filtering Contact objects. +Input was generated by ent. +""" +input ContactWhereInput { + not: ContactWhereInput + and: [ContactWhereInput!] + or: [ContactWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + full_name field predicates + """ + fullName: String + fullNameNEQ: String + fullNameIn: [String!] + fullNameNotIn: [String!] + fullNameGT: String + fullNameGTE: String + fullNameLT: String + fullNameLTE: String + fullNameContains: String + fullNameHasPrefix: String + fullNameHasSuffix: String + fullNameEqualFold: String + fullNameContainsFold: String + """ + title field predicates + """ + title: String + titleNEQ: String + titleIn: [String!] + titleNotIn: [String!] + titleGT: String + titleGTE: String + titleLT: String + titleLTE: String + titleContains: String + titleHasPrefix: String + titleHasSuffix: String + titleIsNil: Boolean + titleNotNil: Boolean + titleEqualFold: String + titleContainsFold: String + """ + company field predicates + """ + company: String + companyNEQ: String + companyIn: [String!] + companyNotIn: [String!] + companyGT: String + companyGTE: String + companyLT: String + companyLTE: String + companyContains: String + companyHasPrefix: String + companyHasSuffix: String + companyIsNil: Boolean + companyNotNil: Boolean + companyEqualFold: String + companyContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailIsNil: Boolean + emailNotNil: Boolean + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + address field predicates + """ + address: String + addressNEQ: String + addressIn: [String!] + addressNotIn: [String!] + addressGT: String + addressGTE: String + addressLT: String + addressLTE: String + addressContains: String + addressHasPrefix: String + addressHasSuffix: String + addressIsNil: Boolean + addressNotNil: Boolean + addressEqualFold: String + addressContainsFold: String + """ + status field predicates + """ + status: ContactUserStatus + statusNEQ: ContactUserStatus + statusIn: [ContactUserStatus!] + statusNotIn: [ContactUserStatus!] + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] +} +""" +CreateAPITokenInput is used for create APIToken object. +Input was generated by ent. +""" +input CreateAPITokenInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + ownerID: ID +} +""" +CreateContactInput is used for create Contact object. +Input was generated by ent. +""" +input CreateContactInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactUserStatus + ownerID: ID + entityIDs: [ID!] +} +""" +CreateDocumentDataInput is used for create DocumentData object. +Input was generated by ent. +""" +input CreateDocumentDataInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the json data of the document + """ + data: JSON! + ownerID: ID + templateID: ID! + entityIDs: [ID!] +} +""" +CreateEntitlementInput is used for create Entitlement object. +Input was generated by ent. +""" +input CreateEntitlementInput { + """ + tags associated with the object + """ + tags: [String!] + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean + ownerID: ID + planID: ID! + organizationID: ID! + eventIDs: [ID!] +} +""" +CreateEntitlementPlanFeatureInput is used for create EntitlementPlanFeature object. +Input was generated by ent. +""" +input CreateEntitlementPlanFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + ownerID: ID + planID: ID! + featureID: ID! + eventIDs: [ID!] +} +""" +CreateEntitlementPlanInput is used for create EntitlementPlan object. +Input was generated by ent. +""" +input CreateEntitlementPlanInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map + ownerID: ID + entitlementIDs: [ID!] + baseFeatureIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateEntityInput is used for create Entity object. +Input was generated by ent. +""" +input CreateEntityInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + status of the entity + """ + status: String + ownerID: ID + contactIDs: [ID!] + documentIDs: [ID!] + noteIDs: [ID!] + fileIDs: [ID!] + entityTypeID: ID + note: CreateNoteInput +} +""" +CreateEntityTypeInput is used for create EntityType object. +Input was generated by ent. +""" +input CreateEntityTypeInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the entity + """ + name: String! + ownerID: ID + entityIDs: [ID!] +} +""" +CreateEventInput is used for create Event object. +Input was generated by ent. +""" +input CreateEventInput { + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map + userIDs: [ID!] + groupIDs: [ID!] + integrationIDs: [ID!] + organizationIDs: [ID!] + inviteIDs: [ID!] + featureIDs: [ID!] + entitlementplanIDs: [ID!] + personalAccessTokenIDs: [ID!] + oauth2tokenIDs: [ID!] + hushIDs: [ID!] + entitlementIDs: [ID!] + webhookIDs: [ID!] + subscriberIDs: [ID!] +} +""" +CreateFeatureInput is used for create Feature object. +Input was generated by ent. +""" +input CreateFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map + ownerID: ID + planIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateFileInput is used for create File object. +Input was generated by ent. +""" +input CreateFileInput { + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String + userID: ID + organizationIDs: [ID!] + entityIDs: [ID!] + groupIDs: [ID!] +} +""" +CreateGroupInput is used for create Group object. +Input was generated by ent. +""" +input CreateGroupInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String + ownerID: ID + settingID: ID! + userIDs: [ID!] + eventIDs: [ID!] + integrationIDs: [ID!] + fileIDs: [ID!] + createGroupSettings: CreateGroupSettingInput +} +""" +CreateGroupMembershipInput is used for create GroupMembership object. +Input was generated by ent. +""" +input CreateGroupMembershipInput { + role: GroupMembershipRole + groupID: ID! + userID: ID! + eventIDs: [ID!] +} +""" +CreateGroupSettingInput is used for create GroupSetting object. +Input was generated by ent. +""" +input CreateGroupSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + groupID: ID +} +""" +CreateHushInput is used for create Hush object. +Input was generated by ent. +""" +input CreateHushInput { + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String + """ + the secret value + """ + secretValue: String + integrationIDs: [ID!] + organizationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateIntegrationInput is used for create Integration object. +Input was generated by ent. +""" +input CreateIntegrationInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String + ownerID: ID + secretIDs: [ID!] + oauth2tokenIDs: [ID!] + eventIDs: [ID!] + webhookIDs: [ID!] +} +""" +CreateInviteInput is used for create Invite object. +Input was generated by ent. +""" +input CreateInviteInput { + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + """ + the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + """ + recipient: String! + """ + the status of the invitation + """ + status: InviteInviteStatus + role: InviteRole + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int + """ + the user who initiated the invitation + """ + requestorID: String + ownerID: ID + eventIDs: [ID!] +} +""" +CreateNoteInput is used for create Note object. +Input was generated by ent. +""" +input CreateNoteInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the text of the note + """ + text: String! + ownerID: ID + entityID: ID +} +""" +CreateOauthProviderInput is used for create OauthProvider object. +Input was generated by ent. +""" +input CreateOauthProviderInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! + ownerID: ID +} +""" +CreateOhAuthTooTokenInput is used for create OhAuthTooToken object. +Input was generated by ent. +""" +input CreateOhAuthTooTokenInput { + """ + tags associated with the object + """ + tags: [String!] + clientID: String! + scopes: [String!] + nonce: String! + claimsUserID: String! + claimsUsername: String! + claimsEmail: String! + claimsEmailVerified: Boolean! + claimsGroups: [String!] + claimsPreferredUsername: String! + connectorID: String! + connectorData: [String!] + lastUsed: Time + integrationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateOrgMembershipInput is used for create OrgMembership object. +Input was generated by ent. +""" +input CreateOrgMembershipInput { + role: OrgMembershipRole + organizationID: ID! + userID: ID! + eventIDs: [ID!] +} +""" +CreateOrganizationInput is used for create Organization object. +Input was generated by ent. +""" +input CreateOrganizationInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean + parentID: ID + groupIDs: [ID!] + templateIDs: [ID!] + integrationIDs: [ID!] + settingID: ID + documentdatumIDs: [ID!] + entitlementIDs: [ID!] + organizationEntitlementIDs: [ID!] + personalAccessTokenIDs: [ID!] + apiTokenIDs: [ID!] + oauthproviderIDs: [ID!] + userIDs: [ID!] + inviteIDs: [ID!] + subscriberIDs: [ID!] + webhookIDs: [ID!] + eventIDs: [ID!] + secretIDs: [ID!] + featureIDs: [ID!] + fileIDs: [ID!] + entitlementplanIDs: [ID!] + entityIDs: [ID!] + entitytypeIDs: [ID!] + contactIDs: [ID!] + noteIDs: [ID!] + createOrgSettings: CreateOrganizationSettingInput +} +""" +CreateOrganizationSettingInput is used for create OrganizationSetting object. +Input was generated by ent. +""" +input CreateOrganizationSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + organizationID: ID +} +""" +CreatePersonalAccessTokenInput is used for create PersonalAccessToken object. +Input was generated by ent. +""" +input CreatePersonalAccessTokenInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + ownerID: ID! + organizationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateSubscriberInput is used for create Subscriber object. +Input was generated by ent. +""" +input CreateSubscriberInput { + """ + tags associated with the object + """ + tags: [String!] + """ + email address of the subscriber + """ + email: String! + """ + phone number of the subscriber + """ + phoneNumber: String + ownerID: ID + eventIDs: [ID!] +} +""" +CreateTFASettingInput is used for create TFASetting object. +Input was generated by ent. +""" +input CreateTFASettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + ownerID: ID +} +""" +CreateTemplateInput is used for create Template object. +Input was generated by ent. +""" +input CreateTemplateInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON + ownerID: ID + documentIDs: [ID!] +} +""" +CreateUserInput is used for create User object. +Input was generated by ent. +""" +input CreateUserInput { + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + user password hash + """ + password: String + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider + """ + the user's role + """ + role: UserRole + personalAccessTokenIDs: [ID!] + tfaSettingIDs: [ID!] + settingID: ID! + emailVerificationTokenIDs: [ID!] + passwordResetTokenIDs: [ID!] + groupIDs: [ID!] + organizationIDs: [ID!] + webauthnIDs: [ID!] + fileIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateUserSettingInput is used for create UserSetting object. +Input was generated by ent. +""" +input CreateUserSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingUserStatus + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + userID: ID + defaultOrgID: ID +} +""" +CreateWebhookInput is used for create Webhook object. +Input was generated by ent. +""" +input CreateWebhookInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String + ownerID: ID + eventIDs: [ID!] + integrationIDs: [ID!] +} +""" +Define a Relay Cursor type: +https://relay.dev/graphql/connections.htm#sec-Cursor +""" +scalar Cursor +type DocumentData implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the template id of the document + """ + templateID: ID! + """ + the json data of the document + """ + data: JSON! + owner: Organization + template: Template! + entity: [Entity!] +} +""" +Return response for createBulkDocumentData mutation +""" +type DocumentDataBulkCreatePayload { + """ + Created documentData + """ + documentData: [DocumentData!] +} +""" +A connection to a list of items. +""" +type DocumentDataConnection { + """ + A list of edges. + """ + edges: [DocumentDataEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createDocumentData mutation +""" +type DocumentDataCreatePayload { + """ + Created documentData + """ + documentData: DocumentData! +} +""" +Return response for deleteDocumentData mutation +""" +type DocumentDataDeletePayload { + """ + Deleted documentData ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type DocumentDataEdge { + """ + The item at the end of the edge. + """ + node: DocumentData + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type DocumentDataHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: DocumentDataHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the template id of the document + """ + templateID: String! + """ + the json data of the document + """ + data: JSON! +} +""" +A connection to a list of items. +""" +type DocumentDataHistoryConnection { + """ + A list of edges. + """ + edges: [DocumentDataHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type DocumentDataHistoryEdge { + """ + The item at the end of the edge. + """ + node: DocumentDataHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +DocumentDataHistoryOpType is enum for the field operation +""" +enum DocumentDataHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +DocumentDataHistoryWhereInput is used for filtering DocumentDataHistory objects. +Input was generated by ent. +""" +input DocumentDataHistoryWhereInput { + not: DocumentDataHistoryWhereInput + and: [DocumentDataHistoryWhereInput!] + or: [DocumentDataHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: DocumentDataHistoryOpType + operationNEQ: DocumentDataHistoryOpType + operationIn: [DocumentDataHistoryOpType!] + operationNotIn: [DocumentDataHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + template_id field predicates + """ + templateID: String + templateIDNEQ: String + templateIDIn: [String!] + templateIDNotIn: [String!] + templateIDGT: String + templateIDGTE: String + templateIDLT: String + templateIDLTE: String + templateIDContains: String + templateIDHasPrefix: String + templateIDHasSuffix: String + templateIDEqualFold: String + templateIDContainsFold: String +} +""" +Return response for updateDocumentData mutation +""" +type DocumentDataUpdatePayload { + """ + Updated documentData + """ + documentData: DocumentData! +} +""" +DocumentDataWhereInput is used for filtering DocumentData objects. +Input was generated by ent. +""" +input DocumentDataWhereInput { + not: DocumentDataWhereInput + and: [DocumentDataWhereInput!] + or: [DocumentDataWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + template_id field predicates + """ + templateID: ID + templateIDNEQ: ID + templateIDIn: [ID!] + templateIDNotIn: [ID!] + templateIDGT: ID + templateIDGTE: ID + templateIDLT: ID + templateIDLTE: ID + templateIDContains: ID + templateIDHasPrefix: ID + templateIDHasSuffix: ID + templateIDEqualFold: ID + templateIDContainsFold: ID + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + template edge predicates + """ + hasTemplate: Boolean + hasTemplateWith: [TemplateWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] +} +type Entitlement implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the plan to which the entitlement belongs + """ + planID: ID! + """ + the organization to which the entitlement belongs + """ + organizationID: ID! + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + whether or not the customers entitlement expires - expires_at will show the time + """ + expires: Boolean! + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean! + owner: Organization + plan: EntitlementPlan! + organization: Organization! + events: [Event!] +} +""" +Return response for createBulkEntitlement mutation +""" +type EntitlementBulkCreatePayload { + """ + Created entitlements + """ + entitlements: [Entitlement!] +} +""" +A connection to a list of items. +""" +type EntitlementConnection { + """ + A list of edges. + """ + edges: [EntitlementEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createEntitlement mutation +""" +type EntitlementCreatePayload { + """ + Created entitlement + """ + entitlement: Entitlement! +} +""" +Return response for deleteEntitlement mutation +""" +type EntitlementDeletePayload { + """ + Deleted entitlement ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type EntitlementEdge { + """ + The item at the end of the edge. + """ + node: Entitlement + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the plan to which the entitlement belongs + """ + planID: String! + """ + the organization to which the entitlement belongs + """ + organizationID: String! + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + whether or not the customers entitlement expires - expires_at will show the time + """ + expires: Boolean! + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean! +} +""" +A connection to a list of items. +""" +type EntitlementHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementHistoryOpType is enum for the field operation +""" +enum EntitlementHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementHistoryWhereInput is used for filtering EntitlementHistory objects. +Input was generated by ent. +""" +input EntitlementHistoryWhereInput { + not: EntitlementHistoryWhereInput + and: [EntitlementHistoryWhereInput!] + or: [EntitlementHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementHistoryOpType + operationNEQ: EntitlementHistoryOpType + operationIn: [EntitlementHistoryOpType!] + operationNotIn: [EntitlementHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + plan_id field predicates + """ + planID: String + planIDNEQ: String + planIDIn: [String!] + planIDNotIn: [String!] + planIDGT: String + planIDGTE: String + planIDLT: String + planIDLTE: String + planIDContains: String + planIDHasPrefix: String + planIDHasSuffix: String + planIDEqualFold: String + planIDContainsFold: String + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDEqualFold: String + organizationIDContainsFold: String + """ + external_customer_id field predicates + """ + externalCustomerID: String + externalCustomerIDNEQ: String + externalCustomerIDIn: [String!] + externalCustomerIDNotIn: [String!] + externalCustomerIDGT: String + externalCustomerIDGTE: String + externalCustomerIDLT: String + externalCustomerIDLTE: String + externalCustomerIDContains: String + externalCustomerIDHasPrefix: String + externalCustomerIDHasSuffix: String + externalCustomerIDIsNil: Boolean + externalCustomerIDNotNil: Boolean + externalCustomerIDEqualFold: String + externalCustomerIDContainsFold: String + """ + external_subscription_id field predicates + """ + externalSubscriptionID: String + externalSubscriptionIDNEQ: String + externalSubscriptionIDIn: [String!] + externalSubscriptionIDNotIn: [String!] + externalSubscriptionIDGT: String + externalSubscriptionIDGTE: String + externalSubscriptionIDLT: String + externalSubscriptionIDLTE: String + externalSubscriptionIDContains: String + externalSubscriptionIDHasPrefix: String + externalSubscriptionIDHasSuffix: String + externalSubscriptionIDIsNil: Boolean + externalSubscriptionIDNotNil: Boolean + externalSubscriptionIDEqualFold: String + externalSubscriptionIDContainsFold: String + """ + expires field predicates + """ + expires: Boolean + expiresNEQ: Boolean + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + cancelled field predicates + """ + cancelled: Boolean + cancelledNEQ: Boolean +} +type EntitlementPlan implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map + owner: Organization + entitlements: [Entitlement!] + baseFeatures: [Feature!] + events: [Event!] + features: [EntitlementPlanFeature!] +} +""" +Return response for createBulkEntitlementPlan mutation +""" +type EntitlementPlanBulkCreatePayload { + """ + Created entitlementPlans + """ + entitlementPlans: [EntitlementPlan!] +} +""" +A connection to a list of items. +""" +type EntitlementPlanConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createEntitlementPlan mutation +""" +type EntitlementPlanCreatePayload { + """ + Created entitlementPlan + """ + entitlementPlan: EntitlementPlan! +} +""" +Return response for deleteEntitlementPlan mutation +""" +type EntitlementPlanDeletePayload { + """ + Deleted entitlementPlan ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type EntitlementPlanEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlan + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementPlanFeature implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + planID: ID! + featureID: ID! + owner: Organization + plan: EntitlementPlan! + feature: Feature! + events: [Event!] +} +""" +Return response for createBulkEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureBulkCreatePayload { + """ + Created entitlementPlanFeatures + """ + entitlementPlanFeatures: [EntitlementPlanFeature!] +} +""" +A connection to a list of items. +""" +type EntitlementPlanFeatureConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanFeatureEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureCreatePayload { + """ + Created entitlementPlanFeature + """ + entitlementPlanFeature: EntitlementPlanFeature! +} +""" +Return response for deleteEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureDeletePayload { + """ + Deleted entitlementPlanFeature ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type EntitlementPlanFeatureEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanFeature + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementPlanFeatureHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementPlanFeatureHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + planID: String! + featureID: String! +} +""" +A connection to a list of items. +""" +type EntitlementPlanFeatureHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanFeatureHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanFeatureHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanFeatureHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementPlanFeatureHistoryOpType is enum for the field operation +""" +enum EntitlementPlanFeatureHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementPlanFeatureHistoryWhereInput is used for filtering EntitlementPlanFeatureHistory objects. +Input was generated by ent. +""" +input EntitlementPlanFeatureHistoryWhereInput { + not: EntitlementPlanFeatureHistoryWhereInput + and: [EntitlementPlanFeatureHistoryWhereInput!] + or: [EntitlementPlanFeatureHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementPlanFeatureHistoryOpType + operationNEQ: EntitlementPlanFeatureHistoryOpType + operationIn: [EntitlementPlanFeatureHistoryOpType!] + operationNotIn: [EntitlementPlanFeatureHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + plan_id field predicates + """ + planID: String + planIDNEQ: String + planIDIn: [String!] + planIDNotIn: [String!] + planIDGT: String + planIDGTE: String + planIDLT: String + planIDLTE: String + planIDContains: String + planIDHasPrefix: String + planIDHasSuffix: String + planIDEqualFold: String + planIDContainsFold: String + """ + feature_id field predicates + """ + featureID: String + featureIDNEQ: String + featureIDIn: [String!] + featureIDNotIn: [String!] + featureIDGT: String + featureIDGTE: String + featureIDLT: String + featureIDLTE: String + featureIDContains: String + featureIDHasPrefix: String + featureIDHasSuffix: String + featureIDEqualFold: String + featureIDContainsFold: String +} +""" +Return response for updateEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureUpdatePayload { + """ + Updated entitlementPlanFeature + """ + entitlementPlanFeature: EntitlementPlanFeature! +} +""" +EntitlementPlanFeatureWhereInput is used for filtering EntitlementPlanFeature objects. +Input was generated by ent. +""" +input EntitlementPlanFeatureWhereInput { + not: EntitlementPlanFeatureWhereInput + and: [EntitlementPlanFeatureWhereInput!] + or: [EntitlementPlanFeatureWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String +} +type EntitlementPlanHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementPlanHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map +} +""" +A connection to a list of items. +""" +type EntitlementPlanHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementPlanHistoryOpType is enum for the field operation +""" +enum EntitlementPlanHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementPlanHistoryWhereInput is used for filtering EntitlementPlanHistory objects. +Input was generated by ent. +""" +input EntitlementPlanHistoryWhereInput { + not: EntitlementPlanHistoryWhereInput + and: [EntitlementPlanHistoryWhereInput!] + or: [EntitlementPlanHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementPlanHistoryOpType + operationNEQ: EntitlementPlanHistoryOpType + operationIn: [EntitlementPlanHistoryOpType!] + operationNotIn: [EntitlementPlanHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + version field predicates + """ + version: String + versionNEQ: String + versionIn: [String!] + versionNotIn: [String!] + versionGT: String + versionGTE: String + versionLT: String + versionLTE: String + versionContains: String + versionHasPrefix: String + versionHasSuffix: String + versionEqualFold: String + versionContainsFold: String +} +""" +Return response for updateEntitlementPlan mutation +""" +type EntitlementPlanUpdatePayload { + """ + Updated entitlementPlan + """ + entitlementPlan: EntitlementPlan! +} +""" +EntitlementPlanWhereInput is used for filtering EntitlementPlan objects. +Input was generated by ent. +""" +input EntitlementPlanWhereInput { + not: EntitlementPlanWhereInput + and: [EntitlementPlanWhereInput!] + or: [EntitlementPlanWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + version field predicates + """ + version: String + versionNEQ: String + versionIn: [String!] + versionNotIn: [String!] + versionGT: String + versionGTE: String + versionLT: String + versionLTE: String + versionContains: String + versionHasPrefix: String + versionHasSuffix: String + versionEqualFold: String + versionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entitlements edge predicates + """ + hasEntitlements: Boolean + hasEntitlementsWith: [EntitlementWhereInput!] + """ + base_features edge predicates + """ + hasBaseFeatures: Boolean + hasBaseFeaturesWith: [FeatureWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [EntitlementPlanFeatureWhereInput!] +} +""" +Return response for updateEntitlement mutation +""" +type EntitlementUpdatePayload { + """ + Updated entitlement + """ + entitlement: Entitlement! +} +""" +EntitlementWhereInput is used for filtering Entitlement objects. +Input was generated by ent. +""" +input EntitlementWhereInput { + not: EntitlementWhereInput + and: [EntitlementWhereInput!] + or: [EntitlementWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + plan_id field predicates + """ + planID: ID + planIDNEQ: ID + planIDIn: [ID!] + planIDNotIn: [ID!] + planIDGT: ID + planIDGTE: ID + planIDLT: ID + planIDLTE: ID + planIDContains: ID + planIDHasPrefix: ID + planIDHasSuffix: ID + planIDEqualFold: ID + planIDContainsFold: ID + """ + organization_id field predicates + """ + organizationID: ID + organizationIDNEQ: ID + organizationIDIn: [ID!] + organizationIDNotIn: [ID!] + organizationIDGT: ID + organizationIDGTE: ID + organizationIDLT: ID + organizationIDLTE: ID + organizationIDContains: ID + organizationIDHasPrefix: ID + organizationIDHasSuffix: ID + organizationIDEqualFold: ID + organizationIDContainsFold: ID + """ + external_customer_id field predicates + """ + externalCustomerID: String + externalCustomerIDNEQ: String + externalCustomerIDIn: [String!] + externalCustomerIDNotIn: [String!] + externalCustomerIDGT: String + externalCustomerIDGTE: String + externalCustomerIDLT: String + externalCustomerIDLTE: String + externalCustomerIDContains: String + externalCustomerIDHasPrefix: String + externalCustomerIDHasSuffix: String + externalCustomerIDIsNil: Boolean + externalCustomerIDNotNil: Boolean + externalCustomerIDEqualFold: String + externalCustomerIDContainsFold: String + """ + external_subscription_id field predicates + """ + externalSubscriptionID: String + externalSubscriptionIDNEQ: String + externalSubscriptionIDIn: [String!] + externalSubscriptionIDNotIn: [String!] + externalSubscriptionIDGT: String + externalSubscriptionIDGTE: String + externalSubscriptionIDLT: String + externalSubscriptionIDLTE: String + externalSubscriptionIDContains: String + externalSubscriptionIDHasPrefix: String + externalSubscriptionIDHasSuffix: String + externalSubscriptionIDIsNil: Boolean + externalSubscriptionIDNotNil: Boolean + externalSubscriptionIDEqualFold: String + externalSubscriptionIDContainsFold: String + """ + expires field predicates + """ + expires: Boolean + expiresNEQ: Boolean + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + cancelled field predicates + """ + cancelled: Boolean + cancelledNEQ: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + plan edge predicates + """ + hasPlan: Boolean + hasPlanWith: [EntitlementPlanWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Entity implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + The type of the entity + """ + entityTypeID: ID + """ + status of the entity + """ + status: String + owner: Organization + contacts: [Contact!] + documents: [DocumentData!] + notes: [Note!] + files: [File!] + entityType: EntityType +} +""" +Return response for createBulkEntity mutation +""" +type EntityBulkCreatePayload { + """ + Created entities + """ + entities: [Entity!] +} +""" +A connection to a list of items. +""" +type EntityConnection { + """ + A list of edges. + """ + edges: [EntityEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createEntity mutation +""" +type EntityCreatePayload { + """ + Created entity + """ + entity: Entity! +} +""" +Return response for deleteEntity mutation +""" +type EntityDeletePayload { + """ + Deleted entity ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type EntityEdge { + """ + The item at the end of the edge. + """ + node: Entity + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntityHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntityHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + The type of the entity + """ + entityTypeID: String + """ + status of the entity + """ + status: String +} +""" +A connection to a list of items. +""" +type EntityHistoryConnection { + """ + A list of edges. + """ + edges: [EntityHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntityHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntityHistoryOpType is enum for the field operation +""" +enum EntityHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for EntityHistory connections +""" +input EntityHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityHistories. + """ + field: EntityHistoryOrderField! +} +""" +Properties by which EntityHistory connections can be ordered. +""" +enum EntityHistoryOrderField { + name + display_name +} +""" +EntityHistoryWhereInput is used for filtering EntityHistory objects. +Input was generated by ent. +""" +input EntityHistoryWhereInput { + not: EntityHistoryWhereInput + and: [EntityHistoryWhereInput!] + or: [EntityHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntityHistoryOpType + operationNEQ: EntityHistoryOpType + operationIn: [EntityHistoryOpType!] + operationNotIn: [EntityHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameIsNil: Boolean + nameNotNil: Boolean + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + entity_type_id field predicates + """ + entityTypeID: String + entityTypeIDNEQ: String + entityTypeIDIn: [String!] + entityTypeIDNotIn: [String!] + entityTypeIDGT: String + entityTypeIDGTE: String + entityTypeIDLT: String + entityTypeIDLTE: String + entityTypeIDContains: String + entityTypeIDHasPrefix: String + entityTypeIDHasSuffix: String + entityTypeIDIsNil: Boolean + entityTypeIDNotNil: Boolean + entityTypeIDEqualFold: String + entityTypeIDContainsFold: String + """ + status field predicates + """ + status: String + statusNEQ: String + statusIn: [String!] + statusNotIn: [String!] + statusGT: String + statusGTE: String + statusLT: String + statusLTE: String + statusContains: String + statusHasPrefix: String + statusHasSuffix: String + statusIsNil: Boolean + statusNotNil: Boolean + statusEqualFold: String + statusContainsFold: String +} +""" +Ordering options for Entity connections +""" +input EntityOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Entities. + """ + field: EntityOrderField! +} +""" +Properties by which Entity connections can be ordered. +""" +enum EntityOrderField { + name + display_name +} +type EntityType implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the entity + """ + name: String! + owner: Organization + entities: [Entity!] +} +""" +Return response for createBulkEntityType mutation +""" +type EntityTypeBulkCreatePayload { + """ + Created entityTypes + """ + entityTypes: [EntityType!] +} +""" +A connection to a list of items. +""" +type EntityTypeConnection { + """ + A list of edges. + """ + edges: [EntityTypeEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createEntityType mutation +""" +type EntityTypeCreatePayload { + """ + Created entityType + """ + entityType: EntityType! +} +""" +Return response for deleteEntityType mutation +""" +type EntityTypeDeletePayload { + """ + Deleted entityType ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type EntityTypeEdge { + """ + The item at the end of the edge. + """ + node: EntityType + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntityTypeHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntityTypeHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the entity + """ + name: String! +} +""" +A connection to a list of items. +""" +type EntityTypeHistoryConnection { + """ + A list of edges. + """ + edges: [EntityTypeHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityTypeHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntityTypeHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntityTypeHistoryOpType is enum for the field operation +""" +enum EntityTypeHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for EntityTypeHistory connections +""" +input EntityTypeHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityTypeHistories. + """ + field: EntityTypeHistoryOrderField! +} +""" +Properties by which EntityTypeHistory connections can be ordered. +""" +enum EntityTypeHistoryOrderField { + name +} +""" +EntityTypeHistoryWhereInput is used for filtering EntityTypeHistory objects. +Input was generated by ent. +""" +input EntityTypeHistoryWhereInput { + not: EntityTypeHistoryWhereInput + and: [EntityTypeHistoryWhereInput!] + or: [EntityTypeHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntityTypeHistoryOpType + operationNEQ: EntityTypeHistoryOpType + operationIn: [EntityTypeHistoryOpType!] + operationNotIn: [EntityTypeHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String +} +""" +Ordering options for EntityType connections +""" +input EntityTypeOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityTypes. + """ + field: EntityTypeOrderField! +} +""" +Properties by which EntityType connections can be ordered. +""" +enum EntityTypeOrderField { + name +} +""" +Return response for updateEntityType mutation +""" +type EntityTypeUpdatePayload { + """ + Updated entityType + """ + entityType: EntityType! +} +""" +EntityTypeWhereInput is used for filtering EntityType objects. +Input was generated by ent. +""" +input EntityTypeWhereInput { + not: EntityTypeWhereInput + and: [EntityTypeWhereInput!] + or: [EntityTypeWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] +} +""" +Return response for updateEntity mutation +""" +type EntityUpdatePayload { + """ + Updated entity + """ + entity: Entity! +} +""" +EntityWhereInput is used for filtering Entity objects. +Input was generated by ent. +""" +input EntityWhereInput { + not: EntityWhereInput + and: [EntityWhereInput!] + or: [EntityWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameIsNil: Boolean + nameNotNil: Boolean + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + entity_type_id field predicates + """ + entityTypeID: ID + entityTypeIDNEQ: ID + entityTypeIDIn: [ID!] + entityTypeIDNotIn: [ID!] + entityTypeIDGT: ID + entityTypeIDGTE: ID + entityTypeIDLT: ID + entityTypeIDLTE: ID + entityTypeIDContains: ID + entityTypeIDHasPrefix: ID + entityTypeIDHasSuffix: ID + entityTypeIDIsNil: Boolean + entityTypeIDNotNil: Boolean + entityTypeIDEqualFold: ID + entityTypeIDContainsFold: ID + """ + status field predicates + """ + status: String + statusNEQ: String + statusIn: [String!] + statusNotIn: [String!] + statusGT: String + statusGTE: String + statusLT: String + statusLTE: String + statusContains: String + statusHasPrefix: String + statusHasSuffix: String + statusIsNil: Boolean + statusNotNil: Boolean + statusEqualFold: String + statusContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + contacts edge predicates + """ + hasContacts: Boolean + hasContactsWith: [ContactWhereInput!] + """ + documents edge predicates + """ + hasDocuments: Boolean + hasDocumentsWith: [DocumentDataWhereInput!] + """ + notes edge predicates + """ + hasNotes: Boolean + hasNotesWith: [NoteWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + entity_type edge predicates + """ + hasEntityType: Boolean + hasEntityTypeWith: [EntityTypeWhereInput!] +} +type Event implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map + user: [User!] + group: [Group!] + integration: [Integration!] + organization: [Organization!] + invite: [Invite!] + feature: [Feature!] + entitlementplan: [EntitlementPlan!] + entitlementplanfeature: [EntitlementPlanFeature!] + personalAccessToken: [PersonalAccessToken!] + oauth2token: [OhAuthTooToken!] + hush: [Hush!] + orgmembership: [OrgMembership!] + groupmembership: [GroupMembership!] + entitlement: [Entitlement!] + webhook: [Webhook!] + subscriber: [Subscriber!] +} +""" +Return response for createBulkEvent mutation +""" +type EventBulkCreatePayload { + """ + Created events + """ + events: [Event!] +} +""" +A connection to a list of items. +""" +type EventConnection { + """ + A list of edges. + """ + edges: [EventEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createEvent mutation +""" +type EventCreatePayload { + """ + Created event + """ + event: Event! +} +""" +Return response for deleteEvent mutation +""" +type EventDeletePayload { + """ + Deleted event ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type EventEdge { + """ + The item at the end of the edge. + """ + node: Event + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EventHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EventHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map +} +""" +A connection to a list of items. +""" +type EventHistoryConnection { + """ + A list of edges. + """ + edges: [EventHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EventHistoryEdge { + """ + The item at the end of the edge. + """ + node: EventHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EventHistoryOpType is enum for the field operation +""" +enum EventHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EventHistoryWhereInput is used for filtering EventHistory objects. +Input was generated by ent. +""" +input EventHistoryWhereInput { + not: EventHistoryWhereInput + and: [EventHistoryWhereInput!] + or: [EventHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EventHistoryOpType + operationNEQ: EventHistoryOpType + operationIn: [EventHistoryOpType!] + operationNotIn: [EventHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + event_id field predicates + """ + eventID: String + eventIDNEQ: String + eventIDIn: [String!] + eventIDNotIn: [String!] + eventIDGT: String + eventIDGTE: String + eventIDLT: String + eventIDLTE: String + eventIDContains: String + eventIDHasPrefix: String + eventIDHasSuffix: String + eventIDIsNil: Boolean + eventIDNotNil: Boolean + eventIDEqualFold: String + eventIDContainsFold: String + """ + correlation_id field predicates + """ + correlationID: String + correlationIDNEQ: String + correlationIDIn: [String!] + correlationIDNotIn: [String!] + correlationIDGT: String + correlationIDGTE: String + correlationIDLT: String + correlationIDLTE: String + correlationIDContains: String + correlationIDHasPrefix: String + correlationIDHasSuffix: String + correlationIDIsNil: Boolean + correlationIDNotNil: Boolean + correlationIDEqualFold: String + correlationIDContainsFold: String + """ + event_type field predicates + """ + eventType: String + eventTypeNEQ: String + eventTypeIn: [String!] + eventTypeNotIn: [String!] + eventTypeGT: String + eventTypeGTE: String + eventTypeLT: String + eventTypeLTE: String + eventTypeContains: String + eventTypeHasPrefix: String + eventTypeHasSuffix: String + eventTypeEqualFold: String + eventTypeContainsFold: String +} +""" +Return response for updateEvent mutation +""" +type EventUpdatePayload { + """ + Updated event + """ + event: Event! +} +""" +EventWhereInput is used for filtering Event objects. +Input was generated by ent. +""" +input EventWhereInput { + not: EventWhereInput + and: [EventWhereInput!] + or: [EventWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + event_id field predicates + """ + eventID: String + eventIDNEQ: String + eventIDIn: [String!] + eventIDNotIn: [String!] + eventIDGT: String + eventIDGTE: String + eventIDLT: String + eventIDLTE: String + eventIDContains: String + eventIDHasPrefix: String + eventIDHasSuffix: String + eventIDIsNil: Boolean + eventIDNotNil: Boolean + eventIDEqualFold: String + eventIDContainsFold: String + """ + correlation_id field predicates + """ + correlationID: String + correlationIDNEQ: String + correlationIDIn: [String!] + correlationIDNotIn: [String!] + correlationIDGT: String + correlationIDGTE: String + correlationIDLT: String + correlationIDLTE: String + correlationIDContains: String + correlationIDHasPrefix: String + correlationIDHasSuffix: String + correlationIDIsNil: Boolean + correlationIDNotNil: Boolean + correlationIDEqualFold: String + correlationIDContainsFold: String + """ + event_type field predicates + """ + eventType: String + eventTypeNEQ: String + eventTypeIn: [String!] + eventTypeNotIn: [String!] + eventTypeGT: String + eventTypeGTE: String + eventTypeLT: String + eventTypeLTE: String + eventTypeContains: String + eventTypeHasPrefix: String + eventTypeHasSuffix: String + eventTypeEqualFold: String + eventTypeContainsFold: String + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] + """ + integration edge predicates + """ + hasIntegration: Boolean + hasIntegrationWith: [IntegrationWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + invite edge predicates + """ + hasInvite: Boolean + hasInviteWith: [InviteWhereInput!] + """ + feature edge predicates + """ + hasFeature: Boolean + hasFeatureWith: [FeatureWhereInput!] + """ + entitlementplan edge predicates + """ + hasEntitlementplan: Boolean + hasEntitlementplanWith: [EntitlementPlanWhereInput!] + """ + entitlementplanfeature edge predicates + """ + hasEntitlementplanfeature: Boolean + hasEntitlementplanfeatureWith: [EntitlementPlanFeatureWhereInput!] + """ + personal_access_token edge predicates + """ + hasPersonalAccessToken: Boolean + hasPersonalAccessTokenWith: [PersonalAccessTokenWhereInput!] + """ + oauth2token edge predicates + """ + hasOauth2token: Boolean + hasOauth2tokenWith: [OhAuthTooTokenWhereInput!] + """ + hush edge predicates + """ + hasHush: Boolean + hasHushWith: [HushWhereInput!] + """ + orgmembership edge predicates + """ + hasOrgmembership: Boolean + hasOrgmembershipWith: [OrgMembershipWhereInput!] + """ + groupmembership edge predicates + """ + hasGroupmembership: Boolean + hasGroupmembershipWith: [GroupMembershipWhereInput!] + """ + entitlement edge predicates + """ + hasEntitlement: Boolean + hasEntitlementWith: [EntitlementWhereInput!] + """ + webhook edge predicates + """ + hasWebhook: Boolean + hasWebhookWith: [WebhookWhereInput!] + """ + subscriber edge predicates + """ + hasSubscriber: Boolean + hasSubscriberWith: [SubscriberWhereInput!] +} +type Feature implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean! + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map + owner: Organization + plans: [EntitlementPlan!] + events: [Event!] + features: [EntitlementPlanFeature!] +} +""" +Return response for createBulkFeature mutation +""" +type FeatureBulkCreatePayload { + """ + Created features + """ + features: [Feature!] +} +""" +A connection to a list of items. +""" +type FeatureConnection { + """ + A list of edges. + """ + edges: [FeatureEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createFeature mutation +""" +type FeatureCreatePayload { + """ + Created feature + """ + feature: Feature! +} +""" +Return response for deleteFeature mutation +""" +type FeatureDeletePayload { + """ + Deleted feature ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type FeatureEdge { + """ + The item at the end of the edge. + """ + node: Feature + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type FeatureHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: FeatureHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean! + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map +} +""" +A connection to a list of items. +""" +type FeatureHistoryConnection { + """ + A list of edges. + """ + edges: [FeatureHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FeatureHistoryEdge { + """ + The item at the end of the edge. + """ + node: FeatureHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +FeatureHistoryOpType is enum for the field operation +""" +enum FeatureHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +FeatureHistoryWhereInput is used for filtering FeatureHistory objects. +Input was generated by ent. +""" +input FeatureHistoryWhereInput { + not: FeatureHistoryWhereInput + and: [FeatureHistoryWhereInput!] + or: [FeatureHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: FeatureHistoryOpType + operationNEQ: FeatureHistoryOpType + operationIn: [FeatureHistoryOpType!] + operationNotIn: [FeatureHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String +} +""" +Return response for updateFeature mutation +""" +type FeatureUpdatePayload { + """ + Updated feature + """ + feature: Feature! +} +""" +FeatureWhereInput is used for filtering Feature objects. +Input was generated by ent. +""" +input FeatureWhereInput { + not: FeatureWhereInput + and: [FeatureWhereInput!] + or: [FeatureWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + plans edge predicates + """ + hasPlans: Boolean + hasPlansWith: [EntitlementPlanWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [EntitlementPlanFeatureWhereInput!] +} +type File implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String + user: User + organization: [Organization!] + entity: [Entity!] + group: [Group!] +} +""" +Return response for createBulkFile mutation +""" +type FileBulkCreatePayload { + """ + Created files + """ + files: [File!] +} +""" +A connection to a list of items. +""" +type FileConnection { + """ + A list of edges. + """ + edges: [FileEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createFile mutation +""" +type FileCreatePayload { + """ + Created file + """ + file: File! +} +""" +Return response for deleteFile mutation +""" +type FileDeletePayload { + """ + Deleted file ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type FileEdge { + """ + The item at the end of the edge. + """ + node: File + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type FileHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: FileHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String +} +""" +A connection to a list of items. +""" +type FileHistoryConnection { + """ + A list of edges. + """ + edges: [FileHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FileHistoryEdge { + """ + The item at the end of the edge. + """ + node: FileHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +FileHistoryOpType is enum for the field operation +""" +enum FileHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +FileHistoryWhereInput is used for filtering FileHistory objects. +Input was generated by ent. +""" +input FileHistoryWhereInput { + not: FileHistoryWhereInput + and: [FileHistoryWhereInput!] + or: [FileHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: FileHistoryOpType + operationNEQ: FileHistoryOpType + operationIn: [FileHistoryOpType!] + operationNotIn: [FileHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + file_name field predicates + """ + fileName: String + fileNameNEQ: String + fileNameIn: [String!] + fileNameNotIn: [String!] + fileNameGT: String + fileNameGTE: String + fileNameLT: String + fileNameLTE: String + fileNameContains: String + fileNameHasPrefix: String + fileNameHasSuffix: String + fileNameEqualFold: String + fileNameContainsFold: String + """ + file_extension field predicates + """ + fileExtension: String + fileExtensionNEQ: String + fileExtensionIn: [String!] + fileExtensionNotIn: [String!] + fileExtensionGT: String + fileExtensionGTE: String + fileExtensionLT: String + fileExtensionLTE: String + fileExtensionContains: String + fileExtensionHasPrefix: String + fileExtensionHasSuffix: String + fileExtensionEqualFold: String + fileExtensionContainsFold: String + """ + file_size field predicates + """ + fileSize: Int + fileSizeNEQ: Int + fileSizeIn: [Int!] + fileSizeNotIn: [Int!] + fileSizeGT: Int + fileSizeGTE: Int + fileSizeLT: Int + fileSizeLTE: Int + fileSizeIsNil: Boolean + fileSizeNotNil: Boolean + """ + content_type field predicates + """ + contentType: String + contentTypeNEQ: String + contentTypeIn: [String!] + contentTypeNotIn: [String!] + contentTypeGT: String + contentTypeGTE: String + contentTypeLT: String + contentTypeLTE: String + contentTypeContains: String + contentTypeHasPrefix: String + contentTypeHasSuffix: String + contentTypeEqualFold: String + contentTypeContainsFold: String + """ + store_key field predicates + """ + storeKey: String + storeKeyNEQ: String + storeKeyIn: [String!] + storeKeyNotIn: [String!] + storeKeyGT: String + storeKeyGTE: String + storeKeyLT: String + storeKeyLTE: String + storeKeyContains: String + storeKeyHasPrefix: String + storeKeyHasSuffix: String + storeKeyEqualFold: String + storeKeyContainsFold: String + """ + category field predicates + """ + category: String + categoryNEQ: String + categoryIn: [String!] + categoryNotIn: [String!] + categoryGT: String + categoryGTE: String + categoryLT: String + categoryLTE: String + categoryContains: String + categoryHasPrefix: String + categoryHasSuffix: String + categoryIsNil: Boolean + categoryNotNil: Boolean + categoryEqualFold: String + categoryContainsFold: String + """ + annotation field predicates + """ + annotation: String + annotationNEQ: String + annotationIn: [String!] + annotationNotIn: [String!] + annotationGT: String + annotationGTE: String + annotationLT: String + annotationLTE: String + annotationContains: String + annotationHasPrefix: String + annotationHasSuffix: String + annotationIsNil: Boolean + annotationNotNil: Boolean + annotationEqualFold: String + annotationContainsFold: String +} +""" +Return response for updateFile mutation +""" +type FileUpdatePayload { + """ + Updated file + """ + file: File! +} +""" +FileWhereInput is used for filtering File objects. +Input was generated by ent. +""" +input FileWhereInput { + not: FileWhereInput + and: [FileWhereInput!] + or: [FileWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + file_name field predicates + """ + fileName: String + fileNameNEQ: String + fileNameIn: [String!] + fileNameNotIn: [String!] + fileNameGT: String + fileNameGTE: String + fileNameLT: String + fileNameLTE: String + fileNameContains: String + fileNameHasPrefix: String + fileNameHasSuffix: String + fileNameEqualFold: String + fileNameContainsFold: String + """ + file_extension field predicates + """ + fileExtension: String + fileExtensionNEQ: String + fileExtensionIn: [String!] + fileExtensionNotIn: [String!] + fileExtensionGT: String + fileExtensionGTE: String + fileExtensionLT: String + fileExtensionLTE: String + fileExtensionContains: String + fileExtensionHasPrefix: String + fileExtensionHasSuffix: String + fileExtensionEqualFold: String + fileExtensionContainsFold: String + """ + file_size field predicates + """ + fileSize: Int + fileSizeNEQ: Int + fileSizeIn: [Int!] + fileSizeNotIn: [Int!] + fileSizeGT: Int + fileSizeGTE: Int + fileSizeLT: Int + fileSizeLTE: Int + fileSizeIsNil: Boolean + fileSizeNotNil: Boolean + """ + content_type field predicates + """ + contentType: String + contentTypeNEQ: String + contentTypeIn: [String!] + contentTypeNotIn: [String!] + contentTypeGT: String + contentTypeGTE: String + contentTypeLT: String + contentTypeLTE: String + contentTypeContains: String + contentTypeHasPrefix: String + contentTypeHasSuffix: String + contentTypeEqualFold: String + contentTypeContainsFold: String + """ + store_key field predicates + """ + storeKey: String + storeKeyNEQ: String + storeKeyIn: [String!] + storeKeyNotIn: [String!] + storeKeyGT: String + storeKeyGTE: String + storeKeyLT: String + storeKeyLTE: String + storeKeyContains: String + storeKeyHasPrefix: String + storeKeyHasSuffix: String + storeKeyEqualFold: String + storeKeyContainsFold: String + """ + category field predicates + """ + category: String + categoryNEQ: String + categoryIn: [String!] + categoryNotIn: [String!] + categoryGT: String + categoryGTE: String + categoryLT: String + categoryLTE: String + categoryContains: String + categoryHasPrefix: String + categoryHasSuffix: String + categoryIsNil: Boolean + categoryNotNil: Boolean + categoryEqualFold: String + categoryContainsFold: String + """ + annotation field predicates + """ + annotation: String + annotationNEQ: String + annotationIn: [String!] + annotationNotIn: [String!] + annotationGT: String + annotationGTE: String + annotationLT: String + annotationLTE: String + annotationContains: String + annotationHasPrefix: String + annotationHasSuffix: String + annotationIsNil: Boolean + annotationNotNil: Boolean + annotationEqualFold: String + annotationContainsFold: String + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] +} +union GlobalSearchResult = OrganizationSearchResult | GroupSearchResult | UserSearchResult | SubscriberSearchResult +type GlobalSearchResultConnection { + page: PageInfo! + nodes: [GlobalSearchResult!]! +} +type Group implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String! + owner: Organization + setting: GroupSetting! + users: [User!] + events: [Event!] + integrations: [Integration!] + files: [File!] + members: [GroupMembership!] +} +""" +Return response for createBulkGroup mutation +""" +type GroupBulkCreatePayload { + """ + Created groups + """ + groups: [Group!] +} +""" +A connection to a list of items. +""" +type GroupConnection { + """ + A list of edges. + """ + edges: [GroupEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createGroup mutation +""" +type GroupCreatePayload { + """ + Created group + """ + group: Group! +} +""" +Return response for deleteGroup mutation +""" +type GroupDeletePayload { + """ + Deleted group ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type GroupEdge { + """ + The item at the end of the edge. + """ + node: Group + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String! +} +""" +A connection to a list of items. +""" +type GroupHistoryConnection { + """ + A list of edges. + """ + edges: [GroupHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupHistoryOpType is enum for the field operation +""" +enum GroupHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for GroupHistory connections +""" +input GroupHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order GroupHistories. + """ + field: GroupHistoryOrderField! +} +""" +Properties by which GroupHistory connections can be ordered. +""" +enum GroupHistoryOrderField { + name + display_name +} +""" +GroupHistoryWhereInput is used for filtering GroupHistory objects. +Input was generated by ent. +""" +input GroupHistoryWhereInput { + not: GroupHistoryWhereInput + and: [GroupHistoryWhereInput!] + or: [GroupHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupHistoryOpType + operationNEQ: GroupHistoryOpType + operationIn: [GroupHistoryOpType!] + operationNotIn: [GroupHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String +} +type GroupMembership implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: GroupMembershipRole! + groupID: ID! + userID: ID! + group: Group! + user: User! + events: [Event!] +} +""" +Return response for createBulkGroupMembership mutation +""" +type GroupMembershipBulkCreatePayload { + """ + Created groupMemberships + """ + groupMemberships: [GroupMembership!] +} +""" +A connection to a list of items. +""" +type GroupMembershipConnection { + """ + A list of edges. + """ + edges: [GroupMembershipEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createGroupMembership mutation +""" +type GroupMembershipCreatePayload { + """ + Created groupMembership + """ + groupMembership: GroupMembership! +} +""" +Return response for deleteGroupMembership mutation +""" +type GroupMembershipDeletePayload { + """ + Deleted groupMembership ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type GroupMembershipEdge { + """ + The item at the end of the edge. + """ + node: GroupMembership + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupMembershipHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupMembershipHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: GroupMembershipHistoryRole! + groupID: String! + userID: String! +} +""" +A connection to a list of items. +""" +type GroupMembershipHistoryConnection { + """ + A list of edges. + """ + edges: [GroupMembershipHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupMembershipHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupMembershipHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupMembershipHistoryOpType is enum for the field operation +""" +enum GroupMembershipHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +GroupMembershipHistoryRole is enum for the field role +""" +enum GroupMembershipHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +GroupMembershipHistoryWhereInput is used for filtering GroupMembershipHistory objects. +Input was generated by ent. +""" +input GroupMembershipHistoryWhereInput { + not: GroupMembershipHistoryWhereInput + and: [GroupMembershipHistoryWhereInput!] + or: [GroupMembershipHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupMembershipHistoryOpType + operationNEQ: GroupMembershipHistoryOpType + operationIn: [GroupMembershipHistoryOpType!] + operationNotIn: [GroupMembershipHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: GroupMembershipHistoryRole + roleNEQ: GroupMembershipHistoryRole + roleIn: [GroupMembershipHistoryRole!] + roleNotIn: [GroupMembershipHistoryRole!] + """ + group_id field predicates + """ + groupID: String + groupIDNEQ: String + groupIDIn: [String!] + groupIDNotIn: [String!] + groupIDGT: String + groupIDGTE: String + groupIDLT: String + groupIDLTE: String + groupIDContains: String + groupIDHasPrefix: String + groupIDHasSuffix: String + groupIDEqualFold: String + groupIDContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDEqualFold: String + userIDContainsFold: String +} +""" +GroupMembershipRole is enum for the field role +""" +enum GroupMembershipRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +Return response for updateGroupMembership mutation +""" +type GroupMembershipUpdatePayload { + """ + Updated groupMembership + """ + groupMembership: GroupMembership! +} +""" +GroupMembershipWhereInput is used for filtering GroupMembership objects. +Input was generated by ent. +""" +input GroupMembershipWhereInput { + not: GroupMembershipWhereInput + and: [GroupMembershipWhereInput!] + or: [GroupMembershipWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: GroupMembershipRole + roleNEQ: GroupMembershipRole + roleIn: [GroupMembershipRole!] + roleNotIn: [GroupMembershipRole!] + groupID: String + userID: String +} +""" +Ordering options for Group connections +""" +input GroupOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Groups. + """ + field: GroupOrderField! +} +""" +Properties by which Group connections can be ordered. +""" +enum GroupOrderField { + name + display_name +} +type GroupSearchResult { + groups: [Group!] +} +type GroupSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility! + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy! + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + """ + the group id associated with the settings + """ + groupID: ID + group: Group +} +""" +Return response for createBulkGroupSetting mutation +""" +type GroupSettingBulkCreatePayload { + """ + Created groupSettings + """ + groupSettings: [GroupSetting!] +} +""" +A connection to a list of items. +""" +type GroupSettingConnection { + """ + A list of edges. + """ + edges: [GroupSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createGroupSetting mutation +""" +type GroupSettingCreatePayload { + """ + Created groupSetting + """ + groupSetting: GroupSetting! +} +""" +Return response for deleteGroupSetting mutation +""" +type GroupSettingDeletePayload { + """ + Deleted groupSetting ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type GroupSettingEdge { + """ + The item at the end of the edge. + """ + node: GroupSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingHistoryVisibility! + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingHistoryJoinPolicy! + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + """ + the group id associated with the settings + """ + groupID: String +} +""" +A connection to a list of items. +""" +type GroupSettingHistoryConnection { + """ + A list of edges. + """ + edges: [GroupSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupSettingHistoryJoinPolicy is enum for the field join_policy +""" +enum GroupSettingHistoryJoinPolicy @goModel(model: "github.com/theopenlane/core/pkg/enums.JoinPolicy") { + OPEN + INVITE_ONLY + APPLICATION_ONLY + INVITE_OR_APPLICATION +} +""" +GroupSettingHistoryOpType is enum for the field operation +""" +enum GroupSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +GroupSettingHistoryVisibility is enum for the field visibility +""" +enum GroupSettingHistoryVisibility @goModel(model: "github.com/theopenlane/core/pkg/enums.Visibility") { + PUBLIC + PRIVATE +} +""" +GroupSettingHistoryWhereInput is used for filtering GroupSettingHistory objects. +Input was generated by ent. +""" +input GroupSettingHistoryWhereInput { + not: GroupSettingHistoryWhereInput + and: [GroupSettingHistoryWhereInput!] + or: [GroupSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupSettingHistoryOpType + operationNEQ: GroupSettingHistoryOpType + operationIn: [GroupSettingHistoryOpType!] + operationNotIn: [GroupSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + visibility field predicates + """ + visibility: GroupSettingHistoryVisibility + visibilityNEQ: GroupSettingHistoryVisibility + visibilityIn: [GroupSettingHistoryVisibility!] + visibilityNotIn: [GroupSettingHistoryVisibility!] + """ + join_policy field predicates + """ + joinPolicy: GroupSettingHistoryJoinPolicy + joinPolicyNEQ: GroupSettingHistoryJoinPolicy + joinPolicyIn: [GroupSettingHistoryJoinPolicy!] + joinPolicyNotIn: [GroupSettingHistoryJoinPolicy!] + """ + sync_to_slack field predicates + """ + syncToSlack: Boolean + syncToSlackNEQ: Boolean + syncToSlackIsNil: Boolean + syncToSlackNotNil: Boolean + """ + sync_to_github field predicates + """ + syncToGithub: Boolean + syncToGithubNEQ: Boolean + syncToGithubIsNil: Boolean + syncToGithubNotNil: Boolean + """ + group_id field predicates + """ + groupID: String + groupIDNEQ: String + groupIDIn: [String!] + groupIDNotIn: [String!] + groupIDGT: String + groupIDGTE: String + groupIDLT: String + groupIDLTE: String + groupIDContains: String + groupIDHasPrefix: String + groupIDHasSuffix: String + groupIDIsNil: Boolean + groupIDNotNil: Boolean + groupIDEqualFold: String + groupIDContainsFold: String +} +""" +GroupSettingJoinPolicy is enum for the field join_policy +""" +enum GroupSettingJoinPolicy @goModel(model: "github.com/theopenlane/core/pkg/enums.JoinPolicy") { + OPEN + INVITE_ONLY + APPLICATION_ONLY + INVITE_OR_APPLICATION +} +""" +Return response for updateGroupSetting mutation +""" +type GroupSettingUpdatePayload { + """ + Updated groupSetting + """ + groupSetting: GroupSetting! +} +""" +GroupSettingVisibility is enum for the field visibility +""" +enum GroupSettingVisibility @goModel(model: "github.com/theopenlane/core/pkg/enums.Visibility") { + PUBLIC + PRIVATE +} +""" +GroupSettingWhereInput is used for filtering GroupSetting objects. +Input was generated by ent. +""" +input GroupSettingWhereInput { + not: GroupSettingWhereInput + and: [GroupSettingWhereInput!] + or: [GroupSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + visibility field predicates + """ + visibility: GroupSettingVisibility + visibilityNEQ: GroupSettingVisibility + visibilityIn: [GroupSettingVisibility!] + visibilityNotIn: [GroupSettingVisibility!] + """ + join_policy field predicates + """ + joinPolicy: GroupSettingJoinPolicy + joinPolicyNEQ: GroupSettingJoinPolicy + joinPolicyIn: [GroupSettingJoinPolicy!] + joinPolicyNotIn: [GroupSettingJoinPolicy!] + """ + sync_to_slack field predicates + """ + syncToSlack: Boolean + syncToSlackNEQ: Boolean + syncToSlackIsNil: Boolean + syncToSlackNotNil: Boolean + """ + sync_to_github field predicates + """ + syncToGithub: Boolean + syncToGithubNEQ: Boolean + syncToGithubIsNil: Boolean + syncToGithubNotNil: Boolean + """ + group_id field predicates + """ + groupID: ID + groupIDNEQ: ID + groupIDIn: [ID!] + groupIDNotIn: [ID!] + groupIDGT: ID + groupIDGTE: ID + groupIDLT: ID + groupIDLTE: ID + groupIDContains: ID + groupIDHasPrefix: ID + groupIDHasSuffix: ID + groupIDIsNil: Boolean + groupIDNotNil: Boolean + groupIDEqualFold: ID + groupIDContainsFold: ID + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] +} +""" +Return response for updateGroup mutation +""" +type GroupUpdatePayload { + """ + Updated group + """ + group: Group! +} +""" +GroupWhereInput is used for filtering Group objects. +Input was generated by ent. +""" +input GroupWhereInput { + not: GroupWhereInput + and: [GroupWhereInput!] + or: [GroupWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [GroupSettingWhereInput!] + """ + users edge predicates + """ + hasUsers: Boolean + hasUsersWith: [UserWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + members edge predicates + """ + hasMembers: Boolean + hasMembersWith: [GroupMembershipWhereInput!] +} +type Hush implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String + """ + the integration associated with the secret + """ + integrations: [Integration!] + organization: [Organization!] + events: [Event!] +} +""" +Return response for createBulkHush mutation +""" +type HushBulkCreatePayload { + """ + Created hushs + """ + hushes: [Hush!] +} +""" +A connection to a list of items. +""" +type HushConnection { + """ + A list of edges. + """ + edges: [HushEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createHush mutation +""" +type HushCreatePayload { + """ + Created hush + """ + hush: Hush! +} +""" +Return response for deleteHush mutation +""" +type HushDeletePayload { + """ + Deleted hush ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type HushEdge { + """ + The item at the end of the edge. + """ + node: Hush + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type HushHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: HushHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String +} +""" +A connection to a list of items. +""" +type HushHistoryConnection { + """ + A list of edges. + """ + edges: [HushHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type HushHistoryEdge { + """ + The item at the end of the edge. + """ + node: HushHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +HushHistoryOpType is enum for the field operation +""" +enum HushHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for HushHistory connections +""" +input HushHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order HushHistories. + """ + field: HushHistoryOrderField! +} +""" +Properties by which HushHistory connections can be ordered. +""" +enum HushHistoryOrderField { + name + kind +} +""" +HushHistoryWhereInput is used for filtering HushHistory objects. +Input was generated by ent. +""" +input HushHistoryWhereInput { + not: HushHistoryWhereInput + and: [HushHistoryWhereInput!] + or: [HushHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: HushHistoryOpType + operationNEQ: HushHistoryOpType + operationIn: [HushHistoryOpType!] + operationNotIn: [HushHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + secret_name field predicates + """ + secretName: String + secretNameNEQ: String + secretNameIn: [String!] + secretNameNotIn: [String!] + secretNameGT: String + secretNameGTE: String + secretNameLT: String + secretNameLTE: String + secretNameContains: String + secretNameHasPrefix: String + secretNameHasSuffix: String + secretNameIsNil: Boolean + secretNameNotNil: Boolean + secretNameEqualFold: String + secretNameContainsFold: String +} +""" +Ordering options for Hush connections +""" +input HushOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Hushes. + """ + field: HushOrderField! +} +""" +Properties by which Hush connections can be ordered. +""" +enum HushOrderField { + name + kind +} +""" +Return response for updateHush mutation +""" +type HushUpdatePayload { + """ + Updated hush + """ + hush: Hush! +} +""" +HushWhereInput is used for filtering Hush objects. +Input was generated by ent. +""" +input HushWhereInput { + not: HushWhereInput + and: [HushWhereInput!] + or: [HushWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + secret_name field predicates + """ + secretName: String + secretNameNEQ: String + secretNameIn: [String!] + secretNameNotIn: [String!] + secretNameGT: String + secretNameGTE: String + secretNameLT: String + secretNameLTE: String + secretNameContains: String + secretNameHasPrefix: String + secretNameHasSuffix: String + secretNameIsNil: Boolean + secretNameNotNil: Boolean + secretNameEqualFold: String + secretNameContainsFold: String + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Integration implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String + owner: Organization + """ + the secrets associated with the integration + """ + secrets: [Hush!] + """ + the oauth2 tokens associated with the integration + """ + oauth2tokens: [OhAuthTooToken!] + events: [Event!] + webhooks: [Webhook!] +} +""" +Return response for createBulkIntegration mutation +""" +type IntegrationBulkCreatePayload { + """ + Created integrations + """ + integrations: [Integration!] +} +""" +A connection to a list of items. +""" +type IntegrationConnection { + """ + A list of edges. + """ + edges: [IntegrationEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createIntegration mutation +""" +type IntegrationCreatePayload { + """ + Created integration + """ + integration: Integration! +} +""" +Return response for deleteIntegration mutation +""" +type IntegrationDeletePayload { + """ + Deleted integration ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type IntegrationEdge { + """ + The item at the end of the edge. + """ + node: Integration + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type IntegrationHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: IntegrationHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String +} +""" +A connection to a list of items. +""" +type IntegrationHistoryConnection { + """ + A list of edges. + """ + edges: [IntegrationHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type IntegrationHistoryEdge { + """ + The item at the end of the edge. + """ + node: IntegrationHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +IntegrationHistoryOpType is enum for the field operation +""" +enum IntegrationHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for IntegrationHistory connections +""" +input IntegrationHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order IntegrationHistories. + """ + field: IntegrationHistoryOrderField! +} +""" +Properties by which IntegrationHistory connections can be ordered. +""" +enum IntegrationHistoryOrderField { + name + kind +} +""" +IntegrationHistoryWhereInput is used for filtering IntegrationHistory objects. +Input was generated by ent. +""" +input IntegrationHistoryWhereInput { + not: IntegrationHistoryWhereInput + and: [IntegrationHistoryWhereInput!] + or: [IntegrationHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: IntegrationHistoryOpType + operationNEQ: IntegrationHistoryOpType + operationIn: [IntegrationHistoryOpType!] + operationNotIn: [IntegrationHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String +} +""" +Ordering options for Integration connections +""" +input IntegrationOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Integrations. + """ + field: IntegrationOrderField! +} +""" +Properties by which Integration connections can be ordered. +""" +enum IntegrationOrderField { + name + kind +} +""" +Return response for updateIntegration mutation +""" +type IntegrationUpdatePayload { + """ + Updated integration + """ + integration: Integration! +} +""" +IntegrationWhereInput is used for filtering Integration objects. +Input was generated by ent. +""" +input IntegrationWhereInput { + not: IntegrationWhereInput + and: [IntegrationWhereInput!] + or: [IntegrationWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + secrets edge predicates + """ + hasSecrets: Boolean + hasSecretsWith: [HushWhereInput!] + """ + oauth2tokens edge predicates + """ + hasOauth2tokens: Boolean + hasOauth2tokensWith: [OhAuthTooTokenWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + webhooks edge predicates + """ + hasWebhooks: Boolean + hasWebhooksWith: [WebhookWhereInput!] +} +type Invite implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + """ + the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + """ + recipient: String! + """ + the status of the invitation + """ + status: InviteInviteStatus! + role: InviteRole! + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int! + """ + the user who initiated the invitation + """ + requestorID: String + owner: Organization + events: [Event!] +} +""" +Return response for createBulkInvite mutation +""" +type InviteBulkCreatePayload { + """ + Created invites + """ + invites: [Invite!] +} +""" +A connection to a list of items. +""" +type InviteConnection { + """ + A list of edges. + """ + edges: [InviteEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createInvite mutation +""" +type InviteCreatePayload { + """ + Created invite + """ + invite: Invite! +} +""" +Return response for deleteInvite mutation +""" +type InviteDeletePayload { + """ + Deleted invite ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type InviteEdge { + """ + The item at the end of the edge. + """ + node: Invite + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +InviteInviteStatus is enum for the field status +""" +enum InviteInviteStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.InviteStatus") { + INVITATION_SENT + APPROVAL_REQUIRED + INVITATION_ACCEPTED + INVITATION_EXPIRED +} +""" +InviteRole is enum for the field role +""" +enum InviteRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +Return response for updateInvite mutation +""" +type InviteUpdatePayload { + """ + Updated invite + """ + invite: Invite! +} +""" +InviteWhereInput is used for filtering Invite objects. +Input was generated by ent. +""" +input InviteWhereInput { + not: InviteWhereInput + and: [InviteWhereInput!] + or: [InviteWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + expires field predicates + """ + expires: Time + expiresNEQ: Time + expiresIn: [Time!] + expiresNotIn: [Time!] + expiresGT: Time + expiresGTE: Time + expiresLT: Time + expiresLTE: Time + expiresIsNil: Boolean + expiresNotNil: Boolean + """ + recipient field predicates + """ + recipient: String + recipientNEQ: String + recipientIn: [String!] + recipientNotIn: [String!] + recipientGT: String + recipientGTE: String + recipientLT: String + recipientLTE: String + recipientContains: String + recipientHasPrefix: String + recipientHasSuffix: String + recipientEqualFold: String + recipientContainsFold: String + """ + status field predicates + """ + status: InviteInviteStatus + statusNEQ: InviteInviteStatus + statusIn: [InviteInviteStatus!] + statusNotIn: [InviteInviteStatus!] + """ + role field predicates + """ + role: InviteRole + roleNEQ: InviteRole + roleIn: [InviteRole!] + roleNotIn: [InviteRole!] + """ + send_attempts field predicates + """ + sendAttempts: Int + sendAttemptsNEQ: Int + sendAttemptsIn: [Int!] + sendAttemptsNotIn: [Int!] + sendAttemptsGT: Int + sendAttemptsGTE: Int + sendAttemptsLT: Int + sendAttemptsLTE: Int + """ + requestor_id field predicates + """ + requestorID: String + requestorIDNEQ: String + requestorIDIn: [String!] + requestorIDNotIn: [String!] + requestorIDGT: String + requestorIDGTE: String + requestorIDLT: String + requestorIDLTE: String + requestorIDContains: String + requestorIDHasPrefix: String + requestorIDHasSuffix: String + requestorIDIsNil: Boolean + requestorIDNotNil: Boolean + requestorIDEqualFold: String + requestorIDContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +""" +A valid JSON string. +""" +scalar JSON +""" +The builtin Map type +""" +scalar Map +type Mutation { + """ + Create a new apiToken + """ + createAPIToken( + """ + values of the apiToken + """ + input: CreateAPITokenInput! + ): APITokenCreatePayload! + """ + Create multiple new apiTokens + """ + createBulkAPIToken( + """ + values of the apiToken + """ + input: [CreateAPITokenInput!] + ): APITokenBulkCreatePayload! + """ + Create multiple new apiTokens via file upload + """ + createBulkCSVAPIToken( + """ + csv file containing values of the apiToken + """ + input: Upload! + ): APITokenBulkCreatePayload! + """ + Update an existing apiToken + """ + updateAPIToken( + """ + ID of the apiToken + """ + id: ID! + + """ + New values for the apiToken + """ + input: UpdateAPITokenInput! + ): APITokenUpdatePayload! + """ + Delete an existing apiToken + """ + deleteAPIToken( + """ + ID of the apiToken + """ + id: ID! + ): APITokenDeletePayload! + """ + Create a new contact + """ + createContact( + """ + values of the contact + """ + input: CreateContactInput! + ): ContactCreatePayload! + """ + Create multiple new contacts + """ + createBulkContact( + """ + values of the contact + """ + input: [CreateContactInput!] + ): ContactBulkCreatePayload! + """ + Create multiple new contacts via file upload + """ + createBulkCSVContact( + """ + csv file containing values of the contact + """ + input: Upload! + ): ContactBulkCreatePayload! + """ + Update an existing contact + """ + updateContact( + """ + ID of the contact + """ + id: ID! + + """ + New values for the contact + """ + input: UpdateContactInput! + ): ContactUpdatePayload! + """ + Delete an existing contact + """ + deleteContact( + """ + ID of the contact + """ + id: ID! + ): ContactDeletePayload! + """ + Create a new documentData + """ + createDocumentData( + """ + values of the documentData + """ + input: CreateDocumentDataInput! + ): DocumentDataCreatePayload! + """ + Create multiple new documentData + """ + createBulkDocumentData( + """ + values of the documentData + """ + input: [CreateDocumentDataInput!] + ): DocumentDataBulkCreatePayload! + """ + Create multiple new documentData via file upload + """ + createBulkCSVDocumentData( + """ + csv file containing values of the documentData + """ + input: Upload! + ): DocumentDataBulkCreatePayload! + """ + Update an existing documentData + """ + updateDocumentData( + """ + ID of the documentData + """ + id: ID! + + """ + New values for the documentData + """ + input: UpdateDocumentDataInput! + ): DocumentDataUpdatePayload! + """ + Delete an existing documentData + """ + deleteDocumentData( + """ + ID of the documentData + """ + id: ID! + ): DocumentDataDeletePayload! + """ + Create a new entitlement + """ + createEntitlement( + """ + values of the entitlement + """ + input: CreateEntitlementInput! + ): EntitlementCreatePayload! + """ + Create multiple new entitlements + """ + createBulkEntitlement( + """ + values of the entitlement + """ + input: [CreateEntitlementInput!] + ): EntitlementBulkCreatePayload! + """ + Create multiple new entitlements via file upload + """ + createBulkCSVEntitlement( + """ + csv file containing values of the entitlement + """ + input: Upload! + ): EntitlementBulkCreatePayload! + """ + Update an existing entitlement + """ + updateEntitlement( + """ + ID of the entitlement + """ + id: ID! + + """ + New values for the entitlement + """ + input: UpdateEntitlementInput! + ): EntitlementUpdatePayload! + """ + Delete an existing entitlement + """ + deleteEntitlement( + """ + ID of the entitlement + """ + id: ID! + ): EntitlementDeletePayload! + """ + Create a new entitlementPlan + """ + createEntitlementPlan( + """ + values of the entitlementPlan + """ + input: CreateEntitlementPlanInput! + ): EntitlementPlanCreatePayload! + """ + Create multiple new entitlementPlans + """ + createBulkEntitlementPlan( + """ + values of the entitlementPlan + """ + input: [CreateEntitlementPlanInput!] + ): EntitlementPlanBulkCreatePayload! + """ + Create multiple new entitlementPlans via file upload + """ + createBulkCSVEntitlementPlan( + """ + csv file containing values of the entitlementPlan + """ + input: Upload! + ): EntitlementPlanBulkCreatePayload! + """ + Update an existing entitlementPlan + """ + updateEntitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + + """ + New values for the entitlementPlan + """ + input: UpdateEntitlementPlanInput! + ): EntitlementPlanUpdatePayload! + """ + Delete an existing entitlementPlan + """ + deleteEntitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + ): EntitlementPlanDeletePayload! + """ + Create a new entitlementPlanFeature + """ + createEntitlementPlanFeature( + """ + values of the entitlementPlanFeature + """ + input: CreateEntitlementPlanFeatureInput! + ): EntitlementPlanFeatureCreatePayload! + """ + Create multiple new entitlementPlanFeatures + """ + createBulkEntitlementPlanFeature( + """ + values of the entitlementPlanFeature + """ + input: [CreateEntitlementPlanFeatureInput!] + ): EntitlementPlanFeatureBulkCreatePayload! + """ + Create multiple new entitlementPlanFeatures via file upload + """ + createBulkCSVEntitlementPlanFeature( + """ + csv file containing values of the entitlementPlanFeature + """ + input: Upload! + ): EntitlementPlanFeatureBulkCreatePayload! + """ + Update an existing entitlementPlanFeature + """ + updateEntitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + + """ + New values for the entitlementPlanFeature + """ + input: UpdateEntitlementPlanFeatureInput! + ): EntitlementPlanFeatureUpdatePayload! + """ + Delete an existing entitlementPlanFeature + """ + deleteEntitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + ): EntitlementPlanFeatureDeletePayload! + """ + Create a new entity + """ + createEntity( + """ + values of the entity + """ + input: CreateEntityInput! + ): EntityCreatePayload! + """ + Create multiple new entities + """ + createBulkEntity( + """ + values of the entity + """ + input: [CreateEntityInput!] + ): EntityBulkCreatePayload! + """ + Create multiple new entities via file upload + """ + createBulkCSVEntity( + """ + csv file containing values of the entity + """ + input: Upload! + ): EntityBulkCreatePayload! + """ + Update an existing entity + """ + updateEntity( + """ + ID of the entity + """ + id: ID! + + """ + New values for the entity + """ + input: UpdateEntityInput! + ): EntityUpdatePayload! + """ + Delete an existing entity + """ + deleteEntity( + """ + ID of the entity + """ + id: ID! + ): EntityDeletePayload! + """ + Create a new entityType + """ + createEntityType( + """ + values of the entityType + """ + input: CreateEntityTypeInput! + ): EntityTypeCreatePayload! + """ + Create multiple new entityTypes + """ + createBulkEntityType( + """ + values of the entityType + """ + input: [CreateEntityTypeInput!] + ): EntityTypeBulkCreatePayload! + """ + Create multiple new entityTypes via file upload + """ + createBulkCSVEntityType( + """ + csv file containing values of the entityType + """ + input: Upload! + ): EntityTypeBulkCreatePayload! + """ + Update an existing entityType + """ + updateEntityType( + """ + ID of the entityType + """ + id: ID! + + """ + New values for the entityType + """ + input: UpdateEntityTypeInput! + ): EntityTypeUpdatePayload! + """ + Delete an existing entityType + """ + deleteEntityType( + """ + ID of the entityType + """ + id: ID! + ): EntityTypeDeletePayload! + """ + Create a new event + """ + createEvent( + """ + values of the event + """ + input: CreateEventInput! + ): EventCreatePayload! + """ + Create multiple new events + """ + createBulkEvent( + """ + values of the event + """ + input: [CreateEventInput!] + ): EventBulkCreatePayload! + """ + Create multiple new events via file upload + """ + createBulkCSVEvent( + """ + csv file containing values of the event + """ + input: Upload! + ): EventBulkCreatePayload! + """ + Update an existing event + """ + updateEvent( + """ + ID of the event + """ + id: ID! + + """ + New values for the event + """ + input: UpdateEventInput! + ): EventUpdatePayload! + """ + Delete an existing event + """ + deleteEvent( + """ + ID of the event + """ + id: ID! + ): EventDeletePayload! + """ + Create a new feature + """ + createFeature( + """ + values of the feature + """ + input: CreateFeatureInput! + ): FeatureCreatePayload! + """ + Create multiple new features + """ + createBulkFeature( + """ + values of the feature + """ + input: [CreateFeatureInput!] + ): FeatureBulkCreatePayload! + """ + Create multiple new features via file upload + """ + createBulkCSVFeature( + """ + csv file containing values of the feature + """ + input: Upload! + ): FeatureBulkCreatePayload! + """ + Update an existing feature + """ + updateFeature( + """ + ID of the feature + """ + id: ID! + + """ + New values for the feature + """ + input: UpdateFeatureInput! + ): FeatureUpdatePayload! + """ + Delete an existing feature + """ + deleteFeature( + """ + ID of the feature + """ + id: ID! + ): FeatureDeletePayload! + """ + Create a new file + """ + createFile( + """ + values of the file + """ + input: CreateFileInput! + ): FileCreatePayload! + """ + Create multiple new files + """ + createBulkFile( + """ + values of the file + """ + input: [CreateFileInput!] + ): FileBulkCreatePayload! + """ + Create multiple new files via file upload + """ + createBulkCSVFile( + """ + csv file containing values of the file + """ + input: Upload! + ): FileBulkCreatePayload! + """ + Update an existing file + """ + updateFile( + """ + ID of the file + """ + id: ID! + + """ + New values for the file + """ + input: UpdateFileInput! + ): FileUpdatePayload! + """ + Delete an existing file + """ + deleteFile( + """ + ID of the file + """ + id: ID! + ): FileDeletePayload! + """ + Create a new group + """ + createGroup( + """ + values of the group + """ + input: CreateGroupInput! + ): GroupCreatePayload! + """ + Create multiple new groups + """ + createBulkGroup( + """ + values of the group + """ + input: [CreateGroupInput!] + ): GroupBulkCreatePayload! + """ + Create multiple new groups via file upload + """ + createBulkCSVGroup( + """ + csv file containing values of the group + """ + input: Upload! + ): GroupBulkCreatePayload! + """ + Update an existing group + """ + updateGroup( + """ + ID of the group + """ + id: ID! + + """ + New values for the group + """ + input: UpdateGroupInput! + ): GroupUpdatePayload! + """ + Delete an existing group + """ + deleteGroup( + """ + ID of the group + """ + id: ID! + ): GroupDeletePayload! + """ + Create a new groupMembership + """ + createGroupMembership( + """ + values of the groupMembership + """ + input: CreateGroupMembershipInput! + ): GroupMembershipCreatePayload! + """ + Create multiple new groupMemberships + """ + createBulkGroupMembership( + """ + values of the groupMembership + """ + input: [CreateGroupMembershipInput!] + ): GroupMembershipBulkCreatePayload! + """ + Create multiple new groupMemberships via file upload + """ + createBulkCSVGroupMembership( + """ + csv file containing values of the groupMembership + """ + input: Upload! + ): GroupMembershipBulkCreatePayload! + """ + Update an existing groupMembership + """ + updateGroupMembership( + """ + ID of the groupMembership + """ + id: ID! + + """ + New values for the groupMembership + """ + input: UpdateGroupMembershipInput! + ): GroupMembershipUpdatePayload! + """ + Delete an existing groupMembership + """ + deleteGroupMembership( + """ + ID of the groupMembership + """ + id: ID! + ): GroupMembershipDeletePayload! + """ + Create a new groupSetting + """ + createGroupSetting( + """ + values of the groupSetting + """ + input: CreateGroupSettingInput! + ): GroupSettingCreatePayload! + """ + Create multiple new groupSettings + """ + createBulkGroupSetting( + """ + values of the groupSetting + """ + input: [CreateGroupSettingInput!] + ): GroupSettingBulkCreatePayload! + """ + Create multiple new groupSettings via file upload + """ + createBulkCSVGroupSetting( + """ + csv file containing values of the groupSetting + """ + input: Upload! + ): GroupSettingBulkCreatePayload! + """ + Update an existing groupSetting + """ + updateGroupSetting( + """ + ID of the groupSetting + """ + id: ID! + + """ + New values for the groupSetting + """ + input: UpdateGroupSettingInput! + ): GroupSettingUpdatePayload! + """ + Delete an existing groupSetting + """ + deleteGroupSetting( + """ + ID of the groupSetting + """ + id: ID! + ): GroupSettingDeletePayload! + """ + Create a new hush + """ + createHush( + """ + values of the hush + """ + input: CreateHushInput! + ): HushCreatePayload! + """ + Create multiple new hushs + """ + createBulkHush( + """ + values of the hush + """ + input: [CreateHushInput!] + ): HushBulkCreatePayload! + """ + Create multiple new hushs via file upload + """ + createBulkCSVHush( + """ + csv file containing values of the hush + """ + input: Upload! + ): HushBulkCreatePayload! + """ + Update an existing hush + """ + updateHush( + """ + ID of the hush + """ + id: ID! + + """ + New values for the hush + """ + input: UpdateHushInput! + ): HushUpdatePayload! + """ + Delete an existing hush + """ + deleteHush( + """ + ID of the hush + """ + id: ID! + ): HushDeletePayload! + """ + Create a new integration + """ + createIntegration( + """ + values of the integration + """ + input: CreateIntegrationInput! + ): IntegrationCreatePayload! + """ + Create multiple new integrations + """ + createBulkIntegration( + """ + values of the integration + """ + input: [CreateIntegrationInput!] + ): IntegrationBulkCreatePayload! + """ + Create multiple new integrations via file upload + """ + createBulkCSVIntegration( + """ + csv file containing values of the integration + """ + input: Upload! + ): IntegrationBulkCreatePayload! + """ + Update an existing integration + """ + updateIntegration( + """ + ID of the integration + """ + id: ID! + + """ + New values for the integration + """ + input: UpdateIntegrationInput! + ): IntegrationUpdatePayload! + """ + Delete an existing integration + """ + deleteIntegration( + """ + ID of the integration + """ + id: ID! + ): IntegrationDeletePayload! + """ + Create a new invite + """ + createInvite( + """ + values of the invite + """ + input: CreateInviteInput! + ): InviteCreatePayload! + """ + Create multiple new invites + """ + createBulkInvite( + """ + values of the invite + """ + input: [CreateInviteInput!] + ): InviteBulkCreatePayload! + """ + Create multiple new invites via file upload + """ + createBulkCSVInvite( + """ + csv file containing values of the invite + """ + input: Upload! + ): InviteBulkCreatePayload! + """ + Update an existing invite + """ + updateInvite( + """ + ID of the invite + """ + id: ID! + + """ + New values for the invite + """ + input: UpdateInviteInput! + ): InviteUpdatePayload! + """ + Delete an existing invite + """ + deleteInvite( + """ + ID of the invite + """ + id: ID! + ): InviteDeletePayload! + """ + Create a new oauthProvider + """ + createOauthProvider( + """ + values of the oauthProvider + """ + input: CreateOauthProviderInput! + ): OauthProviderCreatePayload! + """ + Create multiple new oauthProviders + """ + createBulkOauthProvider( + """ + values of the oauthProvider + """ + input: [CreateOauthProviderInput!] + ): OauthProviderBulkCreatePayload! + """ + Create multiple new oauthProviders via file upload + """ + createBulkCSVOauthProvider( + """ + csv file containing values of the oauthProvider + """ + input: Upload! + ): OauthProviderBulkCreatePayload! + """ + Update an existing oauthProvider + """ + updateOauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + + """ + New values for the oauthProvider + """ + input: UpdateOauthProviderInput! + ): OauthProviderUpdatePayload! + """ + Delete an existing oauthProvider + """ + deleteOauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + ): OauthProviderDeletePayload! + """ + Create a new ohAuthTooToken + """ + createOhAuthTooToken( + """ + values of the ohAuthTooToken + """ + input: CreateOhAuthTooTokenInput! + ): OhAuthTooTokenCreatePayload! + """ + Create multiple new ohAuthTooTokens + """ + createBulkOhAuthTooToken( + """ + values of the ohAuthTooToken + """ + input: [CreateOhAuthTooTokenInput!] + ): OhAuthTooTokenBulkCreatePayload! + """ + Create multiple new ohAuthTooTokens via file upload + """ + createBulkCSVOhAuthTooToken( + """ + csv file containing values of the ohAuthTooToken + """ + input: Upload! + ): OhAuthTooTokenBulkCreatePayload! + """ + Update an existing ohAuthTooToken + """ + updateOhAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + + """ + New values for the ohAuthTooToken + """ + input: UpdateOhAuthTooTokenInput! + ): OhAuthTooTokenUpdatePayload! + """ + Delete an existing ohAuthTooToken + """ + deleteOhAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + ): OhAuthTooTokenDeletePayload! + """ + Create a new organization + """ + createOrganization( + """ + values of the organization + """ + input: CreateOrganizationInput! + ): OrganizationCreatePayload! + """ + Create multiple new organizations + """ + createBulkOrganization( + """ + values of the organization + """ + input: [CreateOrganizationInput!] + ): OrganizationBulkCreatePayload! + """ + Create multiple new organizations via file upload + """ + createBulkCSVOrganization( + """ + csv file containing values of the organization + """ + input: Upload! + ): OrganizationBulkCreatePayload! + """ + Update an existing organization + """ + updateOrganization( + """ + ID of the organization + """ + id: ID! + + """ + New values for the organization + """ + input: UpdateOrganizationInput! + ): OrganizationUpdatePayload! + """ + Delete an existing organization + """ + deleteOrganization( + """ + ID of the organization + """ + id: ID! + ): OrganizationDeletePayload! + """ + Create a new organizationSetting + """ + createOrganizationSetting( + """ + values of the organizationSetting + """ + input: CreateOrganizationSettingInput! + ): OrganizationSettingCreatePayload! + """ + Create multiple new organizationSettings + """ + createBulkOrganizationSetting( + """ + values of the organizationSetting + """ + input: [CreateOrganizationSettingInput!] + ): OrganizationSettingBulkCreatePayload! + """ + Create multiple new organizationSettings via file upload + """ + createBulkCSVOrganizationSetting( + """ + csv file containing values of the organizationSetting + """ + input: Upload! + ): OrganizationSettingBulkCreatePayload! + """ + Update an existing organizationSetting + """ + updateOrganizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + + """ + New values for the organizationSetting + """ + input: UpdateOrganizationSettingInput! + ): OrganizationSettingUpdatePayload! + """ + Delete an existing organizationSetting + """ + deleteOrganizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + ): OrganizationSettingDeletePayload! + """ + Create a new orgMembership + """ + createOrgMembership( + """ + values of the orgMembership + """ + input: CreateOrgMembershipInput! + ): OrgMembershipCreatePayload! + """ + Create multiple new orgMemberships + """ + createBulkOrgMembership( + """ + values of the orgMembership + """ + input: [CreateOrgMembershipInput!] + ): OrgMembershipBulkCreatePayload! + """ + Create multiple new orgMemberships via file upload + """ + createBulkCSVOrgMembership( + """ + csv file containing values of the orgMembership + """ + input: Upload! + ): OrgMembershipBulkCreatePayload! + """ + Update an existing orgMembership + """ + updateOrgMembership( + """ + ID of the orgMembership + """ + id: ID! + + """ + New values for the orgMembership + """ + input: UpdateOrgMembershipInput! + ): OrgMembershipUpdatePayload! + """ + Delete an existing orgMembership + """ + deleteOrgMembership( + """ + ID of the orgMembership + """ + id: ID! + ): OrgMembershipDeletePayload! + """ + Create a new personalAccessToken + """ + createPersonalAccessToken( + """ + values of the personalAccessToken + """ + input: CreatePersonalAccessTokenInput! + ): PersonalAccessTokenCreatePayload! + """ + Create multiple new personalAccessTokens + """ + createBulkPersonalAccessToken( + """ + values of the personalAccessToken + """ + input: [CreatePersonalAccessTokenInput!] + ): PersonalAccessTokenBulkCreatePayload! + """ + Create multiple new personalAccessTokens via file upload + """ + createBulkCSVPersonalAccessToken( + """ + csv file containing values of the personalAccessToken + """ + input: Upload! + ): PersonalAccessTokenBulkCreatePayload! + """ + Update an existing personalAccessToken + """ + updatePersonalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + + """ + New values for the personalAccessToken + """ + input: UpdatePersonalAccessTokenInput! + ): PersonalAccessTokenUpdatePayload! + """ + Delete an existing personalAccessToken + """ + deletePersonalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + ): PersonalAccessTokenDeletePayload! + """ + Create a new subscriber + """ + createSubscriber( + """ + values of the subscriber + """ + input: CreateSubscriberInput! + ): SubscriberCreatePayload! + """ + Create new subscribers + """ + createBulkSubscriber( + """ + values of the subscriber + """ + input: [CreateSubscriberInput!] + ): SubscriberBulkCreatePayload! + """ + Create new subscribers via CSV file + """ + createBulkCSVSubscriber( + """ + values of the subscriber + """ + input: Upload! + ): SubscriberBulkCreatePayload! + """ + Update an existing subscriber + """ + updateSubscriber( + """ + Email of the subscriber + """ + email: String! + + """ + New values for the subscriber + """ + input: UpdateSubscriberInput! + ): SubscriberUpdatePayload! + """ + Delete an existing subscriber by Email + """ + deleteSubscriber( + """ + Email of the subscriber + """ + email: String! + + """ + OwnerID of the subscriber + """ + ownerID: ID + ): SubscriberDeletePayload! + """ + Create a new template + """ + createTemplate( + """ + values of the template + """ + input: CreateTemplateInput! + ): TemplateCreatePayload! + """ + Create multiple new templates + """ + createBulkTemplate( + """ + values of the template + """ + input: [CreateTemplateInput!] + ): TemplateBulkCreatePayload! + """ + Create multiple new templates via file upload + """ + createBulkCSVTemplate( + """ + csv file containing values of the template + """ + input: Upload! + ): TemplateBulkCreatePayload! + """ + Update an existing template + """ + updateTemplate( + """ + ID of the template + """ + id: ID! + + """ + New values for the template + """ + input: UpdateTemplateInput! + ): TemplateUpdatePayload! + """ + Delete an existing template + """ + deleteTemplate( + """ + ID of the template + """ + id: ID! + ): TemplateDeletePayload! + """ + Create a new tfaSetting + """ + createTFASetting( + """ + values of the tfaSetting + """ + input: CreateTFASettingInput! + ): TFASettingCreatePayload! + """ + Update an existing tfaSetting + """ + updateTFASetting( + """ + New values for the tfaSetting + """ + input: UpdateTFASettingInput! + ): TFASettingUpdatePayload! + """ + Create a new user + """ + createUser( + """ + values of the user + """ + input: CreateUserInput! + ): UserCreatePayload! + """ + Update an existing user + """ + updateUser( + """ + ID of the user + """ + id: ID! + + """ + New values for the user + """ + input: UpdateUserInput! + ): UserUpdatePayload! + """ + Delete an existing user + """ + deleteUser( + """ + ID of the user + """ + id: ID! + ): UserDeletePayload! + """ + Create a new userSetting + """ + createUserSetting( + """ + values of the userSetting + """ + input: CreateUserSettingInput! + ): UserSettingCreatePayload! + """ + Create multiple new userSettings + """ + createBulkUserSetting( + """ + values of the userSetting + """ + input: [CreateUserSettingInput!] + ): UserSettingBulkCreatePayload! + """ + Create multiple new userSettings via file upload + """ + createBulkCSVUserSetting( + """ + csv file containing values of the userSetting + """ + input: Upload! + ): UserSettingBulkCreatePayload! + """ + Update an existing userSetting + """ + updateUserSetting( + """ + ID of the userSetting + """ + id: ID! + + """ + New values for the userSetting + """ + input: UpdateUserSettingInput! + ): UserSettingUpdatePayload! + """ + Create a new webhook + """ + createWebhook( + """ + values of the webhook + """ + input: CreateWebhookInput! + ): WebhookCreatePayload! + """ + Create multiple new webhooks + """ + createBulkWebhook( + """ + values of the webhook + """ + input: [CreateWebhookInput!] + ): WebhookBulkCreatePayload! + """ + Create multiple new webhooks via file upload + """ + createBulkCSVWebhook( + """ + csv file containing values of the webhook + """ + input: Upload! + ): WebhookBulkCreatePayload! + """ + Update an existing webhook + """ + updateWebhook( + """ + ID of the webhook + """ + id: ID! + + """ + New values for the webhook + """ + input: UpdateWebhookInput! + ): WebhookUpdatePayload! + """ + Delete an existing webhook + """ + deleteWebhook( + """ + ID of the webhook + """ + id: ID! + ): WebhookDeletePayload! +} +""" +An object with an ID. +Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm) +""" +interface Node @goModel(model: "github.com/theopenlane/core/internal/ent/generated.Noder") { + """ + The id of the object. + """ + id: ID! +} +type Note implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the text of the note + """ + text: String! + owner: Organization + entity: Entity +} +""" +A connection to a list of items. +""" +type NoteConnection { + """ + A list of edges. + """ + edges: [NoteEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type NoteEdge { + """ + The item at the end of the edge. + """ + node: Note + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type NoteHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: NoteHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the text of the note + """ + text: String! +} +""" +A connection to a list of items. +""" +type NoteHistoryConnection { + """ + A list of edges. + """ + edges: [NoteHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type NoteHistoryEdge { + """ + The item at the end of the edge. + """ + node: NoteHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +NoteHistoryOpType is enum for the field operation +""" +enum NoteHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +NoteHistoryWhereInput is used for filtering NoteHistory objects. +Input was generated by ent. +""" +input NoteHistoryWhereInput { + not: NoteHistoryWhereInput + and: [NoteHistoryWhereInput!] + or: [NoteHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: NoteHistoryOpType + operationNEQ: NoteHistoryOpType + operationIn: [NoteHistoryOpType!] + operationNotIn: [NoteHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + text field predicates + """ + text: String + textNEQ: String + textIn: [String!] + textNotIn: [String!] + textGT: String + textGTE: String + textLT: String + textLTE: String + textContains: String + textHasPrefix: String + textHasSuffix: String + textEqualFold: String + textContainsFold: String +} +""" +NoteWhereInput is used for filtering Note objects. +Input was generated by ent. +""" +input NoteWhereInput { + not: NoteWhereInput + and: [NoteWhereInput!] + or: [NoteWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + text field predicates + """ + text: String + textNEQ: String + textIn: [String!] + textNotIn: [String!] + textGT: String + textGTE: String + textLT: String + textLTE: String + textContains: String + textHasPrefix: String + textHasSuffix: String + textEqualFold: String + textContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] +} +type OauthProvider implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! + owner: Organization +} +""" +Return response for createBulkOauthProvider mutation +""" +type OauthProviderBulkCreatePayload { + """ + Created oauthProviders + """ + oauthProviders: [OauthProvider!] +} +""" +A connection to a list of items. +""" +type OauthProviderConnection { + """ + A list of edges. + """ + edges: [OauthProviderEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createOauthProvider mutation +""" +type OauthProviderCreatePayload { + """ + Created oauthProvider + """ + oauthProvider: OauthProvider! +} +""" +Return response for deleteOauthProvider mutation +""" +type OauthProviderDeletePayload { + """ + Deleted oauthProvider ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type OauthProviderEdge { + """ + The item at the end of the edge. + """ + node: OauthProvider + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OauthProviderHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OauthProviderHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! +} +""" +A connection to a list of items. +""" +type OauthProviderHistoryConnection { + """ + A list of edges. + """ + edges: [OauthProviderHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OauthProviderHistoryEdge { + """ + The item at the end of the edge. + """ + node: OauthProviderHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OauthProviderHistoryOpType is enum for the field operation +""" +enum OauthProviderHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OauthProviderHistoryWhereInput is used for filtering OauthProviderHistory objects. +Input was generated by ent. +""" +input OauthProviderHistoryWhereInput { + not: OauthProviderHistoryWhereInput + and: [OauthProviderHistoryWhereInput!] + or: [OauthProviderHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OauthProviderHistoryOpType + operationNEQ: OauthProviderHistoryOpType + operationIn: [OauthProviderHistoryOpType!] + operationNotIn: [OauthProviderHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + client_secret field predicates + """ + clientSecret: String + clientSecretNEQ: String + clientSecretIn: [String!] + clientSecretNotIn: [String!] + clientSecretGT: String + clientSecretGTE: String + clientSecretLT: String + clientSecretLTE: String + clientSecretContains: String + clientSecretHasPrefix: String + clientSecretHasSuffix: String + clientSecretEqualFold: String + clientSecretContainsFold: String + """ + redirect_url field predicates + """ + redirectURL: String + redirectURLNEQ: String + redirectURLIn: [String!] + redirectURLNotIn: [String!] + redirectURLGT: String + redirectURLGTE: String + redirectURLLT: String + redirectURLLTE: String + redirectURLContains: String + redirectURLHasPrefix: String + redirectURLHasSuffix: String + redirectURLEqualFold: String + redirectURLContainsFold: String + """ + scopes field predicates + """ + scopes: String + scopesNEQ: String + scopesIn: [String!] + scopesNotIn: [String!] + scopesGT: String + scopesGTE: String + scopesLT: String + scopesLTE: String + scopesContains: String + scopesHasPrefix: String + scopesHasSuffix: String + scopesEqualFold: String + scopesContainsFold: String + """ + auth_url field predicates + """ + authURL: String + authURLNEQ: String + authURLIn: [String!] + authURLNotIn: [String!] + authURLGT: String + authURLGTE: String + authURLLT: String + authURLLTE: String + authURLContains: String + authURLHasPrefix: String + authURLHasSuffix: String + authURLEqualFold: String + authURLContainsFold: String + """ + token_url field predicates + """ + tokenURL: String + tokenURLNEQ: String + tokenURLIn: [String!] + tokenURLNotIn: [String!] + tokenURLGT: String + tokenURLGTE: String + tokenURLLT: String + tokenURLLTE: String + tokenURLContains: String + tokenURLHasPrefix: String + tokenURLHasSuffix: String + tokenURLEqualFold: String + tokenURLContainsFold: String + """ + auth_style field predicates + """ + authStyle: Uint + authStyleNEQ: Uint + authStyleIn: [Uint!] + authStyleNotIn: [Uint!] + authStyleGT: Uint + authStyleGTE: Uint + authStyleLT: Uint + authStyleLTE: Uint + """ + info_url field predicates + """ + infoURL: String + infoURLNEQ: String + infoURLIn: [String!] + infoURLNotIn: [String!] + infoURLGT: String + infoURLGTE: String + infoURLLT: String + infoURLLTE: String + infoURLContains: String + infoURLHasPrefix: String + infoURLHasSuffix: String + infoURLEqualFold: String + infoURLContainsFold: String +} +""" +Return response for updateOauthProvider mutation +""" +type OauthProviderUpdatePayload { + """ + Updated oauthProvider + """ + oauthProvider: OauthProvider! +} +""" +OauthProviderWhereInput is used for filtering OauthProvider objects. +Input was generated by ent. +""" +input OauthProviderWhereInput { + not: OauthProviderWhereInput + and: [OauthProviderWhereInput!] + or: [OauthProviderWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + client_secret field predicates + """ + clientSecret: String + clientSecretNEQ: String + clientSecretIn: [String!] + clientSecretNotIn: [String!] + clientSecretGT: String + clientSecretGTE: String + clientSecretLT: String + clientSecretLTE: String + clientSecretContains: String + clientSecretHasPrefix: String + clientSecretHasSuffix: String + clientSecretEqualFold: String + clientSecretContainsFold: String + """ + redirect_url field predicates + """ + redirectURL: String + redirectURLNEQ: String + redirectURLIn: [String!] + redirectURLNotIn: [String!] + redirectURLGT: String + redirectURLGTE: String + redirectURLLT: String + redirectURLLTE: String + redirectURLContains: String + redirectURLHasPrefix: String + redirectURLHasSuffix: String + redirectURLEqualFold: String + redirectURLContainsFold: String + """ + scopes field predicates + """ + scopes: String + scopesNEQ: String + scopesIn: [String!] + scopesNotIn: [String!] + scopesGT: String + scopesGTE: String + scopesLT: String + scopesLTE: String + scopesContains: String + scopesHasPrefix: String + scopesHasSuffix: String + scopesEqualFold: String + scopesContainsFold: String + """ + auth_url field predicates + """ + authURL: String + authURLNEQ: String + authURLIn: [String!] + authURLNotIn: [String!] + authURLGT: String + authURLGTE: String + authURLLT: String + authURLLTE: String + authURLContains: String + authURLHasPrefix: String + authURLHasSuffix: String + authURLEqualFold: String + authURLContainsFold: String + """ + token_url field predicates + """ + tokenURL: String + tokenURLNEQ: String + tokenURLIn: [String!] + tokenURLNotIn: [String!] + tokenURLGT: String + tokenURLGTE: String + tokenURLLT: String + tokenURLLTE: String + tokenURLContains: String + tokenURLHasPrefix: String + tokenURLHasSuffix: String + tokenURLEqualFold: String + tokenURLContainsFold: String + """ + auth_style field predicates + """ + authStyle: Uint + authStyleNEQ: Uint + authStyleIn: [Uint!] + authStyleNotIn: [Uint!] + authStyleGT: Uint + authStyleGTE: Uint + authStyleLT: Uint + authStyleLTE: Uint + """ + info_url field predicates + """ + infoURL: String + infoURLNEQ: String + infoURLIn: [String!] + infoURLNotIn: [String!] + infoURLGT: String + infoURLGTE: String + infoURLLT: String + infoURLLTE: String + infoURLContains: String + infoURLHasPrefix: String + infoURLHasSuffix: String + infoURLEqualFold: String + infoURLContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] +} +type OhAuthTooToken implements Node { + id: ID! + """ + tags associated with the object + """ + tags: [String!] + clientID: String! + scopes: [String!] + nonce: String! + claimsUserID: String! + claimsUsername: String! + claimsEmail: String! + claimsEmailVerified: Boolean! + claimsGroups: [String!] + claimsPreferredUsername: String! + connectorID: String! + connectorData: [String!] + lastUsed: Time! + integration: [Integration!] + events: [Event!] +} +""" +Return response for createBulkOhAuthTooToken mutation +""" +type OhAuthTooTokenBulkCreatePayload { + """ + Created ohAuthTooTokens + """ + ohAuthTooTokens: [OhAuthTooToken!] +} +""" +A connection to a list of items. +""" +type OhAuthTooTokenConnection { + """ + A list of edges. + """ + edges: [OhAuthTooTokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createOhAuthTooToken mutation +""" +type OhAuthTooTokenCreatePayload { + """ + Created ohAuthTooToken + """ + ohAuthTooToken: OhAuthTooToken! +} +""" +Return response for deleteOhAuthTooToken mutation +""" +type OhAuthTooTokenDeletePayload { + """ + Deleted ohAuthTooToken ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type OhAuthTooTokenEdge { + """ + The item at the end of the edge. + """ + node: OhAuthTooToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +Return response for updateOhAuthTooToken mutation +""" +type OhAuthTooTokenUpdatePayload { + """ + Updated ohAuthTooToken + """ + ohAuthTooToken: OhAuthTooToken! +} +""" +OhAuthTooTokenWhereInput is used for filtering OhAuthTooToken objects. +Input was generated by ent. +""" +input OhAuthTooTokenWhereInput { + not: OhAuthTooTokenWhereInput + and: [OhAuthTooTokenWhereInput!] + or: [OhAuthTooTokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + nonce field predicates + """ + nonce: String + nonceNEQ: String + nonceIn: [String!] + nonceNotIn: [String!] + nonceGT: String + nonceGTE: String + nonceLT: String + nonceLTE: String + nonceContains: String + nonceHasPrefix: String + nonceHasSuffix: String + nonceEqualFold: String + nonceContainsFold: String + """ + claims_user_id field predicates + """ + claimsUserID: String + claimsUserIDNEQ: String + claimsUserIDIn: [String!] + claimsUserIDNotIn: [String!] + claimsUserIDGT: String + claimsUserIDGTE: String + claimsUserIDLT: String + claimsUserIDLTE: String + claimsUserIDContains: String + claimsUserIDHasPrefix: String + claimsUserIDHasSuffix: String + claimsUserIDEqualFold: String + claimsUserIDContainsFold: String + """ + claims_username field predicates + """ + claimsUsername: String + claimsUsernameNEQ: String + claimsUsernameIn: [String!] + claimsUsernameNotIn: [String!] + claimsUsernameGT: String + claimsUsernameGTE: String + claimsUsernameLT: String + claimsUsernameLTE: String + claimsUsernameContains: String + claimsUsernameHasPrefix: String + claimsUsernameHasSuffix: String + claimsUsernameEqualFold: String + claimsUsernameContainsFold: String + """ + claims_email field predicates + """ + claimsEmail: String + claimsEmailNEQ: String + claimsEmailIn: [String!] + claimsEmailNotIn: [String!] + claimsEmailGT: String + claimsEmailGTE: String + claimsEmailLT: String + claimsEmailLTE: String + claimsEmailContains: String + claimsEmailHasPrefix: String + claimsEmailHasSuffix: String + claimsEmailEqualFold: String + claimsEmailContainsFold: String + """ + claims_email_verified field predicates + """ + claimsEmailVerified: Boolean + claimsEmailVerifiedNEQ: Boolean + """ + claims_preferred_username field predicates + """ + claimsPreferredUsername: String + claimsPreferredUsernameNEQ: String + claimsPreferredUsernameIn: [String!] + claimsPreferredUsernameNotIn: [String!] + claimsPreferredUsernameGT: String + claimsPreferredUsernameGTE: String + claimsPreferredUsernameLT: String + claimsPreferredUsernameLTE: String + claimsPreferredUsernameContains: String + claimsPreferredUsernameHasPrefix: String + claimsPreferredUsernameHasSuffix: String + claimsPreferredUsernameEqualFold: String + claimsPreferredUsernameContainsFold: String + """ + connector_id field predicates + """ + connectorID: String + connectorIDNEQ: String + connectorIDIn: [String!] + connectorIDNotIn: [String!] + connectorIDGT: String + connectorIDGTE: String + connectorIDLT: String + connectorIDLTE: String + connectorIDContains: String + connectorIDHasPrefix: String + connectorIDHasSuffix: String + connectorIDEqualFold: String + connectorIDContainsFold: String + """ + last_used field predicates + """ + lastUsed: Time + lastUsedNEQ: Time + lastUsedIn: [Time!] + lastUsedNotIn: [Time!] + lastUsedGT: Time + lastUsedGTE: Time + lastUsedLT: Time + lastUsedLTE: Time + """ + integration edge predicates + """ + hasIntegration: Boolean + hasIntegrationWith: [IntegrationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +""" +Possible directions in which to order a list of items when provided an `orderBy` argument. +""" +enum OrderDirection { + """ + Specifies an ascending order for a given `orderBy` argument. + """ + ASC + """ + Specifies a descending order for a given `orderBy` argument. + """ + DESC +} +type OrgMembership implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: OrgMembershipRole! + organizationID: ID! + userID: ID! + organization: Organization! + user: User! + events: [Event!] +} +""" +Return response for createBulkOrgMembership mutation +""" +type OrgMembershipBulkCreatePayload { + """ + Created orgMemberships + """ + orgMemberships: [OrgMembership!] +} +""" +A connection to a list of items. +""" +type OrgMembershipConnection { + """ + A list of edges. + """ + edges: [OrgMembershipEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createOrgMembership mutation +""" +type OrgMembershipCreatePayload { + """ + Created orgMembership + """ + orgMembership: OrgMembership! +} +""" +Return response for deleteOrgMembership mutation +""" +type OrgMembershipDeletePayload { + """ + Deleted orgMembership ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type OrgMembershipEdge { + """ + The item at the end of the edge. + """ + node: OrgMembership + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrgMembershipHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrgMembershipHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: OrgMembershipHistoryRole! + organizationID: String! + userID: String! +} +""" +A connection to a list of items. +""" +type OrgMembershipHistoryConnection { + """ + A list of edges. + """ + edges: [OrgMembershipHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrgMembershipHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrgMembershipHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrgMembershipHistoryOpType is enum for the field operation +""" +enum OrgMembershipHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OrgMembershipHistoryRole is enum for the field role +""" +enum OrgMembershipHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER + OWNER +} +""" +OrgMembershipHistoryWhereInput is used for filtering OrgMembershipHistory objects. +Input was generated by ent. +""" +input OrgMembershipHistoryWhereInput { + not: OrgMembershipHistoryWhereInput + and: [OrgMembershipHistoryWhereInput!] + or: [OrgMembershipHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrgMembershipHistoryOpType + operationNEQ: OrgMembershipHistoryOpType + operationIn: [OrgMembershipHistoryOpType!] + operationNotIn: [OrgMembershipHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: OrgMembershipHistoryRole + roleNEQ: OrgMembershipHistoryRole + roleIn: [OrgMembershipHistoryRole!] + roleNotIn: [OrgMembershipHistoryRole!] + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDEqualFold: String + organizationIDContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDEqualFold: String + userIDContainsFold: String +} +""" +OrgMembershipRole is enum for the field role +""" +enum OrgMembershipRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER + OWNER +} +""" +Return response for updateOrgMembership mutation +""" +type OrgMembershipUpdatePayload { + """ + Updated orgMembership + """ + orgMembership: OrgMembership! +} +""" +OrgMembershipWhereInput is used for filtering OrgMembership objects. +Input was generated by ent. +""" +input OrgMembershipWhereInput { + not: OrgMembershipWhereInput + and: [OrgMembershipWhereInput!] + or: [OrgMembershipWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: OrgMembershipRole + roleNEQ: OrgMembershipRole + roleIn: [OrgMembershipRole!] + roleNotIn: [OrgMembershipRole!] + organizationID: String + userID: String +} +type Organization implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String! + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean! + parent: Organization + children( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Organizations returned from the connection. + """ + orderBy: OrganizationOrder + + """ + Filtering options for Organizations returned from the connection. + """ + where: OrganizationWhereInput + ): OrganizationConnection! + groups: [Group!] + templates: [Template!] + integrations: [Integration!] + setting: OrganizationSetting + documentdata: [DocumentData!] + entitlements: [Entitlement!] + organizationEntitlement: [Entitlement!] + personalAccessTokens: [PersonalAccessToken!] + apiTokens: [APIToken!] + oauthprovider: [OauthProvider!] + users: [User!] + invites: [Invite!] + subscribers: [Subscriber!] + webhooks: [Webhook!] + events: [Event!] + secrets: [Hush!] + features: [Feature!] + files: [File!] + entitlementplans: [EntitlementPlan!] + entitlementplanfeatures: [EntitlementPlanFeature!] + entities: [Entity!] + entitytypes: [EntityType!] + contacts: [Contact!] + notes: [Note!] + members: [OrgMembership!] +} +""" +Return response for createBulkOrganization mutation +""" +type OrganizationBulkCreatePayload { + """ + Created organizations + """ + organizations: [Organization!] +} +""" +A connection to a list of items. +""" +type OrganizationConnection { + """ + A list of edges. + """ + edges: [OrganizationEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createOrganization mutation +""" +type OrganizationCreatePayload { + """ + Created organization + """ + organization: Organization! +} +""" +Return response for deleteOrganization mutation +""" +type OrganizationDeletePayload { + """ + Deleted organization ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type OrganizationEdge { + """ + The item at the end of the edge. + """ + node: Organization + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrganizationHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrganizationHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String! + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean! +} +""" +A connection to a list of items. +""" +type OrganizationHistoryConnection { + """ + A list of edges. + """ + edges: [OrganizationHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrganizationHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrganizationHistoryOpType is enum for the field operation +""" +enum OrganizationHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for OrganizationHistory connections +""" +input OrganizationHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order OrganizationHistories. + """ + field: OrganizationHistoryOrderField! +} +""" +Properties by which OrganizationHistory connections can be ordered. +""" +enum OrganizationHistoryOrderField { + name + display_name +} +""" +OrganizationHistoryWhereInput is used for filtering OrganizationHistory objects. +Input was generated by ent. +""" +input OrganizationHistoryWhereInput { + not: OrganizationHistoryWhereInput + and: [OrganizationHistoryWhereInput!] + or: [OrganizationHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrganizationHistoryOpType + operationNEQ: OrganizationHistoryOpType + operationIn: [OrganizationHistoryOpType!] + operationNotIn: [OrganizationHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + parent_organization_id field predicates + """ + parentOrganizationID: ID + parentOrganizationIDNEQ: ID + parentOrganizationIDIn: [ID!] + parentOrganizationIDNotIn: [ID!] + parentOrganizationIDGT: ID + parentOrganizationIDGTE: ID + parentOrganizationIDLT: ID + parentOrganizationIDLTE: ID + parentOrganizationIDContains: ID + parentOrganizationIDHasPrefix: ID + parentOrganizationIDHasSuffix: ID + parentOrganizationIDIsNil: Boolean + parentOrganizationIDNotNil: Boolean + parentOrganizationIDEqualFold: ID + parentOrganizationIDContainsFold: ID + """ + personal_org field predicates + """ + personalOrg: Boolean + personalOrgNEQ: Boolean + personalOrgIsNil: Boolean + personalOrgNotNil: Boolean + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String +} +""" +Ordering options for Organization connections +""" +input OrganizationOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Organizations. + """ + field: OrganizationOrderField! +} +""" +Properties by which Organization connections can be ordered. +""" +enum OrganizationOrderField { + name + display_name +} +type OrganizationSearchResult { + organizations: [Organization!] +} +type OrganizationSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + """ + the ID of the organization the settings belong to + """ + organizationID: ID + organization: Organization +} +""" +Return response for createBulkOrganizationSetting mutation +""" +type OrganizationSettingBulkCreatePayload { + """ + Created organizationSettings + """ + organizationSettings: [OrganizationSetting!] +} +""" +A connection to a list of items. +""" +type OrganizationSettingConnection { + """ + A list of edges. + """ + edges: [OrganizationSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createOrganizationSetting mutation +""" +type OrganizationSettingCreatePayload { + """ + Created organizationSetting + """ + organizationSetting: OrganizationSetting! +} +""" +Return response for deleteOrganizationSetting mutation +""" +type OrganizationSettingDeletePayload { + """ + Deleted organizationSetting ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type OrganizationSettingEdge { + """ + The item at the end of the edge. + """ + node: OrganizationSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrganizationSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrganizationSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingHistoryRegion + """ + the ID of the organization the settings belong to + """ + organizationID: String +} +""" +A connection to a list of items. +""" +type OrganizationSettingHistoryConnection { + """ + A list of edges. + """ + edges: [OrganizationSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrganizationSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrganizationSettingHistoryOpType is enum for the field operation +""" +enum OrganizationSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OrganizationSettingHistoryRegion is enum for the field geo_location +""" +enum OrganizationSettingHistoryRegion @goModel(model: "github.com/theopenlane/core/pkg/enums.Region") { + AMER + EMEA + APAC +} +""" +OrganizationSettingHistoryWhereInput is used for filtering OrganizationSettingHistory objects. +Input was generated by ent. +""" +input OrganizationSettingHistoryWhereInput { + not: OrganizationSettingHistoryWhereInput + and: [OrganizationSettingHistoryWhereInput!] + or: [OrganizationSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrganizationSettingHistoryOpType + operationNEQ: OrganizationSettingHistoryOpType + operationIn: [OrganizationSettingHistoryOpType!] + operationNotIn: [OrganizationSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + billing_contact field predicates + """ + billingContact: String + billingContactNEQ: String + billingContactIn: [String!] + billingContactNotIn: [String!] + billingContactGT: String + billingContactGTE: String + billingContactLT: String + billingContactLTE: String + billingContactContains: String + billingContactHasPrefix: String + billingContactHasSuffix: String + billingContactIsNil: Boolean + billingContactNotNil: Boolean + billingContactEqualFold: String + billingContactContainsFold: String + """ + billing_email field predicates + """ + billingEmail: String + billingEmailNEQ: String + billingEmailIn: [String!] + billingEmailNotIn: [String!] + billingEmailGT: String + billingEmailGTE: String + billingEmailLT: String + billingEmailLTE: String + billingEmailContains: String + billingEmailHasPrefix: String + billingEmailHasSuffix: String + billingEmailIsNil: Boolean + billingEmailNotNil: Boolean + billingEmailEqualFold: String + billingEmailContainsFold: String + """ + billing_phone field predicates + """ + billingPhone: String + billingPhoneNEQ: String + billingPhoneIn: [String!] + billingPhoneNotIn: [String!] + billingPhoneGT: String + billingPhoneGTE: String + billingPhoneLT: String + billingPhoneLTE: String + billingPhoneContains: String + billingPhoneHasPrefix: String + billingPhoneHasSuffix: String + billingPhoneIsNil: Boolean + billingPhoneNotNil: Boolean + billingPhoneEqualFold: String + billingPhoneContainsFold: String + """ + billing_address field predicates + """ + billingAddress: String + billingAddressNEQ: String + billingAddressIn: [String!] + billingAddressNotIn: [String!] + billingAddressGT: String + billingAddressGTE: String + billingAddressLT: String + billingAddressLTE: String + billingAddressContains: String + billingAddressHasPrefix: String + billingAddressHasSuffix: String + billingAddressIsNil: Boolean + billingAddressNotNil: Boolean + billingAddressEqualFold: String + billingAddressContainsFold: String + """ + tax_identifier field predicates + """ + taxIdentifier: String + taxIdentifierNEQ: String + taxIdentifierIn: [String!] + taxIdentifierNotIn: [String!] + taxIdentifierGT: String + taxIdentifierGTE: String + taxIdentifierLT: String + taxIdentifierLTE: String + taxIdentifierContains: String + taxIdentifierHasPrefix: String + taxIdentifierHasSuffix: String + taxIdentifierIsNil: Boolean + taxIdentifierNotNil: Boolean + taxIdentifierEqualFold: String + taxIdentifierContainsFold: String + """ + geo_location field predicates + """ + geoLocation: OrganizationSettingHistoryRegion + geoLocationNEQ: OrganizationSettingHistoryRegion + geoLocationIn: [OrganizationSettingHistoryRegion!] + geoLocationNotIn: [OrganizationSettingHistoryRegion!] + geoLocationIsNil: Boolean + geoLocationNotNil: Boolean + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDIsNil: Boolean + organizationIDNotNil: Boolean + organizationIDEqualFold: String + organizationIDContainsFold: String +} +""" +OrganizationSettingRegion is enum for the field geo_location +""" +enum OrganizationSettingRegion @goModel(model: "github.com/theopenlane/core/pkg/enums.Region") { + AMER + EMEA + APAC +} +""" +Return response for updateOrganizationSetting mutation +""" +type OrganizationSettingUpdatePayload { + """ + Updated organizationSetting + """ + organizationSetting: OrganizationSetting! +} +""" +OrganizationSettingWhereInput is used for filtering OrganizationSetting objects. +Input was generated by ent. +""" +input OrganizationSettingWhereInput { + not: OrganizationSettingWhereInput + and: [OrganizationSettingWhereInput!] + or: [OrganizationSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + billing_contact field predicates + """ + billingContact: String + billingContactNEQ: String + billingContactIn: [String!] + billingContactNotIn: [String!] + billingContactGT: String + billingContactGTE: String + billingContactLT: String + billingContactLTE: String + billingContactContains: String + billingContactHasPrefix: String + billingContactHasSuffix: String + billingContactIsNil: Boolean + billingContactNotNil: Boolean + billingContactEqualFold: String + billingContactContainsFold: String + """ + billing_email field predicates + """ + billingEmail: String + billingEmailNEQ: String + billingEmailIn: [String!] + billingEmailNotIn: [String!] + billingEmailGT: String + billingEmailGTE: String + billingEmailLT: String + billingEmailLTE: String + billingEmailContains: String + billingEmailHasPrefix: String + billingEmailHasSuffix: String + billingEmailIsNil: Boolean + billingEmailNotNil: Boolean + billingEmailEqualFold: String + billingEmailContainsFold: String + """ + billing_phone field predicates + """ + billingPhone: String + billingPhoneNEQ: String + billingPhoneIn: [String!] + billingPhoneNotIn: [String!] + billingPhoneGT: String + billingPhoneGTE: String + billingPhoneLT: String + billingPhoneLTE: String + billingPhoneContains: String + billingPhoneHasPrefix: String + billingPhoneHasSuffix: String + billingPhoneIsNil: Boolean + billingPhoneNotNil: Boolean + billingPhoneEqualFold: String + billingPhoneContainsFold: String + """ + billing_address field predicates + """ + billingAddress: String + billingAddressNEQ: String + billingAddressIn: [String!] + billingAddressNotIn: [String!] + billingAddressGT: String + billingAddressGTE: String + billingAddressLT: String + billingAddressLTE: String + billingAddressContains: String + billingAddressHasPrefix: String + billingAddressHasSuffix: String + billingAddressIsNil: Boolean + billingAddressNotNil: Boolean + billingAddressEqualFold: String + billingAddressContainsFold: String + """ + tax_identifier field predicates + """ + taxIdentifier: String + taxIdentifierNEQ: String + taxIdentifierIn: [String!] + taxIdentifierNotIn: [String!] + taxIdentifierGT: String + taxIdentifierGTE: String + taxIdentifierLT: String + taxIdentifierLTE: String + taxIdentifierContains: String + taxIdentifierHasPrefix: String + taxIdentifierHasSuffix: String + taxIdentifierIsNil: Boolean + taxIdentifierNotNil: Boolean + taxIdentifierEqualFold: String + taxIdentifierContainsFold: String + """ + geo_location field predicates + """ + geoLocation: OrganizationSettingRegion + geoLocationNEQ: OrganizationSettingRegion + geoLocationIn: [OrganizationSettingRegion!] + geoLocationNotIn: [OrganizationSettingRegion!] + geoLocationIsNil: Boolean + geoLocationNotNil: Boolean + """ + organization_id field predicates + """ + organizationID: ID + organizationIDNEQ: ID + organizationIDIn: [ID!] + organizationIDNotIn: [ID!] + organizationIDGT: ID + organizationIDGTE: ID + organizationIDLT: ID + organizationIDLTE: ID + organizationIDContains: ID + organizationIDHasPrefix: ID + organizationIDHasSuffix: ID + organizationIDIsNil: Boolean + organizationIDNotNil: Boolean + organizationIDEqualFold: ID + organizationIDContainsFold: ID + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] +} +""" +Return response for updateOrganization mutation +""" +type OrganizationUpdatePayload { + """ + Updated organization + """ + organization: Organization! +} +""" +OrganizationWhereInput is used for filtering Organization objects. +Input was generated by ent. +""" +input OrganizationWhereInput { + not: OrganizationWhereInput + and: [OrganizationWhereInput!] + or: [OrganizationWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + parent_organization_id field predicates + """ + parentOrganizationID: ID + parentOrganizationIDNEQ: ID + parentOrganizationIDIn: [ID!] + parentOrganizationIDNotIn: [ID!] + parentOrganizationIDGT: ID + parentOrganizationIDGTE: ID + parentOrganizationIDLT: ID + parentOrganizationIDLTE: ID + parentOrganizationIDContains: ID + parentOrganizationIDHasPrefix: ID + parentOrganizationIDHasSuffix: ID + parentOrganizationIDIsNil: Boolean + parentOrganizationIDNotNil: Boolean + parentOrganizationIDEqualFold: ID + parentOrganizationIDContainsFold: ID + """ + personal_org field predicates + """ + personalOrg: Boolean + personalOrgNEQ: Boolean + personalOrgIsNil: Boolean + personalOrgNotNil: Boolean + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + parent edge predicates + """ + hasParent: Boolean + hasParentWith: [OrganizationWhereInput!] + """ + children edge predicates + """ + hasChildren: Boolean + hasChildrenWith: [OrganizationWhereInput!] + """ + groups edge predicates + """ + hasGroups: Boolean + hasGroupsWith: [GroupWhereInput!] + """ + templates edge predicates + """ + hasTemplates: Boolean + hasTemplatesWith: [TemplateWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [OrganizationSettingWhereInput!] + """ + documentdata edge predicates + """ + hasDocumentdata: Boolean + hasDocumentdataWith: [DocumentDataWhereInput!] + """ + entitlements edge predicates + """ + hasEntitlements: Boolean + hasEntitlementsWith: [EntitlementWhereInput!] + """ + organization_entitlement edge predicates + """ + hasOrganizationEntitlement: Boolean + hasOrganizationEntitlementWith: [EntitlementWhereInput!] + """ + personal_access_tokens edge predicates + """ + hasPersonalAccessTokens: Boolean + hasPersonalAccessTokensWith: [PersonalAccessTokenWhereInput!] + """ + api_tokens edge predicates + """ + hasAPITokens: Boolean + hasAPITokensWith: [APITokenWhereInput!] + """ + oauthprovider edge predicates + """ + hasOauthprovider: Boolean + hasOauthproviderWith: [OauthProviderWhereInput!] + """ + users edge predicates + """ + hasUsers: Boolean + hasUsersWith: [UserWhereInput!] + """ + invites edge predicates + """ + hasInvites: Boolean + hasInvitesWith: [InviteWhereInput!] + """ + subscribers edge predicates + """ + hasSubscribers: Boolean + hasSubscribersWith: [SubscriberWhereInput!] + """ + webhooks edge predicates + """ + hasWebhooks: Boolean + hasWebhooksWith: [WebhookWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + secrets edge predicates + """ + hasSecrets: Boolean + hasSecretsWith: [HushWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [FeatureWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + entitlementplans edge predicates + """ + hasEntitlementplans: Boolean + hasEntitlementplansWith: [EntitlementPlanWhereInput!] + """ + entitlementplanfeatures edge predicates + """ + hasEntitlementplanfeatures: Boolean + hasEntitlementplanfeaturesWith: [EntitlementPlanFeatureWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] + """ + entitytypes edge predicates + """ + hasEntitytypes: Boolean + hasEntitytypesWith: [EntityTypeWhereInput!] + """ + contacts edge predicates + """ + hasContacts: Boolean + hasContactsWith: [ContactWhereInput!] + """ + notes edge predicates + """ + hasNotes: Boolean + hasNotesWith: [NoteWhereInput!] + """ + members edge predicates + """ + hasMembers: Boolean + hasMembersWith: [OrgMembershipWhereInput!] +} +""" +Information about pagination in a connection. +https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + """ + When paginating backwards, the cursor to continue. + """ + startCursor: Cursor + """ + When paginating forwards, the cursor to continue. + """ + endCursor: Cursor +} +type PersonalAccessToken implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + token: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + owner: User! + """ + the organization(s) the token is associated with + """ + organizations: [Organization!] + events: [Event!] +} +""" +Return response for createBulkPersonalAccessToken mutation +""" +type PersonalAccessTokenBulkCreatePayload { + """ + Created personalAccessTokens + """ + personalAccessTokens: [PersonalAccessToken!] +} +""" +A connection to a list of items. +""" +type PersonalAccessTokenConnection { + """ + A list of edges. + """ + edges: [PersonalAccessTokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createPersonalAccessToken mutation +""" +type PersonalAccessTokenCreatePayload { + """ + Created personalAccessToken + """ + personalAccessToken: PersonalAccessToken! +} +""" +Return response for deletePersonalAccessToken mutation +""" +type PersonalAccessTokenDeletePayload { + """ + Deleted personalAccessToken ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type PersonalAccessTokenEdge { + """ + The item at the end of the edge. + """ + node: PersonalAccessToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +Return response for updatePersonalAccessToken mutation +""" +type PersonalAccessTokenUpdatePayload { + """ + Updated personalAccessToken + """ + personalAccessToken: PersonalAccessToken! +} +""" +PersonalAccessTokenWhereInput is used for filtering PersonalAccessToken objects. +Input was generated by ent. +""" +input PersonalAccessTokenWhereInput { + not: PersonalAccessTokenWhereInput + and: [PersonalAccessTokenWhereInput!] + or: [PersonalAccessTokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + last_used_at field predicates + """ + lastUsedAt: Time + lastUsedAtNEQ: Time + lastUsedAtIn: [Time!] + lastUsedAtNotIn: [Time!] + lastUsedAtGT: Time + lastUsedAtGTE: Time + lastUsedAtLT: Time + lastUsedAtLTE: Time + lastUsedAtIsNil: Boolean + lastUsedAtNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [UserWhereInput!] + """ + organizations edge predicates + """ + hasOrganizations: Boolean + hasOrganizationsWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Query { + """ + Fetches an object given its ID. + """ + node( + """ + ID of the object. + """ + id: ID! + ): Node + """ + Lookup nodes by a list of IDs. + """ + nodes( + """ + The list of node IDs. + """ + ids: [ID!]! + ): [Node]! + apiTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for APITokens returned from the connection. + """ + where: APITokenWhereInput + ): APITokenConnection! + contacts( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Contacts returned from the connection. + """ + where: ContactWhereInput + ): ContactConnection! + contactHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for ContactHistories returned from the connection. + """ + where: ContactHistoryWhereInput + ): ContactHistoryConnection! + documentDataSlice( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for DocumentDataSlice returned from the connection. + """ + where: DocumentDataWhereInput + ): DocumentDataConnection! + documentDataHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for DocumentDataHistories returned from the connection. + """ + where: DocumentDataHistoryWhereInput + ): DocumentDataHistoryConnection! + entitlements( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Entitlements returned from the connection. + """ + where: EntitlementWhereInput + ): EntitlementConnection! + entitlementHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementHistories returned from the connection. + """ + where: EntitlementHistoryWhereInput + ): EntitlementHistoryConnection! + entitlementPlans( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlans returned from the connection. + """ + where: EntitlementPlanWhereInput + ): EntitlementPlanConnection! + entitlementPlanFeatures( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanFeatures returned from the connection. + """ + where: EntitlementPlanFeatureWhereInput + ): EntitlementPlanFeatureConnection! + entitlementPlanFeatureHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanFeatureHistories returned from the connection. + """ + where: EntitlementPlanFeatureHistoryWhereInput + ): EntitlementPlanFeatureHistoryConnection! + entitlementPlanHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanHistories returned from the connection. + """ + where: EntitlementPlanHistoryWhereInput + ): EntitlementPlanHistoryConnection! + entities( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Entities returned from the connection. + """ + orderBy: EntityOrder + + """ + Filtering options for Entities returned from the connection. + """ + where: EntityWhereInput + ): EntityConnection! + entityHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityHistories returned from the connection. + """ + orderBy: EntityHistoryOrder + + """ + Filtering options for EntityHistories returned from the connection. + """ + where: EntityHistoryWhereInput + ): EntityHistoryConnection! + entityTypes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityTypes returned from the connection. + """ + orderBy: EntityTypeOrder + + """ + Filtering options for EntityTypes returned from the connection. + """ + where: EntityTypeWhereInput + ): EntityTypeConnection! + entityTypeHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityTypeHistories returned from the connection. + """ + orderBy: EntityTypeHistoryOrder + + """ + Filtering options for EntityTypeHistories returned from the connection. + """ + where: EntityTypeHistoryWhereInput + ): EntityTypeHistoryConnection! + events( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Events returned from the connection. + """ + where: EventWhereInput + ): EventConnection! + eventHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EventHistories returned from the connection. + """ + where: EventHistoryWhereInput + ): EventHistoryConnection! + features( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Features returned from the connection. + """ + where: FeatureWhereInput + ): FeatureConnection! + featureHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for FeatureHistories returned from the connection. + """ + where: FeatureHistoryWhereInput + ): FeatureHistoryConnection! + files( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Files returned from the connection. + """ + where: FileWhereInput + ): FileConnection! + fileHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for FileHistories returned from the connection. + """ + where: FileHistoryWhereInput + ): FileHistoryConnection! + groups( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Groups returned from the connection. + """ + orderBy: GroupOrder + + """ + Filtering options for Groups returned from the connection. + """ + where: GroupWhereInput + ): GroupConnection! + groupHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for GroupHistories returned from the connection. + """ + orderBy: GroupHistoryOrder + + """ + Filtering options for GroupHistories returned from the connection. + """ + where: GroupHistoryWhereInput + ): GroupHistoryConnection! + groupMemberships( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupMemberships returned from the connection. + """ + where: GroupMembershipWhereInput + ): GroupMembershipConnection! + groupMembershipHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupMembershipHistories returned from the connection. + """ + where: GroupMembershipHistoryWhereInput + ): GroupMembershipHistoryConnection! + groupSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupSettings returned from the connection. + """ + where: GroupSettingWhereInput + ): GroupSettingConnection! + groupSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupSettingHistories returned from the connection. + """ + where: GroupSettingHistoryWhereInput + ): GroupSettingHistoryConnection! + hushes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Hushes returned from the connection. + """ + orderBy: HushOrder + + """ + Filtering options for Hushes returned from the connection. + """ + where: HushWhereInput + ): HushConnection! + hushHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for HushHistories returned from the connection. + """ + orderBy: HushHistoryOrder + + """ + Filtering options for HushHistories returned from the connection. + """ + where: HushHistoryWhereInput + ): HushHistoryConnection! + integrations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Integrations returned from the connection. + """ + orderBy: IntegrationOrder + + """ + Filtering options for Integrations returned from the connection. + """ + where: IntegrationWhereInput + ): IntegrationConnection! + integrationHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for IntegrationHistories returned from the connection. + """ + orderBy: IntegrationHistoryOrder + + """ + Filtering options for IntegrationHistories returned from the connection. + """ + where: IntegrationHistoryWhereInput + ): IntegrationHistoryConnection! + invites( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Invites returned from the connection. + """ + where: InviteWhereInput + ): InviteConnection! + notes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Notes returned from the connection. + """ + where: NoteWhereInput + ): NoteConnection! + noteHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for NoteHistories returned from the connection. + """ + where: NoteHistoryWhereInput + ): NoteHistoryConnection! + oauthProviders( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OauthProviders returned from the connection. + """ + where: OauthProviderWhereInput + ): OauthProviderConnection! + oauthProviderHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OauthProviderHistories returned from the connection. + """ + where: OauthProviderHistoryWhereInput + ): OauthProviderHistoryConnection! + ohAuthTooTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OhAuthTooTokens returned from the connection. + """ + where: OhAuthTooTokenWhereInput + ): OhAuthTooTokenConnection! + orgMemberships( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrgMemberships returned from the connection. + """ + where: OrgMembershipWhereInput + ): OrgMembershipConnection! + orgMembershipHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrgMembershipHistories returned from the connection. + """ + where: OrgMembershipHistoryWhereInput + ): OrgMembershipHistoryConnection! + organizations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Organizations returned from the connection. + """ + orderBy: OrganizationOrder + + """ + Filtering options for Organizations returned from the connection. + """ + where: OrganizationWhereInput + ): OrganizationConnection! + organizationHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for OrganizationHistories returned from the connection. + """ + orderBy: OrganizationHistoryOrder + + """ + Filtering options for OrganizationHistories returned from the connection. + """ + where: OrganizationHistoryWhereInput + ): OrganizationHistoryConnection! + organizationSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrganizationSettings returned from the connection. + """ + where: OrganizationSettingWhereInput + ): OrganizationSettingConnection! + organizationSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrganizationSettingHistories returned from the connection. + """ + where: OrganizationSettingHistoryWhereInput + ): OrganizationSettingHistoryConnection! + personalAccessTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for PersonalAccessTokens returned from the connection. + """ + where: PersonalAccessTokenWhereInput + ): PersonalAccessTokenConnection! + subscribers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Subscribers returned from the connection. + """ + where: SubscriberWhereInput + ): SubscriberConnection! + tfaSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for TFASettings returned from the connection. + """ + where: TFASettingWhereInput + ): TFASettingConnection! + templates( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Templates returned from the connection. + """ + orderBy: TemplateOrder + + """ + Filtering options for Templates returned from the connection. + """ + where: TemplateWhereInput + ): TemplateConnection! + templateHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for TemplateHistories returned from the connection. + """ + orderBy: TemplateHistoryOrder + + """ + Filtering options for TemplateHistories returned from the connection. + """ + where: TemplateHistoryWhereInput + ): TemplateHistoryConnection! + users( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Users returned from the connection. + """ + orderBy: UserOrder + + """ + Filtering options for Users returned from the connection. + """ + where: UserWhereInput + ): UserConnection! + userHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for UserHistories returned from the connection. + """ + orderBy: UserHistoryOrder + + """ + Filtering options for UserHistories returned from the connection. + """ + where: UserHistoryWhereInput + ): UserHistoryConnection! + userSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for UserSettings returned from the connection. + """ + where: UserSettingWhereInput + ): UserSettingConnection! + userSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for UserSettingHistories returned from the connection. + """ + where: UserSettingHistoryWhereInput + ): UserSettingHistoryConnection! + webhooks( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Webhooks returned from the connection. + """ + orderBy: WebhookOrder + + """ + Filtering options for Webhooks returned from the connection. + """ + where: WebhookWhereInput + ): WebhookConnection! + webhookHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for WebhookHistories returned from the connection. + """ + orderBy: WebhookHistoryOrder + + """ + Filtering options for WebhookHistories returned from the connection. + """ + where: WebhookHistoryWhereInput + ): WebhookHistoryConnection! + """ + Look up apiToken by ID + """ + apiToken( + """ + ID of the apiToken + """ + id: ID! + ): APIToken! + auditLogs( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for AuditLogs returned from the connection. + """ + where: AuditLogWhereInput + ): AuditLogConnection! + """ + Look up contact by ID + """ + contact( + """ + ID of the contact + """ + id: ID! + ): Contact! + """ + Look up documentData by ID + """ + documentData( + """ + ID of the documentData + """ + id: ID! + ): DocumentData! + """ + Look up entitlement by ID + """ + entitlement( + """ + ID of the entitlement + """ + id: ID! + ): Entitlement! + """ + Look up entitlementPlan by ID + """ + entitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + ): EntitlementPlan! + """ + Look up entitlementPlanFeature by ID + """ + entitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + ): EntitlementPlanFeature! + """ + Look up entity by ID + """ + entity( + """ + ID of the entity + """ + id: ID! + ): Entity! + """ + Look up entityType by ID + """ + entityType( + """ + ID of the entityType + """ + id: ID! + ): EntityType! + """ + Look up event by ID + """ + event( + """ + ID of the event + """ + id: ID! + ): Event! + """ + Look up feature by ID + """ + feature( + """ + ID of the feature + """ + id: ID! + ): Feature! + """ + Look up file by ID + """ + file( + """ + ID of the file + """ + id: ID! + ): File! + """ + Look up group by ID + """ + group( + """ + ID of the group + """ + id: ID! + ): Group! + """ + Look up groupMembership by ID + """ + groupMembership( + """ + ID of the groupMembership + """ + id: ID! + ): GroupMembership! + """ + Look up groupSetting by ID + """ + groupSetting( + """ + ID of the groupSetting + """ + id: ID! + ): GroupSetting! + """ + Look up hush by ID + """ + hush( + """ + ID of the hush + """ + id: ID! + ): Hush! + """ + Look up integration by ID + """ + integration( + """ + ID of the integration + """ + id: ID! + ): Integration! + """ + Look up invite by ID + """ + invite( + """ + ID of the invite + """ + id: ID! + ): Invite! + """ + Look up oauthProvider by ID + """ + oauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + ): OauthProvider! + """ + Look up ohAuthTooToken by ID + """ + ohAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + ): OhAuthTooToken! + """ + Look up organization by ID + """ + organization( + """ + ID of the organization + """ + id: ID! + ): Organization! + """ + Look up organizationSetting by ID + """ + organizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + ): OrganizationSetting! + """ + Look up orgMembership by ID + """ + orgMembership( + """ + ID of the orgMembership + """ + id: ID! + ): OrgMembership! + """ + Look up personalAccessToken by ID + """ + personalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + ): PersonalAccessToken! + """ + Search across organizations, groups, and users + """ + search( + """ + Search query + """ + query: String! + ): GlobalSearchResultConnection + """ + Look up subscriber by Email + """ + subscriber( + """ + Email of the subscriber + """ + email: String! + ): Subscriber! + """ + Look up template by ID + """ + template( + """ + ID of the template + """ + id: ID! + ): Template! + """ + Look up tfaSetting for the current user + """ + tfaSetting( + """ + ID of the tfaSetting + """ + id: ID + ): TFASetting! + """ + Look up user by ID + """ + user( + """ + ID of the user + """ + id: ID! + ): User! + """ + Look up userSetting by ID + """ + userSetting( + """ + ID of the userSetting + """ + id: ID! + ): UserSetting! + """ + Look up webhook by ID + """ + webhook( + """ + ID of the webhook + """ + id: ID! + ): Webhook! +} +type Subscriber implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + email address of the subscriber + """ + email: String! + """ + phone number of the subscriber + """ + phoneNumber: String + """ + indicates if the email address has been verified + """ + verifiedEmail: Boolean! + """ + indicates if the phone number has been verified + """ + verifiedPhone: Boolean! + """ + indicates if the subscriber is active or not, active users will have at least one verified contact method + """ + active: Boolean! + owner: Organization + events: [Event!] +} +""" +Return response for createBulkSubscriber mutation +""" +type SubscriberBulkCreatePayload { + """ + Created subscribers + """ + subscribers: [Subscriber!] +} +""" +A connection to a list of items. +""" +type SubscriberConnection { + """ + A list of edges. + """ + edges: [SubscriberEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createSubscriber mutation +""" +type SubscriberCreatePayload { + """ + Created subscriber + """ + subscriber: Subscriber! +} +""" +Return response for deleteSubscriber mutation +""" +type SubscriberDeletePayload { + """ + Deleted subscriber email + """ + email: String! +} +""" +An edge in a connection. +""" +type SubscriberEdge { + """ + The item at the end of the edge. + """ + node: Subscriber + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type SubscriberSearchResult { + subscribers: [Subscriber!] +} +""" +Return response for updateSubscriber mutation +""" +type SubscriberUpdatePayload { + """ + Updated subscriber + """ + subscriber: Subscriber! +} +""" +SubscriberWhereInput is used for filtering Subscriber objects. +Input was generated by ent. +""" +input SubscriberWhereInput { + not: SubscriberWhereInput + and: [SubscriberWhereInput!] + or: [SubscriberWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + verified_email field predicates + """ + verifiedEmail: Boolean + verifiedEmailNEQ: Boolean + """ + verified_phone field predicates + """ + verifiedPhone: Boolean + verifiedPhoneNEQ: Boolean + """ + active field predicates + """ + active: Boolean + activeNEQ: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type TFASetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + TFA secret for the user + """ + tfaSecret: String + """ + specifies if the TFA device has been verified + """ + verified: Boolean! + """ + recovery codes for 2fa + """ + recoveryCodes: [String!] + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + owner: User +} +""" +A connection to a list of items. +""" +type TFASettingConnection { + """ + A list of edges. + """ + edges: [TFASettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createTFASetting mutation +""" +type TFASettingCreatePayload { + """ + Created tfaSetting + """ + tfaSetting: TFASetting! +} +""" +An edge in a connection. +""" +type TFASettingEdge { + """ + The item at the end of the edge. + """ + node: TFASetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +Return response for updateTFASetting mutation +""" +type TFASettingUpdatePayload { + """ + Updated tfaSetting + """ + tfaSetting: TFASetting! +} +""" +TFASettingWhereInput is used for filtering TFASetting objects. +Input was generated by ent. +""" +input TFASettingWhereInput { + not: TFASettingWhereInput + and: [TFASettingWhereInput!] + or: [TFASettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + tfa_secret field predicates + """ + tfaSecret: String + tfaSecretNEQ: String + tfaSecretIn: [String!] + tfaSecretNotIn: [String!] + tfaSecretGT: String + tfaSecretGTE: String + tfaSecretLT: String + tfaSecretLTE: String + tfaSecretContains: String + tfaSecretHasPrefix: String + tfaSecretHasSuffix: String + tfaSecretIsNil: Boolean + tfaSecretNotNil: Boolean + tfaSecretEqualFold: String + tfaSecretContainsFold: String + """ + verified field predicates + """ + verified: Boolean + verifiedNEQ: Boolean + """ + totp_allowed field predicates + """ + totpAllowed: Boolean + totpAllowedNEQ: Boolean + totpAllowedIsNil: Boolean + totpAllowedNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [UserWhereInput!] +} +type Template implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType! + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON + owner: Organization + documents: [DocumentData!] +} +""" +Return response for createBulkTemplate mutation +""" +type TemplateBulkCreatePayload { + """ + Created templates + """ + templates: [Template!] +} +""" +A connection to a list of items. +""" +type TemplateConnection { + """ + A list of edges. + """ + edges: [TemplateEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createTemplate mutation +""" +type TemplateCreatePayload { + """ + Created template + """ + template: Template! +} +""" +Return response for deleteTemplate mutation +""" +type TemplateDeletePayload { + """ + Deleted template ID + """ + deletedID: ID! +} +""" +TemplateDocumentType is enum for the field template_type +""" +enum TemplateDocumentType @goModel(model: "github.com/theopenlane/core/pkg/enums.DocumentType") { + ROOTTEMPLATE + DOCUMENT +} +""" +An edge in a connection. +""" +type TemplateEdge { + """ + The item at the end of the edge. + """ + node: Template + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type TemplateHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: TemplateHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateHistoryDocumentType! + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON +} +""" +A connection to a list of items. +""" +type TemplateHistoryConnection { + """ + A list of edges. + """ + edges: [TemplateHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +TemplateHistoryDocumentType is enum for the field template_type +""" +enum TemplateHistoryDocumentType @goModel(model: "github.com/theopenlane/core/pkg/enums.DocumentType") { + ROOTTEMPLATE + DOCUMENT +} +""" +An edge in a connection. +""" +type TemplateHistoryEdge { + """ + The item at the end of the edge. + """ + node: TemplateHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +TemplateHistoryOpType is enum for the field operation +""" +enum TemplateHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for TemplateHistory connections +""" +input TemplateHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order TemplateHistories. + """ + field: TemplateHistoryOrderField! +} +""" +Properties by which TemplateHistory connections can be ordered. +""" +enum TemplateHistoryOrderField { + name +} +""" +TemplateHistoryWhereInput is used for filtering TemplateHistory objects. +Input was generated by ent. +""" +input TemplateHistoryWhereInput { + not: TemplateHistoryWhereInput + and: [TemplateHistoryWhereInput!] + or: [TemplateHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: TemplateHistoryOpType + operationNEQ: TemplateHistoryOpType + operationIn: [TemplateHistoryOpType!] + operationNotIn: [TemplateHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + template_type field predicates + """ + templateType: TemplateHistoryDocumentType + templateTypeNEQ: TemplateHistoryDocumentType + templateTypeIn: [TemplateHistoryDocumentType!] + templateTypeNotIn: [TemplateHistoryDocumentType!] + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String +} +""" +Ordering options for Template connections +""" +input TemplateOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Templates. + """ + field: TemplateOrderField! +} +""" +Properties by which Template connections can be ordered. +""" +enum TemplateOrderField { + name +} +""" +Return response for updateTemplate mutation +""" +type TemplateUpdatePayload { + """ + Updated template + """ + template: Template! +} +""" +TemplateWhereInput is used for filtering Template objects. +Input was generated by ent. +""" +input TemplateWhereInput { + not: TemplateWhereInput + and: [TemplateWhereInput!] + or: [TemplateWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + template_type field predicates + """ + templateType: TemplateDocumentType + templateTypeNEQ: TemplateDocumentType + templateTypeIn: [TemplateDocumentType!] + templateTypeNotIn: [TemplateDocumentType!] + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + documents edge predicates + """ + hasDocuments: Boolean + hasDocumentsWith: [DocumentDataWhereInput!] +} +""" +The builtin Time type +""" +scalar Time +""" +The builtin Uint type +""" +scalar Uint +""" +UpdateAPITokenInput is used for update APIToken object. +Input was generated by ent. +""" +input UpdateAPITokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name associated with the token + """ + name: String + """ + a description of the token's purpose + """ + description: String + clearDescription: Boolean + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + lastUsedAt: Time + clearLastUsedAt: Boolean + ownerID: ID + clearOwner: Boolean +} +""" +UpdateContactInput is used for update Contact object. +Input was generated by ent. +""" +input UpdateContactInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the full name of the contact + """ + fullName: String + """ + the title of the contact + """ + title: String + clearTitle: Boolean + """ + the company of the contact + """ + company: String + clearCompany: Boolean + """ + the email of the contact + """ + email: String + clearEmail: Boolean + """ + the phone number of the contact + """ + phoneNumber: String + clearPhoneNumber: Boolean + """ + the address of the contact + """ + address: String + clearAddress: Boolean + """ + status of the contact + """ + status: ContactUserStatus + ownerID: ID + clearOwner: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean +} +""" +UpdateDocumentDataInput is used for update DocumentData object. +Input was generated by ent. +""" +input UpdateDocumentDataInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the json data of the document + """ + data: JSON + ownerID: ID + clearOwner: Boolean + templateID: ID + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntity: Boolean +} +""" +UpdateEntitlementInput is used for update Entitlement object. +Input was generated by ent. +""" +input UpdateEntitlementInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + clearExternalCustomerID: Boolean + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + clearExternalSubscriptionID: Boolean + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + clearExpiresAt: Boolean + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntitlementPlanFeatureInput is used for update EntitlementPlanFeature object. +Input was generated by ent. +""" +input UpdateEntitlementPlanFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntitlementPlanInput is used for update EntitlementPlan object. +Input was generated by ent. +""" +input UpdateEntitlementPlanInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the displayed 'friendly' name of the plan + """ + displayName: String + clearDisplayName: Boolean + """ + a description of the plan + """ + description: String + clearDescription: Boolean + """ + metadata for the plan + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlements: Boolean + addBaseFeatureIDs: [ID!] + removeBaseFeatureIDs: [ID!] + clearBaseFeatures: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntityInput is used for update Entity object. +Input was generated by ent. +""" +input UpdateEntityInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the entity + """ + name: String + clearName: Boolean + """ + The entity's displayed 'friendly' name + """ + displayName: String + clearDisplayName: Boolean + """ + An optional description of the entity + """ + description: String + clearDescription: Boolean + """ + domains associated with the entity + """ + domains: [String!] + appendDomains: [String!] + clearDomains: Boolean + """ + status of the entity + """ + status: String + clearStatus: Boolean + ownerID: ID + clearOwner: Boolean + addContactIDs: [ID!] + removeContactIDs: [ID!] + clearContacts: Boolean + addDocumentIDs: [ID!] + removeDocumentIDs: [ID!] + clearDocuments: Boolean + addNoteIDs: [ID!] + removeNoteIDs: [ID!] + clearNotes: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + entityTypeID: ID + clearEntityType: Boolean + note: CreateNoteInput +} +""" +UpdateEntityTypeInput is used for update EntityType object. +Input was generated by ent. +""" +input UpdateEntityTypeInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the entity + """ + name: String + ownerID: ID + clearOwner: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean +} +""" +UpdateEventInput is used for update Event object. +Input was generated by ent. +""" +input UpdateEventInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + eventID: String + clearEventID: Boolean + correlationID: String + clearCorrelationID: Boolean + eventType: String + metadata: Map + clearMetadata: Boolean + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUser: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroup: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegration: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addInviteIDs: [ID!] + removeInviteIDs: [ID!] + clearInvite: Boolean + addFeatureIDs: [ID!] + removeFeatureIDs: [ID!] + clearFeature: Boolean + addEntitlementplanIDs: [ID!] + removeEntitlementplanIDs: [ID!] + clearEntitlementplan: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessToken: Boolean + addOauth2tokenIDs: [ID!] + removeOauth2tokenIDs: [ID!] + clearOauth2token: Boolean + addHushIDs: [ID!] + removeHushIDs: [ID!] + clearHush: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlement: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhook: Boolean + addSubscriberIDs: [ID!] + removeSubscriberIDs: [ID!] + clearSubscriber: Boolean +} +""" +UpdateFeatureInput is used for update Feature object. +Input was generated by ent. +""" +input UpdateFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the displayed 'friendly' name of the feature + """ + displayName: String + clearDisplayName: Boolean + """ + enabled features are available for use + """ + enabled: Boolean + """ + a description of the feature + """ + description: String + clearDescription: Boolean + """ + metadata for the feature + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addPlanIDs: [ID!] + removePlanIDs: [ID!] + clearPlans: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateFileInput is used for update File object. +Input was generated by ent. +""" +input UpdateFileInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + fileName: String + fileExtension: String + fileSize: Int + clearFileSize: Boolean + contentType: String + storeKey: String + category: String + clearCategory: Boolean + annotation: String + clearAnnotation: Boolean + userID: ID + clearUser: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntity: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroup: Boolean +} +""" +UpdateGroupInput is used for update Group object. +Input was generated by ent. +""" +input UpdateGroupInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the group - must be unique within the organization + """ + name: String + """ + the groups description + """ + description: String + clearDescription: Boolean + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + clearGravatarLogoURL: Boolean + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + clearLogoURL: Boolean + """ + The group's displayed 'friendly' name + """ + displayName: String + ownerID: ID + clearOwner: Boolean + settingID: ID + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUsers: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + addGroupMembers: [CreateGroupMembershipInput!] + updateGroupSettings: UpdateGroupSettingInput +} +""" +UpdateGroupMembershipInput is used for update GroupMembership object. +Input was generated by ent. +""" +input UpdateGroupMembershipInput { + role: GroupMembershipRole + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateGroupSettingInput is used for update GroupSetting object. +Input was generated by ent. +""" +input UpdateGroupSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + clearSyncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + clearSyncToGithub: Boolean + groupID: ID + clearGroup: Boolean +} +""" +UpdateHushInput is used for update Hush object. +Input was generated by ent. +""" +input UpdateHushInput { + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + clearDescription: Boolean + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + clearKind: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateIntegrationInput is used for update Integration object. +Input was generated by ent. +""" +input UpdateIntegrationInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the integration - must be unique within the organization + """ + name: String + """ + a description of the integration + """ + description: String + clearDescription: Boolean + kind: String + clearKind: Boolean + ownerID: ID + clearOwner: Boolean + addSecretIDs: [ID!] + removeSecretIDs: [ID!] + clearSecrets: Boolean + addOauth2tokenIDs: [ID!] + removeOauth2tokenIDs: [ID!] + clearOauth2tokens: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhooks: Boolean +} +""" +UpdateInviteInput is used for update Invite object. +Input was generated by ent. +""" +input UpdateInviteInput { + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + clearExpires: Boolean + """ + the status of the invitation + """ + status: InviteInviteStatus + role: InviteRole + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateNoteInput is used for update Note object. +Input was generated by ent. +""" +input UpdateNoteInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the text of the note + """ + text: String + ownerID: ID + clearOwner: Boolean + entityID: ID + clearEntity: Boolean +} +""" +UpdateOauthProviderInput is used for update OauthProvider object. +Input was generated by ent. +""" +input UpdateOauthProviderInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the oauth provider's name + """ + name: String + """ + the client id for the oauth provider + """ + clientID: String + """ + the client secret + """ + clientSecret: String + """ + the redirect url + """ + redirectURL: String + """ + the scopes + """ + scopes: String + """ + the auth url of the provider + """ + authURL: String + """ + the token url of the provider + """ + tokenURL: String + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint + """ + the URL to request user information by token + """ + infoURL: String + ownerID: ID + clearOwner: Boolean +} +""" +UpdateOhAuthTooTokenInput is used for update OhAuthTooToken object. +Input was generated by ent. +""" +input UpdateOhAuthTooTokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + clientID: String + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + nonce: String + claimsUserID: String + claimsUsername: String + claimsEmail: String + claimsEmailVerified: Boolean + claimsGroups: [String!] + appendClaimsGroups: [String!] + clearClaimsGroups: Boolean + claimsPreferredUsername: String + connectorID: String + connectorData: [String!] + appendConnectorData: [String!] + clearConnectorData: Boolean + lastUsed: Time + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegration: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateOrgMembershipInput is used for update OrgMembership object. +Input was generated by ent. +""" +input UpdateOrgMembershipInput { + role: OrgMembershipRole + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateOrganizationInput is used for update Organization object. +Input was generated by ent. +""" +input UpdateOrganizationInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the organization + """ + name: String + """ + The organization's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the organization + """ + description: String + clearDescription: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + clearAvatarRemoteURL: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroups: Boolean + addTemplateIDs: [ID!] + removeTemplateIDs: [ID!] + clearTemplates: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + settingID: ID + clearSetting: Boolean + addDocumentdatumIDs: [ID!] + removeDocumentdatumIDs: [ID!] + clearDocumentdata: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlements: Boolean + addOrganizationEntitlementIDs: [ID!] + removeOrganizationEntitlementIDs: [ID!] + clearOrganizationEntitlement: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessTokens: Boolean + addAPITokenIDs: [ID!] + removeAPITokenIDs: [ID!] + clearAPITokens: Boolean + addOauthproviderIDs: [ID!] + removeOauthproviderIDs: [ID!] + clearOauthprovider: Boolean + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUsers: Boolean + addInviteIDs: [ID!] + removeInviteIDs: [ID!] + clearInvites: Boolean + addSubscriberIDs: [ID!] + removeSubscriberIDs: [ID!] + clearSubscribers: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhooks: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addSecretIDs: [ID!] + removeSecretIDs: [ID!] + clearSecrets: Boolean + addFeatureIDs: [ID!] + removeFeatureIDs: [ID!] + clearFeatures: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + addEntitlementplanIDs: [ID!] + removeEntitlementplanIDs: [ID!] + clearEntitlementplans: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean + addEntitytypeIDs: [ID!] + removeEntitytypeIDs: [ID!] + clearEntitytypes: Boolean + addContactIDs: [ID!] + removeContactIDs: [ID!] + clearContacts: Boolean + addNoteIDs: [ID!] + removeNoteIDs: [ID!] + clearNotes: Boolean + addOrgMembers: [CreateOrgMembershipInput!] + updateOrgSettings: UpdateOrganizationSettingInput +} +""" +UpdateOrganizationSettingInput is used for update OrganizationSetting object. +Input was generated by ent. +""" +input UpdateOrganizationSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + domains associated with the organization + """ + domains: [String!] + appendDomains: [String!] + clearDomains: Boolean + """ + Name of the person to contact for billing + """ + billingContact: String + clearBillingContact: Boolean + """ + Email address of the person to contact for billing + """ + billingEmail: String + clearBillingEmail: Boolean + """ + Phone number to contact for billing + """ + billingPhone: String + clearBillingPhone: Boolean + """ + Address to send billing information to + """ + billingAddress: String + clearBillingAddress: Boolean + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + clearTaxIdentifier: Boolean + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + clearGeoLocation: Boolean + organizationID: ID + clearOrganization: Boolean +} +""" +UpdatePersonalAccessTokenInput is used for update PersonalAccessToken object. +Input was generated by ent. +""" +input UpdatePersonalAccessTokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name associated with the token + """ + name: String + """ + a description of the token's purpose + """ + description: String + clearDescription: Boolean + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + lastUsedAt: Time + clearLastUsedAt: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganizations: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateSubscriberInput is used for update Subscriber object. +Input was generated by ent. +""" +input UpdateSubscriberInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + email address of the subscriber + """ + email: String + """ + phone number of the subscriber + """ + phoneNumber: String + clearPhoneNumber: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateTFASettingInput is used for update TFASetting object. +Input was generated by ent. +""" +input UpdateTFASettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + specifies if the TFA device has been verified + """ + verified: Boolean + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + clearTotpAllowed: Boolean + """ + Whether to regenerate backup codes + """ + regenBackupCodes: Boolean +} +""" +UpdateTemplateInput is used for update Template object. +Input was generated by ent. +""" +input UpdateTemplateInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the template + """ + name: String + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType + """ + the description of the template + """ + description: String + clearDescription: Boolean + """ + the jsonschema object of the template + """ + jsonconfig: JSON + """ + the uischema for the template to render in the UI + """ + uischema: JSON + clearUischema: Boolean + ownerID: ID + clearOwner: Boolean + addDocumentIDs: [ID!] + removeDocumentIDs: [ID!] + clearDocuments: Boolean +} +""" +UpdateUserInput is used for update User object. +Input was generated by ent. +""" +input UpdateUserInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + email: String + firstName: String + clearFirstName: Boolean + lastName: String + clearLastName: Boolean + """ + The user's displayed 'friendly' name + """ + displayName: String + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + clearAvatarRemoteURL: Boolean + """ + The user's local avatar file + """ + avatarLocalFile: String + clearAvatarLocalFile: Boolean + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + clearAvatarUpdatedAt: Boolean + """ + the time the user was last seen + """ + lastSeen: Time + clearLastSeen: Boolean + """ + user password hash + """ + password: String + clearPassword: Boolean + """ + the Subject of the user JWT + """ + sub: String + clearSub: Boolean + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider + """ + the user's role + """ + role: UserRole + clearRole: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessTokens: Boolean + addTfaSettingIDs: [ID!] + removeTfaSettingIDs: [ID!] + clearTfaSettings: Boolean + settingID: ID + addEmailVerificationTokenIDs: [ID!] + removeEmailVerificationTokenIDs: [ID!] + clearEmailVerificationTokens: Boolean + addPasswordResetTokenIDs: [ID!] + removePasswordResetTokenIDs: [ID!] + clearPasswordResetTokens: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroups: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganizations: Boolean + addWebauthnIDs: [ID!] + removeWebauthnIDs: [ID!] + clearWebauthn: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateUserSettingInput is used for update UserSetting object. +Input was generated by ent. +""" +input UpdateUserSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + clearSilencedAt: Boolean + """ + The time the user was suspended + """ + suspendedAt: Time + clearSuspendedAt: Boolean + """ + status of the user account + """ + status: UserSettingUserStatus + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + clearIsWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + clearIsTfaEnabled: Boolean + userID: ID + clearUser: Boolean + defaultOrgID: ID + clearDefaultOrg: Boolean +} +""" +UpdateWebhookInput is used for update Webhook object. +Input was generated by ent. +""" +input UpdateWebhookInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the webhook + """ + name: String + """ + a description of the webhook + """ + description: String + clearDescription: Boolean + """ + the url to send the webhook to + """ + destinationURL: String + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean + """ + the number of failures + """ + failures: Int + clearFailures: Boolean + """ + the last error message + """ + lastError: String + clearLastError: Boolean + """ + the last response + """ + lastResponse: String + clearLastResponse: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean +} +scalar Upload +type User implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider! + """ + the user's role + """ + role: UserRole + personalAccessTokens: [PersonalAccessToken!] + tfaSettings: [TFASetting!] + setting: UserSetting! + groups: [Group!] + organizations: [Organization!] + files: [File!] + events: [Event!] + groupMemberships: [GroupMembership!] + orgMemberships: [OrgMembership!] +} +""" +UserAuthProvider is enum for the field auth_provider +""" +enum UserAuthProvider @goModel(model: "github.com/theopenlane/core/pkg/enums.AuthProvider") { + CREDENTIALS + GOOGLE + GITHUB + WEBAUTHN +} +""" +Return response for createBulkUser mutation +""" +type UserBulkCreatePayload { + """ + Created users + """ + users: [User!] +} +""" +A connection to a list of items. +""" +type UserConnection { + """ + A list of edges. + """ + edges: [UserEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createUser mutation +""" +type UserCreatePayload { + """ + Created user + """ + user: User! +} +""" +Return response for deleteUser mutation +""" +type UserDeletePayload { + """ + Deleted user ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type UserEdge { + """ + The item at the end of the edge. + """ + node: User + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type UserHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: UserHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserHistoryAuthProvider! + """ + the user's role + """ + role: UserHistoryRole +} +""" +UserHistoryAuthProvider is enum for the field auth_provider +""" +enum UserHistoryAuthProvider @goModel(model: "github.com/theopenlane/core/pkg/enums.AuthProvider") { + CREDENTIALS + GOOGLE + GITHUB + WEBAUTHN +} +""" +A connection to a list of items. +""" +type UserHistoryConnection { + """ + A list of edges. + """ + edges: [UserHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserHistoryEdge { + """ + The item at the end of the edge. + """ + node: UserHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +UserHistoryOpType is enum for the field operation +""" +enum UserHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for UserHistory connections +""" +input UserHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order UserHistories. + """ + field: UserHistoryOrderField! +} +""" +Properties by which UserHistory connections can be ordered. +""" +enum UserHistoryOrderField { + first_name + last_name + display_name +} +""" +UserHistoryRole is enum for the field role +""" +enum UserHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +UserHistoryWhereInput is used for filtering UserHistory objects. +Input was generated by ent. +""" +input UserHistoryWhereInput { + not: UserHistoryWhereInput + and: [UserHistoryWhereInput!] + or: [UserHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: UserHistoryOpType + operationNEQ: UserHistoryOpType + operationIn: [UserHistoryOpType!] + operationNotIn: [UserHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + first_name field predicates + """ + firstName: String + firstNameNEQ: String + firstNameIn: [String!] + firstNameNotIn: [String!] + firstNameGT: String + firstNameGTE: String + firstNameLT: String + firstNameLTE: String + firstNameContains: String + firstNameHasPrefix: String + firstNameHasSuffix: String + firstNameIsNil: Boolean + firstNameNotNil: Boolean + firstNameEqualFold: String + firstNameContainsFold: String + """ + last_name field predicates + """ + lastName: String + lastNameNEQ: String + lastNameIn: [String!] + lastNameNotIn: [String!] + lastNameGT: String + lastNameGTE: String + lastNameLT: String + lastNameLTE: String + lastNameContains: String + lastNameHasPrefix: String + lastNameHasSuffix: String + lastNameIsNil: Boolean + lastNameNotNil: Boolean + lastNameEqualFold: String + lastNameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + avatar_local_file field predicates + """ + avatarLocalFile: String + avatarLocalFileNEQ: String + avatarLocalFileIn: [String!] + avatarLocalFileNotIn: [String!] + avatarLocalFileGT: String + avatarLocalFileGTE: String + avatarLocalFileLT: String + avatarLocalFileLTE: String + avatarLocalFileContains: String + avatarLocalFileHasPrefix: String + avatarLocalFileHasSuffix: String + avatarLocalFileIsNil: Boolean + avatarLocalFileNotNil: Boolean + avatarLocalFileEqualFold: String + avatarLocalFileContainsFold: String + """ + avatar_updated_at field predicates + """ + avatarUpdatedAt: Time + avatarUpdatedAtNEQ: Time + avatarUpdatedAtIn: [Time!] + avatarUpdatedAtNotIn: [Time!] + avatarUpdatedAtGT: Time + avatarUpdatedAtGTE: Time + avatarUpdatedAtLT: Time + avatarUpdatedAtLTE: Time + avatarUpdatedAtIsNil: Boolean + avatarUpdatedAtNotNil: Boolean + """ + last_seen field predicates + """ + lastSeen: Time + lastSeenNEQ: Time + lastSeenIn: [Time!] + lastSeenNotIn: [Time!] + lastSeenGT: Time + lastSeenGTE: Time + lastSeenLT: Time + lastSeenLTE: Time + lastSeenIsNil: Boolean + lastSeenNotNil: Boolean + """ + sub field predicates + """ + sub: String + subNEQ: String + subIn: [String!] + subNotIn: [String!] + subGT: String + subGTE: String + subLT: String + subLTE: String + subContains: String + subHasPrefix: String + subHasSuffix: String + subIsNil: Boolean + subNotNil: Boolean + subEqualFold: String + subContainsFold: String + """ + auth_provider field predicates + """ + authProvider: UserHistoryAuthProvider + authProviderNEQ: UserHistoryAuthProvider + authProviderIn: [UserHistoryAuthProvider!] + authProviderNotIn: [UserHistoryAuthProvider!] + """ + role field predicates + """ + role: UserHistoryRole + roleNEQ: UserHistoryRole + roleIn: [UserHistoryRole!] + roleNotIn: [UserHistoryRole!] + roleIsNil: Boolean + roleNotNil: Boolean +} +""" +Ordering options for User connections +""" +input UserOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Users. + """ + field: UserOrderField! +} +""" +Properties by which User connections can be ordered. +""" +enum UserOrderField { + first_name + last_name + display_name +} +""" +UserRole is enum for the field role +""" +enum UserRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +type UserSearchResult { + users: [User!] +} +type UserSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + userID: ID + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean! + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingUserStatus! + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean! + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + user: User + """ + organization to load on user login + """ + defaultOrg: Organization +} +""" +Return response for createBulkUserSetting mutation +""" +type UserSettingBulkCreatePayload { + """ + Created userSettings + """ + userSettings: [UserSetting!] +} +""" +A connection to a list of items. +""" +type UserSettingConnection { + """ + A list of edges. + """ + edges: [UserSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createUserSetting mutation +""" +type UserSettingCreatePayload { + """ + Created userSetting + """ + userSetting: UserSetting! +} +""" +An edge in a connection. +""" +type UserSettingEdge { + """ + The item at the end of the edge. + """ + node: UserSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type UserSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: UserSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + userID: String + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean! + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingHistoryUserStatus! + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean! + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean +} +""" +A connection to a list of items. +""" +type UserSettingHistoryConnection { + """ + A list of edges. + """ + edges: [UserSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: UserSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +UserSettingHistoryOpType is enum for the field operation +""" +enum UserSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +UserSettingHistoryUserStatus is enum for the field status +""" +enum UserSettingHistoryUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +UserSettingHistoryWhereInput is used for filtering UserSettingHistory objects. +Input was generated by ent. +""" +input UserSettingHistoryWhereInput { + not: UserSettingHistoryWhereInput + and: [UserSettingHistoryWhereInput!] + or: [UserSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: UserSettingHistoryOpType + operationNEQ: UserSettingHistoryOpType + operationIn: [UserSettingHistoryOpType!] + operationNotIn: [UserSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDIsNil: Boolean + userIDNotNil: Boolean + userIDEqualFold: String + userIDContainsFold: String + """ + locked field predicates + """ + locked: Boolean + lockedNEQ: Boolean + """ + silenced_at field predicates + """ + silencedAt: Time + silencedAtNEQ: Time + silencedAtIn: [Time!] + silencedAtNotIn: [Time!] + silencedAtGT: Time + silencedAtGTE: Time + silencedAtLT: Time + silencedAtLTE: Time + silencedAtIsNil: Boolean + silencedAtNotNil: Boolean + """ + suspended_at field predicates + """ + suspendedAt: Time + suspendedAtNEQ: Time + suspendedAtIn: [Time!] + suspendedAtNotIn: [Time!] + suspendedAtGT: Time + suspendedAtGTE: Time + suspendedAtLT: Time + suspendedAtLTE: Time + suspendedAtIsNil: Boolean + suspendedAtNotNil: Boolean + """ + status field predicates + """ + status: UserSettingHistoryUserStatus + statusNEQ: UserSettingHistoryUserStatus + statusIn: [UserSettingHistoryUserStatus!] + statusNotIn: [UserSettingHistoryUserStatus!] + """ + email_confirmed field predicates + """ + emailConfirmed: Boolean + emailConfirmedNEQ: Boolean + """ + is_webauthn_allowed field predicates + """ + isWebauthnAllowed: Boolean + isWebauthnAllowedNEQ: Boolean + isWebauthnAllowedIsNil: Boolean + isWebauthnAllowedNotNil: Boolean + """ + is_tfa_enabled field predicates + """ + isTfaEnabled: Boolean + isTfaEnabledNEQ: Boolean + isTfaEnabledIsNil: Boolean + isTfaEnabledNotNil: Boolean +} +""" +Return response for updateUserSetting mutation +""" +type UserSettingUpdatePayload { + """ + Updated userSetting + """ + userSetting: UserSetting! +} +""" +UserSettingUserStatus is enum for the field status +""" +enum UserSettingUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +UserSettingWhereInput is used for filtering UserSetting objects. +Input was generated by ent. +""" +input UserSettingWhereInput { + not: UserSettingWhereInput + and: [UserSettingWhereInput!] + or: [UserSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + user_id field predicates + """ + userID: ID + userIDNEQ: ID + userIDIn: [ID!] + userIDNotIn: [ID!] + userIDGT: ID + userIDGTE: ID + userIDLT: ID + userIDLTE: ID + userIDContains: ID + userIDHasPrefix: ID + userIDHasSuffix: ID + userIDIsNil: Boolean + userIDNotNil: Boolean + userIDEqualFold: ID + userIDContainsFold: ID + """ + locked field predicates + """ + locked: Boolean + lockedNEQ: Boolean + """ + silenced_at field predicates + """ + silencedAt: Time + silencedAtNEQ: Time + silencedAtIn: [Time!] + silencedAtNotIn: [Time!] + silencedAtGT: Time + silencedAtGTE: Time + silencedAtLT: Time + silencedAtLTE: Time + silencedAtIsNil: Boolean + silencedAtNotNil: Boolean + """ + suspended_at field predicates + """ + suspendedAt: Time + suspendedAtNEQ: Time + suspendedAtIn: [Time!] + suspendedAtNotIn: [Time!] + suspendedAtGT: Time + suspendedAtGTE: Time + suspendedAtLT: Time + suspendedAtLTE: Time + suspendedAtIsNil: Boolean + suspendedAtNotNil: Boolean + """ + status field predicates + """ + status: UserSettingUserStatus + statusNEQ: UserSettingUserStatus + statusIn: [UserSettingUserStatus!] + statusNotIn: [UserSettingUserStatus!] + """ + email_confirmed field predicates + """ + emailConfirmed: Boolean + emailConfirmedNEQ: Boolean + """ + is_webauthn_allowed field predicates + """ + isWebauthnAllowed: Boolean + isWebauthnAllowedNEQ: Boolean + isWebauthnAllowedIsNil: Boolean + isWebauthnAllowedNotNil: Boolean + """ + is_tfa_enabled field predicates + """ + isTfaEnabled: Boolean + isTfaEnabledNEQ: Boolean + isTfaEnabledIsNil: Boolean + isTfaEnabledNotNil: Boolean + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + default_org edge predicates + """ + hasDefaultOrg: Boolean + hasDefaultOrgWith: [OrganizationWhereInput!] +} +""" +Return response for updateUser mutation +""" +type UserUpdatePayload { + """ + Updated user + """ + user: User! +} +""" +UserWhereInput is used for filtering User objects. +Input was generated by ent. +""" +input UserWhereInput { + not: UserWhereInput + and: [UserWhereInput!] + or: [UserWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + first_name field predicates + """ + firstName: String + firstNameNEQ: String + firstNameIn: [String!] + firstNameNotIn: [String!] + firstNameGT: String + firstNameGTE: String + firstNameLT: String + firstNameLTE: String + firstNameContains: String + firstNameHasPrefix: String + firstNameHasSuffix: String + firstNameIsNil: Boolean + firstNameNotNil: Boolean + firstNameEqualFold: String + firstNameContainsFold: String + """ + last_name field predicates + """ + lastName: String + lastNameNEQ: String + lastNameIn: [String!] + lastNameNotIn: [String!] + lastNameGT: String + lastNameGTE: String + lastNameLT: String + lastNameLTE: String + lastNameContains: String + lastNameHasPrefix: String + lastNameHasSuffix: String + lastNameIsNil: Boolean + lastNameNotNil: Boolean + lastNameEqualFold: String + lastNameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + avatar_local_file field predicates + """ + avatarLocalFile: String + avatarLocalFileNEQ: String + avatarLocalFileIn: [String!] + avatarLocalFileNotIn: [String!] + avatarLocalFileGT: String + avatarLocalFileGTE: String + avatarLocalFileLT: String + avatarLocalFileLTE: String + avatarLocalFileContains: String + avatarLocalFileHasPrefix: String + avatarLocalFileHasSuffix: String + avatarLocalFileIsNil: Boolean + avatarLocalFileNotNil: Boolean + avatarLocalFileEqualFold: String + avatarLocalFileContainsFold: String + """ + avatar_updated_at field predicates + """ + avatarUpdatedAt: Time + avatarUpdatedAtNEQ: Time + avatarUpdatedAtIn: [Time!] + avatarUpdatedAtNotIn: [Time!] + avatarUpdatedAtGT: Time + avatarUpdatedAtGTE: Time + avatarUpdatedAtLT: Time + avatarUpdatedAtLTE: Time + avatarUpdatedAtIsNil: Boolean + avatarUpdatedAtNotNil: Boolean + """ + last_seen field predicates + """ + lastSeen: Time + lastSeenNEQ: Time + lastSeenIn: [Time!] + lastSeenNotIn: [Time!] + lastSeenGT: Time + lastSeenGTE: Time + lastSeenLT: Time + lastSeenLTE: Time + lastSeenIsNil: Boolean + lastSeenNotNil: Boolean + """ + sub field predicates + """ + sub: String + subNEQ: String + subIn: [String!] + subNotIn: [String!] + subGT: String + subGTE: String + subLT: String + subLTE: String + subContains: String + subHasPrefix: String + subHasSuffix: String + subIsNil: Boolean + subNotNil: Boolean + subEqualFold: String + subContainsFold: String + """ + auth_provider field predicates + """ + authProvider: UserAuthProvider + authProviderNEQ: UserAuthProvider + authProviderIn: [UserAuthProvider!] + authProviderNotIn: [UserAuthProvider!] + """ + role field predicates + """ + role: UserRole + roleNEQ: UserRole + roleIn: [UserRole!] + roleNotIn: [UserRole!] + roleIsNil: Boolean + roleNotNil: Boolean + """ + personal_access_tokens edge predicates + """ + hasPersonalAccessTokens: Boolean + hasPersonalAccessTokensWith: [PersonalAccessTokenWhereInput!] + """ + tfa_settings edge predicates + """ + hasTfaSettings: Boolean + hasTfaSettingsWith: [TFASettingWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [UserSettingWhereInput!] + """ + groups edge predicates + """ + hasGroups: Boolean + hasGroupsWith: [GroupWhereInput!] + """ + organizations edge predicates + """ + hasOrganizations: Boolean + hasOrganizationsWith: [OrganizationWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + group_memberships edge predicates + """ + hasGroupMemberships: Boolean + hasGroupMembershipsWith: [GroupMembershipWhereInput!] + """ + org_memberships edge predicates + """ + hasOrgMemberships: Boolean + hasOrgMembershipsWith: [OrgMembershipWhereInput!] +} +type Webhook implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean! + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String + owner: Organization + events: [Event!] + integrations: [Integration!] +} +""" +Return response for createBulkWebhook mutation +""" +type WebhookBulkCreatePayload { + """ + Created webhooks + """ + webhooks: [Webhook!] +} +""" +A connection to a list of items. +""" +type WebhookConnection { + """ + A list of edges. + """ + edges: [WebhookEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +Return response for createWebhook mutation +""" +type WebhookCreatePayload { + """ + Created webhook + """ + webhook: Webhook! +} +""" +Return response for deleteWebhook mutation +""" +type WebhookDeletePayload { + """ + Deleted webhook ID + """ + deletedID: ID! +} +""" +An edge in a connection. +""" +type WebhookEdge { + """ + The item at the end of the edge. + """ + node: Webhook + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type WebhookHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: WebhookHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean! + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String +} +""" +A connection to a list of items. +""" +type WebhookHistoryConnection { + """ + A list of edges. + """ + edges: [WebhookHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type WebhookHistoryEdge { + """ + The item at the end of the edge. + """ + node: WebhookHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +WebhookHistoryOpType is enum for the field operation +""" +enum WebhookHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for WebhookHistory connections +""" +input WebhookHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order WebhookHistories. + """ + field: WebhookHistoryOrderField! +} +""" +Properties by which WebhookHistory connections can be ordered. +""" +enum WebhookHistoryOrderField { + name + url +} +""" +WebhookHistoryWhereInput is used for filtering WebhookHistory objects. +Input was generated by ent. +""" +input WebhookHistoryWhereInput { + not: WebhookHistoryWhereInput + and: [WebhookHistoryWhereInput!] + or: [WebhookHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: WebhookHistoryOpType + operationNEQ: WebhookHistoryOpType + operationIn: [WebhookHistoryOpType!] + operationNotIn: [WebhookHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + destination_url field predicates + """ + destinationURL: String + destinationURLNEQ: String + destinationURLIn: [String!] + destinationURLNotIn: [String!] + destinationURLGT: String + destinationURLGTE: String + destinationURLLT: String + destinationURLLTE: String + destinationURLContains: String + destinationURLHasPrefix: String + destinationURLHasSuffix: String + destinationURLEqualFold: String + destinationURLContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + failures field predicates + """ + failures: Int + failuresNEQ: Int + failuresIn: [Int!] + failuresNotIn: [Int!] + failuresGT: Int + failuresGTE: Int + failuresLT: Int + failuresLTE: Int + failuresIsNil: Boolean + failuresNotNil: Boolean + """ + last_error field predicates + """ + lastError: String + lastErrorNEQ: String + lastErrorIn: [String!] + lastErrorNotIn: [String!] + lastErrorGT: String + lastErrorGTE: String + lastErrorLT: String + lastErrorLTE: String + lastErrorContains: String + lastErrorHasPrefix: String + lastErrorHasSuffix: String + lastErrorIsNil: Boolean + lastErrorNotNil: Boolean + lastErrorEqualFold: String + lastErrorContainsFold: String + """ + last_response field predicates + """ + lastResponse: String + lastResponseNEQ: String + lastResponseIn: [String!] + lastResponseNotIn: [String!] + lastResponseGT: String + lastResponseGTE: String + lastResponseLT: String + lastResponseLTE: String + lastResponseContains: String + lastResponseHasPrefix: String + lastResponseHasSuffix: String + lastResponseIsNil: Boolean + lastResponseNotNil: Boolean + lastResponseEqualFold: String + lastResponseContainsFold: String +} +""" +Ordering options for Webhook connections +""" +input WebhookOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Webhooks. + """ + field: WebhookOrderField! +} +""" +Properties by which Webhook connections can be ordered. +""" +enum WebhookOrderField { + name + url +} +""" +Return response for updateWebhook mutation +""" +type WebhookUpdatePayload { + """ + Updated webhook + """ + webhook: Webhook! +} +""" +WebhookWhereInput is used for filtering Webhook objects. +Input was generated by ent. +""" +input WebhookWhereInput { + not: WebhookWhereInput + and: [WebhookWhereInput!] + or: [WebhookWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + destination_url field predicates + """ + destinationURL: String + destinationURLNEQ: String + destinationURLIn: [String!] + destinationURLNotIn: [String!] + destinationURLGT: String + destinationURLGTE: String + destinationURLLT: String + destinationURLLTE: String + destinationURLContains: String + destinationURLHasPrefix: String + destinationURLHasSuffix: String + destinationURLEqualFold: String + destinationURLContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + failures field predicates + """ + failures: Int + failuresNEQ: Int + failuresIn: [Int!] + failuresNotIn: [Int!] + failuresGT: Int + failuresGTE: Int + failuresLT: Int + failuresLTE: Int + failuresIsNil: Boolean + failuresNotNil: Boolean + """ + last_error field predicates + """ + lastError: String + lastErrorNEQ: String + lastErrorIn: [String!] + lastErrorNotIn: [String!] + lastErrorGT: String + lastErrorGTE: String + lastErrorLT: String + lastErrorLTE: String + lastErrorContains: String + lastErrorHasPrefix: String + lastErrorHasSuffix: String + lastErrorIsNil: Boolean + lastErrorNotNil: Boolean + lastErrorEqualFold: String + lastErrorContainsFold: String + """ + last_response field predicates + """ + lastResponse: String + lastResponseNEQ: String + lastResponseIn: [String!] + lastResponseNotIn: [String!] + lastResponseGT: String + lastResponseGTE: String + lastResponseLT: String + lastResponseLTE: String + lastResponseContains: String + lastResponseHasPrefix: String + lastResponseHasSuffix: String + lastResponseIsNil: Boolean + lastResponseNotNil: Boolean + lastResponseEqualFold: String + lastResponseContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] +} diff --git a/schema/apitoken.graphql b/schema/apitoken.graphql new file mode 100644 index 0000000..79b3fde --- /dev/null +++ b/schema/apitoken.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up apiToken by ID + """ + apiToken( + """ + ID of the apiToken + """ + id: ID! + ): APIToken! +} + +extend type Mutation{ + """ + Create a new apiToken + """ + createAPIToken( + """ + values of the apiToken + """ + input: CreateAPITokenInput! + ): APITokenCreatePayload! + """ + Create multiple new apiTokens + """ + createBulkAPIToken( + """ + values of the apiToken + """ + input: [CreateAPITokenInput!] + ): APITokenBulkCreatePayload! + """ + Create multiple new apiTokens via file upload + """ + createBulkCSVAPIToken( + """ + csv file containing values of the apiToken + """ + input: Upload! + ): APITokenBulkCreatePayload! + """ + Update an existing apiToken + """ + updateAPIToken( + """ + ID of the apiToken + """ + id: ID! + """ + New values for the apiToken + """ + input: UpdateAPITokenInput! + ): APITokenUpdatePayload! + """ + Delete an existing apiToken + """ + deleteAPIToken( + """ + ID of the apiToken + """ + id: ID! + ): APITokenDeletePayload! +} + +""" +Return response for createAPIToken mutation +""" +type APITokenCreatePayload { + """ + Created apiToken + """ + apiToken: APIToken! +} + +""" +Return response for updateAPIToken mutation +""" +type APITokenUpdatePayload { + """ + Updated apiToken + """ + apiToken: APIToken! +} + +""" +Return response for deleteAPIToken mutation +""" +type APITokenDeletePayload { + """ + Deleted apiToken ID + """ + deletedID: ID! +} + +""" +Return response for createBulkAPIToken mutation +""" +type APITokenBulkCreatePayload { + """ + Created apiTokens + """ + apiTokens: [APIToken!] +} \ No newline at end of file diff --git a/schema/audit.graphql b/schema/audit.graphql new file mode 100644 index 0000000..abefd09 --- /dev/null +++ b/schema/audit.graphql @@ -0,0 +1,78 @@ +extend type Query { + auditLogs( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for AuditLogs returned from the connection. + """ + where: AuditLogWhereInput + ): AuditLogConnection! +} + +""" +A connection to a list of items. +""" +type AuditLogConnection { + """ + A list of edges. + """ + edges: [AuditLogEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type AuditLogEdge { + """ + The item at the end of the edge. + """ + node: AuditLog + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} + +type AuditLog implements Node { + table: String + time: Time + id: ID! + operation: String + changes: [String!] + updatedBy: ID +} + +extend input AuditLogWhereInput { + refID: ID + updatedBy: ID + operation: String + table: ID + before: Time + after: Time +} \ No newline at end of file diff --git a/schema/contact.graphql b/schema/contact.graphql new file mode 100644 index 0000000..7f88e76 --- /dev/null +++ b/schema/contact.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up contact by ID + """ + contact( + """ + ID of the contact + """ + id: ID! + ): Contact! +} + +extend type Mutation{ + """ + Create a new contact + """ + createContact( + """ + values of the contact + """ + input: CreateContactInput! + ): ContactCreatePayload! + """ + Create multiple new contacts + """ + createBulkContact( + """ + values of the contact + """ + input: [CreateContactInput!] + ): ContactBulkCreatePayload! + """ + Create multiple new contacts via file upload + """ + createBulkCSVContact( + """ + csv file containing values of the contact + """ + input: Upload! + ): ContactBulkCreatePayload! + """ + Update an existing contact + """ + updateContact( + """ + ID of the contact + """ + id: ID! + """ + New values for the contact + """ + input: UpdateContactInput! + ): ContactUpdatePayload! + """ + Delete an existing contact + """ + deleteContact( + """ + ID of the contact + """ + id: ID! + ): ContactDeletePayload! +} + +""" +Return response for createContact mutation +""" +type ContactCreatePayload { + """ + Created contact + """ + contact: Contact! +} + +""" +Return response for updateContact mutation +""" +type ContactUpdatePayload { + """ + Updated contact + """ + contact: Contact! +} + +""" +Return response for deleteContact mutation +""" +type ContactDeletePayload { + """ + Deleted contact ID + """ + deletedID: ID! +} + +""" +Return response for createBulkContact mutation +""" +type ContactBulkCreatePayload { + """ + Created contacts + """ + contacts: [Contact!] +} \ No newline at end of file diff --git a/schema/documentdata.graphql b/schema/documentdata.graphql new file mode 100644 index 0000000..ab78fac --- /dev/null +++ b/schema/documentdata.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up documentData by ID + """ + documentData( + """ + ID of the documentData + """ + id: ID! + ): DocumentData! +} + +extend type Mutation{ + """ + Create a new documentData + """ + createDocumentData( + """ + values of the documentData + """ + input: CreateDocumentDataInput! + ): DocumentDataCreatePayload! + """ + Create multiple new documentData + """ + createBulkDocumentData( + """ + values of the documentData + """ + input: [CreateDocumentDataInput!] + ): DocumentDataBulkCreatePayload! + """ + Create multiple new documentData via file upload + """ + createBulkCSVDocumentData( + """ + csv file containing values of the documentData + """ + input: Upload! + ): DocumentDataBulkCreatePayload! + """ + Update an existing documentData + """ + updateDocumentData( + """ + ID of the documentData + """ + id: ID! + """ + New values for the documentData + """ + input: UpdateDocumentDataInput! + ): DocumentDataUpdatePayload! + """ + Delete an existing documentData + """ + deleteDocumentData( + """ + ID of the documentData + """ + id: ID! + ): DocumentDataDeletePayload! +} + +""" +Return response for createDocumentData mutation +""" +type DocumentDataCreatePayload { + """ + Created documentData + """ + documentData: DocumentData! +} + +""" +Return response for updateDocumentData mutation +""" +type DocumentDataUpdatePayload { + """ + Updated documentData + """ + documentData: DocumentData! +} + +""" +Return response for deleteDocumentData mutation +""" +type DocumentDataDeletePayload { + """ + Deleted documentData ID + """ + deletedID: ID! +} + +""" +Return response for createBulkDocumentData mutation +""" +type DocumentDataBulkCreatePayload { + """ + Created documentData + """ + documentData: [DocumentData!] +} \ No newline at end of file diff --git a/schema/ent.graphql b/schema/ent.graphql new file mode 100644 index 0000000..79d51dd --- /dev/null +++ b/schema/ent.graphql @@ -0,0 +1,19427 @@ +directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION +type APIToken implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name associated with the token + """ + name: String! + token: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + owner: Organization +} +""" +A connection to a list of items. +""" +type APITokenConnection { + """ + A list of edges. + """ + edges: [APITokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type APITokenEdge { + """ + The item at the end of the edge. + """ + node: APIToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +APITokenWhereInput is used for filtering APIToken objects. +Input was generated by ent. +""" +input APITokenWhereInput { + not: APITokenWhereInput + and: [APITokenWhereInput!] + or: [APITokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + last_used_at field predicates + """ + lastUsedAt: Time + lastUsedAtNEQ: Time + lastUsedAtIn: [Time!] + lastUsedAtNotIn: [Time!] + lastUsedAtGT: Time + lastUsedAtGTE: Time + lastUsedAtLT: Time + lastUsedAtLTE: Time + lastUsedAtIsNil: Boolean + lastUsedAtNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] +} +type Contact implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactUserStatus! + owner: Organization + entities: [Entity!] +} +""" +A connection to a list of items. +""" +type ContactConnection { + """ + A list of edges. + """ + edges: [ContactEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type ContactEdge { + """ + The item at the end of the edge. + """ + node: Contact + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type ContactHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: ContactHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactHistoryUserStatus! +} +""" +A connection to a list of items. +""" +type ContactHistoryConnection { + """ + A list of edges. + """ + edges: [ContactHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type ContactHistoryEdge { + """ + The item at the end of the edge. + """ + node: ContactHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +ContactHistoryOpType is enum for the field operation +""" +enum ContactHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +ContactHistoryUserStatus is enum for the field status +""" +enum ContactHistoryUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +ContactHistoryWhereInput is used for filtering ContactHistory objects. +Input was generated by ent. +""" +input ContactHistoryWhereInput { + not: ContactHistoryWhereInput + and: [ContactHistoryWhereInput!] + or: [ContactHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: ContactHistoryOpType + operationNEQ: ContactHistoryOpType + operationIn: [ContactHistoryOpType!] + operationNotIn: [ContactHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + full_name field predicates + """ + fullName: String + fullNameNEQ: String + fullNameIn: [String!] + fullNameNotIn: [String!] + fullNameGT: String + fullNameGTE: String + fullNameLT: String + fullNameLTE: String + fullNameContains: String + fullNameHasPrefix: String + fullNameHasSuffix: String + fullNameEqualFold: String + fullNameContainsFold: String + """ + title field predicates + """ + title: String + titleNEQ: String + titleIn: [String!] + titleNotIn: [String!] + titleGT: String + titleGTE: String + titleLT: String + titleLTE: String + titleContains: String + titleHasPrefix: String + titleHasSuffix: String + titleIsNil: Boolean + titleNotNil: Boolean + titleEqualFold: String + titleContainsFold: String + """ + company field predicates + """ + company: String + companyNEQ: String + companyIn: [String!] + companyNotIn: [String!] + companyGT: String + companyGTE: String + companyLT: String + companyLTE: String + companyContains: String + companyHasPrefix: String + companyHasSuffix: String + companyIsNil: Boolean + companyNotNil: Boolean + companyEqualFold: String + companyContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailIsNil: Boolean + emailNotNil: Boolean + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + address field predicates + """ + address: String + addressNEQ: String + addressIn: [String!] + addressNotIn: [String!] + addressGT: String + addressGTE: String + addressLT: String + addressLTE: String + addressContains: String + addressHasPrefix: String + addressHasSuffix: String + addressIsNil: Boolean + addressNotNil: Boolean + addressEqualFold: String + addressContainsFold: String + """ + status field predicates + """ + status: ContactHistoryUserStatus + statusNEQ: ContactHistoryUserStatus + statusIn: [ContactHistoryUserStatus!] + statusNotIn: [ContactHistoryUserStatus!] +} +""" +ContactUserStatus is enum for the field status +""" +enum ContactUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +ContactWhereInput is used for filtering Contact objects. +Input was generated by ent. +""" +input ContactWhereInput { + not: ContactWhereInput + and: [ContactWhereInput!] + or: [ContactWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + full_name field predicates + """ + fullName: String + fullNameNEQ: String + fullNameIn: [String!] + fullNameNotIn: [String!] + fullNameGT: String + fullNameGTE: String + fullNameLT: String + fullNameLTE: String + fullNameContains: String + fullNameHasPrefix: String + fullNameHasSuffix: String + fullNameEqualFold: String + fullNameContainsFold: String + """ + title field predicates + """ + title: String + titleNEQ: String + titleIn: [String!] + titleNotIn: [String!] + titleGT: String + titleGTE: String + titleLT: String + titleLTE: String + titleContains: String + titleHasPrefix: String + titleHasSuffix: String + titleIsNil: Boolean + titleNotNil: Boolean + titleEqualFold: String + titleContainsFold: String + """ + company field predicates + """ + company: String + companyNEQ: String + companyIn: [String!] + companyNotIn: [String!] + companyGT: String + companyGTE: String + companyLT: String + companyLTE: String + companyContains: String + companyHasPrefix: String + companyHasSuffix: String + companyIsNil: Boolean + companyNotNil: Boolean + companyEqualFold: String + companyContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailIsNil: Boolean + emailNotNil: Boolean + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + address field predicates + """ + address: String + addressNEQ: String + addressIn: [String!] + addressNotIn: [String!] + addressGT: String + addressGTE: String + addressLT: String + addressLTE: String + addressContains: String + addressHasPrefix: String + addressHasSuffix: String + addressIsNil: Boolean + addressNotNil: Boolean + addressEqualFold: String + addressContainsFold: String + """ + status field predicates + """ + status: ContactUserStatus + statusNEQ: ContactUserStatus + statusIn: [ContactUserStatus!] + statusNotIn: [ContactUserStatus!] + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] +} +""" +CreateAPITokenInput is used for create APIToken object. +Input was generated by ent. +""" +input CreateAPITokenInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + ownerID: ID +} +""" +CreateContactInput is used for create Contact object. +Input was generated by ent. +""" +input CreateContactInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the full name of the contact + """ + fullName: String! + """ + the title of the contact + """ + title: String + """ + the company of the contact + """ + company: String + """ + the email of the contact + """ + email: String + """ + the phone number of the contact + """ + phoneNumber: String + """ + the address of the contact + """ + address: String + """ + status of the contact + """ + status: ContactUserStatus + ownerID: ID + entityIDs: [ID!] +} +""" +CreateDocumentDataInput is used for create DocumentData object. +Input was generated by ent. +""" +input CreateDocumentDataInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the json data of the document + """ + data: JSON! + ownerID: ID + templateID: ID! + entityIDs: [ID!] +} +""" +CreateEntitlementInput is used for create Entitlement object. +Input was generated by ent. +""" +input CreateEntitlementInput { + """ + tags associated with the object + """ + tags: [String!] + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean + ownerID: ID + planID: ID! + organizationID: ID! + eventIDs: [ID!] +} +""" +CreateEntitlementPlanFeatureInput is used for create EntitlementPlanFeature object. +Input was generated by ent. +""" +input CreateEntitlementPlanFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + ownerID: ID + planID: ID! + featureID: ID! + eventIDs: [ID!] +} +""" +CreateEntitlementPlanInput is used for create EntitlementPlan object. +Input was generated by ent. +""" +input CreateEntitlementPlanInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map + ownerID: ID + entitlementIDs: [ID!] + baseFeatureIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateEntityInput is used for create Entity object. +Input was generated by ent. +""" +input CreateEntityInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + status of the entity + """ + status: String + ownerID: ID + contactIDs: [ID!] + documentIDs: [ID!] + noteIDs: [ID!] + fileIDs: [ID!] + entityTypeID: ID +} +""" +CreateEntityTypeInput is used for create EntityType object. +Input was generated by ent. +""" +input CreateEntityTypeInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the entity + """ + name: String! + ownerID: ID + entityIDs: [ID!] +} +""" +CreateEventInput is used for create Event object. +Input was generated by ent. +""" +input CreateEventInput { + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map + userIDs: [ID!] + groupIDs: [ID!] + integrationIDs: [ID!] + organizationIDs: [ID!] + inviteIDs: [ID!] + featureIDs: [ID!] + entitlementplanIDs: [ID!] + personalAccessTokenIDs: [ID!] + oauth2tokenIDs: [ID!] + hushIDs: [ID!] + entitlementIDs: [ID!] + webhookIDs: [ID!] + subscriberIDs: [ID!] +} +""" +CreateFeatureInput is used for create Feature object. +Input was generated by ent. +""" +input CreateFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map + ownerID: ID + planIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateFileInput is used for create File object. +Input was generated by ent. +""" +input CreateFileInput { + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String + userID: ID + organizationIDs: [ID!] + entityIDs: [ID!] + groupIDs: [ID!] +} +""" +CreateGroupInput is used for create Group object. +Input was generated by ent. +""" +input CreateGroupInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String + ownerID: ID + settingID: ID! + userIDs: [ID!] + eventIDs: [ID!] + integrationIDs: [ID!] + fileIDs: [ID!] +} +""" +CreateGroupMembershipInput is used for create GroupMembership object. +Input was generated by ent. +""" +input CreateGroupMembershipInput { + role: GroupMembershipRole + groupID: ID! + userID: ID! + eventIDs: [ID!] +} +""" +CreateGroupSettingInput is used for create GroupSetting object. +Input was generated by ent. +""" +input CreateGroupSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + groupID: ID +} +""" +CreateHushInput is used for create Hush object. +Input was generated by ent. +""" +input CreateHushInput { + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String + """ + the secret value + """ + secretValue: String + integrationIDs: [ID!] + organizationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateIntegrationInput is used for create Integration object. +Input was generated by ent. +""" +input CreateIntegrationInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String + ownerID: ID + secretIDs: [ID!] + oauth2tokenIDs: [ID!] + eventIDs: [ID!] + webhookIDs: [ID!] +} +""" +CreateInviteInput is used for create Invite object. +Input was generated by ent. +""" +input CreateInviteInput { + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + """ + the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + """ + recipient: String! + """ + the status of the invitation + """ + status: InviteInviteStatus + role: InviteRole + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int + """ + the user who initiated the invitation + """ + requestorID: String + ownerID: ID + eventIDs: [ID!] +} +""" +CreateNoteInput is used for create Note object. +Input was generated by ent. +""" +input CreateNoteInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the text of the note + """ + text: String! + ownerID: ID + entityID: ID +} +""" +CreateOauthProviderInput is used for create OauthProvider object. +Input was generated by ent. +""" +input CreateOauthProviderInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! + ownerID: ID +} +""" +CreateOhAuthTooTokenInput is used for create OhAuthTooToken object. +Input was generated by ent. +""" +input CreateOhAuthTooTokenInput { + """ + tags associated with the object + """ + tags: [String!] + clientID: String! + scopes: [String!] + nonce: String! + claimsUserID: String! + claimsUsername: String! + claimsEmail: String! + claimsEmailVerified: Boolean! + claimsGroups: [String!] + claimsPreferredUsername: String! + connectorID: String! + connectorData: [String!] + lastUsed: Time + integrationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateOrgMembershipInput is used for create OrgMembership object. +Input was generated by ent. +""" +input CreateOrgMembershipInput { + role: OrgMembershipRole + organizationID: ID! + userID: ID! + eventIDs: [ID!] +} +""" +CreateOrganizationInput is used for create Organization object. +Input was generated by ent. +""" +input CreateOrganizationInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean + parentID: ID + groupIDs: [ID!] + templateIDs: [ID!] + integrationIDs: [ID!] + settingID: ID + documentdatumIDs: [ID!] + entitlementIDs: [ID!] + organizationEntitlementIDs: [ID!] + personalAccessTokenIDs: [ID!] + apiTokenIDs: [ID!] + oauthproviderIDs: [ID!] + userIDs: [ID!] + inviteIDs: [ID!] + subscriberIDs: [ID!] + webhookIDs: [ID!] + eventIDs: [ID!] + secretIDs: [ID!] + featureIDs: [ID!] + fileIDs: [ID!] + entitlementplanIDs: [ID!] + entityIDs: [ID!] + entitytypeIDs: [ID!] + contactIDs: [ID!] + noteIDs: [ID!] +} +""" +CreateOrganizationSettingInput is used for create OrganizationSetting object. +Input was generated by ent. +""" +input CreateOrganizationSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + organizationID: ID +} +""" +CreatePersonalAccessTokenInput is used for create PersonalAccessToken object. +Input was generated by ent. +""" +input CreatePersonalAccessTokenInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + ownerID: ID! + organizationIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateSubscriberInput is used for create Subscriber object. +Input was generated by ent. +""" +input CreateSubscriberInput { + """ + tags associated with the object + """ + tags: [String!] + """ + email address of the subscriber + """ + email: String! + """ + phone number of the subscriber + """ + phoneNumber: String + ownerID: ID + eventIDs: [ID!] +} +""" +CreateTFASettingInput is used for create TFASetting object. +Input was generated by ent. +""" +input CreateTFASettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + ownerID: ID +} +""" +CreateTemplateInput is used for create Template object. +Input was generated by ent. +""" +input CreateTemplateInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON + ownerID: ID + documentIDs: [ID!] +} +""" +CreateUserInput is used for create User object. +Input was generated by ent. +""" +input CreateUserInput { + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + user password hash + """ + password: String + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider + """ + the user's role + """ + role: UserRole + personalAccessTokenIDs: [ID!] + tfaSettingIDs: [ID!] + settingID: ID! + emailVerificationTokenIDs: [ID!] + passwordResetTokenIDs: [ID!] + groupIDs: [ID!] + organizationIDs: [ID!] + webauthnIDs: [ID!] + fileIDs: [ID!] + eventIDs: [ID!] +} +""" +CreateUserSettingInput is used for create UserSetting object. +Input was generated by ent. +""" +input CreateUserSettingInput { + """ + tags associated with the object + """ + tags: [String!] + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingUserStatus + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + userID: ID + defaultOrgID: ID +} +""" +CreateWebhookInput is used for create Webhook object. +Input was generated by ent. +""" +input CreateWebhookInput { + """ + tags associated with the object + """ + tags: [String!] + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String + ownerID: ID + eventIDs: [ID!] + integrationIDs: [ID!] +} +""" +Define a Relay Cursor type: +https://relay.dev/graphql/connections.htm#sec-Cursor +""" +scalar Cursor +type DocumentData implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the template id of the document + """ + templateID: ID! + """ + the json data of the document + """ + data: JSON! + owner: Organization + template: Template! + entity: [Entity!] +} +""" +A connection to a list of items. +""" +type DocumentDataConnection { + """ + A list of edges. + """ + edges: [DocumentDataEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type DocumentDataEdge { + """ + The item at the end of the edge. + """ + node: DocumentData + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type DocumentDataHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: DocumentDataHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the template id of the document + """ + templateID: String! + """ + the json data of the document + """ + data: JSON! +} +""" +A connection to a list of items. +""" +type DocumentDataHistoryConnection { + """ + A list of edges. + """ + edges: [DocumentDataHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type DocumentDataHistoryEdge { + """ + The item at the end of the edge. + """ + node: DocumentDataHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +DocumentDataHistoryOpType is enum for the field operation +""" +enum DocumentDataHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +DocumentDataHistoryWhereInput is used for filtering DocumentDataHistory objects. +Input was generated by ent. +""" +input DocumentDataHistoryWhereInput { + not: DocumentDataHistoryWhereInput + and: [DocumentDataHistoryWhereInput!] + or: [DocumentDataHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: DocumentDataHistoryOpType + operationNEQ: DocumentDataHistoryOpType + operationIn: [DocumentDataHistoryOpType!] + operationNotIn: [DocumentDataHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + template_id field predicates + """ + templateID: String + templateIDNEQ: String + templateIDIn: [String!] + templateIDNotIn: [String!] + templateIDGT: String + templateIDGTE: String + templateIDLT: String + templateIDLTE: String + templateIDContains: String + templateIDHasPrefix: String + templateIDHasSuffix: String + templateIDEqualFold: String + templateIDContainsFold: String +} +""" +DocumentDataWhereInput is used for filtering DocumentData objects. +Input was generated by ent. +""" +input DocumentDataWhereInput { + not: DocumentDataWhereInput + and: [DocumentDataWhereInput!] + or: [DocumentDataWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + template_id field predicates + """ + templateID: ID + templateIDNEQ: ID + templateIDIn: [ID!] + templateIDNotIn: [ID!] + templateIDGT: ID + templateIDGTE: ID + templateIDLT: ID + templateIDLTE: ID + templateIDContains: ID + templateIDHasPrefix: ID + templateIDHasSuffix: ID + templateIDEqualFold: ID + templateIDContainsFold: ID + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + template edge predicates + """ + hasTemplate: Boolean + hasTemplateWith: [TemplateWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] +} +type Entitlement implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the plan to which the entitlement belongs + """ + planID: ID! + """ + the organization to which the entitlement belongs + """ + organizationID: ID! + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + whether or not the customers entitlement expires - expires_at will show the time + """ + expires: Boolean! + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean! + owner: Organization + plan: EntitlementPlan! + organization: Organization! + events: [Event!] +} +""" +A connection to a list of items. +""" +type EntitlementConnection { + """ + A list of edges. + """ + edges: [EntitlementEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementEdge { + """ + The item at the end of the edge. + """ + node: Entitlement + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the plan to which the entitlement belongs + """ + planID: String! + """ + the organization to which the entitlement belongs + """ + organizationID: String! + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + """ + whether or not the customers entitlement expires - expires_at will show the time + """ + expires: Boolean! + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean! +} +""" +A connection to a list of items. +""" +type EntitlementHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementHistoryOpType is enum for the field operation +""" +enum EntitlementHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementHistoryWhereInput is used for filtering EntitlementHistory objects. +Input was generated by ent. +""" +input EntitlementHistoryWhereInput { + not: EntitlementHistoryWhereInput + and: [EntitlementHistoryWhereInput!] + or: [EntitlementHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementHistoryOpType + operationNEQ: EntitlementHistoryOpType + operationIn: [EntitlementHistoryOpType!] + operationNotIn: [EntitlementHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + plan_id field predicates + """ + planID: String + planIDNEQ: String + planIDIn: [String!] + planIDNotIn: [String!] + planIDGT: String + planIDGTE: String + planIDLT: String + planIDLTE: String + planIDContains: String + planIDHasPrefix: String + planIDHasSuffix: String + planIDEqualFold: String + planIDContainsFold: String + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDEqualFold: String + organizationIDContainsFold: String + """ + external_customer_id field predicates + """ + externalCustomerID: String + externalCustomerIDNEQ: String + externalCustomerIDIn: [String!] + externalCustomerIDNotIn: [String!] + externalCustomerIDGT: String + externalCustomerIDGTE: String + externalCustomerIDLT: String + externalCustomerIDLTE: String + externalCustomerIDContains: String + externalCustomerIDHasPrefix: String + externalCustomerIDHasSuffix: String + externalCustomerIDIsNil: Boolean + externalCustomerIDNotNil: Boolean + externalCustomerIDEqualFold: String + externalCustomerIDContainsFold: String + """ + external_subscription_id field predicates + """ + externalSubscriptionID: String + externalSubscriptionIDNEQ: String + externalSubscriptionIDIn: [String!] + externalSubscriptionIDNotIn: [String!] + externalSubscriptionIDGT: String + externalSubscriptionIDGTE: String + externalSubscriptionIDLT: String + externalSubscriptionIDLTE: String + externalSubscriptionIDContains: String + externalSubscriptionIDHasPrefix: String + externalSubscriptionIDHasSuffix: String + externalSubscriptionIDIsNil: Boolean + externalSubscriptionIDNotNil: Boolean + externalSubscriptionIDEqualFold: String + externalSubscriptionIDContainsFold: String + """ + expires field predicates + """ + expires: Boolean + expiresNEQ: Boolean + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + cancelled field predicates + """ + cancelled: Boolean + cancelledNEQ: Boolean +} +type EntitlementPlan implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map + owner: Organization + entitlements: [Entitlement!] + baseFeatures: [Feature!] + events: [Event!] + features: [EntitlementPlanFeature!] +} +""" +A connection to a list of items. +""" +type EntitlementPlanConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlan + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementPlanFeature implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + planID: ID! + featureID: ID! + owner: Organization + plan: EntitlementPlan! + feature: Feature! + events: [Event!] +} +""" +A connection to a list of items. +""" +type EntitlementPlanFeatureConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanFeatureEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanFeatureEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanFeature + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntitlementPlanFeatureHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementPlanFeatureHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + planID: String! + featureID: String! +} +""" +A connection to a list of items. +""" +type EntitlementPlanFeatureHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanFeatureHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanFeatureHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanFeatureHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementPlanFeatureHistoryOpType is enum for the field operation +""" +enum EntitlementPlanFeatureHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementPlanFeatureHistoryWhereInput is used for filtering EntitlementPlanFeatureHistory objects. +Input was generated by ent. +""" +input EntitlementPlanFeatureHistoryWhereInput { + not: EntitlementPlanFeatureHistoryWhereInput + and: [EntitlementPlanFeatureHistoryWhereInput!] + or: [EntitlementPlanFeatureHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementPlanFeatureHistoryOpType + operationNEQ: EntitlementPlanFeatureHistoryOpType + operationIn: [EntitlementPlanFeatureHistoryOpType!] + operationNotIn: [EntitlementPlanFeatureHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + plan_id field predicates + """ + planID: String + planIDNEQ: String + planIDIn: [String!] + planIDNotIn: [String!] + planIDGT: String + planIDGTE: String + planIDLT: String + planIDLTE: String + planIDContains: String + planIDHasPrefix: String + planIDHasSuffix: String + planIDEqualFold: String + planIDContainsFold: String + """ + feature_id field predicates + """ + featureID: String + featureIDNEQ: String + featureIDIn: [String!] + featureIDNotIn: [String!] + featureIDGT: String + featureIDGTE: String + featureIDLT: String + featureIDLTE: String + featureIDContains: String + featureIDHasPrefix: String + featureIDHasSuffix: String + featureIDEqualFold: String + featureIDContainsFold: String +} +""" +EntitlementPlanFeatureWhereInput is used for filtering EntitlementPlanFeature objects. +Input was generated by ent. +""" +input EntitlementPlanFeatureWhereInput { + not: EntitlementPlanFeatureWhereInput + and: [EntitlementPlanFeatureWhereInput!] + or: [EntitlementPlanFeatureWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String +} +type EntitlementPlanHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntitlementPlanHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the displayed 'friendly' name of the plan + """ + displayName: String + """ + the unique name of the plan + """ + name: String! + """ + a description of the plan + """ + description: String + """ + the version of the plan + """ + version: String! + """ + metadata for the plan + """ + metadata: Map +} +""" +A connection to a list of items. +""" +type EntitlementPlanHistoryConnection { + """ + A list of edges. + """ + edges: [EntitlementPlanHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntitlementPlanHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntitlementPlanHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntitlementPlanHistoryOpType is enum for the field operation +""" +enum EntitlementPlanHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EntitlementPlanHistoryWhereInput is used for filtering EntitlementPlanHistory objects. +Input was generated by ent. +""" +input EntitlementPlanHistoryWhereInput { + not: EntitlementPlanHistoryWhereInput + and: [EntitlementPlanHistoryWhereInput!] + or: [EntitlementPlanHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntitlementPlanHistoryOpType + operationNEQ: EntitlementPlanHistoryOpType + operationIn: [EntitlementPlanHistoryOpType!] + operationNotIn: [EntitlementPlanHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + version field predicates + """ + version: String + versionNEQ: String + versionIn: [String!] + versionNotIn: [String!] + versionGT: String + versionGTE: String + versionLT: String + versionLTE: String + versionContains: String + versionHasPrefix: String + versionHasSuffix: String + versionEqualFold: String + versionContainsFold: String +} +""" +EntitlementPlanWhereInput is used for filtering EntitlementPlan objects. +Input was generated by ent. +""" +input EntitlementPlanWhereInput { + not: EntitlementPlanWhereInput + and: [EntitlementPlanWhereInput!] + or: [EntitlementPlanWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + version field predicates + """ + version: String + versionNEQ: String + versionIn: [String!] + versionNotIn: [String!] + versionGT: String + versionGTE: String + versionLT: String + versionLTE: String + versionContains: String + versionHasPrefix: String + versionHasSuffix: String + versionEqualFold: String + versionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entitlements edge predicates + """ + hasEntitlements: Boolean + hasEntitlementsWith: [EntitlementWhereInput!] + """ + base_features edge predicates + """ + hasBaseFeatures: Boolean + hasBaseFeaturesWith: [FeatureWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [EntitlementPlanFeatureWhereInput!] +} +""" +EntitlementWhereInput is used for filtering Entitlement objects. +Input was generated by ent. +""" +input EntitlementWhereInput { + not: EntitlementWhereInput + and: [EntitlementWhereInput!] + or: [EntitlementWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + plan_id field predicates + """ + planID: ID + planIDNEQ: ID + planIDIn: [ID!] + planIDNotIn: [ID!] + planIDGT: ID + planIDGTE: ID + planIDLT: ID + planIDLTE: ID + planIDContains: ID + planIDHasPrefix: ID + planIDHasSuffix: ID + planIDEqualFold: ID + planIDContainsFold: ID + """ + organization_id field predicates + """ + organizationID: ID + organizationIDNEQ: ID + organizationIDIn: [ID!] + organizationIDNotIn: [ID!] + organizationIDGT: ID + organizationIDGTE: ID + organizationIDLT: ID + organizationIDLTE: ID + organizationIDContains: ID + organizationIDHasPrefix: ID + organizationIDHasSuffix: ID + organizationIDEqualFold: ID + organizationIDContainsFold: ID + """ + external_customer_id field predicates + """ + externalCustomerID: String + externalCustomerIDNEQ: String + externalCustomerIDIn: [String!] + externalCustomerIDNotIn: [String!] + externalCustomerIDGT: String + externalCustomerIDGTE: String + externalCustomerIDLT: String + externalCustomerIDLTE: String + externalCustomerIDContains: String + externalCustomerIDHasPrefix: String + externalCustomerIDHasSuffix: String + externalCustomerIDIsNil: Boolean + externalCustomerIDNotNil: Boolean + externalCustomerIDEqualFold: String + externalCustomerIDContainsFold: String + """ + external_subscription_id field predicates + """ + externalSubscriptionID: String + externalSubscriptionIDNEQ: String + externalSubscriptionIDIn: [String!] + externalSubscriptionIDNotIn: [String!] + externalSubscriptionIDGT: String + externalSubscriptionIDGTE: String + externalSubscriptionIDLT: String + externalSubscriptionIDLTE: String + externalSubscriptionIDContains: String + externalSubscriptionIDHasPrefix: String + externalSubscriptionIDHasSuffix: String + externalSubscriptionIDIsNil: Boolean + externalSubscriptionIDNotNil: Boolean + externalSubscriptionIDEqualFold: String + externalSubscriptionIDContainsFold: String + """ + expires field predicates + """ + expires: Boolean + expiresNEQ: Boolean + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + cancelled field predicates + """ + cancelled: Boolean + cancelledNEQ: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + plan edge predicates + """ + hasPlan: Boolean + hasPlanWith: [EntitlementPlanWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Entity implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + The type of the entity + """ + entityTypeID: ID + """ + status of the entity + """ + status: String + owner: Organization + contacts: [Contact!] + documents: [DocumentData!] + notes: [Note!] + files: [File!] + entityType: EntityType +} +""" +A connection to a list of items. +""" +type EntityConnection { + """ + A list of edges. + """ + edges: [EntityEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityEdge { + """ + The item at the end of the edge. + """ + node: Entity + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntityHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntityHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the entity + """ + name: String + """ + The entity's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the entity + """ + description: String + """ + domains associated with the entity + """ + domains: [String!] + """ + The type of the entity + """ + entityTypeID: String + """ + status of the entity + """ + status: String +} +""" +A connection to a list of items. +""" +type EntityHistoryConnection { + """ + A list of edges. + """ + edges: [EntityHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntityHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntityHistoryOpType is enum for the field operation +""" +enum EntityHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for EntityHistory connections +""" +input EntityHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityHistories. + """ + field: EntityHistoryOrderField! +} +""" +Properties by which EntityHistory connections can be ordered. +""" +enum EntityHistoryOrderField { + name + display_name +} +""" +EntityHistoryWhereInput is used for filtering EntityHistory objects. +Input was generated by ent. +""" +input EntityHistoryWhereInput { + not: EntityHistoryWhereInput + and: [EntityHistoryWhereInput!] + or: [EntityHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntityHistoryOpType + operationNEQ: EntityHistoryOpType + operationIn: [EntityHistoryOpType!] + operationNotIn: [EntityHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameIsNil: Boolean + nameNotNil: Boolean + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + entity_type_id field predicates + """ + entityTypeID: String + entityTypeIDNEQ: String + entityTypeIDIn: [String!] + entityTypeIDNotIn: [String!] + entityTypeIDGT: String + entityTypeIDGTE: String + entityTypeIDLT: String + entityTypeIDLTE: String + entityTypeIDContains: String + entityTypeIDHasPrefix: String + entityTypeIDHasSuffix: String + entityTypeIDIsNil: Boolean + entityTypeIDNotNil: Boolean + entityTypeIDEqualFold: String + entityTypeIDContainsFold: String + """ + status field predicates + """ + status: String + statusNEQ: String + statusIn: [String!] + statusNotIn: [String!] + statusGT: String + statusGTE: String + statusLT: String + statusLTE: String + statusContains: String + statusHasPrefix: String + statusHasSuffix: String + statusIsNil: Boolean + statusNotNil: Boolean + statusEqualFold: String + statusContainsFold: String +} +""" +Ordering options for Entity connections +""" +input EntityOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Entities. + """ + field: EntityOrderField! +} +""" +Properties by which Entity connections can be ordered. +""" +enum EntityOrderField { + name + display_name +} +type EntityType implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the entity + """ + name: String! + owner: Organization + entities: [Entity!] +} +""" +A connection to a list of items. +""" +type EntityTypeConnection { + """ + A list of edges. + """ + edges: [EntityTypeEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityTypeEdge { + """ + The item at the end of the edge. + """ + node: EntityType + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EntityTypeHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EntityTypeHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the entity + """ + name: String! +} +""" +A connection to a list of items. +""" +type EntityTypeHistoryConnection { + """ + A list of edges. + """ + edges: [EntityTypeHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EntityTypeHistoryEdge { + """ + The item at the end of the edge. + """ + node: EntityTypeHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EntityTypeHistoryOpType is enum for the field operation +""" +enum EntityTypeHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for EntityTypeHistory connections +""" +input EntityTypeHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityTypeHistories. + """ + field: EntityTypeHistoryOrderField! +} +""" +Properties by which EntityTypeHistory connections can be ordered. +""" +enum EntityTypeHistoryOrderField { + name +} +""" +EntityTypeHistoryWhereInput is used for filtering EntityTypeHistory objects. +Input was generated by ent. +""" +input EntityTypeHistoryWhereInput { + not: EntityTypeHistoryWhereInput + and: [EntityTypeHistoryWhereInput!] + or: [EntityTypeHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EntityTypeHistoryOpType + operationNEQ: EntityTypeHistoryOpType + operationIn: [EntityTypeHistoryOpType!] + operationNotIn: [EntityTypeHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String +} +""" +Ordering options for EntityType connections +""" +input EntityTypeOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order EntityTypes. + """ + field: EntityTypeOrderField! +} +""" +Properties by which EntityType connections can be ordered. +""" +enum EntityTypeOrderField { + name +} +""" +EntityTypeWhereInput is used for filtering EntityType objects. +Input was generated by ent. +""" +input EntityTypeWhereInput { + not: EntityTypeWhereInput + and: [EntityTypeWhereInput!] + or: [EntityTypeWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] +} +""" +EntityWhereInput is used for filtering Entity objects. +Input was generated by ent. +""" +input EntityWhereInput { + not: EntityWhereInput + and: [EntityWhereInput!] + or: [EntityWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameIsNil: Boolean + nameNotNil: Boolean + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + entity_type_id field predicates + """ + entityTypeID: ID + entityTypeIDNEQ: ID + entityTypeIDIn: [ID!] + entityTypeIDNotIn: [ID!] + entityTypeIDGT: ID + entityTypeIDGTE: ID + entityTypeIDLT: ID + entityTypeIDLTE: ID + entityTypeIDContains: ID + entityTypeIDHasPrefix: ID + entityTypeIDHasSuffix: ID + entityTypeIDIsNil: Boolean + entityTypeIDNotNil: Boolean + entityTypeIDEqualFold: ID + entityTypeIDContainsFold: ID + """ + status field predicates + """ + status: String + statusNEQ: String + statusIn: [String!] + statusNotIn: [String!] + statusGT: String + statusGTE: String + statusLT: String + statusLTE: String + statusContains: String + statusHasPrefix: String + statusHasSuffix: String + statusIsNil: Boolean + statusNotNil: Boolean + statusEqualFold: String + statusContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + contacts edge predicates + """ + hasContacts: Boolean + hasContactsWith: [ContactWhereInput!] + """ + documents edge predicates + """ + hasDocuments: Boolean + hasDocumentsWith: [DocumentDataWhereInput!] + """ + notes edge predicates + """ + hasNotes: Boolean + hasNotesWith: [NoteWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + entity_type edge predicates + """ + hasEntityType: Boolean + hasEntityTypeWith: [EntityTypeWhereInput!] +} +type Event implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map + user: [User!] + group: [Group!] + integration: [Integration!] + organization: [Organization!] + invite: [Invite!] + feature: [Feature!] + entitlementplan: [EntitlementPlan!] + entitlementplanfeature: [EntitlementPlanFeature!] + personalAccessToken: [PersonalAccessToken!] + oauth2token: [OhAuthTooToken!] + hush: [Hush!] + orgmembership: [OrgMembership!] + groupmembership: [GroupMembership!] + entitlement: [Entitlement!] + webhook: [Webhook!] + subscriber: [Subscriber!] +} +""" +A connection to a list of items. +""" +type EventConnection { + """ + A list of edges. + """ + edges: [EventEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EventEdge { + """ + The item at the end of the edge. + """ + node: Event + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type EventHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: EventHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + eventID: String + correlationID: String + eventType: String! + metadata: Map +} +""" +A connection to a list of items. +""" +type EventHistoryConnection { + """ + A list of edges. + """ + edges: [EventHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type EventHistoryEdge { + """ + The item at the end of the edge. + """ + node: EventHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +EventHistoryOpType is enum for the field operation +""" +enum EventHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +EventHistoryWhereInput is used for filtering EventHistory objects. +Input was generated by ent. +""" +input EventHistoryWhereInput { + not: EventHistoryWhereInput + and: [EventHistoryWhereInput!] + or: [EventHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: EventHistoryOpType + operationNEQ: EventHistoryOpType + operationIn: [EventHistoryOpType!] + operationNotIn: [EventHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + event_id field predicates + """ + eventID: String + eventIDNEQ: String + eventIDIn: [String!] + eventIDNotIn: [String!] + eventIDGT: String + eventIDGTE: String + eventIDLT: String + eventIDLTE: String + eventIDContains: String + eventIDHasPrefix: String + eventIDHasSuffix: String + eventIDIsNil: Boolean + eventIDNotNil: Boolean + eventIDEqualFold: String + eventIDContainsFold: String + """ + correlation_id field predicates + """ + correlationID: String + correlationIDNEQ: String + correlationIDIn: [String!] + correlationIDNotIn: [String!] + correlationIDGT: String + correlationIDGTE: String + correlationIDLT: String + correlationIDLTE: String + correlationIDContains: String + correlationIDHasPrefix: String + correlationIDHasSuffix: String + correlationIDIsNil: Boolean + correlationIDNotNil: Boolean + correlationIDEqualFold: String + correlationIDContainsFold: String + """ + event_type field predicates + """ + eventType: String + eventTypeNEQ: String + eventTypeIn: [String!] + eventTypeNotIn: [String!] + eventTypeGT: String + eventTypeGTE: String + eventTypeLT: String + eventTypeLTE: String + eventTypeContains: String + eventTypeHasPrefix: String + eventTypeHasSuffix: String + eventTypeEqualFold: String + eventTypeContainsFold: String +} +""" +EventWhereInput is used for filtering Event objects. +Input was generated by ent. +""" +input EventWhereInput { + not: EventWhereInput + and: [EventWhereInput!] + or: [EventWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + event_id field predicates + """ + eventID: String + eventIDNEQ: String + eventIDIn: [String!] + eventIDNotIn: [String!] + eventIDGT: String + eventIDGTE: String + eventIDLT: String + eventIDLTE: String + eventIDContains: String + eventIDHasPrefix: String + eventIDHasSuffix: String + eventIDIsNil: Boolean + eventIDNotNil: Boolean + eventIDEqualFold: String + eventIDContainsFold: String + """ + correlation_id field predicates + """ + correlationID: String + correlationIDNEQ: String + correlationIDIn: [String!] + correlationIDNotIn: [String!] + correlationIDGT: String + correlationIDGTE: String + correlationIDLT: String + correlationIDLTE: String + correlationIDContains: String + correlationIDHasPrefix: String + correlationIDHasSuffix: String + correlationIDIsNil: Boolean + correlationIDNotNil: Boolean + correlationIDEqualFold: String + correlationIDContainsFold: String + """ + event_type field predicates + """ + eventType: String + eventTypeNEQ: String + eventTypeIn: [String!] + eventTypeNotIn: [String!] + eventTypeGT: String + eventTypeGTE: String + eventTypeLT: String + eventTypeLTE: String + eventTypeContains: String + eventTypeHasPrefix: String + eventTypeHasSuffix: String + eventTypeEqualFold: String + eventTypeContainsFold: String + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] + """ + integration edge predicates + """ + hasIntegration: Boolean + hasIntegrationWith: [IntegrationWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + invite edge predicates + """ + hasInvite: Boolean + hasInviteWith: [InviteWhereInput!] + """ + feature edge predicates + """ + hasFeature: Boolean + hasFeatureWith: [FeatureWhereInput!] + """ + entitlementplan edge predicates + """ + hasEntitlementplan: Boolean + hasEntitlementplanWith: [EntitlementPlanWhereInput!] + """ + entitlementplanfeature edge predicates + """ + hasEntitlementplanfeature: Boolean + hasEntitlementplanfeatureWith: [EntitlementPlanFeatureWhereInput!] + """ + personal_access_token edge predicates + """ + hasPersonalAccessToken: Boolean + hasPersonalAccessTokenWith: [PersonalAccessTokenWhereInput!] + """ + oauth2token edge predicates + """ + hasOauth2token: Boolean + hasOauth2tokenWith: [OhAuthTooTokenWhereInput!] + """ + hush edge predicates + """ + hasHush: Boolean + hasHushWith: [HushWhereInput!] + """ + orgmembership edge predicates + """ + hasOrgmembership: Boolean + hasOrgmembershipWith: [OrgMembershipWhereInput!] + """ + groupmembership edge predicates + """ + hasGroupmembership: Boolean + hasGroupmembershipWith: [GroupMembershipWhereInput!] + """ + entitlement edge predicates + """ + hasEntitlement: Boolean + hasEntitlementWith: [EntitlementWhereInput!] + """ + webhook edge predicates + """ + hasWebhook: Boolean + hasWebhookWith: [WebhookWhereInput!] + """ + subscriber edge predicates + """ + hasSubscriber: Boolean + hasSubscriberWith: [SubscriberWhereInput!] +} +type Feature implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean! + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map + owner: Organization + plans: [EntitlementPlan!] + events: [Event!] + features: [EntitlementPlanFeature!] +} +""" +A connection to a list of items. +""" +type FeatureConnection { + """ + A list of edges. + """ + edges: [FeatureEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FeatureEdge { + """ + The item at the end of the edge. + """ + node: Feature + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type FeatureHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: FeatureHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the unique name of the feature + """ + name: String! + """ + the displayed 'friendly' name of the feature + """ + displayName: String + """ + enabled features are available for use + """ + enabled: Boolean! + """ + a description of the feature + """ + description: String + """ + metadata for the feature + """ + metadata: Map +} +""" +A connection to a list of items. +""" +type FeatureHistoryConnection { + """ + A list of edges. + """ + edges: [FeatureHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FeatureHistoryEdge { + """ + The item at the end of the edge. + """ + node: FeatureHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +FeatureHistoryOpType is enum for the field operation +""" +enum FeatureHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +FeatureHistoryWhereInput is used for filtering FeatureHistory objects. +Input was generated by ent. +""" +input FeatureHistoryWhereInput { + not: FeatureHistoryWhereInput + and: [FeatureHistoryWhereInput!] + or: [FeatureHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: FeatureHistoryOpType + operationNEQ: FeatureHistoryOpType + operationIn: [FeatureHistoryOpType!] + operationNotIn: [FeatureHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String +} +""" +FeatureWhereInput is used for filtering Feature objects. +Input was generated by ent. +""" +input FeatureWhereInput { + not: FeatureWhereInput + and: [FeatureWhereInput!] + or: [FeatureWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameIsNil: Boolean + displayNameNotNil: Boolean + displayNameEqualFold: String + displayNameContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + plans edge predicates + """ + hasPlans: Boolean + hasPlansWith: [EntitlementPlanWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [EntitlementPlanFeatureWhereInput!] +} +type File implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String + user: User + organization: [Organization!] + entity: [Entity!] + group: [Group!] +} +""" +A connection to a list of items. +""" +type FileConnection { + """ + A list of edges. + """ + edges: [FileEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FileEdge { + """ + The item at the end of the edge. + """ + node: File + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type FileHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: FileHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + fileName: String! + fileExtension: String! + fileSize: Int + contentType: String! + storeKey: String! + category: String + annotation: String +} +""" +A connection to a list of items. +""" +type FileHistoryConnection { + """ + A list of edges. + """ + edges: [FileHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type FileHistoryEdge { + """ + The item at the end of the edge. + """ + node: FileHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +FileHistoryOpType is enum for the field operation +""" +enum FileHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +FileHistoryWhereInput is used for filtering FileHistory objects. +Input was generated by ent. +""" +input FileHistoryWhereInput { + not: FileHistoryWhereInput + and: [FileHistoryWhereInput!] + or: [FileHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: FileHistoryOpType + operationNEQ: FileHistoryOpType + operationIn: [FileHistoryOpType!] + operationNotIn: [FileHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + file_name field predicates + """ + fileName: String + fileNameNEQ: String + fileNameIn: [String!] + fileNameNotIn: [String!] + fileNameGT: String + fileNameGTE: String + fileNameLT: String + fileNameLTE: String + fileNameContains: String + fileNameHasPrefix: String + fileNameHasSuffix: String + fileNameEqualFold: String + fileNameContainsFold: String + """ + file_extension field predicates + """ + fileExtension: String + fileExtensionNEQ: String + fileExtensionIn: [String!] + fileExtensionNotIn: [String!] + fileExtensionGT: String + fileExtensionGTE: String + fileExtensionLT: String + fileExtensionLTE: String + fileExtensionContains: String + fileExtensionHasPrefix: String + fileExtensionHasSuffix: String + fileExtensionEqualFold: String + fileExtensionContainsFold: String + """ + file_size field predicates + """ + fileSize: Int + fileSizeNEQ: Int + fileSizeIn: [Int!] + fileSizeNotIn: [Int!] + fileSizeGT: Int + fileSizeGTE: Int + fileSizeLT: Int + fileSizeLTE: Int + fileSizeIsNil: Boolean + fileSizeNotNil: Boolean + """ + content_type field predicates + """ + contentType: String + contentTypeNEQ: String + contentTypeIn: [String!] + contentTypeNotIn: [String!] + contentTypeGT: String + contentTypeGTE: String + contentTypeLT: String + contentTypeLTE: String + contentTypeContains: String + contentTypeHasPrefix: String + contentTypeHasSuffix: String + contentTypeEqualFold: String + contentTypeContainsFold: String + """ + store_key field predicates + """ + storeKey: String + storeKeyNEQ: String + storeKeyIn: [String!] + storeKeyNotIn: [String!] + storeKeyGT: String + storeKeyGTE: String + storeKeyLT: String + storeKeyLTE: String + storeKeyContains: String + storeKeyHasPrefix: String + storeKeyHasSuffix: String + storeKeyEqualFold: String + storeKeyContainsFold: String + """ + category field predicates + """ + category: String + categoryNEQ: String + categoryIn: [String!] + categoryNotIn: [String!] + categoryGT: String + categoryGTE: String + categoryLT: String + categoryLTE: String + categoryContains: String + categoryHasPrefix: String + categoryHasSuffix: String + categoryIsNil: Boolean + categoryNotNil: Boolean + categoryEqualFold: String + categoryContainsFold: String + """ + annotation field predicates + """ + annotation: String + annotationNEQ: String + annotationIn: [String!] + annotationNotIn: [String!] + annotationGT: String + annotationGTE: String + annotationLT: String + annotationLTE: String + annotationContains: String + annotationHasPrefix: String + annotationHasSuffix: String + annotationIsNil: Boolean + annotationNotNil: Boolean + annotationEqualFold: String + annotationContainsFold: String +} +""" +FileWhereInput is used for filtering File objects. +Input was generated by ent. +""" +input FileWhereInput { + not: FileWhereInput + and: [FileWhereInput!] + or: [FileWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + file_name field predicates + """ + fileName: String + fileNameNEQ: String + fileNameIn: [String!] + fileNameNotIn: [String!] + fileNameGT: String + fileNameGTE: String + fileNameLT: String + fileNameLTE: String + fileNameContains: String + fileNameHasPrefix: String + fileNameHasSuffix: String + fileNameEqualFold: String + fileNameContainsFold: String + """ + file_extension field predicates + """ + fileExtension: String + fileExtensionNEQ: String + fileExtensionIn: [String!] + fileExtensionNotIn: [String!] + fileExtensionGT: String + fileExtensionGTE: String + fileExtensionLT: String + fileExtensionLTE: String + fileExtensionContains: String + fileExtensionHasPrefix: String + fileExtensionHasSuffix: String + fileExtensionEqualFold: String + fileExtensionContainsFold: String + """ + file_size field predicates + """ + fileSize: Int + fileSizeNEQ: Int + fileSizeIn: [Int!] + fileSizeNotIn: [Int!] + fileSizeGT: Int + fileSizeGTE: Int + fileSizeLT: Int + fileSizeLTE: Int + fileSizeIsNil: Boolean + fileSizeNotNil: Boolean + """ + content_type field predicates + """ + contentType: String + contentTypeNEQ: String + contentTypeIn: [String!] + contentTypeNotIn: [String!] + contentTypeGT: String + contentTypeGTE: String + contentTypeLT: String + contentTypeLTE: String + contentTypeContains: String + contentTypeHasPrefix: String + contentTypeHasSuffix: String + contentTypeEqualFold: String + contentTypeContainsFold: String + """ + store_key field predicates + """ + storeKey: String + storeKeyNEQ: String + storeKeyIn: [String!] + storeKeyNotIn: [String!] + storeKeyGT: String + storeKeyGTE: String + storeKeyLT: String + storeKeyLTE: String + storeKeyContains: String + storeKeyHasPrefix: String + storeKeyHasSuffix: String + storeKeyEqualFold: String + storeKeyContainsFold: String + """ + category field predicates + """ + category: String + categoryNEQ: String + categoryIn: [String!] + categoryNotIn: [String!] + categoryGT: String + categoryGTE: String + categoryLT: String + categoryLTE: String + categoryContains: String + categoryHasPrefix: String + categoryHasSuffix: String + categoryIsNil: Boolean + categoryNotNil: Boolean + categoryEqualFold: String + categoryContainsFold: String + """ + annotation field predicates + """ + annotation: String + annotationNEQ: String + annotationIn: [String!] + annotationNotIn: [String!] + annotationGT: String + annotationGTE: String + annotationLT: String + annotationLTE: String + annotationContains: String + annotationHasPrefix: String + annotationHasSuffix: String + annotationIsNil: Boolean + annotationNotNil: Boolean + annotationEqualFold: String + annotationContainsFold: String + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] +} +type Group implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String! + owner: Organization + setting: GroupSetting! + users: [User!] + events: [Event!] + integrations: [Integration!] + files: [File!] + members: [GroupMembership!] +} +""" +A connection to a list of items. +""" +type GroupConnection { + """ + A list of edges. + """ + edges: [GroupEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupEdge { + """ + The item at the end of the edge. + """ + node: Group + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the group - must be unique within the organization + """ + name: String! + """ + the groups description + """ + description: String + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + """ + The group's displayed 'friendly' name + """ + displayName: String! +} +""" +A connection to a list of items. +""" +type GroupHistoryConnection { + """ + A list of edges. + """ + edges: [GroupHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupHistoryOpType is enum for the field operation +""" +enum GroupHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for GroupHistory connections +""" +input GroupHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order GroupHistories. + """ + field: GroupHistoryOrderField! +} +""" +Properties by which GroupHistory connections can be ordered. +""" +enum GroupHistoryOrderField { + name + display_name +} +""" +GroupHistoryWhereInput is used for filtering GroupHistory objects. +Input was generated by ent. +""" +input GroupHistoryWhereInput { + not: GroupHistoryWhereInput + and: [GroupHistoryWhereInput!] + or: [GroupHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupHistoryOpType + operationNEQ: GroupHistoryOpType + operationIn: [GroupHistoryOpType!] + operationNotIn: [GroupHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String +} +type GroupMembership implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: GroupMembershipRole! + groupID: ID! + userID: ID! + group: Group! + user: User! + events: [Event!] +} +""" +A connection to a list of items. +""" +type GroupMembershipConnection { + """ + A list of edges. + """ + edges: [GroupMembershipEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupMembershipEdge { + """ + The item at the end of the edge. + """ + node: GroupMembership + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupMembershipHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupMembershipHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: GroupMembershipHistoryRole! + groupID: String! + userID: String! +} +""" +A connection to a list of items. +""" +type GroupMembershipHistoryConnection { + """ + A list of edges. + """ + edges: [GroupMembershipHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupMembershipHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupMembershipHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupMembershipHistoryOpType is enum for the field operation +""" +enum GroupMembershipHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +GroupMembershipHistoryRole is enum for the field role +""" +enum GroupMembershipHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +GroupMembershipHistoryWhereInput is used for filtering GroupMembershipHistory objects. +Input was generated by ent. +""" +input GroupMembershipHistoryWhereInput { + not: GroupMembershipHistoryWhereInput + and: [GroupMembershipHistoryWhereInput!] + or: [GroupMembershipHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupMembershipHistoryOpType + operationNEQ: GroupMembershipHistoryOpType + operationIn: [GroupMembershipHistoryOpType!] + operationNotIn: [GroupMembershipHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: GroupMembershipHistoryRole + roleNEQ: GroupMembershipHistoryRole + roleIn: [GroupMembershipHistoryRole!] + roleNotIn: [GroupMembershipHistoryRole!] + """ + group_id field predicates + """ + groupID: String + groupIDNEQ: String + groupIDIn: [String!] + groupIDNotIn: [String!] + groupIDGT: String + groupIDGTE: String + groupIDLT: String + groupIDLTE: String + groupIDContains: String + groupIDHasPrefix: String + groupIDHasSuffix: String + groupIDEqualFold: String + groupIDContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDEqualFold: String + userIDContainsFold: String +} +""" +GroupMembershipRole is enum for the field role +""" +enum GroupMembershipRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +GroupMembershipWhereInput is used for filtering GroupMembership objects. +Input was generated by ent. +""" +input GroupMembershipWhereInput { + not: GroupMembershipWhereInput + and: [GroupMembershipWhereInput!] + or: [GroupMembershipWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: GroupMembershipRole + roleNEQ: GroupMembershipRole + roleIn: [GroupMembershipRole!] + roleNotIn: [GroupMembershipRole!] +} +""" +Ordering options for Group connections +""" +input GroupOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Groups. + """ + field: GroupOrderField! +} +""" +Properties by which Group connections can be ordered. +""" +enum GroupOrderField { + name + display_name +} +type GroupSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility! + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy! + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + """ + the group id associated with the settings + """ + groupID: ID + group: Group +} +""" +A connection to a list of items. +""" +type GroupSettingConnection { + """ + A list of edges. + """ + edges: [GroupSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupSettingEdge { + """ + The item at the end of the edge. + """ + node: GroupSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type GroupSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: GroupSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingHistoryVisibility! + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingHistoryJoinPolicy! + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + """ + the group id associated with the settings + """ + groupID: String +} +""" +A connection to a list of items. +""" +type GroupSettingHistoryConnection { + """ + A list of edges. + """ + edges: [GroupSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type GroupSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: GroupSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +GroupSettingHistoryJoinPolicy is enum for the field join_policy +""" +enum GroupSettingHistoryJoinPolicy @goModel(model: "github.com/theopenlane/core/pkg/enums.JoinPolicy") { + OPEN + INVITE_ONLY + APPLICATION_ONLY + INVITE_OR_APPLICATION +} +""" +GroupSettingHistoryOpType is enum for the field operation +""" +enum GroupSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +GroupSettingHistoryVisibility is enum for the field visibility +""" +enum GroupSettingHistoryVisibility @goModel(model: "github.com/theopenlane/core/pkg/enums.Visibility") { + PUBLIC + PRIVATE +} +""" +GroupSettingHistoryWhereInput is used for filtering GroupSettingHistory objects. +Input was generated by ent. +""" +input GroupSettingHistoryWhereInput { + not: GroupSettingHistoryWhereInput + and: [GroupSettingHistoryWhereInput!] + or: [GroupSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: GroupSettingHistoryOpType + operationNEQ: GroupSettingHistoryOpType + operationIn: [GroupSettingHistoryOpType!] + operationNotIn: [GroupSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + visibility field predicates + """ + visibility: GroupSettingHistoryVisibility + visibilityNEQ: GroupSettingHistoryVisibility + visibilityIn: [GroupSettingHistoryVisibility!] + visibilityNotIn: [GroupSettingHistoryVisibility!] + """ + join_policy field predicates + """ + joinPolicy: GroupSettingHistoryJoinPolicy + joinPolicyNEQ: GroupSettingHistoryJoinPolicy + joinPolicyIn: [GroupSettingHistoryJoinPolicy!] + joinPolicyNotIn: [GroupSettingHistoryJoinPolicy!] + """ + sync_to_slack field predicates + """ + syncToSlack: Boolean + syncToSlackNEQ: Boolean + syncToSlackIsNil: Boolean + syncToSlackNotNil: Boolean + """ + sync_to_github field predicates + """ + syncToGithub: Boolean + syncToGithubNEQ: Boolean + syncToGithubIsNil: Boolean + syncToGithubNotNil: Boolean + """ + group_id field predicates + """ + groupID: String + groupIDNEQ: String + groupIDIn: [String!] + groupIDNotIn: [String!] + groupIDGT: String + groupIDGTE: String + groupIDLT: String + groupIDLTE: String + groupIDContains: String + groupIDHasPrefix: String + groupIDHasSuffix: String + groupIDIsNil: Boolean + groupIDNotNil: Boolean + groupIDEqualFold: String + groupIDContainsFold: String +} +""" +GroupSettingJoinPolicy is enum for the field join_policy +""" +enum GroupSettingJoinPolicy @goModel(model: "github.com/theopenlane/core/pkg/enums.JoinPolicy") { + OPEN + INVITE_ONLY + APPLICATION_ONLY + INVITE_OR_APPLICATION +} +""" +GroupSettingVisibility is enum for the field visibility +""" +enum GroupSettingVisibility @goModel(model: "github.com/theopenlane/core/pkg/enums.Visibility") { + PUBLIC + PRIVATE +} +""" +GroupSettingWhereInput is used for filtering GroupSetting objects. +Input was generated by ent. +""" +input GroupSettingWhereInput { + not: GroupSettingWhereInput + and: [GroupSettingWhereInput!] + or: [GroupSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + visibility field predicates + """ + visibility: GroupSettingVisibility + visibilityNEQ: GroupSettingVisibility + visibilityIn: [GroupSettingVisibility!] + visibilityNotIn: [GroupSettingVisibility!] + """ + join_policy field predicates + """ + joinPolicy: GroupSettingJoinPolicy + joinPolicyNEQ: GroupSettingJoinPolicy + joinPolicyIn: [GroupSettingJoinPolicy!] + joinPolicyNotIn: [GroupSettingJoinPolicy!] + """ + sync_to_slack field predicates + """ + syncToSlack: Boolean + syncToSlackNEQ: Boolean + syncToSlackIsNil: Boolean + syncToSlackNotNil: Boolean + """ + sync_to_github field predicates + """ + syncToGithub: Boolean + syncToGithubNEQ: Boolean + syncToGithubIsNil: Boolean + syncToGithubNotNil: Boolean + """ + group_id field predicates + """ + groupID: ID + groupIDNEQ: ID + groupIDIn: [ID!] + groupIDNotIn: [ID!] + groupIDGT: ID + groupIDGTE: ID + groupIDLT: ID + groupIDLTE: ID + groupIDContains: ID + groupIDHasPrefix: ID + groupIDHasSuffix: ID + groupIDIsNil: Boolean + groupIDNotNil: Boolean + groupIDEqualFold: ID + groupIDContainsFold: ID + """ + group edge predicates + """ + hasGroup: Boolean + hasGroupWith: [GroupWhereInput!] +} +""" +GroupWhereInput is used for filtering Group objects. +Input was generated by ent. +""" +input GroupWhereInput { + not: GroupWhereInput + and: [GroupWhereInput!] + or: [GroupWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [GroupSettingWhereInput!] + """ + users edge predicates + """ + hasUsers: Boolean + hasUsersWith: [UserWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + members edge predicates + """ + hasMembers: Boolean + hasMembersWith: [GroupMembershipWhereInput!] +} +type Hush implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String + """ + the integration associated with the secret + """ + integrations: [Integration!] + organization: [Organization!] + events: [Event!] +} +""" +A connection to a list of items. +""" +type HushConnection { + """ + A list of edges. + """ + edges: [HushEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type HushEdge { + """ + The item at the end of the edge. + """ + node: Hush + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type HushHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: HushHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String! + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + """ + the generic name of a secret associated with the organization + """ + secretName: String +} +""" +A connection to a list of items. +""" +type HushHistoryConnection { + """ + A list of edges. + """ + edges: [HushHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type HushHistoryEdge { + """ + The item at the end of the edge. + """ + node: HushHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +HushHistoryOpType is enum for the field operation +""" +enum HushHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for HushHistory connections +""" +input HushHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order HushHistories. + """ + field: HushHistoryOrderField! +} +""" +Properties by which HushHistory connections can be ordered. +""" +enum HushHistoryOrderField { + name + kind +} +""" +HushHistoryWhereInput is used for filtering HushHistory objects. +Input was generated by ent. +""" +input HushHistoryWhereInput { + not: HushHistoryWhereInput + and: [HushHistoryWhereInput!] + or: [HushHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: HushHistoryOpType + operationNEQ: HushHistoryOpType + operationIn: [HushHistoryOpType!] + operationNotIn: [HushHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + secret_name field predicates + """ + secretName: String + secretNameNEQ: String + secretNameIn: [String!] + secretNameNotIn: [String!] + secretNameGT: String + secretNameGTE: String + secretNameLT: String + secretNameLTE: String + secretNameContains: String + secretNameHasPrefix: String + secretNameHasSuffix: String + secretNameIsNil: Boolean + secretNameNotNil: Boolean + secretNameEqualFold: String + secretNameContainsFold: String +} +""" +Ordering options for Hush connections +""" +input HushOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Hushes. + """ + field: HushOrderField! +} +""" +Properties by which Hush connections can be ordered. +""" +enum HushOrderField { + name + kind +} +""" +HushWhereInput is used for filtering Hush objects. +Input was generated by ent. +""" +input HushWhereInput { + not: HushWhereInput + and: [HushWhereInput!] + or: [HushWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + secret_name field predicates + """ + secretName: String + secretNameNEQ: String + secretNameIn: [String!] + secretNameNotIn: [String!] + secretNameGT: String + secretNameGTE: String + secretNameLT: String + secretNameLTE: String + secretNameContains: String + secretNameHasPrefix: String + secretNameHasSuffix: String + secretNameIsNil: Boolean + secretNameNotNil: Boolean + secretNameEqualFold: String + secretNameContainsFold: String + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Integration implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String + owner: Organization + """ + the secrets associated with the integration + """ + secrets: [Hush!] + """ + the oauth2 tokens associated with the integration + """ + oauth2tokens: [OhAuthTooToken!] + events: [Event!] + webhooks: [Webhook!] +} +""" +A connection to a list of items. +""" +type IntegrationConnection { + """ + A list of edges. + """ + edges: [IntegrationEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type IntegrationEdge { + """ + The item at the end of the edge. + """ + node: Integration + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type IntegrationHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: IntegrationHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the integration - must be unique within the organization + """ + name: String! + """ + a description of the integration + """ + description: String + kind: String +} +""" +A connection to a list of items. +""" +type IntegrationHistoryConnection { + """ + A list of edges. + """ + edges: [IntegrationHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type IntegrationHistoryEdge { + """ + The item at the end of the edge. + """ + node: IntegrationHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +IntegrationHistoryOpType is enum for the field operation +""" +enum IntegrationHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for IntegrationHistory connections +""" +input IntegrationHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order IntegrationHistories. + """ + field: IntegrationHistoryOrderField! +} +""" +Properties by which IntegrationHistory connections can be ordered. +""" +enum IntegrationHistoryOrderField { + name + kind +} +""" +IntegrationHistoryWhereInput is used for filtering IntegrationHistory objects. +Input was generated by ent. +""" +input IntegrationHistoryWhereInput { + not: IntegrationHistoryWhereInput + and: [IntegrationHistoryWhereInput!] + or: [IntegrationHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: IntegrationHistoryOpType + operationNEQ: IntegrationHistoryOpType + operationIn: [IntegrationHistoryOpType!] + operationNotIn: [IntegrationHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String +} +""" +Ordering options for Integration connections +""" +input IntegrationOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Integrations. + """ + field: IntegrationOrderField! +} +""" +Properties by which Integration connections can be ordered. +""" +enum IntegrationOrderField { + name + kind +} +""" +IntegrationWhereInput is used for filtering Integration objects. +Input was generated by ent. +""" +input IntegrationWhereInput { + not: IntegrationWhereInput + and: [IntegrationWhereInput!] + or: [IntegrationWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + kind field predicates + """ + kind: String + kindNEQ: String + kindIn: [String!] + kindNotIn: [String!] + kindGT: String + kindGTE: String + kindLT: String + kindLTE: String + kindContains: String + kindHasPrefix: String + kindHasSuffix: String + kindIsNil: Boolean + kindNotNil: Boolean + kindEqualFold: String + kindContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + secrets edge predicates + """ + hasSecrets: Boolean + hasSecretsWith: [HushWhereInput!] + """ + oauth2tokens edge predicates + """ + hasOauth2tokens: Boolean + hasOauth2tokensWith: [OhAuthTooTokenWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + webhooks edge predicates + """ + hasWebhooks: Boolean + hasWebhooksWith: [WebhookWhereInput!] +} +type Invite implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + """ + the email used as input to generate the invitation token and is the destination person the invitation is sent to who is required to accept to join the organization + """ + recipient: String! + """ + the status of the invitation + """ + status: InviteInviteStatus! + role: InviteRole! + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int! + """ + the user who initiated the invitation + """ + requestorID: String + owner: Organization + events: [Event!] +} +""" +A connection to a list of items. +""" +type InviteConnection { + """ + A list of edges. + """ + edges: [InviteEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type InviteEdge { + """ + The item at the end of the edge. + """ + node: Invite + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +InviteInviteStatus is enum for the field status +""" +enum InviteInviteStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.InviteStatus") { + INVITATION_SENT + APPROVAL_REQUIRED + INVITATION_ACCEPTED + INVITATION_EXPIRED +} +""" +InviteRole is enum for the field role +""" +enum InviteRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +InviteWhereInput is used for filtering Invite objects. +Input was generated by ent. +""" +input InviteWhereInput { + not: InviteWhereInput + and: [InviteWhereInput!] + or: [InviteWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + expires field predicates + """ + expires: Time + expiresNEQ: Time + expiresIn: [Time!] + expiresNotIn: [Time!] + expiresGT: Time + expiresGTE: Time + expiresLT: Time + expiresLTE: Time + expiresIsNil: Boolean + expiresNotNil: Boolean + """ + recipient field predicates + """ + recipient: String + recipientNEQ: String + recipientIn: [String!] + recipientNotIn: [String!] + recipientGT: String + recipientGTE: String + recipientLT: String + recipientLTE: String + recipientContains: String + recipientHasPrefix: String + recipientHasSuffix: String + recipientEqualFold: String + recipientContainsFold: String + """ + status field predicates + """ + status: InviteInviteStatus + statusNEQ: InviteInviteStatus + statusIn: [InviteInviteStatus!] + statusNotIn: [InviteInviteStatus!] + """ + role field predicates + """ + role: InviteRole + roleNEQ: InviteRole + roleIn: [InviteRole!] + roleNotIn: [InviteRole!] + """ + send_attempts field predicates + """ + sendAttempts: Int + sendAttemptsNEQ: Int + sendAttemptsIn: [Int!] + sendAttemptsNotIn: [Int!] + sendAttemptsGT: Int + sendAttemptsGTE: Int + sendAttemptsLT: Int + sendAttemptsLTE: Int + """ + requestor_id field predicates + """ + requestorID: String + requestorIDNEQ: String + requestorIDIn: [String!] + requestorIDNotIn: [String!] + requestorIDGT: String + requestorIDGTE: String + requestorIDLT: String + requestorIDLTE: String + requestorIDContains: String + requestorIDHasPrefix: String + requestorIDHasSuffix: String + requestorIDIsNil: Boolean + requestorIDNotNil: Boolean + requestorIDEqualFold: String + requestorIDContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +""" +A valid JSON string. +""" +scalar JSON +""" +The builtin Map type +""" +scalar Map +""" +An object with an ID. +Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm) +""" +interface Node @goModel(model: "github.com/theopenlane/core/internal/ent/generated.Noder") { + """ + The id of the object. + """ + id: ID! +} +type Note implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the text of the note + """ + text: String! + owner: Organization + entity: Entity +} +""" +A connection to a list of items. +""" +type NoteConnection { + """ + A list of edges. + """ + edges: [NoteEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type NoteEdge { + """ + The item at the end of the edge. + """ + node: Note + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type NoteHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: NoteHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the text of the note + """ + text: String! +} +""" +A connection to a list of items. +""" +type NoteHistoryConnection { + """ + A list of edges. + """ + edges: [NoteHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type NoteHistoryEdge { + """ + The item at the end of the edge. + """ + node: NoteHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +NoteHistoryOpType is enum for the field operation +""" +enum NoteHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +NoteHistoryWhereInput is used for filtering NoteHistory objects. +Input was generated by ent. +""" +input NoteHistoryWhereInput { + not: NoteHistoryWhereInput + and: [NoteHistoryWhereInput!] + or: [NoteHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: NoteHistoryOpType + operationNEQ: NoteHistoryOpType + operationIn: [NoteHistoryOpType!] + operationNotIn: [NoteHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + text field predicates + """ + text: String + textNEQ: String + textIn: [String!] + textNotIn: [String!] + textGT: String + textGTE: String + textLT: String + textLTE: String + textContains: String + textHasPrefix: String + textHasSuffix: String + textEqualFold: String + textContainsFold: String +} +""" +NoteWhereInput is used for filtering Note objects. +Input was generated by ent. +""" +input NoteWhereInput { + not: NoteWhereInput + and: [NoteWhereInput!] + or: [NoteWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + text field predicates + """ + text: String + textNEQ: String + textIn: [String!] + textNotIn: [String!] + textGT: String + textGTE: String + textLT: String + textLTE: String + textContains: String + textHasPrefix: String + textHasSuffix: String + textEqualFold: String + textContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + entity edge predicates + """ + hasEntity: Boolean + hasEntityWith: [EntityWhereInput!] +} +type OauthProvider implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! + owner: Organization +} +""" +A connection to a list of items. +""" +type OauthProviderConnection { + """ + A list of edges. + """ + edges: [OauthProviderEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OauthProviderEdge { + """ + The item at the end of the edge. + """ + node: OauthProvider + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OauthProviderHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OauthProviderHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the oauth provider's name + """ + name: String! + """ + the client id for the oauth provider + """ + clientID: String! + """ + the client secret + """ + clientSecret: String! + """ + the redirect url + """ + redirectURL: String! + """ + the scopes + """ + scopes: String! + """ + the auth url of the provider + """ + authURL: String! + """ + the token url of the provider + """ + tokenURL: String! + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint! + """ + the URL to request user information by token + """ + infoURL: String! +} +""" +A connection to a list of items. +""" +type OauthProviderHistoryConnection { + """ + A list of edges. + """ + edges: [OauthProviderHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OauthProviderHistoryEdge { + """ + The item at the end of the edge. + """ + node: OauthProviderHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OauthProviderHistoryOpType is enum for the field operation +""" +enum OauthProviderHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OauthProviderHistoryWhereInput is used for filtering OauthProviderHistory objects. +Input was generated by ent. +""" +input OauthProviderHistoryWhereInput { + not: OauthProviderHistoryWhereInput + and: [OauthProviderHistoryWhereInput!] + or: [OauthProviderHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OauthProviderHistoryOpType + operationNEQ: OauthProviderHistoryOpType + operationIn: [OauthProviderHistoryOpType!] + operationNotIn: [OauthProviderHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + client_secret field predicates + """ + clientSecret: String + clientSecretNEQ: String + clientSecretIn: [String!] + clientSecretNotIn: [String!] + clientSecretGT: String + clientSecretGTE: String + clientSecretLT: String + clientSecretLTE: String + clientSecretContains: String + clientSecretHasPrefix: String + clientSecretHasSuffix: String + clientSecretEqualFold: String + clientSecretContainsFold: String + """ + redirect_url field predicates + """ + redirectURL: String + redirectURLNEQ: String + redirectURLIn: [String!] + redirectURLNotIn: [String!] + redirectURLGT: String + redirectURLGTE: String + redirectURLLT: String + redirectURLLTE: String + redirectURLContains: String + redirectURLHasPrefix: String + redirectURLHasSuffix: String + redirectURLEqualFold: String + redirectURLContainsFold: String + """ + scopes field predicates + """ + scopes: String + scopesNEQ: String + scopesIn: [String!] + scopesNotIn: [String!] + scopesGT: String + scopesGTE: String + scopesLT: String + scopesLTE: String + scopesContains: String + scopesHasPrefix: String + scopesHasSuffix: String + scopesEqualFold: String + scopesContainsFold: String + """ + auth_url field predicates + """ + authURL: String + authURLNEQ: String + authURLIn: [String!] + authURLNotIn: [String!] + authURLGT: String + authURLGTE: String + authURLLT: String + authURLLTE: String + authURLContains: String + authURLHasPrefix: String + authURLHasSuffix: String + authURLEqualFold: String + authURLContainsFold: String + """ + token_url field predicates + """ + tokenURL: String + tokenURLNEQ: String + tokenURLIn: [String!] + tokenURLNotIn: [String!] + tokenURLGT: String + tokenURLGTE: String + tokenURLLT: String + tokenURLLTE: String + tokenURLContains: String + tokenURLHasPrefix: String + tokenURLHasSuffix: String + tokenURLEqualFold: String + tokenURLContainsFold: String + """ + auth_style field predicates + """ + authStyle: Uint + authStyleNEQ: Uint + authStyleIn: [Uint!] + authStyleNotIn: [Uint!] + authStyleGT: Uint + authStyleGTE: Uint + authStyleLT: Uint + authStyleLTE: Uint + """ + info_url field predicates + """ + infoURL: String + infoURLNEQ: String + infoURLIn: [String!] + infoURLNotIn: [String!] + infoURLGT: String + infoURLGTE: String + infoURLLT: String + infoURLLTE: String + infoURLContains: String + infoURLHasPrefix: String + infoURLHasSuffix: String + infoURLEqualFold: String + infoURLContainsFold: String +} +""" +OauthProviderWhereInput is used for filtering OauthProvider objects. +Input was generated by ent. +""" +input OauthProviderWhereInput { + not: OauthProviderWhereInput + and: [OauthProviderWhereInput!] + or: [OauthProviderWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + client_secret field predicates + """ + clientSecret: String + clientSecretNEQ: String + clientSecretIn: [String!] + clientSecretNotIn: [String!] + clientSecretGT: String + clientSecretGTE: String + clientSecretLT: String + clientSecretLTE: String + clientSecretContains: String + clientSecretHasPrefix: String + clientSecretHasSuffix: String + clientSecretEqualFold: String + clientSecretContainsFold: String + """ + redirect_url field predicates + """ + redirectURL: String + redirectURLNEQ: String + redirectURLIn: [String!] + redirectURLNotIn: [String!] + redirectURLGT: String + redirectURLGTE: String + redirectURLLT: String + redirectURLLTE: String + redirectURLContains: String + redirectURLHasPrefix: String + redirectURLHasSuffix: String + redirectURLEqualFold: String + redirectURLContainsFold: String + """ + scopes field predicates + """ + scopes: String + scopesNEQ: String + scopesIn: [String!] + scopesNotIn: [String!] + scopesGT: String + scopesGTE: String + scopesLT: String + scopesLTE: String + scopesContains: String + scopesHasPrefix: String + scopesHasSuffix: String + scopesEqualFold: String + scopesContainsFold: String + """ + auth_url field predicates + """ + authURL: String + authURLNEQ: String + authURLIn: [String!] + authURLNotIn: [String!] + authURLGT: String + authURLGTE: String + authURLLT: String + authURLLTE: String + authURLContains: String + authURLHasPrefix: String + authURLHasSuffix: String + authURLEqualFold: String + authURLContainsFold: String + """ + token_url field predicates + """ + tokenURL: String + tokenURLNEQ: String + tokenURLIn: [String!] + tokenURLNotIn: [String!] + tokenURLGT: String + tokenURLGTE: String + tokenURLLT: String + tokenURLLTE: String + tokenURLContains: String + tokenURLHasPrefix: String + tokenURLHasSuffix: String + tokenURLEqualFold: String + tokenURLContainsFold: String + """ + auth_style field predicates + """ + authStyle: Uint + authStyleNEQ: Uint + authStyleIn: [Uint!] + authStyleNotIn: [Uint!] + authStyleGT: Uint + authStyleGTE: Uint + authStyleLT: Uint + authStyleLTE: Uint + """ + info_url field predicates + """ + infoURL: String + infoURLNEQ: String + infoURLIn: [String!] + infoURLNotIn: [String!] + infoURLGT: String + infoURLGTE: String + infoURLLT: String + infoURLLTE: String + infoURLContains: String + infoURLHasPrefix: String + infoURLHasSuffix: String + infoURLEqualFold: String + infoURLContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] +} +type OhAuthTooToken implements Node { + id: ID! + """ + tags associated with the object + """ + tags: [String!] + clientID: String! + scopes: [String!] + nonce: String! + claimsUserID: String! + claimsUsername: String! + claimsEmail: String! + claimsEmailVerified: Boolean! + claimsGroups: [String!] + claimsPreferredUsername: String! + connectorID: String! + connectorData: [String!] + lastUsed: Time! + integration: [Integration!] + events: [Event!] +} +""" +A connection to a list of items. +""" +type OhAuthTooTokenConnection { + """ + A list of edges. + """ + edges: [OhAuthTooTokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OhAuthTooTokenEdge { + """ + The item at the end of the edge. + """ + node: OhAuthTooToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OhAuthTooTokenWhereInput is used for filtering OhAuthTooToken objects. +Input was generated by ent. +""" +input OhAuthTooTokenWhereInput { + not: OhAuthTooTokenWhereInput + and: [OhAuthTooTokenWhereInput!] + or: [OhAuthTooTokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + client_id field predicates + """ + clientID: String + clientIDNEQ: String + clientIDIn: [String!] + clientIDNotIn: [String!] + clientIDGT: String + clientIDGTE: String + clientIDLT: String + clientIDLTE: String + clientIDContains: String + clientIDHasPrefix: String + clientIDHasSuffix: String + clientIDEqualFold: String + clientIDContainsFold: String + """ + nonce field predicates + """ + nonce: String + nonceNEQ: String + nonceIn: [String!] + nonceNotIn: [String!] + nonceGT: String + nonceGTE: String + nonceLT: String + nonceLTE: String + nonceContains: String + nonceHasPrefix: String + nonceHasSuffix: String + nonceEqualFold: String + nonceContainsFold: String + """ + claims_user_id field predicates + """ + claimsUserID: String + claimsUserIDNEQ: String + claimsUserIDIn: [String!] + claimsUserIDNotIn: [String!] + claimsUserIDGT: String + claimsUserIDGTE: String + claimsUserIDLT: String + claimsUserIDLTE: String + claimsUserIDContains: String + claimsUserIDHasPrefix: String + claimsUserIDHasSuffix: String + claimsUserIDEqualFold: String + claimsUserIDContainsFold: String + """ + claims_username field predicates + """ + claimsUsername: String + claimsUsernameNEQ: String + claimsUsernameIn: [String!] + claimsUsernameNotIn: [String!] + claimsUsernameGT: String + claimsUsernameGTE: String + claimsUsernameLT: String + claimsUsernameLTE: String + claimsUsernameContains: String + claimsUsernameHasPrefix: String + claimsUsernameHasSuffix: String + claimsUsernameEqualFold: String + claimsUsernameContainsFold: String + """ + claims_email field predicates + """ + claimsEmail: String + claimsEmailNEQ: String + claimsEmailIn: [String!] + claimsEmailNotIn: [String!] + claimsEmailGT: String + claimsEmailGTE: String + claimsEmailLT: String + claimsEmailLTE: String + claimsEmailContains: String + claimsEmailHasPrefix: String + claimsEmailHasSuffix: String + claimsEmailEqualFold: String + claimsEmailContainsFold: String + """ + claims_email_verified field predicates + """ + claimsEmailVerified: Boolean + claimsEmailVerifiedNEQ: Boolean + """ + claims_preferred_username field predicates + """ + claimsPreferredUsername: String + claimsPreferredUsernameNEQ: String + claimsPreferredUsernameIn: [String!] + claimsPreferredUsernameNotIn: [String!] + claimsPreferredUsernameGT: String + claimsPreferredUsernameGTE: String + claimsPreferredUsernameLT: String + claimsPreferredUsernameLTE: String + claimsPreferredUsernameContains: String + claimsPreferredUsernameHasPrefix: String + claimsPreferredUsernameHasSuffix: String + claimsPreferredUsernameEqualFold: String + claimsPreferredUsernameContainsFold: String + """ + connector_id field predicates + """ + connectorID: String + connectorIDNEQ: String + connectorIDIn: [String!] + connectorIDNotIn: [String!] + connectorIDGT: String + connectorIDGTE: String + connectorIDLT: String + connectorIDLTE: String + connectorIDContains: String + connectorIDHasPrefix: String + connectorIDHasSuffix: String + connectorIDEqualFold: String + connectorIDContainsFold: String + """ + last_used field predicates + """ + lastUsed: Time + lastUsedNEQ: Time + lastUsedIn: [Time!] + lastUsedNotIn: [Time!] + lastUsedGT: Time + lastUsedGTE: Time + lastUsedLT: Time + lastUsedLTE: Time + """ + integration edge predicates + """ + hasIntegration: Boolean + hasIntegrationWith: [IntegrationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +""" +Possible directions in which to order a list of items when provided an `orderBy` argument. +""" +enum OrderDirection { + """ + Specifies an ascending order for a given `orderBy` argument. + """ + ASC + """ + Specifies a descending order for a given `orderBy` argument. + """ + DESC +} +type OrgMembership implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: OrgMembershipRole! + organizationID: ID! + userID: ID! + organization: Organization! + user: User! + events: [Event!] +} +""" +A connection to a list of items. +""" +type OrgMembershipConnection { + """ + A list of edges. + """ + edges: [OrgMembershipEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrgMembershipEdge { + """ + The item at the end of the edge. + """ + node: OrgMembership + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrgMembershipHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrgMembershipHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + role: OrgMembershipHistoryRole! + organizationID: String! + userID: String! +} +""" +A connection to a list of items. +""" +type OrgMembershipHistoryConnection { + """ + A list of edges. + """ + edges: [OrgMembershipHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrgMembershipHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrgMembershipHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrgMembershipHistoryOpType is enum for the field operation +""" +enum OrgMembershipHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OrgMembershipHistoryRole is enum for the field role +""" +enum OrgMembershipHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER + OWNER +} +""" +OrgMembershipHistoryWhereInput is used for filtering OrgMembershipHistory objects. +Input was generated by ent. +""" +input OrgMembershipHistoryWhereInput { + not: OrgMembershipHistoryWhereInput + and: [OrgMembershipHistoryWhereInput!] + or: [OrgMembershipHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrgMembershipHistoryOpType + operationNEQ: OrgMembershipHistoryOpType + operationIn: [OrgMembershipHistoryOpType!] + operationNotIn: [OrgMembershipHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: OrgMembershipHistoryRole + roleNEQ: OrgMembershipHistoryRole + roleIn: [OrgMembershipHistoryRole!] + roleNotIn: [OrgMembershipHistoryRole!] + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDEqualFold: String + organizationIDContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDEqualFold: String + userIDContainsFold: String +} +""" +OrgMembershipRole is enum for the field role +""" +enum OrgMembershipRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER + OWNER +} +""" +OrgMembershipWhereInput is used for filtering OrgMembership objects. +Input was generated by ent. +""" +input OrgMembershipWhereInput { + not: OrgMembershipWhereInput + and: [OrgMembershipWhereInput!] + or: [OrgMembershipWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + role field predicates + """ + role: OrgMembershipRole + roleNEQ: OrgMembershipRole + roleIn: [OrgMembershipRole!] + roleNotIn: [OrgMembershipRole!] +} +type Organization implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String! + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean! + parent: Organization + children( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Organizations returned from the connection. + """ + orderBy: OrganizationOrder + + """ + Filtering options for Organizations returned from the connection. + """ + where: OrganizationWhereInput + ): OrganizationConnection! + groups: [Group!] + templates: [Template!] + integrations: [Integration!] + setting: OrganizationSetting + documentdata: [DocumentData!] + entitlements: [Entitlement!] + organizationEntitlement: [Entitlement!] + personalAccessTokens: [PersonalAccessToken!] + apiTokens: [APIToken!] + oauthprovider: [OauthProvider!] + users: [User!] + invites: [Invite!] + subscribers: [Subscriber!] + webhooks: [Webhook!] + events: [Event!] + secrets: [Hush!] + features: [Feature!] + files: [File!] + entitlementplans: [EntitlementPlan!] + entitlementplanfeatures: [EntitlementPlanFeature!] + entities: [Entity!] + entitytypes: [EntityType!] + contacts: [Contact!] + notes: [Note!] + members: [OrgMembership!] +} +""" +A connection to a list of items. +""" +type OrganizationConnection { + """ + A list of edges. + """ + edges: [OrganizationEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationEdge { + """ + The item at the end of the edge. + """ + node: Organization + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrganizationHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrganizationHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + the name of the organization + """ + name: String! + """ + The organization's displayed 'friendly' name + """ + displayName: String! + """ + An optional description of the organization + """ + description: String + """ + orgs directly associated with a user + """ + personalOrg: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + Whether the organization has a dedicated database + """ + dedicatedDb: Boolean! +} +""" +A connection to a list of items. +""" +type OrganizationHistoryConnection { + """ + A list of edges. + """ + edges: [OrganizationHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrganizationHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrganizationHistoryOpType is enum for the field operation +""" +enum OrganizationHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for OrganizationHistory connections +""" +input OrganizationHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order OrganizationHistories. + """ + field: OrganizationHistoryOrderField! +} +""" +Properties by which OrganizationHistory connections can be ordered. +""" +enum OrganizationHistoryOrderField { + name + display_name +} +""" +OrganizationHistoryWhereInput is used for filtering OrganizationHistory objects. +Input was generated by ent. +""" +input OrganizationHistoryWhereInput { + not: OrganizationHistoryWhereInput + and: [OrganizationHistoryWhereInput!] + or: [OrganizationHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrganizationHistoryOpType + operationNEQ: OrganizationHistoryOpType + operationIn: [OrganizationHistoryOpType!] + operationNotIn: [OrganizationHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + parent_organization_id field predicates + """ + parentOrganizationID: ID + parentOrganizationIDNEQ: ID + parentOrganizationIDIn: [ID!] + parentOrganizationIDNotIn: [ID!] + parentOrganizationIDGT: ID + parentOrganizationIDGTE: ID + parentOrganizationIDLT: ID + parentOrganizationIDLTE: ID + parentOrganizationIDContains: ID + parentOrganizationIDHasPrefix: ID + parentOrganizationIDHasSuffix: ID + parentOrganizationIDIsNil: Boolean + parentOrganizationIDNotNil: Boolean + parentOrganizationIDEqualFold: ID + parentOrganizationIDContainsFold: ID + """ + personal_org field predicates + """ + personalOrg: Boolean + personalOrgNEQ: Boolean + personalOrgIsNil: Boolean + personalOrgNotNil: Boolean + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String +} +""" +Ordering options for Organization connections +""" +input OrganizationOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Organizations. + """ + field: OrganizationOrderField! +} +""" +Properties by which Organization connections can be ordered. +""" +enum OrganizationOrderField { + name + display_name +} +type OrganizationSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + """ + the ID of the organization the settings belong to + """ + organizationID: ID + organization: Organization +} +""" +A connection to a list of items. +""" +type OrganizationSettingConnection { + """ + A list of edges. + """ + edges: [OrganizationSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationSettingEdge { + """ + The item at the end of the edge. + """ + node: OrganizationSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type OrganizationSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: OrganizationSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + domains associated with the organization + """ + domains: [String!] + """ + Name of the person to contact for billing + """ + billingContact: String + """ + Email address of the person to contact for billing + """ + billingEmail: String + """ + Phone number to contact for billing + """ + billingPhone: String + """ + Address to send billing information to + """ + billingAddress: String + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingHistoryRegion + """ + the ID of the organization the settings belong to + """ + organizationID: String +} +""" +A connection to a list of items. +""" +type OrganizationSettingHistoryConnection { + """ + A list of edges. + """ + edges: [OrganizationSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type OrganizationSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: OrganizationSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +OrganizationSettingHistoryOpType is enum for the field operation +""" +enum OrganizationSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +OrganizationSettingHistoryRegion is enum for the field geo_location +""" +enum OrganizationSettingHistoryRegion @goModel(model: "github.com/theopenlane/core/pkg/enums.Region") { + AMER + EMEA + APAC +} +""" +OrganizationSettingHistoryWhereInput is used for filtering OrganizationSettingHistory objects. +Input was generated by ent. +""" +input OrganizationSettingHistoryWhereInput { + not: OrganizationSettingHistoryWhereInput + and: [OrganizationSettingHistoryWhereInput!] + or: [OrganizationSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: OrganizationSettingHistoryOpType + operationNEQ: OrganizationSettingHistoryOpType + operationIn: [OrganizationSettingHistoryOpType!] + operationNotIn: [OrganizationSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + billing_contact field predicates + """ + billingContact: String + billingContactNEQ: String + billingContactIn: [String!] + billingContactNotIn: [String!] + billingContactGT: String + billingContactGTE: String + billingContactLT: String + billingContactLTE: String + billingContactContains: String + billingContactHasPrefix: String + billingContactHasSuffix: String + billingContactIsNil: Boolean + billingContactNotNil: Boolean + billingContactEqualFold: String + billingContactContainsFold: String + """ + billing_email field predicates + """ + billingEmail: String + billingEmailNEQ: String + billingEmailIn: [String!] + billingEmailNotIn: [String!] + billingEmailGT: String + billingEmailGTE: String + billingEmailLT: String + billingEmailLTE: String + billingEmailContains: String + billingEmailHasPrefix: String + billingEmailHasSuffix: String + billingEmailIsNil: Boolean + billingEmailNotNil: Boolean + billingEmailEqualFold: String + billingEmailContainsFold: String + """ + billing_phone field predicates + """ + billingPhone: String + billingPhoneNEQ: String + billingPhoneIn: [String!] + billingPhoneNotIn: [String!] + billingPhoneGT: String + billingPhoneGTE: String + billingPhoneLT: String + billingPhoneLTE: String + billingPhoneContains: String + billingPhoneHasPrefix: String + billingPhoneHasSuffix: String + billingPhoneIsNil: Boolean + billingPhoneNotNil: Boolean + billingPhoneEqualFold: String + billingPhoneContainsFold: String + """ + billing_address field predicates + """ + billingAddress: String + billingAddressNEQ: String + billingAddressIn: [String!] + billingAddressNotIn: [String!] + billingAddressGT: String + billingAddressGTE: String + billingAddressLT: String + billingAddressLTE: String + billingAddressContains: String + billingAddressHasPrefix: String + billingAddressHasSuffix: String + billingAddressIsNil: Boolean + billingAddressNotNil: Boolean + billingAddressEqualFold: String + billingAddressContainsFold: String + """ + tax_identifier field predicates + """ + taxIdentifier: String + taxIdentifierNEQ: String + taxIdentifierIn: [String!] + taxIdentifierNotIn: [String!] + taxIdentifierGT: String + taxIdentifierGTE: String + taxIdentifierLT: String + taxIdentifierLTE: String + taxIdentifierContains: String + taxIdentifierHasPrefix: String + taxIdentifierHasSuffix: String + taxIdentifierIsNil: Boolean + taxIdentifierNotNil: Boolean + taxIdentifierEqualFold: String + taxIdentifierContainsFold: String + """ + geo_location field predicates + """ + geoLocation: OrganizationSettingHistoryRegion + geoLocationNEQ: OrganizationSettingHistoryRegion + geoLocationIn: [OrganizationSettingHistoryRegion!] + geoLocationNotIn: [OrganizationSettingHistoryRegion!] + geoLocationIsNil: Boolean + geoLocationNotNil: Boolean + """ + organization_id field predicates + """ + organizationID: String + organizationIDNEQ: String + organizationIDIn: [String!] + organizationIDNotIn: [String!] + organizationIDGT: String + organizationIDGTE: String + organizationIDLT: String + organizationIDLTE: String + organizationIDContains: String + organizationIDHasPrefix: String + organizationIDHasSuffix: String + organizationIDIsNil: Boolean + organizationIDNotNil: Boolean + organizationIDEqualFold: String + organizationIDContainsFold: String +} +""" +OrganizationSettingRegion is enum for the field geo_location +""" +enum OrganizationSettingRegion @goModel(model: "github.com/theopenlane/core/pkg/enums.Region") { + AMER + EMEA + APAC +} +""" +OrganizationSettingWhereInput is used for filtering OrganizationSetting objects. +Input was generated by ent. +""" +input OrganizationSettingWhereInput { + not: OrganizationSettingWhereInput + and: [OrganizationSettingWhereInput!] + or: [OrganizationSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + billing_contact field predicates + """ + billingContact: String + billingContactNEQ: String + billingContactIn: [String!] + billingContactNotIn: [String!] + billingContactGT: String + billingContactGTE: String + billingContactLT: String + billingContactLTE: String + billingContactContains: String + billingContactHasPrefix: String + billingContactHasSuffix: String + billingContactIsNil: Boolean + billingContactNotNil: Boolean + billingContactEqualFold: String + billingContactContainsFold: String + """ + billing_email field predicates + """ + billingEmail: String + billingEmailNEQ: String + billingEmailIn: [String!] + billingEmailNotIn: [String!] + billingEmailGT: String + billingEmailGTE: String + billingEmailLT: String + billingEmailLTE: String + billingEmailContains: String + billingEmailHasPrefix: String + billingEmailHasSuffix: String + billingEmailIsNil: Boolean + billingEmailNotNil: Boolean + billingEmailEqualFold: String + billingEmailContainsFold: String + """ + billing_phone field predicates + """ + billingPhone: String + billingPhoneNEQ: String + billingPhoneIn: [String!] + billingPhoneNotIn: [String!] + billingPhoneGT: String + billingPhoneGTE: String + billingPhoneLT: String + billingPhoneLTE: String + billingPhoneContains: String + billingPhoneHasPrefix: String + billingPhoneHasSuffix: String + billingPhoneIsNil: Boolean + billingPhoneNotNil: Boolean + billingPhoneEqualFold: String + billingPhoneContainsFold: String + """ + billing_address field predicates + """ + billingAddress: String + billingAddressNEQ: String + billingAddressIn: [String!] + billingAddressNotIn: [String!] + billingAddressGT: String + billingAddressGTE: String + billingAddressLT: String + billingAddressLTE: String + billingAddressContains: String + billingAddressHasPrefix: String + billingAddressHasSuffix: String + billingAddressIsNil: Boolean + billingAddressNotNil: Boolean + billingAddressEqualFold: String + billingAddressContainsFold: String + """ + tax_identifier field predicates + """ + taxIdentifier: String + taxIdentifierNEQ: String + taxIdentifierIn: [String!] + taxIdentifierNotIn: [String!] + taxIdentifierGT: String + taxIdentifierGTE: String + taxIdentifierLT: String + taxIdentifierLTE: String + taxIdentifierContains: String + taxIdentifierHasPrefix: String + taxIdentifierHasSuffix: String + taxIdentifierIsNil: Boolean + taxIdentifierNotNil: Boolean + taxIdentifierEqualFold: String + taxIdentifierContainsFold: String + """ + geo_location field predicates + """ + geoLocation: OrganizationSettingRegion + geoLocationNEQ: OrganizationSettingRegion + geoLocationIn: [OrganizationSettingRegion!] + geoLocationNotIn: [OrganizationSettingRegion!] + geoLocationIsNil: Boolean + geoLocationNotNil: Boolean + """ + organization_id field predicates + """ + organizationID: ID + organizationIDNEQ: ID + organizationIDIn: [ID!] + organizationIDNotIn: [ID!] + organizationIDGT: ID + organizationIDGTE: ID + organizationIDLT: ID + organizationIDLTE: ID + organizationIDContains: ID + organizationIDHasPrefix: ID + organizationIDHasSuffix: ID + organizationIDIsNil: Boolean + organizationIDNotNil: Boolean + organizationIDEqualFold: ID + organizationIDContainsFold: ID + """ + organization edge predicates + """ + hasOrganization: Boolean + hasOrganizationWith: [OrganizationWhereInput!] +} +""" +OrganizationWhereInput is used for filtering Organization objects. +Input was generated by ent. +""" +input OrganizationWhereInput { + not: OrganizationWhereInput + and: [OrganizationWhereInput!] + or: [OrganizationWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + parent_organization_id field predicates + """ + parentOrganizationID: ID + parentOrganizationIDNEQ: ID + parentOrganizationIDIn: [ID!] + parentOrganizationIDNotIn: [ID!] + parentOrganizationIDGT: ID + parentOrganizationIDGTE: ID + parentOrganizationIDLT: ID + parentOrganizationIDLTE: ID + parentOrganizationIDContains: ID + parentOrganizationIDHasPrefix: ID + parentOrganizationIDHasSuffix: ID + parentOrganizationIDIsNil: Boolean + parentOrganizationIDNotNil: Boolean + parentOrganizationIDEqualFold: ID + parentOrganizationIDContainsFold: ID + """ + personal_org field predicates + """ + personalOrg: Boolean + personalOrgNEQ: Boolean + personalOrgIsNil: Boolean + personalOrgNotNil: Boolean + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + parent edge predicates + """ + hasParent: Boolean + hasParentWith: [OrganizationWhereInput!] + """ + children edge predicates + """ + hasChildren: Boolean + hasChildrenWith: [OrganizationWhereInput!] + """ + groups edge predicates + """ + hasGroups: Boolean + hasGroupsWith: [GroupWhereInput!] + """ + templates edge predicates + """ + hasTemplates: Boolean + hasTemplatesWith: [TemplateWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [OrganizationSettingWhereInput!] + """ + documentdata edge predicates + """ + hasDocumentdata: Boolean + hasDocumentdataWith: [DocumentDataWhereInput!] + """ + entitlements edge predicates + """ + hasEntitlements: Boolean + hasEntitlementsWith: [EntitlementWhereInput!] + """ + organization_entitlement edge predicates + """ + hasOrganizationEntitlement: Boolean + hasOrganizationEntitlementWith: [EntitlementWhereInput!] + """ + personal_access_tokens edge predicates + """ + hasPersonalAccessTokens: Boolean + hasPersonalAccessTokensWith: [PersonalAccessTokenWhereInput!] + """ + api_tokens edge predicates + """ + hasAPITokens: Boolean + hasAPITokensWith: [APITokenWhereInput!] + """ + oauthprovider edge predicates + """ + hasOauthprovider: Boolean + hasOauthproviderWith: [OauthProviderWhereInput!] + """ + users edge predicates + """ + hasUsers: Boolean + hasUsersWith: [UserWhereInput!] + """ + invites edge predicates + """ + hasInvites: Boolean + hasInvitesWith: [InviteWhereInput!] + """ + subscribers edge predicates + """ + hasSubscribers: Boolean + hasSubscribersWith: [SubscriberWhereInput!] + """ + webhooks edge predicates + """ + hasWebhooks: Boolean + hasWebhooksWith: [WebhookWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + secrets edge predicates + """ + hasSecrets: Boolean + hasSecretsWith: [HushWhereInput!] + """ + features edge predicates + """ + hasFeatures: Boolean + hasFeaturesWith: [FeatureWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + entitlementplans edge predicates + """ + hasEntitlementplans: Boolean + hasEntitlementplansWith: [EntitlementPlanWhereInput!] + """ + entitlementplanfeatures edge predicates + """ + hasEntitlementplanfeatures: Boolean + hasEntitlementplanfeaturesWith: [EntitlementPlanFeatureWhereInput!] + """ + entities edge predicates + """ + hasEntities: Boolean + hasEntitiesWith: [EntityWhereInput!] + """ + entitytypes edge predicates + """ + hasEntitytypes: Boolean + hasEntitytypesWith: [EntityTypeWhereInput!] + """ + contacts edge predicates + """ + hasContacts: Boolean + hasContactsWith: [ContactWhereInput!] + """ + notes edge predicates + """ + hasNotes: Boolean + hasNotesWith: [NoteWhereInput!] + """ + members edge predicates + """ + hasMembers: Boolean + hasMembersWith: [OrgMembershipWhereInput!] +} +""" +Information about pagination in a connection. +https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + """ + When paginating backwards, the cursor to continue. + """ + startCursor: Cursor + """ + When paginating forwards, the cursor to continue. + """ + endCursor: Cursor +} +type PersonalAccessToken implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + the name associated with the token + """ + name: String! + token: String! + """ + when the token expires + """ + expiresAt: Time + """ + a description of the token's purpose + """ + description: String + scopes: [String!] + lastUsedAt: Time + owner: User! + """ + the organization(s) the token is associated with + """ + organizations: [Organization!] + events: [Event!] +} +""" +A connection to a list of items. +""" +type PersonalAccessTokenConnection { + """ + A list of edges. + """ + edges: [PersonalAccessTokenEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type PersonalAccessTokenEdge { + """ + The item at the end of the edge. + """ + node: PersonalAccessToken + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +PersonalAccessTokenWhereInput is used for filtering PersonalAccessToken objects. +Input was generated by ent. +""" +input PersonalAccessTokenWhereInput { + not: PersonalAccessTokenWhereInput + and: [PersonalAccessTokenWhereInput!] + or: [PersonalAccessTokenWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + expires_at field predicates + """ + expiresAt: Time + expiresAtNEQ: Time + expiresAtIn: [Time!] + expiresAtNotIn: [Time!] + expiresAtGT: Time + expiresAtGTE: Time + expiresAtLT: Time + expiresAtLTE: Time + expiresAtIsNil: Boolean + expiresAtNotNil: Boolean + """ + last_used_at field predicates + """ + lastUsedAt: Time + lastUsedAtNEQ: Time + lastUsedAtIn: [Time!] + lastUsedAtNotIn: [Time!] + lastUsedAtGT: Time + lastUsedAtGTE: Time + lastUsedAtLT: Time + lastUsedAtLTE: Time + lastUsedAtIsNil: Boolean + lastUsedAtNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [UserWhereInput!] + """ + organizations edge predicates + """ + hasOrganizations: Boolean + hasOrganizationsWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type Query { + """ + Fetches an object given its ID. + """ + node( + """ + ID of the object. + """ + id: ID! + ): Node + """ + Lookup nodes by a list of IDs. + """ + nodes( + """ + The list of node IDs. + """ + ids: [ID!]! + ): [Node]! + apiTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for APITokens returned from the connection. + """ + where: APITokenWhereInput + ): APITokenConnection! + contacts( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Contacts returned from the connection. + """ + where: ContactWhereInput + ): ContactConnection! + contactHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for ContactHistories returned from the connection. + """ + where: ContactHistoryWhereInput + ): ContactHistoryConnection! + documentDataSlice( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for DocumentDataSlice returned from the connection. + """ + where: DocumentDataWhereInput + ): DocumentDataConnection! + documentDataHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for DocumentDataHistories returned from the connection. + """ + where: DocumentDataHistoryWhereInput + ): DocumentDataHistoryConnection! + entitlements( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Entitlements returned from the connection. + """ + where: EntitlementWhereInput + ): EntitlementConnection! + entitlementHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementHistories returned from the connection. + """ + where: EntitlementHistoryWhereInput + ): EntitlementHistoryConnection! + entitlementPlans( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlans returned from the connection. + """ + where: EntitlementPlanWhereInput + ): EntitlementPlanConnection! + entitlementPlanFeatures( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanFeatures returned from the connection. + """ + where: EntitlementPlanFeatureWhereInput + ): EntitlementPlanFeatureConnection! + entitlementPlanFeatureHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanFeatureHistories returned from the connection. + """ + where: EntitlementPlanFeatureHistoryWhereInput + ): EntitlementPlanFeatureHistoryConnection! + entitlementPlanHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EntitlementPlanHistories returned from the connection. + """ + where: EntitlementPlanHistoryWhereInput + ): EntitlementPlanHistoryConnection! + entities( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Entities returned from the connection. + """ + orderBy: EntityOrder + + """ + Filtering options for Entities returned from the connection. + """ + where: EntityWhereInput + ): EntityConnection! + entityHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityHistories returned from the connection. + """ + orderBy: EntityHistoryOrder + + """ + Filtering options for EntityHistories returned from the connection. + """ + where: EntityHistoryWhereInput + ): EntityHistoryConnection! + entityTypes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityTypes returned from the connection. + """ + orderBy: EntityTypeOrder + + """ + Filtering options for EntityTypes returned from the connection. + """ + where: EntityTypeWhereInput + ): EntityTypeConnection! + entityTypeHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for EntityTypeHistories returned from the connection. + """ + orderBy: EntityTypeHistoryOrder + + """ + Filtering options for EntityTypeHistories returned from the connection. + """ + where: EntityTypeHistoryWhereInput + ): EntityTypeHistoryConnection! + events( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Events returned from the connection. + """ + where: EventWhereInput + ): EventConnection! + eventHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for EventHistories returned from the connection. + """ + where: EventHistoryWhereInput + ): EventHistoryConnection! + features( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Features returned from the connection. + """ + where: FeatureWhereInput + ): FeatureConnection! + featureHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for FeatureHistories returned from the connection. + """ + where: FeatureHistoryWhereInput + ): FeatureHistoryConnection! + files( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Files returned from the connection. + """ + where: FileWhereInput + ): FileConnection! + fileHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for FileHistories returned from the connection. + """ + where: FileHistoryWhereInput + ): FileHistoryConnection! + groups( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Groups returned from the connection. + """ + orderBy: GroupOrder + + """ + Filtering options for Groups returned from the connection. + """ + where: GroupWhereInput + ): GroupConnection! + groupHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for GroupHistories returned from the connection. + """ + orderBy: GroupHistoryOrder + + """ + Filtering options for GroupHistories returned from the connection. + """ + where: GroupHistoryWhereInput + ): GroupHistoryConnection! + groupMemberships( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupMemberships returned from the connection. + """ + where: GroupMembershipWhereInput + ): GroupMembershipConnection! + groupMembershipHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupMembershipHistories returned from the connection. + """ + where: GroupMembershipHistoryWhereInput + ): GroupMembershipHistoryConnection! + groupSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupSettings returned from the connection. + """ + where: GroupSettingWhereInput + ): GroupSettingConnection! + groupSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for GroupSettingHistories returned from the connection. + """ + where: GroupSettingHistoryWhereInput + ): GroupSettingHistoryConnection! + hushes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Hushes returned from the connection. + """ + orderBy: HushOrder + + """ + Filtering options for Hushes returned from the connection. + """ + where: HushWhereInput + ): HushConnection! + hushHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for HushHistories returned from the connection. + """ + orderBy: HushHistoryOrder + + """ + Filtering options for HushHistories returned from the connection. + """ + where: HushHistoryWhereInput + ): HushHistoryConnection! + integrations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Integrations returned from the connection. + """ + orderBy: IntegrationOrder + + """ + Filtering options for Integrations returned from the connection. + """ + where: IntegrationWhereInput + ): IntegrationConnection! + integrationHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for IntegrationHistories returned from the connection. + """ + orderBy: IntegrationHistoryOrder + + """ + Filtering options for IntegrationHistories returned from the connection. + """ + where: IntegrationHistoryWhereInput + ): IntegrationHistoryConnection! + invites( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Invites returned from the connection. + """ + where: InviteWhereInput + ): InviteConnection! + notes( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Notes returned from the connection. + """ + where: NoteWhereInput + ): NoteConnection! + noteHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for NoteHistories returned from the connection. + """ + where: NoteHistoryWhereInput + ): NoteHistoryConnection! + oauthProviders( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OauthProviders returned from the connection. + """ + where: OauthProviderWhereInput + ): OauthProviderConnection! + oauthProviderHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OauthProviderHistories returned from the connection. + """ + where: OauthProviderHistoryWhereInput + ): OauthProviderHistoryConnection! + ohAuthTooTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OhAuthTooTokens returned from the connection. + """ + where: OhAuthTooTokenWhereInput + ): OhAuthTooTokenConnection! + orgMemberships( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrgMemberships returned from the connection. + """ + where: OrgMembershipWhereInput + ): OrgMembershipConnection! + orgMembershipHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrgMembershipHistories returned from the connection. + """ + where: OrgMembershipHistoryWhereInput + ): OrgMembershipHistoryConnection! + organizations( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Organizations returned from the connection. + """ + orderBy: OrganizationOrder + + """ + Filtering options for Organizations returned from the connection. + """ + where: OrganizationWhereInput + ): OrganizationConnection! + organizationHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for OrganizationHistories returned from the connection. + """ + orderBy: OrganizationHistoryOrder + + """ + Filtering options for OrganizationHistories returned from the connection. + """ + where: OrganizationHistoryWhereInput + ): OrganizationHistoryConnection! + organizationSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrganizationSettings returned from the connection. + """ + where: OrganizationSettingWhereInput + ): OrganizationSettingConnection! + organizationSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for OrganizationSettingHistories returned from the connection. + """ + where: OrganizationSettingHistoryWhereInput + ): OrganizationSettingHistoryConnection! + personalAccessTokens( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for PersonalAccessTokens returned from the connection. + """ + where: PersonalAccessTokenWhereInput + ): PersonalAccessTokenConnection! + subscribers( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for Subscribers returned from the connection. + """ + where: SubscriberWhereInput + ): SubscriberConnection! + tfaSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for TFASettings returned from the connection. + """ + where: TFASettingWhereInput + ): TFASettingConnection! + templates( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Templates returned from the connection. + """ + orderBy: TemplateOrder + + """ + Filtering options for Templates returned from the connection. + """ + where: TemplateWhereInput + ): TemplateConnection! + templateHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for TemplateHistories returned from the connection. + """ + orderBy: TemplateHistoryOrder + + """ + Filtering options for TemplateHistories returned from the connection. + """ + where: TemplateHistoryWhereInput + ): TemplateHistoryConnection! + users( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Users returned from the connection. + """ + orderBy: UserOrder + + """ + Filtering options for Users returned from the connection. + """ + where: UserWhereInput + ): UserConnection! + userHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for UserHistories returned from the connection. + """ + orderBy: UserHistoryOrder + + """ + Filtering options for UserHistories returned from the connection. + """ + where: UserHistoryWhereInput + ): UserHistoryConnection! + userSettings( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for UserSettings returned from the connection. + """ + where: UserSettingWhereInput + ): UserSettingConnection! + userSettingHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Filtering options for UserSettingHistories returned from the connection. + """ + where: UserSettingHistoryWhereInput + ): UserSettingHistoryConnection! + webhooks( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for Webhooks returned from the connection. + """ + orderBy: WebhookOrder + + """ + Filtering options for Webhooks returned from the connection. + """ + where: WebhookWhereInput + ): WebhookConnection! + webhookHistories( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: Cursor + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: Cursor + + """ + Returns the last _n_ elements from the list. + """ + last: Int + + """ + Ordering options for WebhookHistories returned from the connection. + """ + orderBy: WebhookHistoryOrder + + """ + Filtering options for WebhookHistories returned from the connection. + """ + where: WebhookHistoryWhereInput + ): WebhookHistoryConnection! +} +type Subscriber implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + email address of the subscriber + """ + email: String! + """ + phone number of the subscriber + """ + phoneNumber: String + """ + indicates if the email address has been verified + """ + verifiedEmail: Boolean! + """ + indicates if the phone number has been verified + """ + verifiedPhone: Boolean! + """ + indicates if the subscriber is active or not, active users will have at least one verified contact method + """ + active: Boolean! + owner: Organization + events: [Event!] +} +""" +A connection to a list of items. +""" +type SubscriberConnection { + """ + A list of edges. + """ + edges: [SubscriberEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type SubscriberEdge { + """ + The item at the end of the edge. + """ + node: Subscriber + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +SubscriberWhereInput is used for filtering Subscriber objects. +Input was generated by ent. +""" +input SubscriberWhereInput { + not: SubscriberWhereInput + and: [SubscriberWhereInput!] + or: [SubscriberWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + phone_number field predicates + """ + phoneNumber: String + phoneNumberNEQ: String + phoneNumberIn: [String!] + phoneNumberNotIn: [String!] + phoneNumberGT: String + phoneNumberGTE: String + phoneNumberLT: String + phoneNumberLTE: String + phoneNumberContains: String + phoneNumberHasPrefix: String + phoneNumberHasSuffix: String + phoneNumberIsNil: Boolean + phoneNumberNotNil: Boolean + phoneNumberEqualFold: String + phoneNumberContainsFold: String + """ + verified_email field predicates + """ + verifiedEmail: Boolean + verifiedEmailNEQ: Boolean + """ + verified_phone field predicates + """ + verifiedPhone: Boolean + verifiedPhoneNEQ: Boolean + """ + active field predicates + """ + active: Boolean + activeNEQ: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] +} +type TFASetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + TFA secret for the user + """ + tfaSecret: String + """ + specifies if the TFA device has been verified + """ + verified: Boolean! + """ + recovery codes for 2fa + """ + recoveryCodes: [String!] + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + owner: User +} +""" +A connection to a list of items. +""" +type TFASettingConnection { + """ + A list of edges. + """ + edges: [TFASettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type TFASettingEdge { + """ + The item at the end of the edge. + """ + node: TFASetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +TFASettingWhereInput is used for filtering TFASetting objects. +Input was generated by ent. +""" +input TFASettingWhereInput { + not: TFASettingWhereInput + and: [TFASettingWhereInput!] + or: [TFASettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + tfa_secret field predicates + """ + tfaSecret: String + tfaSecretNEQ: String + tfaSecretIn: [String!] + tfaSecretNotIn: [String!] + tfaSecretGT: String + tfaSecretGTE: String + tfaSecretLT: String + tfaSecretLTE: String + tfaSecretContains: String + tfaSecretHasPrefix: String + tfaSecretHasSuffix: String + tfaSecretIsNil: Boolean + tfaSecretNotNil: Boolean + tfaSecretEqualFold: String + tfaSecretContainsFold: String + """ + verified field predicates + """ + verified: Boolean + verifiedNEQ: Boolean + """ + totp_allowed field predicates + """ + totpAllowed: Boolean + totpAllowedNEQ: Boolean + totpAllowedIsNil: Boolean + totpAllowedNotNil: Boolean + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [UserWhereInput!] +} +type Template implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType! + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON + owner: Organization + documents: [DocumentData!] +} +""" +A connection to a list of items. +""" +type TemplateConnection { + """ + A list of edges. + """ + edges: [TemplateEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +TemplateDocumentType is enum for the field template_type +""" +enum TemplateDocumentType @goModel(model: "github.com/theopenlane/core/pkg/enums.DocumentType") { + ROOTTEMPLATE + DOCUMENT +} +""" +An edge in a connection. +""" +type TemplateEdge { + """ + The item at the end of the edge. + """ + node: Template + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type TemplateHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: TemplateHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the template + """ + name: String! + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateHistoryDocumentType! + """ + the description of the template + """ + description: String + """ + the jsonschema object of the template + """ + jsonconfig: JSON! + """ + the uischema for the template to render in the UI + """ + uischema: JSON +} +""" +A connection to a list of items. +""" +type TemplateHistoryConnection { + """ + A list of edges. + """ + edges: [TemplateHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +TemplateHistoryDocumentType is enum for the field template_type +""" +enum TemplateHistoryDocumentType @goModel(model: "github.com/theopenlane/core/pkg/enums.DocumentType") { + ROOTTEMPLATE + DOCUMENT +} +""" +An edge in a connection. +""" +type TemplateHistoryEdge { + """ + The item at the end of the edge. + """ + node: TemplateHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +TemplateHistoryOpType is enum for the field operation +""" +enum TemplateHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for TemplateHistory connections +""" +input TemplateHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order TemplateHistories. + """ + field: TemplateHistoryOrderField! +} +""" +Properties by which TemplateHistory connections can be ordered. +""" +enum TemplateHistoryOrderField { + name +} +""" +TemplateHistoryWhereInput is used for filtering TemplateHistory objects. +Input was generated by ent. +""" +input TemplateHistoryWhereInput { + not: TemplateHistoryWhereInput + and: [TemplateHistoryWhereInput!] + or: [TemplateHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: TemplateHistoryOpType + operationNEQ: TemplateHistoryOpType + operationIn: [TemplateHistoryOpType!] + operationNotIn: [TemplateHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + template_type field predicates + """ + templateType: TemplateHistoryDocumentType + templateTypeNEQ: TemplateHistoryDocumentType + templateTypeIn: [TemplateHistoryDocumentType!] + templateTypeNotIn: [TemplateHistoryDocumentType!] + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String +} +""" +Ordering options for Template connections +""" +input TemplateOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Templates. + """ + field: TemplateOrderField! +} +""" +Properties by which Template connections can be ordered. +""" +enum TemplateOrderField { + name +} +""" +TemplateWhereInput is used for filtering Template objects. +Input was generated by ent. +""" +input TemplateWhereInput { + not: TemplateWhereInput + and: [TemplateWhereInput!] + or: [TemplateWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + template_type field predicates + """ + templateType: TemplateDocumentType + templateTypeNEQ: TemplateDocumentType + templateTypeIn: [TemplateDocumentType!] + templateTypeNotIn: [TemplateDocumentType!] + """ + description field predicates + """ + description: String + descriptionNEQ: String + descriptionIn: [String!] + descriptionNotIn: [String!] + descriptionGT: String + descriptionGTE: String + descriptionLT: String + descriptionLTE: String + descriptionContains: String + descriptionHasPrefix: String + descriptionHasSuffix: String + descriptionIsNil: Boolean + descriptionNotNil: Boolean + descriptionEqualFold: String + descriptionContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + documents edge predicates + """ + hasDocuments: Boolean + hasDocumentsWith: [DocumentDataWhereInput!] +} +""" +The builtin Time type +""" +scalar Time +""" +The builtin Uint type +""" +scalar Uint +""" +UpdateAPITokenInput is used for update APIToken object. +Input was generated by ent. +""" +input UpdateAPITokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name associated with the token + """ + name: String + """ + a description of the token's purpose + """ + description: String + clearDescription: Boolean + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + lastUsedAt: Time + clearLastUsedAt: Boolean + ownerID: ID + clearOwner: Boolean +} +""" +UpdateContactInput is used for update Contact object. +Input was generated by ent. +""" +input UpdateContactInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the full name of the contact + """ + fullName: String + """ + the title of the contact + """ + title: String + clearTitle: Boolean + """ + the company of the contact + """ + company: String + clearCompany: Boolean + """ + the email of the contact + """ + email: String + clearEmail: Boolean + """ + the phone number of the contact + """ + phoneNumber: String + clearPhoneNumber: Boolean + """ + the address of the contact + """ + address: String + clearAddress: Boolean + """ + status of the contact + """ + status: ContactUserStatus + ownerID: ID + clearOwner: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean +} +""" +UpdateDocumentDataInput is used for update DocumentData object. +Input was generated by ent. +""" +input UpdateDocumentDataInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the json data of the document + """ + data: JSON + ownerID: ID + clearOwner: Boolean + templateID: ID + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntity: Boolean +} +""" +UpdateEntitlementInput is used for update Entitlement object. +Input was generated by ent. +""" +input UpdateEntitlementInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + used to store references to external systems, e.g. Stripe + """ + externalCustomerID: String + clearExternalCustomerID: Boolean + """ + used to store references to external systems, e.g. Stripe + """ + externalSubscriptionID: String + clearExternalSubscriptionID: Boolean + """ + the time at which a customer's entitlement will expire, e.g. they've cancelled but paid through the end of the month + """ + expiresAt: Time + clearExpiresAt: Boolean + """ + whether or not the customer has cancelled their entitlement - usually used in conjunction with expires and expires at + """ + cancelled: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntitlementPlanFeatureInput is used for update EntitlementPlanFeature object. +Input was generated by ent. +""" +input UpdateEntitlementPlanFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + metadata for the entitlement plan feature such as usage limits + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntitlementPlanInput is used for update EntitlementPlan object. +Input was generated by ent. +""" +input UpdateEntitlementPlanInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the displayed 'friendly' name of the plan + """ + displayName: String + clearDisplayName: Boolean + """ + a description of the plan + """ + description: String + clearDescription: Boolean + """ + metadata for the plan + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlements: Boolean + addBaseFeatureIDs: [ID!] + removeBaseFeatureIDs: [ID!] + clearBaseFeatures: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateEntityInput is used for update Entity object. +Input was generated by ent. +""" +input UpdateEntityInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the entity + """ + name: String + clearName: Boolean + """ + The entity's displayed 'friendly' name + """ + displayName: String + clearDisplayName: Boolean + """ + An optional description of the entity + """ + description: String + clearDescription: Boolean + """ + domains associated with the entity + """ + domains: [String!] + appendDomains: [String!] + clearDomains: Boolean + """ + status of the entity + """ + status: String + clearStatus: Boolean + ownerID: ID + clearOwner: Boolean + addContactIDs: [ID!] + removeContactIDs: [ID!] + clearContacts: Boolean + addDocumentIDs: [ID!] + removeDocumentIDs: [ID!] + clearDocuments: Boolean + addNoteIDs: [ID!] + removeNoteIDs: [ID!] + clearNotes: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + entityTypeID: ID + clearEntityType: Boolean +} +""" +UpdateEntityTypeInput is used for update EntityType object. +Input was generated by ent. +""" +input UpdateEntityTypeInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the entity + """ + name: String + ownerID: ID + clearOwner: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean +} +""" +UpdateEventInput is used for update Event object. +Input was generated by ent. +""" +input UpdateEventInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + eventID: String + clearEventID: Boolean + correlationID: String + clearCorrelationID: Boolean + eventType: String + metadata: Map + clearMetadata: Boolean + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUser: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroup: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegration: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addInviteIDs: [ID!] + removeInviteIDs: [ID!] + clearInvite: Boolean + addFeatureIDs: [ID!] + removeFeatureIDs: [ID!] + clearFeature: Boolean + addEntitlementplanIDs: [ID!] + removeEntitlementplanIDs: [ID!] + clearEntitlementplan: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessToken: Boolean + addOauth2tokenIDs: [ID!] + removeOauth2tokenIDs: [ID!] + clearOauth2token: Boolean + addHushIDs: [ID!] + removeHushIDs: [ID!] + clearHush: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlement: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhook: Boolean + addSubscriberIDs: [ID!] + removeSubscriberIDs: [ID!] + clearSubscriber: Boolean +} +""" +UpdateFeatureInput is used for update Feature object. +Input was generated by ent. +""" +input UpdateFeatureInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the displayed 'friendly' name of the feature + """ + displayName: String + clearDisplayName: Boolean + """ + enabled features are available for use + """ + enabled: Boolean + """ + a description of the feature + """ + description: String + clearDescription: Boolean + """ + metadata for the feature + """ + metadata: Map + clearMetadata: Boolean + ownerID: ID + clearOwner: Boolean + addPlanIDs: [ID!] + removePlanIDs: [ID!] + clearPlans: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateFileInput is used for update File object. +Input was generated by ent. +""" +input UpdateFileInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + fileName: String + fileExtension: String + fileSize: Int + clearFileSize: Boolean + contentType: String + storeKey: String + category: String + clearCategory: Boolean + annotation: String + clearAnnotation: Boolean + userID: ID + clearUser: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntity: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroup: Boolean +} +""" +UpdateGroupInput is used for update Group object. +Input was generated by ent. +""" +input UpdateGroupInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the group - must be unique within the organization + """ + name: String + """ + the groups description + """ + description: String + clearDescription: Boolean + """ + the URL to an auto generated gravatar image for the group + """ + gravatarLogoURL: String + clearGravatarLogoURL: Boolean + """ + the URL to an image uploaded by the customer for the groups avatar image + """ + logoURL: String + clearLogoURL: Boolean + """ + The group's displayed 'friendly' name + """ + displayName: String + ownerID: ID + clearOwner: Boolean + settingID: ID + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUsers: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean +} +""" +UpdateGroupMembershipInput is used for update GroupMembership object. +Input was generated by ent. +""" +input UpdateGroupMembershipInput { + role: GroupMembershipRole + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateGroupSettingInput is used for update GroupSetting object. +Input was generated by ent. +""" +input UpdateGroupSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + whether the group is visible to it's members / owners only or if it's searchable by anyone within the organization + """ + visibility: GroupSettingVisibility + """ + the policy governing ability to freely join a group, whether it requires an invitation, application, or either + """ + joinPolicy: GroupSettingJoinPolicy + """ + whether to sync group members to slack groups + """ + syncToSlack: Boolean + clearSyncToSlack: Boolean + """ + whether to sync group members to github groups + """ + syncToGithub: Boolean + clearSyncToGithub: Boolean + groupID: ID + clearGroup: Boolean +} +""" +UpdateHushInput is used for update Hush object. +Input was generated by ent. +""" +input UpdateHushInput { + """ + the logical name of the corresponding hush secret or it's general grouping + """ + name: String + """ + a description of the hush value or purpose, such as github PAT + """ + description: String + clearDescription: Boolean + """ + the kind of secret, such as sshkey, certificate, api token, etc. + """ + kind: String + clearKind: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganization: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateIntegrationInput is used for update Integration object. +Input was generated by ent. +""" +input UpdateIntegrationInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the integration - must be unique within the organization + """ + name: String + """ + a description of the integration + """ + description: String + clearDescription: Boolean + kind: String + clearKind: Boolean + ownerID: ID + clearOwner: Boolean + addSecretIDs: [ID!] + removeSecretIDs: [ID!] + clearSecrets: Boolean + addOauth2tokenIDs: [ID!] + removeOauth2tokenIDs: [ID!] + clearOauth2tokens: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhooks: Boolean +} +""" +UpdateInviteInput is used for update Invite object. +Input was generated by ent. +""" +input UpdateInviteInput { + """ + the expiration date of the invitation token which defaults to 14 days in the future from creation + """ + expires: Time + clearExpires: Boolean + """ + the status of the invitation + """ + status: InviteInviteStatus + role: InviteRole + """ + the number of attempts made to perform email send of the invitation, maximum of 5 + """ + sendAttempts: Int + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateNoteInput is used for update Note object. +Input was generated by ent. +""" +input UpdateNoteInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the text of the note + """ + text: String + ownerID: ID + clearOwner: Boolean + entityID: ID + clearEntity: Boolean +} +""" +UpdateOauthProviderInput is used for update OauthProvider object. +Input was generated by ent. +""" +input UpdateOauthProviderInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the oauth provider's name + """ + name: String + """ + the client id for the oauth provider + """ + clientID: String + """ + the client secret + """ + clientSecret: String + """ + the redirect url + """ + redirectURL: String + """ + the scopes + """ + scopes: String + """ + the auth url of the provider + """ + authURL: String + """ + the token url of the provider + """ + tokenURL: String + """ + the auth style, 0: auto detect 1: third party log in 2: log in with username and password + """ + authStyle: Uint + """ + the URL to request user information by token + """ + infoURL: String + ownerID: ID + clearOwner: Boolean +} +""" +UpdateOhAuthTooTokenInput is used for update OhAuthTooToken object. +Input was generated by ent. +""" +input UpdateOhAuthTooTokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + clientID: String + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + nonce: String + claimsUserID: String + claimsUsername: String + claimsEmail: String + claimsEmailVerified: Boolean + claimsGroups: [String!] + appendClaimsGroups: [String!] + clearClaimsGroups: Boolean + claimsPreferredUsername: String + connectorID: String + connectorData: [String!] + appendConnectorData: [String!] + clearConnectorData: Boolean + lastUsed: Time + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegration: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateOrgMembershipInput is used for update OrgMembership object. +Input was generated by ent. +""" +input UpdateOrgMembershipInput { + role: OrgMembershipRole + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateOrganizationInput is used for update Organization object. +Input was generated by ent. +""" +input UpdateOrganizationInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the organization + """ + name: String + """ + The organization's displayed 'friendly' name + """ + displayName: String + """ + An optional description of the organization + """ + description: String + clearDescription: Boolean + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + clearAvatarRemoteURL: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroups: Boolean + addTemplateIDs: [ID!] + removeTemplateIDs: [ID!] + clearTemplates: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean + settingID: ID + clearSetting: Boolean + addDocumentdatumIDs: [ID!] + removeDocumentdatumIDs: [ID!] + clearDocumentdata: Boolean + addEntitlementIDs: [ID!] + removeEntitlementIDs: [ID!] + clearEntitlements: Boolean + addOrganizationEntitlementIDs: [ID!] + removeOrganizationEntitlementIDs: [ID!] + clearOrganizationEntitlement: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessTokens: Boolean + addAPITokenIDs: [ID!] + removeAPITokenIDs: [ID!] + clearAPITokens: Boolean + addOauthproviderIDs: [ID!] + removeOauthproviderIDs: [ID!] + clearOauthprovider: Boolean + addUserIDs: [ID!] + removeUserIDs: [ID!] + clearUsers: Boolean + addInviteIDs: [ID!] + removeInviteIDs: [ID!] + clearInvites: Boolean + addSubscriberIDs: [ID!] + removeSubscriberIDs: [ID!] + clearSubscribers: Boolean + addWebhookIDs: [ID!] + removeWebhookIDs: [ID!] + clearWebhooks: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addSecretIDs: [ID!] + removeSecretIDs: [ID!] + clearSecrets: Boolean + addFeatureIDs: [ID!] + removeFeatureIDs: [ID!] + clearFeatures: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + addEntitlementplanIDs: [ID!] + removeEntitlementplanIDs: [ID!] + clearEntitlementplans: Boolean + addEntityIDs: [ID!] + removeEntityIDs: [ID!] + clearEntities: Boolean + addEntitytypeIDs: [ID!] + removeEntitytypeIDs: [ID!] + clearEntitytypes: Boolean + addContactIDs: [ID!] + removeContactIDs: [ID!] + clearContacts: Boolean + addNoteIDs: [ID!] + removeNoteIDs: [ID!] + clearNotes: Boolean +} +""" +UpdateOrganizationSettingInput is used for update OrganizationSetting object. +Input was generated by ent. +""" +input UpdateOrganizationSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + domains associated with the organization + """ + domains: [String!] + appendDomains: [String!] + clearDomains: Boolean + """ + Name of the person to contact for billing + """ + billingContact: String + clearBillingContact: Boolean + """ + Email address of the person to contact for billing + """ + billingEmail: String + clearBillingEmail: Boolean + """ + Phone number to contact for billing + """ + billingPhone: String + clearBillingPhone: Boolean + """ + Address to send billing information to + """ + billingAddress: String + clearBillingAddress: Boolean + """ + Usually government-issued tax ID or business ID such as ABN in Australia + """ + taxIdentifier: String + clearTaxIdentifier: Boolean + """ + geographical location of the organization + """ + geoLocation: OrganizationSettingRegion + clearGeoLocation: Boolean + organizationID: ID + clearOrganization: Boolean +} +""" +UpdatePersonalAccessTokenInput is used for update PersonalAccessToken object. +Input was generated by ent. +""" +input UpdatePersonalAccessTokenInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name associated with the token + """ + name: String + """ + a description of the token's purpose + """ + description: String + clearDescription: Boolean + scopes: [String!] + appendScopes: [String!] + clearScopes: Boolean + lastUsedAt: Time + clearLastUsedAt: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganizations: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateSubscriberInput is used for update Subscriber object. +Input was generated by ent. +""" +input UpdateSubscriberInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + email address of the subscriber + """ + email: String + """ + phone number of the subscriber + """ + phoneNumber: String + clearPhoneNumber: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateTFASettingInput is used for update TFASetting object. +Input was generated by ent. +""" +input UpdateTFASettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + specifies if the TFA device has been verified + """ + verified: Boolean + """ + specifies a user may complete authentication by verifying a TOTP code delivered through an authenticator app + """ + totpAllowed: Boolean + clearTotpAllowed: Boolean +} +""" +UpdateTemplateInput is used for update Template object. +Input was generated by ent. +""" +input UpdateTemplateInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the template + """ + name: String + """ + the type of the template, either a provided template or an implementation (document) + """ + templateType: TemplateDocumentType + """ + the description of the template + """ + description: String + clearDescription: Boolean + """ + the jsonschema object of the template + """ + jsonconfig: JSON + """ + the uischema for the template to render in the UI + """ + uischema: JSON + clearUischema: Boolean + ownerID: ID + clearOwner: Boolean + addDocumentIDs: [ID!] + removeDocumentIDs: [ID!] + clearDocuments: Boolean +} +""" +UpdateUserInput is used for update User object. +Input was generated by ent. +""" +input UpdateUserInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + email: String + firstName: String + clearFirstName: Boolean + lastName: String + clearLastName: Boolean + """ + The user's displayed 'friendly' name + """ + displayName: String + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + clearAvatarRemoteURL: Boolean + """ + The user's local avatar file + """ + avatarLocalFile: String + clearAvatarLocalFile: Boolean + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + clearAvatarUpdatedAt: Boolean + """ + the time the user was last seen + """ + lastSeen: Time + clearLastSeen: Boolean + """ + user password hash + """ + password: String + clearPassword: Boolean + """ + the Subject of the user JWT + """ + sub: String + clearSub: Boolean + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider + """ + the user's role + """ + role: UserRole + clearRole: Boolean + addPersonalAccessTokenIDs: [ID!] + removePersonalAccessTokenIDs: [ID!] + clearPersonalAccessTokens: Boolean + addTfaSettingIDs: [ID!] + removeTfaSettingIDs: [ID!] + clearTfaSettings: Boolean + settingID: ID + addEmailVerificationTokenIDs: [ID!] + removeEmailVerificationTokenIDs: [ID!] + clearEmailVerificationTokens: Boolean + addPasswordResetTokenIDs: [ID!] + removePasswordResetTokenIDs: [ID!] + clearPasswordResetTokens: Boolean + addGroupIDs: [ID!] + removeGroupIDs: [ID!] + clearGroups: Boolean + addOrganizationIDs: [ID!] + removeOrganizationIDs: [ID!] + clearOrganizations: Boolean + addWebauthnIDs: [ID!] + removeWebauthnIDs: [ID!] + clearWebauthn: Boolean + addFileIDs: [ID!] + removeFileIDs: [ID!] + clearFiles: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean +} +""" +UpdateUserSettingInput is used for update UserSetting object. +Input was generated by ent. +""" +input UpdateUserSettingInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + clearSilencedAt: Boolean + """ + The time the user was suspended + """ + suspendedAt: Time + clearSuspendedAt: Boolean + """ + status of the user account + """ + status: UserSettingUserStatus + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + clearIsWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + clearIsTfaEnabled: Boolean + userID: ID + clearUser: Boolean + defaultOrgID: ID + clearDefaultOrg: Boolean +} +""" +UpdateWebhookInput is used for update Webhook object. +Input was generated by ent. +""" +input UpdateWebhookInput { + """ + tags associated with the object + """ + tags: [String!] + appendTags: [String!] + clearTags: Boolean + """ + the name of the webhook + """ + name: String + """ + a description of the webhook + """ + description: String + clearDescription: Boolean + """ + the url to send the webhook to + """ + destinationURL: String + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean + """ + the number of failures + """ + failures: Int + clearFailures: Boolean + """ + the last error message + """ + lastError: String + clearLastError: Boolean + """ + the last response + """ + lastResponse: String + clearLastResponse: Boolean + ownerID: ID + clearOwner: Boolean + addEventIDs: [ID!] + removeEventIDs: [ID!] + clearEvents: Boolean + addIntegrationIDs: [ID!] + removeIntegrationIDs: [ID!] + clearIntegrations: Boolean +} +type User implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserAuthProvider! + """ + the user's role + """ + role: UserRole + personalAccessTokens: [PersonalAccessToken!] + tfaSettings: [TFASetting!] + setting: UserSetting! + groups: [Group!] + organizations: [Organization!] + files: [File!] + events: [Event!] + groupMemberships: [GroupMembership!] + orgMemberships: [OrgMembership!] +} +""" +UserAuthProvider is enum for the field auth_provider +""" +enum UserAuthProvider @goModel(model: "github.com/theopenlane/core/pkg/enums.AuthProvider") { + CREDENTIALS + GOOGLE + GITHUB + WEBAUTHN +} +""" +A connection to a list of items. +""" +type UserConnection { + """ + A list of edges. + """ + edges: [UserEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserEdge { + """ + The item at the end of the edge. + """ + node: User + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type UserHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: UserHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + deletedAt: Time + deletedBy: String + """ + tags associated with the object + """ + tags: [String!] + email: String! + firstName: String + lastName: String + """ + The user's displayed 'friendly' name + """ + displayName: String! + """ + URL of the user's remote avatar + """ + avatarRemoteURL: String + """ + The user's local avatar file + """ + avatarLocalFile: String + """ + The time the user's (local) avatar was last updated + """ + avatarUpdatedAt: Time + """ + the time the user was last seen + """ + lastSeen: Time + """ + the Subject of the user JWT + """ + sub: String + """ + auth provider used to register the account + """ + authProvider: UserHistoryAuthProvider! + """ + the user's role + """ + role: UserHistoryRole +} +""" +UserHistoryAuthProvider is enum for the field auth_provider +""" +enum UserHistoryAuthProvider @goModel(model: "github.com/theopenlane/core/pkg/enums.AuthProvider") { + CREDENTIALS + GOOGLE + GITHUB + WEBAUTHN +} +""" +A connection to a list of items. +""" +type UserHistoryConnection { + """ + A list of edges. + """ + edges: [UserHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserHistoryEdge { + """ + The item at the end of the edge. + """ + node: UserHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +UserHistoryOpType is enum for the field operation +""" +enum UserHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for UserHistory connections +""" +input UserHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order UserHistories. + """ + field: UserHistoryOrderField! +} +""" +Properties by which UserHistory connections can be ordered. +""" +enum UserHistoryOrderField { + first_name + last_name + display_name +} +""" +UserHistoryRole is enum for the field role +""" +enum UserHistoryRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +""" +UserHistoryWhereInput is used for filtering UserHistory objects. +Input was generated by ent. +""" +input UserHistoryWhereInput { + not: UserHistoryWhereInput + and: [UserHistoryWhereInput!] + or: [UserHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: UserHistoryOpType + operationNEQ: UserHistoryOpType + operationIn: [UserHistoryOpType!] + operationNotIn: [UserHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + first_name field predicates + """ + firstName: String + firstNameNEQ: String + firstNameIn: [String!] + firstNameNotIn: [String!] + firstNameGT: String + firstNameGTE: String + firstNameLT: String + firstNameLTE: String + firstNameContains: String + firstNameHasPrefix: String + firstNameHasSuffix: String + firstNameIsNil: Boolean + firstNameNotNil: Boolean + firstNameEqualFold: String + firstNameContainsFold: String + """ + last_name field predicates + """ + lastName: String + lastNameNEQ: String + lastNameIn: [String!] + lastNameNotIn: [String!] + lastNameGT: String + lastNameGTE: String + lastNameLT: String + lastNameLTE: String + lastNameContains: String + lastNameHasPrefix: String + lastNameHasSuffix: String + lastNameIsNil: Boolean + lastNameNotNil: Boolean + lastNameEqualFold: String + lastNameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + avatar_local_file field predicates + """ + avatarLocalFile: String + avatarLocalFileNEQ: String + avatarLocalFileIn: [String!] + avatarLocalFileNotIn: [String!] + avatarLocalFileGT: String + avatarLocalFileGTE: String + avatarLocalFileLT: String + avatarLocalFileLTE: String + avatarLocalFileContains: String + avatarLocalFileHasPrefix: String + avatarLocalFileHasSuffix: String + avatarLocalFileIsNil: Boolean + avatarLocalFileNotNil: Boolean + avatarLocalFileEqualFold: String + avatarLocalFileContainsFold: String + """ + avatar_updated_at field predicates + """ + avatarUpdatedAt: Time + avatarUpdatedAtNEQ: Time + avatarUpdatedAtIn: [Time!] + avatarUpdatedAtNotIn: [Time!] + avatarUpdatedAtGT: Time + avatarUpdatedAtGTE: Time + avatarUpdatedAtLT: Time + avatarUpdatedAtLTE: Time + avatarUpdatedAtIsNil: Boolean + avatarUpdatedAtNotNil: Boolean + """ + last_seen field predicates + """ + lastSeen: Time + lastSeenNEQ: Time + lastSeenIn: [Time!] + lastSeenNotIn: [Time!] + lastSeenGT: Time + lastSeenGTE: Time + lastSeenLT: Time + lastSeenLTE: Time + lastSeenIsNil: Boolean + lastSeenNotNil: Boolean + """ + sub field predicates + """ + sub: String + subNEQ: String + subIn: [String!] + subNotIn: [String!] + subGT: String + subGTE: String + subLT: String + subLTE: String + subContains: String + subHasPrefix: String + subHasSuffix: String + subIsNil: Boolean + subNotNil: Boolean + subEqualFold: String + subContainsFold: String + """ + auth_provider field predicates + """ + authProvider: UserHistoryAuthProvider + authProviderNEQ: UserHistoryAuthProvider + authProviderIn: [UserHistoryAuthProvider!] + authProviderNotIn: [UserHistoryAuthProvider!] + """ + role field predicates + """ + role: UserHistoryRole + roleNEQ: UserHistoryRole + roleIn: [UserHistoryRole!] + roleNotIn: [UserHistoryRole!] + roleIsNil: Boolean + roleNotNil: Boolean +} +""" +Ordering options for User connections +""" +input UserOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Users. + """ + field: UserOrderField! +} +""" +Properties by which User connections can be ordered. +""" +enum UserOrderField { + first_name + last_name + display_name +} +""" +UserRole is enum for the field role +""" +enum UserRole @goModel(model: "github.com/theopenlane/core/pkg/enums.Role") { + ADMIN + MEMBER + USER +} +type UserSetting implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + userID: ID + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean! + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingUserStatus! + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean! + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean + user: User + """ + organization to load on user login + """ + defaultOrg: Organization +} +""" +A connection to a list of items. +""" +type UserSettingConnection { + """ + A list of edges. + """ + edges: [UserSettingEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserSettingEdge { + """ + The item at the end of the edge. + """ + node: UserSetting + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type UserSettingHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: UserSettingHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + userID: String + """ + user account is locked if unconfirmed or explicitly locked + """ + locked: Boolean! + """ + The time notifications regarding the user were silenced + """ + silencedAt: Time + """ + The time the user was suspended + """ + suspendedAt: Time + """ + status of the user account + """ + status: UserSettingHistoryUserStatus! + """ + whether the user has confirmed their email address + """ + emailConfirmed: Boolean! + """ + specifies a user may complete authentication by verifying a WebAuthn capable device + """ + isWebauthnAllowed: Boolean + """ + whether the user has two factor authentication enabled + """ + isTfaEnabled: Boolean +} +""" +A connection to a list of items. +""" +type UserSettingHistoryConnection { + """ + A list of edges. + """ + edges: [UserSettingHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type UserSettingHistoryEdge { + """ + The item at the end of the edge. + """ + node: UserSettingHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +UserSettingHistoryOpType is enum for the field operation +""" +enum UserSettingHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +UserSettingHistoryUserStatus is enum for the field status +""" +enum UserSettingHistoryUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +UserSettingHistoryWhereInput is used for filtering UserSettingHistory objects. +Input was generated by ent. +""" +input UserSettingHistoryWhereInput { + not: UserSettingHistoryWhereInput + and: [UserSettingHistoryWhereInput!] + or: [UserSettingHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: UserSettingHistoryOpType + operationNEQ: UserSettingHistoryOpType + operationIn: [UserSettingHistoryOpType!] + operationNotIn: [UserSettingHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + user_id field predicates + """ + userID: String + userIDNEQ: String + userIDIn: [String!] + userIDNotIn: [String!] + userIDGT: String + userIDGTE: String + userIDLT: String + userIDLTE: String + userIDContains: String + userIDHasPrefix: String + userIDHasSuffix: String + userIDIsNil: Boolean + userIDNotNil: Boolean + userIDEqualFold: String + userIDContainsFold: String + """ + locked field predicates + """ + locked: Boolean + lockedNEQ: Boolean + """ + silenced_at field predicates + """ + silencedAt: Time + silencedAtNEQ: Time + silencedAtIn: [Time!] + silencedAtNotIn: [Time!] + silencedAtGT: Time + silencedAtGTE: Time + silencedAtLT: Time + silencedAtLTE: Time + silencedAtIsNil: Boolean + silencedAtNotNil: Boolean + """ + suspended_at field predicates + """ + suspendedAt: Time + suspendedAtNEQ: Time + suspendedAtIn: [Time!] + suspendedAtNotIn: [Time!] + suspendedAtGT: Time + suspendedAtGTE: Time + suspendedAtLT: Time + suspendedAtLTE: Time + suspendedAtIsNil: Boolean + suspendedAtNotNil: Boolean + """ + status field predicates + """ + status: UserSettingHistoryUserStatus + statusNEQ: UserSettingHistoryUserStatus + statusIn: [UserSettingHistoryUserStatus!] + statusNotIn: [UserSettingHistoryUserStatus!] + """ + email_confirmed field predicates + """ + emailConfirmed: Boolean + emailConfirmedNEQ: Boolean + """ + is_webauthn_allowed field predicates + """ + isWebauthnAllowed: Boolean + isWebauthnAllowedNEQ: Boolean + isWebauthnAllowedIsNil: Boolean + isWebauthnAllowedNotNil: Boolean + """ + is_tfa_enabled field predicates + """ + isTfaEnabled: Boolean + isTfaEnabledNEQ: Boolean + isTfaEnabledIsNil: Boolean + isTfaEnabledNotNil: Boolean +} +""" +UserSettingUserStatus is enum for the field status +""" +enum UserSettingUserStatus @goModel(model: "github.com/theopenlane/core/pkg/enums.UserStatus") { + ACTIVE + INACTIVE + DEACTIVATED + SUSPENDED + ONBOARDING +} +""" +UserSettingWhereInput is used for filtering UserSetting objects. +Input was generated by ent. +""" +input UserSettingWhereInput { + not: UserSettingWhereInput + and: [UserSettingWhereInput!] + or: [UserSettingWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + user_id field predicates + """ + userID: ID + userIDNEQ: ID + userIDIn: [ID!] + userIDNotIn: [ID!] + userIDGT: ID + userIDGTE: ID + userIDLT: ID + userIDLTE: ID + userIDContains: ID + userIDHasPrefix: ID + userIDHasSuffix: ID + userIDIsNil: Boolean + userIDNotNil: Boolean + userIDEqualFold: ID + userIDContainsFold: ID + """ + locked field predicates + """ + locked: Boolean + lockedNEQ: Boolean + """ + silenced_at field predicates + """ + silencedAt: Time + silencedAtNEQ: Time + silencedAtIn: [Time!] + silencedAtNotIn: [Time!] + silencedAtGT: Time + silencedAtGTE: Time + silencedAtLT: Time + silencedAtLTE: Time + silencedAtIsNil: Boolean + silencedAtNotNil: Boolean + """ + suspended_at field predicates + """ + suspendedAt: Time + suspendedAtNEQ: Time + suspendedAtIn: [Time!] + suspendedAtNotIn: [Time!] + suspendedAtGT: Time + suspendedAtGTE: Time + suspendedAtLT: Time + suspendedAtLTE: Time + suspendedAtIsNil: Boolean + suspendedAtNotNil: Boolean + """ + status field predicates + """ + status: UserSettingUserStatus + statusNEQ: UserSettingUserStatus + statusIn: [UserSettingUserStatus!] + statusNotIn: [UserSettingUserStatus!] + """ + email_confirmed field predicates + """ + emailConfirmed: Boolean + emailConfirmedNEQ: Boolean + """ + is_webauthn_allowed field predicates + """ + isWebauthnAllowed: Boolean + isWebauthnAllowedNEQ: Boolean + isWebauthnAllowedIsNil: Boolean + isWebauthnAllowedNotNil: Boolean + """ + is_tfa_enabled field predicates + """ + isTfaEnabled: Boolean + isTfaEnabledNEQ: Boolean + isTfaEnabledIsNil: Boolean + isTfaEnabledNotNil: Boolean + """ + user edge predicates + """ + hasUser: Boolean + hasUserWith: [UserWhereInput!] + """ + default_org edge predicates + """ + hasDefaultOrg: Boolean + hasDefaultOrgWith: [OrganizationWhereInput!] +} +""" +UserWhereInput is used for filtering User objects. +Input was generated by ent. +""" +input UserWhereInput { + not: UserWhereInput + and: [UserWhereInput!] + or: [UserWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + email field predicates + """ + email: String + emailNEQ: String + emailIn: [String!] + emailNotIn: [String!] + emailGT: String + emailGTE: String + emailLT: String + emailLTE: String + emailContains: String + emailHasPrefix: String + emailHasSuffix: String + emailEqualFold: String + emailContainsFold: String + """ + first_name field predicates + """ + firstName: String + firstNameNEQ: String + firstNameIn: [String!] + firstNameNotIn: [String!] + firstNameGT: String + firstNameGTE: String + firstNameLT: String + firstNameLTE: String + firstNameContains: String + firstNameHasPrefix: String + firstNameHasSuffix: String + firstNameIsNil: Boolean + firstNameNotNil: Boolean + firstNameEqualFold: String + firstNameContainsFold: String + """ + last_name field predicates + """ + lastName: String + lastNameNEQ: String + lastNameIn: [String!] + lastNameNotIn: [String!] + lastNameGT: String + lastNameGTE: String + lastNameLT: String + lastNameLTE: String + lastNameContains: String + lastNameHasPrefix: String + lastNameHasSuffix: String + lastNameIsNil: Boolean + lastNameNotNil: Boolean + lastNameEqualFold: String + lastNameContainsFold: String + """ + display_name field predicates + """ + displayName: String + displayNameNEQ: String + displayNameIn: [String!] + displayNameNotIn: [String!] + displayNameGT: String + displayNameGTE: String + displayNameLT: String + displayNameLTE: String + displayNameContains: String + displayNameHasPrefix: String + displayNameHasSuffix: String + displayNameEqualFold: String + displayNameContainsFold: String + """ + avatar_remote_url field predicates + """ + avatarRemoteURL: String + avatarRemoteURLNEQ: String + avatarRemoteURLIn: [String!] + avatarRemoteURLNotIn: [String!] + avatarRemoteURLGT: String + avatarRemoteURLGTE: String + avatarRemoteURLLT: String + avatarRemoteURLLTE: String + avatarRemoteURLContains: String + avatarRemoteURLHasPrefix: String + avatarRemoteURLHasSuffix: String + avatarRemoteURLIsNil: Boolean + avatarRemoteURLNotNil: Boolean + avatarRemoteURLEqualFold: String + avatarRemoteURLContainsFold: String + """ + avatar_local_file field predicates + """ + avatarLocalFile: String + avatarLocalFileNEQ: String + avatarLocalFileIn: [String!] + avatarLocalFileNotIn: [String!] + avatarLocalFileGT: String + avatarLocalFileGTE: String + avatarLocalFileLT: String + avatarLocalFileLTE: String + avatarLocalFileContains: String + avatarLocalFileHasPrefix: String + avatarLocalFileHasSuffix: String + avatarLocalFileIsNil: Boolean + avatarLocalFileNotNil: Boolean + avatarLocalFileEqualFold: String + avatarLocalFileContainsFold: String + """ + avatar_updated_at field predicates + """ + avatarUpdatedAt: Time + avatarUpdatedAtNEQ: Time + avatarUpdatedAtIn: [Time!] + avatarUpdatedAtNotIn: [Time!] + avatarUpdatedAtGT: Time + avatarUpdatedAtGTE: Time + avatarUpdatedAtLT: Time + avatarUpdatedAtLTE: Time + avatarUpdatedAtIsNil: Boolean + avatarUpdatedAtNotNil: Boolean + """ + last_seen field predicates + """ + lastSeen: Time + lastSeenNEQ: Time + lastSeenIn: [Time!] + lastSeenNotIn: [Time!] + lastSeenGT: Time + lastSeenGTE: Time + lastSeenLT: Time + lastSeenLTE: Time + lastSeenIsNil: Boolean + lastSeenNotNil: Boolean + """ + sub field predicates + """ + sub: String + subNEQ: String + subIn: [String!] + subNotIn: [String!] + subGT: String + subGTE: String + subLT: String + subLTE: String + subContains: String + subHasPrefix: String + subHasSuffix: String + subIsNil: Boolean + subNotNil: Boolean + subEqualFold: String + subContainsFold: String + """ + auth_provider field predicates + """ + authProvider: UserAuthProvider + authProviderNEQ: UserAuthProvider + authProviderIn: [UserAuthProvider!] + authProviderNotIn: [UserAuthProvider!] + """ + role field predicates + """ + role: UserRole + roleNEQ: UserRole + roleIn: [UserRole!] + roleNotIn: [UserRole!] + roleIsNil: Boolean + roleNotNil: Boolean + """ + personal_access_tokens edge predicates + """ + hasPersonalAccessTokens: Boolean + hasPersonalAccessTokensWith: [PersonalAccessTokenWhereInput!] + """ + tfa_settings edge predicates + """ + hasTfaSettings: Boolean + hasTfaSettingsWith: [TFASettingWhereInput!] + """ + setting edge predicates + """ + hasSetting: Boolean + hasSettingWith: [UserSettingWhereInput!] + """ + groups edge predicates + """ + hasGroups: Boolean + hasGroupsWith: [GroupWhereInput!] + """ + organizations edge predicates + """ + hasOrganizations: Boolean + hasOrganizationsWith: [OrganizationWhereInput!] + """ + files edge predicates + """ + hasFiles: Boolean + hasFilesWith: [FileWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + group_memberships edge predicates + """ + hasGroupMemberships: Boolean + hasGroupMembershipsWith: [GroupMembershipWhereInput!] + """ + org_memberships edge predicates + """ + hasOrgMemberships: Boolean + hasOrgMembershipsWith: [OrgMembershipWhereInput!] +} +type Webhook implements Node { + id: ID! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: ID + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean! + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String + owner: Organization + events: [Event!] + integrations: [Integration!] +} +""" +A connection to a list of items. +""" +type WebhookConnection { + """ + A list of edges. + """ + edges: [WebhookEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type WebhookEdge { + """ + The item at the end of the edge. + """ + node: Webhook + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +type WebhookHistory implements Node { + id: ID! + historyTime: Time! + ref: String + operation: WebhookHistoryOpType! + createdAt: Time + updatedAt: Time + createdBy: String + updatedBy: String + """ + tags associated with the object + """ + tags: [String!] + deletedAt: Time + deletedBy: String + """ + The organization id that owns the object + """ + ownerID: String + """ + the name of the webhook + """ + name: String! + """ + a description of the webhook + """ + description: String + """ + the url to send the webhook to + """ + destinationURL: String! + """ + indicates if the webhook is active and enabled + """ + enabled: Boolean! + """ + the number of failures + """ + failures: Int + """ + the last error message + """ + lastError: String + """ + the last response + """ + lastResponse: String +} +""" +A connection to a list of items. +""" +type WebhookHistoryConnection { + """ + A list of edges. + """ + edges: [WebhookHistoryEdge] + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} +""" +An edge in a connection. +""" +type WebhookHistoryEdge { + """ + The item at the end of the edge. + """ + node: WebhookHistory + """ + A cursor for use in pagination. + """ + cursor: Cursor! +} +""" +WebhookHistoryOpType is enum for the field operation +""" +enum WebhookHistoryOpType @goModel(model: "github.com/theopenlane/entx/history.OpType") { + INSERT + UPDATE + DELETE +} +""" +Ordering options for WebhookHistory connections +""" +input WebhookHistoryOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order WebhookHistories. + """ + field: WebhookHistoryOrderField! +} +""" +Properties by which WebhookHistory connections can be ordered. +""" +enum WebhookHistoryOrderField { + name + url +} +""" +WebhookHistoryWhereInput is used for filtering WebhookHistory objects. +Input was generated by ent. +""" +input WebhookHistoryWhereInput { + not: WebhookHistoryWhereInput + and: [WebhookHistoryWhereInput!] + or: [WebhookHistoryWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + history_time field predicates + """ + historyTime: Time + historyTimeNEQ: Time + historyTimeIn: [Time!] + historyTimeNotIn: [Time!] + historyTimeGT: Time + historyTimeGTE: Time + historyTimeLT: Time + historyTimeLTE: Time + """ + ref field predicates + """ + ref: String + refNEQ: String + refIn: [String!] + refNotIn: [String!] + refGT: String + refGTE: String + refLT: String + refLTE: String + refContains: String + refHasPrefix: String + refHasSuffix: String + refIsNil: Boolean + refNotNil: Boolean + refEqualFold: String + refContainsFold: String + """ + operation field predicates + """ + operation: WebhookHistoryOpType + operationNEQ: WebhookHistoryOpType + operationIn: [WebhookHistoryOpType!] + operationNotIn: [WebhookHistoryOpType!] + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: String + ownerIDNEQ: String + ownerIDIn: [String!] + ownerIDNotIn: [String!] + ownerIDGT: String + ownerIDGTE: String + ownerIDLT: String + ownerIDLTE: String + ownerIDContains: String + ownerIDHasPrefix: String + ownerIDHasSuffix: String + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: String + ownerIDContainsFold: String + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + destination_url field predicates + """ + destinationURL: String + destinationURLNEQ: String + destinationURLIn: [String!] + destinationURLNotIn: [String!] + destinationURLGT: String + destinationURLGTE: String + destinationURLLT: String + destinationURLLTE: String + destinationURLContains: String + destinationURLHasPrefix: String + destinationURLHasSuffix: String + destinationURLEqualFold: String + destinationURLContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + failures field predicates + """ + failures: Int + failuresNEQ: Int + failuresIn: [Int!] + failuresNotIn: [Int!] + failuresGT: Int + failuresGTE: Int + failuresLT: Int + failuresLTE: Int + failuresIsNil: Boolean + failuresNotNil: Boolean + """ + last_error field predicates + """ + lastError: String + lastErrorNEQ: String + lastErrorIn: [String!] + lastErrorNotIn: [String!] + lastErrorGT: String + lastErrorGTE: String + lastErrorLT: String + lastErrorLTE: String + lastErrorContains: String + lastErrorHasPrefix: String + lastErrorHasSuffix: String + lastErrorIsNil: Boolean + lastErrorNotNil: Boolean + lastErrorEqualFold: String + lastErrorContainsFold: String + """ + last_response field predicates + """ + lastResponse: String + lastResponseNEQ: String + lastResponseIn: [String!] + lastResponseNotIn: [String!] + lastResponseGT: String + lastResponseGTE: String + lastResponseLT: String + lastResponseLTE: String + lastResponseContains: String + lastResponseHasPrefix: String + lastResponseHasSuffix: String + lastResponseIsNil: Boolean + lastResponseNotNil: Boolean + lastResponseEqualFold: String + lastResponseContainsFold: String +} +""" +Ordering options for Webhook connections +""" +input WebhookOrder { + """ + The ordering direction. + """ + direction: OrderDirection! = ASC + """ + The field by which to order Webhooks. + """ + field: WebhookOrderField! +} +""" +Properties by which Webhook connections can be ordered. +""" +enum WebhookOrderField { + name + url +} +""" +WebhookWhereInput is used for filtering Webhook objects. +Input was generated by ent. +""" +input WebhookWhereInput { + not: WebhookWhereInput + and: [WebhookWhereInput!] + or: [WebhookWhereInput!] + """ + id field predicates + """ + id: ID + idNEQ: ID + idIn: [ID!] + idNotIn: [ID!] + idGT: ID + idGTE: ID + idLT: ID + idLTE: ID + idEqualFold: ID + idContainsFold: ID + """ + created_at field predicates + """ + createdAt: Time + createdAtNEQ: Time + createdAtIn: [Time!] + createdAtNotIn: [Time!] + createdAtGT: Time + createdAtGTE: Time + createdAtLT: Time + createdAtLTE: Time + createdAtIsNil: Boolean + createdAtNotNil: Boolean + """ + updated_at field predicates + """ + updatedAt: Time + updatedAtNEQ: Time + updatedAtIn: [Time!] + updatedAtNotIn: [Time!] + updatedAtGT: Time + updatedAtGTE: Time + updatedAtLT: Time + updatedAtLTE: Time + updatedAtIsNil: Boolean + updatedAtNotNil: Boolean + """ + created_by field predicates + """ + createdBy: String + createdByNEQ: String + createdByIn: [String!] + createdByNotIn: [String!] + createdByGT: String + createdByGTE: String + createdByLT: String + createdByLTE: String + createdByContains: String + createdByHasPrefix: String + createdByHasSuffix: String + createdByIsNil: Boolean + createdByNotNil: Boolean + createdByEqualFold: String + createdByContainsFold: String + """ + updated_by field predicates + """ + updatedBy: String + updatedByNEQ: String + updatedByIn: [String!] + updatedByNotIn: [String!] + updatedByGT: String + updatedByGTE: String + updatedByLT: String + updatedByLTE: String + updatedByContains: String + updatedByHasPrefix: String + updatedByHasSuffix: String + updatedByIsNil: Boolean + updatedByNotNil: Boolean + updatedByEqualFold: String + updatedByContainsFold: String + """ + deleted_at field predicates + """ + deletedAt: Time + deletedAtNEQ: Time + deletedAtIn: [Time!] + deletedAtNotIn: [Time!] + deletedAtGT: Time + deletedAtGTE: Time + deletedAtLT: Time + deletedAtLTE: Time + deletedAtIsNil: Boolean + deletedAtNotNil: Boolean + """ + deleted_by field predicates + """ + deletedBy: String + deletedByNEQ: String + deletedByIn: [String!] + deletedByNotIn: [String!] + deletedByGT: String + deletedByGTE: String + deletedByLT: String + deletedByLTE: String + deletedByContains: String + deletedByHasPrefix: String + deletedByHasSuffix: String + deletedByIsNil: Boolean + deletedByNotNil: Boolean + deletedByEqualFold: String + deletedByContainsFold: String + """ + owner_id field predicates + """ + ownerID: ID + ownerIDNEQ: ID + ownerIDIn: [ID!] + ownerIDNotIn: [ID!] + ownerIDGT: ID + ownerIDGTE: ID + ownerIDLT: ID + ownerIDLTE: ID + ownerIDContains: ID + ownerIDHasPrefix: ID + ownerIDHasSuffix: ID + ownerIDIsNil: Boolean + ownerIDNotNil: Boolean + ownerIDEqualFold: ID + ownerIDContainsFold: ID + """ + name field predicates + """ + name: String + nameNEQ: String + nameIn: [String!] + nameNotIn: [String!] + nameGT: String + nameGTE: String + nameLT: String + nameLTE: String + nameContains: String + nameHasPrefix: String + nameHasSuffix: String + nameEqualFold: String + nameContainsFold: String + """ + destination_url field predicates + """ + destinationURL: String + destinationURLNEQ: String + destinationURLIn: [String!] + destinationURLNotIn: [String!] + destinationURLGT: String + destinationURLGTE: String + destinationURLLT: String + destinationURLLTE: String + destinationURLContains: String + destinationURLHasPrefix: String + destinationURLHasSuffix: String + destinationURLEqualFold: String + destinationURLContainsFold: String + """ + enabled field predicates + """ + enabled: Boolean + enabledNEQ: Boolean + """ + failures field predicates + """ + failures: Int + failuresNEQ: Int + failuresIn: [Int!] + failuresNotIn: [Int!] + failuresGT: Int + failuresGTE: Int + failuresLT: Int + failuresLTE: Int + failuresIsNil: Boolean + failuresNotNil: Boolean + """ + last_error field predicates + """ + lastError: String + lastErrorNEQ: String + lastErrorIn: [String!] + lastErrorNotIn: [String!] + lastErrorGT: String + lastErrorGTE: String + lastErrorLT: String + lastErrorLTE: String + lastErrorContains: String + lastErrorHasPrefix: String + lastErrorHasSuffix: String + lastErrorIsNil: Boolean + lastErrorNotNil: Boolean + lastErrorEqualFold: String + lastErrorContainsFold: String + """ + last_response field predicates + """ + lastResponse: String + lastResponseNEQ: String + lastResponseIn: [String!] + lastResponseNotIn: [String!] + lastResponseGT: String + lastResponseGTE: String + lastResponseLT: String + lastResponseLTE: String + lastResponseContains: String + lastResponseHasPrefix: String + lastResponseHasSuffix: String + lastResponseIsNil: Boolean + lastResponseNotNil: Boolean + lastResponseEqualFold: String + lastResponseContainsFold: String + """ + owner edge predicates + """ + hasOwner: Boolean + hasOwnerWith: [OrganizationWhereInput!] + """ + events edge predicates + """ + hasEvents: Boolean + hasEventsWith: [EventWhereInput!] + """ + integrations edge predicates + """ + hasIntegrations: Boolean + hasIntegrationsWith: [IntegrationWhereInput!] +} diff --git a/schema/entitlement.graphql b/schema/entitlement.graphql new file mode 100644 index 0000000..a2ebad7 --- /dev/null +++ b/schema/entitlement.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up entitlement by ID + """ + entitlement( + """ + ID of the entitlement + """ + id: ID! + ): Entitlement! +} + +extend type Mutation{ + """ + Create a new entitlement + """ + createEntitlement( + """ + values of the entitlement + """ + input: CreateEntitlementInput! + ): EntitlementCreatePayload! + """ + Create multiple new entitlements + """ + createBulkEntitlement( + """ + values of the entitlement + """ + input: [CreateEntitlementInput!] + ): EntitlementBulkCreatePayload! + """ + Create multiple new entitlements via file upload + """ + createBulkCSVEntitlement( + """ + csv file containing values of the entitlement + """ + input: Upload! + ): EntitlementBulkCreatePayload! + """ + Update an existing entitlement + """ + updateEntitlement( + """ + ID of the entitlement + """ + id: ID! + """ + New values for the entitlement + """ + input: UpdateEntitlementInput! + ): EntitlementUpdatePayload! + """ + Delete an existing entitlement + """ + deleteEntitlement( + """ + ID of the entitlement + """ + id: ID! + ): EntitlementDeletePayload! +} + +""" +Return response for createEntitlement mutation +""" +type EntitlementCreatePayload { + """ + Created entitlement + """ + entitlement: Entitlement! +} + +""" +Return response for updateEntitlement mutation +""" +type EntitlementUpdatePayload { + """ + Updated entitlement + """ + entitlement: Entitlement! +} + +""" +Return response for deleteEntitlement mutation +""" +type EntitlementDeletePayload { + """ + Deleted entitlement ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntitlement mutation +""" +type EntitlementBulkCreatePayload { + """ + Created entitlements + """ + entitlements: [Entitlement!] +} \ No newline at end of file diff --git a/schema/entitlementplan.graphql b/schema/entitlementplan.graphql new file mode 100644 index 0000000..a432306 --- /dev/null +++ b/schema/entitlementplan.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up entitlementPlan by ID + """ + entitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + ): EntitlementPlan! +} + +extend type Mutation{ + """ + Create a new entitlementPlan + """ + createEntitlementPlan( + """ + values of the entitlementPlan + """ + input: CreateEntitlementPlanInput! + ): EntitlementPlanCreatePayload! + """ + Create multiple new entitlementPlans + """ + createBulkEntitlementPlan( + """ + values of the entitlementPlan + """ + input: [CreateEntitlementPlanInput!] + ): EntitlementPlanBulkCreatePayload! + """ + Create multiple new entitlementPlans via file upload + """ + createBulkCSVEntitlementPlan( + """ + csv file containing values of the entitlementPlan + """ + input: Upload! + ): EntitlementPlanBulkCreatePayload! + """ + Update an existing entitlementPlan + """ + updateEntitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + """ + New values for the entitlementPlan + """ + input: UpdateEntitlementPlanInput! + ): EntitlementPlanUpdatePayload! + """ + Delete an existing entitlementPlan + """ + deleteEntitlementPlan( + """ + ID of the entitlementPlan + """ + id: ID! + ): EntitlementPlanDeletePayload! +} + +""" +Return response for createEntitlementPlan mutation +""" +type EntitlementPlanCreatePayload { + """ + Created entitlementPlan + """ + entitlementPlan: EntitlementPlan! +} + +""" +Return response for updateEntitlementPlan mutation +""" +type EntitlementPlanUpdatePayload { + """ + Updated entitlementPlan + """ + entitlementPlan: EntitlementPlan! +} + +""" +Return response for deleteEntitlementPlan mutation +""" +type EntitlementPlanDeletePayload { + """ + Deleted entitlementPlan ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntitlementPlan mutation +""" +type EntitlementPlanBulkCreatePayload { + """ + Created entitlementPlans + """ + entitlementPlans: [EntitlementPlan!] +} \ No newline at end of file diff --git a/schema/entitlementplanfeature.graphql b/schema/entitlementplanfeature.graphql new file mode 100644 index 0000000..f67d3b9 --- /dev/null +++ b/schema/entitlementplanfeature.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up entitlementPlanFeature by ID + """ + entitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + ): EntitlementPlanFeature! +} + +extend type Mutation{ + """ + Create a new entitlementPlanFeature + """ + createEntitlementPlanFeature( + """ + values of the entitlementPlanFeature + """ + input: CreateEntitlementPlanFeatureInput! + ): EntitlementPlanFeatureCreatePayload! + """ + Create multiple new entitlementPlanFeatures + """ + createBulkEntitlementPlanFeature( + """ + values of the entitlementPlanFeature + """ + input: [CreateEntitlementPlanFeatureInput!] + ): EntitlementPlanFeatureBulkCreatePayload! + """ + Create multiple new entitlementPlanFeatures via file upload + """ + createBulkCSVEntitlementPlanFeature( + """ + csv file containing values of the entitlementPlanFeature + """ + input: Upload! + ): EntitlementPlanFeatureBulkCreatePayload! + """ + Update an existing entitlementPlanFeature + """ + updateEntitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + """ + New values for the entitlementPlanFeature + """ + input: UpdateEntitlementPlanFeatureInput! + ): EntitlementPlanFeatureUpdatePayload! + """ + Delete an existing entitlementPlanFeature + """ + deleteEntitlementPlanFeature( + """ + ID of the entitlementPlanFeature + """ + id: ID! + ): EntitlementPlanFeatureDeletePayload! +} + +""" +Return response for createEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureCreatePayload { + """ + Created entitlementPlanFeature + """ + entitlementPlanFeature: EntitlementPlanFeature! +} + +""" +Return response for updateEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureUpdatePayload { + """ + Updated entitlementPlanFeature + """ + entitlementPlanFeature: EntitlementPlanFeature! +} + +""" +Return response for deleteEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureDeletePayload { + """ + Deleted entitlementPlanFeature ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntitlementPlanFeature mutation +""" +type EntitlementPlanFeatureBulkCreatePayload { + """ + Created entitlementPlanFeatures + """ + entitlementPlanFeatures: [EntitlementPlanFeature!] +} \ No newline at end of file diff --git a/schema/entity.graphql b/schema/entity.graphql new file mode 100644 index 0000000..022bcb4 --- /dev/null +++ b/schema/entity.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up entity by ID + """ + entity( + """ + ID of the entity + """ + id: ID! + ): Entity! +} + +extend type Mutation{ + """ + Create a new entity + """ + createEntity( + """ + values of the entity + """ + input: CreateEntityInput! + ): EntityCreatePayload! + """ + Create multiple new entities + """ + createBulkEntity( + """ + values of the entity + """ + input: [CreateEntityInput!] + ): EntityBulkCreatePayload! + """ + Create multiple new entities via file upload + """ + createBulkCSVEntity( + """ + csv file containing values of the entity + """ + input: Upload! + ): EntityBulkCreatePayload! + """ + Update an existing entity + """ + updateEntity( + """ + ID of the entity + """ + id: ID! + """ + New values for the entity + """ + input: UpdateEntityInput! + ): EntityUpdatePayload! + """ + Delete an existing entity + """ + deleteEntity( + """ + ID of the entity + """ + id: ID! + ): EntityDeletePayload! +} + +""" +Return response for createEntity mutation +""" +type EntityCreatePayload { + """ + Created entity + """ + entity: Entity! +} + +""" +Return response for updateEntity mutation +""" +type EntityUpdatePayload { + """ + Updated entity + """ + entity: Entity! +} + +""" +Return response for deleteEntity mutation +""" +type EntityDeletePayload { + """ + Deleted entity ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntity mutation +""" +type EntityBulkCreatePayload { + """ + Created entities + """ + entities: [Entity!] +} \ No newline at end of file diff --git a/schema/entityextended.graphql b/schema/entityextended.graphql new file mode 100644 index 0000000..fdd9b6f --- /dev/null +++ b/schema/entityextended.graphql @@ -0,0 +1,7 @@ +extend input CreateEntityInput { + note: CreateNoteInput +} + +extend input UpdateEntityInput { + note: CreateNoteInput +} diff --git a/schema/entitytype.graphql b/schema/entitytype.graphql new file mode 100644 index 0000000..7f1ba01 --- /dev/null +++ b/schema/entitytype.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up entityType by ID + """ + entityType( + """ + ID of the entityType + """ + id: ID! + ): EntityType! +} + +extend type Mutation{ + """ + Create a new entityType + """ + createEntityType( + """ + values of the entityType + """ + input: CreateEntityTypeInput! + ): EntityTypeCreatePayload! + """ + Create multiple new entityTypes + """ + createBulkEntityType( + """ + values of the entityType + """ + input: [CreateEntityTypeInput!] + ): EntityTypeBulkCreatePayload! + """ + Create multiple new entityTypes via file upload + """ + createBulkCSVEntityType( + """ + csv file containing values of the entityType + """ + input: Upload! + ): EntityTypeBulkCreatePayload! + """ + Update an existing entityType + """ + updateEntityType( + """ + ID of the entityType + """ + id: ID! + """ + New values for the entityType + """ + input: UpdateEntityTypeInput! + ): EntityTypeUpdatePayload! + """ + Delete an existing entityType + """ + deleteEntityType( + """ + ID of the entityType + """ + id: ID! + ): EntityTypeDeletePayload! +} + +""" +Return response for createEntityType mutation +""" +type EntityTypeCreatePayload { + """ + Created entityType + """ + entityType: EntityType! +} + +""" +Return response for updateEntityType mutation +""" +type EntityTypeUpdatePayload { + """ + Updated entityType + """ + entityType: EntityType! +} + +""" +Return response for deleteEntityType mutation +""" +type EntityTypeDeletePayload { + """ + Deleted entityType ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEntityType mutation +""" +type EntityTypeBulkCreatePayload { + """ + Created entityTypes + """ + entityTypes: [EntityType!] +} \ No newline at end of file diff --git a/schema/event.graphql b/schema/event.graphql new file mode 100644 index 0000000..e6ab586 --- /dev/null +++ b/schema/event.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up event by ID + """ + event( + """ + ID of the event + """ + id: ID! + ): Event! +} + +extend type Mutation{ + """ + Create a new event + """ + createEvent( + """ + values of the event + """ + input: CreateEventInput! + ): EventCreatePayload! + """ + Create multiple new events + """ + createBulkEvent( + """ + values of the event + """ + input: [CreateEventInput!] + ): EventBulkCreatePayload! + """ + Create multiple new events via file upload + """ + createBulkCSVEvent( + """ + csv file containing values of the event + """ + input: Upload! + ): EventBulkCreatePayload! + """ + Update an existing event + """ + updateEvent( + """ + ID of the event + """ + id: ID! + """ + New values for the event + """ + input: UpdateEventInput! + ): EventUpdatePayload! + """ + Delete an existing event + """ + deleteEvent( + """ + ID of the event + """ + id: ID! + ): EventDeletePayload! +} + +""" +Return response for createEvent mutation +""" +type EventCreatePayload { + """ + Created event + """ + event: Event! +} + +""" +Return response for updateEvent mutation +""" +type EventUpdatePayload { + """ + Updated event + """ + event: Event! +} + +""" +Return response for deleteEvent mutation +""" +type EventDeletePayload { + """ + Deleted event ID + """ + deletedID: ID! +} + +""" +Return response for createBulkEvent mutation +""" +type EventBulkCreatePayload { + """ + Created events + """ + events: [Event!] +} \ No newline at end of file diff --git a/schema/feature.graphql b/schema/feature.graphql new file mode 100644 index 0000000..cb55d5f --- /dev/null +++ b/schema/feature.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up feature by ID + """ + feature( + """ + ID of the feature + """ + id: ID! + ): Feature! +} + +extend type Mutation{ + """ + Create a new feature + """ + createFeature( + """ + values of the feature + """ + input: CreateFeatureInput! + ): FeatureCreatePayload! + """ + Create multiple new features + """ + createBulkFeature( + """ + values of the feature + """ + input: [CreateFeatureInput!] + ): FeatureBulkCreatePayload! + """ + Create multiple new features via file upload + """ + createBulkCSVFeature( + """ + csv file containing values of the feature + """ + input: Upload! + ): FeatureBulkCreatePayload! + """ + Update an existing feature + """ + updateFeature( + """ + ID of the feature + """ + id: ID! + """ + New values for the feature + """ + input: UpdateFeatureInput! + ): FeatureUpdatePayload! + """ + Delete an existing feature + """ + deleteFeature( + """ + ID of the feature + """ + id: ID! + ): FeatureDeletePayload! +} + +""" +Return response for createFeature mutation +""" +type FeatureCreatePayload { + """ + Created feature + """ + feature: Feature! +} + +""" +Return response for updateFeature mutation +""" +type FeatureUpdatePayload { + """ + Updated feature + """ + feature: Feature! +} + +""" +Return response for deleteFeature mutation +""" +type FeatureDeletePayload { + """ + Deleted feature ID + """ + deletedID: ID! +} + +""" +Return response for createBulkFeature mutation +""" +type FeatureBulkCreatePayload { + """ + Created features + """ + features: [Feature!] +} \ No newline at end of file diff --git a/schema/file.graphql b/schema/file.graphql new file mode 100644 index 0000000..4988f8d --- /dev/null +++ b/schema/file.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up file by ID + """ + file( + """ + ID of the file + """ + id: ID! + ): File! +} + +extend type Mutation{ + """ + Create a new file + """ + createFile( + """ + values of the file + """ + input: CreateFileInput! + ): FileCreatePayload! + """ + Create multiple new files + """ + createBulkFile( + """ + values of the file + """ + input: [CreateFileInput!] + ): FileBulkCreatePayload! + """ + Create multiple new files via file upload + """ + createBulkCSVFile( + """ + csv file containing values of the file + """ + input: Upload! + ): FileBulkCreatePayload! + """ + Update an existing file + """ + updateFile( + """ + ID of the file + """ + id: ID! + """ + New values for the file + """ + input: UpdateFileInput! + ): FileUpdatePayload! + """ + Delete an existing file + """ + deleteFile( + """ + ID of the file + """ + id: ID! + ): FileDeletePayload! +} + +""" +Return response for createFile mutation +""" +type FileCreatePayload { + """ + Created file + """ + file: File! +} + +""" +Return response for updateFile mutation +""" +type FileUpdatePayload { + """ + Updated file + """ + file: File! +} + +""" +Return response for deleteFile mutation +""" +type FileDeletePayload { + """ + Deleted file ID + """ + deletedID: ID! +} + +""" +Return response for createBulkFile mutation +""" +type FileBulkCreatePayload { + """ + Created files + """ + files: [File!] +} \ No newline at end of file diff --git a/schema/group.graphql b/schema/group.graphql new file mode 100644 index 0000000..a12cfd5 --- /dev/null +++ b/schema/group.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up group by ID + """ + group( + """ + ID of the group + """ + id: ID! + ): Group! +} + +extend type Mutation{ + """ + Create a new group + """ + createGroup( + """ + values of the group + """ + input: CreateGroupInput! + ): GroupCreatePayload! + """ + Create multiple new groups + """ + createBulkGroup( + """ + values of the group + """ + input: [CreateGroupInput!] + ): GroupBulkCreatePayload! + """ + Create multiple new groups via file upload + """ + createBulkCSVGroup( + """ + csv file containing values of the group + """ + input: Upload! + ): GroupBulkCreatePayload! + """ + Update an existing group + """ + updateGroup( + """ + ID of the group + """ + id: ID! + """ + New values for the group + """ + input: UpdateGroupInput! + ): GroupUpdatePayload! + """ + Delete an existing group + """ + deleteGroup( + """ + ID of the group + """ + id: ID! + ): GroupDeletePayload! +} + +""" +Return response for createGroup mutation +""" +type GroupCreatePayload { + """ + Created group + """ + group: Group! +} + +""" +Return response for updateGroup mutation +""" +type GroupUpdatePayload { + """ + Updated group + """ + group: Group! +} + +""" +Return response for deleteGroup mutation +""" +type GroupDeletePayload { + """ + Deleted group ID + """ + deletedID: ID! +} + +""" +Return response for createBulkGroup mutation +""" +type GroupBulkCreatePayload { + """ + Created groups + """ + groups: [Group!] +} \ No newline at end of file diff --git a/schema/groupextended.graphql b/schema/groupextended.graphql new file mode 100644 index 0000000..c318f19 --- /dev/null +++ b/schema/groupextended.graphql @@ -0,0 +1,13 @@ +extend input CreateGroupInput { + createGroupSettings: CreateGroupSettingInput +} + +extend input UpdateGroupInput { + addGroupMembers: [CreateGroupMembershipInput!] + updateGroupSettings: UpdateGroupSettingInput +} + +extend input GroupMembershipWhereInput { + groupID: String + userID: String +} \ No newline at end of file diff --git a/schema/groupmembership.graphql b/schema/groupmembership.graphql new file mode 100644 index 0000000..6c50cd1 --- /dev/null +++ b/schema/groupmembership.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up groupMembership by ID + """ + groupMembership( + """ + ID of the groupMembership + """ + id: ID! + ): GroupMembership! +} + +extend type Mutation{ + """ + Create a new groupMembership + """ + createGroupMembership( + """ + values of the groupMembership + """ + input: CreateGroupMembershipInput! + ): GroupMembershipCreatePayload! + """ + Create multiple new groupMemberships + """ + createBulkGroupMembership( + """ + values of the groupMembership + """ + input: [CreateGroupMembershipInput!] + ): GroupMembershipBulkCreatePayload! + """ + Create multiple new groupMemberships via file upload + """ + createBulkCSVGroupMembership( + """ + csv file containing values of the groupMembership + """ + input: Upload! + ): GroupMembershipBulkCreatePayload! + """ + Update an existing groupMembership + """ + updateGroupMembership( + """ + ID of the groupMembership + """ + id: ID! + """ + New values for the groupMembership + """ + input: UpdateGroupMembershipInput! + ): GroupMembershipUpdatePayload! + """ + Delete an existing groupMembership + """ + deleteGroupMembership( + """ + ID of the groupMembership + """ + id: ID! + ): GroupMembershipDeletePayload! +} + +""" +Return response for createGroupMembership mutation +""" +type GroupMembershipCreatePayload { + """ + Created groupMembership + """ + groupMembership: GroupMembership! +} + +""" +Return response for updateGroupMembership mutation +""" +type GroupMembershipUpdatePayload { + """ + Updated groupMembership + """ + groupMembership: GroupMembership! +} + +""" +Return response for deleteGroupMembership mutation +""" +type GroupMembershipDeletePayload { + """ + Deleted groupMembership ID + """ + deletedID: ID! +} + +""" +Return response for createBulkGroupMembership mutation +""" +type GroupMembershipBulkCreatePayload { + """ + Created groupMemberships + """ + groupMemberships: [GroupMembership!] +} \ No newline at end of file diff --git a/schema/groupsetting.graphql b/schema/groupsetting.graphql new file mode 100644 index 0000000..c596d03 --- /dev/null +++ b/schema/groupsetting.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up groupSetting by ID + """ + groupSetting( + """ + ID of the groupSetting + """ + id: ID! + ): GroupSetting! +} + +extend type Mutation{ + """ + Create a new groupSetting + """ + createGroupSetting( + """ + values of the groupSetting + """ + input: CreateGroupSettingInput! + ): GroupSettingCreatePayload! + """ + Create multiple new groupSettings + """ + createBulkGroupSetting( + """ + values of the groupSetting + """ + input: [CreateGroupSettingInput!] + ): GroupSettingBulkCreatePayload! + """ + Create multiple new groupSettings via file upload + """ + createBulkCSVGroupSetting( + """ + csv file containing values of the groupSetting + """ + input: Upload! + ): GroupSettingBulkCreatePayload! + """ + Update an existing groupSetting + """ + updateGroupSetting( + """ + ID of the groupSetting + """ + id: ID! + """ + New values for the groupSetting + """ + input: UpdateGroupSettingInput! + ): GroupSettingUpdatePayload! + """ + Delete an existing groupSetting + """ + deleteGroupSetting( + """ + ID of the groupSetting + """ + id: ID! + ): GroupSettingDeletePayload! +} + +""" +Return response for createGroupSetting mutation +""" +type GroupSettingCreatePayload { + """ + Created groupSetting + """ + groupSetting: GroupSetting! +} + +""" +Return response for updateGroupSetting mutation +""" +type GroupSettingUpdatePayload { + """ + Updated groupSetting + """ + groupSetting: GroupSetting! +} + +""" +Return response for deleteGroupSetting mutation +""" +type GroupSettingDeletePayload { + """ + Deleted groupSetting ID + """ + deletedID: ID! +} + +""" +Return response for createBulkGroupSetting mutation +""" +type GroupSettingBulkCreatePayload { + """ + Created groupSettings + """ + groupSettings: [GroupSetting!] +} \ No newline at end of file diff --git a/schema/hush.graphql b/schema/hush.graphql new file mode 100644 index 0000000..7910978 --- /dev/null +++ b/schema/hush.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up hush by ID + """ + hush( + """ + ID of the hush + """ + id: ID! + ): Hush! +} + +extend type Mutation{ + """ + Create a new hush + """ + createHush( + """ + values of the hush + """ + input: CreateHushInput! + ): HushCreatePayload! + """ + Create multiple new hushs + """ + createBulkHush( + """ + values of the hush + """ + input: [CreateHushInput!] + ): HushBulkCreatePayload! + """ + Create multiple new hushs via file upload + """ + createBulkCSVHush( + """ + csv file containing values of the hush + """ + input: Upload! + ): HushBulkCreatePayload! + """ + Update an existing hush + """ + updateHush( + """ + ID of the hush + """ + id: ID! + """ + New values for the hush + """ + input: UpdateHushInput! + ): HushUpdatePayload! + """ + Delete an existing hush + """ + deleteHush( + """ + ID of the hush + """ + id: ID! + ): HushDeletePayload! +} + +""" +Return response for createHush mutation +""" +type HushCreatePayload { + """ + Created hush + """ + hush: Hush! +} + +""" +Return response for updateHush mutation +""" +type HushUpdatePayload { + """ + Updated hush + """ + hush: Hush! +} + +""" +Return response for deleteHush mutation +""" +type HushDeletePayload { + """ + Deleted hush ID + """ + deletedID: ID! +} + +""" +Return response for createBulkHush mutation +""" +type HushBulkCreatePayload { + """ + Created hushs + """ + hushes: [Hush!] +} \ No newline at end of file diff --git a/schema/integration.graphql b/schema/integration.graphql new file mode 100644 index 0000000..e98e612 --- /dev/null +++ b/schema/integration.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up integration by ID + """ + integration( + """ + ID of the integration + """ + id: ID! + ): Integration! +} + +extend type Mutation{ + """ + Create a new integration + """ + createIntegration( + """ + values of the integration + """ + input: CreateIntegrationInput! + ): IntegrationCreatePayload! + """ + Create multiple new integrations + """ + createBulkIntegration( + """ + values of the integration + """ + input: [CreateIntegrationInput!] + ): IntegrationBulkCreatePayload! + """ + Create multiple new integrations via file upload + """ + createBulkCSVIntegration( + """ + csv file containing values of the integration + """ + input: Upload! + ): IntegrationBulkCreatePayload! + """ + Update an existing integration + """ + updateIntegration( + """ + ID of the integration + """ + id: ID! + """ + New values for the integration + """ + input: UpdateIntegrationInput! + ): IntegrationUpdatePayload! + """ + Delete an existing integration + """ + deleteIntegration( + """ + ID of the integration + """ + id: ID! + ): IntegrationDeletePayload! +} + +""" +Return response for createIntegration mutation +""" +type IntegrationCreatePayload { + """ + Created integration + """ + integration: Integration! +} + +""" +Return response for updateIntegration mutation +""" +type IntegrationUpdatePayload { + """ + Updated integration + """ + integration: Integration! +} + +""" +Return response for deleteIntegration mutation +""" +type IntegrationDeletePayload { + """ + Deleted integration ID + """ + deletedID: ID! +} + +""" +Return response for createBulkIntegration mutation +""" +type IntegrationBulkCreatePayload { + """ + Created integrations + """ + integrations: [Integration!] +} \ No newline at end of file diff --git a/schema/invite.graphql b/schema/invite.graphql new file mode 100644 index 0000000..304b11a --- /dev/null +++ b/schema/invite.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up invite by ID + """ + invite( + """ + ID of the invite + """ + id: ID! + ): Invite! +} + +extend type Mutation{ + """ + Create a new invite + """ + createInvite( + """ + values of the invite + """ + input: CreateInviteInput! + ): InviteCreatePayload! + """ + Create multiple new invites + """ + createBulkInvite( + """ + values of the invite + """ + input: [CreateInviteInput!] + ): InviteBulkCreatePayload! + """ + Create multiple new invites via file upload + """ + createBulkCSVInvite( + """ + csv file containing values of the invite + """ + input: Upload! + ): InviteBulkCreatePayload! + """ + Update an existing invite + """ + updateInvite( + """ + ID of the invite + """ + id: ID! + """ + New values for the invite + """ + input: UpdateInviteInput! + ): InviteUpdatePayload! + """ + Delete an existing invite + """ + deleteInvite( + """ + ID of the invite + """ + id: ID! + ): InviteDeletePayload! +} + +""" +Return response for createInvite mutation +""" +type InviteCreatePayload { + """ + Created invite + """ + invite: Invite! +} + +""" +Return response for updateInvite mutation +""" +type InviteUpdatePayload { + """ + Updated invite + """ + invite: Invite! +} + +""" +Return response for deleteInvite mutation +""" +type InviteDeletePayload { + """ + Deleted invite ID + """ + deletedID: ID! +} + +""" +Return response for createBulkInvite mutation +""" +type InviteBulkCreatePayload { + """ + Created invites + """ + invites: [Invite!] +} \ No newline at end of file diff --git a/schema/oauthprovider.graphql b/schema/oauthprovider.graphql new file mode 100644 index 0000000..2953cd1 --- /dev/null +++ b/schema/oauthprovider.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up oauthProvider by ID + """ + oauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + ): OauthProvider! +} + +extend type Mutation{ + """ + Create a new oauthProvider + """ + createOauthProvider( + """ + values of the oauthProvider + """ + input: CreateOauthProviderInput! + ): OauthProviderCreatePayload! + """ + Create multiple new oauthProviders + """ + createBulkOauthProvider( + """ + values of the oauthProvider + """ + input: [CreateOauthProviderInput!] + ): OauthProviderBulkCreatePayload! + """ + Create multiple new oauthProviders via file upload + """ + createBulkCSVOauthProvider( + """ + csv file containing values of the oauthProvider + """ + input: Upload! + ): OauthProviderBulkCreatePayload! + """ + Update an existing oauthProvider + """ + updateOauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + """ + New values for the oauthProvider + """ + input: UpdateOauthProviderInput! + ): OauthProviderUpdatePayload! + """ + Delete an existing oauthProvider + """ + deleteOauthProvider( + """ + ID of the oauthProvider + """ + id: ID! + ): OauthProviderDeletePayload! +} + +""" +Return response for createOauthProvider mutation +""" +type OauthProviderCreatePayload { + """ + Created oauthProvider + """ + oauthProvider: OauthProvider! +} + +""" +Return response for updateOauthProvider mutation +""" +type OauthProviderUpdatePayload { + """ + Updated oauthProvider + """ + oauthProvider: OauthProvider! +} + +""" +Return response for deleteOauthProvider mutation +""" +type OauthProviderDeletePayload { + """ + Deleted oauthProvider ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOauthProvider mutation +""" +type OauthProviderBulkCreatePayload { + """ + Created oauthProviders + """ + oauthProviders: [OauthProvider!] +} \ No newline at end of file diff --git a/schema/ohauthtootoken.graphql b/schema/ohauthtootoken.graphql new file mode 100644 index 0000000..d5ef68b --- /dev/null +++ b/schema/ohauthtootoken.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up ohAuthTooToken by ID + """ + ohAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + ): OhAuthTooToken! +} + +extend type Mutation{ + """ + Create a new ohAuthTooToken + """ + createOhAuthTooToken( + """ + values of the ohAuthTooToken + """ + input: CreateOhAuthTooTokenInput! + ): OhAuthTooTokenCreatePayload! + """ + Create multiple new ohAuthTooTokens + """ + createBulkOhAuthTooToken( + """ + values of the ohAuthTooToken + """ + input: [CreateOhAuthTooTokenInput!] + ): OhAuthTooTokenBulkCreatePayload! + """ + Create multiple new ohAuthTooTokens via file upload + """ + createBulkCSVOhAuthTooToken( + """ + csv file containing values of the ohAuthTooToken + """ + input: Upload! + ): OhAuthTooTokenBulkCreatePayload! + """ + Update an existing ohAuthTooToken + """ + updateOhAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + """ + New values for the ohAuthTooToken + """ + input: UpdateOhAuthTooTokenInput! + ): OhAuthTooTokenUpdatePayload! + """ + Delete an existing ohAuthTooToken + """ + deleteOhAuthTooToken( + """ + ID of the ohAuthTooToken + """ + id: ID! + ): OhAuthTooTokenDeletePayload! +} + +""" +Return response for createOhAuthTooToken mutation +""" +type OhAuthTooTokenCreatePayload { + """ + Created ohAuthTooToken + """ + ohAuthTooToken: OhAuthTooToken! +} + +""" +Return response for updateOhAuthTooToken mutation +""" +type OhAuthTooTokenUpdatePayload { + """ + Updated ohAuthTooToken + """ + ohAuthTooToken: OhAuthTooToken! +} + +""" +Return response for deleteOhAuthTooToken mutation +""" +type OhAuthTooTokenDeletePayload { + """ + Deleted ohAuthTooToken ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOhAuthTooToken mutation +""" +type OhAuthTooTokenBulkCreatePayload { + """ + Created ohAuthTooTokens + """ + ohAuthTooTokens: [OhAuthTooToken!] +} \ No newline at end of file diff --git a/schema/organization.graphql b/schema/organization.graphql new file mode 100644 index 0000000..aa137e7 --- /dev/null +++ b/schema/organization.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up organization by ID + """ + organization( + """ + ID of the organization + """ + id: ID! + ): Organization! +} + +extend type Mutation{ + """ + Create a new organization + """ + createOrganization( + """ + values of the organization + """ + input: CreateOrganizationInput! + ): OrganizationCreatePayload! + """ + Create multiple new organizations + """ + createBulkOrganization( + """ + values of the organization + """ + input: [CreateOrganizationInput!] + ): OrganizationBulkCreatePayload! + """ + Create multiple new organizations via file upload + """ + createBulkCSVOrganization( + """ + csv file containing values of the organization + """ + input: Upload! + ): OrganizationBulkCreatePayload! + """ + Update an existing organization + """ + updateOrganization( + """ + ID of the organization + """ + id: ID! + """ + New values for the organization + """ + input: UpdateOrganizationInput! + ): OrganizationUpdatePayload! + """ + Delete an existing organization + """ + deleteOrganization( + """ + ID of the organization + """ + id: ID! + ): OrganizationDeletePayload! +} + +""" +Return response for createOrganization mutation +""" +type OrganizationCreatePayload { + """ + Created organization + """ + organization: Organization! +} + +""" +Return response for updateOrganization mutation +""" +type OrganizationUpdatePayload { + """ + Updated organization + """ + organization: Organization! +} + +""" +Return response for deleteOrganization mutation +""" +type OrganizationDeletePayload { + """ + Deleted organization ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOrganization mutation +""" +type OrganizationBulkCreatePayload { + """ + Created organizations + """ + organizations: [Organization!] +} \ No newline at end of file diff --git a/schema/organizationsetting.graphql b/schema/organizationsetting.graphql new file mode 100644 index 0000000..00859eb --- /dev/null +++ b/schema/organizationsetting.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up organizationSetting by ID + """ + organizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + ): OrganizationSetting! +} + +extend type Mutation{ + """ + Create a new organizationSetting + """ + createOrganizationSetting( + """ + values of the organizationSetting + """ + input: CreateOrganizationSettingInput! + ): OrganizationSettingCreatePayload! + """ + Create multiple new organizationSettings + """ + createBulkOrganizationSetting( + """ + values of the organizationSetting + """ + input: [CreateOrganizationSettingInput!] + ): OrganizationSettingBulkCreatePayload! + """ + Create multiple new organizationSettings via file upload + """ + createBulkCSVOrganizationSetting( + """ + csv file containing values of the organizationSetting + """ + input: Upload! + ): OrganizationSettingBulkCreatePayload! + """ + Update an existing organizationSetting + """ + updateOrganizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + """ + New values for the organizationSetting + """ + input: UpdateOrganizationSettingInput! + ): OrganizationSettingUpdatePayload! + """ + Delete an existing organizationSetting + """ + deleteOrganizationSetting( + """ + ID of the organizationSetting + """ + id: ID! + ): OrganizationSettingDeletePayload! +} + +""" +Return response for createOrganizationSetting mutation +""" +type OrganizationSettingCreatePayload { + """ + Created organizationSetting + """ + organizationSetting: OrganizationSetting! +} + +""" +Return response for updateOrganizationSetting mutation +""" +type OrganizationSettingUpdatePayload { + """ + Updated organizationSetting + """ + organizationSetting: OrganizationSetting! +} + +""" +Return response for deleteOrganizationSetting mutation +""" +type OrganizationSettingDeletePayload { + """ + Deleted organizationSetting ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOrganizationSetting mutation +""" +type OrganizationSettingBulkCreatePayload { + """ + Created organizationSettings + """ + organizationSettings: [OrganizationSetting!] +} \ No newline at end of file diff --git a/schema/orgextended.graphql b/schema/orgextended.graphql new file mode 100644 index 0000000..c64d636 --- /dev/null +++ b/schema/orgextended.graphql @@ -0,0 +1,13 @@ +extend input CreateOrganizationInput { + createOrgSettings: CreateOrganizationSettingInput +} + +extend input UpdateOrganizationInput { + addOrgMembers: [CreateOrgMembershipInput!] + updateOrgSettings: UpdateOrganizationSettingInput +} + +extend input OrgMembershipWhereInput { + organizationID: String + userID: String +} \ No newline at end of file diff --git a/schema/orgmembership.graphql b/schema/orgmembership.graphql new file mode 100644 index 0000000..7d22632 --- /dev/null +++ b/schema/orgmembership.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up orgMembership by ID + """ + orgMembership( + """ + ID of the orgMembership + """ + id: ID! + ): OrgMembership! +} + +extend type Mutation{ + """ + Create a new orgMembership + """ + createOrgMembership( + """ + values of the orgMembership + """ + input: CreateOrgMembershipInput! + ): OrgMembershipCreatePayload! + """ + Create multiple new orgMemberships + """ + createBulkOrgMembership( + """ + values of the orgMembership + """ + input: [CreateOrgMembershipInput!] + ): OrgMembershipBulkCreatePayload! + """ + Create multiple new orgMemberships via file upload + """ + createBulkCSVOrgMembership( + """ + csv file containing values of the orgMembership + """ + input: Upload! + ): OrgMembershipBulkCreatePayload! + """ + Update an existing orgMembership + """ + updateOrgMembership( + """ + ID of the orgMembership + """ + id: ID! + """ + New values for the orgMembership + """ + input: UpdateOrgMembershipInput! + ): OrgMembershipUpdatePayload! + """ + Delete an existing orgMembership + """ + deleteOrgMembership( + """ + ID of the orgMembership + """ + id: ID! + ): OrgMembershipDeletePayload! +} + +""" +Return response for createOrgMembership mutation +""" +type OrgMembershipCreatePayload { + """ + Created orgMembership + """ + orgMembership: OrgMembership! +} + +""" +Return response for updateOrgMembership mutation +""" +type OrgMembershipUpdatePayload { + """ + Updated orgMembership + """ + orgMembership: OrgMembership! +} + +""" +Return response for deleteOrgMembership mutation +""" +type OrgMembershipDeletePayload { + """ + Deleted orgMembership ID + """ + deletedID: ID! +} + +""" +Return response for createBulkOrgMembership mutation +""" +type OrgMembershipBulkCreatePayload { + """ + Created orgMemberships + """ + orgMemberships: [OrgMembership!] +} \ No newline at end of file diff --git a/schema/personalaccesstoken.graphql b/schema/personalaccesstoken.graphql new file mode 100644 index 0000000..c7abdf3 --- /dev/null +++ b/schema/personalaccesstoken.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up personalAccessToken by ID + """ + personalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + ): PersonalAccessToken! +} + +extend type Mutation{ + """ + Create a new personalAccessToken + """ + createPersonalAccessToken( + """ + values of the personalAccessToken + """ + input: CreatePersonalAccessTokenInput! + ): PersonalAccessTokenCreatePayload! + """ + Create multiple new personalAccessTokens + """ + createBulkPersonalAccessToken( + """ + values of the personalAccessToken + """ + input: [CreatePersonalAccessTokenInput!] + ): PersonalAccessTokenBulkCreatePayload! + """ + Create multiple new personalAccessTokens via file upload + """ + createBulkCSVPersonalAccessToken( + """ + csv file containing values of the personalAccessToken + """ + input: Upload! + ): PersonalAccessTokenBulkCreatePayload! + """ + Update an existing personalAccessToken + """ + updatePersonalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + """ + New values for the personalAccessToken + """ + input: UpdatePersonalAccessTokenInput! + ): PersonalAccessTokenUpdatePayload! + """ + Delete an existing personalAccessToken + """ + deletePersonalAccessToken( + """ + ID of the personalAccessToken + """ + id: ID! + ): PersonalAccessTokenDeletePayload! +} + +""" +Return response for createPersonalAccessToken mutation +""" +type PersonalAccessTokenCreatePayload { + """ + Created personalAccessToken + """ + personalAccessToken: PersonalAccessToken! +} + +""" +Return response for updatePersonalAccessToken mutation +""" +type PersonalAccessTokenUpdatePayload { + """ + Updated personalAccessToken + """ + personalAccessToken: PersonalAccessToken! +} + +""" +Return response for deletePersonalAccessToken mutation +""" +type PersonalAccessTokenDeletePayload { + """ + Deleted personalAccessToken ID + """ + deletedID: ID! +} + +""" +Return response for createBulkPersonalAccessToken mutation +""" +type PersonalAccessTokenBulkCreatePayload { + """ + Created personalAccessTokens + """ + personalAccessTokens: [PersonalAccessToken!] +} \ No newline at end of file diff --git a/schema/scalars.graphql b/schema/scalars.graphql new file mode 100644 index 0000000..fca9ea1 --- /dev/null +++ b/schema/scalars.graphql @@ -0,0 +1 @@ +scalar Upload \ No newline at end of file diff --git a/schema/search.graphql b/schema/search.graphql new file mode 100644 index 0000000..36c7eb2 --- /dev/null +++ b/schema/search.graphql @@ -0,0 +1,42 @@ +union GlobalSearchResult = + | OrganizationSearchResult + | GroupSearchResult + | UserSearchResult + | SubscriberSearchResult + + + +type OrganizationSearchResult { + organizations: [Organization!] +} + +type GroupSearchResult { + groups: [Group!] +} + +type UserSearchResult { + users: [User!] +} + +type SubscriberSearchResult { + subscribers: [Subscriber!] +} + +type GlobalSearchResultConnection { + page: PageInfo! + + nodes: [GlobalSearchResult!]! +} + + +extend type Query{ + """ + Search across organizations, groups, and users + """ + search( + """ + Search query + """ + query: String! + ): GlobalSearchResultConnection +} diff --git a/schema/subscriber.graphql b/schema/subscriber.graphql new file mode 100644 index 0000000..b8cf0f0 --- /dev/null +++ b/schema/subscriber.graphql @@ -0,0 +1,108 @@ +extend type Query { + """ + Look up subscriber by Email + """ + subscriber( + """ + Email of the subscriber + """ + email: String! + ): Subscriber! +} + +extend type Mutation{ + """ + Create a new subscriber + """ + createSubscriber( + """ + values of the subscriber + """ + input: CreateSubscriberInput! + ): SubscriberCreatePayload! + """ + Create new subscribers + """ + createBulkSubscriber( + """ + values of the subscriber + """ + input: [CreateSubscriberInput!] + ): SubscriberBulkCreatePayload! + """ + Create new subscribers via CSV file + """ + createBulkCSVSubscriber( + """ + values of the subscriber + """ + input: Upload! + ): SubscriberBulkCreatePayload! + """ + Update an existing subscriber + """ + updateSubscriber( + """ + Email of the subscriber + """ + email: String! + """ + New values for the subscriber + """ + input: UpdateSubscriberInput! + ): SubscriberUpdatePayload! + """ + Delete an existing subscriber by Email + """ + deleteSubscriber( + """ + Email of the subscriber + """ + email: String! + """ + OwnerID of the subscriber + """ + ownerID: ID + ): SubscriberDeletePayload! +} + +""" +Return response for createSubscriber mutation +""" +type SubscriberCreatePayload { + """ + Created subscriber + """ + subscriber: Subscriber! +} + +""" +Return response for updateSubscriber mutation +""" +type SubscriberUpdatePayload { + """ + Updated subscriber + """ + subscriber: Subscriber! +} + +""" +Return response for deleteSubscriber mutation +""" +type SubscriberDeletePayload { + """ + Deleted subscriber email + """ + email: String! +} + +""" +Return response for createBulkSubscriber mutation +""" +type SubscriberBulkCreatePayload { + """ + Created subscribers + """ + subscribers: [Subscriber!] +} + diff --git a/schema/template.graphql b/schema/template.graphql new file mode 100644 index 0000000..12409b9 --- /dev/null +++ b/schema/template.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up template by ID + """ + template( + """ + ID of the template + """ + id: ID! + ): Template! +} + +extend type Mutation{ + """ + Create a new template + """ + createTemplate( + """ + values of the template + """ + input: CreateTemplateInput! + ): TemplateCreatePayload! + """ + Create multiple new templates + """ + createBulkTemplate( + """ + values of the template + """ + input: [CreateTemplateInput!] + ): TemplateBulkCreatePayload! + """ + Create multiple new templates via file upload + """ + createBulkCSVTemplate( + """ + csv file containing values of the template + """ + input: Upload! + ): TemplateBulkCreatePayload! + """ + Update an existing template + """ + updateTemplate( + """ + ID of the template + """ + id: ID! + """ + New values for the template + """ + input: UpdateTemplateInput! + ): TemplateUpdatePayload! + """ + Delete an existing template + """ + deleteTemplate( + """ + ID of the template + """ + id: ID! + ): TemplateDeletePayload! +} + +""" +Return response for createTemplate mutation +""" +type TemplateCreatePayload { + """ + Created template + """ + template: Template! +} + +""" +Return response for updateTemplate mutation +""" +type TemplateUpdatePayload { + """ + Updated template + """ + template: Template! +} + +""" +Return response for deleteTemplate mutation +""" +type TemplateDeletePayload { + """ + Deleted template ID + """ + deletedID: ID! +} + +""" +Return response for createBulkTemplate mutation +""" +type TemplateBulkCreatePayload { + """ + Created templates + """ + templates: [Template!] +} \ No newline at end of file diff --git a/schema/tfasetting.graphql b/schema/tfasetting.graphql new file mode 100644 index 0000000..6ff7d32 --- /dev/null +++ b/schema/tfasetting.graphql @@ -0,0 +1,59 @@ +extend type Query { + """ + Look up tfaSetting for the current user + """ + tfaSetting( + """ + ID of the tfaSetting + """ + id: ID + ): TFASetting! +} + +extend type Mutation{ + """ + Create a new tfaSetting + """ + createTFASetting( + """ + values of the tfaSetting + """ + input: CreateTFASettingInput! + ): TFASettingCreatePayload! + """ + Update an existing tfaSetting + """ + updateTFASetting( + """ + New values for the tfaSetting + """ + input: UpdateTFASettingInput! + ): TFASettingUpdatePayload! +} + +""" +Return response for createTFASetting mutation +""" +type TFASettingCreatePayload { + """ + Created tfaSetting + """ + tfaSetting: TFASetting! +} + +""" +Return response for updateTFASetting mutation +""" +type TFASettingUpdatePayload { + """ + Updated tfaSetting + """ + tfaSetting: TFASetting! +} + +extend input UpdateTFASettingInput { + """ + Whether to regenerate backup codes + """ + regenBackupCodes: Boolean +} \ No newline at end of file diff --git a/schema/user.graphql b/schema/user.graphql new file mode 100644 index 0000000..742fbbc --- /dev/null +++ b/schema/user.graphql @@ -0,0 +1,85 @@ +extend type Query { + """ + Look up user by ID + """ + user( + """ + ID of the user + """ + id: ID! + ): User! +} + +extend type Mutation{ + """ + Create a new user + """ + createUser( + """ + values of the user + """ + input: CreateUserInput! + ): UserCreatePayload! + """ + Update an existing user + """ + updateUser( + """ + ID of the user + """ + id: ID! + """ + New values for the user + """ + input: UpdateUserInput! + ): UserUpdatePayload! + """ + Delete an existing user + """ + deleteUser( + """ + ID of the user + """ + id: ID! + ): UserDeletePayload! +} + +""" +Return response for createUser mutation +""" +type UserCreatePayload { + """ + Created user + """ + user: User! +} + +""" +Return response for updateUser mutation +""" +type UserUpdatePayload { + """ + Updated user + """ + user: User! +} + +""" +Return response for deleteUser mutation +""" +type UserDeletePayload { + """ + Deleted user ID + """ + deletedID: ID! +} + +""" +Return response for createBulkUser mutation +""" +type UserBulkCreatePayload { + """ + Created users + """ + users: [User!] +} \ No newline at end of file diff --git a/schema/usersetting.graphql b/schema/usersetting.graphql new file mode 100644 index 0000000..a3d08f0 --- /dev/null +++ b/schema/usersetting.graphql @@ -0,0 +1,84 @@ +extend type Query { + """ + Look up userSetting by ID + """ + userSetting( + """ + ID of the userSetting + """ + id: ID! + ): UserSetting! +} + +extend type Mutation{ + """ + Create a new userSetting + """ + createUserSetting( + """ + values of the userSetting + """ + input: CreateUserSettingInput! + ): UserSettingCreatePayload! + """ + Create multiple new userSettings + """ + createBulkUserSetting( + """ + values of the userSetting + """ + input: [CreateUserSettingInput!] + ): UserSettingBulkCreatePayload! + """ + Create multiple new userSettings via file upload + """ + createBulkCSVUserSetting( + """ + csv file containing values of the userSetting + """ + input: Upload! + ): UserSettingBulkCreatePayload! + """ + Update an existing userSetting + """ + updateUserSetting( + """ + ID of the userSetting + """ + id: ID! + """ + New values for the userSetting + """ + input: UpdateUserSettingInput! + ): UserSettingUpdatePayload! +} + +""" +Return response for createUserSetting mutation +""" +type UserSettingCreatePayload { + """ + Created userSetting + """ + userSetting: UserSetting! +} + +""" +Return response for updateUserSetting mutation +""" +type UserSettingUpdatePayload { + """ + Updated userSetting + """ + userSetting: UserSetting! +} + +""" +Return response for createBulkUserSetting mutation +""" +type UserSettingBulkCreatePayload { + """ + Created userSettings + """ + userSettings: [UserSetting!] +} \ No newline at end of file diff --git a/schema/webhook.graphql b/schema/webhook.graphql new file mode 100644 index 0000000..5276e7a --- /dev/null +++ b/schema/webhook.graphql @@ -0,0 +1,103 @@ +extend type Query { + """ + Look up webhook by ID + """ + webhook( + """ + ID of the webhook + """ + id: ID! + ): Webhook! +} + +extend type Mutation{ + """ + Create a new webhook + """ + createWebhook( + """ + values of the webhook + """ + input: CreateWebhookInput! + ): WebhookCreatePayload! + """ + Create multiple new webhooks + """ + createBulkWebhook( + """ + values of the webhook + """ + input: [CreateWebhookInput!] + ): WebhookBulkCreatePayload! + """ + Create multiple new webhooks via file upload + """ + createBulkCSVWebhook( + """ + csv file containing values of the webhook + """ + input: Upload! + ): WebhookBulkCreatePayload! + """ + Update an existing webhook + """ + updateWebhook( + """ + ID of the webhook + """ + id: ID! + """ + New values for the webhook + """ + input: UpdateWebhookInput! + ): WebhookUpdatePayload! + """ + Delete an existing webhook + """ + deleteWebhook( + """ + ID of the webhook + """ + id: ID! + ): WebhookDeletePayload! +} + +""" +Return response for createWebhook mutation +""" +type WebhookCreatePayload { + """ + Created webhook + """ + webhook: Webhook! +} + +""" +Return response for updateWebhook mutation +""" +type WebhookUpdatePayload { + """ + Updated webhook + """ + webhook: Webhook! +} + +""" +Return response for deleteWebhook mutation +""" +type WebhookDeletePayload { + """ + Deleted webhook ID + """ + deletedID: ID! +} + +""" +Return response for createBulkWebhook mutation +""" +type WebhookBulkCreatePayload { + """ + Created webhooks + """ + webhooks: [Webhook!] +} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..5833a0f --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,16 @@ +sonar.projectKey=theopenlane_core +sonar.organization=theopenlane + +sonar.projectName=core +sonar.projectVersion=1.0 + +sonar.sources=. + +sonar.exclusions=**/*_test.go,**/vendor/**,internal/ent/generated/**,query/**,schema/**,scripts/**,gen_schema.go,generate.go,tools.go,docker/**,db/**,db/backup/**,internal/graphapi/gen_server.go,internal/ent/entc.go,pkg/testutils/**,pkg/utils/emails/mock/**,pkg/utils/emails/templates/**,pkg/utils/emails/testdata,pkg/utils/totp/testing/**,pkg/events/soiree/examples/** +sonar.tests=. +sonar.test.inclusions=**/*_test.go +sonar.test.exclusions=**/vendor/** + +sonar.sourceEncoding=UTF-8 +sonar.go.coverage.reportPaths=coverage.out +sonar.externalIssuesReportPaths=results.txt \ No newline at end of file diff --git a/tools.go b/tools.go new file mode 100644 index 0000000..3d5950b --- /dev/null +++ b/tools.go @@ -0,0 +1,13 @@ +//go:build tools +// +build tools + +package tools + +import ( + _ "entgo.io/ent" + _ "github.com/99designs/gqlgen" + _ "github.com/99designs/gqlgen/graphql/introspection" + _ "github.com/Yamashou/gqlgenc" + _ "github.com/openfga/go-sdk" + _ "github.com/theopenlane/iam/fgax/mockery" +)